From: Fabio Lodato Date: Tue, 31 Mar 2020 14:22:21 +0000 (+0200) Subject: Built motion from commit (unavailable).|2.4.12 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css/%22javascript:;/%22card-image.png//%27?a=commitdiff_plain;h=a7f61cb48865b71e9e1bbb833acf66a886a7ac60;p=motion2.git Built motion from commit (unavailable).|2.4.12 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 9f85cf0..53f9570 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-03-31T10:56:51.522Z", + "time": "2020-03-31T14:04:37.425Z", "url": "http://apidocjs.com", "version": "0.17.7" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 96fb10d..0edc896 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2020-03-31T10:56:51.522Z", + "time": "2020-03-31T14:04:37.425Z", "url": "http://apidocjs.com", "version": "0.17.7" } diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js index cededd8..e837fe8 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 _0xe892=['VIRTUAL','STRING','integration','motionbar','jscripty','urlForward','browser','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]','TEXT','sequelize','exports'];(function(_0x5a43bf,_0x40f481){var _0x1aeea3=function(_0x2b9f62){while(--_0x2b9f62){_0x5a43bf['push'](_0x5a43bf['shift']());}};_0x1aeea3(++_0x40f481);}(_0xe892,0x1da));var _0x2e89=function(_0x405cc5,_0xf716d){_0x405cc5=_0x405cc5-0x0;var _0x2a1a69=_0xe892[_0x405cc5];return _0x2a1a69;};'use strict';var Sequelize=require(_0x2e89('0x0'));module[_0x2e89('0x1')]={'name':{'type':Sequelize[_0x2e89('0x2')],'get':function(_0x2544d2){return this['getDataValue']('action');}},'action':{'type':Sequelize[_0x2e89('0x3')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0x2e89('0x4'),_0x2e89('0x5'),_0x2e89('0x6'),_0x2e89('0x7'),_0x2e89('0x8'),'bot',_0x2e89('0x9')]],'msg':_0x2e89('0xa')}},'comment':_0x2e89('0xa')},'data1':{'type':Sequelize[_0x2e89('0x3')](0x1000),'comment':_0x2e89('0xb')},'data2':{'type':Sequelize[_0x2e89('0x3')](0x1000),'comment':_0x2e89('0xc')},'data3':{'type':Sequelize[_0x2e89('0x3')](0x1000),'comment':'motionbar[NULL,NULL,WinAppArguments]'},'data4':{'type':Sequelize[_0x2e89('0x3')](0x1000)},'data5':{'type':Sequelize[_0x2e89('0x3')](0x1000)},'data6':{'type':Sequelize[_0x2e89('0x3')]},'data7':{'type':Sequelize[_0x2e89('0xd')]}}; \ No newline at end of file +var _0xd8c3=['jscripty','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','motionbar[NULL,NULL,WinAppArguments]','TEXT','sequelize','VIRTUAL','getDataValue','contactManager','motionbar'];(function(_0x4bec11,_0x8d7565){var _0x19b44f=function(_0xcdb5e5){while(--_0xcdb5e5){_0x4bec11['push'](_0x4bec11['shift']());}};_0x19b44f(++_0x8d7565);}(_0xd8c3,0x183));var _0x3d8c=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xd8c3[_0x1d1779];return _0x2377e9;};'use strict';var Sequelize=require(_0x3d8c('0x0'));module['exports']={'name':{'type':Sequelize[_0x3d8c('0x1')],'get':function(_0x3d25af){return this[_0x3d8c('0x2')]('action');}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x3d8c('0x3'),'integration',_0x3d8c('0x4'),_0x3d8c('0x5'),'urlForward',_0x3d8c('0x6'),_0x3d8c('0x7'),_0x3d8c('0x8')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x3d8c('0x9')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':'contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]'},'data2':{'type':Sequelize[_0x3d8c('0xa')](0x1000),'comment':_0x3d8c('0xb')},'data3':{'type':Sequelize[_0x3d8c('0xa')](0x1000),'comment':_0x3d8c('0xc')},'data4':{'type':Sequelize['STRING'](0x1000)},'data5':{'type':Sequelize['STRING'](0x1000)},'data6':{'type':Sequelize[_0x3d8c('0xa')]},'data7':{'type':Sequelize[_0x3d8c('0xd')]}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 0ec0961..501a11e 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 _0xd8b0=['moment','bluebird','mustache','util','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','body','Action','params','destroy','find','html-pdf','eml-format','request-promise'];(function(_0x497e3b,_0x610331){var _0x2a2e5e=function(_0x3d92dd){while(--_0x3d92dd){_0x497e3b['push'](_0x497e3b['shift']());}};_0x2a2e5e(++_0x610331);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var pdf=require(_0x0d8b('0x0'));var emlformat=require(_0x0d8b('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0d8b('0x2'));var moment=require(_0x0d8b('0x3'));var BPromise=require(_0x0d8b('0x4'));var Mustache=require(_0x0d8b('0x5'));var util=require(_0x0d8b('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x0d8b('0x7'));var ejs=require(_0x0d8b('0x8'));var fs=require('fs');var _=require(_0x0d8b('0x9'));var squel=require('squel');var crypto=require(_0x0d8b('0xa'));var jsforce=require(_0x0d8b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0d8b('0x7'));var querystring=require(_0x0d8b('0xc'));var Papa=require(_0x0d8b('0xd'));var Redis=require(_0x0d8b('0xe'));var authService=require(_0x0d8b('0xf'));var qs=require(_0x0d8b('0x10'));var as=require(_0x0d8b('0x11'));var hardwareService=require(_0x0d8b('0x12'));var logger=require('../../config/logger')(_0x0d8b('0x13'));var utils=require('../../config/utils');var config=require(_0x0d8b('0x14'));var db=require(_0x0d8b('0x15'))['db'];function respondWithStatusCode(_0x340cc4,_0x92cdd8){_0x92cdd8=_0x92cdd8||0xcc;return function(_0x35a07b){if(_0x35a07b){return _0x340cc4[_0x0d8b('0x16')](_0x92cdd8);}return _0x340cc4[_0x0d8b('0x17')](_0x92cdd8)[_0x0d8b('0x18')]();};}function respondWithResult(_0x1d4bbc,_0x2ce75e){_0x2ce75e=_0x2ce75e||0xc8;return function(_0x5ad086){if(_0x5ad086){return _0x1d4bbc[_0x0d8b('0x17')](_0x2ce75e)[_0x0d8b('0x19')](_0x5ad086);}};}function respondWithFilteredResult(_0x2d4e1c,_0x4f6f21){return function(_0x23eb7b){if(_0x23eb7b){var _0xa86349=_0x23eb7b['count'],_0x17f7df=_0x4f6f21[_0x0d8b('0x1a')],_0xe2e167=_0x4f6f21[_0x0d8b('0x1a')]+_0x4f6f21[_0x0d8b('0x1b')],_0x2cb03c;if(_0xe2e167>=_0xa86349){_0xe2e167=_0xa86349;_0x2cb03c=0xc8;}else{_0x2cb03c=0xce;}_0x2d4e1c[_0x0d8b('0x17')](_0x2cb03c);return _0x2d4e1c[_0x0d8b('0x1c')](_0x0d8b('0x1d'),_0x17f7df+'-'+_0xe2e167+'/'+_0xa86349)[_0x0d8b('0x19')](_0x23eb7b);}return null;};}function patchUpdates(_0xa3612a){return function(_0x4a15bf){try{jsonpatch[_0x0d8b('0x1e')](_0x4a15bf,_0xa3612a,!![]);}catch(_0x23d58f){return BPromise[_0x0d8b('0x1f')](_0x23d58f);}return _0x4a15bf[_0x0d8b('0x20')]();};}function saveUpdates(_0x24e8ed,_0x5b709c){return function(_0x393beb){if(_0x393beb){return _0x393beb[_0x0d8b('0x21')](_0x24e8ed)['then'](function(_0x4f0a1a){return _0x4f0a1a;});}return null;};}function removeEntity(_0x33fb87,_0x54a9a7){return function(_0x56c729){if(_0x56c729){return _0x56c729['destroy']()[_0x0d8b('0x22')](function(){_0x33fb87[_0x0d8b('0x17')](0xcc)[_0x0d8b('0x18')]();});}};}function handleEntityNotFound(_0x38efc8,_0x221071){return function(_0x2c64e2){if(!_0x2c64e2){_0x38efc8[_0x0d8b('0x16')](0x194);}return _0x2c64e2;};}function handleError(_0x4562cb,_0x27b695){_0x27b695=_0x27b695||0x1f4;return function(_0x5e5bc3){logger[_0x0d8b('0x23')](_0x5e5bc3[_0x0d8b('0x24')]);if(_0x5e5bc3['name']){delete _0x5e5bc3[_0x0d8b('0x25')];}_0x4562cb['status'](_0x27b695)[_0x0d8b('0x26')](_0x5e5bc3);};}exports[_0x0d8b('0x21')]=function(_0xa2af02,_0x4fe6f9){if(_0xa2af02['body']['id']){delete _0xa2af02[_0x0d8b('0x27')]['id'];}return db[_0x0d8b('0x28')]['find']({'where':{'id':_0xa2af02[_0x0d8b('0x29')]['id']}})['then'](handleEntityNotFound(_0x4fe6f9,null))[_0x0d8b('0x22')](saveUpdates(_0xa2af02['body'],null))[_0x0d8b('0x22')](respondWithResult(_0x4fe6f9,null))['catch'](handleError(_0x4fe6f9,null));};exports[_0x0d8b('0x2a')]=function(_0x546bf6,_0x3829c6){return db['Action'][_0x0d8b('0x2b')]({'where':{'id':_0x546bf6[_0x0d8b('0x29')]['id']}})[_0x0d8b('0x22')](handleEntityNotFound(_0x3829c6,null))['then'](removeEntity(_0x3829c6,null))['catch'](handleError(_0x3829c6,null));}; \ No newline at end of file +var _0x4522=['then','status','end','error','stack','send','body','Action','catch','find','params','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy'];(function(_0xd2e5fe,_0x3adc4d){var _0x4ebb02=function(_0x1ac334){while(--_0x1ac334){_0xd2e5fe['push'](_0xd2e5fe['shift']());}};_0x4ebb02(++_0x3adc4d);}(_0x4522,0x1a0));var _0x2452=function(_0x361e8a,_0x458d1f){_0x361e8a=_0x361e8a-0x0;var _0x4f4f22=_0x4522[_0x361e8a];return _0x4f4f22;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x2452('0x0'));var zipdir=require(_0x2452('0x1'));var jsonpatch=require(_0x2452('0x2'));var rp=require('request-promise');var moment=require(_0x2452('0x3'));var BPromise=require(_0x2452('0x4'));var Mustache=require(_0x2452('0x5'));var util=require(_0x2452('0x6'));var path=require(_0x2452('0x7'));var sox=require(_0x2452('0x8'));var csv=require(_0x2452('0x9'));var ejs=require(_0x2452('0xa'));var fs=require('fs');var _=require(_0x2452('0xb'));var squel=require(_0x2452('0xc'));var crypto=require(_0x2452('0xd'));var jsforce=require(_0x2452('0xe'));var deskjs=require(_0x2452('0xf'));var toCsv=require(_0x2452('0x9'));var querystring=require(_0x2452('0x10'));var Papa=require(_0x2452('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2452('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2452('0x13'))(_0x2452('0x14'));var utils=require(_0x2452('0x15'));var config=require(_0x2452('0x16'));var db=require(_0x2452('0x17'))['db'];function respondWithStatusCode(_0x14f338,_0x2c1e0f){_0x2c1e0f=_0x2c1e0f||0xcc;return function(_0x2377b9){if(_0x2377b9){return _0x14f338['sendStatus'](_0x2c1e0f);}return _0x14f338['status'](_0x2c1e0f)['end']();};}function respondWithResult(_0x463960,_0x4fafa0){_0x4fafa0=_0x4fafa0||0xc8;return function(_0x33e592){if(_0x33e592){return _0x463960['status'](_0x4fafa0)[_0x2452('0x18')](_0x33e592);}};}function respondWithFilteredResult(_0x42efdf,_0x5d0438){return function(_0x1dbadf){if(_0x1dbadf){var _0x47930c=_0x1dbadf[_0x2452('0x19')],_0x3dd8cc=_0x5d0438['offset'],_0x734b88=_0x5d0438[_0x2452('0x1a')]+_0x5d0438[_0x2452('0x1b')],_0x461d2b;if(_0x734b88>=_0x47930c){_0x734b88=_0x47930c;_0x461d2b=0xc8;}else{_0x461d2b=0xce;}_0x42efdf['status'](_0x461d2b);return _0x42efdf['set'](_0x2452('0x1c'),_0x3dd8cc+'-'+_0x734b88+'/'+_0x47930c)[_0x2452('0x18')](_0x1dbadf);}return null;};}function patchUpdates(_0x377c12){return function(_0x57cb03){try{jsonpatch[_0x2452('0x1d')](_0x57cb03,_0x377c12,!![]);}catch(_0x467963){return BPromise[_0x2452('0x1e')](_0x467963);}return _0x57cb03[_0x2452('0x1f')]();};}function saveUpdates(_0x1931b0,_0x1c70cb){return function(_0x3f48c2){if(_0x3f48c2){return _0x3f48c2[_0x2452('0x20')](_0x1931b0)['then'](function(_0x48f356){return _0x48f356;});}return null;};}function removeEntity(_0x1f060d,_0x32dfe7){return function(_0x4bb3ff){if(_0x4bb3ff){return _0x4bb3ff[_0x2452('0x21')]()[_0x2452('0x22')](function(){_0x1f060d[_0x2452('0x23')](0xcc)[_0x2452('0x24')]();});}};}function handleEntityNotFound(_0x285281,_0x397f21){return function(_0x155caa){if(!_0x155caa){_0x285281['sendStatus'](0x194);}return _0x155caa;};}function handleError(_0x119bf6,_0x27d049){_0x27d049=_0x27d049||0x1f4;return function(_0x1561e5){logger[_0x2452('0x25')](_0x1561e5[_0x2452('0x26')]);if(_0x1561e5['name']){delete _0x1561e5['name'];}_0x119bf6[_0x2452('0x23')](_0x27d049)[_0x2452('0x27')](_0x1561e5);};}exports[_0x2452('0x20')]=function(_0x3a183c,_0x1aac19){if(_0x3a183c['body']['id']){delete _0x3a183c[_0x2452('0x28')]['id'];}return db[_0x2452('0x29')]['find']({'where':{'id':_0x3a183c['params']['id']}})[_0x2452('0x22')](handleEntityNotFound(_0x1aac19,null))[_0x2452('0x22')](saveUpdates(_0x3a183c[_0x2452('0x28')],null))[_0x2452('0x22')](respondWithResult(_0x1aac19,null))[_0x2452('0x2a')](handleError(_0x1aac19,null));};exports[_0x2452('0x21')]=function(_0x504162,_0x5da9aa){return db[_0x2452('0x29')][_0x2452('0x2b')]({'where':{'id':_0x504162[_0x2452('0x2c')]['id']}})['then'](handleEntityNotFound(_0x5da9aa,null))[_0x2452('0x22')](removeEntity(_0x5da9aa,null))[_0x2452('0x2a')](handleError(_0x5da9aa,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 811cb7d..ad3cdc9 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 _0xb945=['util','../../config/logger','bluebird','request-promise','path','../../config/environment','./action.attributes','exports','define','Action','tools_actions','lodash'];(function(_0x39c803,_0x32b00a){var _0xd21578=function(_0x59293b){while(--_0x59293b){_0x39c803['push'](_0x39c803['shift']());}};_0xd21578(++_0x32b00a);}(_0xb945,0x1bb));var _0x5b94=function(_0x3efc72,_0x405ab7){_0x3efc72=_0x3efc72-0x0;var _0x5a4457=_0xb945[_0x3efc72];return _0x5a4457;};'use strict';var _=require(_0x5b94('0x0'));var util=require(_0x5b94('0x1'));var logger=require(_0x5b94('0x2'))('api');var moment=require('moment');var BPromise=require(_0x5b94('0x3'));var rp=require(_0x5b94('0x4'));var fs=require('fs');var path=require(_0x5b94('0x5'));var rimraf=require('rimraf');var config=require(_0x5b94('0x6'));var attributes=require(_0x5b94('0x7'));module[_0x5b94('0x8')]=function(_0x4150ae,_0x2e305b){return _0x4150ae[_0x5b94('0x9')](_0x5b94('0xa'),attributes,{'tableName':_0x5b94('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3730=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Action','tools_actions','util'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3730,0x1d3));var _0x0373=function(_0x2618be,_0x4e7441){_0x2618be=_0x2618be-0x0;var _0x152f8d=_0x3730[_0x2618be];return _0x152f8d;};'use strict';var _=require('lodash');var util=require(_0x0373('0x0'));var logger=require('../../config/logger')(_0x0373('0x1'));var moment=require(_0x0373('0x2'));var BPromise=require(_0x0373('0x3'));var rp=require(_0x0373('0x4'));var fs=require('fs');var path=require(_0x0373('0x5'));var rimraf=require(_0x0373('0x6'));var config=require(_0x0373('0x7'));var attributes=require('./action.attributes');module[_0x0373('0x8')]=function(_0x4d4256,_0xa275a6){return _0x4d4256[_0x0373('0x9')](_0x0373('0xa'),attributes,{'tableName':_0x0373('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js index 50a7c88..6db512c 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 _0xbaf0=['client','http','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x178f52,_0x5d9675){var _0x556f99=function(_0x4a7b17){while(--_0x4a7b17){_0x178f52['push'](_0x178f52['shift']());}};_0x556f99(++_0x5d9675);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xbaf0[_0x2b4411];return _0x8e41ef;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var moment=require(_0x0baf('0x1'));var BPromise=require(_0x0baf('0x2'));var rs=require(_0x0baf('0x3'));var fs=require('fs');var Redis=require(_0x0baf('0x4'));var db=require(_0x0baf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0baf('0x6'))(_0x0baf('0x7'));var config=require(_0x0baf('0x8'));var jayson=require(_0x0baf('0x9'));var client=jayson[_0x0baf('0xa')][_0x0baf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a10b1,_0x2dcaac,_0x1d0a0d){return new BPromise(function(_0x5f5030,_0x11b947){return client['request'](_0x1a10b1,_0x1d0a0d)[_0x0baf('0xc')](function(_0x2c7442){logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,_0x0baf('0xf'));logger[_0x0baf('0x10')](_0x0baf('0x11'),_0x2dcaac,_0x0baf('0xf'),JSON[_0x0baf('0x12')](_0x2c7442));if(_0x2c7442[_0x0baf('0x13')]){if(_0x2c7442[_0x0baf('0x13')]['code']===0x1f4){logger['error'](_0x0baf('0xe'),_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x11b947(_0x2c7442[_0x0baf('0x13')]['message']);}logger[_0x0baf('0x13')]('Action,\x20%s,\x20%s',_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x5f5030(_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);}else{logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,'request\x20sent');_0x5f5030(_0x2c7442['result'][_0x0baf('0x14')]);}})[_0x0baf('0x15')](function(_0x283408){logger[_0x0baf('0x13')](_0x0baf('0xe'),_0x2dcaac,_0x283408);_0x11b947(_0x283408);});});} \ No newline at end of file +var _0xbaf0=['client','http','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x51674a,_0x77ccff){var _0x13fca6=function(_0x3d6c27){while(--_0x3d6c27){_0x51674a['push'](_0x51674a['shift']());}};_0x13fca6(++_0x77ccff);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xbaf0[_0x6c993a];return _0x27f547;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var moment=require(_0x0baf('0x1'));var BPromise=require(_0x0baf('0x2'));var rs=require(_0x0baf('0x3'));var fs=require('fs');var Redis=require(_0x0baf('0x4'));var db=require(_0x0baf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0baf('0x6'))(_0x0baf('0x7'));var config=require(_0x0baf('0x8'));var jayson=require(_0x0baf('0x9'));var client=jayson[_0x0baf('0xa')][_0x0baf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a10b1,_0x2dcaac,_0x1d0a0d){return new BPromise(function(_0x5f5030,_0x11b947){return client['request'](_0x1a10b1,_0x1d0a0d)[_0x0baf('0xc')](function(_0x2c7442){logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,_0x0baf('0xf'));logger[_0x0baf('0x10')](_0x0baf('0x11'),_0x2dcaac,_0x0baf('0xf'),JSON[_0x0baf('0x12')](_0x2c7442));if(_0x2c7442[_0x0baf('0x13')]){if(_0x2c7442[_0x0baf('0x13')]['code']===0x1f4){logger['error'](_0x0baf('0xe'),_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x11b947(_0x2c7442[_0x0baf('0x13')]['message']);}logger[_0x0baf('0x13')]('Action,\x20%s,\x20%s',_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x5f5030(_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);}else{logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,'request\x20sent');_0x5f5030(_0x2c7442['result'][_0x0baf('0x14')]);}})[_0x0baf('0x15')](function(_0x283408){logger[_0x0baf('0x13')](_0x0baf('0xe'),_0x2dcaac,_0x283408);_0x11b947(_0x283408);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 73da1cb..696aa14 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 _0x1ffb=['/:id','isAuthenticated','delete','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','./action.controller'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x1ffb,0x170));var _0xb1ff=function(_0x468c39,_0x13e529){_0x468c39=_0x468c39-0x0;var _0x291727=_0x1ffb[_0x468c39];return _0x291727;};'use strict';var multer=require('multer');var util=require(_0xb1ff('0x0'));var path=require(_0xb1ff('0x1'));var timeout=require(_0xb1ff('0x2'));var express=require('express');var router=express[_0xb1ff('0x3')]();var auth=require(_0xb1ff('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb1ff('0x5'));router['put'](_0xb1ff('0x6'),auth[_0xb1ff('0x7')](),controller['update']);router[_0xb1ff('0x8')](_0xb1ff('0x6'),auth[_0xb1ff('0x7')](),controller[_0xb1ff('0x9')]);module[_0xb1ff('0xa')]=router; \ No newline at end of file +var _0x5c13=['delete','/:id','destroy','multer','util','connect-timeout','Router','../../components/interaction/service','../../config/environment','./action.controller','put','isAuthenticated'];(function(_0x54ba9d,_0x3adcce){var _0x37c24e=function(_0x49f896){while(--_0x49f896){_0x54ba9d['push'](_0x54ba9d['shift']());}};_0x37c24e(++_0x3adcce);}(_0x5c13,0x177));var _0x35c1=function(_0x8afdd0,_0x548ad1){_0x8afdd0=_0x8afdd0-0x0;var _0x3de7ac=_0x5c13[_0x8afdd0];return _0x3de7ac;};'use strict';var multer=require(_0x35c1('0x0'));var util=require(_0x35c1('0x1'));var path=require('path');var timeout=require(_0x35c1('0x2'));var express=require('express');var router=express[_0x35c1('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x35c1('0x4'));var config=require(_0x35c1('0x5'));var controller=require(_0x35c1('0x6'));router[_0x35c1('0x7')]('/:id',auth[_0x35c1('0x8')](),controller['update']);router[_0x35c1('0x9')](_0x35c1('0xa'),auth[_0x35c1('0x8')](),controller[_0x35c1('0xb')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index a313336..78b6974 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 _0x8fea=['TEXT','sequelize','STRING'];(function(_0x5169da,_0x5db048){var _0x17caf0=function(_0x3726fc){while(--_0x3726fc){_0x5169da['push'](_0x5169da['shift']());}};_0x17caf0(++_0x5db048);}(_0x8fea,0x151));var _0xa8fe=function(_0x3be20a,_0x223336){_0x3be20a=_0x3be20a-0x0;var _0x7382f6=_0x8fea[_0x3be20a];return _0x7382f6;};'use strict';var Sequelize=require(_0xa8fe('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0xa8fe('0x1')]},'table':{'type':Sequelize[_0xa8fe('0x1')]},'conditions':{'type':Sequelize[_0xa8fe('0x2')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x07f1=['STRING','TEXT'];(function(_0x5ed8b4,_0x182907){var _0x46f16f=function(_0x52dab2){while(--_0x52dab2){_0x5ed8b4['push'](_0x5ed8b4['shift']());}};_0x46f16f(++_0x182907);}(_0x07f1,0x1ac));var _0x107f=function(_0x295966,_0x218dfe){_0x295966=_0x295966-0x0;var _0x102436=_0x07f1[_0x295966];return _0x102436;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x107f('0x0')]},'parent':{'type':Sequelize[_0x107f('0x0')]},'table':{'type':Sequelize[_0x107f('0x0')]},'conditions':{'type':Sequelize[_0x107f('0x1')]},'joins':{'type':Sequelize[_0x107f('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index abc1e3e..ad2bc77 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 _0x27c2=['where','filters','pick','filter','merge','type','VIRTUAL','field','options','count','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','operator','rules','group','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','from','MetricId','metric','function','replace','format','orderBy','order','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','table','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','keyBy','%s.%s\x20=\x20%s.%s','No\x20available\x20data','output','web','fullPath','randomstring','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','countTable','COUNT(*)','run','runReport','MAX(%s)','UNIX_TIMESTAMP(%s)','groupBy','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','set','reject','update','then','CustomReports','destroy','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','key','query','keys','model','intersection','fields','attributes','hasOwnProperty','nolimit','limit'];(function(_0x3a3236,_0x264258){var _0x21273e=function(_0x4b7f72){while(--_0x4b7f72){_0x3a3236['push'](_0x3a3236['shift']());}};_0x21273e(++_0x264258);}(_0x27c2,0x71));var _0x227c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x27c2[_0x14add3];return _0x4a174f;};'use strict';var pdf=require(_0x227c('0x0'));var emlformat=require(_0x227c('0x1'));var rimraf=require(_0x227c('0x2'));var zipdir=require(_0x227c('0x3'));var jsonpatch=require(_0x227c('0x4'));var rp=require(_0x227c('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x227c('0x6'));var util=require(_0x227c('0x7'));var path=require('path');var sox=require(_0x227c('0x8'));var csv=require(_0x227c('0x9'));var ejs=require(_0x227c('0xa'));var fs=require('fs');var _=require(_0x227c('0xb'));var squel=require(_0x227c('0xc'));var crypto=require(_0x227c('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x227c('0xe'));var Papa=require(_0x227c('0xf'));var Redis=require(_0x227c('0x10'));var authService=require(_0x227c('0x11'));var qs=require(_0x227c('0x12'));var as=require(_0x227c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x227c('0x14'))(_0x227c('0x15'));var utils=require(_0x227c('0x16'));var config=require(_0x227c('0x17'));var db=require(_0x227c('0x18'))['db'];function respondWithStatusCode(_0x2c9d34,_0x3b60a3){_0x3b60a3=_0x3b60a3||0xcc;return function(_0x154b3a){if(_0x154b3a){return _0x2c9d34[_0x227c('0x19')](_0x3b60a3);}return _0x2c9d34[_0x227c('0x1a')](_0x3b60a3)[_0x227c('0x1b')]();};}function respondWithResult(_0x3fa6aa,_0x45e63f){_0x45e63f=_0x45e63f||0xc8;return function(_0x4f1a62){if(_0x4f1a62){return _0x3fa6aa['status'](_0x45e63f)[_0x227c('0x1c')](_0x4f1a62);}};}function respondWithFilteredResult(_0x2521fd,_0x143e52){return function(_0x23cca6){if(_0x23cca6){var _0x2f5241=_0x23cca6['count'],_0x26b19b=_0x143e52[_0x227c('0x1d')],_0x8bffd3=_0x143e52[_0x227c('0x1d')]+_0x143e52['limit'],_0x31c089;if(_0x8bffd3>=_0x2f5241){_0x8bffd3=_0x2f5241;_0x31c089=0xc8;}else{_0x31c089=0xce;}_0x2521fd[_0x227c('0x1a')](_0x31c089);return _0x2521fd[_0x227c('0x1e')]('Content-Range',_0x26b19b+'-'+_0x8bffd3+'/'+_0x2f5241)[_0x227c('0x1c')](_0x23cca6);}return null;};}function patchUpdates(_0x15956d){return function(_0x310364){try{jsonpatch['apply'](_0x310364,_0x15956d,!![]);}catch(_0x3036d2){return BPromise[_0x227c('0x1f')](_0x3036d2);}return _0x310364['save']();};}function saveUpdates(_0x27032d,_0x5ea6f9){return function(_0x5c73ec){if(_0x5c73ec){return _0x5c73ec[_0x227c('0x20')](_0x27032d)[_0x227c('0x21')](function(_0x1eb883){return _0x1eb883;});}return null;};}function removeEntity(_0x373969,_0x461afc){return function(_0x168954){if(_0x168954){return _0x168954['destroy']()[_0x227c('0x21')](function(){var _0xed8957=_0x168954['get']({'plain':!![]});var _0x17de7f=_0x227c('0x22');return db['UserProfileResource'][_0x227c('0x23')]({'where':{'type':_0x17de7f,'resourceId':_0xed8957['id']}})[_0x227c('0x21')](function(){return _0x168954;});})[_0x227c('0x21')](function(){_0x373969[_0x227c('0x1a')](0xcc)[_0x227c('0x1b')]();});}};}function handleEntityNotFound(_0xc6016e,_0x17f95a){return function(_0x4d8b7b){if(!_0x4d8b7b){_0xc6016e['sendStatus'](0x194);}return _0x4d8b7b;};}function handleError(_0x48aac7,_0x479f6b){_0x479f6b=_0x479f6b||0x1f4;return function(_0xa75d69){logger['error'](_0xa75d69[_0x227c('0x24')]);if(_0xa75d69['name']){delete _0xa75d69[_0x227c('0x25')];}_0x48aac7[_0x227c('0x1a')](_0x479f6b)[_0x227c('0x26')](_0xa75d69);};}exports[_0x227c('0x27')]=function(_0x2f7b23,_0x407329){var _0x209b1d={},_0x28ce07={},_0x1facb3={'count':0x0,'rows':[]};var _0x591d4f=_[_0x227c('0x28')](db[_0x227c('0x29')][_0x227c('0x2a')],function(_0x2903e5){return{'name':_0x2903e5[_0x227c('0x2b')],'type':_0x2903e5['type'][_0x227c('0x2c')]};});_0x28ce07['model']=_[_0x227c('0x28')](_0x591d4f,_0x227c('0x25'));_0x28ce07[_0x227c('0x2d')]=_[_0x227c('0x2e')](_0x2f7b23[_0x227c('0x2d')]);_0x28ce07['filters']=_['intersection'](_0x28ce07[_0x227c('0x2f')],_0x28ce07[_0x227c('0x2d')]);_0x209b1d['attributes']=_[_0x227c('0x30')](_0x28ce07[_0x227c('0x2f')],qs[_0x227c('0x31')](_0x2f7b23[_0x227c('0x2d')][_0x227c('0x31')]));_0x209b1d[_0x227c('0x32')]=_0x209b1d['attributes']['length']?_0x209b1d['attributes']:_0x28ce07[_0x227c('0x2f')];if(!_0x2f7b23[_0x227c('0x2d')][_0x227c('0x33')](_0x227c('0x34'))){_0x209b1d[_0x227c('0x35')]=qs[_0x227c('0x35')](_0x2f7b23[_0x227c('0x2d')]['limit']);_0x209b1d[_0x227c('0x1d')]=qs[_0x227c('0x1d')](_0x2f7b23[_0x227c('0x2d')]['offset']);}_0x209b1d['order']=qs['sort'](_0x2f7b23[_0x227c('0x2d')]['sort']);_0x209b1d[_0x227c('0x36')]=qs[_0x227c('0x37')](_[_0x227c('0x38')](_0x2f7b23[_0x227c('0x2d')],_0x28ce07['filters']));if(_0x2f7b23['query'][_0x227c('0x39')]){_0x209b1d[_0x227c('0x36')]=_[_0x227c('0x3a')](_0x209b1d[_0x227c('0x36')],{'$or':_[_0x227c('0x28')](_0x591d4f,function(_0x38b65c){if(_0x38b65c[_0x227c('0x3b')]['key']!==_0x227c('0x3c')){var _0x571833={};_0x571833[_0x38b65c[_0x227c('0x3d')]]={'$like':'%'+_0x2f7b23[_0x227c('0x2d')][_0x227c('0x39')]+'%'};return _0x571833;}})});}_0x209b1d=_['merge']({},_0x209b1d,_0x2f7b23[_0x227c('0x3e')]);var _0x28e8a7={'where':_0x209b1d['where']};return db[_0x227c('0x29')]['count'](_0x28e8a7)[_0x227c('0x21')](function(_0x242b61){_0x1facb3[_0x227c('0x3f')]=_0x242b61;if(_0x2f7b23[_0x227c('0x2d')][_0x227c('0x40')]){_0x209b1d[_0x227c('0x41')]=[{'all':!![]}];}return db[_0x227c('0x29')][_0x227c('0x42')](_0x209b1d);})['then'](function(_0x46f8b3){_0x1facb3[_0x227c('0x43')]=_0x46f8b3;return _0x1facb3;})[_0x227c('0x21')](respondWithFilteredResult(_0x407329,_0x209b1d))[_0x227c('0x44')](handleError(_0x407329,null));};exports[_0x227c('0x45')]=function(_0x574dae,_0x5cbe15){var _0x46e149={'raw':![],'where':{'id':_0x574dae[_0x227c('0x46')]['id']}},_0xda0fd9={};_0xda0fd9[_0x227c('0x2f')]=_[_0x227c('0x2e')](db[_0x227c('0x29')][_0x227c('0x2a')]);_0xda0fd9[_0x227c('0x2d')]=_[_0x227c('0x2e')](_0x574dae[_0x227c('0x2d')]);_0xda0fd9['filters']=_[_0x227c('0x30')](_0xda0fd9['model'],_0xda0fd9[_0x227c('0x2d')]);_0x46e149[_0x227c('0x32')]=_['intersection'](_0xda0fd9[_0x227c('0x2f')],qs[_0x227c('0x31')](_0x574dae[_0x227c('0x2d')][_0x227c('0x31')]));_0x46e149['attributes']=_0x46e149[_0x227c('0x32')][_0x227c('0x47')]?_0x46e149[_0x227c('0x32')]:_0xda0fd9[_0x227c('0x2f')];if(_0x574dae[_0x227c('0x2d')][_0x227c('0x40')]){_0x46e149[_0x227c('0x41')]=[{'all':!![]}];}_0x46e149=_['merge']({},_0x46e149,_0x574dae[_0x227c('0x3e')]);return db[_0x227c('0x29')][_0x227c('0x48')](_0x46e149)[_0x227c('0x21')](handleEntityNotFound(_0x5cbe15,null))[_0x227c('0x21')](respondWithResult(_0x5cbe15,null))[_0x227c('0x44')](handleError(_0x5cbe15,null));};exports[_0x227c('0x49')]=function(_0x53b44b,_0xd53c8a){return db['AnalyticCustomReport']['create'](_0x53b44b[_0x227c('0x4a')],{})[_0x227c('0x21')](function(_0x904ccb){var _0x24ef22=_0x53b44b['user'][_0x227c('0x4b')]({'plain':!![]});if(!_0x24ef22)throw new Error(_0x227c('0x4c'));if(_0x24ef22[_0x227c('0x4d')]===_0x227c('0x4e')){var _0xebc600=_0x904ccb['get']({'plain':!![]});var _0x18e1a9=_0x227c('0x4f');return db['UserProfileSection'][_0x227c('0x48')]({'where':{'name':_0x18e1a9,'userProfileId':_0x24ef22[_0x227c('0x50')]},'raw':!![]})['then'](function(_0x143501){if(_0x143501&&_0x143501[_0x227c('0x51')]===0x0){return db[_0x227c('0x52')][_0x227c('0x49')]({'name':_0xebc600[_0x227c('0x25')],'resourceId':_0xebc600['id'],'type':_0x227c('0x22'),'sectionId':_0x143501['id']},{})[_0x227c('0x21')](function(){return _0x904ccb;});}else{return _0x904ccb;}})[_0x227c('0x44')](function(_0xd40e22){logger['error'](_0x227c('0x53'),_0xd40e22);throw _0xd40e22;});}return _0x904ccb;})['then'](respondWithResult(_0xd53c8a,0xc9))[_0x227c('0x44')](handleError(_0xd53c8a,null));};exports[_0x227c('0x20')]=function(_0x1c377d,_0xe60f3f){if(_0x1c377d[_0x227c('0x4a')]['id']){delete _0x1c377d[_0x227c('0x4a')]['id'];}return db['AnalyticCustomReport'][_0x227c('0x48')]({'where':{'id':_0x1c377d[_0x227c('0x46')]['id']}})['then'](handleEntityNotFound(_0xe60f3f,null))[_0x227c('0x21')](saveUpdates(_0x1c377d[_0x227c('0x4a')],null))[_0x227c('0x21')](respondWithResult(_0xe60f3f,null))[_0x227c('0x44')](handleError(_0xe60f3f,null));};exports[_0x227c('0x23')]=function(_0xeb65cd,_0x42b2dd){return db[_0x227c('0x29')][_0x227c('0x48')]({'where':{'id':_0xeb65cd['params']['id']}})[_0x227c('0x21')](handleEntityNotFound(_0x42b2dd,null))[_0x227c('0x21')](removeEntity(_0x42b2dd,null))[_0x227c('0x44')](handleError(_0x42b2dd,null));};exports[_0x227c('0x54')]=function(_0x47d2cd,_0x5612f5){var _0x40e6ea=0xa;var _0x3ba00a=[_0x227c('0x55'),_0x227c('0x56'),_0x227c('0x57'),_0x227c('0x58')];var _0x467b1b={'SUM':_0x227c('0x59'),'COUNT':_0x227c('0x5a'),'COUNT DISTINCT':_0x227c('0x5b'),'MAX':'MAX(%s)','MIN':_0x227c('0x5c'),'AVG':_0x227c('0x5d'),'GROUP_CONCAT':_0x227c('0x5e'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x227c('0x5f')};var _0xff23ed={'SEC_TO_TIME':_0x227c('0x60'),'DATE':_0x227c('0x61'),'HOUR':'HOUR(%s)','ROUND':_0x227c('0x62'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x44b07d=function(_0x11cfea){return!_[_0x227c('0x63')]([_0x227c('0x64'),_0x227c('0x65'),_0x227c('0x66'),_0x227c('0x67')],_0x11cfea);};var _0x286f5e=function(_0x43a816){if(!_0x43a816||!_0x43a816['rules'][_0x227c('0x47')]){return'';}for(var _0x4d2ae0='(',_0x5554bb=0x0;_0x5554bb<_0x43a816['rules'][_0x227c('0x47')];_0x5554bb+=0x1){_0x5554bb>0x0&&(_0x4d2ae0+='\x20'+_0x43a816[_0x227c('0x68')]+'\x20');_0x4d2ae0+=_0x43a816[_0x227c('0x69')][_0x5554bb][_0x227c('0x6a')]?_0x286f5e(_0x43a816[_0x227c('0x69')][_0x5554bb][_0x227c('0x6a')]):_0x43a816[_0x227c('0x69')][_0x5554bb]['field']+'\x20'+_0x43a816[_0x227c('0x69')][_0x5554bb][_0x227c('0x6b')]+(_0x44b07d(_0x43a816[_0x227c('0x69')][_0x5554bb][_0x227c('0x6b')])?'\x20'+_0x43a816['rules'][_0x5554bb][_0x227c('0x6c')]:'');}return _0x4d2ae0+')';};var _0x584376={'where':{'id':_0x47d2cd[_0x227c('0x46')]['id']}},_0x1bfa93,_0x412c61,_0x31a74f,_0x51fa91,_0x4463e5;_0x584376=_[_0x227c('0x3a')]({},_0x584376,_0x47d2cd[_0x227c('0x3e')]);return db[_0x227c('0x29')][_0x227c('0x48')](_0x584376)[_0x227c('0x21')](function(_0xc0f8b6){if(_0xc0f8b6){_0x1bfa93=_0xc0f8b6;return _0xc0f8b6[_0x227c('0x6d')]();}return null;})[_0x227c('0x21')](function(_0x51e0af){if(_0x51e0af){if(!_0x51e0af[_0x227c('0x47')]){throw new db[(_0x227c('0x6e'))][(_0x227c('0x6f'))](_0x227c('0x70'),0x193);}_0x412c61=_0x51e0af;return db[_0x227c('0x71')][_0x227c('0x42')]({'raw':!![]});}return null;})[_0x227c('0x21')](function(_0x369faf){if(_0x369faf){_0x31a74f=_['keyBy'](_0x369faf,'id');var _0x36add2;var _0x504f2c=squel[_0x227c('0x72')]();_0x504f2c[_0x227c('0x73')](_0x1bfa93['table']);for(var _0x4a0fe3=0x0;_0x4a0fe3<_0x412c61['length'];_0x4a0fe3+=0x1){_0x36add2=_0x412c61[_0x4a0fe3][_0x227c('0x74')]?_0x31a74f[_0x412c61[_0x4a0fe3][_0x227c('0x74')]][_0x227c('0x75')]:_0x412c61[_0x4a0fe3][_0x227c('0x3d')];_0x36add2=_0x412c61[_0x4a0fe3][_0x227c('0x76')]?_[_0x227c('0x77')](_0x467b1b[_0x412c61[_0x4a0fe3][_0x227c('0x76')]],'%s',_0x36add2):_0x36add2;_0x36add2=_0x412c61[_0x4a0fe3][_0x227c('0x78')]?_['replace'](_0xff23ed[_0x412c61[_0x4a0fe3][_0x227c('0x78')]],'%s',_0x36add2):_0x36add2;if(_0x412c61[_0x4a0fe3]['groupBy']){_0x504f2c[_0x227c('0x6a')](_0x36add2);}_0x412c61[_0x4a0fe3][_0x227c('0x79')]&&_0x504f2c[_0x227c('0x7a')](_0x36add2,_0x412c61[_0x4a0fe3]['orderBy']===_0x227c('0x7b')?![]:!![]);_0x504f2c[_0x227c('0x3d')](_0x36add2,_0x412c61[_0x4a0fe3][_0x227c('0x7c')]||_0x36add2);}if(_0x1bfa93[_0x227c('0x7d')]){_0x1bfa93['joins']=JSON[_0x227c('0x7e')](_0x1bfa93[_0x227c('0x7d')]);for(var _0x35941a=0x0;_0x35941a<_0x1bfa93[_0x227c('0x7d')][_0x227c('0x47')];_0x35941a+=0x1){if(_0x1bfa93[_0x227c('0x7d')][_0x35941a][_0x227c('0x3b')]&&_[_0x227c('0x63')](_0x3ba00a,_0x1bfa93[_0x227c('0x7d')][_0x35941a][_0x227c('0x3b')])&&_0x1bfa93[_0x227c('0x7d')][_0x35941a][_0x227c('0x7f')]&&_0x1bfa93[_0x227c('0x7d')][_0x35941a][_0x227c('0x80')]&&_0x1bfa93['joins'][_0x35941a][_0x227c('0x81')]){_0x504f2c[_0x1bfa93['joins'][_0x35941a][_0x227c('0x3b')]](_0x1bfa93[_0x227c('0x7d')][_0x35941a][_0x227c('0x80')],null,util[_0x227c('0x78')]('%s.%s\x20=\x20%s.%s',_0x1bfa93[_0x227c('0x82')],_0x1bfa93['joins'][_0x35941a][_0x227c('0x7f')],_0x1bfa93[_0x227c('0x7d')][_0x35941a]['foreignTable'],_0x1bfa93[_0x227c('0x7d')][_0x35941a][_0x227c('0x81')]));}}}if(_0x1bfa93[_0x227c('0x83')]){_0x1bfa93[_0x227c('0x83')]=JSON[_0x227c('0x7e')](_0x1bfa93[_0x227c('0x83')]);_0x504f2c[_0x227c('0x36')](_0x286f5e(_0x1bfa93['conditions']['group']));}_0x4463e5=_0x504f2c[_0x227c('0x84')]();_0x504f2c['limit'](_0x40e6ea);_0x504f2c['offset'](0x0);logger[_0x227c('0x85')](_0x227c('0x86'),_0x504f2c[_0x227c('0x87')]());return db[_0x227c('0x88')]['query'](_0x504f2c[_0x227c('0x87')](),{'type':db[_0x227c('0x88')][_0x227c('0x89')][_0x227c('0x8a')]});}})[_0x227c('0x21')](respondWithResult(_0x5612f5,null))['catch'](handleError(_0x5612f5,null));};function runReport(_0x5edde8,_0x2dc0da,_0x7a8609){var _0x2bc08c=_0x2dc0da['name'];var _0x597f91=0xa;var _0x5a5239=[_0x227c('0x55'),_0x227c('0x56'),_0x227c('0x57'),_0x227c('0x58')];var _0x126af4={'SUM':_0x227c('0x59'),'COUNT':_0x227c('0x5a'),'COUNT DISTINCT':_0x227c('0x5b'),'MAX':'MAX(%s)','MIN':_0x227c('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x227c('0x8b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x41fd1c={'SEC_TO_TIME':_0x227c('0x60'),'DATE':_0x227c('0x61'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4c43fd=function(_0x4086e2){return!_[_0x227c('0x63')]([_0x227c('0x64'),_0x227c('0x65'),'IS\x20EMPTY',_0x227c('0x67')],_0x4086e2);};var _0x27c213=function(_0x5d12ce){if(!_0x5d12ce||!_0x5d12ce[_0x227c('0x69')][_0x227c('0x47')]){return'';}for(var _0x16e8a7='(',_0x52e3c2=0x0;_0x52e3c2<_0x5d12ce['rules']['length'];_0x52e3c2+=0x1){_0x52e3c2>0x0&&(_0x16e8a7+='\x20'+_0x5d12ce[_0x227c('0x68')]+'\x20');_0x16e8a7+=_0x5d12ce['rules'][_0x52e3c2][_0x227c('0x6a')]?_0x27c213(_0x5d12ce[_0x227c('0x69')][_0x52e3c2][_0x227c('0x6a')]):_0x5d12ce[_0x227c('0x69')][_0x52e3c2][_0x227c('0x3d')]+'\x20'+_0x5d12ce[_0x227c('0x69')][_0x52e3c2][_0x227c('0x6b')]+(_0x4c43fd(_0x5d12ce[_0x227c('0x69')][_0x52e3c2]['condition'])?'\x20'+_0x5d12ce[_0x227c('0x69')][_0x52e3c2]['value']:'');}return _0x16e8a7+')';};var _0x2ccb3f={'where':{'id':_0x5edde8['id']}},_0x59a19f,_0x4955e2,_0x10de0a,_0x1c4b20,_0x36e492;_0x2ccb3f=_['merge']({},_0x2ccb3f,_0x7a8609);return db[_0x227c('0x29')]['find'](_0x2ccb3f)['then'](function(_0x131ccf){if(_0x131ccf){_0x59a19f=_0x131ccf;return _0x131ccf[_0x227c('0x6d')]();}return null;})['then'](function(_0x24b8e6){if(_0x24b8e6){if(!_0x24b8e6['length']){throw new db[(_0x227c('0x6e'))][(_0x227c('0x6f'))](_0x227c('0x70'),0x193);}_0x4955e2=_0x24b8e6;return db[_0x227c('0x71')][_0x227c('0x42')]({'raw':!![]});}return null;})[_0x227c('0x21')](function(_0x5de729){if(_0x5de729){_0x10de0a=_[_0x227c('0x8c')](_0x5de729,'id');var _0x141a04;var _0x349746=squel[_0x227c('0x72')]();_0x349746[_0x227c('0x73')](_0x59a19f[_0x227c('0x82')]);for(var _0x1ebbe4=0x0;_0x1ebbe4<_0x4955e2['length'];_0x1ebbe4+=0x1){_0x141a04=_0x4955e2[_0x1ebbe4][_0x227c('0x74')]?_0x10de0a[_0x4955e2[_0x1ebbe4][_0x227c('0x74')]]['metric']:_0x4955e2[_0x1ebbe4]['field'];_0x141a04=_0x4955e2[_0x1ebbe4][_0x227c('0x76')]?_[_0x227c('0x77')](_0x126af4[_0x4955e2[_0x1ebbe4][_0x227c('0x76')]],'%s',_0x141a04):_0x141a04;_0x141a04=_0x4955e2[_0x1ebbe4][_0x227c('0x78')]?_[_0x227c('0x77')](_0x41fd1c[_0x4955e2[_0x1ebbe4][_0x227c('0x78')]],'%s',_0x141a04):_0x141a04;if(_0x4955e2[_0x1ebbe4]['groupBy']){_0x349746[_0x227c('0x6a')](_0x141a04);}_0x4955e2[_0x1ebbe4]['orderBy']&&_0x349746[_0x227c('0x7a')](_0x141a04,_0x4955e2[_0x1ebbe4][_0x227c('0x79')]===_0x227c('0x7b')?![]:!![]);_0x349746[_0x227c('0x3d')](_0x141a04,_0x4955e2[_0x1ebbe4][_0x227c('0x7c')]||_0x141a04);}if(_0x59a19f['joins']){_0x59a19f[_0x227c('0x7d')]=JSON[_0x227c('0x7e')](_0x59a19f['joins']);for(var _0x9f9f6b=0x0;_0x9f9f6b<_0x59a19f[_0x227c('0x7d')][_0x227c('0x47')];_0x9f9f6b+=0x1){if(_0x59a19f[_0x227c('0x7d')][_0x9f9f6b][_0x227c('0x3b')]&&_[_0x227c('0x63')](_0x5a5239,_0x59a19f[_0x227c('0x7d')][_0x9f9f6b][_0x227c('0x3b')])&&_0x59a19f[_0x227c('0x7d')][_0x9f9f6b][_0x227c('0x7f')]&&_0x59a19f['joins'][_0x9f9f6b][_0x227c('0x80')]&&_0x59a19f[_0x227c('0x7d')][_0x9f9f6b]['foreignKey']){_0x349746[_0x59a19f[_0x227c('0x7d')][_0x9f9f6b][_0x227c('0x3b')]](_0x59a19f[_0x227c('0x7d')][_0x9f9f6b]['foreignTable'],null,util['format'](_0x227c('0x8d'),_0x59a19f['table'],_0x59a19f[_0x227c('0x7d')][_0x9f9f6b][_0x227c('0x7f')],_0x59a19f[_0x227c('0x7d')][_0x9f9f6b]['foreignTable'],_0x59a19f[_0x227c('0x7d')][_0x9f9f6b][_0x227c('0x81')]));}}}if(_0x59a19f['conditions']){_0x59a19f[_0x227c('0x83')]=JSON['parse'](_0x59a19f[_0x227c('0x83')]);_0x349746[_0x227c('0x36')](_0x27c213(_0x59a19f[_0x227c('0x83')][_0x227c('0x6a')]));}_0x36e492=_0x349746[_0x227c('0x84')]();_0x349746[_0x227c('0x35')](_0x597f91);_0x349746[_0x227c('0x1d')](0x0);logger['debug'](_0x227c('0x86'),_0x349746[_0x227c('0x87')]());return db['sequelize'][_0x227c('0x2d')](_0x349746[_0x227c('0x87')](),{'type':db['sequelize'][_0x227c('0x89')][_0x227c('0x8a')]});}})[_0x227c('0x21')](function(_0x16b298){if(!_0x16b298['length']){throw new db[(_0x227c('0x6e'))][(_0x227c('0x6f'))](_0x227c('0x8e'),0xcc);}if(_0x2dc0da[_0x227c('0x8f')]===_0x227c('0x90')){return null;}var _0x48be8d=_[_0x227c('0x3a')](_0x2dc0da,{'name':_0x2dc0da[_0x227c('0x91')]||_0x2dc0da[_0x227c('0x25')]||_0x59a19f[_0x227c('0x25')],'basename':_0x2bc08c,'savename':util[_0x227c('0x78')]('%s-%s.%s',_0x2dc0da[_0x227c('0x25')]||_0x59a19f[_0x227c('0x25')],require(_0x227c('0x92'))['generate'](0x4),_0x2dc0da[_0x227c('0x8f')]||'csv'),'reportId':_0x59a19f['id'],'reportType':_0x227c('0x93')});return db[_0x227c('0x94')]['create'](_0x48be8d,{'raw':!![]});})[_0x227c('0x21')](function(_0x41fc7c){if(_0x59a19f[_0x227c('0x82')]===_0x227c('0x95')){_0x36e492[_0x227c('0x36')](_0x59a19f[_0x227c('0x82')]+_0x227c('0x96'),_0x2dc0da[_0x227c('0x97')],_0x2dc0da[_0x227c('0x98')]);}else{_0x36e492[_0x227c('0x36')](_0x59a19f[_0x227c('0x82')]+_0x227c('0x99'),_0x2dc0da[_0x227c('0x97')],_0x2dc0da['endDate']);}if(_0x41fc7c){logger[_0x227c('0x9a')](_0x227c('0x9b'),_0x36e492[_0x227c('0x87')]());require(_0x227c('0x9c'))[_0x227c('0x9d')](path[_0x227c('0x55')](__dirname,_0x227c('0x9e'),_0x41fc7c['output']),[_0x41fc7c['id'],_0x36e492['toString'](),path['join'](__dirname,_0x227c('0x9f'),_0x41fc7c['savename']),_0x2bc08c]);return _0x41fc7c;}else{var _0x5f4b2b=squel['select']();_0x5f4b2b[_0x227c('0x73')]('('+_0x36e492[_0x227c('0x87')]()+')',_0x227c('0xa0'));_0x5f4b2b[_0x227c('0x3d')](_0x227c('0xa1'),_0x227c('0x3f'));_0x36e492[_0x227c('0x35')](_0x2dc0da[_0x227c('0x35')]||_0x597f91);_0x36e492[_0x227c('0x1d')](_0x2dc0da['offset']||0x0);return db[_0x227c('0x88')][_0x227c('0x2d')](_0x5f4b2b[_0x227c('0x87')](),{'type':db[_0x227c('0x88')][_0x227c('0x89')][_0x227c('0x8a')]})['then'](function(_0x366ce7){if(!_0x366ce7[_0x227c('0x47')]){_0x1c4b20=0x0;}else{_0x1c4b20=_0x366ce7[0x0][_0x227c('0x3f')]||0x0;}return db[_0x227c('0x88')][_0x227c('0x2d')](_0x36e492[_0x227c('0x87')](),{'type':db['sequelize'][_0x227c('0x89')][_0x227c('0x8a')]});})['then'](function(_0x3e1fc1){return{'rows':_0x3e1fc1||[],'count':_0x1c4b20};});}});}exports[_0x227c('0xa2')]=function(_0x216fe3,_0x1dd797){return runReport(_0x216fe3[_0x227c('0x46')],_0x216fe3[_0x227c('0x2d')],_0x216fe3[_0x227c('0x3e')])[_0x227c('0x21')](respondWithResult(_0x1dd797,null))[_0x227c('0x44')](handleError(_0x1dd797,null));};exports[_0x227c('0xa3')]=runReport;exports[_0x227c('0x2d')]=function(_0x462cd7,_0x18d236){var _0x659fde=0xa;var _0x389b59=[_0x227c('0x55'),'left_join',_0x227c('0x57'),_0x227c('0x58')];var _0xd9c691={'SUM':_0x227c('0x59'),'COUNT':_0x227c('0x5a'),'COUNT DISTINCT':_0x227c('0x5b'),'MAX':_0x227c('0xa4'),'MIN':_0x227c('0x5c'),'AVG':_0x227c('0x5d'),'GROUP_CONCAT':_0x227c('0x5e'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x227c('0x5f')};var _0x1c2793={'SEC_TO_TIME':_0x227c('0x60'),'DATE':_0x227c('0x61'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x227c('0xa5')};var _0x5947d6=function(_0x538760){return!_[_0x227c('0x63')]([_0x227c('0x64'),_0x227c('0x65'),_0x227c('0x66'),_0x227c('0x67')],_0x538760);};var _0x43cbf3=function(_0x30f139){if(!_0x30f139||!_0x30f139[_0x227c('0x69')][_0x227c('0x47')]){return'';}for(var _0x362f41='(',_0x47ccaf=0x0;_0x47ccaf<_0x30f139[_0x227c('0x69')][_0x227c('0x47')];_0x47ccaf+=0x1){_0x47ccaf>0x0&&(_0x362f41+='\x20'+_0x30f139['operator']+'\x20');_0x362f41+=_0x30f139[_0x227c('0x69')][_0x47ccaf][_0x227c('0x6a')]?_0x43cbf3(_0x30f139[_0x227c('0x69')][_0x47ccaf]['group']):_0x30f139[_0x227c('0x69')][_0x47ccaf][_0x227c('0x3d')]+'\x20'+_0x30f139['rules'][_0x47ccaf][_0x227c('0x6b')]+(_0x5947d6(_0x30f139[_0x227c('0x69')][_0x47ccaf][_0x227c('0x6b')])?'\x20'+_0x30f139[_0x227c('0x69')][_0x47ccaf][_0x227c('0x6c')]:'');}return _0x362f41+')';};var _0x321aa4={'where':{'id':_0x462cd7['params']['id']}},_0x27e8a5,_0x485b23,_0x57d66a,_0x1a5127,_0x55010b;_0x321aa4=_[_0x227c('0x3a')]({},_0x321aa4,_0x462cd7[_0x227c('0x3e')]);return db[_0x227c('0x29')][_0x227c('0x48')](_0x321aa4)[_0x227c('0x21')](function(_0x277041){if(_0x277041){_0x27e8a5=_0x277041;return _0x277041[_0x227c('0x6d')]();}return null;})[_0x227c('0x21')](function(_0x41c98e){if(_0x41c98e){if(!_0x41c98e['length']){throw new db[(_0x227c('0x6e'))][(_0x227c('0x6f'))](_0x227c('0x70'),0x193);}_0x485b23=_0x41c98e;return db['AnalyticMetric'][_0x227c('0x42')]({'raw':!![]});}return null;})[_0x227c('0x21')](function(_0x4fd53c){if(_0x4fd53c){_0x57d66a=_['keyBy'](_0x4fd53c,'id');var _0x3886eb;var _0x461fa4=squel[_0x227c('0x72')]();_0x461fa4[_0x227c('0x73')](_0x27e8a5['table']);for(var _0x142573=0x0;_0x142573<_0x485b23[_0x227c('0x47')];_0x142573+=0x1){_0x3886eb=_0x485b23[_0x142573][_0x227c('0x74')]?_0x57d66a[_0x485b23[_0x142573][_0x227c('0x74')]]['metric']:_0x485b23[_0x142573][_0x227c('0x3d')];_0x3886eb=_0x485b23[_0x142573][_0x227c('0x76')]?_['replace'](_0xd9c691[_0x485b23[_0x142573][_0x227c('0x76')]],'%s',_0x3886eb):_0x3886eb;_0x3886eb=_0x485b23[_0x142573][_0x227c('0x78')]?_[_0x227c('0x77')](_0x1c2793[_0x485b23[_0x142573]['format']],'%s',_0x3886eb):_0x3886eb;if(_0x485b23[_0x142573][_0x227c('0xa6')]){_0x461fa4[_0x227c('0x6a')](_0x3886eb);}_0x485b23[_0x142573][_0x227c('0x79')]&&_0x461fa4[_0x227c('0x7a')](_0x3886eb,_0x485b23[_0x142573]['orderBy']===_0x227c('0x7b')?![]:!![]);_0x461fa4[_0x227c('0x3d')](_0x3886eb,_0x485b23[_0x142573][_0x227c('0x7c')]||_0x3886eb);}if(_0x27e8a5[_0x227c('0x7d')]){_0x27e8a5['joins']=JSON[_0x227c('0x7e')](_0x27e8a5[_0x227c('0x7d')]);for(var _0x4b075b=0x0;_0x4b075b<_0x27e8a5[_0x227c('0x7d')][_0x227c('0x47')];_0x4b075b+=0x1){if(_0x27e8a5[_0x227c('0x7d')][_0x4b075b]['type']&&_[_0x227c('0x63')](_0x389b59,_0x27e8a5[_0x227c('0x7d')][_0x4b075b][_0x227c('0x3b')])&&_0x27e8a5[_0x227c('0x7d')][_0x4b075b][_0x227c('0x7f')]&&_0x27e8a5[_0x227c('0x7d')][_0x4b075b]['foreignTable']&&_0x27e8a5[_0x227c('0x7d')][_0x4b075b][_0x227c('0x81')]){_0x461fa4[_0x27e8a5[_0x227c('0x7d')][_0x4b075b][_0x227c('0x3b')]](_0x27e8a5[_0x227c('0x7d')][_0x4b075b][_0x227c('0x80')],null,util[_0x227c('0x78')](_0x227c('0x8d'),_0x27e8a5['table'],_0x27e8a5[_0x227c('0x7d')][_0x4b075b][_0x227c('0x7f')],_0x27e8a5[_0x227c('0x7d')][_0x4b075b][_0x227c('0x80')],_0x27e8a5[_0x227c('0x7d')][_0x4b075b][_0x227c('0x81')]));}}}if(_0x27e8a5[_0x227c('0x83')]){_0x27e8a5[_0x227c('0x83')]=JSON['parse'](_0x27e8a5[_0x227c('0x83')]);_0x461fa4[_0x227c('0x36')](_0x43cbf3(_0x27e8a5['conditions'][_0x227c('0x6a')]));}_0x55010b=_0x461fa4[_0x227c('0x84')]();_0x461fa4[_0x227c('0x35')](_0x659fde);_0x461fa4[_0x227c('0x1d')](0x0);logger[_0x227c('0x85')](_0x227c('0x86'),_0x461fa4[_0x227c('0x87')]());return db['sequelize'][_0x227c('0x2d')](_0x461fa4[_0x227c('0x87')](),{'type':db['sequelize']['QueryTypes']['SELECT']});}})[_0x227c('0x21')](function(){return{'sql':_0x55010b[_0x227c('0x87')]()};})['then'](respondWithResult(_0x18d236,null))[_0x227c('0x44')](handleError(_0x18d236,null));}; \ No newline at end of file +var _0x5d2b=['alias','%s.%s\x20=\x20%s.%s','Limited\x20Query:','No\x20available\x20data','output','web','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','runReport','right_join','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','map','AnalyticCustomReport','type','key','filters','intersection','model','query','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','count','includeAll','include','findAll','catch','show','params','keys','rawAttributes','fields','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','CustomReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','preview','join','left_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','DESC','joins','parse','foreignTable','parentKey','foreignKey','conditions','clone','debug','toString','sequelize','QueryTypes','SELECT','COUNT(%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','IS\x20EMPTY','Please\x20insert\x20at\x20least\x20one\x20field','orderBy'];(function(_0x928b87,_0x53480a){var _0x1e7638=function(_0x1e2184){while(--_0x1e2184){_0x928b87['push'](_0x928b87['shift']());}};_0x1e7638(++_0x53480a);}(_0x5d2b,0xbb));var _0xb5d2=function(_0x44d3d0,_0xf79b5c){_0x44d3d0=_0x44d3d0-0x0;var _0x2ec80c=_0x5d2b[_0x44d3d0];return _0x2ec80c;};'use strict';var pdf=require(_0xb5d2('0x0'));var emlformat=require(_0xb5d2('0x1'));var rimraf=require(_0xb5d2('0x2'));var zipdir=require(_0xb5d2('0x3'));var jsonpatch=require(_0xb5d2('0x4'));var rp=require('request-promise');var moment=require(_0xb5d2('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb5d2('0x6'));var util=require(_0xb5d2('0x7'));var path=require(_0xb5d2('0x8'));var sox=require(_0xb5d2('0x9'));var csv=require(_0xb5d2('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb5d2('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb5d2('0xc'));var deskjs=require(_0xb5d2('0xd'));var toCsv=require(_0xb5d2('0xa'));var querystring=require(_0xb5d2('0xe'));var Papa=require('papaparse');var Redis=require(_0xb5d2('0xf'));var authService=require(_0xb5d2('0x10'));var qs=require(_0xb5d2('0x11'));var as=require(_0xb5d2('0x12'));var hardwareService=require(_0xb5d2('0x13'));var logger=require('../../config/logger')(_0xb5d2('0x14'));var utils=require('../../config/utils');var config=require(_0xb5d2('0x15'));var db=require(_0xb5d2('0x16'))['db'];function respondWithStatusCode(_0x16fe43,_0x4abfc9){_0x4abfc9=_0x4abfc9||0xcc;return function(_0x499738){if(_0x499738){return _0x16fe43[_0xb5d2('0x17')](_0x4abfc9);}return _0x16fe43[_0xb5d2('0x18')](_0x4abfc9)[_0xb5d2('0x19')]();};}function respondWithResult(_0x2a9bdd,_0x12009e){_0x12009e=_0x12009e||0xc8;return function(_0x3d20d4){if(_0x3d20d4){return _0x2a9bdd[_0xb5d2('0x18')](_0x12009e)[_0xb5d2('0x1a')](_0x3d20d4);}};}function respondWithFilteredResult(_0x4616ff,_0x177f72){return function(_0x4d604c){if(_0x4d604c){var _0x23fc54=_0x4d604c['count'],_0x509c81=_0x177f72[_0xb5d2('0x1b')],_0x4c1c3c=_0x177f72[_0xb5d2('0x1b')]+_0x177f72[_0xb5d2('0x1c')],_0x350355;if(_0x4c1c3c>=_0x23fc54){_0x4c1c3c=_0x23fc54;_0x350355=0xc8;}else{_0x350355=0xce;}_0x4616ff['status'](_0x350355);return _0x4616ff[_0xb5d2('0x1d')](_0xb5d2('0x1e'),_0x509c81+'-'+_0x4c1c3c+'/'+_0x23fc54)[_0xb5d2('0x1a')](_0x4d604c);}return null;};}function patchUpdates(_0x419450){return function(_0x2ee9c0){try{jsonpatch['apply'](_0x2ee9c0,_0x419450,!![]);}catch(_0x3811ce){return BPromise[_0xb5d2('0x1f')](_0x3811ce);}return _0x2ee9c0[_0xb5d2('0x20')]();};}function saveUpdates(_0x10aa1f,_0x6f962e){return function(_0x540ea6){if(_0x540ea6){return _0x540ea6[_0xb5d2('0x21')](_0x10aa1f)[_0xb5d2('0x22')](function(_0x121125){return _0x121125;});}return null;};}function removeEntity(_0x172a48,_0x41489a){return function(_0x4d03c2){if(_0x4d03c2){return _0x4d03c2[_0xb5d2('0x23')]()[_0xb5d2('0x22')](function(){var _0x20fe86=_0x4d03c2[_0xb5d2('0x24')]({'plain':!![]});var _0xb2b36b='CustomReports';return db[_0xb5d2('0x25')]['destroy']({'where':{'type':_0xb2b36b,'resourceId':_0x20fe86['id']}})[_0xb5d2('0x22')](function(){return _0x4d03c2;});})[_0xb5d2('0x22')](function(){_0x172a48[_0xb5d2('0x18')](0xcc)[_0xb5d2('0x19')]();});}};}function handleEntityNotFound(_0x377463,_0x512bab){return function(_0x222428){if(!_0x222428){_0x377463[_0xb5d2('0x17')](0x194);}return _0x222428;};}function handleError(_0x2a6dce,_0x4d2b8a){_0x4d2b8a=_0x4d2b8a||0x1f4;return function(_0x5a7352){logger[_0xb5d2('0x26')](_0x5a7352[_0xb5d2('0x27')]);if(_0x5a7352[_0xb5d2('0x28')]){delete _0x5a7352['name'];}_0x2a6dce[_0xb5d2('0x18')](_0x4d2b8a)['send'](_0x5a7352);};}exports['index']=function(_0x1b0bcb,_0x118f03){var _0x45eb5b={},_0x2eb45b={},_0x227420={'count':0x0,'rows':[]};var _0x2a1ed4=_[_0xb5d2('0x29')](db[_0xb5d2('0x2a')]['rawAttributes'],function(_0x5225d8){return{'name':_0x5225d8['fieldName'],'type':_0x5225d8[_0xb5d2('0x2b')][_0xb5d2('0x2c')]};});_0x2eb45b['model']=_['map'](_0x2a1ed4,_0xb5d2('0x28'));_0x2eb45b['query']=_['keys'](_0x1b0bcb['query']);_0x2eb45b[_0xb5d2('0x2d')]=_[_0xb5d2('0x2e')](_0x2eb45b[_0xb5d2('0x2f')],_0x2eb45b[_0xb5d2('0x30')]);_0x45eb5b['attributes']=_[_0xb5d2('0x2e')](_0x2eb45b[_0xb5d2('0x2f')],qs['fields'](_0x1b0bcb[_0xb5d2('0x30')]['fields']));_0x45eb5b[_0xb5d2('0x31')]=_0x45eb5b[_0xb5d2('0x31')][_0xb5d2('0x32')]?_0x45eb5b[_0xb5d2('0x31')]:_0x2eb45b[_0xb5d2('0x2f')];if(!_0x1b0bcb['query'][_0xb5d2('0x33')](_0xb5d2('0x34'))){_0x45eb5b['limit']=qs[_0xb5d2('0x1c')](_0x1b0bcb[_0xb5d2('0x30')]['limit']);_0x45eb5b[_0xb5d2('0x1b')]=qs[_0xb5d2('0x1b')](_0x1b0bcb['query'][_0xb5d2('0x1b')]);}_0x45eb5b[_0xb5d2('0x35')]=qs[_0xb5d2('0x36')](_0x1b0bcb[_0xb5d2('0x30')][_0xb5d2('0x36')]);_0x45eb5b['where']=qs[_0xb5d2('0x2d')](_['pick'](_0x1b0bcb[_0xb5d2('0x30')],_0x2eb45b[_0xb5d2('0x2d')]));if(_0x1b0bcb[_0xb5d2('0x30')][_0xb5d2('0x37')]){_0x45eb5b[_0xb5d2('0x38')]=_[_0xb5d2('0x39')](_0x45eb5b[_0xb5d2('0x38')],{'$or':_[_0xb5d2('0x29')](_0x2a1ed4,function(_0x4e97f9){if(_0x4e97f9['type'][_0xb5d2('0x2c')]!==_0xb5d2('0x3a')){var _0x32d786={};_0x32d786[_0x4e97f9['field']]={'$like':'%'+_0x1b0bcb[_0xb5d2('0x30')][_0xb5d2('0x37')]+'%'};return _0x32d786;}})});}_0x45eb5b=_[_0xb5d2('0x39')]({},_0x45eb5b,_0x1b0bcb[_0xb5d2('0x3b')]);var _0x489f73={'where':_0x45eb5b[_0xb5d2('0x38')]};return db['AnalyticCustomReport'][_0xb5d2('0x3c')](_0x489f73)[_0xb5d2('0x22')](function(_0x2398ba){_0x227420[_0xb5d2('0x3c')]=_0x2398ba;if(_0x1b0bcb['query'][_0xb5d2('0x3d')]){_0x45eb5b[_0xb5d2('0x3e')]=[{'all':!![]}];}return db[_0xb5d2('0x2a')][_0xb5d2('0x3f')](_0x45eb5b);})['then'](function(_0x3def9d){_0x227420['rows']=_0x3def9d;return _0x227420;})[_0xb5d2('0x22')](respondWithFilteredResult(_0x118f03,_0x45eb5b))[_0xb5d2('0x40')](handleError(_0x118f03,null));};exports[_0xb5d2('0x41')]=function(_0x301c79,_0xa70adc){var _0x475edc={'raw':![],'where':{'id':_0x301c79[_0xb5d2('0x42')]['id']}},_0x192c00={};_0x192c00[_0xb5d2('0x2f')]=_[_0xb5d2('0x43')](db[_0xb5d2('0x2a')][_0xb5d2('0x44')]);_0x192c00[_0xb5d2('0x30')]=_[_0xb5d2('0x43')](_0x301c79[_0xb5d2('0x30')]);_0x192c00[_0xb5d2('0x2d')]=_[_0xb5d2('0x2e')](_0x192c00['model'],_0x192c00[_0xb5d2('0x30')]);_0x475edc[_0xb5d2('0x31')]=_[_0xb5d2('0x2e')](_0x192c00[_0xb5d2('0x2f')],qs[_0xb5d2('0x45')](_0x301c79[_0xb5d2('0x30')]['fields']));_0x475edc[_0xb5d2('0x31')]=_0x475edc[_0xb5d2('0x31')]['length']?_0x475edc['attributes']:_0x192c00[_0xb5d2('0x2f')];if(_0x301c79['query'][_0xb5d2('0x3d')]){_0x475edc[_0xb5d2('0x3e')]=[{'all':!![]}];}_0x475edc=_[_0xb5d2('0x39')]({},_0x475edc,_0x301c79[_0xb5d2('0x3b')]);return db[_0xb5d2('0x2a')]['find'](_0x475edc)[_0xb5d2('0x22')](handleEntityNotFound(_0xa70adc,null))[_0xb5d2('0x22')](respondWithResult(_0xa70adc,null))[_0xb5d2('0x40')](handleError(_0xa70adc,null));};exports[_0xb5d2('0x46')]=function(_0x52a65f,_0x228987){return db[_0xb5d2('0x2a')]['create'](_0x52a65f[_0xb5d2('0x47')],{})[_0xb5d2('0x22')](function(_0x54b87c){var _0x264d4d=_0x52a65f[_0xb5d2('0x48')]['get']({'plain':!![]});if(!_0x264d4d)throw new Error(_0xb5d2('0x49'));if(_0x264d4d[_0xb5d2('0x4a')]==='user'){var _0x31b1d3=_0x54b87c[_0xb5d2('0x24')]({'plain':!![]});var _0x4a0c90='Reports';return db[_0xb5d2('0x4b')]['find']({'where':{'name':_0x4a0c90,'userProfileId':_0x264d4d['userProfileId']},'raw':!![]})[_0xb5d2('0x22')](function(_0x5327f5){if(_0x5327f5&&_0x5327f5[_0xb5d2('0x4c')]===0x0){return db[_0xb5d2('0x25')]['create']({'name':_0x31b1d3[_0xb5d2('0x28')],'resourceId':_0x31b1d3['id'],'type':_0xb5d2('0x4d'),'sectionId':_0x5327f5['id']},{})[_0xb5d2('0x22')](function(){return _0x54b87c;});}else{return _0x54b87c;}})[_0xb5d2('0x40')](function(_0x15526c){logger[_0xb5d2('0x26')](_0xb5d2('0x4e'),_0x15526c);throw _0x15526c;});}return _0x54b87c;})['then'](respondWithResult(_0x228987,0xc9))[_0xb5d2('0x40')](handleError(_0x228987,null));};exports[_0xb5d2('0x21')]=function(_0x47539d,_0x451844){if(_0x47539d[_0xb5d2('0x47')]['id']){delete _0x47539d[_0xb5d2('0x47')]['id'];}return db[_0xb5d2('0x2a')][_0xb5d2('0x4f')]({'where':{'id':_0x47539d['params']['id']}})[_0xb5d2('0x22')](handleEntityNotFound(_0x451844,null))['then'](saveUpdates(_0x47539d['body'],null))[_0xb5d2('0x22')](respondWithResult(_0x451844,null))[_0xb5d2('0x40')](handleError(_0x451844,null));};exports[_0xb5d2('0x23')]=function(_0x1b0df9,_0x1e9402){return db['AnalyticCustomReport'][_0xb5d2('0x4f')]({'where':{'id':_0x1b0df9['params']['id']}})[_0xb5d2('0x22')](handleEntityNotFound(_0x1e9402,null))[_0xb5d2('0x22')](removeEntity(_0x1e9402,null))[_0xb5d2('0x40')](handleError(_0x1e9402,null));};exports[_0xb5d2('0x50')]=function(_0x17cfd7,_0x23dbae){var _0x16ec47=0xa;var _0x3a502a=[_0xb5d2('0x51'),_0xb5d2('0x52'),'right_join',_0xb5d2('0x53')];var _0xccf812={'SUM':_0xb5d2('0x54'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xb5d2('0x55'),'MAX':'MAX(%s)','MIN':_0xb5d2('0x56'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb5d2('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xb5d2('0x58')};var _0x4fc496={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xb5d2('0x59'),'ROUND':_0xb5d2('0x5a'),'UNIX_TIMESTAMP':_0xb5d2('0x5b')};var _0x3c25a1=function(_0x2d1ad2){return!_[_0xb5d2('0x5c')]([_0xb5d2('0x5d'),_0xb5d2('0x5e'),'IS\x20EMPTY',_0xb5d2('0x5f')],_0x2d1ad2);};var _0x1420b3=function(_0x526b39){if(!_0x526b39||!_0x526b39[_0xb5d2('0x60')]['length']){return'';}for(var _0x22f830='(',_0x214839=0x0;_0x214839<_0x526b39['rules']['length'];_0x214839+=0x1){_0x214839>0x0&&(_0x22f830+='\x20'+_0x526b39[_0xb5d2('0x61')]+'\x20');_0x22f830+=_0x526b39[_0xb5d2('0x60')][_0x214839][_0xb5d2('0x62')]?_0x1420b3(_0x526b39[_0xb5d2('0x60')][_0x214839][_0xb5d2('0x62')]):_0x526b39[_0xb5d2('0x60')][_0x214839][_0xb5d2('0x63')]+'\x20'+_0x526b39['rules'][_0x214839][_0xb5d2('0x64')]+(_0x3c25a1(_0x526b39['rules'][_0x214839][_0xb5d2('0x64')])?'\x20'+_0x526b39['rules'][_0x214839][_0xb5d2('0x65')]:'');}return _0x22f830+')';};var _0x66c01c={'where':{'id':_0x17cfd7[_0xb5d2('0x42')]['id']}},_0xbc2c1f,_0x9d984b,_0x2d38f2,_0x33dc98,_0x718d7;_0x66c01c=_['merge']({},_0x66c01c,_0x17cfd7[_0xb5d2('0x3b')]);return db[_0xb5d2('0x2a')]['find'](_0x66c01c)[_0xb5d2('0x22')](function(_0x33519e){if(_0x33519e){_0xbc2c1f=_0x33519e;return _0x33519e[_0xb5d2('0x66')]();}return null;})[_0xb5d2('0x22')](function(_0x29e677){if(_0x29e677){if(!_0x29e677[_0xb5d2('0x32')]){throw new db[(_0xb5d2('0x67'))][(_0xb5d2('0x68'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x9d984b=_0x29e677;return db[_0xb5d2('0x69')][_0xb5d2('0x3f')]({'raw':!![]});}return null;})[_0xb5d2('0x22')](function(_0x130d39){if(_0x130d39){_0x2d38f2=_[_0xb5d2('0x6a')](_0x130d39,'id');var _0x3d116b;var _0x472251=squel[_0xb5d2('0x6b')]();_0x472251[_0xb5d2('0x6c')](_0xbc2c1f[_0xb5d2('0x6d')]);for(var _0x3ce1e8=0x0;_0x3ce1e8<_0x9d984b[_0xb5d2('0x32')];_0x3ce1e8+=0x1){_0x3d116b=_0x9d984b[_0x3ce1e8][_0xb5d2('0x6e')]?_0x2d38f2[_0x9d984b[_0x3ce1e8][_0xb5d2('0x6e')]][_0xb5d2('0x6f')]:_0x9d984b[_0x3ce1e8][_0xb5d2('0x63')];_0x3d116b=_0x9d984b[_0x3ce1e8][_0xb5d2('0x70')]?_[_0xb5d2('0x71')](_0xccf812[_0x9d984b[_0x3ce1e8][_0xb5d2('0x70')]],'%s',_0x3d116b):_0x3d116b;_0x3d116b=_0x9d984b[_0x3ce1e8]['format']?_['replace'](_0x4fc496[_0x9d984b[_0x3ce1e8][_0xb5d2('0x72')]],'%s',_0x3d116b):_0x3d116b;if(_0x9d984b[_0x3ce1e8][_0xb5d2('0x73')]){_0x472251[_0xb5d2('0x62')](_0x3d116b);}_0x9d984b[_0x3ce1e8]['orderBy']&&_0x472251[_0xb5d2('0x35')](_0x3d116b,_0x9d984b[_0x3ce1e8]['orderBy']===_0xb5d2('0x74')?![]:!![]);_0x472251[_0xb5d2('0x63')](_0x3d116b,_0x9d984b[_0x3ce1e8]['alias']||_0x3d116b);}if(_0xbc2c1f[_0xb5d2('0x75')]){_0xbc2c1f[_0xb5d2('0x75')]=JSON[_0xb5d2('0x76')](_0xbc2c1f[_0xb5d2('0x75')]);for(var _0x4a5af8=0x0;_0x4a5af8<_0xbc2c1f[_0xb5d2('0x75')][_0xb5d2('0x32')];_0x4a5af8+=0x1){if(_0xbc2c1f[_0xb5d2('0x75')][_0x4a5af8][_0xb5d2('0x2b')]&&_[_0xb5d2('0x5c')](_0x3a502a,_0xbc2c1f[_0xb5d2('0x75')][_0x4a5af8][_0xb5d2('0x2b')])&&_0xbc2c1f[_0xb5d2('0x75')][_0x4a5af8]['parentKey']&&_0xbc2c1f[_0xb5d2('0x75')][_0x4a5af8][_0xb5d2('0x77')]&&_0xbc2c1f[_0xb5d2('0x75')][_0x4a5af8]['foreignKey']){_0x472251[_0xbc2c1f['joins'][_0x4a5af8][_0xb5d2('0x2b')]](_0xbc2c1f[_0xb5d2('0x75')][_0x4a5af8][_0xb5d2('0x77')],null,util[_0xb5d2('0x72')]('%s.%s\x20=\x20%s.%s',_0xbc2c1f[_0xb5d2('0x6d')],_0xbc2c1f[_0xb5d2('0x75')][_0x4a5af8][_0xb5d2('0x78')],_0xbc2c1f[_0xb5d2('0x75')][_0x4a5af8]['foreignTable'],_0xbc2c1f[_0xb5d2('0x75')][_0x4a5af8][_0xb5d2('0x79')]));}}}if(_0xbc2c1f['conditions']){_0xbc2c1f[_0xb5d2('0x7a')]=JSON[_0xb5d2('0x76')](_0xbc2c1f[_0xb5d2('0x7a')]);_0x472251[_0xb5d2('0x38')](_0x1420b3(_0xbc2c1f[_0xb5d2('0x7a')][_0xb5d2('0x62')]));}_0x718d7=_0x472251[_0xb5d2('0x7b')]();_0x472251[_0xb5d2('0x1c')](_0x16ec47);_0x472251[_0xb5d2('0x1b')](0x0);logger[_0xb5d2('0x7c')]('Limited\x20Query:',_0x472251[_0xb5d2('0x7d')]());return db[_0xb5d2('0x7e')][_0xb5d2('0x30')](_0x472251[_0xb5d2('0x7d')](),{'type':db['sequelize'][_0xb5d2('0x7f')][_0xb5d2('0x80')]});}})['then'](respondWithResult(_0x23dbae,null))[_0xb5d2('0x40')](handleError(_0x23dbae,null));};function runReport(_0x55a113,_0x17e5d8,_0x48a937){var _0x3cda0f=_0x17e5d8['name'];var _0x4fb430=0xa;var _0x4206ba=[_0xb5d2('0x51'),_0xb5d2('0x52'),'right_join','cross_join'];var _0x467502={'SUM':_0xb5d2('0x54'),'COUNT':_0xb5d2('0x81'),'COUNT DISTINCT':_0xb5d2('0x55'),'MAX':_0xb5d2('0x82'),'MIN':_0xb5d2('0x56'),'AVG':_0xb5d2('0x83'),'GROUP_CONCAT':_0xb5d2('0x57'),'GROUP_CONCAT ASC':_0xb5d2('0x84'),'GROUP_CONCAT DESC':_0xb5d2('0x58')};var _0x345b8f={'SEC_TO_TIME':_0xb5d2('0x85'),'DATE':'DATE(%s)','HOUR':_0xb5d2('0x59'),'ROUND':_0xb5d2('0x5a'),'UNIX_TIMESTAMP':_0xb5d2('0x5b')};var _0x3397aa=function(_0x347b0a){return!_[_0xb5d2('0x5c')]([_0xb5d2('0x5d'),_0xb5d2('0x5e'),_0xb5d2('0x86'),'IS\x20NOT\x20EMPTY'],_0x347b0a);};var _0xd793eb=function(_0x1c45e3){if(!_0x1c45e3||!_0x1c45e3[_0xb5d2('0x60')]['length']){return'';}for(var _0x2365d8='(',_0x44bbb6=0x0;_0x44bbb6<_0x1c45e3[_0xb5d2('0x60')][_0xb5d2('0x32')];_0x44bbb6+=0x1){_0x44bbb6>0x0&&(_0x2365d8+='\x20'+_0x1c45e3[_0xb5d2('0x61')]+'\x20');_0x2365d8+=_0x1c45e3[_0xb5d2('0x60')][_0x44bbb6][_0xb5d2('0x62')]?_0xd793eb(_0x1c45e3[_0xb5d2('0x60')][_0x44bbb6][_0xb5d2('0x62')]):_0x1c45e3[_0xb5d2('0x60')][_0x44bbb6]['field']+'\x20'+_0x1c45e3[_0xb5d2('0x60')][_0x44bbb6][_0xb5d2('0x64')]+(_0x3397aa(_0x1c45e3[_0xb5d2('0x60')][_0x44bbb6][_0xb5d2('0x64')])?'\x20'+_0x1c45e3[_0xb5d2('0x60')][_0x44bbb6][_0xb5d2('0x65')]:'');}return _0x2365d8+')';};var _0x59c041={'where':{'id':_0x55a113['id']}},_0x46cb63,_0x5a0d34,_0x1f4e8d,_0x2c000e,_0x3797a4;_0x59c041=_[_0xb5d2('0x39')]({},_0x59c041,_0x48a937);return db[_0xb5d2('0x2a')]['find'](_0x59c041)[_0xb5d2('0x22')](function(_0x1aa3f6){if(_0x1aa3f6){_0x46cb63=_0x1aa3f6;return _0x1aa3f6[_0xb5d2('0x66')]();}return null;})[_0xb5d2('0x22')](function(_0x496c4d){if(_0x496c4d){if(!_0x496c4d[_0xb5d2('0x32')]){throw new db[(_0xb5d2('0x67'))]['ValidationErrorItem'](_0xb5d2('0x87'),0x193);}_0x5a0d34=_0x496c4d;return db[_0xb5d2('0x69')][_0xb5d2('0x3f')]({'raw':!![]});}return null;})['then'](function(_0x17bde2){if(_0x17bde2){_0x1f4e8d=_[_0xb5d2('0x6a')](_0x17bde2,'id');var _0x2a469c;var _0x2e6577=squel[_0xb5d2('0x6b')]();_0x2e6577[_0xb5d2('0x6c')](_0x46cb63[_0xb5d2('0x6d')]);for(var _0x1deed6=0x0;_0x1deed6<_0x5a0d34[_0xb5d2('0x32')];_0x1deed6+=0x1){_0x2a469c=_0x5a0d34[_0x1deed6]['MetricId']?_0x1f4e8d[_0x5a0d34[_0x1deed6][_0xb5d2('0x6e')]][_0xb5d2('0x6f')]:_0x5a0d34[_0x1deed6][_0xb5d2('0x63')];_0x2a469c=_0x5a0d34[_0x1deed6]['function']?_['replace'](_0x467502[_0x5a0d34[_0x1deed6][_0xb5d2('0x70')]],'%s',_0x2a469c):_0x2a469c;_0x2a469c=_0x5a0d34[_0x1deed6][_0xb5d2('0x72')]?_[_0xb5d2('0x71')](_0x345b8f[_0x5a0d34[_0x1deed6][_0xb5d2('0x72')]],'%s',_0x2a469c):_0x2a469c;if(_0x5a0d34[_0x1deed6][_0xb5d2('0x73')]){_0x2e6577[_0xb5d2('0x62')](_0x2a469c);}_0x5a0d34[_0x1deed6][_0xb5d2('0x88')]&&_0x2e6577[_0xb5d2('0x35')](_0x2a469c,_0x5a0d34[_0x1deed6][_0xb5d2('0x88')]==='DESC'?![]:!![]);_0x2e6577['field'](_0x2a469c,_0x5a0d34[_0x1deed6][_0xb5d2('0x89')]||_0x2a469c);}if(_0x46cb63[_0xb5d2('0x75')]){_0x46cb63['joins']=JSON[_0xb5d2('0x76')](_0x46cb63[_0xb5d2('0x75')]);for(var _0x2a3fde=0x0;_0x2a3fde<_0x46cb63[_0xb5d2('0x75')][_0xb5d2('0x32')];_0x2a3fde+=0x1){if(_0x46cb63[_0xb5d2('0x75')][_0x2a3fde][_0xb5d2('0x2b')]&&_[_0xb5d2('0x5c')](_0x4206ba,_0x46cb63[_0xb5d2('0x75')][_0x2a3fde]['type'])&&_0x46cb63[_0xb5d2('0x75')][_0x2a3fde]['parentKey']&&_0x46cb63[_0xb5d2('0x75')][_0x2a3fde]['foreignTable']&&_0x46cb63[_0xb5d2('0x75')][_0x2a3fde][_0xb5d2('0x79')]){_0x2e6577[_0x46cb63['joins'][_0x2a3fde]['type']](_0x46cb63[_0xb5d2('0x75')][_0x2a3fde][_0xb5d2('0x77')],null,util[_0xb5d2('0x72')](_0xb5d2('0x8a'),_0x46cb63[_0xb5d2('0x6d')],_0x46cb63[_0xb5d2('0x75')][_0x2a3fde][_0xb5d2('0x78')],_0x46cb63[_0xb5d2('0x75')][_0x2a3fde]['foreignTable'],_0x46cb63[_0xb5d2('0x75')][_0x2a3fde][_0xb5d2('0x79')]));}}}if(_0x46cb63[_0xb5d2('0x7a')]){_0x46cb63[_0xb5d2('0x7a')]=JSON[_0xb5d2('0x76')](_0x46cb63[_0xb5d2('0x7a')]);_0x2e6577[_0xb5d2('0x38')](_0xd793eb(_0x46cb63['conditions'][_0xb5d2('0x62')]));}_0x3797a4=_0x2e6577['clone']();_0x2e6577[_0xb5d2('0x1c')](_0x4fb430);_0x2e6577[_0xb5d2('0x1b')](0x0);logger[_0xb5d2('0x7c')](_0xb5d2('0x8b'),_0x2e6577[_0xb5d2('0x7d')]());return db[_0xb5d2('0x7e')][_0xb5d2('0x30')](_0x2e6577[_0xb5d2('0x7d')](),{'type':db[_0xb5d2('0x7e')]['QueryTypes'][_0xb5d2('0x80')]});}})['then'](function(_0x168c00){if(!_0x168c00['length']){throw new db['Sequelize']['ValidationErrorItem'](_0xb5d2('0x8c'),0xcc);}if(_0x17e5d8[_0xb5d2('0x8d')]===_0xb5d2('0x8e')){return null;}var _0x5cee26=_[_0xb5d2('0x39')](_0x17e5d8,{'name':_0x17e5d8['fullPath']||_0x17e5d8['name']||_0x46cb63[_0xb5d2('0x28')],'basename':_0x3cda0f,'savename':util[_0xb5d2('0x72')](_0xb5d2('0x8f'),_0x17e5d8[_0xb5d2('0x28')]||_0x46cb63['name'],require(_0xb5d2('0x90'))[_0xb5d2('0x91')](0x4),_0x17e5d8[_0xb5d2('0x8d')]||_0xb5d2('0x92')),'reportId':_0x46cb63['id'],'reportType':_0xb5d2('0x93')});return db[_0xb5d2('0x94')][_0xb5d2('0x46')](_0x5cee26,{'raw':!![]});})['then'](function(_0x163ddf){if(_0x46cb63['table']===_0xb5d2('0x95')){_0x3797a4[_0xb5d2('0x38')](_0x46cb63[_0xb5d2('0x6d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x17e5d8[_0xb5d2('0x96')],_0x17e5d8[_0xb5d2('0x97')]);}else{_0x3797a4[_0xb5d2('0x38')](_0x46cb63[_0xb5d2('0x6d')]+_0xb5d2('0x98'),_0x17e5d8[_0xb5d2('0x96')],_0x17e5d8[_0xb5d2('0x97')]);}if(_0x163ddf){logger[_0xb5d2('0x99')](_0xb5d2('0x9a'),_0x3797a4['toString']());require(_0xb5d2('0x9b'))[_0xb5d2('0x9c')](path[_0xb5d2('0x51')](__dirname,'../../components/export/',_0x163ddf[_0xb5d2('0x8d')]),[_0x163ddf['id'],_0x3797a4[_0xb5d2('0x7d')](),path[_0xb5d2('0x51')](__dirname,_0xb5d2('0x9d'),_0x163ddf[_0xb5d2('0x9e')]),_0x3cda0f]);return _0x163ddf;}else{var _0x869794=squel[_0xb5d2('0x6b')]();_0x869794['from']('('+_0x3797a4[_0xb5d2('0x7d')]()+')',_0xb5d2('0x9f'));_0x869794[_0xb5d2('0x63')]('COUNT(*)',_0xb5d2('0x3c'));_0x3797a4['limit'](_0x17e5d8['limit']||_0x4fb430);_0x3797a4[_0xb5d2('0x1b')](_0x17e5d8[_0xb5d2('0x1b')]||0x0);return db[_0xb5d2('0x7e')][_0xb5d2('0x30')](_0x869794[_0xb5d2('0x7d')](),{'type':db[_0xb5d2('0x7e')][_0xb5d2('0x7f')][_0xb5d2('0x80')]})[_0xb5d2('0x22')](function(_0x3bb07a){if(!_0x3bb07a[_0xb5d2('0x32')]){_0x2c000e=0x0;}else{_0x2c000e=_0x3bb07a[0x0][_0xb5d2('0x3c')]||0x0;}return db['sequelize'][_0xb5d2('0x30')](_0x3797a4[_0xb5d2('0x7d')](),{'type':db[_0xb5d2('0x7e')][_0xb5d2('0x7f')]['SELECT']});})[_0xb5d2('0x22')](function(_0x27e3c9){return{'rows':_0x27e3c9||[],'count':_0x2c000e};});}});}exports['run']=function(_0x43a5e9,_0x15864c){return runReport(_0x43a5e9[_0xb5d2('0x42')],_0x43a5e9['query'],_0x43a5e9['options'])[_0xb5d2('0x22')](respondWithResult(_0x15864c,null))[_0xb5d2('0x40')](handleError(_0x15864c,null));};exports[_0xb5d2('0xa0')]=runReport;exports[_0xb5d2('0x30')]=function(_0x51ca04,_0x2f63b2){var _0x29a710=0xa;var _0xc4db2e=[_0xb5d2('0x51'),_0xb5d2('0x52'),_0xb5d2('0xa1'),_0xb5d2('0x53')];var _0x4d789e={'SUM':_0xb5d2('0x54'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xb5d2('0x82'),'MIN':_0xb5d2('0x56'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb5d2('0x57'),'GROUP_CONCAT ASC':_0xb5d2('0x84'),'GROUP_CONCAT DESC':_0xb5d2('0x58')};var _0x35c6f7={'SEC_TO_TIME':_0xb5d2('0x85'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xb5d2('0x5a'),'UNIX_TIMESTAMP':_0xb5d2('0x5b')};var _0x35c3bd=function(_0x32071b){return!_['includes']([_0xb5d2('0x5d'),_0xb5d2('0x5e'),_0xb5d2('0x86'),_0xb5d2('0x5f')],_0x32071b);};var _0x535f36=function(_0x155895){if(!_0x155895||!_0x155895['rules']['length']){return'';}for(var _0x5f1bcf='(',_0x4b80a4=0x0;_0x4b80a4<_0x155895[_0xb5d2('0x60')][_0xb5d2('0x32')];_0x4b80a4+=0x1){_0x4b80a4>0x0&&(_0x5f1bcf+='\x20'+_0x155895[_0xb5d2('0x61')]+'\x20');_0x5f1bcf+=_0x155895[_0xb5d2('0x60')][_0x4b80a4]['group']?_0x535f36(_0x155895['rules'][_0x4b80a4][_0xb5d2('0x62')]):_0x155895[_0xb5d2('0x60')][_0x4b80a4][_0xb5d2('0x63')]+'\x20'+_0x155895[_0xb5d2('0x60')][_0x4b80a4][_0xb5d2('0x64')]+(_0x35c3bd(_0x155895[_0xb5d2('0x60')][_0x4b80a4][_0xb5d2('0x64')])?'\x20'+_0x155895[_0xb5d2('0x60')][_0x4b80a4][_0xb5d2('0x65')]:'');}return _0x5f1bcf+')';};var _0x31356c={'where':{'id':_0x51ca04[_0xb5d2('0x42')]['id']}},_0x213419,_0x53d6d9,_0x4e8ea8,_0x1b2949,_0x236678;_0x31356c=_[_0xb5d2('0x39')]({},_0x31356c,_0x51ca04[_0xb5d2('0x3b')]);return db['AnalyticCustomReport']['find'](_0x31356c)[_0xb5d2('0x22')](function(_0x10267b){if(_0x10267b){_0x213419=_0x10267b;return _0x10267b[_0xb5d2('0x66')]();}return null;})[_0xb5d2('0x22')](function(_0x51302f){if(_0x51302f){if(!_0x51302f[_0xb5d2('0x32')]){throw new db[(_0xb5d2('0x67'))][(_0xb5d2('0x68'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x53d6d9=_0x51302f;return db[_0xb5d2('0x69')][_0xb5d2('0x3f')]({'raw':!![]});}return null;})[_0xb5d2('0x22')](function(_0x2048bd){if(_0x2048bd){_0x4e8ea8=_['keyBy'](_0x2048bd,'id');var _0x4f4fd6;var _0x3e563f=squel[_0xb5d2('0x6b')]();_0x3e563f[_0xb5d2('0x6c')](_0x213419[_0xb5d2('0x6d')]);for(var _0x45329b=0x0;_0x45329b<_0x53d6d9['length'];_0x45329b+=0x1){_0x4f4fd6=_0x53d6d9[_0x45329b][_0xb5d2('0x6e')]?_0x4e8ea8[_0x53d6d9[_0x45329b][_0xb5d2('0x6e')]][_0xb5d2('0x6f')]:_0x53d6d9[_0x45329b][_0xb5d2('0x63')];_0x4f4fd6=_0x53d6d9[_0x45329b][_0xb5d2('0x70')]?_[_0xb5d2('0x71')](_0x4d789e[_0x53d6d9[_0x45329b][_0xb5d2('0x70')]],'%s',_0x4f4fd6):_0x4f4fd6;_0x4f4fd6=_0x53d6d9[_0x45329b]['format']?_[_0xb5d2('0x71')](_0x35c6f7[_0x53d6d9[_0x45329b]['format']],'%s',_0x4f4fd6):_0x4f4fd6;if(_0x53d6d9[_0x45329b][_0xb5d2('0x73')]){_0x3e563f[_0xb5d2('0x62')](_0x4f4fd6);}_0x53d6d9[_0x45329b]['orderBy']&&_0x3e563f[_0xb5d2('0x35')](_0x4f4fd6,_0x53d6d9[_0x45329b][_0xb5d2('0x88')]===_0xb5d2('0x74')?![]:!![]);_0x3e563f[_0xb5d2('0x63')](_0x4f4fd6,_0x53d6d9[_0x45329b][_0xb5d2('0x89')]||_0x4f4fd6);}if(_0x213419[_0xb5d2('0x75')]){_0x213419[_0xb5d2('0x75')]=JSON[_0xb5d2('0x76')](_0x213419[_0xb5d2('0x75')]);for(var _0x2463f6=0x0;_0x2463f6<_0x213419[_0xb5d2('0x75')][_0xb5d2('0x32')];_0x2463f6+=0x1){if(_0x213419[_0xb5d2('0x75')][_0x2463f6][_0xb5d2('0x2b')]&&_[_0xb5d2('0x5c')](_0xc4db2e,_0x213419['joins'][_0x2463f6][_0xb5d2('0x2b')])&&_0x213419[_0xb5d2('0x75')][_0x2463f6][_0xb5d2('0x78')]&&_0x213419[_0xb5d2('0x75')][_0x2463f6][_0xb5d2('0x77')]&&_0x213419['joins'][_0x2463f6][_0xb5d2('0x79')]){_0x3e563f[_0x213419[_0xb5d2('0x75')][_0x2463f6][_0xb5d2('0x2b')]](_0x213419['joins'][_0x2463f6][_0xb5d2('0x77')],null,util[_0xb5d2('0x72')]('%s.%s\x20=\x20%s.%s',_0x213419[_0xb5d2('0x6d')],_0x213419[_0xb5d2('0x75')][_0x2463f6][_0xb5d2('0x78')],_0x213419[_0xb5d2('0x75')][_0x2463f6]['foreignTable'],_0x213419[_0xb5d2('0x75')][_0x2463f6][_0xb5d2('0x79')]));}}}if(_0x213419[_0xb5d2('0x7a')]){_0x213419[_0xb5d2('0x7a')]=JSON[_0xb5d2('0x76')](_0x213419[_0xb5d2('0x7a')]);_0x3e563f[_0xb5d2('0x38')](_0x535f36(_0x213419['conditions'][_0xb5d2('0x62')]));}_0x236678=_0x3e563f['clone']();_0x3e563f['limit'](_0x29a710);_0x3e563f['offset'](0x0);logger[_0xb5d2('0x7c')](_0xb5d2('0x8b'),_0x3e563f['toString']());return db[_0xb5d2('0x7e')][_0xb5d2('0x30')](_0x3e563f[_0xb5d2('0x7d')](),{'type':db['sequelize'][_0xb5d2('0x7f')][_0xb5d2('0x80')]});}})['then'](function(){return{'sql':_0x236678[_0xb5d2('0x7d')]()};})[_0xb5d2('0x22')](respondWithResult(_0x2f63b2,null))[_0xb5d2('0x40')](handleError(_0x2f63b2,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index fa4cdd5..55b5c8d 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 _0x7938=['define','AnalyticCustomReport','analytics_custom_reports','lodash','util','api','bluebird','request-promise','path','../../config/environment','./analyticCustomReport.attributes','exports'];(function(_0x571d9e,_0x1f3133){var _0x2f5a02=function(_0x3f6f3c){while(--_0x3f6f3c){_0x571d9e['push'](_0x571d9e['shift']());}};_0x2f5a02(++_0x1f3133);}(_0x7938,0x1cb));var _0x8793=function(_0x5e3cd8,_0x4722f4){_0x5e3cd8=_0x5e3cd8-0x0;var _0x33ef3d=_0x7938[_0x5e3cd8];return _0x33ef3d;};'use strict';var _=require(_0x8793('0x0'));var util=require(_0x8793('0x1'));var logger=require('../../config/logger')(_0x8793('0x2'));var moment=require('moment');var BPromise=require(_0x8793('0x3'));var rp=require(_0x8793('0x4'));var fs=require('fs');var path=require(_0x8793('0x5'));var rimraf=require('rimraf');var config=require(_0x8793('0x6'));var attributes=require(_0x8793('0x7'));module[_0x8793('0x8')]=function(_0x2df293,_0x2ec908){return _0x2df293[_0x8793('0x9')](_0x8793('0xa'),attributes,{'tableName':_0x8793('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x80b4=['path','./analyticCustomReport.attributes','define','AnalyticCustomReport','analytics_custom_reports','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x27f3af,_0x3cadbc){var _0x45d434=function(_0x5c13d6){while(--_0x5c13d6){_0x27f3af['push'](_0x27f3af['shift']());}};_0x45d434(++_0x3cadbc);}(_0x80b4,0x195));var _0x480b=function(_0xad1a12,_0x12b08e){_0xad1a12=_0xad1a12-0x0;var _0x2ace3f=_0x80b4[_0xad1a12];return _0x2ace3f;};'use strict';var _=require('lodash');var util=require(_0x480b('0x0'));var logger=require(_0x480b('0x1'))('api');var moment=require(_0x480b('0x2'));var BPromise=require(_0x480b('0x3'));var rp=require(_0x480b('0x4'));var fs=require('fs');var path=require(_0x480b('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x480b('0x6'));module['exports']=function(_0x5560a5,_0x4e073b){return _0x5560a5[_0x480b('0x7')](_0x480b('0x8'),attributes,{'tableName':_0x480b('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js index 8bc5806..2ecf81c 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 _0x7b75=['code','AnalyticCustomReport,\x20%s,\x20%s','message','info','result','catch','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','request\x20sent','debug','error'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x7b75,0x110));var _0x57b7=function(_0x595318,_0x2de91d){_0x595318=_0x595318-0x0;var _0x30e136=_0x7b75[_0x595318];return _0x30e136;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x57b7('0x0'));var BPromise=require('bluebird');var rs=require(_0x57b7('0x1'));var fs=require('fs');var Redis=require(_0x57b7('0x2'));var db=require(_0x57b7('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x57b7('0x4'));var config=require(_0x57b7('0x5'));var jayson=require(_0x57b7('0x6'));var client=jayson[_0x57b7('0x7')][_0x57b7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x8d4506,_0x566716,_0x2df235){return new BPromise(function(_0x3f6ee7,_0x51e11c){return client['request'](_0x8d4506,_0x2df235)[_0x57b7('0x9')](function(_0x23167b){logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x566716,_0x57b7('0xa'));logger[_0x57b7('0xb')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x566716,_0x57b7('0xa'),JSON['stringify'](_0x23167b));if(_0x23167b[_0x57b7('0xc')]){if(_0x23167b[_0x57b7('0xc')][_0x57b7('0xd')]===0x1f4){logger[_0x57b7('0xc')](_0x57b7('0xe'),_0x566716,_0x23167b[_0x57b7('0xc')][_0x57b7('0xf')]);return _0x51e11c(_0x23167b['error'][_0x57b7('0xf')]);}logger[_0x57b7('0xc')](_0x57b7('0xe'),_0x566716,_0x23167b[_0x57b7('0xc')][_0x57b7('0xf')]);return _0x3f6ee7(_0x23167b[_0x57b7('0xc')][_0x57b7('0xf')]);}else{logger[_0x57b7('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x566716,_0x57b7('0xa'));_0x3f6ee7(_0x23167b[_0x57b7('0x11')][_0x57b7('0xf')]);}})[_0x57b7('0x12')](function(_0x273b87){logger[_0x57b7('0xc')](_0x57b7('0xe'),_0x566716,_0x273b87);_0x51e11c(_0x273b87);});});} \ No newline at end of file +var _0x68bd=['bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x68bd,0x166));var _0xd68b=function(_0x4bc221,_0x51adfe){_0x4bc221=_0x4bc221-0x0;var _0x188462=_0x68bd[_0x4bc221];return _0x188462;};'use strict';var _=require(_0xd68b('0x0'));var util=require(_0xd68b('0x1'));var moment=require('moment');var BPromise=require(_0xd68b('0x2'));var rs=require(_0xd68b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd68b('0x4'))['db'];var utils=require(_0xd68b('0x5'));var logger=require('../../config/logger')(_0xd68b('0x6'));var config=require('../../config/environment');var jayson=require(_0xd68b('0x7'));var client=jayson['client'][_0xd68b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3948d9,_0x41ea06,_0x14d4d9){return new BPromise(function(_0x3e408e,_0x59b942){return client[_0xd68b('0x9')](_0x3948d9,_0x14d4d9)[_0xd68b('0xa')](function(_0x1820ca){logger[_0xd68b('0xb')](_0xd68b('0xc'),_0x41ea06,_0xd68b('0xd'));logger['debug'](_0xd68b('0xe'),_0x41ea06,'request\x20sent',JSON[_0xd68b('0xf')](_0x1820ca));if(_0x1820ca['error']){if(_0x1820ca[_0xd68b('0x10')][_0xd68b('0x11')]===0x1f4){logger[_0xd68b('0x10')](_0xd68b('0xc'),_0x41ea06,_0x1820ca['error'][_0xd68b('0x12')]);return _0x59b942(_0x1820ca['error'][_0xd68b('0x12')]);}logger[_0xd68b('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x41ea06,_0x1820ca['error'][_0xd68b('0x12')]);return _0x3e408e(_0x1820ca[_0xd68b('0x10')]['message']);}else{logger[_0xd68b('0xb')]('AnalyticCustomReport,\x20%s,\x20%s',_0x41ea06,_0xd68b('0xd'));_0x3e408e(_0x1820ca[_0xd68b('0x13')][_0xd68b('0x12')]);}})['catch'](function(_0x1fc625){logger['error'](_0xd68b('0xc'),_0x41ea06,_0x1fc625);_0x59b942(_0x1fc625);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index c4c0cb7..c1d8c41 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 _0xccaa=['/:id','update','delete','exports','multer','util','Router','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xccaa,0x122));var _0xacca=function(_0x770f7,_0x3af003){_0x770f7=_0x770f7-0x0;var _0xe797c6=_0xccaa[_0x770f7];return _0xe797c6;};'use strict';var multer=require(_0xacca('0x0'));var util=require(_0xacca('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xacca('0x2')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xacca('0x3'));var controller=require(_0xacca('0x4'));router[_0xacca('0x5')]('/',auth[_0xacca('0x6')](),controller[_0xacca('0x7')]);router[_0xacca('0x5')]('/:id',auth[_0xacca('0x6')](),controller[_0xacca('0x8')]);router[_0xacca('0x5')](_0xacca('0x9'),auth[_0xacca('0x6')](),controller[_0xacca('0xa')]);router[_0xacca('0x5')](_0xacca('0xb'),auth[_0xacca('0x6')](),controller[_0xacca('0xc')]);router[_0xacca('0x5')](_0xacca('0xd'),auth['isAuthenticated'](),controller[_0xacca('0xe')]);router[_0xacca('0xf')]('/',auth[_0xacca('0x6')](),controller[_0xacca('0x10')]);router[_0xacca('0x11')](_0xacca('0x12'),auth['isAuthenticated'](),controller[_0xacca('0x13')]);router[_0xacca('0x14')](_0xacca('0x12'),auth[_0xacca('0x6')](),controller['destroy']);module[_0xacca('0x15')]=router; \ No newline at end of file +var _0x5559=['/:id','show','/:id/preview','/:id/run','/:id/query','query','post','put','update','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','isAuthenticated','index','get'];(function(_0x163040,_0x38a58c){var _0x364667=function(_0x3b104f){while(--_0x3b104f){_0x163040['push'](_0x163040['shift']());}};_0x364667(++_0x38a58c);}(_0x5559,0x1ae));var _0x9555=function(_0x354aae,_0x487119){_0x354aae=_0x354aae-0x0;var _0x1426a2=_0x5559[_0x354aae];return _0x1426a2;};'use strict';var multer=require(_0x9555('0x0'));var util=require(_0x9555('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9555('0x2'));var router=express[_0x9555('0x3')]();var auth=require(_0x9555('0x4'));var interaction=require(_0x9555('0x5'));var config=require(_0x9555('0x6'));var controller=require(_0x9555('0x7'));router['get']('/',auth[_0x9555('0x8')](),controller[_0x9555('0x9')]);router[_0x9555('0xa')](_0x9555('0xb'),auth['isAuthenticated'](),controller[_0x9555('0xc')]);router[_0x9555('0xa')](_0x9555('0xd'),auth[_0x9555('0x8')](),controller['preview']);router[_0x9555('0xa')](_0x9555('0xe'),auth['isAuthenticated'](),controller['run']);router[_0x9555('0xa')](_0x9555('0xf'),auth['isAuthenticated'](),controller[_0x9555('0x10')]);router[_0x9555('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9555('0x12')](_0x9555('0xb'),auth['isAuthenticated'](),controller[_0x9555('0x13')]);router['delete']('/:id',auth[_0x9555('0x8')](),controller['destroy']);module[_0x9555('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 0c35578..90d0fb2 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 _0x3b3d=['STRING','TEXT','sequelize'];(function(_0x318179,_0x59b38e){var _0x1d2c30=function(_0x3f7ad4){while(--_0x3f7ad4){_0x318179['push'](_0x318179['shift']());}};_0x1d2c30(++_0x59b38e);}(_0x3b3d,0x122));var _0xd3b3=function(_0x4d7f7b,_0x4987e3){_0x4d7f7b=_0x4d7f7b-0x0;var _0x5effb0=_0x3b3d[_0x4d7f7b];return _0x5effb0;};'use strict';var Sequelize=require(_0xd3b3('0x0'));module['exports']={'name':{'type':Sequelize[_0xd3b3('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xd3b3('0x1')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0xd3b3('0x2')]},'joins':{'type':Sequelize[_0xd3b3('0x2')]}}; \ No newline at end of file +var _0x7c97=['exports','STRING','TEXT','sequelize'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7c97,0x67));var _0x77c9=function(_0x544136,_0x61d7ed){_0x544136=_0x544136-0x0;var _0x3bc455=_0x7c97[_0x544136];return _0x3bc455;};'use strict';var Sequelize=require(_0x77c9('0x0'));module[_0x77c9('0x1')]={'name':{'type':Sequelize[_0x77c9('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x77c9('0x2')]},'parent':{'type':Sequelize[_0x77c9('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x77c9('0x3')]},'joins':{'type':Sequelize[_0x77c9('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 4152cc5..2823d5a 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 _0x8fd3=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','status','end','json','count','offset','limit','set','apply','reject','save','update','then','get','UserProfileResource','destroy','error','name','send','index','AnalyticDefaultReport','fieldName','model','map','query','keys','filters','intersection','attributes','order','sort','where','pick','merge','type','key','VIRTUAL','field','filter','findAll','rows','catch','show','params','fields','includeAll','include','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','userProfileId','autoAssociation','DefaultReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview','join','left_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)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20EMPTY','IS\x20NOT\x20EMPTY','length','operator','rules','group','value','options','Sequelize','ValidationErrorItem','keyBy','select','from','table','MetricId','function','replace','format','groupBy','orderBy','alias','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','parse','clone','debug','toString','sequelize','right_join','SEC_TO_TIME(%s)','IS\x20NULL','IS\x20NOT\x20NULL','condition','getFields','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','metric','DESC','SELECT','No\x20available\x20data','output','web','fullPath','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','child_process','fork','../../components/export/','../../files/reports','countTable','QueryTypes','run','runReport','AVG(%s)','eml-format','rimraf','zip-dir','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce'];(function(_0x53fe97,_0x544271){var _0x5c49a2=function(_0x3fa2b4){while(--_0x3fa2b4){_0x53fe97['push'](_0x53fe97['shift']());}};_0x5c49a2(++_0x544271);}(_0x8fd3,0x1d7));var _0x38fd=function(_0x135b3c,_0x559a66){_0x135b3c=_0x135b3c-0x0;var _0x325a29=_0x8fd3[_0x135b3c];return _0x325a29;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x38fd('0x0'));var rimraf=require(_0x38fd('0x1'));var zipdir=require(_0x38fd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x38fd('0x3'));var Mustache=require(_0x38fd('0x4'));var util=require('util');var path=require('path');var sox=require(_0x38fd('0x5'));var csv=require(_0x38fd('0x6'));var ejs=require(_0x38fd('0x7'));var fs=require('fs');var _=require(_0x38fd('0x8'));var squel=require(_0x38fd('0x9'));var crypto=require(_0x38fd('0xa'));var jsforce=require(_0x38fd('0xb'));var deskjs=require(_0x38fd('0xc'));var toCsv=require('to-csv');var querystring=require(_0x38fd('0xd'));var Papa=require(_0x38fd('0xe'));var Redis=require(_0x38fd('0xf'));var authService=require(_0x38fd('0x10'));var qs=require(_0x38fd('0x11'));var as=require(_0x38fd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x38fd('0x13'));var utils=require(_0x38fd('0x14'));var config=require('../../config/environment');var db=require(_0x38fd('0x15'))['db'];function respondWithStatusCode(_0x42a418,_0xc5ff57){_0xc5ff57=_0xc5ff57||0xcc;return function(_0x534ca1){if(_0x534ca1){return _0x42a418['sendStatus'](_0xc5ff57);}return _0x42a418[_0x38fd('0x16')](_0xc5ff57)[_0x38fd('0x17')]();};}function respondWithResult(_0x25ad82,_0x33ab45){_0x33ab45=_0x33ab45||0xc8;return function(_0x1fefdb){if(_0x1fefdb){return _0x25ad82[_0x38fd('0x16')](_0x33ab45)[_0x38fd('0x18')](_0x1fefdb);}};}function respondWithFilteredResult(_0x51310c,_0x5f18f9){return function(_0x4c91b6){if(_0x4c91b6){var _0x3c01a5=_0x4c91b6[_0x38fd('0x19')],_0x2ab37a=_0x5f18f9[_0x38fd('0x1a')],_0x4fb163=_0x5f18f9[_0x38fd('0x1a')]+_0x5f18f9[_0x38fd('0x1b')],_0x25e5f6;if(_0x4fb163>=_0x3c01a5){_0x4fb163=_0x3c01a5;_0x25e5f6=0xc8;}else{_0x25e5f6=0xce;}_0x51310c[_0x38fd('0x16')](_0x25e5f6);return _0x51310c[_0x38fd('0x1c')]('Content-Range',_0x2ab37a+'-'+_0x4fb163+'/'+_0x3c01a5)[_0x38fd('0x18')](_0x4c91b6);}return null;};}function patchUpdates(_0x422888){return function(_0x42568a){try{jsonpatch[_0x38fd('0x1d')](_0x42568a,_0x422888,!![]);}catch(_0x57f140){return BPromise[_0x38fd('0x1e')](_0x57f140);}return _0x42568a[_0x38fd('0x1f')]();};}function saveUpdates(_0x304e30,_0x1dab96){return function(_0x568c1a){if(_0x568c1a){return _0x568c1a[_0x38fd('0x20')](_0x304e30)[_0x38fd('0x21')](function(_0x2194e5){return _0x2194e5;});}return null;};}function removeEntity(_0x3812cd,_0x2e68dc){return function(_0x15aa31){if(_0x15aa31){return _0x15aa31['destroy']()[_0x38fd('0x21')](function(){var _0x4d76aa=_0x15aa31[_0x38fd('0x22')]({'plain':!![]});var _0x3cb2ae='DefaultReports';return db[_0x38fd('0x23')][_0x38fd('0x24')]({'where':{'type':_0x3cb2ae,'resourceId':_0x4d76aa['id']}})[_0x38fd('0x21')](function(){return _0x15aa31;});})[_0x38fd('0x21')](function(){_0x3812cd[_0x38fd('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x251fc3,_0x26c2a4){return function(_0x5e5533){if(!_0x5e5533){_0x251fc3['sendStatus'](0x194);}return _0x5e5533;};}function handleError(_0x52945d,_0x3841db){_0x3841db=_0x3841db||0x1f4;return function(_0x4f9cd5){logger[_0x38fd('0x25')](_0x4f9cd5['stack']);if(_0x4f9cd5['name']){delete _0x4f9cd5[_0x38fd('0x26')];}_0x52945d[_0x38fd('0x16')](_0x3841db)[_0x38fd('0x27')](_0x4f9cd5);};}exports[_0x38fd('0x28')]=function(_0x1251fc,_0x33701e){var _0x10bea6={},_0x4c9f46={},_0x2bb9e8={'count':0x0,'rows':[]};var _0x5c52d5=_['map'](db[_0x38fd('0x29')]['rawAttributes'],function(_0x3f4f97){return{'name':_0x3f4f97[_0x38fd('0x2a')],'type':_0x3f4f97['type']['key']};});_0x4c9f46[_0x38fd('0x2b')]=_[_0x38fd('0x2c')](_0x5c52d5,_0x38fd('0x26'));_0x4c9f46[_0x38fd('0x2d')]=_[_0x38fd('0x2e')](_0x1251fc[_0x38fd('0x2d')]);_0x4c9f46[_0x38fd('0x2f')]=_['intersection'](_0x4c9f46[_0x38fd('0x2b')],_0x4c9f46[_0x38fd('0x2d')]);_0x10bea6['attributes']=_[_0x38fd('0x30')](_0x4c9f46[_0x38fd('0x2b')],qs['fields'](_0x1251fc[_0x38fd('0x2d')]['fields']));_0x10bea6[_0x38fd('0x31')]=_0x10bea6['attributes']['length']?_0x10bea6['attributes']:_0x4c9f46[_0x38fd('0x2b')];if(!_0x1251fc[_0x38fd('0x2d')]['hasOwnProperty']('nolimit')){_0x10bea6[_0x38fd('0x1b')]=qs[_0x38fd('0x1b')](_0x1251fc[_0x38fd('0x2d')][_0x38fd('0x1b')]);_0x10bea6[_0x38fd('0x1a')]=qs['offset'](_0x1251fc[_0x38fd('0x2d')][_0x38fd('0x1a')]);}_0x10bea6[_0x38fd('0x32')]=qs[_0x38fd('0x33')](_0x1251fc[_0x38fd('0x2d')][_0x38fd('0x33')]);_0x10bea6[_0x38fd('0x34')]=qs[_0x38fd('0x2f')](_[_0x38fd('0x35')](_0x1251fc[_0x38fd('0x2d')],_0x4c9f46[_0x38fd('0x2f')]));if(_0x1251fc[_0x38fd('0x2d')]['filter']){_0x10bea6['where']=_[_0x38fd('0x36')](_0x10bea6[_0x38fd('0x34')],{'$or':_[_0x38fd('0x2c')](_0x5c52d5,function(_0x1816b8){if(_0x1816b8[_0x38fd('0x37')][_0x38fd('0x38')]!==_0x38fd('0x39')){var _0x4620a2={};_0x4620a2[_0x1816b8[_0x38fd('0x3a')]]={'$like':'%'+_0x1251fc[_0x38fd('0x2d')][_0x38fd('0x3b')]+'%'};return _0x4620a2;}})});}_0x10bea6=_[_0x38fd('0x36')]({},_0x10bea6,_0x1251fc['options']);var _0x26a7a8={'where':_0x10bea6['where']};return db[_0x38fd('0x29')][_0x38fd('0x19')](_0x26a7a8)['then'](function(_0x1421ee){_0x2bb9e8['count']=_0x1421ee;if(_0x1251fc[_0x38fd('0x2d')]['includeAll']){_0x10bea6['include']=[{'all':!![]}];}return db[_0x38fd('0x29')][_0x38fd('0x3c')](_0x10bea6);})[_0x38fd('0x21')](function(_0x25798f){_0x2bb9e8[_0x38fd('0x3d')]=_0x25798f;return _0x2bb9e8;})[_0x38fd('0x21')](respondWithFilteredResult(_0x33701e,_0x10bea6))[_0x38fd('0x3e')](handleError(_0x33701e,null));};exports[_0x38fd('0x3f')]=function(_0x5f5d33,_0x18d3b2){var _0x32b72b={'raw':!![],'where':{'id':_0x5f5d33[_0x38fd('0x40')]['id']}},_0x230354={};_0x230354['model']=_[_0x38fd('0x2e')](db[_0x38fd('0x29')]['rawAttributes']);_0x230354[_0x38fd('0x2d')]=_[_0x38fd('0x2e')](_0x5f5d33[_0x38fd('0x2d')]);_0x230354['filters']=_['intersection'](_0x230354[_0x38fd('0x2b')],_0x230354['query']);_0x32b72b['attributes']=_['intersection'](_0x230354['model'],qs['fields'](_0x5f5d33[_0x38fd('0x2d')][_0x38fd('0x41')]));_0x32b72b['attributes']=_0x32b72b[_0x38fd('0x31')]['length']?_0x32b72b[_0x38fd('0x31')]:_0x230354[_0x38fd('0x2b')];if(_0x5f5d33[_0x38fd('0x2d')][_0x38fd('0x42')]){_0x32b72b[_0x38fd('0x43')]=[{'all':!![]}];}_0x32b72b=_['merge']({},_0x32b72b,_0x5f5d33['options']);return db[_0x38fd('0x29')][_0x38fd('0x44')](_0x32b72b)[_0x38fd('0x21')](handleEntityNotFound(_0x18d3b2,null))[_0x38fd('0x21')](respondWithResult(_0x18d3b2,null))[_0x38fd('0x3e')](handleError(_0x18d3b2,null));};exports[_0x38fd('0x45')]=function(_0x5bc29d,_0x5e5785){return db[_0x38fd('0x29')][_0x38fd('0x45')](_0x5bc29d['body'],{})[_0x38fd('0x21')](function(_0x73a077){var _0x1bb3ed=_0x5bc29d['user'][_0x38fd('0x22')]({'plain':!![]});if(!_0x1bb3ed)throw new Error(_0x38fd('0x46'));if(_0x1bb3ed[_0x38fd('0x47')]==='user'){var _0x2ce6f4=_0x73a077[_0x38fd('0x22')]({'plain':!![]});var _0x435677=_0x38fd('0x48');return db['UserProfileSection'][_0x38fd('0x44')]({'where':{'name':_0x435677,'userProfileId':_0x1bb3ed[_0x38fd('0x49')]},'raw':!![]})[_0x38fd('0x21')](function(_0x5683e3){if(_0x5683e3&&_0x5683e3[_0x38fd('0x4a')]===0x0){return db[_0x38fd('0x23')][_0x38fd('0x45')]({'name':_0x2ce6f4[_0x38fd('0x26')],'resourceId':_0x2ce6f4['id'],'type':_0x38fd('0x4b'),'sectionId':_0x5683e3['id']},{})[_0x38fd('0x21')](function(){return _0x73a077;});}else{return _0x73a077;}})[_0x38fd('0x3e')](function(_0x4496f5){logger[_0x38fd('0x25')](_0x38fd('0x4c'),_0x4496f5);throw _0x4496f5;});}return _0x73a077;})['then'](respondWithResult(_0x5e5785,0xc9))[_0x38fd('0x3e')](handleError(_0x5e5785,null));};exports['update']=function(_0x216e08,_0x4cb419){if(_0x216e08[_0x38fd('0x4d')]['id']){delete _0x216e08[_0x38fd('0x4d')]['id'];}return db['AnalyticDefaultReport']['find']({'where':{'id':_0x216e08[_0x38fd('0x40')]['id']}})[_0x38fd('0x21')](handleEntityNotFound(_0x4cb419,null))[_0x38fd('0x21')](saveUpdates(_0x216e08['body'],null))[_0x38fd('0x21')](respondWithResult(_0x4cb419,null))[_0x38fd('0x3e')](handleError(_0x4cb419,null));};exports[_0x38fd('0x24')]=function(_0x36d079,_0x23b1c8){return db[_0x38fd('0x29')][_0x38fd('0x44')]({'where':{'id':_0x36d079['params']['id']}})['then'](handleEntityNotFound(_0x23b1c8,null))['then'](removeEntity(_0x23b1c8,null))[_0x38fd('0x3e')](handleError(_0x23b1c8,null));};exports[_0x38fd('0x4e')]=function(_0x5cee37,_0x189c62){var _0x457e1b=0xa;var _0x176a7e=[_0x38fd('0x4f'),_0x38fd('0x50'),'right_join',_0x38fd('0x51')];var _0x4d691b={'SUM':_0x38fd('0x52'),'COUNT':_0x38fd('0x53'),'COUNT DISTINCT':_0x38fd('0x54'),'MAX':_0x38fd('0x55'),'MIN':_0x38fd('0x56'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x38fd('0x57'),'GROUP_CONCAT ASC':_0x38fd('0x58'),'GROUP_CONCAT DESC':_0x38fd('0x59')};var _0x4523b8={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x38fd('0x5a'),'HOUR':_0x38fd('0x5b'),'ROUND':_0x38fd('0x5c'),'UNIX_TIMESTAMP':_0x38fd('0x5d')};var _0x5646c2=function(_0x43f2d1){return!_[_0x38fd('0x5e')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x38fd('0x5f'),_0x38fd('0x60')],_0x43f2d1);};var _0x1ed016=function(_0xe10b7c){if(!_0xe10b7c||!_0xe10b7c['rules'][_0x38fd('0x61')]){return'';}for(var _0x4b2181='(',_0x4844be=0x0;_0x4844be<_0xe10b7c['rules'][_0x38fd('0x61')];_0x4844be+=0x1){_0x4844be>0x0&&(_0x4b2181+='\x20'+_0xe10b7c[_0x38fd('0x62')]+'\x20');_0x4b2181+=_0xe10b7c[_0x38fd('0x63')][_0x4844be][_0x38fd('0x64')]?_0x1ed016(_0xe10b7c[_0x38fd('0x63')][_0x4844be][_0x38fd('0x64')]):_0xe10b7c['rules'][_0x4844be][_0x38fd('0x3a')]+'\x20'+_0xe10b7c[_0x38fd('0x63')][_0x4844be]['condition']+(_0x5646c2(_0xe10b7c[_0x38fd('0x63')][_0x4844be]['condition'])?'\x20'+_0xe10b7c[_0x38fd('0x63')][_0x4844be][_0x38fd('0x65')]:'');}return _0x4b2181+')';};var _0x25398a={'where':{'id':_0x5cee37['params']['id']}},_0x2bdd1e,_0x3500b4,_0x5ea4bb,_0x2e273e,_0x3b199d;_0x25398a=_[_0x38fd('0x36')]({},_0x25398a,_0x5cee37[_0x38fd('0x66')]);return db[_0x38fd('0x29')][_0x38fd('0x44')](_0x25398a)[_0x38fd('0x21')](function(_0x1a90b1){if(_0x1a90b1){_0x2bdd1e=_0x1a90b1;return _0x1a90b1['getFields']();}return null;})[_0x38fd('0x21')](function(_0x2226bc){if(_0x2226bc){if(!_0x2226bc[_0x38fd('0x61')]){throw new db[(_0x38fd('0x67'))][(_0x38fd('0x68'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x3500b4=_0x2226bc;return db['AnalyticMetric'][_0x38fd('0x3c')]({'raw':!![]});}return null;})[_0x38fd('0x21')](function(_0x5b2bb2){if(_0x5b2bb2){_0x5ea4bb=_[_0x38fd('0x69')](_0x5b2bb2,'id');var _0xf2581b;var _0xc22546=squel[_0x38fd('0x6a')]();_0xc22546[_0x38fd('0x6b')](_0x2bdd1e[_0x38fd('0x6c')]);for(var _0x2a57cf=0x0;_0x2a57cf<_0x3500b4[_0x38fd('0x61')];_0x2a57cf+=0x1){_0xf2581b=_0x3500b4[_0x2a57cf][_0x38fd('0x6d')]?_0x5ea4bb[_0x3500b4[_0x2a57cf][_0x38fd('0x6d')]]['metric']:_0x3500b4[_0x2a57cf][_0x38fd('0x3a')];_0xf2581b=_0x3500b4[_0x2a57cf][_0x38fd('0x6e')]?_[_0x38fd('0x6f')](_0x4d691b[_0x3500b4[_0x2a57cf][_0x38fd('0x6e')]],'%s',_0xf2581b):_0xf2581b;_0xf2581b=_0x3500b4[_0x2a57cf][_0x38fd('0x70')]?_[_0x38fd('0x6f')](_0x4523b8[_0x3500b4[_0x2a57cf][_0x38fd('0x70')]],'%s',_0xf2581b):_0xf2581b;if(_0x3500b4[_0x2a57cf][_0x38fd('0x71')]){_0xc22546[_0x38fd('0x64')](_0xf2581b);}_0x3500b4[_0x2a57cf][_0x38fd('0x72')]&&_0xc22546[_0x38fd('0x32')](_0xf2581b,_0x3500b4[_0x2a57cf]['orderBy']==='DESC'?![]:!![]);_0xc22546[_0x38fd('0x3a')](_0xf2581b,_0x3500b4[_0x2a57cf][_0x38fd('0x73')]||_0xf2581b);}if(_0x2bdd1e[_0x38fd('0x74')]){_0x2bdd1e['joins']=JSON['parse'](_0x2bdd1e[_0x38fd('0x74')]);for(var _0x12035e=0x0;_0x12035e<_0x2bdd1e[_0x38fd('0x74')][_0x38fd('0x61')];_0x12035e+=0x1){if(_0x2bdd1e[_0x38fd('0x74')][_0x12035e][_0x38fd('0x37')]&&_[_0x38fd('0x5e')](_0x176a7e,_0x2bdd1e[_0x38fd('0x74')][_0x12035e][_0x38fd('0x37')])&&_0x2bdd1e[_0x38fd('0x74')][_0x12035e][_0x38fd('0x75')]&&_0x2bdd1e[_0x38fd('0x74')][_0x12035e][_0x38fd('0x76')]&&_0x2bdd1e[_0x38fd('0x74')][_0x12035e][_0x38fd('0x77')]){_0xc22546[_0x2bdd1e[_0x38fd('0x74')][_0x12035e][_0x38fd('0x37')]](_0x2bdd1e['joins'][_0x12035e][_0x38fd('0x76')],null,util[_0x38fd('0x70')](_0x38fd('0x78'),_0x2bdd1e['table'],_0x2bdd1e[_0x38fd('0x74')][_0x12035e][_0x38fd('0x75')],_0x2bdd1e[_0x38fd('0x74')][_0x12035e][_0x38fd('0x76')],_0x2bdd1e['joins'][_0x12035e]['foreignKey']));}}}if(_0x2bdd1e[_0x38fd('0x79')]){_0x2bdd1e[_0x38fd('0x79')]=JSON[_0x38fd('0x7a')](_0x2bdd1e['conditions']);_0xc22546[_0x38fd('0x34')](_0x1ed016(_0x2bdd1e[_0x38fd('0x79')][_0x38fd('0x64')]));}_0x3b199d=_0xc22546[_0x38fd('0x7b')]();_0xc22546[_0x38fd('0x1b')](_0x457e1b);_0xc22546[_0x38fd('0x1a')](0x0);logger[_0x38fd('0x7c')]('Limited\x20Query:',_0xc22546[_0x38fd('0x7d')]());return db[_0x38fd('0x7e')]['query'](_0xc22546[_0x38fd('0x7d')](),{'type':db[_0x38fd('0x7e')]['QueryTypes']['SELECT']});}})['then'](respondWithResult(_0x189c62,null))['catch'](handleError(_0x189c62,null));};function runReport(_0x1dd4f7,_0x2630f1,_0x265f19){var _0x8bdc7f=_0x2630f1[_0x38fd('0x26')];var _0x25341e=0xa;var _0x196ac9=['join',_0x38fd('0x50'),_0x38fd('0x7f'),'cross_join'];var _0x4f7338={'SUM':_0x38fd('0x52'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x38fd('0x54'),'MAX':_0x38fd('0x55'),'MIN':_0x38fd('0x56'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x38fd('0x57'),'GROUP_CONCAT ASC':_0x38fd('0x58'),'GROUP_CONCAT DESC':_0x38fd('0x59')};var _0x1b47b9={'SEC_TO_TIME':_0x38fd('0x80'),'DATE':_0x38fd('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x38fd('0x5c'),'UNIX_TIMESTAMP':_0x38fd('0x5d')};var _0x821d27=function(_0x316a2d){return!_[_0x38fd('0x5e')]([_0x38fd('0x81'),_0x38fd('0x82'),_0x38fd('0x5f'),_0x38fd('0x60')],_0x316a2d);};var _0xa43b79=function(_0x7d24d3){if(!_0x7d24d3||!_0x7d24d3[_0x38fd('0x63')][_0x38fd('0x61')]){return'';}for(var _0x2aa712='(',_0x3202c6=0x0;_0x3202c6<_0x7d24d3[_0x38fd('0x63')][_0x38fd('0x61')];_0x3202c6+=0x1){_0x3202c6>0x0&&(_0x2aa712+='\x20'+_0x7d24d3['operator']+'\x20');_0x2aa712+=_0x7d24d3[_0x38fd('0x63')][_0x3202c6]['group']?_0xa43b79(_0x7d24d3[_0x38fd('0x63')][_0x3202c6][_0x38fd('0x64')]):_0x7d24d3[_0x38fd('0x63')][_0x3202c6]['field']+'\x20'+_0x7d24d3['rules'][_0x3202c6][_0x38fd('0x83')]+(_0x821d27(_0x7d24d3['rules'][_0x3202c6][_0x38fd('0x83')])?'\x20'+_0x7d24d3[_0x38fd('0x63')][_0x3202c6]['value']:'');}return _0x2aa712+')';};var _0x34fa78={'where':{'id':_0x1dd4f7['id']}},_0x25908d,_0x4269a3,_0x292679,_0x30524c,_0x2e62dc;_0x34fa78=_['merge']({},_0x34fa78,_0x265f19);return db['AnalyticDefaultReport'][_0x38fd('0x44')](_0x34fa78)[_0x38fd('0x21')](function(_0x2bffc6){if(_0x2bffc6){_0x25908d=_0x2bffc6;return _0x2bffc6[_0x38fd('0x84')]();}return null;})[_0x38fd('0x21')](function(_0xd92818){if(_0xd92818){if(!_0xd92818[_0x38fd('0x61')]){throw new db[(_0x38fd('0x67'))][(_0x38fd('0x68'))](_0x38fd('0x85'),0x193);}_0x4269a3=_0xd92818;return db[_0x38fd('0x86')]['findAll']({'raw':!![]});}return null;})[_0x38fd('0x21')](function(_0x16c185){if(_0x16c185){_0x292679=_['keyBy'](_0x16c185,'id');var _0x10fa9c;var _0x264839=squel[_0x38fd('0x6a')]();_0x264839[_0x38fd('0x6b')](_0x25908d['table']);for(var _0x10028e=0x0;_0x10028e<_0x4269a3['length'];_0x10028e+=0x1){_0x10fa9c=_0x4269a3[_0x10028e][_0x38fd('0x6d')]?_0x292679[_0x4269a3[_0x10028e][_0x38fd('0x6d')]][_0x38fd('0x87')]:_0x4269a3[_0x10028e]['field'];_0x10fa9c=_0x4269a3[_0x10028e]['function']?_[_0x38fd('0x6f')](_0x4f7338[_0x4269a3[_0x10028e]['function']],'%s',_0x10fa9c):_0x10fa9c;_0x10fa9c=_0x4269a3[_0x10028e][_0x38fd('0x70')]?_[_0x38fd('0x6f')](_0x1b47b9[_0x4269a3[_0x10028e][_0x38fd('0x70')]],'%s',_0x10fa9c):_0x10fa9c;if(_0x4269a3[_0x10028e][_0x38fd('0x71')]){_0x264839[_0x38fd('0x64')](_0x10fa9c);}_0x4269a3[_0x10028e][_0x38fd('0x72')]&&_0x264839[_0x38fd('0x32')](_0x10fa9c,_0x4269a3[_0x10028e][_0x38fd('0x72')]===_0x38fd('0x88')?![]:!![]);_0x264839[_0x38fd('0x3a')](_0x10fa9c,_0x4269a3[_0x10028e]['alias']||_0x10fa9c);}if(_0x25908d[_0x38fd('0x74')]){_0x25908d[_0x38fd('0x74')]=JSON[_0x38fd('0x7a')](_0x25908d['joins']);for(var _0x5d0d92=0x0;_0x5d0d92<_0x25908d[_0x38fd('0x74')][_0x38fd('0x61')];_0x5d0d92+=0x1){if(_0x25908d[_0x38fd('0x74')][_0x5d0d92][_0x38fd('0x37')]&&_[_0x38fd('0x5e')](_0x196ac9,_0x25908d['joins'][_0x5d0d92][_0x38fd('0x37')])&&_0x25908d[_0x38fd('0x74')][_0x5d0d92]['parentKey']&&_0x25908d[_0x38fd('0x74')][_0x5d0d92][_0x38fd('0x76')]&&_0x25908d[_0x38fd('0x74')][_0x5d0d92][_0x38fd('0x77')]){_0x264839[_0x25908d[_0x38fd('0x74')][_0x5d0d92][_0x38fd('0x37')]](_0x25908d[_0x38fd('0x74')][_0x5d0d92][_0x38fd('0x76')],null,util[_0x38fd('0x70')]('%s.%s\x20=\x20%s.%s',_0x25908d[_0x38fd('0x6c')],_0x25908d[_0x38fd('0x74')][_0x5d0d92][_0x38fd('0x75')],_0x25908d[_0x38fd('0x74')][_0x5d0d92]['foreignTable'],_0x25908d[_0x38fd('0x74')][_0x5d0d92][_0x38fd('0x77')]));}}}if(_0x25908d['conditions']){_0x25908d[_0x38fd('0x79')]=JSON[_0x38fd('0x7a')](_0x25908d['conditions']);_0x264839[_0x38fd('0x34')](_0xa43b79(_0x25908d[_0x38fd('0x79')][_0x38fd('0x64')]));}_0x2e62dc=_0x264839[_0x38fd('0x7b')]();_0x264839[_0x38fd('0x1b')](_0x25341e);_0x264839['offset'](0x0);logger[_0x38fd('0x7c')]('Limited\x20Query:',_0x264839[_0x38fd('0x7d')]());return db[_0x38fd('0x7e')][_0x38fd('0x2d')](_0x264839[_0x38fd('0x7d')](),{'type':db[_0x38fd('0x7e')]['QueryTypes'][_0x38fd('0x89')]});}})[_0x38fd('0x21')](function(_0x1a30e5){if(!_0x1a30e5[_0x38fd('0x61')]){throw new db[(_0x38fd('0x67'))]['ValidationErrorItem'](_0x38fd('0x8a'),0xcc);}if(_0x2630f1[_0x38fd('0x8b')]===_0x38fd('0x8c')){return null;}var _0x2df89c=_[_0x38fd('0x36')](_0x2630f1,{'name':_0x2630f1[_0x38fd('0x8d')]||_0x2630f1[_0x38fd('0x26')]||_0x25908d['name'],'basename':_0x8bdc7f,'savename':util['format']('%s-%s.%s',_0x2630f1['name']||_0x25908d['name'],require(_0x38fd('0x8e'))[_0x38fd('0x8f')](0x4),_0x2630f1[_0x38fd('0x8b')]||_0x38fd('0x90')),'reportId':_0x25908d['id'],'reportType':_0x38fd('0x91')});return db[_0x38fd('0x92')][_0x38fd('0x45')](_0x2df89c,{'raw':!![]});})['then'](function(_0x34f42c){if(_0x25908d[_0x38fd('0x6c')]===_0x38fd('0x93')){_0x2e62dc['where'](_0x25908d['table']+_0x38fd('0x94'),_0x2630f1['startDate'],_0x2630f1['endDate']);}else{_0x2e62dc[_0x38fd('0x34')](_0x25908d[_0x38fd('0x6c')]+_0x38fd('0x95'),_0x2630f1[_0x38fd('0x96')],_0x2630f1[_0x38fd('0x97')]);}if(_0x34f42c){logger['info']('Run\x20Query:',_0x2e62dc[_0x38fd('0x7d')]());require(_0x38fd('0x98'))[_0x38fd('0x99')](path[_0x38fd('0x4f')](__dirname,_0x38fd('0x9a'),_0x34f42c[_0x38fd('0x8b')]),[_0x34f42c['id'],_0x2e62dc[_0x38fd('0x7d')](),path[_0x38fd('0x4f')](__dirname,_0x38fd('0x9b'),_0x34f42c['savename']),_0x8bdc7f]);return _0x34f42c;}else{var _0x25e6f4=squel['select']();_0x25e6f4[_0x38fd('0x6b')]('('+_0x2e62dc[_0x38fd('0x7d')]()+')',_0x38fd('0x9c'));_0x25e6f4[_0x38fd('0x3a')]('COUNT(*)',_0x38fd('0x19'));_0x2e62dc[_0x38fd('0x1b')](_0x2630f1[_0x38fd('0x1b')]||_0x25341e);_0x2e62dc[_0x38fd('0x1a')](_0x2630f1[_0x38fd('0x1a')]||0x0);return db['sequelize']['query'](_0x25e6f4[_0x38fd('0x7d')](),{'type':db[_0x38fd('0x7e')][_0x38fd('0x9d')][_0x38fd('0x89')]})[_0x38fd('0x21')](function(_0x338e3f){if(!_0x338e3f[_0x38fd('0x61')]){_0x30524c=0x0;}else{_0x30524c=_0x338e3f[0x0]['count']||0x0;}return db[_0x38fd('0x7e')][_0x38fd('0x2d')](_0x2e62dc[_0x38fd('0x7d')](),{'type':db[_0x38fd('0x7e')][_0x38fd('0x9d')][_0x38fd('0x89')]});})[_0x38fd('0x21')](function(_0x1bc51f){return{'rows':_0x1bc51f||[],'count':_0x30524c};});}});}exports[_0x38fd('0x9e')]=function(_0x6c8cd5,_0x26c43f){return runReport(_0x6c8cd5['params'],_0x6c8cd5[_0x38fd('0x2d')],_0x6c8cd5[_0x38fd('0x66')])[_0x38fd('0x21')](respondWithResult(_0x26c43f,null))['catch'](handleError(_0x26c43f,null));};exports[_0x38fd('0x9f')]=runReport;exports[_0x38fd('0x2d')]=function(_0x1c0438,_0x3f0d99){var _0x40efa4=0xa;var _0x50192a=['join',_0x38fd('0x50'),_0x38fd('0x7f'),_0x38fd('0x51')];var _0x4bb383={'SUM':_0x38fd('0x52'),'COUNT':_0x38fd('0x53'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x38fd('0x55'),'MIN':'MIN(%s)','AVG':_0x38fd('0xa0'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x38fd('0x59')};var _0x3ce84d={'SEC_TO_TIME':_0x38fd('0x80'),'DATE':_0x38fd('0x5a'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4500ae=function(_0x5dcae1){return!_['includes']([_0x38fd('0x81'),_0x38fd('0x82'),_0x38fd('0x5f'),_0x38fd('0x60')],_0x5dcae1);};var _0x40ef0b=function(_0x9b9eb3){if(!_0x9b9eb3||!_0x9b9eb3['rules']['length']){return'';}for(var _0x1444b9='(',_0x256080=0x0;_0x256080<_0x9b9eb3['rules'][_0x38fd('0x61')];_0x256080+=0x1){_0x256080>0x0&&(_0x1444b9+='\x20'+_0x9b9eb3[_0x38fd('0x62')]+'\x20');_0x1444b9+=_0x9b9eb3[_0x38fd('0x63')][_0x256080][_0x38fd('0x64')]?_0x40ef0b(_0x9b9eb3[_0x38fd('0x63')][_0x256080][_0x38fd('0x64')]):_0x9b9eb3[_0x38fd('0x63')][_0x256080][_0x38fd('0x3a')]+'\x20'+_0x9b9eb3[_0x38fd('0x63')][_0x256080][_0x38fd('0x83')]+(_0x4500ae(_0x9b9eb3[_0x38fd('0x63')][_0x256080][_0x38fd('0x83')])?'\x20'+_0x9b9eb3['rules'][_0x256080][_0x38fd('0x65')]:'');}return _0x1444b9+')';};var _0x2e5984={'where':{'id':_0x1c0438[_0x38fd('0x40')]['id']}},_0x3cc9f6,_0x3f2e83,_0x109744,_0x23dfd7,_0x4a8e7b;_0x2e5984=_[_0x38fd('0x36')]({},_0x2e5984,_0x1c0438['options']);return db['AnalyticDefaultReport'][_0x38fd('0x44')](_0x2e5984)[_0x38fd('0x21')](function(_0x2ff68f){if(_0x2ff68f){_0x3cc9f6=_0x2ff68f;return _0x2ff68f[_0x38fd('0x84')]();}return null;})['then'](function(_0x36e8e4){if(_0x36e8e4){if(!_0x36e8e4[_0x38fd('0x61')]){throw new db[(_0x38fd('0x67'))][(_0x38fd('0x68'))](_0x38fd('0x85'),0x193);}_0x3f2e83=_0x36e8e4;return db[_0x38fd('0x86')][_0x38fd('0x3c')]({'raw':!![]});}return null;})[_0x38fd('0x21')](function(_0x1c822f){if(_0x1c822f){_0x109744=_[_0x38fd('0x69')](_0x1c822f,'id');var _0x594131;var _0x23f1d1=squel[_0x38fd('0x6a')]();_0x23f1d1[_0x38fd('0x6b')](_0x3cc9f6[_0x38fd('0x6c')]);for(var _0x52c5b5=0x0;_0x52c5b5<_0x3f2e83[_0x38fd('0x61')];_0x52c5b5+=0x1){_0x594131=_0x3f2e83[_0x52c5b5][_0x38fd('0x6d')]?_0x109744[_0x3f2e83[_0x52c5b5]['MetricId']][_0x38fd('0x87')]:_0x3f2e83[_0x52c5b5]['field'];_0x594131=_0x3f2e83[_0x52c5b5][_0x38fd('0x6e')]?_['replace'](_0x4bb383[_0x3f2e83[_0x52c5b5][_0x38fd('0x6e')]],'%s',_0x594131):_0x594131;_0x594131=_0x3f2e83[_0x52c5b5][_0x38fd('0x70')]?_[_0x38fd('0x6f')](_0x3ce84d[_0x3f2e83[_0x52c5b5][_0x38fd('0x70')]],'%s',_0x594131):_0x594131;if(_0x3f2e83[_0x52c5b5][_0x38fd('0x71')]){_0x23f1d1[_0x38fd('0x64')](_0x594131);}_0x3f2e83[_0x52c5b5][_0x38fd('0x72')]&&_0x23f1d1[_0x38fd('0x32')](_0x594131,_0x3f2e83[_0x52c5b5]['orderBy']==='DESC'?![]:!![]);_0x23f1d1[_0x38fd('0x3a')](_0x594131,_0x3f2e83[_0x52c5b5][_0x38fd('0x73')]||_0x594131);}if(_0x3cc9f6[_0x38fd('0x74')]){_0x3cc9f6[_0x38fd('0x74')]=JSON[_0x38fd('0x7a')](_0x3cc9f6[_0x38fd('0x74')]);for(var _0x55d78c=0x0;_0x55d78c<_0x3cc9f6['joins'][_0x38fd('0x61')];_0x55d78c+=0x1){if(_0x3cc9f6['joins'][_0x55d78c][_0x38fd('0x37')]&&_[_0x38fd('0x5e')](_0x50192a,_0x3cc9f6[_0x38fd('0x74')][_0x55d78c][_0x38fd('0x37')])&&_0x3cc9f6[_0x38fd('0x74')][_0x55d78c][_0x38fd('0x75')]&&_0x3cc9f6['joins'][_0x55d78c]['foreignTable']&&_0x3cc9f6['joins'][_0x55d78c][_0x38fd('0x77')]){_0x23f1d1[_0x3cc9f6[_0x38fd('0x74')][_0x55d78c][_0x38fd('0x37')]](_0x3cc9f6[_0x38fd('0x74')][_0x55d78c]['foreignTable'],null,util[_0x38fd('0x70')](_0x38fd('0x78'),_0x3cc9f6[_0x38fd('0x6c')],_0x3cc9f6[_0x38fd('0x74')][_0x55d78c][_0x38fd('0x75')],_0x3cc9f6[_0x38fd('0x74')][_0x55d78c][_0x38fd('0x76')],_0x3cc9f6[_0x38fd('0x74')][_0x55d78c][_0x38fd('0x77')]));}}}if(_0x3cc9f6[_0x38fd('0x79')]){_0x3cc9f6[_0x38fd('0x79')]=JSON[_0x38fd('0x7a')](_0x3cc9f6[_0x38fd('0x79')]);_0x23f1d1[_0x38fd('0x34')](_0x40ef0b(_0x3cc9f6[_0x38fd('0x79')][_0x38fd('0x64')]));}_0x4a8e7b=_0x23f1d1[_0x38fd('0x7b')]();_0x23f1d1[_0x38fd('0x1b')](_0x40efa4);_0x23f1d1[_0x38fd('0x1a')](0x0);logger[_0x38fd('0x7c')]('Limited\x20Query:',_0x23f1d1[_0x38fd('0x7d')]());return db[_0x38fd('0x7e')]['query'](_0x23f1d1[_0x38fd('0x7d')](),{'type':db[_0x38fd('0x7e')][_0x38fd('0x9d')][_0x38fd('0x89')]});}})[_0x38fd('0x21')](function(){return{'sql':_0x4a8e7b[_0x38fd('0x7d')]()};})[_0x38fd('0x21')](respondWithResult(_0x3f0d99,null))[_0x38fd('0x3e')](handleError(_0x3f0d99,null));}; \ No newline at end of file +var _0xee80=['send','index','map','AnalyticDefaultReport','fieldName','type','key','keys','intersection','model','query','attributes','fields','length','nolimit','limit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','include','findAll','show','rawAttributes','includeAll','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','find','userProfileId','catch','update','params','body','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','from','table','MetricId','metric','field','function','replace','format','groupBy','DESC','alias','joins','foreignTable','foreignKey','conditions','parse','clone','debug','Limited\x20Query:','toString','sequelize','SELECT','COUNT(%s)','GROUP_CONCAT(%s)','DATE(%s)','Sequelize','ValidationErrorItem','select','orderBy','parentKey','QueryTypes','No\x20available\x20data','output','%s-%s.%s','generate','default','AnalyticExtractedReport','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','child_process','../../components/export/','../../files/reports','savename','countTable','run','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','HOUR(%s)','IS\x20NOT\x20NULL','IS\x20EMPTY','%s.%s\x20=\x20%s.%s','html-pdf','rimraf','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','sendStatus','status','count','offset','set','json','apply','reject','save','then','destroy','DefaultReports','UserProfileResource','error','name'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xee80,0x1b0));var _0x0ee8=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xee80[_0x2070da];return _0x4f9fe1;};'use strict';var pdf=require(_0x0ee8('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x0ee8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0ee8('0x2'));var rp=require(_0x0ee8('0x3'));var moment=require('moment');var BPromise=require(_0x0ee8('0x4'));var Mustache=require('mustache');var util=require(_0x0ee8('0x5'));var path=require('path');var sox=require(_0x0ee8('0x6'));var csv=require(_0x0ee8('0x7'));var ejs=require(_0x0ee8('0x8'));var fs=require('fs');var _=require(_0x0ee8('0x9'));var squel=require(_0x0ee8('0xa'));var crypto=require(_0x0ee8('0xb'));var jsforce=require(_0x0ee8('0xc'));var deskjs=require(_0x0ee8('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0ee8('0xe'));var Redis=require(_0x0ee8('0xf'));var authService=require(_0x0ee8('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x0ee8('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0ee8('0x12'))(_0x0ee8('0x13'));var utils=require('../../config/utils');var config=require(_0x0ee8('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x42a14c,_0x735b5c){_0x735b5c=_0x735b5c||0xcc;return function(_0x342e37){if(_0x342e37){return _0x42a14c[_0x0ee8('0x15')](_0x735b5c);}return _0x42a14c[_0x0ee8('0x16')](_0x735b5c)['end']();};}function respondWithResult(_0x40f7f4,_0x31a601){_0x31a601=_0x31a601||0xc8;return function(_0x516156){if(_0x516156){return _0x40f7f4[_0x0ee8('0x16')](_0x31a601)['json'](_0x516156);}};}function respondWithFilteredResult(_0x3c0ce9,_0x532097){return function(_0x28ac56){if(_0x28ac56){var _0x1e23bd=_0x28ac56[_0x0ee8('0x17')],_0x746b9f=_0x532097['offset'],_0x2fdd68=_0x532097[_0x0ee8('0x18')]+_0x532097['limit'],_0x22e1cd;if(_0x2fdd68>=_0x1e23bd){_0x2fdd68=_0x1e23bd;_0x22e1cd=0xc8;}else{_0x22e1cd=0xce;}_0x3c0ce9[_0x0ee8('0x16')](_0x22e1cd);return _0x3c0ce9[_0x0ee8('0x19')]('Content-Range',_0x746b9f+'-'+_0x2fdd68+'/'+_0x1e23bd)[_0x0ee8('0x1a')](_0x28ac56);}return null;};}function patchUpdates(_0x5ba711){return function(_0x41b125){try{jsonpatch[_0x0ee8('0x1b')](_0x41b125,_0x5ba711,!![]);}catch(_0x1fdb74){return BPromise[_0x0ee8('0x1c')](_0x1fdb74);}return _0x41b125[_0x0ee8('0x1d')]();};}function saveUpdates(_0x31d78f,_0x28ac31){return function(_0x444b2f){if(_0x444b2f){return _0x444b2f['update'](_0x31d78f)[_0x0ee8('0x1e')](function(_0x5923c1){return _0x5923c1;});}return null;};}function removeEntity(_0x1bc16d,_0x54a190){return function(_0x12e00f){if(_0x12e00f){return _0x12e00f[_0x0ee8('0x1f')]()['then'](function(){var _0xa3e7df=_0x12e00f['get']({'plain':!![]});var _0x42a1bc=_0x0ee8('0x20');return db[_0x0ee8('0x21')][_0x0ee8('0x1f')]({'where':{'type':_0x42a1bc,'resourceId':_0xa3e7df['id']}})[_0x0ee8('0x1e')](function(){return _0x12e00f;});})[_0x0ee8('0x1e')](function(){_0x1bc16d[_0x0ee8('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x443c56,_0x107809){return function(_0x2d0818){if(!_0x2d0818){_0x443c56[_0x0ee8('0x15')](0x194);}return _0x2d0818;};}function handleError(_0x4a3d0d,_0x4e8cb0){_0x4e8cb0=_0x4e8cb0||0x1f4;return function(_0x49c731){logger[_0x0ee8('0x22')](_0x49c731['stack']);if(_0x49c731[_0x0ee8('0x23')]){delete _0x49c731['name'];}_0x4a3d0d[_0x0ee8('0x16')](_0x4e8cb0)[_0x0ee8('0x24')](_0x49c731);};}exports[_0x0ee8('0x25')]=function(_0x43f0fe,_0xe2ad61){var _0x2f944b={},_0x462a0c={},_0x9e4ea2={'count':0x0,'rows':[]};var _0x129a52=_[_0x0ee8('0x26')](db[_0x0ee8('0x27')]['rawAttributes'],function(_0x4d229d){return{'name':_0x4d229d[_0x0ee8('0x28')],'type':_0x4d229d[_0x0ee8('0x29')][_0x0ee8('0x2a')]};});_0x462a0c['model']=_['map'](_0x129a52,_0x0ee8('0x23'));_0x462a0c['query']=_[_0x0ee8('0x2b')](_0x43f0fe['query']);_0x462a0c['filters']=_[_0x0ee8('0x2c')](_0x462a0c[_0x0ee8('0x2d')],_0x462a0c[_0x0ee8('0x2e')]);_0x2f944b[_0x0ee8('0x2f')]=_['intersection'](_0x462a0c[_0x0ee8('0x2d')],qs[_0x0ee8('0x30')](_0x43f0fe[_0x0ee8('0x2e')]['fields']));_0x2f944b[_0x0ee8('0x2f')]=_0x2f944b[_0x0ee8('0x2f')][_0x0ee8('0x31')]?_0x2f944b['attributes']:_0x462a0c['model'];if(!_0x43f0fe[_0x0ee8('0x2e')]['hasOwnProperty'](_0x0ee8('0x32'))){_0x2f944b[_0x0ee8('0x33')]=qs['limit'](_0x43f0fe[_0x0ee8('0x2e')][_0x0ee8('0x33')]);_0x2f944b[_0x0ee8('0x18')]=qs[_0x0ee8('0x18')](_0x43f0fe[_0x0ee8('0x2e')][_0x0ee8('0x18')]);}_0x2f944b[_0x0ee8('0x34')]=qs[_0x0ee8('0x35')](_0x43f0fe[_0x0ee8('0x2e')][_0x0ee8('0x35')]);_0x2f944b[_0x0ee8('0x36')]=qs['filters'](_[_0x0ee8('0x37')](_0x43f0fe[_0x0ee8('0x2e')],_0x462a0c[_0x0ee8('0x38')]));if(_0x43f0fe[_0x0ee8('0x2e')][_0x0ee8('0x39')]){_0x2f944b[_0x0ee8('0x36')]=_[_0x0ee8('0x3a')](_0x2f944b['where'],{'$or':_[_0x0ee8('0x26')](_0x129a52,function(_0x29b13a){if(_0x29b13a[_0x0ee8('0x29')][_0x0ee8('0x2a')]!==_0x0ee8('0x3b')){var _0xbf5faa={};_0xbf5faa[_0x29b13a['field']]={'$like':'%'+_0x43f0fe[_0x0ee8('0x2e')][_0x0ee8('0x39')]+'%'};return _0xbf5faa;}})});}_0x2f944b=_['merge']({},_0x2f944b,_0x43f0fe[_0x0ee8('0x3c')]);var _0x1f2f94={'where':_0x2f944b[_0x0ee8('0x36')]};return db[_0x0ee8('0x27')][_0x0ee8('0x17')](_0x1f2f94)[_0x0ee8('0x1e')](function(_0x26a04b){_0x9e4ea2[_0x0ee8('0x17')]=_0x26a04b;if(_0x43f0fe[_0x0ee8('0x2e')]['includeAll']){_0x2f944b[_0x0ee8('0x3d')]=[{'all':!![]}];}return db[_0x0ee8('0x27')][_0x0ee8('0x3e')](_0x2f944b);})[_0x0ee8('0x1e')](function(_0x1684f4){_0x9e4ea2['rows']=_0x1684f4;return _0x9e4ea2;})[_0x0ee8('0x1e')](respondWithFilteredResult(_0xe2ad61,_0x2f944b))['catch'](handleError(_0xe2ad61,null));};exports[_0x0ee8('0x3f')]=function(_0x1563cc,_0x1e38ae){var _0x8ef3ab={'raw':!![],'where':{'id':_0x1563cc['params']['id']}},_0x24b91b={};_0x24b91b[_0x0ee8('0x2d')]=_[_0x0ee8('0x2b')](db[_0x0ee8('0x27')][_0x0ee8('0x40')]);_0x24b91b[_0x0ee8('0x2e')]=_[_0x0ee8('0x2b')](_0x1563cc[_0x0ee8('0x2e')]);_0x24b91b[_0x0ee8('0x38')]=_[_0x0ee8('0x2c')](_0x24b91b[_0x0ee8('0x2d')],_0x24b91b['query']);_0x8ef3ab[_0x0ee8('0x2f')]=_[_0x0ee8('0x2c')](_0x24b91b[_0x0ee8('0x2d')],qs[_0x0ee8('0x30')](_0x1563cc[_0x0ee8('0x2e')]['fields']));_0x8ef3ab[_0x0ee8('0x2f')]=_0x8ef3ab[_0x0ee8('0x2f')][_0x0ee8('0x31')]?_0x8ef3ab[_0x0ee8('0x2f')]:_0x24b91b['model'];if(_0x1563cc['query'][_0x0ee8('0x41')]){_0x8ef3ab[_0x0ee8('0x3d')]=[{'all':!![]}];}_0x8ef3ab=_[_0x0ee8('0x3a')]({},_0x8ef3ab,_0x1563cc[_0x0ee8('0x3c')]);return db[_0x0ee8('0x27')]['find'](_0x8ef3ab)[_0x0ee8('0x1e')](handleEntityNotFound(_0x1e38ae,null))[_0x0ee8('0x1e')](respondWithResult(_0x1e38ae,null))['catch'](handleError(_0x1e38ae,null));};exports[_0x0ee8('0x42')]=function(_0x4899b7,_0x341493){return db[_0x0ee8('0x27')][_0x0ee8('0x42')](_0x4899b7['body'],{})[_0x0ee8('0x1e')](function(_0x5c1f23){var _0x36b6ec=_0x4899b7[_0x0ee8('0x43')][_0x0ee8('0x44')]({'plain':!![]});if(!_0x36b6ec)throw new Error(_0x0ee8('0x45'));if(_0x36b6ec[_0x0ee8('0x46')]===_0x0ee8('0x43')){var _0x41e7a2=_0x5c1f23['get']({'plain':!![]});var _0x3a6bea=_0x0ee8('0x47');return db['UserProfileSection'][_0x0ee8('0x48')]({'where':{'name':_0x3a6bea,'userProfileId':_0x36b6ec[_0x0ee8('0x49')]},'raw':!![]})['then'](function(_0x593b23){if(_0x593b23&&_0x593b23['autoAssociation']===0x0){return db[_0x0ee8('0x21')][_0x0ee8('0x42')]({'name':_0x41e7a2[_0x0ee8('0x23')],'resourceId':_0x41e7a2['id'],'type':_0x0ee8('0x20'),'sectionId':_0x593b23['id']},{})[_0x0ee8('0x1e')](function(){return _0x5c1f23;});}else{return _0x5c1f23;}})[_0x0ee8('0x4a')](function(_0x40dbfa){logger[_0x0ee8('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x40dbfa);throw _0x40dbfa;});}return _0x5c1f23;})['then'](respondWithResult(_0x341493,0xc9))[_0x0ee8('0x4a')](handleError(_0x341493,null));};exports[_0x0ee8('0x4b')]=function(_0x3487e0,_0x1dd071){if(_0x3487e0['body']['id']){delete _0x3487e0['body']['id'];}return db[_0x0ee8('0x27')][_0x0ee8('0x48')]({'where':{'id':_0x3487e0[_0x0ee8('0x4c')]['id']}})[_0x0ee8('0x1e')](handleEntityNotFound(_0x1dd071,null))[_0x0ee8('0x1e')](saveUpdates(_0x3487e0[_0x0ee8('0x4d')],null))[_0x0ee8('0x1e')](respondWithResult(_0x1dd071,null))['catch'](handleError(_0x1dd071,null));};exports['destroy']=function(_0x352908,_0x3fe57){return db['AnalyticDefaultReport']['find']({'where':{'id':_0x352908[_0x0ee8('0x4c')]['id']}})[_0x0ee8('0x1e')](handleEntityNotFound(_0x3fe57,null))['then'](removeEntity(_0x3fe57,null))[_0x0ee8('0x4a')](handleError(_0x3fe57,null));};exports[_0x0ee8('0x4e')]=function(_0x226283,_0x13facd){var _0x57eca8=0xa;var _0x265f4c=[_0x0ee8('0x4f'),_0x0ee8('0x50'),_0x0ee8('0x51'),_0x0ee8('0x52')];var _0x10cff5={'SUM':_0x0ee8('0x53'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x0ee8('0x54'),'MAX':_0x0ee8('0x55'),'MIN':_0x0ee8('0x56'),'AVG':_0x0ee8('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x0ee8('0x58')};var _0x205af3={'SEC_TO_TIME':_0x0ee8('0x59'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x0ee8('0x5a'),'UNIX_TIMESTAMP':_0x0ee8('0x5b')};var _0x39094f=function(_0x36f230){return!_[_0x0ee8('0x5c')]([_0x0ee8('0x5d'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0x0ee8('0x5e')],_0x36f230);};var _0x3808f4=function(_0x4dc3a1){if(!_0x4dc3a1||!_0x4dc3a1[_0x0ee8('0x5f')][_0x0ee8('0x31')]){return'';}for(var _0x123136='(',_0x32e870=0x0;_0x32e870<_0x4dc3a1['rules'][_0x0ee8('0x31')];_0x32e870+=0x1){_0x32e870>0x0&&(_0x123136+='\x20'+_0x4dc3a1[_0x0ee8('0x60')]+'\x20');_0x123136+=_0x4dc3a1[_0x0ee8('0x5f')][_0x32e870][_0x0ee8('0x61')]?_0x3808f4(_0x4dc3a1[_0x0ee8('0x5f')][_0x32e870]['group']):_0x4dc3a1[_0x0ee8('0x5f')][_0x32e870]['field']+'\x20'+_0x4dc3a1[_0x0ee8('0x5f')][_0x32e870]['condition']+(_0x39094f(_0x4dc3a1[_0x0ee8('0x5f')][_0x32e870][_0x0ee8('0x62')])?'\x20'+_0x4dc3a1[_0x0ee8('0x5f')][_0x32e870][_0x0ee8('0x63')]:'');}return _0x123136+')';};var _0x10fe80={'where':{'id':_0x226283['params']['id']}},_0xceeb33,_0x5a3f7a,_0x46f297,_0x49f914,_0x3e5ad1;_0x10fe80=_[_0x0ee8('0x3a')]({},_0x10fe80,_0x226283[_0x0ee8('0x3c')]);return db[_0x0ee8('0x27')][_0x0ee8('0x48')](_0x10fe80)['then'](function(_0x5743df){if(_0x5743df){_0xceeb33=_0x5743df;return _0x5743df[_0x0ee8('0x64')]();}return null;})[_0x0ee8('0x1e')](function(_0x5cb1c6){if(_0x5cb1c6){if(!_0x5cb1c6[_0x0ee8('0x31')]){throw new db['Sequelize']['ValidationErrorItem'](_0x0ee8('0x65'),0x193);}_0x5a3f7a=_0x5cb1c6;return db[_0x0ee8('0x66')][_0x0ee8('0x3e')]({'raw':!![]});}return null;})[_0x0ee8('0x1e')](function(_0x3c281f){if(_0x3c281f){_0x46f297=_[_0x0ee8('0x67')](_0x3c281f,'id');var _0x1c8af6;var _0x30808c=squel['select']();_0x30808c[_0x0ee8('0x68')](_0xceeb33[_0x0ee8('0x69')]);for(var _0x2a2bb9=0x0;_0x2a2bb9<_0x5a3f7a[_0x0ee8('0x31')];_0x2a2bb9+=0x1){_0x1c8af6=_0x5a3f7a[_0x2a2bb9][_0x0ee8('0x6a')]?_0x46f297[_0x5a3f7a[_0x2a2bb9][_0x0ee8('0x6a')]][_0x0ee8('0x6b')]:_0x5a3f7a[_0x2a2bb9][_0x0ee8('0x6c')];_0x1c8af6=_0x5a3f7a[_0x2a2bb9][_0x0ee8('0x6d')]?_[_0x0ee8('0x6e')](_0x10cff5[_0x5a3f7a[_0x2a2bb9][_0x0ee8('0x6d')]],'%s',_0x1c8af6):_0x1c8af6;_0x1c8af6=_0x5a3f7a[_0x2a2bb9][_0x0ee8('0x6f')]?_[_0x0ee8('0x6e')](_0x205af3[_0x5a3f7a[_0x2a2bb9][_0x0ee8('0x6f')]],'%s',_0x1c8af6):_0x1c8af6;if(_0x5a3f7a[_0x2a2bb9][_0x0ee8('0x70')]){_0x30808c[_0x0ee8('0x61')](_0x1c8af6);}_0x5a3f7a[_0x2a2bb9]['orderBy']&&_0x30808c[_0x0ee8('0x34')](_0x1c8af6,_0x5a3f7a[_0x2a2bb9]['orderBy']===_0x0ee8('0x71')?![]:!![]);_0x30808c[_0x0ee8('0x6c')](_0x1c8af6,_0x5a3f7a[_0x2a2bb9][_0x0ee8('0x72')]||_0x1c8af6);}if(_0xceeb33[_0x0ee8('0x73')]){_0xceeb33['joins']=JSON['parse'](_0xceeb33[_0x0ee8('0x73')]);for(var _0x3f1796=0x0;_0x3f1796<_0xceeb33['joins'][_0x0ee8('0x31')];_0x3f1796+=0x1){if(_0xceeb33[_0x0ee8('0x73')][_0x3f1796][_0x0ee8('0x29')]&&_[_0x0ee8('0x5c')](_0x265f4c,_0xceeb33[_0x0ee8('0x73')][_0x3f1796][_0x0ee8('0x29')])&&_0xceeb33[_0x0ee8('0x73')][_0x3f1796]['parentKey']&&_0xceeb33[_0x0ee8('0x73')][_0x3f1796][_0x0ee8('0x74')]&&_0xceeb33['joins'][_0x3f1796][_0x0ee8('0x75')]){_0x30808c[_0xceeb33['joins'][_0x3f1796][_0x0ee8('0x29')]](_0xceeb33[_0x0ee8('0x73')][_0x3f1796][_0x0ee8('0x74')],null,util[_0x0ee8('0x6f')]('%s.%s\x20=\x20%s.%s',_0xceeb33[_0x0ee8('0x69')],_0xceeb33[_0x0ee8('0x73')][_0x3f1796]['parentKey'],_0xceeb33[_0x0ee8('0x73')][_0x3f1796][_0x0ee8('0x74')],_0xceeb33['joins'][_0x3f1796]['foreignKey']));}}}if(_0xceeb33['conditions']){_0xceeb33[_0x0ee8('0x76')]=JSON[_0x0ee8('0x77')](_0xceeb33[_0x0ee8('0x76')]);_0x30808c['where'](_0x3808f4(_0xceeb33[_0x0ee8('0x76')]['group']));}_0x3e5ad1=_0x30808c[_0x0ee8('0x78')]();_0x30808c['limit'](_0x57eca8);_0x30808c[_0x0ee8('0x18')](0x0);logger[_0x0ee8('0x79')](_0x0ee8('0x7a'),_0x30808c[_0x0ee8('0x7b')]());return db[_0x0ee8('0x7c')][_0x0ee8('0x2e')](_0x30808c[_0x0ee8('0x7b')](),{'type':db[_0x0ee8('0x7c')]['QueryTypes'][_0x0ee8('0x7d')]});}})['then'](respondWithResult(_0x13facd,null))['catch'](handleError(_0x13facd,null));};function runReport(_0x22c20f,_0x2653f8,_0x53c1ab){var _0xfa7bea=_0x2653f8['name'];var _0x41b8da=0xa;var _0x19b4fd=['join',_0x0ee8('0x50'),_0x0ee8('0x51'),_0x0ee8('0x52')];var _0x26b18e={'SUM':_0x0ee8('0x53'),'COUNT':_0x0ee8('0x7e'),'COUNT DISTINCT':_0x0ee8('0x54'),'MAX':_0x0ee8('0x55'),'MIN':_0x0ee8('0x56'),'AVG':_0x0ee8('0x57'),'GROUP_CONCAT':_0x0ee8('0x7f'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x0ee8('0x58')};var _0x2bad6d={'SEC_TO_TIME':_0x0ee8('0x59'),'DATE':_0x0ee8('0x80'),'HOUR':'HOUR(%s)','ROUND':_0x0ee8('0x5a'),'UNIX_TIMESTAMP':_0x0ee8('0x5b')};var _0x37fe28=function(_0x26b811){return!_[_0x0ee8('0x5c')]([_0x0ee8('0x5d'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0x0ee8('0x5e')],_0x26b811);};var _0x1164be=function(_0xd9ab3c){if(!_0xd9ab3c||!_0xd9ab3c[_0x0ee8('0x5f')][_0x0ee8('0x31')]){return'';}for(var _0x504a70='(',_0x1c2298=0x0;_0x1c2298<_0xd9ab3c['rules'][_0x0ee8('0x31')];_0x1c2298+=0x1){_0x1c2298>0x0&&(_0x504a70+='\x20'+_0xd9ab3c[_0x0ee8('0x60')]+'\x20');_0x504a70+=_0xd9ab3c[_0x0ee8('0x5f')][_0x1c2298][_0x0ee8('0x61')]?_0x1164be(_0xd9ab3c[_0x0ee8('0x5f')][_0x1c2298][_0x0ee8('0x61')]):_0xd9ab3c[_0x0ee8('0x5f')][_0x1c2298][_0x0ee8('0x6c')]+'\x20'+_0xd9ab3c[_0x0ee8('0x5f')][_0x1c2298][_0x0ee8('0x62')]+(_0x37fe28(_0xd9ab3c[_0x0ee8('0x5f')][_0x1c2298][_0x0ee8('0x62')])?'\x20'+_0xd9ab3c[_0x0ee8('0x5f')][_0x1c2298]['value']:'');}return _0x504a70+')';};var _0x41ee6a={'where':{'id':_0x22c20f['id']}},_0x5a0227,_0x55e138,_0x523461,_0x46e5ef,_0x4a387a;_0x41ee6a=_[_0x0ee8('0x3a')]({},_0x41ee6a,_0x53c1ab);return db[_0x0ee8('0x27')]['find'](_0x41ee6a)[_0x0ee8('0x1e')](function(_0xd8bb6e){if(_0xd8bb6e){_0x5a0227=_0xd8bb6e;return _0xd8bb6e[_0x0ee8('0x64')]();}return null;})[_0x0ee8('0x1e')](function(_0x4fa60b){if(_0x4fa60b){if(!_0x4fa60b[_0x0ee8('0x31')]){throw new db[(_0x0ee8('0x81'))][(_0x0ee8('0x82'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x55e138=_0x4fa60b;return db[_0x0ee8('0x66')]['findAll']({'raw':!![]});}return null;})[_0x0ee8('0x1e')](function(_0x583bea){if(_0x583bea){_0x523461=_[_0x0ee8('0x67')](_0x583bea,'id');var _0xd1b9a9;var _0x3003c8=squel[_0x0ee8('0x83')]();_0x3003c8[_0x0ee8('0x68')](_0x5a0227['table']);for(var _0xc85f79=0x0;_0xc85f79<_0x55e138[_0x0ee8('0x31')];_0xc85f79+=0x1){_0xd1b9a9=_0x55e138[_0xc85f79][_0x0ee8('0x6a')]?_0x523461[_0x55e138[_0xc85f79]['MetricId']][_0x0ee8('0x6b')]:_0x55e138[_0xc85f79][_0x0ee8('0x6c')];_0xd1b9a9=_0x55e138[_0xc85f79]['function']?_[_0x0ee8('0x6e')](_0x26b18e[_0x55e138[_0xc85f79]['function']],'%s',_0xd1b9a9):_0xd1b9a9;_0xd1b9a9=_0x55e138[_0xc85f79]['format']?_[_0x0ee8('0x6e')](_0x2bad6d[_0x55e138[_0xc85f79][_0x0ee8('0x6f')]],'%s',_0xd1b9a9):_0xd1b9a9;if(_0x55e138[_0xc85f79][_0x0ee8('0x70')]){_0x3003c8[_0x0ee8('0x61')](_0xd1b9a9);}_0x55e138[_0xc85f79][_0x0ee8('0x84')]&&_0x3003c8[_0x0ee8('0x34')](_0xd1b9a9,_0x55e138[_0xc85f79][_0x0ee8('0x84')]===_0x0ee8('0x71')?![]:!![]);_0x3003c8[_0x0ee8('0x6c')](_0xd1b9a9,_0x55e138[_0xc85f79][_0x0ee8('0x72')]||_0xd1b9a9);}if(_0x5a0227[_0x0ee8('0x73')]){_0x5a0227['joins']=JSON[_0x0ee8('0x77')](_0x5a0227[_0x0ee8('0x73')]);for(var _0x34ec1e=0x0;_0x34ec1e<_0x5a0227['joins']['length'];_0x34ec1e+=0x1){if(_0x5a0227['joins'][_0x34ec1e][_0x0ee8('0x29')]&&_[_0x0ee8('0x5c')](_0x19b4fd,_0x5a0227[_0x0ee8('0x73')][_0x34ec1e]['type'])&&_0x5a0227['joins'][_0x34ec1e][_0x0ee8('0x85')]&&_0x5a0227[_0x0ee8('0x73')][_0x34ec1e][_0x0ee8('0x74')]&&_0x5a0227[_0x0ee8('0x73')][_0x34ec1e][_0x0ee8('0x75')]){_0x3003c8[_0x5a0227[_0x0ee8('0x73')][_0x34ec1e][_0x0ee8('0x29')]](_0x5a0227[_0x0ee8('0x73')][_0x34ec1e][_0x0ee8('0x74')],null,util[_0x0ee8('0x6f')]('%s.%s\x20=\x20%s.%s',_0x5a0227[_0x0ee8('0x69')],_0x5a0227[_0x0ee8('0x73')][_0x34ec1e][_0x0ee8('0x85')],_0x5a0227[_0x0ee8('0x73')][_0x34ec1e][_0x0ee8('0x74')],_0x5a0227[_0x0ee8('0x73')][_0x34ec1e][_0x0ee8('0x75')]));}}}if(_0x5a0227['conditions']){_0x5a0227['conditions']=JSON[_0x0ee8('0x77')](_0x5a0227[_0x0ee8('0x76')]);_0x3003c8[_0x0ee8('0x36')](_0x1164be(_0x5a0227[_0x0ee8('0x76')][_0x0ee8('0x61')]));}_0x4a387a=_0x3003c8[_0x0ee8('0x78')]();_0x3003c8['limit'](_0x41b8da);_0x3003c8[_0x0ee8('0x18')](0x0);logger['debug']('Limited\x20Query:',_0x3003c8[_0x0ee8('0x7b')]());return db[_0x0ee8('0x7c')][_0x0ee8('0x2e')](_0x3003c8[_0x0ee8('0x7b')](),{'type':db[_0x0ee8('0x7c')][_0x0ee8('0x86')][_0x0ee8('0x7d')]});}})[_0x0ee8('0x1e')](function(_0x29be83){if(!_0x29be83['length']){throw new db[(_0x0ee8('0x81'))][(_0x0ee8('0x82'))](_0x0ee8('0x87'),0xcc);}if(_0x2653f8[_0x0ee8('0x88')]==='web'){return null;}var _0x5856e2=_[_0x0ee8('0x3a')](_0x2653f8,{'name':_0x2653f8['fullPath']||_0x2653f8[_0x0ee8('0x23')]||_0x5a0227[_0x0ee8('0x23')],'basename':_0xfa7bea,'savename':util[_0x0ee8('0x6f')](_0x0ee8('0x89'),_0x2653f8[_0x0ee8('0x23')]||_0x5a0227[_0x0ee8('0x23')],require('randomstring')[_0x0ee8('0x8a')](0x4),_0x2653f8[_0x0ee8('0x88')]||'csv'),'reportId':_0x5a0227['id'],'reportType':_0x0ee8('0x8b')});return db[_0x0ee8('0x8c')][_0x0ee8('0x42')](_0x5856e2,{'raw':!![]});})[_0x0ee8('0x1e')](function(_0xc71bfb){if(_0x5a0227[_0x0ee8('0x69')]==='cdr'){_0x4a387a[_0x0ee8('0x36')](_0x5a0227['table']+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x2653f8[_0x0ee8('0x8d')],_0x2653f8['endDate']);}else{_0x4a387a[_0x0ee8('0x36')](_0x5a0227[_0x0ee8('0x69')]+_0x0ee8('0x8e'),_0x2653f8[_0x0ee8('0x8d')],_0x2653f8[_0x0ee8('0x8f')]);}if(_0xc71bfb){logger['info']('Run\x20Query:',_0x4a387a[_0x0ee8('0x7b')]());require(_0x0ee8('0x90'))['fork'](path['join'](__dirname,_0x0ee8('0x91'),_0xc71bfb['output']),[_0xc71bfb['id'],_0x4a387a[_0x0ee8('0x7b')](),path[_0x0ee8('0x4f')](__dirname,_0x0ee8('0x92'),_0xc71bfb[_0x0ee8('0x93')]),_0xfa7bea]);return _0xc71bfb;}else{var _0xcdb198=squel[_0x0ee8('0x83')]();_0xcdb198[_0x0ee8('0x68')]('('+_0x4a387a[_0x0ee8('0x7b')]()+')',_0x0ee8('0x94'));_0xcdb198[_0x0ee8('0x6c')]('COUNT(*)',_0x0ee8('0x17'));_0x4a387a[_0x0ee8('0x33')](_0x2653f8[_0x0ee8('0x33')]||_0x41b8da);_0x4a387a['offset'](_0x2653f8[_0x0ee8('0x18')]||0x0);return db[_0x0ee8('0x7c')]['query'](_0xcdb198[_0x0ee8('0x7b')](),{'type':db['sequelize'][_0x0ee8('0x86')][_0x0ee8('0x7d')]})[_0x0ee8('0x1e')](function(_0xc53cbe){if(!_0xc53cbe[_0x0ee8('0x31')]){_0x46e5ef=0x0;}else{_0x46e5ef=_0xc53cbe[0x0]['count']||0x0;}return db[_0x0ee8('0x7c')][_0x0ee8('0x2e')](_0x4a387a[_0x0ee8('0x7b')](),{'type':db[_0x0ee8('0x7c')][_0x0ee8('0x86')][_0x0ee8('0x7d')]});})[_0x0ee8('0x1e')](function(_0x4fc76b){return{'rows':_0x4fc76b||[],'count':_0x46e5ef};});}});}exports[_0x0ee8('0x95')]=function(_0x44e007,_0x52d150){return runReport(_0x44e007[_0x0ee8('0x4c')],_0x44e007[_0x0ee8('0x2e')],_0x44e007[_0x0ee8('0x3c')])['then'](respondWithResult(_0x52d150,null))[_0x0ee8('0x4a')](handleError(_0x52d150,null));};exports[_0x0ee8('0x96')]=runReport;exports[_0x0ee8('0x2e')]=function(_0x3889e2,_0x2270fc){var _0x95b418=0xa;var _0x285a52=[_0x0ee8('0x4f'),'left_join',_0x0ee8('0x51'),_0x0ee8('0x52')];var _0xa89deb={'SUM':_0x0ee8('0x53'),'COUNT':_0x0ee8('0x7e'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x0ee8('0x55'),'MIN':'MIN(%s)','AVG':_0x0ee8('0x57'),'GROUP_CONCAT':_0x0ee8('0x7f'),'GROUP_CONCAT ASC':_0x0ee8('0x97'),'GROUP_CONCAT DESC':_0x0ee8('0x58')};var _0x2170b9={'SEC_TO_TIME':_0x0ee8('0x59'),'DATE':_0x0ee8('0x80'),'HOUR':_0x0ee8('0x98'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x0ee8('0x5b')};var _0x560fe5=function(_0xce5997){return!_['includes'](['IS\x20NULL',_0x0ee8('0x99'),_0x0ee8('0x9a'),_0x0ee8('0x5e')],_0xce5997);};var _0x4d9963=function(_0x1d03e0){if(!_0x1d03e0||!_0x1d03e0[_0x0ee8('0x5f')][_0x0ee8('0x31')]){return'';}for(var _0x3ac44b='(',_0x1c9863=0x0;_0x1c9863<_0x1d03e0[_0x0ee8('0x5f')][_0x0ee8('0x31')];_0x1c9863+=0x1){_0x1c9863>0x0&&(_0x3ac44b+='\x20'+_0x1d03e0[_0x0ee8('0x60')]+'\x20');_0x3ac44b+=_0x1d03e0[_0x0ee8('0x5f')][_0x1c9863]['group']?_0x4d9963(_0x1d03e0[_0x0ee8('0x5f')][_0x1c9863][_0x0ee8('0x61')]):_0x1d03e0[_0x0ee8('0x5f')][_0x1c9863][_0x0ee8('0x6c')]+'\x20'+_0x1d03e0[_0x0ee8('0x5f')][_0x1c9863][_0x0ee8('0x62')]+(_0x560fe5(_0x1d03e0[_0x0ee8('0x5f')][_0x1c9863][_0x0ee8('0x62')])?'\x20'+_0x1d03e0[_0x0ee8('0x5f')][_0x1c9863]['value']:'');}return _0x3ac44b+')';};var _0x1b1874={'where':{'id':_0x3889e2['params']['id']}},_0x3c9c95,_0x3964ef,_0x14ffd4,_0x4f980f,_0x3037f0;_0x1b1874=_[_0x0ee8('0x3a')]({},_0x1b1874,_0x3889e2[_0x0ee8('0x3c')]);return db[_0x0ee8('0x27')]['find'](_0x1b1874)[_0x0ee8('0x1e')](function(_0x32bd97){if(_0x32bd97){_0x3c9c95=_0x32bd97;return _0x32bd97['getFields']();}return null;})[_0x0ee8('0x1e')](function(_0x2c4688){if(_0x2c4688){if(!_0x2c4688[_0x0ee8('0x31')]){throw new db[(_0x0ee8('0x81'))][(_0x0ee8('0x82'))](_0x0ee8('0x65'),0x193);}_0x3964ef=_0x2c4688;return db['AnalyticMetric'][_0x0ee8('0x3e')]({'raw':!![]});}return null;})[_0x0ee8('0x1e')](function(_0x4160ec){if(_0x4160ec){_0x14ffd4=_[_0x0ee8('0x67')](_0x4160ec,'id');var _0x60fbd9;var _0x4f5a4f=squel['select']();_0x4f5a4f['from'](_0x3c9c95[_0x0ee8('0x69')]);for(var _0xb5332c=0x0;_0xb5332c<_0x3964ef[_0x0ee8('0x31')];_0xb5332c+=0x1){_0x60fbd9=_0x3964ef[_0xb5332c][_0x0ee8('0x6a')]?_0x14ffd4[_0x3964ef[_0xb5332c][_0x0ee8('0x6a')]][_0x0ee8('0x6b')]:_0x3964ef[_0xb5332c][_0x0ee8('0x6c')];_0x60fbd9=_0x3964ef[_0xb5332c]['function']?_[_0x0ee8('0x6e')](_0xa89deb[_0x3964ef[_0xb5332c][_0x0ee8('0x6d')]],'%s',_0x60fbd9):_0x60fbd9;_0x60fbd9=_0x3964ef[_0xb5332c][_0x0ee8('0x6f')]?_[_0x0ee8('0x6e')](_0x2170b9[_0x3964ef[_0xb5332c][_0x0ee8('0x6f')]],'%s',_0x60fbd9):_0x60fbd9;if(_0x3964ef[_0xb5332c][_0x0ee8('0x70')]){_0x4f5a4f[_0x0ee8('0x61')](_0x60fbd9);}_0x3964ef[_0xb5332c][_0x0ee8('0x84')]&&_0x4f5a4f['order'](_0x60fbd9,_0x3964ef[_0xb5332c]['orderBy']===_0x0ee8('0x71')?![]:!![]);_0x4f5a4f[_0x0ee8('0x6c')](_0x60fbd9,_0x3964ef[_0xb5332c][_0x0ee8('0x72')]||_0x60fbd9);}if(_0x3c9c95['joins']){_0x3c9c95['joins']=JSON['parse'](_0x3c9c95[_0x0ee8('0x73')]);for(var _0x2711ba=0x0;_0x2711ba<_0x3c9c95[_0x0ee8('0x73')][_0x0ee8('0x31')];_0x2711ba+=0x1){if(_0x3c9c95[_0x0ee8('0x73')][_0x2711ba][_0x0ee8('0x29')]&&_['includes'](_0x285a52,_0x3c9c95[_0x0ee8('0x73')][_0x2711ba][_0x0ee8('0x29')])&&_0x3c9c95['joins'][_0x2711ba][_0x0ee8('0x85')]&&_0x3c9c95[_0x0ee8('0x73')][_0x2711ba][_0x0ee8('0x74')]&&_0x3c9c95[_0x0ee8('0x73')][_0x2711ba][_0x0ee8('0x75')]){_0x4f5a4f[_0x3c9c95[_0x0ee8('0x73')][_0x2711ba]['type']](_0x3c9c95['joins'][_0x2711ba][_0x0ee8('0x74')],null,util[_0x0ee8('0x6f')](_0x0ee8('0x9b'),_0x3c9c95[_0x0ee8('0x69')],_0x3c9c95[_0x0ee8('0x73')][_0x2711ba]['parentKey'],_0x3c9c95[_0x0ee8('0x73')][_0x2711ba][_0x0ee8('0x74')],_0x3c9c95[_0x0ee8('0x73')][_0x2711ba][_0x0ee8('0x75')]));}}}if(_0x3c9c95['conditions']){_0x3c9c95[_0x0ee8('0x76')]=JSON[_0x0ee8('0x77')](_0x3c9c95['conditions']);_0x4f5a4f[_0x0ee8('0x36')](_0x4d9963(_0x3c9c95[_0x0ee8('0x76')][_0x0ee8('0x61')]));}_0x3037f0=_0x4f5a4f[_0x0ee8('0x78')]();_0x4f5a4f[_0x0ee8('0x33')](_0x95b418);_0x4f5a4f[_0x0ee8('0x18')](0x0);logger[_0x0ee8('0x79')](_0x0ee8('0x7a'),_0x4f5a4f['toString']());return db[_0x0ee8('0x7c')][_0x0ee8('0x2e')](_0x4f5a4f[_0x0ee8('0x7b')](),{'type':db['sequelize'][_0x0ee8('0x86')]['SELECT']});}})[_0x0ee8('0x1e')](function(){return{'sql':_0x3037f0[_0x0ee8('0x7b')]()};})[_0x0ee8('0x1e')](respondWithResult(_0x2270fc,null))['catch'](handleError(_0x2270fc,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index d7d38a8..4cbd888 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 _0x4d1d=['analytics_default_reports','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport'];(function(_0xd1971b,_0x3256f6){var _0x201753=function(_0x4bc424){while(--_0x4bc424){_0xd1971b['push'](_0xd1971b['shift']());}};_0x201753(++_0x3256f6);}(_0x4d1d,0x153));var _0xd4d1=function(_0x2d37d8,_0x10639d){_0x2d37d8=_0x2d37d8-0x0;var _0x35432a=_0x4d1d[_0x2d37d8];return _0x35432a;};'use strict';var _=require('lodash');var util=require(_0xd4d1('0x0'));var logger=require(_0xd4d1('0x1'))(_0xd4d1('0x2'));var moment=require(_0xd4d1('0x3'));var BPromise=require(_0xd4d1('0x4'));var rp=require(_0xd4d1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd4d1('0x6'));var config=require(_0xd4d1('0x7'));var attributes=require(_0xd4d1('0x8'));module[_0xd4d1('0x9')]=function(_0x108ab0,_0x238e11){return _0x108ab0[_0xd4d1('0xa')](_0xd4d1('0xb'),attributes,{'tableName':_0xd4d1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfaa1=['moment','request-promise','path','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','api'];(function(_0x59026b,_0x12ace5){var _0x2c6152=function(_0x193dc2){while(--_0x193dc2){_0x59026b['push'](_0x59026b['shift']());}};_0x2c6152(++_0x12ace5);}(_0xfaa1,0x110));var _0x1faa=function(_0xf17b24,_0x3053fb){_0xf17b24=_0xf17b24-0x0;var _0x51485b=_0xfaa1[_0xf17b24];return _0x51485b;};'use strict';var _=require(_0x1faa('0x0'));var util=require(_0x1faa('0x1'));var logger=require('../../config/logger')(_0x1faa('0x2'));var moment=require(_0x1faa('0x3'));var BPromise=require('bluebird');var rp=require(_0x1faa('0x4'));var fs=require('fs');var path=require(_0x1faa('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1faa('0x6'));module[_0x1faa('0x7')]=function(_0x4cf115,_0x1d4d4d){return _0x4cf115[_0x1faa('0x8')](_0x1faa('0x9'),attributes,{'tableName':_0x1faa('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index e3c28b9..c620136 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 _0x6be1=['code','message','result','catch','lodash','util','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x31e9d7,_0x5bdda2){var _0x1e3b6e=function(_0x3413aa){while(--_0x3413aa){_0x31e9d7['push'](_0x31e9d7['shift']());}};_0x1e3b6e(++_0x5bdda2);}(_0x6be1,0x12f));var _0x16be=function(_0x31b7f5,_0x6a8c2a){_0x31b7f5=_0x31b7f5-0x0;var _0xac76=_0x6be1[_0x31b7f5];return _0xac76;};'use strict';var _=require(_0x16be('0x0'));var util=require(_0x16be('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x16be('0x2'))['db'];var utils=require(_0x16be('0x3'));var logger=require(_0x16be('0x4'))(_0x16be('0x5'));var config=require(_0x16be('0x6'));var jayson=require(_0x16be('0x7'));var client=jayson[_0x16be('0x8')][_0x16be('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2f6c26,_0x1c5e94,_0x4eaedb){return new BPromise(function(_0x36438c,_0x32ff9a){return client[_0x16be('0xa')](_0x2f6c26,_0x4eaedb)[_0x16be('0xb')](function(_0x1a820e){logger[_0x16be('0xc')](_0x16be('0xd'),_0x1c5e94,_0x16be('0xe'));logger[_0x16be('0xf')](_0x16be('0x10'),_0x1c5e94,_0x16be('0xe'),JSON[_0x16be('0x11')](_0x1a820e));if(_0x1a820e[_0x16be('0x12')]){if(_0x1a820e[_0x16be('0x12')][_0x16be('0x13')]===0x1f4){logger[_0x16be('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x1c5e94,_0x1a820e[_0x16be('0x12')][_0x16be('0x14')]);return _0x32ff9a(_0x1a820e[_0x16be('0x12')][_0x16be('0x14')]);}logger[_0x16be('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x1c5e94,_0x1a820e[_0x16be('0x12')][_0x16be('0x14')]);return _0x36438c(_0x1a820e['error'][_0x16be('0x14')]);}else{logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0x1c5e94,'request\x20sent');_0x36438c(_0x1a820e[_0x16be('0x15')][_0x16be('0x14')]);}})[_0x16be('0x16')](function(_0x5e8eeb){logger[_0x16be('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x1c5e94,_0x5e8eeb);_0x32ff9a(_0x5e8eeb);});});} \ No newline at end of file +var _0x9434=['message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x410b07,_0x1e1547){var _0x4f75ac=function(_0x47359b){while(--_0x47359b){_0x410b07['push'](_0x410b07['shift']());}};_0x4f75ac(++_0x1e1547);}(_0x9434,0x168));var _0x4943=function(_0x29431f,_0x25b59e){_0x29431f=_0x29431f-0x0;var _0x30a693=_0x9434[_0x29431f];return _0x30a693;};'use strict';var _=require(_0x4943('0x0'));var util=require(_0x4943('0x1'));var moment=require(_0x4943('0x2'));var BPromise=require(_0x4943('0x3'));var rs=require(_0x4943('0x4'));var fs=require('fs');var Redis=require(_0x4943('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4943('0x6'));var logger=require(_0x4943('0x7'))('rpc');var config=require(_0x4943('0x8'));var jayson=require(_0x4943('0x9'));var client=jayson['client'][_0x4943('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x56a55a,_0x4da494,_0x3ae08d){return new BPromise(function(_0x2f4119,_0x1876eb){return client[_0x4943('0xb')](_0x56a55a,_0x3ae08d)[_0x4943('0xc')](function(_0x553991){logger['info'](_0x4943('0xd'),_0x4da494,_0x4943('0xe'));logger[_0x4943('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x4da494,_0x4943('0xe'),JSON[_0x4943('0x10')](_0x553991));if(_0x553991['error']){if(_0x553991[_0x4943('0x11')]['code']===0x1f4){logger['error'](_0x4943('0xd'),_0x4da494,_0x553991[_0x4943('0x11')][_0x4943('0x12')]);return _0x1876eb(_0x553991[_0x4943('0x11')][_0x4943('0x12')]);}logger[_0x4943('0x11')](_0x4943('0xd'),_0x4da494,_0x553991['error'][_0x4943('0x12')]);return _0x2f4119(_0x553991[_0x4943('0x11')][_0x4943('0x12')]);}else{logger[_0x4943('0x13')](_0x4943('0xd'),_0x4da494,_0x4943('0xe'));_0x2f4119(_0x553991['result'][_0x4943('0x12')]);}})[_0x4943('0x14')](function(_0xb08628){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x4da494,_0xb08628);_0x1876eb(_0xb08628);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 0a1d02d..d93cf36 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 _0x5cd1=['preview','/:id/run','/:id/query','exports','multer','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id'];(function(_0x435ff2,_0x1cdbe8){var _0x2f406e=function(_0x549af0){while(--_0x549af0){_0x435ff2['push'](_0x435ff2['shift']());}};_0x2f406e(++_0x1cdbe8);}(_0x5cd1,0x16c));var _0x15cd=function(_0x5745eb,_0x39ee02){_0x5745eb=_0x5745eb-0x0;var _0x3731a7=_0x5cd1[_0x5745eb];return _0x3731a7;};'use strict';var multer=require(_0x15cd('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x15cd('0x1'));var express=require(_0x15cd('0x2'));var router=express['Router']();var auth=require(_0x15cd('0x3'));var interaction=require(_0x15cd('0x4'));var config=require(_0x15cd('0x5'));var controller=require(_0x15cd('0x6'));router[_0x15cd('0x7')]('/',auth[_0x15cd('0x8')](),controller[_0x15cd('0x9')]);router[_0x15cd('0x7')](_0x15cd('0xa'),auth['isAuthenticated'](),controller['show']);router['get']('/:id/preview',auth[_0x15cd('0x8')](),controller[_0x15cd('0xb')]);router[_0x15cd('0x7')](_0x15cd('0xc'),auth[_0x15cd('0x8')](),controller['run']);router['get'](_0x15cd('0xd'),auth['isAuthenticated'](),controller['query']);router['post']('/',auth[_0x15cd('0x8')](),controller['create']);router['put']('/:id',auth[_0x15cd('0x8')](),controller['update']);router['delete'](_0x15cd('0xa'),auth[_0x15cd('0x8')](),controller['destroy']);module[_0x15cd('0xe')]=router; \ No newline at end of file +var _0xcfe6=['preview','/:id/run','run','get','post','put','/:id','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','isAuthenticated','index','show','/:id/preview'];(function(_0x2dcc12,_0x1924e9){var _0xc0c5b5=function(_0x132559){while(--_0x132559){_0x2dcc12['push'](_0x2dcc12['shift']());}};_0xc0c5b5(++_0x1924e9);}(_0xcfe6,0x1d7));var _0x6cfe=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcfe6[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x6cfe('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6cfe('0x1'));var express=require(_0x6cfe('0x2'));var router=express[_0x6cfe('0x3')]();var auth=require(_0x6cfe('0x4'));var interaction=require(_0x6cfe('0x5'));var config=require(_0x6cfe('0x6'));var controller=require(_0x6cfe('0x7'));router['get']('/',auth[_0x6cfe('0x8')](),controller[_0x6cfe('0x9')]);router['get']('/:id',auth[_0x6cfe('0x8')](),controller[_0x6cfe('0xa')]);router['get'](_0x6cfe('0xb'),auth[_0x6cfe('0x8')](),controller[_0x6cfe('0xc')]);router['get'](_0x6cfe('0xd'),auth[_0x6cfe('0x8')](),controller[_0x6cfe('0xe')]);router[_0x6cfe('0xf')]('/:id/query',auth['isAuthenticated'](),controller['query']);router[_0x6cfe('0x10')]('/',auth[_0x6cfe('0x8')](),controller['create']);router[_0x6cfe('0x11')](_0x6cfe('0x12'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x6cfe('0x12'),auth[_0x6cfe('0x8')](),controller[_0x6cfe('0x13')]);module[_0x6cfe('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 0ae3d84..d1f2eae 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 _0x8ab8=['INTEGER','UNSIGNED','moment','exports','STRING','ENUM','csv','pdf','xlsx','DATE','Loading','manual','scheduled'];(function(_0x15cf93,_0x5b1029){var _0x2afb0a=function(_0x5413ed){while(--_0x5413ed){_0x15cf93['push'](_0x15cf93['shift']());}};_0x2afb0a(++_0x5b1029);}(_0x8ab8,0x17b));var _0x88ab=function(_0x349109,_0x58f5ce){_0x349109=_0x349109-0x0;var _0x3db8d6=_0x8ab8[_0x349109];return _0x3db8d6;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x88ab('0x0'));module[_0x88ab('0x1')]={'name':{'type':Sequelize[_0x88ab('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x88ab('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x88ab('0x3')](_0x88ab('0x4'),_0x88ab('0x5'),_0x88ab('0x6')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x88ab('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x88ab('0x7')]},'endDate':{'type':Sequelize[_0x88ab('0x7')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0x88ab('0x8')},'type':{'type':Sequelize[_0x88ab('0x3')](_0x88ab('0x9'),_0x88ab('0xa')),'allowNull':![],'defaultValue':_0x88ab('0x9')},'reportId':{'type':Sequelize[_0x88ab('0xb')](0xb)[_0x88ab('0xc')]},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6258=['xlsx','DATE','Loading','manual','INTEGER','UNSIGNED','sequelize','exports','STRING','ENUM','csv','pdf'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x6258,0xde));var _0x8625=function(_0x35ace6,_0x56bde1){_0x35ace6=_0x35ace6-0x0;var _0x494243=_0x6258[_0x35ace6];return _0x494243;};'use strict';var Sequelize=require(_0x8625('0x0'));var moment=require('moment');module[_0x8625('0x1')]={'name':{'type':Sequelize[_0x8625('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x8625('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x8625('0x3')](_0x8625('0x4'),_0x8625('0x5'),_0x8625('0x6')),'allowNull':![],'defaultValue':_0x8625('0x4')},'savename':{'type':Sequelize[_0x8625('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x8625('0x7')]},'endDate':{'type':Sequelize[_0x8625('0x7')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0x8625('0x8')},'type':{'type':Sequelize[_0x8625('0x3')](_0x8625('0x9'),'scheduled'),'allowNull':![],'defaultValue':_0x8625('0x9')},'reportId':{'type':Sequelize[_0x8625('0xa')](0xb)[_0x8625('0xb')]},'reportType':{'type':Sequelize[_0x8625('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 4e81045..d7781df 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 _0xdf88=['sort','where','pick','filter','merge','VIRTUAL','field','options','includeAll','include','findAll','rows','find','catch','create','body','user','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','destroy','download','basename','output','existsSync','join','root','server/files/reports','savename','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','sendStatus','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','set','Content-Range','reject','save','update','then','get','ExtractedReports','UserProfileResource','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','limit'];(function(_0x257558,_0x41dd88){var _0x3c3f80=function(_0x32ae45){while(--_0x32ae45){_0x257558['push'](_0x257558['shift']());}};_0x3c3f80(++_0x41dd88);}(_0xdf88,0x1a5));var _0x8df8=function(_0x58a982,_0x4a592a){_0x58a982=_0x58a982-0x0;var _0x1490ed=_0xdf88[_0x58a982];return _0x1490ed;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8df8('0x0'));var rimraf=require(_0x8df8('0x1'));var zipdir=require(_0x8df8('0x2'));var jsonpatch=require(_0x8df8('0x3'));var rp=require('request-promise');var moment=require(_0x8df8('0x4'));var BPromise=require(_0x8df8('0x5'));var Mustache=require(_0x8df8('0x6'));var util=require(_0x8df8('0x7'));var path=require(_0x8df8('0x8'));var sox=require(_0x8df8('0x9'));var csv=require(_0x8df8('0xa'));var ejs=require(_0x8df8('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x8df8('0xc'));var crypto=require(_0x8df8('0xd'));var jsforce=require(_0x8df8('0xe'));var deskjs=require(_0x8df8('0xf'));var toCsv=require('to-csv');var querystring=require(_0x8df8('0x10'));var Papa=require(_0x8df8('0x11'));var Redis=require('ioredis');var authService=require(_0x8df8('0x12'));var qs=require(_0x8df8('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8df8('0x14'));var logger=require(_0x8df8('0x15'))(_0x8df8('0x16'));var utils=require(_0x8df8('0x17'));var config=require(_0x8df8('0x18'));var db=require(_0x8df8('0x19'))['db'];function respondWithStatusCode(_0x5bb9a2,_0x584159){_0x584159=_0x584159||0xcc;return function(_0x5c8d90){if(_0x5c8d90){return _0x5bb9a2['sendStatus'](_0x584159);}return _0x5bb9a2[_0x8df8('0x1a')](_0x584159)[_0x8df8('0x1b')]();};}function respondWithResult(_0x68f4ec,_0x22ebc3){_0x22ebc3=_0x22ebc3||0xc8;return function(_0x324233){if(_0x324233){return _0x68f4ec['status'](_0x22ebc3)[_0x8df8('0x1c')](_0x324233);}};}function respondWithFilteredResult(_0x4b85bd,_0x36096e){return function(_0x86903e){if(_0x86903e){var _0x174afc=_0x86903e[_0x8df8('0x1d')],_0x4aacdf=_0x36096e[_0x8df8('0x1e')],_0x30c91d=_0x36096e[_0x8df8('0x1e')]+_0x36096e['limit'],_0x2adacd;if(_0x30c91d>=_0x174afc){_0x30c91d=_0x174afc;_0x2adacd=0xc8;}else{_0x2adacd=0xce;}_0x4b85bd[_0x8df8('0x1a')](_0x2adacd);return _0x4b85bd[_0x8df8('0x1f')](_0x8df8('0x20'),_0x4aacdf+'-'+_0x30c91d+'/'+_0x174afc)[_0x8df8('0x1c')](_0x86903e);}return null;};}function patchUpdates(_0x575599){return function(_0x3bdaec){try{jsonpatch['apply'](_0x3bdaec,_0x575599,!![]);}catch(_0xecaa71){return BPromise[_0x8df8('0x21')](_0xecaa71);}return _0x3bdaec[_0x8df8('0x22')]();};}function saveUpdates(_0x536d27,_0x1d5428){return function(_0x48d38e){if(_0x48d38e){return _0x48d38e[_0x8df8('0x23')](_0x536d27)[_0x8df8('0x24')](function(_0x36be5a){return _0x36be5a;});}return null;};}function removeEntity(_0x18936e,_0xd9fb49){return function(_0x3f6f75){if(_0x3f6f75){return _0x3f6f75['destroy']()[_0x8df8('0x24')](function(){var _0x4476bf=_0x3f6f75[_0x8df8('0x25')]({'plain':!![]});var _0xe86133=_0x8df8('0x26');return db[_0x8df8('0x27')]['destroy']({'where':{'type':_0xe86133,'resourceId':_0x4476bf['id']}})[_0x8df8('0x24')](function(){return _0x3f6f75;});})[_0x8df8('0x24')](function(){_0x18936e['status'](0xcc)[_0x8df8('0x1b')]();});}};}function handleEntityNotFound(_0x570705,_0x4b9571){return function(_0x465d1d){if(!_0x465d1d){_0x570705['sendStatus'](0x194);}return _0x465d1d;};}function handleError(_0x5d5e67,_0x21ba9f){_0x21ba9f=_0x21ba9f||0x1f4;return function(_0x2b4d6a){logger['error'](_0x2b4d6a[_0x8df8('0x28')]);if(_0x2b4d6a[_0x8df8('0x29')]){delete _0x2b4d6a[_0x8df8('0x29')];}_0x5d5e67[_0x8df8('0x1a')](_0x21ba9f)[_0x8df8('0x2a')](_0x2b4d6a);};}exports[_0x8df8('0x2b')]=function(_0xfed06b,_0x349a6f){var _0x459657={},_0x4b8253={},_0x1aa888={'count':0x0,'rows':[]};var _0x169f10=_[_0x8df8('0x2c')](db[_0x8df8('0x2d')][_0x8df8('0x2e')],function(_0x561152){return{'name':_0x561152[_0x8df8('0x2f')],'type':_0x561152[_0x8df8('0x30')][_0x8df8('0x31')]};});_0x4b8253[_0x8df8('0x32')]=_[_0x8df8('0x2c')](_0x169f10,'name');_0x4b8253[_0x8df8('0x33')]=_[_0x8df8('0x34')](_0xfed06b[_0x8df8('0x33')]);_0x4b8253[_0x8df8('0x35')]=_['intersection'](_0x4b8253['model'],_0x4b8253['query']);_0x459657[_0x8df8('0x36')]=_[_0x8df8('0x37')](_0x4b8253[_0x8df8('0x32')],qs['fields'](_0xfed06b[_0x8df8('0x33')][_0x8df8('0x38')]));_0x459657[_0x8df8('0x36')]=_0x459657[_0x8df8('0x36')][_0x8df8('0x39')]?_0x459657[_0x8df8('0x36')]:_0x4b8253[_0x8df8('0x32')];if(!_0xfed06b['query']['hasOwnProperty']('nolimit')){_0x459657['limit']=qs['limit'](_0xfed06b['query'][_0x8df8('0x3a')]);_0x459657[_0x8df8('0x1e')]=qs[_0x8df8('0x1e')](_0xfed06b['query'][_0x8df8('0x1e')]);}_0x459657['order']=qs[_0x8df8('0x3b')](_0xfed06b[_0x8df8('0x33')]['sort']);_0x459657[_0x8df8('0x3c')]=qs[_0x8df8('0x35')](_[_0x8df8('0x3d')](_0xfed06b[_0x8df8('0x33')],_0x4b8253[_0x8df8('0x35')]));if(_0xfed06b['query'][_0x8df8('0x3e')]){_0x459657[_0x8df8('0x3c')]=_[_0x8df8('0x3f')](_0x459657[_0x8df8('0x3c')],{'$or':_['map'](_0x169f10,function(_0x2ccfcf){if(_0x2ccfcf[_0x8df8('0x30')][_0x8df8('0x31')]!==_0x8df8('0x40')){var _0x46e276={};_0x46e276[_0x2ccfcf[_0x8df8('0x41')]]={'$like':'%'+_0xfed06b[_0x8df8('0x33')][_0x8df8('0x3e')]+'%'};return _0x46e276;}})});}_0x459657=_['merge']({},_0x459657,_0xfed06b[_0x8df8('0x42')]);var _0x49fbc2={'where':_0x459657[_0x8df8('0x3c')]};return db[_0x8df8('0x2d')][_0x8df8('0x1d')](_0x49fbc2)[_0x8df8('0x24')](function(_0x3ef6ec){_0x1aa888[_0x8df8('0x1d')]=_0x3ef6ec;if(_0xfed06b[_0x8df8('0x33')][_0x8df8('0x43')]){_0x459657[_0x8df8('0x44')]=[{'all':!![]}];}return db[_0x8df8('0x2d')][_0x8df8('0x45')](_0x459657);})[_0x8df8('0x24')](function(_0x322cd3){_0x1aa888[_0x8df8('0x46')]=_0x322cd3;return _0x1aa888;})['then'](respondWithFilteredResult(_0x349a6f,_0x459657))['catch'](handleError(_0x349a6f,null));};exports['show']=function(_0x2dd559,_0x3a495e){var _0xd25209={'raw':!![],'where':{'id':_0x2dd559['params']['id']}},_0x5b9d1b={};_0x5b9d1b['model']=_[_0x8df8('0x34')](db['AnalyticExtractedReport']['rawAttributes']);_0x5b9d1b[_0x8df8('0x33')]=_[_0x8df8('0x34')](_0x2dd559[_0x8df8('0x33')]);_0x5b9d1b['filters']=_['intersection'](_0x5b9d1b[_0x8df8('0x32')],_0x5b9d1b[_0x8df8('0x33')]);_0xd25209['attributes']=_['intersection'](_0x5b9d1b[_0x8df8('0x32')],qs[_0x8df8('0x38')](_0x2dd559[_0x8df8('0x33')]['fields']));_0xd25209[_0x8df8('0x36')]=_0xd25209[_0x8df8('0x36')][_0x8df8('0x39')]?_0xd25209['attributes']:_0x5b9d1b[_0x8df8('0x32')];if(_0x2dd559['query'][_0x8df8('0x43')]){_0xd25209[_0x8df8('0x44')]=[{'all':!![]}];}_0xd25209=_['merge']({},_0xd25209,_0x2dd559[_0x8df8('0x42')]);return db[_0x8df8('0x2d')][_0x8df8('0x47')](_0xd25209)[_0x8df8('0x24')](handleEntityNotFound(_0x3a495e,null))[_0x8df8('0x24')](respondWithResult(_0x3a495e,null))[_0x8df8('0x48')](handleError(_0x3a495e,null));};exports[_0x8df8('0x49')]=function(_0xe9599,_0xb854da){return db['AnalyticExtractedReport'][_0x8df8('0x49')](_0xe9599[_0x8df8('0x4a')],{})[_0x8df8('0x24')](function(_0x124ad4){var _0x5cc525=_0xe9599[_0x8df8('0x4b')][_0x8df8('0x25')]({'plain':!![]});if(!_0x5cc525)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5cc525['role']===_0x8df8('0x4b')){var _0x3de338=_0x124ad4[_0x8df8('0x25')]({'plain':!![]});var _0x12457d=_0x8df8('0x26');return db['UserProfileSection']['find']({'where':{'name':_0x12457d,'userProfileId':_0x5cc525[_0x8df8('0x4c')]},'raw':!![]})[_0x8df8('0x24')](function(_0x5617c3){if(_0x5617c3&&_0x5617c3['autoAssociation']===0x0){return db[_0x8df8('0x27')][_0x8df8('0x49')]({'name':_0x3de338['name'],'resourceId':_0x3de338['id'],'type':_0x5617c3['name'],'sectionId':_0x5617c3['id']},{})['then'](function(){return _0x124ad4;});}else{return _0x124ad4;}})[_0x8df8('0x48')](function(_0x2cde33){logger[_0x8df8('0x4d')](_0x8df8('0x4e'),_0x2cde33);throw _0x2cde33;});}return _0x124ad4;})[_0x8df8('0x24')](respondWithResult(_0xb854da,0xc9))['catch'](handleError(_0xb854da,null));};exports[_0x8df8('0x23')]=function(_0x2c285e,_0x4341b7){if(_0x2c285e[_0x8df8('0x4a')]['id']){delete _0x2c285e[_0x8df8('0x4a')]['id'];}return db[_0x8df8('0x2d')]['find']({'where':{'id':_0x2c285e[_0x8df8('0x4f')]['id']}})[_0x8df8('0x24')](handleEntityNotFound(_0x4341b7,null))[_0x8df8('0x24')](saveUpdates(_0x2c285e[_0x8df8('0x4a')],null))['then'](respondWithResult(_0x4341b7,null))[_0x8df8('0x48')](handleError(_0x4341b7,null));};exports[_0x8df8('0x50')]=function(_0x2eee56,_0x46cc2f){return db['AnalyticExtractedReport'][_0x8df8('0x47')]({'where':{'id':_0x2eee56['params']['id']}})[_0x8df8('0x24')](handleEntityNotFound(_0x46cc2f,null))[_0x8df8('0x24')](removeEntity(_0x46cc2f,null))[_0x8df8('0x48')](handleError(_0x46cc2f,null));};exports[_0x8df8('0x51')]=function(_0x16b891,_0xb7d3b6,_0x2073e5){return db[_0x8df8('0x2d')][_0x8df8('0x47')]({'where':{'id':_0x16b891[_0x8df8('0x4f')]['id']},'attributes':[_0x8df8('0x29'),_0x8df8('0x52'),'savename',_0x8df8('0x53')],'raw':!![]})[_0x8df8('0x24')](handleEntityNotFound(_0xb7d3b6,null))['then'](function(_0x553638){if(_0x553638){if(!fs[_0x8df8('0x54')](path[_0x8df8('0x55')](config[_0x8df8('0x56')],_0x8df8('0x57'),_0x553638[_0x8df8('0x58')]))){throw new db['Sequelize'][(_0x8df8('0x59'))](_0x8df8('0x5a'));}if(_0x16b891['query'][_0x8df8('0x5b')]){return _0xb7d3b6[_0x8df8('0x5c')](0xc8);}return _0xb7d3b6[_0x8df8('0x51')](path[_0x8df8('0x55')](config['root'],'server/files/reports',_0x553638[_0x8df8('0x58')]),util[_0x8df8('0x5d')](_0x8df8('0x5e'),_0x553638['basename']||_0x553638[_0x8df8('0x29')],_0x553638[_0x8df8('0x53')][_0x8df8('0x5f')]()));}})[_0x8df8('0x48')](handleError(_0xb7d3b6,null));}; \ No newline at end of file +var _0x2626=['output','existsSync','join','root','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','server/files/reports','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','ExtractedReports','UserProfileResource','then','error','stack','name','send','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','params','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','download','basename','savename'];(function(_0x276d71,_0x2be8f9){var _0x35cc4a=function(_0xc045b1){while(--_0xc045b1){_0x276d71['push'](_0x276d71['shift']());}};_0x35cc4a(++_0x2be8f9);}(_0x2626,0x6e));var _0x6262=function(_0xf0b2e1,_0x4a0cc7){_0xf0b2e1=_0xf0b2e1-0x0;var _0xb53a20=_0x2626[_0xf0b2e1];return _0xb53a20;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6262('0x0'));var rimraf=require(_0x6262('0x1'));var zipdir=require(_0x6262('0x2'));var jsonpatch=require(_0x6262('0x3'));var rp=require(_0x6262('0x4'));var moment=require(_0x6262('0x5'));var BPromise=require(_0x6262('0x6'));var Mustache=require(_0x6262('0x7'));var util=require(_0x6262('0x8'));var path=require(_0x6262('0x9'));var sox=require(_0x6262('0xa'));var csv=require(_0x6262('0xb'));var ejs=require(_0x6262('0xc'));var fs=require('fs');var _=require(_0x6262('0xd'));var squel=require(_0x6262('0xe'));var crypto=require(_0x6262('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x6262('0x10'));var toCsv=require(_0x6262('0xb'));var querystring=require(_0x6262('0x11'));var Papa=require(_0x6262('0x12'));var Redis=require(_0x6262('0x13'));var authService=require(_0x6262('0x14'));var qs=require(_0x6262('0x15'));var as=require(_0x6262('0x16'));var hardwareService=require(_0x6262('0x17'));var logger=require(_0x6262('0x18'))(_0x6262('0x19'));var utils=require(_0x6262('0x1a'));var config=require(_0x6262('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5d45e8,_0x434955){_0x434955=_0x434955||0xcc;return function(_0x9d01ce){if(_0x9d01ce){return _0x5d45e8['sendStatus'](_0x434955);}return _0x5d45e8[_0x6262('0x1c')](_0x434955)['end']();};}function respondWithResult(_0x31139d,_0x3b0224){_0x3b0224=_0x3b0224||0xc8;return function(_0x10197d){if(_0x10197d){return _0x31139d['status'](_0x3b0224)['json'](_0x10197d);}};}function respondWithFilteredResult(_0x2dcf56,_0x53ba2a){return function(_0x4f90be){if(_0x4f90be){var _0x2256f4=_0x4f90be[_0x6262('0x1d')],_0x3faf56=_0x53ba2a['offset'],_0x30b90e=_0x53ba2a[_0x6262('0x1e')]+_0x53ba2a[_0x6262('0x1f')],_0x374282;if(_0x30b90e>=_0x2256f4){_0x30b90e=_0x2256f4;_0x374282=0xc8;}else{_0x374282=0xce;}_0x2dcf56['status'](_0x374282);return _0x2dcf56[_0x6262('0x20')](_0x6262('0x21'),_0x3faf56+'-'+_0x30b90e+'/'+_0x2256f4)['json'](_0x4f90be);}return null;};}function patchUpdates(_0x3b4e45){return function(_0x2d84e1){try{jsonpatch[_0x6262('0x22')](_0x2d84e1,_0x3b4e45,!![]);}catch(_0x567f94){return BPromise[_0x6262('0x23')](_0x567f94);}return _0x2d84e1[_0x6262('0x24')]();};}function saveUpdates(_0x1af0d0,_0x15ce5a){return function(_0x29fa92){if(_0x29fa92){return _0x29fa92[_0x6262('0x25')](_0x1af0d0)['then'](function(_0x213fc4){return _0x213fc4;});}return null;};}function removeEntity(_0xdf9de,_0x516579){return function(_0x451296){if(_0x451296){return _0x451296[_0x6262('0x26')]()['then'](function(){var _0x207856=_0x451296['get']({'plain':!![]});var _0x486068=_0x6262('0x27');return db[_0x6262('0x28')][_0x6262('0x26')]({'where':{'type':_0x486068,'resourceId':_0x207856['id']}})[_0x6262('0x29')](function(){return _0x451296;});})[_0x6262('0x29')](function(){_0xdf9de[_0x6262('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d04f9,_0x3cdfe5){return function(_0x3e1e75){if(!_0x3e1e75){_0x1d04f9['sendStatus'](0x194);}return _0x3e1e75;};}function handleError(_0x2d468e,_0x151714){_0x151714=_0x151714||0x1f4;return function(_0x5ccf1b){logger[_0x6262('0x2a')](_0x5ccf1b[_0x6262('0x2b')]);if(_0x5ccf1b[_0x6262('0x2c')]){delete _0x5ccf1b['name'];}_0x2d468e['status'](_0x151714)[_0x6262('0x2d')](_0x5ccf1b);};}exports['index']=function(_0x41e3e5,_0x14b50a){var _0x3aefb0={},_0xeb6186={},_0x21c675={'count':0x0,'rows':[]};var _0x21487f=_[_0x6262('0x2e')](db[_0x6262('0x2f')][_0x6262('0x30')],function(_0x49bad8){return{'name':_0x49bad8[_0x6262('0x31')],'type':_0x49bad8[_0x6262('0x32')][_0x6262('0x33')]};});_0xeb6186[_0x6262('0x34')]=_[_0x6262('0x2e')](_0x21487f,_0x6262('0x2c'));_0xeb6186[_0x6262('0x35')]=_[_0x6262('0x36')](_0x41e3e5[_0x6262('0x35')]);_0xeb6186[_0x6262('0x37')]=_[_0x6262('0x38')](_0xeb6186[_0x6262('0x34')],_0xeb6186[_0x6262('0x35')]);_0x3aefb0[_0x6262('0x39')]=_[_0x6262('0x38')](_0xeb6186[_0x6262('0x34')],qs[_0x6262('0x3a')](_0x41e3e5[_0x6262('0x35')][_0x6262('0x3a')]));_0x3aefb0[_0x6262('0x39')]=_0x3aefb0[_0x6262('0x39')][_0x6262('0x3b')]?_0x3aefb0[_0x6262('0x39')]:_0xeb6186['model'];if(!_0x41e3e5[_0x6262('0x35')]['hasOwnProperty'](_0x6262('0x3c'))){_0x3aefb0['limit']=qs[_0x6262('0x1f')](_0x41e3e5[_0x6262('0x35')][_0x6262('0x1f')]);_0x3aefb0[_0x6262('0x1e')]=qs[_0x6262('0x1e')](_0x41e3e5['query'][_0x6262('0x1e')]);}_0x3aefb0[_0x6262('0x3d')]=qs[_0x6262('0x3e')](_0x41e3e5[_0x6262('0x35')]['sort']);_0x3aefb0[_0x6262('0x3f')]=qs[_0x6262('0x37')](_['pick'](_0x41e3e5[_0x6262('0x35')],_0xeb6186[_0x6262('0x37')]));if(_0x41e3e5[_0x6262('0x35')]['filter']){_0x3aefb0[_0x6262('0x3f')]=_[_0x6262('0x40')](_0x3aefb0[_0x6262('0x3f')],{'$or':_[_0x6262('0x2e')](_0x21487f,function(_0x4da92f){if(_0x4da92f[_0x6262('0x32')][_0x6262('0x33')]!==_0x6262('0x41')){var _0x1e2e9a={};_0x1e2e9a[_0x4da92f['field']]={'$like':'%'+_0x41e3e5[_0x6262('0x35')][_0x6262('0x42')]+'%'};return _0x1e2e9a;}})});}_0x3aefb0=_[_0x6262('0x40')]({},_0x3aefb0,_0x41e3e5[_0x6262('0x43')]);var _0x1b073d={'where':_0x3aefb0[_0x6262('0x3f')]};return db[_0x6262('0x2f')][_0x6262('0x1d')](_0x1b073d)[_0x6262('0x29')](function(_0x3ad455){_0x21c675['count']=_0x3ad455;if(_0x41e3e5[_0x6262('0x35')][_0x6262('0x44')]){_0x3aefb0[_0x6262('0x45')]=[{'all':!![]}];}return db['AnalyticExtractedReport']['findAll'](_0x3aefb0);})[_0x6262('0x29')](function(_0x4b1937){_0x21c675[_0x6262('0x46')]=_0x4b1937;return _0x21c675;})[_0x6262('0x29')](respondWithFilteredResult(_0x14b50a,_0x3aefb0))[_0x6262('0x47')](handleError(_0x14b50a,null));};exports['show']=function(_0x272492,_0x5cead0){var _0x17d59c={'raw':!![],'where':{'id':_0x272492[_0x6262('0x48')]['id']}},_0x524631={};_0x524631['model']=_[_0x6262('0x36')](db[_0x6262('0x2f')][_0x6262('0x30')]);_0x524631[_0x6262('0x35')]=_[_0x6262('0x36')](_0x272492[_0x6262('0x35')]);_0x524631[_0x6262('0x37')]=_[_0x6262('0x38')](_0x524631[_0x6262('0x34')],_0x524631['query']);_0x17d59c[_0x6262('0x39')]=_[_0x6262('0x38')](_0x524631[_0x6262('0x34')],qs[_0x6262('0x3a')](_0x272492[_0x6262('0x35')][_0x6262('0x3a')]));_0x17d59c[_0x6262('0x39')]=_0x17d59c[_0x6262('0x39')][_0x6262('0x3b')]?_0x17d59c[_0x6262('0x39')]:_0x524631[_0x6262('0x34')];if(_0x272492[_0x6262('0x35')][_0x6262('0x44')]){_0x17d59c[_0x6262('0x45')]=[{'all':!![]}];}_0x17d59c=_[_0x6262('0x40')]({},_0x17d59c,_0x272492[_0x6262('0x43')]);return db[_0x6262('0x2f')]['find'](_0x17d59c)[_0x6262('0x29')](handleEntityNotFound(_0x5cead0,null))[_0x6262('0x29')](respondWithResult(_0x5cead0,null))[_0x6262('0x47')](handleError(_0x5cead0,null));};exports[_0x6262('0x49')]=function(_0x590b6c,_0x2d0d11){return db[_0x6262('0x2f')][_0x6262('0x49')](_0x590b6c['body'],{})[_0x6262('0x29')](function(_0x2d4e9e){var _0x21861f=_0x590b6c['user'][_0x6262('0x4a')]({'plain':!![]});if(!_0x21861f)throw new Error(_0x6262('0x4b'));if(_0x21861f[_0x6262('0x4c')]==='user'){var _0x5b2c97=_0x2d4e9e[_0x6262('0x4a')]({'plain':!![]});var _0x2467f5='ExtractedReports';return db[_0x6262('0x4d')][_0x6262('0x4e')]({'where':{'name':_0x2467f5,'userProfileId':_0x21861f[_0x6262('0x4f')]},'raw':!![]})[_0x6262('0x29')](function(_0x4cb52c){if(_0x4cb52c&&_0x4cb52c[_0x6262('0x50')]===0x0){return db[_0x6262('0x28')][_0x6262('0x49')]({'name':_0x5b2c97['name'],'resourceId':_0x5b2c97['id'],'type':_0x4cb52c[_0x6262('0x2c')],'sectionId':_0x4cb52c['id']},{})[_0x6262('0x29')](function(){return _0x2d4e9e;});}else{return _0x2d4e9e;}})[_0x6262('0x47')](function(_0x8f87c7){logger[_0x6262('0x2a')](_0x6262('0x51'),_0x8f87c7);throw _0x8f87c7;});}return _0x2d4e9e;})[_0x6262('0x29')](respondWithResult(_0x2d0d11,0xc9))[_0x6262('0x47')](handleError(_0x2d0d11,null));};exports[_0x6262('0x25')]=function(_0x179e43,_0x5203eb){if(_0x179e43[_0x6262('0x52')]['id']){delete _0x179e43['body']['id'];}return db[_0x6262('0x2f')][_0x6262('0x4e')]({'where':{'id':_0x179e43[_0x6262('0x48')]['id']}})[_0x6262('0x29')](handleEntityNotFound(_0x5203eb,null))[_0x6262('0x29')](saveUpdates(_0x179e43[_0x6262('0x52')],null))[_0x6262('0x29')](respondWithResult(_0x5203eb,null))['catch'](handleError(_0x5203eb,null));};exports[_0x6262('0x26')]=function(_0x2d27a1,_0x5f49fb){return db['AnalyticExtractedReport'][_0x6262('0x4e')]({'where':{'id':_0x2d27a1[_0x6262('0x48')]['id']}})[_0x6262('0x29')](handleEntityNotFound(_0x5f49fb,null))[_0x6262('0x29')](removeEntity(_0x5f49fb,null))[_0x6262('0x47')](handleError(_0x5f49fb,null));};exports[_0x6262('0x53')]=function(_0x3ccdb5,_0x4c12d7,_0x38bbeb){return db['AnalyticExtractedReport'][_0x6262('0x4e')]({'where':{'id':_0x3ccdb5[_0x6262('0x48')]['id']},'attributes':['name',_0x6262('0x54'),_0x6262('0x55'),_0x6262('0x56')],'raw':!![]})[_0x6262('0x29')](handleEntityNotFound(_0x4c12d7,null))[_0x6262('0x29')](function(_0x1ea0c1){if(_0x1ea0c1){if(!fs[_0x6262('0x57')](path[_0x6262('0x58')](config[_0x6262('0x59')],'server/files/reports',_0x1ea0c1[_0x6262('0x55')]))){throw new db[(_0x6262('0x5a'))][(_0x6262('0x5b'))](_0x6262('0x5c'));}if(_0x3ccdb5[_0x6262('0x35')][_0x6262('0x5d')]){return _0x4c12d7['sendStatus'](0xc8);}return _0x4c12d7[_0x6262('0x53')](path['join'](config[_0x6262('0x59')],_0x6262('0x5e'),_0x1ea0c1['savename']),util[_0x6262('0x5f')](_0x6262('0x60'),_0x1ea0c1[_0x6262('0x54')]||_0x1ea0c1['name'],_0x1ea0c1[_0x6262('0x56')][_0x6262('0x61')]()));}})[_0x6262('0x47')](handleError(_0x4c12d7,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index bf4a247..9a15ebe 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 _0xf226=['../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','lodash','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x3e3bbd,_0x37fb71){var _0x5db74b=function(_0x2bccbc){while(--_0x2bccbc){_0x3e3bbd['push'](_0x3e3bbd['shift']());}};_0x5db74b(++_0x37fb71);}(_0xf226,0xa1));var _0x6f22=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf226[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6f22('0x0'));var util=require('util');var logger=require(_0x6f22('0x1'))(_0x6f22('0x2'));var moment=require(_0x6f22('0x3'));var BPromise=require(_0x6f22('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6f22('0x5'));var rimraf=require(_0x6f22('0x6'));var config=require(_0x6f22('0x7'));var attributes=require(_0x6f22('0x8'));module[_0x6f22('0x9')]=function(_0x217e77,_0x351ddb){return _0x217e77[_0x6f22('0xa')](_0x6f22('0xb'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xad9b=['exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','bluebird','path','../../config/environment','./analyticExtractedReport.attributes'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0xad9b,0x16f));var _0xbad9=function(_0xaf3d79,_0x13fb23){_0xaf3d79=_0xaf3d79-0x0;var _0x40e0b7=_0xad9b[_0xaf3d79];return _0x40e0b7;};'use strict';var _=require(_0xbad9('0x0'));var util=require(_0xbad9('0x1'));var logger=require(_0xbad9('0x2'))('api');var moment=require('moment');var BPromise=require(_0xbad9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbad9('0x4'));var rimraf=require('rimraf');var config=require(_0xbad9('0x5'));var attributes=require(_0xbad9('0x6'));module[_0xbad9('0x7')]=function(_0x918e0a,_0x3bdbf1){return _0x918e0a[_0xbad9('0x8')](_0xbad9('0x9'),attributes,{'tableName':_0xbad9('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 5688849..b9cafc4 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 _0x5acc=['../../config/utils','rpc','../../config/environment','http','request\x20sent','stringify','error','code','AnalyticExtractedReport,\x20%s,\x20%s','message','catch','util','moment','bluebird','../../mysqldb'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x5acc,0x155));var _0xc5ac=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x5acc[_0x2b4411];return _0x8e41ef;};'use strict';var _=require('lodash');var util=require(_0xc5ac('0x0'));var moment=require(_0xc5ac('0x1'));var BPromise=require(_0xc5ac('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc5ac('0x3'))['db'];var utils=require(_0xc5ac('0x4'));var logger=require('../../config/logger')(_0xc5ac('0x5'));var config=require(_0xc5ac('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xc5ac('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xe4a4e3,_0x24e28e,_0x4e5bc3){return new BPromise(function(_0x1d8328,_0x37f6b5){return client['request'](_0xe4a4e3,_0x4e5bc3)['then'](function(_0x3ea85e){logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x24e28e,_0xc5ac('0x8'));logger['debug']('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x24e28e,_0xc5ac('0x8'),JSON[_0xc5ac('0x9')](_0x3ea85e));if(_0x3ea85e[_0xc5ac('0xa')]){if(_0x3ea85e[_0xc5ac('0xa')][_0xc5ac('0xb')]===0x1f4){logger[_0xc5ac('0xa')](_0xc5ac('0xc'),_0x24e28e,_0x3ea85e['error'][_0xc5ac('0xd')]);return _0x37f6b5(_0x3ea85e[_0xc5ac('0xa')][_0xc5ac('0xd')]);}logger[_0xc5ac('0xa')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x24e28e,_0x3ea85e[_0xc5ac('0xa')][_0xc5ac('0xd')]);return _0x1d8328(_0x3ea85e[_0xc5ac('0xa')]['message']);}else{logger['info'](_0xc5ac('0xc'),_0x24e28e,_0xc5ac('0x8'));_0x1d8328(_0x3ea85e['result'][_0xc5ac('0xd')]);}})[_0xc5ac('0xe')](function(_0x211248){logger[_0xc5ac('0xa')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x24e28e,_0x211248);_0x37f6b5(_0x211248);});});} \ No newline at end of file +var _0x2b07=['moment','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','message','result','lodash','util'];(function(_0x902c36,_0x1e694f){var _0x51c425=function(_0x2c9bb3){while(--_0x2c9bb3){_0x902c36['push'](_0x902c36['shift']());}};_0x51c425(++_0x1e694f);}(_0x2b07,0x1c6));var _0x72b0=function(_0x256684,_0x529c1e){_0x256684=_0x256684-0x0;var _0x37a0c9=_0x2b07[_0x256684];return _0x37a0c9;};'use strict';var _=require(_0x72b0('0x0'));var util=require(_0x72b0('0x1'));var moment=require(_0x72b0('0x2'));var BPromise=require('bluebird');var rs=require(_0x72b0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x72b0('0x4'))['db'];var utils=require(_0x72b0('0x5'));var logger=require('../../config/logger')(_0x72b0('0x6'));var config=require('../../config/environment');var jayson=require(_0x72b0('0x7'));var client=jayson['client'][_0x72b0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x53be78,_0x1837a2,_0x901317){return new BPromise(function(_0x354dc2,_0x593ccb){return client[_0x72b0('0x9')](_0x53be78,_0x901317)[_0x72b0('0xa')](function(_0x35d58b){logger[_0x72b0('0xb')](_0x72b0('0xc'),_0x1837a2,_0x72b0('0xd'));logger[_0x72b0('0xe')](_0x72b0('0xf'),_0x1837a2,_0x72b0('0xd'),JSON['stringify'](_0x35d58b));if(_0x35d58b['error']){if(_0x35d58b[_0x72b0('0x10')]['code']===0x1f4){logger[_0x72b0('0x10')](_0x72b0('0xc'),_0x1837a2,_0x35d58b[_0x72b0('0x10')][_0x72b0('0x11')]);return _0x593ccb(_0x35d58b[_0x72b0('0x10')][_0x72b0('0x11')]);}logger[_0x72b0('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1837a2,_0x35d58b['error'][_0x72b0('0x11')]);return _0x354dc2(_0x35d58b['error'][_0x72b0('0x11')]);}else{logger[_0x72b0('0xb')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1837a2,_0x72b0('0xd'));_0x354dc2(_0x35d58b[_0x72b0('0x12')][_0x72b0('0x11')]);}})['catch'](function(_0x3bcf2b){logger[_0x72b0('0x10')](_0x72b0('0xc'),_0x1837a2,_0x3bcf2b);_0x593ccb(_0x3bcf2b);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index b6c895a..4d573b7 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 _0x40b6=['post','create','put','/:id','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','show','download'];(function(_0x4f77ae,_0x26959a){var _0x32ec86=function(_0x43f189){while(--_0x43f189){_0x4f77ae['push'](_0x4f77ae['shift']());}};_0x32ec86(++_0x26959a);}(_0x40b6,0xf7));var _0x640b=function(_0x29e3ec,_0x138a18){_0x29e3ec=_0x29e3ec-0x0;var _0x25727e=_0x40b6[_0x29e3ec];return _0x25727e;};'use strict';var multer=require(_0x640b('0x0'));var util=require('util');var path=require(_0x640b('0x1'));var timeout=require(_0x640b('0x2'));var express=require(_0x640b('0x3'));var router=express[_0x640b('0x4')]();var auth=require(_0x640b('0x5'));var interaction=require(_0x640b('0x6'));var config=require(_0x640b('0x7'));var controller=require(_0x640b('0x8'));router[_0x640b('0x9')]('/',auth[_0x640b('0xa')](),controller['index']);router['get']('/:id',auth[_0x640b('0xa')](),controller[_0x640b('0xb')]);router[_0x640b('0x9')]('/:id/download',auth[_0x640b('0xa')](),controller[_0x640b('0xc')]);router[_0x640b('0xd')]('/',auth['isAuthenticated'](),controller[_0x640b('0xe')]);router[_0x640b('0xf')](_0x640b('0x10'),auth[_0x640b('0xa')](),controller['update']);router[_0x640b('0x11')](_0x640b('0x10'),auth[_0x640b('0xa')](),controller[_0x640b('0x12')]);module[_0x640b('0x13')]=router; \ No newline at end of file +var _0xfeff=['/:id/download','post','create','/:id','update','delete','destroy','exports','multer','util','path','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index'];(function(_0x2f227c,_0x360c3a){var _0x5032bc=function(_0x824bb){while(--_0x824bb){_0x2f227c['push'](_0x2f227c['shift']());}};_0x5032bc(++_0x360c3a);}(_0xfeff,0xe5));var _0xffef=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0xfeff[_0x4d613c];return _0x301fe3;};'use strict';var multer=require(_0xffef('0x0'));var util=require(_0xffef('0x1'));var path=require(_0xffef('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xffef('0x3'));var config=require(_0xffef('0x4'));var controller=require(_0xffef('0x5'));router[_0xffef('0x6')]('/',auth[_0xffef('0x7')](),controller[_0xffef('0x8')]);router[_0xffef('0x6')]('/:id',auth[_0xffef('0x7')](),controller['show']);router['get'](_0xffef('0x9'),auth[_0xffef('0x7')](),controller['download']);router[_0xffef('0xa')]('/',auth[_0xffef('0x7')](),controller[_0xffef('0xb')]);router['put'](_0xffef('0xc'),auth[_0xffef('0x7')](),controller[_0xffef('0xd')]);router[_0xffef('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xffef('0xf')]);module[_0xffef('0x10')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 93a3422..12545b1 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 _0xe14b=['sequelize','exports','STRING'];(function(_0x2803ed,_0x21805c){var _0x4bbc95=function(_0x19bdc1){while(--_0x19bdc1){_0x2803ed['push'](_0x2803ed['shift']());}};_0x4bbc95(++_0x21805c);}(_0xe14b,0x93));var _0xbe14=function(_0x5a8292,_0x5e50b0){_0x5a8292=_0x5a8292-0x0;var _0x519929=_0xe14b[_0x5a8292];return _0x519929;};'use strict';var Sequelize=require(_0xbe14('0x0'));module[_0xbe14('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0xbe14('0x2')]},'format':{'type':Sequelize[_0xbe14('0x2')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xbe14('0x2')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x814b=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0x1f7c09,_0xe3dc0d){var _0x5a3eee=function(_0x1c2309){while(--_0x1c2309){_0x1f7c09['push'](_0x1f7c09['shift']());}};_0x5a3eee(++_0xe3dc0d);}(_0x814b,0x1a2));var _0xb814=function(_0x55bd38,_0x48eacf){_0x55bd38=_0x55bd38-0x0;var _0x444323=_0x814b[_0x55bd38];return _0x444323;};'use strict';var Sequelize=require(_0xb814('0x0'));module[_0xb814('0x1')]={'field':{'type':Sequelize[_0xb814('0x2')]},'alias':{'type':Sequelize[_0xb814('0x3')]},'function':{'type':Sequelize[_0xb814('0x3')]},'format':{'type':Sequelize[_0xb814('0x3')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xb814('0x3')]},'custom':{'type':Sequelize[_0xb814('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 4add861..4587e0a 100644 --- a/server/api/analyticFieldReport/analyticFieldReport.controller.js +++ b/server/api/analyticFieldReport/analyticFieldReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','show','params','options','find','catch','create','body','bulkCreate','bulkDestroy','addFields','sequelize','transaction','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js'];(function(_0x2468f0,_0x58a7b2){var _0xa9cdf3=function(_0x60e77c){while(--_0x60e77c){_0x2468f0['push'](_0x2468f0['shift']());}};_0xa9cdf3(++_0x58a7b2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];function respondWithStatusCode(_0x36471c,_0xd5b662){_0xd5b662=_0xd5b662||0xcc;return function(_0x26d672){if(_0x26d672){return _0x36471c[_0x0a9e('0x14')](_0xd5b662);}return _0x36471c[_0x0a9e('0x15')](_0xd5b662)['end']();};}function respondWithResult(_0x4283ce,_0x239b12){_0x239b12=_0x239b12||0xc8;return function(_0x2b4227){if(_0x2b4227){return _0x4283ce[_0x0a9e('0x15')](_0x239b12)[_0x0a9e('0x16')](_0x2b4227);}};}function respondWithFilteredResult(_0x4d5611,_0x52a03d){return function(_0x22dccb){if(_0x22dccb){var _0x5d0880=_0x22dccb[_0x0a9e('0x17')],_0x1985b6=_0x52a03d['offset'],_0x519dfd=_0x52a03d[_0x0a9e('0x18')]+_0x52a03d['limit'],_0x16033c;if(_0x519dfd>=_0x5d0880){_0x519dfd=_0x5d0880;_0x16033c=0xc8;}else{_0x16033c=0xce;}_0x4d5611[_0x0a9e('0x15')](_0x16033c);return _0x4d5611[_0x0a9e('0x19')](_0x0a9e('0x1a'),_0x1985b6+'-'+_0x519dfd+'/'+_0x5d0880)[_0x0a9e('0x16')](_0x22dccb);}return null;};}function patchUpdates(_0x31b1ca){return function(_0x2eb11f){try{jsonpatch[_0x0a9e('0x1b')](_0x2eb11f,_0x31b1ca,!![]);}catch(_0x20559e){return BPromise[_0x0a9e('0x1c')](_0x20559e);}return _0x2eb11f[_0x0a9e('0x1d')]();};}function saveUpdates(_0x1c696a,_0x105080){return function(_0x4bb1e3){if(_0x4bb1e3){return _0x4bb1e3[_0x0a9e('0x1e')](_0x1c696a)[_0x0a9e('0x1f')](function(_0x53682f){return _0x53682f;});}return null;};}function removeEntity(_0x20f109,_0x5a09ef){return function(_0x588269){if(_0x588269){return _0x588269[_0x0a9e('0x20')]()[_0x0a9e('0x1f')](function(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x21')]();});}};}function handleEntityNotFound(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(!_0x2fb0e4){_0x4abc77[_0x0a9e('0x14')](0x194);}return _0x2fb0e4;};}function handleError(_0x4d00e6,_0x370d86){_0x370d86=_0x370d86||0x1f4;return function(_0x42ac8f){logger[_0x0a9e('0x22')](_0x42ac8f['stack']);if(_0x42ac8f['name']){delete _0x42ac8f[_0x0a9e('0x23')];}_0x4d00e6[_0x0a9e('0x15')](_0x370d86)[_0x0a9e('0x24')](_0x42ac8f);};}exports[_0x0a9e('0x25')]=function(_0x526cf3,_0x384319){var _0x479bc4={},_0x45a1e7={},_0x5bfb33={'count':0x0,'rows':[]};var _0x1dc186=_[_0x0a9e('0x26')](db[_0x0a9e('0x27')][_0x0a9e('0x28')],function(_0x140511){return{'name':_0x140511[_0x0a9e('0x29')],'type':_0x140511[_0x0a9e('0x2a')][_0x0a9e('0x2b')]};});_0x45a1e7['model']=_[_0x0a9e('0x26')](_0x1dc186,_0x0a9e('0x23'));_0x45a1e7[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x526cf3['query']);_0x45a1e7[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],_0x45a1e7[_0x0a9e('0x2c')]);_0x479bc4[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],qs[_0x0a9e('0x32')](_0x526cf3[_0x0a9e('0x2c')]['fields']));_0x479bc4[_0x0a9e('0x31')]=_0x479bc4['attributes'][_0x0a9e('0x33')]?_0x479bc4[_0x0a9e('0x31')]:_0x45a1e7[_0x0a9e('0x30')];if(!_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x34')]('nolimit')){_0x479bc4[_0x0a9e('0x35')]=qs[_0x0a9e('0x35')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x35')]);_0x479bc4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x18')]);}_0x479bc4['order']=qs[_0x0a9e('0x36')](_0x526cf3['query'][_0x0a9e('0x36')]);_0x479bc4[_0x0a9e('0x37')]=qs[_0x0a9e('0x2e')](_[_0x0a9e('0x38')](_0x526cf3['query'],_0x45a1e7[_0x0a9e('0x2e')]));if(_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x39')]){_0x479bc4[_0x0a9e('0x37')]=_['merge'](_0x479bc4['where'],{'$or':_[_0x0a9e('0x26')](_0x1dc186,function(_0x5640eb){if(_0x5640eb[_0x0a9e('0x2a')][_0x0a9e('0x2b')]!==_0x0a9e('0x3a')){var _0x1ef87a={};_0x1ef87a[_0x5640eb['field']]={'$like':'%'+_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x39')]+'%'};return _0x1ef87a;}})});}_0x479bc4=_[_0x0a9e('0x3b')]({},_0x479bc4,_0x526cf3['options']);var _0x1dbf74={'where':_0x479bc4[_0x0a9e('0x37')]};return db[_0x0a9e('0x27')]['count'](_0x1dbf74)['then'](function(_0x11b61d){_0x5bfb33[_0x0a9e('0x17')]=_0x11b61d;if(_0x526cf3['query'][_0x0a9e('0x3c')]){_0x479bc4[_0x0a9e('0x3d')]=[{'all':!![]}];}return db[_0x0a9e('0x27')][_0x0a9e('0x3e')](_0x479bc4);})['then'](function(_0x5a594b){_0x5bfb33[_0x0a9e('0x3f')]=_0x5a594b;return _0x5bfb33;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x384319,_0x479bc4))['catch'](handleError(_0x384319,null));};exports[_0x0a9e('0x40')]=function(_0x1dec2e,_0x1459bb){var _0x5b4f5e={'raw':![],'where':{'id':_0x1dec2e[_0x0a9e('0x41')]['id']}},_0x316c8f={};_0x316c8f[_0x0a9e('0x30')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x27')][_0x0a9e('0x28')]);_0x316c8f[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x1dec2e[_0x0a9e('0x2c')]);_0x316c8f[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x316c8f[_0x0a9e('0x30')],_0x316c8f[_0x0a9e('0x2c')]);_0x5b4f5e[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x316c8f['model'],qs['fields'](_0x1dec2e[_0x0a9e('0x2c')][_0x0a9e('0x32')]));_0x5b4f5e[_0x0a9e('0x31')]=_0x5b4f5e[_0x0a9e('0x31')][_0x0a9e('0x33')]?_0x5b4f5e[_0x0a9e('0x31')]:_0x316c8f[_0x0a9e('0x30')];if(_0x1dec2e[_0x0a9e('0x2c')][_0x0a9e('0x3c')]){_0x5b4f5e[_0x0a9e('0x3d')]=[{'all':!![]}];}_0x5b4f5e=_[_0x0a9e('0x3b')]({},_0x5b4f5e,_0x1dec2e[_0x0a9e('0x42')]);return db['AnalyticFieldReport'][_0x0a9e('0x43')](_0x5b4f5e)[_0x0a9e('0x1f')](handleEntityNotFound(_0x1459bb,null))[_0x0a9e('0x1f')](respondWithResult(_0x1459bb,null))[_0x0a9e('0x44')](handleError(_0x1459bb,null));};exports[_0x0a9e('0x45')]=function(_0xbe9d19,_0x21eb86){return db[_0x0a9e('0x27')]['create'](_0xbe9d19[_0x0a9e('0x46')],{})['then'](respondWithResult(_0x21eb86,0xc9))[_0x0a9e('0x44')](handleError(_0x21eb86,null));};exports[_0x0a9e('0x47')]=function(_0x8d6dd1,_0x562fb4){return db[_0x0a9e('0x27')][_0x0a9e('0x47')](_0x8d6dd1[_0x0a9e('0x46')],{'raw':![],'individualHooks':!![]})[_0x0a9e('0x1f')](respondWithResult(_0x562fb4,0xc9))[_0x0a9e('0x44')](handleError(_0x562fb4,null));};exports[_0x0a9e('0x1e')]=function(_0x45bf7f,_0x5bbcde){if(_0x45bf7f[_0x0a9e('0x46')]['id']){delete _0x45bf7f[_0x0a9e('0x46')]['id'];}return db[_0x0a9e('0x27')][_0x0a9e('0x43')]({'where':{'id':_0x45bf7f[_0x0a9e('0x41')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x5bbcde,null))[_0x0a9e('0x1f')](saveUpdates(_0x45bf7f[_0x0a9e('0x46')],null))[_0x0a9e('0x1f')](respondWithResult(_0x5bbcde,null))['catch'](handleError(_0x5bbcde,null));};exports[_0x0a9e('0x20')]=function(_0x3fe430,_0x4f7240){return db['AnalyticFieldReport']['find']({'where':{'id':_0x3fe430[_0x0a9e('0x41')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x4f7240,null))[_0x0a9e('0x1f')](removeEntity(_0x4f7240,null))[_0x0a9e('0x44')](handleError(_0x4f7240,null));};exports[_0x0a9e('0x48')]=function(_0x30decb,_0x2e5165){return db[_0x0a9e('0x27')]['destroy']({'where':{'id':_0x30decb['query']['ids']||[]},'raw':![],'individualHooks':!![]})[_0x0a9e('0x1f')](respondWithResult(_0x2e5165,0xcc))[_0x0a9e('0x44')](handleError(_0x2e5165,null));};exports[_0x0a9e('0x49')]=function(_0x5bb3ed,_0x2b69d9,_0x161aa7){return db['AnalyticCustomReport']['findOne']({'where':{'id':_0x5bb3ed[_0x0a9e('0x41')]['id']}})['then'](handleEntityNotFound(_0x2b69d9,null))[_0x0a9e('0x1f')](function(_0x4c3845){if(_0x4c3845){return db[_0x0a9e('0x4a')][_0x0a9e('0x4b')](function(_0x439340){return db['AnalyticFieldReport'][_0x0a9e('0x20')]({'where':{'CustomReportId':_0x5bb3ed[_0x0a9e('0x41')]['id']},'transaction':_0x439340})['then'](function(_0x50f687){var _0x128aa6=_[_0x0a9e('0x26')](_0x5bb3ed['body'],function(_0x145931){delete _0x145931['id'];_0x145931['CustomReportId']=_0x5bb3ed[_0x0a9e('0x41')]['id'];return _0x145931;});return db['AnalyticFieldReport'][_0x0a9e('0x47')](_0x128aa6,{'transaction':_0x439340});});})['then'](function(){return db['AnalyticFieldReport']['findAll']({'where':{'CustomReportId':_0x5bb3ed[_0x0a9e('0x41')]['id']}});});}})['then'](respondWithResult(_0x2b69d9,null))[_0x0a9e('0x44')](handleError(_0x2b69d9,null));}; \ No newline at end of file +var _0xb10b=['end','json','count','offset','limit','set','Content-Range','reject','save','then','destroy','name','send','map','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','field','options','includeAll','include','findAll','rows','catch','AnalyticFieldReport','find','create','body','bulkCreate','update','params','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status'];(function(_0x286731,_0x116916){var _0x50f5a5=function(_0x18ef71){while(--_0x18ef71){_0x286731['push'](_0x286731['shift']());}};_0x50f5a5(++_0x116916);}(_0xb10b,0x12a));var _0xbb10=function(_0x15adc6,_0xbc8322){_0x15adc6=_0x15adc6-0x0;var _0x3bb841=_0xb10b[_0x15adc6];return _0x3bb841;};'use strict';var pdf=require(_0xbb10('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbb10('0x1'));var zipdir=require(_0xbb10('0x2'));var jsonpatch=require(_0xbb10('0x3'));var rp=require('request-promise');var moment=require(_0xbb10('0x4'));var BPromise=require(_0xbb10('0x5'));var Mustache=require(_0xbb10('0x6'));var util=require(_0xbb10('0x7'));var path=require(_0xbb10('0x8'));var sox=require(_0xbb10('0x9'));var csv=require('to-csv');var ejs=require(_0xbb10('0xa'));var fs=require('fs');var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0xf'));var querystring=require(_0xbb10('0x10'));var Papa=require(_0xbb10('0x11'));var Redis=require(_0xbb10('0x12'));var authService=require(_0xbb10('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb10('0x14'));var logger=require(_0xbb10('0x15'))(_0xbb10('0x16'));var utils=require('../../config/utils');var config=require(_0xbb10('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x44fb19,_0x916a32){_0x916a32=_0x916a32||0xcc;return function(_0x285009){if(_0x285009){return _0x44fb19[_0xbb10('0x18')](_0x916a32);}return _0x44fb19[_0xbb10('0x19')](_0x916a32)[_0xbb10('0x1a')]();};}function respondWithResult(_0x58a612,_0x26e021){_0x26e021=_0x26e021||0xc8;return function(_0x42d7e4){if(_0x42d7e4){return _0x58a612[_0xbb10('0x19')](_0x26e021)[_0xbb10('0x1b')](_0x42d7e4);}};}function respondWithFilteredResult(_0x3df17b,_0x2f2ebf){return function(_0x24a57b){if(_0x24a57b){var _0x36b5e8=_0x24a57b[_0xbb10('0x1c')],_0x3e26f4=_0x2f2ebf[_0xbb10('0x1d')],_0x2b184e=_0x2f2ebf[_0xbb10('0x1d')]+_0x2f2ebf[_0xbb10('0x1e')],_0x4a2bfc;if(_0x2b184e>=_0x36b5e8){_0x2b184e=_0x36b5e8;_0x4a2bfc=0xc8;}else{_0x4a2bfc=0xce;}_0x3df17b[_0xbb10('0x19')](_0x4a2bfc);return _0x3df17b[_0xbb10('0x1f')](_0xbb10('0x20'),_0x3e26f4+'-'+_0x2b184e+'/'+_0x36b5e8)[_0xbb10('0x1b')](_0x24a57b);}return null;};}function patchUpdates(_0xbf2906){return function(_0xe1c665){try{jsonpatch['apply'](_0xe1c665,_0xbf2906,!![]);}catch(_0x5ff0cf){return BPromise[_0xbb10('0x21')](_0x5ff0cf);}return _0xe1c665[_0xbb10('0x22')]();};}function saveUpdates(_0x109908,_0xdf237d){return function(_0x44e563){if(_0x44e563){return _0x44e563['update'](_0x109908)[_0xbb10('0x23')](function(_0x12ef77){return _0x12ef77;});}return null;};}function removeEntity(_0x50aea1,_0x4c4b0d){return function(_0x8e2b97){if(_0x8e2b97){return _0x8e2b97[_0xbb10('0x24')]()[_0xbb10('0x23')](function(){_0x50aea1[_0xbb10('0x19')](0xcc)[_0xbb10('0x1a')]();});}};}function handleEntityNotFound(_0x1824b7,_0x407cb4){return function(_0x436104){if(!_0x436104){_0x1824b7[_0xbb10('0x18')](0x194);}return _0x436104;};}function handleError(_0x395404,_0x3ba6cd){_0x3ba6cd=_0x3ba6cd||0x1f4;return function(_0x26ad93){logger['error'](_0x26ad93['stack']);if(_0x26ad93['name']){delete _0x26ad93[_0xbb10('0x25')];}_0x395404[_0xbb10('0x19')](_0x3ba6cd)[_0xbb10('0x26')](_0x26ad93);};}exports['index']=function(_0x2fdde9,_0x24d586){var _0x6ed43b={},_0x1d5e95={},_0x1acce9={'count':0x0,'rows':[]};var _0x20d946=_[_0xbb10('0x27')](db['AnalyticFieldReport'][_0xbb10('0x28')],function(_0x21ac54){return{'name':_0x21ac54[_0xbb10('0x29')],'type':_0x21ac54[_0xbb10('0x2a')][_0xbb10('0x2b')]};});_0x1d5e95[_0xbb10('0x2c')]=_['map'](_0x20d946,_0xbb10('0x25'));_0x1d5e95['query']=_[_0xbb10('0x2d')](_0x2fdde9['query']);_0x1d5e95[_0xbb10('0x2e')]=_[_0xbb10('0x2f')](_0x1d5e95[_0xbb10('0x2c')],_0x1d5e95['query']);_0x6ed43b['attributes']=_[_0xbb10('0x2f')](_0x1d5e95[_0xbb10('0x2c')],qs['fields'](_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x31')]));_0x6ed43b[_0xbb10('0x32')]=_0x6ed43b[_0xbb10('0x32')][_0xbb10('0x33')]?_0x6ed43b[_0xbb10('0x32')]:_0x1d5e95[_0xbb10('0x2c')];if(!_0x2fdde9['query'][_0xbb10('0x34')](_0xbb10('0x35'))){_0x6ed43b[_0xbb10('0x1e')]=qs[_0xbb10('0x1e')](_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x1e')]);_0x6ed43b[_0xbb10('0x1d')]=qs[_0xbb10('0x1d')](_0x2fdde9[_0xbb10('0x30')]['offset']);}_0x6ed43b[_0xbb10('0x36')]=qs[_0xbb10('0x37')](_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x37')]);_0x6ed43b['where']=qs[_0xbb10('0x2e')](_['pick'](_0x2fdde9['query'],_0x1d5e95[_0xbb10('0x2e')]));if(_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x38')]){_0x6ed43b[_0xbb10('0x39')]=_[_0xbb10('0x3a')](_0x6ed43b[_0xbb10('0x39')],{'$or':_['map'](_0x20d946,function(_0x1e5bbd){if(_0x1e5bbd[_0xbb10('0x2a')]['key']!=='VIRTUAL'){var _0x5cd55f={};_0x5cd55f[_0x1e5bbd[_0xbb10('0x3b')]]={'$like':'%'+_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x38')]+'%'};return _0x5cd55f;}})});}_0x6ed43b=_['merge']({},_0x6ed43b,_0x2fdde9[_0xbb10('0x3c')]);var _0x3e8538={'where':_0x6ed43b[_0xbb10('0x39')]};return db['AnalyticFieldReport'][_0xbb10('0x1c')](_0x3e8538)[_0xbb10('0x23')](function(_0x1dcd38){_0x1acce9[_0xbb10('0x1c')]=_0x1dcd38;if(_0x2fdde9['query'][_0xbb10('0x3d')]){_0x6ed43b[_0xbb10('0x3e')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0xbb10('0x3f')](_0x6ed43b);})[_0xbb10('0x23')](function(_0x44d6ae){_0x1acce9[_0xbb10('0x40')]=_0x44d6ae;return _0x1acce9;})[_0xbb10('0x23')](respondWithFilteredResult(_0x24d586,_0x6ed43b))[_0xbb10('0x41')](handleError(_0x24d586,null));};exports['show']=function(_0x1e8f79,_0x1c7fae){var _0x3e7b4c={'raw':![],'where':{'id':_0x1e8f79['params']['id']}},_0x3d3c41={};_0x3d3c41[_0xbb10('0x2c')]=_[_0xbb10('0x2d')](db[_0xbb10('0x42')][_0xbb10('0x28')]);_0x3d3c41['query']=_[_0xbb10('0x2d')](_0x1e8f79[_0xbb10('0x30')]);_0x3d3c41['filters']=_['intersection'](_0x3d3c41[_0xbb10('0x2c')],_0x3d3c41['query']);_0x3e7b4c[_0xbb10('0x32')]=_[_0xbb10('0x2f')](_0x3d3c41['model'],qs[_0xbb10('0x31')](_0x1e8f79[_0xbb10('0x30')][_0xbb10('0x31')]));_0x3e7b4c['attributes']=_0x3e7b4c[_0xbb10('0x32')][_0xbb10('0x33')]?_0x3e7b4c[_0xbb10('0x32')]:_0x3d3c41[_0xbb10('0x2c')];if(_0x1e8f79[_0xbb10('0x30')][_0xbb10('0x3d')]){_0x3e7b4c[_0xbb10('0x3e')]=[{'all':!![]}];}_0x3e7b4c=_[_0xbb10('0x3a')]({},_0x3e7b4c,_0x1e8f79[_0xbb10('0x3c')]);return db[_0xbb10('0x42')][_0xbb10('0x43')](_0x3e7b4c)[_0xbb10('0x23')](handleEntityNotFound(_0x1c7fae,null))['then'](respondWithResult(_0x1c7fae,null))[_0xbb10('0x41')](handleError(_0x1c7fae,null));};exports[_0xbb10('0x44')]=function(_0x4a1248,_0x14e1cb){return db[_0xbb10('0x42')][_0xbb10('0x44')](_0x4a1248[_0xbb10('0x45')],{})[_0xbb10('0x23')](respondWithResult(_0x14e1cb,0xc9))[_0xbb10('0x41')](handleError(_0x14e1cb,null));};exports[_0xbb10('0x46')]=function(_0x5be85e,_0x4a9793){return db[_0xbb10('0x42')][_0xbb10('0x46')](_0x5be85e[_0xbb10('0x45')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x4a9793,0xc9))['catch'](handleError(_0x4a9793,null));};exports[_0xbb10('0x47')]=function(_0x34cf4e,_0x1bd054){if(_0x34cf4e[_0xbb10('0x45')]['id']){delete _0x34cf4e[_0xbb10('0x45')]['id'];}return db[_0xbb10('0x42')][_0xbb10('0x43')]({'where':{'id':_0x34cf4e[_0xbb10('0x48')]['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0x1bd054,null))[_0xbb10('0x23')](saveUpdates(_0x34cf4e['body'],null))['then'](respondWithResult(_0x1bd054,null))[_0xbb10('0x41')](handleError(_0x1bd054,null));};exports[_0xbb10('0x24')]=function(_0x36ab7d,_0xb014b0){return db[_0xbb10('0x42')][_0xbb10('0x43')]({'where':{'id':_0x36ab7d[_0xbb10('0x48')]['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0xb014b0,null))[_0xbb10('0x23')](removeEntity(_0xb014b0,null))[_0xbb10('0x41')](handleError(_0xb014b0,null));};exports[_0xbb10('0x49')]=function(_0x20e18a,_0x61e689){return db[_0xbb10('0x42')][_0xbb10('0x24')]({'where':{'id':_0x20e18a['query'][_0xbb10('0x4a')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x61e689,0xcc))[_0xbb10('0x41')](handleError(_0x61e689,null));};exports[_0xbb10('0x4b')]=function(_0x1ffe20,_0x3f27ce,_0x26e66e){return db[_0xbb10('0x4c')][_0xbb10('0x4d')]({'where':{'id':_0x1ffe20[_0xbb10('0x48')]['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0x3f27ce,null))[_0xbb10('0x23')](function(_0x44a056){if(_0x44a056){return db[_0xbb10('0x4e')][_0xbb10('0x4f')](function(_0x3d7e17){return db[_0xbb10('0x42')]['destroy']({'where':{'CustomReportId':_0x1ffe20[_0xbb10('0x48')]['id']},'transaction':_0x3d7e17})[_0xbb10('0x23')](function(_0x1b83a9){var _0x4ce8e7=_[_0xbb10('0x27')](_0x1ffe20[_0xbb10('0x45')],function(_0x4bedd0){delete _0x4bedd0['id'];_0x4bedd0[_0xbb10('0x50')]=_0x1ffe20[_0xbb10('0x48')]['id'];return _0x4bedd0;});return db[_0xbb10('0x42')][_0xbb10('0x46')](_0x4ce8e7,{'transaction':_0x3d7e17});});})[_0xbb10('0x23')](function(){return db[_0xbb10('0x42')][_0xbb10('0x3f')]({'where':{'CustomReportId':_0x1ffe20[_0xbb10('0x48')]['id']}});});}})[_0xbb10('0x23')](respondWithResult(_0x3f27ce,null))[_0xbb10('0x41')](handleError(_0x3f27ce,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 514b657..c3310bd 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 _0xc43c=['util','api','bluebird','request-promise','path','./analyticFieldReport.attributes','exports','define','analytics_report_fields'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0xc43c,0xc6));var _0xcc43=function(_0x516f60,_0x5931e8){_0x516f60=_0x516f60-0x0;var _0x33e092=_0xc43c[_0x516f60];return _0x33e092;};'use strict';var _=require('lodash');var util=require(_0xcc43('0x0'));var logger=require('../../config/logger')(_0xcc43('0x1'));var moment=require('moment');var BPromise=require(_0xcc43('0x2'));var rp=require(_0xcc43('0x3'));var fs=require('fs');var path=require(_0xcc43('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcc43('0x5'));module[_0xcc43('0x6')]=function(_0x19ce10,_0x3e6add){return _0x19ce10[_0xcc43('0x7')]('AnalyticFieldReport',attributes,{'tableName':_0xcc43('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x86e3=['../../config/logger','api','bluebird','request-promise','../../config/environment','exports','define','AnalyticFieldReport','analytics_report_fields'];(function(_0x1b76e6,_0x598520){var _0x333b53=function(_0x106e6a){while(--_0x106e6a){_0x1b76e6['push'](_0x1b76e6['shift']());}};_0x333b53(++_0x598520);}(_0x86e3,0x1d4));var _0x386e=function(_0x53758c,_0x5664af){_0x53758c=_0x53758c-0x0;var _0x425eff=_0x86e3[_0x53758c];return _0x425eff;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x386e('0x0'))(_0x386e('0x1'));var moment=require('moment');var BPromise=require(_0x386e('0x2'));var rp=require(_0x386e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x386e('0x4'));var attributes=require('./analyticFieldReport.attributes');module[_0x386e('0x5')]=function(_0xba75a6,_0x5cd921){return _0xba75a6[_0x386e('0x6')](_0x386e('0x7'),attributes,{'tableName':_0x386e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js index 670ea37..7545209 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 _0x0853=['../../config/logger','rpc','../../config/environment','client','request','then','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x1a47b6,_0x5de248){var _0x389fbe=function(_0x1db5e1){while(--_0x1db5e1){_0x1a47b6['push'](_0x1a47b6['shift']());}};_0x389fbe(++_0x5de248);}(_0x0853,0xc9));var _0x3085=function(_0x1810a6,_0xfe18aa){_0x1810a6=_0x1810a6-0x0;var _0xbe94a7=_0x0853[_0x1810a6];return _0xbe94a7;};'use strict';var _=require('lodash');var util=require(_0x3085('0x0'));var moment=require('moment');var BPromise=require(_0x3085('0x1'));var rs=require(_0x3085('0x2'));var fs=require('fs');var Redis=require(_0x3085('0x3'));var db=require(_0x3085('0x4'))['db'];var utils=require(_0x3085('0x5'));var logger=require(_0x3085('0x6'))(_0x3085('0x7'));var config=require(_0x3085('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3085('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3beae7,_0xdc8950,_0x3b380b){return new BPromise(function(_0x5bf54c,_0x5a2faf){return client[_0x3085('0xa')](_0x3beae7,_0x3b380b)[_0x3085('0xb')](function(_0xf795da){logger['info'](_0x3085('0xc'),_0xdc8950,_0x3085('0xd'));logger[_0x3085('0xe')](_0x3085('0xf'),_0xdc8950,_0x3085('0xd'),JSON[_0x3085('0x10')](_0xf795da));if(_0xf795da[_0x3085('0x11')]){if(_0xf795da[_0x3085('0x11')][_0x3085('0x12')]===0x1f4){logger[_0x3085('0x11')](_0x3085('0xc'),_0xdc8950,_0xf795da[_0x3085('0x11')][_0x3085('0x13')]);return _0x5a2faf(_0xf795da['error'][_0x3085('0x13')]);}logger[_0x3085('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0xdc8950,_0xf795da[_0x3085('0x11')]['message']);return _0x5bf54c(_0xf795da['error'][_0x3085('0x13')]);}else{logger[_0x3085('0x14')](_0x3085('0xc'),_0xdc8950,_0x3085('0xd'));_0x5bf54c(_0xf795da[_0x3085('0x15')][_0x3085('0x13')]);}})[_0x3085('0x16')](function(_0x4cd232){logger[_0x3085('0x11')](_0x3085('0xc'),_0xdc8950,_0x4cd232);_0x5a2faf(_0x4cd232);});});} \ No newline at end of file +var _0x893f=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','result'];(function(_0x575855,_0xd4326f){var _0x3657e7=function(_0x215f56){while(--_0x215f56){_0x575855['push'](_0x575855['shift']());}};_0x3657e7(++_0xd4326f);}(_0x893f,0x181));var _0xf893=function(_0x3d2a49,_0x2882c3){_0x3d2a49=_0x3d2a49-0x0;var _0x1ff9e1=_0x893f[_0x3d2a49];return _0x1ff9e1;};'use strict';var _=require(_0xf893('0x0'));var util=require(_0xf893('0x1'));var moment=require(_0xf893('0x2'));var BPromise=require(_0xf893('0x3'));var rs=require(_0xf893('0x4'));var fs=require('fs');var Redis=require(_0xf893('0x5'));var db=require(_0xf893('0x6'))['db'];var utils=require(_0xf893('0x7'));var logger=require(_0xf893('0x8'))(_0xf893('0x9'));var config=require('../../config/environment');var jayson=require(_0xf893('0xa'));var client=jayson[_0xf893('0xb')][_0xf893('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x14c4b0,_0x4e872e,_0x4d8276){return new BPromise(function(_0x449c8e,_0x48c4fb){return client[_0xf893('0xd')](_0x14c4b0,_0x4d8276)[_0xf893('0xe')](function(_0x2470c4){logger[_0xf893('0xf')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4e872e,_0xf893('0x10'));logger['debug'](_0xf893('0x11'),_0x4e872e,_0xf893('0x10'),JSON['stringify'](_0x2470c4));if(_0x2470c4['error']){if(_0x2470c4[_0xf893('0x12')][_0xf893('0x13')]===0x1f4){logger[_0xf893('0x12')](_0xf893('0x14'),_0x4e872e,_0x2470c4[_0xf893('0x12')][_0xf893('0x15')]);return _0x48c4fb(_0x2470c4[_0xf893('0x12')][_0xf893('0x15')]);}logger[_0xf893('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4e872e,_0x2470c4[_0xf893('0x12')][_0xf893('0x15')]);return _0x449c8e(_0x2470c4[_0xf893('0x12')][_0xf893('0x15')]);}else{logger[_0xf893('0xf')](_0xf893('0x14'),_0x4e872e,_0xf893('0x10'));_0x449c8e(_0x2470c4[_0xf893('0x16')][_0xf893('0x15')]);}})[_0xf893('0x17')](function(_0x36f938){logger[_0xf893('0x12')](_0xf893('0x14'),_0x4e872e,_0x36f938);_0x48c4fb(_0x36f938);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index c8c6979..c2c625f 100644 --- a/server/api/analyticFieldReport/index.js +++ b/server/api/analyticFieldReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe14b=['addFields','update','delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','express','Router','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','/create_many','bulkCreate'];(function(_0x36271b,_0x52ef81){var _0x315b6c=function(_0x121e94){while(--_0x121e94){_0x36271b['push'](_0x36271b['shift']());}};_0x315b6c(++_0x52ef81);}(_0xe14b,0x93));var _0xbe14=function(_0x43604e,_0x41e720){_0x43604e=_0x43604e-0x0;var _0x16a542=_0xe14b[_0x43604e];return _0x16a542;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xbe14('0x4'));var config=require('../../config/environment');var controller=require('./analyticFieldReport.controller');router[_0xbe14('0x5')]('/',auth[_0xbe14('0x6')](),controller[_0xbe14('0x7')]);router[_0xbe14('0x5')](_0xbe14('0x8'),auth[_0xbe14('0x6')](),controller[_0xbe14('0x9')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xbe14('0xa')](_0xbe14('0xb'),auth[_0xbe14('0x6')](),controller[_0xbe14('0xc')]);router['post']('/:id/create_many',auth[_0xbe14('0x6')](),controller[_0xbe14('0xd')]);router['put'](_0xbe14('0x8'),auth[_0xbe14('0x6')](),controller[_0xbe14('0xe')]);router[_0xbe14('0xf')](_0xbe14('0x10'),auth[_0xbe14('0x6')](),controller[_0xbe14('0x11')]);router[_0xbe14('0xf')](_0xbe14('0x8'),auth[_0xbe14('0x6')](),controller[_0xbe14('0x12')]);module[_0xbe14('0x13')]=router; \ No newline at end of file +var _0xe14b=['addFields','update','delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','express','Router','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','/create_many','bulkCreate'];(function(_0xccdde3,_0x4786bb){var _0x3e3a29=function(_0x4e9bc2){while(--_0x4e9bc2){_0xccdde3['push'](_0xccdde3['shift']());}};_0x3e3a29(++_0x4786bb);}(_0xe14b,0x93));var _0xbe14=function(_0x21d49b,_0x571e81){_0x21d49b=_0x21d49b-0x0;var _0x2b9bac=_0xe14b[_0x21d49b];return _0x2b9bac;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xbe14('0x4'));var config=require('../../config/environment');var controller=require('./analyticFieldReport.controller');router[_0xbe14('0x5')]('/',auth[_0xbe14('0x6')](),controller[_0xbe14('0x7')]);router[_0xbe14('0x5')](_0xbe14('0x8'),auth[_0xbe14('0x6')](),controller[_0xbe14('0x9')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xbe14('0xa')](_0xbe14('0xb'),auth[_0xbe14('0x6')](),controller[_0xbe14('0xc')]);router['post']('/:id/create_many',auth[_0xbe14('0x6')](),controller[_0xbe14('0xd')]);router['put'](_0xbe14('0x8'),auth[_0xbe14('0x6')](),controller[_0xbe14('0xe')]);router[_0xbe14('0xf')](_0xbe14('0x10'),auth[_0xbe14('0x6')](),controller[_0xbe14('0x11')]);router[_0xbe14('0xf')](_0xbe14('0x8'),auth[_0xbe14('0x6')](),controller[_0xbe14('0x12')]);module[_0xbe14('0x13')]=router; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js index a050a14..2439f1f 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 _0xc0d6=['STRING','TEXT','exports','name'];(function(_0x458363,_0x1675db){var _0x4d0290=function(_0x22960f){while(--_0x22960f){_0x458363['push'](_0x458363['shift']());}};_0x4d0290(++_0x1675db);}(_0xc0d6,0x1ce));var _0x6c0d=function(_0x55d512,_0x1b85de){_0x55d512=_0x55d512-0x0;var _0x2c8c00=_0xc0d6[_0x55d512];return _0x2c8c00;};'use strict';var Sequelize=require('sequelize');module[_0x6c0d('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x6c0d('0x1')},'table':{'type':Sequelize[_0x6c0d('0x2')]},'metric':{'type':Sequelize[_0x6c0d('0x3')]},'description':{'type':Sequelize[_0x6c0d('0x2')]}}; \ No newline at end of file +var _0x4e81=['sequelize','exports','STRING'];(function(_0x3bfbc7,_0x1aa44f){var _0x41df69=function(_0x42cecc){while(--_0x42cecc){_0x3bfbc7['push'](_0x3bfbc7['shift']());}};_0x41df69(++_0x1aa44f);}(_0x4e81,0x1bc));var _0x14e8=function(_0x29df9a,_0x42aff3){_0x29df9a=_0x29df9a-0x0;var _0x3a8e96=_0x4e81[_0x29df9a];return _0x3a8e96;};'use strict';var Sequelize=require(_0x14e8('0x0'));module[_0x14e8('0x1')]={'name':{'type':Sequelize[_0x14e8('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x14e8('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index e9c0876..751670b 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 _0xab06=['rimraf','zip-dir','moment','bluebird','mustache','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','count','offset','limit','set','apply','reject','save','update','then','destroy','get','Metrics','UserProfileResource','error','stack','name','send','index','AnalyticMetric','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','params','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xab06,0x1ec));var _0x6ab0=function(_0x20a558,_0x160e0e){_0x20a558=_0x20a558-0x0;var _0x53d3f7=_0xab06[_0x20a558];return _0x53d3f7;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x6ab0('0x0'));var zipdir=require(_0x6ab0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6ab0('0x2'));var BPromise=require(_0x6ab0('0x3'));var Mustache=require(_0x6ab0('0x4'));var util=require('util');var path=require(_0x6ab0('0x5'));var sox=require(_0x6ab0('0x6'));var csv=require(_0x6ab0('0x7'));var ejs=require(_0x6ab0('0x8'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x6ab0('0x9'));var jsforce=require(_0x6ab0('0xa'));var deskjs=require(_0x6ab0('0xb'));var toCsv=require(_0x6ab0('0x7'));var querystring=require(_0x6ab0('0xc'));var Papa=require('papaparse');var Redis=require(_0x6ab0('0xd'));var authService=require(_0x6ab0('0xe'));var qs=require(_0x6ab0('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6ab0('0x10'))(_0x6ab0('0x11'));var utils=require(_0x6ab0('0x12'));var config=require('../../config/environment');var db=require(_0x6ab0('0x13'))['db'];function respondWithStatusCode(_0x5c2543,_0x2f23be){_0x2f23be=_0x2f23be||0xcc;return function(_0x218fdc){if(_0x218fdc){return _0x5c2543[_0x6ab0('0x14')](_0x2f23be);}return _0x5c2543[_0x6ab0('0x15')](_0x2f23be)[_0x6ab0('0x16')]();};}function respondWithResult(_0x41e524,_0x5b1e53){_0x5b1e53=_0x5b1e53||0xc8;return function(_0x5d4ae5){if(_0x5d4ae5){return _0x41e524[_0x6ab0('0x15')](_0x5b1e53)['json'](_0x5d4ae5);}};}function respondWithFilteredResult(_0x2d052f,_0x446169){return function(_0x3ab760){if(_0x3ab760){var _0x154c4f=_0x3ab760[_0x6ab0('0x17')],_0x416c8c=_0x446169[_0x6ab0('0x18')],_0x38d099=_0x446169[_0x6ab0('0x18')]+_0x446169[_0x6ab0('0x19')],_0x317355;if(_0x38d099>=_0x154c4f){_0x38d099=_0x154c4f;_0x317355=0xc8;}else{_0x317355=0xce;}_0x2d052f[_0x6ab0('0x15')](_0x317355);return _0x2d052f[_0x6ab0('0x1a')]('Content-Range',_0x416c8c+'-'+_0x38d099+'/'+_0x154c4f)['json'](_0x3ab760);}return null;};}function patchUpdates(_0x414498){return function(_0x43e4fa){try{jsonpatch[_0x6ab0('0x1b')](_0x43e4fa,_0x414498,!![]);}catch(_0x3e92ee){return BPromise[_0x6ab0('0x1c')](_0x3e92ee);}return _0x43e4fa[_0x6ab0('0x1d')]();};}function saveUpdates(_0x235703,_0x30db42){return function(_0x4eb100){if(_0x4eb100){return _0x4eb100[_0x6ab0('0x1e')](_0x235703)[_0x6ab0('0x1f')](function(_0x53e23c){return _0x53e23c;});}return null;};}function removeEntity(_0x5a2e1e,_0x4c537a){return function(_0x5aae8a){if(_0x5aae8a){return _0x5aae8a[_0x6ab0('0x20')]()[_0x6ab0('0x1f')](function(){var _0x1e1ffd=_0x5aae8a[_0x6ab0('0x21')]({'plain':!![]});var _0x58b31f=_0x6ab0('0x22');return db[_0x6ab0('0x23')]['destroy']({'where':{'type':_0x58b31f,'resourceId':_0x1e1ffd['id']}})[_0x6ab0('0x1f')](function(){return _0x5aae8a;});})[_0x6ab0('0x1f')](function(){_0x5a2e1e['status'](0xcc)[_0x6ab0('0x16')]();});}};}function handleEntityNotFound(_0x340f1b,_0x152020){return function(_0x555b6e){if(!_0x555b6e){_0x340f1b['sendStatus'](0x194);}return _0x555b6e;};}function handleError(_0x5680e5,_0x47ea42){_0x47ea42=_0x47ea42||0x1f4;return function(_0x1287e4){logger[_0x6ab0('0x24')](_0x1287e4[_0x6ab0('0x25')]);if(_0x1287e4[_0x6ab0('0x26')]){delete _0x1287e4[_0x6ab0('0x26')];}_0x5680e5['status'](_0x47ea42)[_0x6ab0('0x27')](_0x1287e4);};}exports[_0x6ab0('0x28')]=function(_0x27770a,_0x5e9234){var _0x1e7e45={},_0x287137={},_0x5318c5={'count':0x0,'rows':[]};var _0xe930ff=_['map'](db[_0x6ab0('0x29')][_0x6ab0('0x2a')],function(_0x276463){return{'name':_0x276463[_0x6ab0('0x2b')],'type':_0x276463['type'][_0x6ab0('0x2c')]};});_0x287137[_0x6ab0('0x2d')]=_[_0x6ab0('0x2e')](_0xe930ff,_0x6ab0('0x26'));_0x287137[_0x6ab0('0x2f')]=_[_0x6ab0('0x30')](_0x27770a['query']);_0x287137[_0x6ab0('0x31')]=_[_0x6ab0('0x32')](_0x287137['model'],_0x287137['query']);_0x1e7e45['attributes']=_[_0x6ab0('0x32')](_0x287137[_0x6ab0('0x2d')],qs[_0x6ab0('0x33')](_0x27770a['query'][_0x6ab0('0x33')]));_0x1e7e45[_0x6ab0('0x34')]=_0x1e7e45[_0x6ab0('0x34')]['length']?_0x1e7e45[_0x6ab0('0x34')]:_0x287137[_0x6ab0('0x2d')];if(!_0x27770a['query'][_0x6ab0('0x35')](_0x6ab0('0x36'))){_0x1e7e45['limit']=qs[_0x6ab0('0x19')](_0x27770a[_0x6ab0('0x2f')][_0x6ab0('0x19')]);_0x1e7e45[_0x6ab0('0x18')]=qs[_0x6ab0('0x18')](_0x27770a['query'][_0x6ab0('0x18')]);}_0x1e7e45[_0x6ab0('0x37')]=qs[_0x6ab0('0x38')](_0x27770a[_0x6ab0('0x2f')][_0x6ab0('0x38')]);_0x1e7e45[_0x6ab0('0x39')]=qs[_0x6ab0('0x31')](_[_0x6ab0('0x3a')](_0x27770a[_0x6ab0('0x2f')],_0x287137[_0x6ab0('0x31')]));if(_0x27770a['query'][_0x6ab0('0x3b')]){_0x1e7e45[_0x6ab0('0x39')]=_[_0x6ab0('0x3c')](_0x1e7e45[_0x6ab0('0x39')],{'$or':_[_0x6ab0('0x2e')](_0xe930ff,function(_0x5b01cf){if(_0x5b01cf[_0x6ab0('0x3d')][_0x6ab0('0x2c')]!==_0x6ab0('0x3e')){var _0x17373e={};_0x17373e[_0x5b01cf[_0x6ab0('0x3f')]]={'$like':'%'+_0x27770a[_0x6ab0('0x2f')][_0x6ab0('0x3b')]+'%'};return _0x17373e;}})});}_0x1e7e45=_[_0x6ab0('0x3c')]({},_0x1e7e45,_0x27770a[_0x6ab0('0x40')]);var _0xa18585={'where':_0x1e7e45['where']};return db[_0x6ab0('0x29')][_0x6ab0('0x17')](_0xa18585)[_0x6ab0('0x1f')](function(_0x51b3f8){_0x5318c5[_0x6ab0('0x17')]=_0x51b3f8;if(_0x27770a[_0x6ab0('0x2f')][_0x6ab0('0x41')]){_0x1e7e45[_0x6ab0('0x42')]=[{'all':!![]}];}return db['AnalyticMetric'][_0x6ab0('0x43')](_0x1e7e45);})[_0x6ab0('0x1f')](function(_0x5b31f6){_0x5318c5[_0x6ab0('0x44')]=_0x5b31f6;return _0x5318c5;})['then'](respondWithFilteredResult(_0x5e9234,_0x1e7e45))[_0x6ab0('0x45')](handleError(_0x5e9234,null));};exports['show']=function(_0x1fe98b,_0x39397f){var _0x34cd0d={'raw':!![],'where':{'id':_0x1fe98b[_0x6ab0('0x46')]['id']}},_0x20ad69={};_0x20ad69[_0x6ab0('0x2d')]=_['keys'](db[_0x6ab0('0x29')][_0x6ab0('0x2a')]);_0x20ad69[_0x6ab0('0x2f')]=_[_0x6ab0('0x30')](_0x1fe98b[_0x6ab0('0x2f')]);_0x20ad69['filters']=_[_0x6ab0('0x32')](_0x20ad69[_0x6ab0('0x2d')],_0x20ad69['query']);_0x34cd0d[_0x6ab0('0x34')]=_['intersection'](_0x20ad69[_0x6ab0('0x2d')],qs['fields'](_0x1fe98b[_0x6ab0('0x2f')]['fields']));_0x34cd0d[_0x6ab0('0x34')]=_0x34cd0d[_0x6ab0('0x34')][_0x6ab0('0x47')]?_0x34cd0d['attributes']:_0x20ad69['model'];if(_0x1fe98b[_0x6ab0('0x2f')][_0x6ab0('0x41')]){_0x34cd0d[_0x6ab0('0x42')]=[{'all':!![]}];}_0x34cd0d=_['merge']({},_0x34cd0d,_0x1fe98b[_0x6ab0('0x40')]);return db[_0x6ab0('0x29')][_0x6ab0('0x48')](_0x34cd0d)[_0x6ab0('0x1f')](handleEntityNotFound(_0x39397f,null))['then'](respondWithResult(_0x39397f,null))['catch'](handleError(_0x39397f,null));};exports[_0x6ab0('0x49')]=function(_0x3c8153,_0x76a2d5){return db['AnalyticMetric'][_0x6ab0('0x49')](_0x3c8153['body'],{})[_0x6ab0('0x1f')](function(_0x376eda){var _0x45fbb3=_0x3c8153[_0x6ab0('0x4a')]['get']({'plain':!![]});if(!_0x45fbb3)throw new Error(_0x6ab0('0x4b'));if(_0x45fbb3[_0x6ab0('0x4c')]===_0x6ab0('0x4a')){var _0x5b5902=_0x376eda['get']({'plain':!![]});var _0x51609f=_0x6ab0('0x22');return db[_0x6ab0('0x4d')][_0x6ab0('0x48')]({'where':{'name':_0x51609f,'userProfileId':_0x45fbb3[_0x6ab0('0x4e')]},'raw':!![]})[_0x6ab0('0x1f')](function(_0x1499dc){if(_0x1499dc&&_0x1499dc[_0x6ab0('0x4f')]===0x0){return db[_0x6ab0('0x23')][_0x6ab0('0x49')]({'name':_0x5b5902[_0x6ab0('0x26')],'resourceId':_0x5b5902['id'],'type':_0x1499dc[_0x6ab0('0x26')],'sectionId':_0x1499dc['id']},{})['then'](function(){return _0x376eda;});}else{return _0x376eda;}})[_0x6ab0('0x45')](function(_0x34a706){logger[_0x6ab0('0x24')](_0x6ab0('0x50'),_0x34a706);throw _0x34a706;});}return _0x376eda;})['then'](respondWithResult(_0x76a2d5,0xc9))['catch'](handleError(_0x76a2d5,null));};exports[_0x6ab0('0x1e')]=function(_0x212c01,_0x2c7f11){if(_0x212c01['body']['id']){delete _0x212c01[_0x6ab0('0x51')]['id'];}return db[_0x6ab0('0x29')]['find']({'where':{'id':_0x212c01[_0x6ab0('0x46')]['id']}})[_0x6ab0('0x1f')](handleEntityNotFound(_0x2c7f11,null))[_0x6ab0('0x1f')](saveUpdates(_0x212c01['body'],null))['then'](respondWithResult(_0x2c7f11,null))['catch'](handleError(_0x2c7f11,null));};exports[_0x6ab0('0x20')]=function(_0x413c2c,_0x4e2082){return db[_0x6ab0('0x29')]['find']({'where':{'id':_0x413c2c['params']['id']}})['then'](handleEntityNotFound(_0x4e2082,null))[_0x6ab0('0x1f')](removeEntity(_0x4e2082,null))[_0x6ab0('0x45')](handleError(_0x4e2082,null));}; \ No newline at end of file +var _0x1e4c=['map','AnalyticMetric','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','field','options','includeAll','include','findAll','rows','show','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Metrics','UserProfileSection','autoAssociation','UserProfileResource','error','body','params','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','then','stack','name','send'];(function(_0x43a872,_0x195afd){var _0x36b088=function(_0x5794ce){while(--_0x5794ce){_0x43a872['push'](_0x43a872['shift']());}};_0x36b088(++_0x195afd);}(_0x1e4c,0x118));var _0xc1e4=function(_0x300dec,_0x1c8893){_0x300dec=_0x300dec-0x0;var _0x5acf93=_0x1e4c[_0x300dec];return _0x5acf93;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xc1e4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc1e4('0x1'));var jsonpatch=require(_0xc1e4('0x2'));var rp=require('request-promise');var moment=require(_0xc1e4('0x3'));var BPromise=require(_0xc1e4('0x4'));var Mustache=require(_0xc1e4('0x5'));var util=require(_0xc1e4('0x6'));var path=require(_0xc1e4('0x7'));var sox=require(_0xc1e4('0x8'));var csv=require(_0xc1e4('0x9'));var ejs=require(_0xc1e4('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xc1e4('0xb'));var crypto=require('crypto');var jsforce=require(_0xc1e4('0xc'));var deskjs=require(_0xc1e4('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc1e4('0xe'));var Redis=require(_0xc1e4('0xf'));var authService=require(_0xc1e4('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc1e4('0x11'));var logger=require('../../config/logger')(_0xc1e4('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xc1e4('0x13'))['db'];function respondWithStatusCode(_0xbcc2c1,_0x278262){_0x278262=_0x278262||0xcc;return function(_0x4aeeac){if(_0x4aeeac){return _0xbcc2c1['sendStatus'](_0x278262);}return _0xbcc2c1[_0xc1e4('0x14')](_0x278262)[_0xc1e4('0x15')]();};}function respondWithResult(_0x418989,_0x558bb6){_0x558bb6=_0x558bb6||0xc8;return function(_0x160d2b){if(_0x160d2b){return _0x418989[_0xc1e4('0x14')](_0x558bb6)[_0xc1e4('0x16')](_0x160d2b);}};}function respondWithFilteredResult(_0x558ac8,_0x39c969){return function(_0x5b1e02){if(_0x5b1e02){var _0x3d118b=_0x5b1e02[_0xc1e4('0x17')],_0x2734a3=_0x39c969[_0xc1e4('0x18')],_0x50e380=_0x39c969[_0xc1e4('0x18')]+_0x39c969[_0xc1e4('0x19')],_0x45eacb;if(_0x50e380>=_0x3d118b){_0x50e380=_0x3d118b;_0x45eacb=0xc8;}else{_0x45eacb=0xce;}_0x558ac8[_0xc1e4('0x14')](_0x45eacb);return _0x558ac8[_0xc1e4('0x1a')](_0xc1e4('0x1b'),_0x2734a3+'-'+_0x50e380+'/'+_0x3d118b)[_0xc1e4('0x16')](_0x5b1e02);}return null;};}function patchUpdates(_0x4386a4){return function(_0x3087c4){try{jsonpatch['apply'](_0x3087c4,_0x4386a4,!![]);}catch(_0x33f9af){return BPromise[_0xc1e4('0x1c')](_0x33f9af);}return _0x3087c4[_0xc1e4('0x1d')]();};}function saveUpdates(_0xe02c3d,_0x5ced27){return function(_0x399c4a){if(_0x399c4a){return _0x399c4a[_0xc1e4('0x1e')](_0xe02c3d)['then'](function(_0x52330d){return _0x52330d;});}return null;};}function removeEntity(_0x5574e9,_0x1dca61){return function(_0x34ac47){if(_0x34ac47){return _0x34ac47[_0xc1e4('0x1f')]()['then'](function(){var _0x4d0759=_0x34ac47['get']({'plain':!![]});var _0x24e7d7='Metrics';return db['UserProfileResource'][_0xc1e4('0x1f')]({'where':{'type':_0x24e7d7,'resourceId':_0x4d0759['id']}})['then'](function(){return _0x34ac47;});})[_0xc1e4('0x20')](function(){_0x5574e9[_0xc1e4('0x14')](0xcc)[_0xc1e4('0x15')]();});}};}function handleEntityNotFound(_0x245d49,_0x1f74ef){return function(_0x5b55b9){if(!_0x5b55b9){_0x245d49['sendStatus'](0x194);}return _0x5b55b9;};}function handleError(_0x22619b,_0x42c152){_0x42c152=_0x42c152||0x1f4;return function(_0x272952){logger['error'](_0x272952[_0xc1e4('0x21')]);if(_0x272952[_0xc1e4('0x22')]){delete _0x272952['name'];}_0x22619b[_0xc1e4('0x14')](_0x42c152)[_0xc1e4('0x23')](_0x272952);};}exports['index']=function(_0x4f0b10,_0x29ca12){var _0x575af6={},_0x563094={},_0xca83d8={'count':0x0,'rows':[]};var _0x2145e9=_[_0xc1e4('0x24')](db[_0xc1e4('0x25')][_0xc1e4('0x26')],function(_0x3d720f){return{'name':_0x3d720f[_0xc1e4('0x27')],'type':_0x3d720f[_0xc1e4('0x28')][_0xc1e4('0x29')]};});_0x563094[_0xc1e4('0x2a')]=_[_0xc1e4('0x24')](_0x2145e9,_0xc1e4('0x22'));_0x563094[_0xc1e4('0x2b')]=_[_0xc1e4('0x2c')](_0x4f0b10['query']);_0x563094[_0xc1e4('0x2d')]=_[_0xc1e4('0x2e')](_0x563094[_0xc1e4('0x2a')],_0x563094[_0xc1e4('0x2b')]);_0x575af6['attributes']=_[_0xc1e4('0x2e')](_0x563094['model'],qs['fields'](_0x4f0b10['query'][_0xc1e4('0x2f')]));_0x575af6[_0xc1e4('0x30')]=_0x575af6[_0xc1e4('0x30')][_0xc1e4('0x31')]?_0x575af6[_0xc1e4('0x30')]:_0x563094[_0xc1e4('0x2a')];if(!_0x4f0b10['query'][_0xc1e4('0x32')]('nolimit')){_0x575af6[_0xc1e4('0x19')]=qs['limit'](_0x4f0b10[_0xc1e4('0x2b')]['limit']);_0x575af6[_0xc1e4('0x18')]=qs['offset'](_0x4f0b10[_0xc1e4('0x2b')]['offset']);}_0x575af6[_0xc1e4('0x33')]=qs[_0xc1e4('0x34')](_0x4f0b10[_0xc1e4('0x2b')][_0xc1e4('0x34')]);_0x575af6['where']=qs[_0xc1e4('0x2d')](_[_0xc1e4('0x35')](_0x4f0b10[_0xc1e4('0x2b')],_0x563094[_0xc1e4('0x2d')]));if(_0x4f0b10[_0xc1e4('0x2b')][_0xc1e4('0x36')]){_0x575af6[_0xc1e4('0x37')]=_[_0xc1e4('0x38')](_0x575af6['where'],{'$or':_['map'](_0x2145e9,function(_0x23f0cc){if(_0x23f0cc[_0xc1e4('0x28')][_0xc1e4('0x29')]!==_0xc1e4('0x39')){var _0x5f5773={};_0x5f5773[_0x23f0cc[_0xc1e4('0x3a')]]={'$like':'%'+_0x4f0b10[_0xc1e4('0x2b')]['filter']+'%'};return _0x5f5773;}})});}_0x575af6=_[_0xc1e4('0x38')]({},_0x575af6,_0x4f0b10[_0xc1e4('0x3b')]);var _0x1b93ee={'where':_0x575af6['where']};return db[_0xc1e4('0x25')]['count'](_0x1b93ee)[_0xc1e4('0x20')](function(_0x1b6557){_0xca83d8[_0xc1e4('0x17')]=_0x1b6557;if(_0x4f0b10[_0xc1e4('0x2b')][_0xc1e4('0x3c')]){_0x575af6[_0xc1e4('0x3d')]=[{'all':!![]}];}return db['AnalyticMetric'][_0xc1e4('0x3e')](_0x575af6);})[_0xc1e4('0x20')](function(_0x1225a7){_0xca83d8[_0xc1e4('0x3f')]=_0x1225a7;return _0xca83d8;})[_0xc1e4('0x20')](respondWithFilteredResult(_0x29ca12,_0x575af6))['catch'](handleError(_0x29ca12,null));};exports[_0xc1e4('0x40')]=function(_0xd085a9,_0x2bb5f0){var _0xa5598c={'raw':!![],'where':{'id':_0xd085a9['params']['id']}},_0x1058a3={};_0x1058a3['model']=_[_0xc1e4('0x2c')](db['AnalyticMetric']['rawAttributes']);_0x1058a3[_0xc1e4('0x2b')]=_[_0xc1e4('0x2c')](_0xd085a9[_0xc1e4('0x2b')]);_0x1058a3[_0xc1e4('0x2d')]=_[_0xc1e4('0x2e')](_0x1058a3[_0xc1e4('0x2a')],_0x1058a3[_0xc1e4('0x2b')]);_0xa5598c[_0xc1e4('0x30')]=_['intersection'](_0x1058a3[_0xc1e4('0x2a')],qs['fields'](_0xd085a9[_0xc1e4('0x2b')][_0xc1e4('0x2f')]));_0xa5598c[_0xc1e4('0x30')]=_0xa5598c[_0xc1e4('0x30')][_0xc1e4('0x31')]?_0xa5598c[_0xc1e4('0x30')]:_0x1058a3[_0xc1e4('0x2a')];if(_0xd085a9['query'][_0xc1e4('0x3c')]){_0xa5598c[_0xc1e4('0x3d')]=[{'all':!![]}];}_0xa5598c=_[_0xc1e4('0x38')]({},_0xa5598c,_0xd085a9[_0xc1e4('0x3b')]);return db[_0xc1e4('0x25')][_0xc1e4('0x41')](_0xa5598c)[_0xc1e4('0x20')](handleEntityNotFound(_0x2bb5f0,null))[_0xc1e4('0x20')](respondWithResult(_0x2bb5f0,null))[_0xc1e4('0x42')](handleError(_0x2bb5f0,null));};exports[_0xc1e4('0x43')]=function(_0x26b66c,_0x515887){return db[_0xc1e4('0x25')][_0xc1e4('0x43')](_0x26b66c['body'],{})[_0xc1e4('0x20')](function(_0x42ad2f){var _0x4077f2=_0x26b66c[_0xc1e4('0x44')][_0xc1e4('0x45')]({'plain':!![]});if(!_0x4077f2)throw new Error(_0xc1e4('0x46'));if(_0x4077f2[_0xc1e4('0x47')]===_0xc1e4('0x44')){var _0x2d957f=_0x42ad2f[_0xc1e4('0x45')]({'plain':!![]});var _0x4b7a9d=_0xc1e4('0x48');return db[_0xc1e4('0x49')][_0xc1e4('0x41')]({'where':{'name':_0x4b7a9d,'userProfileId':_0x4077f2['userProfileId']},'raw':!![]})['then'](function(_0x2b4df8){if(_0x2b4df8&&_0x2b4df8[_0xc1e4('0x4a')]===0x0){return db[_0xc1e4('0x4b')][_0xc1e4('0x43')]({'name':_0x2d957f['name'],'resourceId':_0x2d957f['id'],'type':_0x2b4df8[_0xc1e4('0x22')],'sectionId':_0x2b4df8['id']},{})['then'](function(){return _0x42ad2f;});}else{return _0x42ad2f;}})[_0xc1e4('0x42')](function(_0x44bdeb){logger[_0xc1e4('0x4c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x44bdeb);throw _0x44bdeb;});}return _0x42ad2f;})[_0xc1e4('0x20')](respondWithResult(_0x515887,0xc9))['catch'](handleError(_0x515887,null));};exports[_0xc1e4('0x1e')]=function(_0x18405a,_0xedb24e){if(_0x18405a[_0xc1e4('0x4d')]['id']){delete _0x18405a[_0xc1e4('0x4d')]['id'];}return db[_0xc1e4('0x25')][_0xc1e4('0x41')]({'where':{'id':_0x18405a[_0xc1e4('0x4e')]['id']}})[_0xc1e4('0x20')](handleEntityNotFound(_0xedb24e,null))[_0xc1e4('0x20')](saveUpdates(_0x18405a[_0xc1e4('0x4d')],null))[_0xc1e4('0x20')](respondWithResult(_0xedb24e,null))[_0xc1e4('0x42')](handleError(_0xedb24e,null));};exports[_0xc1e4('0x1f')]=function(_0x50ea2b,_0x4ce85f){return db[_0xc1e4('0x25')][_0xc1e4('0x41')]({'where':{'id':_0x50ea2b['params']['id']}})[_0xc1e4('0x20')](handleEntityNotFound(_0x4ce85f,null))[_0xc1e4('0x20')](removeEntity(_0x4ce85f,null))['catch'](handleError(_0x4ce85f,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 755ff24..6607fd8 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 _0x8cae=['rimraf','../../config/environment','./analyticMetric.attributes','define','analytics_metrics','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x8cae,0x1cd));var _0xe8ca=function(_0x337a70,_0x53b0cb){_0x337a70=_0x337a70-0x0;var _0x89443a=_0x8cae[_0x337a70];return _0x89443a;};'use strict';var _=require(_0xe8ca('0x0'));var util=require(_0xe8ca('0x1'));var logger=require(_0xe8ca('0x2'))(_0xe8ca('0x3'));var moment=require('moment');var BPromise=require(_0xe8ca('0x4'));var rp=require(_0xe8ca('0x5'));var fs=require('fs');var path=require(_0xe8ca('0x6'));var rimraf=require(_0xe8ca('0x7'));var config=require(_0xe8ca('0x8'));var attributes=require(_0xe8ca('0x9'));module['exports']=function(_0x5f3efe,_0x4546a3){return _0x5f3efe[_0xe8ca('0xa')]('AnalyticMetric',attributes,{'tableName':_0xe8ca('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x98c4=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','lodash'];(function(_0x45f951,_0x2750c8){var _0x24756c=function(_0x31c931){while(--_0x31c931){_0x45f951['push'](_0x45f951['shift']());}};_0x24756c(++_0x2750c8);}(_0x98c4,0x6f));var _0x498c=function(_0x28cc79,_0x10fbb3){_0x28cc79=_0x28cc79-0x0;var _0x43d753=_0x98c4[_0x28cc79];return _0x43d753;};'use strict';var _=require(_0x498c('0x0'));var util=require(_0x498c('0x1'));var logger=require(_0x498c('0x2'))(_0x498c('0x3'));var moment=require(_0x498c('0x4'));var BPromise=require(_0x498c('0x5'));var rp=require(_0x498c('0x6'));var fs=require('fs');var path=require(_0x498c('0x7'));var rimraf=require(_0x498c('0x8'));var config=require(_0x498c('0x9'));var attributes=require(_0x498c('0xa'));module[_0x498c('0xb')]=function(_0x3492b9,_0x2d8f55){return _0x3492b9[_0x498c('0xc')](_0x498c('0xd'),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 05e2289..b4fe9de 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 _0xfd14=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','message','catch'];(function(_0x153c6a,_0x2a217a){var _0xce898f=function(_0x84c97c){while(--_0x84c97c){_0x153c6a['push'](_0x153c6a['shift']());}};_0xce898f(++_0x2a217a);}(_0xfd14,0x118));var _0x4fd1=function(_0x5a2d7a,_0x2fccc1){_0x5a2d7a=_0x5a2d7a-0x0;var _0x6b7e60=_0xfd14[_0x5a2d7a];return _0x6b7e60;};'use strict';var _=require('lodash');var util=require(_0x4fd1('0x0'));var moment=require(_0x4fd1('0x1'));var BPromise=require('bluebird');var rs=require(_0x4fd1('0x2'));var fs=require('fs');var Redis=require(_0x4fd1('0x3'));var db=require(_0x4fd1('0x4'))['db'];var utils=require(_0x4fd1('0x5'));var logger=require(_0x4fd1('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4fd1('0x7'));var client=jayson[_0x4fd1('0x8')][_0x4fd1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x59f37f,_0x5a5701,_0x158df2){return new BPromise(function(_0x4bea01,_0x1cd096){return client[_0x4fd1('0xa')](_0x59f37f,_0x158df2)[_0x4fd1('0xb')](function(_0x502aca){logger[_0x4fd1('0xc')](_0x4fd1('0xd'),_0x5a5701,_0x4fd1('0xe'));logger[_0x4fd1('0xf')](_0x4fd1('0x10'),_0x5a5701,'request\x20sent',JSON['stringify'](_0x502aca));if(_0x502aca[_0x4fd1('0x11')]){if(_0x502aca[_0x4fd1('0x11')]['code']===0x1f4){logger['error'](_0x4fd1('0xd'),_0x5a5701,_0x502aca[_0x4fd1('0x11')][_0x4fd1('0x12')]);return _0x1cd096(_0x502aca[_0x4fd1('0x11')][_0x4fd1('0x12')]);}logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x5a5701,_0x502aca[_0x4fd1('0x11')]['message']);return _0x4bea01(_0x502aca['error'][_0x4fd1('0x12')]);}else{logger['info'](_0x4fd1('0xd'),_0x5a5701,_0x4fd1('0xe'));_0x4bea01(_0x502aca['result'][_0x4fd1('0x12')]);}})[_0x4fd1('0x13')](function(_0x371c50){logger['error'](_0x4fd1('0xd'),_0x5a5701,_0x371c50);_0x1cd096(_0x371c50);});});} \ No newline at end of file +var _0xab34=['request\x20sent','error','code','message','AnalyticMetric,\x20%s,\x20%s','result','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s'];(function(_0x14e664,_0x41aa92){var _0x46acb3=function(_0x54b53f){while(--_0x54b53f){_0x14e664['push'](_0x14e664['shift']());}};_0x46acb3(++_0x41aa92);}(_0xab34,0x1bc));var _0x4ab3=function(_0x4bfabb,_0x213885){_0x4bfabb=_0x4bfabb-0x0;var _0x56cf62=_0xab34[_0x4bfabb];return _0x56cf62;};'use strict';var _=require('lodash');var util=require(_0x4ab3('0x0'));var moment=require(_0x4ab3('0x1'));var BPromise=require(_0x4ab3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4ab3('0x3'))['db'];var utils=require(_0x4ab3('0x4'));var logger=require(_0x4ab3('0x5'))(_0x4ab3('0x6'));var config=require(_0x4ab3('0x7'));var jayson=require(_0x4ab3('0x8'));var client=jayson[_0x4ab3('0x9')][_0x4ab3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5cdf4b,_0x58e8aa,_0xedd37){return new BPromise(function(_0x2cab97,_0x509a96){return client[_0x4ab3('0xb')](_0x5cdf4b,_0xedd37)[_0x4ab3('0xc')](function(_0x36008e){logger[_0x4ab3('0xd')]('AnalyticMetric,\x20%s,\x20%s',_0x58e8aa,'request\x20sent');logger[_0x4ab3('0xe')](_0x4ab3('0xf'),_0x58e8aa,_0x4ab3('0x10'),JSON['stringify'](_0x36008e));if(_0x36008e[_0x4ab3('0x11')]){if(_0x36008e[_0x4ab3('0x11')][_0x4ab3('0x12')]===0x1f4){logger[_0x4ab3('0x11')]('AnalyticMetric,\x20%s,\x20%s',_0x58e8aa,_0x36008e[_0x4ab3('0x11')]['message']);return _0x509a96(_0x36008e[_0x4ab3('0x11')][_0x4ab3('0x13')]);}logger[_0x4ab3('0x11')](_0x4ab3('0x14'),_0x58e8aa,_0x36008e[_0x4ab3('0x11')][_0x4ab3('0x13')]);return _0x2cab97(_0x36008e[_0x4ab3('0x11')]['message']);}else{logger[_0x4ab3('0xd')](_0x4ab3('0x14'),_0x58e8aa,_0x4ab3('0x10'));_0x2cab97(_0x36008e[_0x4ab3('0x15')][_0x4ab3('0x13')]);}})[_0x4ab3('0x16')](function(_0x1bead4){logger['error'](_0x4ab3('0x14'),_0x58e8aa,_0x1bead4);_0x509a96(_0x1bead4);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 95155b5..e6cb90d 100644 --- a/server/api/analyticMetric/index.js +++ b/server/api/analyticMetric/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6d38=['path','connect-timeout','../../components/auth/service','../../config/environment','./analyticMetric.controller','get','index','/:id','isAuthenticated','create','put','update','delete','destroy','exports','util'];(function(_0x276718,_0x37aaa9){var _0x3aa544=function(_0x2147fc){while(--_0x2147fc){_0x276718['push'](_0x276718['shift']());}};_0x3aa544(++_0x37aaa9);}(_0x6d38,0x1ef));var _0x86d3=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x6d38[_0x173441];return _0x2423a8;};'use strict';var multer=require('multer');var util=require(_0x86d3('0x0'));var path=require(_0x86d3('0x1'));var timeout=require(_0x86d3('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x86d3('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x86d3('0x4'));var controller=require(_0x86d3('0x5'));router[_0x86d3('0x6')]('/',auth['isAuthenticated'](),controller[_0x86d3('0x7')]);router[_0x86d3('0x6')](_0x86d3('0x8'),auth[_0x86d3('0x9')](),controller['show']);router['post']('/',auth[_0x86d3('0x9')](),controller[_0x86d3('0xa')]);router[_0x86d3('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x86d3('0xc')]);router[_0x86d3('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x86d3('0xe')]);module[_0x86d3('0xf')]=router; \ No newline at end of file +var _0x2ef3=['post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show'];(function(_0x20f65d,_0x50ce6f){var _0x43d016=function(_0x277a19){while(--_0x277a19){_0x20f65d['push'](_0x20f65d['shift']());}};_0x43d016(++_0x50ce6f);}(_0x2ef3,0xba));var _0x32ef=function(_0x143e6c,_0x294789){_0x143e6c=_0x143e6c-0x0;var _0x269909=_0x2ef3[_0x143e6c];return _0x269909;};'use strict';var multer=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var path=require(_0x32ef('0x2'));var timeout=require(_0x32ef('0x3'));var express=require(_0x32ef('0x4'));var router=express[_0x32ef('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x32ef('0x6'));var config=require(_0x32ef('0x7'));var controller=require('./analyticMetric.controller');router[_0x32ef('0x8')]('/',auth[_0x32ef('0x9')](),controller['index']);router['get'](_0x32ef('0xa'),auth[_0x32ef('0x9')](),controller[_0x32ef('0xb')]);router[_0x32ef('0xc')]('/',auth[_0x32ef('0x9')](),controller[_0x32ef('0xd')]);router[_0x32ef('0xe')](_0x32ef('0xa'),auth[_0x32ef('0x9')](),controller[_0x32ef('0xf')]);router['delete']('/:id',auth[_0x32ef('0x9')](),controller[_0x32ef('0x10')]);module[_0x32ef('0x11')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 1e7b294..2bfc235 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 _0xbfde=['TEXT','sequelize','exports'];(function(_0x5b4d06,_0x3edc8d){var _0xad4053=function(_0x1e2748){while(--_0x1e2748){_0x5b4d06['push'](_0x5b4d06['shift']());}};_0xad4053(++_0x3edc8d);}(_0xbfde,0x1c0));var _0xebfd=function(_0x5765eb,_0x5bd41b){_0x5765eb=_0x5765eb-0x0;var _0x15d2f5=_0xbfde[_0x5765eb];return _0x15d2f5;};'use strict';var Sequelize=require(_0xebfd('0x0'));module[_0xebfd('0x1')]={'tree':{'type':Sequelize[_0xebfd('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x9bc7=['sequelize','exports'];(function(_0x11c4b6,_0x572fdb){var _0x2cb405=function(_0xf12cc4){while(--_0xf12cc4){_0x11c4b6['push'](_0x11c4b6['shift']());}};_0x2cb405(++_0x572fdb);}(_0x9bc7,0x13a));var _0x79bc=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x9bc7[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0x79bc('0x0'));module[_0x79bc('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index 9b547bf..b20335b 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 _0x9b40=['include','find','create','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','lodash','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','Content-Range','apply','reject','save','update','then','stack','name','send','map','rawAttributes','fieldName','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','where','filters','pick','filter','type','VIRTUAL','field','merge','options','AnalyticTreeReport','findAll','rows','catch','show','params','includeAll'];(function(_0x4f1d8f,_0x2c2d01){var _0x101bcb=function(_0xf440e0){while(--_0xf440e0){_0x4f1d8f['push'](_0x4f1d8f['shift']());}};_0x101bcb(++_0x2c2d01);}(_0x9b40,0x99));var _0x09b4=function(_0x32864c,_0x1c9c83){_0x32864c=_0x32864c-0x0;var _0x4474e1=_0x9b40[_0x32864c];return _0x4474e1;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x09b4('0x0'));var zipdir=require(_0x09b4('0x1'));var jsonpatch=require(_0x09b4('0x2'));var rp=require(_0x09b4('0x3'));var moment=require(_0x09b4('0x4'));var BPromise=require(_0x09b4('0x5'));var Mustache=require('mustache');var util=require(_0x09b4('0x6'));var path=require(_0x09b4('0x7'));var sox=require(_0x09b4('0x8'));var csv=require('to-csv');var ejs=require(_0x09b4('0x9'));var fs=require('fs');var _=require(_0x09b4('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x09b4('0xb'));var toCsv=require(_0x09b4('0xc'));var querystring=require(_0x09b4('0xd'));var Papa=require(_0x09b4('0xe'));var Redis=require(_0x09b4('0xf'));var authService=require(_0x09b4('0x10'));var qs=require(_0x09b4('0x11'));var as=require(_0x09b4('0x12'));var hardwareService=require(_0x09b4('0x13'));var logger=require(_0x09b4('0x14'))('api');var utils=require(_0x09b4('0x15'));var config=require(_0x09b4('0x16'));var db=require(_0x09b4('0x17'))['db'];function respondWithStatusCode(_0x264e65,_0x187cef){_0x187cef=_0x187cef||0xcc;return function(_0x432d7a){if(_0x432d7a){return _0x264e65[_0x09b4('0x18')](_0x187cef);}return _0x264e65['status'](_0x187cef)[_0x09b4('0x19')]();};}function respondWithResult(_0x1221e6,_0x44c5b0){_0x44c5b0=_0x44c5b0||0xc8;return function(_0x357b44){if(_0x357b44){return _0x1221e6[_0x09b4('0x1a')](_0x44c5b0)[_0x09b4('0x1b')](_0x357b44);}};}function respondWithFilteredResult(_0x3aadb9,_0x15317f){return function(_0x1cde50){if(_0x1cde50){var _0x579825=_0x1cde50[_0x09b4('0x1c')],_0x3920e3=_0x15317f['offset'],_0x8c1e84=_0x15317f[_0x09b4('0x1d')]+_0x15317f[_0x09b4('0x1e')],_0x5b0669;if(_0x8c1e84>=_0x579825){_0x8c1e84=_0x579825;_0x5b0669=0xc8;}else{_0x5b0669=0xce;}_0x3aadb9[_0x09b4('0x1a')](_0x5b0669);return _0x3aadb9['set'](_0x09b4('0x1f'),_0x3920e3+'-'+_0x8c1e84+'/'+_0x579825)[_0x09b4('0x1b')](_0x1cde50);}return null;};}function patchUpdates(_0x1edf7a){return function(_0x10d3a0){try{jsonpatch[_0x09b4('0x20')](_0x10d3a0,_0x1edf7a,!![]);}catch(_0x2adea2){return BPromise[_0x09b4('0x21')](_0x2adea2);}return _0x10d3a0[_0x09b4('0x22')]();};}function saveUpdates(_0x2e3aff,_0x4f7ebb){return function(_0x5b0e2e){if(_0x5b0e2e){return _0x5b0e2e[_0x09b4('0x23')](_0x2e3aff)[_0x09b4('0x24')](function(_0x3391d3){return _0x3391d3;});}return null;};}function removeEntity(_0x680a6c,_0x44f6e2){return function(_0x341d3a){if(_0x341d3a){return _0x341d3a['destroy']()[_0x09b4('0x24')](function(){_0x680a6c[_0x09b4('0x1a')](0xcc)[_0x09b4('0x19')]();});}};}function handleEntityNotFound(_0x66f99d,_0x4eb374){return function(_0x4b81cc){if(!_0x4b81cc){_0x66f99d[_0x09b4('0x18')](0x194);}return _0x4b81cc;};}function handleError(_0x30fc6a,_0x55fce1){_0x55fce1=_0x55fce1||0x1f4;return function(_0xc28df1){logger['error'](_0xc28df1[_0x09b4('0x25')]);if(_0xc28df1['name']){delete _0xc28df1[_0x09b4('0x26')];}_0x30fc6a[_0x09b4('0x1a')](_0x55fce1)[_0x09b4('0x27')](_0xc28df1);};}exports['index']=function(_0x479541,_0x2ac7da){var _0x2d20b3={},_0x509ed9={},_0x5b417f={'count':0x0,'rows':[]};var _0x3fe3ba=_[_0x09b4('0x28')](db['AnalyticTreeReport'][_0x09b4('0x29')],function(_0x49c074){return{'name':_0x49c074[_0x09b4('0x2a')],'type':_0x49c074['type']['key']};});_0x509ed9['model']=_[_0x09b4('0x28')](_0x3fe3ba,'name');_0x509ed9[_0x09b4('0x2b')]=_[_0x09b4('0x2c')](_0x479541[_0x09b4('0x2b')]);_0x509ed9['filters']=_[_0x09b4('0x2d')](_0x509ed9[_0x09b4('0x2e')],_0x509ed9[_0x09b4('0x2b')]);_0x2d20b3['attributes']=_[_0x09b4('0x2d')](_0x509ed9['model'],qs['fields'](_0x479541[_0x09b4('0x2b')][_0x09b4('0x2f')]));_0x2d20b3['attributes']=_0x2d20b3[_0x09b4('0x30')][_0x09b4('0x31')]?_0x2d20b3[_0x09b4('0x30')]:_0x509ed9[_0x09b4('0x2e')];if(!_0x479541[_0x09b4('0x2b')][_0x09b4('0x32')](_0x09b4('0x33'))){_0x2d20b3[_0x09b4('0x1e')]=qs[_0x09b4('0x1e')](_0x479541[_0x09b4('0x2b')][_0x09b4('0x1e')]);_0x2d20b3[_0x09b4('0x1d')]=qs[_0x09b4('0x1d')](_0x479541[_0x09b4('0x2b')][_0x09b4('0x1d')]);}_0x2d20b3[_0x09b4('0x34')]=qs['sort'](_0x479541[_0x09b4('0x2b')]['sort']);_0x2d20b3[_0x09b4('0x35')]=qs[_0x09b4('0x36')](_[_0x09b4('0x37')](_0x479541[_0x09b4('0x2b')],_0x509ed9[_0x09b4('0x36')]));if(_0x479541[_0x09b4('0x2b')][_0x09b4('0x38')]){_0x2d20b3[_0x09b4('0x35')]=_['merge'](_0x2d20b3[_0x09b4('0x35')],{'$or':_[_0x09b4('0x28')](_0x3fe3ba,function(_0x2bd612){if(_0x2bd612[_0x09b4('0x39')]['key']!==_0x09b4('0x3a')){var _0x528705={};_0x528705[_0x2bd612[_0x09b4('0x3b')]]={'$like':'%'+_0x479541[_0x09b4('0x2b')][_0x09b4('0x38')]+'%'};return _0x528705;}})});}_0x2d20b3=_[_0x09b4('0x3c')]({},_0x2d20b3,_0x479541[_0x09b4('0x3d')]);var _0x11c46e={'where':_0x2d20b3[_0x09b4('0x35')]};return db[_0x09b4('0x3e')]['count'](_0x11c46e)['then'](function(_0x406aff){_0x5b417f[_0x09b4('0x1c')]=_0x406aff;if(_0x479541[_0x09b4('0x2b')]['includeAll']){_0x2d20b3['include']=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x09b4('0x3f')](_0x2d20b3);})[_0x09b4('0x24')](function(_0x502d7d){_0x5b417f[_0x09b4('0x40')]=_0x502d7d;return _0x5b417f;})['then'](respondWithFilteredResult(_0x2ac7da,_0x2d20b3))[_0x09b4('0x41')](handleError(_0x2ac7da,null));};exports[_0x09b4('0x42')]=function(_0x36e2a0,_0x39920d){var _0x316def={'raw':!![],'where':{'id':_0x36e2a0[_0x09b4('0x43')]['id']}},_0x1941be={};_0x1941be[_0x09b4('0x2e')]=_[_0x09b4('0x2c')](db['AnalyticTreeReport'][_0x09b4('0x29')]);_0x1941be[_0x09b4('0x2b')]=_[_0x09b4('0x2c')](_0x36e2a0['query']);_0x1941be[_0x09b4('0x36')]=_[_0x09b4('0x2d')](_0x1941be['model'],_0x1941be[_0x09b4('0x2b')]);_0x316def[_0x09b4('0x30')]=_[_0x09b4('0x2d')](_0x1941be[_0x09b4('0x2e')],qs[_0x09b4('0x2f')](_0x36e2a0[_0x09b4('0x2b')][_0x09b4('0x2f')]));_0x316def['attributes']=_0x316def[_0x09b4('0x30')]['length']?_0x316def['attributes']:_0x1941be[_0x09b4('0x2e')];if(_0x36e2a0[_0x09b4('0x2b')][_0x09b4('0x44')]){_0x316def[_0x09b4('0x45')]=[{'all':!![]}];}_0x316def=_['merge']({},_0x316def,_0x36e2a0[_0x09b4('0x3d')]);return db[_0x09b4('0x3e')][_0x09b4('0x46')](_0x316def)[_0x09b4('0x24')](handleEntityNotFound(_0x39920d,null))[_0x09b4('0x24')](respondWithResult(_0x39920d,null))[_0x09b4('0x41')](handleError(_0x39920d,null));};exports['create']=function(_0x57ac71,_0x186063){return db[_0x09b4('0x3e')][_0x09b4('0x47')](_0x57ac71[_0x09b4('0x48')],{})[_0x09b4('0x24')](respondWithResult(_0x186063,0xc9))[_0x09b4('0x41')](handleError(_0x186063,null));};exports[_0x09b4('0x23')]=function(_0x3194a7,_0x4e2d63){if(_0x3194a7[_0x09b4('0x48')]['id']){delete _0x3194a7['body']['id'];}return db[_0x09b4('0x3e')][_0x09b4('0x46')]({'where':{'id':_0x3194a7[_0x09b4('0x43')]['id']}})[_0x09b4('0x24')](handleEntityNotFound(_0x4e2d63,null))['then'](saveUpdates(_0x3194a7['body'],null))[_0x09b4('0x24')](respondWithResult(_0x4e2d63,null))[_0x09b4('0x41')](handleError(_0x4e2d63,null));};exports[_0x09b4('0x49')]=function(_0x289ebc,_0x4f1f3d){return db['AnalyticTreeReport']['find']({'where':{'id':_0x289ebc[_0x09b4('0x43')]['id']}})[_0x09b4('0x24')](handleEntityNotFound(_0x4f1f3d,null))[_0x09b4('0x24')](removeEntity(_0x4f1f3d,null))[_0x09b4('0x41')](handleError(_0x4f1f3d,null));}; \ No newline at end of file +var _0x6302=['filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','sort','where','pick','merge','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','update','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','count','set','json','apply','save','then','destroy','error','stack','name','status','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','query','keys'];(function(_0x4adb31,_0x26d680){var _0x5a1626=function(_0xfcd7ed){while(--_0xfcd7ed){_0x4adb31['push'](_0x4adb31['shift']());}};_0x5a1626(++_0x26d680);}(_0x6302,0x1dd));var _0x2630=function(_0x4b1765,_0x32c633){_0x4b1765=_0x4b1765-0x0;var _0x59e11b=_0x6302[_0x4b1765];return _0x59e11b;};'use strict';var pdf=require(_0x2630('0x0'));var emlformat=require(_0x2630('0x1'));var rimraf=require(_0x2630('0x2'));var zipdir=require(_0x2630('0x3'));var jsonpatch=require(_0x2630('0x4'));var rp=require(_0x2630('0x5'));var moment=require(_0x2630('0x6'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2630('0x7'));var path=require(_0x2630('0x8'));var sox=require(_0x2630('0x9'));var csv=require(_0x2630('0xa'));var ejs=require(_0x2630('0xb'));var fs=require('fs');var _=require(_0x2630('0xc'));var squel=require('squel');var crypto=require(_0x2630('0xd'));var jsforce=require(_0x2630('0xe'));var deskjs=require(_0x2630('0xf'));var toCsv=require(_0x2630('0xa'));var querystring=require('querystring');var Papa=require(_0x2630('0x10'));var Redis=require(_0x2630('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x2630('0x12'));var as=require(_0x2630('0x13'));var hardwareService=require(_0x2630('0x14'));var logger=require(_0x2630('0x15'))('api');var utils=require(_0x2630('0x16'));var config=require(_0x2630('0x17'));var db=require(_0x2630('0x18'))['db'];function respondWithStatusCode(_0x345962,_0x154f78){_0x154f78=_0x154f78||0xcc;return function(_0x47e700){if(_0x47e700){return _0x345962[_0x2630('0x19')](_0x154f78);}return _0x345962['status'](_0x154f78)[_0x2630('0x1a')]();};}function respondWithResult(_0x2b0d93,_0x2616fd){_0x2616fd=_0x2616fd||0xc8;return function(_0xc1af33){if(_0xc1af33){return _0x2b0d93['status'](_0x2616fd)['json'](_0xc1af33);}};}function respondWithFilteredResult(_0x16c7cd,_0x44fd67){return function(_0x4f1d85){if(_0x4f1d85){var _0x5d63ff=_0x4f1d85[_0x2630('0x1b')],_0x588ed7=_0x44fd67['offset'],_0x5c92c4=_0x44fd67['offset']+_0x44fd67['limit'],_0x954eb5;if(_0x5c92c4>=_0x5d63ff){_0x5c92c4=_0x5d63ff;_0x954eb5=0xc8;}else{_0x954eb5=0xce;}_0x16c7cd['status'](_0x954eb5);return _0x16c7cd[_0x2630('0x1c')]('Content-Range',_0x588ed7+'-'+_0x5c92c4+'/'+_0x5d63ff)[_0x2630('0x1d')](_0x4f1d85);}return null;};}function patchUpdates(_0x44081f){return function(_0x36e03a){try{jsonpatch[_0x2630('0x1e')](_0x36e03a,_0x44081f,!![]);}catch(_0x1e312a){return BPromise['reject'](_0x1e312a);}return _0x36e03a[_0x2630('0x1f')]();};}function saveUpdates(_0x40eefe,_0x2f5095){return function(_0x28ca01){if(_0x28ca01){return _0x28ca01['update'](_0x40eefe)[_0x2630('0x20')](function(_0xd3ee1d){return _0xd3ee1d;});}return null;};}function removeEntity(_0x36cae3,_0x9c2a75){return function(_0x5967b7){if(_0x5967b7){return _0x5967b7[_0x2630('0x21')]()['then'](function(){_0x36cae3['status'](0xcc)[_0x2630('0x1a')]();});}};}function handleEntityNotFound(_0x160fbe,_0x19491a){return function(_0x477e6a){if(!_0x477e6a){_0x160fbe[_0x2630('0x19')](0x194);}return _0x477e6a;};}function handleError(_0x3f77b7,_0x2abf32){_0x2abf32=_0x2abf32||0x1f4;return function(_0x4e3a3e){logger[_0x2630('0x22')](_0x4e3a3e[_0x2630('0x23')]);if(_0x4e3a3e[_0x2630('0x24')]){delete _0x4e3a3e[_0x2630('0x24')];}_0x3f77b7[_0x2630('0x25')](_0x2abf32)[_0x2630('0x26')](_0x4e3a3e);};}exports[_0x2630('0x27')]=function(_0x1007a1,_0xc4a8b1){var _0x5862d6={},_0xf57393={},_0x30a6a6={'count':0x0,'rows':[]};var _0x55aabb=_[_0x2630('0x28')](db[_0x2630('0x29')][_0x2630('0x2a')],function(_0x572608){return{'name':_0x572608[_0x2630('0x2b')],'type':_0x572608[_0x2630('0x2c')][_0x2630('0x2d')]};});_0xf57393['model']=_['map'](_0x55aabb,_0x2630('0x24'));_0xf57393[_0x2630('0x2e')]=_[_0x2630('0x2f')](_0x1007a1['query']);_0xf57393[_0x2630('0x30')]=_[_0x2630('0x31')](_0xf57393[_0x2630('0x32')],_0xf57393['query']);_0x5862d6[_0x2630('0x33')]=_[_0x2630('0x31')](_0xf57393[_0x2630('0x32')],qs[_0x2630('0x34')](_0x1007a1[_0x2630('0x2e')][_0x2630('0x34')]));_0x5862d6[_0x2630('0x33')]=_0x5862d6[_0x2630('0x33')]['length']?_0x5862d6['attributes']:_0xf57393[_0x2630('0x32')];if(!_0x1007a1[_0x2630('0x2e')][_0x2630('0x35')](_0x2630('0x36'))){_0x5862d6[_0x2630('0x37')]=qs[_0x2630('0x37')](_0x1007a1[_0x2630('0x2e')][_0x2630('0x37')]);_0x5862d6[_0x2630('0x38')]=qs[_0x2630('0x38')](_0x1007a1[_0x2630('0x2e')][_0x2630('0x38')]);}_0x5862d6[_0x2630('0x39')]=qs['sort'](_0x1007a1[_0x2630('0x2e')][_0x2630('0x3a')]);_0x5862d6[_0x2630('0x3b')]=qs['filters'](_[_0x2630('0x3c')](_0x1007a1[_0x2630('0x2e')],_0xf57393[_0x2630('0x30')]));if(_0x1007a1[_0x2630('0x2e')]['filter']){_0x5862d6['where']=_[_0x2630('0x3d')](_0x5862d6[_0x2630('0x3b')],{'$or':_['map'](_0x55aabb,function(_0x95fed0){if(_0x95fed0['type'][_0x2630('0x2d')]!=='VIRTUAL'){var _0x27146c={};_0x27146c[_0x95fed0['field']]={'$like':'%'+_0x1007a1[_0x2630('0x2e')]['filter']+'%'};return _0x27146c;}})});}_0x5862d6=_[_0x2630('0x3d')]({},_0x5862d6,_0x1007a1[_0x2630('0x3e')]);var _0x52c5d9={'where':_0x5862d6[_0x2630('0x3b')]};return db['AnalyticTreeReport'][_0x2630('0x1b')](_0x52c5d9)['then'](function(_0x5ed9dc){_0x30a6a6['count']=_0x5ed9dc;if(_0x1007a1['query'][_0x2630('0x3f')]){_0x5862d6[_0x2630('0x40')]=[{'all':!![]}];}return db[_0x2630('0x29')][_0x2630('0x41')](_0x5862d6);})[_0x2630('0x20')](function(_0x4bb469){_0x30a6a6[_0x2630('0x42')]=_0x4bb469;return _0x30a6a6;})[_0x2630('0x20')](respondWithFilteredResult(_0xc4a8b1,_0x5862d6))[_0x2630('0x43')](handleError(_0xc4a8b1,null));};exports[_0x2630('0x44')]=function(_0x5a6b1e,_0x5157f5){var _0x4aa7ec={'raw':!![],'where':{'id':_0x5a6b1e[_0x2630('0x45')]['id']}},_0x3beadc={};_0x3beadc[_0x2630('0x32')]=_[_0x2630('0x2f')](db[_0x2630('0x29')][_0x2630('0x2a')]);_0x3beadc['query']=_[_0x2630('0x2f')](_0x5a6b1e[_0x2630('0x2e')]);_0x3beadc['filters']=_[_0x2630('0x31')](_0x3beadc['model'],_0x3beadc[_0x2630('0x2e')]);_0x4aa7ec[_0x2630('0x33')]=_[_0x2630('0x31')](_0x3beadc[_0x2630('0x32')],qs[_0x2630('0x34')](_0x5a6b1e[_0x2630('0x2e')][_0x2630('0x34')]));_0x4aa7ec[_0x2630('0x33')]=_0x4aa7ec[_0x2630('0x33')][_0x2630('0x46')]?_0x4aa7ec[_0x2630('0x33')]:_0x3beadc['model'];if(_0x5a6b1e[_0x2630('0x2e')][_0x2630('0x3f')]){_0x4aa7ec[_0x2630('0x40')]=[{'all':!![]}];}_0x4aa7ec=_[_0x2630('0x3d')]({},_0x4aa7ec,_0x5a6b1e[_0x2630('0x3e')]);return db[_0x2630('0x29')][_0x2630('0x47')](_0x4aa7ec)[_0x2630('0x20')](handleEntityNotFound(_0x5157f5,null))[_0x2630('0x20')](respondWithResult(_0x5157f5,null))[_0x2630('0x43')](handleError(_0x5157f5,null));};exports[_0x2630('0x48')]=function(_0xae8b4b,_0x9f2f3a){return db[_0x2630('0x29')]['create'](_0xae8b4b[_0x2630('0x49')],{})[_0x2630('0x20')](respondWithResult(_0x9f2f3a,0xc9))[_0x2630('0x43')](handleError(_0x9f2f3a,null));};exports[_0x2630('0x4a')]=function(_0x2569c2,_0x4e9be6){if(_0x2569c2[_0x2630('0x49')]['id']){delete _0x2569c2['body']['id'];}return db['AnalyticTreeReport'][_0x2630('0x47')]({'where':{'id':_0x2569c2[_0x2630('0x45')]['id']}})[_0x2630('0x20')](handleEntityNotFound(_0x4e9be6,null))['then'](saveUpdates(_0x2569c2[_0x2630('0x49')],null))[_0x2630('0x20')](respondWithResult(_0x4e9be6,null))['catch'](handleError(_0x4e9be6,null));};exports[_0x2630('0x21')]=function(_0x59df6f,_0x2d9a70){return db[_0x2630('0x29')]['find']({'where':{'id':_0x59df6f[_0x2630('0x45')]['id']}})[_0x2630('0x20')](handleEntityNotFound(_0x2d9a70,null))[_0x2630('0x20')](removeEntity(_0x2d9a70,null))['catch'](handleError(_0x2d9a70,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 7669d96..df92cfe 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 _0x8a9a=['rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','analytics_report_trees','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x208442,_0x11d2ba){var _0xd24f10=function(_0x27a184){while(--_0x27a184){_0x208442['push'](_0x208442['shift']());}};_0xd24f10(++_0x11d2ba);}(_0x8a9a,0x17f));var _0xa8a9=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x8a9a[_0x13e741];return _0x3f8bb3;};'use strict';var _=require('lodash');var util=require(_0xa8a9('0x0'));var logger=require(_0xa8a9('0x1'))(_0xa8a9('0x2'));var moment=require(_0xa8a9('0x3'));var BPromise=require(_0xa8a9('0x4'));var rp=require(_0xa8a9('0x5'));var fs=require('fs');var path=require(_0xa8a9('0x6'));var rimraf=require(_0xa8a9('0x7'));var config=require(_0xa8a9('0x8'));var attributes=require(_0xa8a9('0x9'));module[_0xa8a9('0xa')]=function(_0x1de1c6,_0x4ac303){return _0x1de1c6[_0xa8a9('0xb')]('AnalyticTreeReport',attributes,{'tableName':_0xa8a9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xac6a=['util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash'];(function(_0x517bb2,_0x601ecb){var _0x479ff8=function(_0x216995){while(--_0x216995){_0x517bb2['push'](_0x517bb2['shift']());}};_0x479ff8(++_0x601ecb);}(_0xac6a,0xc2));var _0xaac6=function(_0x178a22,_0x2b6e80){_0x178a22=_0x178a22-0x0;var _0xc6e11e=_0xac6a[_0x178a22];return _0xc6e11e;};'use strict';var _=require(_0xaac6('0x0'));var util=require(_0xaac6('0x1'));var logger=require(_0xaac6('0x2'))(_0xaac6('0x3'));var moment=require(_0xaac6('0x4'));var BPromise=require('bluebird');var rp=require(_0xaac6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaac6('0x6'));var config=require(_0xaac6('0x7'));var attributes=require(_0xaac6('0x8'));module[_0xaac6('0x9')]=function(_0xd8f178,_0x1cec82){return _0xd8f178[_0xaac6('0xa')](_0xaac6('0xb'),attributes,{'tableName':_0xaac6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js index 348e682..7fbead1 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 _0x5030=['client','http','request','info','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','AnalyticTreeReport,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x153699,_0xa793f0){var _0x495a32=function(_0x5f04c6){while(--_0x5f04c6){_0x153699['push'](_0x153699['shift']());}};_0x495a32(++_0xa793f0);}(_0x5030,0x156));var _0x0503=function(_0x9ad1e1,_0x375db7){_0x9ad1e1=_0x9ad1e1-0x0;var _0x5da13d=_0x5030[_0x9ad1e1];return _0x5da13d;};'use strict';var _=require(_0x0503('0x0'));var util=require(_0x0503('0x1'));var moment=require(_0x0503('0x2'));var BPromise=require(_0x0503('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0503('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0503('0x5'));var logger=require(_0x0503('0x6'))(_0x0503('0x7'));var config=require(_0x0503('0x8'));var jayson=require(_0x0503('0x9'));var client=jayson[_0x0503('0xa')][_0x0503('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x46243d,_0x5b91c7,_0x2423ac){return new BPromise(function(_0x1fa3c1,_0x25696d){return client[_0x0503('0xc')](_0x46243d,_0x2423ac)['then'](function(_0xd99dd4){logger[_0x0503('0xd')]('AnalyticTreeReport,\x20%s,\x20%s',_0x5b91c7,'request\x20sent');logger['debug'](_0x0503('0xe'),_0x5b91c7,_0x0503('0xf'),JSON[_0x0503('0x10')](_0xd99dd4));if(_0xd99dd4['error']){if(_0xd99dd4[_0x0503('0x11')][_0x0503('0x12')]===0x1f4){logger['error'](_0x0503('0x13'),_0x5b91c7,_0xd99dd4[_0x0503('0x11')][_0x0503('0x14')]);return _0x25696d(_0xd99dd4[_0x0503('0x11')][_0x0503('0x14')]);}logger[_0x0503('0x11')](_0x0503('0x13'),_0x5b91c7,_0xd99dd4[_0x0503('0x11')][_0x0503('0x14')]);return _0x1fa3c1(_0xd99dd4[_0x0503('0x11')]['message']);}else{logger[_0x0503('0xd')](_0x0503('0x13'),_0x5b91c7,_0x0503('0xf'));_0x1fa3c1(_0xd99dd4[_0x0503('0x15')]['message']);}})['catch'](function(_0xe5af82){logger[_0x0503('0x11')](_0x0503('0x13'),_0x5b91c7,_0xe5af82);_0x25696d(_0xe5af82);});});} \ No newline at end of file +var _0xd9e4=['../../config/utils','rpc','jayson/promise','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','lodash','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd9e4,0x174));var _0x4d9e=function(_0x495054,_0x304104){_0x495054=_0x495054-0x0;var _0x146d2e=_0xd9e4[_0x495054];return _0x146d2e;};'use strict';var _=require(_0x4d9e('0x0'));var util=require('util');var moment=require(_0x4d9e('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4d9e('0x2'));var logger=require('../../config/logger')(_0x4d9e('0x3'));var config=require('../../config/environment');var jayson=require(_0x4d9e('0x4'));var client=jayson['client'][_0x4d9e('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x46c4e7,_0x2bf4ef,_0x5c0d8f){return new BPromise(function(_0x36bb68,_0x7e3794){return client[_0x4d9e('0x6')](_0x46c4e7,_0x5c0d8f)[_0x4d9e('0x7')](function(_0x555cbc){logger[_0x4d9e('0x8')](_0x4d9e('0x9'),_0x2bf4ef,'request\x20sent');logger[_0x4d9e('0xa')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x2bf4ef,_0x4d9e('0xb'),JSON[_0x4d9e('0xc')](_0x555cbc));if(_0x555cbc[_0x4d9e('0xd')]){if(_0x555cbc[_0x4d9e('0xd')]['code']===0x1f4){logger[_0x4d9e('0xd')](_0x4d9e('0x9'),_0x2bf4ef,_0x555cbc[_0x4d9e('0xd')][_0x4d9e('0xe')]);return _0x7e3794(_0x555cbc[_0x4d9e('0xd')][_0x4d9e('0xe')]);}logger['error'](_0x4d9e('0x9'),_0x2bf4ef,_0x555cbc[_0x4d9e('0xd')][_0x4d9e('0xe')]);return _0x36bb68(_0x555cbc[_0x4d9e('0xd')][_0x4d9e('0xe')]);}else{logger[_0x4d9e('0x8')](_0x4d9e('0x9'),_0x2bf4ef,_0x4d9e('0xb'));_0x36bb68(_0x555cbc[_0x4d9e('0xf')][_0x4d9e('0xe')]);}})[_0x4d9e('0x10')](function(_0xc03324){logger[_0x4d9e('0xd')]('AnalyticTreeReport,\x20%s,\x20%s',_0x2bf4ef,_0xc03324);_0x7e3794(_0xc03324);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index bd05ad7..de5fec2 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 _0xc3e3=['../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','create','update','delete','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0xfa634c,_0x414e0e){var _0x73e478=function(_0xac2a51){while(--_0xac2a51){_0xfa634c['push'](_0xfa634c['shift']());}};_0x73e478(++_0x414e0e);}(_0xc3e3,0xea));var _0x3c3e=function(_0x1a0dcb,_0x36a473){_0x1a0dcb=_0x1a0dcb-0x0;var _0x1f8cec=_0xc3e3[_0x1a0dcb];return _0x1f8cec;};'use strict';var multer=require(_0x3c3e('0x0'));var util=require(_0x3c3e('0x1'));var path=require(_0x3c3e('0x2'));var timeout=require(_0x3c3e('0x3'));var express=require(_0x3c3e('0x4'));var router=express[_0x3c3e('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3c3e('0x6'));var controller=require(_0x3c3e('0x7'));router[_0x3c3e('0x8')]('/',auth[_0x3c3e('0x9')](),controller[_0x3c3e('0xa')]);router[_0x3c3e('0x8')](_0x3c3e('0xb'),auth[_0x3c3e('0x9')](),controller['show']);router['post']('/',auth[_0x3c3e('0x9')](),controller[_0x3c3e('0xc')]);router['put'](_0x3c3e('0xb'),auth[_0x3c3e('0x9')](),controller[_0x3c3e('0xd')]);router[_0x3c3e('0xe')](_0x3c3e('0xb'),auth['isAuthenticated'](),controller[_0x3c3e('0xf')]);module['exports']=router; \ No newline at end of file +var _0xc2fc=['post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated'];(function(_0x311d76,_0x1b12e9){var _0x2dbddf=function(_0x5969a5){while(--_0x5969a5){_0x311d76['push'](_0x311d76['shift']());}};_0x2dbddf(++_0x1b12e9);}(_0xc2fc,0x1ed));var _0xcc2f=function(_0x3c4818,_0x4e3df6){_0x3c4818=_0x3c4818-0x0;var _0x23ef09=_0xc2fc[_0x3c4818];return _0x23ef09;};'use strict';var multer=require('multer');var util=require(_0xcc2f('0x0'));var path=require(_0xcc2f('0x1'));var timeout=require(_0xcc2f('0x2'));var express=require(_0xcc2f('0x3'));var router=express[_0xcc2f('0x4')]();var auth=require(_0xcc2f('0x5'));var interaction=require(_0xcc2f('0x6'));var config=require('../../config/environment');var controller=require('./analyticTreeReport.controller');router[_0xcc2f('0x7')]('/',auth['isAuthenticated'](),controller[_0xcc2f('0x8')]);router[_0xcc2f('0x7')](_0xcc2f('0x9'),auth[_0xcc2f('0xa')](),controller['show']);router[_0xcc2f('0xb')]('/',auth['isAuthenticated'](),controller[_0xcc2f('0xc')]);router[_0xcc2f('0xd')](_0xcc2f('0x9'),auth[_0xcc2f('0xa')](),controller[_0xcc2f('0xe')]);router[_0xcc2f('0xf')](_0xcc2f('0x9'),auth['isAuthenticated'](),controller[_0xcc2f('0x10')]);module[_0xcc2f('0x11')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index cbe18ac..b9c67e0 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 _0x020c=['exports','STRING'];(function(_0x4611bb,_0x16f2a7){var _0x4ab34a=function(_0x2f28c6){while(--_0x2f28c6){_0x4611bb['push'](_0x4611bb['shift']());}};_0x4ab34a(++_0x16f2a7);}(_0x020c,0x92));var _0xc020=function(_0x1f4742,_0x339395){_0x1f4742=_0x1f4742-0x0;var _0x123cb6=_0x020c[_0x1f4742];return _0x123cb6;};'use strict';var Sequelize=require('sequelize');module[_0xc020('0x0')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0xc020('0x1')]},'type':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6a70=['STRING','exports'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0x6a70,0x77));var _0x06a7=function(_0x18b195,_0x5d1e77){_0x18b195=_0x18b195-0x0;var _0x424153=_0x6a70[_0x18b195];return _0x424153;};'use strict';var Sequelize=require('sequelize');module[_0x06a7('0x0')]={'name':{'type':Sequelize[_0x06a7('0x1')]},'basename':{'type':Sequelize[_0x06a7('0x1')]},'type':{'type':Sequelize[_0x06a7('0x1')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 9a2ebb6..4ceaa22 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 _0x7868=['type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','field','merge','options','count','includeAll','findAll','catch','rawAttributes','include','body','find','create','file','basename','filename','findOne','params','download','join','root','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','end','offset','limit','status','apply','reject','save','update','then','destroy','sendStatus','error','name','index','map','Attachment'];(function(_0x319855,_0x55a20d){var _0xfb7f50=function(_0x391c7f){while(--_0x391c7f){_0x319855['push'](_0x319855['shift']());}};_0xfb7f50(++_0x55a20d);}(_0x7868,0x73));var _0x8786=function(_0x5949e5,_0x374ec8){_0x5949e5=_0x5949e5-0x0;var _0x3b0773=_0x7868[_0x5949e5];return _0x3b0773;};'use strict';var pdf=require(_0x8786('0x0'));var emlformat=require(_0x8786('0x1'));var rimraf=require(_0x8786('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8786('0x3'));var rp=require(_0x8786('0x4'));var moment=require(_0x8786('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8786('0x6'));var util=require(_0x8786('0x7'));var path=require(_0x8786('0x8'));var sox=require(_0x8786('0x9'));var csv=require('to-csv');var ejs=require(_0x8786('0xa'));var fs=require('fs');var _=require(_0x8786('0xb'));var squel=require('squel');var crypto=require(_0x8786('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8786('0xd'));var querystring=require(_0x8786('0xe'));var Papa=require(_0x8786('0xf'));var Redis=require(_0x8786('0x10'));var authService=require(_0x8786('0x11'));var qs=require(_0x8786('0x12'));var as=require(_0x8786('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8786('0x14'))(_0x8786('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x8786('0x16'))['db'];function respondWithStatusCode(_0x207e46,_0x2653a2){_0x2653a2=_0x2653a2||0xcc;return function(_0x52c2ac){if(_0x52c2ac){return _0x207e46['sendStatus'](_0x2653a2);}return _0x207e46['status'](_0x2653a2)[_0x8786('0x17')]();};}function respondWithResult(_0xe3ab90,_0x19bdda){_0x19bdda=_0x19bdda||0xc8;return function(_0x27a721){if(_0x27a721){return _0xe3ab90['status'](_0x19bdda)['json'](_0x27a721);}};}function respondWithFilteredResult(_0x557564,_0x1034cb){return function(_0x531b82){if(_0x531b82){var _0x36512d=_0x531b82['count'],_0x200d65=_0x1034cb[_0x8786('0x18')],_0x17a7e1=_0x1034cb[_0x8786('0x18')]+_0x1034cb[_0x8786('0x19')],_0x4e918d;if(_0x17a7e1>=_0x36512d){_0x17a7e1=_0x36512d;_0x4e918d=0xc8;}else{_0x4e918d=0xce;}_0x557564[_0x8786('0x1a')](_0x4e918d);return _0x557564['set']('Content-Range',_0x200d65+'-'+_0x17a7e1+'/'+_0x36512d)['json'](_0x531b82);}return null;};}function patchUpdates(_0x10f586){return function(_0x7a9b98){try{jsonpatch[_0x8786('0x1b')](_0x7a9b98,_0x10f586,!![]);}catch(_0x1a0527){return BPromise[_0x8786('0x1c')](_0x1a0527);}return _0x7a9b98[_0x8786('0x1d')]();};}function saveUpdates(_0x16c669,_0x452082){return function(_0x2217ff){if(_0x2217ff){return _0x2217ff[_0x8786('0x1e')](_0x16c669)[_0x8786('0x1f')](function(_0x5038b8){return _0x5038b8;});}return null;};}function removeEntity(_0x460621,_0x5abf5e){return function(_0xe98484){if(_0xe98484){return _0xe98484[_0x8786('0x20')]()[_0x8786('0x1f')](function(){_0x460621['status'](0xcc)[_0x8786('0x17')]();});}};}function handleEntityNotFound(_0x11af8a,_0x4ddc4f){return function(_0x57d25a){if(!_0x57d25a){_0x11af8a[_0x8786('0x21')](0x194);}return _0x57d25a;};}function handleError(_0x43bdf8,_0x34b5f1){_0x34b5f1=_0x34b5f1||0x1f4;return function(_0x16c8c2){logger[_0x8786('0x22')](_0x16c8c2['stack']);if(_0x16c8c2[_0x8786('0x23')]){delete _0x16c8c2[_0x8786('0x23')];}_0x43bdf8['status'](_0x34b5f1)['send'](_0x16c8c2);};}exports[_0x8786('0x24')]=function(_0x7c9da3,_0x11e273){var _0x3ad8fd={},_0x441af9={},_0x4ce909={'count':0x0,'rows':[]};var _0x455229=_[_0x8786('0x25')](db[_0x8786('0x26')]['rawAttributes'],function(_0x34432c){return{'name':_0x34432c['fieldName'],'type':_0x34432c[_0x8786('0x27')][_0x8786('0x28')]};});_0x441af9[_0x8786('0x29')]=_[_0x8786('0x25')](_0x455229,_0x8786('0x23'));_0x441af9[_0x8786('0x2a')]=_[_0x8786('0x2b')](_0x7c9da3[_0x8786('0x2a')]);_0x441af9[_0x8786('0x2c')]=_[_0x8786('0x2d')](_0x441af9['model'],_0x441af9[_0x8786('0x2a')]);_0x3ad8fd[_0x8786('0x2e')]=_['intersection'](_0x441af9[_0x8786('0x29')],qs[_0x8786('0x2f')](_0x7c9da3[_0x8786('0x2a')][_0x8786('0x2f')]));_0x3ad8fd[_0x8786('0x2e')]=_0x3ad8fd[_0x8786('0x2e')][_0x8786('0x30')]?_0x3ad8fd[_0x8786('0x2e')]:_0x441af9[_0x8786('0x29')];if(!_0x7c9da3[_0x8786('0x2a')][_0x8786('0x31')](_0x8786('0x32'))){_0x3ad8fd[_0x8786('0x19')]=qs[_0x8786('0x19')](_0x7c9da3[_0x8786('0x2a')][_0x8786('0x19')]);_0x3ad8fd[_0x8786('0x18')]=qs['offset'](_0x7c9da3[_0x8786('0x2a')][_0x8786('0x18')]);}_0x3ad8fd[_0x8786('0x33')]=qs[_0x8786('0x34')](_0x7c9da3['query']['sort']);_0x3ad8fd[_0x8786('0x35')]=qs[_0x8786('0x2c')](_[_0x8786('0x36')](_0x7c9da3[_0x8786('0x2a')],_0x441af9[_0x8786('0x2c')]));if(_0x7c9da3[_0x8786('0x2a')][_0x8786('0x37')]){_0x3ad8fd[_0x8786('0x35')]=_['merge'](_0x3ad8fd[_0x8786('0x35')],{'$or':_[_0x8786('0x25')](_0x455229,function(_0x461a84){if(_0x461a84[_0x8786('0x27')][_0x8786('0x28')]!==_0x8786('0x38')){var _0x394285={};_0x394285[_0x461a84[_0x8786('0x39')]]={'$like':'%'+_0x7c9da3[_0x8786('0x2a')]['filter']+'%'};return _0x394285;}})});}_0x3ad8fd=_[_0x8786('0x3a')]({},_0x3ad8fd,_0x7c9da3[_0x8786('0x3b')]);var _0x523938={'where':_0x3ad8fd[_0x8786('0x35')]};return db[_0x8786('0x26')][_0x8786('0x3c')](_0x523938)[_0x8786('0x1f')](function(_0x1fad9e){_0x4ce909['count']=_0x1fad9e;if(_0x7c9da3[_0x8786('0x2a')][_0x8786('0x3d')]){_0x3ad8fd['include']=[{'all':!![]}];}return db[_0x8786('0x26')][_0x8786('0x3e')](_0x3ad8fd);})[_0x8786('0x1f')](function(_0x26fd67){_0x4ce909['rows']=_0x26fd67;return _0x4ce909;})[_0x8786('0x1f')](respondWithFilteredResult(_0x11e273,_0x3ad8fd))[_0x8786('0x3f')](handleError(_0x11e273,null));};exports['show']=function(_0x4c1f6a,_0x4f06f7){var _0x30af91={'raw':!![],'where':{'id':_0x4c1f6a['params']['id']}},_0xe0647c={};_0xe0647c[_0x8786('0x29')]=_[_0x8786('0x2b')](db[_0x8786('0x26')][_0x8786('0x40')]);_0xe0647c['query']=_[_0x8786('0x2b')](_0x4c1f6a[_0x8786('0x2a')]);_0xe0647c['filters']=_[_0x8786('0x2d')](_0xe0647c[_0x8786('0x29')],_0xe0647c[_0x8786('0x2a')]);_0x30af91[_0x8786('0x2e')]=_[_0x8786('0x2d')](_0xe0647c['model'],qs[_0x8786('0x2f')](_0x4c1f6a[_0x8786('0x2a')]['fields']));_0x30af91['attributes']=_0x30af91[_0x8786('0x2e')][_0x8786('0x30')]?_0x30af91['attributes']:_0xe0647c[_0x8786('0x29')];if(_0x4c1f6a[_0x8786('0x2a')][_0x8786('0x3d')]){_0x30af91[_0x8786('0x41')]=[{'all':!![]}];}_0x30af91=_[_0x8786('0x3a')]({},_0x30af91,_0x4c1f6a[_0x8786('0x3b')]);return db[_0x8786('0x26')]['find'](_0x30af91)[_0x8786('0x1f')](handleEntityNotFound(_0x4f06f7,null))[_0x8786('0x1f')](respondWithResult(_0x4f06f7,null))[_0x8786('0x3f')](handleError(_0x4f06f7,null));};exports['update']=function(_0x32c2cc,_0x58f4a7){if(_0x32c2cc[_0x8786('0x42')]['id']){delete _0x32c2cc[_0x8786('0x42')]['id'];}return db[_0x8786('0x26')][_0x8786('0x43')]({'where':{'id':_0x32c2cc['params']['id']}})[_0x8786('0x1f')](handleEntityNotFound(_0x58f4a7,null))[_0x8786('0x1f')](saveUpdates(_0x32c2cc['body'],null))['then'](respondWithResult(_0x58f4a7,null))[_0x8786('0x3f')](handleError(_0x58f4a7,null));};exports['destroy']=function(_0x547217,_0x27e83f){return db[_0x8786('0x26')]['find']({'where':{'id':_0x547217['params']['id']}})[_0x8786('0x1f')](handleEntityNotFound(_0x27e83f,null))[_0x8786('0x1f')](removeEntity(_0x27e83f,null))[_0x8786('0x3f')](handleError(_0x27e83f,null));};exports[_0x8786('0x44')]=function(_0x2fa7ff,_0xdd2fa7,_0x32d8f8){_0x2fa7ff[_0x8786('0x42')][_0x8786('0x23')]=_0x2fa7ff[_0x8786('0x45')]['originalname'];_0x2fa7ff[_0x8786('0x42')][_0x8786('0x46')]=_0x2fa7ff[_0x8786('0x45')][_0x8786('0x47')];_0x2fa7ff['body']['type']=_0x2fa7ff['file']['mimetype'];return db['Attachment'][_0x8786('0x44')](_0x2fa7ff[_0x8786('0x42')])[_0x8786('0x1f')](respondWithResult(_0xdd2fa7,0xc9))[_0x8786('0x3f')](handleError(_0xdd2fa7,null));};exports['download']=function(_0x107fc8,_0x5ae58b,_0x3caa17){return db[_0x8786('0x26')][_0x8786('0x48')]({'where':{'id':_0x107fc8[_0x8786('0x49')]['id']},'raw':!![]})[_0x8786('0x1f')](handleEntityNotFound(_0x5ae58b,null))[_0x8786('0x1f')](function(_0x1fcbca){if(_0x1fcbca){return _0x5ae58b[_0x8786('0x4a')](path[_0x8786('0x4b')](config[_0x8786('0x4c')],'server/files/attachments/',_0x1fcbca[_0x8786('0x46')]));}})[_0x8786('0x3f')](handleError(_0x5ae58b,null));}; \ No newline at end of file +var _0xbb38=['update','body','params','create','file','originalname','basename','filename','mimetype','findOne','download','join','root','server/files/attachments/','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','save','then','destroy','sendStatus','stack','name','map','Attachment','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','field','options','includeAll','findAll','rows','show','rawAttributes','include','find','catch'];(function(_0x1264b2,_0x266843){var _0x41cfef=function(_0x2f53b8){while(--_0x2f53b8){_0x1264b2['push'](_0x1264b2['shift']());}};_0x41cfef(++_0x266843);}(_0xbb38,0x1f4));var _0x8bb3=function(_0x28578d,_0xcf5cf0){_0x28578d=_0x28578d-0x0;var _0x524826=_0xbb38[_0x28578d];return _0x524826;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8bb3('0x0'));var rimraf=require(_0x8bb3('0x1'));var zipdir=require(_0x8bb3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8bb3('0x3'));var moment=require('moment');var BPromise=require(_0x8bb3('0x4'));var Mustache=require(_0x8bb3('0x5'));var util=require(_0x8bb3('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x8bb3('0x7'));var ejs=require(_0x8bb3('0x8'));var fs=require('fs');var _=require(_0x8bb3('0x9'));var squel=require('squel');var crypto=require(_0x8bb3('0xa'));var jsforce=require(_0x8bb3('0xb'));var deskjs=require(_0x8bb3('0xc'));var toCsv=require(_0x8bb3('0x7'));var querystring=require(_0x8bb3('0xd'));var Papa=require(_0x8bb3('0xe'));var Redis=require('ioredis');var authService=require(_0x8bb3('0xf'));var qs=require(_0x8bb3('0x10'));var as=require(_0x8bb3('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8bb3('0x12'))(_0x8bb3('0x13'));var utils=require('../../config/utils');var config=require(_0x8bb3('0x14'));var db=require(_0x8bb3('0x15'))['db'];function respondWithStatusCode(_0x3ea049,_0x3d138a){_0x3d138a=_0x3d138a||0xcc;return function(_0x46be4f){if(_0x46be4f){return _0x3ea049['sendStatus'](_0x3d138a);}return _0x3ea049[_0x8bb3('0x16')](_0x3d138a)[_0x8bb3('0x17')]();};}function respondWithResult(_0x221cec,_0xd09b84){_0xd09b84=_0xd09b84||0xc8;return function(_0x31da9f){if(_0x31da9f){return _0x221cec[_0x8bb3('0x16')](_0xd09b84)[_0x8bb3('0x18')](_0x31da9f);}};}function respondWithFilteredResult(_0x12184e,_0x2167e4){return function(_0xfa8bf6){if(_0xfa8bf6){var _0x166927=_0xfa8bf6[_0x8bb3('0x19')],_0x258905=_0x2167e4[_0x8bb3('0x1a')],_0x159dbb=_0x2167e4['offset']+_0x2167e4[_0x8bb3('0x1b')],_0x7e0168;if(_0x159dbb>=_0x166927){_0x159dbb=_0x166927;_0x7e0168=0xc8;}else{_0x7e0168=0xce;}_0x12184e[_0x8bb3('0x16')](_0x7e0168);return _0x12184e[_0x8bb3('0x1c')](_0x8bb3('0x1d'),_0x258905+'-'+_0x159dbb+'/'+_0x166927)['json'](_0xfa8bf6);}return null;};}function patchUpdates(_0x446ea2){return function(_0x45179a){try{jsonpatch[_0x8bb3('0x1e')](_0x45179a,_0x446ea2,!![]);}catch(_0x48e49b){return BPromise['reject'](_0x48e49b);}return _0x45179a[_0x8bb3('0x1f')]();};}function saveUpdates(_0xf27c06,_0x2acc72){return function(_0x590dce){if(_0x590dce){return _0x590dce['update'](_0xf27c06)[_0x8bb3('0x20')](function(_0x272934){return _0x272934;});}return null;};}function removeEntity(_0x77c804,_0x1e396a){return function(_0x13c2f8){if(_0x13c2f8){return _0x13c2f8[_0x8bb3('0x21')]()['then'](function(){_0x77c804['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a4422,_0x124349){return function(_0x23b0f8){if(!_0x23b0f8){_0x1a4422[_0x8bb3('0x22')](0x194);}return _0x23b0f8;};}function handleError(_0x578ef8,_0x5832b4){_0x5832b4=_0x5832b4||0x1f4;return function(_0x25385c){logger['error'](_0x25385c[_0x8bb3('0x23')]);if(_0x25385c[_0x8bb3('0x24')]){delete _0x25385c[_0x8bb3('0x24')];}_0x578ef8['status'](_0x5832b4)['send'](_0x25385c);};}exports['index']=function(_0x1f435b,_0x1b927d){var _0xbc346c={},_0x1c34ac={},_0x5a94cb={'count':0x0,'rows':[]};var _0x1144e8=_[_0x8bb3('0x25')](db[_0x8bb3('0x26')]['rawAttributes'],function(_0x40628d){return{'name':_0x40628d['fieldName'],'type':_0x40628d[_0x8bb3('0x27')][_0x8bb3('0x28')]};});_0x1c34ac[_0x8bb3('0x29')]=_[_0x8bb3('0x25')](_0x1144e8,_0x8bb3('0x24'));_0x1c34ac[_0x8bb3('0x2a')]=_[_0x8bb3('0x2b')](_0x1f435b[_0x8bb3('0x2a')]);_0x1c34ac[_0x8bb3('0x2c')]=_[_0x8bb3('0x2d')](_0x1c34ac[_0x8bb3('0x29')],_0x1c34ac[_0x8bb3('0x2a')]);_0xbc346c[_0x8bb3('0x2e')]=_['intersection'](_0x1c34ac[_0x8bb3('0x29')],qs[_0x8bb3('0x2f')](_0x1f435b[_0x8bb3('0x2a')]['fields']));_0xbc346c[_0x8bb3('0x2e')]=_0xbc346c[_0x8bb3('0x2e')][_0x8bb3('0x30')]?_0xbc346c[_0x8bb3('0x2e')]:_0x1c34ac[_0x8bb3('0x29')];if(!_0x1f435b[_0x8bb3('0x2a')][_0x8bb3('0x31')](_0x8bb3('0x32'))){_0xbc346c['limit']=qs['limit'](_0x1f435b[_0x8bb3('0x2a')][_0x8bb3('0x1b')]);_0xbc346c['offset']=qs[_0x8bb3('0x1a')](_0x1f435b[_0x8bb3('0x2a')][_0x8bb3('0x1a')]);}_0xbc346c[_0x8bb3('0x33')]=qs[_0x8bb3('0x34')](_0x1f435b['query'][_0x8bb3('0x34')]);_0xbc346c[_0x8bb3('0x35')]=qs['filters'](_['pick'](_0x1f435b[_0x8bb3('0x2a')],_0x1c34ac['filters']));if(_0x1f435b[_0x8bb3('0x2a')][_0x8bb3('0x36')]){_0xbc346c[_0x8bb3('0x35')]=_[_0x8bb3('0x37')](_0xbc346c[_0x8bb3('0x35')],{'$or':_['map'](_0x1144e8,function(_0x2fbfcd){if(_0x2fbfcd[_0x8bb3('0x27')]['key']!==_0x8bb3('0x38')){var _0x3d4b8f={};_0x3d4b8f[_0x2fbfcd[_0x8bb3('0x39')]]={'$like':'%'+_0x1f435b[_0x8bb3('0x2a')][_0x8bb3('0x36')]+'%'};return _0x3d4b8f;}})});}_0xbc346c=_[_0x8bb3('0x37')]({},_0xbc346c,_0x1f435b[_0x8bb3('0x3a')]);var _0x18427c={'where':_0xbc346c[_0x8bb3('0x35')]};return db[_0x8bb3('0x26')][_0x8bb3('0x19')](_0x18427c)[_0x8bb3('0x20')](function(_0x334fef){_0x5a94cb[_0x8bb3('0x19')]=_0x334fef;if(_0x1f435b[_0x8bb3('0x2a')][_0x8bb3('0x3b')]){_0xbc346c['include']=[{'all':!![]}];}return db[_0x8bb3('0x26')][_0x8bb3('0x3c')](_0xbc346c);})[_0x8bb3('0x20')](function(_0x55e029){_0x5a94cb[_0x8bb3('0x3d')]=_0x55e029;return _0x5a94cb;})[_0x8bb3('0x20')](respondWithFilteredResult(_0x1b927d,_0xbc346c))['catch'](handleError(_0x1b927d,null));};exports[_0x8bb3('0x3e')]=function(_0x211d7f,_0x4c9862){var _0x40320e={'raw':!![],'where':{'id':_0x211d7f['params']['id']}},_0x4db7e1={};_0x4db7e1[_0x8bb3('0x29')]=_['keys'](db['Attachment'][_0x8bb3('0x3f')]);_0x4db7e1['query']=_[_0x8bb3('0x2b')](_0x211d7f[_0x8bb3('0x2a')]);_0x4db7e1[_0x8bb3('0x2c')]=_[_0x8bb3('0x2d')](_0x4db7e1['model'],_0x4db7e1[_0x8bb3('0x2a')]);_0x40320e['attributes']=_[_0x8bb3('0x2d')](_0x4db7e1[_0x8bb3('0x29')],qs['fields'](_0x211d7f['query'][_0x8bb3('0x2f')]));_0x40320e[_0x8bb3('0x2e')]=_0x40320e['attributes'][_0x8bb3('0x30')]?_0x40320e['attributes']:_0x4db7e1['model'];if(_0x211d7f[_0x8bb3('0x2a')][_0x8bb3('0x3b')]){_0x40320e[_0x8bb3('0x40')]=[{'all':!![]}];}_0x40320e=_[_0x8bb3('0x37')]({},_0x40320e,_0x211d7f['options']);return db[_0x8bb3('0x26')][_0x8bb3('0x41')](_0x40320e)['then'](handleEntityNotFound(_0x4c9862,null))[_0x8bb3('0x20')](respondWithResult(_0x4c9862,null))[_0x8bb3('0x42')](handleError(_0x4c9862,null));};exports[_0x8bb3('0x43')]=function(_0x3b4480,_0x4dd191){if(_0x3b4480[_0x8bb3('0x44')]['id']){delete _0x3b4480[_0x8bb3('0x44')]['id'];}return db['Attachment'][_0x8bb3('0x41')]({'where':{'id':_0x3b4480['params']['id']}})['then'](handleEntityNotFound(_0x4dd191,null))['then'](saveUpdates(_0x3b4480['body'],null))[_0x8bb3('0x20')](respondWithResult(_0x4dd191,null))[_0x8bb3('0x42')](handleError(_0x4dd191,null));};exports[_0x8bb3('0x21')]=function(_0x26e608,_0x3c6736){return db[_0x8bb3('0x26')][_0x8bb3('0x41')]({'where':{'id':_0x26e608[_0x8bb3('0x45')]['id']}})[_0x8bb3('0x20')](handleEntityNotFound(_0x3c6736,null))[_0x8bb3('0x20')](removeEntity(_0x3c6736,null))[_0x8bb3('0x42')](handleError(_0x3c6736,null));};exports[_0x8bb3('0x46')]=function(_0x47fba7,_0x7260ee,_0x2a4aae){_0x47fba7[_0x8bb3('0x44')][_0x8bb3('0x24')]=_0x47fba7[_0x8bb3('0x47')][_0x8bb3('0x48')];_0x47fba7[_0x8bb3('0x44')][_0x8bb3('0x49')]=_0x47fba7[_0x8bb3('0x47')][_0x8bb3('0x4a')];_0x47fba7[_0x8bb3('0x44')]['type']=_0x47fba7['file'][_0x8bb3('0x4b')];return db[_0x8bb3('0x26')][_0x8bb3('0x46')](_0x47fba7['body'])[_0x8bb3('0x20')](respondWithResult(_0x7260ee,0xc9))[_0x8bb3('0x42')](handleError(_0x7260ee,null));};exports['download']=function(_0x53d477,_0x3177a8,_0x39f550){return db['Attachment'][_0x8bb3('0x4c')]({'where':{'id':_0x53d477[_0x8bb3('0x45')]['id']},'raw':!![]})[_0x8bb3('0x20')](handleEntityNotFound(_0x3177a8,null))['then'](function(_0x9ed24c){if(_0x9ed24c){return _0x3177a8[_0x8bb3('0x4d')](path[_0x8bb3('0x4e')](config[_0x8bb3('0x4f')],_0x8bb3('0x50'),_0x9ed24c[_0x8bb3('0x49')]));}})['catch'](handleError(_0x3177a8,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 983547b..e95b497 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 _0x5942=['Attachment','attachments','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes','exports','define'];(function(_0x3e1f9c,_0x10c56a){var _0x1e43fa=function(_0x24277b){while(--_0x24277b){_0x3e1f9c['push'](_0x3e1f9c['shift']());}};_0x1e43fa(++_0x10c56a);}(_0x5942,0x16a));var _0x2594=function(_0x2d48dd,_0x556d46){_0x2d48dd=_0x2d48dd-0x0;var _0x78e247=_0x5942[_0x2d48dd];return _0x78e247;};'use strict';var _=require(_0x2594('0x0'));var util=require(_0x2594('0x1'));var logger=require(_0x2594('0x2'))(_0x2594('0x3'));var moment=require(_0x2594('0x4'));var BPromise=require(_0x2594('0x5'));var rp=require(_0x2594('0x6'));var fs=require('fs');var path=require(_0x2594('0x7'));var rimraf=require(_0x2594('0x8'));var config=require(_0x2594('0x9'));var attributes=require(_0x2594('0xa'));module[_0x2594('0xb')]=function(_0x495540,_0x59f01a){return _0x495540[_0x2594('0xc')](_0x2594('0xd'),attributes,{'tableName':_0x2594('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0490=['exports','define','attachments','util','request-promise','path','rimraf','../../config/environment','./attachment.attributes'];(function(_0x3f5925,_0x19c37c){var _0x4dd3c4=function(_0x251720){while(--_0x251720){_0x3f5925['push'](_0x3f5925['shift']());}};_0x4dd3c4(++_0x19c37c);}(_0x0490,0x147));var _0x0049=function(_0x3c4e42,_0x4df3e8){_0x3c4e42=_0x3c4e42-0x0;var _0x7378e0=_0x0490[_0x3c4e42];return _0x7378e0;};'use strict';var _=require('lodash');var util=require(_0x0049('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0049('0x1'));var fs=require('fs');var path=require(_0x0049('0x2'));var rimraf=require(_0x0049('0x3'));var config=require(_0x0049('0x4'));var attributes=require(_0x0049('0x5'));module[_0x0049('0x6')]=function(_0x2957b6,_0x4dde1){return _0x2957b6[_0x0049('0x7')]('Attachment',attributes,{'tableName':_0x0049('0x8'),'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 fc8cc58..2c99943 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 _0x4325=['CreateAttachment','Attachment','create','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x184604,_0x5ed3c0){var _0x5d7735=function(_0x103f03){while(--_0x103f03){_0x184604['push'](_0x184604['shift']());}};_0x5d7735(++_0x5ed3c0);}(_0x4325,0xb9));var _0x5432=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x4325[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x5432('0x0'));var util=require(_0x5432('0x1'));var moment=require(_0x5432('0x2'));var BPromise=require(_0x5432('0x3'));var rs=require(_0x5432('0x4'));var fs=require('fs');var Redis=require(_0x5432('0x5'));var db=require(_0x5432('0x6'))['db'];var utils=require(_0x5432('0x7'));var logger=require(_0x5432('0x8'))('rpc');var config=require(_0x5432('0x9'));var jayson=require(_0x5432('0xa'));var client=jayson[_0x5432('0xb')][_0x5432('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xc33013,_0x1dfa92,_0x177b6d){return new BPromise(function(_0xc30f9,_0x2ceb5c){return client[_0x5432('0xd')](_0xc33013,_0x177b6d)[_0x5432('0xe')](function(_0x3a18d4){logger[_0x5432('0xf')](_0x5432('0x10'),_0x1dfa92,_0x5432('0x11'));logger[_0x5432('0x12')](_0x5432('0x13'),_0x1dfa92,_0x5432('0x11'),JSON[_0x5432('0x14')](_0x3a18d4));if(_0x3a18d4[_0x5432('0x15')]){if(_0x3a18d4[_0x5432('0x15')]['code']===0x1f4){logger[_0x5432('0x15')](_0x5432('0x10'),_0x1dfa92,_0x3a18d4[_0x5432('0x15')]['message']);return _0x2ceb5c(_0x3a18d4[_0x5432('0x15')]['message']);}logger[_0x5432('0x15')](_0x5432('0x10'),_0x1dfa92,_0x3a18d4[_0x5432('0x15')][_0x5432('0x16')]);return _0xc30f9(_0x3a18d4[_0x5432('0x15')][_0x5432('0x16')]);}else{logger[_0x5432('0xf')]('Attachment,\x20%s,\x20%s',_0x1dfa92,_0x5432('0x11'));_0xc30f9(_0x3a18d4[_0x5432('0x17')][_0x5432('0x16')]);}})[_0x5432('0x18')](function(_0xb5b9d){logger[_0x5432('0x15')](_0x5432('0x10'),_0x1dfa92,_0xb5b9d);_0x2ceb5c(_0xb5b9d);});});}exports[_0x5432('0x19')]=function(_0x2e83c4){var _0x5208ef=this;return new Promise(function(_0xf9f178,_0x12c31e){return db[_0x5432('0x1a')][_0x5432('0x1b')](_0x2e83c4['body'],{'raw':_0x2e83c4[_0x5432('0x1c')]?_0x2e83c4[_0x5432('0x1c')][_0x5432('0x1d')]===undefined?!![]:![]:!![]})[_0x5432('0xe')](function(_0x48bf24){logger[_0x5432('0xf')](_0x5432('0x19'),_0x2e83c4);logger[_0x5432('0x12')](_0x5432('0x19'),_0x2e83c4,JSON[_0x5432('0x14')](_0x48bf24));_0xf9f178(_0x48bf24);})['catch'](function(_0x3b44d3){logger[_0x5432('0x15')](_0x5432('0x19'),_0x3b44d3['message'],_0x2e83c4);_0x12c31e(_0x5208ef[_0x5432('0x15')](0x1f4,_0x3b44d3[_0x5432('0x16')]));});});}; \ No newline at end of file +var _0xc047=['moment','bluebird','ioredis','../../config/utils','rpc','jayson/promise','http','request','Attachment,\x20%s,\x20%s','request\x20sent','error','message','info','catch','CreateAttachment','Attachment','create','body','options','raw','then','debug','stringify'];(function(_0x45f951,_0x2750c8){var _0x24756c=function(_0x31c931){while(--_0x31c931){_0x45f951['push'](_0x45f951['shift']());}};_0x24756c(++_0x2750c8);}(_0xc047,0x8a));var _0x7c04=function(_0x590782,_0x555134){_0x590782=_0x590782-0x0;var _0x4dfa84=_0xc047[_0x590782];return _0x4dfa84;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7c04('0x0'));var BPromise=require(_0x7c04('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7c04('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x7c04('0x3'));var logger=require('../../config/logger')(_0x7c04('0x4'));var config=require('../../config/environment');var jayson=require(_0x7c04('0x5'));var client=jayson['client'][_0x7c04('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x380999,_0x4d2157,_0x2605a5){return new BPromise(function(_0x2e3a41,_0x3f57b8){return client[_0x7c04('0x7')](_0x380999,_0x2605a5)['then'](function(_0x6330bc){logger['info'](_0x7c04('0x8'),_0x4d2157,'request\x20sent');logger['debug']('Attachment,\x20%s,\x20%s,\x20%s',_0x4d2157,_0x7c04('0x9'),JSON['stringify'](_0x6330bc));if(_0x6330bc[_0x7c04('0xa')]){if(_0x6330bc[_0x7c04('0xa')]['code']===0x1f4){logger['error'](_0x7c04('0x8'),_0x4d2157,_0x6330bc[_0x7c04('0xa')]['message']);return _0x3f57b8(_0x6330bc[_0x7c04('0xa')][_0x7c04('0xb')]);}logger[_0x7c04('0xa')](_0x7c04('0x8'),_0x4d2157,_0x6330bc[_0x7c04('0xa')][_0x7c04('0xb')]);return _0x2e3a41(_0x6330bc[_0x7c04('0xa')][_0x7c04('0xb')]);}else{logger[_0x7c04('0xc')](_0x7c04('0x8'),_0x4d2157,_0x7c04('0x9'));_0x2e3a41(_0x6330bc['result']['message']);}})[_0x7c04('0xd')](function(_0x50af04){logger['error'](_0x7c04('0x8'),_0x4d2157,_0x50af04);_0x3f57b8(_0x50af04);});});}exports[_0x7c04('0xe')]=function(_0x4e238c){var _0x40dfda=this;return new Promise(function(_0x5d6da9,_0x38525f){return db[_0x7c04('0xf')][_0x7c04('0x10')](_0x4e238c[_0x7c04('0x11')],{'raw':_0x4e238c[_0x7c04('0x12')]?_0x4e238c['options'][_0x7c04('0x13')]===undefined?!![]:![]:!![]})[_0x7c04('0x14')](function(_0x2ba11b){logger[_0x7c04('0xc')]('CreateAttachment',_0x4e238c);logger[_0x7c04('0x15')](_0x7c04('0xe'),_0x4e238c,JSON[_0x7c04('0x16')](_0x2ba11b));_0x5d6da9(_0x2ba11b);})[_0x7c04('0xd')](function(_0x4fca21){logger['error'](_0x7c04('0xe'),_0x4fca21[_0x7c04('0xb')],_0x4e238c);_0x38525f(_0x40dfda[_0x7c04('0xa')](0x1f4,_0x4fca21[_0x7c04('0xb')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index d788f1c..8df6f8e 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 _0x20b3=['download','join','%s-%s','originalname','replace','post','single','file','create','put','update','delete','exports','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id','get','/:id/download'];(function(_0x24bace,_0x58da0f){var _0x3134cd=function(_0x1957eb){while(--_0x1957eb){_0x24bace['push'](_0x24bace['shift']());}};_0x3134cd(++_0x58da0f);}(_0x20b3,0x85));var _0x320b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x20b3[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x320b('0x0'));var timeout=require(_0x320b('0x1'));var express=require(_0x320b('0x2'));var router=express['Router']();var auth=require(_0x320b('0x3'));var interaction=require(_0x320b('0x4'));var config=require(_0x320b('0x5'));var controller=require('./attachment.controller');router['get']('/',auth[_0x320b('0x6')](),controller[_0x320b('0x7')]);router['get'](_0x320b('0x8'),auth[_0x320b('0x6')](),controller['show']);router[_0x320b('0x9')](_0x320b('0xa'),auth[_0x320b('0x6')](),controller[_0x320b('0xb')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x19f445,_0x26c528,_0x28820c){_0x28820c(null,path[_0x320b('0xc')](config['root'],'server/files/attachments/'));},'filename':function(_0x2645be,_0x5acd2e,_0x3e2ff1){_0x3e2ff1(null,util['format'](_0x320b('0xd'),Date['now'](),_0x5acd2e[_0x320b('0xe')][_0x320b('0xf')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x320b('0x10')]('/',upload[_0x320b('0x11')](_0x320b('0x12')),controller[_0x320b('0x13')]);router[_0x320b('0x14')](_0x320b('0x8'),auth[_0x320b('0x6')](),controller[_0x320b('0x15')]);router[_0x320b('0x16')](_0x320b('0x8'),auth[_0x320b('0x6')](),controller['destroy']);module[_0x320b('0x17')]=router; \ No newline at end of file +var _0x52df=['exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','replace','post','single','file','put','update','destroy'];(function(_0xf84b4b,_0x12bbb7){var _0x10851f=function(_0x562da7){while(--_0x562da7){_0xf84b4b['push'](_0xf84b4b['shift']());}};_0x10851f(++_0x12bbb7);}(_0x52df,0x121));var _0xf52d=function(_0x224061,_0x226866){_0x224061=_0x224061-0x0;var _0x30f77e=_0x52df[_0x224061];return _0x30f77e;};'use strict';var multer=require(_0xf52d('0x0'));var util=require(_0xf52d('0x1'));var path=require(_0xf52d('0x2'));var timeout=require('connect-timeout');var express=require(_0xf52d('0x3'));var router=express[_0xf52d('0x4')]();var auth=require(_0xf52d('0x5'));var interaction=require(_0xf52d('0x6'));var config=require(_0xf52d('0x7'));var controller=require(_0xf52d('0x8'));router[_0xf52d('0x9')]('/',auth[_0xf52d('0xa')](),controller[_0xf52d('0xb')]);router[_0xf52d('0x9')](_0xf52d('0xc'),auth[_0xf52d('0xa')](),controller[_0xf52d('0xd')]);router['get'](_0xf52d('0xe'),auth[_0xf52d('0xa')](),controller[_0xf52d('0xf')]);var upload=multer({'storage':multer[_0xf52d('0x10')]({'destination':function(_0x22756f,_0x3a043d,_0x48b203){_0x48b203(null,path[_0xf52d('0x11')](config[_0xf52d('0x12')],_0xf52d('0x13')));},'filename':function(_0x4d047b,_0x14eda7,_0x15724d){_0x15724d(null,util[_0xf52d('0x14')](_0xf52d('0x15'),Date[_0xf52d('0x16')](),_0x14eda7[_0xf52d('0x17')][_0xf52d('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf52d('0x19')]('/',upload[_0xf52d('0x1a')](_0xf52d('0x1b')),controller['create']);router[_0xf52d('0x1c')](_0xf52d('0xc'),auth[_0xf52d('0xa')](),controller[_0xf52d('0x1d')]);router['delete'](_0xf52d('0xc'),auth['isAuthenticated'](),controller[_0xf52d('0x1e')]);module[_0xf52d('0x1f')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index a9c8bb0..65f60ba 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 _0x68c4=['../../components/auth/service','login','authenticate','google','/login','profile','callback','use','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','blockDuration','User','find','emails','value','admin','user','agent','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','add','minutes','getLicense','lodash','moment','../../mysqldb','../../config/environment'];(function(_0x4c4c33,_0x8e827c){var _0x2dfeb0=function(_0x1b732f){while(--_0x1b732f){_0x4c4c33['push'](_0x4c4c33['shift']());}};_0x2dfeb0(++_0x8e827c);}(_0x68c4,0xe3));var _0x468c=function(_0x4ebf6a,_0xfd0a40){_0x4ebf6a=_0x4ebf6a-0x0;var _0x1e7a72=_0x68c4[_0x4ebf6a];return _0x1e7a72;};'use strict';var _=require(_0x468c('0x0'));var passport=require('passport');var GoogleStrategy=require('passport-google-oauth20')['Strategy'];var moment=require(_0x468c('0x1'));var db=require(_0x468c('0x2'))['db'];var config=require(_0x468c('0x3'));var signToken=require(_0x468c('0x4'))['signToken'];var utils=require('../../config/utils');exports[_0x468c('0x5')]=passport[_0x468c('0x6')](_0x468c('0x7'),{'failureRedirect':_0x468c('0x8'),'scope':[_0x468c('0x9'),'email'],'session':![]});exports[_0x468c('0xa')]=passport[_0x468c('0x6')](_0x468c('0x7'),{'failureRedirect':_0x468c('0x8'),'session':![]});passport[_0x468c('0xb')](new GoogleStrategy({'clientID':config['google']?config[_0x468c('0x7')]['clientID']:'id','clientSecret':config[_0x468c('0x7')]?config[_0x468c('0x7')][_0x468c('0xc')]:_0x468c('0xd'),'callbackURL':config[_0x468c('0x7')]?config[_0x468c('0x7')][_0x468c('0xe')]:''},function(_0x4c5b9f,_0x587fc7,_0x55f2e7,_0x187fdd){var _0x37c05e,_0x76913d;return db[_0x468c('0xf')][_0x468c('0x10')]({'where':{'id':0x1},'attributes':[_0x468c('0x11'),_0x468c('0x12')],'raw':!![]})['then'](function(_0x5171ab){_0x37c05e=_0x5171ab;return db[_0x468c('0x13')][_0x468c('0x14')]({'where':{'email':_['map'](_0x55f2e7[_0x468c('0x15')],_0x468c('0x16')),'role':{'$or':[_0x468c('0x17'),_0x468c('0x18'),_0x468c('0x19')]}}});})[_0x468c('0x1a')](function(_0x1baa5c){_0x76913d=_0x1baa5c;if(_0x76913d){if(_0x76913d['disabled']){return _0x187fdd(_0x468c('0x1b'));}else if(_0x37c05e[_0x468c('0x12')]>0x0){if(_0x76913d[_0x468c('0x1c')]){if(moment(_0x76913d[_0x468c('0x1d')])[_0x468c('0x1e')](_0x37c05e[_0x468c('0x12')],_0x468c('0x1f'))>moment()){return _0x187fdd(_0x468c('0x1b'));}else{return utils['clearBlockUser'](_0x76913d,0x0,![],null)[_0x468c('0x1a')](function(){return utils[_0x468c('0x20')](_0x76913d);})[_0x468c('0x1a')](function(){return _0x187fdd(null,_0x76913d);});}}else{return utils['getLicense'](_0x76913d)['then'](function(){return _0x187fdd(null,_0x76913d);});}}else{return utils[_0x468c('0x20')](_0x76913d)['then'](function(){return _0x187fdd(null,_0x76913d);});}}return _0x187fdd(_0x468c('0x1b'));})['catch'](function(_0x42bfab){_0x187fdd(_0x42bfab);});})); \ No newline at end of file +var _0x0068=['then','User','find','map','emails','value','admin','user','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','profile','email','callback','clientID','secret','Setting','findOne','allowedLoginAttempts','blockDuration'];(function(_0x475191,_0x5bce86){var _0x189e96=function(_0x46d6a2){while(--_0x46d6a2){_0x475191['push'](_0x475191['shift']());}};_0x189e96(++_0x5bce86);}(_0x0068,0xa0));var _0x8006=function(_0x56ac40,_0x3eb56c){_0x56ac40=_0x56ac40-0x0;var _0x5e32c3=_0x0068[_0x56ac40];return _0x5e32c3;};'use strict';var _=require(_0x8006('0x0'));var passport=require(_0x8006('0x1'));var GoogleStrategy=require(_0x8006('0x2'))[_0x8006('0x3')];var moment=require(_0x8006('0x4'));var db=require(_0x8006('0x5'))['db'];var config=require('../../config/environment');var signToken=require('../../components/auth/service')['signToken'];var utils=require(_0x8006('0x6'));exports[_0x8006('0x7')]=passport[_0x8006('0x8')](_0x8006('0x9'),{'failureRedirect':_0x8006('0xa'),'scope':[_0x8006('0xb'),_0x8006('0xc')],'session':![]});exports[_0x8006('0xd')]=passport[_0x8006('0x8')](_0x8006('0x9'),{'failureRedirect':_0x8006('0xa'),'session':![]});passport['use'](new GoogleStrategy({'clientID':config['google']?config[_0x8006('0x9')][_0x8006('0xe')]:'id','clientSecret':config[_0x8006('0x9')]?config['google']['clientSecret']:_0x8006('0xf'),'callbackURL':config[_0x8006('0x9')]?config[_0x8006('0x9')]['callbackURL']:''},function(_0x580db0,_0x50ab01,_0x29b83b,_0x1c6fda){var _0x2030ce,_0x468146;return db[_0x8006('0x10')][_0x8006('0x11')]({'where':{'id':0x1},'attributes':[_0x8006('0x12'),_0x8006('0x13')],'raw':!![]})[_0x8006('0x14')](function(_0xb09980){_0x2030ce=_0xb09980;return db[_0x8006('0x15')][_0x8006('0x16')]({'where':{'email':_[_0x8006('0x17')](_0x29b83b[_0x8006('0x18')],_0x8006('0x19')),'role':{'$or':[_0x8006('0x1a'),_0x8006('0x1b'),'agent']}}});})['then'](function(_0x4763db){_0x468146=_0x4763db;if(_0x468146){if(_0x468146[_0x8006('0x1c')]){return _0x1c6fda(_0x8006('0x1d'));}else if(_0x2030ce[_0x8006('0x13')]>0x0){if(_0x468146[_0x8006('0x1e')]){if(moment(_0x468146[_0x8006('0x1f')])['add'](_0x2030ce['blockDuration'],_0x8006('0x20'))>moment()){return _0x1c6fda(_0x8006('0x1d'));}else{return utils[_0x8006('0x21')](_0x468146,0x0,![],null)['then'](function(){return utils[_0x8006('0x22')](_0x468146);})[_0x8006('0x14')](function(){return _0x1c6fda(null,_0x468146);});}}else{return utils['getLicense'](_0x468146)[_0x8006('0x14')](function(){return _0x1c6fda(null,_0x468146);});}}else{return utils[_0x8006('0x22')](_0x468146)[_0x8006('0x14')](function(){return _0x1c6fda(null,_0x468146);});}}return _0x1c6fda(_0x8006('0x1d'));})[_0x8006('0x23')](function(_0x2f5227){_0x1c6fda(_0x2f5227);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index ea2cece..5eac8db 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 _0x0eec=['setTokenCookie','exports','express','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback','isMiddleware'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x0eec,0xac));var _0xc0ee=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0eec[_0x20a584];return _0x4b41a8;};'use strict';var express=require(_0xc0ee('0x0'));var passport=require('passport');var router=express['Router']();var controller=require(_0xc0ee('0x1'));var userController=require(_0xc0ee('0x2'));var authService=require(_0xc0ee('0x3'));router[_0xc0ee('0x4')]('/',controller[_0xc0ee('0x5')]);router[_0xc0ee('0x4')](_0xc0ee('0x6'),controller['callback'],authService[_0xc0ee('0x7')],userController['login'],authService[_0xc0ee('0x8')]);module[_0xc0ee('0x9')]=router; \ No newline at end of file +var _0x22a4=['callback','isMiddleware','setTokenCookie','express','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback'];(function(_0x440a23,_0x283bf0){var _0x5f16ce=function(_0x5d7550){while(--_0x5d7550){_0x440a23['push'](_0x440a23['shift']());}};_0x5f16ce(++_0x283bf0);}(_0x22a4,0x1cb));var _0x422a=function(_0x1e7a07,_0x355dd1){_0x1e7a07=_0x1e7a07-0x0;var _0x4b60be=_0x22a4[_0x1e7a07];return _0x4b60be;};'use strict';var express=require(_0x422a('0x0'));var passport=require(_0x422a('0x1'));var router=express[_0x422a('0x2')]();var controller=require(_0x422a('0x3'));var userController=require(_0x422a('0x4'));var authService=require(_0x422a('0x5'));router[_0x422a('0x6')]('/',controller[_0x422a('0x7')]);router['get'](_0x422a('0x8'),controller[_0x422a('0x9')],authService[_0x422a('0xa')],userController[_0x422a('0x7')],authService[_0x422a('0xb')]);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 ce5320b..6f288c8 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 _0x5fc3=['Password\x20reset!','use','util','passport','Strategy','jayson/promise','lodash','randomstring','moment','../../components/auth/service','../../config/utils','client','Setting','findOne','allowedLoginAttempts','blockDuration','password','salt','disabled','blocked','admin','agent','then','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','loginAttempts','blockedAt','add','minutes','clearBlockUser','getLicense','find','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','auth','user','pass','merge','format','request','SendMail','error','stringify','message','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','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','json','online','body','Email\x20parameter\x20is\x20missing','generate','toLowerCase','User','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','headers','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','send','Reset\x20Email\x20sent!','catch','reset','params','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword'];(function(_0x2272b5,_0x362458){var _0x110156=function(_0x5c2e32){while(--_0x5c2e32){_0x2272b5['push'](_0x2272b5['shift']());}};_0x110156(++_0x362458);}(_0x5fc3,0xa8));var _0x35fc=function(_0x3a3c17,_0x5b7b7e){_0x3a3c17=_0x3a3c17-0x0;var _0xd07f21=_0x5fc3[_0x3a3c17];return _0xd07f21;};'use strict';var util=require(_0x35fc('0x0'));var passport=require(_0x35fc('0x1'));var LocalStrategy=require('passport-local')[_0x35fc('0x2')];var jayson=require(_0x35fc('0x3'));var _=require(_0x35fc('0x4'));var rs=require(_0x35fc('0x5'));var moment=require(_0x35fc('0x6'));var db=require('../../mysqldb')['db'];var authService=require(_0x35fc('0x7'));var utils=require(_0x35fc('0x8'));var client=jayson[_0x35fc('0x9')]['http']({'port':0x232b});function localAuthenticate(_0x5754be,_0x19a0d1,_0x508b32,_0x16e153){var _0x27524f,_0xc72d93;return db[_0x35fc('0xa')][_0x35fc('0xb')]({'where':{'id':0x1},'attributes':[_0x35fc('0xc'),_0x35fc('0xd')],'raw':!![]})['then'](function(_0x1083a9){_0x27524f=_0x1083a9;return _0x5754be[_0x35fc('0xb')]({'attributes':['id','name',_0x35fc('0xe'),_0x35fc('0xf'),'role',_0x35fc('0x10'),_0x35fc('0x11'),'blockedAt','loginAttempts'],'where':{'name':_0x19a0d1,'role':{'$or':[_0x35fc('0x12'),'user',_0x35fc('0x13')]}}});})[_0x35fc('0x14')](function(_0x2a6ad2){if(!_0x2a6ad2||_0x2a6ad2&&_0x2a6ad2[_0x35fc('0x15')]!==_0x19a0d1){throw new Error(_0x35fc('0x16'));}else{_0xc72d93=_0x2a6ad2;return _0xc72d93;}})['then'](function(){_0xc72d93['authenticate'](_0x508b32,function(_0x5eac0f,_0x558364){var _0x398b67=_0xc72d93[_0x35fc('0x17')]+0x1;if(_0x5eac0f){return _0x16e153(_0x5eac0f);}else if(!_0x558364){if(_0xc72d93[_0x35fc('0x10')]){return _0x16e153(null,![],{'message':_0x35fc('0x16')});}else if(_0x27524f[_0x35fc('0xc')]>0x0){if(_0xc72d93[_0x35fc('0x11')]){if(_0x27524f['blockDuration']>0x0){if(moment(_0xc72d93[_0x35fc('0x18')])[_0x35fc('0x19')](_0x27524f['blockDuration'],_0x35fc('0x1a'))>moment()){return _0x16e153(null,![],{'message':_0x35fc('0x16')});}else{return utils[_0x35fc('0x1b')](_0xc72d93,_0x398b67,![],null)['then'](function(){return _0x16e153(null,![],{'message':_0x35fc('0x16')});});}}else{return _0x16e153(null,![],{'message':_0x35fc('0x16')});}}else{if(_0x398b67>=_0x27524f[_0x35fc('0xc')]){return utils['clearBlockUser'](_0xc72d93,0x0,!![],moment())[_0x35fc('0x14')](function(){return _0x16e153(null,![],{'message':_0x35fc('0x16')});});}else{return utils[_0x35fc('0x1b')](_0xc72d93,_0x398b67,![],null)[_0x35fc('0x14')](function(){return _0x16e153(null,![],{'message':_0x35fc('0x16')});});}}}else{return _0x16e153(null,![],{'message':_0x35fc('0x16')});}}else{if(_0xc72d93[_0x35fc('0x10')]){return _0x16e153(null,![],{'message':_0x35fc('0x16')});}else if(_0x27524f[_0x35fc('0xc')]>0x0){if(_0xc72d93[_0x35fc('0x11')]){if(_0x27524f['blockDuration']>0x0){if(moment(_0xc72d93[_0x35fc('0x18')])[_0x35fc('0x19')](_0x27524f[_0x35fc('0xd')],_0x35fc('0x1a'))>moment()){return _0x16e153(null,![],{'message':_0x35fc('0x16')});}else{return utils['clearBlockUser'](_0xc72d93,0x0,![],null)[_0x35fc('0x14')](function(){return utils[_0x35fc('0x1c')](_0xc72d93);})['then'](function(){return _0x16e153(null,_0xc72d93);});}}else{return _0x16e153(null,![],{'message':_0x35fc('0x16')});}}else{return utils[_0x35fc('0x1b')](_0xc72d93,0x0,![],null)[_0x35fc('0x14')](function(){return utils['getLicense'](_0xc72d93);})[_0x35fc('0x14')](function(){return _0x16e153(null,_0xc72d93);})['catch'](function(_0x1bf180){return _0x16e153(null,![],_0x1bf180);});}}else{if(_0xc72d93[_0x35fc('0x11')]){return _0x16e153(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['getLicense'](_0xc72d93)[_0x35fc('0x14')](function(){return _0x16e153(null,_0xc72d93);});}}}});})['catch'](function(_0x274208){return _0x16e153(null,![],_0x274208);});}function sendServiceMail(_0x1a5d92){return db['MailAccount'][_0x35fc('0x1d')]({'where':{'service':!![]},'attributes':['id',_0x35fc('0x15'),_0x35fc('0x1e')],'include':[{'model':db[_0x35fc('0x1f')],'as':_0x35fc('0x20')}]})[_0x35fc('0x14')](function(_0x11ccdb){if(!_0x11ccdb){throw new Error(_0x35fc('0x21'));}var _0x54aedc={'tls':{'rejectUnauthorized':![]}};if(_0x11ccdb[_0x35fc('0x20')][_0x35fc('0x22')]){_0x54aedc[_0x35fc('0x22')]=_0x11ccdb['Smtp'][_0x35fc('0x22')];}else{_0x54aedc[_0x35fc('0x23')]=_0x11ccdb[_0x35fc('0x20')][_0x35fc('0x23')];_0x54aedc[_0x35fc('0x24')]=_0x11ccdb[_0x35fc('0x20')][_0x35fc('0x24')];_0x54aedc[_0x35fc('0x25')]=_0x11ccdb[_0x35fc('0x20')][_0x35fc('0x25')];}if(_0x11ccdb['Smtp']['authentication']){_0x54aedc[_0x35fc('0x26')]={'user':_0x11ccdb['Smtp'][_0x35fc('0x27')],'pass':_0x11ccdb[_0x35fc('0x20')][_0x35fc('0x28')]};}var _0x227471={'account':_0x54aedc,'message':_[_0x35fc('0x29')]({'from':util[_0x35fc('0x2a')]('\x22%s\x22\x20<%s>',_0x11ccdb[_0x35fc('0x15')],_0x11ccdb[_0x35fc('0x1e')]||_0x11ccdb[_0x35fc('0x20')][_0x35fc('0x27')])},_0x1a5d92)};return client[_0x35fc('0x2b')](_0x35fc('0x2c'),_0x227471);})['then'](function(_0x2483be){if(_0x2483be[_0x35fc('0x2d')]){throw new Error(util[_0x35fc('0x2a')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x2483be[_0x35fc('0x2d')]['message']||JSON[_0x35fc('0x2e')](_0x2483be[_0x35fc('0x2d')])));}return!![];});}function handleError(_0x266a11,_0x2e00e3,_0x4de4b7){return _0x266a11['status'](_0x2e00e3||0x1f4)['send']({'message':_0x4de4b7?_0x4de4b7[_0x35fc('0x2f')]||_0x4de4b7:''});}function checkPasswordPattern(_0x56c06c,_0x20f8bb,_0x4b4d4a){if(_0x4b4d4a){var _0x9c6b65=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x9c6b65[_0x35fc('0x30')](_0x20f8bb)){return _0x56c06c;}else{throw new Error(_0x35fc('0x31'));}}else{return _0x56c06c;}}exports[_0x35fc('0x32')]=function(_0x1c10e0,_0x3313fa,_0x9fe7d6){passport['authenticate'](_0x35fc('0x33'),function(_0x16087d,_0x4e0ce3,_0x1feda5){var _0x1ccc41=_0x16087d||_0x1feda5;if(_0x1ccc41){return handleError(_0x3313fa,0x191,_0x1ccc41);}if(!_0x4e0ce3){return handleError(_0x3313fa,0x194,{'message':_0x35fc('0x34')});}else{var _0x1d2ffe={'payload':{'id':_0x4e0ce3['id'],'role':_0x4e0ce3[_0x35fc('0x35')]},'options':{'expiresIn':0x15180}};return authService[_0x35fc('0x36')](_0x1d2ffe)['then'](function(_0x3f6480){_0x3313fa[_0x35fc('0x37')]({'id':_0x4e0ce3['id'],'token':_0x3f6480,'statusCall':'','isAlreadyLogged':_0x4e0ce3[_0x35fc('0x38')]});});}})(_0x1c10e0,_0x3313fa,_0x9fe7d6);};exports['forgot']=function(_0x17821e,_0x350a96,_0x596919){if(!_0x17821e[_0x35fc('0x39')][_0x35fc('0x1e')]){return handleError(_0x350a96,0x1f4,{'message':_0x35fc('0x3a')});}var _0x41e199=rs[_0x35fc('0x3b')]();_0x17821e[_0x35fc('0x39')][_0x35fc('0x1e')]=_0x17821e[_0x35fc('0x39')]['email']['trim']()[_0x35fc('0x3c')]();var _0x36fcf9;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x35fc('0xd')],'raw':!![]})[_0x35fc('0x14')](function(_0x4e56ed){_0x36fcf9=_0x4e56ed;return db[_0x35fc('0x3d')][_0x35fc('0x1d')]({'where':{'email':_0x17821e[_0x35fc('0x39')][_0x35fc('0x1e')]}});})['then'](function(_0x57105c){if(!_0x57105c){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x57105c['disabled']){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x57105c[_0x35fc('0x11')]){if(moment(_0x57105c[_0x35fc('0x18')])['add'](_0x36fcf9[_0x35fc('0xd')],'minutes')>moment()){throw new Error(_0x35fc('0x3e'));}else{_0x57105c[_0x35fc('0x11')]=![];_0x57105c[_0x35fc('0x18')]=null;}}_0x57105c[_0x35fc('0x3f')]=_0x41e199;_0x57105c[_0x35fc('0x40')]=Date['now']()+0x36ee80;return _0x57105c[_0x35fc('0x41')]();})[_0x35fc('0x14')](function(){return sendServiceMail({'to':_0x17821e['body'][_0x35fc('0x1e')],'subject':_0x35fc('0x42'),'text':_0x35fc('0x43')+_0x35fc('0x44')+'http://'+_0x17821e[_0x35fc('0x45')]['host']+'/reset/'+_0x41e199+'\x0a\x0a'+_0x35fc('0x46')});})[_0x35fc('0x14')](function(){_0x350a96[_0x35fc('0x47')](0xc8)[_0x35fc('0x48')]({'message':_0x35fc('0x49')});})[_0x35fc('0x4a')](function(_0x405320){return handleError(_0x350a96,0x1f4,_0x405320);});};exports[_0x35fc('0x4b')]=function(_0x4f555f,_0x3e2961,_0x91d7c0){var _0xeca02e;return db[_0x35fc('0x3d')][_0x35fc('0x1d')]({'where':{'resetPasswordToken':_0x4f555f[_0x35fc('0x4c')][_0x35fc('0x4d')],'resetPasswordExpires':{'$gt':Date[_0x35fc('0x4e')]()}}})[_0x35fc('0x14')](function(_0xe6eb6a){_0xeca02e=_0xe6eb6a;if(!_0xeca02e){throw new Error(_0x35fc('0x4f'));}return db[_0x35fc('0xa')][_0x35fc('0xb')]({'attributes':['id',_0x35fc('0x50')]});})['then'](function(_0x553ed6){return checkPasswordPattern(_0x553ed6,_0x4f555f[_0x35fc('0x39')][_0x35fc('0xe')],_0x553ed6[_0x35fc('0x50')]);})[_0x35fc('0x14')](function(){_0xeca02e[_0x35fc('0xe')]=_0x4f555f[_0x35fc('0x39')]['password'];_0xeca02e['resetPasswordToken']=null;_0xeca02e[_0x35fc('0x40')]=null;return _0xeca02e[_0x35fc('0x41')]();})[_0x35fc('0x14')](function(){_0x3e2961[_0x35fc('0x47')](0xc8)['send']({'message':_0x35fc('0x51')});})[_0x35fc('0x4a')](function(_0x4965d2){return handleError(_0x3e2961,0x1f4,_0x4965d2);});};passport[_0x35fc('0x52')](new LocalStrategy({'usernameField':_0x35fc('0x15'),'passwordField':'password'},function(_0x3e12e4,_0x1ab472,_0x26118e){return localAuthenticate(db[_0x35fc('0x3d')],_0x3e12e4,_0x1ab472,_0x26118e);})); \ No newline at end of file +var _0x53ec=['blockDuration','then','salt','blocked','blockedAt','loginAttempts','admin','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','add','minutes','clearBlockUser','disabled','getLicense','catch','find','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','auth','user','pass','merge','format','\x22%s\x22\x20<%s>','email','request','SendMail','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','error','status','send','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.','json','forgot','body','trim','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','now','save','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','Reset\x20Email\x20sent!','reset','params','token','securePassword','password','resetPasswordToken','Password\x20reset!','use','util','passport','passport-local','Strategy','jayson/promise','lodash','moment','../../components/auth/service','../../config/utils','http','Setting','findOne','allowedLoginAttempts'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0x53ec,0x192));var _0xc53e=function(_0x10dbf6,_0x3ff964){_0x10dbf6=_0x10dbf6-0x0;var _0x452147=_0x53ec[_0x10dbf6];return _0x452147;};'use strict';var util=require(_0xc53e('0x0'));var passport=require(_0xc53e('0x1'));var LocalStrategy=require(_0xc53e('0x2'))[_0xc53e('0x3')];var jayson=require(_0xc53e('0x4'));var _=require(_0xc53e('0x5'));var rs=require('randomstring');var moment=require(_0xc53e('0x6'));var db=require('../../mysqldb')['db'];var authService=require(_0xc53e('0x7'));var utils=require(_0xc53e('0x8'));var client=jayson['client'][_0xc53e('0x9')]({'port':0x232b});function localAuthenticate(_0x4f989b,_0x41a9e8,_0x2de88b,_0x5d3b28){var _0x1616ac,_0x1ac6c0;return db[_0xc53e('0xa')][_0xc53e('0xb')]({'where':{'id':0x1},'attributes':[_0xc53e('0xc'),_0xc53e('0xd')],'raw':!![]})[_0xc53e('0xe')](function(_0x361e9d){_0x1616ac=_0x361e9d;return _0x4f989b[_0xc53e('0xb')]({'attributes':['id','name','password',_0xc53e('0xf'),'role','disabled',_0xc53e('0x10'),_0xc53e('0x11'),_0xc53e('0x12')],'where':{'name':_0x41a9e8,'role':{'$or':[_0xc53e('0x13'),'user','agent']}}});})[_0xc53e('0xe')](function(_0x19a772){if(!_0x19a772||_0x19a772&&_0x19a772[_0xc53e('0x14')]!==_0x41a9e8){throw new Error(_0xc53e('0x15'));}else{_0x1ac6c0=_0x19a772;return _0x1ac6c0;}})[_0xc53e('0xe')](function(){_0x1ac6c0[_0xc53e('0x16')](_0x2de88b,function(_0x3dc2fa,_0x19c0d1){var _0x455e4d=_0x1ac6c0[_0xc53e('0x12')]+0x1;if(_0x3dc2fa){return _0x5d3b28(_0x3dc2fa);}else if(!_0x19c0d1){if(_0x1ac6c0['disabled']){return _0x5d3b28(null,![],{'message':_0xc53e('0x15')});}else if(_0x1616ac[_0xc53e('0xc')]>0x0){if(_0x1ac6c0[_0xc53e('0x10')]){if(_0x1616ac[_0xc53e('0xd')]>0x0){if(moment(_0x1ac6c0[_0xc53e('0x11')])[_0xc53e('0x17')](_0x1616ac[_0xc53e('0xd')],_0xc53e('0x18'))>moment()){return _0x5d3b28(null,![],{'message':_0xc53e('0x15')});}else{return utils['clearBlockUser'](_0x1ac6c0,_0x455e4d,![],null)['then'](function(){return _0x5d3b28(null,![],{'message':_0xc53e('0x15')});});}}else{return _0x5d3b28(null,![],{'message':_0xc53e('0x15')});}}else{if(_0x455e4d>=_0x1616ac[_0xc53e('0xc')]){return utils[_0xc53e('0x19')](_0x1ac6c0,0x0,!![],moment())[_0xc53e('0xe')](function(){return _0x5d3b28(null,![],{'message':_0xc53e('0x15')});});}else{return utils[_0xc53e('0x19')](_0x1ac6c0,_0x455e4d,![],null)[_0xc53e('0xe')](function(){return _0x5d3b28(null,![],{'message':_0xc53e('0x15')});});}}}else{return _0x5d3b28(null,![],{'message':_0xc53e('0x15')});}}else{if(_0x1ac6c0[_0xc53e('0x1a')]){return _0x5d3b28(null,![],{'message':_0xc53e('0x15')});}else if(_0x1616ac[_0xc53e('0xc')]>0x0){if(_0x1ac6c0['blocked']){if(_0x1616ac['blockDuration']>0x0){if(moment(_0x1ac6c0['blockedAt'])[_0xc53e('0x17')](_0x1616ac[_0xc53e('0xd')],_0xc53e('0x18'))>moment()){return _0x5d3b28(null,![],{'message':_0xc53e('0x15')});}else{return utils[_0xc53e('0x19')](_0x1ac6c0,0x0,![],null)['then'](function(){return utils['getLicense'](_0x1ac6c0);})[_0xc53e('0xe')](function(){return _0x5d3b28(null,_0x1ac6c0);});}}else{return _0x5d3b28(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0xc53e('0x19')](_0x1ac6c0,0x0,![],null)[_0xc53e('0xe')](function(){return utils[_0xc53e('0x1b')](_0x1ac6c0);})[_0xc53e('0xe')](function(){return _0x5d3b28(null,_0x1ac6c0);})[_0xc53e('0x1c')](function(_0x4df8cf){return _0x5d3b28(null,![],_0x4df8cf);});}}else{if(_0x1ac6c0[_0xc53e('0x10')]){return _0x5d3b28(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['getLicense'](_0x1ac6c0)['then'](function(){return _0x5d3b28(null,_0x1ac6c0);});}}}});})[_0xc53e('0x1c')](function(_0x57a1f5){return _0x5d3b28(null,![],_0x57a1f5);});}function sendServiceMail(_0x28240a){return db['MailAccount'][_0xc53e('0x1d')]({'where':{'service':!![]},'attributes':['id','name','email'],'include':[{'model':db[_0xc53e('0x1e')],'as':_0xc53e('0x1f')}]})[_0xc53e('0xe')](function(_0x2fa20b){if(!_0x2fa20b){throw new Error(_0xc53e('0x20'));}var _0xf97d78={'tls':{'rejectUnauthorized':![]}};if(_0x2fa20b[_0xc53e('0x1f')][_0xc53e('0x21')]){_0xf97d78['service']=_0x2fa20b[_0xc53e('0x1f')][_0xc53e('0x21')];}else{_0xf97d78[_0xc53e('0x22')]=_0x2fa20b['Smtp'][_0xc53e('0x22')];_0xf97d78['port']=_0x2fa20b[_0xc53e('0x1f')][_0xc53e('0x23')];_0xf97d78['secure']=_0x2fa20b['Smtp'][_0xc53e('0x24')];}if(_0x2fa20b[_0xc53e('0x1f')][_0xc53e('0x25')]){_0xf97d78[_0xc53e('0x26')]={'user':_0x2fa20b[_0xc53e('0x1f')][_0xc53e('0x27')],'pass':_0x2fa20b[_0xc53e('0x1f')][_0xc53e('0x28')]};}var _0x4ffddc={'account':_0xf97d78,'message':_[_0xc53e('0x29')]({'from':util[_0xc53e('0x2a')](_0xc53e('0x2b'),_0x2fa20b[_0xc53e('0x14')],_0x2fa20b[_0xc53e('0x2c')]||_0x2fa20b[_0xc53e('0x1f')][_0xc53e('0x27')])},_0x28240a)};return client[_0xc53e('0x2d')](_0xc53e('0x2e'),_0x4ffddc);})['then'](function(_0x3e395c){if(_0x3e395c['error']){throw new Error(util[_0xc53e('0x2a')](_0xc53e('0x2f'),_0x3e395c['error'][_0xc53e('0x30')]||JSON[_0xc53e('0x31')](_0x3e395c[_0xc53e('0x32')])));}return!![];});}function handleError(_0x5ed90b,_0x4b82bb,_0x17ec92){return _0x5ed90b[_0xc53e('0x33')](_0x4b82bb||0x1f4)[_0xc53e('0x34')]({'message':_0x17ec92?_0x17ec92[_0xc53e('0x30')]||_0x17ec92:''});}function checkPasswordPattern(_0x143101,_0x312c1b,_0x482085){if(_0x482085){var _0x2a85d1=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2a85d1[_0xc53e('0x35')](_0x312c1b)){return _0x143101;}else{throw new Error(_0xc53e('0x36'));}}else{return _0x143101;}}exports['login']=function(_0x70b6c3,_0x5e8ab7,_0xaa00cd){passport[_0xc53e('0x16')](_0xc53e('0x37'),function(_0xad1232,_0x3036e7,_0x5507d0){var _0x3dda55=_0xad1232||_0x5507d0;if(_0x3dda55){return handleError(_0x5e8ab7,0x191,_0x3dda55);}if(!_0x3036e7){return handleError(_0x5e8ab7,0x194,{'message':_0xc53e('0x38')});}else{var _0x4a5529={'payload':{'id':_0x3036e7['id'],'role':_0x3036e7['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x4a5529)['then'](function(_0x1e2ea3){_0x5e8ab7[_0xc53e('0x39')]({'id':_0x3036e7['id'],'token':_0x1e2ea3,'statusCall':'','isAlreadyLogged':_0x3036e7['online']});});}})(_0x70b6c3,_0x5e8ab7,_0xaa00cd);};exports[_0xc53e('0x3a')]=function(_0x574983,_0x55d07d,_0x53447e){if(!_0x574983[_0xc53e('0x3b')]['email']){return handleError(_0x55d07d,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x433a44=rs['generate']();_0x574983[_0xc53e('0x3b')][_0xc53e('0x2c')]=_0x574983['body'][_0xc53e('0x2c')][_0xc53e('0x3c')]()['toLowerCase']();var _0x2ebce7;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0xc53e('0xe')](function(_0x17b586){_0x2ebce7=_0x17b586;return db[_0xc53e('0x3d')]['find']({'where':{'email':_0x574983[_0xc53e('0x3b')][_0xc53e('0x2c')]}});})['then'](function(_0x58ede2){if(!_0x58ede2){throw new Error(_0xc53e('0x3e'));}if(_0x58ede2[_0xc53e('0x1a')]){throw new Error(_0xc53e('0x3f'));}if(_0x58ede2['blocked']){if(moment(_0x58ede2[_0xc53e('0x11')])[_0xc53e('0x17')](_0x2ebce7[_0xc53e('0xd')],_0xc53e('0x18'))>moment()){throw new Error(_0xc53e('0x40'));}else{_0x58ede2[_0xc53e('0x10')]=![];_0x58ede2[_0xc53e('0x11')]=null;}}_0x58ede2['resetPasswordToken']=_0x433a44;_0x58ede2[_0xc53e('0x41')]=Date[_0xc53e('0x42')]()+0x36ee80;return _0x58ede2[_0xc53e('0x43')]();})['then'](function(){return sendServiceMail({'to':_0x574983[_0xc53e('0x3b')][_0xc53e('0x2c')],'subject':_0xc53e('0x44'),'text':_0xc53e('0x45')+_0xc53e('0x46')+_0xc53e('0x47')+_0x574983['headers'][_0xc53e('0x22')]+_0xc53e('0x48')+_0x433a44+'\x0a\x0a'+_0xc53e('0x49')});})['then'](function(){_0x55d07d[_0xc53e('0x33')](0xc8)[_0xc53e('0x34')]({'message':_0xc53e('0x4a')});})[_0xc53e('0x1c')](function(_0x293f36){return handleError(_0x55d07d,0x1f4,_0x293f36);});};exports[_0xc53e('0x4b')]=function(_0x1a5a8f,_0x2ba2b4,_0x34de2d){var _0x430512;return db['User'][_0xc53e('0x1d')]({'where':{'resetPasswordToken':_0x1a5a8f[_0xc53e('0x4c')][_0xc53e('0x4d')],'resetPasswordExpires':{'$gt':Date[_0xc53e('0x42')]()}}})[_0xc53e('0xe')](function(_0x52dac7){_0x430512=_0x52dac7;if(!_0x430512){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0xc53e('0xa')]['findOne']({'attributes':['id',_0xc53e('0x4e')]});})['then'](function(_0x3a49a4){return checkPasswordPattern(_0x3a49a4,_0x1a5a8f[_0xc53e('0x3b')][_0xc53e('0x4f')],_0x3a49a4['securePassword']);})[_0xc53e('0xe')](function(){_0x430512[_0xc53e('0x4f')]=_0x1a5a8f[_0xc53e('0x3b')]['password'];_0x430512[_0xc53e('0x50')]=null;_0x430512['resetPasswordExpires']=null;return _0x430512[_0xc53e('0x43')]();})[_0xc53e('0xe')](function(){_0x2ba2b4['status'](0xc8)[_0xc53e('0x34')]({'message':_0xc53e('0x51')});})['catch'](function(_0x44f7cc){return handleError(_0x2ba2b4,0x1f4,_0x44f7cc);});};passport[_0xc53e('0x52')](new LocalStrategy({'usernameField':_0xc53e('0x14'),'passwordField':_0xc53e('0x4f')},function(_0x31f6e8,_0x3aeb8c,_0x27b6d4){return localAuthenticate(db[_0xc53e('0x3d')],_0x31f6e8,_0x3aeb8c,_0x27b6d4);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index a05d0a0..9298e97 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 _0xb3ff=['express','./authLocal.controller','post','login','/forgot','forgot','/reset/:token','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb3ff,0x180));var _0xfb3f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb3ff[_0x3dd15e];return _0x231fd0;};'use strict';var express=require(_0xfb3f('0x0'));var router=express['Router']();var controller=require(_0xfb3f('0x1'));router[_0xfb3f('0x2')]('/',controller[_0xfb3f('0x3')]);router[_0xfb3f('0x2')](_0xfb3f('0x4'),controller[_0xfb3f('0x5')]);router[_0xfb3f('0x2')](_0xfb3f('0x6'),controller['reset']);module[_0xfb3f('0x7')]=router; \ No newline at end of file +var _0x4003=['forgot','/reset/:token','exports','express','Router','post','/forgot'];(function(_0x144b03,_0x2b9335){var _0x46c33d=function(_0xb8001){while(--_0xb8001){_0x144b03['push'](_0x144b03['shift']());}};_0x46c33d(++_0x2b9335);}(_0x4003,0x184));var _0x3400=function(_0x12692f,_0x2fae5b){_0x12692f=_0x12692f-0x0;var _0x2412ab=_0x4003[_0x12692f];return _0x2412ab;};'use strict';var express=require(_0x3400('0x0'));var router=express[_0x3400('0x1')]();var controller=require('./authLocal.controller');router[_0x3400('0x2')]('/',controller['login']);router['post'](_0x3400('0x3'),controller[_0x3400('0x4')]);router[_0x3400('0x2')](_0x3400('0x5'),controller['reset']);module[_0x3400('0x6')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index c7be567..d0c790b 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 _0x8249=['STRING','BOOLEAN','sequelize'];(function(_0x57020d,_0x5aa5bd){var _0x1f3c11=function(_0xa208ba){while(--_0xa208ba){_0x57020d['push'](_0x57020d['shift']());}};_0x1f3c11(++_0x5aa5bd);}(_0x8249,0x155));var _0x9824=function(_0x3267ff,_0x177378){_0x3267ff=_0x3267ff-0x0;var _0xa98fd8=_0x8249[_0x3267ff];return _0xa98fd8;};'use strict';var Sequelize=require(_0x9824('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9824('0x1')]},'status':{'type':Sequelize[_0x9824('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}}; \ No newline at end of file +var _0x5574=['sequelize','STRING','BOOLEAN'];(function(_0x2c0df1,_0x475f8b){var _0x34e91b=function(_0x3ffa63){while(--_0x3ffa63){_0x2c0df1['push'](_0x2c0df1['shift']());}};_0x34e91b(++_0x475f8b);}(_0x5574,0x17a));var _0x4557=function(_0x5832dd,_0x1e6b00){_0x5832dd=_0x5832dd-0x0;var _0x338e03=_0x5574[_0x5832dd];return _0x338e03;};'use strict';var Sequelize=require(_0x4557('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x4557('0x1')]},'description':{'type':Sequelize[_0x4557('0x1')]},'status':{'type':Sequelize[_0x4557('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 e0e1782..33ec7a3 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 _0x686c=['request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','limit','Content-Range','json','apply','reject','save','update','then','sendStatus','error','stack','name','send','map','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','merge','field','filter','options','Automation','count','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','addConditions','Condition','omit','ids','getConditions','findOne','hasOwnProperty','addActions','Action','getActions','html-pdf','eml-format','rimraf','zip-dir'];(function(_0x10fe90,_0xfc40eb){var _0x4e0c81=function(_0x1aec9c){while(--_0x1aec9c){_0x10fe90['push'](_0x10fe90['shift']());}};_0x4e0c81(++_0xfc40eb);}(_0x686c,0xfe));var _0xc686=function(_0x5670bd,_0x4efe37){_0x5670bd=_0x5670bd-0x0;var _0x39ede0=_0x686c[_0x5670bd];return _0x39ede0;};'use strict';var pdf=require(_0xc686('0x0'));var emlformat=require(_0xc686('0x1'));var rimraf=require(_0xc686('0x2'));var zipdir=require(_0xc686('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc686('0x4'));var moment=require(_0xc686('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc686('0x6'));var path=require(_0xc686('0x7'));var sox=require(_0xc686('0x8'));var csv=require(_0xc686('0x9'));var ejs=require(_0xc686('0xa'));var fs=require('fs');var _=require(_0xc686('0xb'));var squel=require(_0xc686('0xc'));var crypto=require(_0xc686('0xd'));var jsforce=require(_0xc686('0xe'));var deskjs=require(_0xc686('0xf'));var toCsv=require(_0xc686('0x9'));var querystring=require(_0xc686('0x10'));var Papa=require(_0xc686('0x11'));var Redis=require(_0xc686('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xc686('0x13'));var as=require(_0xc686('0x14'));var hardwareService=require(_0xc686('0x15'));var logger=require(_0xc686('0x16'))('api');var utils=require(_0xc686('0x17'));var config=require(_0xc686('0x18'));var db=require(_0xc686('0x19'))['db'];function respondWithStatusCode(_0x2fed5a,_0x455cd2){_0x455cd2=_0x455cd2||0xcc;return function(_0xd2939e){if(_0xd2939e){return _0x2fed5a['sendStatus'](_0x455cd2);}return _0x2fed5a[_0xc686('0x1a')](_0x455cd2)[_0xc686('0x1b')]();};}function respondWithResult(_0x1b72eb,_0x14ff08){_0x14ff08=_0x14ff08||0xc8;return function(_0x383a3d){if(_0x383a3d){return _0x1b72eb[_0xc686('0x1a')](_0x14ff08)['json'](_0x383a3d);}};}function respondWithFilteredResult(_0x4a9546,_0x2c8ee8){return function(_0x193f3f){if(_0x193f3f){var _0x2293fd=_0x193f3f['count'],_0x140801=_0x2c8ee8[_0xc686('0x1c')],_0x15e1bd=_0x2c8ee8['offset']+_0x2c8ee8[_0xc686('0x1d')],_0x3015a2;if(_0x15e1bd>=_0x2293fd){_0x15e1bd=_0x2293fd;_0x3015a2=0xc8;}else{_0x3015a2=0xce;}_0x4a9546[_0xc686('0x1a')](_0x3015a2);return _0x4a9546['set'](_0xc686('0x1e'),_0x140801+'-'+_0x15e1bd+'/'+_0x2293fd)[_0xc686('0x1f')](_0x193f3f);}return null;};}function patchUpdates(_0x1bebd2){return function(_0x20b0c9){try{jsonpatch[_0xc686('0x20')](_0x20b0c9,_0x1bebd2,!![]);}catch(_0x1e91c7){return BPromise[_0xc686('0x21')](_0x1e91c7);}return _0x20b0c9[_0xc686('0x22')]();};}function saveUpdates(_0x467647,_0x447ea4){return function(_0x46f055){if(_0x46f055){return _0x46f055[_0xc686('0x23')](_0x467647)[_0xc686('0x24')](function(_0x51b833){return _0x51b833;});}return null;};}function removeEntity(_0x173cbd,_0x2eaa31){return function(_0x140cd7){if(_0x140cd7){return _0x140cd7['destroy']()[_0xc686('0x24')](function(){_0x173cbd[_0xc686('0x1a')](0xcc)[_0xc686('0x1b')]();});}};}function handleEntityNotFound(_0x19d5bd,_0x21be60){return function(_0x28f23f){if(!_0x28f23f){_0x19d5bd[_0xc686('0x25')](0x194);}return _0x28f23f;};}function handleError(_0x2bc020,_0x22790b){_0x22790b=_0x22790b||0x1f4;return function(_0x13f20b){logger[_0xc686('0x26')](_0x13f20b[_0xc686('0x27')]);if(_0x13f20b['name']){delete _0x13f20b[_0xc686('0x28')];}_0x2bc020['status'](_0x22790b)[_0xc686('0x29')](_0x13f20b);};}exports['index']=function(_0x5ae64e,_0x493fc2){var _0x54589a={},_0x44958e={},_0x5e934e={'count':0x0,'rows':[]};var _0x214bd8=_[_0xc686('0x2a')](db['Automation'][_0xc686('0x2b')],function(_0x3de9df){return{'name':_0x3de9df[_0xc686('0x2c')],'type':_0x3de9df[_0xc686('0x2d')][_0xc686('0x2e')]};});_0x44958e['model']=_[_0xc686('0x2a')](_0x214bd8,'name');_0x44958e[_0xc686('0x2f')]=_['keys'](_0x5ae64e[_0xc686('0x2f')]);_0x44958e[_0xc686('0x30')]=_[_0xc686('0x31')](_0x44958e[_0xc686('0x32')],_0x44958e['query']);_0x54589a['attributes']=_[_0xc686('0x31')](_0x44958e[_0xc686('0x32')],qs[_0xc686('0x33')](_0x5ae64e['query'][_0xc686('0x33')]));_0x54589a['attributes']=_0x54589a[_0xc686('0x34')][_0xc686('0x35')]?_0x54589a[_0xc686('0x34')]:_0x44958e[_0xc686('0x32')];if(!_0x5ae64e[_0xc686('0x2f')]['hasOwnProperty'](_0xc686('0x36'))){_0x54589a['limit']=qs[_0xc686('0x1d')](_0x5ae64e[_0xc686('0x2f')][_0xc686('0x1d')]);_0x54589a[_0xc686('0x1c')]=qs['offset'](_0x5ae64e[_0xc686('0x2f')][_0xc686('0x1c')]);}_0x54589a[_0xc686('0x37')]=qs[_0xc686('0x38')](_0x5ae64e[_0xc686('0x2f')][_0xc686('0x38')]);_0x54589a[_0xc686('0x39')]=qs[_0xc686('0x30')](_[_0xc686('0x3a')](_0x5ae64e[_0xc686('0x2f')],_0x44958e[_0xc686('0x30')]));if(_0x5ae64e[_0xc686('0x2f')]['filter']){_0x54589a['where']=_[_0xc686('0x3b')](_0x54589a[_0xc686('0x39')],{'$or':_['map'](_0x214bd8,function(_0x266f40){if(_0x266f40['type'][_0xc686('0x2e')]!=='VIRTUAL'){var _0x3e723f={};_0x3e723f[_0x266f40[_0xc686('0x3c')]]={'$like':'%'+_0x5ae64e[_0xc686('0x2f')][_0xc686('0x3d')]+'%'};return _0x3e723f;}})});}_0x54589a=_[_0xc686('0x3b')]({},_0x54589a,_0x5ae64e[_0xc686('0x3e')]);var _0x7b7bcb={'where':_0x54589a[_0xc686('0x39')]};return db[_0xc686('0x3f')][_0xc686('0x40')](_0x7b7bcb)[_0xc686('0x24')](function(_0x429d2a){_0x5e934e[_0xc686('0x40')]=_0x429d2a;if(_0x5ae64e[_0xc686('0x2f')][_0xc686('0x41')]){_0x54589a[_0xc686('0x42')]=[{'all':!![]}];}return db[_0xc686('0x3f')][_0xc686('0x43')](_0x54589a);})['then'](function(_0x2c108c){_0x5e934e[_0xc686('0x44')]=_0x2c108c;return _0x5e934e;})[_0xc686('0x24')](respondWithFilteredResult(_0x493fc2,_0x54589a))[_0xc686('0x45')](handleError(_0x493fc2,null));};exports[_0xc686('0x46')]=function(_0x1051a8,_0x5b9838){var _0x55011={'raw':![],'where':{'id':_0x1051a8[_0xc686('0x47')]['id']}},_0x26fc9b={};_0x26fc9b[_0xc686('0x32')]=_[_0xc686('0x48')](db['Automation'][_0xc686('0x2b')]);_0x26fc9b[_0xc686('0x2f')]=_['keys'](_0x1051a8[_0xc686('0x2f')]);_0x26fc9b['filters']=_[_0xc686('0x31')](_0x26fc9b[_0xc686('0x32')],_0x26fc9b['query']);_0x55011[_0xc686('0x34')]=_[_0xc686('0x31')](_0x26fc9b[_0xc686('0x32')],qs['fields'](_0x1051a8[_0xc686('0x2f')][_0xc686('0x33')]));_0x55011['attributes']=_0x55011['attributes'][_0xc686('0x35')]?_0x55011['attributes']:_0x26fc9b['model'];if(_0x1051a8['query'][_0xc686('0x41')]){_0x55011[_0xc686('0x42')]=[{'all':!![]}];}_0x55011=_[_0xc686('0x3b')]({},_0x55011,_0x1051a8[_0xc686('0x3e')]);return db[_0xc686('0x3f')][_0xc686('0x49')](_0x55011)[_0xc686('0x24')](handleEntityNotFound(_0x5b9838,null))[_0xc686('0x24')](respondWithResult(_0x5b9838,null))[_0xc686('0x45')](handleError(_0x5b9838,null));};exports[_0xc686('0x4a')]=function(_0xccd45d,_0x25d179){return db['Automation'][_0xc686('0x4a')](_0xccd45d['body'],{})['then'](respondWithResult(_0x25d179,0xc9))[_0xc686('0x45')](handleError(_0x25d179,null));};exports[_0xc686('0x23')]=function(_0x3e544f,_0x569eb8){if(_0x3e544f['body']['id']){delete _0x3e544f[_0xc686('0x4b')]['id'];}return db['Automation'][_0xc686('0x49')]({'where':{'id':_0x3e544f['params']['id']}})[_0xc686('0x24')](handleEntityNotFound(_0x569eb8,null))['then'](saveUpdates(_0x3e544f['body'],null))['then'](respondWithResult(_0x569eb8,null))['catch'](handleError(_0x569eb8,null));};exports['destroy']=function(_0x8eb0ca,_0x25e02b){return db[_0xc686('0x3f')][_0xc686('0x49')]({'where':{'id':_0x8eb0ca[_0xc686('0x47')]['id']}})[_0xc686('0x24')](handleEntityNotFound(_0x25e02b,null))[_0xc686('0x24')](removeEntity(_0x25e02b,null))[_0xc686('0x45')](handleError(_0x25e02b,null));};exports[_0xc686('0x4c')]=function(_0x20ceb0,_0x575c58,_0x4f9ade){return db[_0xc686('0x4d')][_0xc686('0x49')]({'where':{'id':_0x20ceb0['params']['id']}})[_0xc686('0x24')](handleEntityNotFound(_0x575c58,null))[_0xc686('0x24')](function(_0x900568){if(_0x900568){return _0x900568[_0xc686('0x4c')](_0x20ceb0[_0xc686('0x4b')]['ids'],_[_0xc686('0x4e')](_0x20ceb0['body'],[_0xc686('0x4f'),'id'])||{});}})['then'](respondWithResult(_0x575c58,null))[_0xc686('0x45')](handleError(_0x575c58,null));};exports[_0xc686('0x50')]=function(_0x5d984b,_0x5ef65a,_0x5a28ad){var _0x4ffe8c={};var _0x439bc6={};var _0x4bea93;var _0x1c79bf;return db[_0xc686('0x3f')][_0xc686('0x51')]({'where':{'id':_0x5d984b[_0xc686('0x47')]['id']}})[_0xc686('0x24')](handleEntityNotFound(_0x5ef65a,null))[_0xc686('0x24')](function(_0x330078){if(_0x330078){_0x4bea93=_0x330078;_0x439bc6[_0xc686('0x32')]=_[_0xc686('0x48')](db[_0xc686('0x4d')]['rawAttributes']);_0x439bc6[_0xc686('0x2f')]=_[_0xc686('0x48')](_0x5d984b[_0xc686('0x2f')]);_0x439bc6['filters']=_[_0xc686('0x31')](_0x439bc6['model'],_0x439bc6[_0xc686('0x2f')]);_0x4ffe8c[_0xc686('0x34')]=_[_0xc686('0x31')](_0x439bc6[_0xc686('0x32')],qs['fields'](_0x5d984b['query'][_0xc686('0x33')]));_0x4ffe8c[_0xc686('0x34')]=_0x4ffe8c['attributes'][_0xc686('0x35')]?_0x4ffe8c[_0xc686('0x34')]:_0x439bc6[_0xc686('0x32')];_0x4ffe8c[_0xc686('0x37')]=qs[_0xc686('0x38')](_0x5d984b['query']['sort']);_0x4ffe8c[_0xc686('0x39')]=qs[_0xc686('0x30')](_['pick'](_0x5d984b[_0xc686('0x2f')],_0x439bc6['filters']));if(_0x5d984b[_0xc686('0x2f')][_0xc686('0x3d')]){_0x4ffe8c[_0xc686('0x39')]=_['merge'](_0x4ffe8c[_0xc686('0x39')],{'$or':_[_0xc686('0x2a')](_0x4ffe8c[_0xc686('0x34')],function(_0x50391a){var _0x22c6aa={};_0x22c6aa[_0x50391a]={'$like':'%'+_0x5d984b[_0xc686('0x2f')][_0xc686('0x3d')]+'%'};return _0x22c6aa;})});}_0x4ffe8c=_[_0xc686('0x3b')]({},_0x4ffe8c,_0x5d984b[_0xc686('0x3e')]);return _0x4bea93[_0xc686('0x50')](_0x4ffe8c);}})[_0xc686('0x24')](function(_0x4085c2){if(_0x4085c2){_0x1c79bf=_0x4085c2['length'];if(!_0x5d984b[_0xc686('0x2f')][_0xc686('0x52')](_0xc686('0x36'))){_0x4ffe8c[_0xc686('0x1d')]=qs[_0xc686('0x1d')](_0x5d984b[_0xc686('0x2f')][_0xc686('0x1d')]);_0x4ffe8c['offset']=qs['offset'](_0x5d984b[_0xc686('0x2f')][_0xc686('0x1c')]);}return _0x4bea93[_0xc686('0x50')](_0x4ffe8c);}})[_0xc686('0x24')](function(_0x330437){if(_0x330437){return _0x330437?{'count':_0x1c79bf,'rows':_0x330437}:null;}})[_0xc686('0x24')](respondWithResult(_0x5ef65a,null))['catch'](handleError(_0x5ef65a,null));};exports[_0xc686('0x53')]=function(_0x1abb27,_0xb6db9e,_0x493cec){return db['Action'][_0xc686('0x49')]({'where':{'id':_0x1abb27[_0xc686('0x47')]['id']}})[_0xc686('0x24')](handleEntityNotFound(_0xb6db9e,null))['then'](function(_0x1939b1){if(_0x1939b1){return _0x1939b1['addActions'](_0x1abb27[_0xc686('0x4b')][_0xc686('0x4f')],_['omit'](_0x1abb27[_0xc686('0x4b')],['ids','id'])||{});}})[_0xc686('0x24')](respondWithResult(_0xb6db9e,null))[_0xc686('0x45')](handleError(_0xb6db9e,null));};exports['getActions']=function(_0x30149a,_0x5122c1,_0x48bf45){var _0x52cd2d={};var _0x391ffb={};var _0x3ce673;var _0x3b0c17;return db[_0xc686('0x3f')][_0xc686('0x51')]({'where':{'id':_0x30149a['params']['id']}})[_0xc686('0x24')](handleEntityNotFound(_0x5122c1,null))[_0xc686('0x24')](function(_0x4eb44b){if(_0x4eb44b){_0x3ce673=_0x4eb44b;_0x391ffb[_0xc686('0x32')]=_[_0xc686('0x48')](db[_0xc686('0x54')][_0xc686('0x2b')]);_0x391ffb[_0xc686('0x2f')]=_[_0xc686('0x48')](_0x30149a['query']);_0x391ffb['filters']=_['intersection'](_0x391ffb[_0xc686('0x32')],_0x391ffb[_0xc686('0x2f')]);_0x52cd2d[_0xc686('0x34')]=_[_0xc686('0x31')](_0x391ffb[_0xc686('0x32')],qs[_0xc686('0x33')](_0x30149a[_0xc686('0x2f')]['fields']));_0x52cd2d[_0xc686('0x34')]=_0x52cd2d[_0xc686('0x34')][_0xc686('0x35')]?_0x52cd2d['attributes']:_0x391ffb[_0xc686('0x32')];_0x52cd2d[_0xc686('0x37')]=qs['sort'](_0x30149a[_0xc686('0x2f')]['sort']);_0x52cd2d[_0xc686('0x39')]=qs[_0xc686('0x30')](_['pick'](_0x30149a[_0xc686('0x2f')],_0x391ffb[_0xc686('0x30')]));if(_0x30149a[_0xc686('0x2f')]['filter']){_0x52cd2d[_0xc686('0x39')]=_[_0xc686('0x3b')](_0x52cd2d[_0xc686('0x39')],{'$or':_[_0xc686('0x2a')](_0x52cd2d[_0xc686('0x34')],function(_0x3d86a8){var _0x5dc7bb={};_0x5dc7bb[_0x3d86a8]={'$like':'%'+_0x30149a[_0xc686('0x2f')][_0xc686('0x3d')]+'%'};return _0x5dc7bb;})});}_0x52cd2d=_[_0xc686('0x3b')]({},_0x52cd2d,_0x30149a[_0xc686('0x3e')]);return _0x3ce673['getActions'](_0x52cd2d);}})['then'](function(_0x43c205){if(_0x43c205){_0x3b0c17=_0x43c205[_0xc686('0x35')];if(!_0x30149a[_0xc686('0x2f')][_0xc686('0x52')](_0xc686('0x36'))){_0x52cd2d[_0xc686('0x1d')]=qs[_0xc686('0x1d')](_0x30149a['query']['limit']);_0x52cd2d[_0xc686('0x1c')]=qs['offset'](_0x30149a[_0xc686('0x2f')][_0xc686('0x1c')]);}return _0x3ce673[_0xc686('0x55')](_0x52cd2d);}})[_0xc686('0x24')](function(_0x54d900){if(_0x54d900){return _0x54d900?{'count':_0x3b0c17,'rows':_0x54d900}:null;}})['then'](respondWithResult(_0x5122c1,null))[_0xc686('0x45')](handleError(_0x5122c1,null));}; \ No newline at end of file +var _0x7347=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','status','end','json','offset','limit','set','Content-Range','reject','save','destroy','then','sendStatus','error','stack','name','send','index','rawAttributes','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','field','filter','options','Automation','count','includeAll','include','findAll','rows','catch','show','find','create','body','update','params','addConditions','Condition','ids','omit','addActions','findOne','order','getActions','html-pdf','eml-format','rimraf','moment','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x2c6af3,_0x3ce442){var _0x4895bf=function(_0x5566cf){while(--_0x5566cf){_0x2c6af3['push'](_0x2c6af3['shift']());}};_0x4895bf(++_0x3ce442);}(_0x7347,0xea));var _0x7734=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0x7347[_0x4ae6ef];return _0x3cbb4e;};'use strict';var pdf=require(_0x7734('0x0'));var emlformat=require(_0x7734('0x1'));var rimraf=require(_0x7734('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7734('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x7734('0x4'));var util=require(_0x7734('0x5'));var path=require(_0x7734('0x6'));var sox=require(_0x7734('0x7'));var csv=require(_0x7734('0x8'));var ejs=require(_0x7734('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x7734('0xa'));var jsforce=require(_0x7734('0xb'));var deskjs=require(_0x7734('0xc'));var toCsv=require(_0x7734('0x8'));var querystring=require(_0x7734('0xd'));var Papa=require(_0x7734('0xe'));var Redis=require(_0x7734('0xf'));var authService=require(_0x7734('0x10'));var qs=require(_0x7734('0x11'));var as=require(_0x7734('0x12'));var hardwareService=require(_0x7734('0x13'));var logger=require(_0x7734('0x14'))(_0x7734('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x7734('0x16'))['db'];function respondWithStatusCode(_0x5c5b18,_0xcfb008){_0xcfb008=_0xcfb008||0xcc;return function(_0x163974){if(_0x163974){return _0x5c5b18['sendStatus'](_0xcfb008);}return _0x5c5b18[_0x7734('0x17')](_0xcfb008)[_0x7734('0x18')]();};}function respondWithResult(_0xe3ae3f,_0x23ddf0){_0x23ddf0=_0x23ddf0||0xc8;return function(_0x1262e1){if(_0x1262e1){return _0xe3ae3f['status'](_0x23ddf0)[_0x7734('0x19')](_0x1262e1);}};}function respondWithFilteredResult(_0x4b6f29,_0x481ac4){return function(_0x417daa){if(_0x417daa){var _0x5b356c=_0x417daa['count'],_0x5e2faf=_0x481ac4[_0x7734('0x1a')],_0x41797c=_0x481ac4[_0x7734('0x1a')]+_0x481ac4[_0x7734('0x1b')],_0x519a18;if(_0x41797c>=_0x5b356c){_0x41797c=_0x5b356c;_0x519a18=0xc8;}else{_0x519a18=0xce;}_0x4b6f29[_0x7734('0x17')](_0x519a18);return _0x4b6f29[_0x7734('0x1c')](_0x7734('0x1d'),_0x5e2faf+'-'+_0x41797c+'/'+_0x5b356c)[_0x7734('0x19')](_0x417daa);}return null;};}function patchUpdates(_0x2e7019){return function(_0x494a07){try{jsonpatch['apply'](_0x494a07,_0x2e7019,!![]);}catch(_0x289de5){return BPromise[_0x7734('0x1e')](_0x289de5);}return _0x494a07[_0x7734('0x1f')]();};}function saveUpdates(_0x3688d7,_0xa268dd){return function(_0x462e89){if(_0x462e89){return _0x462e89['update'](_0x3688d7)['then'](function(_0x3a2061){return _0x3a2061;});}return null;};}function removeEntity(_0x13e95a,_0x5ca023){return function(_0x232026){if(_0x232026){return _0x232026[_0x7734('0x20')]()[_0x7734('0x21')](function(){_0x13e95a[_0x7734('0x17')](0xcc)[_0x7734('0x18')]();});}};}function handleEntityNotFound(_0x5dde9f,_0x334abb){return function(_0x4c9a34){if(!_0x4c9a34){_0x5dde9f[_0x7734('0x22')](0x194);}return _0x4c9a34;};}function handleError(_0x2ae0af,_0x3e0fc3){_0x3e0fc3=_0x3e0fc3||0x1f4;return function(_0x4f0733){logger[_0x7734('0x23')](_0x4f0733[_0x7734('0x24')]);if(_0x4f0733[_0x7734('0x25')]){delete _0x4f0733['name'];}_0x2ae0af[_0x7734('0x17')](_0x3e0fc3)[_0x7734('0x26')](_0x4f0733);};}exports[_0x7734('0x27')]=function(_0x5ecc5,_0x5ce59c){var _0x404cdc={},_0x39a212={},_0x56dfd8={'count':0x0,'rows':[]};var _0x316f30=_['map'](db['Automation'][_0x7734('0x28')],function(_0x2ecbdb){return{'name':_0x2ecbdb['fieldName'],'type':_0x2ecbdb['type'][_0x7734('0x29')]};});_0x39a212[_0x7734('0x2a')]=_[_0x7734('0x2b')](_0x316f30,_0x7734('0x25'));_0x39a212[_0x7734('0x2c')]=_[_0x7734('0x2d')](_0x5ecc5[_0x7734('0x2c')]);_0x39a212[_0x7734('0x2e')]=_[_0x7734('0x2f')](_0x39a212[_0x7734('0x2a')],_0x39a212['query']);_0x404cdc[_0x7734('0x30')]=_[_0x7734('0x2f')](_0x39a212['model'],qs[_0x7734('0x31')](_0x5ecc5[_0x7734('0x2c')][_0x7734('0x31')]));_0x404cdc[_0x7734('0x30')]=_0x404cdc[_0x7734('0x30')][_0x7734('0x32')]?_0x404cdc[_0x7734('0x30')]:_0x39a212[_0x7734('0x2a')];if(!_0x5ecc5[_0x7734('0x2c')][_0x7734('0x33')](_0x7734('0x34'))){_0x404cdc[_0x7734('0x1b')]=qs[_0x7734('0x1b')](_0x5ecc5[_0x7734('0x2c')][_0x7734('0x1b')]);_0x404cdc[_0x7734('0x1a')]=qs['offset'](_0x5ecc5[_0x7734('0x2c')][_0x7734('0x1a')]);}_0x404cdc['order']=qs[_0x7734('0x35')](_0x5ecc5['query'][_0x7734('0x35')]);_0x404cdc[_0x7734('0x36')]=qs['filters'](_[_0x7734('0x37')](_0x5ecc5['query'],_0x39a212[_0x7734('0x2e')]));if(_0x5ecc5[_0x7734('0x2c')]['filter']){_0x404cdc[_0x7734('0x36')]=_[_0x7734('0x38')](_0x404cdc[_0x7734('0x36')],{'$or':_['map'](_0x316f30,function(_0x3b6e4b){if(_0x3b6e4b[_0x7734('0x39')][_0x7734('0x29')]!==_0x7734('0x3a')){var _0x6ed475={};_0x6ed475[_0x3b6e4b[_0x7734('0x3b')]]={'$like':'%'+_0x5ecc5['query'][_0x7734('0x3c')]+'%'};return _0x6ed475;}})});}_0x404cdc=_['merge']({},_0x404cdc,_0x5ecc5[_0x7734('0x3d')]);var _0x3aaa5f={'where':_0x404cdc[_0x7734('0x36')]};return db[_0x7734('0x3e')][_0x7734('0x3f')](_0x3aaa5f)[_0x7734('0x21')](function(_0x11e9b2){_0x56dfd8[_0x7734('0x3f')]=_0x11e9b2;if(_0x5ecc5[_0x7734('0x2c')][_0x7734('0x40')]){_0x404cdc[_0x7734('0x41')]=[{'all':!![]}];}return db[_0x7734('0x3e')][_0x7734('0x42')](_0x404cdc);})[_0x7734('0x21')](function(_0x1ec582){_0x56dfd8[_0x7734('0x43')]=_0x1ec582;return _0x56dfd8;})[_0x7734('0x21')](respondWithFilteredResult(_0x5ce59c,_0x404cdc))[_0x7734('0x44')](handleError(_0x5ce59c,null));};exports[_0x7734('0x45')]=function(_0x515729,_0xf191b1){var _0x241d72={'raw':![],'where':{'id':_0x515729['params']['id']}},_0x1c9dec={};_0x1c9dec['model']=_[_0x7734('0x2d')](db[_0x7734('0x3e')][_0x7734('0x28')]);_0x1c9dec['query']=_[_0x7734('0x2d')](_0x515729[_0x7734('0x2c')]);_0x1c9dec[_0x7734('0x2e')]=_['intersection'](_0x1c9dec['model'],_0x1c9dec[_0x7734('0x2c')]);_0x241d72[_0x7734('0x30')]=_[_0x7734('0x2f')](_0x1c9dec[_0x7734('0x2a')],qs[_0x7734('0x31')](_0x515729['query'][_0x7734('0x31')]));_0x241d72[_0x7734('0x30')]=_0x241d72['attributes'][_0x7734('0x32')]?_0x241d72[_0x7734('0x30')]:_0x1c9dec['model'];if(_0x515729[_0x7734('0x2c')][_0x7734('0x40')]){_0x241d72[_0x7734('0x41')]=[{'all':!![]}];}_0x241d72=_['merge']({},_0x241d72,_0x515729[_0x7734('0x3d')]);return db[_0x7734('0x3e')][_0x7734('0x46')](_0x241d72)[_0x7734('0x21')](handleEntityNotFound(_0xf191b1,null))['then'](respondWithResult(_0xf191b1,null))['catch'](handleError(_0xf191b1,null));};exports[_0x7734('0x47')]=function(_0x1a424a,_0x18b816){return db[_0x7734('0x3e')][_0x7734('0x47')](_0x1a424a[_0x7734('0x48')],{})['then'](respondWithResult(_0x18b816,0xc9))[_0x7734('0x44')](handleError(_0x18b816,null));};exports[_0x7734('0x49')]=function(_0x31fa53,_0x264545){if(_0x31fa53[_0x7734('0x48')]['id']){delete _0x31fa53[_0x7734('0x48')]['id'];}return db['Automation'][_0x7734('0x46')]({'where':{'id':_0x31fa53[_0x7734('0x4a')]['id']}})[_0x7734('0x21')](handleEntityNotFound(_0x264545,null))[_0x7734('0x21')](saveUpdates(_0x31fa53[_0x7734('0x48')],null))['then'](respondWithResult(_0x264545,null))['catch'](handleError(_0x264545,null));};exports[_0x7734('0x20')]=function(_0xf62465,_0x28badb){return db['Automation'][_0x7734('0x46')]({'where':{'id':_0xf62465[_0x7734('0x4a')]['id']}})[_0x7734('0x21')](handleEntityNotFound(_0x28badb,null))['then'](removeEntity(_0x28badb,null))['catch'](handleError(_0x28badb,null));};exports[_0x7734('0x4b')]=function(_0x370a6d,_0x25dea5,_0x1e4c32){return db[_0x7734('0x4c')][_0x7734('0x46')]({'where':{'id':_0x370a6d[_0x7734('0x4a')]['id']}})[_0x7734('0x21')](handleEntityNotFound(_0x25dea5,null))['then'](function(_0x7495f2){if(_0x7495f2){return _0x7495f2[_0x7734('0x4b')](_0x370a6d[_0x7734('0x48')][_0x7734('0x4d')],_[_0x7734('0x4e')](_0x370a6d['body'],[_0x7734('0x4d'),'id'])||{});}})['then'](respondWithResult(_0x25dea5,null))[_0x7734('0x44')](handleError(_0x25dea5,null));};exports['getConditions']=function(_0xe27bb2,_0x433afd,_0x22e973){var _0x3bf264={};var _0x5f4c17={};var _0x34797f;var _0x4c5afd;return db['Automation']['findOne']({'where':{'id':_0xe27bb2[_0x7734('0x4a')]['id']}})[_0x7734('0x21')](handleEntityNotFound(_0x433afd,null))['then'](function(_0x3e9cf7){if(_0x3e9cf7){_0x34797f=_0x3e9cf7;_0x5f4c17['model']=_[_0x7734('0x2d')](db[_0x7734('0x4c')][_0x7734('0x28')]);_0x5f4c17[_0x7734('0x2c')]=_['keys'](_0xe27bb2[_0x7734('0x2c')]);_0x5f4c17['filters']=_[_0x7734('0x2f')](_0x5f4c17[_0x7734('0x2a')],_0x5f4c17['query']);_0x3bf264['attributes']=_[_0x7734('0x2f')](_0x5f4c17[_0x7734('0x2a')],qs[_0x7734('0x31')](_0xe27bb2[_0x7734('0x2c')][_0x7734('0x31')]));_0x3bf264[_0x7734('0x30')]=_0x3bf264['attributes']['length']?_0x3bf264[_0x7734('0x30')]:_0x5f4c17['model'];_0x3bf264['order']=qs['sort'](_0xe27bb2[_0x7734('0x2c')][_0x7734('0x35')]);_0x3bf264[_0x7734('0x36')]=qs[_0x7734('0x2e')](_[_0x7734('0x37')](_0xe27bb2['query'],_0x5f4c17[_0x7734('0x2e')]));if(_0xe27bb2[_0x7734('0x2c')][_0x7734('0x3c')]){_0x3bf264[_0x7734('0x36')]=_[_0x7734('0x38')](_0x3bf264[_0x7734('0x36')],{'$or':_[_0x7734('0x2b')](_0x3bf264[_0x7734('0x30')],function(_0x1f817){var _0x4b6399={};_0x4b6399[_0x1f817]={'$like':'%'+_0xe27bb2[_0x7734('0x2c')][_0x7734('0x3c')]+'%'};return _0x4b6399;})});}_0x3bf264=_['merge']({},_0x3bf264,_0xe27bb2[_0x7734('0x3d')]);return _0x34797f['getConditions'](_0x3bf264);}})['then'](function(_0x20632f){if(_0x20632f){_0x4c5afd=_0x20632f[_0x7734('0x32')];if(!_0xe27bb2['query'][_0x7734('0x33')](_0x7734('0x34'))){_0x3bf264[_0x7734('0x1b')]=qs[_0x7734('0x1b')](_0xe27bb2[_0x7734('0x2c')][_0x7734('0x1b')]);_0x3bf264[_0x7734('0x1a')]=qs[_0x7734('0x1a')](_0xe27bb2[_0x7734('0x2c')][_0x7734('0x1a')]);}return _0x34797f['getConditions'](_0x3bf264);}})['then'](function(_0x5dd14e){if(_0x5dd14e){return _0x5dd14e?{'count':_0x4c5afd,'rows':_0x5dd14e}:null;}})[_0x7734('0x21')](respondWithResult(_0x433afd,null))[_0x7734('0x44')](handleError(_0x433afd,null));};exports[_0x7734('0x4f')]=function(_0x224f93,_0x194361,_0xf3dc93){return db['Action']['find']({'where':{'id':_0x224f93[_0x7734('0x4a')]['id']}})[_0x7734('0x21')](handleEntityNotFound(_0x194361,null))[_0x7734('0x21')](function(_0x2041f6){if(_0x2041f6){return _0x2041f6[_0x7734('0x4f')](_0x224f93[_0x7734('0x48')][_0x7734('0x4d')],_[_0x7734('0x4e')](_0x224f93[_0x7734('0x48')],[_0x7734('0x4d'),'id'])||{});}})[_0x7734('0x21')](respondWithResult(_0x194361,null))[_0x7734('0x44')](handleError(_0x194361,null));};exports['getActions']=function(_0x65dc19,_0x5a1474,_0x63fa0f){var _0x2bbef5={};var _0x55dc0b={};var _0xda57b5;var _0x5f3028;return db['Automation'][_0x7734('0x50')]({'where':{'id':_0x65dc19[_0x7734('0x4a')]['id']}})[_0x7734('0x21')](handleEntityNotFound(_0x5a1474,null))[_0x7734('0x21')](function(_0x20afd1){if(_0x20afd1){_0xda57b5=_0x20afd1;_0x55dc0b[_0x7734('0x2a')]=_[_0x7734('0x2d')](db['Action'][_0x7734('0x28')]);_0x55dc0b[_0x7734('0x2c')]=_[_0x7734('0x2d')](_0x65dc19[_0x7734('0x2c')]);_0x55dc0b[_0x7734('0x2e')]=_[_0x7734('0x2f')](_0x55dc0b['model'],_0x55dc0b['query']);_0x2bbef5[_0x7734('0x30')]=_[_0x7734('0x2f')](_0x55dc0b['model'],qs[_0x7734('0x31')](_0x65dc19[_0x7734('0x2c')][_0x7734('0x31')]));_0x2bbef5[_0x7734('0x30')]=_0x2bbef5[_0x7734('0x30')]['length']?_0x2bbef5[_0x7734('0x30')]:_0x55dc0b[_0x7734('0x2a')];_0x2bbef5[_0x7734('0x51')]=qs[_0x7734('0x35')](_0x65dc19[_0x7734('0x2c')][_0x7734('0x35')]);_0x2bbef5[_0x7734('0x36')]=qs[_0x7734('0x2e')](_[_0x7734('0x37')](_0x65dc19[_0x7734('0x2c')],_0x55dc0b['filters']));if(_0x65dc19[_0x7734('0x2c')][_0x7734('0x3c')]){_0x2bbef5[_0x7734('0x36')]=_['merge'](_0x2bbef5['where'],{'$or':_['map'](_0x2bbef5[_0x7734('0x30')],function(_0x2e1602){var _0x3a0730={};_0x3a0730[_0x2e1602]={'$like':'%'+_0x65dc19['query'][_0x7734('0x3c')]+'%'};return _0x3a0730;})});}_0x2bbef5=_[_0x7734('0x38')]({},_0x2bbef5,_0x65dc19['options']);return _0xda57b5[_0x7734('0x52')](_0x2bbef5);}})['then'](function(_0x15d7d4){if(_0x15d7d4){_0x5f3028=_0x15d7d4['length'];if(!_0x65dc19[_0x7734('0x2c')][_0x7734('0x33')](_0x7734('0x34'))){_0x2bbef5[_0x7734('0x1b')]=qs['limit'](_0x65dc19[_0x7734('0x2c')][_0x7734('0x1b')]);_0x2bbef5[_0x7734('0x1a')]=qs['offset'](_0x65dc19['query'][_0x7734('0x1a')]);}return _0xda57b5[_0x7734('0x52')](_0x2bbef5);}})[_0x7734('0x21')](function(_0x55bfcf){if(_0x55bfcf){return _0x55bfcf?{'count':_0x5f3028,'rows':_0x55bfcf}:null;}})['then'](respondWithResult(_0x5a1474,null))[_0x7734('0x44')](handleError(_0x5a1474,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index ed05876..3302eac 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 _0x4a29=['rimraf','../../config/environment','exports','Automation','tools_automations','lodash','util','api','bluebird','request-promise'];(function(_0x128450,_0x5869ba){var _0x4d80ed=function(_0x4a2da3){while(--_0x4a2da3){_0x128450['push'](_0x128450['shift']());}};_0x4d80ed(++_0x5869ba);}(_0x4a29,0x18b));var _0x94a2=function(_0x1987f2,_0x3a8d16){_0x1987f2=_0x1987f2-0x0;var _0x3ff49c=_0x4a29[_0x1987f2];return _0x3ff49c;};'use strict';var _=require(_0x94a2('0x0'));var util=require(_0x94a2('0x1'));var logger=require('../../config/logger')(_0x94a2('0x2'));var moment=require('moment');var BPromise=require(_0x94a2('0x3'));var rp=require(_0x94a2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x94a2('0x5'));var config=require(_0x94a2('0x6'));var attributes=require('./automation.attributes');module[_0x94a2('0x7')]=function(_0x22085e,_0x8c1a90){return _0x22085e['define'](_0x94a2('0x8'),attributes,{'tableName':_0x94a2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x64ad=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./automation.attributes','exports','define','Automation','lodash'];(function(_0x1aece6,_0x5e82f3){var _0x53a506=function(_0x11d84e){while(--_0x11d84e){_0x1aece6['push'](_0x1aece6['shift']());}};_0x53a506(++_0x5e82f3);}(_0x64ad,0x1e0));var _0xd64a=function(_0x4bd06e,_0x593701){_0x4bd06e=_0x4bd06e-0x0;var _0x85ebb=_0x64ad[_0x4bd06e];return _0x85ebb;};'use strict';var _=require(_0xd64a('0x0'));var util=require(_0xd64a('0x1'));var logger=require(_0xd64a('0x2'))(_0xd64a('0x3'));var moment=require(_0xd64a('0x4'));var BPromise=require(_0xd64a('0x5'));var rp=require(_0xd64a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd64a('0x7'));var config=require(_0xd64a('0x8'));var attributes=require(_0xd64a('0x9'));module[_0xd64a('0xa')]=function(_0x417160,_0x15c326){return _0x417160[_0xd64a('0xb')](_0xd64a('0xc'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js index d06611e..81f1b7b 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 _0xa1bb=['request','then','debug','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Automation,\x20%s,\x20%s','message','info','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http'];(function(_0x453a15,_0xcab71f){var _0x2e7f2d=function(_0x141a0b){while(--_0x141a0b){_0x453a15['push'](_0x453a15['shift']());}};_0x2e7f2d(++_0xcab71f);}(_0xa1bb,0x69));var _0xba1b=function(_0xb6a4f,_0x1c0ca2){_0xb6a4f=_0xb6a4f-0x0;var _0x4d7ff6=_0xa1bb[_0xb6a4f];return _0x4d7ff6;};'use strict';var _=require('lodash');var util=require(_0xba1b('0x0'));var moment=require(_0xba1b('0x1'));var BPromise=require(_0xba1b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xba1b('0x3'));var db=require(_0xba1b('0x4'))['db'];var utils=require(_0xba1b('0x5'));var logger=require(_0xba1b('0x6'))(_0xba1b('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xba1b('0x8')][_0xba1b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5c8e45,_0x3264e1,_0xa6e3d6){return new BPromise(function(_0x12141d,_0x567457){return client[_0xba1b('0xa')](_0x5c8e45,_0xa6e3d6)[_0xba1b('0xb')](function(_0xeb5a7c){logger['info']('Automation,\x20%s,\x20%s',_0x3264e1,'request\x20sent');logger[_0xba1b('0xc')](_0xba1b('0xd'),_0x3264e1,_0xba1b('0xe'),JSON[_0xba1b('0xf')](_0xeb5a7c));if(_0xeb5a7c[_0xba1b('0x10')]){if(_0xeb5a7c['error'][_0xba1b('0x11')]===0x1f4){logger[_0xba1b('0x10')](_0xba1b('0x12'),_0x3264e1,_0xeb5a7c[_0xba1b('0x10')]['message']);return _0x567457(_0xeb5a7c[_0xba1b('0x10')][_0xba1b('0x13')]);}logger[_0xba1b('0x10')](_0xba1b('0x12'),_0x3264e1,_0xeb5a7c[_0xba1b('0x10')][_0xba1b('0x13')]);return _0x12141d(_0xeb5a7c[_0xba1b('0x10')][_0xba1b('0x13')]);}else{logger[_0xba1b('0x14')]('Automation,\x20%s,\x20%s',_0x3264e1,'request\x20sent');_0x12141d(_0xeb5a7c[_0xba1b('0x15')][_0xba1b('0x13')]);}})[_0xba1b('0x16')](function(_0x4dba50){logger[_0xba1b('0x10')](_0xba1b('0x12'),_0x3264e1,_0x4dba50);_0x567457(_0x4dba50);});});} \ No newline at end of file +var _0xc3c7=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','error','code','Automation,\x20%s,\x20%s','message','request\x20sent','result','catch'];(function(_0x432fca,_0xb0b1b5){var _0x3adba4=function(_0x5e3ae4){while(--_0x5e3ae4){_0x432fca['push'](_0x432fca['shift']());}};_0x3adba4(++_0xb0b1b5);}(_0xc3c7,0x159));var _0x7c3c=function(_0x34f307,_0x4f1d8e){_0x34f307=_0x34f307-0x0;var _0x47e400=_0xc3c7[_0x34f307];return _0x47e400;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7c3c('0x0'));var BPromise=require(_0x7c3c('0x1'));var rs=require(_0x7c3c('0x2'));var fs=require('fs');var Redis=require(_0x7c3c('0x3'));var db=require(_0x7c3c('0x4'))['db'];var utils=require(_0x7c3c('0x5'));var logger=require(_0x7c3c('0x6'))(_0x7c3c('0x7'));var config=require(_0x7c3c('0x8'));var jayson=require(_0x7c3c('0x9'));var client=jayson[_0x7c3c('0xa')][_0x7c3c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x18e606,_0x504947,_0x349df3){return new BPromise(function(_0x4e20fc,_0x1e6966){return client[_0x7c3c('0xc')](_0x18e606,_0x349df3)[_0x7c3c('0xd')](function(_0x106ad1){logger[_0x7c3c('0xe')]('Automation,\x20%s,\x20%s',_0x504947,'request\x20sent');logger[_0x7c3c('0xf')]('Automation,\x20%s,\x20%s,\x20%s',_0x504947,'request\x20sent',JSON['stringify'](_0x106ad1));if(_0x106ad1[_0x7c3c('0x10')]){if(_0x106ad1[_0x7c3c('0x10')][_0x7c3c('0x11')]===0x1f4){logger[_0x7c3c('0x10')](_0x7c3c('0x12'),_0x504947,_0x106ad1[_0x7c3c('0x10')][_0x7c3c('0x13')]);return _0x1e6966(_0x106ad1['error'][_0x7c3c('0x13')]);}logger['error'](_0x7c3c('0x12'),_0x504947,_0x106ad1[_0x7c3c('0x10')][_0x7c3c('0x13')]);return _0x4e20fc(_0x106ad1['error']['message']);}else{logger[_0x7c3c('0xe')](_0x7c3c('0x12'),_0x504947,_0x7c3c('0x14'));_0x4e20fc(_0x106ad1[_0x7c3c('0x15')]['message']);}})[_0x7c3c('0x16')](function(_0xc5300f){logger[_0x7c3c('0x10')](_0x7c3c('0x12'),_0x504947,_0xc5300f);_0x1e6966(_0xc5300f);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index a475b02..58af645 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 _0x61a8=['util','connect-timeout','express','Router','../../components/interaction/service','./automation.controller','get','isAuthenticated','index','show','/:id/conditions','getActions','post','create','addConditions','/:id/actions','addActions','/:id','update','destroy','exports'];(function(_0x3f0928,_0x1746cb){var _0x58640f=function(_0x1f4f43){while(--_0x1f4f43){_0x3f0928['push'](_0x3f0928['shift']());}};_0x58640f(++_0x1746cb);}(_0x61a8,0x1ce));var _0x861a=function(_0x47470f,_0x411315){_0x47470f=_0x47470f-0x0;var _0x5b16a4=_0x61a8[_0x47470f];return _0x5b16a4;};'use strict';var multer=require('multer');var util=require(_0x861a('0x0'));var path=require('path');var timeout=require(_0x861a('0x1'));var express=require(_0x861a('0x2'));var router=express[_0x861a('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x861a('0x4'));var config=require('../../config/environment');var controller=require(_0x861a('0x5'));router[_0x861a('0x6')]('/',auth[_0x861a('0x7')](),controller[_0x861a('0x8')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x861a('0x9')]);router[_0x861a('0x6')](_0x861a('0xa'),auth[_0x861a('0x7')](),controller['getConditions']);router[_0x861a('0x6')]('/:id/actions',auth[_0x861a('0x7')](),controller[_0x861a('0xb')]);router[_0x861a('0xc')]('/',auth[_0x861a('0x7')](),controller[_0x861a('0xd')]);router['post'](_0x861a('0xa'),auth[_0x861a('0x7')](),controller[_0x861a('0xe')]);router['post'](_0x861a('0xf'),auth[_0x861a('0x7')](),controller[_0x861a('0x10')]);router['put'](_0x861a('0x11'),auth[_0x861a('0x7')](),controller[_0x861a('0x12')]);router['delete']('/:id',auth[_0x861a('0x7')](),controller[_0x861a('0x13')]);module[_0x861a('0x14')]=router; \ No newline at end of file +var _0x98e5=['/:id/actions','getActions','post','addConditions','put','update','delete','destroy','multer','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','index','/:id','isAuthenticated','show','/:id/conditions','get'];(function(_0x13f0d2,_0x27b14c){var _0x81b5fc=function(_0x1ee03b){while(--_0x1ee03b){_0x13f0d2['push'](_0x13f0d2['shift']());}};_0x81b5fc(++_0x27b14c);}(_0x98e5,0x1d4));var _0x598e=function(_0x59cf8a,_0x163bb9){_0x59cf8a=_0x59cf8a-0x0;var _0x22dde8=_0x98e5[_0x59cf8a];return _0x22dde8;};'use strict';var multer=require(_0x598e('0x0'));var util=require(_0x598e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x598e('0x2')]();var auth=require(_0x598e('0x3'));var interaction=require(_0x598e('0x4'));var config=require(_0x598e('0x5'));var controller=require('./automation.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x598e('0x6')]);router['get'](_0x598e('0x7'),auth[_0x598e('0x8')](),controller[_0x598e('0x9')]);router['get'](_0x598e('0xa'),auth[_0x598e('0x8')](),controller['getConditions']);router[_0x598e('0xb')](_0x598e('0xc'),auth[_0x598e('0x8')](),controller[_0x598e('0xd')]);router[_0x598e('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x598e('0xe')](_0x598e('0xa'),auth[_0x598e('0x8')](),controller[_0x598e('0xf')]);router[_0x598e('0xe')](_0x598e('0xc'),auth[_0x598e('0x8')](),controller['addActions']);router[_0x598e('0x10')]('/:id',auth[_0x598e('0x8')](),controller[_0x598e('0x11')]);router[_0x598e('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x598e('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 8658349..4d6ff7e 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 _0x1a8c=['onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','exports','STRING','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never'];(function(_0x34ed99,_0x3e346d){var _0x35d584=function(_0x2dd906){while(--_0x2dd906){_0x34ed99['push'](_0x34ed99['shift']());}};_0x35d584(++_0x3e346d);}(_0x1a8c,0x12d));var _0xc1a8=function(_0x46f13e,_0x5b049c){_0x46f13e=_0x46f13e-0x0;var _0x5856e2=_0x1a8c[_0x46f13e];return _0x5856e2;};'use strict';var Sequelize=require('sequelize');module[_0xc1a8('0x0')]={'name':{'type':Sequelize[_0xc1a8('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xc1a8('0x2')](_0xc1a8('0x3')),'allowNull':![],'defaultValue':_0xc1a8('0x3')},'description':{'type':Sequelize[_0xc1a8('0x1')]},'active':{'type':Sequelize[_0xc1a8('0x4')],'defaultValue':0x0,'comment':_0xc1a8('0x5')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0xc1a8('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xc1a8('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0xc1a8('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0xc1a8('0x8')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc1a8('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0xc1a8('0x8')](0x3)[_0xc1a8('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc1a8('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xc1a8('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xc1a8('0x8')](0x3)[_0xc1a8('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc1a8('0xb')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xc1a8('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc1a8('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xc1a8('0x8')](0x3)[_0xc1a8('0x6')],'defaultValue':0x3,'comment':_0xc1a8('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xc1a8('0x8')](0x5)[_0xc1a8('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc1a8('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0xc1a8('0x8')](0x3)[_0xc1a8('0x6')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xc1a8('0xf')},'dialTimezone':{'type':Sequelize[_0xc1a8('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0xc1a8('0x2')](_0xc1a8('0x10'),_0xc1a8('0x11'),_0xc1a8('0x12')),'defaultValue':_0xc1a8('0x10')},'dialAMDActive':{'type':Sequelize[_0xc1a8('0x4')],'defaultValue':0x0,'comment':_0xc1a8('0x13')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xc1a8('0x6')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xc1a8('0x8')](0x9)[_0xc1a8('0x6')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xc1a8('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xc1a8('0x6')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xc1a8('0x8')](0x9)[_0xc1a8('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xc1a8('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0xc1a8('0x8')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xc1a8('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xc1a8('0x6')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xc1a8('0x8')](0x9)[_0xc1a8('0x6')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xc1a8('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0xc1a8('0x6')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xc1a8('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xc1a8('0x8')](0x9)[_0xc1a8('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xc1a8('0x19')},'dialOrderByScheduledAt':{'type':Sequelize[_0xc1a8('0x2')](_0xc1a8('0x1a'),'ASC'),'defaultValue':_0xc1a8('0x1a')},'dialPrefix':{'type':Sequelize[_0xc1a8('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xc1a8('0x8')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xc1a8('0x1b')},'dialCutDigit':{'type':Sequelize[_0xc1a8('0x8')](0x3)[_0xc1a8('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xc1a8('0x1c')}}; \ No newline at end of file +var _0x73ac=['sequelize','exports','STRING','ENUM','ivr','UNSIGNED','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','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\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0x73ac,0x168));var _0xc73a=function(_0x25029e,_0x3afff3){_0x25029e=_0x25029e-0x0;var _0x382154=_0x73ac[_0x25029e];return _0x382154;};'use strict';var Sequelize=require(_0xc73a('0x0'));module[_0xc73a('0x1')]={'name':{'type':Sequelize[_0xc73a('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xc73a('0x3')](_0xc73a('0x4')),'allowNull':![],'defaultValue':_0xc73a('0x4')},'description':{'type':Sequelize[_0xc73a('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0xc73a('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xc73a('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xc73a('0x6')](0x3)[_0xc73a('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc73a('0x7')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xc73a('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc73a('0x8')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xc73a('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc73a('0x9')},'dialBusyMaxRetry':{'type':Sequelize[_0xc73a('0x6')](0x3)[_0xc73a('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc73a('0xa')},'dialBusyRetryFrequency':{'type':Sequelize[_0xc73a('0x6')](0x5)[_0xc73a('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc73a('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xc73a('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xc73a('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xc73a('0x6')](0x5)[_0xc73a('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc73a('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0xc73a('0x6')](0x3)[_0xc73a('0x5')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xc73a('0xe')},'dialTimezone':{'type':Sequelize[_0xc73a('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xc73a('0x2')],'defaultValue':_0xc73a('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0xc73a('0x3')]('always',_0xc73a('0x10'),_0xc73a('0x11')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xc73a('0x12')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xc73a('0x5')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xc73a('0x13')},'dialAMDGreeting':{'type':Sequelize[_0xc73a('0x6')](0x9)[_0xc73a('0x5')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xc73a('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xc73a('0x5')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xc73a('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xc73a('0x6')](0x9)[_0xc73a('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xc73a('0x16')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xc73a('0x5')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xc73a('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xc73a('0x6')](0x9)[_0xc73a('0x5')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xc73a('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xc73a('0x6')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xc73a('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xc73a('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xc73a('0x6')](0x9)[_0xc73a('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xc73a('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xc73a('0x1b'),_0xc73a('0x1c')),'defaultValue':_0xc73a('0x1b')},'dialPrefix':{'type':Sequelize[_0xc73a('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xc73a('0x6')](0x3)[_0xc73a('0x5')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xc73a('0x1d')},'dialCutDigit':{'type':Sequelize[_0xc73a('0x6')](0x3)[_0xc73a('0x5')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 5140cad..3d22db5 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 _0x2960=['../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','apply','reject','update','then','destroy','IvrCampaigns','error','stack','name','send','index','map','Campaign','fieldName','type','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','merge','key','VIRTUAL','field','filter','options','include','findAll','catch','show','params','rawAttributes','includeAll','create','get','role','user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','length','updatedAt','body','omit','createdAt','getHoppers','CmHopper','hasOwnProperty','rows','getHopperHistories','findOne','CmHopperHistory','CampaignId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','phone','NOW()','CmListId','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','COALESCE(phone,\x27\x27)','from','CampaignId\x20=\x20?','onlyIfOpen','push','sequelize','all','addBlackLists','cm_hopper_black','removeBlackLists','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x3f1c23,_0x14e25e){var _0x5c901d=function(_0xc19b77){while(--_0xc19b77){_0x3f1c23['push'](_0x3f1c23['shift']());}};_0x5c901d(++_0x14e25e);}(_0x2960,0x71));var _0x0296=function(_0x13ed6f,_0x515c3c){_0x13ed6f=_0x13ed6f-0x0;var _0x3b42dd=_0x2960[_0x13ed6f];return _0x3b42dd;};'use strict';var pdf=require(_0x0296('0x0'));var emlformat=require(_0x0296('0x1'));var rimraf=require(_0x0296('0x2'));var zipdir=require(_0x0296('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0296('0x4'));var moment=require(_0x0296('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0296('0x6'));var util=require(_0x0296('0x7'));var path=require(_0x0296('0x8'));var sox=require('sox');var csv=require(_0x0296('0x9'));var ejs=require(_0x0296('0xa'));var fs=require('fs');var _=require(_0x0296('0xb'));var squel=require(_0x0296('0xc'));var crypto=require(_0x0296('0xd'));var jsforce=require(_0x0296('0xe'));var deskjs=require(_0x0296('0xf'));var toCsv=require(_0x0296('0x9'));var querystring=require(_0x0296('0x10'));var Papa=require(_0x0296('0x11'));var Redis=require(_0x0296('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x0296('0x13'));var as=require(_0x0296('0x14'));var hardwareService=require(_0x0296('0x15'));var logger=require(_0x0296('0x16'))('api');var utils=require(_0x0296('0x17'));var config=require(_0x0296('0x18'));var db=require(_0x0296('0x19'))['db'];function respondWithStatusCode(_0x15de09,_0x2fb9ea){_0x2fb9ea=_0x2fb9ea||0xcc;return function(_0x4c532b){if(_0x4c532b){return _0x15de09[_0x0296('0x1a')](_0x2fb9ea);}return _0x15de09['status'](_0x2fb9ea)[_0x0296('0x1b')]();};}function respondWithResult(_0x1072bc,_0xde7543){_0xde7543=_0xde7543||0xc8;return function(_0x2ba2f3){if(_0x2ba2f3){return _0x1072bc[_0x0296('0x1c')](_0xde7543)[_0x0296('0x1d')](_0x2ba2f3);}};}function respondWithFilteredResult(_0x5230a7,_0x2607ee){return function(_0x3551f9){if(_0x3551f9){var _0x3c00f3=_0x3551f9[_0x0296('0x1e')],_0x318891=_0x2607ee[_0x0296('0x1f')],_0x16b263=_0x2607ee['offset']+_0x2607ee[_0x0296('0x20')],_0x29ef6f;if(_0x16b263>=_0x3c00f3){_0x16b263=_0x3c00f3;_0x29ef6f=0xc8;}else{_0x29ef6f=0xce;}_0x5230a7[_0x0296('0x1c')](_0x29ef6f);return _0x5230a7['set']('Content-Range',_0x318891+'-'+_0x16b263+'/'+_0x3c00f3)[_0x0296('0x1d')](_0x3551f9);}return null;};}function patchUpdates(_0x19eede){return function(_0x38bc62){try{jsonpatch[_0x0296('0x21')](_0x38bc62,_0x19eede,!![]);}catch(_0x3781c8){return BPromise[_0x0296('0x22')](_0x3781c8);}return _0x38bc62['save']();};}function saveUpdates(_0x50b727,_0x7279bf){return function(_0x4e8e3e){if(_0x4e8e3e){return _0x4e8e3e[_0x0296('0x23')](_0x50b727)[_0x0296('0x24')](function(_0x4dd947){return _0x4dd947;});}return null;};}function removeEntity(_0x55afdc,_0x51c71f){return function(_0x1dc147){if(_0x1dc147){return _0x1dc147[_0x0296('0x25')]()['then'](function(){var _0x561d61=_0x1dc147['get']({'plain':!![]});var _0x58d8cb=_0x0296('0x26');return db['UserProfileResource'][_0x0296('0x25')]({'where':{'type':_0x58d8cb,'resourceId':_0x561d61['id']}})[_0x0296('0x24')](function(){return _0x1dc147;});})[_0x0296('0x24')](function(){_0x55afdc[_0x0296('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47b8c1,_0x17b4b9){return function(_0x2d3eab){if(!_0x2d3eab){_0x47b8c1[_0x0296('0x1a')](0x194);}return _0x2d3eab;};}function handleError(_0x2e7f5f,_0xe71328){_0xe71328=_0xe71328||0x1f4;return function(_0x1832d8){logger[_0x0296('0x27')](_0x1832d8[_0x0296('0x28')]);if(_0x1832d8[_0x0296('0x29')]){delete _0x1832d8[_0x0296('0x29')];}_0x2e7f5f[_0x0296('0x1c')](_0xe71328)[_0x0296('0x2a')](_0x1832d8);};}exports[_0x0296('0x2b')]=function(_0x3ecb68,_0x100d3a){var _0x5ae0a8={},_0x495d2d={},_0xa94653={'count':0x0,'rows':[]};var _0x48b9db=_[_0x0296('0x2c')](db[_0x0296('0x2d')]['rawAttributes'],function(_0x57d6b5){return{'name':_0x57d6b5[_0x0296('0x2e')],'type':_0x57d6b5[_0x0296('0x2f')]['key']};});_0x495d2d[_0x0296('0x30')]=_[_0x0296('0x2c')](_0x48b9db,'name');_0x495d2d[_0x0296('0x31')]=_[_0x0296('0x32')](_0x3ecb68[_0x0296('0x31')]);_0x495d2d[_0x0296('0x33')]=_[_0x0296('0x34')](_0x495d2d[_0x0296('0x30')],_0x495d2d[_0x0296('0x31')]);_0x5ae0a8[_0x0296('0x35')]=_[_0x0296('0x34')](_0x495d2d[_0x0296('0x30')],qs['fields'](_0x3ecb68[_0x0296('0x31')][_0x0296('0x36')]));_0x5ae0a8['attributes']=_0x5ae0a8['attributes']['length']?_0x5ae0a8[_0x0296('0x35')]:_0x495d2d[_0x0296('0x30')];if(!_0x3ecb68[_0x0296('0x31')]['hasOwnProperty'](_0x0296('0x37'))){_0x5ae0a8[_0x0296('0x20')]=qs[_0x0296('0x20')](_0x3ecb68[_0x0296('0x31')][_0x0296('0x20')]);_0x5ae0a8[_0x0296('0x1f')]=qs['offset'](_0x3ecb68['query'][_0x0296('0x1f')]);}_0x5ae0a8[_0x0296('0x38')]=qs['sort'](_0x3ecb68[_0x0296('0x31')][_0x0296('0x39')]);_0x5ae0a8[_0x0296('0x3a')]=qs['filters'](_[_0x0296('0x3b')](_0x3ecb68[_0x0296('0x31')],_0x495d2d[_0x0296('0x33')]));if(_0x3ecb68[_0x0296('0x31')]['filter']){_0x5ae0a8[_0x0296('0x3a')]=_[_0x0296('0x3c')](_0x5ae0a8[_0x0296('0x3a')],{'$or':_[_0x0296('0x2c')](_0x48b9db,function(_0x56367d){if(_0x56367d['type'][_0x0296('0x3d')]!==_0x0296('0x3e')){var _0x4b4642={};_0x4b4642[_0x56367d[_0x0296('0x3f')]]={'$like':'%'+_0x3ecb68[_0x0296('0x31')][_0x0296('0x40')]+'%'};return _0x4b4642;}})});}_0x5ae0a8=_[_0x0296('0x3c')]({},_0x5ae0a8,_0x3ecb68[_0x0296('0x41')]);var _0x60b583={'where':_0x5ae0a8[_0x0296('0x3a')]};return db[_0x0296('0x2d')][_0x0296('0x1e')](_0x60b583)[_0x0296('0x24')](function(_0x16e20a){_0xa94653[_0x0296('0x1e')]=_0x16e20a;if(_0x3ecb68[_0x0296('0x31')]['includeAll']){_0x5ae0a8[_0x0296('0x42')]=[{'all':!![]}];}return db[_0x0296('0x2d')][_0x0296('0x43')](_0x5ae0a8);})[_0x0296('0x24')](function(_0x2acfd2){_0xa94653['rows']=_0x2acfd2;return _0xa94653;})['then'](respondWithFilteredResult(_0x100d3a,_0x5ae0a8))[_0x0296('0x44')](handleError(_0x100d3a,null));};exports[_0x0296('0x45')]=function(_0x46c626,_0x410249){var _0x5bfb92={'raw':![],'where':{'id':_0x46c626[_0x0296('0x46')]['id']}},_0xe10633={};_0xe10633['model']=_[_0x0296('0x32')](db['Campaign'][_0x0296('0x47')]);_0xe10633[_0x0296('0x31')]=_[_0x0296('0x32')](_0x46c626['query']);_0xe10633[_0x0296('0x33')]=_['intersection'](_0xe10633['model'],_0xe10633[_0x0296('0x31')]);_0x5bfb92[_0x0296('0x35')]=_[_0x0296('0x34')](_0xe10633[_0x0296('0x30')],qs['fields'](_0x46c626[_0x0296('0x31')][_0x0296('0x36')]));_0x5bfb92['attributes']=_0x5bfb92[_0x0296('0x35')]['length']?_0x5bfb92[_0x0296('0x35')]:_0xe10633[_0x0296('0x30')];if(_0x46c626[_0x0296('0x31')][_0x0296('0x48')]){_0x5bfb92[_0x0296('0x42')]=[{'all':!![]}];}_0x5bfb92=_[_0x0296('0x3c')]({},_0x5bfb92,_0x46c626['options']);return db['Campaign']['find'](_0x5bfb92)[_0x0296('0x24')](handleEntityNotFound(_0x410249,null))[_0x0296('0x24')](respondWithResult(_0x410249,null))[_0x0296('0x44')](handleError(_0x410249,null));};exports['create']=function(_0x131708,_0x3f76a8){return db[_0x0296('0x2d')][_0x0296('0x49')](_0x131708['body'],{})['then'](function(_0x2273c4){var _0x224098=_0x131708['user'][_0x0296('0x4a')]({'plain':!![]});if(!_0x224098)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x224098[_0x0296('0x4b')]===_0x0296('0x4c')){var _0x5b4f1f=_0x2273c4[_0x0296('0x4a')]({'plain':!![]});var _0x1ccd00='IvrCampaigns';return db[_0x0296('0x4d')][_0x0296('0x4e')]({'where':{'name':_0x1ccd00,'userProfileId':_0x224098[_0x0296('0x4f')]},'raw':!![]})[_0x0296('0x24')](function(_0x2201f1){if(_0x2201f1&&_0x2201f1[_0x0296('0x50')]===0x0){return db[_0x0296('0x51')][_0x0296('0x49')]({'name':_0x5b4f1f[_0x0296('0x29')],'resourceId':_0x5b4f1f['id'],'type':_0x2201f1[_0x0296('0x29')],'sectionId':_0x2201f1['id']},{})['then'](function(){return _0x2273c4;});}else{return _0x2273c4;}})[_0x0296('0x44')](function(_0x317184){logger[_0x0296('0x27')](_0x0296('0x52'),_0x317184);throw _0x317184;});}return _0x2273c4;})[_0x0296('0x24')](respondWithResult(_0x3f76a8,0xc9))[_0x0296('0x44')](handleError(_0x3f76a8,null));};exports['clone']=function(_0x2863c6,_0x5b753f){var _0x1e5068={'raw':![],'where':{'id':_0x2863c6[_0x0296('0x46')]['id']}},_0xdc2f1c={};_0xdc2f1c[_0x0296('0x30')]=_[_0x0296('0x32')](db['Campaign'][_0x0296('0x47')]);_0x1e5068[_0x0296('0x35')]=_['intersection'](_0xdc2f1c[_0x0296('0x30')],qs[_0x0296('0x36')](_0x2863c6[_0x0296('0x31')][_0x0296('0x36')]));_0x1e5068[_0x0296('0x35')]=_0x1e5068[_0x0296('0x35')][_0x0296('0x53')]?_0x1e5068[_0x0296('0x35')]:_0xdc2f1c[_0x0296('0x30')];if(_0x2863c6[_0x0296('0x31')]['includeAll']){_0x1e5068[_0x0296('0x42')]=[{'all':!![]}];}_0x1e5068=_[_0x0296('0x3c')]({},_0x1e5068,_0x2863c6['options']);return db[_0x0296('0x2d')][_0x0296('0x4e')](_0x1e5068)[_0x0296('0x24')](handleEntityNotFound(_0x5b753f,null))[_0x0296('0x24')](function(_0x1f1d46){if(_0x1f1d46){var _0x52ac6f=_0x1f1d46['get']({'plain':!![]});_0x52ac6f=qs['omit'](_0x52ac6f,['id','createdAt',_0x0296('0x54')]);_0x2863c6[_0x0296('0x55')]=_[_0x0296('0x56')](_0x2863c6[_0x0296('0x55')],['id',_0x0296('0x57'),'updatedAt']);return db[_0x0296('0x2d')][_0x0296('0x49')](_['merge'](_0x52ac6f,_0x2863c6[_0x0296('0x55')]),{'include':_0x2863c6[_0x0296('0x31')][_0x0296('0x48')]?[{'all':!![]}]:undefined})[_0x0296('0x24')](function(_0x37529c){var _0x485362=_0x2863c6[_0x0296('0x4c')][_0x0296('0x4a')]({'plain':!![]});if(!_0x485362)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x485362[_0x0296('0x4b')]==='user'){var _0x1b2679=_0x37529c['get']({'plain':!![]});var _0x52230d=_0x0296('0x26');return db[_0x0296('0x4d')][_0x0296('0x4e')]({'where':{'name':_0x52230d,'userProfileId':_0x485362[_0x0296('0x4f')]},'raw':!![]})[_0x0296('0x24')](function(_0x306975){if(_0x306975&&_0x306975[_0x0296('0x50')]===0x0){return db[_0x0296('0x51')]['create']({'name':_0x1b2679['name'],'resourceId':_0x1b2679['id'],'type':_0x306975[_0x0296('0x29')],'sectionId':_0x306975['id']},{})['then'](function(){return _0x37529c;});}else{return _0x37529c;}})[_0x0296('0x44')](function(_0x4e1cd3){logger[_0x0296('0x27')](_0x0296('0x52'),_0x4e1cd3);throw _0x4e1cd3;});}return _0x37529c;});}})[_0x0296('0x24')](respondWithResult(_0x5b753f,0xc9))['catch'](handleError(_0x5b753f,null));};exports[_0x0296('0x23')]=function(_0x1076c3,_0x38dbdb){if(_0x1076c3[_0x0296('0x55')]['id']){delete _0x1076c3[_0x0296('0x55')]['id'];}return db[_0x0296('0x2d')]['find']({'where':{'id':_0x1076c3['params']['id']}})[_0x0296('0x24')](handleEntityNotFound(_0x38dbdb,null))[_0x0296('0x24')](saveUpdates(_0x1076c3['body'],null))['then'](respondWithResult(_0x38dbdb,null))[_0x0296('0x44')](handleError(_0x38dbdb,null));};exports[_0x0296('0x25')]=function(_0x31941d,_0x3138cd){return db[_0x0296('0x2d')][_0x0296('0x4e')]({'where':{'id':_0x31941d['params']['id']}})[_0x0296('0x24')](handleEntityNotFound(_0x3138cd,null))['then'](removeEntity(_0x3138cd,null))[_0x0296('0x44')](handleError(_0x3138cd,null));};exports[_0x0296('0x58')]=function(_0x39c539,_0x2dae03,_0x98a2e){var _0x4b47db={'raw':!![],'where':{}};var _0x2c1b76={};var _0x17e6ba={'count':0x0,'rows':[]};return db[_0x0296('0x2d')]['findOne']({'where':{'id':_0x39c539[_0x0296('0x46')]['id']}})['then'](handleEntityNotFound(_0x2dae03,null))[_0x0296('0x24')](function(_0x2b6c6f){if(_0x2b6c6f){_0x2c1b76[_0x0296('0x30')]=_[_0x0296('0x32')](db[_0x0296('0x59')][_0x0296('0x47')]);_0x2c1b76[_0x0296('0x31')]=_[_0x0296('0x32')](_0x39c539[_0x0296('0x31')]);_0x2c1b76[_0x0296('0x33')]=_['intersection'](_0x2c1b76[_0x0296('0x30')],_0x2c1b76[_0x0296('0x31')]);_0x4b47db[_0x0296('0x35')]=_[_0x0296('0x34')](_0x2c1b76[_0x0296('0x30')],qs[_0x0296('0x36')](_0x39c539[_0x0296('0x31')]['fields']));_0x4b47db[_0x0296('0x35')]=_0x4b47db[_0x0296('0x35')]['length']?_0x4b47db[_0x0296('0x35')]:_0x2c1b76[_0x0296('0x30')];if(!_0x39c539[_0x0296('0x31')][_0x0296('0x5a')](_0x0296('0x37'))){_0x4b47db['limit']=qs['limit'](_0x39c539[_0x0296('0x31')][_0x0296('0x20')]);_0x4b47db[_0x0296('0x1f')]=qs[_0x0296('0x1f')](_0x39c539['query'][_0x0296('0x1f')]);}_0x4b47db['order']=qs['sort'](_0x39c539[_0x0296('0x31')]['sort']);_0x4b47db['where']=qs[_0x0296('0x33')](_[_0x0296('0x3b')](_0x39c539['query'],_0x2c1b76[_0x0296('0x33')]));_0x4b47db[_0x0296('0x3a')]['CampaignId']=_0x2b6c6f['id'];if(_0x39c539[_0x0296('0x31')][_0x0296('0x40')]){_0x4b47db['where']=_[_0x0296('0x3c')](_0x4b47db[_0x0296('0x3a')],{'$or':_['map'](_0x4b47db[_0x0296('0x35')],function(_0x1dc83b){var _0x37b097={};_0x37b097[_0x1dc83b]={'$like':'%'+_0x39c539[_0x0296('0x31')][_0x0296('0x40')]+'%'};return _0x37b097;})});}_0x4b47db=_[_0x0296('0x3c')]({},_0x4b47db,_0x39c539['options']);return db['CmHopper'][_0x0296('0x1e')]({'where':_0x4b47db['where']})[_0x0296('0x24')](function(_0x434421){_0x17e6ba[_0x0296('0x1e')]=_0x434421;if(_0x39c539[_0x0296('0x31')]['includeAll']){_0x4b47db[_0x0296('0x42')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x4b47db);})[_0x0296('0x24')](function(_0x4d627d){_0x17e6ba[_0x0296('0x5b')]=_0x4d627d;return _0x17e6ba;});}})[_0x0296('0x24')](respondWithFilteredResult(_0x2dae03,_0x4b47db))['catch'](handleError(_0x2dae03,null));};exports[_0x0296('0x5c')]=function(_0xcae76,_0x3a1a04,_0x10f2b8){var _0x5e0b12={'raw':!![],'where':{}};var _0x5e5fb9={};var _0xe41234={'count':0x0,'rows':[]};return db[_0x0296('0x2d')][_0x0296('0x5d')]({'where':{'id':_0xcae76[_0x0296('0x46')]['id']}})[_0x0296('0x24')](handleEntityNotFound(_0x3a1a04,null))[_0x0296('0x24')](function(_0x31b576){if(_0x31b576){_0x5e5fb9[_0x0296('0x30')]=_['keys'](db[_0x0296('0x5e')][_0x0296('0x47')]);_0x5e5fb9[_0x0296('0x31')]=_[_0x0296('0x32')](_0xcae76[_0x0296('0x31')]);_0x5e5fb9[_0x0296('0x33')]=_['intersection'](_0x5e5fb9[_0x0296('0x30')],_0x5e5fb9[_0x0296('0x31')]);_0x5e0b12[_0x0296('0x35')]=_[_0x0296('0x34')](_0x5e5fb9['model'],qs[_0x0296('0x36')](_0xcae76[_0x0296('0x31')]['fields']));_0x5e0b12[_0x0296('0x35')]=_0x5e0b12[_0x0296('0x35')]['length']?_0x5e0b12['attributes']:_0x5e5fb9['model'];if(!_0xcae76['query'][_0x0296('0x5a')]('nolimit')){_0x5e0b12[_0x0296('0x20')]=qs[_0x0296('0x20')](_0xcae76[_0x0296('0x31')][_0x0296('0x20')]);_0x5e0b12[_0x0296('0x1f')]=qs[_0x0296('0x1f')](_0xcae76['query'][_0x0296('0x1f')]);}_0x5e0b12['order']=qs[_0x0296('0x39')](_0xcae76['query']['sort']);_0x5e0b12[_0x0296('0x3a')]=qs['filters'](_[_0x0296('0x3b')](_0xcae76[_0x0296('0x31')],_0x5e5fb9[_0x0296('0x33')]));_0x5e0b12[_0x0296('0x3a')][_0x0296('0x5f')]=_0x31b576['id'];if(_0xcae76[_0x0296('0x31')][_0x0296('0x40')]){_0x5e0b12[_0x0296('0x3a')]=_['merge'](_0x5e0b12['where'],{'$or':_[_0x0296('0x2c')](_0x5e0b12['attributes'],function(_0x15c40a){var _0x2e012b={};_0x2e012b[_0x15c40a]={'$like':'%'+_0xcae76[_0x0296('0x31')]['filter']+'%'};return _0x2e012b;})});}_0x5e0b12=_[_0x0296('0x3c')]({},_0x5e0b12,_0xcae76[_0x0296('0x41')]);return db[_0x0296('0x5e')][_0x0296('0x1e')]({'where':_0x5e0b12[_0x0296('0x3a')]})['then'](function(_0x50dea5){_0xe41234[_0x0296('0x1e')]=_0x50dea5;if(_0xcae76[_0x0296('0x31')][_0x0296('0x48')]){_0x5e0b12[_0x0296('0x42')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x0296('0x43')](_0x5e0b12);})[_0x0296('0x24')](function(_0x321c8a){_0xe41234[_0x0296('0x5b')]=_0x321c8a;return _0xe41234;});}})[_0x0296('0x24')](respondWithFilteredResult(_0x3a1a04,_0x5e0b12))['catch'](handleError(_0x3a1a04,null));};exports[_0x0296('0x60')]=function(_0x4b36b0,_0x301e56,_0xfb770e){var _0x40307c={'raw':!![],'where':{}};var _0x521c80={};var _0x557a60={'count':0x0,'rows':[]};return db[_0x0296('0x2d')][_0x0296('0x5d')]({'where':{'id':_0x4b36b0[_0x0296('0x46')]['id']}})[_0x0296('0x24')](handleEntityNotFound(_0x301e56,null))[_0x0296('0x24')](function(_0x32cd17){if(_0x32cd17){_0x521c80[_0x0296('0x30')]=_['keys'](db['CmHopperFinal'][_0x0296('0x47')]);_0x521c80['query']=_[_0x0296('0x32')](_0x4b36b0[_0x0296('0x31')]);_0x521c80[_0x0296('0x33')]=_[_0x0296('0x34')](_0x521c80[_0x0296('0x30')],_0x521c80['query']);_0x40307c[_0x0296('0x35')]=_[_0x0296('0x34')](_0x521c80['model'],qs[_0x0296('0x36')](_0x4b36b0[_0x0296('0x31')]['fields']));_0x40307c[_0x0296('0x35')]=_0x40307c[_0x0296('0x35')]['length']?_0x40307c[_0x0296('0x35')]:_0x521c80[_0x0296('0x30')];if(!_0x4b36b0[_0x0296('0x31')]['hasOwnProperty'](_0x0296('0x37'))){_0x40307c[_0x0296('0x20')]=qs[_0x0296('0x20')](_0x4b36b0['query']['limit']);_0x40307c['offset']=qs[_0x0296('0x1f')](_0x4b36b0[_0x0296('0x31')][_0x0296('0x1f')]);}_0x40307c['order']=qs[_0x0296('0x39')](_0x4b36b0[_0x0296('0x31')][_0x0296('0x39')]);_0x40307c[_0x0296('0x3a')]=qs['filters'](_[_0x0296('0x3b')](_0x4b36b0[_0x0296('0x31')],_0x521c80[_0x0296('0x33')]));_0x40307c[_0x0296('0x3a')]['CampaignId']=_0x32cd17['id'];if(_0x4b36b0[_0x0296('0x31')][_0x0296('0x40')]){_0x40307c['where']=_[_0x0296('0x3c')](_0x40307c[_0x0296('0x3a')],{'$or':_[_0x0296('0x2c')](_0x40307c[_0x0296('0x35')],function(_0x1e5b08){var _0x52d33e={};_0x52d33e[_0x1e5b08]={'$like':'%'+_0x4b36b0[_0x0296('0x31')]['filter']+'%'};return _0x52d33e;})});}_0x40307c=_[_0x0296('0x3c')]({},_0x40307c,_0x4b36b0['options']);return db[_0x0296('0x61')][_0x0296('0x1e')]({'where':_0x40307c[_0x0296('0x3a')]})['then'](function(_0x21abf1){_0x557a60['count']=_0x21abf1;if(_0x4b36b0['query'][_0x0296('0x48')]){_0x40307c['include']=[{'all':!![]}];}return db[_0x0296('0x61')][_0x0296('0x43')](_0x40307c);})['then'](function(_0x2009fe){_0x557a60[_0x0296('0x5b')]=_0x2009fe;return _0x557a60;});}})[_0x0296('0x24')](respondWithFilteredResult(_0x301e56,_0x40307c))['catch'](handleError(_0x301e56,null));};exports[_0x0296('0x62')]=function(_0x4ec47e,_0x83d10a,_0x422271){var _0x474bbf={'raw':!![],'where':{}};var _0x3af989={};var _0xe0903a={'count':0x0,'rows':[]};return db[_0x0296('0x2d')][_0x0296('0x5d')]({'where':{'id':_0x4ec47e['params']['id']}})[_0x0296('0x24')](handleEntityNotFound(_0x83d10a,null))[_0x0296('0x24')](function(_0x136d5c){if(_0x136d5c){_0x3af989[_0x0296('0x30')]=_[_0x0296('0x32')](db[_0x0296('0x63')][_0x0296('0x47')]);_0x3af989[_0x0296('0x31')]=_[_0x0296('0x32')](_0x4ec47e[_0x0296('0x31')]);_0x3af989[_0x0296('0x33')]=_[_0x0296('0x34')](_0x3af989[_0x0296('0x30')],_0x3af989[_0x0296('0x31')]);_0x474bbf[_0x0296('0x35')]=_[_0x0296('0x34')](_0x3af989[_0x0296('0x30')],qs['fields'](_0x4ec47e['query']['fields']));_0x474bbf['attributes']=_0x474bbf[_0x0296('0x35')][_0x0296('0x53')]?_0x474bbf[_0x0296('0x35')]:_0x3af989[_0x0296('0x30')];if(!_0x4ec47e['query'][_0x0296('0x5a')](_0x0296('0x37'))){_0x474bbf[_0x0296('0x20')]=qs[_0x0296('0x20')](_0x4ec47e[_0x0296('0x31')][_0x0296('0x20')]);_0x474bbf[_0x0296('0x1f')]=qs[_0x0296('0x1f')](_0x4ec47e[_0x0296('0x31')]['offset']);}_0x474bbf['order']=qs[_0x0296('0x39')](_0x4ec47e['query'][_0x0296('0x39')]);_0x474bbf[_0x0296('0x3a')]=qs[_0x0296('0x33')](_[_0x0296('0x3b')](_0x4ec47e[_0x0296('0x31')],_0x3af989[_0x0296('0x33')]));_0x474bbf[_0x0296('0x3a')][_0x0296('0x5f')]=_0x136d5c['id'];if(_0x4ec47e[_0x0296('0x31')][_0x0296('0x40')]){_0x474bbf[_0x0296('0x3a')]=_[_0x0296('0x3c')](_0x474bbf[_0x0296('0x3a')],{'$or':_[_0x0296('0x2c')](_0x474bbf[_0x0296('0x35')],function(_0x24878f){var _0xb4dcb5={};_0xb4dcb5[_0x24878f]={'$like':'%'+_0x4ec47e[_0x0296('0x31')][_0x0296('0x40')]+'%'};return _0xb4dcb5;})});}_0x474bbf=_[_0x0296('0x3c')]({},_0x474bbf,_0x4ec47e[_0x0296('0x41')]);return db[_0x0296('0x63')]['count']({'where':_0x474bbf[_0x0296('0x3a')]})[_0x0296('0x24')](function(_0x33f3e3){_0xe0903a['count']=_0x33f3e3;if(_0x4ec47e['query']['includeAll']){_0x474bbf['include']=[{'all':!![]}];}return db[_0x0296('0x63')][_0x0296('0x43')](_0x474bbf);})[_0x0296('0x24')](function(_0x5684d9){_0xe0903a[_0x0296('0x5b')]=_0x5684d9;return _0xe0903a;});}})[_0x0296('0x24')](respondWithFilteredResult(_0x83d10a,_0x474bbf))[_0x0296('0x44')](handleError(_0x83d10a,null));};exports[_0x0296('0x64')]=function(_0x177d5d,_0x17eb5d,_0x173ea3){var _0x1a58bb={};var _0x550691={};var _0x48492d;var _0x22e60c;return db['Campaign'][_0x0296('0x5d')]({'where':{'id':_0x177d5d['params']['id']}})['then'](handleEntityNotFound(_0x17eb5d,null))[_0x0296('0x24')](function(_0x18abb0){if(_0x18abb0){_0x48492d=_0x18abb0;_0x550691['model']=_[_0x0296('0x32')](db[_0x0296('0x65')][_0x0296('0x47')]);_0x550691[_0x0296('0x31')]=_[_0x0296('0x32')](_0x177d5d[_0x0296('0x31')]);_0x550691[_0x0296('0x33')]=_[_0x0296('0x34')](_0x550691[_0x0296('0x30')],_0x550691[_0x0296('0x31')]);_0x1a58bb[_0x0296('0x35')]=_[_0x0296('0x34')](_0x550691['model'],qs[_0x0296('0x36')](_0x177d5d[_0x0296('0x31')]['fields']));_0x1a58bb[_0x0296('0x35')]=_0x1a58bb['attributes'][_0x0296('0x53')]?_0x1a58bb[_0x0296('0x35')]:_0x550691[_0x0296('0x30')];_0x1a58bb[_0x0296('0x38')]=qs['sort'](_0x177d5d[_0x0296('0x31')][_0x0296('0x39')]);_0x1a58bb[_0x0296('0x3a')]=qs[_0x0296('0x33')](_['pick'](_0x177d5d[_0x0296('0x31')],_0x550691[_0x0296('0x33')]));if(_0x177d5d[_0x0296('0x31')][_0x0296('0x40')]){_0x1a58bb['where']=_[_0x0296('0x3c')](_0x1a58bb[_0x0296('0x3a')],{'$or':_[_0x0296('0x2c')](_0x1a58bb[_0x0296('0x35')],function(_0x1f0e1c){var _0x101fac={};_0x101fac[_0x1f0e1c]={'$like':'%'+_0x177d5d[_0x0296('0x31')][_0x0296('0x40')]+'%'};return _0x101fac;})});}_0x1a58bb=_[_0x0296('0x3c')]({},_0x1a58bb,_0x177d5d[_0x0296('0x41')]);return _0x48492d['getLists'](_0x1a58bb);}})[_0x0296('0x24')](function(_0x50240a){if(_0x50240a){_0x22e60c=_0x50240a['length'];if(!_0x177d5d['query']['hasOwnProperty'](_0x0296('0x37'))){_0x1a58bb[_0x0296('0x20')]=qs[_0x0296('0x20')](_0x177d5d[_0x0296('0x31')][_0x0296('0x20')]);_0x1a58bb[_0x0296('0x1f')]=qs[_0x0296('0x1f')](_0x177d5d['query'][_0x0296('0x1f')]);}return _0x48492d[_0x0296('0x64')](_0x1a58bb);}})[_0x0296('0x24')](function(_0x1956da){if(_0x1956da){return _0x1956da?{'count':_0x22e60c,'rows':_0x1956da}:null;}})[_0x0296('0x24')](respondWithResult(_0x17eb5d,null))[_0x0296('0x44')](handleError(_0x17eb5d,null));};exports['addLists']=function(_0x486922,_0x3acc0a,_0x40690c){var _0x2f5c6a,_0x25f6f8;return db[_0x0296('0x2d')][_0x0296('0x4e')]({'where':{'id':_0x486922[_0x0296('0x46')]['id']}})[_0x0296('0x24')](handleEntityNotFound(_0x3acc0a,null))['then'](function(_0x2cf9bf){if(_0x2cf9bf){_0x25f6f8=_0x2cf9bf;return _0x2cf9bf[_0x0296('0x66')](_0x486922['body'][_0x0296('0x67')],_['omit'](_0x486922[_0x0296('0x55')],[_0x0296('0x67'),'id'])||{});}return null;})[_0x0296('0x68')](function(_0x46de94){var _0x458610;_0x2f5c6a=_0x46de94||[];var _0x14f559=[];if(_0x46de94){for(var _0x12dca7=0x0;_0x12dca7<_0x46de94[_0x0296('0x53')];_0x12dca7+=0x1){var _0x308131=_0x46de94[_0x12dca7][_0x0296('0x4a')]({'plain':!![]});_0x25f6f8[_0x0296('0x69')]=_0x486922[_0x0296('0x55')][_0x0296('0x69')]?_0x486922['body'][_0x0296('0x69')]:_0x25f6f8[_0x0296('0x69')];switch(_0x25f6f8[_0x0296('0x69')]){case _0x0296('0x6a'):_0x458610=squel[_0x0296('0x6b')]()[_0x0296('0x6c')](_0x0296('0x6d'))[_0x0296('0x6e')](['phone',_0x0296('0x6f'),_0x0296('0x70'),_0x0296('0x71'),_0x0296('0x5f'),_0x0296('0x57'),'updatedAt'],squel['select']()[_0x0296('0x3f')](_0x0296('0x72'),_0x0296('0x72'))[_0x0296('0x3f')](_0x0296('0x73'),'scheduledAt')['field']('id','ContactId')[_0x0296('0x3f')](_0x308131[_0x0296('0x74')][_0x0296('0x75')](),_0x0296('0x71'))[_0x0296('0x3f')](_0x486922[_0x0296('0x46')]['id'][_0x0296('0x75')](),_0x0296('0x5f'))['field']('NOW()','createdAt')[_0x0296('0x3f')](_0x0296('0x73'),_0x0296('0x54'))['from'](_0x0296('0x76'))[_0x0296('0x3a')](_0x0296('0x77'))[_0x0296('0x3a')](_0x0296('0x78'),_0x308131[_0x0296('0x74')][_0x0296('0x75')]())['where'](_0x0296('0x79'))[_0x0296('0x3a')](_0x0296('0x7a'),squel[_0x0296('0x7b')]()[_0x0296('0x3f')]('COALESCE(calleridnum,\x27\x27)')['from']('cm_hopper_final')[_0x0296('0x3a')]('CampaignId\x20=\x20?',_0x486922[_0x0296('0x46')]['id'][_0x0296('0x75')]()))['where'](_0x0296('0x7a'),squel[_0x0296('0x7b')]()['field'](_0x0296('0x7c'))[_0x0296('0x7d')](_0x0296('0x6d'))['where'](_0x0296('0x7e'),_0x486922[_0x0296('0x46')]['id'][_0x0296('0x75')]())))[_0x0296('0x75')]();break;case _0x0296('0x7f'):_0x458610=squel[_0x0296('0x6b')]()['into']('cm_hopper')[_0x0296('0x6e')](['phone','scheduledAt',_0x0296('0x70'),_0x0296('0x71'),_0x0296('0x5f'),_0x0296('0x57'),_0x0296('0x54')],squel['select']()[_0x0296('0x3f')]('phone',_0x0296('0x72'))[_0x0296('0x3f')]('NOW()','scheduledAt')[_0x0296('0x3f')]('id',_0x0296('0x70'))[_0x0296('0x3f')](_0x308131[_0x0296('0x74')][_0x0296('0x75')](),_0x0296('0x71'))['field'](_0x486922[_0x0296('0x46')]['id'][_0x0296('0x75')](),_0x0296('0x5f'))['field']('NOW()',_0x0296('0x57'))['field']('NOW()','updatedAt')[_0x0296('0x7d')](_0x0296('0x76'))[_0x0296('0x3a')](_0x0296('0x77'))['where']('ListId\x20=\x20?',_0x308131[_0x0296('0x74')]['toString']())[_0x0296('0x3a')](_0x0296('0x79'))[_0x0296('0x3a')]('phone\x20NOT\x20IN\x20(?)',squel[_0x0296('0x7b')]()[_0x0296('0x3f')]('COALESCE(phone,\x27\x27)')['from'](_0x0296('0x6d'))[_0x0296('0x3a')](_0x0296('0x7e'),_0x486922[_0x0296('0x46')]['id'][_0x0296('0x75')]())))[_0x0296('0x75')]();break;default:_0x458610=squel[_0x0296('0x6b')]()[_0x0296('0x6c')](_0x0296('0x6d'))[_0x0296('0x6e')]([_0x0296('0x72'),_0x0296('0x6f'),_0x0296('0x70'),'ListId',_0x0296('0x5f'),'createdAt',_0x0296('0x54')],squel[_0x0296('0x7b')]()[_0x0296('0x3f')](_0x0296('0x72'),_0x0296('0x72'))[_0x0296('0x3f')](_0x0296('0x73'),_0x0296('0x6f'))[_0x0296('0x3f')]('id','ContactId')[_0x0296('0x3f')](_0x308131[_0x0296('0x74')]['toString'](),_0x0296('0x71'))[_0x0296('0x3f')](_0x486922['params']['id']['toString'](),_0x0296('0x5f'))[_0x0296('0x3f')](_0x0296('0x73'),'createdAt')[_0x0296('0x3f')]('NOW()','updatedAt')['from'](_0x0296('0x76'))[_0x0296('0x3a')]('deletedAt\x20IS\x20NULL')[_0x0296('0x3a')]('ListId\x20=\x20?',_0x308131['CmListId'][_0x0296('0x75')]())[_0x0296('0x3a')](_0x0296('0x79')))['toString']();}_0x14f559[_0x0296('0x80')](db[_0x0296('0x81')]['query'](_0x458610));}return BPromise[_0x0296('0x82')](_0x14f559);}})[_0x0296('0x24')](function(){return _0x2f5c6a;})['then'](respondWithResult(_0x3acc0a,null))[_0x0296('0x44')](handleError(_0x3acc0a,null));};exports['removeLists']=function(_0x2a9a97,_0x5dac78,_0x2088c1){return db[_0x0296('0x2d')][_0x0296('0x4e')]({'where':{'id':_0x2a9a97[_0x0296('0x46')]['id']}})['then'](handleEntityNotFound(_0x5dac78,null))[_0x0296('0x24')](function(_0x2c9aa0){if(_0x2c9aa0){return _0x2c9aa0['removeLists'](_0x2a9a97[_0x0296('0x31')][_0x0296('0x67')]);}})[_0x0296('0x24')](function(_0x3c44fc){if(_0x3c44fc){return db[_0x0296('0x59')][_0x0296('0x25')]({'where':{'ListId':_0x2a9a97[_0x0296('0x31')][_0x0296('0x67')],'CampaignId':_0x2a9a97[_0x0296('0x46')]['id']}})[_0x0296('0x24')](function(){return _0x3c44fc;});}})[_0x0296('0x24')](respondWithStatusCode(_0x5dac78,null))['catch'](handleError(_0x5dac78,null));};exports['getBlackLists']=function(_0x5c1450,_0x1ce765,_0x481c38){var _0x487b96={'raw':!![],'where':{}};var _0x5c6cb8={};var _0xde99bd={'count':0x0,'rows':[]};return db[_0x0296('0x2d')][_0x0296('0x5d')]({'where':{'id':_0x5c1450['params']['id']}})[_0x0296('0x24')](handleEntityNotFound(_0x1ce765,null))[_0x0296('0x24')](function(_0x9b909b){if(_0x9b909b){_0x5c6cb8[_0x0296('0x30')]=_[_0x0296('0x32')](db['CmList'][_0x0296('0x47')]);_0x5c6cb8[_0x0296('0x31')]=_['keys'](_0x5c1450['query']);_0x5c6cb8['filters']=_[_0x0296('0x34')](_0x5c6cb8[_0x0296('0x30')],_0x5c6cb8[_0x0296('0x31')]);_0x487b96['attributes']=_[_0x0296('0x34')](_0x5c6cb8['model'],qs[_0x0296('0x36')](_0x5c1450[_0x0296('0x31')][_0x0296('0x36')]));_0x487b96[_0x0296('0x35')]=_0x487b96[_0x0296('0x35')][_0x0296('0x53')]?_0x487b96['attributes']:_0x5c6cb8[_0x0296('0x30')];if(!_0x5c1450['query'][_0x0296('0x5a')](_0x0296('0x37'))){_0x487b96[_0x0296('0x20')]=qs['limit'](_0x5c1450[_0x0296('0x31')][_0x0296('0x20')]);_0x487b96['offset']=qs[_0x0296('0x1f')](_0x5c1450['query'][_0x0296('0x1f')]);}_0x487b96[_0x0296('0x38')]=qs[_0x0296('0x39')](_0x5c1450[_0x0296('0x31')][_0x0296('0x39')]);_0x487b96[_0x0296('0x3a')]=qs[_0x0296('0x33')](_[_0x0296('0x3b')](_0x5c1450[_0x0296('0x31')],_0x5c6cb8[_0x0296('0x33')]));_0x487b96[_0x0296('0x3a')][_0x0296('0x5f')]=_0x9b909b['id'];if(_0x5c1450[_0x0296('0x31')][_0x0296('0x40')]){_0x487b96[_0x0296('0x3a')]=_[_0x0296('0x3c')](_0x487b96[_0x0296('0x3a')],{'$or':_[_0x0296('0x2c')](_0x487b96['attributes'],function(_0x1a4b2c){var _0x4e2cb8={};_0x4e2cb8[_0x1a4b2c]={'$like':'%'+_0x5c1450['query'][_0x0296('0x40')]+'%'};return _0x4e2cb8;})});}_0x487b96=_[_0x0296('0x3c')]({},_0x487b96,_0x5c1450[_0x0296('0x41')]);return db[_0x0296('0x65')][_0x0296('0x1e')]({'where':_0x487b96['where']})[_0x0296('0x24')](function(_0x15d612){_0xde99bd['count']=_0x15d612;if(_0x5c1450[_0x0296('0x31')][_0x0296('0x48')]){_0x487b96[_0x0296('0x42')]=[{'all':!![]}];}return db[_0x0296('0x65')][_0x0296('0x43')](_0x487b96);})[_0x0296('0x24')](function(_0x459a77){_0xde99bd[_0x0296('0x5b')]=_0x459a77;return _0xde99bd;});}})[_0x0296('0x24')](respondWithFilteredResult(_0x1ce765,_0x487b96))[_0x0296('0x44')](handleError(_0x1ce765,null));};exports[_0x0296('0x83')]=function(_0x3e4407,_0x3629d3,_0x104454){var _0x558f96,_0x2e2ef8;return db[_0x0296('0x2d')][_0x0296('0x4e')]({'where':{'id':_0x3e4407[_0x0296('0x46')]['id']}})['then'](handleEntityNotFound(_0x3629d3,null))[_0x0296('0x24')](function(_0x45ed3f){if(_0x45ed3f){_0x2e2ef8=_0x45ed3f;return _0x45ed3f['addBlackLists'](_0x3e4407[_0x0296('0x55')][_0x0296('0x67')],_[_0x0296('0x56')](_0x3e4407['body'],['ids','id'])||{});}return null;})[_0x0296('0x68')](function(_0x462aa6){var _0x3bd23c;_0x558f96=_0x462aa6||[];var _0x346e88=[];if(_0x462aa6){for(var _0x54a3e6=0x0;_0x54a3e6<_0x462aa6[_0x0296('0x53')];_0x54a3e6+=0x1){var _0x1c7253=_0x462aa6[_0x54a3e6]['get']({'plain':!![]});_0x3bd23c=squel[_0x0296('0x6b')]()[_0x0296('0x6c')](_0x0296('0x84'))[_0x0296('0x6e')]([_0x0296('0x72'),_0x0296('0x70'),_0x0296('0x71'),'CampaignId',_0x0296('0x57'),'updatedAt'],squel['select']()[_0x0296('0x3f')]('phone',_0x0296('0x72'))[_0x0296('0x3f')]('id','ContactId')[_0x0296('0x3f')](_0x1c7253[_0x0296('0x74')][_0x0296('0x75')](),_0x0296('0x71'))[_0x0296('0x3f')](_0x3e4407['params']['id'][_0x0296('0x75')](),_0x0296('0x5f'))[_0x0296('0x3f')]('NOW()','createdAt')['field'](_0x0296('0x73'),_0x0296('0x54'))[_0x0296('0x7d')](_0x0296('0x76'))[_0x0296('0x3a')](_0x0296('0x77'))['where']('ListId\x20=\x20?',_0x1c7253[_0x0296('0x74')][_0x0296('0x75')]())[_0x0296('0x3a')]('phone\x20IS\x20NOT\x20NULL'))['toString']();_0x346e88[_0x0296('0x80')](db['sequelize'][_0x0296('0x31')](_0x3bd23c));}return BPromise[_0x0296('0x82')](_0x346e88);}})[_0x0296('0x24')](function(){return _0x558f96;})[_0x0296('0x24')](respondWithResult(_0x3629d3,null))[_0x0296('0x44')](handleError(_0x3629d3,null));};exports[_0x0296('0x85')]=function(_0x4ef97b,_0x52759f,_0x2a220e){return db[_0x0296('0x2d')][_0x0296('0x4e')]({'where':{'id':_0x4ef97b[_0x0296('0x46')]['id']}})[_0x0296('0x24')](handleEntityNotFound(_0x52759f,null))[_0x0296('0x24')](function(_0x400da1){if(_0x400da1){return _0x400da1[_0x0296('0x85')](_0x4ef97b[_0x0296('0x31')][_0x0296('0x67')]);}})[_0x0296('0x24')](function(_0x1ed59d){if(_0x1ed59d){return db[_0x0296('0x63')][_0x0296('0x25')]({'where':{'ListId':_0x4ef97b[_0x0296('0x31')]['ids'],'CampaignId':_0x4ef97b[_0x0296('0x46')]['id']}})[_0x0296('0x24')](function(){return _0x1ed59d;});}})[_0x0296('0x24')](respondWithStatusCode(_0x52759f,null))[_0x0296('0x44')](handleError(_0x52759f,null));}; \ No newline at end of file +var _0xd8e5=['offset','limit','set','Content-Range','apply','save','update','then','get','IvrCampaigns','UserProfileResource','destroy','error','stack','name','send','index','map','Campaign','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','count','includeAll','include','catch','show','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','fields','length','omit','createdAt','updatedAt','body','getHoppers','CmHopper','CampaignId','findAll','rows','getHopperHistories','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','select','field','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','phone','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','push','sequelize','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','squel','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../mysqldb','sendStatus','status','end','json'];(function(_0x2f4b73,_0x18c42b){var _0x5bb898=function(_0xeb5a0d){while(--_0xeb5a0d){_0x2f4b73['push'](_0x2f4b73['shift']());}};_0x5bb898(++_0x18c42b);}(_0xd8e5,0x6b));var _0x5d8e=function(_0x25a1b9,_0x1679ff){_0x25a1b9=_0x25a1b9-0x0;var _0x2fdf88=_0xd8e5[_0x25a1b9];return _0x2fdf88;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5d8e('0x0'));var rimraf=require(_0x5d8e('0x1'));var zipdir=require(_0x5d8e('0x2'));var jsonpatch=require(_0x5d8e('0x3'));var rp=require(_0x5d8e('0x4'));var moment=require(_0x5d8e('0x5'));var BPromise=require(_0x5d8e('0x6'));var Mustache=require('mustache');var util=require(_0x5d8e('0x7'));var path=require(_0x5d8e('0x8'));var sox=require(_0x5d8e('0x9'));var csv=require(_0x5d8e('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x5d8e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5d8e('0xc'));var toCsv=require(_0x5d8e('0xa'));var querystring=require(_0x5d8e('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5d8e('0xe'));var qs=require(_0x5d8e('0xf'));var as=require(_0x5d8e('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x5d8e('0x11'));var config=require('../../config/environment');var db=require(_0x5d8e('0x12'))['db'];function respondWithStatusCode(_0x391183,_0x3fdb2f){_0x3fdb2f=_0x3fdb2f||0xcc;return function(_0x3b8a8a){if(_0x3b8a8a){return _0x391183[_0x5d8e('0x13')](_0x3fdb2f);}return _0x391183[_0x5d8e('0x14')](_0x3fdb2f)[_0x5d8e('0x15')]();};}function respondWithResult(_0x48f211,_0x36a9f5){_0x36a9f5=_0x36a9f5||0xc8;return function(_0x40f49a){if(_0x40f49a){return _0x48f211[_0x5d8e('0x14')](_0x36a9f5)[_0x5d8e('0x16')](_0x40f49a);}};}function respondWithFilteredResult(_0x35c84b,_0x5ed831){return function(_0x17ee7b){if(_0x17ee7b){var _0x3e8bac=_0x17ee7b['count'],_0x398b66=_0x5ed831[_0x5d8e('0x17')],_0x43c201=_0x5ed831[_0x5d8e('0x17')]+_0x5ed831[_0x5d8e('0x18')],_0x2bc1b6;if(_0x43c201>=_0x3e8bac){_0x43c201=_0x3e8bac;_0x2bc1b6=0xc8;}else{_0x2bc1b6=0xce;}_0x35c84b['status'](_0x2bc1b6);return _0x35c84b[_0x5d8e('0x19')](_0x5d8e('0x1a'),_0x398b66+'-'+_0x43c201+'/'+_0x3e8bac)[_0x5d8e('0x16')](_0x17ee7b);}return null;};}function patchUpdates(_0x119b95){return function(_0x5ad420){try{jsonpatch[_0x5d8e('0x1b')](_0x5ad420,_0x119b95,!![]);}catch(_0x599444){return BPromise['reject'](_0x599444);}return _0x5ad420[_0x5d8e('0x1c')]();};}function saveUpdates(_0x27d216,_0x2938ad){return function(_0x5f6d4){if(_0x5f6d4){return _0x5f6d4[_0x5d8e('0x1d')](_0x27d216)[_0x5d8e('0x1e')](function(_0x41d839){return _0x41d839;});}return null;};}function removeEntity(_0x5e0213,_0x41dd71){return function(_0x19ca32){if(_0x19ca32){return _0x19ca32['destroy']()[_0x5d8e('0x1e')](function(){var _0x406428=_0x19ca32[_0x5d8e('0x1f')]({'plain':!![]});var _0x263b8f=_0x5d8e('0x20');return db[_0x5d8e('0x21')][_0x5d8e('0x22')]({'where':{'type':_0x263b8f,'resourceId':_0x406428['id']}})[_0x5d8e('0x1e')](function(){return _0x19ca32;});})[_0x5d8e('0x1e')](function(){_0x5e0213[_0x5d8e('0x14')](0xcc)[_0x5d8e('0x15')]();});}};}function handleEntityNotFound(_0x17e252,_0x56acd8){return function(_0x33d151){if(!_0x33d151){_0x17e252[_0x5d8e('0x13')](0x194);}return _0x33d151;};}function handleError(_0xd85dac,_0xde21f2){_0xde21f2=_0xde21f2||0x1f4;return function(_0x400321){logger[_0x5d8e('0x23')](_0x400321[_0x5d8e('0x24')]);if(_0x400321[_0x5d8e('0x25')]){delete _0x400321[_0x5d8e('0x25')];}_0xd85dac[_0x5d8e('0x14')](_0xde21f2)[_0x5d8e('0x26')](_0x400321);};}exports[_0x5d8e('0x27')]=function(_0xe4cea9,_0x1edc1f){var _0x1f759e={},_0x3ed672={},_0x72dfc3={'count':0x0,'rows':[]};var _0x5e1267=_[_0x5d8e('0x28')](db[_0x5d8e('0x29')][_0x5d8e('0x2a')],function(_0x53853f){return{'name':_0x53853f['fieldName'],'type':_0x53853f[_0x5d8e('0x2b')][_0x5d8e('0x2c')]};});_0x3ed672[_0x5d8e('0x2d')]=_[_0x5d8e('0x28')](_0x5e1267,'name');_0x3ed672[_0x5d8e('0x2e')]=_[_0x5d8e('0x2f')](_0xe4cea9[_0x5d8e('0x2e')]);_0x3ed672[_0x5d8e('0x30')]=_[_0x5d8e('0x31')](_0x3ed672[_0x5d8e('0x2d')],_0x3ed672['query']);_0x1f759e[_0x5d8e('0x32')]=_[_0x5d8e('0x31')](_0x3ed672[_0x5d8e('0x2d')],qs['fields'](_0xe4cea9['query']['fields']));_0x1f759e[_0x5d8e('0x32')]=_0x1f759e[_0x5d8e('0x32')]['length']?_0x1f759e['attributes']:_0x3ed672[_0x5d8e('0x2d')];if(!_0xe4cea9[_0x5d8e('0x2e')][_0x5d8e('0x33')](_0x5d8e('0x34'))){_0x1f759e['limit']=qs[_0x5d8e('0x18')](_0xe4cea9['query'][_0x5d8e('0x18')]);_0x1f759e[_0x5d8e('0x17')]=qs[_0x5d8e('0x17')](_0xe4cea9['query']['offset']);}_0x1f759e[_0x5d8e('0x35')]=qs[_0x5d8e('0x36')](_0xe4cea9[_0x5d8e('0x2e')][_0x5d8e('0x36')]);_0x1f759e[_0x5d8e('0x37')]=qs[_0x5d8e('0x30')](_[_0x5d8e('0x38')](_0xe4cea9[_0x5d8e('0x2e')],_0x3ed672['filters']));if(_0xe4cea9[_0x5d8e('0x2e')][_0x5d8e('0x39')]){_0x1f759e['where']=_['merge'](_0x1f759e[_0x5d8e('0x37')],{'$or':_['map'](_0x5e1267,function(_0x1a0867){if(_0x1a0867[_0x5d8e('0x2b')][_0x5d8e('0x2c')]!=='VIRTUAL'){var _0x1a909b={};_0x1a909b[_0x1a0867['field']]={'$like':'%'+_0xe4cea9[_0x5d8e('0x2e')][_0x5d8e('0x39')]+'%'};return _0x1a909b;}})});}_0x1f759e=_[_0x5d8e('0x3a')]({},_0x1f759e,_0xe4cea9[_0x5d8e('0x3b')]);var _0x5ae111={'where':_0x1f759e[_0x5d8e('0x37')]};return db[_0x5d8e('0x29')][_0x5d8e('0x3c')](_0x5ae111)[_0x5d8e('0x1e')](function(_0x5e5f99){_0x72dfc3[_0x5d8e('0x3c')]=_0x5e5f99;if(_0xe4cea9[_0x5d8e('0x2e')][_0x5d8e('0x3d')]){_0x1f759e[_0x5d8e('0x3e')]=[{'all':!![]}];}return db[_0x5d8e('0x29')]['findAll'](_0x1f759e);})[_0x5d8e('0x1e')](function(_0x1b3759){_0x72dfc3['rows']=_0x1b3759;return _0x72dfc3;})['then'](respondWithFilteredResult(_0x1edc1f,_0x1f759e))[_0x5d8e('0x3f')](handleError(_0x1edc1f,null));};exports[_0x5d8e('0x40')]=function(_0x1f9de8,_0xa018f7){var _0x439309={'raw':![],'where':{'id':_0x1f9de8['params']['id']}},_0x1e0360={};_0x1e0360[_0x5d8e('0x2d')]=_['keys'](db['Campaign'][_0x5d8e('0x2a')]);_0x1e0360['query']=_[_0x5d8e('0x2f')](_0x1f9de8['query']);_0x1e0360[_0x5d8e('0x30')]=_[_0x5d8e('0x31')](_0x1e0360[_0x5d8e('0x2d')],_0x1e0360['query']);_0x439309[_0x5d8e('0x32')]=_[_0x5d8e('0x31')](_0x1e0360[_0x5d8e('0x2d')],qs['fields'](_0x1f9de8[_0x5d8e('0x2e')]['fields']));_0x439309[_0x5d8e('0x32')]=_0x439309['attributes']['length']?_0x439309[_0x5d8e('0x32')]:_0x1e0360[_0x5d8e('0x2d')];if(_0x1f9de8[_0x5d8e('0x2e')][_0x5d8e('0x3d')]){_0x439309[_0x5d8e('0x3e')]=[{'all':!![]}];}_0x439309=_[_0x5d8e('0x3a')]({},_0x439309,_0x1f9de8[_0x5d8e('0x3b')]);return db[_0x5d8e('0x29')][_0x5d8e('0x41')](_0x439309)[_0x5d8e('0x1e')](handleEntityNotFound(_0xa018f7,null))[_0x5d8e('0x1e')](respondWithResult(_0xa018f7,null))[_0x5d8e('0x3f')](handleError(_0xa018f7,null));};exports[_0x5d8e('0x42')]=function(_0x45f197,_0x2624c5){return db[_0x5d8e('0x29')][_0x5d8e('0x42')](_0x45f197['body'],{})['then'](function(_0x3e0d43){var _0x54c20e=_0x45f197[_0x5d8e('0x43')]['get']({'plain':!![]});if(!_0x54c20e)throw new Error(_0x5d8e('0x44'));if(_0x54c20e[_0x5d8e('0x45')]===_0x5d8e('0x43')){var _0x51769a=_0x3e0d43['get']({'plain':!![]});var _0x10ba99=_0x5d8e('0x20');return db['UserProfileSection'][_0x5d8e('0x41')]({'where':{'name':_0x10ba99,'userProfileId':_0x54c20e[_0x5d8e('0x46')]},'raw':!![]})['then'](function(_0x1fef98){if(_0x1fef98&&_0x1fef98[_0x5d8e('0x47')]===0x0){return db['UserProfileResource']['create']({'name':_0x51769a[_0x5d8e('0x25')],'resourceId':_0x51769a['id'],'type':_0x1fef98[_0x5d8e('0x25')],'sectionId':_0x1fef98['id']},{})[_0x5d8e('0x1e')](function(){return _0x3e0d43;});}else{return _0x3e0d43;}})[_0x5d8e('0x3f')](function(_0x20bf75){logger[_0x5d8e('0x23')](_0x5d8e('0x48'),_0x20bf75);throw _0x20bf75;});}return _0x3e0d43;})['then'](respondWithResult(_0x2624c5,0xc9))[_0x5d8e('0x3f')](handleError(_0x2624c5,null));};exports[_0x5d8e('0x49')]=function(_0x58347b,_0x1331cf){var _0x279bbf={'raw':![],'where':{'id':_0x58347b[_0x5d8e('0x4a')]['id']}},_0x5f550b={};_0x5f550b[_0x5d8e('0x2d')]=_[_0x5d8e('0x2f')](db[_0x5d8e('0x29')][_0x5d8e('0x2a')]);_0x279bbf['attributes']=_[_0x5d8e('0x31')](_0x5f550b['model'],qs[_0x5d8e('0x4b')](_0x58347b[_0x5d8e('0x2e')][_0x5d8e('0x4b')]));_0x279bbf[_0x5d8e('0x32')]=_0x279bbf[_0x5d8e('0x32')][_0x5d8e('0x4c')]?_0x279bbf[_0x5d8e('0x32')]:_0x5f550b[_0x5d8e('0x2d')];if(_0x58347b[_0x5d8e('0x2e')][_0x5d8e('0x3d')]){_0x279bbf[_0x5d8e('0x3e')]=[{'all':!![]}];}_0x279bbf=_['merge']({},_0x279bbf,_0x58347b[_0x5d8e('0x3b')]);return db[_0x5d8e('0x29')][_0x5d8e('0x41')](_0x279bbf)['then'](handleEntityNotFound(_0x1331cf,null))[_0x5d8e('0x1e')](function(_0x325f34){if(_0x325f34){var _0x523359=_0x325f34['get']({'plain':!![]});_0x523359=qs[_0x5d8e('0x4d')](_0x523359,['id',_0x5d8e('0x4e'),_0x5d8e('0x4f')]);_0x58347b['body']=_['omit'](_0x58347b[_0x5d8e('0x50')],['id','createdAt',_0x5d8e('0x4f')]);return db[_0x5d8e('0x29')][_0x5d8e('0x42')](_['merge'](_0x523359,_0x58347b[_0x5d8e('0x50')]),{'include':_0x58347b[_0x5d8e('0x2e')][_0x5d8e('0x3d')]?[{'all':!![]}]:undefined})[_0x5d8e('0x1e')](function(_0x1e20cc){var _0x20de9f=_0x58347b[_0x5d8e('0x43')][_0x5d8e('0x1f')]({'plain':!![]});if(!_0x20de9f)throw new Error(_0x5d8e('0x44'));if(_0x20de9f[_0x5d8e('0x45')]===_0x5d8e('0x43')){var _0x1c1d64=_0x1e20cc[_0x5d8e('0x1f')]({'plain':!![]});var _0x244a67=_0x5d8e('0x20');return db['UserProfileSection'][_0x5d8e('0x41')]({'where':{'name':_0x244a67,'userProfileId':_0x20de9f[_0x5d8e('0x46')]},'raw':!![]})['then'](function(_0x9b2320){if(_0x9b2320&&_0x9b2320[_0x5d8e('0x47')]===0x0){return db[_0x5d8e('0x21')][_0x5d8e('0x42')]({'name':_0x1c1d64[_0x5d8e('0x25')],'resourceId':_0x1c1d64['id'],'type':_0x9b2320['name'],'sectionId':_0x9b2320['id']},{})[_0x5d8e('0x1e')](function(){return _0x1e20cc;});}else{return _0x1e20cc;}})['catch'](function(_0x4eec4f){logger[_0x5d8e('0x23')](_0x5d8e('0x48'),_0x4eec4f);throw _0x4eec4f;});}return _0x1e20cc;});}})[_0x5d8e('0x1e')](respondWithResult(_0x1331cf,0xc9))['catch'](handleError(_0x1331cf,null));};exports[_0x5d8e('0x1d')]=function(_0x16b931,_0x561fe6){if(_0x16b931[_0x5d8e('0x50')]['id']){delete _0x16b931[_0x5d8e('0x50')]['id'];}return db[_0x5d8e('0x29')][_0x5d8e('0x41')]({'where':{'id':_0x16b931['params']['id']}})[_0x5d8e('0x1e')](handleEntityNotFound(_0x561fe6,null))[_0x5d8e('0x1e')](saveUpdates(_0x16b931[_0x5d8e('0x50')],null))['then'](respondWithResult(_0x561fe6,null))['catch'](handleError(_0x561fe6,null));};exports[_0x5d8e('0x22')]=function(_0x446564,_0x3f6415){return db[_0x5d8e('0x29')]['find']({'where':{'id':_0x446564[_0x5d8e('0x4a')]['id']}})[_0x5d8e('0x1e')](handleEntityNotFound(_0x3f6415,null))['then'](removeEntity(_0x3f6415,null))[_0x5d8e('0x3f')](handleError(_0x3f6415,null));};exports[_0x5d8e('0x51')]=function(_0x3a1bc8,_0x682553,_0x126988){var _0x44e6ec={'raw':!![],'where':{}};var _0x208dd5={};var _0x55ba06={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x3a1bc8[_0x5d8e('0x4a')]['id']}})[_0x5d8e('0x1e')](handleEntityNotFound(_0x682553,null))[_0x5d8e('0x1e')](function(_0x500596){if(_0x500596){_0x208dd5[_0x5d8e('0x2d')]=_[_0x5d8e('0x2f')](db[_0x5d8e('0x52')]['rawAttributes']);_0x208dd5[_0x5d8e('0x2e')]=_[_0x5d8e('0x2f')](_0x3a1bc8[_0x5d8e('0x2e')]);_0x208dd5[_0x5d8e('0x30')]=_[_0x5d8e('0x31')](_0x208dd5['model'],_0x208dd5[_0x5d8e('0x2e')]);_0x44e6ec[_0x5d8e('0x32')]=_[_0x5d8e('0x31')](_0x208dd5[_0x5d8e('0x2d')],qs[_0x5d8e('0x4b')](_0x3a1bc8['query'][_0x5d8e('0x4b')]));_0x44e6ec[_0x5d8e('0x32')]=_0x44e6ec[_0x5d8e('0x32')]['length']?_0x44e6ec['attributes']:_0x208dd5[_0x5d8e('0x2d')];if(!_0x3a1bc8['query'][_0x5d8e('0x33')](_0x5d8e('0x34'))){_0x44e6ec[_0x5d8e('0x18')]=qs[_0x5d8e('0x18')](_0x3a1bc8[_0x5d8e('0x2e')]['limit']);_0x44e6ec[_0x5d8e('0x17')]=qs[_0x5d8e('0x17')](_0x3a1bc8['query'][_0x5d8e('0x17')]);}_0x44e6ec[_0x5d8e('0x35')]=qs[_0x5d8e('0x36')](_0x3a1bc8[_0x5d8e('0x2e')][_0x5d8e('0x36')]);_0x44e6ec[_0x5d8e('0x37')]=qs['filters'](_['pick'](_0x3a1bc8[_0x5d8e('0x2e')],_0x208dd5[_0x5d8e('0x30')]));_0x44e6ec[_0x5d8e('0x37')][_0x5d8e('0x53')]=_0x500596['id'];if(_0x3a1bc8[_0x5d8e('0x2e')][_0x5d8e('0x39')]){_0x44e6ec['where']=_[_0x5d8e('0x3a')](_0x44e6ec['where'],{'$or':_['map'](_0x44e6ec[_0x5d8e('0x32')],function(_0x2cabce){var _0x3db33e={};_0x3db33e[_0x2cabce]={'$like':'%'+_0x3a1bc8[_0x5d8e('0x2e')][_0x5d8e('0x39')]+'%'};return _0x3db33e;})});}_0x44e6ec=_['merge']({},_0x44e6ec,_0x3a1bc8[_0x5d8e('0x3b')]);return db[_0x5d8e('0x52')][_0x5d8e('0x3c')]({'where':_0x44e6ec[_0x5d8e('0x37')]})[_0x5d8e('0x1e')](function(_0x68d5c1){_0x55ba06['count']=_0x68d5c1;if(_0x3a1bc8['query'][_0x5d8e('0x3d')]){_0x44e6ec[_0x5d8e('0x3e')]=[{'all':!![]}];}return db[_0x5d8e('0x52')][_0x5d8e('0x54')](_0x44e6ec);})[_0x5d8e('0x1e')](function(_0x5dcb80){_0x55ba06[_0x5d8e('0x55')]=_0x5dcb80;return _0x55ba06;});}})[_0x5d8e('0x1e')](respondWithFilteredResult(_0x682553,_0x44e6ec))[_0x5d8e('0x3f')](handleError(_0x682553,null));};exports[_0x5d8e('0x56')]=function(_0x16729a,_0x449049,_0x42d067){var _0x630b6a={'raw':!![],'where':{}};var _0x307731={};var _0x4ce075={'count':0x0,'rows':[]};return db[_0x5d8e('0x29')][_0x5d8e('0x57')]({'where':{'id':_0x16729a['params']['id']}})[_0x5d8e('0x1e')](handleEntityNotFound(_0x449049,null))[_0x5d8e('0x1e')](function(_0x541c7d){if(_0x541c7d){_0x307731[_0x5d8e('0x2d')]=_['keys'](db[_0x5d8e('0x58')][_0x5d8e('0x2a')]);_0x307731[_0x5d8e('0x2e')]=_['keys'](_0x16729a[_0x5d8e('0x2e')]);_0x307731[_0x5d8e('0x30')]=_[_0x5d8e('0x31')](_0x307731[_0x5d8e('0x2d')],_0x307731[_0x5d8e('0x2e')]);_0x630b6a[_0x5d8e('0x32')]=_[_0x5d8e('0x31')](_0x307731[_0x5d8e('0x2d')],qs['fields'](_0x16729a['query'][_0x5d8e('0x4b')]));_0x630b6a['attributes']=_0x630b6a[_0x5d8e('0x32')][_0x5d8e('0x4c')]?_0x630b6a['attributes']:_0x307731[_0x5d8e('0x2d')];if(!_0x16729a[_0x5d8e('0x2e')][_0x5d8e('0x33')](_0x5d8e('0x34'))){_0x630b6a[_0x5d8e('0x18')]=qs['limit'](_0x16729a[_0x5d8e('0x2e')]['limit']);_0x630b6a['offset']=qs[_0x5d8e('0x17')](_0x16729a[_0x5d8e('0x2e')][_0x5d8e('0x17')]);}_0x630b6a[_0x5d8e('0x35')]=qs[_0x5d8e('0x36')](_0x16729a['query'][_0x5d8e('0x36')]);_0x630b6a[_0x5d8e('0x37')]=qs[_0x5d8e('0x30')](_[_0x5d8e('0x38')](_0x16729a['query'],_0x307731['filters']));_0x630b6a[_0x5d8e('0x37')]['CampaignId']=_0x541c7d['id'];if(_0x16729a['query'][_0x5d8e('0x39')]){_0x630b6a[_0x5d8e('0x37')]=_['merge'](_0x630b6a[_0x5d8e('0x37')],{'$or':_[_0x5d8e('0x28')](_0x630b6a[_0x5d8e('0x32')],function(_0x52c242){var _0x3a1de2={};_0x3a1de2[_0x52c242]={'$like':'%'+_0x16729a[_0x5d8e('0x2e')][_0x5d8e('0x39')]+'%'};return _0x3a1de2;})});}_0x630b6a=_[_0x5d8e('0x3a')]({},_0x630b6a,_0x16729a['options']);return db[_0x5d8e('0x58')][_0x5d8e('0x3c')]({'where':_0x630b6a[_0x5d8e('0x37')]})[_0x5d8e('0x1e')](function(_0x5f30f2){_0x4ce075['count']=_0x5f30f2;if(_0x16729a[_0x5d8e('0x2e')][_0x5d8e('0x3d')]){_0x630b6a[_0x5d8e('0x3e')]=[{'all':!![]}];}return db[_0x5d8e('0x58')][_0x5d8e('0x54')](_0x630b6a);})[_0x5d8e('0x1e')](function(_0x5bf3dd){_0x4ce075[_0x5d8e('0x55')]=_0x5bf3dd;return _0x4ce075;});}})[_0x5d8e('0x1e')](respondWithFilteredResult(_0x449049,_0x630b6a))[_0x5d8e('0x3f')](handleError(_0x449049,null));};exports[_0x5d8e('0x59')]=function(_0x5965bc,_0x404c42,_0x4f2f9e){var _0x39e24a={'raw':!![],'where':{}};var _0x5e1129={};var _0x36f4d9={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x5965bc['params']['id']}})[_0x5d8e('0x1e')](handleEntityNotFound(_0x404c42,null))[_0x5d8e('0x1e')](function(_0x15156e){if(_0x15156e){_0x5e1129[_0x5d8e('0x2d')]=_[_0x5d8e('0x2f')](db[_0x5d8e('0x5a')][_0x5d8e('0x2a')]);_0x5e1129['query']=_[_0x5d8e('0x2f')](_0x5965bc[_0x5d8e('0x2e')]);_0x5e1129[_0x5d8e('0x30')]=_[_0x5d8e('0x31')](_0x5e1129[_0x5d8e('0x2d')],_0x5e1129[_0x5d8e('0x2e')]);_0x39e24a[_0x5d8e('0x32')]=_[_0x5d8e('0x31')](_0x5e1129['model'],qs[_0x5d8e('0x4b')](_0x5965bc[_0x5d8e('0x2e')]['fields']));_0x39e24a[_0x5d8e('0x32')]=_0x39e24a[_0x5d8e('0x32')][_0x5d8e('0x4c')]?_0x39e24a[_0x5d8e('0x32')]:_0x5e1129[_0x5d8e('0x2d')];if(!_0x5965bc[_0x5d8e('0x2e')]['hasOwnProperty'](_0x5d8e('0x34'))){_0x39e24a[_0x5d8e('0x18')]=qs[_0x5d8e('0x18')](_0x5965bc['query'][_0x5d8e('0x18')]);_0x39e24a[_0x5d8e('0x17')]=qs[_0x5d8e('0x17')](_0x5965bc[_0x5d8e('0x2e')][_0x5d8e('0x17')]);}_0x39e24a[_0x5d8e('0x35')]=qs[_0x5d8e('0x36')](_0x5965bc['query']['sort']);_0x39e24a['where']=qs[_0x5d8e('0x30')](_[_0x5d8e('0x38')](_0x5965bc[_0x5d8e('0x2e')],_0x5e1129['filters']));_0x39e24a['where'][_0x5d8e('0x53')]=_0x15156e['id'];if(_0x5965bc['query'][_0x5d8e('0x39')]){_0x39e24a['where']=_[_0x5d8e('0x3a')](_0x39e24a[_0x5d8e('0x37')],{'$or':_[_0x5d8e('0x28')](_0x39e24a['attributes'],function(_0x1e6624){var _0x3f089c={};_0x3f089c[_0x1e6624]={'$like':'%'+_0x5965bc[_0x5d8e('0x2e')]['filter']+'%'};return _0x3f089c;})});}_0x39e24a=_[_0x5d8e('0x3a')]({},_0x39e24a,_0x5965bc[_0x5d8e('0x3b')]);return db['CmHopperFinal'][_0x5d8e('0x3c')]({'where':_0x39e24a[_0x5d8e('0x37')]})[_0x5d8e('0x1e')](function(_0x4f5dcd){_0x36f4d9[_0x5d8e('0x3c')]=_0x4f5dcd;if(_0x5965bc[_0x5d8e('0x2e')][_0x5d8e('0x3d')]){_0x39e24a['include']=[{'all':!![]}];}return db[_0x5d8e('0x5a')][_0x5d8e('0x54')](_0x39e24a);})[_0x5d8e('0x1e')](function(_0x1d9701){_0x36f4d9[_0x5d8e('0x55')]=_0x1d9701;return _0x36f4d9;});}})[_0x5d8e('0x1e')](respondWithFilteredResult(_0x404c42,_0x39e24a))[_0x5d8e('0x3f')](handleError(_0x404c42,null));};exports['getHopperBlacks']=function(_0x4ea7b3,_0x172ecb,_0x499bf0){var _0xbf0f82={'raw':!![],'where':{}};var _0x14a574={};var _0xdd62a8={'count':0x0,'rows':[]};return db[_0x5d8e('0x29')]['findOne']({'where':{'id':_0x4ea7b3[_0x5d8e('0x4a')]['id']}})[_0x5d8e('0x1e')](handleEntityNotFound(_0x172ecb,null))[_0x5d8e('0x1e')](function(_0x359450){if(_0x359450){_0x14a574['model']=_[_0x5d8e('0x2f')](db[_0x5d8e('0x5b')]['rawAttributes']);_0x14a574[_0x5d8e('0x2e')]=_[_0x5d8e('0x2f')](_0x4ea7b3[_0x5d8e('0x2e')]);_0x14a574[_0x5d8e('0x30')]=_[_0x5d8e('0x31')](_0x14a574[_0x5d8e('0x2d')],_0x14a574['query']);_0xbf0f82[_0x5d8e('0x32')]=_[_0x5d8e('0x31')](_0x14a574[_0x5d8e('0x2d')],qs[_0x5d8e('0x4b')](_0x4ea7b3[_0x5d8e('0x2e')][_0x5d8e('0x4b')]));_0xbf0f82[_0x5d8e('0x32')]=_0xbf0f82[_0x5d8e('0x32')][_0x5d8e('0x4c')]?_0xbf0f82['attributes']:_0x14a574['model'];if(!_0x4ea7b3['query'][_0x5d8e('0x33')](_0x5d8e('0x34'))){_0xbf0f82[_0x5d8e('0x18')]=qs['limit'](_0x4ea7b3[_0x5d8e('0x2e')][_0x5d8e('0x18')]);_0xbf0f82[_0x5d8e('0x17')]=qs['offset'](_0x4ea7b3['query']['offset']);}_0xbf0f82['order']=qs[_0x5d8e('0x36')](_0x4ea7b3[_0x5d8e('0x2e')][_0x5d8e('0x36')]);_0xbf0f82[_0x5d8e('0x37')]=qs[_0x5d8e('0x30')](_['pick'](_0x4ea7b3[_0x5d8e('0x2e')],_0x14a574['filters']));_0xbf0f82[_0x5d8e('0x37')][_0x5d8e('0x53')]=_0x359450['id'];if(_0x4ea7b3['query']['filter']){_0xbf0f82[_0x5d8e('0x37')]=_['merge'](_0xbf0f82[_0x5d8e('0x37')],{'$or':_[_0x5d8e('0x28')](_0xbf0f82[_0x5d8e('0x32')],function(_0x2fd897){var _0x15e811={};_0x15e811[_0x2fd897]={'$like':'%'+_0x4ea7b3[_0x5d8e('0x2e')][_0x5d8e('0x39')]+'%'};return _0x15e811;})});}_0xbf0f82=_[_0x5d8e('0x3a')]({},_0xbf0f82,_0x4ea7b3[_0x5d8e('0x3b')]);return db[_0x5d8e('0x5b')][_0x5d8e('0x3c')]({'where':_0xbf0f82[_0x5d8e('0x37')]})['then'](function(_0x9b5aa6){_0xdd62a8[_0x5d8e('0x3c')]=_0x9b5aa6;if(_0x4ea7b3['query'][_0x5d8e('0x3d')]){_0xbf0f82[_0x5d8e('0x3e')]=[{'all':!![]}];}return db[_0x5d8e('0x5b')]['findAll'](_0xbf0f82);})['then'](function(_0x1051a0){_0xdd62a8['rows']=_0x1051a0;return _0xdd62a8;});}})[_0x5d8e('0x1e')](respondWithFilteredResult(_0x172ecb,_0xbf0f82))[_0x5d8e('0x3f')](handleError(_0x172ecb,null));};exports[_0x5d8e('0x5c')]=function(_0x33c3df,_0x27040a,_0xc6e333){var _0x5ca664={};var _0x50c875={};var _0x2425a3;var _0x3f672d;return db[_0x5d8e('0x29')]['findOne']({'where':{'id':_0x33c3df[_0x5d8e('0x4a')]['id']}})[_0x5d8e('0x1e')](handleEntityNotFound(_0x27040a,null))[_0x5d8e('0x1e')](function(_0x1622bd){if(_0x1622bd){_0x2425a3=_0x1622bd;_0x50c875['model']=_[_0x5d8e('0x2f')](db[_0x5d8e('0x5d')]['rawAttributes']);_0x50c875[_0x5d8e('0x2e')]=_[_0x5d8e('0x2f')](_0x33c3df[_0x5d8e('0x2e')]);_0x50c875[_0x5d8e('0x30')]=_[_0x5d8e('0x31')](_0x50c875[_0x5d8e('0x2d')],_0x50c875[_0x5d8e('0x2e')]);_0x5ca664['attributes']=_[_0x5d8e('0x31')](_0x50c875[_0x5d8e('0x2d')],qs[_0x5d8e('0x4b')](_0x33c3df[_0x5d8e('0x2e')]['fields']));_0x5ca664[_0x5d8e('0x32')]=_0x5ca664[_0x5d8e('0x32')][_0x5d8e('0x4c')]?_0x5ca664[_0x5d8e('0x32')]:_0x50c875[_0x5d8e('0x2d')];_0x5ca664[_0x5d8e('0x35')]=qs['sort'](_0x33c3df[_0x5d8e('0x2e')][_0x5d8e('0x36')]);_0x5ca664[_0x5d8e('0x37')]=qs[_0x5d8e('0x30')](_[_0x5d8e('0x38')](_0x33c3df[_0x5d8e('0x2e')],_0x50c875[_0x5d8e('0x30')]));if(_0x33c3df['query']['filter']){_0x5ca664[_0x5d8e('0x37')]=_[_0x5d8e('0x3a')](_0x5ca664[_0x5d8e('0x37')],{'$or':_[_0x5d8e('0x28')](_0x5ca664[_0x5d8e('0x32')],function(_0x1d86bf){var _0x38065a={};_0x38065a[_0x1d86bf]={'$like':'%'+_0x33c3df[_0x5d8e('0x2e')][_0x5d8e('0x39')]+'%'};return _0x38065a;})});}_0x5ca664=_['merge']({},_0x5ca664,_0x33c3df[_0x5d8e('0x3b')]);return _0x2425a3[_0x5d8e('0x5c')](_0x5ca664);}})[_0x5d8e('0x1e')](function(_0x4f4f67){if(_0x4f4f67){_0x3f672d=_0x4f4f67['length'];if(!_0x33c3df[_0x5d8e('0x2e')][_0x5d8e('0x33')]('nolimit')){_0x5ca664[_0x5d8e('0x18')]=qs['limit'](_0x33c3df[_0x5d8e('0x2e')][_0x5d8e('0x18')]);_0x5ca664[_0x5d8e('0x17')]=qs['offset'](_0x33c3df[_0x5d8e('0x2e')][_0x5d8e('0x17')]);}return _0x2425a3['getLists'](_0x5ca664);}})[_0x5d8e('0x1e')](function(_0x4ac604){if(_0x4ac604){return _0x4ac604?{'count':_0x3f672d,'rows':_0x4ac604}:null;}})['then'](respondWithResult(_0x27040a,null))['catch'](handleError(_0x27040a,null));};exports['addLists']=function(_0x4c11a3,_0x542f96,_0x39df36){var _0x38c802,_0x148287;return db[_0x5d8e('0x29')][_0x5d8e('0x41')]({'where':{'id':_0x4c11a3['params']['id']}})[_0x5d8e('0x1e')](handleEntityNotFound(_0x542f96,null))['then'](function(_0xbf705f){if(_0xbf705f){_0x148287=_0xbf705f;return _0xbf705f[_0x5d8e('0x5e')](_0x4c11a3[_0x5d8e('0x50')][_0x5d8e('0x5f')],_[_0x5d8e('0x4d')](_0x4c11a3[_0x5d8e('0x50')],[_0x5d8e('0x5f'),'id'])||{});}return null;})[_0x5d8e('0x60')](function(_0x1cf108){var _0x344924;_0x38c802=_0x1cf108||[];var _0xd1a918=[];if(_0x1cf108){for(var _0x9a2afe=0x0;_0x9a2afe<_0x1cf108[_0x5d8e('0x4c')];_0x9a2afe+=0x1){var _0x357684=_0x1cf108[_0x9a2afe][_0x5d8e('0x1f')]({'plain':!![]});_0x148287[_0x5d8e('0x61')]=_0x4c11a3[_0x5d8e('0x50')][_0x5d8e('0x61')]?_0x4c11a3[_0x5d8e('0x50')][_0x5d8e('0x61')]:_0x148287[_0x5d8e('0x61')];switch(_0x148287[_0x5d8e('0x61')]){case _0x5d8e('0x62'):_0x344924=squel[_0x5d8e('0x63')]()[_0x5d8e('0x64')](_0x5d8e('0x65'))[_0x5d8e('0x66')](['phone',_0x5d8e('0x67'),_0x5d8e('0x68'),_0x5d8e('0x69'),_0x5d8e('0x53'),_0x5d8e('0x4e'),'updatedAt'],squel[_0x5d8e('0x6a')]()[_0x5d8e('0x6b')]('phone','phone')['field'](_0x5d8e('0x6c'),_0x5d8e('0x67'))[_0x5d8e('0x6b')]('id',_0x5d8e('0x68'))[_0x5d8e('0x6b')](_0x357684[_0x5d8e('0x6d')][_0x5d8e('0x6e')](),_0x5d8e('0x69'))[_0x5d8e('0x6b')](_0x4c11a3[_0x5d8e('0x4a')]['id'][_0x5d8e('0x6e')](),_0x5d8e('0x53'))[_0x5d8e('0x6b')](_0x5d8e('0x6c'),'createdAt')[_0x5d8e('0x6b')](_0x5d8e('0x6c'),_0x5d8e('0x4f'))[_0x5d8e('0x6f')](_0x5d8e('0x70'))[_0x5d8e('0x37')](_0x5d8e('0x71'))[_0x5d8e('0x37')](_0x5d8e('0x72'),_0x357684[_0x5d8e('0x6d')][_0x5d8e('0x6e')]())[_0x5d8e('0x37')](_0x5d8e('0x73'))[_0x5d8e('0x37')](_0x5d8e('0x74'),squel['select']()['field'](_0x5d8e('0x75'))[_0x5d8e('0x6f')](_0x5d8e('0x76'))[_0x5d8e('0x37')](_0x5d8e('0x77'),_0x4c11a3['params']['id'][_0x5d8e('0x6e')]()))[_0x5d8e('0x37')](_0x5d8e('0x74'),squel[_0x5d8e('0x6a')]()[_0x5d8e('0x6b')](_0x5d8e('0x78'))[_0x5d8e('0x6f')](_0x5d8e('0x65'))['where'](_0x5d8e('0x77'),_0x4c11a3['params']['id'][_0x5d8e('0x6e')]())))[_0x5d8e('0x6e')]();break;case'onlyIfOpen':_0x344924=squel['insert']()[_0x5d8e('0x64')](_0x5d8e('0x65'))[_0x5d8e('0x66')]([_0x5d8e('0x79'),_0x5d8e('0x67'),'ContactId','ListId','CampaignId','createdAt','updatedAt'],squel[_0x5d8e('0x6a')]()['field']('phone',_0x5d8e('0x79'))[_0x5d8e('0x6b')]('NOW()','scheduledAt')['field']('id','ContactId')['field'](_0x357684['CmListId']['toString'](),_0x5d8e('0x69'))[_0x5d8e('0x6b')](_0x4c11a3[_0x5d8e('0x4a')]['id']['toString'](),'CampaignId')['field'](_0x5d8e('0x6c'),_0x5d8e('0x4e'))[_0x5d8e('0x6b')](_0x5d8e('0x6c'),'updatedAt')[_0x5d8e('0x6f')](_0x5d8e('0x70'))[_0x5d8e('0x37')](_0x5d8e('0x71'))['where'](_0x5d8e('0x72'),_0x357684[_0x5d8e('0x6d')]['toString']())[_0x5d8e('0x37')](_0x5d8e('0x73'))['where'](_0x5d8e('0x74'),squel[_0x5d8e('0x6a')]()['field']('COALESCE(phone,\x27\x27)')['from'](_0x5d8e('0x65'))[_0x5d8e('0x37')](_0x5d8e('0x77'),_0x4c11a3[_0x5d8e('0x4a')]['id'][_0x5d8e('0x6e')]())))[_0x5d8e('0x6e')]();break;default:_0x344924=squel[_0x5d8e('0x63')]()[_0x5d8e('0x64')](_0x5d8e('0x65'))['fromQuery']([_0x5d8e('0x79'),_0x5d8e('0x67'),_0x5d8e('0x68'),_0x5d8e('0x69'),_0x5d8e('0x53'),'createdAt','updatedAt'],squel['select']()['field'](_0x5d8e('0x79'),_0x5d8e('0x79'))['field'](_0x5d8e('0x6c'),'scheduledAt')[_0x5d8e('0x6b')]('id','ContactId')[_0x5d8e('0x6b')](_0x357684['CmListId']['toString'](),'ListId')['field'](_0x4c11a3['params']['id'][_0x5d8e('0x6e')](),_0x5d8e('0x53'))['field'](_0x5d8e('0x6c'),_0x5d8e('0x4e'))[_0x5d8e('0x6b')](_0x5d8e('0x6c'),_0x5d8e('0x4f'))['from']('cm_contacts')[_0x5d8e('0x37')](_0x5d8e('0x71'))[_0x5d8e('0x37')](_0x5d8e('0x72'),_0x357684[_0x5d8e('0x6d')][_0x5d8e('0x6e')]())[_0x5d8e('0x37')](_0x5d8e('0x73')))['toString']();}_0xd1a918['push'](db['sequelize'][_0x5d8e('0x2e')](_0x344924));}return BPromise[_0x5d8e('0x7a')](_0xd1a918);}})[_0x5d8e('0x1e')](function(){return _0x38c802;})['then'](respondWithResult(_0x542f96,null))[_0x5d8e('0x3f')](handleError(_0x542f96,null));};exports[_0x5d8e('0x7b')]=function(_0xbb0f24,_0x3f3e74,_0x300239){return db[_0x5d8e('0x29')][_0x5d8e('0x41')]({'where':{'id':_0xbb0f24[_0x5d8e('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3f3e74,null))['then'](function(_0x26edeb){if(_0x26edeb){return _0x26edeb['removeLists'](_0xbb0f24[_0x5d8e('0x2e')][_0x5d8e('0x5f')]);}})['then'](function(_0x11eae1){if(_0x11eae1){return db[_0x5d8e('0x52')][_0x5d8e('0x22')]({'where':{'ListId':_0xbb0f24[_0x5d8e('0x2e')][_0x5d8e('0x5f')],'CampaignId':_0xbb0f24[_0x5d8e('0x4a')]['id']}})[_0x5d8e('0x1e')](function(){return _0x11eae1;});}})[_0x5d8e('0x1e')](respondWithStatusCode(_0x3f3e74,null))[_0x5d8e('0x3f')](handleError(_0x3f3e74,null));};exports[_0x5d8e('0x7c')]=function(_0x4ed6f4,_0x1797db,_0x20a2f8){var _0x224771={'raw':!![],'where':{}};var _0x4806c1={};var _0x7452a2={'count':0x0,'rows':[]};return db[_0x5d8e('0x29')][_0x5d8e('0x57')]({'where':{'id':_0x4ed6f4['params']['id']}})[_0x5d8e('0x1e')](handleEntityNotFound(_0x1797db,null))[_0x5d8e('0x1e')](function(_0x481967){if(_0x481967){_0x4806c1[_0x5d8e('0x2d')]=_[_0x5d8e('0x2f')](db[_0x5d8e('0x5d')]['rawAttributes']);_0x4806c1[_0x5d8e('0x2e')]=_['keys'](_0x4ed6f4[_0x5d8e('0x2e')]);_0x4806c1['filters']=_[_0x5d8e('0x31')](_0x4806c1[_0x5d8e('0x2d')],_0x4806c1[_0x5d8e('0x2e')]);_0x224771[_0x5d8e('0x32')]=_['intersection'](_0x4806c1[_0x5d8e('0x2d')],qs['fields'](_0x4ed6f4[_0x5d8e('0x2e')][_0x5d8e('0x4b')]));_0x224771[_0x5d8e('0x32')]=_0x224771[_0x5d8e('0x32')][_0x5d8e('0x4c')]?_0x224771[_0x5d8e('0x32')]:_0x4806c1['model'];if(!_0x4ed6f4[_0x5d8e('0x2e')][_0x5d8e('0x33')]('nolimit')){_0x224771[_0x5d8e('0x18')]=qs[_0x5d8e('0x18')](_0x4ed6f4[_0x5d8e('0x2e')][_0x5d8e('0x18')]);_0x224771[_0x5d8e('0x17')]=qs[_0x5d8e('0x17')](_0x4ed6f4[_0x5d8e('0x2e')][_0x5d8e('0x17')]);}_0x224771[_0x5d8e('0x35')]=qs[_0x5d8e('0x36')](_0x4ed6f4[_0x5d8e('0x2e')]['sort']);_0x224771[_0x5d8e('0x37')]=qs[_0x5d8e('0x30')](_[_0x5d8e('0x38')](_0x4ed6f4['query'],_0x4806c1['filters']));_0x224771['where'][_0x5d8e('0x53')]=_0x481967['id'];if(_0x4ed6f4[_0x5d8e('0x2e')][_0x5d8e('0x39')]){_0x224771[_0x5d8e('0x37')]=_['merge'](_0x224771[_0x5d8e('0x37')],{'$or':_['map'](_0x224771['attributes'],function(_0xa1c35d){var _0x559994={};_0x559994[_0xa1c35d]={'$like':'%'+_0x4ed6f4[_0x5d8e('0x2e')]['filter']+'%'};return _0x559994;})});}_0x224771=_[_0x5d8e('0x3a')]({},_0x224771,_0x4ed6f4[_0x5d8e('0x3b')]);return db[_0x5d8e('0x5d')]['count']({'where':_0x224771[_0x5d8e('0x37')]})[_0x5d8e('0x1e')](function(_0x41fc1a){_0x7452a2['count']=_0x41fc1a;if(_0x4ed6f4[_0x5d8e('0x2e')][_0x5d8e('0x3d')]){_0x224771[_0x5d8e('0x3e')]=[{'all':!![]}];}return db['CmList'][_0x5d8e('0x54')](_0x224771);})[_0x5d8e('0x1e')](function(_0x4e56d7){_0x7452a2[_0x5d8e('0x55')]=_0x4e56d7;return _0x7452a2;});}})[_0x5d8e('0x1e')](respondWithFilteredResult(_0x1797db,_0x224771))[_0x5d8e('0x3f')](handleError(_0x1797db,null));};exports[_0x5d8e('0x7d')]=function(_0x4f283a,_0x237c6f,_0x11a30b){var _0x566685,_0x29454c;return db[_0x5d8e('0x29')][_0x5d8e('0x41')]({'where':{'id':_0x4f283a['params']['id']}})[_0x5d8e('0x1e')](handleEntityNotFound(_0x237c6f,null))[_0x5d8e('0x1e')](function(_0x2c2207){if(_0x2c2207){_0x29454c=_0x2c2207;return _0x2c2207['addBlackLists'](_0x4f283a[_0x5d8e('0x50')]['ids'],_['omit'](_0x4f283a['body'],['ids','id'])||{});}return null;})['spread'](function(_0x4e6606){var _0x11fe27;_0x566685=_0x4e6606||[];var _0x5b9193=[];if(_0x4e6606){for(var _0x1e01e3=0x0;_0x1e01e3<_0x4e6606[_0x5d8e('0x4c')];_0x1e01e3+=0x1){var _0x32d122=_0x4e6606[_0x1e01e3][_0x5d8e('0x1f')]({'plain':!![]});_0x11fe27=squel[_0x5d8e('0x63')]()[_0x5d8e('0x64')](_0x5d8e('0x7e'))[_0x5d8e('0x66')]([_0x5d8e('0x79'),'ContactId',_0x5d8e('0x69'),_0x5d8e('0x53'),_0x5d8e('0x4e'),_0x5d8e('0x4f')],squel[_0x5d8e('0x6a')]()['field']('phone',_0x5d8e('0x79'))['field']('id',_0x5d8e('0x68'))[_0x5d8e('0x6b')](_0x32d122[_0x5d8e('0x6d')][_0x5d8e('0x6e')](),'ListId')['field'](_0x4f283a[_0x5d8e('0x4a')]['id'][_0x5d8e('0x6e')](),'CampaignId')[_0x5d8e('0x6b')](_0x5d8e('0x6c'),'createdAt')[_0x5d8e('0x6b')](_0x5d8e('0x6c'),'updatedAt')[_0x5d8e('0x6f')](_0x5d8e('0x70'))[_0x5d8e('0x37')](_0x5d8e('0x71'))['where'](_0x5d8e('0x72'),_0x32d122[_0x5d8e('0x6d')]['toString']())[_0x5d8e('0x37')]('phone\x20IS\x20NOT\x20NULL'))[_0x5d8e('0x6e')]();_0x5b9193[_0x5d8e('0x7f')](db[_0x5d8e('0x80')][_0x5d8e('0x2e')](_0x11fe27));}return BPromise[_0x5d8e('0x7a')](_0x5b9193);}})['then'](function(){return _0x566685;})[_0x5d8e('0x1e')](respondWithResult(_0x237c6f,null))['catch'](handleError(_0x237c6f,null));};exports['removeBlackLists']=function(_0x36c656,_0x4ec4ee,_0x360bf5){return db[_0x5d8e('0x29')][_0x5d8e('0x41')]({'where':{'id':_0x36c656[_0x5d8e('0x4a')]['id']}})[_0x5d8e('0x1e')](handleEntityNotFound(_0x4ec4ee,null))['then'](function(_0x4fba0d){if(_0x4fba0d){return _0x4fba0d[_0x5d8e('0x81')](_0x36c656['query']['ids']);}})[_0x5d8e('0x1e')](function(_0x2a3ea3){if(_0x2a3ea3){return db[_0x5d8e('0x5b')]['destroy']({'where':{'ListId':_0x36c656[_0x5d8e('0x2e')]['ids'],'CampaignId':_0x36c656[_0x5d8e('0x4a')]['id']}})[_0x5d8e('0x1e')](function(){return _0x2a3ea3;});}})[_0x5d8e('0x1e')](respondWithStatusCode(_0x4ec4ee,null))[_0x5d8e('0x3f')](handleError(_0x4ec4ee,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 2dec69e..2ff6ff6 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 _0xda9a=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./campaign.attributes','exports','campaigns','lodash'];(function(_0x1c546c,_0x5c57cb){var _0x2cc384=function(_0x4dee11){while(--_0x4dee11){_0x1c546c['push'](_0x1c546c['shift']());}};_0x2cc384(++_0x5c57cb);}(_0xda9a,0xd7));var _0xada9=function(_0xf4237a,_0x1ac1e2){_0xf4237a=_0xf4237a-0x0;var _0x7b4c17=_0xda9a[_0xf4237a];return _0x7b4c17;};'use strict';var _=require(_0xada9('0x0'));var util=require(_0xada9('0x1'));var logger=require(_0xada9('0x2'))(_0xada9('0x3'));var moment=require(_0xada9('0x4'));var BPromise=require('bluebird');var rp=require(_0xada9('0x5'));var fs=require('fs');var path=require(_0xada9('0x6'));var rimraf=require(_0xada9('0x7'));var config=require(_0xada9('0x8'));var attributes=require(_0xada9('0x9'));module[_0xada9('0xa')]=function(_0x440a51,_0x4cadaa){return _0x440a51['define']('Campaign',attributes,{'tableName':_0xada9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb9ec=['Campaign','campaigns','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','exports','define'];(function(_0x3e6b70,_0x37bc45){var _0x1283a2=function(_0x1f0ec4){while(--_0x1f0ec4){_0x3e6b70['push'](_0x3e6b70['shift']());}};_0x1283a2(++_0x37bc45);}(_0xb9ec,0xf2));var _0xcb9e=function(_0x51b5a,_0x234bc3){_0x51b5a=_0x51b5a-0x0;var _0x10eb61=_0xb9ec[_0x51b5a];return _0x10eb61;};'use strict';var _=require(_0xcb9e('0x0'));var util=require(_0xcb9e('0x1'));var logger=require(_0xcb9e('0x2'))(_0xcb9e('0x3'));var moment=require(_0xcb9e('0x4'));var BPromise=require(_0xcb9e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xcb9e('0x6'));var config=require(_0xcb9e('0x7'));var attributes=require('./campaign.attributes');module[_0xcb9e('0x8')]=function(_0x4f21de,_0x53e947){return _0x4f21de[_0xcb9e('0x9')](_0xcb9e('0xa'),attributes,{'tableName':_0xcb9e('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 13d2430..5816ff2 100644 --- a/server/api/campaign/campaign.rpc.js +++ b/server/api/campaign/campaign.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['catch','GetCampaign','findAll','raw','options','where','attributes','limit','map','include','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x4edca0,_0xc747da){var _0x38114a=function(_0xc9d063){while(--_0xc9d063){_0x4edca0['push'](_0x4edca0['shift']());}};_0x38114a(++_0xc747da);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Campaign,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});}exports[_0x7995('0x18')]=function(_0x291317){var _0x1e1415=this;return new Promise(function(_0x37a7d4,_0x4faa60){return db['Campaign'][_0x7995('0x19')]({'raw':_0x291317['options']?_0x291317['options'][_0x7995('0x1a')]===undefined?!![]:![]:!![],'where':_0x291317[_0x7995('0x1b')]?_0x291317['options'][_0x7995('0x1c')]||null:null,'attributes':_0x291317['options']?_0x291317['options'][_0x7995('0x1d')]||null:null,'limit':_0x291317[_0x7995('0x1b')]?_0x291317[_0x7995('0x1b')][_0x7995('0x1e')]||null:null,'include':_0x291317[_0x7995('0x1b')]?_0x291317[_0x7995('0x1b')]['include']?_[_0x7995('0x1f')](_0x291317[_0x7995('0x1b')][_0x7995('0x20')],function(_0x285437){return{'model':db[_0x285437[_0x7995('0x21')]],'as':_0x285437['as'],'attributes':_0x285437[_0x7995('0x1d')],'include':_0x285437[_0x7995('0x20')]?_[_0x7995('0x1f')](_0x285437['include'],function(_0x39df42){return{'model':db[_0x39df42[_0x7995('0x21')]],'as':_0x39df42['as'],'attributes':_0x39df42[_0x7995('0x1d')],'include':_0x39df42[_0x7995('0x20')]?_[_0x7995('0x1f')](_0x39df42[_0x7995('0x20')],function(_0x56691a){return{'model':db[_0x56691a[_0x7995('0x21')]],'as':_0x56691a['as'],'attributes':_0x56691a['attributes']};}):[]};}):[]};}):[]:[]})[_0x7995('0xc')](function(_0x49bc7e){logger[_0x7995('0xd')](_0x7995('0x18'),_0x291317);logger[_0x7995('0x10')]('GetCampaign',_0x291317,JSON[_0x7995('0x12')](_0x49bc7e));_0x37a7d4(_0x49bc7e);})['catch'](function(_0x456a28){logger[_0x7995('0x13')](_0x7995('0x18'),_0x456a28['message'],_0x291317);_0x4faa60(_0x1e1415['error'](0x1f4,_0x456a28['message']));});});}; \ No newline at end of file +var _0xa9e0=['catch','Campaign','findAll','options','raw','where','attributes','include','map','model','GetCampaign','stringify','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','code','error','message','result'];(function(_0x193209,_0x5e53d9){var _0x3b0971=function(_0x5596b4){while(--_0x5596b4){_0x193209['push'](_0x193209['shift']());}};_0x3b0971(++_0x5e53d9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetCampaign']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index c9096d9..42b31a6 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 _0x93e9=['show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','/:id/lists','addLists','addBlackLists','put','delete','destroy','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./campaign.controller','get','isAuthenticated','index','/:id'];(function(_0x14b18e,_0x1ab1b4){var _0x2f7072=function(_0x538b3f){while(--_0x538b3f){_0x14b18e['push'](_0x14b18e['shift']());}};_0x2f7072(++_0x1ab1b4);}(_0x93e9,0xcc));var _0x993e=function(_0x3c0fda,_0x3f0af4){_0x3c0fda=_0x3c0fda-0x0;var _0x49a582=_0x93e9[_0x3c0fda];return _0x49a582;};'use strict';var multer=require(_0x993e('0x0'));var util=require(_0x993e('0x1'));var path=require(_0x993e('0x2'));var timeout=require(_0x993e('0x3'));var express=require(_0x993e('0x4'));var router=express[_0x993e('0x5')]();var auth=require(_0x993e('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x993e('0x7'));router[_0x993e('0x8')]('/',auth[_0x993e('0x9')](),controller[_0x993e('0xa')]);router[_0x993e('0x8')](_0x993e('0xb'),auth[_0x993e('0x9')](),controller[_0x993e('0xc')]);router['get'](_0x993e('0xd'),auth[_0x993e('0x9')](),controller[_0x993e('0xe')]);router[_0x993e('0x8')](_0x993e('0xf'),auth[_0x993e('0x9')](),controller[_0x993e('0x10')]);router['get'](_0x993e('0x11'),auth[_0x993e('0x9')](),controller['getHopperFinals']);router['get'](_0x993e('0x12'),auth['isAuthenticated'](),controller[_0x993e('0x13')]);router['get']('/:id/lists',auth[_0x993e('0x9')](),controller[_0x993e('0x14')]);router[_0x993e('0x8')](_0x993e('0x15'),auth[_0x993e('0x9')](),controller[_0x993e('0x16')]);router[_0x993e('0x17')]('/',auth[_0x993e('0x9')](),controller[_0x993e('0x18')]);router[_0x993e('0x17')](_0x993e('0x19'),auth[_0x993e('0x9')](),controller[_0x993e('0x1a')]);router[_0x993e('0x17')](_0x993e('0x1b'),auth[_0x993e('0x9')](),controller[_0x993e('0x1c')]);router['post'](_0x993e('0x15'),auth[_0x993e('0x9')](),controller[_0x993e('0x1d')]);router[_0x993e('0x1e')](_0x993e('0xb'),auth[_0x993e('0x9')](),controller['update']);router[_0x993e('0x1f')](_0x993e('0xb'),auth[_0x993e('0x9')](),controller[_0x993e('0x20')]);router[_0x993e('0x1f')](_0x993e('0x1b'),auth[_0x993e('0x9')](),controller[_0x993e('0x21')]);router['delete'](_0x993e('0x15'),auth['isAuthenticated'](),controller[_0x993e('0x22')]);module[_0x993e('0x23')]=router; \ No newline at end of file +var _0x1cbc=['/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperBlacks','/:id/lists','getLists','getBlackLists','post','/:id/clone','addBlackLists','put','/:id','update','delete','destroy','removeLists','/:id/blacklists','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index'];(function(_0x38818e,_0x126692){var _0x96c876=function(_0x293c12){while(--_0x293c12){_0x38818e['push'](_0x38818e['shift']());}};_0x96c876(++_0x126692);}(_0x1cbc,0xf4));var _0xc1cb=function(_0x337d93,_0x7908a5){_0x337d93=_0x337d93-0x0;var _0x52a98b=_0x1cbc[_0x337d93];return _0x52a98b;};'use strict';var multer=require(_0xc1cb('0x0'));var util=require('util');var path=require(_0xc1cb('0x1'));var timeout=require(_0xc1cb('0x2'));var express=require(_0xc1cb('0x3'));var router=express[_0xc1cb('0x4')]();var auth=require(_0xc1cb('0x5'));var interaction=require(_0xc1cb('0x6'));var config=require(_0xc1cb('0x7'));var controller=require(_0xc1cb('0x8'));router[_0xc1cb('0x9')]('/',auth[_0xc1cb('0xa')](),controller[_0xc1cb('0xb')]);router[_0xc1cb('0x9')]('/:id',auth[_0xc1cb('0xa')](),controller['show']);router[_0xc1cb('0x9')](_0xc1cb('0xc'),auth['isAuthenticated'](),controller[_0xc1cb('0xd')]);router[_0xc1cb('0x9')](_0xc1cb('0xe'),auth[_0xc1cb('0xa')](),controller[_0xc1cb('0xf')]);router[_0xc1cb('0x9')](_0xc1cb('0x10'),auth[_0xc1cb('0xa')](),controller['getHopperFinals']);router[_0xc1cb('0x9')]('/:id/hopper_black',auth[_0xc1cb('0xa')](),controller[_0xc1cb('0x11')]);router[_0xc1cb('0x9')](_0xc1cb('0x12'),auth[_0xc1cb('0xa')](),controller[_0xc1cb('0x13')]);router[_0xc1cb('0x9')]('/:id/blacklists',auth[_0xc1cb('0xa')](),controller[_0xc1cb('0x14')]);router[_0xc1cb('0x15')]('/',auth[_0xc1cb('0xa')](),controller['create']);router[_0xc1cb('0x15')](_0xc1cb('0x16'),auth['isAuthenticated'](),controller['clone']);router[_0xc1cb('0x15')](_0xc1cb('0x12'),auth[_0xc1cb('0xa')](),controller['addLists']);router['post']('/:id/blacklists',auth['isAuthenticated'](),controller[_0xc1cb('0x17')]);router[_0xc1cb('0x18')](_0xc1cb('0x19'),auth[_0xc1cb('0xa')](),controller[_0xc1cb('0x1a')]);router[_0xc1cb('0x1b')]('/:id',auth[_0xc1cb('0xa')](),controller[_0xc1cb('0x1c')]);router[_0xc1cb('0x1b')](_0xc1cb('0x12'),auth['isAuthenticated'](),controller[_0xc1cb('0x1d')]);router[_0xc1cb('0x1b')](_0xc1cb('0x1e'),auth['isAuthenticated'](),controller['removeBlackLists']);module[_0xc1cb('0x1f')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 6ec9b85..82f1142 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 _0x5a24=['TEXT','VIRTUAL','key','sequelize','STRING'];(function(_0x38c563,_0x4f4168){var _0x16acac=function(_0x28773e){while(--_0x28773e){_0x38c563['push'](_0x38c563['shift']());}};_0x16acac(++_0x4f4168);}(_0x5a24,0x1e3));var _0x45a2=function(_0x4f74e7,_0x3bc69b){_0x4f74e7=_0x4f74e7-0x0;var _0xf87cf0=_0x5a24[_0x4f74e7];return _0xf87cf0;};'use strict';var Sequelize=require(_0x45a2('0x0'));module['exports']={'key':{'type':Sequelize[_0x45a2('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x45a2('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x45a2('0x1')]},'name':{'type':Sequelize[_0x45a2('0x3')],'get':function(){return this['getDataValue'](_0x45a2('0x4'));}}}; \ No newline at end of file +var _0x5917=['STRING','VIRTUAL','key','exports','TEXT'];(function(_0x1a2a88,_0x2c3cc7){var _0x577d74=function(_0x467bc6){while(--_0x467bc6){_0x1a2a88['push'](_0x1a2a88['shift']());}};_0x577d74(++_0x2c3cc7);}(_0x5917,0xa3));var _0x7591=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x5917[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require('sequelize');module[_0x7591('0x0')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x7591('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x7591('0x2')]},'name':{'type':Sequelize[_0x7591('0x3')],'get':function(){return this['getDataValue'](_0x7591('0x4'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 1bc09f3..41d738f 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 _0x4290=['count','offset','limit','set','Content-Range','save','update','destroy','CannedAnswers','UserProfileResource','then','error','name','send','index','map','CannedAnswer','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','field','includeAll','include','findAll','rows','catch','show','options','find','body','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','lodash','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','status','end','json'];(function(_0xc700b5,_0x14d937){var _0x35ac84=function(_0x4f40b1){while(--_0x4f40b1){_0xc700b5['push'](_0xc700b5['shift']());}};_0x35ac84(++_0x14d937);}(_0x4290,0x180));var _0x0429=function(_0x468119,_0x422d72){_0x468119=_0x468119-0x0;var _0x54ac28=_0x4290[_0x468119];return _0x54ac28;};'use strict';var pdf=require(_0x0429('0x0'));var emlformat=require(_0x0429('0x1'));var rimraf=require(_0x0429('0x2'));var zipdir=require(_0x0429('0x3'));var jsonpatch=require(_0x0429('0x4'));var rp=require(_0x0429('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0429('0x6'));var util=require(_0x0429('0x7'));var path=require(_0x0429('0x8'));var sox=require(_0x0429('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x0429('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0429('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0429('0xc'));var Redis=require('ioredis');var authService=require(_0x0429('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x0429('0xe'));var hardwareService=require(_0x0429('0xf'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x0429('0x10'));var db=require(_0x0429('0x11'))['db'];function respondWithStatusCode(_0x21ecdc,_0x419e6e){_0x419e6e=_0x419e6e||0xcc;return function(_0x2ead94){if(_0x2ead94){return _0x21ecdc['sendStatus'](_0x419e6e);}return _0x21ecdc[_0x0429('0x12')](_0x419e6e)[_0x0429('0x13')]();};}function respondWithResult(_0x2d7278,_0x3fd50d){_0x3fd50d=_0x3fd50d||0xc8;return function(_0x2913af){if(_0x2913af){return _0x2d7278[_0x0429('0x12')](_0x3fd50d)[_0x0429('0x14')](_0x2913af);}};}function respondWithFilteredResult(_0x1558ac,_0x1d97f4){return function(_0x4e8f7e){if(_0x4e8f7e){var _0x41dee6=_0x4e8f7e[_0x0429('0x15')],_0x4afb02=_0x1d97f4['offset'],_0x3ea88f=_0x1d97f4[_0x0429('0x16')]+_0x1d97f4[_0x0429('0x17')],_0x5179f8;if(_0x3ea88f>=_0x41dee6){_0x3ea88f=_0x41dee6;_0x5179f8=0xc8;}else{_0x5179f8=0xce;}_0x1558ac[_0x0429('0x12')](_0x5179f8);return _0x1558ac[_0x0429('0x18')](_0x0429('0x19'),_0x4afb02+'-'+_0x3ea88f+'/'+_0x41dee6)[_0x0429('0x14')](_0x4e8f7e);}return null;};}function patchUpdates(_0x4000fb){return function(_0x289536){try{jsonpatch['apply'](_0x289536,_0x4000fb,!![]);}catch(_0x5abba9){return BPromise['reject'](_0x5abba9);}return _0x289536[_0x0429('0x1a')]();};}function saveUpdates(_0x31d7e4,_0x9ad52){return function(_0x5e474e){if(_0x5e474e){return _0x5e474e[_0x0429('0x1b')](_0x31d7e4)['then'](function(_0x221566){return _0x221566;});}return null;};}function removeEntity(_0x542db3,_0x33c884){return function(_0x3459a4){if(_0x3459a4){return _0x3459a4[_0x0429('0x1c')]()['then'](function(){var _0x4c7b26=_0x3459a4['get']({'plain':!![]});var _0x3b3378=_0x0429('0x1d');return db[_0x0429('0x1e')][_0x0429('0x1c')]({'where':{'type':_0x3b3378,'resourceId':_0x4c7b26['id']}})[_0x0429('0x1f')](function(){return _0x3459a4;});})[_0x0429('0x1f')](function(){_0x542db3['status'](0xcc)[_0x0429('0x13')]();});}};}function handleEntityNotFound(_0x3c6ccd,_0x20632d){return function(_0xf112a2){if(!_0xf112a2){_0x3c6ccd['sendStatus'](0x194);}return _0xf112a2;};}function handleError(_0x2babd4,_0x21bf17){_0x21bf17=_0x21bf17||0x1f4;return function(_0x274a29){logger[_0x0429('0x20')](_0x274a29['stack']);if(_0x274a29[_0x0429('0x21')]){delete _0x274a29['name'];}_0x2babd4[_0x0429('0x12')](_0x21bf17)[_0x0429('0x22')](_0x274a29);};}exports[_0x0429('0x23')]=function(_0x1f7079,_0x1293e8){var _0x31bc4a={},_0x5e5d6e={},_0x4c7c6b={'count':0x0,'rows':[]};var _0x1a685f=_[_0x0429('0x24')](db[_0x0429('0x25')]['rawAttributes'],function(_0x385f93){return{'name':_0x385f93[_0x0429('0x26')],'type':_0x385f93['type'][_0x0429('0x27')]};});_0x5e5d6e[_0x0429('0x28')]=_[_0x0429('0x24')](_0x1a685f,_0x0429('0x21'));_0x5e5d6e[_0x0429('0x29')]=_[_0x0429('0x2a')](_0x1f7079[_0x0429('0x29')]);_0x5e5d6e[_0x0429('0x2b')]=_[_0x0429('0x2c')](_0x5e5d6e['model'],_0x5e5d6e[_0x0429('0x29')]);_0x31bc4a['attributes']=_[_0x0429('0x2c')](_0x5e5d6e[_0x0429('0x28')],qs[_0x0429('0x2d')](_0x1f7079['query'][_0x0429('0x2d')]));_0x31bc4a[_0x0429('0x2e')]=_0x31bc4a[_0x0429('0x2e')][_0x0429('0x2f')]?_0x31bc4a[_0x0429('0x2e')]:_0x5e5d6e[_0x0429('0x28')];if(!_0x1f7079[_0x0429('0x29')][_0x0429('0x30')](_0x0429('0x31'))){_0x31bc4a[_0x0429('0x17')]=qs[_0x0429('0x17')](_0x1f7079[_0x0429('0x29')][_0x0429('0x17')]);_0x31bc4a[_0x0429('0x16')]=qs[_0x0429('0x16')](_0x1f7079['query'][_0x0429('0x16')]);}_0x31bc4a['order']=qs[_0x0429('0x32')](_0x1f7079[_0x0429('0x29')]['sort']);_0x31bc4a['where']=qs[_0x0429('0x2b')](_[_0x0429('0x33')](_0x1f7079[_0x0429('0x29')],_0x5e5d6e[_0x0429('0x2b')]));if(_0x1f7079[_0x0429('0x29')][_0x0429('0x34')]){_0x31bc4a[_0x0429('0x35')]=_[_0x0429('0x36')](_0x31bc4a[_0x0429('0x35')],{'$or':_[_0x0429('0x24')](_0x1a685f,function(_0x1cb253){if(_0x1cb253['type']['key']!=='VIRTUAL'){var _0x167404={};_0x167404[_0x1cb253[_0x0429('0x37')]]={'$like':'%'+_0x1f7079[_0x0429('0x29')]['filter']+'%'};return _0x167404;}})});}_0x31bc4a=_[_0x0429('0x36')]({},_0x31bc4a,_0x1f7079['options']);var _0x22fcd6={'where':_0x31bc4a[_0x0429('0x35')]};return db[_0x0429('0x25')][_0x0429('0x15')](_0x22fcd6)[_0x0429('0x1f')](function(_0xaf9db1){_0x4c7c6b['count']=_0xaf9db1;if(_0x1f7079[_0x0429('0x29')][_0x0429('0x38')]){_0x31bc4a[_0x0429('0x39')]=[{'all':!![]}];}return db[_0x0429('0x25')][_0x0429('0x3a')](_0x31bc4a);})[_0x0429('0x1f')](function(_0x201e4f){_0x4c7c6b[_0x0429('0x3b')]=_0x201e4f;return _0x4c7c6b;})[_0x0429('0x1f')](respondWithFilteredResult(_0x1293e8,_0x31bc4a))[_0x0429('0x3c')](handleError(_0x1293e8,null));};exports[_0x0429('0x3d')]=function(_0x19e357,_0x36fd77){var _0x292778={'raw':!![],'where':{'id':_0x19e357['params']['id']}},_0x38a4e8={};_0x38a4e8[_0x0429('0x28')]=_[_0x0429('0x2a')](db['CannedAnswer']['rawAttributes']);_0x38a4e8[_0x0429('0x29')]=_[_0x0429('0x2a')](_0x19e357[_0x0429('0x29')]);_0x38a4e8[_0x0429('0x2b')]=_[_0x0429('0x2c')](_0x38a4e8['model'],_0x38a4e8[_0x0429('0x29')]);_0x292778[_0x0429('0x2e')]=_[_0x0429('0x2c')](_0x38a4e8[_0x0429('0x28')],qs[_0x0429('0x2d')](_0x19e357[_0x0429('0x29')][_0x0429('0x2d')]));_0x292778[_0x0429('0x2e')]=_0x292778['attributes'][_0x0429('0x2f')]?_0x292778[_0x0429('0x2e')]:_0x38a4e8[_0x0429('0x28')];if(_0x19e357[_0x0429('0x29')][_0x0429('0x38')]){_0x292778[_0x0429('0x39')]=[{'all':!![]}];}_0x292778=_['merge']({},_0x292778,_0x19e357[_0x0429('0x3e')]);return db[_0x0429('0x25')][_0x0429('0x3f')](_0x292778)['then'](handleEntityNotFound(_0x36fd77,null))[_0x0429('0x1f')](respondWithResult(_0x36fd77,null))[_0x0429('0x3c')](handleError(_0x36fd77,null));};exports[_0x0429('0x1b')]=function(_0x46ef52,_0x424836){if(_0x46ef52[_0x0429('0x40')]['id']){delete _0x46ef52[_0x0429('0x40')]['id'];}return db['CannedAnswer'][_0x0429('0x3f')]({'where':{'id':_0x46ef52[_0x0429('0x41')]['id']}})['then'](handleEntityNotFound(_0x424836,null))[_0x0429('0x1f')](saveUpdates(_0x46ef52[_0x0429('0x40')],null))[_0x0429('0x1f')](respondWithResult(_0x424836,null))[_0x0429('0x3c')](handleError(_0x424836,null));};exports[_0x0429('0x1c')]=function(_0x4b3e99,_0x112a8b){return db[_0x0429('0x25')][_0x0429('0x3f')]({'where':{'id':_0x4b3e99[_0x0429('0x41')]['id']}})[_0x0429('0x1f')](handleEntityNotFound(_0x112a8b,null))[_0x0429('0x1f')](removeEntity(_0x112a8b,null))['catch'](handleError(_0x112a8b,null));};exports[_0x0429('0x42')]=function(_0x4bf7dd,_0x31efb6){var _0x2dbbea={'key':_0x4bf7dd[_0x0429('0x40')][_0x0429('0x27')]};if(_0x4bf7dd[_0x0429('0x40')]['MailAccountId']){_0x2dbbea[_0x0429('0x43')]=_0x4bf7dd[_0x0429('0x40')]['MailAccountId'];}else if(_0x4bf7dd[_0x0429('0x40')][_0x0429('0x44')]){_0x2dbbea[_0x0429('0x44')]=_0x4bf7dd['body'][_0x0429('0x44')];}else if(_0x4bf7dd[_0x0429('0x40')][_0x0429('0x45')]){_0x2dbbea[_0x0429('0x45')]=_0x4bf7dd[_0x0429('0x40')][_0x0429('0x45')];}else if(_0x4bf7dd[_0x0429('0x40')][_0x0429('0x46')]){_0x2dbbea[_0x0429('0x46')]=_0x4bf7dd['body'][_0x0429('0x46')];}return db[_0x0429('0x25')]['find']({'where':_0x2dbbea})[_0x0429('0x1f')](function(_0x45f84c){if(_0x45f84c){throw new db[(_0x0429('0x47'))][(_0x0429('0x48'))](_0x0429('0x49'));}return db[_0x0429('0x25')]['create'](_0x4bf7dd[_0x0429('0x40')]);})[_0x0429('0x1f')](function(_0x5c23e6){var _0x1daf9d=_0x4bf7dd[_0x0429('0x4a')][_0x0429('0x4b')]({'plain':!![]});if(!_0x1daf9d)throw new Error(_0x0429('0x4c'));if(_0x1daf9d[_0x0429('0x4d')]===_0x0429('0x4a')){var _0x52f53d=_0x5c23e6[_0x0429('0x4b')]({'plain':!![]});return db[_0x0429('0x4e')][_0x0429('0x3f')]({'where':{'name':'CannedAnswers','userProfileId':_0x1daf9d[_0x0429('0x4f')]},'raw':!![]})[_0x0429('0x1f')](function(_0x28ee45){if(_0x28ee45&&_0x28ee45['autoAssociation']===0x0){return db[_0x0429('0x1e')][_0x0429('0x42')]({'name':_0x52f53d['name'],'resourceId':_0x52f53d['id'],'type':_0x28ee45['name'],'sectionId':_0x28ee45['id']},{})['then'](function(){return _0x5c23e6;});}else{return _0x5c23e6;}})[_0x0429('0x3c')](function(_0x23def4){logger[_0x0429('0x20')](_0x0429('0x50'),_0x23def4);throw _0x23def4;});}return _0x5c23e6;})[_0x0429('0x1f')](respondWithResult(_0x31efb6,0xc9))[_0x0429('0x3c')](handleError(_0x31efb6,null));}; \ No newline at end of file +var _0x41f5=['The\x20inserted\x20key\x20already\x20exists.','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','autoAssociation','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','status','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','get','CannedAnswers','UserProfileResource','sendStatus','error','name','send','index','map','CannedAnswer','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','field','options','includeAll','include','findAll','rows','show','params','find','catch','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize'];(function(_0x395432,_0x1349cb){var _0x4d3c6e=function(_0x4bf76c){while(--_0x4bf76c){_0x395432['push'](_0x395432['shift']());}};_0x4d3c6e(++_0x1349cb);}(_0x41f5,0x117));var _0x541f=function(_0x4f7e37,_0x291c9f){_0x4f7e37=_0x4f7e37-0x0;var _0x442ea8=_0x41f5[_0x4f7e37];return _0x442ea8;};'use strict';var pdf=require(_0x541f('0x0'));var emlformat=require(_0x541f('0x1'));var rimraf=require(_0x541f('0x2'));var zipdir=require(_0x541f('0x3'));var jsonpatch=require(_0x541f('0x4'));var rp=require(_0x541f('0x5'));var moment=require(_0x541f('0x6'));var BPromise=require(_0x541f('0x7'));var Mustache=require(_0x541f('0x8'));var util=require(_0x541f('0x9'));var path=require(_0x541f('0xa'));var sox=require(_0x541f('0xb'));var csv=require('to-csv');var ejs=require(_0x541f('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x541f('0xd'));var crypto=require(_0x541f('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x541f('0xf'));var querystring=require(_0x541f('0x10'));var Papa=require(_0x541f('0x11'));var Redis=require(_0x541f('0x12'));var authService=require(_0x541f('0x13'));var qs=require(_0x541f('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x541f('0x15'))('api');var utils=require(_0x541f('0x16'));var config=require(_0x541f('0x17'));var db=require(_0x541f('0x18'))['db'];function respondWithStatusCode(_0xbc6a82,_0xa617da){_0xa617da=_0xa617da||0xcc;return function(_0x50d831){if(_0x50d831){return _0xbc6a82['sendStatus'](_0xa617da);}return _0xbc6a82['status'](_0xa617da)[_0x541f('0x19')]();};}function respondWithResult(_0x20fe4b,_0x3328ad){_0x3328ad=_0x3328ad||0xc8;return function(_0x450ed9){if(_0x450ed9){return _0x20fe4b[_0x541f('0x1a')](_0x3328ad)[_0x541f('0x1b')](_0x450ed9);}};}function respondWithFilteredResult(_0x343284,_0x3b5ec9){return function(_0x112a01){if(_0x112a01){var _0x4b95b0=_0x112a01[_0x541f('0x1c')],_0x4f510b=_0x3b5ec9['offset'],_0x11f3d2=_0x3b5ec9[_0x541f('0x1d')]+_0x3b5ec9[_0x541f('0x1e')],_0x11836e;if(_0x11f3d2>=_0x4b95b0){_0x11f3d2=_0x4b95b0;_0x11836e=0xc8;}else{_0x11836e=0xce;}_0x343284['status'](_0x11836e);return _0x343284[_0x541f('0x1f')](_0x541f('0x20'),_0x4f510b+'-'+_0x11f3d2+'/'+_0x4b95b0)[_0x541f('0x1b')](_0x112a01);}return null;};}function patchUpdates(_0x2603a8){return function(_0x4b3666){try{jsonpatch[_0x541f('0x21')](_0x4b3666,_0x2603a8,!![]);}catch(_0x107b8c){return BPromise[_0x541f('0x22')](_0x107b8c);}return _0x4b3666['save']();};}function saveUpdates(_0x5f45b3,_0x25e94f){return function(_0x594de5){if(_0x594de5){return _0x594de5[_0x541f('0x23')](_0x5f45b3)[_0x541f('0x24')](function(_0x27a565){return _0x27a565;});}return null;};}function removeEntity(_0x544616,_0x4cf4f5){return function(_0x357032){if(_0x357032){return _0x357032[_0x541f('0x25')]()[_0x541f('0x24')](function(){var _0x5688fa=_0x357032[_0x541f('0x26')]({'plain':!![]});var _0x5b95c6=_0x541f('0x27');return db[_0x541f('0x28')][_0x541f('0x25')]({'where':{'type':_0x5b95c6,'resourceId':_0x5688fa['id']}})[_0x541f('0x24')](function(){return _0x357032;});})[_0x541f('0x24')](function(){_0x544616['status'](0xcc)[_0x541f('0x19')]();});}};}function handleEntityNotFound(_0x214118,_0x43670f){return function(_0x2496cc){if(!_0x2496cc){_0x214118[_0x541f('0x29')](0x194);}return _0x2496cc;};}function handleError(_0x2ea67e,_0x2edd5a){_0x2edd5a=_0x2edd5a||0x1f4;return function(_0x181215){logger[_0x541f('0x2a')](_0x181215['stack']);if(_0x181215[_0x541f('0x2b')]){delete _0x181215['name'];}_0x2ea67e[_0x541f('0x1a')](_0x2edd5a)[_0x541f('0x2c')](_0x181215);};}exports[_0x541f('0x2d')]=function(_0x17e7e4,_0x1b2042){var _0x24582a={},_0x3233be={},_0x5923ce={'count':0x0,'rows':[]};var _0x2df4fe=_[_0x541f('0x2e')](db[_0x541f('0x2f')][_0x541f('0x30')],function(_0x4bc17e){return{'name':_0x4bc17e[_0x541f('0x31')],'type':_0x4bc17e[_0x541f('0x32')][_0x541f('0x33')]};});_0x3233be[_0x541f('0x34')]=_[_0x541f('0x2e')](_0x2df4fe,_0x541f('0x2b'));_0x3233be['query']=_[_0x541f('0x35')](_0x17e7e4[_0x541f('0x36')]);_0x3233be[_0x541f('0x37')]=_[_0x541f('0x38')](_0x3233be[_0x541f('0x34')],_0x3233be[_0x541f('0x36')]);_0x24582a[_0x541f('0x39')]=_[_0x541f('0x38')](_0x3233be[_0x541f('0x34')],qs['fields'](_0x17e7e4['query'][_0x541f('0x3a')]));_0x24582a[_0x541f('0x39')]=_0x24582a[_0x541f('0x39')][_0x541f('0x3b')]?_0x24582a[_0x541f('0x39')]:_0x3233be[_0x541f('0x34')];if(!_0x17e7e4[_0x541f('0x36')][_0x541f('0x3c')](_0x541f('0x3d'))){_0x24582a[_0x541f('0x1e')]=qs['limit'](_0x17e7e4['query'][_0x541f('0x1e')]);_0x24582a[_0x541f('0x1d')]=qs['offset'](_0x17e7e4[_0x541f('0x36')][_0x541f('0x1d')]);}_0x24582a[_0x541f('0x3e')]=qs[_0x541f('0x3f')](_0x17e7e4['query'][_0x541f('0x3f')]);_0x24582a['where']=qs[_0x541f('0x37')](_[_0x541f('0x40')](_0x17e7e4['query'],_0x3233be[_0x541f('0x37')]));if(_0x17e7e4[_0x541f('0x36')][_0x541f('0x41')]){_0x24582a[_0x541f('0x42')]=_[_0x541f('0x43')](_0x24582a[_0x541f('0x42')],{'$or':_['map'](_0x2df4fe,function(_0x39d424){if(_0x39d424[_0x541f('0x32')][_0x541f('0x33')]!==_0x541f('0x44')){var _0xb356e4={};_0xb356e4[_0x39d424[_0x541f('0x45')]]={'$like':'%'+_0x17e7e4[_0x541f('0x36')][_0x541f('0x41')]+'%'};return _0xb356e4;}})});}_0x24582a=_[_0x541f('0x43')]({},_0x24582a,_0x17e7e4[_0x541f('0x46')]);var _0x2d2bdc={'where':_0x24582a['where']};return db['CannedAnswer']['count'](_0x2d2bdc)['then'](function(_0x19ecac){_0x5923ce[_0x541f('0x1c')]=_0x19ecac;if(_0x17e7e4[_0x541f('0x36')][_0x541f('0x47')]){_0x24582a[_0x541f('0x48')]=[{'all':!![]}];}return db['CannedAnswer'][_0x541f('0x49')](_0x24582a);})[_0x541f('0x24')](function(_0x5210e6){_0x5923ce[_0x541f('0x4a')]=_0x5210e6;return _0x5923ce;})[_0x541f('0x24')](respondWithFilteredResult(_0x1b2042,_0x24582a))['catch'](handleError(_0x1b2042,null));};exports[_0x541f('0x4b')]=function(_0x5e01ac,_0x1dc0ed){var _0x1a2847={'raw':!![],'where':{'id':_0x5e01ac[_0x541f('0x4c')]['id']}},_0x1c2107={};_0x1c2107[_0x541f('0x34')]=_[_0x541f('0x35')](db[_0x541f('0x2f')]['rawAttributes']);_0x1c2107[_0x541f('0x36')]=_[_0x541f('0x35')](_0x5e01ac[_0x541f('0x36')]);_0x1c2107[_0x541f('0x37')]=_[_0x541f('0x38')](_0x1c2107[_0x541f('0x34')],_0x1c2107[_0x541f('0x36')]);_0x1a2847['attributes']=_['intersection'](_0x1c2107[_0x541f('0x34')],qs[_0x541f('0x3a')](_0x5e01ac['query'][_0x541f('0x3a')]));_0x1a2847[_0x541f('0x39')]=_0x1a2847[_0x541f('0x39')][_0x541f('0x3b')]?_0x1a2847[_0x541f('0x39')]:_0x1c2107[_0x541f('0x34')];if(_0x5e01ac[_0x541f('0x36')][_0x541f('0x47')]){_0x1a2847[_0x541f('0x48')]=[{'all':!![]}];}_0x1a2847=_[_0x541f('0x43')]({},_0x1a2847,_0x5e01ac[_0x541f('0x46')]);return db['CannedAnswer'][_0x541f('0x4d')](_0x1a2847)[_0x541f('0x24')](handleEntityNotFound(_0x1dc0ed,null))[_0x541f('0x24')](respondWithResult(_0x1dc0ed,null))[_0x541f('0x4e')](handleError(_0x1dc0ed,null));};exports['update']=function(_0x57c75c,_0x275559){if(_0x57c75c['body']['id']){delete _0x57c75c[_0x541f('0x4f')]['id'];}return db[_0x541f('0x2f')][_0x541f('0x4d')]({'where':{'id':_0x57c75c[_0x541f('0x4c')]['id']}})[_0x541f('0x24')](handleEntityNotFound(_0x275559,null))[_0x541f('0x24')](saveUpdates(_0x57c75c[_0x541f('0x4f')],null))[_0x541f('0x24')](respondWithResult(_0x275559,null))[_0x541f('0x4e')](handleError(_0x275559,null));};exports[_0x541f('0x25')]=function(_0x5df412,_0x49e7e8){return db[_0x541f('0x2f')][_0x541f('0x4d')]({'where':{'id':_0x5df412[_0x541f('0x4c')]['id']}})[_0x541f('0x24')](handleEntityNotFound(_0x49e7e8,null))[_0x541f('0x24')](removeEntity(_0x49e7e8,null))[_0x541f('0x4e')](handleError(_0x49e7e8,null));};exports['create']=function(_0x4dcddb,_0x10d2f7){var _0x3245c3={'key':_0x4dcddb[_0x541f('0x4f')][_0x541f('0x33')]};if(_0x4dcddb[_0x541f('0x4f')]['MailAccountId']){_0x3245c3[_0x541f('0x50')]=_0x4dcddb[_0x541f('0x4f')][_0x541f('0x50')];}else if(_0x4dcddb[_0x541f('0x4f')][_0x541f('0x51')]){_0x3245c3[_0x541f('0x51')]=_0x4dcddb['body']['SmsAccountId'];}else if(_0x4dcddb[_0x541f('0x4f')][_0x541f('0x52')]){_0x3245c3[_0x541f('0x52')]=_0x4dcddb[_0x541f('0x4f')][_0x541f('0x52')];}else if(_0x4dcddb[_0x541f('0x4f')][_0x541f('0x53')]){_0x3245c3[_0x541f('0x53')]=_0x4dcddb[_0x541f('0x4f')][_0x541f('0x53')];}return db[_0x541f('0x2f')]['find']({'where':_0x3245c3})[_0x541f('0x24')](function(_0xae46c7){if(_0xae46c7){throw new db[(_0x541f('0x54'))]['ValidationError'](_0x541f('0x55'));}return db[_0x541f('0x2f')][_0x541f('0x56')](_0x4dcddb[_0x541f('0x4f')]);})[_0x541f('0x24')](function(_0x4a396d){var _0x499d8f=_0x4dcddb['user'][_0x541f('0x26')]({'plain':!![]});if(!_0x499d8f)throw new Error(_0x541f('0x57'));if(_0x499d8f['role']===_0x541f('0x58')){var _0x47b46a=_0x4a396d[_0x541f('0x26')]({'plain':!![]});return db['UserProfileSection'][_0x541f('0x4d')]({'where':{'name':_0x541f('0x27'),'userProfileId':_0x499d8f[_0x541f('0x59')]},'raw':!![]})['then'](function(_0x3687d9){if(_0x3687d9&&_0x3687d9[_0x541f('0x5a')]===0x0){return db[_0x541f('0x28')]['create']({'name':_0x47b46a[_0x541f('0x2b')],'resourceId':_0x47b46a['id'],'type':_0x3687d9[_0x541f('0x2b')],'sectionId':_0x3687d9['id']},{})[_0x541f('0x24')](function(){return _0x4a396d;});}else{return _0x4a396d;}})[_0x541f('0x4e')](function(_0x549c9a){logger[_0x541f('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x549c9a);throw _0x549c9a;});}return _0x4a396d;})[_0x541f('0x24')](respondWithResult(_0x10d2f7,0xc9))[_0x541f('0x4e')](handleError(_0x10d2f7,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 998fb1c..f44fafb 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 _0x28e1=['path','../../config/environment','./cannedAnswer.attributes','exports','define','tools_canned_answers','lodash','../../config/logger','api','moment','request-promise'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x28e1,0x1d4));var _0x128e=function(_0x5b622f,_0x4ac5cd){_0x5b622f=_0x5b622f-0x0;var _0x50f1f5=_0x28e1[_0x5b622f];return _0x50f1f5;};'use strict';var _=require(_0x128e('0x0'));var util=require('util');var logger=require(_0x128e('0x1'))(_0x128e('0x2'));var moment=require(_0x128e('0x3'));var BPromise=require('bluebird');var rp=require(_0x128e('0x4'));var fs=require('fs');var path=require(_0x128e('0x5'));var rimraf=require('rimraf');var config=require(_0x128e('0x6'));var attributes=require(_0x128e('0x7'));module[_0x128e('0x8')]=function(_0x2a7687,_0x5277e9){return _0x2a7687[_0x128e('0x9')]('CannedAnswer',attributes,{'tableName':_0x128e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xb43e=['path','rimraf','../../config/environment','exports','define','CannedAnswer','utf8mb4_unicode_ci','lodash','../../config/logger','moment'];(function(_0x27bd2c,_0x24bd98){var _0x3784ea=function(_0x4ca802){while(--_0x4ca802){_0x27bd2c['push'](_0x27bd2c['shift']());}};_0x3784ea(++_0x24bd98);}(_0xb43e,0x183));var _0xeb43=function(_0x3dbe1d,_0x14e971){_0x3dbe1d=_0x3dbe1d-0x0;var _0x88ca95=_0xb43e[_0x3dbe1d];return _0x88ca95;};'use strict';var _=require(_0xeb43('0x0'));var util=require('util');var logger=require(_0xeb43('0x1'))('api');var moment=require(_0xeb43('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xeb43('0x3'));var rimraf=require(_0xeb43('0x4'));var config=require(_0xeb43('0x5'));var attributes=require('./cannedAnswer.attributes');module[_0xeb43('0x6')]=function(_0x450cc4,_0x224311){return _0x450cc4[_0xeb43('0x7')](_0xeb43('0x8'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xeb43('0x9')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 7d7c821..35c5115 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 _0x3270=['request','then','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x30fa1e,_0x1761e8){var _0x357956=function(_0x29d379){while(--_0x29d379){_0x30fa1e['push'](_0x30fa1e['shift']());}};_0x357956(++_0x1761e8);}(_0x3270,0x120));var _0x0327=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0x3270[_0x29d94e];return _0x106237;};'use strict';var _=require(_0x0327('0x0'));var util=require(_0x0327('0x1'));var moment=require(_0x0327('0x2'));var BPromise=require(_0x0327('0x3'));var rs=require(_0x0327('0x4'));var fs=require('fs');var Redis=require(_0x0327('0x5'));var db=require(_0x0327('0x6'))['db'];var utils=require(_0x0327('0x7'));var logger=require('../../config/logger')(_0x0327('0x8'));var config=require(_0x0327('0x9'));var jayson=require(_0x0327('0xa'));var client=jayson[_0x0327('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x17d640,_0x183e86,_0xd6c91){return new BPromise(function(_0x47a254,_0x59186e){return client[_0x0327('0xc')](_0x17d640,_0xd6c91)[_0x0327('0xd')](function(_0x55ee7b){logger[_0x0327('0xe')](_0x0327('0xf'),_0x183e86,_0x0327('0x10'));logger[_0x0327('0x11')](_0x0327('0x12'),_0x183e86,_0x0327('0x10'),JSON[_0x0327('0x13')](_0x55ee7b));if(_0x55ee7b[_0x0327('0x14')]){if(_0x55ee7b['error'][_0x0327('0x15')]===0x1f4){logger['error']('CannedAnswer,\x20%s,\x20%s',_0x183e86,_0x55ee7b[_0x0327('0x14')][_0x0327('0x16')]);return _0x59186e(_0x55ee7b[_0x0327('0x14')][_0x0327('0x16')]);}logger[_0x0327('0x14')](_0x0327('0xf'),_0x183e86,_0x55ee7b[_0x0327('0x14')][_0x0327('0x16')]);return _0x47a254(_0x55ee7b[_0x0327('0x14')][_0x0327('0x16')]);}else{logger[_0x0327('0xe')](_0x0327('0xf'),_0x183e86,_0x0327('0x10'));_0x47a254(_0x55ee7b[_0x0327('0x17')]['message']);}})[_0x0327('0x18')](function(_0x325244){logger['error'](_0x0327('0xf'),_0x183e86,_0x325244);_0x59186e(_0x325244);});});} \ No newline at end of file +var _0x221a=['CannedAnswer,\x20%s,\x20%s,\x20%s','stringify','error','code','CannedAnswer,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x221a,0x13e));var _0xa221=function(_0x311bdd,_0x66de32){_0x311bdd=_0x311bdd-0x0;var _0x1c32ed=_0x221a[_0x311bdd];return _0x1c32ed;};'use strict';var _=require(_0xa221('0x0'));var util=require(_0xa221('0x1'));var moment=require(_0xa221('0x2'));var BPromise=require(_0xa221('0x3'));var rs=require(_0xa221('0x4'));var fs=require('fs');var Redis=require(_0xa221('0x5'));var db=require(_0xa221('0x6'))['db'];var utils=require(_0xa221('0x7'));var logger=require(_0xa221('0x8'))(_0xa221('0x9'));var config=require('../../config/environment');var jayson=require(_0xa221('0xa'));var client=jayson[_0xa221('0xb')][_0xa221('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2ea0dd,_0x4bd325,_0x1bdbcf){return new BPromise(function(_0xf77d24,_0x34190c){return client[_0xa221('0xd')](_0x2ea0dd,_0x1bdbcf)[_0xa221('0xe')](function(_0x2de92f){logger[_0xa221('0xf')]('CannedAnswer,\x20%s,\x20%s',_0x4bd325,_0xa221('0x10'));logger[_0xa221('0x11')](_0xa221('0x12'),_0x4bd325,_0xa221('0x10'),JSON[_0xa221('0x13')](_0x2de92f));if(_0x2de92f[_0xa221('0x14')]){if(_0x2de92f[_0xa221('0x14')][_0xa221('0x15')]===0x1f4){logger[_0xa221('0x14')](_0xa221('0x16'),_0x4bd325,_0x2de92f[_0xa221('0x14')][_0xa221('0x17')]);return _0x34190c(_0x2de92f[_0xa221('0x14')][_0xa221('0x17')]);}logger[_0xa221('0x14')]('CannedAnswer,\x20%s,\x20%s',_0x4bd325,_0x2de92f[_0xa221('0x14')][_0xa221('0x17')]);return _0xf77d24(_0x2de92f[_0xa221('0x14')][_0xa221('0x17')]);}else{logger['info'](_0xa221('0x16'),_0x4bd325,_0xa221('0x10'));_0xf77d24(_0x2de92f['result'][_0xa221('0x17')]);}})['catch'](function(_0x494b7a){logger[_0xa221('0x14')](_0xa221('0x16'),_0x4bd325,_0x494b7a);_0x34190c(_0x494b7a);});});} \ No newline at end of file diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js index fbd2b40..b65a1c3 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 _0x758f=['/:id','isAuthenticated','show','post','put','update','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','index'];(function(_0x2cf54d,_0x471789){var _0x259fb4=function(_0x3db826){while(--_0x3db826){_0x2cf54d['push'](_0x2cf54d['shift']());}};_0x259fb4(++_0x471789);}(_0x758f,0x183));var _0xf758=function(_0x5d7b48,_0x1c8eaa){_0x5d7b48=_0x5d7b48-0x0;var _0x31bd82=_0x758f[_0x5d7b48];return _0x31bd82;};'use strict';var multer=require(_0xf758('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf758('0x1'));var express=require(_0xf758('0x2'));var router=express[_0xf758('0x3')]();var auth=require(_0xf758('0x4'));var interaction=require(_0xf758('0x5'));var config=require(_0xf758('0x6'));var controller=require(_0xf758('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xf758('0x8')]);router['get'](_0xf758('0x9'),auth[_0xf758('0xa')](),controller[_0xf758('0xb')]);router[_0xf758('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0xf758('0xd')](_0xf758('0x9'),auth[_0xf758('0xa')](),controller[_0xf758('0xe')]);router[_0xf758('0xf')](_0xf758('0x9'),auth[_0xf758('0xa')](),controller[_0xf758('0x10')]);module[_0xf758('0x11')]=router; \ No newline at end of file +var _0x6ea4=['delete','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','/:id','isAuthenticated','post','update'];(function(_0x109fe4,_0x286340){var _0x50cc95=function(_0x27842c){while(--_0x27842c){_0x109fe4['push'](_0x109fe4['shift']());}};_0x50cc95(++_0x286340);}(_0x6ea4,0xd3));var _0x46ea=function(_0x4fae19,_0x257a9f){_0x4fae19=_0x4fae19-0x0;var _0xc76eeb=_0x6ea4[_0x4fae19];return _0xc76eeb;};'use strict';var multer=require(_0x46ea('0x0'));var util=require(_0x46ea('0x1'));var path=require(_0x46ea('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x46ea('0x3')]();var auth=require(_0x46ea('0x4'));var interaction=require(_0x46ea('0x5'));var config=require(_0x46ea('0x6'));var controller=require(_0x46ea('0x7'));router[_0x46ea('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x46ea('0x8')](_0x46ea('0x9'),auth[_0x46ea('0xa')](),controller['show']);router[_0x46ea('0xb')]('/',auth[_0x46ea('0xa')](),controller['create']);router['put'](_0x46ea('0x9'),auth[_0x46ea('0xa')](),controller[_0x46ea('0xc')]);router[_0x46ea('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x46ea('0xe')]);module[_0x46ea('0xf')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 78a3fe6..56ea06d 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 _0x35d8=['INTEGER','sequelize','exports','DATE','1970-01-01\x2000:00:01','STRING'];(function(_0x59981b,_0xa439cf){var _0x239b53=function(_0x5c70cd){while(--_0x5c70cd){_0x59981b['push'](_0x59981b['shift']());}};_0x239b53(++_0xa439cf);}(_0x35d8,0xf7));var _0x835d=function(_0x9d505f,_0x5e5b90){_0x9d505f=_0x9d505f-0x0;var _0x3c0ec9=_0x35d8[_0x9d505f];return _0x3c0ec9;};'use strict';var Sequelize=require(_0x835d('0x0'));module[_0x835d('0x1')]={'calldate':{'type':Sequelize[_0x835d('0x2')],'allowNull':![],'defaultValue':_0x835d('0x3')},'clid':{'type':Sequelize[_0x835d('0x4')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x835d('0x4')]},'dcontext':{'type':Sequelize[_0x835d('0x4')]},'channel':{'type':Sequelize[_0x835d('0x4')]},'dstchannel':{'type':Sequelize[_0x835d('0x4')]},'lastapp':{'type':Sequelize[_0x835d('0x4')]},'lastdata':{'type':Sequelize[_0x835d('0x4')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x835d('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x835d('0x4')]},'linkedid':{'type':Sequelize[_0x835d('0x4')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x36c4=['INTEGER','sequelize','exports','STRING'];(function(_0x293178,_0x4a8028){var _0x3b0f63=function(_0x1494c1){while(--_0x1494c1){_0x293178['push'](_0x293178['shift']());}};_0x3b0f63(++_0x4a8028);}(_0x36c4,0x95));var _0x436c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x36c4[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x436c('0x0'));module[_0x436c('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x436c('0x2')]},'src':{'type':Sequelize[_0x436c('0x2')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x436c('0x2')]},'channel':{'type':Sequelize[_0x436c('0x2')]},'dstchannel':{'type':Sequelize[_0x436c('0x2')]},'lastapp':{'type':Sequelize[_0x436c('0x2')]},'lastdata':{'type':Sequelize[_0x436c('0x2')]},'duration':{'type':Sequelize[_0x436c('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x436c('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x436c('0x2')]},'amaflags':{'type':Sequelize[_0x436c('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x436c('0x2')]},'linkedid':{'type':Sequelize[_0x436c('0x2')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x436c('0x2')]},'tag':{'type':Sequelize[_0x436c('0x2')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index db78960..9e6e06e 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 _0x1cd3=['crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','end','count','offset','limit','apply','reject','save','then','status','sendStatus','error','stack','name','index','map','Cdr','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','update','destroy','describe','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel'];(function(_0x307eba,_0x5e447e){var _0x34b1eb=function(_0x1e3add){while(--_0x1e3add){_0x307eba['push'](_0x307eba['shift']());}};_0x34b1eb(++_0x5e447e);}(_0x1cd3,0x1b6));var _0x31cd=function(_0x160d5d,_0x2c8209){_0x160d5d=_0x160d5d-0x0;var _0x67d7b9=_0x1cd3[_0x160d5d];return _0x67d7b9;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x31cd('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x31cd('0x1'));var moment=require(_0x31cd('0x2'));var BPromise=require(_0x31cd('0x3'));var Mustache=require(_0x31cd('0x4'));var util=require(_0x31cd('0x5'));var path=require(_0x31cd('0x6'));var sox=require(_0x31cd('0x7'));var csv=require('to-csv');var ejs=require(_0x31cd('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x31cd('0x9'));var crypto=require(_0x31cd('0xa'));var jsforce=require(_0x31cd('0xb'));var deskjs=require(_0x31cd('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x31cd('0xd'));var Redis=require(_0x31cd('0xe'));var authService=require(_0x31cd('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x31cd('0x10'));var hardwareService=require(_0x31cd('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x31cd('0x12'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x34c44a,_0x565775){_0x565775=_0x565775||0xcc;return function(_0x479ae2){if(_0x479ae2){return _0x34c44a['sendStatus'](_0x565775);}return _0x34c44a['status'](_0x565775)[_0x31cd('0x13')]();};}function respondWithResult(_0x2c07f3,_0x2171c9){_0x2171c9=_0x2171c9||0xc8;return function(_0x1e2971){if(_0x1e2971){return _0x2c07f3['status'](_0x2171c9)['json'](_0x1e2971);}};}function respondWithFilteredResult(_0x224c3b,_0xb98e71){return function(_0x524ae7){if(_0x524ae7){var _0x48498a=_0x524ae7[_0x31cd('0x14')],_0x578269=_0xb98e71[_0x31cd('0x15')],_0x105337=_0xb98e71[_0x31cd('0x15')]+_0xb98e71[_0x31cd('0x16')],_0x409364;if(_0x105337>=_0x48498a){_0x105337=_0x48498a;_0x409364=0xc8;}else{_0x409364=0xce;}_0x224c3b['status'](_0x409364);return _0x224c3b['set']('Content-Range',_0x578269+'-'+_0x105337+'/'+_0x48498a)['json'](_0x524ae7);}return null;};}function patchUpdates(_0x5cc76f){return function(_0xfe6adb){try{jsonpatch[_0x31cd('0x17')](_0xfe6adb,_0x5cc76f,!![]);}catch(_0x225df0){return BPromise[_0x31cd('0x18')](_0x225df0);}return _0xfe6adb[_0x31cd('0x19')]();};}function saveUpdates(_0x5b95e8,_0x52e115){return function(_0x28b9e3){if(_0x28b9e3){return _0x28b9e3['update'](_0x5b95e8)['then'](function(_0x31e41f){return _0x31e41f;});}return null;};}function removeEntity(_0x286db8,_0x1ef0a6){return function(_0x5b8fe7){if(_0x5b8fe7){return _0x5b8fe7['destroy']()[_0x31cd('0x1a')](function(){_0x286db8[_0x31cd('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x22c565,_0x449afd){return function(_0x31f555){if(!_0x31f555){_0x22c565[_0x31cd('0x1c')](0x194);}return _0x31f555;};}function handleError(_0x56e420,_0x4c30ba){_0x4c30ba=_0x4c30ba||0x1f4;return function(_0x4cb465){logger[_0x31cd('0x1d')](_0x4cb465[_0x31cd('0x1e')]);if(_0x4cb465[_0x31cd('0x1f')]){delete _0x4cb465[_0x31cd('0x1f')];}_0x56e420[_0x31cd('0x1b')](_0x4c30ba)['send'](_0x4cb465);};}exports[_0x31cd('0x20')]=function(_0xbed66e,_0x5ec8b5){var _0x3a3d2b={},_0x50696a={},_0x2abe54={'count':0x0,'rows':[]};var _0x482362=_[_0x31cd('0x21')](db[_0x31cd('0x22')][_0x31cd('0x23')],function(_0x5340f3){return{'name':_0x5340f3['fieldName'],'type':_0x5340f3['type'][_0x31cd('0x24')]};});_0x50696a[_0x31cd('0x25')]=_['map'](_0x482362,_0x31cd('0x1f'));_0x50696a['query']=_[_0x31cd('0x26')](_0xbed66e[_0x31cd('0x27')]);_0x50696a[_0x31cd('0x28')]=_[_0x31cd('0x29')](_0x50696a[_0x31cd('0x25')],_0x50696a['query']);_0x3a3d2b[_0x31cd('0x2a')]=_['intersection'](_0x50696a[_0x31cd('0x25')],qs[_0x31cd('0x2b')](_0xbed66e['query'][_0x31cd('0x2b')]));_0x3a3d2b['attributes']=_0x3a3d2b['attributes']['length']?_0x3a3d2b[_0x31cd('0x2a')]:_0x50696a[_0x31cd('0x25')];if(!_0xbed66e['query']['hasOwnProperty'](_0x31cd('0x2c'))){_0x3a3d2b[_0x31cd('0x16')]=qs[_0x31cd('0x16')](_0xbed66e['query'][_0x31cd('0x16')]);_0x3a3d2b[_0x31cd('0x15')]=qs[_0x31cd('0x15')](_0xbed66e[_0x31cd('0x27')][_0x31cd('0x15')]);}_0x3a3d2b['order']=qs[_0x31cd('0x2d')](_0xbed66e[_0x31cd('0x27')]['sort']);_0x3a3d2b[_0x31cd('0x2e')]=qs['filters'](_[_0x31cd('0x2f')](_0xbed66e[_0x31cd('0x27')],_0x50696a['filters']));if(_0xbed66e[_0x31cd('0x27')][_0x31cd('0x30')]){_0x3a3d2b[_0x31cd('0x2e')]=_[_0x31cd('0x31')](_0x3a3d2b[_0x31cd('0x2e')],{'$or':_[_0x31cd('0x21')](_0x482362,function(_0x152612){if(_0x152612['type'][_0x31cd('0x24')]!==_0x31cd('0x32')){var _0x5be91d={};_0x5be91d[_0x152612['field']]={'$like':'%'+_0xbed66e[_0x31cd('0x27')]['filter']+'%'};return _0x5be91d;}})});}_0x3a3d2b=_[_0x31cd('0x31')]({},_0x3a3d2b,_0xbed66e[_0x31cd('0x33')]);var _0x55fe8b={'where':_0x3a3d2b[_0x31cd('0x2e')]};return db[_0x31cd('0x22')][_0x31cd('0x14')](_0x55fe8b)['then'](function(_0x22e0cf){_0x2abe54['count']=_0x22e0cf;if(_0xbed66e[_0x31cd('0x27')][_0x31cd('0x34')]){_0x3a3d2b[_0x31cd('0x35')]=[{'all':!![]}];}return db[_0x31cd('0x22')][_0x31cd('0x36')](_0x3a3d2b);})['then'](function(_0x4f7ddd){_0x2abe54[_0x31cd('0x37')]=_0x4f7ddd;return _0x2abe54;})[_0x31cd('0x1a')](respondWithFilteredResult(_0x5ec8b5,_0x3a3d2b))[_0x31cd('0x38')](handleError(_0x5ec8b5,null));};exports['show']=function(_0x8fa54,_0x39c64a){var _0x3d978e={'raw':!![],'where':{'id':_0x8fa54[_0x31cd('0x39')]['id']}},_0x1747d6={};_0x1747d6[_0x31cd('0x25')]=_[_0x31cd('0x26')](db[_0x31cd('0x22')]['rawAttributes']);_0x1747d6[_0x31cd('0x27')]=_[_0x31cd('0x26')](_0x8fa54['query']);_0x1747d6['filters']=_[_0x31cd('0x29')](_0x1747d6[_0x31cd('0x25')],_0x1747d6[_0x31cd('0x27')]);_0x3d978e['attributes']=_[_0x31cd('0x29')](_0x1747d6[_0x31cd('0x25')],qs['fields'](_0x8fa54['query'][_0x31cd('0x2b')]));_0x3d978e[_0x31cd('0x2a')]=_0x3d978e[_0x31cd('0x2a')]['length']?_0x3d978e[_0x31cd('0x2a')]:_0x1747d6[_0x31cd('0x25')];if(_0x8fa54[_0x31cd('0x27')][_0x31cd('0x34')]){_0x3d978e[_0x31cd('0x35')]=[{'all':!![]}];}_0x3d978e=_[_0x31cd('0x31')]({},_0x3d978e,_0x8fa54[_0x31cd('0x33')]);return db['Cdr'][_0x31cd('0x3a')](_0x3d978e)['then'](handleEntityNotFound(_0x39c64a,null))[_0x31cd('0x1a')](respondWithResult(_0x39c64a,null))[_0x31cd('0x38')](handleError(_0x39c64a,null));};exports[_0x31cd('0x3b')]=function(_0x5987fa,_0x47f115){return db['Cdr'][_0x31cd('0x3b')](_0x5987fa[_0x31cd('0x3c')],{})['then'](respondWithResult(_0x47f115,0xc9))['catch'](handleError(_0x47f115,null));};exports[_0x31cd('0x3d')]=function(_0x214aa3,_0x3fea50){if(_0x214aa3[_0x31cd('0x3c')]['id']){delete _0x214aa3[_0x31cd('0x3c')]['id'];}return db['Cdr'][_0x31cd('0x3a')]({'where':{'id':_0x214aa3['params']['id']}})['then'](handleEntityNotFound(_0x3fea50,null))['then'](saveUpdates(_0x214aa3['body'],null))[_0x31cd('0x1a')](respondWithResult(_0x3fea50,null))[_0x31cd('0x38')](handleError(_0x3fea50,null));};exports[_0x31cd('0x3e')]=function(_0x58f89c,_0x3aba39){return db[_0x31cd('0x22')][_0x31cd('0x3a')]({'where':{'id':_0x58f89c['params']['id']}})[_0x31cd('0x1a')](handleEntityNotFound(_0x3aba39,null))[_0x31cd('0x1a')](removeEntity(_0x3aba39,null))[_0x31cd('0x38')](handleError(_0x3aba39,null));};exports[_0x31cd('0x3f')]=function(_0x7e9a62,_0x12a3ed){return db[_0x31cd('0x22')]['describe']()[_0x31cd('0x1a')](respondWithResult(_0x12a3ed,null))[_0x31cd('0x38')](handleError(_0x12a3ed,null));}; \ No newline at end of file +var _0x4524=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','update','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','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','status','end','json','count','offset','limit','set','reject','save','then','destroy','error','name','send','map','Cdr','key','model','query','keys','filters','intersection'];(function(_0x259780,_0x4fa802){var _0x10b003=function(_0x54e9fa){while(--_0x54e9fa){_0x259780['push'](_0x259780['shift']());}};_0x10b003(++_0x4fa802);}(_0x4524,0x1e2));var _0x4452=function(_0x648aa2,_0x3d26da){_0x648aa2=_0x648aa2-0x0;var _0x15e973=_0x4524[_0x648aa2];return _0x15e973;};'use strict';var pdf=require(_0x4452('0x0'));var emlformat=require(_0x4452('0x1'));var rimraf=require(_0x4452('0x2'));var zipdir=require(_0x4452('0x3'));var jsonpatch=require(_0x4452('0x4'));var rp=require(_0x4452('0x5'));var moment=require('moment');var BPromise=require(_0x4452('0x6'));var Mustache=require(_0x4452('0x7'));var util=require(_0x4452('0x8'));var path=require(_0x4452('0x9'));var sox=require('sox');var csv=require(_0x4452('0xa'));var ejs=require(_0x4452('0xb'));var fs=require('fs');var _=require(_0x4452('0xc'));var squel=require(_0x4452('0xd'));var crypto=require('crypto');var jsforce=require(_0x4452('0xe'));var deskjs=require(_0x4452('0xf'));var toCsv=require('to-csv');var querystring=require(_0x4452('0x10'));var Papa=require(_0x4452('0x11'));var Redis=require(_0x4452('0x12'));var authService=require(_0x4452('0x13'));var qs=require(_0x4452('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4452('0x15'));var logger=require(_0x4452('0x16'))(_0x4452('0x17'));var utils=require(_0x4452('0x18'));var config=require(_0x4452('0x19'));var db=require(_0x4452('0x1a'))['db'];function respondWithStatusCode(_0x25562f,_0x5be11e){_0x5be11e=_0x5be11e||0xcc;return function(_0x24ebd4){if(_0x24ebd4){return _0x25562f[_0x4452('0x1b')](_0x5be11e);}return _0x25562f[_0x4452('0x1c')](_0x5be11e)[_0x4452('0x1d')]();};}function respondWithResult(_0x33bc36,_0x516580){_0x516580=_0x516580||0xc8;return function(_0x29600e){if(_0x29600e){return _0x33bc36[_0x4452('0x1c')](_0x516580)[_0x4452('0x1e')](_0x29600e);}};}function respondWithFilteredResult(_0xb925d7,_0x4534cb){return function(_0x58ba37){if(_0x58ba37){var _0x2e99d0=_0x58ba37[_0x4452('0x1f')],_0x427367=_0x4534cb[_0x4452('0x20')],_0xbb6667=_0x4534cb[_0x4452('0x20')]+_0x4534cb[_0x4452('0x21')],_0x152ad7;if(_0xbb6667>=_0x2e99d0){_0xbb6667=_0x2e99d0;_0x152ad7=0xc8;}else{_0x152ad7=0xce;}_0xb925d7['status'](_0x152ad7);return _0xb925d7[_0x4452('0x22')]('Content-Range',_0x427367+'-'+_0xbb6667+'/'+_0x2e99d0)[_0x4452('0x1e')](_0x58ba37);}return null;};}function patchUpdates(_0x1a7c5e){return function(_0x13ea03){try{jsonpatch['apply'](_0x13ea03,_0x1a7c5e,!![]);}catch(_0x4c9fbc){return BPromise[_0x4452('0x23')](_0x4c9fbc);}return _0x13ea03[_0x4452('0x24')]();};}function saveUpdates(_0x3598b6,_0x4460c8){return function(_0x5b96ef){if(_0x5b96ef){return _0x5b96ef['update'](_0x3598b6)[_0x4452('0x25')](function(_0x232cbf){return _0x232cbf;});}return null;};}function removeEntity(_0x180d6d,_0x157540){return function(_0x11d900){if(_0x11d900){return _0x11d900[_0x4452('0x26')]()[_0x4452('0x25')](function(){_0x180d6d[_0x4452('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf5e25d,_0x17febd){return function(_0x55be7d){if(!_0x55be7d){_0xf5e25d['sendStatus'](0x194);}return _0x55be7d;};}function handleError(_0x4bc8e5,_0x5cfb66){_0x5cfb66=_0x5cfb66||0x1f4;return function(_0x3a0353){logger[_0x4452('0x27')](_0x3a0353['stack']);if(_0x3a0353[_0x4452('0x28')]){delete _0x3a0353[_0x4452('0x28')];}_0x4bc8e5['status'](_0x5cfb66)[_0x4452('0x29')](_0x3a0353);};}exports['index']=function(_0x2345f0,_0x5f1529){var _0x4d7ee1={},_0x6200e6={},_0x3c91e3={'count':0x0,'rows':[]};var _0x52c58c=_[_0x4452('0x2a')](db[_0x4452('0x2b')]['rawAttributes'],function(_0x2e944e){return{'name':_0x2e944e['fieldName'],'type':_0x2e944e['type'][_0x4452('0x2c')]};});_0x6200e6[_0x4452('0x2d')]=_[_0x4452('0x2a')](_0x52c58c,_0x4452('0x28'));_0x6200e6[_0x4452('0x2e')]=_[_0x4452('0x2f')](_0x2345f0['query']);_0x6200e6[_0x4452('0x30')]=_[_0x4452('0x31')](_0x6200e6[_0x4452('0x2d')],_0x6200e6['query']);_0x4d7ee1[_0x4452('0x32')]=_['intersection'](_0x6200e6[_0x4452('0x2d')],qs[_0x4452('0x33')](_0x2345f0[_0x4452('0x2e')]['fields']));_0x4d7ee1['attributes']=_0x4d7ee1[_0x4452('0x32')][_0x4452('0x34')]?_0x4d7ee1[_0x4452('0x32')]:_0x6200e6[_0x4452('0x2d')];if(!_0x2345f0[_0x4452('0x2e')][_0x4452('0x35')](_0x4452('0x36'))){_0x4d7ee1[_0x4452('0x21')]=qs[_0x4452('0x21')](_0x2345f0[_0x4452('0x2e')][_0x4452('0x21')]);_0x4d7ee1[_0x4452('0x20')]=qs['offset'](_0x2345f0['query'][_0x4452('0x20')]);}_0x4d7ee1[_0x4452('0x37')]=qs[_0x4452('0x38')](_0x2345f0[_0x4452('0x2e')][_0x4452('0x38')]);_0x4d7ee1['where']=qs[_0x4452('0x30')](_['pick'](_0x2345f0['query'],_0x6200e6[_0x4452('0x30')]));if(_0x2345f0['query'][_0x4452('0x39')]){_0x4d7ee1[_0x4452('0x3a')]=_[_0x4452('0x3b')](_0x4d7ee1[_0x4452('0x3a')],{'$or':_[_0x4452('0x2a')](_0x52c58c,function(_0xfd369c){if(_0xfd369c[_0x4452('0x3c')][_0x4452('0x2c')]!==_0x4452('0x3d')){var _0x2d5ce6={};_0x2d5ce6[_0xfd369c['field']]={'$like':'%'+_0x2345f0[_0x4452('0x2e')][_0x4452('0x39')]+'%'};return _0x2d5ce6;}})});}_0x4d7ee1=_[_0x4452('0x3b')]({},_0x4d7ee1,_0x2345f0[_0x4452('0x3e')]);var _0x1917f0={'where':_0x4d7ee1[_0x4452('0x3a')]};return db[_0x4452('0x2b')][_0x4452('0x1f')](_0x1917f0)[_0x4452('0x25')](function(_0x25cdff){_0x3c91e3[_0x4452('0x1f')]=_0x25cdff;if(_0x2345f0[_0x4452('0x2e')][_0x4452('0x3f')]){_0x4d7ee1[_0x4452('0x40')]=[{'all':!![]}];}return db[_0x4452('0x2b')][_0x4452('0x41')](_0x4d7ee1);})[_0x4452('0x25')](function(_0x1501c1){_0x3c91e3[_0x4452('0x42')]=_0x1501c1;return _0x3c91e3;})['then'](respondWithFilteredResult(_0x5f1529,_0x4d7ee1))[_0x4452('0x43')](handleError(_0x5f1529,null));};exports[_0x4452('0x44')]=function(_0x4a836d,_0x192832){var _0x595599={'raw':!![],'where':{'id':_0x4a836d[_0x4452('0x45')]['id']}},_0x19370a={};_0x19370a[_0x4452('0x2d')]=_[_0x4452('0x2f')](db[_0x4452('0x2b')][_0x4452('0x46')]);_0x19370a[_0x4452('0x2e')]=_[_0x4452('0x2f')](_0x4a836d[_0x4452('0x2e')]);_0x19370a[_0x4452('0x30')]=_[_0x4452('0x31')](_0x19370a[_0x4452('0x2d')],_0x19370a[_0x4452('0x2e')]);_0x595599[_0x4452('0x32')]=_[_0x4452('0x31')](_0x19370a[_0x4452('0x2d')],qs[_0x4452('0x33')](_0x4a836d[_0x4452('0x2e')][_0x4452('0x33')]));_0x595599[_0x4452('0x32')]=_0x595599[_0x4452('0x32')][_0x4452('0x34')]?_0x595599[_0x4452('0x32')]:_0x19370a[_0x4452('0x2d')];if(_0x4a836d['query'][_0x4452('0x3f')]){_0x595599[_0x4452('0x40')]=[{'all':!![]}];}_0x595599=_[_0x4452('0x3b')]({},_0x595599,_0x4a836d[_0x4452('0x3e')]);return db[_0x4452('0x2b')][_0x4452('0x47')](_0x595599)[_0x4452('0x25')](handleEntityNotFound(_0x192832,null))[_0x4452('0x25')](respondWithResult(_0x192832,null))[_0x4452('0x43')](handleError(_0x192832,null));};exports[_0x4452('0x48')]=function(_0x5564d1,_0x1b2309){return db[_0x4452('0x2b')][_0x4452('0x48')](_0x5564d1['body'],{})[_0x4452('0x25')](respondWithResult(_0x1b2309,0xc9))['catch'](handleError(_0x1b2309,null));};exports[_0x4452('0x49')]=function(_0x418ea1,_0x55ea6e){if(_0x418ea1[_0x4452('0x4a')]['id']){delete _0x418ea1[_0x4452('0x4a')]['id'];}return db['Cdr'][_0x4452('0x47')]({'where':{'id':_0x418ea1[_0x4452('0x45')]['id']}})[_0x4452('0x25')](handleEntityNotFound(_0x55ea6e,null))[_0x4452('0x25')](saveUpdates(_0x418ea1[_0x4452('0x4a')],null))[_0x4452('0x25')](respondWithResult(_0x55ea6e,null))[_0x4452('0x43')](handleError(_0x55ea6e,null));};exports[_0x4452('0x26')]=function(_0x3d1dfd,_0x49eeb8){return db[_0x4452('0x2b')][_0x4452('0x47')]({'where':{'id':_0x3d1dfd[_0x4452('0x45')]['id']}})[_0x4452('0x25')](handleEntityNotFound(_0x49eeb8,null))[_0x4452('0x25')](removeEntity(_0x49eeb8,null))['catch'](handleError(_0x49eeb8,null));};exports[_0x4452('0x4b')]=function(_0x161584,_0xfad0a6){return db[_0x4452('0x2b')]['describe']()[_0x4452('0x25')](respondWithResult(_0xfad0a6,null))['catch'](handleError(_0xfad0a6,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 3f5db8a..fa28cf8 100644 --- a/server/api/cdr/cdr.model.js +++ b/server/api/cdr/cdr.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xda19=['accountcode','disposition','dst','src','uniqueid','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./cdr.attributes','exports','define','Cdr','cdr'];(function(_0x427a32,_0x384a9f){var _0x50bf43=function(_0x2a2d69){while(--_0x2a2d69){_0x427a32['push'](_0x427a32['shift']());}};_0x50bf43(++_0x384a9f);}(_0xda19,0xd5));var _0x9da1=function(_0xefd992,_0x3aa307){_0xefd992=_0xefd992-0x0;var _0x3b11d6=_0xda19[_0xefd992];return _0x3b11d6;};'use strict';var _=require('lodash');var util=require(_0x9da1('0x0'));var logger=require(_0x9da1('0x1'))('api');var moment=require(_0x9da1('0x2'));var BPromise=require('bluebird');var rp=require(_0x9da1('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9da1('0x4'));var config=require(_0x9da1('0x5'));var attributes=require(_0x9da1('0x6'));module[_0x9da1('0x7')]=function(_0x156faf,_0x2dcbc6){return _0x156faf[_0x9da1('0x8')](_0x9da1('0x9'),attributes,{'tableName':_0x9da1('0xa'),'paranoid':![],'indexes':[{'name':_0x9da1('0xb'),'fields':['accountcode']},{'name':'calldate','fields':['calldate']},{'name':_0x9da1('0xc'),'fields':['disposition']},{'name':_0x9da1('0xd'),'fields':[_0x9da1('0xd')]},{'name':_0x9da1('0xe'),'fields':[_0x9da1('0xe')]},{'name':_0x9da1('0xf'),'fields':[_0x9da1('0xf')]}],'timestamps':![]});}; \ No newline at end of file +var _0xfcf0=['accountcode','calldate','disposition','dst','src','uniqueid','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cdr.attributes','exports','define','Cdr'];(function(_0x36cc3d,_0x5f13e5){var _0x980443=function(_0x11fc17){while(--_0x11fc17){_0x36cc3d['push'](_0x36cc3d['shift']());}};_0x980443(++_0x5f13e5);}(_0xfcf0,0x138));var _0x0fcf=function(_0x54381d,_0x247b2c){_0x54381d=_0x54381d-0x0;var _0x5308a7=_0xfcf0[_0x54381d];return _0x5308a7;};'use strict';var _=require(_0x0fcf('0x0'));var util=require(_0x0fcf('0x1'));var logger=require('../../config/logger')(_0x0fcf('0x2'));var moment=require(_0x0fcf('0x3'));var BPromise=require(_0x0fcf('0x4'));var rp=require(_0x0fcf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0fcf('0x6'));var config=require(_0x0fcf('0x7'));var attributes=require(_0x0fcf('0x8'));module[_0x0fcf('0x9')]=function(_0x1bace8,_0x1a7b03){return _0x1bace8[_0x0fcf('0xa')](_0x0fcf('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x0fcf('0xc'),'fields':[_0x0fcf('0xc')]},{'name':_0x0fcf('0xd'),'fields':['calldate']},{'name':_0x0fcf('0xe'),'fields':[_0x0fcf('0xe')]},{'name':_0x0fcf('0xf'),'fields':['dst']},{'name':_0x0fcf('0x10'),'fields':['src']},{'name':_0x0fcf('0x11'),'fields':[_0x0fcf('0x11')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index cae6477..f4d394b 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 _0xf81d=['result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','error','code','message'];(function(_0x274f77,_0x238af1){var _0xa44a7f=function(_0x450158){while(--_0x450158){_0x274f77['push'](_0x274f77['shift']());}};_0xa44a7f(++_0x238af1);}(_0xf81d,0x191));var _0xdf81=function(_0x1df3fa,_0x4c21e9){_0x1df3fa=_0x1df3fa-0x0;var _0x3da317=_0xf81d[_0x1df3fa];return _0x3da317;};'use strict';var _=require(_0xdf81('0x0'));var util=require(_0xdf81('0x1'));var moment=require(_0xdf81('0x2'));var BPromise=require(_0xdf81('0x3'));var rs=require(_0xdf81('0x4'));var fs=require('fs');var Redis=require(_0xdf81('0x5'));var db=require(_0xdf81('0x6'))['db'];var utils=require(_0xdf81('0x7'));var logger=require(_0xdf81('0x8'))('rpc');var config=require(_0xdf81('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x43545b,_0x432f30,_0x2c594d){return new BPromise(function(_0x131722,_0x56e74a){return client[_0xdf81('0xa')](_0x43545b,_0x2c594d)[_0xdf81('0xb')](function(_0x243dba){logger[_0xdf81('0xc')](_0xdf81('0xd'),_0x432f30,_0xdf81('0xe'));logger[_0xdf81('0xf')]('Cdr,\x20%s,\x20%s,\x20%s',_0x432f30,_0xdf81('0xe'),JSON['stringify'](_0x243dba));if(_0x243dba[_0xdf81('0x10')]){if(_0x243dba[_0xdf81('0x10')][_0xdf81('0x11')]===0x1f4){logger[_0xdf81('0x10')](_0xdf81('0xd'),_0x432f30,_0x243dba[_0xdf81('0x10')][_0xdf81('0x12')]);return _0x56e74a(_0x243dba['error'][_0xdf81('0x12')]);}logger[_0xdf81('0x10')]('Cdr,\x20%s,\x20%s',_0x432f30,_0x243dba[_0xdf81('0x10')][_0xdf81('0x12')]);return _0x131722(_0x243dba[_0xdf81('0x10')]['message']);}else{logger['info'](_0xdf81('0xd'),_0x432f30,'request\x20sent');_0x131722(_0x243dba[_0xdf81('0x13')][_0xdf81('0x12')]);}})['catch'](function(_0x45b6bf){logger[_0xdf81('0x10')](_0xdf81('0xd'),_0x432f30,_0x45b6bf);_0x56e74a(_0x45b6bf);});});} \ No newline at end of file +var _0x4b15=['debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','Cdr,\x20%s,\x20%s','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0xf027fe,_0x589f41){var _0x47f852=function(_0x333b7b){while(--_0x333b7b){_0xf027fe['push'](_0xf027fe['shift']());}};_0x47f852(++_0x589f41);}(_0x4b15,0x17f));var _0x54b1=function(_0x598dc3,_0x367544){_0x598dc3=_0x598dc3-0x0;var _0x2d7d3b=_0x4b15[_0x598dc3];return _0x2d7d3b;};'use strict';var _=require(_0x54b1('0x0'));var util=require(_0x54b1('0x1'));var moment=require(_0x54b1('0x2'));var BPromise=require('bluebird');var rs=require(_0x54b1('0x3'));var fs=require('fs');var Redis=require(_0x54b1('0x4'));var db=require(_0x54b1('0x5'))['db'];var utils=require(_0x54b1('0x6'));var logger=require(_0x54b1('0x7'))(_0x54b1('0x8'));var config=require(_0x54b1('0x9'));var jayson=require(_0x54b1('0xa'));var client=jayson[_0x54b1('0xb')][_0x54b1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2dde67,_0x8cc366,_0x44de6f){return new BPromise(function(_0x1a9ff9,_0x1a1273){return client[_0x54b1('0xd')](_0x2dde67,_0x44de6f)[_0x54b1('0xe')](function(_0xc4a013){logger[_0x54b1('0xf')]('Cdr,\x20%s,\x20%s',_0x8cc366,_0x54b1('0x10'));logger[_0x54b1('0x11')](_0x54b1('0x12'),_0x8cc366,'request\x20sent',JSON[_0x54b1('0x13')](_0xc4a013));if(_0xc4a013[_0x54b1('0x14')]){if(_0xc4a013[_0x54b1('0x14')][_0x54b1('0x15')]===0x1f4){logger[_0x54b1('0x14')](_0x54b1('0x16'),_0x8cc366,_0xc4a013['error'][_0x54b1('0x17')]);return _0x1a1273(_0xc4a013[_0x54b1('0x14')][_0x54b1('0x17')]);}logger[_0x54b1('0x14')]('Cdr,\x20%s,\x20%s',_0x8cc366,_0xc4a013[_0x54b1('0x14')][_0x54b1('0x17')]);return _0x1a9ff9(_0xc4a013['error']['message']);}else{logger[_0x54b1('0xf')]('Cdr,\x20%s,\x20%s',_0x8cc366,_0x54b1('0x10'));_0x1a9ff9(_0xc4a013[_0x54b1('0x18')]['message']);}})['catch'](function(_0x4031b0){logger[_0x54b1('0x14')](_0x54b1('0x16'),_0x8cc366,_0x4031b0);_0x1a1273(_0x4031b0);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 8c6d6df..a4b1f35 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 _0xab62=['destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','post','put','/:id','update','delete'];(function(_0x1cf591,_0x5e2b40){var _0x680570=function(_0x374097){while(--_0x374097){_0x1cf591['push'](_0x1cf591['shift']());}};_0x680570(++_0x5e2b40);}(_0xab62,0x9b));var _0x2ab6=function(_0x55a677,_0x7652d){_0x55a677=_0x55a677-0x0;var _0x3a1c18=_0xab62[_0x55a677];return _0x3a1c18;};'use strict';var multer=require(_0x2ab6('0x0'));var util=require(_0x2ab6('0x1'));var path=require('path');var timeout=require(_0x2ab6('0x2'));var express=require('express');var router=express[_0x2ab6('0x3')]();var auth=require(_0x2ab6('0x4'));var interaction=require(_0x2ab6('0x5'));var config=require(_0x2ab6('0x6'));var controller=require('./cdr.controller');router[_0x2ab6('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x2ab6('0x7')](_0x2ab6('0x8'),auth[_0x2ab6('0x9')](),controller['describe']);router['get']('/:id',auth[_0x2ab6('0x9')](),controller['show']);router[_0x2ab6('0xa')]('/',auth[_0x2ab6('0x9')](),controller['create']);router[_0x2ab6('0xb')](_0x2ab6('0xc'),auth[_0x2ab6('0x9')](),controller[_0x2ab6('0xd')]);router[_0x2ab6('0xe')]('/:id',auth[_0x2ab6('0x9')](),controller[_0x2ab6('0xf')]);module[_0x2ab6('0x10')]=router; \ No newline at end of file +var _0x4338=['exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','show','create','put','/:id','update','delete','destroy'];(function(_0x12c492,_0xc73770){var _0x1cf9ad=function(_0x4a44b9){while(--_0x4a44b9){_0x12c492['push'](_0x12c492['shift']());}};_0x1cf9ad(++_0xc73770);}(_0x4338,0x1a5));var _0x8433=function(_0x1c1539,_0x45bc75){_0x1c1539=_0x1c1539-0x0;var _0x3411e0=_0x4338[_0x1c1539];return _0x3411e0;};'use strict';var multer=require(_0x8433('0x0'));var util=require(_0x8433('0x1'));var path=require(_0x8433('0x2'));var timeout=require('connect-timeout');var express=require(_0x8433('0x3'));var router=express[_0x8433('0x4')]();var auth=require(_0x8433('0x5'));var interaction=require(_0x8433('0x6'));var config=require(_0x8433('0x7'));var controller=require('./cdr.controller');router[_0x8433('0x8')]('/',auth[_0x8433('0x9')](),controller[_0x8433('0xa')]);router[_0x8433('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x8433('0xb')]);router['get']('/:id',auth[_0x8433('0x9')](),controller[_0x8433('0xc')]);router['post']('/',auth[_0x8433('0x9')](),controller[_0x8433('0xd')]);router[_0x8433('0xe')](_0x8433('0xf'),auth[_0x8433('0x9')](),controller[_0x8433('0x10')]);router[_0x8433('0x11')]('/:id',auth[_0x8433('0x9')](),controller[_0x8433('0x12')]);module[_0x8433('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index e49d0de..ae08d77 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 _0xa55b=['*,*,*,*','sequelize','INTEGER','STRING','noop'];(function(_0x1c510a,_0x1413a9){var _0x23cedd=function(_0x3f3e43){while(--_0x3f3e43){_0x1c510a['push'](_0x1c510a['shift']());}};_0x23cedd(++_0x1413a9);}(_0xa55b,0x164));var _0xba55=function(_0x48ed78,_0xd3c11b){_0x48ed78=_0x48ed78-0x0;var _0x27d320=_0xa55b[_0x48ed78];return _0x27d320;};'use strict';var Sequelize=require(_0xba55('0x0'));module['exports']={'priority':{'type':Sequelize[_0xba55('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xba55('0x2')],'allowNull':![],'defaultValue':_0xba55('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xba55('0x2')]},'interval':{'type':Sequelize[_0xba55('0x2')],'defaultValue':_0xba55('0x4')}}; \ No newline at end of file +var _0xfe19=['sequelize','exports','INTEGER','STRING','*,*,*,*'];(function(_0x3737a5,_0x1b6b09){var _0x2a5157=function(_0x35773e){while(--_0x35773e){_0x3737a5['push'](_0x3737a5['shift']());}};_0x2a5157(++_0x1b6b09);}(_0xfe19,0x1b8));var _0x9fe1=function(_0x1f4f01,_0x2bd42c){_0x1f4f01=_0x1f4f01-0x0;var _0x4c2240=_0xfe19[_0x1f4f01];return _0x4c2240;};'use strict';var Sequelize=require(_0x9fe1('0x0'));module[_0x9fe1('0x1')]={'priority':{'type':Sequelize[_0x9fe1('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x9fe1('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x9fe1('0x3')]},'interval':{'type':Sequelize[_0x9fe1('0x3')],'defaultValue':_0x9fe1('0x4')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 93f2618..553a8dc 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 _0x17cc=['end','status','count','offset','limit','set','Content-Range','json','reject','save','update','then','destroy','sendStatus','error','stack','name','send','keys','rawAttributes','query','attributes','intersection','model','fields','length','includeAll','include','merge','options','ChatApplication','find','catch','body','params','html-pdf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb'];(function(_0x998aec,_0x28f664){var _0x354de2=function(_0x1964e4){while(--_0x1964e4){_0x998aec['push'](_0x998aec['shift']());}};_0x354de2(++_0x28f664);}(_0x17cc,0x179));var _0xc17c=function(_0x57f152,_0x34be17){_0x57f152=_0x57f152-0x0;var _0x283d82=_0x17cc[_0x57f152];return _0x283d82;};'use strict';var pdf=require(_0xc17c('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc17c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc17c('0x2'));var moment=require(_0xc17c('0x3'));var BPromise=require(_0xc17c('0x4'));var Mustache=require(_0xc17c('0x5'));var util=require(_0xc17c('0x6'));var path=require(_0xc17c('0x7'));var sox=require(_0xc17c('0x8'));var csv=require(_0xc17c('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc17c('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc17c('0xb'));var deskjs=require(_0xc17c('0xc'));var toCsv=require('to-csv');var querystring=require(_0xc17c('0xd'));var Papa=require('papaparse');var Redis=require(_0xc17c('0xe'));var authService=require(_0xc17c('0xf'));var qs=require(_0xc17c('0x10'));var as=require(_0xc17c('0x11'));var hardwareService=require(_0xc17c('0x12'));var logger=require(_0xc17c('0x13'))(_0xc17c('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xc17c('0x15'))['db'];function respondWithStatusCode(_0x2c405b,_0x5ab380){_0x5ab380=_0x5ab380||0xcc;return function(_0x28b980){if(_0x28b980){return _0x2c405b['sendStatus'](_0x5ab380);}return _0x2c405b['status'](_0x5ab380)[_0xc17c('0x16')]();};}function respondWithResult(_0x4acbbe,_0x1509de){_0x1509de=_0x1509de||0xc8;return function(_0x3c352e){if(_0x3c352e){return _0x4acbbe[_0xc17c('0x17')](_0x1509de)['json'](_0x3c352e);}};}function respondWithFilteredResult(_0x4b536a,_0x18c39f){return function(_0x580ffa){if(_0x580ffa){var _0x5ab2d2=_0x580ffa[_0xc17c('0x18')],_0x3cfb0a=_0x18c39f[_0xc17c('0x19')],_0x2b3dc5=_0x18c39f[_0xc17c('0x19')]+_0x18c39f[_0xc17c('0x1a')],_0x10fa97;if(_0x2b3dc5>=_0x5ab2d2){_0x2b3dc5=_0x5ab2d2;_0x10fa97=0xc8;}else{_0x10fa97=0xce;}_0x4b536a[_0xc17c('0x17')](_0x10fa97);return _0x4b536a[_0xc17c('0x1b')](_0xc17c('0x1c'),_0x3cfb0a+'-'+_0x2b3dc5+'/'+_0x5ab2d2)[_0xc17c('0x1d')](_0x580ffa);}return null;};}function patchUpdates(_0x534c00){return function(_0x241580){try{jsonpatch['apply'](_0x241580,_0x534c00,!![]);}catch(_0x581e4e){return BPromise[_0xc17c('0x1e')](_0x581e4e);}return _0x241580[_0xc17c('0x1f')]();};}function saveUpdates(_0x575c29,_0x53cd01){return function(_0xac110e){if(_0xac110e){return _0xac110e[_0xc17c('0x20')](_0x575c29)[_0xc17c('0x21')](function(_0x12a249){return _0x12a249;});}return null;};}function removeEntity(_0x33e5f7,_0xa86e6a){return function(_0x310746){if(_0x310746){return _0x310746[_0xc17c('0x22')]()[_0xc17c('0x21')](function(){_0x33e5f7[_0xc17c('0x17')](0xcc)[_0xc17c('0x16')]();});}};}function handleEntityNotFound(_0x54f579,_0x48dc84){return function(_0x43243d){if(!_0x43243d){_0x54f579[_0xc17c('0x23')](0x194);}return _0x43243d;};}function handleError(_0x5ee94d,_0x450e83){_0x450e83=_0x450e83||0x1f4;return function(_0x46a45a){logger[_0xc17c('0x24')](_0x46a45a[_0xc17c('0x25')]);if(_0x46a45a[_0xc17c('0x26')]){delete _0x46a45a[_0xc17c('0x26')];}_0x5ee94d['status'](_0x450e83)[_0xc17c('0x27')](_0x46a45a);};}exports['show']=function(_0x34e31c,_0x19ce55){var _0x33001d={'raw':!![],'where':{'id':_0x34e31c['params']['id']}},_0x1f06c9={};_0x1f06c9['model']=_[_0xc17c('0x28')](db['ChatApplication'][_0xc17c('0x29')]);_0x1f06c9[_0xc17c('0x2a')]=_[_0xc17c('0x28')](_0x34e31c[_0xc17c('0x2a')]);_0x1f06c9['filters']=_['intersection'](_0x1f06c9['model'],_0x1f06c9[_0xc17c('0x2a')]);_0x33001d[_0xc17c('0x2b')]=_[_0xc17c('0x2c')](_0x1f06c9[_0xc17c('0x2d')],qs[_0xc17c('0x2e')](_0x34e31c['query'][_0xc17c('0x2e')]));_0x33001d[_0xc17c('0x2b')]=_0x33001d[_0xc17c('0x2b')][_0xc17c('0x2f')]?_0x33001d[_0xc17c('0x2b')]:_0x1f06c9['model'];if(_0x34e31c[_0xc17c('0x2a')][_0xc17c('0x30')]){_0x33001d[_0xc17c('0x31')]=[{'all':!![]}];}_0x33001d=_[_0xc17c('0x32')]({},_0x33001d,_0x34e31c[_0xc17c('0x33')]);return db[_0xc17c('0x34')][_0xc17c('0x35')](_0x33001d)[_0xc17c('0x21')](handleEntityNotFound(_0x19ce55,null))['then'](respondWithResult(_0x19ce55,null))[_0xc17c('0x36')](handleError(_0x19ce55,null));};exports[_0xc17c('0x20')]=function(_0x51c148,_0x2ff313){if(_0x51c148[_0xc17c('0x37')]['id']){delete _0x51c148[_0xc17c('0x37')]['id'];}return db['ChatApplication']['find']({'where':{'id':_0x51c148[_0xc17c('0x38')]['id']}})['then'](handleEntityNotFound(_0x2ff313,null))['then'](saveUpdates(_0x51c148[_0xc17c('0x37')],null))[_0xc17c('0x21')](respondWithResult(_0x2ff313,null))[_0xc17c('0x36')](handleError(_0x2ff313,null));};exports[_0xc17c('0x22')]=function(_0x33f95f,_0x4f9bee){return db[_0xc17c('0x34')][_0xc17c('0x35')]({'where':{'id':_0x33f95f[_0xc17c('0x38')]['id']}})['then'](handleEntityNotFound(_0x4f9bee,null))[_0xc17c('0x21')](removeEntity(_0x4f9bee,null))['catch'](handleError(_0x4f9bee,null));}; \ No newline at end of file +var _0x9523=['../../config/utils','../../config/environment','../../mysqldb','end','status','json','count','offset','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','show','params','model','ChatApplication','keys','query','intersection','fields','attributes','includeAll','include','merge','options','find','body','catch','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0x9523,0x1c0));var _0x3952=function(_0x46afbb,_0x3b1327){_0x46afbb=_0x46afbb-0x0;var _0x3a4716=_0x9523[_0x46afbb];return _0x3a4716;};'use strict';var pdf=require(_0x3952('0x0'));var emlformat=require(_0x3952('0x1'));var rimraf=require(_0x3952('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3952('0x3'));var rp=require(_0x3952('0x4'));var moment=require(_0x3952('0x5'));var BPromise=require(_0x3952('0x6'));var Mustache=require(_0x3952('0x7'));var util=require(_0x3952('0x8'));var path=require(_0x3952('0x9'));var sox=require(_0x3952('0xa'));var csv=require(_0x3952('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x3952('0xc'));var squel=require(_0x3952('0xd'));var crypto=require(_0x3952('0xe'));var jsforce=require(_0x3952('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3952('0x10'));var Papa=require(_0x3952('0x11'));var Redis=require(_0x3952('0x12'));var authService=require(_0x3952('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x3952('0x14'));var hardwareService=require(_0x3952('0x15'));var logger=require(_0x3952('0x16'))(_0x3952('0x17'));var utils=require(_0x3952('0x18'));var config=require(_0x3952('0x19'));var db=require(_0x3952('0x1a'))['db'];function respondWithStatusCode(_0x1e4823,_0x215c66){_0x215c66=_0x215c66||0xcc;return function(_0x56df7b){if(_0x56df7b){return _0x1e4823['sendStatus'](_0x215c66);}return _0x1e4823['status'](_0x215c66)[_0x3952('0x1b')]();};}function respondWithResult(_0x59be61,_0x26fda4){_0x26fda4=_0x26fda4||0xc8;return function(_0x5263b3){if(_0x5263b3){return _0x59be61[_0x3952('0x1c')](_0x26fda4)[_0x3952('0x1d')](_0x5263b3);}};}function respondWithFilteredResult(_0x52a322,_0x154a2d){return function(_0x268645){if(_0x268645){var _0x2d96a=_0x268645[_0x3952('0x1e')],_0x252f97=_0x154a2d[_0x3952('0x1f')],_0x3dd1ae=_0x154a2d[_0x3952('0x1f')]+_0x154a2d['limit'],_0x5ad9f4;if(_0x3dd1ae>=_0x2d96a){_0x3dd1ae=_0x2d96a;_0x5ad9f4=0xc8;}else{_0x5ad9f4=0xce;}_0x52a322[_0x3952('0x1c')](_0x5ad9f4);return _0x52a322[_0x3952('0x20')](_0x3952('0x21'),_0x252f97+'-'+_0x3dd1ae+'/'+_0x2d96a)[_0x3952('0x1d')](_0x268645);}return null;};}function patchUpdates(_0x3553e1){return function(_0x3b3528){try{jsonpatch[_0x3952('0x22')](_0x3b3528,_0x3553e1,!![]);}catch(_0x490a62){return BPromise['reject'](_0x490a62);}return _0x3b3528[_0x3952('0x23')]();};}function saveUpdates(_0x1fd03d,_0x26a9b2){return function(_0x298ae9){if(_0x298ae9){return _0x298ae9[_0x3952('0x24')](_0x1fd03d)[_0x3952('0x25')](function(_0x12bdce){return _0x12bdce;});}return null;};}function removeEntity(_0x438b3c,_0x3cf68e){return function(_0xefd1b9){if(_0xefd1b9){return _0xefd1b9[_0x3952('0x26')]()['then'](function(){_0x438b3c[_0x3952('0x1c')](0xcc)[_0x3952('0x1b')]();});}};}function handleEntityNotFound(_0x270784,_0x410571){return function(_0xb85a12){if(!_0xb85a12){_0x270784[_0x3952('0x27')](0x194);}return _0xb85a12;};}function handleError(_0x32d884,_0x13131f){_0x13131f=_0x13131f||0x1f4;return function(_0x441ee0){logger[_0x3952('0x28')](_0x441ee0[_0x3952('0x29')]);if(_0x441ee0[_0x3952('0x2a')]){delete _0x441ee0[_0x3952('0x2a')];}_0x32d884[_0x3952('0x1c')](_0x13131f)['send'](_0x441ee0);};}exports[_0x3952('0x2b')]=function(_0x2a24fd,_0x24c8f4){var _0x4fca64={'raw':!![],'where':{'id':_0x2a24fd[_0x3952('0x2c')]['id']}},_0x539700={};_0x539700[_0x3952('0x2d')]=_['keys'](db[_0x3952('0x2e')]['rawAttributes']);_0x539700['query']=_[_0x3952('0x2f')](_0x2a24fd[_0x3952('0x30')]);_0x539700['filters']=_[_0x3952('0x31')](_0x539700[_0x3952('0x2d')],_0x539700[_0x3952('0x30')]);_0x4fca64['attributes']=_['intersection'](_0x539700['model'],qs[_0x3952('0x32')](_0x2a24fd['query'][_0x3952('0x32')]));_0x4fca64[_0x3952('0x33')]=_0x4fca64[_0x3952('0x33')]['length']?_0x4fca64[_0x3952('0x33')]:_0x539700[_0x3952('0x2d')];if(_0x2a24fd[_0x3952('0x30')][_0x3952('0x34')]){_0x4fca64[_0x3952('0x35')]=[{'all':!![]}];}_0x4fca64=_[_0x3952('0x36')]({},_0x4fca64,_0x2a24fd[_0x3952('0x37')]);return db[_0x3952('0x2e')][_0x3952('0x38')](_0x4fca64)['then'](handleEntityNotFound(_0x24c8f4,null))[_0x3952('0x25')](respondWithResult(_0x24c8f4,null))['catch'](handleError(_0x24c8f4,null));};exports[_0x3952('0x24')]=function(_0x4f89cc,_0x35cd1c){if(_0x4f89cc[_0x3952('0x39')]['id']){delete _0x4f89cc[_0x3952('0x39')]['id'];}return db[_0x3952('0x2e')][_0x3952('0x38')]({'where':{'id':_0x4f89cc[_0x3952('0x2c')]['id']}})[_0x3952('0x25')](handleEntityNotFound(_0x35cd1c,null))[_0x3952('0x25')](saveUpdates(_0x4f89cc['body'],null))[_0x3952('0x25')](respondWithResult(_0x35cd1c,null))[_0x3952('0x3a')](handleError(_0x35cd1c,null));};exports[_0x3952('0x26')]=function(_0x24bac9,_0x15aa0e){return db[_0x3952('0x2e')][_0x3952('0x38')]({'where':{'id':_0x24bac9[_0x3952('0x2c')]['id']}})[_0x3952('0x25')](handleEntityNotFound(_0x15aa0e,null))[_0x3952('0x25')](removeEntity(_0x15aa0e,null))[_0x3952('0x3a')](handleError(_0x15aa0e,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 50d7fe2..d87f68a 100644 --- a/server/api/chatApplication/chatApplication.model.js +++ b/server/api/chatApplication/chatApplication.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['define','ChatApplication','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','exports'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0a9e('0xb')});}; \ No newline at end of file +var _0xa9e0=['define','ChatApplication','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','exports'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0a9e('0xb')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 3a5f79c..2a3228d 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 _0xeb95=['ChatApplication,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x43a31b,_0x279ca4){var _0x37a340=function(_0x266681){while(--_0x266681){_0x43a31b['push'](_0x43a31b['shift']());}};_0x37a340(++_0x279ca4);}(_0xeb95,0x1d2));var _0x5eb9=function(_0xaba7a2,_0x4d7254){_0xaba7a2=_0xaba7a2-0x0;var _0x1cc0a9=_0xeb95[_0xaba7a2];return _0x1cc0a9;};'use strict';var _=require(_0x5eb9('0x0'));var util=require(_0x5eb9('0x1'));var moment=require('moment');var BPromise=require(_0x5eb9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5eb9('0x3'))['db'];var utils=require(_0x5eb9('0x4'));var logger=require(_0x5eb9('0x5'))(_0x5eb9('0x6'));var config=require(_0x5eb9('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5eb9('0x8')][_0x5eb9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x16180d,_0x5f0526,_0x346bc9){return new BPromise(function(_0x11f869,_0x2217d5){return client[_0x5eb9('0xa')](_0x16180d,_0x346bc9)['then'](function(_0x20158c){logger['info']('ChatApplication,\x20%s,\x20%s',_0x5f0526,_0x5eb9('0xb'));logger[_0x5eb9('0xc')](_0x5eb9('0xd'),_0x5f0526,_0x5eb9('0xb'),JSON[_0x5eb9('0xe')](_0x20158c));if(_0x20158c[_0x5eb9('0xf')]){if(_0x20158c['error'][_0x5eb9('0x10')]===0x1f4){logger['error'](_0x5eb9('0x11'),_0x5f0526,_0x20158c['error'][_0x5eb9('0x12')]);return _0x2217d5(_0x20158c['error'][_0x5eb9('0x12')]);}logger[_0x5eb9('0xf')]('ChatApplication,\x20%s,\x20%s',_0x5f0526,_0x20158c[_0x5eb9('0xf')][_0x5eb9('0x12')]);return _0x11f869(_0x20158c[_0x5eb9('0xf')][_0x5eb9('0x12')]);}else{logger['info'](_0x5eb9('0x11'),_0x5f0526,_0x5eb9('0xb'));_0x11f869(_0x20158c[_0x5eb9('0x13')][_0x5eb9('0x12')]);}})[_0x5eb9('0x14')](function(_0x5e598a){logger['error']('ChatApplication,\x20%s,\x20%s',_0x5f0526,_0x5e598a);_0x2217d5(_0x5e598a);});});} \ No newline at end of file +var _0x736a=['info','ChatApplication,\x20%s,\x20%s','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','request'];(function(_0x1642e2,_0x4fdf89){var _0x2215da=function(_0x3c1bef){while(--_0x3c1bef){_0x1642e2['push'](_0x1642e2['shift']());}};_0x2215da(++_0x4fdf89);}(_0x736a,0x11b));var _0xa736=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0x736a[_0x82129b];return _0x2ae5dc;};'use strict';var _=require(_0xa736('0x0'));var util=require(_0xa736('0x1'));var moment=require(_0xa736('0x2'));var BPromise=require(_0xa736('0x3'));var rs=require(_0xa736('0x4'));var fs=require('fs');var Redis=require(_0xa736('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa736('0x6'))(_0xa736('0x7'));var config=require(_0xa736('0x8'));var jayson=require(_0xa736('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5d08a7,_0x487743,_0x308ad6){return new BPromise(function(_0xc6548a,_0x5c6c46){return client[_0xa736('0xa')](_0x5d08a7,_0x308ad6)['then'](function(_0x1efcd3){logger[_0xa736('0xb')](_0xa736('0xc'),_0x487743,'request\x20sent');logger[_0xa736('0xd')](_0xa736('0xe'),_0x487743,_0xa736('0xf'),JSON[_0xa736('0x10')](_0x1efcd3));if(_0x1efcd3[_0xa736('0x11')]){if(_0x1efcd3['error'][_0xa736('0x12')]===0x1f4){logger[_0xa736('0x11')]('ChatApplication,\x20%s,\x20%s',_0x487743,_0x1efcd3['error'][_0xa736('0x13')]);return _0x5c6c46(_0x1efcd3[_0xa736('0x11')][_0xa736('0x13')]);}logger[_0xa736('0x11')](_0xa736('0xc'),_0x487743,_0x1efcd3['error'][_0xa736('0x13')]);return _0xc6548a(_0x1efcd3[_0xa736('0x11')][_0xa736('0x13')]);}else{logger[_0xa736('0xb')](_0xa736('0xc'),_0x487743,'request\x20sent');_0xc6548a(_0x1efcd3['result']['message']);}})[_0xa736('0x14')](function(_0x6bf93f){logger[_0xa736('0x11')](_0xa736('0xc'),_0x487743,_0x6bf93f);_0x5c6c46(_0x6bf93f);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 25b679f..c0589a9 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 _0x0520=['exports','multer','connect-timeout','Router','../../components/auth/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','update','delete','destroy'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x0520,0xc5));var _0x0052=function(_0x51e58e,_0xd60b91){_0x51e58e=_0x51e58e-0x0;var _0x5279cb=_0x0520[_0x51e58e];return _0x5279cb;};'use strict';var multer=require(_0x0052('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x0052('0x1'));var express=require('express');var router=express[_0x0052('0x2')]();var auth=require(_0x0052('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x0052('0x4'));var controller=require(_0x0052('0x5'));router[_0x0052('0x6')](_0x0052('0x7'),auth[_0x0052('0x8')](),controller[_0x0052('0x9')]);router['put'](_0x0052('0x7'),auth[_0x0052('0x8')](),controller[_0x0052('0xa')]);router[_0x0052('0xb')](_0x0052('0x7'),auth['isAuthenticated'](),controller[_0x0052('0xc')]);module[_0x0052('0xd')]=router; \ No newline at end of file +var _0xb556=['./chatApplication.controller','get','/:id','isAuthenticated','show','put','update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x427c1a,_0x59061b){var _0xfb5c2e=function(_0x1fdcc0){while(--_0x1fdcc0){_0x427c1a['push'](_0x427c1a['shift']());}};_0xfb5c2e(++_0x59061b);}(_0xb556,0x16e));var _0x6b55=function(_0x47c171,_0x52fcd5){_0x47c171=_0x47c171-0x0;var _0x25a75e=_0xb556[_0x47c171];return _0x25a75e;};'use strict';var multer=require(_0x6b55('0x0'));var util=require(_0x6b55('0x1'));var path=require(_0x6b55('0x2'));var timeout=require(_0x6b55('0x3'));var express=require('express');var router=express[_0x6b55('0x4')]();var auth=require(_0x6b55('0x5'));var interaction=require(_0x6b55('0x6'));var config=require(_0x6b55('0x7'));var controller=require(_0x6b55('0x8'));router[_0x6b55('0x9')](_0x6b55('0xa'),auth[_0x6b55('0xb')](),controller[_0x6b55('0xc')]);router[_0x6b55('0xd')](_0x6b55('0xa'),auth[_0x6b55('0xb')](),controller[_0x6b55('0xe')]);router['delete'](_0x6b55('0xa'),auth[_0x6b55('0xb')](),controller[_0x6b55('0xf')]);module[_0x6b55('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 0d4e6e5..462ceaf 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 _0x8a4e=['BOOLEAN','sequelize','exports','STRING'];(function(_0x94d23d,_0x35bc12){var _0x43db1c=function(_0x2742d7){while(--_0x2742d7){_0x94d23d['push'](_0x94d23d['shift']());}};_0x43db1c(++_0x35bc12);}(_0x8a4e,0x179));var _0xe8a4=function(_0x25806f,_0x16dbdd){_0x25806f=_0x25806f-0x0;var _0x163f12=_0x8a4e[_0x25806f];return _0x163f12;};'use strict';var Sequelize=require(_0xe8a4('0x0'));module[_0xe8a4('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xe8a4('0x2')]},'write':{'type':Sequelize[_0xe8a4('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0xa170=['BOOLEAN','STRING'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa170,0x1b5));var _0x0a17=function(_0x599b4c,_0x276240){_0x599b4c=_0x599b4c-0x0;var _0x28a0a7=_0xa170[_0x599b4c];return _0x28a0a7;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x0a17('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0x0a17('0x0')]},'write':{'type':Sequelize[_0x0a17('0x1')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 9dd63d6..1e9f4ec 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 _0x0738=['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','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','save','update','stack','name','send','index','map','ChatGroup','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','field','filter','options','count','includeAll','include','rows','show','params','find','create','body','describe','getUnread','user','toInteger','addMembers','ids','omit','getMembers','User','merge','removeMembers','getMessages','ChatInternalMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','defaults','redis','socket.io-emitter','register','jayson/promise','client','http'];(function(_0x4abe46,_0x1ad7df){var _0x12823a=function(_0x4a4941){while(--_0x4a4941){_0x4abe46['push'](_0x4abe46['shift']());}};_0x12823a(++_0x1ad7df);}(_0x0738,0xb9));var _0x8073=function(_0x5a2d95,_0xb362e5){_0x5a2d95=_0x5a2d95-0x0;var _0x2c3986=_0x0738[_0x5a2d95];return _0x2c3986;};'use strict';var pdf=require(_0x8073('0x0'));var emlformat=require(_0x8073('0x1'));var rimraf=require(_0x8073('0x2'));var zipdir=require(_0x8073('0x3'));var jsonpatch=require(_0x8073('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8073('0x5'));var Mustache=require(_0x8073('0x6'));var util=require(_0x8073('0x7'));var path=require(_0x8073('0x8'));var sox=require(_0x8073('0x9'));var csv=require(_0x8073('0xa'));var ejs=require(_0x8073('0xb'));var fs=require('fs');var _=require(_0x8073('0xc'));var squel=require(_0x8073('0xd'));var crypto=require(_0x8073('0xe'));var jsforce=require(_0x8073('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8073('0x10'));var Papa=require(_0x8073('0x11'));var Redis=require('ioredis');var authService=require(_0x8073('0x12'));var qs=require(_0x8073('0x13'));var as=require(_0x8073('0x14'));var hardwareService=require(_0x8073('0x15'));var logger=require('../../config/logger')(_0x8073('0x16'));var utils=require('../../config/utils');var config=require(_0x8073('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x8073('0x18')](config[_0x8073('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x8073('0x1a'))(new Redis(config[_0x8073('0x19')]));require('./chatGroup.socket')[_0x8073('0x1b')](socket);var jayson=require(_0x8073('0x1c'));var client=jayson[_0x8073('0x1d')][_0x8073('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x56d77e,_0x4441ff,_0x3f54fc){if(_0x3f54fc){var _0x1507df=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1507df[_0x8073('0x1f')](_0x4441ff)){return _0x56d77e;}else{throw new Error(_0x8073('0x20'));}}else{return _0x56d77e;}}function respondWithRpcPromise(_0x25fdb2,_0x567155,_0x1d7d66,_0x5088ff){return new BPromise(function(_0x2231e0,_0x181961){var _0x58ad61=_0x5088ff||client;return _0x58ad61[_0x8073('0x21')](_0x25fdb2,_0x1d7d66)[_0x8073('0x22')](function(_0xdb5ddf){logger[_0x8073('0x23')](_0x8073('0x24'),_0x567155,_0x8073('0x25'));logger[_0x8073('0x26')](_0x8073('0x27'),_0x567155,_0x8073('0x25'),JSON[_0x8073('0x28')](_0xdb5ddf));if(_0xdb5ddf[_0x8073('0x29')]){if(_0xdb5ddf[_0x8073('0x29')][_0x8073('0x2a')]===0x1f4){logger[_0x8073('0x29')]('ChatGroup,\x20%s,\x20%s',_0x567155,_0xdb5ddf[_0x8073('0x29')]['message']);return _0x181961(_0xdb5ddf[_0x8073('0x29')]['message']);}logger['error'](_0x8073('0x24'),_0x567155,_0xdb5ddf[_0x8073('0x29')][_0x8073('0x2b')]);return _0x2231e0(_0xdb5ddf[_0x8073('0x29')][_0x8073('0x2b')]);}else{logger[_0x8073('0x23')](_0x8073('0x24'),_0x567155,'request\x20sent');_0x2231e0(_0xdb5ddf['result'][_0x8073('0x2b')]);}})[_0x8073('0x2c')](function(_0x69e652){logger['error'](_0x8073('0x24'),_0x567155,_0x69e652);_0x181961(_0x69e652);});});}function respondWithStatusCode(_0x589d18,_0x38b407){_0x38b407=_0x38b407||0xcc;return function(_0x43f999){if(_0x43f999){return _0x589d18[_0x8073('0x2d')](_0x38b407);}return _0x589d18[_0x8073('0x2e')](_0x38b407)[_0x8073('0x2f')]();};}function respondWithResult(_0x5ab811,_0x225027){_0x225027=_0x225027||0xc8;return function(_0x4b85e6){if(_0x4b85e6){return _0x5ab811['status'](_0x225027)[_0x8073('0x30')](_0x4b85e6);}};}function respondWithFilteredResult(_0x49c1f2,_0x664ff4){return function(_0x5dd81d){if(_0x5dd81d){var _0x5802d7=_0x5dd81d['count'],_0x421f12=_0x664ff4[_0x8073('0x31')],_0x5081cd=_0x664ff4['offset']+_0x664ff4[_0x8073('0x32')],_0x2735d9;if(_0x5081cd>=_0x5802d7){_0x5081cd=_0x5802d7;_0x2735d9=0xc8;}else{_0x2735d9=0xce;}_0x49c1f2[_0x8073('0x2e')](_0x2735d9);return _0x49c1f2[_0x8073('0x33')](_0x8073('0x34'),_0x421f12+'-'+_0x5081cd+'/'+_0x5802d7)[_0x8073('0x30')](_0x5dd81d);}return null;};}function patchUpdates(_0x40abee){return function(_0x449da3){try{jsonpatch[_0x8073('0x35')](_0x449da3,_0x40abee,!![]);}catch(_0x4d6f6a){return BPromise['reject'](_0x4d6f6a);}return _0x449da3[_0x8073('0x36')]();};}function saveUpdates(_0xc0a416,_0x37da8a){return function(_0x9addfb){if(_0x9addfb){return _0x9addfb[_0x8073('0x37')](_0xc0a416)[_0x8073('0x22')](function(_0x181c59){return _0x181c59;});}return null;};}function removeEntity(_0x11e6b9,_0x56515d){return function(_0x351b93){if(_0x351b93){return _0x351b93['destroy']()[_0x8073('0x22')](function(){_0x11e6b9[_0x8073('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f39bb,_0x3e4ff6){return function(_0x50c3ea){if(!_0x50c3ea){_0x2f39bb[_0x8073('0x2d')](0x194);}return _0x50c3ea;};}function handleError(_0x2135c3,_0x27010f){_0x27010f=_0x27010f||0x1f4;return function(_0x5e34ed){logger[_0x8073('0x29')](_0x5e34ed[_0x8073('0x38')]);if(_0x5e34ed['name']){delete _0x5e34ed[_0x8073('0x39')];}_0x2135c3['status'](_0x27010f)[_0x8073('0x3a')](_0x5e34ed);};}exports[_0x8073('0x3b')]=function(_0x43194d,_0x2c4ba9){var _0x354197={},_0x3eacda={},_0x13fc2d={'count':0x0,'rows':[]};var _0x2dbb80=_[_0x8073('0x3c')](db[_0x8073('0x3d')][_0x8073('0x3e')],function(_0x3d9b88){return{'name':_0x3d9b88['fieldName'],'type':_0x3d9b88[_0x8073('0x3f')][_0x8073('0x40')]};});_0x3eacda[_0x8073('0x41')]=_[_0x8073('0x3c')](_0x2dbb80,'name');_0x3eacda[_0x8073('0x42')]=_[_0x8073('0x43')](_0x43194d['query']);_0x3eacda[_0x8073('0x44')]=_[_0x8073('0x45')](_0x3eacda[_0x8073('0x41')],_0x3eacda[_0x8073('0x42')]);_0x354197[_0x8073('0x46')]=_[_0x8073('0x45')](_0x3eacda[_0x8073('0x41')],qs[_0x8073('0x47')](_0x43194d[_0x8073('0x42')]['fields']));_0x354197['attributes']=_0x354197[_0x8073('0x46')][_0x8073('0x48')]?_0x354197[_0x8073('0x46')]:_0x3eacda[_0x8073('0x41')];if(!_0x43194d['query'][_0x8073('0x49')](_0x8073('0x4a'))){_0x354197[_0x8073('0x32')]=qs[_0x8073('0x32')](_0x43194d['query'][_0x8073('0x32')]);_0x354197['offset']=qs[_0x8073('0x31')](_0x43194d[_0x8073('0x42')][_0x8073('0x31')]);}_0x354197[_0x8073('0x4b')]=qs['sort'](_0x43194d[_0x8073('0x42')][_0x8073('0x4c')]);_0x354197[_0x8073('0x4d')]=qs[_0x8073('0x44')](_[_0x8073('0x4e')](_0x43194d['query'],_0x3eacda[_0x8073('0x44')]));if(_0x43194d['query']['filter']){_0x354197[_0x8073('0x4d')]=_['merge'](_0x354197['where'],{'$or':_[_0x8073('0x3c')](_0x2dbb80,function(_0x299c5d){if(_0x299c5d[_0x8073('0x3f')][_0x8073('0x40')]!=='VIRTUAL'){var _0x34ce33={};_0x34ce33[_0x299c5d[_0x8073('0x4f')]]={'$like':'%'+_0x43194d[_0x8073('0x42')][_0x8073('0x50')]+'%'};return _0x34ce33;}})});}_0x354197=_['merge']({},_0x354197,_0x43194d[_0x8073('0x51')]);var _0x5dc619={'where':_0x354197['where']};return db[_0x8073('0x3d')][_0x8073('0x52')](_0x5dc619)[_0x8073('0x22')](function(_0x2167b3){_0x13fc2d[_0x8073('0x52')]=_0x2167b3;if(_0x43194d[_0x8073('0x42')][_0x8073('0x53')]){_0x354197[_0x8073('0x54')]=[{'all':!![]}];}return db[_0x8073('0x3d')]['findAll'](_0x354197);})['then'](function(_0x472d31){_0x13fc2d[_0x8073('0x55')]=_0x472d31;return _0x13fc2d;})['then'](respondWithFilteredResult(_0x2c4ba9,_0x354197))[_0x8073('0x2c')](handleError(_0x2c4ba9,null));};exports[_0x8073('0x56')]=function(_0x465b2c,_0x1d06ee){var _0x369e62={'raw':!![],'where':{'id':_0x465b2c[_0x8073('0x57')]['id']}},_0x2dea8e={};_0x2dea8e[_0x8073('0x41')]=_[_0x8073('0x43')](db[_0x8073('0x3d')][_0x8073('0x3e')]);_0x2dea8e[_0x8073('0x42')]=_[_0x8073('0x43')](_0x465b2c[_0x8073('0x42')]);_0x2dea8e[_0x8073('0x44')]=_['intersection'](_0x2dea8e[_0x8073('0x41')],_0x2dea8e[_0x8073('0x42')]);_0x369e62[_0x8073('0x46')]=_[_0x8073('0x45')](_0x2dea8e[_0x8073('0x41')],qs['fields'](_0x465b2c[_0x8073('0x42')][_0x8073('0x47')]));_0x369e62[_0x8073('0x46')]=_0x369e62['attributes'][_0x8073('0x48')]?_0x369e62[_0x8073('0x46')]:_0x2dea8e[_0x8073('0x41')];if(_0x465b2c['query']['includeAll']){_0x369e62[_0x8073('0x54')]=[{'all':!![]}];}_0x369e62=_['merge']({},_0x369e62,_0x465b2c['options']);return db[_0x8073('0x3d')][_0x8073('0x58')](_0x369e62)[_0x8073('0x22')](handleEntityNotFound(_0x1d06ee,null))['then'](respondWithResult(_0x1d06ee,null))[_0x8073('0x2c')](handleError(_0x1d06ee,null));};exports['create']=function(_0x41e9e3,_0x1ee1b7){return db['ChatGroup'][_0x8073('0x59')](_0x41e9e3[_0x8073('0x5a')],{})['then'](respondWithResult(_0x1ee1b7,0xc9))[_0x8073('0x2c')](handleError(_0x1ee1b7,null));};exports[_0x8073('0x37')]=function(_0x1d7320,_0x331994){if(_0x1d7320[_0x8073('0x5a')]['id']){delete _0x1d7320[_0x8073('0x5a')]['id'];}return db[_0x8073('0x3d')]['find']({'where':{'id':_0x1d7320[_0x8073('0x57')]['id']}})[_0x8073('0x22')](handleEntityNotFound(_0x331994,null))[_0x8073('0x22')](saveUpdates(_0x1d7320[_0x8073('0x5a')],null))[_0x8073('0x22')](respondWithResult(_0x331994,null))['catch'](handleError(_0x331994,null));};exports['destroy']=function(_0x391da5,_0x3b0652){return db[_0x8073('0x3d')][_0x8073('0x58')]({'where':{'id':_0x391da5[_0x8073('0x57')]['id']}})[_0x8073('0x22')](handleEntityNotFound(_0x3b0652,null))[_0x8073('0x22')](removeEntity(_0x3b0652,null))['catch'](handleError(_0x3b0652,null));};exports['describe']=function(_0x376824,_0x564fde){return db[_0x8073('0x3d')][_0x8073('0x5b')]()[_0x8073('0x22')](respondWithResult(_0x564fde,null))['catch'](handleError(_0x564fde,null));};exports[_0x8073('0x5c')]=function(_0x4bd5d3,_0x129245,_0x53487a){return db['ChatInternalMessage']['count']({'where':{'ChatGroupId':_0x4bd5d3[_0x8073('0x57')]['id'],'ToId':_0x4bd5d3[_0x8073('0x5d')]['id'],'read':![]}})[_0x8073('0x22')](function(_0xa144da){return{'id':_[_0x8073('0x5e')](_0x4bd5d3['params']['id']),'count':_0xa144da};})[_0x8073('0x22')](respondWithResult(_0x129245,null))[_0x8073('0x2c')](handleError(_0x129245,null));};exports['addMembers']=function(_0x50be93,_0x21de77,_0xbaf168){return db[_0x8073('0x3d')][_0x8073('0x58')]({'where':{'id':_0x50be93[_0x8073('0x57')]['id']}})[_0x8073('0x22')](handleEntityNotFound(_0x21de77,null))[_0x8073('0x22')](function(_0x4b7f59){if(_0x4b7f59){return _0x4b7f59[_0x8073('0x5f')](_0x50be93[_0x8073('0x5a')][_0x8073('0x60')],_[_0x8073('0x61')](_0x50be93[_0x8073('0x5a')],[_0x8073('0x60'),'id'])||{});}})[_0x8073('0x22')](respondWithResult(_0x21de77,null))[_0x8073('0x2c')](handleError(_0x21de77,null));};exports[_0x8073('0x62')]=function(_0x2ead4e,_0x2b4a42,_0x220625){var _0x2b618c={};var _0x96c513={};var _0x3ae163;var _0x456965;return db[_0x8073('0x3d')]['findOne']({'where':{'id':_0x2ead4e[_0x8073('0x57')]['id']}})['then'](handleEntityNotFound(_0x2b4a42,null))['then'](function(_0x28579d){if(_0x28579d){_0x3ae163=_0x28579d;_0x96c513[_0x8073('0x41')]=_['keys'](db[_0x8073('0x63')][_0x8073('0x3e')]);_0x96c513['query']=_[_0x8073('0x43')](_0x2ead4e['query']);_0x96c513[_0x8073('0x44')]=_[_0x8073('0x45')](_0x96c513[_0x8073('0x41')],_0x96c513[_0x8073('0x42')]);_0x2b618c['attributes']=_['intersection'](_0x96c513[_0x8073('0x41')],qs[_0x8073('0x47')](_0x2ead4e[_0x8073('0x42')]['fields']));_0x2b618c[_0x8073('0x46')]=_0x2b618c['attributes']['length']?_0x2b618c[_0x8073('0x46')]:_0x96c513['model'];_0x2b618c['order']=qs[_0x8073('0x4c')](_0x2ead4e[_0x8073('0x42')][_0x8073('0x4c')]);_0x2b618c['where']=qs[_0x8073('0x44')](_[_0x8073('0x4e')](_0x2ead4e[_0x8073('0x42')],_0x96c513[_0x8073('0x44')]));if(_0x2ead4e[_0x8073('0x42')][_0x8073('0x50')]){_0x2b618c[_0x8073('0x4d')]=_[_0x8073('0x64')](_0x2b618c[_0x8073('0x4d')],{'$or':_[_0x8073('0x3c')](_0x2b618c[_0x8073('0x46')],function(_0x1fb4f7){var _0x28d761={};_0x28d761[_0x1fb4f7]={'$like':'%'+_0x2ead4e[_0x8073('0x42')][_0x8073('0x50')]+'%'};return _0x28d761;})});}_0x2b618c=_[_0x8073('0x64')]({},_0x2b618c,_0x2ead4e[_0x8073('0x51')]);return _0x3ae163[_0x8073('0x62')](_0x2b618c);}})[_0x8073('0x22')](function(_0x13a86e){if(_0x13a86e){_0x456965=_0x13a86e[_0x8073('0x48')];if(!_0x2ead4e[_0x8073('0x42')][_0x8073('0x49')](_0x8073('0x4a'))){_0x2b618c['limit']=qs[_0x8073('0x32')](_0x2ead4e[_0x8073('0x42')][_0x8073('0x32')]);_0x2b618c[_0x8073('0x31')]=qs[_0x8073('0x31')](_0x2ead4e['query'][_0x8073('0x31')]);}return _0x3ae163[_0x8073('0x62')](_0x2b618c);}})['then'](function(_0x45ea21){if(_0x45ea21){return _0x45ea21?{'count':_0x456965,'rows':_0x45ea21}:null;}})['then'](respondWithResult(_0x2b4a42,null))[_0x8073('0x2c')](handleError(_0x2b4a42,null));};exports[_0x8073('0x65')]=function(_0x2defdc,_0x1c9f39,_0x4d8166){return db[_0x8073('0x3d')][_0x8073('0x58')]({'where':{'id':_0x2defdc[_0x8073('0x57')]['id']}})[_0x8073('0x22')](handleEntityNotFound(_0x1c9f39,null))[_0x8073('0x22')](function(_0x3c1080){if(_0x3c1080){return _0x3c1080[_0x8073('0x65')](_0x2defdc['query']['ids']);}})[_0x8073('0x22')](respondWithStatusCode(_0x1c9f39,null))[_0x8073('0x2c')](handleError(_0x1c9f39,null));};exports['addMessage']=function(_0x13f946,_0x338cea,_0x34d61d){if(_0x13f946['body']['id']){delete _0x13f946['body']['id'];}return db[_0x8073('0x3d')][_0x8073('0x58')]({'where':{'id':_0x13f946[_0x8073('0x57')]['id']}})[_0x8073('0x22')](handleEntityNotFound(_0x338cea,null))[_0x8073('0x22')](function(_0x49b05c){if(_0x49b05c){_0x13f946[_0x8073('0x5a')]['ChatGroupId']=_0x49b05c['id'];return db['ChatInternalMessage'][_0x8073('0x59')](_0x13f946[_0x8073('0x5a')]);}})['then'](respondWithResult(_0x338cea,null))[_0x8073('0x2c')](handleError(_0x338cea,null));};exports[_0x8073('0x66')]=function(_0xaffa8c,_0x52038b,_0xb563f2){var _0x52c20b={};var _0x4a8238={};var _0x3be40a;var _0x46e926;return db[_0x8073('0x3d')]['findOne']({'where':{'id':_0xaffa8c[_0x8073('0x57')]['id']}})['then'](handleEntityNotFound(_0x52038b,null))[_0x8073('0x22')](function(_0x43c958){if(_0x43c958){_0x3be40a=_0x43c958;_0x4a8238[_0x8073('0x41')]=_['keys'](db[_0x8073('0x67')][_0x8073('0x3e')]);_0x4a8238[_0x8073('0x42')]=_[_0x8073('0x43')](_0xaffa8c[_0x8073('0x42')]);_0x4a8238[_0x8073('0x44')]=_['intersection'](_0x4a8238[_0x8073('0x41')],_0x4a8238[_0x8073('0x42')]);_0x52c20b[_0x8073('0x46')]=_['intersection'](_0x4a8238[_0x8073('0x41')],qs['fields'](_0xaffa8c[_0x8073('0x42')][_0x8073('0x47')]));_0x52c20b[_0x8073('0x46')]=_0x52c20b[_0x8073('0x46')][_0x8073('0x48')]?_0x52c20b[_0x8073('0x46')]:_0x4a8238['model'];_0x52c20b['order']=qs[_0x8073('0x4c')](_0xaffa8c['query']['sort']);_0x52c20b[_0x8073('0x4d')]=qs[_0x8073('0x44')](_[_0x8073('0x4e')](_0xaffa8c['query'],_0x4a8238['filters']));if(_0xaffa8c['query'][_0x8073('0x50')]){_0x52c20b[_0x8073('0x4d')]=_[_0x8073('0x64')](_0x52c20b[_0x8073('0x4d')],{'$or':_[_0x8073('0x3c')](_0x52c20b[_0x8073('0x46')],function(_0x38cfe4){var _0x12284d={};_0x12284d[_0x38cfe4]={'$like':'%'+_0xaffa8c['query'][_0x8073('0x50')]+'%'};return _0x12284d;})});}if(_0xaffa8c[_0x8073('0x42')][_0x8073('0x68')]){var _0x15bfb9=_0xaffa8c[_0x8073('0x42')][_0x8073('0x68')][_0x8073('0x69')](',');var _0x4a7c30={};_0x4a7c30[_0x15bfb9[0x0]]={'$gte':moment(_0x15bfb9[0x1])[_0x8073('0x6a')](_0x8073('0x6b'))};_0x52c20b[_0x8073('0x4d')]=_[_0x8073('0x64')](_0x52c20b['where'],_0x4a7c30);}_0x52c20b=_['merge']({},_0x52c20b,_0xaffa8c['options']);return _0x3be40a[_0x8073('0x66')](_0x52c20b);}})['then'](function(_0x92f2b8){if(_0x92f2b8){_0x46e926=_0x92f2b8[_0x8073('0x48')];if(!_0xaffa8c[_0x8073('0x42')][_0x8073('0x49')](_0x8073('0x4a'))){_0x52c20b[_0x8073('0x32')]=qs[_0x8073('0x32')](_0xaffa8c['query'][_0x8073('0x32')]);_0x52c20b['offset']=qs[_0x8073('0x31')](_0xaffa8c[_0x8073('0x42')][_0x8073('0x31')]);}return _0x3be40a['getMessages'](_0x52c20b);}})[_0x8073('0x22')](function(_0x461aa0){if(_0x461aa0){return _0x461aa0?{'count':_0x46e926,'rows':_0x461aa0}:null;}})[_0x8073('0x22')](respondWithResult(_0x52038b,null))[_0x8073('0x2c')](handleError(_0x52038b,null));}; \ No newline at end of file +var _0x0683=['addMessage','ChatGroupId','getMessages','ChatInternalMessage','$gte','split','format','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','sendStatus','status','end','count','offset','set','Content-Range','json','reject','stack','send','ChatGroup','rawAttributes','fieldName','type','key','model','name','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','VIRTUAL','field','includeAll','include','findAll','show','length','options','create','update','body','find','params','destroy','describe','getUnread','user','addMembers','ids','getMembers','findOne','User','removeMembers'];(function(_0x3ceea7,_0x130c5c){var _0x56a321=function(_0x2a168a){while(--_0x2a168a){_0x3ceea7['push'](_0x3ceea7['shift']());}};_0x56a321(++_0x130c5c);}(_0x0683,0xe1));var _0x3068=function(_0x47677f,_0x4ec253){_0x47677f=_0x47677f-0x0;var _0x14ded1=_0x0683[_0x47677f];return _0x14ded1;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x3068('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3068('0x1'));var jsonpatch=require(_0x3068('0x2'));var rp=require('request-promise');var moment=require(_0x3068('0x3'));var BPromise=require(_0x3068('0x4'));var Mustache=require(_0x3068('0x5'));var util=require(_0x3068('0x6'));var path=require(_0x3068('0x7'));var sox=require(_0x3068('0x8'));var csv=require('to-csv');var ejs=require(_0x3068('0x9'));var fs=require('fs');var _=require(_0x3068('0xa'));var squel=require('squel');var crypto=require(_0x3068('0xb'));var jsforce=require(_0x3068('0xc'));var deskjs=require(_0x3068('0xd'));var toCsv=require(_0x3068('0xe'));var querystring=require(_0x3068('0xf'));var Papa=require(_0x3068('0x10'));var Redis=require(_0x3068('0x11'));var authService=require(_0x3068('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x3068('0x13'));var hardwareService=require(_0x3068('0x14'));var logger=require(_0x3068('0x15'))(_0x3068('0x16'));var utils=require(_0x3068('0x17'));var config=require(_0x3068('0x18'));var db=require(_0x3068('0x19'))['db'];config['redis']=_[_0x3068('0x1a')](config[_0x3068('0x1b')],{'host':_0x3068('0x1c'),'port':0x18eb});var socket=require(_0x3068('0x1d'))(new Redis(config[_0x3068('0x1b')]));require('./chatGroup.socket')[_0x3068('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0x3068('0x1f')][_0x3068('0x20')]({'port':0x232a});function checkPasswordPattern(_0x475f77,_0x4c7817,_0x1d4ad8){if(_0x1d4ad8){var _0x2ef90b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2ef90b['test'](_0x4c7817)){return _0x475f77;}else{throw new Error(_0x3068('0x21'));}}else{return _0x475f77;}}function respondWithRpcPromise(_0x1af9c9,_0x512d78,_0x7822cb,_0x203c59){return new BPromise(function(_0x179201,_0xed6eae){var _0x55b018=_0x203c59||client;return _0x55b018['request'](_0x1af9c9,_0x7822cb)[_0x3068('0x22')](function(_0x2e8638){logger['info'](_0x3068('0x23'),_0x512d78,_0x3068('0x24'));logger[_0x3068('0x25')](_0x3068('0x26'),_0x512d78,_0x3068('0x24'),JSON['stringify'](_0x2e8638));if(_0x2e8638[_0x3068('0x27')]){if(_0x2e8638[_0x3068('0x27')][_0x3068('0x28')]===0x1f4){logger[_0x3068('0x27')](_0x3068('0x23'),_0x512d78,_0x2e8638['error']['message']);return _0xed6eae(_0x2e8638['error'][_0x3068('0x29')]);}logger[_0x3068('0x27')](_0x3068('0x23'),_0x512d78,_0x2e8638['error'][_0x3068('0x29')]);return _0x179201(_0x2e8638[_0x3068('0x27')][_0x3068('0x29')]);}else{logger[_0x3068('0x2a')](_0x3068('0x23'),_0x512d78,_0x3068('0x24'));_0x179201(_0x2e8638[_0x3068('0x2b')]['message']);}})[_0x3068('0x2c')](function(_0x4ac84a){logger[_0x3068('0x27')](_0x3068('0x23'),_0x512d78,_0x4ac84a);_0xed6eae(_0x4ac84a);});});}function respondWithStatusCode(_0x546771,_0x5bd7d9){_0x5bd7d9=_0x5bd7d9||0xcc;return function(_0x16cb38){if(_0x16cb38){return _0x546771[_0x3068('0x2d')](_0x5bd7d9);}return _0x546771[_0x3068('0x2e')](_0x5bd7d9)[_0x3068('0x2f')]();};}function respondWithResult(_0x2709b9,_0x209c18){_0x209c18=_0x209c18||0xc8;return function(_0x197bbc){if(_0x197bbc){return _0x2709b9[_0x3068('0x2e')](_0x209c18)['json'](_0x197bbc);}};}function respondWithFilteredResult(_0x479d1d,_0x4cd2ec){return function(_0x41bd55){if(_0x41bd55){var _0x3c9dfa=_0x41bd55[_0x3068('0x30')],_0x346d15=_0x4cd2ec[_0x3068('0x31')],_0xcde2cc=_0x4cd2ec[_0x3068('0x31')]+_0x4cd2ec['limit'],_0x45d1d2;if(_0xcde2cc>=_0x3c9dfa){_0xcde2cc=_0x3c9dfa;_0x45d1d2=0xc8;}else{_0x45d1d2=0xce;}_0x479d1d['status'](_0x45d1d2);return _0x479d1d[_0x3068('0x32')](_0x3068('0x33'),_0x346d15+'-'+_0xcde2cc+'/'+_0x3c9dfa)[_0x3068('0x34')](_0x41bd55);}return null;};}function patchUpdates(_0x170ee8){return function(_0x436697){try{jsonpatch['apply'](_0x436697,_0x170ee8,!![]);}catch(_0x39e94b){return BPromise[_0x3068('0x35')](_0x39e94b);}return _0x436697['save']();};}function saveUpdates(_0x1c05dd,_0x28005e){return function(_0x4f4872){if(_0x4f4872){return _0x4f4872['update'](_0x1c05dd)['then'](function(_0x317aa8){return _0x317aa8;});}return null;};}function removeEntity(_0xfe6094,_0x141993){return function(_0x4e1099){if(_0x4e1099){return _0x4e1099['destroy']()[_0x3068('0x22')](function(){_0xfe6094[_0x3068('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ec59a,_0x1bfb3c){return function(_0x282cdc){if(!_0x282cdc){_0x2ec59a[_0x3068('0x2d')](0x194);}return _0x282cdc;};}function handleError(_0x48fe79,_0x3a3c1c){_0x3a3c1c=_0x3a3c1c||0x1f4;return function(_0x106613){logger['error'](_0x106613[_0x3068('0x36')]);if(_0x106613['name']){delete _0x106613['name'];}_0x48fe79[_0x3068('0x2e')](_0x3a3c1c)[_0x3068('0x37')](_0x106613);};}exports['index']=function(_0x1d9507,_0x48b509){var _0x1428eb={},_0xeaca39={},_0x36fab8={'count':0x0,'rows':[]};var _0x35fb83=_['map'](db[_0x3068('0x38')][_0x3068('0x39')],function(_0x450339){return{'name':_0x450339[_0x3068('0x3a')],'type':_0x450339[_0x3068('0x3b')][_0x3068('0x3c')]};});_0xeaca39[_0x3068('0x3d')]=_['map'](_0x35fb83,_0x3068('0x3e'));_0xeaca39['query']=_[_0x3068('0x3f')](_0x1d9507[_0x3068('0x40')]);_0xeaca39[_0x3068('0x41')]=_[_0x3068('0x42')](_0xeaca39[_0x3068('0x3d')],_0xeaca39[_0x3068('0x40')]);_0x1428eb[_0x3068('0x43')]=_[_0x3068('0x42')](_0xeaca39[_0x3068('0x3d')],qs[_0x3068('0x44')](_0x1d9507['query'][_0x3068('0x44')]));_0x1428eb[_0x3068('0x43')]=_0x1428eb['attributes']['length']?_0x1428eb[_0x3068('0x43')]:_0xeaca39[_0x3068('0x3d')];if(!_0x1d9507[_0x3068('0x40')][_0x3068('0x45')](_0x3068('0x46'))){_0x1428eb[_0x3068('0x47')]=qs[_0x3068('0x47')](_0x1d9507[_0x3068('0x40')][_0x3068('0x47')]);_0x1428eb[_0x3068('0x31')]=qs[_0x3068('0x31')](_0x1d9507['query'][_0x3068('0x31')]);}_0x1428eb[_0x3068('0x48')]=qs[_0x3068('0x49')](_0x1d9507['query'][_0x3068('0x49')]);_0x1428eb[_0x3068('0x4a')]=qs[_0x3068('0x41')](_[_0x3068('0x4b')](_0x1d9507[_0x3068('0x40')],_0xeaca39[_0x3068('0x41')]));if(_0x1d9507[_0x3068('0x40')][_0x3068('0x4c')]){_0x1428eb[_0x3068('0x4a')]=_[_0x3068('0x4d')](_0x1428eb[_0x3068('0x4a')],{'$or':_[_0x3068('0x4e')](_0x35fb83,function(_0x4800e8){if(_0x4800e8[_0x3068('0x3b')][_0x3068('0x3c')]!==_0x3068('0x4f')){var _0xcc6746={};_0xcc6746[_0x4800e8[_0x3068('0x50')]]={'$like':'%'+_0x1d9507[_0x3068('0x40')][_0x3068('0x4c')]+'%'};return _0xcc6746;}})});}_0x1428eb=_['merge']({},_0x1428eb,_0x1d9507['options']);var _0x21ccad={'where':_0x1428eb[_0x3068('0x4a')]};return db[_0x3068('0x38')]['count'](_0x21ccad)[_0x3068('0x22')](function(_0xc375f3){_0x36fab8['count']=_0xc375f3;if(_0x1d9507[_0x3068('0x40')][_0x3068('0x51')]){_0x1428eb[_0x3068('0x52')]=[{'all':!![]}];}return db['ChatGroup'][_0x3068('0x53')](_0x1428eb);})['then'](function(_0xa76534){_0x36fab8['rows']=_0xa76534;return _0x36fab8;})['then'](respondWithFilteredResult(_0x48b509,_0x1428eb))[_0x3068('0x2c')](handleError(_0x48b509,null));};exports[_0x3068('0x54')]=function(_0xf06d6,_0x6612ea){var _0x4bb826={'raw':!![],'where':{'id':_0xf06d6['params']['id']}},_0x4368ba={};_0x4368ba[_0x3068('0x3d')]=_[_0x3068('0x3f')](db['ChatGroup'][_0x3068('0x39')]);_0x4368ba[_0x3068('0x40')]=_['keys'](_0xf06d6['query']);_0x4368ba[_0x3068('0x41')]=_['intersection'](_0x4368ba['model'],_0x4368ba['query']);_0x4bb826[_0x3068('0x43')]=_[_0x3068('0x42')](_0x4368ba[_0x3068('0x3d')],qs[_0x3068('0x44')](_0xf06d6[_0x3068('0x40')][_0x3068('0x44')]));_0x4bb826[_0x3068('0x43')]=_0x4bb826[_0x3068('0x43')][_0x3068('0x55')]?_0x4bb826['attributes']:_0x4368ba['model'];if(_0xf06d6[_0x3068('0x40')][_0x3068('0x51')]){_0x4bb826[_0x3068('0x52')]=[{'all':!![]}];}_0x4bb826=_[_0x3068('0x4d')]({},_0x4bb826,_0xf06d6[_0x3068('0x56')]);return db['ChatGroup']['find'](_0x4bb826)[_0x3068('0x22')](handleEntityNotFound(_0x6612ea,null))[_0x3068('0x22')](respondWithResult(_0x6612ea,null))[_0x3068('0x2c')](handleError(_0x6612ea,null));};exports[_0x3068('0x57')]=function(_0x2fa987,_0x3fc28b){return db['ChatGroup']['create'](_0x2fa987['body'],{})[_0x3068('0x22')](respondWithResult(_0x3fc28b,0xc9))[_0x3068('0x2c')](handleError(_0x3fc28b,null));};exports[_0x3068('0x58')]=function(_0x3e210a,_0x2acdd9){if(_0x3e210a['body']['id']){delete _0x3e210a[_0x3068('0x59')]['id'];}return db[_0x3068('0x38')][_0x3068('0x5a')]({'where':{'id':_0x3e210a[_0x3068('0x5b')]['id']}})[_0x3068('0x22')](handleEntityNotFound(_0x2acdd9,null))['then'](saveUpdates(_0x3e210a[_0x3068('0x59')],null))[_0x3068('0x22')](respondWithResult(_0x2acdd9,null))[_0x3068('0x2c')](handleError(_0x2acdd9,null));};exports[_0x3068('0x5c')]=function(_0xca8fa3,_0x533ac6){return db['ChatGroup'][_0x3068('0x5a')]({'where':{'id':_0xca8fa3[_0x3068('0x5b')]['id']}})[_0x3068('0x22')](handleEntityNotFound(_0x533ac6,null))[_0x3068('0x22')](removeEntity(_0x533ac6,null))[_0x3068('0x2c')](handleError(_0x533ac6,null));};exports[_0x3068('0x5d')]=function(_0x530646,_0x11ca45){return db[_0x3068('0x38')]['describe']()[_0x3068('0x22')](respondWithResult(_0x11ca45,null))[_0x3068('0x2c')](handleError(_0x11ca45,null));};exports[_0x3068('0x5e')]=function(_0x521450,_0x544f06,_0x46fd31){return db['ChatInternalMessage'][_0x3068('0x30')]({'where':{'ChatGroupId':_0x521450[_0x3068('0x5b')]['id'],'ToId':_0x521450[_0x3068('0x5f')]['id'],'read':![]}})[_0x3068('0x22')](function(_0x407093){return{'id':_['toInteger'](_0x521450[_0x3068('0x5b')]['id']),'count':_0x407093};})[_0x3068('0x22')](respondWithResult(_0x544f06,null))['catch'](handleError(_0x544f06,null));};exports[_0x3068('0x60')]=function(_0x26a0d6,_0xaa5e23,_0x4df7f7){return db[_0x3068('0x38')]['find']({'where':{'id':_0x26a0d6[_0x3068('0x5b')]['id']}})['then'](handleEntityNotFound(_0xaa5e23,null))[_0x3068('0x22')](function(_0x1eca76){if(_0x1eca76){return _0x1eca76[_0x3068('0x60')](_0x26a0d6[_0x3068('0x59')][_0x3068('0x61')],_['omit'](_0x26a0d6['body'],[_0x3068('0x61'),'id'])||{});}})[_0x3068('0x22')](respondWithResult(_0xaa5e23,null))['catch'](handleError(_0xaa5e23,null));};exports[_0x3068('0x62')]=function(_0x2d22af,_0x53ae7f,_0x4dc570){var _0x4938ed={};var _0x599ce1={};var _0x4cd769;var _0x43eba5;return db[_0x3068('0x38')][_0x3068('0x63')]({'where':{'id':_0x2d22af[_0x3068('0x5b')]['id']}})[_0x3068('0x22')](handleEntityNotFound(_0x53ae7f,null))['then'](function(_0xcc0884){if(_0xcc0884){_0x4cd769=_0xcc0884;_0x599ce1[_0x3068('0x3d')]=_[_0x3068('0x3f')](db[_0x3068('0x64')]['rawAttributes']);_0x599ce1[_0x3068('0x40')]=_[_0x3068('0x3f')](_0x2d22af['query']);_0x599ce1[_0x3068('0x41')]=_[_0x3068('0x42')](_0x599ce1[_0x3068('0x3d')],_0x599ce1[_0x3068('0x40')]);_0x4938ed[_0x3068('0x43')]=_[_0x3068('0x42')](_0x599ce1[_0x3068('0x3d')],qs[_0x3068('0x44')](_0x2d22af[_0x3068('0x40')][_0x3068('0x44')]));_0x4938ed['attributes']=_0x4938ed[_0x3068('0x43')][_0x3068('0x55')]?_0x4938ed['attributes']:_0x599ce1[_0x3068('0x3d')];_0x4938ed[_0x3068('0x48')]=qs[_0x3068('0x49')](_0x2d22af[_0x3068('0x40')][_0x3068('0x49')]);_0x4938ed[_0x3068('0x4a')]=qs[_0x3068('0x41')](_['pick'](_0x2d22af[_0x3068('0x40')],_0x599ce1[_0x3068('0x41')]));if(_0x2d22af['query'][_0x3068('0x4c')]){_0x4938ed[_0x3068('0x4a')]=_[_0x3068('0x4d')](_0x4938ed[_0x3068('0x4a')],{'$or':_['map'](_0x4938ed[_0x3068('0x43')],function(_0x22a057){var _0x23c0fb={};_0x23c0fb[_0x22a057]={'$like':'%'+_0x2d22af['query'][_0x3068('0x4c')]+'%'};return _0x23c0fb;})});}_0x4938ed=_[_0x3068('0x4d')]({},_0x4938ed,_0x2d22af[_0x3068('0x56')]);return _0x4cd769[_0x3068('0x62')](_0x4938ed);}})[_0x3068('0x22')](function(_0x1aa565){if(_0x1aa565){_0x43eba5=_0x1aa565[_0x3068('0x55')];if(!_0x2d22af[_0x3068('0x40')][_0x3068('0x45')](_0x3068('0x46'))){_0x4938ed['limit']=qs[_0x3068('0x47')](_0x2d22af[_0x3068('0x40')][_0x3068('0x47')]);_0x4938ed[_0x3068('0x31')]=qs[_0x3068('0x31')](_0x2d22af['query'][_0x3068('0x31')]);}return _0x4cd769['getMembers'](_0x4938ed);}})[_0x3068('0x22')](function(_0x6cf3cd){if(_0x6cf3cd){return _0x6cf3cd?{'count':_0x43eba5,'rows':_0x6cf3cd}:null;}})[_0x3068('0x22')](respondWithResult(_0x53ae7f,null))[_0x3068('0x2c')](handleError(_0x53ae7f,null));};exports[_0x3068('0x65')]=function(_0x2baf90,_0x4ad1b9,_0x524755){return db[_0x3068('0x38')]['find']({'where':{'id':_0x2baf90['params']['id']}})[_0x3068('0x22')](handleEntityNotFound(_0x4ad1b9,null))['then'](function(_0x4c6a98){if(_0x4c6a98){return _0x4c6a98[_0x3068('0x65')](_0x2baf90['query'][_0x3068('0x61')]);}})[_0x3068('0x22')](respondWithStatusCode(_0x4ad1b9,null))['catch'](handleError(_0x4ad1b9,null));};exports[_0x3068('0x66')]=function(_0x3f5a7b,_0x5a33ff,_0x18345a){if(_0x3f5a7b['body']['id']){delete _0x3f5a7b[_0x3068('0x59')]['id'];}return db['ChatGroup'][_0x3068('0x5a')]({'where':{'id':_0x3f5a7b[_0x3068('0x5b')]['id']}})[_0x3068('0x22')](handleEntityNotFound(_0x5a33ff,null))['then'](function(_0x1bcf22){if(_0x1bcf22){_0x3f5a7b['body'][_0x3068('0x67')]=_0x1bcf22['id'];return db['ChatInternalMessage']['create'](_0x3f5a7b[_0x3068('0x59')]);}})['then'](respondWithResult(_0x5a33ff,null))['catch'](handleError(_0x5a33ff,null));};exports[_0x3068('0x68')]=function(_0x40450b,_0x1b057a,_0x3952fc){var _0x491cf6={};var _0x473a03={};var _0x1260ba;var _0x4ad40d;return db[_0x3068('0x38')][_0x3068('0x63')]({'where':{'id':_0x40450b[_0x3068('0x5b')]['id']}})[_0x3068('0x22')](handleEntityNotFound(_0x1b057a,null))['then'](function(_0x37ceaf){if(_0x37ceaf){_0x1260ba=_0x37ceaf;_0x473a03[_0x3068('0x3d')]=_[_0x3068('0x3f')](db[_0x3068('0x69')][_0x3068('0x39')]);_0x473a03[_0x3068('0x40')]=_[_0x3068('0x3f')](_0x40450b[_0x3068('0x40')]);_0x473a03[_0x3068('0x41')]=_[_0x3068('0x42')](_0x473a03['model'],_0x473a03[_0x3068('0x40')]);_0x491cf6[_0x3068('0x43')]=_['intersection'](_0x473a03[_0x3068('0x3d')],qs[_0x3068('0x44')](_0x40450b['query'][_0x3068('0x44')]));_0x491cf6['attributes']=_0x491cf6[_0x3068('0x43')][_0x3068('0x55')]?_0x491cf6[_0x3068('0x43')]:_0x473a03[_0x3068('0x3d')];_0x491cf6[_0x3068('0x48')]=qs[_0x3068('0x49')](_0x40450b[_0x3068('0x40')][_0x3068('0x49')]);_0x491cf6[_0x3068('0x4a')]=qs[_0x3068('0x41')](_[_0x3068('0x4b')](_0x40450b[_0x3068('0x40')],_0x473a03[_0x3068('0x41')]));if(_0x40450b[_0x3068('0x40')][_0x3068('0x4c')]){_0x491cf6['where']=_[_0x3068('0x4d')](_0x491cf6[_0x3068('0x4a')],{'$or':_[_0x3068('0x4e')](_0x491cf6['attributes'],function(_0xcd0dd1){var _0x5b6492={};_0x5b6492[_0xcd0dd1]={'$like':'%'+_0x40450b[_0x3068('0x40')][_0x3068('0x4c')]+'%'};return _0x5b6492;})});}if(_0x40450b[_0x3068('0x40')][_0x3068('0x6a')]){var _0x38b2b5=_0x40450b[_0x3068('0x40')][_0x3068('0x6a')][_0x3068('0x6b')](',');var _0x116241={};_0x116241[_0x38b2b5[0x0]]={'$gte':moment(_0x38b2b5[0x1])[_0x3068('0x6c')]('YYYY-MM-DD\x20HH:mm:ss')};_0x491cf6['where']=_['merge'](_0x491cf6['where'],_0x116241);}_0x491cf6=_[_0x3068('0x4d')]({},_0x491cf6,_0x40450b[_0x3068('0x56')]);return _0x1260ba['getMessages'](_0x491cf6);}})[_0x3068('0x22')](function(_0x236be1){if(_0x236be1){_0x4ad40d=_0x236be1[_0x3068('0x55')];if(!_0x40450b[_0x3068('0x40')][_0x3068('0x45')](_0x3068('0x46'))){_0x491cf6[_0x3068('0x47')]=qs['limit'](_0x40450b[_0x3068('0x40')][_0x3068('0x47')]);_0x491cf6[_0x3068('0x31')]=qs[_0x3068('0x31')](_0x40450b[_0x3068('0x40')][_0x3068('0x31')]);}return _0x1260ba[_0x3068('0x68')](_0x491cf6);}})[_0x3068('0x22')](function(_0x41555c){if(_0x41555c){return _0x41555c?{'count':_0x4ad40d,'rows':_0x41555c}:null;}})[_0x3068('0x22')](respondWithResult(_0x1b057a,null))[_0x3068('0x2c')](handleError(_0x1b057a,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 34b7967..79312ef 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 _0xe493=['hook','exports','../../mysqldb','ChatGroup','setMaxListeners','save','emit','hasOwnProperty'];(function(_0x4d0d77,_0x5723de){var _0x56a9f4=function(_0x3dd5ab){while(--_0x3dd5ab){_0x4d0d77['push'](_0x4d0d77['shift']());}};_0x56a9f4(++_0x5723de);}(_0xe493,0x192));var _0x3e49=function(_0x3c3535,_0x7789ff){_0x3c3535=_0x3c3535-0x0;var _0x22d376=_0xe493[_0x3c3535];return _0x22d376;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x3e49('0x0'))['db'][_0x3e49('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x3e49('0x2')](0x0);var events={'afterCreate':_0x3e49('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x295df8){return function(_0x1826f6,_0x558b78,_0x39934f){ChatGroupEvents[_0x3e49('0x4')](_0x295df8+':'+_0x1826f6['id'],_0x1826f6);ChatGroupEvents[_0x3e49('0x4')](_0x295df8,_0x1826f6);_0x39934f(null);};}for(var e in events){if(events[_0x3e49('0x5')](e)){var event=events[e];ChatGroup[_0x3e49('0x6')](e,emitEvent(event));}}module[_0x3e49('0x7')]=ChatGroupEvents; \ No newline at end of file +var _0xf7e4=['hook','events','../../mysqldb','ChatGroup','setMaxListeners','emit'];(function(_0x45ce08,_0x59dcc7){var _0x23dff2=function(_0x1ad0e5){while(--_0x1ad0e5){_0x45ce08['push'](_0x45ce08['shift']());}};_0x23dff2(++_0x59dcc7);}(_0xf7e4,0x1bd));var _0x4f7e=function(_0x8cef2d,_0x3a5c6c){_0x8cef2d=_0x8cef2d-0x0;var _0x1cb597=_0xf7e4[_0x8cef2d];return _0x1cb597;};'use strict';var EventEmitter=require(_0x4f7e('0x0'));var ChatGroup=require(_0x4f7e('0x1'))['db'][_0x4f7e('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x4f7e('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x32f4ce){return function(_0x53ac4b,_0x41e26a,_0x1d4edd){ChatGroupEvents[_0x4f7e('0x4')](_0x32f4ce+':'+_0x53ac4b['id'],_0x53ac4b);ChatGroupEvents['emit'](_0x32f4ce,_0x53ac4b);_0x1d4edd(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x4f7e('0x5')](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 8dee79d..4ef11e1 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 _0x5e11=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','ChatGroup'];(function(_0x496926,_0x2130a1){var _0x337701=function(_0xce62a1){while(--_0xce62a1){_0x496926['push'](_0x496926['shift']());}};_0x337701(++_0x2130a1);}(_0x5e11,0x1c3));var _0x15e1=function(_0x20cf8a,_0x44cd6b){_0x20cf8a=_0x20cf8a-0x0;var _0x54e165=_0x5e11[_0x20cf8a];return _0x54e165;};'use strict';var _=require(_0x15e1('0x0'));var util=require('util');var logger=require(_0x15e1('0x1'))(_0x15e1('0x2'));var moment=require(_0x15e1('0x3'));var BPromise=require(_0x15e1('0x4'));var rp=require(_0x15e1('0x5'));var fs=require('fs');var path=require(_0x15e1('0x6'));var rimraf=require('rimraf');var config=require(_0x15e1('0x7'));var attributes=require('./chatGroup.attributes');module[_0x15e1('0x8')]=function(_0x41b56c,_0xa0d783){return _0x41b56c[_0x15e1('0x9')](_0x15e1('0xa'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6726=['../../config/logger','moment','bluebird','path','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','util'];(function(_0x53a72c,_0xc9f802){var _0x56b41b=function(_0x354562){while(--_0x354562){_0x53a72c['push'](_0x53a72c['shift']());}};_0x56b41b(++_0xc9f802);}(_0x6726,0xdb));var _0x6672=function(_0x3acee8,_0x5f3924){_0x3acee8=_0x3acee8-0x0;var _0x5046cc=_0x6726[_0x3acee8];return _0x5046cc;};'use strict';var _=require('lodash');var util=require(_0x6672('0x0'));var logger=require(_0x6672('0x1'))('api');var moment=require(_0x6672('0x2'));var BPromise=require(_0x6672('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6672('0x4'));var rimraf=require('rimraf');var config=require(_0x6672('0x5'));var attributes=require(_0x6672('0x6'));module[_0x6672('0x7')]=function(_0x40ba7e,_0x5701b9){return _0x40ba7e[_0x6672('0x8')](_0x6672('0x9'),attributes,{'tableName':_0x6672('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js index 13f6cf0..1d0ea85 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 _0x435d=['info','ChatGroup,\x20%s,\x20%s','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','socket.io-emitter','./chatGroup.socket','register','request'];(function(_0x2de91a,_0x542708){var _0x49d0b8=function(_0x2e4bcf){while(--_0x2e4bcf){_0x2de91a['push'](_0x2de91a['shift']());}};_0x49d0b8(++_0x542708);}(_0x435d,0x1e4));var _0xd435=function(_0x386a5c,_0x41fdad){_0x386a5c=_0x386a5c-0x0;var _0x2bec7f=_0x435d[_0x386a5c];return _0x2bec7f;};'use strict';var _=require(_0xd435('0x0'));var util=require('util');var moment=require(_0xd435('0x1'));var BPromise=require(_0xd435('0x2'));var rs=require(_0xd435('0x3'));var fs=require('fs');var Redis=require(_0xd435('0x4'));var db=require(_0xd435('0x5'))['db'];var utils=require(_0xd435('0x6'));var logger=require(_0xd435('0x7'))(_0xd435('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd435('0x9')][_0xd435('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0xd435('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xd435('0xc'))(new Redis(config[_0xd435('0xb')]));require(_0xd435('0xd'))[_0xd435('0xe')](socket);function respondWithRpcPromise(_0x5d91b8,_0x1ba164,_0x4ed600){return new BPromise(function(_0x44c442,_0x2b96bb){return client[_0xd435('0xf')](_0x5d91b8,_0x4ed600)['then'](function(_0x2d34da){logger[_0xd435('0x10')](_0xd435('0x11'),_0x1ba164,'request\x20sent');logger[_0xd435('0x12')](_0xd435('0x13'),_0x1ba164,'request\x20sent',JSON[_0xd435('0x14')](_0x2d34da));if(_0x2d34da[_0xd435('0x15')]){if(_0x2d34da[_0xd435('0x15')]['code']===0x1f4){logger[_0xd435('0x15')](_0xd435('0x11'),_0x1ba164,_0x2d34da['error']['message']);return _0x2b96bb(_0x2d34da[_0xd435('0x15')][_0xd435('0x16')]);}logger[_0xd435('0x15')]('ChatGroup,\x20%s,\x20%s',_0x1ba164,_0x2d34da[_0xd435('0x15')]['message']);return _0x44c442(_0x2d34da[_0xd435('0x15')]['message']);}else{logger['info'](_0xd435('0x11'),_0x1ba164,_0xd435('0x17'));_0x44c442(_0x2d34da['result'][_0xd435('0x16')]);}})[_0xd435('0x18')](function(_0x4eaaad){logger[_0xd435('0x15')](_0xd435('0x11'),_0x1ba164,_0x4eaaad);_0x2b96bb(_0x4eaaad);});});} \ No newline at end of file +var _0x6596=['ChatGroup,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','request','then','info','debug','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x34c034,_0x1fd53d){var _0x34b080=function(_0x42e647){while(--_0x42e647){_0x34c034['push'](_0x34c034['shift']());}};_0x34b080(++_0x1fd53d);}(_0x6596,0x86));var _0x6659=function(_0x50e01e,_0x4eb6b0){_0x50e01e=_0x50e01e-0x0;var _0x123147=_0x6596[_0x50e01e];return _0x123147;};'use strict';var _=require(_0x6659('0x0'));var util=require(_0x6659('0x1'));var moment=require('moment');var BPromise=require(_0x6659('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6659('0x3'));var db=require(_0x6659('0x4'))['db'];var utils=require(_0x6659('0x5'));var logger=require(_0x6659('0x6'))(_0x6659('0x7'));var config=require(_0x6659('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6659('0x9')][_0x6659('0xa')]({'port':0x232a});config[_0x6659('0xb')]=_[_0x6659('0xc')](config[_0x6659('0xb')],{'host':_0x6659('0xd'),'port':0x18eb});var socket=require(_0x6659('0xe'))(new Redis(config[_0x6659('0xb')]));require('./chatGroup.socket')['register'](socket);function respondWithRpcPromise(_0x4d7fd2,_0x2ac572,_0x3fe585){return new BPromise(function(_0x2b5b9a,_0x4d9c8c){return client[_0x6659('0xf')](_0x4d7fd2,_0x3fe585)[_0x6659('0x10')](function(_0x2bc732){logger[_0x6659('0x11')]('ChatGroup,\x20%s,\x20%s',_0x2ac572,'request\x20sent');logger[_0x6659('0x12')](_0x6659('0x13'),_0x2ac572,_0x6659('0x14'),JSON['stringify'](_0x2bc732));if(_0x2bc732[_0x6659('0x15')]){if(_0x2bc732[_0x6659('0x15')]['code']===0x1f4){logger['error'](_0x6659('0x16'),_0x2ac572,_0x2bc732['error'][_0x6659('0x17')]);return _0x4d9c8c(_0x2bc732['error'][_0x6659('0x17')]);}logger['error']('ChatGroup,\x20%s,\x20%s',_0x2ac572,_0x2bc732[_0x6659('0x15')][_0x6659('0x17')]);return _0x2b5b9a(_0x2bc732[_0x6659('0x15')]['message']);}else{logger[_0x6659('0x11')]('ChatGroup,\x20%s,\x20%s',_0x2ac572,_0x6659('0x14'));_0x2b5b9a(_0x2bc732[_0x6659('0x18')][_0x6659('0x17')]);}})[_0x6659('0x19')](function(_0xd1a453){logger['error']('ChatGroup,\x20%s,\x20%s',_0x2ac572,_0xd1a453);_0x4d9c8c(_0xd1a453);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index dd1ebf9..797a4c9 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 _0xc852=['./chatGroup.events','save','emit','removeListener'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0xc852,0xc8));var _0x2c85=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc852[_0x14add3];return _0x4a174f;};'use strict';var ChatGroupEvents=require(_0x2c85('0x0'));var events=[_0x2c85('0x1'),'remove','update'];function createListener(_0x37514f,_0x334845){return function(_0x2ab237){_0x334845[_0x2c85('0x2')](_0x37514f,_0x2ab237);};}function removeListener(_0x58f9a0,_0x3b0748){return function(){ChatGroupEvents[_0x2c85('0x3')](_0x58f9a0,_0x3b0748);};}exports['register']=function(_0x51fae4){for(var _0x3a478b=0x0,_0x274246=events['length'];_0x3a478b<_0x274246;_0x3a478b++){var _0x2f3034=events[_0x3a478b];var _0x145c72=createListener('chatGroup:'+_0x2f3034,_0x51fae4);ChatGroupEvents['on'](_0x2f3034,_0x145c72);}}; \ No newline at end of file +var _0x2805=['length','chatGroup:','./chatGroup.events','remove','update','emit'];(function(_0x1a397a,_0x27201a){var _0x1eab9e=function(_0x1cbd61){while(--_0x1cbd61){_0x1a397a['push'](_0x1a397a['shift']());}};_0x1eab9e(++_0x27201a);}(_0x2805,0x86));var _0x5280=function(_0x49d41c,_0x2bdc35){_0x49d41c=_0x49d41c-0x0;var _0xb64c5f=_0x2805[_0x49d41c];return _0xb64c5f;};'use strict';var ChatGroupEvents=require(_0x5280('0x0'));var events=['save',_0x5280('0x1'),_0x5280('0x2')];function createListener(_0x35ccd7,_0x14aa09){return function(_0x124060){_0x14aa09[_0x5280('0x3')](_0x35ccd7,_0x124060);};}function removeListener(_0x53af93,_0x48df52){return function(){ChatGroupEvents['removeListener'](_0x53af93,_0x48df52);};}exports['register']=function(_0x3f9013){for(var _0x7ebc50=0x0,_0x1f7fc5=events[_0x5280('0x4')];_0x7ebc50<_0x1f7fc5;_0x7ebc50++){var _0x3b82ad=events[_0x7ebc50];var _0x2b4f8b=createListener(_0x5280('0x5')+_0x3b82ad,_0x3f9013);ChatGroupEvents['on'](_0x3b82ad,_0x2b4f8b);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 86b8fcc..e73977b 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 _0xd565=['update','delete','/:id','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','/:id/unread','/:id/members','getMembers','getMessages','post','create','/:id/messages','addMessage','put'];(function(_0x3d2012,_0x3d02b9){var _0x53d542=function(_0x8f2be8){while(--_0x8f2be8){_0x3d2012['push'](_0x3d2012['shift']());}};_0x53d542(++_0x3d02b9);}(_0xd565,0xa6));var _0x5d56=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xd565[_0xfae23b];return _0x200640;};'use strict';var multer=require(_0x5d56('0x0'));var util=require(_0x5d56('0x1'));var path=require(_0x5d56('0x2'));var timeout=require('connect-timeout');var express=require(_0x5d56('0x3'));var router=express[_0x5d56('0x4')]();var auth=require(_0x5d56('0x5'));var interaction=require(_0x5d56('0x6'));var config=require(_0x5d56('0x7'));var controller=require(_0x5d56('0x8'));router[_0x5d56('0x9')]('/',auth[_0x5d56('0xa')](),controller[_0x5d56('0xb')]);router[_0x5d56('0x9')](_0x5d56('0xc'),auth[_0x5d56('0xa')](),controller[_0x5d56('0xd')]);router[_0x5d56('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0x5d56('0xe'),auth['isAuthenticated'](),controller['getUnread']);router[_0x5d56('0x9')](_0x5d56('0xf'),auth[_0x5d56('0xa')](),controller[_0x5d56('0x10')]);router['get']('/:id/messages',auth[_0x5d56('0xa')](),controller[_0x5d56('0x11')]);router[_0x5d56('0x12')]('/',auth[_0x5d56('0xa')](),controller[_0x5d56('0x13')]);router[_0x5d56('0x12')](_0x5d56('0xf'),auth[_0x5d56('0xa')](),controller['addMembers']);router['post'](_0x5d56('0x14'),auth[_0x5d56('0xa')](),controller[_0x5d56('0x15')]);router[_0x5d56('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x5d56('0x17')]);router[_0x5d56('0x18')](_0x5d56('0x19'),auth[_0x5d56('0xa')](),controller['destroy']);router[_0x5d56('0x18')](_0x5d56('0xf'),auth['isAuthenticated'](),controller['removeMembers']);module[_0x5d56('0x1a')]=router; \ No newline at end of file +var _0x46d2=['path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','/:id','show','/:id/unread','getUnread','/:id/members','/:id/messages','getMessages','create','post','addMembers','addMessage','put','update','delete','multer'];(function(_0x355ce8,_0x5f1d0a){var _0x1db8b8=function(_0x277eb2){while(--_0x277eb2){_0x355ce8['push'](_0x355ce8['shift']());}};_0x1db8b8(++_0x5f1d0a);}(_0x46d2,0xef));var _0x246d=function(_0x57e0c6,_0x30a1b3){_0x57e0c6=_0x57e0c6-0x0;var _0x376683=_0x46d2[_0x57e0c6];return _0x376683;};'use strict';var multer=require(_0x246d('0x0'));var util=require('util');var path=require(_0x246d('0x1'));var timeout=require(_0x246d('0x2'));var express=require(_0x246d('0x3'));var router=express[_0x246d('0x4')]();var auth=require(_0x246d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x246d('0x6'));var controller=require(_0x246d('0x7'));router[_0x246d('0x8')]('/',auth[_0x246d('0x9')](),controller['index']);router[_0x246d('0x8')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0x246d('0xa'),auth[_0x246d('0x9')](),controller[_0x246d('0xb')]);router[_0x246d('0x8')](_0x246d('0xc'),auth[_0x246d('0x9')](),controller[_0x246d('0xd')]);router[_0x246d('0x8')](_0x246d('0xe'),auth[_0x246d('0x9')](),controller['getMembers']);router[_0x246d('0x8')](_0x246d('0xf'),auth[_0x246d('0x9')](),controller[_0x246d('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x246d('0x11')]);router[_0x246d('0x12')]('/:id/members',auth[_0x246d('0x9')](),controller[_0x246d('0x13')]);router[_0x246d('0x12')]('/:id/messages',auth[_0x246d('0x9')](),controller[_0x246d('0x14')]);router[_0x246d('0x15')](_0x246d('0xa'),auth[_0x246d('0x9')](),controller[_0x246d('0x16')]);router[_0x246d('0x17')](_0x246d('0xa'),auth['isAuthenticated'](),controller['destroy']);router[_0x246d('0x17')](_0x246d('0xe'),auth[_0x246d('0x9')](),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 9c64056..fe93c1e 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 _0x3fc6=['STRING','long','DATE','out','sequelize','exports','BOOLEAN','ENUM','star','thumb','TEXT'];(function(_0x54417c,_0x155f01){var _0x1462c0=function(_0x5d8c0f){while(--_0x5d8c0f){_0x54417c['push'](_0x54417c['shift']());}};_0x1462c0(++_0x155f01);}(_0x3fc6,0x159));var _0x63fc=function(_0x3fe9c3,_0x3d7996){_0x3fe9c3=_0x3fe9c3-0x0;var _0x4a5d2f=_0x3fc6[_0x3fe9c3];return _0x4a5d2f;};'use strict';var Sequelize=require(_0x63fc('0x0'));module[_0x63fc('0x1')]={'closed':{'type':Sequelize[_0x63fc('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0x63fc('0x3')](_0x63fc('0x4'),_0x63fc('0x5')),'defaultValue':_0x63fc('0x4')},'ratingMessage':{'type':Sequelize[_0x63fc('0x6')]},'pathTranscript':{'type':Sequelize[_0x63fc('0x6')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x63fc('0x7')]},'note':{'type':Sequelize[_0x63fc('0x7')]},'browserName':{'type':Sequelize[_0x63fc('0x7')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x63fc('0x7')]},'osVersion':{'type':Sequelize[_0x63fc('0x7')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x63fc('0x7')]},'deviceType':{'type':Sequelize[_0x63fc('0x7')]},'referer':{'type':Sequelize[_0x63fc('0x6')]},'customerIp':{'type':Sequelize[_0x63fc('0x7')]},'formData':{'type':Sequelize[_0x63fc('0x6')](_0x63fc('0x8'))},'read1stAt':{'type':Sequelize[_0x63fc('0x9')]},'lastMsgAt':{'type':Sequelize[_0x63fc('0x9')]},'lastMsgDirection':{'type':Sequelize[_0x63fc('0x3')]('in',_0x63fc('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x63fc('0x7')]}}; \ No newline at end of file +var _0x96e0=['star','thumb','TEXT','STRING','DATE','ENUM','sequelize','BOOLEAN'];(function(_0x12aa02,_0x116599){var _0x3deddd=function(_0x589861){while(--_0x589861){_0x12aa02['push'](_0x12aa02['shift']());}};_0x3deddd(++_0x116599);}(_0x96e0,0x7e));var _0x096e=function(_0x305b74,_0x4ac6b7){_0x305b74=_0x305b74-0x0;var _0x57f623=_0x96e0[_0x305b74];return _0x57f623;};'use strict';var Sequelize=require(_0x096e('0x0'));module['exports']={'closed':{'type':Sequelize[_0x096e('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize['ENUM'](_0x096e('0x2'),_0x096e('0x3')),'defaultValue':_0x096e('0x2')},'ratingMessage':{'type':Sequelize[_0x096e('0x4')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x096e('0x5')]},'note':{'type':Sequelize[_0x096e('0x5')]},'browserName':{'type':Sequelize[_0x096e('0x5')]},'browserVersion':{'type':Sequelize[_0x096e('0x5')]},'osName':{'type':Sequelize[_0x096e('0x5')]},'osVersion':{'type':Sequelize[_0x096e('0x5')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x096e('0x5')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x096e('0x4')]},'customerIp':{'type':Sequelize[_0x096e('0x5')]},'formData':{'type':Sequelize[_0x096e('0x4')]('long')},'read1stAt':{'type':Sequelize[_0x096e('0x6')]},'lastMsgAt':{'type':Sequelize[_0x096e('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x096e('0x7')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x096e('0x5')]},'customerPort':{'type':Sequelize[_0x096e('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 07312f0..ab26c7a 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 _0x2f8e=['includeAgent','addTags','spread','Tag','chatInteractionTags:save','removeTags','unix','files','tmp','attachments','transcript-%d-%s.zip','Contact','lastName','Owner','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','Chat','mkdirSync','Account','N.A.','closedAt','osName','customerIp','customerPort','existsSync','createReadStream','pipe','createWriteStream','out','firstName','renderFile','server','views','downloadInteraction.html','toFile','transcript-','.pdf','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','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~!@#$%^&-_=+[{]}.','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','status','end','offset','set','Content-Range','json','reject','save','update','destroy','sendStatus','stack','name','Users','map','Tags','TagIds','split','forEach','push','index','ChatInteraction','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','select','field','color','from','tools_tags','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','ContactId','buildExpression','text','start','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','keys','filter','isNil','isEmpty','ChatWebsiteId','concat','createdAt','parse','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','isArray','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','isNumeric','i.id\x20LIKE\x20?','toString','join','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','Sequelize','QueryTypes','SELECT','clone','i.id','t.id\x20IN\x20?','sequelize','count','keyBy','merge','Account.mandatoryDisposition','i.*','c.lastName','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','show','params','includeAll','include','options','create','body','describe','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','ValidationError','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','basename','file','filename','mimetype','Attachment','attachmentDownload','findOne','Unauthorized','attachId','download','root','server/files/attachments/','close','server/files/chat/upload/','format','now','pathTranscript','ChatMessage','Messages','ChatWebsite','CmContact','System','customer','Visitor','agentIdentifier','website_alias','agentAlias','agent_alias','alias','fullname','%s%d','[%s]\x20%s:\x20%s\x0a','direction','secret','appendFileSync','MailAccount','Smtp','service','port','secure','auth','user','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','mailTranscript','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','pick','$gte','YYYY-MM-DD\x20HH:mm:ss','findAll','getMyMessages'];(function(_0x524b2a,_0x13e281){var _0x176cc5=function(_0x5c9851){while(--_0x5c9851){_0x524b2a['push'](_0x524b2a['shift']());}};_0x176cc5(++_0x13e281);}(_0x2f8e,0x14d));var _0xe2f8=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x2f8e[_0x1facfa];return _0x9ec701;};'use strict';var pdf=require(_0xe2f8('0x0'));var emlformat=require(_0xe2f8('0x1'));var rimraf=require(_0xe2f8('0x2'));var zipdir=require(_0xe2f8('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe2f8('0x4'));var moment=require(_0xe2f8('0x5'));var BPromise=require(_0xe2f8('0x6'));var Mustache=require(_0xe2f8('0x7'));var util=require('util');var path=require(_0xe2f8('0x8'));var sox=require(_0xe2f8('0x9'));var csv=require('to-csv');var ejs=require(_0xe2f8('0xa'));var fs=require('fs');var _=require(_0xe2f8('0xb'));var squel=require(_0xe2f8('0xc'));var crypto=require(_0xe2f8('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xe2f8('0xe'));var toCsv=require('to-csv');var querystring=require(_0xe2f8('0xf'));var Papa=require('papaparse');var Redis=require(_0xe2f8('0x10'));var authService=require(_0xe2f8('0x11'));var qs=require(_0xe2f8('0x12'));var as=require(_0xe2f8('0x13'));var hardwareService=require(_0xe2f8('0x14'));var logger=require('../../config/logger')(_0xe2f8('0x15'));var utils=require('../../config/utils');var config=require(_0xe2f8('0x16'));var db=require(_0xe2f8('0x17'))['db'];config[_0xe2f8('0x18')]=_[_0xe2f8('0x19')](config['redis'],{'host':_0xe2f8('0x1a'),'port':0x18eb});var socket=require(_0xe2f8('0x1b'))(new Redis(config[_0xe2f8('0x18')]));require('./chatInteraction.socket')[_0xe2f8('0x1c')](socket);var jayson=require(_0xe2f8('0x1d'));var client=jayson[_0xe2f8('0x1e')][_0xe2f8('0x1f')]({'port':0x232b});var client9004=jayson[_0xe2f8('0x1e')][_0xe2f8('0x1f')]({'port':0x232c});function checkPasswordPattern(_0x3ef99a,_0xca33c4,_0x3cc6d8){if(_0x3cc6d8){var _0x25f1a7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x25f1a7['test'](_0xca33c4)){return _0x3ef99a;}else{throw new Error(_0xe2f8('0x20'));}}else{return _0x3ef99a;}}function respondWithRpcPromise(_0x5de415,_0x567a2e,_0x6693e2,_0x3f9493){return new BPromise(function(_0x3155ae,_0x27e153){var _0x18106b=_0x3f9493||client;return _0x18106b['request'](_0x5de415,_0x6693e2)[_0xe2f8('0x21')](function(_0x383050){logger[_0xe2f8('0x22')](_0xe2f8('0x23'),_0x567a2e,_0xe2f8('0x24'));logger[_0xe2f8('0x25')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x567a2e,_0xe2f8('0x24'),JSON[_0xe2f8('0x26')](_0x383050));if(_0x383050[_0xe2f8('0x27')]){if(_0x383050[_0xe2f8('0x27')][_0xe2f8('0x28')]===0x1f4){logger['error'](_0xe2f8('0x23'),_0x567a2e,_0x383050[_0xe2f8('0x27')][_0xe2f8('0x29')]);return _0x27e153(_0x383050['error'][_0xe2f8('0x29')]);}logger[_0xe2f8('0x27')](_0xe2f8('0x23'),_0x567a2e,_0x383050['error'][_0xe2f8('0x29')]);return _0x3155ae(_0x383050[_0xe2f8('0x27')]['message']);}else{logger['info'](_0xe2f8('0x23'),_0x567a2e,'request\x20sent');_0x3155ae(_0x383050['result']['message']);}})[_0xe2f8('0x2a')](function(_0xe3388e){logger[_0xe2f8('0x27')](_0xe2f8('0x23'),_0x567a2e,_0xe3388e);_0x27e153(_0xe3388e);});});}function respondWithStatusCode(_0x222d24,_0x7a78ba){_0x7a78ba=_0x7a78ba||0xcc;return function(_0x2966db){if(_0x2966db){return _0x222d24['sendStatus'](_0x7a78ba);}return _0x222d24[_0xe2f8('0x2b')](_0x7a78ba)[_0xe2f8('0x2c')]();};}function respondWithResult(_0x1b2fb7,_0x5de0df){_0x5de0df=_0x5de0df||0xc8;return function(_0x4114cb){if(_0x4114cb){return _0x1b2fb7[_0xe2f8('0x2b')](_0x5de0df)['json'](_0x4114cb);}};}function respondWithFilteredResult(_0x5eb611,_0x25cf83){return function(_0x40f9ef){if(_0x40f9ef){var _0x86c6c1=_0x40f9ef['count'],_0x3d44ec=_0x25cf83[_0xe2f8('0x2d')],_0x13f832=_0x25cf83[_0xe2f8('0x2d')]+_0x25cf83['limit'],_0x26ec72;if(_0x13f832>=_0x86c6c1){_0x13f832=_0x86c6c1;_0x26ec72=0xc8;}else{_0x26ec72=0xce;}_0x5eb611[_0xe2f8('0x2b')](_0x26ec72);return _0x5eb611[_0xe2f8('0x2e')](_0xe2f8('0x2f'),_0x3d44ec+'-'+_0x13f832+'/'+_0x86c6c1)[_0xe2f8('0x30')](_0x40f9ef);}return null;};}function patchUpdates(_0x1f0f15){return function(_0x58d281){try{jsonpatch['apply'](_0x58d281,_0x1f0f15,!![]);}catch(_0x28f4ad){return BPromise[_0xe2f8('0x31')](_0x28f4ad);}return _0x58d281[_0xe2f8('0x32')]();};}function saveUpdates(_0x3012c4,_0xdb7bd8){return function(_0x428e6b){if(_0x428e6b){return _0x428e6b[_0xe2f8('0x33')](_0x3012c4)[_0xe2f8('0x21')](function(_0x5c1d4a){return _0x5c1d4a;});}return null;};}function removeEntity(_0x513f5c,_0x4fd620){return function(_0x5defdf){if(_0x5defdf){return _0x5defdf[_0xe2f8('0x34')]()[_0xe2f8('0x21')](function(){_0x513f5c[_0xe2f8('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x426c3f,_0x14a8d7){return function(_0x279eab){if(!_0x279eab){_0x426c3f[_0xe2f8('0x35')](0x194);}return _0x279eab;};}function handleError(_0x583cd3,_0x18cf73){_0x18cf73=_0x18cf73||0x1f4;return function(_0x298ec1){logger[_0xe2f8('0x27')](_0x298ec1[_0xe2f8('0x36')]);if(_0x298ec1[_0xe2f8('0x37')]){delete _0x298ec1['name'];}_0x583cd3['status'](_0x18cf73)['send'](_0x298ec1);};}function getInteractionUsers(_0x41f1f3,_0x4b0d56){return new BPromise(function(_0x38f703,_0x10c75e){try{if(_0x4b0d56[_0x41f1f3['id']]){_0x41f1f3[_0xe2f8('0x38')]=_[_0xe2f8('0x39')](_0x4b0d56[_0x41f1f3['id']],function(_0x363c48){return{'id':_0x363c48['id']};});}}catch(_0x4a72b3){_0x10c75e(_0x4a72b3);}_0x38f703(_0x41f1f3);});}function getInteractionTags(_0x397a79,_0x35f0b9){return new BPromise(function(_0x5634ce,_0x15e899){try{if(_0x397a79['TagIds']){_0x397a79[_0xe2f8('0x3a')]=[];_0x397a79[_0xe2f8('0x3b')][_0xe2f8('0x3c')](',')[_0xe2f8('0x3d')](function(_0x4ae6ec){_0x397a79[_0xe2f8('0x3a')][_0xe2f8('0x3e')](_0x35f0b9[_0x4ae6ec]);});}delete _0x397a79[_0xe2f8('0x3b')];}catch(_0x1350db){_0x15e899(_0x1350db);}_0x5634ce(_0x397a79);});}function updateChatInteraction(_0x347e44,_0xef8916,_0x3b3d6d){return new BPromise(function(_0x4f7e0e,_0x572eb2){return getInteractionUsers(_0x347e44,_0x3b3d6d)['then'](function(_0x3fa879){return getInteractionTags(_0x3fa879,_0xef8916);})[_0xe2f8('0x21')](function(_0x25a619){_0x4f7e0e(_0x25a619);})[_0xe2f8('0x2a')](function(_0x676fbb){_0x572eb2(_0x676fbb);});});}exports[_0xe2f8('0x3f')]=function(_0x2c5765,_0x121078){var _0x1ddb67={},_0x954a0={},_0x260397={'count':0x0,'rows':[]};var _0x3f6416=_['map'](db[_0xe2f8('0x40')][_0xe2f8('0x41')],function(_0xacdbec){return{'name':_0xacdbec[_0xe2f8('0x42')],'type':_0xacdbec[_0xe2f8('0x43')][_0xe2f8('0x44')]};});_0x954a0['model']=_[_0xe2f8('0x39')](_0x3f6416,'name');_0x954a0[_0xe2f8('0x45')]=_['keys'](_0x2c5765['query']);_0x954a0[_0xe2f8('0x46')]=_[_0xe2f8('0x47')](_0x954a0['model'],_0x954a0[_0xe2f8('0x45')]);_0x1ddb67[_0xe2f8('0x48')]=_[_0xe2f8('0x47')](_0x954a0[_0xe2f8('0x49')],qs[_0xe2f8('0x4a')](_0x2c5765['query'][_0xe2f8('0x4a')]));_0x1ddb67[_0xe2f8('0x48')]=_0x1ddb67[_0xe2f8('0x48')][_0xe2f8('0x4b')]?_0x1ddb67['attributes']:_0x954a0[_0xe2f8('0x49')];if(!_0x2c5765['query'][_0xe2f8('0x4c')](_0xe2f8('0x4d'))){_0x1ddb67['limit']=qs['limit'](_0x2c5765[_0xe2f8('0x45')][_0xe2f8('0x4e')]);_0x1ddb67['offset']=qs[_0xe2f8('0x2d')](_0x2c5765[_0xe2f8('0x45')][_0xe2f8('0x2d')]);}_0x1ddb67[_0xe2f8('0x4f')]=qs[_0xe2f8('0x50')](_0x2c5765[_0xe2f8('0x45')][_0xe2f8('0x50')]);_0x1ddb67[_0xe2f8('0x51')]=qs['filters'](_['pick'](_0x2c5765[_0xe2f8('0x45')],_0x954a0[_0xe2f8('0x46')]));var _0x4446b7=[];var _0x4da377=squel[_0xe2f8('0x52')]()[_0xe2f8('0x53')]('id')[_0xe2f8('0x53')](_0xe2f8('0x37'))['field'](_0xe2f8('0x54'))[_0xe2f8('0x55')](_0xe2f8('0x56'));var _0x14fcff=squel[_0xe2f8('0x52')]()[_0xe2f8('0x53')]('u.id')['field'](_0xe2f8('0x57'))[_0xe2f8('0x55')](_0xe2f8('0x58'),'ui')[_0xe2f8('0x59')](_0xe2f8('0x5a'),'u',_0xe2f8('0x5b'));var _0xcc69e0=squel[_0xe2f8('0x52')]()[_0xe2f8('0x55')]('chat_interactions','i')['left_join'](_0xe2f8('0x5c'),'c',_0xe2f8('0x5d'))[_0xe2f8('0x59')]('users','o',_0xe2f8('0x5e'))[_0xe2f8('0x59')]('chat_websites','a',_0xe2f8('0x5f'))[_0xe2f8('0x59')](_0xe2f8('0x60'),'me',_0xe2f8('0x61'))[_0xe2f8('0x59')](_0xe2f8('0x62'),'it',_0xe2f8('0x63'))[_0xe2f8('0x59')](_0xe2f8('0x56'),'t',_0xe2f8('0x64'));var _0x2d6176=squel[_0xe2f8('0x65')]();var _0x59d472=[];var _0x19e610=squel[_0xe2f8('0x65')]();if(_0x2c5765[_0xe2f8('0x45')][_0xe2f8('0x66')]){var _0x519417=as[_0xe2f8('0x67')](_0x2c5765[_0xe2f8('0x45')][_0xe2f8('0x66')]);var _0x2d8eb3=_0x519417[_0xe2f8('0x68')];for(var _0x1860cf=0x0;_0x1860cf<_0x519417['conditions'][_0xe2f8('0x4b')];_0x1860cf++){var _0x1c066c=_0x519417[_0xe2f8('0x69')][_0x1860cf];var _0x524eff='i';var _0x38d8c7=_[_0xe2f8('0x6a')](_0x3f6416,['name',_0x1c066c[_0xe2f8('0x53')]]);if(!_0x38d8c7){switch(_0x1c066c[_0xe2f8('0x53')]){case _0xe2f8('0x6b'):if(_0x1c066c[_0xe2f8('0x6c')]==0x1){_0xcc69e0['having']('`'+_0x1c066c[_0xe2f8('0x53')]+_0xe2f8('0x6d'));}else{_0xcc69e0[_0xe2f8('0x6e')]('`'+_0x1c066c[_0xe2f8('0x53')]+_0xe2f8('0x6f'));}break;case'Contact':if(_0x1c066c[_0xe2f8('0x70')]===_0xe2f8('0x71')){_0x2d6176[_0x2d8eb3](_0xe2f8('0x72'),_0x1c066c[_0xe2f8('0x6c')],null);}else{_0x38d8c7=_[_0xe2f8('0x6a')](_0x3f6416,[_0xe2f8('0x37'),_0xe2f8('0x73')]);_0x1c066c[_0xe2f8('0x53')]=_0xe2f8('0x73');_0x4cadd1=as[_0xe2f8('0x74')](_0x524eff,_0x38d8c7['type'],_0x1c066c);_0x2d6176[_0x2d8eb3](_0x4cadd1[_0xe2f8('0x75')],_0x4cadd1[_0xe2f8('0x6c')][_0xe2f8('0x76')],_0x4cadd1[_0xe2f8('0x6c')][_0xe2f8('0x2c')]);}break;case'Tag':var _0x110b6d=_0x1c066c[_0xe2f8('0x6c')]['split'](',')[_0xe2f8('0x39')](function(_0x75dd8a){return Number(_0x75dd8a);});_0x110b6d[_0xe2f8('0x3d')](function(_0x153581){_0x19e610['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x153581+',%');});_0x59d472=_[_0xe2f8('0x77')](_0x59d472,_0x110b6d);break;case _0xe2f8('0x78'):if(_0x1c066c[_0xe2f8('0x70')]===_0xe2f8('0x71')){_0x2d6176[_0x2d8eb3](_0xe2f8('0x79'),'%'+_0x1c066c[_0xe2f8('0x6c')]+'%',null);}else{_0x38d8c7=_[_0xe2f8('0x6a')](_0x3f6416,[_0xe2f8('0x37'),_0xe2f8('0x7a')]);_0x1c066c['field']='UserId';_0x4cadd1=as[_0xe2f8('0x74')](_0x524eff,_0x38d8c7['type'],_0x1c066c);_0x2d6176[_0x2d8eb3](_0x4cadd1[_0xe2f8('0x75')],_0x4cadd1[_0xe2f8('0x6c')][_0xe2f8('0x76')],_0x4cadd1[_0xe2f8('0x6c')]['end']);}break;}}else{var _0x4cadd1=as[_0xe2f8('0x74')](_0x524eff,_0x38d8c7['type'],_0x1c066c);_0x2d6176[_0x2d8eb3](_0x4cadd1['text'],_0x4cadd1['value'][_0xe2f8('0x76')],_0x4cadd1['value']['end']);}}}else{var _0x2031bf=_(Object[_0xe2f8('0x7b')](_0x2c5765[_0xe2f8('0x45')]))[_0xe2f8('0x39')](function(_0x1ccdd8){return _0x3f6416['hasOwnProperty'](_0x1ccdd8)?_0x1ccdd8:undefined;})[_0xe2f8('0x7c')](function(_0x4695cd){return!_[_0xe2f8('0x7d')](_0x4695cd);})[_0xe2f8('0x6c')]();if(!_[_0xe2f8('0x7e')](_0x2031bf)){_0x2031bf[_0xe2f8('0x3d')](function(_0x1b54b0){if(_0x1b54b0===_0xe2f8('0x7f')){_0xcc69e0[_0xe2f8('0x51')]('i.ChatWebsiteId\x20IN\x20?',[][_0xe2f8('0x80')](_0x2c5765[_0xe2f8('0x45')][_0x1b54b0]));}else if(_0x1b54b0===_0xe2f8('0x81')){var _0x323423=JSON[_0xe2f8('0x82')](_0x2c5765[_0xe2f8('0x45')][_0x1b54b0])['$gte'];var _0x1a27c5=JSON[_0xe2f8('0x82')](_0x2c5765['query'][_0x1b54b0])[_0xe2f8('0x83')];_0xcc69e0[_0xe2f8('0x51')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x323423,_0x1a27c5);}else{if(_0x2c5765[_0xe2f8('0x45')][_0x1b54b0]===_0xe2f8('0x84')){_0xcc69e0[_0xe2f8('0x51')]('i.'+_0x1b54b0+_0xe2f8('0x85'));}else{_0xcc69e0[_0xe2f8('0x51')]('i.'+_0x1b54b0+_0xe2f8('0x86'),_0x2c5765[_0xe2f8('0x45')][_0x1b54b0]);}}});}if(_0x2c5765[_0xe2f8('0x45')][_0xe2f8('0x87')]){if(_0x2c5765[_0xe2f8('0x45')][_0xe2f8('0x87')]==0x1){_0xcc69e0[_0xe2f8('0x6e')]('`unreadMessages`\x20=\x200');}else{_0xcc69e0['having'](_0xe2f8('0x88'));}}if(_0x2c5765[_0xe2f8('0x45')]['tag']){_0x59d472=_[_0xe2f8('0x89')](_0x2c5765['query'][_0xe2f8('0x8a')])?_0x2c5765[_0xe2f8('0x45')][_0xe2f8('0x8a')]:new Array(_0x2c5765['query'][_0xe2f8('0x8a')]);_0x59d472[_0xe2f8('0x3d')](function(_0x1c89d9){_0x19e610['or'](_0xe2f8('0x8b'),'%,'+_0x1c89d9+',%');});}if(_0x2c5765[_0xe2f8('0x45')][_0xe2f8('0x7c')]){var _0xb2bdec=_0x2c5765[_0xe2f8('0x45')][_0xe2f8('0x7c')]['replace']('\x5c','\x5c\x5c')[_0xe2f8('0x8c')]('\x27\x27','\x27\x27\x27\x27');if(qs[_0xe2f8('0x8d')](_0xb2bdec)){_0x2d6176['or'](_0xe2f8('0x8e'),_0xb2bdec+'%');}else{var _0x2c354b=[];_0xb2bdec[_0xe2f8('0x3c')]('\x20')[_0xe2f8('0x3d')](function(_0x291661){_0x2c354b[_0xe2f8('0x3e')]('+'+_0x291661[_0xe2f8('0x8f')]());});var _0x2d8ff1=_0x2c354b[_0xe2f8('0x90')]('\x20');_0x2d6176['or'](_0xe2f8('0x91'),_0x2d8ff1)['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0xb2bdec+'%');}}}_0xcc69e0[_0xe2f8('0x51')](_0x2d6176);_0xcc69e0['group']('i.id');var _0x531b0e={'type':db[_0xe2f8('0x92')][_0xe2f8('0x93')][_0xe2f8('0x94')],'raw':!![]};var _0x216af0=_0xcc69e0[_0xe2f8('0x95')]();_0x216af0[_0xe2f8('0x53')](_0xe2f8('0x96'));_0x216af0[_0xe2f8('0x53')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x1ddb67[_0xe2f8('0x4f')]){_0x1ddb67[_0xe2f8('0x4f')][_0xe2f8('0x3d')](function(_0x5942bc){_0xcc69e0[_0xe2f8('0x4f')]('i.'+_0x5942bc[0x0],_0x5942bc[0x1]==='DESC'?![]:!![]);});}if(!_[_0xe2f8('0x7e')](_0x59d472)){_0xcc69e0[_0xe2f8('0x6e')](_0x19e610);_0x216af0['where'](_0xe2f8('0x97'),_0x59d472);}db[_0xe2f8('0x98')][_0xe2f8('0x45')](_0x216af0[_0xe2f8('0x8f')](),_0x531b0e)[_0xe2f8('0x21')](function(_0xdc5835){_0x260397[_0xe2f8('0x99')]=_0xdc5835[_0xe2f8('0x4b')];if(_0x260397[_0xe2f8('0x99')]===0x0)return[];return db[_0xe2f8('0x98')][_0xe2f8('0x45')](_0x4da377[_0xe2f8('0x8f')](),_0x531b0e)[_0xe2f8('0x21')](function(_0xcdaa82){_0x4446b7=_[_0xe2f8('0x9a')](_0xcdaa82,'id');_0x531b0e=_[_0xe2f8('0x9b')](_0x531b0e,{'model':db[_0xe2f8('0x40')],'mapToModel':!![],'raw':!![],'nest':!![]});_0xcc69e0[_0xe2f8('0x53')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xe2f8('0x6b'));_0xcc69e0['field']('a.key','Account.key');_0xcc69e0[_0xe2f8('0x53')]('a.mandatoryDisposition',_0xe2f8('0x9c'));_0xcc69e0[_0xe2f8('0x53')](_0xe2f8('0x9d'));_0xcc69e0['field']('c.firstName','Contact.firstName');_0xcc69e0[_0xe2f8('0x53')](_0xe2f8('0x9e'),'Contact.lastName');_0xcc69e0[_0xe2f8('0x53')]('c.email',_0xe2f8('0x9f'));_0xcc69e0['field']('c.phone',_0xe2f8('0xa0'));_0xcc69e0[_0xe2f8('0x53')](_0xe2f8('0xa1'),_0xe2f8('0xa2'));_0xcc69e0[_0xe2f8('0x53')](_0xe2f8('0xa3'),_0xe2f8('0xa4'));_0xcc69e0['field'](_0xe2f8('0xa5'),_0xe2f8('0x3b'));_0xcc69e0[_0xe2f8('0x4e')](_0x1ddb67[_0xe2f8('0x4e')]);_0xcc69e0['offset'](_0x1ddb67[_0xe2f8('0x2d')]);return db[_0xe2f8('0x98')]['query'](_0xcc69e0[_0xe2f8('0x8f')](),_0x531b0e);})['then'](function(_0x4ab72d){_0x14fcff[_0xe2f8('0x51')](_0xe2f8('0xa6'),_[_0xe2f8('0x39')](_0x4ab72d,'id'));return db[_0xe2f8('0x98')][_0xe2f8('0x45')](_0x14fcff[_0xe2f8('0x8f')](),_0x531b0e)[_0xe2f8('0x21')](function(_0x5ad0e3){var _0x4ddb8e=_[_0xe2f8('0xa7')](_0x5ad0e3,_0xe2f8('0xa8'));var _0x18c25e=[];_0x4ab72d[_0xe2f8('0x3d')](function(_0x3b0ccc){_0x18c25e[_0xe2f8('0x3e')](updateChatInteraction(_0x3b0ccc,_0x4446b7,_0x4ddb8e));});return BPromise[_0xe2f8('0xa9')](_0x18c25e);});});})['then'](function(_0x61b76e){_0x260397[_0xe2f8('0xaa')]=_0x61b76e;return _0x260397;})[_0xe2f8('0x21')](respondWithFilteredResult(_0x121078,_0x1ddb67))[_0xe2f8('0x2a')](handleError(_0x121078,null));};exports[_0xe2f8('0xab')]=function(_0x3e6a91,_0x2ce9e9){var _0x92cc9d={'raw':![],'where':{'id':_0x3e6a91[_0xe2f8('0xac')]['id']}},_0x28d84d={};_0x28d84d[_0xe2f8('0x49')]=_['keys'](db[_0xe2f8('0x40')][_0xe2f8('0x41')]);_0x28d84d['query']=_[_0xe2f8('0x7b')](_0x3e6a91[_0xe2f8('0x45')]);_0x28d84d['filters']=_['intersection'](_0x28d84d[_0xe2f8('0x49')],_0x28d84d[_0xe2f8('0x45')]);_0x92cc9d['attributes']=_[_0xe2f8('0x47')](_0x28d84d[_0xe2f8('0x49')],qs[_0xe2f8('0x4a')](_0x3e6a91[_0xe2f8('0x45')][_0xe2f8('0x4a')]));_0x92cc9d['attributes']=_0x92cc9d[_0xe2f8('0x48')][_0xe2f8('0x4b')]?_0x92cc9d['attributes']:_0x28d84d[_0xe2f8('0x49')];if(_0x3e6a91[_0xe2f8('0x45')][_0xe2f8('0xad')]){_0x92cc9d[_0xe2f8('0xae')]=[{'all':!![]}];}_0x92cc9d=_['merge']({},_0x92cc9d,_0x3e6a91[_0xe2f8('0xaf')]);return db[_0xe2f8('0x40')][_0xe2f8('0x6a')](_0x92cc9d)[_0xe2f8('0x21')](handleEntityNotFound(_0x2ce9e9,null))[_0xe2f8('0x21')](respondWithResult(_0x2ce9e9,null))[_0xe2f8('0x2a')](handleError(_0x2ce9e9,null));};exports['create']=function(_0x23d71b,_0x56b7e0){return db['ChatInteraction'][_0xe2f8('0xb0')](_0x23d71b[_0xe2f8('0xb1')],{})[_0xe2f8('0x21')](respondWithResult(_0x56b7e0,0xc9))['catch'](handleError(_0x56b7e0,null));};exports[_0xe2f8('0x33')]=function(_0x4fe60a,_0x3b7d34){if(_0x4fe60a[_0xe2f8('0xb1')]['id']){delete _0x4fe60a[_0xe2f8('0xb1')]['id'];}return db[_0xe2f8('0x40')][_0xe2f8('0x6a')]({'where':{'id':_0x4fe60a['params']['id']}})['then'](handleEntityNotFound(_0x3b7d34,null))[_0xe2f8('0x21')](saveUpdates(_0x4fe60a[_0xe2f8('0xb1')],null))[_0xe2f8('0x21')](respondWithResult(_0x3b7d34,null))[_0xe2f8('0x2a')](handleError(_0x3b7d34,null));};exports[_0xe2f8('0x34')]=function(_0x658e6e,_0x28da6d){return db['ChatInteraction'][_0xe2f8('0x6a')]({'where':{'id':_0x658e6e[_0xe2f8('0xac')]['id']}})[_0xe2f8('0x21')](handleEntityNotFound(_0x28da6d,null))[_0xe2f8('0x21')](removeEntity(_0x28da6d,null))[_0xe2f8('0x2a')](handleError(_0x28da6d,null));};exports['describe']=function(_0x21edc8,_0x42d0f){return db[_0xe2f8('0x40')][_0xe2f8('0xb2')]()[_0xe2f8('0x21')](respondWithResult(_0x42d0f,null))[_0xe2f8('0x2a')](handleError(_0x42d0f,null));};exports['customUpdate']=function(_0x15681a,_0x16394b){if(_0x15681a[_0xe2f8('0xb1')]['id']){delete _0x15681a[_0xe2f8('0xb1')]['id'];}return db[_0xe2f8('0x40')][_0xe2f8('0x6a')]({'where':{'id':_0x15681a[_0xe2f8('0xac')]['id']}})[_0xe2f8('0x21')](handleEntityNotFound(_0x16394b,null))['then'](saveUpdates(_0x15681a[_0xe2f8('0xb1')],null))[_0xe2f8('0x21')](respondWithResult(_0x16394b,null))['catch'](handleError(_0x16394b,null));};exports['abandon']=function(_0x579b65,_0x141a4c,_0x5e91f9){if(_0x579b65[_0xe2f8('0xb1')]['id']){delete _0x579b65['body']['id'];}return db[_0xe2f8('0x40')][_0xe2f8('0x6a')]({'where':{'id':_0x579b65['params']['id']}})[_0xe2f8('0x21')](function(_0x2481dd){if(!_0x2481dd){logger[_0xe2f8('0x27')](_0xe2f8('0xb3'),_0xe2f8('0xb4'),0x194,'entity\x20not\x20found');_0x141a4c[_0xe2f8('0x35')](0x194);}else{if(_0x2481dd[_0xe2f8('0x7a')]){throw new db['Sequelize'][(_0xe2f8('0xb5'))](_0xe2f8('0xb6'));}}return _0x2481dd;})[_0xe2f8('0x21')](function(_0x5549d0){if(_0x5549d0){return _0x5549d0[_0xe2f8('0x33')]({'closed':_0x579b65[_0xe2f8('0xb1')][_0xe2f8('0xb7')],'disposition':_0x579b65['body'][_0xe2f8('0xb8')]})[_0xe2f8('0x21')](function(_0x1925a9){return _0x1925a9;});}})[_0xe2f8('0x21')](function(_0x5f3d34){return respondWithRpcPromise(_0xe2f8('0xb9'),_0xe2f8('0xb4'),_0x579b65[_0xe2f8('0xb1')],client9004);})[_0xe2f8('0x21')](respondWithResult(_0x141a4c,null))[_0xe2f8('0x2a')](handleError(_0x141a4c,null));};exports[_0xe2f8('0xba')]=function(_0x491e3b,_0x13a5fd,_0x361a29){_0x491e3b['body'][_0xe2f8('0x37')]=_0x491e3b['file']['originalname'];_0x491e3b[_0xe2f8('0xb1')][_0xe2f8('0xbb')]=_0x491e3b[_0xe2f8('0xbc')][_0xe2f8('0xbd')];_0x491e3b[_0xe2f8('0xb1')][_0xe2f8('0x43')]=_0x491e3b['file'][_0xe2f8('0xbe')];return db[_0xe2f8('0xbf')][_0xe2f8('0xb0')](_0x491e3b[_0xe2f8('0xb1')])['then'](respondWithResult(_0x13a5fd,0xc9))[_0xe2f8('0x2a')](handleError(_0x13a5fd,null));};exports[_0xe2f8('0xc0')]=function(_0x56ecb7,_0x4973cf,_0x168e81){return db[_0xe2f8('0x40')][_0xe2f8('0xc1')]({'where':{'id':_0x56ecb7[_0xe2f8('0xac')]['id']},'raw':!![]})[_0xe2f8('0x21')](handleEntityNotFound(_0x4973cf,null))[_0xe2f8('0x21')](function(_0x1e970c){if(_0x1e970c){if(_0x1e970c['closed']){return _0x4973cf[_0xe2f8('0x2b')](0x193)[_0xe2f8('0x30')]({'status':0x193,'message':_0xe2f8('0xc2')});}return db[_0xe2f8('0xbf')][_0xe2f8('0xc1')]({'where':{'id':_0x56ecb7[_0xe2f8('0x45')][_0xe2f8('0xc3')]},'raw':!![]})[_0xe2f8('0x21')](handleEntityNotFound(_0x4973cf,null));}})[_0xe2f8('0x21')](function(_0xe3917c){if(_0xe3917c){return _0x4973cf[_0xe2f8('0xc4')](path[_0xe2f8('0x90')](config[_0xe2f8('0xc5')],_0xe2f8('0xc6'),_0xe3917c['basename']));}})[_0xe2f8('0x2a')](handleError(_0x4973cf,null));};exports[_0xe2f8('0xc7')]=function(_0x18e56c,_0x3788d8){var _0x57a095=null;var _0x502cdf=null;var _0x5e7793=null;var _0x492437=null;if(_0x18e56c['body']['id']){delete _0x18e56c[_0xe2f8('0xb1')]['id'];}if(_0x18e56c['body']['mailTranscript']){_0x492437=path[_0xe2f8('0x90')](config['root'],_0xe2f8('0xc8'),util[_0xe2f8('0xc9')]('transcript-%s.txt',Date[_0xe2f8('0xca')]()));_0x18e56c['body'][_0xe2f8('0xcb')]=_0x492437;}return db['ChatInteraction'][_0xe2f8('0x6a')]({'where':{'id':_0x18e56c[_0xe2f8('0xac')]['id']},'include':[{'model':db[_0xe2f8('0xcc')],'as':_0xe2f8('0xcd'),'include':[{'model':db[_0xe2f8('0x78')],'as':_0xe2f8('0x78')}]}]})[_0xe2f8('0x21')](handleEntityNotFound(_0x3788d8,null))[_0xe2f8('0x21')](saveUpdates(_0x18e56c[_0xe2f8('0xb1')],null))['then'](function(_0x3172d2){if(_0x3172d2){_0x57a095=_0x3172d2;return db[_0xe2f8('0xce')][_0xe2f8('0x6a')]({'where':{'id':_0x57a095['ChatWebsiteId']}});}})[_0xe2f8('0x21')](function(_0x5154c2){if(_0x5154c2){_0x5e7793=_0x5154c2;return db[_0xe2f8('0xcf')][_0xe2f8('0x6a')]({'where':{'id':_0x57a095[_0xe2f8('0x73')]}});}})[_0xe2f8('0x21')](function(_0x44039){if(_0x44039){_0x502cdf=_0x44039;if(_0x492437){var _0x1f8658=null;for(var _0x214738=0x1;_0x214738<_0x57a095['Messages'][_0xe2f8('0x4b')];++_0x214738){_0x1f8658=_0x57a095[_0xe2f8('0xcd')][_0x214738];var _0x1ee7ca=_0x1f8658['UserId']?util[_0xe2f8('0xc9')]('%s%d',_0x5e7793['agentAlias'],_0x1f8658[_0xe2f8('0x7a')]):_0xe2f8('0xd0');var _0x3827fd=_0x18e56c[_0xe2f8('0xb1')][_0xe2f8('0xd1')]||util[_0xe2f8('0xc9')]('%s%d',_0xe2f8('0xd2'),_0x1f8658[_0xe2f8('0x73')]);switch(_0x5e7793[_0xe2f8('0xd3')]){case _0xe2f8('0xd4'):_0x1ee7ca=_0x1f8658[_0xe2f8('0x7a')]?util[_0xe2f8('0xc9')]('%s%d',_0x5e7793[_0xe2f8('0xd5')],_0x1f8658[_0xe2f8('0x7a')]):_0xe2f8('0xd0');break;case _0xe2f8('0xd6'):_0x1ee7ca=_0x1f8658[_0xe2f8('0x7a')]?_0x1f8658[_0xe2f8('0x78')][_0xe2f8('0xd7')]||_0x1f8658[_0xe2f8('0x78')][_0xe2f8('0xd8')]:'System';break;case'agent_fullname':_0x1ee7ca=_0x1f8658['UserId']?_0x1f8658['User'][_0xe2f8('0xd8')]:_0xe2f8('0xd0');break;default:_0x1ee7ca=_0x1f8658['UserId']?util[_0xe2f8('0xc9')](_0xe2f8('0xd9'),_0x5e7793['agentAlias'],_0x1f8658[_0xe2f8('0x7a')]):_0xe2f8('0xd0');}var _0xf104df=util['format'](_0xe2f8('0xda'),moment(_0x1f8658['createdAt'])[_0xe2f8('0xc9')]('MM/DD/YYYY\x20HH:mm:ss'),_0x1f8658[_0xe2f8('0xdb')]==='in'?_0x3827fd:_0x1ee7ca,_0x1f8658[_0xe2f8('0xb1')]);if(!_0x1f8658[_0xe2f8('0xdc')]){fs[_0xe2f8('0xdd')](_0x492437,_0xf104df);}}return db[_0xe2f8('0xde')][_0xe2f8('0xc1')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xe2f8('0xdf'),'raw':!![]}]});}}})[_0xe2f8('0x21')](function(_0x5aee5e){if(_0x5aee5e&&_0x5aee5e[_0xe2f8('0xdf')]&&_0x18e56c[_0xe2f8('0xb1')]){var _0x2a4525={'tls':{'rejectUnauthorized':![]}};if(_0x5aee5e[_0xe2f8('0xdf')][_0xe2f8('0xe0')]){_0x2a4525[_0xe2f8('0xe0')]=_0x5aee5e[_0xe2f8('0xdf')][_0xe2f8('0xe0')];}else{_0x2a4525['host']=_0x5aee5e[_0xe2f8('0xdf')]['host'];_0x2a4525[_0xe2f8('0xe1')]=_0x5aee5e[_0xe2f8('0xdf')]['port'];_0x2a4525[_0xe2f8('0xe2')]=_0x5aee5e[_0xe2f8('0xdf')]['secure'];}if(_0x5aee5e[_0xe2f8('0xdf')]['authentication']){_0x2a4525[_0xe2f8('0xe3')]={'user':_0x5aee5e[_0xe2f8('0xdf')][_0xe2f8('0xe4')],'pass':_0x5aee5e[_0xe2f8('0xdf')][_0xe2f8('0xe5')]};}return respondWithRpcPromise(_0xe2f8('0xe6'),_0xe2f8('0xe7'),{'account':_0x2a4525,'message':{'from':util[_0xe2f8('0xc9')](_0xe2f8('0xe8'),_0x5aee5e['name'],_0x5aee5e[_0xe2f8('0xe9')]||_0x5aee5e['Smtp'][_0xe2f8('0xe4')]),'to':_0x18e56c['body'][_0xe2f8('0xea')],'subject':_0xe2f8('0xeb'),'text':util[_0xe2f8('0xc9')](_0xe2f8('0xec'),_0x18e56c[_0xe2f8('0xb1')][_0xe2f8('0xea')]),'attachments':[{'path':_0x492437}]}})['then'](function(){return _0x57a095;})[_0xe2f8('0x2a')](function(_0x231388){console[_0xe2f8('0x27')](_0x231388);});}else{return _0x57a095;}})['then'](respondWithStatusCode(_0x3788d8,0xc8))[_0xe2f8('0x2a')](handleError(_0x3788d8,null));};exports[_0xe2f8('0xed')]=function(_0x109f84,_0x2654e5,_0x5dbde8){return db['ChatMessage'][_0xe2f8('0x6a')]({'where':{'id':_0x109f84[_0xe2f8('0xac')]['id']}})['then'](handleEntityNotFound(_0x2654e5,null))[_0xe2f8('0x21')](function(_0x401c06){if(_0x401c06){return _0x401c06[_0xe2f8('0xed')](_0x109f84['body'][_0xe2f8('0xee')],_[_0xe2f8('0xef')](_0x109f84['body'],[_0xe2f8('0xee'),'id'])||{});}})['then'](respondWithResult(_0x2654e5,null))[_0xe2f8('0x2a')](handleError(_0x2654e5,null));};exports['getMessages']=function(_0x3b3d43,_0x5e0a18,_0x91f4d7){var _0x1634a9={'raw':![],'where':{}};var _0x52ca74={};var _0x478aa1={'count':0x0,'rows':[]};return db[_0xe2f8('0x40')][_0xe2f8('0xc1')]({'where':{'id':_0x3b3d43['params']['id']}})[_0xe2f8('0x21')](handleEntityNotFound(_0x5e0a18,null))[_0xe2f8('0x21')](function(_0x215cd9){if(_0x215cd9){_0x52ca74[_0xe2f8('0x49')]=_[_0xe2f8('0x7b')](db[_0xe2f8('0xcc')][_0xe2f8('0x41')]);_0x52ca74[_0xe2f8('0x45')]=_['keys'](_0x3b3d43[_0xe2f8('0x45')]);_0x52ca74['filters']=_[_0xe2f8('0x47')](_0x52ca74[_0xe2f8('0x49')],_0x52ca74[_0xe2f8('0x45')]);_0x1634a9[_0xe2f8('0x48')]=_[_0xe2f8('0x47')](_0x52ca74[_0xe2f8('0x49')],qs['fields'](_0x3b3d43[_0xe2f8('0x45')][_0xe2f8('0x4a')]));_0x1634a9['attributes']=_0x1634a9[_0xe2f8('0x48')]['length']?_0x1634a9[_0xe2f8('0x48')]:_0x52ca74[_0xe2f8('0x49')];if(!_0x3b3d43[_0xe2f8('0x45')][_0xe2f8('0x4c')](_0xe2f8('0x4d'))){_0x1634a9[_0xe2f8('0x4e')]=qs['limit'](_0x3b3d43[_0xe2f8('0x45')][_0xe2f8('0x4e')]);_0x1634a9[_0xe2f8('0x2d')]=qs[_0xe2f8('0x2d')](_0x3b3d43[_0xe2f8('0x45')][_0xe2f8('0x2d')]);}_0x1634a9[_0xe2f8('0x4f')]=qs[_0xe2f8('0x50')](_0x3b3d43[_0xe2f8('0x45')][_0xe2f8('0x50')]);_0x1634a9[_0xe2f8('0x51')]=qs[_0xe2f8('0x46')](_[_0xe2f8('0xf0')](_0x3b3d43[_0xe2f8('0x45')],_0x52ca74[_0xe2f8('0x46')]));_0x1634a9[_0xe2f8('0x51')]['ChatInteractionId']=_0x215cd9['id'];if(_0x3b3d43[_0xe2f8('0x45')][_0xe2f8('0x7c')]){_0x1634a9[_0xe2f8('0x51')]=_[_0xe2f8('0x9b')](_0x1634a9[_0xe2f8('0x51')],{'$or':_[_0xe2f8('0x39')](_0x1634a9['attributes'],function(_0x49edbd){var _0x13bf7f={};_0x13bf7f[_0x49edbd]={'$like':'%'+_0x3b3d43['query'][_0xe2f8('0x7c')]+'%'};return _0x13bf7f;})});}if(_0x3b3d43['query'][_0xe2f8('0xf1')]){var _0x53fe03=_0x3b3d43[_0xe2f8('0x45')][_0xe2f8('0xf1')][_0xe2f8('0x3c')](',');var _0x29c866={};_0x29c866[_0x53fe03[0x0]]={'$gte':moment(_0x53fe03[0x1])[_0xe2f8('0xc9')](_0xe2f8('0xf2'))};_0x1634a9[_0xe2f8('0x51')]=_['merge'](_0x1634a9[_0xe2f8('0x51')],_0x29c866);}_0x1634a9=_[_0xe2f8('0x9b')]({},_0x1634a9,_0x3b3d43['options']);return db[_0xe2f8('0xcc')][_0xe2f8('0x99')]({'where':_0x1634a9['where']})[_0xe2f8('0x21')](function(_0x3650ae){_0x478aa1[_0xe2f8('0x99')]=_0x3650ae;if(_0x3b3d43['query'][_0xe2f8('0xad')]){_0x1634a9[_0xe2f8('0xae')]=[{'all':!![]}];}return db[_0xe2f8('0xcc')][_0xe2f8('0xf3')](_0x1634a9);})['then'](function(_0x5ad7b5){_0x478aa1[_0xe2f8('0xaa')]=_0x5ad7b5;return _0x478aa1;});}})[_0xe2f8('0x21')](respondWithFilteredResult(_0x5e0a18,_0x1634a9))[_0xe2f8('0x2a')](handleError(_0x5e0a18,null));};exports[_0xe2f8('0xf4')]=function(_0x46ae9a,_0xaf333f,_0x4cb0e3){var _0x48413b={'where':{}},_0xd1bfe={},_0x2d358c={'count':0x0,'rows':[]};return db[_0xe2f8('0x40')][_0xe2f8('0xc1')]({'where':{'id':_0x46ae9a['params']['id']}})['then'](handleEntityNotFound(_0xaf333f,null))[_0xe2f8('0x21')](function(_0x6a03fb){if(_0x6a03fb){_0xd1bfe['model']=_[_0xe2f8('0x7b')](db['ChatMessage'][_0xe2f8('0x41')]);_0xd1bfe['query']=_['keys'](_0x46ae9a[_0xe2f8('0x45')]);_0xd1bfe['filters']=_[_0xe2f8('0x47')](_0xd1bfe[_0xe2f8('0x49')],_0xd1bfe[_0xe2f8('0x45')]);_0x48413b[_0xe2f8('0x48')]=_[_0xe2f8('0x47')](_0xd1bfe[_0xe2f8('0x49')],qs['fields'](_0x46ae9a[_0xe2f8('0x45')]['fields']));_0x48413b[_0xe2f8('0x48')]=_0x48413b[_0xe2f8('0x48')]['length']?_0x48413b[_0xe2f8('0x48')]:_0xd1bfe['model'];if(!_0x46ae9a[_0xe2f8('0x45')]['hasOwnProperty'](_0xe2f8('0x4d'))){_0x48413b[_0xe2f8('0x4e')]=qs[_0xe2f8('0x4e')](_0x46ae9a[_0xe2f8('0x45')][_0xe2f8('0x4e')]);_0x48413b['offset']=qs[_0xe2f8('0x2d')](_0x46ae9a[_0xe2f8('0x45')][_0xe2f8('0x2d')]);}_0x48413b[_0xe2f8('0x4f')]=qs['sort'](_0x46ae9a['query'][_0xe2f8('0x50')]);_0x48413b[_0xe2f8('0x51')]=qs[_0xe2f8('0x46')](_['pick'](_0x46ae9a[_0xe2f8('0x45')],_0xd1bfe[_0xe2f8('0x46')]));_0x48413b[_0xe2f8('0x51')][_0xe2f8('0xa8')]=_0x6a03fb['id'];if(_0x46ae9a[_0xe2f8('0x45')][_0xe2f8('0x7c')]){_0x48413b[_0xe2f8('0x51')]=_[_0xe2f8('0x9b')](_0x48413b[_0xe2f8('0x51')],{'$or':_[_0xe2f8('0x39')](_0x48413b[_0xe2f8('0x48')],function(_0x2cea1d){var _0x2ee275={};_0x2ee275[_0x2cea1d]={'$like':'%'+_0x46ae9a[_0xe2f8('0x45')][_0xe2f8('0x7c')]+'%'};return _0x2ee275;})});}_0x48413b[_0xe2f8('0x51')][_0xe2f8('0xdc')]=![];if(_0x46ae9a[_0xe2f8('0x45')]['id']){_0x48413b[_0xe2f8('0x51')]['id']={'$gt':_0x46ae9a[_0xe2f8('0x45')]['id']};}_0x48413b=_[_0xe2f8('0x9b')]({},_0x48413b,_0x46ae9a[_0xe2f8('0xaf')]);return db['ChatMessage'][_0xe2f8('0x99')]({'where':_0x48413b[_0xe2f8('0x51')]})[_0xe2f8('0x21')](function(_0x1e56d0){_0x2d358c[_0xe2f8('0x99')]=_0x1e56d0;_0x48413b[_0xe2f8('0xae')]=[];if(_0x46ae9a['query'][_0xe2f8('0xf5')]){_0x48413b[_0xe2f8('0xae')]['push']({'model':db['User'],'as':_0xe2f8('0x78'),'attributes':['id',_0xe2f8('0xd8'),_0xe2f8('0xd7')]});}if(_0x46ae9a['query'][_0xe2f8('0xad')]){_0x48413b[_0xe2f8('0xae')]=[{'all':!![]}];}return db[_0xe2f8('0xcc')][_0xe2f8('0xf3')](_0x48413b);})[_0xe2f8('0x21')](function(_0x17a425){_0x2d358c[_0xe2f8('0xaa')]=_0x17a425;return _0x2d358c;});}})[_0xe2f8('0x21')](respondWithFilteredResult(_0xaf333f,_0x48413b))['catch'](handleError(_0xaf333f,null));};exports[_0xe2f8('0xf6')]=function(_0x4926f6,_0x2897a2,_0x58041a){return db['ChatInteraction']['find']({'where':{'id':_0x4926f6[_0xe2f8('0xac')]['id']}})[_0xe2f8('0x21')](handleEntityNotFound(_0x2897a2,null))['then'](function(_0x425f53){if(_0x425f53){return _0x425f53['setTags'](_0x4926f6[_0xe2f8('0xb1')][_0xe2f8('0xee')],_[_0xe2f8('0xef')](_0x4926f6[_0xe2f8('0xb1')],[_0xe2f8('0xee'),'id'])||{})[_0xe2f8('0xf7')](function(){return db[_0xe2f8('0xf8')][_0xe2f8('0xf3')]({'attributes':['id',_0xe2f8('0x37'),_0xe2f8('0x54')],'where':{'id':_0x4926f6['body']['ids']}});})['then'](function(_0x200ccf){socket['emit'](_0xe2f8('0xf9'),{'id':Number(_0x4926f6[_0xe2f8('0xac')]['id']),'tags':_0x200ccf||[]});return{'id':Number(_0x4926f6[_0xe2f8('0xac')]['id']),'tags':_0x200ccf||[]};});}})[_0xe2f8('0x21')](respondWithResult(_0x2897a2,null))['catch'](handleError(_0x2897a2,null));};exports[_0xe2f8('0xfa')]=function(_0x518e88,_0x2ca384,_0x23e860){return db[_0xe2f8('0x40')][_0xe2f8('0x6a')]({'where':{'id':_0x518e88[_0xe2f8('0xac')]['id']}})[_0xe2f8('0x21')](handleEntityNotFound(_0x2ca384,null))['then'](function(_0x218ef0){if(_0x218ef0){return _0x218ef0[_0xe2f8('0xfa')](_0x518e88[_0xe2f8('0x45')][_0xe2f8('0xee')]);}})['then'](respondWithStatusCode(_0x2ca384,null))[_0xe2f8('0x2a')](handleError(_0x2ca384,null));};exports[_0xe2f8('0xc4')]=function(_0x14efaf,_0x4c33cc){var _0x9d45f6=moment()[_0xe2f8('0xfb')]()['toString']();var _0xd81376=path[_0xe2f8('0x90')](config['root'],'server',_0xe2f8('0xfc'),_0xe2f8('0xfd'));var _0x1a4ba8=path[_0xe2f8('0x90')](config[_0xe2f8('0xc5')],'server',_0xe2f8('0xfc'),_0xe2f8('0xfe'));var _0x202618=path[_0xe2f8('0x90')](_0xd81376,_0x9d45f6);var _0x1c3505=util[_0xe2f8('0xc9')](_0xe2f8('0xff'),_0x14efaf[_0xe2f8('0xac')]['id'],_0x9d45f6);var _0x42c457=path['join'](_0xd81376,_0x1c3505);var _0x191b02=![];return db[_0xe2f8('0x40')][_0xe2f8('0x6a')]({'where':{'id':_0x14efaf[_0xe2f8('0xac')]['id']},'include':[{'model':db[_0xe2f8('0xcc')],'as':'Messages','attributes':['id',_0xe2f8('0xb1'),_0xe2f8('0x81'),_0xe2f8('0xdb'),_0xe2f8('0xdc'),_0xe2f8('0x87')],'include':[{'model':db[_0xe2f8('0x78')],'as':_0xe2f8('0x78'),'attributes':['id',_0xe2f8('0xd8')],'raw':!![]},{'model':db[_0xe2f8('0xcf')],'as':_0xe2f8('0x100'),'attributes':['id','firstName',_0xe2f8('0x101')],'raw':!![]},{'model':db[_0xe2f8('0xbf')],'as':'Attachment','raw':!![]}]},{'model':db[_0xe2f8('0xce')],'as':'Account','attributes':['id',_0xe2f8('0x37')]},{'model':db[_0xe2f8('0x78')],'as':_0xe2f8('0x102'),'attributes':['id',_0xe2f8('0xd8')]}]})[_0xe2f8('0x21')](handleEntityNotFound(_0x4c33cc,null))[_0xe2f8('0x21')](function(_0x4a600a){if(_0x4a600a){var _0x219a04=_0x4a600a[_0xe2f8('0x103')]({'plain':!![]});_0x191b02=!![];var _0x2932a4={'format':'A4','border':_0xe2f8('0x104'),'header':{'height':_0xe2f8('0x105'),'contents':{'first':_0xe2f8('0x106')}},'footer':{'height':_0xe2f8('0x107'),'contents':{'default':util[_0xe2f8('0xc9')](_0xe2f8('0x108'),util[_0xe2f8('0xc9')](_0xe2f8('0x109'),_0xe2f8('0x10a'),_0x219a04['id']),moment()[_0xe2f8('0xc9')]('YYYY-MM-DD')['toString']())}}};fs[_0xe2f8('0x10b')](_0x202618);var _0x30bf96={'channel':_0xe2f8('0x10a'),'account':_0x219a04[_0xe2f8('0x10c')][_0xe2f8('0x37')],'agent':_0x219a04[_0xe2f8('0x102')]?_0x219a04[_0xe2f8('0x102')][_0xe2f8('0xd8')]:_0xe2f8('0x10d'),'createdAt':moment(_0x219a04['createdAt'])[_0xe2f8('0xc9')](_0xe2f8('0xf2'))[_0xe2f8('0x8f')](),'closedAt':_0x219a04[_0xe2f8('0xb7')]?moment(_0x219a04[_0xe2f8('0x10e')])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x219a04['disposition'],'chatInfo':{'browser':_0x219a04['browserName'],'os':_0x219a04[_0xe2f8('0x10f')],'referer':_0x219a04['referer'],'customerIp':_0x219a04[_0xe2f8('0x110')],'customerPort':_0x219a04[_0xe2f8('0x111')]?_0x219a04[_0xe2f8('0x111')]:_0xe2f8('0x10d')},'messages':_(_0x219a04[_0xe2f8('0xcd')])['tail']()[_0xe2f8('0x7c')]({'secret':![]})[_0xe2f8('0x39')](function(_0x29742d){if(_0x29742d['Attachment']){var _0x28e46f=path[_0xe2f8('0x90')](_0x1a4ba8,_0x29742d[_0xe2f8('0xbf')][_0xe2f8('0xbb')]);if(fs[_0xe2f8('0x112')](_0x28e46f)){fs[_0xe2f8('0x113')](_0x28e46f)[_0xe2f8('0x114')](fs[_0xe2f8('0x115')](path[_0xe2f8('0x90')](_0x202618,_0x29742d[_0xe2f8('0xbf')][_0xe2f8('0xbb')])));}}return{'date':moment(_0x29742d[_0xe2f8('0x81')])[_0xe2f8('0xc9')]('YYYY-MM-DD\x20HH:mm:ss')[_0xe2f8('0x8f')](),'sender':_0x29742d[_0xe2f8('0xdb')]===_0xe2f8('0x116')?_0x29742d[_0xe2f8('0x78')]?_0x29742d[_0xe2f8('0x78')][_0xe2f8('0xd8')]:_0xe2f8('0xd0'):_0x29742d[_0xe2f8('0x100')][_0xe2f8('0x117')]+(_0x29742d[_0xe2f8('0x100')][_0xe2f8('0x101')]?'\x20'+_0x29742d[_0xe2f8('0x100')][_0xe2f8('0x101')]:''),'body':_0x29742d[_0xe2f8('0xbf')]?_0x29742d[_0xe2f8('0xbf')][_0xe2f8('0xbb')]:_0x29742d[_0xe2f8('0xb1')],'direction':_0x29742d['direction']===_0xe2f8('0x116')?'A':'C','secret':_0x29742d[_0xe2f8('0xdc')],'read':_0x29742d['read'],'attachment':_0x29742d[_0xe2f8('0xbf')]};})[_0xe2f8('0x6c')]()};return ejs[_0xe2f8('0x118')](path[_0xe2f8('0x90')](config[_0xe2f8('0xc5')],_0xe2f8('0x119'),_0xe2f8('0x11a'),_0xe2f8('0x11b')),{'interaction':_0x30bf96})[_0xe2f8('0x21')](function(_0x43f706){return new BPromise(function(_0x34da1e,_0x2c1211){pdf[_0xe2f8('0xb0')](_0x43f706,_0x2932a4)[_0xe2f8('0x11c')](path[_0xe2f8('0x90')](_0x202618,_0xe2f8('0x11d')+_0x219a04['id']+'-'+_0x9d45f6+_0xe2f8('0x11e')),function(_0x25a1a2,_0x1f0553){if(_0x25a1a2)return _0x2c1211(_0x25a1a2);_0x34da1e(_0x1f0553);});});});}})[_0xe2f8('0x21')](function(){if(_0x191b02){return new BPromise(function(_0x2a1167,_0x19c53f){zipdir(_0x202618,{'saveTo':_0x42c457},function(_0x2b6349,_0x64d3c6){if(_0x2b6349)return _0x19c53f(_0x2b6349);return _0x2a1167(_0x64d3c6);});})[_0xe2f8('0x21')](function(){return new BPromise(function(_0x57d0f0,_0xb90561){rimraf(_0x202618,function(_0x317263){if(_0x317263)_0xb90561(_0x317263);return _0x57d0f0();});});})[_0xe2f8('0x21')](function(){return _0x4c33cc[_0xe2f8('0xc4')](_0x42c457,_0x1c3505,function(_0x540175){if(_0x540175){console['log'](_0xe2f8('0x11f'),_0x540175);}else{fs[_0xe2f8('0x120')](_0x42c457);}});});}else{return _0x4c33cc[_0xe2f8('0x35')](0xc8);}})['catch'](handleError(_0x4c33cc,null));}; \ No newline at end of file +var _0x8cb0=['MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','pass','SendMail','\x22%s\x22\x20<%s>','email','user','Mail\x20Transcript','addMessage','ChatMessage','ids','getMessages','hasOwnProperty','nolimit','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','getMyMessages','setTags','omit','spread','chatInteractionTags:save','removeTags','unix','files','tmp','server','attachments','transcript-%d-%s.zip','lastName','ChatWebsite','Account','Owner','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','%s\x20#%d','Chat','YYYY-MM-DD','browserName','osName','referer','customerIp','customerPort','N.A.','tail','existsSync','pipe','createWriteStream','out','firstName','renderFile','views','.pdf','log','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','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','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatInteraction,\x20%s,\x20%s','request\x20sent','result','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','end','name','send','Users','map','TagIds','Tags','forEach','push','catch','index','ChatInteraction','rawAttributes','fieldName','key','model','query','keys','filters','attributes','fields','sort','where','pick','select','field','color','tools_tags','ui.ChatInteractionId','from','user_has_chat_interactions','left_join','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','chat_messages','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','expr','search','parseSearch','sqlOperator','conditions','find','value','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','ContactId','buildExpression','type','text','start','Tag','union','User','UserId','some','compact','isEmpty','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','having','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','split','join','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','t.id\x20IN\x20?','sequelize','length','toString','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','Contact.firstName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','ChatInteractionId','all','show','intersection','includeAll','include','options','create','body','params','describe','customUpdate','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','ValidationError','closed','disposition','AbandonInteraction','file','originalname','basename','filename','findOne','Unauthorized','Attachment','download','root','server/files/attachments/','close','mailTranscript','server/files/chat/upload/','format','now','pathTranscript','Messages','CmContact','%s%d','agentAlias','customer','Visitor','website_alias','System','agent_alias','alias','fullname','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync'];(function(_0x1b6697,_0x41a088){var _0x1c39cc=function(_0x409a7a){while(--_0x409a7a){_0x1b6697['push'](_0x1b6697['shift']());}};_0x1c39cc(++_0x41a088);}(_0x8cb0,0x15e));var _0x08cb=function(_0x37442f,_0x3eed9a){_0x37442f=_0x37442f-0x0;var _0x1d4482=_0x8cb0[_0x37442f];return _0x1d4482;};'use strict';var pdf=require(_0x08cb('0x0'));var emlformat=require(_0x08cb('0x1'));var rimraf=require(_0x08cb('0x2'));var zipdir=require(_0x08cb('0x3'));var jsonpatch=require(_0x08cb('0x4'));var rp=require(_0x08cb('0x5'));var moment=require(_0x08cb('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x08cb('0x7'));var util=require(_0x08cb('0x8'));var path=require('path');var sox=require(_0x08cb('0x9'));var csv=require(_0x08cb('0xa'));var ejs=require(_0x08cb('0xb'));var fs=require('fs');var _=require(_0x08cb('0xc'));var squel=require('squel');var crypto=require(_0x08cb('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x08cb('0xe'));var toCsv=require(_0x08cb('0xa'));var querystring=require('querystring');var Papa=require(_0x08cb('0xf'));var Redis=require(_0x08cb('0x10'));var authService=require(_0x08cb('0x11'));var qs=require(_0x08cb('0x12'));var as=require(_0x08cb('0x13'));var hardwareService=require(_0x08cb('0x14'));var logger=require(_0x08cb('0x15'))('api');var utils=require(_0x08cb('0x16'));var config=require(_0x08cb('0x17'));var db=require(_0x08cb('0x18'))['db'];config['redis']=_[_0x08cb('0x19')](config['redis'],{'host':_0x08cb('0x1a'),'port':0x18eb});var socket=require(_0x08cb('0x1b'))(new Redis(config[_0x08cb('0x1c')]));require('./chatInteraction.socket')[_0x08cb('0x1d')](socket);var jayson=require(_0x08cb('0x1e'));var client=jayson[_0x08cb('0x1f')][_0x08cb('0x20')]({'port':0x232b});var client9004=jayson[_0x08cb('0x1f')][_0x08cb('0x20')]({'port':0x232c});function checkPasswordPattern(_0x1e1514,_0x563460,_0x5065d4){if(_0x5065d4){var _0x4d2358=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4d2358[_0x08cb('0x21')](_0x563460)){return _0x1e1514;}else{throw new Error(_0x08cb('0x22'));}}else{return _0x1e1514;}}function respondWithRpcPromise(_0x32fee3,_0x4d4466,_0x2f5c3d,_0x473576){return new BPromise(function(_0x4f77ac,_0x10c055){var _0x178268=_0x473576||client;return _0x178268[_0x08cb('0x23')](_0x32fee3,_0x2f5c3d)[_0x08cb('0x24')](function(_0x2351a4){logger[_0x08cb('0x25')]('ChatInteraction,\x20%s,\x20%s',_0x4d4466,'request\x20sent');logger[_0x08cb('0x26')](_0x08cb('0x27'),_0x4d4466,'request\x20sent',JSON[_0x08cb('0x28')](_0x2351a4));if(_0x2351a4[_0x08cb('0x29')]){if(_0x2351a4[_0x08cb('0x29')][_0x08cb('0x2a')]===0x1f4){logger[_0x08cb('0x29')]('ChatInteraction,\x20%s,\x20%s',_0x4d4466,_0x2351a4['error'][_0x08cb('0x2b')]);return _0x10c055(_0x2351a4[_0x08cb('0x29')][_0x08cb('0x2b')]);}logger[_0x08cb('0x29')](_0x08cb('0x2c'),_0x4d4466,_0x2351a4[_0x08cb('0x29')][_0x08cb('0x2b')]);return _0x4f77ac(_0x2351a4[_0x08cb('0x29')][_0x08cb('0x2b')]);}else{logger[_0x08cb('0x25')](_0x08cb('0x2c'),_0x4d4466,_0x08cb('0x2d'));_0x4f77ac(_0x2351a4[_0x08cb('0x2e')][_0x08cb('0x2b')]);}})['catch'](function(_0x169aa9){logger[_0x08cb('0x29')](_0x08cb('0x2c'),_0x4d4466,_0x169aa9);_0x10c055(_0x169aa9);});});}function respondWithStatusCode(_0xfe2490,_0x2e25f5){_0x2e25f5=_0x2e25f5||0xcc;return function(_0x36503b){if(_0x36503b){return _0xfe2490[_0x08cb('0x2f')](_0x2e25f5);}return _0xfe2490[_0x08cb('0x30')](_0x2e25f5)['end']();};}function respondWithResult(_0x512a08,_0x252f42){_0x252f42=_0x252f42||0xc8;return function(_0x5124f7){if(_0x5124f7){return _0x512a08[_0x08cb('0x30')](_0x252f42)[_0x08cb('0x31')](_0x5124f7);}};}function respondWithFilteredResult(_0x300963,_0x32e158){return function(_0x33c2c8){if(_0x33c2c8){var _0x4a02a3=_0x33c2c8[_0x08cb('0x32')],_0x141b78=_0x32e158[_0x08cb('0x33')],_0x370edf=_0x32e158['offset']+_0x32e158[_0x08cb('0x34')],_0x5126e6;if(_0x370edf>=_0x4a02a3){_0x370edf=_0x4a02a3;_0x5126e6=0xc8;}else{_0x5126e6=0xce;}_0x300963[_0x08cb('0x30')](_0x5126e6);return _0x300963[_0x08cb('0x35')](_0x08cb('0x36'),_0x141b78+'-'+_0x370edf+'/'+_0x4a02a3)[_0x08cb('0x31')](_0x33c2c8);}return null;};}function patchUpdates(_0x56a291){return function(_0x2c1e3e){try{jsonpatch['apply'](_0x2c1e3e,_0x56a291,!![]);}catch(_0x102261){return BPromise[_0x08cb('0x37')](_0x102261);}return _0x2c1e3e[_0x08cb('0x38')]();};}function saveUpdates(_0x480385,_0x3ac2bd){return function(_0x2312a6){if(_0x2312a6){return _0x2312a6[_0x08cb('0x39')](_0x480385)['then'](function(_0xcff1ee){return _0xcff1ee;});}return null;};}function removeEntity(_0x3a75e9,_0x5939d2){return function(_0x55e724){if(_0x55e724){return _0x55e724[_0x08cb('0x3a')]()[_0x08cb('0x24')](function(){_0x3a75e9['status'](0xcc)[_0x08cb('0x3b')]();});}};}function handleEntityNotFound(_0x2f04d6,_0x799955){return function(_0x364d95){if(!_0x364d95){_0x2f04d6['sendStatus'](0x194);}return _0x364d95;};}function handleError(_0x264199,_0x48ef7c){_0x48ef7c=_0x48ef7c||0x1f4;return function(_0xc2ecce){logger[_0x08cb('0x29')](_0xc2ecce['stack']);if(_0xc2ecce['name']){delete _0xc2ecce[_0x08cb('0x3c')];}_0x264199[_0x08cb('0x30')](_0x48ef7c)[_0x08cb('0x3d')](_0xc2ecce);};}function getInteractionUsers(_0x28dcef,_0x2df750){return new BPromise(function(_0xe47a7d,_0x5ea9a6){try{if(_0x2df750[_0x28dcef['id']]){_0x28dcef[_0x08cb('0x3e')]=_[_0x08cb('0x3f')](_0x2df750[_0x28dcef['id']],function(_0x2cd501){return{'id':_0x2cd501['id']};});}}catch(_0x431347){_0x5ea9a6(_0x431347);}_0xe47a7d(_0x28dcef);});}function getInteractionTags(_0x11568f,_0x5206f7){return new BPromise(function(_0x2a24f0,_0x1a6889){try{if(_0x11568f[_0x08cb('0x40')]){_0x11568f[_0x08cb('0x41')]=[];_0x11568f[_0x08cb('0x40')]['split'](',')[_0x08cb('0x42')](function(_0xf43d1e){_0x11568f[_0x08cb('0x41')][_0x08cb('0x43')](_0x5206f7[_0xf43d1e]);});}delete _0x11568f[_0x08cb('0x40')];}catch(_0x29fc51){_0x1a6889(_0x29fc51);}_0x2a24f0(_0x11568f);});}function updateChatInteraction(_0x1026ee,_0x1ee5e7,_0x58996b){return new BPromise(function(_0xd24abc,_0x2be143){return getInteractionUsers(_0x1026ee,_0x58996b)[_0x08cb('0x24')](function(_0x728bce){return getInteractionTags(_0x728bce,_0x1ee5e7);})[_0x08cb('0x24')](function(_0x56f7c2){_0xd24abc(_0x56f7c2);})[_0x08cb('0x44')](function(_0x296add){_0x2be143(_0x296add);});});}exports[_0x08cb('0x45')]=function(_0x47924e,_0x346c4c){var _0x561a5a={},_0x438481={},_0x1e979e={'count':0x0,'rows':[]};var _0x384f72=_[_0x08cb('0x3f')](db[_0x08cb('0x46')][_0x08cb('0x47')],function(_0x18c4aa){return{'name':_0x18c4aa[_0x08cb('0x48')],'type':_0x18c4aa['type'][_0x08cb('0x49')]};});_0x438481[_0x08cb('0x4a')]=_[_0x08cb('0x3f')](_0x384f72,'name');_0x438481[_0x08cb('0x4b')]=_[_0x08cb('0x4c')](_0x47924e[_0x08cb('0x4b')]);_0x438481[_0x08cb('0x4d')]=_['intersection'](_0x438481[_0x08cb('0x4a')],_0x438481[_0x08cb('0x4b')]);_0x561a5a[_0x08cb('0x4e')]=_['intersection'](_0x438481[_0x08cb('0x4a')],qs[_0x08cb('0x4f')](_0x47924e['query']['fields']));_0x561a5a[_0x08cb('0x4e')]=_0x561a5a[_0x08cb('0x4e')]['length']?_0x561a5a[_0x08cb('0x4e')]:_0x438481['model'];if(!_0x47924e['query']['hasOwnProperty']('nolimit')){_0x561a5a[_0x08cb('0x34')]=qs[_0x08cb('0x34')](_0x47924e[_0x08cb('0x4b')][_0x08cb('0x34')]);_0x561a5a[_0x08cb('0x33')]=qs['offset'](_0x47924e[_0x08cb('0x4b')][_0x08cb('0x33')]);}_0x561a5a['order']=qs[_0x08cb('0x50')](_0x47924e[_0x08cb('0x4b')][_0x08cb('0x50')]);_0x561a5a[_0x08cb('0x51')]=qs[_0x08cb('0x4d')](_[_0x08cb('0x52')](_0x47924e[_0x08cb('0x4b')],_0x438481['filters']));var _0xc03e96=[];var _0x236499=squel[_0x08cb('0x53')]()[_0x08cb('0x54')]('id')[_0x08cb('0x54')](_0x08cb('0x3c'))[_0x08cb('0x54')](_0x08cb('0x55'))['from'](_0x08cb('0x56'));var _0xc17df9=squel['select']()['field']('u.id')[_0x08cb('0x54')](_0x08cb('0x57'))[_0x08cb('0x58')](_0x08cb('0x59'),'ui')[_0x08cb('0x5a')]('users','u','u.id\x20=\x20ui.UserId');var _0x4e9fdb=squel[_0x08cb('0x53')]()[_0x08cb('0x58')](_0x08cb('0x5b'),'i')['left_join'](_0x08cb('0x5c'),'c',_0x08cb('0x5d'))[_0x08cb('0x5a')](_0x08cb('0x5e'),'o','o.id\x20=\x20i.UserId')[_0x08cb('0x5a')]('chat_websites','a','a.id\x20=\x20i.ChatWebsiteId')[_0x08cb('0x5a')](_0x08cb('0x5f'),'me','me.ChatInteractionId\x20=\x20i.id')[_0x08cb('0x5a')](_0x08cb('0x60'),'it',_0x08cb('0x61'))[_0x08cb('0x5a')](_0x08cb('0x56'),'t','t.id\x20=\x20it.TagId');var _0x5462ba=squel[_0x08cb('0x62')]();var _0x274680=[];var _0x490d5d=squel[_0x08cb('0x62')]();if(_0x47924e[_0x08cb('0x4b')][_0x08cb('0x63')]){var _0x2baf36=as[_0x08cb('0x64')](_0x47924e[_0x08cb('0x4b')][_0x08cb('0x63')]);var _0x4b62c8=_0x2baf36[_0x08cb('0x65')];for(var _0x573f0c=0x0;_0x573f0c<_0x2baf36['conditions']['length'];_0x573f0c++){var _0x271818=_0x2baf36[_0x08cb('0x66')][_0x573f0c];var _0x2b817c='i';var _0x40e2e7=_[_0x08cb('0x67')](_0x384f72,[_0x08cb('0x3c'),_0x271818[_0x08cb('0x54')]]);if(!_0x40e2e7){switch(_0x271818[_0x08cb('0x54')]){case'unreadMessages':if(_0x271818[_0x08cb('0x68')]==0x1){_0x4e9fdb['having']('`'+_0x271818[_0x08cb('0x54')]+'`\x20=\x200');}else{_0x4e9fdb['having']('`'+_0x271818[_0x08cb('0x54')]+_0x08cb('0x69'));}break;case _0x08cb('0x6a'):if(_0x271818[_0x08cb('0x6b')]===_0x08cb('0x6c')){_0x5462ba[_0x4b62c8](_0x08cb('0x6d'),_0x271818[_0x08cb('0x68')],null);}else{_0x40e2e7=_[_0x08cb('0x67')](_0x384f72,[_0x08cb('0x3c'),_0x08cb('0x6e')]);_0x271818[_0x08cb('0x54')]=_0x08cb('0x6e');_0x316c49=as[_0x08cb('0x6f')](_0x2b817c,_0x40e2e7[_0x08cb('0x70')],_0x271818);_0x5462ba[_0x4b62c8](_0x316c49[_0x08cb('0x71')],_0x316c49[_0x08cb('0x68')][_0x08cb('0x72')],_0x316c49[_0x08cb('0x68')][_0x08cb('0x3b')]);}break;case _0x08cb('0x73'):var _0x1fda07=_0x271818[_0x08cb('0x68')]['split'](',')['map'](function(_0x5576ab){return Number(_0x5576ab);});_0x1fda07['forEach'](function(_0x4ea16a){_0x490d5d['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x4ea16a+',%');});_0x274680=_[_0x08cb('0x74')](_0x274680,_0x1fda07);break;case _0x08cb('0x75'):if(_0x271818[_0x08cb('0x6b')]===_0x08cb('0x6c')){_0x5462ba[_0x4b62c8]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x271818[_0x08cb('0x68')]+'%',null);}else{_0x40e2e7=_[_0x08cb('0x67')](_0x384f72,[_0x08cb('0x3c'),_0x08cb('0x76')]);_0x271818[_0x08cb('0x54')]=_0x08cb('0x76');_0x316c49=as[_0x08cb('0x6f')](_0x2b817c,_0x40e2e7[_0x08cb('0x70')],_0x271818);_0x5462ba[_0x4b62c8](_0x316c49[_0x08cb('0x71')],_0x316c49[_0x08cb('0x68')][_0x08cb('0x72')],_0x316c49[_0x08cb('0x68')][_0x08cb('0x3b')]);}break;}}else{var _0x316c49=as['buildExpression'](_0x2b817c,_0x40e2e7['type'],_0x271818);_0x5462ba[_0x4b62c8](_0x316c49[_0x08cb('0x71')],_0x316c49['value'][_0x08cb('0x72')],_0x316c49['value'][_0x08cb('0x3b')]);}}}else{var _0x38dda4=_(_0x47924e['query'])[_0x08cb('0x4c')]()['map'](function(_0x553ed6){return _[_0x08cb('0x77')](_0x384f72,[_0x08cb('0x3c'),_0x553ed6])?_0x553ed6:undefined;})[_0x08cb('0x78')]()[_0x08cb('0x68')]();if(!_[_0x08cb('0x79')](_0x38dda4)){_0x38dda4[_0x08cb('0x42')](function(_0xdd5c5f){if(_0xdd5c5f==='ChatWebsiteId'){_0x4e9fdb[_0x08cb('0x51')](_0x08cb('0x7a'),[][_0x08cb('0x7b')](_0x47924e[_0x08cb('0x4b')][_0xdd5c5f]));}else if(_0xdd5c5f===_0x08cb('0x7c')){var _0x40120e=JSON['parse'](_0x47924e[_0x08cb('0x4b')][_0xdd5c5f])[_0x08cb('0x7d')];var _0x546206=JSON['parse'](_0x47924e[_0x08cb('0x4b')][_0xdd5c5f])[_0x08cb('0x7e')];_0x4e9fdb['where'](_0x08cb('0x7f'),_0x40120e,_0x546206);}else{if(_0x47924e['query'][_0xdd5c5f]===_0x08cb('0x80')){_0x4e9fdb[_0x08cb('0x51')]('i.'+_0xdd5c5f+_0x08cb('0x81'));}else{_0x4e9fdb[_0x08cb('0x51')]('i.'+_0xdd5c5f+_0x08cb('0x82'),_0x47924e[_0x08cb('0x4b')][_0xdd5c5f]);}}});}if(_0x47924e[_0x08cb('0x4b')][_0x08cb('0x83')]){if(_0x47924e[_0x08cb('0x4b')][_0x08cb('0x83')]==0x1){_0x4e9fdb[_0x08cb('0x84')]('`unreadMessages`\x20=\x200');}else{_0x4e9fdb[_0x08cb('0x84')](_0x08cb('0x85'));}}if(_0x47924e[_0x08cb('0x4b')][_0x08cb('0x86')]){_0x274680=_['isArray'](_0x47924e[_0x08cb('0x4b')][_0x08cb('0x86')])?_0x47924e['query'][_0x08cb('0x86')]:new Array(_0x47924e[_0x08cb('0x4b')][_0x08cb('0x86')]);_0x274680[_0x08cb('0x42')](function(_0x3dac11){_0x490d5d['or'](_0x08cb('0x87'),'%,'+_0x3dac11+',%');});}if(_0x47924e[_0x08cb('0x4b')][_0x08cb('0x88')]){var _0xcec256=_0x47924e[_0x08cb('0x4b')]['filter'][_0x08cb('0x89')]('\x5c','\x5c\x5c')['replace']('\x27\x27','\x27\x27\x27\x27');if(qs[_0x08cb('0x8a')](_0xcec256)){_0x5462ba['or'](_0x08cb('0x8b'),_0xcec256+'%');}else{var _0x4c9d87=[];_0xcec256[_0x08cb('0x8c')]('\x20')[_0x08cb('0x42')](function(_0x5241bb){_0x4c9d87[_0x08cb('0x43')]('+'+_0x5241bb['toString']());});var _0x33c768=_0x4c9d87[_0x08cb('0x8d')]('\x20');_0x5462ba['or'](_0x08cb('0x8e'),_0x33c768)['or'](_0x08cb('0x8f'),_0xcec256+'%');}}}_0x4e9fdb['where'](_0x5462ba);_0x4e9fdb[_0x08cb('0x90')]('i.id');var _0x4d39a3={'type':db[_0x08cb('0x91')]['QueryTypes']['SELECT'],'raw':!![]};var _0x4bae70=_0x4e9fdb['clone']();_0x4bae70[_0x08cb('0x54')](_0x08cb('0x92'));_0x4bae70[_0x08cb('0x54')](_0x08cb('0x93'),'unreadMessages');if(_0x561a5a[_0x08cb('0x94')]){_0x561a5a[_0x08cb('0x94')][_0x08cb('0x42')](function(_0x3128fe){_0x4e9fdb[_0x08cb('0x94')]('i.'+_0x3128fe[0x0],_0x3128fe[0x1]==='DESC'?![]:!![]);});}if(!_[_0x08cb('0x79')](_0x274680)){_0x4e9fdb['having'](_0x490d5d);_0x4bae70[_0x08cb('0x51')](_0x08cb('0x95'),_0x274680);}db[_0x08cb('0x96')][_0x08cb('0x4b')](_0x4bae70['toString'](),_0x4d39a3)[_0x08cb('0x24')](function(_0x3b09ee){_0x1e979e['count']=_0x3b09ee[_0x08cb('0x97')];if(_0x1e979e['count']===0x0)return[];return db['sequelize']['query'](_0x236499[_0x08cb('0x98')](),_0x4d39a3)[_0x08cb('0x24')](function(_0x40aa1d){_0xc03e96=_['keyBy'](_0x40aa1d,'id');_0x4d39a3=_[_0x08cb('0x99')](_0x4d39a3,{'model':db[_0x08cb('0x46')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x4e9fdb[_0x08cb('0x54')](_0x08cb('0x93'),'unreadMessages');_0x4e9fdb[_0x08cb('0x54')](_0x08cb('0x9a'),_0x08cb('0x9b'));_0x4e9fdb[_0x08cb('0x54')](_0x08cb('0x9c'),_0x08cb('0x9d'));_0x4e9fdb[_0x08cb('0x54')](_0x08cb('0x9e'));_0x4e9fdb[_0x08cb('0x54')]('c.firstName',_0x08cb('0x9f'));_0x4e9fdb['field']('c.lastName',_0x08cb('0xa0'));_0x4e9fdb[_0x08cb('0x54')]('c.email',_0x08cb('0xa1'));_0x4e9fdb[_0x08cb('0x54')](_0x08cb('0xa2'),_0x08cb('0xa3'));_0x4e9fdb[_0x08cb('0x54')](_0x08cb('0xa4'),_0x08cb('0xa5'));_0x4e9fdb['field']('c.fax',_0x08cb('0xa6'));_0x4e9fdb[_0x08cb('0x54')](_0x08cb('0xa7'),_0x08cb('0x40'));_0x4e9fdb[_0x08cb('0x34')](_0x561a5a[_0x08cb('0x34')]);_0x4e9fdb[_0x08cb('0x33')](_0x561a5a[_0x08cb('0x33')]);return db[_0x08cb('0x96')]['query'](_0x4e9fdb['toString'](),_0x4d39a3);})['then'](function(_0x4c486a){_0xc17df9['where']('ui.ChatInteractionId\x20IN\x20?',_[_0x08cb('0x3f')](_0x4c486a,'id'));return db[_0x08cb('0x96')][_0x08cb('0x4b')](_0xc17df9[_0x08cb('0x98')](),_0x4d39a3)[_0x08cb('0x24')](function(_0x55cfe2){var _0x5f414b=_[_0x08cb('0xa8')](_0x55cfe2,_0x08cb('0xa9'));var _0xa417e8=[];_0x4c486a[_0x08cb('0x42')](function(_0xa8240f){_0xa417e8[_0x08cb('0x43')](updateChatInteraction(_0xa8240f,_0xc03e96,_0x5f414b));});return BPromise[_0x08cb('0xaa')](_0xa417e8);});});})['then'](function(_0x1cae0a){_0x1e979e['rows']=_0x1cae0a;return _0x1e979e;})[_0x08cb('0x24')](respondWithFilteredResult(_0x346c4c,_0x561a5a))[_0x08cb('0x44')](handleError(_0x346c4c,null));};exports[_0x08cb('0xab')]=function(_0x8c8d3d,_0x46378f){var _0x2d84b4={'raw':![],'where':{'id':_0x8c8d3d['params']['id']}},_0x11f928={};_0x11f928[_0x08cb('0x4a')]=_['keys'](db[_0x08cb('0x46')][_0x08cb('0x47')]);_0x11f928[_0x08cb('0x4b')]=_[_0x08cb('0x4c')](_0x8c8d3d['query']);_0x11f928['filters']=_[_0x08cb('0xac')](_0x11f928[_0x08cb('0x4a')],_0x11f928[_0x08cb('0x4b')]);_0x2d84b4['attributes']=_[_0x08cb('0xac')](_0x11f928[_0x08cb('0x4a')],qs[_0x08cb('0x4f')](_0x8c8d3d[_0x08cb('0x4b')][_0x08cb('0x4f')]));_0x2d84b4[_0x08cb('0x4e')]=_0x2d84b4['attributes']['length']?_0x2d84b4[_0x08cb('0x4e')]:_0x11f928[_0x08cb('0x4a')];if(_0x8c8d3d['query'][_0x08cb('0xad')]){_0x2d84b4[_0x08cb('0xae')]=[{'all':!![]}];}_0x2d84b4=_[_0x08cb('0x99')]({},_0x2d84b4,_0x8c8d3d[_0x08cb('0xaf')]);return db['ChatInteraction'][_0x08cb('0x67')](_0x2d84b4)[_0x08cb('0x24')](handleEntityNotFound(_0x46378f,null))['then'](respondWithResult(_0x46378f,null))[_0x08cb('0x44')](handleError(_0x46378f,null));};exports['create']=function(_0x1d53bd,_0x5f23bc){return db[_0x08cb('0x46')][_0x08cb('0xb0')](_0x1d53bd[_0x08cb('0xb1')],{})[_0x08cb('0x24')](respondWithResult(_0x5f23bc,0xc9))[_0x08cb('0x44')](handleError(_0x5f23bc,null));};exports[_0x08cb('0x39')]=function(_0x10dd15,_0x1f4cfb){if(_0x10dd15[_0x08cb('0xb1')]['id']){delete _0x10dd15[_0x08cb('0xb1')]['id'];}return db[_0x08cb('0x46')][_0x08cb('0x67')]({'where':{'id':_0x10dd15[_0x08cb('0xb2')]['id']}})[_0x08cb('0x24')](handleEntityNotFound(_0x1f4cfb,null))[_0x08cb('0x24')](saveUpdates(_0x10dd15[_0x08cb('0xb1')],null))['then'](respondWithResult(_0x1f4cfb,null))[_0x08cb('0x44')](handleError(_0x1f4cfb,null));};exports[_0x08cb('0x3a')]=function(_0x2b597e,_0x5a9043){return db[_0x08cb('0x46')]['find']({'where':{'id':_0x2b597e['params']['id']}})[_0x08cb('0x24')](handleEntityNotFound(_0x5a9043,null))[_0x08cb('0x24')](removeEntity(_0x5a9043,null))[_0x08cb('0x44')](handleError(_0x5a9043,null));};exports[_0x08cb('0xb3')]=function(_0x43149c,_0xcee084){return db[_0x08cb('0x46')][_0x08cb('0xb3')]()[_0x08cb('0x24')](respondWithResult(_0xcee084,null))[_0x08cb('0x44')](handleError(_0xcee084,null));};exports[_0x08cb('0xb4')]=function(_0x13af46,_0x356419){if(_0x13af46[_0x08cb('0xb1')]['id']){delete _0x13af46['body']['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x13af46['params']['id']}})[_0x08cb('0x24')](handleEntityNotFound(_0x356419,null))[_0x08cb('0x24')](saveUpdates(_0x13af46[_0x08cb('0xb1')],null))[_0x08cb('0x24')](respondWithResult(_0x356419,null))[_0x08cb('0x44')](handleError(_0x356419,null));};exports[_0x08cb('0xb5')]=function(_0x5eadbe,_0xe93bc5,_0x39efe8){if(_0x5eadbe[_0x08cb('0xb1')]['id']){delete _0x5eadbe['body']['id'];}return db[_0x08cb('0x46')][_0x08cb('0x67')]({'where':{'id':_0x5eadbe['params']['id']}})[_0x08cb('0x24')](function(_0x148c2f){if(!_0x148c2f){logger[_0x08cb('0x29')](_0x08cb('0xb6'),_0x08cb('0xb5'),0x194,'entity\x20not\x20found');_0xe93bc5[_0x08cb('0x2f')](0x194);}else{if(_0x148c2f['UserId']){throw new db[(_0x08cb('0x91'))][(_0x08cb('0xb7'))]('Interaction\x20already\x20assigned');}}return _0x148c2f;})[_0x08cb('0x24')](function(_0x30682c){if(_0x30682c){return _0x30682c[_0x08cb('0x39')]({'closed':_0x5eadbe[_0x08cb('0xb1')][_0x08cb('0xb8')],'disposition':_0x5eadbe[_0x08cb('0xb1')][_0x08cb('0xb9')]})['then'](function(_0x5f242b){return _0x5f242b;});}})['then'](function(_0x360390){return respondWithRpcPromise(_0x08cb('0xba'),_0x08cb('0xb5'),_0x5eadbe[_0x08cb('0xb1')],client9004);})['then'](respondWithResult(_0xe93bc5,null))[_0x08cb('0x44')](handleError(_0xe93bc5,null));};exports['attachmentUpload']=function(_0x4c75a1,_0x4d5543,_0x4be968){_0x4c75a1[_0x08cb('0xb1')]['name']=_0x4c75a1[_0x08cb('0xbb')][_0x08cb('0xbc')];_0x4c75a1[_0x08cb('0xb1')][_0x08cb('0xbd')]=_0x4c75a1[_0x08cb('0xbb')][_0x08cb('0xbe')];_0x4c75a1[_0x08cb('0xb1')][_0x08cb('0x70')]=_0x4c75a1['file']['mimetype'];return db['Attachment'][_0x08cb('0xb0')](_0x4c75a1[_0x08cb('0xb1')])[_0x08cb('0x24')](respondWithResult(_0x4d5543,0xc9))[_0x08cb('0x44')](handleError(_0x4d5543,null));};exports['attachmentDownload']=function(_0x3347f6,_0x2f7fd3,_0x26a1e0){return db[_0x08cb('0x46')][_0x08cb('0xbf')]({'where':{'id':_0x3347f6[_0x08cb('0xb2')]['id']},'raw':!![]})[_0x08cb('0x24')](handleEntityNotFound(_0x2f7fd3,null))[_0x08cb('0x24')](function(_0x4ec5dd){if(_0x4ec5dd){if(_0x4ec5dd[_0x08cb('0xb8')]){return _0x2f7fd3['status'](0x193)['json']({'status':0x193,'message':_0x08cb('0xc0')});}return db[_0x08cb('0xc1')][_0x08cb('0xbf')]({'where':{'id':_0x3347f6['query']['attachId']},'raw':!![]})[_0x08cb('0x24')](handleEntityNotFound(_0x2f7fd3,null));}})[_0x08cb('0x24')](function(_0x41adc5){if(_0x41adc5){return _0x2f7fd3[_0x08cb('0xc2')](path[_0x08cb('0x8d')](config[_0x08cb('0xc3')],_0x08cb('0xc4'),_0x41adc5[_0x08cb('0xbd')]));}})[_0x08cb('0x44')](handleError(_0x2f7fd3,null));};exports[_0x08cb('0xc5')]=function(_0x5de139,_0x42a32e){var _0x5eafc2=null;var _0x347772=null;var _0x4561f4=null;var _0x58811d=null;if(_0x5de139[_0x08cb('0xb1')]['id']){delete _0x5de139[_0x08cb('0xb1')]['id'];}if(_0x5de139[_0x08cb('0xb1')][_0x08cb('0xc6')]){_0x58811d=path[_0x08cb('0x8d')](config[_0x08cb('0xc3')],_0x08cb('0xc7'),util[_0x08cb('0xc8')]('transcript-%s.txt',Date[_0x08cb('0xc9')]()));_0x5de139[_0x08cb('0xb1')][_0x08cb('0xca')]=_0x58811d;}return db[_0x08cb('0x46')][_0x08cb('0x67')]({'where':{'id':_0x5de139['params']['id']},'include':[{'model':db['ChatMessage'],'as':_0x08cb('0xcb'),'include':[{'model':db[_0x08cb('0x75')],'as':_0x08cb('0x75')}]}]})['then'](handleEntityNotFound(_0x42a32e,null))['then'](saveUpdates(_0x5de139['body'],null))[_0x08cb('0x24')](function(_0x314e62){if(_0x314e62){_0x5eafc2=_0x314e62;return db['ChatWebsite'][_0x08cb('0x67')]({'where':{'id':_0x5eafc2['ChatWebsiteId']}});}})[_0x08cb('0x24')](function(_0xa6ad9c){if(_0xa6ad9c){_0x4561f4=_0xa6ad9c;return db[_0x08cb('0xcc')][_0x08cb('0x67')]({'where':{'id':_0x5eafc2[_0x08cb('0x6e')]}});}})[_0x08cb('0x24')](function(_0x3661d2){if(_0x3661d2){_0x347772=_0x3661d2;if(_0x58811d){var _0x25d3ec=null;for(var _0x4c07e2=0x1;_0x4c07e2<_0x5eafc2[_0x08cb('0xcb')][_0x08cb('0x97')];++_0x4c07e2){_0x25d3ec=_0x5eafc2[_0x08cb('0xcb')][_0x4c07e2];var _0x3c34bc=_0x25d3ec['UserId']?util[_0x08cb('0xc8')](_0x08cb('0xcd'),_0x4561f4[_0x08cb('0xce')],_0x25d3ec['UserId']):'System';var _0x1e244f=_0x5de139[_0x08cb('0xb1')][_0x08cb('0xcf')]||util['format']('%s%d',_0x08cb('0xd0'),_0x25d3ec[_0x08cb('0x6e')]);switch(_0x4561f4['agentIdentifier']){case _0x08cb('0xd1'):_0x3c34bc=_0x25d3ec[_0x08cb('0x76')]?util[_0x08cb('0xc8')](_0x08cb('0xcd'),_0x4561f4[_0x08cb('0xce')],_0x25d3ec[_0x08cb('0x76')]):_0x08cb('0xd2');break;case _0x08cb('0xd3'):_0x3c34bc=_0x25d3ec[_0x08cb('0x76')]?_0x25d3ec[_0x08cb('0x75')][_0x08cb('0xd4')]||_0x25d3ec[_0x08cb('0x75')][_0x08cb('0xd5')]:'System';break;case _0x08cb('0xd6'):_0x3c34bc=_0x25d3ec['UserId']?_0x25d3ec[_0x08cb('0x75')]['fullname']:_0x08cb('0xd2');break;default:_0x3c34bc=_0x25d3ec['UserId']?util[_0x08cb('0xc8')](_0x08cb('0xcd'),_0x4561f4[_0x08cb('0xce')],_0x25d3ec[_0x08cb('0x76')]):_0x08cb('0xd2');}var _0x476eff=util[_0x08cb('0xc8')](_0x08cb('0xd7'),moment(_0x25d3ec['createdAt'])['format'](_0x08cb('0xd8')),_0x25d3ec[_0x08cb('0xd9')]==='in'?_0x1e244f:_0x3c34bc,_0x25d3ec[_0x08cb('0xb1')]);if(!_0x25d3ec[_0x08cb('0xda')]){fs[_0x08cb('0xdb')](_0x58811d,_0x476eff);}}return db[_0x08cb('0xdc')][_0x08cb('0xbf')]({'where':{'service':!![]},'include':[{'model':db[_0x08cb('0xdd')],'as':'Smtp','raw':!![]}]});}}})[_0x08cb('0x24')](function(_0x5cfe55){if(_0x5cfe55&&_0x5cfe55[_0x08cb('0xde')]&&_0x5de139['body']){var _0x10e7df={'tls':{'rejectUnauthorized':![]}};if(_0x5cfe55[_0x08cb('0xde')]['service']){_0x10e7df[_0x08cb('0xdf')]=_0x5cfe55['Smtp']['service'];}else{_0x10e7df[_0x08cb('0xe0')]=_0x5cfe55[_0x08cb('0xde')][_0x08cb('0xe0')];_0x10e7df[_0x08cb('0xe1')]=_0x5cfe55[_0x08cb('0xde')][_0x08cb('0xe1')];_0x10e7df[_0x08cb('0xe2')]=_0x5cfe55[_0x08cb('0xde')][_0x08cb('0xe2')];}if(_0x5cfe55[_0x08cb('0xde')][_0x08cb('0xe3')]){_0x10e7df[_0x08cb('0xe4')]={'user':_0x5cfe55[_0x08cb('0xde')]['user'],'pass':_0x5cfe55[_0x08cb('0xde')][_0x08cb('0xe5')]};}return respondWithRpcPromise(_0x08cb('0xe6'),'sendMail',{'account':_0x10e7df,'message':{'from':util[_0x08cb('0xc8')](_0x08cb('0xe7'),_0x5cfe55[_0x08cb('0x3c')],_0x5cfe55[_0x08cb('0xe8')]||_0x5cfe55[_0x08cb('0xde')][_0x08cb('0xe9')]),'to':_0x5de139[_0x08cb('0xb1')][_0x08cb('0xc6')],'subject':_0x08cb('0xea'),'text':util['format']('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x5de139[_0x08cb('0xb1')][_0x08cb('0xc6')]),'attachments':[{'path':_0x58811d}]}})[_0x08cb('0x24')](function(){return _0x5eafc2;})[_0x08cb('0x44')](function(_0x545d0b){console[_0x08cb('0x29')](_0x545d0b);});}else{return _0x5eafc2;}})[_0x08cb('0x24')](respondWithStatusCode(_0x42a32e,0xc8))[_0x08cb('0x44')](handleError(_0x42a32e,null));};exports[_0x08cb('0xeb')]=function(_0x6fab7,_0x38b811,_0x5e678d){return db[_0x08cb('0xec')][_0x08cb('0x67')]({'where':{'id':_0x6fab7[_0x08cb('0xb2')]['id']}})[_0x08cb('0x24')](handleEntityNotFound(_0x38b811,null))['then'](function(_0x533048){if(_0x533048){return _0x533048[_0x08cb('0xeb')](_0x6fab7[_0x08cb('0xb1')][_0x08cb('0xed')],_['omit'](_0x6fab7[_0x08cb('0xb1')],[_0x08cb('0xed'),'id'])||{});}})[_0x08cb('0x24')](respondWithResult(_0x38b811,null))[_0x08cb('0x44')](handleError(_0x38b811,null));};exports[_0x08cb('0xee')]=function(_0x5c4329,_0xd0e730,_0xeaa01e){var _0x29543c={'raw':![],'where':{}};var _0x210d95={};var _0xaa157e={'count':0x0,'rows':[]};return db[_0x08cb('0x46')][_0x08cb('0xbf')]({'where':{'id':_0x5c4329['params']['id']}})[_0x08cb('0x24')](handleEntityNotFound(_0xd0e730,null))[_0x08cb('0x24')](function(_0x432cb8){if(_0x432cb8){_0x210d95[_0x08cb('0x4a')]=_[_0x08cb('0x4c')](db[_0x08cb('0xec')][_0x08cb('0x47')]);_0x210d95[_0x08cb('0x4b')]=_['keys'](_0x5c4329[_0x08cb('0x4b')]);_0x210d95['filters']=_[_0x08cb('0xac')](_0x210d95['model'],_0x210d95[_0x08cb('0x4b')]);_0x29543c[_0x08cb('0x4e')]=_[_0x08cb('0xac')](_0x210d95[_0x08cb('0x4a')],qs[_0x08cb('0x4f')](_0x5c4329['query']['fields']));_0x29543c['attributes']=_0x29543c[_0x08cb('0x4e')][_0x08cb('0x97')]?_0x29543c['attributes']:_0x210d95['model'];if(!_0x5c4329['query'][_0x08cb('0xef')](_0x08cb('0xf0'))){_0x29543c['limit']=qs[_0x08cb('0x34')](_0x5c4329[_0x08cb('0x4b')][_0x08cb('0x34')]);_0x29543c[_0x08cb('0x33')]=qs[_0x08cb('0x33')](_0x5c4329['query'][_0x08cb('0x33')]);}_0x29543c['order']=qs['sort'](_0x5c4329[_0x08cb('0x4b')][_0x08cb('0x50')]);_0x29543c[_0x08cb('0x51')]=qs['filters'](_[_0x08cb('0x52')](_0x5c4329[_0x08cb('0x4b')],_0x210d95[_0x08cb('0x4d')]));_0x29543c['where'][_0x08cb('0xa9')]=_0x432cb8['id'];if(_0x5c4329[_0x08cb('0x4b')][_0x08cb('0x88')]){_0x29543c['where']=_[_0x08cb('0x99')](_0x29543c[_0x08cb('0x51')],{'$or':_['map'](_0x29543c[_0x08cb('0x4e')],function(_0x1336cd){var _0xeeb98a={};_0xeeb98a[_0x1336cd]={'$like':'%'+_0x5c4329[_0x08cb('0x4b')][_0x08cb('0x88')]+'%'};return _0xeeb98a;})});}if(_0x5c4329[_0x08cb('0x4b')][_0x08cb('0x7d')]){var _0x33097e=_0x5c4329[_0x08cb('0x4b')][_0x08cb('0x7d')][_0x08cb('0x8c')](',');var _0x17513e={};_0x17513e[_0x33097e[0x0]]={'$gte':moment(_0x33097e[0x1])[_0x08cb('0xc8')](_0x08cb('0xf1'))};_0x29543c[_0x08cb('0x51')]=_[_0x08cb('0x99')](_0x29543c[_0x08cb('0x51')],_0x17513e);}_0x29543c=_[_0x08cb('0x99')]({},_0x29543c,_0x5c4329['options']);return db[_0x08cb('0xec')][_0x08cb('0x32')]({'where':_0x29543c['where']})[_0x08cb('0x24')](function(_0x2aceb8){_0xaa157e[_0x08cb('0x32')]=_0x2aceb8;if(_0x5c4329[_0x08cb('0x4b')][_0x08cb('0xad')]){_0x29543c[_0x08cb('0xae')]=[{'all':!![]}];}return db[_0x08cb('0xec')][_0x08cb('0xf2')](_0x29543c);})[_0x08cb('0x24')](function(_0x40f4aa){_0xaa157e[_0x08cb('0xf3')]=_0x40f4aa;return _0xaa157e;});}})[_0x08cb('0x24')](respondWithFilteredResult(_0xd0e730,_0x29543c))[_0x08cb('0x44')](handleError(_0xd0e730,null));};exports[_0x08cb('0xf4')]=function(_0x402dc0,_0x39b4fd,_0x53d533){var _0x553aa5={'where':{}},_0x1de7f5={},_0x5f51e3={'count':0x0,'rows':[]};return db[_0x08cb('0x46')][_0x08cb('0xbf')]({'where':{'id':_0x402dc0['params']['id']}})['then'](handleEntityNotFound(_0x39b4fd,null))[_0x08cb('0x24')](function(_0x1ad918){if(_0x1ad918){_0x1de7f5[_0x08cb('0x4a')]=_[_0x08cb('0x4c')](db[_0x08cb('0xec')][_0x08cb('0x47')]);_0x1de7f5[_0x08cb('0x4b')]=_[_0x08cb('0x4c')](_0x402dc0['query']);_0x1de7f5[_0x08cb('0x4d')]=_[_0x08cb('0xac')](_0x1de7f5[_0x08cb('0x4a')],_0x1de7f5[_0x08cb('0x4b')]);_0x553aa5['attributes']=_['intersection'](_0x1de7f5[_0x08cb('0x4a')],qs['fields'](_0x402dc0['query'][_0x08cb('0x4f')]));_0x553aa5[_0x08cb('0x4e')]=_0x553aa5[_0x08cb('0x4e')][_0x08cb('0x97')]?_0x553aa5[_0x08cb('0x4e')]:_0x1de7f5[_0x08cb('0x4a')];if(!_0x402dc0['query']['hasOwnProperty'](_0x08cb('0xf0'))){_0x553aa5[_0x08cb('0x34')]=qs['limit'](_0x402dc0[_0x08cb('0x4b')]['limit']);_0x553aa5[_0x08cb('0x33')]=qs[_0x08cb('0x33')](_0x402dc0['query'][_0x08cb('0x33')]);}_0x553aa5['order']=qs[_0x08cb('0x50')](_0x402dc0[_0x08cb('0x4b')][_0x08cb('0x50')]);_0x553aa5[_0x08cb('0x51')]=qs[_0x08cb('0x4d')](_[_0x08cb('0x52')](_0x402dc0[_0x08cb('0x4b')],_0x1de7f5[_0x08cb('0x4d')]));_0x553aa5[_0x08cb('0x51')][_0x08cb('0xa9')]=_0x1ad918['id'];if(_0x402dc0[_0x08cb('0x4b')][_0x08cb('0x88')]){_0x553aa5[_0x08cb('0x51')]=_[_0x08cb('0x99')](_0x553aa5['where'],{'$or':_[_0x08cb('0x3f')](_0x553aa5[_0x08cb('0x4e')],function(_0x2d9e5d){var _0xa02dc1={};_0xa02dc1[_0x2d9e5d]={'$like':'%'+_0x402dc0['query'][_0x08cb('0x88')]+'%'};return _0xa02dc1;})});}_0x553aa5['where']['secret']=![];if(_0x402dc0[_0x08cb('0x4b')]['id']){_0x553aa5[_0x08cb('0x51')]['id']={'$gt':_0x402dc0[_0x08cb('0x4b')]['id']};}_0x553aa5=_[_0x08cb('0x99')]({},_0x553aa5,_0x402dc0[_0x08cb('0xaf')]);return db[_0x08cb('0xec')][_0x08cb('0x32')]({'where':_0x553aa5[_0x08cb('0x51')]})[_0x08cb('0x24')](function(_0x3ed049){_0x5f51e3['count']=_0x3ed049;_0x553aa5[_0x08cb('0xae')]=[];if(_0x402dc0[_0x08cb('0x4b')]['includeAgent']){_0x553aa5[_0x08cb('0xae')][_0x08cb('0x43')]({'model':db['User'],'as':_0x08cb('0x75'),'attributes':['id',_0x08cb('0xd5'),_0x08cb('0xd4')]});}if(_0x402dc0['query'][_0x08cb('0xad')]){_0x553aa5[_0x08cb('0xae')]=[{'all':!![]}];}return db[_0x08cb('0xec')][_0x08cb('0xf2')](_0x553aa5);})['then'](function(_0x4a3bff){_0x5f51e3[_0x08cb('0xf3')]=_0x4a3bff;return _0x5f51e3;});}})['then'](respondWithFilteredResult(_0x39b4fd,_0x553aa5))['catch'](handleError(_0x39b4fd,null));};exports['addTags']=function(_0x430c58,_0x57a193,_0x90017a){return db[_0x08cb('0x46')][_0x08cb('0x67')]({'where':{'id':_0x430c58[_0x08cb('0xb2')]['id']}})[_0x08cb('0x24')](handleEntityNotFound(_0x57a193,null))[_0x08cb('0x24')](function(_0x4c098a){if(_0x4c098a){return _0x4c098a[_0x08cb('0xf5')](_0x430c58[_0x08cb('0xb1')][_0x08cb('0xed')],_[_0x08cb('0xf6')](_0x430c58[_0x08cb('0xb1')],['ids','id'])||{})[_0x08cb('0xf7')](function(){return db[_0x08cb('0x73')][_0x08cb('0xf2')]({'attributes':['id',_0x08cb('0x3c'),_0x08cb('0x55')],'where':{'id':_0x430c58[_0x08cb('0xb1')]['ids']}});})[_0x08cb('0x24')](function(_0xad44e6){socket['emit'](_0x08cb('0xf8'),{'id':Number(_0x430c58['params']['id']),'tags':_0xad44e6||[]});return{'id':Number(_0x430c58[_0x08cb('0xb2')]['id']),'tags':_0xad44e6||[]};});}})[_0x08cb('0x24')](respondWithResult(_0x57a193,null))[_0x08cb('0x44')](handleError(_0x57a193,null));};exports[_0x08cb('0xf9')]=function(_0x469a6e,_0x42a9d1,_0x1556a0){return db[_0x08cb('0x46')][_0x08cb('0x67')]({'where':{'id':_0x469a6e[_0x08cb('0xb2')]['id']}})[_0x08cb('0x24')](handleEntityNotFound(_0x42a9d1,null))['then'](function(_0x45d613){if(_0x45d613){return _0x45d613['removeTags'](_0x469a6e[_0x08cb('0x4b')]['ids']);}})[_0x08cb('0x24')](respondWithStatusCode(_0x42a9d1,null))[_0x08cb('0x44')](handleError(_0x42a9d1,null));};exports[_0x08cb('0xc2')]=function(_0x2686c7,_0x1e5e3f){var _0x5a5253=moment()[_0x08cb('0xfa')]()[_0x08cb('0x98')]();var _0x2a3e61=path[_0x08cb('0x8d')](config['root'],'server',_0x08cb('0xfb'),_0x08cb('0xfc'));var _0x145f59=path[_0x08cb('0x8d')](config[_0x08cb('0xc3')],_0x08cb('0xfd'),'files',_0x08cb('0xfe'));var _0x42f856=path[_0x08cb('0x8d')](_0x2a3e61,_0x5a5253);var _0x4d4116=util[_0x08cb('0xc8')](_0x08cb('0xff'),_0x2686c7['params']['id'],_0x5a5253);var _0x144244=path[_0x08cb('0x8d')](_0x2a3e61,_0x4d4116);var _0x5b6e4b=![];return db[_0x08cb('0x46')][_0x08cb('0x67')]({'where':{'id':_0x2686c7[_0x08cb('0xb2')]['id']},'include':[{'model':db['ChatMessage'],'as':_0x08cb('0xcb'),'attributes':['id',_0x08cb('0xb1'),_0x08cb('0x7c'),_0x08cb('0xd9'),_0x08cb('0xda'),_0x08cb('0x83')],'include':[{'model':db[_0x08cb('0x75')],'as':_0x08cb('0x75'),'attributes':['id','fullname'],'raw':!![]},{'model':db[_0x08cb('0xcc')],'as':_0x08cb('0x6a'),'attributes':['id','firstName',_0x08cb('0x100')],'raw':!![]},{'model':db[_0x08cb('0xc1')],'as':_0x08cb('0xc1'),'raw':!![]}]},{'model':db[_0x08cb('0x101')],'as':_0x08cb('0x102'),'attributes':['id',_0x08cb('0x3c')]},{'model':db[_0x08cb('0x75')],'as':_0x08cb('0x103'),'attributes':['id',_0x08cb('0xd5')]}]})[_0x08cb('0x24')](handleEntityNotFound(_0x1e5e3f,null))[_0x08cb('0x24')](function(_0x5c272e){if(_0x5c272e){var _0x2a84c8=_0x5c272e[_0x08cb('0x104')]({'plain':!![]});_0x5b6e4b=!![];var _0x1fb5b0={'format':'A4','border':_0x08cb('0x105'),'header':{'height':_0x08cb('0x106'),'contents':{'first':_0x08cb('0x107')}},'footer':{'height':_0x08cb('0x108'),'contents':{'default':util[_0x08cb('0xc8')]('\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',util[_0x08cb('0xc8')](_0x08cb('0x109'),_0x08cb('0x10a'),_0x2a84c8['id']),moment()[_0x08cb('0xc8')](_0x08cb('0x10b'))[_0x08cb('0x98')]())}}};fs['mkdirSync'](_0x42f856);var _0x514165={'channel':_0x08cb('0x10a'),'account':_0x2a84c8[_0x08cb('0x102')]['name'],'agent':_0x2a84c8['Owner']?_0x2a84c8[_0x08cb('0x103')]['fullname']:'N.A.','createdAt':moment(_0x2a84c8[_0x08cb('0x7c')])[_0x08cb('0xc8')](_0x08cb('0xf1'))[_0x08cb('0x98')](),'closedAt':_0x2a84c8['closed']?moment(_0x2a84c8['closedAt'])[_0x08cb('0xc8')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x2a84c8['disposition'],'chatInfo':{'browser':_0x2a84c8[_0x08cb('0x10c')],'os':_0x2a84c8[_0x08cb('0x10d')],'referer':_0x2a84c8[_0x08cb('0x10e')],'customerIp':_0x2a84c8[_0x08cb('0x10f')],'customerPort':_0x2a84c8[_0x08cb('0x110')]?_0x2a84c8['customerPort']:_0x08cb('0x111')},'messages':_(_0x2a84c8[_0x08cb('0xcb')])[_0x08cb('0x112')]()[_0x08cb('0x88')]({'secret':![]})['map'](function(_0x481072){if(_0x481072[_0x08cb('0xc1')]){var _0x1922b3=path['join'](_0x145f59,_0x481072[_0x08cb('0xc1')][_0x08cb('0xbd')]);if(fs[_0x08cb('0x113')](_0x1922b3)){fs['createReadStream'](_0x1922b3)[_0x08cb('0x114')](fs[_0x08cb('0x115')](path['join'](_0x42f856,_0x481072[_0x08cb('0xc1')]['basename'])));}}return{'date':moment(_0x481072[_0x08cb('0x7c')])[_0x08cb('0xc8')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x481072[_0x08cb('0xd9')]===_0x08cb('0x116')?_0x481072[_0x08cb('0x75')]?_0x481072['User']['fullname']:_0x08cb('0xd2'):_0x481072['Contact'][_0x08cb('0x117')]+(_0x481072['Contact'][_0x08cb('0x100')]?'\x20'+_0x481072[_0x08cb('0x6a')][_0x08cb('0x100')]:''),'body':_0x481072['Attachment']?_0x481072[_0x08cb('0xc1')][_0x08cb('0xbd')]:_0x481072[_0x08cb('0xb1')],'direction':_0x481072[_0x08cb('0xd9')]===_0x08cb('0x116')?'A':'C','secret':_0x481072[_0x08cb('0xda')],'read':_0x481072[_0x08cb('0x83')],'attachment':_0x481072[_0x08cb('0xc1')]};})['value']()};return ejs[_0x08cb('0x118')](path['join'](config[_0x08cb('0xc3')],_0x08cb('0xfd'),_0x08cb('0x119'),'downloadInteraction.html'),{'interaction':_0x514165})['then'](function(_0x207b16){return new BPromise(function(_0xbd81ff,_0x4125c0){pdf['create'](_0x207b16,_0x1fb5b0)['toFile'](path[_0x08cb('0x8d')](_0x42f856,'transcript-'+_0x2a84c8['id']+'-'+_0x5a5253+_0x08cb('0x11a')),function(_0x268bc9,_0x1a988d){if(_0x268bc9)return _0x4125c0(_0x268bc9);_0xbd81ff(_0x1a988d);});});});}})[_0x08cb('0x24')](function(){if(_0x5b6e4b){return new BPromise(function(_0x5afc07,_0x52c359){zipdir(_0x42f856,{'saveTo':_0x144244},function(_0x4a7c12,_0x40b17b){if(_0x4a7c12)return _0x52c359(_0x4a7c12);return _0x5afc07(_0x40b17b);});})[_0x08cb('0x24')](function(){return new BPromise(function(_0x5a5799,_0x1a1e14){rimraf(_0x42f856,function(_0x1c537c){if(_0x1c537c)_0x1a1e14(_0x1c537c);return _0x5a5799();});});})['then'](function(){return _0x1e5e3f[_0x08cb('0xc2')](_0x144244,_0x4d4116,function(_0x5e84cb){if(_0x5e84cb){console[_0x08cb('0x11b')]('err',_0x5e84cb);}else{fs[_0x08cb('0x11c')](_0x144244);}});});}else{return _0x1e5e3f[_0x08cb('0x2f')](0xc8);}})[_0x08cb('0x44')](handleError(_0x1e5e3f,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 67e2a55..8088f92 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 _0x3aee=['getUsers','then','setDataValue','Users','map','findAll','length','hook','exports','events','ChatInteraction','../../mysqldb','setMaxListeners','update','remove'];(function(_0x1567e8,_0xa15c03){var _0x346fd1=function(_0x164c55){while(--_0x164c55){_0x1567e8['push'](_0x1567e8['shift']());}};_0x346fd1(++_0xa15c03);}(_0x3aee,0x180));var _0xe3ae=function(_0x59bcb1,_0x5a4b6c){_0x59bcb1=_0x59bcb1-0x0;var _0x4a737f=_0x3aee[_0x59bcb1];return _0x4a737f;};'use strict';var EventEmitter=require(_0xe3ae('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0xe3ae('0x1')];var ChatMessage=require(_0xe3ae('0x2'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xe3ae('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe3ae('0x4'),'afterDestroy':_0xe3ae('0x5')};function emitEvent(_0x5c53a5){return function(_0x191e9d,_0x1b027b,_0x493181){_0x191e9d[_0xe3ae('0x6')]({'attributes':['id'],'raw':!![]})[_0xe3ae('0x7')](function(_0x437f24){_0x191e9d[_0xe3ae('0x8')](_0xe3ae('0x9'),_0x437f24[_0xe3ae('0xa')](function(_0xb405){return{'id':_0xb405['id']};}));return ChatMessage[_0xe3ae('0xb')]({'where':{'ChatInteractionId':_0x191e9d['id'],'direction':'in','read':![]},'raw':!![]});})[_0xe3ae('0x7')](function(_0x20fc75){_0x191e9d[_0xe3ae('0x8')]('unreadMessages',_0x20fc75[_0xe3ae('0xc')]);ChatInteractionEvents['emit'](_0x5c53a5+':'+_0x191e9d['id'],_0x191e9d);ChatInteractionEvents['emit'](_0x5c53a5,_0x191e9d);_0x493181(null);})['catch'](_0x493181(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0xe3ae('0xd')](e,emitEvent(event));}}module[_0xe3ae('0xe')]=ChatInteractionEvents; \ No newline at end of file +var _0x1ddc=['setDataValue','Users','findAll','unreadMessages','emit','hasOwnProperty','exports','events','../../mysqldb','ChatMessage','setMaxListeners','save','remove','getUsers','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1ddc,0x7f));var _0xc1dd=function(_0x1a0d1f,_0x88e7db){_0x1a0d1f=_0x1a0d1f-0x0;var _0x1770a5=_0x1ddc[_0x1a0d1f];return _0x1770a5;};'use strict';var EventEmitter=require(_0xc1dd('0x0'));var ChatInteraction=require(_0xc1dd('0x1'))['db']['ChatInteraction'];var ChatMessage=require(_0xc1dd('0x1'))['db'][_0xc1dd('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xc1dd('0x3')](0x0);var events={'afterCreate':_0xc1dd('0x4'),'afterUpdate':'update','afterDestroy':_0xc1dd('0x5')};function emitEvent(_0x1bddc2){return function(_0x14f1ae,_0x16f445,_0x4223c1){_0x14f1ae[_0xc1dd('0x6')]({'attributes':['id'],'raw':!![]})[_0xc1dd('0x7')](function(_0x43e35c){_0x14f1ae[_0xc1dd('0x8')](_0xc1dd('0x9'),_0x43e35c['map'](function(_0x3a4155){return{'id':_0x3a4155['id']};}));return ChatMessage[_0xc1dd('0xa')]({'where':{'ChatInteractionId':_0x14f1ae['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc1dd('0x7')](function(_0x437759){_0x14f1ae[_0xc1dd('0x8')](_0xc1dd('0xb'),_0x437759['length']);ChatInteractionEvents['emit'](_0x1bddc2+':'+_0x14f1ae['id'],_0x14f1ae);ChatInteractionEvents[_0xc1dd('0xc')](_0x1bddc2,_0x14f1ae);_0x4223c1(null);})['catch'](_0x4223c1(null));};}for(var e in events){if(events[_0xc1dd('0xd')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0xc1dd('0xe')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index bc0bb2f..0081628 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 _0x1332=['bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','lodash','util','moment'];(function(_0x2be0c4,_0x3dd330){var _0x23d84b=function(_0x578ed3){while(--_0x578ed3){_0x2be0c4['push'](_0x2be0c4['shift']());}};_0x23d84b(++_0x3dd330);}(_0x1332,0x19f));var _0x2133=function(_0x834778,_0x35abff){_0x834778=_0x834778-0x0;var _0x2c1f26=_0x1332[_0x834778];return _0x2c1f26;};'use strict';var _=require(_0x2133('0x0'));var util=require(_0x2133('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x2133('0x2'));var BPromise=require(_0x2133('0x3'));var rp=require(_0x2133('0x4'));var fs=require('fs');var path=require(_0x2133('0x5'));var rimraf=require(_0x2133('0x6'));var config=require(_0x2133('0x7'));var attributes=require(_0x2133('0x8'));module[_0x2133('0x9')]=function(_0x2df87e,_0x554a75){return _0x2df87e[_0x2133('0xa')](_0x2133('0xb'),attributes,{'tableName':_0x2133('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x33d547,_0xc43cdb,_0x4bfa63){if(_0x33d547[_0x2133('0xd')](_0x2133('0xe'))){_0x33d547[_0x2133('0xf')]=moment()[_0x2133('0x10')](_0x2133('0x11'));}_0x4bfa63(null,_0x33d547);}},'charset':'utf8mb4','collate':_0x2133('0x12')});}; \ No newline at end of file +var _0x147d=['define','chat_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x147d,0x193));var _0xd147=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x147d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd147('0x0'));var util=require(_0xd147('0x1'));var logger=require('../../config/logger')(_0xd147('0x2'));var moment=require(_0xd147('0x3'));var BPromise=require(_0xd147('0x4'));var rp=require(_0xd147('0x5'));var fs=require('fs');var path=require(_0xd147('0x6'));var rimraf=require(_0xd147('0x7'));var config=require(_0xd147('0x8'));var attributes=require(_0xd147('0x9'));module[_0xd147('0xa')]=function(_0x1cbc35,_0x43d516){return _0x1cbc35[_0xd147('0xb')]('ChatInteraction',attributes,{'tableName':_0xd147('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x179c80,_0x148aab,_0x4e5f27){if(_0x179c80[_0xd147('0xd')](_0xd147('0xe'))){_0x179c80['closedAt']=moment()[_0xd147('0xf')](_0xd147('0x10'));}_0x4e5f27(null,_0x179c80);}},'charset':'utf8mb4','collate':_0xd147('0x11')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 486a5d0..7de92d0 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 _0xa3e5=['randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','defaults','socket.io-emitter','redis','./chatInteraction.socket','register','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes','limit','AddTagsToChatInteraction','find','addTags','omit','ids','AddTags','lodash','moment'];(function(_0x1fae35,_0x385d6a){var _0x22f1a7=function(_0x181ef9){while(--_0x181ef9){_0x1fae35['push'](_0x1fae35['shift']());}};_0x22f1a7(++_0x385d6a);}(_0xa3e5,0x198));var _0x5a3e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa3e5[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x5a3e('0x0'));var util=require('util');var moment=require(_0x5a3e('0x1'));var BPromise=require('bluebird');var rs=require(_0x5a3e('0x2'));var fs=require('fs');var Redis=require(_0x5a3e('0x3'));var db=require(_0x5a3e('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5a3e('0x5'));var config=require('../../config/environment');var jayson=require(_0x5a3e('0x6'));var client=jayson[_0x5a3e('0x7')][_0x5a3e('0x8')]({'port':0x232a});config['redis']=_[_0x5a3e('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x5a3e('0xa'))(new Redis(config[_0x5a3e('0xb')]));require(_0x5a3e('0xc'))[_0x5a3e('0xd')](socket);function respondWithRpcPromise(_0x2ab45e,_0x5c44b4,_0x1fbe2e){return new BPromise(function(_0x2826ac,_0x3e01cd){return client['request'](_0x2ab45e,_0x1fbe2e)[_0x5a3e('0xe')](function(_0x45efe5){logger[_0x5a3e('0xf')]('ChatInteraction,\x20%s,\x20%s',_0x5c44b4,_0x5a3e('0x10'));logger[_0x5a3e('0x11')](_0x5a3e('0x12'),_0x5c44b4,'request\x20sent',JSON[_0x5a3e('0x13')](_0x45efe5));if(_0x45efe5[_0x5a3e('0x14')]){if(_0x45efe5[_0x5a3e('0x14')][_0x5a3e('0x15')]===0x1f4){logger[_0x5a3e('0x14')](_0x5a3e('0x16'),_0x5c44b4,_0x45efe5['error']['message']);return _0x3e01cd(_0x45efe5[_0x5a3e('0x14')][_0x5a3e('0x17')]);}logger['error']('ChatInteraction,\x20%s,\x20%s',_0x5c44b4,_0x45efe5[_0x5a3e('0x14')][_0x5a3e('0x17')]);return _0x2826ac(_0x45efe5[_0x5a3e('0x14')][_0x5a3e('0x17')]);}else{logger['info'](_0x5a3e('0x16'),_0x5c44b4,_0x5a3e('0x10'));_0x2826ac(_0x45efe5[_0x5a3e('0x18')]['message']);}})[_0x5a3e('0x19')](function(_0xb971b8){logger[_0x5a3e('0x14')](_0x5a3e('0x16'),_0x5c44b4,_0xb971b8);_0x3e01cd(_0xb971b8);});});}exports[_0x5a3e('0x1a')]=function(_0x8bc4da){var _0x12b3a3=this;return new Promise(function(_0x3d9432,_0x468097){return db[_0x5a3e('0x1b')][_0x5a3e('0x1c')](_0x8bc4da[_0x5a3e('0x1d')],{'raw':_0x8bc4da['options']?_0x8bc4da[_0x5a3e('0x1e')][_0x5a3e('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x8bc4da[_0x5a3e('0x1e')]?_0x8bc4da[_0x5a3e('0x1e')][_0x5a3e('0x20')]||null:null,'attributes':_0x8bc4da['options']?_0x8bc4da[_0x5a3e('0x1e')][_0x5a3e('0x21')]||null:null,'limit':_0x8bc4da[_0x5a3e('0x1e')]?_0x8bc4da[_0x5a3e('0x1e')][_0x5a3e('0x22')]||null:null})[_0x5a3e('0xe')](function(_0x18bb50){logger['info'](_0x5a3e('0x1a'),_0x8bc4da);logger[_0x5a3e('0x11')](_0x5a3e('0x1a'),_0x8bc4da,JSON['stringify'](_0x18bb50));_0x3d9432(_0x18bb50);})[_0x5a3e('0x19')](function(_0x24e07e){logger[_0x5a3e('0x14')]('UpdateChatInteraction',_0x24e07e[_0x5a3e('0x17')],_0x8bc4da);_0x468097(_0x12b3a3[_0x5a3e('0x14')](0x1f4,_0x24e07e[_0x5a3e('0x17')]));});});};exports[_0x5a3e('0x23')]=function(_0x9c19e1){return new Promise(function(_0x41e565,_0xf23c24){return db[_0x5a3e('0x1b')][_0x5a3e('0x24')]({'where':_0x9c19e1[_0x5a3e('0x1e')]?_0x9c19e1[_0x5a3e('0x1e')][_0x5a3e('0x20')]||null:null})['then'](function(_0x23af6f){if(_0x23af6f){return _0x23af6f[_0x5a3e('0x25')](_0x9c19e1['body']['ids'],_[_0x5a3e('0x26')](_0x9c19e1[_0x5a3e('0x1d')],[_0x5a3e('0x27'),'id'])||{});}})['spread'](function(_0x5c589c){logger[_0x5a3e('0xf')](_0x5a3e('0x28'),_0x9c19e1);logger[_0x5a3e('0x11')]('AddTags',_0x9c19e1,JSON[_0x5a3e('0x13')](_0x5c589c));_0x41e565(_0x5c589c);})[_0x5a3e('0x19')](function(_0x56fd23){logger[_0x5a3e('0x14')](_0x5a3e('0x28'),_0x56fd23[_0x5a3e('0x17')],_0x9c19e1);_0xf23c24(_this[_0x5a3e('0x14')](0x1f4,_0x56fd23[_0x5a3e('0x17')]));});});}; \ No newline at end of file +var _0x84f3=['debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateChatInteraction','ChatInteraction','update','options','raw','limit','find','where','addTags','body','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./chatInteraction.socket','register','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent'];(function(_0x1b123b,_0x283629){var _0x1bb89c=function(_0x163d67){while(--_0x163d67){_0x1b123b['push'](_0x1b123b['shift']());}};_0x1bb89c(++_0x283629);}(_0x84f3,0x1b9));var _0x384f=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0x84f3[_0x5c2e3e];return _0x53f64a;};'use strict';var _=require(_0x384f('0x0'));var util=require(_0x384f('0x1'));var moment=require(_0x384f('0x2'));var BPromise=require(_0x384f('0x3'));var rs=require(_0x384f('0x4'));var fs=require('fs');var Redis=require(_0x384f('0x5'));var db=require(_0x384f('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x384f('0x7'))(_0x384f('0x8'));var config=require(_0x384f('0x9'));var jayson=require(_0x384f('0xa'));var client=jayson[_0x384f('0xb')][_0x384f('0xc')]({'port':0x232a});config[_0x384f('0xd')]=_[_0x384f('0xe')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x384f('0xd')]));require(_0x384f('0xf'))[_0x384f('0x10')](socket);function respondWithRpcPromise(_0x55e70f,_0xa61bd7,_0x442514){return new BPromise(function(_0x50a497,_0x17a14e){return client['request'](_0x55e70f,_0x442514)[_0x384f('0x11')](function(_0x914913){logger[_0x384f('0x12')](_0x384f('0x13'),_0xa61bd7,_0x384f('0x14'));logger[_0x384f('0x15')](_0x384f('0x16'),_0xa61bd7,_0x384f('0x14'),JSON[_0x384f('0x17')](_0x914913));if(_0x914913[_0x384f('0x18')]){if(_0x914913[_0x384f('0x18')][_0x384f('0x19')]===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0xa61bd7,_0x914913[_0x384f('0x18')][_0x384f('0x1a')]);return _0x17a14e(_0x914913[_0x384f('0x18')][_0x384f('0x1a')]);}logger[_0x384f('0x18')](_0x384f('0x13'),_0xa61bd7,_0x914913[_0x384f('0x18')][_0x384f('0x1a')]);return _0x50a497(_0x914913[_0x384f('0x18')][_0x384f('0x1a')]);}else{logger['info'](_0x384f('0x13'),_0xa61bd7,_0x384f('0x14'));_0x50a497(_0x914913[_0x384f('0x1b')][_0x384f('0x1a')]);}})['catch'](function(_0x443c05){logger[_0x384f('0x18')](_0x384f('0x13'),_0xa61bd7,_0x443c05);_0x17a14e(_0x443c05);});});}exports[_0x384f('0x1c')]=function(_0x1360d3){var _0x2b43f3=this;return new Promise(function(_0x53277c,_0xd6b92f){return db[_0x384f('0x1d')][_0x384f('0x1e')](_0x1360d3['body'],{'raw':_0x1360d3['options']?_0x1360d3[_0x384f('0x1f')][_0x384f('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1360d3[_0x384f('0x1f')]?_0x1360d3['options']['where']||null:null,'attributes':_0x1360d3[_0x384f('0x1f')]?_0x1360d3['options']['attributes']||null:null,'limit':_0x1360d3[_0x384f('0x1f')]?_0x1360d3[_0x384f('0x1f')][_0x384f('0x21')]||null:null})[_0x384f('0x11')](function(_0x3969a1){logger[_0x384f('0x12')](_0x384f('0x1c'),_0x1360d3);logger['debug'](_0x384f('0x1c'),_0x1360d3,JSON['stringify'](_0x3969a1));_0x53277c(_0x3969a1);})['catch'](function(_0x39774a){logger[_0x384f('0x18')](_0x384f('0x1c'),_0x39774a['message'],_0x1360d3);_0xd6b92f(_0x2b43f3[_0x384f('0x18')](0x1f4,_0x39774a[_0x384f('0x1a')]));});});};exports['AddTagsToChatInteraction']=function(_0x38f4d8){return new Promise(function(_0x2ed48b,_0x2e80c){return db[_0x384f('0x1d')][_0x384f('0x22')]({'where':_0x38f4d8[_0x384f('0x1f')]?_0x38f4d8[_0x384f('0x1f')][_0x384f('0x23')]||null:null})[_0x384f('0x11')](function(_0x28f016){if(_0x28f016){return _0x28f016[_0x384f('0x24')](_0x38f4d8[_0x384f('0x25')][_0x384f('0x26')],_[_0x384f('0x27')](_0x38f4d8['body'],['ids','id'])||{});}})[_0x384f('0x28')](function(_0xeeeef1){logger[_0x384f('0x12')](_0x384f('0x29'),_0x38f4d8);logger[_0x384f('0x15')]('AddTags',_0x38f4d8,JSON[_0x384f('0x17')](_0xeeeef1));_0x2ed48b(_0xeeeef1);})['catch'](function(_0x3c9662){logger['error'](_0x384f('0x29'),_0x3c9662[_0x384f('0x1a')],_0x38f4d8);_0x2e80c(_this[_0x384f('0x18')](0x1f4,_0x3c9662['message']));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index cb5cba2..c9f7b2c 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 _0x614d=['chatInteraction:','save','update','removeListener','register'];(function(_0x29a821,_0x5ae8d3){var _0xae076c=function(_0x214fa8){while(--_0x214fa8){_0x29a821['push'](_0x29a821['shift']());}};_0xae076c(++_0x5ae8d3);}(_0x614d,0x150));var _0xd614=function(_0x2e8781,_0x3d023c){_0x2e8781=_0x2e8781-0x0;var _0x5e098c=_0x614d[_0x2e8781];return _0x5e098c;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0xd614('0x0'),'remove',_0xd614('0x1')];function createListener(_0x5113eb,_0x409833){return function(_0x1b342c){_0x409833['emit'](_0x5113eb,_0x1b342c);};}function removeListener(_0x32e6c7,_0x4d945f){return function(){ChatInteractionEvents[_0xd614('0x2')](_0x32e6c7,_0x4d945f);};}exports[_0xd614('0x3')]=function(_0x1d3b5d){for(var _0x328ad6=0x0,_0x287a22=events['length'];_0x328ad6<_0x287a22;_0x328ad6++){var _0x3cc48e=events[_0x328ad6];var _0x4c4d02=createListener(_0xd614('0x4')+_0x3cc48e,_0x1d3b5d);ChatInteractionEvents['on'](_0x3cc48e,_0x4c4d02);}}; \ No newline at end of file +var _0xa3c3=['remove','update','emit','removeListener','register','length','chatInteraction:','save'];(function(_0x57643b,_0x1706fe){var _0x53a35b=function(_0x2625e8){while(--_0x2625e8){_0x57643b['push'](_0x57643b['shift']());}};_0x53a35b(++_0x1706fe);}(_0xa3c3,0xd7));var _0x3a3c=function(_0x14631b,_0x472a16){_0x14631b=_0x14631b-0x0;var _0x568bfc=_0xa3c3[_0x14631b];return _0x568bfc;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0x3a3c('0x0'),_0x3a3c('0x1'),_0x3a3c('0x2')];function createListener(_0x1d2340,_0x461962){return function(_0x42373f){_0x461962[_0x3a3c('0x3')](_0x1d2340,_0x42373f);};}function removeListener(_0x2cebe8,_0x503969){return function(){ChatInteractionEvents[_0x3a3c('0x4')](_0x2cebe8,_0x503969);};}exports[_0x3a3c('0x5')]=function(_0x50ea5a){for(var _0x36a872=0x0,_0x4d7f32=events[_0x3a3c('0x6')];_0x36a872<_0x4d7f32;_0x36a872++){var _0x513dc9=events[_0x36a872];var _0x573198=createListener(_0x3a3c('0x7')+_0x513dc9,_0x50ea5a);ChatInteractionEvents['on'](_0x513dc9,_0x573198);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 736bd13..439e562 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 _0x2cfc=['../../components/auth/service','../../config/environment','./chatInteraction.controller','isAuthenticated','index','/describe','get','/:id','show','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','/:id/download','download','post','diskStorage','root','server/files/attachments/','%s-%s','now','originalname','/:id/attachment_upload','single','file','attachmentUpload','/:id/tags','tracked','chat','addTags','put','chatinteraction:update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','removeTags','exports','multer','path','connect-timeout','express','Router'];(function(_0x114a66,_0x56bb5b){var _0x2544c7=function(_0x531d03){while(--_0x531d03){_0x114a66['push'](_0x114a66['shift']());}};_0x2544c7(++_0x56bb5b);}(_0x2cfc,0xe6));var _0xc2cf=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x2cfc[_0x5f0089];return _0x193892;};'use strict';var multer=require(_0xc2cf('0x0'));var util=require('util');var path=require(_0xc2cf('0x1'));var timeout=require(_0xc2cf('0x2'));var express=require(_0xc2cf('0x3'));var router=express[_0xc2cf('0x4')]();var auth=require(_0xc2cf('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc2cf('0x6'));var controller=require(_0xc2cf('0x7'));router['get']('/',auth[_0xc2cf('0x8')](),controller[_0xc2cf('0x9')]);router['get'](_0xc2cf('0xa'),auth[_0xc2cf('0x8')](),controller['describe']);router[_0xc2cf('0xb')](_0xc2cf('0xc'),auth['isChatInteractionAuthorized'](),controller[_0xc2cf('0xd')]);router[_0xc2cf('0xb')](_0xc2cf('0xe'),auth[_0xc2cf('0xf')](),controller[_0xc2cf('0x10')]);router[_0xc2cf('0xb')](_0xc2cf('0x11'),auth[_0xc2cf('0x8')](),controller[_0xc2cf('0x12')]);router[_0xc2cf('0xb')](_0xc2cf('0x13'),auth['isChatInteractionAuthorized'](),controller['getMyMessages']);router['get'](_0xc2cf('0x14'),auth['isAuthenticated'](),controller[_0xc2cf('0x15')]);router[_0xc2cf('0x16')]('/',auth[_0xc2cf('0x8')](),controller['create']);var upload=multer({'storage':multer[_0xc2cf('0x17')]({'destination':function(_0x2cf85f,_0x233f1a,_0x549be9){_0x549be9(null,path['join'](config[_0xc2cf('0x18')],_0xc2cf('0x19')));},'filename':function(_0x23737e,_0x31c8b9,_0x41b859){_0x41b859(null,util['format'](_0xc2cf('0x1a'),Date[_0xc2cf('0x1b')](),_0x31c8b9[_0xc2cf('0x1c')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xc2cf('0x16')](_0xc2cf('0x1d'),upload[_0xc2cf('0x1e')](_0xc2cf('0x1f')),controller[_0xc2cf('0x20')]);router[_0xc2cf('0x16')](_0xc2cf('0x11'),auth[_0xc2cf('0xf')](),controller['addMessage']);router[_0xc2cf('0x16')](_0xc2cf('0x21'),auth[_0xc2cf('0x8')](),interaction[_0xc2cf('0x22')](_0xc2cf('0x23'),'chatinteraction:addtags'),controller[_0xc2cf('0x24')]);router[_0xc2cf('0x25')](_0xc2cf('0xc'),auth[_0xc2cf('0x8')](),interaction[_0xc2cf('0x22')]('chat',_0xc2cf('0x26')),controller['update']);router[_0xc2cf('0x25')](_0xc2cf('0x27'),controller[_0xc2cf('0x28')]);router[_0xc2cf('0x25')](_0xc2cf('0x29'),auth[_0xc2cf('0xf')](),controller[_0xc2cf('0x2a')]);router[_0xc2cf('0x25')](_0xc2cf('0x2b'),controller[_0xc2cf('0x2c')]);router['delete']('/:id',auth[_0xc2cf('0x8')](),interaction[_0xc2cf('0x22')](_0xc2cf('0x23'),'chatinteraction:destroy'),controller['destroy']);router['delete'](_0xc2cf('0x21'),auth[_0xc2cf('0x8')](),controller[_0xc2cf('0x2d')]);module[_0xc2cf('0x2e')]=router; \ No newline at end of file +var _0xf241=['/:id/attachment_download','attachmentDownload','/:id/download','download','post','create','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','replace','attachmentUpload','/:id/tags','tracked','chat','addTags','put','chatinteraction:update','update','/:id/custom_update','customUpdate','abandon','/:id/close','close','delete','chatinteraction:destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','isAuthenticated','get','/describe','describe','/:id','isChatInteractionAuthorized'];(function(_0x2bf7cf,_0x5a28fe){var _0x3c2eab=function(_0x3b77e0){while(--_0x3b77e0){_0x2bf7cf['push'](_0x2bf7cf['shift']());}};_0x3c2eab(++_0x5a28fe);}(_0xf241,0x7b));var _0x1f24=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xf241[_0x4a9fb1];return _0x348672;};'use strict';var multer=require(_0x1f24('0x0'));var util=require(_0x1f24('0x1'));var path=require(_0x1f24('0x2'));var timeout=require('connect-timeout');var express=require(_0x1f24('0x3'));var router=express[_0x1f24('0x4')]();var auth=require(_0x1f24('0x5'));var interaction=require(_0x1f24('0x6'));var config=require(_0x1f24('0x7'));var controller=require(_0x1f24('0x8'));router['get']('/',auth[_0x1f24('0x9')](),controller['index']);router[_0x1f24('0xa')](_0x1f24('0xb'),auth[_0x1f24('0x9')](),controller[_0x1f24('0xc')]);router[_0x1f24('0xa')](_0x1f24('0xd'),auth[_0x1f24('0xe')](),controller['show']);router[_0x1f24('0xa')](_0x1f24('0xf'),auth[_0x1f24('0xe')](),controller[_0x1f24('0x10')]);router['get']('/:id/messages',auth[_0x1f24('0x9')](),controller['getMessages']);router[_0x1f24('0xa')]('/:id/my_messages',auth['isChatInteractionAuthorized'](),controller['getMyMessages']);router[_0x1f24('0xa')](_0x1f24('0x11'),auth[_0x1f24('0x9')](),controller[_0x1f24('0x12')]);router[_0x1f24('0x13')]('/',auth[_0x1f24('0x9')](),controller[_0x1f24('0x14')]);var upload=multer({'storage':multer[_0x1f24('0x15')]({'destination':function(_0x581506,_0x39de98,_0x354669){_0x354669(null,path[_0x1f24('0x16')](config[_0x1f24('0x17')],_0x1f24('0x18')));},'filename':function(_0x48940f,_0x15daa8,_0x6da09a){_0x6da09a(null,util[_0x1f24('0x19')](_0x1f24('0x1a'),Date[_0x1f24('0x1b')](),_0x15daa8[_0x1f24('0x1c')][_0x1f24('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post']('/:id/attachment_upload',upload['single']('file'),controller[_0x1f24('0x1e')]);router[_0x1f24('0x13')]('/:id/messages',auth[_0x1f24('0xe')](),controller['addMessage']);router[_0x1f24('0x13')](_0x1f24('0x1f'),auth[_0x1f24('0x9')](),interaction[_0x1f24('0x20')](_0x1f24('0x21'),'chatinteraction:addtags'),controller[_0x1f24('0x22')]);router[_0x1f24('0x23')](_0x1f24('0xd'),auth['isAuthenticated'](),interaction[_0x1f24('0x20')](_0x1f24('0x21'),_0x1f24('0x24')),controller[_0x1f24('0x25')]);router['put'](_0x1f24('0x26'),controller[_0x1f24('0x27')]);router['put']('/:id/abandon',auth[_0x1f24('0xe')](),controller[_0x1f24('0x28')]);router[_0x1f24('0x23')](_0x1f24('0x29'),controller[_0x1f24('0x2a')]);router[_0x1f24('0x2b')](_0x1f24('0xd'),auth[_0x1f24('0x9')](),interaction[_0x1f24('0x20')](_0x1f24('0x21'),_0x1f24('0x2c')),controller['destroy']);router['delete'](_0x1f24('0x1f'),auth['isAuthenticated'](),controller['removeTags']);module[_0x1f24('0x2d')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 0bb26e5..bd9abcb 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 _0x0295=['sequelize','medium'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x0295,0x1f0));var _0x5029=function(_0x83609a,_0x4623de){_0x83609a=_0x83609a-0x0;var _0x3de3aa=_0x0295[_0x83609a];return _0x3de3aa;};'use strict';var Sequelize=require(_0x5029('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x5029('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x5f2f=['INTEGER','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x30eeaf,_0x352238){var _0x1687da=function(_0x4ee15d){while(--_0x4ee15d){_0x30eeaf['push'](_0x30eeaf['shift']());}};_0x1687da(++_0x352238);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5cecc0,_0x524daf){_0x5cecc0=_0x5cecc0-0x0;var _0x4739a8=_0x5f2f[_0x5cecc0];return _0x4739a8;};'use strict';var Sequelize=require(_0xf5f2('0x0'));module[_0xf5f2('0x1')]={'body':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xf5f2('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xf5f2('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 6c8676b..401ca6d 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 _0x4205=['where','pick','filter','VIRTUAL','options','ChatInternalMessage','count','includeAll','include','findAll','rows','show','params','keys','merge','find','create','body','catch','describe','get','messages','lastMessageAt','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','User','agent','admin','user','fullname','userpic','online','lastLoginAt','allowmessenger','showWebBar','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Agents','userProfileId','isEmpty','length','push','FromId','ToId','-createdAt','all','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','limit','Content-Range','apply','save','update','then','destroy','error','stack','name','index','map','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort'];(function(_0x136985,_0x3d07bd){var _0x4c139d=function(_0x2feddd){while(--_0x2feddd){_0x136985['push'](_0x136985['shift']());}};_0x4c139d(++_0x3d07bd);}(_0x4205,0x1e3));var _0x5420=function(_0x5baa94,_0x592538){_0x5baa94=_0x5baa94-0x0;var _0x14329a=_0x4205[_0x5baa94];return _0x14329a;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x5420('0x0'));var zipdir=require(_0x5420('0x1'));var jsonpatch=require(_0x5420('0x2'));var rp=require(_0x5420('0x3'));var moment=require(_0x5420('0x4'));var BPromise=require(_0x5420('0x5'));var Mustache=require(_0x5420('0x6'));var util=require(_0x5420('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5420('0x8'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x5420('0x9'));var jsforce=require(_0x5420('0xa'));var deskjs=require(_0x5420('0xb'));var toCsv=require(_0x5420('0xc'));var querystring=require(_0x5420('0xd'));var Papa=require('papaparse');var Redis=require(_0x5420('0xe'));var authService=require(_0x5420('0xf'));var qs=require(_0x5420('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5420('0x11'));var logger=require('../../config/logger')(_0x5420('0x12'));var utils=require(_0x5420('0x13'));var config=require(_0x5420('0x14'));var db=require(_0x5420('0x15'))['db'];config[_0x5420('0x16')]=_[_0x5420('0x17')](config[_0x5420('0x16')],{'host':_0x5420('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5420('0x16')]));require(_0x5420('0x19'))[_0x5420('0x1a')](socket);function respondWithStatusCode(_0x4b0bf0,_0x1b2eb5){_0x1b2eb5=_0x1b2eb5||0xcc;return function(_0x31690b){if(_0x31690b){return _0x4b0bf0[_0x5420('0x1b')](_0x1b2eb5);}return _0x4b0bf0[_0x5420('0x1c')](_0x1b2eb5)[_0x5420('0x1d')]();};}function respondWithResult(_0x304a6d,_0x2217f6){_0x2217f6=_0x2217f6||0xc8;return function(_0x1abf57){if(_0x1abf57){return _0x304a6d[_0x5420('0x1c')](_0x2217f6)[_0x5420('0x1e')](_0x1abf57);}};}function respondWithFilteredResult(_0x1604f7,_0x3fd3c1){return function(_0x26d227){if(_0x26d227){var _0x4c43e6=_0x26d227['count'],_0x5957df=_0x3fd3c1[_0x5420('0x1f')],_0x1adbba=_0x3fd3c1[_0x5420('0x1f')]+_0x3fd3c1[_0x5420('0x20')],_0x2ab4bd;if(_0x1adbba>=_0x4c43e6){_0x1adbba=_0x4c43e6;_0x2ab4bd=0xc8;}else{_0x2ab4bd=0xce;}_0x1604f7[_0x5420('0x1c')](_0x2ab4bd);return _0x1604f7['set'](_0x5420('0x21'),_0x5957df+'-'+_0x1adbba+'/'+_0x4c43e6)[_0x5420('0x1e')](_0x26d227);}return null;};}function patchUpdates(_0xdf4854){return function(_0x1d6524){try{jsonpatch[_0x5420('0x22')](_0x1d6524,_0xdf4854,!![]);}catch(_0x2d85dd){return BPromise['reject'](_0x2d85dd);}return _0x1d6524[_0x5420('0x23')]();};}function saveUpdates(_0x4c940f,_0x56dee9){return function(_0x535a05){if(_0x535a05){return _0x535a05[_0x5420('0x24')](_0x4c940f)[_0x5420('0x25')](function(_0x1f1cee){return _0x1f1cee;});}return null;};}function removeEntity(_0x1cdf70,_0x19fbef){return function(_0x142c67){if(_0x142c67){return _0x142c67[_0x5420('0x26')]()[_0x5420('0x25')](function(){_0x1cdf70[_0x5420('0x1c')](0xcc)[_0x5420('0x1d')]();});}};}function handleEntityNotFound(_0x20666b,_0x2d061f){return function(_0xc1937c){if(!_0xc1937c){_0x20666b[_0x5420('0x1b')](0x194);}return _0xc1937c;};}function handleError(_0x566b87,_0x70cbe7){_0x70cbe7=_0x70cbe7||0x1f4;return function(_0x49c94b){logger[_0x5420('0x27')](_0x49c94b[_0x5420('0x28')]);if(_0x49c94b[_0x5420('0x29')]){delete _0x49c94b[_0x5420('0x29')];}_0x566b87['status'](_0x70cbe7)['send'](_0x49c94b);};}exports[_0x5420('0x2a')]=function(_0x1f08ab,_0x523c61){var _0x12980f={},_0x5999d1={},_0x5792f4={'count':0x0,'rows':[]};var _0x325061=_[_0x5420('0x2b')](db['ChatInternalMessage'][_0x5420('0x2c')],function(_0x1f14bc){return{'name':_0x1f14bc['fieldName'],'type':_0x1f14bc[_0x5420('0x2d')][_0x5420('0x2e')]};});_0x5999d1[_0x5420('0x2f')]=_[_0x5420('0x2b')](_0x325061,_0x5420('0x29'));_0x5999d1[_0x5420('0x30')]=_['keys'](_0x1f08ab[_0x5420('0x30')]);_0x5999d1[_0x5420('0x31')]=_[_0x5420('0x32')](_0x5999d1[_0x5420('0x2f')],_0x5999d1[_0x5420('0x30')]);_0x12980f['attributes']=_[_0x5420('0x32')](_0x5999d1[_0x5420('0x2f')],qs['fields'](_0x1f08ab['query'][_0x5420('0x33')]));_0x12980f[_0x5420('0x34')]=_0x12980f[_0x5420('0x34')]['length']?_0x12980f[_0x5420('0x34')]:_0x5999d1[_0x5420('0x2f')];if(!_0x1f08ab[_0x5420('0x30')][_0x5420('0x35')](_0x5420('0x36'))){_0x12980f[_0x5420('0x20')]=qs['limit'](_0x1f08ab[_0x5420('0x30')][_0x5420('0x20')]);_0x12980f[_0x5420('0x1f')]=qs[_0x5420('0x1f')](_0x1f08ab[_0x5420('0x30')][_0x5420('0x1f')]);}_0x12980f[_0x5420('0x37')]=qs[_0x5420('0x38')](_0x1f08ab[_0x5420('0x30')]['sort']);_0x12980f[_0x5420('0x39')]=qs[_0x5420('0x31')](_[_0x5420('0x3a')](_0x1f08ab[_0x5420('0x30')],_0x5999d1[_0x5420('0x31')]));if(_0x1f08ab[_0x5420('0x30')][_0x5420('0x3b')]){_0x12980f[_0x5420('0x39')]=_['merge'](_0x12980f[_0x5420('0x39')],{'$or':_[_0x5420('0x2b')](_0x325061,function(_0x44a4ed){if(_0x44a4ed[_0x5420('0x2d')]['key']!==_0x5420('0x3c')){var _0x66075c={};_0x66075c[_0x44a4ed['field']]={'$like':'%'+_0x1f08ab['query'][_0x5420('0x3b')]+'%'};return _0x66075c;}})});}_0x12980f=_['merge']({},_0x12980f,_0x1f08ab[_0x5420('0x3d')]);var _0x517381={'where':_0x12980f[_0x5420('0x39')]};return db[_0x5420('0x3e')][_0x5420('0x3f')](_0x517381)[_0x5420('0x25')](function(_0x4ba311){_0x5792f4[_0x5420('0x3f')]=_0x4ba311;if(_0x1f08ab[_0x5420('0x30')][_0x5420('0x40')]){_0x12980f[_0x5420('0x41')]=[{'all':!![]}];}return db[_0x5420('0x3e')][_0x5420('0x42')](_0x12980f);})[_0x5420('0x25')](function(_0xd8b2aa){_0x5792f4[_0x5420('0x43')]=_0xd8b2aa;return _0x5792f4;})[_0x5420('0x25')](respondWithFilteredResult(_0x523c61,_0x12980f))['catch'](handleError(_0x523c61,null));};exports[_0x5420('0x44')]=function(_0x3bdd6a,_0xf429d9){var _0x4d1012={'raw':!![],'where':{'id':_0x3bdd6a[_0x5420('0x45')]['id']}},_0x594e8d={};_0x594e8d['model']=_[_0x5420('0x46')](db[_0x5420('0x3e')]['rawAttributes']);_0x594e8d['query']=_['keys'](_0x3bdd6a[_0x5420('0x30')]);_0x594e8d[_0x5420('0x31')]=_[_0x5420('0x32')](_0x594e8d[_0x5420('0x2f')],_0x594e8d[_0x5420('0x30')]);_0x4d1012[_0x5420('0x34')]=_[_0x5420('0x32')](_0x594e8d['model'],qs[_0x5420('0x33')](_0x3bdd6a[_0x5420('0x30')][_0x5420('0x33')]));_0x4d1012[_0x5420('0x34')]=_0x4d1012['attributes']['length']?_0x4d1012[_0x5420('0x34')]:_0x594e8d[_0x5420('0x2f')];if(_0x3bdd6a['query'][_0x5420('0x40')]){_0x4d1012[_0x5420('0x41')]=[{'all':!![]}];}_0x4d1012=_[_0x5420('0x47')]({},_0x4d1012,_0x3bdd6a[_0x5420('0x3d')]);return db[_0x5420('0x3e')][_0x5420('0x48')](_0x4d1012)[_0x5420('0x25')](handleEntityNotFound(_0xf429d9,null))[_0x5420('0x25')](respondWithResult(_0xf429d9,null))['catch'](handleError(_0xf429d9,null));};exports[_0x5420('0x49')]=function(_0x34acf2,_0xf4be17){return db[_0x5420('0x3e')][_0x5420('0x49')](_0x34acf2['body'],{})[_0x5420('0x25')](respondWithResult(_0xf4be17,0xc9))['catch'](handleError(_0xf4be17,null));};exports[_0x5420('0x24')]=function(_0x7f9dc6,_0x27e522){if(_0x7f9dc6[_0x5420('0x4a')]['id']){delete _0x7f9dc6['body']['id'];}return db[_0x5420('0x3e')][_0x5420('0x48')]({'where':{'id':_0x7f9dc6['params']['id']}})[_0x5420('0x25')](handleEntityNotFound(_0x27e522,null))['then'](saveUpdates(_0x7f9dc6['body'],null))['then'](respondWithResult(_0x27e522,null))['catch'](handleError(_0x27e522,null));};exports[_0x5420('0x26')]=function(_0x4cfcb1,_0x1c313d){return db[_0x5420('0x3e')]['find']({'where':{'id':_0x4cfcb1[_0x5420('0x45')]['id']}})[_0x5420('0x25')](handleEntityNotFound(_0x1c313d,null))[_0x5420('0x25')](removeEntity(_0x1c313d,null))[_0x5420('0x4b')](handleError(_0x1c313d,null));};exports[_0x5420('0x4c')]=function(_0xe6d374,_0x45658e){return db[_0x5420('0x3e')][_0x5420('0x4c')]()['then'](respondWithResult(_0x45658e,null))['catch'](handleError(_0x45658e,null));};function wrapUser(_0x29c36c){return function(_0xef9e49){var _0x39a516=_0x29c36c[_0x5420('0x4d')]({'plain':!![]});_0x39a516[_0x5420('0x4e')]=[];if(_0xef9e49){_0x39a516[_0x5420('0x4f')]=_0xef9e49[_0x5420('0x50')];_0x39a516['lastMessage']=_0xef9e49;}else{_0x39a516[_0x5420('0x4f')]=moment(0x0)[_0x5420('0x51')](_0x5420('0x52'));_0x39a516[_0x5420('0x53')]={};}return _0x39a516;};}exports[_0x5420('0x54')]=function(_0x16e214,_0x4f336e,_0xf71ad){var _0x3842d4=[];return db[_0x5420('0x55')][_0x5420('0x42')]({'where':{'role':[_0x5420('0x56'),_0x5420('0x57'),_0x5420('0x58')]},'attributes':['id',_0x5420('0x59'),'name','role',_0x5420('0x5a'),'internal',_0x5420('0x5b'),_0x5420('0x5c'),_0x5420('0x5d'),_0x5420('0x5e')],'order':qs[_0x5420('0x38')]('-online'),'include':[{'model':db[_0x5420('0x5f')],'as':_0x5420('0x60'),'attributes':['id',_0x5420('0x29'),'type'],'through':{'attributes':[]}}]})[_0x5420('0x25')](function(_0x423f43){if(_0x423f43){var _0x152b04=_0x16e214[_0x5420('0x58')][_0x5420('0x4d')]({'plain':!![]});if(!_0x152b04)throw new Error(_0x5420('0x61'));if(_0x152b04[_0x5420('0x62')]===_0x5420('0x58')){return db['UserProfileSection'][_0x5420('0x48')]({'where':{'name':_0x5420('0x63'),'userProfileId':_0x152b04[_0x5420('0x64')]},'raw':!![]})[_0x5420('0x25')](function(_0x171fbe){if(_0x171fbe){if(_0x171fbe['autoAssociation']===0x0){return db['UserProfileResource'][_0x5420('0x42')]({'where':{'sectionId':_0x171fbe['id']},'raw':!![]})['then'](function(_0x53a410){var _0x2e13e0=[];if(_[_0x5420('0x65')](_0x53a410)){_0x2e13e0=_['filter'](_0x423f43,function(_0x2b66c4){if(_0x2b66c4[_0x5420('0x62')]!==_0x5420('0x56')){return _0x2b66c4;}});return _0x2e13e0;}else{for(var _0x3ba18d=0x0;_0x3ba18d<_0x423f43[_0x5420('0x66')];_0x3ba18d++){var _0x3626e3=_0x423f43[_0x3ba18d];if(_0x3626e3[_0x5420('0x62')]===_0x5420('0x56')){var _0x314bdb=_[_0x5420('0x48')](_0x53a410,function(_0x4bb46b){return _0x4bb46b['resourceId']===_0x3626e3['id'];});if(_0x314bdb)_0x2e13e0[_0x5420('0x67')](_0x3626e3);}else{_0x2e13e0[_0x5420('0x67')](_0x3626e3);}}return _0x2e13e0;}});}else{return _0x423f43;}}else{var _0x52138e=_['filter'](_0x423f43,function(_0x1af238){if(_0x1af238[_0x5420('0x62')]!==_0x5420('0x56')){return _0x1af238;}});return _0x52138e;}});}else{return _0x423f43;}}})[_0x5420('0x25')](function(_0xf5cdc3){var _0x24bf68=[];if(_0xf5cdc3){_0x3842d4=_0xf5cdc3;for(var _0x32d993=0x0;_0x32d993<_0xf5cdc3[_0x5420('0x66')];_0x32d993+=0x1){_0x3842d4[_0x32d993]['messages']=[];_0x24bf68[_0x5420('0x67')](db['ChatInternalMessage'][_0x5420('0x48')]({'where':{'FromId':[_0x16e214[_0x5420('0x58')]['id'],_0xf5cdc3[_0x32d993]['id']],'ToId':[_0x16e214[_0x5420('0x58')]['id'],_0xf5cdc3[_0x32d993]['id']],'ChatGroupId':null},'attributes':['id',_0x5420('0x50'),_0x5420('0x68'),_0x5420('0x69'),'read','body'],'order':qs[_0x5420('0x38')](_0x5420('0x6a')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x5420('0x25')](wrapUser(_0xf5cdc3[_0x32d993])));}return BPromise[_0x5420('0x6b')](_0x24bf68);}return[];})[_0x5420('0x25')](function(_0x1eb64a){return{'rows':_0x1eb64a,'count':_0x1eb64a[_0x5420('0x66')]};})['then'](respondWithResult(_0x4f336e,null))['catch'](handleError(_0x4f336e,null));}; \ No newline at end of file +var _0xd165=['rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','where','pick','merge','field','options','includeAll','findAll','catch','show','params','include','find','body','describe','get','createdAt','lastMessageAt','format','User','agent','admin','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','sort','-online','VoiceQueue','VoiceQueues','UserProfileSection','Agents','autoAssociation','UserProfileResource','isEmpty','filter','resourceId','push','messages','FromId','ToId','read','-createdAt','all','html-pdf','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./chatInternalMessage.socket','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','ChatInternalMessage'];(function(_0x244daf,_0x2260d1){var _0x30ce43=function(_0x1e1a93){while(--_0x1e1a93){_0x244daf['push'](_0x244daf['shift']());}};_0x30ce43(++_0x2260d1);}(_0xd165,0xae));var _0x5d16=function(_0x4f9b79,_0x4fff39){_0x4f9b79=_0x4f9b79-0x0;var _0x60c10f=_0xd165[_0x4f9b79];return _0x60c10f;};'use strict';var pdf=require(_0x5d16('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x5d16('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5d16('0x2'));var rp=require(_0x5d16('0x3'));var moment=require(_0x5d16('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5d16('0x5'));var path=require(_0x5d16('0x6'));var sox=require(_0x5d16('0x7'));var csv=require(_0x5d16('0x8'));var ejs=require(_0x5d16('0x9'));var fs=require('fs');var _=require(_0x5d16('0xa'));var squel=require(_0x5d16('0xb'));var crypto=require(_0x5d16('0xc'));var jsforce=require(_0x5d16('0xd'));var deskjs=require(_0x5d16('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5d16('0xf'));var Papa=require(_0x5d16('0x10'));var Redis=require(_0x5d16('0x11'));var authService=require(_0x5d16('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5d16('0x13'));var hardwareService=require(_0x5d16('0x14'));var logger=require(_0x5d16('0x15'))(_0x5d16('0x16'));var utils=require(_0x5d16('0x17'));var config=require(_0x5d16('0x18'));var db=require(_0x5d16('0x19'))['db'];config['redis']=_['defaults'](config[_0x5d16('0x1a')],{'host':_0x5d16('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5d16('0x1a')]));require(_0x5d16('0x1c'))['register'](socket);function respondWithStatusCode(_0x273d2d,_0x48ce8a){_0x48ce8a=_0x48ce8a||0xcc;return function(_0x3be55c){if(_0x3be55c){return _0x273d2d[_0x5d16('0x1d')](_0x48ce8a);}return _0x273d2d[_0x5d16('0x1e')](_0x48ce8a)[_0x5d16('0x1f')]();};}function respondWithResult(_0x4a5816,_0x1c7bc6){_0x1c7bc6=_0x1c7bc6||0xc8;return function(_0x3977f3){if(_0x3977f3){return _0x4a5816[_0x5d16('0x1e')](_0x1c7bc6)[_0x5d16('0x20')](_0x3977f3);}};}function respondWithFilteredResult(_0x2c11ed,_0x38225f){return function(_0x43e973){if(_0x43e973){var _0x10e858=_0x43e973[_0x5d16('0x21')],_0xe1746c=_0x38225f['offset'],_0x1602e0=_0x38225f[_0x5d16('0x22')]+_0x38225f[_0x5d16('0x23')],_0x2d85c2;if(_0x1602e0>=_0x10e858){_0x1602e0=_0x10e858;_0x2d85c2=0xc8;}else{_0x2d85c2=0xce;}_0x2c11ed[_0x5d16('0x1e')](_0x2d85c2);return _0x2c11ed[_0x5d16('0x24')](_0x5d16('0x25'),_0xe1746c+'-'+_0x1602e0+'/'+_0x10e858)[_0x5d16('0x20')](_0x43e973);}return null;};}function patchUpdates(_0x40d822){return function(_0x23864b){try{jsonpatch[_0x5d16('0x26')](_0x23864b,_0x40d822,!![]);}catch(_0xf5a601){return BPromise[_0x5d16('0x27')](_0xf5a601);}return _0x23864b[_0x5d16('0x28')]();};}function saveUpdates(_0x5addbc,_0x15e3d9){return function(_0x4036f4){if(_0x4036f4){return _0x4036f4[_0x5d16('0x29')](_0x5addbc)[_0x5d16('0x2a')](function(_0x157465){return _0x157465;});}return null;};}function removeEntity(_0x1cf7a7,_0x4406b1){return function(_0xe7700c){if(_0xe7700c){return _0xe7700c[_0x5d16('0x2b')]()['then'](function(){_0x1cf7a7[_0x5d16('0x1e')](0xcc)[_0x5d16('0x1f')]();});}};}function handleEntityNotFound(_0xd3f45,_0x448c9f){return function(_0x3a15b4){if(!_0x3a15b4){_0xd3f45[_0x5d16('0x1d')](0x194);}return _0x3a15b4;};}function handleError(_0x3aad3c,_0x28cff5){_0x28cff5=_0x28cff5||0x1f4;return function(_0x593f58){logger['error'](_0x593f58[_0x5d16('0x2c')]);if(_0x593f58[_0x5d16('0x2d')]){delete _0x593f58[_0x5d16('0x2d')];}_0x3aad3c[_0x5d16('0x1e')](_0x28cff5)[_0x5d16('0x2e')](_0x593f58);};}exports[_0x5d16('0x2f')]=function(_0x2f82c2,_0x2d663f){var _0x31f169={},_0x5de925={},_0x1cb3d5={'count':0x0,'rows':[]};var _0x387c89=_[_0x5d16('0x30')](db[_0x5d16('0x31')][_0x5d16('0x32')],function(_0x5c1a30){return{'name':_0x5c1a30[_0x5d16('0x33')],'type':_0x5c1a30[_0x5d16('0x34')][_0x5d16('0x35')]};});_0x5de925[_0x5d16('0x36')]=_[_0x5d16('0x30')](_0x387c89,_0x5d16('0x2d'));_0x5de925[_0x5d16('0x37')]=_[_0x5d16('0x38')](_0x2f82c2['query']);_0x5de925[_0x5d16('0x39')]=_[_0x5d16('0x3a')](_0x5de925[_0x5d16('0x36')],_0x5de925[_0x5d16('0x37')]);_0x31f169['attributes']=_[_0x5d16('0x3a')](_0x5de925[_0x5d16('0x36')],qs['fields'](_0x2f82c2[_0x5d16('0x37')][_0x5d16('0x3b')]));_0x31f169[_0x5d16('0x3c')]=_0x31f169[_0x5d16('0x3c')][_0x5d16('0x3d')]?_0x31f169[_0x5d16('0x3c')]:_0x5de925[_0x5d16('0x36')];if(!_0x2f82c2[_0x5d16('0x37')][_0x5d16('0x3e')]('nolimit')){_0x31f169[_0x5d16('0x23')]=qs[_0x5d16('0x23')](_0x2f82c2[_0x5d16('0x37')]['limit']);_0x31f169[_0x5d16('0x22')]=qs[_0x5d16('0x22')](_0x2f82c2[_0x5d16('0x37')][_0x5d16('0x22')]);}_0x31f169[_0x5d16('0x3f')]=qs['sort'](_0x2f82c2['query']['sort']);_0x31f169[_0x5d16('0x40')]=qs[_0x5d16('0x39')](_[_0x5d16('0x41')](_0x2f82c2['query'],_0x5de925['filters']));if(_0x2f82c2[_0x5d16('0x37')]['filter']){_0x31f169[_0x5d16('0x40')]=_[_0x5d16('0x42')](_0x31f169['where'],{'$or':_[_0x5d16('0x30')](_0x387c89,function(_0x2fefb9){if(_0x2fefb9['type']['key']!=='VIRTUAL'){var _0x43fceb={};_0x43fceb[_0x2fefb9[_0x5d16('0x43')]]={'$like':'%'+_0x2f82c2['query']['filter']+'%'};return _0x43fceb;}})});}_0x31f169=_[_0x5d16('0x42')]({},_0x31f169,_0x2f82c2[_0x5d16('0x44')]);var _0x5de80b={'where':_0x31f169[_0x5d16('0x40')]};return db[_0x5d16('0x31')][_0x5d16('0x21')](_0x5de80b)['then'](function(_0x3e246a){_0x1cb3d5[_0x5d16('0x21')]=_0x3e246a;if(_0x2f82c2[_0x5d16('0x37')][_0x5d16('0x45')]){_0x31f169['include']=[{'all':!![]}];}return db[_0x5d16('0x31')][_0x5d16('0x46')](_0x31f169);})[_0x5d16('0x2a')](function(_0x5aa15a){_0x1cb3d5['rows']=_0x5aa15a;return _0x1cb3d5;})['then'](respondWithFilteredResult(_0x2d663f,_0x31f169))[_0x5d16('0x47')](handleError(_0x2d663f,null));};exports[_0x5d16('0x48')]=function(_0x11cce0,_0x269e42){var _0x3cdce2={'raw':!![],'where':{'id':_0x11cce0[_0x5d16('0x49')]['id']}},_0x51f62b={};_0x51f62b[_0x5d16('0x36')]=_[_0x5d16('0x38')](db[_0x5d16('0x31')][_0x5d16('0x32')]);_0x51f62b[_0x5d16('0x37')]=_['keys'](_0x11cce0[_0x5d16('0x37')]);_0x51f62b[_0x5d16('0x39')]=_[_0x5d16('0x3a')](_0x51f62b[_0x5d16('0x36')],_0x51f62b['query']);_0x3cdce2[_0x5d16('0x3c')]=_[_0x5d16('0x3a')](_0x51f62b[_0x5d16('0x36')],qs[_0x5d16('0x3b')](_0x11cce0[_0x5d16('0x37')][_0x5d16('0x3b')]));_0x3cdce2[_0x5d16('0x3c')]=_0x3cdce2['attributes']['length']?_0x3cdce2[_0x5d16('0x3c')]:_0x51f62b['model'];if(_0x11cce0[_0x5d16('0x37')][_0x5d16('0x45')]){_0x3cdce2[_0x5d16('0x4a')]=[{'all':!![]}];}_0x3cdce2=_[_0x5d16('0x42')]({},_0x3cdce2,_0x11cce0[_0x5d16('0x44')]);return db[_0x5d16('0x31')][_0x5d16('0x4b')](_0x3cdce2)[_0x5d16('0x2a')](handleEntityNotFound(_0x269e42,null))['then'](respondWithResult(_0x269e42,null))[_0x5d16('0x47')](handleError(_0x269e42,null));};exports['create']=function(_0x48e8e9,_0x19008b){return db[_0x5d16('0x31')]['create'](_0x48e8e9[_0x5d16('0x4c')],{})['then'](respondWithResult(_0x19008b,0xc9))[_0x5d16('0x47')](handleError(_0x19008b,null));};exports['update']=function(_0x4ae9df,_0x3f11d0){if(_0x4ae9df[_0x5d16('0x4c')]['id']){delete _0x4ae9df[_0x5d16('0x4c')]['id'];}return db[_0x5d16('0x31')][_0x5d16('0x4b')]({'where':{'id':_0x4ae9df[_0x5d16('0x49')]['id']}})[_0x5d16('0x2a')](handleEntityNotFound(_0x3f11d0,null))[_0x5d16('0x2a')](saveUpdates(_0x4ae9df[_0x5d16('0x4c')],null))[_0x5d16('0x2a')](respondWithResult(_0x3f11d0,null))[_0x5d16('0x47')](handleError(_0x3f11d0,null));};exports[_0x5d16('0x2b')]=function(_0x10f645,_0x5b9536){return db[_0x5d16('0x31')][_0x5d16('0x4b')]({'where':{'id':_0x10f645[_0x5d16('0x49')]['id']}})['then'](handleEntityNotFound(_0x5b9536,null))['then'](removeEntity(_0x5b9536,null))['catch'](handleError(_0x5b9536,null));};exports[_0x5d16('0x4d')]=function(_0x19c7df,_0xeda5d6){return db[_0x5d16('0x31')][_0x5d16('0x4d')]()['then'](respondWithResult(_0xeda5d6,null))[_0x5d16('0x47')](handleError(_0xeda5d6,null));};function wrapUser(_0x58cf38){return function(_0xe5c13f){var _0x4fc40b=_0x58cf38[_0x5d16('0x4e')]({'plain':!![]});_0x4fc40b['messages']=[];if(_0xe5c13f){_0x4fc40b['lastMessageAt']=_0xe5c13f[_0x5d16('0x4f')];_0x4fc40b['lastMessage']=_0xe5c13f;}else{_0x4fc40b[_0x5d16('0x50')]=moment(0x0)[_0x5d16('0x51')]('YYYY-MM-DD\x20HH:mm:ss');_0x4fc40b['lastMessage']={};}return _0x4fc40b;};}exports['getUsers']=function(_0x45fee0,_0x3312de,_0x1ad80f){var _0x20f5d1=[];return db[_0x5d16('0x52')][_0x5d16('0x46')]({'where':{'role':[_0x5d16('0x53'),_0x5d16('0x54'),_0x5d16('0x55')]},'attributes':['id',_0x5d16('0x56'),_0x5d16('0x2d'),_0x5d16('0x57'),_0x5d16('0x58'),_0x5d16('0x59'),_0x5d16('0x5a'),_0x5d16('0x5b'),_0x5d16('0x5c'),_0x5d16('0x5d')],'order':qs[_0x5d16('0x5e')](_0x5d16('0x5f')),'include':[{'model':db[_0x5d16('0x60')],'as':_0x5d16('0x61'),'attributes':['id',_0x5d16('0x2d'),_0x5d16('0x34')],'through':{'attributes':[]}}]})[_0x5d16('0x2a')](function(_0x356604){if(_0x356604){var _0x5095ac=_0x45fee0[_0x5d16('0x55')][_0x5d16('0x4e')]({'plain':!![]});if(!_0x5095ac)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5095ac[_0x5d16('0x57')]==='user'){return db[_0x5d16('0x62')][_0x5d16('0x4b')]({'where':{'name':_0x5d16('0x63'),'userProfileId':_0x5095ac['userProfileId']},'raw':!![]})[_0x5d16('0x2a')](function(_0xa01c2){if(_0xa01c2){if(_0xa01c2[_0x5d16('0x64')]===0x0){return db[_0x5d16('0x65')][_0x5d16('0x46')]({'where':{'sectionId':_0xa01c2['id']},'raw':!![]})['then'](function(_0x5d33cb){var _0x5ef85f=[];if(_[_0x5d16('0x66')](_0x5d33cb)){_0x5ef85f=_[_0x5d16('0x67')](_0x356604,function(_0x2f0c62){if(_0x2f0c62[_0x5d16('0x57')]!==_0x5d16('0x53')){return _0x2f0c62;}});return _0x5ef85f;}else{for(var _0x259939=0x0;_0x259939<_0x356604['length'];_0x259939++){var _0x83abbe=_0x356604[_0x259939];if(_0x83abbe['role']===_0x5d16('0x53')){var _0x4c50d4=_[_0x5d16('0x4b')](_0x5d33cb,function(_0x3da1db){return _0x3da1db[_0x5d16('0x68')]===_0x83abbe['id'];});if(_0x4c50d4)_0x5ef85f[_0x5d16('0x69')](_0x83abbe);}else{_0x5ef85f[_0x5d16('0x69')](_0x83abbe);}}return _0x5ef85f;}});}else{return _0x356604;}}else{var _0x279b29=_['filter'](_0x356604,function(_0x2de295){if(_0x2de295['role']!==_0x5d16('0x53')){return _0x2de295;}});return _0x279b29;}});}else{return _0x356604;}}})[_0x5d16('0x2a')](function(_0x34e98e){var _0x57a43a=[];if(_0x34e98e){_0x20f5d1=_0x34e98e;for(var _0x96a1=0x0;_0x96a1<_0x34e98e['length'];_0x96a1+=0x1){_0x20f5d1[_0x96a1][_0x5d16('0x6a')]=[];_0x57a43a[_0x5d16('0x69')](db[_0x5d16('0x31')][_0x5d16('0x4b')]({'where':{'FromId':[_0x45fee0[_0x5d16('0x55')]['id'],_0x34e98e[_0x96a1]['id']],'ToId':[_0x45fee0[_0x5d16('0x55')]['id'],_0x34e98e[_0x96a1]['id']],'ChatGroupId':null},'attributes':['id',_0x5d16('0x4f'),_0x5d16('0x6b'),_0x5d16('0x6c'),_0x5d16('0x6d'),_0x5d16('0x4c')],'order':qs[_0x5d16('0x5e')](_0x5d16('0x6e')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x5d16('0x2a')](wrapUser(_0x34e98e[_0x96a1])));}return BPromise[_0x5d16('0x6f')](_0x57a43a);}return[];})[_0x5d16('0x2a')](function(_0x1d52af){return{'rows':_0x1d52af,'count':_0x1d52af[_0x5d16('0x3d')]};})[_0x5d16('0x2a')](respondWithResult(_0x3312de,null))['catch'](handleError(_0x3312de,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index f3dc1d4..156bec5 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 _0xc1eb=['ChatInternalMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x4b4ec4,_0x2611b4){var _0xa84d97=function(_0x306c8c){while(--_0x306c8c){_0x4b4ec4['push'](_0x4b4ec4['shift']());}};_0xa84d97(++_0x2611b4);}(_0xc1eb,0x1ed));var _0xbc1e=function(_0x3d5df9,_0x5b3623){_0x3d5df9=_0x3d5df9-0x0;var _0x50ba39=_0xc1eb[_0x3d5df9];return _0x50ba39;};'use strict';var EventEmitter=require(_0xbc1e('0x0'));var ChatInternalMessage=require(_0xbc1e('0x1'))['db'][_0xbc1e('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xbc1e('0x3')](0x0);var events={'afterCreate':_0xbc1e('0x4'),'afterUpdate':_0xbc1e('0x5'),'afterDestroy':_0xbc1e('0x6')};function emitEvent(_0x564175){return function(_0x325b7d,_0x1fe06b,_0x162f93){ChatInternalMessageEvents['emit'](_0x564175+':'+_0x325b7d['id'],_0x325b7d);ChatInternalMessageEvents[_0xbc1e('0x7')](_0x564175,_0x325b7d);_0x162f93(null);};}for(var e in events){if(events[_0xbc1e('0x8')](e)){var event=events[e];ChatInternalMessage[_0xbc1e('0x9')](e,emitEvent(event));}}module[_0xbc1e('0xa')]=ChatInternalMessageEvents; \ No newline at end of file +var _0xa554=['../../mysqldb','ChatInternalMessage','setMaxListeners','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x713bd8,_0x2f3a74){var _0x5085ec=function(_0x3bc388){while(--_0x3bc388){_0x713bd8['push'](_0x713bd8['shift']());}};_0x5085ec(++_0x2f3a74);}(_0xa554,0x104));var _0x4a55=function(_0x1c9dc4,_0x5ca808){_0x1c9dc4=_0x1c9dc4-0x0;var _0x523d0a=_0xa554[_0x1c9dc4];return _0x523d0a;};'use strict';var EventEmitter=require(_0x4a55('0x0'));var ChatInternalMessage=require(_0x4a55('0x1'))['db'][_0x4a55('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x4a55('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x4a55('0x4')};function emitEvent(_0x541e09){return function(_0x277b9,_0x572d83,_0x43841f){ChatInternalMessageEvents[_0x4a55('0x5')](_0x541e09+':'+_0x277b9['id'],_0x277b9);ChatInternalMessageEvents[_0x4a55('0x5')](_0x541e09,_0x277b9);_0x43841f(null);};}for(var e in events){if(events[_0x4a55('0x6')](e)){var event=events[e];ChatInternalMessage[_0x4a55('0x7')](e,emitEvent(event));}}module[_0x4a55('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 ef5abf8..9b7b257 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 _0x9ffd=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./chatInternalMessage.attributes','define','ChatInternalMessage','chat_internal_messages'];(function(_0x8856e4,_0x472b29){var _0x11276e=function(_0x518750){while(--_0x518750){_0x8856e4['push'](_0x8856e4['shift']());}};_0x11276e(++_0x472b29);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x427dba,_0xe995eb){_0x427dba=_0x427dba-0x0;var _0x4fdecb=_0x9ffd[_0x427dba];return _0x4fdecb;};'use strict';var _=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var logger=require(_0xd9ff('0x2'))('api');var moment=require(_0xd9ff('0x3'));var BPromise=require(_0xd9ff('0x4'));var rp=require(_0xd9ff('0x5'));var fs=require('fs');var path=require(_0xd9ff('0x6'));var rimraf=require('rimraf');var config=require(_0xd9ff('0x7'));var attributes=require(_0xd9ff('0x8'));module['exports']=function(_0x3aa26b,_0x2982c3){return _0x3aa26b[_0xd9ff('0x9')](_0xd9ff('0xa'),attributes,{'tableName':_0xd9ff('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd9ff('0xc'),'collate':_0xd9ff('0xd')});}; \ No newline at end of file +var _0xa9e0=['define','ChatInternalMessage','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0a9e('0xb')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 47192e9..a0475cf 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 _0x3b07=['request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter'];(function(_0x51829a,_0x314d38){var _0x7bae53=function(_0x47fbce){while(--_0x47fbce){_0x51829a['push'](_0x51829a['shift']());}};_0x7bae53(++_0x314d38);}(_0x3b07,0x1b4));var _0x73b0=function(_0x1d591f,_0x3e6682){_0x1d591f=_0x1d591f-0x0;var _0x4f41b3=_0x3b07[_0x1d591f];return _0x4f41b3;};'use strict';var _=require(_0x73b0('0x0'));var util=require(_0x73b0('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x73b0('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x73b0('0x3'))['db'];var utils=require(_0x73b0('0x4'));var logger=require(_0x73b0('0x5'))(_0x73b0('0x6'));var config=require(_0x73b0('0x7'));var jayson=require(_0x73b0('0x8'));var client=jayson[_0x73b0('0x9')]['http']({'port':0x232a});config[_0x73b0('0xa')]=_[_0x73b0('0xb')](config['redis'],{'host':_0x73b0('0xc'),'port':0x18eb});var socket=require(_0x73b0('0xd'))(new Redis(config[_0x73b0('0xa')]));require('./chatInternalMessage.socket')['register'](socket);function respondWithRpcPromise(_0x42dcef,_0x4b8604,_0x483559){return new BPromise(function(_0x68408f,_0x529262){return client[_0x73b0('0xe')](_0x42dcef,_0x483559)[_0x73b0('0xf')](function(_0x1f0cac){logger[_0x73b0('0x10')](_0x73b0('0x11'),_0x4b8604,_0x73b0('0x12'));logger[_0x73b0('0x13')](_0x73b0('0x14'),_0x4b8604,'request\x20sent',JSON[_0x73b0('0x15')](_0x1f0cac));if(_0x1f0cac[_0x73b0('0x16')]){if(_0x1f0cac['error']['code']===0x1f4){logger[_0x73b0('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0x4b8604,_0x1f0cac[_0x73b0('0x16')]['message']);return _0x529262(_0x1f0cac[_0x73b0('0x16')][_0x73b0('0x17')]);}logger[_0x73b0('0x16')](_0x73b0('0x11'),_0x4b8604,_0x1f0cac['error'][_0x73b0('0x17')]);return _0x68408f(_0x1f0cac[_0x73b0('0x16')][_0x73b0('0x17')]);}else{logger[_0x73b0('0x10')](_0x73b0('0x11'),_0x4b8604,_0x73b0('0x12'));_0x68408f(_0x1f0cac[_0x73b0('0x18')]['message']);}})['catch'](function(_0x217c97){logger[_0x73b0('0x16')](_0x73b0('0x11'),_0x4b8604,_0x217c97);_0x529262(_0x217c97);});});} \ No newline at end of file +var _0xe33a=['jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then','info','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','code','ChatInternalMessage,\x20%s,\x20%s','message','result','catch','lodash','moment','../../config/utils','../../config/logger','rpc'];(function(_0x3e7e96,_0x5683ca){var _0x13f6f0=function(_0x320767){while(--_0x320767){_0x3e7e96['push'](_0x3e7e96['shift']());}};_0x13f6f0(++_0x5683ca);}(_0xe33a,0xa3));var _0xae33=function(_0x275cb1,_0x1b913d){_0x275cb1=_0x275cb1-0x0;var _0x2f92b4=_0xe33a[_0x275cb1];return _0x2f92b4;};'use strict';var _=require(_0xae33('0x0'));var util=require('util');var moment=require(_0xae33('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xae33('0x2'));var logger=require(_0xae33('0x3'))(_0xae33('0x4'));var config=require('../../config/environment');var jayson=require(_0xae33('0x5'));var client=jayson[_0xae33('0x6')][_0xae33('0x7')]({'port':0x232a});config[_0xae33('0x8')]=_[_0xae33('0x9')](config[_0xae33('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xae33('0xa'))(new Redis(config[_0xae33('0x8')]));require('./chatInternalMessage.socket')[_0xae33('0xb')](socket);function respondWithRpcPromise(_0x207a78,_0x26b846,_0x1949a6){return new BPromise(function(_0x1115d1,_0x5d4aea){return client[_0xae33('0xc')](_0x207a78,_0x1949a6)[_0xae33('0xd')](function(_0x59c179){logger[_0xae33('0xe')]('ChatInternalMessage,\x20%s,\x20%s',_0x26b846,_0xae33('0xf'));logger[_0xae33('0x10')](_0xae33('0x11'),_0x26b846,_0xae33('0xf'),JSON['stringify'](_0x59c179));if(_0x59c179[_0xae33('0x12')]){if(_0x59c179[_0xae33('0x12')][_0xae33('0x13')]===0x1f4){logger[_0xae33('0x12')](_0xae33('0x14'),_0x26b846,_0x59c179[_0xae33('0x12')]['message']);return _0x5d4aea(_0x59c179[_0xae33('0x12')][_0xae33('0x15')]);}logger[_0xae33('0x12')](_0xae33('0x14'),_0x26b846,_0x59c179['error'][_0xae33('0x15')]);return _0x1115d1(_0x59c179[_0xae33('0x12')][_0xae33('0x15')]);}else{logger[_0xae33('0xe')](_0xae33('0x14'),_0x26b846,_0xae33('0xf'));_0x1115d1(_0x59c179[_0xae33('0x16')]['message']);}})[_0xae33('0x17')](function(_0x4fe322){logger[_0xae33('0x12')](_0xae33('0x14'),_0x26b846,_0x4fe322);_0x5d4aea(_0x4fe322);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 8341bd0..250ba70 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 _0xcee0=['chatInternalMessage:','./chatInternalMessage.events','save','remove','update','emit','removeListener','register'];(function(_0x463e3e,_0x26102e){var _0x236ff4=function(_0x37f15f){while(--_0x37f15f){_0x463e3e['push'](_0x463e3e['shift']());}};_0x236ff4(++_0x26102e);}(_0xcee0,0x1e1));var _0x0cee=function(_0x510c60,_0x50247e){_0x510c60=_0x510c60-0x0;var _0x49c4aa=_0xcee0[_0x510c60];return _0x49c4aa;};'use strict';var ChatInternalMessageEvents=require(_0x0cee('0x0'));var events=[_0x0cee('0x1'),_0x0cee('0x2'),_0x0cee('0x3')];function createListener(_0x3f1953,_0xb77cd5){return function(_0x26f908){_0xb77cd5[_0x0cee('0x4')](_0x3f1953,_0x26f908);};}function removeListener(_0x3d96bf,_0x4b32f3){return function(){ChatInternalMessageEvents[_0x0cee('0x5')](_0x3d96bf,_0x4b32f3);};}exports[_0x0cee('0x6')]=function(_0x1b3abb){for(var _0x465e67=0x0,_0x2af845=events['length'];_0x465e67<_0x2af845;_0x465e67++){var _0x45491f=events[_0x465e67];var _0x24ff83=createListener(_0x0cee('0x7')+_0x45491f,_0x1b3abb);ChatInternalMessageEvents['on'](_0x45491f,_0x24ff83);}}; \ No newline at end of file +var _0x867f=['remove','update','emit','register','length','chatInternalMessage:','./chatInternalMessage.events','save'];(function(_0x55ac98,_0x1f68ee){var _0x34943a=function(_0x5dcd6e){while(--_0x5dcd6e){_0x55ac98['push'](_0x55ac98['shift']());}};_0x34943a(++_0x1f68ee);}(_0x867f,0xe6));var _0xf867=function(_0x5b34c0,_0x3ad403){_0x5b34c0=_0x5b34c0-0x0;var _0x242bd3=_0x867f[_0x5b34c0];return _0x242bd3;};'use strict';var ChatInternalMessageEvents=require(_0xf867('0x0'));var events=[_0xf867('0x1'),_0xf867('0x2'),_0xf867('0x3')];function createListener(_0x433c45,_0x35da23){return function(_0x28e708){_0x35da23[_0xf867('0x4')](_0x433c45,_0x28e708);};}function removeListener(_0x333d91,_0x57ce95){return function(){ChatInternalMessageEvents['removeListener'](_0x333d91,_0x57ce95);};}exports[_0xf867('0x5')]=function(_0x2e0691){for(var _0x2c09b1=0x0,_0x2841d1=events[_0xf867('0x6')];_0x2c09b1<_0x2841d1;_0x2c09b1++){var _0x5c35f9=events[_0x2c09b1];var _0x583f87=createListener(_0xf867('0x7')+_0x5c35f9,_0x2e0691);ChatInternalMessageEvents['on'](_0x5c35f9,_0x583f87);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 4459bd3..2b7b83e 100644 --- a/server/api/chatInternalMessage/index.js +++ b/server/api/chatInternalMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['exports','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','getUsers','/:id','show','post','put','update','delete'];(function(_0x2fc76b,_0x1e14a3){var _0x32ea6a=function(_0xe66595){while(--_0xe66595){_0x2fc76b['push'](_0x2fc76b['shift']());}};_0x32ea6a(++_0x1e14a3);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var auth=require(_0x3071('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x3071('0x5'));var controller=require(_0x3071('0x6'));router[_0x3071('0x7')]('/',auth[_0x3071('0x8')](),controller[_0x3071('0x9')]);router[_0x3071('0x7')](_0x3071('0xa'),auth[_0x3071('0x8')](),controller[_0x3071('0xb')]);router[_0x3071('0x7')](_0x3071('0xc'),auth[_0x3071('0x8')](),controller[_0x3071('0xd')]);router['get'](_0x3071('0xe'),auth[_0x3071('0x8')](),controller[_0x3071('0xf')]);router[_0x3071('0x10')]('/',auth[_0x3071('0x8')](),controller['create']);router[_0x3071('0x11')](_0x3071('0xe'),controller[_0x3071('0x12')]);router[_0x3071('0x13')](_0x3071('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x3071('0x14')]=router; \ No newline at end of file +var _0xb7e7=['exports','multer','path','express','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','/describe','isAuthenticated','/users','getUsers','/:id','post','create','put','update','delete'];(function(_0x547e39,_0x3f5107){var _0x4b90f9=function(_0x441579){while(--_0x441579){_0x547e39['push'](_0x547e39['shift']());}};_0x4b90f9(++_0x3f5107);}(_0xb7e7,0x121));var _0x7b7e=function(_0x39d544,_0x35c14f){_0x39d544=_0x39d544-0x0;var _0x5a5ff2=_0xb7e7[_0x39d544];return _0x5a5ff2;};'use strict';var multer=require(_0x7b7e('0x0'));var util=require('util');var path=require(_0x7b7e('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b7e('0x2'));var router=express['Router']();var auth=require(_0x7b7e('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x7b7e('0x4'));var controller=require(_0x7b7e('0x5'));router[_0x7b7e('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7b7e('0x6')](_0x7b7e('0x7'),auth[_0x7b7e('0x8')](),controller['describe']);router[_0x7b7e('0x6')](_0x7b7e('0x9'),auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xa')]);router[_0x7b7e('0x6')](_0x7b7e('0xb'),auth[_0x7b7e('0x8')](),controller['show']);router[_0x7b7e('0xc')]('/',auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xd')]);router[_0x7b7e('0xe')](_0x7b7e('0xb'),controller[_0x7b7e('0xf')]);router[_0x7b7e('0x10')](_0x7b7e('0xb'),auth[_0x7b7e('0x8')](),controller['destroy']);module[_0x7b7e('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index eb5456d..2c5d7cc 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 _0xf537=['DATE','sequelize','medium','BOOLEAN','ENUM'];(function(_0x3c2075,_0x93f1a8){var _0x267249=function(_0x57c866){while(--_0x57c866){_0x3c2075['push'](_0x3c2075['shift']());}};_0x267249(++_0x93f1a8);}(_0xf537,0x182));var _0x7f53=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xf537[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0x7f53('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x7f53('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x7f53('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0x7f53('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x7f53('0x3')]('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x7f53('0x4')]}}; \ No newline at end of file +var _0x70b9=['DATE','sequelize','TEXT','medium','out'];(function(_0x1147ab,_0x10e72b){var _0x55cb5a=function(_0x364bd6){while(--_0x364bd6){_0x1147ab['push'](_0x1147ab['shift']());}};_0x55cb5a(++_0x10e72b);}(_0x70b9,0xf6));var _0x970b=function(_0x1966a5,_0x3aab3a){_0x1966a5=_0x1966a5-0x0;var _0x56c4b7=_0x70b9[_0x1966a5];return _0x56c4b7;};'use strict';var Sequelize=require(_0x970b('0x0'));module['exports']={'body':{'type':Sequelize[_0x970b('0x1')](_0x970b('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x970b('0x3')),'defaultValue':_0x970b('0x3'),'allowNull':![]},'readAt':{'type':Sequelize[_0x970b('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index f0cc091..015fc39 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 _0xaac5=['event','EventManager','html-pdf','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../mysqldb','redis','defaults','socket.io-emitter','./chatMessage.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~!@#$%^&-_=+[{]}.','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','Content-Range','reject','update','destroy','name','send','index','map','rawAttributes','fieldName','keys','filters','intersection','model','query','attributes','fields','nolimit','limit','order','sort','where','pick','filter','merge','type','field','options','ChatMessage','includeAll','include','findAll','rows','find','create','body','params','describe','../../config/logger','chat-interactions','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','CmContact','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','interface','SIP/%s','user','channel','acceptmessage','parse','interaction','formData','agent','rejectMessage'];(function(_0x185d2a,_0x308609){var _0x4dea27=function(_0x513443){while(--_0x513443){_0x185d2a['push'](_0x185d2a['shift']());}};_0x4dea27(++_0x308609);}(_0xaac5,0x1ca));var _0x5aac=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xaac5[_0x3947c9];return _0x2e7871;};'use strict';var pdf=require(_0x5aac('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x5aac('0x1'));var zipdir=require(_0x5aac('0x2'));var jsonpatch=require(_0x5aac('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5aac('0x4'));var Mustache=require(_0x5aac('0x5'));var util=require('util');var path=require(_0x5aac('0x6'));var sox=require(_0x5aac('0x7'));var csv=require(_0x5aac('0x8'));var ejs=require(_0x5aac('0x9'));var fs=require('fs');var _=require(_0x5aac('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5aac('0xb'));var deskjs=require(_0x5aac('0xc'));var toCsv=require(_0x5aac('0x8'));var querystring=require(_0x5aac('0xd'));var Papa=require(_0x5aac('0xe'));var Redis=require(_0x5aac('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x5aac('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x5aac('0x11'))['db'];config[_0x5aac('0x12')]=_[_0x5aac('0x13')](config[_0x5aac('0x12')],{'host':'localhost','port':0x18eb});var socket=require(_0x5aac('0x14'))(new Redis(config[_0x5aac('0x12')]));require(_0x5aac('0x15'))[_0x5aac('0x16')](socket);var jayson=require('jayson/promise');var client=jayson[_0x5aac('0x17')][_0x5aac('0x18')]({'port':0x232c});var client9002=jayson[_0x5aac('0x17')]['http']({'port':0x232a});function checkPasswordPattern(_0x5386ae,_0x27394a,_0x4eb4e2){if(_0x4eb4e2){var _0x6920c0=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x6920c0[_0x5aac('0x19')](_0x27394a)){return _0x5386ae;}else{throw new Error(_0x5aac('0x1a'));}}else{return _0x5386ae;}}function respondWithRpcPromise(_0xdf52fc,_0x107624,_0x1972ff,_0x430813){return new BPromise(function(_0x2e7bd8,_0x48e1b4){var _0x304a79=_0x430813||client;return _0x304a79['request'](_0xdf52fc,_0x1972ff)[_0x5aac('0x1b')](function(_0x335fc4){logger[_0x5aac('0x1c')](_0x5aac('0x1d'),_0x107624,_0x5aac('0x1e'));logger[_0x5aac('0x1f')](_0x5aac('0x20'),_0x107624,'request\x20sent',JSON[_0x5aac('0x21')](_0x335fc4));if(_0x335fc4['error']){if(_0x335fc4[_0x5aac('0x22')][_0x5aac('0x23')]===0x1f4){logger[_0x5aac('0x22')](_0x5aac('0x1d'),_0x107624,_0x335fc4['error']['message']);return _0x48e1b4(_0x335fc4[_0x5aac('0x22')][_0x5aac('0x24')]);}logger['error'](_0x5aac('0x1d'),_0x107624,_0x335fc4['error'][_0x5aac('0x24')]);return _0x2e7bd8(_0x335fc4[_0x5aac('0x22')][_0x5aac('0x24')]);}else{logger[_0x5aac('0x1c')]('ChatMessage,\x20%s,\x20%s',_0x107624,_0x5aac('0x1e'));_0x2e7bd8(_0x335fc4[_0x5aac('0x25')][_0x5aac('0x24')]);}})[_0x5aac('0x26')](function(_0xac16b4){logger[_0x5aac('0x22')](_0x5aac('0x1d'),_0x107624,_0xac16b4);_0x48e1b4(_0xac16b4);});});}function respondWithStatusCode(_0x381d41,_0x236cb9){_0x236cb9=_0x236cb9||0xcc;return function(_0x48e851){if(_0x48e851){return _0x381d41[_0x5aac('0x27')](_0x236cb9);}return _0x381d41[_0x5aac('0x28')](_0x236cb9)[_0x5aac('0x29')]();};}function respondWithResult(_0x24c244,_0x48a65b){_0x48a65b=_0x48a65b||0xc8;return function(_0x1b29c8){if(_0x1b29c8){return _0x24c244[_0x5aac('0x28')](_0x48a65b)[_0x5aac('0x2a')](_0x1b29c8);}};}function respondWithFilteredResult(_0x2d2117,_0x516002){return function(_0x406443){if(_0x406443){var _0x2f77f8=_0x406443[_0x5aac('0x2b')],_0x5c6f85=_0x516002['offset'],_0x41c6e9=_0x516002[_0x5aac('0x2c')]+_0x516002['limit'],_0x158df0;if(_0x41c6e9>=_0x2f77f8){_0x41c6e9=_0x2f77f8;_0x158df0=0xc8;}else{_0x158df0=0xce;}_0x2d2117[_0x5aac('0x28')](_0x158df0);return _0x2d2117['set'](_0x5aac('0x2d'),_0x5c6f85+'-'+_0x41c6e9+'/'+_0x2f77f8)[_0x5aac('0x2a')](_0x406443);}return null;};}function patchUpdates(_0x1ad036){return function(_0x319895){try{jsonpatch['apply'](_0x319895,_0x1ad036,!![]);}catch(_0x4cace6){return BPromise[_0x5aac('0x2e')](_0x4cace6);}return _0x319895['save']();};}function saveUpdates(_0x4a2383,_0x2900f7){return function(_0x2abda6){if(_0x2abda6){return _0x2abda6[_0x5aac('0x2f')](_0x4a2383)[_0x5aac('0x1b')](function(_0x7ce403){return _0x7ce403;});}return null;};}function removeEntity(_0x2874c1,_0x25f804){return function(_0x1c78d3){if(_0x1c78d3){return _0x1c78d3[_0x5aac('0x30')]()[_0x5aac('0x1b')](function(){_0x2874c1[_0x5aac('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x289cd4,_0x34b262){return function(_0x25ece8){if(!_0x25ece8){_0x289cd4[_0x5aac('0x27')](0x194);}return _0x25ece8;};}function handleError(_0x2023f4,_0x1f6cb7){_0x1f6cb7=_0x1f6cb7||0x1f4;return function(_0x4fe424){logger[_0x5aac('0x22')](_0x4fe424['stack']);if(_0x4fe424[_0x5aac('0x31')]){delete _0x4fe424[_0x5aac('0x31')];}_0x2023f4[_0x5aac('0x28')](_0x1f6cb7)[_0x5aac('0x32')](_0x4fe424);};}exports[_0x5aac('0x33')]=function(_0x1fc68b,_0x1a7760){var _0x44f42a={},_0x46a89b={},_0x19fbb9={'count':0x0,'rows':[]};var _0x3cf44f=_[_0x5aac('0x34')](db['ChatMessage'][_0x5aac('0x35')],function(_0x33f805){return{'name':_0x33f805[_0x5aac('0x36')],'type':_0x33f805['type']['key']};});_0x46a89b['model']=_[_0x5aac('0x34')](_0x3cf44f,_0x5aac('0x31'));_0x46a89b['query']=_[_0x5aac('0x37')](_0x1fc68b['query']);_0x46a89b[_0x5aac('0x38')]=_[_0x5aac('0x39')](_0x46a89b[_0x5aac('0x3a')],_0x46a89b[_0x5aac('0x3b')]);_0x44f42a[_0x5aac('0x3c')]=_['intersection'](_0x46a89b[_0x5aac('0x3a')],qs[_0x5aac('0x3d')](_0x1fc68b[_0x5aac('0x3b')][_0x5aac('0x3d')]));_0x44f42a[_0x5aac('0x3c')]=_0x44f42a[_0x5aac('0x3c')]['length']?_0x44f42a[_0x5aac('0x3c')]:_0x46a89b['model'];if(!_0x1fc68b['query']['hasOwnProperty'](_0x5aac('0x3e'))){_0x44f42a[_0x5aac('0x3f')]=qs[_0x5aac('0x3f')](_0x1fc68b[_0x5aac('0x3b')]['limit']);_0x44f42a[_0x5aac('0x2c')]=qs['offset'](_0x1fc68b[_0x5aac('0x3b')][_0x5aac('0x2c')]);}_0x44f42a[_0x5aac('0x40')]=qs[_0x5aac('0x41')](_0x1fc68b[_0x5aac('0x3b')][_0x5aac('0x41')]);_0x44f42a[_0x5aac('0x42')]=qs[_0x5aac('0x38')](_[_0x5aac('0x43')](_0x1fc68b[_0x5aac('0x3b')],_0x46a89b[_0x5aac('0x38')]));if(_0x1fc68b[_0x5aac('0x3b')][_0x5aac('0x44')]){_0x44f42a['where']=_[_0x5aac('0x45')](_0x44f42a[_0x5aac('0x42')],{'$or':_['map'](_0x3cf44f,function(_0x121e6c){if(_0x121e6c[_0x5aac('0x46')]['key']!=='VIRTUAL'){var _0x1023c7={};_0x1023c7[_0x121e6c[_0x5aac('0x47')]]={'$like':'%'+_0x1fc68b[_0x5aac('0x3b')][_0x5aac('0x44')]+'%'};return _0x1023c7;}})});}_0x44f42a=_[_0x5aac('0x45')]({},_0x44f42a,_0x1fc68b[_0x5aac('0x48')]);var _0xa5c59d={'where':_0x44f42a[_0x5aac('0x42')]};return db[_0x5aac('0x49')]['count'](_0xa5c59d)[_0x5aac('0x1b')](function(_0x5b4477){_0x19fbb9[_0x5aac('0x2b')]=_0x5b4477;if(_0x1fc68b[_0x5aac('0x3b')][_0x5aac('0x4a')]){_0x44f42a[_0x5aac('0x4b')]=[{'all':!![]}];}return db[_0x5aac('0x49')][_0x5aac('0x4c')](_0x44f42a);})[_0x5aac('0x1b')](function(_0x519534){_0x19fbb9[_0x5aac('0x4d')]=_0x519534;return _0x19fbb9;})['then'](respondWithFilteredResult(_0x1a7760,_0x44f42a))['catch'](handleError(_0x1a7760,null));};exports['show']=function(_0xc93242,_0x56e8ef){var _0x2d3fb3={'raw':!![],'where':{'id':_0xc93242['params']['id']}},_0x52b316={};_0x52b316['model']=_['keys'](db[_0x5aac('0x49')][_0x5aac('0x35')]);_0x52b316[_0x5aac('0x3b')]=_['keys'](_0xc93242['query']);_0x52b316['filters']=_['intersection'](_0x52b316[_0x5aac('0x3a')],_0x52b316[_0x5aac('0x3b')]);_0x2d3fb3[_0x5aac('0x3c')]=_[_0x5aac('0x39')](_0x52b316['model'],qs[_0x5aac('0x3d')](_0xc93242[_0x5aac('0x3b')][_0x5aac('0x3d')]));_0x2d3fb3[_0x5aac('0x3c')]=_0x2d3fb3[_0x5aac('0x3c')]['length']?_0x2d3fb3['attributes']:_0x52b316[_0x5aac('0x3a')];if(_0xc93242[_0x5aac('0x3b')]['includeAll']){_0x2d3fb3[_0x5aac('0x4b')]=[{'all':!![]}];}_0x2d3fb3=_[_0x5aac('0x45')]({},_0x2d3fb3,_0xc93242[_0x5aac('0x48')]);return db[_0x5aac('0x49')][_0x5aac('0x4e')](_0x2d3fb3)[_0x5aac('0x1b')](handleEntityNotFound(_0x56e8ef,null))[_0x5aac('0x1b')](respondWithResult(_0x56e8ef,null))[_0x5aac('0x26')](handleError(_0x56e8ef,null));};exports[_0x5aac('0x4f')]=function(_0x28a589,_0xcec67f){return db[_0x5aac('0x49')]['create'](_0x28a589[_0x5aac('0x50')],{})[_0x5aac('0x1b')](respondWithResult(_0xcec67f,0xc9))[_0x5aac('0x26')](handleError(_0xcec67f,null));};exports['update']=function(_0x52b945,_0x600d6b){if(_0x52b945[_0x5aac('0x50')]['id']){delete _0x52b945[_0x5aac('0x50')]['id'];}return db[_0x5aac('0x49')]['find']({'where':{'id':_0x52b945[_0x5aac('0x51')]['id']}})[_0x5aac('0x1b')](handleEntityNotFound(_0x600d6b,null))[_0x5aac('0x1b')](saveUpdates(_0x52b945['body'],null))[_0x5aac('0x1b')](respondWithResult(_0x600d6b,null))[_0x5aac('0x26')](handleError(_0x600d6b,null));};exports['destroy']=function(_0x873d89,_0x1852ee){return db[_0x5aac('0x49')][_0x5aac('0x4e')]({'where':{'id':_0x873d89[_0x5aac('0x51')]['id']}})[_0x5aac('0x1b')](handleEntityNotFound(_0x1852ee,null))[_0x5aac('0x1b')](removeEntity(_0x1852ee,null))[_0x5aac('0x26')](handleError(_0x1852ee,null));};exports[_0x5aac('0x52')]=function(_0x1803da,_0x39d57c){return db[_0x5aac('0x49')][_0x5aac('0x52')]()[_0x5aac('0x1b')](respondWithResult(_0x39d57c,null))[_0x5aac('0x26')](handleError(_0x39d57c,null));};var interaction_log=require(_0x5aac('0x53'))(_0x5aac('0x54'));exports[_0x5aac('0x55')]=function(_0x53f0d0,_0x2e73ad,_0xa6df02){var _0x488e06={'channel':_0x5aac('0x56')};if(_0x53f0d0[_0x5aac('0x50')]['id']){delete _0x53f0d0[_0x5aac('0x50')]['id'];}_0x53f0d0[_0x5aac('0x50')][_0x5aac('0x57')]=!![];_0x53f0d0[_0x5aac('0x50')][_0x5aac('0x58')]=moment()[_0x5aac('0x59')](_0x5aac('0x5a'));_0x53f0d0[_0x5aac('0x50')][_0x5aac('0x5b')]=_0x53f0d0['body'][_0x5aac('0x5b')]||_0x53f0d0['user']['id'];return db['ChatMessage'][_0x5aac('0x4e')]({'where':{'id':_0x53f0d0[_0x5aac('0x51')]['id'],'UserId':null},'include':[{'model':db[_0x5aac('0x5c')],'as':'Contact'}]})[_0x5aac('0x1b')](handleEntityNotFound(_0x2e73ad,null))[_0x5aac('0x1b')](saveUpdates(_0x53f0d0[_0x5aac('0x50')],null))[_0x5aac('0x1b')](function(_0x968256){if(_0x968256){_0x488e06[_0x5aac('0x24')]=_0x968256[_0x5aac('0x5d')]({'plain':!![]});return db[_0x5aac('0x5e')][_0x5aac('0x4e')]({'where':{'id':_0x968256[_0x5aac('0x5f')]}});}return null;})[_0x5aac('0x1b')](handleEntityNotFound(_0x2e73ad,null))[_0x5aac('0x1b')](function(_0x3c1f77){if(_0x3c1f77){return _0x3c1f77[_0x5aac('0x2f')]({'UserId':_0x53f0d0['body']['UserId'],'read1stAt':_[_0x5aac('0x60')](_0x3c1f77[_0x5aac('0x61')])?moment()['format'](_0x5aac('0x5a')):undefined});}return null;})['then'](function(_0x2b0844){if(_0x2b0844){_0x488e06['interaction']=_0x2b0844[_0x5aac('0x5d')]({'plain':!![]});interaction_log[_0x5aac('0x1c')](_0x5aac('0x62'),_0x53f0d0['user']['id'],_0x53f0d0['user']['name'],_0x53f0d0['user'][_0x5aac('0x63')],_0x488e06['interaction']['id'],_0x53f0d0[_0x5aac('0x50')]?JSON['stringify'](_0x53f0d0['body']):_0x5aac('0x64'));return respondWithRpcPromise(_0x5aac('0x65'),'acceptMessage',_0x488e06);}return null;})['then'](function(_0x58c67c){if(_0x58c67c){if(_0x53f0d0['body']['manual']){_0x488e06['message'][_0x5aac('0x66')]=util[_0x5aac('0x59')](_0x5aac('0x67'),_0x53f0d0[_0x5aac('0x68')]['name']);_0x488e06[_0x5aac('0x24')][_0x5aac('0x69')]=_0x488e06[_0x5aac('0x69')];_0x488e06[_0x5aac('0x24')]['event']=_0x5aac('0x55');return respondWithRpcPromise('EventManager','EventManager',{'event':_0x5aac('0x6a'),'message':_['merge'](_0x488e06[_0x5aac('0x24')],JSON[_0x5aac('0x6b')](_0x488e06[_0x5aac('0x6c')][_0x5aac('0x6d')]))},client9002)['then'](function(){return _0x488e06;});}return _0x488e06;}return null;})[_0x5aac('0x1b')](respondWithResult(_0x2e73ad,null))[_0x5aac('0x26')](handleError(_0x2e73ad,null));};var interaction_log=require(_0x5aac('0x53'))('chat-interactions');exports[_0x5aac('0x2e')]=function(_0x40fc9a,_0x3618ca,_0x555fb5){var _0x4643be={'agent':{},'channel':'chat'};if(_0x40fc9a[_0x5aac('0x50')]['id']){delete _0x40fc9a[_0x5aac('0x50')]['id'];}_0x40fc9a[_0x5aac('0x50')][_0x5aac('0x5b')]=_0x40fc9a[_0x5aac('0x50')][_0x5aac('0x5b')]||_0x40fc9a['user']['id'];_0x4643be[_0x5aac('0x6e')]['id']=_0x40fc9a[_0x5aac('0x50')][_0x5aac('0x5b')];return db[_0x5aac('0x49')][_0x5aac('0x4e')]({'where':{'id':_0x40fc9a[_0x5aac('0x51')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3618ca,null))[_0x5aac('0x1b')](function(_0x29e9c6){if(_0x29e9c6){_0x4643be[_0x5aac('0x24')]=_0x29e9c6[_0x5aac('0x5d')]({'plain':!![]});return db[_0x5aac('0x5e')][_0x5aac('0x4e')]({'where':{'id':_0x29e9c6[_0x5aac('0x5f')]}});}return null;})['then'](handleEntityNotFound(_0x3618ca,null))[_0x5aac('0x1b')](function(_0x17dd0e){if(_0x17dd0e){_0x4643be[_0x5aac('0x6c')]=_0x17dd0e[_0x5aac('0x5d')]({'plain':!![]});interaction_log[_0x5aac('0x1c')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x40fc9a[_0x5aac('0x68')]['id'],_0x40fc9a[_0x5aac('0x68')]['name'],_0x40fc9a['user'][_0x5aac('0x63')],_0x4643be[_0x5aac('0x6c')]['id'],_0x40fc9a[_0x5aac('0x50')]?JSON['stringify'](_0x40fc9a[_0x5aac('0x50')]):_0x5aac('0x64'));return respondWithRpcPromise('RejectMessage',_0x5aac('0x6f'),_0x4643be);}return null;})[_0x5aac('0x1b')](function(_0x283cf5){if(_0x283cf5){_0x283cf5[_0x5aac('0x24')][_0x5aac('0x66')]=util[_0x5aac('0x59')](_0x5aac('0x67'),_0x40fc9a['user'][_0x5aac('0x31')]);_0x283cf5[_0x5aac('0x24')][_0x5aac('0x69')]=_0x4643be[_0x5aac('0x69')];_0x283cf5['message'][_0x5aac('0x70')]=_0x5aac('0x2e');respondWithRpcPromise(_0x5aac('0x71'),_0x5aac('0x71'),{'event':'rejectmessage','message':_0x283cf5[_0x5aac('0x24')]},client9002);return _0x4643be;}return null;})[_0x5aac('0x1b')](respondWithResult(_0x3618ca,null))[_0x5aac('0x26')](handleError(_0x3618ca,null));}; \ No newline at end of file +var _0x9209=['length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','field','options','includeAll','include','rows','fields','find','create','body','params','describe','chat-interactions','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','role','stringify','AcceptMessage','acceptMessage','SIP/%s','channel','event','accept','EventManager','acceptmessage','parse','formData','agent','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','interface','rejectmessage','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','client','http','test','request','then','info','request\x20sent','debug','error','message','ChatMessage,\x20%s,\x20%s','result','catch','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','save','update','name','index','ChatMessage','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes'];(function(_0x1957ac,_0x2d9e3c){var _0xde4b98=function(_0x11c85d){while(--_0x11c85d){_0x1957ac['push'](_0x1957ac['shift']());}};_0xde4b98(++_0x2d9e3c);}(_0x9209,0x1a8));var _0x9920=function(_0x3eb3ef,_0x411945){_0x3eb3ef=_0x3eb3ef-0x0;var _0x2e156d=_0x9209[_0x3eb3ef];return _0x2e156d;};'use strict';var pdf=require(_0x9920('0x0'));var emlformat=require(_0x9920('0x1'));var rimraf=require(_0x9920('0x2'));var zipdir=require(_0x9920('0x3'));var jsonpatch=require(_0x9920('0x4'));var rp=require(_0x9920('0x5'));var moment=require(_0x9920('0x6'));var BPromise=require(_0x9920('0x7'));var Mustache=require(_0x9920('0x8'));var util=require(_0x9920('0x9'));var path=require('path');var sox=require(_0x9920('0xa'));var csv=require(_0x9920('0xb'));var ejs=require(_0x9920('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x9920('0xd'));var crypto=require(_0x9920('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x9920('0xf'));var toCsv=require(_0x9920('0xb'));var querystring=require(_0x9920('0x10'));var Papa=require(_0x9920('0x11'));var Redis=require(_0x9920('0x12'));var authService=require(_0x9920('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x9920('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9920('0x15'))(_0x9920('0x16'));var utils=require(_0x9920('0x17'));var config=require(_0x9920('0x18'));var db=require(_0x9920('0x19'))['db'];config['redis']=_[_0x9920('0x1a')](config[_0x9920('0x1b')],{'host':_0x9920('0x1c'),'port':0x18eb});var socket=require(_0x9920('0x1d'))(new Redis(config[_0x9920('0x1b')]));require('./chatMessage.socket')[_0x9920('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0x9920('0x1f')]['http']({'port':0x232c});var client9002=jayson['client'][_0x9920('0x20')]({'port':0x232a});function checkPasswordPattern(_0x5480e2,_0x26060d,_0x3c9d0b){if(_0x3c9d0b){var _0x384afc=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x384afc[_0x9920('0x21')](_0x26060d)){return _0x5480e2;}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 _0x5480e2;}}function respondWithRpcPromise(_0x553806,_0x1f59c5,_0x40eb3d,_0x45d817){return new BPromise(function(_0x1540ef,_0x5d750d){var _0xf8bd91=_0x45d817||client;return _0xf8bd91[_0x9920('0x22')](_0x553806,_0x40eb3d)[_0x9920('0x23')](function(_0x248504){logger[_0x9920('0x24')]('ChatMessage,\x20%s,\x20%s',_0x1f59c5,_0x9920('0x25'));logger[_0x9920('0x26')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x1f59c5,_0x9920('0x25'),JSON['stringify'](_0x248504));if(_0x248504[_0x9920('0x27')]){if(_0x248504[_0x9920('0x27')]['code']===0x1f4){logger[_0x9920('0x27')]('ChatMessage,\x20%s,\x20%s',_0x1f59c5,_0x248504['error'][_0x9920('0x28')]);return _0x5d750d(_0x248504[_0x9920('0x27')][_0x9920('0x28')]);}logger[_0x9920('0x27')](_0x9920('0x29'),_0x1f59c5,_0x248504['error'][_0x9920('0x28')]);return _0x1540ef(_0x248504[_0x9920('0x27')][_0x9920('0x28')]);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x1f59c5,'request\x20sent');_0x1540ef(_0x248504[_0x9920('0x2a')][_0x9920('0x28')]);}})[_0x9920('0x2b')](function(_0x724a96){logger[_0x9920('0x27')](_0x9920('0x29'),_0x1f59c5,_0x724a96);_0x5d750d(_0x724a96);});});}function respondWithStatusCode(_0x34f5b4,_0x368668){_0x368668=_0x368668||0xcc;return function(_0x4be0eb){if(_0x4be0eb){return _0x34f5b4[_0x9920('0x2c')](_0x368668);}return _0x34f5b4[_0x9920('0x2d')](_0x368668)[_0x9920('0x2e')]();};}function respondWithResult(_0x41f4cb,_0x590446){_0x590446=_0x590446||0xc8;return function(_0x37a904){if(_0x37a904){return _0x41f4cb['status'](_0x590446)[_0x9920('0x2f')](_0x37a904);}};}function respondWithFilteredResult(_0x32f2bc,_0x1b6013){return function(_0x466230){if(_0x466230){var _0x4b7ce7=_0x466230[_0x9920('0x30')],_0x2b67d7=_0x1b6013[_0x9920('0x31')],_0x3ce4cf=_0x1b6013[_0x9920('0x31')]+_0x1b6013[_0x9920('0x32')],_0x4ca24c;if(_0x3ce4cf>=_0x4b7ce7){_0x3ce4cf=_0x4b7ce7;_0x4ca24c=0xc8;}else{_0x4ca24c=0xce;}_0x32f2bc[_0x9920('0x2d')](_0x4ca24c);return _0x32f2bc['set'](_0x9920('0x33'),_0x2b67d7+'-'+_0x3ce4cf+'/'+_0x4b7ce7)[_0x9920('0x2f')](_0x466230);}return null;};}function patchUpdates(_0x44a778){return function(_0x1def4a){try{jsonpatch[_0x9920('0x34')](_0x1def4a,_0x44a778,!![]);}catch(_0x4d99ab){return BPromise['reject'](_0x4d99ab);}return _0x1def4a[_0x9920('0x35')]();};}function saveUpdates(_0x5affd9,_0x27390f){return function(_0x1b92d7){if(_0x1b92d7){return _0x1b92d7[_0x9920('0x36')](_0x5affd9)[_0x9920('0x23')](function(_0x11e4e0){return _0x11e4e0;});}return null;};}function removeEntity(_0x524547,_0x5640ff){return function(_0x70b4f2){if(_0x70b4f2){return _0x70b4f2['destroy']()[_0x9920('0x23')](function(){_0x524547[_0x9920('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x48aab0,_0x286f57){return function(_0x4f9a4d){if(!_0x4f9a4d){_0x48aab0[_0x9920('0x2c')](0x194);}return _0x4f9a4d;};}function handleError(_0x1edc17,_0x49a568){_0x49a568=_0x49a568||0x1f4;return function(_0x3b3bfe){logger[_0x9920('0x27')](_0x3b3bfe['stack']);if(_0x3b3bfe[_0x9920('0x37')]){delete _0x3b3bfe[_0x9920('0x37')];}_0x1edc17[_0x9920('0x2d')](_0x49a568)['send'](_0x3b3bfe);};}exports[_0x9920('0x38')]=function(_0x28c939,_0x29b803){var _0x47d69f={},_0x3e6b7={},_0x511a37={'count':0x0,'rows':[]};var _0x2c65fd=_['map'](db[_0x9920('0x39')][_0x9920('0x3a')],function(_0x57104d){return{'name':_0x57104d[_0x9920('0x3b')],'type':_0x57104d[_0x9920('0x3c')][_0x9920('0x3d')]};});_0x3e6b7[_0x9920('0x3e')]=_[_0x9920('0x3f')](_0x2c65fd,_0x9920('0x37'));_0x3e6b7[_0x9920('0x40')]=_[_0x9920('0x41')](_0x28c939[_0x9920('0x40')]);_0x3e6b7['filters']=_[_0x9920('0x42')](_0x3e6b7['model'],_0x3e6b7[_0x9920('0x40')]);_0x47d69f[_0x9920('0x43')]=_[_0x9920('0x42')](_0x3e6b7[_0x9920('0x3e')],qs['fields'](_0x28c939[_0x9920('0x40')]['fields']));_0x47d69f[_0x9920('0x43')]=_0x47d69f[_0x9920('0x43')][_0x9920('0x44')]?_0x47d69f['attributes']:_0x3e6b7['model'];if(!_0x28c939['query'][_0x9920('0x45')]('nolimit')){_0x47d69f['limit']=qs[_0x9920('0x32')](_0x28c939[_0x9920('0x40')][_0x9920('0x32')]);_0x47d69f['offset']=qs[_0x9920('0x31')](_0x28c939['query'][_0x9920('0x31')]);}_0x47d69f[_0x9920('0x46')]=qs['sort'](_0x28c939[_0x9920('0x40')][_0x9920('0x47')]);_0x47d69f[_0x9920('0x48')]=qs[_0x9920('0x49')](_[_0x9920('0x4a')](_0x28c939[_0x9920('0x40')],_0x3e6b7[_0x9920('0x49')]));if(_0x28c939[_0x9920('0x40')][_0x9920('0x4b')]){_0x47d69f['where']=_[_0x9920('0x4c')](_0x47d69f[_0x9920('0x48')],{'$or':_['map'](_0x2c65fd,function(_0x13754a){if(_0x13754a[_0x9920('0x3c')][_0x9920('0x3d')]!=='VIRTUAL'){var _0x25da2b={};_0x25da2b[_0x13754a[_0x9920('0x4d')]]={'$like':'%'+_0x28c939[_0x9920('0x40')][_0x9920('0x4b')]+'%'};return _0x25da2b;}})});}_0x47d69f=_[_0x9920('0x4c')]({},_0x47d69f,_0x28c939[_0x9920('0x4e')]);var _0x584aa9={'where':_0x47d69f['where']};return db[_0x9920('0x39')][_0x9920('0x30')](_0x584aa9)['then'](function(_0x3399c4){_0x511a37[_0x9920('0x30')]=_0x3399c4;if(_0x28c939[_0x9920('0x40')][_0x9920('0x4f')]){_0x47d69f[_0x9920('0x50')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x47d69f);})[_0x9920('0x23')](function(_0x2fbc50){_0x511a37[_0x9920('0x51')]=_0x2fbc50;return _0x511a37;})[_0x9920('0x23')](respondWithFilteredResult(_0x29b803,_0x47d69f))['catch'](handleError(_0x29b803,null));};exports['show']=function(_0x201638,_0x4d4ff6){var _0xe56a65={'raw':!![],'where':{'id':_0x201638['params']['id']}},_0x4ce6ab={};_0x4ce6ab[_0x9920('0x3e')]=_[_0x9920('0x41')](db[_0x9920('0x39')]['rawAttributes']);_0x4ce6ab[_0x9920('0x40')]=_[_0x9920('0x41')](_0x201638[_0x9920('0x40')]);_0x4ce6ab[_0x9920('0x49')]=_[_0x9920('0x42')](_0x4ce6ab[_0x9920('0x3e')],_0x4ce6ab['query']);_0xe56a65[_0x9920('0x43')]=_[_0x9920('0x42')](_0x4ce6ab['model'],qs[_0x9920('0x52')](_0x201638[_0x9920('0x40')]['fields']));_0xe56a65[_0x9920('0x43')]=_0xe56a65[_0x9920('0x43')][_0x9920('0x44')]?_0xe56a65[_0x9920('0x43')]:_0x4ce6ab[_0x9920('0x3e')];if(_0x201638['query'][_0x9920('0x4f')]){_0xe56a65[_0x9920('0x50')]=[{'all':!![]}];}_0xe56a65=_[_0x9920('0x4c')]({},_0xe56a65,_0x201638[_0x9920('0x4e')]);return db[_0x9920('0x39')][_0x9920('0x53')](_0xe56a65)[_0x9920('0x23')](handleEntityNotFound(_0x4d4ff6,null))['then'](respondWithResult(_0x4d4ff6,null))['catch'](handleError(_0x4d4ff6,null));};exports[_0x9920('0x54')]=function(_0x1e373e,_0x1ca272){return db[_0x9920('0x39')][_0x9920('0x54')](_0x1e373e['body'],{})[_0x9920('0x23')](respondWithResult(_0x1ca272,0xc9))['catch'](handleError(_0x1ca272,null));};exports['update']=function(_0x46aaa3,_0x2aa739){if(_0x46aaa3[_0x9920('0x55')]['id']){delete _0x46aaa3[_0x9920('0x55')]['id'];}return db[_0x9920('0x39')][_0x9920('0x53')]({'where':{'id':_0x46aaa3[_0x9920('0x56')]['id']}})[_0x9920('0x23')](handleEntityNotFound(_0x2aa739,null))[_0x9920('0x23')](saveUpdates(_0x46aaa3[_0x9920('0x55')],null))['then'](respondWithResult(_0x2aa739,null))[_0x9920('0x2b')](handleError(_0x2aa739,null));};exports['destroy']=function(_0x16a333,_0x236023){return db[_0x9920('0x39')]['find']({'where':{'id':_0x16a333[_0x9920('0x56')]['id']}})[_0x9920('0x23')](handleEntityNotFound(_0x236023,null))[_0x9920('0x23')](removeEntity(_0x236023,null))['catch'](handleError(_0x236023,null));};exports[_0x9920('0x57')]=function(_0x4b8b9c,_0x240d59){return db[_0x9920('0x39')]['describe']()[_0x9920('0x23')](respondWithResult(_0x240d59,null))['catch'](handleError(_0x240d59,null));};var interaction_log=require('../../config/logger')(_0x9920('0x58'));exports['accept']=function(_0x2eb302,_0xc4b01,_0x32e8b4){var _0x3e50bd={'channel':_0x9920('0x59')};if(_0x2eb302[_0x9920('0x55')]['id']){delete _0x2eb302[_0x9920('0x55')]['id'];}_0x2eb302[_0x9920('0x55')][_0x9920('0x5a')]=!![];_0x2eb302[_0x9920('0x55')][_0x9920('0x5b')]=moment()[_0x9920('0x5c')](_0x9920('0x5d'));_0x2eb302[_0x9920('0x55')][_0x9920('0x5e')]=_0x2eb302[_0x9920('0x55')]['UserId']||_0x2eb302[_0x9920('0x5f')]['id'];return db[_0x9920('0x39')][_0x9920('0x53')]({'where':{'id':_0x2eb302[_0x9920('0x56')]['id'],'UserId':null},'include':[{'model':db[_0x9920('0x60')],'as':_0x9920('0x61')}]})['then'](handleEntityNotFound(_0xc4b01,null))[_0x9920('0x23')](saveUpdates(_0x2eb302[_0x9920('0x55')],null))[_0x9920('0x23')](function(_0x521cde){if(_0x521cde){_0x3e50bd[_0x9920('0x28')]=_0x521cde[_0x9920('0x62')]({'plain':!![]});return db[_0x9920('0x63')][_0x9920('0x53')]({'where':{'id':_0x521cde[_0x9920('0x64')]}});}return null;})[_0x9920('0x23')](handleEntityNotFound(_0xc4b01,null))[_0x9920('0x23')](function(_0x107e99){if(_0x107e99){return _0x107e99[_0x9920('0x36')]({'UserId':_0x2eb302['body'][_0x9920('0x5e')],'read1stAt':_[_0x9920('0x65')](_0x107e99[_0x9920('0x66')])?moment()[_0x9920('0x5c')](_0x9920('0x5d')):undefined});}return null;})['then'](function(_0xd201f8){if(_0xd201f8){_0x3e50bd[_0x9920('0x67')]=_0xd201f8[_0x9920('0x62')]({'plain':!![]});interaction_log[_0x9920('0x24')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2eb302[_0x9920('0x5f')]['id'],_0x2eb302[_0x9920('0x5f')]['name'],_0x2eb302[_0x9920('0x5f')][_0x9920('0x68')],_0x3e50bd[_0x9920('0x67')]['id'],_0x2eb302[_0x9920('0x55')]?JSON[_0x9920('0x69')](_0x2eb302['body']):'null');return respondWithRpcPromise(_0x9920('0x6a'),_0x9920('0x6b'),_0x3e50bd);}return null;})['then'](function(_0x1d8237){if(_0x1d8237){if(_0x2eb302['body']['manual']){_0x3e50bd['message']['interface']=util[_0x9920('0x5c')](_0x9920('0x6c'),_0x2eb302[_0x9920('0x5f')][_0x9920('0x37')]);_0x3e50bd['message'][_0x9920('0x6d')]=_0x3e50bd[_0x9920('0x6d')];_0x3e50bd[_0x9920('0x28')][_0x9920('0x6e')]=_0x9920('0x6f');return respondWithRpcPromise(_0x9920('0x70'),'EventManager',{'event':_0x9920('0x71'),'message':_['merge'](_0x3e50bd[_0x9920('0x28')],JSON[_0x9920('0x72')](_0x3e50bd['interaction'][_0x9920('0x73')]))},client9002)[_0x9920('0x23')](function(){return _0x3e50bd;});}return _0x3e50bd;}return null;})['then'](respondWithResult(_0xc4b01,null))['catch'](handleError(_0xc4b01,null));};var interaction_log=require(_0x9920('0x15'))(_0x9920('0x58'));exports['reject']=function(_0x376d91,_0x4cb897,_0x290c19){var _0x4bb721={'agent':{},'channel':_0x9920('0x59')};if(_0x376d91[_0x9920('0x55')]['id']){delete _0x376d91['body']['id'];}_0x376d91[_0x9920('0x55')][_0x9920('0x5e')]=_0x376d91['body'][_0x9920('0x5e')]||_0x376d91[_0x9920('0x5f')]['id'];_0x4bb721[_0x9920('0x74')]['id']=_0x376d91[_0x9920('0x55')]['UserId'];return db[_0x9920('0x39')][_0x9920('0x53')]({'where':{'id':_0x376d91['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4cb897,null))['then'](function(_0x46c61c){if(_0x46c61c){_0x4bb721[_0x9920('0x28')]=_0x46c61c['get']({'plain':!![]});return db[_0x9920('0x63')][_0x9920('0x53')]({'where':{'id':_0x46c61c[_0x9920('0x64')]}});}return null;})[_0x9920('0x23')](handleEntityNotFound(_0x4cb897,null))[_0x9920('0x23')](function(_0x1827b8){if(_0x1827b8){_0x4bb721['interaction']=_0x1827b8[_0x9920('0x62')]({'plain':!![]});interaction_log[_0x9920('0x24')](_0x9920('0x75'),_0x376d91['user']['id'],_0x376d91[_0x9920('0x5f')][_0x9920('0x37')],_0x376d91[_0x9920('0x5f')][_0x9920('0x68')],_0x4bb721[_0x9920('0x67')]['id'],_0x376d91['body']?JSON[_0x9920('0x69')](_0x376d91[_0x9920('0x55')]):_0x9920('0x76'));return respondWithRpcPromise(_0x9920('0x77'),_0x9920('0x78'),_0x4bb721);}return null;})['then'](function(_0x980df0){if(_0x980df0){_0x980df0[_0x9920('0x28')][_0x9920('0x79')]=util['format']('SIP/%s',_0x376d91[_0x9920('0x5f')][_0x9920('0x37')]);_0x980df0[_0x9920('0x28')][_0x9920('0x6d')]=_0x4bb721['channel'];_0x980df0['message'][_0x9920('0x6e')]='reject';respondWithRpcPromise(_0x9920('0x70'),_0x9920('0x70'),{'event':_0x9920('0x7a'),'message':_0x980df0['message']},client9002);return _0x4bb721;}return null;})[_0x9920('0x23')](respondWithResult(_0x4cb897,null))[_0x9920('0x2b')](handleError(_0x4cb897,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 100f2ec..fcd9eed 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 _0x07e6=['emit','hook','setMaxListeners','save','update','remove'];(function(_0xbfbef0,_0x218b21){var _0x3fdf6f=function(_0x468471){while(--_0x468471){_0xbfbef0['push'](_0xbfbef0['shift']());}};_0x3fdf6f(++_0x218b21);}(_0x07e6,0x19a));var _0x607e=function(_0x182199,_0x4f59f1){_0x182199=_0x182199-0x0;var _0x35b58b=_0x07e6[_0x182199];return _0x35b58b;};'use strict';var EventEmitter=require('events');var ChatMessage=require('../../mysqldb')['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x607e('0x0')](0x0);var events={'afterCreate':_0x607e('0x1'),'afterUpdate':_0x607e('0x2'),'afterDestroy':_0x607e('0x3')};function emitEvent(_0x39bc37){return function(_0x1c5c25,_0x416102,_0x333ee6){ChatMessageEvents['emit'](_0x39bc37+':'+_0x1c5c25['id'],_0x1c5c25);ChatMessageEvents[_0x607e('0x4')](_0x39bc37,_0x1c5c25);_0x333ee6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x607e('0x5')](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file +var _0x3401=['exports','events','../../mysqldb','ChatMessage','setMaxListeners','save','remove','hasOwnProperty'];(function(_0x2f3824,_0x12ca3a){var _0x1de74f=function(_0x4ea12e){while(--_0x4ea12e){_0x2f3824['push'](_0x2f3824['shift']());}};_0x1de74f(++_0x12ca3a);}(_0x3401,0x1e1));var _0x1340=function(_0x509707,_0x3818fc){_0x509707=_0x509707-0x0;var _0x44f988=_0x3401[_0x509707];return _0x44f988;};'use strict';var EventEmitter=require(_0x1340('0x0'));var ChatMessage=require(_0x1340('0x1'))['db'][_0x1340('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x1340('0x3')](0x0);var events={'afterCreate':_0x1340('0x4'),'afterUpdate':'update','afterDestroy':_0x1340('0x5')};function emitEvent(_0x471d2b){return function(_0x2ba699,_0x14b5df,_0x279551){ChatMessageEvents['emit'](_0x471d2b+':'+_0x2ba699['id'],_0x2ba699);ChatMessageEvents['emit'](_0x471d2b,_0x2ba699);_0x279551(null);};}for(var e in events){if(events[_0x1340('0x6')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x1340('0x7')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index b943bfe..a328f8f 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 _0x4808=['ChatMessage','chat_messages','fti_chat_messages','FULLTEXT','models','get','direction','toLowerCase','out','isNil','UserId','findOne','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment','define'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0x4808,0xf4));var _0x8480=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x4808[_0x3511d3];return _0x5d6321;};'use strict';var _=require(_0x8480('0x0'));var util=require(_0x8480('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x8480('0x2'));var BPromise=require(_0x8480('0x3'));var rp=require(_0x8480('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8480('0x5'));var config=require(_0x8480('0x6'));var attributes=require('./chatMessage.attributes');module['exports']=function(_0x438c06,_0x48e7c2){return _0x438c06[_0x8480('0x7')](_0x8480('0x8'),attributes,{'tableName':_0x8480('0x9'),'paranoid':![],'indexes':[{'name':_0x8480('0xa'),'fields':['body'],'type':_0x8480('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x11aa80,_0x13d06a,_0x4aab0e){var _0x378908=_0x438c06[_0x8480('0xc')];var _0x1ab618=_0x11aa80[_0x8480('0xd')]({'plain':!![]});if(_0x1ab618[_0x8480('0xe')][_0x8480('0xf')]()==='in'||_0x1ab618[_0x8480('0xe')]['toLowerCase']()===_0x8480('0x10')&&!_0x1ab618['secret']&&!_[_0x8480('0x11')](_0x1ab618[_0x8480('0x12')])){_0x378908['ChatInteraction'][_0x8480('0x13')]({'where':{'id':_0x1ab618[_0x8480('0x14')]}})[_0x8480('0x15')](function(_0x2f0f2f){if(_0x2f0f2f){_0x2f0f2f[_0x8480('0x16')]({'lastMsgAt':_0x1ab618[_0x8480('0x17')],'lastMsgDirection':_0x1ab618[_0x8480('0xe')][_0x8480('0xf')]()});}})[_0x8480('0x18')](function(_0x3410ac){console[_0x8480('0x19')](_0x3410ac);});}_0x4aab0e();}},'charset':_0x8480('0x1a'),'collate':_0x8480('0x1b')});}; \ No newline at end of file +var _0x9ffe=['get','direction','toLowerCase','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','catch','lodash','util','../../config/logger','api','bluebird','request-promise','path','ChatMessage','fti_chat_messages','body','models'];(function(_0x1ac6ec,_0x1f81fc){var _0x48a489=function(_0xf38b04){while(--_0xf38b04){_0x1ac6ec['push'](_0x1ac6ec['shift']());}};_0x48a489(++_0x1f81fc);}(_0x9ffe,0xfd));var _0xe9ff=function(_0xf8bd98,_0x722df){_0xf8bd98=_0xf8bd98-0x0;var _0x34e8af=_0x9ffe[_0xf8bd98];return _0x34e8af;};'use strict';var _=require(_0xe9ff('0x0'));var util=require(_0xe9ff('0x1'));var logger=require(_0xe9ff('0x2'))(_0xe9ff('0x3'));var moment=require('moment');var BPromise=require(_0xe9ff('0x4'));var rp=require(_0xe9ff('0x5'));var fs=require('fs');var path=require(_0xe9ff('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatMessage.attributes');module['exports']=function(_0x2ee7e2,_0x648807){return _0x2ee7e2['define'](_0xe9ff('0x7'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0xe9ff('0x8'),'fields':[_0xe9ff('0x9')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4a734d,_0x5da2e1,_0x15c87f){var _0x405669=_0x2ee7e2[_0xe9ff('0xa')];var _0x47f368=_0x4a734d[_0xe9ff('0xb')]({'plain':!![]});if(_0x47f368[_0xe9ff('0xc')]['toLowerCase']()==='in'||_0x47f368[_0xe9ff('0xc')][_0xe9ff('0xd')]()==='out'&&!_0x47f368['secret']&&!_['isNil'](_0x47f368[_0xe9ff('0xe')])){_0x405669[_0xe9ff('0xf')][_0xe9ff('0x10')]({'where':{'id':_0x47f368[_0xe9ff('0x11')]}})[_0xe9ff('0x12')](function(_0x1da863){if(_0x1da863){_0x1da863[_0xe9ff('0x13')]({'lastMsgAt':_0x47f368[_0xe9ff('0x14')],'lastMsgDirection':_0x47f368[_0xe9ff('0xc')]['toLowerCase']()});}})[_0xe9ff('0x15')](function(_0x5174df){console['error'](_0x5174df);});}_0x15c87f();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 80dd8bf..4fc3cd8 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 _0xcb2a=['error','code','ChatMessage,\x20%s,\x20%s','message','result','CreateChatMessage','ChatMessage','create','body','options','raw','catch','lodash','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','stringify'];(function(_0x37b3c1,_0x1dba8a){var _0x109803=function(_0x9dbe6e){while(--_0x9dbe6e){_0x37b3c1['push'](_0x37b3c1['shift']());}};_0x109803(++_0x1dba8a);}(_0xcb2a,0xc0));var _0xacb2=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xcb2a[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0xacb2('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xacb2('0x1'));var fs=require('fs');var Redis=require(_0xacb2('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xacb2('0x3'));var logger=require('../../config/logger')(_0xacb2('0x4'));var config=require(_0xacb2('0x5'));var jayson=require(_0xacb2('0x6'));var client=jayson['client']['http']({'port':0x232a});config[_0xacb2('0x7')]=_[_0xacb2('0x8')](config[_0xacb2('0x7')],{'host':_0xacb2('0x9'),'port':0x18eb});var socket=require(_0xacb2('0xa'))(new Redis(config[_0xacb2('0x7')]));require('./chatMessage.socket')[_0xacb2('0xb')](socket);function respondWithRpcPromise(_0x2f60c3,_0x43f2ec,_0x59678f){return new BPromise(function(_0x21f79a,_0x5e523b){return client[_0xacb2('0xc')](_0x2f60c3,_0x59678f)[_0xacb2('0xd')](function(_0x41dcff){logger[_0xacb2('0xe')]('ChatMessage,\x20%s,\x20%s',_0x43f2ec,_0xacb2('0xf'));logger[_0xacb2('0x10')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x43f2ec,'request\x20sent',JSON[_0xacb2('0x11')](_0x41dcff));if(_0x41dcff[_0xacb2('0x12')]){if(_0x41dcff[_0xacb2('0x12')][_0xacb2('0x13')]===0x1f4){logger[_0xacb2('0x12')](_0xacb2('0x14'),_0x43f2ec,_0x41dcff[_0xacb2('0x12')][_0xacb2('0x15')]);return _0x5e523b(_0x41dcff[_0xacb2('0x12')][_0xacb2('0x15')]);}logger[_0xacb2('0x12')](_0xacb2('0x14'),_0x43f2ec,_0x41dcff['error'][_0xacb2('0x15')]);return _0x21f79a(_0x41dcff['error'][_0xacb2('0x15')]);}else{logger[_0xacb2('0xe')]('ChatMessage,\x20%s,\x20%s',_0x43f2ec,_0xacb2('0xf'));_0x21f79a(_0x41dcff[_0xacb2('0x16')][_0xacb2('0x15')]);}})['catch'](function(_0x27d694){logger[_0xacb2('0x12')](_0xacb2('0x14'),_0x43f2ec,_0x27d694);_0x5e523b(_0x27d694);});});}exports[_0xacb2('0x17')]=function(_0x120cdb){var _0x377d09=this;return new Promise(function(_0x1f21fe,_0x26b9a6){return db[_0xacb2('0x18')][_0xacb2('0x19')](_0x120cdb[_0xacb2('0x1a')],{'raw':_0x120cdb[_0xacb2('0x1b')]?_0x120cdb[_0xacb2('0x1b')][_0xacb2('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x2e82de){logger['info']('CreateChatMessage',_0x120cdb);logger[_0xacb2('0x10')](_0xacb2('0x17'),_0x120cdb,JSON[_0xacb2('0x11')](_0x2e82de));_0x1f21fe(_0x2e82de);})[_0xacb2('0x1d')](function(_0x4f0950){logger['error']('CreateChatMessage',_0x4f0950[_0xacb2('0x15')],_0x120cdb);_0x26b9a6(_0x377d09[_0xacb2('0x12')](0x1f4,_0x4f0950[_0xacb2('0x15')]));});});}; \ No newline at end of file +var _0x25bb=['debug','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','then'];(function(_0x2a4452,_0x48673f){var _0xd71e4d=function(_0x167744){while(--_0x167744){_0x2a4452['push'](_0x2a4452['shift']());}};_0xd71e4d(++_0x48673f);}(_0x25bb,0xd4));var _0xb25b=function(_0x3149bc,_0x29b5e3){_0x3149bc=_0x3149bc-0x0;var _0x1e5e34=_0x25bb[_0x3149bc];return _0x1e5e34;};'use strict';var _=require(_0xb25b('0x0'));var util=require(_0xb25b('0x1'));var moment=require(_0xb25b('0x2'));var BPromise=require('bluebird');var rs=require(_0xb25b('0x3'));var fs=require('fs');var Redis=require(_0xb25b('0x4'));var db=require(_0xb25b('0x5'))['db'];var utils=require(_0xb25b('0x6'));var logger=require(_0xb25b('0x7'))(_0xb25b('0x8'));var config=require('../../config/environment');var jayson=require(_0xb25b('0x9'));var client=jayson[_0xb25b('0xa')][_0xb25b('0xb')]({'port':0x232a});config['redis']=_[_0xb25b('0xc')](config[_0xb25b('0xd')],{'host':_0xb25b('0xe'),'port':0x18eb});var socket=require(_0xb25b('0xf'))(new Redis(config[_0xb25b('0xd')]));require('./chatMessage.socket')[_0xb25b('0x10')](socket);function respondWithRpcPromise(_0x5a5d30,_0x5bcda1,_0x51fa58){return new BPromise(function(_0x593ab4,_0xe72ff9){return client[_0xb25b('0x11')](_0x5a5d30,_0x51fa58)['then'](function(_0x225bfe){logger[_0xb25b('0x12')](_0xb25b('0x13'),_0x5bcda1,_0xb25b('0x14'));logger['debug'](_0xb25b('0x15'),_0x5bcda1,'request\x20sent',JSON['stringify'](_0x225bfe));if(_0x225bfe[_0xb25b('0x16')]){if(_0x225bfe[_0xb25b('0x16')]['code']===0x1f4){logger[_0xb25b('0x16')](_0xb25b('0x13'),_0x5bcda1,_0x225bfe['error'][_0xb25b('0x17')]);return _0xe72ff9(_0x225bfe[_0xb25b('0x16')]['message']);}logger['error'](_0xb25b('0x13'),_0x5bcda1,_0x225bfe['error'][_0xb25b('0x17')]);return _0x593ab4(_0x225bfe[_0xb25b('0x16')][_0xb25b('0x17')]);}else{logger[_0xb25b('0x12')](_0xb25b('0x13'),_0x5bcda1,_0xb25b('0x14'));_0x593ab4(_0x225bfe[_0xb25b('0x18')][_0xb25b('0x17')]);}})[_0xb25b('0x19')](function(_0xb7b24){logger[_0xb25b('0x16')]('ChatMessage,\x20%s,\x20%s',_0x5bcda1,_0xb7b24);_0xe72ff9(_0xb7b24);});});}exports[_0xb25b('0x1a')]=function(_0x463191){var _0x1d82d5=this;return new Promise(function(_0x28c90b,_0x9e786a){return db[_0xb25b('0x1b')][_0xb25b('0x1c')](_0x463191[_0xb25b('0x1d')],{'raw':_0x463191[_0xb25b('0x1e')]?_0x463191[_0xb25b('0x1e')][_0xb25b('0x1f')]===undefined?!![]:![]:!![]})[_0xb25b('0x20')](function(_0x55d873){logger['info']('CreateChatMessage',_0x463191);logger[_0xb25b('0x21')](_0xb25b('0x1a'),_0x463191,JSON[_0xb25b('0x22')](_0x55d873));_0x28c90b(_0x55d873);})['catch'](function(_0x11acfe){logger['error'](_0xb25b('0x1a'),_0x11acfe['message'],_0x463191);_0x9e786a(_0x1d82d5['error'](0x1f4,_0x11acfe[_0xb25b('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index b380fdb..84578b5 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 _0x3f8a=['chatMessage:','./chatMessage.events','save','remove','update','emit','removeListener','register','length'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x1e878f,_0x3a63e7){_0x1e878f=_0x1e878f-0x0;var _0x442563=_0x3f8a[_0x1e878f];return _0x442563;};'use strict';var ChatMessageEvents=require(_0xa3f8('0x0'));var events=[_0xa3f8('0x1'),_0xa3f8('0x2'),_0xa3f8('0x3')];function createListener(_0x512b4c,_0x467a6c){return function(_0x143375){_0x467a6c[_0xa3f8('0x4')](_0x512b4c,_0x143375);};}function removeListener(_0x15b6aa,_0x2553fd){return function(){ChatMessageEvents[_0xa3f8('0x5')](_0x15b6aa,_0x2553fd);};}exports[_0xa3f8('0x6')]=function(_0x471464){for(var _0x1f160a=0x0,_0xf895d9=events[_0xa3f8('0x7')];_0x1f160a<_0xf895d9;_0x1f160a++){var _0x268332=events[_0x1f160a];var _0x2faf2e=createListener(_0xa3f8('0x8')+_0x268332,_0x471464);ChatMessageEvents['on'](_0x268332,_0x2faf2e);}}; \ No newline at end of file +var _0xc1c6=['length','chatMessage:','./chatMessage.events','save','remove','emit','register'];(function(_0x4dc7b9,_0x319d5a){var _0x3ab114=function(_0x51a9df){while(--_0x51a9df){_0x4dc7b9['push'](_0x4dc7b9['shift']());}};_0x3ab114(++_0x319d5a);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x3b795b,_0x1ca010){_0x3b795b=_0x3b795b-0x0;var _0x5a13fc=_0xc1c6[_0x3b795b];return _0x5a13fc;};'use strict';var ChatMessageEvents=require(_0x6c1c('0x0'));var events=[_0x6c1c('0x1'),_0x6c1c('0x2'),'update'];function createListener(_0x114c93,_0x4c33ca){return function(_0x426398){_0x4c33ca[_0x6c1c('0x3')](_0x114c93,_0x426398);};}function removeListener(_0x265d2c,_0x59f799){return function(){ChatMessageEvents['removeListener'](_0x265d2c,_0x59f799);};}exports[_0x6c1c('0x4')]=function(_0x524a6b){for(var _0x50c1bb=0x0,_0x582bec=events[_0x6c1c('0x5')];_0x50c1bb<_0x582bec;_0x50c1bb++){var _0x2eb1ba=events[_0x50c1bb];var _0x38369d=createListener(_0x6c1c('0x6')+_0x2eb1ba,_0x524a6b);ChatMessageEvents['on'](_0x2eb1ba,_0x38369d);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index c155fda..87617c4 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 _0xf579=['exports','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','post','tracked','chat','chatmessage:create','update','put','/:id/accept','accept','/:id/reject','reject','destroy'];(function(_0x4c480a,_0x34ebf2){var _0x2c0b49=function(_0x5a2cf6){while(--_0x5a2cf6){_0x4c480a['push'](_0x4c480a['shift']());}};_0x2c0b49(++_0x34ebf2);}(_0xf579,0x139));var _0x9f57=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xf579[_0x3e5086];return _0xfeb102;};'use strict';var multer=require('multer');var util=require(_0x9f57('0x0'));var path=require('path');var timeout=require(_0x9f57('0x1'));var express=require(_0x9f57('0x2'));var router=express['Router']();var auth=require(_0x9f57('0x3'));var interaction=require(_0x9f57('0x4'));var config=require(_0x9f57('0x5'));var controller=require('./chatMessage.controller');router[_0x9f57('0x6')]('/',auth['isAuthenticated'](),controller[_0x9f57('0x7')]);router[_0x9f57('0x6')](_0x9f57('0x8'),auth[_0x9f57('0x9')](),controller[_0x9f57('0xa')]);router[_0x9f57('0x6')](_0x9f57('0xb'),auth[_0x9f57('0x9')](),controller['show']);router[_0x9f57('0xc')]('/',auth[_0x9f57('0x9')](),interaction[_0x9f57('0xd')](_0x9f57('0xe'),_0x9f57('0xf')),controller['create']);router['put'](_0x9f57('0xb'),controller[_0x9f57('0x10')]);router[_0x9f57('0x11')](_0x9f57('0x12'),auth[_0x9f57('0x9')](),controller[_0x9f57('0x13')]);router[_0x9f57('0x11')](_0x9f57('0x14'),auth[_0x9f57('0x9')](),controller[_0x9f57('0x15')]);router['delete'](_0x9f57('0xb'),auth['isAuthenticated'](),controller[_0x9f57('0x16')]);module[_0x9f57('0x17')]=router; \ No newline at end of file +var _0x5abe=['delete','destroy','exports','multer','util','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','/describe','isAuthenticated','describe','post','tracked','chatmessage:create','create','/:id','update','/:id/accept','accept','put','/:id/reject','reject'];(function(_0x29f06c,_0x3f36c1){var _0x5c8626=function(_0x1a4b01){while(--_0x1a4b01){_0x29f06c['push'](_0x29f06c['shift']());}};_0x5c8626(++_0x3f36c1);}(_0x5abe,0x161));var _0xe5ab=function(_0x19fb5e,_0x316197){_0x19fb5e=_0x19fb5e-0x0;var _0x48d0fa=_0x5abe[_0x19fb5e];return _0x48d0fa;};'use strict';var multer=require(_0xe5ab('0x0'));var util=require(_0xe5ab('0x1'));var path=require('path');var timeout=require(_0xe5ab('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0xe5ab('0x3'));var interaction=require(_0xe5ab('0x4'));var config=require(_0xe5ab('0x5'));var controller=require(_0xe5ab('0x6'));router[_0xe5ab('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe5ab('0x7')](_0xe5ab('0x8'),auth[_0xe5ab('0x9')](),controller[_0xe5ab('0xa')]);router['get']('/:id',auth[_0xe5ab('0x9')](),controller['show']);router[_0xe5ab('0xb')]('/',auth[_0xe5ab('0x9')](),interaction[_0xe5ab('0xc')]('chat',_0xe5ab('0xd')),controller[_0xe5ab('0xe')]);router['put'](_0xe5ab('0xf'),controller[_0xe5ab('0x10')]);router['put'](_0xe5ab('0x11'),auth[_0xe5ab('0x9')](),controller[_0xe5ab('0x12')]);router[_0xe5ab('0x13')](_0xe5ab('0x14'),auth[_0xe5ab('0x9')](),controller[_0xe5ab('0x15')]);router[_0xe5ab('0x16')](_0xe5ab('0xf'),auth[_0xe5ab('0x9')](),controller[_0xe5ab('0x17')]);module[_0xe5ab('0x18')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index c990d45..a28872f 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 _0x8e02=['TEXT','sequelize','exports'];(function(_0xac9411,_0x1fa94c){var _0x5ca0f4=function(_0x287ee8){while(--_0x287ee8){_0xac9411['push'](_0xac9411['shift']());}};_0x5ca0f4(++_0x1fa94c);}(_0x8e02,0x121));var _0x28e0=function(_0x3e5fb6,_0x21fb13){_0x3e5fb6=_0x3e5fb6-0x0;var _0x547d83=_0x8e02[_0x3e5fb6];return _0x547d83;};'use strict';var Sequelize=require(_0x28e0('0x0'));module[_0x28e0('0x1')]={'body':{'type':Sequelize[_0x28e0('0x2')]('medium'),'allowNull':![]}}; \ No newline at end of file +var _0x084f=['sequelize','exports','medium'];(function(_0x4c5804,_0xb8dc50){var _0x406867=function(_0xda1fa){while(--_0xda1fa){_0x4c5804['push'](_0x4c5804['shift']());}};_0x406867(++_0xb8dc50);}(_0x084f,0x132));var _0xf084=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0x084f[_0x47b58b];return _0x46bebe;};'use strict';var Sequelize=require(_0xf084('0x0'));module[_0xf084('0x1')]={'body':{'type':Sequelize['TEXT'](_0xf084('0x2')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 637d60d..c44a6ad 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 _0xaa89=['error','name','send','index','ChatOfflineMessage','rawAttributes','type','key','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','filter','map','field','count','include','findAll','rows','catch','length','includeAll','merge','options','create','body','update','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','Content-Range','apply','reject','save','then','destroy'];(function(_0x3ceb28,_0x2f61ea){var _0x31c60b=function(_0x5009d8){while(--_0x5009d8){_0x3ceb28['push'](_0x3ceb28['shift']());}};_0x31c60b(++_0x2f61ea);}(_0xaa89,0xb4));var _0x9aa8=function(_0x6dfbaa,_0x31eede){_0x6dfbaa=_0x6dfbaa-0x0;var _0xfbe02=_0xaa89[_0x6dfbaa];return _0xfbe02;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9aa8('0x0'));var rimraf=require(_0x9aa8('0x1'));var zipdir=require(_0x9aa8('0x2'));var jsonpatch=require(_0x9aa8('0x3'));var rp=require(_0x9aa8('0x4'));var moment=require(_0x9aa8('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9aa8('0x6'));var util=require('util');var path=require(_0x9aa8('0x7'));var sox=require(_0x9aa8('0x8'));var csv=require(_0x9aa8('0x9'));var ejs=require(_0x9aa8('0xa'));var fs=require('fs');var _=require(_0x9aa8('0xb'));var squel=require(_0x9aa8('0xc'));var crypto=require(_0x9aa8('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x9aa8('0xe'));var toCsv=require(_0x9aa8('0x9'));var querystring=require('querystring');var Papa=require(_0x9aa8('0xf'));var Redis=require(_0x9aa8('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9aa8('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9aa8('0x12'))(_0x9aa8('0x13'));var utils=require('../../config/utils');var config=require(_0x9aa8('0x14'));var db=require(_0x9aa8('0x15'))['db'];function respondWithStatusCode(_0x386c8f,_0x4f16e0){_0x4f16e0=_0x4f16e0||0xcc;return function(_0xcb441b){if(_0xcb441b){return _0x386c8f[_0x9aa8('0x16')](_0x4f16e0);}return _0x386c8f[_0x9aa8('0x17')](_0x4f16e0)['end']();};}function respondWithResult(_0x5959b0,_0x3c5113){_0x3c5113=_0x3c5113||0xc8;return function(_0x442c82){if(_0x442c82){return _0x5959b0[_0x9aa8('0x17')](_0x3c5113)[_0x9aa8('0x18')](_0x442c82);}};}function respondWithFilteredResult(_0x151130,_0x444b9d){return function(_0x2e4ea3){if(_0x2e4ea3){var _0x4bc1b8=_0x2e4ea3['count'],_0x5a6bc9=_0x444b9d[_0x9aa8('0x19')],_0x502891=_0x444b9d[_0x9aa8('0x19')]+_0x444b9d[_0x9aa8('0x1a')],_0x3a0569;if(_0x502891>=_0x4bc1b8){_0x502891=_0x4bc1b8;_0x3a0569=0xc8;}else{_0x3a0569=0xce;}_0x151130['status'](_0x3a0569);return _0x151130['set'](_0x9aa8('0x1b'),_0x5a6bc9+'-'+_0x502891+'/'+_0x4bc1b8)['json'](_0x2e4ea3);}return null;};}function patchUpdates(_0x1fc11d){return function(_0x3b65a7){try{jsonpatch[_0x9aa8('0x1c')](_0x3b65a7,_0x1fc11d,!![]);}catch(_0x26ff9f){return BPromise[_0x9aa8('0x1d')](_0x26ff9f);}return _0x3b65a7[_0x9aa8('0x1e')]();};}function saveUpdates(_0x31558c,_0x579542){return function(_0x307ecd){if(_0x307ecd){return _0x307ecd['update'](_0x31558c)[_0x9aa8('0x1f')](function(_0x2e371b){return _0x2e371b;});}return null;};}function removeEntity(_0x55426b,_0x265940){return function(_0x1dfce8){if(_0x1dfce8){return _0x1dfce8[_0x9aa8('0x20')]()[_0x9aa8('0x1f')](function(){_0x55426b[_0x9aa8('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x37f232,_0x126ffa){return function(_0x21390d){if(!_0x21390d){_0x37f232[_0x9aa8('0x16')](0x194);}return _0x21390d;};}function handleError(_0x44c401,_0x1ebdec){_0x1ebdec=_0x1ebdec||0x1f4;return function(_0x3d38ab){logger[_0x9aa8('0x21')](_0x3d38ab['stack']);if(_0x3d38ab[_0x9aa8('0x22')]){delete _0x3d38ab[_0x9aa8('0x22')];}_0x44c401[_0x9aa8('0x17')](_0x1ebdec)[_0x9aa8('0x23')](_0x3d38ab);};}exports[_0x9aa8('0x24')]=function(_0x9851ec,_0x384283){var _0x3f6530={},_0x989642={},_0x54ce38={'count':0x0,'rows':[]};var _0x59de58=_['map'](db[_0x9aa8('0x25')][_0x9aa8('0x26')],function(_0xee9218){return{'name':_0xee9218['fieldName'],'type':_0xee9218[_0x9aa8('0x27')][_0x9aa8('0x28')]};});_0x989642[_0x9aa8('0x29')]=_['map'](_0x59de58,'name');_0x989642['query']=_[_0x9aa8('0x2a')](_0x9851ec[_0x9aa8('0x2b')]);_0x989642[_0x9aa8('0x2c')]=_['intersection'](_0x989642[_0x9aa8('0x29')],_0x989642[_0x9aa8('0x2b')]);_0x3f6530[_0x9aa8('0x2d')]=_[_0x9aa8('0x2e')](_0x989642[_0x9aa8('0x29')],qs[_0x9aa8('0x2f')](_0x9851ec['query'][_0x9aa8('0x2f')]));_0x3f6530['attributes']=_0x3f6530[_0x9aa8('0x2d')]['length']?_0x3f6530[_0x9aa8('0x2d')]:_0x989642[_0x9aa8('0x29')];if(!_0x9851ec[_0x9aa8('0x2b')][_0x9aa8('0x30')]('nolimit')){_0x3f6530[_0x9aa8('0x1a')]=qs['limit'](_0x9851ec['query']['limit']);_0x3f6530['offset']=qs[_0x9aa8('0x19')](_0x9851ec['query'][_0x9aa8('0x19')]);}_0x3f6530[_0x9aa8('0x31')]=qs[_0x9aa8('0x32')](_0x9851ec[_0x9aa8('0x2b')][_0x9aa8('0x32')]);_0x3f6530[_0x9aa8('0x33')]=qs['filters'](_[_0x9aa8('0x34')](_0x9851ec[_0x9aa8('0x2b')],_0x989642[_0x9aa8('0x2c')]));if(_0x9851ec['query'][_0x9aa8('0x35')]){_0x3f6530[_0x9aa8('0x33')]=_['merge'](_0x3f6530[_0x9aa8('0x33')],{'$or':_[_0x9aa8('0x36')](_0x59de58,function(_0x2489b4){if(_0x2489b4[_0x9aa8('0x27')]['key']!=='VIRTUAL'){var _0x2b64a6={};_0x2b64a6[_0x2489b4[_0x9aa8('0x37')]]={'$like':'%'+_0x9851ec[_0x9aa8('0x2b')][_0x9aa8('0x35')]+'%'};return _0x2b64a6;}})});}_0x3f6530=_['merge']({},_0x3f6530,_0x9851ec['options']);var _0x2ae8a7={'where':_0x3f6530[_0x9aa8('0x33')]};return db['ChatOfflineMessage'][_0x9aa8('0x38')](_0x2ae8a7)[_0x9aa8('0x1f')](function(_0x50ac75){_0x54ce38[_0x9aa8('0x38')]=_0x50ac75;if(_0x9851ec[_0x9aa8('0x2b')]['includeAll']){_0x3f6530[_0x9aa8('0x39')]=[{'all':!![]}];}return db[_0x9aa8('0x25')][_0x9aa8('0x3a')](_0x3f6530);})['then'](function(_0x3e1d80){_0x54ce38[_0x9aa8('0x3b')]=_0x3e1d80;return _0x54ce38;})[_0x9aa8('0x1f')](respondWithFilteredResult(_0x384283,_0x3f6530))[_0x9aa8('0x3c')](handleError(_0x384283,null));};exports['show']=function(_0x48ac50,_0x3be1d4){var _0x5aa17b={'raw':!![],'where':{'id':_0x48ac50['params']['id']}},_0x11eecb={};_0x11eecb[_0x9aa8('0x29')]=_['keys'](db['ChatOfflineMessage'][_0x9aa8('0x26')]);_0x11eecb[_0x9aa8('0x2b')]=_['keys'](_0x48ac50[_0x9aa8('0x2b')]);_0x11eecb[_0x9aa8('0x2c')]=_[_0x9aa8('0x2e')](_0x11eecb[_0x9aa8('0x29')],_0x11eecb[_0x9aa8('0x2b')]);_0x5aa17b[_0x9aa8('0x2d')]=_[_0x9aa8('0x2e')](_0x11eecb[_0x9aa8('0x29')],qs[_0x9aa8('0x2f')](_0x48ac50[_0x9aa8('0x2b')][_0x9aa8('0x2f')]));_0x5aa17b[_0x9aa8('0x2d')]=_0x5aa17b[_0x9aa8('0x2d')][_0x9aa8('0x3d')]?_0x5aa17b['attributes']:_0x11eecb[_0x9aa8('0x29')];if(_0x48ac50[_0x9aa8('0x2b')][_0x9aa8('0x3e')]){_0x5aa17b[_0x9aa8('0x39')]=[{'all':!![]}];}_0x5aa17b=_[_0x9aa8('0x3f')]({},_0x5aa17b,_0x48ac50[_0x9aa8('0x40')]);return db[_0x9aa8('0x25')]['find'](_0x5aa17b)[_0x9aa8('0x1f')](handleEntityNotFound(_0x3be1d4,null))['then'](respondWithResult(_0x3be1d4,null))[_0x9aa8('0x3c')](handleError(_0x3be1d4,null));};exports[_0x9aa8('0x41')]=function(_0x27fe39,_0x30d534){return db['ChatOfflineMessage'][_0x9aa8('0x41')](_0x27fe39[_0x9aa8('0x42')],{})[_0x9aa8('0x1f')](respondWithResult(_0x30d534,0xc9))['catch'](handleError(_0x30d534,null));};exports[_0x9aa8('0x43')]=function(_0x3d0260,_0x403fef){if(_0x3d0260[_0x9aa8('0x42')]['id']){delete _0x3d0260[_0x9aa8('0x42')]['id'];}return db['ChatOfflineMessage'][_0x9aa8('0x44')]({'where':{'id':_0x3d0260[_0x9aa8('0x45')]['id']}})[_0x9aa8('0x1f')](handleEntityNotFound(_0x403fef,null))[_0x9aa8('0x1f')](saveUpdates(_0x3d0260[_0x9aa8('0x42')],null))[_0x9aa8('0x1f')](respondWithResult(_0x403fef,null))[_0x9aa8('0x3c')](handleError(_0x403fef,null));};exports[_0x9aa8('0x20')]=function(_0x27078b,_0x576bc9){return db['ChatOfflineMessage']['find']({'where':{'id':_0x27078b[_0x9aa8('0x45')]['id']}})[_0x9aa8('0x1f')](handleEntityNotFound(_0x576bc9,null))[_0x9aa8('0x1f')](removeEntity(_0x576bc9,null))['catch'](handleError(_0x576bc9,null));};exports[_0x9aa8('0x46')]=function(_0x3def22,_0x7f08b2){return db[_0x9aa8('0x25')]['describe']()[_0x9aa8('0x1f')](respondWithResult(_0x7f08b2,null))[_0x9aa8('0x3c')](handleError(_0x7f08b2,null));}; \ No newline at end of file +var _0x7528=['query','filters','intersection','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','VIRTUAL','filter','merge','options','count','include','findAll','catch','params','keys','fields','includeAll','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','status','set','Content-Range','apply','update','then','destroy','error','stack','name','send','index','map','ChatOfflineMessage','rawAttributes','fieldName','type','key','model'];(function(_0x5d374f,_0x200a34){var _0x5819b4=function(_0x26464f){while(--_0x26464f){_0x5d374f['push'](_0x5d374f['shift']());}};_0x5819b4(++_0x200a34);}(_0x7528,0xb8));var _0x8752=function(_0x9290e5,_0x294298){_0x9290e5=_0x9290e5-0x0;var _0x125c7d=_0x7528[_0x9290e5];return _0x125c7d;};'use strict';var pdf=require(_0x8752('0x0'));var emlformat=require(_0x8752('0x1'));var rimraf=require(_0x8752('0x2'));var zipdir=require(_0x8752('0x3'));var jsonpatch=require(_0x8752('0x4'));var rp=require(_0x8752('0x5'));var moment=require(_0x8752('0x6'));var BPromise=require(_0x8752('0x7'));var Mustache=require('mustache');var util=require(_0x8752('0x8'));var path=require(_0x8752('0x9'));var sox=require(_0x8752('0xa'));var csv=require(_0x8752('0xb'));var ejs=require(_0x8752('0xc'));var fs=require('fs');var _=require(_0x8752('0xd'));var squel=require(_0x8752('0xe'));var crypto=require(_0x8752('0xf'));var jsforce=require(_0x8752('0x10'));var deskjs=require(_0x8752('0x11'));var toCsv=require(_0x8752('0xb'));var querystring=require(_0x8752('0x12'));var Papa=require(_0x8752('0x13'));var Redis=require(_0x8752('0x14'));var authService=require(_0x8752('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x8752('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8752('0x17'));var utils=require(_0x8752('0x18'));var config=require(_0x8752('0x19'));var db=require(_0x8752('0x1a'))['db'];function respondWithStatusCode(_0x2ecaf0,_0x5b8d41){_0x5b8d41=_0x5b8d41||0xcc;return function(_0x54a6d3){if(_0x54a6d3){return _0x2ecaf0[_0x8752('0x1b')](_0x5b8d41);}return _0x2ecaf0['status'](_0x5b8d41)[_0x8752('0x1c')]();};}function respondWithResult(_0x4e59bb,_0x5654e4){_0x5654e4=_0x5654e4||0xc8;return function(_0xc47c5a){if(_0xc47c5a){return _0x4e59bb['status'](_0x5654e4)[_0x8752('0x1d')](_0xc47c5a);}};}function respondWithFilteredResult(_0x132052,_0x3a523f){return function(_0x50fcc3){if(_0x50fcc3){var _0x26da17=_0x50fcc3['count'],_0x483f06=_0x3a523f[_0x8752('0x1e')],_0x53dd36=_0x3a523f[_0x8752('0x1e')]+_0x3a523f['limit'],_0x28baaa;if(_0x53dd36>=_0x26da17){_0x53dd36=_0x26da17;_0x28baaa=0xc8;}else{_0x28baaa=0xce;}_0x132052[_0x8752('0x1f')](_0x28baaa);return _0x132052[_0x8752('0x20')](_0x8752('0x21'),_0x483f06+'-'+_0x53dd36+'/'+_0x26da17)[_0x8752('0x1d')](_0x50fcc3);}return null;};}function patchUpdates(_0x3c01aa){return function(_0x2cf282){try{jsonpatch[_0x8752('0x22')](_0x2cf282,_0x3c01aa,!![]);}catch(_0x49a3f5){return BPromise['reject'](_0x49a3f5);}return _0x2cf282['save']();};}function saveUpdates(_0x1def32,_0x1f1dae){return function(_0x37b2e9){if(_0x37b2e9){return _0x37b2e9[_0x8752('0x23')](_0x1def32)[_0x8752('0x24')](function(_0x15774f){return _0x15774f;});}return null;};}function removeEntity(_0x235dfa,_0x2ed5d9){return function(_0x339f4a){if(_0x339f4a){return _0x339f4a[_0x8752('0x25')]()[_0x8752('0x24')](function(){_0x235dfa['status'](0xcc)[_0x8752('0x1c')]();});}};}function handleEntityNotFound(_0x415e04,_0x39ab97){return function(_0x3bdeae){if(!_0x3bdeae){_0x415e04[_0x8752('0x1b')](0x194);}return _0x3bdeae;};}function handleError(_0x58f6c5,_0x501461){_0x501461=_0x501461||0x1f4;return function(_0x84a229){logger[_0x8752('0x26')](_0x84a229[_0x8752('0x27')]);if(_0x84a229[_0x8752('0x28')]){delete _0x84a229[_0x8752('0x28')];}_0x58f6c5[_0x8752('0x1f')](_0x501461)[_0x8752('0x29')](_0x84a229);};}exports[_0x8752('0x2a')]=function(_0x33804e,_0x1610a7){var _0x4977b1={},_0xc90341={},_0x4971ca={'count':0x0,'rows':[]};var _0x305354=_[_0x8752('0x2b')](db[_0x8752('0x2c')][_0x8752('0x2d')],function(_0x13e675){return{'name':_0x13e675[_0x8752('0x2e')],'type':_0x13e675[_0x8752('0x2f')][_0x8752('0x30')]};});_0xc90341[_0x8752('0x31')]=_['map'](_0x305354,_0x8752('0x28'));_0xc90341[_0x8752('0x32')]=_['keys'](_0x33804e[_0x8752('0x32')]);_0xc90341[_0x8752('0x33')]=_[_0x8752('0x34')](_0xc90341[_0x8752('0x31')],_0xc90341[_0x8752('0x32')]);_0x4977b1['attributes']=_[_0x8752('0x34')](_0xc90341[_0x8752('0x31')],qs['fields'](_0x33804e[_0x8752('0x32')]['fields']));_0x4977b1[_0x8752('0x35')]=_0x4977b1[_0x8752('0x35')][_0x8752('0x36')]?_0x4977b1[_0x8752('0x35')]:_0xc90341[_0x8752('0x31')];if(!_0x33804e['query'][_0x8752('0x37')](_0x8752('0x38'))){_0x4977b1[_0x8752('0x39')]=qs[_0x8752('0x39')](_0x33804e[_0x8752('0x32')][_0x8752('0x39')]);_0x4977b1[_0x8752('0x1e')]=qs[_0x8752('0x1e')](_0x33804e[_0x8752('0x32')]['offset']);}_0x4977b1[_0x8752('0x3a')]=qs['sort'](_0x33804e[_0x8752('0x32')][_0x8752('0x3b')]);_0x4977b1[_0x8752('0x3c')]=qs[_0x8752('0x33')](_[_0x8752('0x3d')](_0x33804e[_0x8752('0x32')],_0xc90341[_0x8752('0x33')]));if(_0x33804e[_0x8752('0x32')]['filter']){_0x4977b1[_0x8752('0x3c')]=_['merge'](_0x4977b1[_0x8752('0x3c')],{'$or':_[_0x8752('0x2b')](_0x305354,function(_0x356e4c){if(_0x356e4c[_0x8752('0x2f')][_0x8752('0x30')]!==_0x8752('0x3e')){var _0x545704={};_0x545704[_0x356e4c['field']]={'$like':'%'+_0x33804e[_0x8752('0x32')][_0x8752('0x3f')]+'%'};return _0x545704;}})});}_0x4977b1=_[_0x8752('0x40')]({},_0x4977b1,_0x33804e[_0x8752('0x41')]);var _0x211212={'where':_0x4977b1[_0x8752('0x3c')]};return db[_0x8752('0x2c')][_0x8752('0x42')](_0x211212)[_0x8752('0x24')](function(_0x425bda){_0x4971ca[_0x8752('0x42')]=_0x425bda;if(_0x33804e[_0x8752('0x32')]['includeAll']){_0x4977b1[_0x8752('0x43')]=[{'all':!![]}];}return db[_0x8752('0x2c')][_0x8752('0x44')](_0x4977b1);})[_0x8752('0x24')](function(_0x58635d){_0x4971ca['rows']=_0x58635d;return _0x4971ca;})[_0x8752('0x24')](respondWithFilteredResult(_0x1610a7,_0x4977b1))[_0x8752('0x45')](handleError(_0x1610a7,null));};exports['show']=function(_0x555bd8,_0x529b0a){var _0x399f94={'raw':!![],'where':{'id':_0x555bd8[_0x8752('0x46')]['id']}},_0x517f17={};_0x517f17[_0x8752('0x31')]=_[_0x8752('0x47')](db[_0x8752('0x2c')]['rawAttributes']);_0x517f17[_0x8752('0x32')]=_[_0x8752('0x47')](_0x555bd8[_0x8752('0x32')]);_0x517f17[_0x8752('0x33')]=_[_0x8752('0x34')](_0x517f17[_0x8752('0x31')],_0x517f17['query']);_0x399f94[_0x8752('0x35')]=_['intersection'](_0x517f17[_0x8752('0x31')],qs['fields'](_0x555bd8[_0x8752('0x32')][_0x8752('0x48')]));_0x399f94[_0x8752('0x35')]=_0x399f94[_0x8752('0x35')]['length']?_0x399f94[_0x8752('0x35')]:_0x517f17[_0x8752('0x31')];if(_0x555bd8[_0x8752('0x32')][_0x8752('0x49')]){_0x399f94[_0x8752('0x43')]=[{'all':!![]}];}_0x399f94=_['merge']({},_0x399f94,_0x555bd8[_0x8752('0x41')]);return db[_0x8752('0x2c')][_0x8752('0x4a')](_0x399f94)[_0x8752('0x24')](handleEntityNotFound(_0x529b0a,null))[_0x8752('0x24')](respondWithResult(_0x529b0a,null))['catch'](handleError(_0x529b0a,null));};exports['create']=function(_0x4908c1,_0x5634da){return db[_0x8752('0x2c')][_0x8752('0x4b')](_0x4908c1['body'],{})[_0x8752('0x24')](respondWithResult(_0x5634da,0xc9))[_0x8752('0x45')](handleError(_0x5634da,null));};exports[_0x8752('0x23')]=function(_0x4531a1,_0x2108c4){if(_0x4531a1['body']['id']){delete _0x4531a1[_0x8752('0x4c')]['id'];}return db[_0x8752('0x2c')][_0x8752('0x4a')]({'where':{'id':_0x4531a1['params']['id']}})[_0x8752('0x24')](handleEntityNotFound(_0x2108c4,null))[_0x8752('0x24')](saveUpdates(_0x4531a1[_0x8752('0x4c')],null))['then'](respondWithResult(_0x2108c4,null))[_0x8752('0x45')](handleError(_0x2108c4,null));};exports[_0x8752('0x25')]=function(_0x3a73ef,_0xc562a3){return db[_0x8752('0x2c')][_0x8752('0x4a')]({'where':{'id':_0x3a73ef['params']['id']}})[_0x8752('0x24')](handleEntityNotFound(_0xc562a3,null))[_0x8752('0x24')](removeEntity(_0xc562a3,null))['catch'](handleError(_0xc562a3,null));};exports[_0x8752('0x4d')]=function(_0x5215f5,_0x9b34ef){return db['ChatOfflineMessage'][_0x8752('0x4d')]()[_0x8752('0x24')](respondWithResult(_0x9b34ef,null))[_0x8752('0x45')](handleError(_0x9b34ef,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index c830ef7..ab1840a 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 _0x50a6=['util','moment','request-promise','path','rimraf','./chatOfflineMessage.attributes','define','ChatOfflineMessage','chat_offline_messages','utf8mb4_unicode_ci','lodash'];(function(_0x557ba5,_0x55735b){var _0x4c7d96=function(_0x4ed4d8){while(--_0x4ed4d8){_0x557ba5['push'](_0x557ba5['shift']());}};_0x4c7d96(++_0x55735b);}(_0x50a6,0xa4));var _0x650a=function(_0x2c5255,_0x4340c3){_0x2c5255=_0x2c5255-0x0;var _0x30d0ea=_0x50a6[_0x2c5255];return _0x30d0ea;};'use strict';var _=require(_0x650a('0x0'));var util=require(_0x650a('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x650a('0x2'));var BPromise=require('bluebird');var rp=require(_0x650a('0x3'));var fs=require('fs');var path=require(_0x650a('0x4'));var rimraf=require(_0x650a('0x5'));var config=require('../../config/environment');var attributes=require(_0x650a('0x6'));module['exports']=function(_0x4eabde,_0x2d486d){return _0x4eabde[_0x650a('0x7')](_0x650a('0x8'),attributes,{'tableName':_0x650a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x650a('0xa')});}; \ No newline at end of file +var _0xa8a8=['bluebird','request-promise','path','rimraf','../../config/environment','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x5eca47,_0x59df4a){var _0x3776c2=function(_0x5b957d){while(--_0x5b957d){_0x5eca47['push'](_0x5eca47['shift']());}};_0x3776c2(++_0x59df4a);}(_0xa8a8,0xec));var _0x8a8a=function(_0x2bac71,_0x1a46c3){_0x2bac71=_0x2bac71-0x0;var _0x154465=_0xa8a8[_0x2bac71];return _0x154465;};'use strict';var _=require(_0x8a8a('0x0'));var util=require(_0x8a8a('0x1'));var logger=require(_0x8a8a('0x2'))(_0x8a8a('0x3'));var moment=require('moment');var BPromise=require(_0x8a8a('0x4'));var rp=require(_0x8a8a('0x5'));var fs=require('fs');var path=require(_0x8a8a('0x6'));var rimraf=require(_0x8a8a('0x7'));var config=require(_0x8a8a('0x8'));var attributes=require(_0x8a8a('0x9'));module[_0x8a8a('0xa')]=function(_0x12db82,_0x2e8193){return _0x12db82[_0x8a8a('0xb')](_0x8a8a('0xc'),attributes,{'tableName':_0x8a8a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8a8a('0xe'),'collate':_0x8a8a('0xf')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index f351ba3..f539c4c 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 _0x137a=['request','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x5c2dd5,_0x5e339f){var _0x98129b=function(_0x5a7b2f){while(--_0x5a7b2f){_0x5c2dd5['push'](_0x5c2dd5['shift']());}};_0x98129b(++_0x5e339f);}(_0x137a,0x8f));var _0xa137=function(_0x33ce84,_0x25b01a){_0x33ce84=_0x33ce84-0x0;var _0x4dfa04=_0x137a[_0x33ce84];return _0x4dfa04;};'use strict';var _=require('lodash');var util=require(_0xa137('0x0'));var moment=require(_0xa137('0x1'));var BPromise=require(_0xa137('0x2'));var rs=require(_0xa137('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa137('0x4'));var logger=require(_0xa137('0x5'))(_0xa137('0x6'));var config=require(_0xa137('0x7'));var jayson=require(_0xa137('0x8'));var client=jayson[_0xa137('0x9')][_0xa137('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4af803,_0x17d4f5,_0x2f142b){return new BPromise(function(_0x2e2bce,_0x28abfd){return client[_0xa137('0xb')](_0x4af803,_0x2f142b)['then'](function(_0x1c35d4){logger[_0xa137('0xc')](_0xa137('0xd'),_0x17d4f5,_0xa137('0xe'));logger[_0xa137('0xf')](_0xa137('0x10'),_0x17d4f5,'request\x20sent',JSON[_0xa137('0x11')](_0x1c35d4));if(_0x1c35d4[_0xa137('0x12')]){if(_0x1c35d4['error'][_0xa137('0x13')]===0x1f4){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x17d4f5,_0x1c35d4[_0xa137('0x12')][_0xa137('0x14')]);return _0x28abfd(_0x1c35d4[_0xa137('0x12')][_0xa137('0x14')]);}logger[_0xa137('0x12')](_0xa137('0xd'),_0x17d4f5,_0x1c35d4[_0xa137('0x12')][_0xa137('0x14')]);return _0x2e2bce(_0x1c35d4[_0xa137('0x12')]['message']);}else{logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x17d4f5,_0xa137('0xe'));_0x2e2bce(_0x1c35d4['result'][_0xa137('0x14')]);}})[_0xa137('0x15')](function(_0x3f5e7e){logger[_0xa137('0x12')]('ChatOfflineMessage,\x20%s,\x20%s',_0x17d4f5,_0x3f5e7e);_0x28abfd(_0x3f5e7e);});});} \ No newline at end of file +var _0x0674=['ChatOfflineMessage,\x20%s,\x20%s','message','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','info','request\x20sent','stringify','error','code'];(function(_0xf0e90f,_0x34c54e){var _0x3cbd07=function(_0x23a2a7){while(--_0x23a2a7){_0xf0e90f['push'](_0xf0e90f['shift']());}};_0x3cbd07(++_0x34c54e);}(_0x0674,0x145));var _0x4067=function(_0x5f29b3,_0x4f007c){_0x5f29b3=_0x5f29b3-0x0;var _0x36ec6a=_0x0674[_0x5f29b3];return _0x36ec6a;};'use strict';var _=require(_0x4067('0x0'));var util=require(_0x4067('0x1'));var moment=require(_0x4067('0x2'));var BPromise=require(_0x4067('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4067('0x4'));var db=require(_0x4067('0x5'))['db'];var utils=require(_0x4067('0x6'));var logger=require(_0x4067('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4067('0x8')][_0x4067('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x326b9a,_0x27a1ee,_0x3a9e6d){return new BPromise(function(_0x1c408a,_0x17012a){return client[_0x4067('0xa')](_0x326b9a,_0x3a9e6d)[_0x4067('0xb')](function(_0xb68663){logger[_0x4067('0xc')]('ChatOfflineMessage,\x20%s,\x20%s',_0x27a1ee,'request\x20sent');logger['debug']('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x27a1ee,_0x4067('0xd'),JSON[_0x4067('0xe')](_0xb68663));if(_0xb68663[_0x4067('0xf')]){if(_0xb68663[_0x4067('0xf')][_0x4067('0x10')]===0x1f4){logger[_0x4067('0xf')](_0x4067('0x11'),_0x27a1ee,_0xb68663[_0x4067('0xf')][_0x4067('0x12')]);return _0x17012a(_0xb68663[_0x4067('0xf')][_0x4067('0x12')]);}logger[_0x4067('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0x27a1ee,_0xb68663[_0x4067('0xf')][_0x4067('0x12')]);return _0x1c408a(_0xb68663[_0x4067('0xf')]['message']);}else{logger['info'](_0x4067('0x11'),_0x27a1ee,'request\x20sent');_0x1c408a(_0xb68663['result']['message']);}})['catch'](function(_0x57b379){logger[_0x4067('0xf')](_0x4067('0x11'),_0x27a1ee,_0x57b379);_0x17012a(_0x57b379);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index eabb735..8c45c7a 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 _0x62df=['Router','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','delete','destroy','multer','util','express'];(function(_0x559a80,_0x3d193d){var _0x42f555=function(_0x24e596){while(--_0x24e596){_0x559a80['push'](_0x559a80['shift']());}};_0x42f555(++_0x3d193d);}(_0x62df,0x82));var _0xf62d=function(_0x50dfb0,_0x4f2dbe){_0x50dfb0=_0x50dfb0-0x0;var _0x30a43f=_0x62df[_0x50dfb0];return _0x30a43f;};'use strict';var multer=require(_0xf62d('0x0'));var util=require(_0xf62d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf62d('0x2'));var router=express[_0xf62d('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xf62d('0x4'));var config=require(_0xf62d('0x5'));var controller=require(_0xf62d('0x6'));router[_0xf62d('0x7')]('/',auth[_0xf62d('0x8')](),controller[_0xf62d('0x9')]);router['get'](_0xf62d('0xa'),auth[_0xf62d('0x8')](),controller[_0xf62d('0xb')]);router[_0xf62d('0x7')](_0xf62d('0xc'),auth[_0xf62d('0x8')](),controller[_0xf62d('0xd')]);router['post']('/',auth[_0xf62d('0x8')](),controller[_0xf62d('0xe')]);router[_0xf62d('0xf')](_0xf62d('0xc'),auth[_0xf62d('0x8')](),controller[_0xf62d('0x10')]);router[_0xf62d('0x11')](_0xf62d('0xc'),auth[_0xf62d('0x8')](),controller[_0xf62d('0x12')]);module['exports']=router; \ No newline at end of file +var _0x0195=['update','/:id','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','post','put'];(function(_0x40502f,_0x5aff42){var _0x12a5b9=function(_0x35dbd3){while(--_0x35dbd3){_0x40502f['push'](_0x40502f['shift']());}};_0x12a5b9(++_0x5aff42);}(_0x0195,0xb7));var _0x5019=function(_0x49c9b2,_0x4b0a0b){_0x49c9b2=_0x49c9b2-0x0;var _0x163e08=_0x0195[_0x49c9b2];return _0x163e08;};'use strict';var multer=require(_0x5019('0x0'));var util=require(_0x5019('0x1'));var path=require(_0x5019('0x2'));var timeout=require('connect-timeout');var express=require(_0x5019('0x3'));var router=express[_0x5019('0x4')]();var auth=require(_0x5019('0x5'));var interaction=require(_0x5019('0x6'));var config=require(_0x5019('0x7'));var controller=require('./chatOfflineMessage.controller');router[_0x5019('0x8')]('/',auth[_0x5019('0x9')](),controller[_0x5019('0xa')]);router['get'](_0x5019('0xb'),auth[_0x5019('0x9')](),controller[_0x5019('0xc')]);router[_0x5019('0x8')]('/:id',auth[_0x5019('0x9')](),controller['show']);router[_0x5019('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5019('0xe')]('/:id',auth[_0x5019('0x9')](),controller[_0x5019('0xf')]);router['delete'](_0x5019('0x10'),auth['isAuthenticated'](),controller[_0x5019('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index c0d097a..cc460e2 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 _0xf60a=['ENUM','mouseOver','timeout','STRING','INTEGER','sequelize','exports'];(function(_0x50e7b6,_0x101b29){var _0x25346b=function(_0x380e58){while(--_0x380e58){_0x50e7b6['push'](_0x50e7b6['shift']());}};_0x25346b(++_0x101b29);}(_0xf60a,0xc9));var _0xaf60=function(_0x1ea01b,_0x15a0e9){_0x1ea01b=_0x1ea01b-0x0;var _0x5b97fa=_0xf60a[_0x1ea01b];return _0x5b97fa;};'use strict';var Sequelize=require(_0xaf60('0x0'));module[_0xaf60('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xaf60('0x2')](_0xaf60('0x3'),_0xaf60('0x4')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0xaf60('0x5')]},'timeout':{'type':Sequelize[_0xaf60('0x6')]}}; \ No newline at end of file +var _0xb8e6=['sequelize','exports','STRING','mouseOver','INTEGER'];(function(_0x14a862,_0x2b559d){var _0x245eb5=function(_0x6e014c){while(--_0x6e014c){_0x14a862['push'](_0x14a862['shift']());}};_0x245eb5(++_0x2b559d);}(_0xb8e6,0x87));var _0x6b8e=function(_0x39c6bb,_0x3168e4){_0x39c6bb=_0x39c6bb-0x0;var _0x9cc25f=_0xb8e6[_0x39c6bb];return _0x9cc25f;};'use strict';var Sequelize=require(_0x6b8e('0x0'));module[_0x6b8e('0x1')]={'name':{'type':Sequelize[_0x6b8e('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x6b8e('0x3'),'timeout'),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x6b8e('0x2')]},'timeout':{'type':Sequelize[_0x6b8e('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index e9e3816..53c96e0 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 _0xcddd=['fields','attributes','length','includeAll','merge','options','find','catch','create','body','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','offset','limit','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','show','keys','ChatProactiveAction','query','model'];(function(_0x5dc88c,_0x5773cc){var _0x43648c=function(_0x30a50b){while(--_0x30a50b){_0x5dc88c['push'](_0x5dc88c['shift']());}};_0x43648c(++_0x5773cc);}(_0xcddd,0x1a1));var _0xdcdd=function(_0x4a314a,_0x8b5b01){_0x4a314a=_0x4a314a-0x0;var _0x3ff41d=_0xcddd[_0x4a314a];return _0x3ff41d;};'use strict';var pdf=require(_0xdcdd('0x0'));var emlformat=require(_0xdcdd('0x1'));var rimraf=require(_0xdcdd('0x2'));var zipdir=require(_0xdcdd('0x3'));var jsonpatch=require(_0xdcdd('0x4'));var rp=require(_0xdcdd('0x5'));var moment=require(_0xdcdd('0x6'));var BPromise=require(_0xdcdd('0x7'));var Mustache=require(_0xdcdd('0x8'));var util=require(_0xdcdd('0x9'));var path=require(_0xdcdd('0xa'));var sox=require(_0xdcdd('0xb'));var csv=require('to-csv');var ejs=require(_0xdcdd('0xc'));var fs=require('fs');var _=require(_0xdcdd('0xd'));var squel=require('squel');var crypto=require(_0xdcdd('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xdcdd('0xf'));var toCsv=require(_0xdcdd('0x10'));var querystring=require(_0xdcdd('0x11'));var Papa=require('papaparse');var Redis=require(_0xdcdd('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xdcdd('0x13'));var as=require(_0xdcdd('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdcdd('0x15'))(_0xdcdd('0x16'));var utils=require(_0xdcdd('0x17'));var config=require(_0xdcdd('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4e7859,_0x40a316){_0x40a316=_0x40a316||0xcc;return function(_0x11e0b4){if(_0x11e0b4){return _0x4e7859['sendStatus'](_0x40a316);}return _0x4e7859[_0xdcdd('0x19')](_0x40a316)[_0xdcdd('0x1a')]();};}function respondWithResult(_0x265837,_0x18ab60){_0x18ab60=_0x18ab60||0xc8;return function(_0x2cd434){if(_0x2cd434){return _0x265837['status'](_0x18ab60)[_0xdcdd('0x1b')](_0x2cd434);}};}function respondWithFilteredResult(_0xb27495,_0x5ea867){return function(_0x31ae41){if(_0x31ae41){var _0x2702b0=_0x31ae41['count'],_0x4d9a72=_0x5ea867[_0xdcdd('0x1c')],_0x534847=_0x5ea867[_0xdcdd('0x1c')]+_0x5ea867[_0xdcdd('0x1d')],_0x313273;if(_0x534847>=_0x2702b0){_0x534847=_0x2702b0;_0x313273=0xc8;}else{_0x313273=0xce;}_0xb27495[_0xdcdd('0x19')](_0x313273);return _0xb27495[_0xdcdd('0x1e')](_0xdcdd('0x1f'),_0x4d9a72+'-'+_0x534847+'/'+_0x2702b0)['json'](_0x31ae41);}return null;};}function patchUpdates(_0x3d4932){return function(_0x52c38b){try{jsonpatch[_0xdcdd('0x20')](_0x52c38b,_0x3d4932,!![]);}catch(_0x5f38c0){return BPromise['reject'](_0x5f38c0);}return _0x52c38b[_0xdcdd('0x21')]();};}function saveUpdates(_0xddaa45,_0x28a477){return function(_0xfadcc0){if(_0xfadcc0){return _0xfadcc0[_0xdcdd('0x22')](_0xddaa45)[_0xdcdd('0x23')](function(_0x13f1b1){return _0x13f1b1;});}return null;};}function removeEntity(_0x14e523,_0x18b78d){return function(_0x51ca55){if(_0x51ca55){return _0x51ca55[_0xdcdd('0x24')]()[_0xdcdd('0x23')](function(){_0x14e523[_0xdcdd('0x19')](0xcc)[_0xdcdd('0x1a')]();});}};}function handleEntityNotFound(_0x3e31ae,_0x26a365){return function(_0x5cf148){if(!_0x5cf148){_0x3e31ae[_0xdcdd('0x25')](0x194);}return _0x5cf148;};}function handleError(_0x11f567,_0x2a3e38){_0x2a3e38=_0x2a3e38||0x1f4;return function(_0x873850){logger[_0xdcdd('0x26')](_0x873850[_0xdcdd('0x27')]);if(_0x873850[_0xdcdd('0x28')]){delete _0x873850[_0xdcdd('0x28')];}_0x11f567[_0xdcdd('0x19')](_0x2a3e38)[_0xdcdd('0x29')](_0x873850);};}exports[_0xdcdd('0x2a')]=function(_0x34a6b0,_0x3b1b4a){var _0xe6b71={'raw':!![],'where':{'id':_0x34a6b0['params']['id']}},_0x49cb3e={};_0x49cb3e['model']=_[_0xdcdd('0x2b')](db[_0xdcdd('0x2c')]['rawAttributes']);_0x49cb3e[_0xdcdd('0x2d')]=_[_0xdcdd('0x2b')](_0x34a6b0['query']);_0x49cb3e['filters']=_['intersection'](_0x49cb3e[_0xdcdd('0x2e')],_0x49cb3e[_0xdcdd('0x2d')]);_0xe6b71['attributes']=_['intersection'](_0x49cb3e[_0xdcdd('0x2e')],qs[_0xdcdd('0x2f')](_0x34a6b0[_0xdcdd('0x2d')]['fields']));_0xe6b71[_0xdcdd('0x30')]=_0xe6b71[_0xdcdd('0x30')][_0xdcdd('0x31')]?_0xe6b71[_0xdcdd('0x30')]:_0x49cb3e['model'];if(_0x34a6b0[_0xdcdd('0x2d')][_0xdcdd('0x32')]){_0xe6b71['include']=[{'all':!![]}];}_0xe6b71=_[_0xdcdd('0x33')]({},_0xe6b71,_0x34a6b0[_0xdcdd('0x34')]);return db[_0xdcdd('0x2c')][_0xdcdd('0x35')](_0xe6b71)[_0xdcdd('0x23')](handleEntityNotFound(_0x3b1b4a,null))[_0xdcdd('0x23')](respondWithResult(_0x3b1b4a,null))[_0xdcdd('0x36')](handleError(_0x3b1b4a,null));};exports[_0xdcdd('0x37')]=function(_0x510755,_0x1035e4){return db[_0xdcdd('0x2c')][_0xdcdd('0x37')](_0x510755[_0xdcdd('0x38')],{})[_0xdcdd('0x23')](respondWithResult(_0x1035e4,0xc9))[_0xdcdd('0x36')](handleError(_0x1035e4,null));};exports[_0xdcdd('0x22')]=function(_0xaca658,_0x4c90d3){if(_0xaca658[_0xdcdd('0x38')]['id']){delete _0xaca658['body']['id'];}return db[_0xdcdd('0x2c')][_0xdcdd('0x35')]({'where':{'id':_0xaca658[_0xdcdd('0x39')]['id']}})['then'](handleEntityNotFound(_0x4c90d3,null))[_0xdcdd('0x23')](saveUpdates(_0xaca658[_0xdcdd('0x38')],null))[_0xdcdd('0x23')](respondWithResult(_0x4c90d3,null))[_0xdcdd('0x36')](handleError(_0x4c90d3,null));};exports[_0xdcdd('0x24')]=function(_0x4a946b,_0xcacc53){return db[_0xdcdd('0x2c')]['find']({'where':{'id':_0x4a946b[_0xdcdd('0x39')]['id']}})['then'](handleEntityNotFound(_0xcacc53,null))[_0xdcdd('0x23')](removeEntity(_0xcacc53,null))[_0xdcdd('0x36')](handleError(_0xcacc53,null));}; \ No newline at end of file +var _0x77f7=['merge','options','find','catch','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','set','apply','reject','save','update','destroy','then','error','stack','name','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','intersection','fields','attributes','length','includeAll','include'];(function(_0x2555d0,_0x4150a6){var _0x3bb486=function(_0x1eb89f){while(--_0x1eb89f){_0x2555d0['push'](_0x2555d0['shift']());}};_0x3bb486(++_0x4150a6);}(_0x77f7,0xbd));var _0x777f=function(_0x2701a1,_0x30bffc){_0x2701a1=_0x2701a1-0x0;var _0x1cb0d9=_0x77f7[_0x2701a1];return _0x1cb0d9;};'use strict';var pdf=require(_0x777f('0x0'));var emlformat=require(_0x777f('0x1'));var rimraf=require(_0x777f('0x2'));var zipdir=require(_0x777f('0x3'));var jsonpatch=require(_0x777f('0x4'));var rp=require(_0x777f('0x5'));var moment=require(_0x777f('0x6'));var BPromise=require(_0x777f('0x7'));var Mustache=require(_0x777f('0x8'));var util=require('util');var path=require('path');var sox=require(_0x777f('0x9'));var csv=require(_0x777f('0xa'));var ejs=require(_0x777f('0xb'));var fs=require('fs');var _=require(_0x777f('0xc'));var squel=require(_0x777f('0xd'));var crypto=require(_0x777f('0xe'));var jsforce=require(_0x777f('0xf'));var deskjs=require(_0x777f('0x10'));var toCsv=require(_0x777f('0xa'));var querystring=require(_0x777f('0x11'));var Papa=require('papaparse');var Redis=require(_0x777f('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x777f('0x13'));var as=require(_0x777f('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x777f('0x15'))(_0x777f('0x16'));var utils=require(_0x777f('0x17'));var config=require('../../config/environment');var db=require(_0x777f('0x18'))['db'];function respondWithStatusCode(_0xaa421a,_0x285bf7){_0x285bf7=_0x285bf7||0xcc;return function(_0x30f31b){if(_0x30f31b){return _0xaa421a[_0x777f('0x19')](_0x285bf7);}return _0xaa421a[_0x777f('0x1a')](_0x285bf7)['end']();};}function respondWithResult(_0x33c907,_0x2cef15){_0x2cef15=_0x2cef15||0xc8;return function(_0x5468c0){if(_0x5468c0){return _0x33c907[_0x777f('0x1a')](_0x2cef15)[_0x777f('0x1b')](_0x5468c0);}};}function respondWithFilteredResult(_0x198805,_0x43d45a){return function(_0xf4d60b){if(_0xf4d60b){var _0x217e98=_0xf4d60b[_0x777f('0x1c')],_0x41855a=_0x43d45a[_0x777f('0x1d')],_0x4cdaa9=_0x43d45a[_0x777f('0x1d')]+_0x43d45a[_0x777f('0x1e')],_0x856923;if(_0x4cdaa9>=_0x217e98){_0x4cdaa9=_0x217e98;_0x856923=0xc8;}else{_0x856923=0xce;}_0x198805[_0x777f('0x1a')](_0x856923);return _0x198805[_0x777f('0x1f')]('Content-Range',_0x41855a+'-'+_0x4cdaa9+'/'+_0x217e98)['json'](_0xf4d60b);}return null;};}function patchUpdates(_0x40c91e){return function(_0x270a5b){try{jsonpatch[_0x777f('0x20')](_0x270a5b,_0x40c91e,!![]);}catch(_0x58aae1){return BPromise[_0x777f('0x21')](_0x58aae1);}return _0x270a5b[_0x777f('0x22')]();};}function saveUpdates(_0x1897f0,_0x143f3d){return function(_0x5d31f1){if(_0x5d31f1){return _0x5d31f1[_0x777f('0x23')](_0x1897f0)['then'](function(_0x28407f){return _0x28407f;});}return null;};}function removeEntity(_0x4d1278,_0x1cc281){return function(_0x38e32f){if(_0x38e32f){return _0x38e32f[_0x777f('0x24')]()[_0x777f('0x25')](function(){_0x4d1278[_0x777f('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x780490,_0x17f1ed){return function(_0x5089ba){if(!_0x5089ba){_0x780490[_0x777f('0x19')](0x194);}return _0x5089ba;};}function handleError(_0x52d4fc,_0x39a714){_0x39a714=_0x39a714||0x1f4;return function(_0x4385d9){logger[_0x777f('0x26')](_0x4385d9[_0x777f('0x27')]);if(_0x4385d9[_0x777f('0x28')]){delete _0x4385d9[_0x777f('0x28')];}_0x52d4fc[_0x777f('0x1a')](_0x39a714)[_0x777f('0x29')](_0x4385d9);};}exports[_0x777f('0x2a')]=function(_0x4dd10d,_0x5b865c){var _0x16ca18={'raw':!![],'where':{'id':_0x4dd10d[_0x777f('0x2b')]['id']}},_0x37655d={};_0x37655d[_0x777f('0x2c')]=_[_0x777f('0x2d')](db[_0x777f('0x2e')][_0x777f('0x2f')]);_0x37655d['query']=_[_0x777f('0x2d')](_0x4dd10d[_0x777f('0x30')]);_0x37655d['filters']=_[_0x777f('0x31')](_0x37655d[_0x777f('0x2c')],_0x37655d['query']);_0x16ca18['attributes']=_[_0x777f('0x31')](_0x37655d[_0x777f('0x2c')],qs[_0x777f('0x32')](_0x4dd10d[_0x777f('0x30')][_0x777f('0x32')]));_0x16ca18[_0x777f('0x33')]=_0x16ca18[_0x777f('0x33')][_0x777f('0x34')]?_0x16ca18[_0x777f('0x33')]:_0x37655d[_0x777f('0x2c')];if(_0x4dd10d['query'][_0x777f('0x35')]){_0x16ca18[_0x777f('0x36')]=[{'all':!![]}];}_0x16ca18=_[_0x777f('0x37')]({},_0x16ca18,_0x4dd10d[_0x777f('0x38')]);return db[_0x777f('0x2e')][_0x777f('0x39')](_0x16ca18)['then'](handleEntityNotFound(_0x5b865c,null))[_0x777f('0x25')](respondWithResult(_0x5b865c,null))[_0x777f('0x3a')](handleError(_0x5b865c,null));};exports['create']=function(_0x259983,_0x4e3d35){return db['ChatProactiveAction'][_0x777f('0x3b')](_0x259983[_0x777f('0x3c')],{})[_0x777f('0x25')](respondWithResult(_0x4e3d35,0xc9))[_0x777f('0x3a')](handleError(_0x4e3d35,null));};exports[_0x777f('0x23')]=function(_0x28b9fb,_0x3049c1){if(_0x28b9fb[_0x777f('0x3c')]['id']){delete _0x28b9fb['body']['id'];}return db['ChatProactiveAction'][_0x777f('0x39')]({'where':{'id':_0x28b9fb[_0x777f('0x2b')]['id']}})[_0x777f('0x25')](handleEntityNotFound(_0x3049c1,null))[_0x777f('0x25')](saveUpdates(_0x28b9fb[_0x777f('0x3c')],null))[_0x777f('0x25')](respondWithResult(_0x3049c1,null))[_0x777f('0x3a')](handleError(_0x3049c1,null));};exports[_0x777f('0x24')]=function(_0x5f33e6,_0x22e6f3){return db[_0x777f('0x2e')][_0x777f('0x39')]({'where':{'id':_0x5f33e6[_0x777f('0x2b')]['id']}})[_0x777f('0x25')](handleEntityNotFound(_0x22e6f3,null))[_0x777f('0x25')](removeEntity(_0x22e6f3,null))[_0x777f('0x3a')](handleError(_0x22e6f3,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index d5ea73e..c13ce11 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 _0x8811=['lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions'];(function(_0x4c3797,_0x450618){var _0x10c2ac=function(_0x2981c5){while(--_0x2981c5){_0x4c3797['push'](_0x4c3797['shift']());}};_0x10c2ac(++_0x450618);}(_0x8811,0x152));var _0x1881=function(_0x3179c3,_0x5a3ee3){_0x3179c3=_0x3179c3-0x0;var _0xfde233=_0x8811[_0x3179c3];return _0xfde233;};'use strict';var _=require(_0x1881('0x0'));var util=require(_0x1881('0x1'));var logger=require('../../config/logger')(_0x1881('0x2'));var moment=require(_0x1881('0x3'));var BPromise=require(_0x1881('0x4'));var rp=require(_0x1881('0x5'));var fs=require('fs');var path=require(_0x1881('0x6'));var rimraf=require('rimraf');var config=require(_0x1881('0x7'));var attributes=require(_0x1881('0x8'));module[_0x1881('0x9')]=function(_0x5b02a1,_0x2d56d9){return _0x5b02a1[_0x1881('0xa')](_0x1881('0xb'),attributes,{'tableName':_0x1881('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfdbd=['api','moment','bluebird','request-promise','path','rimraf','./chatProactiveAction.attributes','exports','define','chat_proactive_actions','lodash'];(function(_0x198366,_0x54eaf1){var _0x34c5c0=function(_0x36ca9f){while(--_0x36ca9f){_0x198366['push'](_0x198366['shift']());}};_0x34c5c0(++_0x54eaf1);}(_0xfdbd,0x15f));var _0xdfdb=function(_0x19ac6e,_0x435862){_0x19ac6e=_0x19ac6e-0x0;var _0x1cdcf3=_0xfdbd[_0x19ac6e];return _0x1cdcf3;};'use strict';var _=require(_0xdfdb('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xdfdb('0x1'));var moment=require(_0xdfdb('0x2'));var BPromise=require(_0xdfdb('0x3'));var rp=require(_0xdfdb('0x4'));var fs=require('fs');var path=require(_0xdfdb('0x5'));var rimraf=require(_0xdfdb('0x6'));var config=require('../../config/environment');var attributes=require(_0xdfdb('0x7'));module[_0xdfdb('0x8')]=function(_0x4a8aac,_0x4552f8){return _0x4a8aac[_0xdfdb('0x9')]('ChatProactiveAction',attributes,{'tableName':_0xdfdb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js index c1f2713..cb9a67e 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 _0xa6a2=['jayson/promise','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x109371,_0x441c8e){var _0x4fd858=function(_0x13504f){while(--_0x13504f){_0x109371['push'](_0x109371['shift']());}};_0x4fd858(++_0x441c8e);}(_0xa6a2,0x1be));var _0x2a6a=function(_0x3d210f,_0x5a877b){_0x3d210f=_0x3d210f-0x0;var _0x4e9048=_0xa6a2[_0x3d210f];return _0x4e9048;};'use strict';var _=require(_0x2a6a('0x0'));var util=require(_0x2a6a('0x1'));var moment=require(_0x2a6a('0x2'));var BPromise=require(_0x2a6a('0x3'));var rs=require(_0x2a6a('0x4'));var fs=require('fs');var Redis=require(_0x2a6a('0x5'));var db=require(_0x2a6a('0x6'))['db'];var utils=require(_0x2a6a('0x7'));var logger=require(_0x2a6a('0x8'))(_0x2a6a('0x9'));var config=require('../../config/environment');var jayson=require(_0x2a6a('0xa'));var client=jayson['client'][_0x2a6a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x19e664,_0x3be2bc,_0x44ea00){return new BPromise(function(_0xc7c737,_0x1caec4){return client[_0x2a6a('0xc')](_0x19e664,_0x44ea00)[_0x2a6a('0xd')](function(_0x262136){logger[_0x2a6a('0xe')](_0x2a6a('0xf'),_0x3be2bc,_0x2a6a('0x10'));logger['debug'](_0x2a6a('0x11'),_0x3be2bc,_0x2a6a('0x10'),JSON[_0x2a6a('0x12')](_0x262136));if(_0x262136['error']){if(_0x262136[_0x2a6a('0x13')][_0x2a6a('0x14')]===0x1f4){logger[_0x2a6a('0x13')](_0x2a6a('0xf'),_0x3be2bc,_0x262136[_0x2a6a('0x13')][_0x2a6a('0x15')]);return _0x1caec4(_0x262136[_0x2a6a('0x13')]['message']);}logger[_0x2a6a('0x13')](_0x2a6a('0xf'),_0x3be2bc,_0x262136[_0x2a6a('0x13')][_0x2a6a('0x15')]);return _0xc7c737(_0x262136[_0x2a6a('0x13')]['message']);}else{logger[_0x2a6a('0xe')](_0x2a6a('0xf'),_0x3be2bc,'request\x20sent');_0xc7c737(_0x262136[_0x2a6a('0x16')][_0x2a6a('0x15')]);}})[_0x2a6a('0x17')](function(_0x2928c5){logger[_0x2a6a('0x13')](_0x2a6a('0xf'),_0x3be2bc,_0x2928c5);_0x1caec4(_0x2928c5);});});} \ No newline at end of file +var _0x6ab0=['info','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatProactiveAction,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then'];(function(_0x984b93,_0x26ee75){var _0x396307=function(_0x585ec6){while(--_0x585ec6){_0x984b93['push'](_0x984b93['shift']());}};_0x396307(++_0x26ee75);}(_0x6ab0,0x13e));var _0x06ab=function(_0x32035d,_0x54482d){_0x32035d=_0x32035d-0x0;var _0xcda2ca=_0x6ab0[_0x32035d];return _0xcda2ca;};'use strict';var _=require(_0x06ab('0x0'));var util=require(_0x06ab('0x1'));var moment=require('moment');var BPromise=require(_0x06ab('0x2'));var rs=require(_0x06ab('0x3'));var fs=require('fs');var Redis=require(_0x06ab('0x4'));var db=require(_0x06ab('0x5'))['db'];var utils=require(_0x06ab('0x6'));var logger=require('../../config/logger')(_0x06ab('0x7'));var config=require(_0x06ab('0x8'));var jayson=require(_0x06ab('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xc58765,_0x5b6576,_0x2ff068){return new BPromise(function(_0x41817f,_0x726eb6){return client[_0x06ab('0xa')](_0xc58765,_0x2ff068)[_0x06ab('0xb')](function(_0x41563b){logger[_0x06ab('0xc')]('ChatProactiveAction,\x20%s,\x20%s',_0x5b6576,_0x06ab('0xd'));logger[_0x06ab('0xe')](_0x06ab('0xf'),_0x5b6576,'request\x20sent',JSON[_0x06ab('0x10')](_0x41563b));if(_0x41563b[_0x06ab('0x11')]){if(_0x41563b[_0x06ab('0x11')][_0x06ab('0x12')]===0x1f4){logger[_0x06ab('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x5b6576,_0x41563b[_0x06ab('0x11')][_0x06ab('0x13')]);return _0x726eb6(_0x41563b['error'][_0x06ab('0x13')]);}logger[_0x06ab('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x5b6576,_0x41563b[_0x06ab('0x11')][_0x06ab('0x13')]);return _0x41817f(_0x41563b[_0x06ab('0x11')]['message']);}else{logger[_0x06ab('0xc')](_0x06ab('0x14'),_0x5b6576,_0x06ab('0xd'));_0x41817f(_0x41563b['result'][_0x06ab('0x13')]);}})[_0x06ab('0x15')](function(_0x3b67ed){logger['error'](_0x06ab('0x14'),_0x5b6576,_0x3b67ed);_0x726eb6(_0x3b67ed);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 6954b15..c880b28 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 _0xa6a4=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','put','update','destroy','exports','multer'];(function(_0x140cd1,_0x1193d6){var _0x1e2546=function(_0x4c81bb){while(--_0x4c81bb){_0x140cd1['push'](_0x140cd1['shift']());}};_0x1e2546(++_0x1193d6);}(_0xa6a4,0xe9));var _0x4a6a=function(_0xcbe2e9,_0x1960f9){_0xcbe2e9=_0xcbe2e9-0x0;var _0x27ca1b=_0xa6a4[_0xcbe2e9];return _0x27ca1b;};'use strict';var multer=require(_0x4a6a('0x0'));var util=require(_0x4a6a('0x1'));var path=require(_0x4a6a('0x2'));var timeout=require(_0x4a6a('0x3'));var express=require(_0x4a6a('0x4'));var router=express[_0x4a6a('0x5')]();var auth=require(_0x4a6a('0x6'));var interaction=require(_0x4a6a('0x7'));var config=require('../../config/environment');var controller=require(_0x4a6a('0x8'));router[_0x4a6a('0x9')](_0x4a6a('0xa'),auth[_0x4a6a('0xb')](),controller[_0x4a6a('0xc')]);router[_0x4a6a('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4a6a('0xe')]('/:id',auth[_0x4a6a('0xb')](),controller[_0x4a6a('0xf')]);router['delete'](_0x4a6a('0xa'),auth[_0x4a6a('0xb')](),controller[_0x4a6a('0x10')]);module[_0x4a6a('0x11')]=router; \ No newline at end of file +var _0x1b99=['show','post','delete','multer','util','path','express','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated'];(function(_0x167117,_0x2dee70){var _0x387b70=function(_0x58f7e0){while(--_0x58f7e0){_0x167117['push'](_0x167117['shift']());}};_0x387b70(++_0x2dee70);}(_0x1b99,0x17c));var _0x91b9=function(_0x1b7368,_0x3286ed){_0x1b7368=_0x1b7368-0x0;var _0x25d54c=_0x1b99[_0x1b7368];return _0x25d54c;};'use strict';var multer=require(_0x91b9('0x0'));var util=require(_0x91b9('0x1'));var path=require(_0x91b9('0x2'));var timeout=require('connect-timeout');var express=require(_0x91b9('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x91b9('0x4'));var config=require(_0x91b9('0x5'));var controller=require(_0x91b9('0x6'));router[_0x91b9('0x7')](_0x91b9('0x8'),auth[_0x91b9('0x9')](),controller[_0x91b9('0xa')]);router[_0x91b9('0xb')]('/',auth[_0x91b9('0x9')](),controller['create']);router['put'](_0x91b9('0x8'),auth[_0x91b9('0x9')](),controller['update']);router[_0x91b9('0xc')](_0x91b9('0x8'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 10e195b..8d0cc9d 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 _0x6e24=['sequelize','exports','STRING','INTEGER','ENUM','rrmemory','roundrobin'];(function(_0x18a984,_0x227db9){var _0xc483df=function(_0x566290){while(--_0x566290){_0x18a984['push'](_0x18a984['shift']());}};_0xc483df(++_0x227db9);}(_0x6e24,0x188));var _0x46e2=function(_0x4fe4fc,_0x4a14a7){_0x4fe4fc=_0x4fe4fc-0x0;var _0x251df2=_0x6e24[_0x4fe4fc];return _0x251df2;};'use strict';var Sequelize=require(_0x46e2('0x0'));module[_0x46e2('0x1')]={'name':{'type':Sequelize[_0x46e2('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x46e2('0x2')]},'timeout':{'type':Sequelize[_0x46e2('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x46e2('0x4')](_0x46e2('0x5'),'beepall',_0x46e2('0x6'))}}; \ No newline at end of file +var _0xf7ef=['roundrobin','sequelize','exports','STRING','name','ENUM','beepall'];(function(_0x282292,_0x3c434f){var _0x299155=function(_0x54c3ec){while(--_0x54c3ec){_0x282292['push'](_0x282292['shift']());}};_0x299155(++_0x3c434f);}(_0xf7ef,0x94));var _0xff7e=function(_0x579652,_0x17a7ad){_0x579652=_0x579652-0x0;var _0x4bbc48=_0xf7ef[_0x579652];return _0x4bbc48;};'use strict';var Sequelize=require(_0xff7e('0x0'));module[_0xff7e('0x1')]={'name':{'type':Sequelize[_0xff7e('0x2')],'unique':_0xff7e('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xff7e('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xff7e('0x4')]('rrmemory',_0xff7e('0x5'),_0xff7e('0x6'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 96d271d..d989689 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 _0x9195=['union','compact','value','isEmpty','forEach','userChatQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','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','../../mysqldb','redis','defaults','localhost','./chatQueue.socket','register','jayson/promise','client','http','test','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','status','count','offset','limit','set','Content-Range','json','apply','save','update','get','ChatQueues','UserProfileResource','destroy','end','stack','name','index','map','ChatQueue','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','find','create','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','getMembers','findOne','ChatQueueId','User','UserId','agent','chatPause','updatedAt','createdAt','SIP','getTeams','addTeams','ids','Team','online','interface','flatMap','Agents','sequelize','transaction','UserChatQueue','findOrCreate','emit','userChatQueue:save','removeTeams','field','tq.TeamId','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all'];(function(_0x570e1a,_0x5796cc){var _0x5e7998=function(_0x21b98f){while(--_0x21b98f){_0x570e1a['push'](_0x570e1a['shift']());}};_0x5e7998(++_0x5796cc);}(_0x9195,0x1da));var _0x5919=function(_0x5a45f5,_0x5746bf){_0x5a45f5=_0x5a45f5-0x0;var _0x202b18=_0x9195[_0x5a45f5];return _0x202b18;};'use strict';var pdf=require(_0x5919('0x0'));var emlformat=require(_0x5919('0x1'));var rimraf=require(_0x5919('0x2'));var zipdir=require(_0x5919('0x3'));var jsonpatch=require(_0x5919('0x4'));var rp=require(_0x5919('0x5'));var moment=require('moment');var BPromise=require(_0x5919('0x6'));var Mustache=require(_0x5919('0x7'));var util=require('util');var path=require('path');var sox=require(_0x5919('0x8'));var csv=require(_0x5919('0x9'));var ejs=require(_0x5919('0xa'));var fs=require('fs');var _=require(_0x5919('0xb'));var squel=require(_0x5919('0xc'));var crypto=require(_0x5919('0xd'));var jsforce=require(_0x5919('0xe'));var deskjs=require(_0x5919('0xf'));var toCsv=require(_0x5919('0x9'));var querystring=require(_0x5919('0x10'));var Papa=require(_0x5919('0x11'));var Redis=require(_0x5919('0x12'));var authService=require(_0x5919('0x13'));var qs=require(_0x5919('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5919('0x15'));var logger=require(_0x5919('0x16'))('api');var utils=require(_0x5919('0x17'));var config=require('../../config/environment');var db=require(_0x5919('0x18'))['db'];config[_0x5919('0x19')]=_[_0x5919('0x1a')](config[_0x5919('0x19')],{'host':_0x5919('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5919('0x19')]));require(_0x5919('0x1c'))[_0x5919('0x1d')](socket);var jayson=require(_0x5919('0x1e'));var client=jayson[_0x5919('0x1f')][_0x5919('0x20')]({'port':0x232a});function checkPasswordPattern(_0x5492e2,_0x17eb57,_0x274b80){if(_0x274b80){var _0x4a02aa=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4a02aa[_0x5919('0x21')](_0x17eb57)){return _0x5492e2;}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 _0x5492e2;}}function respondWithRpcPromise(_0x1b22ac,_0x2ed84f,_0xad4b1d,_0x226640){return new BPromise(function(_0xc3d591,_0x2c1b0c){var _0xe51c32=_0x226640||client;return _0xe51c32[_0x5919('0x22')](_0x1b22ac,_0xad4b1d)[_0x5919('0x23')](function(_0x45bd4e){logger[_0x5919('0x24')](_0x5919('0x25'),_0x2ed84f,_0x5919('0x26'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x2ed84f,_0x5919('0x26'),JSON[_0x5919('0x27')](_0x45bd4e));if(_0x45bd4e[_0x5919('0x28')]){if(_0x45bd4e[_0x5919('0x28')]['code']===0x1f4){logger[_0x5919('0x28')](_0x5919('0x25'),_0x2ed84f,_0x45bd4e['error']['message']);return _0x2c1b0c(_0x45bd4e[_0x5919('0x28')][_0x5919('0x29')]);}logger[_0x5919('0x28')](_0x5919('0x25'),_0x2ed84f,_0x45bd4e[_0x5919('0x28')]['message']);return _0xc3d591(_0x45bd4e[_0x5919('0x28')]['message']);}else{logger[_0x5919('0x24')]('ChatQueue,\x20%s,\x20%s',_0x2ed84f,_0x5919('0x26'));_0xc3d591(_0x45bd4e[_0x5919('0x2a')][_0x5919('0x29')]);}})[_0x5919('0x2b')](function(_0x3ac2e2){logger[_0x5919('0x28')]('ChatQueue,\x20%s,\x20%s',_0x2ed84f,_0x3ac2e2);_0x2c1b0c(_0x3ac2e2);});});}function respondWithStatusCode(_0x2615ff,_0x3a51a4){_0x3a51a4=_0x3a51a4||0xcc;return function(_0x19d8e4){if(_0x19d8e4){return _0x2615ff[_0x5919('0x2c')](_0x3a51a4);}return _0x2615ff['status'](_0x3a51a4)['end']();};}function respondWithResult(_0x3b63dc,_0x317e1c){_0x317e1c=_0x317e1c||0xc8;return function(_0x1a509f){if(_0x1a509f){return _0x3b63dc[_0x5919('0x2d')](_0x317e1c)['json'](_0x1a509f);}};}function respondWithFilteredResult(_0x7d3144,_0x4495db){return function(_0x507017){if(_0x507017){var _0x1f5931=_0x507017[_0x5919('0x2e')],_0x25cf0b=_0x4495db[_0x5919('0x2f')],_0x5ed9b6=_0x4495db['offset']+_0x4495db[_0x5919('0x30')],_0x2ed7bd;if(_0x5ed9b6>=_0x1f5931){_0x5ed9b6=_0x1f5931;_0x2ed7bd=0xc8;}else{_0x2ed7bd=0xce;}_0x7d3144['status'](_0x2ed7bd);return _0x7d3144[_0x5919('0x31')](_0x5919('0x32'),_0x25cf0b+'-'+_0x5ed9b6+'/'+_0x1f5931)[_0x5919('0x33')](_0x507017);}return null;};}function patchUpdates(_0x3dc14f){return function(_0x3ca05e){try{jsonpatch[_0x5919('0x34')](_0x3ca05e,_0x3dc14f,!![]);}catch(_0x40c84e){return BPromise['reject'](_0x40c84e);}return _0x3ca05e[_0x5919('0x35')]();};}function saveUpdates(_0x48ab4d,_0x37c00b){return function(_0x176422){if(_0x176422){return _0x176422[_0x5919('0x36')](_0x48ab4d)['then'](function(_0x2e07f3){return _0x2e07f3;});}return null;};}function removeEntity(_0x310ba8,_0x353124){return function(_0x35f159){if(_0x35f159){return _0x35f159['destroy']()[_0x5919('0x23')](function(){var _0x1ee3c6=_0x35f159[_0x5919('0x37')]({'plain':!![]});var _0xa10cc5=_0x5919('0x38');return db[_0x5919('0x39')][_0x5919('0x3a')]({'where':{'type':_0xa10cc5,'resourceId':_0x1ee3c6['id']}})['then'](function(){return _0x35f159;});})[_0x5919('0x23')](function(){_0x310ba8['status'](0xcc)[_0x5919('0x3b')]();});}};}function handleEntityNotFound(_0x575927,_0x464612){return function(_0x2b5708){if(!_0x2b5708){_0x575927['sendStatus'](0x194);}return _0x2b5708;};}function handleError(_0x1823aa,_0x188b20){_0x188b20=_0x188b20||0x1f4;return function(_0x55f6da){logger[_0x5919('0x28')](_0x55f6da[_0x5919('0x3c')]);if(_0x55f6da[_0x5919('0x3d')]){delete _0x55f6da[_0x5919('0x3d')];}_0x1823aa[_0x5919('0x2d')](_0x188b20)['send'](_0x55f6da);};}exports[_0x5919('0x3e')]=function(_0xf87f00,_0x2b1e96){var _0x159734={},_0x5362c={},_0x15c9c6={'count':0x0,'rows':[]};var _0x316025=_[_0x5919('0x3f')](db[_0x5919('0x40')][_0x5919('0x41')],function(_0x4faffe){return{'name':_0x4faffe[_0x5919('0x42')],'type':_0x4faffe[_0x5919('0x43')][_0x5919('0x44')]};});_0x5362c['model']=_[_0x5919('0x3f')](_0x316025,_0x5919('0x3d'));_0x5362c[_0x5919('0x45')]=_[_0x5919('0x46')](_0xf87f00[_0x5919('0x45')]);_0x5362c[_0x5919('0x47')]=_[_0x5919('0x48')](_0x5362c[_0x5919('0x49')],_0x5362c[_0x5919('0x45')]);_0x159734[_0x5919('0x4a')]=_['intersection'](_0x5362c['model'],qs[_0x5919('0x4b')](_0xf87f00[_0x5919('0x45')]['fields']));_0x159734[_0x5919('0x4a')]=_0x159734[_0x5919('0x4a')][_0x5919('0x4c')]?_0x159734['attributes']:_0x5362c[_0x5919('0x49')];if(!_0xf87f00['query'][_0x5919('0x4d')](_0x5919('0x4e'))){_0x159734[_0x5919('0x30')]=qs[_0x5919('0x30')](_0xf87f00[_0x5919('0x45')][_0x5919('0x30')]);_0x159734[_0x5919('0x2f')]=qs[_0x5919('0x2f')](_0xf87f00['query'][_0x5919('0x2f')]);}_0x159734[_0x5919('0x4f')]=qs[_0x5919('0x50')](_0xf87f00[_0x5919('0x45')][_0x5919('0x50')]);_0x159734[_0x5919('0x51')]=qs[_0x5919('0x47')](_[_0x5919('0x52')](_0xf87f00['query'],_0x5362c[_0x5919('0x47')]));if(_0xf87f00['query'][_0x5919('0x53')]){_0x159734[_0x5919('0x51')]=_[_0x5919('0x54')](_0x159734[_0x5919('0x51')],{'$or':_['map'](_0x316025,function(_0x23e026){if(_0x23e026[_0x5919('0x43')][_0x5919('0x44')]!==_0x5919('0x55')){var _0x1ec0f8={};_0x1ec0f8[_0x23e026['field']]={'$like':'%'+_0xf87f00[_0x5919('0x45')]['filter']+'%'};return _0x1ec0f8;}})});}_0x159734=_[_0x5919('0x54')]({},_0x159734,_0xf87f00[_0x5919('0x56')]);var _0x4d43d5={'where':_0x159734[_0x5919('0x51')]};return db[_0x5919('0x40')][_0x5919('0x2e')](_0x4d43d5)[_0x5919('0x23')](function(_0x5bc3c5){_0x15c9c6[_0x5919('0x2e')]=_0x5bc3c5;if(_0xf87f00[_0x5919('0x45')][_0x5919('0x57')]){_0x159734[_0x5919('0x58')]=[{'all':!![]}];}return db[_0x5919('0x40')][_0x5919('0x59')](_0x159734);})['then'](function(_0x28b657){_0x15c9c6[_0x5919('0x5a')]=_0x28b657;return _0x15c9c6;})[_0x5919('0x23')](respondWithFilteredResult(_0x2b1e96,_0x159734))[_0x5919('0x2b')](handleError(_0x2b1e96,null));};exports[_0x5919('0x5b')]=function(_0x2ff37a,_0x394509){var _0xe8eecd={'raw':!![],'where':{'id':_0x2ff37a['params']['id']}},_0x326de5={};_0x326de5[_0x5919('0x49')]=_[_0x5919('0x46')](db[_0x5919('0x40')][_0x5919('0x41')]);_0x326de5[_0x5919('0x45')]=_[_0x5919('0x46')](_0x2ff37a[_0x5919('0x45')]);_0x326de5['filters']=_[_0x5919('0x48')](_0x326de5[_0x5919('0x49')],_0x326de5[_0x5919('0x45')]);_0xe8eecd['attributes']=_[_0x5919('0x48')](_0x326de5[_0x5919('0x49')],qs[_0x5919('0x4b')](_0x2ff37a[_0x5919('0x45')]['fields']));_0xe8eecd['attributes']=_0xe8eecd[_0x5919('0x4a')]['length']?_0xe8eecd[_0x5919('0x4a')]:_0x326de5[_0x5919('0x49')];if(_0x2ff37a['query']['includeAll']){_0xe8eecd[_0x5919('0x58')]=[{'all':!![]}];}_0xe8eecd=_[_0x5919('0x54')]({},_0xe8eecd,_0x2ff37a[_0x5919('0x56')]);return db[_0x5919('0x40')][_0x5919('0x5c')](_0xe8eecd)[_0x5919('0x23')](handleEntityNotFound(_0x394509,null))[_0x5919('0x23')](respondWithResult(_0x394509,null))[_0x5919('0x2b')](handleError(_0x394509,null));};exports[_0x5919('0x5d')]=function(_0x4f78d8,_0xa53f2d){return db['ChatQueue'][_0x5919('0x5d')](_0x4f78d8['body'],{})[_0x5919('0x23')](function(_0x56b3c0){var _0x1b3a88=_0x4f78d8['user'][_0x5919('0x37')]({'plain':!![]});if(!_0x1b3a88)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1b3a88[_0x5919('0x5e')]===_0x5919('0x5f')){var _0x49e431=_0x56b3c0['get']({'plain':!![]});var _0x3441db='ChatQueues';return db[_0x5919('0x60')][_0x5919('0x5c')]({'where':{'name':_0x3441db,'userProfileId':_0x1b3a88[_0x5919('0x61')]},'raw':!![]})['then'](function(_0x563c83){if(_0x563c83&&_0x563c83[_0x5919('0x62')]===0x0){return db['UserProfileResource'][_0x5919('0x5d')]({'name':_0x49e431[_0x5919('0x3d')],'resourceId':_0x49e431['id'],'type':_0x563c83[_0x5919('0x3d')],'sectionId':_0x563c83['id']},{})['then'](function(){return _0x56b3c0;});}else{return _0x56b3c0;}})[_0x5919('0x2b')](function(_0x5c99fb){logger[_0x5919('0x28')](_0x5919('0x63'),_0x5c99fb);throw _0x5c99fb;});}return _0x56b3c0;})[_0x5919('0x23')](respondWithResult(_0xa53f2d,0xc9))['catch'](handleError(_0xa53f2d,null));};exports[_0x5919('0x36')]=function(_0x5462ec,_0x56fc09){if(_0x5462ec['body']['id']){delete _0x5462ec[_0x5919('0x64')]['id'];}return db['ChatQueue'][_0x5919('0x5c')]({'where':{'id':_0x5462ec[_0x5919('0x65')]['id']}})[_0x5919('0x23')](handleEntityNotFound(_0x56fc09,null))[_0x5919('0x23')](saveUpdates(_0x5462ec[_0x5919('0x64')],null))[_0x5919('0x23')](respondWithResult(_0x56fc09,null))[_0x5919('0x2b')](handleError(_0x56fc09,null));};exports[_0x5919('0x3a')]=function(_0x5ac592,_0x1ad830){return db['ChatQueue'][_0x5919('0x5c')]({'where':{'id':_0x5ac592[_0x5919('0x65')]['id']}})[_0x5919('0x23')](handleEntityNotFound(_0x1ad830,null))[_0x5919('0x23')](removeEntity(_0x1ad830,null))['catch'](handleError(_0x1ad830,null));};exports[_0x5919('0x66')]=function(_0x3ada2e,_0x5f2dd6){return db[_0x5919('0x40')][_0x5919('0x66')]()['then'](respondWithResult(_0x5f2dd6,null))[_0x5919('0x2b')](handleError(_0x5f2dd6,null));};exports[_0x5919('0x67')]=function(_0x151164,_0x1b79d0,_0x555269){var _0x1ceef9={'raw':!![],'where':{}},_0x1f8c1a={},_0x52cb3a;return db[_0x5919('0x40')][_0x5919('0x68')]({'where':{'id':_0x151164[_0x5919('0x65')]['id']}})[_0x5919('0x23')](handleEntityNotFound(_0x1b79d0,null))[_0x5919('0x23')](function(_0x4cfa0e){if(_0x4cfa0e){_0x52cb3a=_0x4cfa0e[_0x5919('0x37')]({'plain':!![]});_0x1f8c1a['model']=_['keys'](db['UserChatQueue']['rawAttributes']);_0x1f8c1a['query']=_[_0x5919('0x46')](_0x151164['query']);_0x1f8c1a[_0x5919('0x47')]=_[_0x5919('0x48')](_0x1f8c1a[_0x5919('0x49')],_0x1f8c1a[_0x5919('0x45')]);_0x1ceef9[_0x5919('0x4a')]=_[_0x5919('0x48')](_0x1f8c1a['model'],qs[_0x5919('0x4b')](_0x151164[_0x5919('0x45')][_0x5919('0x4b')]));_0x1ceef9[_0x5919('0x4a')]=_0x1ceef9[_0x5919('0x4a')]['length']?_0x1ceef9[_0x5919('0x4a')]:_0x1f8c1a[_0x5919('0x49')];if(!_0x151164[_0x5919('0x45')][_0x5919('0x4d')](_0x5919('0x4e'))){_0x1ceef9[_0x5919('0x30')]=qs[_0x5919('0x30')](_0x151164[_0x5919('0x45')][_0x5919('0x30')]);_0x1ceef9[_0x5919('0x2f')]=qs[_0x5919('0x2f')](_0x151164[_0x5919('0x45')][_0x5919('0x2f')]);}_0x1ceef9[_0x5919('0x4f')]=qs['sort'](_0x151164[_0x5919('0x45')]['sort']);_0x1ceef9[_0x5919('0x51')]=qs[_0x5919('0x47')](_[_0x5919('0x52')](_0x151164[_0x5919('0x45')],_0x1f8c1a[_0x5919('0x47')]));_0x1ceef9[_0x5919('0x51')][_0x5919('0x69')]=_0x4cfa0e['id'];if(_0x151164[_0x5919('0x45')][_0x5919('0x53')]){_0x1ceef9[_0x5919('0x51')]=_[_0x5919('0x54')](_0x1ceef9[_0x5919('0x51')],{'$or':_[_0x5919('0x3f')](_0x1ceef9[_0x5919('0x4a')],function(_0x31eb18){var _0x215e39={};_0x215e39[_0x31eb18]={'$like':'%'+_0x151164['query'][_0x5919('0x53')]+'%'};return _0x215e39;})});}_0x1ceef9=_['merge']({},_0x1ceef9,_0x151164[_0x5919('0x56')]);return db['UserChatQueue'][_0x5919('0x59')](_0x1ceef9);}})[_0x5919('0x23')](function(_0x4423d6){if(_0x4423d6){return db[_0x5919('0x6a')]['findAndCountAll']({'where':{'id':_['map'](_0x4423d6,_0x5919('0x6b')),'role':_0x5919('0x6c')},'attributes':['id','name',_0x5919('0x6d'),_0x5919('0x6e'),_0x5919('0x6f')]});}})['then'](function(_0x48d1c5){if(_0x48d1c5){return{'count':_0x48d1c5[_0x5919('0x2e')],'rows':_[_0x5919('0x3f')](_0x48d1c5[_0x5919('0x5a')],function(_0x48d248){return{'membername':_0x48d248['name'],'UserId':_0x48d248['id'],'queue_name':_0x52cb3a[_0x5919('0x3d')],'ChatQueueId':_0x52cb3a['id'],'interface':util['format']('%s/%s',_0x5919('0x70'),_0x48d248['name']),'penalty':0x0,'paused':_0x48d248[_0x5919('0x6d')],'createdAt':_0x48d248[_0x5919('0x6f')],'updatedAt':_0x48d248['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x5919('0x23')](respondWithFilteredResult(_0x1b79d0,_0x1ceef9))[_0x5919('0x2b')](handleError(_0x1b79d0,null));};exports['getTeams']=function(_0x16de0b,_0x32f2e9,_0xc498){var _0x37fccf={};var _0x401bf1={};var _0x9e9f6d;var _0x5e9d33;return db['ChatQueue'][_0x5919('0x68')]({'where':{'id':_0x16de0b[_0x5919('0x65')]['id']}})[_0x5919('0x23')](handleEntityNotFound(_0x32f2e9,null))['then'](function(_0x585f8f){if(_0x585f8f){_0x9e9f6d=_0x585f8f;_0x401bf1[_0x5919('0x49')]=_[_0x5919('0x46')](db['Team'][_0x5919('0x41')]);_0x401bf1[_0x5919('0x45')]=_['keys'](_0x16de0b[_0x5919('0x45')]);_0x401bf1[_0x5919('0x47')]=_[_0x5919('0x48')](_0x401bf1[_0x5919('0x49')],_0x401bf1[_0x5919('0x45')]);_0x37fccf[_0x5919('0x4a')]=_[_0x5919('0x48')](_0x401bf1[_0x5919('0x49')],qs['fields'](_0x16de0b[_0x5919('0x45')]['fields']));_0x37fccf[_0x5919('0x4a')]=_0x37fccf['attributes']['length']?_0x37fccf[_0x5919('0x4a')]:_0x401bf1[_0x5919('0x49')];_0x37fccf[_0x5919('0x4f')]=qs[_0x5919('0x50')](_0x16de0b[_0x5919('0x45')][_0x5919('0x50')]);_0x37fccf[_0x5919('0x51')]=qs['filters'](_[_0x5919('0x52')](_0x16de0b[_0x5919('0x45')],_0x401bf1['filters']));if(_0x16de0b[_0x5919('0x45')][_0x5919('0x53')]){_0x37fccf[_0x5919('0x51')]=_[_0x5919('0x54')](_0x37fccf[_0x5919('0x51')],{'$or':_[_0x5919('0x3f')](_0x37fccf[_0x5919('0x4a')],function(_0x41a46b){var _0x22163d={};_0x22163d[_0x41a46b]={'$like':'%'+_0x16de0b[_0x5919('0x45')][_0x5919('0x53')]+'%'};return _0x22163d;})});}_0x37fccf=_[_0x5919('0x54')]({},_0x37fccf,_0x16de0b['options']);return _0x9e9f6d['getTeams'](_0x37fccf);}})[_0x5919('0x23')](function(_0x1dd67b){if(_0x1dd67b){_0x5e9d33=_0x1dd67b[_0x5919('0x4c')];if(!_0x16de0b['query'][_0x5919('0x4d')](_0x5919('0x4e'))){_0x37fccf[_0x5919('0x30')]=qs[_0x5919('0x30')](_0x16de0b[_0x5919('0x45')]['limit']);_0x37fccf['offset']=qs['offset'](_0x16de0b[_0x5919('0x45')][_0x5919('0x2f')]);}return _0x9e9f6d[_0x5919('0x71')](_0x37fccf);}})[_0x5919('0x23')](function(_0x3f5fc6){if(_0x3f5fc6){return _0x3f5fc6?{'count':_0x5e9d33,'rows':_0x3f5fc6}:null;}})[_0x5919('0x23')](respondWithResult(_0x32f2e9,null))[_0x5919('0x2b')](handleError(_0x32f2e9,null));};exports[_0x5919('0x72')]=function(_0x12cdbf,_0x427ac9,_0x34f20d){var _0x1e05a6=_0x12cdbf[_0x5919('0x64')][_0x5919('0x73')];return db[_0x5919('0x74')][_0x5919('0x59')]({'where':{'id':_0x1e05a6},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x5919('0x3d'),_0x5919('0x75'),'voicePause',_0x5919('0x76')],'raw':!![]}]})[_0x5919('0x23')](function(_0x3fd29a){if(_0x3fd29a){var _0xefd08c=_[_0x5919('0x77')](_0x3fd29a,function(_0x530046){var _0x7fa6ac=_0x530046[_0x5919('0x37')]({'plain':!![]});return _0x7fa6ac[_0x5919('0x78')];});return db[_0x5919('0x40')][_0x5919('0x5c')]({'where':{'id':_0x12cdbf[_0x5919('0x65')]['id']}})[_0x5919('0x23')](function(_0x11259a){return db[_0x5919('0x79')][_0x5919('0x7a')](function(_0x20c1a6){return _0x11259a['addTeams'](_0x1e05a6,{'transaction':_0x20c1a6})[_0x5919('0x23')](function(){return BPromise['each'](_0xefd08c,function(_0x498e48){return db[_0x5919('0x7b')][_0x5919('0x7c')]({'where':{'UserId':_0x498e48['id'],'ChatQueueId':_0x12cdbf[_0x5919('0x65')]['id']},'transaction':_0x20c1a6});});})[_0x5919('0x23')](function(){_0xefd08c['forEach'](function(_0x6963ca){socket[_0x5919('0x7d')](_0x5919('0x7e'),{'UserId':_0x6963ca['id'],'ChatQueueId':_0x11259a['id']});});});});});}})[_0x5919('0x23')](respondWithStatusCode(_0x427ac9,null))[_0x5919('0x2b')](handleError(_0x427ac9,null));};exports[_0x5919('0x7f')]=function(_0x1631dd,_0x31db66,_0x5a07f9){return db['Team'][_0x5919('0x59')]({'where':{'id':_0x1631dd[_0x5919('0x45')][_0x5919('0x73')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x5919('0x78'),'attributes':['id'],'raw':!![]}]})[_0x5919('0x23')](handleEntityNotFound(_0x31db66,null))[_0x5919('0x23')](function(_0x5023db){var _0x372fde=_[_0x5919('0x3f')](_0x5023db,'id');var _0xecd90f=[];var _0x1d6440=[];var _0x574f0c=squel['select']();_0x574f0c[_0x5919('0x80')](_0x5919('0x81'))['from'](_0x5919('0x82'),'tq')[_0x5919('0x83')](_0x5919('0x84'),'ut',_0x5919('0x85'))['where']('ChatQueueId\x20=\x20?',_0x1631dd[_0x5919('0x65')]['id']);for(var _0x26007f=0x0;_0x26007f<_0x5023db[_0x5919('0x4c')];_0x26007f+=0x1){let _0x510c82=_0x5023db[_0x26007f];for(var _0x541075=0x0;_0x541075<_0x510c82['Agents'][_0x5919('0x4c')];_0x541075+=0x1){let _0x31fec9=_0x510c82['Agents'][_0x541075];var _0x141c49=_0x574f0c['clone']();_0x141c49[_0x5919('0x51')](_0x5919('0x86'),_0x31fec9['id']);_0x1d6440[_0x5919('0x87')](db[_0x5919('0x79')][_0x5919('0x45')](_0x141c49[_0x5919('0x88')](),{'type':db[_0x5919('0x79')][_0x5919('0x89')][_0x5919('0x8a')]})[_0x5919('0x23')](function(_0x6bafcc){if(_0x6bafcc[_0x5919('0x4c')]===0x1){return _0x31fec9['id'];}else{var _0x109a7d=_[_0x5919('0x8b')](_['map'](_0x6bafcc,_0x5919('0x8c')),function(_0x5aef31){return _['includes'](_0x372fde,_0x5aef31);});if(_0x109a7d){return _0x31fec9['id'];}}}));}}return BPromise[_0x5919('0x8d')](_0x1d6440)[_0x5919('0x23')](function(_0x439afa){_0xecd90f=_(_0xecd90f)[_0x5919('0x8e')](_0x439afa)[_0x5919('0x8f')]()[_0x5919('0x90')]();return db[_0x5919('0x40')]['find']({'where':{'id':_0x1631dd[_0x5919('0x65')]['id']}})[_0x5919('0x23')](function(_0xbe171e){return db[_0x5919('0x79')][_0x5919('0x7a')](function(_0x5ed471){return _0xbe171e[_0x5919('0x7f')](_0x1631dd[_0x5919('0x45')][_0x5919('0x73')],{'transaction':_0x5ed471})[_0x5919('0x23')](function(){if(!_[_0x5919('0x91')](_0xecd90f)){return _0xbe171e['removeAgents'](_0xecd90f,{'transaction':_0x5ed471});}})[_0x5919('0x23')](function(){_0xecd90f[_0x5919('0x92')](function(_0x304671){socket[_0x5919('0x7d')](_0x5919('0x93'),{'UserId':_0x304671,'ChatQueueId':_0xbe171e['id']});});});});});});})[_0x5919('0x23')](respondWithStatusCode(_0x31db66,null))[_0x5919('0x2b')](handleError(_0x31db66,null));};exports['addAgents']=function(_0x3e9587,_0x29f459,_0x401bbb){return db[_0x5919('0x40')][_0x5919('0x5c')]({'where':{'id':_0x3e9587[_0x5919('0x65')]['id']}})[_0x5919('0x23')](handleEntityNotFound(_0x29f459,null))['then'](function(_0x2e9333){if(_0x2e9333){return _0x2e9333[_0x5919('0x94')](_0x3e9587[_0x5919('0x64')]['ids'],_[_0x5919('0x95')](_0x3e9587[_0x5919('0x64')],['ids','id'])||{})[_0x5919('0x96')](function(_0xdfeb87){for(var _0xae5cf8=0x0;_0xae5cf8<_0x3e9587['body'][_0x5919('0x73')][_0x5919('0x4c')];_0xae5cf8+=0x1){socket[_0x5919('0x7d')](_0x5919('0x7e'),{'UserId':_0x3e9587[_0x5919('0x64')]['ids'][_0xae5cf8],'ChatQueueId':_0x3e9587[_0x5919('0x65')]['id']});}return _0xdfeb87;});}})[_0x5919('0x23')](respondWithResult(_0x29f459,null))[_0x5919('0x2b')](handleError(_0x29f459,null));};exports['removeAgents']=function(_0x319f68,_0x4e743b,_0xc9173){return db[_0x5919('0x40')][_0x5919('0x5c')]({'where':{'id':_0x319f68[_0x5919('0x65')]['id']}})[_0x5919('0x23')](handleEntityNotFound(_0x4e743b,null))['then'](function(_0x2b7a92){if(_0x2b7a92){return _0x2b7a92[_0x5919('0x97')](_0x319f68[_0x5919('0x45')][_0x5919('0x73')])[_0x5919('0x23')](function(){if(_[_0x5919('0x98')](_0x319f68['query'][_0x5919('0x73')])){for(var _0x54b545=0x0;_0x54b545<_0x319f68[_0x5919('0x45')][_0x5919('0x73')][_0x5919('0x4c')];_0x54b545+=0x1){socket[_0x5919('0x7d')](_0x5919('0x93'),{'UserId':Number(_0x319f68[_0x5919('0x45')][_0x5919('0x73')][_0x54b545]),'ChatQueueId':Number(_0x319f68[_0x5919('0x65')]['id'])});}}else{socket['emit'](_0x5919('0x93'),{'UserId':Number(_0x319f68[_0x5919('0x45')][_0x5919('0x73')]),'ChatQueueId':Number(_0x319f68['params']['id'])});}});}})[_0x5919('0x23')](respondWithStatusCode(_0x4e743b,null))[_0x5919('0x2b')](handleError(_0x4e743b,null));};exports[_0x5919('0x99')]=function(_0x4ca0b8,_0x1718b3,_0xa1555d){var _0xa25e59={};var _0xd44497={};var _0x15104f;var _0xec5427;return db['ChatQueue'][_0x5919('0x68')]({'where':{'id':_0x4ca0b8[_0x5919('0x65')]['id']}})['then'](handleEntityNotFound(_0x1718b3,null))[_0x5919('0x23')](function(_0x36adee){if(_0x36adee){_0x15104f=_0x36adee;_0xd44497[_0x5919('0x49')]=_['keys'](db[_0x5919('0x6a')]['rawAttributes']);_0xd44497['query']=_[_0x5919('0x46')](_0x4ca0b8[_0x5919('0x45')]);_0xd44497[_0x5919('0x47')]=_[_0x5919('0x48')](_0xd44497[_0x5919('0x49')],_0xd44497[_0x5919('0x45')]);_0xa25e59['attributes']=_[_0x5919('0x48')](_0xd44497['model'],qs[_0x5919('0x4b')](_0x4ca0b8[_0x5919('0x45')][_0x5919('0x4b')]));_0xa25e59[_0x5919('0x4a')]=_0xa25e59[_0x5919('0x4a')][_0x5919('0x4c')]?_0xa25e59[_0x5919('0x4a')]:_0xd44497[_0x5919('0x49')];_0xa25e59[_0x5919('0x4f')]=qs[_0x5919('0x50')](_0x4ca0b8[_0x5919('0x45')]['sort']);_0xa25e59[_0x5919('0x51')]=qs[_0x5919('0x47')](_[_0x5919('0x52')](_0x4ca0b8[_0x5919('0x45')],_0xd44497[_0x5919('0x47')]));if(_0x4ca0b8[_0x5919('0x45')][_0x5919('0x53')]){_0xa25e59[_0x5919('0x51')]=_[_0x5919('0x54')](_0xa25e59['where'],{'$or':_[_0x5919('0x3f')](_0xa25e59[_0x5919('0x4a')],function(_0x323bbc){var _0x1b9f5f={};_0x1b9f5f[_0x323bbc]={'$like':'%'+_0x4ca0b8[_0x5919('0x45')][_0x5919('0x53')]+'%'};return _0x1b9f5f;})});}_0xa25e59=_['merge']({},_0xa25e59,_0x4ca0b8['options']);return _0x15104f[_0x5919('0x99')](_0xa25e59);}})['then'](function(_0x1c2ecd){if(_0x1c2ecd){_0xec5427=_0x1c2ecd[_0x5919('0x4c')];if(!_0x4ca0b8['query'][_0x5919('0x4d')]('nolimit')){_0xa25e59[_0x5919('0x30')]=qs[_0x5919('0x30')](_0x4ca0b8[_0x5919('0x45')][_0x5919('0x30')]);_0xa25e59[_0x5919('0x2f')]=qs['offset'](_0x4ca0b8[_0x5919('0x45')][_0x5919('0x2f')]);}return _0x15104f[_0x5919('0x99')](_0xa25e59);}})[_0x5919('0x23')](function(_0x100796){if(_0x100796){return _0x100796?{'count':_0xec5427,'rows':_0x100796}:null;}})['then'](respondWithResult(_0x1718b3,null))['catch'](handleError(_0x1718b3,null));}; \ No newline at end of file +var _0x639a=['emit','removeTeams','select','tq.TeamId','from','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','sequelize','SELECT','every','TeamId','includes','all','compact','value','transaction','removeAgents','forEach','userChatQueue:remove','addAgents','omit','spread','userChatQueue:save','isArray','getAgents','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','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','error','code','ChatQueue,\x20%s,\x20%s','message','result','status','json','count','offset','limit','set','Content-Range','apply','reject','update','destroy','get','ChatQueues','UserProfileResource','end','stack','name','send','index','map','ChatQueue','rawAttributes','key','model','keys','query','filters','attributes','fields','length','hasOwnProperty','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','intersection','find','create','body','role','userProfileId','autoAssociation','describe','UserChatQueue','nolimit','order','ChatQueueId','User','findAndCountAll','UserId','chatPause','%s/%s','SIP','updatedAt','getTeams','findOne','Team','addTeams','ids','Agents','voicePause','flatMap','findOrCreate'];(function(_0x1d006a,_0x2812b5){var _0x20a76b=function(_0x15953f){while(--_0x15953f){_0x1d006a['push'](_0x1d006a['shift']());}};_0x20a76b(++_0x2812b5);}(_0x639a,0x145));var _0xa639=function(_0x2bab5e,_0x4fa1df){_0x2bab5e=_0x2bab5e-0x0;var _0x3b0a52=_0x639a[_0x2bab5e];return _0x3b0a52;};'use strict';var pdf=require(_0xa639('0x0'));var emlformat=require(_0xa639('0x1'));var rimraf=require(_0xa639('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa639('0x3'));var moment=require('moment');var BPromise=require(_0xa639('0x4'));var Mustache=require(_0xa639('0x5'));var util=require(_0xa639('0x6'));var path=require(_0xa639('0x7'));var sox=require(_0xa639('0x8'));var csv=require(_0xa639('0x9'));var ejs=require(_0xa639('0xa'));var fs=require('fs');var _=require(_0xa639('0xb'));var squel=require('squel');var crypto=require(_0xa639('0xc'));var jsforce=require(_0xa639('0xd'));var deskjs=require(_0xa639('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa639('0xf'));var Redis=require('ioredis');var authService=require(_0xa639('0x10'));var qs=require(_0xa639('0x11'));var as=require(_0xa639('0x12'));var hardwareService=require(_0xa639('0x13'));var logger=require(_0xa639('0x14'))(_0xa639('0x15'));var utils=require('../../config/utils');var config=require(_0xa639('0x16'));var db=require(_0xa639('0x17'))['db'];config[_0xa639('0x18')]=_[_0xa639('0x19')](config['redis'],{'host':_0xa639('0x1a'),'port':0x18eb});var socket=require(_0xa639('0x1b'))(new Redis(config[_0xa639('0x18')]));require(_0xa639('0x1c'))[_0xa639('0x1d')](socket);var jayson=require(_0xa639('0x1e'));var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x1dc69e,_0x61a087,_0x20da79){if(_0x20da79){var _0x3614a3=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3614a3[_0xa639('0x1f')](_0x61a087)){return _0x1dc69e;}else{throw new Error(_0xa639('0x20'));}}else{return _0x1dc69e;}}function respondWithRpcPromise(_0x15a0a0,_0x20e101,_0x3fbfb8,_0x9dce3e){return new BPromise(function(_0x460880,_0x36cdde){var _0x22b583=_0x9dce3e||client;return _0x22b583[_0xa639('0x21')](_0x15a0a0,_0x3fbfb8)[_0xa639('0x22')](function(_0x5d17a5){logger[_0xa639('0x23')]('ChatQueue,\x20%s,\x20%s',_0x20e101,_0xa639('0x24'));logger[_0xa639('0x25')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x20e101,_0xa639('0x24'),JSON['stringify'](_0x5d17a5));if(_0x5d17a5['error']){if(_0x5d17a5[_0xa639('0x26')][_0xa639('0x27')]===0x1f4){logger[_0xa639('0x26')](_0xa639('0x28'),_0x20e101,_0x5d17a5[_0xa639('0x26')][_0xa639('0x29')]);return _0x36cdde(_0x5d17a5[_0xa639('0x26')][_0xa639('0x29')]);}logger[_0xa639('0x26')](_0xa639('0x28'),_0x20e101,_0x5d17a5[_0xa639('0x26')]['message']);return _0x460880(_0x5d17a5[_0xa639('0x26')][_0xa639('0x29')]);}else{logger['info'](_0xa639('0x28'),_0x20e101,_0xa639('0x24'));_0x460880(_0x5d17a5[_0xa639('0x2a')]['message']);}})['catch'](function(_0x71f29d){logger[_0xa639('0x26')](_0xa639('0x28'),_0x20e101,_0x71f29d);_0x36cdde(_0x71f29d);});});}function respondWithStatusCode(_0x312b53,_0x353edd){_0x353edd=_0x353edd||0xcc;return function(_0x3a4625){if(_0x3a4625){return _0x312b53['sendStatus'](_0x353edd);}return _0x312b53[_0xa639('0x2b')](_0x353edd)['end']();};}function respondWithResult(_0x58071c,_0x24ed61){_0x24ed61=_0x24ed61||0xc8;return function(_0x29de25){if(_0x29de25){return _0x58071c[_0xa639('0x2b')](_0x24ed61)[_0xa639('0x2c')](_0x29de25);}};}function respondWithFilteredResult(_0x418e12,_0x2542a8){return function(_0x2c8c48){if(_0x2c8c48){var _0x1d3e6a=_0x2c8c48[_0xa639('0x2d')],_0x286218=_0x2542a8['offset'],_0x2ebf1b=_0x2542a8[_0xa639('0x2e')]+_0x2542a8[_0xa639('0x2f')],_0x3cfb18;if(_0x2ebf1b>=_0x1d3e6a){_0x2ebf1b=_0x1d3e6a;_0x3cfb18=0xc8;}else{_0x3cfb18=0xce;}_0x418e12['status'](_0x3cfb18);return _0x418e12[_0xa639('0x30')](_0xa639('0x31'),_0x286218+'-'+_0x2ebf1b+'/'+_0x1d3e6a)[_0xa639('0x2c')](_0x2c8c48);}return null;};}function patchUpdates(_0x2d4e3f){return function(_0x1e2724){try{jsonpatch[_0xa639('0x32')](_0x1e2724,_0x2d4e3f,!![]);}catch(_0x35b2f6){return BPromise[_0xa639('0x33')](_0x35b2f6);}return _0x1e2724['save']();};}function saveUpdates(_0x5bc70a,_0x1dcd52){return function(_0x55e0da){if(_0x55e0da){return _0x55e0da[_0xa639('0x34')](_0x5bc70a)[_0xa639('0x22')](function(_0xe1fac8){return _0xe1fac8;});}return null;};}function removeEntity(_0x35a113,_0x281b62){return function(_0x31bc85){if(_0x31bc85){return _0x31bc85[_0xa639('0x35')]()['then'](function(){var _0x589004=_0x31bc85[_0xa639('0x36')]({'plain':!![]});var _0x47fe53=_0xa639('0x37');return db[_0xa639('0x38')]['destroy']({'where':{'type':_0x47fe53,'resourceId':_0x589004['id']}})[_0xa639('0x22')](function(){return _0x31bc85;});})['then'](function(){_0x35a113['status'](0xcc)[_0xa639('0x39')]();});}};}function handleEntityNotFound(_0x2bc503,_0x496475){return function(_0x13ace0){if(!_0x13ace0){_0x2bc503['sendStatus'](0x194);}return _0x13ace0;};}function handleError(_0xf6a9f9,_0x9fbc3a){_0x9fbc3a=_0x9fbc3a||0x1f4;return function(_0x3fac51){logger[_0xa639('0x26')](_0x3fac51[_0xa639('0x3a')]);if(_0x3fac51[_0xa639('0x3b')]){delete _0x3fac51[_0xa639('0x3b')];}_0xf6a9f9[_0xa639('0x2b')](_0x9fbc3a)[_0xa639('0x3c')](_0x3fac51);};}exports[_0xa639('0x3d')]=function(_0x2289ef,_0x5ca741){var _0x114424={},_0x2030c3={},_0x4bfea7={'count':0x0,'rows':[]};var _0x130dec=_[_0xa639('0x3e')](db[_0xa639('0x3f')][_0xa639('0x40')],function(_0x97a6cb){return{'name':_0x97a6cb['fieldName'],'type':_0x97a6cb['type'][_0xa639('0x41')]};});_0x2030c3[_0xa639('0x42')]=_['map'](_0x130dec,'name');_0x2030c3['query']=_[_0xa639('0x43')](_0x2289ef[_0xa639('0x44')]);_0x2030c3[_0xa639('0x45')]=_['intersection'](_0x2030c3[_0xa639('0x42')],_0x2030c3[_0xa639('0x44')]);_0x114424[_0xa639('0x46')]=_['intersection'](_0x2030c3[_0xa639('0x42')],qs[_0xa639('0x47')](_0x2289ef[_0xa639('0x44')][_0xa639('0x47')]));_0x114424[_0xa639('0x46')]=_0x114424['attributes'][_0xa639('0x48')]?_0x114424[_0xa639('0x46')]:_0x2030c3['model'];if(!_0x2289ef[_0xa639('0x44')][_0xa639('0x49')]('nolimit')){_0x114424[_0xa639('0x2f')]=qs['limit'](_0x2289ef[_0xa639('0x44')]['limit']);_0x114424['offset']=qs['offset'](_0x2289ef[_0xa639('0x44')][_0xa639('0x2e')]);}_0x114424['order']=qs[_0xa639('0x4a')](_0x2289ef[_0xa639('0x44')][_0xa639('0x4a')]);_0x114424[_0xa639('0x4b')]=qs[_0xa639('0x45')](_[_0xa639('0x4c')](_0x2289ef[_0xa639('0x44')],_0x2030c3['filters']));if(_0x2289ef[_0xa639('0x44')]['filter']){_0x114424[_0xa639('0x4b')]=_[_0xa639('0x4d')](_0x114424[_0xa639('0x4b')],{'$or':_['map'](_0x130dec,function(_0x3c195b){if(_0x3c195b[_0xa639('0x4e')][_0xa639('0x41')]!==_0xa639('0x4f')){var _0x3ced92={};_0x3ced92[_0x3c195b['field']]={'$like':'%'+_0x2289ef['query'][_0xa639('0x50')]+'%'};return _0x3ced92;}})});}_0x114424=_[_0xa639('0x4d')]({},_0x114424,_0x2289ef[_0xa639('0x51')]);var _0x243b8c={'where':_0x114424[_0xa639('0x4b')]};return db['ChatQueue'][_0xa639('0x2d')](_0x243b8c)[_0xa639('0x22')](function(_0xc4f1b1){_0x4bfea7[_0xa639('0x2d')]=_0xc4f1b1;if(_0x2289ef['query'][_0xa639('0x52')]){_0x114424['include']=[{'all':!![]}];}return db[_0xa639('0x3f')][_0xa639('0x53')](_0x114424);})[_0xa639('0x22')](function(_0x3d66f1){_0x4bfea7[_0xa639('0x54')]=_0x3d66f1;return _0x4bfea7;})[_0xa639('0x22')](respondWithFilteredResult(_0x5ca741,_0x114424))[_0xa639('0x55')](handleError(_0x5ca741,null));};exports[_0xa639('0x56')]=function(_0x58f8e3,_0x48f7a4){var _0x119279={'raw':!![],'where':{'id':_0x58f8e3[_0xa639('0x57')]['id']}},_0x42f298={};_0x42f298[_0xa639('0x42')]=_[_0xa639('0x43')](db[_0xa639('0x3f')][_0xa639('0x40')]);_0x42f298[_0xa639('0x44')]=_[_0xa639('0x43')](_0x58f8e3[_0xa639('0x44')]);_0x42f298[_0xa639('0x45')]=_[_0xa639('0x58')](_0x42f298[_0xa639('0x42')],_0x42f298['query']);_0x119279['attributes']=_['intersection'](_0x42f298['model'],qs[_0xa639('0x47')](_0x58f8e3[_0xa639('0x44')][_0xa639('0x47')]));_0x119279[_0xa639('0x46')]=_0x119279[_0xa639('0x46')][_0xa639('0x48')]?_0x119279[_0xa639('0x46')]:_0x42f298[_0xa639('0x42')];if(_0x58f8e3[_0xa639('0x44')][_0xa639('0x52')]){_0x119279['include']=[{'all':!![]}];}_0x119279=_['merge']({},_0x119279,_0x58f8e3[_0xa639('0x51')]);return db[_0xa639('0x3f')][_0xa639('0x59')](_0x119279)[_0xa639('0x22')](handleEntityNotFound(_0x48f7a4,null))[_0xa639('0x22')](respondWithResult(_0x48f7a4,null))[_0xa639('0x55')](handleError(_0x48f7a4,null));};exports[_0xa639('0x5a')]=function(_0x3c9051,_0x71594f){return db[_0xa639('0x3f')][_0xa639('0x5a')](_0x3c9051[_0xa639('0x5b')],{})[_0xa639('0x22')](function(_0xfed0c1){var _0x164505=_0x3c9051['user']['get']({'plain':!![]});if(!_0x164505)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x164505[_0xa639('0x5c')]==='user'){var _0x1b8e11=_0xfed0c1[_0xa639('0x36')]({'plain':!![]});var _0x5b2088='ChatQueues';return db['UserProfileSection'][_0xa639('0x59')]({'where':{'name':_0x5b2088,'userProfileId':_0x164505[_0xa639('0x5d')]},'raw':!![]})[_0xa639('0x22')](function(_0x261109){if(_0x261109&&_0x261109[_0xa639('0x5e')]===0x0){return db[_0xa639('0x38')][_0xa639('0x5a')]({'name':_0x1b8e11['name'],'resourceId':_0x1b8e11['id'],'type':_0x261109[_0xa639('0x3b')],'sectionId':_0x261109['id']},{})[_0xa639('0x22')](function(){return _0xfed0c1;});}else{return _0xfed0c1;}})[_0xa639('0x55')](function(_0xe2d7ba){logger[_0xa639('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xe2d7ba);throw _0xe2d7ba;});}return _0xfed0c1;})[_0xa639('0x22')](respondWithResult(_0x71594f,0xc9))['catch'](handleError(_0x71594f,null));};exports['update']=function(_0x356946,_0x20110c){if(_0x356946[_0xa639('0x5b')]['id']){delete _0x356946[_0xa639('0x5b')]['id'];}return db[_0xa639('0x3f')]['find']({'where':{'id':_0x356946['params']['id']}})['then'](handleEntityNotFound(_0x20110c,null))[_0xa639('0x22')](saveUpdates(_0x356946[_0xa639('0x5b')],null))[_0xa639('0x22')](respondWithResult(_0x20110c,null))[_0xa639('0x55')](handleError(_0x20110c,null));};exports[_0xa639('0x35')]=function(_0x8e9401,_0x441535){return db[_0xa639('0x3f')][_0xa639('0x59')]({'where':{'id':_0x8e9401[_0xa639('0x57')]['id']}})[_0xa639('0x22')](handleEntityNotFound(_0x441535,null))['then'](removeEntity(_0x441535,null))['catch'](handleError(_0x441535,null));};exports[_0xa639('0x5f')]=function(_0x1e5db3,_0x634a64){return db['ChatQueue'][_0xa639('0x5f')]()[_0xa639('0x22')](respondWithResult(_0x634a64,null))[_0xa639('0x55')](handleError(_0x634a64,null));};exports['getMembers']=function(_0x4e37b1,_0x5c65fa,_0xf5b309){var _0x3a5e2f={'raw':!![],'where':{}},_0x58738b={},_0x4e3e04;return db['ChatQueue']['findOne']({'where':{'id':_0x4e37b1[_0xa639('0x57')]['id']}})[_0xa639('0x22')](handleEntityNotFound(_0x5c65fa,null))[_0xa639('0x22')](function(_0x38b58e){if(_0x38b58e){_0x4e3e04=_0x38b58e[_0xa639('0x36')]({'plain':!![]});_0x58738b['model']=_[_0xa639('0x43')](db[_0xa639('0x60')][_0xa639('0x40')]);_0x58738b[_0xa639('0x44')]=_['keys'](_0x4e37b1[_0xa639('0x44')]);_0x58738b[_0xa639('0x45')]=_[_0xa639('0x58')](_0x58738b['model'],_0x58738b[_0xa639('0x44')]);_0x3a5e2f[_0xa639('0x46')]=_[_0xa639('0x58')](_0x58738b[_0xa639('0x42')],qs[_0xa639('0x47')](_0x4e37b1[_0xa639('0x44')]['fields']));_0x3a5e2f[_0xa639('0x46')]=_0x3a5e2f[_0xa639('0x46')][_0xa639('0x48')]?_0x3a5e2f['attributes']:_0x58738b['model'];if(!_0x4e37b1[_0xa639('0x44')][_0xa639('0x49')](_0xa639('0x61'))){_0x3a5e2f['limit']=qs[_0xa639('0x2f')](_0x4e37b1[_0xa639('0x44')][_0xa639('0x2f')]);_0x3a5e2f[_0xa639('0x2e')]=qs['offset'](_0x4e37b1[_0xa639('0x44')][_0xa639('0x2e')]);}_0x3a5e2f[_0xa639('0x62')]=qs[_0xa639('0x4a')](_0x4e37b1[_0xa639('0x44')]['sort']);_0x3a5e2f[_0xa639('0x4b')]=qs[_0xa639('0x45')](_[_0xa639('0x4c')](_0x4e37b1[_0xa639('0x44')],_0x58738b['filters']));_0x3a5e2f[_0xa639('0x4b')][_0xa639('0x63')]=_0x38b58e['id'];if(_0x4e37b1[_0xa639('0x44')][_0xa639('0x50')]){_0x3a5e2f['where']=_['merge'](_0x3a5e2f[_0xa639('0x4b')],{'$or':_[_0xa639('0x3e')](_0x3a5e2f[_0xa639('0x46')],function(_0x2cafa0){var _0x2bb5e4={};_0x2bb5e4[_0x2cafa0]={'$like':'%'+_0x4e37b1[_0xa639('0x44')][_0xa639('0x50')]+'%'};return _0x2bb5e4;})});}_0x3a5e2f=_[_0xa639('0x4d')]({},_0x3a5e2f,_0x4e37b1[_0xa639('0x51')]);return db[_0xa639('0x60')]['findAll'](_0x3a5e2f);}})[_0xa639('0x22')](function(_0x5acbfa){if(_0x5acbfa){return db[_0xa639('0x64')][_0xa639('0x65')]({'where':{'id':_[_0xa639('0x3e')](_0x5acbfa,_0xa639('0x66')),'role':'agent'},'attributes':['id',_0xa639('0x3b'),_0xa639('0x67'),'updatedAt','createdAt']});}})['then'](function(_0x2d3b08){if(_0x2d3b08){return{'count':_0x2d3b08['count'],'rows':_[_0xa639('0x3e')](_0x2d3b08['rows'],function(_0x2f9dc2){return{'membername':_0x2f9dc2['name'],'UserId':_0x2f9dc2['id'],'queue_name':_0x4e3e04[_0xa639('0x3b')],'ChatQueueId':_0x4e3e04['id'],'interface':util['format'](_0xa639('0x68'),_0xa639('0x69'),_0x2f9dc2[_0xa639('0x3b')]),'penalty':0x0,'paused':_0x2f9dc2[_0xa639('0x67')],'createdAt':_0x2f9dc2['createdAt'],'updatedAt':_0x2f9dc2[_0xa639('0x6a')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x5c65fa,_0x3a5e2f))[_0xa639('0x55')](handleError(_0x5c65fa,null));};exports[_0xa639('0x6b')]=function(_0x97af71,_0x25b096,_0x3a67c5){var _0x1b8f6c={};var _0x56b578={};var _0x2b6cbb;var _0x1707ca;return db[_0xa639('0x3f')][_0xa639('0x6c')]({'where':{'id':_0x97af71[_0xa639('0x57')]['id']}})['then'](handleEntityNotFound(_0x25b096,null))[_0xa639('0x22')](function(_0x1b3b77){if(_0x1b3b77){_0x2b6cbb=_0x1b3b77;_0x56b578[_0xa639('0x42')]=_[_0xa639('0x43')](db[_0xa639('0x6d')][_0xa639('0x40')]);_0x56b578[_0xa639('0x44')]=_[_0xa639('0x43')](_0x97af71[_0xa639('0x44')]);_0x56b578[_0xa639('0x45')]=_[_0xa639('0x58')](_0x56b578['model'],_0x56b578[_0xa639('0x44')]);_0x1b8f6c[_0xa639('0x46')]=_[_0xa639('0x58')](_0x56b578[_0xa639('0x42')],qs[_0xa639('0x47')](_0x97af71[_0xa639('0x44')][_0xa639('0x47')]));_0x1b8f6c[_0xa639('0x46')]=_0x1b8f6c[_0xa639('0x46')][_0xa639('0x48')]?_0x1b8f6c[_0xa639('0x46')]:_0x56b578[_0xa639('0x42')];_0x1b8f6c[_0xa639('0x62')]=qs[_0xa639('0x4a')](_0x97af71['query'][_0xa639('0x4a')]);_0x1b8f6c[_0xa639('0x4b')]=qs['filters'](_['pick'](_0x97af71[_0xa639('0x44')],_0x56b578[_0xa639('0x45')]));if(_0x97af71['query'][_0xa639('0x50')]){_0x1b8f6c[_0xa639('0x4b')]=_['merge'](_0x1b8f6c[_0xa639('0x4b')],{'$or':_[_0xa639('0x3e')](_0x1b8f6c[_0xa639('0x46')],function(_0x2e65d2){var _0x45afd1={};_0x45afd1[_0x2e65d2]={'$like':'%'+_0x97af71['query'][_0xa639('0x50')]+'%'};return _0x45afd1;})});}_0x1b8f6c=_[_0xa639('0x4d')]({},_0x1b8f6c,_0x97af71[_0xa639('0x51')]);return _0x2b6cbb[_0xa639('0x6b')](_0x1b8f6c);}})[_0xa639('0x22')](function(_0x6712f5){if(_0x6712f5){_0x1707ca=_0x6712f5['length'];if(!_0x97af71[_0xa639('0x44')][_0xa639('0x49')]('nolimit')){_0x1b8f6c[_0xa639('0x2f')]=qs[_0xa639('0x2f')](_0x97af71['query'][_0xa639('0x2f')]);_0x1b8f6c['offset']=qs['offset'](_0x97af71['query'][_0xa639('0x2e')]);}return _0x2b6cbb[_0xa639('0x6b')](_0x1b8f6c);}})[_0xa639('0x22')](function(_0x4261d2){if(_0x4261d2){return _0x4261d2?{'count':_0x1707ca,'rows':_0x4261d2}:null;}})[_0xa639('0x22')](respondWithResult(_0x25b096,null))[_0xa639('0x55')](handleError(_0x25b096,null));};exports[_0xa639('0x6e')]=function(_0x127bf8,_0x3b42c6,_0x57bbd3){var _0x20eb82=_0x127bf8[_0xa639('0x5b')][_0xa639('0x6f')];return db['Team'][_0xa639('0x53')]({'where':{'id':_0x20eb82},'attributes':['id'],'include':[{'model':db[_0xa639('0x64')],'as':_0xa639('0x70'),'attributes':['id',_0xa639('0x3b'),'online',_0xa639('0x71'),'interface'],'raw':!![]}]})[_0xa639('0x22')](function(_0x591e4f){if(_0x591e4f){var _0x4d2f38=_[_0xa639('0x72')](_0x591e4f,function(_0x8ebb8a){var _0x85b3b1=_0x8ebb8a['get']({'plain':!![]});return _0x85b3b1[_0xa639('0x70')];});return db[_0xa639('0x3f')][_0xa639('0x59')]({'where':{'id':_0x127bf8[_0xa639('0x57')]['id']}})['then'](function(_0x4fecd8){return db['sequelize']['transaction'](function(_0x4570ac){return _0x4fecd8[_0xa639('0x6e')](_0x20eb82,{'transaction':_0x4570ac})[_0xa639('0x22')](function(){return BPromise['each'](_0x4d2f38,function(_0x35cd81){return db[_0xa639('0x60')][_0xa639('0x73')]({'where':{'UserId':_0x35cd81['id'],'ChatQueueId':_0x127bf8['params']['id']},'transaction':_0x4570ac});});})[_0xa639('0x22')](function(){_0x4d2f38['forEach'](function(_0x4f2662){socket[_0xa639('0x74')]('userChatQueue:save',{'UserId':_0x4f2662['id'],'ChatQueueId':_0x4fecd8['id']});});});});});}})[_0xa639('0x22')](respondWithStatusCode(_0x3b42c6,null))[_0xa639('0x55')](handleError(_0x3b42c6,null));};exports[_0xa639('0x75')]=function(_0xc9cb2c,_0x2e5551,_0x4f5837){return db[_0xa639('0x6d')]['findAll']({'where':{'id':_0xc9cb2c[_0xa639('0x44')][_0xa639('0x6f')]},'attributes':['id'],'include':[{'model':db[_0xa639('0x64')],'as':_0xa639('0x70'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2e5551,null))[_0xa639('0x22')](function(_0x126dc1){var _0x416387=_['map'](_0x126dc1,'id');var _0x4312c4=[];var _0x5efe0e=[];var _0x2b8cc2=squel[_0xa639('0x76')]();_0x2b8cc2['field'](_0xa639('0x77'))[_0xa639('0x78')](_0xa639('0x79'),'tq')[_0xa639('0x7a')]('user_has_teams','ut',_0xa639('0x7b'))[_0xa639('0x4b')](_0xa639('0x7c'),_0xc9cb2c['params']['id']);for(var _0x15b3a7=0x0;_0x15b3a7<_0x126dc1[_0xa639('0x48')];_0x15b3a7+=0x1){let _0x47e295=_0x126dc1[_0x15b3a7];for(var _0x409399=0x0;_0x409399<_0x47e295['Agents'][_0xa639('0x48')];_0x409399+=0x1){let _0x35b15e=_0x47e295['Agents'][_0x409399];var _0x1ad8d0=_0x2b8cc2[_0xa639('0x7d')]();_0x1ad8d0[_0xa639('0x4b')](_0xa639('0x7e'),_0x35b15e['id']);_0x5efe0e[_0xa639('0x7f')](db['sequelize'][_0xa639('0x44')](_0x1ad8d0[_0xa639('0x80')](),{'type':db[_0xa639('0x81')]['QueryTypes'][_0xa639('0x82')]})[_0xa639('0x22')](function(_0x5e170f){if(_0x5e170f[_0xa639('0x48')]===0x1){return _0x35b15e['id'];}else{var _0x254fbf=_[_0xa639('0x83')](_[_0xa639('0x3e')](_0x5e170f,_0xa639('0x84')),function(_0xd51532){return _[_0xa639('0x85')](_0x416387,_0xd51532);});if(_0x254fbf){return _0x35b15e['id'];}}}));}}return BPromise[_0xa639('0x86')](_0x5efe0e)[_0xa639('0x22')](function(_0x3820ec){_0x4312c4=_(_0x4312c4)['union'](_0x3820ec)[_0xa639('0x87')]()[_0xa639('0x88')]();return db[_0xa639('0x3f')][_0xa639('0x59')]({'where':{'id':_0xc9cb2c[_0xa639('0x57')]['id']}})[_0xa639('0x22')](function(_0x2c9d3f){return db['sequelize'][_0xa639('0x89')](function(_0x590322){return _0x2c9d3f[_0xa639('0x75')](_0xc9cb2c['query'][_0xa639('0x6f')],{'transaction':_0x590322})[_0xa639('0x22')](function(){if(!_['isEmpty'](_0x4312c4)){return _0x2c9d3f[_0xa639('0x8a')](_0x4312c4,{'transaction':_0x590322});}})[_0xa639('0x22')](function(){_0x4312c4[_0xa639('0x8b')](function(_0x420128){socket[_0xa639('0x74')](_0xa639('0x8c'),{'UserId':_0x420128,'ChatQueueId':_0x2c9d3f['id']});});});});});});})[_0xa639('0x22')](respondWithStatusCode(_0x2e5551,null))[_0xa639('0x55')](handleError(_0x2e5551,null));};exports[_0xa639('0x8d')]=function(_0x341936,_0x593ef7,_0x11b9f5){return db[_0xa639('0x3f')][_0xa639('0x59')]({'where':{'id':_0x341936[_0xa639('0x57')]['id']}})['then'](handleEntityNotFound(_0x593ef7,null))[_0xa639('0x22')](function(_0x3bba2d){if(_0x3bba2d){return _0x3bba2d[_0xa639('0x8d')](_0x341936[_0xa639('0x5b')][_0xa639('0x6f')],_[_0xa639('0x8e')](_0x341936[_0xa639('0x5b')],[_0xa639('0x6f'),'id'])||{})[_0xa639('0x8f')](function(_0x594ab1){for(var _0x505d77=0x0;_0x505d77<_0x341936[_0xa639('0x5b')][_0xa639('0x6f')][_0xa639('0x48')];_0x505d77+=0x1){socket[_0xa639('0x74')](_0xa639('0x90'),{'UserId':_0x341936[_0xa639('0x5b')][_0xa639('0x6f')][_0x505d77],'ChatQueueId':_0x341936['params']['id']});}return _0x594ab1;});}})['then'](respondWithResult(_0x593ef7,null))['catch'](handleError(_0x593ef7,null));};exports['removeAgents']=function(_0x52618a,_0x2db0ee,_0x424f6b){return db[_0xa639('0x3f')]['find']({'where':{'id':_0x52618a[_0xa639('0x57')]['id']}})[_0xa639('0x22')](handleEntityNotFound(_0x2db0ee,null))[_0xa639('0x22')](function(_0x2efa49){if(_0x2efa49){return _0x2efa49[_0xa639('0x8a')](_0x52618a['query'][_0xa639('0x6f')])['then'](function(){if(_[_0xa639('0x91')](_0x52618a[_0xa639('0x44')][_0xa639('0x6f')])){for(var _0x4ffa85=0x0;_0x4ffa85<_0x52618a[_0xa639('0x44')]['ids'][_0xa639('0x48')];_0x4ffa85+=0x1){socket[_0xa639('0x74')]('userChatQueue:remove',{'UserId':Number(_0x52618a['query'][_0xa639('0x6f')][_0x4ffa85]),'ChatQueueId':Number(_0x52618a[_0xa639('0x57')]['id'])});}}else{socket[_0xa639('0x74')](_0xa639('0x8c'),{'UserId':Number(_0x52618a['query']['ids']),'ChatQueueId':Number(_0x52618a[_0xa639('0x57')]['id'])});}});}})['then'](respondWithStatusCode(_0x2db0ee,null))[_0xa639('0x55')](handleError(_0x2db0ee,null));};exports[_0xa639('0x92')]=function(_0x271d7f,_0x3dfb5e,_0x50f859){var _0x450ddb={};var _0x468d78={};var _0x46d1e1;var _0xdae155;return db[_0xa639('0x3f')][_0xa639('0x6c')]({'where':{'id':_0x271d7f['params']['id']}})[_0xa639('0x22')](handleEntityNotFound(_0x3dfb5e,null))[_0xa639('0x22')](function(_0x2761d6){if(_0x2761d6){_0x46d1e1=_0x2761d6;_0x468d78[_0xa639('0x42')]=_[_0xa639('0x43')](db['User'][_0xa639('0x40')]);_0x468d78[_0xa639('0x44')]=_['keys'](_0x271d7f[_0xa639('0x44')]);_0x468d78[_0xa639('0x45')]=_[_0xa639('0x58')](_0x468d78[_0xa639('0x42')],_0x468d78['query']);_0x450ddb[_0xa639('0x46')]=_[_0xa639('0x58')](_0x468d78[_0xa639('0x42')],qs[_0xa639('0x47')](_0x271d7f[_0xa639('0x44')][_0xa639('0x47')]));_0x450ddb[_0xa639('0x46')]=_0x450ddb[_0xa639('0x46')][_0xa639('0x48')]?_0x450ddb[_0xa639('0x46')]:_0x468d78['model'];_0x450ddb[_0xa639('0x62')]=qs[_0xa639('0x4a')](_0x271d7f[_0xa639('0x44')][_0xa639('0x4a')]);_0x450ddb['where']=qs[_0xa639('0x45')](_[_0xa639('0x4c')](_0x271d7f[_0xa639('0x44')],_0x468d78[_0xa639('0x45')]));if(_0x271d7f[_0xa639('0x44')][_0xa639('0x50')]){_0x450ddb[_0xa639('0x4b')]=_[_0xa639('0x4d')](_0x450ddb[_0xa639('0x4b')],{'$or':_[_0xa639('0x3e')](_0x450ddb[_0xa639('0x46')],function(_0x55a4f2){var _0x1362e7={};_0x1362e7[_0x55a4f2]={'$like':'%'+_0x271d7f[_0xa639('0x44')][_0xa639('0x50')]+'%'};return _0x1362e7;})});}_0x450ddb=_[_0xa639('0x4d')]({},_0x450ddb,_0x271d7f['options']);return _0x46d1e1[_0xa639('0x92')](_0x450ddb);}})[_0xa639('0x22')](function(_0xe70881){if(_0xe70881){_0xdae155=_0xe70881['length'];if(!_0x271d7f[_0xa639('0x44')][_0xa639('0x49')]('nolimit')){_0x450ddb[_0xa639('0x2f')]=qs['limit'](_0x271d7f[_0xa639('0x44')][_0xa639('0x2f')]);_0x450ddb[_0xa639('0x2e')]=qs[_0xa639('0x2e')](_0x271d7f['query']['offset']);}return _0x46d1e1[_0xa639('0x92')](_0x450ddb);}})[_0xa639('0x22')](function(_0x8e3705){if(_0x8e3705){return _0x8e3705?{'count':_0xdae155,'rows':_0x8e3705}:null;}})[_0xa639('0x22')](respondWithResult(_0x3dfb5e,null))[_0xa639('0x55')](handleError(_0x3dfb5e,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 2217325..f49c1a4 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 _0x15cb=['emit','hook','exports','../../mysqldb','setMaxListeners','update','remove'];(function(_0x1d1cac,_0x2a142c){var _0x4557a0=function(_0x2349df){while(--_0x2349df){_0x1d1cac['push'](_0x1d1cac['shift']());}};_0x4557a0(++_0x2a142c);}(_0x15cb,0x16f));var _0xb15c=function(_0x2303f4,_0x4e593c){_0x2303f4=_0x2303f4-0x0;var _0x37f15e=_0x15cb[_0x2303f4];return _0x37f15e;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0xb15c('0x0'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xb15c('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb15c('0x2'),'afterDestroy':_0xb15c('0x3')};function emitEvent(_0x2777f9){return function(_0x3d8546,_0x4f1c8f,_0x432920){ChatQueueEvents[_0xb15c('0x4')](_0x2777f9+':'+_0x3d8546['id'],_0x3d8546);ChatQueueEvents['emit'](_0x2777f9,_0x3d8546);_0x432920(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0xb15c('0x5')](e,emitEvent(event));}}module[_0xb15c('0x6')]=ChatQueueEvents; \ No newline at end of file +var _0xdbf5=['emit','hasOwnProperty','hook','exports','../../mysqldb','save','update','remove'];(function(_0x3c51d4,_0x36ba53){var _0x53c45f=function(_0x3d6683){while(--_0x3d6683){_0x3c51d4['push'](_0x3c51d4['shift']());}};_0x53c45f(++_0x36ba53);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x360662,_0x1d89bd){_0x360662=_0x360662-0x0;var _0x323419=_0xdbf5[_0x360662];return _0x323419;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x5dbf('0x0'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5dbf('0x1'),'afterUpdate':_0x5dbf('0x2'),'afterDestroy':_0x5dbf('0x3')};function emitEvent(_0x3afe14){return function(_0x38b629,_0x1a1ea9,_0x776036){ChatQueueEvents[_0x5dbf('0x4')](_0x3afe14+':'+_0x38b629['id'],_0x38b629);ChatQueueEvents[_0x5dbf('0x4')](_0x3afe14,_0x38b629);_0x776036(null);};}for(var e in events){if(events[_0x5dbf('0x5')](e)){var event=events[e];ChatQueue[_0x5dbf('0x6')](e,emitEvent(event));}}module[_0x5dbf('0x7')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 26956fc..8e3ecb3 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 _0xd314=['lodash','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./chatQueue.attributes','chat_queues'];(function(_0x284258,_0x41159b){var _0x1231fc=function(_0x13683d){while(--_0x13683d){_0x284258['push'](_0x284258['shift']());}};_0x1231fc(++_0x41159b);}(_0xd314,0x87));var _0x4d31=function(_0x22a712,_0x5e26a3){_0x22a712=_0x22a712-0x0;var _0x5b327c=_0xd314[_0x22a712];return _0x5b327c;};'use strict';var _=require(_0x4d31('0x0'));var util=require('util');var logger=require(_0x4d31('0x1'))(_0x4d31('0x2'));var moment=require(_0x4d31('0x3'));var BPromise=require(_0x4d31('0x4'));var rp=require(_0x4d31('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4d31('0x6'));var attributes=require(_0x4d31('0x7'));module['exports']=function(_0x22dd4f,_0x4a880d){return _0x22dd4f['define']('ChatQueue',attributes,{'tableName':_0x4d31('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4a78=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','chat_queues','lodash'];(function(_0x542ca9,_0x51e21e){var _0x21a6db=function(_0x53e324){while(--_0x53e324){_0x542ca9['push'](_0x542ca9['shift']());}};_0x21a6db(++_0x51e21e);}(_0x4a78,0xba));var _0x84a7=function(_0x283d40,_0x1ceda2){_0x283d40=_0x283d40-0x0;var _0x2db520=_0x4a78[_0x283d40];return _0x2db520;};'use strict';var _=require(_0x84a7('0x0'));var util=require('util');var logger=require(_0x84a7('0x1'))(_0x84a7('0x2'));var moment=require(_0x84a7('0x3'));var BPromise=require(_0x84a7('0x4'));var rp=require(_0x84a7('0x5'));var fs=require('fs');var path=require(_0x84a7('0x6'));var rimraf=require(_0x84a7('0x7'));var config=require('../../config/environment');var attributes=require('./chatQueue.attributes');module[_0x84a7('0x8')]=function(_0x37774b,_0xafc363){return _0x37774b[_0x84a7('0x9')]('ChatQueue',attributes,{'tableName':_0x84a7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js index c392657..b29b4ee 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 _0xb1fa=['localhost','then','ChatQueue,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','GetChatQueue','options','raw','where','attributes','limit','include','map','model','debug','ChatQueue','ShowChatQueue','stringify','moment','randomstring','../../config/environment','redis'];(function(_0x230e39,_0x5341){var _0xa804e=function(_0xe14796){while(--_0xe14796){_0x230e39['push'](_0x230e39['shift']());}};_0xa804e(++_0x5341);}(_0xb1fa,0x9e));var _0xab1f=function(_0x2da52b,_0x1d20da){_0x2da52b=_0x2da52b-0x0;var _0x334e25=_0xb1fa[_0x2da52b];return _0x334e25;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xab1f('0x0'));var BPromise=require('bluebird');var rs=require(_0xab1f('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xab1f('0x2'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0xab1f('0x3')]=_['defaults'](config[_0xab1f('0x3')],{'host':_0xab1f('0x4'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xab1f('0x3')]));require('./chatQueue.socket')['register'](socket);function respondWithRpcPromise(_0x2a21f9,_0xbac6e5,_0x448a55){return new BPromise(function(_0x6136b3,_0x3f0f7e){return client['request'](_0x2a21f9,_0x448a55)[_0xab1f('0x5')](function(_0x4a62b1){logger['info'](_0xab1f('0x6'),_0xbac6e5,_0xab1f('0x7'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0xbac6e5,_0xab1f('0x7'),JSON['stringify'](_0x4a62b1));if(_0x4a62b1[_0xab1f('0x8')]){if(_0x4a62b1[_0xab1f('0x8')][_0xab1f('0x9')]===0x1f4){logger['error'](_0xab1f('0x6'),_0xbac6e5,_0x4a62b1[_0xab1f('0x8')][_0xab1f('0xa')]);return _0x3f0f7e(_0x4a62b1[_0xab1f('0x8')]['message']);}logger[_0xab1f('0x8')]('ChatQueue,\x20%s,\x20%s',_0xbac6e5,_0x4a62b1[_0xab1f('0x8')][_0xab1f('0xa')]);return _0x6136b3(_0x4a62b1[_0xab1f('0x8')]['message']);}else{logger[_0xab1f('0xb')](_0xab1f('0x6'),_0xbac6e5,'request\x20sent');_0x6136b3(_0x4a62b1[_0xab1f('0xc')][_0xab1f('0xa')]);}})[_0xab1f('0xd')](function(_0x231ce7){logger[_0xab1f('0x8')]('ChatQueue,\x20%s,\x20%s',_0xbac6e5,_0x231ce7);_0x3f0f7e(_0x231ce7);});});}exports[_0xab1f('0xe')]=function(_0x2c4862){var _0x512260=this;return new Promise(function(_0x128422,_0x30f973){return db['ChatQueue']['findAll']({'raw':_0x2c4862[_0xab1f('0xf')]?_0x2c4862[_0xab1f('0xf')][_0xab1f('0x10')]===undefined?!![]:![]:!![],'where':_0x2c4862[_0xab1f('0xf')]?_0x2c4862[_0xab1f('0xf')][_0xab1f('0x11')]||null:null,'attributes':_0x2c4862[_0xab1f('0xf')]?_0x2c4862['options'][_0xab1f('0x12')]||null:null,'limit':_0x2c4862[_0xab1f('0xf')]?_0x2c4862[_0xab1f('0xf')][_0xab1f('0x13')]||null:null,'include':_0x2c4862['options']?_0x2c4862[_0xab1f('0xf')][_0xab1f('0x14')]?_[_0xab1f('0x15')](_0x2c4862[_0xab1f('0xf')]['include'],function(_0x153083){return{'model':db[_0x153083[_0xab1f('0x16')]],'as':_0x153083['as'],'attributes':_0x153083[_0xab1f('0x12')],'include':_0x153083[_0xab1f('0x14')]?_[_0xab1f('0x15')](_0x153083[_0xab1f('0x14')],function(_0x357c51){return{'model':db[_0x357c51['model']],'as':_0x357c51['as'],'attributes':_0x357c51[_0xab1f('0x12')],'include':_0x357c51['include']?_[_0xab1f('0x15')](_0x357c51['include'],function(_0x3357b9){return{'model':db[_0x3357b9[_0xab1f('0x16')]],'as':_0x3357b9['as'],'attributes':_0x3357b9[_0xab1f('0x12')]};}):[]};}):[]};}):[]:[]})[_0xab1f('0x5')](function(_0x137042){logger[_0xab1f('0xb')](_0xab1f('0xe'),_0x2c4862);logger[_0xab1f('0x17')](_0xab1f('0xe'),_0x2c4862,JSON['stringify'](_0x137042));_0x128422(_0x137042);})[_0xab1f('0xd')](function(_0x5e6170){logger[_0xab1f('0x8')](_0xab1f('0xe'),_0x5e6170[_0xab1f('0xa')],_0x2c4862);_0x30f973(_0x512260[_0xab1f('0x8')](0x1f4,_0x5e6170[_0xab1f('0xa')]));});});};exports['ShowChatQueue']=function(_0x11ec23){var _0x3c11d7=this;return new Promise(function(_0x1de532,_0x5e1cf0){return db[_0xab1f('0x18')]['find']({'raw':_0x11ec23[_0xab1f('0xf')]?_0x11ec23['options'][_0xab1f('0x10')]===undefined?!![]:![]:!![],'where':_0x11ec23['options']?_0x11ec23[_0xab1f('0xf')][_0xab1f('0x11')]||null:null,'attributes':_0x11ec23[_0xab1f('0xf')]?_0x11ec23[_0xab1f('0xf')]['attributes']||null:null,'include':_0x11ec23['options']?_0x11ec23[_0xab1f('0xf')]['include']?_[_0xab1f('0x15')](_0x11ec23[_0xab1f('0xf')][_0xab1f('0x14')],function(_0xf5a7cb){return{'model':db[_0xf5a7cb[_0xab1f('0x16')]],'as':_0xf5a7cb['as'],'attributes':_0xf5a7cb[_0xab1f('0x12')],'include':_0xf5a7cb['include']?_[_0xab1f('0x15')](_0xf5a7cb[_0xab1f('0x14')],function(_0x500110){return{'model':db[_0x500110['model']],'as':_0x500110['as'],'attributes':_0x500110[_0xab1f('0x12')],'include':_0x500110[_0xab1f('0x14')]?_[_0xab1f('0x15')](_0x500110[_0xab1f('0x14')],function(_0x298bb9){return{'model':db[_0x298bb9[_0xab1f('0x16')]],'as':_0x298bb9['as'],'attributes':_0x298bb9['attributes']};}):[]};}):[]};}):[]:[]})[_0xab1f('0x5')](function(_0x31b16b){logger[_0xab1f('0xb')](_0xab1f('0x19'),_0x11ec23);logger[_0xab1f('0x17')](_0xab1f('0x19'),_0x11ec23,JSON[_0xab1f('0x1a')](_0x31b16b));_0x1de532(_0x31b16b);})['catch'](function(_0x276609){logger[_0xab1f('0x8')](_0xab1f('0x19'),_0x276609[_0xab1f('0xa')],_0x11ec23);_0x5e1cf0(_0x3c11d7[_0xab1f('0x8')](0x1f4,_0x276609[_0xab1f('0xa')]));});});}; \ No newline at end of file +var _0x82d8=['../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatQueue.socket','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetChatQueue','findAll','options','raw','where','limit','include','map','model','attributes','then','stringify','ShowChatQueue','find','lodash','moment','ioredis','../../config/utils'];(function(_0x1e39f3,_0x4802a4){var _0x23a85b=function(_0x547083){while(--_0x547083){_0x1e39f3['push'](_0x1e39f3['shift']());}};_0x23a85b(++_0x4802a4);}(_0x82d8,0xff));var _0x882d=function(_0x1f5e25,_0x4c09be){_0x1f5e25=_0x1f5e25-0x0;var _0x52fd89=_0x82d8[_0x1f5e25];return _0x52fd89;};'use strict';var _=require(_0x882d('0x0'));var util=require('util');var moment=require(_0x882d('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x882d('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x882d('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x882d('0x4'));var jayson=require(_0x882d('0x5'));var client=jayson[_0x882d('0x6')][_0x882d('0x7')]({'port':0x232a});config[_0x882d('0x8')]=_[_0x882d('0x9')](config[_0x882d('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x882d('0xa'))(new Redis(config[_0x882d('0x8')]));require(_0x882d('0xb'))['register'](socket);function respondWithRpcPromise(_0x2781b1,_0x3ad799,_0x5e342a){return new BPromise(function(_0x130954,_0xa2ca7f){return client[_0x882d('0xc')](_0x2781b1,_0x5e342a)['then'](function(_0x287672){logger[_0x882d('0xd')](_0x882d('0xe'),_0x3ad799,_0x882d('0xf'));logger[_0x882d('0x10')](_0x882d('0x11'),_0x3ad799,_0x882d('0xf'),JSON['stringify'](_0x287672));if(_0x287672['error']){if(_0x287672[_0x882d('0x12')][_0x882d('0x13')]===0x1f4){logger[_0x882d('0x12')](_0x882d('0xe'),_0x3ad799,_0x287672[_0x882d('0x12')]['message']);return _0xa2ca7f(_0x287672[_0x882d('0x12')][_0x882d('0x14')]);}logger[_0x882d('0x12')](_0x882d('0xe'),_0x3ad799,_0x287672[_0x882d('0x12')][_0x882d('0x14')]);return _0x130954(_0x287672[_0x882d('0x12')][_0x882d('0x14')]);}else{logger[_0x882d('0xd')]('ChatQueue,\x20%s,\x20%s',_0x3ad799,'request\x20sent');_0x130954(_0x287672[_0x882d('0x15')]['message']);}})[_0x882d('0x16')](function(_0x47d6a0){logger[_0x882d('0x12')](_0x882d('0xe'),_0x3ad799,_0x47d6a0);_0xa2ca7f(_0x47d6a0);});});}exports[_0x882d('0x17')]=function(_0x559a9b){var _0x22068=this;return new Promise(function(_0x282345,_0x14d709){return db['ChatQueue'][_0x882d('0x18')]({'raw':_0x559a9b[_0x882d('0x19')]?_0x559a9b[_0x882d('0x19')][_0x882d('0x1a')]===undefined?!![]:![]:!![],'where':_0x559a9b[_0x882d('0x19')]?_0x559a9b[_0x882d('0x19')][_0x882d('0x1b')]||null:null,'attributes':_0x559a9b[_0x882d('0x19')]?_0x559a9b[_0x882d('0x19')]['attributes']||null:null,'limit':_0x559a9b[_0x882d('0x19')]?_0x559a9b['options'][_0x882d('0x1c')]||null:null,'include':_0x559a9b[_0x882d('0x19')]?_0x559a9b[_0x882d('0x19')][_0x882d('0x1d')]?_[_0x882d('0x1e')](_0x559a9b['options'][_0x882d('0x1d')],function(_0x58ddb2){return{'model':db[_0x58ddb2[_0x882d('0x1f')]],'as':_0x58ddb2['as'],'attributes':_0x58ddb2[_0x882d('0x20')],'include':_0x58ddb2['include']?_['map'](_0x58ddb2['include'],function(_0x546fba){return{'model':db[_0x546fba[_0x882d('0x1f')]],'as':_0x546fba['as'],'attributes':_0x546fba[_0x882d('0x20')],'include':_0x546fba[_0x882d('0x1d')]?_[_0x882d('0x1e')](_0x546fba['include'],function(_0x287251){return{'model':db[_0x287251[_0x882d('0x1f')]],'as':_0x287251['as'],'attributes':_0x287251[_0x882d('0x20')]};}):[]};}):[]};}):[]:[]})[_0x882d('0x21')](function(_0xe040d8){logger['info']('GetChatQueue',_0x559a9b);logger['debug'](_0x882d('0x17'),_0x559a9b,JSON[_0x882d('0x22')](_0xe040d8));_0x282345(_0xe040d8);})[_0x882d('0x16')](function(_0x49d16f){logger[_0x882d('0x12')](_0x882d('0x17'),_0x49d16f[_0x882d('0x14')],_0x559a9b);_0x14d709(_0x22068[_0x882d('0x12')](0x1f4,_0x49d16f[_0x882d('0x14')]));});});};exports[_0x882d('0x23')]=function(_0x5806a9){var _0x21a75e=this;return new Promise(function(_0x5b2c3a,_0x41f404){return db['ChatQueue'][_0x882d('0x24')]({'raw':_0x5806a9['options']?_0x5806a9[_0x882d('0x19')][_0x882d('0x1a')]===undefined?!![]:![]:!![],'where':_0x5806a9[_0x882d('0x19')]?_0x5806a9[_0x882d('0x19')][_0x882d('0x1b')]||null:null,'attributes':_0x5806a9['options']?_0x5806a9[_0x882d('0x19')]['attributes']||null:null,'include':_0x5806a9[_0x882d('0x19')]?_0x5806a9[_0x882d('0x19')][_0x882d('0x1d')]?_[_0x882d('0x1e')](_0x5806a9[_0x882d('0x19')][_0x882d('0x1d')],function(_0x4becfa){return{'model':db[_0x4becfa['model']],'as':_0x4becfa['as'],'attributes':_0x4becfa['attributes'],'include':_0x4becfa[_0x882d('0x1d')]?_[_0x882d('0x1e')](_0x4becfa[_0x882d('0x1d')],function(_0x45b2a0){return{'model':db[_0x45b2a0[_0x882d('0x1f')]],'as':_0x45b2a0['as'],'attributes':_0x45b2a0['attributes'],'include':_0x45b2a0[_0x882d('0x1d')]?_[_0x882d('0x1e')](_0x45b2a0[_0x882d('0x1d')],function(_0x425dcf){return{'model':db[_0x425dcf[_0x882d('0x1f')]],'as':_0x425dcf['as'],'attributes':_0x425dcf[_0x882d('0x20')]};}):[]};}):[]};}):[]:[]})[_0x882d('0x21')](function(_0xdc43b3){logger[_0x882d('0xd')]('ShowChatQueue',_0x5806a9);logger['debug']('ShowChatQueue',_0x5806a9,JSON[_0x882d('0x22')](_0xdc43b3));_0x5b2c3a(_0xdc43b3);})[_0x882d('0x16')](function(_0x1aec6f){logger[_0x882d('0x12')]('ShowChatQueue',_0x1aec6f['message'],_0x5806a9);_0x41f404(_0x21a75e[_0x882d('0x12')](0x1f4,_0x1aec6f[_0x882d('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index a2a3829..7100b53 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 _0xb10b=['emit','removeListener','register','chatQueue:','./chatQueue.events','remove','update'];(function(_0x471a85,_0x239e8d){var _0x5f2039=function(_0x378952){while(--_0x378952){_0x471a85['push'](_0x471a85['shift']());}};_0x5f2039(++_0x239e8d);}(_0xb10b,0x12a));var _0xbb10=function(_0x405778,_0xa4dd3b){_0x405778=_0x405778-0x0;var _0x341735=_0xb10b[_0x405778];return _0x341735;};'use strict';var ChatQueueEvents=require(_0xbb10('0x0'));var events=['save',_0xbb10('0x1'),_0xbb10('0x2')];function createListener(_0x1dcb08,_0x4d688c){return function(_0x4541ae){_0x4d688c[_0xbb10('0x3')](_0x1dcb08,_0x4541ae);};}function removeListener(_0x460981,_0x22320e){return function(){ChatQueueEvents[_0xbb10('0x4')](_0x460981,_0x22320e);};}exports[_0xbb10('0x5')]=function(_0x481979){for(var _0x328583=0x0,_0x3cdd53=events['length'];_0x328583<_0x3cdd53;_0x328583++){var _0x1b9e94=events[_0x328583];var _0x3fb675=createListener(_0xbb10('0x6')+_0x1b9e94,_0x481979);ChatQueueEvents['on'](_0x1b9e94,_0x3fb675);}}; \ No newline at end of file +var _0x0b0e=['chatQueue:','./chatQueue.events','remove','emit','removeListener','register'];(function(_0x3172de,_0x1e5298){var _0x37233c=function(_0x27e9e8){while(--_0x27e9e8){_0x3172de['push'](_0x3172de['shift']());}};_0x37233c(++_0x1e5298);}(_0x0b0e,0x187));var _0xe0b0=function(_0x17dcd1,_0x3b7ccb){_0x17dcd1=_0x17dcd1-0x0;var _0x12af77=_0x0b0e[_0x17dcd1];return _0x12af77;};'use strict';var ChatQueueEvents=require(_0xe0b0('0x0'));var events=['save',_0xe0b0('0x1'),'update'];function createListener(_0x7e5a8a,_0xdf715e){return function(_0x3b5e2b){_0xdf715e[_0xe0b0('0x2')](_0x7e5a8a,_0x3b5e2b);};}function removeListener(_0x28040c,_0x38a058){return function(){ChatQueueEvents[_0xe0b0('0x3')](_0x28040c,_0x38a058);};}exports[_0xe0b0('0x4')]=function(_0x30e20d){for(var _0x28e40f=0x0,_0x219b1c=events['length'];_0x28e40f<_0x219b1c;_0x28e40f++){var _0x50be7f=events[_0x28e40f];var _0x11effc=createListener(_0xe0b0('0x5')+_0x50be7f,_0x30e20d);ChatQueueEvents['on'](_0x50be7f,_0x11effc);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 519fe6a..4ee0c5c 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 _0x1050=['../../config/environment','./chatQueue.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','create','post','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service'];(function(_0x5b1428,_0x45296d){var _0x31704b=function(_0x2071ea){while(--_0x2071ea){_0x5b1428['push'](_0x5b1428['shift']());}};_0x31704b(++_0x45296d);}(_0x1050,0x157));var _0x0105=function(_0x35c500,_0x4132be){_0x35c500=_0x35c500-0x0;var _0x2aa8b7=_0x1050[_0x35c500];return _0x2aa8b7;};'use strict';var multer=require('multer');var util=require(_0x0105('0x0'));var path=require(_0x0105('0x1'));var timeout=require(_0x0105('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x0105('0x3'));var interaction=require(_0x0105('0x4'));var config=require(_0x0105('0x5'));var controller=require(_0x0105('0x6'));router[_0x0105('0x7')]('/',auth[_0x0105('0x8')](),controller['index']);router[_0x0105('0x7')](_0x0105('0x9'),auth['isAuthenticated'](),controller[_0x0105('0xa')]);router[_0x0105('0x7')](_0x0105('0xb'),auth[_0x0105('0x8')](),controller[_0x0105('0xc')]);router[_0x0105('0x7')](_0x0105('0xd'),auth['isAuthenticated'](),controller[_0x0105('0xe')]);router['get'](_0x0105('0xf'),auth[_0x0105('0x8')](),controller[_0x0105('0x10')]);router[_0x0105('0x7')](_0x0105('0x11'),auth[_0x0105('0x8')](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller[_0x0105('0x12')]);router[_0x0105('0x13')](_0x0105('0xf'),auth[_0x0105('0x8')](),controller[_0x0105('0x14')]);router['post'](_0x0105('0x11'),auth[_0x0105('0x8')](),controller[_0x0105('0x15')]);router[_0x0105('0x16')](_0x0105('0xb'),auth['isAuthenticated'](),controller[_0x0105('0x17')]);router[_0x0105('0x18')]('/:id',auth[_0x0105('0x8')](),controller[_0x0105('0x19')]);router[_0x0105('0x18')](_0x0105('0xf'),auth['isAuthenticated'](),controller[_0x0105('0x1a')]);router[_0x0105('0x18')](_0x0105('0x11'),auth[_0x0105('0x8')](),controller[_0x0105('0x1b')]);module[_0x0105('0x1c')]=router; \ No newline at end of file +var _0x54b9=['create','addTeams','update','delete','/:id','destroy','removeTeams','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id/members','getMembers','/:id/teams','/:id/users','post'];(function(_0x24d22f,_0xfa6241){var _0x33b153=function(_0x28caa6){while(--_0x28caa6){_0x24d22f['push'](_0x24d22f['shift']());}};_0x33b153(++_0xfa6241);}(_0x54b9,0xc0));var _0x954b=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x54b9[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require(_0x954b('0x0'));var util=require(_0x954b('0x1'));var path=require(_0x954b('0x2'));var timeout=require(_0x954b('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x954b('0x4'));var interaction=require(_0x954b('0x5'));var config=require(_0x954b('0x6'));var controller=require('./chatQueue.controller');router[_0x954b('0x7')]('/',auth[_0x954b('0x8')](),controller['index']);router[_0x954b('0x7')]('/describe',auth[_0x954b('0x8')](),controller[_0x954b('0x9')]);router['get']('/:id',auth[_0x954b('0x8')](),controller['show']);router['get'](_0x954b('0xa'),auth[_0x954b('0x8')](),controller[_0x954b('0xb')]);router[_0x954b('0x7')](_0x954b('0xc'),auth[_0x954b('0x8')](),controller['getTeams']);router[_0x954b('0x7')](_0x954b('0xd'),auth[_0x954b('0x8')](),controller['getAgents']);router[_0x954b('0xe')]('/',auth[_0x954b('0x8')](),controller[_0x954b('0xf')]);router[_0x954b('0xe')](_0x954b('0xc'),auth[_0x954b('0x8')](),controller[_0x954b('0x10')]);router['post'](_0x954b('0xd'),auth[_0x954b('0x8')](),controller['addAgents']);router['put']('/:id',auth[_0x954b('0x8')](),controller[_0x954b('0x11')]);router[_0x954b('0x12')](_0x954b('0x13'),auth[_0x954b('0x8')](),controller[_0x954b('0x14')]);router[_0x954b('0x12')]('/:id/teams',auth[_0x954b('0x8')](),controller[_0x954b('0x15')]);router[_0x954b('0x12')](_0x954b('0xd'),auth[_0x954b('0x8')](),controller['removeAgents']);module[_0x954b('0x16')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 5b9cdab..e559399 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 _0xd105=['STRING','DATE','moment','sequelize'];(function(_0x81e0be,_0x509cab){var _0x1fa2c1=function(_0x51cb6e){while(--_0x51cb6e){_0x81e0be['push'](_0x81e0be['shift']());}};_0x1fa2c1(++_0x509cab);}(_0xd105,0x8a));var _0x5d10=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd105[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0x5d10('0x0'));var Sequelize=require(_0x5d10('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x5d10('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x5d10('0x2')]},'joinAt':{'type':Sequelize[_0x5d10('0x3')]},'leaveAt':{'type':Sequelize[_0x5d10('0x3')]},'acceptAt':{'type':Sequelize[_0x5d10('0x3')]},'exitAt':{'type':Sequelize[_0x5d10('0x3')]},'reason':{'type':Sequelize[_0x5d10('0x2')]}}; \ No newline at end of file +var _0xdf72=['DATE','moment','sequelize','exports','STRING'];(function(_0x351283,_0x5966a6){var _0x122685=function(_0x528e21){while(--_0x528e21){_0x351283['push'](_0x351283['shift']());}};_0x122685(++_0x5966a6);}(_0xdf72,0x146));var _0x2df7=function(_0x52684f,_0xff73fc){_0x52684f=_0x52684f-0x0;var _0x4a55f0=_0xdf72[_0x52684f];return _0x4a55f0;};'use strict';var moment=require(_0x2df7('0x0'));var Sequelize=require(_0x2df7('0x1'));module[_0x2df7('0x2')]={'uniqueid':{'type':Sequelize[_0x2df7('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x2df7('0x3')]},'joinAt':{'type':Sequelize[_0x2df7('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x2df7('0x4')]},'exitAt':{'type':Sequelize[_0x2df7('0x4')]},'reason':{'type':Sequelize[_0x2df7('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 9668e5a..ccc02b7 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 _0x2abd=['error','send','index','map','ChatQueueReport','rawAttributes','type','key','model','name','keys','query','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','field','options','count','include','findAll','rows','catch','fields','find','create','body','params','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy'];(function(_0x375989,_0x371b04){var _0x5dfca5=function(_0x282fe3){while(--_0x282fe3){_0x375989['push'](_0x375989['shift']());}};_0x5dfca5(++_0x371b04);}(_0x2abd,0x72));var _0xd2ab=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x2abd[_0x413feb];return _0x40ee88;};'use strict';var pdf=require(_0xd2ab('0x0'));var emlformat=require(_0xd2ab('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xd2ab('0x2'));var jsonpatch=require(_0xd2ab('0x3'));var rp=require(_0xd2ab('0x4'));var moment=require(_0xd2ab('0x5'));var BPromise=require(_0xd2ab('0x6'));var Mustache=require(_0xd2ab('0x7'));var util=require(_0xd2ab('0x8'));var path=require(_0xd2ab('0x9'));var sox=require(_0xd2ab('0xa'));var csv=require(_0xd2ab('0xb'));var ejs=require(_0xd2ab('0xc'));var fs=require('fs');var _=require(_0xd2ab('0xd'));var squel=require('squel');var crypto=require(_0xd2ab('0xe'));var jsforce=require(_0xd2ab('0xf'));var deskjs=require(_0xd2ab('0x10'));var toCsv=require(_0xd2ab('0xb'));var querystring=require('querystring');var Papa=require(_0xd2ab('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd2ab('0x12'));var as=require(_0xd2ab('0x13'));var hardwareService=require(_0xd2ab('0x14'));var logger=require(_0xd2ab('0x15'))(_0xd2ab('0x16'));var utils=require(_0xd2ab('0x17'));var config=require(_0xd2ab('0x18'));var db=require(_0xd2ab('0x19'))['db'];function respondWithStatusCode(_0x104ac0,_0x5618e8){_0x5618e8=_0x5618e8||0xcc;return function(_0x4e8677){if(_0x4e8677){return _0x104ac0[_0xd2ab('0x1a')](_0x5618e8);}return _0x104ac0[_0xd2ab('0x1b')](_0x5618e8)[_0xd2ab('0x1c')]();};}function respondWithResult(_0x8933f5,_0x388137){_0x388137=_0x388137||0xc8;return function(_0x1ab6bd){if(_0x1ab6bd){return _0x8933f5[_0xd2ab('0x1b')](_0x388137)[_0xd2ab('0x1d')](_0x1ab6bd);}};}function respondWithFilteredResult(_0x6d3e3f,_0x37a00b){return function(_0x2f7ab5){if(_0x2f7ab5){var _0xf4c83c=_0x2f7ab5['count'],_0x4df135=_0x37a00b[_0xd2ab('0x1e')],_0xa9fcb8=_0x37a00b['offset']+_0x37a00b[_0xd2ab('0x1f')],_0x26cf0c;if(_0xa9fcb8>=_0xf4c83c){_0xa9fcb8=_0xf4c83c;_0x26cf0c=0xc8;}else{_0x26cf0c=0xce;}_0x6d3e3f['status'](_0x26cf0c);return _0x6d3e3f[_0xd2ab('0x20')](_0xd2ab('0x21'),_0x4df135+'-'+_0xa9fcb8+'/'+_0xf4c83c)['json'](_0x2f7ab5);}return null;};}function patchUpdates(_0x18a3a5){return function(_0x4f83a7){try{jsonpatch[_0xd2ab('0x22')](_0x4f83a7,_0x18a3a5,!![]);}catch(_0x2bc663){return BPromise[_0xd2ab('0x23')](_0x2bc663);}return _0x4f83a7[_0xd2ab('0x24')]();};}function saveUpdates(_0x452e0a,_0x122f48){return function(_0x542331){if(_0x542331){return _0x542331[_0xd2ab('0x25')](_0x452e0a)[_0xd2ab('0x26')](function(_0xc19989){return _0xc19989;});}return null;};}function removeEntity(_0x1559e9,_0x2c3fcc){return function(_0x21cdc0){if(_0x21cdc0){return _0x21cdc0[_0xd2ab('0x27')]()[_0xd2ab('0x26')](function(){_0x1559e9[_0xd2ab('0x1b')](0xcc)[_0xd2ab('0x1c')]();});}};}function handleEntityNotFound(_0x42fe0d,_0xaacbab){return function(_0x4f52bf){if(!_0x4f52bf){_0x42fe0d['sendStatus'](0x194);}return _0x4f52bf;};}function handleError(_0x3af511,_0x58584a){_0x58584a=_0x58584a||0x1f4;return function(_0x3638e5){logger[_0xd2ab('0x28')](_0x3638e5['stack']);if(_0x3638e5['name']){delete _0x3638e5['name'];}_0x3af511[_0xd2ab('0x1b')](_0x58584a)[_0xd2ab('0x29')](_0x3638e5);};}exports[_0xd2ab('0x2a')]=function(_0x5c0db9,_0x582350){var _0x20b61b={},_0x349998={},_0x505ef0={'count':0x0,'rows':[]};var _0x3345b0=_[_0xd2ab('0x2b')](db[_0xd2ab('0x2c')][_0xd2ab('0x2d')],function(_0x395ac2){return{'name':_0x395ac2['fieldName'],'type':_0x395ac2[_0xd2ab('0x2e')][_0xd2ab('0x2f')]};});_0x349998[_0xd2ab('0x30')]=_[_0xd2ab('0x2b')](_0x3345b0,_0xd2ab('0x31'));_0x349998['query']=_[_0xd2ab('0x32')](_0x5c0db9[_0xd2ab('0x33')]);_0x349998[_0xd2ab('0x34')]=_[_0xd2ab('0x35')](_0x349998[_0xd2ab('0x30')],_0x349998[_0xd2ab('0x33')]);_0x20b61b['attributes']=_['intersection'](_0x349998[_0xd2ab('0x30')],qs['fields'](_0x5c0db9[_0xd2ab('0x33')]['fields']));_0x20b61b[_0xd2ab('0x36')]=_0x20b61b['attributes'][_0xd2ab('0x37')]?_0x20b61b[_0xd2ab('0x36')]:_0x349998[_0xd2ab('0x30')];if(!_0x5c0db9[_0xd2ab('0x33')][_0xd2ab('0x38')]('nolimit')){_0x20b61b['limit']=qs[_0xd2ab('0x1f')](_0x5c0db9[_0xd2ab('0x33')]['limit']);_0x20b61b[_0xd2ab('0x1e')]=qs['offset'](_0x5c0db9['query']['offset']);}_0x20b61b[_0xd2ab('0x39')]=qs[_0xd2ab('0x3a')](_0x5c0db9['query'][_0xd2ab('0x3a')]);_0x20b61b[_0xd2ab('0x3b')]=qs[_0xd2ab('0x34')](_[_0xd2ab('0x3c')](_0x5c0db9['query'],_0x349998[_0xd2ab('0x34')]));if(_0x5c0db9[_0xd2ab('0x33')][_0xd2ab('0x3d')]){_0x20b61b[_0xd2ab('0x3b')]=_[_0xd2ab('0x3e')](_0x20b61b[_0xd2ab('0x3b')],{'$or':_[_0xd2ab('0x2b')](_0x3345b0,function(_0x45435a){if(_0x45435a[_0xd2ab('0x2e')][_0xd2ab('0x2f')]!==_0xd2ab('0x3f')){var _0x798219={};_0x798219[_0x45435a[_0xd2ab('0x40')]]={'$like':'%'+_0x5c0db9['query'][_0xd2ab('0x3d')]+'%'};return _0x798219;}})});}_0x20b61b=_['merge']({},_0x20b61b,_0x5c0db9[_0xd2ab('0x41')]);var _0x26eda5={'where':_0x20b61b['where']};return db[_0xd2ab('0x2c')]['count'](_0x26eda5)[_0xd2ab('0x26')](function(_0x5a9e2e){_0x505ef0[_0xd2ab('0x42')]=_0x5a9e2e;if(_0x5c0db9[_0xd2ab('0x33')]['includeAll']){_0x20b61b[_0xd2ab('0x43')]=[{'all':!![]}];}return db[_0xd2ab('0x2c')][_0xd2ab('0x44')](_0x20b61b);})[_0xd2ab('0x26')](function(_0x22c3f5){_0x505ef0[_0xd2ab('0x45')]=_0x22c3f5;return _0x505ef0;})['then'](respondWithFilteredResult(_0x582350,_0x20b61b))[_0xd2ab('0x46')](handleError(_0x582350,null));};exports['show']=function(_0x261982,_0x10550c){var _0x345398={'raw':!![],'where':{'id':_0x261982['params']['id']}},_0x1c808a={};_0x1c808a[_0xd2ab('0x30')]=_[_0xd2ab('0x32')](db[_0xd2ab('0x2c')]['rawAttributes']);_0x1c808a[_0xd2ab('0x33')]=_[_0xd2ab('0x32')](_0x261982[_0xd2ab('0x33')]);_0x1c808a[_0xd2ab('0x34')]=_[_0xd2ab('0x35')](_0x1c808a['model'],_0x1c808a['query']);_0x345398[_0xd2ab('0x36')]=_[_0xd2ab('0x35')](_0x1c808a['model'],qs['fields'](_0x261982[_0xd2ab('0x33')][_0xd2ab('0x47')]));_0x345398[_0xd2ab('0x36')]=_0x345398['attributes']['length']?_0x345398[_0xd2ab('0x36')]:_0x1c808a[_0xd2ab('0x30')];if(_0x261982[_0xd2ab('0x33')]['includeAll']){_0x345398['include']=[{'all':!![]}];}_0x345398=_[_0xd2ab('0x3e')]({},_0x345398,_0x261982['options']);return db[_0xd2ab('0x2c')][_0xd2ab('0x48')](_0x345398)[_0xd2ab('0x26')](handleEntityNotFound(_0x10550c,null))[_0xd2ab('0x26')](respondWithResult(_0x10550c,null))[_0xd2ab('0x46')](handleError(_0x10550c,null));};exports[_0xd2ab('0x49')]=function(_0x4406ac,_0x2030d9){return db[_0xd2ab('0x2c')][_0xd2ab('0x49')](_0x4406ac[_0xd2ab('0x4a')],{})['then'](respondWithResult(_0x2030d9,0xc9))['catch'](handleError(_0x2030d9,null));};exports[_0xd2ab('0x25')]=function(_0x3623c4,_0x17a5a2){if(_0x3623c4[_0xd2ab('0x4a')]['id']){delete _0x3623c4[_0xd2ab('0x4a')]['id'];}return db['ChatQueueReport'][_0xd2ab('0x48')]({'where':{'id':_0x3623c4[_0xd2ab('0x4b')]['id']}})[_0xd2ab('0x26')](handleEntityNotFound(_0x17a5a2,null))[_0xd2ab('0x26')](saveUpdates(_0x3623c4[_0xd2ab('0x4a')],null))['then'](respondWithResult(_0x17a5a2,null))[_0xd2ab('0x46')](handleError(_0x17a5a2,null));};exports['destroy']=function(_0x266719,_0x323ca9){return db[_0xd2ab('0x2c')][_0xd2ab('0x48')]({'where':{'id':_0x266719['params']['id']}})[_0xd2ab('0x26')](handleEntityNotFound(_0x323ca9,null))['then'](removeEntity(_0x323ca9,null))['catch'](handleError(_0x323ca9,null));};exports['describe']=function(_0x1da50c,_0x22f8f0){return db[_0xd2ab('0x2c')][_0xd2ab('0x4c')]()[_0xd2ab('0x26')](respondWithResult(_0x22f8f0,null))[_0xd2ab('0x46')](handleError(_0x22f8f0,null));}; \ No newline at end of file +var _0x8556=['fieldName','type','key','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','field','options','includeAll','include','rows','catch','show','params','keys','find','create','body','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','set','Content-Range','json','reject','save','update','then','destroy','end','error','name','ChatQueueReport','rawAttributes'];(function(_0x376a9f,_0x602742){var _0x5dfc90=function(_0x52c597){while(--_0x52c597){_0x376a9f['push'](_0x376a9f['shift']());}};_0x5dfc90(++_0x602742);}(_0x8556,0x1da));var _0x6855=function(_0xd2dfeb,_0x51aa27){_0xd2dfeb=_0xd2dfeb-0x0;var _0x313172=_0x8556[_0xd2dfeb];return _0x313172;};'use strict';var pdf=require(_0x6855('0x0'));var emlformat=require(_0x6855('0x1'));var rimraf=require(_0x6855('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6855('0x3'));var rp=require(_0x6855('0x4'));var moment=require(_0x6855('0x5'));var BPromise=require(_0x6855('0x6'));var Mustache=require(_0x6855('0x7'));var util=require(_0x6855('0x8'));var path=require(_0x6855('0x9'));var sox=require(_0x6855('0xa'));var csv=require(_0x6855('0xb'));var ejs=require(_0x6855('0xc'));var fs=require('fs');var _=require(_0x6855('0xd'));var squel=require('squel');var crypto=require(_0x6855('0xe'));var jsforce=require(_0x6855('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x6855('0xb'));var querystring=require(_0x6855('0x10'));var Papa=require(_0x6855('0x11'));var Redis=require(_0x6855('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x6855('0x13'));var as=require(_0x6855('0x14'));var hardwareService=require(_0x6855('0x15'));var logger=require('../../config/logger')(_0x6855('0x16'));var utils=require(_0x6855('0x17'));var config=require(_0x6855('0x18'));var db=require(_0x6855('0x19'))['db'];function respondWithStatusCode(_0x2156a4,_0x42a558){_0x42a558=_0x42a558||0xcc;return function(_0x21417f){if(_0x21417f){return _0x2156a4[_0x6855('0x1a')](_0x42a558);}return _0x2156a4[_0x6855('0x1b')](_0x42a558)['end']();};}function respondWithResult(_0x25c6a6,_0x250071){_0x250071=_0x250071||0xc8;return function(_0x3c9fc3){if(_0x3c9fc3){return _0x25c6a6[_0x6855('0x1b')](_0x250071)['json'](_0x3c9fc3);}};}function respondWithFilteredResult(_0x580d54,_0x47dce7){return function(_0x3c9b19){if(_0x3c9b19){var _0x4b5422=_0x3c9b19[_0x6855('0x1c')],_0x523fb4=_0x47dce7['offset'],_0x35773a=_0x47dce7[_0x6855('0x1d')]+_0x47dce7[_0x6855('0x1e')],_0x392ff1;if(_0x35773a>=_0x4b5422){_0x35773a=_0x4b5422;_0x392ff1=0xc8;}else{_0x392ff1=0xce;}_0x580d54[_0x6855('0x1b')](_0x392ff1);return _0x580d54[_0x6855('0x1f')](_0x6855('0x20'),_0x523fb4+'-'+_0x35773a+'/'+_0x4b5422)[_0x6855('0x21')](_0x3c9b19);}return null;};}function patchUpdates(_0x4766b0){return function(_0x595a61){try{jsonpatch['apply'](_0x595a61,_0x4766b0,!![]);}catch(_0x484ed9){return BPromise[_0x6855('0x22')](_0x484ed9);}return _0x595a61[_0x6855('0x23')]();};}function saveUpdates(_0x555c97,_0x3fd295){return function(_0x1d454f){if(_0x1d454f){return _0x1d454f[_0x6855('0x24')](_0x555c97)[_0x6855('0x25')](function(_0x589fa4){return _0x589fa4;});}return null;};}function removeEntity(_0x4b3746,_0x78a466){return function(_0x4160c5){if(_0x4160c5){return _0x4160c5[_0x6855('0x26')]()['then'](function(){_0x4b3746[_0x6855('0x1b')](0xcc)[_0x6855('0x27')]();});}};}function handleEntityNotFound(_0x5d9c1e,_0x5a589c){return function(_0x2db098){if(!_0x2db098){_0x5d9c1e[_0x6855('0x1a')](0x194);}return _0x2db098;};}function handleError(_0x3c5372,_0x3e677f){_0x3e677f=_0x3e677f||0x1f4;return function(_0x119bdd){logger[_0x6855('0x28')](_0x119bdd['stack']);if(_0x119bdd['name']){delete _0x119bdd[_0x6855('0x29')];}_0x3c5372[_0x6855('0x1b')](_0x3e677f)['send'](_0x119bdd);};}exports['index']=function(_0x4e0053,_0x48f021){var _0x25b243={},_0x546ea5={},_0x3b64f6={'count':0x0,'rows':[]};var _0x1a4c8e=_['map'](db[_0x6855('0x2a')][_0x6855('0x2b')],function(_0x34022b){return{'name':_0x34022b[_0x6855('0x2c')],'type':_0x34022b[_0x6855('0x2d')][_0x6855('0x2e')]};});_0x546ea5[_0x6855('0x2f')]=_[_0x6855('0x30')](_0x1a4c8e,_0x6855('0x29'));_0x546ea5[_0x6855('0x31')]=_['keys'](_0x4e0053[_0x6855('0x31')]);_0x546ea5[_0x6855('0x32')]=_['intersection'](_0x546ea5['model'],_0x546ea5[_0x6855('0x31')]);_0x25b243[_0x6855('0x33')]=_[_0x6855('0x34')](_0x546ea5['model'],qs['fields'](_0x4e0053[_0x6855('0x31')][_0x6855('0x35')]));_0x25b243['attributes']=_0x25b243[_0x6855('0x33')][_0x6855('0x36')]?_0x25b243['attributes']:_0x546ea5[_0x6855('0x2f')];if(!_0x4e0053[_0x6855('0x31')][_0x6855('0x37')](_0x6855('0x38'))){_0x25b243[_0x6855('0x1e')]=qs[_0x6855('0x1e')](_0x4e0053[_0x6855('0x31')]['limit']);_0x25b243[_0x6855('0x1d')]=qs[_0x6855('0x1d')](_0x4e0053[_0x6855('0x31')][_0x6855('0x1d')]);}_0x25b243[_0x6855('0x39')]=qs[_0x6855('0x3a')](_0x4e0053[_0x6855('0x31')][_0x6855('0x3a')]);_0x25b243['where']=qs[_0x6855('0x32')](_['pick'](_0x4e0053[_0x6855('0x31')],_0x546ea5[_0x6855('0x32')]));if(_0x4e0053[_0x6855('0x31')]['filter']){_0x25b243[_0x6855('0x3b')]=_[_0x6855('0x3c')](_0x25b243[_0x6855('0x3b')],{'$or':_[_0x6855('0x30')](_0x1a4c8e,function(_0x42b3db){if(_0x42b3db['type'][_0x6855('0x2e')]!=='VIRTUAL'){var _0x2e5bdf={};_0x2e5bdf[_0x42b3db[_0x6855('0x3d')]]={'$like':'%'+_0x4e0053[_0x6855('0x31')]['filter']+'%'};return _0x2e5bdf;}})});}_0x25b243=_[_0x6855('0x3c')]({},_0x25b243,_0x4e0053[_0x6855('0x3e')]);var _0x2580a5={'where':_0x25b243[_0x6855('0x3b')]};return db[_0x6855('0x2a')][_0x6855('0x1c')](_0x2580a5)[_0x6855('0x25')](function(_0x463bbf){_0x3b64f6[_0x6855('0x1c')]=_0x463bbf;if(_0x4e0053[_0x6855('0x31')][_0x6855('0x3f')]){_0x25b243[_0x6855('0x40')]=[{'all':!![]}];}return db['ChatQueueReport']['findAll'](_0x25b243);})['then'](function(_0x91e52f){_0x3b64f6[_0x6855('0x41')]=_0x91e52f;return _0x3b64f6;})[_0x6855('0x25')](respondWithFilteredResult(_0x48f021,_0x25b243))[_0x6855('0x42')](handleError(_0x48f021,null));};exports[_0x6855('0x43')]=function(_0x3d1849,_0x42c8bd){var _0x4f7388={'raw':!![],'where':{'id':_0x3d1849[_0x6855('0x44')]['id']}},_0x7fa40d={};_0x7fa40d[_0x6855('0x2f')]=_[_0x6855('0x45')](db[_0x6855('0x2a')][_0x6855('0x2b')]);_0x7fa40d[_0x6855('0x31')]=_[_0x6855('0x45')](_0x3d1849[_0x6855('0x31')]);_0x7fa40d[_0x6855('0x32')]=_[_0x6855('0x34')](_0x7fa40d[_0x6855('0x2f')],_0x7fa40d[_0x6855('0x31')]);_0x4f7388[_0x6855('0x33')]=_[_0x6855('0x34')](_0x7fa40d[_0x6855('0x2f')],qs[_0x6855('0x35')](_0x3d1849[_0x6855('0x31')][_0x6855('0x35')]));_0x4f7388[_0x6855('0x33')]=_0x4f7388['attributes'][_0x6855('0x36')]?_0x4f7388[_0x6855('0x33')]:_0x7fa40d[_0x6855('0x2f')];if(_0x3d1849[_0x6855('0x31')][_0x6855('0x3f')]){_0x4f7388[_0x6855('0x40')]=[{'all':!![]}];}_0x4f7388=_[_0x6855('0x3c')]({},_0x4f7388,_0x3d1849['options']);return db[_0x6855('0x2a')][_0x6855('0x46')](_0x4f7388)[_0x6855('0x25')](handleEntityNotFound(_0x42c8bd,null))[_0x6855('0x25')](respondWithResult(_0x42c8bd,null))[_0x6855('0x42')](handleError(_0x42c8bd,null));};exports['create']=function(_0x126b91,_0x3130fb){return db[_0x6855('0x2a')][_0x6855('0x47')](_0x126b91[_0x6855('0x48')],{})['then'](respondWithResult(_0x3130fb,0xc9))[_0x6855('0x42')](handleError(_0x3130fb,null));};exports[_0x6855('0x24')]=function(_0x47967b,_0x4f77b7){if(_0x47967b[_0x6855('0x48')]['id']){delete _0x47967b['body']['id'];}return db[_0x6855('0x2a')]['find']({'where':{'id':_0x47967b['params']['id']}})[_0x6855('0x25')](handleEntityNotFound(_0x4f77b7,null))[_0x6855('0x25')](saveUpdates(_0x47967b[_0x6855('0x48')],null))[_0x6855('0x25')](respondWithResult(_0x4f77b7,null))[_0x6855('0x42')](handleError(_0x4f77b7,null));};exports[_0x6855('0x26')]=function(_0x52147f,_0x3e010d){return db[_0x6855('0x2a')]['find']({'where':{'id':_0x52147f['params']['id']}})[_0x6855('0x25')](handleEntityNotFound(_0x3e010d,null))[_0x6855('0x25')](removeEntity(_0x3e010d,null))[_0x6855('0x42')](handleError(_0x3e010d,null));};exports['describe']=function(_0x4d9f47,_0x4968a1){return db[_0x6855('0x2a')][_0x6855('0x49')]()[_0x6855('0x25')](respondWithResult(_0x4968a1,null))['catch'](handleError(_0x4968a1,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 517ba83..30845a1 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 _0x1369=['define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','./chatQueueReport.attributes','exports'];(function(_0x391ad0,_0x554c01){var _0x94f53b=function(_0x37d5be){while(--_0x37d5be){_0x391ad0['push'](_0x391ad0['shift']());}};_0x94f53b(++_0x554c01);}(_0x1369,0xe1));var _0x9136=function(_0x471932,_0x16536d){_0x471932=_0x471932-0x0;var _0x28198c=_0x1369[_0x471932];return _0x28198c;};'use strict';var _=require(_0x9136('0x0'));var util=require(_0x9136('0x1'));var logger=require(_0x9136('0x2'))('api');var moment=require(_0x9136('0x3'));var BPromise=require(_0x9136('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9136('0x5'));var rimraf=require(_0x9136('0x6'));var config=require('../../config/environment');var attributes=require(_0x9136('0x7'));module[_0x9136('0x8')]=function(_0x2af998,_0x250a7){return _0x2af998[_0x9136('0x9')](_0x9136('0xa'),attributes,{'tableName':_0x9136('0xb'),'paranoid':![],'indexes':[{'name':_0x9136('0xc'),'fields':[_0x9136('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7d2b=['define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./chatQueueReport.attributes'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x7d2b,0xd4));var _0xb7d2=function(_0x85d80c,_0x19871e){_0x85d80c=_0x85d80c-0x0;var _0xf6332b=_0x7d2b[_0x85d80c];return _0xf6332b;};'use strict';var _=require(_0xb7d2('0x0'));var util=require(_0xb7d2('0x1'));var logger=require(_0xb7d2('0x2'))(_0xb7d2('0x3'));var moment=require(_0xb7d2('0x4'));var BPromise=require(_0xb7d2('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb7d2('0x6'));var rimraf=require('rimraf');var config=require(_0xb7d2('0x7'));var attributes=require(_0xb7d2('0x8'));module['exports']=function(_0x2ff90a,_0x4df649){return _0x2ff90a[_0xb7d2('0x9')](_0xb7d2('0xa'),attributes,{'tableName':_0xb7d2('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xb7d2('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 2981e9d..519a2d5 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 _0xa108=['ChatQueueReport,\x20%s,\x20%s','message','result','catch','ChatQueueReport','options','raw','CreateChatQueueReport','stringify','UpdateChatQueueReport','update','body','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x5df5e1,_0x3e0305){var _0x2fffd3=function(_0x532a7c){while(--_0x532a7c){_0x5df5e1['push'](_0x5df5e1['shift']());}};_0x2fffd3(++_0x3e0305);}(_0xa108,0x104));var _0x8a10=function(_0x5aa067,_0x2656ea){_0x5aa067=_0x5aa067-0x0;var _0x2210ae=_0xa108[_0x5aa067];return _0x2210ae;};'use strict';var _=require(_0x8a10('0x0'));var util=require(_0x8a10('0x1'));var moment=require(_0x8a10('0x2'));var BPromise=require(_0x8a10('0x3'));var rs=require(_0x8a10('0x4'));var fs=require('fs');var Redis=require(_0x8a10('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8a10('0x6'));var logger=require(_0x8a10('0x7'))(_0x8a10('0x8'));var config=require(_0x8a10('0x9'));var jayson=require(_0x8a10('0xa'));var client=jayson['client'][_0x8a10('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3128ae,_0x5f357e,_0xa6a8fb){return new BPromise(function(_0x17776,_0x2cb3f1){return client[_0x8a10('0xc')](_0x3128ae,_0xa6a8fb)[_0x8a10('0xd')](function(_0xfac78b){logger[_0x8a10('0xe')]('ChatQueueReport,\x20%s,\x20%s',_0x5f357e,'request\x20sent');logger[_0x8a10('0xf')](_0x8a10('0x10'),_0x5f357e,_0x8a10('0x11'),JSON['stringify'](_0xfac78b));if(_0xfac78b['error']){if(_0xfac78b[_0x8a10('0x12')][_0x8a10('0x13')]===0x1f4){logger[_0x8a10('0x12')](_0x8a10('0x14'),_0x5f357e,_0xfac78b[_0x8a10('0x12')][_0x8a10('0x15')]);return _0x2cb3f1(_0xfac78b[_0x8a10('0x12')][_0x8a10('0x15')]);}logger[_0x8a10('0x12')]('ChatQueueReport,\x20%s,\x20%s',_0x5f357e,_0xfac78b['error'][_0x8a10('0x15')]);return _0x17776(_0xfac78b['error'][_0x8a10('0x15')]);}else{logger[_0x8a10('0xe')](_0x8a10('0x14'),_0x5f357e,_0x8a10('0x11'));_0x17776(_0xfac78b[_0x8a10('0x16')][_0x8a10('0x15')]);}})[_0x8a10('0x17')](function(_0x406be5){logger['error'](_0x8a10('0x14'),_0x5f357e,_0x406be5);_0x2cb3f1(_0x406be5);});});}exports['CreateChatQueueReport']=function(_0x376722){var _0x19f002=this;return new Promise(function(_0x3f463a,_0x9d7ae8){return db[_0x8a10('0x18')]['create'](_0x376722['body'],{'raw':_0x376722[_0x8a10('0x19')]?_0x376722[_0x8a10('0x19')][_0x8a10('0x1a')]===undefined?!![]:![]:!![]})[_0x8a10('0xd')](function(_0x173adb){logger['info']('CreateChatQueueReport',_0x376722);logger[_0x8a10('0xf')](_0x8a10('0x1b'),_0x376722,JSON[_0x8a10('0x1c')](_0x173adb));_0x3f463a(_0x173adb);})[_0x8a10('0x17')](function(_0x24aff0){logger[_0x8a10('0x12')]('CreateChatQueueReport',_0x24aff0['message'],_0x376722);_0x9d7ae8(_0x19f002[_0x8a10('0x12')](0x1f4,_0x24aff0['message']));});});};exports[_0x8a10('0x1d')]=function(_0x4e80bd){var _0x3515df=this;return new Promise(function(_0x3f2201,_0x31276e){return db[_0x8a10('0x18')][_0x8a10('0x1e')](_0x4e80bd[_0x8a10('0x1f')],{'raw':_0x4e80bd[_0x8a10('0x19')]?_0x4e80bd['options'][_0x8a10('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e80bd[_0x8a10('0x19')]?_0x4e80bd[_0x8a10('0x19')][_0x8a10('0x20')]||null:null,'attributes':_0x4e80bd[_0x8a10('0x19')]?_0x4e80bd[_0x8a10('0x19')][_0x8a10('0x21')]||null:null,'limit':_0x4e80bd[_0x8a10('0x19')]?_0x4e80bd[_0x8a10('0x19')][_0x8a10('0x22')]||null:null})[_0x8a10('0xd')](function(_0x17c546){logger[_0x8a10('0xe')](_0x8a10('0x1d'),_0x4e80bd);logger[_0x8a10('0xf')](_0x8a10('0x1d'),_0x4e80bd,JSON[_0x8a10('0x1c')](_0x17c546));_0x3f2201(_0x17c546);})[_0x8a10('0x17')](function(_0x5b0baa){logger[_0x8a10('0x12')](_0x8a10('0x1d'),_0x5b0baa['message'],_0x4e80bd);_0x31276e(_0x3515df[_0x8a10('0x12')](0x1f4,_0x5b0baa[_0x8a10('0x15')]));});});}; \ No newline at end of file +var _0x3b87=['update','where','attributes','limit','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ChatQueueReport,\x20%s,\x20%s','message','result','catch','CreateChatQueueReport','create','body','options','raw','UpdateChatQueueReport','ChatQueueReport'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0x3b87,0x190));var _0x73b8=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x3b87[_0x160c73];return _0xd9302;};'use strict';var _=require(_0x73b8('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x73b8('0x1'));var rs=require(_0x73b8('0x2'));var fs=require('fs');var Redis=require(_0x73b8('0x3'));var db=require(_0x73b8('0x4'))['db'];var utils=require(_0x73b8('0x5'));var logger=require(_0x73b8('0x6'))(_0x73b8('0x7'));var config=require(_0x73b8('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x73b8('0x9')][_0x73b8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x26be15,_0x8d2cd0,_0x11b019){return new BPromise(function(_0x3667aa,_0x2f6f1d){return client['request'](_0x26be15,_0x11b019)[_0x73b8('0xb')](function(_0x54ef8e){logger[_0x73b8('0xc')]('ChatQueueReport,\x20%s,\x20%s',_0x8d2cd0,'request\x20sent');logger[_0x73b8('0xd')](_0x73b8('0xe'),_0x8d2cd0,_0x73b8('0xf'),JSON[_0x73b8('0x10')](_0x54ef8e));if(_0x54ef8e[_0x73b8('0x11')]){if(_0x54ef8e[_0x73b8('0x11')]['code']===0x1f4){logger['error'](_0x73b8('0x12'),_0x8d2cd0,_0x54ef8e[_0x73b8('0x11')][_0x73b8('0x13')]);return _0x2f6f1d(_0x54ef8e[_0x73b8('0x11')][_0x73b8('0x13')]);}logger[_0x73b8('0x11')](_0x73b8('0x12'),_0x8d2cd0,_0x54ef8e['error'][_0x73b8('0x13')]);return _0x3667aa(_0x54ef8e[_0x73b8('0x11')][_0x73b8('0x13')]);}else{logger[_0x73b8('0xc')](_0x73b8('0x12'),_0x8d2cd0,_0x73b8('0xf'));_0x3667aa(_0x54ef8e[_0x73b8('0x14')][_0x73b8('0x13')]);}})[_0x73b8('0x15')](function(_0x5ba06e){logger[_0x73b8('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x8d2cd0,_0x5ba06e);_0x2f6f1d(_0x5ba06e);});});}exports[_0x73b8('0x16')]=function(_0x53731c){var _0xc03611=this;return new Promise(function(_0x12ade0,_0xebb37e){return db['ChatQueueReport'][_0x73b8('0x17')](_0x53731c[_0x73b8('0x18')],{'raw':_0x53731c['options']?_0x53731c[_0x73b8('0x19')][_0x73b8('0x1a')]===undefined?!![]:![]:!![]})[_0x73b8('0xb')](function(_0x2e41bb){logger[_0x73b8('0xc')](_0x73b8('0x16'),_0x53731c);logger['debug'](_0x73b8('0x16'),_0x53731c,JSON[_0x73b8('0x10')](_0x2e41bb));_0x12ade0(_0x2e41bb);})[_0x73b8('0x15')](function(_0x33796d){logger[_0x73b8('0x11')](_0x73b8('0x16'),_0x33796d['message'],_0x53731c);_0xebb37e(_0xc03611['error'](0x1f4,_0x33796d[_0x73b8('0x13')]));});});};exports[_0x73b8('0x1b')]=function(_0xdf091c){var _0x1d6757=this;return new Promise(function(_0x3ceb5e,_0x2f8834){return db[_0x73b8('0x1c')][_0x73b8('0x1d')](_0xdf091c[_0x73b8('0x18')],{'raw':_0xdf091c['options']?_0xdf091c[_0x73b8('0x19')][_0x73b8('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xdf091c[_0x73b8('0x19')]?_0xdf091c[_0x73b8('0x19')][_0x73b8('0x1e')]||null:null,'attributes':_0xdf091c[_0x73b8('0x19')]?_0xdf091c[_0x73b8('0x19')][_0x73b8('0x1f')]||null:null,'limit':_0xdf091c[_0x73b8('0x19')]?_0xdf091c[_0x73b8('0x19')][_0x73b8('0x20')]||null:null})[_0x73b8('0xb')](function(_0x1df11a){logger[_0x73b8('0xc')](_0x73b8('0x1b'),_0xdf091c);logger['debug'](_0x73b8('0x1b'),_0xdf091c,JSON['stringify'](_0x1df11a));_0x3ceb5e(_0x1df11a);})[_0x73b8('0x15')](function(_0x3a3b48){logger[_0x73b8('0x11')](_0x73b8('0x1b'),_0x3a3b48[_0x73b8('0x13')],_0xdf091c);_0x2f8834(_0x1d6757[_0x73b8('0x11')](0x1f4,_0x3a3b48[_0x73b8('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index f41782d..f2574cb 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 _0x183e=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','isAuthenticated','get','/describe','describe','/:id','show','post','create','put','update','destroy','exports'];(function(_0xdf986b,_0x5433e8){var _0x1f8502=function(_0x5cedbc){while(--_0x5cedbc){_0xdf986b['push'](_0xdf986b['shift']());}};_0x1f8502(++_0x5433e8);}(_0x183e,0x111));var _0xe183=function(_0x4bc310,_0x36c272){_0x4bc310=_0x4bc310-0x0;var _0x460218=_0x183e[_0x4bc310];return _0x460218;};'use strict';var multer=require('multer');var util=require(_0xe183('0x0'));var path=require(_0xe183('0x1'));var timeout=require(_0xe183('0x2'));var express=require(_0xe183('0x3'));var router=express[_0xe183('0x4')]();var auth=require(_0xe183('0x5'));var interaction=require(_0xe183('0x6'));var config=require(_0xe183('0x7'));var controller=require(_0xe183('0x8'));router['get']('/',auth[_0xe183('0x9')](),controller['index']);router[_0xe183('0xa')](_0xe183('0xb'),auth[_0xe183('0x9')](),controller[_0xe183('0xc')]);router[_0xe183('0xa')](_0xe183('0xd'),auth[_0xe183('0x9')](),controller[_0xe183('0xe')]);router[_0xe183('0xf')]('/',auth['isAuthenticated'](),controller[_0xe183('0x10')]);router[_0xe183('0x11')](_0xe183('0xd'),auth['isAuthenticated'](),controller[_0xe183('0x12')]);router['delete']('/:id',auth[_0xe183('0x9')](),controller[_0xe183('0x13')]);module[_0xe183('0x14')]=router; \ No newline at end of file +var _0x220d=['show','put','update','destroy','multer','util','path','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id'];(function(_0x581ce4,_0x4495a3){var _0x46df4a=function(_0x2204ef){while(--_0x2204ef){_0x581ce4['push'](_0x581ce4['shift']());}};_0x46df4a(++_0x4495a3);}(_0x220d,0x194));var _0xd220=function(_0x11f033,_0x1198b7){_0x11f033=_0x11f033-0x0;var _0x5a9f69=_0x220d[_0x11f033];return _0x5a9f69;};'use strict';var multer=require(_0xd220('0x0'));var util=require(_0xd220('0x1'));var path=require(_0xd220('0x2'));var timeout=require('connect-timeout');var express=require(_0xd220('0x3'));var router=express[_0xd220('0x4')]();var auth=require(_0xd220('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd220('0x6'));var controller=require('./chatQueueReport.controller');router[_0xd220('0x7')]('/',auth[_0xd220('0x8')](),controller['index']);router[_0xd220('0x7')](_0xd220('0x9'),auth[_0xd220('0x8')](),controller[_0xd220('0xa')]);router[_0xd220('0x7')](_0xd220('0xb'),auth[_0xd220('0x8')](),controller[_0xd220('0xc')]);router['post']('/',auth[_0xd220('0x8')](),controller['create']);router[_0xd220('0xd')](_0xd220('0xb'),auth[_0xd220('0x8')](),controller[_0xd220('0xe')]);router['delete'](_0xd220('0xb'),auth[_0xd220('0x8')](),controller[_0xd220('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index d4309b1..106fa68 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 _0x61b4=['moment','sequelize','exports','STRING','agent','queue','DATE','NOW'];(function(_0x1ae6b8,_0x449a54){var _0x369328=function(_0x53a265){while(--_0x53a265){_0x1ae6b8['push'](_0x1ae6b8['shift']());}};_0x369328(++_0x449a54);}(_0x61b4,0x168));var _0x461b=function(_0x11356c,_0x2c0d4c){_0x11356c=_0x11356c-0x0;var _0x81266a=_0x61b4[_0x11356c];return _0x81266a;};'use strict';var moment=require(_0x461b('0x0'));var Sequelize=require(_0x461b('0x1'));module[_0x461b('0x2')]={'uniqueid':{'type':Sequelize[_0x461b('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('account',_0x461b('0x4'),_0x461b('0x5')),'allowNull':![],'defaultValue':_0x461b('0x5')},'transferredAt':{'type':Sequelize[_0x461b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0x461b('0x7')]}}; \ No newline at end of file +var _0x6b7f=['DATE','NOW','moment','sequelize','exports','STRING','ENUM','account','agent','queue'];(function(_0xce9195,_0x1963e1){var _0x530fe6=function(_0x1b8055){while(--_0x1b8055){_0xce9195['push'](_0xce9195['shift']());}};_0x530fe6(++_0x1963e1);}(_0x6b7f,0xd4));var _0xf6b7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6b7f[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0xf6b7('0x0'));var Sequelize=require(_0xf6b7('0x1'));module[_0xf6b7('0x2')]={'uniqueid':{'type':Sequelize[_0xf6b7('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xf6b7('0x4')](_0xf6b7('0x5'),_0xf6b7('0x6'),_0xf6b7('0x7')),'allowNull':![],'defaultValue':_0xf6b7('0x7')},'transferredAt':{'type':Sequelize[_0xf6b7('0x8')],'allowNull':![],'defaultValue':Sequelize[_0xf6b7('0x9')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index b166d67..2fa2004 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 _0xa20b=['includeAll','include','findAll','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','json','count','offset','limit','set','apply','reject','save','update','then','destroy','end','error','stack','name','send','map','ChatTransferReport','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','type','VIRTUAL','field','merge','options'];(function(_0x4174a5,_0xb96b94){var _0x24e13a=function(_0x4d2594){while(--_0x4d2594){_0x4174a5['push'](_0x4174a5['shift']());}};_0x24e13a(++_0xb96b94);}(_0xa20b,0xa4));var _0xba20=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa20b[_0x14add3];return _0x4a174f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xba20('0x0'));var rimraf=require(_0xba20('0x1'));var zipdir=require(_0xba20('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xba20('0x3'));var moment=require(_0xba20('0x4'));var BPromise=require(_0xba20('0x5'));var Mustache=require(_0xba20('0x6'));var util=require('util');var path=require(_0xba20('0x7'));var sox=require('sox');var csv=require(_0xba20('0x8'));var ejs=require(_0xba20('0x9'));var fs=require('fs');var _=require(_0xba20('0xa'));var squel=require(_0xba20('0xb'));var crypto=require(_0xba20('0xc'));var jsforce=require(_0xba20('0xd'));var deskjs=require(_0xba20('0xe'));var toCsv=require(_0xba20('0x8'));var querystring=require(_0xba20('0xf'));var Papa=require(_0xba20('0x10'));var Redis=require(_0xba20('0x11'));var authService=require(_0xba20('0x12'));var qs=require(_0xba20('0x13'));var as=require(_0xba20('0x14'));var hardwareService=require(_0xba20('0x15'));var logger=require(_0xba20('0x16'))('api');var utils=require(_0xba20('0x17'));var config=require(_0xba20('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x113eb7,_0x5289c0){_0x5289c0=_0x5289c0||0xcc;return function(_0x395c5b){if(_0x395c5b){return _0x113eb7[_0xba20('0x19')](_0x5289c0);}return _0x113eb7[_0xba20('0x1a')](_0x5289c0)['end']();};}function respondWithResult(_0x5739c8,_0x528f0f){_0x528f0f=_0x528f0f||0xc8;return function(_0x1cc639){if(_0x1cc639){return _0x5739c8['status'](_0x528f0f)[_0xba20('0x1b')](_0x1cc639);}};}function respondWithFilteredResult(_0x3dac3d,_0x258997){return function(_0x3dcfb2){if(_0x3dcfb2){var _0x3e9acb=_0x3dcfb2[_0xba20('0x1c')],_0x4d39e5=_0x258997[_0xba20('0x1d')],_0xf763c2=_0x258997['offset']+_0x258997[_0xba20('0x1e')],_0x51a2d4;if(_0xf763c2>=_0x3e9acb){_0xf763c2=_0x3e9acb;_0x51a2d4=0xc8;}else{_0x51a2d4=0xce;}_0x3dac3d[_0xba20('0x1a')](_0x51a2d4);return _0x3dac3d[_0xba20('0x1f')]('Content-Range',_0x4d39e5+'-'+_0xf763c2+'/'+_0x3e9acb)[_0xba20('0x1b')](_0x3dcfb2);}return null;};}function patchUpdates(_0xdb7048){return function(_0x34e97f){try{jsonpatch[_0xba20('0x20')](_0x34e97f,_0xdb7048,!![]);}catch(_0x1fd324){return BPromise[_0xba20('0x21')](_0x1fd324);}return _0x34e97f[_0xba20('0x22')]();};}function saveUpdates(_0x2e405c,_0x32777c){return function(_0x564eb5){if(_0x564eb5){return _0x564eb5[_0xba20('0x23')](_0x2e405c)[_0xba20('0x24')](function(_0x4b3ec1){return _0x4b3ec1;});}return null;};}function removeEntity(_0x28a8d6,_0x23f1fe){return function(_0x471299){if(_0x471299){return _0x471299[_0xba20('0x25')]()[_0xba20('0x24')](function(){_0x28a8d6[_0xba20('0x1a')](0xcc)[_0xba20('0x26')]();});}};}function handleEntityNotFound(_0x56b20b,_0x472f6b){return function(_0xe3d0e1){if(!_0xe3d0e1){_0x56b20b[_0xba20('0x19')](0x194);}return _0xe3d0e1;};}function handleError(_0x16b632,_0x4f118e){_0x4f118e=_0x4f118e||0x1f4;return function(_0x18f076){logger[_0xba20('0x27')](_0x18f076[_0xba20('0x28')]);if(_0x18f076['name']){delete _0x18f076[_0xba20('0x29')];}_0x16b632[_0xba20('0x1a')](_0x4f118e)[_0xba20('0x2a')](_0x18f076);};}exports['index']=function(_0x42f266,_0x612346){var _0x217202={},_0x346d67={},_0xf181b9={'count':0x0,'rows':[]};var _0xc28f62=_[_0xba20('0x2b')](db[_0xba20('0x2c')][_0xba20('0x2d')],function(_0x32c433){return{'name':_0x32c433[_0xba20('0x2e')],'type':_0x32c433['type'][_0xba20('0x2f')]};});_0x346d67[_0xba20('0x30')]=_[_0xba20('0x2b')](_0xc28f62,'name');_0x346d67[_0xba20('0x31')]=_[_0xba20('0x32')](_0x42f266['query']);_0x346d67[_0xba20('0x33')]=_['intersection'](_0x346d67['model'],_0x346d67[_0xba20('0x31')]);_0x217202[_0xba20('0x34')]=_[_0xba20('0x35')](_0x346d67[_0xba20('0x30')],qs['fields'](_0x42f266[_0xba20('0x31')][_0xba20('0x36')]));_0x217202['attributes']=_0x217202[_0xba20('0x34')][_0xba20('0x37')]?_0x217202['attributes']:_0x346d67[_0xba20('0x30')];if(!_0x42f266['query']['hasOwnProperty'](_0xba20('0x38'))){_0x217202['limit']=qs[_0xba20('0x1e')](_0x42f266[_0xba20('0x31')]['limit']);_0x217202['offset']=qs[_0xba20('0x1d')](_0x42f266[_0xba20('0x31')]['offset']);}_0x217202[_0xba20('0x39')]=qs[_0xba20('0x3a')](_0x42f266[_0xba20('0x31')][_0xba20('0x3a')]);_0x217202[_0xba20('0x3b')]=qs[_0xba20('0x33')](_[_0xba20('0x3c')](_0x42f266['query'],_0x346d67[_0xba20('0x33')]));if(_0x42f266[_0xba20('0x31')][_0xba20('0x3d')]){_0x217202[_0xba20('0x3b')]=_['merge'](_0x217202[_0xba20('0x3b')],{'$or':_[_0xba20('0x2b')](_0xc28f62,function(_0xd89b6c){if(_0xd89b6c[_0xba20('0x3e')][_0xba20('0x2f')]!==_0xba20('0x3f')){var _0x115493={};_0x115493[_0xd89b6c[_0xba20('0x40')]]={'$like':'%'+_0x42f266[_0xba20('0x31')][_0xba20('0x3d')]+'%'};return _0x115493;}})});}_0x217202=_[_0xba20('0x41')]({},_0x217202,_0x42f266[_0xba20('0x42')]);var _0x241cd0={'where':_0x217202['where']};return db[_0xba20('0x2c')][_0xba20('0x1c')](_0x241cd0)['then'](function(_0x2ed3f5){_0xf181b9[_0xba20('0x1c')]=_0x2ed3f5;if(_0x42f266[_0xba20('0x31')][_0xba20('0x43')]){_0x217202[_0xba20('0x44')]=[{'all':!![]}];}return db[_0xba20('0x2c')][_0xba20('0x45')](_0x217202);})[_0xba20('0x24')](function(_0x5a0eac){_0xf181b9['rows']=_0x5a0eac;return _0xf181b9;})['then'](respondWithFilteredResult(_0x612346,_0x217202))[_0xba20('0x46')](handleError(_0x612346,null));};exports[_0xba20('0x47')]=function(_0x51747e,_0x1c89d2){var _0x44b950={'raw':!![],'where':{'id':_0x51747e[_0xba20('0x48')]['id']}},_0x3508d4={};_0x3508d4[_0xba20('0x30')]=_[_0xba20('0x32')](db['ChatTransferReport'][_0xba20('0x2d')]);_0x3508d4['query']=_['keys'](_0x51747e[_0xba20('0x31')]);_0x3508d4['filters']=_[_0xba20('0x35')](_0x3508d4[_0xba20('0x30')],_0x3508d4[_0xba20('0x31')]);_0x44b950[_0xba20('0x34')]=_[_0xba20('0x35')](_0x3508d4['model'],qs[_0xba20('0x36')](_0x51747e[_0xba20('0x31')]['fields']));_0x44b950['attributes']=_0x44b950[_0xba20('0x34')][_0xba20('0x37')]?_0x44b950[_0xba20('0x34')]:_0x3508d4[_0xba20('0x30')];if(_0x51747e['query'][_0xba20('0x43')]){_0x44b950[_0xba20('0x44')]=[{'all':!![]}];}_0x44b950=_[_0xba20('0x41')]({},_0x44b950,_0x51747e[_0xba20('0x42')]);return db[_0xba20('0x2c')][_0xba20('0x49')](_0x44b950)[_0xba20('0x24')](handleEntityNotFound(_0x1c89d2,null))['then'](respondWithResult(_0x1c89d2,null))[_0xba20('0x46')](handleError(_0x1c89d2,null));};exports['create']=function(_0x53dcf6,_0x56a054){return db[_0xba20('0x2c')][_0xba20('0x4a')](_0x53dcf6[_0xba20('0x4b')],{})['then'](respondWithResult(_0x56a054,0xc9))[_0xba20('0x46')](handleError(_0x56a054,null));};exports[_0xba20('0x23')]=function(_0x3a3771,_0x97df2e){if(_0x3a3771[_0xba20('0x4b')]['id']){delete _0x3a3771[_0xba20('0x4b')]['id'];}return db[_0xba20('0x2c')][_0xba20('0x49')]({'where':{'id':_0x3a3771[_0xba20('0x48')]['id']}})[_0xba20('0x24')](handleEntityNotFound(_0x97df2e,null))[_0xba20('0x24')](saveUpdates(_0x3a3771[_0xba20('0x4b')],null))['then'](respondWithResult(_0x97df2e,null))['catch'](handleError(_0x97df2e,null));};exports[_0xba20('0x25')]=function(_0x408572,_0x8e46ec){return db[_0xba20('0x2c')][_0xba20('0x49')]({'where':{'id':_0x408572[_0xba20('0x48')]['id']}})[_0xba20('0x24')](handleEntityNotFound(_0x8e46ec,null))[_0xba20('0x24')](removeEntity(_0x8e46ec,null))[_0xba20('0x46')](handleError(_0x8e46ec,null));};exports[_0xba20('0x4c')]=function(_0x4847c2,_0x533f1e){return db[_0xba20('0x2c')][_0xba20('0x4c')]()[_0xba20('0x24')](respondWithResult(_0x533f1e,null))['catch'](handleError(_0x533f1e,null));}; \ No newline at end of file +var _0x513b=['../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','count','offset','set','Content-Range','reject','save','then','destroy','end','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','type','query','keys','filters','intersection','model','length','hasOwnProperty','nolimit','limit','sort','where','filter','merge','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','attributes','fields','find','create','update','body','params','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x4404fa,_0x34f28f){var _0x45998f=function(_0x3607b7){while(--_0x3607b7){_0x4404fa['push'](_0x4404fa['shift']());}};_0x45998f(++_0x34f28f);}(_0x513b,0x86));var _0xb513=function(_0x4b06f7,_0x436bca){_0x4b06f7=_0x4b06f7-0x0;var _0x12af91=_0x513b[_0x4b06f7];return _0x12af91;};'use strict';var pdf=require(_0xb513('0x0'));var emlformat=require(_0xb513('0x1'));var rimraf=require(_0xb513('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb513('0x3'));var rp=require(_0xb513('0x4'));var moment=require(_0xb513('0x5'));var BPromise=require(_0xb513('0x6'));var Mustache=require(_0xb513('0x7'));var util=require('util');var path=require(_0xb513('0x8'));var sox=require(_0xb513('0x9'));var csv=require('to-csv');var ejs=require(_0xb513('0xa'));var fs=require('fs');var _=require(_0xb513('0xb'));var squel=require('squel');var crypto=require(_0xb513('0xc'));var jsforce=require(_0xb513('0xd'));var deskjs=require(_0xb513('0xe'));var toCsv=require(_0xb513('0xf'));var querystring=require(_0xb513('0x10'));var Papa=require('papaparse');var Redis=require(_0xb513('0x11'));var authService=require(_0xb513('0x12'));var qs=require(_0xb513('0x13'));var as=require(_0xb513('0x14'));var hardwareService=require(_0xb513('0x15'));var logger=require(_0xb513('0x16'))(_0xb513('0x17'));var utils=require(_0xb513('0x18'));var config=require(_0xb513('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2d31a5,_0x598493){_0x598493=_0x598493||0xcc;return function(_0x3208ba){if(_0x3208ba){return _0x2d31a5[_0xb513('0x1a')](_0x598493);}return _0x2d31a5[_0xb513('0x1b')](_0x598493)['end']();};}function respondWithResult(_0x14f9c1,_0x2f4d89){_0x2f4d89=_0x2f4d89||0xc8;return function(_0x943d09){if(_0x943d09){return _0x14f9c1[_0xb513('0x1b')](_0x2f4d89)[_0xb513('0x1c')](_0x943d09);}};}function respondWithFilteredResult(_0x15e77f,_0xde231){return function(_0x4a0dd9){if(_0x4a0dd9){var _0x3d0033=_0x4a0dd9[_0xb513('0x1d')],_0x40d7f1=_0xde231[_0xb513('0x1e')],_0x257814=_0xde231[_0xb513('0x1e')]+_0xde231['limit'],_0x1935be;if(_0x257814>=_0x3d0033){_0x257814=_0x3d0033;_0x1935be=0xc8;}else{_0x1935be=0xce;}_0x15e77f['status'](_0x1935be);return _0x15e77f[_0xb513('0x1f')](_0xb513('0x20'),_0x40d7f1+'-'+_0x257814+'/'+_0x3d0033)[_0xb513('0x1c')](_0x4a0dd9);}return null;};}function patchUpdates(_0xb5ab35){return function(_0x2154a4){try{jsonpatch['apply'](_0x2154a4,_0xb5ab35,!![]);}catch(_0x3a3cb2){return BPromise[_0xb513('0x21')](_0x3a3cb2);}return _0x2154a4[_0xb513('0x22')]();};}function saveUpdates(_0x2f76e4,_0xd6044f){return function(_0x17fbc8){if(_0x17fbc8){return _0x17fbc8['update'](_0x2f76e4)[_0xb513('0x23')](function(_0x63d2){return _0x63d2;});}return null;};}function removeEntity(_0x290ec8,_0x3add47){return function(_0x2cef7c){if(_0x2cef7c){return _0x2cef7c[_0xb513('0x24')]()['then'](function(){_0x290ec8[_0xb513('0x1b')](0xcc)[_0xb513('0x25')]();});}};}function handleEntityNotFound(_0x4056f2,_0x261a42){return function(_0x32ed2a){if(!_0x32ed2a){_0x4056f2[_0xb513('0x1a')](0x194);}return _0x32ed2a;};}function handleError(_0x132e44,_0x362567){_0x362567=_0x362567||0x1f4;return function(_0x38c3ac){logger[_0xb513('0x26')](_0x38c3ac[_0xb513('0x27')]);if(_0x38c3ac[_0xb513('0x28')]){delete _0x38c3ac[_0xb513('0x28')];}_0x132e44[_0xb513('0x1b')](_0x362567)[_0xb513('0x29')](_0x38c3ac);};}exports[_0xb513('0x2a')]=function(_0x386014,_0x5314b3){var _0x2639b3={},_0x176845={},_0x163476={'count':0x0,'rows':[]};var _0x33acab=_[_0xb513('0x2b')](db[_0xb513('0x2c')][_0xb513('0x2d')],function(_0xaf9011){return{'name':_0xaf9011['fieldName'],'type':_0xaf9011[_0xb513('0x2e')]['key']};});_0x176845['model']=_[_0xb513('0x2b')](_0x33acab,_0xb513('0x28'));_0x176845[_0xb513('0x2f')]=_[_0xb513('0x30')](_0x386014[_0xb513('0x2f')]);_0x176845[_0xb513('0x31')]=_[_0xb513('0x32')](_0x176845[_0xb513('0x33')],_0x176845[_0xb513('0x2f')]);_0x2639b3['attributes']=_['intersection'](_0x176845[_0xb513('0x33')],qs['fields'](_0x386014[_0xb513('0x2f')]['fields']));_0x2639b3['attributes']=_0x2639b3['attributes'][_0xb513('0x34')]?_0x2639b3['attributes']:_0x176845[_0xb513('0x33')];if(!_0x386014[_0xb513('0x2f')][_0xb513('0x35')](_0xb513('0x36'))){_0x2639b3[_0xb513('0x37')]=qs[_0xb513('0x37')](_0x386014['query'][_0xb513('0x37')]);_0x2639b3[_0xb513('0x1e')]=qs[_0xb513('0x1e')](_0x386014[_0xb513('0x2f')]['offset']);}_0x2639b3['order']=qs[_0xb513('0x38')](_0x386014[_0xb513('0x2f')][_0xb513('0x38')]);_0x2639b3[_0xb513('0x39')]=qs[_0xb513('0x31')](_['pick'](_0x386014[_0xb513('0x2f')],_0x176845[_0xb513('0x31')]));if(_0x386014[_0xb513('0x2f')][_0xb513('0x3a')]){_0x2639b3['where']=_[_0xb513('0x3b')](_0x2639b3[_0xb513('0x39')],{'$or':_['map'](_0x33acab,function(_0xed8de6){if(_0xed8de6[_0xb513('0x2e')][_0xb513('0x3c')]!==_0xb513('0x3d')){var _0x21a66a={};_0x21a66a[_0xed8de6[_0xb513('0x3e')]]={'$like':'%'+_0x386014[_0xb513('0x2f')][_0xb513('0x3a')]+'%'};return _0x21a66a;}})});}_0x2639b3=_[_0xb513('0x3b')]({},_0x2639b3,_0x386014[_0xb513('0x3f')]);var _0x27e348={'where':_0x2639b3[_0xb513('0x39')]};return db[_0xb513('0x2c')][_0xb513('0x1d')](_0x27e348)[_0xb513('0x23')](function(_0x569664){_0x163476[_0xb513('0x1d')]=_0x569664;if(_0x386014[_0xb513('0x2f')][_0xb513('0x40')]){_0x2639b3[_0xb513('0x41')]=[{'all':!![]}];}return db[_0xb513('0x2c')][_0xb513('0x42')](_0x2639b3);})['then'](function(_0x30c5f5){_0x163476[_0xb513('0x43')]=_0x30c5f5;return _0x163476;})[_0xb513('0x23')](respondWithFilteredResult(_0x5314b3,_0x2639b3))[_0xb513('0x44')](handleError(_0x5314b3,null));};exports[_0xb513('0x45')]=function(_0x287ddf,_0x4aa17a){var _0x44acfc={'raw':!![],'where':{'id':_0x287ddf['params']['id']}},_0x1a475f={};_0x1a475f[_0xb513('0x33')]=_[_0xb513('0x30')](db[_0xb513('0x2c')][_0xb513('0x2d')]);_0x1a475f[_0xb513('0x2f')]=_[_0xb513('0x30')](_0x287ddf[_0xb513('0x2f')]);_0x1a475f['filters']=_[_0xb513('0x32')](_0x1a475f[_0xb513('0x33')],_0x1a475f[_0xb513('0x2f')]);_0x44acfc[_0xb513('0x46')]=_[_0xb513('0x32')](_0x1a475f['model'],qs[_0xb513('0x47')](_0x287ddf[_0xb513('0x2f')][_0xb513('0x47')]));_0x44acfc[_0xb513('0x46')]=_0x44acfc[_0xb513('0x46')][_0xb513('0x34')]?_0x44acfc[_0xb513('0x46')]:_0x1a475f[_0xb513('0x33')];if(_0x287ddf[_0xb513('0x2f')][_0xb513('0x40')]){_0x44acfc['include']=[{'all':!![]}];}_0x44acfc=_['merge']({},_0x44acfc,_0x287ddf[_0xb513('0x3f')]);return db[_0xb513('0x2c')][_0xb513('0x48')](_0x44acfc)[_0xb513('0x23')](handleEntityNotFound(_0x4aa17a,null))[_0xb513('0x23')](respondWithResult(_0x4aa17a,null))[_0xb513('0x44')](handleError(_0x4aa17a,null));};exports[_0xb513('0x49')]=function(_0x3fc9bc,_0x368089){return db[_0xb513('0x2c')][_0xb513('0x49')](_0x3fc9bc['body'],{})[_0xb513('0x23')](respondWithResult(_0x368089,0xc9))[_0xb513('0x44')](handleError(_0x368089,null));};exports[_0xb513('0x4a')]=function(_0xe03660,_0x4f8155){if(_0xe03660[_0xb513('0x4b')]['id']){delete _0xe03660[_0xb513('0x4b')]['id'];}return db[_0xb513('0x2c')][_0xb513('0x48')]({'where':{'id':_0xe03660['params']['id']}})[_0xb513('0x23')](handleEntityNotFound(_0x4f8155,null))[_0xb513('0x23')](saveUpdates(_0xe03660[_0xb513('0x4b')],null))[_0xb513('0x23')](respondWithResult(_0x4f8155,null))['catch'](handleError(_0x4f8155,null));};exports[_0xb513('0x24')]=function(_0x53eb6b,_0x230899){return db[_0xb513('0x2c')][_0xb513('0x48')]({'where':{'id':_0x53eb6b[_0xb513('0x4c')]['id']}})[_0xb513('0x23')](handleEntityNotFound(_0x230899,null))[_0xb513('0x23')](removeEntity(_0x230899,null))[_0xb513('0x44')](handleError(_0x230899,null));};exports[_0xb513('0x4d')]=function(_0x2259a8,_0x4366a6){return db[_0xb513('0x2c')][_0xb513('0x4d')]()[_0xb513('0x23')](respondWithResult(_0x4366a6,null))[_0xb513('0x44')](handleError(_0x4366a6,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 65f763f..fb01a71 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 _0x79d3=['rimraf','exports','define','ChatTransferReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x350465,_0x18ed5d){var _0x4ae53d=function(_0x28aa44){while(--_0x28aa44){_0x350465['push'](_0x350465['shift']());}};_0x4ae53d(++_0x18ed5d);}(_0x79d3,0x179));var _0x379d=function(_0x2512fd,_0x5f5bfd){_0x2512fd=_0x2512fd-0x0;var _0x576639=_0x79d3[_0x2512fd];return _0x576639;};'use strict';var _=require(_0x379d('0x0'));var util=require(_0x379d('0x1'));var logger=require(_0x379d('0x2'))(_0x379d('0x3'));var moment=require(_0x379d('0x4'));var BPromise=require(_0x379d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x379d('0x6'));var rimraf=require(_0x379d('0x7'));var config=require('../../config/environment');var attributes=require('./chatTransferReport.attributes');module[_0x379d('0x8')]=function(_0x18b0be,_0x2a0f02){return _0x18b0be[_0x379d('0x9')](_0x379d('0xa'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x379d('0xb'),'fields':[_0x379d('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3472=['request-promise','rimraf','./chatTransferReport.attributes','exports','report_chat_transfer','util','../../config/logger','moment','bluebird'];(function(_0x41cfd4,_0x1ed2cc){var _0x190f48=function(_0x4b5b1a){while(--_0x4b5b1a){_0x41cfd4['push'](_0x41cfd4['shift']());}};_0x190f48(++_0x1ed2cc);}(_0x3472,0xf8));var _0x2347=function(_0x408d11,_0x5cb230){_0x408d11=_0x408d11-0x0;var _0x4fdcfb=_0x3472[_0x408d11];return _0x4fdcfb;};'use strict';var _=require('lodash');var util=require(_0x2347('0x0'));var logger=require(_0x2347('0x1'))('api');var moment=require(_0x2347('0x2'));var BPromise=require(_0x2347('0x3'));var rp=require(_0x2347('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2347('0x5'));var config=require('../../config/environment');var attributes=require(_0x2347('0x6'));module[_0x2347('0x7')]=function(_0x48c8ac,_0x6ded3){return _0x48c8ac['define']('ChatTransferReport',attributes,{'tableName':_0x2347('0x8'),'paranoid':![],'indexes':[{'name':'uniqueid','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 76d28c2..8e682bd 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 _0x8f9b=['ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','info','request\x20sent','debug','stringify','error','ChatTransferReport,\x20%s,\x20%s','message','lodash','moment','randomstring'];(function(_0x497f4f,_0x3ec06c){var _0xa4ca29=function(_0x4671b9){while(--_0x4671b9){_0x497f4f['push'](_0x497f4f['shift']());}};_0xa4ca29(++_0x3ec06c);}(_0x8f9b,0x162));var _0xb8f9=function(_0x5a42a6,_0x4200fc){_0x5a42a6=_0x5a42a6-0x0;var _0x312e35=_0x8f9b[_0x5a42a6];return _0x312e35;};'use strict';var _=require(_0xb8f9('0x0'));var util=require('util');var moment=require(_0xb8f9('0x1'));var BPromise=require('bluebird');var rs=require(_0xb8f9('0x2'));var fs=require('fs');var Redis=require(_0xb8f9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb8f9('0x4'));var logger=require(_0xb8f9('0x5'))('rpc');var config=require(_0xb8f9('0x6'));var jayson=require(_0xb8f9('0x7'));var client=jayson[_0xb8f9('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xb06a9d,_0x394030,_0x4fc2ac){return new BPromise(function(_0x3d39fb,_0x45adee){return client[_0xb8f9('0x9')](_0xb06a9d,_0x4fc2ac)['then'](function(_0x1b99ab){logger[_0xb8f9('0xa')]('ChatTransferReport,\x20%s,\x20%s',_0x394030,_0xb8f9('0xb'));logger[_0xb8f9('0xc')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x394030,_0xb8f9('0xb'),JSON[_0xb8f9('0xd')](_0x1b99ab));if(_0x1b99ab[_0xb8f9('0xe')]){if(_0x1b99ab['error']['code']===0x1f4){logger[_0xb8f9('0xe')](_0xb8f9('0xf'),_0x394030,_0x1b99ab[_0xb8f9('0xe')][_0xb8f9('0x10')]);return _0x45adee(_0x1b99ab[_0xb8f9('0xe')][_0xb8f9('0x10')]);}logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x394030,_0x1b99ab[_0xb8f9('0xe')][_0xb8f9('0x10')]);return _0x3d39fb(_0x1b99ab[_0xb8f9('0xe')][_0xb8f9('0x10')]);}else{logger[_0xb8f9('0xa')](_0xb8f9('0xf'),_0x394030,_0xb8f9('0xb'));_0x3d39fb(_0x1b99ab['result'][_0xb8f9('0x10')]);}})['catch'](function(_0x33b44a){logger['error'](_0xb8f9('0xf'),_0x394030,_0x33b44a);_0x45adee(_0x33b44a);});});} \ No newline at end of file +var _0xf725=['ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x55170f,_0x3c410f){var _0x2e2ee2=function(_0x1d0c2d){while(--_0x1d0c2d){_0x55170f['push'](_0x55170f['shift']());}};_0x2e2ee2(++_0x3c410f);}(_0xf725,0x14f));var _0x5f72=function(_0x2206a4,_0x449449){_0x2206a4=_0x2206a4-0x0;var _0x15a531=_0xf725[_0x2206a4];return _0x15a531;};'use strict';var _=require(_0x5f72('0x0'));var util=require(_0x5f72('0x1'));var moment=require(_0x5f72('0x2'));var BPromise=require(_0x5f72('0x3'));var rs=require(_0x5f72('0x4'));var fs=require('fs');var Redis=require(_0x5f72('0x5'));var db=require(_0x5f72('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x5f72('0x7'))('rpc');var config=require(_0x5f72('0x8'));var jayson=require(_0x5f72('0x9'));var client=jayson[_0x5f72('0xa')][_0x5f72('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x533059,_0x33e982,_0x4d73b3){return new BPromise(function(_0x1d2610,_0x2e0a4c){return client[_0x5f72('0xc')](_0x533059,_0x4d73b3)[_0x5f72('0xd')](function(_0x3b6569){logger[_0x5f72('0xe')](_0x5f72('0xf'),_0x33e982,'request\x20sent');logger[_0x5f72('0x10')](_0x5f72('0x11'),_0x33e982,'request\x20sent',JSON[_0x5f72('0x12')](_0x3b6569));if(_0x3b6569[_0x5f72('0x13')]){if(_0x3b6569[_0x5f72('0x13')][_0x5f72('0x14')]===0x1f4){logger[_0x5f72('0x13')](_0x5f72('0xf'),_0x33e982,_0x3b6569[_0x5f72('0x13')]['message']);return _0x2e0a4c(_0x3b6569[_0x5f72('0x13')][_0x5f72('0x15')]);}logger[_0x5f72('0x13')](_0x5f72('0xf'),_0x33e982,_0x3b6569[_0x5f72('0x13')]['message']);return _0x1d2610(_0x3b6569[_0x5f72('0x13')][_0x5f72('0x15')]);}else{logger[_0x5f72('0xe')]('ChatTransferReport,\x20%s,\x20%s',_0x33e982,_0x5f72('0x16'));_0x1d2610(_0x3b6569[_0x5f72('0x17')][_0x5f72('0x15')]);}})[_0x5f72('0x18')](function(_0x5e2490){logger[_0x5f72('0x13')]('ChatTransferReport,\x20%s,\x20%s',_0x33e982,_0x5e2490);_0x2e0a4c(_0x5e2490);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 6b3470e..d231041 100644 --- a/server/api/chatTransferReport/index.js +++ b/server/api/chatTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f66=['describe','get','/:id','show','create','put','delete','destroy','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatTransferReport.controller','isAuthenticated','index'];(function(_0xf79bae,_0x263b2a){var _0x5d2cb7=function(_0x27c86b){while(--_0x27c86b){_0xf79bae['push'](_0xf79bae['shift']());}};_0x5d2cb7(++_0x263b2a);}(_0x5f66,0x1a0));var _0x65f6=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x5f66[_0x5d4607];return _0x5e4a86;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var auth=require(_0x65f6('0x4'));var interaction=require(_0x65f6('0x5'));var config=require('../../config/environment');var controller=require(_0x65f6('0x6'));router['get']('/',auth[_0x65f6('0x7')](),controller[_0x65f6('0x8')]);router['get']('/describe',auth[_0x65f6('0x7')](),controller[_0x65f6('0x9')]);router[_0x65f6('0xa')](_0x65f6('0xb'),auth[_0x65f6('0x7')](),controller[_0x65f6('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x65f6('0xd')]);router[_0x65f6('0xe')](_0x65f6('0xb'),auth[_0x65f6('0x7')](),controller['update']);router[_0x65f6('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x65f6('0x10')]);module['exports']=router; \ No newline at end of file +var _0xb10b=['../../config/environment','./chatTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','update','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x45bf86,_0x75586e){var _0x1f02b7=function(_0x1ea8a3){while(--_0x1ea8a3){_0x45bf86['push'](_0x45bf86['shift']());}};_0x1f02b7(++_0x75586e);}(_0xb10b,0x12a));var _0xbb10=function(_0x4bf3f9,_0x459195){_0x4bf3f9=_0x4bf3f9-0x0;var _0x7bd6fc=_0xb10b[_0x4bf3f9];return _0x7bd6fc;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var auth=require(_0xbb10('0x4'));var interaction=require(_0xbb10('0x5'));var config=require(_0xbb10('0x6'));var controller=require(_0xbb10('0x7'));router[_0xbb10('0x8')]('/',auth[_0xbb10('0x9')](),controller['index']);router[_0xbb10('0x8')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0xb')]);router[_0xbb10('0x8')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0xd')]);router[_0xbb10('0xe')]('/',auth[_0xbb10('0x9')](),controller[_0xbb10('0xf')]);router['put']('/:id',auth[_0xbb10('0x9')](),controller[_0xbb10('0x10')]);router[_0xbb10('0x11')]('/:id',auth[_0xbb10('0x9')](),controller['destroy']);module[_0xbb10('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 4cfb67a..df82826 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 _0x609b=['rounded','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','star','thumb','stringify','text','name','getDataValue','onlineForm','parse','setDataValue','input','textarea','Comments','offlineForm','generate','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','randomstring','exports','STRING','email','Agent','#9f946a','#ffffff','INTEGER','BOOLEAN','ENUM'];(function(_0x5dc03e,_0x54e60c){var _0x466a07=function(_0x2ce0cd){while(--_0x2ce0cd){_0x5dc03e['push'](_0x5dc03e['shift']());}};_0x466a07(++_0x54e60c);}(_0x609b,0x8b));var _0xb609=function(_0x14b688,_0x3a39e7){_0x14b688=_0x14b688-0x0;var _0x3d6c64=_0x609b[_0x14b688];return _0x3d6c64;};'use strict';var Sequelize=require(_0xb609('0x0'));var rs=require(_0xb609('0x1'));module[_0xb609('0x2')]={'name':{'type':Sequelize[_0xb609('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0xb609('0x3')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0xb609('0x3')]},'mapKey':{'type':Sequelize[_0xb609('0x3')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0xb609('0x3')],'defaultValue':_0xb609('0x4')},'key':{'type':Sequelize[_0xb609('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0xb609('0x5')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0xb609('0x3')],'allowNull':![],'defaultValue':_0xb609('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xb609('0x3')],'allowNull':![],'defaultValue':_0xb609('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xb609('0x3')],'allowNull':![],'defaultValue':_0xb609('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xb609('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xb609('0x3')]},'animation':{'type':Sequelize[_0xb609('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xb609('0xa')](_0xb609('0xb'),'squared'),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0xb609('0x3')],'defaultValue':_0xb609('0xc')},'start_chat_button':{'type':Sequelize[_0xb609('0x3')],'defaultValue':_0xb609('0xd')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xb609('0xe')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0xb609('0xf')},'download_transcript':{'type':Sequelize[_0xb609('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xb609('0x3')],'defaultValue':_0xb609('0x10')},'defaultWhiteLabel':{'type':Sequelize[_0xb609('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xb609('0x11')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0xb609('0x3')],'defaultValue':_0xb609('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0xb609('0x3')],'defaultValue':_0xb609('0x13')},'noteTitle':{'type':Sequelize[_0xb609('0x3')],'defaultValue':_0xb609('0x14')},'placeholderMessage':{'type':Sequelize[_0xb609('0x3')],'defaultValue':_0xb609('0x15')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0xb609('0x16')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xb609('0xe')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xb609('0x17')},'conditionAgreement':{'type':Sequelize[_0xb609('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xb609('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xb609('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0xb609('0xa')](_0xb609('0x18'),_0xb609('0x19')),'defaultValue':_0xb609('0x18')},'ratingStarsNumber':{'type':Sequelize[_0xb609('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xb609('0x11')],'defaultValue':function(){return JSON[_0xb609('0x1a')]({'items':[{'type':'input','variable':null,'config':{'placeholder':'name','type':_0xb609('0x1b'),'required':!![]},'props':{'title':_0xb609('0x1c'),'helpText':''}},{'type':'input','props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xb609('0x4'),'type':_0xb609('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xb609('0x1d')](_0xb609('0x1e'))?JSON[_0xb609('0x1f')](this['getDataValue'](_0xb609('0x1e'))):{};},'set':function(_0xf1c6bb){return this[_0xb609('0x20')](_0xb609('0x1e'),JSON[_0xb609('0x1a')](_0xf1c6bb));}},'offlineForm':{'type':Sequelize[_0xb609('0x11')],'defaultValue':function(){return JSON[_0xb609('0x1a')]({'items':[{'type':_0xb609('0x21'),'props':{'title':_0xb609('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xb609('0x4'),'type':_0xb609('0x4')},'variable':null},{'type':_0xb609('0x22'),'config':{'placeholder':_0xb609('0x23')},'props':{'title':_0xb609('0x23'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0xb609('0x1d')](_0xb609('0x24'))?JSON['parse'](this[_0xb609('0x1d')](_0xb609('0x24'))):{};},'set':function(_0x7ca5d1){return this[_0xb609('0x20')](_0xb609('0x24'),JSON[_0xb609('0x1a')](_0x7ca5d1));}},'token':{'type':Sequelize[_0xb609('0x3')],'defaultValue':function(){return rs[_0xb609('0x25')]();}},'autoclose':{'type':Sequelize[_0xb609('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xb609('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xb609('0x3')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xb609('0x3')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0xb609('0x3')],'defaultValue':_0xb609('0x26')},'offlineMessageSubject':{'type':Sequelize[_0xb609('0x3')],'defaultValue':_0xb609('0x27')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0xb609('0x28')},'enableUnmanagedNote':{'type':Sequelize[_0xb609('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0xb609('0x29')},'skipUnmanaged':{'type':Sequelize[_0xb609('0x3')],'defaultValue':_0xb609('0x17')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0xb609('0xe')},'enableCustomerAttachment':{'type':Sequelize[_0xb609('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xb609('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xb609('0x11')]},'showAgentAvatar':{'type':Sequelize[_0xb609('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xb609('0x11')],'defaultValue':function(){return _0xb609('0x2a');}},'notificationSound':{'type':Sequelize[_0xb609('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xb609('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xb609('0x3')],'defaultValue':_0xb609('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize[_0xb609('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0xb609('0x8')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xb609('0x3')],'defaultValue':_0xb609('0x2c')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0xb609('0x11')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xb609('0x3')],'allowNull':![],'defaultValue':_0xb609('0x2d'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb609('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb609('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xb609('0x3')],'defaultValue':_0xb609('0x2e')},'systemAvatar':{'type':Sequelize[_0xb609('0x11')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb609('0x8')],'comment':_0xb609('0x2f')},'mandatoryDisposition':{'type':Sequelize[_0xb609('0x9')],'defaultValue':![],'comment':_0xb609('0x30'),'set':function(_0x4c3baa){if(!_0x4c3baa)this[_0xb609('0x20')]('mandatoryDispositionPauseId',null);this[_0xb609('0x20')](_0xb609('0x31'),_0x4c3baa);}}}; \ No newline at end of file +var _0x8ed3=['Leave\x20your\x20comments','offlineForm','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','alternate','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','sequelize','randomstring','STRING','email','Agent','#9f946a','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','name','input','getDataValue','onlineForm','parse','setDataValue','stringify','textarea','Comments'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x8ed3,0x18c));var _0x38ed=function(_0x1e9483,_0x1a4949){_0x1e9483=_0x1e9483-0x0;var _0x4b7e09=_0x8ed3[_0x1e9483];return _0x4b7e09;};'use strict';var Sequelize=require(_0x38ed('0x0'));var rs=require(_0x38ed('0x1'));module['exports']={'name':{'type':Sequelize[_0x38ed('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x38ed('0x2')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x38ed('0x2')],'defaultValue':_0x38ed('0x3')},'mapKeyOffline':{'type':Sequelize[_0x38ed('0x2')],'defaultValue':_0x38ed('0x3')},'key':{'type':Sequelize[_0x38ed('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x38ed('0x4')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x38ed('0x2')],'allowNull':![],'defaultValue':'#9f946a','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x38ed('0x2')],'allowNull':![],'defaultValue':_0x38ed('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x38ed('0x2')],'allowNull':![],'defaultValue':_0x38ed('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x38ed('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x38ed('0x2')]},'animation':{'type':Sequelize[_0x38ed('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x38ed('0x9')](_0x38ed('0xa'),_0x38ed('0xb')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0x38ed('0x2')],'defaultValue':_0x38ed('0xc')},'start_chat_button':{'type':Sequelize[_0x38ed('0x2')],'defaultValue':_0x38ed('0xd')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x38ed('0xe')},'header_offline':{'type':Sequelize[_0x38ed('0x2')],'defaultValue':_0x38ed('0xf')},'download_transcript':{'type':Sequelize[_0x38ed('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x38ed('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x38ed('0x2')],'defaultValue':_0x38ed('0x10')},'defaultWhiteLabel':{'type':Sequelize[_0x38ed('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x38ed('0x11')]},'closingQuestion':{'type':Sequelize[_0x38ed('0x2')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x38ed('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0x38ed('0x2')],'defaultValue':_0x38ed('0x13')},'noteTitle':{'type':Sequelize[_0x38ed('0x2')],'defaultValue':_0x38ed('0x14')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x38ed('0x15')},'closingMessage':{'type':Sequelize[_0x38ed('0x2')],'defaultValue':_0x38ed('0x16')},'closingMessageButton':{'type':Sequelize[_0x38ed('0x2')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0x38ed('0x2')],'defaultValue':_0x38ed('0x17')},'conditionAgreement':{'type':Sequelize[_0x38ed('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x38ed('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x38ed('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0x38ed('0x18')},'ratingType':{'type':Sequelize['ENUM'](_0x38ed('0x19'),_0x38ed('0x1a')),'defaultValue':_0x38ed('0x19')},'ratingStarsNumber':{'type':Sequelize[_0x38ed('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x38ed('0x11')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','variable':null,'config':{'placeholder':'name','type':'text','required':!![]},'props':{'title':_0x38ed('0x1b'),'helpText':''}},{'type':_0x38ed('0x1c'),'props':{'title':_0x38ed('0x3'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x38ed('0x1d')](_0x38ed('0x1e'))?JSON[_0x38ed('0x1f')](this[_0x38ed('0x1d')](_0x38ed('0x1e'))):{};},'set':function(_0x8ce0c3){return this[_0x38ed('0x20')](_0x38ed('0x1e'),JSON['stringify'](_0x8ce0c3));}},'offlineForm':{'type':Sequelize[_0x38ed('0x11')],'defaultValue':function(){return JSON[_0x38ed('0x21')]({'items':[{'type':_0x38ed('0x1c'),'props':{'title':_0x38ed('0x3'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x38ed('0x3')},'variable':null},{'type':_0x38ed('0x22'),'config':{'placeholder':_0x38ed('0x23')},'props':{'title':_0x38ed('0x23'),'helpText':_0x38ed('0x24')}}],'fromKey':0x0});},'get':function(){return this[_0x38ed('0x1d')](_0x38ed('0x25'))?JSON[_0x38ed('0x1f')](this[_0x38ed('0x1d')]('offlineForm')):{};},'set':function(_0x4cfea9){return this['setDataValue'](_0x38ed('0x25'),JSON['stringify'](_0x4cfea9));}},'token':{'type':Sequelize[_0x38ed('0x2')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x38ed('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x38ed('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x38ed('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x38ed('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x38ed('0x2')],'defaultValue':_0x38ed('0x26')},'waitingMessage':{'type':Sequelize[_0x38ed('0x2')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x38ed('0x2')],'defaultValue':_0x38ed('0x27')},'offlineMessageBody':{'type':Sequelize[_0x38ed('0x2')],'defaultValue':_0x38ed('0x28')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x38ed('0x2')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0x38ed('0x2')],'defaultValue':_0x38ed('0xe')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x38ed('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x38ed('0x11')]},'showAgentAvatar':{'type':Sequelize[_0x38ed('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x38ed('0x11')],'defaultValue':function(){return _0x38ed('0x29');}},'notificationSound':{'type':Sequelize[_0x38ed('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x38ed('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x38ed('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x38ed('0x2')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0x38ed('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x38ed('0x2')],'defaultValue':_0x38ed('0x2a')},'verticalAlignment':{'type':Sequelize[_0x38ed('0x7')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x38ed('0x2')],'defaultValue':_0x38ed('0x2b')},'defaultTitle':{'type':Sequelize[_0x38ed('0x2')]},'customerAvatar':{'type':Sequelize[_0x38ed('0x11')]},'showCustomerAvatar':{'type':Sequelize[_0x38ed('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x38ed('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x38ed('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x38ed('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x38ed('0x2')],'defaultValue':_0x38ed('0x2c')},'systemAvatar':{'type':Sequelize[_0x38ed('0x11')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x38ed('0x7')],'comment':_0x38ed('0x2d')},'mandatoryDisposition':{'type':Sequelize[_0x38ed('0x8')],'defaultValue':![],'comment':_0x38ed('0x2e'),'set':function(_0x2969f1){if(!_0x2969f1)this[_0x38ed('0x20')](_0x38ed('0x2f'),null);this['setDataValue']('mandatoryDisposition',_0x2969f1);}}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 1376064..b425523 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 _0xc5b3=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','ChatWebsiteId','Disposition','getDispositions','removeDispositions','addAnswer','CannedAnswer','getAnswers','findOne','nolimit','removeAnswers','ids','addLogo','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.png','sitepic','custom','isNil','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','existsSync','notify','headers','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','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','DESC','ChatApplication','account','applications','list','orderBy','priority','asc','Applications','contact','customerIp','x-forwarded-for','first','split','firstName','x-real-port','referer','browser','version','unknown','%s\x20%s','device','vendor','format','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','lastName','messageId','created','autoclose','push','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','startRouting','Start','EventManager','offline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','findOrCreate','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','render','toPairs','ChatOfflineMessage','MailAccount','MailServerOut','Smtp','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','SendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','tag','Command','getSnippet','iftime\x20%s,%s','timezone','iftime\x20%s','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','interval','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','../../config/license/util','getLicense','virtual','License','increment','chatLicenseExceeded','some','server/files/chat/iframe.js','remote','x-real-ip','connection','remoteAddress','alignment','addApplications','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','onlineForm','items','fromKey','getOfflineMessages','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','client','http','test','request','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','catch','sendStatus','status','end','count','limit','Content-Range','json','apply','reject','save','update','then','destroy','ChatWebsites','UserProfileResource','stack','name','send','index','map','ChatWebsite','rawAttributes','fieldName','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','offset','order','sort','pick','filter','where','merge','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','show','params','mandatoryDispositionPause','keys','find','create','body','get'];(function(_0x478caa,_0x18fa89){var _0x3cd54e=function(_0x2387fe){while(--_0x2387fe){_0x478caa['push'](_0x478caa['shift']());}};_0x3cd54e(++_0x18fa89);}(_0xc5b3,0x1ee));var _0x3c5b=function(_0x4cb095,_0x58da07){_0x4cb095=_0x4cb095-0x0;var _0x2b565d=_0xc5b3[_0x4cb095];return _0x2b565d;};'use strict';var pdf=require(_0x3c5b('0x0'));var emlformat=require(_0x3c5b('0x1'));var rimraf=require(_0x3c5b('0x2'));var zipdir=require(_0x3c5b('0x3'));var jsonpatch=require(_0x3c5b('0x4'));var rp=require(_0x3c5b('0x5'));var moment=require(_0x3c5b('0x6'));var BPromise=require(_0x3c5b('0x7'));var Mustache=require('mustache');var util=require(_0x3c5b('0x8'));var path=require(_0x3c5b('0x9'));var sox=require('sox');var csv=require(_0x3c5b('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x3c5b('0xb'));var squel=require(_0x3c5b('0xc'));var crypto=require(_0x3c5b('0xd'));var jsforce=require(_0x3c5b('0xe'));var deskjs=require(_0x3c5b('0xf'));var toCsv=require(_0x3c5b('0xa'));var querystring=require(_0x3c5b('0x10'));var Papa=require('papaparse');var Redis=require(_0x3c5b('0x11'));var authService=require(_0x3c5b('0x12'));var qs=require(_0x3c5b('0x13'));var as=require(_0x3c5b('0x14'));var hardwareService=require(_0x3c5b('0x15'));var logger=require('../../config/logger')(_0x3c5b('0x16'));var utils=require(_0x3c5b('0x17'));var config=require(_0x3c5b('0x18'));var db=require(_0x3c5b('0x19'))['db'];config[_0x3c5b('0x1a')]=_[_0x3c5b('0x1b')](config[_0x3c5b('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x3c5b('0x1c'))(new Redis(config[_0x3c5b('0x1a')]));require(_0x3c5b('0x1d'))[_0x3c5b('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0x3c5b('0x1f')]['http']({'port':0x232c});var client9002=jayson[_0x3c5b('0x1f')][_0x3c5b('0x20')]({'port':0x232a});var client9003=jayson['client'][_0x3c5b('0x20')]({'port':0x232b});function checkPasswordPattern(_0x88069a,_0x5d64cb,_0x32c58e){if(_0x32c58e){var _0x1cbe52=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1cbe52[_0x3c5b('0x21')](_0x5d64cb)){return _0x88069a;}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 _0x88069a;}}function respondWithRpcPromise(_0x825859,_0x4945ad,_0x40fe47,_0x3cec41){return new BPromise(function(_0x413266,_0x2189ce){var _0x37dfb0=_0x3cec41||client;return _0x37dfb0[_0x3c5b('0x22')](_0x825859,_0x40fe47)['then'](function(_0x4a76d5){logger[_0x3c5b('0x23')]('ChatWebsite,\x20%s,\x20%s',_0x4945ad,_0x3c5b('0x24'));logger[_0x3c5b('0x25')](_0x3c5b('0x26'),_0x4945ad,'request\x20sent',JSON[_0x3c5b('0x27')](_0x4a76d5));if(_0x4a76d5['error']){if(_0x4a76d5[_0x3c5b('0x28')][_0x3c5b('0x29')]===0x1f4){logger[_0x3c5b('0x28')](_0x3c5b('0x2a'),_0x4945ad,_0x4a76d5[_0x3c5b('0x28')][_0x3c5b('0x2b')]);return _0x2189ce(_0x4a76d5[_0x3c5b('0x28')][_0x3c5b('0x2b')]);}logger['error'](_0x3c5b('0x2a'),_0x4945ad,_0x4a76d5[_0x3c5b('0x28')][_0x3c5b('0x2b')]);return _0x413266(_0x4a76d5['error'][_0x3c5b('0x2b')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x4945ad,'request\x20sent');_0x413266(_0x4a76d5['result'][_0x3c5b('0x2b')]);}})[_0x3c5b('0x2c')](function(_0x1572d4){logger['error'](_0x3c5b('0x2a'),_0x4945ad,_0x1572d4);_0x2189ce(_0x1572d4);});});}function respondWithStatusCode(_0x5c7fc2,_0x3548e9){_0x3548e9=_0x3548e9||0xcc;return function(_0xdffcbd){if(_0xdffcbd){return _0x5c7fc2[_0x3c5b('0x2d')](_0x3548e9);}return _0x5c7fc2[_0x3c5b('0x2e')](_0x3548e9)[_0x3c5b('0x2f')]();};}function respondWithResult(_0x42c5e1,_0x37cd2f){_0x37cd2f=_0x37cd2f||0xc8;return function(_0x2764b6){if(_0x2764b6){return _0x42c5e1[_0x3c5b('0x2e')](_0x37cd2f)['json'](_0x2764b6);}};}function respondWithFilteredResult(_0x173cd1,_0x217022){return function(_0x42f017){if(_0x42f017){var _0x410ebf=_0x42f017[_0x3c5b('0x30')],_0x36c4ba=_0x217022['offset'],_0x1c686a=_0x217022['offset']+_0x217022[_0x3c5b('0x31')],_0x2e730b;if(_0x1c686a>=_0x410ebf){_0x1c686a=_0x410ebf;_0x2e730b=0xc8;}else{_0x2e730b=0xce;}_0x173cd1[_0x3c5b('0x2e')](_0x2e730b);return _0x173cd1['set'](_0x3c5b('0x32'),_0x36c4ba+'-'+_0x1c686a+'/'+_0x410ebf)[_0x3c5b('0x33')](_0x42f017);}return null;};}function patchUpdates(_0x52a50b){return function(_0x1ba178){try{jsonpatch[_0x3c5b('0x34')](_0x1ba178,_0x52a50b,!![]);}catch(_0x539da6){return BPromise[_0x3c5b('0x35')](_0x539da6);}return _0x1ba178[_0x3c5b('0x36')]();};}function saveUpdates(_0x388acd,_0x3031d5){return function(_0x16aa9c){if(_0x16aa9c){return _0x16aa9c[_0x3c5b('0x37')](_0x388acd)[_0x3c5b('0x38')](function(_0x3029b0){return _0x3029b0;});}return null;};}function removeEntity(_0x382908,_0x31a33c){return function(_0x4cd37a){if(_0x4cd37a){return _0x4cd37a[_0x3c5b('0x39')]()[_0x3c5b('0x38')](function(){var _0x34ebdf=_0x4cd37a['get']({'plain':!![]});var _0x3d9afc=_0x3c5b('0x3a');return db[_0x3c5b('0x3b')]['destroy']({'where':{'type':_0x3d9afc,'resourceId':_0x34ebdf['id']}})['then'](function(){return _0x4cd37a;});})[_0x3c5b('0x38')](function(){_0x382908['status'](0xcc)[_0x3c5b('0x2f')]();});}};}function handleEntityNotFound(_0x5a468,_0x217c39){return function(_0x2f6aba){if(!_0x2f6aba){_0x5a468[_0x3c5b('0x2d')](0x194);}return _0x2f6aba;};}function handleError(_0x31f0dd,_0x24886d){_0x24886d=_0x24886d||0x1f4;return function(_0x5c2674){logger['error'](_0x5c2674[_0x3c5b('0x3c')]);if(_0x5c2674[_0x3c5b('0x3d')]){delete _0x5c2674['name'];}_0x31f0dd[_0x3c5b('0x2e')](_0x24886d)[_0x3c5b('0x3e')](_0x5c2674);};}exports[_0x3c5b('0x3f')]=function(_0x4693c1,_0x4e0948){var _0x1e494d={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x3e5b7={},_0x39e1cf={'count':0x0,'rows':[]};var _0x401deb=_[_0x3c5b('0x40')](db[_0x3c5b('0x41')][_0x3c5b('0x42')],function(_0x1175d7){return{'name':_0x1175d7[_0x3c5b('0x43')],'type':_0x1175d7['type']['key']};});_0x3e5b7['model']=_[_0x3c5b('0x40')](_0x401deb,_0x3c5b('0x3d'));_0x3e5b7[_0x3c5b('0x44')]=_['keys'](_0x4693c1['query']);_0x3e5b7[_0x3c5b('0x45')]=_[_0x3c5b('0x46')](_0x3e5b7['model'],_0x3e5b7[_0x3c5b('0x44')]);_0x1e494d['attributes']=_['intersection'](_0x3e5b7[_0x3c5b('0x47')],qs[_0x3c5b('0x48')](_0x4693c1[_0x3c5b('0x44')][_0x3c5b('0x48')]));_0x1e494d[_0x3c5b('0x49')]=_0x1e494d[_0x3c5b('0x49')][_0x3c5b('0x4a')]?_0x1e494d[_0x3c5b('0x49')]:_0x3e5b7[_0x3c5b('0x47')];if(!_0x4693c1[_0x3c5b('0x44')][_0x3c5b('0x4b')]('nolimit')){_0x1e494d[_0x3c5b('0x31')]=qs['limit'](_0x4693c1[_0x3c5b('0x44')]['limit']);_0x1e494d[_0x3c5b('0x4c')]=qs[_0x3c5b('0x4c')](_0x4693c1[_0x3c5b('0x44')][_0x3c5b('0x4c')]);}_0x1e494d[_0x3c5b('0x4d')]=qs[_0x3c5b('0x4e')](_0x4693c1[_0x3c5b('0x44')][_0x3c5b('0x4e')]);_0x1e494d['where']=qs[_0x3c5b('0x45')](_[_0x3c5b('0x4f')](_0x4693c1[_0x3c5b('0x44')],_0x3e5b7[_0x3c5b('0x45')]));if(_0x4693c1['query'][_0x3c5b('0x50')]){_0x1e494d[_0x3c5b('0x51')]=_[_0x3c5b('0x52')](_0x1e494d[_0x3c5b('0x51')],{'$or':_[_0x3c5b('0x40')](_0x401deb,function(_0x38bcb0){if(_0x38bcb0[_0x3c5b('0x53')][_0x3c5b('0x54')]!==_0x3c5b('0x55')){var _0x264ef9={};_0x264ef9[_0x38bcb0[_0x3c5b('0x56')]]={'$like':'%'+_0x4693c1[_0x3c5b('0x44')]['filter']+'%'};return _0x264ef9;}})});}_0x1e494d=_['merge']({},_0x1e494d,_0x4693c1[_0x3c5b('0x57')]);var _0x19a129={'where':_0x1e494d[_0x3c5b('0x51')]};return db['ChatWebsite'][_0x3c5b('0x30')](_0x19a129)['then'](function(_0x9c0d0b){_0x39e1cf[_0x3c5b('0x30')]=_0x9c0d0b;if(_0x4693c1[_0x3c5b('0x44')][_0x3c5b('0x58')]){_0x1e494d[_0x3c5b('0x59')]=[{'all':!![]}];}return db[_0x3c5b('0x41')][_0x3c5b('0x5a')](_0x1e494d);})[_0x3c5b('0x38')](function(_0x337e6d){_0x39e1cf[_0x3c5b('0x5b')]=_0x337e6d;return _0x39e1cf;})[_0x3c5b('0x38')](respondWithFilteredResult(_0x4e0948,_0x1e494d))[_0x3c5b('0x2c')](handleError(_0x4e0948,null));};exports[_0x3c5b('0x5c')]=function(_0x829e00,_0x3ac181){var _0x3033e3={'raw':![],'where':{'id':_0x829e00[_0x3c5b('0x5d')]['id']},'include':[{'model':db['Pause'],'as':_0x3c5b('0x5e')}]},_0x4f812f={};_0x4f812f[_0x3c5b('0x47')]=_['keys'](db[_0x3c5b('0x41')]['rawAttributes']);_0x4f812f[_0x3c5b('0x44')]=_[_0x3c5b('0x5f')](_0x829e00['query']);_0x4f812f[_0x3c5b('0x45')]=_[_0x3c5b('0x46')](_0x4f812f['model'],_0x4f812f[_0x3c5b('0x44')]);_0x3033e3[_0x3c5b('0x49')]=_[_0x3c5b('0x46')](_0x4f812f[_0x3c5b('0x47')],qs['fields'](_0x829e00[_0x3c5b('0x44')][_0x3c5b('0x48')]));_0x3033e3[_0x3c5b('0x49')]=_0x3033e3[_0x3c5b('0x49')][_0x3c5b('0x4a')]?_0x3033e3[_0x3c5b('0x49')]:_0x4f812f[_0x3c5b('0x47')];if(_0x829e00[_0x3c5b('0x44')][_0x3c5b('0x58')]){_0x3033e3[_0x3c5b('0x59')]=[{'all':!![]}];}_0x3033e3=_['merge']({},_0x3033e3,_0x829e00[_0x3c5b('0x57')]);return db[_0x3c5b('0x41')][_0x3c5b('0x60')](_0x3033e3)[_0x3c5b('0x38')](handleEntityNotFound(_0x3ac181,null))['then'](respondWithResult(_0x3ac181,null))[_0x3c5b('0x2c')](handleError(_0x3ac181,null));};exports[_0x3c5b('0x61')]=function(_0x37aadb,_0xd89df4){return db[_0x3c5b('0x41')][_0x3c5b('0x61')](_0x37aadb[_0x3c5b('0x62')],{})[_0x3c5b('0x38')](function(_0x2bbafe){var _0x5454a9=_0x37aadb['user'][_0x3c5b('0x63')]({'plain':!![]});if(!_0x5454a9)throw new Error(_0x3c5b('0x64'));if(_0x5454a9[_0x3c5b('0x65')]===_0x3c5b('0x66')){var _0x172a2e=_0x2bbafe[_0x3c5b('0x63')]({'plain':!![]});var _0x42d7df=_0x3c5b('0x3a');return db[_0x3c5b('0x67')]['find']({'where':{'name':_0x42d7df,'userProfileId':_0x5454a9[_0x3c5b('0x68')]},'raw':!![]})[_0x3c5b('0x38')](function(_0x50fba1){if(_0x50fba1&&_0x50fba1['autoAssociation']===0x0){return db[_0x3c5b('0x3b')][_0x3c5b('0x61')]({'name':_0x172a2e['name'],'resourceId':_0x172a2e['id'],'type':_0x50fba1[_0x3c5b('0x3d')],'sectionId':_0x50fba1['id']},{})[_0x3c5b('0x38')](function(){return _0x2bbafe;});}else{return _0x2bbafe;}})[_0x3c5b('0x2c')](function(_0x560c77){logger[_0x3c5b('0x28')](_0x3c5b('0x69'),_0x560c77);throw _0x560c77;});}return _0x2bbafe;})[_0x3c5b('0x38')](respondWithResult(_0xd89df4,0xc9))['catch'](handleError(_0xd89df4,null));};exports[_0x3c5b('0x37')]=function(_0x2a83aa,_0x347114){if(_0x2a83aa[_0x3c5b('0x62')]['id']){delete _0x2a83aa[_0x3c5b('0x62')]['id'];}return db[_0x3c5b('0x41')][_0x3c5b('0x60')]({'where':{'id':_0x2a83aa['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x3c5b('0x38')](handleEntityNotFound(_0x347114,null))[_0x3c5b('0x38')](saveUpdates(_0x2a83aa[_0x3c5b('0x62')],null))['then'](respondWithResult(_0x347114,null))['catch'](handleError(_0x347114,null));};exports[_0x3c5b('0x39')]=function(_0x77ea7a,_0xefeb61){return db[_0x3c5b('0x41')][_0x3c5b('0x60')]({'where':{'id':_0x77ea7a['params']['id']}})[_0x3c5b('0x38')](handleEntityNotFound(_0xefeb61,null))[_0x3c5b('0x38')](removeEntity(_0xefeb61,null))[_0x3c5b('0x2c')](handleError(_0xefeb61,null));};exports[_0x3c5b('0x6a')]=function(_0x35b590,_0x10f79b){return db[_0x3c5b('0x41')][_0x3c5b('0x6a')]()[_0x3c5b('0x38')](respondWithResult(_0x10f79b,null))[_0x3c5b('0x2c')](handleError(_0x10f79b,null));};exports['addDisposition']=function(_0x1cea04,_0x16694a,_0x5980e6){if(_0x1cea04['body']['id']){delete _0x1cea04[_0x3c5b('0x62')]['id'];}return db[_0x3c5b('0x41')]['find']({'where':{'id':_0x1cea04['params']['id']}})[_0x3c5b('0x38')](handleEntityNotFound(_0x16694a,null))['then'](function(_0x2240e5){if(_0x2240e5){_0x1cea04['body'][_0x3c5b('0x6b')]=_0x2240e5['id'];return db[_0x3c5b('0x6c')]['create'](_0x1cea04[_0x3c5b('0x62')]);}})[_0x3c5b('0x38')](respondWithResult(_0x16694a,null))[_0x3c5b('0x2c')](handleError(_0x16694a,null));};exports[_0x3c5b('0x6d')]=function(_0x3fb875,_0x3ca60c,_0x271fba){var _0x5d67cc={'raw':![],'where':{}};var _0x17c76c={};var _0x29c572={'count':0x0,'rows':[]};return db[_0x3c5b('0x41')]['findOne']({'where':{'id':_0x3fb875['params']['id']}})[_0x3c5b('0x38')](handleEntityNotFound(_0x3ca60c,null))[_0x3c5b('0x38')](function(_0x3311d3){if(_0x3311d3){_0x17c76c[_0x3c5b('0x47')]=_[_0x3c5b('0x5f')](db['Disposition'][_0x3c5b('0x42')]);_0x17c76c[_0x3c5b('0x44')]=_[_0x3c5b('0x5f')](_0x3fb875[_0x3c5b('0x44')]);_0x17c76c[_0x3c5b('0x45')]=_[_0x3c5b('0x46')](_0x17c76c[_0x3c5b('0x47')],_0x17c76c[_0x3c5b('0x44')]);_0x5d67cc[_0x3c5b('0x49')]=_[_0x3c5b('0x46')](_0x17c76c[_0x3c5b('0x47')],qs[_0x3c5b('0x48')](_0x3fb875['query'][_0x3c5b('0x48')]));_0x5d67cc[_0x3c5b('0x49')]=_0x5d67cc[_0x3c5b('0x49')]['length']?_0x5d67cc[_0x3c5b('0x49')]:_0x17c76c[_0x3c5b('0x47')];if(!_0x3fb875[_0x3c5b('0x44')][_0x3c5b('0x4b')]('nolimit')){_0x5d67cc[_0x3c5b('0x31')]=qs[_0x3c5b('0x31')](_0x3fb875[_0x3c5b('0x44')]['limit']);_0x5d67cc[_0x3c5b('0x4c')]=qs[_0x3c5b('0x4c')](_0x3fb875[_0x3c5b('0x44')][_0x3c5b('0x4c')]);}_0x5d67cc[_0x3c5b('0x4d')]=qs['sort'](_0x3fb875['query'][_0x3c5b('0x4e')]);_0x5d67cc[_0x3c5b('0x51')]=qs[_0x3c5b('0x45')](_[_0x3c5b('0x4f')](_0x3fb875[_0x3c5b('0x44')],_0x17c76c[_0x3c5b('0x45')]));_0x5d67cc[_0x3c5b('0x51')]['ChatWebsiteId']=_0x3311d3['id'];if(_0x3fb875[_0x3c5b('0x44')][_0x3c5b('0x50')]){_0x5d67cc[_0x3c5b('0x51')]=_[_0x3c5b('0x52')](_0x5d67cc[_0x3c5b('0x51')],{'$or':_[_0x3c5b('0x40')](_0x5d67cc[_0x3c5b('0x49')],function(_0x3923d8){var _0x111833={};_0x111833[_0x3923d8]={'$like':'%'+_0x3fb875[_0x3c5b('0x44')]['filter']+'%'};return _0x111833;})});}_0x5d67cc=_[_0x3c5b('0x52')]({},_0x5d67cc,_0x3fb875[_0x3c5b('0x57')]);return db[_0x3c5b('0x6c')][_0x3c5b('0x30')]({'where':_0x5d67cc[_0x3c5b('0x51')]})['then'](function(_0x1a8370){_0x29c572[_0x3c5b('0x30')]=_0x1a8370;if(_0x3fb875[_0x3c5b('0x44')][_0x3c5b('0x58')]){_0x5d67cc[_0x3c5b('0x59')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x5d67cc);})[_0x3c5b('0x38')](function(_0x26b8b4){_0x29c572[_0x3c5b('0x5b')]=_0x26b8b4;return _0x29c572;});}})[_0x3c5b('0x38')](respondWithFilteredResult(_0x3ca60c,_0x5d67cc))[_0x3c5b('0x2c')](handleError(_0x3ca60c,null));};exports[_0x3c5b('0x6e')]=function(_0x5d18b4,_0x4157c8,_0x5939eb){return db['ChatWebsite'][_0x3c5b('0x60')]({'where':{'id':_0x5d18b4['params']['id']}})[_0x3c5b('0x38')](handleEntityNotFound(_0x4157c8,null))['then'](function(_0xfae598){if(_0xfae598){return _0xfae598['removeDispositions'](_0x5d18b4[_0x3c5b('0x44')]['ids']);}})['then'](respondWithStatusCode(_0x4157c8,null))[_0x3c5b('0x2c')](handleError(_0x4157c8,null));};exports[_0x3c5b('0x6f')]=function(_0x5ced7f,_0x203cc9,_0x13581b){if(_0x5ced7f[_0x3c5b('0x62')]['id']){delete _0x5ced7f['body']['id'];}return db[_0x3c5b('0x41')][_0x3c5b('0x60')]({'where':{'id':_0x5ced7f[_0x3c5b('0x5d')]['id']}})[_0x3c5b('0x38')](handleEntityNotFound(_0x203cc9,null))[_0x3c5b('0x38')](function(_0x1fd7f9){if(_0x1fd7f9){_0x5ced7f[_0x3c5b('0x62')][_0x3c5b('0x6b')]=_0x1fd7f9['id'];return db[_0x3c5b('0x70')][_0x3c5b('0x61')](_0x5ced7f['body']);}})[_0x3c5b('0x38')](respondWithResult(_0x203cc9,null))[_0x3c5b('0x2c')](handleError(_0x203cc9,null));};exports[_0x3c5b('0x71')]=function(_0x2660c6,_0x5312d0,_0x4a59c7){var _0x489849={'raw':![],'where':{}};var _0x19b40f={};var _0x177703={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x3c5b('0x72')]({'where':{'id':_0x2660c6[_0x3c5b('0x5d')]['id']}})[_0x3c5b('0x38')](handleEntityNotFound(_0x5312d0,null))[_0x3c5b('0x38')](function(_0x3c5ed5){if(_0x3c5ed5){_0x19b40f[_0x3c5b('0x47')]=_[_0x3c5b('0x5f')](db['CannedAnswer'][_0x3c5b('0x42')]);_0x19b40f[_0x3c5b('0x44')]=_[_0x3c5b('0x5f')](_0x2660c6['query']);_0x19b40f['filters']=_[_0x3c5b('0x46')](_0x19b40f[_0x3c5b('0x47')],_0x19b40f['query']);_0x489849['attributes']=_[_0x3c5b('0x46')](_0x19b40f['model'],qs[_0x3c5b('0x48')](_0x2660c6[_0x3c5b('0x44')][_0x3c5b('0x48')]));_0x489849[_0x3c5b('0x49')]=_0x489849[_0x3c5b('0x49')][_0x3c5b('0x4a')]?_0x489849['attributes']:_0x19b40f['model'];if(!_0x2660c6['query'][_0x3c5b('0x4b')](_0x3c5b('0x73'))){_0x489849[_0x3c5b('0x31')]=qs['limit'](_0x2660c6[_0x3c5b('0x44')]['limit']);_0x489849['offset']=qs[_0x3c5b('0x4c')](_0x2660c6[_0x3c5b('0x44')][_0x3c5b('0x4c')]);}_0x489849[_0x3c5b('0x4d')]=qs[_0x3c5b('0x4e')](_0x2660c6[_0x3c5b('0x44')]['sort']);_0x489849[_0x3c5b('0x51')]=qs[_0x3c5b('0x45')](_[_0x3c5b('0x4f')](_0x2660c6[_0x3c5b('0x44')],_0x19b40f[_0x3c5b('0x45')]));_0x489849[_0x3c5b('0x51')]['ChatWebsiteId']=_0x3c5ed5['id'];if(_0x2660c6[_0x3c5b('0x44')][_0x3c5b('0x50')]){_0x489849[_0x3c5b('0x51')]=_['merge'](_0x489849['where'],{'$or':_['map'](_0x489849[_0x3c5b('0x49')],function(_0x1b424d){var _0x3b5522={};_0x3b5522[_0x1b424d]={'$like':'%'+_0x2660c6[_0x3c5b('0x44')][_0x3c5b('0x50')]+'%'};return _0x3b5522;})});}_0x489849=_[_0x3c5b('0x52')]({},_0x489849,_0x2660c6['options']);return db[_0x3c5b('0x70')][_0x3c5b('0x30')]({'where':_0x489849[_0x3c5b('0x51')]})[_0x3c5b('0x38')](function(_0x158b5e){_0x177703[_0x3c5b('0x30')]=_0x158b5e;if(_0x2660c6[_0x3c5b('0x44')][_0x3c5b('0x58')]){_0x489849['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x3c5b('0x5a')](_0x489849);})['then'](function(_0x1c9238){_0x177703[_0x3c5b('0x5b')]=_0x1c9238;return _0x177703;});}})['then'](respondWithFilteredResult(_0x5312d0,_0x489849))[_0x3c5b('0x2c')](handleError(_0x5312d0,null));};exports[_0x3c5b('0x74')]=function(_0x280883,_0x25c3a0,_0x4cd353){return db[_0x3c5b('0x41')][_0x3c5b('0x60')]({'where':{'id':_0x280883['params']['id']}})[_0x3c5b('0x38')](handleEntityNotFound(_0x25c3a0,null))[_0x3c5b('0x38')](function(_0x17afa3){if(_0x17afa3){return _0x17afa3['removeAnswers'](_0x280883[_0x3c5b('0x44')][_0x3c5b('0x75')]);}})[_0x3c5b('0x38')](respondWithStatusCode(_0x25c3a0,null))[_0x3c5b('0x2c')](handleError(_0x25c3a0,null));};exports[_0x3c5b('0x76')]=function(_0x5a239,_0x1cf699,_0x4c660d){_0x5a239[_0x3c5b('0x62')]['sitepic']=_0x5a239[_0x3c5b('0x77')][_0x3c5b('0x78')];return db[_0x3c5b('0x41')][_0x3c5b('0x60')]({'where':{'id':_0x5a239[_0x3c5b('0x5d')]['id']}})[_0x3c5b('0x38')](handleEntityNotFound(_0x1cf699,null))[_0x3c5b('0x38')](saveUpdates(_0x5a239[_0x3c5b('0x62')],null))['then'](respondWithResult(_0x1cf699,null))[_0x3c5b('0x2c')](handleError(_0x1cf699,null));};exports[_0x3c5b('0x79')]=function(_0x29f1fb,_0xe96c4,_0x37c672){_0x29f1fb[_0x3c5b('0x62')][_0x3c5b('0x7a')]=_0x29f1fb['file'][_0x3c5b('0x78')];return db['ChatWebsite'][_0x3c5b('0x60')]({'where':{'id':_0x29f1fb[_0x3c5b('0x5d')]['id']}})[_0x3c5b('0x38')](handleEntityNotFound(_0xe96c4,null))[_0x3c5b('0x38')](saveUpdates(_0x29f1fb[_0x3c5b('0x62')],null))[_0x3c5b('0x38')](respondWithResult(_0xe96c4,null))[_0x3c5b('0x2c')](handleError(_0xe96c4,null));};exports[_0x3c5b('0x7b')]=function(_0x37a1b8,_0x4537d4,_0x18bb13){_0x37a1b8[_0x3c5b('0x62')][_0x3c5b('0x7c')]=_0x37a1b8[_0x3c5b('0x77')][_0x3c5b('0x78')];return db[_0x3c5b('0x41')][_0x3c5b('0x60')]({'where':{'id':_0x37a1b8[_0x3c5b('0x5d')]['id']}})[_0x3c5b('0x38')](handleEntityNotFound(_0x4537d4,null))[_0x3c5b('0x38')](saveUpdates(_0x37a1b8[_0x3c5b('0x62')],null))[_0x3c5b('0x38')](respondWithResult(_0x4537d4,null))['catch'](handleError(_0x4537d4,null));};exports['addSystemAvatar']=function(_0x301b5f,_0x50f787,_0x1fad2d){_0x301b5f['body'][_0x3c5b('0x7d')]=_0x301b5f[_0x3c5b('0x77')][_0x3c5b('0x78')];return db[_0x3c5b('0x41')]['find']({'where':{'id':_0x301b5f[_0x3c5b('0x5d')]['id']}})[_0x3c5b('0x38')](handleEntityNotFound(_0x50f787,null))[_0x3c5b('0x38')](saveUpdates(_0x301b5f[_0x3c5b('0x62')],null))[_0x3c5b('0x38')](respondWithResult(_0x50f787,null))['catch'](handleError(_0x50f787,null));};exports[_0x3c5b('0x7e')]=function(_0x12ec7e,_0x48dda6,_0x41802d){var _0x14f335=path[_0x3c5b('0x7f')](config[_0x3c5b('0x80')],_0x3c5b('0x81'));var _0x7280c9={'where':{'id':_0x12ec7e['params']['id']},'attributes':['id',_0x3c5b('0x82')],'raw':!![]};var _0x7086c2=![];return require('../../config/license/util')['getLicense']()[_0x3c5b('0x38')](function(_0x2c14ac){if(_0x2c14ac){_0x7086c2=_0x2c14ac[_0x3c5b('0x83')];}})[_0x3c5b('0x38')](function(){return db[_0x3c5b('0x41')][_0x3c5b('0x60')](_0x7280c9);})[_0x3c5b('0x38')](handleEntityNotFound(_0x48dda6,null))['then'](function(_0x347ba6){if(_0x347ba6){if(!_[_0x3c5b('0x84')](_0x347ba6[_0x3c5b('0x82')])){if(fs['existsSync'](path[_0x3c5b('0x7f')](config[_0x3c5b('0x80')],'server/files/images/logos/',_0x347ba6['sitepic']))&&_0x7086c2){_0x14f335=path[_0x3c5b('0x7f')](config['root'],_0x3c5b('0x85'),_0x347ba6['sitepic']);}}return _0x48dda6[_0x3c5b('0x86')](_0x14f335);}})[_0x3c5b('0x2c')](handleError(_0x48dda6,null));};exports['getAvatar']=function(_0xb3bf88,_0x218fcf,_0x546f3e){var _0x1da1d9=path[_0x3c5b('0x7f')](config['root'],_0x3c5b('0x87'));var _0x2a205d={'where':{'id':_0xb3bf88['params']['id']},'attributes':['id',_0x3c5b('0x7a')],'raw':!![]};return db['ChatWebsite'][_0x3c5b('0x60')](_0x2a205d)[_0x3c5b('0x38')](handleEntityNotFound(_0x218fcf,null))[_0x3c5b('0x38')](function(_0x50436d){if(_0x50436d){if(!_[_0x3c5b('0x84')](_0x50436d['agentAvatar'])){if(fs['existsSync'](path[_0x3c5b('0x7f')](config[_0x3c5b('0x80')],_0x3c5b('0x88'),_0x50436d[_0x3c5b('0x7a')]))){_0x1da1d9=path[_0x3c5b('0x7f')](config[_0x3c5b('0x80')],_0x3c5b('0x88'),_0x50436d['agentAvatar']);}}return _0x218fcf[_0x3c5b('0x86')](_0x1da1d9);}})[_0x3c5b('0x2c')](handleError(_0x218fcf,null));};exports['getCustomerAvatar']=function(_0x52b09d,_0x108022,_0x438897){var _0x54e6c0=path[_0x3c5b('0x7f')](config[_0x3c5b('0x80')],_0x3c5b('0x89'));var _0x5501df={'where':{'id':_0x52b09d[_0x3c5b('0x5d')]['id']},'attributes':['id',_0x3c5b('0x7c'),_0x3c5b('0x8a')],'raw':!![]};return db['ChatWebsite']['find'](_0x5501df)[_0x3c5b('0x38')](handleEntityNotFound(_0x108022,null))[_0x3c5b('0x38')](function(_0x119793){if(_0x119793){if(!_[_0x3c5b('0x84')](_0x119793['customerAvatar'])){if(fs['existsSync'](path['join'](config[_0x3c5b('0x80')],'server/files/images/avatars/',_0x119793['customerAvatar']))&&_0x119793[_0x3c5b('0x8a')]){_0x54e6c0=path[_0x3c5b('0x7f')](config[_0x3c5b('0x80')],_0x3c5b('0x88'),_0x119793['customerAvatar']);}}return _0x108022[_0x3c5b('0x86')](_0x54e6c0);}})['catch'](handleError(_0x108022,null));};exports[_0x3c5b('0x8b')]=function(_0x4db89f,_0x30815c,_0x341314){var _0x1b94e2=path[_0x3c5b('0x7f')](config['root'],_0x3c5b('0x8c'));var _0x510e14={'where':{'id':_0x4db89f[_0x3c5b('0x5d')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x3c5b('0x41')][_0x3c5b('0x60')](_0x510e14)[_0x3c5b('0x38')](handleEntityNotFound(_0x30815c,null))[_0x3c5b('0x38')](function(_0x108209){if(_0x108209){if(!_['isNil'](_0x108209['systemAvatar'])){if(fs[_0x3c5b('0x8d')](path[_0x3c5b('0x7f')](config[_0x3c5b('0x80')],_0x3c5b('0x88'),_0x108209[_0x3c5b('0x7d')]))){_0x1b94e2=path['join'](config['root'],_0x3c5b('0x88'),_0x108209[_0x3c5b('0x7d')]);}}return _0x30815c['download'](_0x1b94e2);}})[_0x3c5b('0x2c')](handleError(_0x30815c,null));};exports[_0x3c5b('0x8e')]=function(_0x2919a4,_0x43ed19,_0x4a221b){var _0x50c624=require('user-agent-parser');var _0x3634a2=new _0x50c624();var _0xe65b8b=_0x3634a2['setUA'](_0x2919a4[_0x3c5b('0x8f')]['user-agent'])[_0x3c5b('0x90')]();var _0x4f6554={'body':_0x2919a4['body'],'channel':_0x3c5b('0x91')};var _0x2eed20=[];var _0xb4f635=[];var _0x901a10={};var _0x1981d6=![];return db[_0x3c5b('0x92')][_0x3c5b('0x6a')]()['then'](function(_0x1bf079){if(!_0x1bf079){throw new db[(_0x3c5b('0x93'))][(_0x3c5b('0x94'))](_0x3c5b('0x95'));}_0x2eed20=_['difference'](_[_0x3c5b('0x5f')](_0x1bf079),[_0x3c5b('0x96'),_0x3c5b('0x97')]);_0xb4f635=_[_0x3c5b('0x98')](_['keys'](_0x1bf079),[_0x3c5b('0x96'),_0x3c5b('0x97'),_0x3c5b('0x99'),_0x3c5b('0x9a')]);if(_0x2919a4[_0x3c5b('0x62')]['id']){delete _0x2919a4[_0x3c5b('0x62')]['id'];}if(_['isNil'](_0x2919a4[_0x3c5b('0x62')][_0x3c5b('0x9b')])){throw new db[(_0x3c5b('0x93'))][(_0x3c5b('0x94'))](_0x3c5b('0x9c'));}if(_['isNil'](_0x2919a4[_0x3c5b('0x62')][_0x3c5b('0x62')])||_0x2919a4[_0x3c5b('0x62')][_0x3c5b('0x62')]===''){throw new db['Sequelize'][(_0x3c5b('0x94'))](_0x3c5b('0x9d'));}if(_[_0x3c5b('0x84')](_0x2919a4['body'][_0x3c5b('0x9e')])){throw new db[(_0x3c5b('0x93'))][(_0x3c5b('0x94'))](_0x3c5b('0x9f')+_0xb4f635);}if(!_[_0x3c5b('0xa0')](_0xb4f635,_0x2919a4[_0x3c5b('0x62')]['mapKey'])){throw new db[(_0x3c5b('0x93'))][(_0x3c5b('0x94'))](_0x3c5b('0xa1')+_0xb4f635);}_0x901a10[_0x2919a4['body'][_0x3c5b('0x9e')]]=_0x2919a4[_0x3c5b('0x62')][_0x3c5b('0x9b')];})[_0x3c5b('0x38')](function(){return db['ChatWebsite']['find']({'where':{'id':_0x2919a4[_0x3c5b('0x5d')]['id']},'include':[{'model':db[_0x3c5b('0xa2')],'as':_0x3c5b('0xa3'),'include':[{'model':db['CmContact'],'as':_0x3c5b('0xa4'),'where':_0x901a10,'limit':0x1,'order':[[_0x3c5b('0x97'),_0x3c5b('0xa5')]]}]},{'model':db[_0x3c5b('0xa6')],'as':'Applications'}]});})[_0x3c5b('0x38')](handleEntityNotFound(_0x43ed19,null))[_0x3c5b('0x38')](function(_0x5260c9){if(_0x5260c9&&_0x5260c9[_0x3c5b('0xa3')]){_0x4f6554[_0x3c5b('0xa7')]=_0x5260c9;_0x4f6554[_0x3c5b('0xa8')]=_0x5260c9['Applications'];_0x4f6554[_0x3c5b('0xa9')]=_0x5260c9['List'];_0x4f6554[_0x3c5b('0xa8')]=_[_0x3c5b('0xaa')](_0x4f6554[_0x3c5b('0xa8')],[_0x3c5b('0xab')],[_0x3c5b('0xac')]);if(_0x4f6554[_0x3c5b('0xa7')]['Applications']){delete _0x4f6554[_0x3c5b('0xa7')][_0x3c5b('0xad')];}if(_0x4f6554[_0x3c5b('0xa7')][_0x3c5b('0xa3')]&&_0x4f6554[_0x3c5b('0xa7')][_0x3c5b('0xa3')][_0x3c5b('0xa4')]['length']){return _0x4f6554[_0x3c5b('0xa7')][_0x3c5b('0xa3')]['Contacts'][0x0];}var _0x2416ea=_[_0x3c5b('0x1b')](_0x2919a4['body'],{'firstName':_0x2919a4['body'][_0x3c5b('0x9b')],'ListId':_0x5260c9['ListId']});_0x2416ea[_0x2919a4[_0x3c5b('0x62')][_0x3c5b('0x9e')]]=_0x2919a4[_0x3c5b('0x62')][_0x3c5b('0x9b')];return db['CmContact'][_0x3c5b('0x61')](_0x2416ea,{'fields':_0x2eed20,'raw':!![]});}})[_0x3c5b('0x38')](handleEntityNotFound(_0x43ed19,null))['then'](function(_0x1b2d7a){_0x4f6554[_0x3c5b('0xae')]=_0x1b2d7a;var _0x36ac0e=_0x2919a4[_0x3c5b('0x62')][_0x3c5b('0xaf')];if(_0x2919a4[_0x3c5b('0x8f')]['cf-connecting-ip']){_0x36ac0e=_0x2919a4[_0x3c5b('0x8f')]['cf-connecting-ip'];}else if(_0x2919a4[_0x3c5b('0x8f')][_0x3c5b('0xb0')]){_0x36ac0e=_[_0x3c5b('0xb1')](_0x2919a4[_0x3c5b('0x8f')]['x-forwarded-for'][_0x3c5b('0xb2')](','));}if(_0x1b2d7a){var _0x36118c={'ContactId':_0x1b2d7a['id'],'ChatWebsiteId':_0x2919a4[_0x3c5b('0x5d')]['id'],'from':(_0x1b2d7a[_0x3c5b('0xb3')]||'')+'\x20'+(_0x1b2d7a['lastName']||''),'customerIp':_0x36ac0e,'customerPort':_0x2919a4['headers'][_0x3c5b('0xb4')]?_0x2919a4['headers']['x-real-port']:null,'referer':_0x2919a4['body'][_0x3c5b('0xb5')],'browserName':_0xe65b8b[_0x3c5b('0xb6')]['name']&&_0xe65b8b[_0x3c5b('0xb6')][_0x3c5b('0xb7')]?util['format']('%s\x20%s',_0xe65b8b[_0x3c5b('0xb6')][_0x3c5b('0x3d')],_0xe65b8b[_0x3c5b('0xb6')][_0x3c5b('0xb7')]):_0x3c5b('0xb8'),'browserVersion':_0xe65b8b[_0x3c5b('0xb6')][_0x3c5b('0xb7')]||_0x3c5b('0xb8'),'osName':util['format'](_0x3c5b('0xb9'),_0xe65b8b['os'][_0x3c5b('0x3d')],_0xe65b8b['os']['version']),'osVersion':_0xe65b8b['os']['version'],'deviceModel':_0xe65b8b[_0x3c5b('0xba')]['model']&&_0xe65b8b['device'][_0x3c5b('0xbb')]?util[_0x3c5b('0xbc')](_0x3c5b('0xbd'),_0xe65b8b[_0x3c5b('0xba')]['model'],_0xe65b8b[_0x3c5b('0xba')]['vendor'],_0xe65b8b[_0x3c5b('0xba')][_0x3c5b('0x53')]):null,'deviceVendor':_0xe65b8b['device'][_0x3c5b('0xbb')],'deviceType':_0xe65b8b[_0x3c5b('0xba')][_0x3c5b('0x53')],'formData':JSON['stringify'](_0x2919a4[_0x3c5b('0x62')])};var _0x38485d={'ChatWebsiteId':_0x2919a4[_0x3c5b('0x5d')]['id'],'closed':![]};if(_0x2919a4['body'][_0x3c5b('0xbe')]){_0x38485d['threadId']=_0x2919a4['body'][_0x3c5b('0xbe')];return db[_0x3c5b('0xbf')]['find']({'where':_0x38485d})['then'](function(_0x278f36){if(_0x278f36){return[_0x278f36,![]];}_0x36118c['threadId']=_0x2919a4[_0x3c5b('0x62')][_0x3c5b('0xbe')];_0x36118c['externalUrl']=_0x2919a4[_0x3c5b('0x62')][_0x3c5b('0xc0')];return db['ChatInteraction'][_0x3c5b('0x61')](_0x36118c)[_0x3c5b('0x38')](function(_0x43c49d){return[_0x43c49d,!![]];});});}_0x38485d[_0x3c5b('0xc1')]=_0x1b2d7a['id'];if(_0x2919a4[_0x3c5b('0x62')][_0x3c5b('0xc2')]&&_0x2919a4[_0x3c5b('0x62')][_0x3c5b('0xc2')]['id']){_0x38485d['id']=_0x2919a4[_0x3c5b('0x62')][_0x3c5b('0xc2')]['id'];return db[_0x3c5b('0xbf')][_0x3c5b('0x60')]({'where':_0x38485d})[_0x3c5b('0x38')](function(_0x2c59ac){if(_0x2c59ac){return[_0x2c59ac,![]];}return db['ChatInteraction'][_0x3c5b('0x61')](_0x36118c)[_0x3c5b('0x38')](function(_0x2f8a72){return[_0x2f8a72,!![]];});});}return db[_0x3c5b('0xbf')]['create'](_0x36118c)[_0x3c5b('0x38')](function(_0x14f8b3){return[_0x14f8b3,!![]];});}})['spread'](function(_0x7e1693,_0x238d06){if(_0x7e1693){_0x1981d6=_0x238d06;if(!_0x238d06){var _0x4a13d1={'from':(_0x4f6554[_0x3c5b('0xae')][_0x3c5b('0xb3')]||'')+'\x20'+(_0x4f6554[_0x3c5b('0xae')][_0x3c5b('0xc3')]||'')};if(_0x2919a4[_0x3c5b('0x62')][_0x3c5b('0xbe')]&&_0x2919a4[_0x3c5b('0x62')][_0x3c5b('0xc4')]&&_0x2919a4[_0x3c5b('0x62')][_0x3c5b('0xbe')]!=_0x2919a4[_0x3c5b('0x62')][_0x3c5b('0xc4')]){_0x4a13d1[_0x3c5b('0xbe')]=_0x2919a4['body']['messageId'];}return _0x7e1693['update'](_0x4a13d1);}else{return _0x7e1693;}}})[_0x3c5b('0x38')](function(_0x5d5500){_0x4f6554[_0x3c5b('0xc2')]=_0x5d5500['get']({'plain':!![]});_0x4f6554['interaction'][_0x3c5b('0xc5')]=_0x1981d6;if(_0x4f6554['interaction'][_0x3c5b('0xc5')]){if(_0x4f6554['account'][_0x3c5b('0xc6')]){_0x4f6554[_0x3c5b('0xa8')][_0x3c5b('0xc7')]({'id':0x0,'priority':_0x4f6554[_0x3c5b('0xa8')][_0x3c5b('0x4a')]+0x1,'app':'close','appdata':_0x3c5b('0xc8'),'interval':_0x3c5b('0xc9')});}}return db[_0x3c5b('0xca')][_0x3c5b('0x61')]({'body':_0x2919a4[_0x3c5b('0x62')][_0x3c5b('0x62')],'ChatWebsiteId':_0x2919a4['params']['id'],'ChatInteractionId':_0x5d5500['id'],'direction':'in','ContactId':_0x4f6554[_0x3c5b('0xae')]['id'],'AttachmentId':_0x2919a4[_0x3c5b('0x62')][_0x3c5b('0xcb')]});})[_0x3c5b('0x38')](function(_0x1ec6b4){_0x4f6554['message']=_0x1ec6b4;if(_0x4f6554[_0x3c5b('0xc2')][_0x3c5b('0xcc')]){return db[_0x3c5b('0xcd')][_0x3c5b('0x60')]({'attributes':['id',_0x3c5b('0x3d')],'where':{'id':_0x4f6554[_0x3c5b('0xc2')][_0x3c5b('0xcc')]}})['then'](function(_0x364c95){if(_0x364c95){_0x4f6554[_0x3c5b('0xa8')][_0x3c5b('0xce')]({'id':0x0,'priority':0x0,'app':_0x3c5b('0xcf'),'appdata':_0x364c95[_0x3c5b('0x3d')]+','+(_0x4f6554[_0x3c5b('0xa7')]['waitForTheAssignedAgent']||0xa),'interval':_0x3c5b('0xc9')});_0x4f6554['forcedOwnership']=!![];}return respondWithRpcPromise('Start',_0x3c5b('0xd0'),_0x4f6554);});}return respondWithRpcPromise(_0x3c5b('0xd1'),_0x3c5b('0xd0'),_0x4f6554);})[_0x3c5b('0x38')](function(_0x31ba4d){respondWithRpcPromise(_0x3c5b('0xd2'),_0x3c5b('0xd2'),{'event':_0x3c5b('0x8e'),'message':_0x31ba4d},client9002);return _0x31ba4d;})[_0x3c5b('0x38')](respondWithResult(_0x43ed19,null))[_0x3c5b('0x2c')](handleError(_0x43ed19,null));};exports[_0x3c5b('0xd3')]=function(_0x44b7a2,_0x4a6fa4,_0x36dd51){var _0x53a65d,_0x11f268,_0x27f28f;var _0x5dfc90=[];var _0xc015c5=[];var _0x5daff8={};return db['CmContact']['describe']()['then'](function(_0x98c78a){if(!_0x98c78a){throw new db[(_0x3c5b('0x93'))][(_0x3c5b('0x94'))](_0x3c5b('0x95'));}_0xc015c5=_[_0x3c5b('0x98')](_[_0x3c5b('0x5f')](_0x98c78a),[_0x3c5b('0x96'),_0x3c5b('0x97')]);_0x5dfc90=_[_0x3c5b('0x98')](_[_0x3c5b('0x5f')](_0x98c78a),[_0x3c5b('0x96'),_0x3c5b('0x97'),_0x3c5b('0x99'),_0x3c5b('0x9a')]);if(_0x44b7a2[_0x3c5b('0x62')]['id']){delete _0x44b7a2[_0x3c5b('0x62')]['id'];}if(_[_0x3c5b('0x84')](_0x44b7a2[_0x3c5b('0x62')][_0x3c5b('0x9b')])){throw _0x4a6fa4[_0x3c5b('0x2e')](0x1f4)[_0x3c5b('0x3e')](new db['Sequelize']['ValidationError']('from\x20is\x20mandatory'));}if(_[_0x3c5b('0x84')](_0x44b7a2[_0x3c5b('0x62')][_0x3c5b('0x62')])||_0x44b7a2['body'][_0x3c5b('0x62')]===''){throw _0x4a6fa4['status'](0x1f4)[_0x3c5b('0x3e')](new db[(_0x3c5b('0x93'))]['ValidationError'](_0x3c5b('0x9d')));}if(_[_0x3c5b('0x84')](_0x44b7a2[_0x3c5b('0x62')]['mapKeyOffline'])){throw _0x4a6fa4[_0x3c5b('0x2e')](0x1f4)[_0x3c5b('0x3e')](new db[(_0x3c5b('0x93'))][(_0x3c5b('0x94'))](_0x3c5b('0xd4')+_0x5dfc90));}if(!_[_0x3c5b('0xa0')](_0x5dfc90,_0x44b7a2['body'][_0x3c5b('0xd5')])){throw _0x4a6fa4[_0x3c5b('0x2e')](0x1f4)[_0x3c5b('0x3e')](new db[(_0x3c5b('0x93'))]['ValidationError']('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5dfc90));}_0x5daff8[_0x44b7a2[_0x3c5b('0x62')][_0x3c5b('0xd5')]]=_0x44b7a2[_0x3c5b('0x62')][_0x3c5b('0x9b')];})[_0x3c5b('0x38')](function(){return db[_0x3c5b('0x41')]['find']({'where':{'id':_0x44b7a2['params']['id']},'include':[{'model':db[_0x3c5b('0xa2')],'as':_0x3c5b('0xa3')}]});})[_0x3c5b('0x38')](handleEntityNotFound(_0x4a6fa4,null))['then'](function(_0x5b30e3){if(_0x5b30e3&&_0x5b30e3[_0x3c5b('0xa3')]){_0x11f268=_0x5b30e3;var _0x4846c7=_['defaults'](_0x44b7a2[_0x3c5b('0x62')],{'firstName':_0x44b7a2[_0x3c5b('0x62')][_0x3c5b('0x9b')],'phone':_0x44b7a2[_0x3c5b('0x62')][_0x3c5b('0x9b')],'ListId':_0x5b30e3['ListId']});_0x4846c7[_0x44b7a2[_0x3c5b('0x62')][_0x3c5b('0xd5')]]=_0x44b7a2[_0x3c5b('0x62')][_0x3c5b('0x9b')];return db[_0x3c5b('0x92')][_0x3c5b('0xd6')]({'where':_0x5daff8,'defaults':_0x4846c7});}})[_0x3c5b('0xd7')](function(_0x54b55b){if(_0x54b55b){_0x27f28f=_0x54b55b;var _0x1fb1c5=fs[_0x3c5b('0xd8')](path['join'](config[_0x3c5b('0x80')],_0x3c5b('0xd9')),'utf8');var _0x682437=ejs[_0x3c5b('0xda')](_0x1fb1c5,{'body':_[_0x3c5b('0xdb')](_0x44b7a2['body'][_0x3c5b('0x62')]),'bodyTitle':_0x11f268['offlineMessageBody']});return db[_0x3c5b('0xdc')][_0x3c5b('0x61')]({'body':_0x682437,'ContactId':_0x54b55b['id'],'ChatWebsiteId':_0x11f268['id']});}})[_0x3c5b('0x38')](function(_0x105c35){if(_0x105c35){_0x53a65d=_0x105c35;return db[_0x3c5b('0xdd')][_0x3c5b('0x72')]({'where':{'service':!![]},'include':[{'model':db[_0x3c5b('0xde')],'as':_0x3c5b('0xdf'),'raw':!![]}]});}})['then'](function(_0xf6d15c){if(_0xf6d15c&&_0xf6d15c[_0x3c5b('0xdf')]&&_0x11f268[_0x3c5b('0xe0')]){var _0x30b89b={'tls':{'rejectUnauthorized':![]}};if(_0xf6d15c['Smtp'][_0x3c5b('0xe1')]){_0x30b89b['service']=_0xf6d15c['Smtp']['service'];}else{_0x30b89b[_0x3c5b('0xe2')]=_0xf6d15c[_0x3c5b('0xdf')][_0x3c5b('0xe2')];_0x30b89b[_0x3c5b('0xe3')]=_0xf6d15c[_0x3c5b('0xdf')][_0x3c5b('0xe3')];_0x30b89b[_0x3c5b('0xe4')]=_0xf6d15c['Smtp'][_0x3c5b('0xe4')];}if(_0xf6d15c[_0x3c5b('0xdf')][_0x3c5b('0xe5')]){_0x30b89b[_0x3c5b('0xe6')]={'user':_0xf6d15c[_0x3c5b('0xdf')]['user'],'pass':_0xf6d15c[_0x3c5b('0xdf')][_0x3c5b('0xe7')]};}return respondWithRpcPromise(_0x3c5b('0xe8'),'sendMail',{'account':_0x30b89b,'message':{'from':util[_0x3c5b('0xbc')](_0x3c5b('0xe9'),_0xf6d15c['name'],_0xf6d15c[_0x3c5b('0xea')]||_0xf6d15c['Smtp'][_0x3c5b('0x66')]),'to':_0x11f268['forwardOfflineAddress'],'subject':_0x11f268[_0x3c5b('0xeb')],'text':_0x53a65d[_0x3c5b('0x62')]}},client9003)[_0x3c5b('0x38')](function(){return _0x53a65d;})[_0x3c5b('0x2c')](function(_0x2ffc3c){console['error'](_0x2ffc3c);});}})[_0x3c5b('0x38')](function(){if(_0x53a65d){return _0x53a65d;}})[_0x3c5b('0x38')](respondWithResult(_0x4a6fa4,null))[_0x3c5b('0x2c')](handleError(_0x4a6fa4,null));};exports[_0x3c5b('0xec')]=function(_0x143baf,_0x56afd6,_0x162ff5){return db['ChatInteraction']['find']({'where':{'id':_0x143baf[_0x3c5b('0x5d')]['id']}})[_0x3c5b('0x38')](handleEntityNotFound(_0x56afd6,null))[_0x3c5b('0x38')](function(_0x9b62db){if(_0x9b62db){return _0x9b62db[_0x3c5b('0xec')](_0x143baf[_0x3c5b('0x62')][_0x3c5b('0x75')],_[_0x3c5b('0xed')](_0x143baf['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x56afd6,null))[_0x3c5b('0x2c')](handleError(_0x56afd6,null));};exports[_0x3c5b('0xee')]=function(_0x330d24,_0x2ec27d,_0x4c1ff7){var _0x3f9a4a={'raw':![],'where':{}};var _0x2bd990={};var _0x46ed7c={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x3c5b('0x72')]({'where':{'id':_0x330d24[_0x3c5b('0x5d')]['id']}})[_0x3c5b('0x38')](handleEntityNotFound(_0x2ec27d,null))[_0x3c5b('0x38')](function(_0x32c003){if(_0x32c003){_0x2bd990[_0x3c5b('0x47')]=_[_0x3c5b('0x5f')](db[_0x3c5b('0xbf')][_0x3c5b('0x42')]);_0x2bd990[_0x3c5b('0x44')]=_['keys'](_0x330d24['query']);_0x2bd990['filters']=_[_0x3c5b('0x46')](_0x2bd990[_0x3c5b('0x47')],_0x2bd990[_0x3c5b('0x44')]);_0x3f9a4a[_0x3c5b('0x49')]=_[_0x3c5b('0x46')](_0x2bd990[_0x3c5b('0x47')],qs[_0x3c5b('0x48')](_0x330d24[_0x3c5b('0x44')][_0x3c5b('0x48')]));_0x3f9a4a['attributes']=_0x3f9a4a[_0x3c5b('0x49')]['length']?_0x3f9a4a['attributes']:_0x2bd990[_0x3c5b('0x47')];if(!_0x330d24['query'][_0x3c5b('0x4b')](_0x3c5b('0x73'))){_0x3f9a4a[_0x3c5b('0x31')]=qs[_0x3c5b('0x31')](_0x330d24[_0x3c5b('0x44')][_0x3c5b('0x31')]);_0x3f9a4a[_0x3c5b('0x4c')]=qs[_0x3c5b('0x4c')](_0x330d24[_0x3c5b('0x44')][_0x3c5b('0x4c')]);}_0x3f9a4a[_0x3c5b('0x4d')]=qs[_0x3c5b('0x4e')](_0x330d24[_0x3c5b('0x44')]['sort']);_0x3f9a4a[_0x3c5b('0x51')]=qs[_0x3c5b('0x45')](_['pick'](_0x330d24[_0x3c5b('0x44')],_0x2bd990['filters']));_0x3f9a4a['where']['ChatWebsiteId']=_0x32c003['id'];if(_0x330d24['query'][_0x3c5b('0x50')]){_0x3f9a4a['where']=_[_0x3c5b('0x52')](_0x3f9a4a['where'],{'$or':_[_0x3c5b('0x40')](_0x3f9a4a[_0x3c5b('0x49')],function(_0x53ed39){var _0x3a0f10={};_0x3a0f10[_0x53ed39]={'$like':'%'+_0x330d24['query'][_0x3c5b('0x50')]+'%'};return _0x3a0f10;})});}_0x3f9a4a=_[_0x3c5b('0x52')]({},_0x3f9a4a,_0x330d24[_0x3c5b('0x57')]);return db[_0x3c5b('0xbf')][_0x3c5b('0x30')]({'where':_0x3f9a4a['where']})[_0x3c5b('0x38')](function(_0x1a71e2){_0x46ed7c[_0x3c5b('0x30')]=_0x1a71e2;if(_0x330d24[_0x3c5b('0x44')][_0x3c5b('0x58')]){_0x3f9a4a[_0x3c5b('0x59')]=[{'model':db[_0x3c5b('0x92')],'as':_0x3c5b('0xef'),'required':![]},{'model':db[_0x3c5b('0xcd')],'as':_0x3c5b('0xf0'),'attributes':[_0x3c5b('0x3d'),_0x3c5b('0xf1'),_0x3c5b('0xf2')],'required':![]},{'model':db[_0x3c5b('0xf3')],'as':_0x3c5b('0xf4'),'attributes':['id',_0x3c5b('0x3d'),'color'],'where':_0x330d24[_0x3c5b('0x44')][_0x3c5b('0xf5')]?{'id':_0x330d24[_0x3c5b('0x44')]['tag']}:undefined,'required':_0x330d24['query'][_0x3c5b('0xf5')]?!![]:![]}];}return db[_0x3c5b('0xbf')][_0x3c5b('0x5a')](_0x3f9a4a);})[_0x3c5b('0x38')](function(_0x1f9c6a){_0x46ed7c[_0x3c5b('0x5b')]=_0x1f9c6a;return _0x46ed7c;});}})[_0x3c5b('0x38')](respondWithFilteredResult(_0x2ec27d,_0x3f9a4a))['catch'](handleError(_0x2ec27d,null));};function iftimePromise(_0x1355f0,_0x17e6ec){return respondWithRpcPromise(_0x3c5b('0xf6'),_0x3c5b('0xf7'),{'command':_0x17e6ec['timezone']?util[_0x3c5b('0xbc')](_0x3c5b('0xf8'),_0x1355f0['interval'],_0x17e6ec[_0x3c5b('0xf9')]):util[_0x3c5b('0xbc')](_0x3c5b('0xfa'),_0x1355f0['interval'])},client9002)['then'](function(_0x7e6f43){var _0x57d1f4=_0x7e6f43&&_0x7e6f43[_0x3c5b('0xfb')]('true')>=0x0?!![]:![];logger[_0x3c5b('0x23')](_0x3c5b('0xfc'),_0x17e6ec['id'],_0x1355f0['id'],_0x1355f0[_0x3c5b('0xfd')],_0x57d1f4?_0x3c5b('0xfe'):_0x3c5b('0xff'),_0x17e6ec['timezone']?_0x17e6ec['timezone']:_0x3c5b('0x100'));return _0x57d1f4;})[_0x3c5b('0x2c')](function(_0x1462e4){logger[_0x3c5b('0x28')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x17e6ec['id'],_0x1355f0['id'],_0x1355f0['interval'],util[_0x3c5b('0x101')](_0x1462e4,{'showHidden':![],'depth':null}),_0x17e6ec['timezone']?_0x17e6ec[_0x3c5b('0xf9')]:_0x3c5b('0x100'));return![];});}exports[_0x3c5b('0xf7')]=function(_0x3712de,_0x4fc023,_0x4c76ff){var _0x23543d=0x0;var _0x29c54c=0x0;var _0x553297=![];var _0x3e2222;var _0x31fc1e;return db[_0x3c5b('0x41')][_0x3c5b('0x60')]({'where':{'id':_0x3712de[_0x3c5b('0x5d')]['id']},'include':[{'model':db[_0x3c5b('0x102')],'as':_0x3c5b('0x102'),'include':[{'model':db[_0x3c5b('0x102')],'as':_0x3c5b('0x103'),'attributes':['id',_0x3c5b('0xfd')],'raw':!![]}]}]})[_0x3c5b('0x38')](handleEntityNotFound(_0x4fc023,null))[_0x3c5b('0x38')](function(_0x56efdd){if(_0x56efdd){_0x3e2222=_0x56efdd;return _0x56efdd[_0x3c5b('0x104')]({'raw':!![]});}})[_0x3c5b('0x38')](function(_0x32a494){if(_0x3e2222){if(_0x32a494){_0x31fc1e=_0x32a494;}}return require(_0x3c5b('0x105'))[_0x3c5b('0x106')]();})[_0x3c5b('0x38')](function(_0x4d7660){if(_0x4d7660){_0x29c54c=_0x4d7660[_0x3c5b('0x107')];_0x553297=_0x4d7660[_0x3c5b('0x83')];}})[_0x3c5b('0x38')](function(){return db['ChatInteraction'][_0x3c5b('0x30')]({'where':{'closed':![]}});})[_0x3c5b('0x38')](function(_0x593c77){_0x23543d=_0x593c77;if(_0x29c54c&&_0x593c77>_0x29c54c){return db[_0x3c5b('0x108')][_0x3c5b('0x72')]({'where':{'id':0x1}})[_0x3c5b('0x38')](function(_0xde3ed1){if(_0xde3ed1){_0xde3ed1[_0x3c5b('0x109')](_0x3c5b('0x10a'));}});}})[_0x3c5b('0x38')](function(){if(_0x3e2222[_0x3c5b('0x102')]&&_0x3e2222[_0x3c5b('0x102')][_0x3c5b('0x103')]){var _0x39c403=[];for(var _0x3f6e2a=0x0;_0x3f6e2a<_0x3e2222[_0x3c5b('0x102')]['Intervals'][_0x3c5b('0x4a')];_0x3f6e2a++){var _0x456691=_0x3e2222['Interval'][_0x3c5b('0x103')][_0x3f6e2a][_0x3c5b('0x63')]({'plain':!![]});_0x39c403[_0x3c5b('0xc7')](iftimePromise(_0x456691,_0x3e2222));}return BPromise['all'](_0x39c403)['then'](function(_0x4220cb){return _[_0x3c5b('0x10b')](_0x4220cb);});}else{return!![];}})[_0x3c5b('0x38')](function(_0x55c178){var _0x175e1d=fs[_0x3c5b('0xd8')](path[_0x3c5b('0x7f')](config[_0x3c5b('0x80')],_0x3c5b('0x10c')),'utf8');var _0x2111ba={'remote':_0x3e2222[_0x3c5b('0x10d')],'query':querystring[_0x3c5b('0x27')](_[_0x3c5b('0x52')](_0x3e2222[_0x3c5b('0x63')]({'plain':!![]}),{'customerIp':_0x3712de[_0x3c5b('0x8f')][_0x3c5b('0xb0')]||_0x3712de[_0x3c5b('0x8f')][_0x3c5b('0x10e')]||_0x3712de[_0x3c5b('0x10f')][_0x3c5b('0x110')]||_0x3712de['ip'],'referer':_0x3712de['headers']['referer'],'openedInteractions':_0x23543d,'maxInteractions':_0x29c54c,'virtual':_0x553297[_0x3c5b('0x107')],'online':_0x55c178,'custom':_0x553297}))['replace'](/'/g,'\x5c\x27')};_0x4fc023[_0x3c5b('0x3e')](ejs[_0x3c5b('0xda')](Mustache[_0x3c5b('0xda')](_0x175e1d,_0x2111ba),{'proactiveActions':_0x31fc1e,'alignment':_0x3e2222[_0x3c5b('0x111')],'verticalAlignment':_0x3e2222['verticalAlignment']}));})[_0x3c5b('0x2c')](handleError(_0x4fc023,null));};exports[_0x3c5b('0x112')]=function(_0x35f8e0,_0x42728d,_0x4081d5){return db[_0x3c5b('0x41')]['findOne']({'where':{'id':_0x35f8e0[_0x3c5b('0x5d')]['id']}})[_0x3c5b('0x38')](handleEntityNotFound(_0x42728d,null))[_0x3c5b('0x38')](function(_0x3e1349){if(_0x3e1349){return db[_0x3c5b('0x113')][_0x3c5b('0x114')](function(_0x2f23f9){return db[_0x3c5b('0xa6')]['destroy']({'where':{'ChatWebsiteId':_0x35f8e0[_0x3c5b('0x5d')]['id']},'transaction':_0x2f23f9})[_0x3c5b('0x38')](function(_0x2b91ff){var _0x4a3046=_[_0x3c5b('0x40')](_0x35f8e0[_0x3c5b('0x62')],function(_0x3fd47a){_0x3fd47a[_0x3c5b('0x6b')]=_0x35f8e0[_0x3c5b('0x5d')]['id'];return _0x3fd47a;});return db[_0x3c5b('0xa6')][_0x3c5b('0x115')](_0x4a3046,{'transaction':_0x2f23f9});});})[_0x3c5b('0x38')](function(){return db[_0x3c5b('0xa6')][_0x3c5b('0x116')]({'where':{'ChatWebsiteId':_0x35f8e0[_0x3c5b('0x5d')]['id']},'order':_0x3c5b('0xab')});});}})[_0x3c5b('0x38')](respondWithResult(_0x42728d,null))[_0x3c5b('0x2c')](handleError(_0x42728d,null));};exports['getApplications']=function(_0x45a27b,_0x38abc5,_0x494090){var _0x43f691={};var _0x552d38={};var _0x24a8db;var _0x3b7500;return db[_0x3c5b('0x41')][_0x3c5b('0x72')]({'where':{'id':_0x45a27b[_0x3c5b('0x5d')]['id']}})['then'](handleEntityNotFound(_0x38abc5,null))[_0x3c5b('0x38')](function(_0x23836b){if(_0x23836b){_0x24a8db=_0x23836b;_0x552d38['model']=_[_0x3c5b('0x5f')](db[_0x3c5b('0xa6')][_0x3c5b('0x42')]);_0x552d38[_0x3c5b('0x44')]=_[_0x3c5b('0x5f')](_0x45a27b['query']);_0x552d38[_0x3c5b('0x45')]=_[_0x3c5b('0x46')](_0x552d38['model'],_0x552d38[_0x3c5b('0x44')]);_0x43f691[_0x3c5b('0x49')]=_['intersection'](_0x552d38['model'],qs[_0x3c5b('0x48')](_0x45a27b['query'][_0x3c5b('0x48')]));_0x43f691['attributes']=_0x43f691['attributes'][_0x3c5b('0x4a')]?_0x43f691[_0x3c5b('0x49')]:_0x552d38[_0x3c5b('0x47')];_0x43f691[_0x3c5b('0x4d')]=qs[_0x3c5b('0x4e')](_0x45a27b[_0x3c5b('0x44')][_0x3c5b('0x4e')]);_0x43f691[_0x3c5b('0x51')]=qs[_0x3c5b('0x45')](_[_0x3c5b('0x4f')](_0x45a27b[_0x3c5b('0x44')],_0x552d38['filters']));if(_0x45a27b['query'][_0x3c5b('0x50')]){_0x43f691[_0x3c5b('0x51')]=_[_0x3c5b('0x52')](_0x43f691[_0x3c5b('0x51')],{'$or':_[_0x3c5b('0x40')](_0x43f691[_0x3c5b('0x49')],function(_0x40a96b){var _0x523664={};_0x523664[_0x40a96b]={'$like':'%'+_0x45a27b[_0x3c5b('0x44')][_0x3c5b('0x50')]+'%'};return _0x523664;})});}_0x43f691=_[_0x3c5b('0x52')]({},_0x43f691,_0x45a27b[_0x3c5b('0x57')]);return _0x24a8db[_0x3c5b('0x117')](_0x43f691);}})[_0x3c5b('0x38')](function(_0x5b8c21){if(_0x5b8c21){_0x3b7500=_0x5b8c21[_0x3c5b('0x4a')];if(!_0x45a27b['query']['hasOwnProperty'](_0x3c5b('0x73'))){_0x43f691[_0x3c5b('0x31')]=qs[_0x3c5b('0x31')](_0x45a27b['query'][_0x3c5b('0x31')]);_0x43f691[_0x3c5b('0x4c')]=qs[_0x3c5b('0x4c')](_0x45a27b[_0x3c5b('0x44')][_0x3c5b('0x4c')]);}return _0x24a8db[_0x3c5b('0x117')](_0x43f691);}})[_0x3c5b('0x38')](function(_0x32045e){if(_0x32045e){return _0x32045e?{'count':_0x3b7500,'rows':_0x32045e}:null;}})[_0x3c5b('0x38')](respondWithResult(_0x38abc5,null))[_0x3c5b('0x2c')](handleError(_0x38abc5,null));};exports[_0x3c5b('0x118')]=function(_0x2809c7,_0x3428cf,_0x2ea499){return db[_0x3c5b('0x119')][_0x3c5b('0x60')]({'where':{'id':_0x2809c7[_0x3c5b('0x5d')]['id']}})[_0x3c5b('0x38')](handleEntityNotFound(_0x3428cf,null))[_0x3c5b('0x38')](function(_0x24beed){if(_0x24beed){return _0x24beed['addProactiveActions'](_0x2809c7[_0x3c5b('0x62')][_0x3c5b('0x75')],_[_0x3c5b('0xed')](_0x2809c7['body'],['ids','id'])||{});}})[_0x3c5b('0x38')](respondWithResult(_0x3428cf,null))[_0x3c5b('0x2c')](handleError(_0x3428cf,null));};exports[_0x3c5b('0x104')]=function(_0x331e9f,_0x1b623c,_0x204908){var _0x1fb5a9={};var _0x12bafd={};var _0x5270c2;var _0x349c3d;return db[_0x3c5b('0x41')][_0x3c5b('0x72')]({'where':{'id':_0x331e9f[_0x3c5b('0x5d')]['id']}})['then'](handleEntityNotFound(_0x1b623c,null))['then'](function(_0x53547a){if(_0x53547a){_0x5270c2=_0x53547a;_0x12bafd[_0x3c5b('0x47')]=_[_0x3c5b('0x5f')](db[_0x3c5b('0x11a')][_0x3c5b('0x42')]);_0x12bafd[_0x3c5b('0x44')]=_[_0x3c5b('0x5f')](_0x331e9f['query']);_0x12bafd['filters']=_['intersection'](_0x12bafd[_0x3c5b('0x47')],_0x12bafd['query']);_0x1fb5a9[_0x3c5b('0x49')]=_[_0x3c5b('0x46')](_0x12bafd[_0x3c5b('0x47')],qs[_0x3c5b('0x48')](_0x331e9f['query'][_0x3c5b('0x48')]));_0x1fb5a9[_0x3c5b('0x49')]=_0x1fb5a9[_0x3c5b('0x49')][_0x3c5b('0x4a')]?_0x1fb5a9[_0x3c5b('0x49')]:_0x12bafd[_0x3c5b('0x47')];_0x1fb5a9['order']=qs['sort'](_0x331e9f['query']['sort']);_0x1fb5a9[_0x3c5b('0x51')]=qs[_0x3c5b('0x45')](_['pick'](_0x331e9f[_0x3c5b('0x44')],_0x12bafd[_0x3c5b('0x45')]));if(_0x331e9f[_0x3c5b('0x44')][_0x3c5b('0x50')]){_0x1fb5a9[_0x3c5b('0x51')]=_[_0x3c5b('0x52')](_0x1fb5a9[_0x3c5b('0x51')],{'$or':_[_0x3c5b('0x40')](_0x1fb5a9['attributes'],function(_0x2e7d51){var _0x99f064={};_0x99f064[_0x2e7d51]={'$like':'%'+_0x331e9f[_0x3c5b('0x44')]['filter']+'%'};return _0x99f064;})});}_0x1fb5a9=_[_0x3c5b('0x52')]({},_0x1fb5a9,_0x331e9f[_0x3c5b('0x57')]);return _0x5270c2[_0x3c5b('0x104')](_0x1fb5a9);}})[_0x3c5b('0x38')](function(_0x15190c){if(_0x15190c){_0x349c3d=_0x15190c['length'];if(!_0x331e9f[_0x3c5b('0x44')][_0x3c5b('0x4b')](_0x3c5b('0x73'))){_0x1fb5a9[_0x3c5b('0x31')]=qs[_0x3c5b('0x31')](_0x331e9f[_0x3c5b('0x44')][_0x3c5b('0x31')]);_0x1fb5a9[_0x3c5b('0x4c')]=qs[_0x3c5b('0x4c')](_0x331e9f[_0x3c5b('0x44')][_0x3c5b('0x4c')]);}return _0x5270c2[_0x3c5b('0x104')](_0x1fb5a9);}})['then'](function(_0x59230c){if(_0x59230c){return _0x59230c?{'count':_0x349c3d,'rows':_0x59230c}:null;}})[_0x3c5b('0x38')](respondWithResult(_0x1b623c,null))[_0x3c5b('0x2c')](handleError(_0x1b623c,null));};exports[_0x3c5b('0x11b')]=function(_0x16ea0e,_0x3feac1,_0x321d4a){var _0x4561ea=_0x16ea0e[_0x3c5b('0x44')][_0x3c5b('0x11c')]===_0x3c5b('0x11d')?'offlineForm':_0x3c5b('0x11e');return db[_0x3c5b('0x41')][_0x3c5b('0x60')]({'attributes':['id',_0x4561ea],'where':{'id':_0x16ea0e['params']['id']}})[_0x3c5b('0x38')](handleEntityNotFound(_0x3feac1,null))['then'](function(_0x5afc9e){if(_0x5afc9e){var _0x34d017=_0x5afc9e[_0x4561ea];var _0x5b4a37=_0x34d017&&_0x34d017[_0x3c5b('0x11f')]?_0x34d017[_0x3c5b('0x11f')]:[];_0x3feac1['send']({'fromKey':_[_0x3c5b('0x84')](_0x34d017[_0x3c5b('0x120')])?undefined:_0x34d017[_0x3c5b('0x120')],'count':_0x5b4a37[_0x3c5b('0x4a')],'rows':_0x5b4a37});}})[_0x3c5b('0x2c')](handleError(_0x3feac1,null));};exports[_0x3c5b('0x121')]=function(_0x9ef0a3,_0xc80b0b,_0xe555d9){var _0x2a4cb6={'raw':!![],'where':{}};var _0x19cf45={};var _0x493ebf={'count':0x0,'rows':[]};return db[_0x3c5b('0x41')][_0x3c5b('0x72')]({'where':{'id':_0x9ef0a3[_0x3c5b('0x5d')]['id']}})[_0x3c5b('0x38')](handleEntityNotFound(_0xc80b0b,null))[_0x3c5b('0x38')](function(_0x8fd2e0){if(_0x8fd2e0){_0x19cf45[_0x3c5b('0x47')]=_[_0x3c5b('0x5f')](db['ChatOfflineMessage']['rawAttributes']);_0x19cf45[_0x3c5b('0x44')]=_[_0x3c5b('0x5f')](_0x9ef0a3[_0x3c5b('0x44')]);_0x19cf45['filters']=_[_0x3c5b('0x46')](_0x19cf45[_0x3c5b('0x47')],_0x19cf45[_0x3c5b('0x44')]);_0x2a4cb6[_0x3c5b('0x49')]=_[_0x3c5b('0x46')](_0x19cf45[_0x3c5b('0x47')],qs['fields'](_0x9ef0a3['query'][_0x3c5b('0x48')]));_0x2a4cb6[_0x3c5b('0x49')]=_0x2a4cb6['attributes']['length']?_0x2a4cb6['attributes']:_0x19cf45[_0x3c5b('0x47')];if(!_0x9ef0a3[_0x3c5b('0x44')][_0x3c5b('0x4b')](_0x3c5b('0x73'))){_0x2a4cb6[_0x3c5b('0x31')]=qs['limit'](_0x9ef0a3['query'][_0x3c5b('0x31')]);_0x2a4cb6[_0x3c5b('0x4c')]=qs[_0x3c5b('0x4c')](_0x9ef0a3[_0x3c5b('0x44')][_0x3c5b('0x4c')]);}_0x2a4cb6[_0x3c5b('0x4d')]=qs['sort'](_0x9ef0a3[_0x3c5b('0x44')][_0x3c5b('0x4e')]);_0x2a4cb6[_0x3c5b('0x51')]=qs[_0x3c5b('0x45')](_[_0x3c5b('0x4f')](_0x9ef0a3[_0x3c5b('0x44')],_0x19cf45[_0x3c5b('0x45')]));_0x2a4cb6['where'][_0x3c5b('0x6b')]=_0x8fd2e0['id'];if(_0x9ef0a3['query'][_0x3c5b('0x50')]){_0x2a4cb6[_0x3c5b('0x51')]=_[_0x3c5b('0x52')](_0x2a4cb6[_0x3c5b('0x51')],{'$or':_['map'](_0x2a4cb6[_0x3c5b('0x49')],function(_0x345423){var _0xf31e8f={};_0xf31e8f[_0x345423]={'$like':'%'+_0x9ef0a3['query']['filter']+'%'};return _0xf31e8f;})});}_0x2a4cb6=_[_0x3c5b('0x52')]({},_0x2a4cb6,_0x9ef0a3['options']);return db[_0x3c5b('0xdc')][_0x3c5b('0x30')]({'where':_0x2a4cb6[_0x3c5b('0x51')]})['then'](function(_0x3d7ce7){_0x493ebf[_0x3c5b('0x30')]=_0x3d7ce7;if(_0x9ef0a3[_0x3c5b('0x44')][_0x3c5b('0x58')]){_0x2a4cb6[_0x3c5b('0x59')]=[{'all':!![]}];}return db[_0x3c5b('0xdc')]['findAll'](_0x2a4cb6);})[_0x3c5b('0x38')](function(_0x2e93e4){_0x493ebf[_0x3c5b('0x5b')]=_0x2e93e4;return _0x493ebf;});}})[_0x3c5b('0x38')](respondWithFilteredResult(_0xc80b0b,_0x2a4cb6))[_0x3c5b('0x2c')](handleError(_0xc80b0b,null));};exports[_0x3c5b('0x122')]=function(_0x3cf205,_0x54fe2e,_0x20432d){return db[_0x3c5b('0x41')][_0x3c5b('0x60')]({'where':{'id':_0x3cf205[_0x3c5b('0x5d')]['id']}})[_0x3c5b('0x38')](handleEntityNotFound(_0x54fe2e,null))['then'](function(_0x4f2c40){if(_0x4f2c40){return _0x4f2c40[_0x3c5b('0x122')](_0x3cf205[_0x3c5b('0x62')][_0x3c5b('0x75')],_['omit'](_0x3cf205[_0x3c5b('0x62')],[_0x3c5b('0x75'),'id'])||{})[_0x3c5b('0xd7')](function(_0x1c0dcc){for(var _0x1cb099=0x0;_0x1cb099<_0x3cf205[_0x3c5b('0x62')][_0x3c5b('0x75')][_0x3c5b('0x4a')];_0x1cb099+=0x1){socket[_0x3c5b('0x123')](_0x3c5b('0x124'),{'UserId':_0x3cf205['body']['ids'][_0x1cb099],'ChatWebsiteId':_0x3cf205[_0x3c5b('0x5d')]['id']});}return _0x1c0dcc;});}})[_0x3c5b('0x38')](respondWithResult(_0x54fe2e,null))[_0x3c5b('0x2c')](handleError(_0x54fe2e,null));};exports[_0x3c5b('0x125')]=function(_0x23e23d,_0x1fa1b5,_0x544a2f){return db[_0x3c5b('0x41')][_0x3c5b('0x60')]({'where':{'id':_0x23e23d[_0x3c5b('0x5d')]['id']}})[_0x3c5b('0x38')](handleEntityNotFound(_0x1fa1b5,null))['then'](function(_0x47839a){if(_0x47839a){return _0x47839a[_0x3c5b('0x125')](_0x23e23d[_0x3c5b('0x44')][_0x3c5b('0x75')])[_0x3c5b('0x38')](function(){if(_[_0x3c5b('0x126')](_0x23e23d[_0x3c5b('0x44')][_0x3c5b('0x75')])){for(var _0x5315ec=0x0;_0x5315ec<_0x23e23d['query'][_0x3c5b('0x75')][_0x3c5b('0x4a')];_0x5315ec+=0x1){socket[_0x3c5b('0x123')](_0x3c5b('0x127'),{'UserId':Number(_0x23e23d[_0x3c5b('0x44')]['ids'][_0x5315ec]),'ChatWebsiteId':Number(_0x23e23d[_0x3c5b('0x5d')]['id'])});}}else{socket['emit'](_0x3c5b('0x127'),{'UserId':Number(_0x23e23d[_0x3c5b('0x44')][_0x3c5b('0x75')]),'ChatWebsiteId':Number(_0x23e23d[_0x3c5b('0x5d')]['id'])});}});}})[_0x3c5b('0x38')](respondWithStatusCode(_0x1fa1b5,null))['catch'](handleError(_0x1fa1b5,null));};exports['getAgents']=function(_0x26e7aa,_0x36b2b3,_0x44e524){var _0x5a4269={};var _0x1dbf2d={};var _0x3f2b72;var _0x331e54;return db['ChatWebsite'][_0x3c5b('0x72')]({'where':{'id':_0x26e7aa[_0x3c5b('0x5d')]['id']}})[_0x3c5b('0x38')](handleEntityNotFound(_0x36b2b3,null))[_0x3c5b('0x38')](function(_0x542606){if(_0x542606){_0x3f2b72=_0x542606;_0x1dbf2d['model']=_[_0x3c5b('0x5f')](db[_0x3c5b('0xcd')][_0x3c5b('0x42')]);_0x1dbf2d[_0x3c5b('0x44')]=_[_0x3c5b('0x5f')](_0x26e7aa[_0x3c5b('0x44')]);_0x1dbf2d['filters']=_[_0x3c5b('0x46')](_0x1dbf2d[_0x3c5b('0x47')],_0x1dbf2d[_0x3c5b('0x44')]);_0x5a4269[_0x3c5b('0x49')]=_[_0x3c5b('0x46')](_0x1dbf2d[_0x3c5b('0x47')],qs[_0x3c5b('0x48')](_0x26e7aa[_0x3c5b('0x44')][_0x3c5b('0x48')]));_0x5a4269[_0x3c5b('0x49')]=_0x5a4269[_0x3c5b('0x49')][_0x3c5b('0x4a')]?_0x5a4269[_0x3c5b('0x49')]:_0x1dbf2d['model'];_0x5a4269['order']=qs['sort'](_0x26e7aa[_0x3c5b('0x44')][_0x3c5b('0x4e')]);_0x5a4269[_0x3c5b('0x51')]=qs[_0x3c5b('0x45')](_[_0x3c5b('0x4f')](_0x26e7aa[_0x3c5b('0x44')],_0x1dbf2d[_0x3c5b('0x45')]));if(_0x26e7aa[_0x3c5b('0x44')][_0x3c5b('0x50')]){_0x5a4269['where']=_['merge'](_0x5a4269['where'],{'$or':_[_0x3c5b('0x40')](_0x5a4269['attributes'],function(_0x511e9d){var _0x1782ea={};_0x1782ea[_0x511e9d]={'$like':'%'+_0x26e7aa[_0x3c5b('0x44')]['filter']+'%'};return _0x1782ea;})});}_0x5a4269=_[_0x3c5b('0x52')]({},_0x5a4269,_0x26e7aa[_0x3c5b('0x57')]);return _0x3f2b72[_0x3c5b('0x128')](_0x5a4269);}})[_0x3c5b('0x38')](function(_0x1badb1){if(_0x1badb1){_0x331e54=_0x1badb1[_0x3c5b('0x4a')];if(!_0x26e7aa[_0x3c5b('0x44')][_0x3c5b('0x4b')](_0x3c5b('0x73'))){_0x5a4269[_0x3c5b('0x31')]=qs['limit'](_0x26e7aa[_0x3c5b('0x44')][_0x3c5b('0x31')]);_0x5a4269[_0x3c5b('0x4c')]=qs[_0x3c5b('0x4c')](_0x26e7aa[_0x3c5b('0x44')]['offset']);}return _0x3f2b72[_0x3c5b('0x128')](_0x5a4269);}})[_0x3c5b('0x38')](function(_0x2bc0ce){if(_0x2bc0ce){return _0x2bc0ce?{'count':_0x331e54,'rows':_0x2bc0ce}:null;}})[_0x3c5b('0x38')](respondWithResult(_0x36b2b3,null))[_0x3c5b('0x2c')](handleError(_0x36b2b3,null));}; \ No newline at end of file +var _0x5abf=['%s\x20%s','version','unknown','format','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','firstName','messageId','created','push','close','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','notify','offline','no\x20available\x20attributes','send','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','findOrCreate','readFileSync','offlineMessageBody','ChatOfflineMessage','MailAccount','Smtp','host','port','secure','authentication','SendMail','sendMail','\x22%s\x22\x20<%s>','email','forwardOfflineAddress','addInteraction','include','Contact','User','Owner','fullname','Tag','Tags','color','tag','findAll','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','License','chatLicenseExceeded','some','server/files/chat/iframe.js','utf8','remote','x-real-ip','connection','remoteAddress','replace','render','alignment','verticalAlignment','addApplications','sequelize','bulkCreate','getApplications','addProactiveActions','chatProactiveAction','omit','ChatProactiveAction','getFields','offlineForm','onlineForm','items','fromKey','getOfflineMessages','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','defaults','redis','./chatWebsite.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','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatWebsite,\x20%s,\x20%s','info','catch','status','json','count','offset','limit','set','apply','reject','save','update','destroy','get','ChatWebsites','UserProfileResource','end','stack','name','index','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','type','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','rows','show','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','describe','addDisposition','getDispositions','findOne','Disposition','removeDispositions','ids','getAnswers','CannedAnswer','ChatWebsiteId','includeAll','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','systemAvatar','root','server/files/images/logos/default_logo.png','../../config/license/util','getLicense','custom','isNil','join','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','customerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','user-agent-parser','headers','user-agent','getResult','chat','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','from','List','CmContact','Contacts','DESC','ChatApplication','Applications','applications','orderBy','priority','asc','account','ListId','contact','customerIp','x-forwarded-for','first','split','lastName','x-real-port','referer','browser'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0x5abf,0x72));var _0xf5ab=function(_0x2b3cad,_0x573629){_0x2b3cad=_0x2b3cad-0x0;var _0x2175c4=_0x5abf[_0x2b3cad];return _0x2175c4;};'use strict';var pdf=require(_0xf5ab('0x0'));var emlformat=require(_0xf5ab('0x1'));var rimraf=require(_0xf5ab('0x2'));var zipdir=require(_0xf5ab('0x3'));var jsonpatch=require(_0xf5ab('0x4'));var rp=require(_0xf5ab('0x5'));var moment=require(_0xf5ab('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xf5ab('0x7'));var util=require(_0xf5ab('0x8'));var path=require(_0xf5ab('0x9'));var sox=require(_0xf5ab('0xa'));var csv=require(_0xf5ab('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf5ab('0xc'));var squel=require(_0xf5ab('0xd'));var crypto=require(_0xf5ab('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xf5ab('0xf'));var toCsv=require(_0xf5ab('0xb'));var querystring=require('querystring');var Papa=require(_0xf5ab('0x10'));var Redis=require('ioredis');var authService=require(_0xf5ab('0x11'));var qs=require(_0xf5ab('0x12'));var as=require(_0xf5ab('0x13'));var hardwareService=require(_0xf5ab('0x14'));var logger=require(_0xf5ab('0x15'))(_0xf5ab('0x16'));var utils=require(_0xf5ab('0x17'));var config=require(_0xf5ab('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xf5ab('0x19')](config[_0xf5ab('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xf5ab('0x1b'))[_0xf5ab('0x1c')](socket);var jayson=require(_0xf5ab('0x1d'));var client=jayson[_0xf5ab('0x1e')][_0xf5ab('0x1f')]({'port':0x232c});var client9002=jayson['client'][_0xf5ab('0x1f')]({'port':0x232a});var client9003=jayson[_0xf5ab('0x1e')]['http']({'port':0x232b});function checkPasswordPattern(_0x19a1ff,_0x1db38a,_0x20bbd3){if(_0x20bbd3){var _0x2bd5ec=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2bd5ec[_0xf5ab('0x20')](_0x1db38a)){return _0x19a1ff;}else{throw new Error(_0xf5ab('0x21'));}}else{return _0x19a1ff;}}function respondWithRpcPromise(_0x20ada7,_0x36587f,_0x390059,_0xe055f4){return new BPromise(function(_0x4b68a3,_0x9ebe56){var _0x85a31d=_0xe055f4||client;return _0x85a31d[_0xf5ab('0x22')](_0x20ada7,_0x390059)[_0xf5ab('0x23')](function(_0xa45fd3){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x36587f,_0xf5ab('0x24'));logger['debug'](_0xf5ab('0x25'),_0x36587f,'request\x20sent',JSON[_0xf5ab('0x26')](_0xa45fd3));if(_0xa45fd3[_0xf5ab('0x27')]){if(_0xa45fd3[_0xf5ab('0x27')][_0xf5ab('0x28')]===0x1f4){logger[_0xf5ab('0x27')]('ChatWebsite,\x20%s,\x20%s',_0x36587f,_0xa45fd3['error'][_0xf5ab('0x29')]);return _0x9ebe56(_0xa45fd3[_0xf5ab('0x27')][_0xf5ab('0x29')]);}logger[_0xf5ab('0x27')](_0xf5ab('0x2a'),_0x36587f,_0xa45fd3['error']['message']);return _0x4b68a3(_0xa45fd3[_0xf5ab('0x27')][_0xf5ab('0x29')]);}else{logger[_0xf5ab('0x2b')](_0xf5ab('0x2a'),_0x36587f,_0xf5ab('0x24'));_0x4b68a3(_0xa45fd3['result'][_0xf5ab('0x29')]);}})[_0xf5ab('0x2c')](function(_0x52711b){logger['error'](_0xf5ab('0x2a'),_0x36587f,_0x52711b);_0x9ebe56(_0x52711b);});});}function respondWithStatusCode(_0xd0526e,_0x1703f4){_0x1703f4=_0x1703f4||0xcc;return function(_0x3449c9){if(_0x3449c9){return _0xd0526e['sendStatus'](_0x1703f4);}return _0xd0526e[_0xf5ab('0x2d')](_0x1703f4)['end']();};}function respondWithResult(_0x5518a1,_0x41d4f6){_0x41d4f6=_0x41d4f6||0xc8;return function(_0x561006){if(_0x561006){return _0x5518a1[_0xf5ab('0x2d')](_0x41d4f6)[_0xf5ab('0x2e')](_0x561006);}};}function respondWithFilteredResult(_0xad64fd,_0x3406a7){return function(_0x2cfadb){if(_0x2cfadb){var _0x202a5d=_0x2cfadb[_0xf5ab('0x2f')],_0x6c602e=_0x3406a7[_0xf5ab('0x30')],_0xa30edd=_0x3406a7[_0xf5ab('0x30')]+_0x3406a7[_0xf5ab('0x31')],_0x324173;if(_0xa30edd>=_0x202a5d){_0xa30edd=_0x202a5d;_0x324173=0xc8;}else{_0x324173=0xce;}_0xad64fd[_0xf5ab('0x2d')](_0x324173);return _0xad64fd[_0xf5ab('0x32')]('Content-Range',_0x6c602e+'-'+_0xa30edd+'/'+_0x202a5d)[_0xf5ab('0x2e')](_0x2cfadb);}return null;};}function patchUpdates(_0x2ea9c3){return function(_0x53ae97){try{jsonpatch[_0xf5ab('0x33')](_0x53ae97,_0x2ea9c3,!![]);}catch(_0x4e23a8){return BPromise[_0xf5ab('0x34')](_0x4e23a8);}return _0x53ae97[_0xf5ab('0x35')]();};}function saveUpdates(_0x23914d,_0x37684c){return function(_0x10db92){if(_0x10db92){return _0x10db92[_0xf5ab('0x36')](_0x23914d)[_0xf5ab('0x23')](function(_0x3488d8){return _0x3488d8;});}return null;};}function removeEntity(_0x2ed05f,_0x429c0a){return function(_0x11ef13){if(_0x11ef13){return _0x11ef13[_0xf5ab('0x37')]()[_0xf5ab('0x23')](function(){var _0x38659c=_0x11ef13[_0xf5ab('0x38')]({'plain':!![]});var _0x290278=_0xf5ab('0x39');return db[_0xf5ab('0x3a')][_0xf5ab('0x37')]({'where':{'type':_0x290278,'resourceId':_0x38659c['id']}})[_0xf5ab('0x23')](function(){return _0x11ef13;});})[_0xf5ab('0x23')](function(){_0x2ed05f[_0xf5ab('0x2d')](0xcc)[_0xf5ab('0x3b')]();});}};}function handleEntityNotFound(_0x46fc20,_0x452a7c){return function(_0x2135e6){if(!_0x2135e6){_0x46fc20['sendStatus'](0x194);}return _0x2135e6;};}function handleError(_0x199fa0,_0x45427a){_0x45427a=_0x45427a||0x1f4;return function(_0x49f704){logger[_0xf5ab('0x27')](_0x49f704[_0xf5ab('0x3c')]);if(_0x49f704[_0xf5ab('0x3d')]){delete _0x49f704[_0xf5ab('0x3d')];}_0x199fa0[_0xf5ab('0x2d')](_0x45427a)['send'](_0x49f704);};}exports[_0xf5ab('0x3e')]=function(_0x820d50,_0x3f964f){var _0x252870={'include':[{'model':db[_0xf5ab('0x3f')],'as':_0xf5ab('0x40')}]},_0xac424a={},_0x2dfccf={'count':0x0,'rows':[]};var _0x27b56d=_['map'](db[_0xf5ab('0x41')][_0xf5ab('0x42')],function(_0x488a60){return{'name':_0x488a60['fieldName'],'type':_0x488a60[_0xf5ab('0x43')][_0xf5ab('0x44')]};});_0xac424a[_0xf5ab('0x45')]=_[_0xf5ab('0x46')](_0x27b56d,_0xf5ab('0x3d'));_0xac424a[_0xf5ab('0x47')]=_[_0xf5ab('0x48')](_0x820d50[_0xf5ab('0x47')]);_0xac424a[_0xf5ab('0x49')]=_[_0xf5ab('0x4a')](_0xac424a[_0xf5ab('0x45')],_0xac424a[_0xf5ab('0x47')]);_0x252870['attributes']=_[_0xf5ab('0x4a')](_0xac424a['model'],qs[_0xf5ab('0x4b')](_0x820d50[_0xf5ab('0x47')][_0xf5ab('0x4b')]));_0x252870[_0xf5ab('0x4c')]=_0x252870[_0xf5ab('0x4c')]['length']?_0x252870[_0xf5ab('0x4c')]:_0xac424a[_0xf5ab('0x45')];if(!_0x820d50[_0xf5ab('0x47')][_0xf5ab('0x4d')](_0xf5ab('0x4e'))){_0x252870['limit']=qs[_0xf5ab('0x31')](_0x820d50[_0xf5ab('0x47')][_0xf5ab('0x31')]);_0x252870[_0xf5ab('0x30')]=qs[_0xf5ab('0x30')](_0x820d50[_0xf5ab('0x47')]['offset']);}_0x252870[_0xf5ab('0x4f')]=qs[_0xf5ab('0x50')](_0x820d50[_0xf5ab('0x47')][_0xf5ab('0x50')]);_0x252870[_0xf5ab('0x51')]=qs[_0xf5ab('0x49')](_[_0xf5ab('0x52')](_0x820d50[_0xf5ab('0x47')],_0xac424a[_0xf5ab('0x49')]));if(_0x820d50[_0xf5ab('0x47')][_0xf5ab('0x53')]){_0x252870[_0xf5ab('0x51')]=_[_0xf5ab('0x54')](_0x252870[_0xf5ab('0x51')],{'$or':_[_0xf5ab('0x46')](_0x27b56d,function(_0x31c574){if(_0x31c574['type']['key']!=='VIRTUAL'){var _0x34c6a6={};_0x34c6a6[_0x31c574['field']]={'$like':'%'+_0x820d50[_0xf5ab('0x47')][_0xf5ab('0x53')]+'%'};return _0x34c6a6;}})});}_0x252870=_[_0xf5ab('0x54')]({},_0x252870,_0x820d50[_0xf5ab('0x55')]);var _0x3966bf={'where':_0x252870[_0xf5ab('0x51')]};return db[_0xf5ab('0x41')][_0xf5ab('0x2f')](_0x3966bf)['then'](function(_0x22c836){_0x2dfccf['count']=_0x22c836;if(_0x820d50['query']['includeAll']){_0x252870['include']=[{'all':!![]}];}return db[_0xf5ab('0x41')]['findAll'](_0x252870);})['then'](function(_0x419f6d){_0x2dfccf[_0xf5ab('0x56')]=_0x419f6d;return _0x2dfccf;})[_0xf5ab('0x23')](respondWithFilteredResult(_0x3f964f,_0x252870))[_0xf5ab('0x2c')](handleError(_0x3f964f,null));};exports[_0xf5ab('0x57')]=function(_0x4fc4d0,_0xb2a4dc){var _0x1186bc={'raw':![],'where':{'id':_0x4fc4d0[_0xf5ab('0x58')]['id']},'include':[{'model':db[_0xf5ab('0x3f')],'as':_0xf5ab('0x40')}]},_0x23c7ba={};_0x23c7ba[_0xf5ab('0x45')]=_[_0xf5ab('0x48')](db[_0xf5ab('0x41')][_0xf5ab('0x42')]);_0x23c7ba['query']=_[_0xf5ab('0x48')](_0x4fc4d0[_0xf5ab('0x47')]);_0x23c7ba[_0xf5ab('0x49')]=_['intersection'](_0x23c7ba[_0xf5ab('0x45')],_0x23c7ba[_0xf5ab('0x47')]);_0x1186bc[_0xf5ab('0x4c')]=_[_0xf5ab('0x4a')](_0x23c7ba[_0xf5ab('0x45')],qs[_0xf5ab('0x4b')](_0x4fc4d0[_0xf5ab('0x47')][_0xf5ab('0x4b')]));_0x1186bc[_0xf5ab('0x4c')]=_0x1186bc[_0xf5ab('0x4c')][_0xf5ab('0x59')]?_0x1186bc[_0xf5ab('0x4c')]:_0x23c7ba[_0xf5ab('0x45')];if(_0x4fc4d0[_0xf5ab('0x47')]['includeAll']){_0x1186bc['include']=[{'all':!![]}];}_0x1186bc=_[_0xf5ab('0x54')]({},_0x1186bc,_0x4fc4d0[_0xf5ab('0x55')]);return db[_0xf5ab('0x41')][_0xf5ab('0x5a')](_0x1186bc)['then'](handleEntityNotFound(_0xb2a4dc,null))['then'](respondWithResult(_0xb2a4dc,null))[_0xf5ab('0x2c')](handleError(_0xb2a4dc,null));};exports[_0xf5ab('0x5b')]=function(_0x40b834,_0x1e23c4){return db[_0xf5ab('0x41')]['create'](_0x40b834[_0xf5ab('0x5c')],{})[_0xf5ab('0x23')](function(_0xcd417d){var _0xba4d=_0x40b834[_0xf5ab('0x5d')][_0xf5ab('0x38')]({'plain':!![]});if(!_0xba4d)throw new Error(_0xf5ab('0x5e'));if(_0xba4d[_0xf5ab('0x5f')]===_0xf5ab('0x5d')){var _0x14f010=_0xcd417d[_0xf5ab('0x38')]({'plain':!![]});var _0x310b9c=_0xf5ab('0x39');return db[_0xf5ab('0x60')][_0xf5ab('0x5a')]({'where':{'name':_0x310b9c,'userProfileId':_0xba4d[_0xf5ab('0x61')]},'raw':!![]})[_0xf5ab('0x23')](function(_0x41edf7){if(_0x41edf7&&_0x41edf7['autoAssociation']===0x0){return db[_0xf5ab('0x3a')]['create']({'name':_0x14f010[_0xf5ab('0x3d')],'resourceId':_0x14f010['id'],'type':_0x41edf7['name'],'sectionId':_0x41edf7['id']},{})[_0xf5ab('0x23')](function(){return _0xcd417d;});}else{return _0xcd417d;}})['catch'](function(_0x18d7e7){logger['error'](_0xf5ab('0x62'),_0x18d7e7);throw _0x18d7e7;});}return _0xcd417d;})[_0xf5ab('0x23')](respondWithResult(_0x1e23c4,0xc9))[_0xf5ab('0x2c')](handleError(_0x1e23c4,null));};exports[_0xf5ab('0x36')]=function(_0x1f5624,_0x567de9){if(_0x1f5624['body']['id']){delete _0x1f5624[_0xf5ab('0x5c')]['id'];}return db[_0xf5ab('0x41')]['find']({'where':{'id':_0x1f5624[_0xf5ab('0x58')]['id']},'include':[{'model':db['Pause'],'as':_0xf5ab('0x40')}]})[_0xf5ab('0x23')](handleEntityNotFound(_0x567de9,null))[_0xf5ab('0x23')](saveUpdates(_0x1f5624[_0xf5ab('0x5c')],null))[_0xf5ab('0x23')](respondWithResult(_0x567de9,null))['catch'](handleError(_0x567de9,null));};exports[_0xf5ab('0x37')]=function(_0x34299b,_0x4b9cab){return db[_0xf5ab('0x41')][_0xf5ab('0x5a')]({'where':{'id':_0x34299b[_0xf5ab('0x58')]['id']}})[_0xf5ab('0x23')](handleEntityNotFound(_0x4b9cab,null))['then'](removeEntity(_0x4b9cab,null))[_0xf5ab('0x2c')](handleError(_0x4b9cab,null));};exports['describe']=function(_0x167a66,_0x39b5a6){return db[_0xf5ab('0x41')][_0xf5ab('0x63')]()[_0xf5ab('0x23')](respondWithResult(_0x39b5a6,null))['catch'](handleError(_0x39b5a6,null));};exports[_0xf5ab('0x64')]=function(_0x5b77a5,_0x14d7d4,_0x39c155){if(_0x5b77a5['body']['id']){delete _0x5b77a5['body']['id'];}return db[_0xf5ab('0x41')][_0xf5ab('0x5a')]({'where':{'id':_0x5b77a5[_0xf5ab('0x58')]['id']}})[_0xf5ab('0x23')](handleEntityNotFound(_0x14d7d4,null))[_0xf5ab('0x23')](function(_0x4ac216){if(_0x4ac216){_0x5b77a5[_0xf5ab('0x5c')]['ChatWebsiteId']=_0x4ac216['id'];return db['Disposition'][_0xf5ab('0x5b')](_0x5b77a5[_0xf5ab('0x5c')]);}})[_0xf5ab('0x23')](respondWithResult(_0x14d7d4,null))[_0xf5ab('0x2c')](handleError(_0x14d7d4,null));};exports[_0xf5ab('0x65')]=function(_0x1354d7,_0x54d096,_0x208899){var _0x3e3c21={'raw':![],'where':{}};var _0x5e370b={};var _0x3d7d65={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xf5ab('0x66')]({'where':{'id':_0x1354d7[_0xf5ab('0x58')]['id']}})['then'](handleEntityNotFound(_0x54d096,null))[_0xf5ab('0x23')](function(_0x37812a){if(_0x37812a){_0x5e370b[_0xf5ab('0x45')]=_['keys'](db[_0xf5ab('0x67')]['rawAttributes']);_0x5e370b[_0xf5ab('0x47')]=_['keys'](_0x1354d7[_0xf5ab('0x47')]);_0x5e370b['filters']=_[_0xf5ab('0x4a')](_0x5e370b[_0xf5ab('0x45')],_0x5e370b[_0xf5ab('0x47')]);_0x3e3c21[_0xf5ab('0x4c')]=_[_0xf5ab('0x4a')](_0x5e370b[_0xf5ab('0x45')],qs[_0xf5ab('0x4b')](_0x1354d7[_0xf5ab('0x47')]['fields']));_0x3e3c21[_0xf5ab('0x4c')]=_0x3e3c21[_0xf5ab('0x4c')][_0xf5ab('0x59')]?_0x3e3c21[_0xf5ab('0x4c')]:_0x5e370b['model'];if(!_0x1354d7[_0xf5ab('0x47')][_0xf5ab('0x4d')](_0xf5ab('0x4e'))){_0x3e3c21[_0xf5ab('0x31')]=qs[_0xf5ab('0x31')](_0x1354d7['query'][_0xf5ab('0x31')]);_0x3e3c21['offset']=qs[_0xf5ab('0x30')](_0x1354d7['query'][_0xf5ab('0x30')]);}_0x3e3c21[_0xf5ab('0x4f')]=qs['sort'](_0x1354d7[_0xf5ab('0x47')]['sort']);_0x3e3c21['where']=qs[_0xf5ab('0x49')](_[_0xf5ab('0x52')](_0x1354d7['query'],_0x5e370b[_0xf5ab('0x49')]));_0x3e3c21[_0xf5ab('0x51')]['ChatWebsiteId']=_0x37812a['id'];if(_0x1354d7['query'][_0xf5ab('0x53')]){_0x3e3c21[_0xf5ab('0x51')]=_[_0xf5ab('0x54')](_0x3e3c21[_0xf5ab('0x51')],{'$or':_[_0xf5ab('0x46')](_0x3e3c21[_0xf5ab('0x4c')],function(_0x76bb32){var _0x3eb545={};_0x3eb545[_0x76bb32]={'$like':'%'+_0x1354d7[_0xf5ab('0x47')][_0xf5ab('0x53')]+'%'};return _0x3eb545;})});}_0x3e3c21=_[_0xf5ab('0x54')]({},_0x3e3c21,_0x1354d7[_0xf5ab('0x55')]);return db[_0xf5ab('0x67')][_0xf5ab('0x2f')]({'where':_0x3e3c21[_0xf5ab('0x51')]})['then'](function(_0x5254d6){_0x3d7d65[_0xf5ab('0x2f')]=_0x5254d6;if(_0x1354d7['query']['includeAll']){_0x3e3c21['include']=[{'all':!![]}];}return db[_0xf5ab('0x67')]['findAll'](_0x3e3c21);})['then'](function(_0x395805){_0x3d7d65['rows']=_0x395805;return _0x3d7d65;});}})['then'](respondWithFilteredResult(_0x54d096,_0x3e3c21))['catch'](handleError(_0x54d096,null));};exports[_0xf5ab('0x68')]=function(_0x583995,_0x716a47,_0x486f42){return db[_0xf5ab('0x41')][_0xf5ab('0x5a')]({'where':{'id':_0x583995[_0xf5ab('0x58')]['id']}})['then'](handleEntityNotFound(_0x716a47,null))['then'](function(_0x4c91de){if(_0x4c91de){return _0x4c91de['removeDispositions'](_0x583995[_0xf5ab('0x47')][_0xf5ab('0x69')]);}})[_0xf5ab('0x23')](respondWithStatusCode(_0x716a47,null))['catch'](handleError(_0x716a47,null));};exports['addAnswer']=function(_0x34421f,_0x561066,_0x38f9ba){if(_0x34421f['body']['id']){delete _0x34421f[_0xf5ab('0x5c')]['id'];}return db[_0xf5ab('0x41')][_0xf5ab('0x5a')]({'where':{'id':_0x34421f[_0xf5ab('0x58')]['id']}})[_0xf5ab('0x23')](handleEntityNotFound(_0x561066,null))[_0xf5ab('0x23')](function(_0x4ea453){if(_0x4ea453){_0x34421f['body']['ChatWebsiteId']=_0x4ea453['id'];return db['CannedAnswer'][_0xf5ab('0x5b')](_0x34421f[_0xf5ab('0x5c')]);}})[_0xf5ab('0x23')](respondWithResult(_0x561066,null))[_0xf5ab('0x2c')](handleError(_0x561066,null));};exports[_0xf5ab('0x6a')]=function(_0x39e4b2,_0x33644f,_0x47e4fc){var _0x4ace9b={'raw':![],'where':{}};var _0x3f09f1={};var _0x1a5e4e={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x39e4b2[_0xf5ab('0x58')]['id']}})['then'](handleEntityNotFound(_0x33644f,null))[_0xf5ab('0x23')](function(_0x8a5a80){if(_0x8a5a80){_0x3f09f1[_0xf5ab('0x45')]=_[_0xf5ab('0x48')](db[_0xf5ab('0x6b')][_0xf5ab('0x42')]);_0x3f09f1['query']=_[_0xf5ab('0x48')](_0x39e4b2[_0xf5ab('0x47')]);_0x3f09f1['filters']=_[_0xf5ab('0x4a')](_0x3f09f1[_0xf5ab('0x45')],_0x3f09f1['query']);_0x4ace9b[_0xf5ab('0x4c')]=_['intersection'](_0x3f09f1[_0xf5ab('0x45')],qs[_0xf5ab('0x4b')](_0x39e4b2[_0xf5ab('0x47')][_0xf5ab('0x4b')]));_0x4ace9b[_0xf5ab('0x4c')]=_0x4ace9b[_0xf5ab('0x4c')]['length']?_0x4ace9b[_0xf5ab('0x4c')]:_0x3f09f1['model'];if(!_0x39e4b2[_0xf5ab('0x47')]['hasOwnProperty'](_0xf5ab('0x4e'))){_0x4ace9b['limit']=qs[_0xf5ab('0x31')](_0x39e4b2[_0xf5ab('0x47')][_0xf5ab('0x31')]);_0x4ace9b[_0xf5ab('0x30')]=qs[_0xf5ab('0x30')](_0x39e4b2[_0xf5ab('0x47')][_0xf5ab('0x30')]);}_0x4ace9b[_0xf5ab('0x4f')]=qs[_0xf5ab('0x50')](_0x39e4b2[_0xf5ab('0x47')][_0xf5ab('0x50')]);_0x4ace9b[_0xf5ab('0x51')]=qs[_0xf5ab('0x49')](_['pick'](_0x39e4b2[_0xf5ab('0x47')],_0x3f09f1[_0xf5ab('0x49')]));_0x4ace9b[_0xf5ab('0x51')][_0xf5ab('0x6c')]=_0x8a5a80['id'];if(_0x39e4b2[_0xf5ab('0x47')][_0xf5ab('0x53')]){_0x4ace9b[_0xf5ab('0x51')]=_[_0xf5ab('0x54')](_0x4ace9b[_0xf5ab('0x51')],{'$or':_[_0xf5ab('0x46')](_0x4ace9b['attributes'],function(_0x36a463){var _0x3eb79d={};_0x3eb79d[_0x36a463]={'$like':'%'+_0x39e4b2[_0xf5ab('0x47')][_0xf5ab('0x53')]+'%'};return _0x3eb79d;})});}_0x4ace9b=_[_0xf5ab('0x54')]({},_0x4ace9b,_0x39e4b2['options']);return db['CannedAnswer'][_0xf5ab('0x2f')]({'where':_0x4ace9b['where']})[_0xf5ab('0x23')](function(_0x1da7a3){_0x1a5e4e['count']=_0x1da7a3;if(_0x39e4b2[_0xf5ab('0x47')][_0xf5ab('0x6d')]){_0x4ace9b['include']=[{'all':!![]}];}return db[_0xf5ab('0x6b')]['findAll'](_0x4ace9b);})[_0xf5ab('0x23')](function(_0xb1fd91){_0x1a5e4e['rows']=_0xb1fd91;return _0x1a5e4e;});}})[_0xf5ab('0x23')](respondWithFilteredResult(_0x33644f,_0x4ace9b))['catch'](handleError(_0x33644f,null));};exports[_0xf5ab('0x6e')]=function(_0x3ad84e,_0x40cfcc,_0x5b9862){return db[_0xf5ab('0x41')][_0xf5ab('0x5a')]({'where':{'id':_0x3ad84e[_0xf5ab('0x58')]['id']}})[_0xf5ab('0x23')](handleEntityNotFound(_0x40cfcc,null))[_0xf5ab('0x23')](function(_0xfc540e){if(_0xfc540e){return _0xfc540e['removeAnswers'](_0x3ad84e['query'][_0xf5ab('0x69')]);}})['then'](respondWithStatusCode(_0x40cfcc,null))['catch'](handleError(_0x40cfcc,null));};exports[_0xf5ab('0x6f')]=function(_0x40e731,_0x9491a6,_0x1f858b){_0x40e731[_0xf5ab('0x5c')][_0xf5ab('0x70')]=_0x40e731[_0xf5ab('0x71')][_0xf5ab('0x72')];return db[_0xf5ab('0x41')][_0xf5ab('0x5a')]({'where':{'id':_0x40e731[_0xf5ab('0x58')]['id']}})['then'](handleEntityNotFound(_0x9491a6,null))[_0xf5ab('0x23')](saveUpdates(_0x40e731[_0xf5ab('0x5c')],null))[_0xf5ab('0x23')](respondWithResult(_0x9491a6,null))[_0xf5ab('0x2c')](handleError(_0x9491a6,null));};exports[_0xf5ab('0x73')]=function(_0x282c76,_0x14ac46,_0x3ffbcc){_0x282c76[_0xf5ab('0x5c')][_0xf5ab('0x74')]=_0x282c76[_0xf5ab('0x71')][_0xf5ab('0x72')];return db[_0xf5ab('0x41')][_0xf5ab('0x5a')]({'where':{'id':_0x282c76[_0xf5ab('0x58')]['id']}})[_0xf5ab('0x23')](handleEntityNotFound(_0x14ac46,null))[_0xf5ab('0x23')](saveUpdates(_0x282c76[_0xf5ab('0x5c')],null))[_0xf5ab('0x23')](respondWithResult(_0x14ac46,null))[_0xf5ab('0x2c')](handleError(_0x14ac46,null));};exports[_0xf5ab('0x75')]=function(_0x3c8f19,_0x4c7448,_0x73a4eb){_0x3c8f19['body']['customerAvatar']=_0x3c8f19[_0xf5ab('0x71')][_0xf5ab('0x72')];return db[_0xf5ab('0x41')]['find']({'where':{'id':_0x3c8f19[_0xf5ab('0x58')]['id']}})['then'](handleEntityNotFound(_0x4c7448,null))[_0xf5ab('0x23')](saveUpdates(_0x3c8f19[_0xf5ab('0x5c')],null))[_0xf5ab('0x23')](respondWithResult(_0x4c7448,null))['catch'](handleError(_0x4c7448,null));};exports['addSystemAvatar']=function(_0x12da5e,_0x681cf,_0x48a6e7){_0x12da5e[_0xf5ab('0x5c')][_0xf5ab('0x76')]=_0x12da5e['file'][_0xf5ab('0x72')];return db['ChatWebsite'][_0xf5ab('0x5a')]({'where':{'id':_0x12da5e['params']['id']}})[_0xf5ab('0x23')](handleEntityNotFound(_0x681cf,null))['then'](saveUpdates(_0x12da5e[_0xf5ab('0x5c')],null))[_0xf5ab('0x23')](respondWithResult(_0x681cf,null))['catch'](handleError(_0x681cf,null));};exports['getLogo']=function(_0x2fba17,_0x282ace,_0x39ce1d){var _0x46bb97=path['join'](config[_0xf5ab('0x77')],_0xf5ab('0x78'));var _0x2febeb={'where':{'id':_0x2fba17[_0xf5ab('0x58')]['id']},'attributes':['id',_0xf5ab('0x70')],'raw':!![]};var _0x535442=![];return require(_0xf5ab('0x79'))[_0xf5ab('0x7a')]()[_0xf5ab('0x23')](function(_0xe8e72c){if(_0xe8e72c){_0x535442=_0xe8e72c[_0xf5ab('0x7b')];}})[_0xf5ab('0x23')](function(){return db[_0xf5ab('0x41')]['find'](_0x2febeb);})['then'](handleEntityNotFound(_0x282ace,null))[_0xf5ab('0x23')](function(_0x220d65){if(_0x220d65){if(!_[_0xf5ab('0x7c')](_0x220d65[_0xf5ab('0x70')])){if(fs['existsSync'](path[_0xf5ab('0x7d')](config[_0xf5ab('0x77')],_0xf5ab('0x7e'),_0x220d65[_0xf5ab('0x70')]))&&_0x535442){_0x46bb97=path[_0xf5ab('0x7d')](config[_0xf5ab('0x77')],_0xf5ab('0x7e'),_0x220d65['sitepic']);}}return _0x282ace[_0xf5ab('0x7f')](_0x46bb97);}})[_0xf5ab('0x2c')](handleError(_0x282ace,null));};exports[_0xf5ab('0x80')]=function(_0x1897e9,_0x1c5cf6,_0xb60c3e){var _0x58eee0=path[_0xf5ab('0x7d')](config[_0xf5ab('0x77')],_0xf5ab('0x81'));var _0x4e70f4={'where':{'id':_0x1897e9[_0xf5ab('0x58')]['id']},'attributes':['id',_0xf5ab('0x74')],'raw':!![]};return db[_0xf5ab('0x41')][_0xf5ab('0x5a')](_0x4e70f4)[_0xf5ab('0x23')](handleEntityNotFound(_0x1c5cf6,null))[_0xf5ab('0x23')](function(_0x562a3b){if(_0x562a3b){if(!_['isNil'](_0x562a3b['agentAvatar'])){if(fs['existsSync'](path[_0xf5ab('0x7d')](config['root'],_0xf5ab('0x82'),_0x562a3b[_0xf5ab('0x74')]))){_0x58eee0=path[_0xf5ab('0x7d')](config[_0xf5ab('0x77')],_0xf5ab('0x82'),_0x562a3b['agentAvatar']);}}return _0x1c5cf6[_0xf5ab('0x7f')](_0x58eee0);}})['catch'](handleError(_0x1c5cf6,null));};exports['getCustomerAvatar']=function(_0x111522,_0x339bbd,_0x8b0b90){var _0x418ab3=path[_0xf5ab('0x7d')](config[_0xf5ab('0x77')],'server/files/images/avatars/customer_avatar.png');var _0x4f1e4f={'where':{'id':_0x111522['params']['id']},'attributes':['id',_0xf5ab('0x83'),_0xf5ab('0x84')],'raw':!![]};return db['ChatWebsite'][_0xf5ab('0x5a')](_0x4f1e4f)[_0xf5ab('0x23')](handleEntityNotFound(_0x339bbd,null))[_0xf5ab('0x23')](function(_0x1aa8da){if(_0x1aa8da){if(!_[_0xf5ab('0x7c')](_0x1aa8da[_0xf5ab('0x83')])){if(fs['existsSync'](path[_0xf5ab('0x7d')](config[_0xf5ab('0x77')],_0xf5ab('0x82'),_0x1aa8da[_0xf5ab('0x83')]))&&_0x1aa8da[_0xf5ab('0x84')]){_0x418ab3=path[_0xf5ab('0x7d')](config[_0xf5ab('0x77')],_0xf5ab('0x82'),_0x1aa8da[_0xf5ab('0x83')]);}}return _0x339bbd['download'](_0x418ab3);}})[_0xf5ab('0x2c')](handleError(_0x339bbd,null));};exports[_0xf5ab('0x85')]=function(_0x2c9168,_0x534fce,_0x3667c2){var _0x3a038e=path[_0xf5ab('0x7d')](config['root'],_0xf5ab('0x86'));var _0x42ce91={'where':{'id':_0x2c9168[_0xf5ab('0x58')]['id']},'attributes':['id',_0xf5ab('0x76')],'raw':!![]};return db[_0xf5ab('0x41')][_0xf5ab('0x5a')](_0x42ce91)['then'](handleEntityNotFound(_0x534fce,null))[_0xf5ab('0x23')](function(_0x53502e){if(_0x53502e){if(!_[_0xf5ab('0x7c')](_0x53502e['systemAvatar'])){if(fs['existsSync'](path['join'](config['root'],'server/files/images/avatars/',_0x53502e['systemAvatar']))){_0x3a038e=path[_0xf5ab('0x7d')](config['root'],_0xf5ab('0x82'),_0x53502e[_0xf5ab('0x76')]);}}return _0x534fce[_0xf5ab('0x7f')](_0x3a038e);}})[_0xf5ab('0x2c')](handleError(_0x534fce,null));};exports['notify']=function(_0x966a7d,_0x1407af,_0x447668){var _0x251107=require(_0xf5ab('0x87'));var _0x3b62af=new _0x251107();var _0x418a2c=_0x3b62af['setUA'](_0x966a7d[_0xf5ab('0x88')][_0xf5ab('0x89')])[_0xf5ab('0x8a')]();var _0x509639={'body':_0x966a7d[_0xf5ab('0x5c')],'channel':_0xf5ab('0x8b')};var _0x21690c=[];var _0x35aede=[];var _0x280a25={};var _0x392c94=![];return db['CmContact'][_0xf5ab('0x63')]()[_0xf5ab('0x23')](function(_0x5b1fec){if(!_0x5b1fec){throw new db[(_0xf5ab('0x8c'))][(_0xf5ab('0x8d'))]('no\x20available\x20attributes');}_0x21690c=_[_0xf5ab('0x8e')](_[_0xf5ab('0x48')](_0x5b1fec),[_0xf5ab('0x8f'),_0xf5ab('0x90')]);_0x35aede=_[_0xf5ab('0x8e')](_[_0xf5ab('0x48')](_0x5b1fec),[_0xf5ab('0x8f'),_0xf5ab('0x90'),_0xf5ab('0x91'),'ListId']);if(_0x966a7d[_0xf5ab('0x5c')]['id']){delete _0x966a7d[_0xf5ab('0x5c')]['id'];}if(_[_0xf5ab('0x7c')](_0x966a7d[_0xf5ab('0x5c')]['from'])){throw new db[(_0xf5ab('0x8c'))][(_0xf5ab('0x8d'))]('from\x20is\x20mandatory');}if(_[_0xf5ab('0x7c')](_0x966a7d[_0xf5ab('0x5c')]['body'])||_0x966a7d['body'][_0xf5ab('0x5c')]===''){throw new db[(_0xf5ab('0x8c'))][(_0xf5ab('0x8d'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xf5ab('0x7c')](_0x966a7d[_0xf5ab('0x5c')][_0xf5ab('0x92')])){throw new db[(_0xf5ab('0x8c'))][(_0xf5ab('0x8d'))](_0xf5ab('0x93')+_0x35aede);}if(!_[_0xf5ab('0x94')](_0x35aede,_0x966a7d[_0xf5ab('0x5c')][_0xf5ab('0x92')])){throw new db[(_0xf5ab('0x8c'))][(_0xf5ab('0x8d'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x35aede);}_0x280a25[_0x966a7d[_0xf5ab('0x5c')][_0xf5ab('0x92')]]=_0x966a7d[_0xf5ab('0x5c')][_0xf5ab('0x95')];})['then'](function(){return db[_0xf5ab('0x41')][_0xf5ab('0x5a')]({'where':{'id':_0x966a7d['params']['id']},'include':[{'model':db['CmList'],'as':_0xf5ab('0x96'),'include':[{'model':db[_0xf5ab('0x97')],'as':_0xf5ab('0x98'),'where':_0x280a25,'limit':0x1,'order':[['updatedAt',_0xf5ab('0x99')]]}]},{'model':db[_0xf5ab('0x9a')],'as':_0xf5ab('0x9b')}]});})[_0xf5ab('0x23')](handleEntityNotFound(_0x1407af,null))[_0xf5ab('0x23')](function(_0x2ab22c){if(_0x2ab22c&&_0x2ab22c['List']){_0x509639['account']=_0x2ab22c;_0x509639['applications']=_0x2ab22c['Applications'];_0x509639['list']=_0x2ab22c[_0xf5ab('0x96')];_0x509639[_0xf5ab('0x9c')]=_[_0xf5ab('0x9d')](_0x509639['applications'],[_0xf5ab('0x9e')],[_0xf5ab('0x9f')]);if(_0x509639['account'][_0xf5ab('0x9b')]){delete _0x509639['account'][_0xf5ab('0x9b')];}if(_0x509639[_0xf5ab('0xa0')][_0xf5ab('0x96')]&&_0x509639['account'][_0xf5ab('0x96')][_0xf5ab('0x98')][_0xf5ab('0x59')]){return _0x509639[_0xf5ab('0xa0')]['List']['Contacts'][0x0];}var _0x30116b=_[_0xf5ab('0x19')](_0x966a7d[_0xf5ab('0x5c')],{'firstName':_0x966a7d[_0xf5ab('0x5c')][_0xf5ab('0x95')],'ListId':_0x2ab22c[_0xf5ab('0xa1')]});_0x30116b[_0x966a7d[_0xf5ab('0x5c')][_0xf5ab('0x92')]]=_0x966a7d[_0xf5ab('0x5c')]['from'];return db['CmContact'][_0xf5ab('0x5b')](_0x30116b,{'fields':_0x21690c,'raw':!![]});}})[_0xf5ab('0x23')](handleEntityNotFound(_0x1407af,null))['then'](function(_0x5cac2f){_0x509639[_0xf5ab('0xa2')]=_0x5cac2f;var _0x382ab1=_0x966a7d[_0xf5ab('0x5c')][_0xf5ab('0xa3')];if(_0x966a7d['headers']['cf-connecting-ip']){_0x382ab1=_0x966a7d['headers']['cf-connecting-ip'];}else if(_0x966a7d['headers'][_0xf5ab('0xa4')]){_0x382ab1=_[_0xf5ab('0xa5')](_0x966a7d['headers']['x-forwarded-for'][_0xf5ab('0xa6')](','));}if(_0x5cac2f){var _0x5901a4={'ContactId':_0x5cac2f['id'],'ChatWebsiteId':_0x966a7d['params']['id'],'from':(_0x5cac2f['firstName']||'')+'\x20'+(_0x5cac2f[_0xf5ab('0xa7')]||''),'customerIp':_0x382ab1,'customerPort':_0x966a7d['headers'][_0xf5ab('0xa8')]?_0x966a7d[_0xf5ab('0x88')][_0xf5ab('0xa8')]:null,'referer':_0x966a7d[_0xf5ab('0x5c')][_0xf5ab('0xa9')],'browserName':_0x418a2c['browser']['name']&&_0x418a2c[_0xf5ab('0xaa')]['version']?util['format'](_0xf5ab('0xab'),_0x418a2c[_0xf5ab('0xaa')]['name'],_0x418a2c[_0xf5ab('0xaa')][_0xf5ab('0xac')]):_0xf5ab('0xad'),'browserVersion':_0x418a2c[_0xf5ab('0xaa')][_0xf5ab('0xac')]||'unknown','osName':util[_0xf5ab('0xae')](_0xf5ab('0xab'),_0x418a2c['os'][_0xf5ab('0x3d')],_0x418a2c['os'][_0xf5ab('0xac')]),'osVersion':_0x418a2c['os'][_0xf5ab('0xac')],'deviceModel':_0x418a2c[_0xf5ab('0xaf')][_0xf5ab('0x45')]&&_0x418a2c[_0xf5ab('0xaf')][_0xf5ab('0xb0')]?util['format'](_0xf5ab('0xb1'),_0x418a2c[_0xf5ab('0xaf')][_0xf5ab('0x45')],_0x418a2c['device'][_0xf5ab('0xb0')],_0x418a2c['device'][_0xf5ab('0x43')]):null,'deviceVendor':_0x418a2c[_0xf5ab('0xaf')][_0xf5ab('0xb0')],'deviceType':_0x418a2c[_0xf5ab('0xaf')][_0xf5ab('0x43')],'formData':JSON['stringify'](_0x966a7d[_0xf5ab('0x5c')])};var _0x29468d={'ChatWebsiteId':_0x966a7d[_0xf5ab('0x58')]['id'],'closed':![]};if(_0x966a7d[_0xf5ab('0x5c')]['threadId']){_0x29468d['threadId']=_0x966a7d[_0xf5ab('0x5c')][_0xf5ab('0xb2')];return db[_0xf5ab('0xb3')][_0xf5ab('0x5a')]({'where':_0x29468d})['then'](function(_0x261e69){if(_0x261e69){return[_0x261e69,![]];}_0x5901a4[_0xf5ab('0xb2')]=_0x966a7d[_0xf5ab('0x5c')][_0xf5ab('0xb2')];_0x5901a4[_0xf5ab('0xb4')]=_0x966a7d[_0xf5ab('0x5c')]['externalUrl'];return db[_0xf5ab('0xb3')]['create'](_0x5901a4)[_0xf5ab('0x23')](function(_0x527b33){return[_0x527b33,!![]];});});}_0x29468d[_0xf5ab('0xb5')]=_0x5cac2f['id'];if(_0x966a7d['body'][_0xf5ab('0xb6')]&&_0x966a7d[_0xf5ab('0x5c')][_0xf5ab('0xb6')]['id']){_0x29468d['id']=_0x966a7d[_0xf5ab('0x5c')][_0xf5ab('0xb6')]['id'];return db[_0xf5ab('0xb3')][_0xf5ab('0x5a')]({'where':_0x29468d})['then'](function(_0x396137){if(_0x396137){return[_0x396137,![]];}return db[_0xf5ab('0xb3')][_0xf5ab('0x5b')](_0x5901a4)[_0xf5ab('0x23')](function(_0x3179d1){return[_0x3179d1,!![]];});});}return db[_0xf5ab('0xb3')]['create'](_0x5901a4)[_0xf5ab('0x23')](function(_0x34f918){return[_0x34f918,!![]];});}})[_0xf5ab('0xb7')](function(_0x1f231b,_0x2b420b){if(_0x1f231b){_0x392c94=_0x2b420b;if(!_0x2b420b){var _0x2295b3={'from':(_0x509639[_0xf5ab('0xa2')][_0xf5ab('0xb8')]||'')+'\x20'+(_0x509639[_0xf5ab('0xa2')]['lastName']||'')};if(_0x966a7d['body'][_0xf5ab('0xb2')]&&_0x966a7d[_0xf5ab('0x5c')][_0xf5ab('0xb9')]&&_0x966a7d[_0xf5ab('0x5c')][_0xf5ab('0xb2')]!=_0x966a7d[_0xf5ab('0x5c')][_0xf5ab('0xb9')]){_0x2295b3['threadId']=_0x966a7d[_0xf5ab('0x5c')]['messageId'];}return _0x1f231b[_0xf5ab('0x36')](_0x2295b3);}else{return _0x1f231b;}}})[_0xf5ab('0x23')](function(_0x36510a){_0x509639['interaction']=_0x36510a[_0xf5ab('0x38')]({'plain':!![]});_0x509639[_0xf5ab('0xb6')][_0xf5ab('0xba')]=_0x392c94;if(_0x509639[_0xf5ab('0xb6')][_0xf5ab('0xba')]){if(_0x509639[_0xf5ab('0xa0')]['autoclose']){_0x509639[_0xf5ab('0x9c')][_0xf5ab('0xbb')]({'id':0x0,'priority':_0x509639[_0xf5ab('0x9c')][_0xf5ab('0x59')]+0x1,'app':_0xf5ab('0xbc'),'appdata':'unmanaged','interval':'*,*,*,*'});}}return db['ChatMessage'][_0xf5ab('0x5b')]({'body':_0x966a7d[_0xf5ab('0x5c')][_0xf5ab('0x5c')],'ChatWebsiteId':_0x966a7d[_0xf5ab('0x58')]['id'],'ChatInteractionId':_0x36510a['id'],'direction':'in','ContactId':_0x509639[_0xf5ab('0xa2')]['id'],'AttachmentId':_0x966a7d[_0xf5ab('0x5c')][_0xf5ab('0xbd')]});})[_0xf5ab('0x23')](function(_0x21d23b){_0x509639['message']=_0x21d23b;if(_0x509639['interaction'][_0xf5ab('0xbe')]){return db['User']['find']({'attributes':['id',_0xf5ab('0x3d')],'where':{'id':_0x509639[_0xf5ab('0xb6')]['UserId']}})['then'](function(_0x4e150a){if(_0x4e150a){_0x509639[_0xf5ab('0x9c')][_0xf5ab('0xbf')]({'id':0x0,'priority':0x0,'app':_0xf5ab('0xc0'),'appdata':_0x4e150a[_0xf5ab('0x3d')]+','+(_0x509639[_0xf5ab('0xa0')][_0xf5ab('0xc1')]||0xa),'interval':_0xf5ab('0xc2')});_0x509639[_0xf5ab('0xc3')]=!![];}return respondWithRpcPromise(_0xf5ab('0xc4'),_0xf5ab('0xc5'),_0x509639);});}return respondWithRpcPromise(_0xf5ab('0xc4'),_0xf5ab('0xc5'),_0x509639);})['then'](function(_0x3d1325){respondWithRpcPromise('EventManager',_0xf5ab('0xc6'),{'event':_0xf5ab('0xc7'),'message':_0x3d1325},client9002);return _0x3d1325;})[_0xf5ab('0x23')](respondWithResult(_0x1407af,null))[_0xf5ab('0x2c')](handleError(_0x1407af,null));};exports[_0xf5ab('0xc8')]=function(_0x7bda62,_0x5b9b41,_0x3e38aa){var _0x44f453,_0xee4c66,_0x248dbe;var _0x2db41a=[];var _0x31f64a=[];var _0x4b66db={};return db[_0xf5ab('0x97')][_0xf5ab('0x63')]()[_0xf5ab('0x23')](function(_0xa885f6){if(!_0xa885f6){throw new db['Sequelize'][(_0xf5ab('0x8d'))](_0xf5ab('0xc9'));}_0x31f64a=_[_0xf5ab('0x8e')](_['keys'](_0xa885f6),['createdAt',_0xf5ab('0x90')]);_0x2db41a=_[_0xf5ab('0x8e')](_[_0xf5ab('0x48')](_0xa885f6),[_0xf5ab('0x8f'),'updatedAt','CompanyId',_0xf5ab('0xa1')]);if(_0x7bda62[_0xf5ab('0x5c')]['id']){delete _0x7bda62[_0xf5ab('0x5c')]['id'];}if(_[_0xf5ab('0x7c')](_0x7bda62['body'][_0xf5ab('0x95')])){throw _0x5b9b41['status'](0x1f4)[_0xf5ab('0xca')](new db['Sequelize']['ValidationError'](_0xf5ab('0xcb')));}if(_['isNil'](_0x7bda62[_0xf5ab('0x5c')][_0xf5ab('0x5c')])||_0x7bda62[_0xf5ab('0x5c')][_0xf5ab('0x5c')]===''){throw _0x5b9b41[_0xf5ab('0x2d')](0x1f4)['send'](new db[(_0xf5ab('0x8c'))][(_0xf5ab('0x8d'))](_0xf5ab('0xcc')));}if(_[_0xf5ab('0x7c')](_0x7bda62[_0xf5ab('0x5c')][_0xf5ab('0xcd')])){throw _0x5b9b41[_0xf5ab('0x2d')](0x1f4)[_0xf5ab('0xca')](new db[(_0xf5ab('0x8c'))]['ValidationError'](_0xf5ab('0xce')+_0x2db41a));}if(!_[_0xf5ab('0x94')](_0x2db41a,_0x7bda62[_0xf5ab('0x5c')][_0xf5ab('0xcd')])){throw _0x5b9b41['status'](0x1f4)[_0xf5ab('0xca')](new db[(_0xf5ab('0x8c'))]['ValidationError'](_0xf5ab('0xcf')+_0x2db41a));}_0x4b66db[_0x7bda62['body'][_0xf5ab('0xcd')]]=_0x7bda62[_0xf5ab('0x5c')][_0xf5ab('0x95')];})[_0xf5ab('0x23')](function(){return db[_0xf5ab('0x41')][_0xf5ab('0x5a')]({'where':{'id':_0x7bda62[_0xf5ab('0x58')]['id']},'include':[{'model':db[_0xf5ab('0xd0')],'as':_0xf5ab('0x96')}]});})[_0xf5ab('0x23')](handleEntityNotFound(_0x5b9b41,null))[_0xf5ab('0x23')](function(_0x19607a){if(_0x19607a&&_0x19607a['List']){_0xee4c66=_0x19607a;var _0x164bb5=_[_0xf5ab('0x19')](_0x7bda62[_0xf5ab('0x5c')],{'firstName':_0x7bda62['body'][_0xf5ab('0x95')],'phone':_0x7bda62['body'][_0xf5ab('0x95')],'ListId':_0x19607a[_0xf5ab('0xa1')]});_0x164bb5[_0x7bda62[_0xf5ab('0x5c')][_0xf5ab('0xcd')]]=_0x7bda62[_0xf5ab('0x5c')][_0xf5ab('0x95')];return db[_0xf5ab('0x97')][_0xf5ab('0xd1')]({'where':_0x4b66db,'defaults':_0x164bb5});}})[_0xf5ab('0xb7')](function(_0x3f44eb){if(_0x3f44eb){_0x248dbe=_0x3f44eb;var _0x44651a=fs[_0xf5ab('0xd2')](path[_0xf5ab('0x7d')](config['root'],'server/files/templates/chatOfflineMessage.ejs'),'utf8');var _0x455388=ejs['render'](_0x44651a,{'body':_['toPairs'](_0x7bda62['body'][_0xf5ab('0x5c')]),'bodyTitle':_0xee4c66[_0xf5ab('0xd3')]});return db[_0xf5ab('0xd4')][_0xf5ab('0x5b')]({'body':_0x455388,'ContactId':_0x3f44eb['id'],'ChatWebsiteId':_0xee4c66['id']});}})[_0xf5ab('0x23')](function(_0x4b3f87){if(_0x4b3f87){_0x44f453=_0x4b3f87;return db[_0xf5ab('0xd5')][_0xf5ab('0x66')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xf5ab('0xd6'),'raw':!![]}]});}})[_0xf5ab('0x23')](function(_0x1a18b1){if(_0x1a18b1&&_0x1a18b1[_0xf5ab('0xd6')]&&_0xee4c66['forwardOfflineAddress']){var _0x1fbaa6={'tls':{'rejectUnauthorized':![]}};if(_0x1a18b1[_0xf5ab('0xd6')]['service']){_0x1fbaa6['service']=_0x1a18b1[_0xf5ab('0xd6')]['service'];}else{_0x1fbaa6[_0xf5ab('0xd7')]=_0x1a18b1[_0xf5ab('0xd6')][_0xf5ab('0xd7')];_0x1fbaa6[_0xf5ab('0xd8')]=_0x1a18b1[_0xf5ab('0xd6')][_0xf5ab('0xd8')];_0x1fbaa6['secure']=_0x1a18b1[_0xf5ab('0xd6')][_0xf5ab('0xd9')];}if(_0x1a18b1[_0xf5ab('0xd6')][_0xf5ab('0xda')]){_0x1fbaa6['auth']={'user':_0x1a18b1[_0xf5ab('0xd6')][_0xf5ab('0x5d')],'pass':_0x1a18b1[_0xf5ab('0xd6')]['pass']};}return respondWithRpcPromise(_0xf5ab('0xdb'),_0xf5ab('0xdc'),{'account':_0x1fbaa6,'message':{'from':util[_0xf5ab('0xae')](_0xf5ab('0xdd'),_0x1a18b1[_0xf5ab('0x3d')],_0x1a18b1[_0xf5ab('0xde')]||_0x1a18b1[_0xf5ab('0xd6')][_0xf5ab('0x5d')]),'to':_0xee4c66[_0xf5ab('0xdf')],'subject':_0xee4c66['offlineMessageSubject'],'text':_0x44f453['body']}},client9003)[_0xf5ab('0x23')](function(){return _0x44f453;})[_0xf5ab('0x2c')](function(_0x373935){console[_0xf5ab('0x27')](_0x373935);});}})[_0xf5ab('0x23')](function(){if(_0x44f453){return _0x44f453;}})[_0xf5ab('0x23')](respondWithResult(_0x5b9b41,null))[_0xf5ab('0x2c')](handleError(_0x5b9b41,null));};exports[_0xf5ab('0xe0')]=function(_0x1fa1d5,_0x122d2d,_0x20e3ab){return db['ChatInteraction'][_0xf5ab('0x5a')]({'where':{'id':_0x1fa1d5[_0xf5ab('0x58')]['id']}})['then'](handleEntityNotFound(_0x122d2d,null))[_0xf5ab('0x23')](function(_0x3a73fb){if(_0x3a73fb){return _0x3a73fb['addInteraction'](_0x1fa1d5['body'][_0xf5ab('0x69')],_['omit'](_0x1fa1d5[_0xf5ab('0x5c')],[_0xf5ab('0x69'),'id'])||{});}})['then'](respondWithResult(_0x122d2d,null))[_0xf5ab('0x2c')](handleError(_0x122d2d,null));};exports['getInteractions']=function(_0x575fe7,_0x500e4,_0x5b4140){var _0x5b4d91={'raw':![],'where':{}};var _0x46db93={};var _0x73eae8={'count':0x0,'rows':[]};return db[_0xf5ab('0x41')]['findOne']({'where':{'id':_0x575fe7[_0xf5ab('0x58')]['id']}})[_0xf5ab('0x23')](handleEntityNotFound(_0x500e4,null))['then'](function(_0xc19969){if(_0xc19969){_0x46db93[_0xf5ab('0x45')]=_['keys'](db[_0xf5ab('0xb3')]['rawAttributes']);_0x46db93['query']=_[_0xf5ab('0x48')](_0x575fe7[_0xf5ab('0x47')]);_0x46db93[_0xf5ab('0x49')]=_[_0xf5ab('0x4a')](_0x46db93[_0xf5ab('0x45')],_0x46db93[_0xf5ab('0x47')]);_0x5b4d91['attributes']=_[_0xf5ab('0x4a')](_0x46db93[_0xf5ab('0x45')],qs[_0xf5ab('0x4b')](_0x575fe7[_0xf5ab('0x47')]['fields']));_0x5b4d91[_0xf5ab('0x4c')]=_0x5b4d91['attributes'][_0xf5ab('0x59')]?_0x5b4d91['attributes']:_0x46db93['model'];if(!_0x575fe7[_0xf5ab('0x47')][_0xf5ab('0x4d')](_0xf5ab('0x4e'))){_0x5b4d91[_0xf5ab('0x31')]=qs[_0xf5ab('0x31')](_0x575fe7['query']['limit']);_0x5b4d91['offset']=qs[_0xf5ab('0x30')](_0x575fe7['query'][_0xf5ab('0x30')]);}_0x5b4d91[_0xf5ab('0x4f')]=qs['sort'](_0x575fe7[_0xf5ab('0x47')][_0xf5ab('0x50')]);_0x5b4d91[_0xf5ab('0x51')]=qs['filters'](_[_0xf5ab('0x52')](_0x575fe7['query'],_0x46db93[_0xf5ab('0x49')]));_0x5b4d91['where'][_0xf5ab('0x6c')]=_0xc19969['id'];if(_0x575fe7[_0xf5ab('0x47')][_0xf5ab('0x53')]){_0x5b4d91['where']=_[_0xf5ab('0x54')](_0x5b4d91[_0xf5ab('0x51')],{'$or':_[_0xf5ab('0x46')](_0x5b4d91['attributes'],function(_0x33c27f){var _0x4a82b8={};_0x4a82b8[_0x33c27f]={'$like':'%'+_0x575fe7[_0xf5ab('0x47')][_0xf5ab('0x53')]+'%'};return _0x4a82b8;})});}_0x5b4d91=_[_0xf5ab('0x54')]({},_0x5b4d91,_0x575fe7[_0xf5ab('0x55')]);return db[_0xf5ab('0xb3')]['count']({'where':_0x5b4d91[_0xf5ab('0x51')]})[_0xf5ab('0x23')](function(_0x2785b2){_0x73eae8[_0xf5ab('0x2f')]=_0x2785b2;if(_0x575fe7[_0xf5ab('0x47')][_0xf5ab('0x6d')]){_0x5b4d91[_0xf5ab('0xe1')]=[{'model':db[_0xf5ab('0x97')],'as':_0xf5ab('0xe2'),'required':![]},{'model':db[_0xf5ab('0xe3')],'as':_0xf5ab('0xe4'),'attributes':[_0xf5ab('0x3d'),_0xf5ab('0xe5'),'internal'],'required':![]},{'model':db[_0xf5ab('0xe6')],'as':_0xf5ab('0xe7'),'attributes':['id',_0xf5ab('0x3d'),_0xf5ab('0xe8')],'where':_0x575fe7[_0xf5ab('0x47')][_0xf5ab('0xe9')]?{'id':_0x575fe7[_0xf5ab('0x47')]['tag']}:undefined,'required':_0x575fe7[_0xf5ab('0x47')][_0xf5ab('0xe9')]?!![]:![]}];}return db[_0xf5ab('0xb3')][_0xf5ab('0xea')](_0x5b4d91);})['then'](function(_0x316e62){_0x73eae8[_0xf5ab('0x56')]=_0x316e62;return _0x73eae8;});}})[_0xf5ab('0x23')](respondWithFilteredResult(_0x500e4,_0x5b4d91))[_0xf5ab('0x2c')](handleError(_0x500e4,null));};function iftimePromise(_0x5e2dcb,_0x4ea06e){return respondWithRpcPromise(_0xf5ab('0xeb'),_0xf5ab('0xec'),{'command':_0x4ea06e[_0xf5ab('0xed')]?util[_0xf5ab('0xae')](_0xf5ab('0xee'),_0x5e2dcb[_0xf5ab('0xef')],_0x4ea06e['timezone']):util[_0xf5ab('0xae')](_0xf5ab('0xf0'),_0x5e2dcb[_0xf5ab('0xef')])},client9002)[_0xf5ab('0x23')](function(_0xfc5817){var _0x404515=_0xfc5817&&_0xfc5817[_0xf5ab('0xf1')](_0xf5ab('0xf2'))>=0x0?!![]:![];logger['info'](_0xf5ab('0xf3'),_0x4ea06e['id'],_0x5e2dcb['id'],_0x5e2dcb[_0xf5ab('0xef')],_0x404515?_0xf5ab('0xf4'):_0xf5ab('0xf5'),_0x4ea06e['timezone']?_0x4ea06e[_0xf5ab('0xed')]:_0xf5ab('0xf6'));return _0x404515;})['catch'](function(_0x57fcc2){logger[_0xf5ab('0x27')](_0xf5ab('0xf3'),_0x4ea06e['id'],_0x5e2dcb['id'],_0x5e2dcb[_0xf5ab('0xef')],util[_0xf5ab('0xf7')](_0x57fcc2,{'showHidden':![],'depth':null}),_0x4ea06e[_0xf5ab('0xed')]?_0x4ea06e['timezone']:_0xf5ab('0xf6'));return![];});}exports[_0xf5ab('0xec')]=function(_0x10ded8,_0x2f7c8c,_0x4de49d){var _0x49c0d5=0x0;var _0x234a27=0x0;var _0x55297f=![];var _0x323ed4;var _0x1c9b36;return db[_0xf5ab('0x41')][_0xf5ab('0x5a')]({'where':{'id':_0x10ded8[_0xf5ab('0x58')]['id']},'include':[{'model':db[_0xf5ab('0xf8')],'as':_0xf5ab('0xf8'),'include':[{'model':db[_0xf5ab('0xf8')],'as':_0xf5ab('0xf9'),'attributes':['id',_0xf5ab('0xef')],'raw':!![]}]}]})[_0xf5ab('0x23')](handleEntityNotFound(_0x2f7c8c,null))['then'](function(_0x273291){if(_0x273291){_0x323ed4=_0x273291;return _0x273291[_0xf5ab('0xfa')]({'raw':!![]});}})[_0xf5ab('0x23')](function(_0x28fca9){if(_0x323ed4){if(_0x28fca9){_0x1c9b36=_0x28fca9;}}return require('../../config/license/util')['getLicense']();})['then'](function(_0xfc4f67){if(_0xfc4f67){_0x234a27=_0xfc4f67['virtual'];_0x55297f=_0xfc4f67[_0xf5ab('0x7b')];}})[_0xf5ab('0x23')](function(){return db[_0xf5ab('0xb3')][_0xf5ab('0x2f')]({'where':{'closed':![]}});})[_0xf5ab('0x23')](function(_0x50f5f2){_0x49c0d5=_0x50f5f2;if(_0x234a27&&_0x50f5f2>_0x234a27){return db[_0xf5ab('0xfb')]['findOne']({'where':{'id':0x1}})[_0xf5ab('0x23')](function(_0x5aacbf){if(_0x5aacbf){_0x5aacbf['increment'](_0xf5ab('0xfc'));}});}})[_0xf5ab('0x23')](function(){if(_0x323ed4[_0xf5ab('0xf8')]&&_0x323ed4[_0xf5ab('0xf8')][_0xf5ab('0xf9')]){var _0x547af5=[];for(var _0xe2c6c3=0x0;_0xe2c6c3<_0x323ed4[_0xf5ab('0xf8')][_0xf5ab('0xf9')][_0xf5ab('0x59')];_0xe2c6c3++){var _0x234aed=_0x323ed4[_0xf5ab('0xf8')][_0xf5ab('0xf9')][_0xe2c6c3][_0xf5ab('0x38')]({'plain':!![]});_0x547af5[_0xf5ab('0xbb')](iftimePromise(_0x234aed,_0x323ed4));}return BPromise['all'](_0x547af5)[_0xf5ab('0x23')](function(_0x26505a){return _[_0xf5ab('0xfd')](_0x26505a);});}else{return!![];}})[_0xf5ab('0x23')](function(_0x35ab6d){var _0x15479b=fs['readFileSync'](path[_0xf5ab('0x7d')](config[_0xf5ab('0x77')],_0xf5ab('0xfe')),_0xf5ab('0xff'));var _0x2e6dda={'remote':_0x323ed4[_0xf5ab('0x100')],'query':querystring[_0xf5ab('0x26')](_[_0xf5ab('0x54')](_0x323ed4['get']({'plain':!![]}),{'customerIp':_0x10ded8['headers'][_0xf5ab('0xa4')]||_0x10ded8['headers'][_0xf5ab('0x101')]||_0x10ded8[_0xf5ab('0x102')][_0xf5ab('0x103')]||_0x10ded8['ip'],'referer':_0x10ded8[_0xf5ab('0x88')][_0xf5ab('0xa9')],'openedInteractions':_0x49c0d5,'maxInteractions':_0x234a27,'virtual':_0x55297f['virtual'],'online':_0x35ab6d,'custom':_0x55297f}))[_0xf5ab('0x104')](/'/g,'\x5c\x27')};_0x2f7c8c[_0xf5ab('0xca')](ejs[_0xf5ab('0x105')](Mustache[_0xf5ab('0x105')](_0x15479b,_0x2e6dda),{'proactiveActions':_0x1c9b36,'alignment':_0x323ed4[_0xf5ab('0x106')],'verticalAlignment':_0x323ed4[_0xf5ab('0x107')]}));})[_0xf5ab('0x2c')](handleError(_0x2f7c8c,null));};exports[_0xf5ab('0x108')]=function(_0x220058,_0x2cdf17,_0x5a2b40){return db[_0xf5ab('0x41')]['findOne']({'where':{'id':_0x220058[_0xf5ab('0x58')]['id']}})[_0xf5ab('0x23')](handleEntityNotFound(_0x2cdf17,null))['then'](function(_0x5d4d74){if(_0x5d4d74){return db[_0xf5ab('0x109')]['transaction'](function(_0x4b02f1){return db['ChatApplication'][_0xf5ab('0x37')]({'where':{'ChatWebsiteId':_0x220058['params']['id']},'transaction':_0x4b02f1})[_0xf5ab('0x23')](function(_0x12db3d){var _0x549689=_['map'](_0x220058[_0xf5ab('0x5c')],function(_0xa323be){_0xa323be['ChatWebsiteId']=_0x220058[_0xf5ab('0x58')]['id'];return _0xa323be;});return db[_0xf5ab('0x9a')][_0xf5ab('0x10a')](_0x549689,{'transaction':_0x4b02f1});});})['then'](function(){return db['ChatApplication']['findAndCountAll']({'where':{'ChatWebsiteId':_0x220058[_0xf5ab('0x58')]['id']},'order':_0xf5ab('0x9e')});});}})[_0xf5ab('0x23')](respondWithResult(_0x2cdf17,null))[_0xf5ab('0x2c')](handleError(_0x2cdf17,null));};exports[_0xf5ab('0x10b')]=function(_0x392b4f,_0x4bf9eb,_0x30e7bd){var _0x5af57d={};var _0x3a32d4={};var _0x4ff90d;var _0x9279b0;return db[_0xf5ab('0x41')]['findOne']({'where':{'id':_0x392b4f[_0xf5ab('0x58')]['id']}})[_0xf5ab('0x23')](handleEntityNotFound(_0x4bf9eb,null))[_0xf5ab('0x23')](function(_0x8a91c1){if(_0x8a91c1){_0x4ff90d=_0x8a91c1;_0x3a32d4[_0xf5ab('0x45')]=_[_0xf5ab('0x48')](db[_0xf5ab('0x9a')]['rawAttributes']);_0x3a32d4['query']=_[_0xf5ab('0x48')](_0x392b4f[_0xf5ab('0x47')]);_0x3a32d4[_0xf5ab('0x49')]=_[_0xf5ab('0x4a')](_0x3a32d4[_0xf5ab('0x45')],_0x3a32d4['query']);_0x5af57d[_0xf5ab('0x4c')]=_[_0xf5ab('0x4a')](_0x3a32d4[_0xf5ab('0x45')],qs[_0xf5ab('0x4b')](_0x392b4f[_0xf5ab('0x47')][_0xf5ab('0x4b')]));_0x5af57d[_0xf5ab('0x4c')]=_0x5af57d[_0xf5ab('0x4c')][_0xf5ab('0x59')]?_0x5af57d[_0xf5ab('0x4c')]:_0x3a32d4[_0xf5ab('0x45')];_0x5af57d[_0xf5ab('0x4f')]=qs['sort'](_0x392b4f[_0xf5ab('0x47')][_0xf5ab('0x50')]);_0x5af57d['where']=qs[_0xf5ab('0x49')](_[_0xf5ab('0x52')](_0x392b4f[_0xf5ab('0x47')],_0x3a32d4[_0xf5ab('0x49')]));if(_0x392b4f[_0xf5ab('0x47')]['filter']){_0x5af57d[_0xf5ab('0x51')]=_[_0xf5ab('0x54')](_0x5af57d[_0xf5ab('0x51')],{'$or':_[_0xf5ab('0x46')](_0x5af57d[_0xf5ab('0x4c')],function(_0x559e80){var _0xf1ba4={};_0xf1ba4[_0x559e80]={'$like':'%'+_0x392b4f[_0xf5ab('0x47')][_0xf5ab('0x53')]+'%'};return _0xf1ba4;})});}_0x5af57d=_[_0xf5ab('0x54')]({},_0x5af57d,_0x392b4f[_0xf5ab('0x55')]);return _0x4ff90d[_0xf5ab('0x10b')](_0x5af57d);}})[_0xf5ab('0x23')](function(_0x135936){if(_0x135936){_0x9279b0=_0x135936['length'];if(!_0x392b4f[_0xf5ab('0x47')]['hasOwnProperty'](_0xf5ab('0x4e'))){_0x5af57d[_0xf5ab('0x31')]=qs[_0xf5ab('0x31')](_0x392b4f['query'][_0xf5ab('0x31')]);_0x5af57d[_0xf5ab('0x30')]=qs[_0xf5ab('0x30')](_0x392b4f[_0xf5ab('0x47')][_0xf5ab('0x30')]);}return _0x4ff90d[_0xf5ab('0x10b')](_0x5af57d);}})[_0xf5ab('0x23')](function(_0x540c87){if(_0x540c87){return _0x540c87?{'count':_0x9279b0,'rows':_0x540c87}:null;}})[_0xf5ab('0x23')](respondWithResult(_0x4bf9eb,null))[_0xf5ab('0x2c')](handleError(_0x4bf9eb,null));};exports[_0xf5ab('0x10c')]=function(_0x2656d9,_0x11c44d,_0x59c383){return db[_0xf5ab('0x10d')][_0xf5ab('0x5a')]({'where':{'id':_0x2656d9[_0xf5ab('0x58')]['id']}})[_0xf5ab('0x23')](handleEntityNotFound(_0x11c44d,null))[_0xf5ab('0x23')](function(_0x4fcc4e){if(_0x4fcc4e){return _0x4fcc4e[_0xf5ab('0x10c')](_0x2656d9[_0xf5ab('0x5c')][_0xf5ab('0x69')],_[_0xf5ab('0x10e')](_0x2656d9[_0xf5ab('0x5c')],[_0xf5ab('0x69'),'id'])||{});}})[_0xf5ab('0x23')](respondWithResult(_0x11c44d,null))[_0xf5ab('0x2c')](handleError(_0x11c44d,null));};exports['getProactiveActions']=function(_0xa8d49b,_0x19fa27,_0xf89b4f){var _0x469fe6={};var _0x1a14eb={};var _0x21ff90;var _0x2439ca;return db[_0xf5ab('0x41')][_0xf5ab('0x66')]({'where':{'id':_0xa8d49b[_0xf5ab('0x58')]['id']}})['then'](handleEntityNotFound(_0x19fa27,null))[_0xf5ab('0x23')](function(_0x2acf7a){if(_0x2acf7a){_0x21ff90=_0x2acf7a;_0x1a14eb[_0xf5ab('0x45')]=_[_0xf5ab('0x48')](db[_0xf5ab('0x10f')][_0xf5ab('0x42')]);_0x1a14eb[_0xf5ab('0x47')]=_[_0xf5ab('0x48')](_0xa8d49b[_0xf5ab('0x47')]);_0x1a14eb[_0xf5ab('0x49')]=_['intersection'](_0x1a14eb[_0xf5ab('0x45')],_0x1a14eb['query']);_0x469fe6[_0xf5ab('0x4c')]=_[_0xf5ab('0x4a')](_0x1a14eb['model'],qs[_0xf5ab('0x4b')](_0xa8d49b[_0xf5ab('0x47')][_0xf5ab('0x4b')]));_0x469fe6[_0xf5ab('0x4c')]=_0x469fe6[_0xf5ab('0x4c')][_0xf5ab('0x59')]?_0x469fe6[_0xf5ab('0x4c')]:_0x1a14eb[_0xf5ab('0x45')];_0x469fe6[_0xf5ab('0x4f')]=qs[_0xf5ab('0x50')](_0xa8d49b[_0xf5ab('0x47')][_0xf5ab('0x50')]);_0x469fe6[_0xf5ab('0x51')]=qs[_0xf5ab('0x49')](_[_0xf5ab('0x52')](_0xa8d49b[_0xf5ab('0x47')],_0x1a14eb['filters']));if(_0xa8d49b[_0xf5ab('0x47')]['filter']){_0x469fe6[_0xf5ab('0x51')]=_['merge'](_0x469fe6[_0xf5ab('0x51')],{'$or':_[_0xf5ab('0x46')](_0x469fe6[_0xf5ab('0x4c')],function(_0x3689b2){var _0x36ea4a={};_0x36ea4a[_0x3689b2]={'$like':'%'+_0xa8d49b[_0xf5ab('0x47')][_0xf5ab('0x53')]+'%'};return _0x36ea4a;})});}_0x469fe6=_[_0xf5ab('0x54')]({},_0x469fe6,_0xa8d49b[_0xf5ab('0x55')]);return _0x21ff90['getProactiveActions'](_0x469fe6);}})[_0xf5ab('0x23')](function(_0x244332){if(_0x244332){_0x2439ca=_0x244332['length'];if(!_0xa8d49b['query'][_0xf5ab('0x4d')](_0xf5ab('0x4e'))){_0x469fe6[_0xf5ab('0x31')]=qs[_0xf5ab('0x31')](_0xa8d49b[_0xf5ab('0x47')][_0xf5ab('0x31')]);_0x469fe6['offset']=qs[_0xf5ab('0x30')](_0xa8d49b[_0xf5ab('0x47')][_0xf5ab('0x30')]);}return _0x21ff90[_0xf5ab('0xfa')](_0x469fe6);}})[_0xf5ab('0x23')](function(_0x20c192){if(_0x20c192){return _0x20c192?{'count':_0x2439ca,'rows':_0x20c192}:null;}})[_0xf5ab('0x23')](respondWithResult(_0x19fa27,null))['catch'](handleError(_0x19fa27,null));};exports[_0xf5ab('0x110')]=function(_0x2f7bf4,_0x496faa,_0x5bf55f){var _0x1f0c63=_0x2f7bf4[_0xf5ab('0x47')]['online']==='false'?_0xf5ab('0x111'):_0xf5ab('0x112');return db[_0xf5ab('0x41')][_0xf5ab('0x5a')]({'attributes':['id',_0x1f0c63],'where':{'id':_0x2f7bf4[_0xf5ab('0x58')]['id']}})[_0xf5ab('0x23')](handleEntityNotFound(_0x496faa,null))[_0xf5ab('0x23')](function(_0x406847){if(_0x406847){var _0x2c6912=_0x406847[_0x1f0c63];var _0x599af1=_0x2c6912&&_0x2c6912[_0xf5ab('0x113')]?_0x2c6912[_0xf5ab('0x113')]:[];_0x496faa['send']({'fromKey':_['isNil'](_0x2c6912[_0xf5ab('0x114')])?undefined:_0x2c6912[_0xf5ab('0x114')],'count':_0x599af1[_0xf5ab('0x59')],'rows':_0x599af1});}})[_0xf5ab('0x2c')](handleError(_0x496faa,null));};exports[_0xf5ab('0x115')]=function(_0x3f7ec3,_0x2d0171,_0x4bc333){var _0x60a07f={'raw':!![],'where':{}};var _0x3beb30={};var _0x3da427={'count':0x0,'rows':[]};return db[_0xf5ab('0x41')][_0xf5ab('0x66')]({'where':{'id':_0x3f7ec3[_0xf5ab('0x58')]['id']}})[_0xf5ab('0x23')](handleEntityNotFound(_0x2d0171,null))['then'](function(_0x199449){if(_0x199449){_0x3beb30['model']=_['keys'](db[_0xf5ab('0xd4')][_0xf5ab('0x42')]);_0x3beb30['query']=_[_0xf5ab('0x48')](_0x3f7ec3[_0xf5ab('0x47')]);_0x3beb30[_0xf5ab('0x49')]=_['intersection'](_0x3beb30[_0xf5ab('0x45')],_0x3beb30[_0xf5ab('0x47')]);_0x60a07f[_0xf5ab('0x4c')]=_[_0xf5ab('0x4a')](_0x3beb30['model'],qs[_0xf5ab('0x4b')](_0x3f7ec3[_0xf5ab('0x47')]['fields']));_0x60a07f[_0xf5ab('0x4c')]=_0x60a07f['attributes']['length']?_0x60a07f['attributes']:_0x3beb30[_0xf5ab('0x45')];if(!_0x3f7ec3[_0xf5ab('0x47')][_0xf5ab('0x4d')](_0xf5ab('0x4e'))){_0x60a07f[_0xf5ab('0x31')]=qs[_0xf5ab('0x31')](_0x3f7ec3['query']['limit']);_0x60a07f[_0xf5ab('0x30')]=qs['offset'](_0x3f7ec3[_0xf5ab('0x47')][_0xf5ab('0x30')]);}_0x60a07f[_0xf5ab('0x4f')]=qs['sort'](_0x3f7ec3['query'][_0xf5ab('0x50')]);_0x60a07f['where']=qs[_0xf5ab('0x49')](_[_0xf5ab('0x52')](_0x3f7ec3['query'],_0x3beb30[_0xf5ab('0x49')]));_0x60a07f[_0xf5ab('0x51')][_0xf5ab('0x6c')]=_0x199449['id'];if(_0x3f7ec3[_0xf5ab('0x47')][_0xf5ab('0x53')]){_0x60a07f['where']=_[_0xf5ab('0x54')](_0x60a07f[_0xf5ab('0x51')],{'$or':_[_0xf5ab('0x46')](_0x60a07f[_0xf5ab('0x4c')],function(_0x2d022a){var _0x4e3a52={};_0x4e3a52[_0x2d022a]={'$like':'%'+_0x3f7ec3[_0xf5ab('0x47')]['filter']+'%'};return _0x4e3a52;})});}_0x60a07f=_[_0xf5ab('0x54')]({},_0x60a07f,_0x3f7ec3[_0xf5ab('0x55')]);return db['ChatOfflineMessage'][_0xf5ab('0x2f')]({'where':_0x60a07f[_0xf5ab('0x51')]})[_0xf5ab('0x23')](function(_0x1c62b2){_0x3da427['count']=_0x1c62b2;if(_0x3f7ec3[_0xf5ab('0x47')][_0xf5ab('0x6d')]){_0x60a07f[_0xf5ab('0xe1')]=[{'all':!![]}];}return db[_0xf5ab('0xd4')][_0xf5ab('0xea')](_0x60a07f);})[_0xf5ab('0x23')](function(_0x4457a3){_0x3da427['rows']=_0x4457a3;return _0x3da427;});}})['then'](respondWithFilteredResult(_0x2d0171,_0x60a07f))[_0xf5ab('0x2c')](handleError(_0x2d0171,null));};exports[_0xf5ab('0x116')]=function(_0x35a22f,_0x5a8dea,_0xe0c2eb){return db[_0xf5ab('0x41')][_0xf5ab('0x5a')]({'where':{'id':_0x35a22f[_0xf5ab('0x58')]['id']}})[_0xf5ab('0x23')](handleEntityNotFound(_0x5a8dea,null))['then'](function(_0x1909bf){if(_0x1909bf){return _0x1909bf[_0xf5ab('0x116')](_0x35a22f['body'][_0xf5ab('0x69')],_[_0xf5ab('0x10e')](_0x35a22f[_0xf5ab('0x5c')],[_0xf5ab('0x69'),'id'])||{})[_0xf5ab('0xb7')](function(_0x31fe8f){for(var _0x5e641d=0x0;_0x5e641d<_0x35a22f[_0xf5ab('0x5c')][_0xf5ab('0x69')][_0xf5ab('0x59')];_0x5e641d+=0x1){socket[_0xf5ab('0x117')](_0xf5ab('0x118'),{'UserId':_0x35a22f['body'][_0xf5ab('0x69')][_0x5e641d],'ChatWebsiteId':_0x35a22f['params']['id']});}return _0x31fe8f;});}})[_0xf5ab('0x23')](respondWithResult(_0x5a8dea,null))[_0xf5ab('0x2c')](handleError(_0x5a8dea,null));};exports[_0xf5ab('0x119')]=function(_0x198da8,_0x24ccd,_0x54a6a0){return db['ChatWebsite'][_0xf5ab('0x5a')]({'where':{'id':_0x198da8[_0xf5ab('0x58')]['id']}})['then'](handleEntityNotFound(_0x24ccd,null))[_0xf5ab('0x23')](function(_0x47e8b1){if(_0x47e8b1){return _0x47e8b1[_0xf5ab('0x119')](_0x198da8['query'][_0xf5ab('0x69')])['then'](function(){if(_[_0xf5ab('0x11a')](_0x198da8[_0xf5ab('0x47')][_0xf5ab('0x69')])){for(var _0x43dd81=0x0;_0x43dd81<_0x198da8[_0xf5ab('0x47')][_0xf5ab('0x69')][_0xf5ab('0x59')];_0x43dd81+=0x1){socket[_0xf5ab('0x117')]('userChatWebsite:remove',{'UserId':Number(_0x198da8['query'][_0xf5ab('0x69')][_0x43dd81]),'ChatWebsiteId':Number(_0x198da8[_0xf5ab('0x58')]['id'])});}}else{socket[_0xf5ab('0x117')](_0xf5ab('0x11b'),{'UserId':Number(_0x198da8[_0xf5ab('0x47')][_0xf5ab('0x69')]),'ChatWebsiteId':Number(_0x198da8[_0xf5ab('0x58')]['id'])});}});}})[_0xf5ab('0x23')](respondWithStatusCode(_0x24ccd,null))[_0xf5ab('0x2c')](handleError(_0x24ccd,null));};exports[_0xf5ab('0x11c')]=function(_0x3dbdd0,_0x2b6592,_0x210811){var _0x1d63cb={};var _0x4dbd15={};var _0x916df0;var _0x52ed3f;return db[_0xf5ab('0x41')]['findOne']({'where':{'id':_0x3dbdd0[_0xf5ab('0x58')]['id']}})[_0xf5ab('0x23')](handleEntityNotFound(_0x2b6592,null))[_0xf5ab('0x23')](function(_0x13406c){if(_0x13406c){_0x916df0=_0x13406c;_0x4dbd15[_0xf5ab('0x45')]=_[_0xf5ab('0x48')](db[_0xf5ab('0xe3')][_0xf5ab('0x42')]);_0x4dbd15[_0xf5ab('0x47')]=_['keys'](_0x3dbdd0['query']);_0x4dbd15[_0xf5ab('0x49')]=_[_0xf5ab('0x4a')](_0x4dbd15[_0xf5ab('0x45')],_0x4dbd15[_0xf5ab('0x47')]);_0x1d63cb[_0xf5ab('0x4c')]=_[_0xf5ab('0x4a')](_0x4dbd15[_0xf5ab('0x45')],qs[_0xf5ab('0x4b')](_0x3dbdd0[_0xf5ab('0x47')][_0xf5ab('0x4b')]));_0x1d63cb['attributes']=_0x1d63cb[_0xf5ab('0x4c')]['length']?_0x1d63cb[_0xf5ab('0x4c')]:_0x4dbd15[_0xf5ab('0x45')];_0x1d63cb[_0xf5ab('0x4f')]=qs[_0xf5ab('0x50')](_0x3dbdd0['query'][_0xf5ab('0x50')]);_0x1d63cb['where']=qs[_0xf5ab('0x49')](_[_0xf5ab('0x52')](_0x3dbdd0[_0xf5ab('0x47')],_0x4dbd15[_0xf5ab('0x49')]));if(_0x3dbdd0[_0xf5ab('0x47')]['filter']){_0x1d63cb[_0xf5ab('0x51')]=_['merge'](_0x1d63cb['where'],{'$or':_['map'](_0x1d63cb[_0xf5ab('0x4c')],function(_0x3b2aaf){var _0xd83bcc={};_0xd83bcc[_0x3b2aaf]={'$like':'%'+_0x3dbdd0[_0xf5ab('0x47')]['filter']+'%'};return _0xd83bcc;})});}_0x1d63cb=_[_0xf5ab('0x54')]({},_0x1d63cb,_0x3dbdd0[_0xf5ab('0x55')]);return _0x916df0['getAgents'](_0x1d63cb);}})[_0xf5ab('0x23')](function(_0x4acaa5){if(_0x4acaa5){_0x52ed3f=_0x4acaa5[_0xf5ab('0x59')];if(!_0x3dbdd0[_0xf5ab('0x47')]['hasOwnProperty']('nolimit')){_0x1d63cb['limit']=qs[_0xf5ab('0x31')](_0x3dbdd0[_0xf5ab('0x47')][_0xf5ab('0x31')]);_0x1d63cb[_0xf5ab('0x30')]=qs[_0xf5ab('0x30')](_0x3dbdd0['query'][_0xf5ab('0x30')]);}return _0x916df0[_0xf5ab('0x11c')](_0x1d63cb);}})[_0xf5ab('0x23')](function(_0x16fda9){if(_0x16fda9){return _0x16fda9?{'count':_0x52ed3f,'rows':_0x16fda9}:null;}})['then'](respondWithResult(_0x2b6592,null))[_0xf5ab('0x2c')](handleError(_0x2b6592,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 1129a4b..2229870 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 _0xd0a4=['hook','exports','events','../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xd0a4,0x158));var _0x4d0a=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xd0a4[_0x3bf83f];return _0x22c4a9;};'use strict';var EventEmitter=require(_0x4d0a('0x0'));var ChatWebsite=require(_0x4d0a('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x4d0a('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4d0a('0x3'),'afterDestroy':_0x4d0a('0x4')};function emitEvent(_0x160660){return function(_0xbedfe2,_0x55274b,_0x43a06e){ChatWebsiteEvents['emit'](_0x160660+':'+_0xbedfe2['id'],_0xbedfe2);ChatWebsiteEvents[_0x4d0a('0x5')](_0x160660,_0xbedfe2);_0x43a06e(null);};}for(var e in events){if(events[_0x4d0a('0x6')](e)){var event=events[e];ChatWebsite[_0x4d0a('0x7')](e,emitEvent(event));}}module[_0x4d0a('0x8')]=ChatWebsiteEvents; \ No newline at end of file +var _0x3c9a=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite'];(function(_0x550651,_0x32926b){var _0x53edcf=function(_0x1ebc42){while(--_0x1ebc42){_0x550651['push'](_0x550651['shift']());}};_0x53edcf(++_0x32926b);}(_0x3c9a,0x13c));var _0xa3c9=function(_0xcfaec8,_0x1b75d0){_0xcfaec8=_0xcfaec8-0x0;var _0x996e63=_0x3c9a[_0xcfaec8];return _0x996e63;};'use strict';var EventEmitter=require(_0xa3c9('0x0'));var ChatWebsite=require(_0xa3c9('0x1'))['db'][_0xa3c9('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xa3c9('0x3')](0x0);var events={'afterCreate':_0xa3c9('0x4'),'afterUpdate':_0xa3c9('0x5'),'afterDestroy':_0xa3c9('0x6')};function emitEvent(_0x385857){return function(_0x54b30c,_0x185dac,_0x249365){ChatWebsiteEvents[_0xa3c9('0x7')](_0x385857+':'+_0x54b30c['id'],_0x54b30c);ChatWebsiteEvents[_0xa3c9('0x7')](_0x385857,_0x54b30c);_0x249365(null);};}for(var e in events){if(events[_0xa3c9('0x8')](e)){var event=events[e];ChatWebsite[_0xa3c9('0x9')](e,emitEvent(event));}}module[_0xa3c9('0xa')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 1aec856..75b21ca 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 _0x6e6c=['moment','path','../../config/environment','exports','define','ChatWebsite','lodash','util','api'];(function(_0x296b7b,_0x59c5a4){var _0x19f81b=function(_0x33c7ed){while(--_0x33c7ed){_0x296b7b['push'](_0x296b7b['shift']());}};_0x19f81b(++_0x59c5a4);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6e6c[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xc6e6('0x0'));var util=require(_0xc6e6('0x1'));var logger=require('../../config/logger')(_0xc6e6('0x2'));var moment=require(_0xc6e6('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc6e6('0x4'));var rimraf=require('rimraf');var config=require(_0xc6e6('0x5'));var attributes=require('./chatWebsite.attributes');module[_0xc6e6('0x6')]=function(_0x1182c7,_0x4bf906){return _0x1182c7[_0xc6e6('0x7')](_0xc6e6('0x8'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9861=['ChatWebsite','chat_websites','lodash','api','moment','bluebird','request-promise','path','rimraf','./chatWebsite.attributes','exports','define'];(function(_0x5d846b,_0x582c41){var _0x4dd9e9=function(_0x44c9cd){while(--_0x44c9cd){_0x5d846b['push'](_0x5d846b['shift']());}};_0x4dd9e9(++_0x582c41);}(_0x9861,0x176));var _0x1986=function(_0x14ddfc,_0x3a94fc){_0x14ddfc=_0x14ddfc-0x0;var _0x4a9443=_0x9861[_0x14ddfc];return _0x4a9443;};'use strict';var _=require(_0x1986('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x1986('0x1'));var moment=require(_0x1986('0x2'));var BPromise=require(_0x1986('0x3'));var rp=require(_0x1986('0x4'));var fs=require('fs');var path=require(_0x1986('0x5'));var rimraf=require(_0x1986('0x6'));var config=require('../../config/environment');var attributes=require(_0x1986('0x7'));module[_0x1986('0x8')]=function(_0x1b56d6,_0x17ccbf){return _0x1b56d6[_0x1986('0x9')](_0x1986('0xa'),attributes,{'tableName':_0x1986('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index 05a818e..843a5b4 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 _0x5496=['request\x20sent','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','then','info','ChatWebsite,\x20%s,\x20%s'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x5496,0x175));var _0x6549=function(_0x25e4a4,_0x3354ef){_0x25e4a4=_0x25e4a4-0x0;var _0x2c409f=_0x5496[_0x25e4a4];return _0x2c409f;};'use strict';var _=require(_0x6549('0x0'));var util=require(_0x6549('0x1'));var moment=require(_0x6549('0x2'));var BPromise=require(_0x6549('0x3'));var rs=require(_0x6549('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6549('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6549('0x6'))(_0x6549('0x7'));var config=require(_0x6549('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6549('0x9')]({'port':0x232a});config[_0x6549('0xa')]=_['defaults'](config[_0x6549('0xa')],{'host':_0x6549('0xb'),'port':0x18eb});var socket=require(_0x6549('0xc'))(new Redis(config['redis']));require(_0x6549('0xd'))[_0x6549('0xe')](socket);function respondWithRpcPromise(_0x2ecce2,_0x135c2c,_0x1e5083){return new BPromise(function(_0x3e08a6,_0x50fa35){return client['request'](_0x2ecce2,_0x1e5083)[_0x6549('0xf')](function(_0xac828c){logger[_0x6549('0x10')](_0x6549('0x11'),_0x135c2c,_0x6549('0x12'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x135c2c,_0x6549('0x12'),JSON[_0x6549('0x13')](_0xac828c));if(_0xac828c['error']){if(_0xac828c[_0x6549('0x14')][_0x6549('0x15')]===0x1f4){logger[_0x6549('0x14')](_0x6549('0x11'),_0x135c2c,_0xac828c[_0x6549('0x14')][_0x6549('0x16')]);return _0x50fa35(_0xac828c['error']['message']);}logger[_0x6549('0x14')](_0x6549('0x11'),_0x135c2c,_0xac828c['error'][_0x6549('0x16')]);return _0x3e08a6(_0xac828c[_0x6549('0x14')][_0x6549('0x16')]);}else{logger[_0x6549('0x10')](_0x6549('0x11'),_0x135c2c,'request\x20sent');_0x3e08a6(_0xac828c['result'][_0x6549('0x16')]);}})['catch'](function(_0x56c15b){logger[_0x6549('0x14')](_0x6549('0x11'),_0x135c2c,_0x56c15b);_0x50fa35(_0x56c15b);});});} \ No newline at end of file +var _0xc1c6=['./chatWebsite.socket','register','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','defaults','redis','localhost','socket.io-emitter'];(function(_0x181c44,_0x43b397){var _0x19fb14=function(_0x9a6f4a){while(--_0x9a6f4a){_0x181c44['push'](_0x181c44['shift']());}};_0x19fb14(++_0x43b397);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x335107,_0x49c2cd){_0x335107=_0x335107-0x0;var _0x764666=_0xc1c6[_0x335107];return _0x764666;};'use strict';var _=require(_0x6c1c('0x0'));var util=require(_0x6c1c('0x1'));var moment=require(_0x6c1c('0x2'));var BPromise=require('bluebird');var rs=require(_0x6c1c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6c1c('0x4'))['db'];var utils=require(_0x6c1c('0x5'));var logger=require(_0x6c1c('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6c1c('0x7'));var client=jayson['client'][_0x6c1c('0x8')]({'port':0x232a});config['redis']=_[_0x6c1c('0x9')](config[_0x6c1c('0xa')],{'host':_0x6c1c('0xb'),'port':0x18eb});var socket=require(_0x6c1c('0xc'))(new Redis(config['redis']));require(_0x6c1c('0xd'))[_0x6c1c('0xe')](socket);function respondWithRpcPromise(_0x524d21,_0x147c7b,_0x36275f){return new BPromise(function(_0xb3bd12,_0x1137e8){return client['request'](_0x524d21,_0x36275f)[_0x6c1c('0xf')](function(_0x2a4fd4){logger[_0x6c1c('0x10')]('ChatWebsite,\x20%s,\x20%s',_0x147c7b,_0x6c1c('0x11'));logger[_0x6c1c('0x12')](_0x6c1c('0x13'),_0x147c7b,'request\x20sent',JSON[_0x6c1c('0x14')](_0x2a4fd4));if(_0x2a4fd4['error']){if(_0x2a4fd4[_0x6c1c('0x15')][_0x6c1c('0x16')]===0x1f4){logger[_0x6c1c('0x15')](_0x6c1c('0x17'),_0x147c7b,_0x2a4fd4[_0x6c1c('0x15')][_0x6c1c('0x18')]);return _0x1137e8(_0x2a4fd4[_0x6c1c('0x15')][_0x6c1c('0x18')]);}logger[_0x6c1c('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x147c7b,_0x2a4fd4[_0x6c1c('0x15')][_0x6c1c('0x18')]);return _0xb3bd12(_0x2a4fd4['error'][_0x6c1c('0x18')]);}else{logger[_0x6c1c('0x10')]('ChatWebsite,\x20%s,\x20%s',_0x147c7b,_0x6c1c('0x11'));_0xb3bd12(_0x2a4fd4['result'][_0x6c1c('0x18')]);}})[_0x6c1c('0x19')](function(_0x5a3bb7){logger[_0x6c1c('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x147c7b,_0x5a3bb7);_0x1137e8(_0x5a3bb7);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index a56fd5b..8d76812 100644 --- a/server/api/chatWebsite/chatWebsite.socket.js +++ b/server/api/chatWebsite/chatWebsite.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['remove','update','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','save'];(function(_0x2fba2b,_0x4977bf){var _0x438896=function(_0x3c73ca){while(--_0x3c73ca){_0x2fba2b['push'](_0x2fba2b['shift']());}};_0x438896(++_0x4977bf);}(_0x5f2f,0x73));var _0xf5f2=function(_0x138ed8,_0x394451){_0x138ed8=_0x138ed8-0x0;var _0xa1b00e=_0x5f2f[_0x138ed8];return _0xa1b00e;};'use strict';var ChatWebsiteEvents=require(_0xf5f2('0x0'));var events=[_0xf5f2('0x1'),_0xf5f2('0x2'),_0xf5f2('0x3')];function createListener(_0x1172dd,_0x174bc7){return function(_0x3c72ee){_0x174bc7[_0xf5f2('0x4')](_0x1172dd,_0x3c72ee);};}function removeListener(_0x501fbd,_0x4854b6){return function(){ChatWebsiteEvents[_0xf5f2('0x5')](_0x501fbd,_0x4854b6);};}exports[_0xf5f2('0x6')]=function(_0xad7f65){for(var _0x3eebf6=0x0,_0x3133bc=events[_0xf5f2('0x7')];_0x3eebf6<_0x3133bc;_0x3eebf6++){var _0x5907aa=events[_0x3eebf6];var _0x466882=createListener(_0xf5f2('0x8')+_0x5907aa,_0xad7f65);ChatWebsiteEvents['on'](_0x5907aa,_0x466882);}}; \ No newline at end of file +var _0x7a54=['remove','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','save'];(function(_0x1b0957,_0x2fa428){var _0x35c05b=function(_0x2898da){while(--_0x2898da){_0x1b0957['push'](_0x1b0957['shift']());}};_0x35c05b(++_0x2fa428);}(_0x7a54,0x106));var _0x47a5=function(_0x488641,_0x5776c3){_0x488641=_0x488641-0x0;var _0x474b85=_0x7a54[_0x488641];return _0x474b85;};'use strict';var ChatWebsiteEvents=require(_0x47a5('0x0'));var events=[_0x47a5('0x1'),_0x47a5('0x2'),'update'];function createListener(_0x1d33e,_0x4086cd){return function(_0x4880bf){_0x4086cd[_0x47a5('0x3')](_0x1d33e,_0x4880bf);};}function removeListener(_0x11bf85,_0x2a1a7e){return function(){ChatWebsiteEvents[_0x47a5('0x4')](_0x11bf85,_0x2a1a7e);};}exports[_0x47a5('0x5')]=function(_0x545a97){for(var _0x3d5629=0x0,_0x59199c=events[_0x47a5('0x6')];_0x3d5629<_0x59199c;_0x3d5629++){var _0x30e405=events[_0x3d5629];var _0x506eda=createListener(_0x47a5('0x7')+_0x30e405,_0x545a97);ChatWebsiteEvents['on'](_0x30e405,_0x506eda);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 3d17910..7a88625 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 _0x3754=['addLogo','diskStorage','/:id/avatar','addAvatar','server/files/images/avatars/','now','/:id/customer_avatar','single','addCustomerAvatar','addSystemAvatar','/:id/notify','/:id/offline','offline','addInteraction','addApplications','addProactiveActions','delete','destroy','removeDispositions','/:id/canned_answers','removeAnswers','removeAgents','exports','util','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/:id','show','/:id/dispositions','getLogo','getAvatar','getCustomerAvatar','/:id/system_avatar','/:id/interactions','/:id/snippet','/:id/applications','getApplications','/:id/proactive_actions','/:id/fields','getFields','getOfflineMessages','/:id/users','getAgents','post','addDisposition','join','root','server/files/images/logos/','format','%s-%s','originalname','file'];(function(_0x22b4ed,_0x12bf21){var _0x54d987=function(_0x2768be){while(--_0x2768be){_0x22b4ed['push'](_0x22b4ed['shift']());}};_0x54d987(++_0x12bf21);}(_0x3754,0xfb));var _0x4375=function(_0x1f752a,_0x5dba98){_0x1f752a=_0x1f752a-0x0;var _0x2f8b01=_0x3754[_0x1f752a];return _0x2f8b01;};'use strict';var multer=require('multer');var util=require(_0x4375('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x4375('0x1'));var interaction=require(_0x4375('0x2'));var config=require(_0x4375('0x3'));var controller=require(_0x4375('0x4'));router[_0x4375('0x5')]('/',auth[_0x4375('0x6')](),controller[_0x4375('0x7')]);router[_0x4375('0x5')]('/describe',auth[_0x4375('0x6')](),controller['describe']);router['get'](_0x4375('0x8'),auth[_0x4375('0x6')](),controller[_0x4375('0x9')]);router[_0x4375('0x5')](_0x4375('0xa'),auth[_0x4375('0x6')](),controller['getDispositions']);router[_0x4375('0x5')]('/:id/canned_answers',auth[_0x4375('0x6')](),controller['getAnswers']);router[_0x4375('0x5')]('/:id/logo',controller[_0x4375('0xb')]);router[_0x4375('0x5')]('/:id/avatar',controller[_0x4375('0xc')]);router['get']('/:id/customer_avatar',controller[_0x4375('0xd')]);router[_0x4375('0x5')](_0x4375('0xe'),controller['getSystemAvatar']);router['get'](_0x4375('0xf'),auth[_0x4375('0x6')](),controller['getInteractions']);router['get'](_0x4375('0x10'),controller['getSnippet']);router[_0x4375('0x5')](_0x4375('0x11'),auth[_0x4375('0x6')](),controller[_0x4375('0x12')]);router[_0x4375('0x5')](_0x4375('0x13'),auth[_0x4375('0x6')](),controller['getProactiveActions']);router[_0x4375('0x5')](_0x4375('0x14'),controller[_0x4375('0x15')]);router[_0x4375('0x5')]('/:id/offline_messages',auth[_0x4375('0x6')](),controller[_0x4375('0x16')]);router[_0x4375('0x5')](_0x4375('0x17'),auth[_0x4375('0x6')](),controller[_0x4375('0x18')]);router[_0x4375('0x19')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4375('0x19')](_0x4375('0xa'),auth[_0x4375('0x6')](),controller[_0x4375('0x1a')]);router[_0x4375('0x19')]('/:id/canned_answers',auth['isAuthenticated'](),controller['addAnswer']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5ca660,_0x19986d,_0x16a22a){_0x16a22a(null,path[_0x4375('0x1b')](config[_0x4375('0x1c')],_0x4375('0x1d')));},'filename':function(_0x1479eb,_0x379799,_0x5b24bb){_0x5b24bb(null,util[_0x4375('0x1e')](_0x4375('0x1f'),Date['now'](),_0x379799[_0x4375('0x20')]));}})});router['post']('/:id/logo',upload['single'](_0x4375('0x21')),controller[_0x4375('0x22')]);var upload=multer({'storage':multer[_0x4375('0x23')]({'destination':function(_0x5c93d9,_0x4b34fd,_0x41e214){_0x41e214(null,path['join'](config[_0x4375('0x1c')],'server/files/images/avatars/'));},'filename':function(_0x208b61,_0x1877e7,_0x1513c9){_0x1513c9(null,util[_0x4375('0x1e')](_0x4375('0x1f'),Date['now'](),_0x1877e7['originalname']));}})});router['post'](_0x4375('0x24'),upload['single']('file'),controller[_0x4375('0x25')]);var upload=multer({'storage':multer[_0x4375('0x23')]({'destination':function(_0x552fb8,_0x36c44e,_0x2c39e9){_0x2c39e9(null,path[_0x4375('0x1b')](config[_0x4375('0x1c')],_0x4375('0x26')));},'filename':function(_0x43ff1f,_0x31e313,_0x100f87){_0x100f87(null,util['format'](_0x4375('0x1f'),Date[_0x4375('0x27')](),_0x31e313['originalname']));}})});router[_0x4375('0x19')](_0x4375('0x28'),upload[_0x4375('0x29')](_0x4375('0x21')),controller[_0x4375('0x2a')]);var upload=multer({'storage':multer[_0x4375('0x23')]({'destination':function(_0x4dff96,_0xbc89f9,_0x45f630){_0x45f630(null,path[_0x4375('0x1b')](config['root'],_0x4375('0x26')));},'filename':function(_0x24b6d2,_0x36eeb8,_0x5a3efd){_0x5a3efd(null,util[_0x4375('0x1e')]('%s-%s',Date[_0x4375('0x27')](),_0x36eeb8[_0x4375('0x20')]));}})});router[_0x4375('0x19')](_0x4375('0xe'),upload[_0x4375('0x29')]('file'),controller[_0x4375('0x2b')]);router[_0x4375('0x19')](_0x4375('0x2c'),controller['notify']);router[_0x4375('0x19')](_0x4375('0x2d'),controller[_0x4375('0x2e')]);router[_0x4375('0x19')](_0x4375('0xf'),auth[_0x4375('0x6')](),controller[_0x4375('0x2f')]);router[_0x4375('0x19')](_0x4375('0x11'),auth[_0x4375('0x6')](),controller[_0x4375('0x30')]);router[_0x4375('0x19')](_0x4375('0x13'),auth[_0x4375('0x6')](),controller[_0x4375('0x31')]);router[_0x4375('0x19')](_0x4375('0x17'),auth[_0x4375('0x6')](),controller['addAgents']);router['put'](_0x4375('0x8'),auth['isAuthenticated'](),controller['update']);router[_0x4375('0x32')](_0x4375('0x8'),auth['isAuthenticated'](),controller[_0x4375('0x33')]);router['delete'](_0x4375('0xa'),auth[_0x4375('0x6')](),controller[_0x4375('0x34')]);router[_0x4375('0x32')](_0x4375('0x35'),auth[_0x4375('0x6')](),controller[_0x4375('0x36')]);router[_0x4375('0x32')](_0x4375('0x17'),auth[_0x4375('0x6')](),controller[_0x4375('0x37')]);module[_0x4375('0x38')]=router; \ No newline at end of file +var _0x952d=['file','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','/:id/offline','offline','/:id/interactions','addInteraction','addProactiveActions','addAgents','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/logo','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','getInteractions','/:id/snippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','getOfflineMessages','/:id/users','getAgents','post','addDisposition','root','server/files/images/logos/','format','%s-%s','now','originalname','single','diskStorage','join','server/files/images/avatars/','addAvatar'];(function(_0x34325b,_0x5e5afe){var _0x3da348=function(_0x3bf709){while(--_0x3bf709){_0x34325b['push'](_0x34325b['shift']());}};_0x3da348(++_0x5e5afe);}(_0x952d,0x199));var _0xd952=function(_0x103e8d,_0x1fda2f){_0x103e8d=_0x103e8d-0x0;var _0x4580ec=_0x952d[_0x103e8d];return _0x4580ec;};'use strict';var multer=require(_0xd952('0x0'));var util=require(_0xd952('0x1'));var path=require(_0xd952('0x2'));var timeout=require(_0xd952('0x3'));var express=require('express');var router=express[_0xd952('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd952('0x5'));var controller=require(_0xd952('0x6'));router[_0xd952('0x7')]('/',auth[_0xd952('0x8')](),controller[_0xd952('0x9')]);router[_0xd952('0x7')](_0xd952('0xa'),auth[_0xd952('0x8')](),controller[_0xd952('0xb')]);router[_0xd952('0x7')]('/:id',auth[_0xd952('0x8')](),controller[_0xd952('0xc')]);router[_0xd952('0x7')](_0xd952('0xd'),auth[_0xd952('0x8')](),controller['getDispositions']);router[_0xd952('0x7')](_0xd952('0xe'),auth[_0xd952('0x8')](),controller[_0xd952('0xf')]);router[_0xd952('0x7')](_0xd952('0x10'),controller['getLogo']);router[_0xd952('0x7')](_0xd952('0x11'),controller['getAvatar']);router['get'](_0xd952('0x12'),controller[_0xd952('0x13')]);router[_0xd952('0x7')](_0xd952('0x14'),controller[_0xd952('0x15')]);router['get']('/:id/interactions',auth[_0xd952('0x8')](),controller[_0xd952('0x16')]);router[_0xd952('0x7')](_0xd952('0x17'),controller['getSnippet']);router[_0xd952('0x7')](_0xd952('0x18'),auth[_0xd952('0x8')](),controller[_0xd952('0x19')]);router[_0xd952('0x7')](_0xd952('0x1a'),auth[_0xd952('0x8')](),controller[_0xd952('0x1b')]);router['get'](_0xd952('0x1c'),controller[_0xd952('0x1d')]);router[_0xd952('0x7')]('/:id/offline_messages',auth[_0xd952('0x8')](),controller[_0xd952('0x1e')]);router[_0xd952('0x7')](_0xd952('0x1f'),auth[_0xd952('0x8')](),controller[_0xd952('0x20')]);router[_0xd952('0x21')]('/',auth[_0xd952('0x8')](),controller['create']);router[_0xd952('0x21')]('/:id/dispositions',auth[_0xd952('0x8')](),controller[_0xd952('0x22')]);router[_0xd952('0x21')](_0xd952('0xe'),auth[_0xd952('0x8')](),controller['addAnswer']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x24294f,_0x2ebe54,_0x6972e6){_0x6972e6(null,path['join'](config[_0xd952('0x23')],_0xd952('0x24')));},'filename':function(_0xb8cf62,_0x5873a2,_0x2f86ac){_0x2f86ac(null,util[_0xd952('0x25')](_0xd952('0x26'),Date[_0xd952('0x27')](),_0x5873a2[_0xd952('0x28')]));}})});router[_0xd952('0x21')]('/:id/logo',upload[_0xd952('0x29')]('file'),controller['addLogo']);var upload=multer({'storage':multer[_0xd952('0x2a')]({'destination':function(_0x2d1e5f,_0x4e64b1,_0x59fe71){_0x59fe71(null,path[_0xd952('0x2b')](config[_0xd952('0x23')],_0xd952('0x2c')));},'filename':function(_0x327069,_0x22ae05,_0x21da96){_0x21da96(null,util[_0xd952('0x25')](_0xd952('0x26'),Date['now'](),_0x22ae05['originalname']));}})});router['post'](_0xd952('0x11'),upload['single']('file'),controller[_0xd952('0x2d')]);var upload=multer({'storage':multer[_0xd952('0x2a')]({'destination':function(_0x5e0f89,_0x4b96ac,_0x400dfc){_0x400dfc(null,path['join'](config[_0xd952('0x23')],_0xd952('0x2c')));},'filename':function(_0x35da3f,_0x3af257,_0x217206){_0x217206(null,util[_0xd952('0x25')]('%s-%s',Date[_0xd952('0x27')](),_0x3af257['originalname']));}})});router[_0xd952('0x21')]('/:id/customer_avatar',upload[_0xd952('0x29')](_0xd952('0x2e')),controller[_0xd952('0x2f')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4c9db0,_0x385376,_0x14c27e){_0x14c27e(null,path[_0xd952('0x2b')](config[_0xd952('0x23')],'server/files/images/avatars/'));},'filename':function(_0x4c6d20,_0x4326f9,_0x292ccf){_0x292ccf(null,util[_0xd952('0x25')](_0xd952('0x26'),Date['now'](),_0x4326f9[_0xd952('0x28')]));}})});router[_0xd952('0x21')](_0xd952('0x14'),upload['single'](_0xd952('0x2e')),controller[_0xd952('0x30')]);router[_0xd952('0x21')](_0xd952('0x31'),controller[_0xd952('0x32')]);router[_0xd952('0x21')](_0xd952('0x33'),controller[_0xd952('0x34')]);router[_0xd952('0x21')](_0xd952('0x35'),auth[_0xd952('0x8')](),controller[_0xd952('0x36')]);router[_0xd952('0x21')]('/:id/applications',auth[_0xd952('0x8')](),controller['addApplications']);router['post'](_0xd952('0x1a'),auth[_0xd952('0x8')](),controller[_0xd952('0x37')]);router[_0xd952('0x21')](_0xd952('0x1f'),auth['isAuthenticated'](),controller[_0xd952('0x38')]);router['put'](_0xd952('0x39'),auth[_0xd952('0x8')](),controller[_0xd952('0x3a')]);router[_0xd952('0x3b')]('/:id',auth[_0xd952('0x8')](),controller[_0xd952('0x3c')]);router['delete'](_0xd952('0xd'),auth[_0xd952('0x8')](),controller[_0xd952('0x3d')]);router[_0xd952('0x3b')](_0xd952('0xe'),auth['isAuthenticated'](),controller[_0xd952('0x3e')]);router[_0xd952('0x3b')](_0xd952('0x1f'),auth['isAuthenticated'](),controller[_0xd952('0x3f')]);module[_0xd952('0x40')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 03bb8ca..3ba03bf 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 _0x1a4b=['exports','STRING','name','sequelize'];(function(_0x16ce2b,_0x2f48e1){var _0x5cf403=function(_0x478e9b){while(--_0x478e9b){_0x16ce2b['push'](_0x16ce2b['shift']());}};_0x5cf403(++_0x2f48e1);}(_0x1a4b,0x9f));var _0xb1a4=function(_0x219c12,_0x3a391b){_0x219c12=_0x219c12-0x0;var _0x2d6031=_0x1a4b[_0x219c12];return _0x2d6031;};'use strict';var Sequelize=require(_0xb1a4('0x0'));module[_0xb1a4('0x1')]={'name':{'type':Sequelize[_0xb1a4('0x2')],'unique':_0xb1a4('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xb1a4('0x2')]},'companyId':{'type':Sequelize[_0xb1a4('0x2')]},'website':{'type':Sequelize[_0xb1a4('0x2')]},'phone':{'type':Sequelize[_0xb1a4('0x2')]},'fax':{'type':Sequelize[_0xb1a4('0x2')]},'type':{'type':Sequelize[_0xb1a4('0x2')]},'street':{'type':Sequelize[_0xb1a4('0x2')]},'postalCode':{'type':Sequelize[_0xb1a4('0x2')]},'city':{'type':Sequelize[_0xb1a4('0x2')]},'country':{'type':Sequelize[_0xb1a4('0x2')]},'email':{'type':Sequelize[_0xb1a4('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xb1a4('0x2')]},'sStreet':{'type':Sequelize[_0xb1a4('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0xb1a4('0x2')]},'sCountry':{'type':Sequelize[_0xb1a4('0x2')]},'description':{'type':Sequelize[_0xb1a4('0x2')]}}; \ No newline at end of file +var _0x0d23=['exports','name','STRING','sequelize'];(function(_0x526d0c,_0x589427){var _0x42fa82=function(_0x186dd3){while(--_0x186dd3){_0x526d0c['push'](_0x526d0c['shift']());}};_0x42fa82(++_0x589427);}(_0x0d23,0xbb));var _0x30d2=function(_0xe34312,_0x3cfe6a){_0xe34312=_0xe34312-0x0;var _0x2e15ae=_0x0d23[_0xe34312];return _0x2e15ae;};'use strict';var Sequelize=require(_0x30d2('0x0'));module[_0x30d2('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x30d2('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x30d2('0x3')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x30d2('0x3')]},'postalCode':{'type':Sequelize[_0x30d2('0x3')]},'city':{'type':Sequelize[_0x30d2('0x3')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x30d2('0x3')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x30d2('0x3')]},'sCity':{'type':Sequelize[_0x30d2('0x3')]},'sCountry':{'type':Sequelize[_0x30d2('0x3')]},'description':{'type':Sequelize[_0x30d2('0x3')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 0f695be..270abbc 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 _0x61ee=['Companies','UserProfileResource','error','stack','name','send','index','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','merge','map','filter','includeAll','findAll','rows','catch','rawAttributes','include','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addContacts','omit','getContacts','findOne','pick','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','to-csv','ejs','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','apply','update','destroy','then'];(function(_0x1c9cab,_0x5e3c39){var _0xe5e91d=function(_0x409645){while(--_0x409645){_0x1c9cab['push'](_0x1c9cab['shift']());}};_0xe5e91d(++_0x5e3c39);}(_0x61ee,0x1ba));var _0xe61e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x61ee[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require(_0xe61e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xe61e('0x1'));var zipdir=require(_0xe61e('0x2'));var jsonpatch=require(_0xe61e('0x3'));var rp=require(_0xe61e('0x4'));var moment=require(_0xe61e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xe61e('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xe61e('0x7'));var ejs=require(_0xe61e('0x8'));var fs=require('fs');var _=require(_0xe61e('0x9'));var squel=require('squel');var crypto=require(_0xe61e('0xa'));var jsforce=require(_0xe61e('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xe61e('0x7'));var querystring=require(_0xe61e('0xc'));var Papa=require('papaparse');var Redis=require(_0xe61e('0xd'));var authService=require(_0xe61e('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xe61e('0xf'));var hardwareService=require(_0xe61e('0x10'));var logger=require(_0xe61e('0x11'))('api');var utils=require(_0xe61e('0x12'));var config=require(_0xe61e('0x13'));var db=require(_0xe61e('0x14'))['db'];function respondWithStatusCode(_0x477352,_0x2a74de){_0x2a74de=_0x2a74de||0xcc;return function(_0x72e0fb){if(_0x72e0fb){return _0x477352[_0xe61e('0x15')](_0x2a74de);}return _0x477352[_0xe61e('0x16')](_0x2a74de)[_0xe61e('0x17')]();};}function respondWithResult(_0x4a18ca,_0x111523){_0x111523=_0x111523||0xc8;return function(_0xa711cd){if(_0xa711cd){return _0x4a18ca['status'](_0x111523)[_0xe61e('0x18')](_0xa711cd);}};}function respondWithFilteredResult(_0x2c1a5d,_0x13a8f5){return function(_0x45b8d4){if(_0x45b8d4){var _0x182bfd=_0x45b8d4[_0xe61e('0x19')],_0x218ce4=_0x13a8f5[_0xe61e('0x1a')],_0x17accc=_0x13a8f5['offset']+_0x13a8f5[_0xe61e('0x1b')],_0x446664;if(_0x17accc>=_0x182bfd){_0x17accc=_0x182bfd;_0x446664=0xc8;}else{_0x446664=0xce;}_0x2c1a5d[_0xe61e('0x16')](_0x446664);return _0x2c1a5d['set']('Content-Range',_0x218ce4+'-'+_0x17accc+'/'+_0x182bfd)[_0xe61e('0x18')](_0x45b8d4);}return null;};}function patchUpdates(_0x4b12de){return function(_0x5332ea){try{jsonpatch[_0xe61e('0x1c')](_0x5332ea,_0x4b12de,!![]);}catch(_0x396132){return BPromise['reject'](_0x396132);}return _0x5332ea['save']();};}function saveUpdates(_0xac44ff,_0x4d3d56){return function(_0x43db10){if(_0x43db10){return _0x43db10[_0xe61e('0x1d')](_0xac44ff)['then'](function(_0x433cf7){return _0x433cf7;});}return null;};}function removeEntity(_0x39b264,_0x29bda2){return function(_0x19aee0){if(_0x19aee0){return _0x19aee0[_0xe61e('0x1e')]()[_0xe61e('0x1f')](function(){var _0x15f4f8=_0x19aee0['get']({'plain':!![]});var _0x17b9ee=_0xe61e('0x20');return db[_0xe61e('0x21')][_0xe61e('0x1e')]({'where':{'type':_0x17b9ee,'resourceId':_0x15f4f8['id']}})['then'](function(){return _0x19aee0;});})[_0xe61e('0x1f')](function(){_0x39b264['status'](0xcc)[_0xe61e('0x17')]();});}};}function handleEntityNotFound(_0x12b256,_0x361bf6){return function(_0x4bbeb2){if(!_0x4bbeb2){_0x12b256[_0xe61e('0x15')](0x194);}return _0x4bbeb2;};}function handleError(_0x222601,_0x2c0c1a){_0x2c0c1a=_0x2c0c1a||0x1f4;return function(_0x204bbc){logger[_0xe61e('0x22')](_0x204bbc[_0xe61e('0x23')]);if(_0x204bbc[_0xe61e('0x24')]){delete _0x204bbc['name'];}_0x222601[_0xe61e('0x16')](_0x2c0c1a)[_0xe61e('0x25')](_0x204bbc);};}exports[_0xe61e('0x26')]=function(_0x54b1c0,_0x971f64){var _0xa14537={},_0x2c8bd1={},_0x286fc1={'count':0x0,'rows':[]};return db[_0xe61e('0x27')][_0xe61e('0x28')]()[_0xe61e('0x1f')](function(_0x429901){_0x2c8bd1[_0xe61e('0x29')]=_[_0xe61e('0x2a')](_0x429901);_0x2c8bd1[_0xe61e('0x2b')]=_['keys'](_0x54b1c0[_0xe61e('0x2b')]);_0x2c8bd1[_0xe61e('0x2c')]=_[_0xe61e('0x2d')](_0x2c8bd1['model'],_0x2c8bd1['query']);_0xa14537[_0xe61e('0x2e')]=_[_0xe61e('0x2d')](_0x2c8bd1[_0xe61e('0x29')],qs['fields'](_0x54b1c0[_0xe61e('0x2b')][_0xe61e('0x2f')]));_0xa14537['attributes']=_0xa14537[_0xe61e('0x2e')][_0xe61e('0x30')]?_0xa14537[_0xe61e('0x2e')]:_0x2c8bd1[_0xe61e('0x29')];if(!_0x54b1c0[_0xe61e('0x2b')]['hasOwnProperty'](_0xe61e('0x31'))){_0xa14537[_0xe61e('0x1b')]=qs[_0xe61e('0x1b')](_0x54b1c0['query'][_0xe61e('0x1b')]);_0xa14537[_0xe61e('0x1a')]=qs['offset'](_0x54b1c0[_0xe61e('0x2b')][_0xe61e('0x1a')]);}_0xa14537[_0xe61e('0x32')]=qs[_0xe61e('0x33')](_0x54b1c0[_0xe61e('0x2b')]['sort']);_0xa14537['where']=qs['filters'](_['pick'](_0x54b1c0[_0xe61e('0x2b')],_0x2c8bd1['filters']));if(_0x54b1c0[_0xe61e('0x2b')]['filter']){_0xa14537[_0xe61e('0x34')]=_[_0xe61e('0x35')](_0xa14537[_0xe61e('0x34')],{'$or':_[_0xe61e('0x36')](_0xa14537[_0xe61e('0x2e')],function(_0x2e119d){var _0x10fd00={};_0x10fd00[_0x2e119d]={'$like':'%'+_0x54b1c0[_0xe61e('0x2b')][_0xe61e('0x37')]+'%'};return _0x10fd00;})});}_0xa14537=_[_0xe61e('0x35')]({},_0xa14537,_0x54b1c0['options']);var _0x57bfe2={'where':_0xa14537[_0xe61e('0x34')]};return db['CmCompany'][_0xe61e('0x19')](_0x57bfe2)['then'](function(_0x3d62a3){_0x286fc1['count']=_0x3d62a3;if(_0x54b1c0['query'][_0xe61e('0x38')]){_0xa14537['include']=[{'all':!![]}];}return db[_0xe61e('0x27')][_0xe61e('0x39')](_0xa14537);})[_0xe61e('0x1f')](function(_0x181173){_0x286fc1[_0xe61e('0x3a')]=_0x181173;return _0x286fc1;})['then'](respondWithFilteredResult(_0x971f64,_0xa14537))[_0xe61e('0x3b')](handleError(_0x971f64,null));});};exports['show']=function(_0x133598,_0x107d56){var _0x1eb0cf={'raw':![],'where':{'id':_0x133598['params']['id']}},_0xdee77c={};_0xdee77c[_0xe61e('0x29')]=_[_0xe61e('0x2a')](db['CmCompany'][_0xe61e('0x3c')]);_0xdee77c[_0xe61e('0x2b')]=_[_0xe61e('0x2a')](_0x133598['query']);_0xdee77c[_0xe61e('0x2c')]=_[_0xe61e('0x2d')](_0xdee77c[_0xe61e('0x29')],_0xdee77c['query']);_0x1eb0cf[_0xe61e('0x2e')]=_[_0xe61e('0x2d')](_0xdee77c[_0xe61e('0x29')],qs[_0xe61e('0x2f')](_0x133598['query'][_0xe61e('0x2f')]));_0x1eb0cf[_0xe61e('0x2e')]=_0x1eb0cf[_0xe61e('0x2e')][_0xe61e('0x30')]?_0x1eb0cf[_0xe61e('0x2e')]:_0xdee77c['model'];if(_0x133598[_0xe61e('0x2b')][_0xe61e('0x38')]){_0x1eb0cf[_0xe61e('0x3d')]=[{'all':!![]}];}_0x1eb0cf=_[_0xe61e('0x35')]({},_0x1eb0cf,_0x133598[_0xe61e('0x3e')]);return db[_0xe61e('0x27')][_0xe61e('0x3f')](_0x1eb0cf)[_0xe61e('0x1f')](handleEntityNotFound(_0x107d56,null))['then'](respondWithResult(_0x107d56,null))['catch'](handleError(_0x107d56,null));};exports[_0xe61e('0x40')]=function(_0x3c4ba9,_0x422c77){return db['CmCompany']['create'](_0x3c4ba9[_0xe61e('0x41')],{})['then'](function(_0x4055a5){var _0x3e4a4b=_0x3c4ba9[_0xe61e('0x42')][_0xe61e('0x43')]({'plain':!![]});if(!_0x3e4a4b)throw new Error(_0xe61e('0x44'));if(_0x3e4a4b[_0xe61e('0x45')]===_0xe61e('0x42')){var _0x3ba394=_0x4055a5[_0xe61e('0x43')]({'plain':!![]});var _0x11073d=_0xe61e('0x20');return db[_0xe61e('0x46')]['find']({'where':{'name':_0x11073d,'userProfileId':_0x3e4a4b['userProfileId']},'raw':!![]})[_0xe61e('0x1f')](function(_0x3b8266){if(_0x3b8266&&_0x3b8266[_0xe61e('0x47')]===0x0){return db['UserProfileResource'][_0xe61e('0x40')]({'name':_0x3ba394[_0xe61e('0x24')],'resourceId':_0x3ba394['id'],'type':_0x3b8266[_0xe61e('0x24')],'sectionId':_0x3b8266['id']},{})[_0xe61e('0x1f')](function(){return _0x4055a5;});}else{return _0x4055a5;}})[_0xe61e('0x3b')](function(_0x159671){logger[_0xe61e('0x22')](_0xe61e('0x48'),_0x159671);throw _0x159671;});}return _0x4055a5;})['then'](respondWithResult(_0x422c77,0xc9))['catch'](handleError(_0x422c77,null));};exports[_0xe61e('0x1d')]=function(_0x58985a,_0x339a2a){if(_0x58985a[_0xe61e('0x41')]['id']){delete _0x58985a['body']['id'];}return db[_0xe61e('0x27')]['find']({'where':{'id':_0x58985a['params']['id']}})[_0xe61e('0x1f')](handleEntityNotFound(_0x339a2a,null))[_0xe61e('0x1f')](saveUpdates(_0x58985a[_0xe61e('0x41')],null))[_0xe61e('0x1f')](respondWithResult(_0x339a2a,null))[_0xe61e('0x3b')](handleError(_0x339a2a,null));};exports[_0xe61e('0x1e')]=function(_0x39077e,_0x277639){return db[_0xe61e('0x27')][_0xe61e('0x3f')]({'where':{'id':_0x39077e[_0xe61e('0x49')]['id']}})['then'](handleEntityNotFound(_0x277639,null))[_0xe61e('0x1f')](removeEntity(_0x277639,null))[_0xe61e('0x3b')](handleError(_0x277639,null));};exports[_0xe61e('0x28')]=function(_0x3a5eac,_0x1a2b23){return db[_0xe61e('0x27')][_0xe61e('0x28')]()['then'](respondWithResult(_0x1a2b23,null))[_0xe61e('0x3b')](handleError(_0x1a2b23,null));};exports['addContacts']=function(_0x508372,_0x4daa67,_0xe8b2bc){return db['CmContact'][_0xe61e('0x3f')]({'where':{'id':_0x508372[_0xe61e('0x49')]['id']}})[_0xe61e('0x1f')](handleEntityNotFound(_0x4daa67,null))[_0xe61e('0x1f')](function(_0x557612){if(_0x557612){return _0x557612[_0xe61e('0x4a')](_0x508372[_0xe61e('0x41')]['ids'],_[_0xe61e('0x4b')](_0x508372['body'],['ids','id'])||{});}})[_0xe61e('0x1f')](respondWithResult(_0x4daa67,null))[_0xe61e('0x3b')](handleError(_0x4daa67,null));};exports[_0xe61e('0x4c')]=function(_0x1094eb,_0x195e75,_0x3e2a31){var _0x5c9404={};var _0x7c767c={};var _0x2c950d;var _0x312dc2;return db[_0xe61e('0x27')][_0xe61e('0x4d')]({'where':{'id':_0x1094eb[_0xe61e('0x49')]['id']}})['then'](handleEntityNotFound(_0x195e75,null))[_0xe61e('0x1f')](function(_0x441a30){if(_0x441a30){_0x2c950d=_0x441a30;_0x7c767c['model']=_[_0xe61e('0x2a')](db['CmContact'][_0xe61e('0x3c')]);_0x7c767c['query']=_[_0xe61e('0x2a')](_0x1094eb[_0xe61e('0x2b')]);_0x7c767c['filters']=_[_0xe61e('0x2d')](_0x7c767c[_0xe61e('0x29')],_0x7c767c[_0xe61e('0x2b')]);_0x5c9404[_0xe61e('0x2e')]=_[_0xe61e('0x2d')](_0x7c767c['model'],qs[_0xe61e('0x2f')](_0x1094eb[_0xe61e('0x2b')]['fields']));_0x5c9404['attributes']=_0x5c9404[_0xe61e('0x2e')][_0xe61e('0x30')]?_0x5c9404[_0xe61e('0x2e')]:_0x7c767c[_0xe61e('0x29')];_0x5c9404[_0xe61e('0x32')]=qs[_0xe61e('0x33')](_0x1094eb['query'][_0xe61e('0x33')]);_0x5c9404[_0xe61e('0x34')]=qs[_0xe61e('0x2c')](_[_0xe61e('0x4e')](_0x1094eb['query'],_0x7c767c[_0xe61e('0x2c')]));if(_0x1094eb['query'][_0xe61e('0x37')]){_0x5c9404['where']=_[_0xe61e('0x35')](_0x5c9404[_0xe61e('0x34')],{'$or':_[_0xe61e('0x36')](_0x5c9404[_0xe61e('0x2e')],function(_0x535cf5){var _0x3543b9={};_0x3543b9[_0x535cf5]={'$like':'%'+_0x1094eb['query'][_0xe61e('0x37')]+'%'};return _0x3543b9;})});}_0x5c9404=_[_0xe61e('0x35')]({},_0x5c9404,_0x1094eb[_0xe61e('0x3e')]);return _0x2c950d['getContacts'](_0x5c9404);}})[_0xe61e('0x1f')](function(_0x6de4d1){if(_0x6de4d1){_0x312dc2=_0x6de4d1['length'];if(!_0x1094eb[_0xe61e('0x2b')]['hasOwnProperty'](_0xe61e('0x31'))){_0x5c9404[_0xe61e('0x1b')]=qs[_0xe61e('0x1b')](_0x1094eb['query'][_0xe61e('0x1b')]);_0x5c9404[_0xe61e('0x1a')]=qs[_0xe61e('0x1a')](_0x1094eb['query'][_0xe61e('0x1a')]);}return _0x2c950d[_0xe61e('0x4c')](_0x5c9404);}})['then'](function(_0x2675db){if(_0x2675db){return _0x2675db?{'count':_0x312dc2,'rows':_0x2675db}:null;}})[_0xe61e('0x1f')](respondWithResult(_0x195e75,null))[_0xe61e('0x3b')](handleError(_0x195e75,null));}; \ No newline at end of file +var _0xb945=['order','nolimit','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','to-csv','ejs','lodash','squel','jsforce','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','status','Content-Range','reject','save','update','destroy','get','Companies','UserProfileResource','then','error','stack','name','send','index','CmCompany','describe','keys','query','intersection','model','fields','attributes','length','hasOwnProperty','limit','sort','where','pick','merge','map','filter','options','includeAll','include','catch','show','params','rawAttributes','filters','create','body','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids','getContacts'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb945,0x1e2));var _0x5b94=function(_0x2074db,_0x10b81b){_0x2074db=_0x2074db-0x0;var _0x27324c=_0xb945[_0x2074db];return _0x27324c;};'use strict';var pdf=require(_0x5b94('0x0'));var emlformat=require(_0x5b94('0x1'));var rimraf=require(_0x5b94('0x2'));var zipdir=require(_0x5b94('0x3'));var jsonpatch=require(_0x5b94('0x4'));var rp=require('request-promise');var moment=require(_0x5b94('0x5'));var BPromise=require(_0x5b94('0x6'));var Mustache=require(_0x5b94('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x5b94('0x8'));var ejs=require(_0x5b94('0x9'));var fs=require('fs');var _=require(_0x5b94('0xa'));var squel=require(_0x5b94('0xb'));var crypto=require('crypto');var jsforce=require(_0x5b94('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x5b94('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5b94('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x5b94('0xe'));var hardwareService=require(_0x5b94('0xf'));var logger=require(_0x5b94('0x10'))(_0x5b94('0x11'));var utils=require(_0x5b94('0x12'));var config=require(_0x5b94('0x13'));var db=require(_0x5b94('0x14'))['db'];function respondWithStatusCode(_0x2ecefc,_0x418f85){_0x418f85=_0x418f85||0xcc;return function(_0x1227f8){if(_0x1227f8){return _0x2ecefc[_0x5b94('0x15')](_0x418f85);}return _0x2ecefc['status'](_0x418f85)[_0x5b94('0x16')]();};}function respondWithResult(_0xa80cc5,_0x40f647){_0x40f647=_0x40f647||0xc8;return function(_0x18d6af){if(_0x18d6af){return _0xa80cc5['status'](_0x40f647)[_0x5b94('0x17')](_0x18d6af);}};}function respondWithFilteredResult(_0x50f2d7,_0x454101){return function(_0x54d34c){if(_0x54d34c){var _0x58d135=_0x54d34c[_0x5b94('0x18')],_0x6c9dca=_0x454101[_0x5b94('0x19')],_0x384438=_0x454101[_0x5b94('0x19')]+_0x454101['limit'],_0x39b2b4;if(_0x384438>=_0x58d135){_0x384438=_0x58d135;_0x39b2b4=0xc8;}else{_0x39b2b4=0xce;}_0x50f2d7[_0x5b94('0x1a')](_0x39b2b4);return _0x50f2d7['set'](_0x5b94('0x1b'),_0x6c9dca+'-'+_0x384438+'/'+_0x58d135)[_0x5b94('0x17')](_0x54d34c);}return null;};}function patchUpdates(_0x17c262){return function(_0x2bd284){try{jsonpatch['apply'](_0x2bd284,_0x17c262,!![]);}catch(_0xde1cff){return BPromise[_0x5b94('0x1c')](_0xde1cff);}return _0x2bd284[_0x5b94('0x1d')]();};}function saveUpdates(_0x5847b1,_0x36c203){return function(_0x13163f){if(_0x13163f){return _0x13163f[_0x5b94('0x1e')](_0x5847b1)['then'](function(_0x22956b){return _0x22956b;});}return null;};}function removeEntity(_0x552fc,_0x3b0334){return function(_0x428570){if(_0x428570){return _0x428570[_0x5b94('0x1f')]()['then'](function(){var _0x504d70=_0x428570[_0x5b94('0x20')]({'plain':!![]});var _0x5156ee=_0x5b94('0x21');return db[_0x5b94('0x22')][_0x5b94('0x1f')]({'where':{'type':_0x5156ee,'resourceId':_0x504d70['id']}})[_0x5b94('0x23')](function(){return _0x428570;});})['then'](function(){_0x552fc[_0x5b94('0x1a')](0xcc)[_0x5b94('0x16')]();});}};}function handleEntityNotFound(_0x219387,_0x4d0179){return function(_0x887057){if(!_0x887057){_0x219387['sendStatus'](0x194);}return _0x887057;};}function handleError(_0x33ef86,_0x3cbdda){_0x3cbdda=_0x3cbdda||0x1f4;return function(_0x19e28b){logger[_0x5b94('0x24')](_0x19e28b[_0x5b94('0x25')]);if(_0x19e28b[_0x5b94('0x26')]){delete _0x19e28b[_0x5b94('0x26')];}_0x33ef86['status'](_0x3cbdda)[_0x5b94('0x27')](_0x19e28b);};}exports[_0x5b94('0x28')]=function(_0x1f0cc7,_0x26c8cf){var _0x5ae5f6={},_0x113511={},_0x20305f={'count':0x0,'rows':[]};return db[_0x5b94('0x29')][_0x5b94('0x2a')]()[_0x5b94('0x23')](function(_0x6fae4e){_0x113511['model']=_[_0x5b94('0x2b')](_0x6fae4e);_0x113511['query']=_['keys'](_0x1f0cc7[_0x5b94('0x2c')]);_0x113511['filters']=_[_0x5b94('0x2d')](_0x113511[_0x5b94('0x2e')],_0x113511[_0x5b94('0x2c')]);_0x5ae5f6['attributes']=_[_0x5b94('0x2d')](_0x113511[_0x5b94('0x2e')],qs[_0x5b94('0x2f')](_0x1f0cc7[_0x5b94('0x2c')][_0x5b94('0x2f')]));_0x5ae5f6[_0x5b94('0x30')]=_0x5ae5f6[_0x5b94('0x30')][_0x5b94('0x31')]?_0x5ae5f6['attributes']:_0x113511['model'];if(!_0x1f0cc7[_0x5b94('0x2c')][_0x5b94('0x32')]('nolimit')){_0x5ae5f6[_0x5b94('0x33')]=qs['limit'](_0x1f0cc7[_0x5b94('0x2c')][_0x5b94('0x33')]);_0x5ae5f6[_0x5b94('0x19')]=qs['offset'](_0x1f0cc7[_0x5b94('0x2c')][_0x5b94('0x19')]);}_0x5ae5f6['order']=qs[_0x5b94('0x34')](_0x1f0cc7[_0x5b94('0x2c')][_0x5b94('0x34')]);_0x5ae5f6[_0x5b94('0x35')]=qs['filters'](_[_0x5b94('0x36')](_0x1f0cc7[_0x5b94('0x2c')],_0x113511['filters']));if(_0x1f0cc7[_0x5b94('0x2c')]['filter']){_0x5ae5f6['where']=_[_0x5b94('0x37')](_0x5ae5f6[_0x5b94('0x35')],{'$or':_[_0x5b94('0x38')](_0x5ae5f6[_0x5b94('0x30')],function(_0x471121){var _0x4291e1={};_0x4291e1[_0x471121]={'$like':'%'+_0x1f0cc7[_0x5b94('0x2c')][_0x5b94('0x39')]+'%'};return _0x4291e1;})});}_0x5ae5f6=_[_0x5b94('0x37')]({},_0x5ae5f6,_0x1f0cc7[_0x5b94('0x3a')]);var _0x52ae83={'where':_0x5ae5f6[_0x5b94('0x35')]};return db[_0x5b94('0x29')][_0x5b94('0x18')](_0x52ae83)['then'](function(_0x2249ed){_0x20305f[_0x5b94('0x18')]=_0x2249ed;if(_0x1f0cc7[_0x5b94('0x2c')][_0x5b94('0x3b')]){_0x5ae5f6[_0x5b94('0x3c')]=[{'all':!![]}];}return db[_0x5b94('0x29')]['findAll'](_0x5ae5f6);})[_0x5b94('0x23')](function(_0x152fdb){_0x20305f['rows']=_0x152fdb;return _0x20305f;})[_0x5b94('0x23')](respondWithFilteredResult(_0x26c8cf,_0x5ae5f6))[_0x5b94('0x3d')](handleError(_0x26c8cf,null));});};exports[_0x5b94('0x3e')]=function(_0x48b5d6,_0x5d09b7){var _0xf854f9={'raw':![],'where':{'id':_0x48b5d6[_0x5b94('0x3f')]['id']}},_0x18112a={};_0x18112a['model']=_[_0x5b94('0x2b')](db['CmCompany'][_0x5b94('0x40')]);_0x18112a[_0x5b94('0x2c')]=_[_0x5b94('0x2b')](_0x48b5d6['query']);_0x18112a[_0x5b94('0x41')]=_[_0x5b94('0x2d')](_0x18112a['model'],_0x18112a[_0x5b94('0x2c')]);_0xf854f9[_0x5b94('0x30')]=_['intersection'](_0x18112a[_0x5b94('0x2e')],qs[_0x5b94('0x2f')](_0x48b5d6[_0x5b94('0x2c')][_0x5b94('0x2f')]));_0xf854f9['attributes']=_0xf854f9['attributes'][_0x5b94('0x31')]?_0xf854f9['attributes']:_0x18112a[_0x5b94('0x2e')];if(_0x48b5d6[_0x5b94('0x2c')][_0x5b94('0x3b')]){_0xf854f9['include']=[{'all':!![]}];}_0xf854f9=_[_0x5b94('0x37')]({},_0xf854f9,_0x48b5d6[_0x5b94('0x3a')]);return db[_0x5b94('0x29')]['find'](_0xf854f9)['then'](handleEntityNotFound(_0x5d09b7,null))[_0x5b94('0x23')](respondWithResult(_0x5d09b7,null))['catch'](handleError(_0x5d09b7,null));};exports[_0x5b94('0x42')]=function(_0xbf5ab0,_0x513821){return db[_0x5b94('0x29')][_0x5b94('0x42')](_0xbf5ab0[_0x5b94('0x43')],{})['then'](function(_0x34456e){var _0x18cecf=_0xbf5ab0[_0x5b94('0x44')][_0x5b94('0x20')]({'plain':!![]});if(!_0x18cecf)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x18cecf['role']===_0x5b94('0x44')){var _0x12928e=_0x34456e[_0x5b94('0x20')]({'plain':!![]});var _0x2b747f='Companies';return db[_0x5b94('0x45')][_0x5b94('0x46')]({'where':{'name':_0x2b747f,'userProfileId':_0x18cecf[_0x5b94('0x47')]},'raw':!![]})[_0x5b94('0x23')](function(_0x318868){if(_0x318868&&_0x318868[_0x5b94('0x48')]===0x0){return db[_0x5b94('0x22')][_0x5b94('0x42')]({'name':_0x12928e[_0x5b94('0x26')],'resourceId':_0x12928e['id'],'type':_0x318868[_0x5b94('0x26')],'sectionId':_0x318868['id']},{})[_0x5b94('0x23')](function(){return _0x34456e;});}else{return _0x34456e;}})['catch'](function(_0x50ffc9){logger[_0x5b94('0x24')](_0x5b94('0x49'),_0x50ffc9);throw _0x50ffc9;});}return _0x34456e;})[_0x5b94('0x23')](respondWithResult(_0x513821,0xc9))[_0x5b94('0x3d')](handleError(_0x513821,null));};exports[_0x5b94('0x1e')]=function(_0x4750f7,_0x3991b7){if(_0x4750f7[_0x5b94('0x43')]['id']){delete _0x4750f7[_0x5b94('0x43')]['id'];}return db[_0x5b94('0x29')][_0x5b94('0x46')]({'where':{'id':_0x4750f7['params']['id']}})[_0x5b94('0x23')](handleEntityNotFound(_0x3991b7,null))['then'](saveUpdates(_0x4750f7['body'],null))['then'](respondWithResult(_0x3991b7,null))[_0x5b94('0x3d')](handleError(_0x3991b7,null));};exports[_0x5b94('0x1f')]=function(_0x45205d,_0x1bd1ac){return db[_0x5b94('0x29')][_0x5b94('0x46')]({'where':{'id':_0x45205d[_0x5b94('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1bd1ac,null))['then'](removeEntity(_0x1bd1ac,null))[_0x5b94('0x3d')](handleError(_0x1bd1ac,null));};exports[_0x5b94('0x2a')]=function(_0x1b59f3,_0x10a03c){return db['CmCompany'][_0x5b94('0x2a')]()[_0x5b94('0x23')](respondWithResult(_0x10a03c,null))[_0x5b94('0x3d')](handleError(_0x10a03c,null));};exports[_0x5b94('0x4a')]=function(_0x22efbc,_0x23d9a9,_0xf44148){return db[_0x5b94('0x4b')][_0x5b94('0x46')]({'where':{'id':_0x22efbc['params']['id']}})[_0x5b94('0x23')](handleEntityNotFound(_0x23d9a9,null))[_0x5b94('0x23')](function(_0x26b931){if(_0x26b931){return _0x26b931[_0x5b94('0x4a')](_0x22efbc[_0x5b94('0x43')][_0x5b94('0x4c')],_['omit'](_0x22efbc['body'],['ids','id'])||{});}})[_0x5b94('0x23')](respondWithResult(_0x23d9a9,null))[_0x5b94('0x3d')](handleError(_0x23d9a9,null));};exports[_0x5b94('0x4d')]=function(_0x4b2627,_0x52356b,_0x415a7e){var _0x2bf393={};var _0x44ad67={};var _0x41e24d;var _0x4984fb;return db[_0x5b94('0x29')]['findOne']({'where':{'id':_0x4b2627[_0x5b94('0x3f')]['id']}})[_0x5b94('0x23')](handleEntityNotFound(_0x52356b,null))[_0x5b94('0x23')](function(_0x191bc4){if(_0x191bc4){_0x41e24d=_0x191bc4;_0x44ad67['model']=_[_0x5b94('0x2b')](db[_0x5b94('0x4b')][_0x5b94('0x40')]);_0x44ad67[_0x5b94('0x2c')]=_['keys'](_0x4b2627[_0x5b94('0x2c')]);_0x44ad67['filters']=_[_0x5b94('0x2d')](_0x44ad67['model'],_0x44ad67[_0x5b94('0x2c')]);_0x2bf393[_0x5b94('0x30')]=_[_0x5b94('0x2d')](_0x44ad67[_0x5b94('0x2e')],qs[_0x5b94('0x2f')](_0x4b2627['query']['fields']));_0x2bf393[_0x5b94('0x30')]=_0x2bf393[_0x5b94('0x30')][_0x5b94('0x31')]?_0x2bf393[_0x5b94('0x30')]:_0x44ad67['model'];_0x2bf393[_0x5b94('0x4e')]=qs['sort'](_0x4b2627[_0x5b94('0x2c')][_0x5b94('0x34')]);_0x2bf393[_0x5b94('0x35')]=qs[_0x5b94('0x41')](_[_0x5b94('0x36')](_0x4b2627[_0x5b94('0x2c')],_0x44ad67[_0x5b94('0x41')]));if(_0x4b2627['query'][_0x5b94('0x39')]){_0x2bf393[_0x5b94('0x35')]=_[_0x5b94('0x37')](_0x2bf393[_0x5b94('0x35')],{'$or':_['map'](_0x2bf393[_0x5b94('0x30')],function(_0x1ec656){var _0x4071a1={};_0x4071a1[_0x1ec656]={'$like':'%'+_0x4b2627['query']['filter']+'%'};return _0x4071a1;})});}_0x2bf393=_[_0x5b94('0x37')]({},_0x2bf393,_0x4b2627[_0x5b94('0x3a')]);return _0x41e24d['getContacts'](_0x2bf393);}})['then'](function(_0x31d51a){if(_0x31d51a){_0x4984fb=_0x31d51a[_0x5b94('0x31')];if(!_0x4b2627[_0x5b94('0x2c')][_0x5b94('0x32')](_0x5b94('0x4f'))){_0x2bf393['limit']=qs[_0x5b94('0x33')](_0x4b2627['query'][_0x5b94('0x33')]);_0x2bf393['offset']=qs[_0x5b94('0x19')](_0x4b2627[_0x5b94('0x2c')][_0x5b94('0x19')]);}return _0x41e24d[_0x5b94('0x4d')](_0x2bf393);}})['then'](function(_0x203884){if(_0x203884){return _0x203884?{'count':_0x4984fb,'rows':_0x203884}:null;}})[_0x5b94('0x23')](respondWithResult(_0x52356b,null))[_0x5b94('0x3d')](handleError(_0x52356b,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index eda6f82..bf1a6ba 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 _0x50a6=['./cmCompany.attributes','define','CmCompany','cm_companies','lodash','util','moment','request-promise','path','rimraf'];(function(_0x1b1365,_0x205568){var _0x5edfd8=function(_0xae9b3d){while(--_0xae9b3d){_0x1b1365['push'](_0x1b1365['shift']());}};_0x5edfd8(++_0x205568);}(_0x50a6,0xa4));var _0x650a=function(_0x5d4366,_0x1ea497){_0x5d4366=_0x5d4366-0x0;var _0x373165=_0x50a6[_0x5d4366];return _0x373165;};'use strict';var _=require(_0x650a('0x0'));var util=require(_0x650a('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x650a('0x2'));var BPromise=require('bluebird');var rp=require(_0x650a('0x3'));var fs=require('fs');var path=require(_0x650a('0x4'));var rimraf=require(_0x650a('0x5'));var config=require('../../config/environment');var attributes=require(_0x650a('0x6'));module['exports']=function(_0x4eabde,_0x2d486d){return _0x4eabde[_0x650a('0x7')](_0x650a('0x8'),attributes,{'tableName':_0x650a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc18a=['cm_companies','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','exports','define','CmCompany'];(function(_0x3eab03,_0x55192c){var _0x3eda6e=function(_0x2165c5){while(--_0x2165c5){_0x3eab03['push'](_0x3eab03['shift']());}};_0x3eda6e(++_0x55192c);}(_0xc18a,0x1cf));var _0xac18=function(_0x26615d,_0x280370){_0x26615d=_0x26615d-0x0;var _0x26ce8d=_0xc18a[_0x26615d];return _0x26ce8d;};'use strict';var _=require(_0xac18('0x0'));var util=require(_0xac18('0x1'));var logger=require(_0xac18('0x2'))(_0xac18('0x3'));var moment=require('moment');var BPromise=require(_0xac18('0x4'));var rp=require(_0xac18('0x5'));var fs=require('fs');var path=require(_0xac18('0x6'));var rimraf=require(_0xac18('0x7'));var config=require(_0xac18('0x8'));var attributes=require(_0xac18('0x9'));module[_0xac18('0xa')]=function(_0x395493,_0x49136f){return _0x395493[_0xac18('0xb')](_0xac18('0xc'),attributes,{'tableName':_0xac18('0xd'),'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 79174d1..d820362 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 _0x4738=['request','info','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','CmCompany,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x4738,0x156));var _0x8473=function(_0x3402ca,_0x1d0bcf){_0x3402ca=_0x3402ca-0x0;var _0x399c2d=_0x4738[_0x3402ca];return _0x399c2d;};'use strict';var _=require(_0x8473('0x0'));var util=require(_0x8473('0x1'));var moment=require(_0x8473('0x2'));var BPromise=require('bluebird');var rs=require(_0x8473('0x3'));var fs=require('fs');var Redis=require(_0x8473('0x4'));var db=require(_0x8473('0x5'))['db'];var utils=require(_0x8473('0x6'));var logger=require('../../config/logger')(_0x8473('0x7'));var config=require(_0x8473('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8473('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x135fef,_0x3c4f00,_0xcdfbc6){return new BPromise(function(_0x1eb7bd,_0x870372){return client[_0x8473('0xa')](_0x135fef,_0xcdfbc6)['then'](function(_0x2baa72){logger[_0x8473('0xb')]('CmCompany,\x20%s,\x20%s',_0x3c4f00,_0x8473('0xc'));logger[_0x8473('0xd')](_0x8473('0xe'),_0x3c4f00,_0x8473('0xc'),JSON[_0x8473('0xf')](_0x2baa72));if(_0x2baa72[_0x8473('0x10')]){if(_0x2baa72['error'][_0x8473('0x11')]===0x1f4){logger[_0x8473('0x10')](_0x8473('0x12'),_0x3c4f00,_0x2baa72['error'][_0x8473('0x13')]);return _0x870372(_0x2baa72[_0x8473('0x10')][_0x8473('0x13')]);}logger[_0x8473('0x10')](_0x8473('0x12'),_0x3c4f00,_0x2baa72[_0x8473('0x10')][_0x8473('0x13')]);return _0x1eb7bd(_0x2baa72[_0x8473('0x10')][_0x8473('0x13')]);}else{logger[_0x8473('0xb')](_0x8473('0x12'),_0x3c4f00,_0x8473('0xc'));_0x1eb7bd(_0x2baa72[_0x8473('0x14')][_0x8473('0x13')]);}})[_0x8473('0x15')](function(_0xc9648d){logger[_0x8473('0x10')](_0x8473('0x12'),_0x3c4f00,_0xc9648d);_0x870372(_0xc9648d);});});} \ No newline at end of file +var _0xe0e4=['request','CmCompany,\x20%s,\x20%s','debug','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x518db9,_0x124b85){var _0x1233fe=function(_0x6d23c0){while(--_0x6d23c0){_0x518db9['push'](_0x518db9['shift']());}};_0x1233fe(++_0x124b85);}(_0xe0e4,0x1ef));var _0x4e0e=function(_0x523295,_0x5c15d4){_0x523295=_0x523295-0x0;var _0x487b16=_0xe0e4[_0x523295];return _0x487b16;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4e0e('0x0'));var BPromise=require(_0x4e0e('0x1'));var rs=require(_0x4e0e('0x2'));var fs=require('fs');var Redis=require(_0x4e0e('0x3'));var db=require(_0x4e0e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4e0e('0x5'))(_0x4e0e('0x6'));var config=require(_0x4e0e('0x7'));var jayson=require(_0x4e0e('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3f2e80,_0x591068,_0x197425){return new BPromise(function(_0x40fff4,_0x4e31af){return client[_0x4e0e('0x9')](_0x3f2e80,_0x197425)['then'](function(_0x45ddeb){logger['info'](_0x4e0e('0xa'),_0x591068,'request\x20sent');logger[_0x4e0e('0xb')](_0x4e0e('0xc'),_0x591068,_0x4e0e('0xd'),JSON[_0x4e0e('0xe')](_0x45ddeb));if(_0x45ddeb[_0x4e0e('0xf')]){if(_0x45ddeb['error'][_0x4e0e('0x10')]===0x1f4){logger['error'](_0x4e0e('0xa'),_0x591068,_0x45ddeb[_0x4e0e('0xf')][_0x4e0e('0x11')]);return _0x4e31af(_0x45ddeb[_0x4e0e('0xf')][_0x4e0e('0x11')]);}logger[_0x4e0e('0xf')](_0x4e0e('0xa'),_0x591068,_0x45ddeb[_0x4e0e('0xf')][_0x4e0e('0x11')]);return _0x40fff4(_0x45ddeb[_0x4e0e('0xf')][_0x4e0e('0x11')]);}else{logger[_0x4e0e('0x12')](_0x4e0e('0xa'),_0x591068,_0x4e0e('0xd'));_0x40fff4(_0x45ddeb[_0x4e0e('0x13')][_0x4e0e('0x11')]);}})[_0x4e0e('0x14')](function(_0x59f2e7){logger[_0x4e0e('0xf')](_0x4e0e('0xa'),_0x591068,_0x59f2e7);_0x4e31af(_0x59f2e7);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 085b738..103481d 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 _0xbff5=['addContacts','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','getContacts','post'];(function(_0x53fe55,_0xdeddc){var _0x289f64=function(_0xde37b5){while(--_0xde37b5){_0x53fe55['push'](_0x53fe55['shift']());}};_0x289f64(++_0xdeddc);}(_0xbff5,0x1bc));var _0x5bff=function(_0x325db0,_0x12d594){_0x325db0=_0x325db0-0x0;var _0xe50aae=_0xbff5[_0x325db0];return _0xe50aae;};'use strict';var multer=require(_0x5bff('0x0'));var util=require(_0x5bff('0x1'));var path=require(_0x5bff('0x2'));var timeout=require(_0x5bff('0x3'));var express=require(_0x5bff('0x4'));var router=express[_0x5bff('0x5')]();var auth=require(_0x5bff('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5bff('0x7'));var controller=require('./cmCompany.controller');router['get']('/',auth[_0x5bff('0x8')](),controller[_0x5bff('0x9')]);router[_0x5bff('0xa')](_0x5bff('0xb'),auth[_0x5bff('0x8')](),controller[_0x5bff('0xc')]);router[_0x5bff('0xa')](_0x5bff('0xd'),auth[_0x5bff('0x8')](),controller['show']);router[_0x5bff('0xa')]('/:id/contacts',auth[_0x5bff('0x8')](),controller[_0x5bff('0xe')]);router['post']('/',auth[_0x5bff('0x8')](),controller['create']);router[_0x5bff('0xf')]('/:id/contacts',auth[_0x5bff('0x8')](),controller[_0x5bff('0x10')]);router['put'](_0x5bff('0xd'),auth['isAuthenticated'](),controller[_0x5bff('0x11')]);router[_0x5bff('0x12')]('/:id',auth[_0x5bff('0x8')](),controller[_0x5bff('0x13')]);module['exports']=router; \ No newline at end of file +var _0xa6b0=['util','express','Router','../../components/auth/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/contacts','getContacts','post','create','addContacts','put','update','destroy','exports','multer'];(function(_0x372b9e,_0x59fa28){var _0x698bbe=function(_0x119ce5){while(--_0x119ce5){_0x372b9e['push'](_0x372b9e['shift']());}};_0x698bbe(++_0x59fa28);}(_0xa6b0,0xaf));var _0x0a6b=function(_0x42bffa,_0x28f24e){_0x42bffa=_0x42bffa-0x0;var _0x216e7d=_0xa6b0[_0x42bffa];return _0x216e7d;};'use strict';var multer=require(_0x0a6b('0x0'));var util=require(_0x0a6b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0a6b('0x2'));var router=express[_0x0a6b('0x3')]();var auth=require(_0x0a6b('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x0a6b('0x5'));var controller=require(_0x0a6b('0x6'));router[_0x0a6b('0x7')]('/',auth[_0x0a6b('0x8')](),controller[_0x0a6b('0x9')]);router[_0x0a6b('0x7')](_0x0a6b('0xa'),auth[_0x0a6b('0x8')](),controller[_0x0a6b('0xb')]);router[_0x0a6b('0x7')](_0x0a6b('0xc'),auth[_0x0a6b('0x8')](),controller['show']);router['get'](_0x0a6b('0xd'),auth[_0x0a6b('0x8')](),controller[_0x0a6b('0xe')]);router[_0x0a6b('0xf')]('/',auth[_0x0a6b('0x8')](),controller[_0x0a6b('0x10')]);router[_0x0a6b('0xf')](_0x0a6b('0xd'),auth[_0x0a6b('0x8')](),controller[_0x0a6b('0x11')]);router[_0x0a6b('0x12')](_0x0a6b('0xc'),auth[_0x0a6b('0x8')](),controller[_0x0a6b('0x13')]);router['delete']('/:id',auth[_0x0a6b('0x8')](),controller[_0x0a6b('0x14')]);module[_0x0a6b('0x15')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index a6134d8..343004f 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 _0x2a49=['exports','STRING','INTEGER','UNSIGNED'];(function(_0x11767a,_0x14aa23){var _0x2e2c24=function(_0x33bb54){while(--_0x33bb54){_0x11767a['push'](_0x11767a['shift']());}};_0x2e2c24(++_0x14aa23);}(_0x2a49,0x164));var _0x92a4=function(_0x5169dc,_0x5d9983){_0x5169dc=_0x5169dc-0x0;var _0x4642a3=_0x2a49[_0x5169dc];return _0x4642a3;};'use strict';var _=require('lodash');var Sequelize=require('sequelize');module[_0x92a4('0x0')]={'firstName':{'type':Sequelize[_0x92a4('0x1')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x92a4('0x1')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x92a4('0x1')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x92a4('0x1')]},'mobile':{'type':Sequelize[_0x92a4('0x1')]},'fax':{'type':Sequelize[_0x92a4('0x1')]},'email':{'type':Sequelize[_0x92a4('0x1')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0x92a4('0x1')]},'fb_data':{'type':Sequelize[_0x92a4('0x1')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x92a4('0x1')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x92a4('0x1')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x92a4('0x1')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize[_0x92a4('0x2')](0x2)[_0x92a4('0x3')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0x8269=['exports','STRING','TEXT','INTEGER','DATE','NOW','lodash'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x8269,0xbc));var _0x9826=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8269[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x9826('0x0'));var Sequelize=require('sequelize');module[_0x9826('0x1')]={'firstName':{'type':Sequelize[_0x9826('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x9826('0x2')]},'street':{'type':Sequelize[_0x9826('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x9826('0x2')]},'country':{'type':Sequelize[_0x9826('0x2')]},'dateOfBirth':{'type':Sequelize[_0x9826('0x2')]},'description':{'type':Sequelize[_0x9826('0x3')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x9826('0x2')]},'fax':{'type':Sequelize[_0x9826('0x2')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0x9826('0x2')]},'twitter':{'type':Sequelize[_0x9826('0x2')]},'skype':{'type':Sequelize[_0x9826('0x2')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x9826('0x2')]},'wechat':{'type':Sequelize[_0x9826('0x2')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x9826('0x4')]},'priority':{'type':Sequelize[_0x9826('0x4')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x9826('0x5')],'defaultValue':Sequelize[_0x9826('0x6')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 3580d83..32276ed 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 _0x3fce=['Tag','color','push','omit','format','cf_%d','$and','pickBy','table','setFields','id\x20=\x20?','toParam','phone','rawAttributes','nolimit','setTags','ContactId','options','includeAll','include','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','zipObject','No\x20phone\x20column\x20specified','firstName','root','file','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','pid','upload','createReadStream','path','parse','meta','import','User','agent','binding','No\x20firstName\x20column\x20specified','../../components/import/cm/csv2','stringify','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','to-csv','ejs','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','status','end','json','count','limit','set','apply','save','then','destroy','stack','name','send','index','CmContact','describe','keys','length','startsWith','cf_','CmCustomField','findOne','trimStart','all','fieldType','type','model','query','filters','intersection','fields','attributes','hasOwnProperty','offset','sort','where','pick','select','field','from','tools_tags','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','sqlOperator','conditions','find','value','split','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','castTo','DATE','buildExpression','text','filter','isNil','Contact','isEmpty','ListId','c.ListId\x20IN\x20?','concat','tag','replace','\x27\x27\x27\x27','isNumeric','c.id\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','SELECT','clone','order','DESC','having','t.id\x20IN\x20?','toString','keyBy','merge','c.firstName','c.lastName','c.phone','c.mobile','c.fax','c.email','c.deletedAt','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','sequelize','Tags','rows','catch','params','columnName','displayName','findAll','alias','custom','values','body','get','mergeWith','isArray','tags','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','OpenchannelQueueReport','JscriptySessionReport','bulkCreate','each','duplicates','$or','findOrCreate','spread','error'];(function(_0x25f3f7,_0x13f4b0){var _0x4b8e8f=function(_0x23e73b){while(--_0x23e73b){_0x25f3f7['push'](_0x25f3f7['shift']());}};_0x4b8e8f(++_0x13f4b0);}(_0x3fce,0x121));var _0xe3fc=function(_0x2002b3,_0x11e91c){_0x2002b3=_0x2002b3-0x0;var _0x2756f0=_0x3fce[_0x2002b3];return _0x2756f0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xe3fc('0x0'));var rimraf=require(_0xe3fc('0x1'));var zipdir=require(_0xe3fc('0x2'));var jsonpatch=require(_0xe3fc('0x3'));var rp=require(_0xe3fc('0x4'));var moment=require(_0xe3fc('0x5'));var BPromise=require(_0xe3fc('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xe3fc('0x7'));var ejs=require(_0xe3fc('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xe3fc('0x9'));var crypto=require('crypto');var jsforce=require(_0xe3fc('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xe3fc('0x7'));var querystring=require(_0xe3fc('0xb'));var Papa=require(_0xe3fc('0xc'));var Redis=require(_0xe3fc('0xd'));var authService=require(_0xe3fc('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe3fc('0xf'));var logger=require(_0xe3fc('0x10'))(_0xe3fc('0x11'));var utils=require('../../config/utils');var config=require(_0xe3fc('0x12'));var db=require(_0xe3fc('0x13'))['db'];config[_0xe3fc('0x14')]=_[_0xe3fc('0x15')](config[_0xe3fc('0x14')],{'host':_0xe3fc('0x16'),'port':0x18eb});var socket=require(_0xe3fc('0x17'))(new Redis(config['redis']));require(_0xe3fc('0x18'))[_0xe3fc('0x19')](socket);function respondWithStatusCode(_0x4b2ed4,_0x3f7ae2){_0x3f7ae2=_0x3f7ae2||0xcc;return function(_0x3d437f){if(_0x3d437f){return _0x4b2ed4['sendStatus'](_0x3f7ae2);}return _0x4b2ed4[_0xe3fc('0x1a')](_0x3f7ae2)[_0xe3fc('0x1b')]();};}function respondWithResult(_0x4b6256,_0x4fa4d4){_0x4fa4d4=_0x4fa4d4||0xc8;return function(_0x5953ac){if(_0x5953ac){return _0x4b6256[_0xe3fc('0x1a')](_0x4fa4d4)[_0xe3fc('0x1c')](_0x5953ac);}};}function respondWithFilteredResult(_0x2f8cc9,_0x59a6db){return function(_0x58a4b8){if(_0x58a4b8){var _0x354695=_0x58a4b8[_0xe3fc('0x1d')],_0x5a4d98=_0x59a6db['offset'],_0x404e04=_0x59a6db['offset']+_0x59a6db[_0xe3fc('0x1e')],_0xca0203;if(_0x404e04>=_0x354695){_0x404e04=_0x354695;_0xca0203=0xc8;}else{_0xca0203=0xce;}_0x2f8cc9[_0xe3fc('0x1a')](_0xca0203);return _0x2f8cc9[_0xe3fc('0x1f')]('Content-Range',_0x5a4d98+'-'+_0x404e04+'/'+_0x354695)[_0xe3fc('0x1c')](_0x58a4b8);}return null;};}function patchUpdates(_0xfac19f){return function(_0x498bd3){try{jsonpatch[_0xe3fc('0x20')](_0x498bd3,_0xfac19f,!![]);}catch(_0x82da29){return BPromise['reject'](_0x82da29);}return _0x498bd3[_0xe3fc('0x21')]();};}function saveUpdates(_0x457cef,_0x1e307a){return function(_0x5b53a7){if(_0x5b53a7){return _0x5b53a7['update'](_0x457cef)[_0xe3fc('0x22')](function(_0x4f4134){return _0x4f4134;});}return null;};}function removeEntity(_0x55ea5e,_0x383f19){return function(_0x2e9322){if(_0x2e9322){return _0x2e9322[_0xe3fc('0x23')]()[_0xe3fc('0x22')](function(){_0x55ea5e['status'](0xcc)[_0xe3fc('0x1b')]();});}};}function handleEntityNotFound(_0x54e294,_0x507656){return function(_0x5abdb3){if(!_0x5abdb3){_0x54e294['sendStatus'](0x194);}return _0x5abdb3;};}function handleError(_0x51dc35,_0x16045e){_0x16045e=_0x16045e||0x1f4;return function(_0x35a7b5){logger['error'](_0x35a7b5[_0xe3fc('0x24')]);if(_0x35a7b5[_0xe3fc('0x25')]){delete _0x35a7b5['name'];}_0x51dc35[_0xe3fc('0x1a')](_0x16045e)[_0xe3fc('0x26')](_0x35a7b5);};}exports[_0xe3fc('0x27')]=function(_0x3bc101,_0x3d173e){var _0x21ccdd={},_0x396685={},_0x205687={'count':0x0,'rows':[]};return db[_0xe3fc('0x28')][_0xe3fc('0x29')]()[_0xe3fc('0x22')](function(_0x39f375){var _0x25a0af=[];for(var _0x43714d=0x0;_0x43714d=_0x436002){_0xf2c261=_0x436002;_0x2f8df6=0xc8;}else{_0x2f8df6=0xce;}_0x297b70[_0xb9d5('0x20')](_0x2f8df6);return _0x297b70[_0xb9d5('0x25')](_0xb9d5('0x26'),_0x248cb3+'-'+_0xf2c261+'/'+_0x436002)[_0xb9d5('0x21')](_0x243e2d);}return null;};}function patchUpdates(_0x4de540){return function(_0x28c587){try{jsonpatch['apply'](_0x28c587,_0x4de540,!![]);}catch(_0x414849){return BPromise[_0xb9d5('0x27')](_0x414849);}return _0x28c587[_0xb9d5('0x28')]();};}function saveUpdates(_0x13fc35,_0x2b5a1c){return function(_0x22f3fd){if(_0x22f3fd){return _0x22f3fd[_0xb9d5('0x29')](_0x13fc35)[_0xb9d5('0x2a')](function(_0x525e3b){return _0x525e3b;});}return null;};}function removeEntity(_0x45866f,_0x30b06f){return function(_0x5508c6){if(_0x5508c6){return _0x5508c6[_0xb9d5('0x2b')]()[_0xb9d5('0x2a')](function(){_0x45866f[_0xb9d5('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x186360,_0xc2ff0e){return function(_0x19ee15){if(!_0x19ee15){_0x186360[_0xb9d5('0x1e')](0x194);}return _0x19ee15;};}function handleError(_0xb40a3d,_0x236520){_0x236520=_0x236520||0x1f4;return function(_0x1b0c3a){logger[_0xb9d5('0x2c')](_0x1b0c3a[_0xb9d5('0x2d')]);if(_0x1b0c3a['name']){delete _0x1b0c3a[_0xb9d5('0x2e')];}_0xb40a3d['status'](_0x236520)[_0xb9d5('0x2f')](_0x1b0c3a);};}exports[_0xb9d5('0x30')]=function(_0x1de8e6,_0x160da7){var _0x2d9950={},_0x3eb38e={},_0x101a5b={'count':0x0,'rows':[]};return db[_0xb9d5('0x31')][_0xb9d5('0x32')]()[_0xb9d5('0x2a')](function(_0x30ed58){var _0x3be528=[];for(var _0x2f823e=0x0;_0x2f823e{}\s\\|]/g,'-');_0x5f101a(null,util[_0xd81b('0x23')]('%s-%s%s',path[_0xd81b('0x24')](_0x4f8c0b[_0xd81b('0x21')],path['extname'](_0x4f8c0b[_0xd81b('0x21')])),Date[_0xd81b('0x25')](),path[_0xd81b('0x26')](_0x4f8c0b[_0xd81b('0x21')])));}})});router[_0xd81b('0x16')](_0xd81b('0x27'),upload[_0xd81b('0x28')](_0xd81b('0x29')),controller[_0xd81b('0x2a')]);var upload=multer({'storage':multer[_0xd81b('0x1d')]({'destination':function(_0x2ccedf,_0x1bf351,_0x596389){_0x596389(null,path[_0xd81b('0x1e')](config[_0xd81b('0x1f')],_0xd81b('0x20')));},'filename':function(_0x31b9fd,_0x3266c2,_0x2d0d02){_0x3266c2[_0xd81b('0x21')]=_0x3266c2[_0xd81b('0x21')][_0xd81b('0x22')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2d0d02(null,util['format'](_0xd81b('0x2b'),path['basename'](_0x3266c2['originalname'],path[_0xd81b('0x26')](_0x3266c2[_0xd81b('0x21')])),Date['now'](),path['extname'](_0x3266c2[_0xd81b('0x21')])));}})});router[_0xd81b('0x16')](_0xd81b('0x2c'),upload[_0xd81b('0x28')](_0xd81b('0x29')),controller[_0xd81b('0x2d')]);router['post'](_0xd81b('0x2e'),auth[_0xd81b('0xc')](),controller['import']);router['put'](_0xd81b('0x2f'),auth[_0xd81b('0xc')](),controller['update']);router['delete']('/:id',auth[_0xd81b('0xc')](),controller[_0xd81b('0x30')]);module[_0xd81b('0x31')]=router; \ No newline at end of file +var _0x0e85=['connect-timeout','express','../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/tags','getTags','/:id/hoppers','getHoppers','getHopperHistories','getHopperFinals','/:id/jscripty_sessions','post','/merge','create','/create_many','bulkCreate','setTags','diskStorage','join','server/files/tmp','originalname','replace','%s-%s%s','basename','extname','file','uploadCsv','root','format','now','/upload','single','/upload/:id','put','exports','multer','util'];(function(_0x18942b,_0x22f5df){var _0x551abb=function(_0x503224){while(--_0x503224){_0x18942b['push'](_0x18942b['shift']());}};_0x551abb(++_0x22f5df);}(_0x0e85,0x7c));var _0x50e8=function(_0x47a349,_0x4699d9){_0x47a349=_0x47a349-0x0;var _0x18ab75=_0x0e85[_0x47a349];return _0x18ab75;};'use strict';var multer=require(_0x50e8('0x0'));var util=require(_0x50e8('0x1'));var path=require('path');var timeout=require(_0x50e8('0x2'));var express=require(_0x50e8('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x50e8('0x4'));var controller=require('./cmContact.controller');router[_0x50e8('0x5')]('/',auth[_0x50e8('0x6')](),controller[_0x50e8('0x7')]);router[_0x50e8('0x5')]('/describe',auth[_0x50e8('0x6')](),controller[_0x50e8('0x8')]);router[_0x50e8('0x5')](_0x50e8('0x9'),auth[_0x50e8('0x6')](),controller[_0x50e8('0xa')]);router['get'](_0x50e8('0xb'),auth[_0x50e8('0x6')](),controller[_0x50e8('0xc')]);router[_0x50e8('0x5')](_0x50e8('0xd'),auth[_0x50e8('0x6')](),controller[_0x50e8('0xe')]);router[_0x50e8('0x5')]('/:id/hopper_histories',auth['isAuthenticated'](),controller[_0x50e8('0xf')]);router[_0x50e8('0x5')]('/:id/hopper_finals',auth['isAuthenticated'](),controller[_0x50e8('0x10')]);router[_0x50e8('0x5')](_0x50e8('0x11'),auth[_0x50e8('0x6')](),controller['getJscriptySessions']);router[_0x50e8('0x12')](_0x50e8('0x13'),auth[_0x50e8('0x6')](),controller['merge']);router['post']('/',auth[_0x50e8('0x6')](),controller[_0x50e8('0x14')]);router[_0x50e8('0x12')](_0x50e8('0x15'),auth[_0x50e8('0x6')](),controller[_0x50e8('0x16')]);router['post']('/:id/tags',auth[_0x50e8('0x6')](),controller[_0x50e8('0x17')]);var upload=multer({'storage':multer[_0x50e8('0x18')]({'destination':function(_0x45ce11,_0x5dae4e,_0x90c54c){_0x90c54c(null,path[_0x50e8('0x19')](config['root'],_0x50e8('0x1a')));},'filename':function(_0x55997c,_0x4d2318,_0xe04a5c){_0x4d2318[_0x50e8('0x1b')]=_0x4d2318[_0x50e8('0x1b')][_0x50e8('0x1c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xe04a5c(null,util['format'](_0x50e8('0x1d'),path[_0x50e8('0x1e')](_0x4d2318['originalname'],path[_0x50e8('0x1f')](_0x4d2318[_0x50e8('0x1b')])),Date['now'](),path[_0x50e8('0x1f')](_0x4d2318[_0x50e8('0x1b')])));}})});router['post']('/csv',upload['single'](_0x50e8('0x20')),controller[_0x50e8('0x21')]);var upload=multer({'storage':multer[_0x50e8('0x18')]({'destination':function(_0x371a1f,_0xc2f832,_0x13b6e9){_0x13b6e9(null,path['join'](config[_0x50e8('0x22')],_0x50e8('0x1a')));},'filename':function(_0x4b3a09,_0x177201,_0x2bc8d8){_0x177201[_0x50e8('0x1b')]=_0x177201[_0x50e8('0x1b')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2bc8d8(null,util[_0x50e8('0x23')]('%s-%s%s',path[_0x50e8('0x1e')](_0x177201[_0x50e8('0x1b')],path[_0x50e8('0x1f')](_0x177201['originalname'])),Date[_0x50e8('0x24')](),path[_0x50e8('0x1f')](_0x177201[_0x50e8('0x1b')])));}})});router[_0x50e8('0x12')](_0x50e8('0x25'),upload[_0x50e8('0x26')](_0x50e8('0x20')),controller['upload']);router[_0x50e8('0x12')](_0x50e8('0x27'),auth['isAuthenticated'](),controller['import']);router[_0x50e8('0x28')](_0x50e8('0x9'),auth[_0x50e8('0x6')](),controller['update']);router['delete'](_0x50e8('0x9'),auth[_0x50e8('0x6')](),controller['destroy']);module[_0x50e8('0x29')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 26148e7..0fe9a35 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 _0x625f=['alias','STRING','name','long','getDataValue','type','select','parse','values','isArray','setDataValue','stringify','BOOLEAN','sequelize','lodash','exports','VIRTUAL'];(function(_0x2eedb5,_0x2e1801){var _0x534cd6=function(_0x17100c){while(--_0x17100c){_0x2eedb5['push'](_0x2eedb5['shift']());}};_0x534cd6(++_0x2e1801);}(_0x625f,0xfb));var _0xf625=function(_0x1e03a6,_0xf0349){_0x1e03a6=_0x1e03a6-0x0;var _0x295b64=_0x625f[_0x1e03a6];return _0x295b64;};'use strict';var Sequelize=require(_0xf625('0x0'));var _=require(_0xf625('0x1'));module[_0xf625('0x2')]={'name':{'type':Sequelize[_0xf625('0x3')],'get':function(_0x36b966){return this['getDataValue'](_0xf625('0x4'));}},'alias':{'type':Sequelize[_0xf625('0x5')],'allowNull':![],'set':function(_0x404112){this['setDataValue'](_0xf625('0x4'),_0x404112?_0x404112:this['getDataValue'](_0xf625('0x6')));}},'type':{'type':Sequelize[_0xf625('0x5')],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0xf625('0x7')),'get':function(){if(this[_0xf625('0x8')](_0xf625('0x9'))===_0xf625('0xa')){return JSON[_0xf625('0xb')](this['getDataValue'](_0xf625('0xc')));}else{return this['getDataValue'](_0xf625('0xc'));}},'set':function(_0x44fb5a){if(Array[_0xf625('0xd')](_0x44fb5a)){this[_0xf625('0xe')](_0xf625('0xc'),JSON[_0xf625('0xf')](_0x44fb5a));}else{this['setDataValue'](_0xf625('0xc'),_0x44fb5a);}}},'required':{'type':Sequelize[_0xf625('0x10')],'defaultValue':![]}}; \ No newline at end of file +var _0x8ec2=['stringify','BOOLEAN','sequelize','lodash','exports','VIRTUAL','getDataValue','alias','STRING','setDataValue','TEXT','type','select','parse','values','isArray'];(function(_0xfe0fe4,_0x139b32){var _0x25b638=function(_0x4dc38b){while(--_0x4dc38b){_0xfe0fe4['push'](_0xfe0fe4['shift']());}};_0x25b638(++_0x139b32);}(_0x8ec2,0x1b2));var _0x28ec=function(_0x25678f,_0x5958d5){_0x25678f=_0x25678f-0x0;var _0x1961b5=_0x8ec2[_0x25678f];return _0x1961b5;};'use strict';var Sequelize=require(_0x28ec('0x0'));var _=require(_0x28ec('0x1'));module[_0x28ec('0x2')]={'name':{'type':Sequelize[_0x28ec('0x3')],'get':function(_0x42567e){return this[_0x28ec('0x4')](_0x28ec('0x5'));}},'alias':{'type':Sequelize[_0x28ec('0x6')],'allowNull':![],'set':function(_0x3b3722){this[_0x28ec('0x7')](_0x28ec('0x5'),_0x3b3722?_0x3b3722:this['getDataValue']('name'));}},'type':{'type':Sequelize[_0x28ec('0x6')],'allowNull':![]},'values':{'type':Sequelize[_0x28ec('0x8')]('long'),'get':function(){if(this[_0x28ec('0x4')](_0x28ec('0x9'))===_0x28ec('0xa')){return JSON[_0x28ec('0xb')](this[_0x28ec('0x4')](_0x28ec('0xc')));}else{return this[_0x28ec('0x4')](_0x28ec('0xc'));}},'set':function(_0x255e6a){if(Array[_0x28ec('0xd')](_0x255e6a)){this[_0x28ec('0x7')](_0x28ec('0xc'),JSON[_0x28ec('0xe')](_0x255e6a));}else{this[_0x28ec('0x7')](_0x28ec('0xc'),_0x255e6a);}}},'required':{'type':Sequelize[_0x28ec('0xf')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 4995c34..106cf14 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 _0xa9e0=['end','error','name','send','index','map','CmCustomField','rawAttributes','fieldName','type','key','differenceBy','keys','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','limit','sort','where','pick','merge','field','options','includeAll','include','catch','show','params','fields','find','body','create','transaction','Sequelize','TEXT','text','number','switch','defaultValue','queryInterface','cm_contacts','format','cf_%d','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy'];(function(_0x39e6ab,_0x3a8b1b){var _0x4cd072=function(_0x69b250){while(--_0x69b250){_0x39e6ab['push'](_0x39e6ab['shift']());}};_0x4cd072(++_0x3a8b1b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];function respondWithStatusCode(_0x36471c,_0xd5b662){_0xd5b662=_0xd5b662||0xcc;return function(_0x26d672){if(_0x26d672){return _0x36471c[_0x0a9e('0x14')](_0xd5b662);}return _0x36471c[_0x0a9e('0x15')](_0xd5b662)['end']();};}function respondWithResult(_0x4283ce,_0x239b12){_0x239b12=_0x239b12||0xc8;return function(_0x2b4227){if(_0x2b4227){return _0x4283ce[_0x0a9e('0x15')](_0x239b12)[_0x0a9e('0x16')](_0x2b4227);}};}function respondWithFilteredResult(_0x4d5611,_0x52a03d){return function(_0x22dccb){if(_0x22dccb){var _0x5d0880=_0x22dccb[_0x0a9e('0x17')],_0x1985b6=_0x52a03d['offset'],_0x519dfd=_0x52a03d[_0x0a9e('0x18')]+_0x52a03d['limit'],_0x16033c;if(_0x519dfd>=_0x5d0880){_0x519dfd=_0x5d0880;_0x16033c=0xc8;}else{_0x16033c=0xce;}_0x4d5611[_0x0a9e('0x15')](_0x16033c);return _0x4d5611[_0x0a9e('0x19')](_0x0a9e('0x1a'),_0x1985b6+'-'+_0x519dfd+'/'+_0x5d0880)[_0x0a9e('0x16')](_0x22dccb);}return null;};}function patchUpdates(_0x31b1ca){return function(_0x2eb11f){try{jsonpatch[_0x0a9e('0x1b')](_0x2eb11f,_0x31b1ca,!![]);}catch(_0x20559e){return BPromise[_0x0a9e('0x1c')](_0x20559e);}return _0x2eb11f[_0x0a9e('0x1d')]();};}function saveUpdates(_0x1c696a,_0x105080){return function(_0x4bb1e3){if(_0x4bb1e3){return _0x4bb1e3[_0x0a9e('0x1e')](_0x1c696a)[_0x0a9e('0x1f')](function(_0x53682f){return _0x53682f;});}return null;};}function removeEntity(_0x20f109,_0x5a09ef){return function(_0x588269){if(_0x588269){return _0x588269[_0x0a9e('0x20')]()[_0x0a9e('0x1f')](function(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x21')]();});}};}function handleEntityNotFound(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(!_0x2fb0e4){_0x4abc77[_0x0a9e('0x14')](0x194);}return _0x2fb0e4;};}function handleError(_0x4d00e6,_0x370d86){_0x370d86=_0x370d86||0x1f4;return function(_0x42ac8f){logger[_0x0a9e('0x22')](_0x42ac8f['stack']);if(_0x42ac8f['name']){delete _0x42ac8f[_0x0a9e('0x23')];}_0x4d00e6[_0x0a9e('0x15')](_0x370d86)[_0x0a9e('0x24')](_0x42ac8f);};}exports[_0x0a9e('0x25')]=function(_0x526cf3,_0x384319){var _0x479bc4={},_0x45a1e7={},_0x5bfb33={'count':0x0,'rows':[]};var _0x1dc186=_[_0x0a9e('0x26')](db[_0x0a9e('0x27')][_0x0a9e('0x28')],function(_0x140511){return{'name':_0x140511[_0x0a9e('0x29')],'type':_0x140511[_0x0a9e('0x2a')][_0x0a9e('0x2b')]};});_0x45a1e7['model']=_[_0x0a9e('0x2c')](_[_0x0a9e('0x26')](_0x1dc186,_0x0a9e('0x23')),[_0x0a9e('0x23')]);_0x45a1e7['query']=_[_0x0a9e('0x2d')](_0x526cf3[_0x0a9e('0x2e')]);_0x45a1e7[_0x0a9e('0x2f')]=_[_0x0a9e('0x30')](_0x45a1e7[_0x0a9e('0x31')],_0x45a1e7[_0x0a9e('0x2e')]);_0x479bc4[_0x0a9e('0x32')]=_[_0x0a9e('0x30')](_0x45a1e7[_0x0a9e('0x31')],qs['fields'](_0x526cf3[_0x0a9e('0x2e')]['fields']));_0x479bc4[_0x0a9e('0x32')]=_0x479bc4[_0x0a9e('0x32')][_0x0a9e('0x33')]?_0x479bc4[_0x0a9e('0x32')]:_0x45a1e7[_0x0a9e('0x31')];if(!_0x526cf3['query'][_0x0a9e('0x34')](_0x0a9e('0x35'))){_0x479bc4[_0x0a9e('0x36')]=qs[_0x0a9e('0x36')](_0x526cf3[_0x0a9e('0x2e')][_0x0a9e('0x36')]);_0x479bc4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x526cf3['query'][_0x0a9e('0x18')]);}_0x479bc4['order']=qs[_0x0a9e('0x37')](_0x526cf3[_0x0a9e('0x2e')][_0x0a9e('0x37')]);_0x479bc4[_0x0a9e('0x38')]=qs['filters'](_[_0x0a9e('0x39')](_0x526cf3[_0x0a9e('0x2e')],_0x45a1e7[_0x0a9e('0x2f')]));if(_0x526cf3[_0x0a9e('0x2e')]['filter']){_0x479bc4['where']=_[_0x0a9e('0x3a')](_0x479bc4['where'],{'$or':_[_0x0a9e('0x26')](_0x1dc186,function(_0x3d9717){if(_0x3d9717[_0x0a9e('0x2a')][_0x0a9e('0x2b')]!=='VIRTUAL'){var _0x31916f={};_0x31916f[_0x3d9717[_0x0a9e('0x3b')]]={'$like':'%'+_0x526cf3[_0x0a9e('0x2e')]['filter']+'%'};return _0x31916f;}})});}_0x479bc4=_[_0x0a9e('0x3a')]({},_0x479bc4,_0x526cf3[_0x0a9e('0x3c')]);var _0x289467={'where':_0x479bc4['where']};return db['CmCustomField'][_0x0a9e('0x17')](_0x289467)[_0x0a9e('0x1f')](function(_0x5adda1){_0x5bfb33[_0x0a9e('0x17')]=_0x5adda1;if(_0x526cf3[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0x479bc4[_0x0a9e('0x3e')]=[{'all':!![]}];}return db['CmCustomField']['findAll'](_0x479bc4);})[_0x0a9e('0x1f')](function(_0x45b3d0){_0x5bfb33['rows']=_0x45b3d0;return _0x5bfb33;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x384319,_0x479bc4))[_0x0a9e('0x3f')](handleError(_0x384319,null));};exports[_0x0a9e('0x40')]=function(_0x5b4f5e,_0x316c8f){var _0x2cfea9={'raw':!![],'where':{'id':_0x5b4f5e[_0x0a9e('0x41')]['id']}},_0x274e8e={};_0x274e8e[_0x0a9e('0x31')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x27')][_0x0a9e('0x28')]);_0x274e8e[_0x0a9e('0x2e')]=_[_0x0a9e('0x2d')](_0x5b4f5e[_0x0a9e('0x2e')]);_0x274e8e[_0x0a9e('0x2f')]=_[_0x0a9e('0x30')](_0x274e8e[_0x0a9e('0x31')],_0x274e8e[_0x0a9e('0x2e')]);_0x2cfea9['attributes']=_['intersection'](_0x274e8e[_0x0a9e('0x31')],qs[_0x0a9e('0x42')](_0x5b4f5e[_0x0a9e('0x2e')][_0x0a9e('0x42')]));_0x2cfea9[_0x0a9e('0x32')]=_0x2cfea9[_0x0a9e('0x32')][_0x0a9e('0x33')]?_0x2cfea9[_0x0a9e('0x32')]:_0x274e8e[_0x0a9e('0x31')];if(_0x5b4f5e[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0x2cfea9[_0x0a9e('0x3e')]=[{'all':!![]}];}_0x2cfea9=_['merge']({},_0x2cfea9,_0x5b4f5e[_0x0a9e('0x3c')]);return db[_0x0a9e('0x27')][_0x0a9e('0x43')](_0x2cfea9)[_0x0a9e('0x1f')](handleEntityNotFound(_0x316c8f,null))[_0x0a9e('0x1f')](respondWithResult(_0x316c8f,null))[_0x0a9e('0x3f')](handleError(_0x316c8f,null));};exports[_0x0a9e('0x1e')]=function(_0x44dd99,_0x59afe8){if(_0x44dd99[_0x0a9e('0x44')]['id']){delete _0x44dd99['body']['id'];}return db[_0x0a9e('0x27')][_0x0a9e('0x43')]({'where':{'id':_0x44dd99[_0x0a9e('0x41')]['id']}})['then'](handleEntityNotFound(_0x59afe8,null))[_0x0a9e('0x1f')](saveUpdates(_0x44dd99[_0x0a9e('0x44')],null))[_0x0a9e('0x1f')](respondWithResult(_0x59afe8,null))[_0x0a9e('0x3f')](handleError(_0x59afe8,null));};exports[_0x0a9e('0x20')]=function(_0x37be73,_0x45bf7f){return db['CmCustomField'][_0x0a9e('0x43')]({'where':{'id':_0x37be73[_0x0a9e('0x41')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x45bf7f,null))[_0x0a9e('0x1f')](removeEntity(_0x45bf7f,null))[_0x0a9e('0x3f')](handleError(_0x45bf7f,null));};exports[_0x0a9e('0x45')]=function(_0x6054ee,_0x19383e){var _0x34febd;return db['sequelize'][_0x0a9e('0x46')](function(_0x3fe430){return db['CmCustomField']['create'](_0x6054ee['body'],{'transaction':_0x3fe430})[_0x0a9e('0x1f')](function(_0x4317e3){_0x34febd=_0x4317e3;var _0x37edaa={'type':db[_0x0a9e('0x47')][_0x0a9e('0x48')],'transaction':_0x3fe430};switch(_0x6054ee[_0x0a9e('0x44')][_0x0a9e('0x2a')]){case _0x0a9e('0x49'):_0x37edaa['type']=db['Sequelize']['TEXT'];break;case _0x0a9e('0x4a'):_0x37edaa[_0x0a9e('0x2a')]=db[_0x0a9e('0x47')]['INTEGER'];break;case _0x0a9e('0x4b'):_0x37edaa[_0x0a9e('0x2a')]=db['Sequelize']['BOOLEAN'];_0x37edaa[_0x0a9e('0x4c')]=![];break;default:}return db['sequelize'][_0x0a9e('0x4d')]['addColumn'](_0x0a9e('0x4e'),util[_0x0a9e('0x4f')](_0x0a9e('0x50'),_0x34febd['id']),_0x37edaa);})['then'](function(){return _0x34febd;});})[_0x0a9e('0x1f')](respondWithResult(_0x19383e,0xc9))[_0x0a9e('0x3f')](handleError(_0x19383e,null));}; \ No newline at end of file +var _0xa9e0=['end','error','name','send','index','map','CmCustomField','rawAttributes','fieldName','type','key','differenceBy','keys','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','limit','sort','where','pick','merge','field','options','includeAll','include','catch','show','params','fields','find','body','create','transaction','Sequelize','TEXT','text','number','switch','defaultValue','queryInterface','cm_contacts','format','cf_%d','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy'];(function(_0x5b8549,_0x307d3a){var _0x4250e6=function(_0x1140a3){while(--_0x1140a3){_0x5b8549['push'](_0x5b8549['shift']());}};_0x4250e6(++_0x307d3a);}(_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 as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];function respondWithStatusCode(_0x36471c,_0xd5b662){_0xd5b662=_0xd5b662||0xcc;return function(_0x26d672){if(_0x26d672){return _0x36471c[_0x0a9e('0x14')](_0xd5b662);}return _0x36471c[_0x0a9e('0x15')](_0xd5b662)['end']();};}function respondWithResult(_0x4283ce,_0x239b12){_0x239b12=_0x239b12||0xc8;return function(_0x2b4227){if(_0x2b4227){return _0x4283ce[_0x0a9e('0x15')](_0x239b12)[_0x0a9e('0x16')](_0x2b4227);}};}function respondWithFilteredResult(_0x4d5611,_0x52a03d){return function(_0x22dccb){if(_0x22dccb){var _0x5d0880=_0x22dccb[_0x0a9e('0x17')],_0x1985b6=_0x52a03d['offset'],_0x519dfd=_0x52a03d[_0x0a9e('0x18')]+_0x52a03d['limit'],_0x16033c;if(_0x519dfd>=_0x5d0880){_0x519dfd=_0x5d0880;_0x16033c=0xc8;}else{_0x16033c=0xce;}_0x4d5611[_0x0a9e('0x15')](_0x16033c);return _0x4d5611[_0x0a9e('0x19')](_0x0a9e('0x1a'),_0x1985b6+'-'+_0x519dfd+'/'+_0x5d0880)[_0x0a9e('0x16')](_0x22dccb);}return null;};}function patchUpdates(_0x31b1ca){return function(_0x2eb11f){try{jsonpatch[_0x0a9e('0x1b')](_0x2eb11f,_0x31b1ca,!![]);}catch(_0x20559e){return BPromise[_0x0a9e('0x1c')](_0x20559e);}return _0x2eb11f[_0x0a9e('0x1d')]();};}function saveUpdates(_0x1c696a,_0x105080){return function(_0x4bb1e3){if(_0x4bb1e3){return _0x4bb1e3[_0x0a9e('0x1e')](_0x1c696a)[_0x0a9e('0x1f')](function(_0x53682f){return _0x53682f;});}return null;};}function removeEntity(_0x20f109,_0x5a09ef){return function(_0x588269){if(_0x588269){return _0x588269[_0x0a9e('0x20')]()[_0x0a9e('0x1f')](function(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x21')]();});}};}function handleEntityNotFound(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(!_0x2fb0e4){_0x4abc77[_0x0a9e('0x14')](0x194);}return _0x2fb0e4;};}function handleError(_0x4d00e6,_0x370d86){_0x370d86=_0x370d86||0x1f4;return function(_0x42ac8f){logger[_0x0a9e('0x22')](_0x42ac8f['stack']);if(_0x42ac8f['name']){delete _0x42ac8f[_0x0a9e('0x23')];}_0x4d00e6[_0x0a9e('0x15')](_0x370d86)[_0x0a9e('0x24')](_0x42ac8f);};}exports[_0x0a9e('0x25')]=function(_0x526cf3,_0x384319){var _0x479bc4={},_0x45a1e7={},_0x5bfb33={'count':0x0,'rows':[]};var _0x1dc186=_[_0x0a9e('0x26')](db[_0x0a9e('0x27')][_0x0a9e('0x28')],function(_0x140511){return{'name':_0x140511[_0x0a9e('0x29')],'type':_0x140511[_0x0a9e('0x2a')][_0x0a9e('0x2b')]};});_0x45a1e7['model']=_[_0x0a9e('0x2c')](_[_0x0a9e('0x26')](_0x1dc186,_0x0a9e('0x23')),[_0x0a9e('0x23')]);_0x45a1e7['query']=_[_0x0a9e('0x2d')](_0x526cf3[_0x0a9e('0x2e')]);_0x45a1e7[_0x0a9e('0x2f')]=_[_0x0a9e('0x30')](_0x45a1e7[_0x0a9e('0x31')],_0x45a1e7[_0x0a9e('0x2e')]);_0x479bc4[_0x0a9e('0x32')]=_[_0x0a9e('0x30')](_0x45a1e7[_0x0a9e('0x31')],qs['fields'](_0x526cf3[_0x0a9e('0x2e')]['fields']));_0x479bc4[_0x0a9e('0x32')]=_0x479bc4[_0x0a9e('0x32')][_0x0a9e('0x33')]?_0x479bc4[_0x0a9e('0x32')]:_0x45a1e7[_0x0a9e('0x31')];if(!_0x526cf3['query'][_0x0a9e('0x34')](_0x0a9e('0x35'))){_0x479bc4[_0x0a9e('0x36')]=qs[_0x0a9e('0x36')](_0x526cf3[_0x0a9e('0x2e')][_0x0a9e('0x36')]);_0x479bc4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x526cf3['query'][_0x0a9e('0x18')]);}_0x479bc4['order']=qs[_0x0a9e('0x37')](_0x526cf3[_0x0a9e('0x2e')][_0x0a9e('0x37')]);_0x479bc4[_0x0a9e('0x38')]=qs['filters'](_[_0x0a9e('0x39')](_0x526cf3[_0x0a9e('0x2e')],_0x45a1e7[_0x0a9e('0x2f')]));if(_0x526cf3[_0x0a9e('0x2e')]['filter']){_0x479bc4['where']=_[_0x0a9e('0x3a')](_0x479bc4['where'],{'$or':_[_0x0a9e('0x26')](_0x1dc186,function(_0x3d9717){if(_0x3d9717[_0x0a9e('0x2a')][_0x0a9e('0x2b')]!=='VIRTUAL'){var _0x31916f={};_0x31916f[_0x3d9717[_0x0a9e('0x3b')]]={'$like':'%'+_0x526cf3[_0x0a9e('0x2e')]['filter']+'%'};return _0x31916f;}})});}_0x479bc4=_[_0x0a9e('0x3a')]({},_0x479bc4,_0x526cf3[_0x0a9e('0x3c')]);var _0x289467={'where':_0x479bc4['where']};return db['CmCustomField'][_0x0a9e('0x17')](_0x289467)[_0x0a9e('0x1f')](function(_0x5adda1){_0x5bfb33[_0x0a9e('0x17')]=_0x5adda1;if(_0x526cf3[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0x479bc4[_0x0a9e('0x3e')]=[{'all':!![]}];}return db['CmCustomField']['findAll'](_0x479bc4);})[_0x0a9e('0x1f')](function(_0x45b3d0){_0x5bfb33['rows']=_0x45b3d0;return _0x5bfb33;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x384319,_0x479bc4))[_0x0a9e('0x3f')](handleError(_0x384319,null));};exports[_0x0a9e('0x40')]=function(_0x5b4f5e,_0x316c8f){var _0x2cfea9={'raw':!![],'where':{'id':_0x5b4f5e[_0x0a9e('0x41')]['id']}},_0x274e8e={};_0x274e8e[_0x0a9e('0x31')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x27')][_0x0a9e('0x28')]);_0x274e8e[_0x0a9e('0x2e')]=_[_0x0a9e('0x2d')](_0x5b4f5e[_0x0a9e('0x2e')]);_0x274e8e[_0x0a9e('0x2f')]=_[_0x0a9e('0x30')](_0x274e8e[_0x0a9e('0x31')],_0x274e8e[_0x0a9e('0x2e')]);_0x2cfea9['attributes']=_['intersection'](_0x274e8e[_0x0a9e('0x31')],qs[_0x0a9e('0x42')](_0x5b4f5e[_0x0a9e('0x2e')][_0x0a9e('0x42')]));_0x2cfea9[_0x0a9e('0x32')]=_0x2cfea9[_0x0a9e('0x32')][_0x0a9e('0x33')]?_0x2cfea9[_0x0a9e('0x32')]:_0x274e8e[_0x0a9e('0x31')];if(_0x5b4f5e[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0x2cfea9[_0x0a9e('0x3e')]=[{'all':!![]}];}_0x2cfea9=_['merge']({},_0x2cfea9,_0x5b4f5e[_0x0a9e('0x3c')]);return db[_0x0a9e('0x27')][_0x0a9e('0x43')](_0x2cfea9)[_0x0a9e('0x1f')](handleEntityNotFound(_0x316c8f,null))[_0x0a9e('0x1f')](respondWithResult(_0x316c8f,null))[_0x0a9e('0x3f')](handleError(_0x316c8f,null));};exports[_0x0a9e('0x1e')]=function(_0x44dd99,_0x59afe8){if(_0x44dd99[_0x0a9e('0x44')]['id']){delete _0x44dd99['body']['id'];}return db[_0x0a9e('0x27')][_0x0a9e('0x43')]({'where':{'id':_0x44dd99[_0x0a9e('0x41')]['id']}})['then'](handleEntityNotFound(_0x59afe8,null))[_0x0a9e('0x1f')](saveUpdates(_0x44dd99[_0x0a9e('0x44')],null))[_0x0a9e('0x1f')](respondWithResult(_0x59afe8,null))[_0x0a9e('0x3f')](handleError(_0x59afe8,null));};exports[_0x0a9e('0x20')]=function(_0x37be73,_0x45bf7f){return db['CmCustomField'][_0x0a9e('0x43')]({'where':{'id':_0x37be73[_0x0a9e('0x41')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x45bf7f,null))[_0x0a9e('0x1f')](removeEntity(_0x45bf7f,null))[_0x0a9e('0x3f')](handleError(_0x45bf7f,null));};exports[_0x0a9e('0x45')]=function(_0x6054ee,_0x19383e){var _0x34febd;return db['sequelize'][_0x0a9e('0x46')](function(_0x3fe430){return db['CmCustomField']['create'](_0x6054ee['body'],{'transaction':_0x3fe430})[_0x0a9e('0x1f')](function(_0x4317e3){_0x34febd=_0x4317e3;var _0x37edaa={'type':db[_0x0a9e('0x47')][_0x0a9e('0x48')],'transaction':_0x3fe430};switch(_0x6054ee[_0x0a9e('0x44')][_0x0a9e('0x2a')]){case _0x0a9e('0x49'):_0x37edaa['type']=db['Sequelize']['TEXT'];break;case _0x0a9e('0x4a'):_0x37edaa[_0x0a9e('0x2a')]=db[_0x0a9e('0x47')]['INTEGER'];break;case _0x0a9e('0x4b'):_0x37edaa[_0x0a9e('0x2a')]=db['Sequelize']['BOOLEAN'];_0x37edaa[_0x0a9e('0x4c')]=![];break;default:}return db['sequelize'][_0x0a9e('0x4d')]['addColumn'](_0x0a9e('0x4e'),util[_0x0a9e('0x4f')](_0x0a9e('0x50'),_0x34febd['id']),_0x37edaa);})['then'](function(){return _0x34febd;});})[_0x0a9e('0x1f')](respondWithResult(_0x19383e,0xc9))[_0x0a9e('0x3f')](handleError(_0x19383e,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index e3d4c92..8dea907 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 _0x5001=['./cmCustomField.attributes','exports','define','cm_custom_fields','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x13b1fa,_0x575222){var _0x53697e=function(_0x39c5ab){while(--_0x39c5ab){_0x13b1fa['push'](_0x13b1fa['shift']());}};_0x53697e(++_0x575222);}(_0x5001,0xd0));var _0x1500=function(_0x22e222,_0x16a918){_0x22e222=_0x22e222-0x0;var _0x20f74d=_0x5001[_0x22e222];return _0x20f74d;};'use strict';var _=require('lodash');var util=require(_0x1500('0x0'));var logger=require(_0x1500('0x1'))(_0x1500('0x2'));var moment=require(_0x1500('0x3'));var BPromise=require(_0x1500('0x4'));var rp=require(_0x1500('0x5'));var fs=require('fs');var path=require(_0x1500('0x6'));var rimraf=require(_0x1500('0x7'));var config=require('../../config/environment');var attributes=require(_0x1500('0x8'));module[_0x1500('0x9')]=function(_0x209467,_0x4dd00f){return _0x209467[_0x1500('0xa')]('CmCustomField',attributes,{'tableName':_0x1500('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7911=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./cmCustomField.attributes','define','CmCustomField','lodash','util'];(function(_0x2fd986,_0x1013b9){var _0x3d2ea1=function(_0x3141cc){while(--_0x3141cc){_0x2fd986['push'](_0x2fd986['shift']());}};_0x3d2ea1(++_0x1013b9);}(_0x7911,0x8d));var _0x1791=function(_0x3ec122,_0x55150a){_0x3ec122=_0x3ec122-0x0;var _0x4ecf41=_0x7911[_0x3ec122];return _0x4ecf41;};'use strict';var _=require(_0x1791('0x0'));var util=require(_0x1791('0x1'));var logger=require('../../config/logger')(_0x1791('0x2'));var moment=require(_0x1791('0x3'));var BPromise=require(_0x1791('0x4'));var rp=require(_0x1791('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1791('0x6'));var config=require(_0x1791('0x7'));var attributes=require(_0x1791('0x8'));module['exports']=function(_0x2926f3,_0x49bcd8){return _0x2926f3[_0x1791('0x9')](_0x1791('0xa'),attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index 6162d5b..dc16489 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 _0x9c44=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','request\x20sent','debug','stringify','code','error','message','CmCustomField,\x20%s,\x20%s','info','result','catch','moment','bluebird'];(function(_0x440c3a,_0x1e6304){var _0x2c3bc2=function(_0xf66ad8){while(--_0xf66ad8){_0x440c3a['push'](_0x440c3a['shift']());}};_0x2c3bc2(++_0x1e6304);}(_0x9c44,0x178));var _0x49c4=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x9c44[_0x24061a];return _0x82054e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var BPromise=require(_0x49c4('0x1'));var rs=require(_0x49c4('0x2'));var fs=require('fs');var Redis=require(_0x49c4('0x3'));var db=require(_0x49c4('0x4'))['db'];var utils=require(_0x49c4('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x49c4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x7')][_0x49c4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x69bc41,_0x2c4e2e,_0x436234){return new BPromise(function(_0x511d53,_0x11c586){return client[_0x49c4('0x9')](_0x69bc41,_0x436234)[_0x49c4('0xa')](function(_0x4487ca){logger['info']('CmCustomField,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));logger[_0x49c4('0xc')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'),JSON[_0x49c4('0xd')](_0x4487ca));if(_0x4487ca['error']){if(_0x4487ca['error'][_0x49c4('0xe')]===0x1f4){logger[_0x49c4('0xf')]('CmCustomField,\x20%s,\x20%s',_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x11c586(_0x4487ca['error'][_0x49c4('0x10')]);}logger[_0x49c4('0xf')](_0x49c4('0x11'),_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x511d53(_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);}else{logger[_0x49c4('0x12')]('CmCustomField,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));_0x511d53(_0x4487ca[_0x49c4('0x13')][_0x49c4('0x10')]);}})[_0x49c4('0x14')](function(_0x2abc78){logger['error'](_0x49c4('0x11'),_0x2c4e2e,_0x2abc78);_0x11c586(_0x2abc78);});});} \ No newline at end of file +var _0xb66c=['../../config/environment','jayson/promise','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x2dc826,_0x8acd16){var _0x18ffa3=function(_0x50a277){while(--_0x50a277){_0x2dc826['push'](_0x2dc826['shift']());}};_0x18ffa3(++_0x8acd16);}(_0xb66c,0x175));var _0xcb66=function(_0x7f217,_0xa135b7){_0x7f217=_0x7f217-0x0;var _0x91eb6=_0xb66c[_0x7f217];return _0x91eb6;};'use strict';var _=require(_0xcb66('0x0'));var util=require('util');var moment=require(_0xcb66('0x1'));var BPromise=require('bluebird');var rs=require(_0xcb66('0x2'));var fs=require('fs');var Redis=require(_0xcb66('0x3'));var db=require(_0xcb66('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xcb66('0x5'))(_0xcb66('0x6'));var config=require(_0xcb66('0x7'));var jayson=require(_0xcb66('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19adf5,_0x1b6852,_0xa3993){return new BPromise(function(_0x439f3d,_0xf7bc39){return client['request'](_0x19adf5,_0xa3993)[_0xcb66('0x9')](function(_0x3047f7){logger[_0xcb66('0xa')](_0xcb66('0xb'),_0x1b6852,_0xcb66('0xc'));logger['debug'](_0xcb66('0xd'),_0x1b6852,_0xcb66('0xc'),JSON[_0xcb66('0xe')](_0x3047f7));if(_0x3047f7[_0xcb66('0xf')]){if(_0x3047f7['error'][_0xcb66('0x10')]===0x1f4){logger[_0xcb66('0xf')](_0xcb66('0xb'),_0x1b6852,_0x3047f7[_0xcb66('0xf')]['message']);return _0xf7bc39(_0x3047f7[_0xcb66('0xf')][_0xcb66('0x11')]);}logger[_0xcb66('0xf')](_0xcb66('0xb'),_0x1b6852,_0x3047f7['error'][_0xcb66('0x11')]);return _0x439f3d(_0x3047f7['error'][_0xcb66('0x11')]);}else{logger['info'](_0xcb66('0xb'),_0x1b6852,'request\x20sent');_0x439f3d(_0x3047f7['result'][_0xcb66('0x11')]);}})[_0xcb66('0x12')](function(_0x681ce3){logger[_0xcb66('0xf')]('CmCustomField,\x20%s,\x20%s',_0x1b6852,_0x681ce3);_0xf7bc39(_0x681ce3);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index cdef1af..a4dd57f 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 _0x39cd=['util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','index','show','post','put','/:id','update','delete','destroy','exports','multer'];(function(_0x5d65d6,_0x1392c8){var _0x2f42a1=function(_0xcce8f0){while(--_0xcce8f0){_0x5d65d6['push'](_0x5d65d6['shift']());}};_0x2f42a1(++_0x1392c8);}(_0x39cd,0x11c));var _0xd39c=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0x39cd[_0x4ff09b];return _0x3f5c2e;};'use strict';var multer=require(_0xd39c('0x0'));var util=require(_0xd39c('0x1'));var path=require('path');var timeout=require(_0xd39c('0x2'));var express=require(_0xd39c('0x3'));var router=express[_0xd39c('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xd39c('0x5'));var config=require(_0xd39c('0x6'));var controller=require(_0xd39c('0x7'));router[_0xd39c('0x8')]('/',auth[_0xd39c('0x9')](),controller[_0xd39c('0xa')]);router[_0xd39c('0x8')]('/:id',auth[_0xd39c('0x9')](),controller[_0xd39c('0xb')]);router[_0xd39c('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd39c('0xd')](_0xd39c('0xe'),auth[_0xd39c('0x9')](),controller[_0xd39c('0xf')]);router[_0xd39c('0x10')](_0xd39c('0xe'),auth[_0xd39c('0x9')](),controller[_0xd39c('0x11')]);module[_0xd39c('0x12')]=router; \ No newline at end of file +var _0x5ff4=['../../components/auth/service','./cmCustomField.controller','get','index','isAuthenticated','show','create','/:id','destroy','exports','multer','util','path','connect-timeout','Router'];(function(_0x1bf914,_0x11bcab){var _0x52b711=function(_0x34e469){while(--_0x34e469){_0x1bf914['push'](_0x1bf914['shift']());}};_0x52b711(++_0x11bcab);}(_0x5ff4,0x172));var _0x45ff=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0x5ff4[_0x21549c];return _0x426cbd;};'use strict';var multer=require(_0x45ff('0x0'));var util=require(_0x45ff('0x1'));var path=require(_0x45ff('0x2'));var timeout=require(_0x45ff('0x3'));var express=require('express');var router=express[_0x45ff('0x4')]();var auth=require(_0x45ff('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x45ff('0x6'));router[_0x45ff('0x7')]('/',auth['isAuthenticated'](),controller[_0x45ff('0x8')]);router[_0x45ff('0x7')]('/:id',auth[_0x45ff('0x9')](),controller[_0x45ff('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0x45ff('0xb')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x45ff('0xc'),auth['isAuthenticated'](),controller[_0x45ff('0xd')]);module[_0x45ff('0xe')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 7912158..2464f59 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 _0xd7fa=['INTEGER','DATE','contactListQueue','moment','sequelize','exports','STRING','BOOLEAN','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x2698f4,_0x3f5609){var _0x43ed02=function(_0x17a314){while(--_0x17a314){_0x2698f4['push'](_0x2698f4['shift']());}};_0x43ed02(++_0x3f5609);}(_0xd7fa,0xfd));var _0xad7f=function(_0x5e0af1,_0x1bbe16){_0x5e0af1=_0x5e0af1-0x0;var _0x129dff=_0xd7fa[_0x5e0af1];return _0x129dff;};'use strict';var moment=require(_0xad7f('0x0'));var Sequelize=require(_0xad7f('0x1'));module[_0xad7f('0x2')]={'phone':{'type':Sequelize[_0xad7f('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0xad7f('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0xad7f('0x5')](_0xad7f('0x6'))},'countbusyretry':{'type':Sequelize[_0xad7f('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xad7f('0x7')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize[_0xad7f('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xad7f('0x8')]},'priority':{'type':Sequelize[_0xad7f('0x7')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xad7f('0x4')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xad7f('0x7')],'unique':_0xad7f('0x9')},'ListId':{'type':Sequelize[_0xad7f('0x7')],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0xad7f('0x7')]},'VoiceQueueId':{'type':Sequelize[_0xad7f('0x7')],'unique':_0xad7f('0x9')},'CampaignId':{'type':Sequelize[_0xad7f('0x7')]}}; \ No newline at end of file +var _0x635c=['exports','STRING','BOOLEAN','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','sequelize'];(function(_0x3f8218,_0x4a20d6){var _0x274605=function(_0x1fa787){while(--_0x1fa787){_0x3f8218['push'](_0x3f8218['shift']());}};_0x274605(++_0x4a20d6);}(_0x635c,0xa1));var _0xc635=function(_0x1223c4,_0x3bbd2b){_0x1223c4=_0x1223c4-0x0;var _0x4b217f=_0x635c[_0x1223c4];return _0x4b217f;};'use strict';var moment=require('moment');var Sequelize=require(_0xc635('0x0'));module[_0xc635('0x1')]={'phone':{'type':Sequelize[_0xc635('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0xc635('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0xc635('0x4')](_0xc635('0x5'))},'countbusyretry':{'type':Sequelize[_0xc635('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xc635('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xc635('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xc635('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xc635('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize[_0xc635('0x6')](0x2)[_0xc635('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xc635('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0xc635('0x8')},'ListId':{'type':Sequelize[_0xc635('0x6')],'unique':_0xc635('0x8')},'UserId':{'type':Sequelize[_0xc635('0x6')]},'VoiceQueueId':{'type':Sequelize[_0xc635('0x6')],'unique':_0xc635('0x8')},'CampaignId':{'type':Sequelize[_0xc635('0x6')]}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index f54d684..d493413 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 _0xd757=['outbound','preview','dialOrderByScheduledAt','sequelize','format','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','LOCK','UPDATE','Contact','Company','CmList','List','Queue','dialActive','CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts','entity\x20not\x20found','html-pdf','eml-format','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','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','status','end','count','offset','limit','set','Content-Range','json','reject','save','update','then','destroy','sendStatus','error','name','send','map','CmHopper','rawAttributes','fieldName','type','model','query','keys','filters','$and','$or','$gt','$gte','$lte','$ne','$eq','$not','$between','$notBetween','$in','$notIn','$like','$notLike','$notILike','$overlap','$contains','$contained','$any','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','key','VIRTUAL','field','options','includeAll','include','findAll','rows','show','params','find','create','body','describe','catch','CampaignId','VoiceQueueId','VoiceQueue','Campaign','dataValues','updatedAt','statedesc','deleted','campaign','membername','user','deletedat','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','queue','ivr','ContactId','lastName','isNil','firstName','calleridname','finally','getPreview','CmContact','getVoiceQueues'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xd757,0x1e5));var _0x7d75=function(_0x2f182c,_0x1acb77){_0x2f182c=_0x2f182c-0x0;var _0x161c42=_0xd757[_0x2f182c];return _0x161c42;};'use strict';var pdf=require(_0x7d75('0x0'));var emlformat=require(_0x7d75('0x1'));var rimraf=require(_0x7d75('0x2'));var zipdir=require(_0x7d75('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7d75('0x4'));var BPromise=require(_0x7d75('0x5'));var Mustache=require('mustache');var util=require(_0x7d75('0x6'));var path=require(_0x7d75('0x7'));var sox=require(_0x7d75('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x7d75('0x9'));var squel=require(_0x7d75('0xa'));var crypto=require(_0x7d75('0xb'));var jsforce=require(_0x7d75('0xc'));var deskjs=require(_0x7d75('0xd'));var toCsv=require(_0x7d75('0xe'));var querystring=require(_0x7d75('0xf'));var Papa=require(_0x7d75('0x10'));var Redis=require(_0x7d75('0x11'));var authService=require(_0x7d75('0x12'));var qs=require(_0x7d75('0x13'));var as=require(_0x7d75('0x14'));var hardwareService=require(_0x7d75('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x7d75('0x16'));var config=require(_0x7d75('0x17'));var db=require(_0x7d75('0x18'))['db'];function respondWithStatusCode(_0x5ef6cf,_0x3e7b97){_0x3e7b97=_0x3e7b97||0xcc;return function(_0x3a5ca5){if(_0x3a5ca5){return _0x5ef6cf['sendStatus'](_0x3e7b97);}return _0x5ef6cf[_0x7d75('0x19')](_0x3e7b97)[_0x7d75('0x1a')]();};}function respondWithResult(_0x40bb31,_0x43e546){_0x43e546=_0x43e546||0xc8;return function(_0x2b5d23){if(_0x2b5d23){return _0x40bb31[_0x7d75('0x19')](_0x43e546)['json'](_0x2b5d23);}};}function respondWithFilteredResult(_0x8d8bb8,_0x1a460b){return function(_0x14100f){if(_0x14100f){var _0x1a9778=_0x14100f[_0x7d75('0x1b')],_0x44041e=_0x1a460b['offset'],_0x859c4=_0x1a460b[_0x7d75('0x1c')]+_0x1a460b[_0x7d75('0x1d')],_0x5b0dc3;if(_0x859c4>=_0x1a9778){_0x859c4=_0x1a9778;_0x5b0dc3=0xc8;}else{_0x5b0dc3=0xce;}_0x8d8bb8[_0x7d75('0x19')](_0x5b0dc3);return _0x8d8bb8[_0x7d75('0x1e')](_0x7d75('0x1f'),_0x44041e+'-'+_0x859c4+'/'+_0x1a9778)[_0x7d75('0x20')](_0x14100f);}return null;};}function patchUpdates(_0x17a61c){return function(_0x250c7b){try{jsonpatch['apply'](_0x250c7b,_0x17a61c,!![]);}catch(_0x4fb547){return BPromise[_0x7d75('0x21')](_0x4fb547);}return _0x250c7b[_0x7d75('0x22')]();};}function saveUpdates(_0x404257,_0xbb0322){return function(_0x47a5f0){if(_0x47a5f0){return _0x47a5f0[_0x7d75('0x23')](_0x404257)[_0x7d75('0x24')](function(_0x103056){return _0x103056;});}return null;};}function removeEntity(_0x3b10c2,_0x232c46){return function(_0x187093){if(_0x187093){return _0x187093[_0x7d75('0x25')]()[_0x7d75('0x24')](function(){_0x3b10c2[_0x7d75('0x19')](0xcc)[_0x7d75('0x1a')]();});}};}function handleEntityNotFound(_0x3be591,_0x21211b){return function(_0x323e20){if(!_0x323e20){_0x3be591[_0x7d75('0x26')](0x194);}return _0x323e20;};}function handleError(_0x1e32d6,_0x338e26){_0x338e26=_0x338e26||0x1f4;return function(_0x1d1ecf){logger[_0x7d75('0x27')](_0x1d1ecf['stack']);if(_0x1d1ecf[_0x7d75('0x28')]){delete _0x1d1ecf[_0x7d75('0x28')];}_0x1e32d6['status'](_0x338e26)[_0x7d75('0x29')](_0x1d1ecf);};}exports['index']=function(_0x3849c3,_0x37456d){var _0x17d83a={},_0xe66bff={},_0x447969={'count':0x0,'rows':[]};var _0x5623d1=_[_0x7d75('0x2a')](db[_0x7d75('0x2b')][_0x7d75('0x2c')],function(_0xb0c225){return{'name':_0xb0c225[_0x7d75('0x2d')],'type':_0xb0c225[_0x7d75('0x2e')]['key']};});_0xe66bff[_0x7d75('0x2f')]=_[_0x7d75('0x2a')](_0x5623d1,_0x7d75('0x28'));_0xe66bff[_0x7d75('0x30')]=_[_0x7d75('0x31')](_0x3849c3[_0x7d75('0x30')]);_0xe66bff[_0x7d75('0x32')]=_['intersection'](_0xe66bff['model'],_0xe66bff['query']);_0xe66bff[_0x7d75('0x32')]=_['concat'](_0xe66bff[_0x7d75('0x32')],[_0x7d75('0x33'),_0x7d75('0x34'),_0x7d75('0x35'),_0x7d75('0x36'),'$lt',_0x7d75('0x37'),_0x7d75('0x38'),_0x7d75('0x39'),_0x7d75('0x3a'),_0x7d75('0x3b'),_0x7d75('0x3c'),_0x7d75('0x3d'),_0x7d75('0x3e'),_0x7d75('0x3f'),_0x7d75('0x40'),'$iLike',_0x7d75('0x41'),_0x7d75('0x3f'),_0x7d75('0x42'),_0x7d75('0x43'),_0x7d75('0x44'),_0x7d75('0x45')]);_0x17d83a['attributes']=_[_0x7d75('0x46')](_0xe66bff[_0x7d75('0x2f')],qs['fields'](_0x3849c3['query'][_0x7d75('0x47')]));_0x17d83a[_0x7d75('0x48')]=_0x17d83a[_0x7d75('0x48')][_0x7d75('0x49')]?_0x17d83a[_0x7d75('0x48')]:_0xe66bff[_0x7d75('0x2f')];if(!_0x3849c3['query'][_0x7d75('0x4a')](_0x7d75('0x4b'))){_0x17d83a['limit']=qs[_0x7d75('0x1d')](_0x3849c3[_0x7d75('0x30')][_0x7d75('0x1d')]);_0x17d83a[_0x7d75('0x1c')]=qs[_0x7d75('0x1c')](_0x3849c3[_0x7d75('0x30')][_0x7d75('0x1c')]);}_0x17d83a[_0x7d75('0x4c')]=qs[_0x7d75('0x4d')](_0x3849c3[_0x7d75('0x30')][_0x7d75('0x4d')]);_0x17d83a[_0x7d75('0x4e')]=qs[_0x7d75('0x32')](_[_0x7d75('0x4f')](_0x3849c3[_0x7d75('0x30')],_0xe66bff[_0x7d75('0x32')]));if(_0x3849c3[_0x7d75('0x30')][_0x7d75('0x50')]){_0x17d83a[_0x7d75('0x4e')]=_[_0x7d75('0x51')](_0x17d83a['where'],{'$or':_['map'](_0x5623d1,function(_0x33ab8f){if(_0x33ab8f[_0x7d75('0x2e')][_0x7d75('0x52')]!==_0x7d75('0x53')){var _0x222ece={};_0x222ece[_0x33ab8f[_0x7d75('0x54')]]={'$like':'%'+_0x3849c3[_0x7d75('0x30')]['filter']+'%'};return _0x222ece;}})});}_0x17d83a=_[_0x7d75('0x51')]({},_0x17d83a,_0x3849c3[_0x7d75('0x55')]);var _0x42a57e={'where':_0x17d83a['where']};return db[_0x7d75('0x2b')][_0x7d75('0x1b')](_0x42a57e)[_0x7d75('0x24')](function(_0x1f20e8){_0x447969[_0x7d75('0x1b')]=_0x1f20e8;if(_0x3849c3[_0x7d75('0x30')][_0x7d75('0x56')]){_0x17d83a[_0x7d75('0x57')]=[{'all':!![]}];}return db[_0x7d75('0x2b')][_0x7d75('0x58')](_0x17d83a);})[_0x7d75('0x24')](function(_0x4c8f60){_0x447969[_0x7d75('0x59')]=_0x4c8f60;return _0x447969;})['then'](respondWithFilteredResult(_0x37456d,_0x17d83a))['catch'](handleError(_0x37456d,null));};exports[_0x7d75('0x5a')]=function(_0x547667,_0x1882ff){var _0x32ee99={'raw':!![],'where':{'id':_0x547667[_0x7d75('0x5b')]['id']}},_0x4dfa00={};_0x4dfa00[_0x7d75('0x2f')]=_[_0x7d75('0x31')](db[_0x7d75('0x2b')][_0x7d75('0x2c')]);_0x4dfa00[_0x7d75('0x30')]=_[_0x7d75('0x31')](_0x547667[_0x7d75('0x30')]);_0x4dfa00['filters']=_[_0x7d75('0x46')](_0x4dfa00[_0x7d75('0x2f')],_0x4dfa00[_0x7d75('0x30')]);_0x32ee99['attributes']=_[_0x7d75('0x46')](_0x4dfa00[_0x7d75('0x2f')],qs[_0x7d75('0x47')](_0x547667[_0x7d75('0x30')][_0x7d75('0x47')]));_0x32ee99[_0x7d75('0x48')]=_0x32ee99['attributes'][_0x7d75('0x49')]?_0x32ee99[_0x7d75('0x48')]:_0x4dfa00[_0x7d75('0x2f')];if(_0x547667[_0x7d75('0x30')][_0x7d75('0x56')]){_0x32ee99[_0x7d75('0x57')]=[{'all':!![]}];}_0x32ee99=_['merge']({},_0x32ee99,_0x547667[_0x7d75('0x55')]);return db[_0x7d75('0x2b')][_0x7d75('0x5c')](_0x32ee99)['then'](handleEntityNotFound(_0x1882ff,null))[_0x7d75('0x24')](respondWithResult(_0x1882ff,null))['catch'](handleError(_0x1882ff,null));};exports[_0x7d75('0x5d')]=function(_0x489140,_0x201d71){return db[_0x7d75('0x2b')][_0x7d75('0x5d')](_0x489140['body'],{})[_0x7d75('0x24')](respondWithResult(_0x201d71,0xc9))['catch'](handleError(_0x201d71,null));};exports[_0x7d75('0x23')]=function(_0x369652,_0x2e9b8c){if(_0x369652[_0x7d75('0x5e')]['id']){delete _0x369652[_0x7d75('0x5e')]['id'];}return db['CmHopper']['find']({'where':{'id':_0x369652[_0x7d75('0x5b')]['id']}})['then'](handleEntityNotFound(_0x2e9b8c,null))[_0x7d75('0x24')](saveUpdates(_0x369652[_0x7d75('0x5e')],null))[_0x7d75('0x24')](respondWithResult(_0x2e9b8c,null))['catch'](handleError(_0x2e9b8c,null));};exports[_0x7d75('0x5f')]=function(_0x41df1e,_0xa39a1b){return db[_0x7d75('0x2b')][_0x7d75('0x5f')]()['then'](respondWithResult(_0xa39a1b,null))[_0x7d75('0x60')](handleError(_0xa39a1b,null));};exports[_0x7d75('0x25')]=function(_0x3a9621,_0x4ae079){var _0x4d2df5;return db[_0x7d75('0x2b')]['find']({'where':{'id':_0x3a9621['params']['id']}})[_0x7d75('0x24')](handleEntityNotFound(_0x4ae079,null))[_0x7d75('0x24')](function(_0x4f7b4e){if(_0x4f7b4e){return _0x4f7b4e[_0x7d75('0x25')]()[_0x7d75('0x24')](function(_0x5b1fba){return _0x5b1fba;});}})[_0x7d75('0x24')](function(_0x7ebe82){_0x4d2df5=_0x7ebe82;if(_0x7ebe82){if(_0x7ebe82['VoiceQueueId']||_0x7ebe82[_0x7d75('0x61')]){return db[_0x7ebe82[_0x7d75('0x62')]?_0x7d75('0x63'):_0x7d75('0x64')][_0x7d75('0x5c')]({'where':{'id':_0x7ebe82[_0x7d75('0x62')]?_0x7ebe82[_0x7d75('0x62')]:_0x7ebe82[_0x7d75('0x61')]},'attributes':['id',_0x7d75('0x28')],'raw':!![]});}}})[_0x7d75('0x24')](function(_0xd06f9a){var _0x515ad1={};if(_0xd06f9a){_[_0x7d75('0x51')](_0x515ad1,_['omit'](_0x4d2df5[_0x7d75('0x65')],['createdAt',_0x7d75('0x66'),'id']));_0x515ad1['state']=0x15;_0x515ad1[_0x7d75('0x67')]=_0x7d75('0x68');_0x515ad1[_0x7d75('0x69')]=_0xd06f9a['name'];_0x515ad1[_0x7d75('0x6a')]=_0x3a9621[_0x7d75('0x6b')][_0x7d75('0x28')];_0x515ad1['UserId']=_0x3a9621[_0x7d75('0x6b')]['id'];_0x515ad1['deleted']=!![];_0x515ad1[_0x7d75('0x6c')]=moment()['format'](_0x7d75('0x6d'));_0x515ad1[_0x7d75('0x6e')]=_0x4d2df5[_0x7d75('0x6f')];_0x515ad1['campaigntype']=_0x4d2df5['VoiceQueueId']?_0x7d75('0x70'):_0x7d75('0x71');return db['CmContact']['find']({'where':{'id':_0x515ad1[_0x7d75('0x72')]},'attributes':['firstName',_0x7d75('0x73')]})[_0x7d75('0x24')](function(_0x31572d){if(!_['isNil'](_0x4ae079)&&!_[_0x7d75('0x74')](_0x31572d[_0x7d75('0x75')])){_0x515ad1['calleridname']=_0x31572d[_0x7d75('0x75')];if(!_['isNil'](_0x31572d[_0x7d75('0x73')])){_0x515ad1[_0x7d75('0x76')]+='\x20'+_0x31572d[_0x7d75('0x73')];}}})[_0x7d75('0x77')](function(){return db['CmHopperFinal'][_0x7d75('0x5d')](_0x515ad1);});}})[_0x7d75('0x24')](function(){return _0x4ae079[_0x7d75('0x19')](0xcc)[_0x7d75('0x1a')]();})[_0x7d75('0x60')](handleError(_0x4ae079,null));};exports[_0x7d75('0x78')]=function(_0x45acce,_0x239dff,_0x854785){var _0x1432f9=[];return db[_0x7d75('0x79')][_0x7d75('0x5f')]()['then'](function(_0x5ab782){_0x1432f9=_[_0x7d75('0x31')](_0x5ab782);return _0x45acce['user'][_0x7d75('0x7a')]({'where':{'type':_0x7d75('0x7b'),'dialActive':!![],'dialMethod':_0x7d75('0x7c')},'attributes':['id',_0x7d75('0x7d')],'raw':!![]});})[_0x7d75('0x24')](function(_0x560c1c){if(_0x560c1c&&_0x560c1c[_0x7d75('0x49')]){return db[_0x7d75('0x7e')]['transaction'](function(_0x4c0835){var _0x143cc5={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x7d75('0x7f')](_0x7d75('0x6d'))},'VoiceQueueId':{'$in':_[_0x7d75('0x2a')](_0x560c1c,'id')},'$or':[{'UserId':null},{'UserId':_0x45acce[_0x7d75('0x6b')]['id']}]};var _0x3b210b=[];if(_0x45acce[_0x7d75('0x5e')][_0x7d75('0x80')]&&_0x45acce[_0x7d75('0x5e')]['direction']===_0x7d75('0x81')){if(!_[_0x7d75('0x82')](_0x45acce[_0x7d75('0x5e')][_0x7d75('0x83')])){_0x143cc5['id']={'$in':_0x45acce[_0x7d75('0x5e')]['hopperIds']};}_0x3b210b=[[_0x7d75('0x84'),_0x7d75('0x85')],[_0x7d75('0x86'),_0x560c1c[0x0]['dialOrderByScheduledAt']==='ASC'?_0x7d75('0x87'):_0x7d75('0x85')],db[_0x7d75('0x7e')][_0x7d75('0x88')](_0x7d75('0x89')),['id',_0x7d75('0x87')]];}else{if(!_[_0x7d75('0x82')](_0x45acce[_0x7d75('0x5e')][_0x7d75('0x83')])){_0x143cc5['id']={'$notIn':_0x45acce['body'][_0x7d75('0x83')]};}_0x3b210b=[[_0x7d75('0x84'),'DESC'],[_0x7d75('0x86'),_0x560c1c[0x0][_0x7d75('0x7d')]],db[_0x7d75('0x7e')][_0x7d75('0x88')](_0x7d75('0x8a')),['id',_0x7d75('0x85')]];}return db[_0x7d75('0x2b')][_0x7d75('0x8b')]({'attributes':['id',_0x7d75('0x8c')],'where':_0x143cc5,'order':_0x3b210b,'transaction':_0x4c0835,'lock':_0x4c0835[_0x7d75('0x8d')][_0x7d75('0x8e')],'include':[{'model':db[_0x7d75('0x79')],'as':_0x7d75('0x8f'),'attributes':_0x1432f9,'include':[{'model':db['CmCompany'],'as':_0x7d75('0x90'),'attributes':['id',_0x7d75('0x28')]}]},{'model':db[_0x7d75('0x91')],'as':_0x7d75('0x92'),'attributes':['id','name']},{'model':db[_0x7d75('0x63')],'as':_0x7d75('0x93'),'attributes':['id',_0x7d75('0x28'),_0x7d75('0x94')]}]})[_0x7d75('0x24')](function(_0x303fe2){if(_0x303fe2){return _0x303fe2['update']({'UserId':_0x45acce[_0x7d75('0x6b')]['id']},{'transaction':_0x4c0835});}});});}})[_0x7d75('0x24')](handleEntityNotFound(_0x239dff,null))[_0x7d75('0x24')](respondWithResult(_0x239dff,null))[_0x7d75('0x60')](handleError(_0x239dff,null));};exports['getOpenContacts']=function(_0x3ba1c1,_0x1da727,_0x2d2b54){return _0x3ba1c1[_0x7d75('0x6b')][_0x7d75('0x7a')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x7d75('0x7c')},'attributes':['id'],'raw':!![]})[_0x7d75('0x24')](function(_0x50ca10){if(_0x50ca10&&_0x50ca10['length']){return db[_0x7d75('0x2b')][_0x7d75('0x1b')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x7d75('0x6d'))},'VoiceQueueId':{'$in':_[_0x7d75('0x2a')](_0x50ca10,'id')},'$or':[{'UserId':null},{'UserId':_0x3ba1c1[_0x7d75('0x6b')]['id']}]}});}return 0x0;})['then'](function(_0x5c17db){if(!_['isNil'](_0x5c17db)&&_['isNumber'](_0x5c17db)){return _0x1da727[_0x7d75('0x19')](0xc8)[_0x7d75('0x20')]({'contacts':_0x5c17db});}else{logger[_0x7d75('0x27')](_0x7d75('0x95'),_0x7d75('0x96'),0x194,_0x7d75('0x97'));_0x1da727['sendStatus'](0x194);}})[_0x7d75('0x60')](handleError(_0x1da727,null));}; \ No newline at end of file +var _0xa7c8=['papaparse','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','update','then','error','name','send','index','map','type','key','model','query','keys','filters','concat','$or','$gt','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$in','$notLike','$iLike','$overlap','$contains','$contained','$any','attributes','intersection','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','field','options','CmHopper','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','describe','destroy','VoiceQueueId','VoiceQueue','Campaign','omit','dataValues','createdAt','statedesc','deleted','membername','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','ivr','CmContact','ContactId','firstName','lastName','isNil','CmHopperFinal','getPreview','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','sequelize','transaction','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','DESC','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','LOCK','UPDATE','CmCompany','Company','CmList','List','dialActive','getOpenContacts','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring'];(function(_0x51f10c,_0x225f9d){var _0x4fdb79=function(_0x4da4cc){while(--_0x4da4cc){_0x51f10c['push'](_0x51f10c['shift']());}};_0x4fdb79(++_0x225f9d);}(_0xa7c8,0x114));var _0x8a7c=function(_0x4dd95b,_0x2d7ee5){_0x4dd95b=_0x4dd95b-0x0;var _0x150dc2=_0xa7c8[_0x4dd95b];return _0x150dc2;};'use strict';var pdf=require(_0x8a7c('0x0'));var emlformat=require(_0x8a7c('0x1'));var rimraf=require(_0x8a7c('0x2'));var zipdir=require(_0x8a7c('0x3'));var jsonpatch=require(_0x8a7c('0x4'));var rp=require(_0x8a7c('0x5'));var moment=require('moment');var BPromise=require(_0x8a7c('0x6'));var Mustache=require(_0x8a7c('0x7'));var util=require(_0x8a7c('0x8'));var path=require(_0x8a7c('0x9'));var sox=require(_0x8a7c('0xa'));var csv=require(_0x8a7c('0xb'));var ejs=require(_0x8a7c('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x8a7c('0xd'));var crypto=require(_0x8a7c('0xe'));var jsforce=require(_0x8a7c('0xf'));var deskjs=require(_0x8a7c('0x10'));var toCsv=require(_0x8a7c('0xb'));var querystring=require(_0x8a7c('0x11'));var Papa=require(_0x8a7c('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8a7c('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8a7c('0x14'))(_0x8a7c('0x15'));var utils=require('../../config/utils');var config=require(_0x8a7c('0x16'));var db=require(_0x8a7c('0x17'))['db'];function respondWithStatusCode(_0x4b51ee,_0x514444){_0x514444=_0x514444||0xcc;return function(_0x17000f){if(_0x17000f){return _0x4b51ee[_0x8a7c('0x18')](_0x514444);}return _0x4b51ee['status'](_0x514444)[_0x8a7c('0x19')]();};}function respondWithResult(_0x435202,_0x542b77){_0x542b77=_0x542b77||0xc8;return function(_0x29ae1d){if(_0x29ae1d){return _0x435202[_0x8a7c('0x1a')](_0x542b77)[_0x8a7c('0x1b')](_0x29ae1d);}};}function respondWithFilteredResult(_0x3a40ba,_0x39c001){return function(_0x38ca69){if(_0x38ca69){var _0x4878e9=_0x38ca69[_0x8a7c('0x1c')],_0x10ab93=_0x39c001[_0x8a7c('0x1d')],_0x17c1cd=_0x39c001['offset']+_0x39c001[_0x8a7c('0x1e')],_0xd3539b;if(_0x17c1cd>=_0x4878e9){_0x17c1cd=_0x4878e9;_0xd3539b=0xc8;}else{_0xd3539b=0xce;}_0x3a40ba['status'](_0xd3539b);return _0x3a40ba[_0x8a7c('0x1f')](_0x8a7c('0x20'),_0x10ab93+'-'+_0x17c1cd+'/'+_0x4878e9)[_0x8a7c('0x1b')](_0x38ca69);}return null;};}function patchUpdates(_0x4b3b56){return function(_0x101efc){try{jsonpatch[_0x8a7c('0x21')](_0x101efc,_0x4b3b56,!![]);}catch(_0x5b0c56){return BPromise[_0x8a7c('0x22')](_0x5b0c56);}return _0x101efc['save']();};}function saveUpdates(_0x2a83a5,_0x188ee4){return function(_0x3b57e6){if(_0x3b57e6){return _0x3b57e6[_0x8a7c('0x23')](_0x2a83a5)[_0x8a7c('0x24')](function(_0x24dca6){return _0x24dca6;});}return null;};}function removeEntity(_0x53df57,_0x5bb624){return function(_0x496866){if(_0x496866){return _0x496866['destroy']()[_0x8a7c('0x24')](function(){_0x53df57[_0x8a7c('0x1a')](0xcc)[_0x8a7c('0x19')]();});}};}function handleEntityNotFound(_0x50bda9,_0xcd80b2){return function(_0x3c05f5){if(!_0x3c05f5){_0x50bda9[_0x8a7c('0x18')](0x194);}return _0x3c05f5;};}function handleError(_0x1c7dd1,_0x2f4698){_0x2f4698=_0x2f4698||0x1f4;return function(_0xbd3ba8){logger[_0x8a7c('0x25')](_0xbd3ba8['stack']);if(_0xbd3ba8[_0x8a7c('0x26')]){delete _0xbd3ba8['name'];}_0x1c7dd1[_0x8a7c('0x1a')](_0x2f4698)[_0x8a7c('0x27')](_0xbd3ba8);};}exports[_0x8a7c('0x28')]=function(_0x599159,_0x1d467c){var _0x590b4c={},_0x319572={},_0x5abe6c={'count':0x0,'rows':[]};var _0x52e7c6=_[_0x8a7c('0x29')](db['CmHopper']['rawAttributes'],function(_0x4c40c0){return{'name':_0x4c40c0['fieldName'],'type':_0x4c40c0[_0x8a7c('0x2a')][_0x8a7c('0x2b')]};});_0x319572[_0x8a7c('0x2c')]=_[_0x8a7c('0x29')](_0x52e7c6,'name');_0x319572[_0x8a7c('0x2d')]=_[_0x8a7c('0x2e')](_0x599159['query']);_0x319572[_0x8a7c('0x2f')]=_['intersection'](_0x319572[_0x8a7c('0x2c')],_0x319572[_0x8a7c('0x2d')]);_0x319572[_0x8a7c('0x2f')]=_[_0x8a7c('0x30')](_0x319572['filters'],['$and',_0x8a7c('0x31'),_0x8a7c('0x32'),'$gte',_0x8a7c('0x33'),_0x8a7c('0x34'),_0x8a7c('0x35'),_0x8a7c('0x36'),_0x8a7c('0x37'),_0x8a7c('0x38'),_0x8a7c('0x39'),_0x8a7c('0x3a'),'$notIn','$like',_0x8a7c('0x3b'),_0x8a7c('0x3c'),'$notILike','$like',_0x8a7c('0x3d'),_0x8a7c('0x3e'),_0x8a7c('0x3f'),_0x8a7c('0x40')]);_0x590b4c[_0x8a7c('0x41')]=_[_0x8a7c('0x42')](_0x319572[_0x8a7c('0x2c')],qs[_0x8a7c('0x43')](_0x599159[_0x8a7c('0x2d')][_0x8a7c('0x43')]));_0x590b4c[_0x8a7c('0x41')]=_0x590b4c[_0x8a7c('0x41')][_0x8a7c('0x44')]?_0x590b4c[_0x8a7c('0x41')]:_0x319572[_0x8a7c('0x2c')];if(!_0x599159[_0x8a7c('0x2d')]['hasOwnProperty'](_0x8a7c('0x45'))){_0x590b4c[_0x8a7c('0x1e')]=qs['limit'](_0x599159[_0x8a7c('0x2d')]['limit']);_0x590b4c[_0x8a7c('0x1d')]=qs[_0x8a7c('0x1d')](_0x599159[_0x8a7c('0x2d')]['offset']);}_0x590b4c[_0x8a7c('0x46')]=qs['sort'](_0x599159['query'][_0x8a7c('0x47')]);_0x590b4c[_0x8a7c('0x48')]=qs[_0x8a7c('0x2f')](_['pick'](_0x599159['query'],_0x319572[_0x8a7c('0x2f')]));if(_0x599159[_0x8a7c('0x2d')][_0x8a7c('0x49')]){_0x590b4c[_0x8a7c('0x48')]=_[_0x8a7c('0x4a')](_0x590b4c[_0x8a7c('0x48')],{'$or':_['map'](_0x52e7c6,function(_0x5cad40){if(_0x5cad40[_0x8a7c('0x2a')][_0x8a7c('0x2b')]!==_0x8a7c('0x4b')){var _0x318bb1={};_0x318bb1[_0x5cad40[_0x8a7c('0x4c')]]={'$like':'%'+_0x599159[_0x8a7c('0x2d')]['filter']+'%'};return _0x318bb1;}})});}_0x590b4c=_[_0x8a7c('0x4a')]({},_0x590b4c,_0x599159[_0x8a7c('0x4d')]);var _0x5e8282={'where':_0x590b4c['where']};return db[_0x8a7c('0x4e')][_0x8a7c('0x1c')](_0x5e8282)[_0x8a7c('0x24')](function(_0x49fe5d){_0x5abe6c[_0x8a7c('0x1c')]=_0x49fe5d;if(_0x599159[_0x8a7c('0x2d')][_0x8a7c('0x4f')]){_0x590b4c[_0x8a7c('0x50')]=[{'all':!![]}];}return db[_0x8a7c('0x4e')][_0x8a7c('0x51')](_0x590b4c);})[_0x8a7c('0x24')](function(_0x4dad5e){_0x5abe6c[_0x8a7c('0x52')]=_0x4dad5e;return _0x5abe6c;})[_0x8a7c('0x24')](respondWithFilteredResult(_0x1d467c,_0x590b4c))[_0x8a7c('0x53')](handleError(_0x1d467c,null));};exports[_0x8a7c('0x54')]=function(_0x330eb1,_0x8c56fb){var _0x421482={'raw':!![],'where':{'id':_0x330eb1['params']['id']}},_0x1c0674={};_0x1c0674['model']=_[_0x8a7c('0x2e')](db[_0x8a7c('0x4e')][_0x8a7c('0x55')]);_0x1c0674[_0x8a7c('0x2d')]=_['keys'](_0x330eb1[_0x8a7c('0x2d')]);_0x1c0674[_0x8a7c('0x2f')]=_[_0x8a7c('0x42')](_0x1c0674[_0x8a7c('0x2c')],_0x1c0674[_0x8a7c('0x2d')]);_0x421482['attributes']=_[_0x8a7c('0x42')](_0x1c0674[_0x8a7c('0x2c')],qs['fields'](_0x330eb1[_0x8a7c('0x2d')][_0x8a7c('0x43')]));_0x421482['attributes']=_0x421482[_0x8a7c('0x41')][_0x8a7c('0x44')]?_0x421482['attributes']:_0x1c0674['model'];if(_0x330eb1[_0x8a7c('0x2d')][_0x8a7c('0x4f')]){_0x421482[_0x8a7c('0x50')]=[{'all':!![]}];}_0x421482=_[_0x8a7c('0x4a')]({},_0x421482,_0x330eb1['options']);return db[_0x8a7c('0x4e')][_0x8a7c('0x56')](_0x421482)['then'](handleEntityNotFound(_0x8c56fb,null))['then'](respondWithResult(_0x8c56fb,null))[_0x8a7c('0x53')](handleError(_0x8c56fb,null));};exports[_0x8a7c('0x57')]=function(_0x453e93,_0xe0ed80){return db[_0x8a7c('0x4e')][_0x8a7c('0x57')](_0x453e93[_0x8a7c('0x58')],{})[_0x8a7c('0x24')](respondWithResult(_0xe0ed80,0xc9))['catch'](handleError(_0xe0ed80,null));};exports[_0x8a7c('0x23')]=function(_0x64d107,_0x439e28){if(_0x64d107[_0x8a7c('0x58')]['id']){delete _0x64d107[_0x8a7c('0x58')]['id'];}return db['CmHopper']['find']({'where':{'id':_0x64d107['params']['id']}})[_0x8a7c('0x24')](handleEntityNotFound(_0x439e28,null))[_0x8a7c('0x24')](saveUpdates(_0x64d107[_0x8a7c('0x58')],null))[_0x8a7c('0x24')](respondWithResult(_0x439e28,null))[_0x8a7c('0x53')](handleError(_0x439e28,null));};exports[_0x8a7c('0x59')]=function(_0x46f32d,_0x4234e3){return db[_0x8a7c('0x4e')]['describe']()[_0x8a7c('0x24')](respondWithResult(_0x4234e3,null))[_0x8a7c('0x53')](handleError(_0x4234e3,null));};exports[_0x8a7c('0x5a')]=function(_0x541851,_0x46cd21){var _0x38cf17;return db['CmHopper']['find']({'where':{'id':_0x541851['params']['id']}})[_0x8a7c('0x24')](handleEntityNotFound(_0x46cd21,null))[_0x8a7c('0x24')](function(_0x4274dc){if(_0x4274dc){return _0x4274dc[_0x8a7c('0x5a')]()[_0x8a7c('0x24')](function(_0x10eb67){return _0x10eb67;});}})[_0x8a7c('0x24')](function(_0x4b81f1){_0x38cf17=_0x4b81f1;if(_0x4b81f1){if(_0x4b81f1[_0x8a7c('0x5b')]||_0x4b81f1['CampaignId']){return db[_0x4b81f1[_0x8a7c('0x5b')]?_0x8a7c('0x5c'):_0x8a7c('0x5d')]['find']({'where':{'id':_0x4b81f1['VoiceQueueId']?_0x4b81f1[_0x8a7c('0x5b')]:_0x4b81f1['CampaignId']},'attributes':['id',_0x8a7c('0x26')],'raw':!![]});}}})['then'](function(_0x403f1f){var _0x5c94a6={};if(_0x403f1f){_[_0x8a7c('0x4a')](_0x5c94a6,_[_0x8a7c('0x5e')](_0x38cf17[_0x8a7c('0x5f')],[_0x8a7c('0x60'),'updatedAt','id']));_0x5c94a6['state']=0x15;_0x5c94a6[_0x8a7c('0x61')]=_0x8a7c('0x62');_0x5c94a6['campaign']=_0x403f1f[_0x8a7c('0x26')];_0x5c94a6[_0x8a7c('0x63')]=_0x541851[_0x8a7c('0x64')]['name'];_0x5c94a6[_0x8a7c('0x65')]=_0x541851[_0x8a7c('0x64')]['id'];_0x5c94a6[_0x8a7c('0x62')]=!![];_0x5c94a6[_0x8a7c('0x66')]=moment()[_0x8a7c('0x67')](_0x8a7c('0x68'));_0x5c94a6[_0x8a7c('0x69')]=_0x38cf17[_0x8a7c('0x6a')];_0x5c94a6[_0x8a7c('0x6b')]=_0x38cf17[_0x8a7c('0x5b')]?_0x8a7c('0x6c'):_0x8a7c('0x6d');return db[_0x8a7c('0x6e')][_0x8a7c('0x56')]({'where':{'id':_0x5c94a6[_0x8a7c('0x6f')]},'attributes':[_0x8a7c('0x70'),_0x8a7c('0x71')]})[_0x8a7c('0x24')](function(_0x12ee5e){if(!_[_0x8a7c('0x72')](_0x46cd21)&&!_[_0x8a7c('0x72')](_0x12ee5e['firstName'])){_0x5c94a6['calleridname']=_0x12ee5e[_0x8a7c('0x70')];if(!_[_0x8a7c('0x72')](_0x12ee5e[_0x8a7c('0x71')])){_0x5c94a6['calleridname']+='\x20'+_0x12ee5e[_0x8a7c('0x71')];}}})['finally'](function(){return db[_0x8a7c('0x73')]['create'](_0x5c94a6);});}})[_0x8a7c('0x24')](function(){return _0x46cd21['status'](0xcc)[_0x8a7c('0x19')]();})[_0x8a7c('0x53')](handleError(_0x46cd21,null));};exports[_0x8a7c('0x74')]=function(_0x2e027e,_0x2c1a8a,_0x500ad2){var _0x52d81b=[];return db[_0x8a7c('0x6e')][_0x8a7c('0x59')]()[_0x8a7c('0x24')](function(_0x4988be){_0x52d81b=_[_0x8a7c('0x2e')](_0x4988be);return _0x2e027e[_0x8a7c('0x64')][_0x8a7c('0x75')]({'where':{'type':_0x8a7c('0x76'),'dialActive':!![],'dialMethod':_0x8a7c('0x77')},'attributes':['id',_0x8a7c('0x78')],'raw':!![]});})[_0x8a7c('0x24')](function(_0x37c63d){if(_0x37c63d&&_0x37c63d[_0x8a7c('0x44')]){return db[_0x8a7c('0x79')][_0x8a7c('0x7a')](function(_0x1f770a){var _0x13a17a={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x8a7c('0x67')](_0x8a7c('0x68'))},'VoiceQueueId':{'$in':_[_0x8a7c('0x29')](_0x37c63d,'id')},'$or':[{'UserId':null},{'UserId':_0x2e027e[_0x8a7c('0x64')]['id']}]};var _0x4fd64f=[];if(_0x2e027e['body'][_0x8a7c('0x7b')]&&_0x2e027e[_0x8a7c('0x58')][_0x8a7c('0x7b')]===_0x8a7c('0x7c')){if(!_[_0x8a7c('0x7d')](_0x2e027e[_0x8a7c('0x58')]['hopperIds'])){_0x13a17a['id']={'$in':_0x2e027e[_0x8a7c('0x58')][_0x8a7c('0x7e')]};}_0x4fd64f=[[_0x8a7c('0x7f'),_0x8a7c('0x80')],[_0x8a7c('0x81'),_0x37c63d[0x0]['dialOrderByScheduledAt']===_0x8a7c('0x80')?'DESC':_0x8a7c('0x80')],db['sequelize'][_0x8a7c('0x82')](_0x8a7c('0x83')),['id',_0x8a7c('0x84')]];}else{if(!_[_0x8a7c('0x7d')](_0x2e027e['body'][_0x8a7c('0x7e')])){_0x13a17a['id']={'$notIn':_0x2e027e[_0x8a7c('0x58')][_0x8a7c('0x7e')]};}_0x4fd64f=[['priority',_0x8a7c('0x84')],[_0x8a7c('0x81'),_0x37c63d[0x0][_0x8a7c('0x78')]],db[_0x8a7c('0x79')][_0x8a7c('0x82')](_0x8a7c('0x85')),['id','ASC']];}return db[_0x8a7c('0x4e')][_0x8a7c('0x86')]({'attributes':['id',_0x8a7c('0x87')],'where':_0x13a17a,'order':_0x4fd64f,'transaction':_0x1f770a,'lock':_0x1f770a[_0x8a7c('0x88')][_0x8a7c('0x89')],'include':[{'model':db['CmContact'],'as':'Contact','attributes':_0x52d81b,'include':[{'model':db[_0x8a7c('0x8a')],'as':_0x8a7c('0x8b'),'attributes':['id',_0x8a7c('0x26')]}]},{'model':db[_0x8a7c('0x8c')],'as':_0x8a7c('0x8d'),'attributes':['id',_0x8a7c('0x26')]},{'model':db[_0x8a7c('0x5c')],'as':'Queue','attributes':['id',_0x8a7c('0x26'),_0x8a7c('0x8e')]}]})['then'](function(_0x3ae319){if(_0x3ae319){return _0x3ae319['update']({'UserId':_0x2e027e[_0x8a7c('0x64')]['id']},{'transaction':_0x1f770a});}});});}})[_0x8a7c('0x24')](handleEntityNotFound(_0x2c1a8a,null))['then'](respondWithResult(_0x2c1a8a,null))['catch'](handleError(_0x2c1a8a,null));};exports[_0x8a7c('0x8f')]=function(_0x3ee2d8,_0x5de862,_0x1ba088){return _0x3ee2d8[_0x8a7c('0x64')]['getVoiceQueues']({'where':{'type':_0x8a7c('0x76'),'dialActive':!![],'dialMethod':_0x8a7c('0x77')},'attributes':['id'],'raw':!![]})['then'](function(_0x30f752){if(_0x30f752&&_0x30f752[_0x8a7c('0x44')]){return db[_0x8a7c('0x4e')][_0x8a7c('0x1c')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x8a7c('0x68'))},'VoiceQueueId':{'$in':_[_0x8a7c('0x29')](_0x30f752,'id')},'$or':[{'UserId':null},{'UserId':_0x3ee2d8[_0x8a7c('0x64')]['id']}]}});}return 0x0;})[_0x8a7c('0x24')](function(_0x4f457e){if(!_['isNil'](_0x4f457e)&&_[_0x8a7c('0x90')](_0x4f457e)){return _0x5de862[_0x8a7c('0x1a')](0xc8)[_0x8a7c('0x1b')]({'contacts':_0x4f457e});}else{logger[_0x8a7c('0x25')](_0x8a7c('0x91'),'getOpenContacts',0x194,_0x8a7c('0x92'));_0x5de862['sendStatus'](0x194);}})['catch'](handleError(_0x5de862,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index c419280..b767663 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 _0x61bf=['bluebird','request-promise','path','rimraf','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','../../config/logger','api','moment'];(function(_0x16ed4e,_0x240b1f){var _0xf078fe=function(_0x27977b){while(--_0x27977b){_0x16ed4e['push'](_0x16ed4e['shift']());}};_0xf078fe(++_0x240b1f);}(_0x61bf,0x164));var _0xf61b=function(_0x2206ff,_0x21f748){_0x2206ff=_0x2206ff-0x0;var _0x3c0d51=_0x61bf[_0x2206ff];return _0x3c0d51;};'use strict';var _=require(_0xf61b('0x0'));var util=require('util');var logger=require(_0xf61b('0x1'))(_0xf61b('0x2'));var moment=require(_0xf61b('0x3'));var BPromise=require(_0xf61b('0x4'));var rp=require(_0xf61b('0x5'));var fs=require('fs');var path=require(_0xf61b('0x6'));var rimraf=require(_0xf61b('0x7'));var config=require('../../config/environment');var attributes=require('./cmHopper.attributes');module[_0xf61b('0x8')]=function(_0x2e47bf,_0x2daccb){return _0x2e47bf[_0xf61b('0x9')](_0xf61b('0xa'),attributes,{'tableName':_0xf61b('0xb'),'paranoid':![],'indexes':[{'name':_0xf61b('0xc'),'fields':[_0xf61b('0xc')]},{'name':_0xf61b('0xd'),'fields':[_0xf61b('0xd')]},{'name':_0xf61b('0xe'),'fields':[_0xf61b('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6432=['define','CmHopper','scheduledat','phone','priority','lodash','util','../../config/logger','api','moment','path','../../config/environment','./cmHopper.attributes','exports'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x6432,0x9f));var _0x2643=function(_0xbe1801,_0x135c10){_0xbe1801=_0xbe1801-0x0;var _0x200deb=_0x6432[_0xbe1801];return _0x200deb;};'use strict';var _=require(_0x2643('0x0'));var util=require(_0x2643('0x1'));var logger=require(_0x2643('0x2'))(_0x2643('0x3'));var moment=require(_0x2643('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2643('0x5'));var rimraf=require('rimraf');var config=require(_0x2643('0x6'));var attributes=require(_0x2643('0x7'));module[_0x2643('0x8')]=function(_0x17f20e,_0x13f94a){return _0x17f20e[_0x2643('0x9')](_0x2643('0xa'),attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0x2643('0xb'),'fields':[_0x2643('0xb')]},{'name':_0x2643('0xc'),'fields':[_0x2643('0xc')]},{'name':_0x2643('0xd'),'fields':[_0x2643('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 6c30ff9..37afe19 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 _0xaa01=['format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','CmContact','UserId','LOCK','push','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetCmHopper','findAll','options','where','attributes','limit','map','include','model','ShowCmHopper','CmHopper','find','body','CreateCmHopper','UpdateCmHopper','update','raw','DestroyCmHopper','describe','transaction','order','UPDATE','keys','length','all','GetContactDialer','MoveContactManagedDialer','create','destroy','CountReScheduled','sequelize','literal','`scheduledat`\x20>=\x20'];(function(_0x2a1b33,_0x409f50){var _0x4c50e7=function(_0x13e16d){while(--_0x13e16d){_0x2a1b33['push'](_0x2a1b33['shift']());}};_0x4c50e7(++_0x409f50);}(_0xaa01,0x154));var _0x1aa0=function(_0x4fa0ee,_0x59ba05){_0x4fa0ee=_0x4fa0ee-0x0;var _0x1bfad2=_0xaa01[_0x4fa0ee];return _0x1bfad2;};'use strict';var _=require(_0x1aa0('0x0'));var util=require(_0x1aa0('0x1'));var moment=require(_0x1aa0('0x2'));var BPromise=require(_0x1aa0('0x3'));var rs=require(_0x1aa0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1aa0('0x5'))['db'];var utils=require(_0x1aa0('0x6'));var logger=require(_0x1aa0('0x7'))('rpc');var config=require(_0x1aa0('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1aa0('0x9')][_0x1aa0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x36bf77,_0x29214e,_0x14e01e){return new BPromise(function(_0x5ea8ae,_0x47c0d1){return client[_0x1aa0('0xb')](_0x36bf77,_0x14e01e)[_0x1aa0('0xc')](function(_0x551836){logger[_0x1aa0('0xd')](_0x1aa0('0xe'),_0x29214e,_0x1aa0('0xf'));logger[_0x1aa0('0x10')](_0x1aa0('0x11'),_0x29214e,_0x1aa0('0xf'),JSON[_0x1aa0('0x12')](_0x551836));if(_0x551836['error']){if(_0x551836['error']['code']===0x1f4){logger[_0x1aa0('0x13')]('CmHopper,\x20%s,\x20%s',_0x29214e,_0x551836[_0x1aa0('0x13')][_0x1aa0('0x14')]);return _0x47c0d1(_0x551836[_0x1aa0('0x13')][_0x1aa0('0x14')]);}logger[_0x1aa0('0x13')](_0x1aa0('0xe'),_0x29214e,_0x551836[_0x1aa0('0x13')][_0x1aa0('0x14')]);return _0x5ea8ae(_0x551836[_0x1aa0('0x13')]['message']);}else{logger[_0x1aa0('0xd')](_0x1aa0('0xe'),_0x29214e,_0x1aa0('0xf'));_0x5ea8ae(_0x551836[_0x1aa0('0x15')]['message']);}})[_0x1aa0('0x16')](function(_0xce49cd){logger[_0x1aa0('0x13')](_0x1aa0('0xe'),_0x29214e,_0xce49cd);_0x47c0d1(_0xce49cd);});});}exports[_0x1aa0('0x17')]=function(_0x44b32d){var _0x2b2ad9=this;return new Promise(function(_0x3a999c,_0x306213){return db['CmHopper'][_0x1aa0('0x18')]({'raw':_0x44b32d[_0x1aa0('0x19')]?_0x44b32d[_0x1aa0('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x44b32d[_0x1aa0('0x19')]?_0x44b32d[_0x1aa0('0x19')][_0x1aa0('0x1a')]||null:null,'attributes':_0x44b32d['options']?_0x44b32d[_0x1aa0('0x19')][_0x1aa0('0x1b')]||null:null,'limit':_0x44b32d[_0x1aa0('0x19')]?_0x44b32d['options'][_0x1aa0('0x1c')]||null:null,'include':_0x44b32d[_0x1aa0('0x19')]?_0x44b32d[_0x1aa0('0x19')]['include']?_[_0x1aa0('0x1d')](_0x44b32d[_0x1aa0('0x19')][_0x1aa0('0x1e')],function(_0x55a175){return{'model':db[_0x55a175[_0x1aa0('0x1f')]],'as':_0x55a175['as'],'attributes':_0x55a175[_0x1aa0('0x1b')],'include':_0x55a175[_0x1aa0('0x1e')]?_[_0x1aa0('0x1d')](_0x55a175[_0x1aa0('0x1e')],function(_0x15f3dd){return{'model':db[_0x15f3dd['model']],'as':_0x15f3dd['as'],'attributes':_0x15f3dd[_0x1aa0('0x1b')],'include':_0x15f3dd[_0x1aa0('0x1e')]?_['map'](_0x15f3dd[_0x1aa0('0x1e')],function(_0x3acd2e){return{'model':db[_0x3acd2e[_0x1aa0('0x1f')]],'as':_0x3acd2e['as'],'attributes':_0x3acd2e['attributes']};}):[]};}):[]};}):[]:[]})[_0x1aa0('0xc')](function(_0x457ec4){logger[_0x1aa0('0xd')](_0x1aa0('0x17'),_0x44b32d);logger[_0x1aa0('0x10')]('GetCmHopper',_0x44b32d,JSON[_0x1aa0('0x12')](_0x457ec4));_0x3a999c(_0x457ec4);})[_0x1aa0('0x16')](function(_0x31c7f4){logger[_0x1aa0('0x13')](_0x1aa0('0x17'),_0x31c7f4[_0x1aa0('0x14')],_0x44b32d);_0x306213(_0x2b2ad9['error'](0x1f4,_0x31c7f4[_0x1aa0('0x14')]));});});};exports[_0x1aa0('0x20')]=function(_0x177628){var _0x42e05=this;return new Promise(function(_0x1146e7,_0x50d462){return db[_0x1aa0('0x21')][_0x1aa0('0x22')]({'raw':_0x177628[_0x1aa0('0x19')]?_0x177628[_0x1aa0('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x177628[_0x1aa0('0x19')]?_0x177628[_0x1aa0('0x19')][_0x1aa0('0x1a')]||null:null,'attributes':_0x177628['options']?_0x177628[_0x1aa0('0x19')][_0x1aa0('0x1b')]||null:null,'include':_0x177628[_0x1aa0('0x19')]?_0x177628[_0x1aa0('0x19')][_0x1aa0('0x1e')]?_[_0x1aa0('0x1d')](_0x177628[_0x1aa0('0x19')]['include'],function(_0xf9f858){return{'model':db[_0xf9f858[_0x1aa0('0x1f')]],'as':_0xf9f858['as'],'attributes':_0xf9f858[_0x1aa0('0x1b')],'include':_0xf9f858[_0x1aa0('0x1e')]?_['map'](_0xf9f858[_0x1aa0('0x1e')],function(_0x3ea6eb){return{'model':db[_0x3ea6eb[_0x1aa0('0x1f')]],'as':_0x3ea6eb['as'],'attributes':_0x3ea6eb[_0x1aa0('0x1b')],'include':_0x3ea6eb[_0x1aa0('0x1e')]?_[_0x1aa0('0x1d')](_0x3ea6eb[_0x1aa0('0x1e')],function(_0x3f33e8){return{'model':db[_0x3f33e8[_0x1aa0('0x1f')]],'as':_0x3f33e8['as'],'attributes':_0x3f33e8[_0x1aa0('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x1aa0('0xc')](function(_0x1fb935){logger[_0x1aa0('0xd')](_0x1aa0('0x20'),_0x177628);logger[_0x1aa0('0x10')](_0x1aa0('0x20'),_0x177628,JSON['stringify'](_0x1fb935));_0x1146e7(_0x1fb935);})[_0x1aa0('0x16')](function(_0x311ea7){logger[_0x1aa0('0x13')](_0x1aa0('0x20'),_0x311ea7['message'],_0x177628);_0x50d462(_0x42e05[_0x1aa0('0x13')](0x1f4,_0x311ea7[_0x1aa0('0x14')]));});});};exports['CreateCmHopper']=function(_0x1c5c11){var _0x3f427c=this;return new Promise(function(_0x2858eb,_0x273a18){return db[_0x1aa0('0x21')]['create'](_0x1c5c11[_0x1aa0('0x23')],{'raw':_0x1c5c11[_0x1aa0('0x19')]?_0x1c5c11[_0x1aa0('0x19')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x21413e){logger[_0x1aa0('0xd')](_0x1aa0('0x24'),_0x1c5c11);logger['debug'](_0x1aa0('0x24'),_0x1c5c11,JSON[_0x1aa0('0x12')](_0x21413e));_0x2858eb(_0x21413e);})[_0x1aa0('0x16')](function(_0x1398ea){logger['error'](_0x1aa0('0x24'),_0x1398ea[_0x1aa0('0x14')],_0x1c5c11);_0x273a18(_0x3f427c[_0x1aa0('0x13')](0x1f4,_0x1398ea[_0x1aa0('0x14')]));});});};exports[_0x1aa0('0x25')]=function(_0x6f6618){var _0x59d955=this;return new Promise(function(_0x57cfce,_0x4ac22b){return db[_0x1aa0('0x21')][_0x1aa0('0x26')](_0x6f6618[_0x1aa0('0x23')],{'raw':_0x6f6618[_0x1aa0('0x19')]?_0x6f6618['options'][_0x1aa0('0x27')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x6f6618[_0x1aa0('0x19')]?_0x6f6618[_0x1aa0('0x19')]['where']||null:null,'attributes':_0x6f6618['options']?_0x6f6618[_0x1aa0('0x19')][_0x1aa0('0x1b')]||null:null,'limit':_0x6f6618[_0x1aa0('0x19')]?_0x6f6618[_0x1aa0('0x19')][_0x1aa0('0x1c')]||null:null})[_0x1aa0('0xc')](function(_0x8e6ee9){logger[_0x1aa0('0xd')](_0x1aa0('0x25'),_0x6f6618);logger[_0x1aa0('0x10')](_0x1aa0('0x25'),_0x6f6618,JSON['stringify'](_0x8e6ee9));_0x57cfce(_0x8e6ee9);})[_0x1aa0('0x16')](function(_0x26c5f7){logger[_0x1aa0('0x13')](_0x1aa0('0x25'),_0x26c5f7[_0x1aa0('0x14')],_0x6f6618);_0x4ac22b(_0x59d955[_0x1aa0('0x13')](0x1f4,_0x26c5f7[_0x1aa0('0x14')]));});});};exports[_0x1aa0('0x28')]=function(_0x353f32){var _0x572d20=this;return new Promise(function(_0xcff21e,_0x146edd){return db[_0x1aa0('0x21')]['destroy']({'where':_0x353f32[_0x1aa0('0x19')]?_0x353f32[_0x1aa0('0x19')][_0x1aa0('0x1a')]||null:null})[_0x1aa0('0xc')](function(_0x345584){logger[_0x1aa0('0xd')](_0x1aa0('0x28'),_0x353f32);logger['debug'](_0x1aa0('0x28'),_0x353f32,JSON[_0x1aa0('0x12')](_0x345584));_0xcff21e(_0x345584);})[_0x1aa0('0x16')](function(_0x29f4c0){logger[_0x1aa0('0x13')](_0x1aa0('0x28'),_0x29f4c0[_0x1aa0('0x14')],_0x353f32);_0x146edd(_0x572d20[_0x1aa0('0x13')](0x1f4,_0x29f4c0[_0x1aa0('0x14')]));});});};exports['GetContactDialer']=function(_0x459151){var _0x20220e=this;return new Promise(function(_0x2a329b,_0x5a11db){return db['CmContact'][_0x1aa0('0x29')]()[_0x1aa0('0xc')](function(_0x4cc477){return db['sequelize'][_0x1aa0('0x2a')](function(_0x561f76){return db[_0x1aa0('0x21')][_0x1aa0('0x18')]({'where':_0x459151['options']?_0x459151['options'][_0x1aa0('0x1a')]||null:null,'attributes':_0x459151[_0x1aa0('0x19')]?_0x459151[_0x1aa0('0x19')][_0x1aa0('0x1b')]||null:null,'limit':_0x459151['options']?_0x459151[_0x1aa0('0x19')]['limit']||null:null,'order':_0x459151[_0x1aa0('0x19')]?_0x459151['options'][_0x1aa0('0x2b')]||null:null,'transaction':_0x561f76,'lock':_0x561f76['LOCK'][_0x1aa0('0x2c')],'include':[{'model':db['CmContact'],'as':'Contact','attributes':_[_0x1aa0('0x2d')](_0x4cc477)}]})[_0x1aa0('0xc')](function(_0x20f93f){var _0x3336bb=[];for(var _0x5e711b=0x0;_0x5e711b<_0x20f93f[_0x1aa0('0x2e')];_0x5e711b+=0x1){_0x3336bb['push'](_0x20f93f[_0x5e711b][_0x1aa0('0x26')](_0x459151['body'],{'transaction':_0x561f76}));}return BPromise[_0x1aa0('0x2f')](_0x3336bb);});})[_0x1aa0('0xc')](function(_0x48bca0){logger[_0x1aa0('0xd')]('GetContactDialer',_0x459151);logger['debug'](_0x1aa0('0x30'),_0x459151,JSON[_0x1aa0('0x12')](_0x48bca0));_0x2a329b(_0x48bca0);})[_0x1aa0('0x16')](function(_0x6ecaf8){logger[_0x1aa0('0x13')](_0x1aa0('0x30'),_0x6ecaf8['message'],_0x459151);_0x5a11db(_0x20220e[_0x1aa0('0x13')](0x1f4,_0x6ecaf8['message']));});});});};exports[_0x1aa0('0x31')]=function(_0x4f2bb9){var _0x5d8a29=this;return new Promise(function(_0x45afe2,_0x4695ee){return db['sequelize'][_0x1aa0('0x2a')](function(_0x41cf77){return db['CmHopperFinal'][_0x1aa0('0x32')](_0x4f2bb9[_0x1aa0('0x23')],{'raw':_0x4f2bb9[_0x1aa0('0x19')]?_0x4f2bb9[_0x1aa0('0x19')][_0x1aa0('0x27')]===undefined?!![]:![]:!![],'transaction':_0x41cf77})[_0x1aa0('0xc')](function(){return db[_0x1aa0('0x21')][_0x1aa0('0x33')]({'where':_0x4f2bb9[_0x1aa0('0x19')]?_0x4f2bb9['options'][_0x1aa0('0x1a')]||null:null,'transaction':_0x41cf77});});})['then'](function(_0x12be81){logger[_0x1aa0('0xd')](_0x1aa0('0x31'),_0x4f2bb9);logger[_0x1aa0('0x10')](_0x1aa0('0x31'),_0x4f2bb9,JSON[_0x1aa0('0x12')](_0x12be81));_0x45afe2(_0x12be81);})[_0x1aa0('0x16')](function(_0x113873){logger['error'](_0x1aa0('0x31'),_0x113873[_0x1aa0('0x14')],_0x4f2bb9);_0x4695ee(_0x5d8a29[_0x1aa0('0x13')](0x1f4,_0x113873[_0x1aa0('0x14')]));});});};exports[_0x1aa0('0x34')]=function(_0x2795d9){var _0x373078=this;return new Promise(function(_0x571d1c,_0x2666c3){return db[_0x1aa0('0x21')]['findAll']({'raw':_0x2795d9[_0x1aa0('0x19')]?_0x2795d9['options'][_0x1aa0('0x27')]===undefined?!![]:![]:!![],'where':_0x2795d9[_0x1aa0('0x19')]?_0x2795d9[_0x1aa0('0x19')][_0x1aa0('0x1a')]||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db[_0x1aa0('0x35')]['fn']('IF',db[_0x1aa0('0x35')][_0x1aa0('0x36')](_0x1aa0('0x37')+util[_0x1aa0('0x38')](_0x1aa0('0x39'),moment()[_0x1aa0('0x38')](_0x1aa0('0x3a')))+_0x1aa0('0x3b')))),_0x1aa0('0x3c')]]})[_0x1aa0('0xc')](function(_0x34a77e){logger[_0x1aa0('0xd')](_0x1aa0('0x34'),_0x2795d9);logger[_0x1aa0('0x10')](_0x1aa0('0x34'),_0x2795d9,JSON['stringify'](_0x34a77e));_0x571d1c(_0x34a77e);})[_0x1aa0('0x16')](function(_0xfebc30){logger[_0x1aa0('0x13')](_0x1aa0('0x34'),_0xfebc30[_0x1aa0('0x14')],_0x2795d9);_0x2666c3(_0x373078['error'](0x1f4,_0xfebc30[_0x1aa0('0x14')]));});});};exports[_0x1aa0('0x3d')]=function(_0xd02282){var _0x43f5ff=this;return new Promise(function(_0x248134,_0x1feb28){return db[_0x1aa0('0x3e')][_0x1aa0('0x29')]()[_0x1aa0('0xc')](function(_0x174ff4){return db[_0x1aa0('0x35')]['transaction'](function(_0x498aa2){return db[_0x1aa0('0x21')][_0x1aa0('0x18')]({'where':_0xd02282[_0x1aa0('0x19')]?_0xd02282[_0x1aa0('0x19')][_0x1aa0('0x1a')]||null:null,'attributes':_0xd02282['options']?_0xd02282[_0x1aa0('0x19')][_0x1aa0('0x1b')]||null:null,'limit':0x1,'order':_0xd02282[_0x1aa0('0x19')]?_0xd02282[_0x1aa0('0x19')][_0x1aa0('0x2b')]||null:null,'group':db[_0x1aa0('0x21')][_0x1aa0('0x3f')],'transaction':_0x498aa2,'lock':_0x498aa2[_0x1aa0('0x40')]['UPDATE'],'include':_0xd02282[_0x1aa0('0x19')]?_0xd02282[_0x1aa0('0x19')][_0x1aa0('0x1e')]?_[_0x1aa0('0x1d')](_0xd02282['options']['include'],function(_0x81bd52){return{'model':db[_0x81bd52[_0x1aa0('0x1f')]],'as':_0x81bd52['as'],'attributes':_0x81bd52[_0x1aa0('0x1b')],'include':_0x81bd52[_0x1aa0('0x1e')]?_[_0x1aa0('0x1d')](_0x81bd52[_0x1aa0('0x1e')],function(_0x190715){return{'model':db[_0x190715[_0x1aa0('0x1f')]],'as':_0x190715['as'],'attributes':_0x190715['attributes'],'include':_0x190715[_0x1aa0('0x1e')]?_[_0x1aa0('0x1d')](_0x190715[_0x1aa0('0x1e')],function(_0x1e7cc6){return{'model':db[_0x1e7cc6[_0x1aa0('0x1f')]],'as':_0x1e7cc6['as'],'attributes':_0x1e7cc6['attributes']};}):[]};}):[]};}):[]:[]})[_0x1aa0('0xc')](function(_0x752a17){var _0x4555ad=[];for(var _0x151279=0x0;_0x151279<_0x752a17[_0x1aa0('0x2e')];_0x151279+=0x1){_0x4555ad[_0x1aa0('0x41')](_0x752a17[_0x151279][_0x1aa0('0x26')](_0xd02282[_0x1aa0('0x23')],{'transaction':_0x498aa2}));}return BPromise[_0x1aa0('0x2f')](_0x4555ad);});})['then'](function(_0x5708f2){logger[_0x1aa0('0xd')](_0x1aa0('0x3d'),_0xd02282);logger['debug'](_0x1aa0('0x3d'),_0xd02282,JSON['stringify'](_0x5708f2));_0x248134(_0x5708f2);})[_0x1aa0('0x16')](function(_0x742508){logger[_0x1aa0('0x13')](_0x1aa0('0x3d'),_0x742508[_0x1aa0('0x14')],_0xd02282);_0x1feb28(_0x43f5ff[_0x1aa0('0x13')](0x1f4,_0x742508[_0x1aa0('0x14')]));});});});}; \ No newline at end of file +var _0x65cc=['GetContactRecallMe','CmContact','describe','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetCmHopper','CmHopper','findAll','options','raw','where','attributes','limit','include','map','model','ShowCmHopper','find','create','body','CreateCmHopper','UpdateCmHopper','update','DestroyCmHopper','destroy','GetContactDialer','transaction','LOCK','UPDATE','Contact','keys','length','push','all','MoveContactManagedDialer','sequelize','CmHopperFinal','CountReScheduled','COUNT','literal','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled'];(function(_0x4f0168,_0x3312d3){var _0x299795=function(_0x2d4893){while(--_0x2d4893){_0x4f0168['push'](_0x4f0168['shift']());}};_0x299795(++_0x3312d3);}(_0x65cc,0x189));var _0xc65c=function(_0x28e9b6,_0x11ba36){_0x28e9b6=_0x28e9b6-0x0;var _0x58008b=_0x65cc[_0x28e9b6];return _0x58008b;};'use strict';var _=require('lodash');var util=require(_0xc65c('0x0'));var moment=require(_0xc65c('0x1'));var BPromise=require(_0xc65c('0x2'));var rs=require(_0xc65c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc65c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc65c('0x5'))(_0xc65c('0x6'));var config=require(_0xc65c('0x7'));var jayson=require(_0xc65c('0x8'));var client=jayson['client'][_0xc65c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2af061,_0x4f16ae,_0x1f3b34){return new BPromise(function(_0x311f4a,_0x133db0){return client[_0xc65c('0xa')](_0x2af061,_0x1f3b34)[_0xc65c('0xb')](function(_0x108a37){logger['info'](_0xc65c('0xc'),_0x4f16ae,_0xc65c('0xd'));logger[_0xc65c('0xe')](_0xc65c('0xf'),_0x4f16ae,_0xc65c('0xd'),JSON[_0xc65c('0x10')](_0x108a37));if(_0x108a37[_0xc65c('0x11')]){if(_0x108a37['error'][_0xc65c('0x12')]===0x1f4){logger[_0xc65c('0x11')](_0xc65c('0xc'),_0x4f16ae,_0x108a37['error'][_0xc65c('0x13')]);return _0x133db0(_0x108a37[_0xc65c('0x11')][_0xc65c('0x13')]);}logger[_0xc65c('0x11')](_0xc65c('0xc'),_0x4f16ae,_0x108a37[_0xc65c('0x11')][_0xc65c('0x13')]);return _0x311f4a(_0x108a37[_0xc65c('0x11')][_0xc65c('0x13')]);}else{logger[_0xc65c('0x14')](_0xc65c('0xc'),_0x4f16ae,_0xc65c('0xd'));_0x311f4a(_0x108a37[_0xc65c('0x15')][_0xc65c('0x13')]);}})[_0xc65c('0x16')](function(_0x928b94){logger[_0xc65c('0x11')](_0xc65c('0xc'),_0x4f16ae,_0x928b94);_0x133db0(_0x928b94);});});}exports[_0xc65c('0x17')]=function(_0xb097a0){var _0xafd3a2=this;return new Promise(function(_0x435496,_0x3fbeab){return db[_0xc65c('0x18')][_0xc65c('0x19')]({'raw':_0xb097a0[_0xc65c('0x1a')]?_0xb097a0[_0xc65c('0x1a')][_0xc65c('0x1b')]===undefined?!![]:![]:!![],'where':_0xb097a0['options']?_0xb097a0['options'][_0xc65c('0x1c')]||null:null,'attributes':_0xb097a0[_0xc65c('0x1a')]?_0xb097a0['options'][_0xc65c('0x1d')]||null:null,'limit':_0xb097a0[_0xc65c('0x1a')]?_0xb097a0[_0xc65c('0x1a')][_0xc65c('0x1e')]||null:null,'include':_0xb097a0[_0xc65c('0x1a')]?_0xb097a0[_0xc65c('0x1a')][_0xc65c('0x1f')]?_[_0xc65c('0x20')](_0xb097a0[_0xc65c('0x1a')]['include'],function(_0x250c17){return{'model':db[_0x250c17['model']],'as':_0x250c17['as'],'attributes':_0x250c17['attributes'],'include':_0x250c17[_0xc65c('0x1f')]?_['map'](_0x250c17['include'],function(_0x103f6a){return{'model':db[_0x103f6a[_0xc65c('0x21')]],'as':_0x103f6a['as'],'attributes':_0x103f6a[_0xc65c('0x1d')],'include':_0x103f6a[_0xc65c('0x1f')]?_['map'](_0x103f6a[_0xc65c('0x1f')],function(_0xa8dcff){return{'model':db[_0xa8dcff[_0xc65c('0x21')]],'as':_0xa8dcff['as'],'attributes':_0xa8dcff[_0xc65c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xc65c('0xb')](function(_0x63c959){logger[_0xc65c('0x14')](_0xc65c('0x17'),_0xb097a0);logger[_0xc65c('0xe')](_0xc65c('0x17'),_0xb097a0,JSON[_0xc65c('0x10')](_0x63c959));_0x435496(_0x63c959);})[_0xc65c('0x16')](function(_0x15fd06){logger[_0xc65c('0x11')](_0xc65c('0x17'),_0x15fd06['message'],_0xb097a0);_0x3fbeab(_0xafd3a2[_0xc65c('0x11')](0x1f4,_0x15fd06[_0xc65c('0x13')]));});});};exports[_0xc65c('0x22')]=function(_0x427a50){var _0x55f25b=this;return new Promise(function(_0x36beda,_0x20511f){return db[_0xc65c('0x18')][_0xc65c('0x23')]({'raw':_0x427a50['options']?_0x427a50['options']['raw']===undefined?!![]:![]:!![],'where':_0x427a50[_0xc65c('0x1a')]?_0x427a50[_0xc65c('0x1a')][_0xc65c('0x1c')]||null:null,'attributes':_0x427a50[_0xc65c('0x1a')]?_0x427a50[_0xc65c('0x1a')][_0xc65c('0x1d')]||null:null,'include':_0x427a50['options']?_0x427a50[_0xc65c('0x1a')][_0xc65c('0x1f')]?_['map'](_0x427a50['options'][_0xc65c('0x1f')],function(_0x3fc289){return{'model':db[_0x3fc289['model']],'as':_0x3fc289['as'],'attributes':_0x3fc289[_0xc65c('0x1d')],'include':_0x3fc289['include']?_[_0xc65c('0x20')](_0x3fc289[_0xc65c('0x1f')],function(_0x53ddc5){return{'model':db[_0x53ddc5[_0xc65c('0x21')]],'as':_0x53ddc5['as'],'attributes':_0x53ddc5[_0xc65c('0x1d')],'include':_0x53ddc5['include']?_[_0xc65c('0x20')](_0x53ddc5[_0xc65c('0x1f')],function(_0x59fd8e){return{'model':db[_0x59fd8e[_0xc65c('0x21')]],'as':_0x59fd8e['as'],'attributes':_0x59fd8e['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x51a233){logger[_0xc65c('0x14')](_0xc65c('0x22'),_0x427a50);logger[_0xc65c('0xe')](_0xc65c('0x22'),_0x427a50,JSON[_0xc65c('0x10')](_0x51a233));_0x36beda(_0x51a233);})['catch'](function(_0x5c10c1){logger[_0xc65c('0x11')](_0xc65c('0x22'),_0x5c10c1[_0xc65c('0x13')],_0x427a50);_0x20511f(_0x55f25b[_0xc65c('0x11')](0x1f4,_0x5c10c1[_0xc65c('0x13')]));});});};exports['CreateCmHopper']=function(_0x105f89){var _0x5aed13=this;return new Promise(function(_0x29804e,_0x13d1ff){return db['CmHopper'][_0xc65c('0x24')](_0x105f89[_0xc65c('0x25')],{'raw':_0x105f89['options']?_0x105f89[_0xc65c('0x1a')][_0xc65c('0x1b')]===undefined?!![]:![]:!![]})[_0xc65c('0xb')](function(_0x14ede7){logger[_0xc65c('0x14')](_0xc65c('0x26'),_0x105f89);logger[_0xc65c('0xe')]('CreateCmHopper',_0x105f89,JSON[_0xc65c('0x10')](_0x14ede7));_0x29804e(_0x14ede7);})['catch'](function(_0x50cb6b){logger[_0xc65c('0x11')]('CreateCmHopper',_0x50cb6b['message'],_0x105f89);_0x13d1ff(_0x5aed13['error'](0x1f4,_0x50cb6b[_0xc65c('0x13')]));});});};exports[_0xc65c('0x27')]=function(_0x178843){var _0x1508a6=this;return new Promise(function(_0x525c34,_0x836491){return db['CmHopper'][_0xc65c('0x28')](_0x178843[_0xc65c('0x25')],{'raw':_0x178843['options']?_0x178843[_0xc65c('0x1a')][_0xc65c('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x178843[_0xc65c('0x1a')]?_0x178843[_0xc65c('0x1a')][_0xc65c('0x1c')]||null:null,'attributes':_0x178843[_0xc65c('0x1a')]?_0x178843[_0xc65c('0x1a')][_0xc65c('0x1d')]||null:null,'limit':_0x178843[_0xc65c('0x1a')]?_0x178843['options'][_0xc65c('0x1e')]||null:null})['then'](function(_0x429849){logger['info'](_0xc65c('0x27'),_0x178843);logger[_0xc65c('0xe')](_0xc65c('0x27'),_0x178843,JSON[_0xc65c('0x10')](_0x429849));_0x525c34(_0x429849);})[_0xc65c('0x16')](function(_0x24ab85){logger[_0xc65c('0x11')]('UpdateCmHopper',_0x24ab85[_0xc65c('0x13')],_0x178843);_0x836491(_0x1508a6[_0xc65c('0x11')](0x1f4,_0x24ab85[_0xc65c('0x13')]));});});};exports[_0xc65c('0x29')]=function(_0x859e4d){var _0x2be124=this;return new Promise(function(_0x5dc6aa,_0x40f770){return db[_0xc65c('0x18')][_0xc65c('0x2a')]({'where':_0x859e4d[_0xc65c('0x1a')]?_0x859e4d[_0xc65c('0x1a')][_0xc65c('0x1c')]||null:null})['then'](function(_0x14eb13){logger['info'](_0xc65c('0x29'),_0x859e4d);logger[_0xc65c('0xe')]('DestroyCmHopper',_0x859e4d,JSON[_0xc65c('0x10')](_0x14eb13));_0x5dc6aa(_0x14eb13);})[_0xc65c('0x16')](function(_0x15aba7){logger[_0xc65c('0x11')](_0xc65c('0x29'),_0x15aba7[_0xc65c('0x13')],_0x859e4d);_0x40f770(_0x2be124[_0xc65c('0x11')](0x1f4,_0x15aba7[_0xc65c('0x13')]));});});};exports[_0xc65c('0x2b')]=function(_0x375381){var _0x5a20bf=this;return new Promise(function(_0x3c4f7f,_0x2549bb){return db['CmContact']['describe']()[_0xc65c('0xb')](function(_0x2949b7){return db['sequelize'][_0xc65c('0x2c')](function(_0xbb0f4b){return db[_0xc65c('0x18')]['findAll']({'where':_0x375381[_0xc65c('0x1a')]?_0x375381[_0xc65c('0x1a')][_0xc65c('0x1c')]||null:null,'attributes':_0x375381[_0xc65c('0x1a')]?_0x375381[_0xc65c('0x1a')][_0xc65c('0x1d')]||null:null,'limit':_0x375381[_0xc65c('0x1a')]?_0x375381[_0xc65c('0x1a')][_0xc65c('0x1e')]||null:null,'order':_0x375381['options']?_0x375381[_0xc65c('0x1a')]['order']||null:null,'transaction':_0xbb0f4b,'lock':_0xbb0f4b[_0xc65c('0x2d')][_0xc65c('0x2e')],'include':[{'model':db['CmContact'],'as':_0xc65c('0x2f'),'attributes':_[_0xc65c('0x30')](_0x2949b7)}]})[_0xc65c('0xb')](function(_0x15d5dc){var _0x2cac5d=[];for(var _0x109e1a=0x0;_0x109e1a<_0x15d5dc[_0xc65c('0x31')];_0x109e1a+=0x1){_0x2cac5d[_0xc65c('0x32')](_0x15d5dc[_0x109e1a][_0xc65c('0x28')](_0x375381['body'],{'transaction':_0xbb0f4b}));}return BPromise[_0xc65c('0x33')](_0x2cac5d);});})[_0xc65c('0xb')](function(_0x1e1f15){logger[_0xc65c('0x14')](_0xc65c('0x2b'),_0x375381);logger[_0xc65c('0xe')](_0xc65c('0x2b'),_0x375381,JSON[_0xc65c('0x10')](_0x1e1f15));_0x3c4f7f(_0x1e1f15);})['catch'](function(_0x1f5f57){logger['error'](_0xc65c('0x2b'),_0x1f5f57[_0xc65c('0x13')],_0x375381);_0x2549bb(_0x5a20bf[_0xc65c('0x11')](0x1f4,_0x1f5f57[_0xc65c('0x13')]));});});});};exports[_0xc65c('0x34')]=function(_0xf806dc){var _0x5ac86f=this;return new Promise(function(_0x1aa917,_0x29fdca){return db[_0xc65c('0x35')][_0xc65c('0x2c')](function(_0x8bb7f1){return db[_0xc65c('0x36')][_0xc65c('0x24')](_0xf806dc[_0xc65c('0x25')],{'raw':_0xf806dc[_0xc65c('0x1a')]?_0xf806dc[_0xc65c('0x1a')][_0xc65c('0x1b')]===undefined?!![]:![]:!![],'transaction':_0x8bb7f1})['then'](function(){return db[_0xc65c('0x18')][_0xc65c('0x2a')]({'where':_0xf806dc[_0xc65c('0x1a')]?_0xf806dc[_0xc65c('0x1a')][_0xc65c('0x1c')]||null:null,'transaction':_0x8bb7f1});});})[_0xc65c('0xb')](function(_0x24e310){logger[_0xc65c('0x14')](_0xc65c('0x34'),_0xf806dc);logger[_0xc65c('0xe')](_0xc65c('0x34'),_0xf806dc,JSON[_0xc65c('0x10')](_0x24e310));_0x1aa917(_0x24e310);})['catch'](function(_0x55257d){logger['error']('MoveContactManagedDialer',_0x55257d['message'],_0xf806dc);_0x29fdca(_0x5ac86f[_0xc65c('0x11')](0x1f4,_0x55257d[_0xc65c('0x13')]));});});};exports[_0xc65c('0x37')]=function(_0x3d79ff){var _0x2705ba=this;return new Promise(function(_0x36361b,_0x4d4b04){return db[_0xc65c('0x18')][_0xc65c('0x19')]({'raw':_0x3d79ff['options']?_0x3d79ff[_0xc65c('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x3d79ff['options']?_0x3d79ff[_0xc65c('0x1a')][_0xc65c('0x1c')]||null:null,'attributes':[[db[_0xc65c('0x35')]['fn'](_0xc65c('0x38'),db[_0xc65c('0x35')]['fn']('IF',db[_0xc65c('0x35')][_0xc65c('0x39')]('`scheduledat`\x20>=\x20'+util[_0xc65c('0x3a')]('\x22%s\x22',moment()[_0xc65c('0x3a')](_0xc65c('0x3b')))+_0xc65c('0x3c')))),_0xc65c('0x3d')]]})['then'](function(_0x2a4264){logger[_0xc65c('0x14')](_0xc65c('0x37'),_0x3d79ff);logger[_0xc65c('0xe')](_0xc65c('0x37'),_0x3d79ff,JSON['stringify'](_0x2a4264));_0x36361b(_0x2a4264);})[_0xc65c('0x16')](function(_0x2e0c5b){logger['error'](_0xc65c('0x37'),_0x2e0c5b['message'],_0x3d79ff);_0x4d4b04(_0x2705ba[_0xc65c('0x11')](0x1f4,_0x2e0c5b[_0xc65c('0x13')]));});});};exports[_0xc65c('0x3e')]=function(_0x1f5f55){var _0x17e9de=this;return new Promise(function(_0x144b4a,_0x1e0f0a){return db[_0xc65c('0x3f')][_0xc65c('0x40')]()[_0xc65c('0xb')](function(_0x298d0c){return db['sequelize']['transaction'](function(_0x23a6c9){return db[_0xc65c('0x18')][_0xc65c('0x19')]({'where':_0x1f5f55[_0xc65c('0x1a')]?_0x1f5f55[_0xc65c('0x1a')][_0xc65c('0x1c')]||null:null,'attributes':_0x1f5f55['options']?_0x1f5f55[_0xc65c('0x1a')][_0xc65c('0x1d')]||null:null,'limit':0x1,'order':_0x1f5f55[_0xc65c('0x1a')]?_0x1f5f55[_0xc65c('0x1a')]['order']||null:null,'group':db[_0xc65c('0x18')]['UserId'],'transaction':_0x23a6c9,'lock':_0x23a6c9['LOCK'][_0xc65c('0x2e')],'include':_0x1f5f55[_0xc65c('0x1a')]?_0x1f5f55[_0xc65c('0x1a')][_0xc65c('0x1f')]?_[_0xc65c('0x20')](_0x1f5f55[_0xc65c('0x1a')][_0xc65c('0x1f')],function(_0x50a059){return{'model':db[_0x50a059[_0xc65c('0x21')]],'as':_0x50a059['as'],'attributes':_0x50a059[_0xc65c('0x1d')],'include':_0x50a059[_0xc65c('0x1f')]?_[_0xc65c('0x20')](_0x50a059[_0xc65c('0x1f')],function(_0x4781e0){return{'model':db[_0x4781e0['model']],'as':_0x4781e0['as'],'attributes':_0x4781e0[_0xc65c('0x1d')],'include':_0x4781e0[_0xc65c('0x1f')]?_[_0xc65c('0x20')](_0x4781e0[_0xc65c('0x1f')],function(_0x4ebc8b){return{'model':db[_0x4ebc8b[_0xc65c('0x21')]],'as':_0x4ebc8b['as'],'attributes':_0x4ebc8b['attributes']};}):[]};}):[]};}):[]:[]})[_0xc65c('0xb')](function(_0x1b2c04){var _0x6effe4=[];for(var _0x1ec1a9=0x0;_0x1ec1a9<_0x1b2c04['length'];_0x1ec1a9+=0x1){_0x6effe4[_0xc65c('0x32')](_0x1b2c04[_0x1ec1a9][_0xc65c('0x28')](_0x1f5f55[_0xc65c('0x25')],{'transaction':_0x23a6c9}));}return BPromise[_0xc65c('0x33')](_0x6effe4);});})[_0xc65c('0xb')](function(_0x80262a){logger[_0xc65c('0x14')](_0xc65c('0x3e'),_0x1f5f55);logger['debug']('GetContactRecallMe',_0x1f5f55,JSON['stringify'](_0x80262a));_0x144b4a(_0x80262a);})[_0xc65c('0x16')](function(_0x18d3fd){logger[_0xc65c('0x11')](_0xc65c('0x3e'),_0x18d3fd['message'],_0x1f5f55);_0x1e0f0a(_0x17e9de['error'](0x1f4,_0x18d3fd[_0xc65c('0x13')]));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index cdad58f..1876c50 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 _0xb1ec=['show','create','post','getPreview','delete','destroy','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopper.controller','get','isAuthenticated','index','/describe','describe','/opencontacts','/:id'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb1ec,0x65));var _0xcb1e=function(_0xdf68a2,_0x483535){_0xdf68a2=_0xdf68a2-0x0;var _0x5d45a0=_0xb1ec[_0xdf68a2];return _0x5d45a0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xcb1e('0x0'));var timeout=require(_0xcb1e('0x1'));var express=require('express');var router=express['Router']();var auth=require(_0xcb1e('0x2'));var interaction=require(_0xcb1e('0x3'));var config=require(_0xcb1e('0x4'));var controller=require(_0xcb1e('0x5'));router[_0xcb1e('0x6')]('/',auth[_0xcb1e('0x7')](),controller[_0xcb1e('0x8')]);router[_0xcb1e('0x6')](_0xcb1e('0x9'),auth['isAuthenticated'](),controller[_0xcb1e('0xa')]);router[_0xcb1e('0x6')](_0xcb1e('0xb'),auth[_0xcb1e('0x7')](),controller['getOpenContacts']);router['get'](_0xcb1e('0xc'),auth[_0xcb1e('0x7')](),controller[_0xcb1e('0xd')]);router['post']('/',auth[_0xcb1e('0x7')](),controller[_0xcb1e('0xe')]);router[_0xcb1e('0xf')]('/preview',auth[_0xcb1e('0x7')](),controller[_0xcb1e('0x10')]);router['put'](_0xcb1e('0xc'),auth[_0xcb1e('0x7')](),controller['update']);router[_0xcb1e('0x11')](_0xcb1e('0xc'),auth[_0xcb1e('0x7')](),controller[_0xcb1e('0x12')]);module['exports']=router; \ No newline at end of file +var _0x621f=['destroy','exports','multer','path','express','../../components/auth/service','../../config/environment','./cmHopper.controller','get','index','/describe','isAuthenticated','/opencontacts','show','post','/:id'];(function(_0x3bde7b,_0x5f319d){var _0x347214=function(_0x2aaf12){while(--_0x2aaf12){_0x3bde7b['push'](_0x3bde7b['shift']());}};_0x347214(++_0x5f319d);}(_0x621f,0x112));var _0xf621=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x621f[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xf621('0x0'));var util=require('util');var path=require(_0xf621('0x1'));var timeout=require('connect-timeout');var express=require(_0xf621('0x2'));var router=express['Router']();var auth=require(_0xf621('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xf621('0x4'));var controller=require(_0xf621('0x5'));router[_0xf621('0x6')]('/',auth['isAuthenticated'](),controller[_0xf621('0x7')]);router[_0xf621('0x6')](_0xf621('0x8'),auth[_0xf621('0x9')](),controller['describe']);router['get'](_0xf621('0xa'),auth[_0xf621('0x9')](),controller['getOpenContacts']);router[_0xf621('0x6')]('/:id',auth[_0xf621('0x9')](),controller[_0xf621('0xb')]);router[_0xf621('0xc')]('/',auth[_0xf621('0x9')](),controller['create']);router[_0xf621('0xc')]('/preview',auth[_0xf621('0x9')](),controller['getPreview']);router['put'](_0xf621('0xd'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xf621('0xe')]);module[_0xf621('0xf')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index cef819f..df35b0d 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 _0x2b6b=['contactListQueue','INTEGER','exports'];(function(_0x54ff90,_0x4df831){var _0x78a37f=function(_0x1777df){while(--_0x1777df){_0x54ff90['push'](_0x54ff90['shift']());}};_0x78a37f(++_0x4df831);}(_0x2b6b,0xbf));var _0xb2b6=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x2b6b[_0x397e5f];return _0x5302b8;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0xb2b6('0x0')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'ListId':{'type':Sequelize['INTEGER'],'unique':_0xb2b6('0x1')},'VoiceQueueId':{'type':Sequelize[_0xb2b6('0x2')],'unique':_0xb2b6('0x1')}}; \ No newline at end of file +var _0x4e9f=['contactListQueue','moment','sequelize','exports','STRING','INTEGER'];(function(_0x4de4b7,_0x49481f){var _0xa85b65=function(_0x3e1c04){while(--_0x3e1c04){_0x4de4b7['push'](_0x4de4b7['shift']());}};_0xa85b65(++_0x49481f);}(_0x4e9f,0x17b));var _0xf4e9=function(_0x69b12a,_0x5c933b){_0x69b12a=_0x69b12a-0x0;var _0x445cda=_0x4e9f[_0x69b12a];return _0x445cda;};'use strict';var moment=require(_0xf4e9('0x0'));var Sequelize=require(_0xf4e9('0x1'));module[_0xf4e9('0x2')]={'phone':{'type':Sequelize[_0xf4e9('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xf4e9('0x4')],'unique':_0xf4e9('0x5')},'ListId':{'type':Sequelize[_0xf4e9('0x4')],'unique':_0xf4e9('0x5')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0xf4e9('0x5')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 2ef6bfd..95f8fc7 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 _0x087b=['../../config/logger','api','../../config/utils','../../config/environment','status','end','json','count','offset','set','Content-Range','apply','reject','update','then','destroy','send','index','map','CmHopperBlack','rawAttributes','fieldName','key','model','name','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','merge','where','type','VIRTUAL','field','options','includeAll','rows','catch','show','params','intersection','include','find','body','describe','html-pdf','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x51804a,_0x47f01f){var _0x3abc4c=function(_0x3077ec){while(--_0x3077ec){_0x51804a['push'](_0x51804a['shift']());}};_0x3abc4c(++_0x47f01f);}(_0x087b,0x11a));var _0xb087=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0x087b[_0x39096d];return _0x13da4f;};'use strict';var pdf=require(_0xb087('0x0'));var emlformat=require(_0xb087('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb087('0x2'));var rp=require('request-promise');var moment=require(_0xb087('0x3'));var BPromise=require(_0xb087('0x4'));var Mustache=require(_0xb087('0x5'));var util=require(_0xb087('0x6'));var path=require(_0xb087('0x7'));var sox=require(_0xb087('0x8'));var csv=require(_0xb087('0x9'));var ejs=require(_0xb087('0xa'));var fs=require('fs');var _=require(_0xb087('0xb'));var squel=require(_0xb087('0xc'));var crypto=require(_0xb087('0xd'));var jsforce=require(_0xb087('0xe'));var deskjs=require(_0xb087('0xf'));var toCsv=require(_0xb087('0x9'));var querystring=require(_0xb087('0x10'));var Papa=require(_0xb087('0x11'));var Redis=require(_0xb087('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb087('0x13'));var as=require(_0xb087('0x14'));var hardwareService=require(_0xb087('0x15'));var logger=require(_0xb087('0x16'))(_0xb087('0x17'));var utils=require(_0xb087('0x18'));var config=require(_0xb087('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x189e2b,_0x31f977){_0x31f977=_0x31f977||0xcc;return function(_0x323656){if(_0x323656){return _0x189e2b['sendStatus'](_0x31f977);}return _0x189e2b[_0xb087('0x1a')](_0x31f977)[_0xb087('0x1b')]();};}function respondWithResult(_0x43f136,_0x46410b){_0x46410b=_0x46410b||0xc8;return function(_0x11784c){if(_0x11784c){return _0x43f136[_0xb087('0x1a')](_0x46410b)[_0xb087('0x1c')](_0x11784c);}};}function respondWithFilteredResult(_0x5147e3,_0x24e1a3){return function(_0x16d0b7){if(_0x16d0b7){var _0x5193a4=_0x16d0b7[_0xb087('0x1d')],_0x43e576=_0x24e1a3[_0xb087('0x1e')],_0x412b48=_0x24e1a3[_0xb087('0x1e')]+_0x24e1a3['limit'],_0x597478;if(_0x412b48>=_0x5193a4){_0x412b48=_0x5193a4;_0x597478=0xc8;}else{_0x597478=0xce;}_0x5147e3[_0xb087('0x1a')](_0x597478);return _0x5147e3[_0xb087('0x1f')](_0xb087('0x20'),_0x43e576+'-'+_0x412b48+'/'+_0x5193a4)[_0xb087('0x1c')](_0x16d0b7);}return null;};}function patchUpdates(_0x4e333b){return function(_0x13d534){try{jsonpatch[_0xb087('0x21')](_0x13d534,_0x4e333b,!![]);}catch(_0x10bb5b){return BPromise[_0xb087('0x22')](_0x10bb5b);}return _0x13d534['save']();};}function saveUpdates(_0x5aeab1,_0x5ea3dc){return function(_0x49450a){if(_0x49450a){return _0x49450a[_0xb087('0x23')](_0x5aeab1)[_0xb087('0x24')](function(_0x3d0f57){return _0x3d0f57;});}return null;};}function removeEntity(_0x1f3c0e,_0x1fb765){return function(_0x258b4c){if(_0x258b4c){return _0x258b4c[_0xb087('0x25')]()['then'](function(){_0x1f3c0e[_0xb087('0x1a')](0xcc)[_0xb087('0x1b')]();});}};}function handleEntityNotFound(_0x1de654,_0x1cfb3e){return function(_0x3ad74e){if(!_0x3ad74e){_0x1de654['sendStatus'](0x194);}return _0x3ad74e;};}function handleError(_0x183eab,_0xdd4216){_0xdd4216=_0xdd4216||0x1f4;return function(_0x502438){logger['error'](_0x502438['stack']);if(_0x502438['name']){delete _0x502438['name'];}_0x183eab[_0xb087('0x1a')](_0xdd4216)[_0xb087('0x26')](_0x502438);};}exports[_0xb087('0x27')]=function(_0x3ca2df,_0xd9ec66){var _0xb72173={},_0xf3f41f={},_0x35a52c={'count':0x0,'rows':[]};var _0x6cfb22=_[_0xb087('0x28')](db[_0xb087('0x29')][_0xb087('0x2a')],function(_0xb0baf6){return{'name':_0xb0baf6[_0xb087('0x2b')],'type':_0xb0baf6['type'][_0xb087('0x2c')]};});_0xf3f41f[_0xb087('0x2d')]=_[_0xb087('0x28')](_0x6cfb22,_0xb087('0x2e'));_0xf3f41f[_0xb087('0x2f')]=_[_0xb087('0x30')](_0x3ca2df[_0xb087('0x2f')]);_0xf3f41f[_0xb087('0x31')]=_['intersection'](_0xf3f41f['model'],_0xf3f41f[_0xb087('0x2f')]);_0xb72173[_0xb087('0x32')]=_['intersection'](_0xf3f41f[_0xb087('0x2d')],qs[_0xb087('0x33')](_0x3ca2df[_0xb087('0x2f')][_0xb087('0x33')]));_0xb72173[_0xb087('0x32')]=_0xb72173[_0xb087('0x32')][_0xb087('0x34')]?_0xb72173[_0xb087('0x32')]:_0xf3f41f[_0xb087('0x2d')];if(!_0x3ca2df[_0xb087('0x2f')][_0xb087('0x35')](_0xb087('0x36'))){_0xb72173['limit']=qs[_0xb087('0x37')](_0x3ca2df['query'][_0xb087('0x37')]);_0xb72173[_0xb087('0x1e')]=qs[_0xb087('0x1e')](_0x3ca2df[_0xb087('0x2f')][_0xb087('0x1e')]);}_0xb72173[_0xb087('0x38')]=qs[_0xb087('0x39')](_0x3ca2df[_0xb087('0x2f')][_0xb087('0x39')]);_0xb72173['where']=qs['filters'](_[_0xb087('0x3a')](_0x3ca2df[_0xb087('0x2f')],_0xf3f41f[_0xb087('0x31')]));if(_0x3ca2df[_0xb087('0x2f')][_0xb087('0x3b')]){_0xb72173['where']=_[_0xb087('0x3c')](_0xb72173[_0xb087('0x3d')],{'$or':_['map'](_0x6cfb22,function(_0x480e22){if(_0x480e22[_0xb087('0x3e')][_0xb087('0x2c')]!==_0xb087('0x3f')){var _0x4aea2f={};_0x4aea2f[_0x480e22[_0xb087('0x40')]]={'$like':'%'+_0x3ca2df[_0xb087('0x2f')][_0xb087('0x3b')]+'%'};return _0x4aea2f;}})});}_0xb72173=_[_0xb087('0x3c')]({},_0xb72173,_0x3ca2df[_0xb087('0x41')]);var _0x5db6b9={'where':_0xb72173[_0xb087('0x3d')]};return db['CmHopperBlack'][_0xb087('0x1d')](_0x5db6b9)['then'](function(_0x52a98f){_0x35a52c[_0xb087('0x1d')]=_0x52a98f;if(_0x3ca2df['query'][_0xb087('0x42')]){_0xb72173['include']=[{'all':!![]}];}return db[_0xb087('0x29')]['findAll'](_0xb72173);})[_0xb087('0x24')](function(_0x326934){_0x35a52c[_0xb087('0x43')]=_0x326934;return _0x35a52c;})[_0xb087('0x24')](respondWithFilteredResult(_0xd9ec66,_0xb72173))[_0xb087('0x44')](handleError(_0xd9ec66,null));};exports[_0xb087('0x45')]=function(_0x35d010,_0x5e7690){var _0x1625f6={'raw':!![],'where':{'id':_0x35d010[_0xb087('0x46')]['id']}},_0x5662c6={};_0x5662c6[_0xb087('0x2d')]=_['keys'](db[_0xb087('0x29')][_0xb087('0x2a')]);_0x5662c6[_0xb087('0x2f')]=_['keys'](_0x35d010[_0xb087('0x2f')]);_0x5662c6['filters']=_[_0xb087('0x47')](_0x5662c6[_0xb087('0x2d')],_0x5662c6['query']);_0x1625f6[_0xb087('0x32')]=_[_0xb087('0x47')](_0x5662c6['model'],qs[_0xb087('0x33')](_0x35d010[_0xb087('0x2f')]['fields']));_0x1625f6[_0xb087('0x32')]=_0x1625f6[_0xb087('0x32')][_0xb087('0x34')]?_0x1625f6[_0xb087('0x32')]:_0x5662c6['model'];if(_0x35d010['query'][_0xb087('0x42')]){_0x1625f6[_0xb087('0x48')]=[{'all':!![]}];}_0x1625f6=_[_0xb087('0x3c')]({},_0x1625f6,_0x35d010[_0xb087('0x41')]);return db[_0xb087('0x29')][_0xb087('0x49')](_0x1625f6)['then'](handleEntityNotFound(_0x5e7690,null))['then'](respondWithResult(_0x5e7690,null))[_0xb087('0x44')](handleError(_0x5e7690,null));};exports['update']=function(_0x3a405b,_0x3966f4){if(_0x3a405b[_0xb087('0x4a')]['id']){delete _0x3a405b[_0xb087('0x4a')]['id'];}return db['CmHopperBlack'][_0xb087('0x49')]({'where':{'id':_0x3a405b['params']['id']}})[_0xb087('0x24')](handleEntityNotFound(_0x3966f4,null))[_0xb087('0x24')](saveUpdates(_0x3a405b[_0xb087('0x4a')],null))[_0xb087('0x24')](respondWithResult(_0x3966f4,null))[_0xb087('0x44')](handleError(_0x3966f4,null));};exports['destroy']=function(_0x21506f,_0xb15e28){return db[_0xb087('0x29')]['find']({'where':{'id':_0x21506f[_0xb087('0x46')]['id']}})['then'](handleEntityNotFound(_0xb15e28,null))['then'](removeEntity(_0xb15e28,null))[_0xb087('0x44')](handleError(_0xb15e28,null));};exports[_0xb087('0x4b')]=function(_0x5eacf3,_0x4362d4){return db[_0xb087('0x29')][_0xb087('0x4b')]()['then'](respondWithResult(_0x4362d4,null))['catch'](handleError(_0x4362d4,null));}; \ No newline at end of file +var _0xe5b5=['ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','offset','limit','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map','CmHopperBlack','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','field','options','count','includeAll','include','findAll','rows','catch','show','params','body','find','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x501655,_0x1da8fc){var _0x39e7ad=function(_0x58ed01){while(--_0x58ed01){_0x501655['push'](_0x501655['shift']());}};_0x39e7ad(++_0x1da8fc);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x6dd5c,_0x4bfc19){_0x6dd5c=_0x6dd5c-0x0;var _0x5a87fa=_0xe5b5[_0x6dd5c];return _0x5a87fa;};'use strict';var pdf=require(_0x5e5b('0x0'));var emlformat=require(_0x5e5b('0x1'));var rimraf=require(_0x5e5b('0x2'));var zipdir=require(_0x5e5b('0x3'));var jsonpatch=require(_0x5e5b('0x4'));var rp=require(_0x5e5b('0x5'));var moment=require(_0x5e5b('0x6'));var BPromise=require(_0x5e5b('0x7'));var Mustache=require(_0x5e5b('0x8'));var util=require(_0x5e5b('0x9'));var path=require(_0x5e5b('0xa'));var sox=require(_0x5e5b('0xb'));var csv=require(_0x5e5b('0xc'));var ejs=require(_0x5e5b('0xd'));var fs=require('fs');var _=require(_0x5e5b('0xe'));var squel=require(_0x5e5b('0xf'));var crypto=require(_0x5e5b('0x10'));var jsforce=require(_0x5e5b('0x11'));var deskjs=require(_0x5e5b('0x12'));var toCsv=require(_0x5e5b('0xc'));var querystring=require(_0x5e5b('0x13'));var Papa=require(_0x5e5b('0x14'));var Redis=require(_0x5e5b('0x15'));var authService=require('../../components/auth/service');var qs=require(_0x5e5b('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5e5b('0x17'));var logger=require(_0x5e5b('0x18'))(_0x5e5b('0x19'));var utils=require(_0x5e5b('0x1a'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5ebf65,_0x310f71){_0x310f71=_0x310f71||0xcc;return function(_0x18434e){if(_0x18434e){return _0x5ebf65[_0x5e5b('0x1b')](_0x310f71);}return _0x5ebf65[_0x5e5b('0x1c')](_0x310f71)[_0x5e5b('0x1d')]();};}function respondWithResult(_0x1e3483,_0x2e331d){_0x2e331d=_0x2e331d||0xc8;return function(_0x49edd0){if(_0x49edd0){return _0x1e3483[_0x5e5b('0x1c')](_0x2e331d)[_0x5e5b('0x1e')](_0x49edd0);}};}function respondWithFilteredResult(_0x4ff37b,_0x227417){return function(_0x578c14){if(_0x578c14){var _0x4e9509=_0x578c14['count'],_0x13a1cb=_0x227417[_0x5e5b('0x1f')],_0x444435=_0x227417['offset']+_0x227417[_0x5e5b('0x20')],_0xaf9ace;if(_0x444435>=_0x4e9509){_0x444435=_0x4e9509;_0xaf9ace=0xc8;}else{_0xaf9ace=0xce;}_0x4ff37b[_0x5e5b('0x1c')](_0xaf9ace);return _0x4ff37b['set'](_0x5e5b('0x21'),_0x13a1cb+'-'+_0x444435+'/'+_0x4e9509)[_0x5e5b('0x1e')](_0x578c14);}return null;};}function patchUpdates(_0x2281c8){return function(_0x538074){try{jsonpatch[_0x5e5b('0x22')](_0x538074,_0x2281c8,!![]);}catch(_0x3f1103){return BPromise['reject'](_0x3f1103);}return _0x538074[_0x5e5b('0x23')]();};}function saveUpdates(_0x1aa0c2,_0x3c488e){return function(_0x2d8252){if(_0x2d8252){return _0x2d8252[_0x5e5b('0x24')](_0x1aa0c2)[_0x5e5b('0x25')](function(_0x93df5c){return _0x93df5c;});}return null;};}function removeEntity(_0x37552c,_0x4a78e3){return function(_0x512e46){if(_0x512e46){return _0x512e46[_0x5e5b('0x26')]()[_0x5e5b('0x25')](function(){_0x37552c[_0x5e5b('0x1c')](0xcc)[_0x5e5b('0x1d')]();});}};}function handleEntityNotFound(_0x2e38ed,_0x28cd95){return function(_0x135c6c){if(!_0x135c6c){_0x2e38ed[_0x5e5b('0x1b')](0x194);}return _0x135c6c;};}function handleError(_0x161599,_0x26bc02){_0x26bc02=_0x26bc02||0x1f4;return function(_0x1788fd){logger['error'](_0x1788fd[_0x5e5b('0x27')]);if(_0x1788fd[_0x5e5b('0x28')]){delete _0x1788fd[_0x5e5b('0x28')];}_0x161599['status'](_0x26bc02)[_0x5e5b('0x29')](_0x1788fd);};}exports[_0x5e5b('0x2a')]=function(_0x5ee866,_0x13ff91){var _0x21c74b={},_0x39ce16={},_0x36b595={'count':0x0,'rows':[]};var _0x31af09=_[_0x5e5b('0x2b')](db[_0x5e5b('0x2c')][_0x5e5b('0x2d')],function(_0x3f6b25){return{'name':_0x3f6b25[_0x5e5b('0x2e')],'type':_0x3f6b25[_0x5e5b('0x2f')][_0x5e5b('0x30')]};});_0x39ce16['model']=_['map'](_0x31af09,_0x5e5b('0x28'));_0x39ce16[_0x5e5b('0x31')]=_[_0x5e5b('0x32')](_0x5ee866[_0x5e5b('0x31')]);_0x39ce16[_0x5e5b('0x33')]=_['intersection'](_0x39ce16[_0x5e5b('0x34')],_0x39ce16['query']);_0x21c74b[_0x5e5b('0x35')]=_[_0x5e5b('0x36')](_0x39ce16[_0x5e5b('0x34')],qs[_0x5e5b('0x37')](_0x5ee866['query'][_0x5e5b('0x37')]));_0x21c74b[_0x5e5b('0x35')]=_0x21c74b['attributes'][_0x5e5b('0x38')]?_0x21c74b[_0x5e5b('0x35')]:_0x39ce16[_0x5e5b('0x34')];if(!_0x5ee866[_0x5e5b('0x31')][_0x5e5b('0x39')](_0x5e5b('0x3a'))){_0x21c74b[_0x5e5b('0x20')]=qs[_0x5e5b('0x20')](_0x5ee866['query'][_0x5e5b('0x20')]);_0x21c74b[_0x5e5b('0x1f')]=qs[_0x5e5b('0x1f')](_0x5ee866[_0x5e5b('0x31')][_0x5e5b('0x1f')]);}_0x21c74b[_0x5e5b('0x3b')]=qs['sort'](_0x5ee866['query'][_0x5e5b('0x3c')]);_0x21c74b[_0x5e5b('0x3d')]=qs[_0x5e5b('0x33')](_['pick'](_0x5ee866[_0x5e5b('0x31')],_0x39ce16[_0x5e5b('0x33')]));if(_0x5ee866[_0x5e5b('0x31')][_0x5e5b('0x3e')]){_0x21c74b['where']=_[_0x5e5b('0x3f')](_0x21c74b[_0x5e5b('0x3d')],{'$or':_['map'](_0x31af09,function(_0x5ad9a6){if(_0x5ad9a6[_0x5e5b('0x2f')][_0x5e5b('0x30')]!==_0x5e5b('0x40')){var _0x550faf={};_0x550faf[_0x5ad9a6[_0x5e5b('0x41')]]={'$like':'%'+_0x5ee866['query']['filter']+'%'};return _0x550faf;}})});}_0x21c74b=_[_0x5e5b('0x3f')]({},_0x21c74b,_0x5ee866[_0x5e5b('0x42')]);var _0xef0295={'where':_0x21c74b[_0x5e5b('0x3d')]};return db[_0x5e5b('0x2c')][_0x5e5b('0x43')](_0xef0295)[_0x5e5b('0x25')](function(_0x14ac35){_0x36b595[_0x5e5b('0x43')]=_0x14ac35;if(_0x5ee866['query'][_0x5e5b('0x44')]){_0x21c74b[_0x5e5b('0x45')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x5e5b('0x46')](_0x21c74b);})['then'](function(_0x125f95){_0x36b595[_0x5e5b('0x47')]=_0x125f95;return _0x36b595;})[_0x5e5b('0x25')](respondWithFilteredResult(_0x13ff91,_0x21c74b))[_0x5e5b('0x48')](handleError(_0x13ff91,null));};exports[_0x5e5b('0x49')]=function(_0xbe8b1d,_0x371550){var _0x24d81f={'raw':!![],'where':{'id':_0xbe8b1d[_0x5e5b('0x4a')]['id']}},_0x1ac758={};_0x1ac758[_0x5e5b('0x34')]=_['keys'](db[_0x5e5b('0x2c')][_0x5e5b('0x2d')]);_0x1ac758[_0x5e5b('0x31')]=_['keys'](_0xbe8b1d[_0x5e5b('0x31')]);_0x1ac758[_0x5e5b('0x33')]=_['intersection'](_0x1ac758[_0x5e5b('0x34')],_0x1ac758[_0x5e5b('0x31')]);_0x24d81f['attributes']=_[_0x5e5b('0x36')](_0x1ac758['model'],qs['fields'](_0xbe8b1d['query'][_0x5e5b('0x37')]));_0x24d81f['attributes']=_0x24d81f[_0x5e5b('0x35')]['length']?_0x24d81f[_0x5e5b('0x35')]:_0x1ac758[_0x5e5b('0x34')];if(_0xbe8b1d[_0x5e5b('0x31')][_0x5e5b('0x44')]){_0x24d81f[_0x5e5b('0x45')]=[{'all':!![]}];}_0x24d81f=_[_0x5e5b('0x3f')]({},_0x24d81f,_0xbe8b1d[_0x5e5b('0x42')]);return db['CmHopperBlack']['find'](_0x24d81f)[_0x5e5b('0x25')](handleEntityNotFound(_0x371550,null))['then'](respondWithResult(_0x371550,null))['catch'](handleError(_0x371550,null));};exports['update']=function(_0x249922,_0x5d63cc){if(_0x249922[_0x5e5b('0x4b')]['id']){delete _0x249922[_0x5e5b('0x4b')]['id'];}return db[_0x5e5b('0x2c')][_0x5e5b('0x4c')]({'where':{'id':_0x249922[_0x5e5b('0x4a')]['id']}})[_0x5e5b('0x25')](handleEntityNotFound(_0x5d63cc,null))['then'](saveUpdates(_0x249922[_0x5e5b('0x4b')],null))[_0x5e5b('0x25')](respondWithResult(_0x5d63cc,null))['catch'](handleError(_0x5d63cc,null));};exports[_0x5e5b('0x26')]=function(_0x4fe839,_0x41e4b3){return db[_0x5e5b('0x2c')][_0x5e5b('0x4c')]({'where':{'id':_0x4fe839[_0x5e5b('0x4a')]['id']}})['then'](handleEntityNotFound(_0x41e4b3,null))[_0x5e5b('0x25')](removeEntity(_0x41e4b3,null))[_0x5e5b('0x48')](handleError(_0x41e4b3,null));};exports['describe']=function(_0x251997,_0x18844c){return db[_0x5e5b('0x2c')][_0x5e5b('0x4d')]()[_0x5e5b('0x25')](respondWithResult(_0x18844c,null))[_0x5e5b('0x48')](handleError(_0x18844c,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 483fd43..2f21c0e 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 _0xd9f7=['cm_hopper_black','lodash','util','moment','bluebird','path','rimraf','./cmHopperBlack.attributes','exports'];(function(_0x1d7eb1,_0x31f2a8){var _0x23f655=function(_0x47f740){while(--_0x47f740){_0x1d7eb1['push'](_0x1d7eb1['shift']());}};_0x23f655(++_0x31f2a8);}(_0xd9f7,0x106));var _0x7d9f=function(_0x1fa98d,_0x3ba2b2){_0x1fa98d=_0x1fa98d-0x0;var _0x26f5d8=_0xd9f7[_0x1fa98d];return _0x26f5d8;};'use strict';var _=require(_0x7d9f('0x0'));var util=require(_0x7d9f('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x7d9f('0x2'));var BPromise=require(_0x7d9f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7d9f('0x4'));var rimraf=require(_0x7d9f('0x5'));var config=require('../../config/environment');var attributes=require(_0x7d9f('0x6'));module[_0x7d9f('0x7')]=function(_0x428e9f,_0x537c32){return _0x428e9f['define']('CmHopperBlack',attributes,{'tableName':_0x7d9f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1421=['rimraf','../../config/environment','./cmHopperBlack.attributes','exports','define','CmHopperBlack','lodash','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x38469e,_0x109681){var _0x38c50b=function(_0x435fa2){while(--_0x435fa2){_0x38469e['push'](_0x38469e['shift']());}};_0x38c50b(++_0x109681);}(_0x1421,0x72));var _0x1142=function(_0x468e85,_0x5a1304){_0x468e85=_0x468e85-0x0;var _0x1e48ce=_0x1421[_0x468e85];return _0x1e48ce;};'use strict';var _=require(_0x1142('0x0'));var util=require('util');var logger=require(_0x1142('0x1'))('api');var moment=require(_0x1142('0x2'));var BPromise=require(_0x1142('0x3'));var rp=require(_0x1142('0x4'));var fs=require('fs');var path=require(_0x1142('0x5'));var rimraf=require(_0x1142('0x6'));var config=require(_0x1142('0x7'));var attributes=require(_0x1142('0x8'));module[_0x1142('0x9')]=function(_0x540f01,_0x566b79){return _0x540f01[_0x1142('0xa')](_0x1142('0xb'),attributes,{'tableName':'cm_hopper_black','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index 1aebc59..b505ce3 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 _0x84ca=['CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetCmHopperBlack','options','raw','model','attributes','include','map','CmHopperBlack','update','where','limit','UpdateCmHopperBlack','DestroyCmHopperBlack','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x5219aa,_0x357da6){var _0x479261=function(_0x552e4e){while(--_0x552e4e){_0x5219aa['push'](_0x5219aa['shift']());}};_0x479261(++_0x357da6);}(_0x84ca,0xa9));var _0xa84c=function(_0x55f79f,_0x4afd2f){_0x55f79f=_0x55f79f-0x0;var _0x28c06c=_0x84ca[_0x55f79f];return _0x28c06c;};'use strict';var _=require(_0xa84c('0x0'));var util=require(_0xa84c('0x1'));var moment=require(_0xa84c('0x2'));var BPromise=require(_0xa84c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa84c('0x4'));var db=require(_0xa84c('0x5'))['db'];var utils=require(_0xa84c('0x6'));var logger=require('../../config/logger')(_0xa84c('0x7'));var config=require('../../config/environment');var jayson=require(_0xa84c('0x8'));var client=jayson[_0xa84c('0x9')][_0xa84c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x27addb,_0x5ae0cf,_0x11ceda){return new BPromise(function(_0x5a5bd0,_0x236ae3){return client[_0xa84c('0xb')](_0x27addb,_0x11ceda)[_0xa84c('0xc')](function(_0x2b5a1e){logger['info'](_0xa84c('0xd'),_0x5ae0cf,_0xa84c('0xe'));logger[_0xa84c('0xf')](_0xa84c('0x10'),_0x5ae0cf,_0xa84c('0xe'),JSON[_0xa84c('0x11')](_0x2b5a1e));if(_0x2b5a1e[_0xa84c('0x12')]){if(_0x2b5a1e[_0xa84c('0x12')][_0xa84c('0x13')]===0x1f4){logger[_0xa84c('0x12')](_0xa84c('0xd'),_0x5ae0cf,_0x2b5a1e['error'][_0xa84c('0x14')]);return _0x236ae3(_0x2b5a1e[_0xa84c('0x12')]['message']);}logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x5ae0cf,_0x2b5a1e[_0xa84c('0x12')][_0xa84c('0x14')]);return _0x5a5bd0(_0x2b5a1e[_0xa84c('0x12')]['message']);}else{logger[_0xa84c('0x15')](_0xa84c('0xd'),_0x5ae0cf,_0xa84c('0xe'));_0x5a5bd0(_0x2b5a1e[_0xa84c('0x16')][_0xa84c('0x14')]);}})[_0xa84c('0x17')](function(_0x2dce78){logger[_0xa84c('0x12')](_0xa84c('0xd'),_0x5ae0cf,_0x2dce78);_0x236ae3(_0x2dce78);});});}exports[_0xa84c('0x18')]=function(_0x377186){var _0x2ef20a=this;return new Promise(function(_0x33c18b,_0x55e7a4){return db['CmHopperBlack']['findAll']({'raw':_0x377186[_0xa84c('0x19')]?_0x377186[_0xa84c('0x19')][_0xa84c('0x1a')]===undefined?!![]:![]:!![],'where':_0x377186[_0xa84c('0x19')]?_0x377186['options']['where']||null:null,'attributes':_0x377186[_0xa84c('0x19')]?_0x377186['options']['attributes']||null:null,'limit':_0x377186['options']?_0x377186[_0xa84c('0x19')]['limit']||null:null,'include':_0x377186[_0xa84c('0x19')]?_0x377186[_0xa84c('0x19')]['include']?_['map'](_0x377186[_0xa84c('0x19')]['include'],function(_0x39a00a){return{'model':db[_0x39a00a[_0xa84c('0x1b')]],'as':_0x39a00a['as'],'attributes':_0x39a00a[_0xa84c('0x1c')],'include':_0x39a00a[_0xa84c('0x1d')]?_[_0xa84c('0x1e')](_0x39a00a[_0xa84c('0x1d')],function(_0x3b52f4){return{'model':db[_0x3b52f4[_0xa84c('0x1b')]],'as':_0x3b52f4['as'],'attributes':_0x3b52f4['attributes'],'include':_0x3b52f4[_0xa84c('0x1d')]?_[_0xa84c('0x1e')](_0x3b52f4[_0xa84c('0x1d')],function(_0x18f22c){return{'model':db[_0x18f22c[_0xa84c('0x1b')]],'as':_0x18f22c['as'],'attributes':_0x18f22c[_0xa84c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa84c('0xc')](function(_0x5641f3){logger[_0xa84c('0x15')](_0xa84c('0x18'),_0x377186);logger[_0xa84c('0xf')](_0xa84c('0x18'),_0x377186,JSON['stringify'](_0x5641f3));_0x33c18b(_0x5641f3);})['catch'](function(_0x136f9f){logger[_0xa84c('0x12')](_0xa84c('0x18'),_0x136f9f[_0xa84c('0x14')],_0x377186);_0x55e7a4(_0x2ef20a[_0xa84c('0x12')](0x1f4,_0x136f9f[_0xa84c('0x14')]));});});};exports['UpdateCmHopperBlack']=function(_0x50f83d){var _0x4bb7b5=this;return new Promise(function(_0x167021,_0x25c24a){return db[_0xa84c('0x1f')][_0xa84c('0x20')](_0x50f83d['body'],{'raw':_0x50f83d['options']?_0x50f83d[_0xa84c('0x19')][_0xa84c('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x50f83d[_0xa84c('0x19')]?_0x50f83d[_0xa84c('0x19')][_0xa84c('0x21')]||null:null,'attributes':_0x50f83d['options']?_0x50f83d['options'][_0xa84c('0x1c')]||null:null,'limit':_0x50f83d['options']?_0x50f83d[_0xa84c('0x19')][_0xa84c('0x22')]||null:null})['then'](function(_0x4fdb82){logger[_0xa84c('0x15')](_0xa84c('0x23'),_0x50f83d);logger[_0xa84c('0xf')](_0xa84c('0x23'),_0x50f83d,JSON[_0xa84c('0x11')](_0x4fdb82));_0x167021(_0x4fdb82);})[_0xa84c('0x17')](function(_0x1c7ef0){logger[_0xa84c('0x12')](_0xa84c('0x23'),_0x1c7ef0['message'],_0x50f83d);_0x25c24a(_0x4bb7b5[_0xa84c('0x12')](0x1f4,_0x1c7ef0['message']));});});};exports[_0xa84c('0x24')]=function(_0x52d921){var _0x5f5155=this;return new Promise(function(_0x362e69,_0x3822bf){return db[_0xa84c('0x1f')]['destroy']({'where':_0x52d921['options']?_0x52d921[_0xa84c('0x19')]['where']||null:null})[_0xa84c('0xc')](function(_0x2a4623){logger[_0xa84c('0x15')]('DestroyCmHopperBlack',_0x52d921);logger[_0xa84c('0xf')](_0xa84c('0x24'),_0x52d921,JSON['stringify'](_0x2a4623));_0x362e69(_0x2a4623);})['catch'](function(_0x41636a){logger[_0xa84c('0x12')](_0xa84c('0x24'),_0x41636a[_0xa84c('0x14')],_0x52d921);_0x3822bf(_0x5f5155[_0xa84c('0x12')](0x1f4,_0x41636a[_0xa84c('0x14')]));});});}; \ No newline at end of file +var _0x8a52=['debug','error','code','message','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','attributes','limit','include','model','stringify','UpdateCmHopperBlack','update','body','destroy','DestroyCmHopperBlack','lodash','util','moment','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent'];(function(_0x4a3097,_0x58f2bc){var _0x209ebc=function(_0x5b27ea){while(--_0x5b27ea){_0x4a3097['push'](_0x4a3097['shift']());}};_0x209ebc(++_0x58f2bc);}(_0x8a52,0x1ea));var _0x28a5=function(_0x46f9e4,_0xa259ed){_0x46f9e4=_0x46f9e4-0x0;var _0x5e25d1=_0x8a52[_0x46f9e4];return _0x5e25d1;};'use strict';var _=require(_0x28a5('0x0'));var util=require(_0x28a5('0x1'));var moment=require(_0x28a5('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x28a5('0x3'));var db=require(_0x28a5('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x28a5('0x5'));var config=require(_0x28a5('0x6'));var jayson=require(_0x28a5('0x7'));var client=jayson[_0x28a5('0x8')][_0x28a5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x45ce38,_0x2d02e6,_0xae7c68){return new BPromise(function(_0x2345af,_0x208d99){return client['request'](_0x45ce38,_0xae7c68)[_0x28a5('0xa')](function(_0x148d9d){logger[_0x28a5('0xb')](_0x28a5('0xc'),_0x2d02e6,_0x28a5('0xd'));logger[_0x28a5('0xe')]('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x2d02e6,_0x28a5('0xd'),JSON['stringify'](_0x148d9d));if(_0x148d9d[_0x28a5('0xf')]){if(_0x148d9d[_0x28a5('0xf')][_0x28a5('0x10')]===0x1f4){logger['error'](_0x28a5('0xc'),_0x2d02e6,_0x148d9d[_0x28a5('0xf')][_0x28a5('0x11')]);return _0x208d99(_0x148d9d['error'][_0x28a5('0x11')]);}logger[_0x28a5('0xf')](_0x28a5('0xc'),_0x2d02e6,_0x148d9d[_0x28a5('0xf')][_0x28a5('0x11')]);return _0x2345af(_0x148d9d[_0x28a5('0xf')][_0x28a5('0x11')]);}else{logger[_0x28a5('0xb')](_0x28a5('0xc'),_0x2d02e6,_0x28a5('0xd'));_0x2345af(_0x148d9d[_0x28a5('0x12')][_0x28a5('0x11')]);}})[_0x28a5('0x13')](function(_0x46b2fe){logger[_0x28a5('0xf')](_0x28a5('0xc'),_0x2d02e6,_0x46b2fe);_0x208d99(_0x46b2fe);});});}exports[_0x28a5('0x14')]=function(_0x50d3e4){var _0x8cae8b=this;return new Promise(function(_0x45267e,_0x45c806){return db[_0x28a5('0x15')][_0x28a5('0x16')]({'raw':_0x50d3e4[_0x28a5('0x17')]?_0x50d3e4[_0x28a5('0x17')][_0x28a5('0x18')]===undefined?!![]:![]:!![],'where':_0x50d3e4['options']?_0x50d3e4[_0x28a5('0x17')][_0x28a5('0x19')]||null:null,'attributes':_0x50d3e4['options']?_0x50d3e4[_0x28a5('0x17')][_0x28a5('0x1a')]||null:null,'limit':_0x50d3e4[_0x28a5('0x17')]?_0x50d3e4[_0x28a5('0x17')][_0x28a5('0x1b')]||null:null,'include':_0x50d3e4[_0x28a5('0x17')]?_0x50d3e4['options'][_0x28a5('0x1c')]?_['map'](_0x50d3e4[_0x28a5('0x17')][_0x28a5('0x1c')],function(_0x510efe){return{'model':db[_0x510efe[_0x28a5('0x1d')]],'as':_0x510efe['as'],'attributes':_0x510efe[_0x28a5('0x1a')],'include':_0x510efe[_0x28a5('0x1c')]?_['map'](_0x510efe[_0x28a5('0x1c')],function(_0x4b6376){return{'model':db[_0x4b6376[_0x28a5('0x1d')]],'as':_0x4b6376['as'],'attributes':_0x4b6376[_0x28a5('0x1a')],'include':_0x4b6376[_0x28a5('0x1c')]?_['map'](_0x4b6376[_0x28a5('0x1c')],function(_0x5b2ffb){return{'model':db[_0x5b2ffb[_0x28a5('0x1d')]],'as':_0x5b2ffb['as'],'attributes':_0x5b2ffb['attributes']};}):[]};}):[]};}):[]:[]})[_0x28a5('0xa')](function(_0x1dc840){logger['info'](_0x28a5('0x14'),_0x50d3e4);logger[_0x28a5('0xe')](_0x28a5('0x14'),_0x50d3e4,JSON[_0x28a5('0x1e')](_0x1dc840));_0x45267e(_0x1dc840);})['catch'](function(_0x31b5bd){logger['error'](_0x28a5('0x14'),_0x31b5bd[_0x28a5('0x11')],_0x50d3e4);_0x45c806(_0x8cae8b['error'](0x1f4,_0x31b5bd[_0x28a5('0x11')]));});});};exports[_0x28a5('0x1f')]=function(_0x374b48){var _0x4f92eb=this;return new Promise(function(_0xfe7a6,_0x582f14){return db['CmHopperBlack'][_0x28a5('0x20')](_0x374b48[_0x28a5('0x21')],{'raw':_0x374b48[_0x28a5('0x17')]?_0x374b48[_0x28a5('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x374b48[_0x28a5('0x17')]?_0x374b48[_0x28a5('0x17')]['where']||null:null,'attributes':_0x374b48[_0x28a5('0x17')]?_0x374b48[_0x28a5('0x17')][_0x28a5('0x1a')]||null:null,'limit':_0x374b48['options']?_0x374b48[_0x28a5('0x17')][_0x28a5('0x1b')]||null:null})[_0x28a5('0xa')](function(_0x3af2de){logger['info'](_0x28a5('0x1f'),_0x374b48);logger[_0x28a5('0xe')](_0x28a5('0x1f'),_0x374b48,JSON[_0x28a5('0x1e')](_0x3af2de));_0xfe7a6(_0x3af2de);})['catch'](function(_0x43bbd3){logger[_0x28a5('0xf')]('UpdateCmHopperBlack',_0x43bbd3[_0x28a5('0x11')],_0x374b48);_0x582f14(_0x4f92eb[_0x28a5('0xf')](0x1f4,_0x43bbd3[_0x28a5('0x11')]));});});};exports['DestroyCmHopperBlack']=function(_0x46e106){var _0x4f78e3=this;return new Promise(function(_0x5b50dd,_0x7d07ed){return db[_0x28a5('0x15')][_0x28a5('0x22')]({'where':_0x46e106[_0x28a5('0x17')]?_0x46e106['options'][_0x28a5('0x19')]||null:null})[_0x28a5('0xa')](function(_0x1491ad){logger['info'](_0x28a5('0x23'),_0x46e106);logger[_0x28a5('0xe')](_0x28a5('0x23'),_0x46e106,JSON[_0x28a5('0x1e')](_0x1491ad));_0x5b50dd(_0x1491ad);})[_0x28a5('0x13')](function(_0x5c02eb){logger['error'](_0x28a5('0x23'),_0x5c02eb[_0x28a5('0x11')],_0x46e106);_0x7d07ed(_0x4f78e3['error'](0x1f4,_0x5c02eb['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index c0633e6..c2c07f6 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 _0x9957=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router'];(function(_0x28d18d,_0x55896b){var _0x470640=function(_0x57e78b){while(--_0x57e78b){_0x28d18d['push'](_0x28d18d['shift']());}};_0x470640(++_0x55896b);}(_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('./cmHopperBlack.controller');router[_0x7995('0x8')]('/',auth[_0x7995('0x9')](),controller[_0x7995('0xa')]);router[_0x7995('0x8')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller['describe']);router[_0x7995('0x8')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')](_0x7995('0xc'),auth[_0x7995('0x9')](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x11')]);module[_0x7995('0x12')]=router; \ No newline at end of file +var _0x9f62=['/describe','describe','/:id','exports','util','connect-timeout','express','Router','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated'];(function(_0x91f6a1,_0x16e296){var _0x4dfc7c=function(_0x96eaf3){while(--_0x96eaf3){_0x91f6a1['push'](_0x91f6a1['shift']());}};_0x4dfc7c(++_0x16e296);}(_0x9f62,0x154));var _0x29f6=function(_0x534078,_0xcada0f){_0x534078=_0x534078-0x0;var _0x5b26ce=_0x9f62[_0x534078];return _0x5b26ce;};'use strict';var multer=require('multer');var util=require(_0x29f6('0x0'));var path=require('path');var timeout=require(_0x29f6('0x1'));var express=require(_0x29f6('0x2'));var router=express[_0x29f6('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x29f6('0x4'));var controller=require(_0x29f6('0x5'));router[_0x29f6('0x6')]('/',auth[_0x29f6('0x7')](),controller['index']);router[_0x29f6('0x6')](_0x29f6('0x8'),auth[_0x29f6('0x7')](),controller[_0x29f6('0x9')]);router[_0x29f6('0x6')]('/:id',auth['isAuthenticated'](),controller['show']);router['put'](_0x29f6('0xa'),auth[_0x29f6('0x7')](),controller['update']);router['delete'](_0x29f6('0xa'),auth[_0x29f6('0x7')](),controller['destroy']);module[_0x29f6('0xb')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index d80c7e0..6b2533a 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 _0x4ad3=['exports','INTEGER','STRING','DATE','getDataValue','setDataValue','followuptime','diff','seconds','dispositionat','BOOLEAN','sequelize','moment'];(function(_0x81dcac,_0x8ff7db){var _0xc7803b=function(_0x499b29){while(--_0x499b29){_0x81dcac['push'](_0x81dcac['shift']());}};_0xc7803b(++_0x8ff7db);}(_0x4ad3,0x150));var _0x34ad=function(_0x5c7939,_0x22f61e){_0x5c7939=_0x5c7939-0x0;var _0x5bcfbc=_0x4ad3[_0x5c7939];return _0x5bcfbc;};'use strict';var Sequelize=require(_0x34ad('0x0'));var moment=require(_0x34ad('0x1'));module[_0x34ad('0x2')]={'state':{'type':Sequelize[_0x34ad('0x3')](0x2)},'statedesc':{'type':Sequelize[_0x34ad('0x4')]},'scheduledat':{'type':Sequelize[_0x34ad('0x5')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x34ad('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x34ad('0x4')]},'originatecalleridname':{'type':Sequelize[_0x34ad('0x4')]},'calleridnum':{'type':Sequelize[_0x34ad('0x4')]},'calleridname':{'type':Sequelize[_0x34ad('0x4')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x34ad('0x5')]},'endtime':{'type':Sequelize[_0x34ad('0x5')]},'ringtime':{'type':Sequelize[_0x34ad('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x34ad('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x34ad('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x34ad('0x4')]},'campaigntype':{'type':Sequelize[_0x34ad('0x4')]},'membername':{'type':Sequelize[_0x34ad('0x4')]},'reason':{'type':Sequelize[_0x34ad('0x4')]},'disposition':{'type':Sequelize[_0x34ad('0x4')]},'dispositionat':{'type':Sequelize[_0x34ad('0x5')],'set':function(_0x32c966){var _0x294968=this[_0x34ad('0x6')]('endtime');if(_0x294968&&_0x32c966){this[_0x34ad('0x7')](_0x34ad('0x8'),moment(_0x32c966)[_0x34ad('0x9')](moment(_0x294968),_0x34ad('0xa')));}return this[_0x34ad('0x7')](_0x34ad('0xb'),_0x32c966);}},'amd':{'type':Sequelize[_0x34ad('0xc')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x34ad('0xc')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x34ad('0xc')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x34ad('0x5')]},'callback':{'type':Sequelize[_0x34ad('0xc')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x34ad('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize[_0x34ad('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x34ad('0xc')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x34ad('0x5')]}}; \ No newline at end of file +var _0xbbe5=['STRING','INTEGER','DATE','endtime','setDataValue','followuptime','diff','dispositionat','BOOLEAN','sequelize','moment','exports'];(function(_0x19e20e,_0x1d6b5a){var _0x4e63c5=function(_0x29638a){while(--_0x29638a){_0x19e20e['push'](_0x19e20e['shift']());}};_0x4e63c5(++_0x1d6b5a);}(_0xbbe5,0x171));var _0x5bbe=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbbe5[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x5bbe('0x0'));var moment=require(_0x5bbe('0x1'));module[_0x5bbe('0x2')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x5bbe('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x5bbe('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x5bbe('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x5bbe('0x4')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x5bbe('0x4')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x5bbe('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x5bbe('0x3')]},'originatecalleridname':{'type':Sequelize[_0x5bbe('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x5bbe('0x5')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x5bbe('0x5')]},'endtime':{'type':Sequelize[_0x5bbe('0x5')]},'ringtime':{'type':Sequelize[_0x5bbe('0x4')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x5bbe('0x4')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x5bbe('0x4')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x5bbe('0x3')]},'campaign':{'type':Sequelize[_0x5bbe('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x5bbe('0x3')]},'reason':{'type':Sequelize[_0x5bbe('0x3')]},'disposition':{'type':Sequelize[_0x5bbe('0x3')]},'dispositionat':{'type':Sequelize[_0x5bbe('0x5')],'set':function(_0x20e813){var _0x3952=this['getDataValue'](_0x5bbe('0x6'));if(_0x3952&&_0x20e813){this[_0x5bbe('0x7')](_0x5bbe('0x8'),moment(_0x20e813)[_0x5bbe('0x9')](moment(_0x3952),'seconds'));}return this['setDataValue'](_0x5bbe('0xa'),_0x20e813);}},'amd':{'type':Sequelize[_0x5bbe('0xb')],'defaultValue':![]},'fax':{'type':Sequelize[_0x5bbe('0xb')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x5bbe('0xb')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x5bbe('0xb')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x5bbe('0x5')]},'callback':{'type':Sequelize[_0x5bbe('0xb')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x5bbe('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x5bbe('0x5')]},'deleted':{'type':Sequelize[_0x5bbe('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x5bbe('0x5')]},'recallme':{'type':Sequelize[_0x5bbe('0xb')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x5bbe('0x5')]}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index be50373..15643f4 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 _0x6dea=['where','filter','merge','key','VIRTUAL','field','options','count','includeAll','findAll','rows','catch','show','params','length','include','find','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x200,\x201,\x20null','congestionContacts','dropContacts','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','cm_hopper','fromQuery','phone','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','select','group','moveContactsIvrCampaignHopperFinal','into','CampaignId','scheduledAt','ANY_VALUE(ListId)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','state\x20=\x204','checkContactHopper','CmHopper','findOne','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','to-csv','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','save','update','then','destroy','error','stack','name','send','index','map','CmHopperFinal','rawAttributes','type','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort'];(function(_0xd09d88,_0x5a6e9e){var _0x5425a5=function(_0x35a207){while(--_0x35a207){_0xd09d88['push'](_0xd09d88['shift']());}};_0x5425a5(++_0x5a6e9e);}(_0x6dea,0x1d1));var _0xa6de=function(_0x3de875,_0x4c75ab){_0x3de875=_0x3de875-0x0;var _0x3728e6=_0x6dea[_0x3de875];return _0x3728e6;};'use strict';var pdf=require(_0xa6de('0x0'));var emlformat=require(_0xa6de('0x1'));var rimraf=require(_0xa6de('0x2'));var zipdir=require(_0xa6de('0x3'));var jsonpatch=require(_0xa6de('0x4'));var rp=require('request-promise');var moment=require(_0xa6de('0x5'));var BPromise=require(_0xa6de('0x6'));var Mustache=require(_0xa6de('0x7'));var util=require('util');var path=require(_0xa6de('0x8'));var sox=require(_0xa6de('0x9'));var csv=require('to-csv');var ejs=require(_0xa6de('0xa'));var fs=require('fs');var _=require(_0xa6de('0xb'));var squel=require(_0xa6de('0xc'));var crypto=require(_0xa6de('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa6de('0xe'));var querystring=require(_0xa6de('0xf'));var Papa=require('papaparse');var Redis=require(_0xa6de('0x10'));var authService=require(_0xa6de('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa6de('0x12'));var logger=require(_0xa6de('0x13'))(_0xa6de('0x14'));var utils=require(_0xa6de('0x15'));var config=require(_0xa6de('0x16'));var db=require(_0xa6de('0x17'))['db'];function respondWithStatusCode(_0x3c630a,_0x44939e){_0x44939e=_0x44939e||0xcc;return function(_0x569413){if(_0x569413){return _0x3c630a[_0xa6de('0x18')](_0x44939e);}return _0x3c630a[_0xa6de('0x19')](_0x44939e)[_0xa6de('0x1a')]();};}function respondWithResult(_0x15be90,_0xe6b8){_0xe6b8=_0xe6b8||0xc8;return function(_0x406968){if(_0x406968){return _0x15be90['status'](_0xe6b8)[_0xa6de('0x1b')](_0x406968);}};}function respondWithFilteredResult(_0x41ed0b,_0x3817b2){return function(_0xaeb814){if(_0xaeb814){var _0x7c0459=_0xaeb814['count'],_0x492d40=_0x3817b2[_0xa6de('0x1c')],_0x306cfa=_0x3817b2[_0xa6de('0x1c')]+_0x3817b2[_0xa6de('0x1d')],_0x8beb4e;if(_0x306cfa>=_0x7c0459){_0x306cfa=_0x7c0459;_0x8beb4e=0xc8;}else{_0x8beb4e=0xce;}_0x41ed0b[_0xa6de('0x19')](_0x8beb4e);return _0x41ed0b[_0xa6de('0x1e')](_0xa6de('0x1f'),_0x492d40+'-'+_0x306cfa+'/'+_0x7c0459)[_0xa6de('0x1b')](_0xaeb814);}return null;};}function patchUpdates(_0x42bd46){return function(_0x1d5410){try{jsonpatch['apply'](_0x1d5410,_0x42bd46,!![]);}catch(_0x229045){return BPromise['reject'](_0x229045);}return _0x1d5410[_0xa6de('0x20')]();};}function saveUpdates(_0x47ea3a,_0x31dad8){return function(_0x14b99d){if(_0x14b99d){return _0x14b99d[_0xa6de('0x21')](_0x47ea3a)[_0xa6de('0x22')](function(_0x37056f){return _0x37056f;});}return null;};}function removeEntity(_0x4ba447,_0x16f13f){return function(_0x2f1797){if(_0x2f1797){return _0x2f1797[_0xa6de('0x23')]()[_0xa6de('0x22')](function(){_0x4ba447[_0xa6de('0x19')](0xcc)[_0xa6de('0x1a')]();});}};}function handleEntityNotFound(_0x560b7c,_0x22e07e){return function(_0x3fbb0d){if(!_0x3fbb0d){_0x560b7c['sendStatus'](0x194);}return _0x3fbb0d;};}function handleError(_0x255c72,_0x4e3965){_0x4e3965=_0x4e3965||0x1f4;return function(_0x5d0097){logger[_0xa6de('0x24')](_0x5d0097[_0xa6de('0x25')]);if(_0x5d0097[_0xa6de('0x26')]){delete _0x5d0097['name'];}_0x255c72[_0xa6de('0x19')](_0x4e3965)[_0xa6de('0x27')](_0x5d0097);};}exports[_0xa6de('0x28')]=function(_0x56a325,_0x2c45a6){var _0x3c9283={},_0xb5d1bb={},_0x5e986a={'count':0x0,'rows':[]};var _0x4b4ed1=_[_0xa6de('0x29')](db[_0xa6de('0x2a')][_0xa6de('0x2b')],function(_0x3212c3){return{'name':_0x3212c3['fieldName'],'type':_0x3212c3[_0xa6de('0x2c')]['key']};});_0xb5d1bb['model']=_[_0xa6de('0x29')](_0x4b4ed1,_0xa6de('0x26'));_0xb5d1bb[_0xa6de('0x2d')]=_[_0xa6de('0x2e')](_0x56a325[_0xa6de('0x2d')]);_0xb5d1bb[_0xa6de('0x2f')]=_[_0xa6de('0x30')](_0xb5d1bb[_0xa6de('0x31')],_0xb5d1bb['query']);_0x3c9283[_0xa6de('0x32')]=_[_0xa6de('0x30')](_0xb5d1bb['model'],qs[_0xa6de('0x33')](_0x56a325[_0xa6de('0x2d')]['fields']));_0x3c9283['attributes']=_0x3c9283[_0xa6de('0x32')]['length']?_0x3c9283[_0xa6de('0x32')]:_0xb5d1bb[_0xa6de('0x31')];if(!_0x56a325['query'][_0xa6de('0x34')](_0xa6de('0x35'))){_0x3c9283[_0xa6de('0x1d')]=qs[_0xa6de('0x1d')](_0x56a325[_0xa6de('0x2d')][_0xa6de('0x1d')]);_0x3c9283['offset']=qs[_0xa6de('0x1c')](_0x56a325[_0xa6de('0x2d')]['offset']);}_0x3c9283['order']=qs[_0xa6de('0x36')](_0x56a325[_0xa6de('0x2d')][_0xa6de('0x36')]);_0x3c9283[_0xa6de('0x37')]=qs[_0xa6de('0x2f')](_['pick'](_0x56a325['query'],_0xb5d1bb[_0xa6de('0x2f')]));if(_0x56a325['query'][_0xa6de('0x38')]){_0x3c9283[_0xa6de('0x37')]=_[_0xa6de('0x39')](_0x3c9283[_0xa6de('0x37')],{'$or':_[_0xa6de('0x29')](_0x4b4ed1,function(_0x1f7672){if(_0x1f7672[_0xa6de('0x2c')][_0xa6de('0x3a')]!==_0xa6de('0x3b')){var _0x44f5b1={};_0x44f5b1[_0x1f7672[_0xa6de('0x3c')]]={'$like':'%'+_0x56a325['query']['filter']+'%'};return _0x44f5b1;}})});}_0x3c9283=_[_0xa6de('0x39')]({},_0x3c9283,_0x56a325[_0xa6de('0x3d')]);var _0x50942a={'where':_0x3c9283['where']};return db['CmHopperFinal'][_0xa6de('0x3e')](_0x50942a)[_0xa6de('0x22')](function(_0x1d038e){_0x5e986a[_0xa6de('0x3e')]=_0x1d038e;if(_0x56a325[_0xa6de('0x2d')][_0xa6de('0x3f')]){_0x3c9283['include']=[{'all':!![]}];}return db[_0xa6de('0x2a')][_0xa6de('0x40')](_0x3c9283);})[_0xa6de('0x22')](function(_0x38a36c){_0x5e986a[_0xa6de('0x41')]=_0x38a36c;return _0x5e986a;})[_0xa6de('0x22')](respondWithFilteredResult(_0x2c45a6,_0x3c9283))[_0xa6de('0x42')](handleError(_0x2c45a6,null));};exports[_0xa6de('0x43')]=function(_0x198045,_0x20b4cb){var _0x838df4={'raw':!![],'where':{'id':_0x198045[_0xa6de('0x44')]['id']}},_0x56cfea={};_0x56cfea[_0xa6de('0x31')]=_['keys'](db['CmHopperFinal'][_0xa6de('0x2b')]);_0x56cfea[_0xa6de('0x2d')]=_['keys'](_0x198045['query']);_0x56cfea[_0xa6de('0x2f')]=_[_0xa6de('0x30')](_0x56cfea[_0xa6de('0x31')],_0x56cfea[_0xa6de('0x2d')]);_0x838df4[_0xa6de('0x32')]=_['intersection'](_0x56cfea[_0xa6de('0x31')],qs[_0xa6de('0x33')](_0x198045[_0xa6de('0x2d')]['fields']));_0x838df4[_0xa6de('0x32')]=_0x838df4['attributes'][_0xa6de('0x45')]?_0x838df4[_0xa6de('0x32')]:_0x56cfea[_0xa6de('0x31')];if(_0x198045['query']['includeAll']){_0x838df4[_0xa6de('0x46')]=[{'all':!![]}];}_0x838df4=_[_0xa6de('0x39')]({},_0x838df4,_0x198045[_0xa6de('0x3d')]);return db[_0xa6de('0x2a')][_0xa6de('0x47')](_0x838df4)[_0xa6de('0x22')](handleEntityNotFound(_0x20b4cb,null))[_0xa6de('0x22')](respondWithResult(_0x20b4cb,null))[_0xa6de('0x42')](handleError(_0x20b4cb,null));};exports[_0xa6de('0x48')]=function(_0x2bc11a,_0x19531d){return db[_0xa6de('0x2a')][_0xa6de('0x48')]()[_0xa6de('0x22')](respondWithResult(_0x19531d,null))[_0xa6de('0x42')](handleError(_0x19531d,null));};exports['update']=function(_0x1d02cd,_0x1fe7b8){if(_0x1d02cd[_0xa6de('0x49')][_0xa6de('0x4a')]){delete _0x1d02cd['body'][_0xa6de('0x4a')];}return db[_0xa6de('0x2a')][_0xa6de('0x47')]({'where':{'uniqueid':_0x1d02cd[_0xa6de('0x44')]['id']}})[_0xa6de('0x22')](handleEntityNotFound(_0x1fe7b8,null))['then'](saveUpdates(_0x1d02cd[_0xa6de('0x49')],null))[_0xa6de('0x22')](respondWithResult(_0x1fe7b8,null))[_0xa6de('0x42')](handleError(_0x1fe7b8,null));};exports[_0xa6de('0x4b')]=function(_0x5e9cf0,_0xbf6c6e,_0xb459f3){return db[_0xa6de('0x2a')][_0xa6de('0x40')]({'raw':![],'where':{'VoiceQueueId':_0x5e9cf0[_0xa6de('0x44')]['id']},'attributes':[[db[_0xa6de('0x4c')]['fn'](_0xa6de('0x4d'),db[_0xa6de('0x4c')]['fn']('IF',db[_0xa6de('0x4c')][_0xa6de('0x4e')]('`state`\x20=\x200,\x201,\x20null'))),_0xa6de('0x4f')],[db[_0xa6de('0x4c')]['fn'](_0xa6de('0x4d'),db['sequelize']['fn']('IF',db[_0xa6de('0x4c')]['literal'](_0xa6de('0x50')))),_0xa6de('0x51')],[db['sequelize']['fn'](_0xa6de('0x4d'),db[_0xa6de('0x4c')]['fn']('IF',db[_0xa6de('0x4c')][_0xa6de('0x4e')](_0xa6de('0x52')))),_0xa6de('0x53')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xa6de('0x4c')]['literal'](_0xa6de('0x54')))),'congestionContacts'],[db['sequelize']['fn']('COUNT',db[_0xa6de('0x4c')]['fn']('IF',db[_0xa6de('0x4c')]['literal'](_0xa6de('0x55')))),'dropContacts'],[db[_0xa6de('0x4c')]['fn'](_0xa6de('0x4d'),db[_0xa6de('0x4c')]['fn']('IF',db[_0xa6de('0x4c')][_0xa6de('0x4e')](_0xa6de('0x56')))),_0xa6de('0x57')],[db[_0xa6de('0x4c')]['fn'](_0xa6de('0x4d'),db['sequelize']['fn']('IF',db['sequelize'][_0xa6de('0x4e')](_0xa6de('0x58')))),_0xa6de('0x59')],[db[_0xa6de('0x4c')]['fn'](_0xa6de('0x4d'),db[_0xa6de('0x4c')]['fn']('IF',db['sequelize'][_0xa6de('0x4e')]('`state`\x20=\x2019,\x201,\x20null'))),'answeringMachine']]})['then'](handleEntityNotFound(_0xbf6c6e,null))[_0xa6de('0x22')](respondWithResult(_0xbf6c6e,null))[_0xa6de('0x42')](handleError(_0xbf6c6e,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x24be8f,_0x4bc9f4,_0x48dafe){return db['CmHopperFinal'][_0xa6de('0x40')]({'raw':![],'where':{'CampaignId':_0x24be8f['params']['id']},'attributes':[[db['sequelize']['fn'](_0xa6de('0x4d'),db['sequelize']['fn']('IF',db[_0xa6de('0x4c')]['literal'](_0xa6de('0x5a')))),_0xa6de('0x4f')],[db[_0xa6de('0x4c')]['fn'](_0xa6de('0x4d'),db[_0xa6de('0x4c')]['fn']('IF',db[_0xa6de('0x4c')]['literal'](_0xa6de('0x50')))),'noAnswerContacts'],[db[_0xa6de('0x4c')]['fn'](_0xa6de('0x4d'),db[_0xa6de('0x4c')]['fn']('IF',db[_0xa6de('0x4c')]['literal'](_0xa6de('0x52')))),_0xa6de('0x53')],[db[_0xa6de('0x4c')]['fn'](_0xa6de('0x4d'),db['sequelize']['fn']('IF',db[_0xa6de('0x4c')][_0xa6de('0x4e')](_0xa6de('0x54')))),_0xa6de('0x5b')],[db[_0xa6de('0x4c')]['fn'](_0xa6de('0x4d'),db[_0xa6de('0x4c')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xa6de('0x5c')],[db[_0xa6de('0x4c')]['fn'](_0xa6de('0x4d'),db[_0xa6de('0x4c')]['fn']('IF',db['sequelize'][_0xa6de('0x4e')]('`state`\x20=\x2011\x20,\x201,\x20null'))),'abandonedContacts'],[db['sequelize']['fn'](_0xa6de('0x4d'),db[_0xa6de('0x4c')]['fn']('IF',db[_0xa6de('0x4c')][_0xa6de('0x4e')](_0xa6de('0x58')))),_0xa6de('0x59')],[db[_0xa6de('0x4c')]['fn'](_0xa6de('0x4d'),db[_0xa6de('0x4c')]['fn']('IF',db[_0xa6de('0x4c')][_0xa6de('0x4e')]('`state`\x20=\x2019,\x201,\x20null'))),'answeringMachine']]})[_0xa6de('0x22')](handleEntityNotFound(_0x4bc9f4,null))['then'](respondWithResult(_0x4bc9f4,null))['catch'](handleError(_0x4bc9f4,null));};exports[_0xa6de('0x5d')]=function(_0x2cd61c,_0x5181bc,_0x5991bd){return db[_0xa6de('0x5e')][_0xa6de('0x47')]({'where':{'id':_0x2cd61c[_0xa6de('0x44')]['id']}})[_0xa6de('0x22')](handleEntityNotFound(_0x5181bc,null))[_0xa6de('0x22')](function(_0x6fff96){var _0x547c0a;if(_0x6fff96){_0x547c0a=squel[_0xa6de('0x5f')]()['into'](_0xa6de('0x60'))[_0xa6de('0x61')]([_0xa6de('0x62'),'scheduledAt',_0xa6de('0x63'),_0xa6de('0x64'),_0xa6de('0x65'),_0xa6de('0x66'),_0xa6de('0x67')],squel['select']()[_0xa6de('0x3c')](_0xa6de('0x68'),_0xa6de('0x62'))[_0xa6de('0x3c')](_0xa6de('0x69'),'scheduledAt')['field'](_0xa6de('0x6a'),_0xa6de('0x63'))[_0xa6de('0x3c')]('ANY_VALUE(ListId)',_0xa6de('0x64'))[_0xa6de('0x3c')](_0xa6de('0x6b'),'VoiceQueueId')[_0xa6de('0x3c')](_0xa6de('0x69'),'createdAt')[_0xa6de('0x3c')](_0xa6de('0x69'),'updatedAt')[_0xa6de('0x6c')](_0xa6de('0x6d'))[_0xa6de('0x37')](_0xa6de('0x6e'),_0x2cd61c[_0xa6de('0x44')]['id'][_0xa6de('0x6f')]())[_0xa6de('0x37')](_0xa6de('0x70'),_0x2cd61c[_0xa6de('0x49')][_0xa6de('0x71')]['toString']())[_0xa6de('0x37')](_0xa6de('0x72'))[_0xa6de('0x37')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xa6de('0x73')]()[_0xa6de('0x3c')](_0xa6de('0x62'))[_0xa6de('0x6c')](_0xa6de('0x60'))[_0xa6de('0x37')](_0xa6de('0x6e'),_0x2cd61c[_0xa6de('0x44')]['id'][_0xa6de('0x6f')]()))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xa6de('0x73')]()[_0xa6de('0x3c')]('calleridnum')[_0xa6de('0x6c')]('cm_hopper_final')[_0xa6de('0x37')](_0xa6de('0x6e'),_0x2cd61c[_0xa6de('0x44')]['id'][_0xa6de('0x6f')]())[_0xa6de('0x37')]('state\x20=\x204'))[_0xa6de('0x74')](_0xa6de('0x63')))['toString']();return db['sequelize']['query'](_0x547c0a);}return[];})[_0xa6de('0x22')](respondWithResult(_0x5181bc,null))[_0xa6de('0x42')](handleError(_0x5181bc,null));};exports[_0xa6de('0x75')]=function(_0x1b9dde,_0x2b485e,_0x5d3be6){return db['Campaign'][_0xa6de('0x47')]({'where':{'id':_0x1b9dde['params']['id']}})[_0xa6de('0x22')](handleEntityNotFound(_0x2b485e,null))[_0xa6de('0x22')](function(_0x591f28){var _0x28ef52;if(_0x591f28){_0x28ef52=squel[_0xa6de('0x5f')]()[_0xa6de('0x76')]('cm_hopper')[_0xa6de('0x61')]([_0xa6de('0x62'),'scheduledAt','ContactId',_0xa6de('0x64'),_0xa6de('0x77'),_0xa6de('0x66'),_0xa6de('0x67')],squel[_0xa6de('0x73')]()['field']('ANY_VALUE(calleridnum)',_0xa6de('0x62'))[_0xa6de('0x3c')](_0xa6de('0x69'),_0xa6de('0x78'))[_0xa6de('0x3c')]('ANY_VALUE(ContactId)',_0xa6de('0x63'))['field'](_0xa6de('0x79'),'ListId')[_0xa6de('0x3c')](_0xa6de('0x7a'),_0xa6de('0x77'))[_0xa6de('0x3c')]('NOW()',_0xa6de('0x66'))[_0xa6de('0x3c')](_0xa6de('0x69'),_0xa6de('0x67'))[_0xa6de('0x6c')](_0xa6de('0x6d'))[_0xa6de('0x37')](_0xa6de('0x7b'),_0x1b9dde[_0xa6de('0x44')]['id'][_0xa6de('0x6f')]())[_0xa6de('0x37')](_0xa6de('0x70'),_0x1b9dde['body'][_0xa6de('0x71')][_0xa6de('0x6f')]())[_0xa6de('0x37')](_0xa6de('0x72'))[_0xa6de('0x37')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xa6de('0x73')]()[_0xa6de('0x3c')](_0xa6de('0x62'))[_0xa6de('0x6c')](_0xa6de('0x60'))[_0xa6de('0x37')](_0xa6de('0x7b'),_0x1b9dde[_0xa6de('0x44')]['id'][_0xa6de('0x6f')]()))[_0xa6de('0x37')](_0xa6de('0x7c'),squel[_0xa6de('0x73')]()[_0xa6de('0x3c')](_0xa6de('0x7d'))[_0xa6de('0x6c')](_0xa6de('0x6d'))[_0xa6de('0x37')](_0xa6de('0x7b'),_0x1b9dde[_0xa6de('0x44')]['id'][_0xa6de('0x6f')]())['where'](_0xa6de('0x7e')))['group'](_0xa6de('0x63')))[_0xa6de('0x6f')]();return db['sequelize'][_0xa6de('0x2d')](_0x28ef52);}return[];})[_0xa6de('0x22')](respondWithResult(_0x2b485e,null))[_0xa6de('0x42')](handleError(_0x2b485e,null));};exports[_0xa6de('0x7f')]=function(_0x6bfcbc,_0x2c7c17,_0x3bbbe6){return db[_0xa6de('0x80')][_0xa6de('0x81')]({'where':{'VoiceQueueId':_0x6bfcbc[_0xa6de('0x49')]['VoiceQueueId'],'CampaignId':_0x6bfcbc[_0xa6de('0x49')][_0xa6de('0x77')],'ContactId':_0x6bfcbc[_0xa6de('0x49')][_0xa6de('0x63')]}})[_0xa6de('0x22')](handleEntityNotFound(_0x2c7c17,null))[_0xa6de('0x22')](function(_0x2277dc){if(_0x2277dc){return _0x2277dc;}return null;})['then'](respondWithResult(_0x2c7c17,null))[_0xa6de('0x42')](handleError(_0x2c7c17,null));}; \ No newline at end of file +var _0x1e2f=['uniqueid','countContactsQueueCampaignHopperFinal','findAll','sequelize','COUNT','literal','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2022,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','VoiceQueue','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','calleridnum\x20NOT\x20IN\x20(?)','select','calleridnum','group','moveContactsIvrCampaignHopperFinal','insert','CampaignId','ANY_VALUE(calleridnum)','ANY_VALUE(ListId)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','checkContactHopper','CmHopper','findOne','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','send','index','map','CmHopperFinal','type','key','model','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','merge','where','VIRTUAL','field','options','count','includeAll','rows','catch','show','params','keys','rawAttributes','include','find','describe','body'];(function(_0x12246e,_0x3a27e9){var _0x1d97c5=function(_0x1157fd){while(--_0x1157fd){_0x12246e['push'](_0x12246e['shift']());}};_0x1d97c5(++_0x3a27e9);}(_0x1e2f,0xba));var _0xf1e2=function(_0x326174,_0x3295e0){_0x326174=_0x326174-0x0;var _0xebfb04=_0x1e2f[_0x326174];return _0xebfb04;};'use strict';var pdf=require(_0xf1e2('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xf1e2('0x1'));var zipdir=require(_0xf1e2('0x2'));var jsonpatch=require(_0xf1e2('0x3'));var rp=require(_0xf1e2('0x4'));var moment=require(_0xf1e2('0x5'));var BPromise=require(_0xf1e2('0x6'));var Mustache=require('mustache');var util=require(_0xf1e2('0x7'));var path=require(_0xf1e2('0x8'));var sox=require('sox');var csv=require(_0xf1e2('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf1e2('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf1e2('0xb'));var deskjs=require(_0xf1e2('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf1e2('0xd'));var Redis=require(_0xf1e2('0xe'));var authService=require(_0xf1e2('0xf'));var qs=require(_0xf1e2('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf1e2('0x11'))(_0xf1e2('0x12'));var utils=require(_0xf1e2('0x13'));var config=require(_0xf1e2('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x9ef2ee,_0x8720fb){_0x8720fb=_0x8720fb||0xcc;return function(_0x278bef){if(_0x278bef){return _0x9ef2ee[_0xf1e2('0x15')](_0x8720fb);}return _0x9ef2ee[_0xf1e2('0x16')](_0x8720fb)[_0xf1e2('0x17')]();};}function respondWithResult(_0x5d7980,_0x188220){_0x188220=_0x188220||0xc8;return function(_0x215119){if(_0x215119){return _0x5d7980[_0xf1e2('0x16')](_0x188220)[_0xf1e2('0x18')](_0x215119);}};}function respondWithFilteredResult(_0x21422f,_0x35e2d9){return function(_0x5382c4){if(_0x5382c4){var _0x725f6d=_0x5382c4['count'],_0x213a5b=_0x35e2d9[_0xf1e2('0x19')],_0x504ca9=_0x35e2d9[_0xf1e2('0x19')]+_0x35e2d9[_0xf1e2('0x1a')],_0x346aa2;if(_0x504ca9>=_0x725f6d){_0x504ca9=_0x725f6d;_0x346aa2=0xc8;}else{_0x346aa2=0xce;}_0x21422f['status'](_0x346aa2);return _0x21422f[_0xf1e2('0x1b')](_0xf1e2('0x1c'),_0x213a5b+'-'+_0x504ca9+'/'+_0x725f6d)[_0xf1e2('0x18')](_0x5382c4);}return null;};}function patchUpdates(_0x5bf5ef){return function(_0x5dfc38){try{jsonpatch[_0xf1e2('0x1d')](_0x5dfc38,_0x5bf5ef,!![]);}catch(_0x5c6fb6){return BPromise[_0xf1e2('0x1e')](_0x5c6fb6);}return _0x5dfc38['save']();};}function saveUpdates(_0x422621,_0x601cb6){return function(_0x3eaa1e){if(_0x3eaa1e){return _0x3eaa1e[_0xf1e2('0x1f')](_0x422621)[_0xf1e2('0x20')](function(_0x14b2bc){return _0x14b2bc;});}return null;};}function removeEntity(_0x5a6b52,_0x29c8f5){return function(_0x1f0d5e){if(_0x1f0d5e){return _0x1f0d5e[_0xf1e2('0x21')]()['then'](function(){_0x5a6b52[_0xf1e2('0x16')](0xcc)[_0xf1e2('0x17')]();});}};}function handleEntityNotFound(_0x270d6b,_0x59fb57){return function(_0x55b01e){if(!_0x55b01e){_0x270d6b[_0xf1e2('0x15')](0x194);}return _0x55b01e;};}function handleError(_0x53d3c0,_0x16577f){_0x16577f=_0x16577f||0x1f4;return function(_0x21a9b8){logger[_0xf1e2('0x22')](_0x21a9b8[_0xf1e2('0x23')]);if(_0x21a9b8['name']){delete _0x21a9b8['name'];}_0x53d3c0['status'](_0x16577f)[_0xf1e2('0x24')](_0x21a9b8);};}exports[_0xf1e2('0x25')]=function(_0x404700,_0x40c750){var _0x5dce65={},_0x132db5={},_0x163563={'count':0x0,'rows':[]};var _0x414053=_[_0xf1e2('0x26')](db[_0xf1e2('0x27')]['rawAttributes'],function(_0x4cea07){return{'name':_0x4cea07['fieldName'],'type':_0x4cea07[_0xf1e2('0x28')][_0xf1e2('0x29')]};});_0x132db5[_0xf1e2('0x2a')]=_[_0xf1e2('0x26')](_0x414053,_0xf1e2('0x2b'));_0x132db5[_0xf1e2('0x2c')]=_['keys'](_0x404700[_0xf1e2('0x2c')]);_0x132db5[_0xf1e2('0x2d')]=_[_0xf1e2('0x2e')](_0x132db5[_0xf1e2('0x2a')],_0x132db5[_0xf1e2('0x2c')]);_0x5dce65[_0xf1e2('0x2f')]=_[_0xf1e2('0x2e')](_0x132db5[_0xf1e2('0x2a')],qs[_0xf1e2('0x30')](_0x404700['query'][_0xf1e2('0x30')]));_0x5dce65[_0xf1e2('0x2f')]=_0x5dce65[_0xf1e2('0x2f')][_0xf1e2('0x31')]?_0x5dce65['attributes']:_0x132db5[_0xf1e2('0x2a')];if(!_0x404700[_0xf1e2('0x2c')][_0xf1e2('0x32')]('nolimit')){_0x5dce65[_0xf1e2('0x1a')]=qs['limit'](_0x404700[_0xf1e2('0x2c')][_0xf1e2('0x1a')]);_0x5dce65[_0xf1e2('0x19')]=qs[_0xf1e2('0x19')](_0x404700[_0xf1e2('0x2c')][_0xf1e2('0x19')]);}_0x5dce65[_0xf1e2('0x33')]=qs[_0xf1e2('0x34')](_0x404700[_0xf1e2('0x2c')][_0xf1e2('0x34')]);_0x5dce65['where']=qs[_0xf1e2('0x2d')](_[_0xf1e2('0x35')](_0x404700[_0xf1e2('0x2c')],_0x132db5['filters']));if(_0x404700['query'][_0xf1e2('0x36')]){_0x5dce65['where']=_[_0xf1e2('0x37')](_0x5dce65[_0xf1e2('0x38')],{'$or':_[_0xf1e2('0x26')](_0x414053,function(_0x3d015f){if(_0x3d015f[_0xf1e2('0x28')][_0xf1e2('0x29')]!==_0xf1e2('0x39')){var _0x1fb836={};_0x1fb836[_0x3d015f[_0xf1e2('0x3a')]]={'$like':'%'+_0x404700[_0xf1e2('0x2c')][_0xf1e2('0x36')]+'%'};return _0x1fb836;}})});}_0x5dce65=_[_0xf1e2('0x37')]({},_0x5dce65,_0x404700[_0xf1e2('0x3b')]);var _0x513fce={'where':_0x5dce65['where']};return db[_0xf1e2('0x27')][_0xf1e2('0x3c')](_0x513fce)['then'](function(_0x53a81b){_0x163563[_0xf1e2('0x3c')]=_0x53a81b;if(_0x404700[_0xf1e2('0x2c')][_0xf1e2('0x3d')]){_0x5dce65['include']=[{'all':!![]}];}return db[_0xf1e2('0x27')]['findAll'](_0x5dce65);})[_0xf1e2('0x20')](function(_0x2c92cf){_0x163563[_0xf1e2('0x3e')]=_0x2c92cf;return _0x163563;})[_0xf1e2('0x20')](respondWithFilteredResult(_0x40c750,_0x5dce65))[_0xf1e2('0x3f')](handleError(_0x40c750,null));};exports[_0xf1e2('0x40')]=function(_0x3c318e,_0x5d0dec){var _0x4b6bc7={'raw':!![],'where':{'id':_0x3c318e[_0xf1e2('0x41')]['id']}},_0x187d96={};_0x187d96[_0xf1e2('0x2a')]=_[_0xf1e2('0x42')](db[_0xf1e2('0x27')][_0xf1e2('0x43')]);_0x187d96[_0xf1e2('0x2c')]=_[_0xf1e2('0x42')](_0x3c318e[_0xf1e2('0x2c')]);_0x187d96[_0xf1e2('0x2d')]=_[_0xf1e2('0x2e')](_0x187d96[_0xf1e2('0x2a')],_0x187d96['query']);_0x4b6bc7['attributes']=_[_0xf1e2('0x2e')](_0x187d96[_0xf1e2('0x2a')],qs[_0xf1e2('0x30')](_0x3c318e[_0xf1e2('0x2c')][_0xf1e2('0x30')]));_0x4b6bc7[_0xf1e2('0x2f')]=_0x4b6bc7[_0xf1e2('0x2f')][_0xf1e2('0x31')]?_0x4b6bc7[_0xf1e2('0x2f')]:_0x187d96[_0xf1e2('0x2a')];if(_0x3c318e['query'][_0xf1e2('0x3d')]){_0x4b6bc7[_0xf1e2('0x44')]=[{'all':!![]}];}_0x4b6bc7=_[_0xf1e2('0x37')]({},_0x4b6bc7,_0x3c318e[_0xf1e2('0x3b')]);return db[_0xf1e2('0x27')][_0xf1e2('0x45')](_0x4b6bc7)[_0xf1e2('0x20')](handleEntityNotFound(_0x5d0dec,null))[_0xf1e2('0x20')](respondWithResult(_0x5d0dec,null))[_0xf1e2('0x3f')](handleError(_0x5d0dec,null));};exports['describe']=function(_0x100d98,_0x5787bb){return db[_0xf1e2('0x27')][_0xf1e2('0x46')]()['then'](respondWithResult(_0x5787bb,null))[_0xf1e2('0x3f')](handleError(_0x5787bb,null));};exports[_0xf1e2('0x1f')]=function(_0x4e0173,_0x52f9ee){if(_0x4e0173[_0xf1e2('0x47')]['uniqueid']){delete _0x4e0173['body'][_0xf1e2('0x48')];}return db['CmHopperFinal'][_0xf1e2('0x45')]({'where':{'uniqueid':_0x4e0173[_0xf1e2('0x41')]['id']}})[_0xf1e2('0x20')](handleEntityNotFound(_0x52f9ee,null))[_0xf1e2('0x20')](saveUpdates(_0x4e0173[_0xf1e2('0x47')],null))['then'](respondWithResult(_0x52f9ee,null))[_0xf1e2('0x3f')](handleError(_0x52f9ee,null));};exports[_0xf1e2('0x49')]=function(_0x536617,_0xb42e5b,_0x14257a){return db[_0xf1e2('0x27')][_0xf1e2('0x4a')]({'raw':![],'where':{'VoiceQueueId':_0x536617['params']['id']},'attributes':[[db[_0xf1e2('0x4b')]['fn'](_0xf1e2('0x4c'),db[_0xf1e2('0x4b')]['fn']('IF',db[_0xf1e2('0x4b')][_0xf1e2('0x4d')]('`state`\x20=\x200,\x201,\x20null'))),_0xf1e2('0x4e')],[db[_0xf1e2('0x4b')]['fn']('COUNT',db[_0xf1e2('0x4b')]['fn']('IF',db[_0xf1e2('0x4b')]['literal'](_0xf1e2('0x4f')))),_0xf1e2('0x50')],[db['sequelize']['fn']('COUNT',db[_0xf1e2('0x4b')]['fn']('IF',db[_0xf1e2('0x4b')][_0xf1e2('0x4d')](_0xf1e2('0x51')))),'busyContacts'],[db[_0xf1e2('0x4b')]['fn'](_0xf1e2('0x4c'),db['sequelize']['fn']('IF',db['sequelize'][_0xf1e2('0x4d')]('`state`\x20=\x208,\x201,\x20null'))),_0xf1e2('0x52')],[db['sequelize']['fn'](_0xf1e2('0x4c'),db[_0xf1e2('0x4b')]['fn']('IF',db[_0xf1e2('0x4b')][_0xf1e2('0x4d')](_0xf1e2('0x53')))),'dropContacts'],[db[_0xf1e2('0x4b')]['fn'](_0xf1e2('0x4c'),db[_0xf1e2('0x4b')]['fn']('IF',db[_0xf1e2('0x4b')][_0xf1e2('0x4d')]('`state`\x20=\x2011\x20,\x201,\x20null'))),'abandonedContacts'],[db[_0xf1e2('0x4b')]['fn'](_0xf1e2('0x4c'),db[_0xf1e2('0x4b')]['fn']('IF',db[_0xf1e2('0x4b')][_0xf1e2('0x4d')](_0xf1e2('0x54')))),'reCallContacts'],[db[_0xf1e2('0x4b')]['fn']('COUNT',db[_0xf1e2('0x4b')]['fn']('IF',db['sequelize'][_0xf1e2('0x4d')]('`state`\x20=\x2019,\x201,\x20null'))),_0xf1e2('0x55')]]})[_0xf1e2('0x20')](handleEntityNotFound(_0xb42e5b,null))[_0xf1e2('0x20')](respondWithResult(_0xb42e5b,null))['catch'](handleError(_0xb42e5b,null));};exports[_0xf1e2('0x56')]=function(_0x115d6e,_0x5b3387,_0x3803bb){return db[_0xf1e2('0x27')][_0xf1e2('0x4a')]({'raw':![],'where':{'CampaignId':_0x115d6e[_0xf1e2('0x41')]['id']},'attributes':[[db[_0xf1e2('0x4b')]['fn'](_0xf1e2('0x4c'),db[_0xf1e2('0x4b')]['fn']('IF',db[_0xf1e2('0x4b')]['literal'](_0xf1e2('0x57')))),_0xf1e2('0x4e')],[db['sequelize']['fn'](_0xf1e2('0x4c'),db['sequelize']['fn']('IF',db[_0xf1e2('0x4b')][_0xf1e2('0x4d')](_0xf1e2('0x4f')))),_0xf1e2('0x50')],[db[_0xf1e2('0x4b')]['fn'](_0xf1e2('0x4c'),db[_0xf1e2('0x4b')]['fn']('IF',db['sequelize'][_0xf1e2('0x4d')](_0xf1e2('0x51')))),'busyContacts'],[db['sequelize']['fn'](_0xf1e2('0x4c'),db[_0xf1e2('0x4b')]['fn']('IF',db[_0xf1e2('0x4b')][_0xf1e2('0x4d')](_0xf1e2('0x58')))),'congestionContacts'],[db[_0xf1e2('0x4b')]['fn'](_0xf1e2('0x4c'),db['sequelize']['fn']('IF',db['sequelize'][_0xf1e2('0x4d')](_0xf1e2('0x53')))),_0xf1e2('0x59')],[db[_0xf1e2('0x4b')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xf1e2('0x4b')][_0xf1e2('0x4d')](_0xf1e2('0x5a')))),_0xf1e2('0x5b')],[db[_0xf1e2('0x4b')]['fn'](_0xf1e2('0x4c'),db['sequelize']['fn']('IF',db['sequelize'][_0xf1e2('0x4d')](_0xf1e2('0x54')))),_0xf1e2('0x5c')],[db['sequelize']['fn'](_0xf1e2('0x4c'),db[_0xf1e2('0x4b')]['fn']('IF',db[_0xf1e2('0x4b')][_0xf1e2('0x4d')](_0xf1e2('0x5d')))),_0xf1e2('0x55')]]})[_0xf1e2('0x20')](handleEntityNotFound(_0x5b3387,null))[_0xf1e2('0x20')](respondWithResult(_0x5b3387,null))['catch'](handleError(_0x5b3387,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x586122,_0x269ac4,_0x1cff3d){return db[_0xf1e2('0x5e')]['find']({'where':{'id':_0x586122['params']['id']}})[_0xf1e2('0x20')](handleEntityNotFound(_0x269ac4,null))[_0xf1e2('0x20')](function(_0x5e2d6c){var _0x3e6883;if(_0x5e2d6c){_0x3e6883=squel['insert']()[_0xf1e2('0x5f')](_0xf1e2('0x60'))[_0xf1e2('0x61')]([_0xf1e2('0x62'),_0xf1e2('0x63'),_0xf1e2('0x64'),_0xf1e2('0x65'),_0xf1e2('0x66'),_0xf1e2('0x67'),_0xf1e2('0x68')],squel['select']()[_0xf1e2('0x3a')]('ANY_VALUE(calleridnum)',_0xf1e2('0x62'))[_0xf1e2('0x3a')](_0xf1e2('0x69'),_0xf1e2('0x63'))[_0xf1e2('0x3a')](_0xf1e2('0x6a'),_0xf1e2('0x64'))[_0xf1e2('0x3a')]('ANY_VALUE(ListId)',_0xf1e2('0x65'))[_0xf1e2('0x3a')](_0xf1e2('0x6b'),'VoiceQueueId')[_0xf1e2('0x3a')](_0xf1e2('0x69'),_0xf1e2('0x67'))['field'](_0xf1e2('0x69'),_0xf1e2('0x68'))[_0xf1e2('0x6c')](_0xf1e2('0x6d'))[_0xf1e2('0x38')](_0xf1e2('0x6e'),_0x586122['params']['id'][_0xf1e2('0x6f')]())['where']('state\x20=\x20?',_0x586122[_0xf1e2('0x47')]['state'][_0xf1e2('0x6f')]())[_0xf1e2('0x38')]('calleridnum\x20IS\x20NOT\x20NULL')['where'](_0xf1e2('0x70'),squel['select']()['field'](_0xf1e2('0x62'))['from']('cm_hopper')[_0xf1e2('0x38')](_0xf1e2('0x6e'),_0x586122[_0xf1e2('0x41')]['id'][_0xf1e2('0x6f')]()))[_0xf1e2('0x38')](_0xf1e2('0x70'),squel[_0xf1e2('0x71')]()['field'](_0xf1e2('0x72'))['from']('cm_hopper_final')['where'](_0xf1e2('0x6e'),_0x586122[_0xf1e2('0x41')]['id'][_0xf1e2('0x6f')]())[_0xf1e2('0x38')]('state\x20=\x204'))[_0xf1e2('0x73')]('ContactId'))['toString']();return db['sequelize']['query'](_0x3e6883);}return[];})[_0xf1e2('0x20')](respondWithResult(_0x269ac4,null))[_0xf1e2('0x3f')](handleError(_0x269ac4,null));};exports[_0xf1e2('0x74')]=function(_0x9a13dd,_0xbbffbf,_0x1e8c27){return db['Campaign'][_0xf1e2('0x45')]({'where':{'id':_0x9a13dd[_0xf1e2('0x41')]['id']}})[_0xf1e2('0x20')](handleEntityNotFound(_0xbbffbf,null))[_0xf1e2('0x20')](function(_0x2621a4){var _0x37eb73;if(_0x2621a4){_0x37eb73=squel[_0xf1e2('0x75')]()[_0xf1e2('0x5f')](_0xf1e2('0x60'))[_0xf1e2('0x61')](['phone','scheduledAt',_0xf1e2('0x64'),_0xf1e2('0x65'),_0xf1e2('0x76'),_0xf1e2('0x67'),_0xf1e2('0x68')],squel[_0xf1e2('0x71')]()[_0xf1e2('0x3a')](_0xf1e2('0x77'),_0xf1e2('0x62'))[_0xf1e2('0x3a')]('NOW()',_0xf1e2('0x63'))[_0xf1e2('0x3a')](_0xf1e2('0x6a'),_0xf1e2('0x64'))['field'](_0xf1e2('0x78'),_0xf1e2('0x65'))[_0xf1e2('0x3a')](_0xf1e2('0x79'),_0xf1e2('0x76'))[_0xf1e2('0x3a')]('NOW()',_0xf1e2('0x67'))[_0xf1e2('0x3a')](_0xf1e2('0x69'),_0xf1e2('0x68'))[_0xf1e2('0x6c')]('cm_hopper_final')['where'](_0xf1e2('0x7a'),_0x9a13dd[_0xf1e2('0x41')]['id']['toString']())[_0xf1e2('0x38')](_0xf1e2('0x7b'),_0x9a13dd['body'][_0xf1e2('0x7c')][_0xf1e2('0x6f')]())[_0xf1e2('0x38')](_0xf1e2('0x7d'))['where'](_0xf1e2('0x70'),squel['select']()[_0xf1e2('0x3a')](_0xf1e2('0x62'))[_0xf1e2('0x6c')]('cm_hopper')[_0xf1e2('0x38')](_0xf1e2('0x7a'),_0x9a13dd[_0xf1e2('0x41')]['id'][_0xf1e2('0x6f')]()))[_0xf1e2('0x38')](_0xf1e2('0x70'),squel[_0xf1e2('0x71')]()['field'](_0xf1e2('0x72'))[_0xf1e2('0x6c')](_0xf1e2('0x6d'))['where'](_0xf1e2('0x7a'),_0x9a13dd[_0xf1e2('0x41')]['id'][_0xf1e2('0x6f')]())[_0xf1e2('0x38')]('state\x20=\x204'))['group'](_0xf1e2('0x64')))[_0xf1e2('0x6f')]();return db[_0xf1e2('0x4b')][_0xf1e2('0x2c')](_0x37eb73);}return[];})[_0xf1e2('0x20')](respondWithResult(_0xbbffbf,null))[_0xf1e2('0x3f')](handleError(_0xbbffbf,null));};exports[_0xf1e2('0x7e')]=function(_0x272f64,_0x315952,_0x5e4068){return db[_0xf1e2('0x7f')][_0xf1e2('0x80')]({'where':{'VoiceQueueId':_0x272f64['body'][_0xf1e2('0x66')],'CampaignId':_0x272f64[_0xf1e2('0x47')]['CampaignId'],'ContactId':_0x272f64[_0xf1e2('0x47')][_0xf1e2('0x64')]}})[_0xf1e2('0x20')](handleEntityNotFound(_0x315952,null))[_0xf1e2('0x20')](function(_0x3078dc){if(_0x3078dc){return _0x3078dc;}return null;})['then'](respondWithResult(_0x315952,null))[_0xf1e2('0x3f')](handleError(_0x315952,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index e27e929..58a3576 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 _0x74c8=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./cmHopperFinal.attributes','exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0x74c8,0xd0));var _0x874c=function(_0x35b79f,_0x2d47db){_0x35b79f=_0x35b79f-0x0;var _0x1f7357=_0x74c8[_0x35b79f];return _0x1f7357;};'use strict';var _=require(_0x874c('0x0'));var util=require(_0x874c('0x1'));var logger=require(_0x874c('0x2'))(_0x874c('0x3'));var moment=require(_0x874c('0x4'));var BPromise=require(_0x874c('0x5'));var rp=require(_0x874c('0x6'));var fs=require('fs');var path=require(_0x874c('0x7'));var rimraf=require('rimraf');var config=require(_0x874c('0x8'));var attributes=require(_0x874c('0x9'));module[_0x874c('0xa')]=function(_0x2a7f9a,_0x185630){return _0x2a7f9a[_0x874c('0xb')](_0x874c('0xc'),attributes,{'tableName':_0x874c('0xd'),'paranoid':![],'indexes':[{'name':'calleridnum','fields':[_0x874c('0xe')]},{'name':_0x874c('0xf'),'fields':[_0x874c('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1c8a=['uniqueid','lodash','util','api','moment','bluebird','path','rimraf','./cmHopperFinal.attributes','exports','define','CmHopperFinal','cm_hopper_final','calleridnum'];(function(_0x45b1ad,_0x215b03){var _0x3d5696=function(_0x4d9e73){while(--_0x4d9e73){_0x45b1ad['push'](_0x45b1ad['shift']());}};_0x3d5696(++_0x215b03);}(_0x1c8a,0x7f));var _0xa1c8=function(_0x4eb147,_0x592482){_0x4eb147=_0x4eb147-0x0;var _0x22091a=_0x1c8a[_0x4eb147];return _0x22091a;};'use strict';var _=require(_0xa1c8('0x0'));var util=require(_0xa1c8('0x1'));var logger=require('../../config/logger')(_0xa1c8('0x2'));var moment=require(_0xa1c8('0x3'));var BPromise=require(_0xa1c8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa1c8('0x5'));var rimraf=require(_0xa1c8('0x6'));var config=require('../../config/environment');var attributes=require(_0xa1c8('0x7'));module[_0xa1c8('0x8')]=function(_0x32eb27,_0x5eb16b){return _0x32eb27[_0xa1c8('0x9')](_0xa1c8('0xa'),attributes,{'tableName':_0xa1c8('0xb'),'paranoid':![],'indexes':[{'name':_0xa1c8('0xc'),'fields':['calleridnum']},{'name':'uniqueid','fields':[_0xa1c8('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 1686a5d..b56637c 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 _0x9d6a=['then','info','CmHopperFinal,\x20%s,\x20%s','debug','CmHopperFinal,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','options','CreateCmHopperFinal','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x5c722e,_0x83c9bd){var _0x680a07=function(_0xef992a){while(--_0xef992a){_0x5c722e['push'](_0x5c722e['shift']());}};_0x680a07(++_0x83c9bd);}(_0x9d6a,0x1d0));var _0xa9d6=function(_0x580072,_0x275e9){_0x580072=_0x580072-0x0;var _0x2f960c=_0x9d6a[_0x580072];return _0x2f960c;};'use strict';var _=require(_0xa9d6('0x0'));var util=require(_0xa9d6('0x1'));var moment=require(_0xa9d6('0x2'));var BPromise=require(_0xa9d6('0x3'));var rs=require(_0xa9d6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa9d6('0x5'))['db'];var utils=require(_0xa9d6('0x6'));var logger=require(_0xa9d6('0x7'))(_0xa9d6('0x8'));var config=require(_0xa9d6('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa9d6('0xa')][_0xa9d6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1336c4,_0x1bdb7c,_0x429f3e){return new BPromise(function(_0x258c86,_0x947cba){return client['request'](_0x1336c4,_0x429f3e)[_0xa9d6('0xc')](function(_0x4043d8){logger[_0xa9d6('0xd')](_0xa9d6('0xe'),_0x1bdb7c,'request\x20sent');logger[_0xa9d6('0xf')](_0xa9d6('0x10'),_0x1bdb7c,'request\x20sent',JSON[_0xa9d6('0x11')](_0x4043d8));if(_0x4043d8[_0xa9d6('0x12')]){if(_0x4043d8[_0xa9d6('0x12')][_0xa9d6('0x13')]===0x1f4){logger[_0xa9d6('0x12')](_0xa9d6('0xe'),_0x1bdb7c,_0x4043d8[_0xa9d6('0x12')]['message']);return _0x947cba(_0x4043d8['error']['message']);}logger[_0xa9d6('0x12')](_0xa9d6('0xe'),_0x1bdb7c,_0x4043d8['error']['message']);return _0x258c86(_0x4043d8['error'][_0xa9d6('0x14')]);}else{logger[_0xa9d6('0xd')](_0xa9d6('0xe'),_0x1bdb7c,_0xa9d6('0x15'));_0x258c86(_0x4043d8[_0xa9d6('0x16')][_0xa9d6('0x14')]);}})[_0xa9d6('0x17')](function(_0xbf7574){logger[_0xa9d6('0x12')]('CmHopperFinal,\x20%s,\x20%s',_0x1bdb7c,_0xbf7574);_0x947cba(_0xbf7574);});});}exports['CreateCmHopperFinal']=function(_0x33c407){var _0x490737=this;return new Promise(function(_0x1ef3ec,_0x5de65d){return db[_0xa9d6('0x18')][_0xa9d6('0x19')](_0x33c407['body'],{'raw':_0x33c407[_0xa9d6('0x1a')]?_0x33c407[_0xa9d6('0x1a')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x333814){logger[_0xa9d6('0xd')]('CreateCmHopperFinal',_0x33c407);logger[_0xa9d6('0xf')](_0xa9d6('0x1b'),_0x33c407,JSON['stringify'](_0x333814));_0x1ef3ec(_0x333814);})[_0xa9d6('0x17')](function(_0x258ef8){logger[_0xa9d6('0x12')](_0xa9d6('0x1b'),_0x258ef8[_0xa9d6('0x14')],_0x33c407);_0x5de65d(_0x490737[_0xa9d6('0x12')](0x1f4,_0x258ef8['message']));});});}; \ No newline at end of file +var _0x4471=['info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','CreateCmHopperFinal','CmHopperFinal','options','raw','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then'];(function(_0x3f9631,_0x51ffcb){var _0x242d84=function(_0xfcd4f7){while(--_0xfcd4f7){_0x3f9631['push'](_0x3f9631['shift']());}};_0x242d84(++_0x51ffcb);}(_0x4471,0x151));var _0x1447=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x4471[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0x1447('0x0'));var util=require(_0x1447('0x1'));var moment=require(_0x1447('0x2'));var BPromise=require(_0x1447('0x3'));var rs=require(_0x1447('0x4'));var fs=require('fs');var Redis=require(_0x1447('0x5'));var db=require(_0x1447('0x6'))['db'];var utils=require(_0x1447('0x7'));var logger=require(_0x1447('0x8'))(_0x1447('0x9'));var config=require(_0x1447('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1447('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2f5832,_0x452206,_0x2ac509){return new BPromise(function(_0x23f35e,_0x414547){return client[_0x1447('0xc')](_0x2f5832,_0x2ac509)[_0x1447('0xd')](function(_0x3514c5){logger[_0x1447('0xe')](_0x1447('0xf'),_0x452206,'request\x20sent');logger['debug'](_0x1447('0x10'),_0x452206,'request\x20sent',JSON[_0x1447('0x11')](_0x3514c5));if(_0x3514c5[_0x1447('0x12')]){if(_0x3514c5[_0x1447('0x12')]['code']===0x1f4){logger[_0x1447('0x12')](_0x1447('0xf'),_0x452206,_0x3514c5['error'][_0x1447('0x13')]);return _0x414547(_0x3514c5['error'][_0x1447('0x13')]);}logger['error'](_0x1447('0xf'),_0x452206,_0x3514c5[_0x1447('0x12')][_0x1447('0x13')]);return _0x23f35e(_0x3514c5[_0x1447('0x12')][_0x1447('0x13')]);}else{logger['info'](_0x1447('0xf'),_0x452206,_0x1447('0x14'));_0x23f35e(_0x3514c5[_0x1447('0x15')][_0x1447('0x13')]);}})['catch'](function(_0x1c6f12){logger[_0x1447('0x12')]('CmHopperFinal,\x20%s,\x20%s',_0x452206,_0x1c6f12);_0x414547(_0x1c6f12);});});}exports[_0x1447('0x16')]=function(_0x4dbbdb){var _0x2a4495=this;return new Promise(function(_0x10a644,_0x6487d5){return db[_0x1447('0x17')]['create'](_0x4dbbdb['body'],{'raw':_0x4dbbdb[_0x1447('0x18')]?_0x4dbbdb[_0x1447('0x18')][_0x1447('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x245f24){logger[_0x1447('0xe')](_0x1447('0x16'),_0x4dbbdb);logger[_0x1447('0x1a')](_0x1447('0x16'),_0x4dbbdb,JSON[_0x1447('0x11')](_0x245f24));_0x10a644(_0x245f24);})['catch'](function(_0x4664a3){logger[_0x1447('0x12')](_0x1447('0x16'),_0x4664a3['message'],_0x4dbbdb);_0x6487d5(_0x2a4495[_0x1447('0x12')](0x1f4,_0x4664a3['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index 03ef144..e3e13ce 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 _0xf1a4=['countContactsQueueCampaignHopperFinal','countContactsIvrCampaignHopperFinal','post','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','/:id','update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','index','/describe','describe','show','/voice/queue/countAttributes/:id'];(function(_0x273a7c,_0x35a898){var _0x55e73a=function(_0x2673da){while(--_0x2673da){_0x273a7c['push'](_0x273a7c['shift']());}};_0x55e73a(++_0x35a898);}(_0xf1a4,0x14f));var _0x4f1a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf1a4[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x4f1a('0x0'));var util=require(_0x4f1a('0x1'));var path=require(_0x4f1a('0x2'));var timeout=require(_0x4f1a('0x3'));var express=require(_0x4f1a('0x4'));var router=express[_0x4f1a('0x5')]();var auth=require(_0x4f1a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4f1a('0x7'));var controller=require(_0x4f1a('0x8'));router[_0x4f1a('0x9')]('/',auth[_0x4f1a('0xa')](),controller[_0x4f1a('0xb')]);router['get'](_0x4f1a('0xc'),auth['isAuthenticated'](),controller[_0x4f1a('0xd')]);router['get']('/:id',auth[_0x4f1a('0xa')](),controller[_0x4f1a('0xe')]);router['get'](_0x4f1a('0xf'),auth['isAuthenticated'](),controller[_0x4f1a('0x10')]);router['get']('/campaign/countAttributes/:id',auth['isAuthenticated'](),controller[_0x4f1a('0x11')]);router[_0x4f1a('0x12')]('/voice/queue/moveContacts/:id',auth[_0x4f1a('0xa')](),controller['moveContactsQueueCampaignHopperFinal']);router['post'](_0x4f1a('0x13'),auth[_0x4f1a('0xa')](),controller[_0x4f1a('0x14')]);router[_0x4f1a('0x12')](_0x4f1a('0x15'),auth[_0x4f1a('0xa')](),controller[_0x4f1a('0x16')]);router[_0x4f1a('0x17')](_0x4f1a('0x18'),auth[_0x4f1a('0xa')](),controller[_0x4f1a('0x19')]);module[_0x4f1a('0x1a')]=router; \ No newline at end of file +var _0x69a2=['../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','/describe','/:id','show','/voice/queue/countAttributes/:id','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','update','exports','multer','util','path','Router'];(function(_0x2ac803,_0x26b983){var _0x52af5d=function(_0x3072a7){while(--_0x3072a7){_0x2ac803['push'](_0x2ac803['shift']());}};_0x52af5d(++_0x26b983);}(_0x69a2,0x164));var _0x269a=function(_0x47df1f,_0x320d5f){_0x47df1f=_0x47df1f-0x0;var _0x20a401=_0x69a2[_0x47df1f];return _0x20a401;};'use strict';var multer=require(_0x269a('0x0'));var util=require(_0x269a('0x1'));var path=require(_0x269a('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x269a('0x3')]();var auth=require(_0x269a('0x4'));var interaction=require(_0x269a('0x5'));var config=require(_0x269a('0x6'));var controller=require(_0x269a('0x7'));router[_0x269a('0x8')]('/',auth[_0x269a('0x9')](),controller['index']);router['get'](_0x269a('0xa'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x269a('0xb'),auth['isAuthenticated'](),controller[_0x269a('0xc')]);router[_0x269a('0x8')](_0x269a('0xd'),auth[_0x269a('0x9')](),controller['countContactsQueueCampaignHopperFinal']);router['get'](_0x269a('0xe'),auth['isAuthenticated'](),controller[_0x269a('0xf')]);router[_0x269a('0x10')](_0x269a('0x11'),auth['isAuthenticated'](),controller[_0x269a('0x12')]);router['post']('/voice/campaign/moveContacts/:id',auth[_0x269a('0x9')](),controller['moveContactsIvrCampaignHopperFinal']);router['post'](_0x269a('0x13'),auth['isAuthenticated'](),controller[_0x269a('0x14')]);router[_0x269a('0x15')](_0x269a('0xb'),auth[_0x269a('0x9')](),controller[_0x269a('0x16')]);module[_0x269a('0x17')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 787f1cb..97d286c 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 _0xe473=['DATE','INTEGER','BOOLEAN','sequelize','STRING'];(function(_0x9f2fc0,_0xd50b1f){var _0x4e8400=function(_0x34b2fb){while(--_0x34b2fb){_0x9f2fc0['push'](_0x9f2fc0['shift']());}};_0x4e8400(++_0xd50b1f);}(_0xe473,0x193));var _0x3e47=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0xe473[_0x18ab2a];return _0x16dcee;};'use strict';var Sequelize=require(_0x3e47('0x0'));module['exports']={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x3e47('0x1')]},'scheduledat':{'type':Sequelize[_0x3e47('0x2')]},'countbusyretry':{'type':Sequelize[_0x3e47('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x3e47('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x3e47('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x3e47('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x3e47('0x1')]},'originatecalleridname':{'type':Sequelize[_0x3e47('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x3e47('0x1')]},'starttime':{'type':Sequelize[_0x3e47('0x2')]},'responsetime':{'type':Sequelize[_0x3e47('0x2')]},'answertime':{'type':Sequelize[_0x3e47('0x2')]},'droptime':{'type':Sequelize[_0x3e47('0x2')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x3e47('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x3e47('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x3e47('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x3e47('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x3e47('0x1')]},'campaign':{'type':Sequelize[_0x3e47('0x1')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x3e47('0x1')]},'reason':{'type':Sequelize[_0x3e47('0x1')]},'amd':{'type':Sequelize[_0x3e47('0x4')],'defaultValue':![]},'fax':{'type':Sequelize[_0x3e47('0x4')],'defaultValue':![]},'callback':{'type':Sequelize[_0x3e47('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x3e47('0x1')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x3e47('0x2')]},'recallme':{'type':Sequelize[_0x3e47('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0x3e47('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0xf293=['BOOLEAN','sequelize','INTEGER','STRING','DATE'];(function(_0x1a29df,_0x310f66){var _0x4ebf65=function(_0x548d5f){while(--_0x548d5f){_0x1a29df['push'](_0x1a29df['shift']());}};_0x4ebf65(++_0x310f66);}(_0xf293,0xf1));var _0x3f29=function(_0x91f482,_0x454d5a){_0x91f482=_0x91f482-0x0;var _0x22b785=_0xf293[_0x91f482];return _0x22b785;};'use strict';var Sequelize=require(_0x3f29('0x0'));module['exports']={'state':{'type':Sequelize[_0x3f29('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x3f29('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x3f29('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x3f29('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x3f29('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x3f29('0x2')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x3f29('0x2')]},'calleridname':{'type':Sequelize[_0x3f29('0x2')]},'starttime':{'type':Sequelize[_0x3f29('0x3')]},'responsetime':{'type':Sequelize[_0x3f29('0x3')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x3f29('0x3')]},'ringtime':{'type':Sequelize[_0x3f29('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x3f29('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x3f29('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x3f29('0x2')]},'campaigntype':{'type':Sequelize[_0x3f29('0x2')]},'membername':{'type':Sequelize[_0x3f29('0x2')]},'reason':{'type':Sequelize[_0x3f29('0x2')]},'amd':{'type':Sequelize[_0x3f29('0x4')],'defaultValue':![]},'fax':{'type':Sequelize[_0x3f29('0x4')],'defaultValue':![]},'callback':{'type':Sequelize[_0x3f29('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x3f29('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x3f29('0x3')]},'recallme':{'type':Sequelize[_0x3f29('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x3f29('0x3')]},'edited':{'type':Sequelize[_0x3f29('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index ea10243..3557582 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 _0x9802=['create','body','describe','uniqueid','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','sox','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','end','status','json','offset','limit','Content-Range','reject','save','update','destroy','then','sendStatus','error','stack','name','send','index','map','CmHopperHistory','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','field','count','includeAll','include','findAll','rows','show','params','options','find','catch'];(function(_0x103e72,_0x27aa07){var _0x5b6e71=function(_0x243d35){while(--_0x243d35){_0x103e72['push'](_0x103e72['shift']());}};_0x5b6e71(++_0x27aa07);}(_0x9802,0x96));var _0x2980=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x9802[_0x255d5b];return _0x3e141a;};'use strict';var pdf=require(_0x2980('0x0'));var emlformat=require(_0x2980('0x1'));var rimraf=require(_0x2980('0x2'));var zipdir=require(_0x2980('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2980('0x4'));var BPromise=require(_0x2980('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x2980('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x2980('0x7'));var squel=require(_0x2980('0x8'));var crypto=require(_0x2980('0x9'));var jsforce=require(_0x2980('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x2980('0xb'));var querystring=require(_0x2980('0xc'));var Papa=require(_0x2980('0xd'));var Redis=require('ioredis');var authService=require(_0x2980('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x2980('0xf'));var hardwareService=require(_0x2980('0x10'));var logger=require(_0x2980('0x11'))('api');var utils=require(_0x2980('0x12'));var config=require('../../config/environment');var db=require(_0x2980('0x13'))['db'];function respondWithStatusCode(_0x190b87,_0x3ee770){_0x3ee770=_0x3ee770||0xcc;return function(_0x3ba7a1){if(_0x3ba7a1){return _0x190b87['sendStatus'](_0x3ee770);}return _0x190b87['status'](_0x3ee770)[_0x2980('0x14')]();};}function respondWithResult(_0x55b3c9,_0x1fe0c9){_0x1fe0c9=_0x1fe0c9||0xc8;return function(_0x3a4b29){if(_0x3a4b29){return _0x55b3c9[_0x2980('0x15')](_0x1fe0c9)[_0x2980('0x16')](_0x3a4b29);}};}function respondWithFilteredResult(_0x19042f,_0x383f86){return function(_0x11b26b){if(_0x11b26b){var _0x9d2518=_0x11b26b['count'],_0x170757=_0x383f86[_0x2980('0x17')],_0x510267=_0x383f86[_0x2980('0x17')]+_0x383f86[_0x2980('0x18')],_0x183fc0;if(_0x510267>=_0x9d2518){_0x510267=_0x9d2518;_0x183fc0=0xc8;}else{_0x183fc0=0xce;}_0x19042f[_0x2980('0x15')](_0x183fc0);return _0x19042f['set'](_0x2980('0x19'),_0x170757+'-'+_0x510267+'/'+_0x9d2518)[_0x2980('0x16')](_0x11b26b);}return null;};}function patchUpdates(_0xf54d75){return function(_0x5c746b){try{jsonpatch['apply'](_0x5c746b,_0xf54d75,!![]);}catch(_0x568432){return BPromise[_0x2980('0x1a')](_0x568432);}return _0x5c746b[_0x2980('0x1b')]();};}function saveUpdates(_0x32a8b8,_0x285f5c){return function(_0x47caa6){if(_0x47caa6){return _0x47caa6[_0x2980('0x1c')](_0x32a8b8)['then'](function(_0x1a9825){return _0x1a9825;});}return null;};}function removeEntity(_0x58894a,_0x1f02b3){return function(_0x133c90){if(_0x133c90){return _0x133c90[_0x2980('0x1d')]()[_0x2980('0x1e')](function(){_0x58894a[_0x2980('0x15')](0xcc)[_0x2980('0x14')]();});}};}function handleEntityNotFound(_0xb750ed,_0xf10ca7){return function(_0x3cb1d3){if(!_0x3cb1d3){_0xb750ed[_0x2980('0x1f')](0x194);}return _0x3cb1d3;};}function handleError(_0x2b04d2,_0x120c3c){_0x120c3c=_0x120c3c||0x1f4;return function(_0x289924){logger[_0x2980('0x20')](_0x289924[_0x2980('0x21')]);if(_0x289924[_0x2980('0x22')]){delete _0x289924['name'];}_0x2b04d2[_0x2980('0x15')](_0x120c3c)[_0x2980('0x23')](_0x289924);};}exports[_0x2980('0x24')]=function(_0xde9ebd,_0x57159d){var _0x1dd198={},_0x527127={},_0x1fd9a5={'count':0x0,'rows':[]};var _0x9cb590=_[_0x2980('0x25')](db[_0x2980('0x26')][_0x2980('0x27')],function(_0x3d2ea9){return{'name':_0x3d2ea9[_0x2980('0x28')],'type':_0x3d2ea9['type'][_0x2980('0x29')]};});_0x527127[_0x2980('0x2a')]=_['map'](_0x9cb590,'name');_0x527127[_0x2980('0x2b')]=_[_0x2980('0x2c')](_0xde9ebd['query']);_0x527127[_0x2980('0x2d')]=_[_0x2980('0x2e')](_0x527127[_0x2980('0x2a')],_0x527127[_0x2980('0x2b')]);_0x1dd198['attributes']=_[_0x2980('0x2e')](_0x527127[_0x2980('0x2a')],qs[_0x2980('0x2f')](_0xde9ebd[_0x2980('0x2b')]['fields']));_0x1dd198[_0x2980('0x30')]=_0x1dd198[_0x2980('0x30')][_0x2980('0x31')]?_0x1dd198[_0x2980('0x30')]:_0x527127[_0x2980('0x2a')];if(!_0xde9ebd[_0x2980('0x2b')][_0x2980('0x32')](_0x2980('0x33'))){_0x1dd198[_0x2980('0x18')]=qs[_0x2980('0x18')](_0xde9ebd[_0x2980('0x2b')][_0x2980('0x18')]);_0x1dd198[_0x2980('0x17')]=qs[_0x2980('0x17')](_0xde9ebd[_0x2980('0x2b')][_0x2980('0x17')]);}_0x1dd198[_0x2980('0x34')]=qs[_0x2980('0x35')](_0xde9ebd[_0x2980('0x2b')][_0x2980('0x35')]);_0x1dd198[_0x2980('0x36')]=qs['filters'](_[_0x2980('0x37')](_0xde9ebd[_0x2980('0x2b')],_0x527127[_0x2980('0x2d')]));if(_0xde9ebd['query'][_0x2980('0x38')]){_0x1dd198['where']=_[_0x2980('0x39')](_0x1dd198[_0x2980('0x36')],{'$or':_[_0x2980('0x25')](_0x9cb590,function(_0x363aaa){if(_0x363aaa['type'][_0x2980('0x29')]!=='VIRTUAL'){var _0x6026d1={};_0x6026d1[_0x363aaa[_0x2980('0x3a')]]={'$like':'%'+_0xde9ebd['query']['filter']+'%'};return _0x6026d1;}})});}_0x1dd198=_[_0x2980('0x39')]({},_0x1dd198,_0xde9ebd['options']);var _0x5301e9={'where':_0x1dd198['where']};return db[_0x2980('0x26')][_0x2980('0x3b')](_0x5301e9)['then'](function(_0x1f5714){_0x1fd9a5[_0x2980('0x3b')]=_0x1f5714;if(_0xde9ebd[_0x2980('0x2b')][_0x2980('0x3c')]){_0x1dd198[_0x2980('0x3d')]=[{'all':!![]}];}return db[_0x2980('0x26')][_0x2980('0x3e')](_0x1dd198);})[_0x2980('0x1e')](function(_0x3af380){_0x1fd9a5[_0x2980('0x3f')]=_0x3af380;return _0x1fd9a5;})['then'](respondWithFilteredResult(_0x57159d,_0x1dd198))['catch'](handleError(_0x57159d,null));};exports[_0x2980('0x40')]=function(_0x5020b9,_0x1749cb){var _0x17ff1={'raw':!![],'where':{'id':_0x5020b9[_0x2980('0x41')]['id']}},_0x21c93e={};_0x21c93e['model']=_[_0x2980('0x2c')](db[_0x2980('0x26')][_0x2980('0x27')]);_0x21c93e[_0x2980('0x2b')]=_[_0x2980('0x2c')](_0x5020b9[_0x2980('0x2b')]);_0x21c93e[_0x2980('0x2d')]=_[_0x2980('0x2e')](_0x21c93e[_0x2980('0x2a')],_0x21c93e['query']);_0x17ff1[_0x2980('0x30')]=_['intersection'](_0x21c93e['model'],qs['fields'](_0x5020b9[_0x2980('0x2b')][_0x2980('0x2f')]));_0x17ff1[_0x2980('0x30')]=_0x17ff1[_0x2980('0x30')]['length']?_0x17ff1[_0x2980('0x30')]:_0x21c93e[_0x2980('0x2a')];if(_0x5020b9[_0x2980('0x2b')][_0x2980('0x3c')]){_0x17ff1[_0x2980('0x3d')]=[{'all':!![]}];}_0x17ff1=_[_0x2980('0x39')]({},_0x17ff1,_0x5020b9[_0x2980('0x42')]);return db['CmHopperHistory'][_0x2980('0x43')](_0x17ff1)[_0x2980('0x1e')](handleEntityNotFound(_0x1749cb,null))[_0x2980('0x1e')](respondWithResult(_0x1749cb,null))[_0x2980('0x44')](handleError(_0x1749cb,null));};exports[_0x2980('0x45')]=function(_0x200099,_0x52c39c){return db[_0x2980('0x26')][_0x2980('0x45')](_0x200099[_0x2980('0x46')],{})[_0x2980('0x1e')](respondWithResult(_0x52c39c,0xc9))[_0x2980('0x44')](handleError(_0x52c39c,null));};exports['describe']=function(_0x3496dc,_0x51be8d){return db[_0x2980('0x26')][_0x2980('0x47')]()[_0x2980('0x1e')](respondWithResult(_0x51be8d,null))[_0x2980('0x44')](handleError(_0x51be8d,null));};exports[_0x2980('0x1c')]=function(_0x1b04b9,_0x181edf){if(_0x1b04b9['body'][_0x2980('0x48')]){delete _0x1b04b9[_0x2980('0x46')][_0x2980('0x48')];}return db[_0x2980('0x26')]['find']({'where':{'uniqueid':_0x1b04b9[_0x2980('0x41')]['id']}})[_0x2980('0x1e')](handleEntityNotFound(_0x181edf,null))['then'](saveUpdates(_0x1b04b9[_0x2980('0x46')],null))[_0x2980('0x1e')](respondWithResult(_0x181edf,null))['catch'](handleError(_0x181edf,null));}; \ No newline at end of file +var _0x374e=['catch','create','body','uniqueid','find','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','CmHopperHistory','includeAll','findAll','rows','show','params','include'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x374e,0x17c));var _0xe374=function(_0x5c61a9,_0x4b8ddb){_0x5c61a9=_0x5c61a9-0x0;var _0x7b0451=_0x374e[_0x5c61a9];return _0x7b0451;};'use strict';var pdf=require(_0xe374('0x0'));var emlformat=require(_0xe374('0x1'));var rimraf=require(_0xe374('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe374('0x3'));var rp=require(_0xe374('0x4'));var moment=require(_0xe374('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xe374('0x6'));var util=require(_0xe374('0x7'));var path=require('path');var sox=require(_0xe374('0x8'));var csv=require('to-csv');var ejs=require(_0xe374('0x9'));var fs=require('fs');var _=require(_0xe374('0xa'));var squel=require('squel');var crypto=require(_0xe374('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xe374('0xc'));var toCsv=require(_0xe374('0xd'));var querystring=require(_0xe374('0xe'));var Papa=require(_0xe374('0xf'));var Redis=require(_0xe374('0x10'));var authService=require(_0xe374('0x11'));var qs=require(_0xe374('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe374('0x13'));var logger=require(_0xe374('0x14'))(_0xe374('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xe374('0x16'))['db'];function respondWithStatusCode(_0xd680de,_0x43cbea){_0x43cbea=_0x43cbea||0xcc;return function(_0xe2b9a3){if(_0xe2b9a3){return _0xd680de[_0xe374('0x17')](_0x43cbea);}return _0xd680de[_0xe374('0x18')](_0x43cbea)[_0xe374('0x19')]();};}function respondWithResult(_0x55110a,_0x29426a){_0x29426a=_0x29426a||0xc8;return function(_0x5027f9){if(_0x5027f9){return _0x55110a[_0xe374('0x18')](_0x29426a)['json'](_0x5027f9);}};}function respondWithFilteredResult(_0x54a217,_0x2aba7f){return function(_0x53cbca){if(_0x53cbca){var _0x50ae5e=_0x53cbca[_0xe374('0x1a')],_0x4b87c0=_0x2aba7f[_0xe374('0x1b')],_0x245233=_0x2aba7f[_0xe374('0x1b')]+_0x2aba7f[_0xe374('0x1c')],_0x55acf4;if(_0x245233>=_0x50ae5e){_0x245233=_0x50ae5e;_0x55acf4=0xc8;}else{_0x55acf4=0xce;}_0x54a217[_0xe374('0x18')](_0x55acf4);return _0x54a217[_0xe374('0x1d')](_0xe374('0x1e'),_0x4b87c0+'-'+_0x245233+'/'+_0x50ae5e)[_0xe374('0x1f')](_0x53cbca);}return null;};}function patchUpdates(_0x37dfeb){return function(_0x18730a){try{jsonpatch[_0xe374('0x20')](_0x18730a,_0x37dfeb,!![]);}catch(_0x2226ad){return BPromise[_0xe374('0x21')](_0x2226ad);}return _0x18730a[_0xe374('0x22')]();};}function saveUpdates(_0x10e9fc,_0xfeaf75){return function(_0x380c25){if(_0x380c25){return _0x380c25[_0xe374('0x23')](_0x10e9fc)[_0xe374('0x24')](function(_0x277134){return _0x277134;});}return null;};}function removeEntity(_0xc1f6e9,_0x3b3c9e){return function(_0x838b77){if(_0x838b77){return _0x838b77['destroy']()['then'](function(){_0xc1f6e9[_0xe374('0x18')](0xcc)[_0xe374('0x19')]();});}};}function handleEntityNotFound(_0x29bfab,_0x155e2b){return function(_0x295d43){if(!_0x295d43){_0x29bfab['sendStatus'](0x194);}return _0x295d43;};}function handleError(_0x4bc2dc,_0x1d628b){_0x1d628b=_0x1d628b||0x1f4;return function(_0x29e093){logger[_0xe374('0x25')](_0x29e093[_0xe374('0x26')]);if(_0x29e093['name']){delete _0x29e093[_0xe374('0x27')];}_0x4bc2dc[_0xe374('0x18')](_0x1d628b)[_0xe374('0x28')](_0x29e093);};}exports[_0xe374('0x29')]=function(_0x31093e,_0x544217){var _0x3a9dc6={},_0x3325a8={},_0x164153={'count':0x0,'rows':[]};var _0x406639=_[_0xe374('0x2a')](db['CmHopperHistory'][_0xe374('0x2b')],function(_0x3f2878){return{'name':_0x3f2878[_0xe374('0x2c')],'type':_0x3f2878[_0xe374('0x2d')][_0xe374('0x2e')]};});_0x3325a8[_0xe374('0x2f')]=_[_0xe374('0x2a')](_0x406639,_0xe374('0x27'));_0x3325a8['query']=_[_0xe374('0x30')](_0x31093e[_0xe374('0x31')]);_0x3325a8[_0xe374('0x32')]=_['intersection'](_0x3325a8[_0xe374('0x2f')],_0x3325a8['query']);_0x3a9dc6[_0xe374('0x33')]=_[_0xe374('0x34')](_0x3325a8['model'],qs[_0xe374('0x35')](_0x31093e[_0xe374('0x31')][_0xe374('0x35')]));_0x3a9dc6[_0xe374('0x33')]=_0x3a9dc6['attributes'][_0xe374('0x36')]?_0x3a9dc6[_0xe374('0x33')]:_0x3325a8[_0xe374('0x2f')];if(!_0x31093e[_0xe374('0x31')][_0xe374('0x37')]('nolimit')){_0x3a9dc6['limit']=qs[_0xe374('0x1c')](_0x31093e[_0xe374('0x31')][_0xe374('0x1c')]);_0x3a9dc6[_0xe374('0x1b')]=qs[_0xe374('0x1b')](_0x31093e[_0xe374('0x31')][_0xe374('0x1b')]);}_0x3a9dc6[_0xe374('0x38')]=qs[_0xe374('0x39')](_0x31093e[_0xe374('0x31')][_0xe374('0x39')]);_0x3a9dc6[_0xe374('0x3a')]=qs['filters'](_['pick'](_0x31093e['query'],_0x3325a8['filters']));if(_0x31093e[_0xe374('0x31')][_0xe374('0x3b')]){_0x3a9dc6[_0xe374('0x3a')]=_[_0xe374('0x3c')](_0x3a9dc6[_0xe374('0x3a')],{'$or':_[_0xe374('0x2a')](_0x406639,function(_0xd2622a){if(_0xd2622a[_0xe374('0x2d')][_0xe374('0x2e')]!==_0xe374('0x3d')){var _0x612b={};_0x612b[_0xd2622a['field']]={'$like':'%'+_0x31093e[_0xe374('0x31')][_0xe374('0x3b')]+'%'};return _0x612b;}})});}_0x3a9dc6=_[_0xe374('0x3c')]({},_0x3a9dc6,_0x31093e[_0xe374('0x3e')]);var _0x249dab={'where':_0x3a9dc6[_0xe374('0x3a')]};return db[_0xe374('0x3f')][_0xe374('0x1a')](_0x249dab)[_0xe374('0x24')](function(_0x1ce0b1){_0x164153[_0xe374('0x1a')]=_0x1ce0b1;if(_0x31093e[_0xe374('0x31')][_0xe374('0x40')]){_0x3a9dc6['include']=[{'all':!![]}];}return db[_0xe374('0x3f')][_0xe374('0x41')](_0x3a9dc6);})[_0xe374('0x24')](function(_0x462aa1){_0x164153[_0xe374('0x42')]=_0x462aa1;return _0x164153;})['then'](respondWithFilteredResult(_0x544217,_0x3a9dc6))['catch'](handleError(_0x544217,null));};exports[_0xe374('0x43')]=function(_0x5778e1,_0x806f3d){var _0x2dcb21={'raw':!![],'where':{'id':_0x5778e1[_0xe374('0x44')]['id']}},_0x3ce314={};_0x3ce314[_0xe374('0x2f')]=_['keys'](db[_0xe374('0x3f')][_0xe374('0x2b')]);_0x3ce314[_0xe374('0x31')]=_[_0xe374('0x30')](_0x5778e1[_0xe374('0x31')]);_0x3ce314[_0xe374('0x32')]=_['intersection'](_0x3ce314['model'],_0x3ce314['query']);_0x2dcb21['attributes']=_['intersection'](_0x3ce314[_0xe374('0x2f')],qs['fields'](_0x5778e1[_0xe374('0x31')][_0xe374('0x35')]));_0x2dcb21[_0xe374('0x33')]=_0x2dcb21['attributes'][_0xe374('0x36')]?_0x2dcb21[_0xe374('0x33')]:_0x3ce314[_0xe374('0x2f')];if(_0x5778e1[_0xe374('0x31')][_0xe374('0x40')]){_0x2dcb21[_0xe374('0x45')]=[{'all':!![]}];}_0x2dcb21=_['merge']({},_0x2dcb21,_0x5778e1[_0xe374('0x3e')]);return db['CmHopperHistory']['find'](_0x2dcb21)['then'](handleEntityNotFound(_0x806f3d,null))[_0xe374('0x24')](respondWithResult(_0x806f3d,null))[_0xe374('0x46')](handleError(_0x806f3d,null));};exports['create']=function(_0x1ae6da,_0x3b519a){return db[_0xe374('0x3f')][_0xe374('0x47')](_0x1ae6da[_0xe374('0x48')],{})[_0xe374('0x24')](respondWithResult(_0x3b519a,0xc9))[_0xe374('0x46')](handleError(_0x3b519a,null));};exports['describe']=function(_0x25e5eb,_0x3ef882){return db[_0xe374('0x3f')]['describe']()[_0xe374('0x24')](respondWithResult(_0x3ef882,null))[_0xe374('0x46')](handleError(_0x3ef882,null));};exports[_0xe374('0x23')]=function(_0xada51c,_0x3b6ec2){if(_0xada51c['body'][_0xe374('0x49')]){delete _0xada51c['body'][_0xe374('0x49')];}return db['CmHopperHistory'][_0xe374('0x4a')]({'where':{'uniqueid':_0xada51c[_0xe374('0x44')]['id']}})[_0xe374('0x24')](handleEntityNotFound(_0x3b6ec2,null))['then'](saveUpdates(_0xada51c['body'],null))['then'](respondWithResult(_0x3b6ec2,null))[_0xe374('0x46')](handleError(_0x3b6ec2,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index bfb5b64..e3c8265 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 _0x9c35=['cm_hopper_history','endtime','uniqueid','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','CmHopperHistory'];(function(_0x39b670,_0x760b62){var _0x47c8fb=function(_0x4ce9f2){while(--_0x4ce9f2){_0x39b670['push'](_0x39b670['shift']());}};_0x47c8fb(++_0x760b62);}(_0x9c35,0x1c3));var _0x59c3=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x9c35[_0x31e29a];return _0x32d892;};'use strict';var _=require('lodash');var util=require(_0x59c3('0x0'));var logger=require(_0x59c3('0x1'))(_0x59c3('0x2'));var moment=require('moment');var BPromise=require(_0x59c3('0x3'));var rp=require(_0x59c3('0x4'));var fs=require('fs');var path=require(_0x59c3('0x5'));var rimraf=require(_0x59c3('0x6'));var config=require(_0x59c3('0x7'));var attributes=require(_0x59c3('0x8'));module[_0x59c3('0x9')]=function(_0x486f07,_0x21078d){return _0x486f07['define'](_0x59c3('0xa'),attributes,{'tableName':_0x59c3('0xb'),'paranoid':![],'indexes':[{'name':_0x59c3('0xc'),'fields':['endtime']},{'name':_0x59c3('0xd'),'fields':[_0x59c3('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4da0=['bluebird','path','rimraf','../../config/environment','exports','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','util','../../config/logger','api','moment'];(function(_0x1591d4,_0x4ea3bd){var _0x4c46bb=function(_0x13b7e7){while(--_0x13b7e7){_0x1591d4['push'](_0x1591d4['shift']());}};_0x4c46bb(++_0x4ea3bd);}(_0x4da0,0x88));var _0x04da=function(_0x4a68b9,_0x1cf8f2){_0x4a68b9=_0x4a68b9-0x0;var _0x2a86c0=_0x4da0[_0x4a68b9];return _0x2a86c0;};'use strict';var _=require('lodash');var util=require(_0x04da('0x0'));var logger=require(_0x04da('0x1'))(_0x04da('0x2'));var moment=require(_0x04da('0x3'));var BPromise=require(_0x04da('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x04da('0x5'));var rimraf=require(_0x04da('0x6'));var config=require(_0x04da('0x7'));var attributes=require('./cmHopperHistory.attributes');module[_0x04da('0x8')]=function(_0x26e529,_0x244ebf){return _0x26e529[_0x04da('0x9')](_0x04da('0xa'),attributes,{'tableName':_0x04da('0xb'),'paranoid':![],'indexes':[{'name':'endtime','fields':[_0x04da('0xc')]},{'name':_0x04da('0xd'),'fields':[_0x04da('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 74b9255..b6dabb5 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 _0x96cc=['`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetVoiceQueueHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','GetCampaignHopperHistory','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','debug','AvgHandleTime','findAll','where','sequelize','col','predictiveIntervalTotalCalls','COUNT','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','`state`\x20=\x204,\x20`holdtime`,\x20null','AVG','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','outboundNoAnswerCallsDay','outboundAnswerCallsDay','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayCallersExit'];(function(_0x50f392,_0x1d8441){var _0x5926f2=function(_0x17df32){while(--_0x17df32){_0x50f392['push'](_0x50f392['shift']());}};_0x5926f2(++_0x1d8441);}(_0x96cc,0x16c));var _0xc96c=function(_0x51da74,_0xed04){_0x51da74=_0x51da74-0x0;var _0x58cbd7=_0x96cc[_0x51da74];return _0x58cbd7;};'use strict';var _=require(_0xc96c('0x0'));var util=require('util');var moment=require(_0xc96c('0x1'));var BPromise=require('bluebird');var rs=require(_0xc96c('0x2'));var fs=require('fs');var Redis=require(_0xc96c('0x3'));var db=require(_0xc96c('0x4'))['db'];var utils=require(_0xc96c('0x5'));var logger=require(_0xc96c('0x6'))(_0xc96c('0x7'));var config=require(_0xc96c('0x8'));var jayson=require(_0xc96c('0x9'));var client=jayson[_0xc96c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10b411,_0x18eb9c,_0x408afb){return new BPromise(function(_0x86c1a8,_0x13363d){return client[_0xc96c('0xb')](_0x10b411,_0x408afb)[_0xc96c('0xc')](function(_0x54e765){logger[_0xc96c('0xd')](_0xc96c('0xe'),_0x18eb9c,_0xc96c('0xf'));logger['debug'](_0xc96c('0x10'),_0x18eb9c,'request\x20sent',JSON[_0xc96c('0x11')](_0x54e765));if(_0x54e765['error']){if(_0x54e765[_0xc96c('0x12')][_0xc96c('0x13')]===0x1f4){logger[_0xc96c('0x12')](_0xc96c('0xe'),_0x18eb9c,_0x54e765['error'][_0xc96c('0x14')]);return _0x13363d(_0x54e765[_0xc96c('0x12')][_0xc96c('0x14')]);}logger[_0xc96c('0x12')]('CmHopperHistory,\x20%s,\x20%s',_0x18eb9c,_0x54e765[_0xc96c('0x12')][_0xc96c('0x14')]);return _0x86c1a8(_0x54e765[_0xc96c('0x12')][_0xc96c('0x14')]);}else{logger[_0xc96c('0xd')](_0xc96c('0xe'),_0x18eb9c,_0xc96c('0xf'));_0x86c1a8(_0x54e765[_0xc96c('0x15')][_0xc96c('0x14')]);}})[_0xc96c('0x16')](function(_0x861230){logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x18eb9c,_0x861230);_0x13363d(_0x861230);});});}exports[_0xc96c('0x17')]=function(_0x99c402){var _0x16b6ce=this;return new Promise(function(_0x2ae19a,_0x4aa6a3){return db[_0xc96c('0x18')][_0xc96c('0x19')](_0x99c402[_0xc96c('0x1a')],{'raw':_0x99c402[_0xc96c('0x1b')]?_0x99c402[_0xc96c('0x1b')][_0xc96c('0x1c')]===undefined?!![]:![]:!![]})[_0xc96c('0xc')](function(_0x41daba){logger[_0xc96c('0xd')](_0xc96c('0x17'),_0x99c402);logger[_0xc96c('0x1d')](_0xc96c('0x17'),_0x99c402,JSON[_0xc96c('0x11')](_0x41daba));_0x2ae19a(_0x41daba);})[_0xc96c('0x16')](function(_0x325c54){logger[_0xc96c('0x12')](_0xc96c('0x17'),_0x325c54['message'],_0x99c402);_0x4aa6a3(_0x16b6ce[_0xc96c('0x12')](0x1f4,_0x325c54[_0xc96c('0x14')]));});});};exports[_0xc96c('0x1e')]=function(_0x10ae21){var _0x2b1df9=this;return new Promise(function(_0x35f480,_0x40f23d){return db[_0xc96c('0x18')][_0xc96c('0x1f')]({'raw':_0x10ae21[_0xc96c('0x1b')]?_0x10ae21['options'][_0xc96c('0x1c')]===undefined?!![]:![]:!![],'where':_0x10ae21[_0xc96c('0x1b')]?_0x10ae21[_0xc96c('0x1b')][_0xc96c('0x20')]||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db[_0xc96c('0x21')][_0xc96c('0x22')]('id')),_0xc96c('0x23')],[db[_0xc96c('0x21')]['fn'](_0xc96c('0x24'),db[_0xc96c('0x21')]['fn']('IF',db[_0xc96c('0x21')][_0xc96c('0x25')](_0xc96c('0x26')))),_0xc96c('0x27')],[db[_0xc96c('0x21')]['fn'](_0xc96c('0x24'),db[_0xc96c('0x21')]['fn']('IF',db[_0xc96c('0x21')]['literal'](_0xc96c('0x28')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0xc96c('0x21')]['fn'](_0xc96c('0x24'),db[_0xc96c('0x21')]['fn']('IF',db['sequelize'][_0xc96c('0x25')](_0xc96c('0x29')))),_0xc96c('0x2a')],[db[_0xc96c('0x21')]['fn']('AVG',db['sequelize']['fn']('IF',db[_0xc96c('0x21')][_0xc96c('0x25')](_0xc96c('0x2b')))),'predictiveIntervalAvgHoldtime'],[db[_0xc96c('0x21')]['fn'](_0xc96c('0x2c'),db[_0xc96c('0x21')]['fn']('IF',db[_0xc96c('0x21')]['literal'](_0xc96c('0x2d')))),_0xc96c('0x2e')]]})['then'](function(_0x2b1dec){logger[_0xc96c('0xd')](_0xc96c('0x1e'),_0x10ae21);logger[_0xc96c('0x1d')](_0xc96c('0x1e'),_0x10ae21,JSON[_0xc96c('0x11')](_0x2b1dec));_0x35f480(_0x2b1dec);})['catch'](function(_0x35dfb7){logger[_0xc96c('0x12')](_0xc96c('0x1e'),_0x35dfb7[_0xc96c('0x14')],_0x10ae21);_0x40f23d(_0x2b1df9[_0xc96c('0x12')](0x1f4,_0x35dfb7[_0xc96c('0x14')]));});});};exports['GetVoiceQueueHopperHistory']=function(_0x56b5c9){var _0x33b4bb=this;return new Promise(function(_0x156d0f,_0x5006ec){return db['CmHopperHistory'][_0xc96c('0x1f')]({'raw':_0x56b5c9[_0xc96c('0x1b')]?_0x56b5c9[_0xc96c('0x1b')][_0xc96c('0x1c')]===undefined?!![]:![]:!![],'where':_0x56b5c9[_0xc96c('0x1b')]?_0x56b5c9[_0xc96c('0x1b')][_0xc96c('0x20')]||null:null,'attributes':[[_0xc96c('0x2f'),_0xc96c('0x30')],[db[_0xc96c('0x21')]['fn'](_0xc96c('0x24'),db['sequelize']['fn']('IF',db[_0xc96c('0x21')][_0xc96c('0x25')](_0xc96c('0x31')))),_0xc96c('0x32')],[db['sequelize']['fn'](_0xc96c('0x24'),db[_0xc96c('0x21')]['fn']('IF',db[_0xc96c('0x21')]['literal']('`state`\x20=\x203,\x201,\x20null'))),_0xc96c('0x33')],[db[_0xc96c('0x21')]['fn'](_0xc96c('0x24'),db['sequelize']['fn']('IF',db[_0xc96c('0x21')][_0xc96c('0x25')](_0xc96c('0x26')))),_0xc96c('0x34')],[db[_0xc96c('0x21')]['fn'](_0xc96c('0x24'),db[_0xc96c('0x21')]['fn']('IF',db[_0xc96c('0x21')][_0xc96c('0x25')]('`state`\x20=\x205,\x201,\x20null'))),'outboundBusyCallsDay'],[db[_0xc96c('0x21')]['fn'](_0xc96c('0x24'),db[_0xc96c('0x21')]['fn']('IF',db[_0xc96c('0x21')]['literal']('`state`\x20=\x208,\x201,\x20null'))),_0xc96c('0x35')],[db[_0xc96c('0x21')]['fn'](_0xc96c('0x24'),db[_0xc96c('0x21')]['fn']('IF',db[_0xc96c('0x21')][_0xc96c('0x25')](_0xc96c('0x36')))),'outboundDropCallsDayTimeout'],[db[_0xc96c('0x21')]['fn'](_0xc96c('0x24'),db[_0xc96c('0x21')]['fn']('IF',db[_0xc96c('0x21')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xc96c('0x37')],[db[_0xc96c('0x21')]['fn'](_0xc96c('0x24'),db[_0xc96c('0x21')]['fn']('IF',db[_0xc96c('0x21')][_0xc96c('0x25')](_0xc96c('0x38')))),_0xc96c('0x39')],[db[_0xc96c('0x21')]['fn'](_0xc96c('0x24'),db[_0xc96c('0x21')]['fn']('IF',db[_0xc96c('0x21')][_0xc96c('0x25')]('`state`\x20=\x2013,\x201,\x20null'))),_0xc96c('0x3a')],[db[_0xc96c('0x21')]['fn'](_0xc96c('0x24'),db[_0xc96c('0x21')]['fn']('IF',db['sequelize'][_0xc96c('0x25')]('`state`\x20=\x2014,\x201,\x20null'))),_0xc96c('0x3b')],[db[_0xc96c('0x21')]['fn']('COUNT',db[_0xc96c('0x21')]['fn']('IF',db[_0xc96c('0x21')][_0xc96c('0x25')](_0xc96c('0x3c')))),_0xc96c('0x3d')],[db[_0xc96c('0x21')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0xc96c('0x25')]('`state`\x20=\x2016,\x201,\x20null'))),_0xc96c('0x3e')],[db[_0xc96c('0x21')]['fn'](_0xc96c('0x24'),db[_0xc96c('0x21')]['fn']('IF',db[_0xc96c('0x21')][_0xc96c('0x25')](_0xc96c('0x3f')))),_0xc96c('0x3d')],[db[_0xc96c('0x21')]['fn'](_0xc96c('0x24'),db['sequelize']['fn']('IF',db[_0xc96c('0x21')][_0xc96c('0x25')](_0xc96c('0x40')))),_0xc96c('0x41')]],'group':[_0xc96c('0x2f')]})[_0xc96c('0xc')](function(_0xad88c3){logger[_0xc96c('0xd')]('GetVoiceQueueHopperHistory',_0x56b5c9);logger['debug']('GetVoiceQueueHopperHistory',_0x56b5c9,JSON['stringify'](_0xad88c3));_0x156d0f(_0xad88c3);})[_0xc96c('0x16')](function(_0x46c6fb){logger[_0xc96c('0x12')](_0xc96c('0x42'),_0x46c6fb[_0xc96c('0x14')],_0x56b5c9);_0x5006ec(_0x33b4bb[_0xc96c('0x12')](0x1f4,_0x46c6fb[_0xc96c('0x14')]));});});};exports['GetCampaignHopperHistory']=function(_0x47115b){var _0x48dc98=this;return new Promise(function(_0x3c4b60,_0x103e90){return db[_0xc96c('0x18')][_0xc96c('0x1f')]({'raw':_0x47115b[_0xc96c('0x1b')]?_0x47115b['options'][_0xc96c('0x1c')]===undefined?!![]:![]:!![],'where':_0x47115b[_0xc96c('0x1b')]?_0x47115b[_0xc96c('0x1b')][_0xc96c('0x20')]||null:null,'attributes':[[_0xc96c('0x2f'),_0xc96c('0x30')],[db[_0xc96c('0x21')]['fn'](_0xc96c('0x24'),db[_0xc96c('0x21')][_0xc96c('0x22')]('id')),_0xc96c('0x43')],[db[_0xc96c('0x21')]['fn'](_0xc96c('0x24'),db[_0xc96c('0x21')]['fn']('IF',db['sequelize'][_0xc96c('0x25')](_0xc96c('0x26')))),_0xc96c('0x44')]],'group':[_0xc96c('0x2f')]})[_0xc96c('0xc')](function(_0x55219a){logger[_0xc96c('0xd')](_0xc96c('0x45'),_0x47115b);logger[_0xc96c('0x1d')](_0xc96c('0x45'),_0x47115b,JSON['stringify'](_0x55219a));_0x3c4b60(_0x55219a);})[_0xc96c('0x16')](function(_0x4629ce){logger['error']('GetCampaignHopperHistory',_0x4629ce['message'],_0x47115b);_0x103e90(_0x48dc98[_0xc96c('0x12')](0x1f4,_0x4629ce[_0xc96c('0x14')]));});});}; \ No newline at end of file +var _0xefda=['`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','`state`\x20=\x204,\x201,\x20null','ivrAnswerCallsDay','campaign','GetCampaignHopperHistory','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','CmHopperHistory,\x20%s,\x20%s','message','info','result','catch','CreateCmHopperHistory','create','body','options','raw','AvgHandleTime','findAll','where','COUNT','sequelize','predictiveIntervalTotalCalls','literal','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','CmHopperHistory','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundOriginateFailureCallsDay','outboundRejectCallsDay'];(function(_0x4e69b3,_0x1d1faf){var _0x9d62bb=function(_0xd8399a){while(--_0xd8399a){_0x4e69b3['push'](_0x4e69b3['shift']());}};_0x9d62bb(++_0x1d1faf);}(_0xefda,0x96));var _0xaefd=function(_0x3cecd0,_0x3e133f){_0x3cecd0=_0x3cecd0-0x0;var _0x4ff010=_0xefda[_0x3cecd0];return _0x4ff010;};'use strict';var _=require(_0xaefd('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xaefd('0x1'));var rs=require(_0xaefd('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaefd('0x3'))['db'];var utils=require(_0xaefd('0x4'));var logger=require(_0xaefd('0x5'))(_0xaefd('0x6'));var config=require(_0xaefd('0x7'));var jayson=require(_0xaefd('0x8'));var client=jayson['client'][_0xaefd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3b9736,_0x24d10c,_0x1d76f3){return new BPromise(function(_0x4ce248,_0x15193c){return client[_0xaefd('0xa')](_0x3b9736,_0x1d76f3)[_0xaefd('0xb')](function(_0x4d44ed){logger['info']('CmHopperHistory,\x20%s,\x20%s',_0x24d10c,_0xaefd('0xc'));logger[_0xaefd('0xd')](_0xaefd('0xe'),_0x24d10c,_0xaefd('0xc'),JSON[_0xaefd('0xf')](_0x4d44ed));if(_0x4d44ed[_0xaefd('0x10')]){if(_0x4d44ed[_0xaefd('0x10')][_0xaefd('0x11')]===0x1f4){logger[_0xaefd('0x10')](_0xaefd('0x12'),_0x24d10c,_0x4d44ed[_0xaefd('0x10')]['message']);return _0x15193c(_0x4d44ed[_0xaefd('0x10')]['message']);}logger[_0xaefd('0x10')](_0xaefd('0x12'),_0x24d10c,_0x4d44ed[_0xaefd('0x10')][_0xaefd('0x13')]);return _0x4ce248(_0x4d44ed['error'][_0xaefd('0x13')]);}else{logger[_0xaefd('0x14')](_0xaefd('0x12'),_0x24d10c,_0xaefd('0xc'));_0x4ce248(_0x4d44ed[_0xaefd('0x15')][_0xaefd('0x13')]);}})[_0xaefd('0x16')](function(_0x23d736){logger['error'](_0xaefd('0x12'),_0x24d10c,_0x23d736);_0x15193c(_0x23d736);});});}exports[_0xaefd('0x17')]=function(_0x9748f4){var _0x1737a1=this;return new Promise(function(_0x2db61b,_0x244956){return db['CmHopperHistory'][_0xaefd('0x18')](_0x9748f4[_0xaefd('0x19')],{'raw':_0x9748f4[_0xaefd('0x1a')]?_0x9748f4[_0xaefd('0x1a')][_0xaefd('0x1b')]===undefined?!![]:![]:!![]})[_0xaefd('0xb')](function(_0x5282ed){logger[_0xaefd('0x14')](_0xaefd('0x17'),_0x9748f4);logger[_0xaefd('0xd')](_0xaefd('0x17'),_0x9748f4,JSON[_0xaefd('0xf')](_0x5282ed));_0x2db61b(_0x5282ed);})['catch'](function(_0x479486){logger['error'](_0xaefd('0x17'),_0x479486[_0xaefd('0x13')],_0x9748f4);_0x244956(_0x1737a1[_0xaefd('0x10')](0x1f4,_0x479486['message']));});});};exports[_0xaefd('0x1c')]=function(_0x4cd9b2){var _0x3deec8=this;return new Promise(function(_0x3caa99,_0x1a05eb){return db['CmHopperHistory'][_0xaefd('0x1d')]({'raw':_0x4cd9b2[_0xaefd('0x1a')]?_0x4cd9b2[_0xaefd('0x1a')][_0xaefd('0x1b')]===undefined?!![]:![]:!![],'where':_0x4cd9b2[_0xaefd('0x1a')]?_0x4cd9b2['options'][_0xaefd('0x1e')]||null:null,'attributes':[[db['sequelize']['fn'](_0xaefd('0x1f'),db[_0xaefd('0x20')]['col']('id')),_0xaefd('0x21')],[db[_0xaefd('0x20')]['fn']('COUNT',db[_0xaefd('0x20')]['fn']('IF',db[_0xaefd('0x20')][_0xaefd('0x22')]('`state`\x20=\x204,\x201,\x20null'))),_0xaefd('0x23')],[db['sequelize']['fn'](_0xaefd('0x1f'),db['sequelize']['fn']('IF',db['sequelize'][_0xaefd('0x22')](_0xaefd('0x24')))),'predictiveIntervalDroppedCallsTimeout'],[db['sequelize']['fn']('COUNT',db[_0xaefd('0x20')]['fn']('IF',db[_0xaefd('0x20')]['literal']('`state`\x20=\x2011,\x201,\x20null'))),_0xaefd('0x25')],[db[_0xaefd('0x20')]['fn'](_0xaefd('0x26'),db[_0xaefd('0x20')]['fn']('IF',db['sequelize'][_0xaefd('0x22')](_0xaefd('0x27')))),_0xaefd('0x28')],[db[_0xaefd('0x20')]['fn'](_0xaefd('0x26'),db[_0xaefd('0x20')]['fn']('IF',db[_0xaefd('0x20')][_0xaefd('0x22')](_0xaefd('0x29')))),_0xaefd('0x2a')]]})[_0xaefd('0xb')](function(_0x195571){logger[_0xaefd('0x14')](_0xaefd('0x1c'),_0x4cd9b2);logger[_0xaefd('0xd')](_0xaefd('0x1c'),_0x4cd9b2,JSON['stringify'](_0x195571));_0x3caa99(_0x195571);})[_0xaefd('0x16')](function(_0xcb4be8){logger[_0xaefd('0x10')]('AvgHandleTime',_0xcb4be8[_0xaefd('0x13')],_0x4cd9b2);_0x1a05eb(_0x3deec8['error'](0x1f4,_0xcb4be8[_0xaefd('0x13')]));});});};exports[_0xaefd('0x2b')]=function(_0x99a883){var _0xbbbf6d=this;return new Promise(function(_0x2c0d72,_0x2f1548){return db[_0xaefd('0x2c')][_0xaefd('0x1d')]({'raw':_0x99a883[_0xaefd('0x1a')]?_0x99a883[_0xaefd('0x1a')][_0xaefd('0x1b')]===undefined?!![]:![]:!![],'where':_0x99a883[_0xaefd('0x1a')]?_0x99a883[_0xaefd('0x1a')][_0xaefd('0x1e')]||null:null,'attributes':[['campaign',_0xaefd('0x2d')],[db['sequelize']['fn'](_0xaefd('0x1f'),db[_0xaefd('0x20')]['fn']('IF',db[_0xaefd('0x20')][_0xaefd('0x22')](_0xaefd('0x2e')))),_0xaefd('0x2f')],[db[_0xaefd('0x20')]['fn'](_0xaefd('0x1f'),db[_0xaefd('0x20')]['fn']('IF',db[_0xaefd('0x20')]['literal'](_0xaefd('0x30')))),_0xaefd('0x31')],[db['sequelize']['fn'](_0xaefd('0x1f'),db[_0xaefd('0x20')]['fn']('IF',db[_0xaefd('0x20')]['literal']('`state`\x20=\x204,\x201,\x20null'))),_0xaefd('0x32')],[db[_0xaefd('0x20')]['fn'](_0xaefd('0x1f'),db[_0xaefd('0x20')]['fn']('IF',db[_0xaefd('0x20')][_0xaefd('0x22')](_0xaefd('0x33')))),_0xaefd('0x34')],[db['sequelize']['fn'](_0xaefd('0x1f'),db[_0xaefd('0x20')]['fn']('IF',db[_0xaefd('0x20')][_0xaefd('0x22')](_0xaefd('0x35')))),_0xaefd('0x36')],[db[_0xaefd('0x20')]['fn'](_0xaefd('0x1f'),db['sequelize']['fn']('IF',db['sequelize'][_0xaefd('0x22')](_0xaefd('0x37')))),'outboundDropCallsDayTimeout'],[db['sequelize']['fn'](_0xaefd('0x1f'),db[_0xaefd('0x20')]['fn']('IF',db[_0xaefd('0x20')][_0xaefd('0x22')](_0xaefd('0x38')))),_0xaefd('0x39')],[db[_0xaefd('0x20')]['fn'](_0xaefd('0x1f'),db[_0xaefd('0x20')]['fn']('IF',db['sequelize'][_0xaefd('0x22')](_0xaefd('0x3a')))),_0xaefd('0x3b')],[db[_0xaefd('0x20')]['fn'](_0xaefd('0x1f'),db[_0xaefd('0x20')]['fn']('IF',db[_0xaefd('0x20')]['literal'](_0xaefd('0x3c')))),'outboundBlacklistCallsDay'],[db[_0xaefd('0x20')]['fn'](_0xaefd('0x1f'),db[_0xaefd('0x20')]['fn']('IF',db[_0xaefd('0x20')]['literal']('`state`\x20=\x2014,\x201,\x20null'))),_0xaefd('0x3d')],[db[_0xaefd('0x20')]['fn'](_0xaefd('0x1f'),db['sequelize']['fn']('IF',db[_0xaefd('0x20')][_0xaefd('0x22')]('`state`\x20=\x2018,\x201,\x20null'))),_0xaefd('0x3e')],[db[_0xaefd('0x20')]['fn'](_0xaefd('0x1f'),db[_0xaefd('0x20')]['fn']('IF',db[_0xaefd('0x20')][_0xaefd('0x22')](_0xaefd('0x3f')))),_0xaefd('0x40')],[db['sequelize']['fn']('COUNT',db[_0xaefd('0x20')]['fn']('IF',db[_0xaefd('0x20')]['literal'](_0xaefd('0x41')))),'outboundRejectCallsDay'],[db[_0xaefd('0x20')]['fn'](_0xaefd('0x1f'),db[_0xaefd('0x20')]['fn']('IF',db[_0xaefd('0x20')][_0xaefd('0x22')](_0xaefd('0x42')))),'outboundReCallsDay']],'group':['campaign']})[_0xaefd('0xb')](function(_0x338823){logger['info'](_0xaefd('0x2b'),_0x99a883);logger[_0xaefd('0xd')](_0xaefd('0x2b'),_0x99a883,JSON[_0xaefd('0xf')](_0x338823));_0x2c0d72(_0x338823);})['catch'](function(_0x583caa){logger[_0xaefd('0x10')](_0xaefd('0x2b'),_0x583caa[_0xaefd('0x13')],_0x99a883);_0x2f1548(_0xbbbf6d[_0xaefd('0x10')](0x1f4,_0x583caa[_0xaefd('0x13')]));});});};exports['GetCampaignHopperHistory']=function(_0x377c28){var _0x3b6290=this;return new Promise(function(_0x5a54fb,_0xbeca29){return db[_0xaefd('0x2c')]['findAll']({'raw':_0x377c28[_0xaefd('0x1a')]?_0x377c28[_0xaefd('0x1a')][_0xaefd('0x1b')]===undefined?!![]:![]:!![],'where':_0x377c28['options']?_0x377c28[_0xaefd('0x1a')][_0xaefd('0x1e')]||null:null,'attributes':[['campaign',_0xaefd('0x2d')],[db[_0xaefd('0x20')]['fn'](_0xaefd('0x1f'),db[_0xaefd('0x20')]['col']('id')),'ivrTotalCallsDays'],[db[_0xaefd('0x20')]['fn'](_0xaefd('0x1f'),db[_0xaefd('0x20')]['fn']('IF',db[_0xaefd('0x20')][_0xaefd('0x22')](_0xaefd('0x43')))),_0xaefd('0x44')]],'group':[_0xaefd('0x45')]})[_0xaefd('0xb')](function(_0x133c4f){logger['info']('GetCampaignHopperHistory',_0x377c28);logger[_0xaefd('0xd')](_0xaefd('0x46'),_0x377c28,JSON[_0xaefd('0xf')](_0x133c4f));_0x5a54fb(_0x133c4f);})[_0xaefd('0x16')](function(_0x542161){logger[_0xaefd('0x10')](_0xaefd('0x46'),_0x542161[_0xaefd('0x13')],_0x377c28);_0xbeca29(_0x3b6290[_0xaefd('0x10')](0x1f4,_0x542161[_0xaefd('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 1f465a5..6f0f972 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 _0x7f87=['describe','/:id','post','create','put','update','exports','multer','util','connect-timeout','Router','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','index'];(function(_0x3b1ecd,_0x5d22dc){var _0x3ea7a1=function(_0x2a7306){while(--_0x2a7306){_0x3b1ecd['push'](_0x3b1ecd['shift']());}};_0x3ea7a1(++_0x5d22dc);}(_0x7f87,0x18e));var _0x77f8=function(_0x565dea,_0x59420b){_0x565dea=_0x565dea-0x0;var _0x4e8be8=_0x7f87[_0x565dea];return _0x4e8be8;};'use strict';var multer=require(_0x77f8('0x0'));var util=require(_0x77f8('0x1'));var path=require('path');var timeout=require(_0x77f8('0x2'));var express=require('express');var router=express[_0x77f8('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x77f8('0x4'));var config=require(_0x77f8('0x5'));var controller=require(_0x77f8('0x6'));router[_0x77f8('0x7')]('/',auth[_0x77f8('0x8')](),controller[_0x77f8('0x9')]);router[_0x77f8('0x7')]('/describe',auth[_0x77f8('0x8')](),controller[_0x77f8('0xa')]);router[_0x77f8('0x7')](_0x77f8('0xb'),auth[_0x77f8('0x8')](),controller['show']);router[_0x77f8('0xc')]('/',auth[_0x77f8('0x8')](),controller[_0x77f8('0xd')]);router[_0x77f8('0xe')](_0x77f8('0xb'),auth['isAuthenticated'](),controller[_0x77f8('0xf')]);module[_0x77f8('0x10')]=router; \ No newline at end of file +var _0xc2f9=['update','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put'];(function(_0x28a6a8,_0x571419){var _0x2e1d27=function(_0x1181f9){while(--_0x1181f9){_0x28a6a8['push'](_0x28a6a8['shift']());}};_0x2e1d27(++_0x571419);}(_0xc2f9,0x74));var _0x9c2f=function(_0x2c30,_0x508db4){_0x2c30=_0x2c30-0x0;var _0x566305=_0xc2f9[_0x2c30];return _0x566305;};'use strict';var multer=require(_0x9c2f('0x0'));var util=require(_0x9c2f('0x1'));var path=require(_0x9c2f('0x2'));var timeout=require(_0x9c2f('0x3'));var express=require(_0x9c2f('0x4'));var router=express['Router']();var auth=require(_0x9c2f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9c2f('0x6'));var controller=require(_0x9c2f('0x7'));router[_0x9c2f('0x8')]('/',auth[_0x9c2f('0x9')](),controller[_0x9c2f('0xa')]);router[_0x9c2f('0x8')](_0x9c2f('0xb'),auth[_0x9c2f('0x9')](),controller[_0x9c2f('0xc')]);router['get'](_0x9c2f('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x9c2f('0xe')]('/',auth[_0x9c2f('0x9')](),controller[_0x9c2f('0xf')]);router[_0x9c2f('0x10')](_0x9c2f('0xd'),auth[_0x9c2f('0x9')](),controller[_0x9c2f('0x11')]);module[_0x9c2f('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index b6dd473..c95214d 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 _0x0e39=['sequelize','exports','name','STRING'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0x0e39,0x124));var _0x90e3=function(_0x5ac5e8,_0xc333d2){_0x5ac5e8=_0x5ac5e8-0x0;var _0x5eb1ff=_0x0e39[_0x5ac5e8];return _0x5eb1ff;};'use strict';var Sequelize=require(_0x90e3('0x0'));module[_0x90e3('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x90e3('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x90e3('0x3')]},'dialPrefix':{'type':Sequelize[_0x90e3('0x3')]}}; \ No newline at end of file +var _0x0b4d=['exports','STRING','sequelize'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0x0b4d,0x15b));var _0xd0b4=function(_0x4ba9eb,_0x496ce9){_0x4ba9eb=_0x4ba9eb-0x0;var _0x5818fb=_0x0b4d[_0x4ba9eb];return _0x5818fb;};'use strict';var Sequelize=require(_0xd0b4('0x0'));module[_0xd0b4('0x1')]={'name':{'type':Sequelize[_0xd0b4('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xd0b4('0x2')]},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index ab3c8c9..62ada30 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 _0x1345=['removeDispositions','ids','addContacts','CmContact','isArray','tags','push','each','success','dataValues','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','cf_%d','raw','getContactsCsv','concat','now','writeFileSync','format','/tmp/list_%d_%s.csv','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','setHeader','Content-type','download','addCustomField','sequelize','transaction','addCustomFields','Sequelize','TEXT','number','INTEGER','switch','BOOLEAN','queryInterface','addColumn','cm_contacts','cf_%s','getCustomFields','addAgents','omit','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmList.socket','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','save','then','destroy','get','Lists','error','stack','name','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','key','VIRTUAL','field','options','CmList','includeAll','include','rows','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','addDisposition','ListId','findOne','Disposition','rawAttributes','filter'];(function(_0x5a1283,_0x41a6a8){var _0x4215b7=function(_0x241c18){while(--_0x241c18){_0x5a1283['push'](_0x5a1283['shift']());}};_0x4215b7(++_0x41a6a8);}(_0x1345,0xca));var _0x5134=function(_0x110ea8,_0xacb6fa){_0x110ea8=_0x110ea8-0x0;var _0x4073cf=_0x1345[_0x110ea8];return _0x4073cf;};'use strict';var pdf=require(_0x5134('0x0'));var emlformat=require(_0x5134('0x1'));var rimraf=require(_0x5134('0x2'));var zipdir=require(_0x5134('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5134('0x4'));var moment=require(_0x5134('0x5'));var BPromise=require(_0x5134('0x6'));var Mustache=require(_0x5134('0x7'));var util=require(_0x5134('0x8'));var path=require(_0x5134('0x9'));var sox=require(_0x5134('0xa'));var csv=require('to-csv');var ejs=require(_0x5134('0xb'));var fs=require('fs');var _=require(_0x5134('0xc'));var squel=require(_0x5134('0xd'));var crypto=require(_0x5134('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x5134('0xf'));var toCsv=require(_0x5134('0x10'));var querystring=require(_0x5134('0x11'));var Papa=require(_0x5134('0x12'));var Redis=require('ioredis');var authService=require(_0x5134('0x13'));var qs=require(_0x5134('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5134('0x15'));var logger=require(_0x5134('0x16'))(_0x5134('0x17'));var utils=require('../../config/utils');var config=require(_0x5134('0x18'));var db=require(_0x5134('0x19'))['db'];config[_0x5134('0x1a')]=_[_0x5134('0x1b')](config[_0x5134('0x1a')],{'host':_0x5134('0x1c'),'port':0x18eb});var socket=require(_0x5134('0x1d'))(new Redis(config['redis']));require(_0x5134('0x1e'))['register'](socket);function respondWithStatusCode(_0x313738,_0x4e7ebe){_0x4e7ebe=_0x4e7ebe||0xcc;return function(_0x1496ee){if(_0x1496ee){return _0x313738[_0x5134('0x1f')](_0x4e7ebe);}return _0x313738[_0x5134('0x20')](_0x4e7ebe)[_0x5134('0x21')]();};}function respondWithResult(_0x13bbaf,_0x3dcc53){_0x3dcc53=_0x3dcc53||0xc8;return function(_0x18bab5){if(_0x18bab5){return _0x13bbaf[_0x5134('0x20')](_0x3dcc53)['json'](_0x18bab5);}};}function respondWithFilteredResult(_0x2db29b,_0x333f64){return function(_0x2d4e08){if(_0x2d4e08){var _0x288e5e=_0x2d4e08[_0x5134('0x22')],_0x5c620a=_0x333f64[_0x5134('0x23')],_0x4209e0=_0x333f64[_0x5134('0x23')]+_0x333f64[_0x5134('0x24')],_0x1f2f64;if(_0x4209e0>=_0x288e5e){_0x4209e0=_0x288e5e;_0x1f2f64=0xc8;}else{_0x1f2f64=0xce;}_0x2db29b[_0x5134('0x20')](_0x1f2f64);return _0x2db29b[_0x5134('0x25')](_0x5134('0x26'),_0x5c620a+'-'+_0x4209e0+'/'+_0x288e5e)[_0x5134('0x27')](_0x2d4e08);}return null;};}function patchUpdates(_0x22ddb9){return function(_0x1c7b41){try{jsonpatch[_0x5134('0x28')](_0x1c7b41,_0x22ddb9,!![]);}catch(_0x1e64e7){return BPromise['reject'](_0x1e64e7);}return _0x1c7b41[_0x5134('0x29')]();};}function saveUpdates(_0x155163,_0x3e7fde){return function(_0x168f48){if(_0x168f48){return _0x168f48['update'](_0x155163)[_0x5134('0x2a')](function(_0x27636a){return _0x27636a;});}return null;};}function removeEntity(_0x33fbb7,_0x70725){return function(_0x1ba090){if(_0x1ba090){return _0x1ba090[_0x5134('0x2b')]()[_0x5134('0x2a')](function(){var _0x4d7462=_0x1ba090[_0x5134('0x2c')]({'plain':!![]});var _0x55d569=_0x5134('0x2d');return db['UserProfileResource'][_0x5134('0x2b')]({'where':{'type':_0x55d569,'resourceId':_0x4d7462['id']}})[_0x5134('0x2a')](function(){return _0x1ba090;});})['then'](function(){_0x33fbb7[_0x5134('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x20ab4f,_0x450816){return function(_0x52b3fb){if(!_0x52b3fb){_0x20ab4f[_0x5134('0x1f')](0x194);}return _0x52b3fb;};}function handleError(_0x3a19e4,_0x2e4d7e){_0x2e4d7e=_0x2e4d7e||0x1f4;return function(_0xc1b761){logger[_0x5134('0x2e')](_0xc1b761[_0x5134('0x2f')]);if(_0xc1b761[_0x5134('0x30')]){delete _0xc1b761[_0x5134('0x30')];}_0x3a19e4[_0x5134('0x20')](_0x2e4d7e)['send'](_0xc1b761);};}exports['index']=function(_0x41f6f4,_0x3ccd4b){var _0x520723={},_0x27b1d1={},_0x66dd0f={'count':0x0,'rows':[]};var _0x227ca1=_['map'](db['CmList']['rawAttributes'],function(_0x54bd7){return{'name':_0x54bd7[_0x5134('0x31')],'type':_0x54bd7[_0x5134('0x32')]['key']};});_0x27b1d1[_0x5134('0x33')]=_[_0x5134('0x34')](_0x227ca1,_0x5134('0x30'));_0x27b1d1[_0x5134('0x35')]=_[_0x5134('0x36')](_0x41f6f4[_0x5134('0x35')]);_0x27b1d1[_0x5134('0x37')]=_[_0x5134('0x38')](_0x27b1d1['model'],_0x27b1d1[_0x5134('0x35')]);_0x520723['attributes']=_[_0x5134('0x38')](_0x27b1d1[_0x5134('0x33')],qs[_0x5134('0x39')](_0x41f6f4['query']['fields']));_0x520723['attributes']=_0x520723[_0x5134('0x3a')][_0x5134('0x3b')]?_0x520723[_0x5134('0x3a')]:_0x27b1d1[_0x5134('0x33')];if(!_0x41f6f4[_0x5134('0x35')][_0x5134('0x3c')](_0x5134('0x3d'))){_0x520723[_0x5134('0x24')]=qs[_0x5134('0x24')](_0x41f6f4[_0x5134('0x35')][_0x5134('0x24')]);_0x520723[_0x5134('0x23')]=qs[_0x5134('0x23')](_0x41f6f4[_0x5134('0x35')][_0x5134('0x23')]);}_0x520723[_0x5134('0x3e')]=qs[_0x5134('0x3f')](_0x41f6f4['query'][_0x5134('0x3f')]);_0x520723[_0x5134('0x40')]=qs[_0x5134('0x37')](_[_0x5134('0x41')](_0x41f6f4[_0x5134('0x35')],_0x27b1d1['filters']));if(_0x41f6f4[_0x5134('0x35')]['filter']){_0x520723[_0x5134('0x40')]=_[_0x5134('0x42')](_0x520723[_0x5134('0x40')],{'$or':_[_0x5134('0x34')](_0x227ca1,function(_0xf87c48){if(_0xf87c48['type'][_0x5134('0x43')]!==_0x5134('0x44')){var _0x4833d8={};_0x4833d8[_0xf87c48[_0x5134('0x45')]]={'$like':'%'+_0x41f6f4['query']['filter']+'%'};return _0x4833d8;}})});}_0x520723=_['merge']({},_0x520723,_0x41f6f4[_0x5134('0x46')]);var _0x3cb6fc={'where':_0x520723[_0x5134('0x40')]};return db[_0x5134('0x47')]['count'](_0x3cb6fc)[_0x5134('0x2a')](function(_0x1613b9){_0x66dd0f[_0x5134('0x22')]=_0x1613b9;if(_0x41f6f4[_0x5134('0x35')][_0x5134('0x48')]){_0x520723[_0x5134('0x49')]=[{'all':!![]}];}return db[_0x5134('0x47')]['findAll'](_0x520723);})['then'](function(_0x1b4b7a){_0x66dd0f[_0x5134('0x4a')]=_0x1b4b7a;return _0x66dd0f;})[_0x5134('0x2a')](respondWithFilteredResult(_0x3ccd4b,_0x520723))['catch'](handleError(_0x3ccd4b,null));};exports[_0x5134('0x4b')]=function(_0x3d8f20,_0x1ae9c6){var _0x3cc608={'raw':![],'where':{'id':_0x3d8f20['params']['id']}},_0x2e0026={};_0x2e0026[_0x5134('0x33')]=_[_0x5134('0x36')](db[_0x5134('0x47')]['rawAttributes']);_0x2e0026[_0x5134('0x35')]=_[_0x5134('0x36')](_0x3d8f20['query']);_0x2e0026[_0x5134('0x37')]=_[_0x5134('0x38')](_0x2e0026[_0x5134('0x33')],_0x2e0026[_0x5134('0x35')]);_0x3cc608[_0x5134('0x3a')]=_[_0x5134('0x38')](_0x2e0026[_0x5134('0x33')],qs['fields'](_0x3d8f20['query'][_0x5134('0x39')]));_0x3cc608['attributes']=_0x3cc608[_0x5134('0x3a')]['length']?_0x3cc608[_0x5134('0x3a')]:_0x2e0026[_0x5134('0x33')];if(_0x3d8f20[_0x5134('0x35')]['includeAll']){_0x3cc608[_0x5134('0x49')]=[{'all':!![]}];}_0x3cc608=_[_0x5134('0x42')]({},_0x3cc608,_0x3d8f20[_0x5134('0x46')]);return db[_0x5134('0x47')][_0x5134('0x4c')](_0x3cc608)[_0x5134('0x2a')](handleEntityNotFound(_0x1ae9c6,null))['then'](respondWithResult(_0x1ae9c6,null))['catch'](handleError(_0x1ae9c6,null));};exports[_0x5134('0x4d')]=function(_0x33b135,_0x15c102){return db[_0x5134('0x47')][_0x5134('0x4d')](_0x33b135[_0x5134('0x4e')],{})[_0x5134('0x2a')](function(_0x2e638b){var _0x3ad77b=_0x33b135[_0x5134('0x4f')]['get']({'plain':!![]});if(!_0x3ad77b)throw new Error(_0x5134('0x50'));if(_0x3ad77b[_0x5134('0x51')]==='user'){var _0x2e69d1=_0x2e638b[_0x5134('0x2c')]({'plain':!![]});var _0x4aa025='Lists';return db[_0x5134('0x52')][_0x5134('0x4c')]({'where':{'name':_0x4aa025,'userProfileId':_0x3ad77b[_0x5134('0x53')]},'raw':!![]})[_0x5134('0x2a')](function(_0x24a608){if(_0x24a608&&_0x24a608[_0x5134('0x54')]===0x0){return db['UserProfileResource'][_0x5134('0x4d')]({'name':_0x2e69d1[_0x5134('0x30')],'resourceId':_0x2e69d1['id'],'type':_0x24a608[_0x5134('0x30')],'sectionId':_0x24a608['id']},{})['then'](function(){return _0x2e638b;});}else{return _0x2e638b;}})[_0x5134('0x55')](function(_0x2db269){logger[_0x5134('0x2e')](_0x5134('0x56'),_0x2db269);throw _0x2db269;});}return _0x2e638b;})['then'](respondWithResult(_0x15c102,0xc9))[_0x5134('0x55')](handleError(_0x15c102,null));};exports[_0x5134('0x57')]=function(_0x1c8106,_0x4bb7c8){if(_0x1c8106[_0x5134('0x4e')]['id']){delete _0x1c8106[_0x5134('0x4e')]['id'];}return db[_0x5134('0x47')][_0x5134('0x4c')]({'where':{'id':_0x1c8106[_0x5134('0x58')]['id']}})['then'](handleEntityNotFound(_0x4bb7c8,null))[_0x5134('0x2a')](saveUpdates(_0x1c8106[_0x5134('0x4e')],null))[_0x5134('0x2a')](respondWithResult(_0x4bb7c8,null))[_0x5134('0x55')](handleError(_0x4bb7c8,null));};exports[_0x5134('0x2b')]=function(_0x26e003,_0x1ac901){return db['CmList'][_0x5134('0x4c')]({'where':{'id':_0x26e003[_0x5134('0x58')]['id']}})['then'](handleEntityNotFound(_0x1ac901,null))[_0x5134('0x2a')](removeEntity(_0x1ac901,null))[_0x5134('0x55')](handleError(_0x1ac901,null));};exports[_0x5134('0x59')]=function(_0x348f9f,_0x11641d){return db['CmList'][_0x5134('0x59')]()[_0x5134('0x2a')](respondWithResult(_0x11641d,null))[_0x5134('0x55')](handleError(_0x11641d,null));};exports[_0x5134('0x5a')]=function(_0x277c35,_0x51b3ea,_0xf927b0){if(_0x277c35[_0x5134('0x4e')]['id']){delete _0x277c35[_0x5134('0x4e')]['id'];}return db[_0x5134('0x47')]['find']({'where':{'id':_0x277c35[_0x5134('0x58')]['id']}})[_0x5134('0x2a')](handleEntityNotFound(_0x51b3ea,null))[_0x5134('0x2a')](function(_0x3140b1){if(_0x3140b1){_0x277c35[_0x5134('0x4e')][_0x5134('0x5b')]=_0x3140b1['id'];return db['Disposition'][_0x5134('0x4d')](_0x277c35[_0x5134('0x4e')]);}})[_0x5134('0x2a')](respondWithResult(_0x51b3ea,null))[_0x5134('0x55')](handleError(_0x51b3ea,null));};exports['getDispositions']=function(_0x4f8446,_0x25a9a5,_0x1437ed){var _0x260597={'raw':![],'where':{}};var _0x327401={};var _0x1d7030={'count':0x0,'rows':[]};return db['CmList'][_0x5134('0x5c')]({'where':{'id':_0x4f8446[_0x5134('0x58')]['id']}})[_0x5134('0x2a')](handleEntityNotFound(_0x25a9a5,null))[_0x5134('0x2a')](function(_0x272701){if(_0x272701){_0x327401[_0x5134('0x33')]=_[_0x5134('0x36')](db[_0x5134('0x5d')][_0x5134('0x5e')]);_0x327401['query']=_['keys'](_0x4f8446[_0x5134('0x35')]);_0x327401[_0x5134('0x37')]=_['intersection'](_0x327401[_0x5134('0x33')],_0x327401[_0x5134('0x35')]);_0x260597[_0x5134('0x3a')]=_['intersection'](_0x327401[_0x5134('0x33')],qs['fields'](_0x4f8446[_0x5134('0x35')]['fields']));_0x260597[_0x5134('0x3a')]=_0x260597[_0x5134('0x3a')][_0x5134('0x3b')]?_0x260597['attributes']:_0x327401[_0x5134('0x33')];if(!_0x4f8446[_0x5134('0x35')][_0x5134('0x3c')](_0x5134('0x3d'))){_0x260597['limit']=qs[_0x5134('0x24')](_0x4f8446['query']['limit']);_0x260597[_0x5134('0x23')]=qs[_0x5134('0x23')](_0x4f8446[_0x5134('0x35')][_0x5134('0x23')]);}_0x260597[_0x5134('0x3e')]=qs[_0x5134('0x3f')](_0x4f8446[_0x5134('0x35')][_0x5134('0x3f')]);_0x260597['where']=qs[_0x5134('0x37')](_[_0x5134('0x41')](_0x4f8446[_0x5134('0x35')],_0x327401[_0x5134('0x37')]));_0x260597['where'][_0x5134('0x5b')]=_0x272701['id'];if(_0x4f8446[_0x5134('0x35')][_0x5134('0x5f')]){_0x260597[_0x5134('0x40')]=_[_0x5134('0x42')](_0x260597[_0x5134('0x40')],{'$or':_[_0x5134('0x34')](_0x260597[_0x5134('0x3a')],function(_0x305a9d){var _0x4a3321={};_0x4a3321[_0x305a9d]={'$like':'%'+_0x4f8446[_0x5134('0x35')][_0x5134('0x5f')]+'%'};return _0x4a3321;})});}_0x260597=_[_0x5134('0x42')]({},_0x260597,_0x4f8446[_0x5134('0x46')]);return db[_0x5134('0x5d')]['count']({'where':_0x260597['where']})[_0x5134('0x2a')](function(_0x413038){_0x1d7030[_0x5134('0x22')]=_0x413038;if(_0x4f8446['query'][_0x5134('0x48')]){_0x260597[_0x5134('0x49')]=[{'all':!![]}];}return db[_0x5134('0x5d')]['findAll'](_0x260597);})[_0x5134('0x2a')](function(_0x200c03){_0x1d7030[_0x5134('0x4a')]=_0x200c03;return _0x1d7030;});}})[_0x5134('0x2a')](respondWithFilteredResult(_0x25a9a5,_0x260597))[_0x5134('0x55')](handleError(_0x25a9a5,null));};exports[_0x5134('0x60')]=function(_0x431e29,_0x2722cb,_0xadb3c){return db[_0x5134('0x47')]['find']({'where':{'id':_0x431e29[_0x5134('0x58')]['id']}})[_0x5134('0x2a')](handleEntityNotFound(_0x2722cb,null))[_0x5134('0x2a')](function(_0x264f73){if(_0x264f73){return _0x264f73['removeDispositions'](_0x431e29[_0x5134('0x35')][_0x5134('0x61')]);}})[_0x5134('0x2a')](respondWithStatusCode(_0x2722cb,null))[_0x5134('0x55')](handleError(_0x2722cb,null));};exports[_0x5134('0x62')]=function(_0x4707f,_0x1cfdac,_0x3f0b99){return db[_0x5134('0x47')][_0x5134('0x4c')]({'where':{'id':_0x4707f[_0x5134('0x58')]['id']}})[_0x5134('0x2a')](handleEntityNotFound(_0x1cfdac,null))[_0x5134('0x2a')](function(_0x134725){if(_0x134725){var _0xb541dc=[];var _0x4368e9={'success':[],'errors':[]};return db[_0x5134('0x63')][_0x5134('0x59')]()[_0x5134('0x2a')](function(_0x19b14a){if(_0x4707f[_0x5134('0x4e')]['tags']&&_[_0x5134('0x64')](_0x4707f['body'][_0x5134('0x65')])){if(_0x4707f[_0x5134('0x4e')]['tags'][_0x5134('0x3b')]){_0x4707f['body']['tags']=_0x4707f['body'][_0x5134('0x65')]['join'](';')+';';}else{_0x4707f[_0x5134('0x4e')]['tags']=null;}}else{_0x4707f['body']['tags']=null;}if(_0x4707f[_0x5134('0x4e')]&&_[_0x5134('0x64')](_0x4707f[_0x5134('0x4e')])){for(var _0x774e8a=0x0;_0x774e8a<_0x4707f[_0x5134('0x4e')][_0x5134('0x3b')];_0x774e8a+=0x1){_0x4707f[_0x5134('0x4e')][_0x774e8a][_0x5134('0x5b')]=_0x4707f['params']['id'];_0xb541dc[_0x5134('0x66')](_0x4707f[_0x5134('0x4e')][_0x774e8a]);}return BPromise[_0x5134('0x67')](_0xb541dc,function(_0x511e8b){return db['CmContact']['create'](_['omit'](_0x511e8b,[_0x5134('0x61'),'id'])||{},{'fields':_[_0x5134('0x36')](_0x19b14a),'raw':!![]})['then'](function(_0x42c8d3){_0x4368e9[_0x5134('0x68')][_0x5134('0x66')](_0x42c8d3[_0x5134('0x69')]);})[_0x5134('0x55')](function(_0x4c7515){_0x4368e9['errors']['push']({'data':_0x511e8b,'error':_0x4c7515[_0x5134('0x6a')]});});})[_0x5134('0x2a')](function(_0x1fb0f6){return _0x4368e9;})['catch'](function(_0x7fc5f2){return _0x7fc5f2;});}else{_0x1cfdac[_0x5134('0x20')](0x190)[_0x5134('0x27')]({'message':_0x5134('0x6b')});}});}})[_0x5134('0x2a')](respondWithResult(_0x1cfdac,null))[_0x5134('0x55')](handleError(_0x1cfdac,null));};exports[_0x5134('0x6c')]=function(_0x51a167,_0x49c54f,_0x2dbaf4){var _0x3260e8;return db['CmList']['find']({'where':{'id':_0x51a167['params']['id']},'include':[{'model':db[_0x5134('0x6d')],'as':_0x5134('0x6e')}]})[_0x5134('0x2a')](handleEntityNotFound(_0x49c54f,null))[_0x5134('0x2a')](function(_0x746eab){if(_0x746eab){_0x3260e8=_0x746eab;return db[_0x5134('0x63')]['rawAttributes'];}})[_0x5134('0x2a')](function(_0x1daecb){if(_0x1daecb){var _0x47672c={};var _0x1fe634={};_0x1fe634['model']=_['concat'](_['keys'](_0x1daecb),_[_0x5134('0x34')](_0x3260e8[_0x5134('0x6e')],function(_0x5ecdaa){return util['format'](_0x5134('0x6f'),_0x5ecdaa['id']);}));_0x1fe634['query']=_[_0x5134('0x36')](_0x51a167[_0x5134('0x35')]);_0x1fe634[_0x5134('0x37')]=_['intersection'](_0x1fe634[_0x5134('0x33')],_0x1fe634['query']);_0x47672c[_0x5134('0x3a')]=_[_0x5134('0x38')](_0x1fe634[_0x5134('0x33')],qs['fields'](_0x51a167['query']['fields']));_0x47672c[_0x5134('0x3a')]=_0x47672c[_0x5134('0x3a')][_0x5134('0x3b')]?_0x47672c[_0x5134('0x3a')]:_0x1fe634[_0x5134('0x33')];if(!_0x51a167['query']['hasOwnProperty'](_0x5134('0x3d'))){_0x47672c[_0x5134('0x24')]=qs[_0x5134('0x24')](_0x51a167[_0x5134('0x35')][_0x5134('0x24')]);_0x47672c['offset']=qs[_0x5134('0x23')](_0x51a167[_0x5134('0x35')][_0x5134('0x23')]);}_0x47672c[_0x5134('0x3e')]=qs[_0x5134('0x3f')](_0x51a167[_0x5134('0x35')][_0x5134('0x3f')]);_0x47672c[_0x5134('0x40')]=qs['filters'](_[_0x5134('0x41')](_0x51a167[_0x5134('0x35')],_0x1fe634[_0x5134('0x37')]));_0x47672c[_0x5134('0x70')]=!![];if(_0x51a167[_0x5134('0x35')]['filter']){_0x47672c[_0x5134('0x40')]=_['merge'](_0x47672c[_0x5134('0x40')],{'$or':_[_0x5134('0x34')](_0x47672c[_0x5134('0x3a')],function(_0x5f09e7){var _0x3ea6e1={};_0x3ea6e1[_0x5f09e7]={'$like':'%'+_0x51a167[_0x5134('0x35')][_0x5134('0x5f')]+'%'};return _0x3ea6e1;})});}_0x47672c=_['merge']({},_0x47672c,_0x51a167[_0x5134('0x46')]);return _0x3260e8['getContacts'](_0x47672c);}})[_0x5134('0x2a')](respondWithResult(_0x49c54f,null))[_0x5134('0x55')](handleError(_0x49c54f,null));};exports[_0x5134('0x71')]=function(_0x399987,_0x279dc5,_0x4cc67e){var _0x59c755;return db[_0x5134('0x47')][_0x5134('0x4c')]({'where':{'id':_0x399987[_0x5134('0x58')]['id']},'include':[{'model':db[_0x5134('0x6d')],'as':_0x5134('0x6e')}]})[_0x5134('0x2a')](handleEntityNotFound(_0x279dc5,null))[_0x5134('0x2a')](function(_0x28defe){if(_0x28defe){_0x59c755=_0x28defe;return db[_0x5134('0x63')]['rawAttributes'];}})[_0x5134('0x2a')](function(_0x222693){if(_0x222693){var _0x423dda={};var _0x41d236={};_0x41d236[_0x5134('0x33')]=_[_0x5134('0x72')](_[_0x5134('0x36')](_0x222693),_[_0x5134('0x34')](_0x59c755[_0x5134('0x6e')],function(_0x421b3e){return util['format'](_0x5134('0x6f'),_0x421b3e['id']);}));_0x41d236[_0x5134('0x35')]=_[_0x5134('0x36')](_0x399987[_0x5134('0x35')]);_0x41d236[_0x5134('0x37')]=_[_0x5134('0x38')](_0x41d236[_0x5134('0x33')],_0x41d236['query']);_0x423dda[_0x5134('0x3a')]=_['intersection'](_0x41d236[_0x5134('0x33')],qs['fields'](_0x399987[_0x5134('0x35')][_0x5134('0x39')]));_0x423dda[_0x5134('0x3a')]=_0x423dda[_0x5134('0x3a')][_0x5134('0x3b')]?_0x423dda[_0x5134('0x3a')]:_0x41d236[_0x5134('0x33')];if(!_0x399987[_0x5134('0x35')]['hasOwnProperty'](_0x5134('0x3d'))){_0x423dda['limit']=qs[_0x5134('0x24')](_0x399987['query'][_0x5134('0x24')]);_0x423dda['offset']=qs[_0x5134('0x23')](_0x399987[_0x5134('0x35')]['offset']);}_0x423dda[_0x5134('0x3e')]=qs[_0x5134('0x3f')](_0x399987[_0x5134('0x35')][_0x5134('0x3f')]);_0x423dda[_0x5134('0x40')]=qs[_0x5134('0x37')](_['pick'](_0x399987[_0x5134('0x35')],_0x41d236[_0x5134('0x37')]));_0x423dda[_0x5134('0x70')]=!![];if(_0x399987[_0x5134('0x35')][_0x5134('0x5f')]){_0x423dda[_0x5134('0x40')]=_['merge'](_0x423dda[_0x5134('0x40')],{'$or':_['map'](_0x423dda['attributes'],function(_0x56425b){var _0x2ad9f7={};_0x2ad9f7[_0x56425b]={'$like':'%'+_0x399987[_0x5134('0x35')]['filter']+'%'};return _0x2ad9f7;})});}_0x423dda=_[_0x5134('0x42')]({},_0x423dda,_0x399987['options']);return _0x59c755[_0x5134('0x6c')](_0x423dda);}})[_0x5134('0x2a')](function(_0x9847dd){if(!_['isEmpty'](_0x9847dd)){var _0x50b192=toCsv(_0x9847dd);var _0x1e05bb=Date[_0x5134('0x73')]();fs[_0x5134('0x74')](util[_0x5134('0x75')](_0x5134('0x76'),_0x59c755['id'],_0x1e05bb),_0x50b192);_0x279dc5['setHeader'](_0x5134('0x77'),_0x5134('0x78')+util[_0x5134('0x75')](_0x5134('0x79'),_0x59c755['id'],_0x1e05bb));_0x279dc5[_0x5134('0x7a')](_0x5134('0x7b'),'text/csv');return _0x279dc5[_0x5134('0x7c')](util['format'](_0x5134('0x76'),_0x59c755['id'],_0x1e05bb));}else{return _0x279dc5['sendStatus'](0xcc);}})[_0x5134('0x55')](handleError(_0x279dc5,null));};exports[_0x5134('0x7d')]=function(_0x4817ed,_0x31e58a,_0x5757c3){var _0x17ff79;delete _0x4817ed[_0x5134('0x4e')]['id'];return db[_0x5134('0x47')][_0x5134('0x5c')]({'where':{'id':_0x4817ed[_0x5134('0x58')]['id']}})['then'](handleEntityNotFound(_0x31e58a,null))[_0x5134('0x2a')](function(_0x37a3d0){if(_0x37a3d0){return db[_0x5134('0x7e')][_0x5134('0x7f')](function(_0x55c12f){return db[_0x5134('0x6d')][_0x5134('0x4d')](_0x4817ed[_0x5134('0x4e')],{'transaction':_0x55c12f})['then'](function(_0x465ab3){_0x17ff79=_0x465ab3;return _0x37a3d0[_0x5134('0x80')](_0x465ab3,{'transaction':_0x55c12f});})[_0x5134('0x2a')](function(){var _0x126792={'type':db[_0x5134('0x81')]['TEXT'],'transaction':_0x55c12f};switch(_0x4817ed['body']['type']){case'text':_0x126792[_0x5134('0x32')]=db[_0x5134('0x81')][_0x5134('0x82')];break;case _0x5134('0x83'):_0x126792['type']=db['Sequelize'][_0x5134('0x84')];break;case _0x5134('0x85'):_0x126792['type']=db['Sequelize'][_0x5134('0x86')];_0x126792['defaultValue']=![];break;default:}return db[_0x5134('0x7e')][_0x5134('0x87')][_0x5134('0x88')](_0x5134('0x89'),util[_0x5134('0x75')](_0x5134('0x8a'),_0x17ff79['id']),_0x126792);})[_0x5134('0x2a')](function(){return _0x17ff79;});});}})[_0x5134('0x2a')](respondWithResult(_0x31e58a,null))[_0x5134('0x55')](handleError(_0x31e58a,null));};exports[_0x5134('0x8b')]=function(_0x131f0f,_0x3ea643,_0x63a2f7){var _0x5d9e6f={};var _0x49cb74={};var _0x166a49;var _0x58337a;return db[_0x5134('0x47')][_0x5134('0x5c')]({'where':{'id':_0x131f0f['params']['id']}})[_0x5134('0x2a')](handleEntityNotFound(_0x3ea643,null))[_0x5134('0x2a')](function(_0x4e5d80){if(_0x4e5d80){_0x166a49=_0x4e5d80;_0x49cb74[_0x5134('0x33')]=_[_0x5134('0x36')](db[_0x5134('0x6d')][_0x5134('0x5e')]);_0x49cb74[_0x5134('0x35')]=_[_0x5134('0x36')](_0x131f0f['query']);_0x49cb74[_0x5134('0x37')]=_[_0x5134('0x38')](_0x49cb74[_0x5134('0x33')],_0x49cb74[_0x5134('0x35')]);_0x5d9e6f['attributes']=_[_0x5134('0x38')](_0x49cb74['model'],qs[_0x5134('0x39')](_0x131f0f[_0x5134('0x35')]['fields']));_0x5d9e6f[_0x5134('0x3a')]=_0x5d9e6f['attributes']['length']?_0x5d9e6f[_0x5134('0x3a')]:_0x49cb74[_0x5134('0x33')];_0x5d9e6f[_0x5134('0x3e')]=qs['sort'](_0x131f0f[_0x5134('0x35')][_0x5134('0x3f')]);_0x5d9e6f[_0x5134('0x40')]=qs['filters'](_[_0x5134('0x41')](_0x131f0f['query'],_0x49cb74[_0x5134('0x37')]));_0x5d9e6f[_0x5134('0x40')]=_[_0x5134('0x42')](_0x5d9e6f['where'],{'$or':[{'ListId':_0x4e5d80['id']},{'ListId':null}]});if(_0x131f0f[_0x5134('0x35')][_0x5134('0x5f')]){_0x5d9e6f[_0x5134('0x40')]=_[_0x5134('0x42')](_0x5d9e6f[_0x5134('0x40')],{'$or':_[_0x5134('0x34')](_0x5d9e6f[_0x5134('0x3a')],function(_0x459348){var _0x45e11d={};_0x45e11d[_0x459348]={'$like':'%'+_0x131f0f['query'][_0x5134('0x5f')]+'%'};return _0x45e11d;})});}_0x5d9e6f=_[_0x5134('0x42')]({},_0x5d9e6f,_0x131f0f['options']);return db[_0x5134('0x6d')]['findAndCountAll'](_0x5d9e6f);}})[_0x5134('0x2a')](respondWithResult(_0x3ea643,null))['catch'](handleError(_0x3ea643,null));};exports['addAgents']=function(_0x585f6c,_0x5be5bb,_0x2a0bec){return db[_0x5134('0x47')]['find']({'where':{'id':_0x585f6c[_0x5134('0x58')]['id']}})[_0x5134('0x2a')](handleEntityNotFound(_0x5be5bb,null))[_0x5134('0x2a')](function(_0x545984){if(_0x545984){return _0x545984[_0x5134('0x8c')](_0x585f6c[_0x5134('0x4e')][_0x5134('0x61')],_[_0x5134('0x8d')](_0x585f6c[_0x5134('0x4e')],[_0x5134('0x61'),'id'])||{})[_0x5134('0x8e')](function(_0x4ae4c7){for(var _0x4f55fc=0x0;_0x4f55fc<_0x585f6c[_0x5134('0x4e')][_0x5134('0x61')]['length'];_0x4f55fc+=0x1){socket[_0x5134('0x8f')](_0x5134('0x90'),{'UserId':_0x585f6c['body'][_0x5134('0x61')][_0x4f55fc],'CmListId':_0x585f6c[_0x5134('0x58')]['id']});}return _0x4ae4c7;});}})[_0x5134('0x2a')](respondWithResult(_0x5be5bb,null))[_0x5134('0x55')](handleError(_0x5be5bb,null));};exports[_0x5134('0x91')]=function(_0x4065f9,_0x19965e,_0x5a048e){return db[_0x5134('0x47')][_0x5134('0x4c')]({'where':{'id':_0x4065f9[_0x5134('0x58')]['id']}})['then'](handleEntityNotFound(_0x19965e,null))[_0x5134('0x2a')](function(_0x3e7ed3){if(_0x3e7ed3){return _0x3e7ed3[_0x5134('0x91')](_0x4065f9[_0x5134('0x35')][_0x5134('0x61')])[_0x5134('0x2a')](function(){if(_[_0x5134('0x64')](_0x4065f9[_0x5134('0x35')][_0x5134('0x61')])){for(var _0x58c90c=0x0;_0x58c90c<_0x4065f9[_0x5134('0x35')]['ids'][_0x5134('0x3b')];_0x58c90c+=0x1){socket['emit'](_0x5134('0x92'),{'UserId':Number(_0x4065f9[_0x5134('0x35')][_0x5134('0x61')][_0x58c90c]),'CmListId':Number(_0x4065f9[_0x5134('0x58')]['id'])});}}else{socket[_0x5134('0x8f')]('userCmList:remove',{'UserId':Number(_0x4065f9[_0x5134('0x35')][_0x5134('0x61')]),'CmListId':Number(_0x4065f9[_0x5134('0x58')]['id'])});}});}})['then'](respondWithStatusCode(_0x19965e,null))['catch'](handleError(_0x19965e,null));};exports[_0x5134('0x93')]=function(_0x5bd977,_0x5636af,_0xf9cb3d){var _0x4e8c57={};var _0x1547d5={};var _0x39a789;var _0x4292d0;return db['CmList'][_0x5134('0x5c')]({'where':{'id':_0x5bd977['params']['id']}})[_0x5134('0x2a')](handleEntityNotFound(_0x5636af,null))[_0x5134('0x2a')](function(_0x440064){if(_0x440064){_0x39a789=_0x440064;_0x1547d5[_0x5134('0x33')]=_['keys'](db[_0x5134('0x94')][_0x5134('0x5e')]);_0x1547d5[_0x5134('0x35')]=_['keys'](_0x5bd977[_0x5134('0x35')]);_0x1547d5[_0x5134('0x37')]=_[_0x5134('0x38')](_0x1547d5[_0x5134('0x33')],_0x1547d5['query']);_0x4e8c57[_0x5134('0x3a')]=_[_0x5134('0x38')](_0x1547d5[_0x5134('0x33')],qs[_0x5134('0x39')](_0x5bd977['query'][_0x5134('0x39')]));_0x4e8c57['attributes']=_0x4e8c57['attributes'][_0x5134('0x3b')]?_0x4e8c57['attributes']:_0x1547d5[_0x5134('0x33')];_0x4e8c57[_0x5134('0x3e')]=qs[_0x5134('0x3f')](_0x5bd977[_0x5134('0x35')][_0x5134('0x3f')]);_0x4e8c57[_0x5134('0x40')]=qs[_0x5134('0x37')](_['pick'](_0x5bd977[_0x5134('0x35')],_0x1547d5[_0x5134('0x37')]));if(_0x5bd977[_0x5134('0x35')][_0x5134('0x5f')]){_0x4e8c57[_0x5134('0x40')]=_[_0x5134('0x42')](_0x4e8c57[_0x5134('0x40')],{'$or':_[_0x5134('0x34')](_0x4e8c57[_0x5134('0x3a')],function(_0x356688){var _0x262bee={};_0x262bee[_0x356688]={'$like':'%'+_0x5bd977['query'][_0x5134('0x5f')]+'%'};return _0x262bee;})});}_0x4e8c57=_[_0x5134('0x42')]({},_0x4e8c57,_0x5bd977[_0x5134('0x46')]);return _0x39a789['getAgents'](_0x4e8c57);}})[_0x5134('0x2a')](function(_0x4a3557){if(_0x4a3557){_0x4292d0=_0x4a3557[_0x5134('0x3b')];if(!_0x5bd977[_0x5134('0x35')]['hasOwnProperty']('nolimit')){_0x4e8c57['limit']=qs[_0x5134('0x24')](_0x5bd977[_0x5134('0x35')]['limit']);_0x4e8c57[_0x5134('0x23')]=qs[_0x5134('0x23')](_0x5bd977['query'][_0x5134('0x23')]);}return _0x39a789[_0x5134('0x93')](_0x4e8c57);}})[_0x5134('0x2a')](function(_0x3589e1){if(_0x3589e1){return _0x3589e1?{'count':_0x4292d0,'rows':_0x3589e1}:null;}})[_0x5134('0x2a')](respondWithResult(_0x5636af,null))[_0x5134('0x55')](handleError(_0x5636af,null));}; \ No newline at end of file +var _0xf279=['number','INTEGER','switch','defaultValue','queryInterface','addColumn','cm_contacts','getCustomFields','findAndCountAll','addAgents','omit','userCmList:save','removeAgents','emit','userCmList:remove','getAgents','User','html-pdf','eml-format','rimraf','bluebird','mustache','util','ejs','crypto','to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','defaults','localhost','socket.io-emitter','redis','register','sendStatus','end','status','json','count','set','Content-Range','reject','update','then','destroy','get','Lists','UserProfileResource','stack','name','index','CmList','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','offset','order','sort','filter','where','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','rawAttributes','merge','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ListId','Disposition','findOne','pick','removeDispositions','ids','tags','isArray','each','CmContact','success','push','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','format','cf_%d','hasOwnProperty','raw','getContactsCsv','concat','now','/tmp/list_%d_%s.csv','setHeader','list_%d_%s.csv','Content-type','text/csv','download','addCustomField','transaction','addCustomFields','Sequelize','TEXT','text'];(function(_0x5bea3b,_0x4b4807){var _0xba89d7=function(_0x3f51d2){while(--_0x3f51d2){_0x5bea3b['push'](_0x5bea3b['shift']());}};_0xba89d7(++_0x4b4807);}(_0xf279,0x119));var _0x9f27=function(_0x1570e0,_0x271bdf){_0x1570e0=_0x1570e0-0x0;var _0x424cba=_0xf279[_0x1570e0];return _0x424cba;};'use strict';var pdf=require(_0x9f27('0x0'));var emlformat=require(_0x9f27('0x1'));var rimraf=require(_0x9f27('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9f27('0x3'));var Mustache=require(_0x9f27('0x4'));var util=require(_0x9f27('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9f27('0x6'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x9f27('0x7'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9f27('0x8'));var querystring=require(_0x9f27('0x9'));var Papa=require(_0x9f27('0xa'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9f27('0xb'));var hardwareService=require(_0x9f27('0xc'));var logger=require(_0x9f27('0xd'))('api');var utils=require(_0x9f27('0xe'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config['redis']=_[_0x9f27('0xf')](config['redis'],{'host':_0x9f27('0x10'),'port':0x18eb});var socket=require(_0x9f27('0x11'))(new Redis(config[_0x9f27('0x12')]));require('./cmList.socket')[_0x9f27('0x13')](socket);function respondWithStatusCode(_0x1fa1bf,_0x4fca4b){_0x4fca4b=_0x4fca4b||0xcc;return function(_0x41f60c){if(_0x41f60c){return _0x1fa1bf[_0x9f27('0x14')](_0x4fca4b);}return _0x1fa1bf['status'](_0x4fca4b)[_0x9f27('0x15')]();};}function respondWithResult(_0xe991b5,_0x574a94){_0x574a94=_0x574a94||0xc8;return function(_0x1d1f5d){if(_0x1d1f5d){return _0xe991b5[_0x9f27('0x16')](_0x574a94)[_0x9f27('0x17')](_0x1d1f5d);}};}function respondWithFilteredResult(_0x124940,_0x38d16e){return function(_0x4201c2){if(_0x4201c2){var _0x1b6d26=_0x4201c2[_0x9f27('0x18')],_0x3add53=_0x38d16e['offset'],_0x2b57e9=_0x38d16e['offset']+_0x38d16e['limit'],_0x89b633;if(_0x2b57e9>=_0x1b6d26){_0x2b57e9=_0x1b6d26;_0x89b633=0xc8;}else{_0x89b633=0xce;}_0x124940[_0x9f27('0x16')](_0x89b633);return _0x124940[_0x9f27('0x19')](_0x9f27('0x1a'),_0x3add53+'-'+_0x2b57e9+'/'+_0x1b6d26)[_0x9f27('0x17')](_0x4201c2);}return null;};}function patchUpdates(_0x35907d){return function(_0x3f5d07){try{jsonpatch['apply'](_0x3f5d07,_0x35907d,!![]);}catch(_0x3c30f9){return BPromise[_0x9f27('0x1b')](_0x3c30f9);}return _0x3f5d07['save']();};}function saveUpdates(_0x9ff458,_0x220dad){return function(_0xc70d8e){if(_0xc70d8e){return _0xc70d8e[_0x9f27('0x1c')](_0x9ff458)[_0x9f27('0x1d')](function(_0x18730c){return _0x18730c;});}return null;};}function removeEntity(_0x4885af,_0x4ca8af){return function(_0x3d89ee){if(_0x3d89ee){return _0x3d89ee[_0x9f27('0x1e')]()[_0x9f27('0x1d')](function(){var _0x28cacc=_0x3d89ee[_0x9f27('0x1f')]({'plain':!![]});var _0x1e195e=_0x9f27('0x20');return db[_0x9f27('0x21')][_0x9f27('0x1e')]({'where':{'type':_0x1e195e,'resourceId':_0x28cacc['id']}})[_0x9f27('0x1d')](function(){return _0x3d89ee;});})['then'](function(){_0x4885af[_0x9f27('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x49d2fd,_0x5a9758){return function(_0x1bdc37){if(!_0x1bdc37){_0x49d2fd[_0x9f27('0x14')](0x194);}return _0x1bdc37;};}function handleError(_0x31378c,_0x353476){_0x353476=_0x353476||0x1f4;return function(_0x37e248){logger['error'](_0x37e248[_0x9f27('0x22')]);if(_0x37e248[_0x9f27('0x23')]){delete _0x37e248[_0x9f27('0x23')];}_0x31378c['status'](_0x353476)['send'](_0x37e248);};}exports[_0x9f27('0x24')]=function(_0x1608e1,_0x5e4c63){var _0x1a1219={},_0x28623c={},_0x3fe1e3={'count':0x0,'rows':[]};var _0x54518b=_['map'](db[_0x9f27('0x25')]['rawAttributes'],function(_0x47d206){return{'name':_0x47d206['fieldName'],'type':_0x47d206[_0x9f27('0x26')][_0x9f27('0x27')]};});_0x28623c[_0x9f27('0x28')]=_[_0x9f27('0x29')](_0x54518b,_0x9f27('0x23'));_0x28623c[_0x9f27('0x2a')]=_[_0x9f27('0x2b')](_0x1608e1[_0x9f27('0x2a')]);_0x28623c[_0x9f27('0x2c')]=_[_0x9f27('0x2d')](_0x28623c[_0x9f27('0x28')],_0x28623c[_0x9f27('0x2a')]);_0x1a1219[_0x9f27('0x2e')]=_[_0x9f27('0x2d')](_0x28623c[_0x9f27('0x28')],qs[_0x9f27('0x2f')](_0x1608e1[_0x9f27('0x2a')][_0x9f27('0x2f')]));_0x1a1219[_0x9f27('0x2e')]=_0x1a1219[_0x9f27('0x2e')][_0x9f27('0x30')]?_0x1a1219[_0x9f27('0x2e')]:_0x28623c[_0x9f27('0x28')];if(!_0x1608e1['query']['hasOwnProperty'](_0x9f27('0x31'))){_0x1a1219[_0x9f27('0x32')]=qs[_0x9f27('0x32')](_0x1608e1[_0x9f27('0x2a')][_0x9f27('0x32')]);_0x1a1219['offset']=qs['offset'](_0x1608e1[_0x9f27('0x2a')][_0x9f27('0x33')]);}_0x1a1219[_0x9f27('0x34')]=qs['sort'](_0x1608e1[_0x9f27('0x2a')][_0x9f27('0x35')]);_0x1a1219['where']=qs['filters'](_['pick'](_0x1608e1[_0x9f27('0x2a')],_0x28623c[_0x9f27('0x2c')]));if(_0x1608e1[_0x9f27('0x2a')][_0x9f27('0x36')]){_0x1a1219['where']=_['merge'](_0x1a1219[_0x9f27('0x37')],{'$or':_[_0x9f27('0x29')](_0x54518b,function(_0x358586){if(_0x358586['type']['key']!==_0x9f27('0x38')){var _0x3d8c1f={};_0x3d8c1f[_0x358586['field']]={'$like':'%'+_0x1608e1[_0x9f27('0x2a')][_0x9f27('0x36')]+'%'};return _0x3d8c1f;}})});}_0x1a1219=_['merge']({},_0x1a1219,_0x1608e1['options']);var _0x46b3f1={'where':_0x1a1219[_0x9f27('0x37')]};return db[_0x9f27('0x25')][_0x9f27('0x18')](_0x46b3f1)['then'](function(_0x4862ec){_0x3fe1e3[_0x9f27('0x18')]=_0x4862ec;if(_0x1608e1[_0x9f27('0x2a')][_0x9f27('0x39')]){_0x1a1219[_0x9f27('0x3a')]=[{'all':!![]}];}return db[_0x9f27('0x25')][_0x9f27('0x3b')](_0x1a1219);})[_0x9f27('0x1d')](function(_0x4e394){_0x3fe1e3[_0x9f27('0x3c')]=_0x4e394;return _0x3fe1e3;})[_0x9f27('0x1d')](respondWithFilteredResult(_0x5e4c63,_0x1a1219))[_0x9f27('0x3d')](handleError(_0x5e4c63,null));};exports[_0x9f27('0x3e')]=function(_0x12c967,_0x43387b){var _0x55a860={'raw':![],'where':{'id':_0x12c967[_0x9f27('0x3f')]['id']}},_0x182b27={};_0x182b27[_0x9f27('0x28')]=_[_0x9f27('0x2b')](db[_0x9f27('0x25')][_0x9f27('0x40')]);_0x182b27[_0x9f27('0x2a')]=_[_0x9f27('0x2b')](_0x12c967[_0x9f27('0x2a')]);_0x182b27[_0x9f27('0x2c')]=_[_0x9f27('0x2d')](_0x182b27[_0x9f27('0x28')],_0x182b27['query']);_0x55a860[_0x9f27('0x2e')]=_[_0x9f27('0x2d')](_0x182b27[_0x9f27('0x28')],qs[_0x9f27('0x2f')](_0x12c967[_0x9f27('0x2a')]['fields']));_0x55a860[_0x9f27('0x2e')]=_0x55a860[_0x9f27('0x2e')][_0x9f27('0x30')]?_0x55a860[_0x9f27('0x2e')]:_0x182b27['model'];if(_0x12c967['query']['includeAll']){_0x55a860[_0x9f27('0x3a')]=[{'all':!![]}];}_0x55a860=_[_0x9f27('0x41')]({},_0x55a860,_0x12c967[_0x9f27('0x42')]);return db[_0x9f27('0x25')][_0x9f27('0x43')](_0x55a860)[_0x9f27('0x1d')](handleEntityNotFound(_0x43387b,null))[_0x9f27('0x1d')](respondWithResult(_0x43387b,null))[_0x9f27('0x3d')](handleError(_0x43387b,null));};exports[_0x9f27('0x44')]=function(_0xb59834,_0x59cdf0){return db[_0x9f27('0x25')][_0x9f27('0x44')](_0xb59834[_0x9f27('0x45')],{})[_0x9f27('0x1d')](function(_0x4182cf){var _0x32bc5c=_0xb59834['user']['get']({'plain':!![]});if(!_0x32bc5c)throw new Error(_0x9f27('0x46'));if(_0x32bc5c[_0x9f27('0x47')]===_0x9f27('0x48')){var _0x534933=_0x4182cf[_0x9f27('0x1f')]({'plain':!![]});var _0x21f7ec=_0x9f27('0x20');return db['UserProfileSection'][_0x9f27('0x43')]({'where':{'name':_0x21f7ec,'userProfileId':_0x32bc5c[_0x9f27('0x49')]},'raw':!![]})[_0x9f27('0x1d')](function(_0x39841d){if(_0x39841d&&_0x39841d['autoAssociation']===0x0){return db[_0x9f27('0x21')][_0x9f27('0x44')]({'name':_0x534933['name'],'resourceId':_0x534933['id'],'type':_0x39841d[_0x9f27('0x23')],'sectionId':_0x39841d['id']},{})[_0x9f27('0x1d')](function(){return _0x4182cf;});}else{return _0x4182cf;}})[_0x9f27('0x3d')](function(_0x48ba33){logger[_0x9f27('0x4a')](_0x9f27('0x4b'),_0x48ba33);throw _0x48ba33;});}return _0x4182cf;})[_0x9f27('0x1d')](respondWithResult(_0x59cdf0,0xc9))[_0x9f27('0x3d')](handleError(_0x59cdf0,null));};exports['update']=function(_0x59c616,_0x477035){if(_0x59c616[_0x9f27('0x45')]['id']){delete _0x59c616[_0x9f27('0x45')]['id'];}return db['CmList'][_0x9f27('0x43')]({'where':{'id':_0x59c616[_0x9f27('0x3f')]['id']}})[_0x9f27('0x1d')](handleEntityNotFound(_0x477035,null))['then'](saveUpdates(_0x59c616[_0x9f27('0x45')],null))[_0x9f27('0x1d')](respondWithResult(_0x477035,null))[_0x9f27('0x3d')](handleError(_0x477035,null));};exports[_0x9f27('0x1e')]=function(_0x5e6472,_0x583e89){return db[_0x9f27('0x25')][_0x9f27('0x43')]({'where':{'id':_0x5e6472[_0x9f27('0x3f')]['id']}})[_0x9f27('0x1d')](handleEntityNotFound(_0x583e89,null))[_0x9f27('0x1d')](removeEntity(_0x583e89,null))[_0x9f27('0x3d')](handleError(_0x583e89,null));};exports[_0x9f27('0x4c')]=function(_0x291645,_0x25b39e){return db[_0x9f27('0x25')][_0x9f27('0x4c')]()[_0x9f27('0x1d')](respondWithResult(_0x25b39e,null))[_0x9f27('0x3d')](handleError(_0x25b39e,null));};exports[_0x9f27('0x4d')]=function(_0x3ff816,_0x155858,_0x239421){if(_0x3ff816[_0x9f27('0x45')]['id']){delete _0x3ff816[_0x9f27('0x45')]['id'];}return db[_0x9f27('0x25')]['find']({'where':{'id':_0x3ff816[_0x9f27('0x3f')]['id']}})['then'](handleEntityNotFound(_0x155858,null))[_0x9f27('0x1d')](function(_0x31a615){if(_0x31a615){_0x3ff816[_0x9f27('0x45')][_0x9f27('0x4e')]=_0x31a615['id'];return db[_0x9f27('0x4f')][_0x9f27('0x44')](_0x3ff816['body']);}})['then'](respondWithResult(_0x155858,null))[_0x9f27('0x3d')](handleError(_0x155858,null));};exports['getDispositions']=function(_0x2daaa0,_0x274a5c,_0x2d3bdc){var _0x21a879={'raw':![],'where':{}};var _0x406ee3={};var _0x587cba={'count':0x0,'rows':[]};return db[_0x9f27('0x25')][_0x9f27('0x50')]({'where':{'id':_0x2daaa0['params']['id']}})[_0x9f27('0x1d')](handleEntityNotFound(_0x274a5c,null))[_0x9f27('0x1d')](function(_0x3faab0){if(_0x3faab0){_0x406ee3[_0x9f27('0x28')]=_['keys'](db[_0x9f27('0x4f')][_0x9f27('0x40')]);_0x406ee3[_0x9f27('0x2a')]=_[_0x9f27('0x2b')](_0x2daaa0['query']);_0x406ee3[_0x9f27('0x2c')]=_['intersection'](_0x406ee3[_0x9f27('0x28')],_0x406ee3[_0x9f27('0x2a')]);_0x21a879[_0x9f27('0x2e')]=_[_0x9f27('0x2d')](_0x406ee3[_0x9f27('0x28')],qs[_0x9f27('0x2f')](_0x2daaa0[_0x9f27('0x2a')][_0x9f27('0x2f')]));_0x21a879[_0x9f27('0x2e')]=_0x21a879[_0x9f27('0x2e')]['length']?_0x21a879[_0x9f27('0x2e')]:_0x406ee3[_0x9f27('0x28')];if(!_0x2daaa0[_0x9f27('0x2a')]['hasOwnProperty'](_0x9f27('0x31'))){_0x21a879[_0x9f27('0x32')]=qs[_0x9f27('0x32')](_0x2daaa0[_0x9f27('0x2a')]['limit']);_0x21a879[_0x9f27('0x33')]=qs[_0x9f27('0x33')](_0x2daaa0[_0x9f27('0x2a')][_0x9f27('0x33')]);}_0x21a879[_0x9f27('0x34')]=qs[_0x9f27('0x35')](_0x2daaa0[_0x9f27('0x2a')][_0x9f27('0x35')]);_0x21a879[_0x9f27('0x37')]=qs[_0x9f27('0x2c')](_[_0x9f27('0x51')](_0x2daaa0[_0x9f27('0x2a')],_0x406ee3['filters']));_0x21a879[_0x9f27('0x37')][_0x9f27('0x4e')]=_0x3faab0['id'];if(_0x2daaa0['query'][_0x9f27('0x36')]){_0x21a879[_0x9f27('0x37')]=_[_0x9f27('0x41')](_0x21a879[_0x9f27('0x37')],{'$or':_[_0x9f27('0x29')](_0x21a879[_0x9f27('0x2e')],function(_0x41249a){var _0x1406ff={};_0x1406ff[_0x41249a]={'$like':'%'+_0x2daaa0[_0x9f27('0x2a')]['filter']+'%'};return _0x1406ff;})});}_0x21a879=_[_0x9f27('0x41')]({},_0x21a879,_0x2daaa0['options']);return db['Disposition']['count']({'where':_0x21a879[_0x9f27('0x37')]})[_0x9f27('0x1d')](function(_0x5c6b3f){_0x587cba[_0x9f27('0x18')]=_0x5c6b3f;if(_0x2daaa0['query'][_0x9f27('0x39')]){_0x21a879[_0x9f27('0x3a')]=[{'all':!![]}];}return db[_0x9f27('0x4f')][_0x9f27('0x3b')](_0x21a879);})[_0x9f27('0x1d')](function(_0xaa39c1){_0x587cba[_0x9f27('0x3c')]=_0xaa39c1;return _0x587cba;});}})['then'](respondWithFilteredResult(_0x274a5c,_0x21a879))[_0x9f27('0x3d')](handleError(_0x274a5c,null));};exports[_0x9f27('0x52')]=function(_0x3ad219,_0x42f93c,_0x266792){return db['CmList'][_0x9f27('0x43')]({'where':{'id':_0x3ad219['params']['id']}})[_0x9f27('0x1d')](handleEntityNotFound(_0x42f93c,null))[_0x9f27('0x1d')](function(_0x1f1168){if(_0x1f1168){return _0x1f1168[_0x9f27('0x52')](_0x3ad219[_0x9f27('0x2a')][_0x9f27('0x53')]);}})['then'](respondWithStatusCode(_0x42f93c,null))[_0x9f27('0x3d')](handleError(_0x42f93c,null));};exports['addContacts']=function(_0x395f60,_0xfb474a,_0x142401){return db[_0x9f27('0x25')][_0x9f27('0x43')]({'where':{'id':_0x395f60[_0x9f27('0x3f')]['id']}})['then'](handleEntityNotFound(_0xfb474a,null))[_0x9f27('0x1d')](function(_0x102d21){if(_0x102d21){var _0xbe9878=[];var _0x34f951={'success':[],'errors':[]};return db['CmContact'][_0x9f27('0x4c')]()[_0x9f27('0x1d')](function(_0xee3caf){if(_0x395f60[_0x9f27('0x45')][_0x9f27('0x54')]&&_[_0x9f27('0x55')](_0x395f60[_0x9f27('0x45')][_0x9f27('0x54')])){if(_0x395f60['body'][_0x9f27('0x54')]['length']){_0x395f60[_0x9f27('0x45')][_0x9f27('0x54')]=_0x395f60[_0x9f27('0x45')][_0x9f27('0x54')]['join'](';')+';';}else{_0x395f60['body']['tags']=null;}}else{_0x395f60['body'][_0x9f27('0x54')]=null;}if(_0x395f60[_0x9f27('0x45')]&&_[_0x9f27('0x55')](_0x395f60[_0x9f27('0x45')])){for(var _0x1b60d1=0x0;_0x1b60d1<_0x395f60[_0x9f27('0x45')]['length'];_0x1b60d1+=0x1){_0x395f60[_0x9f27('0x45')][_0x1b60d1]['ListId']=_0x395f60[_0x9f27('0x3f')]['id'];_0xbe9878['push'](_0x395f60[_0x9f27('0x45')][_0x1b60d1]);}return BPromise[_0x9f27('0x56')](_0xbe9878,function(_0xdba303){return db[_0x9f27('0x57')]['create'](_['omit'](_0xdba303,[_0x9f27('0x53'),'id'])||{},{'fields':_[_0x9f27('0x2b')](_0xee3caf),'raw':!![]})['then'](function(_0x88f88b){_0x34f951[_0x9f27('0x58')][_0x9f27('0x59')](_0x88f88b['dataValues']);})['catch'](function(_0x190ffc){_0x34f951[_0x9f27('0x5a')][_0x9f27('0x59')]({'data':_0xdba303,'error':_0x190ffc[_0x9f27('0x5b')]});});})[_0x9f27('0x1d')](function(_0x28bf68){return _0x34f951;})[_0x9f27('0x3d')](function(_0x4179cb){return _0x4179cb;});}else{_0xfb474a['status'](0x190)[_0x9f27('0x17')]({'message':_0x9f27('0x5c')});}});}})[_0x9f27('0x1d')](respondWithResult(_0xfb474a,null))[_0x9f27('0x3d')](handleError(_0xfb474a,null));};exports[_0x9f27('0x5d')]=function(_0x1a5bbe,_0x2aecc3,_0xf0be5e){var _0x4ffa07;return db['CmList'][_0x9f27('0x43')]({'where':{'id':_0x1a5bbe['params']['id']},'include':[{'model':db[_0x9f27('0x5e')],'as':_0x9f27('0x5f')}]})[_0x9f27('0x1d')](handleEntityNotFound(_0x2aecc3,null))[_0x9f27('0x1d')](function(_0x41b0ab){if(_0x41b0ab){_0x4ffa07=_0x41b0ab;return db['CmContact'][_0x9f27('0x40')];}})[_0x9f27('0x1d')](function(_0x16ee2b){if(_0x16ee2b){var _0x512615={};var _0x59c608={};_0x59c608[_0x9f27('0x28')]=_['concat'](_[_0x9f27('0x2b')](_0x16ee2b),_['map'](_0x4ffa07[_0x9f27('0x5f')],function(_0x41dea0){return util[_0x9f27('0x60')](_0x9f27('0x61'),_0x41dea0['id']);}));_0x59c608[_0x9f27('0x2a')]=_[_0x9f27('0x2b')](_0x1a5bbe[_0x9f27('0x2a')]);_0x59c608[_0x9f27('0x2c')]=_[_0x9f27('0x2d')](_0x59c608[_0x9f27('0x28')],_0x59c608[_0x9f27('0x2a')]);_0x512615[_0x9f27('0x2e')]=_[_0x9f27('0x2d')](_0x59c608[_0x9f27('0x28')],qs['fields'](_0x1a5bbe['query'][_0x9f27('0x2f')]));_0x512615[_0x9f27('0x2e')]=_0x512615['attributes'][_0x9f27('0x30')]?_0x512615[_0x9f27('0x2e')]:_0x59c608[_0x9f27('0x28')];if(!_0x1a5bbe[_0x9f27('0x2a')][_0x9f27('0x62')](_0x9f27('0x31'))){_0x512615['limit']=qs[_0x9f27('0x32')](_0x1a5bbe['query'][_0x9f27('0x32')]);_0x512615[_0x9f27('0x33')]=qs['offset'](_0x1a5bbe[_0x9f27('0x2a')]['offset']);}_0x512615[_0x9f27('0x34')]=qs[_0x9f27('0x35')](_0x1a5bbe[_0x9f27('0x2a')][_0x9f27('0x35')]);_0x512615[_0x9f27('0x37')]=qs[_0x9f27('0x2c')](_[_0x9f27('0x51')](_0x1a5bbe[_0x9f27('0x2a')],_0x59c608[_0x9f27('0x2c')]));_0x512615[_0x9f27('0x63')]=!![];if(_0x1a5bbe[_0x9f27('0x2a')]['filter']){_0x512615[_0x9f27('0x37')]=_[_0x9f27('0x41')](_0x512615[_0x9f27('0x37')],{'$or':_['map'](_0x512615[_0x9f27('0x2e')],function(_0x53b155){var _0xbe764b={};_0xbe764b[_0x53b155]={'$like':'%'+_0x1a5bbe[_0x9f27('0x2a')]['filter']+'%'};return _0xbe764b;})});}_0x512615=_[_0x9f27('0x41')]({},_0x512615,_0x1a5bbe['options']);return _0x4ffa07[_0x9f27('0x5d')](_0x512615);}})[_0x9f27('0x1d')](respondWithResult(_0x2aecc3,null))[_0x9f27('0x3d')](handleError(_0x2aecc3,null));};exports[_0x9f27('0x64')]=function(_0x395620,_0x72d63c,_0x2c9b04){var _0x29881b;return db['CmList'][_0x9f27('0x43')]({'where':{'id':_0x395620[_0x9f27('0x3f')]['id']},'include':[{'model':db[_0x9f27('0x5e')],'as':_0x9f27('0x5f')}]})[_0x9f27('0x1d')](handleEntityNotFound(_0x72d63c,null))[_0x9f27('0x1d')](function(_0x504a8b){if(_0x504a8b){_0x29881b=_0x504a8b;return db[_0x9f27('0x57')][_0x9f27('0x40')];}})[_0x9f27('0x1d')](function(_0xb30081){if(_0xb30081){var _0x27d17e={};var _0x59e44a={};_0x59e44a['model']=_[_0x9f27('0x65')](_[_0x9f27('0x2b')](_0xb30081),_['map'](_0x29881b['CustomFields'],function(_0x381164){return util['format'](_0x9f27('0x61'),_0x381164['id']);}));_0x59e44a[_0x9f27('0x2a')]=_['keys'](_0x395620[_0x9f27('0x2a')]);_0x59e44a[_0x9f27('0x2c')]=_[_0x9f27('0x2d')](_0x59e44a[_0x9f27('0x28')],_0x59e44a[_0x9f27('0x2a')]);_0x27d17e[_0x9f27('0x2e')]=_[_0x9f27('0x2d')](_0x59e44a[_0x9f27('0x28')],qs[_0x9f27('0x2f')](_0x395620[_0x9f27('0x2a')][_0x9f27('0x2f')]));_0x27d17e[_0x9f27('0x2e')]=_0x27d17e[_0x9f27('0x2e')][_0x9f27('0x30')]?_0x27d17e[_0x9f27('0x2e')]:_0x59e44a[_0x9f27('0x28')];if(!_0x395620[_0x9f27('0x2a')][_0x9f27('0x62')](_0x9f27('0x31'))){_0x27d17e[_0x9f27('0x32')]=qs['limit'](_0x395620[_0x9f27('0x2a')][_0x9f27('0x32')]);_0x27d17e['offset']=qs[_0x9f27('0x33')](_0x395620[_0x9f27('0x2a')][_0x9f27('0x33')]);}_0x27d17e[_0x9f27('0x34')]=qs['sort'](_0x395620['query'][_0x9f27('0x35')]);_0x27d17e['where']=qs['filters'](_['pick'](_0x395620[_0x9f27('0x2a')],_0x59e44a[_0x9f27('0x2c')]));_0x27d17e[_0x9f27('0x63')]=!![];if(_0x395620[_0x9f27('0x2a')][_0x9f27('0x36')]){_0x27d17e[_0x9f27('0x37')]=_[_0x9f27('0x41')](_0x27d17e['where'],{'$or':_[_0x9f27('0x29')](_0x27d17e[_0x9f27('0x2e')],function(_0x109256){var _0x3afd09={};_0x3afd09[_0x109256]={'$like':'%'+_0x395620[_0x9f27('0x2a')][_0x9f27('0x36')]+'%'};return _0x3afd09;})});}_0x27d17e=_[_0x9f27('0x41')]({},_0x27d17e,_0x395620['options']);return _0x29881b[_0x9f27('0x5d')](_0x27d17e);}})[_0x9f27('0x1d')](function(_0x4ad97b){if(!_['isEmpty'](_0x4ad97b)){var _0x277fdc=toCsv(_0x4ad97b);var _0x51cd34=Date[_0x9f27('0x66')]();fs['writeFileSync'](util[_0x9f27('0x60')](_0x9f27('0x67'),_0x29881b['id'],_0x51cd34),_0x277fdc);_0x72d63c[_0x9f27('0x68')]('Content-disposition','attachment;\x20filename='+util[_0x9f27('0x60')](_0x9f27('0x69'),_0x29881b['id'],_0x51cd34));_0x72d63c[_0x9f27('0x68')](_0x9f27('0x6a'),_0x9f27('0x6b'));return _0x72d63c[_0x9f27('0x6c')](util[_0x9f27('0x60')](_0x9f27('0x67'),_0x29881b['id'],_0x51cd34));}else{return _0x72d63c[_0x9f27('0x14')](0xcc);}})[_0x9f27('0x3d')](handleError(_0x72d63c,null));};exports[_0x9f27('0x6d')]=function(_0x335458,_0x5eff94,_0x5a6445){var _0x225be1;delete _0x335458[_0x9f27('0x45')]['id'];return db['CmList'][_0x9f27('0x50')]({'where':{'id':_0x335458[_0x9f27('0x3f')]['id']}})[_0x9f27('0x1d')](handleEntityNotFound(_0x5eff94,null))[_0x9f27('0x1d')](function(_0x329960){if(_0x329960){return db['sequelize'][_0x9f27('0x6e')](function(_0x50e790){return db['CmCustomField'][_0x9f27('0x44')](_0x335458[_0x9f27('0x45')],{'transaction':_0x50e790})['then'](function(_0x32b220){_0x225be1=_0x32b220;return _0x329960[_0x9f27('0x6f')](_0x32b220,{'transaction':_0x50e790});})[_0x9f27('0x1d')](function(){var _0x2145ab={'type':db[_0x9f27('0x70')][_0x9f27('0x71')],'transaction':_0x50e790};switch(_0x335458[_0x9f27('0x45')][_0x9f27('0x26')]){case _0x9f27('0x72'):_0x2145ab[_0x9f27('0x26')]=db[_0x9f27('0x70')][_0x9f27('0x71')];break;case _0x9f27('0x73'):_0x2145ab['type']=db[_0x9f27('0x70')][_0x9f27('0x74')];break;case _0x9f27('0x75'):_0x2145ab[_0x9f27('0x26')]=db[_0x9f27('0x70')]['BOOLEAN'];_0x2145ab[_0x9f27('0x76')]=![];break;default:}return db['sequelize'][_0x9f27('0x77')][_0x9f27('0x78')](_0x9f27('0x79'),util['format']('cf_%s',_0x225be1['id']),_0x2145ab);})[_0x9f27('0x1d')](function(){return _0x225be1;});});}})['then'](respondWithResult(_0x5eff94,null))['catch'](handleError(_0x5eff94,null));};exports[_0x9f27('0x7a')]=function(_0x3bd98e,_0x405300,_0x8c039c){var _0x2e1b17={};var _0x4a7375={};var _0x32da27;var _0xaf4e3e;return db[_0x9f27('0x25')][_0x9f27('0x50')]({'where':{'id':_0x3bd98e[_0x9f27('0x3f')]['id']}})[_0x9f27('0x1d')](handleEntityNotFound(_0x405300,null))[_0x9f27('0x1d')](function(_0x6dd608){if(_0x6dd608){_0x32da27=_0x6dd608;_0x4a7375[_0x9f27('0x28')]=_[_0x9f27('0x2b')](db[_0x9f27('0x5e')][_0x9f27('0x40')]);_0x4a7375[_0x9f27('0x2a')]=_[_0x9f27('0x2b')](_0x3bd98e['query']);_0x4a7375[_0x9f27('0x2c')]=_[_0x9f27('0x2d')](_0x4a7375['model'],_0x4a7375[_0x9f27('0x2a')]);_0x2e1b17[_0x9f27('0x2e')]=_[_0x9f27('0x2d')](_0x4a7375[_0x9f27('0x28')],qs['fields'](_0x3bd98e['query']['fields']));_0x2e1b17[_0x9f27('0x2e')]=_0x2e1b17['attributes'][_0x9f27('0x30')]?_0x2e1b17['attributes']:_0x4a7375[_0x9f27('0x28')];_0x2e1b17[_0x9f27('0x34')]=qs[_0x9f27('0x35')](_0x3bd98e[_0x9f27('0x2a')]['sort']);_0x2e1b17[_0x9f27('0x37')]=qs[_0x9f27('0x2c')](_[_0x9f27('0x51')](_0x3bd98e[_0x9f27('0x2a')],_0x4a7375['filters']));_0x2e1b17['where']=_[_0x9f27('0x41')](_0x2e1b17[_0x9f27('0x37')],{'$or':[{'ListId':_0x6dd608['id']},{'ListId':null}]});if(_0x3bd98e[_0x9f27('0x2a')][_0x9f27('0x36')]){_0x2e1b17[_0x9f27('0x37')]=_[_0x9f27('0x41')](_0x2e1b17['where'],{'$or':_[_0x9f27('0x29')](_0x2e1b17[_0x9f27('0x2e')],function(_0x46775a){var _0x5ee726={};_0x5ee726[_0x46775a]={'$like':'%'+_0x3bd98e[_0x9f27('0x2a')]['filter']+'%'};return _0x5ee726;})});}_0x2e1b17=_[_0x9f27('0x41')]({},_0x2e1b17,_0x3bd98e['options']);return db[_0x9f27('0x5e')][_0x9f27('0x7b')](_0x2e1b17);}})[_0x9f27('0x1d')](respondWithResult(_0x405300,null))[_0x9f27('0x3d')](handleError(_0x405300,null));};exports[_0x9f27('0x7c')]=function(_0x40ec1d,_0x326021,_0xe8bc38){return db[_0x9f27('0x25')]['find']({'where':{'id':_0x40ec1d[_0x9f27('0x3f')]['id']}})[_0x9f27('0x1d')](handleEntityNotFound(_0x326021,null))['then'](function(_0x57edf3){if(_0x57edf3){return _0x57edf3[_0x9f27('0x7c')](_0x40ec1d[_0x9f27('0x45')]['ids'],_[_0x9f27('0x7d')](_0x40ec1d[_0x9f27('0x45')],[_0x9f27('0x53'),'id'])||{})['spread'](function(_0x2411b9){for(var _0x32743d=0x0;_0x32743d<_0x40ec1d[_0x9f27('0x45')]['ids'][_0x9f27('0x30')];_0x32743d+=0x1){socket['emit'](_0x9f27('0x7e'),{'UserId':_0x40ec1d['body'][_0x9f27('0x53')][_0x32743d],'CmListId':_0x40ec1d[_0x9f27('0x3f')]['id']});}return _0x2411b9;});}})['then'](respondWithResult(_0x326021,null))[_0x9f27('0x3d')](handleError(_0x326021,null));};exports[_0x9f27('0x7f')]=function(_0x41e9da,_0x32d25d,_0x17b65a){return db[_0x9f27('0x25')][_0x9f27('0x43')]({'where':{'id':_0x41e9da[_0x9f27('0x3f')]['id']}})[_0x9f27('0x1d')](handleEntityNotFound(_0x32d25d,null))[_0x9f27('0x1d')](function(_0x2d52d9){if(_0x2d52d9){return _0x2d52d9[_0x9f27('0x7f')](_0x41e9da['query'][_0x9f27('0x53')])['then'](function(){if(_[_0x9f27('0x55')](_0x41e9da[_0x9f27('0x2a')][_0x9f27('0x53')])){for(var _0xa129ba=0x0;_0xa129ba<_0x41e9da['query'][_0x9f27('0x53')][_0x9f27('0x30')];_0xa129ba+=0x1){socket[_0x9f27('0x80')](_0x9f27('0x81'),{'UserId':Number(_0x41e9da[_0x9f27('0x2a')][_0x9f27('0x53')][_0xa129ba]),'CmListId':Number(_0x41e9da[_0x9f27('0x3f')]['id'])});}}else{socket[_0x9f27('0x80')]('userCmList:remove',{'UserId':Number(_0x41e9da[_0x9f27('0x2a')][_0x9f27('0x53')]),'CmListId':Number(_0x41e9da[_0x9f27('0x3f')]['id'])});}});}})[_0x9f27('0x1d')](respondWithStatusCode(_0x32d25d,null))[_0x9f27('0x3d')](handleError(_0x32d25d,null));};exports[_0x9f27('0x82')]=function(_0x37c6ee,_0x4918b7,_0x44f3f0){var _0x1bb175={};var _0x13957d={};var _0x3aa849;var _0x52090e;return db['CmList'][_0x9f27('0x50')]({'where':{'id':_0x37c6ee[_0x9f27('0x3f')]['id']}})['then'](handleEntityNotFound(_0x4918b7,null))['then'](function(_0x1d29c7){if(_0x1d29c7){_0x3aa849=_0x1d29c7;_0x13957d[_0x9f27('0x28')]=_[_0x9f27('0x2b')](db[_0x9f27('0x83')][_0x9f27('0x40')]);_0x13957d[_0x9f27('0x2a')]=_['keys'](_0x37c6ee['query']);_0x13957d[_0x9f27('0x2c')]=_['intersection'](_0x13957d[_0x9f27('0x28')],_0x13957d[_0x9f27('0x2a')]);_0x1bb175[_0x9f27('0x2e')]=_['intersection'](_0x13957d[_0x9f27('0x28')],qs['fields'](_0x37c6ee[_0x9f27('0x2a')][_0x9f27('0x2f')]));_0x1bb175[_0x9f27('0x2e')]=_0x1bb175[_0x9f27('0x2e')]['length']?_0x1bb175['attributes']:_0x13957d[_0x9f27('0x28')];_0x1bb175[_0x9f27('0x34')]=qs[_0x9f27('0x35')](_0x37c6ee[_0x9f27('0x2a')][_0x9f27('0x35')]);_0x1bb175[_0x9f27('0x37')]=qs[_0x9f27('0x2c')](_[_0x9f27('0x51')](_0x37c6ee[_0x9f27('0x2a')],_0x13957d['filters']));if(_0x37c6ee[_0x9f27('0x2a')][_0x9f27('0x36')]){_0x1bb175[_0x9f27('0x37')]=_[_0x9f27('0x41')](_0x1bb175['where'],{'$or':_[_0x9f27('0x29')](_0x1bb175['attributes'],function(_0x5eb35e){var _0x15f5e0={};_0x15f5e0[_0x5eb35e]={'$like':'%'+_0x37c6ee['query'][_0x9f27('0x36')]+'%'};return _0x15f5e0;})});}_0x1bb175=_['merge']({},_0x1bb175,_0x37c6ee['options']);return _0x3aa849[_0x9f27('0x82')](_0x1bb175);}})[_0x9f27('0x1d')](function(_0x1f6a62){if(_0x1f6a62){_0x52090e=_0x1f6a62['length'];if(!_0x37c6ee['query'][_0x9f27('0x62')](_0x9f27('0x31'))){_0x1bb175[_0x9f27('0x32')]=qs[_0x9f27('0x32')](_0x37c6ee[_0x9f27('0x2a')]['limit']);_0x1bb175[_0x9f27('0x33')]=qs[_0x9f27('0x33')](_0x37c6ee['query'][_0x9f27('0x33')]);}return _0x3aa849[_0x9f27('0x82')](_0x1bb175);}})[_0x9f27('0x1d')](function(_0x5f3cbe){if(_0x5f3cbe){return _0x5f3cbe?{'count':_0x52090e,'rows':_0x5f3cbe}:null;}})['then'](respondWithResult(_0x4918b7,null))[_0x9f27('0x3d')](handleError(_0x4918b7,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index f07029d..b8c8aab 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 _0x7949=['hook','exports','../../mysqldb','save','update','emit','hasOwnProperty'];(function(_0x36bb68,_0xffd608){var _0x4820d8=function(_0x139304){while(--_0x139304){_0x36bb68['push'](_0x36bb68['shift']());}};_0x4820d8(++_0xffd608);}(_0x7949,0x12f));var _0x9794=function(_0x21bf59,_0xa3a3a4){_0x21bf59=_0x21bf59-0x0;var _0x571e99=_0x7949[_0x21bf59];return _0x571e99;};'use strict';var EventEmitter=require('events');var CmList=require(_0x9794('0x0'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9794('0x1'),'afterUpdate':_0x9794('0x2'),'afterDestroy':'remove'};function emitEvent(_0x378250){return function(_0xfbf0c9,_0x5b7b6c,_0x149b1b){CmListEvents[_0x9794('0x3')](_0x378250+':'+_0xfbf0c9['id'],_0xfbf0c9);CmListEvents[_0x9794('0x3')](_0x378250,_0xfbf0c9);_0x149b1b(null);};}for(var e in events){if(events[_0x9794('0x4')](e)){var event=events[e];CmList[_0x9794('0x5')](e,emitEvent(event));}}module[_0x9794('0x6')]=CmListEvents; \ No newline at end of file +var _0xbc7d=['remove','hasOwnProperty','hook','exports','../../mysqldb','CmList','save'];(function(_0x11ce46,_0x7a1715){var _0x272001=function(_0x38c599){while(--_0x38c599){_0x11ce46['push'](_0x11ce46['shift']());}};_0x272001(++_0x7a1715);}(_0xbc7d,0xdd));var _0xdbc7=function(_0x11309c,_0xe18a74){_0x11309c=_0x11309c-0x0;var _0x3fea9c=_0xbc7d[_0x11309c];return _0x3fea9c;};'use strict';var EventEmitter=require('events');var CmList=require(_0xdbc7('0x0'))['db'][_0xdbc7('0x1')];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xdbc7('0x2'),'afterUpdate':'update','afterDestroy':_0xdbc7('0x3')};function emitEvent(_0x57f627){return function(_0x4718fd,_0x1ad0d7,_0xf41ee5){CmListEvents['emit'](_0x57f627+':'+_0x4718fd['id'],_0x4718fd);CmListEvents['emit'](_0x57f627,_0x4718fd);_0xf41ee5(null);};}for(var e in events){if(events[_0xdbc7('0x4')](e)){var event=events[e];CmList[_0xdbc7('0x5')](e,emitEvent(event));}}module[_0xdbc7('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 8848324..9678c7f 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 _0xd908=['../../config/environment','./cmList.attributes','exports','define','cm_lists','lodash','api','path','rimraf'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0xd908,0x16d));var _0x8d90=function(_0x18f3ec,_0x59d33e){_0x18f3ec=_0x18f3ec-0x0;var _0x5addaa=_0xd908[_0x18f3ec];return _0x5addaa;};'use strict';var _=require(_0x8d90('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8d90('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8d90('0x2'));var rimraf=require(_0x8d90('0x3'));var config=require(_0x8d90('0x4'));var attributes=require(_0x8d90('0x5'));module[_0x8d90('0x6')]=function(_0x24927b,_0x5d3748){return _0x24927b[_0x8d90('0x7')]('CmList',attributes,{'tableName':_0x8d90('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x80c6=['define','cm_lists','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmList.attributes','exports'];(function(_0x1e8860,_0x4c20a4){var _0x11f702=function(_0x49725d){while(--_0x49725d){_0x1e8860['push'](_0x1e8860['shift']());}};_0x11f702(++_0x4c20a4);}(_0x80c6,0x1de));var _0x680c=function(_0x2ebbdf,_0x5021ea){_0x2ebbdf=_0x2ebbdf-0x0;var _0x100e73=_0x80c6[_0x2ebbdf];return _0x100e73;};'use strict';var _=require(_0x680c('0x0'));var util=require(_0x680c('0x1'));var logger=require(_0x680c('0x2'))(_0x680c('0x3'));var moment=require(_0x680c('0x4'));var BPromise=require(_0x680c('0x5'));var rp=require(_0x680c('0x6'));var fs=require('fs');var path=require(_0x680c('0x7'));var rimraf=require(_0x680c('0x8'));var config=require(_0x680c('0x9'));var attributes=require(_0x680c('0xa'));module[_0x680c('0xb')]=function(_0x4527db,_0x126507){return _0x4527db[_0x680c('0xc')]('CmList',attributes,{'tableName':_0x680c('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 7202e04..05f9cf3 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 _0xe909=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','request','then','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','error','code','message','info','moment'];(function(_0x3286d4,_0x141105){var _0x53cb5e=function(_0x5515b4){while(--_0x5515b4){_0x3286d4['push'](_0x3286d4['shift']());}};_0x53cb5e(++_0x141105);}(_0xe909,0x1b9));var _0x9e90=function(_0x4c4e45,_0x4ba716){_0x4c4e45=_0x4c4e45-0x0;var _0x3e520e=_0xe909[_0x4c4e45];return _0x3e520e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9e90('0x0'));var BPromise=require(_0x9e90('0x1'));var rs=require(_0x9e90('0x2'));var fs=require('fs');var Redis=require(_0x9e90('0x3'));var db=require(_0x9e90('0x4'))['db'];var utils=require(_0x9e90('0x5'));var logger=require('../../config/logger')(_0x9e90('0x6'));var config=require(_0x9e90('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9e90('0x8')][_0x9e90('0x9')]({'port':0x232a});config[_0x9e90('0xa')]=_[_0x9e90('0xb')](config[_0x9e90('0xa')],{'host':_0x9e90('0xc'),'port':0x18eb});var socket=require(_0x9e90('0xd'))(new Redis(config[_0x9e90('0xa')]));require(_0x9e90('0xe'))[_0x9e90('0xf')](socket);function respondWithRpcPromise(_0x1e8f8b,_0x2c1e7f,_0x5842db){return new BPromise(function(_0x135eff,_0x4566e9){return client[_0x9e90('0x10')](_0x1e8f8b,_0x5842db)[_0x9e90('0x11')](function(_0x44310e){logger['info'](_0x9e90('0x12'),_0x2c1e7f,_0x9e90('0x13'));logger[_0x9e90('0x14')](_0x9e90('0x15'),_0x2c1e7f,_0x9e90('0x13'),JSON['stringify'](_0x44310e));if(_0x44310e[_0x9e90('0x16')]){if(_0x44310e['error'][_0x9e90('0x17')]===0x1f4){logger[_0x9e90('0x16')](_0x9e90('0x12'),_0x2c1e7f,_0x44310e[_0x9e90('0x16')][_0x9e90('0x18')]);return _0x4566e9(_0x44310e[_0x9e90('0x16')][_0x9e90('0x18')]);}logger[_0x9e90('0x16')](_0x9e90('0x12'),_0x2c1e7f,_0x44310e[_0x9e90('0x16')][_0x9e90('0x18')]);return _0x135eff(_0x44310e['error'][_0x9e90('0x18')]);}else{logger[_0x9e90('0x19')](_0x9e90('0x12'),_0x2c1e7f,'request\x20sent');_0x135eff(_0x44310e['result'][_0x9e90('0x18')]);}})['catch'](function(_0x5e1cbf){logger[_0x9e90('0x16')](_0x9e90('0x12'),_0x2c1e7f,_0x5e1cbf);_0x4566e9(_0x5e1cbf);});});} \ No newline at end of file +var _0x7a3d=['CmList,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./cmList.socket','register','request','then'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x7a3d,0x75));var _0xd7a3=function(_0x3be1c7,_0x5288af){_0x3be1c7=_0x3be1c7-0x0;var _0x4d2f15=_0x7a3d[_0x3be1c7];return _0x4d2f15;};'use strict';var _=require(_0xd7a3('0x0'));var util=require(_0xd7a3('0x1'));var moment=require(_0xd7a3('0x2'));var BPromise=require('bluebird');var rs=require(_0xd7a3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd7a3('0x4'))['db'];var utils=require(_0xd7a3('0x5'));var logger=require(_0xd7a3('0x6'))(_0xd7a3('0x7'));var config=require(_0xd7a3('0x8'));var jayson=require(_0xd7a3('0x9'));var client=jayson[_0xd7a3('0xa')]['http']({'port':0x232a});config[_0xd7a3('0xb')]=_[_0xd7a3('0xc')](config[_0xd7a3('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xd7a3('0xd'))(new Redis(config[_0xd7a3('0xb')]));require(_0xd7a3('0xe'))[_0xd7a3('0xf')](socket);function respondWithRpcPromise(_0x16fa08,_0x5284ed,_0x96cef7){return new BPromise(function(_0x39aa12,_0x5e11e4){return client[_0xd7a3('0x10')](_0x16fa08,_0x96cef7)[_0xd7a3('0x11')](function(_0x148c83){logger['info'](_0xd7a3('0x12'),_0x5284ed,_0xd7a3('0x13'));logger[_0xd7a3('0x14')]('CmList,\x20%s,\x20%s,\x20%s',_0x5284ed,_0xd7a3('0x13'),JSON[_0xd7a3('0x15')](_0x148c83));if(_0x148c83[_0xd7a3('0x16')]){if(_0x148c83[_0xd7a3('0x16')][_0xd7a3('0x17')]===0x1f4){logger[_0xd7a3('0x16')]('CmList,\x20%s,\x20%s',_0x5284ed,_0x148c83[_0xd7a3('0x16')]['message']);return _0x5e11e4(_0x148c83[_0xd7a3('0x16')][_0xd7a3('0x18')]);}logger['error'](_0xd7a3('0x12'),_0x5284ed,_0x148c83['error'][_0xd7a3('0x18')]);return _0x39aa12(_0x148c83['error']['message']);}else{logger[_0xd7a3('0x19')]('CmList,\x20%s,\x20%s',_0x5284ed,_0xd7a3('0x13'));_0x39aa12(_0x148c83[_0xd7a3('0x1a')][_0xd7a3('0x18')]);}})['catch'](function(_0x5cf48c){logger['error'](_0xd7a3('0x12'),_0x5284ed,_0x5cf48c);_0x5e11e4(_0x5cf48c);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 6a32e2a..777459d 100644 --- a/server/api/cmList/cmList.socket.js +++ b/server/api/cmList/cmList.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9305=['register','cmList:','./cmList.events','save','remove','update','emit','removeListener'];(function(_0x2ddd26,_0x555c1b){var _0x254342=function(_0x8908be){while(--_0x8908be){_0x2ddd26['push'](_0x2ddd26['shift']());}};_0x254342(++_0x555c1b);}(_0x9305,0x1e2));var _0x5930=function(_0xa3c315,_0x721d2a){_0xa3c315=_0xa3c315-0x0;var _0x4ab5fc=_0x9305[_0xa3c315];return _0x4ab5fc;};'use strict';var CmListEvents=require(_0x5930('0x0'));var events=[_0x5930('0x1'),_0x5930('0x2'),_0x5930('0x3')];function createListener(_0x5be178,_0x1769b6){return function(_0x1fc6b1){_0x1769b6[_0x5930('0x4')](_0x5be178,_0x1fc6b1);};}function removeListener(_0x16c710,_0x50d9ab){return function(){CmListEvents[_0x5930('0x5')](_0x16c710,_0x50d9ab);};}exports[_0x5930('0x6')]=function(_0x70d74f){for(var _0x2c4ada=0x0,_0x4b9cdf=events['length'];_0x2c4ada<_0x4b9cdf;_0x2c4ada++){var _0x2a3d8c=events[_0x2c4ada];var _0x80c566=createListener(_0x5930('0x7')+_0x2a3d8c,_0x70d74f);CmListEvents['on'](_0x2a3d8c,_0x80c566);}}; \ No newline at end of file +var _0xea03=['update','removeListener','register','cmList:','./cmList.events','remove'];(function(_0x4003ff,_0x5892b0){var _0x2288e2=function(_0x43211b){while(--_0x43211b){_0x4003ff['push'](_0x4003ff['shift']());}};_0x2288e2(++_0x5892b0);}(_0xea03,0x1ba));var _0x3ea0=function(_0x16b667,_0xadec02){_0x16b667=_0x16b667-0x0;var _0x58620e=_0xea03[_0x16b667];return _0x58620e;};'use strict';var CmListEvents=require(_0x3ea0('0x0'));var events=['save',_0x3ea0('0x1'),_0x3ea0('0x2')];function createListener(_0x438baa,_0x36b291){return function(_0x250977){_0x36b291['emit'](_0x438baa,_0x250977);};}function removeListener(_0x4d62ed,_0x531f4a){return function(){CmListEvents[_0x3ea0('0x3')](_0x4d62ed,_0x531f4a);};}exports[_0x3ea0('0x4')]=function(_0x266966){for(var _0xed8a4b=0x0,_0x2be1c5=events['length'];_0xed8a4b<_0x2be1c5;_0xed8a4b++){var _0x128556=events[_0xed8a4b];var _0x13b5ab=createListener(_0x3ea0('0x5')+_0x128556,_0x266966);CmListEvents['on'](_0x128556,_0x13b5ab);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index a3d2afa..71cef49 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 _0x584a=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','index','get','/describe','describe','show','isAuthenticated','getDispositions','getContacts','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','create','/:id/dispositions','addDisposition','/:id/contacts','addContacts','post','addAgents','update','delete','/:id','destroy','removeDispositions','removeAgents','exports','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x584a,0x8b));var _0xa584=function(_0xee122e,_0x58ef2e){_0xee122e=_0xee122e-0x0;var _0x34f98a=_0x584a[_0xee122e];return _0x34f98a;};'use strict';var multer=require('multer');var util=require(_0xa584('0x0'));var path=require(_0xa584('0x1'));var timeout=require(_0xa584('0x2'));var express=require('express');var router=express[_0xa584('0x3')]();var auth=require(_0xa584('0x4'));var interaction=require(_0xa584('0x5'));var config=require(_0xa584('0x6'));var controller=require(_0xa584('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xa584('0x8')]);router[_0xa584('0x9')](_0xa584('0xa'),auth['isAuthenticated'](),controller[_0xa584('0xb')]);router[_0xa584('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xa584('0xc')]);router[_0xa584('0x9')]('/:id/dispositions',auth[_0xa584('0xd')](),controller[_0xa584('0xe')]);router[_0xa584('0x9')]('/:id/contacts',auth['isAuthenticated'](),controller[_0xa584('0xf')]);router[_0xa584('0x9')]('/:id/contacts/csv',auth['isAuthenticated'](),controller[_0xa584('0x10')]);router[_0xa584('0x9')](_0xa584('0x11'),auth[_0xa584('0xd')](),controller[_0xa584('0x12')]);router['get'](_0xa584('0x13'),auth['isAuthenticated'](),controller[_0xa584('0x14')]);router['post']('/',auth[_0xa584('0xd')](),controller[_0xa584('0x15')]);router['post'](_0xa584('0x16'),auth[_0xa584('0xd')](),controller[_0xa584('0x17')]);router['post'](_0xa584('0x18'),auth['isAuthenticated'](),controller[_0xa584('0x19')]);router[_0xa584('0x1a')](_0xa584('0x11'),auth[_0xa584('0xd')](),controller['addCustomField']);router[_0xa584('0x1a')](_0xa584('0x13'),auth[_0xa584('0xd')](),controller[_0xa584('0x1b')]);router['put']('/:id',auth[_0xa584('0xd')](),controller[_0xa584('0x1c')]);router[_0xa584('0x1d')](_0xa584('0x1e'),auth[_0xa584('0xd')](),controller[_0xa584('0x1f')]);router['delete'](_0xa584('0x16'),auth[_0xa584('0xd')](),controller[_0xa584('0x20')]);router[_0xa584('0x1d')]('/:id/users',auth[_0xa584('0xd')](),controller[_0xa584('0x21')]);module[_0xa584('0x22')]=router; \ No newline at end of file +var _0x9d4a=['/:id/users','post','create','addDisposition','/:id/contacts','addContacts','addCustomField','put','destroy','delete','removeDispositions','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/contacts/csv','getContactsCsv','/:id/fields'];(function(_0x4ae27e,_0x4e260c){var _0x1ee2b9=function(_0x335a49){while(--_0x335a49){_0x4ae27e['push'](_0x4ae27e['shift']());}};_0x1ee2b9(++_0x4e260c);}(_0x9d4a,0x8b));var _0xa9d4=function(_0x2d2223,_0x31b6b1){_0x2d2223=_0x2d2223-0x0;var _0x1c3515=_0x9d4a[_0x2d2223];return _0x1c3515;};'use strict';var multer=require('multer');var util=require(_0xa9d4('0x0'));var path=require(_0xa9d4('0x1'));var timeout=require(_0xa9d4('0x2'));var express=require(_0xa9d4('0x3'));var router=express[_0xa9d4('0x4')]();var auth=require(_0xa9d4('0x5'));var interaction=require(_0xa9d4('0x6'));var config=require(_0xa9d4('0x7'));var controller=require(_0xa9d4('0x8'));router[_0xa9d4('0x9')]('/',auth[_0xa9d4('0xa')](),controller[_0xa9d4('0xb')]);router['get'](_0xa9d4('0xc'),auth[_0xa9d4('0xa')](),controller[_0xa9d4('0xd')]);router[_0xa9d4('0x9')](_0xa9d4('0xe'),auth['isAuthenticated'](),controller[_0xa9d4('0xf')]);router[_0xa9d4('0x9')](_0xa9d4('0x10'),auth[_0xa9d4('0xa')](),controller[_0xa9d4('0x11')]);router[_0xa9d4('0x9')]('/:id/contacts',auth[_0xa9d4('0xa')](),controller['getContacts']);router[_0xa9d4('0x9')](_0xa9d4('0x12'),auth[_0xa9d4('0xa')](),controller[_0xa9d4('0x13')]);router[_0xa9d4('0x9')](_0xa9d4('0x14'),auth[_0xa9d4('0xa')](),controller['getCustomFields']);router[_0xa9d4('0x9')](_0xa9d4('0x15'),auth[_0xa9d4('0xa')](),controller['getAgents']);router[_0xa9d4('0x16')]('/',auth[_0xa9d4('0xa')](),controller[_0xa9d4('0x17')]);router['post']('/:id/dispositions',auth['isAuthenticated'](),controller[_0xa9d4('0x18')]);router[_0xa9d4('0x16')](_0xa9d4('0x19'),auth[_0xa9d4('0xa')](),controller[_0xa9d4('0x1a')]);router[_0xa9d4('0x16')](_0xa9d4('0x14'),auth['isAuthenticated'](),controller[_0xa9d4('0x1b')]);router[_0xa9d4('0x16')](_0xa9d4('0x15'),auth['isAuthenticated'](),controller['addAgents']);router[_0xa9d4('0x1c')](_0xa9d4('0xe'),auth[_0xa9d4('0xa')](),controller['update']);router['delete'](_0xa9d4('0xe'),auth[_0xa9d4('0xa')](),controller[_0xa9d4('0x1d')]);router[_0xa9d4('0x1e')](_0xa9d4('0x10'),auth[_0xa9d4('0xa')](),controller[_0xa9d4('0x1f')]);router[_0xa9d4('0x1e')]('/:id/users',auth[_0xa9d4('0xa')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 4d65db0..a83fc6a 100644 --- a/server/api/condition/condition.attributes.js +++ b/server/api/condition/condition.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['field','STRING','sequelize','exports','VIRTUAL'];(function(_0x440fbb,_0x44144e){var _0x3b4abb=function(_0x2b80b4){while(--_0x2b80b4){_0x440fbb['push'](_0x440fbb['shift']());}};_0x3b4abb(++_0x44144e);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'name':{'type':Sequelize[_0x7995('0x2')],'get':function(_0x10a05d){return this['getDataValue'](_0x7995('0x3'));}},'field':{'type':Sequelize[_0x7995('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0x7995('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x7995('0x4')],'allowNull':![]}}; \ No newline at end of file +var _0xa9e0=['STRING','sequelize','exports','VIRTUAL','field'];(function(_0x5c7ced,_0x310d8e){var _0x290e20=function(_0x2da4e6){while(--_0x2da4e6){_0x5c7ced['push'](_0x5c7ced['shift']());}};_0x290e20(++_0x310d8e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')],'get':function(_0x5dd881){return this['getDataValue'](_0x0a9e('0x3'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0x0a9e('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x0a9e('0x4')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 9984f78..9ad63cb 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 _0xa7ba=['moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','error','name','send','body','Condition','params','catch','find','html-pdf','zip-dir','fast-json-patch','request-promise'];(function(_0x32e9f2,_0xb07902){var _0x161bfb=function(_0x52a8e1){while(--_0x52a8e1){_0x32e9f2['push'](_0x32e9f2['shift']());}};_0x161bfb(++_0xb07902);}(_0xa7ba,0x1aa));var _0xaa7b=function(_0x5572aa,_0x5d818d){_0x5572aa=_0x5572aa-0x0;var _0x438997=_0xa7ba[_0x5572aa];return _0x438997;};'use strict';var pdf=require(_0xaa7b('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xaa7b('0x1'));var jsonpatch=require(_0xaa7b('0x2'));var rp=require(_0xaa7b('0x3'));var moment=require(_0xaa7b('0x4'));var BPromise=require(_0xaa7b('0x5'));var Mustache=require(_0xaa7b('0x6'));var util=require(_0xaa7b('0x7'));var path=require('path');var sox=require(_0xaa7b('0x8'));var csv=require(_0xaa7b('0x9'));var ejs=require(_0xaa7b('0xa'));var fs=require('fs');var _=require(_0xaa7b('0xb'));var squel=require(_0xaa7b('0xc'));var crypto=require('crypto');var jsforce=require(_0xaa7b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xaa7b('0x9'));var querystring=require('querystring');var Papa=require(_0xaa7b('0xe'));var Redis=require(_0xaa7b('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xaa7b('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaa7b('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xaa7b('0x12'));var config=require(_0xaa7b('0x13'));var db=require(_0xaa7b('0x14'))['db'];function respondWithStatusCode(_0x3105d4,_0x46c9be){_0x46c9be=_0x46c9be||0xcc;return function(_0x40b654){if(_0x40b654){return _0x3105d4[_0xaa7b('0x15')](_0x46c9be);}return _0x3105d4[_0xaa7b('0x16')](_0x46c9be)[_0xaa7b('0x17')]();};}function respondWithResult(_0x5300cf,_0x3dda43){_0x3dda43=_0x3dda43||0xc8;return function(_0x526e6f){if(_0x526e6f){return _0x5300cf[_0xaa7b('0x16')](_0x3dda43)[_0xaa7b('0x18')](_0x526e6f);}};}function respondWithFilteredResult(_0x384bbf,_0xc35dfa){return function(_0x1e59c2){if(_0x1e59c2){var _0x6b7a3=_0x1e59c2[_0xaa7b('0x19')],_0x5cff96=_0xc35dfa[_0xaa7b('0x1a')],_0x37f4bf=_0xc35dfa[_0xaa7b('0x1a')]+_0xc35dfa['limit'],_0x2f04be;if(_0x37f4bf>=_0x6b7a3){_0x37f4bf=_0x6b7a3;_0x2f04be=0xc8;}else{_0x2f04be=0xce;}_0x384bbf[_0xaa7b('0x16')](_0x2f04be);return _0x384bbf[_0xaa7b('0x1b')](_0xaa7b('0x1c'),_0x5cff96+'-'+_0x37f4bf+'/'+_0x6b7a3)['json'](_0x1e59c2);}return null;};}function patchUpdates(_0x294510){return function(_0x42d883){try{jsonpatch[_0xaa7b('0x1d')](_0x42d883,_0x294510,!![]);}catch(_0x56ef6f){return BPromise[_0xaa7b('0x1e')](_0x56ef6f);}return _0x42d883[_0xaa7b('0x1f')]();};}function saveUpdates(_0x177108,_0x1a7754){return function(_0x47961c){if(_0x47961c){return _0x47961c[_0xaa7b('0x20')](_0x177108)['then'](function(_0x1a5a69){return _0x1a5a69;});}return null;};}function removeEntity(_0x29ac79,_0x50d882){return function(_0x19eb05){if(_0x19eb05){return _0x19eb05[_0xaa7b('0x21')]()[_0xaa7b('0x22')](function(){_0x29ac79[_0xaa7b('0x16')](0xcc)[_0xaa7b('0x17')]();});}};}function handleEntityNotFound(_0x1fd0b8,_0x5473c6){return function(_0x286505){if(!_0x286505){_0x1fd0b8[_0xaa7b('0x15')](0x194);}return _0x286505;};}function handleError(_0x5a30b2,_0x15e30c){_0x15e30c=_0x15e30c||0x1f4;return function(_0x9cfa25){logger[_0xaa7b('0x23')](_0x9cfa25['stack']);if(_0x9cfa25[_0xaa7b('0x24')]){delete _0x9cfa25['name'];}_0x5a30b2[_0xaa7b('0x16')](_0x15e30c)[_0xaa7b('0x25')](_0x9cfa25);};}exports[_0xaa7b('0x20')]=function(_0x2a18bb,_0x119c75){if(_0x2a18bb['body']['id']){delete _0x2a18bb[_0xaa7b('0x26')]['id'];}return db[_0xaa7b('0x27')]['find']({'where':{'id':_0x2a18bb[_0xaa7b('0x28')]['id']}})[_0xaa7b('0x22')](handleEntityNotFound(_0x119c75,null))['then'](saveUpdates(_0x2a18bb[_0xaa7b('0x26')],null))['then'](respondWithResult(_0x119c75,null))[_0xaa7b('0x29')](handleError(_0x119c75,null));};exports[_0xaa7b('0x21')]=function(_0x5b8a9a,_0x5d02d6){return db[_0xaa7b('0x27')][_0xaa7b('0x2a')]({'where':{'id':_0x5b8a9a[_0xaa7b('0x28')]['id']}})['then'](handleEntityNotFound(_0x5d02d6,null))['then'](removeEntity(_0x5d02d6,null))[_0xaa7b('0x29')](handleError(_0x5d02d6,null));}; \ No newline at end of file +var _0xf07a=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','set','Content-Range','update','then','destroy','end','error','name','body','Condition','find','params','catch','html-pdf','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','lodash','squel','jsforce','querystring','papaparse','ioredis'];(function(_0x58fc13,_0x1c0879){var _0x4e1e50=function(_0x2e53bd){while(--_0x2e53bd){_0x58fc13['push'](_0x58fc13['shift']());}};_0x4e1e50(++_0x1c0879);}(_0xf07a,0xe7));var _0xaf07=function(_0x2d51cc,_0x2ca3e2){_0x2d51cc=_0x2d51cc-0x0;var _0x3dc46b=_0xf07a[_0x2d51cc];return _0x3dc46b;};'use strict';var pdf=require(_0xaf07('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xaf07('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaf07('0x2'));var rp=require(_0xaf07('0x3'));var moment=require(_0xaf07('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xaf07('0x5'));var util=require(_0xaf07('0x6'));var path=require(_0xaf07('0x7'));var sox=require('sox');var csv=require(_0xaf07('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xaf07('0x9'));var squel=require(_0xaf07('0xa'));var crypto=require('crypto');var jsforce=require(_0xaf07('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xaf07('0x8'));var querystring=require(_0xaf07('0xc'));var Papa=require(_0xaf07('0xd'));var Redis=require(_0xaf07('0xe'));var authService=require(_0xaf07('0xf'));var qs=require(_0xaf07('0x10'));var as=require(_0xaf07('0x11'));var hardwareService=require(_0xaf07('0x12'));var logger=require(_0xaf07('0x13'))('api');var utils=require(_0xaf07('0x14'));var config=require(_0xaf07('0x15'));var db=require(_0xaf07('0x16'))['db'];function respondWithStatusCode(_0x1950aa,_0x238f61){_0x238f61=_0x238f61||0xcc;return function(_0x3c8d11){if(_0x3c8d11){return _0x1950aa[_0xaf07('0x17')](_0x238f61);}return _0x1950aa[_0xaf07('0x18')](_0x238f61)['end']();};}function respondWithResult(_0x51807a,_0x1a2bcc){_0x1a2bcc=_0x1a2bcc||0xc8;return function(_0x5487aa){if(_0x5487aa){return _0x51807a[_0xaf07('0x18')](_0x1a2bcc)['json'](_0x5487aa);}};}function respondWithFilteredResult(_0xae27fb,_0xe16cf7){return function(_0x1c5849){if(_0x1c5849){var _0x42c3b3=_0x1c5849[_0xaf07('0x19')],_0xe16f6a=_0xe16cf7[_0xaf07('0x1a')],_0x588975=_0xe16cf7[_0xaf07('0x1a')]+_0xe16cf7[_0xaf07('0x1b')],_0xa2ae1e;if(_0x588975>=_0x42c3b3){_0x588975=_0x42c3b3;_0xa2ae1e=0xc8;}else{_0xa2ae1e=0xce;}_0xae27fb[_0xaf07('0x18')](_0xa2ae1e);return _0xae27fb[_0xaf07('0x1c')](_0xaf07('0x1d'),_0xe16f6a+'-'+_0x588975+'/'+_0x42c3b3)['json'](_0x1c5849);}return null;};}function patchUpdates(_0x1bea5e){return function(_0x43fb71){try{jsonpatch['apply'](_0x43fb71,_0x1bea5e,!![]);}catch(_0x3d60a1){return BPromise['reject'](_0x3d60a1);}return _0x43fb71['save']();};}function saveUpdates(_0x705cfa,_0x447b0){return function(_0xdc3643){if(_0xdc3643){return _0xdc3643[_0xaf07('0x1e')](_0x705cfa)[_0xaf07('0x1f')](function(_0x18cf4c){return _0x18cf4c;});}return null;};}function removeEntity(_0x4febd1,_0x1dfbdf){return function(_0x5f589b){if(_0x5f589b){return _0x5f589b[_0xaf07('0x20')]()[_0xaf07('0x1f')](function(){_0x4febd1[_0xaf07('0x18')](0xcc)[_0xaf07('0x21')]();});}};}function handleEntityNotFound(_0x192f45,_0x519f3a){return function(_0x56390a){if(!_0x56390a){_0x192f45[_0xaf07('0x17')](0x194);}return _0x56390a;};}function handleError(_0xc0d499,_0x3f8310){_0x3f8310=_0x3f8310||0x1f4;return function(_0x4e8976){logger[_0xaf07('0x22')](_0x4e8976['stack']);if(_0x4e8976[_0xaf07('0x23')]){delete _0x4e8976[_0xaf07('0x23')];}_0xc0d499[_0xaf07('0x18')](_0x3f8310)['send'](_0x4e8976);};}exports[_0xaf07('0x1e')]=function(_0x3a9c37,_0x3e587c){if(_0x3a9c37[_0xaf07('0x24')]['id']){delete _0x3a9c37[_0xaf07('0x24')]['id'];}return db[_0xaf07('0x25')][_0xaf07('0x26')]({'where':{'id':_0x3a9c37[_0xaf07('0x27')]['id']}})[_0xaf07('0x1f')](handleEntityNotFound(_0x3e587c,null))[_0xaf07('0x1f')](saveUpdates(_0x3a9c37[_0xaf07('0x24')],null))['then'](respondWithResult(_0x3e587c,null))[_0xaf07('0x28')](handleError(_0x3e587c,null));};exports[_0xaf07('0x20')]=function(_0x10c5b9,_0x1e75b6){return db[_0xaf07('0x25')][_0xaf07('0x26')]({'where':{'id':_0x10c5b9[_0xaf07('0x27')]['id']}})['then'](handleEntityNotFound(_0x1e75b6,null))[_0xaf07('0x1f')](removeEntity(_0x1e75b6,null))[_0xaf07('0x28')](handleError(_0x1e75b6,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index d0fa3db..a6bfa49 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 _0x1300=['api','bluebird','request-promise','path','rimraf','./condition.attributes','exports','define','Condition','tools_conditions','lodash','util','../../config/logger'];(function(_0x64aff8,_0x106082){var _0x5488a3=function(_0x36969c){while(--_0x36969c){_0x64aff8['push'](_0x64aff8['shift']());}};_0x5488a3(++_0x106082);}(_0x1300,0xf4));var _0x0130=function(_0x54c402,_0x5495b1){_0x54c402=_0x54c402-0x0;var _0x2e1686=_0x1300[_0x54c402];return _0x2e1686;};'use strict';var _=require(_0x0130('0x0'));var util=require(_0x0130('0x1'));var logger=require(_0x0130('0x2'))(_0x0130('0x3'));var moment=require('moment');var BPromise=require(_0x0130('0x4'));var rp=require(_0x0130('0x5'));var fs=require('fs');var path=require(_0x0130('0x6'));var rimraf=require(_0x0130('0x7'));var config=require('../../config/environment');var attributes=require(_0x0130('0x8'));module[_0x0130('0x9')]=function(_0x179b91,_0x57dd3d){return _0x179b91[_0x0130('0xa')](_0x0130('0xb'),attributes,{'tableName':_0x0130('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x299c=['api','moment','path','rimraf','./condition.attributes','exports','define','tools_conditions','lodash','util','../../config/logger'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x299c,0x1e1));var _0xc299=function(_0x4a3b4b,_0x1319d4){_0x4a3b4b=_0x4a3b4b-0x0;var _0x334c77=_0x299c[_0x4a3b4b];return _0x334c77;};'use strict';var _=require(_0xc299('0x0'));var util=require(_0xc299('0x1'));var logger=require(_0xc299('0x2'))(_0xc299('0x3'));var moment=require(_0xc299('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc299('0x5'));var rimraf=require(_0xc299('0x6'));var config=require('../../config/environment');var attributes=require(_0xc299('0x7'));module[_0xc299('0x8')]=function(_0x4a72c8,_0x13663b){return _0x4a72c8[_0xc299('0x9')]('Condition',attributes,{'tableName':_0xc299('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/condition/condition.rpc.js b/server/api/condition/condition.rpc.js index bee25b5..de37260 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 _0xde47=['client','http','request','then','info','Condition,\x20%s,\x20%s','Condition,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','util','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2f15ff,_0x257115){var _0x1c3cab=function(_0xc328d9){while(--_0xc328d9){_0x2f15ff['push'](_0x2f15ff['shift']());}};_0x1c3cab(++_0x257115);}(_0xde47,0x1c5));var _0x7de4=function(_0xafcf00,_0x4429a3){_0xafcf00=_0xafcf00-0x0;var _0x513af4=_0xde47[_0xafcf00];return _0x513af4;};'use strict';var _=require('lodash');var util=require(_0x7de4('0x0'));var moment=require('moment');var BPromise=require(_0x7de4('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7de4('0x2'));var logger=require(_0x7de4('0x3'))(_0x7de4('0x4'));var config=require(_0x7de4('0x5'));var jayson=require(_0x7de4('0x6'));var client=jayson[_0x7de4('0x7')][_0x7de4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x53cb1d,_0x33464e,_0x1013c0){return new BPromise(function(_0x197512,_0x2d062f){return client[_0x7de4('0x9')](_0x53cb1d,_0x1013c0)[_0x7de4('0xa')](function(_0x659ccc){logger[_0x7de4('0xb')](_0x7de4('0xc'),_0x33464e,'request\x20sent');logger['debug'](_0x7de4('0xd'),_0x33464e,_0x7de4('0xe'),JSON[_0x7de4('0xf')](_0x659ccc));if(_0x659ccc[_0x7de4('0x10')]){if(_0x659ccc[_0x7de4('0x10')][_0x7de4('0x11')]===0x1f4){logger[_0x7de4('0x10')](_0x7de4('0xc'),_0x33464e,_0x659ccc[_0x7de4('0x10')]['message']);return _0x2d062f(_0x659ccc[_0x7de4('0x10')][_0x7de4('0x12')]);}logger[_0x7de4('0x10')](_0x7de4('0xc'),_0x33464e,_0x659ccc[_0x7de4('0x10')][_0x7de4('0x12')]);return _0x197512(_0x659ccc[_0x7de4('0x10')][_0x7de4('0x12')]);}else{logger[_0x7de4('0xb')](_0x7de4('0xc'),_0x33464e,_0x7de4('0xe'));_0x197512(_0x659ccc[_0x7de4('0x13')]['message']);}})['catch'](function(_0x407806){logger[_0x7de4('0x10')](_0x7de4('0xc'),_0x33464e,_0x407806);_0x2d062f(_0x407806);});});} \ No newline at end of file +var _0xf380=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','stringify','error','code','Condition,\x20%s,\x20%s','message'];(function(_0x48deac,_0x4d8ab8){var _0x3b5eaa=function(_0x91c61e){while(--_0x91c61e){_0x48deac['push'](_0x48deac['shift']());}};_0x3b5eaa(++_0x4d8ab8);}(_0xf380,0x95));var _0x0f38=function(_0x26042e,_0x4338d7){_0x26042e=_0x26042e-0x0;var _0x16e92f=_0xf380[_0x26042e];return _0x16e92f;};'use strict';var _=require(_0x0f38('0x0'));var util=require(_0x0f38('0x1'));var moment=require('moment');var BPromise=require(_0x0f38('0x2'));var rs=require(_0x0f38('0x3'));var fs=require('fs');var Redis=require(_0x0f38('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0f38('0x5'));var logger=require(_0x0f38('0x6'))(_0x0f38('0x7'));var config=require(_0x0f38('0x8'));var jayson=require(_0x0f38('0x9'));var client=jayson[_0x0f38('0xa')][_0x0f38('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5685e1,_0x5498fb,_0x21d81d){return new BPromise(function(_0x4b8c03,_0x509f2f){return client[_0x0f38('0xc')](_0x5685e1,_0x21d81d)['then'](function(_0x37b3d8){logger['info']('Condition,\x20%s,\x20%s',_0x5498fb,_0x0f38('0xd'));logger['debug']('Condition,\x20%s,\x20%s,\x20%s',_0x5498fb,_0x0f38('0xd'),JSON[_0x0f38('0xe')](_0x37b3d8));if(_0x37b3d8[_0x0f38('0xf')]){if(_0x37b3d8[_0x0f38('0xf')][_0x0f38('0x10')]===0x1f4){logger[_0x0f38('0xf')](_0x0f38('0x11'),_0x5498fb,_0x37b3d8[_0x0f38('0xf')]['message']);return _0x509f2f(_0x37b3d8[_0x0f38('0xf')][_0x0f38('0x12')]);}logger[_0x0f38('0xf')](_0x0f38('0x11'),_0x5498fb,_0x37b3d8['error'][_0x0f38('0x12')]);return _0x4b8c03(_0x37b3d8['error'][_0x0f38('0x12')]);}else{logger['info'](_0x0f38('0x11'),_0x5498fb,_0x0f38('0xd'));_0x4b8c03(_0x37b3d8[_0x0f38('0x13')][_0x0f38('0x12')]);}})[_0x0f38('0x14')](function(_0x33387d){logger['error'](_0x0f38('0x11'),_0x5498fb,_0x33387d);_0x509f2f(_0x33387d);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index ae269ce..8c5df8d 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 _0xf1f1=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','put','/:id','isAuthenticated','update','delete','destroy','exports','multer','util'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0xf1f1,0x166));var _0x1f1f=function(_0x3942d3,_0x3e0381){_0x3942d3=_0x3942d3-0x0;var _0xf90e4c=_0xf1f1[_0x3942d3];return _0xf90e4c;};'use strict';var multer=require(_0x1f1f('0x0'));var util=require(_0x1f1f('0x1'));var path=require(_0x1f1f('0x2'));var timeout=require(_0x1f1f('0x3'));var express=require('express');var router=express[_0x1f1f('0x4')]();var auth=require(_0x1f1f('0x5'));var interaction=require(_0x1f1f('0x6'));var config=require(_0x1f1f('0x7'));var controller=require('./condition.controller');router[_0x1f1f('0x8')](_0x1f1f('0x9'),auth[_0x1f1f('0xa')](),controller[_0x1f1f('0xb')]);router[_0x1f1f('0xc')](_0x1f1f('0x9'),auth['isAuthenticated'](),controller[_0x1f1f('0xd')]);module[_0x1f1f('0xe')]=router; \ No newline at end of file +var _0xbc5e=['util','path','express','Router','../../components/interaction/service','put','/:id','isAuthenticated','destroy'];(function(_0x4730c4,_0x31303b){var _0x111b33=function(_0x2d71c2){while(--_0x2d71c2){_0x4730c4['push'](_0x4730c4['shift']());}};_0x111b33(++_0x31303b);}(_0xbc5e,0x87));var _0xebc5=function(_0x20826c,_0x150cdc){_0x20826c=_0x20826c-0x0;var _0x14d565=_0xbc5e[_0x20826c];return _0x14d565;};'use strict';var multer=require('multer');var util=require(_0xebc5('0x0'));var path=require(_0xebc5('0x1'));var timeout=require('connect-timeout');var express=require(_0xebc5('0x2'));var router=express[_0xebc5('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xebc5('0x4'));var config=require('../../config/environment');var controller=require('./condition.controller');router[_0xebc5('0x5')](_0xebc5('0x6'),auth[_0xebc5('0x7')](),controller['update']);router['delete'](_0xebc5('0x6'),auth['isAuthenticated'](),controller[_0xebc5('0x8')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 51fd5bd..0ebee96 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 _0x3471=['name','sequelize','STRING'];(function(_0x51e2f4,_0x1acff9){var _0x39ece2=function(_0x3709f0){while(--_0x3709f0){_0x51e2f4['push'](_0x51e2f4['shift']());}};_0x39ece2(++_0x1acff9);}(_0x3471,0x106));var _0x1347=function(_0x4f705a,_0x3b1f60){_0x4f705a=_0x4f705a-0x0;var _0x4f1744=_0x3471[_0x4f705a];return _0x4f1744;};'use strict';var Sequelize=require(_0x1347('0x0'));module['exports']={'name':{'type':Sequelize[_0x1347('0x1')],'allowNull':![],'unique':_0x1347('0x2')},'description':{'type':Sequelize[_0x1347('0x1')]}}; \ No newline at end of file +var _0x2709=['sequelize','STRING','name'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x2709,0x189));var _0x9270=function(_0x5e7bb3,_0x127b08){_0x5e7bb3=_0x5e7bb3-0x0;var _0x3b5dfb=_0x2709[_0x5e7bb3];return _0x3b5dfb;};'use strict';var Sequelize=require(_0x9270('0x0'));module['exports']={'name':{'type':Sequelize[_0x9270('0x1')],'allowNull':![],'unique':_0x9270('0x2')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 19ad8b8..9e15efc 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 _0x93e1=['send','map','Dashboard','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','VIRTUAL','field','filter','merge','includeAll','include','rows','catch','params','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','CustomDashboards','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','createdAt','updatedAt','omit','body','UserProfileSection','attrUrl','attrs','value','https://','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','counter','attrMetric','total','attrVoiceQueues','attrFontSize','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','DashboardId','DashboardItem','pick','getItems','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','name'];(function(_0x447946,_0x5aeceb){var _0x50227c=function(_0x2cb770){while(--_0x2cb770){_0x447946['push'](_0x447946['shift']());}};_0x50227c(++_0x5aeceb);}(_0x93e1,0x1c5));var _0x193e=function(_0x2fde6e,_0x1bab48){_0x2fde6e=_0x2fde6e-0x0;var _0x2c718f=_0x93e1[_0x2fde6e];return _0x2c718f;};'use strict';var pdf=require(_0x193e('0x0'));var emlformat=require(_0x193e('0x1'));var rimraf=require(_0x193e('0x2'));var zipdir=require(_0x193e('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x193e('0x4'));var moment=require(_0x193e('0x5'));var BPromise=require(_0x193e('0x6'));var Mustache=require(_0x193e('0x7'));var util=require('util');var path=require('path');var sox=require(_0x193e('0x8'));var csv=require(_0x193e('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x193e('0xa'));var squel=require(_0x193e('0xb'));var crypto=require(_0x193e('0xc'));var jsforce=require(_0x193e('0xd'));var deskjs=require(_0x193e('0xe'));var toCsv=require(_0x193e('0x9'));var querystring=require(_0x193e('0xf'));var Papa=require(_0x193e('0x10'));var Redis=require(_0x193e('0x11'));var authService=require(_0x193e('0x12'));var qs=require(_0x193e('0x13'));var as=require(_0x193e('0x14'));var hardwareService=require(_0x193e('0x15'));var logger=require(_0x193e('0x16'))(_0x193e('0x17'));var utils=require(_0x193e('0x18'));var config=require(_0x193e('0x19'));var db=require(_0x193e('0x1a'))['db'];config[_0x193e('0x1b')]=_[_0x193e('0x1c')](config[_0x193e('0x1b')],{'host':_0x193e('0x1d'),'port':0x18eb});var socket=require(_0x193e('0x1e'))(new Redis(config[_0x193e('0x1b')]));require(_0x193e('0x1f'))[_0x193e('0x20')](socket);function respondWithStatusCode(_0x2461c6,_0xe60fca){_0xe60fca=_0xe60fca||0xcc;return function(_0x519730){if(_0x519730){return _0x2461c6[_0x193e('0x21')](_0xe60fca);}return _0x2461c6[_0x193e('0x22')](_0xe60fca)[_0x193e('0x23')]();};}function respondWithResult(_0x1258f6,_0x57da48){_0x57da48=_0x57da48||0xc8;return function(_0x782bec){if(_0x782bec){return _0x1258f6[_0x193e('0x22')](_0x57da48)[_0x193e('0x24')](_0x782bec);}};}function respondWithFilteredResult(_0x482e58,_0x31afdf){return function(_0x2b7e7a){if(_0x2b7e7a){var _0x5c2bf2=_0x2b7e7a[_0x193e('0x25')],_0x3feafa=_0x31afdf[_0x193e('0x26')],_0x1511ce=_0x31afdf[_0x193e('0x26')]+_0x31afdf['limit'],_0x17f998;if(_0x1511ce>=_0x5c2bf2){_0x1511ce=_0x5c2bf2;_0x17f998=0xc8;}else{_0x17f998=0xce;}_0x482e58['status'](_0x17f998);return _0x482e58[_0x193e('0x27')](_0x193e('0x28'),_0x3feafa+'-'+_0x1511ce+'/'+_0x5c2bf2)[_0x193e('0x24')](_0x2b7e7a);}return null;};}function patchUpdates(_0x527732){return function(_0x5c102a){try{jsonpatch[_0x193e('0x29')](_0x5c102a,_0x527732,!![]);}catch(_0x4cbf89){return BPromise[_0x193e('0x2a')](_0x4cbf89);}return _0x5c102a[_0x193e('0x2b')]();};}function saveUpdates(_0x447734,_0x5ecbea){return function(_0x5721bd){if(_0x5721bd){return _0x5721bd[_0x193e('0x2c')](_0x447734)[_0x193e('0x2d')](function(_0x3ca70e){return _0x3ca70e;});}return null;};}function removeEntity(_0x30c032,_0x4e50df){return function(_0x2420b9){if(_0x2420b9){return _0x2420b9[_0x193e('0x2e')]()[_0x193e('0x2d')](function(){var _0x5a597b=_0x2420b9[_0x193e('0x2f')]({'plain':!![]});var _0x2cc011='CustomDashboards';return db[_0x193e('0x30')]['destroy']({'where':{'type':_0x2cc011,'resourceId':_0x5a597b['id']}})[_0x193e('0x2d')](function(){return _0x2420b9;});})[_0x193e('0x2d')](function(){_0x30c032[_0x193e('0x22')](0xcc)[_0x193e('0x23')]();});}};}function handleEntityNotFound(_0x5b5418,_0x4f5b72){return function(_0x6d14c0){if(!_0x6d14c0){_0x5b5418[_0x193e('0x21')](0x194);}return _0x6d14c0;};}function handleError(_0x544b45,_0xd7d047){_0xd7d047=_0xd7d047||0x1f4;return function(_0x27c88d){logger[_0x193e('0x31')](_0x27c88d['stack']);if(_0x27c88d[_0x193e('0x32')]){delete _0x27c88d[_0x193e('0x32')];}_0x544b45[_0x193e('0x22')](_0xd7d047)[_0x193e('0x33')](_0x27c88d);};}exports['index']=function(_0x697993,_0x4a530e){var _0x15b275={},_0x19adb5={},_0x20b0aa={'count':0x0,'rows':[]};var _0x131f41=_[_0x193e('0x34')](db[_0x193e('0x35')][_0x193e('0x36')],function(_0x59a9e9){return{'name':_0x59a9e9[_0x193e('0x37')],'type':_0x59a9e9[_0x193e('0x38')][_0x193e('0x39')]};});_0x19adb5[_0x193e('0x3a')]=_['map'](_0x131f41,_0x193e('0x32'));_0x19adb5[_0x193e('0x3b')]=_[_0x193e('0x3c')](_0x697993['query']);_0x19adb5[_0x193e('0x3d')]=_[_0x193e('0x3e')](_0x19adb5['model'],_0x19adb5['query']);_0x15b275['attributes']=_[_0x193e('0x3e')](_0x19adb5['model'],qs[_0x193e('0x3f')](_0x697993[_0x193e('0x3b')][_0x193e('0x3f')]));_0x15b275[_0x193e('0x40')]=_0x15b275[_0x193e('0x40')][_0x193e('0x41')]?_0x15b275[_0x193e('0x40')]:_0x19adb5['model'];if(!_0x697993[_0x193e('0x3b')][_0x193e('0x42')](_0x193e('0x43'))){_0x15b275[_0x193e('0x44')]=qs[_0x193e('0x44')](_0x697993['query'][_0x193e('0x44')]);_0x15b275[_0x193e('0x26')]=qs[_0x193e('0x26')](_0x697993['query'][_0x193e('0x26')]);}_0x15b275[_0x193e('0x45')]=qs[_0x193e('0x46')](_0x697993['query'][_0x193e('0x46')]);_0x15b275[_0x193e('0x47')]=qs['filters'](_['pick'](_0x697993[_0x193e('0x3b')],_0x19adb5[_0x193e('0x3d')]));if(_0x697993['query']['filter']){_0x15b275['where']=_['merge'](_0x15b275[_0x193e('0x47')],{'$or':_[_0x193e('0x34')](_0x131f41,function(_0x1003bf){if(_0x1003bf[_0x193e('0x38')][_0x193e('0x39')]!==_0x193e('0x48')){var _0x2e354b={};_0x2e354b[_0x1003bf[_0x193e('0x49')]]={'$like':'%'+_0x697993[_0x193e('0x3b')][_0x193e('0x4a')]+'%'};return _0x2e354b;}})});}_0x15b275=_[_0x193e('0x4b')]({},_0x15b275,_0x697993['options']);var _0x294cb4={'where':_0x15b275['where']};return db[_0x193e('0x35')]['count'](_0x294cb4)['then'](function(_0x71cc68){_0x20b0aa[_0x193e('0x25')]=_0x71cc68;if(_0x697993[_0x193e('0x3b')][_0x193e('0x4c')]){_0x15b275[_0x193e('0x4d')]=[{'all':!![]}];}return db[_0x193e('0x35')]['findAll'](_0x15b275);})['then'](function(_0x505c24){_0x20b0aa[_0x193e('0x4e')]=_0x505c24;return _0x20b0aa;})[_0x193e('0x2d')](respondWithFilteredResult(_0x4a530e,_0x15b275))[_0x193e('0x4f')](handleError(_0x4a530e,null));};exports['show']=function(_0x1822c5,_0x159d11){var _0x3220e3={'raw':![],'where':{'id':_0x1822c5[_0x193e('0x50')]['id']}},_0x529b49={};_0x529b49[_0x193e('0x3a')]=_[_0x193e('0x3c')](db[_0x193e('0x35')][_0x193e('0x36')]);_0x529b49[_0x193e('0x3b')]=_[_0x193e('0x3c')](_0x1822c5['query']);_0x529b49[_0x193e('0x3d')]=_[_0x193e('0x3e')](_0x529b49['model'],_0x529b49[_0x193e('0x3b')]);_0x3220e3[_0x193e('0x40')]=_[_0x193e('0x3e')](_0x529b49[_0x193e('0x3a')],qs[_0x193e('0x3f')](_0x1822c5[_0x193e('0x3b')][_0x193e('0x3f')]));_0x3220e3[_0x193e('0x40')]=_0x3220e3['attributes'][_0x193e('0x41')]?_0x3220e3['attributes']:_0x529b49['model'];if(_0x1822c5[_0x193e('0x3b')][_0x193e('0x4c')]){_0x3220e3['include']=[{'all':!![]}];}_0x3220e3=_[_0x193e('0x4b')]({},_0x3220e3,_0x1822c5[_0x193e('0x51')]);return db['Dashboard'][_0x193e('0x52')](_0x3220e3)[_0x193e('0x2d')](handleEntityNotFound(_0x159d11,null))[_0x193e('0x2d')](respondWithResult(_0x159d11,null))['catch'](handleError(_0x159d11,null));};exports[_0x193e('0x53')]=function(_0xe301a9,_0x3bdb83){return db[_0x193e('0x35')][_0x193e('0x53')](_0xe301a9['body'],{})[_0x193e('0x2d')](function(_0x52fa37){var _0x177a06=_0xe301a9['user'][_0x193e('0x2f')]({'plain':!![]});if(!_0x177a06)throw new Error(_0x193e('0x54'));if(_0x177a06[_0x193e('0x55')]===_0x193e('0x56')){var _0x35ff7b=_0x52fa37[_0x193e('0x2f')]({'plain':!![]});var _0x3f9097=_0x193e('0x57');return db['UserProfileSection'][_0x193e('0x52')]({'where':{'name':_0x3f9097,'userProfileId':_0x177a06[_0x193e('0x58')]},'raw':!![]})['then'](function(_0x482e16){if(_0x482e16&&_0x482e16[_0x193e('0x59')]===0x0){return db[_0x193e('0x30')]['create']({'name':_0x35ff7b[_0x193e('0x32')],'resourceId':_0x35ff7b['id'],'type':_0x482e16[_0x193e('0x32')],'sectionId':_0x482e16['id']},{})[_0x193e('0x2d')](function(){return _0x52fa37;});}else{return _0x52fa37;}})[_0x193e('0x4f')](function(_0x3c3138){logger[_0x193e('0x31')](_0x193e('0x5a'),_0x3c3138);throw _0x3c3138;});}return _0x52fa37;})[_0x193e('0x2d')](respondWithResult(_0x3bdb83,0xc9))['catch'](handleError(_0x3bdb83,null));};exports['clone']=function(_0x3e2375,_0x4bb64c){var _0x872c74={'raw':![],'where':{'id':_0x3e2375[_0x193e('0x50')]['id']}},_0x381224={};_0x381224[_0x193e('0x3a')]=_[_0x193e('0x3c')](db[_0x193e('0x35')]['rawAttributes']);_0x872c74['attributes']=_[_0x193e('0x3e')](_0x381224[_0x193e('0x3a')],qs[_0x193e('0x3f')](_0x3e2375[_0x193e('0x3b')][_0x193e('0x3f')]));_0x872c74['attributes']=_0x872c74[_0x193e('0x40')][_0x193e('0x41')]?_0x872c74[_0x193e('0x40')]:_0x381224[_0x193e('0x3a')];if(_0x3e2375['query'][_0x193e('0x4c')]){_0x872c74[_0x193e('0x4d')]=[{'all':!![]}];}_0x872c74=_[_0x193e('0x4b')]({},_0x872c74,_0x3e2375['options']);return db[_0x193e('0x35')]['find'](_0x872c74)[_0x193e('0x2d')](handleEntityNotFound(_0x4bb64c,null))['then'](function(_0x5de2b7){if(_0x5de2b7){var _0x1b12de=_0x5de2b7[_0x193e('0x2f')]({'plain':!![]});_0x1b12de=qs['omit'](_0x1b12de,['id',_0x193e('0x5b'),_0x193e('0x5c')]);_0x3e2375['body']=_[_0x193e('0x5d')](_0x3e2375[_0x193e('0x5e')],['id',_0x193e('0x5b'),_0x193e('0x5c')]);return db[_0x193e('0x35')][_0x193e('0x53')](_[_0x193e('0x4b')](_0x1b12de,_0x3e2375[_0x193e('0x5e')]),{'include':_0x3e2375['query'][_0x193e('0x4c')]?[{'all':!![]}]:undefined})['then'](function(_0x2dceca){var _0x128548=_0x3e2375[_0x193e('0x56')][_0x193e('0x2f')]({'plain':!![]});if(!_0x128548)throw new Error(_0x193e('0x54'));if(_0x128548[_0x193e('0x55')]==='user'){var _0x181950=_0x2dceca[_0x193e('0x2f')]({'plain':!![]});var _0x59de07=_0x193e('0x57');return db[_0x193e('0x5f')]['find']({'where':{'name':_0x59de07,'userProfileId':_0x128548[_0x193e('0x58')]},'raw':!![]})[_0x193e('0x2d')](function(_0x15a469){if(_0x15a469&&_0x15a469[_0x193e('0x59')]===0x0){return db['UserProfileResource']['create']({'name':_0x181950['name'],'resourceId':_0x181950['id'],'type':_0x15a469[_0x193e('0x32')],'sectionId':_0x15a469['id']},{})[_0x193e('0x2d')](function(){return _0x2dceca;});}else{return _0x2dceca;}})[_0x193e('0x4f')](function(_0x534c13){logger[_0x193e('0x31')](_0x193e('0x5a'),_0x534c13);throw _0x534c13;});}return _0x2dceca;});}})[_0x193e('0x2d')](respondWithResult(_0x4bb64c,0xc9))['catch'](handleError(_0x4bb64c,null));};exports['update']=function(_0x2d1998,_0x47139c){if(_0x2d1998[_0x193e('0x5e')]['id']){delete _0x2d1998['body']['id'];}return db[_0x193e('0x35')][_0x193e('0x52')]({'where':{'id':_0x2d1998[_0x193e('0x50')]['id']}})[_0x193e('0x2d')](handleEntityNotFound(_0x47139c,null))['then'](saveUpdates(_0x2d1998['body'],null))[_0x193e('0x2d')](respondWithResult(_0x47139c,null))[_0x193e('0x4f')](handleError(_0x47139c,null));};exports[_0x193e('0x2e')]=function(_0x22cb64,_0x2d560a){return db[_0x193e('0x35')][_0x193e('0x52')]({'where':{'id':_0x22cb64[_0x193e('0x50')]['id']}})[_0x193e('0x2d')](handleEntityNotFound(_0x2d560a,null))[_0x193e('0x2d')](removeEntity(_0x2d560a,null))[_0x193e('0x4f')](handleError(_0x2d560a,null));};function widgetAttributes(_0x5bbdbc){try{switch(_0x5bbdbc[_0x193e('0x38')]){case'iframe':return[{'name':_0x193e('0x60'),'value':_0x5bbdbc[_0x193e('0x60')]||(_0x5bbdbc[_0x193e('0x61')]&&_0x5bbdbc[_0x193e('0x61')][0x0]?_0x5bbdbc[_0x193e('0x61')][0x0][_0x193e('0x62')]:undefined)||_0x193e('0x63')}];case'custom':return[{'name':_0x193e('0x64'),'value':_0x5bbdbc[_0x193e('0x64')]||(_0x5bbdbc['attrs']&&_0x5bbdbc['attrs'][0x0]?_0x5bbdbc[_0x193e('0x61')][0x0][_0x193e('0x62')]:undefined)||''}];case _0x193e('0x65'):return[{'name':_0x193e('0x66'),'value':_0x5bbdbc[_0x193e('0x66')]||(_0x5bbdbc[_0x193e('0x61')]&&_0x5bbdbc[_0x193e('0x61')][0x0]?_0x5bbdbc['attrs'][0x0][_0x193e('0x62')]:undefined)||_0x193e('0x67')},{'name':_0x193e('0x68'),'value':_0x5bbdbc[_0x193e('0x68')]||(_0x5bbdbc[_0x193e('0x61')]&&_0x5bbdbc['attrs'][0x1]?_0x5bbdbc[_0x193e('0x61')][0x1][_0x193e('0x62')]:undefined)||_0x193e('0x69')},{'name':'attrFontSize','value':_0x5bbdbc['attrFontSize']||(_0x5bbdbc[_0x193e('0x61')]&&_0x5bbdbc[_0x193e('0x61')][0x2]?_0x5bbdbc[_0x193e('0x61')][0x2][_0x193e('0x62')]:undefined)||0xc}];case _0x193e('0x6a'):return[{'name':_0x193e('0x6b'),'value':_0x5bbdbc[_0x193e('0x6b')]||(_0x5bbdbc['attrs']&&_0x5bbdbc[_0x193e('0x61')][0x0]?_0x5bbdbc[_0x193e('0x61')][0x0][_0x193e('0x62')]:undefined)||_0x193e('0x6c')},{'name':_0x193e('0x6d'),'value':_0x5bbdbc['attrVoiceQueues']||(_0x5bbdbc[_0x193e('0x61')]&&_0x5bbdbc['attrs'][0x1]?_0x5bbdbc[_0x193e('0x61')][0x1]['value']:undefined)||[]},{'name':'attrFontSize','value':_0x5bbdbc[_0x193e('0x6e')]||(_0x5bbdbc['attrs']&&_0x5bbdbc['attrs'][0x2]?_0x5bbdbc['attrs'][0x2][_0x193e('0x62')]:undefined)||0x14}];case _0x193e('0x6f'):case _0x193e('0x70'):return[{'name':'attrSerie1','value':_0x5bbdbc[_0x193e('0x71')]||(_0x5bbdbc[_0x193e('0x61')]&&_0x5bbdbc[_0x193e('0x61')][0x0]?_0x5bbdbc['attrs'][0x0]['value']:undefined)||_0x193e('0x6c')},{'name':_0x193e('0x72'),'value':_0x5bbdbc[_0x193e('0x72')]||(_0x5bbdbc[_0x193e('0x61')]&&_0x5bbdbc[_0x193e('0x61')][0x1]?_0x5bbdbc[_0x193e('0x61')][0x1]['value']:undefined)||null},{'name':'attrSerie3','value':_0x5bbdbc[_0x193e('0x73')]||(_0x5bbdbc[_0x193e('0x61')]&&_0x5bbdbc[_0x193e('0x61')][0x2]?_0x5bbdbc[_0x193e('0x61')][0x2][_0x193e('0x62')]:undefined)||null},{'name':_0x193e('0x6d'),'value':_0x5bbdbc['attrVoiceQueues']||(_0x5bbdbc[_0x193e('0x61')]&&_0x5bbdbc[_0x193e('0x61')][0x3]?_0x5bbdbc[_0x193e('0x61')][0x3]['value']:undefined)||[]}];case _0x193e('0x74'):return[{'name':_0x193e('0x75'),'type':_0x5bbdbc[_0x193e('0x76')]||(_0x5bbdbc[_0x193e('0x61')]&&_0x5bbdbc[_0x193e('0x61')][0x0]?_0x5bbdbc[_0x193e('0x61')][0x0][_0x193e('0x38')]:undefined)||null,'value':_0x5bbdbc['attrReport']||(_0x5bbdbc['attrs']&&_0x5bbdbc[_0x193e('0x61')][0x0]?_0x5bbdbc[_0x193e('0x61')][0x0][_0x193e('0x62')]:undefined)||null},{'name':_0x193e('0x77'),'value':_0x5bbdbc[_0x193e('0x77')]||(_0x5bbdbc[_0x193e('0x61')]&&_0x5bbdbc[_0x193e('0x61')][0x1]?_0x5bbdbc[_0x193e('0x61')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x2df79c){logger[_0x193e('0x31')](_0x193e('0x78'),JSON[_0x193e('0x79')](_0x2df79c));return[];}}exports['addItem']=function(_0x40de50,_0x2f335d,_0x1bdbcb){if(_0x40de50[_0x193e('0x5e')]['id']){delete _0x40de50['body']['id'];}return db['Dashboard']['find']({'where':{'id':_0x40de50['params']['id']}})[_0x193e('0x2d')](handleEntityNotFound(_0x2f335d,null))[_0x193e('0x2d')](function(_0xd3605b){if(_0xd3605b){_0x40de50[_0x193e('0x5e')][_0x193e('0x7a')]=_0xd3605b['id'];_0x40de50[_0x193e('0x5e')][_0x193e('0x61')]=widgetAttributes(_0x40de50[_0x193e('0x5e')]);return db[_0x193e('0x7b')][_0x193e('0x53')](_0x40de50[_0x193e('0x5e')]);}})['then'](respondWithResult(_0x2f335d,null))[_0x193e('0x4f')](handleError(_0x2f335d,null));};exports['getItems']=function(_0x1ac7c8,_0x153eb0,_0x35333a){var _0x2baf27={};var _0x5273df={};var _0x6ee640;var _0x30967f;return db['Dashboard']['findOne']({'where':{'id':_0x1ac7c8[_0x193e('0x50')]['id']}})['then'](handleEntityNotFound(_0x153eb0,null))['then'](function(_0x8f3340){if(_0x8f3340){_0x6ee640=_0x8f3340;_0x5273df[_0x193e('0x3a')]=_['keys'](db[_0x193e('0x7b')]['rawAttributes']);_0x5273df[_0x193e('0x3b')]=_['keys'](_0x1ac7c8[_0x193e('0x3b')]);_0x5273df[_0x193e('0x3d')]=_[_0x193e('0x3e')](_0x5273df[_0x193e('0x3a')],_0x5273df[_0x193e('0x3b')]);_0x2baf27[_0x193e('0x40')]=_[_0x193e('0x3e')](_0x5273df['model'],qs[_0x193e('0x3f')](_0x1ac7c8[_0x193e('0x3b')][_0x193e('0x3f')]));_0x2baf27[_0x193e('0x40')]=_0x2baf27[_0x193e('0x40')][_0x193e('0x41')]?_0x2baf27['attributes']:_0x5273df['model'];_0x2baf27['order']=qs['sort'](_0x1ac7c8[_0x193e('0x3b')][_0x193e('0x46')]);_0x2baf27[_0x193e('0x47')]=qs[_0x193e('0x3d')](_[_0x193e('0x7c')](_0x1ac7c8[_0x193e('0x3b')],_0x5273df['filters']));if(_0x1ac7c8[_0x193e('0x3b')][_0x193e('0x4a')]){_0x2baf27[_0x193e('0x47')]=_[_0x193e('0x4b')](_0x2baf27[_0x193e('0x47')],{'$or':_[_0x193e('0x34')](_0x2baf27[_0x193e('0x40')],function(_0x3c263a){var _0xda8795={};_0xda8795[_0x3c263a]={'$like':'%'+_0x1ac7c8['query'][_0x193e('0x4a')]+'%'};return _0xda8795;})});}_0x2baf27=_[_0x193e('0x4b')]({},_0x2baf27,_0x1ac7c8['options']);return _0x6ee640[_0x193e('0x7d')](_0x2baf27);}})[_0x193e('0x2d')](function(_0x136149){if(_0x136149){_0x30967f=_0x136149[_0x193e('0x41')];if(!_0x1ac7c8[_0x193e('0x3b')][_0x193e('0x42')](_0x193e('0x43'))){_0x2baf27['limit']=qs['limit'](_0x1ac7c8['query'][_0x193e('0x44')]);_0x2baf27[_0x193e('0x26')]=qs['offset'](_0x1ac7c8[_0x193e('0x3b')][_0x193e('0x26')]);}return _0x6ee640[_0x193e('0x7d')](_0x2baf27);}})['then'](function(_0x5ce40d){if(_0x5ce40d){return _0x5ce40d?{'count':_0x30967f,'rows':_0x5ce40d}:null;}})['then'](respondWithResult(_0x153eb0,null))[_0x193e('0x4f')](handleError(_0x153eb0,null));}; \ No newline at end of file +var _0x7f45=['attrReport','attrRefresh','addItem','findOne','DashboardItem','filter','getItems','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./dashboard.socket','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','then','destroy','get','UserProfileResource','error','name','index','map','Dashboard','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','field','options','includeAll','findAll','rows','params','include','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','omit','Unable\x20to\x20retrieve\x20the\x20current\x20user','update','type','attrUrl','attrs','value','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','web-report'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x7f45,0x79));var _0x57f4=function(_0x302735,_0x299314){_0x302735=_0x302735-0x0;var _0x3d7bdd=_0x7f45[_0x302735];return _0x3d7bdd;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x57f4('0x0'));var zipdir=require(_0x57f4('0x1'));var jsonpatch=require(_0x57f4('0x2'));var rp=require(_0x57f4('0x3'));var moment=require('moment');var BPromise=require(_0x57f4('0x4'));var Mustache=require(_0x57f4('0x5'));var util=require(_0x57f4('0x6'));var path=require(_0x57f4('0x7'));var sox=require(_0x57f4('0x8'));var csv=require(_0x57f4('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x57f4('0xa'));var squel=require(_0x57f4('0xb'));var crypto=require(_0x57f4('0xc'));var jsforce=require(_0x57f4('0xd'));var deskjs=require(_0x57f4('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x57f4('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x57f4('0x10'));var logger=require(_0x57f4('0x11'))(_0x57f4('0x12'));var utils=require(_0x57f4('0x13'));var config=require(_0x57f4('0x14'));var db=require(_0x57f4('0x15'))['db'];config[_0x57f4('0x16')]=_[_0x57f4('0x17')](config[_0x57f4('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x57f4('0x18'))(new Redis(config[_0x57f4('0x16')]));require(_0x57f4('0x19'))['register'](socket);function respondWithStatusCode(_0x558eac,_0x6eee7f){_0x6eee7f=_0x6eee7f||0xcc;return function(_0x2d1d28){if(_0x2d1d28){return _0x558eac[_0x57f4('0x1a')](_0x6eee7f);}return _0x558eac[_0x57f4('0x1b')](_0x6eee7f)[_0x57f4('0x1c')]();};}function respondWithResult(_0x390dd9,_0x18470e){_0x18470e=_0x18470e||0xc8;return function(_0x552134){if(_0x552134){return _0x390dd9['status'](_0x18470e)[_0x57f4('0x1d')](_0x552134);}};}function respondWithFilteredResult(_0x5574c3,_0x4bda25){return function(_0x180f54){if(_0x180f54){var _0x43cd18=_0x180f54[_0x57f4('0x1e')],_0x531fff=_0x4bda25[_0x57f4('0x1f')],_0xf65883=_0x4bda25['offset']+_0x4bda25[_0x57f4('0x20')],_0xe8f7ce;if(_0xf65883>=_0x43cd18){_0xf65883=_0x43cd18;_0xe8f7ce=0xc8;}else{_0xe8f7ce=0xce;}_0x5574c3['status'](_0xe8f7ce);return _0x5574c3['set'](_0x57f4('0x21'),_0x531fff+'-'+_0xf65883+'/'+_0x43cd18)[_0x57f4('0x1d')](_0x180f54);}return null;};}function patchUpdates(_0x4fb9f5){return function(_0x4caff0){try{jsonpatch[_0x57f4('0x22')](_0x4caff0,_0x4fb9f5,!![]);}catch(_0x586c29){return BPromise[_0x57f4('0x23')](_0x586c29);}return _0x4caff0[_0x57f4('0x24')]();};}function saveUpdates(_0x52d3c5,_0x208d19){return function(_0x1d91a7){if(_0x1d91a7){return _0x1d91a7['update'](_0x52d3c5)[_0x57f4('0x25')](function(_0x22eabc){return _0x22eabc;});}return null;};}function removeEntity(_0x5d3baf,_0x2a8f7d){return function(_0x1a3690){if(_0x1a3690){return _0x1a3690[_0x57f4('0x26')]()[_0x57f4('0x25')](function(){var _0x5c2f2a=_0x1a3690[_0x57f4('0x27')]({'plain':!![]});var _0x4b153e='CustomDashboards';return db[_0x57f4('0x28')]['destroy']({'where':{'type':_0x4b153e,'resourceId':_0x5c2f2a['id']}})[_0x57f4('0x25')](function(){return _0x1a3690;});})['then'](function(){_0x5d3baf['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xda959e,_0x8d007e){return function(_0x369558){if(!_0x369558){_0xda959e[_0x57f4('0x1a')](0x194);}return _0x369558;};}function handleError(_0x44764e,_0x1fde10){_0x1fde10=_0x1fde10||0x1f4;return function(_0x46e9c0){logger[_0x57f4('0x29')](_0x46e9c0['stack']);if(_0x46e9c0[_0x57f4('0x2a')]){delete _0x46e9c0['name'];}_0x44764e[_0x57f4('0x1b')](_0x1fde10)['send'](_0x46e9c0);};}exports[_0x57f4('0x2b')]=function(_0x4147be,_0x393386){var _0xa326d7={},_0x1cd741={},_0x5a3a7b={'count':0x0,'rows':[]};var _0x41645a=_[_0x57f4('0x2c')](db[_0x57f4('0x2d')][_0x57f4('0x2e')],function(_0x47a51c){return{'name':_0x47a51c[_0x57f4('0x2f')],'type':_0x47a51c['type']['key']};});_0x1cd741[_0x57f4('0x30')]=_[_0x57f4('0x2c')](_0x41645a,_0x57f4('0x2a'));_0x1cd741[_0x57f4('0x31')]=_[_0x57f4('0x32')](_0x4147be[_0x57f4('0x31')]);_0x1cd741[_0x57f4('0x33')]=_[_0x57f4('0x34')](_0x1cd741[_0x57f4('0x30')],_0x1cd741['query']);_0xa326d7[_0x57f4('0x35')]=_[_0x57f4('0x34')](_0x1cd741[_0x57f4('0x30')],qs[_0x57f4('0x36')](_0x4147be[_0x57f4('0x31')]['fields']));_0xa326d7['attributes']=_0xa326d7[_0x57f4('0x35')][_0x57f4('0x37')]?_0xa326d7[_0x57f4('0x35')]:_0x1cd741[_0x57f4('0x30')];if(!_0x4147be[_0x57f4('0x31')][_0x57f4('0x38')](_0x57f4('0x39'))){_0xa326d7[_0x57f4('0x20')]=qs[_0x57f4('0x20')](_0x4147be[_0x57f4('0x31')][_0x57f4('0x20')]);_0xa326d7['offset']=qs[_0x57f4('0x1f')](_0x4147be[_0x57f4('0x31')]['offset']);}_0xa326d7['order']=qs[_0x57f4('0x3a')](_0x4147be['query'][_0x57f4('0x3a')]);_0xa326d7[_0x57f4('0x3b')]=qs[_0x57f4('0x33')](_[_0x57f4('0x3c')](_0x4147be[_0x57f4('0x31')],_0x1cd741[_0x57f4('0x33')]));if(_0x4147be[_0x57f4('0x31')]['filter']){_0xa326d7['where']=_[_0x57f4('0x3d')](_0xa326d7[_0x57f4('0x3b')],{'$or':_[_0x57f4('0x2c')](_0x41645a,function(_0x24c9b4){if(_0x24c9b4['type']['key']!==_0x57f4('0x3e')){var _0x28a8e9={};_0x28a8e9[_0x24c9b4[_0x57f4('0x3f')]]={'$like':'%'+_0x4147be['query']['filter']+'%'};return _0x28a8e9;}})});}_0xa326d7=_[_0x57f4('0x3d')]({},_0xa326d7,_0x4147be[_0x57f4('0x40')]);var _0x424c95={'where':_0xa326d7[_0x57f4('0x3b')]};return db[_0x57f4('0x2d')][_0x57f4('0x1e')](_0x424c95)[_0x57f4('0x25')](function(_0x4c4e0b){_0x5a3a7b['count']=_0x4c4e0b;if(_0x4147be[_0x57f4('0x31')][_0x57f4('0x41')]){_0xa326d7['include']=[{'all':!![]}];}return db['Dashboard'][_0x57f4('0x42')](_0xa326d7);})[_0x57f4('0x25')](function(_0x282c5b){_0x5a3a7b[_0x57f4('0x43')]=_0x282c5b;return _0x5a3a7b;})[_0x57f4('0x25')](respondWithFilteredResult(_0x393386,_0xa326d7))['catch'](handleError(_0x393386,null));};exports['show']=function(_0x345bd9,_0x51135c){var _0xe8db44={'raw':![],'where':{'id':_0x345bd9[_0x57f4('0x44')]['id']}},_0x24ede0={};_0x24ede0[_0x57f4('0x30')]=_[_0x57f4('0x32')](db[_0x57f4('0x2d')][_0x57f4('0x2e')]);_0x24ede0['query']=_['keys'](_0x345bd9[_0x57f4('0x31')]);_0x24ede0[_0x57f4('0x33')]=_[_0x57f4('0x34')](_0x24ede0[_0x57f4('0x30')],_0x24ede0[_0x57f4('0x31')]);_0xe8db44[_0x57f4('0x35')]=_[_0x57f4('0x34')](_0x24ede0['model'],qs[_0x57f4('0x36')](_0x345bd9[_0x57f4('0x31')][_0x57f4('0x36')]));_0xe8db44[_0x57f4('0x35')]=_0xe8db44[_0x57f4('0x35')][_0x57f4('0x37')]?_0xe8db44['attributes']:_0x24ede0[_0x57f4('0x30')];if(_0x345bd9[_0x57f4('0x31')][_0x57f4('0x41')]){_0xe8db44[_0x57f4('0x45')]=[{'all':!![]}];}_0xe8db44=_[_0x57f4('0x3d')]({},_0xe8db44,_0x345bd9[_0x57f4('0x40')]);return db[_0x57f4('0x2d')][_0x57f4('0x46')](_0xe8db44)['then'](handleEntityNotFound(_0x51135c,null))[_0x57f4('0x25')](respondWithResult(_0x51135c,null))['catch'](handleError(_0x51135c,null));};exports[_0x57f4('0x47')]=function(_0x3b8670,_0x59b4f4){return db[_0x57f4('0x2d')][_0x57f4('0x47')](_0x3b8670[_0x57f4('0x48')],{})[_0x57f4('0x25')](function(_0x572ef7){var _0x34df23=_0x3b8670[_0x57f4('0x49')]['get']({'plain':!![]});if(!_0x34df23)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x34df23[_0x57f4('0x4a')]===_0x57f4('0x49')){var _0x5dd423=_0x572ef7['get']({'plain':!![]});var _0x294fe1='CustomDashboards';return db[_0x57f4('0x4b')][_0x57f4('0x46')]({'where':{'name':_0x294fe1,'userProfileId':_0x34df23[_0x57f4('0x4c')]},'raw':!![]})[_0x57f4('0x25')](function(_0x4ddcc8){if(_0x4ddcc8&&_0x4ddcc8[_0x57f4('0x4d')]===0x0){return db['UserProfileResource']['create']({'name':_0x5dd423[_0x57f4('0x2a')],'resourceId':_0x5dd423['id'],'type':_0x4ddcc8[_0x57f4('0x2a')],'sectionId':_0x4ddcc8['id']},{})[_0x57f4('0x25')](function(){return _0x572ef7;});}else{return _0x572ef7;}})[_0x57f4('0x4e')](function(_0x3ca0e6){logger['error'](_0x57f4('0x4f'),_0x3ca0e6);throw _0x3ca0e6;});}return _0x572ef7;})[_0x57f4('0x25')](respondWithResult(_0x59b4f4,0xc9))[_0x57f4('0x4e')](handleError(_0x59b4f4,null));};exports[_0x57f4('0x50')]=function(_0x554a5e,_0x3241e2){var _0x3f7f41={'raw':![],'where':{'id':_0x554a5e[_0x57f4('0x44')]['id']}},_0x4744dc={};_0x4744dc['model']=_['keys'](db[_0x57f4('0x2d')][_0x57f4('0x2e')]);_0x3f7f41['attributes']=_[_0x57f4('0x34')](_0x4744dc[_0x57f4('0x30')],qs[_0x57f4('0x36')](_0x554a5e[_0x57f4('0x31')]['fields']));_0x3f7f41['attributes']=_0x3f7f41[_0x57f4('0x35')][_0x57f4('0x37')]?_0x3f7f41[_0x57f4('0x35')]:_0x4744dc[_0x57f4('0x30')];if(_0x554a5e[_0x57f4('0x31')]['includeAll']){_0x3f7f41[_0x57f4('0x45')]=[{'all':!![]}];}_0x3f7f41=_[_0x57f4('0x3d')]({},_0x3f7f41,_0x554a5e[_0x57f4('0x40')]);return db['Dashboard'][_0x57f4('0x46')](_0x3f7f41)[_0x57f4('0x25')](handleEntityNotFound(_0x3241e2,null))[_0x57f4('0x25')](function(_0x80e083){if(_0x80e083){var _0x1c7ac6=_0x80e083[_0x57f4('0x27')]({'plain':!![]});_0x1c7ac6=qs['omit'](_0x1c7ac6,['id',_0x57f4('0x51'),_0x57f4('0x52')]);_0x554a5e[_0x57f4('0x48')]=_[_0x57f4('0x53')](_0x554a5e[_0x57f4('0x48')],['id',_0x57f4('0x51'),_0x57f4('0x52')]);return db[_0x57f4('0x2d')][_0x57f4('0x47')](_['merge'](_0x1c7ac6,_0x554a5e[_0x57f4('0x48')]),{'include':_0x554a5e[_0x57f4('0x31')][_0x57f4('0x41')]?[{'all':!![]}]:undefined})[_0x57f4('0x25')](function(_0x1bec07){var _0x360fa9=_0x554a5e[_0x57f4('0x49')][_0x57f4('0x27')]({'plain':!![]});if(!_0x360fa9)throw new Error(_0x57f4('0x54'));if(_0x360fa9[_0x57f4('0x4a')]==='user'){var _0x320383=_0x1bec07[_0x57f4('0x27')]({'plain':!![]});var _0x3eab11='CustomDashboards';return db[_0x57f4('0x4b')][_0x57f4('0x46')]({'where':{'name':_0x3eab11,'userProfileId':_0x360fa9[_0x57f4('0x4c')]},'raw':!![]})[_0x57f4('0x25')](function(_0x1cfcad){if(_0x1cfcad&&_0x1cfcad[_0x57f4('0x4d')]===0x0){return db[_0x57f4('0x28')][_0x57f4('0x47')]({'name':_0x320383[_0x57f4('0x2a')],'resourceId':_0x320383['id'],'type':_0x1cfcad[_0x57f4('0x2a')],'sectionId':_0x1cfcad['id']},{})['then'](function(){return _0x1bec07;});}else{return _0x1bec07;}})['catch'](function(_0x314686){logger[_0x57f4('0x29')](_0x57f4('0x4f'),_0x314686);throw _0x314686;});}return _0x1bec07;});}})['then'](respondWithResult(_0x3241e2,0xc9))[_0x57f4('0x4e')](handleError(_0x3241e2,null));};exports[_0x57f4('0x55')]=function(_0x4a4d3b,_0x32386e){if(_0x4a4d3b[_0x57f4('0x48')]['id']){delete _0x4a4d3b[_0x57f4('0x48')]['id'];}return db[_0x57f4('0x2d')][_0x57f4('0x46')]({'where':{'id':_0x4a4d3b[_0x57f4('0x44')]['id']}})[_0x57f4('0x25')](handleEntityNotFound(_0x32386e,null))['then'](saveUpdates(_0x4a4d3b[_0x57f4('0x48')],null))['then'](respondWithResult(_0x32386e,null))[_0x57f4('0x4e')](handleError(_0x32386e,null));};exports[_0x57f4('0x26')]=function(_0x10c976,_0x1935a6){return db[_0x57f4('0x2d')][_0x57f4('0x46')]({'where':{'id':_0x10c976[_0x57f4('0x44')]['id']}})[_0x57f4('0x25')](handleEntityNotFound(_0x1935a6,null))[_0x57f4('0x25')](removeEntity(_0x1935a6,null))['catch'](handleError(_0x1935a6,null));};function widgetAttributes(_0x56423e){try{switch(_0x56423e[_0x57f4('0x56')]){case'iframe':return[{'name':_0x57f4('0x57'),'value':_0x56423e[_0x57f4('0x57')]||(_0x56423e[_0x57f4('0x58')]&&_0x56423e['attrs'][0x0]?_0x56423e[_0x57f4('0x58')][0x0][_0x57f4('0x59')]:undefined)||'https://'}];case _0x57f4('0x5a'):return[{'name':'attrPath','value':_0x56423e[_0x57f4('0x5b')]||(_0x56423e[_0x57f4('0x58')]&&_0x56423e[_0x57f4('0x58')][0x0]?_0x56423e[_0x57f4('0x58')][0x0][_0x57f4('0x59')]:undefined)||''}];case _0x57f4('0x5c'):return[{'name':_0x57f4('0x5d'),'value':_0x56423e[_0x57f4('0x5d')]||(_0x56423e[_0x57f4('0x58')]&&_0x56423e['attrs'][0x0]?_0x56423e[_0x57f4('0x58')][0x0][_0x57f4('0x59')]:undefined)||_0x57f4('0x5e')},{'name':_0x57f4('0x5f'),'value':_0x56423e[_0x57f4('0x5f')]||(_0x56423e['attrs']&&_0x56423e[_0x57f4('0x58')][0x1]?_0x56423e[_0x57f4('0x58')][0x1][_0x57f4('0x59')]:undefined)||_0x57f4('0x60')},{'name':_0x57f4('0x61'),'value':_0x56423e['attrFontSize']||(_0x56423e[_0x57f4('0x58')]&&_0x56423e[_0x57f4('0x58')][0x2]?_0x56423e[_0x57f4('0x58')][0x2][_0x57f4('0x59')]:undefined)||0xc}];case _0x57f4('0x62'):return[{'name':'attrMetric','value':_0x56423e[_0x57f4('0x63')]||(_0x56423e['attrs']&&_0x56423e[_0x57f4('0x58')][0x0]?_0x56423e[_0x57f4('0x58')][0x0]['value']:undefined)||_0x57f4('0x64')},{'name':_0x57f4('0x65'),'value':_0x56423e['attrVoiceQueues']||(_0x56423e['attrs']&&_0x56423e['attrs'][0x1]?_0x56423e[_0x57f4('0x58')][0x1][_0x57f4('0x59')]:undefined)||[]},{'name':_0x57f4('0x61'),'value':_0x56423e[_0x57f4('0x61')]||(_0x56423e[_0x57f4('0x58')]&&_0x56423e[_0x57f4('0x58')][0x2]?_0x56423e[_0x57f4('0x58')][0x2]['value']:undefined)||0x14}];case _0x57f4('0x66'):case _0x57f4('0x67'):return[{'name':'attrSerie1','value':_0x56423e[_0x57f4('0x68')]||(_0x56423e[_0x57f4('0x58')]&&_0x56423e[_0x57f4('0x58')][0x0]?_0x56423e[_0x57f4('0x58')][0x0][_0x57f4('0x59')]:undefined)||_0x57f4('0x64')},{'name':'attrSerie2','value':_0x56423e[_0x57f4('0x69')]||(_0x56423e[_0x57f4('0x58')]&&_0x56423e['attrs'][0x1]?_0x56423e[_0x57f4('0x58')][0x1][_0x57f4('0x59')]:undefined)||null},{'name':'attrSerie3','value':_0x56423e['attrSerie3']||(_0x56423e[_0x57f4('0x58')]&&_0x56423e[_0x57f4('0x58')][0x2]?_0x56423e[_0x57f4('0x58')][0x2][_0x57f4('0x59')]:undefined)||null},{'name':_0x57f4('0x65'),'value':_0x56423e['attrVoiceQueues']||(_0x56423e[_0x57f4('0x58')]&&_0x56423e[_0x57f4('0x58')][0x3]?_0x56423e[_0x57f4('0x58')][0x3]['value']:undefined)||[]}];case _0x57f4('0x6a'):return[{'name':_0x57f4('0x6b'),'type':_0x56423e['reportType']||(_0x56423e[_0x57f4('0x58')]&&_0x56423e[_0x57f4('0x58')][0x0]?_0x56423e[_0x57f4('0x58')][0x0]['type']:undefined)||null,'value':_0x56423e[_0x57f4('0x6b')]||(_0x56423e[_0x57f4('0x58')]&&_0x56423e[_0x57f4('0x58')][0x0]?_0x56423e[_0x57f4('0x58')][0x0][_0x57f4('0x59')]:undefined)||null},{'name':_0x57f4('0x6c'),'value':_0x56423e[_0x57f4('0x6c')]||(_0x56423e[_0x57f4('0x58')]&&_0x56423e[_0x57f4('0x58')][0x1]?_0x56423e['attrs'][0x1][_0x57f4('0x59')]:undefined)||0x0}];default:return[];}}catch(_0x256c43){logger['error']('widgetAttributes:\x20%s',JSON['stringify'](_0x256c43));return[];}}exports[_0x57f4('0x6d')]=function(_0x3ceafa,_0x3e0899,_0x2de85c){if(_0x3ceafa[_0x57f4('0x48')]['id']){delete _0x3ceafa[_0x57f4('0x48')]['id'];}return db[_0x57f4('0x2d')][_0x57f4('0x46')]({'where':{'id':_0x3ceafa[_0x57f4('0x44')]['id']}})[_0x57f4('0x25')](handleEntityNotFound(_0x3e0899,null))[_0x57f4('0x25')](function(_0x4e69ab){if(_0x4e69ab){_0x3ceafa[_0x57f4('0x48')]['DashboardId']=_0x4e69ab['id'];_0x3ceafa[_0x57f4('0x48')][_0x57f4('0x58')]=widgetAttributes(_0x3ceafa['body']);return db['DashboardItem'][_0x57f4('0x47')](_0x3ceafa[_0x57f4('0x48')]);}})[_0x57f4('0x25')](respondWithResult(_0x3e0899,null))[_0x57f4('0x4e')](handleError(_0x3e0899,null));};exports['getItems']=function(_0x500b34,_0x177b1c,_0x2638d3){var _0x1fb382={};var _0x3ac956={};var _0xd1f6bc;var _0x3a4df9;return db['Dashboard'][_0x57f4('0x6e')]({'where':{'id':_0x500b34[_0x57f4('0x44')]['id']}})[_0x57f4('0x25')](handleEntityNotFound(_0x177b1c,null))['then'](function(_0x329491){if(_0x329491){_0xd1f6bc=_0x329491;_0x3ac956[_0x57f4('0x30')]=_[_0x57f4('0x32')](db[_0x57f4('0x6f')][_0x57f4('0x2e')]);_0x3ac956['query']=_[_0x57f4('0x32')](_0x500b34[_0x57f4('0x31')]);_0x3ac956[_0x57f4('0x33')]=_[_0x57f4('0x34')](_0x3ac956['model'],_0x3ac956['query']);_0x1fb382[_0x57f4('0x35')]=_[_0x57f4('0x34')](_0x3ac956[_0x57f4('0x30')],qs[_0x57f4('0x36')](_0x500b34['query'][_0x57f4('0x36')]));_0x1fb382[_0x57f4('0x35')]=_0x1fb382['attributes'][_0x57f4('0x37')]?_0x1fb382[_0x57f4('0x35')]:_0x3ac956[_0x57f4('0x30')];_0x1fb382['order']=qs[_0x57f4('0x3a')](_0x500b34[_0x57f4('0x31')][_0x57f4('0x3a')]);_0x1fb382[_0x57f4('0x3b')]=qs[_0x57f4('0x33')](_[_0x57f4('0x3c')](_0x500b34[_0x57f4('0x31')],_0x3ac956[_0x57f4('0x33')]));if(_0x500b34[_0x57f4('0x31')][_0x57f4('0x70')]){_0x1fb382['where']=_['merge'](_0x1fb382[_0x57f4('0x3b')],{'$or':_[_0x57f4('0x2c')](_0x1fb382['attributes'],function(_0x2110cf){var _0x43be7d={};_0x43be7d[_0x2110cf]={'$like':'%'+_0x500b34[_0x57f4('0x31')][_0x57f4('0x70')]+'%'};return _0x43be7d;})});}_0x1fb382=_['merge']({},_0x1fb382,_0x500b34[_0x57f4('0x40')]);return _0xd1f6bc[_0x57f4('0x71')](_0x1fb382);}})[_0x57f4('0x25')](function(_0x42441){if(_0x42441){_0x3a4df9=_0x42441['length'];if(!_0x500b34[_0x57f4('0x31')]['hasOwnProperty'](_0x57f4('0x39'))){_0x1fb382[_0x57f4('0x20')]=qs[_0x57f4('0x20')](_0x500b34['query'][_0x57f4('0x20')]);_0x1fb382['offset']=qs[_0x57f4('0x1f')](_0x500b34[_0x57f4('0x31')][_0x57f4('0x1f')]);}return _0xd1f6bc['getItems'](_0x1fb382);}})[_0x57f4('0x25')](function(_0x2cb559){if(_0x2cb559){return _0x2cb559?{'count':_0x3a4df9,'rows':_0x2cb559}:null;}})[_0x57f4('0x25')](respondWithResult(_0x177b1c,null))[_0x57f4('0x4e')](handleError(_0x177b1c,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 07f75a4..17e6eec 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 _0x2984=['setMaxListeners','update','remove','emit','hook','exports','../../mysqldb','Dashboard'];(function(_0x1dd5dc,_0x3a211a){var _0x5b93b5=function(_0x57fbe3){while(--_0x57fbe3){_0x1dd5dc['push'](_0x1dd5dc['shift']());}};_0x5b93b5(++_0x3a211a);}(_0x2984,0xae));var _0x4298=function(_0x4559d6,_0x21ff92){_0x4559d6=_0x4559d6-0x0;var _0x3b77ae=_0x2984[_0x4559d6];return _0x3b77ae;};'use strict';var EventEmitter=require('events');var Dashboard=require(_0x4298('0x0'))['db'][_0x4298('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x4298('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4298('0x3'),'afterDestroy':_0x4298('0x4')};function emitEvent(_0x555c47){return function(_0xaccb26,_0xe8665,_0x3534e4){DashboardEvents[_0x4298('0x5')](_0x555c47+':'+_0xaccb26['id'],_0xaccb26);DashboardEvents[_0x4298('0x5')](_0x555c47,_0xaccb26);_0x3534e4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0x4298('0x6')](e,emitEvent(event));}}module[_0x4298('0x7')]=DashboardEvents; \ No newline at end of file +var _0xe4a6=['hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','hasOwnProperty'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xe4a6,0x17c));var _0x6e4a=function(_0x40044c,_0x5b37c7){_0x40044c=_0x40044c-0x0;var _0x5d6177=_0xe4a6[_0x40044c];return _0x5d6177;};'use strict';var EventEmitter=require(_0x6e4a('0x0'));var Dashboard=require(_0x6e4a('0x1'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0x6e4a('0x2')](0x0);var events={'afterCreate':_0x6e4a('0x3'),'afterUpdate':_0x6e4a('0x4'),'afterDestroy':_0x6e4a('0x5')};function emitEvent(_0x430760){return function(_0xd5f811,_0x1c73b1,_0x58e8dd){DashboardEvents['emit'](_0x430760+':'+_0xd5f811['id'],_0xd5f811);DashboardEvents['emit'](_0x430760,_0xd5f811);_0x58e8dd(null);};}for(var e in events){if(events[_0x6e4a('0x6')](e)){var event=events[e];Dashboard[_0x6e4a('0x7')](e,emitEvent(event));}}module[_0x6e4a('0x8')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 06f4a38..dea8cd6 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 _0x2a85=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./dashboard.attributes','exports','define','Dashboard','lodash','util'];(function(_0x3e322b,_0x283893){var _0x48a70e=function(_0x2ff351){while(--_0x2ff351){_0x3e322b['push'](_0x3e322b['shift']());}};_0x48a70e(++_0x283893);}(_0x2a85,0x102));var _0x52a8=function(_0x3d48bf,_0x15d68e){_0x3d48bf=_0x3d48bf-0x0;var _0x442b55=_0x2a85[_0x3d48bf];return _0x442b55;};'use strict';var _=require(_0x52a8('0x0'));var util=require(_0x52a8('0x1'));var logger=require(_0x52a8('0x2'))(_0x52a8('0x3'));var moment=require(_0x52a8('0x4'));var BPromise=require(_0x52a8('0x5'));var rp=require(_0x52a8('0x6'));var fs=require('fs');var path=require(_0x52a8('0x7'));var rimraf=require(_0x52a8('0x8'));var config=require('../../config/environment');var attributes=require(_0x52a8('0x9'));module[_0x52a8('0xa')]=function(_0x589e42,_0x15ff9c){return _0x589e42[_0x52a8('0xb')](_0x52a8('0xc'),attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0a65=['path','rimraf','../../config/environment','exports','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0x0a65,0xc2));var _0x50a6=function(_0x139c3c,_0x326801){_0x139c3c=_0x139c3c-0x0;var _0x335f96=_0x0a65[_0x139c3c];return _0x335f96;};'use strict';var _=require(_0x50a6('0x0'));var util=require('util');var logger=require(_0x50a6('0x1'))(_0x50a6('0x2'));var moment=require(_0x50a6('0x3'));var BPromise=require(_0x50a6('0x4'));var rp=require(_0x50a6('0x5'));var fs=require('fs');var path=require(_0x50a6('0x6'));var rimraf=require(_0x50a6('0x7'));var config=require(_0x50a6('0x8'));var attributes=require('./dashboard.attributes');module[_0x50a6('0x9')]=function(_0x39db6b,_0x5b08b8){return _0x39db6b['define']('Dashboard',attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js index e9b1aa1..63b8c3e 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 _0xf9ba=['then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','./dashboard.socket','register','request'];(function(_0x238dd0,_0x2fe041){var _0x3647cb=function(_0xbb9b9){while(--_0xbb9b9){_0x238dd0['push'](_0x238dd0['shift']());}};_0x3647cb(++_0x2fe041);}(_0xf9ba,0xd3));var _0xaf9b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf9ba[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xaf9b('0x0'));var util=require('util');var moment=require(_0xaf9b('0x1'));var BPromise=require(_0xaf9b('0x2'));var rs=require(_0xaf9b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaf9b('0x4'))(_0xaf9b('0x5'));var config=require(_0xaf9b('0x6'));var jayson=require(_0xaf9b('0x7'));var client=jayson['client'][_0xaf9b('0x8')]({'port':0x232a});config['redis']=_[_0xaf9b('0x9')](config[_0xaf9b('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaf9b('0xa')]));require(_0xaf9b('0xb'))[_0xaf9b('0xc')](socket);function respondWithRpcPromise(_0x549954,_0x18fa97,_0x4f50a5){return new BPromise(function(_0x402568,_0xba1f79){return client[_0xaf9b('0xd')](_0x549954,_0x4f50a5)[_0xaf9b('0xe')](function(_0x31a3d4){logger[_0xaf9b('0xf')](_0xaf9b('0x10'),_0x18fa97,_0xaf9b('0x11'));logger[_0xaf9b('0x12')](_0xaf9b('0x13'),_0x18fa97,_0xaf9b('0x11'),JSON[_0xaf9b('0x14')](_0x31a3d4));if(_0x31a3d4[_0xaf9b('0x15')]){if(_0x31a3d4[_0xaf9b('0x15')]['code']===0x1f4){logger[_0xaf9b('0x15')](_0xaf9b('0x10'),_0x18fa97,_0x31a3d4[_0xaf9b('0x15')][_0xaf9b('0x16')]);return _0xba1f79(_0x31a3d4[_0xaf9b('0x15')][_0xaf9b('0x16')]);}logger[_0xaf9b('0x15')]('Dashboard,\x20%s,\x20%s',_0x18fa97,_0x31a3d4[_0xaf9b('0x15')][_0xaf9b('0x16')]);return _0x402568(_0x31a3d4['error'][_0xaf9b('0x16')]);}else{logger[_0xaf9b('0xf')](_0xaf9b('0x10'),_0x18fa97,_0xaf9b('0x11'));_0x402568(_0x31a3d4[_0xaf9b('0x17')]['message']);}})[_0xaf9b('0x18')](function(_0x5eeefd){logger['error'](_0xaf9b('0x10'),_0x18fa97,_0x5eeefd);_0xba1f79(_0x5eeefd);});});} \ No newline at end of file +var _0x068f=['rpc','jayson/promise','client','redis','defaults','socket.io-emitter','./dashboard.socket','register','request','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','error','code','message','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0xf72786,_0x1a0ddd){var _0x113f3e=function(_0x57337a){while(--_0x57337a){_0xf72786['push'](_0xf72786['shift']());}};_0x113f3e(++_0x1a0ddd);}(_0x068f,0x17a));var _0xf068=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0x068f[_0x40220a];return _0x3903cc;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xf068('0x0'));var rs=require(_0xf068('0x1'));var fs=require('fs');var Redis=require(_0xf068('0x2'));var db=require(_0xf068('0x3'))['db'];var utils=require(_0xf068('0x4'));var logger=require(_0xf068('0x5'))(_0xf068('0x6'));var config=require('../../config/environment');var jayson=require(_0xf068('0x7'));var client=jayson[_0xf068('0x8')]['http']({'port':0x232a});config[_0xf068('0x9')]=_[_0xf068('0xa')](config[_0xf068('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xf068('0xb'))(new Redis(config['redis']));require(_0xf068('0xc'))[_0xf068('0xd')](socket);function respondWithRpcPromise(_0x28016d,_0x49b7b2,_0x3b8cb1){return new BPromise(function(_0x6242d0,_0x48c3c6){return client[_0xf068('0xe')](_0x28016d,_0x3b8cb1)['then'](function(_0x63a1a0){logger[_0xf068('0xf')](_0xf068('0x10'),_0x49b7b2,_0xf068('0x11'));logger[_0xf068('0x12')](_0xf068('0x13'),_0x49b7b2,_0xf068('0x11'),JSON['stringify'](_0x63a1a0));if(_0x63a1a0[_0xf068('0x14')]){if(_0x63a1a0['error'][_0xf068('0x15')]===0x1f4){logger[_0xf068('0x14')](_0xf068('0x10'),_0x49b7b2,_0x63a1a0[_0xf068('0x14')][_0xf068('0x16')]);return _0x48c3c6(_0x63a1a0[_0xf068('0x14')][_0xf068('0x16')]);}logger[_0xf068('0x14')](_0xf068('0x10'),_0x49b7b2,_0x63a1a0['error'][_0xf068('0x16')]);return _0x6242d0(_0x63a1a0[_0xf068('0x14')][_0xf068('0x16')]);}else{logger[_0xf068('0xf')](_0xf068('0x10'),_0x49b7b2,'request\x20sent');_0x6242d0(_0x63a1a0['result'][_0xf068('0x16')]);}})[_0xf068('0x17')](function(_0x19cd34){logger[_0xf068('0x14')](_0xf068('0x10'),_0x49b7b2,_0x19cd34);_0x48c3c6(_0x19cd34);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 586013a..ad6f147 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 _0x0494=['register','dashboard:','save','remove','update','emit','removeListener'];(function(_0x378b4,_0x5ca7fa){var _0x11d07b=function(_0x35d420){while(--_0x35d420){_0x378b4['push'](_0x378b4['shift']());}};_0x11d07b(++_0x5ca7fa);}(_0x0494,0x12f));var _0x4049=function(_0x8bd10,_0x37bb41){_0x8bd10=_0x8bd10-0x0;var _0x41d5d2=_0x0494[_0x8bd10];return _0x41d5d2;};'use strict';var DashboardEvents=require('./dashboard.events');var events=[_0x4049('0x0'),_0x4049('0x1'),_0x4049('0x2')];function createListener(_0x1be4e0,_0x72ce42){return function(_0x43a8df){_0x72ce42[_0x4049('0x3')](_0x1be4e0,_0x43a8df);};}function removeListener(_0x437463,_0x34e7fa){return function(){DashboardEvents[_0x4049('0x4')](_0x437463,_0x34e7fa);};}exports[_0x4049('0x5')]=function(_0x50dcac){for(var _0x16972b=0x0,_0x5e789a=events['length'];_0x16972b<_0x5e789a;_0x16972b++){var _0x1159f8=events[_0x16972b];var _0x3bb5a0=createListener(_0x4049('0x6')+_0x1159f8,_0x50dcac);DashboardEvents['on'](_0x1159f8,_0x3bb5a0);}}; \ No newline at end of file +var _0x0c4a=['length','dashboard:','./dashboard.events','remove','removeListener','register'];(function(_0x1777da,_0x31d4c4){var _0x382d0f=function(_0x50c3ec){while(--_0x50c3ec){_0x1777da['push'](_0x1777da['shift']());}};_0x382d0f(++_0x31d4c4);}(_0x0c4a,0x110));var _0xa0c4=function(_0x10a535,_0x574d1c){_0x10a535=_0x10a535-0x0;var _0x2544e3=_0x0c4a[_0x10a535];return _0x2544e3;};'use strict';var DashboardEvents=require(_0xa0c4('0x0'));var events=['save',_0xa0c4('0x1'),'update'];function createListener(_0x1929a4,_0x496e29){return function(_0x351eea){_0x496e29['emit'](_0x1929a4,_0x351eea);};}function removeListener(_0x1f3d9f,_0xbd0762){return function(){DashboardEvents[_0xa0c4('0x2')](_0x1f3d9f,_0xbd0762);};}exports[_0xa0c4('0x3')]=function(_0x28edd9){for(var _0xa50cbc=0x0,_0x17e52d=events[_0xa0c4('0x4')];_0xa50cbc<_0x17e52d;_0xa50cbc++){var _0x468e90=events[_0xa50cbc];var _0x56e999=createListener(_0xa0c4('0x5')+_0x468e90,_0x28edd9);DashboardEvents['on'](_0x468e90,_0x56e999);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index d23d5f7..dc797f1 100644 --- a/server/api/dashboard/index.js +++ b/server/api/dashboard/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['exports','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','/:id','show','/:id/items','getItems','create','post','/:id/clone','addItem','put','update'];(function(_0x8ce18d,_0x44babb){var _0x2f5071=function(_0x218a05){while(--_0x218a05){_0x8ce18d['push'](_0x8ce18d['shift']());}};_0x2f5071(++_0x44babb);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var auth=require(_0x3071('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x3071('0x5'));var controller=require(_0x3071('0x6'));router[_0x3071('0x7')]('/',auth[_0x3071('0x8')](),controller[_0x3071('0x9')]);router[_0x3071('0x7')](_0x3071('0xa'),auth[_0x3071('0x8')](),controller[_0x3071('0xb')]);router[_0x3071('0x7')](_0x3071('0xc'),auth[_0x3071('0x8')](),controller[_0x3071('0xd')]);router['post']('/',auth[_0x3071('0x8')](),controller[_0x3071('0xe')]);router[_0x3071('0xf')](_0x3071('0x10'),auth[_0x3071('0x8')](),controller['clone']);router[_0x3071('0xf')](_0x3071('0xc'),auth[_0x3071('0x8')](),controller[_0x3071('0x11')]);router[_0x3071('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x3071('0x13')]);router['delete'](_0x3071('0xa'),auth[_0x3071('0x8')](),controller['destroy']);module[_0x3071('0x14')]=router; \ No newline at end of file +var _0xa9e0=['/:id','/:id/items','post','create','/:id/clone','addItem','put','update','delete','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated'];(function(_0x455177,_0x348acb){var _0x3b39c5=function(_0x3e83b9){while(--_0x3e83b9){_0x455177['push'](_0x455177['shift']());}};_0x3b39c5(++_0x348acb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xa9e0[_0x521929];return _0x632436;};'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['getItems']);router[_0x0a9e('0xb')]('/',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0xb')](_0x0a9e('0xd'),auth[_0x0a9e('0x8')](),controller['clone']);router['post']('/:id/items',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')]('/:id',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x12')]);module[_0x0a9e('0x13')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 68fef17..c87fbb6 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 _0xe425=['#ffffff','#2196f3','sequelize','squel','exports','STRING','TEXT','parse','getDataValue','attrs','stringify','INTEGER'];(function(_0x36d11c,_0x6dffa7){var _0xd95b50=function(_0x5ed180){while(--_0x5ed180){_0x36d11c['push'](_0x36d11c['shift']());}};_0xd95b50(++_0x6dffa7);}(_0xe425,0xe6));var _0x5e42=function(_0x11adbd,_0x5055f5){_0x11adbd=_0x11adbd-0x0;var _0x270029=_0xe425[_0x11adbd];return _0x270029;};'use strict';var Sequelize=require(_0x5e42('0x0'));var squel=require(_0x5e42('0x1'));var _=require('lodash');module[_0x5e42('0x2')]={'title':{'type':Sequelize[_0x5e42('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x5e42('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x5e42('0x4')]('long'),'get':function(){try{return JSON[_0x5e42('0x5')](this[_0x5e42('0x6')]('attrs'));}catch(_0x4ee0cf){return[];}},'set':function(_0x2db965){try{this['setDataValue'](_0x5e42('0x7'),JSON[_0x5e42('0x8')](_0x2db965));}catch(_0x35ac45){this['setDataValue']('attrs',JSON[_0x5e42('0x8')]([]));}}},'sizeX':{'type':Sequelize[_0x5e42('0x9')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x5e42('0x9')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x5e42('0x9')]},'col':{'type':Sequelize[_0x5e42('0x9')]},'background':{'type':Sequelize[_0x5e42('0x3')],'allowNull':![],'defaultValue':_0x5e42('0xa'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x5e42('0xb'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x5e42('0x3')]}}; \ No newline at end of file +var _0x0fb5=['#ffffff','#2196f3','sequelize','lodash','exports','STRING','TEXT','long','parse','attrs','setDataValue','stringify','INTEGER'];(function(_0x31394f,_0x2a31f1){var _0x2b96f0=function(_0x37dea0){while(--_0x37dea0){_0x31394f['push'](_0x31394f['shift']());}};_0x2b96f0(++_0x2a31f1);}(_0x0fb5,0x13a));var _0x50fb=function(_0x256497,_0x4a76fe){_0x256497=_0x256497-0x0;var _0x15dedd=_0x0fb5[_0x256497];return _0x15dedd;};'use strict';var Sequelize=require(_0x50fb('0x0'));var squel=require('squel');var _=require(_0x50fb('0x1'));module[_0x50fb('0x2')]={'title':{'type':Sequelize[_0x50fb('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x50fb('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x50fb('0x4')](_0x50fb('0x5')),'get':function(){try{return JSON[_0x50fb('0x6')](this['getDataValue'](_0x50fb('0x7')));}catch(_0xca2592){return[];}},'set':function(_0x2300e4){try{this[_0x50fb('0x8')](_0x50fb('0x7'),JSON['stringify'](_0x2300e4));}catch(_0x2fb5a7){this['setDataValue'](_0x50fb('0x7'),JSON[_0x50fb('0x9')]([]));}}},'sizeX':{'type':Sequelize[_0x50fb('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x50fb('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0x50fb('0xa')]},'background':{'type':Sequelize[_0x50fb('0x3')],'allowNull':![],'defaultValue':_0x50fb('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x50fb('0x3')],'allowNull':![],'defaultValue':_0x50fb('0xc'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 37171f5..ea20dcb 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 _0x2b18=['attrs','https://','attrPath','value','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','type','attrReport','attrRefresh','error','widgetAttributes:\x20%s','stringify','create','body','update','html-pdf','eml-format','rimraf','request-promise','util','sox','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','json','count','offset','limit','Content-Range','apply','save','then','name','send','show','params','model','keys','DashboardItem','rawAttributes','query','filters','attributes','intersection','fields','length','includeAll','include','merge','options','find','catch','iframe','attrUrl'];(function(_0x573ce7,_0x2e596b){var _0x319bd7=function(_0x99d1a8){while(--_0x99d1a8){_0x573ce7['push'](_0x573ce7['shift']());}};_0x319bd7(++_0x2e596b);}(_0x2b18,0x11e));var _0x82b1=function(_0x800a42,_0x3b279a){_0x800a42=_0x800a42-0x0;var _0xa50268=_0x2b18[_0x800a42];return _0xa50268;};'use strict';var pdf=require(_0x82b1('0x0'));var emlformat=require(_0x82b1('0x1'));var rimraf=require(_0x82b1('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x82b1('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x82b1('0x4'));var path=require('path');var sox=require(_0x82b1('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x82b1('0x6'));var crypto=require(_0x82b1('0x7'));var jsforce=require('jsforce');var deskjs=require(_0x82b1('0x8'));var toCsv=require(_0x82b1('0x9'));var querystring=require(_0x82b1('0xa'));var Papa=require(_0x82b1('0xb'));var Redis=require(_0x82b1('0xc'));var authService=require(_0x82b1('0xd'));var qs=require(_0x82b1('0xe'));var as=require(_0x82b1('0xf'));var hardwareService=require(_0x82b1('0x10'));var logger=require(_0x82b1('0x11'))(_0x82b1('0x12'));var utils=require(_0x82b1('0x13'));var config=require(_0x82b1('0x14'));var db=require(_0x82b1('0x15'))['db'];config[_0x82b1('0x16')]=_['defaults'](config[_0x82b1('0x16')],{'host':_0x82b1('0x17'),'port':0x18eb});var socket=require(_0x82b1('0x18'))(new Redis(config['redis']));require('./dashboardItem.socket')[_0x82b1('0x19')](socket);function respondWithStatusCode(_0xf7985c,_0x44e5db){_0x44e5db=_0x44e5db||0xcc;return function(_0x407e36){if(_0x407e36){return _0xf7985c[_0x82b1('0x1a')](_0x44e5db);}return _0xf7985c[_0x82b1('0x1b')](_0x44e5db)['end']();};}function respondWithResult(_0x2a94fd,_0x409b74){_0x409b74=_0x409b74||0xc8;return function(_0x11b213){if(_0x11b213){return _0x2a94fd[_0x82b1('0x1b')](_0x409b74)[_0x82b1('0x1c')](_0x11b213);}};}function respondWithFilteredResult(_0x13d97c,_0x2a0b87){return function(_0x297218){if(_0x297218){var _0x49f748=_0x297218[_0x82b1('0x1d')],_0x5ebdfd=_0x2a0b87['offset'],_0x5182dd=_0x2a0b87[_0x82b1('0x1e')]+_0x2a0b87[_0x82b1('0x1f')],_0x5dc5d3;if(_0x5182dd>=_0x49f748){_0x5182dd=_0x49f748;_0x5dc5d3=0xc8;}else{_0x5dc5d3=0xce;}_0x13d97c[_0x82b1('0x1b')](_0x5dc5d3);return _0x13d97c['set'](_0x82b1('0x20'),_0x5ebdfd+'-'+_0x5182dd+'/'+_0x49f748)[_0x82b1('0x1c')](_0x297218);}return null;};}function patchUpdates(_0xfece16){return function(_0x13d253){try{jsonpatch[_0x82b1('0x21')](_0x13d253,_0xfece16,!![]);}catch(_0x30f8c8){return BPromise['reject'](_0x30f8c8);}return _0x13d253[_0x82b1('0x22')]();};}function saveUpdates(_0x58db06,_0x4c7415){return function(_0x272457){if(_0x272457){return _0x272457['update'](_0x58db06)[_0x82b1('0x23')](function(_0x453f04){return _0x453f04;});}return null;};}function removeEntity(_0x1c885f,_0x58e487){return function(_0x167a45){if(_0x167a45){return _0x167a45['destroy']()[_0x82b1('0x23')](function(){_0x1c885f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x12b9eb,_0x4cea44){return function(_0x2d726f){if(!_0x2d726f){_0x12b9eb[_0x82b1('0x1a')](0x194);}return _0x2d726f;};}function handleError(_0x1efbd9,_0x2747f5){_0x2747f5=_0x2747f5||0x1f4;return function(_0x378ba1){logger['error'](_0x378ba1['stack']);if(_0x378ba1[_0x82b1('0x24')]){delete _0x378ba1['name'];}_0x1efbd9[_0x82b1('0x1b')](_0x2747f5)[_0x82b1('0x25')](_0x378ba1);};}exports[_0x82b1('0x26')]=function(_0xc79017,_0x4aff7a){var _0x156a88={'raw':![],'where':{'id':_0xc79017[_0x82b1('0x27')]['id']}},_0xa1c076={};_0xa1c076[_0x82b1('0x28')]=_[_0x82b1('0x29')](db[_0x82b1('0x2a')][_0x82b1('0x2b')]);_0xa1c076['query']=_['keys'](_0xc79017[_0x82b1('0x2c')]);_0xa1c076[_0x82b1('0x2d')]=_['intersection'](_0xa1c076[_0x82b1('0x28')],_0xa1c076['query']);_0x156a88[_0x82b1('0x2e')]=_[_0x82b1('0x2f')](_0xa1c076[_0x82b1('0x28')],qs[_0x82b1('0x30')](_0xc79017[_0x82b1('0x2c')][_0x82b1('0x30')]));_0x156a88[_0x82b1('0x2e')]=_0x156a88[_0x82b1('0x2e')][_0x82b1('0x31')]?_0x156a88[_0x82b1('0x2e')]:_0xa1c076[_0x82b1('0x28')];if(_0xc79017['query'][_0x82b1('0x32')]){_0x156a88[_0x82b1('0x33')]=[{'all':!![]}];}_0x156a88=_[_0x82b1('0x34')]({},_0x156a88,_0xc79017[_0x82b1('0x35')]);return db[_0x82b1('0x2a')][_0x82b1('0x36')](_0x156a88)[_0x82b1('0x23')](handleEntityNotFound(_0x4aff7a,null))[_0x82b1('0x23')](respondWithResult(_0x4aff7a,null))[_0x82b1('0x37')](handleError(_0x4aff7a,null));};exports['destroy']=function(_0x1706f4,_0x4bb91a){return db[_0x82b1('0x2a')][_0x82b1('0x36')]({'where':{'id':_0x1706f4[_0x82b1('0x27')]['id']}})[_0x82b1('0x23')](handleEntityNotFound(_0x4bb91a,null))[_0x82b1('0x23')](removeEntity(_0x4bb91a,null))[_0x82b1('0x37')](handleError(_0x4bb91a,null));};function widgetAttributes(_0x2979f1){try{switch(_0x2979f1['type']){case _0x82b1('0x38'):return[{'name':_0x82b1('0x39'),'value':_0x2979f1[_0x82b1('0x39')]||(_0x2979f1[_0x82b1('0x3a')]&&_0x2979f1[_0x82b1('0x3a')][0x0]?_0x2979f1['attrs'][0x0]['value']:undefined)||_0x82b1('0x3b')}];case'custom':return[{'name':'attrPath','value':_0x2979f1[_0x82b1('0x3c')]||(_0x2979f1[_0x82b1('0x3a')]&&_0x2979f1[_0x82b1('0x3a')][0x0]?_0x2979f1['attrs'][0x0][_0x82b1('0x3d')]:undefined)||''}];case'clock':return[{'name':_0x82b1('0x3e'),'value':_0x2979f1[_0x82b1('0x3e')]||(_0x2979f1['attrs']&&_0x2979f1['attrs'][0x0]?_0x2979f1['attrs'][0x0]['value']:undefined)||_0x82b1('0x3f')},{'name':_0x82b1('0x40'),'value':_0x2979f1[_0x82b1('0x40')]||(_0x2979f1['attrs']&&_0x2979f1[_0x82b1('0x3a')][0x1]?_0x2979f1['attrs'][0x1][_0x82b1('0x3d')]:undefined)||_0x82b1('0x41')},{'name':_0x82b1('0x42'),'value':_0x2979f1[_0x82b1('0x42')]||(_0x2979f1['attrs']&&_0x2979f1['attrs'][0x2]?_0x2979f1['attrs'][0x2][_0x82b1('0x3d')]:undefined)||0xc}];case _0x82b1('0x43'):return[{'name':_0x82b1('0x44'),'value':_0x2979f1[_0x82b1('0x44')]||(_0x2979f1[_0x82b1('0x3a')]&&_0x2979f1[_0x82b1('0x3a')][0x0]?_0x2979f1[_0x82b1('0x3a')][0x0][_0x82b1('0x3d')]:undefined)||_0x82b1('0x45')},{'name':_0x82b1('0x46'),'value':_0x2979f1[_0x82b1('0x46')]||(_0x2979f1['attrs']&&_0x2979f1[_0x82b1('0x3a')][0x1]?_0x2979f1[_0x82b1('0x3a')][0x1][_0x82b1('0x3d')]:undefined)||[]},{'name':_0x82b1('0x42'),'value':_0x2979f1[_0x82b1('0x42')]||(_0x2979f1['attrs']&&_0x2979f1[_0x82b1('0x3a')][0x2]?_0x2979f1[_0x82b1('0x3a')][0x2][_0x82b1('0x3d')]:undefined)||0x14}];case _0x82b1('0x47'):case _0x82b1('0x48'):return[{'name':'attrSerie1','value':_0x2979f1[_0x82b1('0x49')]||(_0x2979f1['attrs']&&_0x2979f1[_0x82b1('0x3a')][0x0]?_0x2979f1[_0x82b1('0x3a')][0x0][_0x82b1('0x3d')]:undefined)||_0x82b1('0x45')},{'name':'attrSerie2','value':_0x2979f1[_0x82b1('0x4a')]||(_0x2979f1[_0x82b1('0x3a')]&&_0x2979f1[_0x82b1('0x3a')][0x1]?_0x2979f1['attrs'][0x1][_0x82b1('0x3d')]:undefined)||null},{'name':_0x82b1('0x4b'),'value':_0x2979f1['attrSerie3']||(_0x2979f1[_0x82b1('0x3a')]&&_0x2979f1['attrs'][0x2]?_0x2979f1[_0x82b1('0x3a')][0x2][_0x82b1('0x3d')]:undefined)||null},{'name':_0x82b1('0x46'),'value':_0x2979f1['attrVoiceQueues']||(_0x2979f1[_0x82b1('0x3a')]&&_0x2979f1[_0x82b1('0x3a')][0x3]?_0x2979f1[_0x82b1('0x3a')][0x3][_0x82b1('0x3d')]:undefined)||[]}];case _0x82b1('0x4c'):return[{'name':'attrReport','type':_0x2979f1['reportType']||(_0x2979f1['attrs']&&_0x2979f1['attrs'][0x0]?_0x2979f1['attrs'][0x0][_0x82b1('0x4d')]:undefined)||null,'value':_0x2979f1[_0x82b1('0x4e')]||(_0x2979f1[_0x82b1('0x3a')]&&_0x2979f1[_0x82b1('0x3a')][0x0]?_0x2979f1[_0x82b1('0x3a')][0x0]['value']:undefined)||null},{'name':_0x82b1('0x4f'),'value':_0x2979f1[_0x82b1('0x4f')]||(_0x2979f1[_0x82b1('0x3a')]&&_0x2979f1[_0x82b1('0x3a')][0x1]?_0x2979f1[_0x82b1('0x3a')][0x1][_0x82b1('0x3d')]:undefined)||0x0}];default:return[];}}catch(_0x197504){logger[_0x82b1('0x50')](_0x82b1('0x51'),JSON[_0x82b1('0x52')](_0x197504));return[];}}exports[_0x82b1('0x53')]=function(_0x166461,_0x1c08c5){if(_0x166461[_0x82b1('0x54')]){_0x166461['body'][_0x82b1('0x3a')]=widgetAttributes(_0x166461[_0x82b1('0x54')]);}return db[_0x82b1('0x2a')][_0x82b1('0x53')](_0x166461[_0x82b1('0x54')],{})[_0x82b1('0x23')](respondWithResult(_0x1c08c5,0xc9))['catch'](handleError(_0x1c08c5,null));};exports[_0x82b1('0x55')]=function(_0x245963,_0x557859){if(_0x245963[_0x82b1('0x54')]['id']){delete _0x245963[_0x82b1('0x54')]['id'];}_0x245963['body'][_0x82b1('0x3a')]=widgetAttributes(_0x245963[_0x82b1('0x54')]);return db[_0x82b1('0x2a')][_0x82b1('0x36')]({'where':{'id':_0x245963[_0x82b1('0x27')]['id']}})[_0x82b1('0x23')](handleEntityNotFound(_0x557859,null))['then'](saveUpdates(_0x245963[_0x82b1('0x54')],null))[_0x82b1('0x23')](respondWithResult(_0x557859,null))['catch'](handleError(_0x557859,null));}; \ No newline at end of file +var _0x3649=['status','json','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','show','params','keys','rawAttributes','query','filters','intersection','model','fields','attributes','length','options','find','catch','DashboardItem','type','iframe','attrUrl','attrs','value','custom','attrPath','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','attrMetric','attrVoiceQueues','multibar-chart','attrSerie1','total','attrSerie2','web-report','reportType','attrReport','attrRefresh','widgetAttributes:\x20%s','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','sendStatus'];(function(_0x47e309,_0x1e771a){var _0x2e1900=function(_0x407297){while(--_0x407297){_0x47e309['push'](_0x47e309['shift']());}};_0x2e1900(++_0x1e771a);}(_0x3649,0x1d1));var _0x9364=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x3649[_0x24237f];return _0x48298e;};'use strict';var pdf=require(_0x9364('0x0'));var emlformat=require(_0x9364('0x1'));var rimraf=require(_0x9364('0x2'));var zipdir=require(_0x9364('0x3'));var jsonpatch=require(_0x9364('0x4'));var rp=require(_0x9364('0x5'));var moment=require(_0x9364('0x6'));var BPromise=require(_0x9364('0x7'));var Mustache=require(_0x9364('0x8'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x9364('0x9'));var ejs=require(_0x9364('0xa'));var fs=require('fs');var _=require(_0x9364('0xb'));var squel=require('squel');var crypto=require(_0x9364('0xc'));var jsforce=require(_0x9364('0xd'));var deskjs=require(_0x9364('0xe'));var toCsv=require(_0x9364('0x9'));var querystring=require('querystring');var Papa=require(_0x9364('0xf'));var Redis=require(_0x9364('0x10'));var authService=require(_0x9364('0x11'));var qs=require(_0x9364('0x12'));var as=require(_0x9364('0x13'));var hardwareService=require(_0x9364('0x14'));var logger=require(_0x9364('0x15'))('api');var utils=require(_0x9364('0x16'));var config=require('../../config/environment');var db=require(_0x9364('0x17'))['db'];config[_0x9364('0x18')]=_[_0x9364('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9364('0x18')]));require('./dashboardItem.socket')['register'](socket);function respondWithStatusCode(_0x2bafbb,_0x8c011){_0x8c011=_0x8c011||0xcc;return function(_0x357f85){if(_0x357f85){return _0x2bafbb[_0x9364('0x1a')](_0x8c011);}return _0x2bafbb['status'](_0x8c011)['end']();};}function respondWithResult(_0x5ad5c0,_0x559a52){_0x559a52=_0x559a52||0xc8;return function(_0x5aa96e){if(_0x5aa96e){return _0x5ad5c0[_0x9364('0x1b')](_0x559a52)[_0x9364('0x1c')](_0x5aa96e);}};}function respondWithFilteredResult(_0x1dfebb,_0x37c43e){return function(_0x4070cb){if(_0x4070cb){var _0x587c39=_0x4070cb['count'],_0x5e059d=_0x37c43e['offset'],_0x1a5222=_0x37c43e[_0x9364('0x1d')]+_0x37c43e['limit'],_0x1c4501;if(_0x1a5222>=_0x587c39){_0x1a5222=_0x587c39;_0x1c4501=0xc8;}else{_0x1c4501=0xce;}_0x1dfebb[_0x9364('0x1b')](_0x1c4501);return _0x1dfebb[_0x9364('0x1e')](_0x9364('0x1f'),_0x5e059d+'-'+_0x1a5222+'/'+_0x587c39)[_0x9364('0x1c')](_0x4070cb);}return null;};}function patchUpdates(_0x437a99){return function(_0x46bb25){try{jsonpatch[_0x9364('0x20')](_0x46bb25,_0x437a99,!![]);}catch(_0x2a56a5){return BPromise[_0x9364('0x21')](_0x2a56a5);}return _0x46bb25[_0x9364('0x22')]();};}function saveUpdates(_0x3de31a,_0x331b72){return function(_0x4a5921){if(_0x4a5921){return _0x4a5921[_0x9364('0x23')](_0x3de31a)[_0x9364('0x24')](function(_0x1dc21d){return _0x1dc21d;});}return null;};}function removeEntity(_0x3c7a4a,_0xd0df40){return function(_0x5631c4){if(_0x5631c4){return _0x5631c4[_0x9364('0x25')]()[_0x9364('0x24')](function(){_0x3c7a4a[_0x9364('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e66b2,_0x29547e){return function(_0xdd7cfd){if(!_0xdd7cfd){_0x1e66b2[_0x9364('0x1a')](0x194);}return _0xdd7cfd;};}function handleError(_0x523bf6,_0x436d9c){_0x436d9c=_0x436d9c||0x1f4;return function(_0x67426a){logger[_0x9364('0x26')](_0x67426a[_0x9364('0x27')]);if(_0x67426a['name']){delete _0x67426a[_0x9364('0x28')];}_0x523bf6['status'](_0x436d9c)[_0x9364('0x29')](_0x67426a);};}exports[_0x9364('0x2a')]=function(_0x3f0068,_0x21f489){var _0x5706d9={'raw':![],'where':{'id':_0x3f0068[_0x9364('0x2b')]['id']}},_0x4e1153={};_0x4e1153['model']=_[_0x9364('0x2c')](db['DashboardItem'][_0x9364('0x2d')]);_0x4e1153[_0x9364('0x2e')]=_['keys'](_0x3f0068[_0x9364('0x2e')]);_0x4e1153[_0x9364('0x2f')]=_[_0x9364('0x30')](_0x4e1153[_0x9364('0x31')],_0x4e1153[_0x9364('0x2e')]);_0x5706d9['attributes']=_[_0x9364('0x30')](_0x4e1153[_0x9364('0x31')],qs[_0x9364('0x32')](_0x3f0068[_0x9364('0x2e')][_0x9364('0x32')]));_0x5706d9[_0x9364('0x33')]=_0x5706d9['attributes'][_0x9364('0x34')]?_0x5706d9[_0x9364('0x33')]:_0x4e1153['model'];if(_0x3f0068[_0x9364('0x2e')]['includeAll']){_0x5706d9['include']=[{'all':!![]}];}_0x5706d9=_['merge']({},_0x5706d9,_0x3f0068[_0x9364('0x35')]);return db['DashboardItem'][_0x9364('0x36')](_0x5706d9)[_0x9364('0x24')](handleEntityNotFound(_0x21f489,null))[_0x9364('0x24')](respondWithResult(_0x21f489,null))[_0x9364('0x37')](handleError(_0x21f489,null));};exports[_0x9364('0x25')]=function(_0x11e1ac,_0x27bcef){return db[_0x9364('0x38')][_0x9364('0x36')]({'where':{'id':_0x11e1ac['params']['id']}})[_0x9364('0x24')](handleEntityNotFound(_0x27bcef,null))[_0x9364('0x24')](removeEntity(_0x27bcef,null))['catch'](handleError(_0x27bcef,null));};function widgetAttributes(_0x50cf0f){try{switch(_0x50cf0f[_0x9364('0x39')]){case _0x9364('0x3a'):return[{'name':_0x9364('0x3b'),'value':_0x50cf0f[_0x9364('0x3b')]||(_0x50cf0f[_0x9364('0x3c')]&&_0x50cf0f[_0x9364('0x3c')][0x0]?_0x50cf0f[_0x9364('0x3c')][0x0][_0x9364('0x3d')]:undefined)||'https://'}];case _0x9364('0x3e'):return[{'name':_0x9364('0x3f'),'value':_0x50cf0f[_0x9364('0x3f')]||(_0x50cf0f[_0x9364('0x3c')]&&_0x50cf0f[_0x9364('0x3c')][0x0]?_0x50cf0f[_0x9364('0x3c')][0x0]['value']:undefined)||''}];case _0x9364('0x40'):return[{'name':'attrHourFormat','value':_0x50cf0f[_0x9364('0x41')]||(_0x50cf0f[_0x9364('0x3c')]&&_0x50cf0f[_0x9364('0x3c')][0x0]?_0x50cf0f['attrs'][0x0][_0x9364('0x3d')]:undefined)||'HH:mm:ss'},{'name':_0x9364('0x42'),'value':_0x50cf0f['attrTimezone']||(_0x50cf0f['attrs']&&_0x50cf0f[_0x9364('0x3c')][0x1]?_0x50cf0f[_0x9364('0x3c')][0x1][_0x9364('0x3d')]:undefined)||_0x9364('0x43')},{'name':_0x9364('0x44'),'value':_0x50cf0f[_0x9364('0x44')]||(_0x50cf0f[_0x9364('0x3c')]&&_0x50cf0f[_0x9364('0x3c')][0x2]?_0x50cf0f['attrs'][0x2][_0x9364('0x3d')]:undefined)||0xc}];case'counter':return[{'name':_0x9364('0x45'),'value':_0x50cf0f[_0x9364('0x45')]||(_0x50cf0f['attrs']&&_0x50cf0f['attrs'][0x0]?_0x50cf0f[_0x9364('0x3c')][0x0][_0x9364('0x3d')]:undefined)||'total'},{'name':_0x9364('0x46'),'value':_0x50cf0f['attrVoiceQueues']||(_0x50cf0f[_0x9364('0x3c')]&&_0x50cf0f['attrs'][0x1]?_0x50cf0f['attrs'][0x1][_0x9364('0x3d')]:undefined)||[]},{'name':'attrFontSize','value':_0x50cf0f['attrFontSize']||(_0x50cf0f[_0x9364('0x3c')]&&_0x50cf0f[_0x9364('0x3c')][0x2]?_0x50cf0f['attrs'][0x2][_0x9364('0x3d')]:undefined)||0x14}];case _0x9364('0x47'):case'pie-chart':return[{'name':'attrSerie1','value':_0x50cf0f[_0x9364('0x48')]||(_0x50cf0f[_0x9364('0x3c')]&&_0x50cf0f[_0x9364('0x3c')][0x0]?_0x50cf0f[_0x9364('0x3c')][0x0][_0x9364('0x3d')]:undefined)||_0x9364('0x49')},{'name':_0x9364('0x4a'),'value':_0x50cf0f[_0x9364('0x4a')]||(_0x50cf0f[_0x9364('0x3c')]&&_0x50cf0f[_0x9364('0x3c')][0x1]?_0x50cf0f['attrs'][0x1][_0x9364('0x3d')]:undefined)||null},{'name':'attrSerie3','value':_0x50cf0f['attrSerie3']||(_0x50cf0f['attrs']&&_0x50cf0f[_0x9364('0x3c')][0x2]?_0x50cf0f[_0x9364('0x3c')][0x2][_0x9364('0x3d')]:undefined)||null},{'name':_0x9364('0x46'),'value':_0x50cf0f[_0x9364('0x46')]||(_0x50cf0f[_0x9364('0x3c')]&&_0x50cf0f[_0x9364('0x3c')][0x3]?_0x50cf0f[_0x9364('0x3c')][0x3][_0x9364('0x3d')]:undefined)||[]}];case _0x9364('0x4b'):return[{'name':'attrReport','type':_0x50cf0f[_0x9364('0x4c')]||(_0x50cf0f[_0x9364('0x3c')]&&_0x50cf0f[_0x9364('0x3c')][0x0]?_0x50cf0f[_0x9364('0x3c')][0x0][_0x9364('0x39')]:undefined)||null,'value':_0x50cf0f[_0x9364('0x4d')]||(_0x50cf0f[_0x9364('0x3c')]&&_0x50cf0f[_0x9364('0x3c')][0x0]?_0x50cf0f[_0x9364('0x3c')][0x0][_0x9364('0x3d')]:undefined)||null},{'name':_0x9364('0x4e'),'value':_0x50cf0f[_0x9364('0x4e')]||(_0x50cf0f[_0x9364('0x3c')]&&_0x50cf0f[_0x9364('0x3c')][0x1]?_0x50cf0f['attrs'][0x1][_0x9364('0x3d')]:undefined)||0x0}];default:return[];}}catch(_0x2936e1){logger[_0x9364('0x26')](_0x9364('0x4f'),JSON['stringify'](_0x2936e1));return[];}}exports[_0x9364('0x50')]=function(_0x1d6f0e,_0x5cad88){if(_0x1d6f0e[_0x9364('0x51')]){_0x1d6f0e[_0x9364('0x51')]['attrs']=widgetAttributes(_0x1d6f0e[_0x9364('0x51')]);}return db[_0x9364('0x38')][_0x9364('0x50')](_0x1d6f0e['body'],{})[_0x9364('0x24')](respondWithResult(_0x5cad88,0xc9))[_0x9364('0x37')](handleError(_0x5cad88,null));};exports[_0x9364('0x23')]=function(_0x4da505,_0x2ae3fd){if(_0x4da505[_0x9364('0x51')]['id']){delete _0x4da505['body']['id'];}_0x4da505[_0x9364('0x51')][_0x9364('0x3c')]=widgetAttributes(_0x4da505[_0x9364('0x51')]);return db[_0x9364('0x38')][_0x9364('0x36')]({'where':{'id':_0x4da505[_0x9364('0x2b')]['id']}})[_0x9364('0x24')](handleEntityNotFound(_0x2ae3fd,null))[_0x9364('0x24')](saveUpdates(_0x4da505['body'],null))['then'](respondWithResult(_0x2ae3fd,null))[_0x9364('0x37')](handleError(_0x2ae3fd,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 0b90563..0ed6561 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 _0x3235=['update','emit','hook','exports','events','../../mysqldb','DashboardItem','setMaxListeners'];(function(_0x586e4e,_0x95c877){var _0x317445=function(_0x34418e){while(--_0x34418e){_0x586e4e['push'](_0x586e4e['shift']());}};_0x317445(++_0x95c877);}(_0x3235,0x144));var _0x5323=function(_0x66af47,_0x5e4341){_0x66af47=_0x66af47-0x0;var _0x13e72c=_0x3235[_0x66af47];return _0x13e72c;};'use strict';var EventEmitter=require(_0x5323('0x0'));var DashboardItem=require(_0x5323('0x1'))['db'][_0x5323('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x5323('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5323('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1ed510){return function(_0x3d6635,_0x3448ce,_0x49ff02){DashboardItemEvents[_0x5323('0x5')](_0x1ed510+':'+_0x3d6635['id'],_0x3d6635);DashboardItemEvents[_0x5323('0x5')](_0x1ed510,_0x3d6635);_0x49ff02(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0x5323('0x6')](e,emitEvent(event));}}module[_0x5323('0x7')]=DashboardItemEvents; \ No newline at end of file +var _0x44b6=['DashboardItem','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x1cabec,_0x15be7f){var _0x28144e=function(_0x209f7f){while(--_0x209f7f){_0x1cabec['push'](_0x1cabec['shift']());}};_0x28144e(++_0x15be7f);}(_0x44b6,0x14c));var _0x644b=function(_0x3e5d32,_0x19ce13){_0x3e5d32=_0x3e5d32-0x0;var _0x3e7822=_0x44b6[_0x3e5d32];return _0x3e7822;};'use strict';var EventEmitter=require(_0x644b('0x0'));var DashboardItem=require('../../mysqldb')['db'][_0x644b('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x644b('0x2')](0x0);var events={'afterCreate':_0x644b('0x3'),'afterUpdate':_0x644b('0x4'),'afterDestroy':_0x644b('0x5')};function emitEvent(_0x30912a){return function(_0x5c993c,_0x227380,_0x5124f2){DashboardItemEvents[_0x644b('0x6')](_0x30912a+':'+_0x5c993c['id'],_0x5c993c);DashboardItemEvents[_0x644b('0x6')](_0x30912a,_0x5c993c);_0x5124f2(null);};}for(var e in events){if(events[_0x644b('0x7')](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0x644b('0x8')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 87ed9b5..1cdd26a 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 _0x0508=['exports','define','DashboardItem','lodash','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./dashboardItem.attributes'];(function(_0x34f2c5,_0x4fbb6a){var _0x2b1049=function(_0x2d1fc){while(--_0x2d1fc){_0x34f2c5['push'](_0x34f2c5['shift']());}};_0x2b1049(++_0x4fbb6a);}(_0x0508,0x1dc));var _0x8050=function(_0xf8e69a,_0x30af12){_0xf8e69a=_0xf8e69a-0x0;var _0x1a3973=_0x0508[_0xf8e69a];return _0x1a3973;};'use strict';var _=require(_0x8050('0x0'));var util=require(_0x8050('0x1'));var logger=require(_0x8050('0x2'))('api');var moment=require('moment');var BPromise=require(_0x8050('0x3'));var rp=require(_0x8050('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8050('0x5'));var config=require(_0x8050('0x6'));var attributes=require(_0x8050('0x7'));module[_0x8050('0x8')]=function(_0x283948,_0x19f8c5){return _0x283948[_0x8050('0x9')](_0x8050('0xa'),attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x46ca=['bluebird','request-promise','path','rimraf','../../config/environment','./dashboardItem.attributes','exports','define','DashboardItem','dashboard_items','lodash','util','../../config/logger','api','moment'];(function(_0x4017b0,_0x4347db){var _0x5ed4f7=function(_0x706c26){while(--_0x706c26){_0x4017b0['push'](_0x4017b0['shift']());}};_0x5ed4f7(++_0x4347db);}(_0x46ca,0xaf));var _0xa46c=function(_0xeead8a,_0x3d2400){_0xeead8a=_0xeead8a-0x0;var _0x24742c=_0x46ca[_0xeead8a];return _0x24742c;};'use strict';var _=require(_0xa46c('0x0'));var util=require(_0xa46c('0x1'));var logger=require(_0xa46c('0x2'))(_0xa46c('0x3'));var moment=require(_0xa46c('0x4'));var BPromise=require(_0xa46c('0x5'));var rp=require(_0xa46c('0x6'));var fs=require('fs');var path=require(_0xa46c('0x7'));var rimraf=require(_0xa46c('0x8'));var config=require(_0xa46c('0x9'));var attributes=require(_0xa46c('0xa'));module[_0xa46c('0xb')]=function(_0x176684,_0xad3946){return _0x176684[_0xa46c('0xc')](_0xa46c('0xd'),attributes,{'tableName':_0xa46c('0xe'),'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 1ba884f..b9ff0be 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 _0x0d79=['../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','request','then','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','bluebird','ioredis','../../mysqldb'];(function(_0x9f9380,_0x313674){var _0x45290e=function(_0x50ab18){while(--_0x50ab18){_0x9f9380['push'](_0x9f9380['shift']());}};_0x45290e(++_0x313674);}(_0x0d79,0x1e3));var _0x90d7=function(_0x2d982d,_0x121028){_0x2d982d=_0x2d982d-0x0;var _0x4f36b0=_0x0d79[_0x2d982d];return _0x4f36b0;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x90d7('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x90d7('0x1'));var db=require(_0x90d7('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x90d7('0x3'))(_0x90d7('0x4'));var config=require('../../config/environment');var jayson=require(_0x90d7('0x5'));var client=jayson[_0x90d7('0x6')][_0x90d7('0x7')]({'port':0x232a});config[_0x90d7('0x8')]=_[_0x90d7('0x9')](config['redis'],{'host':_0x90d7('0xa'),'port':0x18eb});var socket=require(_0x90d7('0xb'))(new Redis(config[_0x90d7('0x8')]));require(_0x90d7('0xc'))[_0x90d7('0xd')](socket);function respondWithRpcPromise(_0x491f2e,_0x9f4c82,_0x1f3bcc){return new BPromise(function(_0xd57053,_0xab8473){return client[_0x90d7('0xe')](_0x491f2e,_0x1f3bcc)[_0x90d7('0xf')](function(_0x17cc22){logger['info'](_0x90d7('0x10'),_0x9f4c82,_0x90d7('0x11'));logger[_0x90d7('0x12')](_0x90d7('0x13'),_0x9f4c82,'request\x20sent',JSON[_0x90d7('0x14')](_0x17cc22));if(_0x17cc22[_0x90d7('0x15')]){if(_0x17cc22['error'][_0x90d7('0x16')]===0x1f4){logger['error']('DashboardItem,\x20%s,\x20%s',_0x9f4c82,_0x17cc22[_0x90d7('0x15')][_0x90d7('0x17')]);return _0xab8473(_0x17cc22['error'][_0x90d7('0x17')]);}logger['error'](_0x90d7('0x10'),_0x9f4c82,_0x17cc22[_0x90d7('0x15')]['message']);return _0xd57053(_0x17cc22['error'][_0x90d7('0x17')]);}else{logger[_0x90d7('0x18')]('DashboardItem,\x20%s,\x20%s',_0x9f4c82,_0x90d7('0x11'));_0xd57053(_0x17cc22[_0x90d7('0x19')][_0x90d7('0x17')]);}})[_0x90d7('0x1a')](function(_0x484447){logger[_0x90d7('0x15')](_0x90d7('0x10'),_0x9f4c82,_0x484447);_0xab8473(_0x484447);});});} \ No newline at end of file +var _0x60e9=['./dashboardItem.socket','register','request','then','info','DashboardItem,\x20%s,\x20%s','debug','DashboardItem,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter'];(function(_0x5e04f1,_0x1afe5b){var _0x174ee8=function(_0x322ad0){while(--_0x322ad0){_0x5e04f1['push'](_0x5e04f1['shift']());}};_0x174ee8(++_0x1afe5b);}(_0x60e9,0x1f3));var _0x960e=function(_0x30364e,_0x2b2fa6){_0x30364e=_0x30364e-0x0;var _0x5cfe50=_0x60e9[_0x30364e];return _0x5cfe50;};'use strict';var _=require(_0x960e('0x0'));var util=require(_0x960e('0x1'));var moment=require(_0x960e('0x2'));var BPromise=require(_0x960e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x960e('0x4'))['db'];var utils=require(_0x960e('0x5'));var logger=require(_0x960e('0x6'))(_0x960e('0x7'));var config=require('../../config/environment');var jayson=require(_0x960e('0x8'));var client=jayson[_0x960e('0x9')][_0x960e('0xa')]({'port':0x232a});config[_0x960e('0xb')]=_[_0x960e('0xc')](config[_0x960e('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x960e('0xd'))(new Redis(config[_0x960e('0xb')]));require(_0x960e('0xe'))[_0x960e('0xf')](socket);function respondWithRpcPromise(_0xd6b3f,_0x11cbce,_0x50182a){return new BPromise(function(_0x560f80,_0x3fd6af){return client[_0x960e('0x10')](_0xd6b3f,_0x50182a)[_0x960e('0x11')](function(_0x5c1ee9){logger[_0x960e('0x12')](_0x960e('0x13'),_0x11cbce,'request\x20sent');logger[_0x960e('0x14')](_0x960e('0x15'),_0x11cbce,_0x960e('0x16'),JSON[_0x960e('0x17')](_0x5c1ee9));if(_0x5c1ee9[_0x960e('0x18')]){if(_0x5c1ee9[_0x960e('0x18')]['code']===0x1f4){logger[_0x960e('0x18')](_0x960e('0x13'),_0x11cbce,_0x5c1ee9['error']['message']);return _0x3fd6af(_0x5c1ee9[_0x960e('0x18')][_0x960e('0x19')]);}logger[_0x960e('0x18')](_0x960e('0x13'),_0x11cbce,_0x5c1ee9[_0x960e('0x18')][_0x960e('0x19')]);return _0x560f80(_0x5c1ee9[_0x960e('0x18')][_0x960e('0x19')]);}else{logger[_0x960e('0x12')](_0x960e('0x13'),_0x11cbce,'request\x20sent');_0x560f80(_0x5c1ee9[_0x960e('0x1a')]['message']);}})['catch'](function(_0x425084){logger['error'](_0x960e('0x13'),_0x11cbce,_0x425084);_0x3fd6af(_0x425084);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index a97cf9a..c3a2dc4 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 _0x32ec=['remove','update','emit'];(function(_0x37417f,_0x47c566){var _0x351a34=function(_0x29e52a){while(--_0x29e52a){_0x37417f['push'](_0x37417f['shift']());}};_0x351a34(++_0x47c566);}(_0x32ec,0x126));var _0xc32e=function(_0x5f16c3,_0x239c2d){_0x5f16c3=_0x5f16c3-0x0;var _0x5967ad=_0x32ec[_0x5f16c3];return _0x5967ad;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=['save',_0xc32e('0x0'),_0xc32e('0x1')];function createListener(_0x1b056e,_0x1e67c9){return function(_0x4c4766){_0x1e67c9[_0xc32e('0x2')](_0x1b056e,_0x4c4766);};}function removeListener(_0x94c082,_0x4d82d3){return function(){DashboardItemEvents['removeListener'](_0x94c082,_0x4d82d3);};}exports['register']=function(_0x2c441e){for(var _0x52823d=0x0,_0x4d5cd8=events['length'];_0x52823d<_0x4d5cd8;_0x52823d++){var _0x2d3537=events[_0x52823d];var _0x5394c6=createListener('dashboardItem:'+_0x2d3537,_0x2c441e);DashboardItemEvents['on'](_0x2d3537,_0x5394c6);}}; \ No newline at end of file +var _0xa9b3=['dashboardItem:','./dashboardItem.events','save','update','emit','length'];(function(_0x2bd40c,_0x1613cc){var _0x280d61=function(_0x4152c8){while(--_0x4152c8){_0x2bd40c['push'](_0x2bd40c['shift']());}};_0x280d61(++_0x1613cc);}(_0xa9b3,0xcd));var _0x3a9b=function(_0x7cbc3c,_0x2bad4d){_0x7cbc3c=_0x7cbc3c-0x0;var _0x4c4433=_0xa9b3[_0x7cbc3c];return _0x4c4433;};'use strict';var DashboardItemEvents=require(_0x3a9b('0x0'));var events=[_0x3a9b('0x1'),'remove',_0x3a9b('0x2')];function createListener(_0x681ff2,_0x185ae3){return function(_0x5291ed){_0x185ae3[_0x3a9b('0x3')](_0x681ff2,_0x5291ed);};}function removeListener(_0x4840df,_0x261192){return function(){DashboardItemEvents['removeListener'](_0x4840df,_0x261192);};}exports['register']=function(_0x16ce8b){for(var _0x1f500b=0x0,_0xfdc70d=events[_0x3a9b('0x4')];_0x1f500b<_0xfdc70d;_0x1f500b++){var _0x49d422=events[_0x1f500b];var _0x332f78=createListener(_0x3a9b('0x5')+_0x49d422,_0x16ce8b);DashboardItemEvents['on'](_0x49d422,_0x332f78);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 66f5559..99029a7 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 _0x5fab=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','create','put','update','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x4105a8,_0x198324){var _0x553f0c=function(_0x3720f5){while(--_0x3720f5){_0x4105a8['push'](_0x4105a8['shift']());}};_0x553f0c(++_0x198324);}(_0x5fab,0x177));var _0xb5fa=function(_0x4401b7,_0x98b2f1){_0x4401b7=_0x4401b7-0x0;var _0x458b00=_0x5fab[_0x4401b7];return _0x458b00;};'use strict';var multer=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var path=require('path');var timeout=require(_0xb5fa('0x2'));var express=require(_0xb5fa('0x3'));var router=express[_0xb5fa('0x4')]();var auth=require(_0xb5fa('0x5'));var interaction=require(_0xb5fa('0x6'));var config=require(_0xb5fa('0x7'));var controller=require(_0xb5fa('0x8'));router[_0xb5fa('0x9')](_0xb5fa('0xa'),auth[_0xb5fa('0xb')](),controller['show']);router['post']('/',auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xc')]);router[_0xb5fa('0xd')]('/:id',auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xe')]);router[_0xb5fa('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xb5fa('0x10')]);module[_0xb5fa('0x11')]=router; \ No newline at end of file +var _0x9c5a=['delete','isAuthenticated','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./dashboardItem.controller','/:id','show','post','put','update'];(function(_0x11c573,_0x9e7c6e){var _0x6b72de=function(_0x2e8a61){while(--_0x2e8a61){_0x11c573['push'](_0x11c573['shift']());}};_0x6b72de(++_0x9e7c6e);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x1a8c5e,_0x577cee){_0x1a8c5e=_0x1a8c5e-0x0;var _0x10b178=_0x9c5a[_0x1a8c5e];return _0x10b178;};'use strict';var multer=require(_0xa9c5('0x0'));var util=require(_0xa9c5('0x1'));var path=require('path');var timeout=require(_0xa9c5('0x2'));var express=require(_0xa9c5('0x3'));var router=express[_0xa9c5('0x4')]();var auth=require(_0xa9c5('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa9c5('0x6'));var controller=require(_0xa9c5('0x7'));router['get'](_0xa9c5('0x8'),auth['isAuthenticated'](),controller[_0xa9c5('0x9')]);router[_0xa9c5('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa9c5('0xb')](_0xa9c5('0x8'),auth['isAuthenticated'](),controller[_0xa9c5('0xc')]);router[_0xa9c5('0xd')]('/:id',auth[_0xa9c5('0xe')](),controller[_0xa9c5('0xf')]);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 3a09cad..bfb85b6 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 _0xa902=['exports','STRING'];(function(_0x1733e1,_0x22a0d8){var _0x355d9f=function(_0x4dae04){while(--_0x4dae04){_0x1733e1['push'](_0x1733e1['shift']());}};_0x355d9f(++_0x22a0d8);}(_0xa902,0x126));var _0x2a90=function(_0x183cca,_0x211aa5){_0x183cca=_0x183cca-0x0;var _0x4398d6=_0xa902[_0x183cca];return _0x4398d6;};'use strict';var Sequelize=require('sequelize');module[_0x2a90('0x0')]={'name':{'type':Sequelize[_0x2a90('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x0f6a=['exports','STRING','sequelize'];(function(_0x5acb89,_0x295fa2){var _0x4e7ddf=function(_0x30e010){while(--_0x30e010){_0x5acb89['push'](_0x5acb89['shift']());}};_0x4e7ddf(++_0x295fa2);}(_0x0f6a,0xd4));var _0xa0f6=function(_0x322c99,_0x346ce6){_0x322c99=_0x322c99-0x0;var _0x2c098b=_0x0f6a[_0x322c99];return _0x2c098b;};'use strict';var Sequelize=require(_0xa0f6('0x0'));module[_0xa0f6('0x1')]={'name':{'type':Sequelize[_0xa0f6('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index c6bda0e..67a69a4 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 _0x4bd3=['bluebird','mustache','util','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','reject','save','then','UserProfileResource','destroy','stack','name','send','index','map','fieldName','type','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','key','field','merge','options','includeAll','Disposition','findAll','catch','show','rawAttributes','length','find','create','user','get','role','UserProfileSection','update','body','params','html-pdf','rimraf','zip-dir'];(function(_0x2790cf,_0x105752){var _0x23e905=function(_0x14b7cf){while(--_0x14b7cf){_0x2790cf['push'](_0x2790cf['shift']());}};_0x23e905(++_0x105752);}(_0x4bd3,0x174));var _0x34bd=function(_0x222121,_0x320c52){_0x222121=_0x222121-0x0;var _0x3602ee=_0x4bd3[_0x222121];return _0x3602ee;};'use strict';var pdf=require(_0x34bd('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x34bd('0x1'));var zipdir=require(_0x34bd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x34bd('0x3'));var Mustache=require(_0x34bd('0x4'));var util=require(_0x34bd('0x5'));var path=require('path');var sox=require(_0x34bd('0x6'));var csv=require(_0x34bd('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x34bd('0x8'));var squel=require(_0x34bd('0x9'));var crypto=require('crypto');var jsforce=require(_0x34bd('0xa'));var deskjs=require(_0x34bd('0xb'));var toCsv=require(_0x34bd('0x7'));var querystring=require(_0x34bd('0xc'));var Papa=require(_0x34bd('0xd'));var Redis=require(_0x34bd('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x34bd('0xf'));var as=require(_0x34bd('0x10'));var hardwareService=require(_0x34bd('0x11'));var logger=require(_0x34bd('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x34bd('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4ac0dc,_0x275d80){_0x275d80=_0x275d80||0xcc;return function(_0x1f19b9){if(_0x1f19b9){return _0x4ac0dc[_0x34bd('0x14')](_0x275d80);}return _0x4ac0dc[_0x34bd('0x15')](_0x275d80)[_0x34bd('0x16')]();};}function respondWithResult(_0x14cd37,_0x4134ee){_0x4134ee=_0x4134ee||0xc8;return function(_0x236f6b){if(_0x236f6b){return _0x14cd37[_0x34bd('0x15')](_0x4134ee)['json'](_0x236f6b);}};}function respondWithFilteredResult(_0x3fa6a8,_0x4d4955){return function(_0x4e3886){if(_0x4e3886){var _0x6638ed=_0x4e3886[_0x34bd('0x17')],_0x30b3f2=_0x4d4955[_0x34bd('0x18')],_0x280c1a=_0x4d4955[_0x34bd('0x18')]+_0x4d4955[_0x34bd('0x19')],_0x2dc917;if(_0x280c1a>=_0x6638ed){_0x280c1a=_0x6638ed;_0x2dc917=0xc8;}else{_0x2dc917=0xce;}_0x3fa6a8[_0x34bd('0x15')](_0x2dc917);return _0x3fa6a8[_0x34bd('0x1a')](_0x34bd('0x1b'),_0x30b3f2+'-'+_0x280c1a+'/'+_0x6638ed)['json'](_0x4e3886);}return null;};}function patchUpdates(_0x10b977){return function(_0x324f7d){try{jsonpatch[_0x34bd('0x1c')](_0x324f7d,_0x10b977,!![]);}catch(_0x220666){return BPromise[_0x34bd('0x1d')](_0x220666);}return _0x324f7d[_0x34bd('0x1e')]();};}function saveUpdates(_0x288638,_0x3d5f76){return function(_0x130bd0){if(_0x130bd0){return _0x130bd0['update'](_0x288638)[_0x34bd('0x1f')](function(_0xe02cc5){return _0xe02cc5;});}return null;};}function removeEntity(_0x49f625,_0x14254b){return function(_0x463224){if(_0x463224){return _0x463224['destroy']()['then'](function(){var _0x5da62a=_0x463224['get']({'plain':!![]});var _0x3dafe8='Dispositions';return db[_0x34bd('0x20')][_0x34bd('0x21')]({'where':{'type':_0x3dafe8,'resourceId':_0x5da62a['id']}})[_0x34bd('0x1f')](function(){return _0x463224;});})['then'](function(){_0x49f625[_0x34bd('0x15')](0xcc)[_0x34bd('0x16')]();});}};}function handleEntityNotFound(_0x4f0dff,_0x457006){return function(_0x5be702){if(!_0x5be702){_0x4f0dff[_0x34bd('0x14')](0x194);}return _0x5be702;};}function handleError(_0xb256e8,_0x264c94){_0x264c94=_0x264c94||0x1f4;return function(_0x3e4dc3){logger['error'](_0x3e4dc3[_0x34bd('0x22')]);if(_0x3e4dc3[_0x34bd('0x23')]){delete _0x3e4dc3['name'];}_0xb256e8[_0x34bd('0x15')](_0x264c94)[_0x34bd('0x24')](_0x3e4dc3);};}exports[_0x34bd('0x25')]=function(_0x3f675c,_0x26b8e7){var _0x4500c8={},_0x177d43={},_0x58b431={'count':0x0,'rows':[]};var _0x43b92d=_[_0x34bd('0x26')](db['Disposition']['rawAttributes'],function(_0x38bdba){return{'name':_0x38bdba[_0x34bd('0x27')],'type':_0x38bdba[_0x34bd('0x28')]['key']};});_0x177d43['model']=_[_0x34bd('0x26')](_0x43b92d,_0x34bd('0x23'));_0x177d43[_0x34bd('0x29')]=_[_0x34bd('0x2a')](_0x3f675c['query']);_0x177d43[_0x34bd('0x2b')]=_[_0x34bd('0x2c')](_0x177d43[_0x34bd('0x2d')],_0x177d43[_0x34bd('0x29')]);_0x4500c8[_0x34bd('0x2e')]=_[_0x34bd('0x2c')](_0x177d43['model'],qs[_0x34bd('0x2f')](_0x3f675c['query'][_0x34bd('0x2f')]));_0x4500c8[_0x34bd('0x2e')]=_0x4500c8[_0x34bd('0x2e')]['length']?_0x4500c8[_0x34bd('0x2e')]:_0x177d43[_0x34bd('0x2d')];if(!_0x3f675c['query'][_0x34bd('0x30')](_0x34bd('0x31'))){_0x4500c8[_0x34bd('0x19')]=qs['limit'](_0x3f675c[_0x34bd('0x29')][_0x34bd('0x19')]);_0x4500c8['offset']=qs[_0x34bd('0x18')](_0x3f675c[_0x34bd('0x29')][_0x34bd('0x18')]);}_0x4500c8[_0x34bd('0x32')]=qs[_0x34bd('0x33')](_0x3f675c[_0x34bd('0x29')]['sort']);_0x4500c8['where']=qs['filters'](_[_0x34bd('0x34')](_0x3f675c[_0x34bd('0x29')],_0x177d43['filters']));if(_0x3f675c['query'][_0x34bd('0x35')]){_0x4500c8['where']=_['merge'](_0x4500c8[_0x34bd('0x36')],{'$or':_[_0x34bd('0x26')](_0x43b92d,function(_0xa61859){if(_0xa61859[_0x34bd('0x28')][_0x34bd('0x37')]!=='VIRTUAL'){var _0x56765a={};_0x56765a[_0xa61859[_0x34bd('0x38')]]={'$like':'%'+_0x3f675c['query'][_0x34bd('0x35')]+'%'};return _0x56765a;}})});}_0x4500c8=_[_0x34bd('0x39')]({},_0x4500c8,_0x3f675c[_0x34bd('0x3a')]);var _0x15d62d={'where':_0x4500c8[_0x34bd('0x36')]};return db['Disposition'][_0x34bd('0x17')](_0x15d62d)[_0x34bd('0x1f')](function(_0x16858c){_0x58b431[_0x34bd('0x17')]=_0x16858c;if(_0x3f675c['query'][_0x34bd('0x3b')]){_0x4500c8['include']=[{'all':!![]}];}return db[_0x34bd('0x3c')][_0x34bd('0x3d')](_0x4500c8);})['then'](function(_0x279765){_0x58b431['rows']=_0x279765;return _0x58b431;})[_0x34bd('0x1f')](respondWithFilteredResult(_0x26b8e7,_0x4500c8))[_0x34bd('0x3e')](handleError(_0x26b8e7,null));};exports[_0x34bd('0x3f')]=function(_0x42a424,_0x26d73e){var _0xb0f197={'raw':!![],'where':{'id':_0x42a424['params']['id']}},_0x23c457={};_0x23c457['model']=_['keys'](db[_0x34bd('0x3c')][_0x34bd('0x40')]);_0x23c457[_0x34bd('0x29')]=_[_0x34bd('0x2a')](_0x42a424['query']);_0x23c457[_0x34bd('0x2b')]=_[_0x34bd('0x2c')](_0x23c457[_0x34bd('0x2d')],_0x23c457[_0x34bd('0x29')]);_0xb0f197[_0x34bd('0x2e')]=_['intersection'](_0x23c457[_0x34bd('0x2d')],qs['fields'](_0x42a424['query'][_0x34bd('0x2f')]));_0xb0f197['attributes']=_0xb0f197[_0x34bd('0x2e')][_0x34bd('0x41')]?_0xb0f197[_0x34bd('0x2e')]:_0x23c457[_0x34bd('0x2d')];if(_0x42a424[_0x34bd('0x29')]['includeAll']){_0xb0f197['include']=[{'all':!![]}];}_0xb0f197=_[_0x34bd('0x39')]({},_0xb0f197,_0x42a424['options']);return db[_0x34bd('0x3c')][_0x34bd('0x42')](_0xb0f197)[_0x34bd('0x1f')](handleEntityNotFound(_0x26d73e,null))['then'](respondWithResult(_0x26d73e,null))['catch'](handleError(_0x26d73e,null));};exports['create']=function(_0x5a68f3,_0x1ddb77){return db['Disposition'][_0x34bd('0x43')](_0x5a68f3['body'],{})[_0x34bd('0x1f')](function(_0x1d01d7){var _0x1fa341=_0x5a68f3[_0x34bd('0x44')][_0x34bd('0x45')]({'plain':!![]});if(!_0x1fa341)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1fa341[_0x34bd('0x46')]===_0x34bd('0x44')){var _0x1f4d0b=_0x1d01d7[_0x34bd('0x45')]({'plain':!![]});var _0x173da0='Dispositions';return db[_0x34bd('0x47')][_0x34bd('0x42')]({'where':{'name':_0x173da0,'userProfileId':_0x1fa341['userProfileId']},'raw':!![]})[_0x34bd('0x1f')](function(_0x1a935e){if(_0x1a935e&&_0x1a935e['autoAssociation']===0x0){return db['UserProfileResource'][_0x34bd('0x43')]({'name':_0x1f4d0b['name'],'resourceId':_0x1f4d0b['id'],'type':_0x1a935e['name'],'sectionId':_0x1a935e['id']},{})[_0x34bd('0x1f')](function(){return _0x1d01d7;});}else{return _0x1d01d7;}})[_0x34bd('0x3e')](function(_0x556ce8){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x556ce8);throw _0x556ce8;});}return _0x1d01d7;})['then'](respondWithResult(_0x1ddb77,0xc9))[_0x34bd('0x3e')](handleError(_0x1ddb77,null));};exports[_0x34bd('0x48')]=function(_0x482a0b,_0x4a8291){if(_0x482a0b['body']['id']){delete _0x482a0b[_0x34bd('0x49')]['id'];}return db[_0x34bd('0x3c')]['find']({'where':{'id':_0x482a0b[_0x34bd('0x4a')]['id']}})[_0x34bd('0x1f')](handleEntityNotFound(_0x4a8291,null))[_0x34bd('0x1f')](saveUpdates(_0x482a0b[_0x34bd('0x49')],null))[_0x34bd('0x1f')](respondWithResult(_0x4a8291,null))[_0x34bd('0x3e')](handleError(_0x4a8291,null));};exports['destroy']=function(_0x3241e1,_0xb45b50){return db[_0x34bd('0x3c')][_0x34bd('0x42')]({'where':{'id':_0x3241e1['params']['id']}})[_0x34bd('0x1f')](handleEntityNotFound(_0xb45b50,null))['then'](removeEntity(_0xb45b50,null))[_0x34bd('0x3e')](handleError(_0xb45b50,null));}; \ No newline at end of file +var _0x5fdc=['sendStatus','status','end','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','get','UserProfileResource','error','name','send','index','map','Disposition','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','merge','where','field','count','includeAll','include','rows','catch','params','find','create','body','user','role','UserProfileSection','autoAssociation','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb'];(function(_0x88b4b7,_0x3b1faf){var _0x4b5a29=function(_0x1bab45){while(--_0x1bab45){_0x88b4b7['push'](_0x88b4b7['shift']());}};_0x4b5a29(++_0x3b1faf);}(_0x5fdc,0x127));var _0xc5fd=function(_0x10a078,_0x15cf6d){_0x10a078=_0x10a078-0x0;var _0x256217=_0x5fdc[_0x10a078];return _0x256217;};'use strict';var pdf=require(_0xc5fd('0x0'));var emlformat=require(_0xc5fd('0x1'));var rimraf=require(_0xc5fd('0x2'));var zipdir=require(_0xc5fd('0x3'));var jsonpatch=require(_0xc5fd('0x4'));var rp=require(_0xc5fd('0x5'));var moment=require(_0xc5fd('0x6'));var BPromise=require(_0xc5fd('0x7'));var Mustache=require(_0xc5fd('0x8'));var util=require(_0xc5fd('0x9'));var path=require(_0xc5fd('0xa'));var sox=require(_0xc5fd('0xb'));var csv=require(_0xc5fd('0xc'));var ejs=require(_0xc5fd('0xd'));var fs=require('fs');var _=require(_0xc5fd('0xe'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc5fd('0xf'));var toCsv=require(_0xc5fd('0xc'));var querystring=require(_0xc5fd('0x10'));var Papa=require(_0xc5fd('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc5fd('0x12'));var as=require(_0xc5fd('0x13'));var hardwareService=require(_0xc5fd('0x14'));var logger=require(_0xc5fd('0x15'))(_0xc5fd('0x16'));var utils=require(_0xc5fd('0x17'));var config=require('../../config/environment');var db=require(_0xc5fd('0x18'))['db'];function respondWithStatusCode(_0x5c3577,_0x558939){_0x558939=_0x558939||0xcc;return function(_0x1b1b2b){if(_0x1b1b2b){return _0x5c3577[_0xc5fd('0x19')](_0x558939);}return _0x5c3577[_0xc5fd('0x1a')](_0x558939)[_0xc5fd('0x1b')]();};}function respondWithResult(_0x2e77a8,_0x40b0f8){_0x40b0f8=_0x40b0f8||0xc8;return function(_0x27447e){if(_0x27447e){return _0x2e77a8[_0xc5fd('0x1a')](_0x40b0f8)['json'](_0x27447e);}};}function respondWithFilteredResult(_0x124651,_0x103c3d){return function(_0x2221da){if(_0x2221da){var _0x3404e0=_0x2221da['count'],_0x4d3636=_0x103c3d['offset'],_0x4fd364=_0x103c3d[_0xc5fd('0x1c')]+_0x103c3d[_0xc5fd('0x1d')],_0x4efafd;if(_0x4fd364>=_0x3404e0){_0x4fd364=_0x3404e0;_0x4efafd=0xc8;}else{_0x4efafd=0xce;}_0x124651[_0xc5fd('0x1a')](_0x4efafd);return _0x124651[_0xc5fd('0x1e')](_0xc5fd('0x1f'),_0x4d3636+'-'+_0x4fd364+'/'+_0x3404e0)[_0xc5fd('0x20')](_0x2221da);}return null;};}function patchUpdates(_0xfd14c7){return function(_0x54d0d4){try{jsonpatch[_0xc5fd('0x21')](_0x54d0d4,_0xfd14c7,!![]);}catch(_0x27bda1){return BPromise[_0xc5fd('0x22')](_0x27bda1);}return _0x54d0d4[_0xc5fd('0x23')]();};}function saveUpdates(_0x3b3093,_0x48024e){return function(_0x3966a2){if(_0x3966a2){return _0x3966a2[_0xc5fd('0x24')](_0x3b3093)[_0xc5fd('0x25')](function(_0x216512){return _0x216512;});}return null;};}function removeEntity(_0x5a7bdc,_0x4c85d5){return function(_0x13cc42){if(_0x13cc42){return _0x13cc42[_0xc5fd('0x26')]()[_0xc5fd('0x25')](function(){var _0x42d7f4=_0x13cc42[_0xc5fd('0x27')]({'plain':!![]});var _0x311952='Dispositions';return db[_0xc5fd('0x28')][_0xc5fd('0x26')]({'where':{'type':_0x311952,'resourceId':_0x42d7f4['id']}})[_0xc5fd('0x25')](function(){return _0x13cc42;});})[_0xc5fd('0x25')](function(){_0x5a7bdc[_0xc5fd('0x1a')](0xcc)[_0xc5fd('0x1b')]();});}};}function handleEntityNotFound(_0x475b91,_0x527018){return function(_0x3a86f9){if(!_0x3a86f9){_0x475b91['sendStatus'](0x194);}return _0x3a86f9;};}function handleError(_0x2ee700,_0x231368){_0x231368=_0x231368||0x1f4;return function(_0x44681d){logger[_0xc5fd('0x29')](_0x44681d['stack']);if(_0x44681d[_0xc5fd('0x2a')]){delete _0x44681d[_0xc5fd('0x2a')];}_0x2ee700[_0xc5fd('0x1a')](_0x231368)[_0xc5fd('0x2b')](_0x44681d);};}exports[_0xc5fd('0x2c')]=function(_0x209975,_0x541c12){var _0x412ef7={},_0x5d4f70={},_0x4859f7={'count':0x0,'rows':[]};var _0x12a962=_[_0xc5fd('0x2d')](db[_0xc5fd('0x2e')][_0xc5fd('0x2f')],function(_0x7693c4){return{'name':_0x7693c4[_0xc5fd('0x30')],'type':_0x7693c4[_0xc5fd('0x31')][_0xc5fd('0x32')]};});_0x5d4f70['model']=_[_0xc5fd('0x2d')](_0x12a962,_0xc5fd('0x2a'));_0x5d4f70[_0xc5fd('0x33')]=_[_0xc5fd('0x34')](_0x209975[_0xc5fd('0x33')]);_0x5d4f70[_0xc5fd('0x35')]=_[_0xc5fd('0x36')](_0x5d4f70[_0xc5fd('0x37')],_0x5d4f70[_0xc5fd('0x33')]);_0x412ef7[_0xc5fd('0x38')]=_[_0xc5fd('0x36')](_0x5d4f70[_0xc5fd('0x37')],qs['fields'](_0x209975[_0xc5fd('0x33')][_0xc5fd('0x39')]));_0x412ef7[_0xc5fd('0x38')]=_0x412ef7[_0xc5fd('0x38')][_0xc5fd('0x3a')]?_0x412ef7[_0xc5fd('0x38')]:_0x5d4f70[_0xc5fd('0x37')];if(!_0x209975[_0xc5fd('0x33')][_0xc5fd('0x3b')]('nolimit')){_0x412ef7[_0xc5fd('0x1d')]=qs[_0xc5fd('0x1d')](_0x209975[_0xc5fd('0x33')][_0xc5fd('0x1d')]);_0x412ef7[_0xc5fd('0x1c')]=qs[_0xc5fd('0x1c')](_0x209975[_0xc5fd('0x33')]['offset']);}_0x412ef7[_0xc5fd('0x3c')]=qs[_0xc5fd('0x3d')](_0x209975['query'][_0xc5fd('0x3d')]);_0x412ef7['where']=qs[_0xc5fd('0x35')](_[_0xc5fd('0x3e')](_0x209975[_0xc5fd('0x33')],_0x5d4f70['filters']));if(_0x209975[_0xc5fd('0x33')][_0xc5fd('0x3f')]){_0x412ef7['where']=_[_0xc5fd('0x40')](_0x412ef7[_0xc5fd('0x41')],{'$or':_[_0xc5fd('0x2d')](_0x12a962,function(_0x370319){if(_0x370319[_0xc5fd('0x31')][_0xc5fd('0x32')]!=='VIRTUAL'){var _0x401e22={};_0x401e22[_0x370319[_0xc5fd('0x42')]]={'$like':'%'+_0x209975[_0xc5fd('0x33')][_0xc5fd('0x3f')]+'%'};return _0x401e22;}})});}_0x412ef7=_['merge']({},_0x412ef7,_0x209975['options']);var _0x47fe66={'where':_0x412ef7[_0xc5fd('0x41')]};return db[_0xc5fd('0x2e')][_0xc5fd('0x43')](_0x47fe66)[_0xc5fd('0x25')](function(_0x125c02){_0x4859f7[_0xc5fd('0x43')]=_0x125c02;if(_0x209975[_0xc5fd('0x33')][_0xc5fd('0x44')]){_0x412ef7[_0xc5fd('0x45')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x412ef7);})[_0xc5fd('0x25')](function(_0x53a547){_0x4859f7[_0xc5fd('0x46')]=_0x53a547;return _0x4859f7;})[_0xc5fd('0x25')](respondWithFilteredResult(_0x541c12,_0x412ef7))[_0xc5fd('0x47')](handleError(_0x541c12,null));};exports['show']=function(_0x6ebcbf,_0x350753){var _0x588905={'raw':!![],'where':{'id':_0x6ebcbf[_0xc5fd('0x48')]['id']}},_0x2cac7e={};_0x2cac7e['model']=_[_0xc5fd('0x34')](db['Disposition'][_0xc5fd('0x2f')]);_0x2cac7e[_0xc5fd('0x33')]=_['keys'](_0x6ebcbf[_0xc5fd('0x33')]);_0x2cac7e[_0xc5fd('0x35')]=_[_0xc5fd('0x36')](_0x2cac7e['model'],_0x2cac7e[_0xc5fd('0x33')]);_0x588905[_0xc5fd('0x38')]=_['intersection'](_0x2cac7e['model'],qs[_0xc5fd('0x39')](_0x6ebcbf['query']['fields']));_0x588905['attributes']=_0x588905[_0xc5fd('0x38')][_0xc5fd('0x3a')]?_0x588905[_0xc5fd('0x38')]:_0x2cac7e[_0xc5fd('0x37')];if(_0x6ebcbf[_0xc5fd('0x33')][_0xc5fd('0x44')]){_0x588905['include']=[{'all':!![]}];}_0x588905=_['merge']({},_0x588905,_0x6ebcbf['options']);return db[_0xc5fd('0x2e')][_0xc5fd('0x49')](_0x588905)[_0xc5fd('0x25')](handleEntityNotFound(_0x350753,null))['then'](respondWithResult(_0x350753,null))[_0xc5fd('0x47')](handleError(_0x350753,null));};exports['create']=function(_0x884680,_0x1c1541){return db[_0xc5fd('0x2e')][_0xc5fd('0x4a')](_0x884680[_0xc5fd('0x4b')],{})[_0xc5fd('0x25')](function(_0x54d86c){var _0x6b2f77=_0x884680[_0xc5fd('0x4c')]['get']({'plain':!![]});if(!_0x6b2f77)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x6b2f77[_0xc5fd('0x4d')]==='user'){var _0x5723cb=_0x54d86c[_0xc5fd('0x27')]({'plain':!![]});var _0x2436e9='Dispositions';return db[_0xc5fd('0x4e')][_0xc5fd('0x49')]({'where':{'name':_0x2436e9,'userProfileId':_0x6b2f77['userProfileId']},'raw':!![]})[_0xc5fd('0x25')](function(_0x346718){if(_0x346718&&_0x346718[_0xc5fd('0x4f')]===0x0){return db[_0xc5fd('0x28')][_0xc5fd('0x4a')]({'name':_0x5723cb[_0xc5fd('0x2a')],'resourceId':_0x5723cb['id'],'type':_0x346718[_0xc5fd('0x2a')],'sectionId':_0x346718['id']},{})[_0xc5fd('0x25')](function(){return _0x54d86c;});}else{return _0x54d86c;}})[_0xc5fd('0x47')](function(_0x32721e){logger[_0xc5fd('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x32721e);throw _0x32721e;});}return _0x54d86c;})[_0xc5fd('0x25')](respondWithResult(_0x1c1541,0xc9))[_0xc5fd('0x47')](handleError(_0x1c1541,null));};exports[_0xc5fd('0x24')]=function(_0x4989ce,_0xb540a){if(_0x4989ce[_0xc5fd('0x4b')]['id']){delete _0x4989ce[_0xc5fd('0x4b')]['id'];}return db[_0xc5fd('0x2e')]['find']({'where':{'id':_0x4989ce[_0xc5fd('0x48')]['id']}})['then'](handleEntityNotFound(_0xb540a,null))['then'](saveUpdates(_0x4989ce[_0xc5fd('0x4b')],null))[_0xc5fd('0x25')](respondWithResult(_0xb540a,null))[_0xc5fd('0x47')](handleError(_0xb540a,null));};exports[_0xc5fd('0x26')]=function(_0x275e18,_0x47cff9){return db['Disposition'][_0xc5fd('0x49')]({'where':{'id':_0x275e18[_0xc5fd('0x48')]['id']}})['then'](handleEntityNotFound(_0x47cff9,null))['then'](removeEntity(_0x47cff9,null))['catch'](handleError(_0x47cff9,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 6813817..d87af3f 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 _0x21f5=['name','ListId','name_chat','name_mail','name_fax','name_openchannel','OpenchannelAccountId','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./disposition.attributes','exports','define','Disposition','tools_dispositions','name_voice'];(function(_0x289968,_0x5c9c95){var _0x257e13=function(_0x2f88fe){while(--_0x2f88fe){_0x289968['push'](_0x289968['shift']());}};_0x257e13(++_0x5c9c95);}(_0x21f5,0xaf));var _0x521f=function(_0x519b36,_0x828fe2){_0x519b36=_0x519b36-0x0;var _0x368802=_0x21f5[_0x519b36];return _0x368802;};'use strict';var _=require('lodash');var util=require(_0x521f('0x0'));var logger=require(_0x521f('0x1'))(_0x521f('0x2'));var moment=require(_0x521f('0x3'));var BPromise=require(_0x521f('0x4'));var rp=require(_0x521f('0x5'));var fs=require('fs');var path=require(_0x521f('0x6'));var rimraf=require('rimraf');var config=require(_0x521f('0x7'));var attributes=require(_0x521f('0x8'));module[_0x521f('0x9')]=function(_0x2336bf,_0x3bd715){return _0x2336bf[_0x521f('0xa')](_0x521f('0xb'),attributes,{'tableName':_0x521f('0xc'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x521f('0xd'),'fields':[_0x521f('0xe'),_0x521f('0xf')]},{'unique':!![],'name':_0x521f('0x10'),'fields':[_0x521f('0xe'),'ChatWebsiteId']},{'unique':!![],'name':_0x521f('0x11'),'fields':[_0x521f('0xe'),'MailAccountId']},{'unique':!![],'name':'name_sms','fields':['name','SmsAccountId']},{'unique':!![],'name':_0x521f('0x12'),'fields':['name','FaxAccountId']},{'unique':!![],'name':_0x521f('0x13'),'fields':['name',_0x521f('0x14')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xaa77=['../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./disposition.attributes','tools_dispositions','name_voice','name','name_chat','ChatWebsiteId','name_mail','MailAccountId','SmsAccountId','name_fax','util'];(function(_0xc87d08,_0x59c9be){var _0x30a714=function(_0x437c0d){while(--_0x437c0d){_0xc87d08['push'](_0xc87d08['shift']());}};_0x30a714(++_0x59c9be);}(_0xaa77,0x1a8));var _0x7aa7=function(_0x230c11,_0x5ad7a9){_0x230c11=_0x230c11-0x0;var _0xe2f7f5=_0xaa77[_0x230c11];return _0xe2f7f5;};'use strict';var _=require('lodash');var util=require(_0x7aa7('0x0'));var logger=require(_0x7aa7('0x1'))(_0x7aa7('0x2'));var moment=require(_0x7aa7('0x3'));var BPromise=require('bluebird');var rp=require(_0x7aa7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7aa7('0x5'));var config=require(_0x7aa7('0x6'));var attributes=require(_0x7aa7('0x7'));module['exports']=function(_0x3fd538,_0x444fcb){return _0x3fd538['define']('Disposition',attributes,{'tableName':_0x7aa7('0x8'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x7aa7('0x9'),'fields':[_0x7aa7('0xa'),'ListId']},{'unique':!![],'name':_0x7aa7('0xb'),'fields':[_0x7aa7('0xa'),_0x7aa7('0xc')]},{'unique':!![],'name':_0x7aa7('0xd'),'fields':[_0x7aa7('0xa'),_0x7aa7('0xe')]},{'unique':!![],'name':'name_sms','fields':[_0x7aa7('0xa'),_0x7aa7('0xf')]},{'unique':!![],'name':_0x7aa7('0x10'),'fields':[_0x7aa7('0xa'),'FaxAccountId']},{'unique':!![],'name':'name_openchannel','fields':['name','OpenchannelAccountId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 5516870..4cd5c53 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 _0xe029=['message','info','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request','then','Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xe029,0x14e));var _0x9e02=function(_0x29d335,_0x4346a8){_0x29d335=_0x29d335-0x0;var _0x3b0563=_0xe029[_0x29d335];return _0x3b0563;};'use strict';var _=require(_0x9e02('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9e02('0x1'));var rs=require(_0x9e02('0x2'));var fs=require('fs');var Redis=require(_0x9e02('0x3'));var db=require(_0x9e02('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9e02('0x5'));var config=require(_0x9e02('0x6'));var jayson=require(_0x9e02('0x7'));var client=jayson[_0x9e02('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2edabb,_0xe80254,_0x354ec3){return new BPromise(function(_0x10e79a,_0x8fb921){return client[_0x9e02('0x9')](_0x2edabb,_0x354ec3)[_0x9e02('0xa')](function(_0x281d43){logger['info'](_0x9e02('0xb'),_0xe80254,_0x9e02('0xc'));logger[_0x9e02('0xd')](_0x9e02('0xe'),_0xe80254,'request\x20sent',JSON[_0x9e02('0xf')](_0x281d43));if(_0x281d43[_0x9e02('0x10')]){if(_0x281d43[_0x9e02('0x10')][_0x9e02('0x11')]===0x1f4){logger[_0x9e02('0x10')]('Disposition,\x20%s,\x20%s',_0xe80254,_0x281d43[_0x9e02('0x10')][_0x9e02('0x12')]);return _0x8fb921(_0x281d43[_0x9e02('0x10')]['message']);}logger['error'](_0x9e02('0xb'),_0xe80254,_0x281d43[_0x9e02('0x10')]['message']);return _0x10e79a(_0x281d43[_0x9e02('0x10')][_0x9e02('0x12')]);}else{logger[_0x9e02('0x13')](_0x9e02('0xb'),_0xe80254,'request\x20sent');_0x10e79a(_0x281d43[_0x9e02('0x14')][_0x9e02('0x12')]);}})[_0x9e02('0x15')](function(_0x2037c2){logger[_0x9e02('0x10')](_0x9e02('0xb'),_0xe80254,_0x2037c2);_0x8fb921(_0x2037c2);});});} \ No newline at end of file +var _0xf584=['code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','Disposition,\x20%s,\x20%s','Disposition,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xbef475,_0x25ddda){var _0x32fe31=function(_0xdfd6d0){while(--_0xdfd6d0){_0xbef475['push'](_0xbef475['shift']());}};_0x32fe31(++_0x25ddda);}(_0xf584,0xb5));var _0x4f58=function(_0xf1c03c,_0x4f2967){_0xf1c03c=_0xf1c03c-0x0;var _0x25d7a8=_0xf584[_0xf1c03c];return _0x25d7a8;};'use strict';var _=require(_0x4f58('0x0'));var util=require(_0x4f58('0x1'));var moment=require(_0x4f58('0x2'));var BPromise=require(_0x4f58('0x3'));var rs=require(_0x4f58('0x4'));var fs=require('fs');var Redis=require(_0x4f58('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4f58('0x6'));var logger=require(_0x4f58('0x7'))(_0x4f58('0x8'));var config=require(_0x4f58('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2b2fce,_0x19b162,_0x410fe2){return new BPromise(function(_0x4042f5,_0x61392f){return client[_0x4f58('0xa')](_0x2b2fce,_0x410fe2)[_0x4f58('0xb')](function(_0x2095fb){logger[_0x4f58('0xc')](_0x4f58('0xd'),_0x19b162,'request\x20sent');logger['debug'](_0x4f58('0xe'),_0x19b162,'request\x20sent',JSON[_0x4f58('0xf')](_0x2095fb));if(_0x2095fb[_0x4f58('0x10')]){if(_0x2095fb[_0x4f58('0x10')][_0x4f58('0x11')]===0x1f4){logger[_0x4f58('0x10')](_0x4f58('0xd'),_0x19b162,_0x2095fb[_0x4f58('0x10')][_0x4f58('0x12')]);return _0x61392f(_0x2095fb[_0x4f58('0x10')][_0x4f58('0x12')]);}logger[_0x4f58('0x10')](_0x4f58('0xd'),_0x19b162,_0x2095fb[_0x4f58('0x10')][_0x4f58('0x12')]);return _0x4042f5(_0x2095fb['error'][_0x4f58('0x12')]);}else{logger[_0x4f58('0xc')](_0x4f58('0xd'),_0x19b162,_0x4f58('0x13'));_0x4042f5(_0x2095fb[_0x4f58('0x14')][_0x4f58('0x12')]);}})[_0x4f58('0x15')](function(_0x4ac6f6){logger[_0x4f58('0x10')](_0x4f58('0xd'),_0x19b162,_0x4ac6f6);_0x61392f(_0x4ac6f6);});});} \ No newline at end of file diff --git a/server/api/disposition/index.js b/server/api/disposition/index.js index c8d2eaa..4e5131b 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 _0xc2c7=['update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','post','create','put','/:id'];(function(_0x32bcb5,_0x1772a7){var _0x3bc407=function(_0x2b29d2){while(--_0x2b29d2){_0x32bcb5['push'](_0x32bcb5['shift']());}};_0x3bc407(++_0x1772a7);}(_0xc2c7,0x134));var _0x7c2c=function(_0x321e86,_0x4bd0ed){_0x321e86=_0x321e86-0x0;var _0x441eaf=_0xc2c7[_0x321e86];return _0x441eaf;};'use strict';var multer=require('multer');var util=require(_0x7c2c('0x0'));var path=require(_0x7c2c('0x1'));var timeout=require(_0x7c2c('0x2'));var express=require(_0x7c2c('0x3'));var router=express[_0x7c2c('0x4')]();var auth=require(_0x7c2c('0x5'));var interaction=require(_0x7c2c('0x6'));var config=require(_0x7c2c('0x7'));var controller=require('./disposition.controller');router['get']('/',auth[_0x7c2c('0x8')](),controller[_0x7c2c('0x9')]);router[_0x7c2c('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x7c2c('0xb')]('/',auth[_0x7c2c('0x8')](),controller[_0x7c2c('0xc')]);router[_0x7c2c('0xd')](_0x7c2c('0xe'),auth['isAuthenticated'](),controller[_0x7c2c('0xf')]);router[_0x7c2c('0x10')](_0x7c2c('0xe'),auth[_0x7c2c('0x8')](),controller[_0x7c2c('0x11')]);module[_0x7c2c('0x12')]=router; \ No newline at end of file +var _0x7ea9=['/:id','show','post','create','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./disposition.controller','isAuthenticated','index','get'];(function(_0x599d7f,_0xc586e8){var _0x3346d3=function(_0x56b820){while(--_0x56b820){_0x599d7f['push'](_0x599d7f['shift']());}};_0x3346d3(++_0xc586e8);}(_0x7ea9,0xec));var _0x97ea=function(_0x39ea6a,_0x3af7c0){_0x39ea6a=_0x39ea6a-0x0;var _0x2277ea=_0x7ea9[_0x39ea6a];return _0x2277ea;};'use strict';var multer=require('multer');var util=require(_0x97ea('0x0'));var path=require(_0x97ea('0x1'));var timeout=require(_0x97ea('0x2'));var express=require(_0x97ea('0x3'));var router=express[_0x97ea('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x97ea('0x5'));var config=require(_0x97ea('0x6'));var controller=require(_0x97ea('0x7'));router['get']('/',auth[_0x97ea('0x8')](),controller[_0x97ea('0x9')]);router[_0x97ea('0xa')](_0x97ea('0xb'),auth['isAuthenticated'](),controller[_0x97ea('0xc')]);router[_0x97ea('0xd')]('/',auth['isAuthenticated'](),controller[_0x97ea('0xe')]);router['put'](_0x97ea('0xb'),auth['isAuthenticated'](),controller[_0x97ea('0xf')]);router[_0x97ea('0x10')]('/:id',auth[_0x97ea('0x8')](),controller[_0x97ea('0x11')]);module[_0x97ea('0x12')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index f994a54..c1e3149 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 _0xc112=['mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','9600','12000','14400','4800','v17,v27,v29','INTEGER','IAX','DADHI','TEXT','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue'];(function(_0x5aa127,_0x4d30c6){var _0x297cbb=function(_0x5cabef){while(--_0x5cabef){_0x5aa127['push'](_0x5aa127['shift']());}};_0x297cbb(++_0x4d30c6);}(_0xc112,0xb2));var _0x2c11=function(_0x24217f,_0x3d396c){_0x24217f=_0x24217f-0x0;var _0x5285cd=_0xc112[_0x24217f];return _0x5285cd;};'use strict';var Sequelize=require('sequelize');module[_0x2c11('0x0')]={'name':{'type':Sequelize[_0x2c11('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize[_0x2c11('0x2')](_0x2c11('0x3'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0x2c11('0x1')],'defaultValue':_0x2c11('0x4')},'localstationid':{'type':Sequelize['STRING'],'unique':_0x2c11('0x5')},'minrate':{'type':Sequelize['ENUM'](_0x2c11('0x6'),'4800','7200',_0x2c11('0x7'),_0x2c11('0x8'),_0x2c11('0x9')),'defaultValue':_0x2c11('0xa')},'maxrate':{'type':Sequelize[_0x2c11('0x2')](_0x2c11('0x6'),'4800','7200',_0x2c11('0x7'),_0x2c11('0x8'),'14400'),'defaultValue':'14400'},'modem':{'type':Sequelize[_0x2c11('0x1')],'defaultValue':_0x2c11('0xb')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x2c11('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x2c11('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x2c11('0x2')]('SIP',_0x2c11('0xd'),_0x2c11('0xe'),'KHOMP'),'defaultValue':'SIP'},'key':{'type':Sequelize[_0x2c11('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x2c11('0xf')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x2c11('0x10')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x2c11('0x10')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x2c11('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2c11('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x2c11('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2c11('0xc')],'allowNull':!![],'defaultValue':null,'comment':_0x2c11('0x11')},'mandatoryDisposition':{'type':Sequelize[_0x2c11('0x10')],'defaultValue':![],'comment':_0x2c11('0x12'),'set':function(_0x29dfe0){if(!_0x29dfe0)this[_0x2c11('0x13')](_0x2c11('0x14'),null);this[_0x2c11('0x13')](_0x2c11('0x15'),_0x29dfe0);}}}; \ No newline at end of file +var _0x7757=['STRING','yes','xCALLY\x20Motion\x20Fax','ENUM','2400','4800','7200','12000','14400','9600','v17,v27,v29','INTEGER','IAX','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports'];(function(_0x46f1ce,_0x3e7d08){var _0x1f2370=function(_0x3fd370){while(--_0x3fd370){_0x46f1ce['push'](_0x46f1ce['shift']());}};_0x1f2370(++_0x3e7d08);}(_0x7757,0x185));var _0x7775=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x7757[_0x3054be];return _0x3df150;};'use strict';var Sequelize=require(_0x7775('0x0'));module[_0x7775('0x1')]={'name':{'type':Sequelize[_0x7775('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x7775('0x2')]},'ecm':{'type':Sequelize['ENUM'](_0x7775('0x3'),'no'),'defaultValue':_0x7775('0x3')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':_0x7775('0x4')},'localstationid':{'type':Sequelize['STRING'],'unique':'localstationid'},'minrate':{'type':Sequelize[_0x7775('0x5')](_0x7775('0x6'),_0x7775('0x7'),_0x7775('0x8'),'9600',_0x7775('0x9'),_0x7775('0xa')),'defaultValue':_0x7775('0x7')},'maxrate':{'type':Sequelize[_0x7775('0x5')](_0x7775('0x6'),_0x7775('0x7'),_0x7775('0x8'),_0x7775('0xb'),_0x7775('0x9'),_0x7775('0xa')),'defaultValue':_0x7775('0xa')},'modem':{'type':Sequelize[_0x7775('0x2')],'defaultValue':_0x7775('0xc')},'gateway':{'type':Sequelize['STRING'],'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[_0x7775('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM']('SIP',_0x7775('0xe'),'DADHI',_0x7775('0xf')),'defaultValue':'SIP'},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x7775('0x10')],'defaultValue':function(){return _0x7775('0x11');}},'notificationSound':{'type':Sequelize[_0x7775('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x7775('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x7775('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x7775('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x7775('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7775('0xd')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x7775('0x13'),'set':function(_0x23e094){if(!_0x23e094)this[_0x7775('0x14')](_0x7775('0x15'),null);this[_0x7775('0x14')](_0x7775('0x16'),_0x23e094);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index f09977e..d549ee6 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 _0x3bfe=['message','result','catch','sendStatus','status','end','count','offset','limit','set','json','apply','save','update','destroy','then','get','FaxAccounts','name','index','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','model','query','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','filters','field','filter','merge','options','FaxAccount','includeAll','include','findAll','rows','show','params','keys','fields','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','FaxAccountId','getDispositions','Disposition','pick','removeDispositions','ids','getAnswers','findOne','CannedAnswer','addInteraction','FaxInteraction','omit','getInteractions','CmContact','Contact','User','Owner','Tag','Tags','tag','addApplications','sequelize','FaxApplication','bulkCreate','priority','getApplications','from-voip-provider','exten','localstationid','app','description','Fax\x20Extension','appdata','push','CDR(type)=inbound-fax','gateway','faxdetect','headerinfo','maxrate','minrate','modem','t38timeout','FAXOPT(','Set','/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','transaction','VoiceExtension','updateAccountApplications','key','updatedAt','TrunkId','findById','$gte','split','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','CmList','List','Contacts','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','format','fax','ListId','List\x20not\x20found','Send\x20Fax\x20failed','user','out','filename','Messages','Contact\x20not\x20found','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','spread','userFaxAccount:save','removeAgents','isArray','emit','userFaxAccount:remove','getAgents','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','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','debug','stringify','error','code'];(function(_0x3d3856,_0xe556c1){var _0x333ed6=function(_0x2932f7){while(--_0x2932f7){_0x3d3856['push'](_0x3d3856['shift']());}};_0x333ed6(++_0xe556c1);}(_0x3bfe,0x155));var _0xe3bf=function(_0x2ca4fd,_0x1611cc){_0x2ca4fd=_0x2ca4fd-0x0;var _0x24d1cd=_0x3bfe[_0x2ca4fd];return _0x24d1cd;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe3bf('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe3bf('0x1'));var moment=require(_0xe3bf('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xe3bf('0x3'));var util=require(_0xe3bf('0x4'));var path=require(_0xe3bf('0x5'));var sox=require(_0xe3bf('0x6'));var csv=require(_0xe3bf('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xe3bf('0x8'));var squel=require(_0xe3bf('0x9'));var crypto=require(_0xe3bf('0xa'));var jsforce=require(_0xe3bf('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xe3bf('0x7'));var querystring=require(_0xe3bf('0xc'));var Papa=require(_0xe3bf('0xd'));var Redis=require(_0xe3bf('0xe'));var authService=require(_0xe3bf('0xf'));var qs=require(_0xe3bf('0x10'));var as=require(_0xe3bf('0x11'));var hardwareService=require(_0xe3bf('0x12'));var logger=require(_0xe3bf('0x13'))(_0xe3bf('0x14'));var utils=require(_0xe3bf('0x15'));var config=require(_0xe3bf('0x16'));var db=require(_0xe3bf('0x17'))['db'];config[_0xe3bf('0x18')]=_[_0xe3bf('0x19')](config[_0xe3bf('0x18')],{'host':_0xe3bf('0x1a'),'port':0x18eb});var socket=require(_0xe3bf('0x1b'))(new Redis(config[_0xe3bf('0x18')]));require('./faxAccount.socket')[_0xe3bf('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xe3bf('0x1d')]({'port':0x232c});var client9002=jayson[_0xe3bf('0x1e')][_0xe3bf('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x5ca5cb,_0x9c912a,_0xcdc9ac){if(_0xcdc9ac){var _0x48bda0=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x48bda0[_0xe3bf('0x1f')](_0x9c912a)){return _0x5ca5cb;}else{throw new Error(_0xe3bf('0x20'));}}else{return _0x5ca5cb;}}function respondWithRpcPromise(_0x169125,_0xeaeea8,_0x86e1db,_0x2fd5bd){return new BPromise(function(_0x1ec3c4,_0x542f61){var _0x16f594=_0x2fd5bd||client;return _0x16f594[_0xe3bf('0x21')](_0x169125,_0x86e1db)['then'](function(_0x59ce2e){logger[_0xe3bf('0x22')](_0xe3bf('0x23'),_0xeaeea8,_0xe3bf('0x24'));logger[_0xe3bf('0x25')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0xeaeea8,_0xe3bf('0x24'),JSON[_0xe3bf('0x26')](_0x59ce2e));if(_0x59ce2e[_0xe3bf('0x27')]){if(_0x59ce2e[_0xe3bf('0x27')][_0xe3bf('0x28')]===0x1f4){logger[_0xe3bf('0x27')](_0xe3bf('0x23'),_0xeaeea8,_0x59ce2e['error'][_0xe3bf('0x29')]);return _0x542f61(_0x59ce2e[_0xe3bf('0x27')][_0xe3bf('0x29')]);}logger[_0xe3bf('0x27')]('FaxAccount,\x20%s,\x20%s',_0xeaeea8,_0x59ce2e[_0xe3bf('0x27')][_0xe3bf('0x29')]);return _0x1ec3c4(_0x59ce2e['error']['message']);}else{logger[_0xe3bf('0x22')](_0xe3bf('0x23'),_0xeaeea8,_0xe3bf('0x24'));_0x1ec3c4(_0x59ce2e[_0xe3bf('0x2a')][_0xe3bf('0x29')]);}})[_0xe3bf('0x2b')](function(_0x38cbdd){logger[_0xe3bf('0x27')](_0xe3bf('0x23'),_0xeaeea8,_0x38cbdd);_0x542f61(_0x38cbdd);});});}function respondWithStatusCode(_0x4abeb7,_0x4d1a9a){_0x4d1a9a=_0x4d1a9a||0xcc;return function(_0xe9cad3){if(_0xe9cad3){return _0x4abeb7[_0xe3bf('0x2c')](_0x4d1a9a);}return _0x4abeb7[_0xe3bf('0x2d')](_0x4d1a9a)[_0xe3bf('0x2e')]();};}function respondWithResult(_0x18a742,_0x1c775c){_0x1c775c=_0x1c775c||0xc8;return function(_0x1a694c){if(_0x1a694c){return _0x18a742[_0xe3bf('0x2d')](_0x1c775c)['json'](_0x1a694c);}};}function respondWithFilteredResult(_0x47bef3,_0x2f95d2){return function(_0x87a57){if(_0x87a57){var _0x47f057=_0x87a57[_0xe3bf('0x2f')],_0x46e081=_0x2f95d2[_0xe3bf('0x30')],_0x4db7f9=_0x2f95d2['offset']+_0x2f95d2[_0xe3bf('0x31')],_0x34ab22;if(_0x4db7f9>=_0x47f057){_0x4db7f9=_0x47f057;_0x34ab22=0xc8;}else{_0x34ab22=0xce;}_0x47bef3['status'](_0x34ab22);return _0x47bef3[_0xe3bf('0x32')]('Content-Range',_0x46e081+'-'+_0x4db7f9+'/'+_0x47f057)[_0xe3bf('0x33')](_0x87a57);}return null;};}function patchUpdates(_0x1ab603){return function(_0x407242){try{jsonpatch[_0xe3bf('0x34')](_0x407242,_0x1ab603,!![]);}catch(_0x2309d8){return BPromise['reject'](_0x2309d8);}return _0x407242[_0xe3bf('0x35')]();};}function saveUpdates(_0x5b8909,_0x26f064){return function(_0x131116){if(_0x131116){return _0x131116[_0xe3bf('0x36')](_0x5b8909)['then'](function(_0x3e19f7){return _0x3e19f7;});}return null;};}function removeEntity(_0x39fd39,_0x1564e8){return function(_0x2f355){if(_0x2f355){return _0x2f355[_0xe3bf('0x37')]()[_0xe3bf('0x38')](function(){var _0x259883=_0x2f355[_0xe3bf('0x39')]({'plain':!![]});var _0x1ee1d2=_0xe3bf('0x3a');return db['UserProfileResource'][_0xe3bf('0x37')]({'where':{'type':_0x1ee1d2,'resourceId':_0x259883['id']}})[_0xe3bf('0x38')](function(){return _0x2f355;});})[_0xe3bf('0x38')](function(){_0x39fd39[_0xe3bf('0x2d')](0xcc)[_0xe3bf('0x2e')]();});}};}function handleEntityNotFound(_0x37f11b,_0x24d350){return function(_0x5c6095){if(!_0x5c6095){_0x37f11b[_0xe3bf('0x2c')](0x194);}return _0x5c6095;};}function handleError(_0x1630e9,_0x3a1f34){_0x3a1f34=_0x3a1f34||0x1f4;return function(_0x589b60){logger[_0xe3bf('0x27')](_0x589b60['stack']);if(_0x589b60[_0xe3bf('0x3b')]){delete _0x589b60['name'];}_0x1630e9[_0xe3bf('0x2d')](_0x3a1f34)['send'](_0x589b60);};}exports[_0xe3bf('0x3c')]=function(_0x1b9e40,_0x3f9687){var _0x55f26a={'include':[{'model':db[_0xe3bf('0x3d')],'as':_0xe3bf('0x3e')}]},_0x40a351={},_0x2f3f33={'count':0x0,'rows':[]};var _0x1304a4=_[_0xe3bf('0x3f')](db['FaxAccount'][_0xe3bf('0x40')],function(_0x3c5796){return{'name':_0x3c5796[_0xe3bf('0x41')],'type':_0x3c5796[_0xe3bf('0x42')]['key']};});_0x40a351[_0xe3bf('0x43')]=_[_0xe3bf('0x3f')](_0x1304a4,'name');_0x40a351[_0xe3bf('0x44')]=_['keys'](_0x1b9e40[_0xe3bf('0x44')]);_0x40a351['filters']=_[_0xe3bf('0x45')](_0x40a351[_0xe3bf('0x43')],_0x40a351['query']);_0x55f26a[_0xe3bf('0x46')]=_[_0xe3bf('0x45')](_0x40a351['model'],qs['fields'](_0x1b9e40['query']['fields']));_0x55f26a[_0xe3bf('0x46')]=_0x55f26a[_0xe3bf('0x46')]['length']?_0x55f26a[_0xe3bf('0x46')]:_0x40a351[_0xe3bf('0x43')];if(!_0x1b9e40['query'][_0xe3bf('0x47')](_0xe3bf('0x48'))){_0x55f26a['limit']=qs[_0xe3bf('0x31')](_0x1b9e40['query'][_0xe3bf('0x31')]);_0x55f26a[_0xe3bf('0x30')]=qs[_0xe3bf('0x30')](_0x1b9e40[_0xe3bf('0x44')]['offset']);}_0x55f26a[_0xe3bf('0x49')]=qs[_0xe3bf('0x4a')](_0x1b9e40[_0xe3bf('0x44')][_0xe3bf('0x4a')]);_0x55f26a[_0xe3bf('0x4b')]=qs[_0xe3bf('0x4c')](_['pick'](_0x1b9e40[_0xe3bf('0x44')],_0x40a351['filters']));if(_0x1b9e40[_0xe3bf('0x44')]['filter']){_0x55f26a[_0xe3bf('0x4b')]=_['merge'](_0x55f26a[_0xe3bf('0x4b')],{'$or':_[_0xe3bf('0x3f')](_0x1304a4,function(_0x463fc1){if(_0x463fc1[_0xe3bf('0x42')]['key']!=='VIRTUAL'){var _0x2cdce0={};_0x2cdce0[_0x463fc1[_0xe3bf('0x4d')]]={'$like':'%'+_0x1b9e40[_0xe3bf('0x44')][_0xe3bf('0x4e')]+'%'};return _0x2cdce0;}})});}_0x55f26a=_[_0xe3bf('0x4f')]({},_0x55f26a,_0x1b9e40[_0xe3bf('0x50')]);var _0x463ceb={'where':_0x55f26a[_0xe3bf('0x4b')]};return db[_0xe3bf('0x51')][_0xe3bf('0x2f')](_0x463ceb)[_0xe3bf('0x38')](function(_0x381491){_0x2f3f33['count']=_0x381491;if(_0x1b9e40[_0xe3bf('0x44')][_0xe3bf('0x52')]){_0x55f26a[_0xe3bf('0x53')]=[{'all':!![]}];}return db[_0xe3bf('0x51')][_0xe3bf('0x54')](_0x55f26a);})['then'](function(_0x255504){_0x2f3f33[_0xe3bf('0x55')]=_0x255504;return _0x2f3f33;})[_0xe3bf('0x38')](respondWithFilteredResult(_0x3f9687,_0x55f26a))['catch'](handleError(_0x3f9687,null));};exports[_0xe3bf('0x56')]=function(_0x51224c,_0x42a08f){var _0x4a6fba={'raw':![],'where':{'id':_0x51224c[_0xe3bf('0x57')]['id']},'include':[{'model':db['Pause'],'as':_0xe3bf('0x3e')}]},_0xd3c945={};_0xd3c945[_0xe3bf('0x43')]=_[_0xe3bf('0x58')](db['FaxAccount']['rawAttributes']);_0xd3c945[_0xe3bf('0x44')]=_['keys'](_0x51224c[_0xe3bf('0x44')]);_0xd3c945['filters']=_[_0xe3bf('0x45')](_0xd3c945['model'],_0xd3c945[_0xe3bf('0x44')]);_0x4a6fba['attributes']=_[_0xe3bf('0x45')](_0xd3c945['model'],qs[_0xe3bf('0x59')](_0x51224c[_0xe3bf('0x44')]['fields']));_0x4a6fba[_0xe3bf('0x46')]=_0x4a6fba[_0xe3bf('0x46')][_0xe3bf('0x5a')]?_0x4a6fba[_0xe3bf('0x46')]:_0xd3c945[_0xe3bf('0x43')];if(_0x51224c['query']['includeAll']){_0x4a6fba[_0xe3bf('0x53')]=[{'all':!![]}];}_0x4a6fba=_['merge']({},_0x4a6fba,_0x51224c[_0xe3bf('0x50')]);return db[_0xe3bf('0x51')][_0xe3bf('0x5b')](_0x4a6fba)[_0xe3bf('0x38')](handleEntityNotFound(_0x42a08f,null))[_0xe3bf('0x38')](respondWithResult(_0x42a08f,null))[_0xe3bf('0x2b')](handleError(_0x42a08f,null));};exports[_0xe3bf('0x5c')]=function(_0x27d6c1,_0x4b968a){return db[_0xe3bf('0x51')][_0xe3bf('0x5c')](_0x27d6c1[_0xe3bf('0x5d')],{})[_0xe3bf('0x38')](function(_0x3f7b78){var _0x2c567d=_0x27d6c1['user'][_0xe3bf('0x39')]({'plain':!![]});if(!_0x2c567d)throw new Error(_0xe3bf('0x5e'));if(_0x2c567d[_0xe3bf('0x5f')]==='user'){var _0x374cc2=_0x3f7b78[_0xe3bf('0x39')]({'plain':!![]});var _0x21d868=_0xe3bf('0x3a');return db[_0xe3bf('0x60')][_0xe3bf('0x5b')]({'where':{'name':_0x21d868,'userProfileId':_0x2c567d[_0xe3bf('0x61')]},'raw':!![]})['then'](function(_0x532bdf){if(_0x532bdf&&_0x532bdf[_0xe3bf('0x62')]===0x0){return db['UserProfileResource'][_0xe3bf('0x5c')]({'name':_0x374cc2['name'],'resourceId':_0x374cc2['id'],'type':_0x532bdf['name'],'sectionId':_0x532bdf['id']},{})[_0xe3bf('0x38')](function(){return _0x3f7b78;});}else{return _0x3f7b78;}})['catch'](function(_0x2341c0){logger['error'](_0xe3bf('0x63'),_0x2341c0);throw _0x2341c0;});}return _0x3f7b78;})[_0xe3bf('0x38')](respondWithResult(_0x4b968a,0xc9))[_0xe3bf('0x2b')](handleError(_0x4b968a,null));};exports[_0xe3bf('0x36')]=function(_0x320bb7,_0x34eec8){if(_0x320bb7[_0xe3bf('0x5d')]['id']){delete _0x320bb7[_0xe3bf('0x5d')]['id'];}return db[_0xe3bf('0x51')][_0xe3bf('0x5b')]({'where':{'id':_0x320bb7['params']['id']},'include':[{'model':db[_0xe3bf('0x3d')],'as':_0xe3bf('0x3e')}]})[_0xe3bf('0x38')](handleEntityNotFound(_0x34eec8,null))[_0xe3bf('0x38')](saveUpdates(_0x320bb7[_0xe3bf('0x5d')],null))[_0xe3bf('0x38')](respondWithResult(_0x34eec8,null))['catch'](handleError(_0x34eec8,null));};exports[_0xe3bf('0x37')]=function(_0xea0abc,_0x50a1e4){return db[_0xe3bf('0x51')]['find']({'where':{'id':_0xea0abc[_0xe3bf('0x57')]['id']}})['then'](handleEntityNotFound(_0x50a1e4,null))[_0xe3bf('0x38')](removeEntity(_0x50a1e4,null))[_0xe3bf('0x2b')](handleError(_0x50a1e4,null));};exports['describe']=function(_0x3ef93c,_0x3fef9f){return db[_0xe3bf('0x51')][_0xe3bf('0x64')]()[_0xe3bf('0x38')](respondWithResult(_0x3fef9f,null))['catch'](handleError(_0x3fef9f,null));};exports[_0xe3bf('0x65')]=function(_0x152691,_0x1b759c,_0xbafaae){if(_0x152691['body']['id']){delete _0x152691[_0xe3bf('0x5d')]['id'];}return db[_0xe3bf('0x51')][_0xe3bf('0x5b')]({'where':{'id':_0x152691[_0xe3bf('0x57')]['id']}})[_0xe3bf('0x38')](handleEntityNotFound(_0x1b759c,null))[_0xe3bf('0x38')](function(_0x3df356){if(_0x3df356){_0x152691[_0xe3bf('0x5d')][_0xe3bf('0x66')]=_0x3df356['id'];return db['Disposition'][_0xe3bf('0x5c')](_0x152691[_0xe3bf('0x5d')]);}})[_0xe3bf('0x38')](respondWithResult(_0x1b759c,null))[_0xe3bf('0x2b')](handleError(_0x1b759c,null));};exports[_0xe3bf('0x67')]=function(_0x1824c7,_0x50e760,_0x5c7e6a){var _0x226bf9={'raw':![],'where':{}};var _0x1df5f8={};var _0x40fc6f={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x1824c7['params']['id']}})[_0xe3bf('0x38')](handleEntityNotFound(_0x50e760,null))[_0xe3bf('0x38')](function(_0x549d49){if(_0x549d49){_0x1df5f8[_0xe3bf('0x43')]=_['keys'](db[_0xe3bf('0x68')][_0xe3bf('0x40')]);_0x1df5f8[_0xe3bf('0x44')]=_['keys'](_0x1824c7['query']);_0x1df5f8[_0xe3bf('0x4c')]=_[_0xe3bf('0x45')](_0x1df5f8[_0xe3bf('0x43')],_0x1df5f8[_0xe3bf('0x44')]);_0x226bf9[_0xe3bf('0x46')]=_[_0xe3bf('0x45')](_0x1df5f8['model'],qs[_0xe3bf('0x59')](_0x1824c7['query']['fields']));_0x226bf9[_0xe3bf('0x46')]=_0x226bf9[_0xe3bf('0x46')][_0xe3bf('0x5a')]?_0x226bf9[_0xe3bf('0x46')]:_0x1df5f8[_0xe3bf('0x43')];if(!_0x1824c7['query'][_0xe3bf('0x47')]('nolimit')){_0x226bf9[_0xe3bf('0x31')]=qs[_0xe3bf('0x31')](_0x1824c7[_0xe3bf('0x44')]['limit']);_0x226bf9['offset']=qs[_0xe3bf('0x30')](_0x1824c7[_0xe3bf('0x44')][_0xe3bf('0x30')]);}_0x226bf9[_0xe3bf('0x49')]=qs[_0xe3bf('0x4a')](_0x1824c7[_0xe3bf('0x44')][_0xe3bf('0x4a')]);_0x226bf9['where']=qs['filters'](_[_0xe3bf('0x69')](_0x1824c7[_0xe3bf('0x44')],_0x1df5f8['filters']));_0x226bf9['where'][_0xe3bf('0x66')]=_0x549d49['id'];if(_0x1824c7['query'][_0xe3bf('0x4e')]){_0x226bf9[_0xe3bf('0x4b')]=_[_0xe3bf('0x4f')](_0x226bf9[_0xe3bf('0x4b')],{'$or':_['map'](_0x226bf9['attributes'],function(_0x2ea316){var _0x322acd={};_0x322acd[_0x2ea316]={'$like':'%'+_0x1824c7[_0xe3bf('0x44')][_0xe3bf('0x4e')]+'%'};return _0x322acd;})});}_0x226bf9=_[_0xe3bf('0x4f')]({},_0x226bf9,_0x1824c7[_0xe3bf('0x50')]);return db[_0xe3bf('0x68')][_0xe3bf('0x2f')]({'where':_0x226bf9[_0xe3bf('0x4b')]})[_0xe3bf('0x38')](function(_0xdae2a7){_0x40fc6f[_0xe3bf('0x2f')]=_0xdae2a7;if(_0x1824c7['query'][_0xe3bf('0x52')]){_0x226bf9[_0xe3bf('0x53')]=[{'all':!![]}];}return db[_0xe3bf('0x68')]['findAll'](_0x226bf9);})[_0xe3bf('0x38')](function(_0x52acf1){_0x40fc6f['rows']=_0x52acf1;return _0x40fc6f;});}})[_0xe3bf('0x38')](respondWithFilteredResult(_0x50e760,_0x226bf9))[_0xe3bf('0x2b')](handleError(_0x50e760,null));};exports[_0xe3bf('0x6a')]=function(_0x23b8d7,_0x4648d1,_0x3e4706){return db[_0xe3bf('0x51')]['find']({'where':{'id':_0x23b8d7[_0xe3bf('0x57')]['id']}})[_0xe3bf('0x38')](handleEntityNotFound(_0x4648d1,null))['then'](function(_0x4dde1f){if(_0x4dde1f){return _0x4dde1f[_0xe3bf('0x6a')](_0x23b8d7[_0xe3bf('0x44')][_0xe3bf('0x6b')]);}})[_0xe3bf('0x38')](respondWithStatusCode(_0x4648d1,null))[_0xe3bf('0x2b')](handleError(_0x4648d1,null));};exports['addAnswer']=function(_0x3cc58b,_0x105712,_0x4a2bc2){if(_0x3cc58b[_0xe3bf('0x5d')]['id']){delete _0x3cc58b[_0xe3bf('0x5d')]['id'];}return db['FaxAccount'][_0xe3bf('0x5b')]({'where':{'id':_0x3cc58b[_0xe3bf('0x57')]['id']}})[_0xe3bf('0x38')](handleEntityNotFound(_0x105712,null))[_0xe3bf('0x38')](function(_0x5670ef){if(_0x5670ef){_0x3cc58b[_0xe3bf('0x5d')][_0xe3bf('0x66')]=_0x5670ef['id'];return db['CannedAnswer']['create'](_0x3cc58b[_0xe3bf('0x5d')]);}})[_0xe3bf('0x38')](respondWithResult(_0x105712,null))[_0xe3bf('0x2b')](handleError(_0x105712,null));};exports[_0xe3bf('0x6c')]=function(_0x1309ab,_0x58f322,_0x5cd899){var _0x4cbc7b={'raw':![],'where':{}};var _0x589ebe={};var _0x5d7c88={'count':0x0,'rows':[]};return db['FaxAccount'][_0xe3bf('0x6d')]({'where':{'id':_0x1309ab[_0xe3bf('0x57')]['id']}})[_0xe3bf('0x38')](handleEntityNotFound(_0x58f322,null))[_0xe3bf('0x38')](function(_0x2c0d1f){if(_0x2c0d1f){_0x589ebe[_0xe3bf('0x43')]=_[_0xe3bf('0x58')](db[_0xe3bf('0x6e')]['rawAttributes']);_0x589ebe['query']=_[_0xe3bf('0x58')](_0x1309ab['query']);_0x589ebe[_0xe3bf('0x4c')]=_[_0xe3bf('0x45')](_0x589ebe[_0xe3bf('0x43')],_0x589ebe[_0xe3bf('0x44')]);_0x4cbc7b[_0xe3bf('0x46')]=_[_0xe3bf('0x45')](_0x589ebe['model'],qs[_0xe3bf('0x59')](_0x1309ab['query'][_0xe3bf('0x59')]));_0x4cbc7b[_0xe3bf('0x46')]=_0x4cbc7b[_0xe3bf('0x46')][_0xe3bf('0x5a')]?_0x4cbc7b[_0xe3bf('0x46')]:_0x589ebe[_0xe3bf('0x43')];if(!_0x1309ab[_0xe3bf('0x44')]['hasOwnProperty'](_0xe3bf('0x48'))){_0x4cbc7b['limit']=qs[_0xe3bf('0x31')](_0x1309ab[_0xe3bf('0x44')][_0xe3bf('0x31')]);_0x4cbc7b[_0xe3bf('0x30')]=qs[_0xe3bf('0x30')](_0x1309ab['query'][_0xe3bf('0x30')]);}_0x4cbc7b[_0xe3bf('0x49')]=qs[_0xe3bf('0x4a')](_0x1309ab[_0xe3bf('0x44')][_0xe3bf('0x4a')]);_0x4cbc7b[_0xe3bf('0x4b')]=qs[_0xe3bf('0x4c')](_[_0xe3bf('0x69')](_0x1309ab['query'],_0x589ebe['filters']));_0x4cbc7b[_0xe3bf('0x4b')][_0xe3bf('0x66')]=_0x2c0d1f['id'];if(_0x1309ab[_0xe3bf('0x44')]['filter']){_0x4cbc7b[_0xe3bf('0x4b')]=_[_0xe3bf('0x4f')](_0x4cbc7b[_0xe3bf('0x4b')],{'$or':_[_0xe3bf('0x3f')](_0x4cbc7b[_0xe3bf('0x46')],function(_0x28cb81){var _0x33bd05={};_0x33bd05[_0x28cb81]={'$like':'%'+_0x1309ab[_0xe3bf('0x44')][_0xe3bf('0x4e')]+'%'};return _0x33bd05;})});}_0x4cbc7b=_[_0xe3bf('0x4f')]({},_0x4cbc7b,_0x1309ab[_0xe3bf('0x50')]);return db[_0xe3bf('0x6e')]['count']({'where':_0x4cbc7b[_0xe3bf('0x4b')]})[_0xe3bf('0x38')](function(_0x3a191b){_0x5d7c88[_0xe3bf('0x2f')]=_0x3a191b;if(_0x1309ab[_0xe3bf('0x44')][_0xe3bf('0x52')]){_0x4cbc7b[_0xe3bf('0x53')]=[{'all':!![]}];}return db[_0xe3bf('0x6e')][_0xe3bf('0x54')](_0x4cbc7b);})[_0xe3bf('0x38')](function(_0x1887e5){_0x5d7c88[_0xe3bf('0x55')]=_0x1887e5;return _0x5d7c88;});}})['then'](respondWithFilteredResult(_0x58f322,_0x4cbc7b))['catch'](handleError(_0x58f322,null));};exports['removeAnswers']=function(_0x1a04df,_0x12eca4,_0x5b8fd4){return db['FaxAccount'][_0xe3bf('0x5b')]({'where':{'id':_0x1a04df['params']['id']}})[_0xe3bf('0x38')](handleEntityNotFound(_0x12eca4,null))[_0xe3bf('0x38')](function(_0xd1237b){if(_0xd1237b){return _0xd1237b['removeAnswers'](_0x1a04df[_0xe3bf('0x44')]['ids']);}})['then'](respondWithStatusCode(_0x12eca4,null))['catch'](handleError(_0x12eca4,null));};exports[_0xe3bf('0x6f')]=function(_0x42d55a,_0x5e8bce,_0x8901d3){return db[_0xe3bf('0x70')][_0xe3bf('0x5b')]({'where':{'id':_0x42d55a[_0xe3bf('0x57')]['id']}})[_0xe3bf('0x38')](handleEntityNotFound(_0x5e8bce,null))[_0xe3bf('0x38')](function(_0x2647a0){if(_0x2647a0){return _0x2647a0[_0xe3bf('0x6f')](_0x42d55a[_0xe3bf('0x5d')][_0xe3bf('0x6b')],_[_0xe3bf('0x71')](_0x42d55a[_0xe3bf('0x5d')],[_0xe3bf('0x6b'),'id'])||{});}})['then'](respondWithResult(_0x5e8bce,null))[_0xe3bf('0x2b')](handleError(_0x5e8bce,null));};exports[_0xe3bf('0x72')]=function(_0x565f80,_0x37ecb8,_0x53660c){var _0x1cf2f1={'raw':![],'where':{}};var _0x500214={};var _0x3bd8e8={'count':0x0,'rows':[]};return db['FaxAccount'][_0xe3bf('0x6d')]({'where':{'id':_0x565f80[_0xe3bf('0x57')]['id']}})[_0xe3bf('0x38')](handleEntityNotFound(_0x37ecb8,null))['then'](function(_0x197cff){if(_0x197cff){_0x500214['model']=_['keys'](db[_0xe3bf('0x70')][_0xe3bf('0x40')]);_0x500214[_0xe3bf('0x44')]=_[_0xe3bf('0x58')](_0x565f80[_0xe3bf('0x44')]);_0x500214[_0xe3bf('0x4c')]=_[_0xe3bf('0x45')](_0x500214[_0xe3bf('0x43')],_0x500214[_0xe3bf('0x44')]);_0x1cf2f1[_0xe3bf('0x46')]=_[_0xe3bf('0x45')](_0x500214[_0xe3bf('0x43')],qs[_0xe3bf('0x59')](_0x565f80[_0xe3bf('0x44')]['fields']));_0x1cf2f1[_0xe3bf('0x46')]=_0x1cf2f1['attributes']['length']?_0x1cf2f1[_0xe3bf('0x46')]:_0x500214[_0xe3bf('0x43')];if(!_0x565f80['query'][_0xe3bf('0x47')]('nolimit')){_0x1cf2f1[_0xe3bf('0x31')]=qs['limit'](_0x565f80[_0xe3bf('0x44')]['limit']);_0x1cf2f1['offset']=qs[_0xe3bf('0x30')](_0x565f80[_0xe3bf('0x44')]['offset']);}_0x1cf2f1[_0xe3bf('0x49')]=qs[_0xe3bf('0x4a')](_0x565f80[_0xe3bf('0x44')][_0xe3bf('0x4a')]);_0x1cf2f1['where']=qs[_0xe3bf('0x4c')](_[_0xe3bf('0x69')](_0x565f80['query'],_0x500214[_0xe3bf('0x4c')]));_0x1cf2f1[_0xe3bf('0x4b')][_0xe3bf('0x66')]=_0x197cff['id'];if(_0x565f80[_0xe3bf('0x44')]['filter']){_0x1cf2f1['where']=_['merge'](_0x1cf2f1[_0xe3bf('0x4b')],{'$or':_[_0xe3bf('0x3f')](_0x1cf2f1['attributes'],function(_0x3f12d6){var _0x167821={};_0x167821[_0x3f12d6]={'$like':'%'+_0x565f80['query'][_0xe3bf('0x4e')]+'%'};return _0x167821;})});}_0x1cf2f1=_[_0xe3bf('0x4f')]({},_0x1cf2f1,_0x565f80[_0xe3bf('0x50')]);return db['FaxInteraction'][_0xe3bf('0x2f')]({'where':_0x1cf2f1['where']})[_0xe3bf('0x38')](function(_0x975c43){_0x3bd8e8[_0xe3bf('0x2f')]=_0x975c43;if(_0x565f80['query'][_0xe3bf('0x52')]){_0x1cf2f1['include']=[{'model':db[_0xe3bf('0x73')],'as':_0xe3bf('0x74'),'required':![]},{'model':db[_0xe3bf('0x75')],'as':_0xe3bf('0x76'),'attributes':[_0xe3bf('0x3b'),'fullname','internal'],'required':![]},{'model':db[_0xe3bf('0x77')],'as':_0xe3bf('0x78'),'attributes':['id',_0xe3bf('0x3b'),'color'],'where':_0x565f80[_0xe3bf('0x44')][_0xe3bf('0x79')]?{'id':_0x565f80[_0xe3bf('0x44')]['tag']}:undefined,'required':_0x565f80[_0xe3bf('0x44')]['tag']?!![]:![]}];}return db[_0xe3bf('0x70')]['findAll'](_0x1cf2f1);})[_0xe3bf('0x38')](function(_0x4c6330){_0x3bd8e8[_0xe3bf('0x55')]=_0x4c6330;return _0x3bd8e8;});}})[_0xe3bf('0x38')](respondWithFilteredResult(_0x37ecb8,_0x1cf2f1))[_0xe3bf('0x2b')](handleError(_0x37ecb8,null));};exports[_0xe3bf('0x7a')]=function(_0x3e0151,_0x5580af,_0x36da19){return db[_0xe3bf('0x51')][_0xe3bf('0x6d')]({'where':{'id':_0x3e0151[_0xe3bf('0x57')]['id']}})[_0xe3bf('0x38')](handleEntityNotFound(_0x5580af,null))['then'](function(_0x5b8def){if(_0x5b8def){return db[_0xe3bf('0x7b')]['transaction'](function(_0x337b97){return db[_0xe3bf('0x7c')][_0xe3bf('0x37')]({'where':{'FaxAccountId':_0x3e0151[_0xe3bf('0x57')]['id']},'transaction':_0x337b97})[_0xe3bf('0x38')](function(_0x5e09f3){var _0x5f3cca=_['map'](_0x3e0151[_0xe3bf('0x5d')],function(_0x1753a3){_0x1753a3[_0xe3bf('0x66')]=_0x3e0151[_0xe3bf('0x57')]['id'];return _0x1753a3;});return db[_0xe3bf('0x7c')][_0xe3bf('0x7d')](_0x5f3cca,{'transaction':_0x337b97});});})[_0xe3bf('0x38')](function(){return db[_0xe3bf('0x7c')]['findAndCountAll']({'where':{'FaxAccountId':_0x3e0151[_0xe3bf('0x57')]['id']},'order':_0xe3bf('0x7e')});});}})[_0xe3bf('0x38')](respondWithResult(_0x5580af,null))[_0xe3bf('0x2b')](handleError(_0x5580af,null));};exports[_0xe3bf('0x7f')]=function(_0x2af1bf,_0x3ea4b0,_0x41f1fb){var _0x3b3f3e={};var _0x4ae9a1={};var _0x1a8a37;var _0x2f2b4b;return db[_0xe3bf('0x51')][_0xe3bf('0x6d')]({'where':{'id':_0x2af1bf[_0xe3bf('0x57')]['id']}})[_0xe3bf('0x38')](handleEntityNotFound(_0x3ea4b0,null))['then'](function(_0xad431c){if(_0xad431c){_0x1a8a37=_0xad431c;_0x4ae9a1[_0xe3bf('0x43')]=_[_0xe3bf('0x58')](db[_0xe3bf('0x7c')][_0xe3bf('0x40')]);_0x4ae9a1[_0xe3bf('0x44')]=_[_0xe3bf('0x58')](_0x2af1bf[_0xe3bf('0x44')]);_0x4ae9a1[_0xe3bf('0x4c')]=_['intersection'](_0x4ae9a1[_0xe3bf('0x43')],_0x4ae9a1['query']);_0x3b3f3e[_0xe3bf('0x46')]=_[_0xe3bf('0x45')](_0x4ae9a1[_0xe3bf('0x43')],qs[_0xe3bf('0x59')](_0x2af1bf[_0xe3bf('0x44')][_0xe3bf('0x59')]));_0x3b3f3e['attributes']=_0x3b3f3e[_0xe3bf('0x46')][_0xe3bf('0x5a')]?_0x3b3f3e[_0xe3bf('0x46')]:_0x4ae9a1['model'];_0x3b3f3e['order']=qs[_0xe3bf('0x4a')](_0x2af1bf[_0xe3bf('0x44')][_0xe3bf('0x4a')]);_0x3b3f3e[_0xe3bf('0x4b')]=qs[_0xe3bf('0x4c')](_[_0xe3bf('0x69')](_0x2af1bf['query'],_0x4ae9a1['filters']));if(_0x2af1bf['query']['filter']){_0x3b3f3e['where']=_[_0xe3bf('0x4f')](_0x3b3f3e[_0xe3bf('0x4b')],{'$or':_[_0xe3bf('0x3f')](_0x3b3f3e[_0xe3bf('0x46')],function(_0x1f7332){var _0x32317d={};_0x32317d[_0x1f7332]={'$like':'%'+_0x2af1bf[_0xe3bf('0x44')]['filter']+'%'};return _0x32317d;})});}_0x3b3f3e=_[_0xe3bf('0x4f')]({},_0x3b3f3e,_0x2af1bf[_0xe3bf('0x50')]);return _0x1a8a37[_0xe3bf('0x7f')](_0x3b3f3e);}})[_0xe3bf('0x38')](function(_0x5920ab){if(_0x5920ab){_0x2f2b4b=_0x5920ab[_0xe3bf('0x5a')];if(!_0x2af1bf['query'][_0xe3bf('0x47')](_0xe3bf('0x48'))){_0x3b3f3e['limit']=qs['limit'](_0x2af1bf[_0xe3bf('0x44')][_0xe3bf('0x31')]);_0x3b3f3e[_0xe3bf('0x30')]=qs[_0xe3bf('0x30')](_0x2af1bf[_0xe3bf('0x44')][_0xe3bf('0x30')]);}return _0x1a8a37[_0xe3bf('0x7f')](_0x3b3f3e);}})[_0xe3bf('0x38')](function(_0x22aeb8){if(_0x22aeb8){return _0x22aeb8?{'count':_0x2f2b4b,'rows':_0x22aeb8}:null;}})['then'](respondWithResult(_0x3ea4b0,null))[_0xe3bf('0x2b')](handleError(_0x3ea4b0,null));};function Extension(_0x27631c,_0xe2b28d,_0x82e596,_0x5bc6c2){this['context']=_0xe3bf('0x80');this[_0xe3bf('0x81')]=_0x27631c[_0xe3bf('0x82')];this[_0xe3bf('0x83')]=_0x5bc6c2;this[_0xe3bf('0x42')]='system';this[_0xe3bf('0x84')]=_0xe3bf('0x85');this[_0xe3bf('0x66')]=_0x27631c['id'];this[_0xe3bf('0x7e')]=_0xe2b28d;this[_0xe3bf('0x86')]=_0x82e596;}function createExtensionsReciveFax(_0x2cb722){var _0x23d936=0x1;var _0x4fd1ad=[];_0x4fd1ad[_0xe3bf('0x87')](new Extension(_0x2cb722,_0x23d936,'','Answer'));_0x23d936+=0x1;_0x4fd1ad[_0xe3bf('0x87')](new Extension(_0x2cb722,_0x23d936,_0xe3bf('0x88'),'Set'));_0x23d936+=0x1;for(var _0x31a714 in _0x2cb722){if(_0x2cb722['hasOwnProperty'](_0x31a714)&&(_0x31a714==='ecm'||_0x31a714===_0xe3bf('0x82')||_0x31a714===_0xe3bf('0x89')||_0x31a714===_0xe3bf('0x8a')||_0x31a714===_0xe3bf('0x8b')||_0x31a714===_0xe3bf('0x8c')||_0x31a714===_0xe3bf('0x8d')||_0x31a714===_0xe3bf('0x8e')||_0x31a714===_0xe3bf('0x8f'))){_0x4fd1ad[_0xe3bf('0x87')](new Extension(_0x2cb722,_0x23d936,_0xe3bf('0x90')+_0x31a714+')='+_0x2cb722[_0x31a714],_0xe3bf('0x91')));_0x23d936+=0x1;}}_0x4fd1ad[_0xe3bf('0x87')](new Extension(_0x2cb722,_0x23d936,'6','Wait'));_0x23d936+=0x1;_0x4fd1ad[_0xe3bf('0x87')](new Extension(_0x2cb722,_0x23d936,_0xe3bf('0x92'),_0xe3bf('0x93')));_0x23d936=0x0;return _0x4fd1ad;}exports['addAccountApplications']=function(_0x253224,_0x3da4a8,_0x30cc72){var _0x1fb25c;return db[_0xe3bf('0x7b')][_0xe3bf('0x94')](function(_0x24f6bd){return db['FaxAccount'][_0xe3bf('0x5c')](_0x253224[_0xe3bf('0x5d')],{'transaction':_0x24f6bd})[_0xe3bf('0x38')](function(_0x444a82){_0x1fb25c=_0x444a82[_0xe3bf('0x39')]({'plain':!![]});return db[_0xe3bf('0x95')][_0xe3bf('0x7d')](createExtensionsReciveFax(_0x1fb25c),{'transaction':_0x24f6bd});});})[_0xe3bf('0x38')](function(){return _0x1fb25c;})[_0xe3bf('0x38')](respondWithResult(_0x3da4a8,null))[_0xe3bf('0x2b')](handleError(_0x3da4a8,null));};exports[_0xe3bf('0x96')]=function(_0x2583f4,_0x2a5543,_0x367862){var _0x4574fa;return db[_0xe3bf('0x7b')][_0xe3bf('0x94')](function(_0x558e2d){return db[_0xe3bf('0x51')][_0xe3bf('0x36')](_0x2583f4[_0xe3bf('0x5d')],{'where':{'id':_0x2583f4[_0xe3bf('0x5d')]['id']},'transaction':_0x558e2d})['then'](function(_0x344e83){return db[_0xe3bf('0x95')][_0xe3bf('0x37')]({'where':{'FaxAccountId':_0x2583f4[_0xe3bf('0x5d')]['id']},'transaction':_0x558e2d})[_0xe3bf('0x38')](function(_0x1abf31){return db[_0xe3bf('0x95')]['bulkCreate'](createExtensionsReciveFax(_[_0xe3bf('0x71')](_0x2583f4[_0xe3bf('0x5d')],['tech',_0xe3bf('0x97'),'createdAt',_0xe3bf('0x98'),_0xe3bf('0x99'),'ListId'])),{'transaction':_0x558e2d});});});})[_0xe3bf('0x38')](function(){return db[_0xe3bf('0x51')][_0xe3bf('0x9a')](_0x2583f4[_0xe3bf('0x5d')]['id']);})['then'](respondWithResult(_0x2a5543,null))['catch'](handleError(_0x2a5543,null));};exports['getMessages']=function(_0x4affed,_0x499af5,_0x79f79b){var _0x26a85c={'raw':!![],'where':{}};var _0x367833={};var _0x28be0e={'count':0x0,'rows':[]};return db['FaxAccount'][_0xe3bf('0x6d')]({'where':{'id':_0x4affed['params']['id']}})[_0xe3bf('0x38')](handleEntityNotFound(_0x499af5,null))[_0xe3bf('0x38')](function(_0x31be43){if(_0x31be43){_0x367833['model']=_[_0xe3bf('0x58')](db['FaxMessage'][_0xe3bf('0x40')]);_0x367833[_0xe3bf('0x44')]=_[_0xe3bf('0x58')](_0x4affed[_0xe3bf('0x44')]);_0x367833[_0xe3bf('0x4c')]=_['intersection'](_0x367833[_0xe3bf('0x43')],_0x367833[_0xe3bf('0x44')]);_0x26a85c['attributes']=_[_0xe3bf('0x45')](_0x367833[_0xe3bf('0x43')],qs['fields'](_0x4affed[_0xe3bf('0x44')][_0xe3bf('0x59')]));_0x26a85c[_0xe3bf('0x46')]=_0x26a85c[_0xe3bf('0x46')][_0xe3bf('0x5a')]?_0x26a85c[_0xe3bf('0x46')]:_0x367833[_0xe3bf('0x43')];if(!_0x4affed[_0xe3bf('0x44')][_0xe3bf('0x47')](_0xe3bf('0x48'))){_0x26a85c[_0xe3bf('0x31')]=qs[_0xe3bf('0x31')](_0x4affed[_0xe3bf('0x44')]['limit']);_0x26a85c['offset']=qs['offset'](_0x4affed[_0xe3bf('0x44')][_0xe3bf('0x30')]);}_0x26a85c['order']=qs[_0xe3bf('0x4a')](_0x4affed[_0xe3bf('0x44')]['sort']);_0x26a85c[_0xe3bf('0x4b')]=qs[_0xe3bf('0x4c')](_[_0xe3bf('0x69')](_0x4affed[_0xe3bf('0x44')],_0x367833['filters']));_0x26a85c[_0xe3bf('0x4b')][_0xe3bf('0x66')]=_0x31be43['id'];if(_0x4affed[_0xe3bf('0x44')][_0xe3bf('0x4e')]){_0x26a85c[_0xe3bf('0x4b')]=_[_0xe3bf('0x4f')](_0x26a85c['where'],{'$or':_[_0xe3bf('0x3f')](_0x26a85c[_0xe3bf('0x46')],function(_0x5f2b48){var _0x4b69c5={};_0x4b69c5[_0x5f2b48]={'$like':'%'+_0x4affed[_0xe3bf('0x44')][_0xe3bf('0x4e')]+'%'};return _0x4b69c5;})});}if(_0x4affed['query']['$gte']){var _0x586442=_0x4affed['query'][_0xe3bf('0x9b')][_0xe3bf('0x9c')](',');var _0x447d30={};_0x447d30[_0x586442[0x0]]={'$gte':moment(_0x586442[0x1])['format'](_0xe3bf('0x9d'))};_0x26a85c[_0xe3bf('0x4b')]=_[_0xe3bf('0x4f')](_0x26a85c[_0xe3bf('0x4b')],_0x447d30);}_0x26a85c=_[_0xe3bf('0x4f')]({},_0x26a85c,_0x4affed['options']);return db[_0xe3bf('0x9e')]['count']({'where':_0x26a85c['where']})[_0xe3bf('0x38')](function(_0x1c1abb){_0x28be0e['count']=_0x1c1abb;if(_0x4affed[_0xe3bf('0x44')][_0xe3bf('0x52')]){_0x26a85c[_0xe3bf('0x53')]=[{'all':!![]}];}return db[_0xe3bf('0x9e')][_0xe3bf('0x54')](_0x26a85c);})[_0xe3bf('0x38')](function(_0x514533){_0x28be0e[_0xe3bf('0x55')]=_0x514533;return _0x28be0e;});}})['then'](respondWithFilteredResult(_0x499af5,_0x26a85c))[_0xe3bf('0x2b')](handleError(_0x499af5,null));};exports['send']=function(_0x481926,_0x5c3408,_0x5e3e9e){var _0x3b591c,_0x3b5ac4={},_0x458d3f;if(_0x481926['body']['to']){_0x458d3f=_0x481926['body']['to'][0x0];}return db[_0xe3bf('0x51')][_0xe3bf('0x5b')]({'where':{'id':_0x481926[_0xe3bf('0x57')]['id']},'include':[{'model':db[_0xe3bf('0x9f')],'as':_0xe3bf('0xa0'),'include':[{'model':db[_0xe3bf('0x73')],'as':_0xe3bf('0xa1'),'where':{'fax':_0x458d3f},'limit':0x1,'order':[[_0xe3bf('0x98'),'DESC']]}]}]})['then'](handleEntityNotFound(_0x5c3408,null))[_0xe3bf('0x38')](function(_0xb4c34a){_0x3b591c=_0xb4c34a;if(_0x481926[_0xe3bf('0x5d')][_0xe3bf('0xa2')]&&_0x481926[_0xe3bf('0x5d')][_0xe3bf('0xa2')][_0xe3bf('0x5a')]){for(var _0x150984=0x0;_0x150984<_0x481926[_0xe3bf('0x5d')][_0xe3bf('0xa2')][_0xe3bf('0x5a')];_0x150984+=0x1){_0x481926[_0xe3bf('0x5d')][_0xe3bf('0xa2')][_0x150984]={'filename':_0x481926[_0xe3bf('0x5d')][_0xe3bf('0xa2')][_0x150984][_0xe3bf('0x3b')],'id':_0x481926[_0xe3bf('0x5d')][_0xe3bf('0xa2')][_0x150984]['id'],'path':path[_0xe3bf('0xa3')](config[_0xe3bf('0xa4')],_0xe3bf('0xa5'),_0x481926[_0xe3bf('0x5d')]['attachments'][_0x150984][_0xe3bf('0xa6')])};}}return respondWithRpcPromise(_0xe3bf('0xa7'),_0xe3bf('0xa7'),{'FaxAccountId':_[_0xe3bf('0xa8')](_0x481926[_0xe3bf('0x57')]['id'])?undefined:_0x481926['params']['id'],'path':_[_0xe3bf('0xa8')](_0x481926[_0xe3bf('0x5d')][_0xe3bf('0xa2')][0x0][_0xe3bf('0x5')])?undefined:_0x481926[_0xe3bf('0x5d')]['attachments'][0x0]['path'],'fax':_[_0xe3bf('0xa8')](_0x481926[_0xe3bf('0x5d')]['to'][0x0])?undefined:_0x481926[_0xe3bf('0x5d')]['to'][0x0]},client9002);})[_0xe3bf('0x38')](function(){if(_0x3b591c){if(_['isNil'](_0x481926[_0xe3bf('0x5d')][_0xe3bf('0xa9')])){_0x481926[_0xe3bf('0x5d')][_0xe3bf('0xa9')]=util[_0xe3bf('0xaa')]('\x22%s\x22\x20<%s>',_0x3b591c[_0xe3bf('0x3b')],_0x3b591c[_0xe3bf('0xab')]);}if(_0x3b591c[_0xe3bf('0xa0')]){if(_0x3b591c[_0xe3bf('0xa0')][_0xe3bf('0xa1')][_0xe3bf('0x5a')]){return _0x3b591c[_0xe3bf('0xa0')][_0xe3bf('0xa1')][0x0];}else{return db[_0xe3bf('0x73')]['create'](_[_0xe3bf('0x19')](_0x481926[_0xe3bf('0x5d')],{'firstName':_0x481926['body']['to'][0x0],'phone':_0x481926[_0xe3bf('0x5d')]['to'][0x0],'fax':_0x481926[_0xe3bf('0x5d')]['to'][0x0],'ListId':_0x3b591c[_0xe3bf('0xac')]}));}}else{throw new Error(_0xe3bf('0xad'));}}else{throw new Error(_0xe3bf('0xae'));}})[_0xe3bf('0x38')](function(_0x16eac4){if(_0x16eac4){return db[_0xe3bf('0x70')][_0xe3bf('0x5b')]({'where':{'ContactId':_0x16eac4['id'],'closed':![],'FaxAccountId':_0x3b591c['id']}})['then'](function(_0xbedf83){if(_0xbedf83){return[_0xbedf83,![]];}return db[_0xe3bf('0x70')][_0xe3bf('0x5c')]({'UserId':_0x481926[_0xe3bf('0xaf')]['id'],'ContactId':_0x16eac4['id'],'FaxAccountId':_0x3b591c['id'],'fax':_0x481926[_0xe3bf('0x5d')]['to'][0x0],'firstMsgDirection':_0xe3bf('0xb0'),'Messages':[_[_0xe3bf('0x4f')](_0x481926[_0xe3bf('0x5d')],{'read':![],'body':_0x481926[_0xe3bf('0x5d')]['attachments'][0x0][_0xe3bf('0xb1')],'FaxAccountId':_0x3b591c['id'],'UserId':_0x481926[_0xe3bf('0xaf')]['id'],'ContactId':_0x16eac4['id'],'AttachmentId':_0x481926['body'][_0xe3bf('0xa2')][0x0]['id']})]},{'include':[{'model':db[_0xe3bf('0x9e')],'as':_0xe3bf('0xb2')}]})['then'](function(_0x27c659){return[_0x27c659,!![]];});});}else{throw new Error(_0xe3bf('0xb3'));}})['spread'](function(_0xcd97da,_0x4afc07){if(_0x4afc07){return _0xcd97da;}return db[_0xe3bf('0x9e')][_0xe3bf('0x5c')]({'direction':_0xe3bf('0xb0'),'read':![],'body':_0x481926[_0xe3bf('0x5d')][_0xe3bf('0xa2')][0x0]['filename'],'FaxAccountId':_0x3b591c['id'],'FaxInteractionId':_0xcd97da['id'],'UserId':_0x481926['user']['id'],'ContactId':_0xcd97da['ContactId'],'AttachmentId':_0x481926[_0xe3bf('0x5d')][_0xe3bf('0xa2')][0x0]['id']})[_0xe3bf('0x38')](function(_0x3430db){_0xcd97da[_0xe3bf('0xb4')][_0xe3bf('0xb2')]=[];_0xcd97da['dataValues'][_0xe3bf('0xb2')][_0xe3bf('0x87')](_0x3430db[_0xe3bf('0xb4')]);return _0xcd97da;});})[_0xe3bf('0x38')](function(_0x57aa5a){respondWithRpcPromise('SendFax',_0xe3bf('0xb5'),{'FaxAccountId':_['isNil'](_0x481926['params']['id'])?undefined:_0x481926[_0xe3bf('0x57')]['id'],'path':_[_0xe3bf('0xa8')](_0x481926[_0xe3bf('0x5d')][_0xe3bf('0xa2')][0x0]['path'])?undefined:_0x481926['body'][_0xe3bf('0xa2')][0x0][_0xe3bf('0x5')],'fax':_['isNil'](_0x481926[_0xe3bf('0x5d')]['to'][0x0])?undefined:_0x481926[_0xe3bf('0x5d')]['to'][0x0],'AttachmentId':_0x481926[_0xe3bf('0x5d')][_0xe3bf('0xa2')][0x0]['id']},client9002)[_0xe3bf('0x38')](function(_0x53df9e){logger[_0xe3bf('0x22')]('SendFaxRpc,\x20%s',_0x53df9e);})['catch'](function(_0x5bf32b){logger[_0xe3bf('0x22')](_0xe3bf('0xb6'),_0x5bf32b);});return _0x57aa5a;})['then'](respondWithResult(_0x5c3408,null))[_0xe3bf('0x2b')](handleError(_0x5c3408,null));};exports[_0xe3bf('0xb7')]=function(_0x13d4c6,_0x4d5643,_0xad708c){return db[_0xe3bf('0x51')][_0xe3bf('0x5b')]({'where':{'id':_0x13d4c6[_0xe3bf('0x57')]['id']}})[_0xe3bf('0x38')](handleEntityNotFound(_0x4d5643,null))[_0xe3bf('0x38')](function(_0x33efae){if(_0x33efae){return _0x33efae['addAgents'](_0x13d4c6[_0xe3bf('0x5d')][_0xe3bf('0x6b')],_[_0xe3bf('0x71')](_0x13d4c6[_0xe3bf('0x5d')],[_0xe3bf('0x6b'),'id'])||{})[_0xe3bf('0xb8')](function(_0x371a04){for(var _0x355d90=0x0;_0x355d90<_0x13d4c6[_0xe3bf('0x5d')][_0xe3bf('0x6b')][_0xe3bf('0x5a')];_0x355d90+=0x1){socket['emit'](_0xe3bf('0xb9'),{'UserId':_0x13d4c6[_0xe3bf('0x5d')][_0xe3bf('0x6b')][_0x355d90],'FaxAccountId':_0x13d4c6['params']['id']});}return _0x371a04;});}})[_0xe3bf('0x38')](respondWithResult(_0x4d5643,null))['catch'](handleError(_0x4d5643,null));};exports[_0xe3bf('0xba')]=function(_0x1de92b,_0x78f124,_0x5c54d1){return db[_0xe3bf('0x51')][_0xe3bf('0x5b')]({'where':{'id':_0x1de92b[_0xe3bf('0x57')]['id']}})[_0xe3bf('0x38')](handleEntityNotFound(_0x78f124,null))['then'](function(_0x24fead){if(_0x24fead){return _0x24fead[_0xe3bf('0xba')](_0x1de92b[_0xe3bf('0x44')]['ids'])[_0xe3bf('0x38')](function(){if(_[_0xe3bf('0xbb')](_0x1de92b[_0xe3bf('0x44')][_0xe3bf('0x6b')])){for(var _0x13113a=0x0;_0x13113a<_0x1de92b[_0xe3bf('0x44')][_0xe3bf('0x6b')]['length'];_0x13113a+=0x1){socket[_0xe3bf('0xbc')]('userFaxAccount:remove',{'UserId':Number(_0x1de92b[_0xe3bf('0x44')]['ids'][_0x13113a]),'FaxAccountId':Number(_0x1de92b[_0xe3bf('0x57')]['id'])});}}else{socket[_0xe3bf('0xbc')](_0xe3bf('0xbd'),{'UserId':Number(_0x1de92b[_0xe3bf('0x44')]['ids']),'FaxAccountId':Number(_0x1de92b[_0xe3bf('0x57')]['id'])});}});}})[_0xe3bf('0x38')](respondWithStatusCode(_0x78f124,null))[_0xe3bf('0x2b')](handleError(_0x78f124,null));};exports[_0xe3bf('0xbe')]=function(_0x3bbfb0,_0x2c92f0,_0x144605){var _0x2444ed={};var _0xd3a6f={};var _0x317432;var _0x2f1d3e;return db[_0xe3bf('0x51')][_0xe3bf('0x6d')]({'where':{'id':_0x3bbfb0['params']['id']}})['then'](handleEntityNotFound(_0x2c92f0,null))[_0xe3bf('0x38')](function(_0x5a953e){if(_0x5a953e){_0x317432=_0x5a953e;_0xd3a6f[_0xe3bf('0x43')]=_[_0xe3bf('0x58')](db[_0xe3bf('0x75')]['rawAttributes']);_0xd3a6f[_0xe3bf('0x44')]=_[_0xe3bf('0x58')](_0x3bbfb0[_0xe3bf('0x44')]);_0xd3a6f['filters']=_[_0xe3bf('0x45')](_0xd3a6f[_0xe3bf('0x43')],_0xd3a6f['query']);_0x2444ed[_0xe3bf('0x46')]=_['intersection'](_0xd3a6f[_0xe3bf('0x43')],qs['fields'](_0x3bbfb0['query'][_0xe3bf('0x59')]));_0x2444ed[_0xe3bf('0x46')]=_0x2444ed['attributes'][_0xe3bf('0x5a')]?_0x2444ed[_0xe3bf('0x46')]:_0xd3a6f[_0xe3bf('0x43')];_0x2444ed['order']=qs[_0xe3bf('0x4a')](_0x3bbfb0[_0xe3bf('0x44')][_0xe3bf('0x4a')]);_0x2444ed[_0xe3bf('0x4b')]=qs[_0xe3bf('0x4c')](_['pick'](_0x3bbfb0[_0xe3bf('0x44')],_0xd3a6f[_0xe3bf('0x4c')]));if(_0x3bbfb0[_0xe3bf('0x44')]['filter']){_0x2444ed[_0xe3bf('0x4b')]=_[_0xe3bf('0x4f')](_0x2444ed[_0xe3bf('0x4b')],{'$or':_[_0xe3bf('0x3f')](_0x2444ed[_0xe3bf('0x46')],function(_0x1898f0){var _0x353ff9={};_0x353ff9[_0x1898f0]={'$like':'%'+_0x3bbfb0[_0xe3bf('0x44')][_0xe3bf('0x4e')]+'%'};return _0x353ff9;})});}_0x2444ed=_[_0xe3bf('0x4f')]({},_0x2444ed,_0x3bbfb0[_0xe3bf('0x50')]);return _0x317432[_0xe3bf('0xbe')](_0x2444ed);}})[_0xe3bf('0x38')](function(_0x52a589){if(_0x52a589){_0x2f1d3e=_0x52a589[_0xe3bf('0x5a')];if(!_0x3bbfb0[_0xe3bf('0x44')][_0xe3bf('0x47')]('nolimit')){_0x2444ed[_0xe3bf('0x31')]=qs[_0xe3bf('0x31')](_0x3bbfb0[_0xe3bf('0x44')][_0xe3bf('0x31')]);_0x2444ed[_0xe3bf('0x30')]=qs[_0xe3bf('0x30')](_0x3bbfb0[_0xe3bf('0x44')][_0xe3bf('0x30')]);}return _0x317432[_0xe3bf('0xbe')](_0x2444ed);}})[_0xe3bf('0x38')](function(_0x380022){if(_0x380022){return _0x380022?{'count':_0x2f1d3e,'rows':_0x380022}:null;}})[_0xe3bf('0x38')](respondWithResult(_0x2c92f0,null))[_0xe3bf('0x2b')](handleError(_0x2c92f0,null));}; \ No newline at end of file +var _0x2174=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./faxAccount.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','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','FaxAccounts','UserProfileResource','sendStatus','stack','name','index','Pause','mandatoryDispositionPause','map','fieldName','key','model','query','intersection','fields','attributes','length','sort','filters','filter','merge','field','options','where','includeAll','FaxAccount','rows','show','params','rawAttributes','keys','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','findOne','hasOwnProperty','nolimit','FaxAccountId','findAll','removeDispositions','ids','getAnswers','order','pick','removeAnswers','addInteraction','FaxInteraction','omit','Contact','Owner','fullname','internal','Tags','tag','addApplications','sequelize','transaction','FaxApplication','bulkCreate','findAndCountAll','getApplications','context','from-voip-provider','exten','localstationid','system','description','priority','appdata','push','CDR(type)=inbound-fax','Set','ecm','gateway','headerinfo','maxrate','modem','t38timeout','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','VoiceExtension','updateAccountApplications','createdAt','TrunkId','findById','getMessages','FaxMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','send','CmList','List','CmContact','Contacts','updatedAt','DESC','attachments','join','server/files/attachments','basename','CheckAfterSend','isNil','from','format','\x22%s\x22\x20<%s>','fax','ListId','List\x20not\x20found','Send\x20Fax\x20failed','filename','Messages','Contact\x20not\x20found','spread','out','ContactId','dataValues','SendFax','path','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','userFaxAccount:remove','getAgents','User','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring'];(function(_0x4da572,_0x326408){var _0x378393=function(_0x1357e4){while(--_0x1357e4){_0x4da572['push'](_0x4da572['shift']());}};_0x378393(++_0x326408);}(_0x2174,0x180));var _0x4217=function(_0x33eeac,_0x43706d){_0x33eeac=_0x33eeac-0x0;var _0x3fa5d9=_0x2174[_0x33eeac];return _0x3fa5d9;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x4217('0x0'));var rimraf=require(_0x4217('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4217('0x2'));var rp=require('request-promise');var moment=require(_0x4217('0x3'));var BPromise=require(_0x4217('0x4'));var Mustache=require(_0x4217('0x5'));var util=require(_0x4217('0x6'));var path=require('path');var sox=require(_0x4217('0x7'));var csv=require('to-csv');var ejs=require(_0x4217('0x8'));var fs=require('fs');var _=require(_0x4217('0x9'));var squel=require(_0x4217('0xa'));var crypto=require(_0x4217('0xb'));var jsforce=require(_0x4217('0xc'));var deskjs=require(_0x4217('0xd'));var toCsv=require(_0x4217('0xe'));var querystring=require(_0x4217('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4217('0x10'));var qs=require(_0x4217('0x11'));var as=require(_0x4217('0x12'));var hardwareService=require(_0x4217('0x13'));var logger=require('../../config/logger')(_0x4217('0x14'));var utils=require(_0x4217('0x15'));var config=require(_0x4217('0x16'));var db=require(_0x4217('0x17'))['db'];config['redis']=_[_0x4217('0x18')](config[_0x4217('0x19')],{'host':_0x4217('0x1a'),'port':0x18eb});var socket=require(_0x4217('0x1b'))(new Redis(config[_0x4217('0x19')]));require(_0x4217('0x1c'))[_0x4217('0x1d')](socket);var jayson=require(_0x4217('0x1e'));var client=jayson[_0x4217('0x1f')][_0x4217('0x20')]({'port':0x232c});var client9002=jayson[_0x4217('0x1f')]['http']({'port':0x232a});function checkPasswordPattern(_0x268f5b,_0x24e00e,_0x2558f7){if(_0x2558f7){var _0x482f6e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x482f6e[_0x4217('0x21')](_0x24e00e)){return _0x268f5b;}else{throw new Error(_0x4217('0x22'));}}else{return _0x268f5b;}}function respondWithRpcPromise(_0x41a2d5,_0x1c4b5a,_0x2c3e8b,_0x1b520e){return new BPromise(function(_0x2a76a1,_0x2b9eff){var _0x44dc53=_0x1b520e||client;return _0x44dc53['request'](_0x41a2d5,_0x2c3e8b)[_0x4217('0x23')](function(_0x5017ed){logger['info'](_0x4217('0x24'),_0x1c4b5a,_0x4217('0x25'));logger['debug'](_0x4217('0x26'),_0x1c4b5a,_0x4217('0x25'),JSON[_0x4217('0x27')](_0x5017ed));if(_0x5017ed[_0x4217('0x28')]){if(_0x5017ed['error'][_0x4217('0x29')]===0x1f4){logger[_0x4217('0x28')]('FaxAccount,\x20%s,\x20%s',_0x1c4b5a,_0x5017ed[_0x4217('0x28')][_0x4217('0x2a')]);return _0x2b9eff(_0x5017ed[_0x4217('0x28')]['message']);}logger[_0x4217('0x28')](_0x4217('0x24'),_0x1c4b5a,_0x5017ed['error']['message']);return _0x2a76a1(_0x5017ed[_0x4217('0x28')][_0x4217('0x2a')]);}else{logger[_0x4217('0x2b')](_0x4217('0x24'),_0x1c4b5a,_0x4217('0x25'));_0x2a76a1(_0x5017ed[_0x4217('0x2c')]['message']);}})[_0x4217('0x2d')](function(_0x6576ec){logger[_0x4217('0x28')](_0x4217('0x24'),_0x1c4b5a,_0x6576ec);_0x2b9eff(_0x6576ec);});});}function respondWithStatusCode(_0x14cbf6,_0x3eae22){_0x3eae22=_0x3eae22||0xcc;return function(_0x5116dd){if(_0x5116dd){return _0x14cbf6['sendStatus'](_0x3eae22);}return _0x14cbf6[_0x4217('0x2e')](_0x3eae22)[_0x4217('0x2f')]();};}function respondWithResult(_0x2c1428,_0x21e647){_0x21e647=_0x21e647||0xc8;return function(_0x839f22){if(_0x839f22){return _0x2c1428['status'](_0x21e647)[_0x4217('0x30')](_0x839f22);}};}function respondWithFilteredResult(_0x173153,_0x3493f9){return function(_0x2063c5){if(_0x2063c5){var _0x325fb8=_0x2063c5[_0x4217('0x31')],_0xc9a8f1=_0x3493f9[_0x4217('0x32')],_0x139e52=_0x3493f9[_0x4217('0x32')]+_0x3493f9[_0x4217('0x33')],_0x36f8cb;if(_0x139e52>=_0x325fb8){_0x139e52=_0x325fb8;_0x36f8cb=0xc8;}else{_0x36f8cb=0xce;}_0x173153[_0x4217('0x2e')](_0x36f8cb);return _0x173153[_0x4217('0x34')](_0x4217('0x35'),_0xc9a8f1+'-'+_0x139e52+'/'+_0x325fb8)[_0x4217('0x30')](_0x2063c5);}return null;};}function patchUpdates(_0x5d41c0){return function(_0x3ab5b8){try{jsonpatch[_0x4217('0x36')](_0x3ab5b8,_0x5d41c0,!![]);}catch(_0x597149){return BPromise[_0x4217('0x37')](_0x597149);}return _0x3ab5b8[_0x4217('0x38')]();};}function saveUpdates(_0x6585c8,_0x1e50bd){return function(_0x2c736c){if(_0x2c736c){return _0x2c736c[_0x4217('0x39')](_0x6585c8)[_0x4217('0x23')](function(_0x414d62){return _0x414d62;});}return null;};}function removeEntity(_0x432766,_0x5df156){return function(_0x39db15){if(_0x39db15){return _0x39db15[_0x4217('0x3a')]()[_0x4217('0x23')](function(){var _0x589589=_0x39db15['get']({'plain':!![]});var _0x26ac6f=_0x4217('0x3b');return db[_0x4217('0x3c')][_0x4217('0x3a')]({'where':{'type':_0x26ac6f,'resourceId':_0x589589['id']}})[_0x4217('0x23')](function(){return _0x39db15;});})[_0x4217('0x23')](function(){_0x432766['status'](0xcc)[_0x4217('0x2f')]();});}};}function handleEntityNotFound(_0x46024a,_0x5ddf17){return function(_0x3daca7){if(!_0x3daca7){_0x46024a[_0x4217('0x3d')](0x194);}return _0x3daca7;};}function handleError(_0x644953,_0x1f84cb){_0x1f84cb=_0x1f84cb||0x1f4;return function(_0xc116ec){logger[_0x4217('0x28')](_0xc116ec[_0x4217('0x3e')]);if(_0xc116ec[_0x4217('0x3f')]){delete _0xc116ec['name'];}_0x644953[_0x4217('0x2e')](_0x1f84cb)['send'](_0xc116ec);};}exports[_0x4217('0x40')]=function(_0x10a4bb,_0x153900){var _0xdbbc65={'include':[{'model':db[_0x4217('0x41')],'as':_0x4217('0x42')}]},_0x27963a={},_0x2561ee={'count':0x0,'rows':[]};var _0x3f4845=_[_0x4217('0x43')](db['FaxAccount']['rawAttributes'],function(_0xea13d){return{'name':_0xea13d[_0x4217('0x44')],'type':_0xea13d['type'][_0x4217('0x45')]};});_0x27963a[_0x4217('0x46')]=_[_0x4217('0x43')](_0x3f4845,_0x4217('0x3f'));_0x27963a['query']=_['keys'](_0x10a4bb[_0x4217('0x47')]);_0x27963a['filters']=_['intersection'](_0x27963a['model'],_0x27963a[_0x4217('0x47')]);_0xdbbc65['attributes']=_[_0x4217('0x48')](_0x27963a['model'],qs[_0x4217('0x49')](_0x10a4bb[_0x4217('0x47')][_0x4217('0x49')]));_0xdbbc65[_0x4217('0x4a')]=_0xdbbc65[_0x4217('0x4a')][_0x4217('0x4b')]?_0xdbbc65[_0x4217('0x4a')]:_0x27963a[_0x4217('0x46')];if(!_0x10a4bb[_0x4217('0x47')]['hasOwnProperty']('nolimit')){_0xdbbc65[_0x4217('0x33')]=qs[_0x4217('0x33')](_0x10a4bb[_0x4217('0x47')]['limit']);_0xdbbc65['offset']=qs[_0x4217('0x32')](_0x10a4bb[_0x4217('0x47')][_0x4217('0x32')]);}_0xdbbc65['order']=qs[_0x4217('0x4c')](_0x10a4bb['query'][_0x4217('0x4c')]);_0xdbbc65['where']=qs[_0x4217('0x4d')](_['pick'](_0x10a4bb['query'],_0x27963a[_0x4217('0x4d')]));if(_0x10a4bb['query'][_0x4217('0x4e')]){_0xdbbc65['where']=_[_0x4217('0x4f')](_0xdbbc65['where'],{'$or':_['map'](_0x3f4845,function(_0x309ced){if(_0x309ced['type'][_0x4217('0x45')]!=='VIRTUAL'){var _0x14b356={};_0x14b356[_0x309ced[_0x4217('0x50')]]={'$like':'%'+_0x10a4bb[_0x4217('0x47')][_0x4217('0x4e')]+'%'};return _0x14b356;}})});}_0xdbbc65=_['merge']({},_0xdbbc65,_0x10a4bb[_0x4217('0x51')]);var _0x3cb186={'where':_0xdbbc65[_0x4217('0x52')]};return db['FaxAccount']['count'](_0x3cb186)['then'](function(_0x3bf103){_0x2561ee[_0x4217('0x31')]=_0x3bf103;if(_0x10a4bb[_0x4217('0x47')][_0x4217('0x53')]){_0xdbbc65['include']=[{'all':!![]}];}return db[_0x4217('0x54')]['findAll'](_0xdbbc65);})['then'](function(_0x278be3){_0x2561ee[_0x4217('0x55')]=_0x278be3;return _0x2561ee;})['then'](respondWithFilteredResult(_0x153900,_0xdbbc65))['catch'](handleError(_0x153900,null));};exports[_0x4217('0x56')]=function(_0x2ea675,_0x57b971){var _0x303abd={'raw':![],'where':{'id':_0x2ea675[_0x4217('0x57')]['id']},'include':[{'model':db[_0x4217('0x41')],'as':'mandatoryDispositionPause'}]},_0x565008={};_0x565008[_0x4217('0x46')]=_['keys'](db[_0x4217('0x54')][_0x4217('0x58')]);_0x565008['query']=_[_0x4217('0x59')](_0x2ea675[_0x4217('0x47')]);_0x565008[_0x4217('0x4d')]=_[_0x4217('0x48')](_0x565008[_0x4217('0x46')],_0x565008[_0x4217('0x47')]);_0x303abd[_0x4217('0x4a')]=_[_0x4217('0x48')](_0x565008[_0x4217('0x46')],qs[_0x4217('0x49')](_0x2ea675['query'][_0x4217('0x49')]));_0x303abd['attributes']=_0x303abd[_0x4217('0x4a')][_0x4217('0x4b')]?_0x303abd[_0x4217('0x4a')]:_0x565008[_0x4217('0x46')];if(_0x2ea675[_0x4217('0x47')][_0x4217('0x53')]){_0x303abd[_0x4217('0x5a')]=[{'all':!![]}];}_0x303abd=_[_0x4217('0x4f')]({},_0x303abd,_0x2ea675[_0x4217('0x51')]);return db['FaxAccount'][_0x4217('0x5b')](_0x303abd)[_0x4217('0x23')](handleEntityNotFound(_0x57b971,null))['then'](respondWithResult(_0x57b971,null))[_0x4217('0x2d')](handleError(_0x57b971,null));};exports['create']=function(_0x4083b2,_0x4e3e59){return db[_0x4217('0x54')][_0x4217('0x5c')](_0x4083b2[_0x4217('0x5d')],{})[_0x4217('0x23')](function(_0x17b1bc){var _0xd039ad=_0x4083b2[_0x4217('0x5e')][_0x4217('0x5f')]({'plain':!![]});if(!_0xd039ad)throw new Error(_0x4217('0x60'));if(_0xd039ad[_0x4217('0x61')]===_0x4217('0x5e')){var _0x44fcc1=_0x17b1bc[_0x4217('0x5f')]({'plain':!![]});var _0x269f37=_0x4217('0x3b');return db[_0x4217('0x62')][_0x4217('0x5b')]({'where':{'name':_0x269f37,'userProfileId':_0xd039ad['userProfileId']},'raw':!![]})[_0x4217('0x23')](function(_0x3fd631){if(_0x3fd631&&_0x3fd631[_0x4217('0x63')]===0x0){return db['UserProfileResource'][_0x4217('0x5c')]({'name':_0x44fcc1['name'],'resourceId':_0x44fcc1['id'],'type':_0x3fd631[_0x4217('0x3f')],'sectionId':_0x3fd631['id']},{})[_0x4217('0x23')](function(){return _0x17b1bc;});}else{return _0x17b1bc;}})[_0x4217('0x2d')](function(_0x42bc41){logger[_0x4217('0x28')](_0x4217('0x64'),_0x42bc41);throw _0x42bc41;});}return _0x17b1bc;})[_0x4217('0x23')](respondWithResult(_0x4e3e59,0xc9))['catch'](handleError(_0x4e3e59,null));};exports[_0x4217('0x39')]=function(_0x47f28e,_0xae9b1c){if(_0x47f28e[_0x4217('0x5d')]['id']){delete _0x47f28e['body']['id'];}return db[_0x4217('0x54')][_0x4217('0x5b')]({'where':{'id':_0x47f28e[_0x4217('0x57')]['id']},'include':[{'model':db[_0x4217('0x41')],'as':'mandatoryDispositionPause'}]})[_0x4217('0x23')](handleEntityNotFound(_0xae9b1c,null))['then'](saveUpdates(_0x47f28e[_0x4217('0x5d')],null))[_0x4217('0x23')](respondWithResult(_0xae9b1c,null))[_0x4217('0x2d')](handleError(_0xae9b1c,null));};exports[_0x4217('0x3a')]=function(_0x29f0e0,_0x148303){return db['FaxAccount'][_0x4217('0x5b')]({'where':{'id':_0x29f0e0['params']['id']}})[_0x4217('0x23')](handleEntityNotFound(_0x148303,null))[_0x4217('0x23')](removeEntity(_0x148303,null))['catch'](handleError(_0x148303,null));};exports[_0x4217('0x65')]=function(_0x5b29e3,_0x16a9e0){return db[_0x4217('0x54')][_0x4217('0x65')]()[_0x4217('0x23')](respondWithResult(_0x16a9e0,null))[_0x4217('0x2d')](handleError(_0x16a9e0,null));};exports[_0x4217('0x66')]=function(_0x4581e7,_0xc9578e,_0x39089a){if(_0x4581e7[_0x4217('0x5d')]['id']){delete _0x4581e7[_0x4217('0x5d')]['id'];}return db[_0x4217('0x54')][_0x4217('0x5b')]({'where':{'id':_0x4581e7[_0x4217('0x57')]['id']}})['then'](handleEntityNotFound(_0xc9578e,null))[_0x4217('0x23')](function(_0x26000d){if(_0x26000d){_0x4581e7[_0x4217('0x5d')]['FaxAccountId']=_0x26000d['id'];return db[_0x4217('0x67')][_0x4217('0x5c')](_0x4581e7[_0x4217('0x5d')]);}})[_0x4217('0x23')](respondWithResult(_0xc9578e,null))['catch'](handleError(_0xc9578e,null));};exports['getDispositions']=function(_0x211ea5,_0xcf8b3a,_0x223eb7){var _0x488ee9={'raw':![],'where':{}};var _0x3e58a7={};var _0x48b7d2={'count':0x0,'rows':[]};return db['FaxAccount'][_0x4217('0x68')]({'where':{'id':_0x211ea5[_0x4217('0x57')]['id']}})[_0x4217('0x23')](handleEntityNotFound(_0xcf8b3a,null))[_0x4217('0x23')](function(_0x25b415){if(_0x25b415){_0x3e58a7[_0x4217('0x46')]=_['keys'](db['Disposition'][_0x4217('0x58')]);_0x3e58a7[_0x4217('0x47')]=_['keys'](_0x211ea5[_0x4217('0x47')]);_0x3e58a7[_0x4217('0x4d')]=_[_0x4217('0x48')](_0x3e58a7['model'],_0x3e58a7[_0x4217('0x47')]);_0x488ee9[_0x4217('0x4a')]=_['intersection'](_0x3e58a7[_0x4217('0x46')],qs[_0x4217('0x49')](_0x211ea5[_0x4217('0x47')][_0x4217('0x49')]));_0x488ee9[_0x4217('0x4a')]=_0x488ee9[_0x4217('0x4a')][_0x4217('0x4b')]?_0x488ee9[_0x4217('0x4a')]:_0x3e58a7[_0x4217('0x46')];if(!_0x211ea5['query'][_0x4217('0x69')](_0x4217('0x6a'))){_0x488ee9[_0x4217('0x33')]=qs[_0x4217('0x33')](_0x211ea5[_0x4217('0x47')]['limit']);_0x488ee9[_0x4217('0x32')]=qs[_0x4217('0x32')](_0x211ea5[_0x4217('0x47')][_0x4217('0x32')]);}_0x488ee9['order']=qs[_0x4217('0x4c')](_0x211ea5['query'][_0x4217('0x4c')]);_0x488ee9[_0x4217('0x52')]=qs[_0x4217('0x4d')](_['pick'](_0x211ea5[_0x4217('0x47')],_0x3e58a7[_0x4217('0x4d')]));_0x488ee9['where'][_0x4217('0x6b')]=_0x25b415['id'];if(_0x211ea5[_0x4217('0x47')]['filter']){_0x488ee9[_0x4217('0x52')]=_[_0x4217('0x4f')](_0x488ee9[_0x4217('0x52')],{'$or':_[_0x4217('0x43')](_0x488ee9['attributes'],function(_0x506068){var _0x4e2ebb={};_0x4e2ebb[_0x506068]={'$like':'%'+_0x211ea5[_0x4217('0x47')][_0x4217('0x4e')]+'%'};return _0x4e2ebb;})});}_0x488ee9=_[_0x4217('0x4f')]({},_0x488ee9,_0x211ea5['options']);return db[_0x4217('0x67')][_0x4217('0x31')]({'where':_0x488ee9[_0x4217('0x52')]})[_0x4217('0x23')](function(_0x5f40d8){_0x48b7d2[_0x4217('0x31')]=_0x5f40d8;if(_0x211ea5[_0x4217('0x47')][_0x4217('0x53')]){_0x488ee9[_0x4217('0x5a')]=[{'all':!![]}];}return db[_0x4217('0x67')][_0x4217('0x6c')](_0x488ee9);})[_0x4217('0x23')](function(_0x2907b6){_0x48b7d2[_0x4217('0x55')]=_0x2907b6;return _0x48b7d2;});}})[_0x4217('0x23')](respondWithFilteredResult(_0xcf8b3a,_0x488ee9))[_0x4217('0x2d')](handleError(_0xcf8b3a,null));};exports[_0x4217('0x6d')]=function(_0x4355f1,_0x38bea1,_0x110f73){return db[_0x4217('0x54')]['find']({'where':{'id':_0x4355f1[_0x4217('0x57')]['id']}})['then'](handleEntityNotFound(_0x38bea1,null))[_0x4217('0x23')](function(_0x15eccb){if(_0x15eccb){return _0x15eccb['removeDispositions'](_0x4355f1['query'][_0x4217('0x6e')]);}})['then'](respondWithStatusCode(_0x38bea1,null))[_0x4217('0x2d')](handleError(_0x38bea1,null));};exports['addAnswer']=function(_0x1868eb,_0x335a7e,_0x563ddc){if(_0x1868eb[_0x4217('0x5d')]['id']){delete _0x1868eb[_0x4217('0x5d')]['id'];}return db[_0x4217('0x54')][_0x4217('0x5b')]({'where':{'id':_0x1868eb[_0x4217('0x57')]['id']}})[_0x4217('0x23')](handleEntityNotFound(_0x335a7e,null))[_0x4217('0x23')](function(_0x105eb1){if(_0x105eb1){_0x1868eb['body'][_0x4217('0x6b')]=_0x105eb1['id'];return db['CannedAnswer']['create'](_0x1868eb[_0x4217('0x5d')]);}})[_0x4217('0x23')](respondWithResult(_0x335a7e,null))['catch'](handleError(_0x335a7e,null));};exports[_0x4217('0x6f')]=function(_0x2e7a96,_0x21194b,_0x5d31c9){var _0x45087e={'raw':![],'where':{}};var _0x3f41cd={};var _0x169181={'count':0x0,'rows':[]};return db[_0x4217('0x54')][_0x4217('0x68')]({'where':{'id':_0x2e7a96[_0x4217('0x57')]['id']}})[_0x4217('0x23')](handleEntityNotFound(_0x21194b,null))[_0x4217('0x23')](function(_0x5105fa){if(_0x5105fa){_0x3f41cd[_0x4217('0x46')]=_[_0x4217('0x59')](db['CannedAnswer']['rawAttributes']);_0x3f41cd[_0x4217('0x47')]=_[_0x4217('0x59')](_0x2e7a96[_0x4217('0x47')]);_0x3f41cd[_0x4217('0x4d')]=_['intersection'](_0x3f41cd[_0x4217('0x46')],_0x3f41cd[_0x4217('0x47')]);_0x45087e[_0x4217('0x4a')]=_['intersection'](_0x3f41cd[_0x4217('0x46')],qs[_0x4217('0x49')](_0x2e7a96[_0x4217('0x47')][_0x4217('0x49')]));_0x45087e[_0x4217('0x4a')]=_0x45087e['attributes'][_0x4217('0x4b')]?_0x45087e[_0x4217('0x4a')]:_0x3f41cd[_0x4217('0x46')];if(!_0x2e7a96[_0x4217('0x47')]['hasOwnProperty'](_0x4217('0x6a'))){_0x45087e['limit']=qs[_0x4217('0x33')](_0x2e7a96['query'][_0x4217('0x33')]);_0x45087e[_0x4217('0x32')]=qs['offset'](_0x2e7a96['query']['offset']);}_0x45087e[_0x4217('0x70')]=qs[_0x4217('0x4c')](_0x2e7a96['query'][_0x4217('0x4c')]);_0x45087e[_0x4217('0x52')]=qs[_0x4217('0x4d')](_[_0x4217('0x71')](_0x2e7a96[_0x4217('0x47')],_0x3f41cd[_0x4217('0x4d')]));_0x45087e['where']['FaxAccountId']=_0x5105fa['id'];if(_0x2e7a96['query'][_0x4217('0x4e')]){_0x45087e[_0x4217('0x52')]=_[_0x4217('0x4f')](_0x45087e['where'],{'$or':_[_0x4217('0x43')](_0x45087e[_0x4217('0x4a')],function(_0x1566f4){var _0x1a1d69={};_0x1a1d69[_0x1566f4]={'$like':'%'+_0x2e7a96[_0x4217('0x47')][_0x4217('0x4e')]+'%'};return _0x1a1d69;})});}_0x45087e=_[_0x4217('0x4f')]({},_0x45087e,_0x2e7a96[_0x4217('0x51')]);return db['CannedAnswer'][_0x4217('0x31')]({'where':_0x45087e[_0x4217('0x52')]})[_0x4217('0x23')](function(_0x1d7637){_0x169181[_0x4217('0x31')]=_0x1d7637;if(_0x2e7a96[_0x4217('0x47')]['includeAll']){_0x45087e[_0x4217('0x5a')]=[{'all':!![]}];}return db['CannedAnswer'][_0x4217('0x6c')](_0x45087e);})[_0x4217('0x23')](function(_0x59d3b2){_0x169181[_0x4217('0x55')]=_0x59d3b2;return _0x169181;});}})[_0x4217('0x23')](respondWithFilteredResult(_0x21194b,_0x45087e))[_0x4217('0x2d')](handleError(_0x21194b,null));};exports[_0x4217('0x72')]=function(_0x556172,_0x29765f,_0xe159df){return db[_0x4217('0x54')][_0x4217('0x5b')]({'where':{'id':_0x556172[_0x4217('0x57')]['id']}})[_0x4217('0x23')](handleEntityNotFound(_0x29765f,null))[_0x4217('0x23')](function(_0x4a8c8f){if(_0x4a8c8f){return _0x4a8c8f[_0x4217('0x72')](_0x556172['query']['ids']);}})['then'](respondWithStatusCode(_0x29765f,null))['catch'](handleError(_0x29765f,null));};exports[_0x4217('0x73')]=function(_0x37cc97,_0x58e262,_0x1b0dcc){return db[_0x4217('0x74')][_0x4217('0x5b')]({'where':{'id':_0x37cc97['params']['id']}})[_0x4217('0x23')](handleEntityNotFound(_0x58e262,null))[_0x4217('0x23')](function(_0xf0370d){if(_0xf0370d){return _0xf0370d[_0x4217('0x73')](_0x37cc97[_0x4217('0x5d')]['ids'],_[_0x4217('0x75')](_0x37cc97['body'],[_0x4217('0x6e'),'id'])||{});}})[_0x4217('0x23')](respondWithResult(_0x58e262,null))[_0x4217('0x2d')](handleError(_0x58e262,null));};exports['getInteractions']=function(_0x2ccbbd,_0x5f4bdb,_0x325017){var _0x2e9606={'raw':![],'where':{}};var _0x9e3567={};var _0x29944a={'count':0x0,'rows':[]};return db['FaxAccount'][_0x4217('0x68')]({'where':{'id':_0x2ccbbd[_0x4217('0x57')]['id']}})[_0x4217('0x23')](handleEntityNotFound(_0x5f4bdb,null))[_0x4217('0x23')](function(_0x239b13){if(_0x239b13){_0x9e3567[_0x4217('0x46')]=_['keys'](db[_0x4217('0x74')][_0x4217('0x58')]);_0x9e3567[_0x4217('0x47')]=_[_0x4217('0x59')](_0x2ccbbd[_0x4217('0x47')]);_0x9e3567[_0x4217('0x4d')]=_['intersection'](_0x9e3567[_0x4217('0x46')],_0x9e3567[_0x4217('0x47')]);_0x2e9606[_0x4217('0x4a')]=_['intersection'](_0x9e3567[_0x4217('0x46')],qs[_0x4217('0x49')](_0x2ccbbd[_0x4217('0x47')][_0x4217('0x49')]));_0x2e9606[_0x4217('0x4a')]=_0x2e9606[_0x4217('0x4a')][_0x4217('0x4b')]?_0x2e9606[_0x4217('0x4a')]:_0x9e3567[_0x4217('0x46')];if(!_0x2ccbbd[_0x4217('0x47')][_0x4217('0x69')](_0x4217('0x6a'))){_0x2e9606['limit']=qs[_0x4217('0x33')](_0x2ccbbd[_0x4217('0x47')]['limit']);_0x2e9606[_0x4217('0x32')]=qs['offset'](_0x2ccbbd[_0x4217('0x47')][_0x4217('0x32')]);}_0x2e9606[_0x4217('0x70')]=qs[_0x4217('0x4c')](_0x2ccbbd['query'][_0x4217('0x4c')]);_0x2e9606[_0x4217('0x52')]=qs[_0x4217('0x4d')](_[_0x4217('0x71')](_0x2ccbbd[_0x4217('0x47')],_0x9e3567[_0x4217('0x4d')]));_0x2e9606[_0x4217('0x52')]['FaxAccountId']=_0x239b13['id'];if(_0x2ccbbd[_0x4217('0x47')][_0x4217('0x4e')]){_0x2e9606['where']=_[_0x4217('0x4f')](_0x2e9606[_0x4217('0x52')],{'$or':_[_0x4217('0x43')](_0x2e9606[_0x4217('0x4a')],function(_0x109ac1){var _0x5f004e={};_0x5f004e[_0x109ac1]={'$like':'%'+_0x2ccbbd[_0x4217('0x47')][_0x4217('0x4e')]+'%'};return _0x5f004e;})});}_0x2e9606=_[_0x4217('0x4f')]({},_0x2e9606,_0x2ccbbd[_0x4217('0x51')]);return db['FaxInteraction'][_0x4217('0x31')]({'where':_0x2e9606[_0x4217('0x52')]})[_0x4217('0x23')](function(_0x2f18dc){_0x29944a[_0x4217('0x31')]=_0x2f18dc;if(_0x2ccbbd[_0x4217('0x47')][_0x4217('0x53')]){_0x2e9606[_0x4217('0x5a')]=[{'model':db['CmContact'],'as':_0x4217('0x76'),'required':![]},{'model':db['User'],'as':_0x4217('0x77'),'attributes':[_0x4217('0x3f'),_0x4217('0x78'),_0x4217('0x79')],'required':![]},{'model':db['Tag'],'as':_0x4217('0x7a'),'attributes':['id','name','color'],'where':_0x2ccbbd['query'][_0x4217('0x7b')]?{'id':_0x2ccbbd['query'][_0x4217('0x7b')]}:undefined,'required':_0x2ccbbd[_0x4217('0x47')][_0x4217('0x7b')]?!![]:![]}];}return db[_0x4217('0x74')][_0x4217('0x6c')](_0x2e9606);})[_0x4217('0x23')](function(_0x431137){_0x29944a[_0x4217('0x55')]=_0x431137;return _0x29944a;});}})['then'](respondWithFilteredResult(_0x5f4bdb,_0x2e9606))[_0x4217('0x2d')](handleError(_0x5f4bdb,null));};exports[_0x4217('0x7c')]=function(_0x16f087,_0x186824,_0x6e7dd6){return db[_0x4217('0x54')]['findOne']({'where':{'id':_0x16f087[_0x4217('0x57')]['id']}})[_0x4217('0x23')](handleEntityNotFound(_0x186824,null))[_0x4217('0x23')](function(_0x4218eb){if(_0x4218eb){return db[_0x4217('0x7d')][_0x4217('0x7e')](function(_0x7e1fe8){return db[_0x4217('0x7f')][_0x4217('0x3a')]({'where':{'FaxAccountId':_0x16f087[_0x4217('0x57')]['id']},'transaction':_0x7e1fe8})['then'](function(_0x3b5179){var _0x30950e=_[_0x4217('0x43')](_0x16f087[_0x4217('0x5d')],function(_0x11d78f){_0x11d78f[_0x4217('0x6b')]=_0x16f087['params']['id'];return _0x11d78f;});return db['FaxApplication'][_0x4217('0x80')](_0x30950e,{'transaction':_0x7e1fe8});});})[_0x4217('0x23')](function(){return db[_0x4217('0x7f')][_0x4217('0x81')]({'where':{'FaxAccountId':_0x16f087[_0x4217('0x57')]['id']},'order':'priority'});});}})['then'](respondWithResult(_0x186824,null))[_0x4217('0x2d')](handleError(_0x186824,null));};exports[_0x4217('0x82')]=function(_0x1c6e57,_0xec1aa1,_0x40aaa2){var _0x34433b={};var _0x1e9354={};var _0x261b5c;var _0x2ed268;return db[_0x4217('0x54')][_0x4217('0x68')]({'where':{'id':_0x1c6e57[_0x4217('0x57')]['id']}})[_0x4217('0x23')](handleEntityNotFound(_0xec1aa1,null))[_0x4217('0x23')](function(_0x3f8d91){if(_0x3f8d91){_0x261b5c=_0x3f8d91;_0x1e9354['model']=_[_0x4217('0x59')](db[_0x4217('0x7f')]['rawAttributes']);_0x1e9354[_0x4217('0x47')]=_[_0x4217('0x59')](_0x1c6e57[_0x4217('0x47')]);_0x1e9354[_0x4217('0x4d')]=_[_0x4217('0x48')](_0x1e9354[_0x4217('0x46')],_0x1e9354['query']);_0x34433b[_0x4217('0x4a')]=_[_0x4217('0x48')](_0x1e9354[_0x4217('0x46')],qs[_0x4217('0x49')](_0x1c6e57[_0x4217('0x47')][_0x4217('0x49')]));_0x34433b['attributes']=_0x34433b[_0x4217('0x4a')][_0x4217('0x4b')]?_0x34433b[_0x4217('0x4a')]:_0x1e9354['model'];_0x34433b[_0x4217('0x70')]=qs['sort'](_0x1c6e57[_0x4217('0x47')][_0x4217('0x4c')]);_0x34433b['where']=qs[_0x4217('0x4d')](_['pick'](_0x1c6e57[_0x4217('0x47')],_0x1e9354[_0x4217('0x4d')]));if(_0x1c6e57[_0x4217('0x47')][_0x4217('0x4e')]){_0x34433b['where']=_['merge'](_0x34433b[_0x4217('0x52')],{'$or':_[_0x4217('0x43')](_0x34433b[_0x4217('0x4a')],function(_0x1d359b){var _0x2020c5={};_0x2020c5[_0x1d359b]={'$like':'%'+_0x1c6e57[_0x4217('0x47')][_0x4217('0x4e')]+'%'};return _0x2020c5;})});}_0x34433b=_['merge']({},_0x34433b,_0x1c6e57['options']);return _0x261b5c[_0x4217('0x82')](_0x34433b);}})[_0x4217('0x23')](function(_0x218c9f){if(_0x218c9f){_0x2ed268=_0x218c9f[_0x4217('0x4b')];if(!_0x1c6e57[_0x4217('0x47')][_0x4217('0x69')]('nolimit')){_0x34433b[_0x4217('0x33')]=qs[_0x4217('0x33')](_0x1c6e57[_0x4217('0x47')][_0x4217('0x33')]);_0x34433b['offset']=qs[_0x4217('0x32')](_0x1c6e57[_0x4217('0x47')]['offset']);}return _0x261b5c[_0x4217('0x82')](_0x34433b);}})[_0x4217('0x23')](function(_0x18f5ce){if(_0x18f5ce){return _0x18f5ce?{'count':_0x2ed268,'rows':_0x18f5ce}:null;}})[_0x4217('0x23')](respondWithResult(_0xec1aa1,null))[_0x4217('0x2d')](handleError(_0xec1aa1,null));};function Extension(_0x437cd4,_0x51b4ca,_0x4ba726,_0x43e368){this[_0x4217('0x83')]=_0x4217('0x84');this[_0x4217('0x85')]=_0x437cd4[_0x4217('0x86')];this['app']=_0x43e368;this['type']=_0x4217('0x87');this[_0x4217('0x88')]='Fax\x20Extension';this[_0x4217('0x6b')]=_0x437cd4['id'];this[_0x4217('0x89')]=_0x51b4ca;this[_0x4217('0x8a')]=_0x4ba726;}function createExtensionsReciveFax(_0x545444){var _0x543aa5=0x1;var _0x62e93a=[];_0x62e93a['push'](new Extension(_0x545444,_0x543aa5,'','Answer'));_0x543aa5+=0x1;_0x62e93a[_0x4217('0x8b')](new Extension(_0x545444,_0x543aa5,_0x4217('0x8c'),_0x4217('0x8d')));_0x543aa5+=0x1;for(var _0x5739b8 in _0x545444){if(_0x545444['hasOwnProperty'](_0x5739b8)&&(_0x5739b8===_0x4217('0x8e')||_0x5739b8===_0x4217('0x86')||_0x5739b8===_0x4217('0x8f')||_0x5739b8==='faxdetect'||_0x5739b8===_0x4217('0x90')||_0x5739b8===_0x4217('0x91')||_0x5739b8==='minrate'||_0x5739b8===_0x4217('0x92')||_0x5739b8===_0x4217('0x93'))){_0x62e93a[_0x4217('0x8b')](new Extension(_0x545444,_0x543aa5,_0x4217('0x94')+_0x5739b8+')='+_0x545444[_0x5739b8],'Set'));_0x543aa5+=0x1;}}_0x62e93a[_0x4217('0x8b')](new Extension(_0x545444,_0x543aa5,'6',_0x4217('0x95')));_0x543aa5+=0x1;_0x62e93a[_0x4217('0x8b')](new Extension(_0x545444,_0x543aa5,_0x4217('0x96'),_0x4217('0x97')));_0x543aa5=0x0;return _0x62e93a;}exports[_0x4217('0x98')]=function(_0x249764,_0x31714,_0x5a20dd){var _0x4b5ed8;return db[_0x4217('0x7d')]['transaction'](function(_0xb16e10){return db['FaxAccount'][_0x4217('0x5c')](_0x249764['body'],{'transaction':_0xb16e10})[_0x4217('0x23')](function(_0x4a1108){_0x4b5ed8=_0x4a1108[_0x4217('0x5f')]({'plain':!![]});return db[_0x4217('0x99')][_0x4217('0x80')](createExtensionsReciveFax(_0x4b5ed8),{'transaction':_0xb16e10});});})[_0x4217('0x23')](function(){return _0x4b5ed8;})[_0x4217('0x23')](respondWithResult(_0x31714,null))['catch'](handleError(_0x31714,null));};exports[_0x4217('0x9a')]=function(_0x4087bb,_0x295ae8,_0x5783b0){var _0x544ed8;return db[_0x4217('0x7d')][_0x4217('0x7e')](function(_0xe192df){return db[_0x4217('0x54')][_0x4217('0x39')](_0x4087bb[_0x4217('0x5d')],{'where':{'id':_0x4087bb[_0x4217('0x5d')]['id']},'transaction':_0xe192df})[_0x4217('0x23')](function(_0x4c1cac){return db[_0x4217('0x99')][_0x4217('0x3a')]({'where':{'FaxAccountId':_0x4087bb[_0x4217('0x5d')]['id']},'transaction':_0xe192df})[_0x4217('0x23')](function(_0x3233c2){return db['VoiceExtension'][_0x4217('0x80')](createExtensionsReciveFax(_[_0x4217('0x75')](_0x4087bb[_0x4217('0x5d')],['tech',_0x4217('0x45'),_0x4217('0x9b'),'updatedAt',_0x4217('0x9c'),'ListId'])),{'transaction':_0xe192df});});});})[_0x4217('0x23')](function(){return db[_0x4217('0x54')][_0x4217('0x9d')](_0x4087bb[_0x4217('0x5d')]['id']);})[_0x4217('0x23')](respondWithResult(_0x295ae8,null))[_0x4217('0x2d')](handleError(_0x295ae8,null));};exports[_0x4217('0x9e')]=function(_0x22330a,_0xa64e7b,_0x935bdd){var _0x127593={'raw':!![],'where':{}};var _0x55df02={};var _0x2c959a={'count':0x0,'rows':[]};return db[_0x4217('0x54')][_0x4217('0x68')]({'where':{'id':_0x22330a[_0x4217('0x57')]['id']}})['then'](handleEntityNotFound(_0xa64e7b,null))[_0x4217('0x23')](function(_0x1e55b1){if(_0x1e55b1){_0x55df02[_0x4217('0x46')]=_[_0x4217('0x59')](db[_0x4217('0x9f')]['rawAttributes']);_0x55df02[_0x4217('0x47')]=_['keys'](_0x22330a['query']);_0x55df02[_0x4217('0x4d')]=_[_0x4217('0x48')](_0x55df02[_0x4217('0x46')],_0x55df02[_0x4217('0x47')]);_0x127593['attributes']=_['intersection'](_0x55df02[_0x4217('0x46')],qs['fields'](_0x22330a[_0x4217('0x47')][_0x4217('0x49')]));_0x127593['attributes']=_0x127593['attributes'][_0x4217('0x4b')]?_0x127593[_0x4217('0x4a')]:_0x55df02[_0x4217('0x46')];if(!_0x22330a[_0x4217('0x47')][_0x4217('0x69')]('nolimit')){_0x127593[_0x4217('0x33')]=qs[_0x4217('0x33')](_0x22330a['query'][_0x4217('0x33')]);_0x127593[_0x4217('0x32')]=qs[_0x4217('0x32')](_0x22330a[_0x4217('0x47')][_0x4217('0x32')]);}_0x127593['order']=qs['sort'](_0x22330a[_0x4217('0x47')][_0x4217('0x4c')]);_0x127593['where']=qs[_0x4217('0x4d')](_['pick'](_0x22330a['query'],_0x55df02['filters']));_0x127593['where'][_0x4217('0x6b')]=_0x1e55b1['id'];if(_0x22330a['query']['filter']){_0x127593[_0x4217('0x52')]=_[_0x4217('0x4f')](_0x127593['where'],{'$or':_[_0x4217('0x43')](_0x127593[_0x4217('0x4a')],function(_0x5979e6){var _0x300dda={};_0x300dda[_0x5979e6]={'$like':'%'+_0x22330a[_0x4217('0x47')]['filter']+'%'};return _0x300dda;})});}if(_0x22330a[_0x4217('0x47')][_0x4217('0xa0')]){var _0x3a6858=_0x22330a[_0x4217('0x47')][_0x4217('0xa0')][_0x4217('0xa1')](',');var _0x5840ad={};_0x5840ad[_0x3a6858[0x0]]={'$gte':moment(_0x3a6858[0x1])['format'](_0x4217('0xa2'))};_0x127593['where']=_['merge'](_0x127593['where'],_0x5840ad);}_0x127593=_[_0x4217('0x4f')]({},_0x127593,_0x22330a[_0x4217('0x51')]);return db['FaxMessage'][_0x4217('0x31')]({'where':_0x127593[_0x4217('0x52')]})[_0x4217('0x23')](function(_0x43adad){_0x2c959a[_0x4217('0x31')]=_0x43adad;if(_0x22330a['query'][_0x4217('0x53')]){_0x127593[_0x4217('0x5a')]=[{'all':!![]}];}return db[_0x4217('0x9f')][_0x4217('0x6c')](_0x127593);})[_0x4217('0x23')](function(_0xae61f6){_0x2c959a[_0x4217('0x55')]=_0xae61f6;return _0x2c959a;});}})[_0x4217('0x23')](respondWithFilteredResult(_0xa64e7b,_0x127593))[_0x4217('0x2d')](handleError(_0xa64e7b,null));};exports[_0x4217('0xa3')]=function(_0x5fc951,_0x427440,_0x4991f0){var _0x4f7be0,_0xba8557={},_0x9d7e6e;if(_0x5fc951[_0x4217('0x5d')]['to']){_0x9d7e6e=_0x5fc951[_0x4217('0x5d')]['to'][0x0];}return db[_0x4217('0x54')][_0x4217('0x5b')]({'where':{'id':_0x5fc951[_0x4217('0x57')]['id']},'include':[{'model':db[_0x4217('0xa4')],'as':_0x4217('0xa5'),'include':[{'model':db[_0x4217('0xa6')],'as':_0x4217('0xa7'),'where':{'fax':_0x9d7e6e},'limit':0x1,'order':[[_0x4217('0xa8'),_0x4217('0xa9')]]}]}]})['then'](handleEntityNotFound(_0x427440,null))[_0x4217('0x23')](function(_0x292382){_0x4f7be0=_0x292382;if(_0x5fc951[_0x4217('0x5d')][_0x4217('0xaa')]&&_0x5fc951[_0x4217('0x5d')][_0x4217('0xaa')][_0x4217('0x4b')]){for(var _0x368132=0x0;_0x368132<_0x5fc951[_0x4217('0x5d')][_0x4217('0xaa')][_0x4217('0x4b')];_0x368132+=0x1){_0x5fc951['body'][_0x4217('0xaa')][_0x368132]={'filename':_0x5fc951[_0x4217('0x5d')][_0x4217('0xaa')][_0x368132]['name'],'id':_0x5fc951[_0x4217('0x5d')]['attachments'][_0x368132]['id'],'path':path[_0x4217('0xab')](config['root'],_0x4217('0xac'),_0x5fc951[_0x4217('0x5d')][_0x4217('0xaa')][_0x368132][_0x4217('0xad')])};}}return respondWithRpcPromise(_0x4217('0xae'),_0x4217('0xae'),{'FaxAccountId':_[_0x4217('0xaf')](_0x5fc951[_0x4217('0x57')]['id'])?undefined:_0x5fc951[_0x4217('0x57')]['id'],'path':_[_0x4217('0xaf')](_0x5fc951[_0x4217('0x5d')][_0x4217('0xaa')][0x0]['path'])?undefined:_0x5fc951[_0x4217('0x5d')]['attachments'][0x0]['path'],'fax':_[_0x4217('0xaf')](_0x5fc951[_0x4217('0x5d')]['to'][0x0])?undefined:_0x5fc951[_0x4217('0x5d')]['to'][0x0]},client9002);})[_0x4217('0x23')](function(){if(_0x4f7be0){if(_[_0x4217('0xaf')](_0x5fc951[_0x4217('0x5d')]['from'])){_0x5fc951[_0x4217('0x5d')][_0x4217('0xb0')]=util[_0x4217('0xb1')](_0x4217('0xb2'),_0x4f7be0[_0x4217('0x3f')],_0x4f7be0[_0x4217('0xb3')]);}if(_0x4f7be0[_0x4217('0xa5')]){if(_0x4f7be0[_0x4217('0xa5')]['Contacts']['length']){return _0x4f7be0['List'][_0x4217('0xa7')][0x0];}else{return db[_0x4217('0xa6')][_0x4217('0x5c')](_[_0x4217('0x18')](_0x5fc951[_0x4217('0x5d')],{'firstName':_0x5fc951['body']['to'][0x0],'phone':_0x5fc951[_0x4217('0x5d')]['to'][0x0],'fax':_0x5fc951[_0x4217('0x5d')]['to'][0x0],'ListId':_0x4f7be0[_0x4217('0xb4')]}));}}else{throw new Error(_0x4217('0xb5'));}}else{throw new Error(_0x4217('0xb6'));}})['then'](function(_0x20dccd){if(_0x20dccd){return db['FaxInteraction'][_0x4217('0x5b')]({'where':{'ContactId':_0x20dccd['id'],'closed':![],'FaxAccountId':_0x4f7be0['id']}})[_0x4217('0x23')](function(_0x497efb){if(_0x497efb){return[_0x497efb,![]];}return db[_0x4217('0x74')][_0x4217('0x5c')]({'UserId':_0x5fc951[_0x4217('0x5e')]['id'],'ContactId':_0x20dccd['id'],'FaxAccountId':_0x4f7be0['id'],'fax':_0x5fc951[_0x4217('0x5d')]['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0x4217('0x4f')](_0x5fc951[_0x4217('0x5d')],{'read':![],'body':_0x5fc951[_0x4217('0x5d')][_0x4217('0xaa')][0x0][_0x4217('0xb7')],'FaxAccountId':_0x4f7be0['id'],'UserId':_0x5fc951[_0x4217('0x5e')]['id'],'ContactId':_0x20dccd['id'],'AttachmentId':_0x5fc951['body'][_0x4217('0xaa')][0x0]['id']})]},{'include':[{'model':db[_0x4217('0x9f')],'as':_0x4217('0xb8')}]})['then'](function(_0x294e5c){return[_0x294e5c,!![]];});});}else{throw new Error(_0x4217('0xb9'));}})[_0x4217('0xba')](function(_0x5589bf,_0x171920){if(_0x171920){return _0x5589bf;}return db[_0x4217('0x9f')][_0x4217('0x5c')]({'direction':_0x4217('0xbb'),'read':![],'body':_0x5fc951[_0x4217('0x5d')]['attachments'][0x0]['filename'],'FaxAccountId':_0x4f7be0['id'],'FaxInteractionId':_0x5589bf['id'],'UserId':_0x5fc951['user']['id'],'ContactId':_0x5589bf[_0x4217('0xbc')],'AttachmentId':_0x5fc951['body']['attachments'][0x0]['id']})[_0x4217('0x23')](function(_0x476a64){_0x5589bf['dataValues'][_0x4217('0xb8')]=[];_0x5589bf[_0x4217('0xbd')][_0x4217('0xb8')][_0x4217('0x8b')](_0x476a64['dataValues']);return _0x5589bf;});})[_0x4217('0x23')](function(_0xa47a6e){respondWithRpcPromise(_0x4217('0xbe'),_0x4217('0xbe'),{'FaxAccountId':_[_0x4217('0xaf')](_0x5fc951['params']['id'])?undefined:_0x5fc951['params']['id'],'path':_[_0x4217('0xaf')](_0x5fc951[_0x4217('0x5d')][_0x4217('0xaa')][0x0][_0x4217('0xbf')])?undefined:_0x5fc951[_0x4217('0x5d')][_0x4217('0xaa')][0x0][_0x4217('0xbf')],'fax':_['isNil'](_0x5fc951[_0x4217('0x5d')]['to'][0x0])?undefined:_0x5fc951[_0x4217('0x5d')]['to'][0x0],'AttachmentId':_0x5fc951[_0x4217('0x5d')][_0x4217('0xaa')][0x0]['id']},client9002)[_0x4217('0x23')](function(_0x1148db){logger[_0x4217('0x2b')]('SendFaxRpc,\x20%s',_0x1148db);})[_0x4217('0x2d')](function(_0x413ab9){logger[_0x4217('0x2b')](_0x4217('0xc0'),_0x413ab9);});return _0xa47a6e;})['then'](respondWithResult(_0x427440,null))['catch'](handleError(_0x427440,null));};exports[_0x4217('0xc1')]=function(_0x5daa5f,_0x269654,_0x5add61){return db[_0x4217('0x54')][_0x4217('0x5b')]({'where':{'id':_0x5daa5f['params']['id']}})['then'](handleEntityNotFound(_0x269654,null))[_0x4217('0x23')](function(_0x273b47){if(_0x273b47){return _0x273b47[_0x4217('0xc1')](_0x5daa5f[_0x4217('0x5d')][_0x4217('0x6e')],_['omit'](_0x5daa5f[_0x4217('0x5d')],[_0x4217('0x6e'),'id'])||{})[_0x4217('0xba')](function(_0x38b632){for(var _0x39ba98=0x0;_0x39ba98<_0x5daa5f[_0x4217('0x5d')]['ids'][_0x4217('0x4b')];_0x39ba98+=0x1){socket[_0x4217('0xc2')](_0x4217('0xc3'),{'UserId':_0x5daa5f[_0x4217('0x5d')]['ids'][_0x39ba98],'FaxAccountId':_0x5daa5f[_0x4217('0x57')]['id']});}return _0x38b632;});}})[_0x4217('0x23')](respondWithResult(_0x269654,null))[_0x4217('0x2d')](handleError(_0x269654,null));};exports[_0x4217('0xc4')]=function(_0x5c420c,_0x35c5d5,_0x2c45c8){return db[_0x4217('0x54')][_0x4217('0x5b')]({'where':{'id':_0x5c420c['params']['id']}})[_0x4217('0x23')](handleEntityNotFound(_0x35c5d5,null))['then'](function(_0x53a38e){if(_0x53a38e){return _0x53a38e[_0x4217('0xc4')](_0x5c420c['query'][_0x4217('0x6e')])['then'](function(){if(_['isArray'](_0x5c420c[_0x4217('0x47')][_0x4217('0x6e')])){for(var _0x2c0af3=0x0;_0x2c0af3<_0x5c420c['query'][_0x4217('0x6e')]['length'];_0x2c0af3+=0x1){socket[_0x4217('0xc2')](_0x4217('0xc5'),{'UserId':Number(_0x5c420c[_0x4217('0x47')][_0x4217('0x6e')][_0x2c0af3]),'FaxAccountId':Number(_0x5c420c[_0x4217('0x57')]['id'])});}}else{socket[_0x4217('0xc2')](_0x4217('0xc5'),{'UserId':Number(_0x5c420c['query']['ids']),'FaxAccountId':Number(_0x5c420c[_0x4217('0x57')]['id'])});}});}})[_0x4217('0x23')](respondWithStatusCode(_0x35c5d5,null))[_0x4217('0x2d')](handleError(_0x35c5d5,null));};exports[_0x4217('0xc6')]=function(_0x2f8a71,_0x3f27d6,_0x437ec9){var _0x2cc789={};var _0x49a9b6={};var _0x5be00b;var _0x3f0e52;return db[_0x4217('0x54')][_0x4217('0x68')]({'where':{'id':_0x2f8a71['params']['id']}})[_0x4217('0x23')](handleEntityNotFound(_0x3f27d6,null))[_0x4217('0x23')](function(_0x15c97a){if(_0x15c97a){_0x5be00b=_0x15c97a;_0x49a9b6['model']=_[_0x4217('0x59')](db[_0x4217('0xc7')]['rawAttributes']);_0x49a9b6[_0x4217('0x47')]=_[_0x4217('0x59')](_0x2f8a71[_0x4217('0x47')]);_0x49a9b6['filters']=_[_0x4217('0x48')](_0x49a9b6[_0x4217('0x46')],_0x49a9b6[_0x4217('0x47')]);_0x2cc789[_0x4217('0x4a')]=_[_0x4217('0x48')](_0x49a9b6['model'],qs[_0x4217('0x49')](_0x2f8a71['query'][_0x4217('0x49')]));_0x2cc789['attributes']=_0x2cc789['attributes']['length']?_0x2cc789[_0x4217('0x4a')]:_0x49a9b6[_0x4217('0x46')];_0x2cc789['order']=qs['sort'](_0x2f8a71['query'][_0x4217('0x4c')]);_0x2cc789[_0x4217('0x52')]=qs[_0x4217('0x4d')](_['pick'](_0x2f8a71[_0x4217('0x47')],_0x49a9b6[_0x4217('0x4d')]));if(_0x2f8a71[_0x4217('0x47')][_0x4217('0x4e')]){_0x2cc789[_0x4217('0x52')]=_['merge'](_0x2cc789[_0x4217('0x52')],{'$or':_[_0x4217('0x43')](_0x2cc789[_0x4217('0x4a')],function(_0x18e427){var _0xb5aa9a={};_0xb5aa9a[_0x18e427]={'$like':'%'+_0x2f8a71[_0x4217('0x47')]['filter']+'%'};return _0xb5aa9a;})});}_0x2cc789=_[_0x4217('0x4f')]({},_0x2cc789,_0x2f8a71[_0x4217('0x51')]);return _0x5be00b[_0x4217('0xc6')](_0x2cc789);}})['then'](function(_0xe23b4f){if(_0xe23b4f){_0x3f0e52=_0xe23b4f[_0x4217('0x4b')];if(!_0x2f8a71['query'][_0x4217('0x69')](_0x4217('0x6a'))){_0x2cc789['limit']=qs[_0x4217('0x33')](_0x2f8a71[_0x4217('0x47')][_0x4217('0x33')]);_0x2cc789['offset']=qs[_0x4217('0x32')](_0x2f8a71[_0x4217('0x47')][_0x4217('0x32')]);}return _0x5be00b['getAgents'](_0x2cc789);}})[_0x4217('0x23')](function(_0x5c57b9){if(_0x5c57b9){return _0x5c57b9?{'count':_0x3f0e52,'rows':_0x5c57b9}:null;}})[_0x4217('0x23')](respondWithResult(_0x3f27d6,null))[_0x4217('0x2d')](handleError(_0x3f27d6,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 0bd96db..938f786 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 _0x7268=['remove','emit','hasOwnProperty','exports','events','setMaxListeners','save','update'];(function(_0x208b69,_0xadaed7){var _0x7f1fe4=function(_0x297bab){while(--_0x297bab){_0x208b69['push'](_0x208b69['shift']());}};_0x7f1fe4(++_0xadaed7);}(_0x7268,0x1d4));var _0x8726=function(_0x3bf6d2,_0x3ccca5){_0x3bf6d2=_0x3bf6d2-0x0;var _0x3a8432=_0x7268[_0x3bf6d2];return _0x3a8432;};'use strict';var EventEmitter=require(_0x8726('0x0'));var FaxAccount=require('../../mysqldb')['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x8726('0x1')](0x0);var events={'afterCreate':_0x8726('0x2'),'afterUpdate':_0x8726('0x3'),'afterDestroy':_0x8726('0x4')};function emitEvent(_0x200936){return function(_0x33951c,_0x1e627b,_0x36ca66){FaxAccountEvents[_0x8726('0x5')](_0x200936+':'+_0x33951c['id'],_0x33951c);FaxAccountEvents[_0x8726('0x5')](_0x200936,_0x33951c);_0x36ca66(null);};}for(var e in events){if(events[_0x8726('0x6')](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0x8726('0x7')]=FaxAccountEvents; \ No newline at end of file +var _0x2fed=['remove','hasOwnProperty','hook','exports','events','../../mysqldb','FaxAccount','save','update'];(function(_0x223a99,_0x1ddaff){var _0x5a2346=function(_0x2d77ae){while(--_0x2d77ae){_0x223a99['push'](_0x223a99['shift']());}};_0x5a2346(++_0x1ddaff);}(_0x2fed,0x11b));var _0xd2fe=function(_0x5e1882,_0x49be29){_0x5e1882=_0x5e1882-0x0;var _0x1c878b=_0x2fed[_0x5e1882];return _0x1c878b;};'use strict';var EventEmitter=require(_0xd2fe('0x0'));var FaxAccount=require(_0xd2fe('0x1'))['db'][_0xd2fe('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd2fe('0x3'),'afterUpdate':_0xd2fe('0x4'),'afterDestroy':_0xd2fe('0x5')};function emitEvent(_0x476ef8){return function(_0x3dfd66,_0x1c241a,_0x42be03){FaxAccountEvents['emit'](_0x476ef8+':'+_0x3dfd66['id'],_0x3dfd66);FaxAccountEvents['emit'](_0x476ef8,_0x3dfd66);_0x42be03(null);};}for(var e in events){if(events[_0xd2fe('0x6')](e)){var event=events[e];FaxAccount[_0xd2fe('0x7')](e,emitEvent(event));}}module[_0xd2fe('0x8')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index ee746cf..c450068 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 _0xe6a6=['../../config/environment','exports','define','FaxAccount','fax_accounts','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf'];(function(_0x5f3ebf,_0x38f294){var _0x12b6e4=function(_0x10d977){while(--_0x10d977){_0x5f3ebf['push'](_0x5f3ebf['shift']());}};_0x12b6e4(++_0x38f294);}(_0xe6a6,0x7d));var _0x6e6a=function(_0x2da0ba,_0x46c7de){_0x2da0ba=_0x2da0ba-0x0;var _0x5b190c=_0xe6a6[_0x2da0ba];return _0x5b190c;};'use strict';var _=require(_0x6e6a('0x0'));var util=require(_0x6e6a('0x1'));var logger=require(_0x6e6a('0x2'))('api');var moment=require(_0x6e6a('0x3'));var BPromise=require(_0x6e6a('0x4'));var rp=require(_0x6e6a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6e6a('0x6'));var config=require(_0x6e6a('0x7'));var attributes=require('./faxAccount.attributes');module[_0x6e6a('0x8')]=function(_0x5a7ee5,_0x3ce7dd){return _0x5a7ee5[_0x6e6a('0x9')](_0x6e6a('0xa'),attributes,{'tableName':_0x6e6a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xafe1=['define','FaxAccount','util','../../config/logger','bluebird','request-promise','path','rimraf','./faxAccount.attributes','exports'];(function(_0x53f715,_0x52587b){var _0x16c757=function(_0x5cc9bf){while(--_0x5cc9bf){_0x53f715['push'](_0x53f715['shift']());}};_0x16c757(++_0x52587b);}(_0xafe1,0x1ba));var _0x1afe=function(_0x46928f,_0x5c8481){_0x46928f=_0x46928f-0x0;var _0x3c21bb=_0xafe1[_0x46928f];return _0x3c21bb;};'use strict';var _=require('lodash');var util=require(_0x1afe('0x0'));var logger=require(_0x1afe('0x1'))('api');var moment=require('moment');var BPromise=require(_0x1afe('0x2'));var rp=require(_0x1afe('0x3'));var fs=require('fs');var path=require(_0x1afe('0x4'));var rimraf=require(_0x1afe('0x5'));var config=require('../../config/environment');var attributes=require(_0x1afe('0x6'));module[_0x1afe('0x7')]=function(_0x4eb42b,_0x542554){return _0x4eb42b[_0x1afe('0x8')](_0x1afe('0x9'),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 a4f9437..8b3a365 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 _0xe043=['create','contact','FaxInteraction','Contact\x20not\x20found','autoclose','close','*,*,*,*','created','interaction','ContactId','AttachmentId','UserId','User','name','unshift','agent','Start','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','redis','defaults','localhost','./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','findAll','options','where','attributes','limit','include','map','model','GetFaxAccount','stringify','catch','NotifyFaxAccount','body','fax','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','from','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','FaxAccount','find','CmList','Contacts','FaxApplication','List','account','applications','Applications','priority','asc','length'];(function(_0x392d7f,_0x5f38ef){var _0x25ccc2=function(_0x4b7de3){while(--_0x4b7de3){_0x392d7f['push'](_0x392d7f['shift']());}};_0x25ccc2(++_0x5f38ef);}(_0xe043,0x113));var _0x3e04=function(_0x58d568,_0x160d58){_0x58d568=_0x58d568-0x0;var _0x37a056=_0xe043[_0x58d568];return _0x37a056;};'use strict';var _=require(_0x3e04('0x0'));var util=require(_0x3e04('0x1'));var moment=require(_0x3e04('0x2'));var BPromise=require(_0x3e04('0x3'));var rs=require(_0x3e04('0x4'));var fs=require('fs');var Redis=require(_0x3e04('0x5'));var db=require(_0x3e04('0x6'))['db'];var utils=require(_0x3e04('0x7'));var logger=require('../../config/logger')(_0x3e04('0x8'));var config=require('../../config/environment');var jayson=require(_0x3e04('0x9'));var client=jayson['client'][_0x3e04('0xa')]({'port':0x232c});config[_0x3e04('0xb')]=_[_0x3e04('0xc')](config['redis'],{'host':_0x3e04('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3e04('0xb')]));require(_0x3e04('0xe'))[_0x3e04('0xf')](socket);function respondWithRpcPromise(_0x590742,_0x8bfb4e,_0x50daac){return new BPromise(function(_0x5e959a,_0x5bc036){return client[_0x3e04('0x10')](_0x590742,_0x50daac)[_0x3e04('0x11')](function(_0xa0c9f2){logger[_0x3e04('0x12')](_0x3e04('0x13'),_0x8bfb4e,_0x3e04('0x14'));logger[_0x3e04('0x15')](_0x3e04('0x16'),_0x8bfb4e,_0x3e04('0x14'),JSON['stringify'](_0xa0c9f2));if(_0xa0c9f2[_0x3e04('0x17')]){if(_0xa0c9f2[_0x3e04('0x17')][_0x3e04('0x18')]===0x1f4){logger[_0x3e04('0x17')](_0x3e04('0x13'),_0x8bfb4e,_0xa0c9f2['error']['message']);return _0x5bc036(_0xa0c9f2[_0x3e04('0x17')][_0x3e04('0x19')]);}logger[_0x3e04('0x17')](_0x3e04('0x13'),_0x8bfb4e,_0xa0c9f2[_0x3e04('0x17')]['message']);return _0x5e959a(_0xa0c9f2[_0x3e04('0x17')][_0x3e04('0x19')]);}else{logger[_0x3e04('0x12')](_0x3e04('0x13'),_0x8bfb4e,_0x3e04('0x14'));_0x5e959a(_0xa0c9f2[_0x3e04('0x1a')][_0x3e04('0x19')]);}})['catch'](function(_0x5b2054){logger[_0x3e04('0x17')](_0x3e04('0x13'),_0x8bfb4e,_0x5b2054);_0x5bc036(_0x5b2054);});});}exports['GetFaxAccount']=function(_0x9d9f9b){var _0x4be97f=this;return new Promise(function(_0x629853,_0x5e0b3a){return db['FaxAccount'][_0x3e04('0x1b')]({'raw':_0x9d9f9b[_0x3e04('0x1c')]?_0x9d9f9b[_0x3e04('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x9d9f9b[_0x3e04('0x1c')]?_0x9d9f9b['options'][_0x3e04('0x1d')]||null:null,'attributes':_0x9d9f9b[_0x3e04('0x1c')]?_0x9d9f9b[_0x3e04('0x1c')][_0x3e04('0x1e')]||null:null,'limit':_0x9d9f9b['options']?_0x9d9f9b[_0x3e04('0x1c')][_0x3e04('0x1f')]||null:null,'include':_0x9d9f9b[_0x3e04('0x1c')]?_0x9d9f9b[_0x3e04('0x1c')][_0x3e04('0x20')]?_[_0x3e04('0x21')](_0x9d9f9b['options'][_0x3e04('0x20')],function(_0x2b44b4){return{'model':db[_0x2b44b4[_0x3e04('0x22')]],'as':_0x2b44b4['as'],'attributes':_0x2b44b4[_0x3e04('0x1e')],'include':_0x2b44b4['include']?_[_0x3e04('0x21')](_0x2b44b4[_0x3e04('0x20')],function(_0xc5c8e0){return{'model':db[_0xc5c8e0['model']],'as':_0xc5c8e0['as'],'attributes':_0xc5c8e0['attributes'],'include':_0xc5c8e0[_0x3e04('0x20')]?_[_0x3e04('0x21')](_0xc5c8e0[_0x3e04('0x20')],function(_0x27946a){return{'model':db[_0x27946a['model']],'as':_0x27946a['as'],'attributes':_0x27946a[_0x3e04('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x3e04('0x11')](function(_0x78983c){logger[_0x3e04('0x12')](_0x3e04('0x23'),_0x9d9f9b);logger[_0x3e04('0x15')](_0x3e04('0x23'),_0x9d9f9b,JSON[_0x3e04('0x24')](_0x78983c));_0x629853(_0x78983c);})[_0x3e04('0x25')](function(_0x41744){logger[_0x3e04('0x17')](_0x3e04('0x23'),_0x41744[_0x3e04('0x19')],_0x9d9f9b);_0x5e0b3a(_0x4be97f['error'](0x1f4,_0x41744['message']));});});};exports[_0x3e04('0x26')]=function(_0x8853af,_0x5aff19,_0x18c58e){var _0x5d5cab=this;return new Promise(function(_0x5c5f6d,_0x44ad37){var _0x26d118={'body':_0x8853af[_0x3e04('0x27')],'channel':_0x3e04('0x28')};var _0x3db1af=[];var _0x1753aa=[];var _0x5ef7f0={};return db[_0x3e04('0x29')][_0x3e04('0x2a')]()[_0x3e04('0x11')](function(_0x3b89cf){if(!_0x3b89cf){throw new db[(_0x3e04('0x2b'))][(_0x3e04('0x2c'))](_0x3e04('0x2d'));}_0x3db1af=_[_0x3e04('0x2e')](_['keys'](_0x3b89cf),['createdAt',_0x3e04('0x2f')]);_0x1753aa=_[_0x3e04('0x2e')](_['keys'](_0x3b89cf),[_0x3e04('0x30'),_0x3e04('0x2f'),_0x3e04('0x31'),_0x3e04('0x32')]);if(_0x8853af[_0x3e04('0x27')]['id']){delete _0x8853af[_0x3e04('0x27')]['id'];}if(_['isNil'](_0x8853af[_0x3e04('0x27')][_0x3e04('0x33')])){throw new db[(_0x3e04('0x2b'))][(_0x3e04('0x2c'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x8853af['body'][_0x3e04('0x27')])||_0x8853af[_0x3e04('0x27')]['body']===''){throw new db[(_0x3e04('0x2b'))][(_0x3e04('0x2c'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x3e04('0x34')](_0x8853af[_0x3e04('0x27')][_0x3e04('0x35')])){throw new db['Sequelize'][(_0x3e04('0x2c'))](_0x3e04('0x36')+_0x1753aa);}if(!_[_0x3e04('0x37')](_0x1753aa,_0x8853af[_0x3e04('0x27')][_0x3e04('0x35')])){throw new db[(_0x3e04('0x2b'))][(_0x3e04('0x2c'))](_0x3e04('0x38')+_0x1753aa);}_0x5ef7f0[_0x8853af[_0x3e04('0x27')]['mapKey']]=_0x8853af[_0x3e04('0x27')]['from'];})[_0x3e04('0x11')](function(){return db[_0x3e04('0x39')][_0x3e04('0x3a')]({'where':{'id':_0x8853af['account']['id']},'include':[{'model':db[_0x3e04('0x3b')],'as':'List','include':[{'model':db[_0x3e04('0x29')],'as':_0x3e04('0x3c'),'where':_0x5ef7f0,'limit':0x1,'order':[[_0x3e04('0x2f'),'DESC']]}]},{'model':db[_0x3e04('0x3d')],'as':'Applications'}]});})[_0x3e04('0x11')](function(_0xec3ea5){if(_0xec3ea5&&_0xec3ea5[_0x3e04('0x3e')]){var _0x6b38fe=_0xec3ea5['get']({'plain':!![]});_0x26d118[_0x3e04('0x3f')]=_0x6b38fe;_0x26d118[_0x3e04('0x40')]=_0x6b38fe[_0x3e04('0x41')];_0x26d118['list']=_0x6b38fe[_0x3e04('0x3e')];_0x26d118['applications']=_['orderBy'](_0x26d118['applications'],[_0x3e04('0x42')],[_0x3e04('0x43')]);if(_0x26d118[_0x3e04('0x3f')]['Applications']){delete _0x26d118[_0x3e04('0x3f')][_0x3e04('0x41')];}if(_0x26d118[_0x3e04('0x3f')]['List']&&_0x26d118[_0x3e04('0x3f')][_0x3e04('0x3e')][_0x3e04('0x3c')][_0x3e04('0x44')]){return _0x26d118[_0x3e04('0x3f')]['List'][_0x3e04('0x3c')][0x0];}var _0x3e654d=_[_0x3e04('0xc')](_0x8853af['body'],{'firstName':_0x8853af[_0x3e04('0x27')][_0x3e04('0x33')],'ListId':_0x6b38fe[_0x3e04('0x32')]});_0x3e654d[_0x8853af[_0x3e04('0x27')][_0x3e04('0x35')]]=_0x8853af['body'][_0x3e04('0x33')];return db[_0x3e04('0x29')][_0x3e04('0x45')](_0x3e654d,{'fields':_0x3db1af,'raw':!![]});}})[_0x3e04('0x11')](function(_0x44386b){_0x26d118[_0x3e04('0x46')]=_0x44386b;if(_0x44386b){var _0x434cb7={'ContactId':_0x44386b['id'],'FaxAccountId':_0x8853af['account']['id'],'fax':_0x44386b[_0x3e04('0x28')]};return db[_0x3e04('0x47')][_0x3e04('0x3a')]({'where':{'ContactId':_0x44386b['id'],'closed':![],'FaxAccountId':_0x8853af['account']['id']}})['then'](function(_0x3c311b){if(_0x3c311b){return[_0x3c311b,![]];}return db[_0x3e04('0x47')][_0x3e04('0x45')](_0x434cb7)[_0x3e04('0x11')](function(_0x6187ef){return[_0x6187ef,!![]];});});}else{throw new Error(_0x3e04('0x48'));}})['spread'](function(_0x1ad566,_0x506aa){var _0x563aee=_0x1ad566['get']({'plain':!![]});if(_0x506aa){if(_0x26d118[_0x3e04('0x3f')][_0x3e04('0x49')]){_0x26d118[_0x3e04('0x40')]['push']({'id':0x0,'priority':_0x26d118[_0x3e04('0x40')]['length']+0x1,'app':_0x3e04('0x4a'),'appdata':'unmanaged','interval':_0x3e04('0x4b')});}_0x563aee[_0x3e04('0x4c')]=!![];}else{_0x563aee['created']=![];}_0x26d118[_0x3e04('0x4d')]=_0x563aee;return db['FaxMessage'][_0x3e04('0x45')]({'body':_0x8853af[_0x3e04('0x27')][_0x3e04('0x27')],'FaxAccountId':_0x8853af[_0x3e04('0x3f')]['id'],'FaxInteractionId':_0x1ad566['id'],'direction':'in','ContactId':_0x1ad566[_0x3e04('0x4e')],'AttachmentId':_0x8853af['body'][_0x3e04('0x4f')]});})[_0x3e04('0x11')](function(_0x54e08c){_0x26d118['message']=_0x54e08c;if(_0x26d118[_0x3e04('0x4d')][_0x3e04('0x50')]){return db[_0x3e04('0x51')][_0x3e04('0x3a')]({'attributes':['id',_0x3e04('0x52')],'where':{'id':_0x26d118[_0x3e04('0x4d')][_0x3e04('0x50')]}})[_0x3e04('0x11')](function(_0x3ed761){if(_0x3ed761){_0x26d118[_0x3e04('0x40')][_0x3e04('0x53')]({'id':0x0,'priority':0x0,'app':_0x3e04('0x54'),'appdata':_0x3ed761['name']+','+(_0x26d118[_0x3e04('0x3f')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x3e04('0x55'),'startRouting',_0x26d118);});}return respondWithRpcPromise(_0x3e04('0x55'),'startRouting',_0x26d118);})[_0x3e04('0x11')](function(_0x4b118e){_0x5c5f6d(_0x4b118e);})['catch'](function(_0x32e8e5){_0x44ad37(_0x5d5cab[_0x3e04('0x17')](0x1f4,_0x32e8e5[_0x3e04('0x19')]));});});}; \ No newline at end of file +var _0xc557=['FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetFaxAccount','FaxAccount','findAll','options','raw','where','attributes','limit','include','map','model','NotifyFaxAccount','body','fax','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','CompanyId','ListId','from','isNil','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','Contacts','updatedAt','DESC','FaxApplication','Applications','get','applications','list','orderBy','priority','create','contact','FaxInteraction','find','Contact\x20not\x20found','autoclose','push','length','close','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','User','name','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','./faxAccount.socket','register','then','info','FaxAccount,\x20%s,\x20%s','debug'];(function(_0x47c0da,_0x114bbc){var _0x31bb8d=function(_0x359241){while(--_0x359241){_0x47c0da['push'](_0x47c0da['shift']());}};_0x31bb8d(++_0x114bbc);}(_0xc557,0xa7));var _0x7c55=function(_0x36153d,_0x4fed67){_0x36153d=_0x36153d-0x0;var _0xfdacff=_0xc557[_0x36153d];return _0xfdacff;};'use strict';var _=require(_0x7c55('0x0'));var util=require(_0x7c55('0x1'));var moment=require(_0x7c55('0x2'));var BPromise=require(_0x7c55('0x3'));var rs=require(_0x7c55('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7c55('0x5'))['db'];var utils=require(_0x7c55('0x6'));var logger=require(_0x7c55('0x7'))(_0x7c55('0x8'));var config=require(_0x7c55('0x9'));var jayson=require(_0x7c55('0xa'));var client=jayson['client'][_0x7c55('0xb')]({'port':0x232c});config['redis']=_[_0x7c55('0xc')](config[_0x7c55('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x7c55('0xe'))(new Redis(config[_0x7c55('0xd')]));require(_0x7c55('0xf'))[_0x7c55('0x10')](socket);function respondWithRpcPromise(_0x105786,_0x4c70ff,_0x321206){return new BPromise(function(_0x2b0924,_0x298f5c){return client['request'](_0x105786,_0x321206)[_0x7c55('0x11')](function(_0x372561){logger[_0x7c55('0x12')](_0x7c55('0x13'),_0x4c70ff,'request\x20sent');logger[_0x7c55('0x14')](_0x7c55('0x15'),_0x4c70ff,_0x7c55('0x16'),JSON[_0x7c55('0x17')](_0x372561));if(_0x372561[_0x7c55('0x18')]){if(_0x372561['error'][_0x7c55('0x19')]===0x1f4){logger['error'](_0x7c55('0x13'),_0x4c70ff,_0x372561[_0x7c55('0x18')][_0x7c55('0x1a')]);return _0x298f5c(_0x372561[_0x7c55('0x18')][_0x7c55('0x1a')]);}logger[_0x7c55('0x18')]('FaxAccount,\x20%s,\x20%s',_0x4c70ff,_0x372561[_0x7c55('0x18')][_0x7c55('0x1a')]);return _0x2b0924(_0x372561['error'][_0x7c55('0x1a')]);}else{logger[_0x7c55('0x12')](_0x7c55('0x13'),_0x4c70ff,_0x7c55('0x16'));_0x2b0924(_0x372561[_0x7c55('0x1b')][_0x7c55('0x1a')]);}})[_0x7c55('0x1c')](function(_0x2089f5){logger[_0x7c55('0x18')]('FaxAccount,\x20%s,\x20%s',_0x4c70ff,_0x2089f5);_0x298f5c(_0x2089f5);});});}exports[_0x7c55('0x1d')]=function(_0xb7501c){var _0x34068e=this;return new Promise(function(_0x29064d,_0x4b21d3){return db[_0x7c55('0x1e')][_0x7c55('0x1f')]({'raw':_0xb7501c[_0x7c55('0x20')]?_0xb7501c[_0x7c55('0x20')][_0x7c55('0x21')]===undefined?!![]:![]:!![],'where':_0xb7501c[_0x7c55('0x20')]?_0xb7501c[_0x7c55('0x20')][_0x7c55('0x22')]||null:null,'attributes':_0xb7501c[_0x7c55('0x20')]?_0xb7501c[_0x7c55('0x20')][_0x7c55('0x23')]||null:null,'limit':_0xb7501c[_0x7c55('0x20')]?_0xb7501c['options'][_0x7c55('0x24')]||null:null,'include':_0xb7501c[_0x7c55('0x20')]?_0xb7501c[_0x7c55('0x20')][_0x7c55('0x25')]?_[_0x7c55('0x26')](_0xb7501c[_0x7c55('0x20')][_0x7c55('0x25')],function(_0x250d76){return{'model':db[_0x250d76['model']],'as':_0x250d76['as'],'attributes':_0x250d76[_0x7c55('0x23')],'include':_0x250d76[_0x7c55('0x25')]?_['map'](_0x250d76['include'],function(_0x2c3e8e){return{'model':db[_0x2c3e8e[_0x7c55('0x27')]],'as':_0x2c3e8e['as'],'attributes':_0x2c3e8e[_0x7c55('0x23')],'include':_0x2c3e8e['include']?_['map'](_0x2c3e8e[_0x7c55('0x25')],function(_0x59a623){return{'model':db[_0x59a623['model']],'as':_0x59a623['as'],'attributes':_0x59a623['attributes']};}):[]};}):[]};}):[]:[]})[_0x7c55('0x11')](function(_0x1e6579){logger[_0x7c55('0x12')](_0x7c55('0x1d'),_0xb7501c);logger['debug']('GetFaxAccount',_0xb7501c,JSON[_0x7c55('0x17')](_0x1e6579));_0x29064d(_0x1e6579);})[_0x7c55('0x1c')](function(_0x3da917){logger[_0x7c55('0x18')]('GetFaxAccount',_0x3da917[_0x7c55('0x1a')],_0xb7501c);_0x4b21d3(_0x34068e[_0x7c55('0x18')](0x1f4,_0x3da917[_0x7c55('0x1a')]));});});};exports[_0x7c55('0x28')]=function(_0x14368f,_0x11ea7a,_0x44c675){var _0x75ad6=this;return new Promise(function(_0x66525c,_0x486f20){var _0x239af0={'body':_0x14368f[_0x7c55('0x29')],'channel':_0x7c55('0x2a')};var _0x1a0b8d=[];var _0x1904c7=[];var _0x313e48={};return db[_0x7c55('0x2b')][_0x7c55('0x2c')]()[_0x7c55('0x11')](function(_0x2d184d){if(!_0x2d184d){throw new db[(_0x7c55('0x2d'))][(_0x7c55('0x2e'))](_0x7c55('0x2f'));}_0x1a0b8d=_[_0x7c55('0x30')](_['keys'](_0x2d184d),['createdAt','updatedAt']);_0x1904c7=_[_0x7c55('0x30')](_[_0x7c55('0x31')](_0x2d184d),[_0x7c55('0x32'),'updatedAt',_0x7c55('0x33'),_0x7c55('0x34')]);if(_0x14368f[_0x7c55('0x29')]['id']){delete _0x14368f[_0x7c55('0x29')]['id'];}if(_['isNil'](_0x14368f[_0x7c55('0x29')][_0x7c55('0x35')])){throw new db[(_0x7c55('0x2d'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0x7c55('0x36')](_0x14368f[_0x7c55('0x29')][_0x7c55('0x29')])||_0x14368f['body'][_0x7c55('0x29')]===''){throw new db['Sequelize'][(_0x7c55('0x2e'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x7c55('0x36')](_0x14368f[_0x7c55('0x29')][_0x7c55('0x37')])){throw new db[(_0x7c55('0x2d'))][(_0x7c55('0x2e'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1904c7);}if(!_[_0x7c55('0x38')](_0x1904c7,_0x14368f[_0x7c55('0x29')][_0x7c55('0x37')])){throw new db[(_0x7c55('0x2d'))][(_0x7c55('0x2e'))](_0x7c55('0x39')+_0x1904c7);}_0x313e48[_0x14368f[_0x7c55('0x29')][_0x7c55('0x37')]]=_0x14368f[_0x7c55('0x29')][_0x7c55('0x35')];})[_0x7c55('0x11')](function(){return db['FaxAccount']['find']({'where':{'id':_0x14368f[_0x7c55('0x3a')]['id']},'include':[{'model':db[_0x7c55('0x3b')],'as':_0x7c55('0x3c'),'include':[{'model':db[_0x7c55('0x2b')],'as':_0x7c55('0x3d'),'where':_0x313e48,'limit':0x1,'order':[[_0x7c55('0x3e'),_0x7c55('0x3f')]]}]},{'model':db[_0x7c55('0x40')],'as':_0x7c55('0x41')}]});})[_0x7c55('0x11')](function(_0xde7367){if(_0xde7367&&_0xde7367['List']){var _0x4bf1c5=_0xde7367[_0x7c55('0x42')]({'plain':!![]});_0x239af0['account']=_0x4bf1c5;_0x239af0[_0x7c55('0x43')]=_0x4bf1c5[_0x7c55('0x41')];_0x239af0[_0x7c55('0x44')]=_0x4bf1c5['List'];_0x239af0[_0x7c55('0x43')]=_[_0x7c55('0x45')](_0x239af0[_0x7c55('0x43')],[_0x7c55('0x46')],['asc']);if(_0x239af0[_0x7c55('0x3a')][_0x7c55('0x41')]){delete _0x239af0[_0x7c55('0x3a')][_0x7c55('0x41')];}if(_0x239af0[_0x7c55('0x3a')][_0x7c55('0x3c')]&&_0x239af0['account']['List'][_0x7c55('0x3d')]['length']){return _0x239af0[_0x7c55('0x3a')][_0x7c55('0x3c')][_0x7c55('0x3d')][0x0];}var _0x3a6408=_[_0x7c55('0xc')](_0x14368f['body'],{'firstName':_0x14368f['body']['from'],'ListId':_0x4bf1c5['ListId']});_0x3a6408[_0x14368f['body'][_0x7c55('0x37')]]=_0x14368f['body'][_0x7c55('0x35')];return db['CmContact'][_0x7c55('0x47')](_0x3a6408,{'fields':_0x1a0b8d,'raw':!![]});}})[_0x7c55('0x11')](function(_0x16b377){_0x239af0[_0x7c55('0x48')]=_0x16b377;if(_0x16b377){var _0x3f19a0={'ContactId':_0x16b377['id'],'FaxAccountId':_0x14368f['account']['id'],'fax':_0x16b377['fax']};return db[_0x7c55('0x49')][_0x7c55('0x4a')]({'where':{'ContactId':_0x16b377['id'],'closed':![],'FaxAccountId':_0x14368f['account']['id']}})[_0x7c55('0x11')](function(_0x47aa2c){if(_0x47aa2c){return[_0x47aa2c,![]];}return db[_0x7c55('0x49')][_0x7c55('0x47')](_0x3f19a0)['then'](function(_0x1584e0){return[_0x1584e0,!![]];});});}else{throw new Error(_0x7c55('0x4b'));}})['spread'](function(_0x50056a,_0x2d4681){var _0x4c8ad5=_0x50056a[_0x7c55('0x42')]({'plain':!![]});if(_0x2d4681){if(_0x239af0[_0x7c55('0x3a')][_0x7c55('0x4c')]){_0x239af0['applications'][_0x7c55('0x4d')]({'id':0x0,'priority':_0x239af0['applications'][_0x7c55('0x4e')]+0x1,'app':_0x7c55('0x4f'),'appdata':'unmanaged','interval':_0x7c55('0x50')});}_0x4c8ad5[_0x7c55('0x51')]=!![];}else{_0x4c8ad5[_0x7c55('0x51')]=![];}_0x239af0[_0x7c55('0x52')]=_0x4c8ad5;return db[_0x7c55('0x53')]['create']({'body':_0x14368f[_0x7c55('0x29')][_0x7c55('0x29')],'FaxAccountId':_0x14368f[_0x7c55('0x3a')]['id'],'FaxInteractionId':_0x50056a['id'],'direction':'in','ContactId':_0x50056a[_0x7c55('0x54')],'AttachmentId':_0x14368f[_0x7c55('0x29')][_0x7c55('0x55')]});})['then'](function(_0x32d5d9){_0x239af0['message']=_0x32d5d9;if(_0x239af0['interaction']['UserId']){return db[_0x7c55('0x56')]['find']({'attributes':['id',_0x7c55('0x57')],'where':{'id':_0x239af0['interaction'][_0x7c55('0x58')]}})[_0x7c55('0x11')](function(_0x4e7d56){if(_0x4e7d56){_0x239af0[_0x7c55('0x43')][_0x7c55('0x59')]({'id':0x0,'priority':0x0,'app':_0x7c55('0x5a'),'appdata':_0x4e7d56[_0x7c55('0x57')]+','+(_0x239af0[_0x7c55('0x3a')][_0x7c55('0x5b')]||0xa),'interval':_0x7c55('0x50')});}return respondWithRpcPromise(_0x7c55('0x5c'),_0x7c55('0x5d'),_0x239af0);});}return respondWithRpcPromise(_0x7c55('0x5c'),_0x7c55('0x5d'),_0x239af0);})[_0x7c55('0x11')](function(_0x41e6f3){_0x66525c(_0x41e6f3);})[_0x7c55('0x1c')](function(_0x250993){_0x486f20(_0x75ad6[_0x7c55('0x18')](0x1f4,_0x250993[_0x7c55('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 536ee58..48c1eaa 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 _0xd943=['save','remove','update','emit','./faxAccount.events'];(function(_0x4b736c,_0x18d185){var _0x236b90=function(_0xd4590){while(--_0xd4590){_0x4b736c['push'](_0x4b736c['shift']());}};_0x236b90(++_0x18d185);}(_0xd943,0x15d));var _0x3d94=function(_0x3f4909,_0x5508d5){_0x3f4909=_0x3f4909-0x0;var _0x44ca0e=_0xd943[_0x3f4909];return _0x44ca0e;};'use strict';var FaxAccountEvents=require(_0x3d94('0x0'));var events=[_0x3d94('0x1'),_0x3d94('0x2'),_0x3d94('0x3')];function createListener(_0x5495df,_0x691e28){return function(_0x3edd1b){_0x691e28[_0x3d94('0x4')](_0x5495df,_0x3edd1b);};}function removeListener(_0xc13b61,_0xaf8962){return function(){FaxAccountEvents['removeListener'](_0xc13b61,_0xaf8962);};}exports['register']=function(_0x34c9c3){for(var _0x51cf1f=0x0,_0x54e81f=events['length'];_0x51cf1f<_0x54e81f;_0x51cf1f++){var _0x20f4d1=events[_0x51cf1f];var _0x35d36a=createListener('faxAccount:'+_0x20f4d1,_0x34c9c3);FaxAccountEvents['on'](_0x20f4d1,_0x35d36a);}}; \ No newline at end of file +var _0x4c60=['faxAccount:','./faxAccount.events','save','remove','update','removeListener','register','length'];(function(_0x438fcb,_0x5b1372){var _0x278a74=function(_0x3c27d5){while(--_0x3c27d5){_0x438fcb['push'](_0x438fcb['shift']());}};_0x278a74(++_0x5b1372);}(_0x4c60,0xc1));var _0x04c6=function(_0x4cc4f8,_0x5c7f8e){_0x4cc4f8=_0x4cc4f8-0x0;var _0x3fcbbf=_0x4c60[_0x4cc4f8];return _0x3fcbbf;};'use strict';var FaxAccountEvents=require(_0x04c6('0x0'));var events=[_0x04c6('0x1'),_0x04c6('0x2'),_0x04c6('0x3')];function createListener(_0x5ba768,_0x2a1d36){return function(_0x5d9fa3){_0x2a1d36['emit'](_0x5ba768,_0x5d9fa3);};}function removeListener(_0x4ad4f1,_0x53ca7a){return function(){FaxAccountEvents[_0x04c6('0x4')](_0x4ad4f1,_0x53ca7a);};}exports[_0x04c6('0x5')]=function(_0x2054da){for(var _0x12bd5d=0x0,_0x2b9041=events[_0x04c6('0x6')];_0x12bd5d<_0x2b9041;_0x12bd5d++){var _0x8f9b13=events[_0x12bd5d];var _0x530a48=createListener(_0x04c6('0x7')+_0x8f9b13,_0x2054da);FaxAccountEvents['on'](_0x8f9b13,_0x530a48);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index c74ac34..2dd4c56 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 _0x1861=['/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/messages','getMessages','/:id/users','post','create','/:id/dispositions','addDisposition','/:id/interactions','/addaccountapplications','/:id/send','send','addAgents','put','update','delete','destroy','removeDispositions','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','getDispositions'];(function(_0x28f262,_0x1deed7){var _0x372913=function(_0xcad5a0){while(--_0xcad5a0){_0x28f262['push'](_0x28f262['shift']());}};_0x372913(++_0x1deed7);}(_0x1861,0x8b));var _0x1186=function(_0x23cd8b,_0x314a93){_0x23cd8b=_0x23cd8b-0x0;var _0x574c66=_0x1861[_0x23cd8b];return _0x574c66;};'use strict';var multer=require(_0x1186('0x0'));var util=require(_0x1186('0x1'));var path=require(_0x1186('0x2'));var timeout=require(_0x1186('0x3'));var express=require(_0x1186('0x4'));var router=express[_0x1186('0x5')]();var auth=require(_0x1186('0x6'));var interaction=require(_0x1186('0x7'));var config=require(_0x1186('0x8'));var controller=require('./faxAccount.controller');router[_0x1186('0x9')]('/',auth[_0x1186('0xa')](),controller[_0x1186('0xb')]);router[_0x1186('0x9')](_0x1186('0xc'),auth[_0x1186('0xa')](),controller[_0x1186('0xd')]);router[_0x1186('0x9')](_0x1186('0xe'),auth[_0x1186('0xa')](),controller[_0x1186('0xf')]);router[_0x1186('0x9')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x1186('0x10')]);router['get'](_0x1186('0x11'),auth[_0x1186('0xa')](),controller[_0x1186('0x12')]);router[_0x1186('0x9')]('/:id/interactions',auth['isAuthenticated'](),controller['getInteractions']);router[_0x1186('0x9')](_0x1186('0x13'),auth[_0x1186('0xa')](),controller[_0x1186('0x14')]);router[_0x1186('0x9')](_0x1186('0x15'),auth['isAuthenticated'](),controller[_0x1186('0x16')]);router[_0x1186('0x9')](_0x1186('0x17'),auth[_0x1186('0xa')](),controller['getAgents']);router[_0x1186('0x18')]('/',auth[_0x1186('0xa')](),controller[_0x1186('0x19')]);router['post'](_0x1186('0x1a'),auth[_0x1186('0xa')](),controller[_0x1186('0x1b')]);router['post'](_0x1186('0x11'),auth['isAuthenticated'](),controller['addAnswer']);router[_0x1186('0x18')](_0x1186('0x1c'),auth[_0x1186('0xa')](),controller['addInteraction']);router[_0x1186('0x18')](_0x1186('0x13'),auth[_0x1186('0xa')](),controller['addApplications']);router[_0x1186('0x18')](_0x1186('0x1d'),auth[_0x1186('0xa')](),controller['addAccountApplications']);router[_0x1186('0x18')]('/updateaccountapplications',auth[_0x1186('0xa')](),controller['updateAccountApplications']);router[_0x1186('0x18')](_0x1186('0x1e'),auth[_0x1186('0xa')](),controller[_0x1186('0x1f')]);router[_0x1186('0x18')](_0x1186('0x17'),auth[_0x1186('0xa')](),controller[_0x1186('0x20')]);router[_0x1186('0x21')]('/:id',auth[_0x1186('0xa')](),controller[_0x1186('0x22')]);router[_0x1186('0x23')](_0x1186('0xe'),auth['isAuthenticated'](),controller[_0x1186('0x24')]);router[_0x1186('0x23')](_0x1186('0x1a'),auth[_0x1186('0xa')](),controller[_0x1186('0x25')]);router[_0x1186('0x23')](_0x1186('0x11'),auth[_0x1186('0xa')](),controller['removeAnswers']);router[_0x1186('0x23')](_0x1186('0x17'),auth[_0x1186('0xa')](),controller[_0x1186('0x26')]);module['exports']=router; \ No newline at end of file +var _0x6079=['connect-timeout','express','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','isAuthenticated','index','/describe','/:id','/:id/interactions','getInteractions','/:id/applications','getApplications','getMessages','getAgents','post','create','/:id/dispositions','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','/addaccountapplications','addAccountApplications','/updateaccountapplications','updateAccountApplications','/:id/send','/:id/users','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x5ad85c,_0x31702d){var _0x4d1d3c=function(_0x38bce7){while(--_0x38bce7){_0x5ad85c['push'](_0x5ad85c['shift']());}};_0x4d1d3c(++_0x31702d);}(_0x6079,0xcf));var _0x9607=function(_0x2df724,_0x411382){_0x2df724=_0x2df724-0x0;var _0x1b2504=_0x6079[_0x2df724];return _0x1b2504;};'use strict';var multer=require(_0x9607('0x0'));var util=require(_0x9607('0x1'));var path=require(_0x9607('0x2'));var timeout=require(_0x9607('0x3'));var express=require(_0x9607('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x9607('0x5'));var config=require(_0x9607('0x6'));var controller=require(_0x9607('0x7'));router[_0x9607('0x8')]('/',auth[_0x9607('0x9')](),controller[_0x9607('0xa')]);router[_0x9607('0x8')](_0x9607('0xb'),auth[_0x9607('0x9')](),controller['describe']);router[_0x9607('0x8')](_0x9607('0xc'),auth[_0x9607('0x9')](),controller['show']);router[_0x9607('0x8')]('/:id/dispositions',auth[_0x9607('0x9')](),controller['getDispositions']);router['get']('/:id/canned_answers',auth[_0x9607('0x9')](),controller['getAnswers']);router[_0x9607('0x8')](_0x9607('0xd'),auth[_0x9607('0x9')](),controller[_0x9607('0xe')]);router[_0x9607('0x8')](_0x9607('0xf'),auth[_0x9607('0x9')](),controller[_0x9607('0x10')]);router[_0x9607('0x8')]('/:id/messages',auth[_0x9607('0x9')](),controller[_0x9607('0x11')]);router[_0x9607('0x8')]('/:id/users',auth[_0x9607('0x9')](),controller[_0x9607('0x12')]);router[_0x9607('0x13')]('/',auth[_0x9607('0x9')](),controller[_0x9607('0x14')]);router[_0x9607('0x13')](_0x9607('0x15'),auth[_0x9607('0x9')](),controller[_0x9607('0x16')]);router[_0x9607('0x13')](_0x9607('0x17'),auth['isAuthenticated'](),controller[_0x9607('0x18')]);router[_0x9607('0x13')](_0x9607('0xd'),auth['isAuthenticated'](),controller[_0x9607('0x19')]);router[_0x9607('0x13')](_0x9607('0xf'),auth[_0x9607('0x9')](),controller[_0x9607('0x1a')]);router['post'](_0x9607('0x1b'),auth[_0x9607('0x9')](),controller[_0x9607('0x1c')]);router[_0x9607('0x13')](_0x9607('0x1d'),auth['isAuthenticated'](),controller[_0x9607('0x1e')]);router['post'](_0x9607('0x1f'),auth[_0x9607('0x9')](),controller['send']);router['post'](_0x9607('0x20'),auth[_0x9607('0x9')](),controller[_0x9607('0x21')]);router[_0x9607('0x22')](_0x9607('0xc'),auth[_0x9607('0x9')](),controller[_0x9607('0x23')]);router[_0x9607('0x24')](_0x9607('0xc'),auth[_0x9607('0x9')](),controller[_0x9607('0x25')]);router[_0x9607('0x24')](_0x9607('0x15'),auth[_0x9607('0x9')](),controller[_0x9607('0x26')]);router['delete'](_0x9607('0x17'),auth['isAuthenticated'](),controller[_0x9607('0x27')]);router[_0x9607('0x24')]('/:id/users',auth[_0x9607('0x9')](),controller[_0x9607('0x28')]);module[_0x9607('0x29')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index 5e9eccc..1c72e9d 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 _0x72e4=['sequelize','exports','INTEGER','STRING','TEXT','*,*,*,*'];(function(_0xf2bd50,_0x52b123){var _0x3bbf30=function(_0x189a04){while(--_0x189a04){_0xf2bd50['push'](_0xf2bd50['shift']());}};_0x3bbf30(++_0x52b123);}(_0x72e4,0xae));var _0x472e=function(_0x2ad657,_0x17d9fe){_0x2ad657=_0x2ad657-0x0;var _0x5a907a=_0x72e4[_0x2ad657];return _0x5a907a;};'use strict';var Sequelize=require(_0x472e('0x0'));module[_0x472e('0x1')]={'priority':{'type':Sequelize[_0x472e('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x472e('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x472e('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x472e('0x5')}}; \ No newline at end of file +var _0x6e9b=['sequelize','exports','INTEGER','STRING','noop','*,*,*,*'];(function(_0x2d8ba1,_0x330248){var _0x272547=function(_0x139c72){while(--_0x139c72){_0x2d8ba1['push'](_0x2d8ba1['shift']());}};_0x272547(++_0x330248);}(_0x6e9b,0xea));var _0xb6e9=function(_0x374d91,_0xd44ee0){_0x374d91=_0x374d91-0x0;var _0x3e9262=_0x6e9b[_0x374d91];return _0x3e9262;};'use strict';var Sequelize=require(_0xb6e9('0x0'));module[_0xb6e9('0x1')]={'priority':{'type':Sequelize[_0xb6e9('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xb6e9('0x3')],'allowNull':![],'defaultValue':_0xb6e9('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xb6e9('0x3')]},'interval':{'type':Sequelize[_0xb6e9('0x3')],'defaultValue':_0xb6e9('0x5')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 6980467..97d667f 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 _0x57fc=['length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','find','then','create','catch','body','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','reject','save','destroy','error','stack','name','send','index','map','FaxApplication','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields'];(function(_0x48c228,_0x34b40c){var _0x2999db=function(_0x2e8af3){while(--_0x2e8af3){_0x48c228['push'](_0x48c228['shift']());}};_0x2999db(++_0x34b40c);}(_0x57fc,0x100));var _0xc57f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x57fc[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require(_0xc57f('0x0'));var emlformat=require(_0xc57f('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xc57f('0x2'));var jsonpatch=require(_0xc57f('0x3'));var rp=require(_0xc57f('0x4'));var moment=require('moment');var BPromise=require(_0xc57f('0x5'));var Mustache=require(_0xc57f('0x6'));var util=require(_0xc57f('0x7'));var path=require(_0xc57f('0x8'));var sox=require(_0xc57f('0x9'));var csv=require('to-csv');var ejs=require(_0xc57f('0xa'));var fs=require('fs');var _=require(_0xc57f('0xb'));var squel=require(_0xc57f('0xc'));var crypto=require(_0xc57f('0xd'));var jsforce=require(_0xc57f('0xe'));var deskjs=require(_0xc57f('0xf'));var toCsv=require(_0xc57f('0x10'));var querystring=require(_0xc57f('0x11'));var Papa=require('papaparse');var Redis=require(_0xc57f('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xc57f('0x13'));var as=require(_0xc57f('0x14'));var hardwareService=require(_0xc57f('0x15'));var logger=require(_0xc57f('0x16'))(_0xc57f('0x17'));var utils=require(_0xc57f('0x18'));var config=require(_0xc57f('0x19'));var db=require(_0xc57f('0x1a'))['db'];function respondWithStatusCode(_0x45098c,_0x5d91ce){_0x5d91ce=_0x5d91ce||0xcc;return function(_0x10c01e){if(_0x10c01e){return _0x45098c[_0xc57f('0x1b')](_0x5d91ce);}return _0x45098c[_0xc57f('0x1c')](_0x5d91ce)[_0xc57f('0x1d')]();};}function respondWithResult(_0x2b6e06,_0x3e9456){_0x3e9456=_0x3e9456||0xc8;return function(_0x4310b8){if(_0x4310b8){return _0x2b6e06[_0xc57f('0x1c')](_0x3e9456)[_0xc57f('0x1e')](_0x4310b8);}};}function respondWithFilteredResult(_0x157a2d,_0x483649){return function(_0x30aa43){if(_0x30aa43){var _0x366029=_0x30aa43[_0xc57f('0x1f')],_0x3e2b99=_0x483649[_0xc57f('0x20')],_0x453940=_0x483649[_0xc57f('0x20')]+_0x483649[_0xc57f('0x21')],_0x2685ed;if(_0x453940>=_0x366029){_0x453940=_0x366029;_0x2685ed=0xc8;}else{_0x2685ed=0xce;}_0x157a2d[_0xc57f('0x1c')](_0x2685ed);return _0x157a2d['set'](_0xc57f('0x22'),_0x3e2b99+'-'+_0x453940+'/'+_0x366029)[_0xc57f('0x1e')](_0x30aa43);}return null;};}function patchUpdates(_0x2d2e4c){return function(_0x369c89){try{jsonpatch['apply'](_0x369c89,_0x2d2e4c,!![]);}catch(_0x12f476){return BPromise[_0xc57f('0x23')](_0x12f476);}return _0x369c89[_0xc57f('0x24')]();};}function saveUpdates(_0x333206,_0x2ef1a8){return function(_0x87b1bb){if(_0x87b1bb){return _0x87b1bb['update'](_0x333206)['then'](function(_0x2532da){return _0x2532da;});}return null;};}function removeEntity(_0x50bec1,_0x2e2cd1){return function(_0x37109c){if(_0x37109c){return _0x37109c[_0xc57f('0x25')]()['then'](function(){_0x50bec1[_0xc57f('0x1c')](0xcc)[_0xc57f('0x1d')]();});}};}function handleEntityNotFound(_0x4cdd68,_0x116a1b){return function(_0x4b3268){if(!_0x4b3268){_0x4cdd68['sendStatus'](0x194);}return _0x4b3268;};}function handleError(_0x53f2c0,_0xb5df40){_0xb5df40=_0xb5df40||0x1f4;return function(_0x179b23){logger[_0xc57f('0x26')](_0x179b23[_0xc57f('0x27')]);if(_0x179b23['name']){delete _0x179b23[_0xc57f('0x28')];}_0x53f2c0[_0xc57f('0x1c')](_0xb5df40)[_0xc57f('0x29')](_0x179b23);};}exports[_0xc57f('0x2a')]=function(_0x14cb79,_0x46743f){var _0x1d53bd={},_0x17f873={},_0x387ecf={'count':0x0,'rows':[]};var _0x111070=_[_0xc57f('0x2b')](db[_0xc57f('0x2c')][_0xc57f('0x2d')],function(_0x4921eb){return{'name':_0x4921eb[_0xc57f('0x2e')],'type':_0x4921eb[_0xc57f('0x2f')][_0xc57f('0x30')]};});_0x17f873[_0xc57f('0x31')]=_[_0xc57f('0x2b')](_0x111070,_0xc57f('0x28'));_0x17f873['query']=_[_0xc57f('0x32')](_0x14cb79['query']);_0x17f873[_0xc57f('0x33')]=_[_0xc57f('0x34')](_0x17f873['model'],_0x17f873[_0xc57f('0x35')]);_0x1d53bd[_0xc57f('0x36')]=_['intersection'](_0x17f873['model'],qs[_0xc57f('0x37')](_0x14cb79[_0xc57f('0x35')]['fields']));_0x1d53bd[_0xc57f('0x36')]=_0x1d53bd[_0xc57f('0x36')][_0xc57f('0x38')]?_0x1d53bd[_0xc57f('0x36')]:_0x17f873['model'];if(!_0x14cb79[_0xc57f('0x35')][_0xc57f('0x39')](_0xc57f('0x3a'))){_0x1d53bd[_0xc57f('0x21')]=qs[_0xc57f('0x21')](_0x14cb79[_0xc57f('0x35')][_0xc57f('0x21')]);_0x1d53bd[_0xc57f('0x20')]=qs[_0xc57f('0x20')](_0x14cb79[_0xc57f('0x35')][_0xc57f('0x20')]);}_0x1d53bd[_0xc57f('0x3b')]=qs[_0xc57f('0x3c')](_0x14cb79[_0xc57f('0x35')][_0xc57f('0x3c')]);_0x1d53bd[_0xc57f('0x3d')]=qs[_0xc57f('0x33')](_[_0xc57f('0x3e')](_0x14cb79[_0xc57f('0x35')],_0x17f873[_0xc57f('0x33')]));if(_0x14cb79['query']['filter']){_0x1d53bd['where']=_[_0xc57f('0x3f')](_0x1d53bd['where'],{'$or':_[_0xc57f('0x2b')](_0x111070,function(_0x1dc03a){if(_0x1dc03a[_0xc57f('0x2f')][_0xc57f('0x30')]!==_0xc57f('0x40')){var _0x1fec83={};_0x1fec83[_0x1dc03a['field']]={'$like':'%'+_0x14cb79[_0xc57f('0x35')][_0xc57f('0x41')]+'%'};return _0x1fec83;}})});}_0x1d53bd=_[_0xc57f('0x3f')]({},_0x1d53bd,_0x14cb79[_0xc57f('0x42')]);var _0x581c9a={'where':_0x1d53bd[_0xc57f('0x3d')]};return db['FaxApplication'][_0xc57f('0x1f')](_0x581c9a)['then'](function(_0x4d799c){_0x387ecf['count']=_0x4d799c;if(_0x14cb79[_0xc57f('0x35')][_0xc57f('0x43')]){_0x1d53bd[_0xc57f('0x44')]=[{'all':!![]}];}return db[_0xc57f('0x2c')][_0xc57f('0x45')](_0x1d53bd);})['then'](function(_0xfd33d4){_0x387ecf[_0xc57f('0x46')]=_0xfd33d4;return _0x387ecf;})['then'](respondWithFilteredResult(_0x46743f,_0x1d53bd))['catch'](handleError(_0x46743f,null));};exports[_0xc57f('0x47')]=function(_0x328d84,_0x42ed6c){var _0x16aeb5={'raw':!![],'where':{'id':_0x328d84[_0xc57f('0x48')]['id']}},_0x4f5af2={};_0x4f5af2[_0xc57f('0x31')]=_['keys'](db['FaxApplication'][_0xc57f('0x2d')]);_0x4f5af2[_0xc57f('0x35')]=_[_0xc57f('0x32')](_0x328d84[_0xc57f('0x35')]);_0x4f5af2['filters']=_['intersection'](_0x4f5af2[_0xc57f('0x31')],_0x4f5af2[_0xc57f('0x35')]);_0x16aeb5[_0xc57f('0x36')]=_['intersection'](_0x4f5af2[_0xc57f('0x31')],qs[_0xc57f('0x37')](_0x328d84['query'][_0xc57f('0x37')]));_0x16aeb5['attributes']=_0x16aeb5[_0xc57f('0x36')]['length']?_0x16aeb5['attributes']:_0x4f5af2[_0xc57f('0x31')];if(_0x328d84[_0xc57f('0x35')][_0xc57f('0x43')]){_0x16aeb5[_0xc57f('0x44')]=[{'all':!![]}];}_0x16aeb5=_['merge']({},_0x16aeb5,_0x328d84[_0xc57f('0x42')]);return db[_0xc57f('0x2c')][_0xc57f('0x49')](_0x16aeb5)['then'](handleEntityNotFound(_0x42ed6c,null))[_0xc57f('0x4a')](respondWithResult(_0x42ed6c,null))['catch'](handleError(_0x42ed6c,null));};exports[_0xc57f('0x4b')]=function(_0xefa0d7,_0x40bdce){return db['FaxApplication'][_0xc57f('0x4b')](_0xefa0d7['body'],{})[_0xc57f('0x4a')](respondWithResult(_0x40bdce,0xc9))[_0xc57f('0x4c')](handleError(_0x40bdce,null));};exports['update']=function(_0x4a9329,_0x1276d4){if(_0x4a9329[_0xc57f('0x4d')]['id']){delete _0x4a9329[_0xc57f('0x4d')]['id'];}return db[_0xc57f('0x2c')]['find']({'where':{'id':_0x4a9329[_0xc57f('0x48')]['id']}})[_0xc57f('0x4a')](handleEntityNotFound(_0x1276d4,null))[_0xc57f('0x4a')](saveUpdates(_0x4a9329[_0xc57f('0x4d')],null))[_0xc57f('0x4a')](respondWithResult(_0x1276d4,null))[_0xc57f('0x4c')](handleError(_0x1276d4,null));};exports[_0xc57f('0x25')]=function(_0x138fd1,_0x161a04){return db['FaxApplication']['find']({'where':{'id':_0x138fd1[_0xc57f('0x48')]['id']}})[_0xc57f('0x4a')](handleEntityNotFound(_0x161a04,null))[_0xc57f('0x4a')](removeEntity(_0x161a04,null))[_0xc57f('0x4c')](handleError(_0x161a04,null));}; \ No newline at end of file +var _0xa5ee=['../../config/license/hardware','../../config/logger','../../config/environment','status','end','json','count','offset','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','send','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','merge','VIRTUAL','field','filter','FaxApplication','include','findAll','rows','catch','params','includeAll','find','create','body','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch'];(function(_0x2df3ba,_0x439e64){var _0x556108=function(_0x458143){while(--_0x458143){_0x2df3ba['push'](_0x2df3ba['shift']());}};_0x556108(++_0x439e64);}(_0xa5ee,0x14f));var _0xea5e=function(_0x384186,_0x12252b){_0x384186=_0x384186-0x0;var _0x3d0592=_0xa5ee[_0x384186];return _0x3d0592;};'use strict';var pdf=require(_0xea5e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xea5e('0x1'));var zipdir=require(_0xea5e('0x2'));var jsonpatch=require(_0xea5e('0x3'));var rp=require(_0xea5e('0x4'));var moment=require(_0xea5e('0x5'));var BPromise=require(_0xea5e('0x6'));var Mustache=require(_0xea5e('0x7'));var util=require(_0xea5e('0x8'));var path=require('path');var sox=require(_0xea5e('0x9'));var csv=require(_0xea5e('0xa'));var ejs=require(_0xea5e('0xb'));var fs=require('fs');var _=require(_0xea5e('0xc'));var squel=require(_0xea5e('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xea5e('0xe'));var toCsv=require(_0xea5e('0xa'));var querystring=require(_0xea5e('0xf'));var Papa=require(_0xea5e('0x10'));var Redis=require(_0xea5e('0x11'));var authService=require(_0xea5e('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xea5e('0x13'));var hardwareService=require(_0xea5e('0x14'));var logger=require(_0xea5e('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xea5e('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3acc97,_0x33c16d){_0x33c16d=_0x33c16d||0xcc;return function(_0x346eee){if(_0x346eee){return _0x3acc97['sendStatus'](_0x33c16d);}return _0x3acc97[_0xea5e('0x17')](_0x33c16d)[_0xea5e('0x18')]();};}function respondWithResult(_0x5e2853,_0x5d99bf){_0x5d99bf=_0x5d99bf||0xc8;return function(_0xf8e6d8){if(_0xf8e6d8){return _0x5e2853[_0xea5e('0x17')](_0x5d99bf)[_0xea5e('0x19')](_0xf8e6d8);}};}function respondWithFilteredResult(_0x4f609b,_0x19aefc){return function(_0x3df447){if(_0x3df447){var _0x56d465=_0x3df447[_0xea5e('0x1a')],_0x41f847=_0x19aefc[_0xea5e('0x1b')],_0x1b4e2c=_0x19aefc['offset']+_0x19aefc['limit'],_0x4e1b0b;if(_0x1b4e2c>=_0x56d465){_0x1b4e2c=_0x56d465;_0x4e1b0b=0xc8;}else{_0x4e1b0b=0xce;}_0x4f609b['status'](_0x4e1b0b);return _0x4f609b[_0xea5e('0x1c')](_0xea5e('0x1d'),_0x41f847+'-'+_0x1b4e2c+'/'+_0x56d465)[_0xea5e('0x19')](_0x3df447);}return null;};}function patchUpdates(_0x59341c){return function(_0x37cb7d){try{jsonpatch['apply'](_0x37cb7d,_0x59341c,!![]);}catch(_0x350ca8){return BPromise[_0xea5e('0x1e')](_0x350ca8);}return _0x37cb7d[_0xea5e('0x1f')]();};}function saveUpdates(_0x28e79a,_0x272f78){return function(_0x1dbf53){if(_0x1dbf53){return _0x1dbf53[_0xea5e('0x20')](_0x28e79a)[_0xea5e('0x21')](function(_0xc8ad90){return _0xc8ad90;});}return null;};}function removeEntity(_0xa98abd,_0x52b19a){return function(_0x14be64){if(_0x14be64){return _0x14be64[_0xea5e('0x22')]()[_0xea5e('0x21')](function(){_0xa98abd[_0xea5e('0x17')](0xcc)[_0xea5e('0x18')]();});}};}function handleEntityNotFound(_0x1c33ed,_0x15ba98){return function(_0x2f0858){if(!_0x2f0858){_0x1c33ed[_0xea5e('0x23')](0x194);}return _0x2f0858;};}function handleError(_0x4ac428,_0x5970e5){_0x5970e5=_0x5970e5||0x1f4;return function(_0x3b09bb){logger[_0xea5e('0x24')](_0x3b09bb['stack']);if(_0x3b09bb['name']){delete _0x3b09bb['name'];}_0x4ac428[_0xea5e('0x17')](_0x5970e5)[_0xea5e('0x25')](_0x3b09bb);};}exports['index']=function(_0x197c33,_0x5b3edc){var _0x277d66={},_0x48be6b={},_0x356964={'count':0x0,'rows':[]};var _0x3028d8=_['map'](db['FaxApplication'][_0xea5e('0x26')],function(_0x17e8b3){return{'name':_0x17e8b3[_0xea5e('0x27')],'type':_0x17e8b3[_0xea5e('0x28')][_0xea5e('0x29')]};});_0x48be6b[_0xea5e('0x2a')]=_[_0xea5e('0x2b')](_0x3028d8,'name');_0x48be6b[_0xea5e('0x2c')]=_[_0xea5e('0x2d')](_0x197c33[_0xea5e('0x2c')]);_0x48be6b[_0xea5e('0x2e')]=_[_0xea5e('0x2f')](_0x48be6b[_0xea5e('0x2a')],_0x48be6b[_0xea5e('0x2c')]);_0x277d66[_0xea5e('0x30')]=_[_0xea5e('0x2f')](_0x48be6b[_0xea5e('0x2a')],qs['fields'](_0x197c33[_0xea5e('0x2c')][_0xea5e('0x31')]));_0x277d66[_0xea5e('0x30')]=_0x277d66[_0xea5e('0x30')][_0xea5e('0x32')]?_0x277d66['attributes']:_0x48be6b[_0xea5e('0x2a')];if(!_0x197c33[_0xea5e('0x2c')][_0xea5e('0x33')](_0xea5e('0x34'))){_0x277d66[_0xea5e('0x35')]=qs[_0xea5e('0x35')](_0x197c33[_0xea5e('0x2c')][_0xea5e('0x35')]);_0x277d66[_0xea5e('0x1b')]=qs['offset'](_0x197c33[_0xea5e('0x2c')][_0xea5e('0x1b')]);}_0x277d66['order']=qs['sort'](_0x197c33['query'][_0xea5e('0x36')]);_0x277d66[_0xea5e('0x37')]=qs[_0xea5e('0x2e')](_[_0xea5e('0x38')](_0x197c33[_0xea5e('0x2c')],_0x48be6b[_0xea5e('0x2e')]));if(_0x197c33['query']['filter']){_0x277d66[_0xea5e('0x37')]=_[_0xea5e('0x39')](_0x277d66[_0xea5e('0x37')],{'$or':_[_0xea5e('0x2b')](_0x3028d8,function(_0x381639){if(_0x381639[_0xea5e('0x28')][_0xea5e('0x29')]!==_0xea5e('0x3a')){var _0x1d84ff={};_0x1d84ff[_0x381639[_0xea5e('0x3b')]]={'$like':'%'+_0x197c33[_0xea5e('0x2c')][_0xea5e('0x3c')]+'%'};return _0x1d84ff;}})});}_0x277d66=_[_0xea5e('0x39')]({},_0x277d66,_0x197c33['options']);var _0x24e479={'where':_0x277d66[_0xea5e('0x37')]};return db[_0xea5e('0x3d')][_0xea5e('0x1a')](_0x24e479)['then'](function(_0x39e3d7){_0x356964[_0xea5e('0x1a')]=_0x39e3d7;if(_0x197c33[_0xea5e('0x2c')]['includeAll']){_0x277d66[_0xea5e('0x3e')]=[{'all':!![]}];}return db[_0xea5e('0x3d')][_0xea5e('0x3f')](_0x277d66);})[_0xea5e('0x21')](function(_0x154917){_0x356964[_0xea5e('0x40')]=_0x154917;return _0x356964;})[_0xea5e('0x21')](respondWithFilteredResult(_0x5b3edc,_0x277d66))[_0xea5e('0x41')](handleError(_0x5b3edc,null));};exports['show']=function(_0x5de74d,_0x2e928f){var _0x4cb672={'raw':!![],'where':{'id':_0x5de74d[_0xea5e('0x42')]['id']}},_0x1a5712={};_0x1a5712[_0xea5e('0x2a')]=_[_0xea5e('0x2d')](db['FaxApplication'][_0xea5e('0x26')]);_0x1a5712[_0xea5e('0x2c')]=_[_0xea5e('0x2d')](_0x5de74d[_0xea5e('0x2c')]);_0x1a5712[_0xea5e('0x2e')]=_[_0xea5e('0x2f')](_0x1a5712[_0xea5e('0x2a')],_0x1a5712['query']);_0x4cb672[_0xea5e('0x30')]=_[_0xea5e('0x2f')](_0x1a5712[_0xea5e('0x2a')],qs[_0xea5e('0x31')](_0x5de74d[_0xea5e('0x2c')][_0xea5e('0x31')]));_0x4cb672['attributes']=_0x4cb672[_0xea5e('0x30')][_0xea5e('0x32')]?_0x4cb672[_0xea5e('0x30')]:_0x1a5712['model'];if(_0x5de74d[_0xea5e('0x2c')][_0xea5e('0x43')]){_0x4cb672['include']=[{'all':!![]}];}_0x4cb672=_[_0xea5e('0x39')]({},_0x4cb672,_0x5de74d['options']);return db[_0xea5e('0x3d')][_0xea5e('0x44')](_0x4cb672)['then'](handleEntityNotFound(_0x2e928f,null))[_0xea5e('0x21')](respondWithResult(_0x2e928f,null))[_0xea5e('0x41')](handleError(_0x2e928f,null));};exports['create']=function(_0x28ee2e,_0x3916c1){return db[_0xea5e('0x3d')][_0xea5e('0x45')](_0x28ee2e[_0xea5e('0x46')],{})[_0xea5e('0x21')](respondWithResult(_0x3916c1,0xc9))['catch'](handleError(_0x3916c1,null));};exports[_0xea5e('0x20')]=function(_0x3ffde6,_0x2a6748){if(_0x3ffde6['body']['id']){delete _0x3ffde6['body']['id'];}return db[_0xea5e('0x3d')][_0xea5e('0x44')]({'where':{'id':_0x3ffde6[_0xea5e('0x42')]['id']}})[_0xea5e('0x21')](handleEntityNotFound(_0x2a6748,null))[_0xea5e('0x21')](saveUpdates(_0x3ffde6[_0xea5e('0x46')],null))[_0xea5e('0x21')](respondWithResult(_0x2a6748,null))[_0xea5e('0x41')](handleError(_0x2a6748,null));};exports['destroy']=function(_0x53c0e7,_0x5b21a8){return db[_0xea5e('0x3d')][_0xea5e('0x44')]({'where':{'id':_0x53c0e7[_0xea5e('0x42')]['id']}})[_0xea5e('0x21')](handleEntityNotFound(_0x5b21a8,null))['then'](removeEntity(_0x5b21a8,null))[_0xea5e('0x41')](handleError(_0x5b21a8,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index f783584..afc1afe 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 _0x4584=['./faxApplication.attributes','define','FaxApplication','utf8mb4','utf8mb4_unicode_ci','lodash','util','bluebird','request-promise','../../config/environment'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x4584,0x69));var _0x4458=function(_0x4b87dc,_0x65bfba){_0x4b87dc=_0x4b87dc-0x0;var _0x4c3b12=_0x4584[_0x4b87dc];return _0x4c3b12;};'use strict';var _=require(_0x4458('0x0'));var util=require(_0x4458('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x4458('0x2'));var rp=require(_0x4458('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4458('0x4'));var attributes=require(_0x4458('0x5'));module['exports']=function(_0x344ca2,_0x437005){return _0x344ca2[_0x4458('0x6')](_0x4458('0x7'),attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4458('0x8'),'collate':_0x4458('0x9')});}; \ No newline at end of file +var _0x2c24=['rimraf','../../config/environment','exports','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise'];(function(_0x29a7e2,_0x5291b0){var _0x332d1b=function(_0x46ab6c){while(--_0x46ab6c){_0x29a7e2['push'](_0x29a7e2['shift']());}};_0x332d1b(++_0x5291b0);}(_0x2c24,0x18d));var _0x42c2=function(_0x542250,_0x4568cf){_0x542250=_0x542250-0x0;var _0x43c5da=_0x2c24[_0x542250];return _0x43c5da;};'use strict';var _=require(_0x42c2('0x0'));var util=require(_0x42c2('0x1'));var logger=require('../../config/logger')(_0x42c2('0x2'));var moment=require(_0x42c2('0x3'));var BPromise=require(_0x42c2('0x4'));var rp=require(_0x42c2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x42c2('0x6'));var config=require(_0x42c2('0x7'));var attributes=require('./faxApplication.attributes');module[_0x42c2('0x8')]=function(_0x25b2e4,_0x1f1ce1){return _0x25b2e4['define'](_0x42c2('0x9'),attributes,{'tableName':_0x42c2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x42c2('0xb'),'collate':_0x42c2('0xc')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 1950041..0b49e5f 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 _0x39ff=['message','result','UpdateFaxApplication','FaxApplication','update','body','options','raw','attributes','limit','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','FaxApplication,\x20%s,\x20%s','debug','request\x20sent','stringify','error'];(function(_0x5b673f,_0x3ada35){var _0x18d0bd=function(_0x463212){while(--_0x463212){_0x5b673f['push'](_0x5b673f['shift']());}};_0x18d0bd(++_0x3ada35);}(_0x39ff,0x155));var _0xf39f=function(_0x26722d,_0x3f4e12){_0x26722d=_0x26722d-0x0;var _0x114d00=_0x39ff[_0x26722d];return _0x114d00;};'use strict';var _=require(_0xf39f('0x0'));var util=require(_0xf39f('0x1'));var moment=require('moment');var BPromise=require(_0xf39f('0x2'));var rs=require(_0xf39f('0x3'));var fs=require('fs');var Redis=require(_0xf39f('0x4'));var db=require(_0xf39f('0x5'))['db'];var utils=require(_0xf39f('0x6'));var logger=require('../../config/logger')(_0xf39f('0x7'));var config=require(_0xf39f('0x8'));var jayson=require(_0xf39f('0x9'));var client=jayson[_0xf39f('0xa')][_0xf39f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3bb15b,_0x5b5480,_0x22dc87){return new BPromise(function(_0x58309e,_0x2a310a){return client[_0xf39f('0xc')](_0x3bb15b,_0x22dc87)['then'](function(_0xb58949){logger[_0xf39f('0xd')](_0xf39f('0xe'),_0x5b5480,'request\x20sent');logger[_0xf39f('0xf')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x5b5480,_0xf39f('0x10'),JSON[_0xf39f('0x11')](_0xb58949));if(_0xb58949['error']){if(_0xb58949['error']['code']===0x1f4){logger[_0xf39f('0x12')](_0xf39f('0xe'),_0x5b5480,_0xb58949['error']['message']);return _0x2a310a(_0xb58949[_0xf39f('0x12')][_0xf39f('0x13')]);}logger[_0xf39f('0x12')]('FaxApplication,\x20%s,\x20%s',_0x5b5480,_0xb58949['error'][_0xf39f('0x13')]);return _0x58309e(_0xb58949[_0xf39f('0x12')][_0xf39f('0x13')]);}else{logger['info'](_0xf39f('0xe'),_0x5b5480,_0xf39f('0x10'));_0x58309e(_0xb58949[_0xf39f('0x14')][_0xf39f('0x13')]);}})['catch'](function(_0x215126){logger['error']('FaxApplication,\x20%s,\x20%s',_0x5b5480,_0x215126);_0x2a310a(_0x215126);});});}exports[_0xf39f('0x15')]=function(_0x3ad6df){var _0xc29425=this;return new Promise(function(_0x5a5488,_0x246d36){return db[_0xf39f('0x16')][_0xf39f('0x17')](_0x3ad6df[_0xf39f('0x18')],{'raw':_0x3ad6df[_0xf39f('0x19')]?_0x3ad6df[_0xf39f('0x19')][_0xf39f('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3ad6df[_0xf39f('0x19')]?_0x3ad6df['options']['where']||null:null,'attributes':_0x3ad6df[_0xf39f('0x19')]?_0x3ad6df[_0xf39f('0x19')][_0xf39f('0x1b')]||null:null,'limit':_0x3ad6df[_0xf39f('0x19')]?_0x3ad6df[_0xf39f('0x19')][_0xf39f('0x1c')]||null:null})['then'](function(_0x14f357){logger[_0xf39f('0xd')]('UpdateFaxApplication',_0x3ad6df);logger['debug'](_0xf39f('0x15'),_0x3ad6df,JSON[_0xf39f('0x11')](_0x14f357));_0x5a5488(_0x14f357);})[_0xf39f('0x1d')](function(_0x1689d5){logger[_0xf39f('0x12')](_0xf39f('0x15'),_0x1689d5['message'],_0x3ad6df);_0x246d36(_0xc29425[_0xf39f('0x12')](0x1f4,_0x1689d5['message']));});});}; \ No newline at end of file +var _0x687f=['util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','error','code','FaxApplication,\x20%s,\x20%s','message','result','UpdateFaxApplication','FaxApplication','update','body','options','raw','where','attributes','limit','stringify','lodash'];(function(_0x4d21ff,_0x19d202){var _0x22b554=function(_0x4473c5){while(--_0x4473c5){_0x4d21ff['push'](_0x4d21ff['shift']());}};_0x22b554(++_0x19d202);}(_0x687f,0x9f));var _0xf687=function(_0x424a9a,_0x2dd9af){_0x424a9a=_0x424a9a-0x0;var _0xa7831c=_0x687f[_0x424a9a];return _0xa7831c;};'use strict';var _=require(_0xf687('0x0'));var util=require(_0xf687('0x1'));var moment=require(_0xf687('0x2'));var BPromise=require(_0xf687('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf687('0x4'))['db'];var utils=require(_0xf687('0x5'));var logger=require(_0xf687('0x6'))(_0xf687('0x7'));var config=require(_0xf687('0x8'));var jayson=require(_0xf687('0x9'));var client=jayson[_0xf687('0xa')][_0xf687('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1973eb,_0x2910be,_0x958376){return new BPromise(function(_0x1b01d0,_0x4f4398){return client[_0xf687('0xc')](_0x1973eb,_0x958376)[_0xf687('0xd')](function(_0x11c857){logger[_0xf687('0xe')]('FaxApplication,\x20%s,\x20%s',_0x2910be,_0xf687('0xf'));logger[_0xf687('0x10')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x2910be,_0xf687('0xf'),JSON['stringify'](_0x11c857));if(_0x11c857[_0xf687('0x11')]){if(_0x11c857[_0xf687('0x11')][_0xf687('0x12')]===0x1f4){logger[_0xf687('0x11')](_0xf687('0x13'),_0x2910be,_0x11c857[_0xf687('0x11')]['message']);return _0x4f4398(_0x11c857[_0xf687('0x11')][_0xf687('0x14')]);}logger['error'](_0xf687('0x13'),_0x2910be,_0x11c857[_0xf687('0x11')][_0xf687('0x14')]);return _0x1b01d0(_0x11c857['error'][_0xf687('0x14')]);}else{logger[_0xf687('0xe')]('FaxApplication,\x20%s,\x20%s',_0x2910be,_0xf687('0xf'));_0x1b01d0(_0x11c857[_0xf687('0x15')]['message']);}})['catch'](function(_0xd21955){logger[_0xf687('0x11')](_0xf687('0x13'),_0x2910be,_0xd21955);_0x4f4398(_0xd21955);});});}exports[_0xf687('0x16')]=function(_0x4d3cb5){var _0xb54e30=this;return new Promise(function(_0xf4ffe2,_0x43fa59){return db[_0xf687('0x17')][_0xf687('0x18')](_0x4d3cb5[_0xf687('0x19')],{'raw':_0x4d3cb5['options']?_0x4d3cb5[_0xf687('0x1a')][_0xf687('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4d3cb5['options']?_0x4d3cb5[_0xf687('0x1a')][_0xf687('0x1c')]||null:null,'attributes':_0x4d3cb5['options']?_0x4d3cb5[_0xf687('0x1a')][_0xf687('0x1d')]||null:null,'limit':_0x4d3cb5[_0xf687('0x1a')]?_0x4d3cb5[_0xf687('0x1a')][_0xf687('0x1e')]||null:null})['then'](function(_0x12f3b5){logger[_0xf687('0xe')](_0xf687('0x16'),_0x4d3cb5);logger[_0xf687('0x10')]('UpdateFaxApplication',_0x4d3cb5,JSON[_0xf687('0x1f')](_0x12f3b5));_0xf4ffe2(_0x12f3b5);})['catch'](function(_0x54ab08){logger[_0xf687('0x11')](_0xf687('0x16'),_0x54ab08[_0xf687('0x14')],_0x4d3cb5);_0x43fa59(_0xb54e30[_0xf687('0x11')](0x1f4,_0x54ab08[_0xf687('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 991906c..3c9b0b6 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 _0xdbf5=['index','/:id','show','put','update','exports','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','isAuthenticated'];(function(_0x3ac1c7,_0x8f6272){var _0x583b42=function(_0x3e7f21){while(--_0x3e7f21){_0x3ac1c7['push'](_0x3ac1c7['shift']());}};_0x583b42(++_0x8f6272);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x358f74,_0x5a7bd7){_0x358f74=_0x358f74-0x0;var _0x5b1c0b=_0xdbf5[_0x358f74];return _0x5b1c0b;};'use strict';var multer=require('multer');var util=require(_0x5dbf('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5dbf('0x1'));var router=express[_0x5dbf('0x2')]();var auth=require(_0x5dbf('0x3'));var interaction=require(_0x5dbf('0x4'));var config=require(_0x5dbf('0x5'));var controller=require(_0x5dbf('0x6'));router[_0x5dbf('0x7')]('/',auth[_0x5dbf('0x8')](),controller[_0x5dbf('0x9')]);router[_0x5dbf('0x7')](_0x5dbf('0xa'),auth[_0x5dbf('0x8')](),controller[_0x5dbf('0xb')]);router['post']('/',auth[_0x5dbf('0x8')](),controller['create']);router[_0x5dbf('0xc')](_0x5dbf('0xa'),auth[_0x5dbf('0x8')](),controller[_0x5dbf('0xd')]);router['delete'](_0x5dbf('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x5dbf('0xe')]=router; \ No newline at end of file +var _0x8ef6=['Router','../../components/auth/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x1d7f08,_0x38a721){var _0x12b3ef=function(_0x54303a){while(--_0x54303a){_0x1d7f08['push'](_0x1d7f08['shift']());}};_0x12b3ef(++_0x38a721);}(_0x8ef6,0xf2));var _0x68ef=function(_0x225e35,_0x1bcdd8){_0x225e35=_0x225e35-0x0;var _0xd3583d=_0x8ef6[_0x225e35];return _0xd3583d;};'use strict';var multer=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var path=require(_0x68ef('0x2'));var timeout=require(_0x68ef('0x3'));var express=require(_0x68ef('0x4'));var router=express[_0x68ef('0x5')]();var auth=require(_0x68ef('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x68ef('0x7'));var controller=require(_0x68ef('0x8'));router[_0x68ef('0x9')]('/',auth[_0x68ef('0xa')](),controller['index']);router['get'](_0x68ef('0xb'),auth[_0x68ef('0xa')](),controller[_0x68ef('0xc')]);router['post']('/',auth[_0x68ef('0xa')](),controller[_0x68ef('0xd')]);router[_0x68ef('0xe')](_0x68ef('0xb'),auth[_0x68ef('0xa')](),controller[_0x68ef('0xf')]);router[_0x68ef('0x10')](_0x68ef('0xb'),auth[_0x68ef('0xa')](),controller[_0x68ef('0x11')]);module[_0x68ef('0x12')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 7313aa8..f2b32e9 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 _0x86d0=['out','sequelize','exports','DATE','STRING'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x86d0,0x191));var _0x086d=function(_0x4f232d,_0x50c2fd){_0x4f232d=_0x4f232d-0x0;var _0x494086=_0x86d0[_0x4f232d];return _0x494086;};'use strict';var Sequelize=require(_0x086d('0x0'));module[_0x086d('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x086d('0x2')]},'disposition':{'type':Sequelize[_0x086d('0x3')]},'note':{'type':Sequelize[_0x086d('0x3')]},'read1stAt':{'type':Sequelize[_0x086d('0x2')]},'fax':{'type':Sequelize[_0x086d('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x086d('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x086d('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x210d=['DATE','STRING','ENUM','out','sequelize','exports','BOOLEAN'];(function(_0x3a4e6d,_0x425b58){var _0x4fd72d=function(_0x1bb2ac){while(--_0x1bb2ac){_0x3a4e6d['push'](_0x3a4e6d['shift']());}};_0x4fd72d(++_0x425b58);}(_0x210d,0xeb));var _0xd210=function(_0x22b39b,_0x2b7d63){_0x22b39b=_0x22b39b-0x0;var _0x280e1d=_0x210d[_0x22b39b];return _0x280e1d;};'use strict';var Sequelize=require(_0xd210('0x0'));module[_0xd210('0x1')]={'closed':{'type':Sequelize[_0xd210('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xd210('0x3')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xd210('0x4')]},'read1stAt':{'type':Sequelize[_0xd210('0x3')]},'fax':{'type':Sequelize[_0xd210('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xd210('0x5')]('in',_0xd210('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xd210('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xd210('0x6')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index 2f1d220..7db5482 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 _0xaf6c=['util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','error','name','Users','Tags','TagIds','forEach','push','catch','map','FaxInteraction','rawAttributes','type','key','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','order','sort','pick','field','color','from','tools_tags','select','u.id','ui.FaxInteractionId','user_has_fax_interactions','left_join','users','u.id\x20=\x20ui.UserId','fax_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_interaction_has_tags','t.id\x20=\x20it.TagId','expr','parseSearch','sqlOperator','conditions','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','find','ContactId','buildExpression','text','start','split','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','filter','isNil','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','$gte','where','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','replace','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','clone','DESC','t.id\x20IN\x20?','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','Contact.firstName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','all','rows','show','includeAll','options','create','body','describe','addMessage','FaxMessage','params','ids','getMessages','findOne','nolimit','FaxInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','findAll','setTags','omit','spread','Tag','emit','faxInteractionTags:save','removeTags','download','join','root','server','files','attachments','tmp','Attachment','mkdirSync','basename','existsSync','createReadStream','pipe','log','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x3e2a12,_0x10b037){var _0x2a6f13=function(_0x4d1b00){while(--_0x4d1b00){_0x3e2a12['push'](_0x3e2a12['shift']());}};_0x2a6f13(++_0x10b037);}(_0xaf6c,0x180));var _0xcaf6=function(_0x46eb48,_0x1a1d03){_0x46eb48=_0x46eb48-0x0;var _0x32538c=_0xaf6c[_0x46eb48];return _0x32538c;};'use strict';var pdf=require(_0xcaf6('0x0'));var emlformat=require(_0xcaf6('0x1'));var rimraf=require(_0xcaf6('0x2'));var zipdir=require(_0xcaf6('0x3'));var jsonpatch=require(_0xcaf6('0x4'));var rp=require(_0xcaf6('0x5'));var moment=require(_0xcaf6('0x6'));var BPromise=require(_0xcaf6('0x7'));var Mustache=require('mustache');var util=require(_0xcaf6('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xcaf6('0x9'));var ejs=require(_0xcaf6('0xa'));var fs=require('fs');var _=require(_0xcaf6('0xb'));var squel=require(_0xcaf6('0xc'));var crypto=require(_0xcaf6('0xd'));var jsforce=require(_0xcaf6('0xe'));var deskjs=require(_0xcaf6('0xf'));var toCsv=require(_0xcaf6('0x9'));var querystring=require(_0xcaf6('0x10'));var Papa=require(_0xcaf6('0x11'));var Redis=require(_0xcaf6('0x12'));var authService=require(_0xcaf6('0x13'));var qs=require(_0xcaf6('0x14'));var as=require(_0xcaf6('0x15'));var hardwareService=require(_0xcaf6('0x16'));var logger=require('../../config/logger')(_0xcaf6('0x17'));var utils=require(_0xcaf6('0x18'));var config=require(_0xcaf6('0x19'));var db=require('../../mysqldb')['db'];config[_0xcaf6('0x1a')]=_['defaults'](config[_0xcaf6('0x1a')],{'host':_0xcaf6('0x1b'),'port':0x18eb});var socket=require(_0xcaf6('0x1c'))(new Redis(config['redis']));require(_0xcaf6('0x1d'))[_0xcaf6('0x1e')](socket);function respondWithStatusCode(_0x327819,_0x511996){_0x511996=_0x511996||0xcc;return function(_0x3c8a9f){if(_0x3c8a9f){return _0x327819[_0xcaf6('0x1f')](_0x511996);}return _0x327819[_0xcaf6('0x20')](_0x511996)[_0xcaf6('0x21')]();};}function respondWithResult(_0x44a5f2,_0x2fd479){_0x2fd479=_0x2fd479||0xc8;return function(_0x53be3e){if(_0x53be3e){return _0x44a5f2['status'](_0x2fd479)[_0xcaf6('0x22')](_0x53be3e);}};}function respondWithFilteredResult(_0x4b9082,_0x2c1adc){return function(_0x236b9e){if(_0x236b9e){var _0x1ee9f4=_0x236b9e[_0xcaf6('0x23')],_0x1e3f20=_0x2c1adc[_0xcaf6('0x24')],_0x29d4de=_0x2c1adc[_0xcaf6('0x24')]+_0x2c1adc[_0xcaf6('0x25')],_0x523c4b;if(_0x29d4de>=_0x1ee9f4){_0x29d4de=_0x1ee9f4;_0x523c4b=0xc8;}else{_0x523c4b=0xce;}_0x4b9082[_0xcaf6('0x20')](_0x523c4b);return _0x4b9082[_0xcaf6('0x26')](_0xcaf6('0x27'),_0x1e3f20+'-'+_0x29d4de+'/'+_0x1ee9f4)[_0xcaf6('0x22')](_0x236b9e);}return null;};}function patchUpdates(_0xf1d6ac){return function(_0x318e4f){try{jsonpatch[_0xcaf6('0x28')](_0x318e4f,_0xf1d6ac,!![]);}catch(_0xde4395){return BPromise['reject'](_0xde4395);}return _0x318e4f[_0xcaf6('0x29')]();};}function saveUpdates(_0x48b7e4,_0x23f5bd){return function(_0x31493f){if(_0x31493f){return _0x31493f[_0xcaf6('0x2a')](_0x48b7e4)[_0xcaf6('0x2b')](function(_0x436d44){return _0x436d44;});}return null;};}function removeEntity(_0x36575c,_0x3fe115){return function(_0x37d7d4){if(_0x37d7d4){return _0x37d7d4[_0xcaf6('0x2c')]()[_0xcaf6('0x2b')](function(){_0x36575c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1201ef,_0x41600d){return function(_0x5a6355){if(!_0x5a6355){_0x1201ef[_0xcaf6('0x1f')](0x194);}return _0x5a6355;};}function handleError(_0x245e18,_0xf1f7c6){_0xf1f7c6=_0xf1f7c6||0x1f4;return function(_0x3499be){logger[_0xcaf6('0x2d')](_0x3499be['stack']);if(_0x3499be['name']){delete _0x3499be[_0xcaf6('0x2e')];}_0x245e18['status'](_0xf1f7c6)['send'](_0x3499be);};}function getInteractionUsers(_0x224b4f,_0x2e5296){return new BPromise(function(_0x16e59a,_0x39ce24){try{if(_0x2e5296[_0x224b4f['id']]){_0x224b4f[_0xcaf6('0x2f')]=_['map'](_0x2e5296[_0x224b4f['id']],function(_0x1e5d29){return{'id':_0x1e5d29['id']};});}}catch(_0x5537fd){_0x39ce24(_0x5537fd);}_0x16e59a(_0x224b4f);});}function getInteractionTags(_0x20e159,_0x5834d5){return new BPromise(function(_0x20a269,_0x205124){try{if(_0x20e159['TagIds']){_0x20e159[_0xcaf6('0x30')]=[];_0x20e159[_0xcaf6('0x31')]['split'](',')[_0xcaf6('0x32')](function(_0x33ca71){_0x20e159[_0xcaf6('0x30')][_0xcaf6('0x33')](_0x5834d5[_0x33ca71]);});}delete _0x20e159[_0xcaf6('0x31')];}catch(_0x4ff3e7){_0x205124(_0x4ff3e7);}_0x20a269(_0x20e159);});}function updateFaxInteraction(_0x343b16,_0x4521af,_0x1d29e8){return new BPromise(function(_0x557f39,_0x4fcad7){return getInteractionUsers(_0x343b16,_0x1d29e8)[_0xcaf6('0x2b')](function(_0x913ca2){return getInteractionTags(_0x913ca2,_0x4521af);})[_0xcaf6('0x2b')](function(_0x11e171){_0x557f39(_0x11e171);})[_0xcaf6('0x34')](function(_0x27a546){_0x4fcad7(_0x27a546);});});}exports['index']=function(_0x5c8ff8,_0x641c48){var _0x535733={},_0x24b767={},_0x2843c5={'count':0x0,'rows':[]};var _0x2287c3=_[_0xcaf6('0x35')](db[_0xcaf6('0x36')][_0xcaf6('0x37')],function(_0x459010){return{'name':_0x459010['fieldName'],'type':_0x459010[_0xcaf6('0x38')][_0xcaf6('0x39')]};});_0x24b767[_0xcaf6('0x3a')]=_[_0xcaf6('0x35')](_0x2287c3,_0xcaf6('0x2e'));_0x24b767[_0xcaf6('0x3b')]=_[_0xcaf6('0x3c')](_0x5c8ff8[_0xcaf6('0x3b')]);_0x24b767[_0xcaf6('0x3d')]=_['intersection'](_0x24b767['model'],_0x24b767[_0xcaf6('0x3b')]);_0x535733['attributes']=_[_0xcaf6('0x3e')](_0x24b767[_0xcaf6('0x3a')],qs[_0xcaf6('0x3f')](_0x5c8ff8['query'][_0xcaf6('0x3f')]));_0x535733['attributes']=_0x535733['attributes'][_0xcaf6('0x40')]?_0x535733[_0xcaf6('0x41')]:_0x24b767[_0xcaf6('0x3a')];if(!_0x5c8ff8[_0xcaf6('0x3b')][_0xcaf6('0x42')]('nolimit')){_0x535733[_0xcaf6('0x25')]=qs['limit'](_0x5c8ff8[_0xcaf6('0x3b')][_0xcaf6('0x25')]);_0x535733['offset']=qs[_0xcaf6('0x24')](_0x5c8ff8[_0xcaf6('0x3b')]['offset']);}_0x535733[_0xcaf6('0x43')]=qs[_0xcaf6('0x44')](_0x5c8ff8['query'][_0xcaf6('0x44')]);_0x535733['where']=qs['filters'](_[_0xcaf6('0x45')](_0x5c8ff8[_0xcaf6('0x3b')],_0x24b767[_0xcaf6('0x3d')]));var _0x38ba67=[];var _0x53fac3=squel['select']()[_0xcaf6('0x46')]('id')[_0xcaf6('0x46')](_0xcaf6('0x2e'))[_0xcaf6('0x46')](_0xcaf6('0x47'))[_0xcaf6('0x48')](_0xcaf6('0x49'));var _0x2500de=squel[_0xcaf6('0x4a')]()['field'](_0xcaf6('0x4b'))[_0xcaf6('0x46')](_0xcaf6('0x4c'))[_0xcaf6('0x48')](_0xcaf6('0x4d'),'ui')[_0xcaf6('0x4e')](_0xcaf6('0x4f'),'u',_0xcaf6('0x50'));var _0x57faa0=squel['select']()[_0xcaf6('0x48')](_0xcaf6('0x51'),'i')[_0xcaf6('0x4e')](_0xcaf6('0x52'),'c',_0xcaf6('0x53'))[_0xcaf6('0x4e')](_0xcaf6('0x4f'),'o',_0xcaf6('0x54'))['left_join'](_0xcaf6('0x55'),'a',_0xcaf6('0x56'))[_0xcaf6('0x4e')]('fax_messages','me','me.FaxInteractionId\x20=\x20i.id')[_0xcaf6('0x4e')](_0xcaf6('0x57'),'it','it.FaxInteractionId\x20=\x20i.id')[_0xcaf6('0x4e')](_0xcaf6('0x49'),'t',_0xcaf6('0x58'));var _0x2a8899=squel[_0xcaf6('0x59')]();var _0x1aaf38=[];var _0x18c72c=squel[_0xcaf6('0x59')]();if(_0x5c8ff8[_0xcaf6('0x3b')]['search']){var _0x9a6f67=as[_0xcaf6('0x5a')](_0x5c8ff8[_0xcaf6('0x3b')]['search']);var _0x44c517=_0x9a6f67[_0xcaf6('0x5b')];for(var _0x39b779=0x0;_0x39b779<_0x9a6f67[_0xcaf6('0x5c')][_0xcaf6('0x40')];_0x39b779++){var _0x1211ec=_0x9a6f67[_0xcaf6('0x5c')][_0x39b779];var _0x44f221='i';var _0x338088=_['find'](_0x2287c3,[_0xcaf6('0x2e'),_0x1211ec[_0xcaf6('0x46')]]);if(!_0x338088){switch(_0x1211ec[_0xcaf6('0x46')]){case'unreadMessages':if(_0x1211ec[_0xcaf6('0x5d')]==0x1){_0x57faa0[_0xcaf6('0x5e')]('`'+_0x1211ec['field']+_0xcaf6('0x5f'));}else{_0x57faa0[_0xcaf6('0x5e')]('`'+_0x1211ec[_0xcaf6('0x46')]+_0xcaf6('0x60'));}break;case _0xcaf6('0x61'):if(_0x1211ec[_0xcaf6('0x62')]===_0xcaf6('0x63')){_0x2a8899[_0x44c517]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',_0x1211ec[_0xcaf6('0x5d')],null);}else{_0x338088=_[_0xcaf6('0x64')](_0x2287c3,[_0xcaf6('0x2e'),_0xcaf6('0x65')]);_0x1211ec['field']=_0xcaf6('0x65');_0x131a39=as[_0xcaf6('0x66')](_0x44f221,_0x338088[_0xcaf6('0x38')],_0x1211ec);_0x2a8899[_0x44c517](_0x131a39[_0xcaf6('0x67')],_0x131a39['value'][_0xcaf6('0x68')],_0x131a39[_0xcaf6('0x5d')]['end']);}break;case'Tag':var _0x45b5df=_0x1211ec[_0xcaf6('0x5d')][_0xcaf6('0x69')](',')[_0xcaf6('0x35')](function(_0x3d9237){return Number(_0x3d9237);});_0x45b5df[_0xcaf6('0x32')](function(_0x17f5cd){_0x18c72c['or'](_0xcaf6('0x6a'),'%,'+_0x17f5cd+',%');});_0x1aaf38=_[_0xcaf6('0x6b')](_0x1aaf38,_0x45b5df);break;case _0xcaf6('0x6c'):if(_0x1211ec[_0xcaf6('0x62')]==='$substring'){_0x2a8899[_0x44c517](_0xcaf6('0x6d'),'%'+_0x1211ec[_0xcaf6('0x5d')]+'%',null);}else{_0x338088=_[_0xcaf6('0x64')](_0x2287c3,[_0xcaf6('0x2e'),_0xcaf6('0x6e')]);_0x1211ec[_0xcaf6('0x46')]=_0xcaf6('0x6e');_0x131a39=as[_0xcaf6('0x66')](_0x44f221,_0x338088['type'],_0x1211ec);_0x2a8899[_0x44c517](_0x131a39[_0xcaf6('0x67')],_0x131a39['value'][_0xcaf6('0x68')],_0x131a39[_0xcaf6('0x5d')][_0xcaf6('0x21')]);}break;}}else{var _0x131a39=as[_0xcaf6('0x66')](_0x44f221,_0x338088[_0xcaf6('0x38')],_0x1211ec);_0x2a8899[_0x44c517](_0x131a39[_0xcaf6('0x67')],_0x131a39['value']['start'],_0x131a39['value'][_0xcaf6('0x21')]);}}}else{var _0x23c664=_(Object[_0xcaf6('0x3c')](_0x5c8ff8[_0xcaf6('0x3b')]))[_0xcaf6('0x35')](function(_0x183d80){return _0x2287c3['hasOwnProperty'](_0x183d80)?_0x183d80:undefined;})[_0xcaf6('0x6f')](function(_0x3cd4f0){return!_[_0xcaf6('0x70')](_0x3cd4f0);})[_0xcaf6('0x5d')]();if(!_[_0xcaf6('0x71')](_0x23c664)){_0x23c664[_0xcaf6('0x32')](function(_0x55d652){if(_0x55d652===_0xcaf6('0x72')){_0x57faa0['where'](_0xcaf6('0x73'),[][_0xcaf6('0x74')](_0x5c8ff8[_0xcaf6('0x3b')][_0x55d652]));}else if(_0x55d652==='createdAt'){var _0x4a14a1=JSON['parse'](_0x5c8ff8[_0xcaf6('0x3b')][_0x55d652])[_0xcaf6('0x75')];var _0x3c0cf0=JSON['parse'](_0x5c8ff8[_0xcaf6('0x3b')][_0x55d652])['$lte'];_0x57faa0[_0xcaf6('0x76')](_0xcaf6('0x77'),_0x4a14a1,_0x3c0cf0);}else{if(_0x5c8ff8['query'][_0x55d652]==='null'){_0x57faa0['where']('i.'+_0x55d652+'\x20IS\x20NULL');}else{_0x57faa0[_0xcaf6('0x76')]('i.'+_0x55d652+_0xcaf6('0x78'),_0x5c8ff8[_0xcaf6('0x3b')][_0x55d652]);}}});}if(_0x5c8ff8['query'][_0xcaf6('0x79')]){if(_0x5c8ff8[_0xcaf6('0x3b')][_0xcaf6('0x79')]==0x1){_0x57faa0[_0xcaf6('0x5e')](_0xcaf6('0x7a'));}else{_0x57faa0[_0xcaf6('0x5e')](_0xcaf6('0x7b'));}}if(_0x5c8ff8[_0xcaf6('0x3b')][_0xcaf6('0x7c')]){_0x1aaf38=_[_0xcaf6('0x7d')](_0x5c8ff8[_0xcaf6('0x3b')]['tag'])?_0x5c8ff8[_0xcaf6('0x3b')][_0xcaf6('0x7c')]:new Array(_0x5c8ff8[_0xcaf6('0x3b')][_0xcaf6('0x7c')]);_0x1aaf38['forEach'](function(_0xbee49){_0x18c72c['or'](_0xcaf6('0x6a'),'%,'+_0xbee49+',%');});}if(_0x5c8ff8['query'][_0xcaf6('0x6f')]){var _0x2b51af=_0x5c8ff8[_0xcaf6('0x3b')][_0xcaf6('0x6f')]['replace']('\x5c','\x5c\x5c')[_0xcaf6('0x7e')]('\x27\x27','\x27\x27\x27\x27');if(qs['isNumeric'](_0x2b51af)){_0x2a8899['or'](_0xcaf6('0x7f'),_0x2b51af+'%')['or']('i.fax\x20LIKE\x20?',_0x2b51af+'%');}_0x2a8899['or'](_0xcaf6('0x80'),_0x2b51af+'%');}}_0x57faa0[_0xcaf6('0x76')](_0x2a8899);_0x57faa0[_0xcaf6('0x81')](_0xcaf6('0x82'));var _0x3e0ea9={'type':db['Sequelize'][_0xcaf6('0x83')]['SELECT'],'raw':!![]};var _0x53765b=_0x57faa0[_0xcaf6('0x84')]();_0x53765b[_0xcaf6('0x46')](_0xcaf6('0x82'));_0x53765b[_0xcaf6('0x46')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x535733[_0xcaf6('0x43')]){_0x535733[_0xcaf6('0x43')][_0xcaf6('0x32')](function(_0x34418a){_0x57faa0[_0xcaf6('0x43')]('i.'+_0x34418a[0x0],_0x34418a[0x1]===_0xcaf6('0x85')?![]:!![]);});}if(!_['isEmpty'](_0x1aaf38)){_0x57faa0['having'](_0x18c72c);_0x53765b['where'](_0xcaf6('0x86'),_0x1aaf38);}db[_0xcaf6('0x87')]['query'](_0x53765b[_0xcaf6('0x88')](),_0x3e0ea9)[_0xcaf6('0x2b')](function(_0xe80ac5){_0x2843c5[_0xcaf6('0x23')]=_0xe80ac5[_0xcaf6('0x40')];if(_0x2843c5[_0xcaf6('0x23')]===0x0)return[];return db['sequelize'][_0xcaf6('0x3b')](_0x53fac3[_0xcaf6('0x88')](),_0x3e0ea9)[_0xcaf6('0x2b')](function(_0x2d8ed5){_0x38ba67=_[_0xcaf6('0x89')](_0x2d8ed5,'id');_0x3e0ea9=_[_0xcaf6('0x8a')](_0x3e0ea9,{'model':db[_0xcaf6('0x36')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x57faa0[_0xcaf6('0x46')](_0xcaf6('0x8b'),_0xcaf6('0x8c'));_0x57faa0[_0xcaf6('0x46')]('a.key',_0xcaf6('0x8d'));_0x57faa0[_0xcaf6('0x46')](_0xcaf6('0x8e'),_0xcaf6('0x8f'));_0x57faa0[_0xcaf6('0x46')]('i.*');_0x57faa0[_0xcaf6('0x46')]('c.firstName',_0xcaf6('0x90'));_0x57faa0['field']('c.lastName',_0xcaf6('0x91'));_0x57faa0[_0xcaf6('0x46')](_0xcaf6('0x92'),'Contact.email');_0x57faa0[_0xcaf6('0x46')](_0xcaf6('0x93'),_0xcaf6('0x94'));_0x57faa0[_0xcaf6('0x46')](_0xcaf6('0x95'),_0xcaf6('0x96'));_0x57faa0[_0xcaf6('0x46')]('c.fax',_0xcaf6('0x97'));_0x57faa0[_0xcaf6('0x46')](_0xcaf6('0x98'),_0xcaf6('0x31'));_0x57faa0[_0xcaf6('0x25')](_0x535733[_0xcaf6('0x25')]);_0x57faa0['offset'](_0x535733[_0xcaf6('0x24')]);return db[_0xcaf6('0x87')][_0xcaf6('0x3b')](_0x57faa0[_0xcaf6('0x88')](),_0x3e0ea9);})[_0xcaf6('0x2b')](function(_0xec2e9e){_0x2500de[_0xcaf6('0x76')](_0xcaf6('0x99'),_[_0xcaf6('0x35')](_0xec2e9e,'id'));return db['sequelize']['query'](_0x2500de[_0xcaf6('0x88')](),_0x3e0ea9)[_0xcaf6('0x2b')](function(_0x109689){var _0x490e2b=_['groupBy'](_0x109689,'FaxInteractionId');var _0x35ec1c=[];_0xec2e9e['forEach'](function(_0x4eb4b7){_0x35ec1c[_0xcaf6('0x33')](updateFaxInteraction(_0x4eb4b7,_0x38ba67,_0x490e2b));});return BPromise[_0xcaf6('0x9a')](_0x35ec1c);});});})['then'](function(_0x3ee210){_0x2843c5[_0xcaf6('0x9b')]=_0x3ee210;return _0x2843c5;})[_0xcaf6('0x2b')](respondWithFilteredResult(_0x641c48,_0x535733))[_0xcaf6('0x34')](handleError(_0x641c48,null));};exports[_0xcaf6('0x9c')]=function(_0x14fc8e,_0x28e3db){var _0x299185={'raw':![],'where':{'id':_0x14fc8e['params']['id']}},_0x72c282={};_0x72c282[_0xcaf6('0x3a')]=_['keys'](db[_0xcaf6('0x36')][_0xcaf6('0x37')]);_0x72c282[_0xcaf6('0x3b')]=_[_0xcaf6('0x3c')](_0x14fc8e['query']);_0x72c282[_0xcaf6('0x3d')]=_[_0xcaf6('0x3e')](_0x72c282[_0xcaf6('0x3a')],_0x72c282[_0xcaf6('0x3b')]);_0x299185[_0xcaf6('0x41')]=_[_0xcaf6('0x3e')](_0x72c282[_0xcaf6('0x3a')],qs['fields'](_0x14fc8e[_0xcaf6('0x3b')]['fields']));_0x299185['attributes']=_0x299185[_0xcaf6('0x41')]['length']?_0x299185[_0xcaf6('0x41')]:_0x72c282[_0xcaf6('0x3a')];if(_0x14fc8e[_0xcaf6('0x3b')][_0xcaf6('0x9d')]){_0x299185['include']=[{'all':!![]}];}_0x299185=_[_0xcaf6('0x8a')]({},_0x299185,_0x14fc8e[_0xcaf6('0x9e')]);return db[_0xcaf6('0x36')][_0xcaf6('0x64')](_0x299185)['then'](handleEntityNotFound(_0x28e3db,null))['then'](respondWithResult(_0x28e3db,null))[_0xcaf6('0x34')](handleError(_0x28e3db,null));};exports[_0xcaf6('0x9f')]=function(_0x4e04aa,_0x3c01e0){return db[_0xcaf6('0x36')]['create'](_0x4e04aa[_0xcaf6('0xa0')],{})[_0xcaf6('0x2b')](respondWithResult(_0x3c01e0,0xc9))[_0xcaf6('0x34')](handleError(_0x3c01e0,null));};exports[_0xcaf6('0x2a')]=function(_0x45cd9d,_0x1c75e2){if(_0x45cd9d[_0xcaf6('0xa0')]['id']){delete _0x45cd9d[_0xcaf6('0xa0')]['id'];}return db[_0xcaf6('0x36')]['find']({'where':{'id':_0x45cd9d['params']['id']}})[_0xcaf6('0x2b')](handleEntityNotFound(_0x1c75e2,null))[_0xcaf6('0x2b')](saveUpdates(_0x45cd9d[_0xcaf6('0xa0')],null))[_0xcaf6('0x2b')](respondWithResult(_0x1c75e2,null))[_0xcaf6('0x34')](handleError(_0x1c75e2,null));};exports['destroy']=function(_0x2d0513,_0x4d91da){return db[_0xcaf6('0x36')][_0xcaf6('0x64')]({'where':{'id':_0x2d0513['params']['id']}})[_0xcaf6('0x2b')](handleEntityNotFound(_0x4d91da,null))[_0xcaf6('0x2b')](removeEntity(_0x4d91da,null))[_0xcaf6('0x34')](handleError(_0x4d91da,null));};exports[_0xcaf6('0xa1')]=function(_0x169d1b,_0x4c881d){return db['FaxInteraction'][_0xcaf6('0xa1')]()[_0xcaf6('0x2b')](respondWithResult(_0x4c881d,null))[_0xcaf6('0x34')](handleError(_0x4c881d,null));};exports[_0xcaf6('0xa2')]=function(_0x29e723,_0x4db755,_0x42ad55){return db[_0xcaf6('0xa3')][_0xcaf6('0x64')]({'where':{'id':_0x29e723[_0xcaf6('0xa4')]['id']}})[_0xcaf6('0x2b')](handleEntityNotFound(_0x4db755,null))['then'](function(_0x218928){if(_0x218928){return _0x218928[_0xcaf6('0xa2')](_0x29e723['body'][_0xcaf6('0xa5')],_['omit'](_0x29e723[_0xcaf6('0xa0')],[_0xcaf6('0xa5'),'id'])||{});}})[_0xcaf6('0x2b')](respondWithResult(_0x4db755,null))[_0xcaf6('0x34')](handleError(_0x4db755,null));};exports[_0xcaf6('0xa6')]=function(_0x723fd6,_0x5e319f,_0x27a94a){var _0x1ce177={'raw':![],'where':{}};var _0x28a2c6={};var _0x4b4888={'count':0x0,'rows':[]};return db[_0xcaf6('0x36')][_0xcaf6('0xa7')]({'where':{'id':_0x723fd6['params']['id']}})[_0xcaf6('0x2b')](handleEntityNotFound(_0x5e319f,null))[_0xcaf6('0x2b')](function(_0x532a74){if(_0x532a74){_0x28a2c6[_0xcaf6('0x3a')]=_[_0xcaf6('0x3c')](db[_0xcaf6('0xa3')][_0xcaf6('0x37')]);_0x28a2c6[_0xcaf6('0x3b')]=_[_0xcaf6('0x3c')](_0x723fd6[_0xcaf6('0x3b')]);_0x28a2c6[_0xcaf6('0x3d')]=_['intersection'](_0x28a2c6[_0xcaf6('0x3a')],_0x28a2c6[_0xcaf6('0x3b')]);_0x1ce177[_0xcaf6('0x41')]=_[_0xcaf6('0x3e')](_0x28a2c6[_0xcaf6('0x3a')],qs[_0xcaf6('0x3f')](_0x723fd6[_0xcaf6('0x3b')][_0xcaf6('0x3f')]));_0x1ce177[_0xcaf6('0x41')]=_0x1ce177[_0xcaf6('0x41')][_0xcaf6('0x40')]?_0x1ce177['attributes']:_0x28a2c6['model'];if(!_0x723fd6[_0xcaf6('0x3b')][_0xcaf6('0x42')](_0xcaf6('0xa8'))){_0x1ce177['limit']=qs[_0xcaf6('0x25')](_0x723fd6['query'][_0xcaf6('0x25')]);_0x1ce177[_0xcaf6('0x24')]=qs['offset'](_0x723fd6['query'][_0xcaf6('0x24')]);}_0x1ce177[_0xcaf6('0x43')]=qs[_0xcaf6('0x44')](_0x723fd6[_0xcaf6('0x3b')][_0xcaf6('0x44')]);_0x1ce177['where']=qs['filters'](_['pick'](_0x723fd6[_0xcaf6('0x3b')],_0x28a2c6[_0xcaf6('0x3d')]));_0x1ce177['where'][_0xcaf6('0xa9')]=_0x532a74['id'];if(_0x723fd6['query'][_0xcaf6('0x6f')]){_0x1ce177[_0xcaf6('0x76')]=_[_0xcaf6('0x8a')](_0x1ce177[_0xcaf6('0x76')],{'$or':_['map'](_0x1ce177[_0xcaf6('0x41')],function(_0x1c6e09){var _0x2a844d={};_0x2a844d[_0x1c6e09]={'$like':'%'+_0x723fd6[_0xcaf6('0x3b')][_0xcaf6('0x6f')]+'%'};return _0x2a844d;})});}if(_0x723fd6[_0xcaf6('0x3b')][_0xcaf6('0x75')]){var _0x922e00=_0x723fd6[_0xcaf6('0x3b')][_0xcaf6('0x75')][_0xcaf6('0x69')](',');var _0x1d4388={};_0x1d4388[_0x922e00[0x0]]={'$gte':moment(_0x922e00[0x1])[_0xcaf6('0xaa')](_0xcaf6('0xab'))};_0x1ce177[_0xcaf6('0x76')]=_[_0xcaf6('0x8a')](_0x1ce177[_0xcaf6('0x76')],_0x1d4388);}_0x1ce177=_['merge']({},_0x1ce177,_0x723fd6[_0xcaf6('0x9e')]);return db[_0xcaf6('0xa3')][_0xcaf6('0x23')]({'where':_0x1ce177[_0xcaf6('0x76')]})[_0xcaf6('0x2b')](function(_0xb762d6){_0x4b4888[_0xcaf6('0x23')]=_0xb762d6;if(_0x723fd6['query'][_0xcaf6('0x9d')]){_0x1ce177['include']=[{'all':!![]}];}return db[_0xcaf6('0xa3')][_0xcaf6('0xac')](_0x1ce177);})['then'](function(_0x4104ef){_0x4b4888[_0xcaf6('0x9b')]=_0x4104ef;return _0x4b4888;});}})[_0xcaf6('0x2b')](respondWithFilteredResult(_0x5e319f,_0x1ce177))[_0xcaf6('0x34')](handleError(_0x5e319f,null));};exports['addTags']=function(_0x3d49cc,_0x597b5c,_0x3fbf88){return db[_0xcaf6('0x36')]['find']({'where':{'id':_0x3d49cc[_0xcaf6('0xa4')]['id']}})[_0xcaf6('0x2b')](handleEntityNotFound(_0x597b5c,null))[_0xcaf6('0x2b')](function(_0x2879cf){if(_0x2879cf){return _0x2879cf[_0xcaf6('0xad')](_0x3d49cc[_0xcaf6('0xa0')][_0xcaf6('0xa5')],_[_0xcaf6('0xae')](_0x3d49cc['body'],[_0xcaf6('0xa5'),'id'])||{})[_0xcaf6('0xaf')](function(){return db[_0xcaf6('0xb0')]['findAll']({'attributes':['id',_0xcaf6('0x2e'),_0xcaf6('0x47')],'where':{'id':_0x3d49cc[_0xcaf6('0xa0')][_0xcaf6('0xa5')]}});})[_0xcaf6('0x2b')](function(_0x11ee80){socket[_0xcaf6('0xb1')](_0xcaf6('0xb2'),{'id':Number(_0x3d49cc[_0xcaf6('0xa4')]['id']),'tags':_0x11ee80||[]});return{'id':Number(_0x3d49cc['params']['id']),'tags':_0x11ee80||[]};});}})[_0xcaf6('0x2b')](respondWithResult(_0x597b5c,null))['catch'](handleError(_0x597b5c,null));};exports[_0xcaf6('0xb3')]=function(_0x156b81,_0x3c858d,_0x35347f){return db[_0xcaf6('0x36')][_0xcaf6('0x64')]({'where':{'id':_0x156b81[_0xcaf6('0xa4')]['id']}})[_0xcaf6('0x2b')](handleEntityNotFound(_0x3c858d,null))[_0xcaf6('0x2b')](function(_0x1a0e0d){if(_0x1a0e0d){return _0x1a0e0d[_0xcaf6('0xb3')](_0x156b81[_0xcaf6('0x3b')]['ids']);}})['then'](respondWithStatusCode(_0x3c858d,null))['catch'](handleError(_0x3c858d,null));};exports[_0xcaf6('0xb4')]=function(_0x4897f0,_0x3a0150){var _0x40b4d0=moment()['unix']()[_0xcaf6('0x88')]();var _0x32d56b=path[_0xcaf6('0xb5')](config[_0xcaf6('0xb6')],_0xcaf6('0xb7'),_0xcaf6('0xb8'),_0xcaf6('0xb9'));var _0x54772b=path[_0xcaf6('0xb5')](config[_0xcaf6('0xb6')],_0xcaf6('0xb7'),'files',_0xcaf6('0xba'));var _0x18d256=path[_0xcaf6('0xb5')](_0x54772b,_0x40b4d0);var _0x2bd295=util[_0xcaf6('0xaa')]('interaction-%s.zip',_0x40b4d0);var _0xef1eea=path[_0xcaf6('0xb5')](_0x54772b,_0x2bd295);var _0x584633=![];return db[_0xcaf6('0x36')][_0xcaf6('0x64')]({'where':{'id':_0x4897f0[_0xcaf6('0xa4')]['id']}})[_0xcaf6('0x2b')](handleEntityNotFound(_0x3a0150,null))['then'](function(_0x240784){if(_0x240784){return _0x240784[_0xcaf6('0xa6')]({'attributes':['id','body','createdAt'],'include':[{'model':db[_0xcaf6('0xbb')],'as':_0xcaf6('0xbb')}]});}return[];})[_0xcaf6('0x2b')](function(_0x3fb07b){_0x584633=_0x3fb07b['length'];if(_0x3fb07b[_0xcaf6('0x40')]){fs[_0xcaf6('0xbc')](_0x18d256);for(var _0x295fd6=0x0;_0x295fd6<_0x3fb07b[_0xcaf6('0x40')];_0x295fd6++){var _0x16f121=_0x3fb07b[_0x295fd6];var _0x21b146=_0x16f121['Attachment'];if(_0x21b146){var _0x417961=path[_0xcaf6('0xb5')](_0x32d56b,_0x21b146[_0xcaf6('0xbd')]);if(fs[_0xcaf6('0xbe')](_0x417961)){fs[_0xcaf6('0xbf')](_0x417961)[_0xcaf6('0xc0')](fs['createWriteStream'](path[_0xcaf6('0xb5')](_0x18d256,_0x21b146['basename'])));}}}}})[_0xcaf6('0x2b')](function(){if(_0x584633){return new BPromise(function(_0x58c236,_0xedbc00){zipdir(_0x18d256,{'saveTo':_0xef1eea},function(_0x3d7e48,_0x29a950){if(_0x3d7e48)return _0xedbc00(_0x3d7e48);return _0x58c236(_0x29a950);});});}})[_0xcaf6('0x2b')](function(){if(_0x584633){return new BPromise(function(_0x4f4967,_0x39e444){rimraf(_0x18d256,function(_0x49c7db){if(_0x49c7db)_0x39e444(_0x49c7db);return _0x4f4967();});});}})[_0xcaf6('0x2b')](function(){if(_0x584633){return _0x3a0150[_0xcaf6('0xb4')](_0xef1eea,_0x2bd295,function(_0x215d36){if(_0x215d36){console[_0xcaf6('0xc1')](_0xcaf6('0xc2'),_0x215d36);}else{fs[_0xcaf6('0xc3')](_0xef1eea);}});}else{return _0x3a0150[_0xcaf6('0x1f')](0xc8);}})[_0xcaf6('0x34')](handleError(_0x3a0150,null));}; \ No newline at end of file +var _0xa03c=['server','files','attachments','tmp','interaction-%s.zip','createdAt','Attachment','mkdirSync','basename','existsSync','createReadStream','pipe','createWriteStream','log','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','stack','name','send','Users','map','TagIds','forEach','Tags','push','catch','index','FaxInteraction','rawAttributes','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.id','ui.FaxInteractionId','user_has_fax_interactions','left_join','u.id\x20=\x20ui.UserId','fax_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','sqlOperator','find','having','Contact','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','value','buildExpression','type','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','compact','FaxAccountId','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','read','isArray','tag','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?','i.id','Sequelize','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','DESC','t.id\x20IN\x20?','sequelize','toString','keyBy','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','FaxInteractionId','all','rows','params','includeAll','include','merge','options','create','body','update','describe','addMessage','FaxMessage','ids','getMessages','hasOwnProperty','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','findAll','spread','Tag','emit','faxInteractionTags:save','removeTags','download','unix','join','root'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa03c,0xd4));var _0xca03=function(_0x30580b,_0x50f369){_0x30580b=_0x30580b-0x0;var _0x44a0d3=_0xa03c[_0x30580b];return _0x44a0d3;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xca03('0x0'));var rimraf=require(_0xca03('0x1'));var zipdir=require(_0xca03('0x2'));var jsonpatch=require(_0xca03('0x3'));var rp=require('request-promise');var moment=require(_0xca03('0x4'));var BPromise=require(_0xca03('0x5'));var Mustache=require(_0xca03('0x6'));var util=require(_0xca03('0x7'));var path=require(_0xca03('0x8'));var sox=require(_0xca03('0x9'));var csv=require(_0xca03('0xa'));var ejs=require(_0xca03('0xb'));var fs=require('fs');var _=require(_0xca03('0xc'));var squel=require('squel');var crypto=require(_0xca03('0xd'));var jsforce=require(_0xca03('0xe'));var deskjs=require(_0xca03('0xf'));var toCsv=require(_0xca03('0xa'));var querystring=require('querystring');var Papa=require(_0xca03('0x10'));var Redis=require(_0xca03('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xca03('0x12'));var as=require(_0xca03('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xca03('0x14'))(_0xca03('0x15'));var utils=require(_0xca03('0x16'));var config=require(_0xca03('0x17'));var db=require(_0xca03('0x18'))['db'];config[_0xca03('0x19')]=_['defaults'](config[_0xca03('0x19')],{'host':_0xca03('0x1a'),'port':0x18eb});var socket=require(_0xca03('0x1b'))(new Redis(config[_0xca03('0x19')]));require(_0xca03('0x1c'))[_0xca03('0x1d')](socket);function respondWithStatusCode(_0x4c368d,_0x532042){_0x532042=_0x532042||0xcc;return function(_0x1439f8){if(_0x1439f8){return _0x4c368d[_0xca03('0x1e')](_0x532042);}return _0x4c368d[_0xca03('0x1f')](_0x532042)[_0xca03('0x20')]();};}function respondWithResult(_0x446f8b,_0x103f8b){_0x103f8b=_0x103f8b||0xc8;return function(_0x15a798){if(_0x15a798){return _0x446f8b['status'](_0x103f8b)[_0xca03('0x21')](_0x15a798);}};}function respondWithFilteredResult(_0x4da2a0,_0x477327){return function(_0x2aad04){if(_0x2aad04){var _0x28c8c2=_0x2aad04[_0xca03('0x22')],_0x41ee94=_0x477327[_0xca03('0x23')],_0x12cb68=_0x477327[_0xca03('0x23')]+_0x477327[_0xca03('0x24')],_0x2d4e53;if(_0x12cb68>=_0x28c8c2){_0x12cb68=_0x28c8c2;_0x2d4e53=0xc8;}else{_0x2d4e53=0xce;}_0x4da2a0['status'](_0x2d4e53);return _0x4da2a0[_0xca03('0x25')](_0xca03('0x26'),_0x41ee94+'-'+_0x12cb68+'/'+_0x28c8c2)['json'](_0x2aad04);}return null;};}function patchUpdates(_0x4bef62){return function(_0x4b61c0){try{jsonpatch[_0xca03('0x27')](_0x4b61c0,_0x4bef62,!![]);}catch(_0x7fb692){return BPromise[_0xca03('0x28')](_0x7fb692);}return _0x4b61c0[_0xca03('0x29')]();};}function saveUpdates(_0x514c48,_0x28c13a){return function(_0x4d6505){if(_0x4d6505){return _0x4d6505['update'](_0x514c48)[_0xca03('0x2a')](function(_0x41108e){return _0x41108e;});}return null;};}function removeEntity(_0x6efa2f,_0x525526){return function(_0x29bc53){if(_0x29bc53){return _0x29bc53[_0xca03('0x2b')]()[_0xca03('0x2a')](function(){_0x6efa2f[_0xca03('0x1f')](0xcc)[_0xca03('0x20')]();});}};}function handleEntityNotFound(_0x492db1,_0x2aa06f){return function(_0x9fb980){if(!_0x9fb980){_0x492db1[_0xca03('0x1e')](0x194);}return _0x9fb980;};}function handleError(_0x2c9803,_0xedb57d){_0xedb57d=_0xedb57d||0x1f4;return function(_0x13e22f){logger['error'](_0x13e22f[_0xca03('0x2c')]);if(_0x13e22f[_0xca03('0x2d')]){delete _0x13e22f['name'];}_0x2c9803[_0xca03('0x1f')](_0xedb57d)[_0xca03('0x2e')](_0x13e22f);};}function getInteractionUsers(_0x4e19d8,_0x5f3cd6){return new BPromise(function(_0x42d255,_0x4a8e60){try{if(_0x5f3cd6[_0x4e19d8['id']]){_0x4e19d8[_0xca03('0x2f')]=_[_0xca03('0x30')](_0x5f3cd6[_0x4e19d8['id']],function(_0x5281bb){return{'id':_0x5281bb['id']};});}}catch(_0x2dbd18){_0x4a8e60(_0x2dbd18);}_0x42d255(_0x4e19d8);});}function getInteractionTags(_0x51a80d,_0xb64de){return new BPromise(function(_0x342835,_0x2c33bb){try{if(_0x51a80d['TagIds']){_0x51a80d['Tags']=[];_0x51a80d[_0xca03('0x31')]['split'](',')[_0xca03('0x32')](function(_0x5774d5){_0x51a80d[_0xca03('0x33')][_0xca03('0x34')](_0xb64de[_0x5774d5]);});}delete _0x51a80d[_0xca03('0x31')];}catch(_0x1605ee){_0x2c33bb(_0x1605ee);}_0x342835(_0x51a80d);});}function updateFaxInteraction(_0x2746e4,_0x23fdb6,_0x33fa28){return new BPromise(function(_0x4da61a,_0x1dbaef){return getInteractionUsers(_0x2746e4,_0x33fa28)[_0xca03('0x2a')](function(_0x50c33c){return getInteractionTags(_0x50c33c,_0x23fdb6);})[_0xca03('0x2a')](function(_0xd0b266){_0x4da61a(_0xd0b266);})[_0xca03('0x35')](function(_0x1f9ce9){_0x1dbaef(_0x1f9ce9);});});}exports[_0xca03('0x36')]=function(_0x147b0e,_0x2e2310){var _0x1a8c6a={},_0x4cf188={},_0x3d7bca={'count':0x0,'rows':[]};var _0x296962=_[_0xca03('0x30')](db[_0xca03('0x37')][_0xca03('0x38')],function(_0x33d33a){return{'name':_0x33d33a['fieldName'],'type':_0x33d33a['type']['key']};});_0x4cf188['model']=_['map'](_0x296962,'name');_0x4cf188[_0xca03('0x39')]=_[_0xca03('0x3a')](_0x147b0e[_0xca03('0x39')]);_0x4cf188[_0xca03('0x3b')]=_[_0xca03('0x3c')](_0x4cf188[_0xca03('0x3d')],_0x4cf188[_0xca03('0x39')]);_0x1a8c6a[_0xca03('0x3e')]=_[_0xca03('0x3c')](_0x4cf188[_0xca03('0x3d')],qs[_0xca03('0x3f')](_0x147b0e[_0xca03('0x39')]['fields']));_0x1a8c6a[_0xca03('0x3e')]=_0x1a8c6a['attributes'][_0xca03('0x40')]?_0x1a8c6a[_0xca03('0x3e')]:_0x4cf188['model'];if(!_0x147b0e[_0xca03('0x39')]['hasOwnProperty'](_0xca03('0x41'))){_0x1a8c6a[_0xca03('0x24')]=qs[_0xca03('0x24')](_0x147b0e['query'][_0xca03('0x24')]);_0x1a8c6a[_0xca03('0x23')]=qs[_0xca03('0x23')](_0x147b0e[_0xca03('0x39')][_0xca03('0x23')]);}_0x1a8c6a[_0xca03('0x42')]=qs['sort'](_0x147b0e[_0xca03('0x39')][_0xca03('0x43')]);_0x1a8c6a[_0xca03('0x44')]=qs[_0xca03('0x3b')](_[_0xca03('0x45')](_0x147b0e['query'],_0x4cf188[_0xca03('0x3b')]));var _0x1209e3=[];var _0x57e8e5=squel[_0xca03('0x46')]()[_0xca03('0x47')]('id')[_0xca03('0x47')](_0xca03('0x2d'))[_0xca03('0x47')](_0xca03('0x48'))[_0xca03('0x49')](_0xca03('0x4a'));var _0x5c7467=squel[_0xca03('0x46')]()['field'](_0xca03('0x4b'))[_0xca03('0x47')](_0xca03('0x4c'))[_0xca03('0x49')](_0xca03('0x4d'),'ui')[_0xca03('0x4e')]('users','u',_0xca03('0x4f'));var _0x5a0e93=squel[_0xca03('0x46')]()[_0xca03('0x49')](_0xca03('0x50'),'i')[_0xca03('0x4e')](_0xca03('0x51'),'c',_0xca03('0x52'))[_0xca03('0x4e')](_0xca03('0x53'),'o',_0xca03('0x54'))[_0xca03('0x4e')](_0xca03('0x55'),'a',_0xca03('0x56'))['left_join'](_0xca03('0x57'),'me',_0xca03('0x58'))[_0xca03('0x4e')](_0xca03('0x59'),'it','it.FaxInteractionId\x20=\x20i.id')[_0xca03('0x4e')](_0xca03('0x4a'),'t',_0xca03('0x5a'));var _0x415516=squel[_0xca03('0x5b')]();var _0x1ac9dd=[];var _0x28874a=squel['expr']();if(_0x147b0e[_0xca03('0x39')][_0xca03('0x5c')]){var _0x1470d3=as['parseSearch'](_0x147b0e[_0xca03('0x39')][_0xca03('0x5c')]);var _0x496ed4=_0x1470d3[_0xca03('0x5d')];for(var _0x23c6f2=0x0;_0x23c6f2<_0x1470d3['conditions'][_0xca03('0x40')];_0x23c6f2++){var _0x6aad8e=_0x1470d3['conditions'][_0x23c6f2];var _0xa5338b='i';var _0xf34e22=_[_0xca03('0x5e')](_0x296962,[_0xca03('0x2d'),_0x6aad8e[_0xca03('0x47')]]);if(!_0xf34e22){switch(_0x6aad8e[_0xca03('0x47')]){case'unreadMessages':if(_0x6aad8e['value']==0x1){_0x5a0e93[_0xca03('0x5f')]('`'+_0x6aad8e[_0xca03('0x47')]+'`\x20=\x200');}else{_0x5a0e93[_0xca03('0x5f')]('`'+_0x6aad8e[_0xca03('0x47')]+'`\x20>\x200');}break;case _0xca03('0x60'):if(_0x6aad8e['operator']==='$substring'){_0x415516[_0x496ed4](_0xca03('0x61'),_0x6aad8e[_0xca03('0x62')],null);}else{_0xf34e22=_[_0xca03('0x5e')](_0x296962,[_0xca03('0x2d'),'ContactId']);_0x6aad8e[_0xca03('0x47')]='ContactId';_0x5d4dfc=as[_0xca03('0x63')](_0xa5338b,_0xf34e22[_0xca03('0x64')],_0x6aad8e);_0x415516[_0x496ed4](_0x5d4dfc[_0xca03('0x65')],_0x5d4dfc['value'][_0xca03('0x66')],_0x5d4dfc[_0xca03('0x62')][_0xca03('0x20')]);}break;case'Tag':var _0x4da450=_0x6aad8e[_0xca03('0x62')]['split'](',')[_0xca03('0x30')](function(_0x2a2688){return Number(_0x2a2688);});_0x4da450[_0xca03('0x32')](function(_0x3f7b52){_0x28874a['or'](_0xca03('0x67'),'%,'+_0x3f7b52+',%');});_0x1ac9dd=_['union'](_0x1ac9dd,_0x4da450);break;case _0xca03('0x68'):if(_0x6aad8e['operator']===_0xca03('0x69')){_0x415516[_0x496ed4](_0xca03('0x6a'),'%'+_0x6aad8e[_0xca03('0x62')]+'%',null);}else{_0xf34e22=_[_0xca03('0x5e')](_0x296962,[_0xca03('0x2d'),_0xca03('0x6b')]);_0x6aad8e[_0xca03('0x47')]=_0xca03('0x6b');_0x5d4dfc=as[_0xca03('0x63')](_0xa5338b,_0xf34e22[_0xca03('0x64')],_0x6aad8e);_0x415516[_0x496ed4](_0x5d4dfc[_0xca03('0x65')],_0x5d4dfc[_0xca03('0x62')][_0xca03('0x66')],_0x5d4dfc[_0xca03('0x62')]['end']);}break;}}else{var _0x5d4dfc=as[_0xca03('0x63')](_0xa5338b,_0xf34e22['type'],_0x6aad8e);_0x415516[_0x496ed4](_0x5d4dfc[_0xca03('0x65')],_0x5d4dfc[_0xca03('0x62')]['start'],_0x5d4dfc[_0xca03('0x62')]['end']);}}}else{var _0x52fecc=_(_0x147b0e[_0xca03('0x39')])['keys']()[_0xca03('0x30')](function(_0x5f5852){return _['some'](_0x296962,[_0xca03('0x2d'),_0x5f5852])?_0x5f5852:undefined;})[_0xca03('0x6c')]()[_0xca03('0x62')]();if(!_['isEmpty'](_0x52fecc)){_0x52fecc[_0xca03('0x32')](function(_0x2c9fa6){if(_0x2c9fa6===_0xca03('0x6d')){_0x5a0e93[_0xca03('0x44')]('i.FaxAccountId\x20IN\x20?',[]['concat'](_0x147b0e['query'][_0x2c9fa6]));}else if(_0x2c9fa6==='createdAt'){var _0x2b985d=JSON[_0xca03('0x6e')](_0x147b0e[_0xca03('0x39')][_0x2c9fa6])['$gte'];var _0x288033=JSON[_0xca03('0x6e')](_0x147b0e[_0xca03('0x39')][_0x2c9fa6])[_0xca03('0x6f')];_0x5a0e93[_0xca03('0x44')](_0xca03('0x70'),_0x2b985d,_0x288033);}else{if(_0x147b0e[_0xca03('0x39')][_0x2c9fa6]===_0xca03('0x71')){_0x5a0e93[_0xca03('0x44')]('i.'+_0x2c9fa6+'\x20IS\x20NULL');}else{_0x5a0e93['where']('i.'+_0x2c9fa6+'\x20=\x20?',_0x147b0e[_0xca03('0x39')][_0x2c9fa6]);}}});}if(_0x147b0e[_0xca03('0x39')][_0xca03('0x72')]){if(_0x147b0e['query'][_0xca03('0x72')]==0x1){_0x5a0e93[_0xca03('0x5f')]('`unreadMessages`\x20=\x200');}else{_0x5a0e93[_0xca03('0x5f')]('`unreadMessages`\x20>\x200');}}if(_0x147b0e[_0xca03('0x39')]['tag']){_0x1ac9dd=_[_0xca03('0x73')](_0x147b0e['query'][_0xca03('0x74')])?_0x147b0e['query'][_0xca03('0x74')]:new Array(_0x147b0e['query'][_0xca03('0x74')]);_0x1ac9dd[_0xca03('0x32')](function(_0xf1d4a9){_0x28874a['or'](_0xca03('0x67'),'%,'+_0xf1d4a9+',%');});}if(_0x147b0e[_0xca03('0x39')]['filter']){var _0x392f26=_0x147b0e[_0xca03('0x39')]['filter'][_0xca03('0x75')]('\x5c','\x5c\x5c')[_0xca03('0x75')]('\x27\x27',_0xca03('0x76'));if(qs[_0xca03('0x77')](_0x392f26)){_0x415516['or'](_0xca03('0x78'),_0x392f26+'%')['or'](_0xca03('0x79'),_0x392f26+'%');}_0x415516['or'](_0xca03('0x7a'),_0x392f26+'%');}}_0x5a0e93[_0xca03('0x44')](_0x415516);_0x5a0e93['group'](_0xca03('0x7b'));var _0x49d1ff={'type':db[_0xca03('0x7c')]['QueryTypes']['SELECT'],'raw':!![]};var _0xae7297=_0x5a0e93[_0xca03('0x7d')]();_0xae7297[_0xca03('0x47')](_0xca03('0x7b'));_0xae7297[_0xca03('0x47')](_0xca03('0x7e'),_0xca03('0x7f'));if(_0x1a8c6a[_0xca03('0x42')]){_0x1a8c6a[_0xca03('0x42')][_0xca03('0x32')](function(_0x49a458){_0x5a0e93[_0xca03('0x42')]('i.'+_0x49a458[0x0],_0x49a458[0x1]===_0xca03('0x80')?![]:!![]);});}if(!_['isEmpty'](_0x1ac9dd)){_0x5a0e93[_0xca03('0x5f')](_0x28874a);_0xae7297[_0xca03('0x44')](_0xca03('0x81'),_0x1ac9dd);}db[_0xca03('0x82')][_0xca03('0x39')](_0xae7297[_0xca03('0x83')](),_0x49d1ff)[_0xca03('0x2a')](function(_0x43a16c){_0x3d7bca[_0xca03('0x22')]=_0x43a16c[_0xca03('0x40')];if(_0x3d7bca[_0xca03('0x22')]===0x0)return[];return db[_0xca03('0x82')][_0xca03('0x39')](_0x57e8e5[_0xca03('0x83')](),_0x49d1ff)[_0xca03('0x2a')](function(_0xbfef89){_0x1209e3=_[_0xca03('0x84')](_0xbfef89,'id');_0x49d1ff=_['merge'](_0x49d1ff,{'model':db[_0xca03('0x37')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x5a0e93['field'](_0xca03('0x7e'),_0xca03('0x7f'));_0x5a0e93[_0xca03('0x47')](_0xca03('0x85'),_0xca03('0x86'));_0x5a0e93[_0xca03('0x47')](_0xca03('0x87'),_0xca03('0x88'));_0x5a0e93['field'](_0xca03('0x89'));_0x5a0e93[_0xca03('0x47')](_0xca03('0x8a'),'Contact.firstName');_0x5a0e93[_0xca03('0x47')](_0xca03('0x8b'),_0xca03('0x8c'));_0x5a0e93[_0xca03('0x47')](_0xca03('0x8d'),_0xca03('0x8e'));_0x5a0e93[_0xca03('0x47')](_0xca03('0x8f'),_0xca03('0x90'));_0x5a0e93[_0xca03('0x47')](_0xca03('0x91'),_0xca03('0x92'));_0x5a0e93[_0xca03('0x47')](_0xca03('0x93'),'Contact.fax');_0x5a0e93[_0xca03('0x47')](_0xca03('0x94'),_0xca03('0x31'));_0x5a0e93[_0xca03('0x24')](_0x1a8c6a[_0xca03('0x24')]);_0x5a0e93[_0xca03('0x23')](_0x1a8c6a[_0xca03('0x23')]);return db[_0xca03('0x82')][_0xca03('0x39')](_0x5a0e93[_0xca03('0x83')](),_0x49d1ff);})[_0xca03('0x2a')](function(_0x9a6d9e){_0x5c7467[_0xca03('0x44')](_0xca03('0x95'),_[_0xca03('0x30')](_0x9a6d9e,'id'));return db[_0xca03('0x82')][_0xca03('0x39')](_0x5c7467['toString'](),_0x49d1ff)[_0xca03('0x2a')](function(_0x272f7b){var _0x2bec3c=_['groupBy'](_0x272f7b,_0xca03('0x96'));var _0x1f24c9=[];_0x9a6d9e[_0xca03('0x32')](function(_0x376277){_0x1f24c9[_0xca03('0x34')](updateFaxInteraction(_0x376277,_0x1209e3,_0x2bec3c));});return BPromise[_0xca03('0x97')](_0x1f24c9);});});})['then'](function(_0x30b4c6){_0x3d7bca[_0xca03('0x98')]=_0x30b4c6;return _0x3d7bca;})['then'](respondWithFilteredResult(_0x2e2310,_0x1a8c6a))[_0xca03('0x35')](handleError(_0x2e2310,null));};exports['show']=function(_0x130b3f,_0x434991){var _0x1cebb2={'raw':![],'where':{'id':_0x130b3f[_0xca03('0x99')]['id']}},_0x518dde={};_0x518dde['model']=_[_0xca03('0x3a')](db[_0xca03('0x37')][_0xca03('0x38')]);_0x518dde[_0xca03('0x39')]=_[_0xca03('0x3a')](_0x130b3f[_0xca03('0x39')]);_0x518dde[_0xca03('0x3b')]=_['intersection'](_0x518dde[_0xca03('0x3d')],_0x518dde['query']);_0x1cebb2['attributes']=_[_0xca03('0x3c')](_0x518dde[_0xca03('0x3d')],qs[_0xca03('0x3f')](_0x130b3f[_0xca03('0x39')][_0xca03('0x3f')]));_0x1cebb2[_0xca03('0x3e')]=_0x1cebb2[_0xca03('0x3e')][_0xca03('0x40')]?_0x1cebb2['attributes']:_0x518dde['model'];if(_0x130b3f[_0xca03('0x39')][_0xca03('0x9a')]){_0x1cebb2[_0xca03('0x9b')]=[{'all':!![]}];}_0x1cebb2=_[_0xca03('0x9c')]({},_0x1cebb2,_0x130b3f[_0xca03('0x9d')]);return db[_0xca03('0x37')][_0xca03('0x5e')](_0x1cebb2)[_0xca03('0x2a')](handleEntityNotFound(_0x434991,null))[_0xca03('0x2a')](respondWithResult(_0x434991,null))['catch'](handleError(_0x434991,null));};exports['create']=function(_0x406694,_0x414db4){return db[_0xca03('0x37')][_0xca03('0x9e')](_0x406694[_0xca03('0x9f')],{})['then'](respondWithResult(_0x414db4,0xc9))['catch'](handleError(_0x414db4,null));};exports[_0xca03('0xa0')]=function(_0x2dec1d,_0x3806ca){if(_0x2dec1d[_0xca03('0x9f')]['id']){delete _0x2dec1d['body']['id'];}return db['FaxInteraction'][_0xca03('0x5e')]({'where':{'id':_0x2dec1d[_0xca03('0x99')]['id']}})[_0xca03('0x2a')](handleEntityNotFound(_0x3806ca,null))['then'](saveUpdates(_0x2dec1d[_0xca03('0x9f')],null))[_0xca03('0x2a')](respondWithResult(_0x3806ca,null))[_0xca03('0x35')](handleError(_0x3806ca,null));};exports[_0xca03('0x2b')]=function(_0x50a399,_0x45da98){return db[_0xca03('0x37')][_0xca03('0x5e')]({'where':{'id':_0x50a399[_0xca03('0x99')]['id']}})[_0xca03('0x2a')](handleEntityNotFound(_0x45da98,null))[_0xca03('0x2a')](removeEntity(_0x45da98,null))[_0xca03('0x35')](handleError(_0x45da98,null));};exports[_0xca03('0xa1')]=function(_0x23230f,_0x57861e){return db[_0xca03('0x37')][_0xca03('0xa1')]()['then'](respondWithResult(_0x57861e,null))['catch'](handleError(_0x57861e,null));};exports[_0xca03('0xa2')]=function(_0x5ea549,_0x2a40b6,_0x840068){return db[_0xca03('0xa3')][_0xca03('0x5e')]({'where':{'id':_0x5ea549[_0xca03('0x99')]['id']}})[_0xca03('0x2a')](handleEntityNotFound(_0x2a40b6,null))[_0xca03('0x2a')](function(_0x427e92){if(_0x427e92){return _0x427e92[_0xca03('0xa2')](_0x5ea549['body'][_0xca03('0xa4')],_['omit'](_0x5ea549[_0xca03('0x9f')],[_0xca03('0xa4'),'id'])||{});}})[_0xca03('0x2a')](respondWithResult(_0x2a40b6,null))[_0xca03('0x35')](handleError(_0x2a40b6,null));};exports[_0xca03('0xa5')]=function(_0x20c7b6,_0x1daf16,_0x4f84ec){var _0x851a18={'raw':![],'where':{}};var _0x5db5a1={};var _0x9f330c={'count':0x0,'rows':[]};return db['FaxInteraction']['findOne']({'where':{'id':_0x20c7b6[_0xca03('0x99')]['id']}})[_0xca03('0x2a')](handleEntityNotFound(_0x1daf16,null))[_0xca03('0x2a')](function(_0x33fe4d){if(_0x33fe4d){_0x5db5a1[_0xca03('0x3d')]=_[_0xca03('0x3a')](db['FaxMessage'][_0xca03('0x38')]);_0x5db5a1[_0xca03('0x39')]=_['keys'](_0x20c7b6[_0xca03('0x39')]);_0x5db5a1[_0xca03('0x3b')]=_[_0xca03('0x3c')](_0x5db5a1['model'],_0x5db5a1[_0xca03('0x39')]);_0x851a18['attributes']=_[_0xca03('0x3c')](_0x5db5a1[_0xca03('0x3d')],qs[_0xca03('0x3f')](_0x20c7b6[_0xca03('0x39')][_0xca03('0x3f')]));_0x851a18['attributes']=_0x851a18[_0xca03('0x3e')][_0xca03('0x40')]?_0x851a18[_0xca03('0x3e')]:_0x5db5a1[_0xca03('0x3d')];if(!_0x20c7b6[_0xca03('0x39')][_0xca03('0xa6')](_0xca03('0x41'))){_0x851a18[_0xca03('0x24')]=qs[_0xca03('0x24')](_0x20c7b6[_0xca03('0x39')][_0xca03('0x24')]);_0x851a18[_0xca03('0x23')]=qs[_0xca03('0x23')](_0x20c7b6['query'][_0xca03('0x23')]);}_0x851a18[_0xca03('0x42')]=qs[_0xca03('0x43')](_0x20c7b6['query'][_0xca03('0x43')]);_0x851a18[_0xca03('0x44')]=qs[_0xca03('0x3b')](_['pick'](_0x20c7b6[_0xca03('0x39')],_0x5db5a1[_0xca03('0x3b')]));_0x851a18[_0xca03('0x44')][_0xca03('0x96')]=_0x33fe4d['id'];if(_0x20c7b6[_0xca03('0x39')][_0xca03('0xa7')]){_0x851a18[_0xca03('0x44')]=_[_0xca03('0x9c')](_0x851a18[_0xca03('0x44')],{'$or':_[_0xca03('0x30')](_0x851a18['attributes'],function(_0x226bc8){var _0x3b2875={};_0x3b2875[_0x226bc8]={'$like':'%'+_0x20c7b6[_0xca03('0x39')][_0xca03('0xa7')]+'%'};return _0x3b2875;})});}if(_0x20c7b6[_0xca03('0x39')][_0xca03('0xa8')]){var _0x4e489a=_0x20c7b6[_0xca03('0x39')]['$gte'][_0xca03('0xa9')](',');var _0x59a263={};_0x59a263[_0x4e489a[0x0]]={'$gte':moment(_0x4e489a[0x1])[_0xca03('0xaa')](_0xca03('0xab'))};_0x851a18[_0xca03('0x44')]=_[_0xca03('0x9c')](_0x851a18[_0xca03('0x44')],_0x59a263);}_0x851a18=_['merge']({},_0x851a18,_0x20c7b6[_0xca03('0x9d')]);return db[_0xca03('0xa3')][_0xca03('0x22')]({'where':_0x851a18[_0xca03('0x44')]})['then'](function(_0x481aa6){_0x9f330c[_0xca03('0x22')]=_0x481aa6;if(_0x20c7b6[_0xca03('0x39')][_0xca03('0x9a')]){_0x851a18['include']=[{'all':!![]}];}return db[_0xca03('0xa3')][_0xca03('0xac')](_0x851a18);})[_0xca03('0x2a')](function(_0x152e05){_0x9f330c[_0xca03('0x98')]=_0x152e05;return _0x9f330c;});}})[_0xca03('0x2a')](respondWithFilteredResult(_0x1daf16,_0x851a18))['catch'](handleError(_0x1daf16,null));};exports['addTags']=function(_0x31127d,_0x21c8c3,_0x1d9468){return db[_0xca03('0x37')]['find']({'where':{'id':_0x31127d[_0xca03('0x99')]['id']}})[_0xca03('0x2a')](handleEntityNotFound(_0x21c8c3,null))[_0xca03('0x2a')](function(_0x531c60){if(_0x531c60){return _0x531c60['setTags'](_0x31127d[_0xca03('0x9f')][_0xca03('0xa4')],_['omit'](_0x31127d['body'],[_0xca03('0xa4'),'id'])||{})[_0xca03('0xad')](function(){return db[_0xca03('0xae')][_0xca03('0xac')]({'attributes':['id',_0xca03('0x2d'),'color'],'where':{'id':_0x31127d['body'][_0xca03('0xa4')]}});})[_0xca03('0x2a')](function(_0xf03b7){socket[_0xca03('0xaf')](_0xca03('0xb0'),{'id':Number(_0x31127d[_0xca03('0x99')]['id']),'tags':_0xf03b7||[]});return{'id':Number(_0x31127d['params']['id']),'tags':_0xf03b7||[]};});}})[_0xca03('0x2a')](respondWithResult(_0x21c8c3,null))[_0xca03('0x35')](handleError(_0x21c8c3,null));};exports[_0xca03('0xb1')]=function(_0x3b48cd,_0x185051,_0x1ff454){return db[_0xca03('0x37')][_0xca03('0x5e')]({'where':{'id':_0x3b48cd['params']['id']}})[_0xca03('0x2a')](handleEntityNotFound(_0x185051,null))[_0xca03('0x2a')](function(_0x4d4dbe){if(_0x4d4dbe){return _0x4d4dbe[_0xca03('0xb1')](_0x3b48cd[_0xca03('0x39')][_0xca03('0xa4')]);}})['then'](respondWithStatusCode(_0x185051,null))[_0xca03('0x35')](handleError(_0x185051,null));};exports[_0xca03('0xb2')]=function(_0x53328b,_0x229ce2){var _0x31c806=moment()[_0xca03('0xb3')]()[_0xca03('0x83')]();var _0x19262d=path[_0xca03('0xb4')](config[_0xca03('0xb5')],_0xca03('0xb6'),_0xca03('0xb7'),_0xca03('0xb8'));var _0xd2cc47=path[_0xca03('0xb4')](config[_0xca03('0xb5')],'server',_0xca03('0xb7'),_0xca03('0xb9'));var _0x113a06=path[_0xca03('0xb4')](_0xd2cc47,_0x31c806);var _0x5c9d3a=util[_0xca03('0xaa')](_0xca03('0xba'),_0x31c806);var _0x47d60c=path[_0xca03('0xb4')](_0xd2cc47,_0x5c9d3a);var _0x18ac4d=![];return db[_0xca03('0x37')][_0xca03('0x5e')]({'where':{'id':_0x53328b[_0xca03('0x99')]['id']}})[_0xca03('0x2a')](handleEntityNotFound(_0x229ce2,null))['then'](function(_0x1b730f){if(_0x1b730f){return _0x1b730f[_0xca03('0xa5')]({'attributes':['id',_0xca03('0x9f'),_0xca03('0xbb')],'include':[{'model':db[_0xca03('0xbc')],'as':_0xca03('0xbc')}]});}return[];})[_0xca03('0x2a')](function(_0x3ec788){_0x18ac4d=_0x3ec788[_0xca03('0x40')];if(_0x3ec788[_0xca03('0x40')]){fs[_0xca03('0xbd')](_0x113a06);for(var _0x327165=0x0;_0x327165<_0x3ec788[_0xca03('0x40')];_0x327165++){var _0x1f9847=_0x3ec788[_0x327165];var _0x22a011=_0x1f9847['Attachment'];if(_0x22a011){var _0x4f05c6=path[_0xca03('0xb4')](_0x19262d,_0x22a011[_0xca03('0xbe')]);if(fs[_0xca03('0xbf')](_0x4f05c6)){fs[_0xca03('0xc0')](_0x4f05c6)[_0xca03('0xc1')](fs[_0xca03('0xc2')](path[_0xca03('0xb4')](_0x113a06,_0x22a011[_0xca03('0xbe')])));}}}}})[_0xca03('0x2a')](function(){if(_0x18ac4d){return new BPromise(function(_0x2c6eb4,_0x408e42){zipdir(_0x113a06,{'saveTo':_0x47d60c},function(_0x1e6d5,_0x5298d0){if(_0x1e6d5)return _0x408e42(_0x1e6d5);return _0x2c6eb4(_0x5298d0);});});}})[_0xca03('0x2a')](function(){if(_0x18ac4d){return new BPromise(function(_0x1b0581,_0x177f5c){rimraf(_0x113a06,function(_0x235cc2){if(_0x235cc2)_0x177f5c(_0x235cc2);return _0x1b0581();});});}})[_0xca03('0x2a')](function(){if(_0x18ac4d){return _0x229ce2[_0xca03('0xb2')](_0x47d60c,_0x5c9d3a,function(_0x217bda){if(_0x217bda){console[_0xca03('0xc3')]('err',_0x217bda);}else{fs[_0xca03('0xc4')](_0x47d60c);}});}else{return _0x229ce2['sendStatus'](0xc8);}})[_0xca03('0x35')](handleError(_0x229ce2,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 84b1b6e..ceef93f 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 _0x2fed=['events','../../mysqldb','FaxInteraction','FaxMessage','save','update','getUsers','setDataValue','Users','findAll','then','length','emit','catch','hasOwnProperty','hook','exports'];(function(_0x2d2a2b,_0x523936){var _0xabf4fb=function(_0xaac416){while(--_0xaac416){_0x2d2a2b['push'](_0x2d2a2b['shift']());}};_0xabf4fb(++_0x523936);}(_0x2fed,0x1ed));var _0xd2fe=function(_0x1a0ac3,_0x593313){_0x1a0ac3=_0x1a0ac3-0x0;var _0x3d9f82=_0x2fed[_0x1a0ac3];return _0x3d9f82;};'use strict';var EventEmitter=require(_0xd2fe('0x0'));var FaxInteraction=require(_0xd2fe('0x1'))['db'][_0xd2fe('0x2')];var FaxMessage=require('../../mysqldb')['db'][_0xd2fe('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd2fe('0x4'),'afterUpdate':_0xd2fe('0x5'),'afterDestroy':'remove'};function emitEvent(_0x189e00){return function(_0x54c163,_0x4ca174,_0x2108bd){_0x54c163[_0xd2fe('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x3e7d47){_0x54c163[_0xd2fe('0x7')](_0xd2fe('0x8'),_0x3e7d47['map'](function(_0x39781d){return{'id':_0x39781d['id']};}));return FaxMessage[_0xd2fe('0x9')]({'where':{'FaxInteractionId':_0x54c163['id'],'direction':'in','read':![]},'raw':!![]});})[_0xd2fe('0xa')](function(_0x4a5b77){_0x54c163[_0xd2fe('0x7')]('unreadMessages',_0x4a5b77[_0xd2fe('0xb')]);FaxInteractionEvents[_0xd2fe('0xc')](_0x189e00+':'+_0x54c163['id'],_0x54c163);FaxInteractionEvents['emit'](_0x189e00,_0x54c163);_0x2108bd(null);})[_0xd2fe('0xd')](_0x2108bd(null));};}for(var e in events){if(events[_0xd2fe('0xe')](e)){var event=events[e];FaxInteraction[_0xd2fe('0xf')](e,emitEvent(event));}}module[_0xd2fe('0x10')]=FaxInteractionEvents; \ No newline at end of file +var _0xd259=['../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','save','update','getUsers','then','Users','map','findAll','unreadMessages','emit','hasOwnProperty','hook','exports','events'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xd259,0xed));var _0x9d25=function(_0xf6502e,_0x1cd6d7){_0xf6502e=_0xf6502e-0x0;var _0xd01708=_0xd259[_0xf6502e];return _0xd01708;};'use strict';var EventEmitter=require(_0x9d25('0x0'));var FaxInteraction=require(_0x9d25('0x1'))['db'][_0x9d25('0x2')];var FaxMessage=require(_0x9d25('0x1'))['db'][_0x9d25('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x9d25('0x4')](0x0);var events={'afterCreate':_0x9d25('0x5'),'afterUpdate':_0x9d25('0x6'),'afterDestroy':'remove'};function emitEvent(_0x55d467){return function(_0x70a03c,_0x23097e,_0x374984){_0x70a03c[_0x9d25('0x7')]({'attributes':['id'],'raw':!![]})[_0x9d25('0x8')](function(_0x1acaac){_0x70a03c['setDataValue'](_0x9d25('0x9'),_0x1acaac[_0x9d25('0xa')](function(_0x4965a2){return{'id':_0x4965a2['id']};}));return FaxMessage[_0x9d25('0xb')]({'where':{'FaxInteractionId':_0x70a03c['id'],'direction':'in','read':![]},'raw':!![]});})[_0x9d25('0x8')](function(_0x662868){_0x70a03c['setDataValue'](_0x9d25('0xc'),_0x662868['length']);FaxInteractionEvents[_0x9d25('0xd')](_0x55d467+':'+_0x70a03c['id'],_0x70a03c);FaxInteractionEvents[_0x9d25('0xd')](_0x55d467,_0x70a03c);_0x374984(null);})['catch'](_0x374984(null));};}for(var e in events){if(events[_0x9d25('0xe')](e)){var event=events[e];FaxInteraction[_0x9d25('0xf')](e,emitEvent(event));}}module[_0x9d25('0x10')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 8d4ae95..0f06340 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 _0x90fb=['closed','closedAt','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./faxInteraction.attributes','exports','define','FaxInteraction','changed'];(function(_0x3e0763,_0x3d12be){var _0x351ca2=function(_0x9beae7){while(--_0x9beae7){_0x3e0763['push'](_0x3e0763['shift']());}};_0x351ca2(++_0x3d12be);}(_0x90fb,0x122));var _0xb90f=function(_0x46aebd,_0x488973){_0x46aebd=_0x46aebd-0x0;var _0x549577=_0x90fb[_0x46aebd];return _0x549577;};'use strict';var _=require(_0xb90f('0x0'));var util=require(_0xb90f('0x1'));var logger=require(_0xb90f('0x2'))(_0xb90f('0x3'));var moment=require(_0xb90f('0x4'));var BPromise=require(_0xb90f('0x5'));var rp=require(_0xb90f('0x6'));var fs=require('fs');var path=require(_0xb90f('0x7'));var rimraf=require(_0xb90f('0x8'));var config=require('../../config/environment');var attributes=require(_0xb90f('0x9'));module[_0xb90f('0xa')]=function(_0x38966c,_0x564ea1){return _0x38966c[_0xb90f('0xb')](_0xb90f('0xc'),attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1c328b,_0xc4f2b0,_0x1a6b72){if(_0x1c328b[_0xb90f('0xd')](_0xb90f('0xe'))){_0x1c328b[_0xb90f('0xf')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x1a6b72(null,_0x1c328b);}}});}; \ No newline at end of file +var _0xb662=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions','changed','closed','closedAt','format','lodash','util','api'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0xb662,0x8d));var _0x2b66=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0xb662[_0x1589dd];return _0x1bddd1;};'use strict';var _=require(_0x2b66('0x0'));var util=require(_0x2b66('0x1'));var logger=require('../../config/logger')(_0x2b66('0x2'));var moment=require(_0x2b66('0x3'));var BPromise=require(_0x2b66('0x4'));var rp=require(_0x2b66('0x5'));var fs=require('fs');var path=require(_0x2b66('0x6'));var rimraf=require(_0x2b66('0x7'));var config=require(_0x2b66('0x8'));var attributes=require(_0x2b66('0x9'));module[_0x2b66('0xa')]=function(_0x288a87,_0x24cefe){return _0x288a87[_0x2b66('0xb')](_0x2b66('0xc'),attributes,{'tableName':_0x2b66('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x567e3d,_0x100672,_0x16fdff){if(_0x567e3d[_0x2b66('0xe')](_0x2b66('0xf'))){_0x567e3d[_0x2b66('0x10')]=moment()[_0x2b66('0x11')]('YYYY-MM-DD\x20HH:mm:ss');}_0x16fdff(null,_0x567e3d);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 5b55e09..bfde19c 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 _0x280a=['http','redis','localhost','socket.io-emitter','./faxInteraction.socket','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateFaxInteraction','FaxInteraction','update','body','options','where','attributes','stringify','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x280a,0xec));var _0xa280=function(_0x579baf,_0x4aaafa){_0x579baf=_0x579baf-0x0;var _0x4c601a=_0x280a[_0x579baf];return _0x4c601a;};'use strict';var _=require(_0xa280('0x0'));var util=require(_0xa280('0x1'));var moment=require(_0xa280('0x2'));var BPromise=require(_0xa280('0x3'));var rs=require(_0xa280('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa280('0x5'))['db'];var utils=require(_0xa280('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xa280('0x7'));var jayson=require(_0xa280('0x8'));var client=jayson[_0xa280('0x9')][_0xa280('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0xa280('0xb')],{'host':_0xa280('0xc'),'port':0x18eb});var socket=require(_0xa280('0xd'))(new Redis(config['redis']));require(_0xa280('0xe'))['register'](socket);function respondWithRpcPromise(_0x402dbd,_0x9d122f,_0x2d709b){return new BPromise(function(_0x18bc83,_0x2a7b94){return client[_0xa280('0xf')](_0x402dbd,_0x2d709b)[_0xa280('0x10')](function(_0xc7126d){logger[_0xa280('0x11')](_0xa280('0x12'),_0x9d122f,_0xa280('0x13'));logger[_0xa280('0x14')](_0xa280('0x15'),_0x9d122f,'request\x20sent',JSON['stringify'](_0xc7126d));if(_0xc7126d[_0xa280('0x16')]){if(_0xc7126d[_0xa280('0x16')][_0xa280('0x17')]===0x1f4){logger[_0xa280('0x16')](_0xa280('0x12'),_0x9d122f,_0xc7126d['error']['message']);return _0x2a7b94(_0xc7126d['error'][_0xa280('0x18')]);}logger['error'](_0xa280('0x12'),_0x9d122f,_0xc7126d[_0xa280('0x16')][_0xa280('0x18')]);return _0x18bc83(_0xc7126d[_0xa280('0x16')]['message']);}else{logger[_0xa280('0x11')](_0xa280('0x12'),_0x9d122f,_0xa280('0x13'));_0x18bc83(_0xc7126d[_0xa280('0x19')][_0xa280('0x18')]);}})[_0xa280('0x1a')](function(_0x55a410){logger[_0xa280('0x16')](_0xa280('0x12'),_0x9d122f,_0x55a410);_0x2a7b94(_0x55a410);});});}exports[_0xa280('0x1b')]=function(_0x51e489){var _0x305553=this;return new Promise(function(_0x5e1cd9,_0x26399a){return db[_0xa280('0x1c')][_0xa280('0x1d')](_0x51e489[_0xa280('0x1e')],{'raw':_0x51e489[_0xa280('0x1f')]?_0x51e489['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x51e489['options']?_0x51e489[_0xa280('0x1f')][_0xa280('0x20')]||null:null,'attributes':_0x51e489['options']?_0x51e489[_0xa280('0x1f')][_0xa280('0x21')]||null:null,'limit':_0x51e489[_0xa280('0x1f')]?_0x51e489[_0xa280('0x1f')]['limit']||null:null})['then'](function(_0x445fab){logger[_0xa280('0x11')](_0xa280('0x1b'),_0x51e489);logger[_0xa280('0x14')](_0xa280('0x1b'),_0x51e489,JSON[_0xa280('0x22')](_0x445fab));_0x5e1cd9(_0x445fab);})[_0xa280('0x1a')](function(_0x10bbfb){logger[_0xa280('0x16')](_0xa280('0x1b'),_0x10bbfb['message'],_0x51e489);_0x26399a(_0x305553[_0xa280('0x16')](0x1f4,_0x10bbfb[_0xa280('0x18')]));});});};exports['AddTagsToFaxInteraction']=function(_0x139cae){return new Promise(function(_0x18f0b1,_0x542147){return db[_0xa280('0x1c')][_0xa280('0x23')]({'where':_0x139cae[_0xa280('0x1f')]?_0x139cae['options'][_0xa280('0x20')]||null:null})['then'](function(_0x27743e){if(_0x27743e){return _0x27743e[_0xa280('0x24')](_0x139cae[_0xa280('0x1e')][_0xa280('0x25')],_[_0xa280('0x26')](_0x139cae[_0xa280('0x1e')],[_0xa280('0x25'),'id'])||{});}})[_0xa280('0x27')](function(_0xa39b48){logger['info']('AddTags',_0x139cae);logger[_0xa280('0x14')](_0xa280('0x28'),_0x139cae,JSON[_0xa280('0x22')](_0xa39b48));_0x18f0b1(_0xa39b48);})['catch'](function(_0x42e1df){logger[_0xa280('0x16')]('AddTags',_0x42e1df['message'],_0x139cae);_0x542147(_this[_0xa280('0x16')](0x1f4,_0x42e1df['message']));});});}; \ No newline at end of file +var _0xbb13=['UpdateFaxInteraction','update','body','options','limit','FaxInteraction','where','addTags','ids','omit','AddTags','debug','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0xae1bec,_0x29c660){var _0x4a1224=function(_0x452783){while(--_0x452783){_0xae1bec['push'](_0xae1bec['shift']());}};_0x4a1224(++_0x29c660);}(_0xbb13,0x1e0));var _0x3bb1=function(_0x38460b,_0x1b94c5){_0x38460b=_0x38460b-0x0;var _0x2f1d0b=_0xbb13[_0x38460b];return _0x2f1d0b;};'use strict';var _=require('lodash');var util=require(_0x3bb1('0x0'));var moment=require(_0x3bb1('0x1'));var BPromise=require(_0x3bb1('0x2'));var rs=require(_0x3bb1('0x3'));var fs=require('fs');var Redis=require(_0x3bb1('0x4'));var db=require(_0x3bb1('0x5'))['db'];var utils=require(_0x3bb1('0x6'));var logger=require('../../config/logger')(_0x3bb1('0x7'));var config=require(_0x3bb1('0x8'));var jayson=require(_0x3bb1('0x9'));var client=jayson[_0x3bb1('0xa')][_0x3bb1('0xb')]({'port':0x232a});config['redis']=_[_0x3bb1('0xc')](config[_0x3bb1('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x3bb1('0xe'))(new Redis(config[_0x3bb1('0xd')]));require('./faxInteraction.socket')[_0x3bb1('0xf')](socket);function respondWithRpcPromise(_0x2de17e,_0x46fa4a,_0x16b30e){return new BPromise(function(_0x3b7126,_0x400493){return client[_0x3bb1('0x10')](_0x2de17e,_0x16b30e)[_0x3bb1('0x11')](function(_0x386a42){logger[_0x3bb1('0x12')](_0x3bb1('0x13'),_0x46fa4a,'request\x20sent');logger['debug']('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x46fa4a,_0x3bb1('0x14'),JSON[_0x3bb1('0x15')](_0x386a42));if(_0x386a42[_0x3bb1('0x16')]){if(_0x386a42[_0x3bb1('0x16')][_0x3bb1('0x17')]===0x1f4){logger[_0x3bb1('0x16')]('FaxInteraction,\x20%s,\x20%s',_0x46fa4a,_0x386a42['error']['message']);return _0x400493(_0x386a42['error'][_0x3bb1('0x18')]);}logger[_0x3bb1('0x16')]('FaxInteraction,\x20%s,\x20%s',_0x46fa4a,_0x386a42['error'][_0x3bb1('0x18')]);return _0x3b7126(_0x386a42[_0x3bb1('0x16')][_0x3bb1('0x18')]);}else{logger[_0x3bb1('0x12')]('FaxInteraction,\x20%s,\x20%s',_0x46fa4a,_0x3bb1('0x14'));_0x3b7126(_0x386a42[_0x3bb1('0x19')][_0x3bb1('0x18')]);}})[_0x3bb1('0x1a')](function(_0x3f6462){logger[_0x3bb1('0x16')]('FaxInteraction,\x20%s,\x20%s',_0x46fa4a,_0x3f6462);_0x400493(_0x3f6462);});});}exports[_0x3bb1('0x1b')]=function(_0x15ec8e){var _0x71de55=this;return new Promise(function(_0x55708,_0x2ee3af){return db['FaxInteraction'][_0x3bb1('0x1c')](_0x15ec8e[_0x3bb1('0x1d')],{'raw':_0x15ec8e[_0x3bb1('0x1e')]?_0x15ec8e[_0x3bb1('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x15ec8e['options']?_0x15ec8e['options']['where']||null:null,'attributes':_0x15ec8e[_0x3bb1('0x1e')]?_0x15ec8e[_0x3bb1('0x1e')]['attributes']||null:null,'limit':_0x15ec8e[_0x3bb1('0x1e')]?_0x15ec8e[_0x3bb1('0x1e')][_0x3bb1('0x1f')]||null:null})[_0x3bb1('0x11')](function(_0x5a58d3){logger[_0x3bb1('0x12')](_0x3bb1('0x1b'),_0x15ec8e);logger['debug'](_0x3bb1('0x1b'),_0x15ec8e,JSON['stringify'](_0x5a58d3));_0x55708(_0x5a58d3);})[_0x3bb1('0x1a')](function(_0x5d147a){logger[_0x3bb1('0x16')](_0x3bb1('0x1b'),_0x5d147a[_0x3bb1('0x18')],_0x15ec8e);_0x2ee3af(_0x71de55[_0x3bb1('0x16')](0x1f4,_0x5d147a[_0x3bb1('0x18')]));});});};exports['AddTagsToFaxInteraction']=function(_0x1d58e6){return new Promise(function(_0x39a117,_0x41b3ae){return db[_0x3bb1('0x20')]['find']({'where':_0x1d58e6[_0x3bb1('0x1e')]?_0x1d58e6[_0x3bb1('0x1e')][_0x3bb1('0x21')]||null:null})['then'](function(_0x36d01e){if(_0x36d01e){return _0x36d01e[_0x3bb1('0x22')](_0x1d58e6[_0x3bb1('0x1d')][_0x3bb1('0x23')],_[_0x3bb1('0x24')](_0x1d58e6[_0x3bb1('0x1d')],[_0x3bb1('0x23'),'id'])||{});}})['spread'](function(_0x212f7f){logger['info'](_0x3bb1('0x25'),_0x1d58e6);logger[_0x3bb1('0x26')](_0x3bb1('0x25'),_0x1d58e6,JSON['stringify'](_0x212f7f));_0x39a117(_0x212f7f);})[_0x3bb1('0x1a')](function(_0x3bd6cf){logger[_0x3bb1('0x16')](_0x3bb1('0x25'),_0x3bd6cf['message'],_0x1d58e6);_0x41b3ae(_this[_0x3bb1('0x16')](0x1f4,_0x3bd6cf[_0x3bb1('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index a87b8db..20815db 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 _0x9a81=['./faxInteraction.events','save','remove','update','emit','removeListener','length'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x9a81,0x18f));var _0x19a8=function(_0x3b237d,_0x5bae62){_0x3b237d=_0x3b237d-0x0;var _0x3b9383=_0x9a81[_0x3b237d];return _0x3b9383;};'use strict';var FaxInteractionEvents=require(_0x19a8('0x0'));var events=[_0x19a8('0x1'),_0x19a8('0x2'),_0x19a8('0x3')];function createListener(_0x419496,_0x51e609){return function(_0x4034b8){_0x51e609[_0x19a8('0x4')](_0x419496,_0x4034b8);};}function removeListener(_0x282980,_0x34b7a7){return function(){FaxInteractionEvents[_0x19a8('0x5')](_0x282980,_0x34b7a7);};}exports['register']=function(_0x1e11c5){for(var _0x4a51ef=0x0,_0x47bdc5=events[_0x19a8('0x6')];_0x4a51ef<_0x47bdc5;_0x4a51ef++){var _0x30cede=events[_0x4a51ef];var _0x474a68=createListener('faxInteraction:'+_0x30cede,_0x1e11c5);FaxInteractionEvents['on'](_0x30cede,_0x474a68);}}; \ No newline at end of file +var _0x819a=['removeListener','./faxInteraction.events','save','remove','update'];(function(_0x1ca848,_0x37c06b){var _0x450b66=function(_0x602f5){while(--_0x602f5){_0x1ca848['push'](_0x1ca848['shift']());}};_0x450b66(++_0x37c06b);}(_0x819a,0x1d7));var _0xa819=function(_0x4874d1,_0xb53cf){_0x4874d1=_0x4874d1-0x0;var _0x136e8a=_0x819a[_0x4874d1];return _0x136e8a;};'use strict';var FaxInteractionEvents=require(_0xa819('0x0'));var events=[_0xa819('0x1'),_0xa819('0x2'),_0xa819('0x3')];function createListener(_0x9ba990,_0x5e0453){return function(_0x19ed34){_0x5e0453['emit'](_0x9ba990,_0x19ed34);};}function removeListener(_0x20e66a,_0x2f35b3){return function(){FaxInteractionEvents[_0xa819('0x4')](_0x20e66a,_0x2f35b3);};}exports['register']=function(_0x4b72a8){for(var _0x3e5bf8=0x0,_0x1436d5=events['length'];_0x3e5bf8<_0x1436d5;_0x3e5bf8++){var _0x2df83b=events[_0x3e5bf8];var _0x48e1d3=createListener('faxInteraction:'+_0x2df83b,_0x4b72a8);FaxInteractionEvents['on'](_0x2df83b,_0x48e1d3);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 41ee774..a40c35d 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 _0x37a6=['post','addMessage','/:id/tags','tracked','fax','faxinteraction:addtags','addTags','faxinteraction:update','update','delete','faxinteraction:destroy','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','/describe','describe','/:id','/:id/messages','getMessages','/:id/download','download'];(function(_0x16e1ad,_0xb270cc){var _0x31e084=function(_0x14bb0b){while(--_0x14bb0b){_0x16e1ad['push'](_0x16e1ad['shift']());}};_0x31e084(++_0xb270cc);}(_0x37a6,0x8d));var _0x637a=function(_0x26e332,_0x2ef48e){_0x26e332=_0x26e332-0x0;var _0x5501a6=_0x37a6[_0x26e332];return _0x5501a6;};'use strict';var multer=require(_0x637a('0x0'));var util=require(_0x637a('0x1'));var path=require(_0x637a('0x2'));var timeout=require(_0x637a('0x3'));var express=require(_0x637a('0x4'));var router=express[_0x637a('0x5')]();var auth=require(_0x637a('0x6'));var interaction=require(_0x637a('0x7'));var config=require(_0x637a('0x8'));var controller=require(_0x637a('0x9'));router[_0x637a('0xa')]('/',auth[_0x637a('0xb')](),controller['index']);router[_0x637a('0xa')](_0x637a('0xc'),auth[_0x637a('0xb')](),controller[_0x637a('0xd')]);router[_0x637a('0xa')](_0x637a('0xe'),auth[_0x637a('0xb')](),controller['show']);router[_0x637a('0xa')](_0x637a('0xf'),auth[_0x637a('0xb')](),controller[_0x637a('0x10')]);router['get'](_0x637a('0x11'),auth[_0x637a('0xb')](),controller[_0x637a('0x12')]);router[_0x637a('0x13')]('/',auth[_0x637a('0xb')](),controller['create']);router[_0x637a('0x13')](_0x637a('0xf'),auth['isAuthenticated'](),controller[_0x637a('0x14')]);router[_0x637a('0x13')](_0x637a('0x15'),auth[_0x637a('0xb')](),interaction[_0x637a('0x16')](_0x637a('0x17'),_0x637a('0x18')),controller[_0x637a('0x19')]);router['put'](_0x637a('0xe'),auth[_0x637a('0xb')](),interaction['tracked'](_0x637a('0x17'),_0x637a('0x1a')),controller[_0x637a('0x1b')]);router[_0x637a('0x1c')](_0x637a('0xe'),auth[_0x637a('0xb')](),interaction[_0x637a('0x16')]('fax',_0x637a('0x1d')),controller[_0x637a('0x1e')]);router[_0x637a('0x1c')](_0x637a('0x15'),auth[_0x637a('0xb')](),controller['removeTags']);module[_0x637a('0x1f')]=router; \ No newline at end of file +var _0x1e31=['addTags','put','faxinteraction:update','update','delete','faxinteraction:destroy','destroy','removeTags','exports','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMessages','download','post','create','addMessage','/:id/tags','tracked','fax','faxinteraction:addtags'];(function(_0x40fede,_0x203a11){var _0x482694=function(_0x4b7fa0){while(--_0x4b7fa0){_0x40fede['push'](_0x40fede['shift']());}};_0x482694(++_0x203a11);}(_0x1e31,0x129));var _0x11e3=function(_0x17e5b3,_0x519fe7){_0x17e5b3=_0x17e5b3-0x0;var _0x14af03=_0x1e31[_0x17e5b3];return _0x14af03;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x11e3('0x0'));var timeout=require(_0x11e3('0x1'));var express=require(_0x11e3('0x2'));var router=express['Router']();var auth=require(_0x11e3('0x3'));var interaction=require(_0x11e3('0x4'));var config=require(_0x11e3('0x5'));var controller=require(_0x11e3('0x6'));router[_0x11e3('0x7')]('/',auth[_0x11e3('0x8')](),controller[_0x11e3('0x9')]);router[_0x11e3('0x7')](_0x11e3('0xa'),auth['isAuthenticated'](),controller[_0x11e3('0xb')]);router[_0x11e3('0x7')](_0x11e3('0xc'),auth[_0x11e3('0x8')](),controller[_0x11e3('0xd')]);router[_0x11e3('0x7')]('/:id/messages',auth[_0x11e3('0x8')](),controller[_0x11e3('0xe')]);router[_0x11e3('0x7')]('/:id/download',auth[_0x11e3('0x8')](),controller[_0x11e3('0xf')]);router[_0x11e3('0x10')]('/',auth[_0x11e3('0x8')](),controller[_0x11e3('0x11')]);router[_0x11e3('0x10')]('/:id/messages',auth[_0x11e3('0x8')](),controller[_0x11e3('0x12')]);router['post'](_0x11e3('0x13'),auth[_0x11e3('0x8')](),interaction[_0x11e3('0x14')](_0x11e3('0x15'),_0x11e3('0x16')),controller[_0x11e3('0x17')]);router[_0x11e3('0x18')](_0x11e3('0xc'),auth['isAuthenticated'](),interaction[_0x11e3('0x14')]('fax',_0x11e3('0x19')),controller[_0x11e3('0x1a')]);router[_0x11e3('0x1b')]('/:id',auth['isAuthenticated'](),interaction[_0x11e3('0x14')](_0x11e3('0x15'),_0x11e3('0x1c')),controller[_0x11e3('0x1d')]);router[_0x11e3('0x1b')](_0x11e3('0x13'),auth[_0x11e3('0x8')](),controller[_0x11e3('0x1e')]);module[_0x11e3('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 0aa42db..d399bcc 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 _0x3e8a=['BOOLEAN','ENUM','out','DATE','sequelize','exports','TEXT'];(function(_0x2dc8b3,_0x420aad){var _0x1559de=function(_0x4757ac){while(--_0x4757ac){_0x2dc8b3['push'](_0x2dc8b3['shift']());}};_0x1559de(++_0x420aad);}(_0x3e8a,0xac));var _0xa3e8=function(_0x46a00c,_0x57cd8a){_0x46a00c=_0x46a00c-0x0;var _0x247873=_0x3e8a[_0x46a00c];return _0x247873;};'use strict';var Sequelize=require(_0xa3e8('0x0'));module[_0xa3e8('0x1')]={'body':{'type':Sequelize[_0xa3e8('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xa3e8('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xa3e8('0x4')]('in','out'),'defaultValue':_0xa3e8('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0xa3e8('0x6')]}}; \ No newline at end of file +var _0x0ece=['ENUM','out','DATE','sequelize','TEXT','medium','BOOLEAN'];(function(_0x2f5302,_0x477d1a){var _0x142aad=function(_0x52c65f){while(--_0x52c65f){_0x2f5302['push'](_0x2f5302['shift']());}};_0x142aad(++_0x477d1a);}(_0x0ece,0x114));var _0xe0ec=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0ece[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xe0ec('0x0'));module['exports']={'body':{'type':Sequelize[_0xe0ec('0x1')](_0xe0ec('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xe0ec('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xe0ec('0x4')]('in',_0xe0ec('0x5')),'defaultValue':_0xe0ec('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xe0ec('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0xe0ec('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 3997612..5fdaf7a 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 _0x7217=['fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./faxMessage.socket','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','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','save','destroy','stack','name','send','map','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','key','VIRTUAL','options','count','includeAll','FaxMessage','findAll','rows','show','params','length','include','update','body','find','describe','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','FaxInteraction','FaxInteractionId','read1stAt','interaction','get','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','channel','event','EventManager','acceptmessage','fax-interactions','agent','RejectMessage','interface','SIP/%s','rejectmessage','create','findOne','isNil','Attachment','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','AttachmentId','download','join','root','server','files','html-pdf','rimraf','zip-dir'];(function(_0x35b4f4,_0x1dbc8c){var _0x2c26f9=function(_0x26f14d){while(--_0x26f14d){_0x35b4f4['push'](_0x35b4f4['shift']());}};_0x2c26f9(++_0x1dbc8c);}(_0x7217,0x19e));var _0x7721=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0x7217[_0x3635ce];return _0x97ecd0;};'use strict';var pdf=require(_0x7721('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7721('0x1'));var zipdir=require(_0x7721('0x2'));var jsonpatch=require(_0x7721('0x3'));var rp=require(_0x7721('0x4'));var moment=require(_0x7721('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7721('0x6'));var path=require(_0x7721('0x7'));var sox=require(_0x7721('0x8'));var csv=require(_0x7721('0x9'));var ejs=require(_0x7721('0xa'));var fs=require('fs');var _=require(_0x7721('0xb'));var squel=require(_0x7721('0xc'));var crypto=require(_0x7721('0xd'));var jsforce=require(_0x7721('0xe'));var deskjs=require(_0x7721('0xf'));var toCsv=require(_0x7721('0x9'));var querystring=require(_0x7721('0x10'));var Papa=require(_0x7721('0x11'));var Redis=require(_0x7721('0x12'));var authService=require(_0x7721('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7721('0x14'));var hardwareService=require(_0x7721('0x15'));var logger=require(_0x7721('0x16'))(_0x7721('0x17'));var utils=require(_0x7721('0x18'));var config=require(_0x7721('0x19'));var db=require(_0x7721('0x1a'))['db'];config[_0x7721('0x1b')]=_['defaults'](config[_0x7721('0x1b')],{'host':_0x7721('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7721('0x1b')]));require(_0x7721('0x1d'))[_0x7721('0x1e')](socket);var jayson=require(_0x7721('0x1f'));var client=jayson['client'][_0x7721('0x20')]({'port':0x232c});var client9002=jayson[_0x7721('0x21')]['http']({'port':0x232a});function checkPasswordPattern(_0x4e199a,_0x4b183e,_0x5ed54){if(_0x5ed54){var _0x25a628=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x25a628[_0x7721('0x22')](_0x4b183e)){return _0x4e199a;}else{throw new Error(_0x7721('0x23'));}}else{return _0x4e199a;}}function respondWithRpcPromise(_0x5ed94b,_0x20f669,_0x54a838,_0x3fc09e){return new BPromise(function(_0x5cb0e6,_0xfec626){var _0x4e96fb=_0x3fc09e||client;return _0x4e96fb[_0x7721('0x24')](_0x5ed94b,_0x54a838)[_0x7721('0x25')](function(_0x2286e5){logger[_0x7721('0x26')](_0x7721('0x27'),_0x20f669,_0x7721('0x28'));logger[_0x7721('0x29')](_0x7721('0x2a'),_0x20f669,'request\x20sent',JSON[_0x7721('0x2b')](_0x2286e5));if(_0x2286e5[_0x7721('0x2c')]){if(_0x2286e5[_0x7721('0x2c')][_0x7721('0x2d')]===0x1f4){logger['error'](_0x7721('0x27'),_0x20f669,_0x2286e5['error'][_0x7721('0x2e')]);return _0xfec626(_0x2286e5[_0x7721('0x2c')][_0x7721('0x2e')]);}logger[_0x7721('0x2c')](_0x7721('0x27'),_0x20f669,_0x2286e5[_0x7721('0x2c')][_0x7721('0x2e')]);return _0x5cb0e6(_0x2286e5['error'][_0x7721('0x2e')]);}else{logger[_0x7721('0x26')](_0x7721('0x27'),_0x20f669,_0x7721('0x28'));_0x5cb0e6(_0x2286e5[_0x7721('0x2f')][_0x7721('0x2e')]);}})[_0x7721('0x30')](function(_0xf753f1){logger[_0x7721('0x2c')]('FaxMessage,\x20%s,\x20%s',_0x20f669,_0xf753f1);_0xfec626(_0xf753f1);});});}function respondWithStatusCode(_0x258ddf,_0x5b0551){_0x5b0551=_0x5b0551||0xcc;return function(_0x499b87){if(_0x499b87){return _0x258ddf[_0x7721('0x31')](_0x5b0551);}return _0x258ddf[_0x7721('0x32')](_0x5b0551)[_0x7721('0x33')]();};}function respondWithResult(_0x158d98,_0x1ea4d){_0x1ea4d=_0x1ea4d||0xc8;return function(_0x37b9f0){if(_0x37b9f0){return _0x158d98[_0x7721('0x32')](_0x1ea4d)[_0x7721('0x34')](_0x37b9f0);}};}function respondWithFilteredResult(_0x5c54f0,_0x471651){return function(_0x2871c5){if(_0x2871c5){var _0x497f9f=_0x2871c5['count'],_0x4a25c9=_0x471651[_0x7721('0x35')],_0xfde9ec=_0x471651[_0x7721('0x35')]+_0x471651[_0x7721('0x36')],_0x220bbf;if(_0xfde9ec>=_0x497f9f){_0xfde9ec=_0x497f9f;_0x220bbf=0xc8;}else{_0x220bbf=0xce;}_0x5c54f0['status'](_0x220bbf);return _0x5c54f0[_0x7721('0x37')](_0x7721('0x38'),_0x4a25c9+'-'+_0xfde9ec+'/'+_0x497f9f)[_0x7721('0x34')](_0x2871c5);}return null;};}function patchUpdates(_0x3f15e2){return function(_0xc0f3c4){try{jsonpatch['apply'](_0xc0f3c4,_0x3f15e2,!![]);}catch(_0x195ffb){return BPromise[_0x7721('0x39')](_0x195ffb);}return _0xc0f3c4[_0x7721('0x3a')]();};}function saveUpdates(_0x5c5b33,_0x35de7a){return function(_0x213a2e){if(_0x213a2e){return _0x213a2e['update'](_0x5c5b33)[_0x7721('0x25')](function(_0x5ce026){return _0x5ce026;});}return null;};}function removeEntity(_0x2d6ba0,_0x326c50){return function(_0x19d082){if(_0x19d082){return _0x19d082[_0x7721('0x3b')]()[_0x7721('0x25')](function(){_0x2d6ba0[_0x7721('0x32')](0xcc)[_0x7721('0x33')]();});}};}function handleEntityNotFound(_0x15545a,_0x25bdd9){return function(_0x3a2eb7){if(!_0x3a2eb7){_0x15545a[_0x7721('0x31')](0x194);}return _0x3a2eb7;};}function handleError(_0x5c806d,_0xd1df68){_0xd1df68=_0xd1df68||0x1f4;return function(_0x5e6663){logger[_0x7721('0x2c')](_0x5e6663[_0x7721('0x3c')]);if(_0x5e6663[_0x7721('0x3d')]){delete _0x5e6663[_0x7721('0x3d')];}_0x5c806d[_0x7721('0x32')](_0xd1df68)[_0x7721('0x3e')](_0x5e6663);};}exports['index']=function(_0x557c34,_0x4cadef){var _0x539560={},_0x18001c={},_0x1b3f8d={'count':0x0,'rows':[]};var _0x1acc72=_[_0x7721('0x3f')](db['FaxMessage'][_0x7721('0x40')],function(_0x4cf659){return{'name':_0x4cf659[_0x7721('0x41')],'type':_0x4cf659[_0x7721('0x42')]['key']};});_0x18001c[_0x7721('0x43')]=_[_0x7721('0x3f')](_0x1acc72,'name');_0x18001c['query']=_[_0x7721('0x44')](_0x557c34[_0x7721('0x45')]);_0x18001c[_0x7721('0x46')]=_[_0x7721('0x47')](_0x18001c['model'],_0x18001c[_0x7721('0x45')]);_0x539560[_0x7721('0x48')]=_[_0x7721('0x47')](_0x18001c[_0x7721('0x43')],qs[_0x7721('0x49')](_0x557c34['query'][_0x7721('0x49')]));_0x539560['attributes']=_0x539560[_0x7721('0x48')]['length']?_0x539560[_0x7721('0x48')]:_0x18001c[_0x7721('0x43')];if(!_0x557c34[_0x7721('0x45')]['hasOwnProperty'](_0x7721('0x4a'))){_0x539560[_0x7721('0x36')]=qs[_0x7721('0x36')](_0x557c34['query'][_0x7721('0x36')]);_0x539560[_0x7721('0x35')]=qs[_0x7721('0x35')](_0x557c34[_0x7721('0x45')][_0x7721('0x35')]);}_0x539560[_0x7721('0x4b')]=qs[_0x7721('0x4c')](_0x557c34['query']['sort']);_0x539560[_0x7721('0x4d')]=qs[_0x7721('0x46')](_[_0x7721('0x4e')](_0x557c34[_0x7721('0x45')],_0x18001c[_0x7721('0x46')]));if(_0x557c34[_0x7721('0x45')][_0x7721('0x4f')]){_0x539560[_0x7721('0x4d')]=_[_0x7721('0x50')](_0x539560[_0x7721('0x4d')],{'$or':_['map'](_0x1acc72,function(_0x578867){if(_0x578867[_0x7721('0x42')][_0x7721('0x51')]!==_0x7721('0x52')){var _0x219c9f={};_0x219c9f[_0x578867['field']]={'$like':'%'+_0x557c34[_0x7721('0x45')][_0x7721('0x4f')]+'%'};return _0x219c9f;}})});}_0x539560=_['merge']({},_0x539560,_0x557c34[_0x7721('0x53')]);var _0x583320={'where':_0x539560[_0x7721('0x4d')]};return db['FaxMessage'][_0x7721('0x54')](_0x583320)[_0x7721('0x25')](function(_0xf17c40){_0x1b3f8d['count']=_0xf17c40;if(_0x557c34[_0x7721('0x45')][_0x7721('0x55')]){_0x539560['include']=[{'all':!![]}];}return db[_0x7721('0x56')][_0x7721('0x57')](_0x539560);})[_0x7721('0x25')](function(_0x5c4078){_0x1b3f8d[_0x7721('0x58')]=_0x5c4078;return _0x1b3f8d;})['then'](respondWithFilteredResult(_0x4cadef,_0x539560))[_0x7721('0x30')](handleError(_0x4cadef,null));};exports[_0x7721('0x59')]=function(_0x4738ef,_0x443503){var _0x1c95d8={'raw':!![],'where':{'id':_0x4738ef[_0x7721('0x5a')]['id']}},_0x7de310={};_0x7de310[_0x7721('0x43')]=_[_0x7721('0x44')](db[_0x7721('0x56')][_0x7721('0x40')]);_0x7de310[_0x7721('0x45')]=_[_0x7721('0x44')](_0x4738ef[_0x7721('0x45')]);_0x7de310[_0x7721('0x46')]=_['intersection'](_0x7de310[_0x7721('0x43')],_0x7de310[_0x7721('0x45')]);_0x1c95d8[_0x7721('0x48')]=_[_0x7721('0x47')](_0x7de310[_0x7721('0x43')],qs[_0x7721('0x49')](_0x4738ef[_0x7721('0x45')]['fields']));_0x1c95d8[_0x7721('0x48')]=_0x1c95d8[_0x7721('0x48')][_0x7721('0x5b')]?_0x1c95d8[_0x7721('0x48')]:_0x7de310[_0x7721('0x43')];if(_0x4738ef[_0x7721('0x45')][_0x7721('0x55')]){_0x1c95d8[_0x7721('0x5c')]=[{'all':!![]}];}_0x1c95d8=_[_0x7721('0x50')]({},_0x1c95d8,_0x4738ef[_0x7721('0x53')]);return db[_0x7721('0x56')]['find'](_0x1c95d8)[_0x7721('0x25')](handleEntityNotFound(_0x443503,null))[_0x7721('0x25')](respondWithResult(_0x443503,null))[_0x7721('0x30')](handleError(_0x443503,null));};exports[_0x7721('0x5d')]=function(_0x15ed3b,_0x3e7918){if(_0x15ed3b[_0x7721('0x5e')]['id']){delete _0x15ed3b[_0x7721('0x5e')]['id'];}return db[_0x7721('0x56')][_0x7721('0x5f')]({'where':{'id':_0x15ed3b[_0x7721('0x5a')]['id']}})[_0x7721('0x25')](handleEntityNotFound(_0x3e7918,null))[_0x7721('0x25')](saveUpdates(_0x15ed3b[_0x7721('0x5e')],null))[_0x7721('0x25')](respondWithResult(_0x3e7918,null))['catch'](handleError(_0x3e7918,null));};exports['destroy']=function(_0x4e112e,_0x885a3a){return db['FaxMessage']['find']({'where':{'id':_0x4e112e['params']['id']}})['then'](handleEntityNotFound(_0x885a3a,null))[_0x7721('0x25')](removeEntity(_0x885a3a,null))[_0x7721('0x30')](handleError(_0x885a3a,null));};exports[_0x7721('0x60')]=function(_0x5343a1,_0x5181d7){return db['FaxMessage']['describe']()['then'](respondWithResult(_0x5181d7,null))[_0x7721('0x30')](handleError(_0x5181d7,null));};var interaction_log=require('../../config/logger')('fax-interactions');exports['accept']=function(_0x160292,_0x2e9155,_0x1ff090){var _0x4a94c8={'channel':_0x7721('0x61')};if(_0x160292[_0x7721('0x5e')]['id']){delete _0x160292[_0x7721('0x5e')]['id'];}_0x160292[_0x7721('0x5e')][_0x7721('0x62')]=!![];_0x160292[_0x7721('0x5e')][_0x7721('0x63')]=moment()[_0x7721('0x64')](_0x7721('0x65'));_0x160292[_0x7721('0x5e')][_0x7721('0x66')]=_0x160292[_0x7721('0x5e')][_0x7721('0x66')]||_0x160292[_0x7721('0x67')]['id'];return db[_0x7721('0x56')]['find']({'where':{'id':_0x160292[_0x7721('0x5a')]['id'],'UserId':null},'include':[{'model':db[_0x7721('0x68')],'as':_0x7721('0x69')}]})[_0x7721('0x25')](handleEntityNotFound(_0x2e9155,null))['then'](saveUpdates(_0x160292[_0x7721('0x5e')],null))[_0x7721('0x25')](function(_0x4c8284){if(_0x4c8284){_0x4a94c8[_0x7721('0x2e')]=_0x4c8284['get']({'plain':!![]});return db[_0x7721('0x6a')][_0x7721('0x5f')]({'where':{'id':_0x4c8284[_0x7721('0x6b')]}});}return null;})[_0x7721('0x25')](handleEntityNotFound(_0x2e9155,null))[_0x7721('0x25')](function(_0x158aae){if(_0x158aae){return _0x158aae[_0x7721('0x5d')]({'UserId':_0x160292[_0x7721('0x5e')][_0x7721('0x66')],'read1stAt':_['isNil'](_0x158aae[_0x7721('0x6c')])?moment()[_0x7721('0x64')](_0x7721('0x65')):undefined});}return null;})[_0x7721('0x25')](function(_0x56a988){if(_0x56a988){_0x4a94c8[_0x7721('0x6d')]=_0x56a988[_0x7721('0x6e')]({'plain':!![]});interaction_log['info'](_0x7721('0x6f'),_0x160292[_0x7721('0x67')]['id'],_0x160292['user'][_0x7721('0x3d')],_0x160292['user'][_0x7721('0x70')],_0x4a94c8[_0x7721('0x6d')]['id'],_0x160292[_0x7721('0x5e')]?JSON[_0x7721('0x2b')](_0x160292[_0x7721('0x5e')]):_0x7721('0x71'));return respondWithRpcPromise(_0x7721('0x72'),'acceptMessage',_0x4a94c8);}return null;})[_0x7721('0x25')](function(_0x1d252a){if(_0x1d252a){if(_0x160292[_0x7721('0x5e')]['manual']){_0x4a94c8['message']['interface']=util['format']('SIP/%s',_0x160292[_0x7721('0x67')][_0x7721('0x3d')]);_0x4a94c8['message'][_0x7721('0x73')]=_0x4a94c8[_0x7721('0x73')];_0x4a94c8[_0x7721('0x2e')][_0x7721('0x74')]='accept';return respondWithRpcPromise(_0x7721('0x75'),_0x7721('0x75'),{'event':_0x7721('0x76'),'message':_0x4a94c8[_0x7721('0x2e')]},client9002)[_0x7721('0x25')](function(){return _0x4a94c8;});}return _0x4a94c8;}return null;})['then'](respondWithResult(_0x2e9155,null))[_0x7721('0x30')](handleError(_0x2e9155,null));};var interaction_log=require(_0x7721('0x16'))(_0x7721('0x77'));exports['reject']=function(_0x52f509,_0x76d89e,_0x752564){var _0x423040={'agent':{},'channel':_0x7721('0x61')};if(_0x52f509[_0x7721('0x5e')]['id']){delete _0x52f509['body']['id'];}_0x52f509['body'][_0x7721('0x66')]=_0x52f509[_0x7721('0x5e')][_0x7721('0x66')]||_0x52f509[_0x7721('0x67')]['id'];_0x423040[_0x7721('0x78')]['id']=_0x52f509[_0x7721('0x5e')][_0x7721('0x66')];return db['FaxMessage'][_0x7721('0x5f')]({'where':{'id':_0x52f509[_0x7721('0x5a')]['id'],'UserId':null}})[_0x7721('0x25')](handleEntityNotFound(_0x76d89e,null))['then'](function(_0xdc60ee){if(_0xdc60ee){_0x423040[_0x7721('0x2e')]=_0xdc60ee[_0x7721('0x6e')]({'plain':!![]});return db[_0x7721('0x6a')]['find']({'where':{'id':_0xdc60ee['FaxInteractionId']}});}return null;})[_0x7721('0x25')](handleEntityNotFound(_0x76d89e,null))[_0x7721('0x25')](function(_0x177fe3){if(_0x177fe3){_0x423040[_0x7721('0x6d')]=_0x177fe3[_0x7721('0x6e')]({'plain':!![]});interaction_log[_0x7721('0x26')]('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x52f509[_0x7721('0x67')]['id'],_0x52f509[_0x7721('0x67')][_0x7721('0x3d')],_0x52f509['user'][_0x7721('0x70')],_0x423040[_0x7721('0x6d')]['id'],_0x52f509[_0x7721('0x5e')]?JSON[_0x7721('0x2b')](_0x52f509[_0x7721('0x5e')]):'null');return respondWithRpcPromise(_0x7721('0x79'),'rejectMessage',_0x423040);}return null;})[_0x7721('0x25')](function(_0x47764b){if(_0x47764b){_0x47764b[_0x7721('0x2e')][_0x7721('0x7a')]=util[_0x7721('0x64')](_0x7721('0x7b'),_0x52f509[_0x7721('0x67')][_0x7721('0x3d')]);_0x47764b[_0x7721('0x2e')][_0x7721('0x73')]=_0x423040[_0x7721('0x73')];_0x47764b['message'][_0x7721('0x74')]=_0x7721('0x39');respondWithRpcPromise(_0x7721('0x75'),'EventManager',{'event':_0x7721('0x7c'),'message':_0x47764b[_0x7721('0x2e')]},client9002);return _0x423040;}return null;})[_0x7721('0x25')](respondWithResult(_0x76d89e,null))[_0x7721('0x30')](handleError(_0x76d89e,null));};exports[_0x7721('0x7d')]=function(_0x594059,_0x1276ce){var _0x22f15a;return db[_0x7721('0x56')][_0x7721('0x7d')](_0x594059[_0x7721('0x5e')],{})[_0x7721('0x25')](function(_0x52270e){_0x22f15a=_0x52270e;return db[_0x7721('0x68')][_0x7721('0x7e')]({'where':{'id':_0x22f15a['ContactId']}});})[_0x7721('0x25')](function(_0x4c8fb9){if(_[_0x7721('0x7f')](_0x4c8fb9)){return;}else{_0x22f15a[_0x7721('0x61')]=_0x4c8fb9['fax'];return db[_0x7721('0x80')]['findOne']({'where':{'id':_0x22f15a['AttachmentId']}});}})['then'](function(_0x1bd716){return respondWithRpcPromise(_0x7721('0x81'),_0x7721('0x81'),{'FaxAccountId':_['isNil'](_0x594059['body'])?undefined:_0x594059['body'][_0x7721('0x82')],'path':_[_0x7721('0x7f')](_0x1bd716)?undefined:util[_0x7721('0x64')](_0x7721('0x83'),_0x1bd716[_0x7721('0x84')]),'fax':_[_0x7721('0x7f')](_0x22f15a['fax'])?undefined:_0x22f15a[_0x7721('0x61')],'AttachmentId':_0x22f15a[_0x7721('0x85')]},client9002);})[_0x7721('0x25')](respondWithResult(_0x1276ce,0xc9))[_0x7721('0x30')](handleError(_0x1276ce,null));};exports[_0x7721('0x86')]=function(_0x1a0232,_0x342da2){var _0x6252db=path[_0x7721('0x87')](config[_0x7721('0x88')],_0x7721('0x89'),_0x7721('0x8a'),'attachments');return db['FaxMessage'][_0x7721('0x5f')]({'where':{'id':_0x1a0232[_0x7721('0x5a')]['id']},'include':[{'model':db['Attachment'],'as':_0x7721('0x80')}]})['then'](handleEntityNotFound(_0x342da2,null))['then'](function(_0x154b4b){if(_0x154b4b){return _0x342da2['download'](path['join'](_0x6252db,_0x154b4b[_0x7721('0x80')][_0x7721('0x84')]));}})[_0x7721('0x30')](handleError(_0x342da2,null));}; \ No newline at end of file +var _0x008c=['create','findOne','AttachmentId','SendFax','basename','download','join','root','files','attachments','Attachment','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./faxMessage.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','debug','code','error','FaxMessage,\x20%s,\x20%s','message','info','catch','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','destroy','sendStatus','stack','name','index','FaxMessage','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','include','findAll','rows','show','params','includeAll','find','body','describe','fax-interactions','accept','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','get','FaxInteraction','FaxInteractionId','isNil','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','AcceptMessage','interface','channel','event','EventManager','reject','fax','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','RejectMessage','SIP/%s'];(function(_0x3007d3,_0x2a17da){var _0x4e01a7=function(_0x5cd682){while(--_0x5cd682){_0x3007d3['push'](_0x3007d3['shift']());}};_0x4e01a7(++_0x2a17da);}(_0x008c,0x188));var _0xc008=function(_0x242117,_0x505596){_0x242117=_0x242117-0x0;var _0x51e9df=_0x008c[_0x242117];return _0x51e9df;};'use strict';var pdf=require(_0xc008('0x0'));var emlformat=require(_0xc008('0x1'));var rimraf=require(_0xc008('0x2'));var zipdir=require(_0xc008('0x3'));var jsonpatch=require(_0xc008('0x4'));var rp=require('request-promise');var moment=require(_0xc008('0x5'));var BPromise=require(_0xc008('0x6'));var Mustache=require(_0xc008('0x7'));var util=require(_0xc008('0x8'));var path=require(_0xc008('0x9'));var sox=require(_0xc008('0xa'));var csv=require(_0xc008('0xb'));var ejs=require(_0xc008('0xc'));var fs=require('fs');var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var db=require(_0xc008('0x16'))['db'];config[_0xc008('0x17')]=_[_0xc008('0x18')](config[_0xc008('0x17')],{'host':_0xc008('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc008('0x1a'))['register'](socket);var jayson=require(_0xc008('0x1b'));var client=jayson[_0xc008('0x1c')][_0xc008('0x1d')]({'port':0x232c});var client9002=jayson[_0xc008('0x1c')][_0xc008('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x5ee00b,_0x5e894e,_0x4bd0f4){if(_0x4bd0f4){var _0x11ef38=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x11ef38[_0xc008('0x1e')](_0x5e894e)){return _0x5ee00b;}else{throw new Error(_0xc008('0x1f'));}}else{return _0x5ee00b;}}function respondWithRpcPromise(_0x3eb12a,_0x4fe771,_0x53b06e,_0x540e45){return new BPromise(function(_0x5c2668,_0x46042b){var _0x462af5=_0x540e45||client;return _0x462af5['request'](_0x3eb12a,_0x53b06e)[_0xc008('0x20')](function(_0x5906e6){logger['info']('FaxMessage,\x20%s,\x20%s',_0x4fe771,'request\x20sent');logger[_0xc008('0x21')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x4fe771,'request\x20sent',JSON['stringify'](_0x5906e6));if(_0x5906e6['error']){if(_0x5906e6['error'][_0xc008('0x22')]===0x1f4){logger[_0xc008('0x23')](_0xc008('0x24'),_0x4fe771,_0x5906e6[_0xc008('0x23')][_0xc008('0x25')]);return _0x46042b(_0x5906e6[_0xc008('0x23')]['message']);}logger[_0xc008('0x23')]('FaxMessage,\x20%s,\x20%s',_0x4fe771,_0x5906e6['error'][_0xc008('0x25')]);return _0x5c2668(_0x5906e6[_0xc008('0x23')][_0xc008('0x25')]);}else{logger[_0xc008('0x26')]('FaxMessage,\x20%s,\x20%s',_0x4fe771,'request\x20sent');_0x5c2668(_0x5906e6['result'][_0xc008('0x25')]);}})[_0xc008('0x27')](function(_0x92c582){logger[_0xc008('0x23')]('FaxMessage,\x20%s,\x20%s',_0x4fe771,_0x92c582);_0x46042b(_0x92c582);});});}function respondWithStatusCode(_0x5e2aca,_0x4fce9c){_0x4fce9c=_0x4fce9c||0xcc;return function(_0x4adbab){if(_0x4adbab){return _0x5e2aca['sendStatus'](_0x4fce9c);}return _0x5e2aca[_0xc008('0x28')](_0x4fce9c)[_0xc008('0x29')]();};}function respondWithResult(_0x25eae4,_0x529961){_0x529961=_0x529961||0xc8;return function(_0x24c14c){if(_0x24c14c){return _0x25eae4[_0xc008('0x28')](_0x529961)[_0xc008('0x2a')](_0x24c14c);}};}function respondWithFilteredResult(_0x2a7d4f,_0x4c5dec){return function(_0xcdb32b){if(_0xcdb32b){var _0x2e0b4e=_0xcdb32b[_0xc008('0x2b')],_0x53ed35=_0x4c5dec[_0xc008('0x2c')],_0x58db82=_0x4c5dec[_0xc008('0x2c')]+_0x4c5dec[_0xc008('0x2d')],_0x539766;if(_0x58db82>=_0x2e0b4e){_0x58db82=_0x2e0b4e;_0x539766=0xc8;}else{_0x539766=0xce;}_0x2a7d4f[_0xc008('0x28')](_0x539766);return _0x2a7d4f[_0xc008('0x2e')](_0xc008('0x2f'),_0x53ed35+'-'+_0x58db82+'/'+_0x2e0b4e)[_0xc008('0x2a')](_0xcdb32b);}return null;};}function patchUpdates(_0x1fe1e1){return function(_0x2b862d){try{jsonpatch[_0xc008('0x30')](_0x2b862d,_0x1fe1e1,!![]);}catch(_0x1ac7c8){return BPromise['reject'](_0x1ac7c8);}return _0x2b862d[_0xc008('0x31')]();};}function saveUpdates(_0x4b7fd4,_0x499754){return function(_0xaf4b84){if(_0xaf4b84){return _0xaf4b84[_0xc008('0x32')](_0x4b7fd4)[_0xc008('0x20')](function(_0xca0520){return _0xca0520;});}return null;};}function removeEntity(_0xd0e05a,_0x3cd878){return function(_0x7cfbc5){if(_0x7cfbc5){return _0x7cfbc5[_0xc008('0x33')]()[_0xc008('0x20')](function(){_0xd0e05a['status'](0xcc)[_0xc008('0x29')]();});}};}function handleEntityNotFound(_0x389a40,_0x459df4){return function(_0x344bad){if(!_0x344bad){_0x389a40[_0xc008('0x34')](0x194);}return _0x344bad;};}function handleError(_0x315562,_0x1667a0){_0x1667a0=_0x1667a0||0x1f4;return function(_0x5d0e06){logger[_0xc008('0x23')](_0x5d0e06[_0xc008('0x35')]);if(_0x5d0e06['name']){delete _0x5d0e06[_0xc008('0x36')];}_0x315562[_0xc008('0x28')](_0x1667a0)['send'](_0x5d0e06);};}exports[_0xc008('0x37')]=function(_0x2e4ae1,_0x280e9b){var _0x55ff48={},_0x53b353={},_0x478810={'count':0x0,'rows':[]};var _0x234f2a=_['map'](db[_0xc008('0x38')][_0xc008('0x39')],function(_0x6a4ccb){return{'name':_0x6a4ccb[_0xc008('0x3a')],'type':_0x6a4ccb[_0xc008('0x3b')][_0xc008('0x3c')]};});_0x53b353[_0xc008('0x3d')]=_[_0xc008('0x3e')](_0x234f2a,_0xc008('0x36'));_0x53b353[_0xc008('0x3f')]=_[_0xc008('0x40')](_0x2e4ae1[_0xc008('0x3f')]);_0x53b353[_0xc008('0x41')]=_[_0xc008('0x42')](_0x53b353['model'],_0x53b353[_0xc008('0x3f')]);_0x55ff48[_0xc008('0x43')]=_[_0xc008('0x42')](_0x53b353[_0xc008('0x3d')],qs['fields'](_0x2e4ae1[_0xc008('0x3f')][_0xc008('0x44')]));_0x55ff48[_0xc008('0x43')]=_0x55ff48[_0xc008('0x43')][_0xc008('0x45')]?_0x55ff48['attributes']:_0x53b353[_0xc008('0x3d')];if(!_0x2e4ae1[_0xc008('0x3f')][_0xc008('0x46')](_0xc008('0x47'))){_0x55ff48[_0xc008('0x2d')]=qs['limit'](_0x2e4ae1[_0xc008('0x3f')][_0xc008('0x2d')]);_0x55ff48[_0xc008('0x2c')]=qs[_0xc008('0x2c')](_0x2e4ae1['query'][_0xc008('0x2c')]);}_0x55ff48[_0xc008('0x48')]=qs[_0xc008('0x49')](_0x2e4ae1['query'][_0xc008('0x49')]);_0x55ff48['where']=qs[_0xc008('0x41')](_['pick'](_0x2e4ae1[_0xc008('0x3f')],_0x53b353[_0xc008('0x41')]));if(_0x2e4ae1['query'][_0xc008('0x4a')]){_0x55ff48[_0xc008('0x4b')]=_[_0xc008('0x4c')](_0x55ff48['where'],{'$or':_[_0xc008('0x3e')](_0x234f2a,function(_0x2a9b5c){if(_0x2a9b5c[_0xc008('0x3b')][_0xc008('0x3c')]!==_0xc008('0x4d')){var _0x372305={};_0x372305[_0x2a9b5c['field']]={'$like':'%'+_0x2e4ae1['query']['filter']+'%'};return _0x372305;}})});}_0x55ff48=_[_0xc008('0x4c')]({},_0x55ff48,_0x2e4ae1[_0xc008('0x4e')]);var _0x103a83={'where':_0x55ff48[_0xc008('0x4b')]};return db[_0xc008('0x38')][_0xc008('0x2b')](_0x103a83)[_0xc008('0x20')](function(_0x33be4f){_0x478810['count']=_0x33be4f;if(_0x2e4ae1['query']['includeAll']){_0x55ff48[_0xc008('0x4f')]=[{'all':!![]}];}return db[_0xc008('0x38')][_0xc008('0x50')](_0x55ff48);})['then'](function(_0x28bc33){_0x478810[_0xc008('0x51')]=_0x28bc33;return _0x478810;})[_0xc008('0x20')](respondWithFilteredResult(_0x280e9b,_0x55ff48))[_0xc008('0x27')](handleError(_0x280e9b,null));};exports[_0xc008('0x52')]=function(_0x56e4ac,_0x17ec90){var _0x405e87={'raw':!![],'where':{'id':_0x56e4ac[_0xc008('0x53')]['id']}},_0x3fd7d9={};_0x3fd7d9['model']=_['keys'](db[_0xc008('0x38')]['rawAttributes']);_0x3fd7d9[_0xc008('0x3f')]=_[_0xc008('0x40')](_0x56e4ac[_0xc008('0x3f')]);_0x3fd7d9['filters']=_[_0xc008('0x42')](_0x3fd7d9[_0xc008('0x3d')],_0x3fd7d9[_0xc008('0x3f')]);_0x405e87[_0xc008('0x43')]=_[_0xc008('0x42')](_0x3fd7d9['model'],qs[_0xc008('0x44')](_0x56e4ac[_0xc008('0x3f')]['fields']));_0x405e87[_0xc008('0x43')]=_0x405e87[_0xc008('0x43')]['length']?_0x405e87['attributes']:_0x3fd7d9[_0xc008('0x3d')];if(_0x56e4ac[_0xc008('0x3f')][_0xc008('0x54')]){_0x405e87[_0xc008('0x4f')]=[{'all':!![]}];}_0x405e87=_[_0xc008('0x4c')]({},_0x405e87,_0x56e4ac['options']);return db['FaxMessage'][_0xc008('0x55')](_0x405e87)['then'](handleEntityNotFound(_0x17ec90,null))[_0xc008('0x20')](respondWithResult(_0x17ec90,null))[_0xc008('0x27')](handleError(_0x17ec90,null));};exports[_0xc008('0x32')]=function(_0x2f1105,_0x44f42d){if(_0x2f1105[_0xc008('0x56')]['id']){delete _0x2f1105['body']['id'];}return db[_0xc008('0x38')][_0xc008('0x55')]({'where':{'id':_0x2f1105[_0xc008('0x53')]['id']}})[_0xc008('0x20')](handleEntityNotFound(_0x44f42d,null))[_0xc008('0x20')](saveUpdates(_0x2f1105['body'],null))[_0xc008('0x20')](respondWithResult(_0x44f42d,null))['catch'](handleError(_0x44f42d,null));};exports['destroy']=function(_0x5dbfca,_0x89bb20){return db[_0xc008('0x38')][_0xc008('0x55')]({'where':{'id':_0x5dbfca['params']['id']}})[_0xc008('0x20')](handleEntityNotFound(_0x89bb20,null))[_0xc008('0x20')](removeEntity(_0x89bb20,null))[_0xc008('0x27')](handleError(_0x89bb20,null));};exports['describe']=function(_0x3587c3,_0x1092cb){return db[_0xc008('0x38')][_0xc008('0x57')]()['then'](respondWithResult(_0x1092cb,null))[_0xc008('0x27')](handleError(_0x1092cb,null));};var interaction_log=require('../../config/logger')(_0xc008('0x58'));exports[_0xc008('0x59')]=function(_0x2ae14e,_0x943c91,_0x192c87){var _0x4752f6={'channel':'fax'};if(_0x2ae14e[_0xc008('0x56')]['id']){delete _0x2ae14e['body']['id'];}_0x2ae14e['body'][_0xc008('0x5a')]=!![];_0x2ae14e[_0xc008('0x56')]['readAt']=moment()[_0xc008('0x5b')](_0xc008('0x5c'));_0x2ae14e[_0xc008('0x56')][_0xc008('0x5d')]=_0x2ae14e[_0xc008('0x56')][_0xc008('0x5d')]||_0x2ae14e[_0xc008('0x5e')]['id'];return db['FaxMessage'][_0xc008('0x55')]({'where':{'id':_0x2ae14e[_0xc008('0x53')]['id'],'UserId':null},'include':[{'model':db[_0xc008('0x5f')],'as':_0xc008('0x60')}]})[_0xc008('0x20')](handleEntityNotFound(_0x943c91,null))[_0xc008('0x20')](saveUpdates(_0x2ae14e[_0xc008('0x56')],null))[_0xc008('0x20')](function(_0xbc430a){if(_0xbc430a){_0x4752f6[_0xc008('0x25')]=_0xbc430a[_0xc008('0x61')]({'plain':!![]});return db[_0xc008('0x62')][_0xc008('0x55')]({'where':{'id':_0xbc430a[_0xc008('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x943c91,null))[_0xc008('0x20')](function(_0x2e5467){if(_0x2e5467){return _0x2e5467[_0xc008('0x32')]({'UserId':_0x2ae14e['body'][_0xc008('0x5d')],'read1stAt':_[_0xc008('0x64')](_0x2e5467['read1stAt'])?moment()['format'](_0xc008('0x5c')):undefined});}return null;})[_0xc008('0x20')](function(_0x7bad14){if(_0x7bad14){_0x4752f6[_0xc008('0x65')]=_0x7bad14[_0xc008('0x61')]({'plain':!![]});interaction_log[_0xc008('0x26')](_0xc008('0x66'),_0x2ae14e[_0xc008('0x5e')]['id'],_0x2ae14e[_0xc008('0x5e')][_0xc008('0x36')],_0x2ae14e[_0xc008('0x5e')]['role'],_0x4752f6[_0xc008('0x65')]['id'],_0x2ae14e[_0xc008('0x56')]?JSON[_0xc008('0x67')](_0x2ae14e[_0xc008('0x56')]):'null');return respondWithRpcPromise(_0xc008('0x68'),'acceptMessage',_0x4752f6);}return null;})[_0xc008('0x20')](function(_0x46fa7b){if(_0x46fa7b){if(_0x2ae14e[_0xc008('0x56')]['manual']){_0x4752f6[_0xc008('0x25')][_0xc008('0x69')]=util[_0xc008('0x5b')]('SIP/%s',_0x2ae14e[_0xc008('0x5e')]['name']);_0x4752f6[_0xc008('0x25')][_0xc008('0x6a')]=_0x4752f6[_0xc008('0x6a')];_0x4752f6[_0xc008('0x25')][_0xc008('0x6b')]='accept';return respondWithRpcPromise(_0xc008('0x6c'),_0xc008('0x6c'),{'event':'acceptmessage','message':_0x4752f6[_0xc008('0x25')]},client9002)['then'](function(){return _0x4752f6;});}return _0x4752f6;}return null;})[_0xc008('0x20')](respondWithResult(_0x943c91,null))['catch'](handleError(_0x943c91,null));};var interaction_log=require(_0xc008('0x13'))('fax-interactions');exports[_0xc008('0x6d')]=function(_0x103d75,_0x33d8e4,_0x47337b){var _0x5a94ff={'agent':{},'channel':_0xc008('0x6e')};if(_0x103d75[_0xc008('0x56')]['id']){delete _0x103d75[_0xc008('0x56')]['id'];}_0x103d75[_0xc008('0x56')][_0xc008('0x5d')]=_0x103d75[_0xc008('0x56')][_0xc008('0x5d')]||_0x103d75[_0xc008('0x5e')]['id'];_0x5a94ff['agent']['id']=_0x103d75[_0xc008('0x56')]['UserId'];return db['FaxMessage']['find']({'where':{'id':_0x103d75[_0xc008('0x53')]['id'],'UserId':null}})[_0xc008('0x20')](handleEntityNotFound(_0x33d8e4,null))[_0xc008('0x20')](function(_0x233a85){if(_0x233a85){_0x5a94ff[_0xc008('0x25')]=_0x233a85[_0xc008('0x61')]({'plain':!![]});return db[_0xc008('0x62')][_0xc008('0x55')]({'where':{'id':_0x233a85[_0xc008('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x33d8e4,null))[_0xc008('0x20')](function(_0x1e6055){if(_0x1e6055){_0x5a94ff[_0xc008('0x65')]=_0x1e6055[_0xc008('0x61')]({'plain':!![]});interaction_log[_0xc008('0x26')](_0xc008('0x6f'),_0x103d75[_0xc008('0x5e')]['id'],_0x103d75[_0xc008('0x5e')][_0xc008('0x36')],_0x103d75[_0xc008('0x5e')][_0xc008('0x70')],_0x5a94ff[_0xc008('0x65')]['id'],_0x103d75['body']?JSON['stringify'](_0x103d75[_0xc008('0x56')]):_0xc008('0x71'));return respondWithRpcPromise(_0xc008('0x72'),'rejectMessage',_0x5a94ff);}return null;})[_0xc008('0x20')](function(_0x312fa9){if(_0x312fa9){_0x312fa9['message']['interface']=util['format'](_0xc008('0x73'),_0x103d75[_0xc008('0x5e')][_0xc008('0x36')]);_0x312fa9[_0xc008('0x25')][_0xc008('0x6a')]=_0x5a94ff[_0xc008('0x6a')];_0x312fa9[_0xc008('0x25')][_0xc008('0x6b')]=_0xc008('0x6d');respondWithRpcPromise(_0xc008('0x6c'),'EventManager',{'event':'rejectmessage','message':_0x312fa9[_0xc008('0x25')]},client9002);return _0x5a94ff;}return null;})[_0xc008('0x20')](respondWithResult(_0x33d8e4,null))[_0xc008('0x27')](handleError(_0x33d8e4,null));};exports[_0xc008('0x74')]=function(_0x2b94b2,_0x37fc2c){var _0x4b434f;return db['FaxMessage'][_0xc008('0x74')](_0x2b94b2[_0xc008('0x56')],{})[_0xc008('0x20')](function(_0x558105){_0x4b434f=_0x558105;return db['CmContact']['findOne']({'where':{'id':_0x4b434f['ContactId']}});})['then'](function(_0x5a29da){if(_[_0xc008('0x64')](_0x5a29da)){return;}else{_0x4b434f['fax']=_0x5a29da[_0xc008('0x6e')];return db['Attachment'][_0xc008('0x75')]({'where':{'id':_0x4b434f[_0xc008('0x76')]}});}})[_0xc008('0x20')](function(_0x5bc8b0){return respondWithRpcPromise('SendFax',_0xc008('0x77'),{'FaxAccountId':_['isNil'](_0x2b94b2[_0xc008('0x56')])?undefined:_0x2b94b2[_0xc008('0x56')]['FaxAccountId'],'path':_[_0xc008('0x64')](_0x5bc8b0)?undefined:util['format']('/var/opt/motion2/server/files/attachments/%s',_0x5bc8b0[_0xc008('0x78')]),'fax':_[_0xc008('0x64')](_0x4b434f['fax'])?undefined:_0x4b434f[_0xc008('0x6e')],'AttachmentId':_0x4b434f[_0xc008('0x76')]},client9002);})[_0xc008('0x20')](respondWithResult(_0x37fc2c,0xc9))['catch'](handleError(_0x37fc2c,null));};exports[_0xc008('0x79')]=function(_0x17c1d8,_0x1181c5){var _0x29da7d=path[_0xc008('0x7a')](config[_0xc008('0x7b')],'server',_0xc008('0x7c'),_0xc008('0x7d'));return db[_0xc008('0x38')]['find']({'where':{'id':_0x17c1d8[_0xc008('0x53')]['id']},'include':[{'model':db[_0xc008('0x7e')],'as':_0xc008('0x7e')}]})['then'](handleEntityNotFound(_0x1181c5,null))['then'](function(_0x4efcf5){if(_0x4efcf5){return _0x1181c5[_0xc008('0x79')](path[_0xc008('0x7a')](_0x29da7d,_0x4efcf5[_0xc008('0x7e')][_0xc008('0x78')]));}})[_0xc008('0x27')](handleError(_0x1181c5,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index ca295b4..4a89888 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 _0xb1d1=['remove','hasOwnProperty','../../mysqldb','setMaxListeners','update'];(function(_0x75e143,_0x218710){var _0xdddfdb=function(_0x32d694){while(--_0x32d694){_0x75e143['push'](_0x75e143['shift']());}};_0xdddfdb(++_0x218710);}(_0xb1d1,0x1a1));var _0x1b1d=function(_0x41ef76,_0x5c1d05){_0x41ef76=_0x41ef76-0x0;var _0x272688=_0xb1d1[_0x41ef76];return _0x272688;};'use strict';var EventEmitter=require('events');var FaxMessage=require(_0x1b1d('0x0'))['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x1b1d('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1b1d('0x2'),'afterDestroy':_0x1b1d('0x3')};function emitEvent(_0x1270e5){return function(_0x5c710f,_0x198872,_0x21a547){FaxMessageEvents['emit'](_0x1270e5+':'+_0x5c710f['id'],_0x5c710f);FaxMessageEvents['emit'](_0x1270e5,_0x5c710f);_0x21a547(null);};}for(var e in events){if(events[_0x1b1d('0x4')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file +var _0x5777=['setMaxListeners','update','remove','emit','hasOwnProperty','exports','../../mysqldb','FaxMessage'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x5777,0xde));var _0x7577=function(_0x4c56b6,_0x239082){_0x4c56b6=_0x4c56b6-0x0;var _0x1ee73a=_0x5777[_0x4c56b6];return _0x1ee73a;};'use strict';var EventEmitter=require('events');var FaxMessage=require(_0x7577('0x0'))['db'][_0x7577('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x7577('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7577('0x3'),'afterDestroy':_0x7577('0x4')};function emitEvent(_0x518c2b){return function(_0x36525e,_0x208dfa,_0x5182f1){FaxMessageEvents[_0x7577('0x5')](_0x518c2b+':'+_0x36525e['id'],_0x36525e);FaxMessageEvents[_0x7577('0x5')](_0x518c2b,_0x36525e);_0x5182f1(null);};}for(var e in events){if(events[_0x7577('0x6')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0x7577('0x7')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 07da62a..1c34b1d 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 _0x462a=['FaxInteraction','findOne','FaxInteractionId','catch','error','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./faxMessage.attributes','exports','define','FaxMessage','fti_fax_messages','body','FULLTEXT','models','get','toLowerCase','out','secret','isNil','UserId'];(function(_0x817d9b,_0x3c37e3){var _0x2752e1=function(_0x2b434e){while(--_0x2b434e){_0x817d9b['push'](_0x817d9b['shift']());}};_0x2752e1(++_0x3c37e3);}(_0x462a,0x12e));var _0xa462=function(_0x249bdc,_0x3898d6){_0x249bdc=_0x249bdc-0x0;var _0x4ec6cb=_0x462a[_0x249bdc];return _0x4ec6cb;};'use strict';var _=require(_0xa462('0x0'));var util=require(_0xa462('0x1'));var logger=require('../../config/logger')(_0xa462('0x2'));var moment=require(_0xa462('0x3'));var BPromise=require(_0xa462('0x4'));var rp=require(_0xa462('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa462('0x6'));var config=require(_0xa462('0x7'));var attributes=require(_0xa462('0x8'));module[_0xa462('0x9')]=function(_0xe759d6,_0x2e6c89){return _0xe759d6[_0xa462('0xa')](_0xa462('0xb'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0xa462('0xc'),'fields':[_0xa462('0xd')],'type':_0xa462('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5df316,_0x47a886,_0x320560){var _0x48c53b=_0xe759d6[_0xa462('0xf')];var _0x52551e=_0x5df316[_0xa462('0x10')]({'plain':!![]});if(_0x52551e['direction'][_0xa462('0x11')]()==='in'||_0x52551e['direction'][_0xa462('0x11')]()===_0xa462('0x12')&&!_0x52551e[_0xa462('0x13')]&&!_[_0xa462('0x14')](_0x52551e[_0xa462('0x15')])){_0x48c53b[_0xa462('0x16')][_0xa462('0x17')]({'where':{'id':_0x52551e[_0xa462('0x18')]}})['then'](function(_0x4b4da8){if(_0x4b4da8){_0x4b4da8['update']({'lastMsgAt':_0x52551e['createdAt'],'lastMsgDirection':_0x52551e['direction'][_0xa462('0x11')]()});}})[_0xa462('0x19')](function(_0x4438cd){console[_0xa462('0x1a')](_0x4438cd);});}_0x320560();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x4394=['findOne','then','createdAt','catch','error','utf8mb4','lodash','util','moment','bluebird','path','./faxMessage.attributes','define','FaxMessage','fax_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','FaxInteraction'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x4394,0x10a));var _0x4439=function(_0x51df00,_0x4ac573){_0x51df00=_0x51df00-0x0;var _0x198328=_0x4394[_0x51df00];return _0x198328;};'use strict';var _=require(_0x4439('0x0'));var util=require(_0x4439('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x4439('0x2'));var BPromise=require(_0x4439('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4439('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4439('0x5'));module['exports']=function(_0x28b4ca,_0x2721ca){return _0x28b4ca[_0x4439('0x6')](_0x4439('0x7'),attributes,{'tableName':_0x4439('0x8'),'paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0x4439('0x9')],'type':_0x4439('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x41ee9e,_0x4c6089,_0x443c92){var _0x364af6=_0x28b4ca[_0x4439('0xb')];var _0x2d0b80=_0x41ee9e[_0x4439('0xc')]({'plain':!![]});if(_0x2d0b80[_0x4439('0xd')][_0x4439('0xe')]()==='in'||_0x2d0b80['direction'][_0x4439('0xe')]()===_0x4439('0xf')&&!_0x2d0b80[_0x4439('0x10')]&&!_[_0x4439('0x11')](_0x2d0b80[_0x4439('0x12')])){_0x364af6[_0x4439('0x13')][_0x4439('0x14')]({'where':{'id':_0x2d0b80['FaxInteractionId']}})[_0x4439('0x15')](function(_0x13976d){if(_0x13976d){_0x13976d['update']({'lastMsgAt':_0x2d0b80[_0x4439('0x16')],'lastMsgDirection':_0x2d0b80[_0x4439('0xd')]['toLowerCase']()});}})[_0x4439('0x17')](function(_0x9cf978){console[_0x4439('0x18')](_0x9cf978);});}_0x443c92();}},'charset':_0x4439('0x19'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 313a0a3..ee3b6a1 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 _0x069d=['attributes','catch','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateFaxMessage','create','body','options','UpdateFaxMessage','FaxMessage','update','raw','where'];(function(_0x4abd36,_0x23c455){var _0x2c7f59=function(_0x3b0ed9){while(--_0x3b0ed9){_0x4abd36['push'](_0x4abd36['shift']());}};_0x2c7f59(++_0x23c455);}(_0x069d,0x11a));var _0xd069=function(_0x5c22df,_0x4f70a7){_0x5c22df=_0x5c22df-0x0;var _0x198572=_0x069d[_0x5c22df];return _0x198572;};'use strict';var _=require(_0xd069('0x0'));var util=require('util');var moment=require(_0xd069('0x1'));var BPromise=require('bluebird');var rs=require(_0xd069('0x2'));var fs=require('fs');var Redis=require(_0xd069('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xd069('0x4'));var logger=require(_0xd069('0x5'))('rpc');var config=require(_0xd069('0x6'));var jayson=require(_0xd069('0x7'));var client=jayson['client'][_0xd069('0x8')]({'port':0x232a});config[_0xd069('0x9')]=_['defaults'](config[_0xd069('0x9')],{'host':_0xd069('0xa'),'port':0x18eb});var socket=require(_0xd069('0xb'))(new Redis(config['redis']));require('./faxMessage.socket')['register'](socket);function respondWithRpcPromise(_0x24b3d7,_0x3e0233,_0x439bfa){return new BPromise(function(_0x339852,_0x217d2c){return client[_0xd069('0xc')](_0x24b3d7,_0x439bfa)[_0xd069('0xd')](function(_0xddefd7){logger[_0xd069('0xe')](_0xd069('0xf'),_0x3e0233,_0xd069('0x10'));logger[_0xd069('0x11')](_0xd069('0x12'),_0x3e0233,'request\x20sent',JSON[_0xd069('0x13')](_0xddefd7));if(_0xddefd7['error']){if(_0xddefd7[_0xd069('0x14')][_0xd069('0x15')]===0x1f4){logger[_0xd069('0x14')](_0xd069('0xf'),_0x3e0233,_0xddefd7[_0xd069('0x14')][_0xd069('0x16')]);return _0x217d2c(_0xddefd7['error'][_0xd069('0x16')]);}logger['error'](_0xd069('0xf'),_0x3e0233,_0xddefd7[_0xd069('0x14')]['message']);return _0x339852(_0xddefd7[_0xd069('0x14')][_0xd069('0x16')]);}else{logger[_0xd069('0xe')](_0xd069('0xf'),_0x3e0233,_0xd069('0x10'));_0x339852(_0xddefd7[_0xd069('0x17')][_0xd069('0x16')]);}})['catch'](function(_0x2e30a0){logger['error']('FaxMessage,\x20%s,\x20%s',_0x3e0233,_0x2e30a0);_0x217d2c(_0x2e30a0);});});}exports[_0xd069('0x18')]=function(_0x286181){var _0x1db98a=this;return new Promise(function(_0x58963b,_0x141e06){return db['FaxMessage'][_0xd069('0x19')](_0x286181[_0xd069('0x1a')],{'raw':_0x286181[_0xd069('0x1b')]?_0x286181[_0xd069('0x1b')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1667fb){logger['info'](_0xd069('0x18'),_0x286181);logger[_0xd069('0x11')](_0xd069('0x18'),_0x286181,JSON[_0xd069('0x13')](_0x1667fb));_0x58963b(_0x1667fb);})['catch'](function(_0x3df557){logger['error'](_0xd069('0x18'),_0x3df557[_0xd069('0x16')],_0x286181);_0x141e06(_0x1db98a[_0xd069('0x14')](0x1f4,_0x3df557[_0xd069('0x16')]));});});};exports[_0xd069('0x1c')]=function(_0x3f9bd7){var _0x18e0ca=this;return new Promise(function(_0x36eef0,_0x3c4356){return db[_0xd069('0x1d')][_0xd069('0x1e')](_0x3f9bd7[_0xd069('0x1a')],{'raw':_0x3f9bd7[_0xd069('0x1b')]?_0x3f9bd7[_0xd069('0x1b')][_0xd069('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f9bd7[_0xd069('0x1b')]?_0x3f9bd7[_0xd069('0x1b')][_0xd069('0x20')]||null:null,'attributes':_0x3f9bd7[_0xd069('0x1b')]?_0x3f9bd7[_0xd069('0x1b')][_0xd069('0x21')]||null:null,'limit':_0x3f9bd7['options']?_0x3f9bd7[_0xd069('0x1b')]['limit']||null:null})[_0xd069('0xd')](function(_0x490baa){logger[_0xd069('0xe')](_0xd069('0x1c'),_0x3f9bd7);logger[_0xd069('0x11')]('UpdateFaxMessage',_0x3f9bd7,JSON['stringify'](_0x490baa));_0x36eef0(_0x490baa);})[_0xd069('0x22')](function(_0x4474d6){logger['error']('UpdateFaxMessage',_0x4474d6['message'],_0x3f9bd7);_0x3c4356(_0x18e0ca['error'](0x1f4,_0x4474d6[_0xd069('0x16')]));});});}; \ No newline at end of file +var _0x03da=['result','catch','CreateFaxMessage','FaxMessage','body','options','raw','debug','UpdateFaxMessage','update','where','attributes','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','stringify','error','message'];(function(_0x2bff69,_0x677dec){var _0x109e8a=function(_0x3b1950){while(--_0x3b1950){_0x2bff69['push'](_0x2bff69['shift']());}};_0x109e8a(++_0x677dec);}(_0x03da,0xec));var _0xa03d=function(_0x19d0b6,_0x85209a){_0x19d0b6=_0x19d0b6-0x0;var _0x16060b=_0x03da[_0x19d0b6];return _0x16060b;};'use strict';var _=require(_0xa03d('0x0'));var util=require(_0xa03d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa03d('0x2'));var fs=require('fs');var Redis=require(_0xa03d('0x3'));var db=require(_0xa03d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa03d('0x5'))(_0xa03d('0x6'));var config=require(_0xa03d('0x7'));var jayson=require(_0xa03d('0x8'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_['defaults'](config[_0xa03d('0x9')],{'host':_0xa03d('0xa'),'port':0x18eb});var socket=require(_0xa03d('0xb'))(new Redis(config[_0xa03d('0x9')]));require('./faxMessage.socket')['register'](socket);function respondWithRpcPromise(_0x296270,_0x293171,_0x43e2f8){return new BPromise(function(_0x373f2c,_0x50e9cd){return client[_0xa03d('0xc')](_0x296270,_0x43e2f8)[_0xa03d('0xd')](function(_0x1ce60c){logger[_0xa03d('0xe')](_0xa03d('0xf'),_0x293171,_0xa03d('0x10'));logger['debug']('FaxMessage,\x20%s,\x20%s,\x20%s',_0x293171,_0xa03d('0x10'),JSON[_0xa03d('0x11')](_0x1ce60c));if(_0x1ce60c[_0xa03d('0x12')]){if(_0x1ce60c['error']['code']===0x1f4){logger[_0xa03d('0x12')](_0xa03d('0xf'),_0x293171,_0x1ce60c[_0xa03d('0x12')][_0xa03d('0x13')]);return _0x50e9cd(_0x1ce60c[_0xa03d('0x12')][_0xa03d('0x13')]);}logger['error']('FaxMessage,\x20%s,\x20%s',_0x293171,_0x1ce60c[_0xa03d('0x12')][_0xa03d('0x13')]);return _0x373f2c(_0x1ce60c[_0xa03d('0x12')][_0xa03d('0x13')]);}else{logger[_0xa03d('0xe')]('FaxMessage,\x20%s,\x20%s',_0x293171,_0xa03d('0x10'));_0x373f2c(_0x1ce60c[_0xa03d('0x14')][_0xa03d('0x13')]);}})[_0xa03d('0x15')](function(_0x3c9388){logger[_0xa03d('0x12')](_0xa03d('0xf'),_0x293171,_0x3c9388);_0x50e9cd(_0x3c9388);});});}exports[_0xa03d('0x16')]=function(_0x4250a7){var _0x39d205=this;return new Promise(function(_0x408c6e,_0x321297){return db[_0xa03d('0x17')]['create'](_0x4250a7[_0xa03d('0x18')],{'raw':_0x4250a7[_0xa03d('0x19')]?_0x4250a7[_0xa03d('0x19')][_0xa03d('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x1e97de){logger[_0xa03d('0xe')]('CreateFaxMessage',_0x4250a7);logger[_0xa03d('0x1b')](_0xa03d('0x16'),_0x4250a7,JSON[_0xa03d('0x11')](_0x1e97de));_0x408c6e(_0x1e97de);})[_0xa03d('0x15')](function(_0x1bf9c1){logger[_0xa03d('0x12')](_0xa03d('0x16'),_0x1bf9c1[_0xa03d('0x13')],_0x4250a7);_0x321297(_0x39d205[_0xa03d('0x12')](0x1f4,_0x1bf9c1[_0xa03d('0x13')]));});});};exports[_0xa03d('0x1c')]=function(_0x5b3255){var _0xf32893=this;return new Promise(function(_0x4d63f4,_0x9999fc){return db[_0xa03d('0x17')][_0xa03d('0x1d')](_0x5b3255['body'],{'raw':_0x5b3255[_0xa03d('0x19')]?_0x5b3255['options'][_0xa03d('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5b3255[_0xa03d('0x19')]?_0x5b3255['options'][_0xa03d('0x1e')]||null:null,'attributes':_0x5b3255[_0xa03d('0x19')]?_0x5b3255[_0xa03d('0x19')][_0xa03d('0x1f')]||null:null,'limit':_0x5b3255[_0xa03d('0x19')]?_0x5b3255[_0xa03d('0x19')]['limit']||null:null})[_0xa03d('0xd')](function(_0x2a3f54){logger[_0xa03d('0xe')]('UpdateFaxMessage',_0x5b3255);logger[_0xa03d('0x1b')](_0xa03d('0x1c'),_0x5b3255,JSON[_0xa03d('0x11')](_0x2a3f54));_0x4d63f4(_0x2a3f54);})['catch'](function(_0x25c857){logger[_0xa03d('0x12')](_0xa03d('0x1c'),_0x25c857[_0xa03d('0x13')],_0x5b3255);_0x9999fc(_0xf32893[_0xa03d('0x12')](0x1f4,_0x25c857[_0xa03d('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 158f0d4..c0e9c8d 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 _0x9957=['register','length','faxMessage:','./faxMessage.events','save','remove','update','emit','removeListener'];(function(_0x2ff4bd,_0x4780a6){var _0x28edc6=function(_0x792380){while(--_0x792380){_0x2ff4bd['push'](_0x2ff4bd['shift']());}};_0x28edc6(++_0x4780a6);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var FaxMessageEvents=require(_0x7995('0x0'));var events=[_0x7995('0x1'),_0x7995('0x2'),_0x7995('0x3')];function createListener(_0x5b96eb,_0x86c128){return function(_0x3c58eb){_0x86c128[_0x7995('0x4')](_0x5b96eb,_0x3c58eb);};}function removeListener(_0x462a03,_0x576d89){return function(){FaxMessageEvents[_0x7995('0x5')](_0x462a03,_0x576d89);};}exports[_0x7995('0x6')]=function(_0x137b6b){for(var _0x219534=0x0,_0xbda126=events[_0x7995('0x7')];_0x219534<_0xbda126;_0x219534++){var _0x4996ca=events[_0x219534];var _0x465276=createListener(_0x7995('0x8')+_0x4996ca,_0x137b6b);FaxMessageEvents['on'](_0x4996ca,_0x465276);}}; \ No newline at end of file +var _0x9957=['register','length','faxMessage:','./faxMessage.events','save','remove','update','emit','removeListener'];(function(_0x5ce15c,_0x19c917){var _0x36e4f5=function(_0x50fa90){while(--_0x50fa90){_0x5ce15c['push'](_0x5ce15c['shift']());}};_0x36e4f5(++_0x19c917);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var FaxMessageEvents=require(_0x7995('0x0'));var events=[_0x7995('0x1'),_0x7995('0x2'),_0x7995('0x3')];function createListener(_0x5b96eb,_0x86c128){return function(_0x3c58eb){_0x86c128[_0x7995('0x4')](_0x5b96eb,_0x3c58eb);};}function removeListener(_0x462a03,_0x576d89){return function(){FaxMessageEvents[_0x7995('0x5')](_0x462a03,_0x576d89);};}exports[_0x7995('0x6')]=function(_0x137b6b){for(var _0x219534=0x0,_0xbda126=events[_0x7995('0x7')];_0x219534<_0xbda126;_0x219534++){var _0x4996ca=events[_0x219534];var _0x465276=createListener(_0x7995('0x8')+_0x4996ca,_0x137b6b);FaxMessageEvents['on'](_0x4996ca,_0x465276);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index afd7701..bb7a1b1 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 _0x4724=['/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','./faxMessage.controller','isAuthenticated','index','get','describe','/:id','download','post','tracked','faxmessage:create','create','put','update'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4724,0xcf));var _0x4472=function(_0x4a23a9,_0x17a2c0){_0x4a23a9=_0x4a23a9-0x0;var _0x18c27f=_0x4724[_0x4a23a9];return _0x18c27f;};'use strict';var multer=require(_0x4472('0x0'));var util=require(_0x4472('0x1'));var path=require(_0x4472('0x2'));var timeout=require(_0x4472('0x3'));var express=require(_0x4472('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4472('0x5'));router['get']('/',auth[_0x4472('0x6')](),controller[_0x4472('0x7')]);router[_0x4472('0x8')]('/describe',auth[_0x4472('0x6')](),controller[_0x4472('0x9')]);router[_0x4472('0x8')](_0x4472('0xa'),auth[_0x4472('0x6')](),controller['show']);router['get']('/:id/download',auth[_0x4472('0x6')](),controller[_0x4472('0xb')]);router[_0x4472('0xc')]('/',auth['isAuthenticated'](),interaction[_0x4472('0xd')]('fax',_0x4472('0xe')),controller[_0x4472('0xf')]);router[_0x4472('0x10')](_0x4472('0xa'),auth[_0x4472('0x6')](),controller[_0x4472('0x11')]);router[_0x4472('0x10')](_0x4472('0x12'),auth[_0x4472('0x6')](),controller[_0x4472('0x13')]);router[_0x4472('0x10')](_0x4472('0x14'),auth[_0x4472('0x6')](),controller[_0x4472('0x15')]);router[_0x4472('0x16')]('/:id',auth[_0x4472('0x6')](),controller[_0x4472('0x17')]);module[_0x4472('0x18')]=router; \ No newline at end of file +var _0x39be=['/:id/accept','accept','/:id/reject','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','describe','show','/:id/download','download','post','tracked','fax','faxmessage:create','create','put','/:id','update'];(function(_0x4498ac,_0x30e301){var _0x4bf1b6=function(_0x117f33){while(--_0x117f33){_0x4498ac['push'](_0x4498ac['shift']());}};_0x4bf1b6(++_0x30e301);}(_0x39be,0x19a));var _0xe39b=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x39be[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0xe39b('0x0'));var util=require(_0xe39b('0x1'));var path=require(_0xe39b('0x2'));var timeout=require('connect-timeout');var express=require(_0xe39b('0x3'));var router=express[_0xe39b('0x4')]();var auth=require(_0xe39b('0x5'));var interaction=require(_0xe39b('0x6'));var config=require('../../config/environment');var controller=require('./faxMessage.controller');router[_0xe39b('0x7')]('/',auth[_0xe39b('0x8')](),controller['index']);router['get'](_0xe39b('0x9'),auth[_0xe39b('0x8')](),controller[_0xe39b('0xa')]);router[_0xe39b('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xe39b('0xb')]);router[_0xe39b('0x7')](_0xe39b('0xc'),auth[_0xe39b('0x8')](),controller[_0xe39b('0xd')]);router[_0xe39b('0xe')]('/',auth[_0xe39b('0x8')](),interaction[_0xe39b('0xf')](_0xe39b('0x10'),_0xe39b('0x11')),controller[_0xe39b('0x12')]);router[_0xe39b('0x13')](_0xe39b('0x14'),auth[_0xe39b('0x8')](),controller[_0xe39b('0x15')]);router[_0xe39b('0x13')](_0xe39b('0x16'),auth[_0xe39b('0x8')](),controller[_0xe39b('0x17')]);router['put'](_0xe39b('0x18'),auth['isAuthenticated'](),controller['reject']);router['delete'](_0xe39b('0x14'),auth[_0xe39b('0x8')](),controller[_0xe39b('0x19')]);module[_0xe39b('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 d3a9904..bd90433 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 _0xbd94=['roundrobin','sequelize','name','INTEGER','ENUM','rrmemory'];(function(_0x235e2b,_0x232235){var _0x4e9f0a=function(_0x2f5bf2){while(--_0x2f5bf2){_0x235e2b['push'](_0x235e2b['shift']());}};_0x4e9f0a(++_0x232235);}(_0xbd94,0xfd));var _0x4bd9=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xbd94[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require(_0x4bd9('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x4bd9('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x4bd9('0x2')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4bd9('0x3')](_0x4bd9('0x4'),'beepall',_0x4bd9('0x5')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x4bd9('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc570=['INTEGER','ENUM','rrmemory','beepall','exports','STRING'];(function(_0x1c8af1,_0x835095){var _0x1192be=function(_0x171525){while(--_0x171525){_0x1c8af1['push'](_0x1c8af1['shift']());}};_0x1192be(++_0x835095);}(_0xc570,0x142));var _0x0c57=function(_0x54d4a8,_0x585a59){_0x54d4a8=_0x54d4a8-0x0;var _0x3b321b=_0xc570[_0x54d4a8];return _0x3b321b;};'use strict';var Sequelize=require('sequelize');module[_0x0c57('0x0')]={'name':{'type':Sequelize[_0x0c57('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x0c57('0x2')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0c57('0x3')](_0x0c57('0x4'),_0x0c57('0x5'),'roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.controller.js b/server/api/faxQueue/faxQueue.controller.js index 4efc33e..043040f 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 _0x3c34=['set','apply','reject','update','then','get','FaxQueues','UserProfileResource','destroy','error','name','status','send','index','map','FaxQueue','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','field','includeAll','findAll','rows','show','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','params','UserFaxQueue','FaxQueueId','filter','options','findAndCountAll','UserId','agent','faxPause','updatedAt','createdAt','format','SIP','getTeams','findOne','Team','addTeams','User','Agents','online','voicePause','interface','flatMap','each','findOrCreate','forEach','emit','removeTeams','ids','select','tq.TeamId','team_has_fax_queues','join','user_has_teams','FaxQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','sequelize','QueryTypes','all','union','compact','value','transaction','removeAgents','userFaxQueue:remove','addAgents','omit','spread','userFaxQueue:save','isArray','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','redis','socket.io-emitter','register','sendStatus','end','json','count','offset','limit'];(function(_0x1b1c20,_0x239497){var _0x146201=function(_0x59faa5){while(--_0x59faa5){_0x1b1c20['push'](_0x1b1c20['shift']());}};_0x146201(++_0x239497);}(_0x3c34,0xf7));var _0x43c3=function(_0x2d61b2,_0x142947){_0x2d61b2=_0x2d61b2-0x0;var _0x12df89=_0x3c34[_0x2d61b2];return _0x12df89;};'use strict';var pdf=require(_0x43c3('0x0'));var emlformat=require(_0x43c3('0x1'));var rimraf=require(_0x43c3('0x2'));var zipdir=require(_0x43c3('0x3'));var jsonpatch=require(_0x43c3('0x4'));var rp=require(_0x43c3('0x5'));var moment=require(_0x43c3('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x43c3('0x7'));var util=require(_0x43c3('0x8'));var path=require(_0x43c3('0x9'));var sox=require(_0x43c3('0xa'));var csv=require(_0x43c3('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x43c3('0xc'));var squel=require('squel');var crypto=require(_0x43c3('0xd'));var jsforce=require(_0x43c3('0xe'));var deskjs=require(_0x43c3('0xf'));var toCsv=require(_0x43c3('0xb'));var querystring=require(_0x43c3('0x10'));var Papa=require(_0x43c3('0x11'));var Redis=require('ioredis');var authService=require(_0x43c3('0x12'));var qs=require(_0x43c3('0x13'));var as=require(_0x43c3('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x43c3('0x15'));var utils=require('../../config/utils');var config=require(_0x43c3('0x16'));var db=require(_0x43c3('0x17'))['db'];config[_0x43c3('0x18')]=_['defaults'](config[_0x43c3('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x43c3('0x19'))(new Redis(config[_0x43c3('0x18')]));require('./faxQueue.socket')[_0x43c3('0x1a')](socket);function respondWithStatusCode(_0x148d5b,_0x37a225){_0x37a225=_0x37a225||0xcc;return function(_0x1e9922){if(_0x1e9922){return _0x148d5b[_0x43c3('0x1b')](_0x37a225);}return _0x148d5b['status'](_0x37a225)[_0x43c3('0x1c')]();};}function respondWithResult(_0x11ca52,_0x1ec854){_0x1ec854=_0x1ec854||0xc8;return function(_0x572a5b){if(_0x572a5b){return _0x11ca52['status'](_0x1ec854)[_0x43c3('0x1d')](_0x572a5b);}};}function respondWithFilteredResult(_0x20a146,_0x3d429d){return function(_0x4296d6){if(_0x4296d6){var _0x4e7588=_0x4296d6[_0x43c3('0x1e')],_0x106a6b=_0x3d429d[_0x43c3('0x1f')],_0x215848=_0x3d429d['offset']+_0x3d429d[_0x43c3('0x20')],_0x550b3f;if(_0x215848>=_0x4e7588){_0x215848=_0x4e7588;_0x550b3f=0xc8;}else{_0x550b3f=0xce;}_0x20a146['status'](_0x550b3f);return _0x20a146[_0x43c3('0x21')]('Content-Range',_0x106a6b+'-'+_0x215848+'/'+_0x4e7588)[_0x43c3('0x1d')](_0x4296d6);}return null;};}function patchUpdates(_0x2fe113){return function(_0x147489){try{jsonpatch[_0x43c3('0x22')](_0x147489,_0x2fe113,!![]);}catch(_0xda2300){return BPromise[_0x43c3('0x23')](_0xda2300);}return _0x147489['save']();};}function saveUpdates(_0xb950a8,_0x194aba){return function(_0x5a01fd){if(_0x5a01fd){return _0x5a01fd[_0x43c3('0x24')](_0xb950a8)['then'](function(_0x2d6529){return _0x2d6529;});}return null;};}function removeEntity(_0x3d6276,_0x4dc1ce){return function(_0x8e9809){if(_0x8e9809){return _0x8e9809['destroy']()[_0x43c3('0x25')](function(){var _0x2a4551=_0x8e9809[_0x43c3('0x26')]({'plain':!![]});var _0x2e9225=_0x43c3('0x27');return db[_0x43c3('0x28')][_0x43c3('0x29')]({'where':{'type':_0x2e9225,'resourceId':_0x2a4551['id']}})[_0x43c3('0x25')](function(){return _0x8e9809;});})[_0x43c3('0x25')](function(){_0x3d6276['status'](0xcc)[_0x43c3('0x1c')]();});}};}function handleEntityNotFound(_0x21e32e,_0x8af52c){return function(_0x64a3e4){if(!_0x64a3e4){_0x21e32e['sendStatus'](0x194);}return _0x64a3e4;};}function handleError(_0x49e36f,_0x1f3801){_0x1f3801=_0x1f3801||0x1f4;return function(_0x96424b){logger[_0x43c3('0x2a')](_0x96424b['stack']);if(_0x96424b[_0x43c3('0x2b')]){delete _0x96424b['name'];}_0x49e36f[_0x43c3('0x2c')](_0x1f3801)[_0x43c3('0x2d')](_0x96424b);};}exports[_0x43c3('0x2e')]=function(_0x404e68,_0x3c2bca){var _0x35eacf={},_0x53f86b={},_0x31e53c={'count':0x0,'rows':[]};var _0x574692=_[_0x43c3('0x2f')](db[_0x43c3('0x30')][_0x43c3('0x31')],function(_0xda22f8){return{'name':_0xda22f8[_0x43c3('0x32')],'type':_0xda22f8[_0x43c3('0x33')][_0x43c3('0x34')]};});_0x53f86b['model']=_[_0x43c3('0x2f')](_0x574692,'name');_0x53f86b[_0x43c3('0x35')]=_[_0x43c3('0x36')](_0x404e68['query']);_0x53f86b[_0x43c3('0x37')]=_[_0x43c3('0x38')](_0x53f86b[_0x43c3('0x39')],_0x53f86b['query']);_0x35eacf['attributes']=_[_0x43c3('0x38')](_0x53f86b[_0x43c3('0x39')],qs[_0x43c3('0x3a')](_0x404e68[_0x43c3('0x35')][_0x43c3('0x3a')]));_0x35eacf['attributes']=_0x35eacf[_0x43c3('0x3b')][_0x43c3('0x3c')]?_0x35eacf[_0x43c3('0x3b')]:_0x53f86b['model'];if(!_0x404e68['query'][_0x43c3('0x3d')](_0x43c3('0x3e'))){_0x35eacf[_0x43c3('0x20')]=qs[_0x43c3('0x20')](_0x404e68['query'][_0x43c3('0x20')]);_0x35eacf[_0x43c3('0x1f')]=qs['offset'](_0x404e68[_0x43c3('0x35')]['offset']);}_0x35eacf[_0x43c3('0x3f')]=qs['sort'](_0x404e68[_0x43c3('0x35')][_0x43c3('0x40')]);_0x35eacf[_0x43c3('0x41')]=qs[_0x43c3('0x37')](_[_0x43c3('0x42')](_0x404e68['query'],_0x53f86b['filters']));if(_0x404e68[_0x43c3('0x35')]['filter']){_0x35eacf[_0x43c3('0x41')]=_[_0x43c3('0x43')](_0x35eacf['where'],{'$or':_[_0x43c3('0x2f')](_0x574692,function(_0x3ac770){if(_0x3ac770[_0x43c3('0x33')][_0x43c3('0x34')]!==_0x43c3('0x44')){var _0x5a4a19={};_0x5a4a19[_0x3ac770[_0x43c3('0x45')]]={'$like':'%'+_0x404e68['query']['filter']+'%'};return _0x5a4a19;}})});}_0x35eacf=_[_0x43c3('0x43')]({},_0x35eacf,_0x404e68['options']);var _0x3f998a={'where':_0x35eacf[_0x43c3('0x41')]};return db[_0x43c3('0x30')]['count'](_0x3f998a)[_0x43c3('0x25')](function(_0x218a95){_0x31e53c['count']=_0x218a95;if(_0x404e68[_0x43c3('0x35')][_0x43c3('0x46')]){_0x35eacf['include']=[{'all':!![]}];}return db['FaxQueue'][_0x43c3('0x47')](_0x35eacf);})[_0x43c3('0x25')](function(_0x395575){_0x31e53c[_0x43c3('0x48')]=_0x395575;return _0x31e53c;})[_0x43c3('0x25')](respondWithFilteredResult(_0x3c2bca,_0x35eacf))['catch'](handleError(_0x3c2bca,null));};exports[_0x43c3('0x49')]=function(_0x1e8ee7,_0x7ac4cf){var _0x483513={'raw':!![],'where':{'id':_0x1e8ee7['params']['id']}},_0x3550d2={};_0x3550d2[_0x43c3('0x39')]=_['keys'](db[_0x43c3('0x30')][_0x43c3('0x31')]);_0x3550d2[_0x43c3('0x35')]=_['keys'](_0x1e8ee7[_0x43c3('0x35')]);_0x3550d2[_0x43c3('0x37')]=_['intersection'](_0x3550d2[_0x43c3('0x39')],_0x3550d2[_0x43c3('0x35')]);_0x483513[_0x43c3('0x3b')]=_[_0x43c3('0x38')](_0x3550d2[_0x43c3('0x39')],qs['fields'](_0x1e8ee7[_0x43c3('0x35')][_0x43c3('0x3a')]));_0x483513[_0x43c3('0x3b')]=_0x483513['attributes'][_0x43c3('0x3c')]?_0x483513[_0x43c3('0x3b')]:_0x3550d2[_0x43c3('0x39')];if(_0x1e8ee7[_0x43c3('0x35')][_0x43c3('0x46')]){_0x483513[_0x43c3('0x4a')]=[{'all':!![]}];}_0x483513=_['merge']({},_0x483513,_0x1e8ee7['options']);return db[_0x43c3('0x30')][_0x43c3('0x4b')](_0x483513)[_0x43c3('0x25')](handleEntityNotFound(_0x7ac4cf,null))[_0x43c3('0x25')](respondWithResult(_0x7ac4cf,null))[_0x43c3('0x4c')](handleError(_0x7ac4cf,null));};exports[_0x43c3('0x4d')]=function(_0x13cf30,_0x122cd4){return db['FaxQueue']['create'](_0x13cf30[_0x43c3('0x4e')],{})[_0x43c3('0x25')](function(_0x918a84){var _0x2b7468=_0x13cf30[_0x43c3('0x4f')][_0x43c3('0x26')]({'plain':!![]});if(!_0x2b7468)throw new Error(_0x43c3('0x50'));if(_0x2b7468[_0x43c3('0x51')]===_0x43c3('0x4f')){var _0x4137fa=_0x918a84[_0x43c3('0x26')]({'plain':!![]});var _0x27eac0='FaxQueues';return db[_0x43c3('0x52')][_0x43c3('0x4b')]({'where':{'name':_0x27eac0,'userProfileId':_0x2b7468[_0x43c3('0x53')]},'raw':!![]})['then'](function(_0x264b78){if(_0x264b78&&_0x264b78[_0x43c3('0x54')]===0x0){return db[_0x43c3('0x28')][_0x43c3('0x4d')]({'name':_0x4137fa[_0x43c3('0x2b')],'resourceId':_0x4137fa['id'],'type':_0x264b78[_0x43c3('0x2b')],'sectionId':_0x264b78['id']},{})[_0x43c3('0x25')](function(){return _0x918a84;});}else{return _0x918a84;}})[_0x43c3('0x4c')](function(_0x18c7a0){logger['error'](_0x43c3('0x55'),_0x18c7a0);throw _0x18c7a0;});}return _0x918a84;})[_0x43c3('0x25')](respondWithResult(_0x122cd4,0xc9))[_0x43c3('0x4c')](handleError(_0x122cd4,null));};exports['update']=function(_0x5d8863,_0x5af266){if(_0x5d8863[_0x43c3('0x4e')]['id']){delete _0x5d8863[_0x43c3('0x4e')]['id'];}return db[_0x43c3('0x30')]['find']({'where':{'id':_0x5d8863['params']['id']}})[_0x43c3('0x25')](handleEntityNotFound(_0x5af266,null))['then'](saveUpdates(_0x5d8863[_0x43c3('0x4e')],null))['then'](respondWithResult(_0x5af266,null))[_0x43c3('0x4c')](handleError(_0x5af266,null));};exports['destroy']=function(_0x4bab17,_0x2d362d){return db[_0x43c3('0x30')][_0x43c3('0x4b')]({'where':{'id':_0x4bab17['params']['id']}})[_0x43c3('0x25')](handleEntityNotFound(_0x2d362d,null))['then'](removeEntity(_0x2d362d,null))[_0x43c3('0x4c')](handleError(_0x2d362d,null));};exports[_0x43c3('0x56')]=function(_0x31a584,_0x2b4c2d){return db[_0x43c3('0x30')][_0x43c3('0x56')]()[_0x43c3('0x25')](respondWithResult(_0x2b4c2d,null))[_0x43c3('0x4c')](handleError(_0x2b4c2d,null));};exports['getMembers']=function(_0x18115a,_0x40122f,_0x5719b8){var _0x1fa59b={'raw':!![],'where':{}},_0x30699e={},_0x300f4e;return db[_0x43c3('0x30')]['findOne']({'where':{'id':_0x18115a[_0x43c3('0x57')]['id']}})[_0x43c3('0x25')](handleEntityNotFound(_0x40122f,null))[_0x43c3('0x25')](function(_0x32a8c4){if(_0x32a8c4){_0x300f4e=_0x32a8c4[_0x43c3('0x26')]({'plain':!![]});_0x30699e[_0x43c3('0x39')]=_[_0x43c3('0x36')](db[_0x43c3('0x58')][_0x43c3('0x31')]);_0x30699e[_0x43c3('0x35')]=_['keys'](_0x18115a[_0x43c3('0x35')]);_0x30699e[_0x43c3('0x37')]=_['intersection'](_0x30699e[_0x43c3('0x39')],_0x30699e[_0x43c3('0x35')]);_0x1fa59b['attributes']=_[_0x43c3('0x38')](_0x30699e['model'],qs[_0x43c3('0x3a')](_0x18115a[_0x43c3('0x35')]['fields']));_0x1fa59b[_0x43c3('0x3b')]=_0x1fa59b[_0x43c3('0x3b')][_0x43c3('0x3c')]?_0x1fa59b[_0x43c3('0x3b')]:_0x30699e[_0x43c3('0x39')];if(!_0x18115a['query'][_0x43c3('0x3d')]('nolimit')){_0x1fa59b[_0x43c3('0x20')]=qs['limit'](_0x18115a['query'][_0x43c3('0x20')]);_0x1fa59b[_0x43c3('0x1f')]=qs[_0x43c3('0x1f')](_0x18115a[_0x43c3('0x35')][_0x43c3('0x1f')]);}_0x1fa59b[_0x43c3('0x3f')]=qs[_0x43c3('0x40')](_0x18115a['query'][_0x43c3('0x40')]);_0x1fa59b[_0x43c3('0x41')]=qs[_0x43c3('0x37')](_[_0x43c3('0x42')](_0x18115a[_0x43c3('0x35')],_0x30699e['filters']));_0x1fa59b['where'][_0x43c3('0x59')]=_0x32a8c4['id'];if(_0x18115a[_0x43c3('0x35')][_0x43c3('0x5a')]){_0x1fa59b[_0x43c3('0x41')]=_[_0x43c3('0x43')](_0x1fa59b[_0x43c3('0x41')],{'$or':_['map'](_0x1fa59b[_0x43c3('0x3b')],function(_0xe76a0a){var _0x373aad={};_0x373aad[_0xe76a0a]={'$like':'%'+_0x18115a['query']['filter']+'%'};return _0x373aad;})});}_0x1fa59b=_[_0x43c3('0x43')]({},_0x1fa59b,_0x18115a[_0x43c3('0x5b')]);return db['UserFaxQueue'][_0x43c3('0x47')](_0x1fa59b);}})[_0x43c3('0x25')](function(_0x559430){if(_0x559430){return db['User'][_0x43c3('0x5c')]({'where':{'id':_['map'](_0x559430,_0x43c3('0x5d')),'role':_0x43c3('0x5e')},'attributes':['id',_0x43c3('0x2b'),_0x43c3('0x5f'),_0x43c3('0x60'),_0x43c3('0x61')]});}})[_0x43c3('0x25')](function(_0x51b6a3){if(_0x51b6a3){return{'count':_0x51b6a3[_0x43c3('0x1e')],'rows':_[_0x43c3('0x2f')](_0x51b6a3[_0x43c3('0x48')],function(_0x12f02a){return{'membername':_0x12f02a[_0x43c3('0x2b')],'UserId':_0x12f02a['id'],'queue_name':_0x300f4e[_0x43c3('0x2b')],'FaxQueueId':_0x300f4e['id'],'interface':util[_0x43c3('0x62')]('%s/%s',_0x43c3('0x63'),_0x12f02a[_0x43c3('0x2b')]),'penalty':0x0,'paused':_0x12f02a['faxPause'],'createdAt':_0x12f02a[_0x43c3('0x61')],'updatedAt':_0x12f02a[_0x43c3('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x40122f,_0x1fa59b))[_0x43c3('0x4c')](handleError(_0x40122f,null));};exports[_0x43c3('0x64')]=function(_0x3de342,_0x4fe412,_0x112af6){var _0x51ef50={};var _0xf5310d={};var _0x2d18b1;var _0x5cb312;return db[_0x43c3('0x30')][_0x43c3('0x65')]({'where':{'id':_0x3de342[_0x43c3('0x57')]['id']}})[_0x43c3('0x25')](handleEntityNotFound(_0x4fe412,null))['then'](function(_0x3a1446){if(_0x3a1446){_0x2d18b1=_0x3a1446;_0xf5310d[_0x43c3('0x39')]=_['keys'](db[_0x43c3('0x66')][_0x43c3('0x31')]);_0xf5310d[_0x43c3('0x35')]=_[_0x43c3('0x36')](_0x3de342[_0x43c3('0x35')]);_0xf5310d[_0x43c3('0x37')]=_['intersection'](_0xf5310d[_0x43c3('0x39')],_0xf5310d[_0x43c3('0x35')]);_0x51ef50[_0x43c3('0x3b')]=_[_0x43c3('0x38')](_0xf5310d['model'],qs[_0x43c3('0x3a')](_0x3de342['query'][_0x43c3('0x3a')]));_0x51ef50[_0x43c3('0x3b')]=_0x51ef50[_0x43c3('0x3b')]['length']?_0x51ef50[_0x43c3('0x3b')]:_0xf5310d[_0x43c3('0x39')];_0x51ef50['order']=qs[_0x43c3('0x40')](_0x3de342[_0x43c3('0x35')][_0x43c3('0x40')]);_0x51ef50[_0x43c3('0x41')]=qs[_0x43c3('0x37')](_['pick'](_0x3de342[_0x43c3('0x35')],_0xf5310d[_0x43c3('0x37')]));if(_0x3de342[_0x43c3('0x35')][_0x43c3('0x5a')]){_0x51ef50[_0x43c3('0x41')]=_[_0x43c3('0x43')](_0x51ef50['where'],{'$or':_['map'](_0x51ef50[_0x43c3('0x3b')],function(_0x24d589){var _0x400d9d={};_0x400d9d[_0x24d589]={'$like':'%'+_0x3de342[_0x43c3('0x35')][_0x43c3('0x5a')]+'%'};return _0x400d9d;})});}_0x51ef50=_[_0x43c3('0x43')]({},_0x51ef50,_0x3de342[_0x43c3('0x5b')]);return _0x2d18b1[_0x43c3('0x64')](_0x51ef50);}})[_0x43c3('0x25')](function(_0x1ba6c4){if(_0x1ba6c4){_0x5cb312=_0x1ba6c4[_0x43c3('0x3c')];if(!_0x3de342[_0x43c3('0x35')][_0x43c3('0x3d')](_0x43c3('0x3e'))){_0x51ef50[_0x43c3('0x20')]=qs[_0x43c3('0x20')](_0x3de342[_0x43c3('0x35')][_0x43c3('0x20')]);_0x51ef50[_0x43c3('0x1f')]=qs['offset'](_0x3de342[_0x43c3('0x35')]['offset']);}return _0x2d18b1[_0x43c3('0x64')](_0x51ef50);}})['then'](function(_0x6dc751){if(_0x6dc751){return _0x6dc751?{'count':_0x5cb312,'rows':_0x6dc751}:null;}})[_0x43c3('0x25')](respondWithResult(_0x4fe412,null))[_0x43c3('0x4c')](handleError(_0x4fe412,null));};exports[_0x43c3('0x67')]=function(_0x3bbbc6,_0x82ca49,_0x5ea3b2){var _0x4808ce=_0x3bbbc6[_0x43c3('0x4e')]['ids'];return db[_0x43c3('0x66')][_0x43c3('0x47')]({'where':{'id':_0x4808ce},'attributes':['id'],'include':[{'model':db[_0x43c3('0x68')],'as':_0x43c3('0x69'),'attributes':['id',_0x43c3('0x2b'),_0x43c3('0x6a'),_0x43c3('0x6b'),_0x43c3('0x6c')],'raw':!![]}]})[_0x43c3('0x25')](function(_0xf2e46a){if(_0xf2e46a){var _0x4c31e2=_[_0x43c3('0x6d')](_0xf2e46a,function(_0x2900d4){var _0x5583a4=_0x2900d4[_0x43c3('0x26')]({'plain':!![]});return _0x5583a4[_0x43c3('0x69')];});return db[_0x43c3('0x30')][_0x43c3('0x4b')]({'where':{'id':_0x3bbbc6[_0x43c3('0x57')]['id']}})[_0x43c3('0x25')](function(_0x4a6d22){return db['sequelize']['transaction'](function(_0x4aa4b0){return _0x4a6d22['addTeams'](_0x4808ce,{'transaction':_0x4aa4b0})[_0x43c3('0x25')](function(){return BPromise[_0x43c3('0x6e')](_0x4c31e2,function(_0x395fd5){return db[_0x43c3('0x58')][_0x43c3('0x6f')]({'where':{'UserId':_0x395fd5['id'],'FaxQueueId':_0x3bbbc6[_0x43c3('0x57')]['id']},'transaction':_0x4aa4b0});});})[_0x43c3('0x25')](function(){_0x4c31e2[_0x43c3('0x70')](function(_0x1934fd){socket[_0x43c3('0x71')]('userFaxQueue:save',{'UserId':_0x1934fd['id'],'FaxQueueId':_0x4a6d22['id']});});});});});}})[_0x43c3('0x25')](respondWithStatusCode(_0x82ca49,null))[_0x43c3('0x4c')](handleError(_0x82ca49,null));};exports[_0x43c3('0x72')]=function(_0x120123,_0x265a32,_0x4f5244){return db[_0x43c3('0x66')][_0x43c3('0x47')]({'where':{'id':_0x120123['query'][_0x43c3('0x73')]},'attributes':['id'],'include':[{'model':db[_0x43c3('0x68')],'as':_0x43c3('0x69'),'attributes':['id'],'raw':!![]}]})[_0x43c3('0x25')](handleEntityNotFound(_0x265a32,null))[_0x43c3('0x25')](function(_0xe39e18){var _0x4a4b2a=_[_0x43c3('0x2f')](_0xe39e18,'id');var _0x2d0284=[];var _0x48b208=[];var _0x351b7e=squel[_0x43c3('0x74')]();_0x351b7e[_0x43c3('0x45')](_0x43c3('0x75'))['from'](_0x43c3('0x76'),'tq')[_0x43c3('0x77')](_0x43c3('0x78'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x43c3('0x41')](_0x43c3('0x79'),_0x120123['params']['id']);for(var _0xbb5ffc=0x0;_0xbb5ffc<_0xe39e18['length'];_0xbb5ffc+=0x1){let _0x3822f8=_0xe39e18[_0xbb5ffc];for(var _0x3660b1=0x0;_0x3660b1<_0x3822f8['Agents']['length'];_0x3660b1+=0x1){let _0x222617=_0x3822f8['Agents'][_0x3660b1];var _0x15f6e1=_0x351b7e['clone']();_0x15f6e1[_0x43c3('0x41')](_0x43c3('0x7a'),_0x222617['id']);_0x48b208[_0x43c3('0x7b')](db['sequelize'][_0x43c3('0x35')](_0x15f6e1[_0x43c3('0x7c')](),{'type':db[_0x43c3('0x7d')][_0x43c3('0x7e')]['SELECT']})[_0x43c3('0x25')](function(_0x3cbb9b){if(_0x3cbb9b[_0x43c3('0x3c')]===0x1){return _0x222617['id'];}else{var _0xf6a170=_['every'](_[_0x43c3('0x2f')](_0x3cbb9b,'TeamId'),function(_0x3f41d1){return _['includes'](_0x4a4b2a,_0x3f41d1);});if(_0xf6a170){return _0x222617['id'];}}}));}}return BPromise[_0x43c3('0x7f')](_0x48b208)[_0x43c3('0x25')](function(_0x339c37){_0x2d0284=_(_0x2d0284)[_0x43c3('0x80')](_0x339c37)[_0x43c3('0x81')]()[_0x43c3('0x82')]();return db[_0x43c3('0x30')][_0x43c3('0x4b')]({'where':{'id':_0x120123[_0x43c3('0x57')]['id']}})['then'](function(_0x3028e8){return db[_0x43c3('0x7d')][_0x43c3('0x83')](function(_0x12e102){return _0x3028e8['removeTeams'](_0x120123[_0x43c3('0x35')][_0x43c3('0x73')],{'transaction':_0x12e102})['then'](function(){if(!_['isEmpty'](_0x2d0284)){return _0x3028e8[_0x43c3('0x84')](_0x2d0284,{'transaction':_0x12e102});}})[_0x43c3('0x25')](function(){_0x2d0284[_0x43c3('0x70')](function(_0x4d32d6){socket[_0x43c3('0x71')](_0x43c3('0x85'),{'UserId':_0x4d32d6,'FaxQueueId':_0x3028e8['id']});});});});});});})[_0x43c3('0x25')](respondWithStatusCode(_0x265a32,null))[_0x43c3('0x4c')](handleError(_0x265a32,null));};exports[_0x43c3('0x86')]=function(_0x2a5b84,_0x3a8ce7,_0xc9c00){return db[_0x43c3('0x30')][_0x43c3('0x4b')]({'where':{'id':_0x2a5b84[_0x43c3('0x57')]['id']}})[_0x43c3('0x25')](handleEntityNotFound(_0x3a8ce7,null))[_0x43c3('0x25')](function(_0x369f51){if(_0x369f51){return _0x369f51[_0x43c3('0x86')](_0x2a5b84[_0x43c3('0x4e')][_0x43c3('0x73')],_[_0x43c3('0x87')](_0x2a5b84[_0x43c3('0x4e')],[_0x43c3('0x73'),'id'])||{})[_0x43c3('0x88')](function(_0x546949){for(var _0x360a1d=0x0;_0x360a1d<_0x2a5b84['body'][_0x43c3('0x73')][_0x43c3('0x3c')];_0x360a1d+=0x1){socket[_0x43c3('0x71')](_0x43c3('0x89'),{'UserId':_0x2a5b84[_0x43c3('0x4e')][_0x43c3('0x73')][_0x360a1d],'FaxQueueId':_0x2a5b84[_0x43c3('0x57')]['id']});}return _0x546949;});}})[_0x43c3('0x25')](respondWithResult(_0x3a8ce7,null))['catch'](handleError(_0x3a8ce7,null));};exports[_0x43c3('0x84')]=function(_0x4c357e,_0x8671d2,_0x518475){return db[_0x43c3('0x30')]['find']({'where':{'id':_0x4c357e[_0x43c3('0x57')]['id']}})['then'](handleEntityNotFound(_0x8671d2,null))[_0x43c3('0x25')](function(_0x2b7adf){if(_0x2b7adf){return _0x2b7adf['removeAgents'](_0x4c357e[_0x43c3('0x35')][_0x43c3('0x73')])[_0x43c3('0x25')](function(){if(_[_0x43c3('0x8a')](_0x4c357e[_0x43c3('0x35')][_0x43c3('0x73')])){for(var _0x4ce1f3=0x0;_0x4ce1f3<_0x4c357e['query'][_0x43c3('0x73')][_0x43c3('0x3c')];_0x4ce1f3+=0x1){socket['emit'](_0x43c3('0x85'),{'UserId':Number(_0x4c357e['query'][_0x43c3('0x73')][_0x4ce1f3]),'FaxQueueId':Number(_0x4c357e[_0x43c3('0x57')]['id'])});}}else{socket[_0x43c3('0x71')]('userFaxQueue:remove',{'UserId':Number(_0x4c357e[_0x43c3('0x35')][_0x43c3('0x73')]),'FaxQueueId':Number(_0x4c357e[_0x43c3('0x57')]['id'])});}});}})[_0x43c3('0x25')](respondWithStatusCode(_0x8671d2,null))[_0x43c3('0x4c')](handleError(_0x8671d2,null));};exports[_0x43c3('0x8b')]=function(_0x244650,_0x2f71d2,_0x2783fb){var _0x445867={};var _0x1b95f4={};var _0x2eb963;var _0x2f0e86;return db['FaxQueue']['findOne']({'where':{'id':_0x244650['params']['id']}})[_0x43c3('0x25')](handleEntityNotFound(_0x2f71d2,null))[_0x43c3('0x25')](function(_0x3d9014){if(_0x3d9014){_0x2eb963=_0x3d9014;_0x1b95f4['model']=_['keys'](db[_0x43c3('0x68')][_0x43c3('0x31')]);_0x1b95f4[_0x43c3('0x35')]=_['keys'](_0x244650[_0x43c3('0x35')]);_0x1b95f4[_0x43c3('0x37')]=_[_0x43c3('0x38')](_0x1b95f4['model'],_0x1b95f4['query']);_0x445867['attributes']=_[_0x43c3('0x38')](_0x1b95f4['model'],qs[_0x43c3('0x3a')](_0x244650[_0x43c3('0x35')][_0x43c3('0x3a')]));_0x445867[_0x43c3('0x3b')]=_0x445867[_0x43c3('0x3b')]['length']?_0x445867[_0x43c3('0x3b')]:_0x1b95f4[_0x43c3('0x39')];_0x445867['order']=qs[_0x43c3('0x40')](_0x244650[_0x43c3('0x35')]['sort']);_0x445867[_0x43c3('0x41')]=qs[_0x43c3('0x37')](_[_0x43c3('0x42')](_0x244650[_0x43c3('0x35')],_0x1b95f4[_0x43c3('0x37')]));if(_0x244650[_0x43c3('0x35')][_0x43c3('0x5a')]){_0x445867[_0x43c3('0x41')]=_['merge'](_0x445867['where'],{'$or':_[_0x43c3('0x2f')](_0x445867[_0x43c3('0x3b')],function(_0x69c67e){var _0x4f5093={};_0x4f5093[_0x69c67e]={'$like':'%'+_0x244650[_0x43c3('0x35')]['filter']+'%'};return _0x4f5093;})});}_0x445867=_[_0x43c3('0x43')]({},_0x445867,_0x244650[_0x43c3('0x5b')]);return _0x2eb963[_0x43c3('0x8b')](_0x445867);}})['then'](function(_0xa5b758){if(_0xa5b758){_0x2f0e86=_0xa5b758[_0x43c3('0x3c')];if(!_0x244650[_0x43c3('0x35')][_0x43c3('0x3d')](_0x43c3('0x3e'))){_0x445867[_0x43c3('0x20')]=qs[_0x43c3('0x20')](_0x244650['query'][_0x43c3('0x20')]);_0x445867[_0x43c3('0x1f')]=qs['offset'](_0x244650[_0x43c3('0x35')][_0x43c3('0x1f')]);}return _0x2eb963[_0x43c3('0x8b')](_0x445867);}})['then'](function(_0x41606e){if(_0x41606e){return _0x41606e?{'count':_0x2f0e86,'rows':_0x41606e}:null;}})[_0x43c3('0x25')](respondWithResult(_0x2f71d2,null))[_0x43c3('0x4c')](handleError(_0x2f71d2,null));}; \ No newline at end of file +var _0x5c76=['key','VIRTUAL','field','filter','options','FaxQueue','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','user','role','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','order','FaxQueueId','UserFaxQueue','User','findAndCountAll','UserId','agent','faxPause','updatedAt','createdAt','%s/%s','SIP','getTeams','findOne','addTeams','Team','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','removeTeams','ids','select','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','TeamId','includes','compact','isEmpty','removeAgents','userFaxQueue:remove','spread','userFaxQueue:save','isArray','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','localhost','register','status','end','json','count','offset','limit','Content-Range','save','update','then','FaxQueues','UserProfileResource','destroy','sendStatus','error','stack','name','index','map','fieldName','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','type'];(function(_0x5dd917,_0x5888de){var _0x2da356=function(_0x16111b){while(--_0x16111b){_0x5dd917['push'](_0x5dd917['shift']());}};_0x2da356(++_0x5888de);}(_0x5c76,0x1ef));var _0x65c7=function(_0x26b80e,_0x5c9333){_0x26b80e=_0x26b80e-0x0;var _0x84a8a8=_0x5c76[_0x26b80e];return _0x84a8a8;};'use strict';var pdf=require(_0x65c7('0x0'));var emlformat=require(_0x65c7('0x1'));var rimraf=require(_0x65c7('0x2'));var zipdir=require(_0x65c7('0x3'));var jsonpatch=require(_0x65c7('0x4'));var rp=require(_0x65c7('0x5'));var moment=require(_0x65c7('0x6'));var BPromise=require(_0x65c7('0x7'));var Mustache=require('mustache');var util=require(_0x65c7('0x8'));var path=require(_0x65c7('0x9'));var sox=require('sox');var csv=require(_0x65c7('0xa'));var ejs=require(_0x65c7('0xb'));var fs=require('fs');var _=require(_0x65c7('0xc'));var squel=require(_0x65c7('0xd'));var crypto=require(_0x65c7('0xe'));var jsforce=require(_0x65c7('0xf'));var deskjs=require(_0x65c7('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x65c7('0x11'));var Redis=require(_0x65c7('0x12'));var authService=require(_0x65c7('0x13'));var qs=require(_0x65c7('0x14'));var as=require(_0x65c7('0x15'));var hardwareService=require(_0x65c7('0x16'));var logger=require(_0x65c7('0x17'))(_0x65c7('0x18'));var utils=require(_0x65c7('0x19'));var config=require('../../config/environment');var db=require(_0x65c7('0x1a'))['db'];config[_0x65c7('0x1b')]=_['defaults'](config['redis'],{'host':_0x65c7('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x65c7('0x1b')]));require('./faxQueue.socket')[_0x65c7('0x1d')](socket);function respondWithStatusCode(_0x4c91aa,_0x337bd5){_0x337bd5=_0x337bd5||0xcc;return function(_0x417aba){if(_0x417aba){return _0x4c91aa['sendStatus'](_0x337bd5);}return _0x4c91aa[_0x65c7('0x1e')](_0x337bd5)[_0x65c7('0x1f')]();};}function respondWithResult(_0x224cf7,_0x58279b){_0x58279b=_0x58279b||0xc8;return function(_0x3826cc){if(_0x3826cc){return _0x224cf7['status'](_0x58279b)[_0x65c7('0x20')](_0x3826cc);}};}function respondWithFilteredResult(_0x45ada1,_0x2dcd05){return function(_0x4ba3ed){if(_0x4ba3ed){var _0xace91d=_0x4ba3ed[_0x65c7('0x21')],_0x128d52=_0x2dcd05[_0x65c7('0x22')],_0x45ca9e=_0x2dcd05['offset']+_0x2dcd05[_0x65c7('0x23')],_0x87e62a;if(_0x45ca9e>=_0xace91d){_0x45ca9e=_0xace91d;_0x87e62a=0xc8;}else{_0x87e62a=0xce;}_0x45ada1[_0x65c7('0x1e')](_0x87e62a);return _0x45ada1['set'](_0x65c7('0x24'),_0x128d52+'-'+_0x45ca9e+'/'+_0xace91d)[_0x65c7('0x20')](_0x4ba3ed);}return null;};}function patchUpdates(_0x59b002){return function(_0x1e5964){try{jsonpatch['apply'](_0x1e5964,_0x59b002,!![]);}catch(_0x46e0eb){return BPromise['reject'](_0x46e0eb);}return _0x1e5964[_0x65c7('0x25')]();};}function saveUpdates(_0x43ce50,_0x257146){return function(_0x2848a4){if(_0x2848a4){return _0x2848a4[_0x65c7('0x26')](_0x43ce50)[_0x65c7('0x27')](function(_0x4422df){return _0x4422df;});}return null;};}function removeEntity(_0x2f5a23,_0x27d6b2){return function(_0x238d00){if(_0x238d00){return _0x238d00['destroy']()[_0x65c7('0x27')](function(){var _0x333bd2=_0x238d00['get']({'plain':!![]});var _0x2c6d=_0x65c7('0x28');return db[_0x65c7('0x29')][_0x65c7('0x2a')]({'where':{'type':_0x2c6d,'resourceId':_0x333bd2['id']}})['then'](function(){return _0x238d00;});})['then'](function(){_0x2f5a23[_0x65c7('0x1e')](0xcc)[_0x65c7('0x1f')]();});}};}function handleEntityNotFound(_0x3b5d68,_0x5e1f17){return function(_0x5f122e){if(!_0x5f122e){_0x3b5d68[_0x65c7('0x2b')](0x194);}return _0x5f122e;};}function handleError(_0x45ef9b,_0x53ac66){_0x53ac66=_0x53ac66||0x1f4;return function(_0x711654){logger[_0x65c7('0x2c')](_0x711654[_0x65c7('0x2d')]);if(_0x711654[_0x65c7('0x2e')]){delete _0x711654[_0x65c7('0x2e')];}_0x45ef9b[_0x65c7('0x1e')](_0x53ac66)['send'](_0x711654);};}exports[_0x65c7('0x2f')]=function(_0x289e99,_0x42d041){var _0x3c7cf9={},_0x51c1dc={},_0x5a428b={'count':0x0,'rows':[]};var _0x4209be=_[_0x65c7('0x30')](db['FaxQueue']['rawAttributes'],function(_0x299225){return{'name':_0x299225[_0x65c7('0x31')],'type':_0x299225['type']['key']};});_0x51c1dc['model']=_[_0x65c7('0x30')](_0x4209be,_0x65c7('0x2e'));_0x51c1dc[_0x65c7('0x32')]=_[_0x65c7('0x33')](_0x289e99[_0x65c7('0x32')]);_0x51c1dc[_0x65c7('0x34')]=_['intersection'](_0x51c1dc[_0x65c7('0x35')],_0x51c1dc['query']);_0x3c7cf9[_0x65c7('0x36')]=_[_0x65c7('0x37')](_0x51c1dc[_0x65c7('0x35')],qs[_0x65c7('0x38')](_0x289e99[_0x65c7('0x32')][_0x65c7('0x38')]));_0x3c7cf9['attributes']=_0x3c7cf9['attributes'][_0x65c7('0x39')]?_0x3c7cf9[_0x65c7('0x36')]:_0x51c1dc[_0x65c7('0x35')];if(!_0x289e99[_0x65c7('0x32')][_0x65c7('0x3a')](_0x65c7('0x3b'))){_0x3c7cf9['limit']=qs['limit'](_0x289e99[_0x65c7('0x32')][_0x65c7('0x23')]);_0x3c7cf9['offset']=qs[_0x65c7('0x22')](_0x289e99['query'][_0x65c7('0x22')]);}_0x3c7cf9['order']=qs[_0x65c7('0x3c')](_0x289e99['query'][_0x65c7('0x3c')]);_0x3c7cf9[_0x65c7('0x3d')]=qs[_0x65c7('0x34')](_[_0x65c7('0x3e')](_0x289e99['query'],_0x51c1dc['filters']));if(_0x289e99[_0x65c7('0x32')]['filter']){_0x3c7cf9[_0x65c7('0x3d')]=_[_0x65c7('0x3f')](_0x3c7cf9[_0x65c7('0x3d')],{'$or':_[_0x65c7('0x30')](_0x4209be,function(_0x3048a5){if(_0x3048a5[_0x65c7('0x40')][_0x65c7('0x41')]!==_0x65c7('0x42')){var _0x48e9c1={};_0x48e9c1[_0x3048a5[_0x65c7('0x43')]]={'$like':'%'+_0x289e99[_0x65c7('0x32')][_0x65c7('0x44')]+'%'};return _0x48e9c1;}})});}_0x3c7cf9=_[_0x65c7('0x3f')]({},_0x3c7cf9,_0x289e99[_0x65c7('0x45')]);var _0x4d2776={'where':_0x3c7cf9['where']};return db[_0x65c7('0x46')][_0x65c7('0x21')](_0x4d2776)['then'](function(_0x40411d){_0x5a428b[_0x65c7('0x21')]=_0x40411d;if(_0x289e99[_0x65c7('0x32')][_0x65c7('0x47')]){_0x3c7cf9[_0x65c7('0x48')]=[{'all':!![]}];}return db[_0x65c7('0x46')][_0x65c7('0x49')](_0x3c7cf9);})[_0x65c7('0x27')](function(_0x159b31){_0x5a428b[_0x65c7('0x4a')]=_0x159b31;return _0x5a428b;})[_0x65c7('0x27')](respondWithFilteredResult(_0x42d041,_0x3c7cf9))[_0x65c7('0x4b')](handleError(_0x42d041,null));};exports[_0x65c7('0x4c')]=function(_0x144320,_0x1e588a){var _0x1ff19a={'raw':!![],'where':{'id':_0x144320[_0x65c7('0x4d')]['id']}},_0x4e15af={};_0x4e15af[_0x65c7('0x35')]=_[_0x65c7('0x33')](db['FaxQueue'][_0x65c7('0x4e')]);_0x4e15af[_0x65c7('0x32')]=_[_0x65c7('0x33')](_0x144320[_0x65c7('0x32')]);_0x4e15af[_0x65c7('0x34')]=_[_0x65c7('0x37')](_0x4e15af['model'],_0x4e15af[_0x65c7('0x32')]);_0x1ff19a[_0x65c7('0x36')]=_['intersection'](_0x4e15af[_0x65c7('0x35')],qs[_0x65c7('0x38')](_0x144320[_0x65c7('0x32')][_0x65c7('0x38')]));_0x1ff19a['attributes']=_0x1ff19a[_0x65c7('0x36')][_0x65c7('0x39')]?_0x1ff19a[_0x65c7('0x36')]:_0x4e15af[_0x65c7('0x35')];if(_0x144320[_0x65c7('0x32')][_0x65c7('0x47')]){_0x1ff19a[_0x65c7('0x48')]=[{'all':!![]}];}_0x1ff19a=_['merge']({},_0x1ff19a,_0x144320[_0x65c7('0x45')]);return db[_0x65c7('0x46')][_0x65c7('0x4f')](_0x1ff19a)['then'](handleEntityNotFound(_0x1e588a,null))[_0x65c7('0x27')](respondWithResult(_0x1e588a,null))['catch'](handleError(_0x1e588a,null));};exports[_0x65c7('0x50')]=function(_0x23435c,_0x40505e){return db[_0x65c7('0x46')][_0x65c7('0x50')](_0x23435c['body'],{})['then'](function(_0x318686){var _0x46e02b=_0x23435c[_0x65c7('0x51')]['get']({'plain':!![]});if(!_0x46e02b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x46e02b[_0x65c7('0x52')]===_0x65c7('0x51')){var _0x4f3e54=_0x318686[_0x65c7('0x53')]({'plain':!![]});var _0x168257=_0x65c7('0x28');return db[_0x65c7('0x54')]['find']({'where':{'name':_0x168257,'userProfileId':_0x46e02b[_0x65c7('0x55')]},'raw':!![]})[_0x65c7('0x27')](function(_0x5e98e8){if(_0x5e98e8&&_0x5e98e8[_0x65c7('0x56')]===0x0){return db[_0x65c7('0x29')][_0x65c7('0x50')]({'name':_0x4f3e54[_0x65c7('0x2e')],'resourceId':_0x4f3e54['id'],'type':_0x5e98e8['name'],'sectionId':_0x5e98e8['id']},{})[_0x65c7('0x27')](function(){return _0x318686;});}else{return _0x318686;}})[_0x65c7('0x4b')](function(_0x96c54f){logger[_0x65c7('0x2c')](_0x65c7('0x57'),_0x96c54f);throw _0x96c54f;});}return _0x318686;})['then'](respondWithResult(_0x40505e,0xc9))[_0x65c7('0x4b')](handleError(_0x40505e,null));};exports[_0x65c7('0x26')]=function(_0x1e9b40,_0x436011){if(_0x1e9b40[_0x65c7('0x58')]['id']){delete _0x1e9b40[_0x65c7('0x58')]['id'];}return db[_0x65c7('0x46')][_0x65c7('0x4f')]({'where':{'id':_0x1e9b40['params']['id']}})['then'](handleEntityNotFound(_0x436011,null))[_0x65c7('0x27')](saveUpdates(_0x1e9b40[_0x65c7('0x58')],null))[_0x65c7('0x27')](respondWithResult(_0x436011,null))[_0x65c7('0x4b')](handleError(_0x436011,null));};exports['destroy']=function(_0x5f59cb,_0x55f6cf){return db[_0x65c7('0x46')][_0x65c7('0x4f')]({'where':{'id':_0x5f59cb[_0x65c7('0x4d')]['id']}})['then'](handleEntityNotFound(_0x55f6cf,null))['then'](removeEntity(_0x55f6cf,null))[_0x65c7('0x4b')](handleError(_0x55f6cf,null));};exports[_0x65c7('0x59')]=function(_0x23fe24,_0x2a6bad){return db[_0x65c7('0x46')][_0x65c7('0x59')]()[_0x65c7('0x27')](respondWithResult(_0x2a6bad,null))['catch'](handleError(_0x2a6bad,null));};exports[_0x65c7('0x5a')]=function(_0x51aa17,_0x11d620,_0x6a7507){var _0xf4c7f2={'raw':!![],'where':{}},_0x2d4600={},_0x518cab;return db[_0x65c7('0x46')]['findOne']({'where':{'id':_0x51aa17[_0x65c7('0x4d')]['id']}})['then'](handleEntityNotFound(_0x11d620,null))['then'](function(_0x3e0a13){if(_0x3e0a13){_0x518cab=_0x3e0a13[_0x65c7('0x53')]({'plain':!![]});_0x2d4600[_0x65c7('0x35')]=_[_0x65c7('0x33')](db['UserFaxQueue'][_0x65c7('0x4e')]);_0x2d4600['query']=_[_0x65c7('0x33')](_0x51aa17['query']);_0x2d4600[_0x65c7('0x34')]=_[_0x65c7('0x37')](_0x2d4600[_0x65c7('0x35')],_0x2d4600[_0x65c7('0x32')]);_0xf4c7f2[_0x65c7('0x36')]=_['intersection'](_0x2d4600[_0x65c7('0x35')],qs[_0x65c7('0x38')](_0x51aa17['query'][_0x65c7('0x38')]));_0xf4c7f2[_0x65c7('0x36')]=_0xf4c7f2[_0x65c7('0x36')]['length']?_0xf4c7f2['attributes']:_0x2d4600[_0x65c7('0x35')];if(!_0x51aa17['query'][_0x65c7('0x3a')]('nolimit')){_0xf4c7f2[_0x65c7('0x23')]=qs[_0x65c7('0x23')](_0x51aa17[_0x65c7('0x32')][_0x65c7('0x23')]);_0xf4c7f2[_0x65c7('0x22')]=qs[_0x65c7('0x22')](_0x51aa17[_0x65c7('0x32')][_0x65c7('0x22')]);}_0xf4c7f2[_0x65c7('0x5b')]=qs[_0x65c7('0x3c')](_0x51aa17[_0x65c7('0x32')][_0x65c7('0x3c')]);_0xf4c7f2['where']=qs[_0x65c7('0x34')](_['pick'](_0x51aa17[_0x65c7('0x32')],_0x2d4600['filters']));_0xf4c7f2['where'][_0x65c7('0x5c')]=_0x3e0a13['id'];if(_0x51aa17[_0x65c7('0x32')]['filter']){_0xf4c7f2[_0x65c7('0x3d')]=_[_0x65c7('0x3f')](_0xf4c7f2[_0x65c7('0x3d')],{'$or':_[_0x65c7('0x30')](_0xf4c7f2[_0x65c7('0x36')],function(_0x3d4c05){var _0x3e116c={};_0x3e116c[_0x3d4c05]={'$like':'%'+_0x51aa17[_0x65c7('0x32')][_0x65c7('0x44')]+'%'};return _0x3e116c;})});}_0xf4c7f2=_[_0x65c7('0x3f')]({},_0xf4c7f2,_0x51aa17[_0x65c7('0x45')]);return db[_0x65c7('0x5d')]['findAll'](_0xf4c7f2);}})[_0x65c7('0x27')](function(_0x184eb3){if(_0x184eb3){return db[_0x65c7('0x5e')][_0x65c7('0x5f')]({'where':{'id':_[_0x65c7('0x30')](_0x184eb3,_0x65c7('0x60')),'role':_0x65c7('0x61')},'attributes':['id',_0x65c7('0x2e'),_0x65c7('0x62'),_0x65c7('0x63'),_0x65c7('0x64')]});}})[_0x65c7('0x27')](function(_0x4c69eb){if(_0x4c69eb){return{'count':_0x4c69eb[_0x65c7('0x21')],'rows':_[_0x65c7('0x30')](_0x4c69eb[_0x65c7('0x4a')],function(_0x5b076b){return{'membername':_0x5b076b['name'],'UserId':_0x5b076b['id'],'queue_name':_0x518cab['name'],'FaxQueueId':_0x518cab['id'],'interface':util['format'](_0x65c7('0x65'),_0x65c7('0x66'),_0x5b076b[_0x65c7('0x2e')]),'penalty':0x0,'paused':_0x5b076b[_0x65c7('0x62')],'createdAt':_0x5b076b[_0x65c7('0x64')],'updatedAt':_0x5b076b[_0x65c7('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x65c7('0x27')](respondWithFilteredResult(_0x11d620,_0xf4c7f2))['catch'](handleError(_0x11d620,null));};exports[_0x65c7('0x67')]=function(_0x3a7791,_0x49936a,_0xc2e188){var _0xd61334={};var _0x49aafd={};var _0x223d16;var _0x3fde1e;return db['FaxQueue'][_0x65c7('0x68')]({'where':{'id':_0x3a7791['params']['id']}})[_0x65c7('0x27')](handleEntityNotFound(_0x49936a,null))[_0x65c7('0x27')](function(_0x415b5c){if(_0x415b5c){_0x223d16=_0x415b5c;_0x49aafd[_0x65c7('0x35')]=_['keys'](db['Team'][_0x65c7('0x4e')]);_0x49aafd[_0x65c7('0x32')]=_[_0x65c7('0x33')](_0x3a7791[_0x65c7('0x32')]);_0x49aafd[_0x65c7('0x34')]=_[_0x65c7('0x37')](_0x49aafd[_0x65c7('0x35')],_0x49aafd[_0x65c7('0x32')]);_0xd61334[_0x65c7('0x36')]=_[_0x65c7('0x37')](_0x49aafd[_0x65c7('0x35')],qs[_0x65c7('0x38')](_0x3a7791[_0x65c7('0x32')][_0x65c7('0x38')]));_0xd61334[_0x65c7('0x36')]=_0xd61334['attributes'][_0x65c7('0x39')]?_0xd61334[_0x65c7('0x36')]:_0x49aafd[_0x65c7('0x35')];_0xd61334['order']=qs[_0x65c7('0x3c')](_0x3a7791[_0x65c7('0x32')][_0x65c7('0x3c')]);_0xd61334[_0x65c7('0x3d')]=qs['filters'](_[_0x65c7('0x3e')](_0x3a7791['query'],_0x49aafd['filters']));if(_0x3a7791[_0x65c7('0x32')]['filter']){_0xd61334[_0x65c7('0x3d')]=_['merge'](_0xd61334['where'],{'$or':_[_0x65c7('0x30')](_0xd61334[_0x65c7('0x36')],function(_0x4badd8){var _0x5360c8={};_0x5360c8[_0x4badd8]={'$like':'%'+_0x3a7791[_0x65c7('0x32')][_0x65c7('0x44')]+'%'};return _0x5360c8;})});}_0xd61334=_[_0x65c7('0x3f')]({},_0xd61334,_0x3a7791[_0x65c7('0x45')]);return _0x223d16[_0x65c7('0x67')](_0xd61334);}})[_0x65c7('0x27')](function(_0x52a6b6){if(_0x52a6b6){_0x3fde1e=_0x52a6b6['length'];if(!_0x3a7791[_0x65c7('0x32')]['hasOwnProperty'](_0x65c7('0x3b'))){_0xd61334[_0x65c7('0x23')]=qs[_0x65c7('0x23')](_0x3a7791[_0x65c7('0x32')]['limit']);_0xd61334[_0x65c7('0x22')]=qs[_0x65c7('0x22')](_0x3a7791['query'][_0x65c7('0x22')]);}return _0x223d16[_0x65c7('0x67')](_0xd61334);}})['then'](function(_0x4927ac){if(_0x4927ac){return _0x4927ac?{'count':_0x3fde1e,'rows':_0x4927ac}:null;}})['then'](respondWithResult(_0x49936a,null))['catch'](handleError(_0x49936a,null));};exports[_0x65c7('0x69')]=function(_0x38a150,_0x166a85,_0x46bdfc){var _0x5e92d5=_0x38a150[_0x65c7('0x58')]['ids'];return db[_0x65c7('0x6a')]['findAll']({'where':{'id':_0x5e92d5},'attributes':['id'],'include':[{'model':db[_0x65c7('0x5e')],'as':_0x65c7('0x6b'),'attributes':['id','name',_0x65c7('0x6c'),_0x65c7('0x6d'),_0x65c7('0x6e')],'raw':!![]}]})['then'](function(_0x440da5){if(_0x440da5){var _0x2aaf40=_[_0x65c7('0x6f')](_0x440da5,function(_0x48278a){var _0x2ce0e1=_0x48278a[_0x65c7('0x53')]({'plain':!![]});return _0x2ce0e1[_0x65c7('0x6b')];});return db[_0x65c7('0x46')]['find']({'where':{'id':_0x38a150[_0x65c7('0x4d')]['id']}})[_0x65c7('0x27')](function(_0xfc0a26){return db[_0x65c7('0x70')][_0x65c7('0x71')](function(_0x273b88){return _0xfc0a26[_0x65c7('0x69')](_0x5e92d5,{'transaction':_0x273b88})[_0x65c7('0x27')](function(){return BPromise[_0x65c7('0x72')](_0x2aaf40,function(_0x535942){return db[_0x65c7('0x5d')][_0x65c7('0x73')]({'where':{'UserId':_0x535942['id'],'FaxQueueId':_0x38a150[_0x65c7('0x4d')]['id']},'transaction':_0x273b88});});})[_0x65c7('0x27')](function(){_0x2aaf40[_0x65c7('0x74')](function(_0x33e3a){socket[_0x65c7('0x75')]('userFaxQueue:save',{'UserId':_0x33e3a['id'],'FaxQueueId':_0xfc0a26['id']});});});});});}})['then'](respondWithStatusCode(_0x166a85,null))[_0x65c7('0x4b')](handleError(_0x166a85,null));};exports[_0x65c7('0x76')]=function(_0x17b96e,_0x119bd6,_0x1f5850){return db[_0x65c7('0x6a')]['findAll']({'where':{'id':_0x17b96e[_0x65c7('0x32')][_0x65c7('0x77')]},'attributes':['id'],'include':[{'model':db[_0x65c7('0x5e')],'as':_0x65c7('0x6b'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x119bd6,null))[_0x65c7('0x27')](function(_0x307e64){var _0x404c89=_['map'](_0x307e64,'id');var _0x28841c=[];var _0x249f92=[];var _0x40875b=squel[_0x65c7('0x78')]();_0x40875b[_0x65c7('0x43')](_0x65c7('0x79'))[_0x65c7('0x7a')](_0x65c7('0x7b'),'tq')[_0x65c7('0x7c')](_0x65c7('0x7d'),'ut',_0x65c7('0x7e'))['where'](_0x65c7('0x7f'),_0x17b96e[_0x65c7('0x4d')]['id']);for(var _0x4d1caa=0x0;_0x4d1caa<_0x307e64[_0x65c7('0x39')];_0x4d1caa+=0x1){let _0x496610=_0x307e64[_0x4d1caa];for(var _0xbec53b=0x0;_0xbec53b<_0x496610[_0x65c7('0x6b')][_0x65c7('0x39')];_0xbec53b+=0x1){let _0x392784=_0x496610['Agents'][_0xbec53b];var _0xab8652=_0x40875b['clone']();_0xab8652['where'](_0x65c7('0x80'),_0x392784['id']);_0x249f92[_0x65c7('0x81')](db[_0x65c7('0x70')][_0x65c7('0x32')](_0xab8652['toString'](),{'type':db[_0x65c7('0x70')]['QueryTypes']['SELECT']})[_0x65c7('0x27')](function(_0x332ca2){if(_0x332ca2['length']===0x1){return _0x392784['id'];}else{var _0x8f6018=_['every'](_['map'](_0x332ca2,_0x65c7('0x82')),function(_0x5a3080){return _[_0x65c7('0x83')](_0x404c89,_0x5a3080);});if(_0x8f6018){return _0x392784['id'];}}}));}}return BPromise['all'](_0x249f92)[_0x65c7('0x27')](function(_0x518882){_0x28841c=_(_0x28841c)['union'](_0x518882)[_0x65c7('0x84')]()['value']();return db[_0x65c7('0x46')][_0x65c7('0x4f')]({'where':{'id':_0x17b96e[_0x65c7('0x4d')]['id']}})['then'](function(_0x1ba8a8){return db['sequelize'][_0x65c7('0x71')](function(_0x8ec118){return _0x1ba8a8[_0x65c7('0x76')](_0x17b96e[_0x65c7('0x32')][_0x65c7('0x77')],{'transaction':_0x8ec118})[_0x65c7('0x27')](function(){if(!_[_0x65c7('0x85')](_0x28841c)){return _0x1ba8a8[_0x65c7('0x86')](_0x28841c,{'transaction':_0x8ec118});}})[_0x65c7('0x27')](function(){_0x28841c['forEach'](function(_0x3a3434){socket[_0x65c7('0x75')](_0x65c7('0x87'),{'UserId':_0x3a3434,'FaxQueueId':_0x1ba8a8['id']});});});});});});})['then'](respondWithStatusCode(_0x119bd6,null))[_0x65c7('0x4b')](handleError(_0x119bd6,null));};exports['addAgents']=function(_0x4e3641,_0x5d71a7,_0x3c882c){return db[_0x65c7('0x46')][_0x65c7('0x4f')]({'where':{'id':_0x4e3641[_0x65c7('0x4d')]['id']}})['then'](handleEntityNotFound(_0x5d71a7,null))[_0x65c7('0x27')](function(_0x484cb1){if(_0x484cb1){return _0x484cb1['addAgents'](_0x4e3641[_0x65c7('0x58')][_0x65c7('0x77')],_['omit'](_0x4e3641[_0x65c7('0x58')],[_0x65c7('0x77'),'id'])||{})[_0x65c7('0x88')](function(_0x4c77e7){for(var _0x34761d=0x0;_0x34761d<_0x4e3641[_0x65c7('0x58')]['ids'][_0x65c7('0x39')];_0x34761d+=0x1){socket[_0x65c7('0x75')](_0x65c7('0x89'),{'UserId':_0x4e3641[_0x65c7('0x58')][_0x65c7('0x77')][_0x34761d],'FaxQueueId':_0x4e3641['params']['id']});}return _0x4c77e7;});}})['then'](respondWithResult(_0x5d71a7,null))[_0x65c7('0x4b')](handleError(_0x5d71a7,null));};exports[_0x65c7('0x86')]=function(_0x39f6c9,_0x2697d5,_0x2e9dc8){return db[_0x65c7('0x46')][_0x65c7('0x4f')]({'where':{'id':_0x39f6c9['params']['id']}})[_0x65c7('0x27')](handleEntityNotFound(_0x2697d5,null))[_0x65c7('0x27')](function(_0x3bbbe6){if(_0x3bbbe6){return _0x3bbbe6['removeAgents'](_0x39f6c9[_0x65c7('0x32')]['ids'])[_0x65c7('0x27')](function(){if(_[_0x65c7('0x8a')](_0x39f6c9['query'][_0x65c7('0x77')])){for(var _0x4ed474=0x0;_0x4ed474<_0x39f6c9[_0x65c7('0x32')][_0x65c7('0x77')][_0x65c7('0x39')];_0x4ed474+=0x1){socket[_0x65c7('0x75')](_0x65c7('0x87'),{'UserId':Number(_0x39f6c9[_0x65c7('0x32')][_0x65c7('0x77')][_0x4ed474]),'FaxQueueId':Number(_0x39f6c9[_0x65c7('0x4d')]['id'])});}}else{socket[_0x65c7('0x75')](_0x65c7('0x87'),{'UserId':Number(_0x39f6c9[_0x65c7('0x32')][_0x65c7('0x77')]),'FaxQueueId':Number(_0x39f6c9[_0x65c7('0x4d')]['id'])});}});}})[_0x65c7('0x27')](respondWithStatusCode(_0x2697d5,null))[_0x65c7('0x4b')](handleError(_0x2697d5,null));};exports[_0x65c7('0x8b')]=function(_0x347fd8,_0x5adf55,_0x2f11c7){var _0x365fb3={};var _0x1e5140={};var _0x327dbf;var _0x36f619;return db[_0x65c7('0x46')][_0x65c7('0x68')]({'where':{'id':_0x347fd8[_0x65c7('0x4d')]['id']}})[_0x65c7('0x27')](handleEntityNotFound(_0x5adf55,null))[_0x65c7('0x27')](function(_0x42fb9c){if(_0x42fb9c){_0x327dbf=_0x42fb9c;_0x1e5140[_0x65c7('0x35')]=_['keys'](db[_0x65c7('0x5e')]['rawAttributes']);_0x1e5140['query']=_[_0x65c7('0x33')](_0x347fd8[_0x65c7('0x32')]);_0x1e5140[_0x65c7('0x34')]=_['intersection'](_0x1e5140['model'],_0x1e5140[_0x65c7('0x32')]);_0x365fb3[_0x65c7('0x36')]=_[_0x65c7('0x37')](_0x1e5140['model'],qs['fields'](_0x347fd8[_0x65c7('0x32')][_0x65c7('0x38')]));_0x365fb3[_0x65c7('0x36')]=_0x365fb3[_0x65c7('0x36')][_0x65c7('0x39')]?_0x365fb3[_0x65c7('0x36')]:_0x1e5140[_0x65c7('0x35')];_0x365fb3[_0x65c7('0x5b')]=qs[_0x65c7('0x3c')](_0x347fd8['query'][_0x65c7('0x3c')]);_0x365fb3[_0x65c7('0x3d')]=qs[_0x65c7('0x34')](_[_0x65c7('0x3e')](_0x347fd8['query'],_0x1e5140['filters']));if(_0x347fd8['query'][_0x65c7('0x44')]){_0x365fb3[_0x65c7('0x3d')]=_[_0x65c7('0x3f')](_0x365fb3['where'],{'$or':_[_0x65c7('0x30')](_0x365fb3[_0x65c7('0x36')],function(_0x495dcb){var _0x1cee09={};_0x1cee09[_0x495dcb]={'$like':'%'+_0x347fd8['query'][_0x65c7('0x44')]+'%'};return _0x1cee09;})});}_0x365fb3=_[_0x65c7('0x3f')]({},_0x365fb3,_0x347fd8[_0x65c7('0x45')]);return _0x327dbf[_0x65c7('0x8b')](_0x365fb3);}})[_0x65c7('0x27')](function(_0x2f04e2){if(_0x2f04e2){_0x36f619=_0x2f04e2[_0x65c7('0x39')];if(!_0x347fd8[_0x65c7('0x32')][_0x65c7('0x3a')]('nolimit')){_0x365fb3[_0x65c7('0x23')]=qs[_0x65c7('0x23')](_0x347fd8[_0x65c7('0x32')][_0x65c7('0x23')]);_0x365fb3['offset']=qs[_0x65c7('0x22')](_0x347fd8['query'][_0x65c7('0x22')]);}return _0x327dbf[_0x65c7('0x8b')](_0x365fb3);}})['then'](function(_0x5505f0){if(_0x5505f0){return _0x5505f0?{'count':_0x36f619,'rows':_0x5505f0}:null;}})['then'](respondWithResult(_0x5adf55,null))[_0x65c7('0x4b')](handleError(_0x5adf55,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index ebcc0c8..9b8866c 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 _0x6eed=['emit','hasOwnProperty','hook','events','../../mysqldb','FaxQueue','setMaxListeners','save','remove'];(function(_0x610412,_0x149b94){var _0x440814=function(_0x21e408){while(--_0x21e408){_0x610412['push'](_0x610412['shift']());}};_0x440814(++_0x149b94);}(_0x6eed,0xff));var _0xd6ee=function(_0xd765af,_0x176212){_0xd765af=_0xd765af-0x0;var _0x3b9421=_0x6eed[_0xd765af];return _0x3b9421;};'use strict';var EventEmitter=require(_0xd6ee('0x0'));var FaxQueue=require(_0xd6ee('0x1'))['db'][_0xd6ee('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xd6ee('0x3')](0x0);var events={'afterCreate':_0xd6ee('0x4'),'afterUpdate':'update','afterDestroy':_0xd6ee('0x5')};function emitEvent(_0x315fdb){return function(_0x588715,_0x53cce9,_0x1d3312){FaxQueueEvents[_0xd6ee('0x6')](_0x315fdb+':'+_0x588715['id'],_0x588715);FaxQueueEvents[_0xd6ee('0x6')](_0x315fdb,_0x588715);_0x1d3312(null);};}for(var e in events){if(events[_0xd6ee('0x7')](e)){var event=events[e];FaxQueue[_0xd6ee('0x8')](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file +var _0xa0a1=['hasOwnProperty','hook','exports','events','FaxQueue','setMaxListeners','save','emit'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0xa0a1,0x15b));var _0x1a0a=function(_0x35141a,_0x2c71fc){_0x35141a=_0x35141a-0x0;var _0x244754=_0xa0a1[_0x35141a];return _0x244754;};'use strict';var EventEmitter=require(_0x1a0a('0x0'));var FaxQueue=require('../../mysqldb')['db'][_0x1a0a('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x1a0a('0x2')](0x0);var events={'afterCreate':_0x1a0a('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xeaff7a){return function(_0x22f069,_0x5114de,_0x27077a){FaxQueueEvents[_0x1a0a('0x4')](_0xeaff7a+':'+_0x22f069['id'],_0x22f069);FaxQueueEvents['emit'](_0xeaff7a,_0x22f069);_0x27077a(null);};}for(var e in events){if(events[_0x1a0a('0x5')](e)){var event=events[e];FaxQueue[_0x1a0a('0x6')](e,emitEvent(event));}}module[_0x1a0a('0x7')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 3a4ab86..b205d62 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 _0xff02=['api','moment','bluebird','path','rimraf','../../config/environment','exports','define','FaxQueue','fax_queues','lodash','../../config/logger'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xff02,0x8e));var _0x2ff0=function(_0x97c9c0,_0x39319c){_0x97c9c0=_0x97c9c0-0x0;var _0x56231b=_0xff02[_0x97c9c0];return _0x56231b;};'use strict';var _=require(_0x2ff0('0x0'));var util=require('util');var logger=require(_0x2ff0('0x1'))(_0x2ff0('0x2'));var moment=require(_0x2ff0('0x3'));var BPromise=require(_0x2ff0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2ff0('0x5'));var rimraf=require(_0x2ff0('0x6'));var config=require(_0x2ff0('0x7'));var attributes=require('./faxQueue.attributes');module[_0x2ff0('0x8')]=function(_0xb30e2d,_0x3abd6e){return _0xb30e2d[_0x2ff0('0x9')](_0x2ff0('0xa'),attributes,{'tableName':_0x2ff0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8a77=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./faxQueue.attributes','exports','define','FaxQueue','util'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x8a77,0xa7));var _0x78a7=function(_0x37b168,_0x19afe7){_0x37b168=_0x37b168-0x0;var _0x572896=_0x8a77[_0x37b168];return _0x572896;};'use strict';var _=require('lodash');var util=require(_0x78a7('0x0'));var logger=require(_0x78a7('0x1'))(_0x78a7('0x2'));var moment=require(_0x78a7('0x3'));var BPromise=require(_0x78a7('0x4'));var rp=require(_0x78a7('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x78a7('0x6'));var config=require(_0x78a7('0x7'));var attributes=require(_0x78a7('0x8'));module[_0x78a7('0x9')]=function(_0x26caa8,_0x50ff65){return _0x26caa8[_0x78a7('0xa')](_0x78a7('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 d89a40c..58d29a4 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 _0x9d19=['info','catch','ShowFaxQueue','find','where','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetFaxQueue','FaxQueue','options','raw','attributes','limit','include','map','model'];(function(_0x47cad1,_0x46e05c){var _0x25d08b=function(_0x34d692){while(--_0x34d692){_0x47cad1['push'](_0x47cad1['shift']());}};_0x25d08b(++_0x46e05c);}(_0x9d19,0x176));var _0x99d1=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9d19[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x99d1('0x0'));var util=require(_0x99d1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x99d1('0x2'));var fs=require('fs');var Redis=require(_0x99d1('0x3'));var db=require(_0x99d1('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x99d1('0x5'))(_0x99d1('0x6'));var config=require(_0x99d1('0x7'));var jayson=require(_0x99d1('0x8'));var client=jayson[_0x99d1('0x9')][_0x99d1('0xa')]({'port':0x232a});config[_0x99d1('0xb')]=_[_0x99d1('0xc')](config[_0x99d1('0xb')],{'host':_0x99d1('0xd'),'port':0x18eb});var socket=require(_0x99d1('0xe'))(new Redis(config[_0x99d1('0xb')]));require('./faxQueue.socket')[_0x99d1('0xf')](socket);function respondWithRpcPromise(_0x6c52c0,_0x21cbcd,_0x54b148){return new BPromise(function(_0xb085d2,_0x106d9e){return client[_0x99d1('0x10')](_0x6c52c0,_0x54b148)[_0x99d1('0x11')](function(_0x5692a3){logger['info'](_0x99d1('0x12'),_0x21cbcd,_0x99d1('0x13'));logger[_0x99d1('0x14')](_0x99d1('0x15'),_0x21cbcd,_0x99d1('0x13'),JSON[_0x99d1('0x16')](_0x5692a3));if(_0x5692a3[_0x99d1('0x17')]){if(_0x5692a3['error'][_0x99d1('0x18')]===0x1f4){logger['error'](_0x99d1('0x12'),_0x21cbcd,_0x5692a3[_0x99d1('0x17')][_0x99d1('0x19')]);return _0x106d9e(_0x5692a3[_0x99d1('0x17')][_0x99d1('0x19')]);}logger[_0x99d1('0x17')](_0x99d1('0x12'),_0x21cbcd,_0x5692a3[_0x99d1('0x17')][_0x99d1('0x19')]);return _0xb085d2(_0x5692a3['error'][_0x99d1('0x19')]);}else{logger['info'](_0x99d1('0x12'),_0x21cbcd,_0x99d1('0x13'));_0xb085d2(_0x5692a3[_0x99d1('0x1a')][_0x99d1('0x19')]);}})['catch'](function(_0x4bace2){logger[_0x99d1('0x17')](_0x99d1('0x12'),_0x21cbcd,_0x4bace2);_0x106d9e(_0x4bace2);});});}exports[_0x99d1('0x1b')]=function(_0x573abd){var _0x14a3f3=this;return new Promise(function(_0x4a6bdc,_0x37f081){return db[_0x99d1('0x1c')]['findAll']({'raw':_0x573abd[_0x99d1('0x1d')]?_0x573abd[_0x99d1('0x1d')][_0x99d1('0x1e')]===undefined?!![]:![]:!![],'where':_0x573abd[_0x99d1('0x1d')]?_0x573abd['options']['where']||null:null,'attributes':_0x573abd[_0x99d1('0x1d')]?_0x573abd[_0x99d1('0x1d')][_0x99d1('0x1f')]||null:null,'limit':_0x573abd[_0x99d1('0x1d')]?_0x573abd[_0x99d1('0x1d')][_0x99d1('0x20')]||null:null,'include':_0x573abd[_0x99d1('0x1d')]?_0x573abd[_0x99d1('0x1d')][_0x99d1('0x21')]?_[_0x99d1('0x22')](_0x573abd['options']['include'],function(_0x15b603){return{'model':db[_0x15b603['model']],'as':_0x15b603['as'],'attributes':_0x15b603[_0x99d1('0x1f')],'include':_0x15b603[_0x99d1('0x21')]?_[_0x99d1('0x22')](_0x15b603[_0x99d1('0x21')],function(_0x161308){return{'model':db[_0x161308[_0x99d1('0x23')]],'as':_0x161308['as'],'attributes':_0x161308[_0x99d1('0x1f')],'include':_0x161308[_0x99d1('0x21')]?_['map'](_0x161308['include'],function(_0x35e584){return{'model':db[_0x35e584[_0x99d1('0x23')]],'as':_0x35e584['as'],'attributes':_0x35e584['attributes']};}):[]};}):[]};}):[]:[]})[_0x99d1('0x11')](function(_0x31b504){logger[_0x99d1('0x24')](_0x99d1('0x1b'),_0x573abd);logger['debug']('GetFaxQueue',_0x573abd,JSON[_0x99d1('0x16')](_0x31b504));_0x4a6bdc(_0x31b504);})[_0x99d1('0x25')](function(_0x10548a){logger['error']('GetFaxQueue',_0x10548a['message'],_0x573abd);_0x37f081(_0x14a3f3['error'](0x1f4,_0x10548a[_0x99d1('0x19')]));});});};exports[_0x99d1('0x26')]=function(_0x207c19){var _0x5aa3bd=this;return new Promise(function(_0x57263f,_0x2df93d){return db[_0x99d1('0x1c')][_0x99d1('0x27')]({'raw':_0x207c19[_0x99d1('0x1d')]?_0x207c19[_0x99d1('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x207c19[_0x99d1('0x1d')]?_0x207c19['options'][_0x99d1('0x28')]||null:null,'attributes':_0x207c19[_0x99d1('0x1d')]?_0x207c19['options']['attributes']||null:null,'include':_0x207c19[_0x99d1('0x1d')]?_0x207c19['options'][_0x99d1('0x21')]?_['map'](_0x207c19[_0x99d1('0x1d')][_0x99d1('0x21')],function(_0x4f4a6c){return{'model':db[_0x4f4a6c[_0x99d1('0x23')]],'as':_0x4f4a6c['as'],'attributes':_0x4f4a6c[_0x99d1('0x1f')],'include':_0x4f4a6c[_0x99d1('0x21')]?_[_0x99d1('0x22')](_0x4f4a6c['include'],function(_0x41d121){return{'model':db[_0x41d121[_0x99d1('0x23')]],'as':_0x41d121['as'],'attributes':_0x41d121['attributes'],'include':_0x41d121['include']?_[_0x99d1('0x22')](_0x41d121[_0x99d1('0x21')],function(_0x3ebc89){return{'model':db[_0x3ebc89['model']],'as':_0x3ebc89['as'],'attributes':_0x3ebc89['attributes']};}):[]};}):[]};}):[]:[]})[_0x99d1('0x11')](function(_0x2ef15f){logger['info'](_0x99d1('0x26'),_0x207c19);logger[_0x99d1('0x14')](_0x99d1('0x26'),_0x207c19,JSON['stringify'](_0x2ef15f));_0x57263f(_0x2ef15f);})['catch'](function(_0x4006d2){logger[_0x99d1('0x17')](_0x99d1('0x26'),_0x4006d2[_0x99d1('0x19')],_0x207c19);_0x2df93d(_0x5aa3bd['error'](0x1f4,_0x4006d2[_0x99d1('0x19')]));});});}; \ No newline at end of file +var _0x866c=['options','raw','where','include','model','attributes','map','ShowFaxQueue','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','./faxQueue.socket','register','request','then','info','FaxQueue,\x20%s,\x20%s','debug','FaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetFaxQueue','FaxQueue'];(function(_0x1fbc5c,_0x3897e9){var _0x50a63d=function(_0x4665c4){while(--_0x4665c4){_0x1fbc5c['push'](_0x1fbc5c['shift']());}};_0x50a63d(++_0x3897e9);}(_0x866c,0xa4));var _0xc866=function(_0x18c5a1,_0x3701ea){_0x18c5a1=_0x18c5a1-0x0;var _0x1f3934=_0x866c[_0x18c5a1];return _0x1f3934;};'use strict';var _=require(_0xc866('0x0'));var util=require('util');var moment=require(_0xc866('0x1'));var BPromise=require(_0xc866('0x2'));var rs=require(_0xc866('0x3'));var fs=require('fs');var Redis=require(_0xc866('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc866('0x5'));var logger=require(_0xc866('0x6'))(_0xc866('0x7'));var config=require('../../config/environment');var jayson=require(_0xc866('0x8'));var client=jayson[_0xc866('0x9')][_0xc866('0xa')]({'port':0x232a});config[_0xc866('0xb')]=_[_0xc866('0xc')](config[_0xc866('0xb')],{'host':_0xc866('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc866('0xb')]));require(_0xc866('0xe'))[_0xc866('0xf')](socket);function respondWithRpcPromise(_0x34a7ec,_0x25528d,_0x26d833){return new BPromise(function(_0x17b0ab,_0x2b1df3){return client[_0xc866('0x10')](_0x34a7ec,_0x26d833)[_0xc866('0x11')](function(_0x1ac955){logger[_0xc866('0x12')](_0xc866('0x13'),_0x25528d,'request\x20sent');logger[_0xc866('0x14')](_0xc866('0x15'),_0x25528d,_0xc866('0x16'),JSON[_0xc866('0x17')](_0x1ac955));if(_0x1ac955['error']){if(_0x1ac955[_0xc866('0x18')][_0xc866('0x19')]===0x1f4){logger[_0xc866('0x18')](_0xc866('0x13'),_0x25528d,_0x1ac955[_0xc866('0x18')][_0xc866('0x1a')]);return _0x2b1df3(_0x1ac955[_0xc866('0x18')][_0xc866('0x1a')]);}logger[_0xc866('0x18')](_0xc866('0x13'),_0x25528d,_0x1ac955[_0xc866('0x18')][_0xc866('0x1a')]);return _0x17b0ab(_0x1ac955['error']['message']);}else{logger[_0xc866('0x12')](_0xc866('0x13'),_0x25528d,'request\x20sent');_0x17b0ab(_0x1ac955[_0xc866('0x1b')]['message']);}})[_0xc866('0x1c')](function(_0x9c6de6){logger[_0xc866('0x18')](_0xc866('0x13'),_0x25528d,_0x9c6de6);_0x2b1df3(_0x9c6de6);});});}exports[_0xc866('0x1d')]=function(_0xb8d212){var _0x5574cd=this;return new Promise(function(_0x5330e3,_0xc71cfb){return db[_0xc866('0x1e')]['findAll']({'raw':_0xb8d212['options']?_0xb8d212[_0xc866('0x1f')][_0xc866('0x20')]===undefined?!![]:![]:!![],'where':_0xb8d212[_0xc866('0x1f')]?_0xb8d212[_0xc866('0x1f')][_0xc866('0x21')]||null:null,'attributes':_0xb8d212[_0xc866('0x1f')]?_0xb8d212[_0xc866('0x1f')]['attributes']||null:null,'limit':_0xb8d212['options']?_0xb8d212[_0xc866('0x1f')]['limit']||null:null,'include':_0xb8d212[_0xc866('0x1f')]?_0xb8d212['options'][_0xc866('0x22')]?_['map'](_0xb8d212[_0xc866('0x1f')]['include'],function(_0x26172d){return{'model':db[_0x26172d[_0xc866('0x23')]],'as':_0x26172d['as'],'attributes':_0x26172d[_0xc866('0x24')],'include':_0x26172d['include']?_[_0xc866('0x25')](_0x26172d[_0xc866('0x22')],function(_0x2a8c32){return{'model':db[_0x2a8c32['model']],'as':_0x2a8c32['as'],'attributes':_0x2a8c32[_0xc866('0x24')],'include':_0x2a8c32[_0xc866('0x22')]?_['map'](_0x2a8c32[_0xc866('0x22')],function(_0x1b2452){return{'model':db[_0x1b2452[_0xc866('0x23')]],'as':_0x1b2452['as'],'attributes':_0x1b2452['attributes']};}):[]};}):[]};}):[]:[]})[_0xc866('0x11')](function(_0x33fec4){logger[_0xc866('0x12')](_0xc866('0x1d'),_0xb8d212);logger[_0xc866('0x14')](_0xc866('0x1d'),_0xb8d212,JSON[_0xc866('0x17')](_0x33fec4));_0x5330e3(_0x33fec4);})[_0xc866('0x1c')](function(_0x28b7b2){logger['error']('GetFaxQueue',_0x28b7b2[_0xc866('0x1a')],_0xb8d212);_0xc71cfb(_0x5574cd[_0xc866('0x18')](0x1f4,_0x28b7b2[_0xc866('0x1a')]));});});};exports[_0xc866('0x26')]=function(_0x3cfa80){var _0x51d9dc=this;return new Promise(function(_0x27aaf2,_0x12587e){return db[_0xc866('0x1e')]['find']({'raw':_0x3cfa80['options']?_0x3cfa80[_0xc866('0x1f')][_0xc866('0x20')]===undefined?!![]:![]:!![],'where':_0x3cfa80['options']?_0x3cfa80[_0xc866('0x1f')][_0xc866('0x21')]||null:null,'attributes':_0x3cfa80[_0xc866('0x1f')]?_0x3cfa80['options'][_0xc866('0x24')]||null:null,'include':_0x3cfa80['options']?_0x3cfa80[_0xc866('0x1f')][_0xc866('0x22')]?_[_0xc866('0x25')](_0x3cfa80[_0xc866('0x1f')][_0xc866('0x22')],function(_0xc44bd5){return{'model':db[_0xc44bd5[_0xc866('0x23')]],'as':_0xc44bd5['as'],'attributes':_0xc44bd5['attributes'],'include':_0xc44bd5[_0xc866('0x22')]?_[_0xc866('0x25')](_0xc44bd5[_0xc866('0x22')],function(_0x194803){return{'model':db[_0x194803['model']],'as':_0x194803['as'],'attributes':_0x194803['attributes'],'include':_0x194803[_0xc866('0x22')]?_[_0xc866('0x25')](_0x194803['include'],function(_0x4e7f01){return{'model':db[_0x4e7f01[_0xc866('0x23')]],'as':_0x4e7f01['as'],'attributes':_0x4e7f01[_0xc866('0x24')]};}):[]};}):[]};}):[]:[]})[_0xc866('0x11')](function(_0x174a57){logger['info']('ShowFaxQueue',_0x3cfa80);logger['debug'](_0xc866('0x26'),_0x3cfa80,JSON[_0xc866('0x17')](_0x174a57));_0x27aaf2(_0x174a57);})[_0xc866('0x1c')](function(_0x2b1c6c){logger[_0xc866('0x18')](_0xc866('0x26'),_0x2b1c6c['message'],_0x3cfa80);_0x12587e(_0x51d9dc['error'](0x1f4,_0x2b1c6c['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 9e527fe..d50349b 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 _0xa650=['./faxQueue.events','save','remove','update','emit','register','faxQueue:'];(function(_0x1b91c7,_0x539acd){var _0xbbe014=function(_0x57ff15){while(--_0x57ff15){_0x1b91c7['push'](_0x1b91c7['shift']());}};_0xbbe014(++_0x539acd);}(_0xa650,0x7e));var _0x0a65=function(_0x1c0d28,_0xc85fc9){_0x1c0d28=_0x1c0d28-0x0;var _0x1c3b4a=_0xa650[_0x1c0d28];return _0x1c3b4a;};'use strict';var FaxQueueEvents=require(_0x0a65('0x0'));var events=[_0x0a65('0x1'),_0x0a65('0x2'),_0x0a65('0x3')];function createListener(_0x23044e,_0x41ca07){return function(_0x5f0430){_0x41ca07[_0x0a65('0x4')](_0x23044e,_0x5f0430);};}function removeListener(_0x56f083,_0x5debec){return function(){FaxQueueEvents['removeListener'](_0x56f083,_0x5debec);};}exports[_0x0a65('0x5')]=function(_0x59da13){for(var _0x4d7ad2=0x0,_0x567187=events['length'];_0x4d7ad2<_0x567187;_0x4d7ad2++){var _0x544797=events[_0x4d7ad2];var _0x579a49=createListener(_0x0a65('0x6')+_0x544797,_0x59da13);FaxQueueEvents['on'](_0x544797,_0x579a49);}}; \ No newline at end of file +var _0x51f4=['update','emit','removeListener','register','faxQueue:','./faxQueue.events','save'];(function(_0x3f474b,_0x4b75d4){var _0x39f792=function(_0x7079cc){while(--_0x7079cc){_0x3f474b['push'](_0x3f474b['shift']());}};_0x39f792(++_0x4b75d4);}(_0x51f4,0x1a2));var _0x451f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x51f4[_0x321bb2];return _0x9c12ed;};'use strict';var FaxQueueEvents=require(_0x451f('0x0'));var events=[_0x451f('0x1'),'remove',_0x451f('0x2')];function createListener(_0x57dab5,_0x1dcf62){return function(_0x5b2fa8){_0x1dcf62[_0x451f('0x3')](_0x57dab5,_0x5b2fa8);};}function removeListener(_0x3931a3,_0x335006){return function(){FaxQueueEvents[_0x451f('0x4')](_0x3931a3,_0x335006);};}exports[_0x451f('0x5')]=function(_0x57e150){for(var _0x3d8841=0x0,_0xad87a8=events['length'];_0x3d8841<_0xad87a8;_0x3d8841++){var _0xaa8b66=events[_0x3d8841];var _0x4e5296=createListener(_0x451f('0x6')+_0xaa8b66,_0x57e150);FaxQueueEvents['on'](_0xaa8b66,_0x4e5296);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index de167aa..47bb547 100644 --- a/server/api/faxQueue/index.js +++ b/server/api/faxQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['create','addAgents','put','delete','destroy','removeTeams','removeAgents','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post'];(function(_0x30dba7,_0x2fb710){var _0x1a9a83=function(_0x1a2043){while(--_0x1a2043){_0x30dba7['push'](_0x30dba7['shift']());}};_0x1a9a83(++_0x2fb710);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xbaf0[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var auth=require(_0x0baf('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0baf('0x6'));var controller=require(_0x0baf('0x7'));router[_0x0baf('0x8')]('/',auth[_0x0baf('0x9')](),controller[_0x0baf('0xa')]);router[_0x0baf('0x8')](_0x0baf('0xb'),auth[_0x0baf('0x9')](),controller[_0x0baf('0xc')]);router['get'](_0x0baf('0xd'),auth['isAuthenticated'](),controller[_0x0baf('0xe')]);router[_0x0baf('0x8')](_0x0baf('0xf'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x10')]);router[_0x0baf('0x8')](_0x0baf('0x11'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x8')](_0x0baf('0x13'),auth['isAuthenticated'](),controller['getAgents']);router[_0x0baf('0x14')]('/',auth[_0x0baf('0x9')](),controller[_0x0baf('0x15')]);router[_0x0baf('0x14')]('/:id/teams',auth[_0x0baf('0x9')](),controller['addTeams']);router[_0x0baf('0x14')](_0x0baf('0x13'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x16')]);router[_0x0baf('0x17')](_0x0baf('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x0baf('0x18')](_0x0baf('0xd'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x19')]);router[_0x0baf('0x18')](_0x0baf('0x11'),auth['isAuthenticated'](),controller[_0x0baf('0x1a')]);router[_0x0baf('0x18')](_0x0baf('0x13'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x1b')]);module[_0x0baf('0x1c')]=router; \ No newline at end of file +var _0xd8b0=['util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','index','get','/describe','describe','isAuthenticated','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','/:id','update','delete','destroy','removeTeams','exports','multer'];(function(_0x466f67,_0x4eafad){var _0x7e1b8d=function(_0x3b1558){while(--_0x3b1558){_0x466f67['push'](_0x466f67['shift']());}};_0x7e1b8d(++_0x4eafad);}(_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',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0x8')](_0x0d8b('0xd'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0x8')](_0x0d8b('0xf'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['get'](_0x0d8b('0x11'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x12')]);router[_0x0d8b('0x13')]('/',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x14')]);router[_0x0d8b('0x13')](_0x0d8b('0xf'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x15')]);router[_0x0d8b('0x13')](_0x0d8b('0x11'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x16')]);router['put'](_0x0d8b('0x17'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x18')]);router[_0x0d8b('0x19')](_0x0d8b('0x17'),auth['isAuthenticated'](),controller[_0x0d8b('0x1a')]);router[_0x0d8b('0x19')](_0x0d8b('0xf'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x1b')]);router[_0x0d8b('0x19')](_0x0d8b('0x11'),auth[_0x0d8b('0xb')](),controller['removeAgents']);module[_0x0d8b('0x1c')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 55471ce..bf1d164 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 _0xa01d=['sequelize','STRING','DATE'];(function(_0xd2254e,_0x457bec){var _0x10146d=function(_0x4fd0d9){while(--_0x4fd0d9){_0xd2254e['push'](_0xd2254e['shift']());}};_0x10146d(++_0x457bec);}(_0xa01d,0x132));var _0xda01=function(_0x9574df,_0x272055){_0x9574df=_0x9574df-0x0;var _0x127e45=_0xa01d[_0x9574df];return _0x127e45;};'use strict';var moment=require('moment');var Sequelize=require(_0xda01('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xda01('0x1')]},'joinAt':{'type':Sequelize[_0xda01('0x2')]},'leaveAt':{'type':Sequelize[_0xda01('0x2')]},'acceptAt':{'type':Sequelize[_0xda01('0x2')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xda01('0x1')]}}; \ No newline at end of file +var _0xcaaf=['DATE','sequelize','exports','STRING'];(function(_0x2c4e8b,_0x5daae4){var _0xf4471a=function(_0x242405){while(--_0x242405){_0x2c4e8b['push'](_0x2c4e8b['shift']());}};_0xf4471a(++_0x5daae4);}(_0xcaaf,0x1b5));var _0xfcaa=function(_0x469daf,_0x4db8cf){_0x469daf=_0x469daf-0x0;var _0x53938e=_0xcaaf[_0x469daf];return _0x53938e;};'use strict';var moment=require('moment');var Sequelize=require(_0xfcaa('0x0'));module[_0xfcaa('0x1')]={'uniqueid':{'type':Sequelize[_0xfcaa('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xfcaa('0x2')]},'joinAt':{'type':Sequelize[_0xfcaa('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xfcaa('0x3')]},'exitAt':{'type':Sequelize[_0xfcaa('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 7f84529..7baa457 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 _0x9ee8=['offset','order','sort','where','pick','filter','key','VIRTUAL','field','merge','options','FaxQueueReport','includeAll','include','findAll','rows','show','params','keys','intersection','length','find','create','catch','body','describe','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','sendStatus','status','end','json','count','Content-Range','save','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','model','map','query','filters','fields','attributes','hasOwnProperty','limit'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x9ee8,0x182));var _0x89ee=function(_0x466dcb,_0x2ba4b0){_0x466dcb=_0x466dcb-0x0;var _0x5de537=_0x9ee8[_0x466dcb];return _0x5de537;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x89ee('0x0'));var rimraf=require(_0x89ee('0x1'));var zipdir=require(_0x89ee('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x89ee('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x89ee('0x4'));var util=require(_0x89ee('0x5'));var path=require(_0x89ee('0x6'));var sox=require('sox');var csv=require(_0x89ee('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x89ee('0x8'));var squel=require(_0x89ee('0x9'));var crypto=require(_0x89ee('0xa'));var jsforce=require(_0x89ee('0xb'));var deskjs=require(_0x89ee('0xc'));var toCsv=require('to-csv');var querystring=require(_0x89ee('0xd'));var Papa=require(_0x89ee('0xe'));var Redis=require(_0x89ee('0xf'));var authService=require(_0x89ee('0x10'));var qs=require(_0x89ee('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x89ee('0x12'))(_0x89ee('0x13'));var utils=require('../../config/utils');var config=require(_0x89ee('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3c7b85,_0x4d7bc4){_0x4d7bc4=_0x4d7bc4||0xcc;return function(_0x58ecb4){if(_0x58ecb4){return _0x3c7b85[_0x89ee('0x15')](_0x4d7bc4);}return _0x3c7b85[_0x89ee('0x16')](_0x4d7bc4)[_0x89ee('0x17')]();};}function respondWithResult(_0x5a4c02,_0x48a4d0){_0x48a4d0=_0x48a4d0||0xc8;return function(_0x95dac1){if(_0x95dac1){return _0x5a4c02['status'](_0x48a4d0)[_0x89ee('0x18')](_0x95dac1);}};}function respondWithFilteredResult(_0xddd9e7,_0x3f1d1f){return function(_0x2be094){if(_0x2be094){var _0x57bebd=_0x2be094[_0x89ee('0x19')],_0x97e916=_0x3f1d1f['offset'],_0x3d9e2c=_0x3f1d1f['offset']+_0x3f1d1f['limit'],_0x4851d7;if(_0x3d9e2c>=_0x57bebd){_0x3d9e2c=_0x57bebd;_0x4851d7=0xc8;}else{_0x4851d7=0xce;}_0xddd9e7[_0x89ee('0x16')](_0x4851d7);return _0xddd9e7['set'](_0x89ee('0x1a'),_0x97e916+'-'+_0x3d9e2c+'/'+_0x57bebd)[_0x89ee('0x18')](_0x2be094);}return null;};}function patchUpdates(_0xef29ff){return function(_0x3e1a10){try{jsonpatch['apply'](_0x3e1a10,_0xef29ff,!![]);}catch(_0x3e92f5){return BPromise['reject'](_0x3e92f5);}return _0x3e1a10[_0x89ee('0x1b')]();};}function saveUpdates(_0x2bbd1d,_0x2997ba){return function(_0x38c476){if(_0x38c476){return _0x38c476['update'](_0x2bbd1d)[_0x89ee('0x1c')](function(_0x195062){return _0x195062;});}return null;};}function removeEntity(_0x3577df,_0x3b0aae){return function(_0x4bf542){if(_0x4bf542){return _0x4bf542[_0x89ee('0x1d')]()[_0x89ee('0x1c')](function(){_0x3577df[_0x89ee('0x16')](0xcc)[_0x89ee('0x17')]();});}};}function handleEntityNotFound(_0x17d0c8,_0x58880e){return function(_0x12f4f9){if(!_0x12f4f9){_0x17d0c8[_0x89ee('0x15')](0x194);}return _0x12f4f9;};}function handleError(_0x3b328c,_0x8e002f){_0x8e002f=_0x8e002f||0x1f4;return function(_0x3817b2){logger[_0x89ee('0x1e')](_0x3817b2[_0x89ee('0x1f')]);if(_0x3817b2[_0x89ee('0x20')]){delete _0x3817b2[_0x89ee('0x20')];}_0x3b328c[_0x89ee('0x16')](_0x8e002f)[_0x89ee('0x21')](_0x3817b2);};}exports[_0x89ee('0x22')]=function(_0x49a018,_0x2bc65f){var _0x24d938={},_0x56b49c={},_0x4a03e3={'count':0x0,'rows':[]};var _0x43d5b3=_['map'](db['FaxQueueReport'][_0x89ee('0x23')],function(_0x2403af){return{'name':_0x2403af[_0x89ee('0x24')],'type':_0x2403af[_0x89ee('0x25')]['key']};});_0x56b49c[_0x89ee('0x26')]=_[_0x89ee('0x27')](_0x43d5b3,'name');_0x56b49c[_0x89ee('0x28')]=_['keys'](_0x49a018[_0x89ee('0x28')]);_0x56b49c[_0x89ee('0x29')]=_['intersection'](_0x56b49c[_0x89ee('0x26')],_0x56b49c[_0x89ee('0x28')]);_0x24d938['attributes']=_['intersection'](_0x56b49c[_0x89ee('0x26')],qs[_0x89ee('0x2a')](_0x49a018[_0x89ee('0x28')][_0x89ee('0x2a')]));_0x24d938[_0x89ee('0x2b')]=_0x24d938[_0x89ee('0x2b')]['length']?_0x24d938[_0x89ee('0x2b')]:_0x56b49c[_0x89ee('0x26')];if(!_0x49a018[_0x89ee('0x28')][_0x89ee('0x2c')]('nolimit')){_0x24d938[_0x89ee('0x2d')]=qs[_0x89ee('0x2d')](_0x49a018['query'][_0x89ee('0x2d')]);_0x24d938[_0x89ee('0x2e')]=qs['offset'](_0x49a018[_0x89ee('0x28')]['offset']);}_0x24d938[_0x89ee('0x2f')]=qs[_0x89ee('0x30')](_0x49a018[_0x89ee('0x28')]['sort']);_0x24d938[_0x89ee('0x31')]=qs[_0x89ee('0x29')](_[_0x89ee('0x32')](_0x49a018['query'],_0x56b49c[_0x89ee('0x29')]));if(_0x49a018[_0x89ee('0x28')][_0x89ee('0x33')]){_0x24d938[_0x89ee('0x31')]=_['merge'](_0x24d938['where'],{'$or':_[_0x89ee('0x27')](_0x43d5b3,function(_0x16df08){if(_0x16df08['type'][_0x89ee('0x34')]!==_0x89ee('0x35')){var _0x14d35b={};_0x14d35b[_0x16df08[_0x89ee('0x36')]]={'$like':'%'+_0x49a018[_0x89ee('0x28')][_0x89ee('0x33')]+'%'};return _0x14d35b;}})});}_0x24d938=_[_0x89ee('0x37')]({},_0x24d938,_0x49a018[_0x89ee('0x38')]);var _0x14184c={'where':_0x24d938[_0x89ee('0x31')]};return db[_0x89ee('0x39')][_0x89ee('0x19')](_0x14184c)[_0x89ee('0x1c')](function(_0x424612){_0x4a03e3[_0x89ee('0x19')]=_0x424612;if(_0x49a018[_0x89ee('0x28')][_0x89ee('0x3a')]){_0x24d938[_0x89ee('0x3b')]=[{'all':!![]}];}return db['FaxQueueReport'][_0x89ee('0x3c')](_0x24d938);})['then'](function(_0x2fb531){_0x4a03e3[_0x89ee('0x3d')]=_0x2fb531;return _0x4a03e3;})['then'](respondWithFilteredResult(_0x2bc65f,_0x24d938))['catch'](handleError(_0x2bc65f,null));};exports[_0x89ee('0x3e')]=function(_0x3045c6,_0x95b06d){var _0x373eba={'raw':!![],'where':{'id':_0x3045c6[_0x89ee('0x3f')]['id']}},_0x7e78d4={};_0x7e78d4[_0x89ee('0x26')]=_[_0x89ee('0x40')](db[_0x89ee('0x39')][_0x89ee('0x23')]);_0x7e78d4[_0x89ee('0x28')]=_['keys'](_0x3045c6[_0x89ee('0x28')]);_0x7e78d4[_0x89ee('0x29')]=_['intersection'](_0x7e78d4['model'],_0x7e78d4[_0x89ee('0x28')]);_0x373eba[_0x89ee('0x2b')]=_[_0x89ee('0x41')](_0x7e78d4[_0x89ee('0x26')],qs['fields'](_0x3045c6[_0x89ee('0x28')][_0x89ee('0x2a')]));_0x373eba['attributes']=_0x373eba['attributes'][_0x89ee('0x42')]?_0x373eba[_0x89ee('0x2b')]:_0x7e78d4['model'];if(_0x3045c6[_0x89ee('0x28')][_0x89ee('0x3a')]){_0x373eba['include']=[{'all':!![]}];}_0x373eba=_[_0x89ee('0x37')]({},_0x373eba,_0x3045c6[_0x89ee('0x38')]);return db[_0x89ee('0x39')][_0x89ee('0x43')](_0x373eba)[_0x89ee('0x1c')](handleEntityNotFound(_0x95b06d,null))[_0x89ee('0x1c')](respondWithResult(_0x95b06d,null))['catch'](handleError(_0x95b06d,null));};exports[_0x89ee('0x44')]=function(_0x26da87,_0x43bb39){return db[_0x89ee('0x39')][_0x89ee('0x44')](_0x26da87['body'],{})[_0x89ee('0x1c')](respondWithResult(_0x43bb39,0xc9))[_0x89ee('0x45')](handleError(_0x43bb39,null));};exports['update']=function(_0x55ca6e,_0x12cde3){if(_0x55ca6e['body']['id']){delete _0x55ca6e[_0x89ee('0x46')]['id'];}return db['FaxQueueReport']['find']({'where':{'id':_0x55ca6e[_0x89ee('0x3f')]['id']}})[_0x89ee('0x1c')](handleEntityNotFound(_0x12cde3,null))[_0x89ee('0x1c')](saveUpdates(_0x55ca6e[_0x89ee('0x46')],null))[_0x89ee('0x1c')](respondWithResult(_0x12cde3,null))[_0x89ee('0x45')](handleError(_0x12cde3,null));};exports[_0x89ee('0x1d')]=function(_0x3453a1,_0x30c7d3){return db['FaxQueueReport'][_0x89ee('0x43')]({'where':{'id':_0x3453a1[_0x89ee('0x3f')]['id']}})[_0x89ee('0x1c')](handleEntityNotFound(_0x30c7d3,null))[_0x89ee('0x1c')](removeEntity(_0x30c7d3,null))['catch'](handleError(_0x30c7d3,null));};exports[_0x89ee('0x47')]=function(_0x42253d,_0x1e743c){return db[_0x89ee('0x39')][_0x89ee('0x47')]()[_0x89ee('0x1c')](respondWithResult(_0x1e743c,null))[_0x89ee('0x45')](handleError(_0x1e743c,null));}; \ No newline at end of file +var _0x3808=['../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','then','error','name','index','map','FaxQueueReport','type','key','query','filters','attributes','intersection','model','fields','length','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','params','keys','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api'];(function(_0x20aadb,_0x5a607a){var _0x520018=function(_0x1d258a){while(--_0x1d258a){_0x20aadb['push'](_0x20aadb['shift']());}};_0x520018(++_0x5a607a);}(_0x3808,0x1dc));var _0x8380=function(_0x5d0325,_0x107e6b){_0x5d0325=_0x5d0325-0x0;var _0x551295=_0x3808[_0x5d0325];return _0x551295;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8380('0x0'));var rimraf=require(_0x8380('0x1'));var zipdir=require(_0x8380('0x2'));var jsonpatch=require(_0x8380('0x3'));var rp=require(_0x8380('0x4'));var moment=require(_0x8380('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8380('0x6'));var util=require(_0x8380('0x7'));var path=require(_0x8380('0x8'));var sox=require(_0x8380('0x9'));var csv=require(_0x8380('0xa'));var ejs=require(_0x8380('0xb'));var fs=require('fs');var _=require(_0x8380('0xc'));var squel=require(_0x8380('0xd'));var crypto=require(_0x8380('0xe'));var jsforce=require(_0x8380('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8380('0x10'));var Redis=require(_0x8380('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8380('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8380('0x13'))(_0x8380('0x14'));var utils=require(_0x8380('0x15'));var config=require(_0x8380('0x16'));var db=require(_0x8380('0x17'))['db'];function respondWithStatusCode(_0x1f1009,_0x440e6d){_0x440e6d=_0x440e6d||0xcc;return function(_0x2a7f15){if(_0x2a7f15){return _0x1f1009[_0x8380('0x18')](_0x440e6d);}return _0x1f1009[_0x8380('0x19')](_0x440e6d)[_0x8380('0x1a')]();};}function respondWithResult(_0x3a0bc8,_0x3b8d07){_0x3b8d07=_0x3b8d07||0xc8;return function(_0x229ce9){if(_0x229ce9){return _0x3a0bc8[_0x8380('0x19')](_0x3b8d07)[_0x8380('0x1b')](_0x229ce9);}};}function respondWithFilteredResult(_0x30c93e,_0x232374){return function(_0x29d9da){if(_0x29d9da){var _0x22f972=_0x29d9da[_0x8380('0x1c')],_0x3b3941=_0x232374['offset'],_0x5b9d6d=_0x232374[_0x8380('0x1d')]+_0x232374['limit'],_0x78a151;if(_0x5b9d6d>=_0x22f972){_0x5b9d6d=_0x22f972;_0x78a151=0xc8;}else{_0x78a151=0xce;}_0x30c93e[_0x8380('0x19')](_0x78a151);return _0x30c93e[_0x8380('0x1e')](_0x8380('0x1f'),_0x3b3941+'-'+_0x5b9d6d+'/'+_0x22f972)[_0x8380('0x1b')](_0x29d9da);}return null;};}function patchUpdates(_0x2c28ee){return function(_0x409746){try{jsonpatch[_0x8380('0x20')](_0x409746,_0x2c28ee,!![]);}catch(_0xbd532c){return BPromise[_0x8380('0x21')](_0xbd532c);}return _0x409746['save']();};}function saveUpdates(_0x275a91,_0x2b5909){return function(_0x3d901f){if(_0x3d901f){return _0x3d901f['update'](_0x275a91)[_0x8380('0x22')](function(_0x5413a2){return _0x5413a2;});}return null;};}function removeEntity(_0x136ecc,_0x5e521f){return function(_0x42af57){if(_0x42af57){return _0x42af57['destroy']()[_0x8380('0x22')](function(){_0x136ecc[_0x8380('0x19')](0xcc)[_0x8380('0x1a')]();});}};}function handleEntityNotFound(_0xb8123,_0x3ddf5d){return function(_0x1ec281){if(!_0x1ec281){_0xb8123[_0x8380('0x18')](0x194);}return _0x1ec281;};}function handleError(_0x4c7751,_0x42dfaf){_0x42dfaf=_0x42dfaf||0x1f4;return function(_0x236cf9){logger[_0x8380('0x23')](_0x236cf9['stack']);if(_0x236cf9[_0x8380('0x24')]){delete _0x236cf9[_0x8380('0x24')];}_0x4c7751[_0x8380('0x19')](_0x42dfaf)['send'](_0x236cf9);};}exports[_0x8380('0x25')]=function(_0x2a6cc2,_0x1164f2){var _0x1dc11d={},_0xd24e07={},_0x2e6fa8={'count':0x0,'rows':[]};var _0x2439ca=_[_0x8380('0x26')](db[_0x8380('0x27')]['rawAttributes'],function(_0x2038b4){return{'name':_0x2038b4['fieldName'],'type':_0x2038b4[_0x8380('0x28')][_0x8380('0x29')]};});_0xd24e07['model']=_[_0x8380('0x26')](_0x2439ca,_0x8380('0x24'));_0xd24e07[_0x8380('0x2a')]=_['keys'](_0x2a6cc2[_0x8380('0x2a')]);_0xd24e07[_0x8380('0x2b')]=_['intersection'](_0xd24e07['model'],_0xd24e07[_0x8380('0x2a')]);_0x1dc11d[_0x8380('0x2c')]=_[_0x8380('0x2d')](_0xd24e07[_0x8380('0x2e')],qs['fields'](_0x2a6cc2[_0x8380('0x2a')][_0x8380('0x2f')]));_0x1dc11d[_0x8380('0x2c')]=_0x1dc11d[_0x8380('0x2c')][_0x8380('0x30')]?_0x1dc11d[_0x8380('0x2c')]:_0xd24e07[_0x8380('0x2e')];if(!_0x2a6cc2['query']['hasOwnProperty'](_0x8380('0x31'))){_0x1dc11d[_0x8380('0x32')]=qs['limit'](_0x2a6cc2[_0x8380('0x2a')][_0x8380('0x32')]);_0x1dc11d[_0x8380('0x1d')]=qs['offset'](_0x2a6cc2[_0x8380('0x2a')][_0x8380('0x1d')]);}_0x1dc11d['order']=qs[_0x8380('0x33')](_0x2a6cc2[_0x8380('0x2a')]['sort']);_0x1dc11d[_0x8380('0x34')]=qs['filters'](_[_0x8380('0x35')](_0x2a6cc2[_0x8380('0x2a')],_0xd24e07['filters']));if(_0x2a6cc2[_0x8380('0x2a')][_0x8380('0x36')]){_0x1dc11d[_0x8380('0x34')]=_[_0x8380('0x37')](_0x1dc11d[_0x8380('0x34')],{'$or':_[_0x8380('0x26')](_0x2439ca,function(_0x2f5928){if(_0x2f5928[_0x8380('0x28')][_0x8380('0x29')]!==_0x8380('0x38')){var _0xa75a60={};_0xa75a60[_0x2f5928[_0x8380('0x39')]]={'$like':'%'+_0x2a6cc2[_0x8380('0x2a')][_0x8380('0x36')]+'%'};return _0xa75a60;}})});}_0x1dc11d=_[_0x8380('0x37')]({},_0x1dc11d,_0x2a6cc2[_0x8380('0x3a')]);var _0x24bfb7={'where':_0x1dc11d[_0x8380('0x34')]};return db[_0x8380('0x27')][_0x8380('0x1c')](_0x24bfb7)['then'](function(_0x32fda0){_0x2e6fa8[_0x8380('0x1c')]=_0x32fda0;if(_0x2a6cc2[_0x8380('0x2a')][_0x8380('0x3b')]){_0x1dc11d[_0x8380('0x3c')]=[{'all':!![]}];}return db['FaxQueueReport'][_0x8380('0x3d')](_0x1dc11d);})[_0x8380('0x22')](function(_0x2afac2){_0x2e6fa8[_0x8380('0x3e')]=_0x2afac2;return _0x2e6fa8;})[_0x8380('0x22')](respondWithFilteredResult(_0x1164f2,_0x1dc11d))[_0x8380('0x3f')](handleError(_0x1164f2,null));};exports['show']=function(_0x425f61,_0xdc2f3d){var _0x20b009={'raw':!![],'where':{'id':_0x425f61[_0x8380('0x40')]['id']}},_0x5d71a4={};_0x5d71a4[_0x8380('0x2e')]=_[_0x8380('0x41')](db['FaxQueueReport']['rawAttributes']);_0x5d71a4[_0x8380('0x2a')]=_[_0x8380('0x41')](_0x425f61[_0x8380('0x2a')]);_0x5d71a4[_0x8380('0x2b')]=_[_0x8380('0x2d')](_0x5d71a4['model'],_0x5d71a4[_0x8380('0x2a')]);_0x20b009[_0x8380('0x2c')]=_[_0x8380('0x2d')](_0x5d71a4[_0x8380('0x2e')],qs[_0x8380('0x2f')](_0x425f61[_0x8380('0x2a')][_0x8380('0x2f')]));_0x20b009['attributes']=_0x20b009[_0x8380('0x2c')][_0x8380('0x30')]?_0x20b009[_0x8380('0x2c')]:_0x5d71a4['model'];if(_0x425f61[_0x8380('0x2a')][_0x8380('0x3b')]){_0x20b009[_0x8380('0x3c')]=[{'all':!![]}];}_0x20b009=_[_0x8380('0x37')]({},_0x20b009,_0x425f61[_0x8380('0x3a')]);return db[_0x8380('0x27')][_0x8380('0x42')](_0x20b009)['then'](handleEntityNotFound(_0xdc2f3d,null))[_0x8380('0x22')](respondWithResult(_0xdc2f3d,null))[_0x8380('0x3f')](handleError(_0xdc2f3d,null));};exports[_0x8380('0x43')]=function(_0x3dd527,_0x5a52e9){return db['FaxQueueReport'][_0x8380('0x43')](_0x3dd527[_0x8380('0x44')],{})['then'](respondWithResult(_0x5a52e9,0xc9))[_0x8380('0x3f')](handleError(_0x5a52e9,null));};exports['update']=function(_0x545116,_0x3f2918){if(_0x545116[_0x8380('0x44')]['id']){delete _0x545116[_0x8380('0x44')]['id'];}return db[_0x8380('0x27')][_0x8380('0x42')]({'where':{'id':_0x545116[_0x8380('0x40')]['id']}})[_0x8380('0x22')](handleEntityNotFound(_0x3f2918,null))['then'](saveUpdates(_0x545116[_0x8380('0x44')],null))[_0x8380('0x22')](respondWithResult(_0x3f2918,null))[_0x8380('0x3f')](handleError(_0x3f2918,null));};exports[_0x8380('0x45')]=function(_0x27a2d8,_0x14aa02){return db[_0x8380('0x27')]['find']({'where':{'id':_0x27a2d8[_0x8380('0x40')]['id']}})['then'](handleEntityNotFound(_0x14aa02,null))[_0x8380('0x22')](removeEntity(_0x14aa02,null))[_0x8380('0x3f')](handleError(_0x14aa02,null));};exports['describe']=function(_0xd9b262,_0x130d89){return db[_0x8380('0x27')][_0x8380('0x46')]()[_0x8380('0x22')](respondWithResult(_0x130d89,null))[_0x8380('0x3f')](handleError(_0x130d89,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index d1e6600..394e3c0 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 _0x761b=['../../config/environment','exports','define','FaxQueueReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x761b,0x9f));var _0xb761=function(_0x1cd285,_0x99f96f){_0x1cd285=_0x1cd285-0x0;var _0x19cd3d=_0x761b[_0x1cd285];return _0x19cd3d;};'use strict';var _=require(_0xb761('0x0'));var util=require(_0xb761('0x1'));var logger=require(_0xb761('0x2'))(_0xb761('0x3'));var moment=require(_0xb761('0x4'));var BPromise=require(_0xb761('0x5'));var rp=require(_0xb761('0x6'));var fs=require('fs');var path=require(_0xb761('0x7'));var rimraf=require(_0xb761('0x8'));var config=require(_0xb761('0x9'));var attributes=require('./faxQueueReport.attributes');module[_0xb761('0xa')]=function(_0x379935,_0x5c4b31){return _0x379935[_0xb761('0xb')](_0xb761('0xc'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0xb761('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xf586=['exports','define','report_fax_queue','uniqueid','lodash','../../config/logger','api','request-promise','path','../../config/environment','./faxQueueReport.attributes'];(function(_0x5d8a3b,_0x2b9800){var _0x3e9aa2=function(_0x364636){while(--_0x364636){_0x5d8a3b['push'](_0x5d8a3b['shift']());}};_0x3e9aa2(++_0x2b9800);}(_0xf586,0x1c7));var _0x6f58=function(_0x49944a,_0x1a3723){_0x49944a=_0x49944a-0x0;var _0x2567fc=_0xf586[_0x49944a];return _0x2567fc;};'use strict';var _=require(_0x6f58('0x0'));var util=require('util');var logger=require(_0x6f58('0x1'))(_0x6f58('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6f58('0x3'));var fs=require('fs');var path=require(_0x6f58('0x4'));var rimraf=require('rimraf');var config=require(_0x6f58('0x5'));var attributes=require(_0x6f58('0x6'));module[_0x6f58('0x7')]=function(_0x249120,_0x34df15){return _0x249120[_0x6f58('0x8')]('FaxQueueReport',attributes,{'tableName':_0x6f58('0x9'),'paranoid':![],'indexes':[{'name':_0x6f58('0xa'),'fields':[_0x6f58('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 5593503..77a42e1 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 _0xac0d=['../../config/logger','rpc','jayson/promise','http','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','create','CreateFaxQueueReport','UpdateFaxQueueReport','FaxQueueReport','update','body','options','raw','where','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x46fa21,_0x4dd7a8){var _0x519555=function(_0x38bd54){while(--_0x38bd54){_0x46fa21['push'](_0x46fa21['shift']());}};_0x519555(++_0x4dd7a8);}(_0xac0d,0x79));var _0xdac0=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0xac0d[_0x513aa5];return _0x1a1a7c;};'use strict';var _=require(_0xdac0('0x0'));var util=require(_0xdac0('0x1'));var moment=require(_0xdac0('0x2'));var BPromise=require(_0xdac0('0x3'));var rs=require(_0xdac0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdac0('0x5'))['db'];var utils=require(_0xdac0('0x6'));var logger=require(_0xdac0('0x7'))(_0xdac0('0x8'));var config=require('../../config/environment');var jayson=require(_0xdac0('0x9'));var client=jayson['client'][_0xdac0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1711f4,_0x116237,_0x450ba0){return new BPromise(function(_0x19c32b,_0x45f68c){return client['request'](_0x1711f4,_0x450ba0)[_0xdac0('0xb')](function(_0x1ab8e9){logger[_0xdac0('0xc')](_0xdac0('0xd'),_0x116237,_0xdac0('0xe'));logger[_0xdac0('0xf')](_0xdac0('0x10'),_0x116237,_0xdac0('0xe'),JSON[_0xdac0('0x11')](_0x1ab8e9));if(_0x1ab8e9[_0xdac0('0x12')]){if(_0x1ab8e9[_0xdac0('0x12')][_0xdac0('0x13')]===0x1f4){logger[_0xdac0('0x12')](_0xdac0('0xd'),_0x116237,_0x1ab8e9['error'][_0xdac0('0x14')]);return _0x45f68c(_0x1ab8e9[_0xdac0('0x12')][_0xdac0('0x14')]);}logger[_0xdac0('0x12')](_0xdac0('0xd'),_0x116237,_0x1ab8e9[_0xdac0('0x12')]['message']);return _0x19c32b(_0x1ab8e9[_0xdac0('0x12')][_0xdac0('0x14')]);}else{logger[_0xdac0('0xc')]('FaxQueueReport,\x20%s,\x20%s',_0x116237,_0xdac0('0xe'));_0x19c32b(_0x1ab8e9[_0xdac0('0x15')][_0xdac0('0x14')]);}})[_0xdac0('0x16')](function(_0x3b2e99){logger['error'](_0xdac0('0xd'),_0x116237,_0x3b2e99);_0x45f68c(_0x3b2e99);});});}exports['CreateFaxQueueReport']=function(_0x468699){var _0x56f1dd=this;return new Promise(function(_0x3cb71f,_0x1e5eb7){return db['FaxQueueReport'][_0xdac0('0x17')](_0x468699['body'],{'raw':_0x468699['options']?_0x468699['options']['raw']===undefined?!![]:![]:!![]})[_0xdac0('0xb')](function(_0x5041bd){logger[_0xdac0('0xc')](_0xdac0('0x18'),_0x468699);logger[_0xdac0('0xf')](_0xdac0('0x18'),_0x468699,JSON['stringify'](_0x5041bd));_0x3cb71f(_0x5041bd);})['catch'](function(_0xcc959d){logger[_0xdac0('0x12')](_0xdac0('0x18'),_0xcc959d[_0xdac0('0x14')],_0x468699);_0x1e5eb7(_0x56f1dd[_0xdac0('0x12')](0x1f4,_0xcc959d[_0xdac0('0x14')]));});});};exports[_0xdac0('0x19')]=function(_0x303331){var _0x368cf8=this;return new Promise(function(_0x563298,_0xb69fc4){return db[_0xdac0('0x1a')][_0xdac0('0x1b')](_0x303331[_0xdac0('0x1c')],{'raw':_0x303331['options']?_0x303331[_0xdac0('0x1d')][_0xdac0('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x303331[_0xdac0('0x1d')]?_0x303331[_0xdac0('0x1d')][_0xdac0('0x1f')]||null:null,'attributes':_0x303331['options']?_0x303331['options']['attributes']||null:null,'limit':_0x303331[_0xdac0('0x1d')]?_0x303331[_0xdac0('0x1d')]['limit']||null:null})[_0xdac0('0xb')](function(_0x4584ef){logger[_0xdac0('0xc')](_0xdac0('0x19'),_0x303331);logger[_0xdac0('0xf')](_0xdac0('0x19'),_0x303331,JSON[_0xdac0('0x11')](_0x4584ef));_0x563298(_0x4584ef);})[_0xdac0('0x16')](function(_0x2856dc){logger[_0xdac0('0x12')]('UpdateFaxQueueReport',_0x2856dc['message'],_0x303331);_0xb69fc4(_0x368cf8['error'](0x1f4,_0x2856dc[_0xdac0('0x14')]));});});}; \ No newline at end of file +var _0xa262=['limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','CreateFaxQueueReport','FaxQueueReport','create','options','raw','stringify','UpdateFaxQueueReport','update','body','where','attributes'];(function(_0xb725be,_0x45bd01){var _0x2f2424=function(_0x2566ca){while(--_0x2566ca){_0xb725be['push'](_0xb725be['shift']());}};_0x2f2424(++_0x45bd01);}(_0xa262,0xb5));var _0x2a26=function(_0x13ced4,_0x3f90b8){_0x13ced4=_0x13ced4-0x0;var _0x5cdd8a=_0xa262[_0x13ced4];return _0x5cdd8a;};'use strict';var _=require(_0x2a26('0x0'));var util=require(_0x2a26('0x1'));var moment=require(_0x2a26('0x2'));var BPromise=require(_0x2a26('0x3'));var rs=require(_0x2a26('0x4'));var fs=require('fs');var Redis=require(_0x2a26('0x5'));var db=require(_0x2a26('0x6'))['db'];var utils=require(_0x2a26('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x2a26('0x8'));var jayson=require(_0x2a26('0x9'));var client=jayson[_0x2a26('0xa')][_0x2a26('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x449181,_0x2e5389,_0x11a3ff){return new BPromise(function(_0x322833,_0x1b8d5a){return client[_0x2a26('0xc')](_0x449181,_0x11a3ff)[_0x2a26('0xd')](function(_0x2c3ace){logger[_0x2a26('0xe')](_0x2a26('0xf'),_0x2e5389,_0x2a26('0x10'));logger[_0x2a26('0x11')](_0x2a26('0x12'),_0x2e5389,_0x2a26('0x10'),JSON['stringify'](_0x2c3ace));if(_0x2c3ace['error']){if(_0x2c3ace['error'][_0x2a26('0x13')]===0x1f4){logger['error'](_0x2a26('0xf'),_0x2e5389,_0x2c3ace[_0x2a26('0x14')][_0x2a26('0x15')]);return _0x1b8d5a(_0x2c3ace[_0x2a26('0x14')][_0x2a26('0x15')]);}logger[_0x2a26('0x14')](_0x2a26('0xf'),_0x2e5389,_0x2c3ace[_0x2a26('0x14')]['message']);return _0x322833(_0x2c3ace['error']['message']);}else{logger[_0x2a26('0xe')](_0x2a26('0xf'),_0x2e5389,_0x2a26('0x10'));_0x322833(_0x2c3ace[_0x2a26('0x16')][_0x2a26('0x15')]);}})[_0x2a26('0x17')](function(_0x2bbc64){logger[_0x2a26('0x14')](_0x2a26('0xf'),_0x2e5389,_0x2bbc64);_0x1b8d5a(_0x2bbc64);});});}exports[_0x2a26('0x18')]=function(_0x5e96a2){var _0x38bb7b=this;return new Promise(function(_0x180d4c,_0x4bb000){return db[_0x2a26('0x19')][_0x2a26('0x1a')](_0x5e96a2['body'],{'raw':_0x5e96a2['options']?_0x5e96a2[_0x2a26('0x1b')][_0x2a26('0x1c')]===undefined?!![]:![]:!![]})[_0x2a26('0xd')](function(_0x364ad9){logger[_0x2a26('0xe')](_0x2a26('0x18'),_0x5e96a2);logger[_0x2a26('0x11')](_0x2a26('0x18'),_0x5e96a2,JSON[_0x2a26('0x1d')](_0x364ad9));_0x180d4c(_0x364ad9);})[_0x2a26('0x17')](function(_0x54459d){logger[_0x2a26('0x14')](_0x2a26('0x18'),_0x54459d[_0x2a26('0x15')],_0x5e96a2);_0x4bb000(_0x38bb7b[_0x2a26('0x14')](0x1f4,_0x54459d[_0x2a26('0x15')]));});});};exports[_0x2a26('0x1e')]=function(_0x20f224){var _0x3153ee=this;return new Promise(function(_0x31afc8,_0x586138){return db[_0x2a26('0x19')][_0x2a26('0x1f')](_0x20f224[_0x2a26('0x20')],{'raw':_0x20f224[_0x2a26('0x1b')]?_0x20f224['options'][_0x2a26('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x20f224[_0x2a26('0x1b')]?_0x20f224[_0x2a26('0x1b')][_0x2a26('0x21')]||null:null,'attributes':_0x20f224[_0x2a26('0x1b')]?_0x20f224[_0x2a26('0x1b')][_0x2a26('0x22')]||null:null,'limit':_0x20f224['options']?_0x20f224[_0x2a26('0x1b')][_0x2a26('0x23')]||null:null})[_0x2a26('0xd')](function(_0x3d62f5){logger[_0x2a26('0xe')](_0x2a26('0x1e'),_0x20f224);logger[_0x2a26('0x11')](_0x2a26('0x1e'),_0x20f224,JSON[_0x2a26('0x1d')](_0x3d62f5));_0x31afc8(_0x3d62f5);})[_0x2a26('0x17')](function(_0x50fc93){logger[_0x2a26('0x14')](_0x2a26('0x1e'),_0x50fc93[_0x2a26('0x15')],_0x20f224);_0x586138(_0x3153ee[_0x2a26('0x14')](0x1f4,_0x50fc93[_0x2a26('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index a6c438a..e08f930 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 _0xa8fe=['exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','post','create','put','update','delete','destroy'];(function(_0x2113fc,_0x3b1683){var _0xe9ec6c=function(_0x5a15b2){while(--_0x5a15b2){_0x2113fc['push'](_0x2113fc['shift']());}};_0xe9ec6c(++_0x3b1683);}(_0xa8fe,0x1a5));var _0xea8f=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xa8fe[_0x57b54c];return _0x59cc19;};'use strict';var multer=require(_0xea8f('0x0'));var util=require(_0xea8f('0x1'));var path=require(_0xea8f('0x2'));var timeout=require('connect-timeout');var express=require(_0xea8f('0x3'));var router=express['Router']();var auth=require(_0xea8f('0x4'));var interaction=require(_0xea8f('0x5'));var config=require(_0xea8f('0x6'));var controller=require(_0xea8f('0x7'));router[_0xea8f('0x8')]('/',auth[_0xea8f('0x9')](),controller['index']);router[_0xea8f('0x8')](_0xea8f('0xa'),auth[_0xea8f('0x9')](),controller[_0xea8f('0xb')]);router[_0xea8f('0x8')](_0xea8f('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xea8f('0xd')]('/',auth[_0xea8f('0x9')](),controller[_0xea8f('0xe')]);router[_0xea8f('0xf')](_0xea8f('0xc'),auth[_0xea8f('0x9')](),controller[_0xea8f('0x10')]);router[_0xea8f('0x11')](_0xea8f('0xc'),auth[_0xea8f('0x9')](),controller[_0xea8f('0x12')]);module[_0xea8f('0x13')]=router; \ No newline at end of file +var _0x11f6=['connect-timeout','express','../../components/auth/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','/describe','describe','post','put','/:id','update','destroy','exports','multer','util','path'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0x11f6,0x7b));var _0x611f=function(_0x398dda,_0xdbcec6){_0x398dda=_0x398dda-0x0;var _0x2a48ea=_0x11f6[_0x398dda];return _0x2a48ea;};'use strict';var multer=require(_0x611f('0x0'));var util=require(_0x611f('0x1'));var path=require(_0x611f('0x2'));var timeout=require(_0x611f('0x3'));var express=require(_0x611f('0x4'));var router=express['Router']();var auth=require(_0x611f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x611f('0x6'));var controller=require(_0x611f('0x7'));router[_0x611f('0x8')]('/',auth[_0x611f('0x9')](),controller['index']);router[_0x611f('0x8')](_0x611f('0xa'),auth[_0x611f('0x9')](),controller[_0x611f('0xb')]);router[_0x611f('0x8')]('/:id',auth[_0x611f('0x9')](),controller['show']);router[_0x611f('0xc')]('/',auth[_0x611f('0x9')](),controller['create']);router[_0x611f('0xd')](_0x611f('0xe'),auth[_0x611f('0x9')](),controller[_0x611f('0xf')]);router['delete'](_0x611f('0xe'),auth[_0x611f('0x9')](),controller[_0x611f('0x10')]);module[_0x611f('0x11')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 97e0cbb..e51d701 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 _0x0453=['queue','DATE','NOW','sequelize','exports','STRING','ENUM','account','agent'];(function(_0x4dbc35,_0x4056d4){var _0x1f2c1c=function(_0x1e97c8){while(--_0x1e97c8){_0x4dbc35['push'](_0x4dbc35['shift']());}};_0x1f2c1c(++_0x4056d4);}(_0x0453,0x1aa));var _0x3045=function(_0x50181e,_0x435a51){_0x50181e=_0x50181e-0x0;var _0x15c38c=_0x0453[_0x50181e];return _0x15c38c;};'use strict';var moment=require('moment');var Sequelize=require(_0x3045('0x0'));module[_0x3045('0x1')]={'uniqueid':{'type':Sequelize[_0x3045('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x3045('0x3')](_0x3045('0x4'),_0x3045('0x5'),_0x3045('0x6')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0x3045('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x3045('0x8')]}}; \ No newline at end of file +var _0x25e7=['moment','sequelize','exports','ENUM','account','agent','queue','NOW'];(function(_0x21bfab,_0x2fee48){var _0x4db318=function(_0x10396d){while(--_0x10396d){_0x21bfab['push'](_0x21bfab['shift']());}};_0x4db318(++_0x2fee48);}(_0x25e7,0x170));var _0x725e=function(_0x4c974e,_0x513d9e){_0x4c974e=_0x4c974e-0x0;var _0x31327b=_0x25e7[_0x4c974e];return _0x31327b;};'use strict';var moment=require(_0x725e('0x0'));var Sequelize=require(_0x725e('0x1'));module[_0x725e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x725e('0x3')](_0x725e('0x4'),_0x725e('0x5'),'queue'),'allowNull':![],'defaultValue':_0x725e('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x725e('0x7')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index d705460..03ea164 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 _0x78f4=['intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','field','options','count','includeAll','include','findAll','catch','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','ejs','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','FaxTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters'];(function(_0x37cc97,_0x4126b4){var _0x35b343=function(_0x4af142){while(--_0x4af142){_0x37cc97['push'](_0x37cc97['shift']());}};_0x35b343(++_0x4126b4);}(_0x78f4,0x1c8));var _0x478f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x78f4[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x478f('0x0'));var rimraf=require(_0x478f('0x1'));var zipdir=require(_0x478f('0x2'));var jsonpatch=require(_0x478f('0x3'));var rp=require('request-promise');var moment=require(_0x478f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x478f('0x5'));var util=require(_0x478f('0x6'));var path=require(_0x478f('0x7'));var sox=require('sox');var csv=require(_0x478f('0x8'));var ejs=require(_0x478f('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x478f('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x478f('0xb'));var toCsv=require('to-csv');var querystring=require(_0x478f('0xc'));var Papa=require(_0x478f('0xd'));var Redis=require(_0x478f('0xe'));var authService=require(_0x478f('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x478f('0x10'));var logger=require(_0x478f('0x11'))(_0x478f('0x12'));var utils=require(_0x478f('0x13'));var config=require(_0x478f('0x14'));var db=require(_0x478f('0x15'))['db'];function respondWithStatusCode(_0x3ab8c2,_0x3c91d0){_0x3c91d0=_0x3c91d0||0xcc;return function(_0x551169){if(_0x551169){return _0x3ab8c2[_0x478f('0x16')](_0x3c91d0);}return _0x3ab8c2[_0x478f('0x17')](_0x3c91d0)[_0x478f('0x18')]();};}function respondWithResult(_0x4178c0,_0x165dfd){_0x165dfd=_0x165dfd||0xc8;return function(_0xbcfcb4){if(_0xbcfcb4){return _0x4178c0[_0x478f('0x17')](_0x165dfd)[_0x478f('0x19')](_0xbcfcb4);}};}function respondWithFilteredResult(_0x5acee6,_0x3de264){return function(_0x1c8990){if(_0x1c8990){var _0x36e13a=_0x1c8990['count'],_0x2f1266=_0x3de264[_0x478f('0x1a')],_0x528142=_0x3de264[_0x478f('0x1a')]+_0x3de264['limit'],_0x10e21d;if(_0x528142>=_0x36e13a){_0x528142=_0x36e13a;_0x10e21d=0xc8;}else{_0x10e21d=0xce;}_0x5acee6[_0x478f('0x17')](_0x10e21d);return _0x5acee6['set'](_0x478f('0x1b'),_0x2f1266+'-'+_0x528142+'/'+_0x36e13a)[_0x478f('0x19')](_0x1c8990);}return null;};}function patchUpdates(_0x181d9d){return function(_0x23b455){try{jsonpatch[_0x478f('0x1c')](_0x23b455,_0x181d9d,!![]);}catch(_0xae9063){return BPromise[_0x478f('0x1d')](_0xae9063);}return _0x23b455[_0x478f('0x1e')]();};}function saveUpdates(_0x384dfc,_0x341cd0){return function(_0x47160a){if(_0x47160a){return _0x47160a[_0x478f('0x1f')](_0x384dfc)[_0x478f('0x20')](function(_0x4ad190){return _0x4ad190;});}return null;};}function removeEntity(_0x185706,_0x32b512){return function(_0x424427){if(_0x424427){return _0x424427[_0x478f('0x21')]()[_0x478f('0x20')](function(){_0x185706[_0x478f('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a8ebc,_0x3934b4){return function(_0x4cd51d){if(!_0x4cd51d){_0x4a8ebc[_0x478f('0x16')](0x194);}return _0x4cd51d;};}function handleError(_0x2810a4,_0x333f12){_0x333f12=_0x333f12||0x1f4;return function(_0x44e0d0){logger[_0x478f('0x22')](_0x44e0d0[_0x478f('0x23')]);if(_0x44e0d0['name']){delete _0x44e0d0[_0x478f('0x24')];}_0x2810a4[_0x478f('0x17')](_0x333f12)['send'](_0x44e0d0);};}exports[_0x478f('0x25')]=function(_0x49cb67,_0x101952){var _0x591e00={},_0xe8fc1e={},_0x29ecdb={'count':0x0,'rows':[]};var _0x369cbd=_[_0x478f('0x26')](db[_0x478f('0x27')][_0x478f('0x28')],function(_0x4e48cd){return{'name':_0x4e48cd[_0x478f('0x29')],'type':_0x4e48cd[_0x478f('0x2a')][_0x478f('0x2b')]};});_0xe8fc1e[_0x478f('0x2c')]=_[_0x478f('0x26')](_0x369cbd,_0x478f('0x24'));_0xe8fc1e[_0x478f('0x2d')]=_[_0x478f('0x2e')](_0x49cb67[_0x478f('0x2d')]);_0xe8fc1e[_0x478f('0x2f')]=_[_0x478f('0x30')](_0xe8fc1e['model'],_0xe8fc1e[_0x478f('0x2d')]);_0x591e00[_0x478f('0x31')]=_['intersection'](_0xe8fc1e[_0x478f('0x2c')],qs[_0x478f('0x32')](_0x49cb67[_0x478f('0x2d')][_0x478f('0x32')]));_0x591e00[_0x478f('0x31')]=_0x591e00[_0x478f('0x31')]['length']?_0x591e00[_0x478f('0x31')]:_0xe8fc1e[_0x478f('0x2c')];if(!_0x49cb67[_0x478f('0x2d')][_0x478f('0x33')](_0x478f('0x34'))){_0x591e00[_0x478f('0x35')]=qs[_0x478f('0x35')](_0x49cb67['query'][_0x478f('0x35')]);_0x591e00[_0x478f('0x1a')]=qs[_0x478f('0x1a')](_0x49cb67[_0x478f('0x2d')][_0x478f('0x1a')]);}_0x591e00[_0x478f('0x36')]=qs[_0x478f('0x37')](_0x49cb67[_0x478f('0x2d')]['sort']);_0x591e00[_0x478f('0x38')]=qs[_0x478f('0x2f')](_['pick'](_0x49cb67[_0x478f('0x2d')],_0xe8fc1e['filters']));if(_0x49cb67[_0x478f('0x2d')][_0x478f('0x39')]){_0x591e00['where']=_[_0x478f('0x3a')](_0x591e00[_0x478f('0x38')],{'$or':_[_0x478f('0x26')](_0x369cbd,function(_0x4ca471){if(_0x4ca471['type'][_0x478f('0x2b')]!==_0x478f('0x3b')){var _0x2db2d5={};_0x2db2d5[_0x4ca471[_0x478f('0x3c')]]={'$like':'%'+_0x49cb67[_0x478f('0x2d')]['filter']+'%'};return _0x2db2d5;}})});}_0x591e00=_['merge']({},_0x591e00,_0x49cb67[_0x478f('0x3d')]);var _0x3a90ab={'where':_0x591e00['where']};return db['FaxTransferReport'][_0x478f('0x3e')](_0x3a90ab)[_0x478f('0x20')](function(_0x838a8a){_0x29ecdb[_0x478f('0x3e')]=_0x838a8a;if(_0x49cb67[_0x478f('0x2d')][_0x478f('0x3f')]){_0x591e00[_0x478f('0x40')]=[{'all':!![]}];}return db[_0x478f('0x27')][_0x478f('0x41')](_0x591e00);})[_0x478f('0x20')](function(_0x185413){_0x29ecdb['rows']=_0x185413;return _0x29ecdb;})[_0x478f('0x20')](respondWithFilteredResult(_0x101952,_0x591e00))[_0x478f('0x42')](handleError(_0x101952,null));};exports['show']=function(_0x5029d6,_0x39c3ce){var _0x3b0a00={'raw':!![],'where':{'id':_0x5029d6[_0x478f('0x43')]['id']}},_0x21c13d={};_0x21c13d[_0x478f('0x2c')]=_['keys'](db[_0x478f('0x27')][_0x478f('0x28')]);_0x21c13d[_0x478f('0x2d')]=_[_0x478f('0x2e')](_0x5029d6[_0x478f('0x2d')]);_0x21c13d[_0x478f('0x2f')]=_['intersection'](_0x21c13d['model'],_0x21c13d[_0x478f('0x2d')]);_0x3b0a00[_0x478f('0x31')]=_[_0x478f('0x30')](_0x21c13d[_0x478f('0x2c')],qs[_0x478f('0x32')](_0x5029d6['query']['fields']));_0x3b0a00['attributes']=_0x3b0a00[_0x478f('0x31')]['length']?_0x3b0a00[_0x478f('0x31')]:_0x21c13d[_0x478f('0x2c')];if(_0x5029d6[_0x478f('0x2d')][_0x478f('0x3f')]){_0x3b0a00[_0x478f('0x40')]=[{'all':!![]}];}_0x3b0a00=_['merge']({},_0x3b0a00,_0x5029d6[_0x478f('0x3d')]);return db[_0x478f('0x27')][_0x478f('0x44')](_0x3b0a00)[_0x478f('0x20')](handleEntityNotFound(_0x39c3ce,null))['then'](respondWithResult(_0x39c3ce,null))[_0x478f('0x42')](handleError(_0x39c3ce,null));};exports[_0x478f('0x45')]=function(_0x388091,_0x4c6df3){return db['FaxTransferReport'][_0x478f('0x45')](_0x388091[_0x478f('0x46')],{})[_0x478f('0x20')](respondWithResult(_0x4c6df3,0xc9))[_0x478f('0x42')](handleError(_0x4c6df3,null));};exports[_0x478f('0x1f')]=function(_0x5cb7fc,_0x5769b1){if(_0x5cb7fc[_0x478f('0x46')]['id']){delete _0x5cb7fc[_0x478f('0x46')]['id'];}return db['FaxTransferReport'][_0x478f('0x44')]({'where':{'id':_0x5cb7fc[_0x478f('0x43')]['id']}})[_0x478f('0x20')](handleEntityNotFound(_0x5769b1,null))[_0x478f('0x20')](saveUpdates(_0x5cb7fc[_0x478f('0x46')],null))[_0x478f('0x20')](respondWithResult(_0x5769b1,null))[_0x478f('0x42')](handleError(_0x5769b1,null));};exports[_0x478f('0x21')]=function(_0x249d01,_0x2bcd44){return db[_0x478f('0x27')][_0x478f('0x44')]({'where':{'id':_0x249d01['params']['id']}})[_0x478f('0x20')](handleEntityNotFound(_0x2bcd44,null))[_0x478f('0x20')](removeEntity(_0x2bcd44,null))['catch'](handleError(_0x2bcd44,null));};exports[_0x478f('0x47')]=function(_0x2db50b,_0x1773e9){return db[_0x478f('0x27')]['describe']()[_0x478f('0x20')](respondWithResult(_0x1773e9,null))[_0x478f('0x42')](handleError(_0x1773e9,null));}; \ No newline at end of file +var _0xc359=['sort','where','pick','filter','merge','VIRTUAL','field','options','includeAll','rows','catch','params','keys','rawAttributes','include','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','reject','save','update','destroy','then','stack','send','index','map','FaxTransferReport','fieldName','key','model','name','query','filters','intersection','attributes','fields','length','order'];(function(_0xd0e798,_0x2c007c){var _0x1e5001=function(_0x378802){while(--_0x378802){_0xd0e798['push'](_0xd0e798['shift']());}};_0x1e5001(++_0x2c007c);}(_0xc359,0x1d9));var _0x9c35=function(_0x4f3c9b,_0x28e078){_0x4f3c9b=_0x4f3c9b-0x0;var _0x84e58a=_0xc359[_0x4f3c9b];return _0x84e58a;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9c35('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9c35('0x1'));var jsonpatch=require(_0x9c35('0x2'));var rp=require(_0x9c35('0x3'));var moment=require('moment');var BPromise=require(_0x9c35('0x4'));var Mustache=require('mustache');var util=require(_0x9c35('0x5'));var path=require('path');var sox=require(_0x9c35('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x9c35('0x7'));var jsforce=require(_0x9c35('0x8'));var deskjs=require(_0x9c35('0x9'));var toCsv=require(_0x9c35('0xa'));var querystring=require(_0x9c35('0xb'));var Papa=require(_0x9c35('0xc'));var Redis=require('ioredis');var authService=require(_0x9c35('0xd'));var qs=require(_0x9c35('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9c35('0xf'));var utils=require('../../config/utils');var config=require(_0x9c35('0x10'));var db=require(_0x9c35('0x11'))['db'];function respondWithStatusCode(_0x5883a8,_0x575589){_0x575589=_0x575589||0xcc;return function(_0x24210f){if(_0x24210f){return _0x5883a8[_0x9c35('0x12')](_0x575589);}return _0x5883a8[_0x9c35('0x13')](_0x575589)[_0x9c35('0x14')]();};}function respondWithResult(_0x836808,_0x4cc2ca){_0x4cc2ca=_0x4cc2ca||0xc8;return function(_0x280758){if(_0x280758){return _0x836808[_0x9c35('0x13')](_0x4cc2ca)[_0x9c35('0x15')](_0x280758);}};}function respondWithFilteredResult(_0x4150cd,_0x2af21e){return function(_0x308392){if(_0x308392){var _0x9e7d2d=_0x308392[_0x9c35('0x16')],_0x77588e=_0x2af21e[_0x9c35('0x17')],_0x34b72d=_0x2af21e[_0x9c35('0x17')]+_0x2af21e[_0x9c35('0x18')],_0x2b2c2b;if(_0x34b72d>=_0x9e7d2d){_0x34b72d=_0x9e7d2d;_0x2b2c2b=0xc8;}else{_0x2b2c2b=0xce;}_0x4150cd[_0x9c35('0x13')](_0x2b2c2b);return _0x4150cd['set'](_0x9c35('0x19'),_0x77588e+'-'+_0x34b72d+'/'+_0x9e7d2d)[_0x9c35('0x15')](_0x308392);}return null;};}function patchUpdates(_0x26911d){return function(_0x24f1d9){try{jsonpatch['apply'](_0x24f1d9,_0x26911d,!![]);}catch(_0x142091){return BPromise[_0x9c35('0x1a')](_0x142091);}return _0x24f1d9[_0x9c35('0x1b')]();};}function saveUpdates(_0x50d7b8,_0x69d118){return function(_0x4a84dd){if(_0x4a84dd){return _0x4a84dd[_0x9c35('0x1c')](_0x50d7b8)['then'](function(_0x41aee8){return _0x41aee8;});}return null;};}function removeEntity(_0x421979,_0x29f569){return function(_0x8ffae5){if(_0x8ffae5){return _0x8ffae5[_0x9c35('0x1d')]()[_0x9c35('0x1e')](function(){_0x421979[_0x9c35('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x572b46,_0x1bc7e4){return function(_0x2997d3){if(!_0x2997d3){_0x572b46[_0x9c35('0x12')](0x194);}return _0x2997d3;};}function handleError(_0x27d74c,_0x50a509){_0x50a509=_0x50a509||0x1f4;return function(_0x233364){logger['error'](_0x233364[_0x9c35('0x1f')]);if(_0x233364['name']){delete _0x233364['name'];}_0x27d74c[_0x9c35('0x13')](_0x50a509)[_0x9c35('0x20')](_0x233364);};}exports[_0x9c35('0x21')]=function(_0x4df6bc,_0x3bfdfd){var _0x55cd82={},_0x16cc31={},_0x2a0954={'count':0x0,'rows':[]};var _0x462f00=_[_0x9c35('0x22')](db[_0x9c35('0x23')]['rawAttributes'],function(_0x4593e3){return{'name':_0x4593e3[_0x9c35('0x24')],'type':_0x4593e3['type'][_0x9c35('0x25')]};});_0x16cc31[_0x9c35('0x26')]=_[_0x9c35('0x22')](_0x462f00,_0x9c35('0x27'));_0x16cc31[_0x9c35('0x28')]=_['keys'](_0x4df6bc[_0x9c35('0x28')]);_0x16cc31[_0x9c35('0x29')]=_[_0x9c35('0x2a')](_0x16cc31[_0x9c35('0x26')],_0x16cc31[_0x9c35('0x28')]);_0x55cd82[_0x9c35('0x2b')]=_['intersection'](_0x16cc31[_0x9c35('0x26')],qs['fields'](_0x4df6bc[_0x9c35('0x28')][_0x9c35('0x2c')]));_0x55cd82[_0x9c35('0x2b')]=_0x55cd82[_0x9c35('0x2b')][_0x9c35('0x2d')]?_0x55cd82['attributes']:_0x16cc31[_0x9c35('0x26')];if(!_0x4df6bc[_0x9c35('0x28')]['hasOwnProperty']('nolimit')){_0x55cd82[_0x9c35('0x18')]=qs['limit'](_0x4df6bc['query']['limit']);_0x55cd82[_0x9c35('0x17')]=qs[_0x9c35('0x17')](_0x4df6bc[_0x9c35('0x28')][_0x9c35('0x17')]);}_0x55cd82[_0x9c35('0x2e')]=qs[_0x9c35('0x2f')](_0x4df6bc['query'][_0x9c35('0x2f')]);_0x55cd82[_0x9c35('0x30')]=qs[_0x9c35('0x29')](_[_0x9c35('0x31')](_0x4df6bc['query'],_0x16cc31[_0x9c35('0x29')]));if(_0x4df6bc[_0x9c35('0x28')][_0x9c35('0x32')]){_0x55cd82[_0x9c35('0x30')]=_[_0x9c35('0x33')](_0x55cd82[_0x9c35('0x30')],{'$or':_[_0x9c35('0x22')](_0x462f00,function(_0x5628e7){if(_0x5628e7['type']['key']!==_0x9c35('0x34')){var _0x4db802={};_0x4db802[_0x5628e7[_0x9c35('0x35')]]={'$like':'%'+_0x4df6bc['query']['filter']+'%'};return _0x4db802;}})});}_0x55cd82=_[_0x9c35('0x33')]({},_0x55cd82,_0x4df6bc[_0x9c35('0x36')]);var _0x20f06e={'where':_0x55cd82[_0x9c35('0x30')]};return db[_0x9c35('0x23')][_0x9c35('0x16')](_0x20f06e)[_0x9c35('0x1e')](function(_0x4a2002){_0x2a0954[_0x9c35('0x16')]=_0x4a2002;if(_0x4df6bc['query'][_0x9c35('0x37')]){_0x55cd82['include']=[{'all':!![]}];}return db['FaxTransferReport']['findAll'](_0x55cd82);})['then'](function(_0x35e4e3){_0x2a0954[_0x9c35('0x38')]=_0x35e4e3;return _0x2a0954;})[_0x9c35('0x1e')](respondWithFilteredResult(_0x3bfdfd,_0x55cd82))[_0x9c35('0x39')](handleError(_0x3bfdfd,null));};exports['show']=function(_0x2aaef4,_0xff952f){var _0x35cf5a={'raw':!![],'where':{'id':_0x2aaef4[_0x9c35('0x3a')]['id']}},_0x481eef={};_0x481eef[_0x9c35('0x26')]=_[_0x9c35('0x3b')](db[_0x9c35('0x23')][_0x9c35('0x3c')]);_0x481eef[_0x9c35('0x28')]=_[_0x9c35('0x3b')](_0x2aaef4[_0x9c35('0x28')]);_0x481eef[_0x9c35('0x29')]=_[_0x9c35('0x2a')](_0x481eef[_0x9c35('0x26')],_0x481eef['query']);_0x35cf5a[_0x9c35('0x2b')]=_[_0x9c35('0x2a')](_0x481eef[_0x9c35('0x26')],qs[_0x9c35('0x2c')](_0x2aaef4[_0x9c35('0x28')][_0x9c35('0x2c')]));_0x35cf5a[_0x9c35('0x2b')]=_0x35cf5a[_0x9c35('0x2b')][_0x9c35('0x2d')]?_0x35cf5a[_0x9c35('0x2b')]:_0x481eef[_0x9c35('0x26')];if(_0x2aaef4[_0x9c35('0x28')][_0x9c35('0x37')]){_0x35cf5a[_0x9c35('0x3d')]=[{'all':!![]}];}_0x35cf5a=_[_0x9c35('0x33')]({},_0x35cf5a,_0x2aaef4[_0x9c35('0x36')]);return db[_0x9c35('0x23')][_0x9c35('0x3e')](_0x35cf5a)[_0x9c35('0x1e')](handleEntityNotFound(_0xff952f,null))[_0x9c35('0x1e')](respondWithResult(_0xff952f,null))[_0x9c35('0x39')](handleError(_0xff952f,null));};exports[_0x9c35('0x3f')]=function(_0x5ca172,_0x23afc2){return db['FaxTransferReport'][_0x9c35('0x3f')](_0x5ca172[_0x9c35('0x40')],{})[_0x9c35('0x1e')](respondWithResult(_0x23afc2,0xc9))['catch'](handleError(_0x23afc2,null));};exports[_0x9c35('0x1c')]=function(_0x1d24ae,_0xee48bd){if(_0x1d24ae['body']['id']){delete _0x1d24ae[_0x9c35('0x40')]['id'];}return db[_0x9c35('0x23')]['find']({'where':{'id':_0x1d24ae[_0x9c35('0x3a')]['id']}})['then'](handleEntityNotFound(_0xee48bd,null))[_0x9c35('0x1e')](saveUpdates(_0x1d24ae[_0x9c35('0x40')],null))[_0x9c35('0x1e')](respondWithResult(_0xee48bd,null))[_0x9c35('0x39')](handleError(_0xee48bd,null));};exports[_0x9c35('0x1d')]=function(_0x26d7f7,_0x3b5efc){return db[_0x9c35('0x23')][_0x9c35('0x3e')]({'where':{'id':_0x26d7f7['params']['id']}})[_0x9c35('0x1e')](handleEntityNotFound(_0x3b5efc,null))[_0x9c35('0x1e')](removeEntity(_0x3b5efc,null))[_0x9c35('0x39')](handleError(_0x3b5efc,null));};exports['describe']=function(_0x5e4096,_0x35f34b){return db[_0x9c35('0x23')]['describe']()[_0x9c35('0x1e')](respondWithResult(_0x35f34b,null))[_0x9c35('0x39')](handleError(_0x35f34b,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 8b19367..9682593 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 _0x51a3=['rimraf','../../config/environment','./faxTransferReport.attributes','exports','define','uniqueid','api','moment','bluebird','request-promise'];(function(_0x32b62e,_0x422213){var _0x967254=function(_0x25dfaa){while(--_0x25dfaa){_0x32b62e['push'](_0x32b62e['shift']());}};_0x967254(++_0x422213);}(_0x51a3,0x114));var _0x351a=function(_0x29a500,_0x48e008){_0x29a500=_0x29a500-0x0;var _0x1870cb=_0x51a3[_0x29a500];return _0x1870cb;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x351a('0x0'));var moment=require(_0x351a('0x1'));var BPromise=require(_0x351a('0x2'));var rp=require(_0x351a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x351a('0x4'));var config=require(_0x351a('0x5'));var attributes=require(_0x351a('0x6'));module[_0x351a('0x7')]=function(_0x14b0e8,_0x192338){return _0x14b0e8[_0x351a('0x8')]('FaxTransferReport',attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0x351a('0x9'),'fields':[_0x351a('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8ea9=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','uniqueid','util'];(function(_0x5bd4f6,_0xf4e45c){var _0x33a165=function(_0x37eef6){while(--_0x37eef6){_0x5bd4f6['push'](_0x5bd4f6['shift']());}};_0x33a165(++_0xf4e45c);}(_0x8ea9,0x1a3));var _0x98ea=function(_0x21231f,_0x5c6cec){_0x21231f=_0x21231f-0x0;var _0xde930e=_0x8ea9[_0x21231f];return _0xde930e;};'use strict';var _=require('lodash');var util=require(_0x98ea('0x0'));var logger=require(_0x98ea('0x1'))(_0x98ea('0x2'));var moment=require('moment');var BPromise=require(_0x98ea('0x3'));var rp=require(_0x98ea('0x4'));var fs=require('fs');var path=require(_0x98ea('0x5'));var rimraf=require(_0x98ea('0x6'));var config=require(_0x98ea('0x7'));var attributes=require('./faxTransferReport.attributes');module[_0x98ea('0x8')]=function(_0x87d883,_0xb96dec){return _0x87d883['define']('FaxTransferReport',attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0x98ea('0x9'),'fields':[_0x98ea('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 71db41c..6ab16b9 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 _0x338a=['debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x2b54ea,_0x603ac5){var _0xbf41d2=function(_0x3b8ffd){while(--_0x3b8ffd){_0x2b54ea['push'](_0x2b54ea['shift']());}};_0xbf41d2(++_0x603ac5);}(_0x338a,0x105));var _0xa338=function(_0x257d48,_0x470afc){_0x257d48=_0x257d48-0x0;var _0x577f53=_0x338a[_0x257d48];return _0x577f53;};'use strict';var _=require(_0xa338('0x0'));var util=require(_0xa338('0x1'));var moment=require(_0xa338('0x2'));var BPromise=require('bluebird');var rs=require(_0xa338('0x3'));var fs=require('fs');var Redis=require(_0xa338('0x4'));var db=require(_0xa338('0x5'))['db'];var utils=require(_0xa338('0x6'));var logger=require('../../config/logger')(_0xa338('0x7'));var config=require(_0xa338('0x8'));var jayson=require(_0xa338('0x9'));var client=jayson['client'][_0xa338('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5f151f,_0xb29a17,_0x3f09c3){return new BPromise(function(_0x334232,_0x51e6ad){return client[_0xa338('0xb')](_0x5f151f,_0x3f09c3)['then'](function(_0x32f9fb){logger[_0xa338('0xc')](_0xa338('0xd'),_0xb29a17,_0xa338('0xe'));logger[_0xa338('0xf')](_0xa338('0x10'),_0xb29a17,_0xa338('0xe'),JSON[_0xa338('0x11')](_0x32f9fb));if(_0x32f9fb[_0xa338('0x12')]){if(_0x32f9fb[_0xa338('0x12')][_0xa338('0x13')]===0x1f4){logger['error'](_0xa338('0xd'),_0xb29a17,_0x32f9fb[_0xa338('0x12')]['message']);return _0x51e6ad(_0x32f9fb[_0xa338('0x12')][_0xa338('0x14')]);}logger[_0xa338('0x12')](_0xa338('0xd'),_0xb29a17,_0x32f9fb[_0xa338('0x12')]['message']);return _0x334232(_0x32f9fb[_0xa338('0x12')][_0xa338('0x14')]);}else{logger[_0xa338('0xc')]('FaxTransferReport,\x20%s,\x20%s',_0xb29a17,_0xa338('0xe'));_0x334232(_0x32f9fb[_0xa338('0x15')][_0xa338('0x14')]);}})[_0xa338('0x16')](function(_0x4af2f1){logger[_0xa338('0x12')](_0xa338('0xd'),_0xb29a17,_0x4af2f1);_0x51e6ad(_0x4af2f1);});});} \ No newline at end of file +var _0x1ff6=['code','message','result','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x6059ed,_0x8ea3d2){var _0x5824ff=function(_0x18430d){while(--_0x18430d){_0x6059ed['push'](_0x6059ed['shift']());}};_0x5824ff(++_0x8ea3d2);}(_0x1ff6,0x71));var _0x61ff=function(_0x290201,_0x279632){_0x290201=_0x290201-0x0;var _0x3d5c08=_0x1ff6[_0x290201];return _0x3d5c08;};'use strict';var _=require(_0x61ff('0x0'));var util=require('util');var moment=require(_0x61ff('0x1'));var BPromise=require(_0x61ff('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x61ff('0x3'))['db'];var utils=require(_0x61ff('0x4'));var logger=require(_0x61ff('0x5'))(_0x61ff('0x6'));var config=require(_0x61ff('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x61ff('0x8')][_0x61ff('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3ff398,_0x321efe,_0x59e17f){return new BPromise(function(_0x1e238d,_0x3166c2){return client[_0x61ff('0xa')](_0x3ff398,_0x59e17f)[_0x61ff('0xb')](function(_0x29f0b4){logger[_0x61ff('0xc')](_0x61ff('0xd'),_0x321efe,_0x61ff('0xe'));logger[_0x61ff('0xf')](_0x61ff('0x10'),_0x321efe,'request\x20sent',JSON[_0x61ff('0x11')](_0x29f0b4));if(_0x29f0b4[_0x61ff('0x12')]){if(_0x29f0b4[_0x61ff('0x12')][_0x61ff('0x13')]===0x1f4){logger['error']('FaxTransferReport,\x20%s,\x20%s',_0x321efe,_0x29f0b4['error'][_0x61ff('0x14')]);return _0x3166c2(_0x29f0b4[_0x61ff('0x12')][_0x61ff('0x14')]);}logger[_0x61ff('0x12')](_0x61ff('0xd'),_0x321efe,_0x29f0b4[_0x61ff('0x12')][_0x61ff('0x14')]);return _0x1e238d(_0x29f0b4[_0x61ff('0x12')][_0x61ff('0x14')]);}else{logger[_0x61ff('0xc')](_0x61ff('0xd'),_0x321efe,_0x61ff('0xe'));_0x1e238d(_0x29f0b4[_0x61ff('0x15')][_0x61ff('0x14')]);}})['catch'](function(_0x242121){logger[_0x61ff('0x12')]('FaxTransferReport,\x20%s,\x20%s',_0x321efe,_0x242121);_0x3166c2(_0x242121);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index eb50395..5989adc 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 _0xcb54=['isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','destroy','exports','multer','util','Router','../../components/auth/service','../../config/environment','./faxTransferReport.controller','get'];(function(_0x4a42c9,_0x1ec939){var _0x4f21ec=function(_0x953a53){while(--_0x953a53){_0x4a42c9['push'](_0x4a42c9['shift']());}};_0x4f21ec(++_0x1ec939);}(_0xcb54,0x162));var _0x4cb5=function(_0x1bb8d1,_0x48b94d){_0x1bb8d1=_0x1bb8d1-0x0;var _0x4f775e=_0xcb54[_0x1bb8d1];return _0x4f775e;};'use strict';var multer=require(_0x4cb5('0x0'));var util=require(_0x4cb5('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4cb5('0x2')]();var auth=require(_0x4cb5('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x4cb5('0x4'));var controller=require(_0x4cb5('0x5'));router[_0x4cb5('0x6')]('/',auth[_0x4cb5('0x7')](),controller[_0x4cb5('0x8')]);router[_0x4cb5('0x6')](_0x4cb5('0x9'),auth[_0x4cb5('0x7')](),controller[_0x4cb5('0xa')]);router[_0x4cb5('0x6')](_0x4cb5('0xb'),auth[_0x4cb5('0x7')](),controller[_0x4cb5('0xc')]);router[_0x4cb5('0xd')]('/',auth[_0x4cb5('0x7')](),controller[_0x4cb5('0xe')]);router['put'](_0x4cb5('0xb'),auth[_0x4cb5('0x7')](),controller[_0x4cb5('0xf')]);router[_0x4cb5('0x10')](_0x4cb5('0xb'),auth[_0x4cb5('0x7')](),controller[_0x4cb5('0x11')]);module[_0x4cb5('0x12')]=router; \ No newline at end of file +var _0xbbc1=['delete','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','index','/describe','describe','isAuthenticated','post','create','put','/:id'];(function(_0x59de79,_0x34ce25){var _0x3dffcc=function(_0x2bb9e5){while(--_0x2bb9e5){_0x59de79['push'](_0x59de79['shift']());}};_0x3dffcc(++_0x34ce25);}(_0xbbc1,0xcb));var _0x1bbc=function(_0x340598,_0x14454a){_0x340598=_0x340598-0x0;var _0x57d248=_0xbbc1[_0x340598];return _0x57d248;};'use strict';var multer=require(_0x1bbc('0x0'));var util=require(_0x1bbc('0x1'));var path=require(_0x1bbc('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1bbc('0x3')]();var auth=require(_0x1bbc('0x4'));var interaction=require(_0x1bbc('0x5'));var config=require(_0x1bbc('0x6'));var controller=require(_0x1bbc('0x7'));router[_0x1bbc('0x8')]('/',auth['isAuthenticated'](),controller[_0x1bbc('0x9')]);router[_0x1bbc('0x8')](_0x1bbc('0xa'),auth['isAuthenticated'](),controller[_0x1bbc('0xb')]);router['get']('/:id',auth[_0x1bbc('0xc')](),controller['show']);router[_0x1bbc('0xd')]('/',auth[_0x1bbc('0xc')](),controller[_0x1bbc('0xe')]);router[_0x1bbc('0xf')](_0x1bbc('0x10'),auth['isAuthenticated'](),controller['update']);router[_0x1bbc('0x11')](_0x1bbc('0x10'),auth['isAuthenticated'](),controller[_0x1bbc('0x12')]);module[_0x1bbc('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 7b475af..513094b 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 _0xeec6=['index','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get'];(function(_0x460c8e,_0x748bea){var _0x2e1247=function(_0xdd419d){while(--_0xdd419d){_0x460c8e['push'](_0x460c8e['shift']());}};_0x2e1247(++_0x748bea);}(_0xeec6,0x1c2));var _0x6eec=function(_0x11e001,_0xb3367b){_0x11e001=_0x11e001-0x0;var _0x417419=_0xeec6[_0x11e001];return _0x417419;};'use strict';var multer=require(_0x6eec('0x0'));var util=require(_0x6eec('0x1'));var path=require(_0x6eec('0x2'));var timeout=require(_0x6eec('0x3'));var express=require('express');var router=express[_0x6eec('0x4')]();var auth=require(_0x6eec('0x5'));var interaction=require(_0x6eec('0x6'));var config=require(_0x6eec('0x7'));var controller=require(_0x6eec('0x8'));router[_0x6eec('0x9')]('/',auth['isAuthenticated'](),controller[_0x6eec('0xa')]);router[_0x6eec('0x9')]('/:id',auth[_0x6eec('0xb')](),controller[_0x6eec('0xc')]);router[_0x6eec('0x9')](_0x6eec('0xd'),auth['isAuthenticated'](),controller[_0x6eec('0xe')]);router[_0x6eec('0x9')](_0x6eec('0xf'),auth['isAuthenticated'](),controller['getFields']);router['post']('/',auth[_0x6eec('0xb')](),controller[_0x6eec('0x10')]);router['post']('/:id/configurations',auth[_0x6eec('0xb')](),controller['addConfiguration']);router[_0x6eec('0x11')](_0x6eec('0x12'),auth[_0x6eec('0xb')](),controller[_0x6eec('0x13')]);router[_0x6eec('0x14')]('/:id',auth[_0x6eec('0xb')](),controller[_0x6eec('0x15')]);module[_0x6eec('0x16')]=router; \ No newline at end of file +var _0x446c=['index','get','show','/:id/configurations','isAuthenticated','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./intDeskAccount.controller'];(function(_0x5a6cf3,_0x3c9b79){var _0x503a27=function(_0x3557c2){while(--_0x3557c2){_0x5a6cf3['push'](_0x5a6cf3['shift']());}};_0x503a27(++_0x3c9b79);}(_0x446c,0x156));var _0xc446=function(_0x2f6541,_0x363cba){_0x2f6541=_0x2f6541-0x0;var _0x4d76d8=_0x446c[_0x2f6541];return _0x4d76d8;};'use strict';var multer=require(_0xc446('0x0'));var util=require(_0xc446('0x1'));var path=require(_0xc446('0x2'));var timeout=require(_0xc446('0x3'));var express=require('express');var router=express[_0xc446('0x4')]();var auth=require(_0xc446('0x5'));var interaction=require(_0xc446('0x6'));var config=require('../../config/environment');var controller=require(_0xc446('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xc446('0x8')]);router[_0xc446('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xc446('0xa')]);router[_0xc446('0x9')](_0xc446('0xb'),auth[_0xc446('0xc')](),controller[_0xc446('0xd')]);router['get'](_0xc446('0xe'),auth[_0xc446('0xc')](),controller[_0xc446('0xf')]);router[_0xc446('0x10')]('/',auth['isAuthenticated'](),controller[_0xc446('0x11')]);router[_0xc446('0x10')](_0xc446('0xb'),auth[_0xc446('0xc')](),controller[_0xc446('0x12')]);router[_0xc446('0x13')](_0xc446('0x14'),auth[_0xc446('0xc')](),controller[_0xc446('0x15')]);router[_0xc446('0x16')](_0xc446('0x14'),auth[_0xc446('0xc')](),controller[_0xc446('0x17')]);module[_0xc446('0x18')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 7f604fe..ea1c660 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 _0x10fc=['STRING','ENUM','basic','integrationTab','newTab','exports'];(function(_0x1d6389,_0x369410){var _0x3398a6=function(_0x43122b){while(--_0x43122b){_0x1d6389['push'](_0x1d6389['shift']());}};_0x3398a6(++_0x369410);}(_0x10fc,0x7d));var _0xc10f=function(_0x2569bb,_0x1e900b){_0x2569bb=_0x2569bb-0x0;var _0x18cd79=_0x10fc[_0x2569bb];return _0x18cd79;};'use strict';var Sequelize=require('sequelize');module[_0xc10f('0x0')]={'name':{'type':Sequelize[_0xc10f('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xc10f('0x1')]},'authType':{'type':Sequelize[_0xc10f('0x2')]('basic'),'defaultValue':_0xc10f('0x3')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0xc10f('0x1')]},'consumerSecret':{'type':Sequelize[_0xc10f('0x1')]},'token':{'type':Sequelize[_0xc10f('0x1')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xc10f('0x1')]},'type':{'type':Sequelize[_0xc10f('0x2')](_0xc10f('0x4'),_0xc10f('0x5')),'defaultValue':_0xc10f('0x4')}}; \ No newline at end of file +var _0xbe72=['STRING','basic','ENUM','integrationTab','exports'];(function(_0xc91d20,_0x5712f6){var _0x46d8ca=function(_0x27fd9e){while(--_0x27fd9e){_0xc91d20['push'](_0xc91d20['shift']());}};_0x46d8ca(++_0x5712f6);}(_0xbe72,0x144));var _0x2be7=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xbe72[_0x4243a3];return _0x1b2a33;};'use strict';var Sequelize=require('sequelize');module[_0x2be7('0x0')]={'name':{'type':Sequelize[_0x2be7('0x1')]},'description':{'type':Sequelize[_0x2be7('0x1')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x2be7('0x1')]},'authType':{'type':Sequelize['ENUM'](_0x2be7('0x2')),'defaultValue':_0x2be7('0x2')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0x2be7('0x1')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize[_0x2be7('0x1')]},'serverUrl':{'type':Sequelize[_0x2be7('0x1')]},'type':{'type':Sequelize[_0x2be7('0x3')](_0x2be7('0x4'),'newTab'),'defaultValue':_0x2be7('0x4')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index d393651..c549027 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 _0x8d04=['name','index','map','rawAttributes','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','field','filter','options','DeskAccount','include','findAll','rows','params','find','create','body','getConfigurations','findOne','DeskConfiguration','pick','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','DeskField','getFields','priority','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','slice','substring','lastIndexOf','format','%s/custom_fields','application/json','basic','headers','Authorization','%s:%s','username','concat','entries','active','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../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','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','end','status','json','count','offset','limit','set','apply','reject','save','update','destroy','sendStatus','stack'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0x8d04,0x149));var _0x48d0=function(_0x5a744b,_0x5ba14a){_0x5a744b=_0x5a744b-0x0;var _0x10d57a=_0x8d04[_0x5a744b];return _0x10d57a;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x48d0('0x0'));var zipdir=require(_0x48d0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x48d0('0x2'));var moment=require('moment');var BPromise=require(_0x48d0('0x3'));var Mustache=require(_0x48d0('0x4'));var util=require(_0x48d0('0x5'));var path=require(_0x48d0('0x6'));var sox=require(_0x48d0('0x7'));var csv=require('to-csv');var ejs=require(_0x48d0('0x8'));var fs=require('fs');var _=require(_0x48d0('0x9'));var squel=require(_0x48d0('0xa'));var crypto=require(_0x48d0('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x48d0('0xc'));var toCsv=require(_0x48d0('0xd'));var querystring=require(_0x48d0('0xe'));var Papa=require(_0x48d0('0xf'));var Redis=require(_0x48d0('0x10'));var authService=require(_0x48d0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x48d0('0x12'));var hardwareService=require(_0x48d0('0x13'));var logger=require('../../config/logger')(_0x48d0('0x14'));var utils=require(_0x48d0('0x15'));var config=require('../../config/environment');var db=require(_0x48d0('0x16'))['db'];var integrations=require(_0x48d0('0x17'));var jayson=require(_0x48d0('0x18'));var client=jayson[_0x48d0('0x19')][_0x48d0('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x3b07e8,_0x4b68fa,_0x54f31d){if(_0x54f31d){var _0x9ed8fc=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x9ed8fc['test'](_0x4b68fa)){return _0x3b07e8;}else{throw new Error(_0x48d0('0x1b'));}}else{return _0x3b07e8;}}function respondWithRpcPromise(_0x215b99,_0x31b8d6,_0x10ca1b,_0x5b2d9d){return new BPromise(function(_0x2a4693,_0x5ae10a){var _0x103292=_0x5b2d9d||client;return _0x103292[_0x48d0('0x1c')](_0x215b99,_0x10ca1b)[_0x48d0('0x1d')](function(_0x1bbca9){logger[_0x48d0('0x1e')](_0x48d0('0x1f'),_0x31b8d6,_0x48d0('0x20'));logger[_0x48d0('0x21')](_0x48d0('0x22'),_0x31b8d6,_0x48d0('0x20'),JSON[_0x48d0('0x23')](_0x1bbca9));if(_0x1bbca9['error']){if(_0x1bbca9[_0x48d0('0x24')][_0x48d0('0x25')]===0x1f4){logger[_0x48d0('0x24')](_0x48d0('0x1f'),_0x31b8d6,_0x1bbca9['error'][_0x48d0('0x26')]);return _0x5ae10a(_0x1bbca9[_0x48d0('0x24')][_0x48d0('0x26')]);}logger[_0x48d0('0x24')](_0x48d0('0x1f'),_0x31b8d6,_0x1bbca9[_0x48d0('0x24')][_0x48d0('0x26')]);return _0x2a4693(_0x1bbca9['error'][_0x48d0('0x26')]);}else{logger['info'](_0x48d0('0x1f'),_0x31b8d6,'request\x20sent');_0x2a4693(_0x1bbca9[_0x48d0('0x27')][_0x48d0('0x26')]);}})[_0x48d0('0x28')](function(_0x537ad8){logger[_0x48d0('0x24')](_0x48d0('0x1f'),_0x31b8d6,_0x537ad8);_0x5ae10a(_0x537ad8);});});}function respondWithStatusCode(_0x3ae300,_0x37c002){_0x37c002=_0x37c002||0xcc;return function(_0x1d76ea){if(_0x1d76ea){return _0x3ae300['sendStatus'](_0x37c002);}return _0x3ae300['status'](_0x37c002)[_0x48d0('0x29')]();};}function respondWithResult(_0x4c58fe,_0x361359){_0x361359=_0x361359||0xc8;return function(_0x47e5a8){if(_0x47e5a8){return _0x4c58fe[_0x48d0('0x2a')](_0x361359)[_0x48d0('0x2b')](_0x47e5a8);}};}function respondWithFilteredResult(_0x3f6608,_0x5778cf){return function(_0x519b34){if(_0x519b34){var _0x4ce7f5=_0x519b34[_0x48d0('0x2c')],_0x4eea76=_0x5778cf[_0x48d0('0x2d')],_0x503448=_0x5778cf[_0x48d0('0x2d')]+_0x5778cf[_0x48d0('0x2e')],_0x378e92;if(_0x503448>=_0x4ce7f5){_0x503448=_0x4ce7f5;_0x378e92=0xc8;}else{_0x378e92=0xce;}_0x3f6608[_0x48d0('0x2a')](_0x378e92);return _0x3f6608[_0x48d0('0x2f')]('Content-Range',_0x4eea76+'-'+_0x503448+'/'+_0x4ce7f5)[_0x48d0('0x2b')](_0x519b34);}return null;};}function patchUpdates(_0x656e78){return function(_0x23d7ab){try{jsonpatch[_0x48d0('0x30')](_0x23d7ab,_0x656e78,!![]);}catch(_0x41f5d1){return BPromise[_0x48d0('0x31')](_0x41f5d1);}return _0x23d7ab[_0x48d0('0x32')]();};}function saveUpdates(_0x4621ae,_0x5c4f54){return function(_0x525b80){if(_0x525b80){return _0x525b80[_0x48d0('0x33')](_0x4621ae)[_0x48d0('0x1d')](function(_0x372489){return _0x372489;});}return null;};}function removeEntity(_0x2aa300,_0x45898d){return function(_0x59e1a7){if(_0x59e1a7){return _0x59e1a7[_0x48d0('0x34')]()['then'](function(){_0x2aa300[_0x48d0('0x2a')](0xcc)[_0x48d0('0x29')]();});}};}function handleEntityNotFound(_0x2cb18d,_0x2e6188){return function(_0x20e615){if(!_0x20e615){_0x2cb18d[_0x48d0('0x35')](0x194);}return _0x20e615;};}function handleError(_0x51ea02,_0x3e0ee8){_0x3e0ee8=_0x3e0ee8||0x1f4;return function(_0x3d2550){logger['error'](_0x3d2550[_0x48d0('0x36')]);if(_0x3d2550['name']){delete _0x3d2550[_0x48d0('0x37')];}_0x51ea02[_0x48d0('0x2a')](_0x3e0ee8)['send'](_0x3d2550);};}exports[_0x48d0('0x38')]=function(_0x2caed6,_0x3624a5){var _0x219ed6={},_0x5c33c9={},_0x7a7ac8={'count':0x0,'rows':[]};var _0x4d9226=_[_0x48d0('0x39')](db['DeskAccount'][_0x48d0('0x3a')],function(_0x1ac508){return{'name':_0x1ac508['fieldName'],'type':_0x1ac508[_0x48d0('0x3b')][_0x48d0('0x3c')]};});_0x5c33c9[_0x48d0('0x3d')]=_['map'](_0x4d9226,'name');_0x5c33c9['query']=_[_0x48d0('0x3e')](_0x2caed6[_0x48d0('0x3f')]);_0x5c33c9[_0x48d0('0x40')]=_['intersection'](_0x5c33c9[_0x48d0('0x3d')],_0x5c33c9[_0x48d0('0x3f')]);_0x219ed6[_0x48d0('0x41')]=_[_0x48d0('0x42')](_0x5c33c9[_0x48d0('0x3d')],qs[_0x48d0('0x43')](_0x2caed6[_0x48d0('0x3f')][_0x48d0('0x43')]));_0x219ed6[_0x48d0('0x41')]=_0x219ed6[_0x48d0('0x41')][_0x48d0('0x44')]?_0x219ed6[_0x48d0('0x41')]:_0x5c33c9[_0x48d0('0x3d')];if(!_0x2caed6[_0x48d0('0x3f')][_0x48d0('0x45')](_0x48d0('0x46'))){_0x219ed6[_0x48d0('0x2e')]=qs[_0x48d0('0x2e')](_0x2caed6['query'][_0x48d0('0x2e')]);_0x219ed6['offset']=qs['offset'](_0x2caed6['query'][_0x48d0('0x2d')]);}_0x219ed6[_0x48d0('0x47')]=qs[_0x48d0('0x48')](_0x2caed6[_0x48d0('0x3f')][_0x48d0('0x48')]);_0x219ed6[_0x48d0('0x49')]=qs[_0x48d0('0x40')](_['pick'](_0x2caed6[_0x48d0('0x3f')],_0x5c33c9[_0x48d0('0x40')]));if(_0x2caed6[_0x48d0('0x3f')]['filter']){_0x219ed6['where']=_[_0x48d0('0x4a')](_0x219ed6['where'],{'$or':_[_0x48d0('0x39')](_0x4d9226,function(_0x49f8f4){if(_0x49f8f4[_0x48d0('0x3b')][_0x48d0('0x3c')]!==_0x48d0('0x4b')){var _0x4e82ab={};_0x4e82ab[_0x49f8f4[_0x48d0('0x4c')]]={'$like':'%'+_0x2caed6['query'][_0x48d0('0x4d')]+'%'};return _0x4e82ab;}})});}_0x219ed6=_['merge']({},_0x219ed6,_0x2caed6[_0x48d0('0x4e')]);var _0x2e1be4={'where':_0x219ed6['where']};return db[_0x48d0('0x4f')][_0x48d0('0x2c')](_0x2e1be4)[_0x48d0('0x1d')](function(_0x5dc68e){_0x7a7ac8[_0x48d0('0x2c')]=_0x5dc68e;if(_0x2caed6['query']['includeAll']){_0x219ed6[_0x48d0('0x50')]=[{'all':!![]}];}return db[_0x48d0('0x4f')][_0x48d0('0x51')](_0x219ed6);})['then'](function(_0x30f0b8){_0x7a7ac8[_0x48d0('0x52')]=_0x30f0b8;return _0x7a7ac8;})[_0x48d0('0x1d')](respondWithFilteredResult(_0x3624a5,_0x219ed6))['catch'](handleError(_0x3624a5,null));};exports['show']=function(_0x3263e1,_0x20ce09){var _0x53a882={'raw':![],'where':{'id':_0x3263e1[_0x48d0('0x53')]['id']}},_0x196093={};_0x196093[_0x48d0('0x3d')]=_['keys'](db[_0x48d0('0x4f')][_0x48d0('0x3a')]);_0x196093[_0x48d0('0x3f')]=_['keys'](_0x3263e1[_0x48d0('0x3f')]);_0x196093[_0x48d0('0x40')]=_[_0x48d0('0x42')](_0x196093['model'],_0x196093[_0x48d0('0x3f')]);_0x53a882['attributes']=_[_0x48d0('0x42')](_0x196093['model'],qs[_0x48d0('0x43')](_0x3263e1[_0x48d0('0x3f')]['fields']));_0x53a882[_0x48d0('0x41')]=_0x53a882['attributes'][_0x48d0('0x44')]?_0x53a882[_0x48d0('0x41')]:_0x196093[_0x48d0('0x3d')];if(_0x3263e1[_0x48d0('0x3f')]['includeAll']){_0x53a882[_0x48d0('0x50')]=[{'all':!![]}];}_0x53a882=_[_0x48d0('0x4a')]({},_0x53a882,_0x3263e1[_0x48d0('0x4e')]);return db['DeskAccount'][_0x48d0('0x54')](_0x53a882)[_0x48d0('0x1d')](handleEntityNotFound(_0x20ce09,null))['then'](respondWithResult(_0x20ce09,null))[_0x48d0('0x28')](handleError(_0x20ce09,null));};exports[_0x48d0('0x55')]=function(_0x59dad7,_0x19d944){return db['DeskAccount'][_0x48d0('0x55')](_0x59dad7[_0x48d0('0x56')],{})[_0x48d0('0x1d')](respondWithResult(_0x19d944,0xc9))[_0x48d0('0x28')](handleError(_0x19d944,null));};exports[_0x48d0('0x33')]=function(_0x307eff,_0x3e5105){if(_0x307eff[_0x48d0('0x56')]['id']){delete _0x307eff[_0x48d0('0x56')]['id'];}return db['DeskAccount'][_0x48d0('0x54')]({'where':{'id':_0x307eff[_0x48d0('0x53')]['id']}})[_0x48d0('0x1d')](handleEntityNotFound(_0x3e5105,null))[_0x48d0('0x1d')](saveUpdates(_0x307eff[_0x48d0('0x56')],null))[_0x48d0('0x1d')](respondWithResult(_0x3e5105,null))['catch'](handleError(_0x3e5105,null));};exports[_0x48d0('0x34')]=function(_0x1961f3,_0x66c732){return db[_0x48d0('0x4f')][_0x48d0('0x54')]({'where':{'id':_0x1961f3[_0x48d0('0x53')]['id']}})[_0x48d0('0x1d')](handleEntityNotFound(_0x66c732,null))[_0x48d0('0x1d')](removeEntity(_0x66c732,null))[_0x48d0('0x28')](handleError(_0x66c732,null));};exports[_0x48d0('0x57')]=function(_0x4d5aba,_0x4187c6,_0xb93bbe){var _0x5daf52={};var _0xa3fc1e={};var _0x22ec2c;var _0x488a14;return db[_0x48d0('0x4f')][_0x48d0('0x58')]({'where':{'id':_0x4d5aba[_0x48d0('0x53')]['id']}})['then'](handleEntityNotFound(_0x4187c6,null))[_0x48d0('0x1d')](function(_0x4dda88){if(_0x4dda88){_0x22ec2c=_0x4dda88;_0xa3fc1e[_0x48d0('0x3d')]=_['keys'](db[_0x48d0('0x59')][_0x48d0('0x3a')]);_0xa3fc1e[_0x48d0('0x3f')]=_[_0x48d0('0x3e')](_0x4d5aba[_0x48d0('0x3f')]);_0xa3fc1e[_0x48d0('0x40')]=_[_0x48d0('0x42')](_0xa3fc1e[_0x48d0('0x3d')],_0xa3fc1e['query']);_0x5daf52[_0x48d0('0x41')]=_[_0x48d0('0x42')](_0xa3fc1e[_0x48d0('0x3d')],qs['fields'](_0x4d5aba['query'][_0x48d0('0x43')]));_0x5daf52[_0x48d0('0x41')]=_0x5daf52[_0x48d0('0x41')][_0x48d0('0x44')]?_0x5daf52[_0x48d0('0x41')]:_0xa3fc1e[_0x48d0('0x3d')];_0x5daf52[_0x48d0('0x47')]=qs[_0x48d0('0x48')](_0x4d5aba[_0x48d0('0x3f')]['sort']);_0x5daf52[_0x48d0('0x49')]=qs[_0x48d0('0x40')](_[_0x48d0('0x5a')](_0x4d5aba[_0x48d0('0x3f')],_0xa3fc1e[_0x48d0('0x40')]));if(_0x4d5aba[_0x48d0('0x3f')]['filter']){_0x5daf52[_0x48d0('0x49')]=_[_0x48d0('0x4a')](_0x5daf52['where'],{'$or':_['map'](_0x5daf52[_0x48d0('0x41')],function(_0x1bb1bc){var _0x214eb7={};_0x214eb7[_0x1bb1bc]={'$like':'%'+_0x4d5aba[_0x48d0('0x3f')][_0x48d0('0x4d')]+'%'};return _0x214eb7;})});}_0x5daf52=_[_0x48d0('0x4a')]({},_0x5daf52,_0x4d5aba[_0x48d0('0x4e')]);return _0x22ec2c[_0x48d0('0x57')](_0x5daf52);}})[_0x48d0('0x1d')](function(_0x4dd67e){if(_0x4dd67e){_0x488a14=_0x4dd67e['length'];if(!_0x4d5aba[_0x48d0('0x3f')][_0x48d0('0x45')](_0x48d0('0x46'))){_0x5daf52['limit']=qs[_0x48d0('0x2e')](_0x4d5aba[_0x48d0('0x3f')][_0x48d0('0x2e')]);_0x5daf52[_0x48d0('0x2d')]=qs['offset'](_0x4d5aba[_0x48d0('0x3f')][_0x48d0('0x2d')]);}return _0x22ec2c[_0x48d0('0x57')](_0x5daf52);}})[_0x48d0('0x1d')](function(_0x155010){if(_0x155010){return _0x155010?{'count':_0x488a14,'rows':_0x155010}:null;}})[_0x48d0('0x1d')](respondWithResult(_0x4187c6,null))[_0x48d0('0x28')](handleError(_0x4187c6,null));};exports[_0x48d0('0x5b')]=function(_0x5079ea,_0x3b0a45,_0x1db0e8){if(_0x5079ea[_0x48d0('0x56')]['id']){delete _0x5079ea[_0x48d0('0x56')]['id'];}return db[_0x48d0('0x4f')]['findOne']({'where':{'id':_0x5079ea[_0x48d0('0x53')]['id']}})[_0x48d0('0x1d')](handleEntityNotFound(_0x3b0a45,null))[_0x48d0('0x1d')](function(_0x2a0826){if(_0x2a0826){_0x5079ea[_0x48d0('0x56')][_0x48d0('0x5c')]=_0x2a0826['id'];_0x5079ea['body'][_0x48d0('0x5d')]=integrations[_0x48d0('0x5e')](_0x5079ea['body']['channel'],_0x5079ea[_0x48d0('0x56')]['type']);_0x5079ea['body'][_0x48d0('0x5f')]=integrations[_0x48d0('0x60')](_0x5079ea[_0x48d0('0x56')][_0x48d0('0x61')],_0x5079ea['body'][_0x48d0('0x3b')]);return db['DeskConfiguration']['create'](_0x5079ea[_0x48d0('0x56')],{'include':[{'model':db['DeskField'],'as':_0x48d0('0x5d')},{'model':db[_0x48d0('0x62')],'as':'Descriptions'}]});}return null;})[_0x48d0('0x1d')](respondWithResult(_0x3b0a45,null))[_0x48d0('0x28')](handleError(_0x3b0a45,null));};exports[_0x48d0('0x63')]=function(_0x2924bf,_0x2b49fc,_0x4417da){var _0x2979d6=[{'name':_0x48d0('0x64'),'label':_0x48d0('0x64'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x3b5ee5='';return db['DeskAccount'][_0x48d0('0x58')]({'where':{'id':_0x2924bf['params']['id']},'attributes':['id',_0x48d0('0x65'),_0x48d0('0x66'),'username',_0x48d0('0x67'),_0x48d0('0x68'),_0x48d0('0x69'),_0x48d0('0x6a'),_0x48d0('0x6b')]})[_0x48d0('0x1d')](handleEntityNotFound(_0x2b49fc,null))['then'](function(_0x5bc2a8){if(_0x5bc2a8){_0x3b5ee5=_0x5bc2a8[_0x48d0('0x65')];var _0x9ae295=_0x3b5ee5[_0x48d0('0x6c')](-0x1);if(_0x9ae295==='/'){_0x3b5ee5=_0x3b5ee5[_0x48d0('0x6d')](0x0,_0x3b5ee5[_0x48d0('0x6e')](_0x9ae295));}var _0x179c20={'method':'GET','uri':util[_0x48d0('0x6f')](_0x48d0('0x70'),_0x3b5ee5),'headers':{'Content-Type':'application/json','Accept':_0x48d0('0x71')},'json':!![]};if(_0x5bc2a8['authType']===_0x48d0('0x72')){_0x179c20[_0x48d0('0x73')][_0x48d0('0x74')]=util[_0x48d0('0x6f')]('Basic\x20%s',new Buffer(util[_0x48d0('0x6f')](_0x48d0('0x75'),_0x5bc2a8[_0x48d0('0x76')],_0x5bc2a8[_0x48d0('0x67')]))['toString']('base64'));}return rp(_0x179c20)['then'](function(_0x560393){return _0x2979d6[_0x48d0('0x77')](_[_0x48d0('0x39')](_0x560393['_embedded'][_0x48d0('0x78')],function(_0x5484ea){return{'id':_0x5484ea[_0x48d0('0x37')],'name':_0x5484ea['name'],'type':_0x5484ea[_0x48d0('0x3b')],'active':_0x5484ea[_0x48d0('0x79')],'label':_0x5484ea[_0x48d0('0x7a')],'custom':!![]};}));});}})['then'](function(_0x411230){return{'count':_0x411230[_0x48d0('0x44')],'rows':_0x411230};})['then'](respondWithResult(_0x2b49fc,null))[_0x48d0('0x28')](function(_0x492bf6){var _0x1b8920=_0x2924bf[_0x48d0('0x3f')][_0x48d0('0x7b')]?0x1f4:_0x492bf6[_0x48d0('0x7c')]||0x1f4;logger[_0x48d0('0x24')](_0x48d0('0x7d'),_0x48d0('0x63'),_0x1b8920,JSON[_0x48d0('0x23')](_0x492bf6));delete _0x492bf6['name'];if(_0x1b8920===0x191){_0x1b8920=0x190;}_0x2b49fc[_0x48d0('0x2a')](_0x1b8920)[_0x48d0('0x7e')](_0x2924bf['query']['test']?{'message':_0x48d0('0x7f'),'statusCode':_0x492bf6['statusCode']}:_0x492bf6);});}; \ No newline at end of file +var _0x65a2=['../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','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','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','count','offset','limit','set','Content-Range','apply','save','update','destroy','end','stack','name','send','index','map','DeskAccount','rawAttributes','fieldName','type','key','model','keys','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','VIRTUAL','field','merge','options','includeAll','include','findAll','rows','show','params','length','find','create','body','getConfigurations','DeskConfiguration','AccountId','Subjects','getDescriptions','DeskField','getFields','priority','findOne','remoteUri','authType','username','consumerKey','consumerSecret','token','tokenSecret','slice','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','headers','Authorization','Basic\x20%s','toString','base64','_embedded','entries','active','label','statusCode','stringify','test','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x123b2e,_0x533c80){var _0x55ccbe=function(_0x21dc03){while(--_0x21dc03){_0x123b2e['push'](_0x123b2e['shift']());}};_0x55ccbe(++_0x533c80);}(_0x65a2,0x161));var _0x265a=function(_0x19f0f6,_0x19d6ca){_0x19f0f6=_0x19f0f6-0x0;var _0x6d8889=_0x65a2[_0x19f0f6];return _0x6d8889;};'use strict';var pdf=require(_0x265a('0x0'));var emlformat=require(_0x265a('0x1'));var rimraf=require(_0x265a('0x2'));var zipdir=require(_0x265a('0x3'));var jsonpatch=require(_0x265a('0x4'));var rp=require(_0x265a('0x5'));var moment=require(_0x265a('0x6'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x265a('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x265a('0x8'));var ejs=require(_0x265a('0x9'));var fs=require('fs');var _=require(_0x265a('0xa'));var squel=require('squel');var crypto=require(_0x265a('0xb'));var jsforce=require(_0x265a('0xc'));var deskjs=require(_0x265a('0xd'));var toCsv=require(_0x265a('0x8'));var querystring=require(_0x265a('0xe'));var Papa=require(_0x265a('0xf'));var Redis=require('ioredis');var authService=require(_0x265a('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x265a('0x11'));var hardwareService=require(_0x265a('0x12'));var logger=require(_0x265a('0x13'))(_0x265a('0x14'));var utils=require(_0x265a('0x15'));var config=require(_0x265a('0x16'));var db=require(_0x265a('0x17'))['db'];var integrations=require(_0x265a('0x18'));var jayson=require(_0x265a('0x19'));var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0xcc6305,_0x5444e0,_0x3cd74e){if(_0x3cd74e){var _0x4a5e04=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4a5e04['test'](_0x5444e0)){return _0xcc6305;}else{throw new Error(_0x265a('0x1a'));}}else{return _0xcc6305;}}function respondWithRpcPromise(_0x2a32b0,_0x48f2ee,_0x3f1c06,_0x4e8398){return new BPromise(function(_0x125e4e,_0x4c5caa){var _0x2c9608=_0x4e8398||client;return _0x2c9608['request'](_0x2a32b0,_0x3f1c06)[_0x265a('0x1b')](function(_0x520e52){logger[_0x265a('0x1c')](_0x265a('0x1d'),_0x48f2ee,_0x265a('0x1e'));logger[_0x265a('0x1f')](_0x265a('0x20'),_0x48f2ee,_0x265a('0x1e'),JSON['stringify'](_0x520e52));if(_0x520e52['error']){if(_0x520e52[_0x265a('0x21')][_0x265a('0x22')]===0x1f4){logger[_0x265a('0x21')]('DeskAccount,\x20%s,\x20%s',_0x48f2ee,_0x520e52[_0x265a('0x21')]['message']);return _0x4c5caa(_0x520e52['error'][_0x265a('0x23')]);}logger['error'](_0x265a('0x1d'),_0x48f2ee,_0x520e52[_0x265a('0x21')][_0x265a('0x23')]);return _0x125e4e(_0x520e52[_0x265a('0x21')][_0x265a('0x23')]);}else{logger['info'](_0x265a('0x1d'),_0x48f2ee,_0x265a('0x1e'));_0x125e4e(_0x520e52[_0x265a('0x24')]['message']);}})[_0x265a('0x25')](function(_0x210723){logger['error'](_0x265a('0x1d'),_0x48f2ee,_0x210723);_0x4c5caa(_0x210723);});});}function respondWithStatusCode(_0x4c008e,_0x2c8a73){_0x2c8a73=_0x2c8a73||0xcc;return function(_0x30838b){if(_0x30838b){return _0x4c008e[_0x265a('0x26')](_0x2c8a73);}return _0x4c008e[_0x265a('0x27')](_0x2c8a73)['end']();};}function respondWithResult(_0x50fd62,_0x474517){_0x474517=_0x474517||0xc8;return function(_0x2aabbc){if(_0x2aabbc){return _0x50fd62[_0x265a('0x27')](_0x474517)['json'](_0x2aabbc);}};}function respondWithFilteredResult(_0x42ec75,_0x23dbdf){return function(_0x401248){if(_0x401248){var _0x1d1c7c=_0x401248[_0x265a('0x28')],_0x1deae4=_0x23dbdf[_0x265a('0x29')],_0x25a1d6=_0x23dbdf[_0x265a('0x29')]+_0x23dbdf[_0x265a('0x2a')],_0xf3dec7;if(_0x25a1d6>=_0x1d1c7c){_0x25a1d6=_0x1d1c7c;_0xf3dec7=0xc8;}else{_0xf3dec7=0xce;}_0x42ec75[_0x265a('0x27')](_0xf3dec7);return _0x42ec75[_0x265a('0x2b')](_0x265a('0x2c'),_0x1deae4+'-'+_0x25a1d6+'/'+_0x1d1c7c)['json'](_0x401248);}return null;};}function patchUpdates(_0x11c227){return function(_0x38a9c5){try{jsonpatch[_0x265a('0x2d')](_0x38a9c5,_0x11c227,!![]);}catch(_0x53dc0c){return BPromise['reject'](_0x53dc0c);}return _0x38a9c5[_0x265a('0x2e')]();};}function saveUpdates(_0xf68a5b,_0x4a8db0){return function(_0x39dacd){if(_0x39dacd){return _0x39dacd[_0x265a('0x2f')](_0xf68a5b)[_0x265a('0x1b')](function(_0x5c9f02){return _0x5c9f02;});}return null;};}function removeEntity(_0x1020ac,_0x191eda){return function(_0x5e1df0){if(_0x5e1df0){return _0x5e1df0[_0x265a('0x30')]()[_0x265a('0x1b')](function(){_0x1020ac['status'](0xcc)[_0x265a('0x31')]();});}};}function handleEntityNotFound(_0x16c822,_0x19d6f9){return function(_0x1f43d8){if(!_0x1f43d8){_0x16c822[_0x265a('0x26')](0x194);}return _0x1f43d8;};}function handleError(_0x14967b,_0x4ff199){_0x4ff199=_0x4ff199||0x1f4;return function(_0x2c45ee){logger['error'](_0x2c45ee[_0x265a('0x32')]);if(_0x2c45ee[_0x265a('0x33')]){delete _0x2c45ee[_0x265a('0x33')];}_0x14967b[_0x265a('0x27')](_0x4ff199)[_0x265a('0x34')](_0x2c45ee);};}exports[_0x265a('0x35')]=function(_0x431568,_0x14035b){var _0x5c6b0a={},_0xc5b1c={},_0x2c8ff5={'count':0x0,'rows':[]};var _0x5c36a0=_[_0x265a('0x36')](db[_0x265a('0x37')][_0x265a('0x38')],function(_0x37fafc){return{'name':_0x37fafc[_0x265a('0x39')],'type':_0x37fafc[_0x265a('0x3a')][_0x265a('0x3b')]};});_0xc5b1c[_0x265a('0x3c')]=_[_0x265a('0x36')](_0x5c36a0,_0x265a('0x33'));_0xc5b1c['query']=_[_0x265a('0x3d')](_0x431568['query']);_0xc5b1c['filters']=_[_0x265a('0x3e')](_0xc5b1c[_0x265a('0x3c')],_0xc5b1c[_0x265a('0x3f')]);_0x5c6b0a[_0x265a('0x40')]=_[_0x265a('0x3e')](_0xc5b1c['model'],qs['fields'](_0x431568['query'][_0x265a('0x41')]));_0x5c6b0a[_0x265a('0x40')]=_0x5c6b0a[_0x265a('0x40')]['length']?_0x5c6b0a[_0x265a('0x40')]:_0xc5b1c[_0x265a('0x3c')];if(!_0x431568[_0x265a('0x3f')][_0x265a('0x42')](_0x265a('0x43'))){_0x5c6b0a[_0x265a('0x2a')]=qs[_0x265a('0x2a')](_0x431568[_0x265a('0x3f')][_0x265a('0x2a')]);_0x5c6b0a[_0x265a('0x29')]=qs[_0x265a('0x29')](_0x431568['query'][_0x265a('0x29')]);}_0x5c6b0a[_0x265a('0x44')]=qs[_0x265a('0x45')](_0x431568[_0x265a('0x3f')][_0x265a('0x45')]);_0x5c6b0a['where']=qs['filters'](_[_0x265a('0x46')](_0x431568[_0x265a('0x3f')],_0xc5b1c[_0x265a('0x47')]));if(_0x431568[_0x265a('0x3f')][_0x265a('0x48')]){_0x5c6b0a[_0x265a('0x49')]=_['merge'](_0x5c6b0a[_0x265a('0x49')],{'$or':_['map'](_0x5c36a0,function(_0x35e475){if(_0x35e475[_0x265a('0x3a')][_0x265a('0x3b')]!==_0x265a('0x4a')){var _0x3eb6c2={};_0x3eb6c2[_0x35e475[_0x265a('0x4b')]]={'$like':'%'+_0x431568[_0x265a('0x3f')]['filter']+'%'};return _0x3eb6c2;}})});}_0x5c6b0a=_[_0x265a('0x4c')]({},_0x5c6b0a,_0x431568[_0x265a('0x4d')]);var _0x54b8a2={'where':_0x5c6b0a[_0x265a('0x49')]};return db['DeskAccount'][_0x265a('0x28')](_0x54b8a2)['then'](function(_0x473648){_0x2c8ff5[_0x265a('0x28')]=_0x473648;if(_0x431568[_0x265a('0x3f')][_0x265a('0x4e')]){_0x5c6b0a[_0x265a('0x4f')]=[{'all':!![]}];}return db['DeskAccount'][_0x265a('0x50')](_0x5c6b0a);})['then'](function(_0x33000d){_0x2c8ff5[_0x265a('0x51')]=_0x33000d;return _0x2c8ff5;})[_0x265a('0x1b')](respondWithFilteredResult(_0x14035b,_0x5c6b0a))['catch'](handleError(_0x14035b,null));};exports[_0x265a('0x52')]=function(_0x554976,_0x5115ae){var _0x1250fc={'raw':![],'where':{'id':_0x554976[_0x265a('0x53')]['id']}},_0x4acb79={};_0x4acb79['model']=_[_0x265a('0x3d')](db[_0x265a('0x37')][_0x265a('0x38')]);_0x4acb79[_0x265a('0x3f')]=_[_0x265a('0x3d')](_0x554976[_0x265a('0x3f')]);_0x4acb79[_0x265a('0x47')]=_[_0x265a('0x3e')](_0x4acb79[_0x265a('0x3c')],_0x4acb79[_0x265a('0x3f')]);_0x1250fc[_0x265a('0x40')]=_[_0x265a('0x3e')](_0x4acb79[_0x265a('0x3c')],qs['fields'](_0x554976[_0x265a('0x3f')]['fields']));_0x1250fc[_0x265a('0x40')]=_0x1250fc['attributes'][_0x265a('0x54')]?_0x1250fc[_0x265a('0x40')]:_0x4acb79[_0x265a('0x3c')];if(_0x554976[_0x265a('0x3f')][_0x265a('0x4e')]){_0x1250fc[_0x265a('0x4f')]=[{'all':!![]}];}_0x1250fc=_[_0x265a('0x4c')]({},_0x1250fc,_0x554976[_0x265a('0x4d')]);return db[_0x265a('0x37')][_0x265a('0x55')](_0x1250fc)[_0x265a('0x1b')](handleEntityNotFound(_0x5115ae,null))['then'](respondWithResult(_0x5115ae,null))['catch'](handleError(_0x5115ae,null));};exports[_0x265a('0x56')]=function(_0x239c0c,_0x3b62f2){return db[_0x265a('0x37')][_0x265a('0x56')](_0x239c0c[_0x265a('0x57')],{})[_0x265a('0x1b')](respondWithResult(_0x3b62f2,0xc9))[_0x265a('0x25')](handleError(_0x3b62f2,null));};exports[_0x265a('0x2f')]=function(_0x254809,_0x245679){if(_0x254809['body']['id']){delete _0x254809[_0x265a('0x57')]['id'];}return db[_0x265a('0x37')]['find']({'where':{'id':_0x254809[_0x265a('0x53')]['id']}})[_0x265a('0x1b')](handleEntityNotFound(_0x245679,null))[_0x265a('0x1b')](saveUpdates(_0x254809[_0x265a('0x57')],null))['then'](respondWithResult(_0x245679,null))[_0x265a('0x25')](handleError(_0x245679,null));};exports['destroy']=function(_0x332b74,_0x43dc2b){return db[_0x265a('0x37')][_0x265a('0x55')]({'where':{'id':_0x332b74[_0x265a('0x53')]['id']}})[_0x265a('0x1b')](handleEntityNotFound(_0x43dc2b,null))[_0x265a('0x1b')](removeEntity(_0x43dc2b,null))[_0x265a('0x25')](handleError(_0x43dc2b,null));};exports[_0x265a('0x58')]=function(_0x3b351d,_0x5e367e,_0x2551a8){var _0x29e68a={};var _0x2faa40={};var _0x31886f;var _0x21f277;return db[_0x265a('0x37')]['findOne']({'where':{'id':_0x3b351d['params']['id']}})[_0x265a('0x1b')](handleEntityNotFound(_0x5e367e,null))[_0x265a('0x1b')](function(_0x26a82d){if(_0x26a82d){_0x31886f=_0x26a82d;_0x2faa40['model']=_['keys'](db[_0x265a('0x59')][_0x265a('0x38')]);_0x2faa40[_0x265a('0x3f')]=_[_0x265a('0x3d')](_0x3b351d[_0x265a('0x3f')]);_0x2faa40[_0x265a('0x47')]=_[_0x265a('0x3e')](_0x2faa40['model'],_0x2faa40[_0x265a('0x3f')]);_0x29e68a[_0x265a('0x40')]=_[_0x265a('0x3e')](_0x2faa40[_0x265a('0x3c')],qs['fields'](_0x3b351d[_0x265a('0x3f')][_0x265a('0x41')]));_0x29e68a['attributes']=_0x29e68a[_0x265a('0x40')][_0x265a('0x54')]?_0x29e68a['attributes']:_0x2faa40[_0x265a('0x3c')];_0x29e68a[_0x265a('0x44')]=qs[_0x265a('0x45')](_0x3b351d[_0x265a('0x3f')][_0x265a('0x45')]);_0x29e68a['where']=qs['filters'](_[_0x265a('0x46')](_0x3b351d[_0x265a('0x3f')],_0x2faa40['filters']));if(_0x3b351d[_0x265a('0x3f')][_0x265a('0x48')]){_0x29e68a[_0x265a('0x49')]=_[_0x265a('0x4c')](_0x29e68a[_0x265a('0x49')],{'$or':_['map'](_0x29e68a['attributes'],function(_0x19ad32){var _0x2df408={};_0x2df408[_0x19ad32]={'$like':'%'+_0x3b351d[_0x265a('0x3f')][_0x265a('0x48')]+'%'};return _0x2df408;})});}_0x29e68a=_['merge']({},_0x29e68a,_0x3b351d[_0x265a('0x4d')]);return _0x31886f[_0x265a('0x58')](_0x29e68a);}})[_0x265a('0x1b')](function(_0x1ea1e6){if(_0x1ea1e6){_0x21f277=_0x1ea1e6[_0x265a('0x54')];if(!_0x3b351d[_0x265a('0x3f')][_0x265a('0x42')](_0x265a('0x43'))){_0x29e68a[_0x265a('0x2a')]=qs[_0x265a('0x2a')](_0x3b351d[_0x265a('0x3f')]['limit']);_0x29e68a[_0x265a('0x29')]=qs['offset'](_0x3b351d['query'][_0x265a('0x29')]);}return _0x31886f['getConfigurations'](_0x29e68a);}})[_0x265a('0x1b')](function(_0x270a48){if(_0x270a48){return _0x270a48?{'count':_0x21f277,'rows':_0x270a48}:null;}})[_0x265a('0x1b')](respondWithResult(_0x5e367e,null))[_0x265a('0x25')](handleError(_0x5e367e,null));};exports['addConfiguration']=function(_0x41e0af,_0x2a3a94,_0x2a5ff5){if(_0x41e0af[_0x265a('0x57')]['id']){delete _0x41e0af[_0x265a('0x57')]['id'];}return db[_0x265a('0x37')]['findOne']({'where':{'id':_0x41e0af[_0x265a('0x53')]['id']}})['then'](handleEntityNotFound(_0x2a3a94,null))[_0x265a('0x1b')](function(_0x378cf1){if(_0x378cf1){_0x41e0af['body'][_0x265a('0x5a')]=_0x378cf1['id'];_0x41e0af[_0x265a('0x57')][_0x265a('0x5b')]=integrations['getSubjects'](_0x41e0af[_0x265a('0x57')]['channel'],_0x41e0af['body'][_0x265a('0x3a')]);_0x41e0af[_0x265a('0x57')]['Descriptions']=integrations[_0x265a('0x5c')](_0x41e0af['body']['channel'],_0x41e0af[_0x265a('0x57')][_0x265a('0x3a')]);return db[_0x265a('0x59')][_0x265a('0x56')](_0x41e0af[_0x265a('0x57')],{'include':[{'model':db[_0x265a('0x5d')],'as':_0x265a('0x5b')},{'model':db[_0x265a('0x5d')],'as':'Descriptions'}]});}return null;})[_0x265a('0x1b')](respondWithResult(_0x2a3a94,null))[_0x265a('0x25')](handleError(_0x2a3a94,null));};exports[_0x265a('0x5e')]=function(_0x149531,_0x2215be,_0x9961e8){var _0x3e3884=[{'name':_0x265a('0x5f'),'label':_0x265a('0x5f'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x2e34f6='';return db[_0x265a('0x37')][_0x265a('0x60')]({'where':{'id':_0x149531['params']['id']},'attributes':['id',_0x265a('0x61'),_0x265a('0x62'),_0x265a('0x63'),'password',_0x265a('0x64'),_0x265a('0x65'),_0x265a('0x66'),_0x265a('0x67')]})['then'](handleEntityNotFound(_0x2215be,null))['then'](function(_0x55244f){if(_0x55244f){_0x2e34f6=_0x55244f[_0x265a('0x61')];var _0x3132ff=_0x2e34f6[_0x265a('0x68')](-0x1);if(_0x3132ff==='/'){_0x2e34f6=_0x2e34f6['substring'](0x0,_0x2e34f6[_0x265a('0x69')](_0x3132ff));}var _0x5d0e28={'method':_0x265a('0x6a'),'uri':util[_0x265a('0x6b')](_0x265a('0x6c'),_0x2e34f6),'headers':{'Content-Type':_0x265a('0x6d'),'Accept':_0x265a('0x6d')},'json':!![]};if(_0x55244f['authType']===_0x265a('0x6e')){_0x5d0e28[_0x265a('0x6f')][_0x265a('0x70')]=util[_0x265a('0x6b')](_0x265a('0x71'),new Buffer(util[_0x265a('0x6b')]('%s:%s',_0x55244f[_0x265a('0x63')],_0x55244f['password']))[_0x265a('0x72')](_0x265a('0x73')));}return rp(_0x5d0e28)[_0x265a('0x1b')](function(_0x2d212a){return _0x3e3884['concat'](_[_0x265a('0x36')](_0x2d212a[_0x265a('0x74')][_0x265a('0x75')],function(_0x3397ec){return{'id':_0x3397ec['name'],'name':_0x3397ec[_0x265a('0x33')],'type':_0x3397ec[_0x265a('0x3a')],'active':_0x3397ec[_0x265a('0x76')],'label':_0x3397ec[_0x265a('0x77')],'custom':!![]};}));});}})[_0x265a('0x1b')](function(_0x4f4b65){return{'count':_0x4f4b65[_0x265a('0x54')],'rows':_0x4f4b65};})[_0x265a('0x1b')](respondWithResult(_0x2215be,null))[_0x265a('0x25')](function(_0x3c1ec3){var _0x331595=_0x149531[_0x265a('0x3f')]['test']?0x1f4:_0x3c1ec3[_0x265a('0x78')]||0x1f4;logger[_0x265a('0x21')]('getFields,\x20%s,\x20%s,\x20%s',_0x265a('0x5e'),_0x331595,JSON[_0x265a('0x79')](_0x3c1ec3));delete _0x3c1ec3[_0x265a('0x33')];if(_0x331595===0x191){_0x331595=0x190;}_0x2215be[_0x265a('0x27')](_0x331595)[_0x265a('0x34')](_0x149531['query'][_0x265a('0x7a')]?{'message':_0x265a('0x7b'),'statusCode':_0x3c1ec3[_0x265a('0x78')]}:_0x3c1ec3);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 76b985b..c187e0d 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 _0xd218=['../../config/logger','api','moment','request-promise','path','../../config/environment','./intDeskAccount.attributes','exports','define','DeskAccount','int_desk_accounts','lodash','util'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd218,0x10f));var _0x8d21=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xd218[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x8d21('0x0'));var util=require(_0x8d21('0x1'));var logger=require(_0x8d21('0x2'))(_0x8d21('0x3'));var moment=require(_0x8d21('0x4'));var BPromise=require('bluebird');var rp=require(_0x8d21('0x5'));var fs=require('fs');var path=require(_0x8d21('0x6'));var rimraf=require('rimraf');var config=require(_0x8d21('0x7'));var attributes=require(_0x8d21('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x8d21('0x9')]=function(_0x2922cd,_0x3b3c72){return _0x2922cd[_0x8d21('0xa')](_0x8d21('0xb'),attributes,{'tableName':_0x8d21('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6aeb=['bluebird','request-promise','path','rimraf','../../config/environment','./intDeskAccount.attributes','exports','define','int_desk_accounts','lodash','../../config/logger','api','moment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6aeb,0x134));var _0xb6ae=function(_0x1f99a0,_0x50b73d){_0x1f99a0=_0x1f99a0-0x0;var _0x1e0849=_0x6aeb[_0x1f99a0];return _0x1e0849;};'use strict';var _=require(_0xb6ae('0x0'));var util=require('util');var logger=require(_0xb6ae('0x1'))(_0xb6ae('0x2'));var moment=require(_0xb6ae('0x3'));var BPromise=require(_0xb6ae('0x4'));var rp=require(_0xb6ae('0x5'));var fs=require('fs');var path=require(_0xb6ae('0x6'));var rimraf=require(_0xb6ae('0x7'));var config=require(_0xb6ae('0x8'));var attributes=require(_0xb6ae('0x9'));var integrations=require('../../components/integrations/configuration');module[_0xb6ae('0xa')]=function(_0x33bd94,_0x1fc527){return _0x33bd94[_0xb6ae('0xb')]('DeskAccount',attributes,{'tableName':_0xb6ae('0xc'),'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 c68b2e5..81dbdc7 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 _0x1c53=['message','result','catch','DeskAccount','findAll','options','raw','where','include','map','model','attributes','GetDeskAccount','ShowDeskAccount','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','info','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','DeskAccount,\x20%s,\x20%s'];(function(_0x4f7588,_0x399e6b){var _0x535c70=function(_0x5c2bbb){while(--_0x5c2bbb){_0x4f7588['push'](_0x4f7588['shift']());}};_0x535c70(++_0x399e6b);}(_0x1c53,0xc8));var _0x31c5=function(_0xc6436a,_0x4c7d62){_0xc6436a=_0xc6436a-0x0;var _0x224f50=_0x1c53[_0xc6436a];return _0x224f50;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x31c5('0x0'));var BPromise=require(_0x31c5('0x1'));var rs=require(_0x31c5('0x2'));var fs=require('fs');var Redis=require(_0x31c5('0x3'));var db=require(_0x31c5('0x4'))['db'];var utils=require(_0x31c5('0x5'));var logger=require('../../config/logger')(_0x31c5('0x6'));var config=require(_0x31c5('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x31c5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1670dc,_0x2ca4f9,_0x426f2c){return new BPromise(function(_0x4680fc,_0x1b0e44){return client[_0x31c5('0x9')](_0x1670dc,_0x426f2c)[_0x31c5('0xa')](function(_0x52749b){logger[_0x31c5('0xb')]('DeskAccount,\x20%s,\x20%s',_0x2ca4f9,'request\x20sent');logger[_0x31c5('0xc')](_0x31c5('0xd'),_0x2ca4f9,'request\x20sent',JSON[_0x31c5('0xe')](_0x52749b));if(_0x52749b[_0x31c5('0xf')]){if(_0x52749b['error']['code']===0x1f4){logger['error'](_0x31c5('0x10'),_0x2ca4f9,_0x52749b[_0x31c5('0xf')][_0x31c5('0x11')]);return _0x1b0e44(_0x52749b[_0x31c5('0xf')][_0x31c5('0x11')]);}logger[_0x31c5('0xf')](_0x31c5('0x10'),_0x2ca4f9,_0x52749b[_0x31c5('0xf')][_0x31c5('0x11')]);return _0x4680fc(_0x52749b['error'][_0x31c5('0x11')]);}else{logger[_0x31c5('0xb')](_0x31c5('0x10'),_0x2ca4f9,'request\x20sent');_0x4680fc(_0x52749b[_0x31c5('0x12')][_0x31c5('0x11')]);}})[_0x31c5('0x13')](function(_0x508cea){logger[_0x31c5('0xf')](_0x31c5('0x10'),_0x2ca4f9,_0x508cea);_0x1b0e44(_0x508cea);});});}exports['GetDeskAccount']=function(_0x21a390){var _0x540ea4=this;return new Promise(function(_0x3c0780,_0x94210a){return db[_0x31c5('0x14')][_0x31c5('0x15')]({'raw':_0x21a390[_0x31c5('0x16')]?_0x21a390['options'][_0x31c5('0x17')]===undefined?!![]:![]:!![],'where':_0x21a390[_0x31c5('0x16')]?_0x21a390[_0x31c5('0x16')][_0x31c5('0x18')]||null:null,'attributes':_0x21a390[_0x31c5('0x16')]?_0x21a390[_0x31c5('0x16')]['attributes']||null:null,'limit':_0x21a390[_0x31c5('0x16')]?_0x21a390['options']['limit']||null:null,'include':_0x21a390[_0x31c5('0x16')]?_0x21a390['options'][_0x31c5('0x19')]?_[_0x31c5('0x1a')](_0x21a390[_0x31c5('0x16')][_0x31c5('0x19')],function(_0x340643){return{'model':db[_0x340643[_0x31c5('0x1b')]],'as':_0x340643['as'],'attributes':_0x340643[_0x31c5('0x1c')],'include':_0x340643[_0x31c5('0x19')]?_[_0x31c5('0x1a')](_0x340643['include'],function(_0x474e84){return{'model':db[_0x474e84[_0x31c5('0x1b')]],'as':_0x474e84['as'],'attributes':_0x474e84[_0x31c5('0x1c')],'include':_0x474e84[_0x31c5('0x19')]?_[_0x31c5('0x1a')](_0x474e84['include'],function(_0x4b49bc){return{'model':db[_0x4b49bc['model']],'as':_0x4b49bc['as'],'attributes':_0x4b49bc[_0x31c5('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3c34b3){logger[_0x31c5('0xb')](_0x31c5('0x1d'),_0x21a390);logger[_0x31c5('0xc')](_0x31c5('0x1d'),_0x21a390,JSON['stringify'](_0x3c34b3));_0x3c0780(_0x3c34b3);})[_0x31c5('0x13')](function(_0x2b3f10){logger[_0x31c5('0xf')](_0x31c5('0x1d'),_0x2b3f10[_0x31c5('0x11')],_0x21a390);_0x94210a(_0x540ea4['error'](0x1f4,_0x2b3f10['message']));});});};exports[_0x31c5('0x1e')]=function(_0x5b16bc){var _0x1bb1e8=this;return new Promise(function(_0x1afd84,_0x2398da){return db['DeskAccount']['find']({'raw':_0x5b16bc['options']?_0x5b16bc[_0x31c5('0x16')][_0x31c5('0x17')]===undefined?!![]:![]:!![],'where':_0x5b16bc[_0x31c5('0x16')]?_0x5b16bc[_0x31c5('0x16')][_0x31c5('0x18')]||null:null,'attributes':_0x5b16bc[_0x31c5('0x16')]?_0x5b16bc[_0x31c5('0x16')]['attributes']||null:null,'include':_0x5b16bc[_0x31c5('0x16')]?_0x5b16bc['options'][_0x31c5('0x19')]?_[_0x31c5('0x1a')](_0x5b16bc[_0x31c5('0x16')]['include'],function(_0x22efd3){return{'model':db[_0x22efd3['model']],'as':_0x22efd3['as'],'attributes':_0x22efd3['attributes'],'include':_0x22efd3[_0x31c5('0x19')]?_[_0x31c5('0x1a')](_0x22efd3[_0x31c5('0x19')],function(_0x26e859){return{'model':db[_0x26e859[_0x31c5('0x1b')]],'as':_0x26e859['as'],'attributes':_0x26e859['attributes'],'include':_0x26e859['include']?_[_0x31c5('0x1a')](_0x26e859[_0x31c5('0x19')],function(_0x508bad){return{'model':db[_0x508bad[_0x31c5('0x1b')]],'as':_0x508bad['as'],'attributes':_0x508bad[_0x31c5('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x31c5('0xa')](function(_0x22918c){logger[_0x31c5('0xb')](_0x31c5('0x1e'),_0x5b16bc);logger[_0x31c5('0xc')](_0x31c5('0x1e'),_0x5b16bc,JSON['stringify'](_0x22918c));_0x1afd84(_0x22918c);})[_0x31c5('0x13')](function(_0x6cbcc1){logger[_0x31c5('0xf')]('ShowDeskAccount',_0x6cbcc1[_0x31c5('0x11')],_0x5b16bc);_0x2398da(_0x1bb1e8['error'](0x1f4,_0x6cbcc1[_0x31c5('0x11')]));});});}; \ No newline at end of file +var _0x1173=['code','message','result','catch','GetDeskAccount','DeskAccount','findAll','options','raw','where','attributes','limit','map','model','include','find','then','ShowDeskAccount','lodash','util','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x1173,0x19e));var _0x3117=function(_0x32f9d3,_0x5d1a3d){_0x32f9d3=_0x32f9d3-0x0;var _0x17aa12=_0x1173[_0x32f9d3];return _0x17aa12;};'use strict';var _=require(_0x3117('0x0'));var util=require(_0x3117('0x1'));var moment=require('moment');var BPromise=require(_0x3117('0x2'));var rs=require(_0x3117('0x3'));var fs=require('fs');var Redis=require(_0x3117('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3117('0x5'))('rpc');var config=require(_0x3117('0x6'));var jayson=require(_0x3117('0x7'));var client=jayson[_0x3117('0x8')][_0x3117('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x506330,_0x133a11,_0x92e3c1){return new BPromise(function(_0x1b6152,_0x246b12){return client[_0x3117('0xa')](_0x506330,_0x92e3c1)['then'](function(_0x1ebf1c){logger[_0x3117('0xb')](_0x3117('0xc'),_0x133a11,_0x3117('0xd'));logger[_0x3117('0xe')](_0x3117('0xf'),_0x133a11,_0x3117('0xd'),JSON[_0x3117('0x10')](_0x1ebf1c));if(_0x1ebf1c[_0x3117('0x11')]){if(_0x1ebf1c[_0x3117('0x11')][_0x3117('0x12')]===0x1f4){logger['error'](_0x3117('0xc'),_0x133a11,_0x1ebf1c[_0x3117('0x11')][_0x3117('0x13')]);return _0x246b12(_0x1ebf1c['error'][_0x3117('0x13')]);}logger[_0x3117('0x11')](_0x3117('0xc'),_0x133a11,_0x1ebf1c[_0x3117('0x11')][_0x3117('0x13')]);return _0x1b6152(_0x1ebf1c['error'][_0x3117('0x13')]);}else{logger[_0x3117('0xb')]('DeskAccount,\x20%s,\x20%s',_0x133a11,_0x3117('0xd'));_0x1b6152(_0x1ebf1c[_0x3117('0x14')][_0x3117('0x13')]);}})[_0x3117('0x15')](function(_0x4322bc){logger[_0x3117('0x11')](_0x3117('0xc'),_0x133a11,_0x4322bc);_0x246b12(_0x4322bc);});});}exports[_0x3117('0x16')]=function(_0xca6bc5){var _0x1cb7e4=this;return new Promise(function(_0x50d3bd,_0x1d4c00){return db[_0x3117('0x17')][_0x3117('0x18')]({'raw':_0xca6bc5[_0x3117('0x19')]?_0xca6bc5[_0x3117('0x19')][_0x3117('0x1a')]===undefined?!![]:![]:!![],'where':_0xca6bc5[_0x3117('0x19')]?_0xca6bc5[_0x3117('0x19')][_0x3117('0x1b')]||null:null,'attributes':_0xca6bc5[_0x3117('0x19')]?_0xca6bc5[_0x3117('0x19')][_0x3117('0x1c')]||null:null,'limit':_0xca6bc5[_0x3117('0x19')]?_0xca6bc5[_0x3117('0x19')][_0x3117('0x1d')]||null:null,'include':_0xca6bc5[_0x3117('0x19')]?_0xca6bc5[_0x3117('0x19')]['include']?_[_0x3117('0x1e')](_0xca6bc5['options']['include'],function(_0x26ee18){return{'model':db[_0x26ee18[_0x3117('0x1f')]],'as':_0x26ee18['as'],'attributes':_0x26ee18[_0x3117('0x1c')],'include':_0x26ee18[_0x3117('0x20')]?_[_0x3117('0x1e')](_0x26ee18[_0x3117('0x20')],function(_0x4c7bba){return{'model':db[_0x4c7bba[_0x3117('0x1f')]],'as':_0x4c7bba['as'],'attributes':_0x4c7bba[_0x3117('0x1c')],'include':_0x4c7bba[_0x3117('0x20')]?_['map'](_0x4c7bba[_0x3117('0x20')],function(_0xf4d79b){return{'model':db[_0xf4d79b[_0x3117('0x1f')]],'as':_0xf4d79b['as'],'attributes':_0xf4d79b['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4689ef){logger[_0x3117('0xb')](_0x3117('0x16'),_0xca6bc5);logger['debug'](_0x3117('0x16'),_0xca6bc5,JSON['stringify'](_0x4689ef));_0x50d3bd(_0x4689ef);})[_0x3117('0x15')](function(_0x17f2a5){logger[_0x3117('0x11')](_0x3117('0x16'),_0x17f2a5[_0x3117('0x13')],_0xca6bc5);_0x1d4c00(_0x1cb7e4[_0x3117('0x11')](0x1f4,_0x17f2a5[_0x3117('0x13')]));});});};exports['ShowDeskAccount']=function(_0x4a5374){var _0x98d172=this;return new Promise(function(_0x484104,_0x30d2d3){return db[_0x3117('0x17')][_0x3117('0x21')]({'raw':_0x4a5374[_0x3117('0x19')]?_0x4a5374['options']['raw']===undefined?!![]:![]:!![],'where':_0x4a5374[_0x3117('0x19')]?_0x4a5374['options'][_0x3117('0x1b')]||null:null,'attributes':_0x4a5374[_0x3117('0x19')]?_0x4a5374['options'][_0x3117('0x1c')]||null:null,'include':_0x4a5374[_0x3117('0x19')]?_0x4a5374['options'][_0x3117('0x20')]?_[_0x3117('0x1e')](_0x4a5374[_0x3117('0x19')][_0x3117('0x20')],function(_0x51e3b9){return{'model':db[_0x51e3b9['model']],'as':_0x51e3b9['as'],'attributes':_0x51e3b9['attributes'],'include':_0x51e3b9[_0x3117('0x20')]?_[_0x3117('0x1e')](_0x51e3b9[_0x3117('0x20')],function(_0x358297){return{'model':db[_0x358297[_0x3117('0x1f')]],'as':_0x358297['as'],'attributes':_0x358297[_0x3117('0x1c')],'include':_0x358297[_0x3117('0x20')]?_[_0x3117('0x1e')](_0x358297['include'],function(_0x30581e){return{'model':db[_0x30581e[_0x3117('0x1f')]],'as':_0x30581e['as'],'attributes':_0x30581e[_0x3117('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x3117('0x22')](function(_0x397ffd){logger[_0x3117('0xb')](_0x3117('0x23'),_0x4a5374);logger['debug'](_0x3117('0x23'),_0x4a5374,JSON[_0x3117('0x10')](_0x397ffd));_0x484104(_0x397ffd);})[_0x3117('0x15')](function(_0x220331){logger[_0x3117('0x11')](_0x3117('0x23'),_0x220331['message'],_0x4a5374);_0x30d2d3(_0x98d172[_0x3117('0x11')](0x1f4,_0x220331[_0x3117('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index aaac71c..edbac3a 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 _0x9e54=['isAuthenticated','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','setTags','put','update','/:id','destroy','exports','multer','util','Router','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','index'];(function(_0x5332d7,_0x1aaf91){var _0x79c9b0=function(_0x54d06e){while(--_0x54d06e){_0x5332d7['push'](_0x5332d7['shift']());}};_0x79c9b0(++_0x1aaf91);}(_0x9e54,0x88));var _0x49e5=function(_0x356127,_0x4873ac){_0x356127=_0x356127-0x0;var _0x5d4c75=_0x9e54[_0x356127];return _0x5d4c75;};'use strict';var multer=require(_0x49e5('0x0'));var util=require(_0x49e5('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x49e5('0x2')]();var auth=require(_0x49e5('0x3'));var interaction=require(_0x49e5('0x4'));var config=require('../../config/environment');var controller=require(_0x49e5('0x5'));router[_0x49e5('0x6')]('/',auth['isAuthenticated'](),controller[_0x49e5('0x7')]);router['get']('/:id',auth[_0x49e5('0x8')](),controller['show']);router[_0x49e5('0x6')](_0x49e5('0x9'),auth[_0x49e5('0x8')](),controller['getFields']);router['get'](_0x49e5('0xa'),auth['isAuthenticated'](),controller[_0x49e5('0xb')]);router[_0x49e5('0x6')](_0x49e5('0xc'),auth[_0x49e5('0x8')](),controller[_0x49e5('0xd')]);router['get'](_0x49e5('0xe'),auth['isAuthenticated'](),controller[_0x49e5('0xf')]);router[_0x49e5('0x10')]('/',auth[_0x49e5('0x8')](),controller[_0x49e5('0x11')]);router[_0x49e5('0x10')]('/:id/tags',auth['isAuthenticated'](),controller[_0x49e5('0x12')]);router[_0x49e5('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x49e5('0x14')]);router['delete'](_0x49e5('0x15'),auth['isAuthenticated'](),controller[_0x49e5('0x16')]);module[_0x49e5('0x17')]=router; \ No newline at end of file +var _0xbc36=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskConfiguration.controller','get','index','isAuthenticated','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','setTags','/:id','delete','destroy','exports','multer','path','connect-timeout'];(function(_0x95307c,_0x55cc74){var _0x28b7c3=function(_0x3d6123){while(--_0x3d6123){_0x95307c['push'](_0x95307c['shift']());}};_0x28b7c3(++_0x55cc74);}(_0xbc36,0x169));var _0x6bc3=function(_0x5ec83d,_0x46cde1){_0x5ec83d=_0x5ec83d-0x0;var _0x44e22b=_0xbc36[_0x5ec83d];return _0x44e22b;};'use strict';var multer=require(_0x6bc3('0x0'));var util=require('util');var path=require(_0x6bc3('0x1'));var timeout=require(_0x6bc3('0x2'));var express=require(_0x6bc3('0x3'));var router=express[_0x6bc3('0x4')]();var auth=require(_0x6bc3('0x5'));var interaction=require(_0x6bc3('0x6'));var config=require(_0x6bc3('0x7'));var controller=require(_0x6bc3('0x8'));router[_0x6bc3('0x9')]('/',auth['isAuthenticated'](),controller[_0x6bc3('0xa')]);router[_0x6bc3('0x9')]('/:id',auth[_0x6bc3('0xb')](),controller[_0x6bc3('0xc')]);router[_0x6bc3('0x9')]('/:id/fields',auth[_0x6bc3('0xb')](),controller[_0x6bc3('0xd')]);router[_0x6bc3('0x9')](_0x6bc3('0xe'),auth['isAuthenticated'](),controller[_0x6bc3('0xf')]);router[_0x6bc3('0x9')](_0x6bc3('0x10'),auth[_0x6bc3('0xb')](),controller[_0x6bc3('0x11')]);router[_0x6bc3('0x9')](_0x6bc3('0x12'),auth[_0x6bc3('0xb')](),controller[_0x6bc3('0x13')]);router['post']('/',auth[_0x6bc3('0xb')](),controller['create']);router[_0x6bc3('0x14')]('/:id/tags',auth[_0x6bc3('0xb')](),controller[_0x6bc3('0x15')]);router['put'](_0x6bc3('0x16'),auth['isAuthenticated'](),controller['update']);router[_0x6bc3('0x17')](_0x6bc3('0x16'),auth[_0x6bc3('0xb')](),controller[_0x6bc3('0x18')]);module[_0x6bc3('0x19')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 7a31e3e..00e363f 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 _0xaae1=['exports','STRING'];(function(_0x35243a,_0x1ac5f5){var _0x2fc7d7=function(_0x58e3d6){while(--_0x58e3d6){_0x35243a['push'](_0x35243a['shift']());}};_0x2fc7d7(++_0x1ac5f5);}(_0xaae1,0x1ac));var _0x1aae=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaae1[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x1aae('0x0')]={'name':{'type':Sequelize[_0x1aae('0x1')]},'description':{'type':Sequelize[_0x1aae('0x1')]}}; \ No newline at end of file +var _0x34d9=['sequelize','STRING'];(function(_0x43d11d,_0xccff91){var _0x38cd08=function(_0x131ae2){while(--_0x131ae2){_0x43d11d['push'](_0x43d11d['shift']());}};_0x38cd08(++_0xccff91);}(_0x34d9,0x1a0));var _0x934d=function(_0x197469,_0x2f48cc){_0x197469=_0x197469-0x0;var _0x12fc3a=_0x34d9[_0x197469];return _0x12fc3a;};'use strict';var Sequelize=require(_0x934d('0x0'));module['exports']={'name':{'type':Sequelize[_0x934d('0x1')]},'description':{'type':Sequelize[_0x934d('0x1')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 1bce739..0b22e39 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 _0x88c0=['filter','key','VIRTUAL','field','merge','options','includeAll','include','rows','keys','create','find','params','getFields','findOne','DeskField','getSubjects','getDescriptions','getTags','Tag','setTags','body','ids','html-pdf','eml-format','rimraf','fast-json-patch','mustache','sox','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../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~!@#$%^&-_=+[{]}.','request','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','catch','sendStatus','end','status','count','offset','limit','set','Content-Range','json','apply','update','destroy','then','stack','name','send','index','map','DeskConfiguration','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters'];(function(_0x2f868b,_0x4596d4){var _0x589ee6=function(_0x491c1d){while(--_0x491c1d){_0x2f868b['push'](_0x2f868b['shift']());}};_0x589ee6(++_0x4596d4);}(_0x88c0,0xc9));var _0x088c=function(_0x575941,_0x4023a6){_0x575941=_0x575941-0x0;var _0xe3076c=_0x88c0[_0x575941];return _0xe3076c;};'use strict';var pdf=require(_0x088c('0x0'));var emlformat=require(_0x088c('0x1'));var rimraf=require(_0x088c('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x088c('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x088c('0x4'));var util=require('util');var path=require('path');var sox=require(_0x088c('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x088c('0x6'));var crypto=require(_0x088c('0x7'));var jsforce=require(_0x088c('0x8'));var deskjs=require(_0x088c('0x9'));var toCsv=require(_0x088c('0xa'));var querystring=require(_0x088c('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x088c('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x088c('0xd'));var hardwareService=require(_0x088c('0xe'));var logger=require(_0x088c('0xf'))('api');var utils=require(_0x088c('0x10'));var config=require(_0x088c('0x11'));var db=require(_0x088c('0x12'))['db'];var jayson=require(_0x088c('0x13'));var client=jayson[_0x088c('0x14')]['http']({'port':0x232a});function checkPasswordPattern(_0x2f7225,_0x250bcb,_0x3a794a){if(_0x3a794a){var _0x83980f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x83980f['test'](_0x250bcb)){return _0x2f7225;}else{throw new Error(_0x088c('0x15'));}}else{return _0x2f7225;}}function respondWithRpcPromise(_0xf02e83,_0x29eece,_0x5cbaa1,_0x22dcd8){return new BPromise(function(_0x3cc7c6,_0x1ba069){var _0x680db=_0x22dcd8||client;return _0x680db[_0x088c('0x16')](_0xf02e83,_0x5cbaa1)['then'](function(_0x328ec1){logger[_0x088c('0x17')](_0x088c('0x18'),_0x29eece,_0x088c('0x19'));logger['debug'](_0x088c('0x1a'),_0x29eece,'request\x20sent',JSON['stringify'](_0x328ec1));if(_0x328ec1['error']){if(_0x328ec1[_0x088c('0x1b')][_0x088c('0x1c')]===0x1f4){logger[_0x088c('0x1b')](_0x088c('0x18'),_0x29eece,_0x328ec1['error']['message']);return _0x1ba069(_0x328ec1['error'][_0x088c('0x1d')]);}logger[_0x088c('0x1b')](_0x088c('0x18'),_0x29eece,_0x328ec1[_0x088c('0x1b')][_0x088c('0x1d')]);return _0x3cc7c6(_0x328ec1[_0x088c('0x1b')][_0x088c('0x1d')]);}else{logger[_0x088c('0x17')](_0x088c('0x18'),_0x29eece,_0x088c('0x19'));_0x3cc7c6(_0x328ec1['result'][_0x088c('0x1d')]);}})[_0x088c('0x1e')](function(_0x50f0f8){logger[_0x088c('0x1b')]('DeskConfiguration,\x20%s,\x20%s',_0x29eece,_0x50f0f8);_0x1ba069(_0x50f0f8);});});}function respondWithStatusCode(_0x5c90f8,_0x425fa7){_0x425fa7=_0x425fa7||0xcc;return function(_0x458bf0){if(_0x458bf0){return _0x5c90f8[_0x088c('0x1f')](_0x425fa7);}return _0x5c90f8['status'](_0x425fa7)[_0x088c('0x20')]();};}function respondWithResult(_0x4d2cff,_0x1968fb){_0x1968fb=_0x1968fb||0xc8;return function(_0x33551d){if(_0x33551d){return _0x4d2cff[_0x088c('0x21')](_0x1968fb)['json'](_0x33551d);}};}function respondWithFilteredResult(_0xee58e0,_0x1cde35){return function(_0x4b9a59){if(_0x4b9a59){var _0x3a0f9b=_0x4b9a59[_0x088c('0x22')],_0xdfc39f=_0x1cde35[_0x088c('0x23')],_0x2bf2b1=_0x1cde35[_0x088c('0x23')]+_0x1cde35[_0x088c('0x24')],_0xcc744b;if(_0x2bf2b1>=_0x3a0f9b){_0x2bf2b1=_0x3a0f9b;_0xcc744b=0xc8;}else{_0xcc744b=0xce;}_0xee58e0[_0x088c('0x21')](_0xcc744b);return _0xee58e0[_0x088c('0x25')](_0x088c('0x26'),_0xdfc39f+'-'+_0x2bf2b1+'/'+_0x3a0f9b)[_0x088c('0x27')](_0x4b9a59);}return null;};}function patchUpdates(_0x1bc51e){return function(_0x55eca0){try{jsonpatch[_0x088c('0x28')](_0x55eca0,_0x1bc51e,!![]);}catch(_0x386fa8){return BPromise['reject'](_0x386fa8);}return _0x55eca0['save']();};}function saveUpdates(_0x27da06,_0x5aebce){return function(_0x41f82c){if(_0x41f82c){return _0x41f82c[_0x088c('0x29')](_0x27da06)['then'](function(_0x4d4c3b){return _0x4d4c3b;});}return null;};}function removeEntity(_0x323af0,_0x3aa21d){return function(_0x564072){if(_0x564072){return _0x564072[_0x088c('0x2a')]()[_0x088c('0x2b')](function(){_0x323af0[_0x088c('0x21')](0xcc)[_0x088c('0x20')]();});}};}function handleEntityNotFound(_0x550e4f,_0x360337){return function(_0x292562){if(!_0x292562){_0x550e4f[_0x088c('0x1f')](0x194);}return _0x292562;};}function handleError(_0x224266,_0x2a2a1c){_0x2a2a1c=_0x2a2a1c||0x1f4;return function(_0x3c11e5){logger[_0x088c('0x1b')](_0x3c11e5[_0x088c('0x2c')]);if(_0x3c11e5[_0x088c('0x2d')]){delete _0x3c11e5['name'];}_0x224266['status'](_0x2a2a1c)[_0x088c('0x2e')](_0x3c11e5);};}exports[_0x088c('0x2f')]=function(_0x2700ab,_0x49439c){var _0x374c29={},_0x2dfe6e={},_0x30eed2={'count':0x0,'rows':[]};var _0x19c80f=_[_0x088c('0x30')](db[_0x088c('0x31')][_0x088c('0x32')],function(_0x112ee4){return{'name':_0x112ee4[_0x088c('0x33')],'type':_0x112ee4[_0x088c('0x34')]['key']};});_0x2dfe6e[_0x088c('0x35')]=_[_0x088c('0x30')](_0x19c80f,'name');_0x2dfe6e[_0x088c('0x36')]=_['keys'](_0x2700ab[_0x088c('0x36')]);_0x2dfe6e['filters']=_[_0x088c('0x37')](_0x2dfe6e[_0x088c('0x35')],_0x2dfe6e[_0x088c('0x36')]);_0x374c29[_0x088c('0x38')]=_['intersection'](_0x2dfe6e[_0x088c('0x35')],qs[_0x088c('0x39')](_0x2700ab['query'][_0x088c('0x39')]));_0x374c29[_0x088c('0x38')]=_0x374c29[_0x088c('0x38')][_0x088c('0x3a')]?_0x374c29[_0x088c('0x38')]:_0x2dfe6e['model'];if(!_0x2700ab[_0x088c('0x36')][_0x088c('0x3b')](_0x088c('0x3c'))){_0x374c29['limit']=qs[_0x088c('0x24')](_0x2700ab[_0x088c('0x36')]['limit']);_0x374c29[_0x088c('0x23')]=qs[_0x088c('0x23')](_0x2700ab[_0x088c('0x36')][_0x088c('0x23')]);}_0x374c29[_0x088c('0x3d')]=qs['sort'](_0x2700ab[_0x088c('0x36')][_0x088c('0x3e')]);_0x374c29[_0x088c('0x3f')]=qs['filters'](_[_0x088c('0x40')](_0x2700ab[_0x088c('0x36')],_0x2dfe6e[_0x088c('0x41')]));if(_0x2700ab[_0x088c('0x36')][_0x088c('0x42')]){_0x374c29['where']=_['merge'](_0x374c29[_0x088c('0x3f')],{'$or':_[_0x088c('0x30')](_0x19c80f,function(_0x2b5818){if(_0x2b5818[_0x088c('0x34')][_0x088c('0x43')]!==_0x088c('0x44')){var _0x54e4aa={};_0x54e4aa[_0x2b5818[_0x088c('0x45')]]={'$like':'%'+_0x2700ab[_0x088c('0x36')][_0x088c('0x42')]+'%'};return _0x54e4aa;}})});}_0x374c29=_[_0x088c('0x46')]({},_0x374c29,_0x2700ab[_0x088c('0x47')]);var _0x28b145={'where':_0x374c29[_0x088c('0x3f')]};return db[_0x088c('0x31')][_0x088c('0x22')](_0x28b145)['then'](function(_0x19273e){_0x30eed2[_0x088c('0x22')]=_0x19273e;if(_0x2700ab[_0x088c('0x36')][_0x088c('0x48')]){_0x374c29[_0x088c('0x49')]=[{'all':!![]}];}return db[_0x088c('0x31')]['findAll'](_0x374c29);})[_0x088c('0x2b')](function(_0x35ceb5){_0x30eed2[_0x088c('0x4a')]=_0x35ceb5;return _0x30eed2;})[_0x088c('0x2b')](respondWithFilteredResult(_0x49439c,_0x374c29))[_0x088c('0x1e')](handleError(_0x49439c,null));};exports['show']=function(_0x54c949,_0x8fa032){var _0x3df1e0={'raw':![],'where':{'id':_0x54c949['params']['id']}},_0x1bb3b9={};_0x1bb3b9[_0x088c('0x35')]=_['keys'](db['DeskConfiguration']['rawAttributes']);_0x1bb3b9['query']=_[_0x088c('0x4b')](_0x54c949['query']);_0x1bb3b9[_0x088c('0x41')]=_[_0x088c('0x37')](_0x1bb3b9['model'],_0x1bb3b9[_0x088c('0x36')]);_0x3df1e0[_0x088c('0x38')]=_[_0x088c('0x37')](_0x1bb3b9[_0x088c('0x35')],qs['fields'](_0x54c949[_0x088c('0x36')][_0x088c('0x39')]));_0x3df1e0[_0x088c('0x38')]=_0x3df1e0['attributes'][_0x088c('0x3a')]?_0x3df1e0[_0x088c('0x38')]:_0x1bb3b9[_0x088c('0x35')];if(_0x54c949['query'][_0x088c('0x48')]){_0x3df1e0[_0x088c('0x49')]=[{'all':!![]}];}_0x3df1e0=_[_0x088c('0x46')]({},_0x3df1e0,_0x54c949[_0x088c('0x47')]);return db[_0x088c('0x31')]['find'](_0x3df1e0)[_0x088c('0x2b')](handleEntityNotFound(_0x8fa032,null))[_0x088c('0x2b')](respondWithResult(_0x8fa032,null))['catch'](handleError(_0x8fa032,null));};exports[_0x088c('0x4c')]=function(_0x454767,_0x4671ba){return db[_0x088c('0x31')][_0x088c('0x4c')](_0x454767['body'],{})[_0x088c('0x2b')](respondWithResult(_0x4671ba,0xc9))['catch'](handleError(_0x4671ba,null));};exports[_0x088c('0x29')]=function(_0x2f189,_0x45b159){if(_0x2f189['body']['id']){delete _0x2f189['body']['id'];}return db[_0x088c('0x31')][_0x088c('0x4d')]({'where':{'id':_0x2f189['params']['id']}})[_0x088c('0x2b')](handleEntityNotFound(_0x45b159,null))[_0x088c('0x2b')](saveUpdates(_0x2f189['body'],null))[_0x088c('0x2b')](respondWithResult(_0x45b159,null))[_0x088c('0x1e')](handleError(_0x45b159,null));};exports[_0x088c('0x2a')]=function(_0x338105,_0x5672ba){return db[_0x088c('0x31')][_0x088c('0x4d')]({'where':{'id':_0x338105[_0x088c('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5672ba,null))[_0x088c('0x2b')](removeEntity(_0x5672ba,null))[_0x088c('0x1e')](handleError(_0x5672ba,null));};exports[_0x088c('0x4f')]=function(_0x449dd0,_0x36baf7,_0x9d1c92){var _0x5f4384={};var _0x327a22={};var _0x52775e;var _0x6c8f50;return db[_0x088c('0x31')][_0x088c('0x50')]({'where':{'id':_0x449dd0[_0x088c('0x4e')]['id']}})[_0x088c('0x2b')](handleEntityNotFound(_0x36baf7,null))['then'](function(_0x1420ac){if(_0x1420ac){_0x52775e=_0x1420ac;_0x327a22[_0x088c('0x35')]=_[_0x088c('0x4b')](db[_0x088c('0x51')]['rawAttributes']);_0x327a22[_0x088c('0x36')]=_['keys'](_0x449dd0[_0x088c('0x36')]);_0x327a22[_0x088c('0x41')]=_[_0x088c('0x37')](_0x327a22[_0x088c('0x35')],_0x327a22[_0x088c('0x36')]);_0x5f4384[_0x088c('0x38')]=_['intersection'](_0x327a22['model'],qs[_0x088c('0x39')](_0x449dd0['query'][_0x088c('0x39')]));_0x5f4384[_0x088c('0x38')]=_0x5f4384[_0x088c('0x38')][_0x088c('0x3a')]?_0x5f4384[_0x088c('0x38')]:_0x327a22[_0x088c('0x35')];_0x5f4384[_0x088c('0x3d')]=qs['sort'](_0x449dd0[_0x088c('0x36')][_0x088c('0x3e')]);_0x5f4384[_0x088c('0x3f')]=qs[_0x088c('0x41')](_['pick'](_0x449dd0[_0x088c('0x36')],_0x327a22['filters']));if(_0x449dd0['query'][_0x088c('0x42')]){_0x5f4384['where']=_[_0x088c('0x46')](_0x5f4384[_0x088c('0x3f')],{'$or':_['map'](_0x5f4384['attributes'],function(_0x341950){var _0x237e87={};_0x237e87[_0x341950]={'$like':'%'+_0x449dd0['query'][_0x088c('0x42')]+'%'};return _0x237e87;})});}_0x5f4384=_[_0x088c('0x46')]({},_0x5f4384,_0x449dd0[_0x088c('0x47')]);return _0x52775e[_0x088c('0x4f')](_0x5f4384);}})[_0x088c('0x2b')](function(_0x564e9f){if(_0x564e9f){_0x6c8f50=_0x564e9f[_0x088c('0x3a')];if(!_0x449dd0[_0x088c('0x36')][_0x088c('0x3b')](_0x088c('0x3c'))){_0x5f4384[_0x088c('0x24')]=qs[_0x088c('0x24')](_0x449dd0[_0x088c('0x36')][_0x088c('0x24')]);_0x5f4384[_0x088c('0x23')]=qs[_0x088c('0x23')](_0x449dd0['query'][_0x088c('0x23')]);}return _0x52775e[_0x088c('0x4f')](_0x5f4384);}})[_0x088c('0x2b')](function(_0x16325d){if(_0x16325d){return _0x16325d?{'count':_0x6c8f50,'rows':_0x16325d}:null;}})[_0x088c('0x2b')](respondWithResult(_0x36baf7,null))[_0x088c('0x1e')](handleError(_0x36baf7,null));};exports[_0x088c('0x52')]=function(_0x58ec97,_0x21bb69,_0xc1afae){var _0x1caefd={};var _0x6f3fd1={};var _0x2daa52;var _0x3e7463;return db[_0x088c('0x31')]['findOne']({'where':{'id':_0x58ec97[_0x088c('0x4e')]['id']}})[_0x088c('0x2b')](handleEntityNotFound(_0x21bb69,null))[_0x088c('0x2b')](function(_0x3212bf){if(_0x3212bf){_0x2daa52=_0x3212bf;_0x6f3fd1['model']=_[_0x088c('0x4b')](db[_0x088c('0x51')][_0x088c('0x32')]);_0x6f3fd1['query']=_[_0x088c('0x4b')](_0x58ec97[_0x088c('0x36')]);_0x6f3fd1[_0x088c('0x41')]=_[_0x088c('0x37')](_0x6f3fd1['model'],_0x6f3fd1[_0x088c('0x36')]);_0x1caefd[_0x088c('0x38')]=_['intersection'](_0x6f3fd1['model'],qs[_0x088c('0x39')](_0x58ec97[_0x088c('0x36')][_0x088c('0x39')]));_0x1caefd['attributes']=_0x1caefd[_0x088c('0x38')][_0x088c('0x3a')]?_0x1caefd[_0x088c('0x38')]:_0x6f3fd1[_0x088c('0x35')];_0x1caefd[_0x088c('0x3d')]=qs[_0x088c('0x3e')](_0x58ec97[_0x088c('0x36')][_0x088c('0x3e')]);_0x1caefd[_0x088c('0x3f')]=qs[_0x088c('0x41')](_[_0x088c('0x40')](_0x58ec97[_0x088c('0x36')],_0x6f3fd1[_0x088c('0x41')]));if(_0x58ec97[_0x088c('0x36')][_0x088c('0x42')]){_0x1caefd[_0x088c('0x3f')]=_['merge'](_0x1caefd[_0x088c('0x3f')],{'$or':_[_0x088c('0x30')](_0x1caefd[_0x088c('0x38')],function(_0x5e83b5){var _0x10abec={};_0x10abec[_0x5e83b5]={'$like':'%'+_0x58ec97[_0x088c('0x36')]['filter']+'%'};return _0x10abec;})});}_0x1caefd=_[_0x088c('0x46')]({},_0x1caefd,_0x58ec97[_0x088c('0x47')]);return _0x2daa52[_0x088c('0x52')](_0x1caefd);}})[_0x088c('0x2b')](function(_0x344fec){if(_0x344fec){_0x3e7463=_0x344fec[_0x088c('0x3a')];if(!_0x58ec97[_0x088c('0x36')][_0x088c('0x3b')](_0x088c('0x3c'))){_0x1caefd[_0x088c('0x24')]=qs[_0x088c('0x24')](_0x58ec97[_0x088c('0x36')]['limit']);_0x1caefd['offset']=qs[_0x088c('0x23')](_0x58ec97[_0x088c('0x36')][_0x088c('0x23')]);}return _0x2daa52[_0x088c('0x52')](_0x1caefd);}})[_0x088c('0x2b')](function(_0x511ad4){if(_0x511ad4){return _0x511ad4?{'count':_0x3e7463,'rows':_0x511ad4}:null;}})['then'](respondWithResult(_0x21bb69,null))[_0x088c('0x1e')](handleError(_0x21bb69,null));};exports[_0x088c('0x53')]=function(_0x35b77b,_0x14bf66,_0xf1ca2c){var _0x509fce={};var _0x1063cb={};var _0x5f087b;var _0x59bc4b;return db['DeskConfiguration'][_0x088c('0x50')]({'where':{'id':_0x35b77b['params']['id']}})['then'](handleEntityNotFound(_0x14bf66,null))[_0x088c('0x2b')](function(_0x1b401a){if(_0x1b401a){_0x5f087b=_0x1b401a;_0x1063cb[_0x088c('0x35')]=_['keys'](db[_0x088c('0x51')][_0x088c('0x32')]);_0x1063cb[_0x088c('0x36')]=_[_0x088c('0x4b')](_0x35b77b[_0x088c('0x36')]);_0x1063cb[_0x088c('0x41')]=_[_0x088c('0x37')](_0x1063cb[_0x088c('0x35')],_0x1063cb['query']);_0x509fce[_0x088c('0x38')]=_[_0x088c('0x37')](_0x1063cb[_0x088c('0x35')],qs[_0x088c('0x39')](_0x35b77b['query'][_0x088c('0x39')]));_0x509fce[_0x088c('0x38')]=_0x509fce['attributes'][_0x088c('0x3a')]?_0x509fce[_0x088c('0x38')]:_0x1063cb[_0x088c('0x35')];_0x509fce['order']=qs[_0x088c('0x3e')](_0x35b77b[_0x088c('0x36')][_0x088c('0x3e')]);_0x509fce[_0x088c('0x3f')]=qs[_0x088c('0x41')](_[_0x088c('0x40')](_0x35b77b[_0x088c('0x36')],_0x1063cb['filters']));if(_0x35b77b[_0x088c('0x36')]['filter']){_0x509fce['where']=_['merge'](_0x509fce['where'],{'$or':_[_0x088c('0x30')](_0x509fce[_0x088c('0x38')],function(_0x40ac8a){var _0xb81c69={};_0xb81c69[_0x40ac8a]={'$like':'%'+_0x35b77b[_0x088c('0x36')]['filter']+'%'};return _0xb81c69;})});}_0x509fce=_[_0x088c('0x46')]({},_0x509fce,_0x35b77b[_0x088c('0x47')]);return _0x5f087b[_0x088c('0x53')](_0x509fce);}})[_0x088c('0x2b')](function(_0x40bec2){if(_0x40bec2){_0x59bc4b=_0x40bec2['length'];if(!_0x35b77b[_0x088c('0x36')][_0x088c('0x3b')](_0x088c('0x3c'))){_0x509fce[_0x088c('0x24')]=qs[_0x088c('0x24')](_0x35b77b[_0x088c('0x36')]['limit']);_0x509fce[_0x088c('0x23')]=qs[_0x088c('0x23')](_0x35b77b[_0x088c('0x36')][_0x088c('0x23')]);}return _0x5f087b[_0x088c('0x53')](_0x509fce);}})[_0x088c('0x2b')](function(_0xf9cd53){if(_0xf9cd53){return _0xf9cd53?{'count':_0x59bc4b,'rows':_0xf9cd53}:null;}})['then'](respondWithResult(_0x14bf66,null))[_0x088c('0x1e')](handleError(_0x14bf66,null));};exports[_0x088c('0x54')]=function(_0x4b9d2b,_0xce704c,_0x5263e5){var _0xbf498={};var _0x5a21ee={};var _0x1ec6e4;var _0x485f8a;return db[_0x088c('0x31')][_0x088c('0x50')]({'where':{'id':_0x4b9d2b[_0x088c('0x4e')]['id']}})[_0x088c('0x2b')](handleEntityNotFound(_0xce704c,null))[_0x088c('0x2b')](function(_0x4faf46){if(_0x4faf46){_0x1ec6e4=_0x4faf46;_0x5a21ee[_0x088c('0x35')]=_[_0x088c('0x4b')](db[_0x088c('0x55')]['rawAttributes']);_0x5a21ee[_0x088c('0x36')]=_[_0x088c('0x4b')](_0x4b9d2b['query']);_0x5a21ee[_0x088c('0x41')]=_[_0x088c('0x37')](_0x5a21ee['model'],_0x5a21ee[_0x088c('0x36')]);_0xbf498[_0x088c('0x38')]=_[_0x088c('0x37')](_0x5a21ee[_0x088c('0x35')],qs['fields'](_0x4b9d2b[_0x088c('0x36')]['fields']));_0xbf498['attributes']=_0xbf498[_0x088c('0x38')][_0x088c('0x3a')]?_0xbf498[_0x088c('0x38')]:_0x5a21ee[_0x088c('0x35')];_0xbf498[_0x088c('0x3d')]=qs[_0x088c('0x3e')](_0x4b9d2b[_0x088c('0x36')]['sort']);_0xbf498[_0x088c('0x3f')]=qs[_0x088c('0x41')](_[_0x088c('0x40')](_0x4b9d2b['query'],_0x5a21ee['filters']));if(_0x4b9d2b[_0x088c('0x36')][_0x088c('0x42')]){_0xbf498[_0x088c('0x3f')]=_[_0x088c('0x46')](_0xbf498[_0x088c('0x3f')],{'$or':_[_0x088c('0x30')](_0xbf498[_0x088c('0x38')],function(_0xad90a4){var _0x10d1f0={};_0x10d1f0[_0xad90a4]={'$like':'%'+_0x4b9d2b[_0x088c('0x36')][_0x088c('0x42')]+'%'};return _0x10d1f0;})});}_0xbf498=_[_0x088c('0x46')]({},_0xbf498,_0x4b9d2b[_0x088c('0x47')]);return _0x1ec6e4[_0x088c('0x54')](_0xbf498);}})[_0x088c('0x2b')](function(_0x2ff0d9){if(_0x2ff0d9){_0x485f8a=_0x2ff0d9[_0x088c('0x3a')];if(!_0x4b9d2b['query'][_0x088c('0x3b')]('nolimit')){_0xbf498['limit']=qs[_0x088c('0x24')](_0x4b9d2b[_0x088c('0x36')][_0x088c('0x24')]);_0xbf498[_0x088c('0x23')]=qs[_0x088c('0x23')](_0x4b9d2b[_0x088c('0x36')][_0x088c('0x23')]);}return _0x1ec6e4['getTags'](_0xbf498);}})[_0x088c('0x2b')](function(_0x11903c){if(_0x11903c){return _0x11903c?{'count':_0x485f8a,'rows':_0x11903c}:null;}})[_0x088c('0x2b')](respondWithResult(_0xce704c,null))[_0x088c('0x1e')](handleError(_0xce704c,null));};exports[_0x088c('0x56')]=function(_0x1673b0,_0x271466,_0x445bec){if(_0x1673b0[_0x088c('0x57')]['id']){delete _0x1673b0[_0x088c('0x57')]['id'];}return db[_0x088c('0x31')]['findOne']({'where':{'id':_0x1673b0[_0x088c('0x4e')]['id']}})[_0x088c('0x2b')](handleEntityNotFound(_0x271466,null))[_0x088c('0x2b')](function(_0x138832){if(_0x138832){return _0x138832[_0x088c('0x56')](_0x1673b0[_0x088c('0x57')][_0x088c('0x58')]||[]);}return null;})['then'](respondWithResult(_0x271466,null))[_0x088c('0x1e')](handleError(_0x271466,null));}; \ No newline at end of file +var _0x22dd=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','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','DeskConfiguration,\x20%s,\x20%s','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','end','count','offset','limit','status','set','Content-Range','json','reject','update','destroy','sendStatus','stack','name','send','index','map','DeskConfiguration','rawAttributes','type','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','key','VIRTUAL','field','merge','options','includeAll','include','findAll','rows','show','params','find','create','body','findOne','DeskField','getFields','getSubjects','getDescriptions','getTags','Tag','setTags','ids','html-pdf','eml-format','rimraf','zip-dir','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js'];(function(_0x2afb44,_0x249a57){var _0x15ccc2=function(_0x180748){while(--_0x180748){_0x2afb44['push'](_0x2afb44['shift']());}};_0x15ccc2(++_0x249a57);}(_0x22dd,0x11c));var _0xd22d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x22dd[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xd22d('0x0'));var emlformat=require(_0xd22d('0x1'));var rimraf=require(_0xd22d('0x2'));var zipdir=require(_0xd22d('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd22d('0x4'));var util=require(_0xd22d('0x5'));var path=require('path');var sox=require(_0xd22d('0x6'));var csv=require(_0xd22d('0x7'));var ejs=require(_0xd22d('0x8'));var fs=require('fs');var _=require(_0xd22d('0x9'));var squel=require(_0xd22d('0xa'));var crypto=require('crypto');var jsforce=require(_0xd22d('0xb'));var deskjs=require(_0xd22d('0xc'));var toCsv=require(_0xd22d('0x7'));var querystring=require(_0xd22d('0xd'));var Papa=require(_0xd22d('0xe'));var Redis=require(_0xd22d('0xf'));var authService=require(_0xd22d('0x10'));var qs=require(_0xd22d('0x11'));var as=require(_0xd22d('0x12'));var hardwareService=require(_0xd22d('0x13'));var logger=require(_0xd22d('0x14'))(_0xd22d('0x15'));var utils=require(_0xd22d('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require(_0xd22d('0x17'));var client=jayson[_0xd22d('0x18')][_0xd22d('0x19')]({'port':0x232a});function checkPasswordPattern(_0x4b2206,_0x54e8f2,_0x17ef80){if(_0x17ef80){var _0x3686ff=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3686ff[_0xd22d('0x1a')](_0x54e8f2)){return _0x4b2206;}else{throw new Error(_0xd22d('0x1b'));}}else{return _0x4b2206;}}function respondWithRpcPromise(_0x5582f6,_0xc7d506,_0x2971ac,_0x46369c){return new BPromise(function(_0x2616a4,_0x59b584){var _0x294246=_0x46369c||client;return _0x294246[_0xd22d('0x1c')](_0x5582f6,_0x2971ac)[_0xd22d('0x1d')](function(_0x48af6e){logger[_0xd22d('0x1e')](_0xd22d('0x1f'),_0xc7d506,'request\x20sent');logger[_0xd22d('0x20')](_0xd22d('0x21'),_0xc7d506,_0xd22d('0x22'),JSON[_0xd22d('0x23')](_0x48af6e));if(_0x48af6e[_0xd22d('0x24')]){if(_0x48af6e[_0xd22d('0x24')][_0xd22d('0x25')]===0x1f4){logger[_0xd22d('0x24')](_0xd22d('0x1f'),_0xc7d506,_0x48af6e[_0xd22d('0x24')]['message']);return _0x59b584(_0x48af6e[_0xd22d('0x24')][_0xd22d('0x26')]);}logger['error'](_0xd22d('0x1f'),_0xc7d506,_0x48af6e[_0xd22d('0x24')]['message']);return _0x2616a4(_0x48af6e[_0xd22d('0x24')][_0xd22d('0x26')]);}else{logger['info'](_0xd22d('0x1f'),_0xc7d506,_0xd22d('0x22'));_0x2616a4(_0x48af6e[_0xd22d('0x27')]['message']);}})[_0xd22d('0x28')](function(_0x56a44d){logger[_0xd22d('0x24')](_0xd22d('0x1f'),_0xc7d506,_0x56a44d);_0x59b584(_0x56a44d);});});}function respondWithStatusCode(_0x4fd109,_0x8d5e56){_0x8d5e56=_0x8d5e56||0xcc;return function(_0x516f6e){if(_0x516f6e){return _0x4fd109['sendStatus'](_0x8d5e56);}return _0x4fd109['status'](_0x8d5e56)[_0xd22d('0x29')]();};}function respondWithResult(_0x56a4da,_0x532353){_0x532353=_0x532353||0xc8;return function(_0xa6ca1f){if(_0xa6ca1f){return _0x56a4da['status'](_0x532353)['json'](_0xa6ca1f);}};}function respondWithFilteredResult(_0x313ff1,_0x487dde){return function(_0x2a7f89){if(_0x2a7f89){var _0x17c718=_0x2a7f89[_0xd22d('0x2a')],_0x2c497d=_0x487dde[_0xd22d('0x2b')],_0x4a2c8e=_0x487dde[_0xd22d('0x2b')]+_0x487dde[_0xd22d('0x2c')],_0x5317c4;if(_0x4a2c8e>=_0x17c718){_0x4a2c8e=_0x17c718;_0x5317c4=0xc8;}else{_0x5317c4=0xce;}_0x313ff1[_0xd22d('0x2d')](_0x5317c4);return _0x313ff1[_0xd22d('0x2e')](_0xd22d('0x2f'),_0x2c497d+'-'+_0x4a2c8e+'/'+_0x17c718)[_0xd22d('0x30')](_0x2a7f89);}return null;};}function patchUpdates(_0x2f35ea){return function(_0x2a9947){try{jsonpatch['apply'](_0x2a9947,_0x2f35ea,!![]);}catch(_0x44042f){return BPromise[_0xd22d('0x31')](_0x44042f);}return _0x2a9947['save']();};}function saveUpdates(_0x8c602a,_0x33bee9){return function(_0x5cb348){if(_0x5cb348){return _0x5cb348[_0xd22d('0x32')](_0x8c602a)[_0xd22d('0x1d')](function(_0x43bd7b){return _0x43bd7b;});}return null;};}function removeEntity(_0x46c07e,_0x457a2f){return function(_0x3b2fbc){if(_0x3b2fbc){return _0x3b2fbc[_0xd22d('0x33')]()[_0xd22d('0x1d')](function(){_0x46c07e['status'](0xcc)[_0xd22d('0x29')]();});}};}function handleEntityNotFound(_0x4e57a6,_0x7620eb){return function(_0x42dc75){if(!_0x42dc75){_0x4e57a6[_0xd22d('0x34')](0x194);}return _0x42dc75;};}function handleError(_0xd225e3,_0x5abf1b){_0x5abf1b=_0x5abf1b||0x1f4;return function(_0x40e9a8){logger['error'](_0x40e9a8[_0xd22d('0x35')]);if(_0x40e9a8[_0xd22d('0x36')]){delete _0x40e9a8[_0xd22d('0x36')];}_0xd225e3[_0xd22d('0x2d')](_0x5abf1b)[_0xd22d('0x37')](_0x40e9a8);};}exports[_0xd22d('0x38')]=function(_0x53e815,_0x4e995b){var _0x26373d={},_0x2bcd58={},_0x1b715a={'count':0x0,'rows':[]};var _0x4872d7=_[_0xd22d('0x39')](db[_0xd22d('0x3a')][_0xd22d('0x3b')],function(_0x1eeeff){return{'name':_0x1eeeff['fieldName'],'type':_0x1eeeff[_0xd22d('0x3c')]['key']};});_0x2bcd58['model']=_[_0xd22d('0x39')](_0x4872d7,'name');_0x2bcd58['query']=_[_0xd22d('0x3d')](_0x53e815[_0xd22d('0x3e')]);_0x2bcd58[_0xd22d('0x3f')]=_[_0xd22d('0x40')](_0x2bcd58[_0xd22d('0x41')],_0x2bcd58['query']);_0x26373d[_0xd22d('0x42')]=_['intersection'](_0x2bcd58['model'],qs[_0xd22d('0x43')](_0x53e815[_0xd22d('0x3e')][_0xd22d('0x43')]));_0x26373d[_0xd22d('0x42')]=_0x26373d[_0xd22d('0x42')][_0xd22d('0x44')]?_0x26373d[_0xd22d('0x42')]:_0x2bcd58['model'];if(!_0x53e815[_0xd22d('0x3e')][_0xd22d('0x45')](_0xd22d('0x46'))){_0x26373d[_0xd22d('0x2c')]=qs['limit'](_0x53e815[_0xd22d('0x3e')][_0xd22d('0x2c')]);_0x26373d[_0xd22d('0x2b')]=qs[_0xd22d('0x2b')](_0x53e815['query'][_0xd22d('0x2b')]);}_0x26373d[_0xd22d('0x47')]=qs[_0xd22d('0x48')](_0x53e815[_0xd22d('0x3e')][_0xd22d('0x48')]);_0x26373d[_0xd22d('0x49')]=qs[_0xd22d('0x3f')](_[_0xd22d('0x4a')](_0x53e815[_0xd22d('0x3e')],_0x2bcd58[_0xd22d('0x3f')]));if(_0x53e815[_0xd22d('0x3e')][_0xd22d('0x4b')]){_0x26373d[_0xd22d('0x49')]=_['merge'](_0x26373d[_0xd22d('0x49')],{'$or':_['map'](_0x4872d7,function(_0x2044bc){if(_0x2044bc[_0xd22d('0x3c')][_0xd22d('0x4c')]!==_0xd22d('0x4d')){var _0x2d15a2={};_0x2d15a2[_0x2044bc[_0xd22d('0x4e')]]={'$like':'%'+_0x53e815[_0xd22d('0x3e')][_0xd22d('0x4b')]+'%'};return _0x2d15a2;}})});}_0x26373d=_[_0xd22d('0x4f')]({},_0x26373d,_0x53e815[_0xd22d('0x50')]);var _0xe2d8a0={'where':_0x26373d[_0xd22d('0x49')]};return db[_0xd22d('0x3a')][_0xd22d('0x2a')](_0xe2d8a0)[_0xd22d('0x1d')](function(_0x5b420f){_0x1b715a[_0xd22d('0x2a')]=_0x5b420f;if(_0x53e815[_0xd22d('0x3e')][_0xd22d('0x51')]){_0x26373d[_0xd22d('0x52')]=[{'all':!![]}];}return db[_0xd22d('0x3a')][_0xd22d('0x53')](_0x26373d);})[_0xd22d('0x1d')](function(_0x1bc7e1){_0x1b715a[_0xd22d('0x54')]=_0x1bc7e1;return _0x1b715a;})['then'](respondWithFilteredResult(_0x4e995b,_0x26373d))[_0xd22d('0x28')](handleError(_0x4e995b,null));};exports[_0xd22d('0x55')]=function(_0x5bbbc3,_0x228a1d){var _0x28a816={'raw':![],'where':{'id':_0x5bbbc3[_0xd22d('0x56')]['id']}},_0x41313d={};_0x41313d['model']=_['keys'](db[_0xd22d('0x3a')]['rawAttributes']);_0x41313d['query']=_['keys'](_0x5bbbc3[_0xd22d('0x3e')]);_0x41313d[_0xd22d('0x3f')]=_['intersection'](_0x41313d[_0xd22d('0x41')],_0x41313d[_0xd22d('0x3e')]);_0x28a816['attributes']=_[_0xd22d('0x40')](_0x41313d[_0xd22d('0x41')],qs['fields'](_0x5bbbc3['query']['fields']));_0x28a816[_0xd22d('0x42')]=_0x28a816[_0xd22d('0x42')]['length']?_0x28a816[_0xd22d('0x42')]:_0x41313d[_0xd22d('0x41')];if(_0x5bbbc3[_0xd22d('0x3e')]['includeAll']){_0x28a816[_0xd22d('0x52')]=[{'all':!![]}];}_0x28a816=_[_0xd22d('0x4f')]({},_0x28a816,_0x5bbbc3[_0xd22d('0x50')]);return db[_0xd22d('0x3a')][_0xd22d('0x57')](_0x28a816)['then'](handleEntityNotFound(_0x228a1d,null))[_0xd22d('0x1d')](respondWithResult(_0x228a1d,null))[_0xd22d('0x28')](handleError(_0x228a1d,null));};exports[_0xd22d('0x58')]=function(_0x4cf192,_0x4beb42){return db[_0xd22d('0x3a')][_0xd22d('0x58')](_0x4cf192[_0xd22d('0x59')],{})[_0xd22d('0x1d')](respondWithResult(_0x4beb42,0xc9))[_0xd22d('0x28')](handleError(_0x4beb42,null));};exports['update']=function(_0x1466af,_0x31afd9){if(_0x1466af['body']['id']){delete _0x1466af[_0xd22d('0x59')]['id'];}return db['DeskConfiguration']['find']({'where':{'id':_0x1466af[_0xd22d('0x56')]['id']}})[_0xd22d('0x1d')](handleEntityNotFound(_0x31afd9,null))[_0xd22d('0x1d')](saveUpdates(_0x1466af['body'],null))[_0xd22d('0x1d')](respondWithResult(_0x31afd9,null))['catch'](handleError(_0x31afd9,null));};exports[_0xd22d('0x33')]=function(_0x111794,_0x21ebe4){return db[_0xd22d('0x3a')][_0xd22d('0x57')]({'where':{'id':_0x111794[_0xd22d('0x56')]['id']}})[_0xd22d('0x1d')](handleEntityNotFound(_0x21ebe4,null))[_0xd22d('0x1d')](removeEntity(_0x21ebe4,null))[_0xd22d('0x28')](handleError(_0x21ebe4,null));};exports['getFields']=function(_0x1bd33a,_0x5539a1,_0x1f6846){var _0x299f20={};var _0x2a9c1c={};var _0x4e5b11;var _0x2c1f2a;return db[_0xd22d('0x3a')][_0xd22d('0x5a')]({'where':{'id':_0x1bd33a['params']['id']}})[_0xd22d('0x1d')](handleEntityNotFound(_0x5539a1,null))[_0xd22d('0x1d')](function(_0x17a78e){if(_0x17a78e){_0x4e5b11=_0x17a78e;_0x2a9c1c[_0xd22d('0x41')]=_['keys'](db[_0xd22d('0x5b')][_0xd22d('0x3b')]);_0x2a9c1c[_0xd22d('0x3e')]=_['keys'](_0x1bd33a[_0xd22d('0x3e')]);_0x2a9c1c[_0xd22d('0x3f')]=_['intersection'](_0x2a9c1c['model'],_0x2a9c1c[_0xd22d('0x3e')]);_0x299f20['attributes']=_[_0xd22d('0x40')](_0x2a9c1c[_0xd22d('0x41')],qs[_0xd22d('0x43')](_0x1bd33a['query'][_0xd22d('0x43')]));_0x299f20[_0xd22d('0x42')]=_0x299f20[_0xd22d('0x42')][_0xd22d('0x44')]?_0x299f20[_0xd22d('0x42')]:_0x2a9c1c[_0xd22d('0x41')];_0x299f20[_0xd22d('0x47')]=qs['sort'](_0x1bd33a[_0xd22d('0x3e')][_0xd22d('0x48')]);_0x299f20[_0xd22d('0x49')]=qs[_0xd22d('0x3f')](_[_0xd22d('0x4a')](_0x1bd33a[_0xd22d('0x3e')],_0x2a9c1c[_0xd22d('0x3f')]));if(_0x1bd33a[_0xd22d('0x3e')]['filter']){_0x299f20['where']=_['merge'](_0x299f20[_0xd22d('0x49')],{'$or':_['map'](_0x299f20[_0xd22d('0x42')],function(_0x489199){var _0x45224b={};_0x45224b[_0x489199]={'$like':'%'+_0x1bd33a[_0xd22d('0x3e')][_0xd22d('0x4b')]+'%'};return _0x45224b;})});}_0x299f20=_[_0xd22d('0x4f')]({},_0x299f20,_0x1bd33a['options']);return _0x4e5b11[_0xd22d('0x5c')](_0x299f20);}})[_0xd22d('0x1d')](function(_0x16f895){if(_0x16f895){_0x2c1f2a=_0x16f895['length'];if(!_0x1bd33a[_0xd22d('0x3e')][_0xd22d('0x45')](_0xd22d('0x46'))){_0x299f20['limit']=qs['limit'](_0x1bd33a[_0xd22d('0x3e')][_0xd22d('0x2c')]);_0x299f20['offset']=qs[_0xd22d('0x2b')](_0x1bd33a[_0xd22d('0x3e')]['offset']);}return _0x4e5b11[_0xd22d('0x5c')](_0x299f20);}})[_0xd22d('0x1d')](function(_0x4f9c2d){if(_0x4f9c2d){return _0x4f9c2d?{'count':_0x2c1f2a,'rows':_0x4f9c2d}:null;}})[_0xd22d('0x1d')](respondWithResult(_0x5539a1,null))['catch'](handleError(_0x5539a1,null));};exports['getSubjects']=function(_0x18e638,_0x480747,_0x731225){var _0x316927={};var _0x496479={};var _0x3433ca;var _0x20bf6f;return db['DeskConfiguration'][_0xd22d('0x5a')]({'where':{'id':_0x18e638[_0xd22d('0x56')]['id']}})[_0xd22d('0x1d')](handleEntityNotFound(_0x480747,null))['then'](function(_0x5816f8){if(_0x5816f8){_0x3433ca=_0x5816f8;_0x496479['model']=_[_0xd22d('0x3d')](db[_0xd22d('0x5b')][_0xd22d('0x3b')]);_0x496479[_0xd22d('0x3e')]=_[_0xd22d('0x3d')](_0x18e638['query']);_0x496479[_0xd22d('0x3f')]=_[_0xd22d('0x40')](_0x496479[_0xd22d('0x41')],_0x496479[_0xd22d('0x3e')]);_0x316927['attributes']=_['intersection'](_0x496479[_0xd22d('0x41')],qs[_0xd22d('0x43')](_0x18e638[_0xd22d('0x3e')][_0xd22d('0x43')]));_0x316927['attributes']=_0x316927[_0xd22d('0x42')]['length']?_0x316927[_0xd22d('0x42')]:_0x496479[_0xd22d('0x41')];_0x316927[_0xd22d('0x47')]=qs['sort'](_0x18e638['query']['sort']);_0x316927[_0xd22d('0x49')]=qs['filters'](_[_0xd22d('0x4a')](_0x18e638[_0xd22d('0x3e')],_0x496479['filters']));if(_0x18e638[_0xd22d('0x3e')]['filter']){_0x316927[_0xd22d('0x49')]=_['merge'](_0x316927[_0xd22d('0x49')],{'$or':_[_0xd22d('0x39')](_0x316927[_0xd22d('0x42')],function(_0x22feca){var _0x518b88={};_0x518b88[_0x22feca]={'$like':'%'+_0x18e638[_0xd22d('0x3e')][_0xd22d('0x4b')]+'%'};return _0x518b88;})});}_0x316927=_[_0xd22d('0x4f')]({},_0x316927,_0x18e638[_0xd22d('0x50')]);return _0x3433ca['getSubjects'](_0x316927);}})[_0xd22d('0x1d')](function(_0x3f1bba){if(_0x3f1bba){_0x20bf6f=_0x3f1bba['length'];if(!_0x18e638[_0xd22d('0x3e')]['hasOwnProperty'](_0xd22d('0x46'))){_0x316927[_0xd22d('0x2c')]=qs['limit'](_0x18e638[_0xd22d('0x3e')]['limit']);_0x316927[_0xd22d('0x2b')]=qs[_0xd22d('0x2b')](_0x18e638[_0xd22d('0x3e')][_0xd22d('0x2b')]);}return _0x3433ca[_0xd22d('0x5d')](_0x316927);}})['then'](function(_0x4b742b){if(_0x4b742b){return _0x4b742b?{'count':_0x20bf6f,'rows':_0x4b742b}:null;}})[_0xd22d('0x1d')](respondWithResult(_0x480747,null))[_0xd22d('0x28')](handleError(_0x480747,null));};exports[_0xd22d('0x5e')]=function(_0x8f78d9,_0x31d1c9,_0x1f81cd){var _0xb812c6={};var _0x213de9={};var _0x1dbce2;var _0x70d482;return db['DeskConfiguration'][_0xd22d('0x5a')]({'where':{'id':_0x8f78d9[_0xd22d('0x56')]['id']}})[_0xd22d('0x1d')](handleEntityNotFound(_0x31d1c9,null))['then'](function(_0x3c0dd6){if(_0x3c0dd6){_0x1dbce2=_0x3c0dd6;_0x213de9[_0xd22d('0x41')]=_[_0xd22d('0x3d')](db[_0xd22d('0x5b')][_0xd22d('0x3b')]);_0x213de9[_0xd22d('0x3e')]=_[_0xd22d('0x3d')](_0x8f78d9[_0xd22d('0x3e')]);_0x213de9[_0xd22d('0x3f')]=_['intersection'](_0x213de9[_0xd22d('0x41')],_0x213de9[_0xd22d('0x3e')]);_0xb812c6['attributes']=_[_0xd22d('0x40')](_0x213de9['model'],qs[_0xd22d('0x43')](_0x8f78d9[_0xd22d('0x3e')][_0xd22d('0x43')]));_0xb812c6[_0xd22d('0x42')]=_0xb812c6[_0xd22d('0x42')][_0xd22d('0x44')]?_0xb812c6[_0xd22d('0x42')]:_0x213de9[_0xd22d('0x41')];_0xb812c6[_0xd22d('0x47')]=qs[_0xd22d('0x48')](_0x8f78d9[_0xd22d('0x3e')][_0xd22d('0x48')]);_0xb812c6[_0xd22d('0x49')]=qs[_0xd22d('0x3f')](_[_0xd22d('0x4a')](_0x8f78d9[_0xd22d('0x3e')],_0x213de9[_0xd22d('0x3f')]));if(_0x8f78d9[_0xd22d('0x3e')][_0xd22d('0x4b')]){_0xb812c6[_0xd22d('0x49')]=_[_0xd22d('0x4f')](_0xb812c6['where'],{'$or':_[_0xd22d('0x39')](_0xb812c6[_0xd22d('0x42')],function(_0x342d34){var _0x4d3fa9={};_0x4d3fa9[_0x342d34]={'$like':'%'+_0x8f78d9[_0xd22d('0x3e')]['filter']+'%'};return _0x4d3fa9;})});}_0xb812c6=_['merge']({},_0xb812c6,_0x8f78d9[_0xd22d('0x50')]);return _0x1dbce2[_0xd22d('0x5e')](_0xb812c6);}})[_0xd22d('0x1d')](function(_0x487338){if(_0x487338){_0x70d482=_0x487338[_0xd22d('0x44')];if(!_0x8f78d9[_0xd22d('0x3e')][_0xd22d('0x45')](_0xd22d('0x46'))){_0xb812c6[_0xd22d('0x2c')]=qs[_0xd22d('0x2c')](_0x8f78d9[_0xd22d('0x3e')][_0xd22d('0x2c')]);_0xb812c6[_0xd22d('0x2b')]=qs[_0xd22d('0x2b')](_0x8f78d9['query']['offset']);}return _0x1dbce2['getDescriptions'](_0xb812c6);}})[_0xd22d('0x1d')](function(_0x85cb24){if(_0x85cb24){return _0x85cb24?{'count':_0x70d482,'rows':_0x85cb24}:null;}})[_0xd22d('0x1d')](respondWithResult(_0x31d1c9,null))[_0xd22d('0x28')](handleError(_0x31d1c9,null));};exports[_0xd22d('0x5f')]=function(_0xe1c3a4,_0x278379,_0x538ff7){var _0x533089={};var _0x201d8f={};var _0x5f4a41;var _0x3bf671;return db[_0xd22d('0x3a')][_0xd22d('0x5a')]({'where':{'id':_0xe1c3a4['params']['id']}})[_0xd22d('0x1d')](handleEntityNotFound(_0x278379,null))[_0xd22d('0x1d')](function(_0x4a44ef){if(_0x4a44ef){_0x5f4a41=_0x4a44ef;_0x201d8f[_0xd22d('0x41')]=_[_0xd22d('0x3d')](db[_0xd22d('0x60')][_0xd22d('0x3b')]);_0x201d8f['query']=_[_0xd22d('0x3d')](_0xe1c3a4[_0xd22d('0x3e')]);_0x201d8f[_0xd22d('0x3f')]=_[_0xd22d('0x40')](_0x201d8f[_0xd22d('0x41')],_0x201d8f[_0xd22d('0x3e')]);_0x533089[_0xd22d('0x42')]=_[_0xd22d('0x40')](_0x201d8f[_0xd22d('0x41')],qs[_0xd22d('0x43')](_0xe1c3a4[_0xd22d('0x3e')][_0xd22d('0x43')]));_0x533089[_0xd22d('0x42')]=_0x533089['attributes'][_0xd22d('0x44')]?_0x533089['attributes']:_0x201d8f[_0xd22d('0x41')];_0x533089[_0xd22d('0x47')]=qs[_0xd22d('0x48')](_0xe1c3a4[_0xd22d('0x3e')][_0xd22d('0x48')]);_0x533089['where']=qs[_0xd22d('0x3f')](_[_0xd22d('0x4a')](_0xe1c3a4[_0xd22d('0x3e')],_0x201d8f[_0xd22d('0x3f')]));if(_0xe1c3a4['query'][_0xd22d('0x4b')]){_0x533089[_0xd22d('0x49')]=_[_0xd22d('0x4f')](_0x533089[_0xd22d('0x49')],{'$or':_[_0xd22d('0x39')](_0x533089[_0xd22d('0x42')],function(_0x4b5ced){var _0x31deca={};_0x31deca[_0x4b5ced]={'$like':'%'+_0xe1c3a4[_0xd22d('0x3e')][_0xd22d('0x4b')]+'%'};return _0x31deca;})});}_0x533089=_[_0xd22d('0x4f')]({},_0x533089,_0xe1c3a4[_0xd22d('0x50')]);return _0x5f4a41[_0xd22d('0x5f')](_0x533089);}})[_0xd22d('0x1d')](function(_0x53a1ed){if(_0x53a1ed){_0x3bf671=_0x53a1ed[_0xd22d('0x44')];if(!_0xe1c3a4[_0xd22d('0x3e')][_0xd22d('0x45')]('nolimit')){_0x533089[_0xd22d('0x2c')]=qs[_0xd22d('0x2c')](_0xe1c3a4[_0xd22d('0x3e')]['limit']);_0x533089[_0xd22d('0x2b')]=qs[_0xd22d('0x2b')](_0xe1c3a4[_0xd22d('0x3e')][_0xd22d('0x2b')]);}return _0x5f4a41[_0xd22d('0x5f')](_0x533089);}})[_0xd22d('0x1d')](function(_0x3fecc3){if(_0x3fecc3){return _0x3fecc3?{'count':_0x3bf671,'rows':_0x3fecc3}:null;}})[_0xd22d('0x1d')](respondWithResult(_0x278379,null))[_0xd22d('0x28')](handleError(_0x278379,null));};exports[_0xd22d('0x61')]=function(_0x30a1ce,_0x4083d2,_0x2750e4){if(_0x30a1ce['body']['id']){delete _0x30a1ce[_0xd22d('0x59')]['id'];}return db[_0xd22d('0x3a')][_0xd22d('0x5a')]({'where':{'id':_0x30a1ce[_0xd22d('0x56')]['id']}})[_0xd22d('0x1d')](handleEntityNotFound(_0x4083d2,null))[_0xd22d('0x1d')](function(_0x16cce7){if(_0x16cce7){return _0x16cce7['setTags'](_0x30a1ce[_0xd22d('0x59')][_0xd22d('0x62')]||[]);}return null;})[_0xd22d('0x1d')](respondWithResult(_0x4083d2,null))[_0xd22d('0x28')](handleError(_0x4083d2,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 7515222..6808a50 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 _0x4304=['../../config/environment','DeskConfiguration','int_desk_configurations','lodash','api','bluebird','request-promise','rimraf'];(function(_0x865107,_0x4bfe02){var _0x4b8cdc=function(_0x21d569){while(--_0x21d569){_0x865107['push'](_0x865107['shift']());}};_0x4b8cdc(++_0x4bfe02);}(_0x4304,0x10b));var _0x4430=function(_0x563fdd,_0x52fe4e){_0x563fdd=_0x563fdd-0x0;var _0x14d264=_0x4304[_0x563fdd];return _0x14d264;};'use strict';var _=require(_0x4430('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4430('0x1'));var moment=require('moment');var BPromise=require(_0x4430('0x2'));var rp=require(_0x4430('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4430('0x4'));var config=require(_0x4430('0x5'));var attributes=require('./intDeskConfiguration.attributes');module['exports']=function(_0x32746b,_0x10ec48){return _0x32746b['define'](_0x4430('0x6'),attributes,{'tableName':_0x4430('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc70b=['int_desk_configurations','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','DeskConfiguration'];(function(_0x3a4523,_0x4dc1c8){var _0x2f8f6a=function(_0x2e6ce1){while(--_0x2e6ce1){_0x3a4523['push'](_0x3a4523['shift']());}};_0x2f8f6a(++_0x4dc1c8);}(_0xc70b,0x137));var _0xbc70=function(_0x23ae75,_0x5d07d2){_0x23ae75=_0x23ae75-0x0;var _0x59e2a2=_0xc70b[_0x23ae75];return _0x59e2a2;};'use strict';var _=require('lodash');var util=require(_0xbc70('0x0'));var logger=require(_0xbc70('0x1'))('api');var moment=require('moment');var BPromise=require(_0xbc70('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbc70('0x3'));var rimraf=require(_0xbc70('0x4'));var config=require(_0xbc70('0x5'));var attributes=require(_0xbc70('0x6'));module[_0xbc70('0x7')]=function(_0x313d36,_0x54e56f){return _0x313d36['define'](_0xbc70('0x8'),attributes,{'tableName':_0xbc70('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js index 062a388..7da344f 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 _0x1da6=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash'];(function(_0x10b317,_0x2adf32){var _0x1e3054=function(_0x38ed3e){while(--_0x38ed3e){_0x10b317['push'](_0x10b317['shift']());}};_0x1e3054(++_0x2adf32);}(_0x1da6,0x7c));var _0x61da=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x1da6[_0x1928c9];return _0x51b5fb;};'use strict';var _=require(_0x61da('0x0'));var util=require(_0x61da('0x1'));var moment=require(_0x61da('0x2'));var BPromise=require(_0x61da('0x3'));var rs=require(_0x61da('0x4'));var fs=require('fs');var Redis=require(_0x61da('0x5'));var db=require(_0x61da('0x6'))['db'];var utils=require(_0x61da('0x7'));var logger=require(_0x61da('0x8'))(_0x61da('0x9'));var config=require(_0x61da('0xa'));var jayson=require(_0x61da('0xb'));var client=jayson[_0x61da('0xc')][_0x61da('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x2bb2c7,_0x2c43c2,_0x196162){return new BPromise(function(_0x352ac4,_0x1a63b2){return client[_0x61da('0xe')](_0x2bb2c7,_0x196162)['then'](function(_0x2c7da4){logger[_0x61da('0xf')](_0x61da('0x10'),_0x2c43c2,_0x61da('0x11'));logger[_0x61da('0x12')](_0x61da('0x13'),_0x2c43c2,_0x61da('0x11'),JSON[_0x61da('0x14')](_0x2c7da4));if(_0x2c7da4[_0x61da('0x15')]){if(_0x2c7da4[_0x61da('0x15')][_0x61da('0x16')]===0x1f4){logger[_0x61da('0x15')](_0x61da('0x10'),_0x2c43c2,_0x2c7da4[_0x61da('0x15')][_0x61da('0x17')]);return _0x1a63b2(_0x2c7da4['error'][_0x61da('0x17')]);}logger[_0x61da('0x15')](_0x61da('0x10'),_0x2c43c2,_0x2c7da4[_0x61da('0x15')]['message']);return _0x352ac4(_0x2c7da4[_0x61da('0x15')]['message']);}else{logger[_0x61da('0xf')](_0x61da('0x10'),_0x2c43c2,'request\x20sent');_0x352ac4(_0x2c7da4['result'][_0x61da('0x17')]);}})[_0x61da('0x18')](function(_0x46d2c4){logger[_0x61da('0x15')](_0x61da('0x10'),_0x2c43c2,_0x46d2c4);_0x1a63b2(_0x46d2c4);});});} \ No newline at end of file +var _0xe644=['../../config/logger','rpc','../../config/environment','jayson/promise','client','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x55ffee,_0x1862c1){var _0x27992d=function(_0x3cd3d9){while(--_0x3cd3d9){_0x55ffee['push'](_0x55ffee['shift']());}};_0x27992d(++_0x1862c1);}(_0xe644,0x159));var _0x4e64=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe644[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4e64('0x0'));var util=require(_0x4e64('0x1'));var moment=require(_0x4e64('0x2'));var BPromise=require(_0x4e64('0x3'));var rs=require(_0x4e64('0x4'));var fs=require('fs');var Redis=require(_0x4e64('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4e64('0x6'));var logger=require(_0x4e64('0x7'))(_0x4e64('0x8'));var config=require(_0x4e64('0x9'));var jayson=require(_0x4e64('0xa'));var client=jayson[_0x4e64('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x66faf,_0x12c40d,_0x5cce6e){return new BPromise(function(_0x4d5aa6,_0x8573c1){return client['request'](_0x66faf,_0x5cce6e)['then'](function(_0x2ebcfe){logger[_0x4e64('0xc')](_0x4e64('0xd'),_0x12c40d,_0x4e64('0xe'));logger[_0x4e64('0xf')](_0x4e64('0x10'),_0x12c40d,'request\x20sent',JSON[_0x4e64('0x11')](_0x2ebcfe));if(_0x2ebcfe[_0x4e64('0x12')]){if(_0x2ebcfe['error'][_0x4e64('0x13')]===0x1f4){logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x12c40d,_0x2ebcfe[_0x4e64('0x12')]['message']);return _0x8573c1(_0x2ebcfe[_0x4e64('0x12')][_0x4e64('0x14')]);}logger[_0x4e64('0x12')](_0x4e64('0xd'),_0x12c40d,_0x2ebcfe[_0x4e64('0x12')][_0x4e64('0x14')]);return _0x4d5aa6(_0x2ebcfe[_0x4e64('0x12')]['message']);}else{logger[_0x4e64('0xc')](_0x4e64('0xd'),_0x12c40d,_0x4e64('0xe'));_0x4d5aa6(_0x2ebcfe['result'][_0x4e64('0x14')]);}})[_0x4e64('0x15')](function(_0x452f34){logger[_0x4e64('0x12')](_0x4e64('0xd'),_0x12c40d,_0x452f34);_0x8573c1(_0x452f34);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index a634e56..0df8848 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 _0xdd19=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','isAuthenticated','index','show','post','create','put','/:id','update','exports','multer','util','Router'];(function(_0x5f4f9f,_0x587dda){var _0x4ad986=function(_0x3e6b58){while(--_0x3e6b58){_0x5f4f9f['push'](_0x5f4f9f['shift']());}};_0x4ad986(++_0x587dda);}(_0xdd19,0xdd));var _0x9dd1=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xdd19[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require(_0x9dd1('0x0'));var util=require(_0x9dd1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9dd1('0x2')]();var auth=require(_0x9dd1('0x3'));var interaction=require(_0x9dd1('0x4'));var config=require(_0x9dd1('0x5'));var controller=require(_0x9dd1('0x6'));router['get']('/',auth[_0x9dd1('0x7')](),controller[_0x9dd1('0x8')]);router['get']('/:id',auth[_0x9dd1('0x7')](),controller[_0x9dd1('0x9')]);router[_0x9dd1('0xa')]('/',auth[_0x9dd1('0x7')](),controller[_0x9dd1('0xb')]);router[_0x9dd1('0xc')](_0x9dd1('0xd'),auth[_0x9dd1('0x7')](),controller[_0x9dd1('0xe')]);router['delete'](_0x9dd1('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x9dd1('0xf')]=router; \ No newline at end of file +var _0xba32=['delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','./intDeskField.controller','get','isAuthenticated','index','show','post','put','/:id','update'];(function(_0x16d49e,_0x28af64){var _0x36dd9d=function(_0x585046){while(--_0x585046){_0x16d49e['push'](_0x16d49e['shift']());}};_0x36dd9d(++_0x28af64);}(_0xba32,0x1a1));var _0x2ba3=function(_0x405e13,_0x1ed8d3){_0x405e13=_0x405e13-0x0;var _0x5eb8a5=_0xba32[_0x405e13];return _0x5eb8a5;};'use strict';var multer=require(_0x2ba3('0x0'));var util=require(_0x2ba3('0x1'));var path=require(_0x2ba3('0x2'));var timeout=require('connect-timeout');var express=require(_0x2ba3('0x3'));var router=express[_0x2ba3('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x2ba3('0x5'));var config=require('../../config/environment');var controller=require(_0x2ba3('0x6'));router[_0x2ba3('0x7')]('/',auth[_0x2ba3('0x8')](),controller[_0x2ba3('0x9')]);router[_0x2ba3('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x2ba3('0xa')]);router[_0x2ba3('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2ba3('0xc')](_0x2ba3('0xd'),auth[_0x2ba3('0x8')](),controller[_0x2ba3('0xe')]);router[_0x2ba3('0xf')](_0x2ba3('0xd'),auth[_0x2ba3('0x8')](),controller[_0x2ba3('0x10')]);module[_0x2ba3('0x11')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index c3ea861..7f614e3 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 _0x8e56=['BOOLEAN','exports','string','variable','STRING','ENUM','customVariable'];(function(_0x458ed6,_0x504646){var _0xa5dfd9=function(_0x504e7b){while(--_0x504e7b){_0x458ed6['push'](_0x458ed6['shift']());}};_0xa5dfd9(++_0x504646);}(_0x8e56,0x71));var _0x68e5=function(_0x663eaf,_0xe5b1){_0x663eaf=_0x663eaf-0x0;var _0x305c8a=_0x8e56[_0x663eaf];return _0x305c8a;};'use strict';var Sequelize=require('sequelize');module[_0x68e5('0x0')]={'type':{'type':Sequelize['ENUM'](_0x68e5('0x1'),_0x68e5('0x2'),'customVariable','keyValue'),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x68e5('0x3')]},'keyType':{'type':Sequelize[_0x68e5('0x4')](_0x68e5('0x1'),_0x68e5('0x2'),_0x68e5('0x5'))},'keyContent':{'type':Sequelize[_0x68e5('0x3')]},'idField':{'type':Sequelize[_0x68e5('0x3')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x68e5('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x68e5('0x3')]}}; \ No newline at end of file +var _0xfb27=['sequelize','exports','ENUM','variable','keyValue','string','STRING','customVariable','BOOLEAN'];(function(_0x37a2f7,_0x381297){var _0x155894=function(_0x382325){while(--_0x382325){_0x37a2f7['push'](_0x37a2f7['shift']());}};_0x155894(++_0x381297);}(_0xfb27,0xbd));var _0x7fb2=function(_0x50a330,_0x2e003c){_0x50a330=_0x50a330-0x0;var _0x475636=_0xfb27[_0x50a330];return _0x475636;};'use strict';var Sequelize=require(_0x7fb2('0x0'));module[_0x7fb2('0x1')]={'type':{'type':Sequelize[_0x7fb2('0x2')]('string',_0x7fb2('0x3'),'customVariable',_0x7fb2('0x4')),'defaultValue':_0x7fb2('0x5')},'content':{'type':Sequelize[_0x7fb2('0x6')]},'key':{'type':Sequelize[_0x7fb2('0x6')]},'keyType':{'type':Sequelize[_0x7fb2('0x2')](_0x7fb2('0x5'),_0x7fb2('0x3'),_0x7fb2('0x7'))},'keyContent':{'type':Sequelize[_0x7fb2('0x6')]},'idField':{'type':Sequelize[_0x7fb2('0x6')]},'nameField':{'type':Sequelize[_0x7fb2('0x6')]},'customField':{'type':Sequelize[_0x7fb2('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7fb2('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 2031131..e46bcc9 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 _0x82ec=['key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','include','find','create','body','update','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','index','map','DeskField','rawAttributes','type'];(function(_0x5e1538,_0x3ea836){var _0x3f4943=function(_0x4ea2ae){while(--_0x4ea2ae){_0x5e1538['push'](_0x5e1538['shift']());}};_0x3f4943(++_0x3ea836);}(_0x82ec,0x1c0));var _0xc82e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x82ec[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xc82e('0x0'));var zipdir=require(_0xc82e('0x1'));var jsonpatch=require(_0xc82e('0x2'));var rp=require(_0xc82e('0x3'));var moment=require(_0xc82e('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xc82e('0x5'));var sox=require(_0xc82e('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xc82e('0x7'));var squel=require(_0xc82e('0x8'));var crypto=require('crypto');var jsforce=require(_0xc82e('0x9'));var deskjs=require(_0xc82e('0xa'));var toCsv=require('to-csv');var querystring=require(_0xc82e('0xb'));var Papa=require(_0xc82e('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc82e('0xd'));var as=require(_0xc82e('0xe'));var hardwareService=require(_0xc82e('0xf'));var logger=require(_0xc82e('0x10'))(_0xc82e('0x11'));var utils=require('../../config/utils');var config=require(_0xc82e('0x12'));var db=require(_0xc82e('0x13'))['db'];function respondWithStatusCode(_0x3b9a69,_0x5266a){_0x5266a=_0x5266a||0xcc;return function(_0x29546f){if(_0x29546f){return _0x3b9a69[_0xc82e('0x14')](_0x5266a);}return _0x3b9a69[_0xc82e('0x15')](_0x5266a)['end']();};}function respondWithResult(_0x531c2c,_0x16a9c3){_0x16a9c3=_0x16a9c3||0xc8;return function(_0x853e28){if(_0x853e28){return _0x531c2c[_0xc82e('0x15')](_0x16a9c3)[_0xc82e('0x16')](_0x853e28);}};}function respondWithFilteredResult(_0x1da669,_0xf15795){return function(_0x570a3f){if(_0x570a3f){var _0x4c6d18=_0x570a3f[_0xc82e('0x17')],_0x338ca9=_0xf15795[_0xc82e('0x18')],_0x23bf39=_0xf15795[_0xc82e('0x18')]+_0xf15795[_0xc82e('0x19')],_0x5072eb;if(_0x23bf39>=_0x4c6d18){_0x23bf39=_0x4c6d18;_0x5072eb=0xc8;}else{_0x5072eb=0xce;}_0x1da669['status'](_0x5072eb);return _0x1da669[_0xc82e('0x1a')](_0xc82e('0x1b'),_0x338ca9+'-'+_0x23bf39+'/'+_0x4c6d18)[_0xc82e('0x16')](_0x570a3f);}return null;};}function patchUpdates(_0x2ccd3b){return function(_0x5a26f7){try{jsonpatch[_0xc82e('0x1c')](_0x5a26f7,_0x2ccd3b,!![]);}catch(_0x209652){return BPromise[_0xc82e('0x1d')](_0x209652);}return _0x5a26f7[_0xc82e('0x1e')]();};}function saveUpdates(_0x5d4c3d,_0x2d2946){return function(_0xf31008){if(_0xf31008){return _0xf31008['update'](_0x5d4c3d)[_0xc82e('0x1f')](function(_0x2a8bbf){return _0x2a8bbf;});}return null;};}function removeEntity(_0x8f20c7,_0x5f5d95){return function(_0x152426){if(_0x152426){return _0x152426[_0xc82e('0x20')]()['then'](function(){_0x8f20c7[_0xc82e('0x15')](0xcc)[_0xc82e('0x21')]();});}};}function handleEntityNotFound(_0x2899fd,_0x4dca68){return function(_0x54222b){if(!_0x54222b){_0x2899fd['sendStatus'](0x194);}return _0x54222b;};}function handleError(_0x343b95,_0x15acc8){_0x15acc8=_0x15acc8||0x1f4;return function(_0x44f778){logger[_0xc82e('0x22')](_0x44f778[_0xc82e('0x23')]);if(_0x44f778[_0xc82e('0x24')]){delete _0x44f778[_0xc82e('0x24')];}_0x343b95['status'](_0x15acc8)['send'](_0x44f778);};}exports[_0xc82e('0x25')]=function(_0x91bcc,_0x25cada){var _0x12e3b9={},_0x649af2={},_0x353a56={'count':0x0,'rows':[]};var _0x5c8e2d=_[_0xc82e('0x26')](db[_0xc82e('0x27')][_0xc82e('0x28')],function(_0x2b24b4){return{'name':_0x2b24b4['fieldName'],'type':_0x2b24b4[_0xc82e('0x29')][_0xc82e('0x2a')]};});_0x649af2[_0xc82e('0x2b')]=_[_0xc82e('0x26')](_0x5c8e2d,_0xc82e('0x24'));_0x649af2[_0xc82e('0x2c')]=_[_0xc82e('0x2d')](_0x91bcc[_0xc82e('0x2c')]);_0x649af2[_0xc82e('0x2e')]=_[_0xc82e('0x2f')](_0x649af2[_0xc82e('0x2b')],_0x649af2[_0xc82e('0x2c')]);_0x12e3b9[_0xc82e('0x30')]=_['intersection'](_0x649af2['model'],qs[_0xc82e('0x31')](_0x91bcc['query']['fields']));_0x12e3b9['attributes']=_0x12e3b9[_0xc82e('0x30')][_0xc82e('0x32')]?_0x12e3b9[_0xc82e('0x30')]:_0x649af2['model'];if(!_0x91bcc[_0xc82e('0x2c')]['hasOwnProperty'](_0xc82e('0x33'))){_0x12e3b9[_0xc82e('0x19')]=qs[_0xc82e('0x19')](_0x91bcc[_0xc82e('0x2c')][_0xc82e('0x19')]);_0x12e3b9[_0xc82e('0x18')]=qs['offset'](_0x91bcc[_0xc82e('0x2c')]['offset']);}_0x12e3b9[_0xc82e('0x34')]=qs[_0xc82e('0x35')](_0x91bcc['query']['sort']);_0x12e3b9[_0xc82e('0x36')]=qs[_0xc82e('0x2e')](_[_0xc82e('0x37')](_0x91bcc[_0xc82e('0x2c')],_0x649af2[_0xc82e('0x2e')]));if(_0x91bcc[_0xc82e('0x2c')][_0xc82e('0x38')]){_0x12e3b9[_0xc82e('0x36')]=_[_0xc82e('0x39')](_0x12e3b9[_0xc82e('0x36')],{'$or':_[_0xc82e('0x26')](_0x5c8e2d,function(_0x2e4716){if(_0x2e4716['type']['key']!==_0xc82e('0x3a')){var _0x56669c={};_0x56669c[_0x2e4716['field']]={'$like':'%'+_0x91bcc[_0xc82e('0x2c')][_0xc82e('0x38')]+'%'};return _0x56669c;}})});}_0x12e3b9=_[_0xc82e('0x39')]({},_0x12e3b9,_0x91bcc[_0xc82e('0x3b')]);var _0x773bf1={'where':_0x12e3b9[_0xc82e('0x36')]};return db[_0xc82e('0x27')][_0xc82e('0x17')](_0x773bf1)[_0xc82e('0x1f')](function(_0xe9f890){_0x353a56[_0xc82e('0x17')]=_0xe9f890;if(_0x91bcc[_0xc82e('0x2c')][_0xc82e('0x3c')]){_0x12e3b9['include']=[{'all':!![]}];}return db[_0xc82e('0x27')][_0xc82e('0x3d')](_0x12e3b9);})[_0xc82e('0x1f')](function(_0x94a7b7){_0x353a56['rows']=_0x94a7b7;return _0x353a56;})['then'](respondWithFilteredResult(_0x25cada,_0x12e3b9))[_0xc82e('0x3e')](handleError(_0x25cada,null));};exports[_0xc82e('0x3f')]=function(_0x4ead3a,_0x1b69a4){var _0x1428e2={'raw':!![],'where':{'id':_0x4ead3a[_0xc82e('0x40')]['id']}},_0x140c67={};_0x140c67[_0xc82e('0x2b')]=_['keys'](db[_0xc82e('0x27')][_0xc82e('0x28')]);_0x140c67[_0xc82e('0x2c')]=_[_0xc82e('0x2d')](_0x4ead3a[_0xc82e('0x2c')]);_0x140c67[_0xc82e('0x2e')]=_[_0xc82e('0x2f')](_0x140c67[_0xc82e('0x2b')],_0x140c67[_0xc82e('0x2c')]);_0x1428e2[_0xc82e('0x30')]=_['intersection'](_0x140c67[_0xc82e('0x2b')],qs[_0xc82e('0x31')](_0x4ead3a[_0xc82e('0x2c')]['fields']));_0x1428e2[_0xc82e('0x30')]=_0x1428e2['attributes'][_0xc82e('0x32')]?_0x1428e2[_0xc82e('0x30')]:_0x140c67[_0xc82e('0x2b')];if(_0x4ead3a[_0xc82e('0x2c')]['includeAll']){_0x1428e2[_0xc82e('0x41')]=[{'all':!![]}];}_0x1428e2=_[_0xc82e('0x39')]({},_0x1428e2,_0x4ead3a[_0xc82e('0x3b')]);return db['DeskField'][_0xc82e('0x42')](_0x1428e2)[_0xc82e('0x1f')](handleEntityNotFound(_0x1b69a4,null))[_0xc82e('0x1f')](respondWithResult(_0x1b69a4,null))['catch'](handleError(_0x1b69a4,null));};exports[_0xc82e('0x43')]=function(_0x265e93,_0x2da335){return db['DeskField']['create'](_0x265e93[_0xc82e('0x44')],{})[_0xc82e('0x1f')](respondWithResult(_0x2da335,0xc9))[_0xc82e('0x3e')](handleError(_0x2da335,null));};exports[_0xc82e('0x45')]=function(_0x2a12a8,_0x218d33){if(_0x2a12a8[_0xc82e('0x44')]['id']){delete _0x2a12a8[_0xc82e('0x44')]['id'];}return db[_0xc82e('0x27')]['find']({'where':{'id':_0x2a12a8['params']['id']}})[_0xc82e('0x1f')](handleEntityNotFound(_0x218d33,null))['then'](saveUpdates(_0x2a12a8['body'],null))[_0xc82e('0x1f')](respondWithResult(_0x218d33,null))[_0xc82e('0x3e')](handleError(_0x218d33,null));};exports[_0xc82e('0x20')]=function(_0xe3c473,_0x1423d7){return db[_0xc82e('0x27')][_0xc82e('0x42')]({'where':{'id':_0xe3c473[_0xc82e('0x40')]['id']}})[_0xc82e('0x1f')](handleEntityNotFound(_0x1423d7,null))['then'](removeEntity(_0x1423d7,null))['catch'](handleError(_0x1423d7,null));}; \ No newline at end of file +var _0x0c39=['Content-Range','apply','then','end','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','where','pick','filter','merge','VIRTUAL','field','DeskField','include','findAll','rows','catch','show','params','keys','length','includeAll','options','find','create','body','update','destroy','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','lodash','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','status','json','count','offset','set'];(function(_0x534f7c,_0x3eb489){var _0x5c3e22=function(_0x5dd4a4){while(--_0x5dd4a4){_0x534f7c['push'](_0x534f7c['shift']());}};_0x5c3e22(++_0x3eb489);}(_0x0c39,0x75));var _0x90c3=function(_0x495e1e,_0x4ff02c){_0x495e1e=_0x495e1e-0x0;var _0x23eb32=_0x0c39[_0x495e1e];return _0x23eb32;};'use strict';var pdf=require(_0x90c3('0x0'));var emlformat=require(_0x90c3('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x90c3('0x2'));var jsonpatch=require(_0x90c3('0x3'));var rp=require(_0x90c3('0x4'));var moment=require(_0x90c3('0x5'));var BPromise=require(_0x90c3('0x6'));var Mustache=require(_0x90c3('0x7'));var util=require(_0x90c3('0x8'));var path=require('path');var sox=require(_0x90c3('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x90c3('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x90c3('0xb'));var deskjs=require(_0x90c3('0xc'));var toCsv=require(_0x90c3('0xd'));var querystring=require(_0x90c3('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x90c3('0xf'));var qs=require(_0x90c3('0x10'));var as=require(_0x90c3('0x11'));var hardwareService=require(_0x90c3('0x12'));var logger=require(_0x90c3('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x90c3('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4d0de2,_0x202dec){_0x202dec=_0x202dec||0xcc;return function(_0x3bfe13){if(_0x3bfe13){return _0x4d0de2[_0x90c3('0x15')](_0x202dec);}return _0x4d0de2[_0x90c3('0x16')](_0x202dec)['end']();};}function respondWithResult(_0x344844,_0x2a2984){_0x2a2984=_0x2a2984||0xc8;return function(_0x355deb){if(_0x355deb){return _0x344844[_0x90c3('0x16')](_0x2a2984)[_0x90c3('0x17')](_0x355deb);}};}function respondWithFilteredResult(_0xb193f7,_0x1274f2){return function(_0x3ba000){if(_0x3ba000){var _0x11fada=_0x3ba000[_0x90c3('0x18')],_0x21ba58=_0x1274f2['offset'],_0x3da912=_0x1274f2[_0x90c3('0x19')]+_0x1274f2['limit'],_0xf826cf;if(_0x3da912>=_0x11fada){_0x3da912=_0x11fada;_0xf826cf=0xc8;}else{_0xf826cf=0xce;}_0xb193f7[_0x90c3('0x16')](_0xf826cf);return _0xb193f7[_0x90c3('0x1a')](_0x90c3('0x1b'),_0x21ba58+'-'+_0x3da912+'/'+_0x11fada)['json'](_0x3ba000);}return null;};}function patchUpdates(_0x1c2df4){return function(_0x361d96){try{jsonpatch[_0x90c3('0x1c')](_0x361d96,_0x1c2df4,!![]);}catch(_0x45df01){return BPromise['reject'](_0x45df01);}return _0x361d96['save']();};}function saveUpdates(_0x3eb8e6,_0x58a829){return function(_0x2f7e8b){if(_0x2f7e8b){return _0x2f7e8b['update'](_0x3eb8e6)[_0x90c3('0x1d')](function(_0x4f566c){return _0x4f566c;});}return null;};}function removeEntity(_0x3f0230,_0x6bdc40){return function(_0x4e6ced){if(_0x4e6ced){return _0x4e6ced['destroy']()['then'](function(){_0x3f0230['status'](0xcc)[_0x90c3('0x1e')]();});}};}function handleEntityNotFound(_0xa07bb7,_0x185fcb){return function(_0x1d3b25){if(!_0x1d3b25){_0xa07bb7['sendStatus'](0x194);}return _0x1d3b25;};}function handleError(_0x35df35,_0x516cd9){_0x516cd9=_0x516cd9||0x1f4;return function(_0x491dbe){logger['error'](_0x491dbe[_0x90c3('0x1f')]);if(_0x491dbe[_0x90c3('0x20')]){delete _0x491dbe[_0x90c3('0x20')];}_0x35df35[_0x90c3('0x16')](_0x516cd9)[_0x90c3('0x21')](_0x491dbe);};}exports[_0x90c3('0x22')]=function(_0x377cee,_0x134688){var _0x169299={},_0x555c23={},_0x40e712={'count':0x0,'rows':[]};var _0x1c133b=_[_0x90c3('0x23')](db['DeskField'][_0x90c3('0x24')],function(_0x2c1fa6){return{'name':_0x2c1fa6[_0x90c3('0x25')],'type':_0x2c1fa6[_0x90c3('0x26')][_0x90c3('0x27')]};});_0x555c23[_0x90c3('0x28')]=_['map'](_0x1c133b,_0x90c3('0x20'));_0x555c23[_0x90c3('0x29')]=_['keys'](_0x377cee[_0x90c3('0x29')]);_0x555c23[_0x90c3('0x2a')]=_[_0x90c3('0x2b')](_0x555c23['model'],_0x555c23['query']);_0x169299[_0x90c3('0x2c')]=_['intersection'](_0x555c23[_0x90c3('0x28')],qs[_0x90c3('0x2d')](_0x377cee[_0x90c3('0x29')]['fields']));_0x169299[_0x90c3('0x2c')]=_0x169299['attributes']['length']?_0x169299[_0x90c3('0x2c')]:_0x555c23[_0x90c3('0x28')];if(!_0x377cee[_0x90c3('0x29')][_0x90c3('0x2e')](_0x90c3('0x2f'))){_0x169299[_0x90c3('0x30')]=qs['limit'](_0x377cee[_0x90c3('0x29')][_0x90c3('0x30')]);_0x169299['offset']=qs[_0x90c3('0x19')](_0x377cee[_0x90c3('0x29')][_0x90c3('0x19')]);}_0x169299[_0x90c3('0x31')]=qs['sort'](_0x377cee['query']['sort']);_0x169299[_0x90c3('0x32')]=qs[_0x90c3('0x2a')](_[_0x90c3('0x33')](_0x377cee[_0x90c3('0x29')],_0x555c23[_0x90c3('0x2a')]));if(_0x377cee['query'][_0x90c3('0x34')]){_0x169299[_0x90c3('0x32')]=_[_0x90c3('0x35')](_0x169299[_0x90c3('0x32')],{'$or':_[_0x90c3('0x23')](_0x1c133b,function(_0x33670a){if(_0x33670a[_0x90c3('0x26')][_0x90c3('0x27')]!==_0x90c3('0x36')){var _0x589192={};_0x589192[_0x33670a[_0x90c3('0x37')]]={'$like':'%'+_0x377cee['query'][_0x90c3('0x34')]+'%'};return _0x589192;}})});}_0x169299=_[_0x90c3('0x35')]({},_0x169299,_0x377cee['options']);var _0x190d65={'where':_0x169299[_0x90c3('0x32')]};return db[_0x90c3('0x38')]['count'](_0x190d65)[_0x90c3('0x1d')](function(_0x379c3b){_0x40e712[_0x90c3('0x18')]=_0x379c3b;if(_0x377cee[_0x90c3('0x29')]['includeAll']){_0x169299[_0x90c3('0x39')]=[{'all':!![]}];}return db[_0x90c3('0x38')][_0x90c3('0x3a')](_0x169299);})[_0x90c3('0x1d')](function(_0x37c96b){_0x40e712[_0x90c3('0x3b')]=_0x37c96b;return _0x40e712;})[_0x90c3('0x1d')](respondWithFilteredResult(_0x134688,_0x169299))[_0x90c3('0x3c')](handleError(_0x134688,null));};exports[_0x90c3('0x3d')]=function(_0x4df57e,_0x3d51cb){var _0x57a9c3={'raw':!![],'where':{'id':_0x4df57e[_0x90c3('0x3e')]['id']}},_0x10b0a5={};_0x10b0a5[_0x90c3('0x28')]=_[_0x90c3('0x3f')](db[_0x90c3('0x38')][_0x90c3('0x24')]);_0x10b0a5[_0x90c3('0x29')]=_[_0x90c3('0x3f')](_0x4df57e[_0x90c3('0x29')]);_0x10b0a5['filters']=_[_0x90c3('0x2b')](_0x10b0a5['model'],_0x10b0a5[_0x90c3('0x29')]);_0x57a9c3['attributes']=_[_0x90c3('0x2b')](_0x10b0a5[_0x90c3('0x28')],qs[_0x90c3('0x2d')](_0x4df57e[_0x90c3('0x29')][_0x90c3('0x2d')]));_0x57a9c3[_0x90c3('0x2c')]=_0x57a9c3[_0x90c3('0x2c')][_0x90c3('0x40')]?_0x57a9c3[_0x90c3('0x2c')]:_0x10b0a5['model'];if(_0x4df57e[_0x90c3('0x29')][_0x90c3('0x41')]){_0x57a9c3[_0x90c3('0x39')]=[{'all':!![]}];}_0x57a9c3=_[_0x90c3('0x35')]({},_0x57a9c3,_0x4df57e[_0x90c3('0x42')]);return db[_0x90c3('0x38')][_0x90c3('0x43')](_0x57a9c3)['then'](handleEntityNotFound(_0x3d51cb,null))[_0x90c3('0x1d')](respondWithResult(_0x3d51cb,null))[_0x90c3('0x3c')](handleError(_0x3d51cb,null));};exports[_0x90c3('0x44')]=function(_0x39cc9c,_0x3150b3){return db[_0x90c3('0x38')][_0x90c3('0x44')](_0x39cc9c[_0x90c3('0x45')],{})[_0x90c3('0x1d')](respondWithResult(_0x3150b3,0xc9))[_0x90c3('0x3c')](handleError(_0x3150b3,null));};exports[_0x90c3('0x46')]=function(_0x19e643,_0x366f69){if(_0x19e643['body']['id']){delete _0x19e643[_0x90c3('0x45')]['id'];}return db['DeskField'][_0x90c3('0x43')]({'where':{'id':_0x19e643[_0x90c3('0x3e')]['id']}})[_0x90c3('0x1d')](handleEntityNotFound(_0x366f69,null))[_0x90c3('0x1d')](saveUpdates(_0x19e643[_0x90c3('0x45')],null))[_0x90c3('0x1d')](respondWithResult(_0x366f69,null))[_0x90c3('0x3c')](handleError(_0x366f69,null));};exports[_0x90c3('0x47')]=function(_0x443ba9,_0x2f255a){return db[_0x90c3('0x38')][_0x90c3('0x43')]({'where':{'id':_0x443ba9[_0x90c3('0x3e')]['id']}})[_0x90c3('0x1d')](handleEntityNotFound(_0x2f255a,null))[_0x90c3('0x1d')](removeEntity(_0x2f255a,null))[_0x90c3('0x3c')](handleError(_0x2f255a,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index fa132d3..a10e5a8 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 _0x5095=['rimraf','../../config/environment','./intDeskField.attributes','exports','define','DeskField','desk_unique_index','idField','FieldId','util','../../config/logger','bluebird','request-promise','path'];(function(_0x329df2,_0x225747){var _0x513a18=function(_0x444fde){while(--_0x444fde){_0x329df2['push'](_0x329df2['shift']());}};_0x513a18(++_0x225747);}(_0x5095,0x6b));var _0x5509=function(_0x503941,_0xeae209){_0x503941=_0x503941-0x0;var _0x46082a=_0x5095[_0x503941];return _0x46082a;};'use strict';var _=require('lodash');var util=require(_0x5509('0x0'));var logger=require(_0x5509('0x1'))('api');var moment=require('moment');var BPromise=require(_0x5509('0x2'));var rp=require(_0x5509('0x3'));var fs=require('fs');var path=require(_0x5509('0x4'));var rimraf=require(_0x5509('0x5'));var config=require(_0x5509('0x6'));var attributes=require(_0x5509('0x7'));module[_0x5509('0x8')]=function(_0x138e9e,_0x9b1d5a){return _0x138e9e[_0x5509('0x9')](_0x5509('0xa'),attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':_0x5509('0xb'),'fields':[_0x5509('0xc'),_0x5509('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbde3=['define','int_desk_fields','desk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDeskField.attributes'];(function(_0x1b8f04,_0x56dbb7){var _0x28ef77=function(_0x4eb575){while(--_0x4eb575){_0x1b8f04['push'](_0x1b8f04['shift']());}};_0x28ef77(++_0x56dbb7);}(_0xbde3,0x1c7));var _0x3bde=function(_0x1009c6,_0x548277){_0x1009c6=_0x1009c6-0x0;var _0x40dc08=_0xbde3[_0x1009c6];return _0x40dc08;};'use strict';var _=require(_0x3bde('0x0'));var util=require(_0x3bde('0x1'));var logger=require(_0x3bde('0x2'))(_0x3bde('0x3'));var moment=require(_0x3bde('0x4'));var BPromise=require(_0x3bde('0x5'));var rp=require(_0x3bde('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3bde('0x7'));var config=require(_0x3bde('0x8'));var attributes=require(_0x3bde('0x9'));module['exports']=function(_0x31634a,_0x32ee74){return _0x31634a[_0x3bde('0xa')]('DeskField',attributes,{'tableName':_0x3bde('0xb'),'paranoid':![],'indexes':[{'name':_0x3bde('0xc'),'fields':[_0x3bde('0xd'),_0x3bde('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js index 053dadd..d0f3a79 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 _0x109a=['bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','error','code','DeskField,\x20%s,\x20%s','message','result','catch','lodash','util','moment'];(function(_0x1fd8b3,_0x1c9469){var _0x7455e7=function(_0x3a9c91){while(--_0x3a9c91){_0x1fd8b3['push'](_0x1fd8b3['shift']());}};_0x7455e7(++_0x1c9469);}(_0x109a,0x16d));var _0xa109=function(_0x5f225f,_0x5c6b35){_0x5f225f=_0x5f225f-0x0;var _0x5cb055=_0x109a[_0x5f225f];return _0x5cb055;};'use strict';var _=require(_0xa109('0x0'));var util=require(_0xa109('0x1'));var moment=require(_0xa109('0x2'));var BPromise=require(_0xa109('0x3'));var rs=require(_0xa109('0x4'));var fs=require('fs');var Redis=require(_0xa109('0x5'));var db=require(_0xa109('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa109('0x7'));var config=require(_0xa109('0x8'));var jayson=require(_0xa109('0x9'));var client=jayson[_0xa109('0xa')][_0xa109('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x33e7ef,_0x52afd6,_0xbb597a){return new BPromise(function(_0x309ef5,_0x1e2425){return client[_0xa109('0xc')](_0x33e7ef,_0xbb597a)[_0xa109('0xd')](function(_0x3a7646){logger['info']('DeskField,\x20%s,\x20%s',_0x52afd6,_0xa109('0xe'));logger[_0xa109('0xf')](_0xa109('0x10'),_0x52afd6,_0xa109('0xe'),JSON['stringify'](_0x3a7646));if(_0x3a7646[_0xa109('0x11')]){if(_0x3a7646[_0xa109('0x11')][_0xa109('0x12')]===0x1f4){logger['error'](_0xa109('0x13'),_0x52afd6,_0x3a7646[_0xa109('0x11')]['message']);return _0x1e2425(_0x3a7646[_0xa109('0x11')][_0xa109('0x14')]);}logger[_0xa109('0x11')]('DeskField,\x20%s,\x20%s',_0x52afd6,_0x3a7646[_0xa109('0x11')][_0xa109('0x14')]);return _0x309ef5(_0x3a7646[_0xa109('0x11')][_0xa109('0x14')]);}else{logger['info'](_0xa109('0x13'),_0x52afd6,_0xa109('0xe'));_0x309ef5(_0x3a7646[_0xa109('0x15')]['message']);}})[_0xa109('0x16')](function(_0x1e5c09){logger[_0xa109('0x11')](_0xa109('0x13'),_0x52afd6,_0x1e5c09);_0x1e2425(_0x1e5c09);});});} \ No newline at end of file +var _0xc80b=['jayson/promise','client','http','request','then','info','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xc80b,0x1a5));var _0xbc80=function(_0x19c253,_0x4ba2ee){_0x19c253=_0x19c253-0x0;var _0x592285=_0xc80b[_0x19c253];return _0x592285;};'use strict';var _=require(_0xbc80('0x0'));var util=require(_0xbc80('0x1'));var moment=require(_0xbc80('0x2'));var BPromise=require(_0xbc80('0x3'));var rs=require(_0xbc80('0x4'));var fs=require('fs');var Redis=require(_0xbc80('0x5'));var db=require(_0xbc80('0x6'))['db'];var utils=require(_0xbc80('0x7'));var logger=require(_0xbc80('0x8'))(_0xbc80('0x9'));var config=require(_0xbc80('0xa'));var jayson=require(_0xbc80('0xb'));var client=jayson[_0xbc80('0xc')][_0xbc80('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x46d9ef,_0x2e8378,_0x34cebf){return new BPromise(function(_0x3768f9,_0x5ec372){return client[_0xbc80('0xe')](_0x46d9ef,_0x34cebf)[_0xbc80('0xf')](function(_0x50a1ae){logger[_0xbc80('0x10')]('DeskField,\x20%s,\x20%s',_0x2e8378,_0xbc80('0x11'));logger[_0xbc80('0x12')](_0xbc80('0x13'),_0x2e8378,_0xbc80('0x11'),JSON[_0xbc80('0x14')](_0x50a1ae));if(_0x50a1ae['error']){if(_0x50a1ae[_0xbc80('0x15')][_0xbc80('0x16')]===0x1f4){logger[_0xbc80('0x15')](_0xbc80('0x17'),_0x2e8378,_0x50a1ae[_0xbc80('0x15')][_0xbc80('0x18')]);return _0x5ec372(_0x50a1ae[_0xbc80('0x15')][_0xbc80('0x18')]);}logger['error'](_0xbc80('0x17'),_0x2e8378,_0x50a1ae[_0xbc80('0x15')][_0xbc80('0x18')]);return _0x3768f9(_0x50a1ae['error'][_0xbc80('0x18')]);}else{logger['info'](_0xbc80('0x17'),_0x2e8378,'request\x20sent');_0x3768f9(_0x50a1ae[_0xbc80('0x19')][_0xbc80('0x18')]);}})[_0xbc80('0x1a')](function(_0x4efeda){logger['error'](_0xbc80('0x17'),_0x2e8378,_0x4efeda);_0x5ec372(_0x4efeda);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 67ddd21..64e9f55 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 _0x0948=['path','express','Router','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','delete','destroy','exports','multer','util'];(function(_0x5da11b,_0xe47f15){var _0x174c2a=function(_0x4a2d23){while(--_0x4a2d23){_0x5da11b['push'](_0x5da11b['shift']());}};_0x174c2a(++_0xe47f15);}(_0x0948,0x1cc));var _0x8094=function(_0x159f91,_0xe8a30f){_0x159f91=_0x159f91-0x0;var _0x26bd65=_0x0948[_0x159f91];return _0x26bd65;};'use strict';var multer=require(_0x8094('0x0'));var util=require(_0x8094('0x1'));var path=require(_0x8094('0x2'));var timeout=require('connect-timeout');var express=require(_0x8094('0x3'));var router=express[_0x8094('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x8094('0x5'));var config=require(_0x8094('0x6'));var controller=require(_0x8094('0x7'));router[_0x8094('0x8')]('/',auth[_0x8094('0x9')](),controller[_0x8094('0xa')]);router[_0x8094('0x8')](_0x8094('0xb'),auth[_0x8094('0x9')](),controller[_0x8094('0xc')]);router[_0x8094('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x8094('0xd')]);router[_0x8094('0x8')](_0x8094('0xe'),auth[_0x8094('0x9')](),controller[_0x8094('0xf')]);router[_0x8094('0x10')]('/',auth[_0x8094('0x9')](),controller[_0x8094('0x11')]);router[_0x8094('0x10')](_0x8094('0x12'),auth['isAuthenticated'](),controller['addConfiguration']);router['put']('/:id',auth[_0x8094('0x9')](),controller['update']);router[_0x8094('0x13')]('/:id',auth[_0x8094('0x9')](),controller[_0x8094('0x14')]);module[_0x8094('0x15')]=router; \ No newline at end of file +var _0xfa6c=['/:id/fields','post','create','/:id/configurations','addConfiguration','put','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','./intDynamics365Account.controller','isAuthenticated','index','get','/:id','show','getConfigurations'];(function(_0x58a4ac,_0x43fd42){var _0x545810=function(_0x308e65){while(--_0x308e65){_0x58a4ac['push'](_0x58a4ac['shift']());}};_0x545810(++_0x43fd42);}(_0xfa6c,0xbb));var _0xcfa6=function(_0x1e2437,_0x77580){_0x1e2437=_0x1e2437-0x0;var _0x2f4a27=_0xfa6c[_0x1e2437];return _0x2f4a27;};'use strict';var multer=require(_0xcfa6('0x0'));var util=require(_0xcfa6('0x1'));var path=require(_0xcfa6('0x2'));var timeout=require(_0xcfa6('0x3'));var express=require(_0xcfa6('0x4'));var router=express['Router']();var auth=require(_0xcfa6('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xcfa6('0x6'));router['get']('/',auth[_0xcfa6('0x7')](),controller[_0xcfa6('0x8')]);router[_0xcfa6('0x9')](_0xcfa6('0xa'),auth['isAuthenticated'](),controller[_0xcfa6('0xb')]);router[_0xcfa6('0x9')]('/:id/configurations',auth[_0xcfa6('0x7')](),controller[_0xcfa6('0xc')]);router[_0xcfa6('0x9')](_0xcfa6('0xd'),auth['isAuthenticated'](),controller['getFields']);router[_0xcfa6('0xe')]('/',auth[_0xcfa6('0x7')](),controller[_0xcfa6('0xf')]);router[_0xcfa6('0xe')](_0xcfa6('0x10'),auth['isAuthenticated'](),controller[_0xcfa6('0x11')]);router[_0xcfa6('0x12')]('/:id',auth[_0xcfa6('0x7')](),controller['update']);router['delete']('/:id',auth[_0xcfa6('0x7')](),controller[_0xcfa6('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index ddabb26..8b76439 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 _0x7a53=['STRING'];(function(_0x12fde3,_0x4800c6){var _0x521038=function(_0x2ea066){while(--_0x2ea066){_0x12fde3['push'](_0x12fde3['shift']());}};_0x521038(++_0x4800c6);}(_0x7a53,0x155));var _0x37a5=function(_0x21cb56,_0xfea3f5){_0x21cb56=_0x21cb56-0x0;var _0x33e54a=_0x7a53[_0x21cb56];return _0x33e54a;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x37a5('0x0')]},'password':{'type':Sequelize[_0x37a5('0x0')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize[_0x37a5('0x0')]},'clientId':{'type':Sequelize[_0x37a5('0x0')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x37a5('0x0')]},'description':{'type':Sequelize[_0x37a5('0x0')]}}; \ No newline at end of file +var _0x8f74=['STRING','sequelize','exports'];(function(_0x3818f6,_0x279e88){var _0x4adb4d=function(_0x4d3d3f){while(--_0x4d3d3f){_0x3818f6['push'](_0x3818f6['shift']());}};_0x4adb4d(++_0x279e88);}(_0x8f74,0x6a));var _0x48f7=function(_0x4516bb,_0x5a2ad9){_0x4516bb=_0x4516bb-0x0;var _0x1db84e=_0x8f74[_0x4516bb];return _0x1db84e;};'use strict';var Sequelize=require(_0x48f7('0x0'));module[_0x48f7('0x1')]={'name':{'type':Sequelize[_0x48f7('0x2')]},'username':{'type':Sequelize[_0x48f7('0x2')]},'password':{'type':Sequelize[_0x48f7('0x2')]},'remoteUri':{'type':Sequelize[_0x48f7('0x2')]},'tenantId':{'type':Sequelize[_0x48f7('0x2')]},'clientId':{'type':Sequelize[_0x48f7('0x2')]},'clientSecret':{'type':Sequelize[_0x48f7('0x2')]},'serverUrl':{'type':Sequelize[_0x48f7('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 7e7c91c..3aad419 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 _0xbddf=['destroy','sendStatus','name','send','index','map','Dynamics365Account','rawAttributes','fieldName','type','query','keys','model','attributes','intersection','fields','length','order','sort','where','filters','pick','filter','merge','key','field','includeAll','include','findAll','rows','params','options','find','create','body','getConfigurations','hasOwnProperty','nolimit','addConfiguration','AccountId','getSubjects','channel','Dynamics365Configuration','Subjects','Dynamics365Field','Descriptions','getFields','ticketType','incident','Incident','title','description','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slaname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','utcconversiontimezonecode','versionnumber','username','password','remoteUri','tenantId','clientId','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','POST','/oauth2/token','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','value','MetadataId','Attributes','includes','LogicalName','forEach','@odata.type','push','all','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','concat','log','Dynamics365\x20error:\x20','statusCode','stack','Wrong\x20credentials','EntityDefinitions(',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','4.0','Label','UserLocalizedLabel','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','OptionSet','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','test','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','end','status','count','offset','limit','Content-Range','json','apply','reject','update'];(function(_0x4bd67a,_0x4f9725){var _0x2be5fb=function(_0x33e132){while(--_0x33e132){_0x4bd67a['push'](_0x4bd67a['shift']());}};_0x2be5fb(++_0x4f9725);}(_0xbddf,0xac));var _0xfbdd=function(_0x18b41f,_0x537640){_0x18b41f=_0x18b41f-0x0;var _0x2e5a2f=_0xbddf[_0x18b41f];return _0x2e5a2f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xfbdd('0x0'));var rimraf=require(_0xfbdd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfbdd('0x2'));var rp=require('request-promise');var moment=require(_0xfbdd('0x3'));var BPromise=require(_0xfbdd('0x4'));var Mustache=require('mustache');var util=require(_0xfbdd('0x5'));var path=require(_0xfbdd('0x6'));var sox=require('sox');var csv=require(_0xfbdd('0x7'));var ejs=require(_0xfbdd('0x8'));var fs=require('fs');var _=require(_0xfbdd('0x9'));var squel=require(_0xfbdd('0xa'));var crypto=require(_0xfbdd('0xb'));var jsforce=require(_0xfbdd('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xfbdd('0x7'));var querystring=require(_0xfbdd('0xd'));var Papa=require('papaparse');var Redis=require(_0xfbdd('0xe'));var authService=require(_0xfbdd('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfbdd('0x10'));var logger=require(_0xfbdd('0x11'))(_0xfbdd('0x12'));var utils=require(_0xfbdd('0x13'));var config=require(_0xfbdd('0x14'));var db=require(_0xfbdd('0x15'))['db'];var integrations=require(_0xfbdd('0x16'));var jayson=require(_0xfbdd('0x17'));var client=jayson[_0xfbdd('0x18')]['http']({'port':0x232a});function checkPasswordPattern(_0x56f1f1,_0x55c26f,_0x400908){if(_0x400908){var _0x404887=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x404887[_0xfbdd('0x19')](_0x55c26f)){return _0x56f1f1;}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 _0x56f1f1;}}function respondWithRpcPromise(_0x3b68b7,_0x3862ef,_0x4bbf23,_0x4b5c54){return new BPromise(function(_0x462e33,_0x5c4668){var _0x274289=_0x4b5c54||client;return _0x274289['request'](_0x3b68b7,_0x4bbf23)[_0xfbdd('0x1a')](function(_0x4496b6){logger[_0xfbdd('0x1b')](_0xfbdd('0x1c'),_0x3862ef,_0xfbdd('0x1d'));logger[_0xfbdd('0x1e')](_0xfbdd('0x1f'),_0x3862ef,_0xfbdd('0x1d'),JSON['stringify'](_0x4496b6));if(_0x4496b6[_0xfbdd('0x20')]){if(_0x4496b6[_0xfbdd('0x20')][_0xfbdd('0x21')]===0x1f4){logger[_0xfbdd('0x20')]('Dynamics365Account,\x20%s,\x20%s',_0x3862ef,_0x4496b6[_0xfbdd('0x20')][_0xfbdd('0x22')]);return _0x5c4668(_0x4496b6[_0xfbdd('0x20')]['message']);}logger[_0xfbdd('0x20')](_0xfbdd('0x1c'),_0x3862ef,_0x4496b6[_0xfbdd('0x20')][_0xfbdd('0x22')]);return _0x462e33(_0x4496b6[_0xfbdd('0x20')][_0xfbdd('0x22')]);}else{logger[_0xfbdd('0x1b')]('Dynamics365Account,\x20%s,\x20%s',_0x3862ef,'request\x20sent');_0x462e33(_0x4496b6[_0xfbdd('0x23')][_0xfbdd('0x22')]);}})[_0xfbdd('0x24')](function(_0x36cbfb){logger[_0xfbdd('0x20')](_0xfbdd('0x1c'),_0x3862ef,_0x36cbfb);_0x5c4668(_0x36cbfb);});});}function respondWithStatusCode(_0x130fcf,_0x14c70e){_0x14c70e=_0x14c70e||0xcc;return function(_0x248d17){if(_0x248d17){return _0x130fcf['sendStatus'](_0x14c70e);}return _0x130fcf['status'](_0x14c70e)[_0xfbdd('0x25')]();};}function respondWithResult(_0x240d27,_0x560b86){_0x560b86=_0x560b86||0xc8;return function(_0x3b0f16){if(_0x3b0f16){return _0x240d27[_0xfbdd('0x26')](_0x560b86)['json'](_0x3b0f16);}};}function respondWithFilteredResult(_0xe4965e,_0x24e9a9){return function(_0x27bf6c){if(_0x27bf6c){var _0x2d6f3e=_0x27bf6c[_0xfbdd('0x27')],_0x1ad832=_0x24e9a9[_0xfbdd('0x28')],_0x469d5a=_0x24e9a9[_0xfbdd('0x28')]+_0x24e9a9[_0xfbdd('0x29')],_0x433a9b;if(_0x469d5a>=_0x2d6f3e){_0x469d5a=_0x2d6f3e;_0x433a9b=0xc8;}else{_0x433a9b=0xce;}_0xe4965e['status'](_0x433a9b);return _0xe4965e['set'](_0xfbdd('0x2a'),_0x1ad832+'-'+_0x469d5a+'/'+_0x2d6f3e)[_0xfbdd('0x2b')](_0x27bf6c);}return null;};}function patchUpdates(_0x26b1e5){return function(_0x157265){try{jsonpatch[_0xfbdd('0x2c')](_0x157265,_0x26b1e5,!![]);}catch(_0x4fbe76){return BPromise[_0xfbdd('0x2d')](_0x4fbe76);}return _0x157265['save']();};}function saveUpdates(_0x4669a0,_0x59bbf7){return function(_0x2cc380){if(_0x2cc380){return _0x2cc380[_0xfbdd('0x2e')](_0x4669a0)['then'](function(_0x5efee6){return _0x5efee6;});}return null;};}function removeEntity(_0x2f1ef2,_0x1213a2){return function(_0x4694c7){if(_0x4694c7){return _0x4694c7[_0xfbdd('0x2f')]()['then'](function(){_0x2f1ef2[_0xfbdd('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x25e3dd,_0x29535f){return function(_0x4479ce){if(!_0x4479ce){_0x25e3dd[_0xfbdd('0x30')](0x194);}return _0x4479ce;};}function handleError(_0x6009ef,_0x3d8f94){_0x3d8f94=_0x3d8f94||0x1f4;return function(_0x503dfc){logger[_0xfbdd('0x20')](_0x503dfc['stack']);if(_0x503dfc[_0xfbdd('0x31')]){delete _0x503dfc[_0xfbdd('0x31')];}_0x6009ef[_0xfbdd('0x26')](_0x3d8f94)[_0xfbdd('0x32')](_0x503dfc);};}exports[_0xfbdd('0x33')]=function(_0x3f7c88,_0x4abb7d){var _0x43e438={},_0x235849={},_0xd26718={'count':0x0,'rows':[]};var _0x3a1d3e=_[_0xfbdd('0x34')](db[_0xfbdd('0x35')][_0xfbdd('0x36')],function(_0x5c36d5){return{'name':_0x5c36d5[_0xfbdd('0x37')],'type':_0x5c36d5[_0xfbdd('0x38')]['key']};});_0x235849['model']=_[_0xfbdd('0x34')](_0x3a1d3e,'name');_0x235849[_0xfbdd('0x39')]=_[_0xfbdd('0x3a')](_0x3f7c88['query']);_0x235849['filters']=_['intersection'](_0x235849[_0xfbdd('0x3b')],_0x235849[_0xfbdd('0x39')]);_0x43e438[_0xfbdd('0x3c')]=_[_0xfbdd('0x3d')](_0x235849['model'],qs[_0xfbdd('0x3e')](_0x3f7c88['query'][_0xfbdd('0x3e')]));_0x43e438[_0xfbdd('0x3c')]=_0x43e438['attributes'][_0xfbdd('0x3f')]?_0x43e438[_0xfbdd('0x3c')]:_0x235849[_0xfbdd('0x3b')];if(!_0x3f7c88['query']['hasOwnProperty']('nolimit')){_0x43e438['limit']=qs['limit'](_0x3f7c88[_0xfbdd('0x39')][_0xfbdd('0x29')]);_0x43e438[_0xfbdd('0x28')]=qs['offset'](_0x3f7c88['query']['offset']);}_0x43e438[_0xfbdd('0x40')]=qs[_0xfbdd('0x41')](_0x3f7c88[_0xfbdd('0x39')][_0xfbdd('0x41')]);_0x43e438[_0xfbdd('0x42')]=qs[_0xfbdd('0x43')](_[_0xfbdd('0x44')](_0x3f7c88[_0xfbdd('0x39')],_0x235849[_0xfbdd('0x43')]));if(_0x3f7c88[_0xfbdd('0x39')][_0xfbdd('0x45')]){_0x43e438[_0xfbdd('0x42')]=_[_0xfbdd('0x46')](_0x43e438[_0xfbdd('0x42')],{'$or':_['map'](_0x3a1d3e,function(_0x49d6c2){if(_0x49d6c2['type'][_0xfbdd('0x47')]!=='VIRTUAL'){var _0x420ea7={};_0x420ea7[_0x49d6c2[_0xfbdd('0x48')]]={'$like':'%'+_0x3f7c88['query'][_0xfbdd('0x45')]+'%'};return _0x420ea7;}})});}_0x43e438=_[_0xfbdd('0x46')]({},_0x43e438,_0x3f7c88['options']);var _0x2d6ed9={'where':_0x43e438[_0xfbdd('0x42')]};return db[_0xfbdd('0x35')][_0xfbdd('0x27')](_0x2d6ed9)[_0xfbdd('0x1a')](function(_0x352ca1){_0xd26718[_0xfbdd('0x27')]=_0x352ca1;if(_0x3f7c88[_0xfbdd('0x39')][_0xfbdd('0x49')]){_0x43e438[_0xfbdd('0x4a')]=[{'all':!![]}];}return db[_0xfbdd('0x35')][_0xfbdd('0x4b')](_0x43e438);})['then'](function(_0x52f783){_0xd26718[_0xfbdd('0x4c')]=_0x52f783;return _0xd26718;})[_0xfbdd('0x1a')](respondWithFilteredResult(_0x4abb7d,_0x43e438))[_0xfbdd('0x24')](handleError(_0x4abb7d,null));};exports['show']=function(_0x12b2ec,_0x2215a9){var _0x35e293={'raw':![],'where':{'id':_0x12b2ec[_0xfbdd('0x4d')]['id']}},_0x15d3a1={};_0x15d3a1['model']=_[_0xfbdd('0x3a')](db[_0xfbdd('0x35')][_0xfbdd('0x36')]);_0x15d3a1[_0xfbdd('0x39')]=_[_0xfbdd('0x3a')](_0x12b2ec[_0xfbdd('0x39')]);_0x15d3a1[_0xfbdd('0x43')]=_[_0xfbdd('0x3d')](_0x15d3a1[_0xfbdd('0x3b')],_0x15d3a1[_0xfbdd('0x39')]);_0x35e293[_0xfbdd('0x3c')]=_['intersection'](_0x15d3a1[_0xfbdd('0x3b')],qs[_0xfbdd('0x3e')](_0x12b2ec['query'][_0xfbdd('0x3e')]));_0x35e293[_0xfbdd('0x3c')]=_0x35e293[_0xfbdd('0x3c')][_0xfbdd('0x3f')]?_0x35e293[_0xfbdd('0x3c')]:_0x15d3a1[_0xfbdd('0x3b')];if(_0x12b2ec[_0xfbdd('0x39')]['includeAll']){_0x35e293['include']=[{'all':!![]}];}_0x35e293=_['merge']({},_0x35e293,_0x12b2ec[_0xfbdd('0x4e')]);return db['Dynamics365Account'][_0xfbdd('0x4f')](_0x35e293)[_0xfbdd('0x1a')](handleEntityNotFound(_0x2215a9,null))[_0xfbdd('0x1a')](respondWithResult(_0x2215a9,null))['catch'](handleError(_0x2215a9,null));};exports[_0xfbdd('0x50')]=function(_0x3a9a41,_0xbb918e){return db['Dynamics365Account']['create'](_0x3a9a41['body'],{})[_0xfbdd('0x1a')](respondWithResult(_0xbb918e,0xc9))['catch'](handleError(_0xbb918e,null));};exports[_0xfbdd('0x2e')]=function(_0x45e550,_0x304530){if(_0x45e550[_0xfbdd('0x51')]['id']){delete _0x45e550[_0xfbdd('0x51')]['id'];}return db[_0xfbdd('0x35')][_0xfbdd('0x4f')]({'where':{'id':_0x45e550[_0xfbdd('0x4d')]['id']}})[_0xfbdd('0x1a')](handleEntityNotFound(_0x304530,null))['then'](saveUpdates(_0x45e550[_0xfbdd('0x51')],null))[_0xfbdd('0x1a')](respondWithResult(_0x304530,null))[_0xfbdd('0x24')](handleError(_0x304530,null));};exports[_0xfbdd('0x2f')]=function(_0x1bfb38,_0x28c68e){return db['Dynamics365Account'][_0xfbdd('0x4f')]({'where':{'id':_0x1bfb38[_0xfbdd('0x4d')]['id']}})[_0xfbdd('0x1a')](handleEntityNotFound(_0x28c68e,null))[_0xfbdd('0x1a')](removeEntity(_0x28c68e,null))[_0xfbdd('0x24')](handleError(_0x28c68e,null));};exports[_0xfbdd('0x52')]=function(_0x35d009,_0x2c39e6,_0x2138c1){var _0x472ba9={};var _0x526e8e={};var _0x15e2fc;var _0x34d863;return db['Dynamics365Account']['findOne']({'where':{'id':_0x35d009[_0xfbdd('0x4d')]['id']}})[_0xfbdd('0x1a')](handleEntityNotFound(_0x2c39e6,null))[_0xfbdd('0x1a')](function(_0x455bd6){if(_0x455bd6){_0x15e2fc=_0x455bd6;_0x526e8e[_0xfbdd('0x3b')]=_[_0xfbdd('0x3a')](db['Dynamics365Configuration'][_0xfbdd('0x36')]);_0x526e8e[_0xfbdd('0x39')]=_[_0xfbdd('0x3a')](_0x35d009['query']);_0x526e8e[_0xfbdd('0x43')]=_[_0xfbdd('0x3d')](_0x526e8e[_0xfbdd('0x3b')],_0x526e8e['query']);_0x472ba9['attributes']=_[_0xfbdd('0x3d')](_0x526e8e[_0xfbdd('0x3b')],qs[_0xfbdd('0x3e')](_0x35d009[_0xfbdd('0x39')][_0xfbdd('0x3e')]));_0x472ba9[_0xfbdd('0x3c')]=_0x472ba9[_0xfbdd('0x3c')][_0xfbdd('0x3f')]?_0x472ba9[_0xfbdd('0x3c')]:_0x526e8e[_0xfbdd('0x3b')];_0x472ba9[_0xfbdd('0x40')]=qs['sort'](_0x35d009[_0xfbdd('0x39')][_0xfbdd('0x41')]);_0x472ba9[_0xfbdd('0x42')]=qs[_0xfbdd('0x43')](_[_0xfbdd('0x44')](_0x35d009[_0xfbdd('0x39')],_0x526e8e[_0xfbdd('0x43')]));if(_0x35d009[_0xfbdd('0x39')][_0xfbdd('0x45')]){_0x472ba9[_0xfbdd('0x42')]=_[_0xfbdd('0x46')](_0x472ba9[_0xfbdd('0x42')],{'$or':_[_0xfbdd('0x34')](_0x472ba9[_0xfbdd('0x3c')],function(_0x3f8f7b){var _0x2a0381={};_0x2a0381[_0x3f8f7b]={'$like':'%'+_0x35d009[_0xfbdd('0x39')][_0xfbdd('0x45')]+'%'};return _0x2a0381;})});}_0x472ba9=_[_0xfbdd('0x46')]({},_0x472ba9,_0x35d009[_0xfbdd('0x4e')]);return _0x15e2fc[_0xfbdd('0x52')](_0x472ba9);}})[_0xfbdd('0x1a')](function(_0x52ee7a){if(_0x52ee7a){_0x34d863=_0x52ee7a[_0xfbdd('0x3f')];if(!_0x35d009[_0xfbdd('0x39')][_0xfbdd('0x53')](_0xfbdd('0x54'))){_0x472ba9['limit']=qs[_0xfbdd('0x29')](_0x35d009[_0xfbdd('0x39')]['limit']);_0x472ba9['offset']=qs[_0xfbdd('0x28')](_0x35d009[_0xfbdd('0x39')]['offset']);}return _0x15e2fc[_0xfbdd('0x52')](_0x472ba9);}})[_0xfbdd('0x1a')](function(_0x456d22){if(_0x456d22){return _0x456d22?{'count':_0x34d863,'rows':_0x456d22}:null;}})[_0xfbdd('0x1a')](respondWithResult(_0x2c39e6,null))[_0xfbdd('0x24')](handleError(_0x2c39e6,null));};exports[_0xfbdd('0x55')]=function(_0x3fb5b0,_0x192eda,_0xd57e5d){if(_0x3fb5b0[_0xfbdd('0x51')]['id']){delete _0x3fb5b0[_0xfbdd('0x51')]['id'];}return db[_0xfbdd('0x35')]['findOne']({'where':{'id':_0x3fb5b0[_0xfbdd('0x4d')]['id']}})[_0xfbdd('0x1a')](handleEntityNotFound(_0x192eda,null))[_0xfbdd('0x1a')](function(_0x5b0a90){if(_0x5b0a90){_0x3fb5b0[_0xfbdd('0x51')][_0xfbdd('0x56')]=_0x5b0a90['id'];_0x3fb5b0[_0xfbdd('0x51')]['Subjects']=integrations[_0xfbdd('0x57')](_0x3fb5b0['body']['channel'],_0x3fb5b0[_0xfbdd('0x51')]['type']);_0x3fb5b0['body']['Descriptions']=integrations['getDescriptions'](_0x3fb5b0[_0xfbdd('0x51')][_0xfbdd('0x58')],_0x3fb5b0[_0xfbdd('0x51')][_0xfbdd('0x38')]);return db[_0xfbdd('0x59')][_0xfbdd('0x50')](_0x3fb5b0[_0xfbdd('0x51')],{'include':[{'model':db['Dynamics365Field'],'as':_0xfbdd('0x5a')},{'model':db[_0xfbdd('0x5b')],'as':_0xfbdd('0x5c')}]});}return null;})[_0xfbdd('0x1a')](respondWithResult(_0x192eda,null))[_0xfbdd('0x24')](handleError(_0x192eda,null));};exports[_0xfbdd('0x5d')]=function(_0x3a826f,_0x2199c8,_0x297a0c){var _0x1ce7ae=_0x3a826f[_0xfbdd('0x39')][_0xfbdd('0x5e')];var _0x2badcd=_0x1ce7ae===_0xfbdd('0x5f')?_0xfbdd('0x60'):'PhoneCall';var _0x35d25d='';var _0xd44a83='';var _0x5a0ebb='';var _0x19b718='';var _0x12f81f='';var _0x4f7124='';var _0xa39ac6='';var _0x299e28='';var _0x2f92e9=[_0xfbdd('0x61'),_0xfbdd('0x62'),_0xfbdd('0x63'),_0xfbdd('0x64'),_0xfbdd('0x65'),_0xfbdd('0x66'),_0xfbdd('0x67'),_0xfbdd('0x68'),'directioncode',_0xfbdd('0x69')];var _0x313f0c=[_0xfbdd('0x6a'),_0xfbdd('0x6b'),_0xfbdd('0x6c'),'billedserviceunits','contactidname',_0xfbdd('0x6d'),_0xfbdd('0x6e'),_0xfbdd('0x6f'),_0xfbdd('0x70'),_0xfbdd('0x71'),_0xfbdd('0x72'),_0xfbdd('0x73'),_0xfbdd('0x74'),_0xfbdd('0x75'),_0xfbdd('0x76'),_0xfbdd('0x77'),_0xfbdd('0x78'),'customeridyominame',_0xfbdd('0x79'),_0xfbdd('0x7a'),_0xfbdd('0x7b'),_0xfbdd('0x7c'),'escalatedon',_0xfbdd('0x7d'),_0xfbdd('0x7e'),_0xfbdd('0x7f'),_0xfbdd('0x80'),_0xfbdd('0x81'),'kbarticleidname','lastonholdtime',_0xfbdd('0x82'),_0xfbdd('0x83'),_0xfbdd('0x84'),_0xfbdd('0x85'),'modifiedbyyominame','modifiedon',_0xfbdd('0x86'),_0xfbdd('0x87'),_0xfbdd('0x88'),_0xfbdd('0x89'),_0xfbdd('0x8a'),_0xfbdd('0x8b'),'overriddencreatedon','owneridname',_0xfbdd('0x8c'),_0xfbdd('0x8d'),_0xfbdd('0x8e'),_0xfbdd('0x8f'),_0xfbdd('0x90'),_0xfbdd('0x91'),_0xfbdd('0x92'),_0xfbdd('0x93'),_0xfbdd('0x94'),'resolvebykpiidname',_0xfbdd('0x95'),_0xfbdd('0x96'),_0xfbdd('0x97'),_0xfbdd('0x98'),'slainvokedidname',_0xfbdd('0x99'),_0xfbdd('0x9a'),_0xfbdd('0x9b'),_0xfbdd('0x9c'),_0xfbdd('0x9d'),_0xfbdd('0x9e'),_0xfbdd('0x9f'),'transactioncurrencyidname','traversedpath',_0xfbdd('0xa0'),_0xfbdd('0xa1')];var _0x597a91=_0x2f92e9['concat'](_0x313f0c);return db[_0xfbdd('0x35')]['findOne']({'where':{'id':_0x3a826f[_0xfbdd('0x4d')]['id']},'attributes':['id',_0xfbdd('0xa2'),_0xfbdd('0xa3'),_0xfbdd('0xa4'),_0xfbdd('0xa5'),_0xfbdd('0xa6'),'clientSecret']})[_0xfbdd('0x1a')](handleEntityNotFound(_0x2199c8,null))[_0xfbdd('0x1a')](function(_0x3ee596){if(_0x3ee596){_0x299e28=_0x3ee596[_0xfbdd('0xa4')];var _0x201108=_0x299e28[_0xfbdd('0xa7')](-0x1);if(_0x201108==='/'){_0x299e28=_0x299e28[_0xfbdd('0xa8')](0x0,_0x299e28[_0xfbdd('0xa9')](_0x201108));}_0xa39ac6=util[_0xfbdd('0xaa')](_0xfbdd('0xab'),_0x299e28);var _0x27ae28={'method':_0xfbdd('0xac'),'uri':'https://login.microsoftonline.com/'+_0x3ee596[_0xfbdd('0xa5')]+_0xfbdd('0xad'),'form':{'client_id':_0x3ee596[_0xfbdd('0xa6')],'resource':_0x299e28,'username':_0x3ee596[_0xfbdd('0xa2')],'password':_0x3ee596[_0xfbdd('0xa3')],'grant_type':_0xfbdd('0xa3'),'client_secret':_0x3ee596['clientSecret']},'json':!![]};return rp(_0x27ae28);}})[_0xfbdd('0x1a')](function(_0xacf6af){_0x4f7124=_0xacf6af[_0xfbdd('0xae')];var _0x210e64={'method':_0xfbdd('0xaf'),'uri':encodeURI(_0xa39ac6+_0xfbdd('0xb0')+_0x2badcd+'\x27'),'headers':{'Authorization':_0xfbdd('0xb1')+_0x4f7124,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x210e64);})['then'](function(_0x6abe66){var _0x49a14e=_0x6abe66[_0xfbdd('0xb2')][0x0];var _0x131d21=_0x49a14e[_0xfbdd('0xb3')];var _0x238f7b={'method':'GET','uri':_0xa39ac6+'EntityDefinitions('+_0x131d21+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0xfbdd('0xb1')+_0x4f7124,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x238f7b);})[_0xfbdd('0x1a')](function(_0x163c02){_0x35d25d=_0x163c02;_0xd44a83=_0x35d25d[_0xfbdd('0xb4')];_0xd44a83=_['remove'](_0xd44a83,function(_0x5d254d){return!_0x597a91[_0xfbdd('0xb5')](_0x5d254d[_0xfbdd('0xb6')]);});var _0x364c20=[];var _0x445df9=[];_0xd44a83[_0xfbdd('0xb7')](function(_0xa6c46){if(_0xa6c46[_0xfbdd('0xb8')]){var _0x48aaaf=_0xa6c46[_0xfbdd('0xb8')]['substring'](_0xa6c46['@odata.type']['lastIndexOf']('.')+0x1);if(_0x48aaaf==='PicklistAttributeMetadata'){_0x364c20[_0xfbdd('0xb9')](getSelectList(_0xa39ac6,_0x1ce7ae,_0x445df9,_0x35d25d[_0xfbdd('0xb3')],_0xa6c46['MetadataId'],_0x4f7124));}}});return Promise[_0xfbdd('0xba')](_0x364c20);})['then'](function(_0x5d2983){_0x5a0ebb=_0x5d2983[0x0];var _0x6b3672=[];var _0x2b58f1=[];_0xd44a83[_0xfbdd('0xb7')](function(_0x1dad29){if(!_['isNil'](_0x1dad29[_0xfbdd('0xb8')])){var _0x43cca4=_0x1dad29[_0xfbdd('0xb8')][_0xfbdd('0xa8')](_0x1dad29[_0xfbdd('0xb8')]['lastIndexOf']('.')+0x1);if(_0x43cca4===_0xfbdd('0xbb')){_0x6b3672[_0xfbdd('0xb9')](getBooleanList(_0xa39ac6,_0x1ce7ae,_0x2b58f1,_0x35d25d[_0xfbdd('0xb3')],_0x1dad29['MetadataId'],_0x4f7124));}}});return Promise[_0xfbdd('0xba')](_0x6b3672);})[_0xfbdd('0x1a')](function(_0x275cfa){_0x19b718=_0x275cfa[0x0];var _0x1a3512=[];var _0x2e07c8=[];_0xd44a83[_0xfbdd('0xb7')](function(_0x59aba8){if(_0x59aba8[_0xfbdd('0xb8')]){var _0x1888a2=_0x59aba8[_0xfbdd('0xb8')][_0xfbdd('0xa8')](_0x59aba8[_0xfbdd('0xb8')][_0xfbdd('0xa9')]('.')+0x1);if(_0x1888a2===_0xfbdd('0xbc')||_0x1888a2===_0xfbdd('0xbd')||_0x1888a2===_0xfbdd('0xbe')||_0x1888a2==='IntegerAttributeMetadata'||_0x1888a2===_0xfbdd('0xbf')||_0x1888a2===_0xfbdd('0xc0')||_0x1888a2===_0xfbdd('0xc1')||_0x1888a2===_0xfbdd('0xc2')||_0x1888a2===_0xfbdd('0xc3')||_0x1888a2==='DecimalAttributeMetadata'){_0x1a3512[_0xfbdd('0xb9')](getInputList(_0xa39ac6,_0x1ce7ae,_0x1888a2,_0x2e07c8,_0x35d25d[_0xfbdd('0xb3')],_0x59aba8['MetadataId'],_0x4f7124));}}});return Promise['all'](_0x1a3512);})[_0xfbdd('0x1a')](function(_0x416caa){_0x12f81f=_0x416caa[0x0];var _0x1d6361=_0x5a0ebb[_0xfbdd('0xc4')](_0x19b718)['concat'](_0x12f81f);var _0x3ded7b={'count':_0x1d6361[_0xfbdd('0x3f')],'rows':_0x1d6361};return _0x3ded7b;})[_0xfbdd('0x1a')](respondWithResult(_0x2199c8,null))['catch'](function(_0x1025d4){console[_0xfbdd('0xc5')](_0xfbdd('0xc6')+_0x1025d4);var _0x2784ed=_0x3a826f[_0xfbdd('0x39')]['test']?0x1f4:_0x1025d4[_0xfbdd('0xc7')]||0x1f4;logger[_0xfbdd('0x20')](_0x1025d4[_0xfbdd('0xc8')]);delete _0x1025d4[_0xfbdd('0x31')];if(_0x2784ed===0x191){_0x2784ed=0x190;}_0x2199c8[_0xfbdd('0x26')](_0x2784ed)['send'](_0x3a826f[_0xfbdd('0x39')][_0xfbdd('0x19')]?{'message':_0xfbdd('0xc9'),'statusCode':_0x1025d4[_0xfbdd('0xc7')]}:_0x1025d4);});};function getSelectList(_0xae8eda,_0x22ebe7,_0x43ed2d,_0x3f6ef7,_0x511daa,_0x196b1a){var _0x5b46cc={'method':_0xfbdd('0xaf'),'uri':_0xae8eda+_0xfbdd('0xca')+_0x3f6ef7+_0xfbdd('0xcb')+_0x511daa+_0xfbdd('0xcc')+_0xfbdd('0xcd'),'headers':{'Authorization':_0xfbdd('0xb1')+_0x196b1a,'If-None-Match':null,'OData-Version':_0xfbdd('0xce')},'json':!![]};return rp(_0x5b46cc)['then'](function(_0x506ceb){var _0x43c991=[];var _0x235dc3=_0x506ceb['OptionSet']['Options'];_0x235dc3[_0xfbdd('0xb7')](function(_0x17573d){_0x43c991['push']({'name':_0x17573d[_0xfbdd('0xcf')][_0xfbdd('0xd0')]['Label'],'value':String(_0x17573d[_0xfbdd('0xd1')])});});var _0x356ab4={'id':_0x22ebe7+'_'+_0x506ceb[_0xfbdd('0xb6')],'name':_0x506ceb[_0xfbdd('0xd2')][_0xfbdd('0xd0')]['Label'],'custom':![],'options':_0x43c991};_0x43ed2d['push'](_0x356ab4);return _0x43ed2d;});}function getBooleanList(_0x3f0e55,_0x1a4ea5,_0x331b32,_0xa057da,_0xb24b8a,_0x19590a){var _0x2ce0ec={'method':_0xfbdd('0xaf'),'uri':_0x3f0e55+'EntityDefinitions('+_0xa057da+')/Attributes('+_0xb24b8a+_0xfbdd('0xd3'),'headers':{'Authorization':'Bearer\x20'+_0x19590a,'If-None-Match':null,'OData-Version':_0xfbdd('0xce')},'json':!![]};return rp(_0x2ce0ec)[_0xfbdd('0x1a')](function(_0x40d68b){var _0x413ca3=[];_0x413ca3['push']({'name':_0x40d68b['OptionSet'][_0xfbdd('0xd4')][_0xfbdd('0xcf')][_0xfbdd('0xd0')][_0xfbdd('0xcf')],'value':_0xfbdd('0xd5')},{'name':_0x40d68b[_0xfbdd('0xd6')][_0xfbdd('0xd7')][_0xfbdd('0xcf')][_0xfbdd('0xd0')][_0xfbdd('0xcf')],'value':_0xfbdd('0xd8')});var _0x5d1d8d={'id':_0x1a4ea5+'_'+_0x40d68b['LogicalName'],'name':_0x40d68b[_0xfbdd('0xd2')]['UserLocalizedLabel'][_0xfbdd('0xcf')],'custom':![],'options':_0x413ca3};_0x331b32[_0xfbdd('0xb9')](_0x5d1d8d);return _0x331b32;});}function getInputList(_0x5ae614,_0xac7497,_0x2b7a1e,_0x389897,_0x2d123c,_0xa2fc10,_0x3085c4){var _0x1c34a4={'method':_0xfbdd('0xaf'),'uri':_0x5ae614+'EntityDefinitions('+_0x2d123c+')/Attributes('+_0xa2fc10+_0xfbdd('0xd9')+_0x2b7a1e+_0xfbdd('0xda'),'headers':{'Authorization':_0xfbdd('0xb1')+_0x3085c4,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x1c34a4)['then'](function(_0x9d87f){var _0x3ce28c={'id':_0xac7497+'_'+_0x9d87f[_0xfbdd('0xb6')],'name':_0x9d87f[_0xfbdd('0xd2')][_0xfbdd('0xd0')]?_0x9d87f[_0xfbdd('0xd2')]['UserLocalizedLabel'][_0xfbdd('0xcf')]:_0x9d87f[_0xfbdd('0xb6')],'custom':![],'options':[]};_0x389897[_0xfbdd('0xb9')](_0x3ce28c);return _0x389897;});} \ No newline at end of file +var _0x421c=['jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','client','http','test','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','status','end','json','count','offset','limit','set','apply','save','destroy','stack','name','index','Dynamics365Account','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','VIRTUAL','field','options','includeAll','show','params','include','merge','find','catch','create','body','update','getConfigurations','findOne','Dynamics365Configuration','order','addConfiguration','Subjects','getSubjects','Descriptions','getDescriptions','channel','Dynamics365Field','getFields','ticketType','incident','Incident','title','description','customerid','ownerid','caseorigincode','phonenumber','regardingobjectid','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyyominame','createdbyyominame','createdon','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','msdyn_iotalertname','numberofchildincidents','onholdtime','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','productserialnumber','resolveby','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','statecode','statuscode','subjectidname','ticketnumber','transactioncurrencyidname','versionnumber','concat','username','password','tenantId','clientId','clientSecret','substring','lastIndexOf','POST','/oauth2/token','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','remove','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','isNil','BooleanAttributeMetadata','all','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','Dynamics365\x20error:\x20','statusCode','send','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Label','Value','DisplayName','UserLocalizedLabel',')/Attributes(','true','FalseOption','false','?$select=DisplayName,LogicalName','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto'];(function(_0x19cbcc,_0x44384e){var _0x44d405=function(_0x475354){while(--_0x475354){_0x19cbcc['push'](_0x19cbcc['shift']());}};_0x44d405(++_0x44384e);}(_0x421c,0xca));var _0xc421=function(_0x1389fd,_0x421122){_0x1389fd=_0x1389fd-0x0;var _0x219853=_0x421c[_0x1389fd];return _0x219853;};'use strict';var pdf=require(_0xc421('0x0'));var emlformat=require(_0xc421('0x1'));var rimraf=require(_0xc421('0x2'));var zipdir=require(_0xc421('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc421('0x4'));var moment=require('moment');var BPromise=require(_0xc421('0x5'));var Mustache=require(_0xc421('0x6'));var util=require(_0xc421('0x7'));var path=require(_0xc421('0x8'));var sox=require(_0xc421('0x9'));var csv=require(_0xc421('0xa'));var ejs=require(_0xc421('0xb'));var fs=require('fs');var _=require(_0xc421('0xc'));var squel=require(_0xc421('0xd'));var crypto=require(_0xc421('0xe'));var jsforce=require(_0xc421('0xf'));var deskjs=require(_0xc421('0x10'));var toCsv=require(_0xc421('0xa'));var querystring=require(_0xc421('0x11'));var Papa=require(_0xc421('0x12'));var Redis=require('ioredis');var authService=require(_0xc421('0x13'));var qs=require(_0xc421('0x14'));var as=require(_0xc421('0x15'));var hardwareService=require(_0xc421('0x16'));var logger=require(_0xc421('0x17'))(_0xc421('0x18'));var utils=require(_0xc421('0x19'));var config=require('../../config/environment');var db=require(_0xc421('0x1a'))['db'];var integrations=require(_0xc421('0x1b'));var jayson=require('jayson/promise');var client=jayson[_0xc421('0x1c')][_0xc421('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x1264f6,_0x65c52c,_0x55bd98){if(_0x55bd98){var _0x315042=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x315042[_0xc421('0x1e')](_0x65c52c)){return _0x1264f6;}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 _0x1264f6;}}function respondWithRpcPromise(_0x52fea0,_0x15676f,_0x2d81b1,_0x1a0813){return new BPromise(function(_0x4fa76c,_0x3f4c3e){var _0x31d13c=_0x1a0813||client;return _0x31d13c['request'](_0x52fea0,_0x2d81b1)[_0xc421('0x1f')](function(_0x44565f){logger[_0xc421('0x20')](_0xc421('0x21'),_0x15676f,_0xc421('0x22'));logger[_0xc421('0x23')](_0xc421('0x24'),_0x15676f,_0xc421('0x22'),JSON['stringify'](_0x44565f));if(_0x44565f[_0xc421('0x25')]){if(_0x44565f[_0xc421('0x25')][_0xc421('0x26')]===0x1f4){logger[_0xc421('0x25')](_0xc421('0x21'),_0x15676f,_0x44565f['error'][_0xc421('0x27')]);return _0x3f4c3e(_0x44565f['error'][_0xc421('0x27')]);}logger['error'](_0xc421('0x21'),_0x15676f,_0x44565f[_0xc421('0x25')][_0xc421('0x27')]);return _0x4fa76c(_0x44565f[_0xc421('0x25')]['message']);}else{logger[_0xc421('0x20')](_0xc421('0x21'),_0x15676f,_0xc421('0x22'));_0x4fa76c(_0x44565f[_0xc421('0x28')][_0xc421('0x27')]);}})['catch'](function(_0x3f30ee){logger['error'](_0xc421('0x21'),_0x15676f,_0x3f30ee);_0x3f4c3e(_0x3f30ee);});});}function respondWithStatusCode(_0x57dcfd,_0x4f7de2){_0x4f7de2=_0x4f7de2||0xcc;return function(_0x490c42){if(_0x490c42){return _0x57dcfd[_0xc421('0x29')](_0x4f7de2);}return _0x57dcfd[_0xc421('0x2a')](_0x4f7de2)[_0xc421('0x2b')]();};}function respondWithResult(_0x18d033,_0x894ea5){_0x894ea5=_0x894ea5||0xc8;return function(_0x43d606){if(_0x43d606){return _0x18d033[_0xc421('0x2a')](_0x894ea5)[_0xc421('0x2c')](_0x43d606);}};}function respondWithFilteredResult(_0x344066,_0x527b48){return function(_0x124e2f){if(_0x124e2f){var _0x4319cb=_0x124e2f[_0xc421('0x2d')],_0x56c691=_0x527b48[_0xc421('0x2e')],_0x3f5f85=_0x527b48[_0xc421('0x2e')]+_0x527b48[_0xc421('0x2f')],_0x3c18c4;if(_0x3f5f85>=_0x4319cb){_0x3f5f85=_0x4319cb;_0x3c18c4=0xc8;}else{_0x3c18c4=0xce;}_0x344066[_0xc421('0x2a')](_0x3c18c4);return _0x344066[_0xc421('0x30')]('Content-Range',_0x56c691+'-'+_0x3f5f85+'/'+_0x4319cb)[_0xc421('0x2c')](_0x124e2f);}return null;};}function patchUpdates(_0x25497b){return function(_0x28b6bd){try{jsonpatch[_0xc421('0x31')](_0x28b6bd,_0x25497b,!![]);}catch(_0x57bbd3){return BPromise['reject'](_0x57bbd3);}return _0x28b6bd[_0xc421('0x32')]();};}function saveUpdates(_0x2f17ea,_0x453fcf){return function(_0x83906d){if(_0x83906d){return _0x83906d['update'](_0x2f17ea)['then'](function(_0x1cbc25){return _0x1cbc25;});}return null;};}function removeEntity(_0x410a0b,_0x33719b){return function(_0x22b912){if(_0x22b912){return _0x22b912[_0xc421('0x33')]()[_0xc421('0x1f')](function(){_0x410a0b[_0xc421('0x2a')](0xcc)[_0xc421('0x2b')]();});}};}function handleEntityNotFound(_0x8a231d,_0x4fcb60){return function(_0x95ae94){if(!_0x95ae94){_0x8a231d[_0xc421('0x29')](0x194);}return _0x95ae94;};}function handleError(_0x506a9,_0x4452c2){_0x4452c2=_0x4452c2||0x1f4;return function(_0x4112f2){logger[_0xc421('0x25')](_0x4112f2[_0xc421('0x34')]);if(_0x4112f2[_0xc421('0x35')]){delete _0x4112f2[_0xc421('0x35')];}_0x506a9[_0xc421('0x2a')](_0x4452c2)['send'](_0x4112f2);};}exports[_0xc421('0x36')]=function(_0x110247,_0xea8a7b){var _0x1e7d9b={},_0x619a43={},_0x5937c8={'count':0x0,'rows':[]};var _0x3149f2=_['map'](db[_0xc421('0x37')][_0xc421('0x38')],function(_0x514a59){return{'name':_0x514a59[_0xc421('0x39')],'type':_0x514a59[_0xc421('0x3a')][_0xc421('0x3b')]};});_0x619a43[_0xc421('0x3c')]=_[_0xc421('0x3d')](_0x3149f2,_0xc421('0x35'));_0x619a43['query']=_[_0xc421('0x3e')](_0x110247[_0xc421('0x3f')]);_0x619a43[_0xc421('0x40')]=_[_0xc421('0x41')](_0x619a43[_0xc421('0x3c')],_0x619a43[_0xc421('0x3f')]);_0x1e7d9b[_0xc421('0x42')]=_[_0xc421('0x41')](_0x619a43['model'],qs[_0xc421('0x43')](_0x110247['query']['fields']));_0x1e7d9b['attributes']=_0x1e7d9b[_0xc421('0x42')][_0xc421('0x44')]?_0x1e7d9b[_0xc421('0x42')]:_0x619a43[_0xc421('0x3c')];if(!_0x110247[_0xc421('0x3f')][_0xc421('0x45')]('nolimit')){_0x1e7d9b['limit']=qs[_0xc421('0x2f')](_0x110247[_0xc421('0x3f')][_0xc421('0x2f')]);_0x1e7d9b[_0xc421('0x2e')]=qs['offset'](_0x110247[_0xc421('0x3f')][_0xc421('0x2e')]);}_0x1e7d9b['order']=qs[_0xc421('0x46')](_0x110247[_0xc421('0x3f')][_0xc421('0x46')]);_0x1e7d9b[_0xc421('0x47')]=qs[_0xc421('0x40')](_[_0xc421('0x48')](_0x110247['query'],_0x619a43['filters']));if(_0x110247['query'][_0xc421('0x49')]){_0x1e7d9b[_0xc421('0x47')]=_['merge'](_0x1e7d9b['where'],{'$or':_[_0xc421('0x3d')](_0x3149f2,function(_0x568d6d){if(_0x568d6d[_0xc421('0x3a')][_0xc421('0x3b')]!==_0xc421('0x4a')){var _0x3c994a={};_0x3c994a[_0x568d6d[_0xc421('0x4b')]]={'$like':'%'+_0x110247['query'][_0xc421('0x49')]+'%'};return _0x3c994a;}})});}_0x1e7d9b=_['merge']({},_0x1e7d9b,_0x110247[_0xc421('0x4c')]);var _0x7fd326={'where':_0x1e7d9b['where']};return db[_0xc421('0x37')]['count'](_0x7fd326)['then'](function(_0x76dcb8){_0x5937c8[_0xc421('0x2d')]=_0x76dcb8;if(_0x110247[_0xc421('0x3f')][_0xc421('0x4d')]){_0x1e7d9b['include']=[{'all':!![]}];}return db[_0xc421('0x37')]['findAll'](_0x1e7d9b);})[_0xc421('0x1f')](function(_0x4666c2){_0x5937c8['rows']=_0x4666c2;return _0x5937c8;})['then'](respondWithFilteredResult(_0xea8a7b,_0x1e7d9b))['catch'](handleError(_0xea8a7b,null));};exports[_0xc421('0x4e')]=function(_0x325e88,_0x10a570){var _0x193b42={'raw':![],'where':{'id':_0x325e88[_0xc421('0x4f')]['id']}},_0x410557={};_0x410557[_0xc421('0x3c')]=_[_0xc421('0x3e')](db[_0xc421('0x37')]['rawAttributes']);_0x410557[_0xc421('0x3f')]=_[_0xc421('0x3e')](_0x325e88[_0xc421('0x3f')]);_0x410557['filters']=_[_0xc421('0x41')](_0x410557[_0xc421('0x3c')],_0x410557[_0xc421('0x3f')]);_0x193b42[_0xc421('0x42')]=_[_0xc421('0x41')](_0x410557[_0xc421('0x3c')],qs[_0xc421('0x43')](_0x325e88[_0xc421('0x3f')][_0xc421('0x43')]));_0x193b42[_0xc421('0x42')]=_0x193b42[_0xc421('0x42')][_0xc421('0x44')]?_0x193b42[_0xc421('0x42')]:_0x410557['model'];if(_0x325e88[_0xc421('0x3f')][_0xc421('0x4d')]){_0x193b42[_0xc421('0x50')]=[{'all':!![]}];}_0x193b42=_[_0xc421('0x51')]({},_0x193b42,_0x325e88[_0xc421('0x4c')]);return db[_0xc421('0x37')][_0xc421('0x52')](_0x193b42)[_0xc421('0x1f')](handleEntityNotFound(_0x10a570,null))[_0xc421('0x1f')](respondWithResult(_0x10a570,null))[_0xc421('0x53')](handleError(_0x10a570,null));};exports[_0xc421('0x54')]=function(_0x1af042,_0x128214){return db['Dynamics365Account'][_0xc421('0x54')](_0x1af042[_0xc421('0x55')],{})[_0xc421('0x1f')](respondWithResult(_0x128214,0xc9))['catch'](handleError(_0x128214,null));};exports[_0xc421('0x56')]=function(_0x112383,_0x3e1c1b){if(_0x112383[_0xc421('0x55')]['id']){delete _0x112383['body']['id'];}return db[_0xc421('0x37')]['find']({'where':{'id':_0x112383[_0xc421('0x4f')]['id']}})[_0xc421('0x1f')](handleEntityNotFound(_0x3e1c1b,null))[_0xc421('0x1f')](saveUpdates(_0x112383[_0xc421('0x55')],null))['then'](respondWithResult(_0x3e1c1b,null))[_0xc421('0x53')](handleError(_0x3e1c1b,null));};exports[_0xc421('0x33')]=function(_0x3362d4,_0x49debc){return db['Dynamics365Account'][_0xc421('0x52')]({'where':{'id':_0x3362d4['params']['id']}})[_0xc421('0x1f')](handleEntityNotFound(_0x49debc,null))[_0xc421('0x1f')](removeEntity(_0x49debc,null))['catch'](handleError(_0x49debc,null));};exports[_0xc421('0x57')]=function(_0x1fc804,_0x5716e8,_0x2f546e){var _0x2b538d={};var _0x46f112={};var _0x126ec8;var _0x400f31;return db['Dynamics365Account'][_0xc421('0x58')]({'where':{'id':_0x1fc804[_0xc421('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5716e8,null))[_0xc421('0x1f')](function(_0x2ff559){if(_0x2ff559){_0x126ec8=_0x2ff559;_0x46f112['model']=_[_0xc421('0x3e')](db[_0xc421('0x59')][_0xc421('0x38')]);_0x46f112[_0xc421('0x3f')]=_[_0xc421('0x3e')](_0x1fc804[_0xc421('0x3f')]);_0x46f112[_0xc421('0x40')]=_[_0xc421('0x41')](_0x46f112['model'],_0x46f112[_0xc421('0x3f')]);_0x2b538d['attributes']=_[_0xc421('0x41')](_0x46f112['model'],qs[_0xc421('0x43')](_0x1fc804[_0xc421('0x3f')][_0xc421('0x43')]));_0x2b538d[_0xc421('0x42')]=_0x2b538d[_0xc421('0x42')][_0xc421('0x44')]?_0x2b538d[_0xc421('0x42')]:_0x46f112['model'];_0x2b538d[_0xc421('0x5a')]=qs[_0xc421('0x46')](_0x1fc804[_0xc421('0x3f')][_0xc421('0x46')]);_0x2b538d[_0xc421('0x47')]=qs[_0xc421('0x40')](_[_0xc421('0x48')](_0x1fc804[_0xc421('0x3f')],_0x46f112[_0xc421('0x40')]));if(_0x1fc804[_0xc421('0x3f')][_0xc421('0x49')]){_0x2b538d[_0xc421('0x47')]=_[_0xc421('0x51')](_0x2b538d[_0xc421('0x47')],{'$or':_['map'](_0x2b538d[_0xc421('0x42')],function(_0xf524c1){var _0x151ad2={};_0x151ad2[_0xf524c1]={'$like':'%'+_0x1fc804['query']['filter']+'%'};return _0x151ad2;})});}_0x2b538d=_['merge']({},_0x2b538d,_0x1fc804[_0xc421('0x4c')]);return _0x126ec8[_0xc421('0x57')](_0x2b538d);}})[_0xc421('0x1f')](function(_0x4634f4){if(_0x4634f4){_0x400f31=_0x4634f4[_0xc421('0x44')];if(!_0x1fc804[_0xc421('0x3f')][_0xc421('0x45')]('nolimit')){_0x2b538d['limit']=qs['limit'](_0x1fc804['query'][_0xc421('0x2f')]);_0x2b538d['offset']=qs[_0xc421('0x2e')](_0x1fc804[_0xc421('0x3f')]['offset']);}return _0x126ec8[_0xc421('0x57')](_0x2b538d);}})['then'](function(_0x1b2146){if(_0x1b2146){return _0x1b2146?{'count':_0x400f31,'rows':_0x1b2146}:null;}})[_0xc421('0x1f')](respondWithResult(_0x5716e8,null))['catch'](handleError(_0x5716e8,null));};exports[_0xc421('0x5b')]=function(_0x24d82d,_0x2019b6,_0xfdb893){if(_0x24d82d[_0xc421('0x55')]['id']){delete _0x24d82d[_0xc421('0x55')]['id'];}return db['Dynamics365Account'][_0xc421('0x58')]({'where':{'id':_0x24d82d['params']['id']}})['then'](handleEntityNotFound(_0x2019b6,null))[_0xc421('0x1f')](function(_0x586505){if(_0x586505){_0x24d82d[_0xc421('0x55')]['AccountId']=_0x586505['id'];_0x24d82d[_0xc421('0x55')][_0xc421('0x5c')]=integrations[_0xc421('0x5d')](_0x24d82d[_0xc421('0x55')]['channel'],_0x24d82d[_0xc421('0x55')]['type']);_0x24d82d[_0xc421('0x55')][_0xc421('0x5e')]=integrations[_0xc421('0x5f')](_0x24d82d[_0xc421('0x55')][_0xc421('0x60')],_0x24d82d[_0xc421('0x55')][_0xc421('0x3a')]);return db[_0xc421('0x59')][_0xc421('0x54')](_0x24d82d[_0xc421('0x55')],{'include':[{'model':db[_0xc421('0x61')],'as':_0xc421('0x5c')},{'model':db[_0xc421('0x61')],'as':_0xc421('0x5e')}]});}return null;})[_0xc421('0x1f')](respondWithResult(_0x2019b6,null))[_0xc421('0x53')](handleError(_0x2019b6,null));};exports[_0xc421('0x62')]=function(_0x32e87e,_0xa88b15,_0x26c0c4){var _0x1ae38a=_0x32e87e[_0xc421('0x3f')][_0xc421('0x63')];var _0x180391=_0x1ae38a===_0xc421('0x64')?_0xc421('0x65'):'PhoneCall';var _0x37a5e8='';var _0x50833b='';var _0x3b1559='';var _0x40d0cc='';var _0x2dfc18='';var _0x3592e2='';var _0x1e8f60='';var _0xaac008='';var _0x2a19b0=[_0xc421('0x66'),_0xc421('0x67'),_0xc421('0x68'),_0xc421('0x69'),_0xc421('0x6a'),'subject',_0xc421('0x6b'),_0xc421('0x6c'),'directioncode',_0xc421('0x6d')];var _0x33edae=[_0xc421('0x6e'),_0xc421('0x6f'),_0xc421('0x70'),_0xc421('0x71'),_0xc421('0x72'),_0xc421('0x73'),_0xc421('0x74'),_0xc421('0x75'),'createdbyexternalpartyname',_0xc421('0x76'),'createdbyname',_0xc421('0x77'),_0xc421('0x78'),'createdonbehalfbyname','createdonbehalfbyyominame',_0xc421('0x79'),_0xc421('0x7a'),_0xc421('0x7b'),_0xc421('0x7c'),_0xc421('0x7d'),_0xc421('0x7e'),_0xc421('0x7f'),'escalatedon',_0xc421('0x80'),_0xc421('0x81'),_0xc421('0x82'),_0xc421('0x83'),_0xc421('0x84'),_0xc421('0x85'),_0xc421('0x86'),_0xc421('0x87'),_0xc421('0x88'),_0xc421('0x89'),_0xc421('0x8a'),_0xc421('0x8b'),_0xc421('0x8c'),_0xc421('0x8d'),'modifiedonbehalfbyyominame','msdyn_incidenttypename',_0xc421('0x8e'),_0xc421('0x8f'),_0xc421('0x90'),'overriddencreatedon',_0xc421('0x91'),_0xc421('0x92'),_0xc421('0x93'),_0xc421('0x94'),_0xc421('0x95'),_0xc421('0x96'),'prioritycodename','productidname',_0xc421('0x97'),_0xc421('0x98'),'resolvebykpiidname',_0xc421('0x99'),_0xc421('0x9a'),_0xc421('0x9b'),_0xc421('0x9c'),_0xc421('0x9d'),_0xc421('0x9e'),'socialprofileidname',_0xc421('0x9f'),_0xc421('0xa0'),_0xc421('0xa1'),_0xc421('0xa2'),'timezoneruleversionnumber',_0xc421('0xa3'),'traversedpath','utcconversiontimezonecode',_0xc421('0xa4')];var _0x5754dd=_0x2a19b0[_0xc421('0xa5')](_0x33edae);return db['Dynamics365Account'][_0xc421('0x58')]({'where':{'id':_0x32e87e['params']['id']},'attributes':['id',_0xc421('0xa6'),_0xc421('0xa7'),'remoteUri',_0xc421('0xa8'),_0xc421('0xa9'),_0xc421('0xaa')]})[_0xc421('0x1f')](handleEntityNotFound(_0xa88b15,null))[_0xc421('0x1f')](function(_0x56c284){if(_0x56c284){_0xaac008=_0x56c284['remoteUri'];var _0x534a42=_0xaac008['slice'](-0x1);if(_0x534a42==='/'){_0xaac008=_0xaac008[_0xc421('0xab')](0x0,_0xaac008[_0xc421('0xac')](_0x534a42));}_0x1e8f60=util['format']('%s/api/data/v9.0/',_0xaac008);var _0x366ed8={'method':_0xc421('0xad'),'uri':'https://login.microsoftonline.com/'+_0x56c284[_0xc421('0xa8')]+_0xc421('0xae'),'form':{'client_id':_0x56c284[_0xc421('0xa9')],'resource':_0xaac008,'username':_0x56c284[_0xc421('0xa6')],'password':_0x56c284['password'],'grant_type':_0xc421('0xa7'),'client_secret':_0x56c284[_0xc421('0xaa')]},'json':!![]};return rp(_0x366ed8);}})[_0xc421('0x1f')](function(_0x40a5c6){_0x3592e2=_0x40a5c6[_0xc421('0xaf')];var _0x54c605={'method':_0xc421('0xb0'),'uri':encodeURI(_0x1e8f60+_0xc421('0xb1')+_0x180391+'\x27'),'headers':{'Authorization':_0xc421('0xb2')+_0x3592e2,'If-None-Match':null,'OData-Version':_0xc421('0xb3')},'json':!![]};return rp(_0x54c605);})[_0xc421('0x1f')](function(_0x533b2b){var _0x1e3a70=_0x533b2b[_0xc421('0xb4')][0x0];var _0x16857d=_0x1e3a70[_0xc421('0xb5')];var _0x590786={'method':_0xc421('0xb0'),'uri':_0x1e8f60+_0xc421('0xb6')+_0x16857d+_0xc421('0xb7'),'headers':{'Authorization':_0xc421('0xb2')+_0x3592e2,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x590786);})['then'](function(_0x14e5a3){_0x37a5e8=_0x14e5a3;_0x50833b=_0x37a5e8['Attributes'];_0x50833b=_[_0xc421('0xb8')](_0x50833b,function(_0x1eae4a){return!_0x5754dd[_0xc421('0xb9')](_0x1eae4a[_0xc421('0xba')]);});var _0x4485f4=[];var _0x336df9=[];_0x50833b[_0xc421('0xbb')](function(_0x1cb154){if(_0x1cb154[_0xc421('0xbc')]){var _0x52b9b5=_0x1cb154['@odata.type'][_0xc421('0xab')](_0x1cb154[_0xc421('0xbc')][_0xc421('0xac')]('.')+0x1);if(_0x52b9b5===_0xc421('0xbd')){_0x4485f4[_0xc421('0xbe')](getSelectList(_0x1e8f60,_0x1ae38a,_0x336df9,_0x37a5e8[_0xc421('0xb5')],_0x1cb154[_0xc421('0xb5')],_0x3592e2));}}});return Promise['all'](_0x4485f4);})[_0xc421('0x1f')](function(_0x5fb98e){_0x3b1559=_0x5fb98e[0x0];var _0x4cb4a0=[];var _0x5d97de=[];_0x50833b['forEach'](function(_0x88cb74){if(!_[_0xc421('0xbf')](_0x88cb74[_0xc421('0xbc')])){var _0x426dbd=_0x88cb74[_0xc421('0xbc')][_0xc421('0xab')](_0x88cb74[_0xc421('0xbc')]['lastIndexOf']('.')+0x1);if(_0x426dbd===_0xc421('0xc0')){_0x4cb4a0[_0xc421('0xbe')](getBooleanList(_0x1e8f60,_0x1ae38a,_0x5d97de,_0x37a5e8['MetadataId'],_0x88cb74['MetadataId'],_0x3592e2));}}});return Promise[_0xc421('0xc1')](_0x4cb4a0);})['then'](function(_0x51e883){_0x40d0cc=_0x51e883[0x0];var _0x15e78a=[];var _0xd40a19=[];_0x50833b['forEach'](function(_0x5deef2){if(_0x5deef2[_0xc421('0xbc')]){var _0x50f9ef=_0x5deef2['@odata.type'][_0xc421('0xab')](_0x5deef2[_0xc421('0xbc')][_0xc421('0xac')]('.')+0x1);if(_0x50f9ef===_0xc421('0xc2')||_0x50f9ef===_0xc421('0xc3')||_0x50f9ef===_0xc421('0xc4')||_0x50f9ef===_0xc421('0xc5')||_0x50f9ef==='MemoAttributeMetadata'||_0x50f9ef===_0xc421('0xc6')||_0x50f9ef===_0xc421('0xc7')||_0x50f9ef===_0xc421('0xc8')||_0x50f9ef===_0xc421('0xc9')||_0x50f9ef===_0xc421('0xca')){_0x15e78a[_0xc421('0xbe')](getInputList(_0x1e8f60,_0x1ae38a,_0x50f9ef,_0xd40a19,_0x37a5e8[_0xc421('0xb5')],_0x5deef2[_0xc421('0xb5')],_0x3592e2));}}});return Promise[_0xc421('0xc1')](_0x15e78a);})[_0xc421('0x1f')](function(_0x43b261){_0x2dfc18=_0x43b261[0x0];var _0x2a89eb=_0x3b1559['concat'](_0x40d0cc)[_0xc421('0xa5')](_0x2dfc18);var _0x45d577={'count':_0x2a89eb['length'],'rows':_0x2a89eb};return _0x45d577;})['then'](respondWithResult(_0xa88b15,null))['catch'](function(_0x1fb2dd){console['log'](_0xc421('0xcb')+_0x1fb2dd);var _0x4dd6d9=_0x32e87e[_0xc421('0x3f')][_0xc421('0x1e')]?0x1f4:_0x1fb2dd[_0xc421('0xcc')]||0x1f4;logger[_0xc421('0x25')](_0x1fb2dd[_0xc421('0x34')]);delete _0x1fb2dd[_0xc421('0x35')];if(_0x4dd6d9===0x191){_0x4dd6d9=0x190;}_0xa88b15[_0xc421('0x2a')](_0x4dd6d9)[_0xc421('0xcd')](_0x32e87e[_0xc421('0x3f')][_0xc421('0x1e')]?{'message':'Wrong\x20credentials','statusCode':_0x1fb2dd[_0xc421('0xcc')]}:_0x1fb2dd);});};function getSelectList(_0x1b549c,_0x1b9db9,_0x5ed93b,_0x5cfa65,_0x3fa69e,_0x5894e4){var _0xa98a78={'method':'GET','uri':_0x1b549c+'EntityDefinitions('+_0x5cfa65+')/Attributes('+_0x3fa69e+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0xc421('0xce'),'headers':{'Authorization':_0xc421('0xb2')+_0x5894e4,'If-None-Match':null,'OData-Version':_0xc421('0xb3')},'json':!![]};return rp(_0xa98a78)['then'](function(_0x494469){var _0x153dc5=[];var _0x52dd70=_0x494469[_0xc421('0xcf')]['Options'];_0x52dd70[_0xc421('0xbb')](function(_0x4bce75){_0x153dc5[_0xc421('0xbe')]({'name':_0x4bce75[_0xc421('0xd0')]['UserLocalizedLabel'][_0xc421('0xd0')],'value':String(_0x4bce75[_0xc421('0xd1')])});});var _0x2af9df={'id':_0x1b9db9+'_'+_0x494469['LogicalName'],'name':_0x494469[_0xc421('0xd2')][_0xc421('0xd3')]['Label'],'custom':![],'options':_0x153dc5};_0x5ed93b[_0xc421('0xbe')](_0x2af9df);return _0x5ed93b;});}function getBooleanList(_0x3c35e8,_0x2e5e44,_0x499f82,_0x36393c,_0x5f1c13,_0x53ce67){var _0xa5dd43={'method':_0xc421('0xb0'),'uri':_0x3c35e8+_0xc421('0xb6')+_0x36393c+_0xc421('0xd4')+_0x5f1c13+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':_0xc421('0xb2')+_0x53ce67,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0xa5dd43)[_0xc421('0x1f')](function(_0x5196d5){var _0x177002=[];_0x177002['push']({'name':_0x5196d5[_0xc421('0xcf')]['TrueOption'][_0xc421('0xd0')][_0xc421('0xd3')][_0xc421('0xd0')],'value':_0xc421('0xd5')},{'name':_0x5196d5[_0xc421('0xcf')][_0xc421('0xd6')][_0xc421('0xd0')][_0xc421('0xd3')]['Label'],'value':_0xc421('0xd7')});var _0x17a79f={'id':_0x2e5e44+'_'+_0x5196d5[_0xc421('0xba')],'name':_0x5196d5[_0xc421('0xd2')][_0xc421('0xd3')][_0xc421('0xd0')],'custom':![],'options':_0x177002};_0x499f82[_0xc421('0xbe')](_0x17a79f);return _0x499f82;});}function getInputList(_0x29afc6,_0x3082e7,_0x36ab69,_0x1cb080,_0x1822d9,_0x42bbd8,_0x2acd06){var _0x4c2e4f={'method':'GET','uri':_0x29afc6+'EntityDefinitions('+_0x1822d9+_0xc421('0xd4')+_0x42bbd8+')/Microsoft.Dynamics.CRM.'+_0x36ab69+_0xc421('0xd8'),'headers':{'Authorization':_0xc421('0xb2')+_0x2acd06,'If-None-Match':null,'OData-Version':_0xc421('0xb3')},'json':!![]};return rp(_0x4c2e4f)[_0xc421('0x1f')](function(_0x505d0c){var _0x3cb11e={'id':_0x3082e7+'_'+_0x505d0c[_0xc421('0xba')],'name':_0x505d0c[_0xc421('0xd2')][_0xc421('0xd3')]?_0x505d0c[_0xc421('0xd2')][_0xc421('0xd3')]['Label']:_0x505d0c[_0xc421('0xba')],'custom':![],'options':[]};_0x1cb080[_0xc421('0xbe')](_0x3cb11e);return _0x1cb080;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 766afe8..ec35131 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 _0x8a3a=['../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','int_dynamics365_accounts','util','../../config/logger','api','request-promise','path','rimraf'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x8a3a,0x19e));var _0xa8a3=function(_0x235f6c,_0x47eadd){_0x235f6c=_0x235f6c-0x0;var _0x115fb2=_0x8a3a[_0x235f6c];return _0x115fb2;};'use strict';var _=require('lodash');var util=require(_0xa8a3('0x0'));var logger=require(_0xa8a3('0x1'))(_0xa8a3('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa8a3('0x3'));var fs=require('fs');var path=require(_0xa8a3('0x4'));var rimraf=require(_0xa8a3('0x5'));var config=require(_0xa8a3('0x6'));var attributes=require(_0xa8a3('0x7'));var integrations=require(_0xa8a3('0x8'));module[_0xa8a3('0x9')]=function(_0x549a9b,_0x1ca46b){return _0x549a9b[_0xa8a3('0xa')]('Dynamics365Account',attributes,{'tableName':_0xa8a3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbbdc=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','define','Dynamics365Account','int_dynamics365_accounts'];(function(_0x3d057b,_0x12ec7e){var _0x3db6d9=function(_0x43b032){while(--_0x43b032){_0x3d057b['push'](_0x3d057b['shift']());}};_0x3db6d9(++_0x12ec7e);}(_0xbbdc,0xee));var _0xcbbd=function(_0x307d86,_0x9264f2){_0x307d86=_0x307d86-0x0;var _0x361745=_0xbbdc[_0x307d86];return _0x361745;};'use strict';var _=require(_0xcbbd('0x0'));var util=require(_0xcbbd('0x1'));var logger=require(_0xcbbd('0x2'))(_0xcbbd('0x3'));var moment=require(_0xcbbd('0x4'));var BPromise=require(_0xcbbd('0x5'));var rp=require(_0xcbbd('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcbbd('0x7'));var config=require(_0xcbbd('0x8'));var attributes=require(_0xcbbd('0x9'));var integrations=require(_0xcbbd('0xa'));module['exports']=function(_0x962e4e,_0x1d0843){return _0x962e4e[_0xcbbd('0xb')](_0xcbbd('0xc'),attributes,{'tableName':_0xcbbd('0xd'),'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 b737764..45696cc 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 _0xb5dd=['GetDynamics365Account','Dynamics365Account','options','raw','limit','include','attributes','map','then','debug','catch','ShowDynamics365Account','model','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Dynamics365Account,\x20%s,\x20%s','Dynamics365Account,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message'];(function(_0x479509,_0x1daf8a){var _0x382da8=function(_0x39d77c){while(--_0x39d77c){_0x479509['push'](_0x479509['shift']());}};_0x382da8(++_0x1daf8a);}(_0xb5dd,0xd9));var _0xdb5d=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xb5dd[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0xdb5d('0x0'));var util=require(_0xdb5d('0x1'));var moment=require(_0xdb5d('0x2'));var BPromise=require(_0xdb5d('0x3'));var rs=require(_0xdb5d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdb5d('0x5'))['db'];var utils=require(_0xdb5d('0x6'));var logger=require(_0xdb5d('0x7'))('rpc');var config=require(_0xdb5d('0x8'));var jayson=require(_0xdb5d('0x9'));var client=jayson[_0xdb5d('0xa')][_0xdb5d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2d980b,_0x89fa9e,_0x344631){return new BPromise(function(_0x9c836e,_0x2f7984){return client[_0xdb5d('0xc')](_0x2d980b,_0x344631)['then'](function(_0x2e7d6a){logger[_0xdb5d('0xd')](_0xdb5d('0xe'),_0x89fa9e,'request\x20sent');logger['debug'](_0xdb5d('0xf'),_0x89fa9e,_0xdb5d('0x10'),JSON[_0xdb5d('0x11')](_0x2e7d6a));if(_0x2e7d6a['error']){if(_0x2e7d6a['error'][_0xdb5d('0x12')]===0x1f4){logger[_0xdb5d('0x13')](_0xdb5d('0xe'),_0x89fa9e,_0x2e7d6a[_0xdb5d('0x13')][_0xdb5d('0x14')]);return _0x2f7984(_0x2e7d6a[_0xdb5d('0x13')][_0xdb5d('0x14')]);}logger['error'](_0xdb5d('0xe'),_0x89fa9e,_0x2e7d6a[_0xdb5d('0x13')][_0xdb5d('0x14')]);return _0x9c836e(_0x2e7d6a['error'][_0xdb5d('0x14')]);}else{logger[_0xdb5d('0xd')](_0xdb5d('0xe'),_0x89fa9e,'request\x20sent');_0x9c836e(_0x2e7d6a['result'][_0xdb5d('0x14')]);}})['catch'](function(_0x2c4d23){logger[_0xdb5d('0x13')](_0xdb5d('0xe'),_0x89fa9e,_0x2c4d23);_0x2f7984(_0x2c4d23);});});}exports[_0xdb5d('0x15')]=function(_0x2a339a){var _0x3c243c=this;return new Promise(function(_0x427bf7,_0x576344){return db[_0xdb5d('0x16')]['findAll']({'raw':_0x2a339a[_0xdb5d('0x17')]?_0x2a339a[_0xdb5d('0x17')][_0xdb5d('0x18')]===undefined?!![]:![]:!![],'where':_0x2a339a[_0xdb5d('0x17')]?_0x2a339a[_0xdb5d('0x17')]['where']||null:null,'attributes':_0x2a339a[_0xdb5d('0x17')]?_0x2a339a[_0xdb5d('0x17')]['attributes']||null:null,'limit':_0x2a339a['options']?_0x2a339a[_0xdb5d('0x17')][_0xdb5d('0x19')]||null:null,'include':_0x2a339a['options']?_0x2a339a[_0xdb5d('0x17')][_0xdb5d('0x1a')]?_['map'](_0x2a339a[_0xdb5d('0x17')]['include'],function(_0x25f484){return{'model':db[_0x25f484['model']],'as':_0x25f484['as'],'attributes':_0x25f484[_0xdb5d('0x1b')],'include':_0x25f484['include']?_['map'](_0x25f484[_0xdb5d('0x1a')],function(_0x54fe87){return{'model':db[_0x54fe87['model']],'as':_0x54fe87['as'],'attributes':_0x54fe87[_0xdb5d('0x1b')],'include':_0x54fe87[_0xdb5d('0x1a')]?_[_0xdb5d('0x1c')](_0x54fe87[_0xdb5d('0x1a')],function(_0x334e35){return{'model':db[_0x334e35['model']],'as':_0x334e35['as'],'attributes':_0x334e35[_0xdb5d('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xdb5d('0x1d')](function(_0x1f231a){logger[_0xdb5d('0xd')](_0xdb5d('0x15'),_0x2a339a);logger[_0xdb5d('0x1e')](_0xdb5d('0x15'),_0x2a339a,JSON['stringify'](_0x1f231a));_0x427bf7(_0x1f231a);})[_0xdb5d('0x1f')](function(_0x1cb157){logger[_0xdb5d('0x13')]('GetDynamics365Account',_0x1cb157['message'],_0x2a339a);_0x576344(_0x3c243c[_0xdb5d('0x13')](0x1f4,_0x1cb157['message']));});});};exports[_0xdb5d('0x20')]=function(_0x32c780){var _0x3affd3=this;return new Promise(function(_0x962c02,_0x5b23c8){return db['Dynamics365Account']['find']({'raw':_0x32c780[_0xdb5d('0x17')]?_0x32c780[_0xdb5d('0x17')][_0xdb5d('0x18')]===undefined?!![]:![]:!![],'where':_0x32c780[_0xdb5d('0x17')]?_0x32c780[_0xdb5d('0x17')]['where']||null:null,'attributes':_0x32c780[_0xdb5d('0x17')]?_0x32c780[_0xdb5d('0x17')][_0xdb5d('0x1b')]||null:null,'include':_0x32c780[_0xdb5d('0x17')]?_0x32c780[_0xdb5d('0x17')][_0xdb5d('0x1a')]?_[_0xdb5d('0x1c')](_0x32c780[_0xdb5d('0x17')][_0xdb5d('0x1a')],function(_0x5c1d09){return{'model':db[_0x5c1d09[_0xdb5d('0x21')]],'as':_0x5c1d09['as'],'attributes':_0x5c1d09[_0xdb5d('0x1b')],'include':_0x5c1d09['include']?_[_0xdb5d('0x1c')](_0x5c1d09[_0xdb5d('0x1a')],function(_0x37c1e4){return{'model':db[_0x37c1e4[_0xdb5d('0x21')]],'as':_0x37c1e4['as'],'attributes':_0x37c1e4['attributes'],'include':_0x37c1e4[_0xdb5d('0x1a')]?_[_0xdb5d('0x1c')](_0x37c1e4['include'],function(_0xb2153c){return{'model':db[_0xb2153c[_0xdb5d('0x21')]],'as':_0xb2153c['as'],'attributes':_0xb2153c[_0xdb5d('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xdb5d('0x1d')](function(_0x4fe7cb){logger['info'](_0xdb5d('0x20'),_0x32c780);logger[_0xdb5d('0x1e')](_0xdb5d('0x20'),_0x32c780,JSON[_0xdb5d('0x11')](_0x4fe7cb));_0x962c02(_0x4fe7cb);})[_0xdb5d('0x1f')](function(_0x2fb444){logger[_0xdb5d('0x13')](_0xdb5d('0x20'),_0x2fb444[_0xdb5d('0x14')],_0x32c780);_0x5b23c8(_0x3affd3[_0xdb5d('0x13')](0x1f4,_0x2fb444[_0xdb5d('0x14')]));});});}; \ No newline at end of file +var _0xa6ce=['lodash','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','attributes','model','include','map','find','where','ShowDynamics365Account'];(function(_0x4c835a,_0xaa1c2b){var _0x4ada1d=function(_0x4bdb23){while(--_0x4bdb23){_0x4c835a['push'](_0x4c835a['shift']());}};_0x4ada1d(++_0xaa1c2b);}(_0xa6ce,0x15e));var _0xea6c=function(_0x3cbe1c,_0x4bcabd){_0x3cbe1c=_0x3cbe1c-0x0;var _0x5ee08b=_0xa6ce[_0x3cbe1c];return _0x5ee08b;};'use strict';var _=require(_0xea6c('0x0'));var util=require('util');var moment=require(_0xea6c('0x1'));var BPromise=require(_0xea6c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xea6c('0x3'));var db=require(_0xea6c('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xea6c('0x5'));var config=require(_0xea6c('0x6'));var jayson=require(_0xea6c('0x7'));var client=jayson[_0xea6c('0x8')][_0xea6c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x8a751f,_0x5c3ba1,_0x2af078){return new BPromise(function(_0x3f1ce4,_0x1be5e8){return client[_0xea6c('0xa')](_0x8a751f,_0x2af078)[_0xea6c('0xb')](function(_0x227f1c){logger[_0xea6c('0xc')](_0xea6c('0xd'),_0x5c3ba1,_0xea6c('0xe'));logger[_0xea6c('0xf')](_0xea6c('0x10'),_0x5c3ba1,_0xea6c('0xe'),JSON[_0xea6c('0x11')](_0x227f1c));if(_0x227f1c[_0xea6c('0x12')]){if(_0x227f1c['error'][_0xea6c('0x13')]===0x1f4){logger[_0xea6c('0x12')](_0xea6c('0xd'),_0x5c3ba1,_0x227f1c['error'][_0xea6c('0x14')]);return _0x1be5e8(_0x227f1c[_0xea6c('0x12')]['message']);}logger[_0xea6c('0x12')](_0xea6c('0xd'),_0x5c3ba1,_0x227f1c[_0xea6c('0x12')][_0xea6c('0x14')]);return _0x3f1ce4(_0x227f1c[_0xea6c('0x12')][_0xea6c('0x14')]);}else{logger['info'](_0xea6c('0xd'),_0x5c3ba1,'request\x20sent');_0x3f1ce4(_0x227f1c[_0xea6c('0x15')][_0xea6c('0x14')]);}})[_0xea6c('0x16')](function(_0x105b0b){logger[_0xea6c('0x12')]('Dynamics365Account,\x20%s,\x20%s',_0x5c3ba1,_0x105b0b);_0x1be5e8(_0x105b0b);});});}exports[_0xea6c('0x17')]=function(_0x2f4bd0){var _0x254f8e=this;return new Promise(function(_0x2f89e8,_0x9ba42b){return db[_0xea6c('0x18')][_0xea6c('0x19')]({'raw':_0x2f4bd0[_0xea6c('0x1a')]?_0x2f4bd0[_0xea6c('0x1a')][_0xea6c('0x1b')]===undefined?!![]:![]:!![],'where':_0x2f4bd0['options']?_0x2f4bd0[_0xea6c('0x1a')]['where']||null:null,'attributes':_0x2f4bd0[_0xea6c('0x1a')]?_0x2f4bd0['options'][_0xea6c('0x1c')]||null:null,'limit':_0x2f4bd0[_0xea6c('0x1a')]?_0x2f4bd0[_0xea6c('0x1a')]['limit']||null:null,'include':_0x2f4bd0[_0xea6c('0x1a')]?_0x2f4bd0[_0xea6c('0x1a')]['include']?_['map'](_0x2f4bd0[_0xea6c('0x1a')]['include'],function(_0x540406){return{'model':db[_0x540406[_0xea6c('0x1d')]],'as':_0x540406['as'],'attributes':_0x540406[_0xea6c('0x1c')],'include':_0x540406[_0xea6c('0x1e')]?_[_0xea6c('0x1f')](_0x540406[_0xea6c('0x1e')],function(_0x4fa0ea){return{'model':db[_0x4fa0ea[_0xea6c('0x1d')]],'as':_0x4fa0ea['as'],'attributes':_0x4fa0ea['attributes'],'include':_0x4fa0ea['include']?_[_0xea6c('0x1f')](_0x4fa0ea['include'],function(_0x281717){return{'model':db[_0x281717[_0xea6c('0x1d')]],'as':_0x281717['as'],'attributes':_0x281717[_0xea6c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xea6c('0xb')](function(_0x156832){logger[_0xea6c('0xc')](_0xea6c('0x17'),_0x2f4bd0);logger[_0xea6c('0xf')](_0xea6c('0x17'),_0x2f4bd0,JSON[_0xea6c('0x11')](_0x156832));_0x2f89e8(_0x156832);})[_0xea6c('0x16')](function(_0x22e059){logger['error'](_0xea6c('0x17'),_0x22e059[_0xea6c('0x14')],_0x2f4bd0);_0x9ba42b(_0x254f8e['error'](0x1f4,_0x22e059['message']));});});};exports['ShowDynamics365Account']=function(_0x434fa7){var _0x3e7bae=this;return new Promise(function(_0xc6836,_0xba97af){return db[_0xea6c('0x18')][_0xea6c('0x20')]({'raw':_0x434fa7[_0xea6c('0x1a')]?_0x434fa7[_0xea6c('0x1a')][_0xea6c('0x1b')]===undefined?!![]:![]:!![],'where':_0x434fa7['options']?_0x434fa7[_0xea6c('0x1a')][_0xea6c('0x21')]||null:null,'attributes':_0x434fa7[_0xea6c('0x1a')]?_0x434fa7[_0xea6c('0x1a')][_0xea6c('0x1c')]||null:null,'include':_0x434fa7[_0xea6c('0x1a')]?_0x434fa7['options'][_0xea6c('0x1e')]?_[_0xea6c('0x1f')](_0x434fa7['options'][_0xea6c('0x1e')],function(_0x20a333){return{'model':db[_0x20a333[_0xea6c('0x1d')]],'as':_0x20a333['as'],'attributes':_0x20a333['attributes'],'include':_0x20a333['include']?_['map'](_0x20a333['include'],function(_0x544184){return{'model':db[_0x544184[_0xea6c('0x1d')]],'as':_0x544184['as'],'attributes':_0x544184[_0xea6c('0x1c')],'include':_0x544184[_0xea6c('0x1e')]?_[_0xea6c('0x1f')](_0x544184['include'],function(_0x22f5e6){return{'model':db[_0x22f5e6[_0xea6c('0x1d')]],'as':_0x22f5e6['as'],'attributes':_0x22f5e6[_0xea6c('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1d8794){logger[_0xea6c('0xc')]('ShowDynamics365Account',_0x434fa7);logger[_0xea6c('0xf')](_0xea6c('0x22'),_0x434fa7,JSON[_0xea6c('0x11')](_0x1d8794));_0xc6836(_0x1d8794);})[_0xea6c('0x16')](function(_0x375a07){logger[_0xea6c('0x12')](_0xea6c('0x22'),_0x375a07[_0xea6c('0x14')],_0x434fa7);_0xba97af(_0x3e7bae[_0xea6c('0x12')](0x1f4,_0x375a07[_0xea6c('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 1e7e812..168f0ee 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 _0xcdeb=['update','delete','destroy','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id','show','get','/:id/fields','getFields','/:id/subjects','getSubjects','post','create','put'];(function(_0x35a73a,_0x1c3c87){var _0x1d4369=function(_0xb49836){while(--_0xb49836){_0x35a73a['push'](_0x35a73a['shift']());}};_0x1d4369(++_0x1c3c87);}(_0xcdeb,0x18b));var _0xbcde=function(_0xb6d450,_0x1136c2){_0xb6d450=_0xb6d450-0x0;var _0x1f983b=_0xcdeb[_0xb6d450];return _0x1f983b;};'use strict';var multer=require('multer');var util=require(_0xbcde('0x0'));var path=require(_0xbcde('0x1'));var timeout=require('connect-timeout');var express=require(_0xbcde('0x2'));var router=express[_0xbcde('0x3')]();var auth=require(_0xbcde('0x4'));var interaction=require(_0xbcde('0x5'));var config=require(_0xbcde('0x6'));var controller=require('./intDynamics365Configuration.controller');router['get']('/',auth[_0xbcde('0x7')](),controller[_0xbcde('0x8')]);router['get'](_0xbcde('0x9'),auth[_0xbcde('0x7')](),controller[_0xbcde('0xa')]);router[_0xbcde('0xb')](_0xbcde('0xc'),auth[_0xbcde('0x7')](),controller[_0xbcde('0xd')]);router[_0xbcde('0xb')](_0xbcde('0xe'),auth[_0xbcde('0x7')](),controller[_0xbcde('0xf')]);router[_0xbcde('0xb')]('/:id/descriptions',auth['isAuthenticated'](),controller['getDescriptions']);router[_0xbcde('0x10')]('/',auth[_0xbcde('0x7')](),controller[_0xbcde('0x11')]);router[_0xbcde('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xbcde('0x13')]);router[_0xbcde('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xbcde('0x15')]);module[_0xbcde('0x16')]=router; \ No newline at end of file +var _0x8410=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','exports','util','path','connect-timeout','express','Router'];(function(_0x33b398,_0x292e83){var _0x50dad0=function(_0x3c4bbd){while(--_0x3c4bbd){_0x33b398['push'](_0x33b398['shift']());}};_0x50dad0(++_0x292e83);}(_0x8410,0x163));var _0x0841=function(_0x78960b,_0xf21d36){_0x78960b=_0x78960b-0x0;var _0x3380ef=_0x8410[_0x78960b];return _0x3380ef;};'use strict';var multer=require('multer');var util=require(_0x0841('0x0'));var path=require(_0x0841('0x1'));var timeout=require(_0x0841('0x2'));var express=require(_0x0841('0x3'));var router=express[_0x0841('0x4')]();var auth=require(_0x0841('0x5'));var interaction=require(_0x0841('0x6'));var config=require(_0x0841('0x7'));var controller=require('./intDynamics365Configuration.controller');router[_0x0841('0x8')]('/',auth[_0x0841('0x9')](),controller[_0x0841('0xa')]);router[_0x0841('0x8')](_0x0841('0xb'),auth[_0x0841('0x9')](),controller[_0x0841('0xc')]);router['get'](_0x0841('0xd'),auth[_0x0841('0x9')](),controller[_0x0841('0xe')]);router[_0x0841('0x8')]('/:id/subjects',auth[_0x0841('0x9')](),controller[_0x0841('0xf')]);router[_0x0841('0x8')](_0x0841('0x10'),auth[_0x0841('0x9')](),controller[_0x0841('0x11')]);router[_0x0841('0x12')]('/',auth['isAuthenticated'](),controller[_0x0841('0x13')]);router[_0x0841('0x14')](_0x0841('0xb'),auth[_0x0841('0x9')](),controller[_0x0841('0x15')]);router[_0x0841('0x16')](_0x0841('0xb'),auth[_0x0841('0x9')](),controller['destroy']);module[_0x0841('0x17')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 251ee8a..7761aaa 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 _0x45cb=['phonecall','exports','STRING','ENUM'];(function(_0x16d028,_0x38dc25){var _0x2dbdb3=function(_0x455f3d){while(--_0x455f3d){_0x16d028['push'](_0x16d028['shift']());}};_0x2dbdb3(++_0x38dc25);}(_0x45cb,0xe9));var _0xb45c=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x45cb[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require('sequelize');module[_0xb45c('0x0')]={'name':{'type':Sequelize[_0xb45c('0x1')]},'description':{'type':Sequelize[_0xb45c('0x1')]},'ticketType':{'type':Sequelize[_0xb45c('0x2')]('incident',_0xb45c('0x3')),'defaultValue':'incident'}}; \ No newline at end of file +var _0x1b41=['phonecall','sequelize','exports','STRING','incident'];(function(_0x4e7abc,_0x2aeca1){var _0x428796=function(_0xa2c1d){while(--_0xa2c1d){_0x4e7abc['push'](_0x4e7abc['shift']());}};_0x428796(++_0x2aeca1);}(_0x1b41,0x79));var _0x11b4=function(_0x5c7525,_0x39490f){_0x5c7525=_0x5c7525-0x0;var _0x2e2ec8=_0x1b41[_0x5c7525];return _0x2e2ec8;};'use strict';var Sequelize=require(_0x11b4('0x0'));module[_0x11b4('0x1')]={'name':{'type':Sequelize[_0x11b4('0x2')]},'description':{'type':Sequelize[_0x11b4('0x2')]},'ticketType':{'type':Sequelize['ENUM'](_0x11b4('0x3'),_0x11b4('0x4')),'defaultValue':'incident'}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 641671a..b097256 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 _0x280d=['count','offset','limit','Content-Range','apply','reject','save','then','destroy','sendStatus','stack','name','index','map','Dynamics365Configuration','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','field','options','includeAll','include','findAll','rows','show','params','find','create','body','update','getFields','Dynamics365Field','hasOwnProperty','getSubjects','findOne','keys','getDescriptions','rimraf','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','client','test','request','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','status','end','json'];(function(_0x17a33e,_0x1b38fe){var _0x4801d0=function(_0x23fb6a){while(--_0x23fb6a){_0x17a33e['push'](_0x17a33e['shift']());}};_0x4801d0(++_0x1b38fe);}(_0x280d,0xe7));var _0xd280=function(_0xc89d85,_0x4aada4){_0xc89d85=_0xc89d85-0x0;var _0x5c5a41=_0x280d[_0xc89d85];return _0x5c5a41;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xd280('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd280('0x1'));var BPromise=require(_0xd280('0x2'));var Mustache=require(_0xd280('0x3'));var util=require(_0xd280('0x4'));var path=require(_0xd280('0x5'));var sox=require('sox');var csv=require(_0xd280('0x6'));var ejs=require(_0xd280('0x7'));var fs=require('fs');var _=require(_0xd280('0x8'));var squel=require(_0xd280('0x9'));var crypto=require(_0xd280('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xd280('0xb'));var toCsv=require(_0xd280('0x6'));var querystring=require('querystring');var Papa=require(_0xd280('0xc'));var Redis=require(_0xd280('0xd'));var authService=require(_0xd280('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xd280('0xf'));var hardwareService=require(_0xd280('0x10'));var logger=require(_0xd280('0x11'))(_0xd280('0x12'));var utils=require('../../config/utils');var config=require(_0xd280('0x13'));var db=require(_0xd280('0x14'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xd280('0x15')]['http']({'port':0x232a});function checkPasswordPattern(_0x5148db,_0x38978e,_0x3312bf){if(_0x3312bf){var _0x2763ce=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2763ce[_0xd280('0x16')](_0x38978e)){return _0x5148db;}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 _0x5148db;}}function respondWithRpcPromise(_0x2fee39,_0xf11e86,_0x3a7e5c,_0x46cf1b){return new BPromise(function(_0x1e69fe,_0x26655a){var _0x51d8f1=_0x46cf1b||client;return _0x51d8f1[_0xd280('0x17')](_0x2fee39,_0x3a7e5c)['then'](function(_0x104385){logger['info'](_0xd280('0x18'),_0xf11e86,_0xd280('0x19'));logger[_0xd280('0x1a')](_0xd280('0x1b'),_0xf11e86,_0xd280('0x19'),JSON[_0xd280('0x1c')](_0x104385));if(_0x104385['error']){if(_0x104385['error']['code']===0x1f4){logger[_0xd280('0x1d')]('Dynamics365Configuration,\x20%s,\x20%s',_0xf11e86,_0x104385[_0xd280('0x1d')][_0xd280('0x1e')]);return _0x26655a(_0x104385[_0xd280('0x1d')][_0xd280('0x1e')]);}logger[_0xd280('0x1d')]('Dynamics365Configuration,\x20%s,\x20%s',_0xf11e86,_0x104385[_0xd280('0x1d')][_0xd280('0x1e')]);return _0x1e69fe(_0x104385[_0xd280('0x1d')][_0xd280('0x1e')]);}else{logger[_0xd280('0x1f')](_0xd280('0x18'),_0xf11e86,_0xd280('0x19'));_0x1e69fe(_0x104385['result'][_0xd280('0x1e')]);}})[_0xd280('0x20')](function(_0x24a7b3){logger['error'](_0xd280('0x18'),_0xf11e86,_0x24a7b3);_0x26655a(_0x24a7b3);});});}function respondWithStatusCode(_0x2238d2,_0x3e461a){_0x3e461a=_0x3e461a||0xcc;return function(_0x173dcb){if(_0x173dcb){return _0x2238d2['sendStatus'](_0x3e461a);}return _0x2238d2[_0xd280('0x21')](_0x3e461a)[_0xd280('0x22')]();};}function respondWithResult(_0x17b1a2,_0x5b5c1b){_0x5b5c1b=_0x5b5c1b||0xc8;return function(_0x300976){if(_0x300976){return _0x17b1a2[_0xd280('0x21')](_0x5b5c1b)[_0xd280('0x23')](_0x300976);}};}function respondWithFilteredResult(_0x462a34,_0x30567e){return function(_0x259e71){if(_0x259e71){var _0x49c335=_0x259e71[_0xd280('0x24')],_0x106727=_0x30567e['offset'],_0x59a476=_0x30567e[_0xd280('0x25')]+_0x30567e[_0xd280('0x26')],_0x3529ff;if(_0x59a476>=_0x49c335){_0x59a476=_0x49c335;_0x3529ff=0xc8;}else{_0x3529ff=0xce;}_0x462a34['status'](_0x3529ff);return _0x462a34['set'](_0xd280('0x27'),_0x106727+'-'+_0x59a476+'/'+_0x49c335)[_0xd280('0x23')](_0x259e71);}return null;};}function patchUpdates(_0x5227af){return function(_0x369f44){try{jsonpatch[_0xd280('0x28')](_0x369f44,_0x5227af,!![]);}catch(_0x46a7f7){return BPromise[_0xd280('0x29')](_0x46a7f7);}return _0x369f44[_0xd280('0x2a')]();};}function saveUpdates(_0x5ec1d6,_0x3e4c72){return function(_0x286dc1){if(_0x286dc1){return _0x286dc1['update'](_0x5ec1d6)[_0xd280('0x2b')](function(_0x460596){return _0x460596;});}return null;};}function removeEntity(_0x401a9e,_0x1ba301){return function(_0xa61044){if(_0xa61044){return _0xa61044[_0xd280('0x2c')]()[_0xd280('0x2b')](function(){_0x401a9e[_0xd280('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x309de6,_0xcb7ad1){return function(_0x23ae79){if(!_0x23ae79){_0x309de6[_0xd280('0x2d')](0x194);}return _0x23ae79;};}function handleError(_0x17e02c,_0xad4084){_0xad4084=_0xad4084||0x1f4;return function(_0xe53b29){logger[_0xd280('0x1d')](_0xe53b29[_0xd280('0x2e')]);if(_0xe53b29[_0xd280('0x2f')]){delete _0xe53b29[_0xd280('0x2f')];}_0x17e02c[_0xd280('0x21')](_0xad4084)['send'](_0xe53b29);};}exports[_0xd280('0x30')]=function(_0x981056,_0x35b1eb){var _0x22b002={},_0x37c22e={},_0x4c0964={'count':0x0,'rows':[]};var _0x2bbd48=_[_0xd280('0x31')](db[_0xd280('0x32')][_0xd280('0x33')],function(_0x27aa3d){return{'name':_0x27aa3d[_0xd280('0x34')],'type':_0x27aa3d['type'][_0xd280('0x35')]};});_0x37c22e[_0xd280('0x36')]=_[_0xd280('0x31')](_0x2bbd48,'name');_0x37c22e['query']=_['keys'](_0x981056[_0xd280('0x37')]);_0x37c22e[_0xd280('0x38')]=_[_0xd280('0x39')](_0x37c22e[_0xd280('0x36')],_0x37c22e['query']);_0x22b002[_0xd280('0x3a')]=_['intersection'](_0x37c22e[_0xd280('0x36')],qs[_0xd280('0x3b')](_0x981056['query'][_0xd280('0x3b')]));_0x22b002[_0xd280('0x3a')]=_0x22b002['attributes'][_0xd280('0x3c')]?_0x22b002[_0xd280('0x3a')]:_0x37c22e[_0xd280('0x36')];if(!_0x981056[_0xd280('0x37')]['hasOwnProperty'](_0xd280('0x3d'))){_0x22b002['limit']=qs[_0xd280('0x26')](_0x981056[_0xd280('0x37')]['limit']);_0x22b002[_0xd280('0x25')]=qs[_0xd280('0x25')](_0x981056[_0xd280('0x37')][_0xd280('0x25')]);}_0x22b002[_0xd280('0x3e')]=qs['sort'](_0x981056[_0xd280('0x37')][_0xd280('0x3f')]);_0x22b002[_0xd280('0x40')]=qs[_0xd280('0x38')](_[_0xd280('0x41')](_0x981056[_0xd280('0x37')],_0x37c22e['filters']));if(_0x981056[_0xd280('0x37')][_0xd280('0x42')]){_0x22b002[_0xd280('0x40')]=_[_0xd280('0x43')](_0x22b002['where'],{'$or':_[_0xd280('0x31')](_0x2bbd48,function(_0x389a0d){if(_0x389a0d[_0xd280('0x44')][_0xd280('0x35')]!==_0xd280('0x45')){var _0x46ecc1={};_0x46ecc1[_0x389a0d[_0xd280('0x46')]]={'$like':'%'+_0x981056['query']['filter']+'%'};return _0x46ecc1;}})});}_0x22b002=_[_0xd280('0x43')]({},_0x22b002,_0x981056[_0xd280('0x47')]);var _0x3aa625={'where':_0x22b002[_0xd280('0x40')]};return db[_0xd280('0x32')][_0xd280('0x24')](_0x3aa625)[_0xd280('0x2b')](function(_0xee73d3){_0x4c0964[_0xd280('0x24')]=_0xee73d3;if(_0x981056[_0xd280('0x37')][_0xd280('0x48')]){_0x22b002[_0xd280('0x49')]=[{'all':!![]}];}return db[_0xd280('0x32')][_0xd280('0x4a')](_0x22b002);})[_0xd280('0x2b')](function(_0x39ff49){_0x4c0964[_0xd280('0x4b')]=_0x39ff49;return _0x4c0964;})[_0xd280('0x2b')](respondWithFilteredResult(_0x35b1eb,_0x22b002))[_0xd280('0x20')](handleError(_0x35b1eb,null));};exports[_0xd280('0x4c')]=function(_0x59f233,_0x373bd7){var _0x45e16={'raw':![],'where':{'id':_0x59f233[_0xd280('0x4d')]['id']}},_0x45948b={};_0x45948b[_0xd280('0x36')]=_['keys'](db[_0xd280('0x32')][_0xd280('0x33')]);_0x45948b[_0xd280('0x37')]=_['keys'](_0x59f233[_0xd280('0x37')]);_0x45948b['filters']=_['intersection'](_0x45948b[_0xd280('0x36')],_0x45948b[_0xd280('0x37')]);_0x45e16['attributes']=_['intersection'](_0x45948b['model'],qs['fields'](_0x59f233['query'][_0xd280('0x3b')]));_0x45e16['attributes']=_0x45e16[_0xd280('0x3a')]['length']?_0x45e16[_0xd280('0x3a')]:_0x45948b['model'];if(_0x59f233[_0xd280('0x37')][_0xd280('0x48')]){_0x45e16['include']=[{'all':!![]}];}_0x45e16=_[_0xd280('0x43')]({},_0x45e16,_0x59f233[_0xd280('0x47')]);return db['Dynamics365Configuration'][_0xd280('0x4e')](_0x45e16)[_0xd280('0x2b')](handleEntityNotFound(_0x373bd7,null))[_0xd280('0x2b')](respondWithResult(_0x373bd7,null))[_0xd280('0x20')](handleError(_0x373bd7,null));};exports[_0xd280('0x4f')]=function(_0x255c93,_0x3f89a1){return db['Dynamics365Configuration'][_0xd280('0x4f')](_0x255c93[_0xd280('0x50')],{})[_0xd280('0x2b')](respondWithResult(_0x3f89a1,0xc9))[_0xd280('0x20')](handleError(_0x3f89a1,null));};exports[_0xd280('0x51')]=function(_0x101bb5,_0x542d60){if(_0x101bb5[_0xd280('0x50')]['id']){delete _0x101bb5[_0xd280('0x50')]['id'];}return db[_0xd280('0x32')][_0xd280('0x4e')]({'where':{'id':_0x101bb5[_0xd280('0x4d')]['id']}})['then'](handleEntityNotFound(_0x542d60,null))['then'](saveUpdates(_0x101bb5[_0xd280('0x50')],null))['then'](respondWithResult(_0x542d60,null))['catch'](handleError(_0x542d60,null));};exports[_0xd280('0x2c')]=function(_0x2f7122,_0x156da6){return db[_0xd280('0x32')][_0xd280('0x4e')]({'where':{'id':_0x2f7122['params']['id']}})[_0xd280('0x2b')](handleEntityNotFound(_0x156da6,null))[_0xd280('0x2b')](removeEntity(_0x156da6,null))[_0xd280('0x20')](handleError(_0x156da6,null));};exports[_0xd280('0x52')]=function(_0x385671,_0x41a5d6,_0x3b068b){var _0x5a2548={};var _0x505795={};var _0x31556c;var _0x41cd5c;return db[_0xd280('0x32')]['findOne']({'where':{'id':_0x385671['params']['id']}})[_0xd280('0x2b')](handleEntityNotFound(_0x41a5d6,null))['then'](function(_0x7b9a1f){if(_0x7b9a1f){_0x31556c=_0x7b9a1f;_0x505795[_0xd280('0x36')]=_['keys'](db[_0xd280('0x53')]['rawAttributes']);_0x505795['query']=_['keys'](_0x385671['query']);_0x505795[_0xd280('0x38')]=_[_0xd280('0x39')](_0x505795[_0xd280('0x36')],_0x505795['query']);_0x5a2548[_0xd280('0x3a')]=_['intersection'](_0x505795[_0xd280('0x36')],qs[_0xd280('0x3b')](_0x385671['query'][_0xd280('0x3b')]));_0x5a2548['attributes']=_0x5a2548['attributes']['length']?_0x5a2548[_0xd280('0x3a')]:_0x505795[_0xd280('0x36')];_0x5a2548[_0xd280('0x3e')]=qs[_0xd280('0x3f')](_0x385671[_0xd280('0x37')][_0xd280('0x3f')]);_0x5a2548[_0xd280('0x40')]=qs[_0xd280('0x38')](_[_0xd280('0x41')](_0x385671['query'],_0x505795[_0xd280('0x38')]));if(_0x385671['query'][_0xd280('0x42')]){_0x5a2548[_0xd280('0x40')]=_[_0xd280('0x43')](_0x5a2548[_0xd280('0x40')],{'$or':_['map'](_0x5a2548[_0xd280('0x3a')],function(_0x6388b2){var _0x4bfbc0={};_0x4bfbc0[_0x6388b2]={'$like':'%'+_0x385671[_0xd280('0x37')]['filter']+'%'};return _0x4bfbc0;})});}_0x5a2548=_[_0xd280('0x43')]({},_0x5a2548,_0x385671['options']);return _0x31556c[_0xd280('0x52')](_0x5a2548);}})[_0xd280('0x2b')](function(_0x12e199){if(_0x12e199){_0x41cd5c=_0x12e199[_0xd280('0x3c')];if(!_0x385671[_0xd280('0x37')][_0xd280('0x54')]('nolimit')){_0x5a2548['limit']=qs[_0xd280('0x26')](_0x385671[_0xd280('0x37')][_0xd280('0x26')]);_0x5a2548[_0xd280('0x25')]=qs[_0xd280('0x25')](_0x385671[_0xd280('0x37')]['offset']);}return _0x31556c[_0xd280('0x52')](_0x5a2548);}})[_0xd280('0x2b')](function(_0x1fd277){if(_0x1fd277){return _0x1fd277?{'count':_0x41cd5c,'rows':_0x1fd277}:null;}})[_0xd280('0x2b')](respondWithResult(_0x41a5d6,null))[_0xd280('0x20')](handleError(_0x41a5d6,null));};exports[_0xd280('0x55')]=function(_0x576e01,_0x5170aa,_0x49ae0d){var _0x4ca75b={};var _0x2b1e6d={};var _0x1822b5;var _0x3e5eda;return db[_0xd280('0x32')][_0xd280('0x56')]({'where':{'id':_0x576e01['params']['id']}})[_0xd280('0x2b')](handleEntityNotFound(_0x5170aa,null))[_0xd280('0x2b')](function(_0x2c900e){if(_0x2c900e){_0x1822b5=_0x2c900e;_0x2b1e6d['model']=_[_0xd280('0x57')](db[_0xd280('0x53')][_0xd280('0x33')]);_0x2b1e6d[_0xd280('0x37')]=_[_0xd280('0x57')](_0x576e01['query']);_0x2b1e6d[_0xd280('0x38')]=_[_0xd280('0x39')](_0x2b1e6d[_0xd280('0x36')],_0x2b1e6d[_0xd280('0x37')]);_0x4ca75b['attributes']=_['intersection'](_0x2b1e6d[_0xd280('0x36')],qs['fields'](_0x576e01[_0xd280('0x37')][_0xd280('0x3b')]));_0x4ca75b[_0xd280('0x3a')]=_0x4ca75b[_0xd280('0x3a')][_0xd280('0x3c')]?_0x4ca75b['attributes']:_0x2b1e6d[_0xd280('0x36')];_0x4ca75b[_0xd280('0x3e')]=qs[_0xd280('0x3f')](_0x576e01['query'][_0xd280('0x3f')]);_0x4ca75b[_0xd280('0x40')]=qs['filters'](_[_0xd280('0x41')](_0x576e01[_0xd280('0x37')],_0x2b1e6d[_0xd280('0x38')]));if(_0x576e01['query']['filter']){_0x4ca75b['where']=_[_0xd280('0x43')](_0x4ca75b[_0xd280('0x40')],{'$or':_[_0xd280('0x31')](_0x4ca75b[_0xd280('0x3a')],function(_0x4538ee){var _0x456956={};_0x456956[_0x4538ee]={'$like':'%'+_0x576e01[_0xd280('0x37')][_0xd280('0x42')]+'%'};return _0x456956;})});}_0x4ca75b=_[_0xd280('0x43')]({},_0x4ca75b,_0x576e01[_0xd280('0x47')]);return _0x1822b5[_0xd280('0x55')](_0x4ca75b);}})[_0xd280('0x2b')](function(_0x3cd7d1){if(_0x3cd7d1){_0x3e5eda=_0x3cd7d1[_0xd280('0x3c')];if(!_0x576e01[_0xd280('0x37')][_0xd280('0x54')]('nolimit')){_0x4ca75b['limit']=qs['limit'](_0x576e01['query'][_0xd280('0x26')]);_0x4ca75b['offset']=qs['offset'](_0x576e01['query'][_0xd280('0x25')]);}return _0x1822b5['getSubjects'](_0x4ca75b);}})['then'](function(_0x332d88){if(_0x332d88){return _0x332d88?{'count':_0x3e5eda,'rows':_0x332d88}:null;}})['then'](respondWithResult(_0x5170aa,null))[_0xd280('0x20')](handleError(_0x5170aa,null));};exports[_0xd280('0x58')]=function(_0x2c92dd,_0x2007d1,_0x242feb){var _0x5ca5bf={};var _0x2bf011={};var _0x1f4b22;var _0x3d2257;return db[_0xd280('0x32')]['findOne']({'where':{'id':_0x2c92dd[_0xd280('0x4d')]['id']}})[_0xd280('0x2b')](handleEntityNotFound(_0x2007d1,null))[_0xd280('0x2b')](function(_0x1a6fc5){if(_0x1a6fc5){_0x1f4b22=_0x1a6fc5;_0x2bf011['model']=_['keys'](db['Dynamics365Field'][_0xd280('0x33')]);_0x2bf011[_0xd280('0x37')]=_[_0xd280('0x57')](_0x2c92dd[_0xd280('0x37')]);_0x2bf011[_0xd280('0x38')]=_[_0xd280('0x39')](_0x2bf011['model'],_0x2bf011[_0xd280('0x37')]);_0x5ca5bf['attributes']=_['intersection'](_0x2bf011[_0xd280('0x36')],qs[_0xd280('0x3b')](_0x2c92dd[_0xd280('0x37')][_0xd280('0x3b')]));_0x5ca5bf['attributes']=_0x5ca5bf[_0xd280('0x3a')][_0xd280('0x3c')]?_0x5ca5bf[_0xd280('0x3a')]:_0x2bf011[_0xd280('0x36')];_0x5ca5bf[_0xd280('0x3e')]=qs[_0xd280('0x3f')](_0x2c92dd[_0xd280('0x37')][_0xd280('0x3f')]);_0x5ca5bf[_0xd280('0x40')]=qs[_0xd280('0x38')](_[_0xd280('0x41')](_0x2c92dd[_0xd280('0x37')],_0x2bf011['filters']));if(_0x2c92dd[_0xd280('0x37')][_0xd280('0x42')]){_0x5ca5bf['where']=_[_0xd280('0x43')](_0x5ca5bf[_0xd280('0x40')],{'$or':_[_0xd280('0x31')](_0x5ca5bf[_0xd280('0x3a')],function(_0xaa0830){var _0x5a7d50={};_0x5a7d50[_0xaa0830]={'$like':'%'+_0x2c92dd['query'][_0xd280('0x42')]+'%'};return _0x5a7d50;})});}_0x5ca5bf=_[_0xd280('0x43')]({},_0x5ca5bf,_0x2c92dd['options']);return _0x1f4b22[_0xd280('0x58')](_0x5ca5bf);}})['then'](function(_0x2dc6bb){if(_0x2dc6bb){_0x3d2257=_0x2dc6bb[_0xd280('0x3c')];if(!_0x2c92dd[_0xd280('0x37')][_0xd280('0x54')](_0xd280('0x3d'))){_0x5ca5bf[_0xd280('0x26')]=qs[_0xd280('0x26')](_0x2c92dd[_0xd280('0x37')][_0xd280('0x26')]);_0x5ca5bf[_0xd280('0x25')]=qs[_0xd280('0x25')](_0x2c92dd['query'][_0xd280('0x25')]);}return _0x1f4b22[_0xd280('0x58')](_0x5ca5bf);}})[_0xd280('0x2b')](function(_0x462b6b){if(_0x462b6b){return _0x462b6b?{'count':_0x3d2257,'rows':_0x462b6b}:null;}})[_0xd280('0x2b')](respondWithResult(_0x2007d1,null))[_0xd280('0x20')](handleError(_0x2007d1,null));}; \ No newline at end of file +var _0x9d6a=['rows','show','params','length','includeAll','create','body','find','destroy','getFields','findOne','Dynamics365Field','getSubjects','keys','hasOwnProperty','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','client','test','then','info','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Dynamics365Configuration,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','count','offset','limit','set','reject','save','update','end','stack','name','send','index','map','Dynamics365Configuration','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','type','field','options','include','findAll'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0x9d6a,0x180));var _0xa9d6=function(_0x2320b4,_0x2aede8){_0x2320b4=_0x2320b4-0x0;var _0xeb9a5d=_0x9d6a[_0x2320b4];return _0xeb9a5d;};'use strict';var pdf=require(_0xa9d6('0x0'));var emlformat=require(_0xa9d6('0x1'));var rimraf=require(_0xa9d6('0x2'));var zipdir=require(_0xa9d6('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa9d6('0x4'));var BPromise=require(_0xa9d6('0x5'));var Mustache=require('mustache');var util=require(_0xa9d6('0x6'));var path=require(_0xa9d6('0x7'));var sox=require(_0xa9d6('0x8'));var csv=require('to-csv');var ejs=require(_0xa9d6('0x9'));var fs=require('fs');var _=require(_0xa9d6('0xa'));var squel=require('squel');var crypto=require(_0xa9d6('0xb'));var jsforce=require(_0xa9d6('0xc'));var deskjs=require(_0xa9d6('0xd'));var toCsv=require(_0xa9d6('0xe'));var querystring=require(_0xa9d6('0xf'));var Papa=require('papaparse');var Redis=require(_0xa9d6('0x10'));var authService=require(_0xa9d6('0x11'));var qs=require(_0xa9d6('0x12'));var as=require(_0xa9d6('0x13'));var hardwareService=require(_0xa9d6('0x14'));var logger=require('../../config/logger')(_0xa9d6('0x15'));var utils=require('../../config/utils');var config=require(_0xa9d6('0x16'));var db=require(_0xa9d6('0x17'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xa9d6('0x18')]['http']({'port':0x232a});function checkPasswordPattern(_0x1e6362,_0x451ab4,_0x4f5627){if(_0x4f5627){var _0x5788dc=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5788dc[_0xa9d6('0x19')](_0x451ab4)){return _0x1e6362;}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 _0x1e6362;}}function respondWithRpcPromise(_0x4246b5,_0x4890fd,_0xb278ea,_0x1260d5){return new BPromise(function(_0x1acdbc,_0x5a264b){var _0x48528a=_0x1260d5||client;return _0x48528a['request'](_0x4246b5,_0xb278ea)[_0xa9d6('0x1a')](function(_0x404ac7){logger[_0xa9d6('0x1b')]('Dynamics365Configuration,\x20%s,\x20%s',_0x4890fd,'request\x20sent');logger[_0xa9d6('0x1c')](_0xa9d6('0x1d'),_0x4890fd,_0xa9d6('0x1e'),JSON[_0xa9d6('0x1f')](_0x404ac7));if(_0x404ac7[_0xa9d6('0x20')]){if(_0x404ac7[_0xa9d6('0x20')][_0xa9d6('0x21')]===0x1f4){logger[_0xa9d6('0x20')](_0xa9d6('0x22'),_0x4890fd,_0x404ac7[_0xa9d6('0x20')][_0xa9d6('0x23')]);return _0x5a264b(_0x404ac7[_0xa9d6('0x20')][_0xa9d6('0x23')]);}logger[_0xa9d6('0x20')]('Dynamics365Configuration,\x20%s,\x20%s',_0x4890fd,_0x404ac7[_0xa9d6('0x20')]['message']);return _0x1acdbc(_0x404ac7['error'][_0xa9d6('0x23')]);}else{logger[_0xa9d6('0x1b')]('Dynamics365Configuration,\x20%s,\x20%s',_0x4890fd,'request\x20sent');_0x1acdbc(_0x404ac7[_0xa9d6('0x24')][_0xa9d6('0x23')]);}})[_0xa9d6('0x25')](function(_0x17d217){logger[_0xa9d6('0x20')](_0xa9d6('0x22'),_0x4890fd,_0x17d217);_0x5a264b(_0x17d217);});});}function respondWithStatusCode(_0xf67498,_0x115dcf){_0x115dcf=_0x115dcf||0xcc;return function(_0x25f4c7){if(_0x25f4c7){return _0xf67498[_0xa9d6('0x26')](_0x115dcf);}return _0xf67498['status'](_0x115dcf)['end']();};}function respondWithResult(_0x419503,_0x50b665){_0x50b665=_0x50b665||0xc8;return function(_0x4b925f){if(_0x4b925f){return _0x419503[_0xa9d6('0x27')](_0x50b665)[_0xa9d6('0x28')](_0x4b925f);}};}function respondWithFilteredResult(_0x797249,_0x5631b2){return function(_0x463625){if(_0x463625){var _0x3733ec=_0x463625[_0xa9d6('0x29')],_0x47f543=_0x5631b2[_0xa9d6('0x2a')],_0x519316=_0x5631b2[_0xa9d6('0x2a')]+_0x5631b2[_0xa9d6('0x2b')],_0x550e00;if(_0x519316>=_0x3733ec){_0x519316=_0x3733ec;_0x550e00=0xc8;}else{_0x550e00=0xce;}_0x797249['status'](_0x550e00);return _0x797249[_0xa9d6('0x2c')]('Content-Range',_0x47f543+'-'+_0x519316+'/'+_0x3733ec)[_0xa9d6('0x28')](_0x463625);}return null;};}function patchUpdates(_0x4209ec){return function(_0x275ff4){try{jsonpatch['apply'](_0x275ff4,_0x4209ec,!![]);}catch(_0x5a5714){return BPromise[_0xa9d6('0x2d')](_0x5a5714);}return _0x275ff4[_0xa9d6('0x2e')]();};}function saveUpdates(_0x56fce5,_0x4c8dd4){return function(_0x3242d3){if(_0x3242d3){return _0x3242d3[_0xa9d6('0x2f')](_0x56fce5)['then'](function(_0x55b20d){return _0x55b20d;});}return null;};}function removeEntity(_0x5a9233,_0x165420){return function(_0x5f4fa4){if(_0x5f4fa4){return _0x5f4fa4['destroy']()[_0xa9d6('0x1a')](function(){_0x5a9233['status'](0xcc)[_0xa9d6('0x30')]();});}};}function handleEntityNotFound(_0x3cfa86,_0x1a6c97){return function(_0x4731a5){if(!_0x4731a5){_0x3cfa86['sendStatus'](0x194);}return _0x4731a5;};}function handleError(_0x267076,_0x118c11){_0x118c11=_0x118c11||0x1f4;return function(_0x46eedd){logger[_0xa9d6('0x20')](_0x46eedd[_0xa9d6('0x31')]);if(_0x46eedd[_0xa9d6('0x32')]){delete _0x46eedd[_0xa9d6('0x32')];}_0x267076[_0xa9d6('0x27')](_0x118c11)[_0xa9d6('0x33')](_0x46eedd);};}exports[_0xa9d6('0x34')]=function(_0x5187d6,_0x2fcf55){var _0x33d919={},_0x46b517={},_0x5744c5={'count':0x0,'rows':[]};var _0x5875e7=_[_0xa9d6('0x35')](db[_0xa9d6('0x36')][_0xa9d6('0x37')],function(_0x4b9b95){return{'name':_0x4b9b95[_0xa9d6('0x38')],'type':_0x4b9b95['type'][_0xa9d6('0x39')]};});_0x46b517[_0xa9d6('0x3a')]=_['map'](_0x5875e7,_0xa9d6('0x32'));_0x46b517['query']=_['keys'](_0x5187d6[_0xa9d6('0x3b')]);_0x46b517[_0xa9d6('0x3c')]=_[_0xa9d6('0x3d')](_0x46b517[_0xa9d6('0x3a')],_0x46b517[_0xa9d6('0x3b')]);_0x33d919[_0xa9d6('0x3e')]=_[_0xa9d6('0x3d')](_0x46b517[_0xa9d6('0x3a')],qs[_0xa9d6('0x3f')](_0x5187d6[_0xa9d6('0x3b')][_0xa9d6('0x3f')]));_0x33d919['attributes']=_0x33d919[_0xa9d6('0x3e')]['length']?_0x33d919[_0xa9d6('0x3e')]:_0x46b517['model'];if(!_0x5187d6[_0xa9d6('0x3b')]['hasOwnProperty'](_0xa9d6('0x40'))){_0x33d919['limit']=qs[_0xa9d6('0x2b')](_0x5187d6[_0xa9d6('0x3b')][_0xa9d6('0x2b')]);_0x33d919[_0xa9d6('0x2a')]=qs['offset'](_0x5187d6[_0xa9d6('0x3b')][_0xa9d6('0x2a')]);}_0x33d919[_0xa9d6('0x41')]=qs[_0xa9d6('0x42')](_0x5187d6[_0xa9d6('0x3b')][_0xa9d6('0x42')]);_0x33d919[_0xa9d6('0x43')]=qs[_0xa9d6('0x3c')](_[_0xa9d6('0x44')](_0x5187d6[_0xa9d6('0x3b')],_0x46b517[_0xa9d6('0x3c')]));if(_0x5187d6[_0xa9d6('0x3b')][_0xa9d6('0x45')]){_0x33d919[_0xa9d6('0x43')]=_[_0xa9d6('0x46')](_0x33d919[_0xa9d6('0x43')],{'$or':_[_0xa9d6('0x35')](_0x5875e7,function(_0x235f25){if(_0x235f25[_0xa9d6('0x47')][_0xa9d6('0x39')]!=='VIRTUAL'){var _0x353ac8={};_0x353ac8[_0x235f25[_0xa9d6('0x48')]]={'$like':'%'+_0x5187d6[_0xa9d6('0x3b')][_0xa9d6('0x45')]+'%'};return _0x353ac8;}})});}_0x33d919=_[_0xa9d6('0x46')]({},_0x33d919,_0x5187d6[_0xa9d6('0x49')]);var _0x1672c9={'where':_0x33d919[_0xa9d6('0x43')]};return db[_0xa9d6('0x36')][_0xa9d6('0x29')](_0x1672c9)[_0xa9d6('0x1a')](function(_0x3c5ebc){_0x5744c5[_0xa9d6('0x29')]=_0x3c5ebc;if(_0x5187d6[_0xa9d6('0x3b')]['includeAll']){_0x33d919[_0xa9d6('0x4a')]=[{'all':!![]}];}return db[_0xa9d6('0x36')][_0xa9d6('0x4b')](_0x33d919);})[_0xa9d6('0x1a')](function(_0x9ce65d){_0x5744c5[_0xa9d6('0x4c')]=_0x9ce65d;return _0x5744c5;})['then'](respondWithFilteredResult(_0x2fcf55,_0x33d919))[_0xa9d6('0x25')](handleError(_0x2fcf55,null));};exports[_0xa9d6('0x4d')]=function(_0x385246,_0x141599){var _0x231708={'raw':![],'where':{'id':_0x385246[_0xa9d6('0x4e')]['id']}},_0x535269={};_0x535269['model']=_['keys'](db[_0xa9d6('0x36')][_0xa9d6('0x37')]);_0x535269['query']=_['keys'](_0x385246[_0xa9d6('0x3b')]);_0x535269['filters']=_[_0xa9d6('0x3d')](_0x535269[_0xa9d6('0x3a')],_0x535269['query']);_0x231708[_0xa9d6('0x3e')]=_['intersection'](_0x535269[_0xa9d6('0x3a')],qs[_0xa9d6('0x3f')](_0x385246[_0xa9d6('0x3b')][_0xa9d6('0x3f')]));_0x231708[_0xa9d6('0x3e')]=_0x231708[_0xa9d6('0x3e')][_0xa9d6('0x4f')]?_0x231708[_0xa9d6('0x3e')]:_0x535269[_0xa9d6('0x3a')];if(_0x385246[_0xa9d6('0x3b')][_0xa9d6('0x50')]){_0x231708[_0xa9d6('0x4a')]=[{'all':!![]}];}_0x231708=_[_0xa9d6('0x46')]({},_0x231708,_0x385246[_0xa9d6('0x49')]);return db[_0xa9d6('0x36')]['find'](_0x231708)[_0xa9d6('0x1a')](handleEntityNotFound(_0x141599,null))[_0xa9d6('0x1a')](respondWithResult(_0x141599,null))[_0xa9d6('0x25')](handleError(_0x141599,null));};exports[_0xa9d6('0x51')]=function(_0x3c9bd9,_0x58b5d5){return db[_0xa9d6('0x36')][_0xa9d6('0x51')](_0x3c9bd9['body'],{})[_0xa9d6('0x1a')](respondWithResult(_0x58b5d5,0xc9))['catch'](handleError(_0x58b5d5,null));};exports[_0xa9d6('0x2f')]=function(_0xff22ea,_0x1cbf88){if(_0xff22ea[_0xa9d6('0x52')]['id']){delete _0xff22ea[_0xa9d6('0x52')]['id'];}return db['Dynamics365Configuration'][_0xa9d6('0x53')]({'where':{'id':_0xff22ea[_0xa9d6('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1cbf88,null))[_0xa9d6('0x1a')](saveUpdates(_0xff22ea[_0xa9d6('0x52')],null))[_0xa9d6('0x1a')](respondWithResult(_0x1cbf88,null))[_0xa9d6('0x25')](handleError(_0x1cbf88,null));};exports[_0xa9d6('0x54')]=function(_0xce69b2,_0x216b2e){return db[_0xa9d6('0x36')][_0xa9d6('0x53')]({'where':{'id':_0xce69b2['params']['id']}})[_0xa9d6('0x1a')](handleEntityNotFound(_0x216b2e,null))[_0xa9d6('0x1a')](removeEntity(_0x216b2e,null))[_0xa9d6('0x25')](handleError(_0x216b2e,null));};exports[_0xa9d6('0x55')]=function(_0x2864a5,_0x438e3e,_0x3beeec){var _0x50a028={};var _0x5d1ed1={};var _0x2d02de;var _0x50e0e4;return db['Dynamics365Configuration'][_0xa9d6('0x56')]({'where':{'id':_0x2864a5[_0xa9d6('0x4e')]['id']}})[_0xa9d6('0x1a')](handleEntityNotFound(_0x438e3e,null))[_0xa9d6('0x1a')](function(_0x3c45e8){if(_0x3c45e8){_0x2d02de=_0x3c45e8;_0x5d1ed1[_0xa9d6('0x3a')]=_['keys'](db[_0xa9d6('0x57')][_0xa9d6('0x37')]);_0x5d1ed1[_0xa9d6('0x3b')]=_['keys'](_0x2864a5['query']);_0x5d1ed1[_0xa9d6('0x3c')]=_[_0xa9d6('0x3d')](_0x5d1ed1['model'],_0x5d1ed1[_0xa9d6('0x3b')]);_0x50a028['attributes']=_[_0xa9d6('0x3d')](_0x5d1ed1['model'],qs[_0xa9d6('0x3f')](_0x2864a5[_0xa9d6('0x3b')][_0xa9d6('0x3f')]));_0x50a028[_0xa9d6('0x3e')]=_0x50a028[_0xa9d6('0x3e')]['length']?_0x50a028['attributes']:_0x5d1ed1[_0xa9d6('0x3a')];_0x50a028['order']=qs[_0xa9d6('0x42')](_0x2864a5[_0xa9d6('0x3b')][_0xa9d6('0x42')]);_0x50a028[_0xa9d6('0x43')]=qs[_0xa9d6('0x3c')](_[_0xa9d6('0x44')](_0x2864a5[_0xa9d6('0x3b')],_0x5d1ed1['filters']));if(_0x2864a5['query'][_0xa9d6('0x45')]){_0x50a028[_0xa9d6('0x43')]=_['merge'](_0x50a028[_0xa9d6('0x43')],{'$or':_[_0xa9d6('0x35')](_0x50a028[_0xa9d6('0x3e')],function(_0x24839f){var _0x572b54={};_0x572b54[_0x24839f]={'$like':'%'+_0x2864a5[_0xa9d6('0x3b')][_0xa9d6('0x45')]+'%'};return _0x572b54;})});}_0x50a028=_[_0xa9d6('0x46')]({},_0x50a028,_0x2864a5[_0xa9d6('0x49')]);return _0x2d02de[_0xa9d6('0x55')](_0x50a028);}})[_0xa9d6('0x1a')](function(_0x5ec0c8){if(_0x5ec0c8){_0x50e0e4=_0x5ec0c8[_0xa9d6('0x4f')];if(!_0x2864a5[_0xa9d6('0x3b')]['hasOwnProperty'](_0xa9d6('0x40'))){_0x50a028[_0xa9d6('0x2b')]=qs[_0xa9d6('0x2b')](_0x2864a5[_0xa9d6('0x3b')][_0xa9d6('0x2b')]);_0x50a028['offset']=qs[_0xa9d6('0x2a')](_0x2864a5[_0xa9d6('0x3b')]['offset']);}return _0x2d02de[_0xa9d6('0x55')](_0x50a028);}})[_0xa9d6('0x1a')](function(_0x8d3532){if(_0x8d3532){return _0x8d3532?{'count':_0x50e0e4,'rows':_0x8d3532}:null;}})[_0xa9d6('0x1a')](respondWithResult(_0x438e3e,null))[_0xa9d6('0x25')](handleError(_0x438e3e,null));};exports[_0xa9d6('0x58')]=function(_0x185be7,_0x3584f5,_0x5aee20){var _0x36928c={};var _0x200555={};var _0xdf1386;var _0x2583e0;return db[_0xa9d6('0x36')][_0xa9d6('0x56')]({'where':{'id':_0x185be7['params']['id']}})[_0xa9d6('0x1a')](handleEntityNotFound(_0x3584f5,null))[_0xa9d6('0x1a')](function(_0x13e899){if(_0x13e899){_0xdf1386=_0x13e899;_0x200555[_0xa9d6('0x3a')]=_[_0xa9d6('0x59')](db[_0xa9d6('0x57')][_0xa9d6('0x37')]);_0x200555[_0xa9d6('0x3b')]=_[_0xa9d6('0x59')](_0x185be7[_0xa9d6('0x3b')]);_0x200555['filters']=_[_0xa9d6('0x3d')](_0x200555[_0xa9d6('0x3a')],_0x200555[_0xa9d6('0x3b')]);_0x36928c[_0xa9d6('0x3e')]=_[_0xa9d6('0x3d')](_0x200555[_0xa9d6('0x3a')],qs[_0xa9d6('0x3f')](_0x185be7[_0xa9d6('0x3b')][_0xa9d6('0x3f')]));_0x36928c[_0xa9d6('0x3e')]=_0x36928c[_0xa9d6('0x3e')]['length']?_0x36928c[_0xa9d6('0x3e')]:_0x200555[_0xa9d6('0x3a')];_0x36928c[_0xa9d6('0x41')]=qs[_0xa9d6('0x42')](_0x185be7[_0xa9d6('0x3b')][_0xa9d6('0x42')]);_0x36928c['where']=qs['filters'](_[_0xa9d6('0x44')](_0x185be7[_0xa9d6('0x3b')],_0x200555['filters']));if(_0x185be7['query']['filter']){_0x36928c[_0xa9d6('0x43')]=_['merge'](_0x36928c[_0xa9d6('0x43')],{'$or':_[_0xa9d6('0x35')](_0x36928c[_0xa9d6('0x3e')],function(_0x1262c2){var _0x2da71e={};_0x2da71e[_0x1262c2]={'$like':'%'+_0x185be7[_0xa9d6('0x3b')][_0xa9d6('0x45')]+'%'};return _0x2da71e;})});}_0x36928c=_['merge']({},_0x36928c,_0x185be7[_0xa9d6('0x49')]);return _0xdf1386[_0xa9d6('0x58')](_0x36928c);}})[_0xa9d6('0x1a')](function(_0x5bf0ae){if(_0x5bf0ae){_0x2583e0=_0x5bf0ae[_0xa9d6('0x4f')];if(!_0x185be7[_0xa9d6('0x3b')][_0xa9d6('0x5a')](_0xa9d6('0x40'))){_0x36928c[_0xa9d6('0x2b')]=qs[_0xa9d6('0x2b')](_0x185be7[_0xa9d6('0x3b')][_0xa9d6('0x2b')]);_0x36928c[_0xa9d6('0x2a')]=qs[_0xa9d6('0x2a')](_0x185be7[_0xa9d6('0x3b')][_0xa9d6('0x2a')]);}return _0xdf1386['getSubjects'](_0x36928c);}})[_0xa9d6('0x1a')](function(_0x4576e2){if(_0x4576e2){return _0x4576e2?{'count':_0x2583e0,'rows':_0x4576e2}:null;}})[_0xa9d6('0x1a')](respondWithResult(_0x3584f5,null))['catch'](handleError(_0x3584f5,null));};exports[_0xa9d6('0x5b')]=function(_0x4c34c2,_0x466c3b,_0x32a8be){var _0x5eea69={};var _0x5586ce={};var _0x519c82;var _0x54c61c;return db[_0xa9d6('0x36')][_0xa9d6('0x56')]({'where':{'id':_0x4c34c2['params']['id']}})['then'](handleEntityNotFound(_0x466c3b,null))['then'](function(_0x26f99e){if(_0x26f99e){_0x519c82=_0x26f99e;_0x5586ce['model']=_['keys'](db[_0xa9d6('0x57')][_0xa9d6('0x37')]);_0x5586ce['query']=_[_0xa9d6('0x59')](_0x4c34c2[_0xa9d6('0x3b')]);_0x5586ce[_0xa9d6('0x3c')]=_[_0xa9d6('0x3d')](_0x5586ce[_0xa9d6('0x3a')],_0x5586ce['query']);_0x5eea69[_0xa9d6('0x3e')]=_['intersection'](_0x5586ce[_0xa9d6('0x3a')],qs[_0xa9d6('0x3f')](_0x4c34c2['query'][_0xa9d6('0x3f')]));_0x5eea69['attributes']=_0x5eea69['attributes']['length']?_0x5eea69[_0xa9d6('0x3e')]:_0x5586ce['model'];_0x5eea69[_0xa9d6('0x41')]=qs['sort'](_0x4c34c2[_0xa9d6('0x3b')][_0xa9d6('0x42')]);_0x5eea69[_0xa9d6('0x43')]=qs[_0xa9d6('0x3c')](_[_0xa9d6('0x44')](_0x4c34c2[_0xa9d6('0x3b')],_0x5586ce['filters']));if(_0x4c34c2[_0xa9d6('0x3b')][_0xa9d6('0x45')]){_0x5eea69[_0xa9d6('0x43')]=_[_0xa9d6('0x46')](_0x5eea69[_0xa9d6('0x43')],{'$or':_['map'](_0x5eea69[_0xa9d6('0x3e')],function(_0x2f9902){var _0x2fedbf={};_0x2fedbf[_0x2f9902]={'$like':'%'+_0x4c34c2['query'][_0xa9d6('0x45')]+'%'};return _0x2fedbf;})});}_0x5eea69=_[_0xa9d6('0x46')]({},_0x5eea69,_0x4c34c2[_0xa9d6('0x49')]);return _0x519c82[_0xa9d6('0x5b')](_0x5eea69);}})[_0xa9d6('0x1a')](function(_0x3c41ea){if(_0x3c41ea){_0x54c61c=_0x3c41ea['length'];if(!_0x4c34c2[_0xa9d6('0x3b')][_0xa9d6('0x5a')]('nolimit')){_0x5eea69[_0xa9d6('0x2b')]=qs[_0xa9d6('0x2b')](_0x4c34c2[_0xa9d6('0x3b')][_0xa9d6('0x2b')]);_0x5eea69[_0xa9d6('0x2a')]=qs[_0xa9d6('0x2a')](_0x4c34c2['query']['offset']);}return _0x519c82[_0xa9d6('0x5b')](_0x5eea69);}})['then'](function(_0x57d307){if(_0x57d307){return _0x57d307?{'count':_0x54c61c,'rows':_0x57d307}:null;}})[_0xa9d6('0x1a')](respondWithResult(_0x466c3b,null))[_0xa9d6('0x25')](handleError(_0x466c3b,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 51edaee..76d36ff 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 _0xad53=['../../config/logger','moment','bluebird','request-promise','../../config/environment','./intDynamics365Configuration.attributes','define','lodash','util'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0xad53,0x1ed));var _0x3ad5=function(_0x4261c8,_0xc91797){_0x4261c8=_0x4261c8-0x0;var _0x1d581c=_0xad53[_0x4261c8];return _0x1d581c;};'use strict';var _=require(_0x3ad5('0x0'));var util=require(_0x3ad5('0x1'));var logger=require(_0x3ad5('0x2'))('api');var moment=require(_0x3ad5('0x3'));var BPromise=require(_0x3ad5('0x4'));var rp=require(_0x3ad5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3ad5('0x6'));var attributes=require(_0x3ad5('0x7'));module['exports']=function(_0x4cc153,_0x1c55da){return _0x4cc153[_0x3ad5('0x8')]('Dynamics365Configuration',attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2b30=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','lodash'];(function(_0x4f4c11,_0xdb6add){var _0x4dfd33=function(_0x163cfe){while(--_0x163cfe){_0x4f4c11['push'](_0x4f4c11['shift']());}};_0x4dfd33(++_0xdb6add);}(_0x2b30,0x83));var _0x02b3=function(_0x197da8,_0x2ae40d){_0x197da8=_0x197da8-0x0;var _0x2afecf=_0x2b30[_0x197da8];return _0x2afecf;};'use strict';var _=require(_0x02b3('0x0'));var util=require(_0x02b3('0x1'));var logger=require(_0x02b3('0x2'))('api');var moment=require(_0x02b3('0x3'));var BPromise=require(_0x02b3('0x4'));var rp=require(_0x02b3('0x5'));var fs=require('fs');var path=require(_0x02b3('0x6'));var rimraf=require(_0x02b3('0x7'));var config=require('../../config/environment');var attributes=require(_0x02b3('0x8'));module[_0x02b3('0x9')]=function(_0x58902f,_0x1c59bf){return _0x58902f[_0x02b3('0xa')](_0x02b3('0xb'),attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index 006b5b9..7877f01 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 _0x63e7=['info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then'];(function(_0x4bb145,_0x3e7d33){var _0x4db596=function(_0x144489){while(--_0x144489){_0x4bb145['push'](_0x4bb145['shift']());}};_0x4db596(++_0x3e7d33);}(_0x63e7,0x107));var _0x763e=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x63e7[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x763e('0x0'));var util=require(_0x763e('0x1'));var moment=require(_0x763e('0x2'));var BPromise=require(_0x763e('0x3'));var rs=require(_0x763e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x763e('0x5'))['db'];var utils=require(_0x763e('0x6'));var logger=require(_0x763e('0x7'))(_0x763e('0x8'));var config=require('../../config/environment');var jayson=require(_0x763e('0x9'));var client=jayson[_0x763e('0xa')][_0x763e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2a5d8f,_0x365bc0,_0x36ffe4){return new BPromise(function(_0x1b0291,_0x10e50a){return client['request'](_0x2a5d8f,_0x36ffe4)[_0x763e('0xc')](function(_0x3bc575){logger[_0x763e('0xd')](_0x763e('0xe'),_0x365bc0,_0x763e('0xf'));logger[_0x763e('0x10')](_0x763e('0x11'),_0x365bc0,'request\x20sent',JSON[_0x763e('0x12')](_0x3bc575));if(_0x3bc575[_0x763e('0x13')]){if(_0x3bc575[_0x763e('0x13')][_0x763e('0x14')]===0x1f4){logger[_0x763e('0x13')](_0x763e('0xe'),_0x365bc0,_0x3bc575['error'][_0x763e('0x15')]);return _0x10e50a(_0x3bc575[_0x763e('0x13')][_0x763e('0x15')]);}logger[_0x763e('0x13')]('Dynamics365Configuration,\x20%s,\x20%s',_0x365bc0,_0x3bc575[_0x763e('0x13')]['message']);return _0x1b0291(_0x3bc575[_0x763e('0x13')]['message']);}else{logger[_0x763e('0xd')](_0x763e('0xe'),_0x365bc0,_0x763e('0xf'));_0x1b0291(_0x3bc575[_0x763e('0x16')][_0x763e('0x15')]);}})['catch'](function(_0x1aac82){logger[_0x763e('0x13')]('Dynamics365Configuration,\x20%s,\x20%s',_0x365bc0,_0x1aac82);_0x10e50a(_0x1aac82);});});} \ No newline at end of file +var _0x5457=['stringify','error','code','message','result','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent'];(function(_0x217ae0,_0x29caa9){var _0x502898=function(_0x119c12){while(--_0x119c12){_0x217ae0['push'](_0x217ae0['shift']());}};_0x502898(++_0x29caa9);}(_0x5457,0x135));var _0x7545=function(_0x2b22e6,_0x3f2337){_0x2b22e6=_0x2b22e6-0x0;var _0x225b25=_0x5457[_0x2b22e6];return _0x225b25;};'use strict';var _=require('lodash');var util=require(_0x7545('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7545('0x1'));var fs=require('fs');var Redis=require(_0x7545('0x2'));var db=require(_0x7545('0x3'))['db'];var utils=require(_0x7545('0x4'));var logger=require(_0x7545('0x5'))(_0x7545('0x6'));var config=require(_0x7545('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7545('0x8')][_0x7545('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x50d8a7,_0x322813,_0x124ea8){return new BPromise(function(_0x380ea0,_0x3f9328){return client[_0x7545('0xa')](_0x50d8a7,_0x124ea8)['then'](function(_0x21fb6c){logger[_0x7545('0xb')](_0x7545('0xc'),_0x322813,'request\x20sent');logger['debug']('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x322813,_0x7545('0xd'),JSON[_0x7545('0xe')](_0x21fb6c));if(_0x21fb6c[_0x7545('0xf')]){if(_0x21fb6c[_0x7545('0xf')][_0x7545('0x10')]===0x1f4){logger['error'](_0x7545('0xc'),_0x322813,_0x21fb6c[_0x7545('0xf')]['message']);return _0x3f9328(_0x21fb6c[_0x7545('0xf')][_0x7545('0x11')]);}logger[_0x7545('0xf')]('Dynamics365Configuration,\x20%s,\x20%s',_0x322813,_0x21fb6c['error']['message']);return _0x380ea0(_0x21fb6c['error'][_0x7545('0x11')]);}else{logger[_0x7545('0xb')](_0x7545('0xc'),_0x322813,_0x7545('0xd'));_0x380ea0(_0x21fb6c[_0x7545('0x12')]['message']);}})['catch'](function(_0x93e430){logger[_0x7545('0xf')](_0x7545('0xc'),_0x322813,_0x93e430);_0x3f9328(_0x93e430);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index f9c38fe..067d95f 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 _0x2504=['./intDynamics365Field.controller','get','isAuthenticated','show','post','create','put','delete','/:id','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5a8f02,_0xdc731e){var _0x15a0d2=function(_0x175d42){while(--_0x175d42){_0x5a8f02['push'](_0x5a8f02['shift']());}};_0x15a0d2(++_0xdc731e);}(_0x2504,0xee));var _0x4250=function(_0xf1de09,_0x4ae947){_0xf1de09=_0xf1de09-0x0;var _0x48b030=_0x2504[_0xf1de09];return _0x48b030;};'use strict';var multer=require(_0x4250('0x0'));var util=require(_0x4250('0x1'));var path=require(_0x4250('0x2'));var timeout=require(_0x4250('0x3'));var express=require(_0x4250('0x4'));var router=express[_0x4250('0x5')]();var auth=require(_0x4250('0x6'));var interaction=require(_0x4250('0x7'));var config=require(_0x4250('0x8'));var controller=require(_0x4250('0x9'));router[_0x4250('0xa')]('/',auth[_0x4250('0xb')](),controller['index']);router[_0x4250('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x4250('0xc')]);router[_0x4250('0xd')]('/',auth[_0x4250('0xb')](),controller[_0x4250('0xe')]);router[_0x4250('0xf')]('/:id',auth[_0x4250('0xb')](),controller['update']);router[_0x4250('0x10')](_0x4250('0x11'),auth['isAuthenticated'](),controller[_0x4250('0x12')]);module['exports']=router; \ No newline at end of file +var _0x7d98=['get','/:id','isAuthenticated','show','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x455afa,_0x235bfc){var _0x46ee43=function(_0x26de4a){while(--_0x26de4a){_0x455afa['push'](_0x455afa['shift']());}};_0x46ee43(++_0x235bfc);}(_0x7d98,0xe7));var _0x87d9=function(_0x5678b5,_0x1c4aa8){_0x5678b5=_0x5678b5-0x0;var _0x4c09a5=_0x7d98[_0x5678b5];return _0x4c09a5;};'use strict';var multer=require(_0x87d9('0x0'));var util=require('util');var path=require(_0x87d9('0x1'));var timeout=require(_0x87d9('0x2'));var express=require(_0x87d9('0x3'));var router=express[_0x87d9('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x87d9('0x5'));var config=require(_0x87d9('0x6'));var controller=require('./intDynamics365Field.controller');router[_0x87d9('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x87d9('0x8'),auth[_0x87d9('0x9')](),controller[_0x87d9('0xa')]);router['post']('/',auth[_0x87d9('0x9')](),controller[_0x87d9('0xb')]);router[_0x87d9('0xc')]('/:id',auth[_0x87d9('0x9')](),controller[_0x87d9('0xd')]);router[_0x87d9('0xe')](_0x87d9('0x8'),auth[_0x87d9('0x9')](),controller[_0x87d9('0xf')]);module[_0x87d9('0x10')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 2e322d4..df9f0cc 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 _0x073e=['sequelize','exports','ENUM','string','STRING','customVariable','BOOLEAN'];(function(_0x45b034,_0x3a57dd){var _0x509cb0=function(_0x3a89d5){while(--_0x3a89d5){_0x45b034['push'](_0x45b034['shift']());}};_0x509cb0(++_0x3a57dd);}(_0x073e,0x181));var _0xe073=function(_0x4a0be9,_0x4216d3){_0x4a0be9=_0x4a0be9-0x0;var _0x483e7c=_0x073e[_0x4a0be9];return _0x483e7c;};'use strict';var Sequelize=require(_0xe073('0x0'));module[_0xe073('0x1')]={'type':{'type':Sequelize[_0xe073('0x2')](_0xe073('0x3'),'variable','customVariable','keyValue'),'defaultValue':_0xe073('0x3')},'content':{'type':Sequelize[_0xe073('0x4')]},'key':{'type':Sequelize[_0xe073('0x4')]},'keyType':{'type':Sequelize['ENUM']('string','variable',_0xe073('0x5'))},'keyContent':{'type':Sequelize[_0xe073('0x4')]},'idField':{'type':Sequelize[_0xe073('0x4')]},'nameField':{'type':Sequelize[_0xe073('0x4')]},'customField':{'type':Sequelize[_0xe073('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe073('0x4')]}}; \ No newline at end of file +var _0x49da=['BOOLEAN','exports','ENUM','string','customVariable','keyValue','STRING','variable'];(function(_0x38138f,_0x2cc68f){var _0x5de7c2=function(_0x1f6fdb){while(--_0x1f6fdb){_0x38138f['push'](_0x38138f['shift']());}};_0x5de7c2(++_0x2cc68f);}(_0x49da,0x1c1));var _0xa49d=function(_0x79103f,_0x1748d5){_0x79103f=_0x79103f-0x0;var _0x5eaec0=_0x49da[_0x79103f];return _0x5eaec0;};'use strict';var Sequelize=require('sequelize');module[_0xa49d('0x0')]={'type':{'type':Sequelize[_0xa49d('0x1')](_0xa49d('0x2'),'variable',_0xa49d('0x3'),_0xa49d('0x4')),'defaultValue':_0xa49d('0x2')},'content':{'type':Sequelize[_0xa49d('0x5')]},'key':{'type':Sequelize[_0xa49d('0x5')]},'keyType':{'type':Sequelize[_0xa49d('0x1')](_0xa49d('0x2'),_0xa49d('0x6'),_0xa49d('0x3'))},'keyContent':{'type':Sequelize[_0xa49d('0x5')]},'idField':{'type':Sequelize[_0xa49d('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xa49d('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa49d('0x5')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 0f18e5e..0386930 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 _0x9a6b=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','error','name','send','index','map','fieldName','type','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','key','VIRTUAL','field','Dynamics365Field','includeAll','include','findAll','rows','catch','show','params','options','create','body','find','destroy','html-pdf'];(function(_0x150714,_0x3ca609){var _0x598a1c=function(_0x3eeabe){while(--_0x3eeabe){_0x150714['push'](_0x150714['shift']());}};_0x598a1c(++_0x3ca609);}(_0x9a6b,0xda));var _0xb9a6=function(_0x5cf92c,_0x5d174f){_0x5cf92c=_0x5cf92c-0x0;var _0x37c0b4=_0x9a6b[_0x5cf92c];return _0x37c0b4;};'use strict';var pdf=require(_0xb9a6('0x0'));var emlformat=require(_0xb9a6('0x1'));var rimraf=require(_0xb9a6('0x2'));var zipdir=require(_0xb9a6('0x3'));var jsonpatch=require(_0xb9a6('0x4'));var rp=require('request-promise');var moment=require(_0xb9a6('0x5'));var BPromise=require(_0xb9a6('0x6'));var Mustache=require(_0xb9a6('0x7'));var util=require(_0xb9a6('0x8'));var path=require('path');var sox=require(_0xb9a6('0x9'));var csv=require(_0xb9a6('0xa'));var ejs=require(_0xb9a6('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb9a6('0xc'));var deskjs=require(_0xb9a6('0xd'));var toCsv=require(_0xb9a6('0xa'));var querystring=require(_0xb9a6('0xe'));var Papa=require('papaparse');var Redis=require(_0xb9a6('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xb9a6('0x10'));var as=require(_0xb9a6('0x11'));var hardwareService=require(_0xb9a6('0x12'));var logger=require(_0xb9a6('0x13'))(_0xb9a6('0x14'));var utils=require('../../config/utils');var config=require(_0xb9a6('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x42484d,_0x25c9d2){_0x25c9d2=_0x25c9d2||0xcc;return function(_0x54b7aa){if(_0x54b7aa){return _0x42484d[_0xb9a6('0x16')](_0x25c9d2);}return _0x42484d[_0xb9a6('0x17')](_0x25c9d2)[_0xb9a6('0x18')]();};}function respondWithResult(_0x1100b9,_0x3e6868){_0x3e6868=_0x3e6868||0xc8;return function(_0x5cb91e){if(_0x5cb91e){return _0x1100b9[_0xb9a6('0x17')](_0x3e6868)[_0xb9a6('0x19')](_0x5cb91e);}};}function respondWithFilteredResult(_0x45658b,_0x2d5b61){return function(_0x347d1e){if(_0x347d1e){var _0x1dbc47=_0x347d1e[_0xb9a6('0x1a')],_0x23a453=_0x2d5b61[_0xb9a6('0x1b')],_0x89ca3a=_0x2d5b61[_0xb9a6('0x1b')]+_0x2d5b61[_0xb9a6('0x1c')],_0x9353cd;if(_0x89ca3a>=_0x1dbc47){_0x89ca3a=_0x1dbc47;_0x9353cd=0xc8;}else{_0x9353cd=0xce;}_0x45658b[_0xb9a6('0x17')](_0x9353cd);return _0x45658b['set'](_0xb9a6('0x1d'),_0x23a453+'-'+_0x89ca3a+'/'+_0x1dbc47)['json'](_0x347d1e);}return null;};}function patchUpdates(_0x392963){return function(_0x3e759d){try{jsonpatch[_0xb9a6('0x1e')](_0x3e759d,_0x392963,!![]);}catch(_0x2b3892){return BPromise[_0xb9a6('0x1f')](_0x2b3892);}return _0x3e759d[_0xb9a6('0x20')]();};}function saveUpdates(_0x54c1ab,_0x5b9dda){return function(_0x37813d){if(_0x37813d){return _0x37813d[_0xb9a6('0x21')](_0x54c1ab)[_0xb9a6('0x22')](function(_0x350e77){return _0x350e77;});}return null;};}function removeEntity(_0x4c2d39,_0x32410a){return function(_0x38d457){if(_0x38d457){return _0x38d457['destroy']()[_0xb9a6('0x22')](function(){_0x4c2d39[_0xb9a6('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ae01b,_0x5074ea){return function(_0x191bae){if(!_0x191bae){_0x5ae01b[_0xb9a6('0x16')](0x194);}return _0x191bae;};}function handleError(_0x4d6269,_0x3c59b7){_0x3c59b7=_0x3c59b7||0x1f4;return function(_0x366807){logger[_0xb9a6('0x23')](_0x366807['stack']);if(_0x366807[_0xb9a6('0x24')]){delete _0x366807[_0xb9a6('0x24')];}_0x4d6269[_0xb9a6('0x17')](_0x3c59b7)[_0xb9a6('0x25')](_0x366807);};}exports[_0xb9a6('0x26')]=function(_0x56ef5,_0x36e8af){var _0x15fdb5={},_0x27879e={},_0x1d11d3={'count':0x0,'rows':[]};var _0x59596c=_[_0xb9a6('0x27')](db['Dynamics365Field']['rawAttributes'],function(_0x399e0a){return{'name':_0x399e0a[_0xb9a6('0x28')],'type':_0x399e0a[_0xb9a6('0x29')]['key']};});_0x27879e['model']=_[_0xb9a6('0x27')](_0x59596c,_0xb9a6('0x24'));_0x27879e[_0xb9a6('0x2a')]=_[_0xb9a6('0x2b')](_0x56ef5[_0xb9a6('0x2a')]);_0x27879e[_0xb9a6('0x2c')]=_['intersection'](_0x27879e[_0xb9a6('0x2d')],_0x27879e['query']);_0x15fdb5[_0xb9a6('0x2e')]=_[_0xb9a6('0x2f')](_0x27879e[_0xb9a6('0x2d')],qs['fields'](_0x56ef5['query'][_0xb9a6('0x30')]));_0x15fdb5[_0xb9a6('0x2e')]=_0x15fdb5[_0xb9a6('0x2e')][_0xb9a6('0x31')]?_0x15fdb5[_0xb9a6('0x2e')]:_0x27879e[_0xb9a6('0x2d')];if(!_0x56ef5[_0xb9a6('0x2a')][_0xb9a6('0x32')](_0xb9a6('0x33'))){_0x15fdb5[_0xb9a6('0x1c')]=qs[_0xb9a6('0x1c')](_0x56ef5[_0xb9a6('0x2a')]['limit']);_0x15fdb5[_0xb9a6('0x1b')]=qs[_0xb9a6('0x1b')](_0x56ef5[_0xb9a6('0x2a')][_0xb9a6('0x1b')]);}_0x15fdb5[_0xb9a6('0x34')]=qs[_0xb9a6('0x35')](_0x56ef5[_0xb9a6('0x2a')][_0xb9a6('0x35')]);_0x15fdb5[_0xb9a6('0x36')]=qs[_0xb9a6('0x2c')](_[_0xb9a6('0x37')](_0x56ef5[_0xb9a6('0x2a')],_0x27879e[_0xb9a6('0x2c')]));if(_0x56ef5[_0xb9a6('0x2a')]['filter']){_0x15fdb5[_0xb9a6('0x36')]=_[_0xb9a6('0x38')](_0x15fdb5[_0xb9a6('0x36')],{'$or':_[_0xb9a6('0x27')](_0x59596c,function(_0x4565eb){if(_0x4565eb[_0xb9a6('0x29')][_0xb9a6('0x39')]!==_0xb9a6('0x3a')){var _0x40dc81={};_0x40dc81[_0x4565eb[_0xb9a6('0x3b')]]={'$like':'%'+_0x56ef5[_0xb9a6('0x2a')]['filter']+'%'};return _0x40dc81;}})});}_0x15fdb5=_[_0xb9a6('0x38')]({},_0x15fdb5,_0x56ef5['options']);var _0x206a73={'where':_0x15fdb5[_0xb9a6('0x36')]};return db[_0xb9a6('0x3c')][_0xb9a6('0x1a')](_0x206a73)[_0xb9a6('0x22')](function(_0x4fff87){_0x1d11d3[_0xb9a6('0x1a')]=_0x4fff87;if(_0x56ef5[_0xb9a6('0x2a')][_0xb9a6('0x3d')]){_0x15fdb5[_0xb9a6('0x3e')]=[{'all':!![]}];}return db[_0xb9a6('0x3c')][_0xb9a6('0x3f')](_0x15fdb5);})['then'](function(_0x22e024){_0x1d11d3[_0xb9a6('0x40')]=_0x22e024;return _0x1d11d3;})[_0xb9a6('0x22')](respondWithFilteredResult(_0x36e8af,_0x15fdb5))[_0xb9a6('0x41')](handleError(_0x36e8af,null));};exports[_0xb9a6('0x42')]=function(_0x4063ee,_0x1848d5){var _0x473c3b={'raw':!![],'where':{'id':_0x4063ee[_0xb9a6('0x43')]['id']}},_0x1ae87c={};_0x1ae87c['model']=_[_0xb9a6('0x2b')](db['Dynamics365Field']['rawAttributes']);_0x1ae87c['query']=_[_0xb9a6('0x2b')](_0x4063ee[_0xb9a6('0x2a')]);_0x1ae87c[_0xb9a6('0x2c')]=_[_0xb9a6('0x2f')](_0x1ae87c[_0xb9a6('0x2d')],_0x1ae87c[_0xb9a6('0x2a')]);_0x473c3b[_0xb9a6('0x2e')]=_[_0xb9a6('0x2f')](_0x1ae87c[_0xb9a6('0x2d')],qs[_0xb9a6('0x30')](_0x4063ee[_0xb9a6('0x2a')][_0xb9a6('0x30')]));_0x473c3b[_0xb9a6('0x2e')]=_0x473c3b['attributes'][_0xb9a6('0x31')]?_0x473c3b[_0xb9a6('0x2e')]:_0x1ae87c['model'];if(_0x4063ee[_0xb9a6('0x2a')][_0xb9a6('0x3d')]){_0x473c3b[_0xb9a6('0x3e')]=[{'all':!![]}];}_0x473c3b=_[_0xb9a6('0x38')]({},_0x473c3b,_0x4063ee[_0xb9a6('0x44')]);return db[_0xb9a6('0x3c')]['find'](_0x473c3b)[_0xb9a6('0x22')](handleEntityNotFound(_0x1848d5,null))[_0xb9a6('0x22')](respondWithResult(_0x1848d5,null))[_0xb9a6('0x41')](handleError(_0x1848d5,null));};exports[_0xb9a6('0x45')]=function(_0x3c1e47,_0x2eee40){return db[_0xb9a6('0x3c')][_0xb9a6('0x45')](_0x3c1e47[_0xb9a6('0x46')],{})[_0xb9a6('0x22')](respondWithResult(_0x2eee40,0xc9))[_0xb9a6('0x41')](handleError(_0x2eee40,null));};exports[_0xb9a6('0x21')]=function(_0x56e76a,_0x1c0cea){if(_0x56e76a[_0xb9a6('0x46')]['id']){delete _0x56e76a[_0xb9a6('0x46')]['id'];}return db['Dynamics365Field'][_0xb9a6('0x47')]({'where':{'id':_0x56e76a['params']['id']}})['then'](handleEntityNotFound(_0x1c0cea,null))['then'](saveUpdates(_0x56e76a[_0xb9a6('0x46')],null))['then'](respondWithResult(_0x1c0cea,null))['catch'](handleError(_0x1c0cea,null));};exports[_0xb9a6('0x48')]=function(_0x5dd769,_0x37adaa){return db[_0xb9a6('0x3c')][_0xb9a6('0x47')]({'where':{'id':_0x5dd769[_0xb9a6('0x43')]['id']}})[_0xb9a6('0x22')](handleEntityNotFound(_0x37adaa,null))[_0xb9a6('0x22')](removeEntity(_0x37adaa,null))[_0xb9a6('0x41')](handleError(_0x37adaa,null));}; \ No newline at end of file +var _0x93ac=['filter','where','merge','VIRTUAL','field','options','includeAll','include','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','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','set','Content-Range','json','apply','reject','update','then','destroy','end','error','stack','name','send','index','map','Dynamics365Field','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','pick'];(function(_0x251ac0,_0xeb0c93){var _0x5c8263=function(_0x18244a){while(--_0x18244a){_0x251ac0['push'](_0x251ac0['shift']());}};_0x5c8263(++_0xeb0c93);}(_0x93ac,0xfa));var _0xc93a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x93ac[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xc93a('0x0'));var emlformat=require(_0xc93a('0x1'));var rimraf=require(_0xc93a('0x2'));var zipdir=require(_0xc93a('0x3'));var jsonpatch=require(_0xc93a('0x4'));var rp=require(_0xc93a('0x5'));var moment=require(_0xc93a('0x6'));var BPromise=require(_0xc93a('0x7'));var Mustache=require(_0xc93a('0x8'));var util=require(_0xc93a('0x9'));var path=require(_0xc93a('0xa'));var sox=require(_0xc93a('0xb'));var csv=require(_0xc93a('0xc'));var ejs=require(_0xc93a('0xd'));var fs=require('fs');var _=require('lodash');var squel=require(_0xc93a('0xe'));var crypto=require(_0xc93a('0xf'));var jsforce=require(_0xc93a('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xc93a('0xc'));var querystring=require(_0xc93a('0x11'));var Papa=require(_0xc93a('0x12'));var Redis=require(_0xc93a('0x13'));var authService=require(_0xc93a('0x14'));var qs=require(_0xc93a('0x15'));var as=require(_0xc93a('0x16'));var hardwareService=require(_0xc93a('0x17'));var logger=require('../../config/logger')(_0xc93a('0x18'));var utils=require('../../config/utils');var config=require(_0xc93a('0x19'));var db=require(_0xc93a('0x1a'))['db'];function respondWithStatusCode(_0x54203c,_0x31b096){_0x31b096=_0x31b096||0xcc;return function(_0x3128d5){if(_0x3128d5){return _0x54203c[_0xc93a('0x1b')](_0x31b096);}return _0x54203c['status'](_0x31b096)['end']();};}function respondWithResult(_0x20c4d6,_0x43d70f){_0x43d70f=_0x43d70f||0xc8;return function(_0x26dc49){if(_0x26dc49){return _0x20c4d6[_0xc93a('0x1c')](_0x43d70f)['json'](_0x26dc49);}};}function respondWithFilteredResult(_0x4cd6ad,_0x192b53){return function(_0x16710b){if(_0x16710b){var _0x212f97=_0x16710b[_0xc93a('0x1d')],_0x4ae8a0=_0x192b53[_0xc93a('0x1e')],_0x3997c8=_0x192b53[_0xc93a('0x1e')]+_0x192b53[_0xc93a('0x1f')],_0x563ec1;if(_0x3997c8>=_0x212f97){_0x3997c8=_0x212f97;_0x563ec1=0xc8;}else{_0x563ec1=0xce;}_0x4cd6ad[_0xc93a('0x1c')](_0x563ec1);return _0x4cd6ad[_0xc93a('0x20')](_0xc93a('0x21'),_0x4ae8a0+'-'+_0x3997c8+'/'+_0x212f97)[_0xc93a('0x22')](_0x16710b);}return null;};}function patchUpdates(_0x2a9a65){return function(_0x22e6d2){try{jsonpatch[_0xc93a('0x23')](_0x22e6d2,_0x2a9a65,!![]);}catch(_0x98be71){return BPromise[_0xc93a('0x24')](_0x98be71);}return _0x22e6d2['save']();};}function saveUpdates(_0x10efbb,_0x25c37a){return function(_0x10bac7){if(_0x10bac7){return _0x10bac7[_0xc93a('0x25')](_0x10efbb)[_0xc93a('0x26')](function(_0x199d9a){return _0x199d9a;});}return null;};}function removeEntity(_0x5d708d,_0x40d90b){return function(_0x516ce4){if(_0x516ce4){return _0x516ce4[_0xc93a('0x27')]()[_0xc93a('0x26')](function(){_0x5d708d['status'](0xcc)[_0xc93a('0x28')]();});}};}function handleEntityNotFound(_0x2aee57,_0x458b7e){return function(_0x547b27){if(!_0x547b27){_0x2aee57[_0xc93a('0x1b')](0x194);}return _0x547b27;};}function handleError(_0x32c54a,_0x3a5016){_0x3a5016=_0x3a5016||0x1f4;return function(_0x2b1b3c){logger[_0xc93a('0x29')](_0x2b1b3c[_0xc93a('0x2a')]);if(_0x2b1b3c[_0xc93a('0x2b')]){delete _0x2b1b3c[_0xc93a('0x2b')];}_0x32c54a[_0xc93a('0x1c')](_0x3a5016)[_0xc93a('0x2c')](_0x2b1b3c);};}exports[_0xc93a('0x2d')]=function(_0xd6c7a7,_0x265009){var _0x16bd64={},_0x2bc50c={},_0x5a7baa={'count':0x0,'rows':[]};var _0x33f884=_[_0xc93a('0x2e')](db[_0xc93a('0x2f')]['rawAttributes'],function(_0x11d19d){return{'name':_0x11d19d['fieldName'],'type':_0x11d19d[_0xc93a('0x30')][_0xc93a('0x31')]};});_0x2bc50c[_0xc93a('0x32')]=_[_0xc93a('0x2e')](_0x33f884,_0xc93a('0x2b'));_0x2bc50c[_0xc93a('0x33')]=_[_0xc93a('0x34')](_0xd6c7a7['query']);_0x2bc50c[_0xc93a('0x35')]=_[_0xc93a('0x36')](_0x2bc50c[_0xc93a('0x32')],_0x2bc50c[_0xc93a('0x33')]);_0x16bd64['attributes']=_[_0xc93a('0x36')](_0x2bc50c[_0xc93a('0x32')],qs[_0xc93a('0x37')](_0xd6c7a7[_0xc93a('0x33')]['fields']));_0x16bd64[_0xc93a('0x38')]=_0x16bd64[_0xc93a('0x38')][_0xc93a('0x39')]?_0x16bd64[_0xc93a('0x38')]:_0x2bc50c['model'];if(!_0xd6c7a7[_0xc93a('0x33')]['hasOwnProperty'](_0xc93a('0x3a'))){_0x16bd64['limit']=qs[_0xc93a('0x1f')](_0xd6c7a7[_0xc93a('0x33')][_0xc93a('0x1f')]);_0x16bd64[_0xc93a('0x1e')]=qs[_0xc93a('0x1e')](_0xd6c7a7[_0xc93a('0x33')]['offset']);}_0x16bd64[_0xc93a('0x3b')]=qs[_0xc93a('0x3c')](_0xd6c7a7[_0xc93a('0x33')][_0xc93a('0x3c')]);_0x16bd64['where']=qs[_0xc93a('0x35')](_[_0xc93a('0x3d')](_0xd6c7a7[_0xc93a('0x33')],_0x2bc50c[_0xc93a('0x35')]));if(_0xd6c7a7['query'][_0xc93a('0x3e')]){_0x16bd64[_0xc93a('0x3f')]=_[_0xc93a('0x40')](_0x16bd64['where'],{'$or':_['map'](_0x33f884,function(_0x58cbb9){if(_0x58cbb9['type'][_0xc93a('0x31')]!==_0xc93a('0x41')){var _0x5794de={};_0x5794de[_0x58cbb9[_0xc93a('0x42')]]={'$like':'%'+_0xd6c7a7[_0xc93a('0x33')][_0xc93a('0x3e')]+'%'};return _0x5794de;}})});}_0x16bd64=_[_0xc93a('0x40')]({},_0x16bd64,_0xd6c7a7[_0xc93a('0x43')]);var _0x4ec657={'where':_0x16bd64[_0xc93a('0x3f')]};return db['Dynamics365Field'][_0xc93a('0x1d')](_0x4ec657)[_0xc93a('0x26')](function(_0x5418ae){_0x5a7baa['count']=_0x5418ae;if(_0xd6c7a7[_0xc93a('0x33')][_0xc93a('0x44')]){_0x16bd64[_0xc93a('0x45')]=[{'all':!![]}];}return db[_0xc93a('0x2f')]['findAll'](_0x16bd64);})[_0xc93a('0x26')](function(_0xf3845a){_0x5a7baa[_0xc93a('0x46')]=_0xf3845a;return _0x5a7baa;})[_0xc93a('0x26')](respondWithFilteredResult(_0x265009,_0x16bd64))[_0xc93a('0x47')](handleError(_0x265009,null));};exports[_0xc93a('0x48')]=function(_0x31a55c,_0x30786e){var _0x167632={'raw':!![],'where':{'id':_0x31a55c[_0xc93a('0x49')]['id']}},_0x544af6={};_0x544af6['model']=_['keys'](db['Dynamics365Field'][_0xc93a('0x4a')]);_0x544af6['query']=_[_0xc93a('0x34')](_0x31a55c[_0xc93a('0x33')]);_0x544af6[_0xc93a('0x35')]=_[_0xc93a('0x36')](_0x544af6[_0xc93a('0x32')],_0x544af6['query']);_0x167632['attributes']=_[_0xc93a('0x36')](_0x544af6[_0xc93a('0x32')],qs[_0xc93a('0x37')](_0x31a55c[_0xc93a('0x33')][_0xc93a('0x37')]));_0x167632['attributes']=_0x167632[_0xc93a('0x38')][_0xc93a('0x39')]?_0x167632[_0xc93a('0x38')]:_0x544af6[_0xc93a('0x32')];if(_0x31a55c[_0xc93a('0x33')][_0xc93a('0x44')]){_0x167632[_0xc93a('0x45')]=[{'all':!![]}];}_0x167632=_['merge']({},_0x167632,_0x31a55c[_0xc93a('0x43')]);return db[_0xc93a('0x2f')]['find'](_0x167632)[_0xc93a('0x26')](handleEntityNotFound(_0x30786e,null))[_0xc93a('0x26')](respondWithResult(_0x30786e,null))[_0xc93a('0x47')](handleError(_0x30786e,null));};exports[_0xc93a('0x4b')]=function(_0x1d619e,_0x13ec2e){return db[_0xc93a('0x2f')][_0xc93a('0x4b')](_0x1d619e[_0xc93a('0x4c')],{})[_0xc93a('0x26')](respondWithResult(_0x13ec2e,0xc9))[_0xc93a('0x47')](handleError(_0x13ec2e,null));};exports[_0xc93a('0x25')]=function(_0x13b2df,_0x26c591){if(_0x13b2df[_0xc93a('0x4c')]['id']){delete _0x13b2df[_0xc93a('0x4c')]['id'];}return db[_0xc93a('0x2f')][_0xc93a('0x4d')]({'where':{'id':_0x13b2df['params']['id']}})[_0xc93a('0x26')](handleEntityNotFound(_0x26c591,null))[_0xc93a('0x26')](saveUpdates(_0x13b2df[_0xc93a('0x4c')],null))[_0xc93a('0x26')](respondWithResult(_0x26c591,null))[_0xc93a('0x47')](handleError(_0x26c591,null));};exports[_0xc93a('0x27')]=function(_0x3690ab,_0x12a6b9){return db[_0xc93a('0x2f')][_0xc93a('0x4d')]({'where':{'id':_0x3690ab[_0xc93a('0x49')]['id']}})['then'](handleEntityNotFound(_0x12a6b9,null))['then'](removeEntity(_0x12a6b9,null))[_0xc93a('0x47')](handleError(_0x12a6b9,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 1cbd616..975aca5 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 _0xe11b=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0xe11b,0x11d));var _0xbe11=function(_0x2a4b9b,_0x2cfed7){_0x2a4b9b=_0x2a4b9b-0x0;var _0x30096c=_0xe11b[_0x2a4b9b];return _0x30096c;};'use strict';var _=require('lodash');var util=require(_0xbe11('0x0'));var logger=require(_0xbe11('0x1'))(_0xbe11('0x2'));var moment=require(_0xbe11('0x3'));var BPromise=require(_0xbe11('0x4'));var rp=require(_0xbe11('0x5'));var fs=require('fs');var path=require(_0xbe11('0x6'));var rimraf=require(_0xbe11('0x7'));var config=require(_0xbe11('0x8'));var attributes=require(_0xbe11('0x9'));module[_0xbe11('0xa')]=function(_0x70df0a,_0x3e827d){return _0x70df0a['define'](_0xbe11('0xb'),attributes,{'tableName':_0xbe11('0xc'),'paranoid':![],'indexes':[{'name':_0xbe11('0xd'),'fields':[_0xbe11('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb475=['path','rimraf','../../config/environment','./intDynamics365Field.attributes','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','util','../../config/logger','api','moment','request-promise'];(function(_0x4169fd,_0x4676cb){var _0x2e25f6=function(_0x2c8336){while(--_0x2c8336){_0x4169fd['push'](_0x4169fd['shift']());}};_0x2e25f6(++_0x4676cb);}(_0xb475,0x1ea));var _0x5b47=function(_0x513f27,_0x1cbc87){_0x513f27=_0x513f27-0x0;var _0xa316b7=_0xb475[_0x513f27];return _0xa316b7;};'use strict';var _=require('lodash');var util=require(_0x5b47('0x0'));var logger=require(_0x5b47('0x1'))(_0x5b47('0x2'));var moment=require(_0x5b47('0x3'));var BPromise=require('bluebird');var rp=require(_0x5b47('0x4'));var fs=require('fs');var path=require(_0x5b47('0x5'));var rimraf=require(_0x5b47('0x6'));var config=require(_0x5b47('0x7'));var attributes=require(_0x5b47('0x8'));module['exports']=function(_0x266889,_0xcdae3d){return _0x266889[_0x5b47('0x9')](_0x5b47('0xa'),attributes,{'tableName':_0x5b47('0xb'),'paranoid':![],'indexes':[{'name':_0x5b47('0xc'),'fields':[_0x5b47('0xd'),_0x5b47('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.rpc.js b/server/api/intDynamics365Field/intDynamics365Field.rpc.js index dd301b9..8ca2e76 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 _0xdfa0=['code','Dynamics365Field,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','then','info','request\x20sent','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3b8603,_0x388b6c){var _0x1bc590=function(_0x4e1632){while(--_0x4e1632){_0x3b8603['push'](_0x3b8603['shift']());}};_0x1bc590(++_0x388b6c);}(_0xdfa0,0x69));var _0x0dfa=function(_0x263aec,_0x40dee6){_0x263aec=_0x263aec-0x0;var _0x45f2c6=_0xdfa0[_0x263aec];return _0x45f2c6;};'use strict';var _=require(_0x0dfa('0x0'));var util=require('util');var moment=require(_0x0dfa('0x1'));var BPromise=require(_0x0dfa('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0dfa('0x3'));var db=require(_0x0dfa('0x4'))['db'];var utils=require(_0x0dfa('0x5'));var logger=require('../../config/logger')(_0x0dfa('0x6'));var config=require('../../config/environment');var jayson=require(_0x0dfa('0x7'));var client=jayson[_0x0dfa('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x417f7a,_0x29ca78,_0x32280b){return new BPromise(function(_0x16070c,_0x3b6881){return client['request'](_0x417f7a,_0x32280b)[_0x0dfa('0x9')](function(_0x2f813e){logger[_0x0dfa('0xa')]('Dynamics365Field,\x20%s,\x20%s',_0x29ca78,_0x0dfa('0xb'));logger['debug'](_0x0dfa('0xc'),_0x29ca78,_0x0dfa('0xb'),JSON[_0x0dfa('0xd')](_0x2f813e));if(_0x2f813e['error']){if(_0x2f813e[_0x0dfa('0xe')][_0x0dfa('0xf')]===0x1f4){logger['error'](_0x0dfa('0x10'),_0x29ca78,_0x2f813e[_0x0dfa('0xe')]['message']);return _0x3b6881(_0x2f813e[_0x0dfa('0xe')][_0x0dfa('0x11')]);}logger[_0x0dfa('0xe')](_0x0dfa('0x10'),_0x29ca78,_0x2f813e[_0x0dfa('0xe')][_0x0dfa('0x11')]);return _0x16070c(_0x2f813e['error'][_0x0dfa('0x11')]);}else{logger[_0x0dfa('0xa')](_0x0dfa('0x10'),_0x29ca78,_0x0dfa('0xb'));_0x16070c(_0x2f813e[_0x0dfa('0x12')][_0x0dfa('0x11')]);}})[_0x0dfa('0x13')](function(_0x3c79f0){logger[_0x0dfa('0xe')](_0x0dfa('0x10'),_0x29ca78,_0x3c79f0);_0x3b6881(_0x3c79f0);});});} \ No newline at end of file +var _0x2484=['Dynamics365Field,\x20%s,\x20%s','request\x20sent','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x4df4e7,_0x179ce8){var _0x389091=function(_0x10c7b6){while(--_0x10c7b6){_0x4df4e7['push'](_0x4df4e7['shift']());}};_0x389091(++_0x179ce8);}(_0x2484,0x178));var _0x4248=function(_0xe5b349,_0x5f06e4){_0xe5b349=_0xe5b349-0x0;var _0x26b0ad=_0x2484[_0xe5b349];return _0x26b0ad;};'use strict';var _=require(_0x4248('0x0'));var util=require(_0x4248('0x1'));var moment=require('moment');var BPromise=require(_0x4248('0x2'));var rs=require(_0x4248('0x3'));var fs=require('fs');var Redis=require(_0x4248('0x4'));var db=require(_0x4248('0x5'))['db'];var utils=require(_0x4248('0x6'));var logger=require(_0x4248('0x7'))(_0x4248('0x8'));var config=require('../../config/environment');var jayson=require(_0x4248('0x9'));var client=jayson[_0x4248('0xa')][_0x4248('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x189f42,_0x412c18,_0x14500e){return new BPromise(function(_0x5c1284,_0xa19286){return client[_0x4248('0xc')](_0x189f42,_0x14500e)[_0x4248('0xd')](function(_0xbe710c){logger[_0x4248('0xe')](_0x4248('0xf'),_0x412c18,_0x4248('0x10'));logger['debug'](_0x4248('0x11'),_0x412c18,'request\x20sent',JSON[_0x4248('0x12')](_0xbe710c));if(_0xbe710c[_0x4248('0x13')]){if(_0xbe710c[_0x4248('0x13')]['code']===0x1f4){logger['error'](_0x4248('0xf'),_0x412c18,_0xbe710c['error'][_0x4248('0x14')]);return _0xa19286(_0xbe710c[_0x4248('0x13')][_0x4248('0x14')]);}logger[_0x4248('0x13')](_0x4248('0xf'),_0x412c18,_0xbe710c['error'][_0x4248('0x14')]);return _0x5c1284(_0xbe710c[_0x4248('0x13')][_0x4248('0x14')]);}else{logger[_0x4248('0xe')](_0x4248('0xf'),_0x412c18,'request\x20sent');_0x5c1284(_0xbe710c[_0x4248('0x15')][_0x4248('0x14')]);}})[_0x4248('0x16')](function(_0x3a2cd5){logger[_0x4248('0x13')](_0x4248('0xf'),_0x412c18,_0x3a2cd5);_0xa19286(_0x3a2cd5);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 17c2c65..a3302b7 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 _0x1072=['destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','getConfigurations','/:id/fields','post','create','/:id/configurations','addConfiguration','put','update','delete'];(function(_0x1ab7c1,_0x48f0f3){var _0x415865=function(_0x19c232){while(--_0x19c232){_0x1ab7c1['push'](_0x1ab7c1['shift']());}};_0x415865(++_0x48f0f3);}(_0x1072,0x9c));var _0x2107=function(_0x62c958,_0x2bfdbc){_0x62c958=_0x62c958-0x0;var _0x57ec61=_0x1072[_0x62c958];return _0x57ec61;};'use strict';var multer=require(_0x2107('0x0'));var util=require('util');var path=require(_0x2107('0x1'));var timeout=require(_0x2107('0x2'));var express=require(_0x2107('0x3'));var router=express[_0x2107('0x4')]();var auth=require(_0x2107('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2107('0x6'));var controller=require('./intFreshdeskAccount.controller');router[_0x2107('0x7')]('/',auth[_0x2107('0x8')](),controller['index']);router[_0x2107('0x7')](_0x2107('0x9'),auth[_0x2107('0x8')](),controller[_0x2107('0xa')]);router[_0x2107('0x7')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x2107('0xb')]);router[_0x2107('0x7')](_0x2107('0xc'),auth['isAuthenticated'](),controller['getFields']);router[_0x2107('0xd')]('/',auth[_0x2107('0x8')](),controller[_0x2107('0xe')]);router[_0x2107('0xd')](_0x2107('0xf'),auth['isAuthenticated'](),controller[_0x2107('0x10')]);router[_0x2107('0x11')](_0x2107('0x9'),auth['isAuthenticated'](),controller[_0x2107('0x12')]);router[_0x2107('0x13')](_0x2107('0x9'),auth['isAuthenticated'](),controller[_0x2107('0x14')]);module[_0x2107('0x15')]=router; \ No newline at end of file +var _0xde14=['index','/:id','getConfigurations','/:id/fields','post','addConfiguration','put','update','delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0xde14,0x1ae));var _0x4de1=function(_0x283acc,_0x2e1f84){_0x283acc=_0x283acc-0x0;var _0x70a7e0=_0xde14[_0x283acc];return _0x70a7e0;};'use strict';var multer=require(_0x4de1('0x0'));var util=require(_0x4de1('0x1'));var path=require(_0x4de1('0x2'));var timeout=require(_0x4de1('0x3'));var express=require('express');var router=express[_0x4de1('0x4')]();var auth=require(_0x4de1('0x5'));var interaction=require(_0x4de1('0x6'));var config=require(_0x4de1('0x7'));var controller=require(_0x4de1('0x8'));router[_0x4de1('0x9')]('/',auth[_0x4de1('0xa')](),controller[_0x4de1('0xb')]);router[_0x4de1('0x9')](_0x4de1('0xc'),auth[_0x4de1('0xa')](),controller['show']);router[_0x4de1('0x9')]('/:id/configurations',auth[_0x4de1('0xa')](),controller[_0x4de1('0xd')]);router['get'](_0x4de1('0xe'),auth[_0x4de1('0xa')](),controller['getFields']);router[_0x4de1('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4de1('0xf')]('/:id/configurations',auth[_0x4de1('0xa')](),controller[_0x4de1('0x10')]);router[_0x4de1('0x11')](_0x4de1('0xc'),auth[_0x4de1('0xa')](),controller[_0x4de1('0x12')]);router[_0x4de1('0x13')](_0x4de1('0xc'),auth[_0x4de1('0xa')](),controller[_0x4de1('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index cfba93a..e2f1e04 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 _0x7804=['STRING','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7804,0xc3));var _0x4780=function(_0x458b3e,_0x131edc){_0x458b3e=_0x458b3e-0x0;var _0x175dbc=_0x7804[_0x458b3e];return _0x175dbc;};'use strict';var Sequelize=require(_0x4780('0x0'));module['exports']={'name':{'type':Sequelize[_0x4780('0x1')]},'description':{'type':Sequelize[_0x4780('0x1')]},'username':{'type':Sequelize[_0x4780('0x1')],'unique':'username'},'apiKey':{'type':Sequelize[_0x4780('0x1')]},'remoteUri':{'type':Sequelize[_0x4780('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xfef3=['sequelize','STRING','username','remoteUri'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xfef3,0x118));var _0x3fef=function(_0x7a3bfe,_0x41fc9e){_0x7a3bfe=_0x7a3bfe-0x0;var _0x3829e4=_0xfef3[_0x7a3bfe];return _0x3829e4;};'use strict';var Sequelize=require(_0x3fef('0x0'));module['exports']={'name':{'type':Sequelize[_0x3fef('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x3fef('0x1')],'unique':_0x3fef('0x2')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x3fef('0x1')],'unique':_0x3fef('0x3')},'serverUrl':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index ee398d8..e3ad5ac 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 _0x838a=['http','test','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','count','offset','set','Content-Range','json','apply','reject','save','update','stack','name','send','index','FreshdeskAccount','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','nolimit','limit','order','sort','where','filter','merge','field','options','include','findAll','rows','show','params','includeAll','find','create','body','destroy','getConfigurations','findOne','FreshdeskConfiguration','pick','map','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','FreshdeskField','getFields','apiKey','slice','substring','lastIndexOf','GET','%s/%s','api/v2/ticket_fields','format','Basic\x20%s','base64','subject','agent','description','priority','group','source','ticket_type','company','remove','includes','default','custom_text','label','choices','capitalize','statusCode','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../mysqldb','../../components/integrations/configuration'];(function(_0x332933,_0x3f58df){var _0x34fb7b=function(_0x1d0de0){while(--_0x1d0de0){_0x332933['push'](_0x332933['shift']());}};_0x34fb7b(++_0x3f58df);}(_0x838a,0x65));var _0xa838=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0x838a[_0x2bf141];return _0x48277b;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xa838('0x0'));var zipdir=require(_0xa838('0x1'));var jsonpatch=require(_0xa838('0x2'));var rp=require(_0xa838('0x3'));var moment=require(_0xa838('0x4'));var BPromise=require(_0xa838('0x5'));var Mustache=require(_0xa838('0x6'));var util=require(_0xa838('0x7'));var path=require(_0xa838('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa838('0x9'));var fs=require('fs');var _=require(_0xa838('0xa'));var squel=require(_0xa838('0xb'));var crypto=require(_0xa838('0xc'));var jsforce=require(_0xa838('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa838('0xe'));var Papa=require('papaparse');var Redis=require(_0xa838('0xf'));var authService=require(_0xa838('0x10'));var qs=require(_0xa838('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xa838('0x12'));var config=require('../../config/environment');var db=require(_0xa838('0x13'))['db'];var integrations=require(_0xa838('0x14'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa838('0x15')]({'port':0x232a});function checkPasswordPattern(_0x3838c1,_0x5b0769,_0x31fa6e){if(_0x31fa6e){var _0x2c3d0b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2c3d0b[_0xa838('0x16')](_0x5b0769)){return _0x3838c1;}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 _0x3838c1;}}function respondWithRpcPromise(_0x3a4a20,_0x8544ba,_0x236a03,_0x4b8166){return new BPromise(function(_0x3b6bdc,_0x4083aa){var _0x16bad2=_0x4b8166||client;return _0x16bad2[_0xa838('0x17')](_0x3a4a20,_0x236a03)[_0xa838('0x18')](function(_0x545871){logger[_0xa838('0x19')](_0xa838('0x1a'),_0x8544ba,_0xa838('0x1b'));logger['debug'](_0xa838('0x1c'),_0x8544ba,_0xa838('0x1b'),JSON[_0xa838('0x1d')](_0x545871));if(_0x545871[_0xa838('0x1e')]){if(_0x545871[_0xa838('0x1e')][_0xa838('0x1f')]===0x1f4){logger[_0xa838('0x1e')](_0xa838('0x1a'),_0x8544ba,_0x545871[_0xa838('0x1e')][_0xa838('0x20')]);return _0x4083aa(_0x545871[_0xa838('0x1e')]['message']);}logger[_0xa838('0x1e')](_0xa838('0x1a'),_0x8544ba,_0x545871[_0xa838('0x1e')]['message']);return _0x3b6bdc(_0x545871['error'][_0xa838('0x20')]);}else{logger[_0xa838('0x19')](_0xa838('0x1a'),_0x8544ba,_0xa838('0x1b'));_0x3b6bdc(_0x545871['result']['message']);}})[_0xa838('0x21')](function(_0x510211){logger[_0xa838('0x1e')](_0xa838('0x1a'),_0x8544ba,_0x510211);_0x4083aa(_0x510211);});});}function respondWithStatusCode(_0x28f7df,_0x36e1a1){_0x36e1a1=_0x36e1a1||0xcc;return function(_0x4d19ea){if(_0x4d19ea){return _0x28f7df[_0xa838('0x22')](_0x36e1a1);}return _0x28f7df[_0xa838('0x23')](_0x36e1a1)[_0xa838('0x24')]();};}function respondWithResult(_0x41c7c8,_0x175714){_0x175714=_0x175714||0xc8;return function(_0x9e275c){if(_0x9e275c){return _0x41c7c8[_0xa838('0x23')](_0x175714)['json'](_0x9e275c);}};}function respondWithFilteredResult(_0x5263d1,_0x48066c){return function(_0x5badc3){if(_0x5badc3){var _0x2f9a33=_0x5badc3[_0xa838('0x25')],_0xaece71=_0x48066c['offset'],_0x52809d=_0x48066c[_0xa838('0x26')]+_0x48066c['limit'],_0x205087;if(_0x52809d>=_0x2f9a33){_0x52809d=_0x2f9a33;_0x205087=0xc8;}else{_0x205087=0xce;}_0x5263d1['status'](_0x205087);return _0x5263d1[_0xa838('0x27')](_0xa838('0x28'),_0xaece71+'-'+_0x52809d+'/'+_0x2f9a33)[_0xa838('0x29')](_0x5badc3);}return null;};}function patchUpdates(_0x118272){return function(_0x38c167){try{jsonpatch[_0xa838('0x2a')](_0x38c167,_0x118272,!![]);}catch(_0x22da7d){return BPromise[_0xa838('0x2b')](_0x22da7d);}return _0x38c167[_0xa838('0x2c')]();};}function saveUpdates(_0x4964b5,_0x39d9c){return function(_0x265c2d){if(_0x265c2d){return _0x265c2d[_0xa838('0x2d')](_0x4964b5)[_0xa838('0x18')](function(_0x4f56e4){return _0x4f56e4;});}return null;};}function removeEntity(_0x12cbd6,_0x1efa00){return function(_0x103c7b){if(_0x103c7b){return _0x103c7b['destroy']()[_0xa838('0x18')](function(){_0x12cbd6[_0xa838('0x23')](0xcc)[_0xa838('0x24')]();});}};}function handleEntityNotFound(_0x268920,_0x5a6cd6){return function(_0x3daf44){if(!_0x3daf44){_0x268920[_0xa838('0x22')](0x194);}return _0x3daf44;};}function handleError(_0x259b60,_0x4a144f){_0x4a144f=_0x4a144f||0x1f4;return function(_0x184d85){logger[_0xa838('0x1e')](_0x184d85[_0xa838('0x2e')]);if(_0x184d85[_0xa838('0x2f')]){delete _0x184d85[_0xa838('0x2f')];}_0x259b60[_0xa838('0x23')](_0x4a144f)[_0xa838('0x30')](_0x184d85);};}exports[_0xa838('0x31')]=function(_0x20b991,_0x539283){var _0x1db025={},_0x375c45={},_0x1ce090={'count':0x0,'rows':[]};var _0x17d933=_['map'](db[_0xa838('0x32')][_0xa838('0x33')],function(_0x39b0b8){return{'name':_0x39b0b8[_0xa838('0x34')],'type':_0x39b0b8[_0xa838('0x35')][_0xa838('0x36')]};});_0x375c45['model']=_['map'](_0x17d933,_0xa838('0x2f'));_0x375c45['query']=_[_0xa838('0x37')](_0x20b991[_0xa838('0x38')]);_0x375c45[_0xa838('0x39')]=_[_0xa838('0x3a')](_0x375c45[_0xa838('0x3b')],_0x375c45[_0xa838('0x38')]);_0x1db025[_0xa838('0x3c')]=_[_0xa838('0x3a')](_0x375c45['model'],qs['fields'](_0x20b991['query'][_0xa838('0x3d')]));_0x1db025[_0xa838('0x3c')]=_0x1db025[_0xa838('0x3c')][_0xa838('0x3e')]?_0x1db025[_0xa838('0x3c')]:_0x375c45[_0xa838('0x3b')];if(!_0x20b991[_0xa838('0x38')]['hasOwnProperty'](_0xa838('0x3f'))){_0x1db025[_0xa838('0x40')]=qs[_0xa838('0x40')](_0x20b991[_0xa838('0x38')][_0xa838('0x40')]);_0x1db025[_0xa838('0x26')]=qs['offset'](_0x20b991['query'][_0xa838('0x26')]);}_0x1db025[_0xa838('0x41')]=qs[_0xa838('0x42')](_0x20b991[_0xa838('0x38')][_0xa838('0x42')]);_0x1db025[_0xa838('0x43')]=qs[_0xa838('0x39')](_['pick'](_0x20b991[_0xa838('0x38')],_0x375c45[_0xa838('0x39')]));if(_0x20b991[_0xa838('0x38')][_0xa838('0x44')]){_0x1db025['where']=_[_0xa838('0x45')](_0x1db025[_0xa838('0x43')],{'$or':_['map'](_0x17d933,function(_0x2fe928){if(_0x2fe928[_0xa838('0x35')]['key']!=='VIRTUAL'){var _0x46f5ca={};_0x46f5ca[_0x2fe928[_0xa838('0x46')]]={'$like':'%'+_0x20b991[_0xa838('0x38')][_0xa838('0x44')]+'%'};return _0x46f5ca;}})});}_0x1db025=_[_0xa838('0x45')]({},_0x1db025,_0x20b991[_0xa838('0x47')]);var _0x340c6e={'where':_0x1db025['where']};return db[_0xa838('0x32')][_0xa838('0x25')](_0x340c6e)[_0xa838('0x18')](function(_0x4c811f){_0x1ce090[_0xa838('0x25')]=_0x4c811f;if(_0x20b991[_0xa838('0x38')]['includeAll']){_0x1db025[_0xa838('0x48')]=[{'all':!![]}];}return db[_0xa838('0x32')][_0xa838('0x49')](_0x1db025);})['then'](function(_0x66d67c){_0x1ce090[_0xa838('0x4a')]=_0x66d67c;return _0x1ce090;})[_0xa838('0x18')](respondWithFilteredResult(_0x539283,_0x1db025))[_0xa838('0x21')](handleError(_0x539283,null));};exports[_0xa838('0x4b')]=function(_0x55b723,_0x4d0b64){var _0x496493={'raw':![],'where':{'id':_0x55b723[_0xa838('0x4c')]['id']}},_0x26cc26={};_0x26cc26[_0xa838('0x3b')]=_[_0xa838('0x37')](db[_0xa838('0x32')][_0xa838('0x33')]);_0x26cc26[_0xa838('0x38')]=_[_0xa838('0x37')](_0x55b723[_0xa838('0x38')]);_0x26cc26[_0xa838('0x39')]=_['intersection'](_0x26cc26[_0xa838('0x3b')],_0x26cc26['query']);_0x496493[_0xa838('0x3c')]=_['intersection'](_0x26cc26['model'],qs[_0xa838('0x3d')](_0x55b723[_0xa838('0x38')]['fields']));_0x496493[_0xa838('0x3c')]=_0x496493['attributes'][_0xa838('0x3e')]?_0x496493[_0xa838('0x3c')]:_0x26cc26[_0xa838('0x3b')];if(_0x55b723[_0xa838('0x38')][_0xa838('0x4d')]){_0x496493[_0xa838('0x48')]=[{'all':!![]}];}_0x496493=_['merge']({},_0x496493,_0x55b723[_0xa838('0x47')]);return db[_0xa838('0x32')][_0xa838('0x4e')](_0x496493)[_0xa838('0x18')](handleEntityNotFound(_0x4d0b64,null))[_0xa838('0x18')](respondWithResult(_0x4d0b64,null))[_0xa838('0x21')](handleError(_0x4d0b64,null));};exports[_0xa838('0x4f')]=function(_0x70511f,_0x21cf67){return db['FreshdeskAccount']['create'](_0x70511f[_0xa838('0x50')],{})[_0xa838('0x18')](respondWithResult(_0x21cf67,0xc9))[_0xa838('0x21')](handleError(_0x21cf67,null));};exports['update']=function(_0x4e860b,_0x3f4b8e){if(_0x4e860b['body']['id']){delete _0x4e860b[_0xa838('0x50')]['id'];}return db[_0xa838('0x32')]['find']({'where':{'id':_0x4e860b['params']['id']}})[_0xa838('0x18')](handleEntityNotFound(_0x3f4b8e,null))['then'](saveUpdates(_0x4e860b[_0xa838('0x50')],null))[_0xa838('0x18')](respondWithResult(_0x3f4b8e,null))[_0xa838('0x21')](handleError(_0x3f4b8e,null));};exports[_0xa838('0x51')]=function(_0x24a349,_0x5e7c57){return db[_0xa838('0x32')]['find']({'where':{'id':_0x24a349[_0xa838('0x4c')]['id']}})[_0xa838('0x18')](handleEntityNotFound(_0x5e7c57,null))[_0xa838('0x18')](removeEntity(_0x5e7c57,null))[_0xa838('0x21')](handleError(_0x5e7c57,null));};exports[_0xa838('0x52')]=function(_0x2dd0ab,_0x3ee7d7,_0xb623ea){var _0x20d533={};var _0xa31623={};var _0x3234fc;var _0x53635d;return db[_0xa838('0x32')][_0xa838('0x53')]({'where':{'id':_0x2dd0ab[_0xa838('0x4c')]['id']}})[_0xa838('0x18')](handleEntityNotFound(_0x3ee7d7,null))['then'](function(_0xb12824){if(_0xb12824){_0x3234fc=_0xb12824;_0xa31623[_0xa838('0x3b')]=_[_0xa838('0x37')](db[_0xa838('0x54')][_0xa838('0x33')]);_0xa31623['query']=_[_0xa838('0x37')](_0x2dd0ab[_0xa838('0x38')]);_0xa31623[_0xa838('0x39')]=_[_0xa838('0x3a')](_0xa31623[_0xa838('0x3b')],_0xa31623[_0xa838('0x38')]);_0x20d533[_0xa838('0x3c')]=_[_0xa838('0x3a')](_0xa31623['model'],qs['fields'](_0x2dd0ab[_0xa838('0x38')][_0xa838('0x3d')]));_0x20d533[_0xa838('0x3c')]=_0x20d533[_0xa838('0x3c')][_0xa838('0x3e')]?_0x20d533[_0xa838('0x3c')]:_0xa31623[_0xa838('0x3b')];_0x20d533['order']=qs['sort'](_0x2dd0ab[_0xa838('0x38')]['sort']);_0x20d533[_0xa838('0x43')]=qs[_0xa838('0x39')](_[_0xa838('0x55')](_0x2dd0ab[_0xa838('0x38')],_0xa31623[_0xa838('0x39')]));if(_0x2dd0ab['query'][_0xa838('0x44')]){_0x20d533[_0xa838('0x43')]=_['merge'](_0x20d533[_0xa838('0x43')],{'$or':_[_0xa838('0x56')](_0x20d533['attributes'],function(_0x1396b3){var _0x47dbcf={};_0x47dbcf[_0x1396b3]={'$like':'%'+_0x2dd0ab[_0xa838('0x38')][_0xa838('0x44')]+'%'};return _0x47dbcf;})});}_0x20d533=_['merge']({},_0x20d533,_0x2dd0ab[_0xa838('0x47')]);return _0x3234fc['getConfigurations'](_0x20d533);}})[_0xa838('0x18')](function(_0x16a921){if(_0x16a921){_0x53635d=_0x16a921[_0xa838('0x3e')];if(!_0x2dd0ab[_0xa838('0x38')]['hasOwnProperty'](_0xa838('0x3f'))){_0x20d533[_0xa838('0x40')]=qs[_0xa838('0x40')](_0x2dd0ab['query'][_0xa838('0x40')]);_0x20d533[_0xa838('0x26')]=qs[_0xa838('0x26')](_0x2dd0ab[_0xa838('0x38')][_0xa838('0x26')]);}return _0x3234fc[_0xa838('0x52')](_0x20d533);}})[_0xa838('0x18')](function(_0x14ab38){if(_0x14ab38){return _0x14ab38?{'count':_0x53635d,'rows':_0x14ab38}:null;}})[_0xa838('0x18')](respondWithResult(_0x3ee7d7,null))[_0xa838('0x21')](handleError(_0x3ee7d7,null));};exports[_0xa838('0x57')]=function(_0x273744,_0x391375,_0x28e3f2){if(_0x273744[_0xa838('0x50')]['id']){delete _0x273744[_0xa838('0x50')]['id'];}return db[_0xa838('0x32')][_0xa838('0x53')]({'where':{'id':_0x273744[_0xa838('0x4c')]['id']}})['then'](handleEntityNotFound(_0x391375,null))['then'](function(_0x24f863){if(_0x24f863){_0x273744[_0xa838('0x50')][_0xa838('0x58')]=_0x24f863['id'];_0x273744['body'][_0xa838('0x59')]=integrations[_0xa838('0x5a')](_0x273744[_0xa838('0x50')][_0xa838('0x5b')],_0x273744[_0xa838('0x50')][_0xa838('0x35')]);_0x273744[_0xa838('0x50')]['Descriptions']=integrations[_0xa838('0x5c')](_0x273744[_0xa838('0x50')][_0xa838('0x5b')],_0x273744[_0xa838('0x50')][_0xa838('0x35')]);return db[_0xa838('0x54')][_0xa838('0x4f')](_0x273744[_0xa838('0x50')],{'include':[{'model':db[_0xa838('0x5d')],'as':_0xa838('0x59')},{'model':db[_0xa838('0x5d')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x391375,null))[_0xa838('0x21')](handleError(_0x391375,null));};exports[_0xa838('0x5e')]=function(_0x3e8c8a,_0x253b72,_0x16a97b){var _0x180859='';return db['FreshdeskAccount'][_0xa838('0x53')]({'where':{'id':_0x3e8c8a['params']['id']},'attributes':['id','remoteUri',_0xa838('0x5f')]})[_0xa838('0x18')](handleEntityNotFound(_0x253b72,null))[_0xa838('0x18')](function(_0x215db1){if(_0x215db1){_0x180859=_0x215db1['remoteUri'];var _0x31713c=_0x180859[_0xa838('0x60')](-0x1);if(_0x31713c==='/'){_0x180859=_0x180859[_0xa838('0x61')](0x0,_0x180859[_0xa838('0x62')](_0x31713c));}return rp({'method':_0xa838('0x63'),'uri':util['format'](_0xa838('0x64'),_0x180859,_0xa838('0x65')),'headers':{'Authorization':util[_0xa838('0x66')](_0xa838('0x67'),new Buffer(util[_0xa838('0x66')]('%s:X',_0x215db1[_0xa838('0x5f')]))['toString'](_0xa838('0x68')))},'json':!![]});}})[_0xa838('0x18')](function(_0xbe47aa){if(_0xbe47aa){var _0x52b810=['requester',_0xa838('0x69'),_0xa838('0x6a'),_0xa838('0x6b'),_0xa838('0x23'),_0xa838('0x6c'),_0xa838('0x6d'),_0xa838('0x6e'),_0xa838('0x6f'),_0xa838('0x6d'),_0xa838('0x70')];_[_0xa838('0x71')](_0xbe47aa,function(_0x25ec64){return _0x52b810[_0xa838('0x72')](_0x25ec64['name'])||!_0x25ec64[_0xa838('0x73')]&&_0x25ec64[_0xa838('0x35')]!==_0xa838('0x74')&&_0x25ec64[_0xa838('0x35')]!=='custom_dropdown';});return{'count':_0xbe47aa[_0xa838('0x3e')],'rows':_[_0xa838('0x56')](_0xbe47aa,function(_0x556e14){return{'id':_0x556e14[_0xa838('0x2f')],'name':_0x556e14[_0xa838('0x75')],'custom':!_0x556e14[_0xa838('0x73')],'options':_0x556e14['choices']?_[_0xa838('0x56')](_0x556e14[_0xa838('0x76')],function(_0x33128f){return{'name':_[_0xa838('0x77')](_0x33128f),'value':_0x33128f};}):[]};})};}})[_0xa838('0x18')](respondWithResult(_0x253b72,null))[_0xa838('0x21')](function(_0x17971e){var _0x550c08=_0x3e8c8a[_0xa838('0x38')][_0xa838('0x16')]?0x1f4:_0x17971e[_0xa838('0x78')]||0x1f4;logger[_0xa838('0x1e')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x550c08,JSON[_0xa838('0x1d')](_0x17971e));delete _0x17971e['name'];if(_0x550c08===0x191){_0x550c08=0x190;}_0x253b72[_0xa838('0x23')](_0x550c08)['send'](_0x3e8c8a[_0xa838('0x38')][_0xa838('0x16')]?{'message':_0xa838('0x79'),'statusCode':_0x17971e[_0xa838('0x78')]}:_0x17971e);});}; \ No newline at end of file +var _0xc25b=['where','pick','filter','merge','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','update','findOne','FreshdeskConfiguration','order','hasOwnProperty','nolimit','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','FreshdeskField','remoteUri','apiKey','GET','format','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','base64','requester','subject','agent','description','group','ticket_type','company','remove','includes','custom_text','custom_dropdown','label','default','choices','capitalize','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','html-pdf','rimraf','request-promise','moment','bluebird','path','sox','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','client','http','test','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','sendStatus','status','end','json','count','set','Content-Range','apply','destroy','stack','name','send','index','map','FreshdeskAccount','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','limit','offset','sort'];(function(_0x1da9ce,_0x22ddf9){var _0x5663f3=function(_0x7aaf98){while(--_0x7aaf98){_0x1da9ce['push'](_0x1da9ce['shift']());}};_0x5663f3(++_0x22ddf9);}(_0xc25b,0x133));var _0xbc25=function(_0x490a6c,_0x1f7fb2){_0x490a6c=_0x490a6c-0x0;var _0x361ea5=_0xc25b[_0x490a6c];return _0x361ea5;};'use strict';var pdf=require(_0xbc25('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbc25('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbc25('0x2'));var moment=require(_0xbc25('0x3'));var BPromise=require(_0xbc25('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xbc25('0x5'));var sox=require(_0xbc25('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xbc25('0x7'));var squel=require(_0xbc25('0x8'));var crypto=require(_0xbc25('0x9'));var jsforce=require(_0xbc25('0xa'));var deskjs=require(_0xbc25('0xb'));var toCsv=require('to-csv');var querystring=require(_0xbc25('0xc'));var Papa=require(_0xbc25('0xd'));var Redis=require('ioredis');var authService=require(_0xbc25('0xe'));var qs=require(_0xbc25('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xbc25('0x10'));var utils=require(_0xbc25('0x11'));var config=require(_0xbc25('0x12'));var db=require(_0xbc25('0x13'))['db'];var integrations=require(_0xbc25('0x14'));var jayson=require('jayson/promise');var client=jayson[_0xbc25('0x15')][_0xbc25('0x16')]({'port':0x232a});function checkPasswordPattern(_0x2efe9b,_0x1011b2,_0xd2203a){if(_0xd2203a){var _0x39d76b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x39d76b[_0xbc25('0x17')](_0x1011b2)){return _0x2efe9b;}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 _0x2efe9b;}}function respondWithRpcPromise(_0x562e31,_0x374d55,_0x233cfc,_0x221aef){return new BPromise(function(_0x81926b,_0x11cdde){var _0x59b880=_0x221aef||client;return _0x59b880[_0xbc25('0x18')](_0x562e31,_0x233cfc)[_0xbc25('0x19')](function(_0x129569){logger[_0xbc25('0x1a')](_0xbc25('0x1b'),_0x374d55,_0xbc25('0x1c'));logger[_0xbc25('0x1d')](_0xbc25('0x1e'),_0x374d55,_0xbc25('0x1c'),JSON['stringify'](_0x129569));if(_0x129569[_0xbc25('0x1f')]){if(_0x129569[_0xbc25('0x1f')][_0xbc25('0x20')]===0x1f4){logger[_0xbc25('0x1f')](_0xbc25('0x1b'),_0x374d55,_0x129569[_0xbc25('0x1f')][_0xbc25('0x21')]);return _0x11cdde(_0x129569['error'][_0xbc25('0x21')]);}logger[_0xbc25('0x1f')](_0xbc25('0x1b'),_0x374d55,_0x129569['error']['message']);return _0x81926b(_0x129569[_0xbc25('0x1f')][_0xbc25('0x21')]);}else{logger[_0xbc25('0x1a')](_0xbc25('0x1b'),_0x374d55,_0xbc25('0x1c'));_0x81926b(_0x129569['result'][_0xbc25('0x21')]);}})['catch'](function(_0x24adfd){logger[_0xbc25('0x1f')](_0xbc25('0x1b'),_0x374d55,_0x24adfd);_0x11cdde(_0x24adfd);});});}function respondWithStatusCode(_0x1a208c,_0x50f7f1){_0x50f7f1=_0x50f7f1||0xcc;return function(_0x471521){if(_0x471521){return _0x1a208c[_0xbc25('0x22')](_0x50f7f1);}return _0x1a208c[_0xbc25('0x23')](_0x50f7f1)[_0xbc25('0x24')]();};}function respondWithResult(_0x1eb658,_0x4e6276){_0x4e6276=_0x4e6276||0xc8;return function(_0x2a823b){if(_0x2a823b){return _0x1eb658[_0xbc25('0x23')](_0x4e6276)[_0xbc25('0x25')](_0x2a823b);}};}function respondWithFilteredResult(_0x1d39e6,_0x4c599a){return function(_0x5109c7){if(_0x5109c7){var _0x180a58=_0x5109c7[_0xbc25('0x26')],_0x63a259=_0x4c599a['offset'],_0x485508=_0x4c599a['offset']+_0x4c599a['limit'],_0x8b1b5c;if(_0x485508>=_0x180a58){_0x485508=_0x180a58;_0x8b1b5c=0xc8;}else{_0x8b1b5c=0xce;}_0x1d39e6[_0xbc25('0x23')](_0x8b1b5c);return _0x1d39e6[_0xbc25('0x27')](_0xbc25('0x28'),_0x63a259+'-'+_0x485508+'/'+_0x180a58)['json'](_0x5109c7);}return null;};}function patchUpdates(_0x1791ac){return function(_0x845322){try{jsonpatch[_0xbc25('0x29')](_0x845322,_0x1791ac,!![]);}catch(_0x2c24cd){return BPromise['reject'](_0x2c24cd);}return _0x845322['save']();};}function saveUpdates(_0x10bb87,_0x33356e){return function(_0x587e09){if(_0x587e09){return _0x587e09['update'](_0x10bb87)['then'](function(_0x396435){return _0x396435;});}return null;};}function removeEntity(_0x1c8ff3,_0x450575){return function(_0x544b4c){if(_0x544b4c){return _0x544b4c[_0xbc25('0x2a')]()[_0xbc25('0x19')](function(){_0x1c8ff3[_0xbc25('0x23')](0xcc)[_0xbc25('0x24')]();});}};}function handleEntityNotFound(_0x348a7a,_0x491327){return function(_0xc3ef00){if(!_0xc3ef00){_0x348a7a[_0xbc25('0x22')](0x194);}return _0xc3ef00;};}function handleError(_0x31a247,_0x55e4eb){_0x55e4eb=_0x55e4eb||0x1f4;return function(_0x4e17c3){logger[_0xbc25('0x1f')](_0x4e17c3[_0xbc25('0x2b')]);if(_0x4e17c3['name']){delete _0x4e17c3[_0xbc25('0x2c')];}_0x31a247[_0xbc25('0x23')](_0x55e4eb)[_0xbc25('0x2d')](_0x4e17c3);};}exports[_0xbc25('0x2e')]=function(_0x5539ba,_0x1dab48){var _0x37240a={},_0x44fb49={},_0x5d9379={'count':0x0,'rows':[]};var _0x356ebf=_[_0xbc25('0x2f')](db[_0xbc25('0x30')][_0xbc25('0x31')],function(_0x5aa6e8){return{'name':_0x5aa6e8['fieldName'],'type':_0x5aa6e8[_0xbc25('0x32')][_0xbc25('0x33')]};});_0x44fb49[_0xbc25('0x34')]=_[_0xbc25('0x2f')](_0x356ebf,_0xbc25('0x2c'));_0x44fb49['query']=_['keys'](_0x5539ba[_0xbc25('0x35')]);_0x44fb49[_0xbc25('0x36')]=_[_0xbc25('0x37')](_0x44fb49[_0xbc25('0x34')],_0x44fb49[_0xbc25('0x35')]);_0x37240a[_0xbc25('0x38')]=_['intersection'](_0x44fb49[_0xbc25('0x34')],qs[_0xbc25('0x39')](_0x5539ba[_0xbc25('0x35')][_0xbc25('0x39')]));_0x37240a['attributes']=_0x37240a['attributes'][_0xbc25('0x3a')]?_0x37240a[_0xbc25('0x38')]:_0x44fb49['model'];if(!_0x5539ba['query']['hasOwnProperty']('nolimit')){_0x37240a[_0xbc25('0x3b')]=qs['limit'](_0x5539ba[_0xbc25('0x35')][_0xbc25('0x3b')]);_0x37240a[_0xbc25('0x3c')]=qs[_0xbc25('0x3c')](_0x5539ba[_0xbc25('0x35')]['offset']);}_0x37240a['order']=qs[_0xbc25('0x3d')](_0x5539ba[_0xbc25('0x35')][_0xbc25('0x3d')]);_0x37240a[_0xbc25('0x3e')]=qs[_0xbc25('0x36')](_[_0xbc25('0x3f')](_0x5539ba['query'],_0x44fb49['filters']));if(_0x5539ba[_0xbc25('0x35')][_0xbc25('0x40')]){_0x37240a[_0xbc25('0x3e')]=_[_0xbc25('0x41')](_0x37240a[_0xbc25('0x3e')],{'$or':_['map'](_0x356ebf,function(_0xd67459){if(_0xd67459[_0xbc25('0x32')][_0xbc25('0x33')]!==_0xbc25('0x42')){var _0x4dba62={};_0x4dba62[_0xd67459[_0xbc25('0x43')]]={'$like':'%'+_0x5539ba[_0xbc25('0x35')][_0xbc25('0x40')]+'%'};return _0x4dba62;}})});}_0x37240a=_[_0xbc25('0x41')]({},_0x37240a,_0x5539ba[_0xbc25('0x44')]);var _0x127e44={'where':_0x37240a[_0xbc25('0x3e')]};return db[_0xbc25('0x30')][_0xbc25('0x26')](_0x127e44)['then'](function(_0x21255e){_0x5d9379['count']=_0x21255e;if(_0x5539ba[_0xbc25('0x35')][_0xbc25('0x45')]){_0x37240a[_0xbc25('0x46')]=[{'all':!![]}];}return db['FreshdeskAccount'][_0xbc25('0x47')](_0x37240a);})[_0xbc25('0x19')](function(_0x16dcdc){_0x5d9379[_0xbc25('0x48')]=_0x16dcdc;return _0x5d9379;})['then'](respondWithFilteredResult(_0x1dab48,_0x37240a))[_0xbc25('0x49')](handleError(_0x1dab48,null));};exports[_0xbc25('0x4a')]=function(_0x2b21b6,_0x2e84c0){var _0x13f25b={'raw':![],'where':{'id':_0x2b21b6[_0xbc25('0x4b')]['id']}},_0x2be922={};_0x2be922[_0xbc25('0x34')]=_[_0xbc25('0x4c')](db['FreshdeskAccount']['rawAttributes']);_0x2be922[_0xbc25('0x35')]=_[_0xbc25('0x4c')](_0x2b21b6[_0xbc25('0x35')]);_0x2be922['filters']=_[_0xbc25('0x37')](_0x2be922['model'],_0x2be922[_0xbc25('0x35')]);_0x13f25b['attributes']=_[_0xbc25('0x37')](_0x2be922[_0xbc25('0x34')],qs[_0xbc25('0x39')](_0x2b21b6['query'][_0xbc25('0x39')]));_0x13f25b[_0xbc25('0x38')]=_0x13f25b[_0xbc25('0x38')][_0xbc25('0x3a')]?_0x13f25b[_0xbc25('0x38')]:_0x2be922['model'];if(_0x2b21b6['query']['includeAll']){_0x13f25b['include']=[{'all':!![]}];}_0x13f25b=_[_0xbc25('0x41')]({},_0x13f25b,_0x2b21b6[_0xbc25('0x44')]);return db[_0xbc25('0x30')][_0xbc25('0x4d')](_0x13f25b)[_0xbc25('0x19')](handleEntityNotFound(_0x2e84c0,null))[_0xbc25('0x19')](respondWithResult(_0x2e84c0,null))[_0xbc25('0x49')](handleError(_0x2e84c0,null));};exports[_0xbc25('0x4e')]=function(_0x6a52a1,_0x57e992){return db[_0xbc25('0x30')]['create'](_0x6a52a1[_0xbc25('0x4f')],{})[_0xbc25('0x19')](respondWithResult(_0x57e992,0xc9))[_0xbc25('0x49')](handleError(_0x57e992,null));};exports[_0xbc25('0x50')]=function(_0x3743db,_0x27ba01){if(_0x3743db[_0xbc25('0x4f')]['id']){delete _0x3743db['body']['id'];}return db[_0xbc25('0x30')][_0xbc25('0x4d')]({'where':{'id':_0x3743db[_0xbc25('0x4b')]['id']}})['then'](handleEntityNotFound(_0x27ba01,null))[_0xbc25('0x19')](saveUpdates(_0x3743db[_0xbc25('0x4f')],null))[_0xbc25('0x19')](respondWithResult(_0x27ba01,null))[_0xbc25('0x49')](handleError(_0x27ba01,null));};exports[_0xbc25('0x2a')]=function(_0x55e89f,_0x4abcf5){return db['FreshdeskAccount'][_0xbc25('0x4d')]({'where':{'id':_0x55e89f[_0xbc25('0x4b')]['id']}})[_0xbc25('0x19')](handleEntityNotFound(_0x4abcf5,null))[_0xbc25('0x19')](removeEntity(_0x4abcf5,null))[_0xbc25('0x49')](handleError(_0x4abcf5,null));};exports['getConfigurations']=function(_0x21fed3,_0x21da74,_0x23073e){var _0xe740e9={};var _0x532c58={};var _0x2822c6;var _0xb2051b;return db['FreshdeskAccount'][_0xbc25('0x51')]({'where':{'id':_0x21fed3['params']['id']}})['then'](handleEntityNotFound(_0x21da74,null))['then'](function(_0x5d1225){if(_0x5d1225){_0x2822c6=_0x5d1225;_0x532c58[_0xbc25('0x34')]=_[_0xbc25('0x4c')](db[_0xbc25('0x52')][_0xbc25('0x31')]);_0x532c58[_0xbc25('0x35')]=_[_0xbc25('0x4c')](_0x21fed3['query']);_0x532c58[_0xbc25('0x36')]=_[_0xbc25('0x37')](_0x532c58['model'],_0x532c58[_0xbc25('0x35')]);_0xe740e9[_0xbc25('0x38')]=_[_0xbc25('0x37')](_0x532c58['model'],qs[_0xbc25('0x39')](_0x21fed3[_0xbc25('0x35')][_0xbc25('0x39')]));_0xe740e9[_0xbc25('0x38')]=_0xe740e9['attributes'][_0xbc25('0x3a')]?_0xe740e9[_0xbc25('0x38')]:_0x532c58[_0xbc25('0x34')];_0xe740e9[_0xbc25('0x53')]=qs[_0xbc25('0x3d')](_0x21fed3[_0xbc25('0x35')][_0xbc25('0x3d')]);_0xe740e9[_0xbc25('0x3e')]=qs['filters'](_['pick'](_0x21fed3['query'],_0x532c58[_0xbc25('0x36')]));if(_0x21fed3[_0xbc25('0x35')][_0xbc25('0x40')]){_0xe740e9['where']=_[_0xbc25('0x41')](_0xe740e9[_0xbc25('0x3e')],{'$or':_[_0xbc25('0x2f')](_0xe740e9[_0xbc25('0x38')],function(_0x3d36ad){var _0x17b7ae={};_0x17b7ae[_0x3d36ad]={'$like':'%'+_0x21fed3[_0xbc25('0x35')]['filter']+'%'};return _0x17b7ae;})});}_0xe740e9=_[_0xbc25('0x41')]({},_0xe740e9,_0x21fed3['options']);return _0x2822c6['getConfigurations'](_0xe740e9);}})[_0xbc25('0x19')](function(_0x38e3d8){if(_0x38e3d8){_0xb2051b=_0x38e3d8['length'];if(!_0x21fed3[_0xbc25('0x35')][_0xbc25('0x54')](_0xbc25('0x55'))){_0xe740e9['limit']=qs[_0xbc25('0x3b')](_0x21fed3[_0xbc25('0x35')][_0xbc25('0x3b')]);_0xe740e9['offset']=qs[_0xbc25('0x3c')](_0x21fed3[_0xbc25('0x35')]['offset']);}return _0x2822c6[_0xbc25('0x56')](_0xe740e9);}})['then'](function(_0x59b3ab){if(_0x59b3ab){return _0x59b3ab?{'count':_0xb2051b,'rows':_0x59b3ab}:null;}})[_0xbc25('0x19')](respondWithResult(_0x21da74,null))[_0xbc25('0x49')](handleError(_0x21da74,null));};exports[_0xbc25('0x57')]=function(_0x5ddb75,_0x24247f,_0x31077c){if(_0x5ddb75['body']['id']){delete _0x5ddb75[_0xbc25('0x4f')]['id'];}return db[_0xbc25('0x30')][_0xbc25('0x51')]({'where':{'id':_0x5ddb75['params']['id']}})['then'](handleEntityNotFound(_0x24247f,null))[_0xbc25('0x19')](function(_0x3a10b6){if(_0x3a10b6){_0x5ddb75[_0xbc25('0x4f')][_0xbc25('0x58')]=_0x3a10b6['id'];_0x5ddb75[_0xbc25('0x4f')][_0xbc25('0x59')]=integrations[_0xbc25('0x5a')](_0x5ddb75[_0xbc25('0x4f')][_0xbc25('0x5b')],_0x5ddb75['body']['type']);_0x5ddb75[_0xbc25('0x4f')][_0xbc25('0x5c')]=integrations['getDescriptions'](_0x5ddb75[_0xbc25('0x4f')][_0xbc25('0x5b')],_0x5ddb75[_0xbc25('0x4f')]['type']);return db[_0xbc25('0x52')][_0xbc25('0x4e')](_0x5ddb75[_0xbc25('0x4f')],{'include':[{'model':db[_0xbc25('0x5d')],'as':'Subjects'},{'model':db[_0xbc25('0x5d')],'as':_0xbc25('0x5c')}]});}return null;})['then'](respondWithResult(_0x24247f,null))[_0xbc25('0x49')](handleError(_0x24247f,null));};exports['getFields']=function(_0x598943,_0x43fa0c,_0x3129de){var _0x45f67d='';return db['FreshdeskAccount'][_0xbc25('0x51')]({'where':{'id':_0x598943[_0xbc25('0x4b')]['id']},'attributes':['id',_0xbc25('0x5e'),_0xbc25('0x5f')]})[_0xbc25('0x19')](handleEntityNotFound(_0x43fa0c,null))[_0xbc25('0x19')](function(_0x547d99){if(_0x547d99){_0x45f67d=_0x547d99[_0xbc25('0x5e')];var _0x4d9340=_0x45f67d['slice'](-0x1);if(_0x4d9340==='/'){_0x45f67d=_0x45f67d['substring'](0x0,_0x45f67d['lastIndexOf'](_0x4d9340));}return rp({'method':_0xbc25('0x60'),'uri':util[_0xbc25('0x61')]('%s/%s',_0x45f67d,_0xbc25('0x62')),'headers':{'Authorization':util[_0xbc25('0x61')](_0xbc25('0x63'),new Buffer(util[_0xbc25('0x61')](_0xbc25('0x64'),_0x547d99[_0xbc25('0x5f')]))[_0xbc25('0x65')](_0xbc25('0x66')))},'json':!![]});}})['then'](function(_0x261b88){if(_0x261b88){var _0x1bb5a5=[_0xbc25('0x67'),_0xbc25('0x68'),_0xbc25('0x69'),_0xbc25('0x6a'),_0xbc25('0x23'),'priority',_0xbc25('0x6b'),'source',_0xbc25('0x6c'),_0xbc25('0x6b'),_0xbc25('0x6d')];_[_0xbc25('0x6e')](_0x261b88,function(_0x376683){return _0x1bb5a5[_0xbc25('0x6f')](_0x376683[_0xbc25('0x2c')])||!_0x376683['default']&&_0x376683[_0xbc25('0x32')]!==_0xbc25('0x70')&&_0x376683[_0xbc25('0x32')]!==_0xbc25('0x71');});return{'count':_0x261b88[_0xbc25('0x3a')],'rows':_[_0xbc25('0x2f')](_0x261b88,function(_0x37eaf1){return{'id':_0x37eaf1[_0xbc25('0x2c')],'name':_0x37eaf1[_0xbc25('0x72')],'custom':!_0x37eaf1[_0xbc25('0x73')],'options':_0x37eaf1[_0xbc25('0x74')]?_[_0xbc25('0x2f')](_0x37eaf1[_0xbc25('0x74')],function(_0x57bff9){return{'name':_[_0xbc25('0x75')](_0x57bff9),'value':_0x57bff9};}):[]};})};}})[_0xbc25('0x19')](respondWithResult(_0x43fa0c,null))[_0xbc25('0x49')](function(_0x5b9c33){var _0x3f15b6=_0x598943[_0xbc25('0x35')][_0xbc25('0x17')]?0x1f4:_0x5b9c33[_0xbc25('0x76')]||0x1f4;logger['error'](_0xbc25('0x77'),_0xbc25('0x78'),_0x3f15b6,JSON[_0xbc25('0x79')](_0x5b9c33));delete _0x5b9c33['name'];if(_0x3f15b6===0x191){_0x3f15b6=0x190;}_0x43fa0c[_0xbc25('0x23')](_0x3f15b6)[_0xbc25('0x2d')](_0x598943[_0xbc25('0x35')][_0xbc25('0x17')]?{'message':_0xbc25('0x7a'),'statusCode':_0x5b9c33[_0xbc25('0x76')]}:_0x5b9c33);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index caba5cd..c8fe1c2 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 _0x4cfb=['FreshdeskAccount','int_freshdesk_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./intFreshdeskAccount.attributes','exports','define'];(function(_0x1de154,_0x1f23ec){var _0x16f75c=function(_0x5245a1){while(--_0x5245a1){_0x1de154['push'](_0x1de154['shift']());}};_0x16f75c(++_0x1f23ec);}(_0x4cfb,0x84));var _0xb4cf=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4cfb[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xb4cf('0x0'));var util=require(_0xb4cf('0x1'));var logger=require(_0xb4cf('0x2'))(_0xb4cf('0x3'));var moment=require(_0xb4cf('0x4'));var BPromise=require(_0xb4cf('0x5'));var rp=require(_0xb4cf('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb4cf('0x7'));var attributes=require(_0xb4cf('0x8'));var integrations=require('../../components/integrations/configuration');module[_0xb4cf('0x9')]=function(_0x5ec73a,_0x1dc733){return _0x5ec73a[_0xb4cf('0xa')](_0xb4cf('0xb'),attributes,{'tableName':_0xb4cf('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4f9c=['FreshdeskAccount','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4f9c,0x6d));var _0xc4f9=function(_0x1098db,_0x39ba6b){_0x1098db=_0x1098db-0x0;var _0x14f090=_0x4f9c[_0x1098db];return _0x14f090;};'use strict';var _=require(_0xc4f9('0x0'));var util=require(_0xc4f9('0x1'));var logger=require(_0xc4f9('0x2'))(_0xc4f9('0x3'));var moment=require(_0xc4f9('0x4'));var BPromise=require(_0xc4f9('0x5'));var rp=require(_0xc4f9('0x6'));var fs=require('fs');var path=require(_0xc4f9('0x7'));var rimraf=require(_0xc4f9('0x8'));var config=require(_0xc4f9('0x9'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0xc4f9('0xa')]=function(_0x57960e,_0x3077bd){return _0x57960e['define'](_0xc4f9('0xb'),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 c752e8f..229442f 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 _0x63c7=['GetFreshdeskAccount','catch','find','ShowFreshdeskAccount','lodash','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','FreshdeskAccount,\x20%s,\x20%s','message','result','FreshdeskAccount','findAll','options','raw','where','limit','include','map','model','attributes'];(function(_0x4252bc,_0x5dad76){var _0x2ab40f=function(_0x5743c8){while(--_0x5743c8){_0x4252bc['push'](_0x4252bc['shift']());}};_0x2ab40f(++_0x5dad76);}(_0x63c7,0x1d2));var _0x763c=function(_0x2372d9,_0x1e6093){_0x2372d9=_0x2372d9-0x0;var _0x2ad40c=_0x63c7[_0x2372d9];return _0x2ad40c;};'use strict';var _=require(_0x763c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x763c('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x763c('0x2'))(_0x763c('0x3'));var config=require(_0x763c('0x4'));var jayson=require(_0x763c('0x5'));var client=jayson[_0x763c('0x6')][_0x763c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2e78c9,_0x5b2d7c,_0x41081c){return new BPromise(function(_0x16f21f,_0x19037e){return client[_0x763c('0x8')](_0x2e78c9,_0x41081c)[_0x763c('0x9')](function(_0x461cba){logger[_0x763c('0xa')]('FreshdeskAccount,\x20%s,\x20%s',_0x5b2d7c,_0x763c('0xb'));logger[_0x763c('0xc')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x5b2d7c,_0x763c('0xb'),JSON[_0x763c('0xd')](_0x461cba));if(_0x461cba[_0x763c('0xe')]){if(_0x461cba['error'][_0x763c('0xf')]===0x1f4){logger[_0x763c('0xe')](_0x763c('0x10'),_0x5b2d7c,_0x461cba[_0x763c('0xe')]['message']);return _0x19037e(_0x461cba[_0x763c('0xe')][_0x763c('0x11')]);}logger[_0x763c('0xe')](_0x763c('0x10'),_0x5b2d7c,_0x461cba[_0x763c('0xe')][_0x763c('0x11')]);return _0x16f21f(_0x461cba[_0x763c('0xe')][_0x763c('0x11')]);}else{logger[_0x763c('0xa')](_0x763c('0x10'),_0x5b2d7c,'request\x20sent');_0x16f21f(_0x461cba[_0x763c('0x12')][_0x763c('0x11')]);}})['catch'](function(_0xfaf069){logger[_0x763c('0xe')](_0x763c('0x10'),_0x5b2d7c,_0xfaf069);_0x19037e(_0xfaf069);});});}exports['GetFreshdeskAccount']=function(_0x526fff){var _0x4593b3=this;return new Promise(function(_0x29116e,_0x2992a2){return db[_0x763c('0x13')][_0x763c('0x14')]({'raw':_0x526fff[_0x763c('0x15')]?_0x526fff[_0x763c('0x15')][_0x763c('0x16')]===undefined?!![]:![]:!![],'where':_0x526fff[_0x763c('0x15')]?_0x526fff[_0x763c('0x15')][_0x763c('0x17')]||null:null,'attributes':_0x526fff[_0x763c('0x15')]?_0x526fff['options']['attributes']||null:null,'limit':_0x526fff[_0x763c('0x15')]?_0x526fff['options'][_0x763c('0x18')]||null:null,'include':_0x526fff['options']?_0x526fff[_0x763c('0x15')][_0x763c('0x19')]?_[_0x763c('0x1a')](_0x526fff[_0x763c('0x15')][_0x763c('0x19')],function(_0x228a96){return{'model':db[_0x228a96[_0x763c('0x1b')]],'as':_0x228a96['as'],'attributes':_0x228a96['attributes'],'include':_0x228a96[_0x763c('0x19')]?_[_0x763c('0x1a')](_0x228a96[_0x763c('0x19')],function(_0x5a34f7){return{'model':db[_0x5a34f7[_0x763c('0x1b')]],'as':_0x5a34f7['as'],'attributes':_0x5a34f7['attributes'],'include':_0x5a34f7['include']?_['map'](_0x5a34f7[_0x763c('0x19')],function(_0x18f997){return{'model':db[_0x18f997['model']],'as':_0x18f997['as'],'attributes':_0x18f997[_0x763c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x763c('0x9')](function(_0x1d9214){logger[_0x763c('0xa')](_0x763c('0x1d'),_0x526fff);logger[_0x763c('0xc')](_0x763c('0x1d'),_0x526fff,JSON[_0x763c('0xd')](_0x1d9214));_0x29116e(_0x1d9214);})[_0x763c('0x1e')](function(_0x28714c){logger[_0x763c('0xe')](_0x763c('0x1d'),_0x28714c[_0x763c('0x11')],_0x526fff);_0x2992a2(_0x4593b3[_0x763c('0xe')](0x1f4,_0x28714c['message']));});});};exports['ShowFreshdeskAccount']=function(_0x22bc06){var _0x33236f=this;return new Promise(function(_0x559d94,_0x3766fa){return db[_0x763c('0x13')][_0x763c('0x1f')]({'raw':_0x22bc06[_0x763c('0x15')]?_0x22bc06[_0x763c('0x15')][_0x763c('0x16')]===undefined?!![]:![]:!![],'where':_0x22bc06[_0x763c('0x15')]?_0x22bc06[_0x763c('0x15')][_0x763c('0x17')]||null:null,'attributes':_0x22bc06['options']?_0x22bc06[_0x763c('0x15')][_0x763c('0x1c')]||null:null,'include':_0x22bc06[_0x763c('0x15')]?_0x22bc06['options'][_0x763c('0x19')]?_[_0x763c('0x1a')](_0x22bc06[_0x763c('0x15')][_0x763c('0x19')],function(_0x20b5aa){return{'model':db[_0x20b5aa['model']],'as':_0x20b5aa['as'],'attributes':_0x20b5aa['attributes'],'include':_0x20b5aa[_0x763c('0x19')]?_['map'](_0x20b5aa['include'],function(_0x1b1184){return{'model':db[_0x1b1184[_0x763c('0x1b')]],'as':_0x1b1184['as'],'attributes':_0x1b1184[_0x763c('0x1c')],'include':_0x1b1184[_0x763c('0x19')]?_[_0x763c('0x1a')](_0x1b1184[_0x763c('0x19')],function(_0x4af8da){return{'model':db[_0x4af8da[_0x763c('0x1b')]],'as':_0x4af8da['as'],'attributes':_0x4af8da['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x41e149){logger[_0x763c('0xa')](_0x763c('0x20'),_0x22bc06);logger[_0x763c('0xc')](_0x763c('0x20'),_0x22bc06,JSON[_0x763c('0xd')](_0x41e149));_0x559d94(_0x41e149);})['catch'](function(_0x1e925d){logger[_0x763c('0xe')](_0x763c('0x20'),_0x1e925d[_0x763c('0x11')],_0x22bc06);_0x3766fa(_0x33236f['error'](0x1f4,_0x1e925d['message']));});});}; \ No newline at end of file +var _0x9972=['bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','request\x20sent','FreshdeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','FreshdeskAccount,\x20%s,\x20%s','info','result','catch','GetFreshdeskAccount','findAll','options','raw','where','attributes','include','map','model','debug','ShowFreshdeskAccount','FreshdeskAccount','find','then','stringify','util','moment'];(function(_0x236703,_0x14bea1){var _0x24d041=function(_0x4b4d6c){while(--_0x4b4d6c){_0x236703['push'](_0x236703['shift']());}};_0x24d041(++_0x14bea1);}(_0x9972,0xd0));var _0x2997=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9972[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x2997('0x0'));var moment=require(_0x2997('0x1'));var BPromise=require(_0x2997('0x2'));var rs=require(_0x2997('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2997('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2997('0x5'))(_0x2997('0x6'));var config=require(_0x2997('0x7'));var jayson=require(_0x2997('0x8'));var client=jayson['client'][_0x2997('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3dc592,_0x39ca2a,_0x58d091){return new BPromise(function(_0xef47e2,_0x3daf07){return client[_0x2997('0xa')](_0x3dc592,_0x58d091)['then'](function(_0xd3e39f){logger['info']('FreshdeskAccount,\x20%s,\x20%s',_0x39ca2a,_0x2997('0xb'));logger['debug'](_0x2997('0xc'),_0x39ca2a,'request\x20sent',JSON['stringify'](_0xd3e39f));if(_0xd3e39f[_0x2997('0xd')]){if(_0xd3e39f[_0x2997('0xd')][_0x2997('0xe')]===0x1f4){logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0x39ca2a,_0xd3e39f['error'][_0x2997('0xf')]);return _0x3daf07(_0xd3e39f[_0x2997('0xd')][_0x2997('0xf')]);}logger[_0x2997('0xd')](_0x2997('0x10'),_0x39ca2a,_0xd3e39f[_0x2997('0xd')][_0x2997('0xf')]);return _0xef47e2(_0xd3e39f[_0x2997('0xd')]['message']);}else{logger[_0x2997('0x11')](_0x2997('0x10'),_0x39ca2a,_0x2997('0xb'));_0xef47e2(_0xd3e39f[_0x2997('0x12')]['message']);}})[_0x2997('0x13')](function(_0x24a4ad){logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0x39ca2a,_0x24a4ad);_0x3daf07(_0x24a4ad);});});}exports[_0x2997('0x14')]=function(_0x22e75e){var _0x5149fa=this;return new Promise(function(_0x5463f0,_0x3ef382){return db['FreshdeskAccount'][_0x2997('0x15')]({'raw':_0x22e75e[_0x2997('0x16')]?_0x22e75e[_0x2997('0x16')][_0x2997('0x17')]===undefined?!![]:![]:!![],'where':_0x22e75e[_0x2997('0x16')]?_0x22e75e[_0x2997('0x16')][_0x2997('0x18')]||null:null,'attributes':_0x22e75e[_0x2997('0x16')]?_0x22e75e[_0x2997('0x16')][_0x2997('0x19')]||null:null,'limit':_0x22e75e[_0x2997('0x16')]?_0x22e75e[_0x2997('0x16')]['limit']||null:null,'include':_0x22e75e['options']?_0x22e75e[_0x2997('0x16')][_0x2997('0x1a')]?_[_0x2997('0x1b')](_0x22e75e[_0x2997('0x16')]['include'],function(_0x36df9f){return{'model':db[_0x36df9f[_0x2997('0x1c')]],'as':_0x36df9f['as'],'attributes':_0x36df9f['attributes'],'include':_0x36df9f[_0x2997('0x1a')]?_[_0x2997('0x1b')](_0x36df9f[_0x2997('0x1a')],function(_0x5e51a9){return{'model':db[_0x5e51a9[_0x2997('0x1c')]],'as':_0x5e51a9['as'],'attributes':_0x5e51a9[_0x2997('0x19')],'include':_0x5e51a9[_0x2997('0x1a')]?_[_0x2997('0x1b')](_0x5e51a9[_0x2997('0x1a')],function(_0x521396){return{'model':db[_0x521396[_0x2997('0x1c')]],'as':_0x521396['as'],'attributes':_0x521396[_0x2997('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x356f37){logger[_0x2997('0x11')](_0x2997('0x14'),_0x22e75e);logger[_0x2997('0x1d')]('GetFreshdeskAccount',_0x22e75e,JSON['stringify'](_0x356f37));_0x5463f0(_0x356f37);})[_0x2997('0x13')](function(_0x368b39){logger[_0x2997('0xd')](_0x2997('0x14'),_0x368b39[_0x2997('0xf')],_0x22e75e);_0x3ef382(_0x5149fa[_0x2997('0xd')](0x1f4,_0x368b39[_0x2997('0xf')]));});});};exports[_0x2997('0x1e')]=function(_0x49bd38){var _0x98bb87=this;return new Promise(function(_0x5cba02,_0x40c1df){return db[_0x2997('0x1f')][_0x2997('0x20')]({'raw':_0x49bd38[_0x2997('0x16')]?_0x49bd38[_0x2997('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x49bd38[_0x2997('0x16')]?_0x49bd38['options'][_0x2997('0x18')]||null:null,'attributes':_0x49bd38[_0x2997('0x16')]?_0x49bd38['options'][_0x2997('0x19')]||null:null,'include':_0x49bd38['options']?_0x49bd38[_0x2997('0x16')][_0x2997('0x1a')]?_[_0x2997('0x1b')](_0x49bd38[_0x2997('0x16')][_0x2997('0x1a')],function(_0x4c7a12){return{'model':db[_0x4c7a12['model']],'as':_0x4c7a12['as'],'attributes':_0x4c7a12[_0x2997('0x19')],'include':_0x4c7a12[_0x2997('0x1a')]?_['map'](_0x4c7a12['include'],function(_0x4b322b){return{'model':db[_0x4b322b['model']],'as':_0x4b322b['as'],'attributes':_0x4b322b[_0x2997('0x19')],'include':_0x4b322b[_0x2997('0x1a')]?_[_0x2997('0x1b')](_0x4b322b[_0x2997('0x1a')],function(_0x106c76){return{'model':db[_0x106c76[_0x2997('0x1c')]],'as':_0x106c76['as'],'attributes':_0x106c76[_0x2997('0x19')]};}):[]};}):[]};}):[]:[]})[_0x2997('0x21')](function(_0x4fcc1b){logger[_0x2997('0x11')](_0x2997('0x1e'),_0x49bd38);logger[_0x2997('0x1d')](_0x2997('0x1e'),_0x49bd38,JSON[_0x2997('0x22')](_0x4fcc1b));_0x5cba02(_0x4fcc1b);})[_0x2997('0x13')](function(_0x338391){logger[_0x2997('0xd')](_0x2997('0x1e'),_0x338391[_0x2997('0xf')],_0x49bd38);_0x40c1df(_0x98bb87['error'](0x1f4,_0x338391[_0x2997('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 37803d2..b237778 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 _0x20f3=['put','update','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','get','/:id','isAuthenticated','show','getSubjects','/:id/descriptions','/:id/tags','getTags','post','create'];(function(_0x5a8720,_0x964ae4){var _0xf1485e=function(_0x440636){while(--_0x440636){_0x5a8720['push'](_0x5a8720['shift']());}};_0xf1485e(++_0x964ae4);}(_0x20f3,0x12b));var _0x320f=function(_0x3b76f7,_0x566c53){_0x3b76f7=_0x3b76f7-0x0;var _0x43984e=_0x20f3[_0x3b76f7];return _0x43984e;};'use strict';var multer=require(_0x320f('0x0'));var util=require('util');var path=require(_0x320f('0x1'));var timeout=require('connect-timeout');var express=require(_0x320f('0x2'));var router=express[_0x320f('0x3')]();var auth=require(_0x320f('0x4'));var interaction=require(_0x320f('0x5'));var config=require('../../config/environment');var controller=require('./intFreshdeskConfiguration.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x320f('0x6')](_0x320f('0x7'),auth[_0x320f('0x8')](),controller[_0x320f('0x9')]);router[_0x320f('0x6')]('/:id/fields',auth[_0x320f('0x8')](),controller['getFields']);router[_0x320f('0x6')]('/:id/subjects',auth[_0x320f('0x8')](),controller[_0x320f('0xa')]);router[_0x320f('0x6')](_0x320f('0xb'),auth[_0x320f('0x8')](),controller['getDescriptions']);router[_0x320f('0x6')](_0x320f('0xc'),auth['isAuthenticated'](),controller[_0x320f('0xd')]);router[_0x320f('0xe')]('/',auth[_0x320f('0x8')](),controller[_0x320f('0xf')]);router['post'](_0x320f('0xc'),auth[_0x320f('0x8')](),controller['setTags']);router[_0x320f('0x10')](_0x320f('0x7'),auth[_0x320f('0x8')](),controller[_0x320f('0x11')]);router[_0x320f('0x12')](_0x320f('0x7'),auth[_0x320f('0x8')](),controller[_0x320f('0x13')]);module[_0x320f('0x14')]=router; \ No newline at end of file +var _0x6cd5=['setTags','put','/:id','update','delete','destroy','multer','util','connect-timeout','express','Router','../../components/interaction/service','get','index','isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','getTags','post','create'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x6cd5,0x1a8));var _0x56cd=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6cd5[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x56cd('0x0'));var util=require(_0x56cd('0x1'));var path=require('path');var timeout=require(_0x56cd('0x2'));var express=require(_0x56cd('0x3'));var router=express[_0x56cd('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x56cd('0x5'));var config=require('../../config/environment');var controller=require('./intFreshdeskConfiguration.controller');router[_0x56cd('0x6')]('/',auth['isAuthenticated'](),controller[_0x56cd('0x7')]);router[_0x56cd('0x6')]('/:id',auth[_0x56cd('0x8')](),controller['show']);router[_0x56cd('0x6')]('/:id/fields',auth[_0x56cd('0x8')](),controller[_0x56cd('0x9')]);router[_0x56cd('0x6')](_0x56cd('0xa'),auth[_0x56cd('0x8')](),controller[_0x56cd('0xb')]);router[_0x56cd('0x6')](_0x56cd('0xc'),auth['isAuthenticated'](),controller['getDescriptions']);router['get']('/:id/tags',auth['isAuthenticated'](),controller[_0x56cd('0xd')]);router[_0x56cd('0xe')]('/',auth['isAuthenticated'](),controller[_0x56cd('0xf')]);router[_0x56cd('0xe')]('/:id/tags',auth[_0x56cd('0x8')](),controller[_0x56cd('0x10')]);router[_0x56cd('0x11')](_0x56cd('0x12'),auth['isAuthenticated'](),controller[_0x56cd('0x13')]);router[_0x56cd('0x14')](_0x56cd('0x12'),auth[_0x56cd('0x8')](),controller[_0x56cd('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index cbefffa..ad0cce3 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 _0xdb11=['exports','sequelize'];(function(_0x4bb04f,_0x302a8f){var _0x434d5c=function(_0x103eca){while(--_0x103eca){_0x4bb04f['push'](_0x4bb04f['shift']());}};_0x434d5c(++_0x302a8f);}(_0xdb11,0x187));var _0x1db1=function(_0x576170,_0x1712ae){_0x576170=_0x576170-0x0;var _0x397c70=_0xdb11[_0x576170];return _0x397c70;};'use strict';var Sequelize=require(_0x1db1('0x0'));module[_0x1db1('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xbfb2=['exports','STRING','sequelize'];(function(_0x5deab0,_0x59f8e6){var _0x381b5a=function(_0x89ed){while(--_0x89ed){_0x5deab0['push'](_0x5deab0['shift']());}};_0x381b5a(++_0x59f8e6);}(_0xbfb2,0x1f1));var _0x2bfb=function(_0x2eae07,_0x12a7db){_0x2eae07=_0x2eae07-0x0;var _0x5ba7ba=_0xbfb2[_0x2eae07];return _0x5ba7ba;};'use strict';var Sequelize=require(_0x2bfb('0x0'));module[_0x2bfb('0x1')]={'name':{'type':Sequelize[_0x2bfb('0x2')]},'description':{'type':Sequelize[_0x2bfb('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 5ad3935..4ea697f 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 _0x1c73=['key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','field','options','include','findAll','params','FreshdeskConfiguration','includeAll','find','catch','create','body','FreshdeskField','pick','getFields','getSubjects','findOne','getDescriptions','Tag','setTags','html-pdf','eml-format','rimraf','fast-json-patch','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','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','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','end','status','json','count','offset','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type'];(function(_0x21cc45,_0x22eff2){var _0x169c76=function(_0x540230){while(--_0x540230){_0x21cc45['push'](_0x21cc45['shift']());}};_0x169c76(++_0x22eff2);}(_0x1c73,0x194));var _0x31c7=function(_0x720fc1,_0x1e232f){_0x720fc1=_0x720fc1-0x0;var _0x3ea41d=_0x1c73[_0x720fc1];return _0x3ea41d;};'use strict';var pdf=require(_0x31c7('0x0'));var emlformat=require(_0x31c7('0x1'));var rimraf=require(_0x31c7('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x31c7('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x31c7('0x4'));var Mustache=require(_0x31c7('0x5'));var util=require('util');var path=require(_0x31c7('0x6'));var sox=require(_0x31c7('0x7'));var csv=require(_0x31c7('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x31c7('0x9'));var squel=require(_0x31c7('0xa'));var crypto=require(_0x31c7('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x31c7('0x8'));var querystring=require(_0x31c7('0xc'));var Papa=require(_0x31c7('0xd'));var Redis=require('ioredis');var authService=require(_0x31c7('0xe'));var qs=require(_0x31c7('0xf'));var as=require(_0x31c7('0x10'));var hardwareService=require(_0x31c7('0x11'));var logger=require('../../config/logger')(_0x31c7('0x12'));var utils=require('../../config/utils');var config=require(_0x31c7('0x13'));var db=require(_0x31c7('0x14'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0x31c7('0x15')]({'port':0x232a});function checkPasswordPattern(_0xe94826,_0x4275c9,_0x2c5079){if(_0x2c5079){var _0x1e702d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1e702d[_0x31c7('0x16')](_0x4275c9)){return _0xe94826;}else{throw new Error(_0x31c7('0x17'));}}else{return _0xe94826;}}function respondWithRpcPromise(_0x16301b,_0x1468fa,_0x362f82,_0x25a35b){return new BPromise(function(_0x45c089,_0x112ff7){var _0x1e994b=_0x25a35b||client;return _0x1e994b[_0x31c7('0x18')](_0x16301b,_0x362f82)[_0x31c7('0x19')](function(_0x1e39dd){logger[_0x31c7('0x1a')](_0x31c7('0x1b'),_0x1468fa,_0x31c7('0x1c'));logger[_0x31c7('0x1d')](_0x31c7('0x1e'),_0x1468fa,_0x31c7('0x1c'),JSON[_0x31c7('0x1f')](_0x1e39dd));if(_0x1e39dd[_0x31c7('0x20')]){if(_0x1e39dd[_0x31c7('0x20')][_0x31c7('0x21')]===0x1f4){logger[_0x31c7('0x20')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x1468fa,_0x1e39dd[_0x31c7('0x20')][_0x31c7('0x22')]);return _0x112ff7(_0x1e39dd[_0x31c7('0x20')][_0x31c7('0x22')]);}logger[_0x31c7('0x20')](_0x31c7('0x1b'),_0x1468fa,_0x1e39dd['error'][_0x31c7('0x22')]);return _0x45c089(_0x1e39dd['error'][_0x31c7('0x22')]);}else{logger[_0x31c7('0x1a')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x1468fa,_0x31c7('0x1c'));_0x45c089(_0x1e39dd[_0x31c7('0x23')][_0x31c7('0x22')]);}})['catch'](function(_0x5c56a1){logger['error'](_0x31c7('0x1b'),_0x1468fa,_0x5c56a1);_0x112ff7(_0x5c56a1);});});}function respondWithStatusCode(_0x4ecb21,_0x2c202c){_0x2c202c=_0x2c202c||0xcc;return function(_0x1f8f39){if(_0x1f8f39){return _0x4ecb21['sendStatus'](_0x2c202c);}return _0x4ecb21['status'](_0x2c202c)[_0x31c7('0x24')]();};}function respondWithResult(_0x5a6b9a,_0x124f9b){_0x124f9b=_0x124f9b||0xc8;return function(_0x4eef6a){if(_0x4eef6a){return _0x5a6b9a[_0x31c7('0x25')](_0x124f9b)[_0x31c7('0x26')](_0x4eef6a);}};}function respondWithFilteredResult(_0x53ec52,_0x43a32d){return function(_0x349a9d){if(_0x349a9d){var _0x5f134a=_0x349a9d[_0x31c7('0x27')],_0x21ee27=_0x43a32d['offset'],_0x94dca7=_0x43a32d[_0x31c7('0x28')]+_0x43a32d['limit'],_0x480852;if(_0x94dca7>=_0x5f134a){_0x94dca7=_0x5f134a;_0x480852=0xc8;}else{_0x480852=0xce;}_0x53ec52[_0x31c7('0x25')](_0x480852);return _0x53ec52['set'](_0x31c7('0x29'),_0x21ee27+'-'+_0x94dca7+'/'+_0x5f134a)['json'](_0x349a9d);}return null;};}function patchUpdates(_0x5cdd6c){return function(_0x59cfe5){try{jsonpatch[_0x31c7('0x2a')](_0x59cfe5,_0x5cdd6c,!![]);}catch(_0x4a4d31){return BPromise[_0x31c7('0x2b')](_0x4a4d31);}return _0x59cfe5[_0x31c7('0x2c')]();};}function saveUpdates(_0x511528,_0x31c80d){return function(_0x2bda40){if(_0x2bda40){return _0x2bda40[_0x31c7('0x2d')](_0x511528)[_0x31c7('0x19')](function(_0x45b372){return _0x45b372;});}return null;};}function removeEntity(_0x34c59a,_0x493d38){return function(_0x5f164a){if(_0x5f164a){return _0x5f164a[_0x31c7('0x2e')]()[_0x31c7('0x19')](function(){_0x34c59a[_0x31c7('0x25')](0xcc)[_0x31c7('0x24')]();});}};}function handleEntityNotFound(_0x31e2b6,_0x1cc74a){return function(_0x440464){if(!_0x440464){_0x31e2b6[_0x31c7('0x2f')](0x194);}return _0x440464;};}function handleError(_0x39e592,_0x17ef90){_0x17ef90=_0x17ef90||0x1f4;return function(_0x3cb219){logger['error'](_0x3cb219[_0x31c7('0x30')]);if(_0x3cb219[_0x31c7('0x31')]){delete _0x3cb219[_0x31c7('0x31')];}_0x39e592[_0x31c7('0x25')](_0x17ef90)[_0x31c7('0x32')](_0x3cb219);};}exports[_0x31c7('0x33')]=function(_0x1fb2a5,_0x2b5dee){var _0x27162c={},_0x4777c1={},_0x53ceeb={'count':0x0,'rows':[]};var _0x5d2fd3=_[_0x31c7('0x34')](db['FreshdeskConfiguration'][_0x31c7('0x35')],function(_0xc64fa3){return{'name':_0xc64fa3[_0x31c7('0x36')],'type':_0xc64fa3[_0x31c7('0x37')][_0x31c7('0x38')]};});_0x4777c1[_0x31c7('0x39')]=_[_0x31c7('0x34')](_0x5d2fd3,'name');_0x4777c1[_0x31c7('0x3a')]=_[_0x31c7('0x3b')](_0x1fb2a5['query']);_0x4777c1[_0x31c7('0x3c')]=_['intersection'](_0x4777c1[_0x31c7('0x39')],_0x4777c1['query']);_0x27162c[_0x31c7('0x3d')]=_[_0x31c7('0x3e')](_0x4777c1[_0x31c7('0x39')],qs[_0x31c7('0x3f')](_0x1fb2a5['query'][_0x31c7('0x3f')]));_0x27162c[_0x31c7('0x3d')]=_0x27162c[_0x31c7('0x3d')][_0x31c7('0x40')]?_0x27162c[_0x31c7('0x3d')]:_0x4777c1[_0x31c7('0x39')];if(!_0x1fb2a5[_0x31c7('0x3a')][_0x31c7('0x41')](_0x31c7('0x42'))){_0x27162c[_0x31c7('0x43')]=qs['limit'](_0x1fb2a5['query'][_0x31c7('0x43')]);_0x27162c[_0x31c7('0x28')]=qs['offset'](_0x1fb2a5[_0x31c7('0x3a')]['offset']);}_0x27162c[_0x31c7('0x44')]=qs[_0x31c7('0x45')](_0x1fb2a5['query'][_0x31c7('0x45')]);_0x27162c[_0x31c7('0x46')]=qs[_0x31c7('0x3c')](_['pick'](_0x1fb2a5[_0x31c7('0x3a')],_0x4777c1['filters']));if(_0x1fb2a5[_0x31c7('0x3a')][_0x31c7('0x47')]){_0x27162c['where']=_[_0x31c7('0x48')](_0x27162c[_0x31c7('0x46')],{'$or':_[_0x31c7('0x34')](_0x5d2fd3,function(_0x8a309a){if(_0x8a309a[_0x31c7('0x37')][_0x31c7('0x38')]!=='VIRTUAL'){var _0xc73d2e={};_0xc73d2e[_0x8a309a[_0x31c7('0x49')]]={'$like':'%'+_0x1fb2a5['query'][_0x31c7('0x47')]+'%'};return _0xc73d2e;}})});}_0x27162c=_['merge']({},_0x27162c,_0x1fb2a5[_0x31c7('0x4a')]);var _0x146f4d={'where':_0x27162c[_0x31c7('0x46')]};return db['FreshdeskConfiguration'][_0x31c7('0x27')](_0x146f4d)['then'](function(_0x34ada1){_0x53ceeb[_0x31c7('0x27')]=_0x34ada1;if(_0x1fb2a5[_0x31c7('0x3a')]['includeAll']){_0x27162c[_0x31c7('0x4b')]=[{'all':!![]}];}return db['FreshdeskConfiguration'][_0x31c7('0x4c')](_0x27162c);})[_0x31c7('0x19')](function(_0x250a97){_0x53ceeb['rows']=_0x250a97;return _0x53ceeb;})[_0x31c7('0x19')](respondWithFilteredResult(_0x2b5dee,_0x27162c))['catch'](handleError(_0x2b5dee,null));};exports['show']=function(_0x51a653,_0x54c394){var _0x75d886={'raw':![],'where':{'id':_0x51a653[_0x31c7('0x4d')]['id']}},_0x3585b7={};_0x3585b7['model']=_[_0x31c7('0x3b')](db[_0x31c7('0x4e')][_0x31c7('0x35')]);_0x3585b7[_0x31c7('0x3a')]=_[_0x31c7('0x3b')](_0x51a653[_0x31c7('0x3a')]);_0x3585b7[_0x31c7('0x3c')]=_[_0x31c7('0x3e')](_0x3585b7['model'],_0x3585b7['query']);_0x75d886[_0x31c7('0x3d')]=_[_0x31c7('0x3e')](_0x3585b7[_0x31c7('0x39')],qs[_0x31c7('0x3f')](_0x51a653[_0x31c7('0x3a')]['fields']));_0x75d886[_0x31c7('0x3d')]=_0x75d886[_0x31c7('0x3d')][_0x31c7('0x40')]?_0x75d886[_0x31c7('0x3d')]:_0x3585b7[_0x31c7('0x39')];if(_0x51a653['query'][_0x31c7('0x4f')]){_0x75d886[_0x31c7('0x4b')]=[{'all':!![]}];}_0x75d886=_[_0x31c7('0x48')]({},_0x75d886,_0x51a653[_0x31c7('0x4a')]);return db[_0x31c7('0x4e')][_0x31c7('0x50')](_0x75d886)[_0x31c7('0x19')](handleEntityNotFound(_0x54c394,null))[_0x31c7('0x19')](respondWithResult(_0x54c394,null))[_0x31c7('0x51')](handleError(_0x54c394,null));};exports[_0x31c7('0x52')]=function(_0x6d89b4,_0x40041c){return db[_0x31c7('0x4e')][_0x31c7('0x52')](_0x6d89b4[_0x31c7('0x53')],{})[_0x31c7('0x19')](respondWithResult(_0x40041c,0xc9))['catch'](handleError(_0x40041c,null));};exports[_0x31c7('0x2d')]=function(_0xa68545,_0x1f24ff){if(_0xa68545[_0x31c7('0x53')]['id']){delete _0xa68545[_0x31c7('0x53')]['id'];}return db[_0x31c7('0x4e')][_0x31c7('0x50')]({'where':{'id':_0xa68545[_0x31c7('0x4d')]['id']}})[_0x31c7('0x19')](handleEntityNotFound(_0x1f24ff,null))['then'](saveUpdates(_0xa68545[_0x31c7('0x53')],null))['then'](respondWithResult(_0x1f24ff,null))[_0x31c7('0x51')](handleError(_0x1f24ff,null));};exports[_0x31c7('0x2e')]=function(_0x347d54,_0x3da296){return db['FreshdeskConfiguration']['find']({'where':{'id':_0x347d54[_0x31c7('0x4d')]['id']}})[_0x31c7('0x19')](handleEntityNotFound(_0x3da296,null))['then'](removeEntity(_0x3da296,null))[_0x31c7('0x51')](handleError(_0x3da296,null));};exports['getFields']=function(_0x269607,_0x138405,_0x1c9b73){var _0x520477={};var _0x387c4e={};var _0x2a298d;var _0x2adc2e;return db[_0x31c7('0x4e')]['findOne']({'where':{'id':_0x269607[_0x31c7('0x4d')]['id']}})[_0x31c7('0x19')](handleEntityNotFound(_0x138405,null))[_0x31c7('0x19')](function(_0x5524cc){if(_0x5524cc){_0x2a298d=_0x5524cc;_0x387c4e[_0x31c7('0x39')]=_[_0x31c7('0x3b')](db[_0x31c7('0x54')]['rawAttributes']);_0x387c4e[_0x31c7('0x3a')]=_[_0x31c7('0x3b')](_0x269607[_0x31c7('0x3a')]);_0x387c4e[_0x31c7('0x3c')]=_[_0x31c7('0x3e')](_0x387c4e[_0x31c7('0x39')],_0x387c4e[_0x31c7('0x3a')]);_0x520477[_0x31c7('0x3d')]=_[_0x31c7('0x3e')](_0x387c4e['model'],qs[_0x31c7('0x3f')](_0x269607[_0x31c7('0x3a')][_0x31c7('0x3f')]));_0x520477['attributes']=_0x520477[_0x31c7('0x3d')][_0x31c7('0x40')]?_0x520477[_0x31c7('0x3d')]:_0x387c4e[_0x31c7('0x39')];_0x520477[_0x31c7('0x44')]=qs[_0x31c7('0x45')](_0x269607[_0x31c7('0x3a')]['sort']);_0x520477['where']=qs[_0x31c7('0x3c')](_[_0x31c7('0x55')](_0x269607[_0x31c7('0x3a')],_0x387c4e[_0x31c7('0x3c')]));if(_0x269607[_0x31c7('0x3a')][_0x31c7('0x47')]){_0x520477[_0x31c7('0x46')]=_[_0x31c7('0x48')](_0x520477[_0x31c7('0x46')],{'$or':_[_0x31c7('0x34')](_0x520477[_0x31c7('0x3d')],function(_0x2e9652){var _0x5dcc4b={};_0x5dcc4b[_0x2e9652]={'$like':'%'+_0x269607[_0x31c7('0x3a')]['filter']+'%'};return _0x5dcc4b;})});}_0x520477=_[_0x31c7('0x48')]({},_0x520477,_0x269607[_0x31c7('0x4a')]);return _0x2a298d['getFields'](_0x520477);}})[_0x31c7('0x19')](function(_0x35abae){if(_0x35abae){_0x2adc2e=_0x35abae[_0x31c7('0x40')];if(!_0x269607[_0x31c7('0x3a')][_0x31c7('0x41')](_0x31c7('0x42'))){_0x520477[_0x31c7('0x43')]=qs[_0x31c7('0x43')](_0x269607['query'][_0x31c7('0x43')]);_0x520477[_0x31c7('0x28')]=qs[_0x31c7('0x28')](_0x269607['query']['offset']);}return _0x2a298d[_0x31c7('0x56')](_0x520477);}})[_0x31c7('0x19')](function(_0x40070e){if(_0x40070e){return _0x40070e?{'count':_0x2adc2e,'rows':_0x40070e}:null;}})['then'](respondWithResult(_0x138405,null))[_0x31c7('0x51')](handleError(_0x138405,null));};exports[_0x31c7('0x57')]=function(_0x2e1e29,_0x10d956,_0x74cce7){var _0x53ba86={};var _0x1c2b15={};var _0xd8a192;var _0x3af4ff;return db[_0x31c7('0x4e')][_0x31c7('0x58')]({'where':{'id':_0x2e1e29['params']['id']}})['then'](handleEntityNotFound(_0x10d956,null))[_0x31c7('0x19')](function(_0x32ceb5){if(_0x32ceb5){_0xd8a192=_0x32ceb5;_0x1c2b15[_0x31c7('0x39')]=_[_0x31c7('0x3b')](db[_0x31c7('0x54')][_0x31c7('0x35')]);_0x1c2b15['query']=_[_0x31c7('0x3b')](_0x2e1e29[_0x31c7('0x3a')]);_0x1c2b15[_0x31c7('0x3c')]=_[_0x31c7('0x3e')](_0x1c2b15[_0x31c7('0x39')],_0x1c2b15[_0x31c7('0x3a')]);_0x53ba86[_0x31c7('0x3d')]=_['intersection'](_0x1c2b15[_0x31c7('0x39')],qs['fields'](_0x2e1e29[_0x31c7('0x3a')][_0x31c7('0x3f')]));_0x53ba86[_0x31c7('0x3d')]=_0x53ba86['attributes'][_0x31c7('0x40')]?_0x53ba86[_0x31c7('0x3d')]:_0x1c2b15[_0x31c7('0x39')];_0x53ba86[_0x31c7('0x44')]=qs[_0x31c7('0x45')](_0x2e1e29[_0x31c7('0x3a')][_0x31c7('0x45')]);_0x53ba86[_0x31c7('0x46')]=qs[_0x31c7('0x3c')](_[_0x31c7('0x55')](_0x2e1e29[_0x31c7('0x3a')],_0x1c2b15[_0x31c7('0x3c')]));if(_0x2e1e29['query'][_0x31c7('0x47')]){_0x53ba86[_0x31c7('0x46')]=_[_0x31c7('0x48')](_0x53ba86[_0x31c7('0x46')],{'$or':_[_0x31c7('0x34')](_0x53ba86[_0x31c7('0x3d')],function(_0x134b76){var _0x17539e={};_0x17539e[_0x134b76]={'$like':'%'+_0x2e1e29[_0x31c7('0x3a')][_0x31c7('0x47')]+'%'};return _0x17539e;})});}_0x53ba86=_[_0x31c7('0x48')]({},_0x53ba86,_0x2e1e29[_0x31c7('0x4a')]);return _0xd8a192[_0x31c7('0x57')](_0x53ba86);}})['then'](function(_0x1d2ca0){if(_0x1d2ca0){_0x3af4ff=_0x1d2ca0[_0x31c7('0x40')];if(!_0x2e1e29[_0x31c7('0x3a')][_0x31c7('0x41')](_0x31c7('0x42'))){_0x53ba86[_0x31c7('0x43')]=qs[_0x31c7('0x43')](_0x2e1e29['query'][_0x31c7('0x43')]);_0x53ba86[_0x31c7('0x28')]=qs[_0x31c7('0x28')](_0x2e1e29['query'][_0x31c7('0x28')]);}return _0xd8a192[_0x31c7('0x57')](_0x53ba86);}})['then'](function(_0x4494db){if(_0x4494db){return _0x4494db?{'count':_0x3af4ff,'rows':_0x4494db}:null;}})[_0x31c7('0x19')](respondWithResult(_0x10d956,null))[_0x31c7('0x51')](handleError(_0x10d956,null));};exports[_0x31c7('0x59')]=function(_0x1e841b,_0x7c7cf3,_0x211db0){var _0x12e559={};var _0x5e1b08={};var _0x2ca126;var _0x37839d;return db['FreshdeskConfiguration'][_0x31c7('0x58')]({'where':{'id':_0x1e841b['params']['id']}})[_0x31c7('0x19')](handleEntityNotFound(_0x7c7cf3,null))['then'](function(_0x29192b){if(_0x29192b){_0x2ca126=_0x29192b;_0x5e1b08[_0x31c7('0x39')]=_[_0x31c7('0x3b')](db[_0x31c7('0x54')][_0x31c7('0x35')]);_0x5e1b08[_0x31c7('0x3a')]=_[_0x31c7('0x3b')](_0x1e841b[_0x31c7('0x3a')]);_0x5e1b08[_0x31c7('0x3c')]=_['intersection'](_0x5e1b08[_0x31c7('0x39')],_0x5e1b08[_0x31c7('0x3a')]);_0x12e559[_0x31c7('0x3d')]=_[_0x31c7('0x3e')](_0x5e1b08[_0x31c7('0x39')],qs[_0x31c7('0x3f')](_0x1e841b['query'][_0x31c7('0x3f')]));_0x12e559[_0x31c7('0x3d')]=_0x12e559['attributes'][_0x31c7('0x40')]?_0x12e559[_0x31c7('0x3d')]:_0x5e1b08[_0x31c7('0x39')];_0x12e559[_0x31c7('0x44')]=qs[_0x31c7('0x45')](_0x1e841b['query'][_0x31c7('0x45')]);_0x12e559[_0x31c7('0x46')]=qs[_0x31c7('0x3c')](_[_0x31c7('0x55')](_0x1e841b['query'],_0x5e1b08[_0x31c7('0x3c')]));if(_0x1e841b[_0x31c7('0x3a')][_0x31c7('0x47')]){_0x12e559[_0x31c7('0x46')]=_[_0x31c7('0x48')](_0x12e559[_0x31c7('0x46')],{'$or':_['map'](_0x12e559[_0x31c7('0x3d')],function(_0x2265bd){var _0x3d3fb7={};_0x3d3fb7[_0x2265bd]={'$like':'%'+_0x1e841b[_0x31c7('0x3a')][_0x31c7('0x47')]+'%'};return _0x3d3fb7;})});}_0x12e559=_[_0x31c7('0x48')]({},_0x12e559,_0x1e841b[_0x31c7('0x4a')]);return _0x2ca126[_0x31c7('0x59')](_0x12e559);}})[_0x31c7('0x19')](function(_0x7a1dd2){if(_0x7a1dd2){_0x37839d=_0x7a1dd2[_0x31c7('0x40')];if(!_0x1e841b['query'][_0x31c7('0x41')](_0x31c7('0x42'))){_0x12e559[_0x31c7('0x43')]=qs[_0x31c7('0x43')](_0x1e841b[_0x31c7('0x3a')][_0x31c7('0x43')]);_0x12e559['offset']=qs[_0x31c7('0x28')](_0x1e841b['query']['offset']);}return _0x2ca126[_0x31c7('0x59')](_0x12e559);}})['then'](function(_0x104832){if(_0x104832){return _0x104832?{'count':_0x37839d,'rows':_0x104832}:null;}})[_0x31c7('0x19')](respondWithResult(_0x7c7cf3,null))[_0x31c7('0x51')](handleError(_0x7c7cf3,null));};exports['getTags']=function(_0x39bf40,_0x1cacf4,_0x433b5c){var _0x1c3c42={};var _0x4ee67b={};var _0xab383a;var _0xaacb90;return db[_0x31c7('0x4e')]['findOne']({'where':{'id':_0x39bf40[_0x31c7('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1cacf4,null))[_0x31c7('0x19')](function(_0x48809c){if(_0x48809c){_0xab383a=_0x48809c;_0x4ee67b[_0x31c7('0x39')]=_[_0x31c7('0x3b')](db[_0x31c7('0x5a')]['rawAttributes']);_0x4ee67b['query']=_['keys'](_0x39bf40['query']);_0x4ee67b['filters']=_['intersection'](_0x4ee67b['model'],_0x4ee67b['query']);_0x1c3c42['attributes']=_['intersection'](_0x4ee67b[_0x31c7('0x39')],qs[_0x31c7('0x3f')](_0x39bf40[_0x31c7('0x3a')][_0x31c7('0x3f')]));_0x1c3c42[_0x31c7('0x3d')]=_0x1c3c42[_0x31c7('0x3d')][_0x31c7('0x40')]?_0x1c3c42[_0x31c7('0x3d')]:_0x4ee67b[_0x31c7('0x39')];_0x1c3c42[_0x31c7('0x44')]=qs[_0x31c7('0x45')](_0x39bf40[_0x31c7('0x3a')][_0x31c7('0x45')]);_0x1c3c42[_0x31c7('0x46')]=qs[_0x31c7('0x3c')](_['pick'](_0x39bf40[_0x31c7('0x3a')],_0x4ee67b[_0x31c7('0x3c')]));if(_0x39bf40['query'][_0x31c7('0x47')]){_0x1c3c42['where']=_['merge'](_0x1c3c42[_0x31c7('0x46')],{'$or':_['map'](_0x1c3c42[_0x31c7('0x3d')],function(_0x23d98c){var _0x44bad4={};_0x44bad4[_0x23d98c]={'$like':'%'+_0x39bf40[_0x31c7('0x3a')]['filter']+'%'};return _0x44bad4;})});}_0x1c3c42=_[_0x31c7('0x48')]({},_0x1c3c42,_0x39bf40[_0x31c7('0x4a')]);return _0xab383a['getTags'](_0x1c3c42);}})[_0x31c7('0x19')](function(_0x8a03fb){if(_0x8a03fb){_0xaacb90=_0x8a03fb[_0x31c7('0x40')];if(!_0x39bf40['query'][_0x31c7('0x41')]('nolimit')){_0x1c3c42[_0x31c7('0x43')]=qs[_0x31c7('0x43')](_0x39bf40[_0x31c7('0x3a')][_0x31c7('0x43')]);_0x1c3c42[_0x31c7('0x28')]=qs[_0x31c7('0x28')](_0x39bf40[_0x31c7('0x3a')][_0x31c7('0x28')]);}return _0xab383a['getTags'](_0x1c3c42);}})[_0x31c7('0x19')](function(_0x363292){if(_0x363292){return _0x363292?{'count':_0xaacb90,'rows':_0x363292}:null;}})[_0x31c7('0x19')](respondWithResult(_0x1cacf4,null))[_0x31c7('0x51')](handleError(_0x1cacf4,null));};exports[_0x31c7('0x5b')]=function(_0x231524,_0x3cbdec,_0x46b3ff){if(_0x231524[_0x31c7('0x53')]['id']){delete _0x231524[_0x31c7('0x53')]['id'];}return db[_0x31c7('0x4e')][_0x31c7('0x58')]({'where':{'id':_0x231524[_0x31c7('0x4d')]['id']}})[_0x31c7('0x19')](handleEntityNotFound(_0x3cbdec,null))[_0x31c7('0x19')](function(_0x2becde){if(_0x2becde){return _0x2becde[_0x31c7('0x5b')](_0x231524['body']['ids']||[]);}return null;})[_0x31c7('0x19')](respondWithResult(_0x3cbdec,null))[_0x31c7('0x51')](handleError(_0x3cbdec,null));}; \ No newline at end of file +var _0x1e56=['json','count','offset','limit','set','Content-Range','reject','save','update','destroy','stack','name','send','map','FreshdeskConfiguration','fieldName','type','key','model','query','filters','intersection','attributes','length','nolimit','order','where','pick','filter','merge','VIRTUAL','field','options','includeAll','include','findAll','rows','show','params','keys','rawAttributes','fields','find','create','body','getFields','findOne','FreshdeskField','sort','getSubjects','getDescriptions','getTags','hasOwnProperty','setTags','ids','html-pdf','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','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','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end'];(function(_0x2f7023,_0x1aa399){var _0x2f5e4e=function(_0x1fa5d4){while(--_0x1fa5d4){_0x2f7023['push'](_0x2f7023['shift']());}};_0x2f5e4e(++_0x1aa399);}(_0x1e56,0x99));var _0x61e5=function(_0x448ae8,_0x3aaa5b){_0x448ae8=_0x448ae8-0x0;var _0x33cb48=_0x1e56[_0x448ae8];return _0x33cb48;};'use strict';var pdf=require(_0x61e5('0x0'));var emlformat=require(_0x61e5('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x61e5('0x2'));var jsonpatch=require(_0x61e5('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x61e5('0x4'));var Mustache=require(_0x61e5('0x5'));var util=require(_0x61e5('0x6'));var path=require(_0x61e5('0x7'));var sox=require(_0x61e5('0x8'));var csv=require(_0x61e5('0x9'));var ejs=require(_0x61e5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x61e5('0xb'));var crypto=require(_0x61e5('0xc'));var jsforce=require(_0x61e5('0xd'));var deskjs=require(_0x61e5('0xe'));var toCsv=require(_0x61e5('0x9'));var querystring=require('querystring');var Papa=require(_0x61e5('0xf'));var Redis=require('ioredis');var authService=require(_0x61e5('0x10'));var qs=require(_0x61e5('0x11'));var as=require(_0x61e5('0x12'));var hardwareService=require(_0x61e5('0x13'));var logger=require(_0x61e5('0x14'))(_0x61e5('0x15'));var utils=require(_0x61e5('0x16'));var config=require(_0x61e5('0x17'));var db=require(_0x61e5('0x18'))['db'];var jayson=require(_0x61e5('0x19'));var client=jayson[_0x61e5('0x1a')]['http']({'port':0x232a});function checkPasswordPattern(_0x1a87ed,_0x304aec,_0x1e4338){if(_0x1e4338){var _0x46efc0=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x46efc0[_0x61e5('0x1b')](_0x304aec)){return _0x1a87ed;}else{throw new Error(_0x61e5('0x1c'));}}else{return _0x1a87ed;}}function respondWithRpcPromise(_0x585547,_0x5c5c88,_0x125f00,_0x44fd1d){return new BPromise(function(_0x2a5fe7,_0x4c7380){var _0x3290f2=_0x44fd1d||client;return _0x3290f2[_0x61e5('0x1d')](_0x585547,_0x125f00)[_0x61e5('0x1e')](function(_0x777e73){logger[_0x61e5('0x1f')](_0x61e5('0x20'),_0x5c5c88,_0x61e5('0x21'));logger['debug'](_0x61e5('0x22'),_0x5c5c88,_0x61e5('0x21'),JSON[_0x61e5('0x23')](_0x777e73));if(_0x777e73[_0x61e5('0x24')]){if(_0x777e73[_0x61e5('0x24')]['code']===0x1f4){logger[_0x61e5('0x24')](_0x61e5('0x20'),_0x5c5c88,_0x777e73[_0x61e5('0x24')][_0x61e5('0x25')]);return _0x4c7380(_0x777e73['error'][_0x61e5('0x25')]);}logger['error'](_0x61e5('0x20'),_0x5c5c88,_0x777e73[_0x61e5('0x24')][_0x61e5('0x25')]);return _0x2a5fe7(_0x777e73['error'][_0x61e5('0x25')]);}else{logger[_0x61e5('0x1f')](_0x61e5('0x20'),_0x5c5c88,_0x61e5('0x21'));_0x2a5fe7(_0x777e73[_0x61e5('0x26')]['message']);}})[_0x61e5('0x27')](function(_0xf5b5e3){logger[_0x61e5('0x24')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x5c5c88,_0xf5b5e3);_0x4c7380(_0xf5b5e3);});});}function respondWithStatusCode(_0x53f4e7,_0x297399){_0x297399=_0x297399||0xcc;return function(_0x4c28eb){if(_0x4c28eb){return _0x53f4e7[_0x61e5('0x28')](_0x297399);}return _0x53f4e7[_0x61e5('0x29')](_0x297399)[_0x61e5('0x2a')]();};}function respondWithResult(_0x586fa5,_0x30ee63){_0x30ee63=_0x30ee63||0xc8;return function(_0x6bf0e){if(_0x6bf0e){return _0x586fa5['status'](_0x30ee63)[_0x61e5('0x2b')](_0x6bf0e);}};}function respondWithFilteredResult(_0x379519,_0x454238){return function(_0x55ba83){if(_0x55ba83){var _0x4e1b5e=_0x55ba83[_0x61e5('0x2c')],_0x5df222=_0x454238['offset'],_0x1332ba=_0x454238[_0x61e5('0x2d')]+_0x454238[_0x61e5('0x2e')],_0x2a4440;if(_0x1332ba>=_0x4e1b5e){_0x1332ba=_0x4e1b5e;_0x2a4440=0xc8;}else{_0x2a4440=0xce;}_0x379519[_0x61e5('0x29')](_0x2a4440);return _0x379519[_0x61e5('0x2f')](_0x61e5('0x30'),_0x5df222+'-'+_0x1332ba+'/'+_0x4e1b5e)[_0x61e5('0x2b')](_0x55ba83);}return null;};}function patchUpdates(_0x5d0339){return function(_0x419b1b){try{jsonpatch['apply'](_0x419b1b,_0x5d0339,!![]);}catch(_0x19c6b1){return BPromise[_0x61e5('0x31')](_0x19c6b1);}return _0x419b1b[_0x61e5('0x32')]();};}function saveUpdates(_0xdec14e,_0x1acf1a){return function(_0x552729){if(_0x552729){return _0x552729[_0x61e5('0x33')](_0xdec14e)['then'](function(_0x30082c){return _0x30082c;});}return null;};}function removeEntity(_0x5ba768,_0x3ab349){return function(_0x2bc8b4){if(_0x2bc8b4){return _0x2bc8b4[_0x61e5('0x34')]()[_0x61e5('0x1e')](function(){_0x5ba768[_0x61e5('0x29')](0xcc)[_0x61e5('0x2a')]();});}};}function handleEntityNotFound(_0x14c24a,_0x34ec2e){return function(_0x1d9a69){if(!_0x1d9a69){_0x14c24a[_0x61e5('0x28')](0x194);}return _0x1d9a69;};}function handleError(_0x3d2cee,_0x1a47ab){_0x1a47ab=_0x1a47ab||0x1f4;return function(_0x94f2c2){logger[_0x61e5('0x24')](_0x94f2c2[_0x61e5('0x35')]);if(_0x94f2c2[_0x61e5('0x36')]){delete _0x94f2c2[_0x61e5('0x36')];}_0x3d2cee['status'](_0x1a47ab)[_0x61e5('0x37')](_0x94f2c2);};}exports['index']=function(_0x477c5e,_0x4da0d8){var _0x4e7b72={},_0x46a34e={},_0x477e60={'count':0x0,'rows':[]};var _0x398c62=_[_0x61e5('0x38')](db[_0x61e5('0x39')]['rawAttributes'],function(_0x394b2e){return{'name':_0x394b2e[_0x61e5('0x3a')],'type':_0x394b2e[_0x61e5('0x3b')][_0x61e5('0x3c')]};});_0x46a34e[_0x61e5('0x3d')]=_[_0x61e5('0x38')](_0x398c62,_0x61e5('0x36'));_0x46a34e[_0x61e5('0x3e')]=_['keys'](_0x477c5e[_0x61e5('0x3e')]);_0x46a34e[_0x61e5('0x3f')]=_[_0x61e5('0x40')](_0x46a34e[_0x61e5('0x3d')],_0x46a34e[_0x61e5('0x3e')]);_0x4e7b72[_0x61e5('0x41')]=_[_0x61e5('0x40')](_0x46a34e[_0x61e5('0x3d')],qs['fields'](_0x477c5e[_0x61e5('0x3e')]['fields']));_0x4e7b72[_0x61e5('0x41')]=_0x4e7b72[_0x61e5('0x41')][_0x61e5('0x42')]?_0x4e7b72['attributes']:_0x46a34e[_0x61e5('0x3d')];if(!_0x477c5e[_0x61e5('0x3e')]['hasOwnProperty'](_0x61e5('0x43'))){_0x4e7b72[_0x61e5('0x2e')]=qs[_0x61e5('0x2e')](_0x477c5e[_0x61e5('0x3e')][_0x61e5('0x2e')]);_0x4e7b72[_0x61e5('0x2d')]=qs[_0x61e5('0x2d')](_0x477c5e['query'][_0x61e5('0x2d')]);}_0x4e7b72[_0x61e5('0x44')]=qs['sort'](_0x477c5e[_0x61e5('0x3e')]['sort']);_0x4e7b72[_0x61e5('0x45')]=qs['filters'](_[_0x61e5('0x46')](_0x477c5e['query'],_0x46a34e['filters']));if(_0x477c5e[_0x61e5('0x3e')][_0x61e5('0x47')]){_0x4e7b72['where']=_[_0x61e5('0x48')](_0x4e7b72[_0x61e5('0x45')],{'$or':_[_0x61e5('0x38')](_0x398c62,function(_0x32b83e){if(_0x32b83e[_0x61e5('0x3b')][_0x61e5('0x3c')]!==_0x61e5('0x49')){var _0x31f731={};_0x31f731[_0x32b83e[_0x61e5('0x4a')]]={'$like':'%'+_0x477c5e[_0x61e5('0x3e')][_0x61e5('0x47')]+'%'};return _0x31f731;}})});}_0x4e7b72=_[_0x61e5('0x48')]({},_0x4e7b72,_0x477c5e[_0x61e5('0x4b')]);var _0x43d90c={'where':_0x4e7b72[_0x61e5('0x45')]};return db[_0x61e5('0x39')][_0x61e5('0x2c')](_0x43d90c)[_0x61e5('0x1e')](function(_0x34b091){_0x477e60[_0x61e5('0x2c')]=_0x34b091;if(_0x477c5e['query'][_0x61e5('0x4c')]){_0x4e7b72[_0x61e5('0x4d')]=[{'all':!![]}];}return db[_0x61e5('0x39')][_0x61e5('0x4e')](_0x4e7b72);})[_0x61e5('0x1e')](function(_0x12645f){_0x477e60[_0x61e5('0x4f')]=_0x12645f;return _0x477e60;})[_0x61e5('0x1e')](respondWithFilteredResult(_0x4da0d8,_0x4e7b72))[_0x61e5('0x27')](handleError(_0x4da0d8,null));};exports[_0x61e5('0x50')]=function(_0x4b4f89,_0x2d306b){var _0x34eeb8={'raw':![],'where':{'id':_0x4b4f89[_0x61e5('0x51')]['id']}},_0x5dd354={};_0x5dd354['model']=_[_0x61e5('0x52')](db[_0x61e5('0x39')][_0x61e5('0x53')]);_0x5dd354[_0x61e5('0x3e')]=_['keys'](_0x4b4f89[_0x61e5('0x3e')]);_0x5dd354[_0x61e5('0x3f')]=_['intersection'](_0x5dd354['model'],_0x5dd354['query']);_0x34eeb8['attributes']=_[_0x61e5('0x40')](_0x5dd354[_0x61e5('0x3d')],qs[_0x61e5('0x54')](_0x4b4f89[_0x61e5('0x3e')][_0x61e5('0x54')]));_0x34eeb8[_0x61e5('0x41')]=_0x34eeb8['attributes']['length']?_0x34eeb8['attributes']:_0x5dd354[_0x61e5('0x3d')];if(_0x4b4f89[_0x61e5('0x3e')][_0x61e5('0x4c')]){_0x34eeb8['include']=[{'all':!![]}];}_0x34eeb8=_[_0x61e5('0x48')]({},_0x34eeb8,_0x4b4f89['options']);return db[_0x61e5('0x39')][_0x61e5('0x55')](_0x34eeb8)[_0x61e5('0x1e')](handleEntityNotFound(_0x2d306b,null))[_0x61e5('0x1e')](respondWithResult(_0x2d306b,null))[_0x61e5('0x27')](handleError(_0x2d306b,null));};exports['create']=function(_0x80d2a8,_0x1844c9){return db[_0x61e5('0x39')][_0x61e5('0x56')](_0x80d2a8[_0x61e5('0x57')],{})[_0x61e5('0x1e')](respondWithResult(_0x1844c9,0xc9))[_0x61e5('0x27')](handleError(_0x1844c9,null));};exports['update']=function(_0x41dc03,_0x4d1bfb){if(_0x41dc03[_0x61e5('0x57')]['id']){delete _0x41dc03[_0x61e5('0x57')]['id'];}return db[_0x61e5('0x39')]['find']({'where':{'id':_0x41dc03['params']['id']}})['then'](handleEntityNotFound(_0x4d1bfb,null))[_0x61e5('0x1e')](saveUpdates(_0x41dc03['body'],null))['then'](respondWithResult(_0x4d1bfb,null))[_0x61e5('0x27')](handleError(_0x4d1bfb,null));};exports[_0x61e5('0x34')]=function(_0x1752eb,_0x179403){return db[_0x61e5('0x39')][_0x61e5('0x55')]({'where':{'id':_0x1752eb[_0x61e5('0x51')]['id']}})['then'](handleEntityNotFound(_0x179403,null))[_0x61e5('0x1e')](removeEntity(_0x179403,null))[_0x61e5('0x27')](handleError(_0x179403,null));};exports[_0x61e5('0x58')]=function(_0x110190,_0x6521b9,_0x53f132){var _0x4a54fc={};var _0x5cf3dd={};var _0x45e00d;var _0x5d9a04;return db[_0x61e5('0x39')][_0x61e5('0x59')]({'where':{'id':_0x110190['params']['id']}})[_0x61e5('0x1e')](handleEntityNotFound(_0x6521b9,null))['then'](function(_0x5210fc){if(_0x5210fc){_0x45e00d=_0x5210fc;_0x5cf3dd[_0x61e5('0x3d')]=_[_0x61e5('0x52')](db[_0x61e5('0x5a')]['rawAttributes']);_0x5cf3dd[_0x61e5('0x3e')]=_[_0x61e5('0x52')](_0x110190[_0x61e5('0x3e')]);_0x5cf3dd[_0x61e5('0x3f')]=_[_0x61e5('0x40')](_0x5cf3dd[_0x61e5('0x3d')],_0x5cf3dd[_0x61e5('0x3e')]);_0x4a54fc[_0x61e5('0x41')]=_[_0x61e5('0x40')](_0x5cf3dd[_0x61e5('0x3d')],qs[_0x61e5('0x54')](_0x110190['query'][_0x61e5('0x54')]));_0x4a54fc[_0x61e5('0x41')]=_0x4a54fc[_0x61e5('0x41')][_0x61e5('0x42')]?_0x4a54fc['attributes']:_0x5cf3dd[_0x61e5('0x3d')];_0x4a54fc[_0x61e5('0x44')]=qs['sort'](_0x110190[_0x61e5('0x3e')][_0x61e5('0x5b')]);_0x4a54fc['where']=qs['filters'](_[_0x61e5('0x46')](_0x110190['query'],_0x5cf3dd[_0x61e5('0x3f')]));if(_0x110190[_0x61e5('0x3e')][_0x61e5('0x47')]){_0x4a54fc[_0x61e5('0x45')]=_[_0x61e5('0x48')](_0x4a54fc[_0x61e5('0x45')],{'$or':_[_0x61e5('0x38')](_0x4a54fc[_0x61e5('0x41')],function(_0x4b7742){var _0x4f9320={};_0x4f9320[_0x4b7742]={'$like':'%'+_0x110190[_0x61e5('0x3e')][_0x61e5('0x47')]+'%'};return _0x4f9320;})});}_0x4a54fc=_['merge']({},_0x4a54fc,_0x110190[_0x61e5('0x4b')]);return _0x45e00d[_0x61e5('0x58')](_0x4a54fc);}})[_0x61e5('0x1e')](function(_0x1af8dd){if(_0x1af8dd){_0x5d9a04=_0x1af8dd[_0x61e5('0x42')];if(!_0x110190[_0x61e5('0x3e')]['hasOwnProperty']('nolimit')){_0x4a54fc[_0x61e5('0x2e')]=qs[_0x61e5('0x2e')](_0x110190[_0x61e5('0x3e')]['limit']);_0x4a54fc[_0x61e5('0x2d')]=qs[_0x61e5('0x2d')](_0x110190[_0x61e5('0x3e')][_0x61e5('0x2d')]);}return _0x45e00d[_0x61e5('0x58')](_0x4a54fc);}})[_0x61e5('0x1e')](function(_0x580f4b){if(_0x580f4b){return _0x580f4b?{'count':_0x5d9a04,'rows':_0x580f4b}:null;}})[_0x61e5('0x1e')](respondWithResult(_0x6521b9,null))[_0x61e5('0x27')](handleError(_0x6521b9,null));};exports[_0x61e5('0x5c')]=function(_0x1198c0,_0x4fed13,_0x181f5c){var _0x44d718={};var _0x151153={};var _0x1548ac;var _0x4b9324;return db[_0x61e5('0x39')]['findOne']({'where':{'id':_0x1198c0['params']['id']}})['then'](handleEntityNotFound(_0x4fed13,null))[_0x61e5('0x1e')](function(_0x48bdc6){if(_0x48bdc6){_0x1548ac=_0x48bdc6;_0x151153[_0x61e5('0x3d')]=_[_0x61e5('0x52')](db[_0x61e5('0x5a')][_0x61e5('0x53')]);_0x151153[_0x61e5('0x3e')]=_[_0x61e5('0x52')](_0x1198c0['query']);_0x151153['filters']=_[_0x61e5('0x40')](_0x151153[_0x61e5('0x3d')],_0x151153[_0x61e5('0x3e')]);_0x44d718[_0x61e5('0x41')]=_['intersection'](_0x151153[_0x61e5('0x3d')],qs['fields'](_0x1198c0[_0x61e5('0x3e')]['fields']));_0x44d718['attributes']=_0x44d718[_0x61e5('0x41')][_0x61e5('0x42')]?_0x44d718[_0x61e5('0x41')]:_0x151153['model'];_0x44d718[_0x61e5('0x44')]=qs['sort'](_0x1198c0[_0x61e5('0x3e')][_0x61e5('0x5b')]);_0x44d718[_0x61e5('0x45')]=qs['filters'](_['pick'](_0x1198c0['query'],_0x151153[_0x61e5('0x3f')]));if(_0x1198c0[_0x61e5('0x3e')][_0x61e5('0x47')]){_0x44d718[_0x61e5('0x45')]=_[_0x61e5('0x48')](_0x44d718['where'],{'$or':_[_0x61e5('0x38')](_0x44d718[_0x61e5('0x41')],function(_0x4c32c9){var _0x23e73a={};_0x23e73a[_0x4c32c9]={'$like':'%'+_0x1198c0['query'][_0x61e5('0x47')]+'%'};return _0x23e73a;})});}_0x44d718=_[_0x61e5('0x48')]({},_0x44d718,_0x1198c0[_0x61e5('0x4b')]);return _0x1548ac[_0x61e5('0x5c')](_0x44d718);}})[_0x61e5('0x1e')](function(_0x1ee276){if(_0x1ee276){_0x4b9324=_0x1ee276[_0x61e5('0x42')];if(!_0x1198c0[_0x61e5('0x3e')]['hasOwnProperty'](_0x61e5('0x43'))){_0x44d718[_0x61e5('0x2e')]=qs[_0x61e5('0x2e')](_0x1198c0[_0x61e5('0x3e')][_0x61e5('0x2e')]);_0x44d718['offset']=qs[_0x61e5('0x2d')](_0x1198c0[_0x61e5('0x3e')]['offset']);}return _0x1548ac[_0x61e5('0x5c')](_0x44d718);}})[_0x61e5('0x1e')](function(_0x2518cc){if(_0x2518cc){return _0x2518cc?{'count':_0x4b9324,'rows':_0x2518cc}:null;}})[_0x61e5('0x1e')](respondWithResult(_0x4fed13,null))['catch'](handleError(_0x4fed13,null));};exports['getDescriptions']=function(_0x2fa90f,_0x1244b3,_0x10daba){var _0x578dd7={};var _0x4c79ae={};var _0x1889f4;var _0x1c1135;return db[_0x61e5('0x39')][_0x61e5('0x59')]({'where':{'id':_0x2fa90f[_0x61e5('0x51')]['id']}})[_0x61e5('0x1e')](handleEntityNotFound(_0x1244b3,null))[_0x61e5('0x1e')](function(_0x18465a){if(_0x18465a){_0x1889f4=_0x18465a;_0x4c79ae[_0x61e5('0x3d')]=_[_0x61e5('0x52')](db[_0x61e5('0x5a')]['rawAttributes']);_0x4c79ae[_0x61e5('0x3e')]=_[_0x61e5('0x52')](_0x2fa90f[_0x61e5('0x3e')]);_0x4c79ae[_0x61e5('0x3f')]=_['intersection'](_0x4c79ae['model'],_0x4c79ae[_0x61e5('0x3e')]);_0x578dd7[_0x61e5('0x41')]=_['intersection'](_0x4c79ae[_0x61e5('0x3d')],qs['fields'](_0x2fa90f['query'][_0x61e5('0x54')]));_0x578dd7['attributes']=_0x578dd7[_0x61e5('0x41')]['length']?_0x578dd7['attributes']:_0x4c79ae[_0x61e5('0x3d')];_0x578dd7['order']=qs['sort'](_0x2fa90f['query'][_0x61e5('0x5b')]);_0x578dd7[_0x61e5('0x45')]=qs[_0x61e5('0x3f')](_['pick'](_0x2fa90f[_0x61e5('0x3e')],_0x4c79ae[_0x61e5('0x3f')]));if(_0x2fa90f[_0x61e5('0x3e')][_0x61e5('0x47')]){_0x578dd7['where']=_['merge'](_0x578dd7[_0x61e5('0x45')],{'$or':_[_0x61e5('0x38')](_0x578dd7['attributes'],function(_0x5cbba4){var _0x1c8604={};_0x1c8604[_0x5cbba4]={'$like':'%'+_0x2fa90f[_0x61e5('0x3e')]['filter']+'%'};return _0x1c8604;})});}_0x578dd7=_[_0x61e5('0x48')]({},_0x578dd7,_0x2fa90f[_0x61e5('0x4b')]);return _0x1889f4['getDescriptions'](_0x578dd7);}})['then'](function(_0x18af58){if(_0x18af58){_0x1c1135=_0x18af58[_0x61e5('0x42')];if(!_0x2fa90f[_0x61e5('0x3e')]['hasOwnProperty'](_0x61e5('0x43'))){_0x578dd7[_0x61e5('0x2e')]=qs['limit'](_0x2fa90f[_0x61e5('0x3e')]['limit']);_0x578dd7['offset']=qs[_0x61e5('0x2d')](_0x2fa90f[_0x61e5('0x3e')][_0x61e5('0x2d')]);}return _0x1889f4[_0x61e5('0x5d')](_0x578dd7);}})[_0x61e5('0x1e')](function(_0x418a15){if(_0x418a15){return _0x418a15?{'count':_0x1c1135,'rows':_0x418a15}:null;}})[_0x61e5('0x1e')](respondWithResult(_0x1244b3,null))['catch'](handleError(_0x1244b3,null));};exports[_0x61e5('0x5e')]=function(_0xac8358,_0x271b43,_0x5ba54d){var _0x590fbe={};var _0x2ec873={};var _0x3df248;var _0x42a69d;return db[_0x61e5('0x39')][_0x61e5('0x59')]({'where':{'id':_0xac8358['params']['id']}})[_0x61e5('0x1e')](handleEntityNotFound(_0x271b43,null))['then'](function(_0x1ec82c){if(_0x1ec82c){_0x3df248=_0x1ec82c;_0x2ec873[_0x61e5('0x3d')]=_['keys'](db['Tag'][_0x61e5('0x53')]);_0x2ec873[_0x61e5('0x3e')]=_[_0x61e5('0x52')](_0xac8358['query']);_0x2ec873[_0x61e5('0x3f')]=_[_0x61e5('0x40')](_0x2ec873[_0x61e5('0x3d')],_0x2ec873[_0x61e5('0x3e')]);_0x590fbe[_0x61e5('0x41')]=_['intersection'](_0x2ec873[_0x61e5('0x3d')],qs[_0x61e5('0x54')](_0xac8358[_0x61e5('0x3e')][_0x61e5('0x54')]));_0x590fbe[_0x61e5('0x41')]=_0x590fbe[_0x61e5('0x41')]['length']?_0x590fbe[_0x61e5('0x41')]:_0x2ec873['model'];_0x590fbe[_0x61e5('0x44')]=qs['sort'](_0xac8358[_0x61e5('0x3e')]['sort']);_0x590fbe['where']=qs[_0x61e5('0x3f')](_[_0x61e5('0x46')](_0xac8358[_0x61e5('0x3e')],_0x2ec873[_0x61e5('0x3f')]));if(_0xac8358[_0x61e5('0x3e')][_0x61e5('0x47')]){_0x590fbe['where']=_[_0x61e5('0x48')](_0x590fbe[_0x61e5('0x45')],{'$or':_['map'](_0x590fbe['attributes'],function(_0x3836ee){var _0x389f0e={};_0x389f0e[_0x3836ee]={'$like':'%'+_0xac8358[_0x61e5('0x3e')][_0x61e5('0x47')]+'%'};return _0x389f0e;})});}_0x590fbe=_[_0x61e5('0x48')]({},_0x590fbe,_0xac8358[_0x61e5('0x4b')]);return _0x3df248[_0x61e5('0x5e')](_0x590fbe);}})['then'](function(_0x1f144c){if(_0x1f144c){_0x42a69d=_0x1f144c[_0x61e5('0x42')];if(!_0xac8358[_0x61e5('0x3e')][_0x61e5('0x5f')](_0x61e5('0x43'))){_0x590fbe[_0x61e5('0x2e')]=qs['limit'](_0xac8358['query'][_0x61e5('0x2e')]);_0x590fbe[_0x61e5('0x2d')]=qs['offset'](_0xac8358['query'][_0x61e5('0x2d')]);}return _0x3df248[_0x61e5('0x5e')](_0x590fbe);}})[_0x61e5('0x1e')](function(_0x50035c){if(_0x50035c){return _0x50035c?{'count':_0x42a69d,'rows':_0x50035c}:null;}})[_0x61e5('0x1e')](respondWithResult(_0x271b43,null))[_0x61e5('0x27')](handleError(_0x271b43,null));};exports[_0x61e5('0x60')]=function(_0x2fe6e8,_0x212a8d,_0x4c7d1b){if(_0x2fe6e8[_0x61e5('0x57')]['id']){delete _0x2fe6e8[_0x61e5('0x57')]['id'];}return db[_0x61e5('0x39')][_0x61e5('0x59')]({'where':{'id':_0x2fe6e8['params']['id']}})['then'](handleEntityNotFound(_0x212a8d,null))['then'](function(_0x5d0b91){if(_0x5d0b91){return _0x5d0b91[_0x61e5('0x60')](_0x2fe6e8[_0x61e5('0x57')][_0x61e5('0x61')]||[]);}return null;})[_0x61e5('0x1e')](respondWithResult(_0x212a8d,null))[_0x61e5('0x27')](handleError(_0x212a8d,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 9f12565..5a8c56a 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 _0xb585=['FreshdeskConfiguration','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./intFreshdeskConfiguration.attributes'];(function(_0x196779,_0x2c0618){var _0xad076f=function(_0x18740a){while(--_0x18740a){_0x196779['push'](_0x196779['shift']());}};_0xad076f(++_0x2c0618);}(_0xb585,0x1e1));var _0x5b58=function(_0x48ad26,_0x56bbc7){_0x48ad26=_0x48ad26-0x0;var _0x7e477e=_0xb585[_0x48ad26];return _0x7e477e;};'use strict';var _=require(_0x5b58('0x0'));var util=require(_0x5b58('0x1'));var logger=require(_0x5b58('0x2'))(_0x5b58('0x3'));var moment=require('moment');var BPromise=require(_0x5b58('0x4'));var rp=require(_0x5b58('0x5'));var fs=require('fs');var path=require(_0x5b58('0x6'));var rimraf=require(_0x5b58('0x7'));var config=require('../../config/environment');var attributes=require(_0x5b58('0x8'));module['exports']=function(_0xeb0f9d,_0x4c2ec4){return _0xeb0f9d['define'](_0x5b58('0x9'),attributes,{'tableName':'int_freshdesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4284=['bluebird','rimraf','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','lodash','util','../../config/logger','api','moment'];(function(_0x2ea714,_0x3ec05a){var _0x2707ad=function(_0xba98cd){while(--_0xba98cd){_0x2ea714['push'](_0x2ea714['shift']());}};_0x2707ad(++_0x3ec05a);}(_0x4284,0x145));var _0x4428=function(_0x39e918,_0x5de932){_0x39e918=_0x39e918-0x0;var _0x543321=_0x4284[_0x39e918];return _0x543321;};'use strict';var _=require(_0x4428('0x0'));var util=require(_0x4428('0x1'));var logger=require(_0x4428('0x2'))(_0x4428('0x3'));var moment=require(_0x4428('0x4'));var BPromise=require(_0x4428('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4428('0x6'));var config=require('../../config/environment');var attributes=require(_0x4428('0x7'));module[_0x4428('0x8')]=function(_0x282580,_0x483b5f){return _0x282580[_0x4428('0x9')](_0x4428('0xa'),attributes,{'tableName':'int_freshdesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js index 8e357a1..27d186a 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 _0xf175=['FreshdeskConfiguration,\x20%s,\x20%s','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info'];(function(_0x15f3c0,_0x165a64){var _0x1adfe0=function(_0x212cfc){while(--_0x212cfc){_0x15f3c0['push'](_0x15f3c0['shift']());}};_0x1adfe0(++_0x165a64);}(_0xf175,0xb0));var _0x5f17=function(_0x17c860,_0x3e2265){_0x17c860=_0x17c860-0x0;var _0x5435bd=_0xf175[_0x17c860];return _0x5435bd;};'use strict';var _=require(_0x5f17('0x0'));var util=require('util');var moment=require(_0x5f17('0x1'));var BPromise=require(_0x5f17('0x2'));var rs=require(_0x5f17('0x3'));var fs=require('fs');var Redis=require(_0x5f17('0x4'));var db=require(_0x5f17('0x5'))['db'];var utils=require(_0x5f17('0x6'));var logger=require(_0x5f17('0x7'))(_0x5f17('0x8'));var config=require(_0x5f17('0x9'));var jayson=require(_0x5f17('0xa'));var client=jayson[_0x5f17('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x40e3f1,_0x1f4392,_0x4a4f98){return new BPromise(function(_0x45dc2c,_0x50fac9){return client['request'](_0x40e3f1,_0x4a4f98)['then'](function(_0x32a3f5){logger[_0x5f17('0xc')](_0x5f17('0xd'),_0x1f4392,'request\x20sent');logger['debug'](_0x5f17('0xe'),_0x1f4392,_0x5f17('0xf'),JSON['stringify'](_0x32a3f5));if(_0x32a3f5[_0x5f17('0x10')]){if(_0x32a3f5['error'][_0x5f17('0x11')]===0x1f4){logger[_0x5f17('0x10')](_0x5f17('0xd'),_0x1f4392,_0x32a3f5[_0x5f17('0x10')][_0x5f17('0x12')]);return _0x50fac9(_0x32a3f5[_0x5f17('0x10')][_0x5f17('0x12')]);}logger[_0x5f17('0x10')](_0x5f17('0xd'),_0x1f4392,_0x32a3f5[_0x5f17('0x10')][_0x5f17('0x12')]);return _0x45dc2c(_0x32a3f5[_0x5f17('0x10')][_0x5f17('0x12')]);}else{logger['info'](_0x5f17('0xd'),_0x1f4392,_0x5f17('0xf'));_0x45dc2c(_0x32a3f5[_0x5f17('0x13')][_0x5f17('0x12')]);}})[_0x5f17('0x14')](function(_0x43b4a2){logger[_0x5f17('0x10')](_0x5f17('0xd'),_0x1f4392,_0x43b4a2);_0x50fac9(_0x43b4a2);});});} \ No newline at end of file +var _0x4d42=['../../config/environment','client','http','request','then','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','moment','bluebird','../../config/utils','../../config/logger'];(function(_0x1274f4,_0x3bc587){var _0x334b60=function(_0x1b5a1a){while(--_0x1b5a1a){_0x1274f4['push'](_0x1274f4['shift']());}};_0x334b60(++_0x3bc587);}(_0x4d42,0x1e9));var _0x24d4=function(_0x56194e,_0x1a615f){_0x56194e=_0x56194e-0x0;var _0xfcbf96=_0x4d42[_0x56194e];return _0xfcbf96;};'use strict';var _=require(_0x24d4('0x0'));var util=require('util');var moment=require(_0x24d4('0x1'));var BPromise=require(_0x24d4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x24d4('0x3'));var logger=require(_0x24d4('0x4'))('rpc');var config=require(_0x24d4('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x24d4('0x6')][_0x24d4('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x25aa25,_0x4a7098,_0x4ed30e){return new BPromise(function(_0x531989,_0x401e52){return client[_0x24d4('0x8')](_0x25aa25,_0x4ed30e)[_0x24d4('0x9')](function(_0x2338ca){logger['info'](_0x24d4('0xa'),_0x4a7098,_0x24d4('0xb'));logger['debug'](_0x24d4('0xc'),_0x4a7098,_0x24d4('0xb'),JSON[_0x24d4('0xd')](_0x2338ca));if(_0x2338ca[_0x24d4('0xe')]){if(_0x2338ca[_0x24d4('0xe')]['code']===0x1f4){logger['error'](_0x24d4('0xa'),_0x4a7098,_0x2338ca[_0x24d4('0xe')][_0x24d4('0xf')]);return _0x401e52(_0x2338ca[_0x24d4('0xe')][_0x24d4('0xf')]);}logger['error'](_0x24d4('0xa'),_0x4a7098,_0x2338ca[_0x24d4('0xe')][_0x24d4('0xf')]);return _0x531989(_0x2338ca['error'][_0x24d4('0xf')]);}else{logger[_0x24d4('0x10')](_0x24d4('0xa'),_0x4a7098,_0x24d4('0xb'));_0x531989(_0x2338ca[_0x24d4('0x11')][_0x24d4('0xf')]);}})[_0x24d4('0x12')](function(_0x2fff7e){logger['error'](_0x24d4('0xa'),_0x4a7098,_0x2fff7e);_0x401e52(_0x2fff7e);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 72e8548..a0f2643 100644 --- a/server/api/intFreshdeskField/index.js +++ b/server/api/intFreshdeskField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports'];(function(_0x17a32f,_0x5a51a){var _0x15a293=function(_0x55fbd3){while(--_0x55fbd3){_0x17a32f['push'](_0x17a32f['shift']());}};_0x15a293(++_0x5a51a);}(_0x34e8,0x12c));var _0x834e=function(_0x4671ed,_0x5a15ba){_0x4671ed=_0x4671ed-0x0;var _0x439b49=_0x34e8[_0x4671ed];return _0x439b49;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var auth=require(_0x834e('0x5'));var interaction=require(_0x834e('0x6'));var config=require(_0x834e('0x7'));var controller=require(_0x834e('0x8'));router[_0x834e('0x9')]('/',auth[_0x834e('0xa')](),controller['index']);router[_0x834e('0x9')]('/:id',auth[_0x834e('0xa')](),controller[_0x834e('0xb')]);router[_0x834e('0xc')]('/',auth[_0x834e('0xa')](),controller[_0x834e('0xd')]);router[_0x834e('0xe')](_0x834e('0xf'),auth[_0x834e('0xa')](),controller[_0x834e('0x10')]);router[_0x834e('0x11')](_0x834e('0xf'),auth[_0x834e('0xa')](),controller[_0x834e('0x12')]);module[_0x834e('0x13')]=router; \ No newline at end of file +var _0x9c44=['/:id','isAuthenticated','show','create','put','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','index'];(function(_0x5e3f0f,_0x16c6c7){var _0xbd8d66=function(_0x3f4da4){while(--_0x3f4da4){_0x5e3f0f['push'](_0x5e3f0f['shift']());}};_0xbd8d66(++_0x16c6c7);}(_0x9c44,0x178));var _0x49c4=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x9c44[_0x422905];return _0x33dc6c;};'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('./intFreshdeskField.controller');router[_0x49c4('0x6')]('/',auth['isAuthenticated'](),controller[_0x49c4('0x7')]);router[_0x49c4('0x6')](_0x49c4('0x8'),auth[_0x49c4('0x9')](),controller[_0x49c4('0xa')]);router['post']('/',auth[_0x49c4('0x9')](),controller[_0x49c4('0xb')]);router[_0x49c4('0xc')](_0x49c4('0x8'),auth['isAuthenticated'](),controller['update']);router[_0x49c4('0xd')](_0x49c4('0x8'),auth['isAuthenticated'](),controller[_0x49c4('0xe')]);module[_0x49c4('0xf')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 517674d..4b76633 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 _0x47c7=['sequelize','ENUM','string','customVariable','keyValue','STRING','BOOLEAN'];(function(_0xf34109,_0x380779){var _0x570bfc=function(_0x1ad086){while(--_0x1ad086){_0xf34109['push'](_0xf34109['shift']());}};_0x570bfc(++_0x380779);}(_0x47c7,0x1ab));var _0x747c=function(_0x35af23,_0x9190f6){_0x35af23=_0x35af23-0x0;var _0x340506=_0x47c7[_0x35af23];return _0x340506;};'use strict';var Sequelize=require(_0x747c('0x0'));module['exports']={'type':{'type':Sequelize[_0x747c('0x1')](_0x747c('0x2'),'variable',_0x747c('0x3'),_0x747c('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x747c('0x5')]},'key':{'type':Sequelize[_0x747c('0x5')]},'keyType':{'type':Sequelize[_0x747c('0x1')](_0x747c('0x2'),'variable',_0x747c('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x747c('0x5')]},'nameField':{'type':Sequelize[_0x747c('0x5')]},'customField':{'type':Sequelize[_0x747c('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x747c('0x5')]}}; \ No newline at end of file +var _0x75a2=['keyValue','string','STRING','BOOLEAN','sequelize','exports','ENUM','variable','customVariable'];(function(_0x11b28c,_0x26825f){var _0x278bf9=function(_0xb6fbcf){while(--_0xb6fbcf){_0x11b28c['push'](_0x11b28c['shift']());}};_0x278bf9(++_0x26825f);}(_0x75a2,0x187));var _0x275a=function(_0x18a51c,_0x7e83c2){_0x18a51c=_0x18a51c-0x0;var _0x5b31fe=_0x75a2[_0x18a51c];return _0x5b31fe;};'use strict';var Sequelize=require(_0x275a('0x0'));module[_0x275a('0x1')]={'type':{'type':Sequelize[_0x275a('0x2')]('string',_0x275a('0x3'),_0x275a('0x4'),_0x275a('0x5')),'defaultValue':_0x275a('0x6')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x275a('0x7')]},'keyType':{'type':Sequelize['ENUM']('string','variable','customVariable')},'keyContent':{'type':Sequelize[_0x275a('0x7')]},'idField':{'type':Sequelize[_0x275a('0x7')]},'nameField':{'type':Sequelize[_0x275a('0x7')]},'customField':{'type':Sequelize[_0x275a('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 03ad88d..7b2cbc7 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 _0xf410=['sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','FreshdeskField','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','field','options','count','include','rows','catch','show','params','includeAll','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0x1cec84,_0x101ec2){var _0x12b7d3=function(_0x9679d8){while(--_0x9679d8){_0x1cec84['push'](_0x1cec84['shift']());}};_0x12b7d3(++_0x101ec2);}(_0xf410,0xdc));var _0x0f41=function(_0x14f288,_0x49f14e){_0x14f288=_0x14f288-0x0;var _0x169642=_0xf410[_0x14f288];return _0x169642;};'use strict';var pdf=require(_0x0f41('0x0'));var emlformat=require(_0x0f41('0x1'));var rimraf=require(_0x0f41('0x2'));var zipdir=require(_0x0f41('0x3'));var jsonpatch=require(_0x0f41('0x4'));var rp=require(_0x0f41('0x5'));var moment=require(_0x0f41('0x6'));var BPromise=require(_0x0f41('0x7'));var Mustache=require(_0x0f41('0x8'));var util=require(_0x0f41('0x9'));var path=require(_0x0f41('0xa'));var sox=require(_0x0f41('0xb'));var csv=require('to-csv');var ejs=require(_0x0f41('0xc'));var fs=require('fs');var _=require(_0x0f41('0xd'));var squel=require(_0x0f41('0xe'));var crypto=require(_0x0f41('0xf'));var jsforce=require(_0x0f41('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x0f41('0x11'));var querystring=require(_0x0f41('0x12'));var Papa=require(_0x0f41('0x13'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0f41('0x14'));var as=require(_0x0f41('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0f41('0x16'))(_0x0f41('0x17'));var utils=require(_0x0f41('0x18'));var config=require('../../config/environment');var db=require(_0x0f41('0x19'))['db'];function respondWithStatusCode(_0x3157a2,_0x19cc7a){_0x19cc7a=_0x19cc7a||0xcc;return function(_0x4fc1bf){if(_0x4fc1bf){return _0x3157a2[_0x0f41('0x1a')](_0x19cc7a);}return _0x3157a2[_0x0f41('0x1b')](_0x19cc7a)['end']();};}function respondWithResult(_0x498637,_0x36852c){_0x36852c=_0x36852c||0xc8;return function(_0x5512c5){if(_0x5512c5){return _0x498637[_0x0f41('0x1b')](_0x36852c)[_0x0f41('0x1c')](_0x5512c5);}};}function respondWithFilteredResult(_0x3cdee5,_0x3233c1){return function(_0xb4b5f2){if(_0xb4b5f2){var _0x341d1c=_0xb4b5f2['count'],_0x2683f9=_0x3233c1[_0x0f41('0x1d')],_0x1f7807=_0x3233c1[_0x0f41('0x1d')]+_0x3233c1[_0x0f41('0x1e')],_0x5da3b3;if(_0x1f7807>=_0x341d1c){_0x1f7807=_0x341d1c;_0x5da3b3=0xc8;}else{_0x5da3b3=0xce;}_0x3cdee5[_0x0f41('0x1b')](_0x5da3b3);return _0x3cdee5[_0x0f41('0x1f')](_0x0f41('0x20'),_0x2683f9+'-'+_0x1f7807+'/'+_0x341d1c)[_0x0f41('0x1c')](_0xb4b5f2);}return null;};}function patchUpdates(_0x2c6711){return function(_0x12503f){try{jsonpatch[_0x0f41('0x21')](_0x12503f,_0x2c6711,!![]);}catch(_0x491948){return BPromise[_0x0f41('0x22')](_0x491948);}return _0x12503f[_0x0f41('0x23')]();};}function saveUpdates(_0xd0ed18,_0x563a28){return function(_0x162c61){if(_0x162c61){return _0x162c61[_0x0f41('0x24')](_0xd0ed18)[_0x0f41('0x25')](function(_0x2761af){return _0x2761af;});}return null;};}function removeEntity(_0x2f7a0b,_0xb2486d){return function(_0x1bcd7c){if(_0x1bcd7c){return _0x1bcd7c['destroy']()[_0x0f41('0x25')](function(){_0x2f7a0b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e11dc,_0x564292){return function(_0x4ecc1e){if(!_0x4ecc1e){_0x5e11dc['sendStatus'](0x194);}return _0x4ecc1e;};}function handleError(_0x41ff6f,_0x2f5c5e){_0x2f5c5e=_0x2f5c5e||0x1f4;return function(_0x4c4fcf){logger[_0x0f41('0x26')](_0x4c4fcf[_0x0f41('0x27')]);if(_0x4c4fcf['name']){delete _0x4c4fcf[_0x0f41('0x28')];}_0x41ff6f[_0x0f41('0x1b')](_0x2f5c5e)[_0x0f41('0x29')](_0x4c4fcf);};}exports[_0x0f41('0x2a')]=function(_0xb8a42f,_0x42007b){var _0x3bc6fe={},_0x2f479d={},_0x31811d={'count':0x0,'rows':[]};var _0x569545=_[_0x0f41('0x2b')](db[_0x0f41('0x2c')]['rawAttributes'],function(_0xa659aa){return{'name':_0xa659aa[_0x0f41('0x2d')],'type':_0xa659aa[_0x0f41('0x2e')][_0x0f41('0x2f')]};});_0x2f479d[_0x0f41('0x30')]=_['map'](_0x569545,_0x0f41('0x28'));_0x2f479d[_0x0f41('0x31')]=_[_0x0f41('0x32')](_0xb8a42f[_0x0f41('0x31')]);_0x2f479d[_0x0f41('0x33')]=_[_0x0f41('0x34')](_0x2f479d[_0x0f41('0x30')],_0x2f479d['query']);_0x3bc6fe[_0x0f41('0x35')]=_[_0x0f41('0x34')](_0x2f479d[_0x0f41('0x30')],qs[_0x0f41('0x36')](_0xb8a42f[_0x0f41('0x31')][_0x0f41('0x36')]));_0x3bc6fe[_0x0f41('0x35')]=_0x3bc6fe['attributes'][_0x0f41('0x37')]?_0x3bc6fe['attributes']:_0x2f479d[_0x0f41('0x30')];if(!_0xb8a42f['query'][_0x0f41('0x38')](_0x0f41('0x39'))){_0x3bc6fe[_0x0f41('0x1e')]=qs['limit'](_0xb8a42f[_0x0f41('0x31')][_0x0f41('0x1e')]);_0x3bc6fe[_0x0f41('0x1d')]=qs[_0x0f41('0x1d')](_0xb8a42f['query'][_0x0f41('0x1d')]);}_0x3bc6fe[_0x0f41('0x3a')]=qs[_0x0f41('0x3b')](_0xb8a42f[_0x0f41('0x31')][_0x0f41('0x3b')]);_0x3bc6fe['where']=qs['filters'](_[_0x0f41('0x3c')](_0xb8a42f[_0x0f41('0x31')],_0x2f479d[_0x0f41('0x33')]));if(_0xb8a42f[_0x0f41('0x31')][_0x0f41('0x3d')]){_0x3bc6fe[_0x0f41('0x3e')]=_[_0x0f41('0x3f')](_0x3bc6fe[_0x0f41('0x3e')],{'$or':_[_0x0f41('0x2b')](_0x569545,function(_0x4ce683){if(_0x4ce683[_0x0f41('0x2e')][_0x0f41('0x2f')]!==_0x0f41('0x40')){var _0x50fcdd={};_0x50fcdd[_0x4ce683[_0x0f41('0x41')]]={'$like':'%'+_0xb8a42f[_0x0f41('0x31')]['filter']+'%'};return _0x50fcdd;}})});}_0x3bc6fe=_['merge']({},_0x3bc6fe,_0xb8a42f[_0x0f41('0x42')]);var _0x187899={'where':_0x3bc6fe['where']};return db['FreshdeskField']['count'](_0x187899)[_0x0f41('0x25')](function(_0x22c40c){_0x31811d[_0x0f41('0x43')]=_0x22c40c;if(_0xb8a42f[_0x0f41('0x31')]['includeAll']){_0x3bc6fe[_0x0f41('0x44')]=[{'all':!![]}];}return db[_0x0f41('0x2c')]['findAll'](_0x3bc6fe);})[_0x0f41('0x25')](function(_0x23c65c){_0x31811d[_0x0f41('0x45')]=_0x23c65c;return _0x31811d;})[_0x0f41('0x25')](respondWithFilteredResult(_0x42007b,_0x3bc6fe))[_0x0f41('0x46')](handleError(_0x42007b,null));};exports[_0x0f41('0x47')]=function(_0x414093,_0x8a6f35){var _0x231cda={'raw':!![],'where':{'id':_0x414093[_0x0f41('0x48')]['id']}},_0x37f7bb={};_0x37f7bb[_0x0f41('0x30')]=_[_0x0f41('0x32')](db[_0x0f41('0x2c')]['rawAttributes']);_0x37f7bb[_0x0f41('0x31')]=_[_0x0f41('0x32')](_0x414093[_0x0f41('0x31')]);_0x37f7bb[_0x0f41('0x33')]=_[_0x0f41('0x34')](_0x37f7bb['model'],_0x37f7bb['query']);_0x231cda[_0x0f41('0x35')]=_[_0x0f41('0x34')](_0x37f7bb[_0x0f41('0x30')],qs[_0x0f41('0x36')](_0x414093[_0x0f41('0x31')][_0x0f41('0x36')]));_0x231cda[_0x0f41('0x35')]=_0x231cda['attributes'][_0x0f41('0x37')]?_0x231cda[_0x0f41('0x35')]:_0x37f7bb[_0x0f41('0x30')];if(_0x414093[_0x0f41('0x31')][_0x0f41('0x49')]){_0x231cda[_0x0f41('0x44')]=[{'all':!![]}];}_0x231cda=_[_0x0f41('0x3f')]({},_0x231cda,_0x414093[_0x0f41('0x42')]);return db[_0x0f41('0x2c')][_0x0f41('0x4a')](_0x231cda)[_0x0f41('0x25')](handleEntityNotFound(_0x8a6f35,null))['then'](respondWithResult(_0x8a6f35,null))[_0x0f41('0x46')](handleError(_0x8a6f35,null));};exports[_0x0f41('0x4b')]=function(_0x2b0a1f,_0x5591f5){return db[_0x0f41('0x2c')][_0x0f41('0x4b')](_0x2b0a1f[_0x0f41('0x4c')],{})['then'](respondWithResult(_0x5591f5,0xc9))['catch'](handleError(_0x5591f5,null));};exports[_0x0f41('0x24')]=function(_0x519140,_0x8a54d4){if(_0x519140[_0x0f41('0x4c')]['id']){delete _0x519140[_0x0f41('0x4c')]['id'];}return db[_0x0f41('0x2c')]['find']({'where':{'id':_0x519140[_0x0f41('0x48')]['id']}})[_0x0f41('0x25')](handleEntityNotFound(_0x8a54d4,null))[_0x0f41('0x25')](saveUpdates(_0x519140[_0x0f41('0x4c')],null))[_0x0f41('0x25')](respondWithResult(_0x8a54d4,null))[_0x0f41('0x46')](handleError(_0x8a54d4,null));};exports['destroy']=function(_0x395b0e,_0x35ba0e){return db[_0x0f41('0x2c')]['find']({'where':{'id':_0x395b0e[_0x0f41('0x48')]['id']}})['then'](handleEntityNotFound(_0x35ba0e,null))[_0x0f41('0x25')](removeEntity(_0x35ba0e,null))['catch'](handleError(_0x35ba0e,null));}; \ No newline at end of file +var _0xcb4e=['merge','where','VIRTUAL','field','options','includeAll','include','rows','catch','show','params','length','find','create','update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','set','Content-Range','json','reject','save','then','destroy','error','name','send','map','FreshdeskField','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','nolimit','limit','order','sort','filter'];(function(_0x327817,_0x299051){var _0xa4e2f7=function(_0x2a760e){while(--_0x2a760e){_0x327817['push'](_0x327817['shift']());}};_0xa4e2f7(++_0x299051);}(_0xcb4e,0x138));var _0xecb4=function(_0x11922c,_0x1b3213){_0x11922c=_0x11922c-0x0;var _0xa4823f=_0xcb4e[_0x11922c];return _0xa4823f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xecb4('0x0'));var rimraf=require(_0xecb4('0x1'));var zipdir=require(_0xecb4('0x2'));var jsonpatch=require(_0xecb4('0x3'));var rp=require(_0xecb4('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xecb4('0x5'));var util=require('util');var path=require('path');var sox=require(_0xecb4('0x6'));var csv=require(_0xecb4('0x7'));var ejs=require(_0xecb4('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xecb4('0x9'));var crypto=require(_0xecb4('0xa'));var jsforce=require(_0xecb4('0xb'));var deskjs=require(_0xecb4('0xc'));var toCsv=require(_0xecb4('0x7'));var querystring=require(_0xecb4('0xd'));var Papa=require(_0xecb4('0xe'));var Redis=require(_0xecb4('0xf'));var authService=require(_0xecb4('0x10'));var qs=require(_0xecb4('0x11'));var as=require(_0xecb4('0x12'));var hardwareService=require(_0xecb4('0x13'));var logger=require(_0xecb4('0x14'))(_0xecb4('0x15'));var utils=require(_0xecb4('0x16'));var config=require(_0xecb4('0x17'));var db=require(_0xecb4('0x18'))['db'];function respondWithStatusCode(_0x5a40d1,_0x3c74bb){_0x3c74bb=_0x3c74bb||0xcc;return function(_0x28a9e0){if(_0x28a9e0){return _0x5a40d1[_0xecb4('0x19')](_0x3c74bb);}return _0x5a40d1[_0xecb4('0x1a')](_0x3c74bb)[_0xecb4('0x1b')]();};}function respondWithResult(_0x3e5aaf,_0x5254f7){_0x5254f7=_0x5254f7||0xc8;return function(_0x585a60){if(_0x585a60){return _0x3e5aaf[_0xecb4('0x1a')](_0x5254f7)['json'](_0x585a60);}};}function respondWithFilteredResult(_0x42f2f1,_0x1e183d){return function(_0x3eec35){if(_0x3eec35){var _0x337839=_0x3eec35[_0xecb4('0x1c')],_0x1d4dfc=_0x1e183d['offset'],_0x2484c5=_0x1e183d[_0xecb4('0x1d')]+_0x1e183d['limit'],_0x1abb58;if(_0x2484c5>=_0x337839){_0x2484c5=_0x337839;_0x1abb58=0xc8;}else{_0x1abb58=0xce;}_0x42f2f1[_0xecb4('0x1a')](_0x1abb58);return _0x42f2f1[_0xecb4('0x1e')](_0xecb4('0x1f'),_0x1d4dfc+'-'+_0x2484c5+'/'+_0x337839)[_0xecb4('0x20')](_0x3eec35);}return null;};}function patchUpdates(_0x51ac5f){return function(_0x2bf419){try{jsonpatch['apply'](_0x2bf419,_0x51ac5f,!![]);}catch(_0x55e4d3){return BPromise[_0xecb4('0x21')](_0x55e4d3);}return _0x2bf419[_0xecb4('0x22')]();};}function saveUpdates(_0x276b12,_0x3a1e64){return function(_0x2a7dd3){if(_0x2a7dd3){return _0x2a7dd3['update'](_0x276b12)[_0xecb4('0x23')](function(_0x2f3b73){return _0x2f3b73;});}return null;};}function removeEntity(_0x1244c0,_0x3e0853){return function(_0x346a36){if(_0x346a36){return _0x346a36[_0xecb4('0x24')]()[_0xecb4('0x23')](function(){_0x1244c0[_0xecb4('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x222b45,_0x17db4f){return function(_0x54b3c3){if(!_0x54b3c3){_0x222b45[_0xecb4('0x19')](0x194);}return _0x54b3c3;};}function handleError(_0x9187e8,_0x41abc9){_0x41abc9=_0x41abc9||0x1f4;return function(_0x5919fc){logger[_0xecb4('0x25')](_0x5919fc['stack']);if(_0x5919fc[_0xecb4('0x26')]){delete _0x5919fc['name'];}_0x9187e8[_0xecb4('0x1a')](_0x41abc9)[_0xecb4('0x27')](_0x5919fc);};}exports['index']=function(_0x29d144,_0x4582c6){var _0x218cdc={},_0x2292de={},_0x385bd1={'count':0x0,'rows':[]};var _0x48fc46=_[_0xecb4('0x28')](db[_0xecb4('0x29')][_0xecb4('0x2a')],function(_0x53d003){return{'name':_0x53d003[_0xecb4('0x2b')],'type':_0x53d003[_0xecb4('0x2c')][_0xecb4('0x2d')]};});_0x2292de['model']=_[_0xecb4('0x28')](_0x48fc46,'name');_0x2292de['query']=_[_0xecb4('0x2e')](_0x29d144[_0xecb4('0x2f')]);_0x2292de[_0xecb4('0x30')]=_[_0xecb4('0x31')](_0x2292de[_0xecb4('0x32')],_0x2292de['query']);_0x218cdc[_0xecb4('0x33')]=_['intersection'](_0x2292de['model'],qs[_0xecb4('0x34')](_0x29d144['query'][_0xecb4('0x34')]));_0x218cdc[_0xecb4('0x33')]=_0x218cdc[_0xecb4('0x33')]['length']?_0x218cdc[_0xecb4('0x33')]:_0x2292de['model'];if(!_0x29d144[_0xecb4('0x2f')]['hasOwnProperty'](_0xecb4('0x35'))){_0x218cdc['limit']=qs[_0xecb4('0x36')](_0x29d144['query'][_0xecb4('0x36')]);_0x218cdc[_0xecb4('0x1d')]=qs['offset'](_0x29d144[_0xecb4('0x2f')][_0xecb4('0x1d')]);}_0x218cdc[_0xecb4('0x37')]=qs['sort'](_0x29d144['query'][_0xecb4('0x38')]);_0x218cdc['where']=qs[_0xecb4('0x30')](_['pick'](_0x29d144[_0xecb4('0x2f')],_0x2292de['filters']));if(_0x29d144[_0xecb4('0x2f')][_0xecb4('0x39')]){_0x218cdc['where']=_[_0xecb4('0x3a')](_0x218cdc[_0xecb4('0x3b')],{'$or':_[_0xecb4('0x28')](_0x48fc46,function(_0x1dd025){if(_0x1dd025[_0xecb4('0x2c')][_0xecb4('0x2d')]!==_0xecb4('0x3c')){var _0xac7753={};_0xac7753[_0x1dd025[_0xecb4('0x3d')]]={'$like':'%'+_0x29d144[_0xecb4('0x2f')][_0xecb4('0x39')]+'%'};return _0xac7753;}})});}_0x218cdc=_[_0xecb4('0x3a')]({},_0x218cdc,_0x29d144[_0xecb4('0x3e')]);var _0x39799d={'where':_0x218cdc[_0xecb4('0x3b')]};return db[_0xecb4('0x29')]['count'](_0x39799d)[_0xecb4('0x23')](function(_0x2a0d37){_0x385bd1[_0xecb4('0x1c')]=_0x2a0d37;if(_0x29d144['query'][_0xecb4('0x3f')]){_0x218cdc[_0xecb4('0x40')]=[{'all':!![]}];}return db['FreshdeskField']['findAll'](_0x218cdc);})[_0xecb4('0x23')](function(_0x31d363){_0x385bd1[_0xecb4('0x41')]=_0x31d363;return _0x385bd1;})['then'](respondWithFilteredResult(_0x4582c6,_0x218cdc))[_0xecb4('0x42')](handleError(_0x4582c6,null));};exports[_0xecb4('0x43')]=function(_0x19a453,_0x3ee2af){var _0x476bd0={'raw':!![],'where':{'id':_0x19a453[_0xecb4('0x44')]['id']}},_0x1e15ff={};_0x1e15ff[_0xecb4('0x32')]=_[_0xecb4('0x2e')](db['FreshdeskField'][_0xecb4('0x2a')]);_0x1e15ff[_0xecb4('0x2f')]=_[_0xecb4('0x2e')](_0x19a453['query']);_0x1e15ff[_0xecb4('0x30')]=_[_0xecb4('0x31')](_0x1e15ff[_0xecb4('0x32')],_0x1e15ff[_0xecb4('0x2f')]);_0x476bd0[_0xecb4('0x33')]=_[_0xecb4('0x31')](_0x1e15ff[_0xecb4('0x32')],qs[_0xecb4('0x34')](_0x19a453[_0xecb4('0x2f')][_0xecb4('0x34')]));_0x476bd0[_0xecb4('0x33')]=_0x476bd0[_0xecb4('0x33')][_0xecb4('0x45')]?_0x476bd0[_0xecb4('0x33')]:_0x1e15ff['model'];if(_0x19a453[_0xecb4('0x2f')][_0xecb4('0x3f')]){_0x476bd0['include']=[{'all':!![]}];}_0x476bd0=_[_0xecb4('0x3a')]({},_0x476bd0,_0x19a453['options']);return db[_0xecb4('0x29')][_0xecb4('0x46')](_0x476bd0)['then'](handleEntityNotFound(_0x3ee2af,null))[_0xecb4('0x23')](respondWithResult(_0x3ee2af,null))[_0xecb4('0x42')](handleError(_0x3ee2af,null));};exports['create']=function(_0x58a85b,_0x32cfc7){return db[_0xecb4('0x29')][_0xecb4('0x47')](_0x58a85b['body'],{})[_0xecb4('0x23')](respondWithResult(_0x32cfc7,0xc9))['catch'](handleError(_0x32cfc7,null));};exports[_0xecb4('0x48')]=function(_0x3a2767,_0x5727fa){if(_0x3a2767[_0xecb4('0x49')]['id']){delete _0x3a2767[_0xecb4('0x49')]['id'];}return db[_0xecb4('0x29')]['find']({'where':{'id':_0x3a2767['params']['id']}})[_0xecb4('0x23')](handleEntityNotFound(_0x5727fa,null))[_0xecb4('0x23')](saveUpdates(_0x3a2767[_0xecb4('0x49')],null))['then'](respondWithResult(_0x5727fa,null))['catch'](handleError(_0x5727fa,null));};exports[_0xecb4('0x24')]=function(_0xfbe5aa,_0x2891b3){return db['FreshdeskField'][_0xecb4('0x46')]({'where':{'id':_0xfbe5aa[_0xecb4('0x44')]['id']}})[_0xecb4('0x23')](handleEntityNotFound(_0x2891b3,null))[_0xecb4('0x23')](removeEntity(_0x2891b3,null))[_0xecb4('0x42')](handleError(_0x2891b3,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 7d9c48d..262a8da 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 _0xddf7=['path','rimraf','./intFreshdeskField.attributes','exports','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','lodash','../../config/logger','api','moment','bluebird'];(function(_0x17307c,_0x3a27ff){var _0x2592ea=function(_0x3ea97c){while(--_0x3ea97c){_0x17307c['push'](_0x17307c['shift']());}};_0x2592ea(++_0x3a27ff);}(_0xddf7,0x121));var _0x7ddf=function(_0x5c6361,_0x55c253){_0x5c6361=_0x5c6361-0x0;var _0x40729f=_0xddf7[_0x5c6361];return _0x40729f;};'use strict';var _=require(_0x7ddf('0x0'));var util=require('util');var logger=require(_0x7ddf('0x1'))(_0x7ddf('0x2'));var moment=require(_0x7ddf('0x3'));var BPromise=require(_0x7ddf('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7ddf('0x5'));var rimraf=require(_0x7ddf('0x6'));var config=require('../../config/environment');var attributes=require(_0x7ddf('0x7'));module[_0x7ddf('0x8')]=function(_0x50726b,_0x2f013a){return _0x50726b[_0x7ddf('0x9')](_0x7ddf('0xa'),attributes,{'tableName':_0x7ddf('0xb'),'paranoid':![],'indexes':[{'name':_0x7ddf('0xc'),'fields':[_0x7ddf('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0a15=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','define','FreshdeskField','freshdesk_unique_index','idField','FieldId','lodash','api'];(function(_0x42b92a,_0x250330){var _0x46ea82=function(_0xb9483e){while(--_0xb9483e){_0x42b92a['push'](_0x42b92a['shift']());}};_0x46ea82(++_0x250330);}(_0x0a15,0x67));var _0x50a1=function(_0x2adbeb,_0x5581be){_0x2adbeb=_0x2adbeb-0x0;var _0x5e18a6=_0x0a15[_0x2adbeb];return _0x5e18a6;};'use strict';var _=require(_0x50a1('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x50a1('0x1'));var moment=require(_0x50a1('0x2'));var BPromise=require(_0x50a1('0x3'));var rp=require(_0x50a1('0x4'));var fs=require('fs');var path=require(_0x50a1('0x5'));var rimraf=require(_0x50a1('0x6'));var config=require(_0x50a1('0x7'));var attributes=require(_0x50a1('0x8'));module[_0x50a1('0x9')]=function(_0x232bbf,_0x5094a0){return _0x232bbf[_0x50a1('0xa')](_0x50a1('0xb'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0x50a1('0xc'),'fields':[_0x50a1('0xd'),_0x50a1('0xe')],'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 05393a7..32a35cc 100644 --- a/server/api/intFreshdeskField/intFreshdeskField.rpc.js +++ b/server/api/intFreshdeskField/intFreshdeskField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['info','FreshdeskField,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x7a54,0x106));var _0x47a5=function(_0x278115,_0x3405c7){_0x278115=_0x278115-0x0;var _0x3274d5=_0x7a54[_0x278115];return _0x3274d5;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0xb10b=['stringify','error','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshdeskField,\x20%s,\x20%s','FreshdeskField,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x3bc3a3,_0x5313b7){var _0x1d2f99=function(_0x4ce44c){while(--_0x4ce44c){_0x3bc3a3['push'](_0x3bc3a3['shift']());}};_0x1d2f99(++_0x5313b7);}(_0xb10b,0x12a));var _0xbb10=function(_0x19e9a7,_0x57e686){_0x19e9a7=_0x19e9a7-0x0;var _0x3a8442=_0xb10b[_0x19e9a7];return _0x3a8442;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index ff1aa79..dbc1b36 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 _0x3b34=['getConfigurations','/:id/fields','getFields','create','post','addConfiguration','put','update','delete','destroy','exports','multer','util','path','express','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations'];(function(_0x5b0070,_0x4d121d){var _0x48df63=function(_0x4475fd){while(--_0x4475fd){_0x5b0070['push'](_0x5b0070['shift']());}};_0x48df63(++_0x4d121d);}(_0x3b34,0xe3));var _0x43b3=function(_0x5b274d,_0x25f421){_0x5b274d=_0x5b274d-0x0;var _0x1bc220=_0x3b34[_0x5b274d];return _0x1bc220;};'use strict';var multer=require(_0x43b3('0x0'));var util=require(_0x43b3('0x1'));var path=require(_0x43b3('0x2'));var timeout=require('connect-timeout');var express=require(_0x43b3('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x43b3('0x4'));var config=require(_0x43b3('0x5'));var controller=require(_0x43b3('0x6'));router[_0x43b3('0x7')]('/',auth[_0x43b3('0x8')](),controller[_0x43b3('0x9')]);router['get'](_0x43b3('0xa'),auth[_0x43b3('0x8')](),controller[_0x43b3('0xb')]);router[_0x43b3('0x7')](_0x43b3('0xc'),auth[_0x43b3('0x8')](),controller[_0x43b3('0xd')]);router[_0x43b3('0x7')](_0x43b3('0xe'),auth[_0x43b3('0x8')](),controller[_0x43b3('0xf')]);router['post']('/',auth[_0x43b3('0x8')](),controller[_0x43b3('0x10')]);router[_0x43b3('0x11')](_0x43b3('0xc'),auth[_0x43b3('0x8')](),controller[_0x43b3('0x12')]);router[_0x43b3('0x13')](_0x43b3('0xa'),auth[_0x43b3('0x8')](),controller[_0x43b3('0x14')]);router[_0x43b3('0x15')](_0x43b3('0xa'),auth[_0x43b3('0x8')](),controller[_0x43b3('0x16')]);module[_0x43b3('0x17')]=router; \ No newline at end of file +var _0x0324=['express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','addConfiguration','put','update','delete','destroy','multer','util','connect-timeout'];(function(_0x54a479,_0x1b321d){var _0x2474ab=function(_0x428755){while(--_0x428755){_0x54a479['push'](_0x54a479['shift']());}};_0x2474ab(++_0x1b321d);}(_0x0324,0x1e0));var _0x4032=function(_0x4e44b0,_0x3d79a0){_0x4e44b0=_0x4e44b0-0x0;var _0x16874e=_0x0324[_0x4e44b0];return _0x16874e;};'use strict';var multer=require(_0x4032('0x0'));var util=require(_0x4032('0x1'));var path=require('path');var timeout=require(_0x4032('0x2'));var express=require(_0x4032('0x3'));var router=express[_0x4032('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x4032('0x5'));var config=require(_0x4032('0x6'));var controller=require('./intSalesforceAccount.controller');router[_0x4032('0x7')]('/',auth[_0x4032('0x8')](),controller[_0x4032('0x9')]);router[_0x4032('0x7')]('/:id',auth[_0x4032('0x8')](),controller[_0x4032('0xa')]);router[_0x4032('0x7')](_0x4032('0xb'),auth['isAuthenticated'](),controller[_0x4032('0xc')]);router[_0x4032('0x7')](_0x4032('0xd'),auth[_0x4032('0x8')](),controller[_0x4032('0xe')]);router['post']('/',auth[_0x4032('0x8')](),controller[_0x4032('0xf')]);router['post']('/:id/configurations',auth[_0x4032('0x8')](),controller[_0x4032('0x10')]);router[_0x4032('0x11')]('/:id',auth[_0x4032('0x8')](),controller[_0x4032('0x12')]);router[_0x4032('0x13')]('/:id',auth[_0x4032('0x8')](),controller[_0x4032('0x14')]);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 0a1f6f0..2b99d93 100644 --- a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js +++ b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['STRING','username','ENUM','integrationTab','newTab','sequelize','exports'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0xc4aa[_0x2d2c16];return _0x53f2fb;};'use strict';var Sequelize=require(_0xac4a('0x0'));module[_0xac4a('0x1')]={'name':{'type':Sequelize[_0xac4a('0x2')]},'description':{'type':Sequelize[_0xac4a('0x2')]},'username':{'type':Sequelize[_0xac4a('0x2')],'unique':_0xac4a('0x3')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0xac4a('0x2')]},'securityToken':{'type':Sequelize[_0xac4a('0x2')]},'serverUrl':{'type':Sequelize[_0xac4a('0x2')]},'type':{'type':Sequelize[_0xac4a('0x4')](_0xac4a('0x5'),_0xac4a('0x6')),'defaultValue':_0xac4a('0x5')}}; \ No newline at end of file +var _0xf494=['exports','STRING','username','ENUM','integrationTab','newTab','sequelize'];(function(_0x38eec8,_0x581108){var _0x30ca06=function(_0x4f08d4){while(--_0x4f08d4){_0x38eec8['push'](_0x38eec8['shift']());}};_0x30ca06(++_0x581108);}(_0xf494,0x1c6));var _0x4f49=function(_0x5676d3,_0x582062){_0x5676d3=_0x5676d3-0x0;var _0x573736=_0xf494[_0x5676d3];return _0x573736;};'use strict';var Sequelize=require(_0x4f49('0x0'));module[_0x4f49('0x1')]={'name':{'type':Sequelize[_0x4f49('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x4f49('0x2')],'unique':_0x4f49('0x3')},'remoteUri':{'type':Sequelize[_0x4f49('0x2')]},'password':{'type':Sequelize[_0x4f49('0x2')]},'clientId':{'type':Sequelize[_0x4f49('0x2')]},'clientSecret':{'type':Sequelize[_0x4f49('0x2')]},'securityToken':{'type':Sequelize[_0x4f49('0x2')]},'serverUrl':{'type':Sequelize[_0x4f49('0x2')]},'type':{'type':Sequelize[_0x4f49('0x4')](_0x4f49('0x5'),_0x4f49('0x6')),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 746a818..248ee42 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 _0x4796=['remoteUri','clientSecret','username','password','securityToken','substring','lastIndexOf','clientId','login','isNil','ticketType','sobject','CallDisposition','CallDurationInSeconds','CallObject','CallType','Priority','Status','Type','Case','Origin','Reason','IsEscalated','remove','includes','label','picklistValues','value','True','true','False','false','test','getFields,\x20%s,\x20%s,\x20%s','getFields','send','statusCode','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','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','SalesforceAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','catch','sendStatus','end','status','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','name','index','map','SalesforceAccount','fieldName','type','model','keys','query','attributes','intersection','fields','length','nolimit','limit','sort','where','filters','merge','key','VIRTUAL','field','filter','options','includeAll','include','findAll','show','params','rawAttributes','find','create','body','findOne','SalesforceConfiguration','order','pick','getConfigurations','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','SalesforceField','Task'];(function(_0x57d0c0,_0x4103a7){var _0x5f0155=function(_0x312d93){while(--_0x312d93){_0x57d0c0['push'](_0x57d0c0['shift']());}};_0x5f0155(++_0x4103a7);}(_0x4796,0x1c0));var _0x6479=function(_0x10750f,_0x1f3b0a){_0x10750f=_0x10750f-0x0;var _0x1cf955=_0x4796[_0x10750f];return _0x1cf955;};'use strict';var pdf=require(_0x6479('0x0'));var emlformat=require(_0x6479('0x1'));var rimraf=require(_0x6479('0x2'));var zipdir=require(_0x6479('0x3'));var jsonpatch=require(_0x6479('0x4'));var rp=require(_0x6479('0x5'));var moment=require(_0x6479('0x6'));var BPromise=require(_0x6479('0x7'));var Mustache=require(_0x6479('0x8'));var util=require(_0x6479('0x9'));var path=require('path');var sox=require('sox');var csv=require(_0x6479('0xa'));var ejs=require(_0x6479('0xb'));var fs=require('fs');var _=require(_0x6479('0xc'));var squel=require(_0x6479('0xd'));var crypto=require(_0x6479('0xe'));var jsforce=require(_0x6479('0xf'));var deskjs=require(_0x6479('0x10'));var toCsv=require(_0x6479('0xa'));var querystring=require(_0x6479('0x11'));var Papa=require(_0x6479('0x12'));var Redis=require('ioredis');var authService=require(_0x6479('0x13'));var qs=require(_0x6479('0x14'));var as=require(_0x6479('0x15'));var hardwareService=require(_0x6479('0x16'));var logger=require(_0x6479('0x17'))(_0x6479('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x6479('0x19'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x6479('0x1a'));var client=jayson['client'][_0x6479('0x1b')]({'port':0x232a});function checkPasswordPattern(_0xca2da1,_0x391a38,_0x38f61e){if(_0x38f61e){var _0x407962=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x407962['test'](_0x391a38)){return _0xca2da1;}else{throw new Error(_0x6479('0x1c'));}}else{return _0xca2da1;}}function respondWithRpcPromise(_0x2046e1,_0x29d47d,_0x2a24f6,_0x4fe8f0){return new BPromise(function(_0x93fe54,_0x57d9df){var _0x9d4e9e=_0x4fe8f0||client;return _0x9d4e9e[_0x6479('0x1d')](_0x2046e1,_0x2a24f6)[_0x6479('0x1e')](function(_0x3cf34f){logger['info'](_0x6479('0x1f'),_0x29d47d,'request\x20sent');logger[_0x6479('0x20')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x29d47d,_0x6479('0x21'),JSON[_0x6479('0x22')](_0x3cf34f));if(_0x3cf34f['error']){if(_0x3cf34f[_0x6479('0x23')][_0x6479('0x24')]===0x1f4){logger[_0x6479('0x23')]('SalesforceAccount,\x20%s,\x20%s',_0x29d47d,_0x3cf34f[_0x6479('0x23')][_0x6479('0x25')]);return _0x57d9df(_0x3cf34f[_0x6479('0x23')][_0x6479('0x25')]);}logger['error'](_0x6479('0x1f'),_0x29d47d,_0x3cf34f['error'][_0x6479('0x25')]);return _0x93fe54(_0x3cf34f['error']['message']);}else{logger[_0x6479('0x26')](_0x6479('0x1f'),_0x29d47d,'request\x20sent');_0x93fe54(_0x3cf34f['result'][_0x6479('0x25')]);}})[_0x6479('0x27')](function(_0x25bb2c){logger[_0x6479('0x23')](_0x6479('0x1f'),_0x29d47d,_0x25bb2c);_0x57d9df(_0x25bb2c);});});}function respondWithStatusCode(_0x9a5e1f,_0x3da4cc){_0x3da4cc=_0x3da4cc||0xcc;return function(_0x19c572){if(_0x19c572){return _0x9a5e1f[_0x6479('0x28')](_0x3da4cc);}return _0x9a5e1f['status'](_0x3da4cc)[_0x6479('0x29')]();};}function respondWithResult(_0x58ff7b,_0xaee7cd){_0xaee7cd=_0xaee7cd||0xc8;return function(_0x3f41dc){if(_0x3f41dc){return _0x58ff7b[_0x6479('0x2a')](_0xaee7cd)[_0x6479('0x2b')](_0x3f41dc);}};}function respondWithFilteredResult(_0xafbe96,_0x929e43){return function(_0x409b7a){if(_0x409b7a){var _0xbe9982=_0x409b7a[_0x6479('0x2c')],_0x3248c1=_0x929e43[_0x6479('0x2d')],_0x9df657=_0x929e43[_0x6479('0x2d')]+_0x929e43['limit'],_0xaa21fc;if(_0x9df657>=_0xbe9982){_0x9df657=_0xbe9982;_0xaa21fc=0xc8;}else{_0xaa21fc=0xce;}_0xafbe96[_0x6479('0x2a')](_0xaa21fc);return _0xafbe96[_0x6479('0x2e')](_0x6479('0x2f'),_0x3248c1+'-'+_0x9df657+'/'+_0xbe9982)[_0x6479('0x2b')](_0x409b7a);}return null;};}function patchUpdates(_0x14dc4e){return function(_0x1fd34a){try{jsonpatch[_0x6479('0x30')](_0x1fd34a,_0x14dc4e,!![]);}catch(_0x1bf826){return BPromise[_0x6479('0x31')](_0x1bf826);}return _0x1fd34a[_0x6479('0x32')]();};}function saveUpdates(_0x1e404c,_0x5a9c50){return function(_0x14a9fb){if(_0x14a9fb){return _0x14a9fb[_0x6479('0x33')](_0x1e404c)[_0x6479('0x1e')](function(_0xf78599){return _0xf78599;});}return null;};}function removeEntity(_0x556d8a,_0x121e41){return function(_0x5a1bf5){if(_0x5a1bf5){return _0x5a1bf5[_0x6479('0x34')]()['then'](function(){_0x556d8a[_0x6479('0x2a')](0xcc)[_0x6479('0x29')]();});}};}function handleEntityNotFound(_0x58e77b,_0x5cbacd){return function(_0x4618ea){if(!_0x4618ea){_0x58e77b[_0x6479('0x28')](0x194);}return _0x4618ea;};}function handleError(_0x1fe846,_0x3f037a){_0x3f037a=_0x3f037a||0x1f4;return function(_0x2578c7){logger[_0x6479('0x23')](_0x2578c7['stack']);if(_0x2578c7[_0x6479('0x35')]){delete _0x2578c7['name'];}_0x1fe846['status'](_0x3f037a)['send'](_0x2578c7);};}exports[_0x6479('0x36')]=function(_0x15f4d5,_0x4e3cea){var _0x197a7a={},_0x3da7fb={},_0x3bb88a={'count':0x0,'rows':[]};var _0x12574f=_[_0x6479('0x37')](db[_0x6479('0x38')]['rawAttributes'],function(_0x18f21a){return{'name':_0x18f21a[_0x6479('0x39')],'type':_0x18f21a[_0x6479('0x3a')]['key']};});_0x3da7fb[_0x6479('0x3b')]=_[_0x6479('0x37')](_0x12574f,_0x6479('0x35'));_0x3da7fb['query']=_[_0x6479('0x3c')](_0x15f4d5['query']);_0x3da7fb['filters']=_['intersection'](_0x3da7fb['model'],_0x3da7fb[_0x6479('0x3d')]);_0x197a7a[_0x6479('0x3e')]=_[_0x6479('0x3f')](_0x3da7fb[_0x6479('0x3b')],qs[_0x6479('0x40')](_0x15f4d5['query'][_0x6479('0x40')]));_0x197a7a[_0x6479('0x3e')]=_0x197a7a['attributes'][_0x6479('0x41')]?_0x197a7a[_0x6479('0x3e')]:_0x3da7fb['model'];if(!_0x15f4d5['query']['hasOwnProperty'](_0x6479('0x42'))){_0x197a7a[_0x6479('0x43')]=qs[_0x6479('0x43')](_0x15f4d5[_0x6479('0x3d')]['limit']);_0x197a7a['offset']=qs[_0x6479('0x2d')](_0x15f4d5[_0x6479('0x3d')][_0x6479('0x2d')]);}_0x197a7a['order']=qs[_0x6479('0x44')](_0x15f4d5[_0x6479('0x3d')][_0x6479('0x44')]);_0x197a7a[_0x6479('0x45')]=qs[_0x6479('0x46')](_['pick'](_0x15f4d5[_0x6479('0x3d')],_0x3da7fb['filters']));if(_0x15f4d5['query']['filter']){_0x197a7a[_0x6479('0x45')]=_[_0x6479('0x47')](_0x197a7a[_0x6479('0x45')],{'$or':_[_0x6479('0x37')](_0x12574f,function(_0x269aa8){if(_0x269aa8[_0x6479('0x3a')][_0x6479('0x48')]!==_0x6479('0x49')){var _0x1c8f5a={};_0x1c8f5a[_0x269aa8[_0x6479('0x4a')]]={'$like':'%'+_0x15f4d5[_0x6479('0x3d')][_0x6479('0x4b')]+'%'};return _0x1c8f5a;}})});}_0x197a7a=_['merge']({},_0x197a7a,_0x15f4d5[_0x6479('0x4c')]);var _0x16e0ab={'where':_0x197a7a['where']};return db[_0x6479('0x38')]['count'](_0x16e0ab)[_0x6479('0x1e')](function(_0x1f7078){_0x3bb88a['count']=_0x1f7078;if(_0x15f4d5[_0x6479('0x3d')][_0x6479('0x4d')]){_0x197a7a[_0x6479('0x4e')]=[{'all':!![]}];}return db[_0x6479('0x38')][_0x6479('0x4f')](_0x197a7a);})[_0x6479('0x1e')](function(_0x52454a){_0x3bb88a['rows']=_0x52454a;return _0x3bb88a;})['then'](respondWithFilteredResult(_0x4e3cea,_0x197a7a))[_0x6479('0x27')](handleError(_0x4e3cea,null));};exports[_0x6479('0x50')]=function(_0x4a5073,_0x28c6bb){var _0x125987={'raw':![],'where':{'id':_0x4a5073[_0x6479('0x51')]['id']}},_0x15c96d={};_0x15c96d[_0x6479('0x3b')]=_['keys'](db[_0x6479('0x38')][_0x6479('0x52')]);_0x15c96d['query']=_['keys'](_0x4a5073['query']);_0x15c96d[_0x6479('0x46')]=_[_0x6479('0x3f')](_0x15c96d['model'],_0x15c96d[_0x6479('0x3d')]);_0x125987[_0x6479('0x3e')]=_[_0x6479('0x3f')](_0x15c96d['model'],qs['fields'](_0x4a5073[_0x6479('0x3d')][_0x6479('0x40')]));_0x125987[_0x6479('0x3e')]=_0x125987[_0x6479('0x3e')][_0x6479('0x41')]?_0x125987[_0x6479('0x3e')]:_0x15c96d['model'];if(_0x4a5073[_0x6479('0x3d')][_0x6479('0x4d')]){_0x125987[_0x6479('0x4e')]=[{'all':!![]}];}_0x125987=_[_0x6479('0x47')]({},_0x125987,_0x4a5073[_0x6479('0x4c')]);return db[_0x6479('0x38')][_0x6479('0x53')](_0x125987)[_0x6479('0x1e')](handleEntityNotFound(_0x28c6bb,null))[_0x6479('0x1e')](respondWithResult(_0x28c6bb,null))['catch'](handleError(_0x28c6bb,null));};exports[_0x6479('0x54')]=function(_0x52eca0,_0x2902c3){return db[_0x6479('0x38')]['create'](_0x52eca0[_0x6479('0x55')],{})[_0x6479('0x1e')](respondWithResult(_0x2902c3,0xc9))[_0x6479('0x27')](handleError(_0x2902c3,null));};exports[_0x6479('0x33')]=function(_0x520fcb,_0x4ceb9c){if(_0x520fcb['body']['id']){delete _0x520fcb[_0x6479('0x55')]['id'];}return db[_0x6479('0x38')][_0x6479('0x53')]({'where':{'id':_0x520fcb[_0x6479('0x51')]['id']}})[_0x6479('0x1e')](handleEntityNotFound(_0x4ceb9c,null))['then'](saveUpdates(_0x520fcb[_0x6479('0x55')],null))[_0x6479('0x1e')](respondWithResult(_0x4ceb9c,null))[_0x6479('0x27')](handleError(_0x4ceb9c,null));};exports[_0x6479('0x34')]=function(_0x58e074,_0x1cc307){return db[_0x6479('0x38')][_0x6479('0x53')]({'where':{'id':_0x58e074['params']['id']}})['then'](handleEntityNotFound(_0x1cc307,null))[_0x6479('0x1e')](removeEntity(_0x1cc307,null))[_0x6479('0x27')](handleError(_0x1cc307,null));};exports['getConfigurations']=function(_0x4b4974,_0x4e7fa4,_0xdeea8b){var _0x4d3496={};var _0xaba0e8={};var _0x14fb46;var _0x55a222;return db['SalesforceAccount'][_0x6479('0x56')]({'where':{'id':_0x4b4974['params']['id']}})[_0x6479('0x1e')](handleEntityNotFound(_0x4e7fa4,null))[_0x6479('0x1e')](function(_0x160949){if(_0x160949){_0x14fb46=_0x160949;_0xaba0e8[_0x6479('0x3b')]=_[_0x6479('0x3c')](db[_0x6479('0x57')]['rawAttributes']);_0xaba0e8[_0x6479('0x3d')]=_[_0x6479('0x3c')](_0x4b4974[_0x6479('0x3d')]);_0xaba0e8['filters']=_[_0x6479('0x3f')](_0xaba0e8[_0x6479('0x3b')],_0xaba0e8[_0x6479('0x3d')]);_0x4d3496['attributes']=_[_0x6479('0x3f')](_0xaba0e8[_0x6479('0x3b')],qs[_0x6479('0x40')](_0x4b4974[_0x6479('0x3d')][_0x6479('0x40')]));_0x4d3496['attributes']=_0x4d3496['attributes'][_0x6479('0x41')]?_0x4d3496[_0x6479('0x3e')]:_0xaba0e8[_0x6479('0x3b')];_0x4d3496[_0x6479('0x58')]=qs['sort'](_0x4b4974[_0x6479('0x3d')]['sort']);_0x4d3496['where']=qs[_0x6479('0x46')](_[_0x6479('0x59')](_0x4b4974['query'],_0xaba0e8[_0x6479('0x46')]));if(_0x4b4974[_0x6479('0x3d')][_0x6479('0x4b')]){_0x4d3496[_0x6479('0x45')]=_['merge'](_0x4d3496[_0x6479('0x45')],{'$or':_[_0x6479('0x37')](_0x4d3496[_0x6479('0x3e')],function(_0x53fd33){var _0x3c91b7={};_0x3c91b7[_0x53fd33]={'$like':'%'+_0x4b4974[_0x6479('0x3d')]['filter']+'%'};return _0x3c91b7;})});}_0x4d3496=_['merge']({},_0x4d3496,_0x4b4974[_0x6479('0x4c')]);return _0x14fb46[_0x6479('0x5a')](_0x4d3496);}})[_0x6479('0x1e')](function(_0x5f13ce){if(_0x5f13ce){_0x55a222=_0x5f13ce[_0x6479('0x41')];if(!_0x4b4974['query'][_0x6479('0x5b')](_0x6479('0x42'))){_0x4d3496['limit']=qs['limit'](_0x4b4974[_0x6479('0x3d')][_0x6479('0x43')]);_0x4d3496[_0x6479('0x2d')]=qs[_0x6479('0x2d')](_0x4b4974[_0x6479('0x3d')][_0x6479('0x2d')]);}return _0x14fb46['getConfigurations'](_0x4d3496);}})['then'](function(_0x4716ba){if(_0x4716ba){return _0x4716ba?{'count':_0x55a222,'rows':_0x4716ba}:null;}})['then'](respondWithResult(_0x4e7fa4,null))[_0x6479('0x27')](handleError(_0x4e7fa4,null));};exports[_0x6479('0x5c')]=function(_0x54a09a,_0x4e7dc9,_0x10a29d){if(_0x54a09a[_0x6479('0x55')]['id']){delete _0x54a09a['body']['id'];}return db[_0x6479('0x38')][_0x6479('0x56')]({'where':{'id':_0x54a09a[_0x6479('0x51')]['id']}})[_0x6479('0x1e')](handleEntityNotFound(_0x4e7dc9,null))[_0x6479('0x1e')](function(_0x353a8a){if(_0x353a8a){_0x54a09a[_0x6479('0x55')][_0x6479('0x5d')]=_0x353a8a['id'];_0x54a09a['body'][_0x6479('0x5e')]=integrations[_0x6479('0x5f')](_0x54a09a['body'][_0x6479('0x60')],_0x54a09a[_0x6479('0x55')][_0x6479('0x3a')]);_0x54a09a[_0x6479('0x55')][_0x6479('0x61')]=integrations['getDescriptions'](_0x54a09a[_0x6479('0x55')][_0x6479('0x60')],_0x54a09a[_0x6479('0x55')][_0x6479('0x3a')]);return db[_0x6479('0x57')][_0x6479('0x54')](_0x54a09a[_0x6479('0x55')],{'include':[{'model':db['SalesforceField'],'as':_0x6479('0x5e')},{'model':db[_0x6479('0x62')],'as':_0x6479('0x61')}]});}return null;})['then'](respondWithResult(_0x4e7dc9,null))[_0x6479('0x27')](handleError(_0x4e7dc9,null));};exports['getFields']=function(_0x520267,_0x1d2200,_0x281435){var _0x419d10;var _0x1898d3='';var _0xba9f92=_0x6479('0x63');return db['SalesforceAccount'][_0x6479('0x56')]({'where':{'id':_0x520267[_0x6479('0x51')]['id']},'attributes':['id',_0x6479('0x64'),'clientId',_0x6479('0x65'),_0x6479('0x66'),_0x6479('0x67'),_0x6479('0x68')]})['then'](handleEntityNotFound(_0x1d2200,null))[_0x6479('0x1e')](function(_0x584a5f){if(_0x584a5f){_0x1898d3=_0x584a5f[_0x6479('0x64')];var _0x2dce81=_0x1898d3['slice'](-0x1);if(_0x2dce81==='/'){_0x1898d3=_0x1898d3[_0x6479('0x69')](0x0,_0x1898d3[_0x6479('0x6a')](_0x2dce81));}_0x419d10=new jsforce['Connection']({'oauth2':{'loginUrl':_0x1898d3,'clientId':_0x584a5f[_0x6479('0x6b')],'clientSecret':_0x584a5f[_0x6479('0x65')]}});return _0x419d10[_0x6479('0x6c')](_0x584a5f[_0x6479('0x66')],_0x584a5f[_0x6479('0x67')]['concat'](_0x584a5f[_0x6479('0x68')]));}})[_0x6479('0x1e')](function(_0x165eb0){if(_0x165eb0){if(!_[_0x6479('0x6d')](_0x520267[_0x6479('0x3d')][_0x6479('0x6e')])){_0xba9f92=_0x520267['query']['ticketType'];}return _0x419d10[_0x6479('0x6f')](_0xba9f92)['describe']();}})[_0x6479('0x1e')](function(_0x8a69bb){var _0x5354d7=[_0x6479('0x70'),_0x6479('0x71'),_0x6479('0x72'),_0x6479('0x73'),'IsArchived',_0x6479('0x74'),_0x6479('0x75'),_0x6479('0x76')];if(!_[_0x6479('0x6d')](_0x520267['query']['ticketType'])&&_0x520267[_0x6479('0x3d')][_0x6479('0x6e')]===_0x6479('0x77')){_0x5354d7=['Type',_0x6479('0x78'),_0x6479('0x79'),_0x6479('0x75'),'Priority',_0x6479('0x7a'),'SuppliedName','SuppliedCompany'];}if(_0x8a69bb){_[_0x6479('0x7b')](_0x8a69bb['fields'],function(_0x5088f0){return _0x5088f0['custom']===![]&&!_0x5354d7[_0x6479('0x7c')](_0x5088f0['name']);});return{'count':_0x8a69bb['fields'][_0x6479('0x41')],'rows':_['map'](_0x8a69bb[_0x6479('0x40')],function(_0x209afe){return{'id':_0x209afe['name'],'name':_0x209afe[_0x6479('0x7d')],'custom':_0x209afe['custom'],'options':_0x209afe[_0x6479('0x7e')][_0x6479('0x41')]>0x0?_[_0x6479('0x37')](_0x209afe[_0x6479('0x7e')],function(_0x5a00be){return{'name':_0x5a00be[_0x6479('0x7d')],'value':_0x5a00be[_0x6479('0x7f')]};}):_0x209afe[_0x6479('0x3a')]=='boolean'?[{'name':_0x6479('0x80'),'value':_0x6479('0x81')},{'name':_0x6479('0x82'),'value':_0x6479('0x83')}]:[]};})};}})[_0x6479('0x1e')](respondWithResult(_0x1d2200,null))[_0x6479('0x27')](function(_0xeb032e){var _0x3cd6ef=_0x520267[_0x6479('0x3d')][_0x6479('0x84')]?0x1f4:_0xeb032e['statusCode']||0x1f4;logger[_0x6479('0x23')](_0x6479('0x85'),_0x6479('0x86'),_0x3cd6ef,JSON[_0x6479('0x22')](_0xeb032e));delete _0xeb032e[_0x6479('0x35')];if(_0x3cd6ef===0x191){_0x3cd6ef=0x190;}_0x1d2200['status'](_0x3cd6ef)[_0x6479('0x87')](_0x520267[_0x6479('0x3d')][_0x6479('0x84')]?{'message':'Wrong\x20credentials','statusCode':_0xeb032e[_0x6479('0x88')]}:_0xeb032e);});}; \ No newline at end of file +var _0x38b0=['custom','includes','label','picklistValues','value','boolean','true','False','false','statusCode','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','to-csv','ejs','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','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','SalesforceAccount,\x20%s,\x20%s','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','end','status','json','count','offset','limit','set','reject','save','update','destroy','sendStatus','stack','name','send','index','map','SalesforceAccount','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','field','options','includeAll','include','findAll','params','keys','find','create','body','getConfigurations','rawAttributes','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SalesforceConfiguration','SalesforceField','getFields','Task','remoteUri','clientId','clientSecret','securityToken','lastIndexOf','Connection','login','username','password','concat','ticketType','sobject','describe','CallDurationInSeconds','CallObject','CallType','IsArchived','Priority','Status','Type','Case','Origin','Reason','IsEscalated','SuppliedName','SuppliedCompany','remove'];(function(_0x47956a,_0x5e87cd){var _0x5582eb=function(_0x24532){while(--_0x24532){_0x47956a['push'](_0x47956a['shift']());}};_0x5582eb(++_0x5e87cd);}(_0x38b0,0x117));var _0x038b=function(_0x5e28c2,_0x1e48ab){_0x5e28c2=_0x5e28c2-0x0;var _0x1a8cc6=_0x38b0[_0x5e28c2];return _0x1a8cc6;};'use strict';var pdf=require(_0x038b('0x0'));var emlformat=require(_0x038b('0x1'));var rimraf=require(_0x038b('0x2'));var zipdir=require(_0x038b('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x038b('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x038b('0x5'));var util=require(_0x038b('0x6'));var path=require(_0x038b('0x7'));var sox=require('sox');var csv=require(_0x038b('0x8'));var ejs=require(_0x038b('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x038b('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x038b('0xb'));var toCsv=require('to-csv');var querystring=require(_0x038b('0xc'));var Papa=require(_0x038b('0xd'));var Redis=require(_0x038b('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x038b('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x038b('0x10'));var logger=require(_0x038b('0x11'))(_0x038b('0x12'));var utils=require(_0x038b('0x13'));var config=require(_0x038b('0x14'));var db=require(_0x038b('0x15'))['db'];var integrations=require(_0x038b('0x16'));var jayson=require(_0x038b('0x17'));var client=jayson[_0x038b('0x18')]['http']({'port':0x232a});function checkPasswordPattern(_0x254069,_0x341ff0,_0x4da4ff){if(_0x4da4ff){var _0x135c95=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x135c95[_0x038b('0x19')](_0x341ff0)){return _0x254069;}else{throw new Error(_0x038b('0x1a'));}}else{return _0x254069;}}function respondWithRpcPromise(_0x54e0a7,_0x5b0c3e,_0x55bcb4,_0xaaef1b){return new BPromise(function(_0x32899b,_0x207cd4){var _0x40d45e=_0xaaef1b||client;return _0x40d45e[_0x038b('0x1b')](_0x54e0a7,_0x55bcb4)[_0x038b('0x1c')](function(_0x5e00a4){logger['info'](_0x038b('0x1d'),_0x5b0c3e,'request\x20sent');logger[_0x038b('0x1e')](_0x038b('0x1f'),_0x5b0c3e,'request\x20sent',JSON[_0x038b('0x20')](_0x5e00a4));if(_0x5e00a4[_0x038b('0x21')]){if(_0x5e00a4[_0x038b('0x21')]['code']===0x1f4){logger['error'](_0x038b('0x1d'),_0x5b0c3e,_0x5e00a4[_0x038b('0x21')][_0x038b('0x22')]);return _0x207cd4(_0x5e00a4[_0x038b('0x21')][_0x038b('0x22')]);}logger[_0x038b('0x21')](_0x038b('0x1d'),_0x5b0c3e,_0x5e00a4[_0x038b('0x21')][_0x038b('0x22')]);return _0x32899b(_0x5e00a4[_0x038b('0x21')][_0x038b('0x22')]);}else{logger['info'](_0x038b('0x1d'),_0x5b0c3e,'request\x20sent');_0x32899b(_0x5e00a4[_0x038b('0x23')][_0x038b('0x22')]);}})[_0x038b('0x24')](function(_0x21771b){logger[_0x038b('0x21')]('SalesforceAccount,\x20%s,\x20%s',_0x5b0c3e,_0x21771b);_0x207cd4(_0x21771b);});});}function respondWithStatusCode(_0x5d4935,_0x339d0b){_0x339d0b=_0x339d0b||0xcc;return function(_0x1fa859){if(_0x1fa859){return _0x5d4935['sendStatus'](_0x339d0b);}return _0x5d4935['status'](_0x339d0b)[_0x038b('0x25')]();};}function respondWithResult(_0x57611f,_0x270265){_0x270265=_0x270265||0xc8;return function(_0x3b60b5){if(_0x3b60b5){return _0x57611f[_0x038b('0x26')](_0x270265)[_0x038b('0x27')](_0x3b60b5);}};}function respondWithFilteredResult(_0x5ac085,_0x3211ec){return function(_0x53b0cb){if(_0x53b0cb){var _0xab6482=_0x53b0cb[_0x038b('0x28')],_0x56b8ca=_0x3211ec[_0x038b('0x29')],_0x3f1eef=_0x3211ec[_0x038b('0x29')]+_0x3211ec[_0x038b('0x2a')],_0x160db1;if(_0x3f1eef>=_0xab6482){_0x3f1eef=_0xab6482;_0x160db1=0xc8;}else{_0x160db1=0xce;}_0x5ac085['status'](_0x160db1);return _0x5ac085[_0x038b('0x2b')]('Content-Range',_0x56b8ca+'-'+_0x3f1eef+'/'+_0xab6482)['json'](_0x53b0cb);}return null;};}function patchUpdates(_0x288fda){return function(_0x215afe){try{jsonpatch['apply'](_0x215afe,_0x288fda,!![]);}catch(_0x5b04f2){return BPromise[_0x038b('0x2c')](_0x5b04f2);}return _0x215afe[_0x038b('0x2d')]();};}function saveUpdates(_0x5bc942,_0x2718b9){return function(_0x525f8d){if(_0x525f8d){return _0x525f8d[_0x038b('0x2e')](_0x5bc942)[_0x038b('0x1c')](function(_0x2ccec8){return _0x2ccec8;});}return null;};}function removeEntity(_0x58f5fb,_0x551b45){return function(_0x4fcc34){if(_0x4fcc34){return _0x4fcc34[_0x038b('0x2f')]()[_0x038b('0x1c')](function(){_0x58f5fb[_0x038b('0x26')](0xcc)[_0x038b('0x25')]();});}};}function handleEntityNotFound(_0xf8a16a,_0xa8f265){return function(_0x2ed212){if(!_0x2ed212){_0xf8a16a[_0x038b('0x30')](0x194);}return _0x2ed212;};}function handleError(_0x4516ab,_0x4f9ce2){_0x4f9ce2=_0x4f9ce2||0x1f4;return function(_0x3cdf52){logger['error'](_0x3cdf52[_0x038b('0x31')]);if(_0x3cdf52[_0x038b('0x32')]){delete _0x3cdf52[_0x038b('0x32')];}_0x4516ab[_0x038b('0x26')](_0x4f9ce2)[_0x038b('0x33')](_0x3cdf52);};}exports[_0x038b('0x34')]=function(_0xdac436,_0x24f69d){var _0x2699f8={},_0x440d72={},_0xecc182={'count':0x0,'rows':[]};var _0x1680ec=_[_0x038b('0x35')](db[_0x038b('0x36')]['rawAttributes'],function(_0x51f9d8){return{'name':_0x51f9d8[_0x038b('0x37')],'type':_0x51f9d8[_0x038b('0x38')][_0x038b('0x39')]};});_0x440d72[_0x038b('0x3a')]=_[_0x038b('0x35')](_0x1680ec,_0x038b('0x32'));_0x440d72[_0x038b('0x3b')]=_['keys'](_0xdac436[_0x038b('0x3b')]);_0x440d72[_0x038b('0x3c')]=_[_0x038b('0x3d')](_0x440d72[_0x038b('0x3a')],_0x440d72[_0x038b('0x3b')]);_0x2699f8[_0x038b('0x3e')]=_[_0x038b('0x3d')](_0x440d72['model'],qs[_0x038b('0x3f')](_0xdac436[_0x038b('0x3b')][_0x038b('0x3f')]));_0x2699f8[_0x038b('0x3e')]=_0x2699f8[_0x038b('0x3e')][_0x038b('0x40')]?_0x2699f8[_0x038b('0x3e')]:_0x440d72[_0x038b('0x3a')];if(!_0xdac436['query'][_0x038b('0x41')](_0x038b('0x42'))){_0x2699f8[_0x038b('0x2a')]=qs['limit'](_0xdac436[_0x038b('0x3b')][_0x038b('0x2a')]);_0x2699f8['offset']=qs[_0x038b('0x29')](_0xdac436['query'][_0x038b('0x29')]);}_0x2699f8[_0x038b('0x43')]=qs[_0x038b('0x44')](_0xdac436[_0x038b('0x3b')][_0x038b('0x44')]);_0x2699f8['where']=qs[_0x038b('0x3c')](_[_0x038b('0x45')](_0xdac436['query'],_0x440d72[_0x038b('0x3c')]));if(_0xdac436[_0x038b('0x3b')][_0x038b('0x46')]){_0x2699f8[_0x038b('0x47')]=_[_0x038b('0x48')](_0x2699f8[_0x038b('0x47')],{'$or':_['map'](_0x1680ec,function(_0x4b7c35){if(_0x4b7c35[_0x038b('0x38')][_0x038b('0x39')]!=='VIRTUAL'){var _0x4eae27={};_0x4eae27[_0x4b7c35[_0x038b('0x49')]]={'$like':'%'+_0xdac436[_0x038b('0x3b')]['filter']+'%'};return _0x4eae27;}})});}_0x2699f8=_[_0x038b('0x48')]({},_0x2699f8,_0xdac436[_0x038b('0x4a')]);var _0x435067={'where':_0x2699f8[_0x038b('0x47')]};return db[_0x038b('0x36')][_0x038b('0x28')](_0x435067)[_0x038b('0x1c')](function(_0x2fdef4){_0xecc182[_0x038b('0x28')]=_0x2fdef4;if(_0xdac436['query'][_0x038b('0x4b')]){_0x2699f8[_0x038b('0x4c')]=[{'all':!![]}];}return db[_0x038b('0x36')][_0x038b('0x4d')](_0x2699f8);})[_0x038b('0x1c')](function(_0x2d4341){_0xecc182['rows']=_0x2d4341;return _0xecc182;})['then'](respondWithFilteredResult(_0x24f69d,_0x2699f8))[_0x038b('0x24')](handleError(_0x24f69d,null));};exports['show']=function(_0xc8387d,_0x268415){var _0x557da0={'raw':![],'where':{'id':_0xc8387d[_0x038b('0x4e')]['id']}},_0x3b28c8={};_0x3b28c8[_0x038b('0x3a')]=_[_0x038b('0x4f')](db[_0x038b('0x36')]['rawAttributes']);_0x3b28c8['query']=_['keys'](_0xc8387d['query']);_0x3b28c8[_0x038b('0x3c')]=_[_0x038b('0x3d')](_0x3b28c8[_0x038b('0x3a')],_0x3b28c8[_0x038b('0x3b')]);_0x557da0[_0x038b('0x3e')]=_[_0x038b('0x3d')](_0x3b28c8[_0x038b('0x3a')],qs[_0x038b('0x3f')](_0xc8387d['query'][_0x038b('0x3f')]));_0x557da0[_0x038b('0x3e')]=_0x557da0[_0x038b('0x3e')]['length']?_0x557da0[_0x038b('0x3e')]:_0x3b28c8[_0x038b('0x3a')];if(_0xc8387d[_0x038b('0x3b')][_0x038b('0x4b')]){_0x557da0[_0x038b('0x4c')]=[{'all':!![]}];}_0x557da0=_[_0x038b('0x48')]({},_0x557da0,_0xc8387d[_0x038b('0x4a')]);return db['SalesforceAccount'][_0x038b('0x50')](_0x557da0)[_0x038b('0x1c')](handleEntityNotFound(_0x268415,null))[_0x038b('0x1c')](respondWithResult(_0x268415,null))[_0x038b('0x24')](handleError(_0x268415,null));};exports[_0x038b('0x51')]=function(_0x55351e,_0x1534ce){return db['SalesforceAccount'][_0x038b('0x51')](_0x55351e[_0x038b('0x52')],{})['then'](respondWithResult(_0x1534ce,0xc9))['catch'](handleError(_0x1534ce,null));};exports[_0x038b('0x2e')]=function(_0x5c3bf8,_0x14afc6){if(_0x5c3bf8['body']['id']){delete _0x5c3bf8[_0x038b('0x52')]['id'];}return db['SalesforceAccount'][_0x038b('0x50')]({'where':{'id':_0x5c3bf8[_0x038b('0x4e')]['id']}})['then'](handleEntityNotFound(_0x14afc6,null))[_0x038b('0x1c')](saveUpdates(_0x5c3bf8['body'],null))['then'](respondWithResult(_0x14afc6,null))[_0x038b('0x24')](handleError(_0x14afc6,null));};exports['destroy']=function(_0x29364b,_0x31306e){return db[_0x038b('0x36')]['find']({'where':{'id':_0x29364b['params']['id']}})[_0x038b('0x1c')](handleEntityNotFound(_0x31306e,null))['then'](removeEntity(_0x31306e,null))[_0x038b('0x24')](handleError(_0x31306e,null));};exports[_0x038b('0x53')]=function(_0x21d72a,_0x25818b,_0x2dfb08){var _0x2c1e85={};var _0x313452={};var _0x803685;var _0x5e2e8c;return db[_0x038b('0x36')]['findOne']({'where':{'id':_0x21d72a['params']['id']}})[_0x038b('0x1c')](handleEntityNotFound(_0x25818b,null))[_0x038b('0x1c')](function(_0x3d5380){if(_0x3d5380){_0x803685=_0x3d5380;_0x313452[_0x038b('0x3a')]=_[_0x038b('0x4f')](db['SalesforceConfiguration'][_0x038b('0x54')]);_0x313452['query']=_[_0x038b('0x4f')](_0x21d72a[_0x038b('0x3b')]);_0x313452['filters']=_[_0x038b('0x3d')](_0x313452[_0x038b('0x3a')],_0x313452[_0x038b('0x3b')]);_0x2c1e85[_0x038b('0x3e')]=_[_0x038b('0x3d')](_0x313452[_0x038b('0x3a')],qs[_0x038b('0x3f')](_0x21d72a['query'][_0x038b('0x3f')]));_0x2c1e85[_0x038b('0x3e')]=_0x2c1e85[_0x038b('0x3e')][_0x038b('0x40')]?_0x2c1e85[_0x038b('0x3e')]:_0x313452[_0x038b('0x3a')];_0x2c1e85[_0x038b('0x43')]=qs[_0x038b('0x44')](_0x21d72a[_0x038b('0x3b')]['sort']);_0x2c1e85[_0x038b('0x47')]=qs[_0x038b('0x3c')](_[_0x038b('0x45')](_0x21d72a[_0x038b('0x3b')],_0x313452['filters']));if(_0x21d72a[_0x038b('0x3b')][_0x038b('0x46')]){_0x2c1e85['where']=_[_0x038b('0x48')](_0x2c1e85[_0x038b('0x47')],{'$or':_[_0x038b('0x35')](_0x2c1e85[_0x038b('0x3e')],function(_0x4a6fa2){var _0x435e4a={};_0x435e4a[_0x4a6fa2]={'$like':'%'+_0x21d72a[_0x038b('0x3b')][_0x038b('0x46')]+'%'};return _0x435e4a;})});}_0x2c1e85=_[_0x038b('0x48')]({},_0x2c1e85,_0x21d72a[_0x038b('0x4a')]);return _0x803685[_0x038b('0x53')](_0x2c1e85);}})['then'](function(_0x19bd61){if(_0x19bd61){_0x5e2e8c=_0x19bd61['length'];if(!_0x21d72a[_0x038b('0x3b')][_0x038b('0x41')]('nolimit')){_0x2c1e85['limit']=qs[_0x038b('0x2a')](_0x21d72a[_0x038b('0x3b')]['limit']);_0x2c1e85[_0x038b('0x29')]=qs['offset'](_0x21d72a[_0x038b('0x3b')][_0x038b('0x29')]);}return _0x803685['getConfigurations'](_0x2c1e85);}})['then'](function(_0x430211){if(_0x430211){return _0x430211?{'count':_0x5e2e8c,'rows':_0x430211}:null;}})['then'](respondWithResult(_0x25818b,null))['catch'](handleError(_0x25818b,null));};exports['addConfiguration']=function(_0x52d329,_0x93debf,_0x16e303){if(_0x52d329[_0x038b('0x52')]['id']){delete _0x52d329[_0x038b('0x52')]['id'];}return db[_0x038b('0x36')][_0x038b('0x55')]({'where':{'id':_0x52d329['params']['id']}})[_0x038b('0x1c')](handleEntityNotFound(_0x93debf,null))[_0x038b('0x1c')](function(_0x3328bf){if(_0x3328bf){_0x52d329['body'][_0x038b('0x56')]=_0x3328bf['id'];_0x52d329[_0x038b('0x52')][_0x038b('0x57')]=integrations[_0x038b('0x58')](_0x52d329[_0x038b('0x52')][_0x038b('0x59')],_0x52d329[_0x038b('0x52')]['type']);_0x52d329['body'][_0x038b('0x5a')]=integrations[_0x038b('0x5b')](_0x52d329[_0x038b('0x52')]['channel'],_0x52d329['body'][_0x038b('0x38')]);return db[_0x038b('0x5c')][_0x038b('0x51')](_0x52d329[_0x038b('0x52')],{'include':[{'model':db[_0x038b('0x5d')],'as':_0x038b('0x57')},{'model':db['SalesforceField'],'as':_0x038b('0x5a')}]});}return null;})[_0x038b('0x1c')](respondWithResult(_0x93debf,null))[_0x038b('0x24')](handleError(_0x93debf,null));};exports[_0x038b('0x5e')]=function(_0x4fdb48,_0x40a58e,_0x2736f7){var _0x332723;var _0x30d461='';var _0x293eeb=_0x038b('0x5f');return db['SalesforceAccount'][_0x038b('0x55')]({'where':{'id':_0x4fdb48[_0x038b('0x4e')]['id']},'attributes':['id',_0x038b('0x60'),_0x038b('0x61'),_0x038b('0x62'),'username','password',_0x038b('0x63')]})[_0x038b('0x1c')](handleEntityNotFound(_0x40a58e,null))[_0x038b('0x1c')](function(_0x51a398){if(_0x51a398){_0x30d461=_0x51a398[_0x038b('0x60')];var _0x262cc9=_0x30d461['slice'](-0x1);if(_0x262cc9==='/'){_0x30d461=_0x30d461['substring'](0x0,_0x30d461[_0x038b('0x64')](_0x262cc9));}_0x332723=new jsforce[(_0x038b('0x65'))]({'oauth2':{'loginUrl':_0x30d461,'clientId':_0x51a398['clientId'],'clientSecret':_0x51a398[_0x038b('0x62')]}});return _0x332723[_0x038b('0x66')](_0x51a398[_0x038b('0x67')],_0x51a398[_0x038b('0x68')][_0x038b('0x69')](_0x51a398[_0x038b('0x63')]));}})['then'](function(_0x33a512){if(_0x33a512){if(!_['isNil'](_0x4fdb48[_0x038b('0x3b')][_0x038b('0x6a')])){_0x293eeb=_0x4fdb48[_0x038b('0x3b')][_0x038b('0x6a')];}return _0x332723[_0x038b('0x6b')](_0x293eeb)[_0x038b('0x6c')]();}})[_0x038b('0x1c')](function(_0x227240){var _0x173106=['CallDisposition',_0x038b('0x6d'),_0x038b('0x6e'),_0x038b('0x6f'),_0x038b('0x70'),_0x038b('0x71'),_0x038b('0x72'),_0x038b('0x73')];if(!_['isNil'](_0x4fdb48[_0x038b('0x3b')][_0x038b('0x6a')])&&_0x4fdb48['query'][_0x038b('0x6a')]===_0x038b('0x74')){_0x173106=[_0x038b('0x73'),_0x038b('0x75'),_0x038b('0x76'),_0x038b('0x72'),_0x038b('0x71'),_0x038b('0x77'),_0x038b('0x78'),_0x038b('0x79')];}if(_0x227240){_[_0x038b('0x7a')](_0x227240[_0x038b('0x3f')],function(_0x52e8b7){return _0x52e8b7[_0x038b('0x7b')]===![]&&!_0x173106[_0x038b('0x7c')](_0x52e8b7[_0x038b('0x32')]);});return{'count':_0x227240[_0x038b('0x3f')][_0x038b('0x40')],'rows':_[_0x038b('0x35')](_0x227240[_0x038b('0x3f')],function(_0x200fef){return{'id':_0x200fef[_0x038b('0x32')],'name':_0x200fef[_0x038b('0x7d')],'custom':_0x200fef[_0x038b('0x7b')],'options':_0x200fef[_0x038b('0x7e')][_0x038b('0x40')]>0x0?_['map'](_0x200fef[_0x038b('0x7e')],function(_0x3d7f00){return{'name':_0x3d7f00['label'],'value':_0x3d7f00[_0x038b('0x7f')]};}):_0x200fef['type']==_0x038b('0x80')?[{'name':'True','value':_0x038b('0x81')},{'name':_0x038b('0x82'),'value':_0x038b('0x83')}]:[]};})};}})[_0x038b('0x1c')](respondWithResult(_0x40a58e,null))[_0x038b('0x24')](function(_0x12003d){var _0x511b8e=_0x4fdb48[_0x038b('0x3b')][_0x038b('0x19')]?0x1f4:_0x12003d[_0x038b('0x84')]||0x1f4;logger[_0x038b('0x21')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x511b8e,JSON['stringify'](_0x12003d));delete _0x12003d['name'];if(_0x511b8e===0x191){_0x511b8e=0x190;}_0x40a58e[_0x038b('0x26')](_0x511b8e)['send'](_0x4fdb48[_0x038b('0x3b')][_0x038b('0x19')]?{'message':_0x038b('0x85'),'statusCode':_0x12003d[_0x038b('0x84')]}:_0x12003d);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index f10b12a..337fc5c 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 _0x6744=['request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','../../config/logger','api'];(function(_0x239eaf,_0x1968b4){var _0x8863f7=function(_0x1b34d7){while(--_0x1b34d7){_0x239eaf['push'](_0x239eaf['shift']());}};_0x8863f7(++_0x1968b4);}(_0x6744,0xbb));var _0x4674=function(_0x23049f,_0x9be1fc){_0x23049f=_0x23049f-0x0;var _0x42305f=_0x6744[_0x23049f];return _0x42305f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4674('0x0'))(_0x4674('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4674('0x2'));var fs=require('fs');var path=require(_0x4674('0x3'));var rimraf=require(_0x4674('0x4'));var config=require(_0x4674('0x5'));var attributes=require('./intSalesforceAccount.attributes');var integrations=require(_0x4674('0x6'));module[_0x4674('0x7')]=function(_0x45ef14,_0x5d24a8){return _0x45ef14[_0x4674('0x8')]('SalesforceAccount',attributes,{'tableName':'int_salesforce_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1388=['../../config/logger','api','moment','bluebird','request-promise','path','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','SalesforceAccount','int_salesforce_accounts','util'];(function(_0xf855c3,_0x2191f8){var _0x4597fa=function(_0x4122cd){while(--_0x4122cd){_0xf855c3['push'](_0xf855c3['shift']());}};_0x4597fa(++_0x2191f8);}(_0x1388,0xf6));var _0x8138=function(_0x483102,_0x54e93d){_0x483102=_0x483102-0x0;var _0x5cc885=_0x1388[_0x483102];return _0x5cc885;};'use strict';var _=require('lodash');var util=require(_0x8138('0x0'));var logger=require(_0x8138('0x1'))(_0x8138('0x2'));var moment=require(_0x8138('0x3'));var BPromise=require(_0x8138('0x4'));var rp=require(_0x8138('0x5'));var fs=require('fs');var path=require(_0x8138('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8138('0x7'));var integrations=require(_0x8138('0x8'));module[_0x8138('0x9')]=function(_0x535eef,_0x5ee5c7){return _0x535eef[_0x8138('0xa')](_0x8138('0xb'),attributes,{'tableName':_0x8138('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 1272044..13e38a8 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 _0x39cb=['request','then','info','SalesforceAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SalesforceAccount,\x20%s,\x20%s','message','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','attributes','limit','map','include','model','debug','ShowSalesforceAccount','raw','where','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x491c77,_0x489661){var _0x36466a=function(_0x23c095){while(--_0x23c095){_0x491c77['push'](_0x491c77['shift']());}};_0x36466a(++_0x489661);}(_0x39cb,0x1bd));var _0xb39c=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x39cb[_0x42cae2];return _0x5f256f;};'use strict';var _=require('lodash');var util=require(_0xb39c('0x0'));var moment=require(_0xb39c('0x1'));var BPromise=require('bluebird');var rs=require(_0xb39c('0x2'));var fs=require('fs');var Redis=require(_0xb39c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb39c('0x4'));var logger=require(_0xb39c('0x5'))(_0xb39c('0x6'));var config=require(_0xb39c('0x7'));var jayson=require(_0xb39c('0x8'));var client=jayson['client'][_0xb39c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2fc868,_0x40112f,_0x3f2fbe){return new BPromise(function(_0x47d6d7,_0x5ae14a){return client[_0xb39c('0xa')](_0x2fc868,_0x3f2fbe)[_0xb39c('0xb')](function(_0x3ffb94){logger[_0xb39c('0xc')]('SalesforceAccount,\x20%s,\x20%s',_0x40112f,'request\x20sent');logger['debug'](_0xb39c('0xd'),_0x40112f,_0xb39c('0xe'),JSON[_0xb39c('0xf')](_0x3ffb94));if(_0x3ffb94[_0xb39c('0x10')]){if(_0x3ffb94[_0xb39c('0x10')][_0xb39c('0x11')]===0x1f4){logger[_0xb39c('0x10')](_0xb39c('0x12'),_0x40112f,_0x3ffb94['error'][_0xb39c('0x13')]);return _0x5ae14a(_0x3ffb94[_0xb39c('0x10')][_0xb39c('0x13')]);}logger['error'](_0xb39c('0x12'),_0x40112f,_0x3ffb94[_0xb39c('0x10')][_0xb39c('0x13')]);return _0x47d6d7(_0x3ffb94[_0xb39c('0x10')][_0xb39c('0x13')]);}else{logger[_0xb39c('0xc')](_0xb39c('0x12'),_0x40112f,'request\x20sent');_0x47d6d7(_0x3ffb94[_0xb39c('0x14')][_0xb39c('0x13')]);}})[_0xb39c('0x15')](function(_0x1c2c5f){logger[_0xb39c('0x10')](_0xb39c('0x12'),_0x40112f,_0x1c2c5f);_0x5ae14a(_0x1c2c5f);});});}exports[_0xb39c('0x16')]=function(_0x4e02cf){var _0x35dade=this;return new Promise(function(_0x2eeae6,_0x559ad6){return db[_0xb39c('0x17')][_0xb39c('0x18')]({'raw':_0x4e02cf[_0xb39c('0x19')]?_0x4e02cf[_0xb39c('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x4e02cf[_0xb39c('0x19')]?_0x4e02cf[_0xb39c('0x19')]['where']||null:null,'attributes':_0x4e02cf[_0xb39c('0x19')]?_0x4e02cf[_0xb39c('0x19')][_0xb39c('0x1a')]||null:null,'limit':_0x4e02cf['options']?_0x4e02cf['options'][_0xb39c('0x1b')]||null:null,'include':_0x4e02cf[_0xb39c('0x19')]?_0x4e02cf[_0xb39c('0x19')]['include']?_[_0xb39c('0x1c')](_0x4e02cf[_0xb39c('0x19')][_0xb39c('0x1d')],function(_0x16f3b0){return{'model':db[_0x16f3b0[_0xb39c('0x1e')]],'as':_0x16f3b0['as'],'attributes':_0x16f3b0['attributes'],'include':_0x16f3b0[_0xb39c('0x1d')]?_[_0xb39c('0x1c')](_0x16f3b0['include'],function(_0x1fd145){return{'model':db[_0x1fd145[_0xb39c('0x1e')]],'as':_0x1fd145['as'],'attributes':_0x1fd145[_0xb39c('0x1a')],'include':_0x1fd145[_0xb39c('0x1d')]?_[_0xb39c('0x1c')](_0x1fd145['include'],function(_0x23a2f1){return{'model':db[_0x23a2f1[_0xb39c('0x1e')]],'as':_0x23a2f1['as'],'attributes':_0x23a2f1[_0xb39c('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x41fff2){logger[_0xb39c('0xc')]('GetSalesforceAccount',_0x4e02cf);logger[_0xb39c('0x1f')](_0xb39c('0x16'),_0x4e02cf,JSON[_0xb39c('0xf')](_0x41fff2));_0x2eeae6(_0x41fff2);})['catch'](function(_0x714d20){logger[_0xb39c('0x10')]('GetSalesforceAccount',_0x714d20[_0xb39c('0x13')],_0x4e02cf);_0x559ad6(_0x35dade['error'](0x1f4,_0x714d20[_0xb39c('0x13')]));});});};exports[_0xb39c('0x20')]=function(_0x309697){var _0x7339b4=this;return new Promise(function(_0x17eb7b,_0x52e642){return db[_0xb39c('0x17')]['find']({'raw':_0x309697[_0xb39c('0x19')]?_0x309697['options'][_0xb39c('0x21')]===undefined?!![]:![]:!![],'where':_0x309697[_0xb39c('0x19')]?_0x309697[_0xb39c('0x19')][_0xb39c('0x22')]||null:null,'attributes':_0x309697['options']?_0x309697['options'][_0xb39c('0x1a')]||null:null,'include':_0x309697[_0xb39c('0x19')]?_0x309697['options'][_0xb39c('0x1d')]?_[_0xb39c('0x1c')](_0x309697[_0xb39c('0x19')][_0xb39c('0x1d')],function(_0x14a92f){return{'model':db[_0x14a92f[_0xb39c('0x1e')]],'as':_0x14a92f['as'],'attributes':_0x14a92f[_0xb39c('0x1a')],'include':_0x14a92f[_0xb39c('0x1d')]?_[_0xb39c('0x1c')](_0x14a92f[_0xb39c('0x1d')],function(_0x15882d){return{'model':db[_0x15882d[_0xb39c('0x1e')]],'as':_0x15882d['as'],'attributes':_0x15882d[_0xb39c('0x1a')],'include':_0x15882d[_0xb39c('0x1d')]?_[_0xb39c('0x1c')](_0x15882d[_0xb39c('0x1d')],function(_0x8e5a74){return{'model':db[_0x8e5a74[_0xb39c('0x1e')]],'as':_0x8e5a74['as'],'attributes':_0x8e5a74[_0xb39c('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2c2b40){logger[_0xb39c('0xc')]('ShowSalesforceAccount',_0x309697);logger['debug']('ShowSalesforceAccount',_0x309697,JSON[_0xb39c('0xf')](_0x2c2b40));_0x17eb7b(_0x2c2b40);})[_0xb39c('0x15')](function(_0xe6bc2e){logger['error'](_0xb39c('0x20'),_0xe6bc2e[_0xb39c('0x13')],_0x309697);_0x52e642(_0x7339b4[_0xb39c('0x10')](0x1f4,_0xe6bc2e[_0xb39c('0x13')]));});});}; \ No newline at end of file +var _0x0a9a=['catch','where','ShowSalesforceAccount','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','SalesforceAccount,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','attributes','include','map','model','debug'];(function(_0x3fd733,_0x122220){var _0x4015fb=function(_0x437c33){while(--_0x437c33){_0x3fd733['push'](_0x3fd733['shift']());}};_0x4015fb(++_0x122220);}(_0x0a9a,0x183));var _0xa0a9=function(_0x161012,_0x544477){_0x161012=_0x161012-0x0;var _0x129426=_0x0a9a[_0x161012];return _0x129426;};'use strict';var _=require('lodash');var util=require(_0xa0a9('0x0'));var moment=require('moment');var BPromise=require(_0xa0a9('0x1'));var rs=require(_0xa0a9('0x2'));var fs=require('fs');var Redis=require(_0xa0a9('0x3'));var db=require(_0xa0a9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa0a9('0x5'))(_0xa0a9('0x6'));var config=require('../../config/environment');var jayson=require(_0xa0a9('0x7'));var client=jayson[_0xa0a9('0x8')][_0xa0a9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x31d689,_0x499a29,_0x2b2eb4){return new BPromise(function(_0x520f42,_0x10aa8a){return client[_0xa0a9('0xa')](_0x31d689,_0x2b2eb4)[_0xa0a9('0xb')](function(_0x2d6ac0){logger['info'](_0xa0a9('0xc'),_0x499a29,_0xa0a9('0xd'));logger['debug']('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x499a29,_0xa0a9('0xd'),JSON[_0xa0a9('0xe')](_0x2d6ac0));if(_0x2d6ac0['error']){if(_0x2d6ac0[_0xa0a9('0xf')]['code']===0x1f4){logger[_0xa0a9('0xf')]('SalesforceAccount,\x20%s,\x20%s',_0x499a29,_0x2d6ac0[_0xa0a9('0xf')][_0xa0a9('0x10')]);return _0x10aa8a(_0x2d6ac0[_0xa0a9('0xf')][_0xa0a9('0x10')]);}logger[_0xa0a9('0xf')]('SalesforceAccount,\x20%s,\x20%s',_0x499a29,_0x2d6ac0[_0xa0a9('0xf')][_0xa0a9('0x10')]);return _0x520f42(_0x2d6ac0[_0xa0a9('0xf')][_0xa0a9('0x10')]);}else{logger[_0xa0a9('0x11')](_0xa0a9('0xc'),_0x499a29,'request\x20sent');_0x520f42(_0x2d6ac0[_0xa0a9('0x12')]['message']);}})['catch'](function(_0x347092){logger[_0xa0a9('0xf')](_0xa0a9('0xc'),_0x499a29,_0x347092);_0x10aa8a(_0x347092);});});}exports[_0xa0a9('0x13')]=function(_0x568409){var _0x320735=this;return new Promise(function(_0x126401,_0x33eb8f){return db[_0xa0a9('0x14')][_0xa0a9('0x15')]({'raw':_0x568409[_0xa0a9('0x16')]?_0x568409['options'][_0xa0a9('0x17')]===undefined?!![]:![]:!![],'where':_0x568409[_0xa0a9('0x16')]?_0x568409['options']['where']||null:null,'attributes':_0x568409[_0xa0a9('0x16')]?_0x568409[_0xa0a9('0x16')][_0xa0a9('0x18')]||null:null,'limit':_0x568409['options']?_0x568409[_0xa0a9('0x16')]['limit']||null:null,'include':_0x568409[_0xa0a9('0x16')]?_0x568409['options'][_0xa0a9('0x19')]?_[_0xa0a9('0x1a')](_0x568409[_0xa0a9('0x16')][_0xa0a9('0x19')],function(_0x4938da){return{'model':db[_0x4938da[_0xa0a9('0x1b')]],'as':_0x4938da['as'],'attributes':_0x4938da['attributes'],'include':_0x4938da[_0xa0a9('0x19')]?_[_0xa0a9('0x1a')](_0x4938da[_0xa0a9('0x19')],function(_0x252a14){return{'model':db[_0x252a14['model']],'as':_0x252a14['as'],'attributes':_0x252a14[_0xa0a9('0x18')],'include':_0x252a14[_0xa0a9('0x19')]?_[_0xa0a9('0x1a')](_0x252a14[_0xa0a9('0x19')],function(_0x526dd1){return{'model':db[_0x526dd1[_0xa0a9('0x1b')]],'as':_0x526dd1['as'],'attributes':_0x526dd1[_0xa0a9('0x18')]};}):[]};}):[]};}):[]:[]})[_0xa0a9('0xb')](function(_0x5c446e){logger['info'](_0xa0a9('0x13'),_0x568409);logger[_0xa0a9('0x1c')](_0xa0a9('0x13'),_0x568409,JSON[_0xa0a9('0xe')](_0x5c446e));_0x126401(_0x5c446e);})[_0xa0a9('0x1d')](function(_0xe218ff){logger[_0xa0a9('0xf')](_0xa0a9('0x13'),_0xe218ff[_0xa0a9('0x10')],_0x568409);_0x33eb8f(_0x320735[_0xa0a9('0xf')](0x1f4,_0xe218ff[_0xa0a9('0x10')]));});});};exports['ShowSalesforceAccount']=function(_0x1f6178){var _0x1957bf=this;return new Promise(function(_0x4fc94a,_0x2f21ea){return db[_0xa0a9('0x14')]['find']({'raw':_0x1f6178['options']?_0x1f6178[_0xa0a9('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x1f6178['options']?_0x1f6178[_0xa0a9('0x16')][_0xa0a9('0x1e')]||null:null,'attributes':_0x1f6178[_0xa0a9('0x16')]?_0x1f6178[_0xa0a9('0x16')][_0xa0a9('0x18')]||null:null,'include':_0x1f6178[_0xa0a9('0x16')]?_0x1f6178[_0xa0a9('0x16')]['include']?_[_0xa0a9('0x1a')](_0x1f6178[_0xa0a9('0x16')]['include'],function(_0x46ef2b){return{'model':db[_0x46ef2b[_0xa0a9('0x1b')]],'as':_0x46ef2b['as'],'attributes':_0x46ef2b[_0xa0a9('0x18')],'include':_0x46ef2b['include']?_['map'](_0x46ef2b[_0xa0a9('0x19')],function(_0x210ddb){return{'model':db[_0x210ddb[_0xa0a9('0x1b')]],'as':_0x210ddb['as'],'attributes':_0x210ddb[_0xa0a9('0x18')],'include':_0x210ddb['include']?_[_0xa0a9('0x1a')](_0x210ddb[_0xa0a9('0x19')],function(_0x459485){return{'model':db[_0x459485['model']],'as':_0x459485['as'],'attributes':_0x459485[_0xa0a9('0x18')]};}):[]};}):[]};}):[]:[]})[_0xa0a9('0xb')](function(_0x4e121e){logger['info'](_0xa0a9('0x1f'),_0x1f6178);logger[_0xa0a9('0x1c')](_0xa0a9('0x1f'),_0x1f6178,JSON[_0xa0a9('0xe')](_0x4e121e));_0x4fc94a(_0x4e121e);})[_0xa0a9('0x1d')](function(_0x1d6bae){logger[_0xa0a9('0xf')](_0xa0a9('0x1f'),_0x1d6bae[_0xa0a9('0x10')],_0x1f6178);_0x2f21ea(_0x1957bf[_0xa0a9('0xf')](0x1f4,_0x1d6bae[_0xa0a9('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index d21d35d..d25c69b 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 _0x79fe=['multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','update','delete','destroy','exports'];(function(_0x25c7fb,_0x2e4e86){var _0x214b77=function(_0x36b7c0){while(--_0x36b7c0){_0x25c7fb['push'](_0x25c7fb['shift']());}};_0x214b77(++_0x2e4e86);}(_0x79fe,0x1b0));var _0xe79f=function(_0xe7e888,_0x277d59){_0xe7e888=_0xe7e888-0x0;var _0x5f2341=_0x79fe[_0xe7e888];return _0x5f2341;};'use strict';var multer=require(_0xe79f('0x0'));var util=require(_0xe79f('0x1'));var path=require(_0xe79f('0x2'));var timeout=require(_0xe79f('0x3'));var express=require(_0xe79f('0x4'));var router=express['Router']();var auth=require(_0xe79f('0x5'));var interaction=require(_0xe79f('0x6'));var config=require(_0xe79f('0x7'));var controller=require('./intSalesforceConfiguration.controller');router['get']('/',auth[_0xe79f('0x8')](),controller[_0xe79f('0x9')]);router[_0xe79f('0xa')](_0xe79f('0xb'),auth[_0xe79f('0x8')](),controller[_0xe79f('0xc')]);router[_0xe79f('0xa')](_0xe79f('0xd'),auth[_0xe79f('0x8')](),controller[_0xe79f('0xe')]);router[_0xe79f('0xa')](_0xe79f('0xf'),auth[_0xe79f('0x8')](),controller[_0xe79f('0x10')]);router[_0xe79f('0xa')](_0xe79f('0x11'),auth[_0xe79f('0x8')](),controller[_0xe79f('0x12')]);router[_0xe79f('0x13')]('/',auth[_0xe79f('0x8')](),controller['create']);router['put'](_0xe79f('0xb'),auth[_0xe79f('0x8')](),controller[_0xe79f('0x14')]);router[_0xe79f('0x15')]('/:id',auth[_0xe79f('0x8')](),controller[_0xe79f('0x16')]);module[_0xe79f('0x17')]=router; \ No newline at end of file +var _0x1480=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','exports','util'];(function(_0x1286a9,_0x593458){var _0x55943e=function(_0x3dffaa){while(--_0x3dffaa){_0x1286a9['push'](_0x1286a9['shift']());}};_0x55943e(++_0x593458);}(_0x1480,0x18f));var _0x0148=function(_0x8e6768,_0x997aad){_0x8e6768=_0x8e6768-0x0;var _0x4db9e9=_0x1480[_0x8e6768];return _0x4db9e9;};'use strict';var multer=require('multer');var util=require(_0x0148('0x0'));var path=require(_0x0148('0x1'));var timeout=require(_0x0148('0x2'));var express=require(_0x0148('0x3'));var router=express[_0x0148('0x4')]();var auth=require(_0x0148('0x5'));var interaction=require(_0x0148('0x6'));var config=require(_0x0148('0x7'));var controller=require(_0x0148('0x8'));router[_0x0148('0x9')]('/',auth[_0x0148('0xa')](),controller[_0x0148('0xb')]);router['get'](_0x0148('0xc'),auth[_0x0148('0xa')](),controller[_0x0148('0xd')]);router['get']('/:id/fields',auth[_0x0148('0xa')](),controller[_0x0148('0xe')]);router[_0x0148('0x9')](_0x0148('0xf'),auth[_0x0148('0xa')](),controller[_0x0148('0x10')]);router[_0x0148('0x9')](_0x0148('0x11'),auth[_0x0148('0xa')](),controller[_0x0148('0x12')]);router[_0x0148('0x13')]('/',auth['isAuthenticated'](),controller[_0x0148('0x14')]);router[_0x0148('0x15')](_0x0148('0xc'),auth[_0x0148('0xa')](),controller[_0x0148('0x16')]);router[_0x0148('0x17')](_0x0148('0xc'),auth[_0x0148('0xa')](),controller['destroy']);module[_0x0148('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index d44f125..d56b209 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 _0xb7e6=['nothing','lead','sequelize','exports','STRING','ENUM','Task','Case','contact_lead','contact'];(function(_0x51beba,_0x202d19){var _0x167ee0=function(_0x2d5b21){while(--_0x2d5b21){_0x51beba['push'](_0x51beba['shift']());}};_0x167ee0(++_0x202d19);}(_0xb7e6,0x12e));var _0x6b7e=function(_0x1eb3f0,_0x167481){_0x1eb3f0=_0x1eb3f0-0x0;var _0x728014=_0xb7e6[_0x1eb3f0];return _0x728014;};'use strict';var Sequelize=require(_0x6b7e('0x0'));module[_0x6b7e('0x1')]={'name':{'type':Sequelize[_0x6b7e('0x2')]},'description':{'type':Sequelize[_0x6b7e('0x2')]},'ticketType':{'type':Sequelize[_0x6b7e('0x3')](_0x6b7e('0x4'),_0x6b7e('0x5')),'defaultValue':_0x6b7e('0x4')},'moduleSearch':{'type':Sequelize[_0x6b7e('0x3')](_0x6b7e('0x6'),_0x6b7e('0x7'),'lead'),'defaultValue':_0x6b7e('0x6')},'moduleCreate':{'type':Sequelize[_0x6b7e('0x3')](_0x6b7e('0x8'),_0x6b7e('0x7'),'lead'),'defaultValue':_0x6b7e('0x9')}}; \ No newline at end of file +var _0x7983=['nothing','sequelize','exports','ENUM','Task','Case','contact_lead','contact','lead'];(function(_0x27b49f,_0x5609d2){var _0x1b75c2=function(_0x4908ae){while(--_0x4908ae){_0x27b49f['push'](_0x27b49f['shift']());}};_0x1b75c2(++_0x5609d2);}(_0x7983,0xf4));var _0x3798=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x7983[_0x8c43de];return _0xa6591b;};'use strict';var Sequelize=require(_0x3798('0x0'));module[_0x3798('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x3798('0x2')](_0x3798('0x3'),_0x3798('0x4')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize[_0x3798('0x2')](_0x3798('0x5'),_0x3798('0x6'),_0x3798('0x7')),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize[_0x3798('0x2')](_0x3798('0x8'),_0x3798('0x6'),'lead'),'defaultValue':_0x3798('0x7')}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 16d3076..216c8ce 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 _0x0641=['Content-Range','apply','save','update','destroy','end','stack','name','send','map','fieldName','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','type','VIRTUAL','merge','SalesforceConfiguration','includeAll','include','findAll','rows','show','params','rawAttributes','create','body','find','getFields','pick','options','getSubjects','findOne','getDescriptions','SalesforceField','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','status','count','offset','limit','set'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0641,0x140));var _0x1064=function(_0x5cc73a,_0x16b650){_0x5cc73a=_0x5cc73a-0x0;var _0x366d3b=_0x0641[_0x5cc73a];return _0x366d3b;};'use strict';var pdf=require(_0x1064('0x0'));var emlformat=require(_0x1064('0x1'));var rimraf=require(_0x1064('0x2'));var zipdir=require(_0x1064('0x3'));var jsonpatch=require(_0x1064('0x4'));var rp=require(_0x1064('0x5'));var moment=require(_0x1064('0x6'));var BPromise=require(_0x1064('0x7'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x1064('0x8'));var ejs=require(_0x1064('0x9'));var fs=require('fs');var _=require(_0x1064('0xa'));var squel=require(_0x1064('0xb'));var crypto=require(_0x1064('0xc'));var jsforce=require(_0x1064('0xd'));var deskjs=require(_0x1064('0xe'));var toCsv=require(_0x1064('0x8'));var querystring=require(_0x1064('0xf'));var Papa=require(_0x1064('0x10'));var Redis=require('ioredis');var authService=require(_0x1064('0x11'));var qs=require(_0x1064('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1064('0x13'));var logger=require(_0x1064('0x14'))('api');var utils=require(_0x1064('0x15'));var config=require(_0x1064('0x16'));var db=require(_0x1064('0x17'))['db'];var jayson=require(_0x1064('0x18'));var client=jayson[_0x1064('0x19')]['http']({'port':0x232a});function checkPasswordPattern(_0x42f31b,_0x280712,_0x2a8199){if(_0x2a8199){var _0x5240a3=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5240a3['test'](_0x280712)){return _0x42f31b;}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 _0x42f31b;}}function respondWithRpcPromise(_0x588fc7,_0x2479f3,_0xb51af2,_0x51cb1a){return new BPromise(function(_0x5aa31d,_0x421cc5){var _0xd7e2e7=_0x51cb1a||client;return _0xd7e2e7[_0x1064('0x1a')](_0x588fc7,_0xb51af2)[_0x1064('0x1b')](function(_0x376d73){logger[_0x1064('0x1c')](_0x1064('0x1d'),_0x2479f3,'request\x20sent');logger[_0x1064('0x1e')](_0x1064('0x1f'),_0x2479f3,_0x1064('0x20'),JSON[_0x1064('0x21')](_0x376d73));if(_0x376d73[_0x1064('0x22')]){if(_0x376d73[_0x1064('0x22')][_0x1064('0x23')]===0x1f4){logger[_0x1064('0x22')](_0x1064('0x1d'),_0x2479f3,_0x376d73['error']['message']);return _0x421cc5(_0x376d73[_0x1064('0x22')][_0x1064('0x24')]);}logger['error'](_0x1064('0x1d'),_0x2479f3,_0x376d73[_0x1064('0x22')][_0x1064('0x24')]);return _0x5aa31d(_0x376d73[_0x1064('0x22')][_0x1064('0x24')]);}else{logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x2479f3,_0x1064('0x20'));_0x5aa31d(_0x376d73[_0x1064('0x25')][_0x1064('0x24')]);}})[_0x1064('0x26')](function(_0x45724a){logger[_0x1064('0x22')](_0x1064('0x1d'),_0x2479f3,_0x45724a);_0x421cc5(_0x45724a);});});}function respondWithStatusCode(_0x341538,_0x1a321a){_0x1a321a=_0x1a321a||0xcc;return function(_0x20d962){if(_0x20d962){return _0x341538['sendStatus'](_0x1a321a);}return _0x341538[_0x1064('0x27')](_0x1a321a)['end']();};}function respondWithResult(_0x4f0fae,_0x2b5d5c){_0x2b5d5c=_0x2b5d5c||0xc8;return function(_0xfee31){if(_0xfee31){return _0x4f0fae[_0x1064('0x27')](_0x2b5d5c)['json'](_0xfee31);}};}function respondWithFilteredResult(_0x4f50ba,_0x551387){return function(_0x14369f){if(_0x14369f){var _0x1168a9=_0x14369f[_0x1064('0x28')],_0x37d359=_0x551387[_0x1064('0x29')],_0xfa32a=_0x551387[_0x1064('0x29')]+_0x551387[_0x1064('0x2a')],_0x1cd4cc;if(_0xfa32a>=_0x1168a9){_0xfa32a=_0x1168a9;_0x1cd4cc=0xc8;}else{_0x1cd4cc=0xce;}_0x4f50ba['status'](_0x1cd4cc);return _0x4f50ba[_0x1064('0x2b')](_0x1064('0x2c'),_0x37d359+'-'+_0xfa32a+'/'+_0x1168a9)['json'](_0x14369f);}return null;};}function patchUpdates(_0x21b805){return function(_0x3772c6){try{jsonpatch[_0x1064('0x2d')](_0x3772c6,_0x21b805,!![]);}catch(_0x2f89b0){return BPromise['reject'](_0x2f89b0);}return _0x3772c6[_0x1064('0x2e')]();};}function saveUpdates(_0x13bfb9,_0x147f1c){return function(_0x3b834f){if(_0x3b834f){return _0x3b834f[_0x1064('0x2f')](_0x13bfb9)[_0x1064('0x1b')](function(_0x3fa666){return _0x3fa666;});}return null;};}function removeEntity(_0x12846d,_0xdb94ab){return function(_0x25d48e){if(_0x25d48e){return _0x25d48e[_0x1064('0x30')]()[_0x1064('0x1b')](function(){_0x12846d[_0x1064('0x27')](0xcc)[_0x1064('0x31')]();});}};}function handleEntityNotFound(_0x196501,_0x11d018){return function(_0xc2634){if(!_0xc2634){_0x196501['sendStatus'](0x194);}return _0xc2634;};}function handleError(_0x2b9875,_0x4f905a){_0x4f905a=_0x4f905a||0x1f4;return function(_0x512a91){logger[_0x1064('0x22')](_0x512a91[_0x1064('0x32')]);if(_0x512a91[_0x1064('0x33')]){delete _0x512a91[_0x1064('0x33')];}_0x2b9875[_0x1064('0x27')](_0x4f905a)[_0x1064('0x34')](_0x512a91);};}exports['index']=function(_0x3e45db,_0x460081){var _0x57014e={},_0x3cfcfa={},_0x176378={'count':0x0,'rows':[]};var _0x368e7a=_[_0x1064('0x35')](db['SalesforceConfiguration']['rawAttributes'],function(_0xc67731){return{'name':_0xc67731[_0x1064('0x36')],'type':_0xc67731['type'][_0x1064('0x37')]};});_0x3cfcfa['model']=_[_0x1064('0x35')](_0x368e7a,_0x1064('0x33'));_0x3cfcfa[_0x1064('0x38')]=_[_0x1064('0x39')](_0x3e45db[_0x1064('0x38')]);_0x3cfcfa['filters']=_[_0x1064('0x3a')](_0x3cfcfa[_0x1064('0x3b')],_0x3cfcfa['query']);_0x57014e[_0x1064('0x3c')]=_['intersection'](_0x3cfcfa['model'],qs['fields'](_0x3e45db[_0x1064('0x38')][_0x1064('0x3d')]));_0x57014e[_0x1064('0x3c')]=_0x57014e[_0x1064('0x3c')][_0x1064('0x3e')]?_0x57014e[_0x1064('0x3c')]:_0x3cfcfa[_0x1064('0x3b')];if(!_0x3e45db[_0x1064('0x38')][_0x1064('0x3f')](_0x1064('0x40'))){_0x57014e[_0x1064('0x2a')]=qs[_0x1064('0x2a')](_0x3e45db[_0x1064('0x38')][_0x1064('0x2a')]);_0x57014e[_0x1064('0x29')]=qs[_0x1064('0x29')](_0x3e45db[_0x1064('0x38')][_0x1064('0x29')]);}_0x57014e[_0x1064('0x41')]=qs['sort'](_0x3e45db['query'][_0x1064('0x42')]);_0x57014e['where']=qs[_0x1064('0x43')](_['pick'](_0x3e45db[_0x1064('0x38')],_0x3cfcfa[_0x1064('0x43')]));if(_0x3e45db['query'][_0x1064('0x44')]){_0x57014e[_0x1064('0x45')]=_['merge'](_0x57014e[_0x1064('0x45')],{'$or':_[_0x1064('0x35')](_0x368e7a,function(_0x5822cd){if(_0x5822cd[_0x1064('0x46')][_0x1064('0x37')]!==_0x1064('0x47')){var _0x4f5e76={};_0x4f5e76[_0x5822cd['field']]={'$like':'%'+_0x3e45db['query'][_0x1064('0x44')]+'%'};return _0x4f5e76;}})});}_0x57014e=_[_0x1064('0x48')]({},_0x57014e,_0x3e45db['options']);var _0x1207a8={'where':_0x57014e[_0x1064('0x45')]};return db[_0x1064('0x49')][_0x1064('0x28')](_0x1207a8)[_0x1064('0x1b')](function(_0x9df97){_0x176378[_0x1064('0x28')]=_0x9df97;if(_0x3e45db[_0x1064('0x38')][_0x1064('0x4a')]){_0x57014e[_0x1064('0x4b')]=[{'all':!![]}];}return db['SalesforceConfiguration'][_0x1064('0x4c')](_0x57014e);})[_0x1064('0x1b')](function(_0x3d4ecc){_0x176378[_0x1064('0x4d')]=_0x3d4ecc;return _0x176378;})[_0x1064('0x1b')](respondWithFilteredResult(_0x460081,_0x57014e))[_0x1064('0x26')](handleError(_0x460081,null));};exports[_0x1064('0x4e')]=function(_0x340232,_0x53e2a9){var _0x4d1e9a={'raw':![],'where':{'id':_0x340232[_0x1064('0x4f')]['id']}},_0x271f08={};_0x271f08[_0x1064('0x3b')]=_[_0x1064('0x39')](db[_0x1064('0x49')][_0x1064('0x50')]);_0x271f08[_0x1064('0x38')]=_[_0x1064('0x39')](_0x340232[_0x1064('0x38')]);_0x271f08[_0x1064('0x43')]=_[_0x1064('0x3a')](_0x271f08[_0x1064('0x3b')],_0x271f08['query']);_0x4d1e9a['attributes']=_[_0x1064('0x3a')](_0x271f08[_0x1064('0x3b')],qs[_0x1064('0x3d')](_0x340232[_0x1064('0x38')][_0x1064('0x3d')]));_0x4d1e9a[_0x1064('0x3c')]=_0x4d1e9a[_0x1064('0x3c')]['length']?_0x4d1e9a[_0x1064('0x3c')]:_0x271f08[_0x1064('0x3b')];if(_0x340232[_0x1064('0x38')][_0x1064('0x4a')]){_0x4d1e9a[_0x1064('0x4b')]=[{'all':!![]}];}_0x4d1e9a=_[_0x1064('0x48')]({},_0x4d1e9a,_0x340232['options']);return db[_0x1064('0x49')]['find'](_0x4d1e9a)[_0x1064('0x1b')](handleEntityNotFound(_0x53e2a9,null))[_0x1064('0x1b')](respondWithResult(_0x53e2a9,null))['catch'](handleError(_0x53e2a9,null));};exports[_0x1064('0x51')]=function(_0x2660a0,_0x1224ac){return db[_0x1064('0x49')]['create'](_0x2660a0[_0x1064('0x52')],{})[_0x1064('0x1b')](respondWithResult(_0x1224ac,0xc9))[_0x1064('0x26')](handleError(_0x1224ac,null));};exports[_0x1064('0x2f')]=function(_0x4a7ea7,_0x2b8f5f){if(_0x4a7ea7[_0x1064('0x52')]['id']){delete _0x4a7ea7[_0x1064('0x52')]['id'];}return db[_0x1064('0x49')][_0x1064('0x53')]({'where':{'id':_0x4a7ea7[_0x1064('0x4f')]['id']}})['then'](handleEntityNotFound(_0x2b8f5f,null))[_0x1064('0x1b')](saveUpdates(_0x4a7ea7[_0x1064('0x52')],null))[_0x1064('0x1b')](respondWithResult(_0x2b8f5f,null))['catch'](handleError(_0x2b8f5f,null));};exports[_0x1064('0x30')]=function(_0x77a0e2,_0x2b8143){return db['SalesforceConfiguration'][_0x1064('0x53')]({'where':{'id':_0x77a0e2[_0x1064('0x4f')]['id']}})['then'](handleEntityNotFound(_0x2b8143,null))['then'](removeEntity(_0x2b8143,null))[_0x1064('0x26')](handleError(_0x2b8143,null));};exports[_0x1064('0x54')]=function(_0xc5d2d6,_0x5e98d3,_0x2d03dc){var _0x329c2c={};var _0x10d674={};var _0x527362;var _0x3f5966;return db[_0x1064('0x49')]['findOne']({'where':{'id':_0xc5d2d6[_0x1064('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5e98d3,null))[_0x1064('0x1b')](function(_0x353b29){if(_0x353b29){_0x527362=_0x353b29;_0x10d674[_0x1064('0x3b')]=_['keys'](db['SalesforceField'][_0x1064('0x50')]);_0x10d674[_0x1064('0x38')]=_[_0x1064('0x39')](_0xc5d2d6[_0x1064('0x38')]);_0x10d674[_0x1064('0x43')]=_[_0x1064('0x3a')](_0x10d674[_0x1064('0x3b')],_0x10d674['query']);_0x329c2c[_0x1064('0x3c')]=_[_0x1064('0x3a')](_0x10d674[_0x1064('0x3b')],qs[_0x1064('0x3d')](_0xc5d2d6[_0x1064('0x38')]['fields']));_0x329c2c[_0x1064('0x3c')]=_0x329c2c[_0x1064('0x3c')][_0x1064('0x3e')]?_0x329c2c[_0x1064('0x3c')]:_0x10d674[_0x1064('0x3b')];_0x329c2c[_0x1064('0x41')]=qs[_0x1064('0x42')](_0xc5d2d6[_0x1064('0x38')][_0x1064('0x42')]);_0x329c2c[_0x1064('0x45')]=qs[_0x1064('0x43')](_[_0x1064('0x55')](_0xc5d2d6[_0x1064('0x38')],_0x10d674[_0x1064('0x43')]));if(_0xc5d2d6['query']['filter']){_0x329c2c[_0x1064('0x45')]=_['merge'](_0x329c2c[_0x1064('0x45')],{'$or':_[_0x1064('0x35')](_0x329c2c[_0x1064('0x3c')],function(_0x96bd6d){var _0x13bf46={};_0x13bf46[_0x96bd6d]={'$like':'%'+_0xc5d2d6[_0x1064('0x38')]['filter']+'%'};return _0x13bf46;})});}_0x329c2c=_[_0x1064('0x48')]({},_0x329c2c,_0xc5d2d6[_0x1064('0x56')]);return _0x527362[_0x1064('0x54')](_0x329c2c);}})['then'](function(_0xe0cb7d){if(_0xe0cb7d){_0x3f5966=_0xe0cb7d['length'];if(!_0xc5d2d6['query']['hasOwnProperty']('nolimit')){_0x329c2c['limit']=qs[_0x1064('0x2a')](_0xc5d2d6[_0x1064('0x38')]['limit']);_0x329c2c[_0x1064('0x29')]=qs['offset'](_0xc5d2d6['query'][_0x1064('0x29')]);}return _0x527362[_0x1064('0x54')](_0x329c2c);}})[_0x1064('0x1b')](function(_0x5f415d){if(_0x5f415d){return _0x5f415d?{'count':_0x3f5966,'rows':_0x5f415d}:null;}})[_0x1064('0x1b')](respondWithResult(_0x5e98d3,null))[_0x1064('0x26')](handleError(_0x5e98d3,null));};exports[_0x1064('0x57')]=function(_0x15eecd,_0x581445,_0x3da652){var _0x3d596e={};var _0x59c71e={};var _0x11f4aa;var _0xfd5c01;return db[_0x1064('0x49')][_0x1064('0x58')]({'where':{'id':_0x15eecd[_0x1064('0x4f')]['id']}})[_0x1064('0x1b')](handleEntityNotFound(_0x581445,null))[_0x1064('0x1b')](function(_0x5e8053){if(_0x5e8053){_0x11f4aa=_0x5e8053;_0x59c71e[_0x1064('0x3b')]=_[_0x1064('0x39')](db['SalesforceField']['rawAttributes']);_0x59c71e['query']=_[_0x1064('0x39')](_0x15eecd[_0x1064('0x38')]);_0x59c71e[_0x1064('0x43')]=_[_0x1064('0x3a')](_0x59c71e['model'],_0x59c71e[_0x1064('0x38')]);_0x3d596e[_0x1064('0x3c')]=_[_0x1064('0x3a')](_0x59c71e[_0x1064('0x3b')],qs['fields'](_0x15eecd[_0x1064('0x38')][_0x1064('0x3d')]));_0x3d596e[_0x1064('0x3c')]=_0x3d596e['attributes'][_0x1064('0x3e')]?_0x3d596e['attributes']:_0x59c71e[_0x1064('0x3b')];_0x3d596e['order']=qs[_0x1064('0x42')](_0x15eecd[_0x1064('0x38')]['sort']);_0x3d596e[_0x1064('0x45')]=qs[_0x1064('0x43')](_[_0x1064('0x55')](_0x15eecd[_0x1064('0x38')],_0x59c71e[_0x1064('0x43')]));if(_0x15eecd[_0x1064('0x38')][_0x1064('0x44')]){_0x3d596e[_0x1064('0x45')]=_[_0x1064('0x48')](_0x3d596e[_0x1064('0x45')],{'$or':_[_0x1064('0x35')](_0x3d596e[_0x1064('0x3c')],function(_0x8193b){var _0x2f85f3={};_0x2f85f3[_0x8193b]={'$like':'%'+_0x15eecd['query']['filter']+'%'};return _0x2f85f3;})});}_0x3d596e=_[_0x1064('0x48')]({},_0x3d596e,_0x15eecd['options']);return _0x11f4aa[_0x1064('0x57')](_0x3d596e);}})[_0x1064('0x1b')](function(_0x2018ea){if(_0x2018ea){_0xfd5c01=_0x2018ea[_0x1064('0x3e')];if(!_0x15eecd[_0x1064('0x38')]['hasOwnProperty'](_0x1064('0x40'))){_0x3d596e[_0x1064('0x2a')]=qs['limit'](_0x15eecd[_0x1064('0x38')]['limit']);_0x3d596e[_0x1064('0x29')]=qs['offset'](_0x15eecd[_0x1064('0x38')][_0x1064('0x29')]);}return _0x11f4aa[_0x1064('0x57')](_0x3d596e);}})[_0x1064('0x1b')](function(_0x36dbb5){if(_0x36dbb5){return _0x36dbb5?{'count':_0xfd5c01,'rows':_0x36dbb5}:null;}})[_0x1064('0x1b')](respondWithResult(_0x581445,null))[_0x1064('0x26')](handleError(_0x581445,null));};exports[_0x1064('0x59')]=function(_0x4885aa,_0xd4a58c,_0x3e35ab){var _0xb871f0={};var _0x1755a7={};var _0x6b9b9b;var _0x310a56;return db[_0x1064('0x49')][_0x1064('0x58')]({'where':{'id':_0x4885aa[_0x1064('0x4f')]['id']}})[_0x1064('0x1b')](handleEntityNotFound(_0xd4a58c,null))['then'](function(_0x53ba17){if(_0x53ba17){_0x6b9b9b=_0x53ba17;_0x1755a7[_0x1064('0x3b')]=_['keys'](db[_0x1064('0x5a')]['rawAttributes']);_0x1755a7['query']=_[_0x1064('0x39')](_0x4885aa[_0x1064('0x38')]);_0x1755a7[_0x1064('0x43')]=_[_0x1064('0x3a')](_0x1755a7[_0x1064('0x3b')],_0x1755a7[_0x1064('0x38')]);_0xb871f0[_0x1064('0x3c')]=_[_0x1064('0x3a')](_0x1755a7[_0x1064('0x3b')],qs[_0x1064('0x3d')](_0x4885aa[_0x1064('0x38')][_0x1064('0x3d')]));_0xb871f0[_0x1064('0x3c')]=_0xb871f0[_0x1064('0x3c')][_0x1064('0x3e')]?_0xb871f0[_0x1064('0x3c')]:_0x1755a7[_0x1064('0x3b')];_0xb871f0[_0x1064('0x41')]=qs[_0x1064('0x42')](_0x4885aa[_0x1064('0x38')][_0x1064('0x42')]);_0xb871f0[_0x1064('0x45')]=qs[_0x1064('0x43')](_[_0x1064('0x55')](_0x4885aa[_0x1064('0x38')],_0x1755a7[_0x1064('0x43')]));if(_0x4885aa['query'][_0x1064('0x44')]){_0xb871f0[_0x1064('0x45')]=_[_0x1064('0x48')](_0xb871f0[_0x1064('0x45')],{'$or':_[_0x1064('0x35')](_0xb871f0[_0x1064('0x3c')],function(_0x4046a8){var _0x2fbd36={};_0x2fbd36[_0x4046a8]={'$like':'%'+_0x4885aa['query'][_0x1064('0x44')]+'%'};return _0x2fbd36;})});}_0xb871f0=_[_0x1064('0x48')]({},_0xb871f0,_0x4885aa[_0x1064('0x56')]);return _0x6b9b9b[_0x1064('0x59')](_0xb871f0);}})[_0x1064('0x1b')](function(_0x62dc66){if(_0x62dc66){_0x310a56=_0x62dc66['length'];if(!_0x4885aa['query'][_0x1064('0x3f')](_0x1064('0x40'))){_0xb871f0[_0x1064('0x2a')]=qs[_0x1064('0x2a')](_0x4885aa[_0x1064('0x38')][_0x1064('0x2a')]);_0xb871f0[_0x1064('0x29')]=qs[_0x1064('0x29')](_0x4885aa['query'][_0x1064('0x29')]);}return _0x6b9b9b[_0x1064('0x59')](_0xb871f0);}})[_0x1064('0x1b')](function(_0x514aff){if(_0x514aff){return _0x514aff?{'count':_0x310a56,'rows':_0x514aff}:null;}})['then'](respondWithResult(_0xd4a58c,null))[_0x1064('0x26')](handleError(_0xd4a58c,null));}; \ No newline at end of file +var _0xd00a=['hasOwnProperty','nolimit','limit','sort','where','pick','filters','filter','merge','VIRTUAL','field','options','include','findAll','show','params','keys','includeAll','find','create','body','destroy','findOne','SalesforceField','order','getFields','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','to-csv','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','SalesforceConfiguration,\x20%s,\x20%s','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','set','Content-Range','reject','save','update','name','send','index','SalesforceConfiguration','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','fields','length'];(function(_0xc057ab,_0x1cd50e){var _0x1eeacd=function(_0x487a0e){while(--_0x487a0e){_0xc057ab['push'](_0xc057ab['shift']());}};_0x1eeacd(++_0x1cd50e);}(_0xd00a,0x1e3));var _0xad00=function(_0x3b91c1,_0x3f991c){_0x3b91c1=_0x3b91c1-0x0;var _0x170474=_0xd00a[_0x3b91c1];return _0x170474;};'use strict';var pdf=require(_0xad00('0x0'));var emlformat=require(_0xad00('0x1'));var rimraf=require(_0xad00('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xad00('0x3'));var rp=require('request-promise');var moment=require(_0xad00('0x4'));var BPromise=require(_0xad00('0x5'));var Mustache=require(_0xad00('0x6'));var util=require(_0xad00('0x7'));var path=require(_0xad00('0x8'));var sox=require(_0xad00('0x9'));var csv=require('to-csv');var ejs=require(_0xad00('0xa'));var fs=require('fs');var _=require(_0xad00('0xb'));var squel=require(_0xad00('0xc'));var crypto=require('crypto');var jsforce=require(_0xad00('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xad00('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xad00('0xf'));var as=require(_0xad00('0x10'));var hardwareService=require(_0xad00('0x11'));var logger=require(_0xad00('0x12'))(_0xad00('0x13'));var utils=require('../../config/utils');var config=require(_0xad00('0x14'));var db=require(_0xad00('0x15'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xad00('0x16')][_0xad00('0x17')]({'port':0x232a});function checkPasswordPattern(_0x1cdc8b,_0x26f84d,_0x3329a0){if(_0x3329a0){var _0x3da494=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3da494[_0xad00('0x18')](_0x26f84d)){return _0x1cdc8b;}else{throw new Error(_0xad00('0x19'));}}else{return _0x1cdc8b;}}function respondWithRpcPromise(_0x58a3db,_0x3cc6f8,_0x32641a,_0x292248){return new BPromise(function(_0x5eece6,_0x235481){var _0x465c0b=_0x292248||client;return _0x465c0b['request'](_0x58a3db,_0x32641a)[_0xad00('0x1a')](function(_0x5cb8df){logger['info'](_0xad00('0x1b'),_0x3cc6f8,'request\x20sent');logger[_0xad00('0x1c')](_0xad00('0x1d'),_0x3cc6f8,_0xad00('0x1e'),JSON[_0xad00('0x1f')](_0x5cb8df));if(_0x5cb8df[_0xad00('0x20')]){if(_0x5cb8df[_0xad00('0x20')][_0xad00('0x21')]===0x1f4){logger[_0xad00('0x20')](_0xad00('0x1b'),_0x3cc6f8,_0x5cb8df['error']['message']);return _0x235481(_0x5cb8df[_0xad00('0x20')][_0xad00('0x22')]);}logger[_0xad00('0x20')]('SalesforceConfiguration,\x20%s,\x20%s',_0x3cc6f8,_0x5cb8df[_0xad00('0x20')][_0xad00('0x22')]);return _0x5eece6(_0x5cb8df[_0xad00('0x20')][_0xad00('0x22')]);}else{logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x3cc6f8,_0xad00('0x1e'));_0x5eece6(_0x5cb8df[_0xad00('0x23')][_0xad00('0x22')]);}})[_0xad00('0x24')](function(_0x21a038){logger[_0xad00('0x20')](_0xad00('0x1b'),_0x3cc6f8,_0x21a038);_0x235481(_0x21a038);});});}function respondWithStatusCode(_0x512183,_0x5d3d80){_0x5d3d80=_0x5d3d80||0xcc;return function(_0x115fba){if(_0x115fba){return _0x512183[_0xad00('0x25')](_0x5d3d80);}return _0x512183[_0xad00('0x26')](_0x5d3d80)[_0xad00('0x27')]();};}function respondWithResult(_0x5b6618,_0x5c767e){_0x5c767e=_0x5c767e||0xc8;return function(_0x3eaf51){if(_0x3eaf51){return _0x5b6618[_0xad00('0x26')](_0x5c767e)[_0xad00('0x28')](_0x3eaf51);}};}function respondWithFilteredResult(_0x553a93,_0x24b7a2){return function(_0x4c103c){if(_0x4c103c){var _0x5b5e7f=_0x4c103c[_0xad00('0x29')],_0x24ecfa=_0x24b7a2[_0xad00('0x2a')],_0x2a8bb7=_0x24b7a2[_0xad00('0x2a')]+_0x24b7a2['limit'],_0x4c63de;if(_0x2a8bb7>=_0x5b5e7f){_0x2a8bb7=_0x5b5e7f;_0x4c63de=0xc8;}else{_0x4c63de=0xce;}_0x553a93[_0xad00('0x26')](_0x4c63de);return _0x553a93[_0xad00('0x2b')](_0xad00('0x2c'),_0x24ecfa+'-'+_0x2a8bb7+'/'+_0x5b5e7f)[_0xad00('0x28')](_0x4c103c);}return null;};}function patchUpdates(_0x5c5286){return function(_0xb428c9){try{jsonpatch['apply'](_0xb428c9,_0x5c5286,!![]);}catch(_0x222fd1){return BPromise[_0xad00('0x2d')](_0x222fd1);}return _0xb428c9[_0xad00('0x2e')]();};}function saveUpdates(_0x548c71,_0x89501f){return function(_0x3425c3){if(_0x3425c3){return _0x3425c3[_0xad00('0x2f')](_0x548c71)[_0xad00('0x1a')](function(_0x38922c){return _0x38922c;});}return null;};}function removeEntity(_0x2ee5a1,_0x1acc02){return function(_0x532c81){if(_0x532c81){return _0x532c81['destroy']()[_0xad00('0x1a')](function(){_0x2ee5a1[_0xad00('0x26')](0xcc)[_0xad00('0x27')]();});}};}function handleEntityNotFound(_0x50346c,_0x1ceccd){return function(_0x1fc390){if(!_0x1fc390){_0x50346c[_0xad00('0x25')](0x194);}return _0x1fc390;};}function handleError(_0x4c76da,_0x3caf8c){_0x3caf8c=_0x3caf8c||0x1f4;return function(_0x23d36c){logger[_0xad00('0x20')](_0x23d36c['stack']);if(_0x23d36c['name']){delete _0x23d36c[_0xad00('0x30')];}_0x4c76da[_0xad00('0x26')](_0x3caf8c)[_0xad00('0x31')](_0x23d36c);};}exports[_0xad00('0x32')]=function(_0x429df4,_0x5dfe37){var _0x5ef363={},_0x53574a={},_0x33bafe={'count':0x0,'rows':[]};var _0xb0b8db=_['map'](db[_0xad00('0x33')][_0xad00('0x34')],function(_0x13983b){return{'name':_0x13983b[_0xad00('0x35')],'type':_0x13983b[_0xad00('0x36')][_0xad00('0x37')]};});_0x53574a[_0xad00('0x38')]=_[_0xad00('0x39')](_0xb0b8db,_0xad00('0x30'));_0x53574a[_0xad00('0x3a')]=_['keys'](_0x429df4[_0xad00('0x3a')]);_0x53574a['filters']=_[_0xad00('0x3b')](_0x53574a[_0xad00('0x38')],_0x53574a['query']);_0x5ef363[_0xad00('0x3c')]=_[_0xad00('0x3b')](_0x53574a['model'],qs[_0xad00('0x3d')](_0x429df4[_0xad00('0x3a')][_0xad00('0x3d')]));_0x5ef363[_0xad00('0x3c')]=_0x5ef363[_0xad00('0x3c')][_0xad00('0x3e')]?_0x5ef363[_0xad00('0x3c')]:_0x53574a[_0xad00('0x38')];if(!_0x429df4[_0xad00('0x3a')][_0xad00('0x3f')](_0xad00('0x40'))){_0x5ef363['limit']=qs[_0xad00('0x41')](_0x429df4[_0xad00('0x3a')][_0xad00('0x41')]);_0x5ef363[_0xad00('0x2a')]=qs[_0xad00('0x2a')](_0x429df4[_0xad00('0x3a')][_0xad00('0x2a')]);}_0x5ef363['order']=qs[_0xad00('0x42')](_0x429df4['query']['sort']);_0x5ef363[_0xad00('0x43')]=qs['filters'](_[_0xad00('0x44')](_0x429df4[_0xad00('0x3a')],_0x53574a[_0xad00('0x45')]));if(_0x429df4[_0xad00('0x3a')][_0xad00('0x46')]){_0x5ef363['where']=_[_0xad00('0x47')](_0x5ef363[_0xad00('0x43')],{'$or':_[_0xad00('0x39')](_0xb0b8db,function(_0x5be3fb){if(_0x5be3fb[_0xad00('0x36')]['key']!==_0xad00('0x48')){var _0x3db08a={};_0x3db08a[_0x5be3fb[_0xad00('0x49')]]={'$like':'%'+_0x429df4[_0xad00('0x3a')]['filter']+'%'};return _0x3db08a;}})});}_0x5ef363=_[_0xad00('0x47')]({},_0x5ef363,_0x429df4[_0xad00('0x4a')]);var _0x15038c={'where':_0x5ef363[_0xad00('0x43')]};return db['SalesforceConfiguration'][_0xad00('0x29')](_0x15038c)[_0xad00('0x1a')](function(_0x2127d6){_0x33bafe[_0xad00('0x29')]=_0x2127d6;if(_0x429df4['query']['includeAll']){_0x5ef363[_0xad00('0x4b')]=[{'all':!![]}];}return db[_0xad00('0x33')][_0xad00('0x4c')](_0x5ef363);})[_0xad00('0x1a')](function(_0xd49f5){_0x33bafe['rows']=_0xd49f5;return _0x33bafe;})[_0xad00('0x1a')](respondWithFilteredResult(_0x5dfe37,_0x5ef363))['catch'](handleError(_0x5dfe37,null));};exports[_0xad00('0x4d')]=function(_0x230555,_0xebe9aa){var _0xf1c0e5={'raw':![],'where':{'id':_0x230555[_0xad00('0x4e')]['id']}},_0x5741fc={};_0x5741fc[_0xad00('0x38')]=_[_0xad00('0x4f')](db[_0xad00('0x33')][_0xad00('0x34')]);_0x5741fc['query']=_[_0xad00('0x4f')](_0x230555['query']);_0x5741fc[_0xad00('0x45')]=_[_0xad00('0x3b')](_0x5741fc[_0xad00('0x38')],_0x5741fc[_0xad00('0x3a')]);_0xf1c0e5[_0xad00('0x3c')]=_['intersection'](_0x5741fc[_0xad00('0x38')],qs['fields'](_0x230555[_0xad00('0x3a')][_0xad00('0x3d')]));_0xf1c0e5['attributes']=_0xf1c0e5[_0xad00('0x3c')]['length']?_0xf1c0e5['attributes']:_0x5741fc[_0xad00('0x38')];if(_0x230555['query'][_0xad00('0x50')]){_0xf1c0e5[_0xad00('0x4b')]=[{'all':!![]}];}_0xf1c0e5=_[_0xad00('0x47')]({},_0xf1c0e5,_0x230555[_0xad00('0x4a')]);return db['SalesforceConfiguration'][_0xad00('0x51')](_0xf1c0e5)[_0xad00('0x1a')](handleEntityNotFound(_0xebe9aa,null))[_0xad00('0x1a')](respondWithResult(_0xebe9aa,null))[_0xad00('0x24')](handleError(_0xebe9aa,null));};exports[_0xad00('0x52')]=function(_0x4af409,_0x2bbfb3){return db[_0xad00('0x33')][_0xad00('0x52')](_0x4af409[_0xad00('0x53')],{})[_0xad00('0x1a')](respondWithResult(_0x2bbfb3,0xc9))[_0xad00('0x24')](handleError(_0x2bbfb3,null));};exports[_0xad00('0x2f')]=function(_0x5a96da,_0x4b9617){if(_0x5a96da[_0xad00('0x53')]['id']){delete _0x5a96da['body']['id'];}return db['SalesforceConfiguration'][_0xad00('0x51')]({'where':{'id':_0x5a96da['params']['id']}})[_0xad00('0x1a')](handleEntityNotFound(_0x4b9617,null))[_0xad00('0x1a')](saveUpdates(_0x5a96da['body'],null))[_0xad00('0x1a')](respondWithResult(_0x4b9617,null))[_0xad00('0x24')](handleError(_0x4b9617,null));};exports[_0xad00('0x54')]=function(_0x1c5644,_0x538e84){return db[_0xad00('0x33')]['find']({'where':{'id':_0x1c5644['params']['id']}})[_0xad00('0x1a')](handleEntityNotFound(_0x538e84,null))['then'](removeEntity(_0x538e84,null))[_0xad00('0x24')](handleError(_0x538e84,null));};exports['getFields']=function(_0x534a20,_0x19b512,_0x563a87){var _0x2d58eb={};var _0x5cb2d0={};var _0x2bd13a;var _0x38d552;return db['SalesforceConfiguration'][_0xad00('0x55')]({'where':{'id':_0x534a20[_0xad00('0x4e')]['id']}})['then'](handleEntityNotFound(_0x19b512,null))['then'](function(_0x39d24f){if(_0x39d24f){_0x2bd13a=_0x39d24f;_0x5cb2d0[_0xad00('0x38')]=_[_0xad00('0x4f')](db[_0xad00('0x56')][_0xad00('0x34')]);_0x5cb2d0[_0xad00('0x3a')]=_['keys'](_0x534a20[_0xad00('0x3a')]);_0x5cb2d0[_0xad00('0x45')]=_[_0xad00('0x3b')](_0x5cb2d0[_0xad00('0x38')],_0x5cb2d0[_0xad00('0x3a')]);_0x2d58eb[_0xad00('0x3c')]=_[_0xad00('0x3b')](_0x5cb2d0[_0xad00('0x38')],qs[_0xad00('0x3d')](_0x534a20['query'][_0xad00('0x3d')]));_0x2d58eb[_0xad00('0x3c')]=_0x2d58eb[_0xad00('0x3c')][_0xad00('0x3e')]?_0x2d58eb[_0xad00('0x3c')]:_0x5cb2d0[_0xad00('0x38')];_0x2d58eb[_0xad00('0x57')]=qs[_0xad00('0x42')](_0x534a20[_0xad00('0x3a')][_0xad00('0x42')]);_0x2d58eb['where']=qs[_0xad00('0x45')](_[_0xad00('0x44')](_0x534a20[_0xad00('0x3a')],_0x5cb2d0['filters']));if(_0x534a20['query']['filter']){_0x2d58eb[_0xad00('0x43')]=_[_0xad00('0x47')](_0x2d58eb[_0xad00('0x43')],{'$or':_[_0xad00('0x39')](_0x2d58eb['attributes'],function(_0x2fa563){var _0x117fa3={};_0x117fa3[_0x2fa563]={'$like':'%'+_0x534a20[_0xad00('0x3a')][_0xad00('0x46')]+'%'};return _0x117fa3;})});}_0x2d58eb=_['merge']({},_0x2d58eb,_0x534a20[_0xad00('0x4a')]);return _0x2bd13a[_0xad00('0x58')](_0x2d58eb);}})[_0xad00('0x1a')](function(_0x1db59e){if(_0x1db59e){_0x38d552=_0x1db59e[_0xad00('0x3e')];if(!_0x534a20['query'][_0xad00('0x3f')](_0xad00('0x40'))){_0x2d58eb[_0xad00('0x41')]=qs[_0xad00('0x41')](_0x534a20[_0xad00('0x3a')][_0xad00('0x41')]);_0x2d58eb[_0xad00('0x2a')]=qs[_0xad00('0x2a')](_0x534a20[_0xad00('0x3a')][_0xad00('0x2a')]);}return _0x2bd13a[_0xad00('0x58')](_0x2d58eb);}})[_0xad00('0x1a')](function(_0x3f1baa){if(_0x3f1baa){return _0x3f1baa?{'count':_0x38d552,'rows':_0x3f1baa}:null;}})[_0xad00('0x1a')](respondWithResult(_0x19b512,null))[_0xad00('0x24')](handleError(_0x19b512,null));};exports['getSubjects']=function(_0x2f8d83,_0x4afee6,_0x51bcb1){var _0x568f69={};var _0x4713b={};var _0x1f03ad;var _0x3072c1;return db[_0xad00('0x33')][_0xad00('0x55')]({'where':{'id':_0x2f8d83[_0xad00('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4afee6,null))['then'](function(_0x488ade){if(_0x488ade){_0x1f03ad=_0x488ade;_0x4713b[_0xad00('0x38')]=_[_0xad00('0x4f')](db[_0xad00('0x56')][_0xad00('0x34')]);_0x4713b[_0xad00('0x3a')]=_[_0xad00('0x4f')](_0x2f8d83[_0xad00('0x3a')]);_0x4713b[_0xad00('0x45')]=_['intersection'](_0x4713b[_0xad00('0x38')],_0x4713b['query']);_0x568f69['attributes']=_[_0xad00('0x3b')](_0x4713b[_0xad00('0x38')],qs[_0xad00('0x3d')](_0x2f8d83['query']['fields']));_0x568f69[_0xad00('0x3c')]=_0x568f69[_0xad00('0x3c')][_0xad00('0x3e')]?_0x568f69[_0xad00('0x3c')]:_0x4713b['model'];_0x568f69[_0xad00('0x57')]=qs[_0xad00('0x42')](_0x2f8d83[_0xad00('0x3a')][_0xad00('0x42')]);_0x568f69[_0xad00('0x43')]=qs[_0xad00('0x45')](_['pick'](_0x2f8d83[_0xad00('0x3a')],_0x4713b[_0xad00('0x45')]));if(_0x2f8d83['query'][_0xad00('0x46')]){_0x568f69[_0xad00('0x43')]=_['merge'](_0x568f69[_0xad00('0x43')],{'$or':_[_0xad00('0x39')](_0x568f69[_0xad00('0x3c')],function(_0x6f56fd){var _0x46ec2c={};_0x46ec2c[_0x6f56fd]={'$like':'%'+_0x2f8d83[_0xad00('0x3a')][_0xad00('0x46')]+'%'};return _0x46ec2c;})});}_0x568f69=_[_0xad00('0x47')]({},_0x568f69,_0x2f8d83['options']);return _0x1f03ad[_0xad00('0x59')](_0x568f69);}})[_0xad00('0x1a')](function(_0x3e8139){if(_0x3e8139){_0x3072c1=_0x3e8139[_0xad00('0x3e')];if(!_0x2f8d83[_0xad00('0x3a')]['hasOwnProperty'](_0xad00('0x40'))){_0x568f69[_0xad00('0x41')]=qs['limit'](_0x2f8d83['query']['limit']);_0x568f69[_0xad00('0x2a')]=qs[_0xad00('0x2a')](_0x2f8d83[_0xad00('0x3a')][_0xad00('0x2a')]);}return _0x1f03ad[_0xad00('0x59')](_0x568f69);}})[_0xad00('0x1a')](function(_0x2479d8){if(_0x2479d8){return _0x2479d8?{'count':_0x3072c1,'rows':_0x2479d8}:null;}})[_0xad00('0x1a')](respondWithResult(_0x4afee6,null))['catch'](handleError(_0x4afee6,null));};exports[_0xad00('0x5a')]=function(_0x3e4652,_0x5f176b,_0xf236c){var _0x1a7fad={};var _0x172201={};var _0x358517;var _0x47a78e;return db[_0xad00('0x33')][_0xad00('0x55')]({'where':{'id':_0x3e4652[_0xad00('0x4e')]['id']}})[_0xad00('0x1a')](handleEntityNotFound(_0x5f176b,null))[_0xad00('0x1a')](function(_0x477a79){if(_0x477a79){_0x358517=_0x477a79;_0x172201[_0xad00('0x38')]=_[_0xad00('0x4f')](db[_0xad00('0x56')]['rawAttributes']);_0x172201[_0xad00('0x3a')]=_[_0xad00('0x4f')](_0x3e4652['query']);_0x172201[_0xad00('0x45')]=_['intersection'](_0x172201[_0xad00('0x38')],_0x172201[_0xad00('0x3a')]);_0x1a7fad[_0xad00('0x3c')]=_[_0xad00('0x3b')](_0x172201[_0xad00('0x38')],qs[_0xad00('0x3d')](_0x3e4652[_0xad00('0x3a')]['fields']));_0x1a7fad[_0xad00('0x3c')]=_0x1a7fad[_0xad00('0x3c')][_0xad00('0x3e')]?_0x1a7fad[_0xad00('0x3c')]:_0x172201[_0xad00('0x38')];_0x1a7fad['order']=qs['sort'](_0x3e4652['query'][_0xad00('0x42')]);_0x1a7fad[_0xad00('0x43')]=qs[_0xad00('0x45')](_[_0xad00('0x44')](_0x3e4652['query'],_0x172201[_0xad00('0x45')]));if(_0x3e4652[_0xad00('0x3a')][_0xad00('0x46')]){_0x1a7fad[_0xad00('0x43')]=_[_0xad00('0x47')](_0x1a7fad[_0xad00('0x43')],{'$or':_['map'](_0x1a7fad[_0xad00('0x3c')],function(_0x55d542){var _0x360e60={};_0x360e60[_0x55d542]={'$like':'%'+_0x3e4652['query'][_0xad00('0x46')]+'%'};return _0x360e60;})});}_0x1a7fad=_[_0xad00('0x47')]({},_0x1a7fad,_0x3e4652[_0xad00('0x4a')]);return _0x358517[_0xad00('0x5a')](_0x1a7fad);}})[_0xad00('0x1a')](function(_0x48924a){if(_0x48924a){_0x47a78e=_0x48924a[_0xad00('0x3e')];if(!_0x3e4652[_0xad00('0x3a')]['hasOwnProperty']('nolimit')){_0x1a7fad[_0xad00('0x41')]=qs[_0xad00('0x41')](_0x3e4652[_0xad00('0x3a')][_0xad00('0x41')]);_0x1a7fad['offset']=qs[_0xad00('0x2a')](_0x3e4652[_0xad00('0x3a')][_0xad00('0x2a')]);}return _0x358517[_0xad00('0x5a')](_0x1a7fad);}})[_0xad00('0x1a')](function(_0x502e1b){if(_0x502e1b){return _0x502e1b?{'count':_0x47a78e,'rows':_0x502e1b}:null;}})[_0xad00('0x1a')](respondWithResult(_0x5f176b,null))[_0xad00('0x24')](handleError(_0x5f176b,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index c27de1f..9dc7b59 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 _0x748a=['define','SalesforceConfiguration','int_salesforce_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','exports'];(function(_0x6c28d7,_0x2e6dcb){var _0x22369c=function(_0x2ee07a){while(--_0x2ee07a){_0x6c28d7['push'](_0x6c28d7['shift']());}};_0x22369c(++_0x2e6dcb);}(_0x748a,0xc6));var _0xa748=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x748a[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0xa748('0x0'));var util=require(_0xa748('0x1'));var logger=require(_0xa748('0x2'))(_0xa748('0x3'));var moment=require(_0xa748('0x4'));var BPromise=require(_0xa748('0x5'));var rp=require(_0xa748('0x6'));var fs=require('fs');var path=require(_0xa748('0x7'));var rimraf=require(_0xa748('0x8'));var config=require(_0xa748('0x9'));var attributes=require(_0xa748('0xa'));module[_0xa748('0xb')]=function(_0xcf5f02,_0x93f7c1){return _0xcf5f02[_0xa748('0xc')](_0xa748('0xd'),attributes,{'tableName':_0xa748('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x535f=['SalesforceConfiguration','int_salesforce_configurations','util','moment','bluebird','request-promise','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','exports','define'];(function(_0x2d7136,_0x4d45a3){var _0x43c608=function(_0x1c0f48){while(--_0x1c0f48){_0x2d7136['push'](_0x2d7136['shift']());}};_0x43c608(++_0x4d45a3);}(_0x535f,0x115));var _0xf535=function(_0xf18452,_0x1df28e){_0xf18452=_0xf18452-0x0;var _0x2d87c2=_0x535f[_0xf18452];return _0x2d87c2;};'use strict';var _=require('lodash');var util=require(_0xf535('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xf535('0x1'));var BPromise=require(_0xf535('0x2'));var rp=require(_0xf535('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf535('0x4'));var config=require(_0xf535('0x5'));var attributes=require(_0xf535('0x6'));module[_0xf535('0x7')]=function(_0x34c5c6,_0x39f5da){return _0x34c5c6[_0xf535('0x8')](_0xf535('0x9'),attributes,{'tableName':_0xf535('0xa'),'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 159bbc6..3c56033 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 _0x3fa5=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x1facbb,_0x23b719){var _0x561981=function(_0x18b566){while(--_0x18b566){_0x1facbb['push'](_0x1facbb['shift']());}};_0x561981(++_0x23b719);}(_0x3fa5,0x1c2));var _0x53fa=function(_0x222bd0,_0x4ca0fc){_0x222bd0=_0x222bd0-0x0;var _0x31199c=_0x3fa5[_0x222bd0];return _0x31199c;};'use strict';var _=require('lodash');var util=require(_0x53fa('0x0'));var moment=require(_0x53fa('0x1'));var BPromise=require(_0x53fa('0x2'));var rs=require(_0x53fa('0x3'));var fs=require('fs');var Redis=require(_0x53fa('0x4'));var db=require(_0x53fa('0x5'))['db'];var utils=require(_0x53fa('0x6'));var logger=require(_0x53fa('0x7'))(_0x53fa('0x8'));var config=require(_0x53fa('0x9'));var jayson=require(_0x53fa('0xa'));var client=jayson[_0x53fa('0xb')][_0x53fa('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x152988,_0x591a11,_0x22d082){return new BPromise(function(_0x498f1f,_0x455804){return client['request'](_0x152988,_0x22d082)[_0x53fa('0xd')](function(_0x50f318){logger[_0x53fa('0xe')](_0x53fa('0xf'),_0x591a11,_0x53fa('0x10'));logger[_0x53fa('0x11')](_0x53fa('0x12'),_0x591a11,_0x53fa('0x10'),JSON[_0x53fa('0x13')](_0x50f318));if(_0x50f318['error']){if(_0x50f318[_0x53fa('0x14')][_0x53fa('0x15')]===0x1f4){logger[_0x53fa('0x14')](_0x53fa('0xf'),_0x591a11,_0x50f318[_0x53fa('0x14')]['message']);return _0x455804(_0x50f318[_0x53fa('0x14')][_0x53fa('0x16')]);}logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x591a11,_0x50f318['error'][_0x53fa('0x16')]);return _0x498f1f(_0x50f318[_0x53fa('0x14')][_0x53fa('0x16')]);}else{logger[_0x53fa('0xe')](_0x53fa('0xf'),_0x591a11,_0x53fa('0x10'));_0x498f1f(_0x50f318[_0x53fa('0x17')][_0x53fa('0x16')]);}})[_0x53fa('0x18')](function(_0x531140){logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x591a11,_0x531140);_0x455804(_0x531140);});});} \ No newline at end of file +var _0x77d4=['request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','SalesforceConfiguration,\x20%s,\x20%s','message','info','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then'];(function(_0x2cdf66,_0x530f7f){var _0x5af684=function(_0x3a2d69){while(--_0x3a2d69){_0x2cdf66['push'](_0x2cdf66['shift']());}};_0x5af684(++_0x530f7f);}(_0x77d4,0x1c0));var _0x477d=function(_0x5ed88a,_0x1d13a7){_0x5ed88a=_0x5ed88a-0x0;var _0x5233fb=_0x77d4[_0x5ed88a];return _0x5233fb;};'use strict';var _=require(_0x477d('0x0'));var util=require(_0x477d('0x1'));var moment=require('moment');var BPromise=require(_0x477d('0x2'));var rs=require(_0x477d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x477d('0x4'))['db'];var utils=require(_0x477d('0x5'));var logger=require(_0x477d('0x6'))(_0x477d('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x477d('0x8')][_0x477d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x183ab2,_0x123c9b,_0x43fb81){return new BPromise(function(_0xf43b93,_0x166565){return client[_0x477d('0xa')](_0x183ab2,_0x43fb81)[_0x477d('0xb')](function(_0x5c7ebd){logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x123c9b,_0x477d('0xc'));logger[_0x477d('0xd')](_0x477d('0xe'),_0x123c9b,_0x477d('0xc'),JSON[_0x477d('0xf')](_0x5c7ebd));if(_0x5c7ebd[_0x477d('0x10')]){if(_0x5c7ebd[_0x477d('0x10')][_0x477d('0x11')]===0x1f4){logger[_0x477d('0x10')](_0x477d('0x12'),_0x123c9b,_0x5c7ebd[_0x477d('0x10')][_0x477d('0x13')]);return _0x166565(_0x5c7ebd[_0x477d('0x10')][_0x477d('0x13')]);}logger['error'](_0x477d('0x12'),_0x123c9b,_0x5c7ebd[_0x477d('0x10')][_0x477d('0x13')]);return _0xf43b93(_0x5c7ebd[_0x477d('0x10')]['message']);}else{logger[_0x477d('0x14')]('SalesforceConfiguration,\x20%s,\x20%s',_0x123c9b,_0x477d('0xc'));_0xf43b93(_0x5c7ebd[_0x477d('0x15')]['message']);}})[_0x477d('0x16')](function(_0x49b783){logger[_0x477d('0x10')]('SalesforceConfiguration,\x20%s,\x20%s',_0x123c9b,_0x49b783);_0x166565(_0x49b783);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index de9b631..3f2a777 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 _0x6f47=['put','delete','exports','util','path','express','../../components/auth/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','/:id','post','create'];(function(_0x1e4f93,_0x3a2579){var _0x344641=function(_0x28e1c9){while(--_0x28e1c9){_0x1e4f93['push'](_0x1e4f93['shift']());}};_0x344641(++_0x3a2579);}(_0x6f47,0xc7));var _0x76f4=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x6f47[_0x4c12ec];return _0x3ae42c;};'use strict';var multer=require('multer');var util=require(_0x76f4('0x0'));var path=require(_0x76f4('0x1'));var timeout=require('connect-timeout');var express=require(_0x76f4('0x2'));var router=express['Router']();var auth=require(_0x76f4('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x76f4('0x4'));var controller=require(_0x76f4('0x5'));router[_0x76f4('0x6')]('/',auth[_0x76f4('0x7')](),controller['index']);router[_0x76f4('0x6')](_0x76f4('0x8'),auth[_0x76f4('0x7')](),controller['show']);router[_0x76f4('0x9')]('/',auth[_0x76f4('0x7')](),controller[_0x76f4('0xa')]);router[_0x76f4('0xb')](_0x76f4('0x8'),auth['isAuthenticated'](),controller['update']);router[_0x76f4('0xc')](_0x76f4('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0x76f4('0xd')]=router; \ No newline at end of file +var _0x77d4=['Router','../../components/auth/service','./intSalesforceField.controller','get','isAuthenticated','index','/:id','post','put','update','delete','exports','util','connect-timeout'];(function(_0x59a873,_0x5c8a71){var _0x24b9a1=function(_0x379eaa){while(--_0x379eaa){_0x59a873['push'](_0x59a873['shift']());}};_0x24b9a1(++_0x5c8a71);}(_0x77d4,0x108));var _0x477d=function(_0x5c9273,_0x4d348e){_0x5c9273=_0x5c9273-0x0;var _0x3daad7=_0x77d4[_0x5c9273];return _0x3daad7;};'use strict';var multer=require('multer');var util=require(_0x477d('0x0'));var path=require('path');var timeout=require(_0x477d('0x1'));var express=require('express');var router=express[_0x477d('0x2')]();var auth=require(_0x477d('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x477d('0x4'));router[_0x477d('0x5')]('/',auth[_0x477d('0x6')](),controller[_0x477d('0x7')]);router[_0x477d('0x5')](_0x477d('0x8'),auth['isAuthenticated'](),controller['show']);router[_0x477d('0x9')]('/',auth['isAuthenticated'](),controller['create']);router[_0x477d('0xa')](_0x477d('0x8'),auth[_0x477d('0x6')](),controller[_0x477d('0xb')]);router[_0x477d('0xc')]('/:id',auth[_0x477d('0x6')](),controller['destroy']);module[_0x477d('0xd')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 8386fbd..0001516 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 _0xf14a=['STRING','ENUM','string','variable','customVariable','keyValue'];(function(_0x52643f,_0x12fce4){var _0x407a36=function(_0xebe601){while(--_0xebe601){_0x52643f['push'](_0x52643f['shift']());}};_0x407a36(++_0x12fce4);}(_0xf14a,0xd4));var _0xaf14=function(_0x45615f,_0x4a4641){_0x45615f=_0x45615f-0x0;var _0x32a753=_0xf14a[_0x45615f];return _0x32a753;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize['ENUM'](_0xaf14('0x0'),_0xaf14('0x1'),_0xaf14('0x2'),_0xaf14('0x3')),'defaultValue':'string'},'content':{'type':Sequelize[_0xaf14('0x4')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xaf14('0x5')](_0xaf14('0x0'),'variable',_0xaf14('0x2'))},'keyContent':{'type':Sequelize[_0xaf14('0x4')]},'idField':{'type':Sequelize[_0xaf14('0x4')]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x085b=['customVariable','keyValue','STRING','sequelize','exports','ENUM','string','variable'];(function(_0x28a8d0,_0x257510){var _0x87bd45=function(_0x2eecc0){while(--_0x2eecc0){_0x28a8d0['push'](_0x28a8d0['shift']());}};_0x87bd45(++_0x257510);}(_0x085b,0xa3));var _0xb085=function(_0x1184b5,_0x5687a3){_0x1184b5=_0x1184b5-0x0;var _0x68045c=_0x085b[_0x1184b5];return _0x68045c;};'use strict';var Sequelize=require(_0xb085('0x0'));module[_0xb085('0x1')]={'type':{'type':Sequelize[_0xb085('0x2')](_0xb085('0x3'),_0xb085('0x4'),_0xb085('0x5'),_0xb085('0x6')),'defaultValue':_0xb085('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xb085('0x2')](_0xb085('0x3'),_0xb085('0x4'),_0xb085('0x5'))},'keyContent':{'type':Sequelize[_0xb085('0x7')]},'idField':{'type':Sequelize[_0xb085('0x7')]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index abd2eb1..9f0b821 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 _0xe1cd=['Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','map','SalesforceField','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','limit','order','sort','where','filter','merge','key','VIRTUAL','field','options','includeAll','rows','catch','show','rawAttributes','include','find','create','body','destroy','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','status','end','json','count','offset','set'];(function(_0x329b62,_0x45f020){var _0x4c66c2=function(_0xf7eb79){while(--_0xf7eb79){_0x329b62['push'](_0x329b62['shift']());}};_0x4c66c2(++_0x45f020);}(_0xe1cd,0xc0));var _0xde1c=function(_0xbee705,_0x2c2a44){_0xbee705=_0xbee705-0x0;var _0x20f000=_0xe1cd[_0xbee705];return _0x20f000;};'use strict';var pdf=require(_0xde1c('0x0'));var emlformat=require(_0xde1c('0x1'));var rimraf=require(_0xde1c('0x2'));var zipdir=require(_0xde1c('0x3'));var jsonpatch=require(_0xde1c('0x4'));var rp=require(_0xde1c('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xde1c('0x6'));var path=require(_0xde1c('0x7'));var sox=require(_0xde1c('0x8'));var csv=require(_0xde1c('0x9'));var ejs=require(_0xde1c('0xa'));var fs=require('fs');var _=require(_0xde1c('0xb'));var squel=require(_0xde1c('0xc'));var crypto=require('crypto');var jsforce=require(_0xde1c('0xd'));var deskjs=require(_0xde1c('0xe'));var toCsv=require(_0xde1c('0x9'));var querystring=require(_0xde1c('0xf'));var Papa=require(_0xde1c('0x10'));var Redis=require('ioredis');var authService=require(_0xde1c('0x11'));var qs=require(_0xde1c('0x12'));var as=require(_0xde1c('0x13'));var hardwareService=require(_0xde1c('0x14'));var logger=require('../../config/logger')(_0xde1c('0x15'));var utils=require(_0xde1c('0x16'));var config=require('../../config/environment');var db=require(_0xde1c('0x17'))['db'];function respondWithStatusCode(_0x84ddf7,_0x518d94){_0x518d94=_0x518d94||0xcc;return function(_0x418ee5){if(_0x418ee5){return _0x84ddf7['sendStatus'](_0x518d94);}return _0x84ddf7[_0xde1c('0x18')](_0x518d94)[_0xde1c('0x19')]();};}function respondWithResult(_0x5374d6,_0x3eef5c){_0x3eef5c=_0x3eef5c||0xc8;return function(_0x2529b3){if(_0x2529b3){return _0x5374d6[_0xde1c('0x18')](_0x3eef5c)[_0xde1c('0x1a')](_0x2529b3);}};}function respondWithFilteredResult(_0x23e37d,_0x17387b){return function(_0x82f123){if(_0x82f123){var _0x8b4de3=_0x82f123[_0xde1c('0x1b')],_0x566057=_0x17387b[_0xde1c('0x1c')],_0xd6488e=_0x17387b[_0xde1c('0x1c')]+_0x17387b['limit'],_0x2d7374;if(_0xd6488e>=_0x8b4de3){_0xd6488e=_0x8b4de3;_0x2d7374=0xc8;}else{_0x2d7374=0xce;}_0x23e37d[_0xde1c('0x18')](_0x2d7374);return _0x23e37d[_0xde1c('0x1d')](_0xde1c('0x1e'),_0x566057+'-'+_0xd6488e+'/'+_0x8b4de3)[_0xde1c('0x1a')](_0x82f123);}return null;};}function patchUpdates(_0x207c93){return function(_0x204bd7){try{jsonpatch[_0xde1c('0x1f')](_0x204bd7,_0x207c93,!![]);}catch(_0x5c7cdb){return BPromise[_0xde1c('0x20')](_0x5c7cdb);}return _0x204bd7[_0xde1c('0x21')]();};}function saveUpdates(_0x5834e7,_0x4ba7d0){return function(_0x42d3f0){if(_0x42d3f0){return _0x42d3f0[_0xde1c('0x22')](_0x5834e7)[_0xde1c('0x23')](function(_0x3ab2b0){return _0x3ab2b0;});}return null;};}function removeEntity(_0x285c5d,_0x1250c7){return function(_0x1d8138){if(_0x1d8138){return _0x1d8138['destroy']()[_0xde1c('0x23')](function(){_0x285c5d['status'](0xcc)[_0xde1c('0x19')]();});}};}function handleEntityNotFound(_0x4127c1,_0x1c1cb1){return function(_0x3610c6){if(!_0x3610c6){_0x4127c1[_0xde1c('0x24')](0x194);}return _0x3610c6;};}function handleError(_0x268f8e,_0x13dd33){_0x13dd33=_0x13dd33||0x1f4;return function(_0x9b7830){logger[_0xde1c('0x25')](_0x9b7830[_0xde1c('0x26')]);if(_0x9b7830[_0xde1c('0x27')]){delete _0x9b7830['name'];}_0x268f8e['status'](_0x13dd33)[_0xde1c('0x28')](_0x9b7830);};}exports['index']=function(_0x206772,_0x2fcc1d){var _0x430cb={},_0x4e3245={},_0x44a580={'count':0x0,'rows':[]};var _0xad02de=_[_0xde1c('0x29')](db[_0xde1c('0x2a')]['rawAttributes'],function(_0x7bd6d6){return{'name':_0x7bd6d6['fieldName'],'type':_0x7bd6d6[_0xde1c('0x2b')]['key']};});_0x4e3245['model']=_[_0xde1c('0x29')](_0xad02de,_0xde1c('0x27'));_0x4e3245[_0xde1c('0x2c')]=_[_0xde1c('0x2d')](_0x206772['query']);_0x4e3245[_0xde1c('0x2e')]=_[_0xde1c('0x2f')](_0x4e3245[_0xde1c('0x30')],_0x4e3245['query']);_0x430cb['attributes']=_[_0xde1c('0x2f')](_0x4e3245[_0xde1c('0x30')],qs['fields'](_0x206772['query'][_0xde1c('0x31')]));_0x430cb[_0xde1c('0x32')]=_0x430cb[_0xde1c('0x32')][_0xde1c('0x33')]?_0x430cb[_0xde1c('0x32')]:_0x4e3245['model'];if(!_0x206772[_0xde1c('0x2c')][_0xde1c('0x34')]('nolimit')){_0x430cb[_0xde1c('0x35')]=qs[_0xde1c('0x35')](_0x206772['query'][_0xde1c('0x35')]);_0x430cb['offset']=qs[_0xde1c('0x1c')](_0x206772[_0xde1c('0x2c')][_0xde1c('0x1c')]);}_0x430cb[_0xde1c('0x36')]=qs[_0xde1c('0x37')](_0x206772[_0xde1c('0x2c')][_0xde1c('0x37')]);_0x430cb[_0xde1c('0x38')]=qs[_0xde1c('0x2e')](_['pick'](_0x206772[_0xde1c('0x2c')],_0x4e3245[_0xde1c('0x2e')]));if(_0x206772[_0xde1c('0x2c')][_0xde1c('0x39')]){_0x430cb['where']=_[_0xde1c('0x3a')](_0x430cb[_0xde1c('0x38')],{'$or':_['map'](_0xad02de,function(_0x30c4cc){if(_0x30c4cc[_0xde1c('0x2b')][_0xde1c('0x3b')]!==_0xde1c('0x3c')){var _0x42a23a={};_0x42a23a[_0x30c4cc[_0xde1c('0x3d')]]={'$like':'%'+_0x206772['query'][_0xde1c('0x39')]+'%'};return _0x42a23a;}})});}_0x430cb=_[_0xde1c('0x3a')]({},_0x430cb,_0x206772[_0xde1c('0x3e')]);var _0x2c1c2b={'where':_0x430cb[_0xde1c('0x38')]};return db[_0xde1c('0x2a')][_0xde1c('0x1b')](_0x2c1c2b)[_0xde1c('0x23')](function(_0x2f4df1){_0x44a580[_0xde1c('0x1b')]=_0x2f4df1;if(_0x206772[_0xde1c('0x2c')][_0xde1c('0x3f')]){_0x430cb['include']=[{'all':!![]}];}return db[_0xde1c('0x2a')]['findAll'](_0x430cb);})['then'](function(_0x11bb4f){_0x44a580[_0xde1c('0x40')]=_0x11bb4f;return _0x44a580;})[_0xde1c('0x23')](respondWithFilteredResult(_0x2fcc1d,_0x430cb))[_0xde1c('0x41')](handleError(_0x2fcc1d,null));};exports[_0xde1c('0x42')]=function(_0x4123e0,_0x3bb4d8){var _0x476676={'raw':!![],'where':{'id':_0x4123e0['params']['id']}},_0x162330={};_0x162330[_0xde1c('0x30')]=_[_0xde1c('0x2d')](db[_0xde1c('0x2a')][_0xde1c('0x43')]);_0x162330[_0xde1c('0x2c')]=_[_0xde1c('0x2d')](_0x4123e0[_0xde1c('0x2c')]);_0x162330[_0xde1c('0x2e')]=_[_0xde1c('0x2f')](_0x162330[_0xde1c('0x30')],_0x162330[_0xde1c('0x2c')]);_0x476676[_0xde1c('0x32')]=_[_0xde1c('0x2f')](_0x162330[_0xde1c('0x30')],qs[_0xde1c('0x31')](_0x4123e0['query']['fields']));_0x476676[_0xde1c('0x32')]=_0x476676[_0xde1c('0x32')][_0xde1c('0x33')]?_0x476676[_0xde1c('0x32')]:_0x162330[_0xde1c('0x30')];if(_0x4123e0['query'][_0xde1c('0x3f')]){_0x476676[_0xde1c('0x44')]=[{'all':!![]}];}_0x476676=_['merge']({},_0x476676,_0x4123e0[_0xde1c('0x3e')]);return db[_0xde1c('0x2a')][_0xde1c('0x45')](_0x476676)[_0xde1c('0x23')](handleEntityNotFound(_0x3bb4d8,null))[_0xde1c('0x23')](respondWithResult(_0x3bb4d8,null))[_0xde1c('0x41')](handleError(_0x3bb4d8,null));};exports[_0xde1c('0x46')]=function(_0x492201,_0x297df3){return db['SalesforceField'][_0xde1c('0x46')](_0x492201['body'],{})[_0xde1c('0x23')](respondWithResult(_0x297df3,0xc9))['catch'](handleError(_0x297df3,null));};exports[_0xde1c('0x22')]=function(_0x16e757,_0x4e09b2){if(_0x16e757[_0xde1c('0x47')]['id']){delete _0x16e757[_0xde1c('0x47')]['id'];}return db['SalesforceField'][_0xde1c('0x45')]({'where':{'id':_0x16e757['params']['id']}})[_0xde1c('0x23')](handleEntityNotFound(_0x4e09b2,null))[_0xde1c('0x23')](saveUpdates(_0x16e757[_0xde1c('0x47')],null))[_0xde1c('0x23')](respondWithResult(_0x4e09b2,null))[_0xde1c('0x41')](handleError(_0x4e09b2,null));};exports[_0xde1c('0x48')]=function(_0x4b3ea2,_0x1ff09f){return db[_0xde1c('0x2a')]['find']({'where':{'id':_0x4b3ea2[_0xde1c('0x49')]['id']}})[_0xde1c('0x23')](handleEntityNotFound(_0x1ff09f,null))[_0xde1c('0x23')](removeEntity(_0x1ff09f,null))[_0xde1c('0x41')](handleError(_0x1ff09f,null));}; \ No newline at end of file +var _0xd8d8=['end','json','offset','Content-Range','apply','update','then','stack','name','index','SalesforceField','rawAttributes','fieldName','key','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','count','includeAll','include','findAll','rows','params','catch','create','body','find','destroy','eml-format','rimraf','request-promise','moment','mustache','util','sox','to-csv','ejs','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','status'];(function(_0x54fb15,_0x30241f){var _0x325cb8=function(_0x5c2c99){while(--_0x5c2c99){_0x54fb15['push'](_0x54fb15['shift']());}};_0x325cb8(++_0x30241f);}(_0xd8d8,0x12c));var _0x8d8d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8d8[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8d8d('0x0'));var rimraf=require(_0x8d8d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8d8d('0x2'));var moment=require(_0x8d8d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x8d8d('0x4'));var util=require(_0x8d8d('0x5'));var path=require('path');var sox=require(_0x8d8d('0x6'));var csv=require(_0x8d8d('0x7'));var ejs=require(_0x8d8d('0x8'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8d8d('0x9'));var deskjs=require(_0x8d8d('0xa'));var toCsv=require(_0x8d8d('0x7'));var querystring=require(_0x8d8d('0xb'));var Papa=require('papaparse');var Redis=require(_0x8d8d('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x8d8d('0xd'));var as=require(_0x8d8d('0xe'));var hardwareService=require(_0x8d8d('0xf'));var logger=require(_0x8d8d('0x10'))('api');var utils=require('../../config/utils');var config=require(_0x8d8d('0x11'));var db=require(_0x8d8d('0x12'))['db'];function respondWithStatusCode(_0x45cfee,_0x3b8a88){_0x3b8a88=_0x3b8a88||0xcc;return function(_0x1f0a5f){if(_0x1f0a5f){return _0x45cfee['sendStatus'](_0x3b8a88);}return _0x45cfee[_0x8d8d('0x13')](_0x3b8a88)[_0x8d8d('0x14')]();};}function respondWithResult(_0x13fdd7,_0xe222c3){_0xe222c3=_0xe222c3||0xc8;return function(_0x244e92){if(_0x244e92){return _0x13fdd7[_0x8d8d('0x13')](_0xe222c3)[_0x8d8d('0x15')](_0x244e92);}};}function respondWithFilteredResult(_0x552e6a,_0x54a89c){return function(_0x365c00){if(_0x365c00){var _0x35fdac=_0x365c00['count'],_0x5d76fc=_0x54a89c[_0x8d8d('0x16')],_0x21cd68=_0x54a89c[_0x8d8d('0x16')]+_0x54a89c['limit'],_0x3ab168;if(_0x21cd68>=_0x35fdac){_0x21cd68=_0x35fdac;_0x3ab168=0xc8;}else{_0x3ab168=0xce;}_0x552e6a[_0x8d8d('0x13')](_0x3ab168);return _0x552e6a['set'](_0x8d8d('0x17'),_0x5d76fc+'-'+_0x21cd68+'/'+_0x35fdac)['json'](_0x365c00);}return null;};}function patchUpdates(_0x56a610){return function(_0x59f9b2){try{jsonpatch[_0x8d8d('0x18')](_0x59f9b2,_0x56a610,!![]);}catch(_0x5ac5ca){return BPromise['reject'](_0x5ac5ca);}return _0x59f9b2['save']();};}function saveUpdates(_0x4c72a6,_0x1f63fa){return function(_0xe8ec8f){if(_0xe8ec8f){return _0xe8ec8f[_0x8d8d('0x19')](_0x4c72a6)[_0x8d8d('0x1a')](function(_0x1f4f7e){return _0x1f4f7e;});}return null;};}function removeEntity(_0x1cc0e1,_0x982de9){return function(_0x57020b){if(_0x57020b){return _0x57020b['destroy']()[_0x8d8d('0x1a')](function(){_0x1cc0e1[_0x8d8d('0x13')](0xcc)[_0x8d8d('0x14')]();});}};}function handleEntityNotFound(_0x52cd5e,_0x154a67){return function(_0x33cc0f){if(!_0x33cc0f){_0x52cd5e['sendStatus'](0x194);}return _0x33cc0f;};}function handleError(_0x35374e,_0x1cb261){_0x1cb261=_0x1cb261||0x1f4;return function(_0x6387b3){logger['error'](_0x6387b3[_0x8d8d('0x1b')]);if(_0x6387b3[_0x8d8d('0x1c')]){delete _0x6387b3[_0x8d8d('0x1c')];}_0x35374e[_0x8d8d('0x13')](_0x1cb261)['send'](_0x6387b3);};}exports[_0x8d8d('0x1d')]=function(_0x5a7140,_0x1e9b60){var _0x225e18={},_0x17c8aa={},_0x5b24a8={'count':0x0,'rows':[]};var _0x1d7f00=_['map'](db[_0x8d8d('0x1e')][_0x8d8d('0x1f')],function(_0x270d17){return{'name':_0x270d17[_0x8d8d('0x20')],'type':_0x270d17['type'][_0x8d8d('0x21')]};});_0x17c8aa['model']=_[_0x8d8d('0x22')](_0x1d7f00,_0x8d8d('0x1c'));_0x17c8aa[_0x8d8d('0x23')]=_[_0x8d8d('0x24')](_0x5a7140['query']);_0x17c8aa['filters']=_[_0x8d8d('0x25')](_0x17c8aa[_0x8d8d('0x26')],_0x17c8aa[_0x8d8d('0x23')]);_0x225e18[_0x8d8d('0x27')]=_[_0x8d8d('0x25')](_0x17c8aa[_0x8d8d('0x26')],qs['fields'](_0x5a7140[_0x8d8d('0x23')][_0x8d8d('0x28')]));_0x225e18[_0x8d8d('0x27')]=_0x225e18[_0x8d8d('0x27')][_0x8d8d('0x29')]?_0x225e18['attributes']:_0x17c8aa[_0x8d8d('0x26')];if(!_0x5a7140[_0x8d8d('0x23')][_0x8d8d('0x2a')](_0x8d8d('0x2b'))){_0x225e18['limit']=qs[_0x8d8d('0x2c')](_0x5a7140[_0x8d8d('0x23')][_0x8d8d('0x2c')]);_0x225e18['offset']=qs['offset'](_0x5a7140[_0x8d8d('0x23')][_0x8d8d('0x16')]);}_0x225e18[_0x8d8d('0x2d')]=qs[_0x8d8d('0x2e')](_0x5a7140['query'][_0x8d8d('0x2e')]);_0x225e18[_0x8d8d('0x2f')]=qs['filters'](_[_0x8d8d('0x30')](_0x5a7140[_0x8d8d('0x23')],_0x17c8aa['filters']));if(_0x5a7140[_0x8d8d('0x23')][_0x8d8d('0x31')]){_0x225e18[_0x8d8d('0x2f')]=_[_0x8d8d('0x32')](_0x225e18['where'],{'$or':_[_0x8d8d('0x22')](_0x1d7f00,function(_0x3f3980){if(_0x3f3980[_0x8d8d('0x33')][_0x8d8d('0x21')]!==_0x8d8d('0x34')){var _0x205025={};_0x205025[_0x3f3980['field']]={'$like':'%'+_0x5a7140[_0x8d8d('0x23')][_0x8d8d('0x31')]+'%'};return _0x205025;}})});}_0x225e18=_[_0x8d8d('0x32')]({},_0x225e18,_0x5a7140['options']);var _0xca7a61={'where':_0x225e18[_0x8d8d('0x2f')]};return db[_0x8d8d('0x1e')][_0x8d8d('0x35')](_0xca7a61)[_0x8d8d('0x1a')](function(_0x2b19bb){_0x5b24a8[_0x8d8d('0x35')]=_0x2b19bb;if(_0x5a7140[_0x8d8d('0x23')][_0x8d8d('0x36')]){_0x225e18[_0x8d8d('0x37')]=[{'all':!![]}];}return db[_0x8d8d('0x1e')][_0x8d8d('0x38')](_0x225e18);})[_0x8d8d('0x1a')](function(_0x2f270f){_0x5b24a8[_0x8d8d('0x39')]=_0x2f270f;return _0x5b24a8;})[_0x8d8d('0x1a')](respondWithFilteredResult(_0x1e9b60,_0x225e18))['catch'](handleError(_0x1e9b60,null));};exports['show']=function(_0x155206,_0x146df4){var _0x588eb2={'raw':!![],'where':{'id':_0x155206[_0x8d8d('0x3a')]['id']}},_0x33ef20={};_0x33ef20[_0x8d8d('0x26')]=_[_0x8d8d('0x24')](db['SalesforceField'][_0x8d8d('0x1f')]);_0x33ef20[_0x8d8d('0x23')]=_['keys'](_0x155206['query']);_0x33ef20['filters']=_[_0x8d8d('0x25')](_0x33ef20['model'],_0x33ef20[_0x8d8d('0x23')]);_0x588eb2[_0x8d8d('0x27')]=_[_0x8d8d('0x25')](_0x33ef20[_0x8d8d('0x26')],qs[_0x8d8d('0x28')](_0x155206[_0x8d8d('0x23')][_0x8d8d('0x28')]));_0x588eb2[_0x8d8d('0x27')]=_0x588eb2[_0x8d8d('0x27')][_0x8d8d('0x29')]?_0x588eb2['attributes']:_0x33ef20[_0x8d8d('0x26')];if(_0x155206[_0x8d8d('0x23')]['includeAll']){_0x588eb2[_0x8d8d('0x37')]=[{'all':!![]}];}_0x588eb2=_[_0x8d8d('0x32')]({},_0x588eb2,_0x155206['options']);return db[_0x8d8d('0x1e')]['find'](_0x588eb2)['then'](handleEntityNotFound(_0x146df4,null))['then'](respondWithResult(_0x146df4,null))[_0x8d8d('0x3b')](handleError(_0x146df4,null));};exports[_0x8d8d('0x3c')]=function(_0x562808,_0x7919c9){return db['SalesforceField'][_0x8d8d('0x3c')](_0x562808[_0x8d8d('0x3d')],{})[_0x8d8d('0x1a')](respondWithResult(_0x7919c9,0xc9))['catch'](handleError(_0x7919c9,null));};exports[_0x8d8d('0x19')]=function(_0x3ca12d,_0x36569a){if(_0x3ca12d['body']['id']){delete _0x3ca12d[_0x8d8d('0x3d')]['id'];}return db[_0x8d8d('0x1e')][_0x8d8d('0x3e')]({'where':{'id':_0x3ca12d[_0x8d8d('0x3a')]['id']}})['then'](handleEntityNotFound(_0x36569a,null))['then'](saveUpdates(_0x3ca12d['body'],null))[_0x8d8d('0x1a')](respondWithResult(_0x36569a,null))[_0x8d8d('0x3b')](handleError(_0x36569a,null));};exports[_0x8d8d('0x3f')]=function(_0x5e60e5,_0x5e670f){return db[_0x8d8d('0x1e')]['find']({'where':{'id':_0x5e60e5[_0x8d8d('0x3a')]['id']}})[_0x8d8d('0x1a')](handleEntityNotFound(_0x5e670f,null))[_0x8d8d('0x1a')](removeEntity(_0x5e670f,null))[_0x8d8d('0x3b')](handleError(_0x5e670f,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index fa84685..b5e07b1 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 _0x8eca=['idField','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','SalesforceField','salesforce_unique_index'];(function(_0x35c824,_0x2ff932){var _0x1c768f=function(_0x1e84fc){while(--_0x1e84fc){_0x35c824['push'](_0x35c824['shift']());}};_0x1c768f(++_0x2ff932);}(_0x8eca,0x1e2));var _0xa8ec=function(_0x40b71e,_0x340718){_0x40b71e=_0x40b71e-0x0;var _0x1c503a=_0x8eca[_0x40b71e];return _0x1c503a;};'use strict';var _=require(_0xa8ec('0x0'));var util=require(_0xa8ec('0x1'));var logger=require(_0xa8ec('0x2'))('api');var moment=require(_0xa8ec('0x3'));var BPromise=require(_0xa8ec('0x4'));var rp=require(_0xa8ec('0x5'));var fs=require('fs');var path=require(_0xa8ec('0x6'));var rimraf=require(_0xa8ec('0x7'));var config=require('../../config/environment');var attributes=require('./intSalesforceField.attributes');module['exports']=function(_0x5363ad,_0x278798){return _0x5363ad['define'](_0xa8ec('0x8'),attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':_0xa8ec('0x9'),'fields':[_0xa8ec('0xa'),_0xa8ec('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x48d5=['lodash','api','bluebird','request-promise','../../config/environment','./intSalesforceField.attributes','exports','define','int_salesforce_fields','salesforce_unique_index','idField','FieldId'];(function(_0xa4016d,_0x3fcd9){var _0x5252c0=function(_0x2d3df3){while(--_0x2d3df3){_0xa4016d['push'](_0xa4016d['shift']());}};_0x5252c0(++_0x3fcd9);}(_0x48d5,0xa8));var _0x548d=function(_0x38af13,_0x3949a1){_0x38af13=_0x38af13-0x0;var _0x56a221=_0x48d5[_0x38af13];return _0x56a221;};'use strict';var _=require(_0x548d('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x548d('0x1'));var moment=require('moment');var BPromise=require(_0x548d('0x2'));var rp=require(_0x548d('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x548d('0x4'));var attributes=require(_0x548d('0x5'));module[_0x548d('0x6')]=function(_0x230d89,_0x340cc5){return _0x230d89[_0x548d('0x7')]('SalesforceField',attributes,{'tableName':_0x548d('0x8'),'paranoid':![],'indexes':[{'name':_0x548d('0x9'),'fields':[_0x548d('0xa'),_0x548d('0xb')],'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 304c439..7bb77bb 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 _0xac4a=['SalesforceField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','then','info','debug','SalesforceField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xac4a,0x13f));var _0xaac4=function(_0x146a3a,_0x17bb51){_0x146a3a=_0x146a3a-0x0;var _0x183a4f=_0xac4a[_0x146a3a];return _0x183a4f;};'use strict';var _=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var moment=require(_0xaac4('0x2'));var BPromise=require(_0xaac4('0x3'));var rs=require(_0xaac4('0x4'));var fs=require('fs');var Redis=require(_0xaac4('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaac4('0x6'))(_0xaac4('0x7'));var config=require(_0xaac4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xaac4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cdfc5,_0x5870e8,_0x1e4283){return new BPromise(function(_0x27354c,_0x567295){return client['request'](_0x1cdfc5,_0x1e4283)[_0xaac4('0xa')](function(_0x50d114){logger[_0xaac4('0xb')]('SalesforceField,\x20%s,\x20%s',_0x5870e8,'request\x20sent');logger[_0xaac4('0xc')](_0xaac4('0xd'),_0x5870e8,_0xaac4('0xe'),JSON[_0xaac4('0xf')](_0x50d114));if(_0x50d114[_0xaac4('0x10')]){if(_0x50d114['error']['code']===0x1f4){logger[_0xaac4('0x10')](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')]['message']);return _0x567295(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}logger['error'](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);return _0x27354c(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}else{logger[_0xaac4('0xb')](_0xaac4('0x11'),_0x5870e8,_0xaac4('0xe'));_0x27354c(_0x50d114[_0xaac4('0x13')][_0xaac4('0x12')]);}})[_0xaac4('0x14')](function(_0x1766c2){logger[_0xaac4('0x10')]('SalesforceField,\x20%s,\x20%s',_0x5870e8,_0x1766c2);_0x567295(_0x1766c2);});});} \ No newline at end of file +var _0xac4a=['SalesforceField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','then','info','debug','SalesforceField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xac4a,0x13f));var _0xaac4=function(_0xf0b296,_0x26f8e4){_0xf0b296=_0xf0b296-0x0;var _0x70ec77=_0xac4a[_0xf0b296];return _0x70ec77;};'use strict';var _=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var moment=require(_0xaac4('0x2'));var BPromise=require(_0xaac4('0x3'));var rs=require(_0xaac4('0x4'));var fs=require('fs');var Redis=require(_0xaac4('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaac4('0x6'))(_0xaac4('0x7'));var config=require(_0xaac4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xaac4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cdfc5,_0x5870e8,_0x1e4283){return new BPromise(function(_0x27354c,_0x567295){return client['request'](_0x1cdfc5,_0x1e4283)[_0xaac4('0xa')](function(_0x50d114){logger[_0xaac4('0xb')]('SalesforceField,\x20%s,\x20%s',_0x5870e8,'request\x20sent');logger[_0xaac4('0xc')](_0xaac4('0xd'),_0x5870e8,_0xaac4('0xe'),JSON[_0xaac4('0xf')](_0x50d114));if(_0x50d114[_0xaac4('0x10')]){if(_0x50d114['error']['code']===0x1f4){logger[_0xaac4('0x10')](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')]['message']);return _0x567295(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}logger['error'](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);return _0x27354c(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}else{logger[_0xaac4('0xb')](_0xaac4('0x11'),_0x5870e8,_0xaac4('0xe'));_0x27354c(_0x50d114[_0xaac4('0x13')][_0xaac4('0x12')]);}})[_0xaac4('0x14')](function(_0x1766c2){logger[_0xaac4('0x10')]('SalesforceField,\x20%s,\x20%s',_0x5870e8,_0x1766c2);_0x567295(_0x1766c2);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index e01bb14..c73f79f 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 _0xc4a1=['isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','create','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get'];(function(_0x17b5b9,_0x1e284e){var _0x2eb0da=function(_0x287d74){while(--_0x287d74){_0x17b5b9['push'](_0x17b5b9['shift']());}};_0x2eb0da(++_0x1e284e);}(_0xc4a1,0x1ef));var _0x1c4a=function(_0x53d227,_0x590b7b){_0x53d227=_0x53d227-0x0;var _0x1024af=_0xc4a1[_0x53d227];return _0x1024af;};'use strict';var multer=require(_0x1c4a('0x0'));var util=require('util');var path=require(_0x1c4a('0x1'));var timeout=require(_0x1c4a('0x2'));var express=require(_0x1c4a('0x3'));var router=express['Router']();var auth=require(_0x1c4a('0x4'));var interaction=require(_0x1c4a('0x5'));var config=require(_0x1c4a('0x6'));var controller=require(_0x1c4a('0x7'));router[_0x1c4a('0x8')]('/',auth[_0x1c4a('0x9')](),controller[_0x1c4a('0xa')]);router[_0x1c4a('0x8')](_0x1c4a('0xb'),auth[_0x1c4a('0x9')](),controller[_0x1c4a('0xc')]);router[_0x1c4a('0x8')](_0x1c4a('0xd'),auth['isAuthenticated'](),controller[_0x1c4a('0xe')]);router[_0x1c4a('0x8')]('/:id/fields',auth[_0x1c4a('0x9')](),controller['getFields']);router['post']('/',auth[_0x1c4a('0x9')](),controller[_0x1c4a('0xf')]);router['post'](_0x1c4a('0xd'),auth[_0x1c4a('0x9')](),controller['addConfiguration']);router['put'](_0x1c4a('0xb'),auth[_0x1c4a('0x9')](),controller['update']);router['delete'](_0x1c4a('0xb'),auth[_0x1c4a('0x9')](),controller[_0x1c4a('0x10')]);module[_0x1c4a('0x11')]=router; \ No newline at end of file +var _0x2e8a=['exports','util','path','express','Router','../../components/interaction/service','index','get','/:id','show','/:id/configurations','isAuthenticated','getFields','post','create','put','update','delete'];(function(_0x2f4b05,_0x520fa3){var _0x6b20c0=function(_0x5b4a19){while(--_0x5b4a19){_0x2f4b05['push'](_0x2f4b05['shift']());}};_0x6b20c0(++_0x520fa3);}(_0x2e8a,0xc7));var _0xa2e8=function(_0x3b3210,_0x25e8ed){_0x3b3210=_0x3b3210-0x0;var _0x5b5484=_0x2e8a[_0x3b3210];return _0x5b5484;};'use strict';var multer=require('multer');var util=require(_0xa2e8('0x0'));var path=require(_0xa2e8('0x1'));var timeout=require('connect-timeout');var express=require(_0xa2e8('0x2'));var router=express[_0xa2e8('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xa2e8('0x4'));var config=require('../../config/environment');var controller=require('./intServicenowAccount.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xa2e8('0x5')]);router[_0xa2e8('0x6')](_0xa2e8('0x7'),auth['isAuthenticated'](),controller[_0xa2e8('0x8')]);router[_0xa2e8('0x6')](_0xa2e8('0x9'),auth[_0xa2e8('0xa')](),controller['getConfigurations']);router[_0xa2e8('0x6')]('/:id/fields',auth[_0xa2e8('0xa')](),controller[_0xa2e8('0xb')]);router[_0xa2e8('0xc')]('/',auth[_0xa2e8('0xa')](),controller[_0xa2e8('0xd')]);router['post'](_0xa2e8('0x9'),auth[_0xa2e8('0xa')](),controller['addConfiguration']);router[_0xa2e8('0xe')]('/:id',auth[_0xa2e8('0xa')](),controller[_0xa2e8('0xf')]);router[_0xa2e8('0x10')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xa2e8('0x11')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 60d6460..f460d6d 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 _0xb6d5=['username','remoteUri','sequelize','exports','STRING'];(function(_0x45bf86,_0x75586e){var _0x1f02b7=function(_0x1ea8a3){while(--_0x1ea8a3){_0x45bf86['push'](_0x45bf86['shift']());}};_0x1f02b7(++_0x75586e);}(_0xb6d5,0x183));var _0x5b6d=function(_0x230639,_0x20f428){_0x230639=_0x230639-0x0;var _0x5248d7=_0xb6d5[_0x230639];return _0x5248d7;};'use strict';var Sequelize=require(_0x5b6d('0x0'));module[_0x5b6d('0x1')]={'name':{'type':Sequelize[_0x5b6d('0x2')]},'description':{'type':Sequelize[_0x5b6d('0x2')]},'username':{'type':Sequelize[_0x5b6d('0x2')],'unique':_0x5b6d('0x3')},'password':{'type':Sequelize[_0x5b6d('0x2')]},'email':{'type':Sequelize[_0x5b6d('0x2')]},'remoteUri':{'type':Sequelize[_0x5b6d('0x2')],'unique':_0x5b6d('0x4')},'serverUrl':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0e42=['STRING','username','remoteUri','sequelize'];(function(_0x5d2dde,_0x222c3d){var _0x11de3a=function(_0x4a9805){while(--_0x4a9805){_0x5d2dde['push'](_0x5d2dde['shift']());}};_0x11de3a(++_0x222c3d);}(_0x0e42,0x1c3));var _0x20e4=function(_0xd078c8,_0x1459e4){_0xd078c8=_0xd078c8-0x0;var _0x3f4954=_0x0e42[_0xd078c8];return _0x3f4954;};'use strict';var Sequelize=require(_0x20e4('0x0'));module['exports']={'name':{'type':Sequelize[_0x20e4('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x20e4('0x2')},'password':{'type':Sequelize[_0x20e4('0x1')]},'email':{'type':Sequelize[_0x20e4('0x1')]},'remoteUri':{'type':Sequelize[_0x20e4('0x1')],'unique':_0x20e4('0x3')},'serverUrl':{'type':Sequelize[_0x20e4('0x1')]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 271627c..59c7c99 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 _0xc133=['watch_list','upon_reject','sys_updated_on','hold_reason','approval_history','number','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','sys_domain','state','sys_created_by','knowledge','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','work_end','reopened_time','approval_set','work_notes','short_description','delivery_task','work_start','assignment_group','additional_assignee_list','description','calendar_duration','sys_class_name','close_notes','parent_incident','sys_id','contact_type','reopened_by','urgency','problem_id','reassignment_count','assigned_to','comments','sla_due','approval','due_date','sys_tags','escalation','upon_approval','correlation_id','username','password','email','remoteUri','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','incident?sysparm_display_value=all','log','incident\x20table\x20objects','assign','remove','includes','internalType','push','all','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','label','concat','ServiceNow\x20error:\x20','statusCode','Wrong\x20credentials','boolean','True','False','false','GET','result','value','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../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~!@#$%^&-_=+[{]}.','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','status','end','json','offset','set','apply','reject','save','then','destroy','stack','name','send','index','map','ServicenowAccount','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','field','options','count','includeAll','findAll','rows','show','keys','include','find','create','body','update','params','findOne','ServicenowConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','channel','Descriptions','ServicenowField','getFields','made_sla','subcategory','close_code','notify','incident_state','severity','category','parent','caused_by'];(function(_0x1751b3,_0x16f9d8){var _0x5dd310=function(_0x46bd00){while(--_0x46bd00){_0x1751b3['push'](_0x1751b3['shift']());}};_0x5dd310(++_0x16f9d8);}(_0xc133,0x1eb));var _0x3c13=function(_0xd1b0ac,_0x159e8b){_0xd1b0ac=_0xd1b0ac-0x0;var _0xb656ef=_0xc133[_0xd1b0ac];return _0xb656ef;};'use strict';var pdf=require(_0x3c13('0x0'));var emlformat=require(_0x3c13('0x1'));var rimraf=require(_0x3c13('0x2'));var zipdir=require(_0x3c13('0x3'));var jsonpatch=require(_0x3c13('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3c13('0x5'));var Mustache=require(_0x3c13('0x6'));var util=require('util');var path=require(_0x3c13('0x7'));var sox=require(_0x3c13('0x8'));var csv=require(_0x3c13('0x9'));var ejs=require(_0x3c13('0xa'));var fs=require('fs');var _=require(_0x3c13('0xb'));var squel=require(_0x3c13('0xc'));var crypto=require(_0x3c13('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x3c13('0xe'));var toCsv=require(_0x3c13('0x9'));var querystring=require(_0x3c13('0xf'));var Papa=require(_0x3c13('0x10'));var Redis=require(_0x3c13('0x11'));var authService=require(_0x3c13('0x12'));var qs=require(_0x3c13('0x13'));var as=require(_0x3c13('0x14'));var hardwareService=require(_0x3c13('0x15'));var logger=require(_0x3c13('0x16'))(_0x3c13('0x17'));var utils=require('../../config/utils');var config=require(_0x3c13('0x18'));var db=require('../../mysqldb')['db'];var integrations=require(_0x3c13('0x19'));var jayson=require(_0x3c13('0x1a'));var client=jayson[_0x3c13('0x1b')][_0x3c13('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x2caf6b,_0xb48957,_0x34082f){if(_0x34082f){var _0x51c3f2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x51c3f2[_0x3c13('0x1d')](_0xb48957)){return _0x2caf6b;}else{throw new Error(_0x3c13('0x1e'));}}else{return _0x2caf6b;}}function respondWithRpcPromise(_0x4b46c7,_0x362737,_0x26c11e,_0x1df518){return new BPromise(function(_0x122cc6,_0x4c4141){var _0x3f173c=_0x1df518||client;return _0x3f173c['request'](_0x4b46c7,_0x26c11e)['then'](function(_0x2cac7b){logger['info'](_0x3c13('0x1f'),_0x362737,_0x3c13('0x20'));logger[_0x3c13('0x21')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x362737,_0x3c13('0x20'),JSON[_0x3c13('0x22')](_0x2cac7b));if(_0x2cac7b['error']){if(_0x2cac7b[_0x3c13('0x23')][_0x3c13('0x24')]===0x1f4){logger[_0x3c13('0x23')](_0x3c13('0x1f'),_0x362737,_0x2cac7b[_0x3c13('0x23')]['message']);return _0x4c4141(_0x2cac7b['error'][_0x3c13('0x25')]);}logger['error'](_0x3c13('0x1f'),_0x362737,_0x2cac7b['error']['message']);return _0x122cc6(_0x2cac7b['error'][_0x3c13('0x25')]);}else{logger['info'](_0x3c13('0x1f'),_0x362737,_0x3c13('0x20'));_0x122cc6(_0x2cac7b['result'][_0x3c13('0x25')]);}})[_0x3c13('0x26')](function(_0x2283ea){logger[_0x3c13('0x23')](_0x3c13('0x1f'),_0x362737,_0x2283ea);_0x4c4141(_0x2283ea);});});}function respondWithStatusCode(_0x290bae,_0x32c467){_0x32c467=_0x32c467||0xcc;return function(_0x52cab8){if(_0x52cab8){return _0x290bae['sendStatus'](_0x32c467);}return _0x290bae[_0x3c13('0x27')](_0x32c467)[_0x3c13('0x28')]();};}function respondWithResult(_0x4ff51a,_0x147557){_0x147557=_0x147557||0xc8;return function(_0x2cfc43){if(_0x2cfc43){return _0x4ff51a[_0x3c13('0x27')](_0x147557)[_0x3c13('0x29')](_0x2cfc43);}};}function respondWithFilteredResult(_0x442bc1,_0x13c9ed){return function(_0x9a61ac){if(_0x9a61ac){var _0x743d93=_0x9a61ac['count'],_0x45f871=_0x13c9ed[_0x3c13('0x2a')],_0x2041cf=_0x13c9ed[_0x3c13('0x2a')]+_0x13c9ed['limit'],_0x1f3923;if(_0x2041cf>=_0x743d93){_0x2041cf=_0x743d93;_0x1f3923=0xc8;}else{_0x1f3923=0xce;}_0x442bc1[_0x3c13('0x27')](_0x1f3923);return _0x442bc1[_0x3c13('0x2b')]('Content-Range',_0x45f871+'-'+_0x2041cf+'/'+_0x743d93)[_0x3c13('0x29')](_0x9a61ac);}return null;};}function patchUpdates(_0x31b2f6){return function(_0x103cf4){try{jsonpatch[_0x3c13('0x2c')](_0x103cf4,_0x31b2f6,!![]);}catch(_0x527157){return BPromise[_0x3c13('0x2d')](_0x527157);}return _0x103cf4[_0x3c13('0x2e')]();};}function saveUpdates(_0x37e26b,_0x54d51a){return function(_0xe9b9b4){if(_0xe9b9b4){return _0xe9b9b4['update'](_0x37e26b)[_0x3c13('0x2f')](function(_0x22e6df){return _0x22e6df;});}return null;};}function removeEntity(_0xdb2e4b,_0x34bef9){return function(_0x47912b){if(_0x47912b){return _0x47912b[_0x3c13('0x30')]()['then'](function(){_0xdb2e4b['status'](0xcc)[_0x3c13('0x28')]();});}};}function handleEntityNotFound(_0x885c1d,_0x422a22){return function(_0x4208ea){if(!_0x4208ea){_0x885c1d['sendStatus'](0x194);}return _0x4208ea;};}function handleError(_0x4106c8,_0x54b105){_0x54b105=_0x54b105||0x1f4;return function(_0x4b5085){logger[_0x3c13('0x23')](_0x4b5085[_0x3c13('0x31')]);if(_0x4b5085[_0x3c13('0x32')]){delete _0x4b5085[_0x3c13('0x32')];}_0x4106c8[_0x3c13('0x27')](_0x54b105)[_0x3c13('0x33')](_0x4b5085);};}exports[_0x3c13('0x34')]=function(_0x22ec0b,_0x3a258e){var _0x2b7a08={},_0x1a7435={},_0x7bd31c={'count':0x0,'rows':[]};var _0x49aa7d=_[_0x3c13('0x35')](db[_0x3c13('0x36')][_0x3c13('0x37')],function(_0x15573c){return{'name':_0x15573c[_0x3c13('0x38')],'type':_0x15573c[_0x3c13('0x39')][_0x3c13('0x3a')]};});_0x1a7435[_0x3c13('0x3b')]=_[_0x3c13('0x35')](_0x49aa7d,_0x3c13('0x32'));_0x1a7435[_0x3c13('0x3c')]=_['keys'](_0x22ec0b[_0x3c13('0x3c')]);_0x1a7435[_0x3c13('0x3d')]=_['intersection'](_0x1a7435[_0x3c13('0x3b')],_0x1a7435[_0x3c13('0x3c')]);_0x2b7a08[_0x3c13('0x3e')]=_[_0x3c13('0x3f')](_0x1a7435[_0x3c13('0x3b')],qs[_0x3c13('0x40')](_0x22ec0b[_0x3c13('0x3c')][_0x3c13('0x40')]));_0x2b7a08[_0x3c13('0x3e')]=_0x2b7a08['attributes'][_0x3c13('0x41')]?_0x2b7a08[_0x3c13('0x3e')]:_0x1a7435[_0x3c13('0x3b')];if(!_0x22ec0b[_0x3c13('0x3c')][_0x3c13('0x42')](_0x3c13('0x43'))){_0x2b7a08[_0x3c13('0x44')]=qs[_0x3c13('0x44')](_0x22ec0b[_0x3c13('0x3c')]['limit']);_0x2b7a08[_0x3c13('0x2a')]=qs['offset'](_0x22ec0b[_0x3c13('0x3c')][_0x3c13('0x2a')]);}_0x2b7a08[_0x3c13('0x45')]=qs[_0x3c13('0x46')](_0x22ec0b[_0x3c13('0x3c')][_0x3c13('0x46')]);_0x2b7a08[_0x3c13('0x47')]=qs[_0x3c13('0x3d')](_[_0x3c13('0x48')](_0x22ec0b[_0x3c13('0x3c')],_0x1a7435[_0x3c13('0x3d')]));if(_0x22ec0b[_0x3c13('0x3c')][_0x3c13('0x49')]){_0x2b7a08[_0x3c13('0x47')]=_[_0x3c13('0x4a')](_0x2b7a08[_0x3c13('0x47')],{'$or':_['map'](_0x49aa7d,function(_0x17d3e8){if(_0x17d3e8[_0x3c13('0x39')][_0x3c13('0x3a')]!==_0x3c13('0x4b')){var _0x5370ad={};_0x5370ad[_0x17d3e8[_0x3c13('0x4c')]]={'$like':'%'+_0x22ec0b[_0x3c13('0x3c')][_0x3c13('0x49')]+'%'};return _0x5370ad;}})});}_0x2b7a08=_[_0x3c13('0x4a')]({},_0x2b7a08,_0x22ec0b[_0x3c13('0x4d')]);var _0x1748f9={'where':_0x2b7a08[_0x3c13('0x47')]};return db[_0x3c13('0x36')][_0x3c13('0x4e')](_0x1748f9)[_0x3c13('0x2f')](function(_0x292525){_0x7bd31c[_0x3c13('0x4e')]=_0x292525;if(_0x22ec0b[_0x3c13('0x3c')][_0x3c13('0x4f')]){_0x2b7a08['include']=[{'all':!![]}];}return db[_0x3c13('0x36')][_0x3c13('0x50')](_0x2b7a08);})[_0x3c13('0x2f')](function(_0x3989f6){_0x7bd31c[_0x3c13('0x51')]=_0x3989f6;return _0x7bd31c;})[_0x3c13('0x2f')](respondWithFilteredResult(_0x3a258e,_0x2b7a08))[_0x3c13('0x26')](handleError(_0x3a258e,null));};exports[_0x3c13('0x52')]=function(_0x511a63,_0x71220e){var _0x31d1a5={'raw':![],'where':{'id':_0x511a63['params']['id']}},_0x5ee795={};_0x5ee795['model']=_[_0x3c13('0x53')](db[_0x3c13('0x36')][_0x3c13('0x37')]);_0x5ee795[_0x3c13('0x3c')]=_[_0x3c13('0x53')](_0x511a63[_0x3c13('0x3c')]);_0x5ee795[_0x3c13('0x3d')]=_[_0x3c13('0x3f')](_0x5ee795['model'],_0x5ee795[_0x3c13('0x3c')]);_0x31d1a5[_0x3c13('0x3e')]=_['intersection'](_0x5ee795['model'],qs[_0x3c13('0x40')](_0x511a63[_0x3c13('0x3c')][_0x3c13('0x40')]));_0x31d1a5['attributes']=_0x31d1a5['attributes'][_0x3c13('0x41')]?_0x31d1a5[_0x3c13('0x3e')]:_0x5ee795[_0x3c13('0x3b')];if(_0x511a63['query']['includeAll']){_0x31d1a5[_0x3c13('0x54')]=[{'all':!![]}];}_0x31d1a5=_[_0x3c13('0x4a')]({},_0x31d1a5,_0x511a63[_0x3c13('0x4d')]);return db[_0x3c13('0x36')][_0x3c13('0x55')](_0x31d1a5)[_0x3c13('0x2f')](handleEntityNotFound(_0x71220e,null))[_0x3c13('0x2f')](respondWithResult(_0x71220e,null))[_0x3c13('0x26')](handleError(_0x71220e,null));};exports['create']=function(_0x4ecc87,_0x4f57ca){return db[_0x3c13('0x36')][_0x3c13('0x56')](_0x4ecc87[_0x3c13('0x57')],{})[_0x3c13('0x2f')](respondWithResult(_0x4f57ca,0xc9))[_0x3c13('0x26')](handleError(_0x4f57ca,null));};exports[_0x3c13('0x58')]=function(_0x4c818e,_0x46b504){if(_0x4c818e['body']['id']){delete _0x4c818e['body']['id'];}return db[_0x3c13('0x36')][_0x3c13('0x55')]({'where':{'id':_0x4c818e[_0x3c13('0x59')]['id']}})[_0x3c13('0x2f')](handleEntityNotFound(_0x46b504,null))[_0x3c13('0x2f')](saveUpdates(_0x4c818e[_0x3c13('0x57')],null))[_0x3c13('0x2f')](respondWithResult(_0x46b504,null))[_0x3c13('0x26')](handleError(_0x46b504,null));};exports[_0x3c13('0x30')]=function(_0x48d0da,_0x3ad042){return db[_0x3c13('0x36')][_0x3c13('0x55')]({'where':{'id':_0x48d0da[_0x3c13('0x59')]['id']}})[_0x3c13('0x2f')](handleEntityNotFound(_0x3ad042,null))[_0x3c13('0x2f')](removeEntity(_0x3ad042,null))[_0x3c13('0x26')](handleError(_0x3ad042,null));};exports['getConfigurations']=function(_0xcec457,_0x1aa2e0,_0x56c2f3){var _0x3fe5a1={};var _0x296d08={};var _0x162eec;var _0x308164;return db[_0x3c13('0x36')][_0x3c13('0x5a')]({'where':{'id':_0xcec457['params']['id']}})[_0x3c13('0x2f')](handleEntityNotFound(_0x1aa2e0,null))['then'](function(_0x35d24d){if(_0x35d24d){_0x162eec=_0x35d24d;_0x296d08['model']=_[_0x3c13('0x53')](db[_0x3c13('0x5b')][_0x3c13('0x37')]);_0x296d08['query']=_[_0x3c13('0x53')](_0xcec457[_0x3c13('0x3c')]);_0x296d08[_0x3c13('0x3d')]=_[_0x3c13('0x3f')](_0x296d08[_0x3c13('0x3b')],_0x296d08[_0x3c13('0x3c')]);_0x3fe5a1[_0x3c13('0x3e')]=_[_0x3c13('0x3f')](_0x296d08[_0x3c13('0x3b')],qs['fields'](_0xcec457['query'][_0x3c13('0x40')]));_0x3fe5a1[_0x3c13('0x3e')]=_0x3fe5a1[_0x3c13('0x3e')]['length']?_0x3fe5a1[_0x3c13('0x3e')]:_0x296d08[_0x3c13('0x3b')];_0x3fe5a1[_0x3c13('0x45')]=qs[_0x3c13('0x46')](_0xcec457['query'][_0x3c13('0x46')]);_0x3fe5a1['where']=qs[_0x3c13('0x3d')](_['pick'](_0xcec457['query'],_0x296d08['filters']));if(_0xcec457[_0x3c13('0x3c')][_0x3c13('0x49')]){_0x3fe5a1[_0x3c13('0x47')]=_['merge'](_0x3fe5a1[_0x3c13('0x47')],{'$or':_['map'](_0x3fe5a1['attributes'],function(_0x1aaa16){var _0x29e132={};_0x29e132[_0x1aaa16]={'$like':'%'+_0xcec457['query'][_0x3c13('0x49')]+'%'};return _0x29e132;})});}_0x3fe5a1=_[_0x3c13('0x4a')]({},_0x3fe5a1,_0xcec457['options']);return _0x162eec['getConfigurations'](_0x3fe5a1);}})['then'](function(_0x1328e0){if(_0x1328e0){_0x308164=_0x1328e0[_0x3c13('0x41')];if(!_0xcec457[_0x3c13('0x3c')][_0x3c13('0x42')]('nolimit')){_0x3fe5a1['limit']=qs[_0x3c13('0x44')](_0xcec457[_0x3c13('0x3c')][_0x3c13('0x44')]);_0x3fe5a1[_0x3c13('0x2a')]=qs[_0x3c13('0x2a')](_0xcec457[_0x3c13('0x3c')][_0x3c13('0x2a')]);}return _0x162eec[_0x3c13('0x5c')](_0x3fe5a1);}})['then'](function(_0x1e0423){if(_0x1e0423){return _0x1e0423?{'count':_0x308164,'rows':_0x1e0423}:null;}})[_0x3c13('0x2f')](respondWithResult(_0x1aa2e0,null))[_0x3c13('0x26')](handleError(_0x1aa2e0,null));};exports[_0x3c13('0x5d')]=function(_0x16a68c,_0x2f6af3,_0x45bd46){if(_0x16a68c[_0x3c13('0x57')]['id']){delete _0x16a68c[_0x3c13('0x57')]['id'];}return db[_0x3c13('0x36')][_0x3c13('0x5a')]({'where':{'id':_0x16a68c[_0x3c13('0x59')]['id']}})[_0x3c13('0x2f')](handleEntityNotFound(_0x2f6af3,null))[_0x3c13('0x2f')](function(_0x246920){if(_0x246920){_0x16a68c[_0x3c13('0x57')][_0x3c13('0x5e')]=_0x246920['id'];_0x16a68c[_0x3c13('0x57')][_0x3c13('0x5f')]=integrations['getSubjects'](_0x16a68c[_0x3c13('0x57')][_0x3c13('0x60')],_0x16a68c[_0x3c13('0x57')]['type']);_0x16a68c[_0x3c13('0x57')][_0x3c13('0x61')]=integrations['getDescriptions'](_0x16a68c[_0x3c13('0x57')][_0x3c13('0x60')],_0x16a68c['body'][_0x3c13('0x39')]);return db[_0x3c13('0x5b')]['create'](_0x16a68c['body'],{'include':[{'model':db['ServicenowField'],'as':_0x3c13('0x5f')},{'model':db[_0x3c13('0x62')],'as':_0x3c13('0x61')}]});}return null;})['then'](respondWithResult(_0x2f6af3,null))[_0x3c13('0x26')](handleError(_0x2f6af3,null));};exports[_0x3c13('0x63')]=function(_0x3106d6,_0x167861,_0x3b3eb3){var _0x1fb505=[_0x3c13('0x64'),'hold_reason','knowledge',_0x3c13('0x65'),_0x3c13('0x66'),_0x3c13('0x67'),_0x3c13('0x68'),_0x3c13('0x69'),_0x3c13('0x6a')];var _0x14acf7=[_0x3c13('0x6b'),_0x3c13('0x64'),_0x3c13('0x6c'),_0x3c13('0x6d'),_0x3c13('0x6e'),_0x3c13('0x6f'),'child_incidents',_0x3c13('0x70'),_0x3c13('0x71'),_0x3c13('0x72'),_0x3c13('0x73'),_0x3c13('0x74'),_0x3c13('0x75'),_0x3c13('0x76'),_0x3c13('0x77'),_0x3c13('0x78'),_0x3c13('0x79'),_0x3c13('0x7a'),_0x3c13('0x7b'),'order','calendar_stc','closed_at',_0x3c13('0x7c'),_0x3c13('0x7d'),_0x3c13('0x7e'),_0x3c13('0x7f'),_0x3c13('0x80'),_0x3c13('0x81'),_0x3c13('0x82'),_0x3c13('0x83'),_0x3c13('0x84'),_0x3c13('0x85'),_0x3c13('0x86'),_0x3c13('0x87'),_0x3c13('0x88'),'group_list',_0x3c13('0x89'),_0x3c13('0x8a'),'resolved_at','caller_id',_0x3c13('0x8b'),_0x3c13('0x65'),_0x3c13('0x8c'),_0x3c13('0x8d'),'close_code','correlation_display',_0x3c13('0x8e'),_0x3c13('0x8f'),_0x3c13('0x90'),'business_stc',_0x3c13('0x91'),_0x3c13('0x92'),_0x3c13('0x93'),_0x3c13('0x67'),_0x3c13('0x94'),_0x3c13('0x95'),'closed_by','follow_up',_0x3c13('0x96'),_0x3c13('0x97'),_0x3c13('0x98'),_0x3c13('0x99'),_0x3c13('0x68'),_0x3c13('0x9a'),_0x3c13('0x9b'),'company',_0x3c13('0x9c'),'activity_due',_0x3c13('0x9d'),_0x3c13('0x69'),_0x3c13('0x9e'),_0x3c13('0x9f'),_0x3c13('0xa0'),'comments_and_work_notes',_0x3c13('0xa1'),'sys_mod_count','reopen_count',_0x3c13('0xa2'),_0x3c13('0xa3'),_0x3c13('0xa4'),_0x3c13('0xa5'),'location',_0x3c13('0x6a')];var _0x514829='';var _0x154da5='';var _0x8ee781=[];var _0x1e7a7a='';var _0x37bc0a='';var _0x1c5d34=[];var _0x345049='';var _0x278cf5='';var _0x2dd649={};var _0x4fe4bb='';return db['ServicenowAccount'][_0x3c13('0x5a')]({'where':{'id':_0x3106d6['params']['id']},'attributes':['id',_0x3c13('0xa6'),_0x3c13('0xa7'),_0x3c13('0xa8'),_0x3c13('0xa9'),_0x3c13('0xaa')]})['then'](handleEntityNotFound(_0x167861,null))[_0x3c13('0x2f')](function(_0x3e81e1){if(_0x3e81e1){_0x4fe4bb=_0x3e81e1[_0x3c13('0xa9')];var _0x305365=_0x4fe4bb[_0x3c13('0xab')](-0x1);if(_0x305365==='/'){_0x4fe4bb=_0x4fe4bb[_0x3c13('0xac')](0x0,_0x4fe4bb[_0x3c13('0xad')](_0x305365));}_0x278cf5=util[_0x3c13('0xae')](_0x3c13('0xaf'),_0x4fe4bb);_0x345049=util[_0x3c13('0xae')](_0x3c13('0xb0'),_0x4fe4bb);_0x2dd649={'user':_0x3e81e1[_0x3c13('0xa6')],'pass':_0x3e81e1[_0x3c13('0xa7')]};var _0xf7a4e8={'method':'GET','uri':_0x278cf5+_0x3c13('0xb1'),'auth':_0x2dd649,'json':!![]};return rp(_0xf7a4e8);}})[_0x3c13('0x2f')](function(_0x171787){if(_0x171787['result'][_0x3c13('0x41')]>0x0){_0x514829=_0x171787['result'];}console[_0x3c13('0xb2')](_0x3c13('0xb3'),_0x514829);_0x1c5d34=[];_0x154da5=Object[_0x3c13('0xb4')]([],_0x514829);_[_0x3c13('0xb5')](_0x154da5,function(_0x29f917){return!_0x1fb505[_0x3c13('0xb6')](_0x29f917[_0x3c13('0x32')]);});_0x154da5['forEach'](function(_0xf233f4){var _0xf94d9e=createFieldObject(_0x345049,_0x2dd649,_0xf233f4[_0x3c13('0xb7')],_0xf233f4[_0x3c13('0x32')],_0xf233f4['label'],![]);_0x1c5d34[_0x3c13('0xb8')](_0xf94d9e);});return Promise[_0x3c13('0xb9')](_0x1c5d34);})['then'](function(_0x574564){_0x8ee781=_0x574564;_0x1e7a7a=Object[_0x3c13('0xb4')]([],_0x514829);console[_0x3c13('0xb2')](_0x3c13('0xba'),_0x514829);_[_0x3c13('0xb5')](_0x1e7a7a,function(_0x2bf417){return _0x14acf7[_0x3c13('0xb6')](_0x2bf417[_0x3c13('0x32')]);});console[_0x3c13('0xb2')](_0x3c13('0xbb'),_0x1e7a7a);_0x1c5d34=[];_0x1e7a7a['forEach'](function(_0x19f723){var _0x1f2574=createFieldObject(_0x345049,_0x2dd649,_0x19f723[_0x3c13('0xb7')],_0x19f723[_0x3c13('0x32')],_0x19f723[_0x3c13('0xbc')],!![]);_0x1c5d34[_0x3c13('0xb8')](_0x1f2574);});return Promise[_0x3c13('0xb9')](_0x1c5d34);})[_0x3c13('0x2f')](function(_0x432657){_0x37bc0a=_0x432657;var _0x4330c6=_0x8ee781[_0x3c13('0xbd')](_0x37bc0a);return{'count':_0x4330c6[_0x3c13('0x41')],'rows':_0x4330c6};})[_0x3c13('0x2f')](respondWithResult(_0x167861,null))[_0x3c13('0x26')](function(_0x571d02){console[_0x3c13('0xb2')](_0x3c13('0xbe')+_0x571d02);var _0x3ef7d7=_0x3106d6[_0x3c13('0x3c')]['test']?0x1f4:_0x571d02[_0x3c13('0xbf')]||0x1f4;logger[_0x3c13('0x23')](_0x571d02['stack']);delete _0x571d02[_0x3c13('0x32')];if(_0x3ef7d7===0x191){_0x3ef7d7=0x190;}_0x167861[_0x3c13('0x27')](_0x3ef7d7)[_0x3c13('0x33')](_0x3106d6['query'][_0x3c13('0x1d')]?{'message':_0x3c13('0xc0'),'statusCode':_0x571d02[_0x3c13('0xbf')]}:_0x571d02);});};function createFieldObject(_0x14a7a5,_0x23473c,_0x2ac3c6,_0x589360,_0x522d22,_0x42768f){return new Promise(function(_0x3169c4,_0xa36ff8){var _0x451254={'id':_0x589360,'name':_0x522d22,'custom':_0x42768f};if(_0x2ac3c6===_0x3c13('0xc1')){_0x451254[_0x3c13('0x4d')]=[{'name':_0x3c13('0xc2'),'value':'true'},{'name':_0x3c13('0xc3'),'value':_0x3c13('0xc4')}];_0x3169c4(_0x451254);}else{var _0xf2119a={'method':_0x3c13('0xc5'),'uri':_0x14a7a5+'sys_choice?sysparm_query=name=incident^element='+_0x589360,'auth':_0x23473c,'json':!![]};return rp(_0xf2119a)[_0x3c13('0x2f')](function(_0x6dc857){var _0xd8f0e8=[];if(_0x6dc857[_0x3c13('0xc6')]['length']>0x0){_0x6dc857[_0x3c13('0xc6')]['forEach'](function(_0x44937e){if(_0x44937e['inactive']===_0x3c13('0xc4')){var _0x269eb5={'name':_0x44937e[_0x3c13('0xbc')],'value':_0x44937e[_0x3c13('0xc7')]};_0xd8f0e8[_0x3c13('0xb8')](_0x269eb5);}});}_0x451254[_0x3c13('0x4d')]=_0xd8f0e8;if(_0x451254[_0x3c13('0x4d')][_0x3c13('0x41')]>0x0){_0x3169c4(_0x451254);}else{if(_0x42768f==![]){_0x3169c4();}else{_0x3169c4(_0x451254);}}});}});} \ No newline at end of file +var _0xcf9a=['params','destroy','ServicenowConfiguration','getConfigurations','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','Subjects','made_sla','knowledge','subcategory','close_code','notify','incident_state','category','parent','caused_by','upon_reject','child_incidents','approval_history','number','sys_updated_by','user_input','sys_created_on','sys_domain','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','work_end','reopened_time','approval_set','work_notes','short_description','correlation_display','delivery_task','business_stc','additional_assignee_list','description','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','parent_incident','contact_type','reopened_by','urgency','company','activity_due','assigned_to','severity','comments','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','correlation_id','location','findOne','remoteUri','substring','%s/api/now/doc/table/schema/','format','%s/api/now/table/','username','GET','incident?sysparm_display_value=all','log','incident\x20table\x20objects','assign','remove','forEach','internalType','label','all','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','push','concat','ServiceNow\x20error:\x20','statusCode','boolean','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','http','test','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','sendStatus','status','count','offset','limit','set','json','apply','reject','save','update','end','stack','name','send','index','map','ServicenowAccount','rawAttributes','key','query','keys','filters','model','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','include','findAll','rows','show','intersection','fields','length','includeAll','find','create','body'];(function(_0x17ec8c,_0x34eb4b){var _0x2dc485=function(_0x2da422){while(--_0x2da422){_0x17ec8c['push'](_0x17ec8c['shift']());}};_0x2dc485(++_0x34eb4b);}(_0xcf9a,0x6a));var _0xacf9=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xcf9a[_0x4b369d];return _0x571a98;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xacf9('0x0'));var rimraf=require(_0xacf9('0x1'));var zipdir=require(_0xacf9('0x2'));var jsonpatch=require(_0xacf9('0x3'));var rp=require(_0xacf9('0x4'));var moment=require(_0xacf9('0x5'));var BPromise=require(_0xacf9('0x6'));var Mustache=require('mustache');var util=require(_0xacf9('0x7'));var path=require(_0xacf9('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xacf9('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xacf9('0xa'));var crypto=require(_0xacf9('0xb'));var jsforce=require(_0xacf9('0xc'));var deskjs=require(_0xacf9('0xd'));var toCsv=require(_0xacf9('0xe'));var querystring=require('querystring');var Papa=require(_0xacf9('0xf'));var Redis=require(_0xacf9('0x10'));var authService=require(_0xacf9('0x11'));var qs=require(_0xacf9('0x12'));var as=require(_0xacf9('0x13'));var hardwareService=require(_0xacf9('0x14'));var logger=require('../../config/logger')(_0xacf9('0x15'));var utils=require(_0xacf9('0x16'));var config=require(_0xacf9('0x17'));var db=require(_0xacf9('0x18'))['db'];var integrations=require(_0xacf9('0x19'));var jayson=require(_0xacf9('0x1a'));var client=jayson['client'][_0xacf9('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x15b211,_0x279980,_0x113c65){if(_0x113c65){var _0x5c09df=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5c09df[_0xacf9('0x1c')](_0x279980)){return _0x15b211;}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 _0x15b211;}}function respondWithRpcPromise(_0x1c3173,_0x4c809a,_0x5c0000,_0x291b53){return new BPromise(function(_0x5b1e40,_0x5d8f74){var _0x5dd473=_0x291b53||client;return _0x5dd473[_0xacf9('0x1d')](_0x1c3173,_0x5c0000)[_0xacf9('0x1e')](function(_0xbd0641){logger[_0xacf9('0x1f')](_0xacf9('0x20'),_0x4c809a,_0xacf9('0x21'));logger[_0xacf9('0x22')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x4c809a,'request\x20sent',JSON[_0xacf9('0x23')](_0xbd0641));if(_0xbd0641['error']){if(_0xbd0641[_0xacf9('0x24')]['code']===0x1f4){logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x4c809a,_0xbd0641[_0xacf9('0x24')][_0xacf9('0x25')]);return _0x5d8f74(_0xbd0641[_0xacf9('0x24')]['message']);}logger['error'](_0xacf9('0x20'),_0x4c809a,_0xbd0641[_0xacf9('0x24')]['message']);return _0x5b1e40(_0xbd0641[_0xacf9('0x24')][_0xacf9('0x25')]);}else{logger[_0xacf9('0x1f')](_0xacf9('0x20'),_0x4c809a,_0xacf9('0x21'));_0x5b1e40(_0xbd0641[_0xacf9('0x26')][_0xacf9('0x25')]);}})[_0xacf9('0x27')](function(_0x506abb){logger[_0xacf9('0x24')]('ServicenowAccount,\x20%s,\x20%s',_0x4c809a,_0x506abb);_0x5d8f74(_0x506abb);});});}function respondWithStatusCode(_0x34196e,_0x4b3ef4){_0x4b3ef4=_0x4b3ef4||0xcc;return function(_0x569672){if(_0x569672){return _0x34196e[_0xacf9('0x28')](_0x4b3ef4);}return _0x34196e['status'](_0x4b3ef4)['end']();};}function respondWithResult(_0x46ce76,_0x59b3d1){_0x59b3d1=_0x59b3d1||0xc8;return function(_0x1a4ee7){if(_0x1a4ee7){return _0x46ce76[_0xacf9('0x29')](_0x59b3d1)['json'](_0x1a4ee7);}};}function respondWithFilteredResult(_0x5d0e9b,_0x4f7e91){return function(_0x34dc7c){if(_0x34dc7c){var _0x56a43e=_0x34dc7c[_0xacf9('0x2a')],_0x33f5de=_0x4f7e91[_0xacf9('0x2b')],_0x16f3cf=_0x4f7e91['offset']+_0x4f7e91[_0xacf9('0x2c')],_0x5cfc90;if(_0x16f3cf>=_0x56a43e){_0x16f3cf=_0x56a43e;_0x5cfc90=0xc8;}else{_0x5cfc90=0xce;}_0x5d0e9b[_0xacf9('0x29')](_0x5cfc90);return _0x5d0e9b[_0xacf9('0x2d')]('Content-Range',_0x33f5de+'-'+_0x16f3cf+'/'+_0x56a43e)[_0xacf9('0x2e')](_0x34dc7c);}return null;};}function patchUpdates(_0x1c12d0){return function(_0x46076f){try{jsonpatch[_0xacf9('0x2f')](_0x46076f,_0x1c12d0,!![]);}catch(_0x197b57){return BPromise[_0xacf9('0x30')](_0x197b57);}return _0x46076f[_0xacf9('0x31')]();};}function saveUpdates(_0x4b3042,_0x4a0704){return function(_0x42f350){if(_0x42f350){return _0x42f350[_0xacf9('0x32')](_0x4b3042)[_0xacf9('0x1e')](function(_0x1f20b4){return _0x1f20b4;});}return null;};}function removeEntity(_0x5b97d5,_0x2f7505){return function(_0x43982b){if(_0x43982b){return _0x43982b['destroy']()[_0xacf9('0x1e')](function(){_0x5b97d5[_0xacf9('0x29')](0xcc)[_0xacf9('0x33')]();});}};}function handleEntityNotFound(_0x5471cc,_0x5f3bc5){return function(_0x5badd9){if(!_0x5badd9){_0x5471cc[_0xacf9('0x28')](0x194);}return _0x5badd9;};}function handleError(_0x398aa7,_0x41b713){_0x41b713=_0x41b713||0x1f4;return function(_0x343e50){logger[_0xacf9('0x24')](_0x343e50[_0xacf9('0x34')]);if(_0x343e50['name']){delete _0x343e50[_0xacf9('0x35')];}_0x398aa7[_0xacf9('0x29')](_0x41b713)[_0xacf9('0x36')](_0x343e50);};}exports[_0xacf9('0x37')]=function(_0xc4fd55,_0x1d8c2d){var _0x28679f={},_0x167b63={},_0xe8ed67={'count':0x0,'rows':[]};var _0x16d7e9=_[_0xacf9('0x38')](db[_0xacf9('0x39')][_0xacf9('0x3a')],function(_0x445fb5){return{'name':_0x445fb5['fieldName'],'type':_0x445fb5['type'][_0xacf9('0x3b')]};});_0x167b63['model']=_[_0xacf9('0x38')](_0x16d7e9,_0xacf9('0x35'));_0x167b63[_0xacf9('0x3c')]=_[_0xacf9('0x3d')](_0xc4fd55[_0xacf9('0x3c')]);_0x167b63[_0xacf9('0x3e')]=_['intersection'](_0x167b63[_0xacf9('0x3f')],_0x167b63['query']);_0x28679f[_0xacf9('0x40')]=_['intersection'](_0x167b63[_0xacf9('0x3f')],qs['fields'](_0xc4fd55[_0xacf9('0x3c')]['fields']));_0x28679f[_0xacf9('0x40')]=_0x28679f[_0xacf9('0x40')]['length']?_0x28679f[_0xacf9('0x40')]:_0x167b63[_0xacf9('0x3f')];if(!_0xc4fd55[_0xacf9('0x3c')][_0xacf9('0x41')](_0xacf9('0x42'))){_0x28679f['limit']=qs[_0xacf9('0x2c')](_0xc4fd55[_0xacf9('0x3c')][_0xacf9('0x2c')]);_0x28679f[_0xacf9('0x2b')]=qs[_0xacf9('0x2b')](_0xc4fd55[_0xacf9('0x3c')][_0xacf9('0x2b')]);}_0x28679f[_0xacf9('0x43')]=qs[_0xacf9('0x44')](_0xc4fd55[_0xacf9('0x3c')][_0xacf9('0x44')]);_0x28679f[_0xacf9('0x45')]=qs[_0xacf9('0x3e')](_[_0xacf9('0x46')](_0xc4fd55[_0xacf9('0x3c')],_0x167b63[_0xacf9('0x3e')]));if(_0xc4fd55['query']['filter']){_0x28679f[_0xacf9('0x45')]=_[_0xacf9('0x47')](_0x28679f['where'],{'$or':_['map'](_0x16d7e9,function(_0x1a7890){if(_0x1a7890[_0xacf9('0x48')][_0xacf9('0x3b')]!==_0xacf9('0x49')){var _0x4b7998={};_0x4b7998[_0x1a7890['field']]={'$like':'%'+_0xc4fd55[_0xacf9('0x3c')][_0xacf9('0x4a')]+'%'};return _0x4b7998;}})});}_0x28679f=_[_0xacf9('0x47')]({},_0x28679f,_0xc4fd55[_0xacf9('0x4b')]);var _0x3fcb88={'where':_0x28679f[_0xacf9('0x45')]};return db['ServicenowAccount'][_0xacf9('0x2a')](_0x3fcb88)[_0xacf9('0x1e')](function(_0x2213e7){_0xe8ed67[_0xacf9('0x2a')]=_0x2213e7;if(_0xc4fd55['query']['includeAll']){_0x28679f[_0xacf9('0x4c')]=[{'all':!![]}];}return db['ServicenowAccount'][_0xacf9('0x4d')](_0x28679f);})[_0xacf9('0x1e')](function(_0x430fc5){_0xe8ed67[_0xacf9('0x4e')]=_0x430fc5;return _0xe8ed67;})[_0xacf9('0x1e')](respondWithFilteredResult(_0x1d8c2d,_0x28679f))[_0xacf9('0x27')](handleError(_0x1d8c2d,null));};exports[_0xacf9('0x4f')]=function(_0x56ebb2,_0x3714b8){var _0x1578cf={'raw':![],'where':{'id':_0x56ebb2['params']['id']}},_0x138c37={};_0x138c37[_0xacf9('0x3f')]=_[_0xacf9('0x3d')](db['ServicenowAccount'][_0xacf9('0x3a')]);_0x138c37[_0xacf9('0x3c')]=_[_0xacf9('0x3d')](_0x56ebb2[_0xacf9('0x3c')]);_0x138c37[_0xacf9('0x3e')]=_[_0xacf9('0x50')](_0x138c37[_0xacf9('0x3f')],_0x138c37['query']);_0x1578cf[_0xacf9('0x40')]=_[_0xacf9('0x50')](_0x138c37[_0xacf9('0x3f')],qs['fields'](_0x56ebb2[_0xacf9('0x3c')][_0xacf9('0x51')]));_0x1578cf[_0xacf9('0x40')]=_0x1578cf[_0xacf9('0x40')][_0xacf9('0x52')]?_0x1578cf[_0xacf9('0x40')]:_0x138c37[_0xacf9('0x3f')];if(_0x56ebb2[_0xacf9('0x3c')][_0xacf9('0x53')]){_0x1578cf[_0xacf9('0x4c')]=[{'all':!![]}];}_0x1578cf=_['merge']({},_0x1578cf,_0x56ebb2['options']);return db['ServicenowAccount'][_0xacf9('0x54')](_0x1578cf)['then'](handleEntityNotFound(_0x3714b8,null))[_0xacf9('0x1e')](respondWithResult(_0x3714b8,null))[_0xacf9('0x27')](handleError(_0x3714b8,null));};exports[_0xacf9('0x55')]=function(_0x53f989,_0x23cd14){return db[_0xacf9('0x39')][_0xacf9('0x55')](_0x53f989['body'],{})[_0xacf9('0x1e')](respondWithResult(_0x23cd14,0xc9))[_0xacf9('0x27')](handleError(_0x23cd14,null));};exports[_0xacf9('0x32')]=function(_0x3b47ee,_0x2b7bd9){if(_0x3b47ee['body']['id']){delete _0x3b47ee[_0xacf9('0x56')]['id'];}return db['ServicenowAccount'][_0xacf9('0x54')]({'where':{'id':_0x3b47ee[_0xacf9('0x57')]['id']}})[_0xacf9('0x1e')](handleEntityNotFound(_0x2b7bd9,null))[_0xacf9('0x1e')](saveUpdates(_0x3b47ee[_0xacf9('0x56')],null))[_0xacf9('0x1e')](respondWithResult(_0x2b7bd9,null))[_0xacf9('0x27')](handleError(_0x2b7bd9,null));};exports[_0xacf9('0x58')]=function(_0x425f6b,_0x413797){return db[_0xacf9('0x39')]['find']({'where':{'id':_0x425f6b['params']['id']}})['then'](handleEntityNotFound(_0x413797,null))[_0xacf9('0x1e')](removeEntity(_0x413797,null))[_0xacf9('0x27')](handleError(_0x413797,null));};exports['getConfigurations']=function(_0x3f8b4d,_0x31d13f,_0x5e70e1){var _0x279cef={};var _0x105799={};var _0x5280a6;var _0x2a5294;return db[_0xacf9('0x39')]['findOne']({'where':{'id':_0x3f8b4d[_0xacf9('0x57')]['id']}})[_0xacf9('0x1e')](handleEntityNotFound(_0x31d13f,null))[_0xacf9('0x1e')](function(_0x1404bf){if(_0x1404bf){_0x5280a6=_0x1404bf;_0x105799[_0xacf9('0x3f')]=_[_0xacf9('0x3d')](db[_0xacf9('0x59')][_0xacf9('0x3a')]);_0x105799[_0xacf9('0x3c')]=_[_0xacf9('0x3d')](_0x3f8b4d[_0xacf9('0x3c')]);_0x105799[_0xacf9('0x3e')]=_['intersection'](_0x105799[_0xacf9('0x3f')],_0x105799[_0xacf9('0x3c')]);_0x279cef[_0xacf9('0x40')]=_[_0xacf9('0x50')](_0x105799['model'],qs[_0xacf9('0x51')](_0x3f8b4d['query'][_0xacf9('0x51')]));_0x279cef[_0xacf9('0x40')]=_0x279cef[_0xacf9('0x40')][_0xacf9('0x52')]?_0x279cef[_0xacf9('0x40')]:_0x105799[_0xacf9('0x3f')];_0x279cef['order']=qs[_0xacf9('0x44')](_0x3f8b4d['query'][_0xacf9('0x44')]);_0x279cef[_0xacf9('0x45')]=qs[_0xacf9('0x3e')](_[_0xacf9('0x46')](_0x3f8b4d[_0xacf9('0x3c')],_0x105799[_0xacf9('0x3e')]));if(_0x3f8b4d[_0xacf9('0x3c')][_0xacf9('0x4a')]){_0x279cef[_0xacf9('0x45')]=_[_0xacf9('0x47')](_0x279cef['where'],{'$or':_[_0xacf9('0x38')](_0x279cef[_0xacf9('0x40')],function(_0x2f98de){var _0x36d635={};_0x36d635[_0x2f98de]={'$like':'%'+_0x3f8b4d[_0xacf9('0x3c')][_0xacf9('0x4a')]+'%'};return _0x36d635;})});}_0x279cef=_[_0xacf9('0x47')]({},_0x279cef,_0x3f8b4d[_0xacf9('0x4b')]);return _0x5280a6[_0xacf9('0x5a')](_0x279cef);}})[_0xacf9('0x1e')](function(_0x36ed97){if(_0x36ed97){_0x2a5294=_0x36ed97[_0xacf9('0x52')];if(!_0x3f8b4d[_0xacf9('0x3c')]['hasOwnProperty'](_0xacf9('0x42'))){_0x279cef[_0xacf9('0x2c')]=qs[_0xacf9('0x2c')](_0x3f8b4d[_0xacf9('0x3c')][_0xacf9('0x2c')]);_0x279cef['offset']=qs['offset'](_0x3f8b4d[_0xacf9('0x3c')]['offset']);}return _0x5280a6[_0xacf9('0x5a')](_0x279cef);}})[_0xacf9('0x1e')](function(_0x3850d8){if(_0x3850d8){return _0x3850d8?{'count':_0x2a5294,'rows':_0x3850d8}:null;}})['then'](respondWithResult(_0x31d13f,null))[_0xacf9('0x27')](handleError(_0x31d13f,null));};exports[_0xacf9('0x5b')]=function(_0x3cef58,_0xbea81f,_0x15d107){if(_0x3cef58['body']['id']){delete _0x3cef58[_0xacf9('0x56')]['id'];}return db['ServicenowAccount']['findOne']({'where':{'id':_0x3cef58[_0xacf9('0x57')]['id']}})[_0xacf9('0x1e')](handleEntityNotFound(_0xbea81f,null))[_0xacf9('0x1e')](function(_0xc6b08c){if(_0xc6b08c){_0x3cef58[_0xacf9('0x56')][_0xacf9('0x5c')]=_0xc6b08c['id'];_0x3cef58['body']['Subjects']=integrations[_0xacf9('0x5d')](_0x3cef58['body'][_0xacf9('0x5e')],_0x3cef58[_0xacf9('0x56')]['type']);_0x3cef58[_0xacf9('0x56')][_0xacf9('0x5f')]=integrations[_0xacf9('0x60')](_0x3cef58[_0xacf9('0x56')]['channel'],_0x3cef58['body'][_0xacf9('0x48')]);return db[_0xacf9('0x59')][_0xacf9('0x55')](_0x3cef58[_0xacf9('0x56')],{'include':[{'model':db[_0xacf9('0x61')],'as':_0xacf9('0x62')},{'model':db[_0xacf9('0x61')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0xbea81f,null))[_0xacf9('0x27')](handleError(_0xbea81f,null));};exports['getFields']=function(_0x59ff20,_0x19aabc,_0x2fd985){var _0x23a487=[_0xacf9('0x63'),'hold_reason',_0xacf9('0x64'),_0xacf9('0x65'),_0xacf9('0x66'),_0xacf9('0x67'),_0xacf9('0x68'),'severity',_0xacf9('0x69')];var _0x2faa1e=[_0xacf9('0x6a'),_0xacf9('0x63'),_0xacf9('0x6b'),'watch_list',_0xacf9('0x6c'),'sys_updated_on',_0xacf9('0x6d'),'hold_reason',_0xacf9('0x6e'),_0xacf9('0x6f'),'resolved_by',_0xacf9('0x70'),'opened_by',_0xacf9('0x71'),_0xacf9('0x72'),_0xacf9('0x73'),'state',_0xacf9('0x74'),_0xacf9('0x64'),_0xacf9('0x43'),_0xacf9('0x75'),_0xacf9('0x76'),_0xacf9('0x77'),_0xacf9('0x78'),_0xacf9('0x79'),_0xacf9('0x7a'),_0xacf9('0x7b'),'business_service',_0xacf9('0x7c'),_0xacf9('0x7d'),_0xacf9('0x7e'),_0xacf9('0x7f'),_0xacf9('0x80'),_0xacf9('0x81'),_0xacf9('0x82'),'group_list',_0xacf9('0x83'),_0xacf9('0x84'),'resolved_at','caller_id',_0xacf9('0x85'),'subcategory',_0xacf9('0x86'),_0xacf9('0x87'),_0xacf9('0x66'),_0xacf9('0x88'),_0xacf9('0x89'),'work_start','assignment_group',_0xacf9('0x8a'),_0xacf9('0x8b'),_0xacf9('0x8c'),_0xacf9('0x8d'),_0xacf9('0x67'),_0xacf9('0x8e'),_0xacf9('0x8f'),_0xacf9('0x90'),_0xacf9('0x91'),_0xacf9('0x92'),'sys_id',_0xacf9('0x93'),_0xacf9('0x94'),_0xacf9('0x68'),_0xacf9('0x95'),'problem_id',_0xacf9('0x96'),'reassignment_count',_0xacf9('0x97'),_0xacf9('0x98'),_0xacf9('0x99'),_0xacf9('0x9a'),'sla_due',_0xacf9('0x9b'),_0xacf9('0x9c'),_0xacf9('0x9d'),_0xacf9('0x9e'),_0xacf9('0x9f'),_0xacf9('0xa0'),_0xacf9('0xa1'),'upon_approval',_0xacf9('0xa2'),_0xacf9('0xa3'),_0xacf9('0x69')];var _0x21209b='';var _0x59fa1e='';var _0x399a6a=[];var _0x18dce1='';var _0x36e41d='';var _0x2d5f04=[];var _0x15c9eb='';var _0x112edf='';var _0x50248c={};var _0xc84160='';return db[_0xacf9('0x39')][_0xacf9('0xa4')]({'where':{'id':_0x59ff20[_0xacf9('0x57')]['id']},'attributes':['id','username','password','email',_0xacf9('0xa5'),'serverUrl']})['then'](handleEntityNotFound(_0x19aabc,null))[_0xacf9('0x1e')](function(_0x30da7e){if(_0x30da7e){_0xc84160=_0x30da7e[_0xacf9('0xa5')];var _0x8cfd49=_0xc84160['slice'](-0x1);if(_0x8cfd49==='/'){_0xc84160=_0xc84160[_0xacf9('0xa6')](0x0,_0xc84160['lastIndexOf'](_0x8cfd49));}_0x112edf=util['format'](_0xacf9('0xa7'),_0xc84160);_0x15c9eb=util[_0xacf9('0xa8')](_0xacf9('0xa9'),_0xc84160);_0x50248c={'user':_0x30da7e[_0xacf9('0xaa')],'pass':_0x30da7e['password']};var _0xd7b15f={'method':_0xacf9('0xab'),'uri':_0x112edf+_0xacf9('0xac'),'auth':_0x50248c,'json':!![]};return rp(_0xd7b15f);}})[_0xacf9('0x1e')](function(_0x3826d3){if(_0x3826d3[_0xacf9('0x26')][_0xacf9('0x52')]>0x0){_0x21209b=_0x3826d3[_0xacf9('0x26')];}console[_0xacf9('0xad')](_0xacf9('0xae'),_0x21209b);_0x2d5f04=[];_0x59fa1e=Object[_0xacf9('0xaf')]([],_0x21209b);_[_0xacf9('0xb0')](_0x59fa1e,function(_0x1906c8){return!_0x23a487['includes'](_0x1906c8[_0xacf9('0x35')]);});_0x59fa1e[_0xacf9('0xb1')](function(_0x5d3238){var _0x28c765=createFieldObject(_0x15c9eb,_0x50248c,_0x5d3238[_0xacf9('0xb2')],_0x5d3238[_0xacf9('0x35')],_0x5d3238[_0xacf9('0xb3')],![]);_0x2d5f04['push'](_0x28c765);});return Promise[_0xacf9('0xb4')](_0x2d5f04);})[_0xacf9('0x1e')](function(_0x37c2ff){_0x399a6a=_0x37c2ff;_0x18dce1=Object[_0xacf9('0xaf')]([],_0x21209b);console['log'](_0xacf9('0xb5'),_0x21209b);_['remove'](_0x18dce1,function(_0x546eb7){return _0x2faa1e['includes'](_0x546eb7['name']);});console['log'](_0xacf9('0xb6'),_0x18dce1);_0x2d5f04=[];_0x18dce1[_0xacf9('0xb1')](function(_0xccc040){var _0x3fd7ae=createFieldObject(_0x15c9eb,_0x50248c,_0xccc040[_0xacf9('0xb2')],_0xccc040[_0xacf9('0x35')],_0xccc040[_0xacf9('0xb3')],!![]);_0x2d5f04[_0xacf9('0xb7')](_0x3fd7ae);});return Promise[_0xacf9('0xb4')](_0x2d5f04);})[_0xacf9('0x1e')](function(_0x458927){_0x36e41d=_0x458927;var _0x1aa369=_0x399a6a[_0xacf9('0xb8')](_0x36e41d);return{'count':_0x1aa369['length'],'rows':_0x1aa369};})['then'](respondWithResult(_0x19aabc,null))[_0xacf9('0x27')](function(_0x1fa2b2){console[_0xacf9('0xad')](_0xacf9('0xb9')+_0x1fa2b2);var _0xfdc8d8=_0x59ff20[_0xacf9('0x3c')][_0xacf9('0x1c')]?0x1f4:_0x1fa2b2[_0xacf9('0xba')]||0x1f4;logger['error'](_0x1fa2b2['stack']);delete _0x1fa2b2[_0xacf9('0x35')];if(_0xfdc8d8===0x191){_0xfdc8d8=0x190;}_0x19aabc['status'](_0xfdc8d8)[_0xacf9('0x36')](_0x59ff20['query']['test']?{'message':'Wrong\x20credentials','statusCode':_0x1fa2b2[_0xacf9('0xba')]}:_0x1fa2b2);});};function createFieldObject(_0x37574d,_0x56a67a,_0x41accd,_0x1bb4fb,_0x524247,_0x1f3d4d){return new Promise(function(_0x59ee28,_0x2f8d95){var _0x2c0f95={'id':_0x1bb4fb,'name':_0x524247,'custom':_0x1f3d4d};if(_0x41accd===_0xacf9('0xbb')){_0x2c0f95[_0xacf9('0x4b')]=[{'name':'True','value':_0xacf9('0xbc')},{'name':_0xacf9('0xbd'),'value':_0xacf9('0xbe')}];_0x59ee28(_0x2c0f95);}else{var _0x1c05cc={'method':_0xacf9('0xab'),'uri':_0x37574d+_0xacf9('0xbf')+_0x1bb4fb,'auth':_0x56a67a,'json':!![]};return rp(_0x1c05cc)['then'](function(_0x120f48){var _0x46524d=[];if(_0x120f48[_0xacf9('0x26')][_0xacf9('0x52')]>0x0){_0x120f48['result'][_0xacf9('0xb1')](function(_0x411f68){if(_0x411f68[_0xacf9('0xc0')]===_0xacf9('0xbe')){var _0x27eb98={'name':_0x411f68[_0xacf9('0xb3')],'value':_0x411f68['value']};_0x46524d[_0xacf9('0xb7')](_0x27eb98);}});}_0x2c0f95[_0xacf9('0x4b')]=_0x46524d;if(_0x2c0f95['options'][_0xacf9('0x52')]>0x0){_0x59ee28(_0x2c0f95);}else{if(_0x1f3d4d==![]){_0x59ee28();}else{_0x59ee28(_0x2c0f95);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 7aa4e93..34975b4 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 _0xa630=['moment','request-promise','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','int_servicenow_accounts','lodash','util'];(function(_0x35d564,_0x9c79a1){var _0x335d97=function(_0x38deeb){while(--_0x38deeb){_0x35d564['push'](_0x35d564['shift']());}};_0x335d97(++_0x9c79a1);}(_0xa630,0xbe));var _0x0a63=function(_0x2090b1,_0x251113){_0x2090b1=_0x2090b1-0x0;var _0x1067b7=_0xa630[_0x2090b1];return _0x1067b7;};'use strict';var _=require(_0x0a63('0x0'));var util=require(_0x0a63('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0a63('0x2'));var BPromise=require('bluebird');var rp=require(_0x0a63('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0a63('0x4'));var config=require(_0x0a63('0x5'));var attributes=require(_0x0a63('0x6'));var integrations=require(_0x0a63('0x7'));module[_0x0a63('0x8')]=function(_0x4b7474,_0x2760b0){return _0x4b7474[_0x0a63('0x9')](_0x0a63('0xa'),attributes,{'tableName':_0x0a63('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x33c5=['request-promise','path','rimraf','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','int_servicenow_accounts','util','../../config/logger','moment','bluebird'];(function(_0x12f2c0,_0x11e470){var _0x1c62b3=function(_0x47aaa0){while(--_0x47aaa0){_0x12f2c0['push'](_0x12f2c0['shift']());}};_0x1c62b3(++_0x11e470);}(_0x33c5,0xe6));var _0x533c=function(_0x5266e7,_0x97b16b){_0x5266e7=_0x5266e7-0x0;var _0x5470f1=_0x33c5[_0x5266e7];return _0x5470f1;};'use strict';var _=require('lodash');var util=require(_0x533c('0x0'));var logger=require(_0x533c('0x1'))('api');var moment=require(_0x533c('0x2'));var BPromise=require(_0x533c('0x3'));var rp=require(_0x533c('0x4'));var fs=require('fs');var path=require(_0x533c('0x5'));var rimraf=require(_0x533c('0x6'));var config=require('../../config/environment');var attributes=require(_0x533c('0x7'));var integrations=require(_0x533c('0x8'));module[_0x533c('0x9')]=function(_0x151732,_0x34ca89){return _0x151732[_0x533c('0xa')](_0x533c('0xb'),attributes,{'tableName':_0x533c('0xc'),'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 e88c556..cc24653 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 _0x0b33=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','ServicenowAccount,\x20%s,\x20%s','ServicenowAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetServicenowAccount','findAll','options','limit','include','map','model','attributes','ServicenowAccount','find','raw','where','ShowServicenowAccount','debug','lodash','util','moment','randomstring','../../mysqldb'];(function(_0x411787,_0x448d92){var _0x4fd3b7=function(_0x5905da){while(--_0x5905da){_0x411787['push'](_0x411787['shift']());}};_0x4fd3b7(++_0x448d92);}(_0x0b33,0xcd));var _0x30b3=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x0b33[_0x2c7618];return _0x5ce3f0;};'use strict';var _=require(_0x30b3('0x0'));var util=require(_0x30b3('0x1'));var moment=require(_0x30b3('0x2'));var BPromise=require('bluebird');var rs=require(_0x30b3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x30b3('0x4'))['db'];var utils=require(_0x30b3('0x5'));var logger=require(_0x30b3('0x6'))(_0x30b3('0x7'));var config=require('../../config/environment');var jayson=require(_0x30b3('0x8'));var client=jayson[_0x30b3('0x9')][_0x30b3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x50875d,_0x3cdd66,_0x2fcc88){return new BPromise(function(_0x58b2ba,_0x202fce){return client['request'](_0x50875d,_0x2fcc88)[_0x30b3('0xb')](function(_0x161148){logger[_0x30b3('0xc')](_0x30b3('0xd'),_0x3cdd66,'request\x20sent');logger['debug'](_0x30b3('0xe'),_0x3cdd66,_0x30b3('0xf'),JSON[_0x30b3('0x10')](_0x161148));if(_0x161148[_0x30b3('0x11')]){if(_0x161148[_0x30b3('0x11')]['code']===0x1f4){logger[_0x30b3('0x11')](_0x30b3('0xd'),_0x3cdd66,_0x161148[_0x30b3('0x11')][_0x30b3('0x12')]);return _0x202fce(_0x161148[_0x30b3('0x11')][_0x30b3('0x12')]);}logger[_0x30b3('0x11')](_0x30b3('0xd'),_0x3cdd66,_0x161148[_0x30b3('0x11')]['message']);return _0x58b2ba(_0x161148[_0x30b3('0x11')][_0x30b3('0x12')]);}else{logger['info']('ServicenowAccount,\x20%s,\x20%s',_0x3cdd66,_0x30b3('0xf'));_0x58b2ba(_0x161148[_0x30b3('0x13')][_0x30b3('0x12')]);}})[_0x30b3('0x14')](function(_0x2d9585){logger[_0x30b3('0x11')](_0x30b3('0xd'),_0x3cdd66,_0x2d9585);_0x202fce(_0x2d9585);});});}exports[_0x30b3('0x15')]=function(_0x415538){var _0x2ffe9e=this;return new Promise(function(_0x12d1c6,_0x142ccf){return db['ServicenowAccount'][_0x30b3('0x16')]({'raw':_0x415538[_0x30b3('0x17')]?_0x415538[_0x30b3('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x415538[_0x30b3('0x17')]?_0x415538[_0x30b3('0x17')]['where']||null:null,'attributes':_0x415538[_0x30b3('0x17')]?_0x415538[_0x30b3('0x17')]['attributes']||null:null,'limit':_0x415538['options']?_0x415538[_0x30b3('0x17')][_0x30b3('0x18')]||null:null,'include':_0x415538[_0x30b3('0x17')]?_0x415538['options'][_0x30b3('0x19')]?_[_0x30b3('0x1a')](_0x415538['options'][_0x30b3('0x19')],function(_0x540bd1){return{'model':db[_0x540bd1[_0x30b3('0x1b')]],'as':_0x540bd1['as'],'attributes':_0x540bd1[_0x30b3('0x1c')],'include':_0x540bd1[_0x30b3('0x19')]?_[_0x30b3('0x1a')](_0x540bd1[_0x30b3('0x19')],function(_0x4304a0){return{'model':db[_0x4304a0['model']],'as':_0x4304a0['as'],'attributes':_0x4304a0[_0x30b3('0x1c')],'include':_0x4304a0[_0x30b3('0x19')]?_[_0x30b3('0x1a')](_0x4304a0[_0x30b3('0x19')],function(_0x282239){return{'model':db[_0x282239['model']],'as':_0x282239['as'],'attributes':_0x282239['attributes']};}):[]};}):[]};}):[]:[]})[_0x30b3('0xb')](function(_0x3a1a7e){logger[_0x30b3('0xc')](_0x30b3('0x15'),_0x415538);logger['debug']('GetServicenowAccount',_0x415538,JSON[_0x30b3('0x10')](_0x3a1a7e));_0x12d1c6(_0x3a1a7e);})['catch'](function(_0x36ea44){logger[_0x30b3('0x11')](_0x30b3('0x15'),_0x36ea44[_0x30b3('0x12')],_0x415538);_0x142ccf(_0x2ffe9e[_0x30b3('0x11')](0x1f4,_0x36ea44[_0x30b3('0x12')]));});});};exports['ShowServicenowAccount']=function(_0xbfbd47){var _0x372383=this;return new Promise(function(_0x48f633,_0x401689){return db[_0x30b3('0x1d')][_0x30b3('0x1e')]({'raw':_0xbfbd47[_0x30b3('0x17')]?_0xbfbd47[_0x30b3('0x17')][_0x30b3('0x1f')]===undefined?!![]:![]:!![],'where':_0xbfbd47[_0x30b3('0x17')]?_0xbfbd47[_0x30b3('0x17')][_0x30b3('0x20')]||null:null,'attributes':_0xbfbd47[_0x30b3('0x17')]?_0xbfbd47[_0x30b3('0x17')][_0x30b3('0x1c')]||null:null,'include':_0xbfbd47['options']?_0xbfbd47[_0x30b3('0x17')]['include']?_[_0x30b3('0x1a')](_0xbfbd47['options'][_0x30b3('0x19')],function(_0x4bebc6){return{'model':db[_0x4bebc6['model']],'as':_0x4bebc6['as'],'attributes':_0x4bebc6[_0x30b3('0x1c')],'include':_0x4bebc6[_0x30b3('0x19')]?_[_0x30b3('0x1a')](_0x4bebc6[_0x30b3('0x19')],function(_0x5033c1){return{'model':db[_0x5033c1[_0x30b3('0x1b')]],'as':_0x5033c1['as'],'attributes':_0x5033c1[_0x30b3('0x1c')],'include':_0x5033c1[_0x30b3('0x19')]?_['map'](_0x5033c1[_0x30b3('0x19')],function(_0x5e450a){return{'model':db[_0x5e450a[_0x30b3('0x1b')]],'as':_0x5e450a['as'],'attributes':_0x5e450a['attributes']};}):[]};}):[]};}):[]:[]})[_0x30b3('0xb')](function(_0x10e95f){logger[_0x30b3('0xc')](_0x30b3('0x21'),_0xbfbd47);logger[_0x30b3('0x22')](_0x30b3('0x21'),_0xbfbd47,JSON['stringify'](_0x10e95f));_0x48f633(_0x10e95f);})['catch'](function(_0x469e49){logger[_0x30b3('0x11')](_0x30b3('0x21'),_0x469e49['message'],_0xbfbd47);_0x401689(_0x372383['error'](0x1f4,_0x469e49['message']));});});}; \ No newline at end of file +var _0x9ba5=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','error','message','result','catch','GetServicenowAccount','ServicenowAccount','findAll','options','raw','where','attributes','limit','map','include','model','debug','ShowServicenowAccount','find','stringify','bluebird','ioredis','../../mysqldb'];(function(_0x475eb2,_0x50c5c7){var _0x3b4560=function(_0x59f496){while(--_0x59f496){_0x475eb2['push'](_0x475eb2['shift']());}};_0x3b4560(++_0x50c5c7);}(_0x9ba5,0x15d));var _0x59ba=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x9ba5[_0x8c43de];return _0xa6591b;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x59ba('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x59ba('0x1'));var db=require(_0x59ba('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x59ba('0x3'))(_0x59ba('0x4'));var config=require(_0x59ba('0x5'));var jayson=require(_0x59ba('0x6'));var client=jayson[_0x59ba('0x7')][_0x59ba('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x552879,_0x21cd0b,_0x2b9109){return new BPromise(function(_0x3e7f0d,_0x1656bc){return client['request'](_0x552879,_0x2b9109)[_0x59ba('0x9')](function(_0x5f0b17){logger[_0x59ba('0xa')](_0x59ba('0xb'),_0x21cd0b,_0x59ba('0xc'));logger['debug']('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x21cd0b,_0x59ba('0xc'),JSON['stringify'](_0x5f0b17));if(_0x5f0b17[_0x59ba('0xd')]){if(_0x5f0b17['error']['code']===0x1f4){logger[_0x59ba('0xd')](_0x59ba('0xb'),_0x21cd0b,_0x5f0b17[_0x59ba('0xd')][_0x59ba('0xe')]);return _0x1656bc(_0x5f0b17[_0x59ba('0xd')][_0x59ba('0xe')]);}logger[_0x59ba('0xd')]('ServicenowAccount,\x20%s,\x20%s',_0x21cd0b,_0x5f0b17[_0x59ba('0xd')][_0x59ba('0xe')]);return _0x3e7f0d(_0x5f0b17[_0x59ba('0xd')][_0x59ba('0xe')]);}else{logger[_0x59ba('0xa')](_0x59ba('0xb'),_0x21cd0b,_0x59ba('0xc'));_0x3e7f0d(_0x5f0b17[_0x59ba('0xf')][_0x59ba('0xe')]);}})[_0x59ba('0x10')](function(_0x1facef){logger['error'](_0x59ba('0xb'),_0x21cd0b,_0x1facef);_0x1656bc(_0x1facef);});});}exports[_0x59ba('0x11')]=function(_0x41305e){var _0x5d4243=this;return new Promise(function(_0x55059c,_0x4c7495){return db[_0x59ba('0x12')][_0x59ba('0x13')]({'raw':_0x41305e['options']?_0x41305e[_0x59ba('0x14')][_0x59ba('0x15')]===undefined?!![]:![]:!![],'where':_0x41305e[_0x59ba('0x14')]?_0x41305e[_0x59ba('0x14')][_0x59ba('0x16')]||null:null,'attributes':_0x41305e[_0x59ba('0x14')]?_0x41305e[_0x59ba('0x14')][_0x59ba('0x17')]||null:null,'limit':_0x41305e[_0x59ba('0x14')]?_0x41305e['options'][_0x59ba('0x18')]||null:null,'include':_0x41305e[_0x59ba('0x14')]?_0x41305e[_0x59ba('0x14')]['include']?_[_0x59ba('0x19')](_0x41305e[_0x59ba('0x14')][_0x59ba('0x1a')],function(_0x34eca7){return{'model':db[_0x34eca7[_0x59ba('0x1b')]],'as':_0x34eca7['as'],'attributes':_0x34eca7[_0x59ba('0x17')],'include':_0x34eca7[_0x59ba('0x1a')]?_[_0x59ba('0x19')](_0x34eca7[_0x59ba('0x1a')],function(_0x3c503a){return{'model':db[_0x3c503a['model']],'as':_0x3c503a['as'],'attributes':_0x3c503a[_0x59ba('0x17')],'include':_0x3c503a['include']?_['map'](_0x3c503a[_0x59ba('0x1a')],function(_0x2a3a3a){return{'model':db[_0x2a3a3a[_0x59ba('0x1b')]],'as':_0x2a3a3a['as'],'attributes':_0x2a3a3a[_0x59ba('0x17')]};}):[]};}):[]};}):[]:[]})[_0x59ba('0x9')](function(_0xe3d6ba){logger['info'](_0x59ba('0x11'),_0x41305e);logger[_0x59ba('0x1c')](_0x59ba('0x11'),_0x41305e,JSON['stringify'](_0xe3d6ba));_0x55059c(_0xe3d6ba);})[_0x59ba('0x10')](function(_0x49d8a3){logger['error']('GetServicenowAccount',_0x49d8a3[_0x59ba('0xe')],_0x41305e);_0x4c7495(_0x5d4243[_0x59ba('0xd')](0x1f4,_0x49d8a3[_0x59ba('0xe')]));});});};exports[_0x59ba('0x1d')]=function(_0x44101e){var _0x451976=this;return new Promise(function(_0x1b2d5f,_0x2a1334){return db[_0x59ba('0x12')][_0x59ba('0x1e')]({'raw':_0x44101e['options']?_0x44101e[_0x59ba('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x44101e['options']?_0x44101e[_0x59ba('0x14')][_0x59ba('0x16')]||null:null,'attributes':_0x44101e[_0x59ba('0x14')]?_0x44101e[_0x59ba('0x14')][_0x59ba('0x17')]||null:null,'include':_0x44101e[_0x59ba('0x14')]?_0x44101e[_0x59ba('0x14')]['include']?_[_0x59ba('0x19')](_0x44101e[_0x59ba('0x14')][_0x59ba('0x1a')],function(_0x301e2b){return{'model':db[_0x301e2b['model']],'as':_0x301e2b['as'],'attributes':_0x301e2b[_0x59ba('0x17')],'include':_0x301e2b[_0x59ba('0x1a')]?_[_0x59ba('0x19')](_0x301e2b['include'],function(_0x1ebf2f){return{'model':db[_0x1ebf2f[_0x59ba('0x1b')]],'as':_0x1ebf2f['as'],'attributes':_0x1ebf2f['attributes'],'include':_0x1ebf2f[_0x59ba('0x1a')]?_['map'](_0x1ebf2f[_0x59ba('0x1a')],function(_0x90616e){return{'model':db[_0x90616e['model']],'as':_0x90616e['as'],'attributes':_0x90616e[_0x59ba('0x17')]};}):[]};}):[]};}):[]:[]})[_0x59ba('0x9')](function(_0x5ae5d9){logger[_0x59ba('0xa')](_0x59ba('0x1d'),_0x44101e);logger[_0x59ba('0x1c')]('ShowServicenowAccount',_0x44101e,JSON[_0x59ba('0x1f')](_0x5ae5d9));_0x1b2d5f(_0x5ae5d9);})[_0x59ba('0x10')](function(_0x442883){logger['error'](_0x59ba('0x1d'),_0x442883[_0x59ba('0xe')],_0x44101e);_0x2a1334(_0x451976['error'](0x1f4,_0x442883[_0x59ba('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index d82ebe1..ecf8815 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 _0x24f3=['post','create','put','update','destroy','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions'];(function(_0x561771,_0x554760){var _0x54d16e=function(_0x381c1f){while(--_0x381c1f){_0x561771['push'](_0x561771['shift']());}};_0x54d16e(++_0x554760);}(_0x24f3,0xbd));var _0x324f=function(_0x26bd0d,_0x4487ca){_0x26bd0d=_0x26bd0d-0x0;var _0x39e3bb=_0x24f3[_0x26bd0d];return _0x39e3bb;};'use strict';var multer=require(_0x324f('0x0'));var util=require(_0x324f('0x1'));var path=require('path');var timeout=require(_0x324f('0x2'));var express=require(_0x324f('0x3'));var router=express['Router']();var auth=require(_0x324f('0x4'));var interaction=require(_0x324f('0x5'));var config=require(_0x324f('0x6'));var controller=require(_0x324f('0x7'));router[_0x324f('0x8')]('/',auth[_0x324f('0x9')](),controller[_0x324f('0xa')]);router[_0x324f('0x8')](_0x324f('0xb'),auth['isAuthenticated'](),controller[_0x324f('0xc')]);router[_0x324f('0x8')](_0x324f('0xd'),auth['isAuthenticated'](),controller[_0x324f('0xe')]);router[_0x324f('0x8')](_0x324f('0xf'),auth[_0x324f('0x9')](),controller['getSubjects']);router[_0x324f('0x8')](_0x324f('0x10'),auth[_0x324f('0x9')](),controller[_0x324f('0x11')]);router[_0x324f('0x12')]('/',auth['isAuthenticated'](),controller[_0x324f('0x13')]);router[_0x324f('0x14')]('/:id',auth[_0x324f('0x9')](),controller[_0x324f('0x15')]);router['delete'](_0x324f('0xb'),auth['isAuthenticated'](),controller[_0x324f('0x16')]);module['exports']=router; \ No newline at end of file +var _0xcbe4=['./intServicenowConfiguration.controller','isAuthenticated','get','show','/:id/fields','getSubjects','post','/:id','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xcbe4,0x173));var _0x4cbe=function(_0x434520,_0x9bbc47){_0x434520=_0x434520-0x0;var _0x180482=_0xcbe4[_0x434520];return _0x180482;};'use strict';var multer=require(_0x4cbe('0x0'));var util=require(_0x4cbe('0x1'));var path=require(_0x4cbe('0x2'));var timeout=require(_0x4cbe('0x3'));var express=require(_0x4cbe('0x4'));var router=express[_0x4cbe('0x5')]();var auth=require(_0x4cbe('0x6'));var interaction=require(_0x4cbe('0x7'));var config=require(_0x4cbe('0x8'));var controller=require(_0x4cbe('0x9'));router['get']('/',auth[_0x4cbe('0xa')](),controller['index']);router[_0x4cbe('0xb')]('/:id',auth[_0x4cbe('0xa')](),controller[_0x4cbe('0xc')]);router['get'](_0x4cbe('0xd'),auth['isAuthenticated'](),controller['getFields']);router['get']('/:id/subjects',auth[_0x4cbe('0xa')](),controller[_0x4cbe('0xe')]);router['get']('/:id/descriptions',auth[_0x4cbe('0xa')](),controller['getDescriptions']);router[_0x4cbe('0xf')]('/',auth[_0x4cbe('0xa')](),controller['create']);router['put'](_0x4cbe('0x10'),auth[_0x4cbe('0xa')](),controller['update']);router[_0x4cbe('0x11')](_0x4cbe('0x10'),auth[_0x4cbe('0xa')](),controller['destroy']);module[_0x4cbe('0x12')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 9caa038..4a13b35 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 _0x5675=['exports','STRING','sequelize'];(function(_0x21fe04,_0x1162f1){var _0x3a83ef=function(_0x3990c0){while(--_0x3990c0){_0x21fe04['push'](_0x21fe04['shift']());}};_0x3a83ef(++_0x1162f1);}(_0x5675,0x86));var _0x5567=function(_0x409353,_0xe9f04d){_0x409353=_0x409353-0x0;var _0x4f4b59=_0x5675[_0x409353];return _0x4f4b59;};'use strict';var Sequelize=require(_0x5567('0x0'));module[_0x5567('0x1')]={'name':{'type':Sequelize[_0x5567('0x2')]},'description':{'type':Sequelize[_0x5567('0x2')]}}; \ No newline at end of file +var _0xe649=['sequelize','exports'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0xe649,0xaa));var _0x9e64=function(_0x3026a4,_0x3ef14a){_0x3026a4=_0x3026a4-0x0;var _0xca0627=_0xe649[_0x3026a4];return _0xca0627;};'use strict';var Sequelize=require(_0x9e64('0x0'));module[_0x9e64('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index f409631..086fb14 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 _0xec83=['stringify','code','error','message','result','sendStatus','status','end','limit','set','json','apply','save','destroy','name','index','map','ServicenowConfiguration','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','offset','sort','where','filters','pick','filter','merge','VIRTUAL','field','options','count','includeAll','include','rows','catch','show','params','length','find','create','body','update','getFields','findOne','ServicenowField','order','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','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','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0xba0853,_0x29931b){var _0x13f5a9=function(_0x426486){while(--_0x426486){_0xba0853['push'](_0xba0853['shift']());}};_0x13f5a9(++_0x29931b);}(_0xec83,0xfa));var _0x3ec8=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0xec83[_0x525c7b];return _0x27b33e;};'use strict';var pdf=require(_0x3ec8('0x0'));var emlformat=require(_0x3ec8('0x1'));var rimraf=require(_0x3ec8('0x2'));var zipdir=require(_0x3ec8('0x3'));var jsonpatch=require(_0x3ec8('0x4'));var rp=require(_0x3ec8('0x5'));var moment=require(_0x3ec8('0x6'));var BPromise=require(_0x3ec8('0x7'));var Mustache=require(_0x3ec8('0x8'));var util=require(_0x3ec8('0x9'));var path=require(_0x3ec8('0xa'));var sox=require(_0x3ec8('0xb'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x3ec8('0xc'));var squel=require(_0x3ec8('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3ec8('0xe'));var toCsv=require(_0x3ec8('0xf'));var querystring=require(_0x3ec8('0x10'));var Papa=require(_0x3ec8('0x11'));var Redis=require(_0x3ec8('0x12'));var authService=require(_0x3ec8('0x13'));var qs=require(_0x3ec8('0x14'));var as=require(_0x3ec8('0x15'));var hardwareService=require(_0x3ec8('0x16'));var logger=require('../../config/logger')(_0x3ec8('0x17'));var utils=require(_0x3ec8('0x18'));var config=require(_0x3ec8('0x19'));var db=require(_0x3ec8('0x1a'))['db'];var jayson=require(_0x3ec8('0x1b'));var client=jayson[_0x3ec8('0x1c')][_0x3ec8('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x40f190,_0x595f3b,_0x4210b0){if(_0x4210b0){var _0x2d928a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2d928a[_0x3ec8('0x1e')](_0x595f3b)){return _0x40f190;}else{throw new Error(_0x3ec8('0x1f'));}}else{return _0x40f190;}}function respondWithRpcPromise(_0xaec0a3,_0x316591,_0x12ed37,_0x451ac4){return new BPromise(function(_0x3eccaa,_0xf75cc3){var _0x5261c3=_0x451ac4||client;return _0x5261c3['request'](_0xaec0a3,_0x12ed37)[_0x3ec8('0x20')](function(_0x2530b2){logger[_0x3ec8('0x21')](_0x3ec8('0x22'),_0x316591,_0x3ec8('0x23'));logger[_0x3ec8('0x24')](_0x3ec8('0x25'),_0x316591,_0x3ec8('0x23'),JSON[_0x3ec8('0x26')](_0x2530b2));if(_0x2530b2['error']){if(_0x2530b2['error'][_0x3ec8('0x27')]===0x1f4){logger[_0x3ec8('0x28')](_0x3ec8('0x22'),_0x316591,_0x2530b2[_0x3ec8('0x28')]['message']);return _0xf75cc3(_0x2530b2[_0x3ec8('0x28')][_0x3ec8('0x29')]);}logger[_0x3ec8('0x28')](_0x3ec8('0x22'),_0x316591,_0x2530b2[_0x3ec8('0x28')][_0x3ec8('0x29')]);return _0x3eccaa(_0x2530b2[_0x3ec8('0x28')]['message']);}else{logger[_0x3ec8('0x21')](_0x3ec8('0x22'),_0x316591,_0x3ec8('0x23'));_0x3eccaa(_0x2530b2[_0x3ec8('0x2a')]['message']);}})['catch'](function(_0x2cf514){logger[_0x3ec8('0x28')](_0x3ec8('0x22'),_0x316591,_0x2cf514);_0xf75cc3(_0x2cf514);});});}function respondWithStatusCode(_0xfa980a,_0x4c88e1){_0x4c88e1=_0x4c88e1||0xcc;return function(_0x316fd7){if(_0x316fd7){return _0xfa980a[_0x3ec8('0x2b')](_0x4c88e1);}return _0xfa980a[_0x3ec8('0x2c')](_0x4c88e1)[_0x3ec8('0x2d')]();};}function respondWithResult(_0x36162d,_0x2516a1){_0x2516a1=_0x2516a1||0xc8;return function(_0x40c4fa){if(_0x40c4fa){return _0x36162d['status'](_0x2516a1)['json'](_0x40c4fa);}};}function respondWithFilteredResult(_0x5a7b31,_0x1d20a3){return function(_0x19eacc){if(_0x19eacc){var _0x324a98=_0x19eacc['count'],_0x57e409=_0x1d20a3['offset'],_0x1ea869=_0x1d20a3['offset']+_0x1d20a3[_0x3ec8('0x2e')],_0x172088;if(_0x1ea869>=_0x324a98){_0x1ea869=_0x324a98;_0x172088=0xc8;}else{_0x172088=0xce;}_0x5a7b31[_0x3ec8('0x2c')](_0x172088);return _0x5a7b31[_0x3ec8('0x2f')]('Content-Range',_0x57e409+'-'+_0x1ea869+'/'+_0x324a98)[_0x3ec8('0x30')](_0x19eacc);}return null;};}function patchUpdates(_0x2c6cb9){return function(_0x640602){try{jsonpatch[_0x3ec8('0x31')](_0x640602,_0x2c6cb9,!![]);}catch(_0xe9e230){return BPromise['reject'](_0xe9e230);}return _0x640602[_0x3ec8('0x32')]();};}function saveUpdates(_0x7c919e,_0xfdb88a){return function(_0x17e543){if(_0x17e543){return _0x17e543['update'](_0x7c919e)[_0x3ec8('0x20')](function(_0x1a7474){return _0x1a7474;});}return null;};}function removeEntity(_0x3bcbf1,_0x13fc4a){return function(_0xfe7d82){if(_0xfe7d82){return _0xfe7d82[_0x3ec8('0x33')]()[_0x3ec8('0x20')](function(){_0x3bcbf1[_0x3ec8('0x2c')](0xcc)[_0x3ec8('0x2d')]();});}};}function handleEntityNotFound(_0x2e2db2,_0x3b63a5){return function(_0x3439e5){if(!_0x3439e5){_0x2e2db2[_0x3ec8('0x2b')](0x194);}return _0x3439e5;};}function handleError(_0xf2299e,_0x2808b7){_0x2808b7=_0x2808b7||0x1f4;return function(_0x3bf1e1){logger[_0x3ec8('0x28')](_0x3bf1e1['stack']);if(_0x3bf1e1[_0x3ec8('0x34')]){delete _0x3bf1e1[_0x3ec8('0x34')];}_0xf2299e['status'](_0x2808b7)['send'](_0x3bf1e1);};}exports[_0x3ec8('0x35')]=function(_0x2b24b3,_0x47d5b8){var _0x48c7f8={},_0x47e4e2={},_0xd75d6b={'count':0x0,'rows':[]};var _0x1aa031=_[_0x3ec8('0x36')](db[_0x3ec8('0x37')][_0x3ec8('0x38')],function(_0x31da58){return{'name':_0x31da58[_0x3ec8('0x39')],'type':_0x31da58[_0x3ec8('0x3a')][_0x3ec8('0x3b')]};});_0x47e4e2[_0x3ec8('0x3c')]=_[_0x3ec8('0x36')](_0x1aa031,_0x3ec8('0x34'));_0x47e4e2['query']=_[_0x3ec8('0x3d')](_0x2b24b3[_0x3ec8('0x3e')]);_0x47e4e2['filters']=_[_0x3ec8('0x3f')](_0x47e4e2[_0x3ec8('0x3c')],_0x47e4e2[_0x3ec8('0x3e')]);_0x48c7f8[_0x3ec8('0x40')]=_[_0x3ec8('0x3f')](_0x47e4e2['model'],qs[_0x3ec8('0x41')](_0x2b24b3['query'][_0x3ec8('0x41')]));_0x48c7f8[_0x3ec8('0x40')]=_0x48c7f8['attributes']['length']?_0x48c7f8[_0x3ec8('0x40')]:_0x47e4e2[_0x3ec8('0x3c')];if(!_0x2b24b3['query'][_0x3ec8('0x42')](_0x3ec8('0x43'))){_0x48c7f8[_0x3ec8('0x2e')]=qs[_0x3ec8('0x2e')](_0x2b24b3['query']['limit']);_0x48c7f8[_0x3ec8('0x44')]=qs['offset'](_0x2b24b3[_0x3ec8('0x3e')]['offset']);}_0x48c7f8['order']=qs[_0x3ec8('0x45')](_0x2b24b3[_0x3ec8('0x3e')][_0x3ec8('0x45')]);_0x48c7f8[_0x3ec8('0x46')]=qs[_0x3ec8('0x47')](_[_0x3ec8('0x48')](_0x2b24b3[_0x3ec8('0x3e')],_0x47e4e2[_0x3ec8('0x47')]));if(_0x2b24b3['query'][_0x3ec8('0x49')]){_0x48c7f8[_0x3ec8('0x46')]=_[_0x3ec8('0x4a')](_0x48c7f8['where'],{'$or':_[_0x3ec8('0x36')](_0x1aa031,function(_0x4b634b){if(_0x4b634b[_0x3ec8('0x3a')][_0x3ec8('0x3b')]!==_0x3ec8('0x4b')){var _0x2a7f85={};_0x2a7f85[_0x4b634b[_0x3ec8('0x4c')]]={'$like':'%'+_0x2b24b3[_0x3ec8('0x3e')][_0x3ec8('0x49')]+'%'};return _0x2a7f85;}})});}_0x48c7f8=_['merge']({},_0x48c7f8,_0x2b24b3[_0x3ec8('0x4d')]);var _0x4001ad={'where':_0x48c7f8[_0x3ec8('0x46')]};return db[_0x3ec8('0x37')][_0x3ec8('0x4e')](_0x4001ad)['then'](function(_0x4fb3b8){_0xd75d6b['count']=_0x4fb3b8;if(_0x2b24b3[_0x3ec8('0x3e')][_0x3ec8('0x4f')]){_0x48c7f8[_0x3ec8('0x50')]=[{'all':!![]}];}return db[_0x3ec8('0x37')]['findAll'](_0x48c7f8);})[_0x3ec8('0x20')](function(_0x135c38){_0xd75d6b[_0x3ec8('0x51')]=_0x135c38;return _0xd75d6b;})['then'](respondWithFilteredResult(_0x47d5b8,_0x48c7f8))[_0x3ec8('0x52')](handleError(_0x47d5b8,null));};exports[_0x3ec8('0x53')]=function(_0x9256b,_0x29be06){var _0x13e965={'raw':![],'where':{'id':_0x9256b[_0x3ec8('0x54')]['id']}},_0x32fddd={};_0x32fddd[_0x3ec8('0x3c')]=_[_0x3ec8('0x3d')](db[_0x3ec8('0x37')]['rawAttributes']);_0x32fddd[_0x3ec8('0x3e')]=_[_0x3ec8('0x3d')](_0x9256b[_0x3ec8('0x3e')]);_0x32fddd[_0x3ec8('0x47')]=_[_0x3ec8('0x3f')](_0x32fddd[_0x3ec8('0x3c')],_0x32fddd['query']);_0x13e965[_0x3ec8('0x40')]=_[_0x3ec8('0x3f')](_0x32fddd[_0x3ec8('0x3c')],qs[_0x3ec8('0x41')](_0x9256b[_0x3ec8('0x3e')][_0x3ec8('0x41')]));_0x13e965['attributes']=_0x13e965[_0x3ec8('0x40')][_0x3ec8('0x55')]?_0x13e965[_0x3ec8('0x40')]:_0x32fddd[_0x3ec8('0x3c')];if(_0x9256b[_0x3ec8('0x3e')][_0x3ec8('0x4f')]){_0x13e965[_0x3ec8('0x50')]=[{'all':!![]}];}_0x13e965=_[_0x3ec8('0x4a')]({},_0x13e965,_0x9256b[_0x3ec8('0x4d')]);return db[_0x3ec8('0x37')][_0x3ec8('0x56')](_0x13e965)[_0x3ec8('0x20')](handleEntityNotFound(_0x29be06,null))[_0x3ec8('0x20')](respondWithResult(_0x29be06,null))[_0x3ec8('0x52')](handleError(_0x29be06,null));};exports[_0x3ec8('0x57')]=function(_0x1601d7,_0xe87c94){return db['ServicenowConfiguration']['create'](_0x1601d7[_0x3ec8('0x58')],{})['then'](respondWithResult(_0xe87c94,0xc9))[_0x3ec8('0x52')](handleError(_0xe87c94,null));};exports[_0x3ec8('0x59')]=function(_0x23a533,_0x54b971){if(_0x23a533['body']['id']){delete _0x23a533['body']['id'];}return db[_0x3ec8('0x37')][_0x3ec8('0x56')]({'where':{'id':_0x23a533[_0x3ec8('0x54')]['id']}})[_0x3ec8('0x20')](handleEntityNotFound(_0x54b971,null))[_0x3ec8('0x20')](saveUpdates(_0x23a533[_0x3ec8('0x58')],null))[_0x3ec8('0x20')](respondWithResult(_0x54b971,null))['catch'](handleError(_0x54b971,null));};exports[_0x3ec8('0x33')]=function(_0x39c2e2,_0x205443){return db[_0x3ec8('0x37')][_0x3ec8('0x56')]({'where':{'id':_0x39c2e2['params']['id']}})['then'](handleEntityNotFound(_0x205443,null))[_0x3ec8('0x20')](removeEntity(_0x205443,null))['catch'](handleError(_0x205443,null));};exports[_0x3ec8('0x5a')]=function(_0x21cf03,_0xe35068,_0x33e895){var _0x5d8410={};var _0x224d9c={};var _0x1d591a;var _0x4cc10d;return db[_0x3ec8('0x37')][_0x3ec8('0x5b')]({'where':{'id':_0x21cf03['params']['id']}})['then'](handleEntityNotFound(_0xe35068,null))[_0x3ec8('0x20')](function(_0x20a971){if(_0x20a971){_0x1d591a=_0x20a971;_0x224d9c['model']=_[_0x3ec8('0x3d')](db[_0x3ec8('0x5c')][_0x3ec8('0x38')]);_0x224d9c[_0x3ec8('0x3e')]=_['keys'](_0x21cf03['query']);_0x224d9c[_0x3ec8('0x47')]=_[_0x3ec8('0x3f')](_0x224d9c[_0x3ec8('0x3c')],_0x224d9c[_0x3ec8('0x3e')]);_0x5d8410[_0x3ec8('0x40')]=_[_0x3ec8('0x3f')](_0x224d9c[_0x3ec8('0x3c')],qs[_0x3ec8('0x41')](_0x21cf03[_0x3ec8('0x3e')][_0x3ec8('0x41')]));_0x5d8410['attributes']=_0x5d8410[_0x3ec8('0x40')]['length']?_0x5d8410[_0x3ec8('0x40')]:_0x224d9c[_0x3ec8('0x3c')];_0x5d8410[_0x3ec8('0x5d')]=qs[_0x3ec8('0x45')](_0x21cf03[_0x3ec8('0x3e')][_0x3ec8('0x45')]);_0x5d8410[_0x3ec8('0x46')]=qs[_0x3ec8('0x47')](_[_0x3ec8('0x48')](_0x21cf03[_0x3ec8('0x3e')],_0x224d9c[_0x3ec8('0x47')]));if(_0x21cf03[_0x3ec8('0x3e')][_0x3ec8('0x49')]){_0x5d8410['where']=_[_0x3ec8('0x4a')](_0x5d8410[_0x3ec8('0x46')],{'$or':_[_0x3ec8('0x36')](_0x5d8410['attributes'],function(_0x52d44d){var _0x5c7ab6={};_0x5c7ab6[_0x52d44d]={'$like':'%'+_0x21cf03[_0x3ec8('0x3e')][_0x3ec8('0x49')]+'%'};return _0x5c7ab6;})});}_0x5d8410=_['merge']({},_0x5d8410,_0x21cf03[_0x3ec8('0x4d')]);return _0x1d591a[_0x3ec8('0x5a')](_0x5d8410);}})['then'](function(_0x4883c9){if(_0x4883c9){_0x4cc10d=_0x4883c9[_0x3ec8('0x55')];if(!_0x21cf03[_0x3ec8('0x3e')]['hasOwnProperty'](_0x3ec8('0x43'))){_0x5d8410['limit']=qs['limit'](_0x21cf03[_0x3ec8('0x3e')][_0x3ec8('0x2e')]);_0x5d8410['offset']=qs[_0x3ec8('0x44')](_0x21cf03[_0x3ec8('0x3e')][_0x3ec8('0x44')]);}return _0x1d591a['getFields'](_0x5d8410);}})[_0x3ec8('0x20')](function(_0x1e4656){if(_0x1e4656){return _0x1e4656?{'count':_0x4cc10d,'rows':_0x1e4656}:null;}})['then'](respondWithResult(_0xe35068,null))[_0x3ec8('0x52')](handleError(_0xe35068,null));};exports[_0x3ec8('0x5e')]=function(_0x28b380,_0x703a88,_0x8c5179){var _0x3cd1dc={};var _0x173dc3={};var _0x307858;var _0x1b8878;return db['ServicenowConfiguration'][_0x3ec8('0x5b')]({'where':{'id':_0x28b380[_0x3ec8('0x54')]['id']}})[_0x3ec8('0x20')](handleEntityNotFound(_0x703a88,null))[_0x3ec8('0x20')](function(_0x5a5050){if(_0x5a5050){_0x307858=_0x5a5050;_0x173dc3[_0x3ec8('0x3c')]=_[_0x3ec8('0x3d')](db[_0x3ec8('0x5c')]['rawAttributes']);_0x173dc3['query']=_[_0x3ec8('0x3d')](_0x28b380[_0x3ec8('0x3e')]);_0x173dc3['filters']=_[_0x3ec8('0x3f')](_0x173dc3['model'],_0x173dc3['query']);_0x3cd1dc['attributes']=_[_0x3ec8('0x3f')](_0x173dc3[_0x3ec8('0x3c')],qs[_0x3ec8('0x41')](_0x28b380[_0x3ec8('0x3e')][_0x3ec8('0x41')]));_0x3cd1dc[_0x3ec8('0x40')]=_0x3cd1dc[_0x3ec8('0x40')]['length']?_0x3cd1dc[_0x3ec8('0x40')]:_0x173dc3[_0x3ec8('0x3c')];_0x3cd1dc['order']=qs[_0x3ec8('0x45')](_0x28b380[_0x3ec8('0x3e')][_0x3ec8('0x45')]);_0x3cd1dc[_0x3ec8('0x46')]=qs[_0x3ec8('0x47')](_['pick'](_0x28b380[_0x3ec8('0x3e')],_0x173dc3['filters']));if(_0x28b380[_0x3ec8('0x3e')]['filter']){_0x3cd1dc[_0x3ec8('0x46')]=_[_0x3ec8('0x4a')](_0x3cd1dc['where'],{'$or':_[_0x3ec8('0x36')](_0x3cd1dc[_0x3ec8('0x40')],function(_0x28efde){var _0x5d7abb={};_0x5d7abb[_0x28efde]={'$like':'%'+_0x28b380['query'][_0x3ec8('0x49')]+'%'};return _0x5d7abb;})});}_0x3cd1dc=_[_0x3ec8('0x4a')]({},_0x3cd1dc,_0x28b380[_0x3ec8('0x4d')]);return _0x307858[_0x3ec8('0x5e')](_0x3cd1dc);}})['then'](function(_0x50e51a){if(_0x50e51a){_0x1b8878=_0x50e51a[_0x3ec8('0x55')];if(!_0x28b380[_0x3ec8('0x3e')][_0x3ec8('0x42')](_0x3ec8('0x43'))){_0x3cd1dc['limit']=qs['limit'](_0x28b380['query'][_0x3ec8('0x2e')]);_0x3cd1dc['offset']=qs['offset'](_0x28b380[_0x3ec8('0x3e')]['offset']);}return _0x307858[_0x3ec8('0x5e')](_0x3cd1dc);}})[_0x3ec8('0x20')](function(_0x4e66cc){if(_0x4e66cc){return _0x4e66cc?{'count':_0x1b8878,'rows':_0x4e66cc}:null;}})[_0x3ec8('0x20')](respondWithResult(_0x703a88,null))['catch'](handleError(_0x703a88,null));};exports[_0x3ec8('0x5f')]=function(_0x516f83,_0x173c46,_0x1eb470){var _0x3ac9e0={};var _0x444520={};var _0xbb1809;var _0x37659d;return db['ServicenowConfiguration'][_0x3ec8('0x5b')]({'where':{'id':_0x516f83['params']['id']}})[_0x3ec8('0x20')](handleEntityNotFound(_0x173c46,null))[_0x3ec8('0x20')](function(_0x41487b){if(_0x41487b){_0xbb1809=_0x41487b;_0x444520[_0x3ec8('0x3c')]=_[_0x3ec8('0x3d')](db[_0x3ec8('0x5c')][_0x3ec8('0x38')]);_0x444520[_0x3ec8('0x3e')]=_[_0x3ec8('0x3d')](_0x516f83[_0x3ec8('0x3e')]);_0x444520['filters']=_['intersection'](_0x444520['model'],_0x444520['query']);_0x3ac9e0['attributes']=_['intersection'](_0x444520['model'],qs[_0x3ec8('0x41')](_0x516f83[_0x3ec8('0x3e')][_0x3ec8('0x41')]));_0x3ac9e0[_0x3ec8('0x40')]=_0x3ac9e0[_0x3ec8('0x40')][_0x3ec8('0x55')]?_0x3ac9e0[_0x3ec8('0x40')]:_0x444520[_0x3ec8('0x3c')];_0x3ac9e0[_0x3ec8('0x5d')]=qs['sort'](_0x516f83[_0x3ec8('0x3e')][_0x3ec8('0x45')]);_0x3ac9e0[_0x3ec8('0x46')]=qs[_0x3ec8('0x47')](_[_0x3ec8('0x48')](_0x516f83['query'],_0x444520['filters']));if(_0x516f83[_0x3ec8('0x3e')][_0x3ec8('0x49')]){_0x3ac9e0[_0x3ec8('0x46')]=_[_0x3ec8('0x4a')](_0x3ac9e0[_0x3ec8('0x46')],{'$or':_[_0x3ec8('0x36')](_0x3ac9e0[_0x3ec8('0x40')],function(_0x19ad79){var _0x21d3c6={};_0x21d3c6[_0x19ad79]={'$like':'%'+_0x516f83['query'][_0x3ec8('0x49')]+'%'};return _0x21d3c6;})});}_0x3ac9e0=_[_0x3ec8('0x4a')]({},_0x3ac9e0,_0x516f83[_0x3ec8('0x4d')]);return _0xbb1809[_0x3ec8('0x5f')](_0x3ac9e0);}})[_0x3ec8('0x20')](function(_0x1384d1){if(_0x1384d1){_0x37659d=_0x1384d1[_0x3ec8('0x55')];if(!_0x516f83[_0x3ec8('0x3e')]['hasOwnProperty'](_0x3ec8('0x43'))){_0x3ac9e0[_0x3ec8('0x2e')]=qs[_0x3ec8('0x2e')](_0x516f83[_0x3ec8('0x3e')][_0x3ec8('0x2e')]);_0x3ac9e0[_0x3ec8('0x44')]=qs[_0x3ec8('0x44')](_0x516f83[_0x3ec8('0x3e')]['offset']);}return _0xbb1809['getDescriptions'](_0x3ac9e0);}})[_0x3ec8('0x20')](function(_0x5d2246){if(_0x5d2246){return _0x5d2246?{'count':_0x37659d,'rows':_0x5d2246}:null;}})[_0x3ec8('0x20')](respondWithResult(_0x173c46,null))[_0x3ec8('0x52')](handleError(_0x173c46,null));}; \ No newline at end of file +var _0xc574=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../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','ServicenowConfiguration,\x20%s,\x20%s','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','json','count','offset','set','apply','save','update','destroy','end','stack','name','send','index','map','ServicenowConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','field','options','findAll','rows','params','include','find','create','body','getFields','ServicenowField','findOne','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service'];(function(_0x391c55,_0x168617){var _0xa434e0=function(_0x51fa5c){while(--_0x51fa5c){_0x391c55['push'](_0x391c55['shift']());}};_0xa434e0(++_0x168617);}(_0xc574,0x107));var _0x4c57=function(_0x524f2a,_0x2591d8){_0x524f2a=_0x524f2a-0x0;var _0x3239d2=_0xc574[_0x524f2a];return _0x3239d2;};'use strict';var pdf=require(_0x4c57('0x0'));var emlformat=require(_0x4c57('0x1'));var rimraf=require(_0x4c57('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4c57('0x3'));var rp=require(_0x4c57('0x4'));var moment=require(_0x4c57('0x5'));var BPromise=require(_0x4c57('0x6'));var Mustache=require(_0x4c57('0x7'));var util=require('util');var path=require(_0x4c57('0x8'));var sox=require(_0x4c57('0x9'));var csv=require(_0x4c57('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x4c57('0xb'));var squel=require(_0x4c57('0xc'));var crypto=require(_0x4c57('0xd'));var jsforce=require(_0x4c57('0xe'));var deskjs=require(_0x4c57('0xf'));var toCsv=require(_0x4c57('0xa'));var querystring=require(_0x4c57('0x10'));var Papa=require(_0x4c57('0x11'));var Redis=require('ioredis');var authService=require(_0x4c57('0x12'));var qs=require(_0x4c57('0x13'));var as=require(_0x4c57('0x14'));var hardwareService=require(_0x4c57('0x15'));var logger=require(_0x4c57('0x16'))('api');var utils=require(_0x4c57('0x17'));var config=require(_0x4c57('0x18'));var db=require(_0x4c57('0x19'))['db'];var jayson=require(_0x4c57('0x1a'));var client=jayson[_0x4c57('0x1b')][_0x4c57('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x1224e3,_0x4b0fca,_0x540fbd){if(_0x540fbd){var _0x4bfe2b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4bfe2b['test'](_0x4b0fca)){return _0x1224e3;}else{throw new Error(_0x4c57('0x1d'));}}else{return _0x1224e3;}}function respondWithRpcPromise(_0x2422c4,_0x275992,_0x436fa0,_0x1c64a7){return new BPromise(function(_0x3bdf37,_0xe93b58){var _0x243901=_0x1c64a7||client;return _0x243901[_0x4c57('0x1e')](_0x2422c4,_0x436fa0)[_0x4c57('0x1f')](function(_0xe0449a){logger[_0x4c57('0x20')](_0x4c57('0x21'),_0x275992,'request\x20sent');logger[_0x4c57('0x22')](_0x4c57('0x23'),_0x275992,_0x4c57('0x24'),JSON['stringify'](_0xe0449a));if(_0xe0449a[_0x4c57('0x25')]){if(_0xe0449a[_0x4c57('0x25')][_0x4c57('0x26')]===0x1f4){logger[_0x4c57('0x25')](_0x4c57('0x21'),_0x275992,_0xe0449a['error']['message']);return _0xe93b58(_0xe0449a[_0x4c57('0x25')][_0x4c57('0x27')]);}logger[_0x4c57('0x25')]('ServicenowConfiguration,\x20%s,\x20%s',_0x275992,_0xe0449a[_0x4c57('0x25')][_0x4c57('0x27')]);return _0x3bdf37(_0xe0449a[_0x4c57('0x25')][_0x4c57('0x27')]);}else{logger[_0x4c57('0x20')]('ServicenowConfiguration,\x20%s,\x20%s',_0x275992,_0x4c57('0x24'));_0x3bdf37(_0xe0449a[_0x4c57('0x28')][_0x4c57('0x27')]);}})[_0x4c57('0x29')](function(_0x2f9723){logger[_0x4c57('0x25')](_0x4c57('0x21'),_0x275992,_0x2f9723);_0xe93b58(_0x2f9723);});});}function respondWithStatusCode(_0x505e29,_0x4d58aa){_0x4d58aa=_0x4d58aa||0xcc;return function(_0x2c5306){if(_0x2c5306){return _0x505e29[_0x4c57('0x2a')](_0x4d58aa);}return _0x505e29['status'](_0x4d58aa)['end']();};}function respondWithResult(_0x51061d,_0x565dfa){_0x565dfa=_0x565dfa||0xc8;return function(_0x5dacf2){if(_0x5dacf2){return _0x51061d[_0x4c57('0x2b')](_0x565dfa)[_0x4c57('0x2c')](_0x5dacf2);}};}function respondWithFilteredResult(_0x4cb8c0,_0x22f49f){return function(_0x3fad3a){if(_0x3fad3a){var _0x281260=_0x3fad3a[_0x4c57('0x2d')],_0x160ad3=_0x22f49f[_0x4c57('0x2e')],_0x2d8487=_0x22f49f[_0x4c57('0x2e')]+_0x22f49f['limit'],_0x7b07d7;if(_0x2d8487>=_0x281260){_0x2d8487=_0x281260;_0x7b07d7=0xc8;}else{_0x7b07d7=0xce;}_0x4cb8c0[_0x4c57('0x2b')](_0x7b07d7);return _0x4cb8c0[_0x4c57('0x2f')]('Content-Range',_0x160ad3+'-'+_0x2d8487+'/'+_0x281260)[_0x4c57('0x2c')](_0x3fad3a);}return null;};}function patchUpdates(_0x3a1f59){return function(_0x48472c){try{jsonpatch[_0x4c57('0x30')](_0x48472c,_0x3a1f59,!![]);}catch(_0x26d294){return BPromise['reject'](_0x26d294);}return _0x48472c[_0x4c57('0x31')]();};}function saveUpdates(_0x17393a,_0x2d63e6){return function(_0x1dbb98){if(_0x1dbb98){return _0x1dbb98[_0x4c57('0x32')](_0x17393a)[_0x4c57('0x1f')](function(_0x3dff3a){return _0x3dff3a;});}return null;};}function removeEntity(_0x3b9973,_0x6d1e3f){return function(_0x18f5b8){if(_0x18f5b8){return _0x18f5b8[_0x4c57('0x33')]()['then'](function(){_0x3b9973['status'](0xcc)[_0x4c57('0x34')]();});}};}function handleEntityNotFound(_0x5b7c3e,_0x3d6be6){return function(_0x463fc3){if(!_0x463fc3){_0x5b7c3e[_0x4c57('0x2a')](0x194);}return _0x463fc3;};}function handleError(_0x3de8a4,_0x180dc6){_0x180dc6=_0x180dc6||0x1f4;return function(_0x473c4b){logger['error'](_0x473c4b[_0x4c57('0x35')]);if(_0x473c4b[_0x4c57('0x36')]){delete _0x473c4b[_0x4c57('0x36')];}_0x3de8a4['status'](_0x180dc6)[_0x4c57('0x37')](_0x473c4b);};}exports[_0x4c57('0x38')]=function(_0x77bd5d,_0x4ba248){var _0x1cd708={},_0x43fcfe={},_0x800c0b={'count':0x0,'rows':[]};var _0x4cabc2=_[_0x4c57('0x39')](db[_0x4c57('0x3a')][_0x4c57('0x3b')],function(_0x7314ab){return{'name':_0x7314ab[_0x4c57('0x3c')],'type':_0x7314ab[_0x4c57('0x3d')][_0x4c57('0x3e')]};});_0x43fcfe[_0x4c57('0x3f')]=_['map'](_0x4cabc2,_0x4c57('0x36'));_0x43fcfe[_0x4c57('0x40')]=_[_0x4c57('0x41')](_0x77bd5d[_0x4c57('0x40')]);_0x43fcfe[_0x4c57('0x42')]=_[_0x4c57('0x43')](_0x43fcfe['model'],_0x43fcfe[_0x4c57('0x40')]);_0x1cd708['attributes']=_[_0x4c57('0x43')](_0x43fcfe['model'],qs[_0x4c57('0x44')](_0x77bd5d[_0x4c57('0x40')]['fields']));_0x1cd708['attributes']=_0x1cd708[_0x4c57('0x45')][_0x4c57('0x46')]?_0x1cd708[_0x4c57('0x45')]:_0x43fcfe['model'];if(!_0x77bd5d[_0x4c57('0x40')][_0x4c57('0x47')](_0x4c57('0x48'))){_0x1cd708['limit']=qs['limit'](_0x77bd5d[_0x4c57('0x40')][_0x4c57('0x49')]);_0x1cd708[_0x4c57('0x2e')]=qs[_0x4c57('0x2e')](_0x77bd5d[_0x4c57('0x40')][_0x4c57('0x2e')]);}_0x1cd708[_0x4c57('0x4a')]=qs['sort'](_0x77bd5d[_0x4c57('0x40')][_0x4c57('0x4b')]);_0x1cd708[_0x4c57('0x4c')]=qs[_0x4c57('0x42')](_[_0x4c57('0x4d')](_0x77bd5d[_0x4c57('0x40')],_0x43fcfe[_0x4c57('0x42')]));if(_0x77bd5d[_0x4c57('0x40')][_0x4c57('0x4e')]){_0x1cd708['where']=_[_0x4c57('0x4f')](_0x1cd708[_0x4c57('0x4c')],{'$or':_[_0x4c57('0x39')](_0x4cabc2,function(_0x32c1e5){if(_0x32c1e5['type']['key']!=='VIRTUAL'){var _0x5d7e39={};_0x5d7e39[_0x32c1e5[_0x4c57('0x50')]]={'$like':'%'+_0x77bd5d[_0x4c57('0x40')]['filter']+'%'};return _0x5d7e39;}})});}_0x1cd708=_[_0x4c57('0x4f')]({},_0x1cd708,_0x77bd5d[_0x4c57('0x51')]);var _0x27c96c={'where':_0x1cd708[_0x4c57('0x4c')]};return db[_0x4c57('0x3a')][_0x4c57('0x2d')](_0x27c96c)[_0x4c57('0x1f')](function(_0x19b6e2){_0x800c0b[_0x4c57('0x2d')]=_0x19b6e2;if(_0x77bd5d[_0x4c57('0x40')]['includeAll']){_0x1cd708['include']=[{'all':!![]}];}return db[_0x4c57('0x3a')][_0x4c57('0x52')](_0x1cd708);})['then'](function(_0x1737f6){_0x800c0b[_0x4c57('0x53')]=_0x1737f6;return _0x800c0b;})[_0x4c57('0x1f')](respondWithFilteredResult(_0x4ba248,_0x1cd708))[_0x4c57('0x29')](handleError(_0x4ba248,null));};exports['show']=function(_0x549578,_0x37ff58){var _0x5bcb4c={'raw':![],'where':{'id':_0x549578[_0x4c57('0x54')]['id']}},_0x501180={};_0x501180['model']=_[_0x4c57('0x41')](db['ServicenowConfiguration'][_0x4c57('0x3b')]);_0x501180[_0x4c57('0x40')]=_['keys'](_0x549578[_0x4c57('0x40')]);_0x501180[_0x4c57('0x42')]=_['intersection'](_0x501180[_0x4c57('0x3f')],_0x501180[_0x4c57('0x40')]);_0x5bcb4c[_0x4c57('0x45')]=_[_0x4c57('0x43')](_0x501180[_0x4c57('0x3f')],qs['fields'](_0x549578[_0x4c57('0x40')][_0x4c57('0x44')]));_0x5bcb4c[_0x4c57('0x45')]=_0x5bcb4c[_0x4c57('0x45')][_0x4c57('0x46')]?_0x5bcb4c[_0x4c57('0x45')]:_0x501180[_0x4c57('0x3f')];if(_0x549578['query']['includeAll']){_0x5bcb4c[_0x4c57('0x55')]=[{'all':!![]}];}_0x5bcb4c=_['merge']({},_0x5bcb4c,_0x549578[_0x4c57('0x51')]);return db[_0x4c57('0x3a')][_0x4c57('0x56')](_0x5bcb4c)[_0x4c57('0x1f')](handleEntityNotFound(_0x37ff58,null))[_0x4c57('0x1f')](respondWithResult(_0x37ff58,null))[_0x4c57('0x29')](handleError(_0x37ff58,null));};exports['create']=function(_0x181486,_0x4f31b9){return db['ServicenowConfiguration'][_0x4c57('0x57')](_0x181486[_0x4c57('0x58')],{})[_0x4c57('0x1f')](respondWithResult(_0x4f31b9,0xc9))[_0x4c57('0x29')](handleError(_0x4f31b9,null));};exports[_0x4c57('0x32')]=function(_0x57c8c5,_0x1757d7){if(_0x57c8c5[_0x4c57('0x58')]['id']){delete _0x57c8c5['body']['id'];}return db[_0x4c57('0x3a')][_0x4c57('0x56')]({'where':{'id':_0x57c8c5['params']['id']}})[_0x4c57('0x1f')](handleEntityNotFound(_0x1757d7,null))[_0x4c57('0x1f')](saveUpdates(_0x57c8c5['body'],null))[_0x4c57('0x1f')](respondWithResult(_0x1757d7,null))[_0x4c57('0x29')](handleError(_0x1757d7,null));};exports['destroy']=function(_0x155874,_0x497501){return db[_0x4c57('0x3a')]['find']({'where':{'id':_0x155874[_0x4c57('0x54')]['id']}})[_0x4c57('0x1f')](handleEntityNotFound(_0x497501,null))[_0x4c57('0x1f')](removeEntity(_0x497501,null))['catch'](handleError(_0x497501,null));};exports[_0x4c57('0x59')]=function(_0x3d10fa,_0x1422a0,_0x3beea0){var _0xa466b={};var _0x2fb7e3={};var _0x216dc6;var _0x5b7207;return db[_0x4c57('0x3a')]['findOne']({'where':{'id':_0x3d10fa[_0x4c57('0x54')]['id']}})[_0x4c57('0x1f')](handleEntityNotFound(_0x1422a0,null))[_0x4c57('0x1f')](function(_0x390bf4){if(_0x390bf4){_0x216dc6=_0x390bf4;_0x2fb7e3[_0x4c57('0x3f')]=_[_0x4c57('0x41')](db[_0x4c57('0x5a')][_0x4c57('0x3b')]);_0x2fb7e3['query']=_[_0x4c57('0x41')](_0x3d10fa[_0x4c57('0x40')]);_0x2fb7e3[_0x4c57('0x42')]=_[_0x4c57('0x43')](_0x2fb7e3['model'],_0x2fb7e3['query']);_0xa466b[_0x4c57('0x45')]=_[_0x4c57('0x43')](_0x2fb7e3[_0x4c57('0x3f')],qs[_0x4c57('0x44')](_0x3d10fa['query']['fields']));_0xa466b[_0x4c57('0x45')]=_0xa466b[_0x4c57('0x45')][_0x4c57('0x46')]?_0xa466b['attributes']:_0x2fb7e3['model'];_0xa466b['order']=qs[_0x4c57('0x4b')](_0x3d10fa[_0x4c57('0x40')][_0x4c57('0x4b')]);_0xa466b[_0x4c57('0x4c')]=qs[_0x4c57('0x42')](_[_0x4c57('0x4d')](_0x3d10fa[_0x4c57('0x40')],_0x2fb7e3[_0x4c57('0x42')]));if(_0x3d10fa[_0x4c57('0x40')]['filter']){_0xa466b['where']=_[_0x4c57('0x4f')](_0xa466b['where'],{'$or':_['map'](_0xa466b[_0x4c57('0x45')],function(_0x4db26b){var _0x3b6b04={};_0x3b6b04[_0x4db26b]={'$like':'%'+_0x3d10fa['query'][_0x4c57('0x4e')]+'%'};return _0x3b6b04;})});}_0xa466b=_['merge']({},_0xa466b,_0x3d10fa[_0x4c57('0x51')]);return _0x216dc6['getFields'](_0xa466b);}})[_0x4c57('0x1f')](function(_0x37d816){if(_0x37d816){_0x5b7207=_0x37d816[_0x4c57('0x46')];if(!_0x3d10fa[_0x4c57('0x40')][_0x4c57('0x47')](_0x4c57('0x48'))){_0xa466b['limit']=qs['limit'](_0x3d10fa[_0x4c57('0x40')][_0x4c57('0x49')]);_0xa466b[_0x4c57('0x2e')]=qs[_0x4c57('0x2e')](_0x3d10fa[_0x4c57('0x40')]['offset']);}return _0x216dc6['getFields'](_0xa466b);}})[_0x4c57('0x1f')](function(_0x32c1a1){if(_0x32c1a1){return _0x32c1a1?{'count':_0x5b7207,'rows':_0x32c1a1}:null;}})[_0x4c57('0x1f')](respondWithResult(_0x1422a0,null))[_0x4c57('0x29')](handleError(_0x1422a0,null));};exports['getSubjects']=function(_0x1df81d,_0x16ad9a,_0x5103de){var _0x18cff4={};var _0x4425e8={};var _0x2c1c99;var _0x35cda0;return db['ServicenowConfiguration'][_0x4c57('0x5b')]({'where':{'id':_0x1df81d[_0x4c57('0x54')]['id']}})['then'](handleEntityNotFound(_0x16ad9a,null))[_0x4c57('0x1f')](function(_0x5249be){if(_0x5249be){_0x2c1c99=_0x5249be;_0x4425e8[_0x4c57('0x3f')]=_[_0x4c57('0x41')](db[_0x4c57('0x5a')]['rawAttributes']);_0x4425e8[_0x4c57('0x40')]=_['keys'](_0x1df81d['query']);_0x4425e8[_0x4c57('0x42')]=_[_0x4c57('0x43')](_0x4425e8[_0x4c57('0x3f')],_0x4425e8[_0x4c57('0x40')]);_0x18cff4[_0x4c57('0x45')]=_[_0x4c57('0x43')](_0x4425e8[_0x4c57('0x3f')],qs['fields'](_0x1df81d['query'][_0x4c57('0x44')]));_0x18cff4['attributes']=_0x18cff4[_0x4c57('0x45')][_0x4c57('0x46')]?_0x18cff4[_0x4c57('0x45')]:_0x4425e8[_0x4c57('0x3f')];_0x18cff4[_0x4c57('0x4a')]=qs[_0x4c57('0x4b')](_0x1df81d['query'][_0x4c57('0x4b')]);_0x18cff4['where']=qs[_0x4c57('0x42')](_['pick'](_0x1df81d[_0x4c57('0x40')],_0x4425e8['filters']));if(_0x1df81d['query']['filter']){_0x18cff4[_0x4c57('0x4c')]=_['merge'](_0x18cff4[_0x4c57('0x4c')],{'$or':_[_0x4c57('0x39')](_0x18cff4[_0x4c57('0x45')],function(_0x421f93){var _0x22b444={};_0x22b444[_0x421f93]={'$like':'%'+_0x1df81d[_0x4c57('0x40')][_0x4c57('0x4e')]+'%'};return _0x22b444;})});}_0x18cff4=_[_0x4c57('0x4f')]({},_0x18cff4,_0x1df81d[_0x4c57('0x51')]);return _0x2c1c99[_0x4c57('0x5c')](_0x18cff4);}})['then'](function(_0x1b61ef){if(_0x1b61ef){_0x35cda0=_0x1b61ef[_0x4c57('0x46')];if(!_0x1df81d['query']['hasOwnProperty'](_0x4c57('0x48'))){_0x18cff4[_0x4c57('0x49')]=qs['limit'](_0x1df81d[_0x4c57('0x40')]['limit']);_0x18cff4['offset']=qs[_0x4c57('0x2e')](_0x1df81d['query']['offset']);}return _0x2c1c99[_0x4c57('0x5c')](_0x18cff4);}})[_0x4c57('0x1f')](function(_0x3fa1c4){if(_0x3fa1c4){return _0x3fa1c4?{'count':_0x35cda0,'rows':_0x3fa1c4}:null;}})[_0x4c57('0x1f')](respondWithResult(_0x16ad9a,null))[_0x4c57('0x29')](handleError(_0x16ad9a,null));};exports[_0x4c57('0x5d')]=function(_0x4e4841,_0xb64761,_0x1442e9){var _0x3c08ef={};var _0x286ebf={};var _0x24c12e;var _0x5b3251;return db[_0x4c57('0x3a')]['findOne']({'where':{'id':_0x4e4841['params']['id']}})[_0x4c57('0x1f')](handleEntityNotFound(_0xb64761,null))[_0x4c57('0x1f')](function(_0x2ead66){if(_0x2ead66){_0x24c12e=_0x2ead66;_0x286ebf[_0x4c57('0x3f')]=_['keys'](db[_0x4c57('0x5a')][_0x4c57('0x3b')]);_0x286ebf[_0x4c57('0x40')]=_['keys'](_0x4e4841[_0x4c57('0x40')]);_0x286ebf[_0x4c57('0x42')]=_[_0x4c57('0x43')](_0x286ebf['model'],_0x286ebf['query']);_0x3c08ef[_0x4c57('0x45')]=_[_0x4c57('0x43')](_0x286ebf[_0x4c57('0x3f')],qs[_0x4c57('0x44')](_0x4e4841['query'][_0x4c57('0x44')]));_0x3c08ef[_0x4c57('0x45')]=_0x3c08ef['attributes'][_0x4c57('0x46')]?_0x3c08ef['attributes']:_0x286ebf[_0x4c57('0x3f')];_0x3c08ef[_0x4c57('0x4a')]=qs['sort'](_0x4e4841[_0x4c57('0x40')][_0x4c57('0x4b')]);_0x3c08ef[_0x4c57('0x4c')]=qs[_0x4c57('0x42')](_[_0x4c57('0x4d')](_0x4e4841['query'],_0x286ebf['filters']));if(_0x4e4841['query'][_0x4c57('0x4e')]){_0x3c08ef[_0x4c57('0x4c')]=_[_0x4c57('0x4f')](_0x3c08ef[_0x4c57('0x4c')],{'$or':_['map'](_0x3c08ef[_0x4c57('0x45')],function(_0x30a958){var _0x177b54={};_0x177b54[_0x30a958]={'$like':'%'+_0x4e4841[_0x4c57('0x40')][_0x4c57('0x4e')]+'%'};return _0x177b54;})});}_0x3c08ef=_[_0x4c57('0x4f')]({},_0x3c08ef,_0x4e4841[_0x4c57('0x51')]);return _0x24c12e[_0x4c57('0x5d')](_0x3c08ef);}})[_0x4c57('0x1f')](function(_0x39dc64){if(_0x39dc64){_0x5b3251=_0x39dc64[_0x4c57('0x46')];if(!_0x4e4841[_0x4c57('0x40')][_0x4c57('0x47')](_0x4c57('0x48'))){_0x3c08ef[_0x4c57('0x49')]=qs[_0x4c57('0x49')](_0x4e4841['query']['limit']);_0x3c08ef['offset']=qs[_0x4c57('0x2e')](_0x4e4841[_0x4c57('0x40')]['offset']);}return _0x24c12e[_0x4c57('0x5d')](_0x3c08ef);}})[_0x4c57('0x1f')](function(_0x5f293c){if(_0x5f293c){return _0x5f293c?{'count':_0x5b3251,'rows':_0x5f293c}:null;}})[_0x4c57('0x1f')](respondWithResult(_0xb64761,null))[_0x4c57('0x29')](handleError(_0xb64761,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index c0f8ccf..0bb7f6d 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 _0xed8b=['exports','define','int_servicenow_configurations','util','api','bluebird','request-promise','path','rimraf'];(function(_0x236596,_0x56136d){var _0x55d0fc=function(_0x45484e){while(--_0x45484e){_0x236596['push'](_0x236596['shift']());}};_0x55d0fc(++_0x56136d);}(_0xed8b,0x135));var _0xbed8=function(_0x584806,_0x4eaf1d){_0x584806=_0x584806-0x0;var _0x2c1351=_0xed8b[_0x584806];return _0x2c1351;};'use strict';var _=require('lodash');var util=require(_0xbed8('0x0'));var logger=require('../../config/logger')(_0xbed8('0x1'));var moment=require('moment');var BPromise=require(_0xbed8('0x2'));var rp=require(_0xbed8('0x3'));var fs=require('fs');var path=require(_0xbed8('0x4'));var rimraf=require(_0xbed8('0x5'));var config=require('../../config/environment');var attributes=require('./intServicenowConfiguration.attributes');module[_0xbed8('0x6')]=function(_0x4b4a38,_0x596320){return _0x4b4a38[_0xbed8('0x7')]('ServicenowConfiguration',attributes,{'tableName':_0xbed8('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe6fa=['lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','define','int_servicenow_configurations'];(function(_0x438912,_0x3f7f74){var _0x18112f=function(_0x1b8ac9){while(--_0x1b8ac9){_0x438912['push'](_0x438912['shift']());}};_0x18112f(++_0x3f7f74);}(_0xe6fa,0x154));var _0xae6f=function(_0x574a4c,_0x943417){_0x574a4c=_0x574a4c-0x0;var _0x668f77=_0xe6fa[_0x574a4c];return _0x668f77;};'use strict';var _=require(_0xae6f('0x0'));var util=require(_0xae6f('0x1'));var logger=require('../../config/logger')(_0xae6f('0x2'));var moment=require(_0xae6f('0x3'));var BPromise=require(_0xae6f('0x4'));var rp=require(_0xae6f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xae6f('0x6'));var config=require(_0xae6f('0x7'));var attributes=require('./intServicenowConfiguration.attributes');module['exports']=function(_0x3c9b76,_0x410f34){return _0x3c9b76[_0xae6f('0x8')]('ServicenowConfiguration',attributes,{'tableName':_0xae6f('0x9'),'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 61d6240..124f9e5 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 _0x4b9d=['bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','info','request\x20sent','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ServicenowConfiguration,\x20%s,\x20%s','message','catch','lodash','util','moment'];(function(_0x84ea36,_0x3befc4){var _0x5a518f=function(_0x16b218){while(--_0x16b218){_0x84ea36['push'](_0x84ea36['shift']());}};_0x5a518f(++_0x3befc4);}(_0x4b9d,0x165));var _0xd4b9=function(_0x18b5e8,_0x51e875){_0x18b5e8=_0x18b5e8-0x0;var _0x25baed=_0x4b9d[_0x18b5e8];return _0x25baed;};'use strict';var _=require(_0xd4b9('0x0'));var util=require(_0xd4b9('0x1'));var moment=require(_0xd4b9('0x2'));var BPromise=require(_0xd4b9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd4b9('0x4'));var db=require(_0xd4b9('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd4b9('0x6'))(_0xd4b9('0x7'));var config=require('../../config/environment');var jayson=require(_0xd4b9('0x8'));var client=jayson[_0xd4b9('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c73ca,_0x4917e4,_0x1baedc){return new BPromise(function(_0x38c8bb,_0x164917){return client[_0xd4b9('0xa')](_0x3c73ca,_0x1baedc)['then'](function(_0x4ad7c9){logger[_0xd4b9('0xb')]('ServicenowConfiguration,\x20%s,\x20%s',_0x4917e4,_0xd4b9('0xc'));logger['debug'](_0xd4b9('0xd'),_0x4917e4,_0xd4b9('0xc'),JSON[_0xd4b9('0xe')](_0x4ad7c9));if(_0x4ad7c9[_0xd4b9('0xf')]){if(_0x4ad7c9[_0xd4b9('0xf')][_0xd4b9('0x10')]===0x1f4){logger[_0xd4b9('0xf')](_0xd4b9('0x11'),_0x4917e4,_0x4ad7c9[_0xd4b9('0xf')][_0xd4b9('0x12')]);return _0x164917(_0x4ad7c9[_0xd4b9('0xf')][_0xd4b9('0x12')]);}logger[_0xd4b9('0xf')](_0xd4b9('0x11'),_0x4917e4,_0x4ad7c9[_0xd4b9('0xf')][_0xd4b9('0x12')]);return _0x38c8bb(_0x4ad7c9['error'][_0xd4b9('0x12')]);}else{logger['info'](_0xd4b9('0x11'),_0x4917e4,'request\x20sent');_0x38c8bb(_0x4ad7c9['result']['message']);}})[_0xd4b9('0x13')](function(_0x14322c){logger[_0xd4b9('0xf')](_0xd4b9('0x11'),_0x4917e4,_0x14322c);_0x164917(_0x14322c);});});} \ No newline at end of file +var _0x9cdd=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird'];(function(_0x55322d,_0x2d4ab1){var _0x1aeaba=function(_0x2c2814){while(--_0x2c2814){_0x55322d['push'](_0x55322d['shift']());}};_0x1aeaba(++_0x2d4ab1);}(_0x9cdd,0x15d));var _0xd9cd=function(_0x529b35,_0x35387b){_0x529b35=_0x529b35-0x0;var _0x42bdef=_0x9cdd[_0x529b35];return _0x42bdef;};'use strict';var _=require('lodash');var util=require(_0xd9cd('0x0'));var moment=require(_0xd9cd('0x1'));var BPromise=require(_0xd9cd('0x2'));var rs=require(_0xd9cd('0x3'));var fs=require('fs');var Redis=require(_0xd9cd('0x4'));var db=require(_0xd9cd('0x5'))['db'];var utils=require(_0xd9cd('0x6'));var logger=require(_0xd9cd('0x7'))(_0xd9cd('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xd9cd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2891c5,_0x3f529d,_0x5d18c0){return new BPromise(function(_0x591f44,_0x467eff){return client[_0xd9cd('0xa')](_0x2891c5,_0x5d18c0)[_0xd9cd('0xb')](function(_0x177609){logger[_0xd9cd('0xc')](_0xd9cd('0xd'),_0x3f529d,_0xd9cd('0xe'));logger[_0xd9cd('0xf')](_0xd9cd('0x10'),_0x3f529d,'request\x20sent',JSON[_0xd9cd('0x11')](_0x177609));if(_0x177609[_0xd9cd('0x12')]){if(_0x177609['error']['code']===0x1f4){logger['error'](_0xd9cd('0xd'),_0x3f529d,_0x177609[_0xd9cd('0x12')][_0xd9cd('0x13')]);return _0x467eff(_0x177609[_0xd9cd('0x12')][_0xd9cd('0x13')]);}logger[_0xd9cd('0x12')](_0xd9cd('0xd'),_0x3f529d,_0x177609[_0xd9cd('0x12')]['message']);return _0x591f44(_0x177609[_0xd9cd('0x12')][_0xd9cd('0x13')]);}else{logger['info'](_0xd9cd('0xd'),_0x3f529d,_0xd9cd('0xe'));_0x591f44(_0x177609[_0xd9cd('0x14')][_0xd9cd('0x13')]);}})[_0xd9cd('0x15')](function(_0x2f6946){logger[_0xd9cd('0x12')](_0xd9cd('0xd'),_0x3f529d,_0x2f6946);_0x467eff(_0x2f6946);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 710dd9b..28c8ce2 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 _0x86b7=['delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','isAuthenticated','get','/:id','show','create','put','update'];(function(_0x4f56f3,_0x2a64b1){var _0x58a688=function(_0x3f42fa){while(--_0x3f42fa){_0x4f56f3['push'](_0x4f56f3['shift']());}};_0x58a688(++_0x2a64b1);}(_0x86b7,0x1f1));var _0x786b=function(_0x381b34,_0x1bf94a){_0x381b34=_0x381b34-0x0;var _0x16a3a4=_0x86b7[_0x381b34];return _0x16a3a4;};'use strict';var multer=require(_0x786b('0x0'));var util=require(_0x786b('0x1'));var path=require(_0x786b('0x2'));var timeout=require('connect-timeout');var express=require(_0x786b('0x3'));var router=express[_0x786b('0x4')]();var auth=require(_0x786b('0x5'));var interaction=require(_0x786b('0x6'));var config=require(_0x786b('0x7'));var controller=require(_0x786b('0x8'));router['get']('/',auth[_0x786b('0x9')](),controller['index']);router[_0x786b('0xa')](_0x786b('0xb'),auth[_0x786b('0x9')](),controller[_0x786b('0xc')]);router['post']('/',auth[_0x786b('0x9')](),controller[_0x786b('0xd')]);router[_0x786b('0xe')](_0x786b('0xb'),auth[_0x786b('0x9')](),controller[_0x786b('0xf')]);router[_0x786b('0x10')](_0x786b('0xb'),auth['isAuthenticated'](),controller[_0x786b('0x11')]);module[_0x786b('0x12')]=router; \ No newline at end of file +var _0x2eeb=['/:id','show','post','put','update','delete','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index'];(function(_0x12a2ef,_0x59a691){var _0xef8691=function(_0x27616e){while(--_0x27616e){_0x12a2ef['push'](_0x12a2ef['shift']());}};_0xef8691(++_0x59a691);}(_0x2eeb,0x86));var _0xb2ee=function(_0x49f037,_0x5cd60e){_0x49f037=_0x49f037-0x0;var _0x51228a=_0x2eeb[_0x49f037];return _0x51228a;};'use strict';var multer=require(_0xb2ee('0x0'));var util=require(_0xb2ee('0x1'));var path=require(_0xb2ee('0x2'));var timeout=require(_0xb2ee('0x3'));var express=require(_0xb2ee('0x4'));var router=express['Router']();var auth=require(_0xb2ee('0x5'));var interaction=require(_0xb2ee('0x6'));var config=require(_0xb2ee('0x7'));var controller=require('./intServicenowField.controller');router['get']('/',auth[_0xb2ee('0x8')](),controller[_0xb2ee('0x9')]);router['get'](_0xb2ee('0xa'),auth[_0xb2ee('0x8')](),controller[_0xb2ee('0xb')]);router[_0xb2ee('0xc')]('/',auth[_0xb2ee('0x8')](),controller['create']);router[_0xb2ee('0xd')](_0xb2ee('0xa'),auth[_0xb2ee('0x8')](),controller[_0xb2ee('0xe')]);router[_0xb2ee('0xf')](_0xb2ee('0xa'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 89f8b05..bd421a6 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 _0x5a1f=['ENUM','string','keyValue','STRING','variable','customVariable','BOOLEAN','sequelize','exports'];(function(_0x10608c,_0x41480b){var _0x45c488=function(_0xad5ddc){while(--_0xad5ddc){_0x10608c['push'](_0x10608c['shift']());}};_0x45c488(++_0x41480b);}(_0x5a1f,0x19c));var _0xf5a1=function(_0x4c507f,_0x25cd00){_0x4c507f=_0x4c507f-0x0;var _0x4f411d=_0x5a1f[_0x4c507f];return _0x4f411d;};'use strict';var Sequelize=require(_0xf5a1('0x0'));module[_0xf5a1('0x1')]={'type':{'type':Sequelize[_0xf5a1('0x2')](_0xf5a1('0x3'),'variable','customVariable',_0xf5a1('0x4')),'defaultValue':_0xf5a1('0x3')},'content':{'type':Sequelize[_0xf5a1('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0xf5a1('0x3'),_0xf5a1('0x6'),_0xf5a1('0x7'))},'keyContent':{'type':Sequelize[_0xf5a1('0x5')]},'idField':{'type':Sequelize[_0xf5a1('0x5')]},'nameField':{'type':Sequelize[_0xf5a1('0x5')]},'customField':{'type':Sequelize[_0xf5a1('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf5a1('0x5')]}}; \ No newline at end of file +var _0x6064=['STRING','variable','BOOLEAN','sequelize','ENUM','string','customVariable','keyValue'];(function(_0x15ffd5,_0x1bf5de){var _0x170afa=function(_0x31916a){while(--_0x31916a){_0x15ffd5['push'](_0x15ffd5['shift']());}};_0x170afa(++_0x1bf5de);}(_0x6064,0xe3));var _0x4606=function(_0x3e0b67,_0x353781){_0x3e0b67=_0x3e0b67-0x0;var _0x1c4a9d=_0x6064[_0x3e0b67];return _0x1c4a9d;};'use strict';var Sequelize=require(_0x4606('0x0'));module['exports']={'type':{'type':Sequelize[_0x4606('0x1')](_0x4606('0x2'),'variable',_0x4606('0x3'),_0x4606('0x4')),'defaultValue':_0x4606('0x2')},'content':{'type':Sequelize[_0x4606('0x5')]},'key':{'type':Sequelize[_0x4606('0x5')]},'keyType':{'type':Sequelize[_0x4606('0x1')]('string',_0x4606('0x6'),_0x4606('0x3'))},'keyContent':{'type':Sequelize[_0x4606('0x5')]},'idField':{'type':Sequelize[_0x4606('0x5')]},'nameField':{'type':Sequelize[_0x4606('0x5')]},'customField':{'type':Sequelize[_0x4606('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index a12ea3c..1c920cc 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 _0x3f57=['nolimit','order','sort','where','filters','pick','filter','merge','key','VIRTUAL','field','options','include','catch','show','params','length','find','create','body','update','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','count','offset','limit','set','apply','reject','save','then','destroy','sendStatus','stack','send','index','ServicenowField','rawAttributes','fieldName','type','model','map','name','keys','query','intersection','attributes','fields','hasOwnProperty'];(function(_0x3e5389,_0x11e72b){var _0x5731cb=function(_0xded1f7){while(--_0xded1f7){_0x3e5389['push'](_0x3e5389['shift']());}};_0x5731cb(++_0x11e72b);}(_0x3f57,0xb1));var _0x73f5=function(_0x37722d,_0x33ca5a){_0x37722d=_0x37722d-0x0;var _0x123fd0=_0x3f57[_0x37722d];return _0x123fd0;};'use strict';var pdf=require(_0x73f5('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x73f5('0x1'));var zipdir=require(_0x73f5('0x2'));var jsonpatch=require(_0x73f5('0x3'));var rp=require(_0x73f5('0x4'));var moment=require(_0x73f5('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x73f5('0x6'));var util=require(_0x73f5('0x7'));var path=require(_0x73f5('0x8'));var sox=require(_0x73f5('0x9'));var csv=require(_0x73f5('0xa'));var ejs=require(_0x73f5('0xb'));var fs=require('fs');var _=require(_0x73f5('0xc'));var squel=require(_0x73f5('0xd'));var crypto=require(_0x73f5('0xe'));var jsforce=require(_0x73f5('0xf'));var deskjs=require(_0x73f5('0x10'));var toCsv=require(_0x73f5('0xa'));var querystring=require(_0x73f5('0x11'));var Papa=require(_0x73f5('0x12'));var Redis=require(_0x73f5('0x13'));var authService=require(_0x73f5('0x14'));var qs=require(_0x73f5('0x15'));var as=require(_0x73f5('0x16'));var hardwareService=require(_0x73f5('0x17'));var logger=require(_0x73f5('0x18'))(_0x73f5('0x19'));var utils=require(_0x73f5('0x1a'));var config=require(_0x73f5('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xd2feca,_0x4accfe){_0x4accfe=_0x4accfe||0xcc;return function(_0x1f3ca4){if(_0x1f3ca4){return _0xd2feca['sendStatus'](_0x4accfe);}return _0xd2feca[_0x73f5('0x1c')](_0x4accfe)[_0x73f5('0x1d')]();};}function respondWithResult(_0x3998af,_0x40b8c7){_0x40b8c7=_0x40b8c7||0xc8;return function(_0x1a7f95){if(_0x1a7f95){return _0x3998af[_0x73f5('0x1c')](_0x40b8c7)[_0x73f5('0x1e')](_0x1a7f95);}};}function respondWithFilteredResult(_0x28c598,_0x5d7c1c){return function(_0xc9cb1d){if(_0xc9cb1d){var _0x53fd92=_0xc9cb1d[_0x73f5('0x1f')],_0x20ecb=_0x5d7c1c[_0x73f5('0x20')],_0x15e2fb=_0x5d7c1c[_0x73f5('0x20')]+_0x5d7c1c[_0x73f5('0x21')],_0x46c215;if(_0x15e2fb>=_0x53fd92){_0x15e2fb=_0x53fd92;_0x46c215=0xc8;}else{_0x46c215=0xce;}_0x28c598[_0x73f5('0x1c')](_0x46c215);return _0x28c598[_0x73f5('0x22')]('Content-Range',_0x20ecb+'-'+_0x15e2fb+'/'+_0x53fd92)['json'](_0xc9cb1d);}return null;};}function patchUpdates(_0x1febf5){return function(_0x4a7269){try{jsonpatch[_0x73f5('0x23')](_0x4a7269,_0x1febf5,!![]);}catch(_0x3780ec){return BPromise[_0x73f5('0x24')](_0x3780ec);}return _0x4a7269[_0x73f5('0x25')]();};}function saveUpdates(_0x158c25,_0x36d161){return function(_0x1860c0){if(_0x1860c0){return _0x1860c0['update'](_0x158c25)[_0x73f5('0x26')](function(_0x3eb0bf){return _0x3eb0bf;});}return null;};}function removeEntity(_0x476f9e,_0x580d27){return function(_0x9fef0){if(_0x9fef0){return _0x9fef0[_0x73f5('0x27')]()['then'](function(){_0x476f9e['status'](0xcc)[_0x73f5('0x1d')]();});}};}function handleEntityNotFound(_0x25c34f,_0x232688){return function(_0x345197){if(!_0x345197){_0x25c34f[_0x73f5('0x28')](0x194);}return _0x345197;};}function handleError(_0x205774,_0x46afa3){_0x46afa3=_0x46afa3||0x1f4;return function(_0xbb85d9){logger['error'](_0xbb85d9[_0x73f5('0x29')]);if(_0xbb85d9['name']){delete _0xbb85d9['name'];}_0x205774[_0x73f5('0x1c')](_0x46afa3)[_0x73f5('0x2a')](_0xbb85d9);};}exports[_0x73f5('0x2b')]=function(_0xb2688a,_0x49852a){var _0x47127d={},_0x10915a={},_0x36c6f6={'count':0x0,'rows':[]};var _0x364b9f=_['map'](db[_0x73f5('0x2c')][_0x73f5('0x2d')],function(_0x380f61){return{'name':_0x380f61[_0x73f5('0x2e')],'type':_0x380f61[_0x73f5('0x2f')]['key']};});_0x10915a[_0x73f5('0x30')]=_[_0x73f5('0x31')](_0x364b9f,_0x73f5('0x32'));_0x10915a['query']=_[_0x73f5('0x33')](_0xb2688a[_0x73f5('0x34')]);_0x10915a['filters']=_[_0x73f5('0x35')](_0x10915a['model'],_0x10915a[_0x73f5('0x34')]);_0x47127d[_0x73f5('0x36')]=_[_0x73f5('0x35')](_0x10915a[_0x73f5('0x30')],qs[_0x73f5('0x37')](_0xb2688a[_0x73f5('0x34')][_0x73f5('0x37')]));_0x47127d[_0x73f5('0x36')]=_0x47127d[_0x73f5('0x36')]['length']?_0x47127d[_0x73f5('0x36')]:_0x10915a[_0x73f5('0x30')];if(!_0xb2688a[_0x73f5('0x34')][_0x73f5('0x38')](_0x73f5('0x39'))){_0x47127d[_0x73f5('0x21')]=qs['limit'](_0xb2688a[_0x73f5('0x34')][_0x73f5('0x21')]);_0x47127d[_0x73f5('0x20')]=qs['offset'](_0xb2688a['query']['offset']);}_0x47127d[_0x73f5('0x3a')]=qs[_0x73f5('0x3b')](_0xb2688a['query'][_0x73f5('0x3b')]);_0x47127d[_0x73f5('0x3c')]=qs[_0x73f5('0x3d')](_[_0x73f5('0x3e')](_0xb2688a[_0x73f5('0x34')],_0x10915a['filters']));if(_0xb2688a[_0x73f5('0x34')][_0x73f5('0x3f')]){_0x47127d[_0x73f5('0x3c')]=_[_0x73f5('0x40')](_0x47127d[_0x73f5('0x3c')],{'$or':_[_0x73f5('0x31')](_0x364b9f,function(_0x179b78){if(_0x179b78[_0x73f5('0x2f')][_0x73f5('0x41')]!==_0x73f5('0x42')){var _0x43527d={};_0x43527d[_0x179b78[_0x73f5('0x43')]]={'$like':'%'+_0xb2688a[_0x73f5('0x34')][_0x73f5('0x3f')]+'%'};return _0x43527d;}})});}_0x47127d=_[_0x73f5('0x40')]({},_0x47127d,_0xb2688a[_0x73f5('0x44')]);var _0x5c7ed2={'where':_0x47127d[_0x73f5('0x3c')]};return db['ServicenowField'][_0x73f5('0x1f')](_0x5c7ed2)[_0x73f5('0x26')](function(_0x2b0b56){_0x36c6f6[_0x73f5('0x1f')]=_0x2b0b56;if(_0xb2688a[_0x73f5('0x34')]['includeAll']){_0x47127d[_0x73f5('0x45')]=[{'all':!![]}];}return db[_0x73f5('0x2c')]['findAll'](_0x47127d);})['then'](function(_0x1db2b6){_0x36c6f6['rows']=_0x1db2b6;return _0x36c6f6;})[_0x73f5('0x26')](respondWithFilteredResult(_0x49852a,_0x47127d))[_0x73f5('0x46')](handleError(_0x49852a,null));};exports[_0x73f5('0x47')]=function(_0xabf59d,_0x3e7370){var _0x45dfc3={'raw':!![],'where':{'id':_0xabf59d[_0x73f5('0x48')]['id']}},_0x47bbb1={};_0x47bbb1['model']=_[_0x73f5('0x33')](db[_0x73f5('0x2c')][_0x73f5('0x2d')]);_0x47bbb1[_0x73f5('0x34')]=_[_0x73f5('0x33')](_0xabf59d[_0x73f5('0x34')]);_0x47bbb1[_0x73f5('0x3d')]=_['intersection'](_0x47bbb1['model'],_0x47bbb1[_0x73f5('0x34')]);_0x45dfc3[_0x73f5('0x36')]=_[_0x73f5('0x35')](_0x47bbb1[_0x73f5('0x30')],qs[_0x73f5('0x37')](_0xabf59d[_0x73f5('0x34')][_0x73f5('0x37')]));_0x45dfc3[_0x73f5('0x36')]=_0x45dfc3[_0x73f5('0x36')][_0x73f5('0x49')]?_0x45dfc3['attributes']:_0x47bbb1['model'];if(_0xabf59d[_0x73f5('0x34')]['includeAll']){_0x45dfc3['include']=[{'all':!![]}];}_0x45dfc3=_['merge']({},_0x45dfc3,_0xabf59d[_0x73f5('0x44')]);return db[_0x73f5('0x2c')][_0x73f5('0x4a')](_0x45dfc3)['then'](handleEntityNotFound(_0x3e7370,null))[_0x73f5('0x26')](respondWithResult(_0x3e7370,null))[_0x73f5('0x46')](handleError(_0x3e7370,null));};exports[_0x73f5('0x4b')]=function(_0x43d272,_0x1e11ce){return db['ServicenowField'][_0x73f5('0x4b')](_0x43d272[_0x73f5('0x4c')],{})[_0x73f5('0x26')](respondWithResult(_0x1e11ce,0xc9))[_0x73f5('0x46')](handleError(_0x1e11ce,null));};exports[_0x73f5('0x4d')]=function(_0x4f6d95,_0x3e3b5e){if(_0x4f6d95[_0x73f5('0x4c')]['id']){delete _0x4f6d95[_0x73f5('0x4c')]['id'];}return db[_0x73f5('0x2c')][_0x73f5('0x4a')]({'where':{'id':_0x4f6d95[_0x73f5('0x48')]['id']}})[_0x73f5('0x26')](handleEntityNotFound(_0x3e3b5e,null))[_0x73f5('0x26')](saveUpdates(_0x4f6d95[_0x73f5('0x4c')],null))[_0x73f5('0x26')](respondWithResult(_0x3e3b5e,null))['catch'](handleError(_0x3e3b5e,null));};exports[_0x73f5('0x27')]=function(_0x107a2e,_0xbaee5e){return db[_0x73f5('0x2c')][_0x73f5('0x4a')]({'where':{'id':_0x107a2e[_0x73f5('0x48')]['id']}})['then'](handleEntityNotFound(_0xbaee5e,null))[_0x73f5('0x26')](removeEntity(_0xbaee5e,null))['catch'](handleError(_0xbaee5e,null));}; \ No newline at end of file +var _0x46d2=['destroy','error','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','field','options','includeAll','include','ServicenowField','findAll','rows','catch','show','find','create','body','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','end','status','json','count','offset','limit','Content-Range','apply','reject','save','then'];(function(_0x26ec61,_0x123571){var _0x5894e1=function(_0x1e7cc1){while(--_0x1e7cc1){_0x26ec61['push'](_0x26ec61['shift']());}};_0x5894e1(++_0x123571);}(_0x46d2,0xbc));var _0x246d=function(_0x4f6c04,_0x128e34){_0x4f6c04=_0x4f6c04-0x0;var _0x177258=_0x46d2[_0x4f6c04];return _0x177258;};'use strict';var pdf=require(_0x246d('0x0'));var emlformat=require(_0x246d('0x1'));var rimraf=require(_0x246d('0x2'));var zipdir=require(_0x246d('0x3'));var jsonpatch=require(_0x246d('0x4'));var rp=require('request-promise');var moment=require(_0x246d('0x5'));var BPromise=require(_0x246d('0x6'));var Mustache=require(_0x246d('0x7'));var util=require(_0x246d('0x8'));var path=require(_0x246d('0x9'));var sox=require('sox');var csv=require(_0x246d('0xa'));var ejs=require(_0x246d('0xb'));var fs=require('fs');var _=require(_0x246d('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x246d('0xa'));var querystring=require(_0x246d('0xd'));var Papa=require(_0x246d('0xe'));var Redis=require(_0x246d('0xf'));var authService=require(_0x246d('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x246d('0x11'));var hardwareService=require(_0x246d('0x12'));var logger=require(_0x246d('0x13'))('api');var utils=require(_0x246d('0x14'));var config=require('../../config/environment');var db=require(_0x246d('0x15'))['db'];function respondWithStatusCode(_0x24ff51,_0x3c2182){_0x3c2182=_0x3c2182||0xcc;return function(_0x347bb9){if(_0x347bb9){return _0x24ff51[_0x246d('0x16')](_0x3c2182);}return _0x24ff51['status'](_0x3c2182)[_0x246d('0x17')]();};}function respondWithResult(_0x15f7f9,_0x222c5b){_0x222c5b=_0x222c5b||0xc8;return function(_0x1b1042){if(_0x1b1042){return _0x15f7f9[_0x246d('0x18')](_0x222c5b)[_0x246d('0x19')](_0x1b1042);}};}function respondWithFilteredResult(_0x16babd,_0x54f423){return function(_0x15055b){if(_0x15055b){var _0x3e6407=_0x15055b[_0x246d('0x1a')],_0x1c0fea=_0x54f423[_0x246d('0x1b')],_0x240b5c=_0x54f423[_0x246d('0x1b')]+_0x54f423[_0x246d('0x1c')],_0x5663b5;if(_0x240b5c>=_0x3e6407){_0x240b5c=_0x3e6407;_0x5663b5=0xc8;}else{_0x5663b5=0xce;}_0x16babd[_0x246d('0x18')](_0x5663b5);return _0x16babd['set'](_0x246d('0x1d'),_0x1c0fea+'-'+_0x240b5c+'/'+_0x3e6407)[_0x246d('0x19')](_0x15055b);}return null;};}function patchUpdates(_0x134539){return function(_0x43a337){try{jsonpatch[_0x246d('0x1e')](_0x43a337,_0x134539,!![]);}catch(_0x2ee9ba){return BPromise[_0x246d('0x1f')](_0x2ee9ba);}return _0x43a337[_0x246d('0x20')]();};}function saveUpdates(_0x4460d3,_0x4462ad){return function(_0x53172d){if(_0x53172d){return _0x53172d['update'](_0x4460d3)[_0x246d('0x21')](function(_0xae0003){return _0xae0003;});}return null;};}function removeEntity(_0x4935ed,_0x2c792c){return function(_0x2c12a5){if(_0x2c12a5){return _0x2c12a5[_0x246d('0x22')]()[_0x246d('0x21')](function(){_0x4935ed[_0x246d('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x6c0ed4,_0x4be465){return function(_0xcd74f8){if(!_0xcd74f8){_0x6c0ed4[_0x246d('0x16')](0x194);}return _0xcd74f8;};}function handleError(_0x2979f2,_0x1814dc){_0x1814dc=_0x1814dc||0x1f4;return function(_0x2628bb){logger[_0x246d('0x23')](_0x2628bb['stack']);if(_0x2628bb[_0x246d('0x24')]){delete _0x2628bb[_0x246d('0x24')];}_0x2979f2[_0x246d('0x18')](_0x1814dc)[_0x246d('0x25')](_0x2628bb);};}exports[_0x246d('0x26')]=function(_0x2ff9f0,_0x56f070){var _0x7e51b={},_0xdd9162={},_0x3391a5={'count':0x0,'rows':[]};var _0x1c4a2b=_[_0x246d('0x27')](db['ServicenowField'][_0x246d('0x28')],function(_0x54820d){return{'name':_0x54820d[_0x246d('0x29')],'type':_0x54820d[_0x246d('0x2a')][_0x246d('0x2b')]};});_0xdd9162[_0x246d('0x2c')]=_[_0x246d('0x27')](_0x1c4a2b,_0x246d('0x24'));_0xdd9162['query']=_[_0x246d('0x2d')](_0x2ff9f0[_0x246d('0x2e')]);_0xdd9162['filters']=_[_0x246d('0x2f')](_0xdd9162[_0x246d('0x2c')],_0xdd9162['query']);_0x7e51b[_0x246d('0x30')]=_[_0x246d('0x2f')](_0xdd9162[_0x246d('0x2c')],qs['fields'](_0x2ff9f0[_0x246d('0x2e')][_0x246d('0x31')]));_0x7e51b['attributes']=_0x7e51b['attributes'][_0x246d('0x32')]?_0x7e51b[_0x246d('0x30')]:_0xdd9162['model'];if(!_0x2ff9f0['query'][_0x246d('0x33')](_0x246d('0x34'))){_0x7e51b[_0x246d('0x1c')]=qs[_0x246d('0x1c')](_0x2ff9f0[_0x246d('0x2e')][_0x246d('0x1c')]);_0x7e51b['offset']=qs[_0x246d('0x1b')](_0x2ff9f0['query'][_0x246d('0x1b')]);}_0x7e51b[_0x246d('0x35')]=qs[_0x246d('0x36')](_0x2ff9f0['query']['sort']);_0x7e51b[_0x246d('0x37')]=qs['filters'](_[_0x246d('0x38')](_0x2ff9f0[_0x246d('0x2e')],_0xdd9162[_0x246d('0x39')]));if(_0x2ff9f0['query'][_0x246d('0x3a')]){_0x7e51b[_0x246d('0x37')]=_[_0x246d('0x3b')](_0x7e51b[_0x246d('0x37')],{'$or':_[_0x246d('0x27')](_0x1c4a2b,function(_0x42c7c4){if(_0x42c7c4['type']['key']!==_0x246d('0x3c')){var _0x399319={};_0x399319[_0x42c7c4[_0x246d('0x3d')]]={'$like':'%'+_0x2ff9f0[_0x246d('0x2e')][_0x246d('0x3a')]+'%'};return _0x399319;}})});}_0x7e51b=_[_0x246d('0x3b')]({},_0x7e51b,_0x2ff9f0[_0x246d('0x3e')]);var _0x449a8f={'where':_0x7e51b['where']};return db['ServicenowField'][_0x246d('0x1a')](_0x449a8f)[_0x246d('0x21')](function(_0x4add17){_0x3391a5[_0x246d('0x1a')]=_0x4add17;if(_0x2ff9f0[_0x246d('0x2e')][_0x246d('0x3f')]){_0x7e51b[_0x246d('0x40')]=[{'all':!![]}];}return db[_0x246d('0x41')][_0x246d('0x42')](_0x7e51b);})[_0x246d('0x21')](function(_0x3a41f4){_0x3391a5[_0x246d('0x43')]=_0x3a41f4;return _0x3391a5;})[_0x246d('0x21')](respondWithFilteredResult(_0x56f070,_0x7e51b))[_0x246d('0x44')](handleError(_0x56f070,null));};exports[_0x246d('0x45')]=function(_0x4f01ee,_0x1460e8){var _0x4244e8={'raw':!![],'where':{'id':_0x4f01ee['params']['id']}},_0x1e3b43={};_0x1e3b43[_0x246d('0x2c')]=_[_0x246d('0x2d')](db['ServicenowField'][_0x246d('0x28')]);_0x1e3b43[_0x246d('0x2e')]=_[_0x246d('0x2d')](_0x4f01ee[_0x246d('0x2e')]);_0x1e3b43[_0x246d('0x39')]=_[_0x246d('0x2f')](_0x1e3b43[_0x246d('0x2c')],_0x1e3b43[_0x246d('0x2e')]);_0x4244e8[_0x246d('0x30')]=_[_0x246d('0x2f')](_0x1e3b43[_0x246d('0x2c')],qs[_0x246d('0x31')](_0x4f01ee[_0x246d('0x2e')][_0x246d('0x31')]));_0x4244e8[_0x246d('0x30')]=_0x4244e8[_0x246d('0x30')][_0x246d('0x32')]?_0x4244e8[_0x246d('0x30')]:_0x1e3b43[_0x246d('0x2c')];if(_0x4f01ee[_0x246d('0x2e')][_0x246d('0x3f')]){_0x4244e8[_0x246d('0x40')]=[{'all':!![]}];}_0x4244e8=_['merge']({},_0x4244e8,_0x4f01ee[_0x246d('0x3e')]);return db[_0x246d('0x41')][_0x246d('0x46')](_0x4244e8)[_0x246d('0x21')](handleEntityNotFound(_0x1460e8,null))[_0x246d('0x21')](respondWithResult(_0x1460e8,null))[_0x246d('0x44')](handleError(_0x1460e8,null));};exports[_0x246d('0x47')]=function(_0x1cedff,_0xa9729b){return db[_0x246d('0x41')]['create'](_0x1cedff['body'],{})[_0x246d('0x21')](respondWithResult(_0xa9729b,0xc9))[_0x246d('0x44')](handleError(_0xa9729b,null));};exports['update']=function(_0x1efce9,_0x18d561){if(_0x1efce9[_0x246d('0x48')]['id']){delete _0x1efce9['body']['id'];}return db[_0x246d('0x41')][_0x246d('0x46')]({'where':{'id':_0x1efce9['params']['id']}})[_0x246d('0x21')](handleEntityNotFound(_0x18d561,null))[_0x246d('0x21')](saveUpdates(_0x1efce9['body'],null))['then'](respondWithResult(_0x18d561,null))[_0x246d('0x44')](handleError(_0x18d561,null));};exports[_0x246d('0x22')]=function(_0x3854d7,_0x255f6c){return db['ServicenowField'][_0x246d('0x46')]({'where':{'id':_0x3854d7[_0x246d('0x49')]['id']}})[_0x246d('0x21')](handleEntityNotFound(_0x255f6c,null))[_0x246d('0x21')](removeEntity(_0x255f6c,null))[_0x246d('0x44')](handleError(_0x255f6c,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 925ec07..1bd2677 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 _0xaff9=['servicenow_unique_index','FieldId','lodash','util','api','request-promise','path','rimraf','../../config/environment','exports','define','ServicenowField','int_servicenow_fields'];(function(_0x20f848,_0x2bb454){var _0x3a5f92=function(_0x52e7b3){while(--_0x52e7b3){_0x20f848['push'](_0x20f848['shift']());}};_0x3a5f92(++_0x2bb454);}(_0xaff9,0x84));var _0x9aff=function(_0x10f7fe,_0x523271){_0x10f7fe=_0x10f7fe-0x0;var _0x20fbf9=_0xaff9[_0x10f7fe];return _0x20fbf9;};'use strict';var _=require(_0x9aff('0x0'));var util=require(_0x9aff('0x1'));var logger=require('../../config/logger')(_0x9aff('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9aff('0x3'));var fs=require('fs');var path=require(_0x9aff('0x4'));var rimraf=require(_0x9aff('0x5'));var config=require(_0x9aff('0x6'));var attributes=require('./intServicenowField.attributes');module[_0x9aff('0x7')]=function(_0x4323ff,_0x535ec3){return _0x4323ff[_0x9aff('0x8')](_0x9aff('0x9'),attributes,{'tableName':_0x9aff('0xa'),'paranoid':![],'indexes':[{'name':_0x9aff('0xb'),'fields':['idField',_0x9aff('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x146b=['./intServicenowField.attributes','exports','define','ServicenowField','servicenow_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x16a5f7,_0x3caeb2){var _0x163f03=function(_0x568530){while(--_0x568530){_0x16a5f7['push'](_0x16a5f7['shift']());}};_0x163f03(++_0x3caeb2);}(_0x146b,0x18e));var _0xb146=function(_0x538bd3,_0x1e3c75){_0x538bd3=_0x538bd3-0x0;var _0x5e2fd7=_0x146b[_0x538bd3];return _0x5e2fd7;};'use strict';var _=require(_0xb146('0x0'));var util=require(_0xb146('0x1'));var logger=require(_0xb146('0x2'))(_0xb146('0x3'));var moment=require(_0xb146('0x4'));var BPromise=require(_0xb146('0x5'));var rp=require(_0xb146('0x6'));var fs=require('fs');var path=require(_0xb146('0x7'));var rimraf=require(_0xb146('0x8'));var config=require(_0xb146('0x9'));var attributes=require(_0xb146('0xa'));module[_0xb146('0xb')]=function(_0x4caf40,_0x39a2a3){return _0x4caf40[_0xb146('0xc')](_0xb146('0xd'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0xb146('0xe'),'fields':[_0xb146('0xf'),_0xb146('0x10')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.rpc.js b/server/api/intServicenowField/intServicenowField.rpc.js index e93f177..346aea5 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 _0xdf9b=['error','message','result','catch','lodash','util','moment','../../mysqldb','rpc','jayson/promise','client','request','then','info','ServicenowField,\x20%s,\x20%s','debug','ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x4a325a,_0x2c154c){var _0x2597a1=function(_0x437af3){while(--_0x437af3){_0x4a325a['push'](_0x4a325a['shift']());}};_0x2597a1(++_0x2c154c);}(_0xdf9b,0x1a6));var _0xbdf9=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0xdf9b[_0x5c2e3e];return _0x53f64a;};'use strict';var _=require(_0xbdf9('0x0'));var util=require(_0xbdf9('0x1'));var moment=require(_0xbdf9('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbdf9('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xbdf9('0x4'));var config=require('../../config/environment');var jayson=require(_0xbdf9('0x5'));var client=jayson[_0xbdf9('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x52d6dd,_0x4635e9,_0x1347c0){return new BPromise(function(_0x334868,_0x290607){return client[_0xbdf9('0x7')](_0x52d6dd,_0x1347c0)[_0xbdf9('0x8')](function(_0x205b43){logger[_0xbdf9('0x9')](_0xbdf9('0xa'),_0x4635e9,'request\x20sent');logger[_0xbdf9('0xb')](_0xbdf9('0xc'),_0x4635e9,_0xbdf9('0xd'),JSON[_0xbdf9('0xe')](_0x205b43));if(_0x205b43[_0xbdf9('0xf')]){if(_0x205b43[_0xbdf9('0xf')]['code']===0x1f4){logger[_0xbdf9('0xf')](_0xbdf9('0xa'),_0x4635e9,_0x205b43[_0xbdf9('0xf')][_0xbdf9('0x10')]);return _0x290607(_0x205b43[_0xbdf9('0xf')]['message']);}logger[_0xbdf9('0xf')](_0xbdf9('0xa'),_0x4635e9,_0x205b43[_0xbdf9('0xf')][_0xbdf9('0x10')]);return _0x334868(_0x205b43[_0xbdf9('0xf')]['message']);}else{logger['info'](_0xbdf9('0xa'),_0x4635e9,'request\x20sent');_0x334868(_0x205b43[_0xbdf9('0x11')]['message']);}})[_0xbdf9('0x12')](function(_0x196149){logger[_0xbdf9('0xf')](_0xbdf9('0xa'),_0x4635e9,_0x196149);_0x290607(_0x196149);});});} \ No newline at end of file +var _0x15bf=['client','http','request','then','info','ServicenowField,\x20%s,\x20%s','ServicenowField,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','jayson/promise'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x15bf,0x172));var _0xf15b=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x15bf[_0x16b9ed];return _0x66b1f8;};'use strict';var _=require(_0xf15b('0x0'));var util=require(_0xf15b('0x1'));var moment=require(_0xf15b('0x2'));var BPromise=require(_0xf15b('0x3'));var rs=require(_0xf15b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf15b('0x5'))['db'];var utils=require(_0xf15b('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xf15b('0x7'));var client=jayson[_0xf15b('0x8')][_0xf15b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x382e64,_0x17e0f9,_0x1dc67e){return new BPromise(function(_0x219aef,_0x540a54){return client[_0xf15b('0xa')](_0x382e64,_0x1dc67e)[_0xf15b('0xb')](function(_0x147a76){logger[_0xf15b('0xc')](_0xf15b('0xd'),_0x17e0f9,'request\x20sent');logger['debug'](_0xf15b('0xe'),_0x17e0f9,'request\x20sent',JSON['stringify'](_0x147a76));if(_0x147a76[_0xf15b('0xf')]){if(_0x147a76['error'][_0xf15b('0x10')]===0x1f4){logger['error'](_0xf15b('0xd'),_0x17e0f9,_0x147a76[_0xf15b('0xf')][_0xf15b('0x11')]);return _0x540a54(_0x147a76['error'][_0xf15b('0x11')]);}logger[_0xf15b('0xf')](_0xf15b('0xd'),_0x17e0f9,_0x147a76[_0xf15b('0xf')][_0xf15b('0x11')]);return _0x219aef(_0x147a76[_0xf15b('0xf')][_0xf15b('0x11')]);}else{logger[_0xf15b('0xc')]('ServicenowField,\x20%s,\x20%s',_0x17e0f9,_0xf15b('0x12'));_0x219aef(_0x147a76[_0xf15b('0x13')][_0xf15b('0x11')]);}})[_0xf15b('0x14')](function(_0xa7b560){logger[_0xf15b('0xf')](_0xf15b('0xd'),_0x17e0f9,_0xa7b560);_0x540a54(_0xa7b560);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index c3fd1a7..6417d51 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 _0xdd19=['post','create','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','getFields'];(function(_0x5782d3,_0x5d6b90){var _0x49df53=function(_0x5c2f6c){while(--_0x5c2f6c){_0x5782d3['push'](_0x5782d3['shift']());}};_0x49df53(++_0x5d6b90);}(_0xdd19,0x1a9));var _0x9dd1=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xdd19[_0x465a0c];return _0x1e202e;};'use strict';var multer=require(_0x9dd1('0x0'));var util=require('util');var path=require(_0x9dd1('0x1'));var timeout=require(_0x9dd1('0x2'));var express=require(_0x9dd1('0x3'));var router=express[_0x9dd1('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x9dd1('0x5'));var config=require(_0x9dd1('0x6'));var controller=require(_0x9dd1('0x7'));router[_0x9dd1('0x8')]('/',auth[_0x9dd1('0x9')](),controller[_0x9dd1('0xa')]);router[_0x9dd1('0x8')](_0x9dd1('0xb'),auth[_0x9dd1('0x9')](),controller['show']);router[_0x9dd1('0x8')](_0x9dd1('0xc'),auth[_0x9dd1('0x9')](),controller[_0x9dd1('0xd')]);router[_0x9dd1('0x8')]('/:id/fields',auth['isAuthenticated'](),controller[_0x9dd1('0xe')]);router[_0x9dd1('0xf')]('/',auth[_0x9dd1('0x9')](),controller[_0x9dd1('0x10')]);router[_0x9dd1('0xf')](_0x9dd1('0xc'),auth[_0x9dd1('0x9')](),controller['addConfiguration']);router['put'](_0x9dd1('0xb'),auth[_0x9dd1('0x9')](),controller['update']);router[_0x9dd1('0x11')](_0x9dd1('0xb'),auth[_0x9dd1('0x9')](),controller[_0x9dd1('0x12')]);module[_0x9dd1('0x13')]=router; \ No newline at end of file +var _0xd68b=['delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','/:id','/:id/configurations','isAuthenticated','getConfigurations','getFields','post','put','update'];(function(_0x518212,_0x1c87dd){var _0x51bba6=function(_0x30da43){while(--_0x30da43){_0x518212['push'](_0x518212['shift']());}};_0x51bba6(++_0x1c87dd);}(_0xd68b,0xa3));var _0xbd68=function(_0x4de1b5,_0x2a7626){_0x4de1b5=_0x4de1b5-0x0;var _0xed55cf=_0xd68b[_0x4de1b5];return _0xed55cf;};'use strict';var multer=require(_0xbd68('0x0'));var util=require('util');var path=require(_0xbd68('0x1'));var timeout=require(_0xbd68('0x2'));var express=require(_0xbd68('0x3'));var router=express[_0xbd68('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xbd68('0x5'));var config=require(_0xbd68('0x6'));var controller=require(_0xbd68('0x7'));router[_0xbd68('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xbd68('0x9'),auth['isAuthenticated'](),controller['show']);router[_0xbd68('0x8')](_0xbd68('0xa'),auth[_0xbd68('0xb')](),controller[_0xbd68('0xc')]);router[_0xbd68('0x8')]('/:id/fields',auth[_0xbd68('0xb')](),controller[_0xbd68('0xd')]);router[_0xbd68('0xe')]('/',auth[_0xbd68('0xb')](),controller['create']);router['post'](_0xbd68('0xa'),auth[_0xbd68('0xb')](),controller['addConfiguration']);router[_0xbd68('0xf')](_0xbd68('0x9'),auth[_0xbd68('0xb')](),controller[_0xbd68('0x10')]);router[_0xbd68('0x11')]('/:id',auth[_0xbd68('0xb')](),controller[_0xbd68('0x12')]);module[_0xbd68('0x13')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index f99701f..2481f69 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 _0x0f36=['exports','STRING','username','remoteUri','sequelize'];(function(_0x322652,_0x5a85c0){var _0x5d5e88=function(_0x5ce853){while(--_0x5ce853){_0x322652['push'](_0x322652['shift']());}};_0x5d5e88(++_0x5a85c0);}(_0x0f36,0x8b));var _0x60f3=function(_0x2a238a,_0x1d5054){_0x2a238a=_0x2a238a-0x0;var _0xeef802=_0x0f36[_0x2a238a];return _0xeef802;};'use strict';var Sequelize=require(_0x60f3('0x0'));module[_0x60f3('0x1')]={'name':{'type':Sequelize[_0x60f3('0x2')]},'description':{'type':Sequelize[_0x60f3('0x2')]},'username':{'type':Sequelize[_0x60f3('0x2')],'unique':_0x60f3('0x3')},'password':{'type':Sequelize[_0x60f3('0x2')]},'remoteUri':{'type':Sequelize[_0x60f3('0x2')],'unique':_0x60f3('0x4')},'serverUrl':{'type':Sequelize[_0x60f3('0x2')]}}; \ No newline at end of file +var _0x158f=['STRING','username','exports'];(function(_0xa81172,_0xf3c44b){var _0x213953=function(_0xbd11d9){while(--_0xbd11d9){_0xa81172['push'](_0xa81172['shift']());}};_0x213953(++_0xf3c44b);}(_0x158f,0x137));var _0xf158=function(_0x3731d7,_0x10c780){_0x3731d7=_0x3731d7-0x0;var _0x292e6a=_0x158f[_0x3731d7];return _0x292e6a;};'use strict';var Sequelize=require('sequelize');module[_0xf158('0x0')]={'name':{'type':Sequelize[_0xf158('0x1')]},'description':{'type':Sequelize[_0xf158('0x1')]},'username':{'type':Sequelize[_0xf158('0x1')],'unique':_0xf158('0x2')},'password':{'type':Sequelize[_0xf158('0x1')]},'remoteUri':{'type':Sequelize[_0xf158('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xf158('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js index 2e29595..b3fc359 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 _0x6039=['stack','name','send','index','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','VIRTUAL','field','merge','options','SugarcrmAccount','includeAll','findAll','show','params','keys','include','create','body','update','find','getConfigurations','findOne','SugarcrmConfiguration','pick','addConfiguration','AccountId','getSubjects','channel','getDescriptions','SugarcrmField','Subjects','Descriptions','getFields','created_by','description','date_start','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','username','password','remoteUri','slice','substring','POST','%s%s','login','JSON','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','format','/service/v4_1/rest.php','get_module_fields','Calls','values','module_fields','remove','label','value','statusCode','getFields,\x20%s,\x20%s,\x20%s','test','Wrong\x20credentials','html-pdf','eml-format','zip-dir','request-promise','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','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','then','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','end','count','offset','status','set','Content-Range','apply','save','destroy'];(function(_0x4392af,_0xec5afe){var _0x9fa8eb=function(_0x41d7a4){while(--_0x41d7a4){_0x4392af['push'](_0x4392af['shift']());}};_0x9fa8eb(++_0xec5afe);}(_0x6039,0xd6));var _0x9603=function(_0x3491b9,_0x413269){_0x3491b9=_0x3491b9-0x0;var _0x4675e0=_0x6039[_0x3491b9];return _0x4675e0;};'use strict';var pdf=require(_0x9603('0x0'));var emlformat=require(_0x9603('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x9603('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9603('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x9603('0x4'));var csv=require(_0x9603('0x5'));var ejs=require(_0x9603('0x6'));var fs=require('fs');var _=require(_0x9603('0x7'));var squel=require(_0x9603('0x8'));var crypto=require('crypto');var jsforce=require(_0x9603('0x9'));var deskjs=require(_0x9603('0xa'));var toCsv=require(_0x9603('0x5'));var querystring=require(_0x9603('0xb'));var Papa=require('papaparse');var Redis=require(_0x9603('0xc'));var authService=require(_0x9603('0xd'));var qs=require(_0x9603('0xe'));var as=require(_0x9603('0xf'));var hardwareService=require(_0x9603('0x10'));var logger=require(_0x9603('0x11'))(_0x9603('0x12'));var utils=require(_0x9603('0x13'));var config=require(_0x9603('0x14'));var db=require(_0x9603('0x15'))['db'];var integrations=require(_0x9603('0x16'));var jayson=require('jayson/promise');var client=jayson[_0x9603('0x17')]['http']({'port':0x232a});function checkPasswordPattern(_0x4cb563,_0x1ab442,_0x2c84ba){if(_0x2c84ba){var _0x1e1714=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1e1714['test'](_0x1ab442)){return _0x4cb563;}else{throw new Error(_0x9603('0x18'));}}else{return _0x4cb563;}}function respondWithRpcPromise(_0x2d1d42,_0x3e004d,_0x392209,_0x544f22){return new BPromise(function(_0x342062,_0x4ba315){var _0x2fdb24=_0x544f22||client;return _0x2fdb24[_0x9603('0x19')](_0x2d1d42,_0x392209)[_0x9603('0x1a')](function(_0x4ff4ff){logger['info'](_0x9603('0x1b'),_0x3e004d,_0x9603('0x1c'));logger[_0x9603('0x1d')](_0x9603('0x1e'),_0x3e004d,_0x9603('0x1c'),JSON[_0x9603('0x1f')](_0x4ff4ff));if(_0x4ff4ff['error']){if(_0x4ff4ff[_0x9603('0x20')][_0x9603('0x21')]===0x1f4){logger[_0x9603('0x20')](_0x9603('0x1b'),_0x3e004d,_0x4ff4ff[_0x9603('0x20')][_0x9603('0x22')]);return _0x4ba315(_0x4ff4ff['error'][_0x9603('0x22')]);}logger[_0x9603('0x20')](_0x9603('0x1b'),_0x3e004d,_0x4ff4ff[_0x9603('0x20')][_0x9603('0x22')]);return _0x342062(_0x4ff4ff['error'][_0x9603('0x22')]);}else{logger['info'](_0x9603('0x1b'),_0x3e004d,_0x9603('0x1c'));_0x342062(_0x4ff4ff['result'][_0x9603('0x22')]);}})[_0x9603('0x23')](function(_0x317c0f){logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x3e004d,_0x317c0f);_0x4ba315(_0x317c0f);});});}function respondWithStatusCode(_0x539648,_0x3f44e1){_0x3f44e1=_0x3f44e1||0xcc;return function(_0x531bb9){if(_0x531bb9){return _0x539648[_0x9603('0x24')](_0x3f44e1);}return _0x539648['status'](_0x3f44e1)[_0x9603('0x25')]();};}function respondWithResult(_0x4acd3d,_0x217528){_0x217528=_0x217528||0xc8;return function(_0x59e73b){if(_0x59e73b){return _0x4acd3d['status'](_0x217528)['json'](_0x59e73b);}};}function respondWithFilteredResult(_0x3b2214,_0x5ab3c9){return function(_0x14e512){if(_0x14e512){var _0x4fe162=_0x14e512[_0x9603('0x26')],_0x5e7b0c=_0x5ab3c9[_0x9603('0x27')],_0x4fd7b1=_0x5ab3c9[_0x9603('0x27')]+_0x5ab3c9['limit'],_0xf16b40;if(_0x4fd7b1>=_0x4fe162){_0x4fd7b1=_0x4fe162;_0xf16b40=0xc8;}else{_0xf16b40=0xce;}_0x3b2214[_0x9603('0x28')](_0xf16b40);return _0x3b2214[_0x9603('0x29')](_0x9603('0x2a'),_0x5e7b0c+'-'+_0x4fd7b1+'/'+_0x4fe162)['json'](_0x14e512);}return null;};}function patchUpdates(_0x524353){return function(_0x2b88b7){try{jsonpatch[_0x9603('0x2b')](_0x2b88b7,_0x524353,!![]);}catch(_0x4292cd){return BPromise['reject'](_0x4292cd);}return _0x2b88b7[_0x9603('0x2c')]();};}function saveUpdates(_0x4b757d,_0x1a31e7){return function(_0x46d628){if(_0x46d628){return _0x46d628['update'](_0x4b757d)[_0x9603('0x1a')](function(_0x55003b){return _0x55003b;});}return null;};}function removeEntity(_0x4257b9,_0x28cc4a){return function(_0x6aff4e){if(_0x6aff4e){return _0x6aff4e[_0x9603('0x2d')]()[_0x9603('0x1a')](function(){_0x4257b9['status'](0xcc)[_0x9603('0x25')]();});}};}function handleEntityNotFound(_0x4a3dd1,_0x2596ba){return function(_0x36a333){if(!_0x36a333){_0x4a3dd1[_0x9603('0x24')](0x194);}return _0x36a333;};}function handleError(_0x4542e3,_0x4cffe0){_0x4cffe0=_0x4cffe0||0x1f4;return function(_0x3f8a3a){logger['error'](_0x3f8a3a[_0x9603('0x2e')]);if(_0x3f8a3a['name']){delete _0x3f8a3a[_0x9603('0x2f')];}_0x4542e3[_0x9603('0x28')](_0x4cffe0)[_0x9603('0x30')](_0x3f8a3a);};}exports[_0x9603('0x31')]=function(_0x1d2ede,_0x3915b1){var _0x283a08={},_0x27e27c={},_0x37b130={'count':0x0,'rows':[]};var _0x302be6=_['map'](db['SugarcrmAccount'][_0x9603('0x32')],function(_0x2380de){return{'name':_0x2380de[_0x9603('0x33')],'type':_0x2380de[_0x9603('0x34')]['key']};});_0x27e27c['model']=_[_0x9603('0x35')](_0x302be6,_0x9603('0x2f'));_0x27e27c[_0x9603('0x36')]=_['keys'](_0x1d2ede[_0x9603('0x36')]);_0x27e27c[_0x9603('0x37')]=_[_0x9603('0x38')](_0x27e27c[_0x9603('0x39')],_0x27e27c[_0x9603('0x36')]);_0x283a08[_0x9603('0x3a')]=_[_0x9603('0x38')](_0x27e27c[_0x9603('0x39')],qs[_0x9603('0x3b')](_0x1d2ede[_0x9603('0x36')][_0x9603('0x3b')]));_0x283a08[_0x9603('0x3a')]=_0x283a08['attributes'][_0x9603('0x3c')]?_0x283a08[_0x9603('0x3a')]:_0x27e27c[_0x9603('0x39')];if(!_0x1d2ede[_0x9603('0x36')][_0x9603('0x3d')](_0x9603('0x3e'))){_0x283a08['limit']=qs[_0x9603('0x3f')](_0x1d2ede[_0x9603('0x36')][_0x9603('0x3f')]);_0x283a08[_0x9603('0x27')]=qs[_0x9603('0x27')](_0x1d2ede[_0x9603('0x36')][_0x9603('0x27')]);}_0x283a08[_0x9603('0x40')]=qs[_0x9603('0x41')](_0x1d2ede[_0x9603('0x36')][_0x9603('0x41')]);_0x283a08[_0x9603('0x42')]=qs[_0x9603('0x37')](_['pick'](_0x1d2ede['query'],_0x27e27c[_0x9603('0x37')]));if(_0x1d2ede[_0x9603('0x36')][_0x9603('0x43')]){_0x283a08[_0x9603('0x42')]=_['merge'](_0x283a08[_0x9603('0x42')],{'$or':_['map'](_0x302be6,function(_0x57f8b8){if(_0x57f8b8[_0x9603('0x34')]['key']!==_0x9603('0x44')){var _0x72b9f0={};_0x72b9f0[_0x57f8b8[_0x9603('0x45')]]={'$like':'%'+_0x1d2ede[_0x9603('0x36')][_0x9603('0x43')]+'%'};return _0x72b9f0;}})});}_0x283a08=_[_0x9603('0x46')]({},_0x283a08,_0x1d2ede[_0x9603('0x47')]);var _0x4b82ee={'where':_0x283a08['where']};return db[_0x9603('0x48')][_0x9603('0x26')](_0x4b82ee)['then'](function(_0x40f953){_0x37b130[_0x9603('0x26')]=_0x40f953;if(_0x1d2ede[_0x9603('0x36')][_0x9603('0x49')]){_0x283a08['include']=[{'all':!![]}];}return db[_0x9603('0x48')][_0x9603('0x4a')](_0x283a08);})[_0x9603('0x1a')](function(_0x1920ec){_0x37b130['rows']=_0x1920ec;return _0x37b130;})[_0x9603('0x1a')](respondWithFilteredResult(_0x3915b1,_0x283a08))[_0x9603('0x23')](handleError(_0x3915b1,null));};exports[_0x9603('0x4b')]=function(_0x4b1b32,_0x505cba){var _0xed7d91={'raw':![],'where':{'id':_0x4b1b32[_0x9603('0x4c')]['id']}},_0x167a87={};_0x167a87[_0x9603('0x39')]=_['keys'](db['SugarcrmAccount'][_0x9603('0x32')]);_0x167a87['query']=_[_0x9603('0x4d')](_0x4b1b32[_0x9603('0x36')]);_0x167a87['filters']=_[_0x9603('0x38')](_0x167a87[_0x9603('0x39')],_0x167a87[_0x9603('0x36')]);_0xed7d91[_0x9603('0x3a')]=_[_0x9603('0x38')](_0x167a87[_0x9603('0x39')],qs[_0x9603('0x3b')](_0x4b1b32[_0x9603('0x36')]['fields']));_0xed7d91[_0x9603('0x3a')]=_0xed7d91['attributes']['length']?_0xed7d91['attributes']:_0x167a87[_0x9603('0x39')];if(_0x4b1b32[_0x9603('0x36')][_0x9603('0x49')]){_0xed7d91[_0x9603('0x4e')]=[{'all':!![]}];}_0xed7d91=_[_0x9603('0x46')]({},_0xed7d91,_0x4b1b32['options']);return db[_0x9603('0x48')]['find'](_0xed7d91)[_0x9603('0x1a')](handleEntityNotFound(_0x505cba,null))[_0x9603('0x1a')](respondWithResult(_0x505cba,null))[_0x9603('0x23')](handleError(_0x505cba,null));};exports[_0x9603('0x4f')]=function(_0x3ca371,_0x4a7ad4){return db[_0x9603('0x48')][_0x9603('0x4f')](_0x3ca371[_0x9603('0x50')],{})[_0x9603('0x1a')](respondWithResult(_0x4a7ad4,0xc9))['catch'](handleError(_0x4a7ad4,null));};exports[_0x9603('0x51')]=function(_0x3e3ed3,_0x8f0585){if(_0x3e3ed3['body']['id']){delete _0x3e3ed3[_0x9603('0x50')]['id'];}return db[_0x9603('0x48')]['find']({'where':{'id':_0x3e3ed3[_0x9603('0x4c')]['id']}})['then'](handleEntityNotFound(_0x8f0585,null))['then'](saveUpdates(_0x3e3ed3[_0x9603('0x50')],null))[_0x9603('0x1a')](respondWithResult(_0x8f0585,null))['catch'](handleError(_0x8f0585,null));};exports[_0x9603('0x2d')]=function(_0x2c2ff6,_0x6d55ff){return db[_0x9603('0x48')][_0x9603('0x52')]({'where':{'id':_0x2c2ff6[_0x9603('0x4c')]['id']}})[_0x9603('0x1a')](handleEntityNotFound(_0x6d55ff,null))[_0x9603('0x1a')](removeEntity(_0x6d55ff,null))[_0x9603('0x23')](handleError(_0x6d55ff,null));};exports[_0x9603('0x53')]=function(_0xb2e77a,_0x3613d1,_0x1a295f){var _0x2ebb7e={};var _0x596c00={};var _0x4ed06d;var _0xf1efc4;return db[_0x9603('0x48')][_0x9603('0x54')]({'where':{'id':_0xb2e77a[_0x9603('0x4c')]['id']}})[_0x9603('0x1a')](handleEntityNotFound(_0x3613d1,null))['then'](function(_0xd4cf7a){if(_0xd4cf7a){_0x4ed06d=_0xd4cf7a;_0x596c00[_0x9603('0x39')]=_[_0x9603('0x4d')](db[_0x9603('0x55')][_0x9603('0x32')]);_0x596c00[_0x9603('0x36')]=_[_0x9603('0x4d')](_0xb2e77a[_0x9603('0x36')]);_0x596c00[_0x9603('0x37')]=_['intersection'](_0x596c00[_0x9603('0x39')],_0x596c00[_0x9603('0x36')]);_0x2ebb7e[_0x9603('0x3a')]=_[_0x9603('0x38')](_0x596c00[_0x9603('0x39')],qs['fields'](_0xb2e77a[_0x9603('0x36')][_0x9603('0x3b')]));_0x2ebb7e['attributes']=_0x2ebb7e[_0x9603('0x3a')]['length']?_0x2ebb7e[_0x9603('0x3a')]:_0x596c00[_0x9603('0x39')];_0x2ebb7e['order']=qs['sort'](_0xb2e77a[_0x9603('0x36')][_0x9603('0x41')]);_0x2ebb7e[_0x9603('0x42')]=qs[_0x9603('0x37')](_[_0x9603('0x56')](_0xb2e77a['query'],_0x596c00[_0x9603('0x37')]));if(_0xb2e77a[_0x9603('0x36')][_0x9603('0x43')]){_0x2ebb7e[_0x9603('0x42')]=_[_0x9603('0x46')](_0x2ebb7e[_0x9603('0x42')],{'$or':_[_0x9603('0x35')](_0x2ebb7e[_0x9603('0x3a')],function(_0x4d3729){var _0xe5c777={};_0xe5c777[_0x4d3729]={'$like':'%'+_0xb2e77a[_0x9603('0x36')]['filter']+'%'};return _0xe5c777;})});}_0x2ebb7e=_[_0x9603('0x46')]({},_0x2ebb7e,_0xb2e77a['options']);return _0x4ed06d[_0x9603('0x53')](_0x2ebb7e);}})['then'](function(_0x1de61a){if(_0x1de61a){_0xf1efc4=_0x1de61a[_0x9603('0x3c')];if(!_0xb2e77a[_0x9603('0x36')][_0x9603('0x3d')]('nolimit')){_0x2ebb7e[_0x9603('0x3f')]=qs[_0x9603('0x3f')](_0xb2e77a[_0x9603('0x36')][_0x9603('0x3f')]);_0x2ebb7e[_0x9603('0x27')]=qs[_0x9603('0x27')](_0xb2e77a[_0x9603('0x36')]['offset']);}return _0x4ed06d['getConfigurations'](_0x2ebb7e);}})[_0x9603('0x1a')](function(_0x35b414){if(_0x35b414){return _0x35b414?{'count':_0xf1efc4,'rows':_0x35b414}:null;}})[_0x9603('0x1a')](respondWithResult(_0x3613d1,null))[_0x9603('0x23')](handleError(_0x3613d1,null));};exports[_0x9603('0x57')]=function(_0x112739,_0x467620,_0x4636ad){if(_0x112739[_0x9603('0x50')]['id']){delete _0x112739[_0x9603('0x50')]['id'];}return db['SugarcrmAccount']['findOne']({'where':{'id':_0x112739[_0x9603('0x4c')]['id']}})[_0x9603('0x1a')](handleEntityNotFound(_0x467620,null))[_0x9603('0x1a')](function(_0x3a7ae0){if(_0x3a7ae0){_0x112739['body'][_0x9603('0x58')]=_0x3a7ae0['id'];_0x112739[_0x9603('0x50')]['Subjects']=integrations[_0x9603('0x59')](_0x112739['body'][_0x9603('0x5a')],_0x112739[_0x9603('0x50')][_0x9603('0x34')]);_0x112739[_0x9603('0x50')]['Descriptions']=integrations[_0x9603('0x5b')](_0x112739[_0x9603('0x50')][_0x9603('0x5a')],_0x112739[_0x9603('0x50')][_0x9603('0x34')]);return db[_0x9603('0x55')][_0x9603('0x4f')](_0x112739[_0x9603('0x50')],{'include':[{'model':db[_0x9603('0x5c')],'as':_0x9603('0x5d')},{'model':db['SugarcrmField'],'as':_0x9603('0x5e')}]});}return null;})['then'](respondWithResult(_0x467620,null))['catch'](handleError(_0x467620,null));};exports[_0x9603('0x5f')]=function(_0x401164,_0x1687b5,_0x4833a6){var _0x1edc2b='';var _0x584f92=['id','name','assigned_user_id',_0x9603('0x60'),_0x9603('0x61'),_0x9603('0x62'),_0x9603('0x63'),_0x9603('0x64'),_0x9603('0x65'),_0x9603('0x66'),_0x9603('0x67'),_0x9603('0x68')];return db[_0x9603('0x48')][_0x9603('0x54')]({'where':{'id':_0x401164[_0x9603('0x4c')]['id']},'attributes':['id',_0x9603('0x69'),_0x9603('0x6a'),_0x9603('0x6b')]})[_0x9603('0x1a')](handleEntityNotFound(_0x1687b5,null))['then'](function(_0x128b48){if(_0x128b48){_0x1edc2b=_0x128b48[_0x9603('0x6b')];var _0x27934d=_0x1edc2b[_0x9603('0x6c')](-0x1);if(_0x27934d==='/'){_0x1edc2b=_0x1edc2b[_0x9603('0x6d')](0x0,_0x1edc2b['lastIndexOf'](_0x27934d));}return rp({'method':_0x9603('0x6e'),'uri':util['format'](_0x9603('0x6f'),_0x1edc2b,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x9603('0x70'),'input_type':_0x9603('0x71'),'response_type':'JSON','rest_data':JSON['stringify']({'user_auth':{'user_name':_0x128b48[_0x9603('0x69')],'password':_0x128b48[_0x9603('0x6a')],'encryption':'PLAIN'},'application':_0x9603('0x72')})}});}})['then'](function(_0x4316ce){if(_0x4316ce&&_0x4316ce[_0x9603('0x2f')]!==_0x9603('0x73')&&_0x4316ce[_0x9603('0x2f')]!==_0x9603('0x74')){return rp({'method':_0x9603('0x6e'),'uri':util[_0x9603('0x75')](_0x9603('0x6f'),_0x1edc2b,_0x9603('0x76')),'json':!![],'form':{'method':_0x9603('0x77'),'input_type':_0x9603('0x71'),'response_type':_0x9603('0x71'),'rest_data':JSON[_0x9603('0x1f')]({'session':_0x4316ce['id'],'module_name':_0x9603('0x78')})}})['then'](function(_0x28e358){if(_0x28e358){var _0x8be902=_[_0x9603('0x79')](_0x28e358[_0x9603('0x7a')]);_[_0x9603('0x7b')](_0x8be902,function(_0x52b3fc){return _0x584f92['includes'](_0x52b3fc[_0x9603('0x2f')]);});return{'count':_0x8be902['length'],'rows':_[_0x9603('0x35')](_0x8be902,function(_0x11c15d){return{'id':_0x11c15d[_0x9603('0x2f')],'name':_0x11c15d[_0x9603('0x7c')],'custom':_['endsWith'](_0x11c15d[_0x9603('0x2f')],'_c')?!![]:![],'options':_0x11c15d['options']?_[_0x9603('0x35')](_['values'](_0x11c15d[_0x9603('0x47')]),function(_0x12a80a){return{'name':_0x12a80a[_0x9603('0x7d')],'value':_0x12a80a[_0x9603('0x2f')]};}):[]};})};}})[_0x9603('0x1a')](respondWithResult(_0x1687b5,null))[_0x9603('0x23')](function(_0x44072f){var _0x276cf0=_0x401164[_0x9603('0x36')]['test']?0x1f4:_0x44072f[_0x9603('0x7e')]||0x1f4;logger[_0x9603('0x20')](_0x9603('0x7f'),_0x9603('0x5f'),_0x276cf0,JSON[_0x9603('0x1f')](_0x44072f));delete _0x44072f[_0x9603('0x2f')];if(_0x276cf0===0x191){_0x276cf0=0x190;}_0x1687b5['status'](_0x276cf0)['send'](_0x401164[_0x9603('0x36')][_0x9603('0x80')]?{'message':'Wrong\x20credentials','statusCode':_0x44072f[_0x9603('0x7e')]}:_0x44072f);});}else{var _0x56a948=0x1f4;_0x1687b5['status'](_0x56a948)[_0x9603('0x30')]({'message':_0x9603('0x81'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x5c42=['show','rawAttributes','include','find','create','body','params','getConfigurations','findOne','pick','merge','map','nolimit','getDescriptions','SugarcrmConfiguration','SugarcrmField','Descriptions','getFields','assigned_user_id','created_by','description','duration_minutes','parent_id','parent_type','parent_name','direction','username','password','slice','substring','lastIndexOf','POST','format','/service/v4_1/rest.php','PLAIN','Invalid\x20Login','Password\x20Expired','%s%s','get_module_fields','JSON','Calls','values','module_fields','remove','includes','label','endsWith','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','send','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','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','SugarcrmAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','status','end','json','count','offset','set','apply','reject','update','destroy','sendStatus','stack','name','index','SugarcrmAccount','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','filter','type','key','VIRTUAL','options','includeAll','rows','catch'];(function(_0x2ad9a1,_0x193540){var _0x274938=function(_0x61024d){while(--_0x61024d){_0x2ad9a1['push'](_0x2ad9a1['shift']());}};_0x274938(++_0x193540);}(_0x5c42,0x135));var _0x25c4=function(_0x4d6968,_0xfd11a1){_0x4d6968=_0x4d6968-0x0;var _0x575098=_0x5c42[_0x4d6968];return _0x575098;};'use strict';var pdf=require(_0x25c4('0x0'));var emlformat=require(_0x25c4('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x25c4('0x2'));var jsonpatch=require(_0x25c4('0x3'));var rp=require(_0x25c4('0x4'));var moment=require(_0x25c4('0x5'));var BPromise=require(_0x25c4('0x6'));var Mustache=require('mustache');var util=require(_0x25c4('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x25c4('0x8'));var ejs=require(_0x25c4('0x9'));var fs=require('fs');var _=require(_0x25c4('0xa'));var squel=require(_0x25c4('0xb'));var crypto=require(_0x25c4('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x25c4('0xd'));var toCsv=require('to-csv');var querystring=require(_0x25c4('0xe'));var Papa=require('papaparse');var Redis=require(_0x25c4('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x25c4('0x10'));var as=require(_0x25c4('0x11'));var hardwareService=require(_0x25c4('0x12'));var logger=require('../../config/logger')(_0x25c4('0x13'));var utils=require(_0x25c4('0x14'));var config=require(_0x25c4('0x15'));var db=require(_0x25c4('0x16'))['db'];var integrations=require(_0x25c4('0x17'));var jayson=require(_0x25c4('0x18'));var client=jayson['client'][_0x25c4('0x19')]({'port':0x232a});function checkPasswordPattern(_0x1c0f38,_0x4a6628,_0x3eb098){if(_0x3eb098){var _0x43335a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x43335a['test'](_0x4a6628)){return _0x1c0f38;}else{throw new Error(_0x25c4('0x1a'));}}else{return _0x1c0f38;}}function respondWithRpcPromise(_0x27bd6c,_0x562936,_0x3a72d2,_0x5933af){return new BPromise(function(_0x89002c,_0x199b8e){var _0x46baf8=_0x5933af||client;return _0x46baf8[_0x25c4('0x1b')](_0x27bd6c,_0x3a72d2)[_0x25c4('0x1c')](function(_0x447e52){logger[_0x25c4('0x1d')](_0x25c4('0x1e'),_0x562936,'request\x20sent');logger[_0x25c4('0x1f')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x562936,_0x25c4('0x20'),JSON[_0x25c4('0x21')](_0x447e52));if(_0x447e52[_0x25c4('0x22')]){if(_0x447e52[_0x25c4('0x22')][_0x25c4('0x23')]===0x1f4){logger['error'](_0x25c4('0x1e'),_0x562936,_0x447e52[_0x25c4('0x22')]['message']);return _0x199b8e(_0x447e52['error'][_0x25c4('0x24')]);}logger[_0x25c4('0x22')](_0x25c4('0x1e'),_0x562936,_0x447e52['error'][_0x25c4('0x24')]);return _0x89002c(_0x447e52[_0x25c4('0x22')]['message']);}else{logger[_0x25c4('0x1d')](_0x25c4('0x1e'),_0x562936,_0x25c4('0x20'));_0x89002c(_0x447e52[_0x25c4('0x25')]['message']);}})['catch'](function(_0x192b24){logger[_0x25c4('0x22')](_0x25c4('0x1e'),_0x562936,_0x192b24);_0x199b8e(_0x192b24);});});}function respondWithStatusCode(_0x3c5223,_0x3e652f){_0x3e652f=_0x3e652f||0xcc;return function(_0x3fa899){if(_0x3fa899){return _0x3c5223['sendStatus'](_0x3e652f);}return _0x3c5223[_0x25c4('0x26')](_0x3e652f)[_0x25c4('0x27')]();};}function respondWithResult(_0x4d6cc4,_0x57be8f){_0x57be8f=_0x57be8f||0xc8;return function(_0x2fad9b){if(_0x2fad9b){return _0x4d6cc4[_0x25c4('0x26')](_0x57be8f)[_0x25c4('0x28')](_0x2fad9b);}};}function respondWithFilteredResult(_0x261de2,_0x22dd54){return function(_0x3c7206){if(_0x3c7206){var _0x2bd99a=_0x3c7206[_0x25c4('0x29')],_0x23b39a=_0x22dd54[_0x25c4('0x2a')],_0x2ae856=_0x22dd54[_0x25c4('0x2a')]+_0x22dd54['limit'],_0x2c2204;if(_0x2ae856>=_0x2bd99a){_0x2ae856=_0x2bd99a;_0x2c2204=0xc8;}else{_0x2c2204=0xce;}_0x261de2[_0x25c4('0x26')](_0x2c2204);return _0x261de2[_0x25c4('0x2b')]('Content-Range',_0x23b39a+'-'+_0x2ae856+'/'+_0x2bd99a)['json'](_0x3c7206);}return null;};}function patchUpdates(_0x2baea4){return function(_0x33f3b9){try{jsonpatch[_0x25c4('0x2c')](_0x33f3b9,_0x2baea4,!![]);}catch(_0x11f8b5){return BPromise[_0x25c4('0x2d')](_0x11f8b5);}return _0x33f3b9['save']();};}function saveUpdates(_0x1109fc,_0x4e083b){return function(_0x346632){if(_0x346632){return _0x346632[_0x25c4('0x2e')](_0x1109fc)[_0x25c4('0x1c')](function(_0x540897){return _0x540897;});}return null;};}function removeEntity(_0x2b9d17,_0x101ea2){return function(_0x47e736){if(_0x47e736){return _0x47e736[_0x25c4('0x2f')]()[_0x25c4('0x1c')](function(){_0x2b9d17[_0x25c4('0x26')](0xcc)[_0x25c4('0x27')]();});}};}function handleEntityNotFound(_0x12b9f0,_0x50850e){return function(_0x132c0d){if(!_0x132c0d){_0x12b9f0[_0x25c4('0x30')](0x194);}return _0x132c0d;};}function handleError(_0x2cf5fa,_0x26b7a2){_0x26b7a2=_0x26b7a2||0x1f4;return function(_0x4c1094){logger[_0x25c4('0x22')](_0x4c1094[_0x25c4('0x31')]);if(_0x4c1094[_0x25c4('0x32')]){delete _0x4c1094['name'];}_0x2cf5fa['status'](_0x26b7a2)['send'](_0x4c1094);};}exports[_0x25c4('0x33')]=function(_0x958d8b,_0x5e5ea2){var _0x333de4={},_0x24258a={},_0x1a65d2={'count':0x0,'rows':[]};var _0x22dc06=_['map'](db[_0x25c4('0x34')]['rawAttributes'],function(_0x189e0b){return{'name':_0x189e0b[_0x25c4('0x35')],'type':_0x189e0b['type']['key']};});_0x24258a[_0x25c4('0x36')]=_['map'](_0x22dc06,_0x25c4('0x32'));_0x24258a[_0x25c4('0x37')]=_[_0x25c4('0x38')](_0x958d8b['query']);_0x24258a[_0x25c4('0x39')]=_[_0x25c4('0x3a')](_0x24258a[_0x25c4('0x36')],_0x24258a[_0x25c4('0x37')]);_0x333de4['attributes']=_[_0x25c4('0x3a')](_0x24258a[_0x25c4('0x36')],qs['fields'](_0x958d8b[_0x25c4('0x37')][_0x25c4('0x3b')]));_0x333de4[_0x25c4('0x3c')]=_0x333de4['attributes'][_0x25c4('0x3d')]?_0x333de4[_0x25c4('0x3c')]:_0x24258a[_0x25c4('0x36')];if(!_0x958d8b[_0x25c4('0x37')][_0x25c4('0x3e')]('nolimit')){_0x333de4[_0x25c4('0x3f')]=qs[_0x25c4('0x3f')](_0x958d8b['query'][_0x25c4('0x3f')]);_0x333de4[_0x25c4('0x2a')]=qs[_0x25c4('0x2a')](_0x958d8b[_0x25c4('0x37')]['offset']);}_0x333de4[_0x25c4('0x40')]=qs[_0x25c4('0x41')](_0x958d8b[_0x25c4('0x37')][_0x25c4('0x41')]);_0x333de4[_0x25c4('0x42')]=qs[_0x25c4('0x39')](_['pick'](_0x958d8b[_0x25c4('0x37')],_0x24258a[_0x25c4('0x39')]));if(_0x958d8b[_0x25c4('0x37')][_0x25c4('0x43')]){_0x333de4['where']=_['merge'](_0x333de4[_0x25c4('0x42')],{'$or':_['map'](_0x22dc06,function(_0x385cef){if(_0x385cef[_0x25c4('0x44')][_0x25c4('0x45')]!==_0x25c4('0x46')){var _0xb1ee3f={};_0xb1ee3f[_0x385cef['field']]={'$like':'%'+_0x958d8b[_0x25c4('0x37')][_0x25c4('0x43')]+'%'};return _0xb1ee3f;}})});}_0x333de4=_['merge']({},_0x333de4,_0x958d8b[_0x25c4('0x47')]);var _0x338855={'where':_0x333de4[_0x25c4('0x42')]};return db[_0x25c4('0x34')]['count'](_0x338855)[_0x25c4('0x1c')](function(_0x54d8d9){_0x1a65d2['count']=_0x54d8d9;if(_0x958d8b[_0x25c4('0x37')][_0x25c4('0x48')]){_0x333de4['include']=[{'all':!![]}];}return db[_0x25c4('0x34')]['findAll'](_0x333de4);})[_0x25c4('0x1c')](function(_0x4333fc){_0x1a65d2[_0x25c4('0x49')]=_0x4333fc;return _0x1a65d2;})['then'](respondWithFilteredResult(_0x5e5ea2,_0x333de4))[_0x25c4('0x4a')](handleError(_0x5e5ea2,null));};exports[_0x25c4('0x4b')]=function(_0x41ab46,_0x23c3ba){var _0x5417c7={'raw':![],'where':{'id':_0x41ab46['params']['id']}},_0x269222={};_0x269222[_0x25c4('0x36')]=_[_0x25c4('0x38')](db[_0x25c4('0x34')][_0x25c4('0x4c')]);_0x269222[_0x25c4('0x37')]=_[_0x25c4('0x38')](_0x41ab46['query']);_0x269222[_0x25c4('0x39')]=_['intersection'](_0x269222['model'],_0x269222[_0x25c4('0x37')]);_0x5417c7['attributes']=_[_0x25c4('0x3a')](_0x269222[_0x25c4('0x36')],qs['fields'](_0x41ab46[_0x25c4('0x37')][_0x25c4('0x3b')]));_0x5417c7['attributes']=_0x5417c7[_0x25c4('0x3c')][_0x25c4('0x3d')]?_0x5417c7['attributes']:_0x269222[_0x25c4('0x36')];if(_0x41ab46[_0x25c4('0x37')][_0x25c4('0x48')]){_0x5417c7[_0x25c4('0x4d')]=[{'all':!![]}];}_0x5417c7=_['merge']({},_0x5417c7,_0x41ab46[_0x25c4('0x47')]);return db[_0x25c4('0x34')][_0x25c4('0x4e')](_0x5417c7)[_0x25c4('0x1c')](handleEntityNotFound(_0x23c3ba,null))[_0x25c4('0x1c')](respondWithResult(_0x23c3ba,null))[_0x25c4('0x4a')](handleError(_0x23c3ba,null));};exports[_0x25c4('0x4f')]=function(_0xe9958d,_0x26b2e7){return db[_0x25c4('0x34')][_0x25c4('0x4f')](_0xe9958d[_0x25c4('0x50')],{})[_0x25c4('0x1c')](respondWithResult(_0x26b2e7,0xc9))[_0x25c4('0x4a')](handleError(_0x26b2e7,null));};exports['update']=function(_0x1e9e41,_0x3badc0){if(_0x1e9e41[_0x25c4('0x50')]['id']){delete _0x1e9e41[_0x25c4('0x50')]['id'];}return db['SugarcrmAccount'][_0x25c4('0x4e')]({'where':{'id':_0x1e9e41[_0x25c4('0x51')]['id']}})[_0x25c4('0x1c')](handleEntityNotFound(_0x3badc0,null))[_0x25c4('0x1c')](saveUpdates(_0x1e9e41[_0x25c4('0x50')],null))[_0x25c4('0x1c')](respondWithResult(_0x3badc0,null))['catch'](handleError(_0x3badc0,null));};exports[_0x25c4('0x2f')]=function(_0x5293eb,_0x2d557d){return db['SugarcrmAccount'][_0x25c4('0x4e')]({'where':{'id':_0x5293eb['params']['id']}})['then'](handleEntityNotFound(_0x2d557d,null))[_0x25c4('0x1c')](removeEntity(_0x2d557d,null))['catch'](handleError(_0x2d557d,null));};exports[_0x25c4('0x52')]=function(_0xcddc28,_0x506dfb,_0x3eadf0){var _0x8dcd26={};var _0x1ec0f5={};var _0x2abc03;var _0x22299c;return db[_0x25c4('0x34')][_0x25c4('0x53')]({'where':{'id':_0xcddc28[_0x25c4('0x51')]['id']}})[_0x25c4('0x1c')](handleEntityNotFound(_0x506dfb,null))['then'](function(_0x192083){if(_0x192083){_0x2abc03=_0x192083;_0x1ec0f5[_0x25c4('0x36')]=_[_0x25c4('0x38')](db['SugarcrmConfiguration'][_0x25c4('0x4c')]);_0x1ec0f5[_0x25c4('0x37')]=_[_0x25c4('0x38')](_0xcddc28[_0x25c4('0x37')]);_0x1ec0f5['filters']=_[_0x25c4('0x3a')](_0x1ec0f5[_0x25c4('0x36')],_0x1ec0f5[_0x25c4('0x37')]);_0x8dcd26[_0x25c4('0x3c')]=_['intersection'](_0x1ec0f5[_0x25c4('0x36')],qs['fields'](_0xcddc28[_0x25c4('0x37')][_0x25c4('0x3b')]));_0x8dcd26[_0x25c4('0x3c')]=_0x8dcd26[_0x25c4('0x3c')][_0x25c4('0x3d')]?_0x8dcd26['attributes']:_0x1ec0f5['model'];_0x8dcd26[_0x25c4('0x40')]=qs[_0x25c4('0x41')](_0xcddc28[_0x25c4('0x37')]['sort']);_0x8dcd26['where']=qs['filters'](_[_0x25c4('0x54')](_0xcddc28[_0x25c4('0x37')],_0x1ec0f5['filters']));if(_0xcddc28[_0x25c4('0x37')][_0x25c4('0x43')]){_0x8dcd26[_0x25c4('0x42')]=_[_0x25c4('0x55')](_0x8dcd26[_0x25c4('0x42')],{'$or':_[_0x25c4('0x56')](_0x8dcd26[_0x25c4('0x3c')],function(_0x371407){var _0x584362={};_0x584362[_0x371407]={'$like':'%'+_0xcddc28[_0x25c4('0x37')][_0x25c4('0x43')]+'%'};return _0x584362;})});}_0x8dcd26=_['merge']({},_0x8dcd26,_0xcddc28[_0x25c4('0x47')]);return _0x2abc03['getConfigurations'](_0x8dcd26);}})[_0x25c4('0x1c')](function(_0x54f14f){if(_0x54f14f){_0x22299c=_0x54f14f[_0x25c4('0x3d')];if(!_0xcddc28[_0x25c4('0x37')]['hasOwnProperty'](_0x25c4('0x57'))){_0x8dcd26[_0x25c4('0x3f')]=qs[_0x25c4('0x3f')](_0xcddc28['query'][_0x25c4('0x3f')]);_0x8dcd26[_0x25c4('0x2a')]=qs['offset'](_0xcddc28[_0x25c4('0x37')]['offset']);}return _0x2abc03[_0x25c4('0x52')](_0x8dcd26);}})[_0x25c4('0x1c')](function(_0x149fe5){if(_0x149fe5){return _0x149fe5?{'count':_0x22299c,'rows':_0x149fe5}:null;}})[_0x25c4('0x1c')](respondWithResult(_0x506dfb,null))['catch'](handleError(_0x506dfb,null));};exports['addConfiguration']=function(_0x2a4544,_0x53c8ca,_0x561b54){if(_0x2a4544['body']['id']){delete _0x2a4544[_0x25c4('0x50')]['id'];}return db[_0x25c4('0x34')][_0x25c4('0x53')]({'where':{'id':_0x2a4544[_0x25c4('0x51')]['id']}})[_0x25c4('0x1c')](handleEntityNotFound(_0x53c8ca,null))[_0x25c4('0x1c')](function(_0x386b38){if(_0x386b38){_0x2a4544['body']['AccountId']=_0x386b38['id'];_0x2a4544[_0x25c4('0x50')]['Subjects']=integrations['getSubjects'](_0x2a4544[_0x25c4('0x50')]['channel'],_0x2a4544['body'][_0x25c4('0x44')]);_0x2a4544['body']['Descriptions']=integrations[_0x25c4('0x58')](_0x2a4544[_0x25c4('0x50')]['channel'],_0x2a4544[_0x25c4('0x50')][_0x25c4('0x44')]);return db[_0x25c4('0x59')]['create'](_0x2a4544[_0x25c4('0x50')],{'include':[{'model':db[_0x25c4('0x5a')],'as':'Subjects'},{'model':db[_0x25c4('0x5a')],'as':_0x25c4('0x5b')}]});}return null;})[_0x25c4('0x1c')](respondWithResult(_0x53c8ca,null))[_0x25c4('0x4a')](handleError(_0x53c8ca,null));};exports[_0x25c4('0x5c')]=function(_0x31f5b8,_0x1c33e4,_0x247290){var _0x4420c3='';var _0x43882f=['id',_0x25c4('0x32'),_0x25c4('0x5d'),_0x25c4('0x5e'),_0x25c4('0x5f'),'date_start','duration_hours',_0x25c4('0x60'),_0x25c4('0x61'),_0x25c4('0x62'),_0x25c4('0x63'),_0x25c4('0x64')];return db[_0x25c4('0x34')][_0x25c4('0x53')]({'where':{'id':_0x31f5b8['params']['id']},'attributes':['id',_0x25c4('0x65'),_0x25c4('0x66'),'remoteUri']})[_0x25c4('0x1c')](handleEntityNotFound(_0x1c33e4,null))[_0x25c4('0x1c')](function(_0x4a56bb){if(_0x4a56bb){_0x4420c3=_0x4a56bb['remoteUri'];var _0x194979=_0x4420c3[_0x25c4('0x67')](-0x1);if(_0x194979==='/'){_0x4420c3=_0x4420c3[_0x25c4('0x68')](0x0,_0x4420c3[_0x25c4('0x69')](_0x194979));}return rp({'method':_0x25c4('0x6a'),'uri':util[_0x25c4('0x6b')]('%s%s',_0x4420c3,_0x25c4('0x6c')),'json':!![],'form':{'method':'login','input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x25c4('0x21')]({'user_auth':{'user_name':_0x4a56bb[_0x25c4('0x65')],'password':_0x4a56bb[_0x25c4('0x66')],'encryption':_0x25c4('0x6d')},'application':'xCALLY\x20Motion\x20Integration'})}});}})[_0x25c4('0x1c')](function(_0x3d0daf){if(_0x3d0daf&&_0x3d0daf[_0x25c4('0x32')]!==_0x25c4('0x6e')&&_0x3d0daf[_0x25c4('0x32')]!==_0x25c4('0x6f')){return rp({'method':_0x25c4('0x6a'),'uri':util[_0x25c4('0x6b')](_0x25c4('0x70'),_0x4420c3,_0x25c4('0x6c')),'json':!![],'form':{'method':_0x25c4('0x71'),'input_type':'JSON','response_type':_0x25c4('0x72'),'rest_data':JSON['stringify']({'session':_0x3d0daf['id'],'module_name':_0x25c4('0x73')})}})['then'](function(_0x1d4eb5){if(_0x1d4eb5){var _0x28f2d9=_[_0x25c4('0x74')](_0x1d4eb5[_0x25c4('0x75')]);_[_0x25c4('0x76')](_0x28f2d9,function(_0x354fea){return _0x43882f[_0x25c4('0x77')](_0x354fea[_0x25c4('0x32')]);});return{'count':_0x28f2d9['length'],'rows':_[_0x25c4('0x56')](_0x28f2d9,function(_0x30c6fb){return{'id':_0x30c6fb[_0x25c4('0x32')],'name':_0x30c6fb[_0x25c4('0x78')],'custom':_[_0x25c4('0x79')](_0x30c6fb[_0x25c4('0x32')],'_c')?!![]:![],'options':_0x30c6fb['options']?_[_0x25c4('0x56')](_[_0x25c4('0x74')](_0x30c6fb[_0x25c4('0x47')]),function(_0x2cfd4a){return{'name':_0x2cfd4a[_0x25c4('0x7a')],'value':_0x2cfd4a[_0x25c4('0x32')]};}):[]};})};}})['then'](respondWithResult(_0x1c33e4,null))[_0x25c4('0x4a')](function(_0xec886){var _0x57dc01=_0x31f5b8['query'][_0x25c4('0x7b')]?0x1f4:_0xec886[_0x25c4('0x7c')]||0x1f4;logger['error'](_0x25c4('0x7d'),'getFields',_0x57dc01,JSON['stringify'](_0xec886));delete _0xec886[_0x25c4('0x32')];if(_0x57dc01===0x191){_0x57dc01=0x190;}_0x1c33e4[_0x25c4('0x26')](_0x57dc01)['send'](_0x31f5b8['query'][_0x25c4('0x7b')]?{'message':_0x25c4('0x7e'),'statusCode':_0xec886['statusCode']}:_0xec886);});}else{var _0x4b5905=0x1f4;_0x1c33e4[_0x25c4('0x26')](_0x4b5905)[_0x25c4('0x7f')]({'message':_0x25c4('0x7e'),'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 3071f97..a5a3c72 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 _0x92b9=['../../config/environment','./intSugarcrmAccount.attributes','exports','SugarcrmAccount','int_sugarcrm_accounts','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x126c5c,_0x2143eb){var _0x418412=function(_0x3c1567){while(--_0x3c1567){_0x126c5c['push'](_0x126c5c['shift']());}};_0x418412(++_0x2143eb);}(_0x92b9,0x13d));var _0x992b=function(_0x1ebf97,_0x510a3d){_0x1ebf97=_0x1ebf97-0x0;var _0x2bd171=_0x92b9[_0x1ebf97];return _0x2bd171;};'use strict';var _=require('lodash');var util=require(_0x992b('0x0'));var logger=require(_0x992b('0x1'))(_0x992b('0x2'));var moment=require(_0x992b('0x3'));var BPromise=require(_0x992b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x992b('0x5'));var rimraf=require(_0x992b('0x6'));var config=require(_0x992b('0x7'));var attributes=require(_0x992b('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x992b('0x9')]=function(_0x550896,_0x450c6f){return _0x550896['define'](_0x992b('0xa'),attributes,{'tableName':_0x992b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3d81=['path','rimraf','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','../../config/logger','api','bluebird'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x3d81,0x1dc));var _0x13d8=function(_0x13e4fd,_0x578d43){_0x13e4fd=_0x13e4fd-0x0;var _0x1055ef=_0x3d81[_0x13e4fd];return _0x1055ef;};'use strict';var _=require(_0x13d8('0x0'));var util=require(_0x13d8('0x1'));var logger=require(_0x13d8('0x2'))(_0x13d8('0x3'));var moment=require('moment');var BPromise=require(_0x13d8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x13d8('0x5'));var rimraf=require(_0x13d8('0x6'));var config=require('../../config/environment');var attributes=require(_0x13d8('0x7'));var integrations=require(_0x13d8('0x8'));module[_0x13d8('0x9')]=function(_0x37077a,_0x3eea70){return _0x37077a[_0x13d8('0xa')](_0x13d8('0xb'),attributes,{'tableName':_0x13d8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js index 12a1eec..68a5567 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 _0x6fcc=['findAll','options','raw','attributes','limit','include','model','map','ShowSugarcrmAccount','find','where','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetSugarcrmAccount','SugarcrmAccount'];(function(_0x71d11c,_0x1d0994){var _0x4664f6=function(_0xbd11b0){while(--_0xbd11b0){_0x71d11c['push'](_0x71d11c['shift']());}};_0x4664f6(++_0x1d0994);}(_0x6fcc,0x14f));var _0xc6fc=function(_0xc048e2,_0x3825ef){_0xc048e2=_0xc048e2-0x0;var _0x4012ed=_0x6fcc[_0xc048e2];return _0x4012ed;};'use strict';var _=require('lodash');var util=require(_0xc6fc('0x0'));var moment=require(_0xc6fc('0x1'));var BPromise=require(_0xc6fc('0x2'));var rs=require(_0xc6fc('0x3'));var fs=require('fs');var Redis=require(_0xc6fc('0x4'));var db=require(_0xc6fc('0x5'))['db'];var utils=require(_0xc6fc('0x6'));var logger=require(_0xc6fc('0x7'))(_0xc6fc('0x8'));var config=require('../../config/environment');var jayson=require(_0xc6fc('0x9'));var client=jayson['client'][_0xc6fc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5c91e1,_0x19bc5b,_0x5649eb){return new BPromise(function(_0xe7e3cf,_0x5551d1){return client[_0xc6fc('0xb')](_0x5c91e1,_0x5649eb)[_0xc6fc('0xc')](function(_0x5e64ff){logger[_0xc6fc('0xd')](_0xc6fc('0xe'),_0x19bc5b,_0xc6fc('0xf'));logger[_0xc6fc('0x10')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x19bc5b,'request\x20sent',JSON[_0xc6fc('0x11')](_0x5e64ff));if(_0x5e64ff[_0xc6fc('0x12')]){if(_0x5e64ff[_0xc6fc('0x12')][_0xc6fc('0x13')]===0x1f4){logger[_0xc6fc('0x12')](_0xc6fc('0xe'),_0x19bc5b,_0x5e64ff['error'][_0xc6fc('0x14')]);return _0x5551d1(_0x5e64ff[_0xc6fc('0x12')]['message']);}logger[_0xc6fc('0x12')](_0xc6fc('0xe'),_0x19bc5b,_0x5e64ff[_0xc6fc('0x12')][_0xc6fc('0x14')]);return _0xe7e3cf(_0x5e64ff[_0xc6fc('0x12')][_0xc6fc('0x14')]);}else{logger[_0xc6fc('0xd')](_0xc6fc('0xe'),_0x19bc5b,_0xc6fc('0xf'));_0xe7e3cf(_0x5e64ff[_0xc6fc('0x15')][_0xc6fc('0x14')]);}})[_0xc6fc('0x16')](function(_0x41fe10){logger[_0xc6fc('0x12')](_0xc6fc('0xe'),_0x19bc5b,_0x41fe10);_0x5551d1(_0x41fe10);});});}exports[_0xc6fc('0x17')]=function(_0xc344b8){var _0x6d9fa5=this;return new Promise(function(_0x337c70,_0x5b05f4){return db[_0xc6fc('0x18')][_0xc6fc('0x19')]({'raw':_0xc344b8[_0xc6fc('0x1a')]?_0xc344b8[_0xc6fc('0x1a')][_0xc6fc('0x1b')]===undefined?!![]:![]:!![],'where':_0xc344b8[_0xc6fc('0x1a')]?_0xc344b8[_0xc6fc('0x1a')]['where']||null:null,'attributes':_0xc344b8[_0xc6fc('0x1a')]?_0xc344b8[_0xc6fc('0x1a')][_0xc6fc('0x1c')]||null:null,'limit':_0xc344b8[_0xc6fc('0x1a')]?_0xc344b8['options'][_0xc6fc('0x1d')]||null:null,'include':_0xc344b8[_0xc6fc('0x1a')]?_0xc344b8['options']['include']?_['map'](_0xc344b8[_0xc6fc('0x1a')][_0xc6fc('0x1e')],function(_0xa1f5aa){return{'model':db[_0xa1f5aa[_0xc6fc('0x1f')]],'as':_0xa1f5aa['as'],'attributes':_0xa1f5aa[_0xc6fc('0x1c')],'include':_0xa1f5aa[_0xc6fc('0x1e')]?_[_0xc6fc('0x20')](_0xa1f5aa[_0xc6fc('0x1e')],function(_0x4178bd){return{'model':db[_0x4178bd[_0xc6fc('0x1f')]],'as':_0x4178bd['as'],'attributes':_0x4178bd[_0xc6fc('0x1c')],'include':_0x4178bd[_0xc6fc('0x1e')]?_['map'](_0x4178bd[_0xc6fc('0x1e')],function(_0x3404cc){return{'model':db[_0x3404cc['model']],'as':_0x3404cc['as'],'attributes':_0x3404cc[_0xc6fc('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xc6fc('0xc')](function(_0xf85469){logger['info'](_0xc6fc('0x17'),_0xc344b8);logger[_0xc6fc('0x10')]('GetSugarcrmAccount',_0xc344b8,JSON['stringify'](_0xf85469));_0x337c70(_0xf85469);})[_0xc6fc('0x16')](function(_0x4244f7){logger['error']('GetSugarcrmAccount',_0x4244f7[_0xc6fc('0x14')],_0xc344b8);_0x5b05f4(_0x6d9fa5[_0xc6fc('0x12')](0x1f4,_0x4244f7['message']));});});};exports[_0xc6fc('0x21')]=function(_0x1c83d9){var _0xd16b14=this;return new Promise(function(_0x5d5d31,_0xe478ff){return db[_0xc6fc('0x18')][_0xc6fc('0x22')]({'raw':_0x1c83d9[_0xc6fc('0x1a')]?_0x1c83d9['options'][_0xc6fc('0x1b')]===undefined?!![]:![]:!![],'where':_0x1c83d9['options']?_0x1c83d9[_0xc6fc('0x1a')][_0xc6fc('0x23')]||null:null,'attributes':_0x1c83d9[_0xc6fc('0x1a')]?_0x1c83d9[_0xc6fc('0x1a')]['attributes']||null:null,'include':_0x1c83d9[_0xc6fc('0x1a')]?_0x1c83d9[_0xc6fc('0x1a')]['include']?_[_0xc6fc('0x20')](_0x1c83d9[_0xc6fc('0x1a')][_0xc6fc('0x1e')],function(_0x4582e5){return{'model':db[_0x4582e5[_0xc6fc('0x1f')]],'as':_0x4582e5['as'],'attributes':_0x4582e5[_0xc6fc('0x1c')],'include':_0x4582e5[_0xc6fc('0x1e')]?_[_0xc6fc('0x20')](_0x4582e5[_0xc6fc('0x1e')],function(_0x242c4a){return{'model':db[_0x242c4a[_0xc6fc('0x1f')]],'as':_0x242c4a['as'],'attributes':_0x242c4a['attributes'],'include':_0x242c4a['include']?_[_0xc6fc('0x20')](_0x242c4a[_0xc6fc('0x1e')],function(_0x4dfd8e){return{'model':db[_0x4dfd8e[_0xc6fc('0x1f')]],'as':_0x4dfd8e['as'],'attributes':_0x4dfd8e[_0xc6fc('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xc6fc('0xc')](function(_0x3b60bd){logger[_0xc6fc('0xd')](_0xc6fc('0x21'),_0x1c83d9);logger[_0xc6fc('0x10')](_0xc6fc('0x21'),_0x1c83d9,JSON[_0xc6fc('0x11')](_0x3b60bd));_0x5d5d31(_0x3b60bd);})[_0xc6fc('0x16')](function(_0x19c037){logger[_0xc6fc('0x12')]('ShowSugarcrmAccount',_0x19c037[_0xc6fc('0x14')],_0x1c83d9);_0xe478ff(_0xd16b14[_0xc6fc('0x12')](0x1f4,_0x19c037[_0xc6fc('0x14')]));});});}; \ No newline at end of file +var _0xd9ae=['model','attributes','stringify','ShowSugarcrmAccount','find','util','moment','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where','include','map'];(function(_0x344288,_0x33215d){var _0x5b9349=function(_0x4c8db8){while(--_0x4c8db8){_0x344288['push'](_0x344288['shift']());}};_0x5b9349(++_0x33215d);}(_0xd9ae,0x1bf));var _0xed9a=function(_0x25128a,_0x40adf6){_0x25128a=_0x25128a-0x0;var _0x300793=_0xd9ae[_0x25128a];return _0x300793;};'use strict';var _=require('lodash');var util=require(_0xed9a('0x0'));var moment=require(_0xed9a('0x1'));var BPromise=require('bluebird');var rs=require(_0xed9a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xed9a('0x3'));var logger=require(_0xed9a('0x4'))(_0xed9a('0x5'));var config=require('../../config/environment');var jayson=require(_0xed9a('0x6'));var client=jayson[_0xed9a('0x7')][_0xed9a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xc044b6,_0x25874b,_0x2419de){return new BPromise(function(_0x5d2328,_0x958667){return client[_0xed9a('0x9')](_0xc044b6,_0x2419de)[_0xed9a('0xa')](function(_0x3c287d){logger[_0xed9a('0xb')](_0xed9a('0xc'),_0x25874b,'request\x20sent');logger[_0xed9a('0xd')](_0xed9a('0xe'),_0x25874b,_0xed9a('0xf'),JSON['stringify'](_0x3c287d));if(_0x3c287d['error']){if(_0x3c287d[_0xed9a('0x10')][_0xed9a('0x11')]===0x1f4){logger['error'](_0xed9a('0xc'),_0x25874b,_0x3c287d[_0xed9a('0x10')][_0xed9a('0x12')]);return _0x958667(_0x3c287d['error'][_0xed9a('0x12')]);}logger['error'](_0xed9a('0xc'),_0x25874b,_0x3c287d[_0xed9a('0x10')]['message']);return _0x5d2328(_0x3c287d[_0xed9a('0x10')][_0xed9a('0x12')]);}else{logger[_0xed9a('0xb')](_0xed9a('0xc'),_0x25874b,_0xed9a('0xf'));_0x5d2328(_0x3c287d[_0xed9a('0x13')][_0xed9a('0x12')]);}})[_0xed9a('0x14')](function(_0x3c19a5){logger[_0xed9a('0x10')](_0xed9a('0xc'),_0x25874b,_0x3c19a5);_0x958667(_0x3c19a5);});});}exports[_0xed9a('0x15')]=function(_0x965181){var _0x1a7d62=this;return new Promise(function(_0x2dc4a2,_0x5e745c){return db[_0xed9a('0x16')][_0xed9a('0x17')]({'raw':_0x965181[_0xed9a('0x18')]?_0x965181['options'][_0xed9a('0x19')]===undefined?!![]:![]:!![],'where':_0x965181['options']?_0x965181[_0xed9a('0x18')][_0xed9a('0x1a')]||null:null,'attributes':_0x965181[_0xed9a('0x18')]?_0x965181[_0xed9a('0x18')]['attributes']||null:null,'limit':_0x965181['options']?_0x965181[_0xed9a('0x18')]['limit']||null:null,'include':_0x965181[_0xed9a('0x18')]?_0x965181[_0xed9a('0x18')][_0xed9a('0x1b')]?_[_0xed9a('0x1c')](_0x965181[_0xed9a('0x18')][_0xed9a('0x1b')],function(_0xdb11f4){return{'model':db[_0xdb11f4[_0xed9a('0x1d')]],'as':_0xdb11f4['as'],'attributes':_0xdb11f4['attributes'],'include':_0xdb11f4[_0xed9a('0x1b')]?_[_0xed9a('0x1c')](_0xdb11f4[_0xed9a('0x1b')],function(_0x35847f){return{'model':db[_0x35847f['model']],'as':_0x35847f['as'],'attributes':_0x35847f[_0xed9a('0x1e')],'include':_0x35847f[_0xed9a('0x1b')]?_[_0xed9a('0x1c')](_0x35847f['include'],function(_0x122eda){return{'model':db[_0x122eda[_0xed9a('0x1d')]],'as':_0x122eda['as'],'attributes':_0x122eda[_0xed9a('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xed9a('0xa')](function(_0x407418){logger[_0xed9a('0xb')]('GetSugarcrmAccount',_0x965181);logger[_0xed9a('0xd')]('GetSugarcrmAccount',_0x965181,JSON[_0xed9a('0x1f')](_0x407418));_0x2dc4a2(_0x407418);})[_0xed9a('0x14')](function(_0x377b9f){logger[_0xed9a('0x10')](_0xed9a('0x15'),_0x377b9f[_0xed9a('0x12')],_0x965181);_0x5e745c(_0x1a7d62[_0xed9a('0x10')](0x1f4,_0x377b9f[_0xed9a('0x12')]));});});};exports[_0xed9a('0x20')]=function(_0x4bfe86){var _0x22bdd5=this;return new Promise(function(_0x2b7b04,_0x480a21){return db[_0xed9a('0x16')][_0xed9a('0x21')]({'raw':_0x4bfe86[_0xed9a('0x18')]?_0x4bfe86[_0xed9a('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x4bfe86['options']?_0x4bfe86[_0xed9a('0x18')][_0xed9a('0x1a')]||null:null,'attributes':_0x4bfe86[_0xed9a('0x18')]?_0x4bfe86[_0xed9a('0x18')][_0xed9a('0x1e')]||null:null,'include':_0x4bfe86[_0xed9a('0x18')]?_0x4bfe86[_0xed9a('0x18')][_0xed9a('0x1b')]?_[_0xed9a('0x1c')](_0x4bfe86[_0xed9a('0x18')][_0xed9a('0x1b')],function(_0x4a7fac){return{'model':db[_0x4a7fac[_0xed9a('0x1d')]],'as':_0x4a7fac['as'],'attributes':_0x4a7fac['attributes'],'include':_0x4a7fac['include']?_['map'](_0x4a7fac[_0xed9a('0x1b')],function(_0x1458cb){return{'model':db[_0x1458cb['model']],'as':_0x1458cb['as'],'attributes':_0x1458cb[_0xed9a('0x1e')],'include':_0x1458cb[_0xed9a('0x1b')]?_[_0xed9a('0x1c')](_0x1458cb[_0xed9a('0x1b')],function(_0x2c6189){return{'model':db[_0x2c6189['model']],'as':_0x2c6189['as'],'attributes':_0x2c6189['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x20d3a4){logger[_0xed9a('0xb')](_0xed9a('0x20'),_0x4bfe86);logger[_0xed9a('0xd')](_0xed9a('0x20'),_0x4bfe86,JSON['stringify'](_0x20d3a4));_0x2b7b04(_0x20d3a4);})['catch'](function(_0x45b1fc){logger[_0xed9a('0x10')](_0xed9a('0x20'),_0x45b1fc[_0xed9a('0x12')],_0x4bfe86);_0x480a21(_0x22bdd5[_0xed9a('0x10')](0x1f4,_0x45b1fc['message']));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 4c12334..f67cdad 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 _0xb2fc=['getFields','/:id/subjects','getSubjects','getDescriptions','post','create','put','/:id','update','delete','destroy','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','index','get','isAuthenticated','show'];(function(_0x45b1ba,_0x5a6a21){var _0x145ddb=function(_0x650d42){while(--_0x650d42){_0x45b1ba['push'](_0x45b1ba['shift']());}};_0x145ddb(++_0x5a6a21);}(_0xb2fc,0xda));var _0xcb2f=function(_0x241ee4,_0x11db28){_0x241ee4=_0x241ee4-0x0;var _0x4ac2e2=_0xb2fc[_0x241ee4];return _0x4ac2e2;};'use strict';var multer=require(_0xcb2f('0x0'));var util=require(_0xcb2f('0x1'));var path=require(_0xcb2f('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xcb2f('0x3')]();var auth=require(_0xcb2f('0x4'));var interaction=require(_0xcb2f('0x5'));var config=require(_0xcb2f('0x6'));var controller=require(_0xcb2f('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xcb2f('0x8')]);router[_0xcb2f('0x9')]('/:id',auth[_0xcb2f('0xa')](),controller[_0xcb2f('0xb')]);router[_0xcb2f('0x9')]('/:id/fields',auth[_0xcb2f('0xa')](),controller[_0xcb2f('0xc')]);router['get'](_0xcb2f('0xd'),auth[_0xcb2f('0xa')](),controller[_0xcb2f('0xe')]);router[_0xcb2f('0x9')]('/:id/descriptions',auth[_0xcb2f('0xa')](),controller[_0xcb2f('0xf')]);router[_0xcb2f('0x10')]('/',auth[_0xcb2f('0xa')](),controller[_0xcb2f('0x11')]);router[_0xcb2f('0x12')](_0xcb2f('0x13'),auth[_0xcb2f('0xa')](),controller[_0xcb2f('0x14')]);router[_0xcb2f('0x15')](_0xcb2f('0x13'),auth[_0xcb2f('0xa')](),controller[_0xcb2f('0x16')]);module['exports']=router; \ No newline at end of file +var _0x79cb=['/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','getFields'];(function(_0x1ca6c5,_0x48502b){var _0x2b0f16=function(_0x1fa425){while(--_0x1fa425){_0x1ca6c5['push'](_0x1ca6c5['shift']());}};_0x2b0f16(++_0x48502b);}(_0x79cb,0x127));var _0xb79c=function(_0xd40212,_0xcb44a9){_0xd40212=_0xd40212-0x0;var _0x1aa203=_0x79cb[_0xd40212];return _0x1aa203;};'use strict';var multer=require('multer');var util=require(_0xb79c('0x0'));var path=require(_0xb79c('0x1'));var timeout=require(_0xb79c('0x2'));var express=require(_0xb79c('0x3'));var router=express[_0xb79c('0x4')]();var auth=require(_0xb79c('0x5'));var interaction=require(_0xb79c('0x6'));var config=require(_0xb79c('0x7'));var controller=require('./intSugarcrmConfiguration.controller');router[_0xb79c('0x8')]('/',auth['isAuthenticated'](),controller[_0xb79c('0x9')]);router[_0xb79c('0x8')](_0xb79c('0xa'),auth[_0xb79c('0xb')](),controller['show']);router[_0xb79c('0x8')]('/:id/fields',auth[_0xb79c('0xb')](),controller[_0xb79c('0xc')]);router[_0xb79c('0x8')](_0xb79c('0xd'),auth[_0xb79c('0xb')](),controller[_0xb79c('0xe')]);router[_0xb79c('0x8')](_0xb79c('0xf'),auth[_0xb79c('0xb')](),controller[_0xb79c('0x10')]);router['post']('/',auth[_0xb79c('0xb')](),controller[_0xb79c('0x11')]);router[_0xb79c('0x12')]('/:id',auth[_0xb79c('0xb')](),controller['update']);router[_0xb79c('0x13')](_0xb79c('0xa'),auth[_0xb79c('0xb')](),controller[_0xb79c('0x14')]);module[_0xb79c('0x15')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 29a6414..5b669ef 100644 --- a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js +++ b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbb2d=['sequelize','exports','STRING'];(function(_0x2b26d9,_0x2e53f6){var _0xf6fff9=function(_0x5a003a){while(--_0x5a003a){_0x2b26d9['push'](_0x2b26d9['shift']());}};_0xf6fff9(++_0x2e53f6);}(_0xbb2d,0x159));var _0xdbb2=function(_0x16dbcd,_0x274516){_0x16dbcd=_0x16dbcd-0x0;var _0x34706e=_0xbb2d[_0x16dbcd];return _0x34706e;};'use strict';var Sequelize=require(_0xdbb2('0x0'));module[_0xdbb2('0x1')]={'name':{'type':Sequelize[_0xdbb2('0x2')]},'description':{'type':Sequelize[_0xdbb2('0x2')]}}; \ No newline at end of file +var _0xb33b=['STRING'];(function(_0x56dfeb,_0x950b38){var _0x3196f1=function(_0x31e707){while(--_0x31e707){_0x56dfeb['push'](_0x56dfeb['shift']());}};_0x3196f1(++_0x950b38);}(_0xb33b,0x1b0));var _0xbb33=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb33b[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xbb33('0x0')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index dfffca5..f59a241 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 _0x267b=['fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','field','options','includeAll','include','findAll','rows','params','rawAttributes','find','create','body','update','destroy','getFields','findOne','SugarcrmField','getSubjects','nolimit','getDescriptions','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','jayson/promise','http','test','request','info','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','SugarcrmConfiguration,\x20%s,\x20%s','message','result','catch','status','count','offset','limit','set','Content-Range','json','reject','save','then','end','sendStatus','stack','name','send','index','map','SugarcrmConfiguration','fieldName','type','key','model','query','keys','filters','intersection','attributes'];(function(_0x3b918b,_0x2edc55){var _0x57d988=function(_0x1a4463){while(--_0x1a4463){_0x3b918b['push'](_0x3b918b['shift']());}};_0x57d988(++_0x2edc55);}(_0x267b,0x130));var _0xb267=function(_0x13892d,_0x5c382e){_0x13892d=_0x13892d-0x0;var _0x3bdf63=_0x267b[_0x13892d];return _0x3bdf63;};'use strict';var pdf=require(_0xb267('0x0'));var emlformat=require(_0xb267('0x1'));var rimraf=require(_0xb267('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb267('0x3'));var rp=require(_0xb267('0x4'));var moment=require(_0xb267('0x5'));var BPromise=require(_0xb267('0x6'));var Mustache=require(_0xb267('0x7'));var util=require('util');var path=require(_0xb267('0x8'));var sox=require('sox');var csv=require(_0xb267('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb267('0xa'));var squel=require(_0xb267('0xb'));var crypto=require(_0xb267('0xc'));var jsforce=require(_0xb267('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb267('0x9'));var querystring=require(_0xb267('0xe'));var Papa=require(_0xb267('0xf'));var Redis=require(_0xb267('0x10'));var authService=require(_0xb267('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xb267('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb267('0x13'))('api');var utils=require(_0xb267('0x14'));var config=require('../../config/environment');var db=require(_0xb267('0x15'))['db'];var jayson=require(_0xb267('0x16'));var client=jayson['client'][_0xb267('0x17')]({'port':0x232a});function checkPasswordPattern(_0x3062d1,_0x3c050b,_0x31f39){if(_0x31f39){var _0x2dacbe=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2dacbe[_0xb267('0x18')](_0x3c050b)){return _0x3062d1;}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 _0x3062d1;}}function respondWithRpcPromise(_0x578ca0,_0x267306,_0x1f1e39,_0x598f9c){return new BPromise(function(_0x33d7e6,_0x2c85f4){var _0x2acce1=_0x598f9c||client;return _0x2acce1[_0xb267('0x19')](_0x578ca0,_0x1f1e39)['then'](function(_0x426aac){logger[_0xb267('0x1a')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x267306,_0xb267('0x1b'));logger[_0xb267('0x1c')](_0xb267('0x1d'),_0x267306,_0xb267('0x1b'),JSON[_0xb267('0x1e')](_0x426aac));if(_0x426aac[_0xb267('0x1f')]){if(_0x426aac['error'][_0xb267('0x20')]===0x1f4){logger[_0xb267('0x1f')](_0xb267('0x21'),_0x267306,_0x426aac[_0xb267('0x1f')][_0xb267('0x22')]);return _0x2c85f4(_0x426aac[_0xb267('0x1f')]['message']);}logger['error'](_0xb267('0x21'),_0x267306,_0x426aac[_0xb267('0x1f')][_0xb267('0x22')]);return _0x33d7e6(_0x426aac['error'][_0xb267('0x22')]);}else{logger[_0xb267('0x1a')](_0xb267('0x21'),_0x267306,_0xb267('0x1b'));_0x33d7e6(_0x426aac[_0xb267('0x23')][_0xb267('0x22')]);}})[_0xb267('0x24')](function(_0x161b99){logger[_0xb267('0x1f')](_0xb267('0x21'),_0x267306,_0x161b99);_0x2c85f4(_0x161b99);});});}function respondWithStatusCode(_0x4befc0,_0x4eca08){_0x4eca08=_0x4eca08||0xcc;return function(_0x4ebeef){if(_0x4ebeef){return _0x4befc0['sendStatus'](_0x4eca08);}return _0x4befc0[_0xb267('0x25')](_0x4eca08)['end']();};}function respondWithResult(_0x39fac7,_0x86b53e){_0x86b53e=_0x86b53e||0xc8;return function(_0x48be09){if(_0x48be09){return _0x39fac7['status'](_0x86b53e)['json'](_0x48be09);}};}function respondWithFilteredResult(_0x512c7f,_0x5625a2){return function(_0x56bbd6){if(_0x56bbd6){var _0x2e0eb0=_0x56bbd6[_0xb267('0x26')],_0xd7d19b=_0x5625a2[_0xb267('0x27')],_0x3bc69e=_0x5625a2[_0xb267('0x27')]+_0x5625a2[_0xb267('0x28')],_0x196c00;if(_0x3bc69e>=_0x2e0eb0){_0x3bc69e=_0x2e0eb0;_0x196c00=0xc8;}else{_0x196c00=0xce;}_0x512c7f[_0xb267('0x25')](_0x196c00);return _0x512c7f[_0xb267('0x29')](_0xb267('0x2a'),_0xd7d19b+'-'+_0x3bc69e+'/'+_0x2e0eb0)[_0xb267('0x2b')](_0x56bbd6);}return null;};}function patchUpdates(_0x3b493f){return function(_0x201486){try{jsonpatch['apply'](_0x201486,_0x3b493f,!![]);}catch(_0x470be8){return BPromise[_0xb267('0x2c')](_0x470be8);}return _0x201486[_0xb267('0x2d')]();};}function saveUpdates(_0x3e25b4,_0x43f87a){return function(_0x4f4bff){if(_0x4f4bff){return _0x4f4bff['update'](_0x3e25b4)[_0xb267('0x2e')](function(_0x944b6){return _0x944b6;});}return null;};}function removeEntity(_0x4f2d8d,_0x8bb4a3){return function(_0x174e51){if(_0x174e51){return _0x174e51['destroy']()[_0xb267('0x2e')](function(){_0x4f2d8d[_0xb267('0x25')](0xcc)[_0xb267('0x2f')]();});}};}function handleEntityNotFound(_0x4bdfd5,_0x54fdca){return function(_0x8b65ae){if(!_0x8b65ae){_0x4bdfd5[_0xb267('0x30')](0x194);}return _0x8b65ae;};}function handleError(_0xd48857,_0x4af836){_0x4af836=_0x4af836||0x1f4;return function(_0x2b2f99){logger['error'](_0x2b2f99[_0xb267('0x31')]);if(_0x2b2f99[_0xb267('0x32')]){delete _0x2b2f99['name'];}_0xd48857[_0xb267('0x25')](_0x4af836)[_0xb267('0x33')](_0x2b2f99);};}exports[_0xb267('0x34')]=function(_0x17d154,_0x12ed5a){var _0x403881={},_0xd0d8c0={},_0x972b66={'count':0x0,'rows':[]};var _0x36e481=_[_0xb267('0x35')](db[_0xb267('0x36')]['rawAttributes'],function(_0x580ac1){return{'name':_0x580ac1[_0xb267('0x37')],'type':_0x580ac1[_0xb267('0x38')][_0xb267('0x39')]};});_0xd0d8c0[_0xb267('0x3a')]=_['map'](_0x36e481,_0xb267('0x32'));_0xd0d8c0[_0xb267('0x3b')]=_[_0xb267('0x3c')](_0x17d154[_0xb267('0x3b')]);_0xd0d8c0[_0xb267('0x3d')]=_[_0xb267('0x3e')](_0xd0d8c0[_0xb267('0x3a')],_0xd0d8c0[_0xb267('0x3b')]);_0x403881[_0xb267('0x3f')]=_[_0xb267('0x3e')](_0xd0d8c0[_0xb267('0x3a')],qs[_0xb267('0x40')](_0x17d154[_0xb267('0x3b')][_0xb267('0x40')]));_0x403881[_0xb267('0x3f')]=_0x403881['attributes'][_0xb267('0x41')]?_0x403881[_0xb267('0x3f')]:_0xd0d8c0[_0xb267('0x3a')];if(!_0x17d154['query'][_0xb267('0x42')]('nolimit')){_0x403881[_0xb267('0x28')]=qs[_0xb267('0x28')](_0x17d154[_0xb267('0x3b')][_0xb267('0x28')]);_0x403881[_0xb267('0x27')]=qs['offset'](_0x17d154['query'][_0xb267('0x27')]);}_0x403881[_0xb267('0x43')]=qs[_0xb267('0x44')](_0x17d154[_0xb267('0x3b')][_0xb267('0x44')]);_0x403881[_0xb267('0x45')]=qs[_0xb267('0x3d')](_[_0xb267('0x46')](_0x17d154[_0xb267('0x3b')],_0xd0d8c0['filters']));if(_0x17d154[_0xb267('0x3b')][_0xb267('0x47')]){_0x403881['where']=_[_0xb267('0x48')](_0x403881[_0xb267('0x45')],{'$or':_['map'](_0x36e481,function(_0x2807ab){if(_0x2807ab[_0xb267('0x38')]['key']!=='VIRTUAL'){var _0x462c5d={};_0x462c5d[_0x2807ab[_0xb267('0x49')]]={'$like':'%'+_0x17d154[_0xb267('0x3b')]['filter']+'%'};return _0x462c5d;}})});}_0x403881=_[_0xb267('0x48')]({},_0x403881,_0x17d154[_0xb267('0x4a')]);var _0x1d9a9e={'where':_0x403881['where']};return db[_0xb267('0x36')][_0xb267('0x26')](_0x1d9a9e)[_0xb267('0x2e')](function(_0x143e35){_0x972b66[_0xb267('0x26')]=_0x143e35;if(_0x17d154[_0xb267('0x3b')][_0xb267('0x4b')]){_0x403881[_0xb267('0x4c')]=[{'all':!![]}];}return db[_0xb267('0x36')][_0xb267('0x4d')](_0x403881);})[_0xb267('0x2e')](function(_0x1f348e){_0x972b66[_0xb267('0x4e')]=_0x1f348e;return _0x972b66;})[_0xb267('0x2e')](respondWithFilteredResult(_0x12ed5a,_0x403881))['catch'](handleError(_0x12ed5a,null));};exports['show']=function(_0x9103d2,_0x122f38){var _0x5d4573={'raw':![],'where':{'id':_0x9103d2[_0xb267('0x4f')]['id']}},_0x16cb1a={};_0x16cb1a['model']=_[_0xb267('0x3c')](db['SugarcrmConfiguration'][_0xb267('0x50')]);_0x16cb1a['query']=_[_0xb267('0x3c')](_0x9103d2['query']);_0x16cb1a[_0xb267('0x3d')]=_[_0xb267('0x3e')](_0x16cb1a[_0xb267('0x3a')],_0x16cb1a[_0xb267('0x3b')]);_0x5d4573[_0xb267('0x3f')]=_[_0xb267('0x3e')](_0x16cb1a['model'],qs[_0xb267('0x40')](_0x9103d2['query']['fields']));_0x5d4573[_0xb267('0x3f')]=_0x5d4573[_0xb267('0x3f')][_0xb267('0x41')]?_0x5d4573[_0xb267('0x3f')]:_0x16cb1a[_0xb267('0x3a')];if(_0x9103d2[_0xb267('0x3b')][_0xb267('0x4b')]){_0x5d4573[_0xb267('0x4c')]=[{'all':!![]}];}_0x5d4573=_[_0xb267('0x48')]({},_0x5d4573,_0x9103d2[_0xb267('0x4a')]);return db[_0xb267('0x36')][_0xb267('0x51')](_0x5d4573)[_0xb267('0x2e')](handleEntityNotFound(_0x122f38,null))[_0xb267('0x2e')](respondWithResult(_0x122f38,null))['catch'](handleError(_0x122f38,null));};exports['create']=function(_0x23ef59,_0x5c777b){return db['SugarcrmConfiguration'][_0xb267('0x52')](_0x23ef59[_0xb267('0x53')],{})[_0xb267('0x2e')](respondWithResult(_0x5c777b,0xc9))[_0xb267('0x24')](handleError(_0x5c777b,null));};exports[_0xb267('0x54')]=function(_0x1e9530,_0x43fe0d){if(_0x1e9530[_0xb267('0x53')]['id']){delete _0x1e9530[_0xb267('0x53')]['id'];}return db[_0xb267('0x36')][_0xb267('0x51')]({'where':{'id':_0x1e9530[_0xb267('0x4f')]['id']}})[_0xb267('0x2e')](handleEntityNotFound(_0x43fe0d,null))[_0xb267('0x2e')](saveUpdates(_0x1e9530[_0xb267('0x53')],null))['then'](respondWithResult(_0x43fe0d,null))[_0xb267('0x24')](handleError(_0x43fe0d,null));};exports[_0xb267('0x55')]=function(_0x41dd45,_0x80b87e){return db[_0xb267('0x36')][_0xb267('0x51')]({'where':{'id':_0x41dd45[_0xb267('0x4f')]['id']}})[_0xb267('0x2e')](handleEntityNotFound(_0x80b87e,null))[_0xb267('0x2e')](removeEntity(_0x80b87e,null))[_0xb267('0x24')](handleError(_0x80b87e,null));};exports[_0xb267('0x56')]=function(_0x2923e5,_0xb63b5f,_0xd85a9){var _0x31c17d={};var _0x10e0ff={};var _0x5f3c9b;var _0x355c2f;return db[_0xb267('0x36')][_0xb267('0x57')]({'where':{'id':_0x2923e5[_0xb267('0x4f')]['id']}})[_0xb267('0x2e')](handleEntityNotFound(_0xb63b5f,null))['then'](function(_0x133b1f){if(_0x133b1f){_0x5f3c9b=_0x133b1f;_0x10e0ff[_0xb267('0x3a')]=_[_0xb267('0x3c')](db[_0xb267('0x58')][_0xb267('0x50')]);_0x10e0ff[_0xb267('0x3b')]=_[_0xb267('0x3c')](_0x2923e5[_0xb267('0x3b')]);_0x10e0ff['filters']=_[_0xb267('0x3e')](_0x10e0ff[_0xb267('0x3a')],_0x10e0ff['query']);_0x31c17d[_0xb267('0x3f')]=_[_0xb267('0x3e')](_0x10e0ff[_0xb267('0x3a')],qs['fields'](_0x2923e5['query'][_0xb267('0x40')]));_0x31c17d[_0xb267('0x3f')]=_0x31c17d[_0xb267('0x3f')]['length']?_0x31c17d['attributes']:_0x10e0ff[_0xb267('0x3a')];_0x31c17d[_0xb267('0x43')]=qs[_0xb267('0x44')](_0x2923e5[_0xb267('0x3b')][_0xb267('0x44')]);_0x31c17d['where']=qs['filters'](_['pick'](_0x2923e5[_0xb267('0x3b')],_0x10e0ff['filters']));if(_0x2923e5[_0xb267('0x3b')][_0xb267('0x47')]){_0x31c17d[_0xb267('0x45')]=_['merge'](_0x31c17d[_0xb267('0x45')],{'$or':_[_0xb267('0x35')](_0x31c17d[_0xb267('0x3f')],function(_0x4406c3){var _0x4d952b={};_0x4d952b[_0x4406c3]={'$like':'%'+_0x2923e5[_0xb267('0x3b')][_0xb267('0x47')]+'%'};return _0x4d952b;})});}_0x31c17d=_['merge']({},_0x31c17d,_0x2923e5['options']);return _0x5f3c9b[_0xb267('0x56')](_0x31c17d);}})[_0xb267('0x2e')](function(_0x44cf05){if(_0x44cf05){_0x355c2f=_0x44cf05[_0xb267('0x41')];if(!_0x2923e5[_0xb267('0x3b')][_0xb267('0x42')]('nolimit')){_0x31c17d[_0xb267('0x28')]=qs['limit'](_0x2923e5[_0xb267('0x3b')][_0xb267('0x28')]);_0x31c17d[_0xb267('0x27')]=qs[_0xb267('0x27')](_0x2923e5[_0xb267('0x3b')][_0xb267('0x27')]);}return _0x5f3c9b[_0xb267('0x56')](_0x31c17d);}})[_0xb267('0x2e')](function(_0x2196cf){if(_0x2196cf){return _0x2196cf?{'count':_0x355c2f,'rows':_0x2196cf}:null;}})[_0xb267('0x2e')](respondWithResult(_0xb63b5f,null))[_0xb267('0x24')](handleError(_0xb63b5f,null));};exports[_0xb267('0x59')]=function(_0x285acf,_0x365be6,_0x41c40b){var _0x4ff16b={};var _0x3277e9={};var _0x71e8f4;var _0x286cfd;return db[_0xb267('0x36')]['findOne']({'where':{'id':_0x285acf[_0xb267('0x4f')]['id']}})['then'](handleEntityNotFound(_0x365be6,null))['then'](function(_0x58c7be){if(_0x58c7be){_0x71e8f4=_0x58c7be;_0x3277e9[_0xb267('0x3a')]=_[_0xb267('0x3c')](db[_0xb267('0x58')]['rawAttributes']);_0x3277e9[_0xb267('0x3b')]=_[_0xb267('0x3c')](_0x285acf[_0xb267('0x3b')]);_0x3277e9[_0xb267('0x3d')]=_[_0xb267('0x3e')](_0x3277e9[_0xb267('0x3a')],_0x3277e9['query']);_0x4ff16b[_0xb267('0x3f')]=_[_0xb267('0x3e')](_0x3277e9[_0xb267('0x3a')],qs['fields'](_0x285acf[_0xb267('0x3b')][_0xb267('0x40')]));_0x4ff16b[_0xb267('0x3f')]=_0x4ff16b[_0xb267('0x3f')]['length']?_0x4ff16b[_0xb267('0x3f')]:_0x3277e9['model'];_0x4ff16b[_0xb267('0x43')]=qs[_0xb267('0x44')](_0x285acf[_0xb267('0x3b')][_0xb267('0x44')]);_0x4ff16b[_0xb267('0x45')]=qs[_0xb267('0x3d')](_[_0xb267('0x46')](_0x285acf[_0xb267('0x3b')],_0x3277e9[_0xb267('0x3d')]));if(_0x285acf[_0xb267('0x3b')][_0xb267('0x47')]){_0x4ff16b[_0xb267('0x45')]=_['merge'](_0x4ff16b['where'],{'$or':_['map'](_0x4ff16b[_0xb267('0x3f')],function(_0x4117e1){var _0x205687={};_0x205687[_0x4117e1]={'$like':'%'+_0x285acf['query'][_0xb267('0x47')]+'%'};return _0x205687;})});}_0x4ff16b=_[_0xb267('0x48')]({},_0x4ff16b,_0x285acf[_0xb267('0x4a')]);return _0x71e8f4[_0xb267('0x59')](_0x4ff16b);}})[_0xb267('0x2e')](function(_0x49ce09){if(_0x49ce09){_0x286cfd=_0x49ce09[_0xb267('0x41')];if(!_0x285acf[_0xb267('0x3b')]['hasOwnProperty'](_0xb267('0x5a'))){_0x4ff16b['limit']=qs[_0xb267('0x28')](_0x285acf[_0xb267('0x3b')][_0xb267('0x28')]);_0x4ff16b[_0xb267('0x27')]=qs['offset'](_0x285acf['query']['offset']);}return _0x71e8f4[_0xb267('0x59')](_0x4ff16b);}})[_0xb267('0x2e')](function(_0x1b30e3){if(_0x1b30e3){return _0x1b30e3?{'count':_0x286cfd,'rows':_0x1b30e3}:null;}})[_0xb267('0x2e')](respondWithResult(_0x365be6,null))['catch'](handleError(_0x365be6,null));};exports[_0xb267('0x5b')]=function(_0x54a68c,_0x476034,_0x37d39d){var _0x250861={};var _0x473f7d={};var _0x512d0d;var _0x28f172;return db[_0xb267('0x36')][_0xb267('0x57')]({'where':{'id':_0x54a68c[_0xb267('0x4f')]['id']}})[_0xb267('0x2e')](handleEntityNotFound(_0x476034,null))[_0xb267('0x2e')](function(_0x53872a){if(_0x53872a){_0x512d0d=_0x53872a;_0x473f7d[_0xb267('0x3a')]=_[_0xb267('0x3c')](db[_0xb267('0x58')][_0xb267('0x50')]);_0x473f7d[_0xb267('0x3b')]=_[_0xb267('0x3c')](_0x54a68c[_0xb267('0x3b')]);_0x473f7d[_0xb267('0x3d')]=_[_0xb267('0x3e')](_0x473f7d['model'],_0x473f7d['query']);_0x250861['attributes']=_[_0xb267('0x3e')](_0x473f7d[_0xb267('0x3a')],qs['fields'](_0x54a68c['query']['fields']));_0x250861[_0xb267('0x3f')]=_0x250861[_0xb267('0x3f')][_0xb267('0x41')]?_0x250861['attributes']:_0x473f7d[_0xb267('0x3a')];_0x250861[_0xb267('0x43')]=qs[_0xb267('0x44')](_0x54a68c[_0xb267('0x3b')]['sort']);_0x250861[_0xb267('0x45')]=qs[_0xb267('0x3d')](_[_0xb267('0x46')](_0x54a68c[_0xb267('0x3b')],_0x473f7d[_0xb267('0x3d')]));if(_0x54a68c[_0xb267('0x3b')][_0xb267('0x47')]){_0x250861[_0xb267('0x45')]=_['merge'](_0x250861[_0xb267('0x45')],{'$or':_[_0xb267('0x35')](_0x250861[_0xb267('0x3f')],function(_0xb960c){var _0xaf3cfd={};_0xaf3cfd[_0xb960c]={'$like':'%'+_0x54a68c[_0xb267('0x3b')][_0xb267('0x47')]+'%'};return _0xaf3cfd;})});}_0x250861=_[_0xb267('0x48')]({},_0x250861,_0x54a68c['options']);return _0x512d0d[_0xb267('0x5b')](_0x250861);}})[_0xb267('0x2e')](function(_0x4fd0f0){if(_0x4fd0f0){_0x28f172=_0x4fd0f0[_0xb267('0x41')];if(!_0x54a68c[_0xb267('0x3b')][_0xb267('0x42')](_0xb267('0x5a'))){_0x250861[_0xb267('0x28')]=qs[_0xb267('0x28')](_0x54a68c[_0xb267('0x3b')]['limit']);_0x250861[_0xb267('0x27')]=qs[_0xb267('0x27')](_0x54a68c[_0xb267('0x3b')][_0xb267('0x27')]);}return _0x512d0d[_0xb267('0x5b')](_0x250861);}})[_0xb267('0x2e')](function(_0x3a3aaa){if(_0x3a3aaa){return _0x3a3aaa?{'count':_0x28f172,'rows':_0x3a3aaa}:null;}})[_0xb267('0x2e')](respondWithResult(_0x476034,null))[_0xb267('0x24')](handleError(_0x476034,null));}; \ No newline at end of file +var _0xe28d=['findOne','rawAttributes','getSubjects','getDescriptions','html-pdf','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../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','SugarcrmConfiguration,\x20%s,\x20%s','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','apply','reject','update','destroy','name','send','map','SugarcrmConfiguration','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','field','options','includeAll','findAll','show','params','fields','include','find','create','body','getFields'];(function(_0x4361b6,_0x29e3fe){var _0x477231=function(_0x4c570d){while(--_0x4c570d){_0x4361b6['push'](_0x4361b6['shift']());}};_0x477231(++_0x29e3fe);}(_0xe28d,0x16c));var _0xde28=function(_0x1d75f7,_0x139d5e){_0x1d75f7=_0x1d75f7-0x0;var _0x307f9a=_0xe28d[_0x1d75f7];return _0x307f9a;};'use strict';var pdf=require(_0xde28('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xde28('0x1'));var zipdir=require(_0xde28('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xde28('0x3'));var moment=require(_0xde28('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xde28('0x5'));var util=require(_0xde28('0x6'));var path=require(_0xde28('0x7'));var sox=require(_0xde28('0x8'));var csv=require(_0xde28('0x9'));var ejs=require(_0xde28('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xde28('0xb'));var crypto=require(_0xde28('0xc'));var jsforce=require(_0xde28('0xd'));var deskjs=require(_0xde28('0xe'));var toCsv=require(_0xde28('0x9'));var querystring=require(_0xde28('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xde28('0x10'));var qs=require(_0xde28('0x11'));var as=require(_0xde28('0x12'));var hardwareService=require(_0xde28('0x13'));var logger=require(_0xde28('0x14'))(_0xde28('0x15'));var utils=require(_0xde28('0x16'));var config=require(_0xde28('0x17'));var db=require(_0xde28('0x18'))['db'];var jayson=require(_0xde28('0x19'));var client=jayson[_0xde28('0x1a')]['http']({'port':0x232a});function checkPasswordPattern(_0x26f7ba,_0x5a0e2f,_0x27ed9a){if(_0x27ed9a){var _0x95646=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x95646['test'](_0x5a0e2f)){return _0x26f7ba;}else{throw new Error(_0xde28('0x1b'));}}else{return _0x26f7ba;}}function respondWithRpcPromise(_0x2f7345,_0x587adb,_0x56f592,_0x267086){return new BPromise(function(_0x2713a4,_0x396d3d){var _0x3368fd=_0x267086||client;return _0x3368fd['request'](_0x2f7345,_0x56f592)[_0xde28('0x1c')](function(_0xac6c1b){logger[_0xde28('0x1d')](_0xde28('0x1e'),_0x587adb,'request\x20sent');logger[_0xde28('0x1f')](_0xde28('0x20'),_0x587adb,_0xde28('0x21'),JSON[_0xde28('0x22')](_0xac6c1b));if(_0xac6c1b[_0xde28('0x23')]){if(_0xac6c1b['error'][_0xde28('0x24')]===0x1f4){logger[_0xde28('0x23')](_0xde28('0x1e'),_0x587adb,_0xac6c1b[_0xde28('0x23')][_0xde28('0x25')]);return _0x396d3d(_0xac6c1b[_0xde28('0x23')]['message']);}logger[_0xde28('0x23')](_0xde28('0x1e'),_0x587adb,_0xac6c1b['error'][_0xde28('0x25')]);return _0x2713a4(_0xac6c1b[_0xde28('0x23')][_0xde28('0x25')]);}else{logger[_0xde28('0x1d')](_0xde28('0x1e'),_0x587adb,'request\x20sent');_0x2713a4(_0xac6c1b[_0xde28('0x26')]['message']);}})[_0xde28('0x27')](function(_0x27c14d){logger[_0xde28('0x23')](_0xde28('0x1e'),_0x587adb,_0x27c14d);_0x396d3d(_0x27c14d);});});}function respondWithStatusCode(_0x409e4d,_0x55eefd){_0x55eefd=_0x55eefd||0xcc;return function(_0x34d53e){if(_0x34d53e){return _0x409e4d[_0xde28('0x28')](_0x55eefd);}return _0x409e4d[_0xde28('0x29')](_0x55eefd)[_0xde28('0x2a')]();};}function respondWithResult(_0x4e24b0,_0x2dced1){_0x2dced1=_0x2dced1||0xc8;return function(_0x51bf53){if(_0x51bf53){return _0x4e24b0[_0xde28('0x29')](_0x2dced1)[_0xde28('0x2b')](_0x51bf53);}};}function respondWithFilteredResult(_0x4eaaee,_0x172ef2){return function(_0xd12460){if(_0xd12460){var _0x3b35bf=_0xd12460[_0xde28('0x2c')],_0x118528=_0x172ef2[_0xde28('0x2d')],_0x4ce5a2=_0x172ef2['offset']+_0x172ef2[_0xde28('0x2e')],_0xa645c3;if(_0x4ce5a2>=_0x3b35bf){_0x4ce5a2=_0x3b35bf;_0xa645c3=0xc8;}else{_0xa645c3=0xce;}_0x4eaaee[_0xde28('0x29')](_0xa645c3);return _0x4eaaee[_0xde28('0x2f')]('Content-Range',_0x118528+'-'+_0x4ce5a2+'/'+_0x3b35bf)[_0xde28('0x2b')](_0xd12460);}return null;};}function patchUpdates(_0x531443){return function(_0x4a2694){try{jsonpatch[_0xde28('0x30')](_0x4a2694,_0x531443,!![]);}catch(_0x4e9225){return BPromise[_0xde28('0x31')](_0x4e9225);}return _0x4a2694['save']();};}function saveUpdates(_0x415f67,_0x4b50e6){return function(_0x21eb9f){if(_0x21eb9f){return _0x21eb9f[_0xde28('0x32')](_0x415f67)[_0xde28('0x1c')](function(_0x560b8d){return _0x560b8d;});}return null;};}function removeEntity(_0x34d9a0,_0x32b5ec){return function(_0x38da35){if(_0x38da35){return _0x38da35[_0xde28('0x33')]()['then'](function(){_0x34d9a0['status'](0xcc)[_0xde28('0x2a')]();});}};}function handleEntityNotFound(_0x1afe1d,_0x4bf061){return function(_0x53573d){if(!_0x53573d){_0x1afe1d[_0xde28('0x28')](0x194);}return _0x53573d;};}function handleError(_0x28c89,_0x51b69c){_0x51b69c=_0x51b69c||0x1f4;return function(_0x2f6575){logger[_0xde28('0x23')](_0x2f6575['stack']);if(_0x2f6575[_0xde28('0x34')]){delete _0x2f6575['name'];}_0x28c89['status'](_0x51b69c)[_0xde28('0x35')](_0x2f6575);};}exports['index']=function(_0x2cbe1b,_0x3b5ae1){var _0x1f3640={},_0x2e19ab={},_0x587b2e={'count':0x0,'rows':[]};var _0x481429=_[_0xde28('0x36')](db[_0xde28('0x37')]['rawAttributes'],function(_0x49648f){return{'name':_0x49648f['fieldName'],'type':_0x49648f[_0xde28('0x38')][_0xde28('0x39')]};});_0x2e19ab[_0xde28('0x3a')]=_[_0xde28('0x36')](_0x481429,_0xde28('0x34'));_0x2e19ab[_0xde28('0x3b')]=_[_0xde28('0x3c')](_0x2cbe1b[_0xde28('0x3b')]);_0x2e19ab[_0xde28('0x3d')]=_[_0xde28('0x3e')](_0x2e19ab[_0xde28('0x3a')],_0x2e19ab['query']);_0x1f3640['attributes']=_['intersection'](_0x2e19ab[_0xde28('0x3a')],qs['fields'](_0x2cbe1b['query']['fields']));_0x1f3640[_0xde28('0x3f')]=_0x1f3640[_0xde28('0x3f')][_0xde28('0x40')]?_0x1f3640['attributes']:_0x2e19ab[_0xde28('0x3a')];if(!_0x2cbe1b[_0xde28('0x3b')][_0xde28('0x41')](_0xde28('0x42'))){_0x1f3640[_0xde28('0x2e')]=qs[_0xde28('0x2e')](_0x2cbe1b[_0xde28('0x3b')][_0xde28('0x2e')]);_0x1f3640[_0xde28('0x2d')]=qs[_0xde28('0x2d')](_0x2cbe1b['query']['offset']);}_0x1f3640[_0xde28('0x43')]=qs[_0xde28('0x44')](_0x2cbe1b['query']['sort']);_0x1f3640[_0xde28('0x45')]=qs['filters'](_[_0xde28('0x46')](_0x2cbe1b['query'],_0x2e19ab[_0xde28('0x3d')]));if(_0x2cbe1b[_0xde28('0x3b')][_0xde28('0x47')]){_0x1f3640['where']=_[_0xde28('0x48')](_0x1f3640['where'],{'$or':_[_0xde28('0x36')](_0x481429,function(_0x5984eb){if(_0x5984eb['type'][_0xde28('0x39')]!==_0xde28('0x49')){var _0x3f4f02={};_0x3f4f02[_0x5984eb[_0xde28('0x4a')]]={'$like':'%'+_0x2cbe1b[_0xde28('0x3b')][_0xde28('0x47')]+'%'};return _0x3f4f02;}})});}_0x1f3640=_[_0xde28('0x48')]({},_0x1f3640,_0x2cbe1b[_0xde28('0x4b')]);var _0x37823a={'where':_0x1f3640[_0xde28('0x45')]};return db['SugarcrmConfiguration'][_0xde28('0x2c')](_0x37823a)['then'](function(_0x292132){_0x587b2e[_0xde28('0x2c')]=_0x292132;if(_0x2cbe1b[_0xde28('0x3b')][_0xde28('0x4c')]){_0x1f3640['include']=[{'all':!![]}];}return db[_0xde28('0x37')][_0xde28('0x4d')](_0x1f3640);})['then'](function(_0x40f778){_0x587b2e['rows']=_0x40f778;return _0x587b2e;})[_0xde28('0x1c')](respondWithFilteredResult(_0x3b5ae1,_0x1f3640))[_0xde28('0x27')](handleError(_0x3b5ae1,null));};exports[_0xde28('0x4e')]=function(_0x138007,_0x5b7feb){var _0x2ccb91={'raw':![],'where':{'id':_0x138007[_0xde28('0x4f')]['id']}},_0x4b010d={};_0x4b010d[_0xde28('0x3a')]=_[_0xde28('0x3c')](db['SugarcrmConfiguration']['rawAttributes']);_0x4b010d[_0xde28('0x3b')]=_['keys'](_0x138007[_0xde28('0x3b')]);_0x4b010d['filters']=_[_0xde28('0x3e')](_0x4b010d[_0xde28('0x3a')],_0x4b010d[_0xde28('0x3b')]);_0x2ccb91['attributes']=_[_0xde28('0x3e')](_0x4b010d[_0xde28('0x3a')],qs[_0xde28('0x50')](_0x138007['query'][_0xde28('0x50')]));_0x2ccb91[_0xde28('0x3f')]=_0x2ccb91[_0xde28('0x3f')][_0xde28('0x40')]?_0x2ccb91[_0xde28('0x3f')]:_0x4b010d[_0xde28('0x3a')];if(_0x138007[_0xde28('0x3b')][_0xde28('0x4c')]){_0x2ccb91[_0xde28('0x51')]=[{'all':!![]}];}_0x2ccb91=_[_0xde28('0x48')]({},_0x2ccb91,_0x138007[_0xde28('0x4b')]);return db['SugarcrmConfiguration'][_0xde28('0x52')](_0x2ccb91)['then'](handleEntityNotFound(_0x5b7feb,null))[_0xde28('0x1c')](respondWithResult(_0x5b7feb,null))[_0xde28('0x27')](handleError(_0x5b7feb,null));};exports[_0xde28('0x53')]=function(_0x99d663,_0x5263e5){return db[_0xde28('0x37')][_0xde28('0x53')](_0x99d663[_0xde28('0x54')],{})[_0xde28('0x1c')](respondWithResult(_0x5263e5,0xc9))[_0xde28('0x27')](handleError(_0x5263e5,null));};exports['update']=function(_0x58765b,_0x326027){if(_0x58765b[_0xde28('0x54')]['id']){delete _0x58765b['body']['id'];}return db[_0xde28('0x37')][_0xde28('0x52')]({'where':{'id':_0x58765b['params']['id']}})[_0xde28('0x1c')](handleEntityNotFound(_0x326027,null))[_0xde28('0x1c')](saveUpdates(_0x58765b[_0xde28('0x54')],null))[_0xde28('0x1c')](respondWithResult(_0x326027,null))[_0xde28('0x27')](handleError(_0x326027,null));};exports[_0xde28('0x33')]=function(_0x616779,_0x3bc1e6){return db[_0xde28('0x37')]['find']({'where':{'id':_0x616779[_0xde28('0x4f')]['id']}})[_0xde28('0x1c')](handleEntityNotFound(_0x3bc1e6,null))[_0xde28('0x1c')](removeEntity(_0x3bc1e6,null))[_0xde28('0x27')](handleError(_0x3bc1e6,null));};exports[_0xde28('0x55')]=function(_0x1bbb24,_0x474fe9,_0x7a96ef){var _0x3d59f2={};var _0x50f266={};var _0x3b4670;var _0x5ee1b9;return db['SugarcrmConfiguration'][_0xde28('0x56')]({'where':{'id':_0x1bbb24[_0xde28('0x4f')]['id']}})[_0xde28('0x1c')](handleEntityNotFound(_0x474fe9,null))[_0xde28('0x1c')](function(_0x5ee625){if(_0x5ee625){_0x3b4670=_0x5ee625;_0x50f266[_0xde28('0x3a')]=_[_0xde28('0x3c')](db['SugarcrmField']['rawAttributes']);_0x50f266[_0xde28('0x3b')]=_[_0xde28('0x3c')](_0x1bbb24[_0xde28('0x3b')]);_0x50f266[_0xde28('0x3d')]=_[_0xde28('0x3e')](_0x50f266[_0xde28('0x3a')],_0x50f266['query']);_0x3d59f2['attributes']=_[_0xde28('0x3e')](_0x50f266[_0xde28('0x3a')],qs['fields'](_0x1bbb24[_0xde28('0x3b')][_0xde28('0x50')]));_0x3d59f2[_0xde28('0x3f')]=_0x3d59f2['attributes'][_0xde28('0x40')]?_0x3d59f2[_0xde28('0x3f')]:_0x50f266['model'];_0x3d59f2[_0xde28('0x43')]=qs[_0xde28('0x44')](_0x1bbb24['query'][_0xde28('0x44')]);_0x3d59f2[_0xde28('0x45')]=qs['filters'](_[_0xde28('0x46')](_0x1bbb24[_0xde28('0x3b')],_0x50f266[_0xde28('0x3d')]));if(_0x1bbb24[_0xde28('0x3b')][_0xde28('0x47')]){_0x3d59f2['where']=_[_0xde28('0x48')](_0x3d59f2[_0xde28('0x45')],{'$or':_['map'](_0x3d59f2[_0xde28('0x3f')],function(_0x36f2ee){var _0x5ded0d={};_0x5ded0d[_0x36f2ee]={'$like':'%'+_0x1bbb24[_0xde28('0x3b')][_0xde28('0x47')]+'%'};return _0x5ded0d;})});}_0x3d59f2=_['merge']({},_0x3d59f2,_0x1bbb24[_0xde28('0x4b')]);return _0x3b4670['getFields'](_0x3d59f2);}})[_0xde28('0x1c')](function(_0x764933){if(_0x764933){_0x5ee1b9=_0x764933[_0xde28('0x40')];if(!_0x1bbb24[_0xde28('0x3b')][_0xde28('0x41')](_0xde28('0x42'))){_0x3d59f2[_0xde28('0x2e')]=qs[_0xde28('0x2e')](_0x1bbb24[_0xde28('0x3b')][_0xde28('0x2e')]);_0x3d59f2[_0xde28('0x2d')]=qs[_0xde28('0x2d')](_0x1bbb24['query']['offset']);}return _0x3b4670['getFields'](_0x3d59f2);}})[_0xde28('0x1c')](function(_0x1cb0d0){if(_0x1cb0d0){return _0x1cb0d0?{'count':_0x5ee1b9,'rows':_0x1cb0d0}:null;}})['then'](respondWithResult(_0x474fe9,null))[_0xde28('0x27')](handleError(_0x474fe9,null));};exports['getSubjects']=function(_0x2f0cf2,_0x5326cc,_0x11553b){var _0x27f005={};var _0x2763df={};var _0x1132e4;var _0x4d6548;return db[_0xde28('0x37')]['findOne']({'where':{'id':_0x2f0cf2[_0xde28('0x4f')]['id']}})[_0xde28('0x1c')](handleEntityNotFound(_0x5326cc,null))['then'](function(_0xc907a){if(_0xc907a){_0x1132e4=_0xc907a;_0x2763df['model']=_[_0xde28('0x3c')](db['SugarcrmField'][_0xde28('0x57')]);_0x2763df[_0xde28('0x3b')]=_[_0xde28('0x3c')](_0x2f0cf2[_0xde28('0x3b')]);_0x2763df[_0xde28('0x3d')]=_[_0xde28('0x3e')](_0x2763df[_0xde28('0x3a')],_0x2763df[_0xde28('0x3b')]);_0x27f005['attributes']=_[_0xde28('0x3e')](_0x2763df['model'],qs[_0xde28('0x50')](_0x2f0cf2[_0xde28('0x3b')][_0xde28('0x50')]));_0x27f005[_0xde28('0x3f')]=_0x27f005[_0xde28('0x3f')][_0xde28('0x40')]?_0x27f005[_0xde28('0x3f')]:_0x2763df['model'];_0x27f005[_0xde28('0x43')]=qs[_0xde28('0x44')](_0x2f0cf2[_0xde28('0x3b')]['sort']);_0x27f005[_0xde28('0x45')]=qs[_0xde28('0x3d')](_['pick'](_0x2f0cf2[_0xde28('0x3b')],_0x2763df[_0xde28('0x3d')]));if(_0x2f0cf2[_0xde28('0x3b')]['filter']){_0x27f005[_0xde28('0x45')]=_[_0xde28('0x48')](_0x27f005[_0xde28('0x45')],{'$or':_[_0xde28('0x36')](_0x27f005[_0xde28('0x3f')],function(_0x1d095c){var _0x39c447={};_0x39c447[_0x1d095c]={'$like':'%'+_0x2f0cf2[_0xde28('0x3b')][_0xde28('0x47')]+'%'};return _0x39c447;})});}_0x27f005=_['merge']({},_0x27f005,_0x2f0cf2['options']);return _0x1132e4['getSubjects'](_0x27f005);}})[_0xde28('0x1c')](function(_0x3bf393){if(_0x3bf393){_0x4d6548=_0x3bf393[_0xde28('0x40')];if(!_0x2f0cf2['query'][_0xde28('0x41')](_0xde28('0x42'))){_0x27f005[_0xde28('0x2e')]=qs[_0xde28('0x2e')](_0x2f0cf2['query']['limit']);_0x27f005[_0xde28('0x2d')]=qs[_0xde28('0x2d')](_0x2f0cf2[_0xde28('0x3b')][_0xde28('0x2d')]);}return _0x1132e4[_0xde28('0x58')](_0x27f005);}})['then'](function(_0x1a65c8){if(_0x1a65c8){return _0x1a65c8?{'count':_0x4d6548,'rows':_0x1a65c8}:null;}})['then'](respondWithResult(_0x5326cc,null))[_0xde28('0x27')](handleError(_0x5326cc,null));};exports[_0xde28('0x59')]=function(_0x3f44b2,_0x4f2600,_0x51be46){var _0x3759b2={};var _0x2ddebf={};var _0x392db3;var _0x217ee8;return db['SugarcrmConfiguration'][_0xde28('0x56')]({'where':{'id':_0x3f44b2['params']['id']}})[_0xde28('0x1c')](handleEntityNotFound(_0x4f2600,null))['then'](function(_0x3b4b63){if(_0x3b4b63){_0x392db3=_0x3b4b63;_0x2ddebf['model']=_['keys'](db['SugarcrmField']['rawAttributes']);_0x2ddebf[_0xde28('0x3b')]=_['keys'](_0x3f44b2['query']);_0x2ddebf[_0xde28('0x3d')]=_[_0xde28('0x3e')](_0x2ddebf['model'],_0x2ddebf[_0xde28('0x3b')]);_0x3759b2[_0xde28('0x3f')]=_[_0xde28('0x3e')](_0x2ddebf[_0xde28('0x3a')],qs['fields'](_0x3f44b2[_0xde28('0x3b')]['fields']));_0x3759b2[_0xde28('0x3f')]=_0x3759b2[_0xde28('0x3f')][_0xde28('0x40')]?_0x3759b2[_0xde28('0x3f')]:_0x2ddebf[_0xde28('0x3a')];_0x3759b2[_0xde28('0x43')]=qs[_0xde28('0x44')](_0x3f44b2[_0xde28('0x3b')][_0xde28('0x44')]);_0x3759b2[_0xde28('0x45')]=qs[_0xde28('0x3d')](_[_0xde28('0x46')](_0x3f44b2['query'],_0x2ddebf[_0xde28('0x3d')]));if(_0x3f44b2[_0xde28('0x3b')][_0xde28('0x47')]){_0x3759b2['where']=_[_0xde28('0x48')](_0x3759b2[_0xde28('0x45')],{'$or':_[_0xde28('0x36')](_0x3759b2[_0xde28('0x3f')],function(_0x33402a){var _0x16bcfd={};_0x16bcfd[_0x33402a]={'$like':'%'+_0x3f44b2[_0xde28('0x3b')][_0xde28('0x47')]+'%'};return _0x16bcfd;})});}_0x3759b2=_[_0xde28('0x48')]({},_0x3759b2,_0x3f44b2[_0xde28('0x4b')]);return _0x392db3[_0xde28('0x59')](_0x3759b2);}})['then'](function(_0x1cc15d){if(_0x1cc15d){_0x217ee8=_0x1cc15d[_0xde28('0x40')];if(!_0x3f44b2[_0xde28('0x3b')][_0xde28('0x41')](_0xde28('0x42'))){_0x3759b2[_0xde28('0x2e')]=qs['limit'](_0x3f44b2[_0xde28('0x3b')][_0xde28('0x2e')]);_0x3759b2['offset']=qs['offset'](_0x3f44b2[_0xde28('0x3b')][_0xde28('0x2d')]);}return _0x392db3[_0xde28('0x59')](_0x3759b2);}})[_0xde28('0x1c')](function(_0x226d44){if(_0x226d44){return _0x226d44?{'count':_0x217ee8,'rows':_0x226d44}:null;}})['then'](respondWithResult(_0x4f2600,null))[_0xde28('0x27')](handleError(_0x4f2600,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 3b0e616..886ef30 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 _0xfb1b=['request-promise','path','rimraf','../../config/environment','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','../../config/logger','api','moment'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xfb1b,0x1ac));var _0xbfb1=function(_0x21c225,_0x531849){_0x21c225=_0x21c225-0x0;var _0x539351=_0xfb1b[_0x21c225];return _0x539351;};'use strict';var _=require(_0xbfb1('0x0'));var util=require('util');var logger=require(_0xbfb1('0x1'))(_0xbfb1('0x2'));var moment=require(_0xbfb1('0x3'));var BPromise=require('bluebird');var rp=require(_0xbfb1('0x4'));var fs=require('fs');var path=require(_0xbfb1('0x5'));var rimraf=require(_0xbfb1('0x6'));var config=require(_0xbfb1('0x7'));var attributes=require('./intSugarcrmConfiguration.attributes');module[_0xbfb1('0x8')]=function(_0x3e772a,_0x2c90c1){return _0x3e772a[_0xbfb1('0x9')](_0xbfb1('0xa'),attributes,{'tableName':_0xbfb1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x61be=['request-promise','path','rimraf','../../config/environment','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger','api','moment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x61be,0x15a));var _0xe61b=function(_0x5ac9b9,_0x1a2212){_0x5ac9b9=_0x5ac9b9-0x0;var _0x4e1ca1=_0x61be[_0x5ac9b9];return _0x4e1ca1;};'use strict';var _=require(_0xe61b('0x0'));var util=require(_0xe61b('0x1'));var logger=require(_0xe61b('0x2'))(_0xe61b('0x3'));var moment=require(_0xe61b('0x4'));var BPromise=require('bluebird');var rp=require(_0xe61b('0x5'));var fs=require('fs');var path=require(_0xe61b('0x6'));var rimraf=require(_0xe61b('0x7'));var config=require(_0xe61b('0x8'));var attributes=require('./intSugarcrmConfiguration.attributes');module[_0xe61b('0x9')]=function(_0x4df420,_0x1d5f7e){return _0x4df420[_0xe61b('0xa')](_0xe61b('0xb'),attributes,{'tableName':_0xe61b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index 42a864a..136c545 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 _0x3937=['ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring'];(function(_0x308e4f,_0x134e25){var _0x17ab35=function(_0x2cfcd9){while(--_0x2cfcd9){_0x308e4f['push'](_0x308e4f['shift']());}};_0x17ab35(++_0x134e25);}(_0x3937,0x66));var _0x7393=function(_0x491fb9,_0x58f1cf){_0x491fb9=_0x491fb9-0x0;var _0x530f30=_0x3937[_0x491fb9];return _0x530f30;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7393('0x0'));var BPromise=require(_0x7393('0x1'));var rs=require(_0x7393('0x2'));var fs=require('fs');var Redis=require(_0x7393('0x3'));var db=require(_0x7393('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7393('0x5'))(_0x7393('0x6'));var config=require('../../config/environment');var jayson=require(_0x7393('0x7'));var client=jayson[_0x7393('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1fb014,_0x4bd528,_0x33929c){return new BPromise(function(_0x49f3a0,_0xf7f41a){return client['request'](_0x1fb014,_0x33929c)[_0x7393('0x9')](function(_0x5f30d1){logger[_0x7393('0xa')](_0x7393('0xb'),_0x4bd528,_0x7393('0xc'));logger[_0x7393('0xd')](_0x7393('0xe'),_0x4bd528,_0x7393('0xc'),JSON[_0x7393('0xf')](_0x5f30d1));if(_0x5f30d1[_0x7393('0x10')]){if(_0x5f30d1[_0x7393('0x10')][_0x7393('0x11')]===0x1f4){logger['error'](_0x7393('0xb'),_0x4bd528,_0x5f30d1['error']['message']);return _0xf7f41a(_0x5f30d1[_0x7393('0x10')]['message']);}logger[_0x7393('0x10')](_0x7393('0xb'),_0x4bd528,_0x5f30d1[_0x7393('0x10')][_0x7393('0x12')]);return _0x49f3a0(_0x5f30d1[_0x7393('0x10')]['message']);}else{logger[_0x7393('0xa')](_0x7393('0xb'),_0x4bd528,_0x7393('0xc'));_0x49f3a0(_0x5f30d1[_0x7393('0x13')][_0x7393('0x12')]);}})[_0x7393('0x14')](function(_0xe33eeb){logger[_0x7393('0x10')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x4bd528,_0xe33eeb);_0xf7f41a(_0xe33eeb);});});} \ No newline at end of file +var _0xc7b8=['error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','jayson/promise','client','request','info','SugarcrmConfiguration,\x20%s,\x20%s','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x32f05c,_0x273aef){var _0x4307ed=function(_0x1be4da){while(--_0x1be4da){_0x32f05c['push'](_0x32f05c['shift']());}};_0x4307ed(++_0x273aef);}(_0xc7b8,0x1ea));var _0x8c7b=function(_0x1ac383,_0x42dd46){_0x1ac383=_0x1ac383-0x0;var _0x5e149d=_0xc7b8[_0x1ac383];return _0x5e149d;};'use strict';var _=require(_0x8c7b('0x0'));var util=require(_0x8c7b('0x1'));var moment=require(_0x8c7b('0x2'));var BPromise=require(_0x8c7b('0x3'));var rs=require(_0x8c7b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8c7b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8c7b('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8c7b('0x7'));var client=jayson[_0x8c7b('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x995974,_0x121284,_0x4f4a6e){return new BPromise(function(_0x3a5f51,_0x27b257){return client[_0x8c7b('0x9')](_0x995974,_0x4f4a6e)['then'](function(_0x3aac87){logger[_0x8c7b('0xa')](_0x8c7b('0xb'),_0x121284,'request\x20sent');logger['debug'](_0x8c7b('0xc'),_0x121284,_0x8c7b('0xd'),JSON['stringify'](_0x3aac87));if(_0x3aac87[_0x8c7b('0xe')]){if(_0x3aac87['error'][_0x8c7b('0xf')]===0x1f4){logger[_0x8c7b('0xe')](_0x8c7b('0xb'),_0x121284,_0x3aac87[_0x8c7b('0xe')][_0x8c7b('0x10')]);return _0x27b257(_0x3aac87[_0x8c7b('0xe')][_0x8c7b('0x10')]);}logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0x121284,_0x3aac87['error'][_0x8c7b('0x10')]);return _0x3a5f51(_0x3aac87[_0x8c7b('0xe')][_0x8c7b('0x10')]);}else{logger['info'](_0x8c7b('0xb'),_0x121284,_0x8c7b('0xd'));_0x3a5f51(_0x3aac87['result'][_0x8c7b('0x10')]);}})[_0x8c7b('0x11')](function(_0x499711){logger[_0x8c7b('0xe')](_0x8c7b('0xb'),_0x121284,_0x499711);_0x27b257(_0x499711);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 2cadbc1..bfa135d 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 _0x01c6=['index','/:id','post','put','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated'];(function(_0x41041a,_0xc5d111){var _0x27cc83=function(_0x80cf5c){while(--_0x80cf5c){_0x41041a['push'](_0x41041a['shift']());}};_0x27cc83(++_0xc5d111);}(_0x01c6,0x16c));var _0x601c=function(_0x3fad5a,_0x2d3b02){_0x3fad5a=_0x3fad5a-0x0;var _0x4ca713=_0x01c6[_0x3fad5a];return _0x4ca713;};'use strict';var multer=require(_0x601c('0x0'));var util=require(_0x601c('0x1'));var path=require('path');var timeout=require(_0x601c('0x2'));var express=require(_0x601c('0x3'));var router=express[_0x601c('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x601c('0x5'));var config=require(_0x601c('0x6'));var controller=require(_0x601c('0x7'));router[_0x601c('0x8')]('/',auth[_0x601c('0x9')](),controller[_0x601c('0xa')]);router[_0x601c('0x8')](_0x601c('0xb'),auth[_0x601c('0x9')](),controller['show']);router[_0x601c('0xc')]('/',auth[_0x601c('0x9')](),controller['create']);router[_0x601c('0xd')](_0x601c('0xb'),auth[_0x601c('0x9')](),controller['update']);router[_0x601c('0xe')](_0x601c('0xb'),auth[_0x601c('0x9')](),controller[_0x601c('0xf')]);module[_0x601c('0x10')]=router; \ No newline at end of file +var _0x8220=['./intSugarcrmField.controller','isAuthenticated','index','show','post','create','put','/:id','update','delete','exports','multer','util','express','../../components/interaction/service'];(function(_0x37ae26,_0x2ecd70){var _0x1b1902=function(_0x5a6ae0){while(--_0x5a6ae0){_0x37ae26['push'](_0x37ae26['shift']());}};_0x1b1902(++_0x2ecd70);}(_0x8220,0xb0));var _0x0822=function(_0x96b9f1,_0x100578){_0x96b9f1=_0x96b9f1-0x0;var _0x1943fe=_0x8220[_0x96b9f1];return _0x1943fe;};'use strict';var multer=require(_0x0822('0x0'));var util=require(_0x0822('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0822('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x0822('0x3'));var config=require('../../config/environment');var controller=require(_0x0822('0x4'));router['get']('/',auth[_0x0822('0x5')](),controller[_0x0822('0x6')]);router['get']('/:id',auth[_0x0822('0x5')](),controller[_0x0822('0x7')]);router[_0x0822('0x8')]('/',auth['isAuthenticated'](),controller[_0x0822('0x9')]);router[_0x0822('0xa')](_0x0822('0xb'),auth[_0x0822('0x5')](),controller[_0x0822('0xc')]);router[_0x0822('0xd')](_0x0822('0xb'),auth[_0x0822('0x5')](),controller['destroy']);module[_0x0822('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 eaa546e..d7fd00d 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 _0xf53f=['string','variable','customVariable','keyValue','STRING','BOOLEAN','sequelize','exports','ENUM'];(function(_0x27148e,_0x3e9e9c){var _0x49490e=function(_0x47bb93){while(--_0x47bb93){_0x27148e['push'](_0x27148e['shift']());}};_0x49490e(++_0x3e9e9c);}(_0xf53f,0x8d));var _0xff53=function(_0x637e0a,_0x3193ea){_0x637e0a=_0x637e0a-0x0;var _0x8921c5=_0xf53f[_0x637e0a];return _0x8921c5;};'use strict';var Sequelize=require(_0xff53('0x0'));module[_0xff53('0x1')]={'type':{'type':Sequelize[_0xff53('0x2')](_0xff53('0x3'),_0xff53('0x4'),_0xff53('0x5'),_0xff53('0x6')),'defaultValue':_0xff53('0x3')},'content':{'type':Sequelize[_0xff53('0x7')]},'key':{'type':Sequelize[_0xff53('0x7')]},'keyType':{'type':Sequelize[_0xff53('0x2')](_0xff53('0x3'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0xff53('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xff53('0x7')]},'customField':{'type':Sequelize[_0xff53('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xff53('0x7')]}}; \ No newline at end of file +var _0xd338=['string','STRING','variable','BOOLEAN','sequelize','ENUM','customVariable','keyValue'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0xd338,0x1f4));var _0x8d33=function(_0x3e5f6d,_0x121db6){_0x3e5f6d=_0x3e5f6d-0x0;var _0x1bea6e=_0xd338[_0x3e5f6d];return _0x1bea6e;};'use strict';var Sequelize=require(_0x8d33('0x0'));module['exports']={'type':{'type':Sequelize[_0x8d33('0x1')]('string','variable',_0x8d33('0x2'),_0x8d33('0x3')),'defaultValue':_0x8d33('0x4')},'content':{'type':Sequelize[_0x8d33('0x5')]},'key':{'type':Sequelize[_0x8d33('0x5')]},'keyType':{'type':Sequelize['ENUM']('string',_0x8d33('0x6'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x8d33('0x5')]},'nameField':{'type':Sequelize[_0x8d33('0x5')]},'customField':{'type':Sequelize[_0x8d33('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8d33('0x5')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index fe560ed..9ec0663 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 _0xd5dd=['querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','error','name','send','index','map','SugarcrmField','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','key','field','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','destroy','html-pdf','eml-format','rimraf','zip-dir','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce'];(function(_0x1ecc66,_0x494bb3){var _0x486ae7=function(_0x3a751b){while(--_0x3a751b){_0x1ecc66['push'](_0x1ecc66['shift']());}};_0x486ae7(++_0x494bb3);}(_0xd5dd,0xd4));var _0xdd5d=function(_0x4cfec8,_0x12fdb3){_0x4cfec8=_0x4cfec8-0x0;var _0x1f8a67=_0xd5dd[_0x4cfec8];return _0x1f8a67;};'use strict';var pdf=require(_0xdd5d('0x0'));var emlformat=require(_0xdd5d('0x1'));var rimraf=require(_0xdd5d('0x2'));var zipdir=require(_0xdd5d('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xdd5d('0x4'));var Mustache=require('mustache');var util=require(_0xdd5d('0x5'));var path=require(_0xdd5d('0x6'));var sox=require(_0xdd5d('0x7'));var csv=require(_0xdd5d('0x8'));var ejs=require(_0xdd5d('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xdd5d('0xa'));var crypto=require(_0xdd5d('0xb'));var jsforce=require(_0xdd5d('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xdd5d('0x8'));var querystring=require(_0xdd5d('0xd'));var Papa=require(_0xdd5d('0xe'));var Redis=require('ioredis');var authService=require(_0xdd5d('0xf'));var qs=require(_0xdd5d('0x10'));var as=require(_0xdd5d('0x11'));var hardwareService=require(_0xdd5d('0x12'));var logger=require('../../config/logger')(_0xdd5d('0x13'));var utils=require(_0xdd5d('0x14'));var config=require(_0xdd5d('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3ca76a,_0x11d766){_0x11d766=_0x11d766||0xcc;return function(_0x5788d0){if(_0x5788d0){return _0x3ca76a[_0xdd5d('0x16')](_0x11d766);}return _0x3ca76a[_0xdd5d('0x17')](_0x11d766)[_0xdd5d('0x18')]();};}function respondWithResult(_0x3c6c57,_0xa8737c){_0xa8737c=_0xa8737c||0xc8;return function(_0x32c678){if(_0x32c678){return _0x3c6c57['status'](_0xa8737c)[_0xdd5d('0x19')](_0x32c678);}};}function respondWithFilteredResult(_0x122bc1,_0x2d4681){return function(_0x5d3fa9){if(_0x5d3fa9){var _0x1b75aa=_0x5d3fa9[_0xdd5d('0x1a')],_0x14e896=_0x2d4681[_0xdd5d('0x1b')],_0x2f7b25=_0x2d4681[_0xdd5d('0x1b')]+_0x2d4681[_0xdd5d('0x1c')],_0x34841b;if(_0x2f7b25>=_0x1b75aa){_0x2f7b25=_0x1b75aa;_0x34841b=0xc8;}else{_0x34841b=0xce;}_0x122bc1['status'](_0x34841b);return _0x122bc1[_0xdd5d('0x1d')](_0xdd5d('0x1e'),_0x14e896+'-'+_0x2f7b25+'/'+_0x1b75aa)[_0xdd5d('0x19')](_0x5d3fa9);}return null;};}function patchUpdates(_0x4e7fce){return function(_0x4e14c7){try{jsonpatch[_0xdd5d('0x1f')](_0x4e14c7,_0x4e7fce,!![]);}catch(_0x57f94b){return BPromise[_0xdd5d('0x20')](_0x57f94b);}return _0x4e14c7[_0xdd5d('0x21')]();};}function saveUpdates(_0xb1e266,_0x4bc720){return function(_0x4caf9a){if(_0x4caf9a){return _0x4caf9a[_0xdd5d('0x22')](_0xb1e266)[_0xdd5d('0x23')](function(_0x38b517){return _0x38b517;});}return null;};}function removeEntity(_0x1d4e5d,_0x2a5a38){return function(_0x5c64a4){if(_0x5c64a4){return _0x5c64a4['destroy']()[_0xdd5d('0x23')](function(){_0x1d4e5d[_0xdd5d('0x17')](0xcc)[_0xdd5d('0x18')]();});}};}function handleEntityNotFound(_0x56ab1e,_0x11f594){return function(_0x2bf37c){if(!_0x2bf37c){_0x56ab1e['sendStatus'](0x194);}return _0x2bf37c;};}function handleError(_0x5f5594,_0x3121fc){_0x3121fc=_0x3121fc||0x1f4;return function(_0x35bff2){logger[_0xdd5d('0x24')](_0x35bff2['stack']);if(_0x35bff2[_0xdd5d('0x25')]){delete _0x35bff2[_0xdd5d('0x25')];}_0x5f5594[_0xdd5d('0x17')](_0x3121fc)[_0xdd5d('0x26')](_0x35bff2);};}exports[_0xdd5d('0x27')]=function(_0x583085,_0x146b07){var _0x372f81={},_0x4e2b8a={},_0x36df6b={'count':0x0,'rows':[]};var _0x2b2ad8=_[_0xdd5d('0x28')](db[_0xdd5d('0x29')]['rawAttributes'],function(_0x24660f){return{'name':_0x24660f[_0xdd5d('0x2a')],'type':_0x24660f[_0xdd5d('0x2b')]['key']};});_0x4e2b8a[_0xdd5d('0x2c')]=_['map'](_0x2b2ad8,_0xdd5d('0x25'));_0x4e2b8a[_0xdd5d('0x2d')]=_[_0xdd5d('0x2e')](_0x583085['query']);_0x4e2b8a[_0xdd5d('0x2f')]=_[_0xdd5d('0x30')](_0x4e2b8a[_0xdd5d('0x2c')],_0x4e2b8a['query']);_0x372f81['attributes']=_[_0xdd5d('0x30')](_0x4e2b8a[_0xdd5d('0x2c')],qs[_0xdd5d('0x31')](_0x583085['query']['fields']));_0x372f81[_0xdd5d('0x32')]=_0x372f81[_0xdd5d('0x32')][_0xdd5d('0x33')]?_0x372f81[_0xdd5d('0x32')]:_0x4e2b8a[_0xdd5d('0x2c')];if(!_0x583085[_0xdd5d('0x2d')][_0xdd5d('0x34')](_0xdd5d('0x35'))){_0x372f81['limit']=qs[_0xdd5d('0x1c')](_0x583085[_0xdd5d('0x2d')][_0xdd5d('0x1c')]);_0x372f81[_0xdd5d('0x1b')]=qs[_0xdd5d('0x1b')](_0x583085[_0xdd5d('0x2d')][_0xdd5d('0x1b')]);}_0x372f81[_0xdd5d('0x36')]=qs[_0xdd5d('0x37')](_0x583085[_0xdd5d('0x2d')][_0xdd5d('0x37')]);_0x372f81['where']=qs['filters'](_[_0xdd5d('0x38')](_0x583085['query'],_0x4e2b8a[_0xdd5d('0x2f')]));if(_0x583085[_0xdd5d('0x2d')][_0xdd5d('0x39')]){_0x372f81[_0xdd5d('0x3a')]=_[_0xdd5d('0x3b')](_0x372f81['where'],{'$or':_['map'](_0x2b2ad8,function(_0x99d09){if(_0x99d09['type'][_0xdd5d('0x3c')]!=='VIRTUAL'){var _0x2a1121={};_0x2a1121[_0x99d09[_0xdd5d('0x3d')]]={'$like':'%'+_0x583085[_0xdd5d('0x2d')][_0xdd5d('0x39')]+'%'};return _0x2a1121;}})});}_0x372f81=_['merge']({},_0x372f81,_0x583085[_0xdd5d('0x3e')]);var _0x4c7375={'where':_0x372f81[_0xdd5d('0x3a')]};return db[_0xdd5d('0x29')][_0xdd5d('0x1a')](_0x4c7375)[_0xdd5d('0x23')](function(_0xbad2c6){_0x36df6b[_0xdd5d('0x1a')]=_0xbad2c6;if(_0x583085['query']['includeAll']){_0x372f81[_0xdd5d('0x3f')]=[{'all':!![]}];}return db[_0xdd5d('0x29')][_0xdd5d('0x40')](_0x372f81);})['then'](function(_0x2fc480){_0x36df6b[_0xdd5d('0x41')]=_0x2fc480;return _0x36df6b;})[_0xdd5d('0x23')](respondWithFilteredResult(_0x146b07,_0x372f81))[_0xdd5d('0x42')](handleError(_0x146b07,null));};exports[_0xdd5d('0x43')]=function(_0x5700d9,_0x2db0af){var _0x2bc83c={'raw':!![],'where':{'id':_0x5700d9[_0xdd5d('0x44')]['id']}},_0x33e4fb={};_0x33e4fb[_0xdd5d('0x2c')]=_[_0xdd5d('0x2e')](db[_0xdd5d('0x29')][_0xdd5d('0x45')]);_0x33e4fb[_0xdd5d('0x2d')]=_[_0xdd5d('0x2e')](_0x5700d9[_0xdd5d('0x2d')]);_0x33e4fb[_0xdd5d('0x2f')]=_[_0xdd5d('0x30')](_0x33e4fb[_0xdd5d('0x2c')],_0x33e4fb['query']);_0x2bc83c[_0xdd5d('0x32')]=_[_0xdd5d('0x30')](_0x33e4fb[_0xdd5d('0x2c')],qs[_0xdd5d('0x31')](_0x5700d9[_0xdd5d('0x2d')]['fields']));_0x2bc83c[_0xdd5d('0x32')]=_0x2bc83c[_0xdd5d('0x32')][_0xdd5d('0x33')]?_0x2bc83c[_0xdd5d('0x32')]:_0x33e4fb[_0xdd5d('0x2c')];if(_0x5700d9['query'][_0xdd5d('0x46')]){_0x2bc83c[_0xdd5d('0x3f')]=[{'all':!![]}];}_0x2bc83c=_[_0xdd5d('0x3b')]({},_0x2bc83c,_0x5700d9['options']);return db['SugarcrmField'][_0xdd5d('0x47')](_0x2bc83c)[_0xdd5d('0x23')](handleEntityNotFound(_0x2db0af,null))['then'](respondWithResult(_0x2db0af,null))[_0xdd5d('0x42')](handleError(_0x2db0af,null));};exports[_0xdd5d('0x48')]=function(_0x240e60,_0x31d9fb){return db[_0xdd5d('0x29')][_0xdd5d('0x48')](_0x240e60[_0xdd5d('0x49')],{})['then'](respondWithResult(_0x31d9fb,0xc9))['catch'](handleError(_0x31d9fb,null));};exports[_0xdd5d('0x22')]=function(_0x118343,_0x5cd367){if(_0x118343[_0xdd5d('0x49')]['id']){delete _0x118343[_0xdd5d('0x49')]['id'];}return db[_0xdd5d('0x29')]['find']({'where':{'id':_0x118343['params']['id']}})[_0xdd5d('0x23')](handleEntityNotFound(_0x5cd367,null))[_0xdd5d('0x23')](saveUpdates(_0x118343[_0xdd5d('0x49')],null))[_0xdd5d('0x23')](respondWithResult(_0x5cd367,null))[_0xdd5d('0x42')](handleError(_0x5cd367,null));};exports[_0xdd5d('0x4a')]=function(_0x1b3448,_0x6679c6){return db['SugarcrmField'][_0xdd5d('0x47')]({'where':{'id':_0x1b3448[_0xdd5d('0x44')]['id']}})[_0xdd5d('0x23')](handleEntityNotFound(_0x6679c6,null))[_0xdd5d('0x23')](removeEntity(_0x6679c6,null))[_0xdd5d('0x42')](handleError(_0x6679c6,null));}; \ No newline at end of file +var _0xb2b1=['type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','filter','merge','VIRTUAL','field','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','body','destroy','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','json','apply','reject','save','update','then','error','stack','name','send','index','map','SugarcrmField','fieldName'];(function(_0x2c1ac1,_0x3dfb07){var _0x240e2d=function(_0x5e6afd){while(--_0x5e6afd){_0x2c1ac1['push'](_0x2c1ac1['shift']());}};_0x240e2d(++_0x3dfb07);}(_0xb2b1,0x190));var _0x1b2b=function(_0x2aceb6,_0x4179b8){_0x2aceb6=_0x2aceb6-0x0;var _0x7515aa=_0xb2b1[_0x2aceb6];return _0x7515aa;};'use strict';var pdf=require(_0x1b2b('0x0'));var emlformat=require(_0x1b2b('0x1'));var rimraf=require(_0x1b2b('0x2'));var zipdir=require(_0x1b2b('0x3'));var jsonpatch=require(_0x1b2b('0x4'));var rp=require(_0x1b2b('0x5'));var moment=require('moment');var BPromise=require(_0x1b2b('0x6'));var Mustache=require(_0x1b2b('0x7'));var util=require('util');var path=require('path');var sox=require(_0x1b2b('0x8'));var csv=require(_0x1b2b('0x9'));var ejs=require(_0x1b2b('0xa'));var fs=require('fs');var _=require(_0x1b2b('0xb'));var squel=require(_0x1b2b('0xc'));var crypto=require(_0x1b2b('0xd'));var jsforce=require(_0x1b2b('0xe'));var deskjs=require(_0x1b2b('0xf'));var toCsv=require(_0x1b2b('0x9'));var querystring=require('querystring');var Papa=require(_0x1b2b('0x10'));var Redis=require(_0x1b2b('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1b2b('0x12'));var logger=require(_0x1b2b('0x13'))('api');var utils=require(_0x1b2b('0x14'));var config=require(_0x1b2b('0x15'));var db=require(_0x1b2b('0x16'))['db'];function respondWithStatusCode(_0x45c65a,_0x57687b){_0x57687b=_0x57687b||0xcc;return function(_0x440384){if(_0x440384){return _0x45c65a[_0x1b2b('0x17')](_0x57687b);}return _0x45c65a[_0x1b2b('0x18')](_0x57687b)[_0x1b2b('0x19')]();};}function respondWithResult(_0x3a1461,_0x4e02e5){_0x4e02e5=_0x4e02e5||0xc8;return function(_0x406a94){if(_0x406a94){return _0x3a1461[_0x1b2b('0x18')](_0x4e02e5)['json'](_0x406a94);}};}function respondWithFilteredResult(_0x520350,_0x5abf88){return function(_0x3f1624){if(_0x3f1624){var _0x56355a=_0x3f1624[_0x1b2b('0x1a')],_0x28a2ed=_0x5abf88[_0x1b2b('0x1b')],_0x1b2c37=_0x5abf88['offset']+_0x5abf88[_0x1b2b('0x1c')],_0x1b2dbc;if(_0x1b2c37>=_0x56355a){_0x1b2c37=_0x56355a;_0x1b2dbc=0xc8;}else{_0x1b2dbc=0xce;}_0x520350[_0x1b2b('0x18')](_0x1b2dbc);return _0x520350[_0x1b2b('0x1d')]('Content-Range',_0x28a2ed+'-'+_0x1b2c37+'/'+_0x56355a)[_0x1b2b('0x1e')](_0x3f1624);}return null;};}function patchUpdates(_0x300df0){return function(_0x1852f5){try{jsonpatch[_0x1b2b('0x1f')](_0x1852f5,_0x300df0,!![]);}catch(_0x3d25d0){return BPromise[_0x1b2b('0x20')](_0x3d25d0);}return _0x1852f5[_0x1b2b('0x21')]();};}function saveUpdates(_0x5474cd,_0x323327){return function(_0x2352e8){if(_0x2352e8){return _0x2352e8[_0x1b2b('0x22')](_0x5474cd)[_0x1b2b('0x23')](function(_0x4dbb95){return _0x4dbb95;});}return null;};}function removeEntity(_0x4a5fa1,_0x52727e){return function(_0x20b9fd){if(_0x20b9fd){return _0x20b9fd['destroy']()[_0x1b2b('0x23')](function(){_0x4a5fa1[_0x1b2b('0x18')](0xcc)[_0x1b2b('0x19')]();});}};}function handleEntityNotFound(_0x584b9b,_0x5979ac){return function(_0x482d77){if(!_0x482d77){_0x584b9b[_0x1b2b('0x17')](0x194);}return _0x482d77;};}function handleError(_0x5d325a,_0x35a8ef){_0x35a8ef=_0x35a8ef||0x1f4;return function(_0x5da94b){logger[_0x1b2b('0x24')](_0x5da94b[_0x1b2b('0x25')]);if(_0x5da94b[_0x1b2b('0x26')]){delete _0x5da94b['name'];}_0x5d325a[_0x1b2b('0x18')](_0x35a8ef)[_0x1b2b('0x27')](_0x5da94b);};}exports[_0x1b2b('0x28')]=function(_0x5c42b8,_0x6d5f31){var _0x505a32={},_0x5777b4={},_0x514770={'count':0x0,'rows':[]};var _0x5c6cc1=_[_0x1b2b('0x29')](db[_0x1b2b('0x2a')]['rawAttributes'],function(_0x59cbcf){return{'name':_0x59cbcf[_0x1b2b('0x2b')],'type':_0x59cbcf[_0x1b2b('0x2c')][_0x1b2b('0x2d')]};});_0x5777b4[_0x1b2b('0x2e')]=_[_0x1b2b('0x29')](_0x5c6cc1,_0x1b2b('0x26'));_0x5777b4[_0x1b2b('0x2f')]=_[_0x1b2b('0x30')](_0x5c42b8['query']);_0x5777b4[_0x1b2b('0x31')]=_[_0x1b2b('0x32')](_0x5777b4[_0x1b2b('0x2e')],_0x5777b4[_0x1b2b('0x2f')]);_0x505a32[_0x1b2b('0x33')]=_[_0x1b2b('0x32')](_0x5777b4[_0x1b2b('0x2e')],qs[_0x1b2b('0x34')](_0x5c42b8[_0x1b2b('0x2f')][_0x1b2b('0x34')]));_0x505a32[_0x1b2b('0x33')]=_0x505a32[_0x1b2b('0x33')][_0x1b2b('0x35')]?_0x505a32[_0x1b2b('0x33')]:_0x5777b4['model'];if(!_0x5c42b8[_0x1b2b('0x2f')][_0x1b2b('0x36')]('nolimit')){_0x505a32['limit']=qs[_0x1b2b('0x1c')](_0x5c42b8[_0x1b2b('0x2f')]['limit']);_0x505a32[_0x1b2b('0x1b')]=qs['offset'](_0x5c42b8[_0x1b2b('0x2f')][_0x1b2b('0x1b')]);}_0x505a32['order']=qs[_0x1b2b('0x37')](_0x5c42b8[_0x1b2b('0x2f')][_0x1b2b('0x37')]);_0x505a32[_0x1b2b('0x38')]=qs[_0x1b2b('0x31')](_['pick'](_0x5c42b8[_0x1b2b('0x2f')],_0x5777b4[_0x1b2b('0x31')]));if(_0x5c42b8[_0x1b2b('0x2f')][_0x1b2b('0x39')]){_0x505a32[_0x1b2b('0x38')]=_[_0x1b2b('0x3a')](_0x505a32[_0x1b2b('0x38')],{'$or':_[_0x1b2b('0x29')](_0x5c6cc1,function(_0xc840){if(_0xc840[_0x1b2b('0x2c')][_0x1b2b('0x2d')]!==_0x1b2b('0x3b')){var _0x3378b1={};_0x3378b1[_0xc840[_0x1b2b('0x3c')]]={'$like':'%'+_0x5c42b8['query'][_0x1b2b('0x39')]+'%'};return _0x3378b1;}})});}_0x505a32=_[_0x1b2b('0x3a')]({},_0x505a32,_0x5c42b8[_0x1b2b('0x3d')]);var _0x8da873={'where':_0x505a32[_0x1b2b('0x38')]};return db[_0x1b2b('0x2a')][_0x1b2b('0x1a')](_0x8da873)[_0x1b2b('0x23')](function(_0x140f7e){_0x514770[_0x1b2b('0x1a')]=_0x140f7e;if(_0x5c42b8[_0x1b2b('0x2f')][_0x1b2b('0x3e')]){_0x505a32[_0x1b2b('0x3f')]=[{'all':!![]}];}return db[_0x1b2b('0x2a')][_0x1b2b('0x40')](_0x505a32);})['then'](function(_0x2420a5){_0x514770[_0x1b2b('0x41')]=_0x2420a5;return _0x514770;})[_0x1b2b('0x23')](respondWithFilteredResult(_0x6d5f31,_0x505a32))['catch'](handleError(_0x6d5f31,null));};exports[_0x1b2b('0x42')]=function(_0x3a68a2,_0x2d15e3){var _0x3b55c1={'raw':!![],'where':{'id':_0x3a68a2[_0x1b2b('0x43')]['id']}},_0x352c70={};_0x352c70[_0x1b2b('0x2e')]=_['keys'](db[_0x1b2b('0x2a')][_0x1b2b('0x44')]);_0x352c70[_0x1b2b('0x2f')]=_[_0x1b2b('0x30')](_0x3a68a2[_0x1b2b('0x2f')]);_0x352c70[_0x1b2b('0x31')]=_['intersection'](_0x352c70['model'],_0x352c70[_0x1b2b('0x2f')]);_0x3b55c1[_0x1b2b('0x33')]=_[_0x1b2b('0x32')](_0x352c70[_0x1b2b('0x2e')],qs[_0x1b2b('0x34')](_0x3a68a2['query'][_0x1b2b('0x34')]));_0x3b55c1[_0x1b2b('0x33')]=_0x3b55c1[_0x1b2b('0x33')][_0x1b2b('0x35')]?_0x3b55c1[_0x1b2b('0x33')]:_0x352c70[_0x1b2b('0x2e')];if(_0x3a68a2[_0x1b2b('0x2f')][_0x1b2b('0x3e')]){_0x3b55c1[_0x1b2b('0x3f')]=[{'all':!![]}];}_0x3b55c1=_[_0x1b2b('0x3a')]({},_0x3b55c1,_0x3a68a2[_0x1b2b('0x3d')]);return db['SugarcrmField'][_0x1b2b('0x45')](_0x3b55c1)[_0x1b2b('0x23')](handleEntityNotFound(_0x2d15e3,null))[_0x1b2b('0x23')](respondWithResult(_0x2d15e3,null))[_0x1b2b('0x46')](handleError(_0x2d15e3,null));};exports[_0x1b2b('0x47')]=function(_0x34eac6,_0x14bff6){return db[_0x1b2b('0x2a')]['create'](_0x34eac6['body'],{})[_0x1b2b('0x23')](respondWithResult(_0x14bff6,0xc9))[_0x1b2b('0x46')](handleError(_0x14bff6,null));};exports[_0x1b2b('0x22')]=function(_0x440e2b,_0x59dc8f){if(_0x440e2b[_0x1b2b('0x48')]['id']){delete _0x440e2b[_0x1b2b('0x48')]['id'];}return db[_0x1b2b('0x2a')]['find']({'where':{'id':_0x440e2b[_0x1b2b('0x43')]['id']}})[_0x1b2b('0x23')](handleEntityNotFound(_0x59dc8f,null))[_0x1b2b('0x23')](saveUpdates(_0x440e2b[_0x1b2b('0x48')],null))[_0x1b2b('0x23')](respondWithResult(_0x59dc8f,null))[_0x1b2b('0x46')](handleError(_0x59dc8f,null));};exports[_0x1b2b('0x49')]=function(_0x54d434,_0x5e7a8d){return db[_0x1b2b('0x2a')][_0x1b2b('0x45')]({'where':{'id':_0x54d434[_0x1b2b('0x43')]['id']}})[_0x1b2b('0x23')](handleEntityNotFound(_0x5e7a8d,null))[_0x1b2b('0x23')](removeEntity(_0x5e7a8d,null))[_0x1b2b('0x46')](handleError(_0x5e7a8d,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 7d57bf7..4c3ff3d 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 _0x1048=['SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intSugarcrmField.attributes','exports','define'];(function(_0x409fb8,_0x5ab3d3){var _0x278270=function(_0x58849c){while(--_0x58849c){_0x409fb8['push'](_0x409fb8['shift']());}};_0x278270(++_0x5ab3d3);}(_0x1048,0x148));var _0x8104=function(_0x5398ee,_0x3e8f9c){_0x5398ee=_0x5398ee-0x0;var _0x413476=_0x1048[_0x5398ee];return _0x413476;};'use strict';var _=require(_0x8104('0x0'));var util=require(_0x8104('0x1'));var logger=require(_0x8104('0x2'))(_0x8104('0x3'));var moment=require(_0x8104('0x4'));var BPromise=require(_0x8104('0x5'));var rp=require(_0x8104('0x6'));var fs=require('fs');var path=require(_0x8104('0x7'));var rimraf=require(_0x8104('0x8'));var config=require('../../config/environment');var attributes=require(_0x8104('0x9'));module[_0x8104('0xa')]=function(_0x4cfa00,_0x57fcbc){return _0x4cfa00[_0x8104('0xb')](_0x8104('0xc'),attributes,{'tableName':_0x8104('0xd'),'paranoid':![],'indexes':[{'name':_0x8104('0xe'),'fields':[_0x8104('0xf'),_0x8104('0x10')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6dd2=['./intSugarcrmField.attributes','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','FieldId','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x2cc569,_0x4e9568){var _0x1bfc2e=function(_0x5b8fcb){while(--_0x5b8fcb){_0x2cc569['push'](_0x2cc569['shift']());}};_0x1bfc2e(++_0x4e9568);}(_0x6dd2,0xc0));var _0x26dd=function(_0x22ef99,_0xf7fcd6){_0x22ef99=_0x22ef99-0x0;var _0x4ba77f=_0x6dd2[_0x22ef99];return _0x4ba77f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x26dd('0x0'))(_0x26dd('0x1'));var moment=require(_0x26dd('0x2'));var BPromise=require('bluebird');var rp=require(_0x26dd('0x3'));var fs=require('fs');var path=require(_0x26dd('0x4'));var rimraf=require(_0x26dd('0x5'));var config=require('../../config/environment');var attributes=require(_0x26dd('0x6'));module['exports']=function(_0x1dae77,_0xea549){return _0x1dae77['define'](_0x26dd('0x7'),attributes,{'tableName':_0x26dd('0x8'),'paranoid':![],'indexes':[{'name':_0x26dd('0x9'),'fields':['idField',_0x26dd('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.rpc.js b/server/api/intSugarcrmField/intSugarcrmField.rpc.js index 44607a4..ade7a40 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 _0x0b0e=['SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmField,\x20%s,\x20%s','debug'];(function(_0x2de020,_0x252df0){var _0x182b7c=function(_0xcbcdaa){while(--_0xcbcdaa){_0x2de020['push'](_0x2de020['shift']());}};_0x182b7c(++_0x252df0);}(_0x0b0e,0x187));var _0xe0b0=function(_0x474bc0,_0x26989c){_0x474bc0=_0x474bc0-0x0;var _0x4b24cf=_0x0b0e[_0x474bc0];return _0x4b24cf;};'use strict';var _=require(_0xe0b0('0x0'));var util=require('util');var moment=require(_0xe0b0('0x1'));var BPromise=require('bluebird');var rs=require(_0xe0b0('0x2'));var fs=require('fs');var Redis=require(_0xe0b0('0x3'));var db=require(_0xe0b0('0x4'))['db'];var utils=require(_0xe0b0('0x5'));var logger=require(_0xe0b0('0x6'))(_0xe0b0('0x7'));var config=require(_0xe0b0('0x8'));var jayson=require(_0xe0b0('0x9'));var client=jayson[_0xe0b0('0xa')][_0xe0b0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x219b1c,_0x5cf9cc,_0x50be7f){return new BPromise(function(_0x11effc,_0x435060){return client[_0xe0b0('0xc')](_0x219b1c,_0x50be7f)[_0xe0b0('0xd')](function(_0x4c24f9){logger[_0xe0b0('0xe')](_0xe0b0('0xf'),_0x5cf9cc,'request\x20sent');logger[_0xe0b0('0x10')](_0xe0b0('0x11'),_0x5cf9cc,'request\x20sent',JSON[_0xe0b0('0x12')](_0x4c24f9));if(_0x4c24f9[_0xe0b0('0x13')]){if(_0x4c24f9[_0xe0b0('0x13')]['code']===0x1f4){logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4c24f9[_0xe0b0('0x13')][_0xe0b0('0x14')]);return _0x435060(_0x4c24f9[_0xe0b0('0x13')]['message']);}logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4c24f9[_0xe0b0('0x13')][_0xe0b0('0x14')]);return _0x11effc(_0x4c24f9[_0xe0b0('0x13')]['message']);}else{logger[_0xe0b0('0xe')]('SugarcrmField,\x20%s,\x20%s',_0x5cf9cc,_0xe0b0('0x15'));_0x11effc(_0x4c24f9[_0xe0b0('0x16')]['message']);}})[_0xe0b0('0x17')](function(_0x4a4cc0){logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4a4cc0);_0x435060(_0x4a4cc0);});});} \ No newline at end of file +var _0xb10b=['stringify','error','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SugarcrmField,\x20%s,\x20%s','SugarcrmField,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x116d25,_0x12a226){var _0x4d88ad=function(_0x36dc00){while(--_0x36dc00){_0x116d25['push'](_0x116d25['shift']());}};_0x4d88ad(++_0x12a226);}(_0xb10b,0x12a));var _0xbb10=function(_0x4b9f35,_0x287585){_0x4b9f35=_0x4b9f35-0x0;var _0x200ea1=_0xb10b[_0x4b9f35];return _0x200ea1;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index cf2ec1f..1cba189 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 _0x50d4=['./intVtigerAccount.controller','get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','getFields','create','post','addConfiguration','update','delete','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x50d4,0xb0));var _0x450d=function(_0x309a45,_0x139d58){_0x309a45=_0x309a45-0x0;var _0x2e8030=_0x50d4[_0x309a45];return _0x2e8030;};'use strict';var multer=require('multer');var util=require(_0x450d('0x0'));var path=require(_0x450d('0x1'));var timeout=require(_0x450d('0x2'));var express=require(_0x450d('0x3'));var router=express[_0x450d('0x4')]();var auth=require(_0x450d('0x5'));var interaction=require(_0x450d('0x6'));var config=require(_0x450d('0x7'));var controller=require(_0x450d('0x8'));router[_0x450d('0x9')]('/',auth['isAuthenticated'](),controller[_0x450d('0xa')]);router[_0x450d('0x9')](_0x450d('0xb'),auth[_0x450d('0xc')](),controller[_0x450d('0xd')]);router[_0x450d('0x9')](_0x450d('0xe'),auth[_0x450d('0xc')](),controller[_0x450d('0xf')]);router[_0x450d('0x9')]('/:id/fields',auth[_0x450d('0xc')](),controller[_0x450d('0x10')]);router['post']('/',auth[_0x450d('0xc')](),controller[_0x450d('0x11')]);router[_0x450d('0x12')]('/:id/configurations',auth[_0x450d('0xc')](),controller[_0x450d('0x13')]);router['put'](_0x450d('0xb'),auth['isAuthenticated'](),controller[_0x450d('0x14')]);router[_0x450d('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x450d('0x16')]);module['exports']=router; \ No newline at end of file +var _0xf254=['./intVtigerAccount.controller','isAuthenticated','get','/:id','show','/:id/fields','post','create','/:id/configurations','addConfiguration','put','update','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xd2f6ad,_0x1ea6cb){var _0x16de9b=function(_0x5252b6){while(--_0x5252b6){_0xd2f6ad['push'](_0xd2f6ad['shift']());}};_0x16de9b(++_0x1ea6cb);}(_0xf254,0x7d));var _0x4f25=function(_0xe0c564,_0x2ff569){_0xe0c564=_0xe0c564-0x0;var _0x32e0f6=_0xf254[_0xe0c564];return _0x32e0f6;};'use strict';var multer=require(_0x4f25('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4f25('0x1'));var express=require(_0x4f25('0x2'));var router=express[_0x4f25('0x3')]();var auth=require(_0x4f25('0x4'));var interaction=require(_0x4f25('0x5'));var config=require(_0x4f25('0x6'));var controller=require(_0x4f25('0x7'));router['get']('/',auth[_0x4f25('0x8')](),controller['index']);router[_0x4f25('0x9')](_0x4f25('0xa'),auth[_0x4f25('0x8')](),controller[_0x4f25('0xb')]);router['get']('/:id/configurations',auth['isAuthenticated'](),controller['getConfigurations']);router[_0x4f25('0x9')](_0x4f25('0xc'),auth['isAuthenticated'](),controller['getFields']);router[_0x4f25('0xd')]('/',auth[_0x4f25('0x8')](),controller[_0x4f25('0xe')]);router['post'](_0x4f25('0xf'),auth[_0x4f25('0x8')](),controller[_0x4f25('0x10')]);router[_0x4f25('0x11')](_0x4f25('0xa'),auth['isAuthenticated'](),controller[_0x4f25('0x12')]);router[_0x4f25('0x13')]('/:id',auth[_0x4f25('0x8')](),controller[_0x4f25('0x14')]);module[_0x4f25('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 17ccf0c..8b0fceb 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 _0x87bd=['HelpDesk','sequelize','STRING'];(function(_0x345ac9,_0x1d87e4){var _0x15fa3f=function(_0x18fcc0){while(--_0x18fcc0){_0x345ac9['push'](_0x345ac9['shift']());}};_0x15fa3f(++_0x1d87e4);}(_0x87bd,0x1f0));var _0xd87b=function(_0x8ae747,_0x135483){_0x8ae747=_0x8ae747-0x0;var _0x16d68b=_0x87bd[_0x8ae747];return _0x16d68b;};'use strict';var Sequelize=require(_0xd87b('0x0'));module['exports']={'name':{'type':Sequelize[_0xd87b('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xd87b('0x1')]},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd87b('0x2')},'remoteUri':{'type':Sequelize[_0xd87b('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xd87b('0x1')]},'accessKey':{'type':Sequelize[_0xd87b('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xed80=['STRING','HelpDesk','sequelize','exports'];(function(_0x48e921,_0x20cf98){var _0x4986fe=function(_0x466eb2){while(--_0x466eb2){_0x48e921['push'](_0x48e921['shift']());}};_0x4986fe(++_0x20cf98);}(_0xed80,0x116));var _0x0ed8=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xed80[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require(_0x0ed8('0x0'));module[_0x0ed8('0x1')]={'name':{'type':Sequelize[_0x0ed8('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x0ed8('0x2')]},'username':{'type':Sequelize[_0x0ed8('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0ed8('0x3')},'remoteUri':{'type':Sequelize[_0x0ed8('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x0ed8('0x2')]},'accessKey':{'type':Sequelize[_0x0ed8('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 56eb3ea..377326f 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 _0xe74a=['startsWith','picklist','picklistValues','value','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../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~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerAccount,\x20%s,\x20%s','message','result','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','end','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','field','options','VtigerAccount','count','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','findOne','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','VtigerConfiguration','VtigerField','md5','username','description','remoteUri','accessKey','moduleName','slice','substring','lastIndexOf','%s/webservice.php','GET','getchallenge','success','POST','login','describe','sessionName','autogenerated','owner','remove','includes','editable','false','label'];(function(_0x3de873,_0x174b5f){var _0x380b8c=function(_0x313dea){while(--_0x313dea){_0x3de873['push'](_0x3de873['shift']());}};_0x380b8c(++_0x174b5f);}(_0xe74a,0x94));var _0xae74=function(_0x137f1a,_0x2887df){_0x137f1a=_0x137f1a-0x0;var _0x439923=_0xe74a[_0x137f1a];return _0x439923;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xae74('0x0'));var rimraf=require(_0xae74('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xae74('0x2'));var rp=require(_0xae74('0x3'));var moment=require(_0xae74('0x4'));var BPromise=require(_0xae74('0x5'));var Mustache=require(_0xae74('0x6'));var util=require(_0xae74('0x7'));var path=require(_0xae74('0x8'));var sox=require(_0xae74('0x9'));var csv=require(_0xae74('0xa'));var ejs=require(_0xae74('0xb'));var fs=require('fs');var _=require(_0xae74('0xc'));var squel=require(_0xae74('0xd'));var crypto=require(_0xae74('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xae74('0xf'));var toCsv=require('to-csv');var querystring=require(_0xae74('0x10'));var Papa=require(_0xae74('0x11'));var Redis=require(_0xae74('0x12'));var authService=require(_0xae74('0x13'));var qs=require(_0xae74('0x14'));var as=require(_0xae74('0x15'));var hardwareService=require(_0xae74('0x16'));var logger=require('../../config/logger')(_0xae74('0x17'));var utils=require(_0xae74('0x18'));var config=require(_0xae74('0x19'));var db=require(_0xae74('0x1a'))['db'];var integrations=require(_0xae74('0x1b'));var jayson=require(_0xae74('0x1c'));var client=jayson[_0xae74('0x1d')][_0xae74('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x51718a,_0x2453e3,_0x22a2d4){if(_0x22a2d4){var _0x4abb28=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4abb28['test'](_0x2453e3)){return _0x51718a;}else{throw new Error(_0xae74('0x1f'));}}else{return _0x51718a;}}function respondWithRpcPromise(_0x2c7377,_0x12483f,_0x578eda,_0x21fc70){return new BPromise(function(_0x6fa677,_0x3021b4){var _0xb2e8bf=_0x21fc70||client;return _0xb2e8bf[_0xae74('0x20')](_0x2c7377,_0x578eda)[_0xae74('0x21')](function(_0x543182){logger[_0xae74('0x22')]('VtigerAccount,\x20%s,\x20%s',_0x12483f,_0xae74('0x23'));logger[_0xae74('0x24')](_0xae74('0x25'),_0x12483f,_0xae74('0x23'),JSON[_0xae74('0x26')](_0x543182));if(_0x543182[_0xae74('0x27')]){if(_0x543182['error'][_0xae74('0x28')]===0x1f4){logger['error'](_0xae74('0x29'),_0x12483f,_0x543182[_0xae74('0x27')]['message']);return _0x3021b4(_0x543182[_0xae74('0x27')][_0xae74('0x2a')]);}logger[_0xae74('0x27')]('VtigerAccount,\x20%s,\x20%s',_0x12483f,_0x543182[_0xae74('0x27')][_0xae74('0x2a')]);return _0x6fa677(_0x543182[_0xae74('0x27')][_0xae74('0x2a')]);}else{logger['info'](_0xae74('0x29'),_0x12483f,_0xae74('0x23'));_0x6fa677(_0x543182[_0xae74('0x2b')]['message']);}})['catch'](function(_0x29e301){logger[_0xae74('0x27')](_0xae74('0x29'),_0x12483f,_0x29e301);_0x3021b4(_0x29e301);});});}function respondWithStatusCode(_0x474394,_0x593843){_0x593843=_0x593843||0xcc;return function(_0x1ca9ba){if(_0x1ca9ba){return _0x474394[_0xae74('0x2c')](_0x593843);}return _0x474394[_0xae74('0x2d')](_0x593843)['end']();};}function respondWithResult(_0x13f8d9,_0x33e1ce){_0x33e1ce=_0x33e1ce||0xc8;return function(_0x37e12f){if(_0x37e12f){return _0x13f8d9[_0xae74('0x2d')](_0x33e1ce)[_0xae74('0x2e')](_0x37e12f);}};}function respondWithFilteredResult(_0x49f513,_0x5bbc58){return function(_0x25684e){if(_0x25684e){var _0x1896e1=_0x25684e['count'],_0x555fd2=_0x5bbc58[_0xae74('0x2f')],_0x21cbfe=_0x5bbc58[_0xae74('0x2f')]+_0x5bbc58[_0xae74('0x30')],_0x56b8c6;if(_0x21cbfe>=_0x1896e1){_0x21cbfe=_0x1896e1;_0x56b8c6=0xc8;}else{_0x56b8c6=0xce;}_0x49f513['status'](_0x56b8c6);return _0x49f513[_0xae74('0x31')](_0xae74('0x32'),_0x555fd2+'-'+_0x21cbfe+'/'+_0x1896e1)[_0xae74('0x2e')](_0x25684e);}return null;};}function patchUpdates(_0x1ab4d5){return function(_0x36b85e){try{jsonpatch[_0xae74('0x33')](_0x36b85e,_0x1ab4d5,!![]);}catch(_0x294a9c){return BPromise[_0xae74('0x34')](_0x294a9c);}return _0x36b85e[_0xae74('0x35')]();};}function saveUpdates(_0x50a07b,_0x14843d){return function(_0x9ee372){if(_0x9ee372){return _0x9ee372[_0xae74('0x36')](_0x50a07b)[_0xae74('0x21')](function(_0x581d02){return _0x581d02;});}return null;};}function removeEntity(_0x55e42f,_0x395d90){return function(_0x469dad){if(_0x469dad){return _0x469dad[_0xae74('0x37')]()[_0xae74('0x21')](function(){_0x55e42f[_0xae74('0x2d')](0xcc)[_0xae74('0x38')]();});}};}function handleEntityNotFound(_0x5b7bfc,_0x30f143){return function(_0x5f08f3){if(!_0x5f08f3){_0x5b7bfc[_0xae74('0x2c')](0x194);}return _0x5f08f3;};}function handleError(_0xf12a3b,_0x1f8233){_0x1f8233=_0x1f8233||0x1f4;return function(_0x4f53d7){logger[_0xae74('0x27')](_0x4f53d7[_0xae74('0x39')]);if(_0x4f53d7[_0xae74('0x3a')]){delete _0x4f53d7[_0xae74('0x3a')];}_0xf12a3b[_0xae74('0x2d')](_0x1f8233)[_0xae74('0x3b')](_0x4f53d7);};}exports[_0xae74('0x3c')]=function(_0x164a08,_0x3ec1e8){var _0xb085da={},_0x593702={},_0x24e7b5={'count':0x0,'rows':[]};var _0x57ef1e=_[_0xae74('0x3d')](db['VtigerAccount'][_0xae74('0x3e')],function(_0x40ab4a){return{'name':_0x40ab4a[_0xae74('0x3f')],'type':_0x40ab4a[_0xae74('0x40')][_0xae74('0x41')]};});_0x593702[_0xae74('0x42')]=_[_0xae74('0x3d')](_0x57ef1e,'name');_0x593702[_0xae74('0x43')]=_[_0xae74('0x44')](_0x164a08[_0xae74('0x43')]);_0x593702['filters']=_[_0xae74('0x45')](_0x593702[_0xae74('0x42')],_0x593702[_0xae74('0x43')]);_0xb085da[_0xae74('0x46')]=_['intersection'](_0x593702[_0xae74('0x42')],qs[_0xae74('0x47')](_0x164a08['query']['fields']));_0xb085da[_0xae74('0x46')]=_0xb085da[_0xae74('0x46')]['length']?_0xb085da[_0xae74('0x46')]:_0x593702[_0xae74('0x42')];if(!_0x164a08[_0xae74('0x43')][_0xae74('0x48')](_0xae74('0x49'))){_0xb085da['limit']=qs[_0xae74('0x30')](_0x164a08[_0xae74('0x43')][_0xae74('0x30')]);_0xb085da['offset']=qs[_0xae74('0x2f')](_0x164a08[_0xae74('0x43')][_0xae74('0x2f')]);}_0xb085da[_0xae74('0x4a')]=qs[_0xae74('0x4b')](_0x164a08[_0xae74('0x43')]['sort']);_0xb085da[_0xae74('0x4c')]=qs['filters'](_[_0xae74('0x4d')](_0x164a08[_0xae74('0x43')],_0x593702[_0xae74('0x4e')]));if(_0x164a08[_0xae74('0x43')][_0xae74('0x4f')]){_0xb085da[_0xae74('0x4c')]=_[_0xae74('0x50')](_0xb085da['where'],{'$or':_[_0xae74('0x3d')](_0x57ef1e,function(_0x1762ac){if(_0x1762ac[_0xae74('0x40')][_0xae74('0x41')]!=='VIRTUAL'){var _0x3e071e={};_0x3e071e[_0x1762ac[_0xae74('0x51')]]={'$like':'%'+_0x164a08['query'][_0xae74('0x4f')]+'%'};return _0x3e071e;}})});}_0xb085da=_[_0xae74('0x50')]({},_0xb085da,_0x164a08[_0xae74('0x52')]);var _0x5f2d91={'where':_0xb085da[_0xae74('0x4c')]};return db[_0xae74('0x53')][_0xae74('0x54')](_0x5f2d91)[_0xae74('0x21')](function(_0x2d0890){_0x24e7b5[_0xae74('0x54')]=_0x2d0890;if(_0x164a08[_0xae74('0x43')][_0xae74('0x55')]){_0xb085da[_0xae74('0x56')]=[{'all':!![]}];}return db[_0xae74('0x53')][_0xae74('0x57')](_0xb085da);})[_0xae74('0x21')](function(_0x5d188c){_0x24e7b5[_0xae74('0x58')]=_0x5d188c;return _0x24e7b5;})[_0xae74('0x21')](respondWithFilteredResult(_0x3ec1e8,_0xb085da))[_0xae74('0x59')](handleError(_0x3ec1e8,null));};exports[_0xae74('0x5a')]=function(_0x368839,_0x171f9a){var _0x38bcc={'raw':![],'where':{'id':_0x368839[_0xae74('0x5b')]['id']}},_0x1086a2={};_0x1086a2['model']=_[_0xae74('0x44')](db['VtigerAccount'][_0xae74('0x3e')]);_0x1086a2[_0xae74('0x43')]=_['keys'](_0x368839[_0xae74('0x43')]);_0x1086a2[_0xae74('0x4e')]=_[_0xae74('0x45')](_0x1086a2[_0xae74('0x42')],_0x1086a2[_0xae74('0x43')]);_0x38bcc['attributes']=_['intersection'](_0x1086a2['model'],qs['fields'](_0x368839[_0xae74('0x43')]['fields']));_0x38bcc[_0xae74('0x46')]=_0x38bcc['attributes'][_0xae74('0x5c')]?_0x38bcc[_0xae74('0x46')]:_0x1086a2[_0xae74('0x42')];if(_0x368839['query'][_0xae74('0x55')]){_0x38bcc['include']=[{'all':!![]}];}_0x38bcc=_[_0xae74('0x50')]({},_0x38bcc,_0x368839[_0xae74('0x52')]);return db[_0xae74('0x53')][_0xae74('0x5d')](_0x38bcc)['then'](handleEntityNotFound(_0x171f9a,null))[_0xae74('0x21')](respondWithResult(_0x171f9a,null))[_0xae74('0x59')](handleError(_0x171f9a,null));};exports[_0xae74('0x5e')]=function(_0x5a9243,_0x17ffad){return db['VtigerAccount'][_0xae74('0x5e')](_0x5a9243[_0xae74('0x5f')],{})[_0xae74('0x21')](respondWithResult(_0x17ffad,0xc9))[_0xae74('0x59')](handleError(_0x17ffad,null));};exports[_0xae74('0x36')]=function(_0x3f07e7,_0xd8148c){if(_0x3f07e7[_0xae74('0x5f')]['id']){delete _0x3f07e7['body']['id'];}return db[_0xae74('0x53')][_0xae74('0x5d')]({'where':{'id':_0x3f07e7[_0xae74('0x5b')]['id']}})[_0xae74('0x21')](handleEntityNotFound(_0xd8148c,null))[_0xae74('0x21')](saveUpdates(_0x3f07e7[_0xae74('0x5f')],null))['then'](respondWithResult(_0xd8148c,null))[_0xae74('0x59')](handleError(_0xd8148c,null));};exports[_0xae74('0x37')]=function(_0x113196,_0x12c506){return db['VtigerAccount'][_0xae74('0x5d')]({'where':{'id':_0x113196['params']['id']}})[_0xae74('0x21')](handleEntityNotFound(_0x12c506,null))[_0xae74('0x21')](removeEntity(_0x12c506,null))['catch'](handleError(_0x12c506,null));};exports['getConfigurations']=function(_0x50b666,_0x1a477a,_0x5c9156){var _0x583d2e={};var _0x1a4f43={};var _0x1f9d42;var _0x5347bc;return db[_0xae74('0x53')][_0xae74('0x60')]({'where':{'id':_0x50b666['params']['id']}})['then'](handleEntityNotFound(_0x1a477a,null))[_0xae74('0x21')](function(_0x4a8af7){if(_0x4a8af7){_0x1f9d42=_0x4a8af7;_0x1a4f43['model']=_[_0xae74('0x44')](db['VtigerConfiguration'][_0xae74('0x3e')]);_0x1a4f43[_0xae74('0x43')]=_['keys'](_0x50b666[_0xae74('0x43')]);_0x1a4f43['filters']=_[_0xae74('0x45')](_0x1a4f43[_0xae74('0x42')],_0x1a4f43[_0xae74('0x43')]);_0x583d2e['attributes']=_[_0xae74('0x45')](_0x1a4f43[_0xae74('0x42')],qs[_0xae74('0x47')](_0x50b666[_0xae74('0x43')][_0xae74('0x47')]));_0x583d2e[_0xae74('0x46')]=_0x583d2e[_0xae74('0x46')][_0xae74('0x5c')]?_0x583d2e[_0xae74('0x46')]:_0x1a4f43['model'];_0x583d2e[_0xae74('0x4a')]=qs[_0xae74('0x4b')](_0x50b666[_0xae74('0x43')][_0xae74('0x4b')]);_0x583d2e[_0xae74('0x4c')]=qs[_0xae74('0x4e')](_[_0xae74('0x4d')](_0x50b666[_0xae74('0x43')],_0x1a4f43['filters']));if(_0x50b666[_0xae74('0x43')][_0xae74('0x4f')]){_0x583d2e[_0xae74('0x4c')]=_[_0xae74('0x50')](_0x583d2e['where'],{'$or':_[_0xae74('0x3d')](_0x583d2e[_0xae74('0x46')],function(_0x20940f){var _0x4981fb={};_0x4981fb[_0x20940f]={'$like':'%'+_0x50b666[_0xae74('0x43')][_0xae74('0x4f')]+'%'};return _0x4981fb;})});}_0x583d2e=_[_0xae74('0x50')]({},_0x583d2e,_0x50b666['options']);return _0x1f9d42[_0xae74('0x61')](_0x583d2e);}})[_0xae74('0x21')](function(_0x295f10){if(_0x295f10){_0x5347bc=_0x295f10[_0xae74('0x5c')];if(!_0x50b666['query']['hasOwnProperty'](_0xae74('0x49'))){_0x583d2e[_0xae74('0x30')]=qs['limit'](_0x50b666['query']['limit']);_0x583d2e[_0xae74('0x2f')]=qs[_0xae74('0x2f')](_0x50b666[_0xae74('0x43')][_0xae74('0x2f')]);}return _0x1f9d42[_0xae74('0x61')](_0x583d2e);}})[_0xae74('0x21')](function(_0x134a39){if(_0x134a39){return _0x134a39?{'count':_0x5347bc,'rows':_0x134a39}:null;}})[_0xae74('0x21')](respondWithResult(_0x1a477a,null))[_0xae74('0x59')](handleError(_0x1a477a,null));};exports[_0xae74('0x62')]=function(_0x1262b9,_0x104327,_0xdd692b){if(_0x1262b9[_0xae74('0x5f')]['id']){delete _0x1262b9['body']['id'];}return db[_0xae74('0x53')][_0xae74('0x60')]({'where':{'id':_0x1262b9[_0xae74('0x5b')]['id']}})[_0xae74('0x21')](handleEntityNotFound(_0x104327,null))['then'](function(_0x7b2c56){if(_0x7b2c56){_0x1262b9[_0xae74('0x5f')][_0xae74('0x63')]=_0x7b2c56['id'];_0x1262b9[_0xae74('0x5f')][_0xae74('0x64')]=integrations[_0xae74('0x65')](_0x1262b9[_0xae74('0x5f')][_0xae74('0x66')],_0x1262b9[_0xae74('0x5f')][_0xae74('0x40')]);_0x1262b9[_0xae74('0x5f')][_0xae74('0x67')]=integrations['getDescriptions'](_0x1262b9[_0xae74('0x5f')][_0xae74('0x66')],_0x1262b9[_0xae74('0x5f')]['type']);return db[_0xae74('0x68')]['create'](_0x1262b9[_0xae74('0x5f')],{'include':[{'model':db[_0xae74('0x69')],'as':'Subjects'},{'model':db['VtigerField'],'as':_0xae74('0x67')}]});}return null;})[_0xae74('0x21')](respondWithResult(_0x104327,null))['catch'](handleError(_0x104327,null));};var md5=require(_0xae74('0x6a'));exports['getFields']=function(_0x113b16,_0x398c53,_0x373b6f){var _0x253109=null;var _0x294e23=null;var _0x37ed2e=null;var _0x586e64=null;var _0x2cd8b1='';return db['VtigerAccount'][_0xae74('0x60')]({'where':{'id':_0x113b16[_0xae74('0x5b')]['id']},'attributes':['id','name',_0xae74('0x6b'),_0xae74('0x6c'),'moduleName',_0xae74('0x6d'),'serverUrl',_0xae74('0x6e')]})[_0xae74('0x21')](handleEntityNotFound(_0x398c53,null))[_0xae74('0x21')](function(_0x2e0aa1){if(_0x2e0aa1){_0x253109=_0x2e0aa1[_0xae74('0x6b')];_0x294e23=_0x2e0aa1[_0xae74('0x6e')];_0x37ed2e=_0x2e0aa1[_0xae74('0x6f')];_0x2cd8b1=_0x2e0aa1['remoteUri'];var _0x8fde2d=_0x2cd8b1[_0xae74('0x70')](-0x1);if(_0x8fde2d==='/'){_0x2cd8b1=_0x2cd8b1[_0xae74('0x71')](0x0,_0x2cd8b1[_0xae74('0x72')](_0x8fde2d));}_0x586e64=util['format'](_0xae74('0x73'),_0x2cd8b1);var _0xf74124={'method':_0xae74('0x74'),'uri':_0x586e64,'qs':{'operation':_0xae74('0x75'),'username':_0x2e0aa1[_0xae74('0x6b')]},'json':!![]};return rp(_0xf74124);}})[_0xae74('0x21')](function(_0x2a8f21){if(_0x2a8f21[_0xae74('0x76')]){var _0x1ed799={'method':_0xae74('0x77'),'uri':_0x586e64,'form':{'operation':_0xae74('0x78'),'username':_0x253109,'accessKey':md5(_0x2a8f21[_0xae74('0x2b')]['token']+_0x294e23)},'json':!![]};return rp(_0x1ed799);}})[_0xae74('0x21')](function(_0x16d4aa){if(_0x16d4aa['success']){var _0x2129bf={'method':'GET','uri':_0x586e64,'qs':{'operation':_0xae74('0x79'),'username':_0x253109,'sessionName':_0x16d4aa[_0xae74('0x2b')][_0xae74('0x7a')],'elementType':_0x37ed2e},'json':!![]};return rp(_0x2129bf);}})[_0xae74('0x21')](function(_0x1f99fe){if(_0x1f99fe[_0xae74('0x76')]){var _0x38a065=[_0xae74('0x7b'),'reference',_0xae74('0x7c')];_[_0xae74('0x7d')](_0x1f99fe[_0xae74('0x2b')]['fields'],function(_0x22da13){return _0x38a065[_0xae74('0x7e')](_0x22da13[_0xae74('0x40')]['name']);});_[_0xae74('0x7d')](_0x1f99fe[_0xae74('0x2b')][_0xae74('0x47')],function(_0x44b514){return _0x44b514[_0xae74('0x7f')]===_0xae74('0x80');});return{'count':_0x1f99fe[_0xae74('0x2b')][_0xae74('0x47')][_0xae74('0x5c')],'rows':_[_0xae74('0x3d')](_0x1f99fe[_0xae74('0x2b')][_0xae74('0x47')],function(_0x1c119d){return{'id':_0x1c119d['name'],'name':_0x1c119d[_0xae74('0x81')],'custom':_[_0xae74('0x82')](_0x1c119d['name'],'cf_')?!![]:![],'options':_0x1c119d[_0xae74('0x40')][_0xae74('0x3a')]===_0xae74('0x83')&&_0x1c119d[_0xae74('0x40')][_0xae74('0x84')]['length']>0x0?_[_0xae74('0x3d')](_0x1c119d[_0xae74('0x40')][_0xae74('0x84')],function(_0x1fb1fa){return{'name':_0x1fb1fa[_0xae74('0x81')],'value':_0x1fb1fa[_0xae74('0x85')]};}):[]};})};}})[_0xae74('0x21')](respondWithResult(_0x398c53,null))[_0xae74('0x59')](function(_0x20a1d1){console['log'](_0xae74('0x86')+_0x20a1d1);var _0x19d149=_0x113b16['query'][_0xae74('0x87')]?0x1f4:_0x20a1d1[_0xae74('0x88')]||0x1f4;logger[_0xae74('0x27')](_0xae74('0x89'),_0xae74('0x8a'),_0x19d149,JSON['stringify'](_0x20a1d1));delete _0x20a1d1['name'];if(_0x19d149===0x191){_0x19d149=0x190;}_0x398c53[_0xae74('0x2d')](_0x19d149)[_0xae74('0x3b')](_0x113b16[_0xae74('0x43')][_0xae74('0x87')]?{'message':'Wrong\x20credentials','statusCode':_0x20a1d1[_0xae74('0x88')]}:_0x20a1d1);});}; \ No newline at end of file +var _0x17f0=['AccountId','Subjects','getSubjects','channel','Descriptions','VtigerField','getFields','username','description','remoteUri','serverUrl','accessKey','moduleName','substring','lastIndexOf','format','GET','login','token','sessionName','success','autogenerated','owner','remove','includes','editable','false','label','startsWith','cf_','picklistValues','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','http','test','request','then','info','debug','stringify','error','code','message','VtigerAccount,\x20%s,\x20%s','result','catch','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','update','destroy','name','index','map','VtigerAccount','fieldName','keys','query','filters','intersection','model','attributes','fields','length','order','sort','filter','where','type','VIRTUAL','field','merge','includeAll','findAll','rows','show','params','include','options','create','body','find','getConfigurations','findOne','VtigerConfiguration','rawAttributes','pick','hasOwnProperty','nolimit','addConfiguration'];(function(_0xeb7d44,_0x91a742){var _0x32cdf1=function(_0x1f0dec){while(--_0x1f0dec){_0xeb7d44['push'](_0xeb7d44['shift']());}};_0x32cdf1(++_0x91a742);}(_0x17f0,0x11a));var _0x017f=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0x17f0[_0x25e7cb];return _0x375d92;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x017f('0x0'));var rimraf=require(_0x017f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x017f('0x2'));var rp=require(_0x017f('0x3'));var moment=require(_0x017f('0x4'));var BPromise=require(_0x017f('0x5'));var Mustache=require('mustache');var util=require(_0x017f('0x6'));var path=require(_0x017f('0x7'));var sox=require(_0x017f('0x8'));var csv=require('to-csv');var ejs=require(_0x017f('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x017f('0xa'));var crypto=require(_0x017f('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x017f('0xc'));var toCsv=require(_0x017f('0xd'));var querystring=require(_0x017f('0xe'));var Papa=require(_0x017f('0xf'));var Redis=require('ioredis');var authService=require(_0x017f('0x10'));var qs=require(_0x017f('0x11'));var as=require(_0x017f('0x12'));var hardwareService=require(_0x017f('0x13'));var logger=require('../../config/logger')(_0x017f('0x14'));var utils=require(_0x017f('0x15'));var config=require(_0x017f('0x16'));var db=require(_0x017f('0x17'))['db'];var integrations=require(_0x017f('0x18'));var jayson=require(_0x017f('0x19'));var client=jayson['client'][_0x017f('0x1a')]({'port':0x232a});function checkPasswordPattern(_0xcefcc7,_0x11b6d4,_0x1be2d1){if(_0x1be2d1){var _0x93659=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x93659[_0x017f('0x1b')](_0x11b6d4)){return _0xcefcc7;}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 _0xcefcc7;}}function respondWithRpcPromise(_0x4f7480,_0x3260ce,_0x4c3e92,_0x39bb7b){return new BPromise(function(_0x2fb56e,_0x15d1fd){var _0x3eae8f=_0x39bb7b||client;return _0x3eae8f[_0x017f('0x1c')](_0x4f7480,_0x4c3e92)[_0x017f('0x1d')](function(_0x31c679){logger[_0x017f('0x1e')]('VtigerAccount,\x20%s,\x20%s',_0x3260ce,'request\x20sent');logger[_0x017f('0x1f')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x3260ce,'request\x20sent',JSON[_0x017f('0x20')](_0x31c679));if(_0x31c679['error']){if(_0x31c679[_0x017f('0x21')][_0x017f('0x22')]===0x1f4){logger[_0x017f('0x21')]('VtigerAccount,\x20%s,\x20%s',_0x3260ce,_0x31c679[_0x017f('0x21')]['message']);return _0x15d1fd(_0x31c679[_0x017f('0x21')][_0x017f('0x23')]);}logger[_0x017f('0x21')]('VtigerAccount,\x20%s,\x20%s',_0x3260ce,_0x31c679[_0x017f('0x21')][_0x017f('0x23')]);return _0x2fb56e(_0x31c679['error'][_0x017f('0x23')]);}else{logger[_0x017f('0x1e')](_0x017f('0x24'),_0x3260ce,'request\x20sent');_0x2fb56e(_0x31c679[_0x017f('0x25')][_0x017f('0x23')]);}})[_0x017f('0x26')](function(_0xd49e10){logger[_0x017f('0x21')](_0x017f('0x24'),_0x3260ce,_0xd49e10);_0x15d1fd(_0xd49e10);});});}function respondWithStatusCode(_0x51db70,_0x3b7f9d){_0x3b7f9d=_0x3b7f9d||0xcc;return function(_0x53ff8d){if(_0x53ff8d){return _0x51db70[_0x017f('0x27')](_0x3b7f9d);}return _0x51db70[_0x017f('0x28')](_0x3b7f9d)[_0x017f('0x29')]();};}function respondWithResult(_0x1784e4,_0x553f0e){_0x553f0e=_0x553f0e||0xc8;return function(_0x27f342){if(_0x27f342){return _0x1784e4['status'](_0x553f0e)[_0x017f('0x2a')](_0x27f342);}};}function respondWithFilteredResult(_0x2381b8,_0x1d5ebb){return function(_0x12b0a5){if(_0x12b0a5){var _0x14a852=_0x12b0a5[_0x017f('0x2b')],_0x4fb312=_0x1d5ebb[_0x017f('0x2c')],_0x1de9a0=_0x1d5ebb[_0x017f('0x2c')]+_0x1d5ebb[_0x017f('0x2d')],_0x5d32f7;if(_0x1de9a0>=_0x14a852){_0x1de9a0=_0x14a852;_0x5d32f7=0xc8;}else{_0x5d32f7=0xce;}_0x2381b8['status'](_0x5d32f7);return _0x2381b8['set'](_0x017f('0x2e'),_0x4fb312+'-'+_0x1de9a0+'/'+_0x14a852)[_0x017f('0x2a')](_0x12b0a5);}return null;};}function patchUpdates(_0x903a01){return function(_0x136b21){try{jsonpatch[_0x017f('0x2f')](_0x136b21,_0x903a01,!![]);}catch(_0x49bc03){return BPromise[_0x017f('0x30')](_0x49bc03);}return _0x136b21['save']();};}function saveUpdates(_0x4414a3,_0x3c7629){return function(_0x36dad3){if(_0x36dad3){return _0x36dad3[_0x017f('0x31')](_0x4414a3)[_0x017f('0x1d')](function(_0x39743b){return _0x39743b;});}return null;};}function removeEntity(_0x59abd3,_0x268b00){return function(_0x1bf64c){if(_0x1bf64c){return _0x1bf64c[_0x017f('0x32')]()[_0x017f('0x1d')](function(){_0x59abd3[_0x017f('0x28')](0xcc)[_0x017f('0x29')]();});}};}function handleEntityNotFound(_0x1638c1,_0x242a2a){return function(_0x445d17){if(!_0x445d17){_0x1638c1[_0x017f('0x27')](0x194);}return _0x445d17;};}function handleError(_0x32bbd9,_0x4b6995){_0x4b6995=_0x4b6995||0x1f4;return function(_0x5b96d7){logger[_0x017f('0x21')](_0x5b96d7['stack']);if(_0x5b96d7[_0x017f('0x33')]){delete _0x5b96d7[_0x017f('0x33')];}_0x32bbd9[_0x017f('0x28')](_0x4b6995)['send'](_0x5b96d7);};}exports[_0x017f('0x34')]=function(_0xb9cbcc,_0x3de476){var _0x1106a3={},_0x180b8e={},_0xc1e59d={'count':0x0,'rows':[]};var _0x469cf7=_[_0x017f('0x35')](db[_0x017f('0x36')]['rawAttributes'],function(_0x5cd939){return{'name':_0x5cd939[_0x017f('0x37')],'type':_0x5cd939['type']['key']};});_0x180b8e['model']=_['map'](_0x469cf7,_0x017f('0x33'));_0x180b8e['query']=_[_0x017f('0x38')](_0xb9cbcc[_0x017f('0x39')]);_0x180b8e[_0x017f('0x3a')]=_[_0x017f('0x3b')](_0x180b8e[_0x017f('0x3c')],_0x180b8e[_0x017f('0x39')]);_0x1106a3[_0x017f('0x3d')]=_['intersection'](_0x180b8e[_0x017f('0x3c')],qs[_0x017f('0x3e')](_0xb9cbcc[_0x017f('0x39')][_0x017f('0x3e')]));_0x1106a3['attributes']=_0x1106a3[_0x017f('0x3d')][_0x017f('0x3f')]?_0x1106a3['attributes']:_0x180b8e[_0x017f('0x3c')];if(!_0xb9cbcc['query']['hasOwnProperty']('nolimit')){_0x1106a3['limit']=qs[_0x017f('0x2d')](_0xb9cbcc[_0x017f('0x39')][_0x017f('0x2d')]);_0x1106a3[_0x017f('0x2c')]=qs[_0x017f('0x2c')](_0xb9cbcc[_0x017f('0x39')][_0x017f('0x2c')]);}_0x1106a3[_0x017f('0x40')]=qs['sort'](_0xb9cbcc[_0x017f('0x39')][_0x017f('0x41')]);_0x1106a3['where']=qs[_0x017f('0x3a')](_['pick'](_0xb9cbcc[_0x017f('0x39')],_0x180b8e[_0x017f('0x3a')]));if(_0xb9cbcc[_0x017f('0x39')][_0x017f('0x42')]){_0x1106a3['where']=_['merge'](_0x1106a3[_0x017f('0x43')],{'$or':_[_0x017f('0x35')](_0x469cf7,function(_0x40f3f9){if(_0x40f3f9[_0x017f('0x44')]['key']!==_0x017f('0x45')){var _0x177dd7={};_0x177dd7[_0x40f3f9[_0x017f('0x46')]]={'$like':'%'+_0xb9cbcc['query'][_0x017f('0x42')]+'%'};return _0x177dd7;}})});}_0x1106a3=_[_0x017f('0x47')]({},_0x1106a3,_0xb9cbcc['options']);var _0x6b7bd7={'where':_0x1106a3[_0x017f('0x43')]};return db[_0x017f('0x36')][_0x017f('0x2b')](_0x6b7bd7)['then'](function(_0x5571b7){_0xc1e59d['count']=_0x5571b7;if(_0xb9cbcc[_0x017f('0x39')][_0x017f('0x48')]){_0x1106a3['include']=[{'all':!![]}];}return db[_0x017f('0x36')][_0x017f('0x49')](_0x1106a3);})[_0x017f('0x1d')](function(_0x42713f){_0xc1e59d[_0x017f('0x4a')]=_0x42713f;return _0xc1e59d;})['then'](respondWithFilteredResult(_0x3de476,_0x1106a3))[_0x017f('0x26')](handleError(_0x3de476,null));};exports[_0x017f('0x4b')]=function(_0x1b1d81,_0x433101){var _0x36a971={'raw':![],'where':{'id':_0x1b1d81[_0x017f('0x4c')]['id']}},_0x1dc855={};_0x1dc855['model']=_[_0x017f('0x38')](db[_0x017f('0x36')]['rawAttributes']);_0x1dc855[_0x017f('0x39')]=_['keys'](_0x1b1d81[_0x017f('0x39')]);_0x1dc855[_0x017f('0x3a')]=_[_0x017f('0x3b')](_0x1dc855['model'],_0x1dc855[_0x017f('0x39')]);_0x36a971[_0x017f('0x3d')]=_[_0x017f('0x3b')](_0x1dc855[_0x017f('0x3c')],qs['fields'](_0x1b1d81['query'][_0x017f('0x3e')]));_0x36a971[_0x017f('0x3d')]=_0x36a971[_0x017f('0x3d')][_0x017f('0x3f')]?_0x36a971[_0x017f('0x3d')]:_0x1dc855[_0x017f('0x3c')];if(_0x1b1d81[_0x017f('0x39')][_0x017f('0x48')]){_0x36a971[_0x017f('0x4d')]=[{'all':!![]}];}_0x36a971=_[_0x017f('0x47')]({},_0x36a971,_0x1b1d81[_0x017f('0x4e')]);return db[_0x017f('0x36')]['find'](_0x36a971)[_0x017f('0x1d')](handleEntityNotFound(_0x433101,null))[_0x017f('0x1d')](respondWithResult(_0x433101,null))[_0x017f('0x26')](handleError(_0x433101,null));};exports[_0x017f('0x4f')]=function(_0x4eddf4,_0x288b6d){return db['VtigerAccount']['create'](_0x4eddf4[_0x017f('0x50')],{})[_0x017f('0x1d')](respondWithResult(_0x288b6d,0xc9))[_0x017f('0x26')](handleError(_0x288b6d,null));};exports[_0x017f('0x31')]=function(_0x32ee60,_0x46fd9b){if(_0x32ee60[_0x017f('0x50')]['id']){delete _0x32ee60[_0x017f('0x50')]['id'];}return db[_0x017f('0x36')][_0x017f('0x51')]({'where':{'id':_0x32ee60[_0x017f('0x4c')]['id']}})[_0x017f('0x1d')](handleEntityNotFound(_0x46fd9b,null))[_0x017f('0x1d')](saveUpdates(_0x32ee60[_0x017f('0x50')],null))[_0x017f('0x1d')](respondWithResult(_0x46fd9b,null))[_0x017f('0x26')](handleError(_0x46fd9b,null));};exports[_0x017f('0x32')]=function(_0x4d38e4,_0x593c4a){return db[_0x017f('0x36')][_0x017f('0x51')]({'where':{'id':_0x4d38e4['params']['id']}})[_0x017f('0x1d')](handleEntityNotFound(_0x593c4a,null))[_0x017f('0x1d')](removeEntity(_0x593c4a,null))[_0x017f('0x26')](handleError(_0x593c4a,null));};exports[_0x017f('0x52')]=function(_0x4c9c24,_0x22242b,_0x4c5b68){var _0x5e22cf={};var _0x2db48d={};var _0x36a9b2;var _0x3c05bc;return db[_0x017f('0x36')][_0x017f('0x53')]({'where':{'id':_0x4c9c24[_0x017f('0x4c')]['id']}})[_0x017f('0x1d')](handleEntityNotFound(_0x22242b,null))['then'](function(_0x177276){if(_0x177276){_0x36a9b2=_0x177276;_0x2db48d[_0x017f('0x3c')]=_['keys'](db[_0x017f('0x54')][_0x017f('0x55')]);_0x2db48d[_0x017f('0x39')]=_['keys'](_0x4c9c24[_0x017f('0x39')]);_0x2db48d[_0x017f('0x3a')]=_[_0x017f('0x3b')](_0x2db48d[_0x017f('0x3c')],_0x2db48d[_0x017f('0x39')]);_0x5e22cf[_0x017f('0x3d')]=_[_0x017f('0x3b')](_0x2db48d[_0x017f('0x3c')],qs[_0x017f('0x3e')](_0x4c9c24['query'][_0x017f('0x3e')]));_0x5e22cf[_0x017f('0x3d')]=_0x5e22cf[_0x017f('0x3d')][_0x017f('0x3f')]?_0x5e22cf[_0x017f('0x3d')]:_0x2db48d['model'];_0x5e22cf[_0x017f('0x40')]=qs[_0x017f('0x41')](_0x4c9c24[_0x017f('0x39')]['sort']);_0x5e22cf[_0x017f('0x43')]=qs[_0x017f('0x3a')](_[_0x017f('0x56')](_0x4c9c24[_0x017f('0x39')],_0x2db48d[_0x017f('0x3a')]));if(_0x4c9c24['query'][_0x017f('0x42')]){_0x5e22cf[_0x017f('0x43')]=_['merge'](_0x5e22cf[_0x017f('0x43')],{'$or':_['map'](_0x5e22cf['attributes'],function(_0xe9276c){var _0x4bf829={};_0x4bf829[_0xe9276c]={'$like':'%'+_0x4c9c24['query'][_0x017f('0x42')]+'%'};return _0x4bf829;})});}_0x5e22cf=_[_0x017f('0x47')]({},_0x5e22cf,_0x4c9c24[_0x017f('0x4e')]);return _0x36a9b2['getConfigurations'](_0x5e22cf);}})[_0x017f('0x1d')](function(_0x4cea04){if(_0x4cea04){_0x3c05bc=_0x4cea04[_0x017f('0x3f')];if(!_0x4c9c24['query'][_0x017f('0x57')](_0x017f('0x58'))){_0x5e22cf['limit']=qs['limit'](_0x4c9c24['query'][_0x017f('0x2d')]);_0x5e22cf['offset']=qs[_0x017f('0x2c')](_0x4c9c24[_0x017f('0x39')][_0x017f('0x2c')]);}return _0x36a9b2[_0x017f('0x52')](_0x5e22cf);}})[_0x017f('0x1d')](function(_0x1f000c){if(_0x1f000c){return _0x1f000c?{'count':_0x3c05bc,'rows':_0x1f000c}:null;}})['then'](respondWithResult(_0x22242b,null))['catch'](handleError(_0x22242b,null));};exports[_0x017f('0x59')]=function(_0x8288f9,_0x52cb20,_0x742915){if(_0x8288f9[_0x017f('0x50')]['id']){delete _0x8288f9['body']['id'];}return db[_0x017f('0x36')]['findOne']({'where':{'id':_0x8288f9[_0x017f('0x4c')]['id']}})['then'](handleEntityNotFound(_0x52cb20,null))[_0x017f('0x1d')](function(_0x11665a){if(_0x11665a){_0x8288f9['body'][_0x017f('0x5a')]=_0x11665a['id'];_0x8288f9['body'][_0x017f('0x5b')]=integrations[_0x017f('0x5c')](_0x8288f9['body'][_0x017f('0x5d')],_0x8288f9['body'][_0x017f('0x44')]);_0x8288f9[_0x017f('0x50')][_0x017f('0x5e')]=integrations['getDescriptions'](_0x8288f9[_0x017f('0x50')][_0x017f('0x5d')],_0x8288f9[_0x017f('0x50')][_0x017f('0x44')]);return db[_0x017f('0x54')][_0x017f('0x4f')](_0x8288f9[_0x017f('0x50')],{'include':[{'model':db[_0x017f('0x5f')],'as':_0x017f('0x5b')},{'model':db[_0x017f('0x5f')],'as':_0x017f('0x5e')}]});}return null;})[_0x017f('0x1d')](respondWithResult(_0x52cb20,null))[_0x017f('0x26')](handleError(_0x52cb20,null));};var md5=require('md5');exports[_0x017f('0x60')]=function(_0x44239b,_0x254cf5,_0x22cef0){var _0x275f48=null;var _0x27842e=null;var _0x3ff7d8=null;var _0x33210f=null;var _0x2bcac6='';return db['VtigerAccount'][_0x017f('0x53')]({'where':{'id':_0x44239b[_0x017f('0x4c')]['id']},'attributes':['id',_0x017f('0x33'),_0x017f('0x61'),_0x017f('0x62'),'moduleName',_0x017f('0x63'),_0x017f('0x64'),'accessKey']})['then'](handleEntityNotFound(_0x254cf5,null))[_0x017f('0x1d')](function(_0x28ad8e){if(_0x28ad8e){_0x275f48=_0x28ad8e[_0x017f('0x61')];_0x27842e=_0x28ad8e[_0x017f('0x65')];_0x3ff7d8=_0x28ad8e[_0x017f('0x66')];_0x2bcac6=_0x28ad8e[_0x017f('0x63')];var _0x5d7343=_0x2bcac6['slice'](-0x1);if(_0x5d7343==='/'){_0x2bcac6=_0x2bcac6[_0x017f('0x67')](0x0,_0x2bcac6[_0x017f('0x68')](_0x5d7343));}_0x33210f=util[_0x017f('0x69')]('%s/webservice.php',_0x2bcac6);var _0x451b25={'method':_0x017f('0x6a'),'uri':_0x33210f,'qs':{'operation':'getchallenge','username':_0x28ad8e[_0x017f('0x61')]},'json':!![]};return rp(_0x451b25);}})[_0x017f('0x1d')](function(_0x31eb42){if(_0x31eb42['success']){var _0x4d59b8={'method':'POST','uri':_0x33210f,'form':{'operation':_0x017f('0x6b'),'username':_0x275f48,'accessKey':md5(_0x31eb42['result'][_0x017f('0x6c')]+_0x27842e)},'json':!![]};return rp(_0x4d59b8);}})[_0x017f('0x1d')](function(_0x5143a1){if(_0x5143a1['success']){var _0x1baab1={'method':_0x017f('0x6a'),'uri':_0x33210f,'qs':{'operation':'describe','username':_0x275f48,'sessionName':_0x5143a1[_0x017f('0x25')][_0x017f('0x6d')],'elementType':_0x3ff7d8},'json':!![]};return rp(_0x1baab1);}})[_0x017f('0x1d')](function(_0x1c1258){if(_0x1c1258[_0x017f('0x6e')]){var _0x46e413=[_0x017f('0x6f'),'reference',_0x017f('0x70')];_[_0x017f('0x71')](_0x1c1258[_0x017f('0x25')][_0x017f('0x3e')],function(_0x383612){return _0x46e413[_0x017f('0x72')](_0x383612[_0x017f('0x44')][_0x017f('0x33')]);});_[_0x017f('0x71')](_0x1c1258[_0x017f('0x25')][_0x017f('0x3e')],function(_0x5b1078){return _0x5b1078[_0x017f('0x73')]===_0x017f('0x74');});return{'count':_0x1c1258[_0x017f('0x25')][_0x017f('0x3e')][_0x017f('0x3f')],'rows':_[_0x017f('0x35')](_0x1c1258['result'][_0x017f('0x3e')],function(_0x405638){return{'id':_0x405638[_0x017f('0x33')],'name':_0x405638[_0x017f('0x75')],'custom':_[_0x017f('0x76')](_0x405638['name'],_0x017f('0x77'))?!![]:![],'options':_0x405638['type']['name']==='picklist'&&_0x405638[_0x017f('0x44')][_0x017f('0x78')][_0x017f('0x3f')]>0x0?_['map'](_0x405638['type'][_0x017f('0x78')],function(_0x1cca94){return{'name':_0x1cca94['label'],'value':_0x1cca94['value']};}):[]};})};}})[_0x017f('0x1d')](respondWithResult(_0x254cf5,null))[_0x017f('0x26')](function(_0x5ecf24){console['log']('vTiger\x20error:\x20'+_0x5ecf24);var _0x2698a7=_0x44239b[_0x017f('0x39')][_0x017f('0x1b')]?0x1f4:_0x5ecf24[_0x017f('0x79')]||0x1f4;logger['error'](_0x017f('0x7a'),_0x017f('0x60'),_0x2698a7,JSON[_0x017f('0x20')](_0x5ecf24));delete _0x5ecf24[_0x017f('0x33')];if(_0x2698a7===0x191){_0x2698a7=0x190;}_0x254cf5['status'](_0x2698a7)['send'](_0x44239b[_0x017f('0x39')][_0x017f('0x1b')]?{'message':_0x017f('0x7b'),'statusCode':_0x5ecf24['statusCode']}:_0x5ecf24);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 4f45b0c..dcdb30c 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 _0xd8c9=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','VtigerAccount','int_vtiger_accounts','lodash'];(function(_0x4f2a0e,_0x242aa6){var _0x2f3461=function(_0x2c17b5){while(--_0x2c17b5){_0x4f2a0e['push'](_0x4f2a0e['shift']());}};_0x2f3461(++_0x242aa6);}(_0xd8c9,0x6f));var _0x9d8c=function(_0x10cac9,_0xdb4b81){_0x10cac9=_0x10cac9-0x0;var _0x3ce47e=_0xd8c9[_0x10cac9];return _0x3ce47e;};'use strict';var _=require(_0x9d8c('0x0'));var util=require(_0x9d8c('0x1'));var logger=require(_0x9d8c('0x2'))(_0x9d8c('0x3'));var moment=require(_0x9d8c('0x4'));var BPromise=require(_0x9d8c('0x5'));var rp=require(_0x9d8c('0x6'));var fs=require('fs');var path=require(_0x9d8c('0x7'));var rimraf=require('rimraf');var config=require(_0x9d8c('0x8'));var attributes=require(_0x9d8c('0x9'));var integrations=require(_0x9d8c('0xa'));module[_0x9d8c('0xb')]=function(_0x18789a,_0x53a57e){return _0x18789a['define'](_0x9d8c('0xc'),attributes,{'tableName':_0x9d8c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe103=['exports','define','VtigerAccount','int_vtiger_accounts','lodash','util','api','moment','request-promise','path','./intVtigerAccount.attributes'];(function(_0x693080,_0x57d1bb){var _0x225e1d=function(_0x235bf2){while(--_0x235bf2){_0x693080['push'](_0x693080['shift']());}};_0x225e1d(++_0x57d1bb);}(_0xe103,0x1d2));var _0x3e10=function(_0x3d0978,_0x2465e2){_0x3d0978=_0x3d0978-0x0;var _0x563357=_0xe103[_0x3d0978];return _0x563357;};'use strict';var _=require(_0x3e10('0x0'));var util=require(_0x3e10('0x1'));var logger=require('../../config/logger')(_0x3e10('0x2'));var moment=require(_0x3e10('0x3'));var BPromise=require('bluebird');var rp=require(_0x3e10('0x4'));var fs=require('fs');var path=require(_0x3e10('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3e10('0x6'));var integrations=require('../../components/integrations/configuration');module[_0x3e10('0x7')]=function(_0x46b919,_0x4520b8){return _0x46b919[_0x3e10('0x8')](_0x3e10('0x9'),attributes,{'tableName':_0x3e10('0xa'),'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 d1bcec0..2adeba2 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 _0x92be=['jayson/promise','client','http','request','then','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','GetVtigerAccount','VtigerAccount','findAll','options','raw','limit','include','map','model','attributes','catch','where','ShowVtigerAccount','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x2e43c9,_0x4688f9){var _0x2b6116=function(_0x1636d4){while(--_0x1636d4){_0x2e43c9['push'](_0x2e43c9['shift']());}};_0x2b6116(++_0x4688f9);}(_0x92be,0x191));var _0xe92b=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x92be[_0x46e363];return _0x3fb059;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe92b('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe92b('0x1'));var db=require(_0xe92b('0x2'))['db'];var utils=require(_0xe92b('0x3'));var logger=require(_0xe92b('0x4'))(_0xe92b('0x5'));var config=require(_0xe92b('0x6'));var jayson=require(_0xe92b('0x7'));var client=jayson[_0xe92b('0x8')][_0xe92b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2d5375,_0x3d03f6,_0x13e23d){return new BPromise(function(_0x23ceb1,_0x2c2219){return client[_0xe92b('0xa')](_0x2d5375,_0x13e23d)[_0xe92b('0xb')](function(_0x2ab737){logger['info'](_0xe92b('0xc'),_0x3d03f6,_0xe92b('0xd'));logger[_0xe92b('0xe')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x3d03f6,_0xe92b('0xd'),JSON[_0xe92b('0xf')](_0x2ab737));if(_0x2ab737[_0xe92b('0x10')]){if(_0x2ab737[_0xe92b('0x10')][_0xe92b('0x11')]===0x1f4){logger[_0xe92b('0x10')]('VtigerAccount,\x20%s,\x20%s',_0x3d03f6,_0x2ab737['error']['message']);return _0x2c2219(_0x2ab737['error']['message']);}logger['error'](_0xe92b('0xc'),_0x3d03f6,_0x2ab737[_0xe92b('0x10')][_0xe92b('0x12')]);return _0x23ceb1(_0x2ab737[_0xe92b('0x10')][_0xe92b('0x12')]);}else{logger[_0xe92b('0x13')](_0xe92b('0xc'),_0x3d03f6,_0xe92b('0xd'));_0x23ceb1(_0x2ab737[_0xe92b('0x14')][_0xe92b('0x12')]);}})['catch'](function(_0xc94bed){logger[_0xe92b('0x10')](_0xe92b('0xc'),_0x3d03f6,_0xc94bed);_0x2c2219(_0xc94bed);});});}exports[_0xe92b('0x15')]=function(_0x660edb){var _0x452f1e=this;return new Promise(function(_0x4f965d,_0x21f975){return db[_0xe92b('0x16')][_0xe92b('0x17')]({'raw':_0x660edb['options']?_0x660edb[_0xe92b('0x18')][_0xe92b('0x19')]===undefined?!![]:![]:!![],'where':_0x660edb['options']?_0x660edb[_0xe92b('0x18')]['where']||null:null,'attributes':_0x660edb[_0xe92b('0x18')]?_0x660edb[_0xe92b('0x18')]['attributes']||null:null,'limit':_0x660edb['options']?_0x660edb['options'][_0xe92b('0x1a')]||null:null,'include':_0x660edb[_0xe92b('0x18')]?_0x660edb[_0xe92b('0x18')][_0xe92b('0x1b')]?_['map'](_0x660edb[_0xe92b('0x18')][_0xe92b('0x1b')],function(_0x42cd6a){return{'model':db[_0x42cd6a['model']],'as':_0x42cd6a['as'],'attributes':_0x42cd6a['attributes'],'include':_0x42cd6a[_0xe92b('0x1b')]?_[_0xe92b('0x1c')](_0x42cd6a[_0xe92b('0x1b')],function(_0xc5f071){return{'model':db[_0xc5f071[_0xe92b('0x1d')]],'as':_0xc5f071['as'],'attributes':_0xc5f071['attributes'],'include':_0xc5f071[_0xe92b('0x1b')]?_['map'](_0xc5f071['include'],function(_0x7afb1b){return{'model':db[_0x7afb1b[_0xe92b('0x1d')]],'as':_0x7afb1b['as'],'attributes':_0x7afb1b[_0xe92b('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xe92b('0xb')](function(_0x534486){logger[_0xe92b('0x13')]('GetVtigerAccount',_0x660edb);logger['debug'](_0xe92b('0x15'),_0x660edb,JSON[_0xe92b('0xf')](_0x534486));_0x4f965d(_0x534486);})[_0xe92b('0x1f')](function(_0x7c703a){logger[_0xe92b('0x10')]('GetVtigerAccount',_0x7c703a['message'],_0x660edb);_0x21f975(_0x452f1e[_0xe92b('0x10')](0x1f4,_0x7c703a['message']));});});};exports['ShowVtigerAccount']=function(_0x4f7cea){var _0x1ba05e=this;return new Promise(function(_0x2ca74a,_0x3ce22b){return db['VtigerAccount']['find']({'raw':_0x4f7cea['options']?_0x4f7cea[_0xe92b('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x4f7cea[_0xe92b('0x18')]?_0x4f7cea[_0xe92b('0x18')][_0xe92b('0x20')]||null:null,'attributes':_0x4f7cea[_0xe92b('0x18')]?_0x4f7cea['options']['attributes']||null:null,'include':_0x4f7cea[_0xe92b('0x18')]?_0x4f7cea[_0xe92b('0x18')][_0xe92b('0x1b')]?_['map'](_0x4f7cea[_0xe92b('0x18')][_0xe92b('0x1b')],function(_0x10108e){return{'model':db[_0x10108e[_0xe92b('0x1d')]],'as':_0x10108e['as'],'attributes':_0x10108e[_0xe92b('0x1e')],'include':_0x10108e['include']?_[_0xe92b('0x1c')](_0x10108e[_0xe92b('0x1b')],function(_0x122d71){return{'model':db[_0x122d71[_0xe92b('0x1d')]],'as':_0x122d71['as'],'attributes':_0x122d71['attributes'],'include':_0x122d71[_0xe92b('0x1b')]?_[_0xe92b('0x1c')](_0x122d71[_0xe92b('0x1b')],function(_0x325bdf){return{'model':db[_0x325bdf[_0xe92b('0x1d')]],'as':_0x325bdf['as'],'attributes':_0x325bdf['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1c0cc3){logger[_0xe92b('0x13')](_0xe92b('0x21'),_0x4f7cea);logger['debug'](_0xe92b('0x21'),_0x4f7cea,JSON[_0xe92b('0xf')](_0x1c0cc3));_0x2ca74a(_0x1c0cc3);})[_0xe92b('0x1f')](function(_0x4155f1){logger[_0xe92b('0x10')](_0xe92b('0x21'),_0x4155f1[_0xe92b('0x12')],_0x4f7cea);_0x3ce22b(_0x1ba05e[_0xe92b('0x10')](0x1f4,_0x4155f1['message']));});});}; \ No newline at end of file +var _0xd61d=['model','attributes','GetVtigerAccount','debug','ShowVtigerAccount','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','VtigerAccount,\x20%s,\x20%s','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','VtigerAccount','findAll','options','raw','where','include','map'];(function(_0x4fffce,_0x5aeead){var _0x5230eb=function(_0xf765ce){while(--_0xf765ce){_0x4fffce['push'](_0x4fffce['shift']());}};_0x5230eb(++_0x5aeead);}(_0xd61d,0x1cc));var _0xdd61=function(_0x2587cd,_0x5edb21){_0x2587cd=_0x2587cd-0x0;var _0x17112e=_0xd61d[_0x2587cd];return _0x17112e;};'use strict';var _=require(_0xdd61('0x0'));var util=require(_0xdd61('0x1'));var moment=require(_0xdd61('0x2'));var BPromise=require('bluebird');var rs=require(_0xdd61('0x3'));var fs=require('fs');var Redis=require(_0xdd61('0x4'));var db=require(_0xdd61('0x5'))['db'];var utils=require(_0xdd61('0x6'));var logger=require(_0xdd61('0x7'))(_0xdd61('0x8'));var config=require(_0xdd61('0x9'));var jayson=require(_0xdd61('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5784d9,_0x479b43,_0xfb4843){return new BPromise(function(_0x1894dc,_0xc198d4){return client[_0xdd61('0xb')](_0x5784d9,_0xfb4843)[_0xdd61('0xc')](function(_0x521c9b){logger['info'](_0xdd61('0xd'),_0x479b43,'request\x20sent');logger['debug'](_0xdd61('0xe'),_0x479b43,_0xdd61('0xf'),JSON[_0xdd61('0x10')](_0x521c9b));if(_0x521c9b[_0xdd61('0x11')]){if(_0x521c9b['error'][_0xdd61('0x12')]===0x1f4){logger[_0xdd61('0x11')]('VtigerAccount,\x20%s,\x20%s',_0x479b43,_0x521c9b[_0xdd61('0x11')][_0xdd61('0x13')]);return _0xc198d4(_0x521c9b[_0xdd61('0x11')][_0xdd61('0x13')]);}logger[_0xdd61('0x11')]('VtigerAccount,\x20%s,\x20%s',_0x479b43,_0x521c9b['error'][_0xdd61('0x13')]);return _0x1894dc(_0x521c9b['error'][_0xdd61('0x13')]);}else{logger[_0xdd61('0x14')](_0xdd61('0xd'),_0x479b43,_0xdd61('0xf'));_0x1894dc(_0x521c9b[_0xdd61('0x15')][_0xdd61('0x13')]);}})[_0xdd61('0x16')](function(_0x5f3896){logger['error'](_0xdd61('0xd'),_0x479b43,_0x5f3896);_0xc198d4(_0x5f3896);});});}exports['GetVtigerAccount']=function(_0x1de83b){var _0x227638=this;return new Promise(function(_0x3f8fcb,_0x9dd39a){return db[_0xdd61('0x17')][_0xdd61('0x18')]({'raw':_0x1de83b[_0xdd61('0x19')]?_0x1de83b[_0xdd61('0x19')][_0xdd61('0x1a')]===undefined?!![]:![]:!![],'where':_0x1de83b[_0xdd61('0x19')]?_0x1de83b[_0xdd61('0x19')][_0xdd61('0x1b')]||null:null,'attributes':_0x1de83b[_0xdd61('0x19')]?_0x1de83b[_0xdd61('0x19')]['attributes']||null:null,'limit':_0x1de83b[_0xdd61('0x19')]?_0x1de83b[_0xdd61('0x19')]['limit']||null:null,'include':_0x1de83b[_0xdd61('0x19')]?_0x1de83b[_0xdd61('0x19')][_0xdd61('0x1c')]?_[_0xdd61('0x1d')](_0x1de83b[_0xdd61('0x19')][_0xdd61('0x1c')],function(_0x28fdf5){return{'model':db[_0x28fdf5[_0xdd61('0x1e')]],'as':_0x28fdf5['as'],'attributes':_0x28fdf5[_0xdd61('0x1f')],'include':_0x28fdf5[_0xdd61('0x1c')]?_[_0xdd61('0x1d')](_0x28fdf5[_0xdd61('0x1c')],function(_0x55032d){return{'model':db[_0x55032d[_0xdd61('0x1e')]],'as':_0x55032d['as'],'attributes':_0x55032d[_0xdd61('0x1f')],'include':_0x55032d['include']?_[_0xdd61('0x1d')](_0x55032d[_0xdd61('0x1c')],function(_0x42d766){return{'model':db[_0x42d766[_0xdd61('0x1e')]],'as':_0x42d766['as'],'attributes':_0x42d766[_0xdd61('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xdd61('0xc')](function(_0x20aab3){logger[_0xdd61('0x14')](_0xdd61('0x20'),_0x1de83b);logger[_0xdd61('0x21')](_0xdd61('0x20'),_0x1de83b,JSON[_0xdd61('0x10')](_0x20aab3));_0x3f8fcb(_0x20aab3);})['catch'](function(_0x2a078e){logger[_0xdd61('0x11')](_0xdd61('0x20'),_0x2a078e[_0xdd61('0x13')],_0x1de83b);_0x9dd39a(_0x227638['error'](0x1f4,_0x2a078e[_0xdd61('0x13')]));});});};exports[_0xdd61('0x22')]=function(_0x282ea7){var _0x330f6f=this;return new Promise(function(_0x41ca8b,_0x5df5b2){return db['VtigerAccount']['find']({'raw':_0x282ea7[_0xdd61('0x19')]?_0x282ea7[_0xdd61('0x19')][_0xdd61('0x1a')]===undefined?!![]:![]:!![],'where':_0x282ea7[_0xdd61('0x19')]?_0x282ea7['options'][_0xdd61('0x1b')]||null:null,'attributes':_0x282ea7[_0xdd61('0x19')]?_0x282ea7[_0xdd61('0x19')][_0xdd61('0x1f')]||null:null,'include':_0x282ea7[_0xdd61('0x19')]?_0x282ea7[_0xdd61('0x19')][_0xdd61('0x1c')]?_[_0xdd61('0x1d')](_0x282ea7['options'][_0xdd61('0x1c')],function(_0x408987){return{'model':db[_0x408987[_0xdd61('0x1e')]],'as':_0x408987['as'],'attributes':_0x408987['attributes'],'include':_0x408987[_0xdd61('0x1c')]?_[_0xdd61('0x1d')](_0x408987[_0xdd61('0x1c')],function(_0x2c3a9c){return{'model':db[_0x2c3a9c['model']],'as':_0x2c3a9c['as'],'attributes':_0x2c3a9c[_0xdd61('0x1f')],'include':_0x2c3a9c[_0xdd61('0x1c')]?_['map'](_0x2c3a9c[_0xdd61('0x1c')],function(_0x3b4567){return{'model':db[_0x3b4567[_0xdd61('0x1e')]],'as':_0x3b4567['as'],'attributes':_0x3b4567[_0xdd61('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xdd61('0xc')](function(_0x2a2e85){logger[_0xdd61('0x14')](_0xdd61('0x22'),_0x282ea7);logger[_0xdd61('0x21')]('ShowVtigerAccount',_0x282ea7,JSON['stringify'](_0x2a2e85));_0x41ca8b(_0x2a2e85);})['catch'](function(_0x43a632){logger[_0xdd61('0x11')](_0xdd61('0x22'),_0x43a632['message'],_0x282ea7);_0x5df5b2(_0x330f6f[_0xdd61('0x11')](0x1f4,_0x43a632['message']));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index f0099e0..30de870 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 _0xb10b=['/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated'];(function(_0xc470e4,_0x488dc6){var _0x1a5dfc=function(_0x5e9200){while(--_0x5e9200){_0xc470e4['push'](_0xc470e4['shift']());}};_0x1a5dfc(++_0x488dc6);}(_0xb10b,0x12a));var _0xbb10=function(_0x3d7f0e,_0x104d69){_0x3d7f0e=_0x3d7f0e-0x0;var _0x3e45dd=_0xb10b[_0x3d7f0e];return _0x3e45dd;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var auth=require(_0xbb10('0x4'));var interaction=require(_0xbb10('0x5'));var config=require(_0xbb10('0x6'));var controller=require(_0xbb10('0x7'));router[_0xbb10('0x8')]('/',auth[_0xbb10('0x9')](),controller['index']);router[_0xbb10('0x8')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0xb')]);router[_0xbb10('0x8')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0xd')]);router[_0xbb10('0x8')](_0xbb10('0xe'),auth[_0xbb10('0x9')](),controller['getSubjects']);router['get'](_0xbb10('0xf'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x10')]);router['post']('/',auth[_0xbb10('0x9')](),controller['create']);router[_0xbb10('0x11')](_0xbb10('0xa'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x12')]);router[_0xbb10('0x13')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0x14')]);module[_0xbb10('0x15')]=router; \ No newline at end of file +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(_0x34eb31,_0x8f0f70){var _0x254994=function(_0xbec9a3){while(--_0xbec9a3){_0x34eb31['push'](_0x34eb31['shift']());}};_0x254994(++_0x8f0f70);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var auth=require(_0x0d8b('0x3'));var interaction=require(_0x0d8b('0x4'));var config=require(_0x0d8b('0x5'));var controller=require(_0x0d8b('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x0d8b('0x7')]);router[_0x0d8b('0x8')](_0x0d8b('0x9'),auth['isAuthenticated'](),controller[_0x0d8b('0xa')]);router[_0x0d8b('0x8')]('/:id/fields',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0x8')](_0x0d8b('0xd'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0x8')](_0x0d8b('0xf'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['post']('/',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x11')]);router[_0x0d8b('0x12')](_0x0d8b('0x9'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x13')]);router[_0x0d8b('0x14')](_0x0d8b('0x9'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x15')]);module[_0x0d8b('0x16')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index ba778e6..f47bf59 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 _0xd97d=['STRING','exports'];(function(_0xb4f240,_0x15f734){var _0x30682a=function(_0x349112){while(--_0x349112){_0xb4f240['push'](_0xb4f240['shift']());}};_0x30682a(++_0x15f734);}(_0xd97d,0x1d7));var _0xdd97=function(_0x469a3c,_0x5ebc10){_0x469a3c=_0x469a3c-0x0;var _0x968f4=_0xd97d[_0x469a3c];return _0x968f4;};'use strict';var Sequelize=require('sequelize');module[_0xdd97('0x0')]={'name':{'type':Sequelize[_0xdd97('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf45b=['exports','STRING','sequelize'];(function(_0x11d74f,_0x3e392f){var _0x419f9a=function(_0x2ef64a){while(--_0x2ef64a){_0x11d74f['push'](_0x11d74f['shift']());}};_0x419f9a(++_0x3e392f);}(_0xf45b,0x128));var _0xbf45=function(_0x4dfd10,_0x3169d5){_0x4dfd10=_0x4dfd10-0x0;var _0x267950=_0xf45b[_0x4dfd10];return _0x267950;};'use strict';var Sequelize=require(_0xbf45('0x0'));module[_0xbf45('0x1')]={'name':{'type':Sequelize[_0xbf45('0x2')]},'description':{'type':Sequelize[_0xbf45('0x2')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 836c5c4..895d302 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 _0x811a=['code','message','VtigerConfiguration,\x20%s,\x20%s','info','result','catch','sendStatus','status','end','json','count','offset','set','reject','save','destroy','stack','name','index','map','VtigerConfiguration','rawAttributes','fieldName','type','model','query','filters','intersection','fields','length','attributes','hasOwnProperty','limit','order','sort','where','pick','field','filter','options','findAll','rows','show','params','keys','includeAll','merge','create','body','update','find','getFields','findOne','nolimit','getSubjects','VtigerField','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','client','request','then','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x329ee5,_0xd42d0){var _0x23c68c=function(_0x24ebaf){while(--_0x24ebaf){_0x329ee5['push'](_0x329ee5['shift']());}};_0x23c68c(++_0xd42d0);}(_0x811a,0x147));var _0xa811=function(_0x40d301,_0x2501d4){_0x40d301=_0x40d301-0x0;var _0x5b5d90=_0x811a[_0x40d301];return _0x5b5d90;};'use strict';var pdf=require(_0xa811('0x0'));var emlformat=require(_0xa811('0x1'));var rimraf=require(_0xa811('0x2'));var zipdir=require(_0xa811('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa811('0x4'));var moment=require(_0xa811('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa811('0x6'));var path=require(_0xa811('0x7'));var sox=require(_0xa811('0x8'));var csv=require(_0xa811('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xa811('0xa'));var squel=require(_0xa811('0xb'));var crypto=require(_0xa811('0xc'));var jsforce=require(_0xa811('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xa811('0x9'));var querystring=require(_0xa811('0xe'));var Papa=require(_0xa811('0xf'));var Redis=require(_0xa811('0x10'));var authService=require(_0xa811('0x11'));var qs=require(_0xa811('0x12'));var as=require(_0xa811('0x13'));var hardwareService=require(_0xa811('0x14'));var logger=require(_0xa811('0x15'))(_0xa811('0x16'));var utils=require('../../config/utils');var config=require(_0xa811('0x17'));var db=require(_0xa811('0x18'))['db'];var jayson=require(_0xa811('0x19'));var client=jayson[_0xa811('0x1a')]['http']({'port':0x232a});function checkPasswordPattern(_0x59a949,_0x16c2aa,_0x1609d6){if(_0x1609d6){var _0xd64c5d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xd64c5d['test'](_0x16c2aa)){return _0x59a949;}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 _0x59a949;}}function respondWithRpcPromise(_0x554739,_0x3d7f62,_0x42050d,_0x3647a6){return new BPromise(function(_0x35333f,_0x5cf809){var _0x39d3a3=_0x3647a6||client;return _0x39d3a3[_0xa811('0x1b')](_0x554739,_0x42050d)[_0xa811('0x1c')](function(_0x3a359d){logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0x3d7f62,_0xa811('0x1d'));logger['debug'](_0xa811('0x1e'),_0x3d7f62,_0xa811('0x1d'),JSON[_0xa811('0x1f')](_0x3a359d));if(_0x3a359d['error']){if(_0x3a359d[_0xa811('0x20')][_0xa811('0x21')]===0x1f4){logger[_0xa811('0x20')]('VtigerConfiguration,\x20%s,\x20%s',_0x3d7f62,_0x3a359d[_0xa811('0x20')][_0xa811('0x22')]);return _0x5cf809(_0x3a359d[_0xa811('0x20')]['message']);}logger[_0xa811('0x20')](_0xa811('0x23'),_0x3d7f62,_0x3a359d[_0xa811('0x20')][_0xa811('0x22')]);return _0x35333f(_0x3a359d[_0xa811('0x20')]['message']);}else{logger[_0xa811('0x24')]('VtigerConfiguration,\x20%s,\x20%s',_0x3d7f62,_0xa811('0x1d'));_0x35333f(_0x3a359d[_0xa811('0x25')][_0xa811('0x22')]);}})[_0xa811('0x26')](function(_0x561ae7){logger[_0xa811('0x20')](_0xa811('0x23'),_0x3d7f62,_0x561ae7);_0x5cf809(_0x561ae7);});});}function respondWithStatusCode(_0x157c78,_0x2ed3fd){_0x2ed3fd=_0x2ed3fd||0xcc;return function(_0x530d1b){if(_0x530d1b){return _0x157c78[_0xa811('0x27')](_0x2ed3fd);}return _0x157c78[_0xa811('0x28')](_0x2ed3fd)[_0xa811('0x29')]();};}function respondWithResult(_0x3c41d1,_0x386dde){_0x386dde=_0x386dde||0xc8;return function(_0x8233d4){if(_0x8233d4){return _0x3c41d1[_0xa811('0x28')](_0x386dde)[_0xa811('0x2a')](_0x8233d4);}};}function respondWithFilteredResult(_0x161e23,_0x4923c2){return function(_0x716a55){if(_0x716a55){var _0x146604=_0x716a55[_0xa811('0x2b')],_0x580ec1=_0x4923c2[_0xa811('0x2c')],_0x1631c0=_0x4923c2[_0xa811('0x2c')]+_0x4923c2['limit'],_0x3d3531;if(_0x1631c0>=_0x146604){_0x1631c0=_0x146604;_0x3d3531=0xc8;}else{_0x3d3531=0xce;}_0x161e23[_0xa811('0x28')](_0x3d3531);return _0x161e23[_0xa811('0x2d')]('Content-Range',_0x580ec1+'-'+_0x1631c0+'/'+_0x146604)[_0xa811('0x2a')](_0x716a55);}return null;};}function patchUpdates(_0x45140d){return function(_0x2bfc89){try{jsonpatch['apply'](_0x2bfc89,_0x45140d,!![]);}catch(_0x46138a){return BPromise[_0xa811('0x2e')](_0x46138a);}return _0x2bfc89[_0xa811('0x2f')]();};}function saveUpdates(_0x51f663,_0x49e2d9){return function(_0x448620){if(_0x448620){return _0x448620['update'](_0x51f663)[_0xa811('0x1c')](function(_0x559572){return _0x559572;});}return null;};}function removeEntity(_0x41d4f9,_0x382f11){return function(_0x2f07be){if(_0x2f07be){return _0x2f07be[_0xa811('0x30')]()[_0xa811('0x1c')](function(){_0x41d4f9[_0xa811('0x28')](0xcc)[_0xa811('0x29')]();});}};}function handleEntityNotFound(_0xd671e3,_0x1cdaf6){return function(_0xb6793e){if(!_0xb6793e){_0xd671e3['sendStatus'](0x194);}return _0xb6793e;};}function handleError(_0x21ecd2,_0x3f8b95){_0x3f8b95=_0x3f8b95||0x1f4;return function(_0x1544b3){logger['error'](_0x1544b3[_0xa811('0x31')]);if(_0x1544b3[_0xa811('0x32')]){delete _0x1544b3[_0xa811('0x32')];}_0x21ecd2[_0xa811('0x28')](_0x3f8b95)['send'](_0x1544b3);};}exports[_0xa811('0x33')]=function(_0x40e4be,_0x3566b7){var _0x51bf2a={},_0x45c73a={},_0x45ff35={'count':0x0,'rows':[]};var _0x7c23f8=_[_0xa811('0x34')](db[_0xa811('0x35')][_0xa811('0x36')],function(_0x4a87cf){return{'name':_0x4a87cf[_0xa811('0x37')],'type':_0x4a87cf[_0xa811('0x38')]['key']};});_0x45c73a[_0xa811('0x39')]=_[_0xa811('0x34')](_0x7c23f8,'name');_0x45c73a[_0xa811('0x3a')]=_['keys'](_0x40e4be['query']);_0x45c73a[_0xa811('0x3b')]=_[_0xa811('0x3c')](_0x45c73a[_0xa811('0x39')],_0x45c73a['query']);_0x51bf2a['attributes']=_[_0xa811('0x3c')](_0x45c73a[_0xa811('0x39')],qs[_0xa811('0x3d')](_0x40e4be[_0xa811('0x3a')][_0xa811('0x3d')]));_0x51bf2a['attributes']=_0x51bf2a['attributes'][_0xa811('0x3e')]?_0x51bf2a[_0xa811('0x3f')]:_0x45c73a['model'];if(!_0x40e4be[_0xa811('0x3a')][_0xa811('0x40')]('nolimit')){_0x51bf2a[_0xa811('0x41')]=qs[_0xa811('0x41')](_0x40e4be[_0xa811('0x3a')]['limit']);_0x51bf2a[_0xa811('0x2c')]=qs[_0xa811('0x2c')](_0x40e4be[_0xa811('0x3a')][_0xa811('0x2c')]);}_0x51bf2a[_0xa811('0x42')]=qs[_0xa811('0x43')](_0x40e4be['query'][_0xa811('0x43')]);_0x51bf2a[_0xa811('0x44')]=qs[_0xa811('0x3b')](_[_0xa811('0x45')](_0x40e4be['query'],_0x45c73a[_0xa811('0x3b')]));if(_0x40e4be['query']['filter']){_0x51bf2a['where']=_['merge'](_0x51bf2a[_0xa811('0x44')],{'$or':_[_0xa811('0x34')](_0x7c23f8,function(_0x3ae44c){if(_0x3ae44c[_0xa811('0x38')]['key']!=='VIRTUAL'){var _0x241383={};_0x241383[_0x3ae44c[_0xa811('0x46')]]={'$like':'%'+_0x40e4be[_0xa811('0x3a')][_0xa811('0x47')]+'%'};return _0x241383;}})});}_0x51bf2a=_['merge']({},_0x51bf2a,_0x40e4be[_0xa811('0x48')]);var _0x132acc={'where':_0x51bf2a['where']};return db[_0xa811('0x35')][_0xa811('0x2b')](_0x132acc)[_0xa811('0x1c')](function(_0x477e06){_0x45ff35['count']=_0x477e06;if(_0x40e4be['query']['includeAll']){_0x51bf2a['include']=[{'all':!![]}];}return db['VtigerConfiguration'][_0xa811('0x49')](_0x51bf2a);})[_0xa811('0x1c')](function(_0xaa0ebe){_0x45ff35[_0xa811('0x4a')]=_0xaa0ebe;return _0x45ff35;})['then'](respondWithFilteredResult(_0x3566b7,_0x51bf2a))[_0xa811('0x26')](handleError(_0x3566b7,null));};exports[_0xa811('0x4b')]=function(_0x59e7fe,_0x55cfe5){var _0x11e93e={'raw':![],'where':{'id':_0x59e7fe[_0xa811('0x4c')]['id']}},_0x265fa7={};_0x265fa7[_0xa811('0x39')]=_['keys'](db[_0xa811('0x35')]['rawAttributes']);_0x265fa7[_0xa811('0x3a')]=_[_0xa811('0x4d')](_0x59e7fe[_0xa811('0x3a')]);_0x265fa7[_0xa811('0x3b')]=_[_0xa811('0x3c')](_0x265fa7[_0xa811('0x39')],_0x265fa7['query']);_0x11e93e['attributes']=_[_0xa811('0x3c')](_0x265fa7[_0xa811('0x39')],qs['fields'](_0x59e7fe['query'][_0xa811('0x3d')]));_0x11e93e[_0xa811('0x3f')]=_0x11e93e[_0xa811('0x3f')][_0xa811('0x3e')]?_0x11e93e[_0xa811('0x3f')]:_0x265fa7[_0xa811('0x39')];if(_0x59e7fe[_0xa811('0x3a')][_0xa811('0x4e')]){_0x11e93e['include']=[{'all':!![]}];}_0x11e93e=_[_0xa811('0x4f')]({},_0x11e93e,_0x59e7fe['options']);return db[_0xa811('0x35')]['find'](_0x11e93e)[_0xa811('0x1c')](handleEntityNotFound(_0x55cfe5,null))[_0xa811('0x1c')](respondWithResult(_0x55cfe5,null))[_0xa811('0x26')](handleError(_0x55cfe5,null));};exports[_0xa811('0x50')]=function(_0x4d61a5,_0x30a90b){return db[_0xa811('0x35')][_0xa811('0x50')](_0x4d61a5[_0xa811('0x51')],{})['then'](respondWithResult(_0x30a90b,0xc9))['catch'](handleError(_0x30a90b,null));};exports[_0xa811('0x52')]=function(_0x583690,_0x3d36f8){if(_0x583690[_0xa811('0x51')]['id']){delete _0x583690[_0xa811('0x51')]['id'];}return db[_0xa811('0x35')][_0xa811('0x53')]({'where':{'id':_0x583690[_0xa811('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3d36f8,null))[_0xa811('0x1c')](saveUpdates(_0x583690['body'],null))[_0xa811('0x1c')](respondWithResult(_0x3d36f8,null))[_0xa811('0x26')](handleError(_0x3d36f8,null));};exports[_0xa811('0x30')]=function(_0x1e4480,_0x59c586){return db[_0xa811('0x35')][_0xa811('0x53')]({'where':{'id':_0x1e4480[_0xa811('0x4c')]['id']}})[_0xa811('0x1c')](handleEntityNotFound(_0x59c586,null))[_0xa811('0x1c')](removeEntity(_0x59c586,null))['catch'](handleError(_0x59c586,null));};exports[_0xa811('0x54')]=function(_0x247c2f,_0x374e5f,_0xc5d94){var _0x5bc966={};var _0x4fce7f={};var _0x3feec4;var _0x13cf79;return db[_0xa811('0x35')][_0xa811('0x55')]({'where':{'id':_0x247c2f['params']['id']}})[_0xa811('0x1c')](handleEntityNotFound(_0x374e5f,null))[_0xa811('0x1c')](function(_0x34a75b){if(_0x34a75b){_0x3feec4=_0x34a75b;_0x4fce7f[_0xa811('0x39')]=_[_0xa811('0x4d')](db['VtigerField'][_0xa811('0x36')]);_0x4fce7f['query']=_['keys'](_0x247c2f[_0xa811('0x3a')]);_0x4fce7f[_0xa811('0x3b')]=_[_0xa811('0x3c')](_0x4fce7f[_0xa811('0x39')],_0x4fce7f[_0xa811('0x3a')]);_0x5bc966[_0xa811('0x3f')]=_[_0xa811('0x3c')](_0x4fce7f[_0xa811('0x39')],qs[_0xa811('0x3d')](_0x247c2f['query']['fields']));_0x5bc966[_0xa811('0x3f')]=_0x5bc966['attributes']['length']?_0x5bc966[_0xa811('0x3f')]:_0x4fce7f['model'];_0x5bc966[_0xa811('0x42')]=qs[_0xa811('0x43')](_0x247c2f[_0xa811('0x3a')][_0xa811('0x43')]);_0x5bc966[_0xa811('0x44')]=qs[_0xa811('0x3b')](_[_0xa811('0x45')](_0x247c2f[_0xa811('0x3a')],_0x4fce7f[_0xa811('0x3b')]));if(_0x247c2f[_0xa811('0x3a')]['filter']){_0x5bc966[_0xa811('0x44')]=_[_0xa811('0x4f')](_0x5bc966[_0xa811('0x44')],{'$or':_['map'](_0x5bc966[_0xa811('0x3f')],function(_0x557981){var _0x2e533a={};_0x2e533a[_0x557981]={'$like':'%'+_0x247c2f[_0xa811('0x3a')][_0xa811('0x47')]+'%'};return _0x2e533a;})});}_0x5bc966=_[_0xa811('0x4f')]({},_0x5bc966,_0x247c2f[_0xa811('0x48')]);return _0x3feec4[_0xa811('0x54')](_0x5bc966);}})[_0xa811('0x1c')](function(_0x59524e){if(_0x59524e){_0x13cf79=_0x59524e['length'];if(!_0x247c2f[_0xa811('0x3a')][_0xa811('0x40')](_0xa811('0x56'))){_0x5bc966[_0xa811('0x41')]=qs['limit'](_0x247c2f[_0xa811('0x3a')][_0xa811('0x41')]);_0x5bc966['offset']=qs[_0xa811('0x2c')](_0x247c2f[_0xa811('0x3a')]['offset']);}return _0x3feec4['getFields'](_0x5bc966);}})['then'](function(_0x123fc9){if(_0x123fc9){return _0x123fc9?{'count':_0x13cf79,'rows':_0x123fc9}:null;}})[_0xa811('0x1c')](respondWithResult(_0x374e5f,null))[_0xa811('0x26')](handleError(_0x374e5f,null));};exports[_0xa811('0x57')]=function(_0xef7082,_0x360c4b,_0xbe1a9f){var _0x2b47e2={};var _0x2c1a4={};var _0x164d80;var _0x2bb45f;return db[_0xa811('0x35')][_0xa811('0x55')]({'where':{'id':_0xef7082['params']['id']}})['then'](handleEntityNotFound(_0x360c4b,null))[_0xa811('0x1c')](function(_0x644069){if(_0x644069){_0x164d80=_0x644069;_0x2c1a4[_0xa811('0x39')]=_['keys'](db[_0xa811('0x58')][_0xa811('0x36')]);_0x2c1a4['query']=_[_0xa811('0x4d')](_0xef7082[_0xa811('0x3a')]);_0x2c1a4['filters']=_[_0xa811('0x3c')](_0x2c1a4[_0xa811('0x39')],_0x2c1a4[_0xa811('0x3a')]);_0x2b47e2[_0xa811('0x3f')]=_[_0xa811('0x3c')](_0x2c1a4[_0xa811('0x39')],qs[_0xa811('0x3d')](_0xef7082['query']['fields']));_0x2b47e2[_0xa811('0x3f')]=_0x2b47e2['attributes'][_0xa811('0x3e')]?_0x2b47e2[_0xa811('0x3f')]:_0x2c1a4[_0xa811('0x39')];_0x2b47e2['order']=qs['sort'](_0xef7082[_0xa811('0x3a')]['sort']);_0x2b47e2[_0xa811('0x44')]=qs[_0xa811('0x3b')](_[_0xa811('0x45')](_0xef7082[_0xa811('0x3a')],_0x2c1a4[_0xa811('0x3b')]));if(_0xef7082[_0xa811('0x3a')][_0xa811('0x47')]){_0x2b47e2[_0xa811('0x44')]=_[_0xa811('0x4f')](_0x2b47e2[_0xa811('0x44')],{'$or':_[_0xa811('0x34')](_0x2b47e2[_0xa811('0x3f')],function(_0x1abb5d){var _0x334c95={};_0x334c95[_0x1abb5d]={'$like':'%'+_0xef7082['query']['filter']+'%'};return _0x334c95;})});}_0x2b47e2=_[_0xa811('0x4f')]({},_0x2b47e2,_0xef7082[_0xa811('0x48')]);return _0x164d80[_0xa811('0x57')](_0x2b47e2);}})[_0xa811('0x1c')](function(_0x4865c2){if(_0x4865c2){_0x2bb45f=_0x4865c2[_0xa811('0x3e')];if(!_0xef7082[_0xa811('0x3a')][_0xa811('0x40')](_0xa811('0x56'))){_0x2b47e2['limit']=qs[_0xa811('0x41')](_0xef7082[_0xa811('0x3a')][_0xa811('0x41')]);_0x2b47e2[_0xa811('0x2c')]=qs[_0xa811('0x2c')](_0xef7082[_0xa811('0x3a')][_0xa811('0x2c')]);}return _0x164d80[_0xa811('0x57')](_0x2b47e2);}})[_0xa811('0x1c')](function(_0x615671){if(_0x615671){return _0x615671?{'count':_0x2bb45f,'rows':_0x615671}:null;}})[_0xa811('0x1c')](respondWithResult(_0x360c4b,null))['catch'](handleError(_0x360c4b,null));};exports[_0xa811('0x59')]=function(_0x282680,_0x3268f9,_0x3a0fed){var _0xdf8b56={};var _0x564a78={};var _0x1555bb;var _0x1213d2;return db[_0xa811('0x35')][_0xa811('0x55')]({'where':{'id':_0x282680[_0xa811('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3268f9,null))[_0xa811('0x1c')](function(_0x524cad){if(_0x524cad){_0x1555bb=_0x524cad;_0x564a78[_0xa811('0x39')]=_[_0xa811('0x4d')](db[_0xa811('0x58')]['rawAttributes']);_0x564a78[_0xa811('0x3a')]=_[_0xa811('0x4d')](_0x282680['query']);_0x564a78[_0xa811('0x3b')]=_[_0xa811('0x3c')](_0x564a78['model'],_0x564a78[_0xa811('0x3a')]);_0xdf8b56[_0xa811('0x3f')]=_[_0xa811('0x3c')](_0x564a78[_0xa811('0x39')],qs[_0xa811('0x3d')](_0x282680[_0xa811('0x3a')]['fields']));_0xdf8b56[_0xa811('0x3f')]=_0xdf8b56[_0xa811('0x3f')][_0xa811('0x3e')]?_0xdf8b56[_0xa811('0x3f')]:_0x564a78[_0xa811('0x39')];_0xdf8b56[_0xa811('0x42')]=qs[_0xa811('0x43')](_0x282680['query']['sort']);_0xdf8b56[_0xa811('0x44')]=qs[_0xa811('0x3b')](_[_0xa811('0x45')](_0x282680[_0xa811('0x3a')],_0x564a78[_0xa811('0x3b')]));if(_0x282680[_0xa811('0x3a')][_0xa811('0x47')]){_0xdf8b56[_0xa811('0x44')]=_['merge'](_0xdf8b56[_0xa811('0x44')],{'$or':_['map'](_0xdf8b56[_0xa811('0x3f')],function(_0x222872){var _0x1c0b42={};_0x1c0b42[_0x222872]={'$like':'%'+_0x282680[_0xa811('0x3a')][_0xa811('0x47')]+'%'};return _0x1c0b42;})});}_0xdf8b56=_[_0xa811('0x4f')]({},_0xdf8b56,_0x282680[_0xa811('0x48')]);return _0x1555bb['getDescriptions'](_0xdf8b56);}})[_0xa811('0x1c')](function(_0x4664e1){if(_0x4664e1){_0x1213d2=_0x4664e1['length'];if(!_0x282680[_0xa811('0x3a')]['hasOwnProperty'](_0xa811('0x56'))){_0xdf8b56['limit']=qs[_0xa811('0x41')](_0x282680['query']['limit']);_0xdf8b56['offset']=qs[_0xa811('0x2c')](_0x282680['query']['offset']);}return _0x1555bb[_0xa811('0x59')](_0xdf8b56);}})[_0xa811('0x1c')](function(_0x252e9f){if(_0x252e9f){return _0x252e9f?{'count':_0x1213d2,'rows':_0x252e9f}:null;}})[_0xa811('0x1c')](respondWithResult(_0x3268f9,null))[_0xa811('0x26')](handleError(_0x3268f9,null));}; \ No newline at end of file +var _0x96f5=['Content-Range','save','update','then','destroy','name','send','index','VtigerConfiguration','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','field','merge','options','includeAll','include','findAll','show','length','find','create','body','params','findOne','getFields','getSubjects','getDescriptions','VtigerField','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','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','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','sendStatus','end','json','count','offset','limit','status','set'];(function(_0x2d1f6e,_0x13fdc7){var _0x421074=function(_0x521ea){while(--_0x521ea){_0x2d1f6e['push'](_0x2d1f6e['shift']());}};_0x421074(++_0x13fdc7);}(_0x96f5,0x133));var _0x596f=function(_0x56a37a,_0xffb054){_0x56a37a=_0x56a37a-0x0;var _0x3a57ff=_0x96f5[_0x56a37a];return _0x3a57ff;};'use strict';var pdf=require(_0x596f('0x0'));var emlformat=require(_0x596f('0x1'));var rimraf=require(_0x596f('0x2'));var zipdir=require(_0x596f('0x3'));var jsonpatch=require(_0x596f('0x4'));var rp=require(_0x596f('0x5'));var moment=require('moment');var BPromise=require(_0x596f('0x6'));var Mustache=require(_0x596f('0x7'));var util=require('util');var path=require(_0x596f('0x8'));var sox=require(_0x596f('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x596f('0xa'));var crypto=require(_0x596f('0xb'));var jsforce=require(_0x596f('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x596f('0xd'));var Redis=require('ioredis');var authService=require(_0x596f('0xe'));var qs=require(_0x596f('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x596f('0x10'));var logger=require(_0x596f('0x11'))(_0x596f('0x12'));var utils=require(_0x596f('0x13'));var config=require(_0x596f('0x14'));var db=require(_0x596f('0x15'))['db'];var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x1015af,_0x28ae3f,_0x2bda71){if(_0x2bda71){var _0x230d0e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x230d0e['test'](_0x28ae3f)){return _0x1015af;}else{throw new Error(_0x596f('0x16'));}}else{return _0x1015af;}}function respondWithRpcPromise(_0x1f8ae6,_0xa8906f,_0x51faa9,_0x3d7ce1){return new BPromise(function(_0x7ebd2,_0x324ff4){var _0x135225=_0x3d7ce1||client;return _0x135225[_0x596f('0x17')](_0x1f8ae6,_0x51faa9)['then'](function(_0x1de95f){logger['info'](_0x596f('0x18'),_0xa8906f,_0x596f('0x19'));logger['debug'](_0x596f('0x1a'),_0xa8906f,_0x596f('0x19'),JSON[_0x596f('0x1b')](_0x1de95f));if(_0x1de95f[_0x596f('0x1c')]){if(_0x1de95f[_0x596f('0x1c')]['code']===0x1f4){logger[_0x596f('0x1c')]('VtigerConfiguration,\x20%s,\x20%s',_0xa8906f,_0x1de95f[_0x596f('0x1c')][_0x596f('0x1d')]);return _0x324ff4(_0x1de95f['error'][_0x596f('0x1d')]);}logger[_0x596f('0x1c')](_0x596f('0x18'),_0xa8906f,_0x1de95f[_0x596f('0x1c')][_0x596f('0x1d')]);return _0x7ebd2(_0x1de95f['error']['message']);}else{logger[_0x596f('0x1e')](_0x596f('0x18'),_0xa8906f,_0x596f('0x19'));_0x7ebd2(_0x1de95f[_0x596f('0x1f')]['message']);}})[_0x596f('0x20')](function(_0x77fca9){logger[_0x596f('0x1c')]('VtigerConfiguration,\x20%s,\x20%s',_0xa8906f,_0x77fca9);_0x324ff4(_0x77fca9);});});}function respondWithStatusCode(_0x581963,_0x5dcc7f){_0x5dcc7f=_0x5dcc7f||0xcc;return function(_0x118d74){if(_0x118d74){return _0x581963[_0x596f('0x21')](_0x5dcc7f);}return _0x581963['status'](_0x5dcc7f)[_0x596f('0x22')]();};}function respondWithResult(_0x33460d,_0x5eef90){_0x5eef90=_0x5eef90||0xc8;return function(_0x267093){if(_0x267093){return _0x33460d['status'](_0x5eef90)[_0x596f('0x23')](_0x267093);}};}function respondWithFilteredResult(_0x5e237d,_0x316631){return function(_0x4ba26d){if(_0x4ba26d){var _0x2f96bf=_0x4ba26d[_0x596f('0x24')],_0x27b472=_0x316631[_0x596f('0x25')],_0x4b7ea1=_0x316631[_0x596f('0x25')]+_0x316631[_0x596f('0x26')],_0x2bb427;if(_0x4b7ea1>=_0x2f96bf){_0x4b7ea1=_0x2f96bf;_0x2bb427=0xc8;}else{_0x2bb427=0xce;}_0x5e237d[_0x596f('0x27')](_0x2bb427);return _0x5e237d[_0x596f('0x28')](_0x596f('0x29'),_0x27b472+'-'+_0x4b7ea1+'/'+_0x2f96bf)[_0x596f('0x23')](_0x4ba26d);}return null;};}function patchUpdates(_0x53eeb2){return function(_0x580066){try{jsonpatch['apply'](_0x580066,_0x53eeb2,!![]);}catch(_0x5c834d){return BPromise['reject'](_0x5c834d);}return _0x580066[_0x596f('0x2a')]();};}function saveUpdates(_0x2d4e17,_0xcc6a4c){return function(_0x1d76b6){if(_0x1d76b6){return _0x1d76b6[_0x596f('0x2b')](_0x2d4e17)[_0x596f('0x2c')](function(_0x2955d1){return _0x2955d1;});}return null;};}function removeEntity(_0x54fe89,_0x161808){return function(_0x6390f){if(_0x6390f){return _0x6390f[_0x596f('0x2d')]()['then'](function(){_0x54fe89['status'](0xcc)[_0x596f('0x22')]();});}};}function handleEntityNotFound(_0x2b88d4,_0x551dc4){return function(_0x1f4fda){if(!_0x1f4fda){_0x2b88d4[_0x596f('0x21')](0x194);}return _0x1f4fda;};}function handleError(_0x1b90a2,_0x605ac4){_0x605ac4=_0x605ac4||0x1f4;return function(_0x4e54f6){logger['error'](_0x4e54f6['stack']);if(_0x4e54f6[_0x596f('0x2e')]){delete _0x4e54f6[_0x596f('0x2e')];}_0x1b90a2[_0x596f('0x27')](_0x605ac4)[_0x596f('0x2f')](_0x4e54f6);};}exports[_0x596f('0x30')]=function(_0x278caa,_0x5890e7){var _0x5aa903={},_0xc045c2={},_0x23c695={'count':0x0,'rows':[]};var _0x54c69a=_['map'](db[_0x596f('0x31')][_0x596f('0x32')],function(_0x17f69a){return{'name':_0x17f69a[_0x596f('0x33')],'type':_0x17f69a[_0x596f('0x34')][_0x596f('0x35')]};});_0xc045c2[_0x596f('0x36')]=_[_0x596f('0x37')](_0x54c69a,_0x596f('0x2e'));_0xc045c2[_0x596f('0x38')]=_[_0x596f('0x39')](_0x278caa[_0x596f('0x38')]);_0xc045c2[_0x596f('0x3a')]=_[_0x596f('0x3b')](_0xc045c2[_0x596f('0x36')],_0xc045c2[_0x596f('0x38')]);_0x5aa903['attributes']=_[_0x596f('0x3b')](_0xc045c2[_0x596f('0x36')],qs[_0x596f('0x3c')](_0x278caa[_0x596f('0x38')][_0x596f('0x3c')]));_0x5aa903['attributes']=_0x5aa903[_0x596f('0x3d')]['length']?_0x5aa903[_0x596f('0x3d')]:_0xc045c2[_0x596f('0x36')];if(!_0x278caa['query'][_0x596f('0x3e')](_0x596f('0x3f'))){_0x5aa903['limit']=qs[_0x596f('0x26')](_0x278caa[_0x596f('0x38')][_0x596f('0x26')]);_0x5aa903['offset']=qs['offset'](_0x278caa['query']['offset']);}_0x5aa903[_0x596f('0x40')]=qs[_0x596f('0x41')](_0x278caa['query']['sort']);_0x5aa903[_0x596f('0x42')]=qs['filters'](_[_0x596f('0x43')](_0x278caa[_0x596f('0x38')],_0xc045c2[_0x596f('0x3a')]));if(_0x278caa[_0x596f('0x38')][_0x596f('0x44')]){_0x5aa903['where']=_['merge'](_0x5aa903[_0x596f('0x42')],{'$or':_[_0x596f('0x37')](_0x54c69a,function(_0x19fed6){if(_0x19fed6['type'][_0x596f('0x35')]!==_0x596f('0x45')){var _0x597791={};_0x597791[_0x19fed6[_0x596f('0x46')]]={'$like':'%'+_0x278caa['query'][_0x596f('0x44')]+'%'};return _0x597791;}})});}_0x5aa903=_[_0x596f('0x47')]({},_0x5aa903,_0x278caa[_0x596f('0x48')]);var _0x4ee39f={'where':_0x5aa903['where']};return db['VtigerConfiguration'][_0x596f('0x24')](_0x4ee39f)[_0x596f('0x2c')](function(_0x3c9468){_0x23c695['count']=_0x3c9468;if(_0x278caa[_0x596f('0x38')][_0x596f('0x49')]){_0x5aa903[_0x596f('0x4a')]=[{'all':!![]}];}return db['VtigerConfiguration'][_0x596f('0x4b')](_0x5aa903);})[_0x596f('0x2c')](function(_0x23e3ee){_0x23c695['rows']=_0x23e3ee;return _0x23c695;})['then'](respondWithFilteredResult(_0x5890e7,_0x5aa903))['catch'](handleError(_0x5890e7,null));};exports[_0x596f('0x4c')]=function(_0x277a6e,_0x521b2d){var _0x298d08={'raw':![],'where':{'id':_0x277a6e['params']['id']}},_0x276a08={};_0x276a08[_0x596f('0x36')]=_['keys'](db['VtigerConfiguration'][_0x596f('0x32')]);_0x276a08['query']=_[_0x596f('0x39')](_0x277a6e[_0x596f('0x38')]);_0x276a08[_0x596f('0x3a')]=_[_0x596f('0x3b')](_0x276a08[_0x596f('0x36')],_0x276a08[_0x596f('0x38')]);_0x298d08[_0x596f('0x3d')]=_['intersection'](_0x276a08['model'],qs['fields'](_0x277a6e[_0x596f('0x38')]['fields']));_0x298d08['attributes']=_0x298d08[_0x596f('0x3d')][_0x596f('0x4d')]?_0x298d08['attributes']:_0x276a08[_0x596f('0x36')];if(_0x277a6e[_0x596f('0x38')][_0x596f('0x49')]){_0x298d08['include']=[{'all':!![]}];}_0x298d08=_['merge']({},_0x298d08,_0x277a6e[_0x596f('0x48')]);return db[_0x596f('0x31')][_0x596f('0x4e')](_0x298d08)[_0x596f('0x2c')](handleEntityNotFound(_0x521b2d,null))['then'](respondWithResult(_0x521b2d,null))[_0x596f('0x20')](handleError(_0x521b2d,null));};exports[_0x596f('0x4f')]=function(_0x53a84d,_0x4df921){return db[_0x596f('0x31')][_0x596f('0x4f')](_0x53a84d['body'],{})[_0x596f('0x2c')](respondWithResult(_0x4df921,0xc9))[_0x596f('0x20')](handleError(_0x4df921,null));};exports[_0x596f('0x2b')]=function(_0x26820a,_0x2e9fc0){if(_0x26820a[_0x596f('0x50')]['id']){delete _0x26820a[_0x596f('0x50')]['id'];}return db[_0x596f('0x31')][_0x596f('0x4e')]({'where':{'id':_0x26820a['params']['id']}})[_0x596f('0x2c')](handleEntityNotFound(_0x2e9fc0,null))[_0x596f('0x2c')](saveUpdates(_0x26820a[_0x596f('0x50')],null))['then'](respondWithResult(_0x2e9fc0,null))[_0x596f('0x20')](handleError(_0x2e9fc0,null));};exports[_0x596f('0x2d')]=function(_0x40dad0,_0x2551ee){return db[_0x596f('0x31')][_0x596f('0x4e')]({'where':{'id':_0x40dad0[_0x596f('0x51')]['id']}})[_0x596f('0x2c')](handleEntityNotFound(_0x2551ee,null))[_0x596f('0x2c')](removeEntity(_0x2551ee,null))['catch'](handleError(_0x2551ee,null));};exports['getFields']=function(_0x2ef10e,_0x6eae6a,_0x310038){var _0x14f79c={};var _0x293e76={};var _0x34a65d;var _0x231133;return db['VtigerConfiguration'][_0x596f('0x52')]({'where':{'id':_0x2ef10e[_0x596f('0x51')]['id']}})[_0x596f('0x2c')](handleEntityNotFound(_0x6eae6a,null))[_0x596f('0x2c')](function(_0x291768){if(_0x291768){_0x34a65d=_0x291768;_0x293e76['model']=_[_0x596f('0x39')](db['VtigerField']['rawAttributes']);_0x293e76[_0x596f('0x38')]=_[_0x596f('0x39')](_0x2ef10e['query']);_0x293e76[_0x596f('0x3a')]=_['intersection'](_0x293e76[_0x596f('0x36')],_0x293e76[_0x596f('0x38')]);_0x14f79c[_0x596f('0x3d')]=_['intersection'](_0x293e76[_0x596f('0x36')],qs[_0x596f('0x3c')](_0x2ef10e[_0x596f('0x38')]['fields']));_0x14f79c[_0x596f('0x3d')]=_0x14f79c[_0x596f('0x3d')][_0x596f('0x4d')]?_0x14f79c[_0x596f('0x3d')]:_0x293e76['model'];_0x14f79c[_0x596f('0x40')]=qs['sort'](_0x2ef10e[_0x596f('0x38')][_0x596f('0x41')]);_0x14f79c[_0x596f('0x42')]=qs[_0x596f('0x3a')](_[_0x596f('0x43')](_0x2ef10e['query'],_0x293e76['filters']));if(_0x2ef10e[_0x596f('0x38')][_0x596f('0x44')]){_0x14f79c['where']=_[_0x596f('0x47')](_0x14f79c[_0x596f('0x42')],{'$or':_[_0x596f('0x37')](_0x14f79c[_0x596f('0x3d')],function(_0x87ad76){var _0x236f20={};_0x236f20[_0x87ad76]={'$like':'%'+_0x2ef10e[_0x596f('0x38')]['filter']+'%'};return _0x236f20;})});}_0x14f79c=_[_0x596f('0x47')]({},_0x14f79c,_0x2ef10e[_0x596f('0x48')]);return _0x34a65d[_0x596f('0x53')](_0x14f79c);}})[_0x596f('0x2c')](function(_0x37eadd){if(_0x37eadd){_0x231133=_0x37eadd[_0x596f('0x4d')];if(!_0x2ef10e['query'][_0x596f('0x3e')]('nolimit')){_0x14f79c[_0x596f('0x26')]=qs[_0x596f('0x26')](_0x2ef10e[_0x596f('0x38')][_0x596f('0x26')]);_0x14f79c[_0x596f('0x25')]=qs[_0x596f('0x25')](_0x2ef10e[_0x596f('0x38')]['offset']);}return _0x34a65d[_0x596f('0x53')](_0x14f79c);}})[_0x596f('0x2c')](function(_0x58a9b6){if(_0x58a9b6){return _0x58a9b6?{'count':_0x231133,'rows':_0x58a9b6}:null;}})[_0x596f('0x2c')](respondWithResult(_0x6eae6a,null))[_0x596f('0x20')](handleError(_0x6eae6a,null));};exports['getSubjects']=function(_0x456e97,_0x241d6e,_0x436be4){var _0x226cc5={};var _0x7012eb={};var _0x44515b;var _0x3d3f43;return db['VtigerConfiguration'][_0x596f('0x52')]({'where':{'id':_0x456e97[_0x596f('0x51')]['id']}})[_0x596f('0x2c')](handleEntityNotFound(_0x241d6e,null))[_0x596f('0x2c')](function(_0xccc83){if(_0xccc83){_0x44515b=_0xccc83;_0x7012eb[_0x596f('0x36')]=_[_0x596f('0x39')](db['VtigerField'][_0x596f('0x32')]);_0x7012eb[_0x596f('0x38')]=_['keys'](_0x456e97['query']);_0x7012eb['filters']=_[_0x596f('0x3b')](_0x7012eb[_0x596f('0x36')],_0x7012eb[_0x596f('0x38')]);_0x226cc5[_0x596f('0x3d')]=_[_0x596f('0x3b')](_0x7012eb['model'],qs[_0x596f('0x3c')](_0x456e97[_0x596f('0x38')][_0x596f('0x3c')]));_0x226cc5[_0x596f('0x3d')]=_0x226cc5[_0x596f('0x3d')][_0x596f('0x4d')]?_0x226cc5[_0x596f('0x3d')]:_0x7012eb[_0x596f('0x36')];_0x226cc5[_0x596f('0x40')]=qs[_0x596f('0x41')](_0x456e97[_0x596f('0x38')][_0x596f('0x41')]);_0x226cc5[_0x596f('0x42')]=qs[_0x596f('0x3a')](_[_0x596f('0x43')](_0x456e97['query'],_0x7012eb[_0x596f('0x3a')]));if(_0x456e97[_0x596f('0x38')][_0x596f('0x44')]){_0x226cc5['where']=_[_0x596f('0x47')](_0x226cc5[_0x596f('0x42')],{'$or':_[_0x596f('0x37')](_0x226cc5[_0x596f('0x3d')],function(_0x365b29){var _0x315cc2={};_0x315cc2[_0x365b29]={'$like':'%'+_0x456e97[_0x596f('0x38')][_0x596f('0x44')]+'%'};return _0x315cc2;})});}_0x226cc5=_['merge']({},_0x226cc5,_0x456e97[_0x596f('0x48')]);return _0x44515b[_0x596f('0x54')](_0x226cc5);}})[_0x596f('0x2c')](function(_0x3477b8){if(_0x3477b8){_0x3d3f43=_0x3477b8[_0x596f('0x4d')];if(!_0x456e97[_0x596f('0x38')]['hasOwnProperty'](_0x596f('0x3f'))){_0x226cc5['limit']=qs[_0x596f('0x26')](_0x456e97['query'][_0x596f('0x26')]);_0x226cc5[_0x596f('0x25')]=qs[_0x596f('0x25')](_0x456e97[_0x596f('0x38')][_0x596f('0x25')]);}return _0x44515b[_0x596f('0x54')](_0x226cc5);}})[_0x596f('0x2c')](function(_0x1e17fe){if(_0x1e17fe){return _0x1e17fe?{'count':_0x3d3f43,'rows':_0x1e17fe}:null;}})[_0x596f('0x2c')](respondWithResult(_0x241d6e,null))[_0x596f('0x20')](handleError(_0x241d6e,null));};exports[_0x596f('0x55')]=function(_0x327383,_0x49a3c9,_0x5452f3){var _0x4c4724={};var _0x4f17b8={};var _0x397d77;var _0x2ea14e;return db[_0x596f('0x31')][_0x596f('0x52')]({'where':{'id':_0x327383[_0x596f('0x51')]['id']}})[_0x596f('0x2c')](handleEntityNotFound(_0x49a3c9,null))['then'](function(_0x24dabf){if(_0x24dabf){_0x397d77=_0x24dabf;_0x4f17b8[_0x596f('0x36')]=_[_0x596f('0x39')](db[_0x596f('0x56')]['rawAttributes']);_0x4f17b8['query']=_[_0x596f('0x39')](_0x327383[_0x596f('0x38')]);_0x4f17b8['filters']=_[_0x596f('0x3b')](_0x4f17b8['model'],_0x4f17b8[_0x596f('0x38')]);_0x4c4724[_0x596f('0x3d')]=_['intersection'](_0x4f17b8['model'],qs['fields'](_0x327383[_0x596f('0x38')][_0x596f('0x3c')]));_0x4c4724[_0x596f('0x3d')]=_0x4c4724[_0x596f('0x3d')][_0x596f('0x4d')]?_0x4c4724[_0x596f('0x3d')]:_0x4f17b8[_0x596f('0x36')];_0x4c4724['order']=qs[_0x596f('0x41')](_0x327383[_0x596f('0x38')]['sort']);_0x4c4724[_0x596f('0x42')]=qs[_0x596f('0x3a')](_[_0x596f('0x43')](_0x327383[_0x596f('0x38')],_0x4f17b8['filters']));if(_0x327383[_0x596f('0x38')]['filter']){_0x4c4724[_0x596f('0x42')]=_['merge'](_0x4c4724[_0x596f('0x42')],{'$or':_[_0x596f('0x37')](_0x4c4724[_0x596f('0x3d')],function(_0x33b211){var _0x4bf64d={};_0x4bf64d[_0x33b211]={'$like':'%'+_0x327383[_0x596f('0x38')][_0x596f('0x44')]+'%'};return _0x4bf64d;})});}_0x4c4724=_[_0x596f('0x47')]({},_0x4c4724,_0x327383[_0x596f('0x48')]);return _0x397d77[_0x596f('0x55')](_0x4c4724);}})['then'](function(_0x5c8460){if(_0x5c8460){_0x2ea14e=_0x5c8460[_0x596f('0x4d')];if(!_0x327383[_0x596f('0x38')][_0x596f('0x3e')](_0x596f('0x3f'))){_0x4c4724[_0x596f('0x26')]=qs['limit'](_0x327383[_0x596f('0x38')][_0x596f('0x26')]);_0x4c4724[_0x596f('0x25')]=qs[_0x596f('0x25')](_0x327383[_0x596f('0x38')][_0x596f('0x25')]);}return _0x397d77[_0x596f('0x55')](_0x4c4724);}})[_0x596f('0x2c')](function(_0x3e25b7){if(_0x3e25b7){return _0x3e25b7?{'count':_0x2ea14e,'rows':_0x3e25b7}:null;}})['then'](respondWithResult(_0x49a3c9,null))[_0x596f('0x20')](handleError(_0x49a3c9,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 002ff99..a174851 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 _0x27f1=['rimraf','../../config/environment','./intVtigerConfiguration.attributes','define','VtigerConfiguration','int_vtiger_configurations','lodash','moment','bluebird','request-promise'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x27f1,0x196));var _0x127f=function(_0x545b71,_0x4f44eb){_0x545b71=_0x545b71-0x0;var _0x26e587=_0x27f1[_0x545b71];return _0x26e587;};'use strict';var _=require(_0x127f('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x127f('0x1'));var BPromise=require(_0x127f('0x2'));var rp=require(_0x127f('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x127f('0x4'));var config=require(_0x127f('0x5'));var attributes=require(_0x127f('0x6'));module['exports']=function(_0x59f912,_0x1459ab){return _0x59f912[_0x127f('0x7')](_0x127f('0x8'),attributes,{'tableName':_0x127f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbd21=['../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbd21,0x19c));var _0x1bd2=function(_0x5bf6a5,_0x401acd){_0x5bf6a5=_0x5bf6a5-0x0;var _0x2a7011=_0xbd21[_0x5bf6a5];return _0x2a7011;};'use strict';var _=require(_0x1bd2('0x0'));var util=require('util');var logger=require(_0x1bd2('0x1'))(_0x1bd2('0x2'));var moment=require(_0x1bd2('0x3'));var BPromise=require(_0x1bd2('0x4'));var rp=require(_0x1bd2('0x5'));var fs=require('fs');var path=require(_0x1bd2('0x6'));var rimraf=require(_0x1bd2('0x7'));var config=require(_0x1bd2('0x8'));var attributes=require(_0x1bd2('0x9'));module[_0x1bd2('0xa')]=function(_0x21ab03,_0x440f1d){return _0x21ab03[_0x1bd2('0xb')](_0x1bd2('0xc'),attributes,{'tableName':_0x1bd2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js index c52edcf..1016910 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 _0xcff4=['result','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0xcff4,0xc7));var _0x4cff=function(_0x34a8e1,_0x170c60){_0x34a8e1=_0x34a8e1-0x0;var _0x2a32e1=_0xcff4[_0x34a8e1];return _0x2a32e1;};'use strict';var _=require(_0x4cff('0x0'));var util=require('util');var moment=require(_0x4cff('0x1'));var BPromise=require(_0x4cff('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4cff('0x3'));var db=require(_0x4cff('0x4'))['db'];var utils=require(_0x4cff('0x5'));var logger=require(_0x4cff('0x6'))(_0x4cff('0x7'));var config=require('../../config/environment');var jayson=require(_0x4cff('0x8'));var client=jayson[_0x4cff('0x9')][_0x4cff('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4d5918,_0x32c906,_0x96e0ab){return new BPromise(function(_0x5485a9,_0x313727){return client[_0x4cff('0xb')](_0x4d5918,_0x96e0ab)[_0x4cff('0xc')](function(_0x1dee2d){logger[_0x4cff('0xd')](_0x4cff('0xe'),_0x32c906,'request\x20sent');logger[_0x4cff('0xf')](_0x4cff('0x10'),_0x32c906,'request\x20sent',JSON['stringify'](_0x1dee2d));if(_0x1dee2d[_0x4cff('0x11')]){if(_0x1dee2d[_0x4cff('0x11')][_0x4cff('0x12')]===0x1f4){logger[_0x4cff('0x11')](_0x4cff('0xe'),_0x32c906,_0x1dee2d['error']['message']);return _0x313727(_0x1dee2d[_0x4cff('0x11')][_0x4cff('0x13')]);}logger[_0x4cff('0x11')](_0x4cff('0xe'),_0x32c906,_0x1dee2d[_0x4cff('0x11')][_0x4cff('0x13')]);return _0x5485a9(_0x1dee2d['error']['message']);}else{logger[_0x4cff('0xd')](_0x4cff('0xe'),_0x32c906,_0x4cff('0x14'));_0x5485a9(_0x1dee2d[_0x4cff('0x15')][_0x4cff('0x13')]);}})['catch'](function(_0x1c6270){logger[_0x4cff('0x11')]('VtigerConfiguration,\x20%s,\x20%s',_0x32c906,_0x1c6270);_0x313727(_0x1c6270);});});} \ No newline at end of file +var _0x90b8=['../../config/logger','rpc','jayson/promise','client','http','request','then','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','moment','ioredis','../../mysqldb','../../config/utils'];(function(_0x19af1f,_0x554215){var _0x556bfc=function(_0x1c0e46){while(--_0x1c0e46){_0x19af1f['push'](_0x19af1f['shift']());}};_0x556bfc(++_0x554215);}(_0x90b8,0x19d));var _0x890b=function(_0x2d364e,_0x301c5e){_0x2d364e=_0x2d364e-0x0;var _0x1b9312=_0x90b8[_0x2d364e];return _0x1b9312;};'use strict';var _=require(_0x890b('0x0'));var util=require('util');var moment=require(_0x890b('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x890b('0x2'));var db=require(_0x890b('0x3'))['db'];var utils=require(_0x890b('0x4'));var logger=require(_0x890b('0x5'))(_0x890b('0x6'));var config=require('../../config/environment');var jayson=require(_0x890b('0x7'));var client=jayson[_0x890b('0x8')][_0x890b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x55df9a,_0x1b94d0,_0x533a37){return new BPromise(function(_0x1b7115,_0x212022){return client[_0x890b('0xa')](_0x55df9a,_0x533a37)[_0x890b('0xb')](function(_0x41e667){logger['info'](_0x890b('0xc'),_0x1b94d0,_0x890b('0xd'));logger[_0x890b('0xe')](_0x890b('0xf'),_0x1b94d0,'request\x20sent',JSON[_0x890b('0x10')](_0x41e667));if(_0x41e667[_0x890b('0x11')]){if(_0x41e667['error'][_0x890b('0x12')]===0x1f4){logger[_0x890b('0x11')](_0x890b('0xc'),_0x1b94d0,_0x41e667[_0x890b('0x11')][_0x890b('0x13')]);return _0x212022(_0x41e667[_0x890b('0x11')]['message']);}logger[_0x890b('0x11')](_0x890b('0xc'),_0x1b94d0,_0x41e667[_0x890b('0x11')]['message']);return _0x1b7115(_0x41e667[_0x890b('0x11')][_0x890b('0x13')]);}else{logger[_0x890b('0x14')]('VtigerConfiguration,\x20%s,\x20%s',_0x1b94d0,_0x890b('0xd'));_0x1b7115(_0x41e667[_0x890b('0x15')][_0x890b('0x13')]);}})['catch'](function(_0x236d99){logger[_0x890b('0x11')](_0x890b('0xc'),_0x1b94d0,_0x236d99);_0x212022(_0x236d99);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 82e1535..84ebe02 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 _0xf46b=['express','Router','get','index','show','post','create','put','isAuthenticated','delete','/:id','destroy','exports','multer','util','path','connect-timeout'];(function(_0x2600db,_0x14cbf6){var _0xaabff3=function(_0x29cee8){while(--_0x29cee8){_0x2600db['push'](_0x2600db['shift']());}};_0xaabff3(++_0x14cbf6);}(_0xf46b,0x150));var _0xbf46=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0xf46b[_0x24f31b];return _0x488401;};'use strict';var multer=require(_0xbf46('0x0'));var util=require(_0xbf46('0x1'));var path=require(_0xbf46('0x2'));var timeout=require(_0xbf46('0x3'));var express=require(_0xbf46('0x4'));var router=express[_0xbf46('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intVtigerField.controller');router[_0xbf46('0x6')]('/',auth['isAuthenticated'](),controller[_0xbf46('0x7')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xbf46('0x8')]);router[_0xbf46('0x9')]('/',auth['isAuthenticated'](),controller[_0xbf46('0xa')]);router[_0xbf46('0xb')]('/:id',auth[_0xbf46('0xc')](),controller['update']);router[_0xbf46('0xd')](_0xbf46('0xe'),auth[_0xbf46('0xc')](),controller[_0xbf46('0xf')]);module[_0xbf46('0x10')]=router; \ No newline at end of file +var _0x7426=['isAuthenticated','index','/:id','show','create','put','delete','destroy','multer','path','express','Router','../../components/auth/service','../../config/environment','./intVtigerField.controller'];(function(_0xca7ceb,_0x2fcbc2){var _0x5c7c27=function(_0x53c6d6){while(--_0x53c6d6){_0xca7ceb['push'](_0xca7ceb['shift']());}};_0x5c7c27(++_0x2fcbc2);}(_0x7426,0x1ac));var _0x6742=function(_0x5f4c52,_0x1c375c){_0x5f4c52=_0x5f4c52-0x0;var _0x2ea8ca=_0x7426[_0x5f4c52];return _0x2ea8ca;};'use strict';var multer=require(_0x6742('0x0'));var util=require('util');var path=require(_0x6742('0x1'));var timeout=require('connect-timeout');var express=require(_0x6742('0x2'));var router=express[_0x6742('0x3')]();var auth=require(_0x6742('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6742('0x5'));var controller=require(_0x6742('0x6'));router['get']('/',auth[_0x6742('0x7')](),controller[_0x6742('0x8')]);router['get'](_0x6742('0x9'),auth[_0x6742('0x7')](),controller[_0x6742('0xa')]);router['post']('/',auth[_0x6742('0x7')](),controller[_0x6742('0xb')]);router[_0x6742('0xc')](_0x6742('0x9'),auth[_0x6742('0x7')](),controller['update']);router[_0x6742('0xd')](_0x6742('0x9'),auth['isAuthenticated'](),controller[_0x6742('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 4adc786..47bfb1d 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 _0x78d8=['string','STRING','variable','customVariable','BOOLEAN','exports','ENUM'];(function(_0x5499d9,_0x1abd4f){var _0x52054c=function(_0x2205bc){while(--_0x2205bc){_0x5499d9['push'](_0x5499d9['shift']());}};_0x52054c(++_0x1abd4f);}(_0x78d8,0x15c));var _0x878d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x78d8[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');module[_0x878d('0x0')]={'type':{'type':Sequelize[_0x878d('0x1')](_0x878d('0x2'),'variable','customVariable','keyValue'),'defaultValue':'string'},'content':{'type':Sequelize[_0x878d('0x3')]},'key':{'type':Sequelize[_0x878d('0x3')]},'keyType':{'type':Sequelize[_0x878d('0x1')](_0x878d('0x2'),_0x878d('0x4'),_0x878d('0x5'))},'keyContent':{'type':Sequelize[_0x878d('0x3')]},'idField':{'type':Sequelize[_0x878d('0x3')]},'nameField':{'type':Sequelize[_0x878d('0x3')]},'customField':{'type':Sequelize[_0x878d('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x323b=['variable','keyValue','STRING','customVariable','BOOLEAN','sequelize','ENUM','string'];(function(_0x50a004,_0x193d84){var _0x5e9992=function(_0x3c8c37){while(--_0x3c8c37){_0x50a004['push'](_0x50a004['shift']());}};_0x5e9992(++_0x193d84);}(_0x323b,0x1ad));var _0xb323=function(_0x4757e6,_0x1a6563){_0x4757e6=_0x4757e6-0x0;var _0x150ff8=_0x323b[_0x4757e6];return _0x150ff8;};'use strict';var Sequelize=require(_0xb323('0x0'));module['exports']={'type':{'type':Sequelize[_0xb323('0x1')](_0xb323('0x2'),_0xb323('0x3'),'customVariable',_0xb323('0x4')),'defaultValue':_0xb323('0x2')},'content':{'type':Sequelize[_0xb323('0x5')]},'key':{'type':Sequelize[_0xb323('0x5')]},'keyType':{'type':Sequelize[_0xb323('0x1')](_0xb323('0x2'),_0xb323('0x3'),_0xb323('0x6'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xb323('0x5')]},'customField':{'type':Sequelize[_0xb323('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb323('0x5')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 4b08685..bd70521 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 _0x8814=['intersection','model','fields','attributes','length','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','VtigerField','include','findAll','rows','catch','params','includeAll','find','create','body','destroy','html-pdf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','count','offset','Content-Range','update','then','error','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x8814,0x1b8));var _0x4881=function(_0x4ae829,_0x2c842c){_0x4ae829=_0x4ae829-0x0;var _0x256b31=_0x8814[_0x4ae829];return _0x256b31;};'use strict';var pdf=require(_0x4881('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4881('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4881('0x2'));var moment=require(_0x4881('0x3'));var BPromise=require(_0x4881('0x4'));var Mustache=require(_0x4881('0x5'));var util=require('util');var path=require(_0x4881('0x6'));var sox=require(_0x4881('0x7'));var csv=require(_0x4881('0x8'));var ejs=require(_0x4881('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x4881('0xa'));var crypto=require('crypto');var jsforce=require(_0x4881('0xb'));var deskjs=require(_0x4881('0xc'));var toCsv=require(_0x4881('0x8'));var querystring=require(_0x4881('0xd'));var Papa=require('papaparse');var Redis=require(_0x4881('0xe'));var authService=require(_0x4881('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x4881('0x10'));var hardwareService=require(_0x4881('0x11'));var logger=require(_0x4881('0x12'))(_0x4881('0x13'));var utils=require(_0x4881('0x14'));var config=require(_0x4881('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3bfd56,_0x1aa300){_0x1aa300=_0x1aa300||0xcc;return function(_0x42454b){if(_0x42454b){return _0x3bfd56[_0x4881('0x16')](_0x1aa300);}return _0x3bfd56['status'](_0x1aa300)[_0x4881('0x17')]();};}function respondWithResult(_0x35ab50,_0x20357a){_0x20357a=_0x20357a||0xc8;return function(_0x44b25b){if(_0x44b25b){return _0x35ab50[_0x4881('0x18')](_0x20357a)[_0x4881('0x19')](_0x44b25b);}};}function respondWithFilteredResult(_0x534063,_0x4bdffa){return function(_0x527762){if(_0x527762){var _0x5ad538=_0x527762[_0x4881('0x1a')],_0x22df92=_0x4bdffa[_0x4881('0x1b')],_0x5b6add=_0x4bdffa[_0x4881('0x1b')]+_0x4bdffa['limit'],_0x579c68;if(_0x5b6add>=_0x5ad538){_0x5b6add=_0x5ad538;_0x579c68=0xc8;}else{_0x579c68=0xce;}_0x534063['status'](_0x579c68);return _0x534063['set'](_0x4881('0x1c'),_0x22df92+'-'+_0x5b6add+'/'+_0x5ad538)['json'](_0x527762);}return null;};}function patchUpdates(_0x3a8a57){return function(_0x3d455b){try{jsonpatch['apply'](_0x3d455b,_0x3a8a57,!![]);}catch(_0x59fb41){return BPromise['reject'](_0x59fb41);}return _0x3d455b['save']();};}function saveUpdates(_0x17556d,_0x543c5e){return function(_0x4dc126){if(_0x4dc126){return _0x4dc126[_0x4881('0x1d')](_0x17556d)[_0x4881('0x1e')](function(_0x446eb4){return _0x446eb4;});}return null;};}function removeEntity(_0x15e63f,_0x347b35){return function(_0x33b74a){if(_0x33b74a){return _0x33b74a['destroy']()['then'](function(){_0x15e63f['status'](0xcc)[_0x4881('0x17')]();});}};}function handleEntityNotFound(_0x2727c4,_0xb965c9){return function(_0x470df9){if(!_0x470df9){_0x2727c4[_0x4881('0x16')](0x194);}return _0x470df9;};}function handleError(_0x337064,_0x4cf5c3){_0x4cf5c3=_0x4cf5c3||0x1f4;return function(_0x783a6a){logger[_0x4881('0x1f')](_0x783a6a['stack']);if(_0x783a6a[_0x4881('0x20')]){delete _0x783a6a[_0x4881('0x20')];}_0x337064[_0x4881('0x18')](_0x4cf5c3)[_0x4881('0x21')](_0x783a6a);};}exports[_0x4881('0x22')]=function(_0x590098,_0x658ec9){var _0x2bf637={},_0x41b83f={},_0x5525eb={'count':0x0,'rows':[]};var _0x339600=_[_0x4881('0x23')](db['VtigerField'][_0x4881('0x24')],function(_0x1e61a){return{'name':_0x1e61a[_0x4881('0x25')],'type':_0x1e61a[_0x4881('0x26')][_0x4881('0x27')]};});_0x41b83f['model']=_[_0x4881('0x23')](_0x339600,_0x4881('0x20'));_0x41b83f[_0x4881('0x28')]=_[_0x4881('0x29')](_0x590098[_0x4881('0x28')]);_0x41b83f[_0x4881('0x2a')]=_[_0x4881('0x2b')](_0x41b83f[_0x4881('0x2c')],_0x41b83f[_0x4881('0x28')]);_0x2bf637['attributes']=_['intersection'](_0x41b83f[_0x4881('0x2c')],qs[_0x4881('0x2d')](_0x590098['query'][_0x4881('0x2d')]));_0x2bf637[_0x4881('0x2e')]=_0x2bf637['attributes'][_0x4881('0x2f')]?_0x2bf637[_0x4881('0x2e')]:_0x41b83f[_0x4881('0x2c')];if(!_0x590098['query']['hasOwnProperty'](_0x4881('0x30'))){_0x2bf637[_0x4881('0x31')]=qs[_0x4881('0x31')](_0x590098['query'][_0x4881('0x31')]);_0x2bf637[_0x4881('0x1b')]=qs[_0x4881('0x1b')](_0x590098['query'][_0x4881('0x1b')]);}_0x2bf637[_0x4881('0x32')]=qs[_0x4881('0x33')](_0x590098[_0x4881('0x28')][_0x4881('0x33')]);_0x2bf637['where']=qs[_0x4881('0x2a')](_[_0x4881('0x34')](_0x590098['query'],_0x41b83f[_0x4881('0x2a')]));if(_0x590098[_0x4881('0x28')][_0x4881('0x35')]){_0x2bf637[_0x4881('0x36')]=_[_0x4881('0x37')](_0x2bf637['where'],{'$or':_[_0x4881('0x23')](_0x339600,function(_0x154f33){if(_0x154f33['type'][_0x4881('0x27')]!==_0x4881('0x38')){var _0x24a414={};_0x24a414[_0x154f33['field']]={'$like':'%'+_0x590098[_0x4881('0x28')][_0x4881('0x35')]+'%'};return _0x24a414;}})});}_0x2bf637=_[_0x4881('0x37')]({},_0x2bf637,_0x590098[_0x4881('0x39')]);var _0x2a84fd={'where':_0x2bf637['where']};return db[_0x4881('0x3a')][_0x4881('0x1a')](_0x2a84fd)['then'](function(_0x52a198){_0x5525eb['count']=_0x52a198;if(_0x590098[_0x4881('0x28')]['includeAll']){_0x2bf637[_0x4881('0x3b')]=[{'all':!![]}];}return db['VtigerField'][_0x4881('0x3c')](_0x2bf637);})[_0x4881('0x1e')](function(_0x374150){_0x5525eb[_0x4881('0x3d')]=_0x374150;return _0x5525eb;})['then'](respondWithFilteredResult(_0x658ec9,_0x2bf637))[_0x4881('0x3e')](handleError(_0x658ec9,null));};exports['show']=function(_0x15fc80,_0x497baa){var _0x5e8ad1={'raw':!![],'where':{'id':_0x15fc80[_0x4881('0x3f')]['id']}},_0x17bbe7={};_0x17bbe7[_0x4881('0x2c')]=_[_0x4881('0x29')](db[_0x4881('0x3a')][_0x4881('0x24')]);_0x17bbe7[_0x4881('0x28')]=_[_0x4881('0x29')](_0x15fc80[_0x4881('0x28')]);_0x17bbe7['filters']=_[_0x4881('0x2b')](_0x17bbe7[_0x4881('0x2c')],_0x17bbe7[_0x4881('0x28')]);_0x5e8ad1[_0x4881('0x2e')]=_[_0x4881('0x2b')](_0x17bbe7['model'],qs[_0x4881('0x2d')](_0x15fc80['query'][_0x4881('0x2d')]));_0x5e8ad1['attributes']=_0x5e8ad1['attributes'][_0x4881('0x2f')]?_0x5e8ad1[_0x4881('0x2e')]:_0x17bbe7[_0x4881('0x2c')];if(_0x15fc80[_0x4881('0x28')][_0x4881('0x40')]){_0x5e8ad1[_0x4881('0x3b')]=[{'all':!![]}];}_0x5e8ad1=_[_0x4881('0x37')]({},_0x5e8ad1,_0x15fc80['options']);return db['VtigerField'][_0x4881('0x41')](_0x5e8ad1)['then'](handleEntityNotFound(_0x497baa,null))['then'](respondWithResult(_0x497baa,null))[_0x4881('0x3e')](handleError(_0x497baa,null));};exports[_0x4881('0x42')]=function(_0x479043,_0x699b38){return db[_0x4881('0x3a')][_0x4881('0x42')](_0x479043[_0x4881('0x43')],{})[_0x4881('0x1e')](respondWithResult(_0x699b38,0xc9))[_0x4881('0x3e')](handleError(_0x699b38,null));};exports['update']=function(_0x3bfd36,_0x5bc1c2){if(_0x3bfd36[_0x4881('0x43')]['id']){delete _0x3bfd36[_0x4881('0x43')]['id'];}return db['VtigerField']['find']({'where':{'id':_0x3bfd36[_0x4881('0x3f')]['id']}})['then'](handleEntityNotFound(_0x5bc1c2,null))[_0x4881('0x1e')](saveUpdates(_0x3bfd36[_0x4881('0x43')],null))[_0x4881('0x1e')](respondWithResult(_0x5bc1c2,null))[_0x4881('0x3e')](handleError(_0x5bc1c2,null));};exports[_0x4881('0x44')]=function(_0x9b18cb,_0x2c994d){return db[_0x4881('0x3a')][_0x4881('0x41')]({'where':{'id':_0x9b18cb[_0x4881('0x3f')]['id']}})[_0x4881('0x1e')](handleEntityNotFound(_0x2c994d,null))[_0x4881('0x1e')](removeEntity(_0x2c994d,null))[_0x4881('0x3e')](handleError(_0x2c994d,null));}; \ No newline at end of file +var _0x8a9a=['attributes','model','fields','hasOwnProperty','nolimit','sort','where','filters','merge','VIRTUAL','filter','include','findAll','rows','catch','show','keys','length','includeAll','create','body','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','limit','status','set','reject','save','update','then','destroy','stack','name','send','index','map','VtigerField','rawAttributes','fieldName','type','key','intersection','query'];(function(_0x2d34d6,_0x397ff9){var _0x1d3d12=function(_0x558800){while(--_0x558800){_0x2d34d6['push'](_0x2d34d6['shift']());}};_0x1d3d12(++_0x397ff9);}(_0x8a9a,0x17f));var _0xa8a9=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x8a9a[_0x465a0c];return _0x1e202e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa8a9('0x0'));var rimraf=require(_0xa8a9('0x1'));var zipdir=require(_0xa8a9('0x2'));var jsonpatch=require(_0xa8a9('0x3'));var rp=require(_0xa8a9('0x4'));var moment=require(_0xa8a9('0x5'));var BPromise=require(_0xa8a9('0x6'));var Mustache=require(_0xa8a9('0x7'));var util=require(_0xa8a9('0x8'));var path=require(_0xa8a9('0x9'));var sox=require(_0xa8a9('0xa'));var csv=require(_0xa8a9('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xa8a9('0xc'));var squel=require('squel');var crypto=require(_0xa8a9('0xd'));var jsforce=require(_0xa8a9('0xe'));var deskjs=require(_0xa8a9('0xf'));var toCsv=require(_0xa8a9('0xb'));var querystring=require(_0xa8a9('0x10'));var Papa=require('papaparse');var Redis=require(_0xa8a9('0x11'));var authService=require(_0xa8a9('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xa8a9('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa8a9('0x14'))(_0xa8a9('0x15'));var utils=require('../../config/utils');var config=require(_0xa8a9('0x16'));var db=require(_0xa8a9('0x17'))['db'];function respondWithStatusCode(_0x4477a5,_0x28d881){_0x28d881=_0x28d881||0xcc;return function(_0x35b204){if(_0x35b204){return _0x4477a5[_0xa8a9('0x18')](_0x28d881);}return _0x4477a5['status'](_0x28d881)[_0xa8a9('0x19')]();};}function respondWithResult(_0x157ad7,_0x24abd1){_0x24abd1=_0x24abd1||0xc8;return function(_0x509bcb){if(_0x509bcb){return _0x157ad7['status'](_0x24abd1)[_0xa8a9('0x1a')](_0x509bcb);}};}function respondWithFilteredResult(_0x1d145e,_0x2c9f36){return function(_0x4ca16f){if(_0x4ca16f){var _0x2efd94=_0x4ca16f[_0xa8a9('0x1b')],_0x35be8c=_0x2c9f36[_0xa8a9('0x1c')],_0x557f45=_0x2c9f36[_0xa8a9('0x1c')]+_0x2c9f36[_0xa8a9('0x1d')],_0x4b7219;if(_0x557f45>=_0x2efd94){_0x557f45=_0x2efd94;_0x4b7219=0xc8;}else{_0x4b7219=0xce;}_0x1d145e[_0xa8a9('0x1e')](_0x4b7219);return _0x1d145e[_0xa8a9('0x1f')]('Content-Range',_0x35be8c+'-'+_0x557f45+'/'+_0x2efd94)['json'](_0x4ca16f);}return null;};}function patchUpdates(_0x3a7ae7){return function(_0x5ca727){try{jsonpatch['apply'](_0x5ca727,_0x3a7ae7,!![]);}catch(_0x133d0e){return BPromise[_0xa8a9('0x20')](_0x133d0e);}return _0x5ca727[_0xa8a9('0x21')]();};}function saveUpdates(_0x3a2207,_0x4744f1){return function(_0x3e8629){if(_0x3e8629){return _0x3e8629[_0xa8a9('0x22')](_0x3a2207)[_0xa8a9('0x23')](function(_0x1ef185){return _0x1ef185;});}return null;};}function removeEntity(_0x59d315,_0x102301){return function(_0x481a34){if(_0x481a34){return _0x481a34[_0xa8a9('0x24')]()['then'](function(){_0x59d315[_0xa8a9('0x1e')](0xcc)[_0xa8a9('0x19')]();});}};}function handleEntityNotFound(_0x540349,_0x58f832){return function(_0x5d3ec8){if(!_0x5d3ec8){_0x540349['sendStatus'](0x194);}return _0x5d3ec8;};}function handleError(_0xcca967,_0x4faffe){_0x4faffe=_0x4faffe||0x1f4;return function(_0x46d765){logger['error'](_0x46d765[_0xa8a9('0x25')]);if(_0x46d765[_0xa8a9('0x26')]){delete _0x46d765[_0xa8a9('0x26')];}_0xcca967[_0xa8a9('0x1e')](_0x4faffe)[_0xa8a9('0x27')](_0x46d765);};}exports[_0xa8a9('0x28')]=function(_0x489159,_0x3c210b){var _0x4d6c65={},_0x45578f={},_0x1f748a={'count':0x0,'rows':[]};var _0x476365=_[_0xa8a9('0x29')](db[_0xa8a9('0x2a')][_0xa8a9('0x2b')],function(_0x4a468f){return{'name':_0x4a468f[_0xa8a9('0x2c')],'type':_0x4a468f[_0xa8a9('0x2d')][_0xa8a9('0x2e')]};});_0x45578f['model']=_[_0xa8a9('0x29')](_0x476365,_0xa8a9('0x26'));_0x45578f['query']=_['keys'](_0x489159['query']);_0x45578f['filters']=_[_0xa8a9('0x2f')](_0x45578f['model'],_0x45578f[_0xa8a9('0x30')]);_0x4d6c65[_0xa8a9('0x31')]=_[_0xa8a9('0x2f')](_0x45578f[_0xa8a9('0x32')],qs['fields'](_0x489159['query'][_0xa8a9('0x33')]));_0x4d6c65[_0xa8a9('0x31')]=_0x4d6c65[_0xa8a9('0x31')]['length']?_0x4d6c65[_0xa8a9('0x31')]:_0x45578f[_0xa8a9('0x32')];if(!_0x489159[_0xa8a9('0x30')][_0xa8a9('0x34')](_0xa8a9('0x35'))){_0x4d6c65['limit']=qs[_0xa8a9('0x1d')](_0x489159[_0xa8a9('0x30')][_0xa8a9('0x1d')]);_0x4d6c65['offset']=qs[_0xa8a9('0x1c')](_0x489159['query']['offset']);}_0x4d6c65['order']=qs[_0xa8a9('0x36')](_0x489159['query'][_0xa8a9('0x36')]);_0x4d6c65[_0xa8a9('0x37')]=qs[_0xa8a9('0x38')](_['pick'](_0x489159[_0xa8a9('0x30')],_0x45578f[_0xa8a9('0x38')]));if(_0x489159['query']['filter']){_0x4d6c65[_0xa8a9('0x37')]=_[_0xa8a9('0x39')](_0x4d6c65['where'],{'$or':_[_0xa8a9('0x29')](_0x476365,function(_0x53a589){if(_0x53a589['type'][_0xa8a9('0x2e')]!==_0xa8a9('0x3a')){var _0x41e1f0={};_0x41e1f0[_0x53a589['field']]={'$like':'%'+_0x489159[_0xa8a9('0x30')][_0xa8a9('0x3b')]+'%'};return _0x41e1f0;}})});}_0x4d6c65=_[_0xa8a9('0x39')]({},_0x4d6c65,_0x489159['options']);var _0x280b9d={'where':_0x4d6c65['where']};return db[_0xa8a9('0x2a')]['count'](_0x280b9d)[_0xa8a9('0x23')](function(_0x579081){_0x1f748a[_0xa8a9('0x1b')]=_0x579081;if(_0x489159[_0xa8a9('0x30')]['includeAll']){_0x4d6c65[_0xa8a9('0x3c')]=[{'all':!![]}];}return db['VtigerField'][_0xa8a9('0x3d')](_0x4d6c65);})[_0xa8a9('0x23')](function(_0x475a0a){_0x1f748a[_0xa8a9('0x3e')]=_0x475a0a;return _0x1f748a;})[_0xa8a9('0x23')](respondWithFilteredResult(_0x3c210b,_0x4d6c65))[_0xa8a9('0x3f')](handleError(_0x3c210b,null));};exports[_0xa8a9('0x40')]=function(_0x47cb9e,_0x1e05f6){var _0x333101={'raw':!![],'where':{'id':_0x47cb9e['params']['id']}},_0x3a51ed={};_0x3a51ed['model']=_['keys'](db[_0xa8a9('0x2a')][_0xa8a9('0x2b')]);_0x3a51ed[_0xa8a9('0x30')]=_[_0xa8a9('0x41')](_0x47cb9e[_0xa8a9('0x30')]);_0x3a51ed[_0xa8a9('0x38')]=_[_0xa8a9('0x2f')](_0x3a51ed[_0xa8a9('0x32')],_0x3a51ed['query']);_0x333101[_0xa8a9('0x31')]=_[_0xa8a9('0x2f')](_0x3a51ed[_0xa8a9('0x32')],qs[_0xa8a9('0x33')](_0x47cb9e[_0xa8a9('0x30')][_0xa8a9('0x33')]));_0x333101['attributes']=_0x333101[_0xa8a9('0x31')][_0xa8a9('0x42')]?_0x333101[_0xa8a9('0x31')]:_0x3a51ed['model'];if(_0x47cb9e[_0xa8a9('0x30')][_0xa8a9('0x43')]){_0x333101[_0xa8a9('0x3c')]=[{'all':!![]}];}_0x333101=_[_0xa8a9('0x39')]({},_0x333101,_0x47cb9e['options']);return db[_0xa8a9('0x2a')]['find'](_0x333101)[_0xa8a9('0x23')](handleEntityNotFound(_0x1e05f6,null))[_0xa8a9('0x23')](respondWithResult(_0x1e05f6,null))[_0xa8a9('0x3f')](handleError(_0x1e05f6,null));};exports[_0xa8a9('0x44')]=function(_0x38b9c0,_0x21ff9b){return db['VtigerField'][_0xa8a9('0x44')](_0x38b9c0[_0xa8a9('0x45')],{})['then'](respondWithResult(_0x21ff9b,0xc9))[_0xa8a9('0x3f')](handleError(_0x21ff9b,null));};exports['update']=function(_0x2fba4a,_0x4c57c4){if(_0x2fba4a[_0xa8a9('0x45')]['id']){delete _0x2fba4a[_0xa8a9('0x45')]['id'];}return db[_0xa8a9('0x2a')][_0xa8a9('0x46')]({'where':{'id':_0x2fba4a[_0xa8a9('0x47')]['id']}})[_0xa8a9('0x23')](handleEntityNotFound(_0x4c57c4,null))[_0xa8a9('0x23')](saveUpdates(_0x2fba4a['body'],null))[_0xa8a9('0x23')](respondWithResult(_0x4c57c4,null))[_0xa8a9('0x3f')](handleError(_0x4c57c4,null));};exports['destroy']=function(_0x3eec79,_0x333628){return db['VtigerField'][_0xa8a9('0x46')]({'where':{'id':_0x3eec79[_0xa8a9('0x47')]['id']}})[_0xa8a9('0x23')](handleEntityNotFound(_0x333628,null))[_0xa8a9('0x23')](removeEntity(_0x333628,null))[_0xa8a9('0x3f')](handleError(_0x333628,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 6e4bf30..1063b45 100644 --- a/server/api/intVtigerField/intVtigerField.model.js +++ b/server/api/intVtigerField/intVtigerField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['int_vtiger_fields','idField','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intVtigerField.attributes','exports','VtigerField'];(function(_0x4d98d4,_0x105c0c){var _0x3093b4=function(_0xf0959b){while(--_0xf0959b){_0x4d98d4['push'](_0x4d98d4['shift']());}};_0x3093b4(++_0x105c0c);}(_0x7a54,0x106));var _0x47a5=function(_0x2843de,_0x2fbc2f){_0x2843de=_0x2843de-0x0;var _0x32e5f5=_0x7a54[_0x2843de];return _0x32e5f5;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':[_0x47a5('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['int_vtiger_fields','idField','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intVtigerField.attributes','exports','VtigerField'];(function(_0x407ea5,_0x172b55){var _0x170fd3=function(_0x46b46d){while(--_0x46b46d){_0x407ea5['push'](_0x407ea5['shift']());}};_0x170fd3(++_0x172b55);}(_0x7a54,0x106));var _0x47a5=function(_0x4622a2,_0xfdfe1c){_0x4622a2=_0x4622a2-0x0;var _0xda5efd=_0x7a54[_0x4622a2];return _0xda5efd;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':[_0x47a5('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.rpc.js b/server/api/intVtigerField/intVtigerField.rpc.js index f0343b2..18d2bd1 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 _0x2ea1=['message','VtigerField,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','error'];(function(_0x170f1d,_0x5cc5b2){var _0x21dd10=function(_0x33be5f){while(--_0x33be5f){_0x170f1d['push'](_0x170f1d['shift']());}};_0x21dd10(++_0x5cc5b2);}(_0x2ea1,0xca));var _0x12ea=function(_0x2c55b9,_0x59fefc){_0x2c55b9=_0x2c55b9-0x0;var _0x25e842=_0x2ea1[_0x2c55b9];return _0x25e842;};'use strict';var _=require(_0x12ea('0x0'));var util=require(_0x12ea('0x1'));var moment=require(_0x12ea('0x2'));var BPromise=require(_0x12ea('0x3'));var rs=require(_0x12ea('0x4'));var fs=require('fs');var Redis=require(_0x12ea('0x5'));var db=require(_0x12ea('0x6'))['db'];var utils=require(_0x12ea('0x7'));var logger=require('../../config/logger')(_0x12ea('0x8'));var config=require(_0x12ea('0x9'));var jayson=require(_0x12ea('0xa'));var client=jayson['client'][_0x12ea('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x242d90,_0x46885c,_0x18108b){return new BPromise(function(_0x3d83e1,_0xacc885){return client[_0x12ea('0xc')](_0x242d90,_0x18108b)['then'](function(_0x5984f7){logger[_0x12ea('0xd')]('VtigerField,\x20%s,\x20%s',_0x46885c,_0x12ea('0xe'));logger[_0x12ea('0xf')](_0x12ea('0x10'),_0x46885c,_0x12ea('0xe'),JSON['stringify'](_0x5984f7));if(_0x5984f7[_0x12ea('0x11')]){if(_0x5984f7[_0x12ea('0x11')]['code']===0x1f4){logger[_0x12ea('0x11')]('VtigerField,\x20%s,\x20%s',_0x46885c,_0x5984f7['error'][_0x12ea('0x12')]);return _0xacc885(_0x5984f7[_0x12ea('0x11')][_0x12ea('0x12')]);}logger[_0x12ea('0x11')](_0x12ea('0x13'),_0x46885c,_0x5984f7[_0x12ea('0x11')][_0x12ea('0x12')]);return _0x3d83e1(_0x5984f7[_0x12ea('0x11')]['message']);}else{logger[_0x12ea('0xd')](_0x12ea('0x13'),_0x46885c,_0x12ea('0xe'));_0x3d83e1(_0x5984f7[_0x12ea('0x14')]['message']);}})[_0x12ea('0x15')](function(_0x4d8c57){logger[_0x12ea('0x11')](_0x12ea('0x13'),_0x46885c,_0x4d8c57);_0xacc885(_0x4d8c57);});});} \ No newline at end of file +var _0x56c8=['message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','debug','VtigerField,\x20%s,\x20%s,\x20%s','request\x20sent','error','VtigerField,\x20%s,\x20%s'];(function(_0x5ad131,_0x33549f){var _0xf19630=function(_0x4fa562){while(--_0x4fa562){_0x5ad131['push'](_0x5ad131['shift']());}};_0xf19630(++_0x33549f);}(_0x56c8,0x12f));var _0x856c=function(_0x410b1d,_0x2566f3){_0x410b1d=_0x410b1d-0x0;var _0x1f4bd5=_0x56c8[_0x410b1d];return _0x1f4bd5;};'use strict';var _=require(_0x856c('0x0'));var util=require(_0x856c('0x1'));var moment=require(_0x856c('0x2'));var BPromise=require(_0x856c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x856c('0x4'));var db=require(_0x856c('0x5'))['db'];var utils=require(_0x856c('0x6'));var logger=require(_0x856c('0x7'))(_0x856c('0x8'));var config=require('../../config/environment');var jayson=require(_0x856c('0x9'));var client=jayson[_0x856c('0xa')][_0x856c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x15a17c,_0x338a7e,_0x456bdb){return new BPromise(function(_0x48d81b,_0x5064ef){return client[_0x856c('0xc')](_0x15a17c,_0x456bdb)[_0x856c('0xd')](function(_0xa2bd07){logger['info']('VtigerField,\x20%s,\x20%s',_0x338a7e,'request\x20sent');logger[_0x856c('0xe')](_0x856c('0xf'),_0x338a7e,_0x856c('0x10'),JSON['stringify'](_0xa2bd07));if(_0xa2bd07[_0x856c('0x11')]){if(_0xa2bd07[_0x856c('0x11')]['code']===0x1f4){logger[_0x856c('0x11')](_0x856c('0x12'),_0x338a7e,_0xa2bd07[_0x856c('0x11')][_0x856c('0x13')]);return _0x5064ef(_0xa2bd07[_0x856c('0x11')][_0x856c('0x13')]);}logger[_0x856c('0x11')](_0x856c('0x12'),_0x338a7e,_0xa2bd07['error'][_0x856c('0x13')]);return _0x48d81b(_0xa2bd07['error'][_0x856c('0x13')]);}else{logger[_0x856c('0x14')](_0x856c('0x12'),_0x338a7e,_0x856c('0x10'));_0x48d81b(_0xa2bd07[_0x856c('0x15')][_0x856c('0x13')]);}})[_0x856c('0x16')](function(_0x13b1c6){logger[_0x856c('0x11')](_0x856c('0x12'),_0x338a7e,_0x13b1c6);_0x5064ef(_0x13b1c6);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 0941c57..45e49d1 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 _0x53be=['getConfigurations','getFields','post','create','update','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','isAuthenticated','index','get','/:id','show','/:id/configurations'];(function(_0x1232ec,_0x2df4b1){var _0x4483b4=function(_0x39bfff){while(--_0x39bfff){_0x1232ec['push'](_0x1232ec['shift']());}};_0x4483b4(++_0x2df4b1);}(_0x53be,0x151));var _0xe53b=function(_0x549b03,_0x2f96dc){_0x549b03=_0x549b03-0x0;var _0x1779ab=_0x53be[_0x549b03];return _0x1779ab;};'use strict';var multer=require(_0xe53b('0x0'));var util=require(_0xe53b('0x1'));var path=require('path');var timeout=require(_0xe53b('0x2'));var express=require(_0xe53b('0x3'));var router=express[_0xe53b('0x4')]();var auth=require(_0xe53b('0x5'));var interaction=require(_0xe53b('0x6'));var config=require(_0xe53b('0x7'));var controller=require(_0xe53b('0x8'));router['get']('/',auth[_0xe53b('0x9')](),controller[_0xe53b('0xa')]);router[_0xe53b('0xb')](_0xe53b('0xc'),auth[_0xe53b('0x9')](),controller[_0xe53b('0xd')]);router[_0xe53b('0xb')](_0xe53b('0xe'),auth[_0xe53b('0x9')](),controller[_0xe53b('0xf')]);router[_0xe53b('0xb')]('/:id/fields',auth[_0xe53b('0x9')](),controller[_0xe53b('0x10')]);router[_0xe53b('0x11')]('/',auth[_0xe53b('0x9')](),controller[_0xe53b('0x12')]);router[_0xe53b('0x11')](_0xe53b('0xe'),auth[_0xe53b('0x9')](),controller['addConfiguration']);router['put']('/:id',auth[_0xe53b('0x9')](),controller[_0xe53b('0x13')]);router['delete'](_0xe53b('0xc'),auth['isAuthenticated'](),controller[_0xe53b('0x14')]);module[_0xe53b('0x15')]=router; \ No newline at end of file +var _0x9c6a=['multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','update','exports'];(function(_0x33e6b4,_0x4fa8eb){var _0x37aadb=function(_0x49c5bd){while(--_0x49c5bd){_0x33e6b4['push'](_0x33e6b4['shift']());}};_0x37aadb(++_0x4fa8eb);}(_0x9c6a,0xcf));var _0xa9c6=function(_0x4306b6,_0x230d73){_0x4306b6=_0x4306b6-0x0;var _0xa7eace=_0x9c6a[_0x4306b6];return _0xa7eace;};'use strict';var multer=require(_0xa9c6('0x0'));var util=require(_0xa9c6('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa9c6('0x2'));var router=express[_0xa9c6('0x3')]();var auth=require(_0xa9c6('0x4'));var interaction=require(_0xa9c6('0x5'));var config=require(_0xa9c6('0x6'));var controller=require(_0xa9c6('0x7'));router[_0xa9c6('0x8')]('/',auth[_0xa9c6('0x9')](),controller[_0xa9c6('0xa')]);router[_0xa9c6('0x8')](_0xa9c6('0xb'),auth[_0xa9c6('0x9')](),controller[_0xa9c6('0xc')]);router[_0xa9c6('0x8')]('/:id/configurations',auth[_0xa9c6('0x9')](),controller[_0xa9c6('0xd')]);router[_0xa9c6('0x8')](_0xa9c6('0xe'),auth[_0xa9c6('0x9')](),controller[_0xa9c6('0xf')]);router[_0xa9c6('0x10')]('/',auth[_0xa9c6('0x9')](),controller[_0xa9c6('0x11')]);router[_0xa9c6('0x10')](_0xa9c6('0x12'),auth[_0xa9c6('0x9')](),controller[_0xa9c6('0x13')]);router[_0xa9c6('0x14')](_0xa9c6('0xb'),auth['isAuthenticated'](),controller[_0xa9c6('0x15')]);router['delete'](_0xa9c6('0xb'),auth[_0xa9c6('0x9')](),controller['destroy']);module[_0xa9c6('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 4808eb3..ca97bbd 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 _0x3320=['newTab','sequelize','exports','STRING','username','remoteUri','token','password','integrationTab'];(function(_0x4360c4,_0x2f8209){var _0x3168c8=function(_0x309523){while(--_0x309523){_0x4360c4['push'](_0x4360c4['shift']());}};_0x3168c8(++_0x2f8209);}(_0x3320,0x169));var _0x0332=function(_0x2342e2,_0x387260){_0x2342e2=_0x2342e2-0x0;var _0x1bfb7b=_0x3320[_0x2342e2];return _0x1bfb7b;};'use strict';var Sequelize=require(_0x0332('0x0'));module[_0x0332('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0332('0x2')]},'username':{'type':Sequelize[_0x0332('0x2')],'unique':_0x0332('0x3')},'password':{'type':Sequelize[_0x0332('0x2')]},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0332('0x2')],'unique':_0x0332('0x4')},'authType':{'type':Sequelize['ENUM']('password',_0x0332('0x5')),'defaultValue':_0x0332('0x6')},'serverUrl':{'type':Sequelize[_0x0332('0x2')]},'type':{'type':Sequelize['ENUM'](_0x0332('0x7'),_0x0332('0x8')),'defaultValue':_0x0332('0x7')}}; \ No newline at end of file +var _0xbebb=['integrationTab','sequelize','STRING','username','remoteUri','ENUM','password','newTab'];(function(_0x1cc274,_0x1ac4bb){var _0x59b240=function(_0x41ad69){while(--_0x41ad69){_0x1cc274['push'](_0x1cc274['shift']());}};_0x59b240(++_0x1ac4bb);}(_0xbebb,0x69));var _0xbbeb=function(_0x11c907,_0x467970){_0x11c907=_0x11c907-0x0;var _0x1a89e8=_0xbebb[_0x11c907];return _0x1a89e8;};'use strict';var Sequelize=require(_0xbbeb('0x0'));module['exports']={'name':{'type':Sequelize[_0xbbeb('0x1')]},'description':{'type':Sequelize[_0xbbeb('0x1')]},'username':{'type':Sequelize[_0xbbeb('0x1')],'unique':_0xbbeb('0x2')},'password':{'type':Sequelize[_0xbbeb('0x1')]},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xbbeb('0x1')],'unique':_0xbbeb('0x3')},'authType':{'type':Sequelize[_0xbbeb('0x4')](_0xbbeb('0x5'),'token'),'defaultValue':_0xbbeb('0x5')},'serverUrl':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xbbeb('0x4')]('integrationTab',_0xbbeb('0x6')),'defaultValue':_0xbbeb('0x7')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index af4f6c8..3956a95 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 _0x9c63=['type','VIRTUAL','field','filter','count','includeAll','include','findAll','rows','show','params','find','create','body','getConfigurations','findOne','ZendeskConfiguration','options','AccountId','Subjects','Descriptions','channel','ZendeskField','getFields','username','password','token','authType','remoteUri','slice','lastIndexOf','GET','ticket_fields','headers','format','Basic\x20%s','%s:%s','toString','base64','%s/token:%s','ValidationError','subject','description','group','assignee','includes','position','system_field_options','custom_field_options','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','name','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../components/integrations/configuration','http','test','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','code','error','message','result','catch','sendStatus','status','end','json','offset','apply','reject','save','update','destroy','stack','send','index','map','ZendeskAccount','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge'];(function(_0x29c3b2,_0x3c12ac){var _0x4b3aa7=function(_0x622a9d){while(--_0x622a9d){_0x29c3b2['push'](_0x29c3b2['shift']());}};_0x4b3aa7(++_0x3c12ac);}(_0x9c63,0x1a7));var _0x39c6=function(_0x3676e5,_0x948cdc){_0x3676e5=_0x3676e5-0x0;var _0xcc71cc=_0x9c63[_0x3676e5];return _0xcc71cc;};'use strict';var pdf=require(_0x39c6('0x0'));var emlformat=require(_0x39c6('0x1'));var rimraf=require(_0x39c6('0x2'));var zipdir=require(_0x39c6('0x3'));var jsonpatch=require(_0x39c6('0x4'));var rp=require('request-promise');var moment=require(_0x39c6('0x5'));var BPromise=require(_0x39c6('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x39c6('0x7'));var sox=require(_0x39c6('0x8'));var csv=require(_0x39c6('0x9'));var ejs=require(_0x39c6('0xa'));var fs=require('fs');var _=require(_0x39c6('0xb'));var squel=require(_0x39c6('0xc'));var crypto=require('crypto');var jsforce=require(_0x39c6('0xd'));var deskjs=require(_0x39c6('0xe'));var toCsv=require(_0x39c6('0x9'));var querystring=require(_0x39c6('0xf'));var Papa=require(_0x39c6('0x10'));var Redis=require('ioredis');var authService=require(_0x39c6('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x39c6('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x39c6('0x13'))(_0x39c6('0x14'));var utils=require(_0x39c6('0x15'));var config=require(_0x39c6('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0x39c6('0x17'));var jayson=require('jayson/promise');var client=jayson['client'][_0x39c6('0x18')]({'port':0x232a});function checkPasswordPattern(_0x10859a,_0x2542c9,_0x13ea70){if(_0x13ea70){var _0x504041=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x504041[_0x39c6('0x19')](_0x2542c9)){return _0x10859a;}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 _0x10859a;}}function respondWithRpcPromise(_0xf713c8,_0x1c25a9,_0x2ac896,_0x4c732a){return new BPromise(function(_0x5e3046,_0x4581d7){var _0x1b8bc3=_0x4c732a||client;return _0x1b8bc3['request'](_0xf713c8,_0x2ac896)[_0x39c6('0x1a')](function(_0x258b0a){logger[_0x39c6('0x1b')](_0x39c6('0x1c'),_0x1c25a9,_0x39c6('0x1d'));logger[_0x39c6('0x1e')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x1c25a9,'request\x20sent',JSON['stringify'](_0x258b0a));if(_0x258b0a['error']){if(_0x258b0a['error'][_0x39c6('0x1f')]===0x1f4){logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x1c25a9,_0x258b0a[_0x39c6('0x20')][_0x39c6('0x21')]);return _0x4581d7(_0x258b0a[_0x39c6('0x20')][_0x39c6('0x21')]);}logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x1c25a9,_0x258b0a['error'][_0x39c6('0x21')]);return _0x5e3046(_0x258b0a['error']['message']);}else{logger[_0x39c6('0x1b')](_0x39c6('0x1c'),_0x1c25a9,_0x39c6('0x1d'));_0x5e3046(_0x258b0a[_0x39c6('0x22')][_0x39c6('0x21')]);}})[_0x39c6('0x23')](function(_0x19e54d){logger[_0x39c6('0x20')](_0x39c6('0x1c'),_0x1c25a9,_0x19e54d);_0x4581d7(_0x19e54d);});});}function respondWithStatusCode(_0x245821,_0x2fd3a7){_0x2fd3a7=_0x2fd3a7||0xcc;return function(_0x3018f6){if(_0x3018f6){return _0x245821[_0x39c6('0x24')](_0x2fd3a7);}return _0x245821[_0x39c6('0x25')](_0x2fd3a7)[_0x39c6('0x26')]();};}function respondWithResult(_0x46d0c3,_0x1708e7){_0x1708e7=_0x1708e7||0xc8;return function(_0x48e08e){if(_0x48e08e){return _0x46d0c3[_0x39c6('0x25')](_0x1708e7)[_0x39c6('0x27')](_0x48e08e);}};}function respondWithFilteredResult(_0x929a7b,_0x4d3761){return function(_0xf06e09){if(_0xf06e09){var _0x348f90=_0xf06e09['count'],_0x185869=_0x4d3761[_0x39c6('0x28')],_0x179f15=_0x4d3761[_0x39c6('0x28')]+_0x4d3761['limit'],_0x5c07f7;if(_0x179f15>=_0x348f90){_0x179f15=_0x348f90;_0x5c07f7=0xc8;}else{_0x5c07f7=0xce;}_0x929a7b[_0x39c6('0x25')](_0x5c07f7);return _0x929a7b['set']('Content-Range',_0x185869+'-'+_0x179f15+'/'+_0x348f90)[_0x39c6('0x27')](_0xf06e09);}return null;};}function patchUpdates(_0x2aeab0){return function(_0x2a9b70){try{jsonpatch[_0x39c6('0x29')](_0x2a9b70,_0x2aeab0,!![]);}catch(_0x267441){return BPromise[_0x39c6('0x2a')](_0x267441);}return _0x2a9b70[_0x39c6('0x2b')]();};}function saveUpdates(_0xd0d54b,_0x4759c5){return function(_0x176e8e){if(_0x176e8e){return _0x176e8e[_0x39c6('0x2c')](_0xd0d54b)[_0x39c6('0x1a')](function(_0x33db66){return _0x33db66;});}return null;};}function removeEntity(_0x17d6bf,_0x14f28b){return function(_0x955f40){if(_0x955f40){return _0x955f40[_0x39c6('0x2d')]()['then'](function(){_0x17d6bf['status'](0xcc)[_0x39c6('0x26')]();});}};}function handleEntityNotFound(_0x29c845,_0x3ea9ef){return function(_0xa04e7a){if(!_0xa04e7a){_0x29c845[_0x39c6('0x24')](0x194);}return _0xa04e7a;};}function handleError(_0x114e36,_0x346938){_0x346938=_0x346938||0x1f4;return function(_0x52143d){logger[_0x39c6('0x20')](_0x52143d[_0x39c6('0x2e')]);if(_0x52143d['name']){delete _0x52143d['name'];}_0x114e36[_0x39c6('0x25')](_0x346938)[_0x39c6('0x2f')](_0x52143d);};}exports[_0x39c6('0x30')]=function(_0x1e1c31,_0x454c1b){var _0x2ec74d={},_0x321f5a={},_0x20f422={'count':0x0,'rows':[]};var _0x3c86ea=_[_0x39c6('0x31')](db[_0x39c6('0x32')][_0x39c6('0x33')],function(_0x1340f4){return{'name':_0x1340f4['fieldName'],'type':_0x1340f4['type'][_0x39c6('0x34')]};});_0x321f5a[_0x39c6('0x35')]=_[_0x39c6('0x31')](_0x3c86ea,'name');_0x321f5a[_0x39c6('0x36')]=_[_0x39c6('0x37')](_0x1e1c31[_0x39c6('0x36')]);_0x321f5a[_0x39c6('0x38')]=_['intersection'](_0x321f5a['model'],_0x321f5a[_0x39c6('0x36')]);_0x2ec74d['attributes']=_[_0x39c6('0x39')](_0x321f5a[_0x39c6('0x35')],qs[_0x39c6('0x3a')](_0x1e1c31[_0x39c6('0x36')]['fields']));_0x2ec74d[_0x39c6('0x3b')]=_0x2ec74d[_0x39c6('0x3b')][_0x39c6('0x3c')]?_0x2ec74d[_0x39c6('0x3b')]:_0x321f5a[_0x39c6('0x35')];if(!_0x1e1c31[_0x39c6('0x36')][_0x39c6('0x3d')](_0x39c6('0x3e'))){_0x2ec74d[_0x39c6('0x3f')]=qs['limit'](_0x1e1c31['query'][_0x39c6('0x3f')]);_0x2ec74d['offset']=qs[_0x39c6('0x28')](_0x1e1c31['query']['offset']);}_0x2ec74d[_0x39c6('0x40')]=qs[_0x39c6('0x41')](_0x1e1c31[_0x39c6('0x36')]['sort']);_0x2ec74d[_0x39c6('0x42')]=qs[_0x39c6('0x38')](_[_0x39c6('0x43')](_0x1e1c31[_0x39c6('0x36')],_0x321f5a[_0x39c6('0x38')]));if(_0x1e1c31[_0x39c6('0x36')]['filter']){_0x2ec74d['where']=_[_0x39c6('0x44')](_0x2ec74d[_0x39c6('0x42')],{'$or':_['map'](_0x3c86ea,function(_0x2a3143){if(_0x2a3143[_0x39c6('0x45')]['key']!==_0x39c6('0x46')){var _0x12a112={};_0x12a112[_0x2a3143[_0x39c6('0x47')]]={'$like':'%'+_0x1e1c31[_0x39c6('0x36')][_0x39c6('0x48')]+'%'};return _0x12a112;}})});}_0x2ec74d=_[_0x39c6('0x44')]({},_0x2ec74d,_0x1e1c31['options']);var _0x6e3511={'where':_0x2ec74d[_0x39c6('0x42')]};return db[_0x39c6('0x32')][_0x39c6('0x49')](_0x6e3511)[_0x39c6('0x1a')](function(_0x4d0479){_0x20f422[_0x39c6('0x49')]=_0x4d0479;if(_0x1e1c31['query'][_0x39c6('0x4a')]){_0x2ec74d[_0x39c6('0x4b')]=[{'all':!![]}];}return db[_0x39c6('0x32')][_0x39c6('0x4c')](_0x2ec74d);})[_0x39c6('0x1a')](function(_0x182b0d){_0x20f422[_0x39c6('0x4d')]=_0x182b0d;return _0x20f422;})[_0x39c6('0x1a')](respondWithFilteredResult(_0x454c1b,_0x2ec74d))['catch'](handleError(_0x454c1b,null));};exports[_0x39c6('0x4e')]=function(_0x7c2f08,_0x209bda){var _0x3147e2={'raw':![],'where':{'id':_0x7c2f08[_0x39c6('0x4f')]['id']}},_0x2a70a9={};_0x2a70a9[_0x39c6('0x35')]=_[_0x39c6('0x37')](db[_0x39c6('0x32')]['rawAttributes']);_0x2a70a9[_0x39c6('0x36')]=_[_0x39c6('0x37')](_0x7c2f08[_0x39c6('0x36')]);_0x2a70a9['filters']=_[_0x39c6('0x39')](_0x2a70a9['model'],_0x2a70a9[_0x39c6('0x36')]);_0x3147e2['attributes']=_[_0x39c6('0x39')](_0x2a70a9[_0x39c6('0x35')],qs[_0x39c6('0x3a')](_0x7c2f08['query'][_0x39c6('0x3a')]));_0x3147e2[_0x39c6('0x3b')]=_0x3147e2[_0x39c6('0x3b')][_0x39c6('0x3c')]?_0x3147e2[_0x39c6('0x3b')]:_0x2a70a9[_0x39c6('0x35')];if(_0x7c2f08['query'][_0x39c6('0x4a')]){_0x3147e2[_0x39c6('0x4b')]=[{'all':!![]}];}_0x3147e2=_[_0x39c6('0x44')]({},_0x3147e2,_0x7c2f08['options']);return db[_0x39c6('0x32')][_0x39c6('0x50')](_0x3147e2)['then'](handleEntityNotFound(_0x209bda,null))[_0x39c6('0x1a')](respondWithResult(_0x209bda,null))[_0x39c6('0x23')](handleError(_0x209bda,null));};exports[_0x39c6('0x51')]=function(_0x3d00d7,_0x369394){return db[_0x39c6('0x32')]['create'](_0x3d00d7[_0x39c6('0x52')],{})['then'](respondWithResult(_0x369394,0xc9))[_0x39c6('0x23')](handleError(_0x369394,null));};exports[_0x39c6('0x2c')]=function(_0x5d56e5,_0x5459e7){if(_0x5d56e5[_0x39c6('0x52')]['id']){delete _0x5d56e5[_0x39c6('0x52')]['id'];}return db[_0x39c6('0x32')][_0x39c6('0x50')]({'where':{'id':_0x5d56e5[_0x39c6('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5459e7,null))['then'](saveUpdates(_0x5d56e5['body'],null))[_0x39c6('0x1a')](respondWithResult(_0x5459e7,null))[_0x39c6('0x23')](handleError(_0x5459e7,null));};exports[_0x39c6('0x2d')]=function(_0xa0c2c0,_0x30f625){return db['ZendeskAccount'][_0x39c6('0x50')]({'where':{'id':_0xa0c2c0[_0x39c6('0x4f')]['id']}})[_0x39c6('0x1a')](handleEntityNotFound(_0x30f625,null))[_0x39c6('0x1a')](removeEntity(_0x30f625,null))[_0x39c6('0x23')](handleError(_0x30f625,null));};exports[_0x39c6('0x53')]=function(_0x51e356,_0x4f2fbe,_0x6729f){var _0x540bf9={};var _0x2e53b4={};var _0x2608e0;var _0x46c7eb;return db[_0x39c6('0x32')][_0x39c6('0x54')]({'where':{'id':_0x51e356[_0x39c6('0x4f')]['id']}})[_0x39c6('0x1a')](handleEntityNotFound(_0x4f2fbe,null))[_0x39c6('0x1a')](function(_0x3950ab){if(_0x3950ab){_0x2608e0=_0x3950ab;_0x2e53b4[_0x39c6('0x35')]=_['keys'](db[_0x39c6('0x55')]['rawAttributes']);_0x2e53b4[_0x39c6('0x36')]=_['keys'](_0x51e356[_0x39c6('0x36')]);_0x2e53b4[_0x39c6('0x38')]=_[_0x39c6('0x39')](_0x2e53b4[_0x39c6('0x35')],_0x2e53b4[_0x39c6('0x36')]);_0x540bf9['attributes']=_[_0x39c6('0x39')](_0x2e53b4[_0x39c6('0x35')],qs['fields'](_0x51e356[_0x39c6('0x36')][_0x39c6('0x3a')]));_0x540bf9[_0x39c6('0x3b')]=_0x540bf9[_0x39c6('0x3b')][_0x39c6('0x3c')]?_0x540bf9[_0x39c6('0x3b')]:_0x2e53b4[_0x39c6('0x35')];_0x540bf9[_0x39c6('0x40')]=qs[_0x39c6('0x41')](_0x51e356[_0x39c6('0x36')]['sort']);_0x540bf9[_0x39c6('0x42')]=qs[_0x39c6('0x38')](_[_0x39c6('0x43')](_0x51e356[_0x39c6('0x36')],_0x2e53b4[_0x39c6('0x38')]));if(_0x51e356['query'][_0x39c6('0x48')]){_0x540bf9[_0x39c6('0x42')]=_[_0x39c6('0x44')](_0x540bf9[_0x39c6('0x42')],{'$or':_[_0x39c6('0x31')](_0x540bf9[_0x39c6('0x3b')],function(_0x5d0c72){var _0x565ce6={};_0x565ce6[_0x5d0c72]={'$like':'%'+_0x51e356[_0x39c6('0x36')][_0x39c6('0x48')]+'%'};return _0x565ce6;})});}_0x540bf9=_['merge']({},_0x540bf9,_0x51e356[_0x39c6('0x56')]);return _0x2608e0[_0x39c6('0x53')](_0x540bf9);}})['then'](function(_0x3810d6){if(_0x3810d6){_0x46c7eb=_0x3810d6['length'];if(!_0x51e356[_0x39c6('0x36')][_0x39c6('0x3d')]('nolimit')){_0x540bf9[_0x39c6('0x3f')]=qs[_0x39c6('0x3f')](_0x51e356[_0x39c6('0x36')][_0x39c6('0x3f')]);_0x540bf9['offset']=qs[_0x39c6('0x28')](_0x51e356['query'][_0x39c6('0x28')]);}return _0x2608e0['getConfigurations'](_0x540bf9);}})[_0x39c6('0x1a')](function(_0xcd265e){if(_0xcd265e){return _0xcd265e?{'count':_0x46c7eb,'rows':_0xcd265e}:null;}})[_0x39c6('0x1a')](respondWithResult(_0x4f2fbe,null))[_0x39c6('0x23')](handleError(_0x4f2fbe,null));};exports['addConfiguration']=function(_0x4d02a5,_0x1edcd1,_0x1cfe6e){if(_0x4d02a5[_0x39c6('0x52')]['id']){delete _0x4d02a5['body']['id'];}return db[_0x39c6('0x32')][_0x39c6('0x54')]({'where':{'id':_0x4d02a5['params']['id']}})[_0x39c6('0x1a')](handleEntityNotFound(_0x1edcd1,null))['then'](function(_0x2254b8){if(_0x2254b8){_0x4d02a5[_0x39c6('0x52')][_0x39c6('0x57')]=_0x2254b8['id'];_0x4d02a5[_0x39c6('0x52')][_0x39c6('0x58')]=integrations['getSubjects'](_0x4d02a5['body']['channel'],_0x4d02a5[_0x39c6('0x52')][_0x39c6('0x45')]);_0x4d02a5[_0x39c6('0x52')][_0x39c6('0x59')]=integrations['getDescriptions'](_0x4d02a5[_0x39c6('0x52')][_0x39c6('0x5a')],_0x4d02a5[_0x39c6('0x52')][_0x39c6('0x45')]);return db[_0x39c6('0x55')][_0x39c6('0x51')](_0x4d02a5['body'],{'include':[{'model':db[_0x39c6('0x5b')],'as':'Subjects'},{'model':db['ZendeskField'],'as':_0x39c6('0x59')}]});}return null;})[_0x39c6('0x1a')](respondWithResult(_0x1edcd1,null))[_0x39c6('0x23')](handleError(_0x1edcd1,null));};exports[_0x39c6('0x5c')]=function(_0x22b4eb,_0x2f1de7,_0x1327bd){var _0x31e7ef='';return db[_0x39c6('0x32')][_0x39c6('0x54')]({'where':{'id':_0x22b4eb[_0x39c6('0x4f')]['id']},'attributes':['id',_0x39c6('0x5d'),_0x39c6('0x5e'),_0x39c6('0x5f'),_0x39c6('0x60'),_0x39c6('0x61')]})[_0x39c6('0x1a')](handleEntityNotFound(_0x2f1de7,null))['then'](function(_0x5b94e4){if(_0x5b94e4){_0x31e7ef=_0x5b94e4[_0x39c6('0x61')];var _0x197e1f=_0x31e7ef[_0x39c6('0x62')](-0x1);if(_0x197e1f==='/'){_0x31e7ef=_0x31e7ef['substring'](0x0,_0x31e7ef[_0x39c6('0x63')](_0x197e1f));}var _0x37f34d={'method':_0x39c6('0x64'),'uri':util['format']('%s/%s',_0x31e7ef,_0x39c6('0x65')),'json':!![]};switch(_0x5b94e4[_0x39c6('0x60')]){case'password':_0x37f34d[_0x39c6('0x66')]={'Authorization':util[_0x39c6('0x67')](_0x39c6('0x68'),new Buffer(util[_0x39c6('0x67')](_0x39c6('0x69'),_0x5b94e4['username'],_0x5b94e4[_0x39c6('0x5e')]))[_0x39c6('0x6a')](_0x39c6('0x6b')))};break;case _0x39c6('0x5f'):_0x37f34d[_0x39c6('0x66')]={'Authorization':util[_0x39c6('0x67')](_0x39c6('0x68'),new Buffer(util[_0x39c6('0x67')](_0x39c6('0x6c'),_0x5b94e4[_0x39c6('0x5d')],_0x5b94e4['token']))[_0x39c6('0x6a')](_0x39c6('0x6b')))};break;default:throw new db['Sequelize'][(_0x39c6('0x6d'))]('Unknown\x20authentication\x20type');}return rp(_0x37f34d);}})['then'](function(_0x360a5d){if(_0x360a5d){var _0x5ace2d=[_0x39c6('0x6e'),_0x39c6('0x6f'),_0x39c6('0x70'),_0x39c6('0x71')];_['remove'](_0x360a5d[_0x39c6('0x65')],function(_0x2905fe){return _0x5ace2d[_0x39c6('0x72')](_0x2905fe[_0x39c6('0x45')]);});return{'count':_0x360a5d[_0x39c6('0x65')][_0x39c6('0x3c')],'rows':_['map'](_0x360a5d['ticket_fields'],function(_0x54713b){return{'id':_0x54713b['id'],'name':_0x54713b[_0x39c6('0x73')]>0x7?_0x54713b['title']:_0x54713b['type'],'custom':_0x54713b['position']>0x7?!![]:![],'options':_0x54713b[_0x39c6('0x74')]?_0x54713b[_0x39c6('0x74')]:_0x54713b[_0x39c6('0x75')]?_0x54713b['custom_field_options']:[]};})};}})['then'](respondWithResult(_0x2f1de7,null))[_0x39c6('0x23')](function(_0x1b76c0){var _0x214f7c=_0x22b4eb[_0x39c6('0x36')][_0x39c6('0x19')]?0x1f4:_0x1b76c0[_0x39c6('0x76')]||0x1f4;logger[_0x39c6('0x20')](_0x39c6('0x77'),_0x39c6('0x5c'),_0x214f7c,JSON[_0x39c6('0x78')](_0x1b76c0));delete _0x1b76c0[_0x39c6('0x79')];if(_0x214f7c===0x191){_0x214f7c=0x190;}_0x2f1de7[_0x39c6('0x25')](_0x214f7c)[_0x39c6('0x2f')](_0x22b4eb[_0x39c6('0x36')][_0x39c6('0x19')]?{'message':_0x39c6('0x7a'),'statusCode':_0x1b76c0[_0x39c6('0x76')]}:_0x1b76c0);});}; \ No newline at end of file +var _0xb194=['sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','rows','params','keys','find','catch','body','findOne','ZendeskConfiguration','getConfigurations','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','ZendeskField','getFields','username','password','remoteUri','slice','substring','GET','format','%s/%s','authType','headers','Basic\x20%s','%s:%s','toString','base64','token','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','remove','ticket_fields','includes','position','title','system_field_options','custom_field_options','statusCode','send','Wrong\x20credentials','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../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','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','end','status','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','index','map','ZendeskAccount','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order'];(function(_0x1120cf,_0x2a04a7){var _0x27f040=function(_0x2427cf){while(--_0x2427cf){_0x1120cf['push'](_0x1120cf['shift']());}};_0x27f040(++_0x2a04a7);}(_0xb194,0x1b2));var _0x4b19=function(_0x2d1cf5,_0x8212d4){_0x2d1cf5=_0x2d1cf5-0x0;var _0x3edb6e=_0xb194[_0x2d1cf5];return _0x3edb6e;};'use strict';var pdf=require(_0x4b19('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x4b19('0x1'));var zipdir=require(_0x4b19('0x2'));var jsonpatch=require(_0x4b19('0x3'));var rp=require(_0x4b19('0x4'));var moment=require(_0x4b19('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4b19('0x6'));var util=require(_0x4b19('0x7'));var path=require('path');var sox=require(_0x4b19('0x8'));var csv=require('to-csv');var ejs=require(_0x4b19('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x4b19('0xa'));var crypto=require(_0x4b19('0xb'));var jsforce=require(_0x4b19('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4b19('0xd'));var Papa=require('papaparse');var Redis=require(_0x4b19('0xe'));var authService=require(_0x4b19('0xf'));var qs=require(_0x4b19('0x10'));var as=require(_0x4b19('0x11'));var hardwareService=require(_0x4b19('0x12'));var logger=require(_0x4b19('0x13'))(_0x4b19('0x14'));var utils=require(_0x4b19('0x15'));var config=require('../../config/environment');var db=require(_0x4b19('0x16'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x4b19('0x17'));var client=jayson[_0x4b19('0x18')]['http']({'port':0x232a});function checkPasswordPattern(_0x3eb69c,_0x4bb9c5,_0x22d142){if(_0x22d142){var _0x820063=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x820063[_0x4b19('0x19')](_0x4bb9c5)){return _0x3eb69c;}else{throw new Error(_0x4b19('0x1a'));}}else{return _0x3eb69c;}}function respondWithRpcPromise(_0xc0a0da,_0x5e02bc,_0xcaaaf6,_0xffedd7){return new BPromise(function(_0x17c334,_0x3a19cf){var _0x18d261=_0xffedd7||client;return _0x18d261[_0x4b19('0x1b')](_0xc0a0da,_0xcaaaf6)['then'](function(_0xb01cb6){logger[_0x4b19('0x1c')](_0x4b19('0x1d'),_0x5e02bc,_0x4b19('0x1e'));logger[_0x4b19('0x1f')](_0x4b19('0x20'),_0x5e02bc,_0x4b19('0x1e'),JSON[_0x4b19('0x21')](_0xb01cb6));if(_0xb01cb6['error']){if(_0xb01cb6[_0x4b19('0x22')]['code']===0x1f4){logger[_0x4b19('0x22')](_0x4b19('0x1d'),_0x5e02bc,_0xb01cb6[_0x4b19('0x22')][_0x4b19('0x23')]);return _0x3a19cf(_0xb01cb6[_0x4b19('0x22')][_0x4b19('0x23')]);}logger['error'](_0x4b19('0x1d'),_0x5e02bc,_0xb01cb6['error'][_0x4b19('0x23')]);return _0x17c334(_0xb01cb6[_0x4b19('0x22')][_0x4b19('0x23')]);}else{logger['info'](_0x4b19('0x1d'),_0x5e02bc,'request\x20sent');_0x17c334(_0xb01cb6[_0x4b19('0x24')][_0x4b19('0x23')]);}})['catch'](function(_0x363165){logger[_0x4b19('0x22')](_0x4b19('0x1d'),_0x5e02bc,_0x363165);_0x3a19cf(_0x363165);});});}function respondWithStatusCode(_0x821fae,_0x4c5f27){_0x4c5f27=_0x4c5f27||0xcc;return function(_0x12c4ac){if(_0x12c4ac){return _0x821fae['sendStatus'](_0x4c5f27);}return _0x821fae['status'](_0x4c5f27)[_0x4b19('0x25')]();};}function respondWithResult(_0x5a84a2,_0x294372){_0x294372=_0x294372||0xc8;return function(_0x3b1e62){if(_0x3b1e62){return _0x5a84a2[_0x4b19('0x26')](_0x294372)[_0x4b19('0x27')](_0x3b1e62);}};}function respondWithFilteredResult(_0x5c6741,_0x4149f1){return function(_0xcf1850){if(_0xcf1850){var _0x5987d6=_0xcf1850['count'],_0x2e1fab=_0x4149f1['offset'],_0x3bcc26=_0x4149f1[_0x4b19('0x28')]+_0x4149f1[_0x4b19('0x29')],_0x37d99b;if(_0x3bcc26>=_0x5987d6){_0x3bcc26=_0x5987d6;_0x37d99b=0xc8;}else{_0x37d99b=0xce;}_0x5c6741[_0x4b19('0x26')](_0x37d99b);return _0x5c6741[_0x4b19('0x2a')](_0x4b19('0x2b'),_0x2e1fab+'-'+_0x3bcc26+'/'+_0x5987d6)['json'](_0xcf1850);}return null;};}function patchUpdates(_0x15d240){return function(_0x1b75c){try{jsonpatch[_0x4b19('0x2c')](_0x1b75c,_0x15d240,!![]);}catch(_0x67e167){return BPromise[_0x4b19('0x2d')](_0x67e167);}return _0x1b75c[_0x4b19('0x2e')]();};}function saveUpdates(_0x2549e5,_0x32ee93){return function(_0xba0249){if(_0xba0249){return _0xba0249[_0x4b19('0x2f')](_0x2549e5)[_0x4b19('0x30')](function(_0x2be76d){return _0x2be76d;});}return null;};}function removeEntity(_0x5e4049,_0x2d0560){return function(_0x4d7252){if(_0x4d7252){return _0x4d7252[_0x4b19('0x31')]()[_0x4b19('0x30')](function(){_0x5e4049['status'](0xcc)[_0x4b19('0x25')]();});}};}function handleEntityNotFound(_0x289049,_0x310b08){return function(_0x4733fd){if(!_0x4733fd){_0x289049[_0x4b19('0x32')](0x194);}return _0x4733fd;};}function handleError(_0x3dcd1e,_0xe68ab5){_0xe68ab5=_0xe68ab5||0x1f4;return function(_0x22d5e7){logger[_0x4b19('0x22')](_0x22d5e7[_0x4b19('0x33')]);if(_0x22d5e7[_0x4b19('0x34')]){delete _0x22d5e7[_0x4b19('0x34')];}_0x3dcd1e[_0x4b19('0x26')](_0xe68ab5)['send'](_0x22d5e7);};}exports[_0x4b19('0x35')]=function(_0x5a7452,_0x52bbb2){var _0xc530e2={},_0x31eabc={},_0x273986={'count':0x0,'rows':[]};var _0x1fd261=_[_0x4b19('0x36')](db[_0x4b19('0x37')][_0x4b19('0x38')],function(_0x2c8bfa){return{'name':_0x2c8bfa[_0x4b19('0x39')],'type':_0x2c8bfa[_0x4b19('0x3a')][_0x4b19('0x3b')]};});_0x31eabc['model']=_[_0x4b19('0x36')](_0x1fd261,_0x4b19('0x34'));_0x31eabc['query']=_['keys'](_0x5a7452[_0x4b19('0x3c')]);_0x31eabc[_0x4b19('0x3d')]=_[_0x4b19('0x3e')](_0x31eabc[_0x4b19('0x3f')],_0x31eabc[_0x4b19('0x3c')]);_0xc530e2['attributes']=_['intersection'](_0x31eabc[_0x4b19('0x3f')],qs[_0x4b19('0x40')](_0x5a7452[_0x4b19('0x3c')][_0x4b19('0x40')]));_0xc530e2[_0x4b19('0x41')]=_0xc530e2[_0x4b19('0x41')][_0x4b19('0x42')]?_0xc530e2[_0x4b19('0x41')]:_0x31eabc[_0x4b19('0x3f')];if(!_0x5a7452[_0x4b19('0x3c')][_0x4b19('0x43')](_0x4b19('0x44'))){_0xc530e2[_0x4b19('0x29')]=qs['limit'](_0x5a7452[_0x4b19('0x3c')][_0x4b19('0x29')]);_0xc530e2[_0x4b19('0x28')]=qs['offset'](_0x5a7452[_0x4b19('0x3c')][_0x4b19('0x28')]);}_0xc530e2[_0x4b19('0x45')]=qs[_0x4b19('0x46')](_0x5a7452[_0x4b19('0x3c')]['sort']);_0xc530e2[_0x4b19('0x47')]=qs['filters'](_[_0x4b19('0x48')](_0x5a7452[_0x4b19('0x3c')],_0x31eabc[_0x4b19('0x3d')]));if(_0x5a7452['query'][_0x4b19('0x49')]){_0xc530e2[_0x4b19('0x47')]=_[_0x4b19('0x4a')](_0xc530e2[_0x4b19('0x47')],{'$or':_['map'](_0x1fd261,function(_0x501e01){if(_0x501e01['type'][_0x4b19('0x3b')]!==_0x4b19('0x4b')){var _0x3084bc={};_0x3084bc[_0x501e01['field']]={'$like':'%'+_0x5a7452[_0x4b19('0x3c')]['filter']+'%'};return _0x3084bc;}})});}_0xc530e2=_[_0x4b19('0x4a')]({},_0xc530e2,_0x5a7452[_0x4b19('0x4c')]);var _0x2d136b={'where':_0xc530e2[_0x4b19('0x47')]};return db[_0x4b19('0x37')][_0x4b19('0x4d')](_0x2d136b)['then'](function(_0x468e82){_0x273986[_0x4b19('0x4d')]=_0x468e82;if(_0x5a7452[_0x4b19('0x3c')][_0x4b19('0x4e')]){_0xc530e2[_0x4b19('0x4f')]=[{'all':!![]}];}return db['ZendeskAccount']['findAll'](_0xc530e2);})[_0x4b19('0x30')](function(_0x1ae695){_0x273986[_0x4b19('0x50')]=_0x1ae695;return _0x273986;})[_0x4b19('0x30')](respondWithFilteredResult(_0x52bbb2,_0xc530e2))['catch'](handleError(_0x52bbb2,null));};exports['show']=function(_0x1aaac2,_0xe70530){var _0x53b0df={'raw':![],'where':{'id':_0x1aaac2[_0x4b19('0x51')]['id']}},_0x5a469f={};_0x5a469f[_0x4b19('0x3f')]=_[_0x4b19('0x52')](db[_0x4b19('0x37')][_0x4b19('0x38')]);_0x5a469f['query']=_[_0x4b19('0x52')](_0x1aaac2[_0x4b19('0x3c')]);_0x5a469f['filters']=_[_0x4b19('0x3e')](_0x5a469f[_0x4b19('0x3f')],_0x5a469f['query']);_0x53b0df[_0x4b19('0x41')]=_[_0x4b19('0x3e')](_0x5a469f[_0x4b19('0x3f')],qs[_0x4b19('0x40')](_0x1aaac2[_0x4b19('0x3c')][_0x4b19('0x40')]));_0x53b0df[_0x4b19('0x41')]=_0x53b0df[_0x4b19('0x41')][_0x4b19('0x42')]?_0x53b0df[_0x4b19('0x41')]:_0x5a469f[_0x4b19('0x3f')];if(_0x1aaac2[_0x4b19('0x3c')]['includeAll']){_0x53b0df[_0x4b19('0x4f')]=[{'all':!![]}];}_0x53b0df=_[_0x4b19('0x4a')]({},_0x53b0df,_0x1aaac2[_0x4b19('0x4c')]);return db[_0x4b19('0x37')][_0x4b19('0x53')](_0x53b0df)[_0x4b19('0x30')](handleEntityNotFound(_0xe70530,null))['then'](respondWithResult(_0xe70530,null))[_0x4b19('0x54')](handleError(_0xe70530,null));};exports['create']=function(_0x143a7f,_0x311ef7){return db[_0x4b19('0x37')]['create'](_0x143a7f[_0x4b19('0x55')],{})[_0x4b19('0x30')](respondWithResult(_0x311ef7,0xc9))[_0x4b19('0x54')](handleError(_0x311ef7,null));};exports['update']=function(_0x4a0d49,_0x3195a5){if(_0x4a0d49[_0x4b19('0x55')]['id']){delete _0x4a0d49[_0x4b19('0x55')]['id'];}return db[_0x4b19('0x37')]['find']({'where':{'id':_0x4a0d49[_0x4b19('0x51')]['id']}})[_0x4b19('0x30')](handleEntityNotFound(_0x3195a5,null))['then'](saveUpdates(_0x4a0d49[_0x4b19('0x55')],null))['then'](respondWithResult(_0x3195a5,null))[_0x4b19('0x54')](handleError(_0x3195a5,null));};exports[_0x4b19('0x31')]=function(_0x1c6cbc,_0x3b8489){return db['ZendeskAccount'][_0x4b19('0x53')]({'where':{'id':_0x1c6cbc[_0x4b19('0x51')]['id']}})[_0x4b19('0x30')](handleEntityNotFound(_0x3b8489,null))[_0x4b19('0x30')](removeEntity(_0x3b8489,null))[_0x4b19('0x54')](handleError(_0x3b8489,null));};exports['getConfigurations']=function(_0xeaa367,_0x377d3c,_0x3c1c36){var _0x797fd3={};var _0x62df26={};var _0x23a5d9;var _0x5e20e6;return db[_0x4b19('0x37')][_0x4b19('0x56')]({'where':{'id':_0xeaa367[_0x4b19('0x51')]['id']}})['then'](handleEntityNotFound(_0x377d3c,null))['then'](function(_0x507490){if(_0x507490){_0x23a5d9=_0x507490;_0x62df26['model']=_['keys'](db[_0x4b19('0x57')][_0x4b19('0x38')]);_0x62df26['query']=_['keys'](_0xeaa367['query']);_0x62df26[_0x4b19('0x3d')]=_[_0x4b19('0x3e')](_0x62df26[_0x4b19('0x3f')],_0x62df26['query']);_0x797fd3[_0x4b19('0x41')]=_[_0x4b19('0x3e')](_0x62df26[_0x4b19('0x3f')],qs[_0x4b19('0x40')](_0xeaa367[_0x4b19('0x3c')]['fields']));_0x797fd3['attributes']=_0x797fd3[_0x4b19('0x41')][_0x4b19('0x42')]?_0x797fd3[_0x4b19('0x41')]:_0x62df26['model'];_0x797fd3[_0x4b19('0x45')]=qs['sort'](_0xeaa367[_0x4b19('0x3c')][_0x4b19('0x46')]);_0x797fd3[_0x4b19('0x47')]=qs[_0x4b19('0x3d')](_[_0x4b19('0x48')](_0xeaa367[_0x4b19('0x3c')],_0x62df26['filters']));if(_0xeaa367[_0x4b19('0x3c')]['filter']){_0x797fd3[_0x4b19('0x47')]=_[_0x4b19('0x4a')](_0x797fd3[_0x4b19('0x47')],{'$or':_['map'](_0x797fd3[_0x4b19('0x41')],function(_0x503ebc){var _0xcdb048={};_0xcdb048[_0x503ebc]={'$like':'%'+_0xeaa367[_0x4b19('0x3c')][_0x4b19('0x49')]+'%'};return _0xcdb048;})});}_0x797fd3=_[_0x4b19('0x4a')]({},_0x797fd3,_0xeaa367[_0x4b19('0x4c')]);return _0x23a5d9[_0x4b19('0x58')](_0x797fd3);}})['then'](function(_0x3f5f12){if(_0x3f5f12){_0x5e20e6=_0x3f5f12[_0x4b19('0x42')];if(!_0xeaa367['query']['hasOwnProperty'](_0x4b19('0x44'))){_0x797fd3['limit']=qs[_0x4b19('0x29')](_0xeaa367[_0x4b19('0x3c')][_0x4b19('0x29')]);_0x797fd3[_0x4b19('0x28')]=qs[_0x4b19('0x28')](_0xeaa367[_0x4b19('0x3c')][_0x4b19('0x28')]);}return _0x23a5d9['getConfigurations'](_0x797fd3);}})[_0x4b19('0x30')](function(_0x1edc38){if(_0x1edc38){return _0x1edc38?{'count':_0x5e20e6,'rows':_0x1edc38}:null;}})[_0x4b19('0x30')](respondWithResult(_0x377d3c,null))['catch'](handleError(_0x377d3c,null));};exports['addConfiguration']=function(_0x530dbe,_0x127606,_0x38aea3){if(_0x530dbe[_0x4b19('0x55')]['id']){delete _0x530dbe['body']['id'];}return db['ZendeskAccount'][_0x4b19('0x56')]({'where':{'id':_0x530dbe['params']['id']}})['then'](handleEntityNotFound(_0x127606,null))[_0x4b19('0x30')](function(_0xd6146a){if(_0xd6146a){_0x530dbe[_0x4b19('0x55')][_0x4b19('0x59')]=_0xd6146a['id'];_0x530dbe[_0x4b19('0x55')][_0x4b19('0x5a')]=integrations[_0x4b19('0x5b')](_0x530dbe[_0x4b19('0x55')]['channel'],_0x530dbe['body']['type']);_0x530dbe[_0x4b19('0x55')][_0x4b19('0x5c')]=integrations[_0x4b19('0x5d')](_0x530dbe['body']['channel'],_0x530dbe['body'][_0x4b19('0x3a')]);return db['ZendeskConfiguration']['create'](_0x530dbe[_0x4b19('0x55')],{'include':[{'model':db[_0x4b19('0x5e')],'as':'Subjects'},{'model':db[_0x4b19('0x5e')],'as':'Descriptions'}]});}return null;})[_0x4b19('0x30')](respondWithResult(_0x127606,null))[_0x4b19('0x54')](handleError(_0x127606,null));};exports[_0x4b19('0x5f')]=function(_0x151d08,_0x12c6d0,_0x32ebf7){var _0x24f135='';return db[_0x4b19('0x37')][_0x4b19('0x56')]({'where':{'id':_0x151d08['params']['id']},'attributes':['id',_0x4b19('0x60'),_0x4b19('0x61'),'token','authType','remoteUri']})[_0x4b19('0x30')](handleEntityNotFound(_0x12c6d0,null))[_0x4b19('0x30')](function(_0x21e852){if(_0x21e852){_0x24f135=_0x21e852[_0x4b19('0x62')];var _0x10b835=_0x24f135[_0x4b19('0x63')](-0x1);if(_0x10b835==='/'){_0x24f135=_0x24f135[_0x4b19('0x64')](0x0,_0x24f135['lastIndexOf'](_0x10b835));}var _0x99e7ca={'method':_0x4b19('0x65'),'uri':util[_0x4b19('0x66')](_0x4b19('0x67'),_0x24f135,'ticket_fields'),'json':!![]};switch(_0x21e852[_0x4b19('0x68')]){case _0x4b19('0x61'):_0x99e7ca[_0x4b19('0x69')]={'Authorization':util[_0x4b19('0x66')](_0x4b19('0x6a'),new Buffer(util['format'](_0x4b19('0x6b'),_0x21e852['username'],_0x21e852[_0x4b19('0x61')]))[_0x4b19('0x6c')](_0x4b19('0x6d')))};break;case'token':_0x99e7ca[_0x4b19('0x69')]={'Authorization':util[_0x4b19('0x66')](_0x4b19('0x6a'),new Buffer(util[_0x4b19('0x66')]('%s/token:%s',_0x21e852[_0x4b19('0x60')],_0x21e852[_0x4b19('0x6e')]))[_0x4b19('0x6c')](_0x4b19('0x6d')))};break;default:throw new db[(_0x4b19('0x6f'))][(_0x4b19('0x70'))](_0x4b19('0x71'));}return rp(_0x99e7ca);}})[_0x4b19('0x30')](function(_0xdd0077){if(_0xdd0077){var _0x8f5b5a=[_0x4b19('0x72'),_0x4b19('0x73'),'group','assignee'];_[_0x4b19('0x74')](_0xdd0077[_0x4b19('0x75')],function(_0x35494a){return _0x8f5b5a[_0x4b19('0x76')](_0x35494a[_0x4b19('0x3a')]);});return{'count':_0xdd0077[_0x4b19('0x75')]['length'],'rows':_[_0x4b19('0x36')](_0xdd0077[_0x4b19('0x75')],function(_0x3fae20){return{'id':_0x3fae20['id'],'name':_0x3fae20[_0x4b19('0x77')]>0x7?_0x3fae20[_0x4b19('0x78')]:_0x3fae20['type'],'custom':_0x3fae20[_0x4b19('0x77')]>0x7?!![]:![],'options':_0x3fae20[_0x4b19('0x79')]?_0x3fae20[_0x4b19('0x79')]:_0x3fae20[_0x4b19('0x7a')]?_0x3fae20[_0x4b19('0x7a')]:[]};})};}})[_0x4b19('0x30')](respondWithResult(_0x12c6d0,null))['catch'](function(_0xe5c335){var _0x270f67=_0x151d08['query']['test']?0x1f4:_0xe5c335[_0x4b19('0x7b')]||0x1f4;logger[_0x4b19('0x22')]('getFields,\x20%s,\x20%s,\x20%s',_0x4b19('0x5f'),_0x270f67,JSON[_0x4b19('0x21')](_0xe5c335));delete _0xe5c335[_0x4b19('0x34')];if(_0x270f67===0x191){_0x270f67=0x190;}_0x12c6d0['status'](_0x270f67)[_0x4b19('0x7c')](_0x151d08[_0x4b19('0x3c')][_0x4b19('0x19')]?{'message':_0x4b19('0x7d'),'statusCode':_0xe5c335[_0x4b19('0x7b')]}:_0xe5c335);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 82a843d..23b0e07 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 _0x0b04=['./intZendeskAccount.attributes','ZendeskAccount','int_zendesk_accounts','util','api','bluebird','path','../../config/environment'];(function(_0x4b5813,_0x5769de){var _0x423465=function(_0x18071f){while(--_0x18071f){_0x4b5813['push'](_0x4b5813['shift']());}};_0x423465(++_0x5769de);}(_0x0b04,0x183));var _0x40b0=function(_0x59d89e,_0x55edf5){_0x59d89e=_0x59d89e-0x0;var _0x554e93=_0x0b04[_0x59d89e];return _0x554e93;};'use strict';var _=require('lodash');var util=require(_0x40b0('0x0'));var logger=require('../../config/logger')(_0x40b0('0x1'));var moment=require('moment');var BPromise=require(_0x40b0('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x40b0('0x3'));var rimraf=require('rimraf');var config=require(_0x40b0('0x4'));var attributes=require(_0x40b0('0x5'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x16599d,_0x3305d1){return _0x16599d['define'](_0x40b0('0x6'),attributes,{'tableName':_0x40b0('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb700=['define','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x4975f8,_0x3a226c){var _0x86d59f=function(_0x17a8d4){while(--_0x17a8d4){_0x4975f8['push'](_0x4975f8['shift']());}};_0x86d59f(++_0x3a226c);}(_0xb700,0x85));var _0x0b70=function(_0x124f88,_0x3ad501){_0x124f88=_0x124f88-0x0;var _0xed0e3b=_0xb700[_0x124f88];return _0xed0e3b;};'use strict';var _=require(_0x0b70('0x0'));var util=require(_0x0b70('0x1'));var logger=require(_0x0b70('0x2'))(_0x0b70('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0b70('0x4'));var fs=require('fs');var path=require(_0x0b70('0x5'));var rimraf=require(_0x0b70('0x6'));var config=require(_0x0b70('0x7'));var attributes=require(_0x0b70('0x8'));var integrations=require(_0x0b70('0x9'));module[_0x0b70('0xa')]=function(_0x3c15f5,_0x2a01f8){return _0x3c15f5[_0x0b70('0xb')]('ZendeskAccount',attributes,{'tableName':'int_zendesk_accounts','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 566bf78..d4a8346 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 _0xbaf0=['ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetZendeskAccount','ZendeskAccount','findAll','options','where','attributes','limit','include','model','map','ShowZendeskAccount','find','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x334f9a,_0x542f01){var _0x2b219d=function(_0x25bb3e){while(--_0x25bb3e){_0x334f9a['push'](_0x334f9a['shift']());}};_0x2b219d(++_0x542f01);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xbaf0[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var moment=require(_0x0baf('0x1'));var BPromise=require(_0x0baf('0x2'));var rs=require(_0x0baf('0x3'));var fs=require('fs');var Redis=require(_0x0baf('0x4'));var db=require(_0x0baf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0baf('0x6'))(_0x0baf('0x7'));var config=require(_0x0baf('0x8'));var jayson=require(_0x0baf('0x9'));var client=jayson[_0x0baf('0xa')][_0x0baf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a10b1,_0x2dcaac,_0x1d0a0d){return new BPromise(function(_0x5f5030,_0x11b947){return client['request'](_0x1a10b1,_0x1d0a0d)[_0x0baf('0xc')](function(_0x2c7442){logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,_0x0baf('0xf'));logger[_0x0baf('0x10')](_0x0baf('0x11'),_0x2dcaac,_0x0baf('0xf'),JSON[_0x0baf('0x12')](_0x2c7442));if(_0x2c7442[_0x0baf('0x13')]){if(_0x2c7442[_0x0baf('0x13')]['code']===0x1f4){logger['error'](_0x0baf('0xe'),_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x11b947(_0x2c7442[_0x0baf('0x13')]['message']);}logger[_0x0baf('0x13')]('ZendeskAccount,\x20%s,\x20%s',_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x5f5030(_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);}else{logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,'request\x20sent');_0x5f5030(_0x2c7442['result'][_0x0baf('0x14')]);}})[_0x0baf('0x15')](function(_0x283408){logger[_0x0baf('0x13')](_0x0baf('0xe'),_0x2dcaac,_0x283408);_0x11b947(_0x283408);});});}exports[_0x0baf('0x16')]=function(_0x53c338){var _0x63c820=this;return new Promise(function(_0xfbecec,_0x1ef0e5){return db[_0x0baf('0x17')][_0x0baf('0x18')]({'raw':_0x53c338[_0x0baf('0x19')]?_0x53c338['options']['raw']===undefined?!![]:![]:!![],'where':_0x53c338[_0x0baf('0x19')]?_0x53c338[_0x0baf('0x19')][_0x0baf('0x1a')]||null:null,'attributes':_0x53c338[_0x0baf('0x19')]?_0x53c338[_0x0baf('0x19')][_0x0baf('0x1b')]||null:null,'limit':_0x53c338[_0x0baf('0x19')]?_0x53c338[_0x0baf('0x19')][_0x0baf('0x1c')]||null:null,'include':_0x53c338[_0x0baf('0x19')]?_0x53c338['options'][_0x0baf('0x1d')]?_['map'](_0x53c338[_0x0baf('0x19')]['include'],function(_0x4de74c){return{'model':db[_0x4de74c[_0x0baf('0x1e')]],'as':_0x4de74c['as'],'attributes':_0x4de74c['attributes'],'include':_0x4de74c['include']?_[_0x0baf('0x1f')](_0x4de74c[_0x0baf('0x1d')],function(_0x34e264){return{'model':db[_0x34e264[_0x0baf('0x1e')]],'as':_0x34e264['as'],'attributes':_0x34e264[_0x0baf('0x1b')],'include':_0x34e264['include']?_[_0x0baf('0x1f')](_0x34e264[_0x0baf('0x1d')],function(_0x1ca35a){return{'model':db[_0x1ca35a[_0x0baf('0x1e')]],'as':_0x1ca35a['as'],'attributes':_0x1ca35a[_0x0baf('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0baf('0xc')](function(_0x453525){logger['info'](_0x0baf('0x16'),_0x53c338);logger[_0x0baf('0x10')](_0x0baf('0x16'),_0x53c338,JSON[_0x0baf('0x12')](_0x453525));_0xfbecec(_0x453525);})['catch'](function(_0x29dbdf){logger[_0x0baf('0x13')]('GetZendeskAccount',_0x29dbdf[_0x0baf('0x14')],_0x53c338);_0x1ef0e5(_0x63c820[_0x0baf('0x13')](0x1f4,_0x29dbdf[_0x0baf('0x14')]));});});};exports[_0x0baf('0x20')]=function(_0xd14f0f){var _0x366924=this;return new Promise(function(_0x213a6a,_0x57476f){return db[_0x0baf('0x17')][_0x0baf('0x21')]({'raw':_0xd14f0f[_0x0baf('0x19')]?_0xd14f0f[_0x0baf('0x19')][_0x0baf('0x22')]===undefined?!![]:![]:!![],'where':_0xd14f0f[_0x0baf('0x19')]?_0xd14f0f[_0x0baf('0x19')][_0x0baf('0x1a')]||null:null,'attributes':_0xd14f0f[_0x0baf('0x19')]?_0xd14f0f[_0x0baf('0x19')][_0x0baf('0x1b')]||null:null,'include':_0xd14f0f[_0x0baf('0x19')]?_0xd14f0f[_0x0baf('0x19')][_0x0baf('0x1d')]?_['map'](_0xd14f0f[_0x0baf('0x19')]['include'],function(_0x1aa474){return{'model':db[_0x1aa474[_0x0baf('0x1e')]],'as':_0x1aa474['as'],'attributes':_0x1aa474[_0x0baf('0x1b')],'include':_0x1aa474[_0x0baf('0x1d')]?_['map'](_0x1aa474[_0x0baf('0x1d')],function(_0x1d6575){return{'model':db[_0x1d6575['model']],'as':_0x1d6575['as'],'attributes':_0x1d6575[_0x0baf('0x1b')],'include':_0x1d6575[_0x0baf('0x1d')]?_[_0x0baf('0x1f')](_0x1d6575[_0x0baf('0x1d')],function(_0x1f60bd){return{'model':db[_0x1f60bd[_0x0baf('0x1e')]],'as':_0x1f60bd['as'],'attributes':_0x1f60bd[_0x0baf('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0baf('0xc')](function(_0x4aa6ed){logger[_0x0baf('0xd')](_0x0baf('0x20'),_0xd14f0f);logger['debug'](_0x0baf('0x20'),_0xd14f0f,JSON['stringify'](_0x4aa6ed));_0x213a6a(_0x4aa6ed);})['catch'](function(_0x11bc49){logger[_0x0baf('0x13')]('ShowZendeskAccount',_0x11bc49['message'],_0xd14f0f);_0x57476f(_0x366924[_0x0baf('0x13')](0x1f4,_0x11bc49[_0x0baf('0x14')]));});});}; \ No newline at end of file +var _0xb7e7=['request','then','info','ZendeskAccount,\x20%s,\x20%s','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','attributes','limit','include','map','model','ShowZendeskAccount','find','where','lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http'];(function(_0x1364dd,_0x55eb85){var _0x1d5165=function(_0x42d919){while(--_0x42d919){_0x1364dd['push'](_0x1364dd['shift']());}};_0x1d5165(++_0x55eb85);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0xb7e7[_0x1f9f37];return _0x21c080;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var moment=require(_0x7b7e('0x1'));var BPromise=require('bluebird');var rs=require(_0x7b7e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7b7e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7b7e('0x4'))(_0x7b7e('0x5'));var config=require(_0x7b7e('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7b7e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x372bde,_0x7f87e0,_0x55ce81){return new BPromise(function(_0x42b871,_0x223587){return client[_0x7b7e('0x8')](_0x372bde,_0x55ce81)[_0x7b7e('0x9')](function(_0x148964){logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');logger[_0x7b7e('0xc')](_0x7b7e('0xd'),_0x7f87e0,_0x7b7e('0xe'),JSON[_0x7b7e('0xf')](_0x148964));if(_0x148964[_0x7b7e('0x10')]){if(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x11')]===0x1f4){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x223587(_0x148964[_0x7b7e('0x10')]['message']);}logger[_0x7b7e('0x10')]('ZendeskAccount,\x20%s,\x20%s',_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x42b871(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x12')]);}else{logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');_0x42b871(_0x148964['result'][_0x7b7e('0x12')]);}})[_0x7b7e('0x13')](function(_0x27f999){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x27f999);_0x223587(_0x27f999);});});}exports[_0x7b7e('0x14')]=function(_0x242368){var _0x200ef7=this;return new Promise(function(_0x2acb8c,_0x429a0e){return db[_0x7b7e('0x15')][_0x7b7e('0x16')]({'raw':_0x242368[_0x7b7e('0x17')]?_0x242368[_0x7b7e('0x17')][_0x7b7e('0x18')]===undefined?!![]:![]:!![],'where':_0x242368[_0x7b7e('0x17')]?_0x242368[_0x7b7e('0x17')]['where']||null:null,'attributes':_0x242368[_0x7b7e('0x17')]?_0x242368[_0x7b7e('0x17')][_0x7b7e('0x19')]||null:null,'limit':_0x242368['options']?_0x242368[_0x7b7e('0x17')][_0x7b7e('0x1a')]||null:null,'include':_0x242368[_0x7b7e('0x17')]?_0x242368[_0x7b7e('0x17')][_0x7b7e('0x1b')]?_[_0x7b7e('0x1c')](_0x242368[_0x7b7e('0x17')][_0x7b7e('0x1b')],function(_0x53bbb3){return{'model':db[_0x53bbb3['model']],'as':_0x53bbb3['as'],'attributes':_0x53bbb3['attributes'],'include':_0x53bbb3[_0x7b7e('0x1b')]?_[_0x7b7e('0x1c')](_0x53bbb3[_0x7b7e('0x1b')],function(_0x483c6f){return{'model':db[_0x483c6f['model']],'as':_0x483c6f['as'],'attributes':_0x483c6f['attributes'],'include':_0x483c6f[_0x7b7e('0x1b')]?_[_0x7b7e('0x1c')](_0x483c6f[_0x7b7e('0x1b')],function(_0x7aa71){return{'model':db[_0x7aa71[_0x7b7e('0x1d')]],'as':_0x7aa71['as'],'attributes':_0x7aa71['attributes']};}):[]};}):[]};}):[]:[]})[_0x7b7e('0x9')](function(_0x21a15){logger['info']('GetZendeskAccount',_0x242368);logger['debug'](_0x7b7e('0x14'),_0x242368,JSON[_0x7b7e('0xf')](_0x21a15));_0x2acb8c(_0x21a15);})['catch'](function(_0x3db8c4){logger['error'](_0x7b7e('0x14'),_0x3db8c4[_0x7b7e('0x12')],_0x242368);_0x429a0e(_0x200ef7[_0x7b7e('0x10')](0x1f4,_0x3db8c4['message']));});});};exports[_0x7b7e('0x1e')]=function(_0xe31336){var _0x35602a=this;return new Promise(function(_0x326dd2,_0x33f9a1){return db['ZendeskAccount'][_0x7b7e('0x1f')]({'raw':_0xe31336['options']?_0xe31336[_0x7b7e('0x17')][_0x7b7e('0x18')]===undefined?!![]:![]:!![],'where':_0xe31336[_0x7b7e('0x17')]?_0xe31336[_0x7b7e('0x17')][_0x7b7e('0x20')]||null:null,'attributes':_0xe31336[_0x7b7e('0x17')]?_0xe31336[_0x7b7e('0x17')]['attributes']||null:null,'include':_0xe31336['options']?_0xe31336[_0x7b7e('0x17')][_0x7b7e('0x1b')]?_['map'](_0xe31336[_0x7b7e('0x17')][_0x7b7e('0x1b')],function(_0x2ca366){return{'model':db[_0x2ca366['model']],'as':_0x2ca366['as'],'attributes':_0x2ca366[_0x7b7e('0x19')],'include':_0x2ca366[_0x7b7e('0x1b')]?_[_0x7b7e('0x1c')](_0x2ca366[_0x7b7e('0x1b')],function(_0x31043a){return{'model':db[_0x31043a[_0x7b7e('0x1d')]],'as':_0x31043a['as'],'attributes':_0x31043a[_0x7b7e('0x19')],'include':_0x31043a[_0x7b7e('0x1b')]?_[_0x7b7e('0x1c')](_0x31043a[_0x7b7e('0x1b')],function(_0xd5a64d){return{'model':db[_0xd5a64d[_0x7b7e('0x1d')]],'as':_0xd5a64d['as'],'attributes':_0xd5a64d[_0x7b7e('0x19')]};}):[]};}):[]};}):[]:[]})[_0x7b7e('0x9')](function(_0x116563){logger[_0x7b7e('0xa')]('ShowZendeskAccount',_0xe31336);logger[_0x7b7e('0xc')](_0x7b7e('0x1e'),_0xe31336,JSON[_0x7b7e('0xf')](_0x116563));_0x326dd2(_0x116563);})[_0x7b7e('0x13')](function(_0x36abfc){logger[_0x7b7e('0x10')](_0x7b7e('0x1e'),_0x36abfc[_0x7b7e('0x12')],_0xe31336);_0x33f9a1(_0x35602a[_0x7b7e('0x10')](0x1f4,_0x36abfc[_0x7b7e('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 4d05d2f..c3bff35 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 _0x3f32=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','getTags','post','create','/:id/tags','setTags','update','delete','exports','multer','util','path','connect-timeout','Router'];(function(_0x128bef,_0xc7a0af){var _0x1ba862=function(_0x4858e8){while(--_0x4858e8){_0x128bef['push'](_0x128bef['shift']());}};_0x1ba862(++_0xc7a0af);}(_0x3f32,0x18b));var _0x23f3=function(_0x1e2072,_0x145d84){_0x1e2072=_0x1e2072-0x0;var _0x1a72ce=_0x3f32[_0x1e2072];return _0x1a72ce;};'use strict';var multer=require(_0x23f3('0x0'));var util=require(_0x23f3('0x1'));var path=require(_0x23f3('0x2'));var timeout=require(_0x23f3('0x3'));var express=require('express');var router=express[_0x23f3('0x4')]();var auth=require(_0x23f3('0x5'));var interaction=require(_0x23f3('0x6'));var config=require(_0x23f3('0x7'));var controller=require('./intZendeskConfiguration.controller');router[_0x23f3('0x8')]('/',auth[_0x23f3('0x9')](),controller['index']);router[_0x23f3('0x8')](_0x23f3('0xa'),auth[_0x23f3('0x9')](),controller[_0x23f3('0xb')]);router[_0x23f3('0x8')](_0x23f3('0xc'),auth[_0x23f3('0x9')](),controller[_0x23f3('0xd')]);router[_0x23f3('0x8')](_0x23f3('0xe'),auth[_0x23f3('0x9')](),controller['getSubjects']);router[_0x23f3('0x8')](_0x23f3('0xf'),auth[_0x23f3('0x9')](),controller[_0x23f3('0x10')]);router[_0x23f3('0x8')]('/:id/tags',auth['isAuthenticated'](),controller[_0x23f3('0x11')]);router[_0x23f3('0x12')]('/',auth[_0x23f3('0x9')](),controller[_0x23f3('0x13')]);router[_0x23f3('0x12')](_0x23f3('0x14'),auth[_0x23f3('0x9')](),controller[_0x23f3('0x15')]);router['put'](_0x23f3('0xa'),auth['isAuthenticated'](),controller[_0x23f3('0x16')]);router[_0x23f3('0x17')](_0x23f3('0xa'),auth[_0x23f3('0x9')](),controller['destroy']);module[_0x23f3('0x18')]=router; \ No newline at end of file +var _0x46c2=['get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','getTags','post','create','setTags','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','./intZendeskConfiguration.controller'];(function(_0x12c818,_0x9ed027){var _0x24bf34=function(_0x3ec807){while(--_0x3ec807){_0x12c818['push'](_0x12c818['shift']());}};_0x24bf34(++_0x9ed027);}(_0x46c2,0x162));var _0x246c=function(_0x29faef,_0x4b6499){_0x29faef=_0x29faef-0x0;var _0x292304=_0x46c2[_0x29faef];return _0x292304;};'use strict';var multer=require(_0x246c('0x0'));var util=require(_0x246c('0x1'));var path=require('path');var timeout=require(_0x246c('0x2'));var express=require(_0x246c('0x3'));var router=express[_0x246c('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x246c('0x5'));router[_0x246c('0x6')]('/',auth[_0x246c('0x7')](),controller['index']);router[_0x246c('0x6')](_0x246c('0x8'),auth[_0x246c('0x7')](),controller[_0x246c('0x9')]);router[_0x246c('0x6')](_0x246c('0xa'),auth[_0x246c('0x7')](),controller[_0x246c('0xb')]);router[_0x246c('0x6')](_0x246c('0xc'),auth[_0x246c('0x7')](),controller[_0x246c('0xd')]);router[_0x246c('0x6')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x246c('0xe')]);router['get']('/:id/tags',auth[_0x246c('0x7')](),controller[_0x246c('0xf')]);router[_0x246c('0x10')]('/',auth[_0x246c('0x7')](),controller[_0x246c('0x11')]);router[_0x246c('0x10')]('/:id/tags',auth[_0x246c('0x7')](),controller[_0x246c('0x12')]);router[_0x246c('0x13')](_0x246c('0x8'),auth['isAuthenticated'](),controller[_0x246c('0x14')]);router[_0x246c('0x15')](_0x246c('0x8'),auth[_0x246c('0x7')](),controller[_0x246c('0x16')]);module[_0x246c('0x17')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 2b79ce5..c64335c 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 _0x6809=['STRING','sequelize'];(function(_0x1fdde4,_0x525a8a){var _0x53bc2e=function(_0x327c96){while(--_0x327c96){_0x1fdde4['push'](_0x1fdde4['shift']());}};_0x53bc2e(++_0x525a8a);}(_0x6809,0x9d));var _0x9680=function(_0x3b8f2e,_0x5a99a8){_0x3b8f2e=_0x3b8f2e-0x0;var _0x1433d5=_0x6809[_0x3b8f2e];return _0x1433d5;};'use strict';var Sequelize=require(_0x9680('0x0'));module['exports']={'name':{'type':Sequelize[_0x9680('0x1')]},'description':{'type':Sequelize[_0x9680('0x1')]}}; \ No newline at end of file +var _0x9619=['exports','STRING','sequelize'];(function(_0x444a01,_0xed08bb){var _0x3b2a40=function(_0x5a9e45){while(--_0x5a9e45){_0x444a01['push'](_0x444a01['shift']());}};_0x3b2a40(++_0xed08bb);}(_0x9619,0x1f4));var _0x9961=function(_0x384068,_0x2e7c2d){_0x384068=_0x384068-0x0;var _0x47e63b=_0x9619[_0x384068];return _0x47e63b;};'use strict';var Sequelize=require(_0x9961('0x0'));module[_0x9961('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9961('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index cc3ae6f..8b1b29b 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 _0x57ca=['../../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','info','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ZendeskConfiguration,\x20%s,\x20%s','message','result','catch','status','end','json','count','offset','limit','set','save','update','destroy','stack','name','index','map','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','key','VIRTUAL','field','options','includeAll','ZendeskConfiguration','findAll','rows','params','rawAttributes','keys','include','find','create','body','getFields','findOne','ZendeskField','order','pick','getSubjects','getDescriptions','Tag','getTags','setTags','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs'];(function(_0x3f6ba7,_0x44b8bc){var _0x53fb11=function(_0x232d2b){while(--_0x232d2b){_0x3f6ba7['push'](_0x3f6ba7['shift']());}};_0x53fb11(++_0x44b8bc);}(_0x57ca,0x108));var _0xa57c=function(_0x253b37,_0xdb7ae0){_0x253b37=_0x253b37-0x0;var _0x24b147=_0x57ca[_0x253b37];return _0x24b147;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa57c('0x0'));var rimraf=require(_0xa57c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa57c('0x2'));var rp=require(_0xa57c('0x3'));var moment=require(_0xa57c('0x4'));var BPromise=require(_0xa57c('0x5'));var Mustache=require(_0xa57c('0x6'));var util=require('util');var path=require(_0xa57c('0x7'));var sox=require(_0xa57c('0x8'));var csv=require(_0xa57c('0x9'));var ejs=require(_0xa57c('0xa'));var fs=require('fs');var _=require(_0xa57c('0xb'));var squel=require(_0xa57c('0xc'));var crypto=require(_0xa57c('0xd'));var jsforce=require(_0xa57c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa57c('0x9'));var querystring=require('querystring');var Papa=require(_0xa57c('0xf'));var Redis=require(_0xa57c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa57c('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa57c('0x12'));var logger=require(_0xa57c('0x13'))('api');var utils=require(_0xa57c('0x14'));var config=require('../../config/environment');var db=require(_0xa57c('0x15'))['db'];var jayson=require(_0xa57c('0x16'));var client=jayson[_0xa57c('0x17')][_0xa57c('0x18')]({'port':0x232a});function checkPasswordPattern(_0x205e72,_0x57a546,_0x2644a1){if(_0x2644a1){var _0x546cde=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x546cde[_0xa57c('0x19')](_0x57a546)){return _0x205e72;}else{throw new Error(_0xa57c('0x1a'));}}else{return _0x205e72;}}function respondWithRpcPromise(_0x30940d,_0x3821d2,_0x3238ff,_0x37a323){return new BPromise(function(_0x3f900a,_0x4b4bdb){var _0x26607a=_0x37a323||client;return _0x26607a[_0xa57c('0x1b')](_0x30940d,_0x3238ff)[_0xa57c('0x1c')](function(_0x5a6024){logger[_0xa57c('0x1d')]('ZendeskConfiguration,\x20%s,\x20%s',_0x3821d2,_0xa57c('0x1e'));logger[_0xa57c('0x1f')](_0xa57c('0x20'),_0x3821d2,_0xa57c('0x1e'),JSON[_0xa57c('0x21')](_0x5a6024));if(_0x5a6024[_0xa57c('0x22')]){if(_0x5a6024[_0xa57c('0x22')][_0xa57c('0x23')]===0x1f4){logger['error'](_0xa57c('0x24'),_0x3821d2,_0x5a6024['error']['message']);return _0x4b4bdb(_0x5a6024[_0xa57c('0x22')][_0xa57c('0x25')]);}logger[_0xa57c('0x22')](_0xa57c('0x24'),_0x3821d2,_0x5a6024['error'][_0xa57c('0x25')]);return _0x3f900a(_0x5a6024[_0xa57c('0x22')][_0xa57c('0x25')]);}else{logger[_0xa57c('0x1d')](_0xa57c('0x24'),_0x3821d2,_0xa57c('0x1e'));_0x3f900a(_0x5a6024[_0xa57c('0x26')][_0xa57c('0x25')]);}})[_0xa57c('0x27')](function(_0xdf65dd){logger[_0xa57c('0x22')](_0xa57c('0x24'),_0x3821d2,_0xdf65dd);_0x4b4bdb(_0xdf65dd);});});}function respondWithStatusCode(_0x241dcc,_0x10a33d){_0x10a33d=_0x10a33d||0xcc;return function(_0x431bec){if(_0x431bec){return _0x241dcc['sendStatus'](_0x10a33d);}return _0x241dcc[_0xa57c('0x28')](_0x10a33d)[_0xa57c('0x29')]();};}function respondWithResult(_0x27884d,_0x5228b9){_0x5228b9=_0x5228b9||0xc8;return function(_0x315ad7){if(_0x315ad7){return _0x27884d[_0xa57c('0x28')](_0x5228b9)[_0xa57c('0x2a')](_0x315ad7);}};}function respondWithFilteredResult(_0xe50fb8,_0x337f97){return function(_0x1d59c2){if(_0x1d59c2){var _0x57ebe0=_0x1d59c2[_0xa57c('0x2b')],_0x3b7364=_0x337f97[_0xa57c('0x2c')],_0x4c1478=_0x337f97['offset']+_0x337f97[_0xa57c('0x2d')],_0x54a18b;if(_0x4c1478>=_0x57ebe0){_0x4c1478=_0x57ebe0;_0x54a18b=0xc8;}else{_0x54a18b=0xce;}_0xe50fb8[_0xa57c('0x28')](_0x54a18b);return _0xe50fb8[_0xa57c('0x2e')]('Content-Range',_0x3b7364+'-'+_0x4c1478+'/'+_0x57ebe0)[_0xa57c('0x2a')](_0x1d59c2);}return null;};}function patchUpdates(_0x58d46f){return function(_0xf5f70c){try{jsonpatch['apply'](_0xf5f70c,_0x58d46f,!![]);}catch(_0x2a3bbe){return BPromise['reject'](_0x2a3bbe);}return _0xf5f70c[_0xa57c('0x2f')]();};}function saveUpdates(_0x532164,_0x9e02bb){return function(_0x1d82d9){if(_0x1d82d9){return _0x1d82d9[_0xa57c('0x30')](_0x532164)[_0xa57c('0x1c')](function(_0xfd0f66){return _0xfd0f66;});}return null;};}function removeEntity(_0x4016dd,_0x4f45c7){return function(_0x5aa91e){if(_0x5aa91e){return _0x5aa91e[_0xa57c('0x31')]()['then'](function(){_0x4016dd[_0xa57c('0x28')](0xcc)[_0xa57c('0x29')]();});}};}function handleEntityNotFound(_0x27ada0,_0x587ce1){return function(_0x289174){if(!_0x289174){_0x27ada0['sendStatus'](0x194);}return _0x289174;};}function handleError(_0x24a087,_0x501a4c){_0x501a4c=_0x501a4c||0x1f4;return function(_0x2e33f5){logger['error'](_0x2e33f5[_0xa57c('0x32')]);if(_0x2e33f5[_0xa57c('0x33')]){delete _0x2e33f5['name'];}_0x24a087[_0xa57c('0x28')](_0x501a4c)['send'](_0x2e33f5);};}exports[_0xa57c('0x34')]=function(_0x5c56d3,_0x189d9b){var _0x3776de={},_0x205ee5={},_0x62f697={'count':0x0,'rows':[]};var _0x2c224c=_[_0xa57c('0x35')](db['ZendeskConfiguration']['rawAttributes'],function(_0x3f6d86){return{'name':_0x3f6d86[_0xa57c('0x36')],'type':_0x3f6d86[_0xa57c('0x37')]['key']};});_0x205ee5[_0xa57c('0x38')]=_['map'](_0x2c224c,_0xa57c('0x33'));_0x205ee5[_0xa57c('0x39')]=_['keys'](_0x5c56d3['query']);_0x205ee5['filters']=_[_0xa57c('0x3a')](_0x205ee5[_0xa57c('0x38')],_0x205ee5[_0xa57c('0x39')]);_0x3776de[_0xa57c('0x3b')]=_[_0xa57c('0x3a')](_0x205ee5[_0xa57c('0x38')],qs['fields'](_0x5c56d3[_0xa57c('0x39')][_0xa57c('0x3c')]));_0x3776de['attributes']=_0x3776de['attributes'][_0xa57c('0x3d')]?_0x3776de[_0xa57c('0x3b')]:_0x205ee5['model'];if(!_0x5c56d3[_0xa57c('0x39')][_0xa57c('0x3e')](_0xa57c('0x3f'))){_0x3776de[_0xa57c('0x2d')]=qs[_0xa57c('0x2d')](_0x5c56d3[_0xa57c('0x39')]['limit']);_0x3776de[_0xa57c('0x2c')]=qs['offset'](_0x5c56d3['query']['offset']);}_0x3776de['order']=qs['sort'](_0x5c56d3[_0xa57c('0x39')][_0xa57c('0x40')]);_0x3776de[_0xa57c('0x41')]=qs['filters'](_['pick'](_0x5c56d3['query'],_0x205ee5[_0xa57c('0x42')]));if(_0x5c56d3[_0xa57c('0x39')][_0xa57c('0x43')]){_0x3776de[_0xa57c('0x41')]=_[_0xa57c('0x44')](_0x3776de[_0xa57c('0x41')],{'$or':_['map'](_0x2c224c,function(_0xaf0402){if(_0xaf0402[_0xa57c('0x37')][_0xa57c('0x45')]!==_0xa57c('0x46')){var _0x2fa6a7={};_0x2fa6a7[_0xaf0402[_0xa57c('0x47')]]={'$like':'%'+_0x5c56d3['query'][_0xa57c('0x43')]+'%'};return _0x2fa6a7;}})});}_0x3776de=_[_0xa57c('0x44')]({},_0x3776de,_0x5c56d3[_0xa57c('0x48')]);var _0x14e943={'where':_0x3776de[_0xa57c('0x41')]};return db['ZendeskConfiguration'][_0xa57c('0x2b')](_0x14e943)[_0xa57c('0x1c')](function(_0xa18f64){_0x62f697[_0xa57c('0x2b')]=_0xa18f64;if(_0x5c56d3[_0xa57c('0x39')][_0xa57c('0x49')]){_0x3776de['include']=[{'all':!![]}];}return db[_0xa57c('0x4a')][_0xa57c('0x4b')](_0x3776de);})[_0xa57c('0x1c')](function(_0x44ea0a){_0x62f697[_0xa57c('0x4c')]=_0x44ea0a;return _0x62f697;})[_0xa57c('0x1c')](respondWithFilteredResult(_0x189d9b,_0x3776de))['catch'](handleError(_0x189d9b,null));};exports['show']=function(_0x578436,_0x5082ef){var _0x232675={'raw':![],'where':{'id':_0x578436[_0xa57c('0x4d')]['id']}},_0x49492f={};_0x49492f[_0xa57c('0x38')]=_['keys'](db[_0xa57c('0x4a')][_0xa57c('0x4e')]);_0x49492f[_0xa57c('0x39')]=_[_0xa57c('0x4f')](_0x578436[_0xa57c('0x39')]);_0x49492f['filters']=_[_0xa57c('0x3a')](_0x49492f[_0xa57c('0x38')],_0x49492f[_0xa57c('0x39')]);_0x232675[_0xa57c('0x3b')]=_[_0xa57c('0x3a')](_0x49492f['model'],qs[_0xa57c('0x3c')](_0x578436['query']['fields']));_0x232675[_0xa57c('0x3b')]=_0x232675[_0xa57c('0x3b')][_0xa57c('0x3d')]?_0x232675['attributes']:_0x49492f['model'];if(_0x578436[_0xa57c('0x39')][_0xa57c('0x49')]){_0x232675[_0xa57c('0x50')]=[{'all':!![]}];}_0x232675=_[_0xa57c('0x44')]({},_0x232675,_0x578436['options']);return db[_0xa57c('0x4a')][_0xa57c('0x51')](_0x232675)[_0xa57c('0x1c')](handleEntityNotFound(_0x5082ef,null))['then'](respondWithResult(_0x5082ef,null))['catch'](handleError(_0x5082ef,null));};exports[_0xa57c('0x52')]=function(_0x25fc6b,_0x4d5d46){return db[_0xa57c('0x4a')][_0xa57c('0x52')](_0x25fc6b[_0xa57c('0x53')],{})[_0xa57c('0x1c')](respondWithResult(_0x4d5d46,0xc9))[_0xa57c('0x27')](handleError(_0x4d5d46,null));};exports[_0xa57c('0x30')]=function(_0x4fc413,_0x4ee02a){if(_0x4fc413['body']['id']){delete _0x4fc413[_0xa57c('0x53')]['id'];}return db[_0xa57c('0x4a')][_0xa57c('0x51')]({'where':{'id':_0x4fc413[_0xa57c('0x4d')]['id']}})[_0xa57c('0x1c')](handleEntityNotFound(_0x4ee02a,null))[_0xa57c('0x1c')](saveUpdates(_0x4fc413[_0xa57c('0x53')],null))[_0xa57c('0x1c')](respondWithResult(_0x4ee02a,null))['catch'](handleError(_0x4ee02a,null));};exports['destroy']=function(_0x28997e,_0x4e18ad){return db[_0xa57c('0x4a')][_0xa57c('0x51')]({'where':{'id':_0x28997e[_0xa57c('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4e18ad,null))[_0xa57c('0x1c')](removeEntity(_0x4e18ad,null))['catch'](handleError(_0x4e18ad,null));};exports[_0xa57c('0x54')]=function(_0x4b3416,_0x39484d,_0x170187){var _0x398743={};var _0x26a8e1={};var _0x4c192d;var _0x3abb69;return db[_0xa57c('0x4a')][_0xa57c('0x55')]({'where':{'id':_0x4b3416[_0xa57c('0x4d')]['id']}})[_0xa57c('0x1c')](handleEntityNotFound(_0x39484d,null))['then'](function(_0x13afd0){if(_0x13afd0){_0x4c192d=_0x13afd0;_0x26a8e1[_0xa57c('0x38')]=_[_0xa57c('0x4f')](db[_0xa57c('0x56')][_0xa57c('0x4e')]);_0x26a8e1[_0xa57c('0x39')]=_[_0xa57c('0x4f')](_0x4b3416[_0xa57c('0x39')]);_0x26a8e1[_0xa57c('0x42')]=_[_0xa57c('0x3a')](_0x26a8e1['model'],_0x26a8e1[_0xa57c('0x39')]);_0x398743[_0xa57c('0x3b')]=_[_0xa57c('0x3a')](_0x26a8e1[_0xa57c('0x38')],qs[_0xa57c('0x3c')](_0x4b3416[_0xa57c('0x39')]['fields']));_0x398743[_0xa57c('0x3b')]=_0x398743[_0xa57c('0x3b')]['length']?_0x398743[_0xa57c('0x3b')]:_0x26a8e1[_0xa57c('0x38')];_0x398743[_0xa57c('0x57')]=qs[_0xa57c('0x40')](_0x4b3416[_0xa57c('0x39')][_0xa57c('0x40')]);_0x398743[_0xa57c('0x41')]=qs['filters'](_[_0xa57c('0x58')](_0x4b3416['query'],_0x26a8e1[_0xa57c('0x42')]));if(_0x4b3416['query'][_0xa57c('0x43')]){_0x398743['where']=_[_0xa57c('0x44')](_0x398743[_0xa57c('0x41')],{'$or':_['map'](_0x398743[_0xa57c('0x3b')],function(_0x23302d){var _0x2dbd17={};_0x2dbd17[_0x23302d]={'$like':'%'+_0x4b3416[_0xa57c('0x39')]['filter']+'%'};return _0x2dbd17;})});}_0x398743=_[_0xa57c('0x44')]({},_0x398743,_0x4b3416[_0xa57c('0x48')]);return _0x4c192d[_0xa57c('0x54')](_0x398743);}})[_0xa57c('0x1c')](function(_0x3fdaac){if(_0x3fdaac){_0x3abb69=_0x3fdaac[_0xa57c('0x3d')];if(!_0x4b3416[_0xa57c('0x39')][_0xa57c('0x3e')](_0xa57c('0x3f'))){_0x398743[_0xa57c('0x2d')]=qs[_0xa57c('0x2d')](_0x4b3416[_0xa57c('0x39')][_0xa57c('0x2d')]);_0x398743[_0xa57c('0x2c')]=qs[_0xa57c('0x2c')](_0x4b3416[_0xa57c('0x39')]['offset']);}return _0x4c192d[_0xa57c('0x54')](_0x398743);}})['then'](function(_0xd6762d){if(_0xd6762d){return _0xd6762d?{'count':_0x3abb69,'rows':_0xd6762d}:null;}})[_0xa57c('0x1c')](respondWithResult(_0x39484d,null))[_0xa57c('0x27')](handleError(_0x39484d,null));};exports['getSubjects']=function(_0x4176b3,_0x2ccc4d,_0x1be631){var _0x47e3d5={};var _0x571e10={};var _0x20ff5f;var _0x39aa65;return db[_0xa57c('0x4a')][_0xa57c('0x55')]({'where':{'id':_0x4176b3[_0xa57c('0x4d')]['id']}})[_0xa57c('0x1c')](handleEntityNotFound(_0x2ccc4d,null))[_0xa57c('0x1c')](function(_0x33f20e){if(_0x33f20e){_0x20ff5f=_0x33f20e;_0x571e10[_0xa57c('0x38')]=_['keys'](db[_0xa57c('0x56')][_0xa57c('0x4e')]);_0x571e10['query']=_[_0xa57c('0x4f')](_0x4176b3[_0xa57c('0x39')]);_0x571e10[_0xa57c('0x42')]=_[_0xa57c('0x3a')](_0x571e10[_0xa57c('0x38')],_0x571e10[_0xa57c('0x39')]);_0x47e3d5[_0xa57c('0x3b')]=_[_0xa57c('0x3a')](_0x571e10['model'],qs[_0xa57c('0x3c')](_0x4176b3[_0xa57c('0x39')]['fields']));_0x47e3d5[_0xa57c('0x3b')]=_0x47e3d5[_0xa57c('0x3b')]['length']?_0x47e3d5['attributes']:_0x571e10[_0xa57c('0x38')];_0x47e3d5[_0xa57c('0x57')]=qs[_0xa57c('0x40')](_0x4176b3[_0xa57c('0x39')][_0xa57c('0x40')]);_0x47e3d5['where']=qs[_0xa57c('0x42')](_[_0xa57c('0x58')](_0x4176b3[_0xa57c('0x39')],_0x571e10['filters']));if(_0x4176b3[_0xa57c('0x39')]['filter']){_0x47e3d5[_0xa57c('0x41')]=_[_0xa57c('0x44')](_0x47e3d5[_0xa57c('0x41')],{'$or':_[_0xa57c('0x35')](_0x47e3d5['attributes'],function(_0x3740e9){var _0xc0a581={};_0xc0a581[_0x3740e9]={'$like':'%'+_0x4176b3[_0xa57c('0x39')][_0xa57c('0x43')]+'%'};return _0xc0a581;})});}_0x47e3d5=_['merge']({},_0x47e3d5,_0x4176b3[_0xa57c('0x48')]);return _0x20ff5f[_0xa57c('0x59')](_0x47e3d5);}})[_0xa57c('0x1c')](function(_0x49e030){if(_0x49e030){_0x39aa65=_0x49e030[_0xa57c('0x3d')];if(!_0x4176b3[_0xa57c('0x39')][_0xa57c('0x3e')]('nolimit')){_0x47e3d5[_0xa57c('0x2d')]=qs[_0xa57c('0x2d')](_0x4176b3[_0xa57c('0x39')][_0xa57c('0x2d')]);_0x47e3d5['offset']=qs[_0xa57c('0x2c')](_0x4176b3[_0xa57c('0x39')]['offset']);}return _0x20ff5f[_0xa57c('0x59')](_0x47e3d5);}})[_0xa57c('0x1c')](function(_0x59d2a2){if(_0x59d2a2){return _0x59d2a2?{'count':_0x39aa65,'rows':_0x59d2a2}:null;}})[_0xa57c('0x1c')](respondWithResult(_0x2ccc4d,null))['catch'](handleError(_0x2ccc4d,null));};exports[_0xa57c('0x5a')]=function(_0xceaee4,_0x22dc2b,_0x37c00d){var _0x599408={};var _0x40a8db={};var _0x2288c2;var _0x224a5d;return db[_0xa57c('0x4a')][_0xa57c('0x55')]({'where':{'id':_0xceaee4[_0xa57c('0x4d')]['id']}})[_0xa57c('0x1c')](handleEntityNotFound(_0x22dc2b,null))[_0xa57c('0x1c')](function(_0x1129f){if(_0x1129f){_0x2288c2=_0x1129f;_0x40a8db[_0xa57c('0x38')]=_[_0xa57c('0x4f')](db['ZendeskField']['rawAttributes']);_0x40a8db['query']=_[_0xa57c('0x4f')](_0xceaee4['query']);_0x40a8db[_0xa57c('0x42')]=_[_0xa57c('0x3a')](_0x40a8db[_0xa57c('0x38')],_0x40a8db['query']);_0x599408[_0xa57c('0x3b')]=_[_0xa57c('0x3a')](_0x40a8db[_0xa57c('0x38')],qs[_0xa57c('0x3c')](_0xceaee4[_0xa57c('0x39')][_0xa57c('0x3c')]));_0x599408[_0xa57c('0x3b')]=_0x599408['attributes'][_0xa57c('0x3d')]?_0x599408[_0xa57c('0x3b')]:_0x40a8db['model'];_0x599408['order']=qs[_0xa57c('0x40')](_0xceaee4[_0xa57c('0x39')]['sort']);_0x599408['where']=qs[_0xa57c('0x42')](_['pick'](_0xceaee4[_0xa57c('0x39')],_0x40a8db[_0xa57c('0x42')]));if(_0xceaee4['query'][_0xa57c('0x43')]){_0x599408[_0xa57c('0x41')]=_[_0xa57c('0x44')](_0x599408[_0xa57c('0x41')],{'$or':_[_0xa57c('0x35')](_0x599408['attributes'],function(_0x17fc78){var _0x4f7260={};_0x4f7260[_0x17fc78]={'$like':'%'+_0xceaee4[_0xa57c('0x39')][_0xa57c('0x43')]+'%'};return _0x4f7260;})});}_0x599408=_['merge']({},_0x599408,_0xceaee4['options']);return _0x2288c2['getDescriptions'](_0x599408);}})[_0xa57c('0x1c')](function(_0x500014){if(_0x500014){_0x224a5d=_0x500014['length'];if(!_0xceaee4[_0xa57c('0x39')][_0xa57c('0x3e')](_0xa57c('0x3f'))){_0x599408['limit']=qs[_0xa57c('0x2d')](_0xceaee4[_0xa57c('0x39')][_0xa57c('0x2d')]);_0x599408['offset']=qs['offset'](_0xceaee4[_0xa57c('0x39')]['offset']);}return _0x2288c2[_0xa57c('0x5a')](_0x599408);}})[_0xa57c('0x1c')](function(_0x490ea1){if(_0x490ea1){return _0x490ea1?{'count':_0x224a5d,'rows':_0x490ea1}:null;}})[_0xa57c('0x1c')](respondWithResult(_0x22dc2b,null))['catch'](handleError(_0x22dc2b,null));};exports['getTags']=function(_0x5db013,_0x6825df,_0x4985bb){var _0x5143c0={};var _0x542194={};var _0x3e12e5;var _0x23c39b;return db['ZendeskConfiguration'][_0xa57c('0x55')]({'where':{'id':_0x5db013[_0xa57c('0x4d')]['id']}})[_0xa57c('0x1c')](handleEntityNotFound(_0x6825df,null))['then'](function(_0x31be8e){if(_0x31be8e){_0x3e12e5=_0x31be8e;_0x542194[_0xa57c('0x38')]=_[_0xa57c('0x4f')](db[_0xa57c('0x5b')]['rawAttributes']);_0x542194['query']=_[_0xa57c('0x4f')](_0x5db013['query']);_0x542194[_0xa57c('0x42')]=_[_0xa57c('0x3a')](_0x542194[_0xa57c('0x38')],_0x542194['query']);_0x5143c0[_0xa57c('0x3b')]=_['intersection'](_0x542194['model'],qs[_0xa57c('0x3c')](_0x5db013['query'][_0xa57c('0x3c')]));_0x5143c0[_0xa57c('0x3b')]=_0x5143c0['attributes']['length']?_0x5143c0[_0xa57c('0x3b')]:_0x542194[_0xa57c('0x38')];_0x5143c0['order']=qs['sort'](_0x5db013[_0xa57c('0x39')][_0xa57c('0x40')]);_0x5143c0[_0xa57c('0x41')]=qs['filters'](_[_0xa57c('0x58')](_0x5db013[_0xa57c('0x39')],_0x542194[_0xa57c('0x42')]));if(_0x5db013[_0xa57c('0x39')][_0xa57c('0x43')]){_0x5143c0[_0xa57c('0x41')]=_[_0xa57c('0x44')](_0x5143c0[_0xa57c('0x41')],{'$or':_[_0xa57c('0x35')](_0x5143c0[_0xa57c('0x3b')],function(_0x46b223){var _0x2fa5fe={};_0x2fa5fe[_0x46b223]={'$like':'%'+_0x5db013[_0xa57c('0x39')]['filter']+'%'};return _0x2fa5fe;})});}_0x5143c0=_[_0xa57c('0x44')]({},_0x5143c0,_0x5db013[_0xa57c('0x48')]);return _0x3e12e5[_0xa57c('0x5c')](_0x5143c0);}})[_0xa57c('0x1c')](function(_0x159b00){if(_0x159b00){_0x23c39b=_0x159b00[_0xa57c('0x3d')];if(!_0x5db013['query']['hasOwnProperty'](_0xa57c('0x3f'))){_0x5143c0['limit']=qs['limit'](_0x5db013[_0xa57c('0x39')][_0xa57c('0x2d')]);_0x5143c0[_0xa57c('0x2c')]=qs['offset'](_0x5db013[_0xa57c('0x39')][_0xa57c('0x2c')]);}return _0x3e12e5[_0xa57c('0x5c')](_0x5143c0);}})[_0xa57c('0x1c')](function(_0x3eb06d){if(_0x3eb06d){return _0x3eb06d?{'count':_0x23c39b,'rows':_0x3eb06d}:null;}})['then'](respondWithResult(_0x6825df,null))['catch'](handleError(_0x6825df,null));};exports[_0xa57c('0x5d')]=function(_0x113ced,_0x3df959,_0x5c970c){if(_0x113ced[_0xa57c('0x53')]['id']){delete _0x113ced['body']['id'];}return db[_0xa57c('0x4a')][_0xa57c('0x55')]({'where':{'id':_0x113ced[_0xa57c('0x4d')]['id']}})[_0xa57c('0x1c')](handleEntityNotFound(_0x3df959,null))[_0xa57c('0x1c')](function(_0x80dfcb){if(_0x80dfcb){return _0x80dfcb[_0xa57c('0x5d')](_0x113ced['body']['ids']||[]);}return null;})[_0xa57c('0x1c')](respondWithResult(_0x3df959,null))[_0xa57c('0x27')](handleError(_0x3df959,null));}; \ No newline at end of file +var _0x14a0=['save','update','destroy','end','stack','name','index','map','ZendeskConfiguration','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','offset','order','sort','pick','merge','where','VIRTUAL','field','filter','options','includeAll','include','findAll','rows','params','create','body','find','getFields','ZendeskField','getSubjects','findOne','getDescriptions','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','squel','crypto','jsforce','querystring','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','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','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','json','count','limit','set','Content-Range','apply','reject'];(function(_0x572009,_0x3e00ad){var _0x36efbf=function(_0x340bb5){while(--_0x340bb5){_0x572009['push'](_0x572009['shift']());}};_0x36efbf(++_0x3e00ad);}(_0x14a0,0x8e));var _0x014a=function(_0x1e888f,_0x45b38c){_0x1e888f=_0x1e888f-0x0;var _0x289447=_0x14a0[_0x1e888f];return _0x289447;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x014a('0x0'));var rimraf=require(_0x014a('0x1'));var zipdir=require(_0x014a('0x2'));var jsonpatch=require(_0x014a('0x3'));var rp=require(_0x014a('0x4'));var moment=require(_0x014a('0x5'));var BPromise=require(_0x014a('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x014a('0x7'));var sox=require(_0x014a('0x8'));var csv=require(_0x014a('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x014a('0xa'));var crypto=require(_0x014a('0xb'));var jsforce=require(_0x014a('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x014a('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x014a('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x014a('0xf'))(_0x014a('0x10'));var utils=require('../../config/utils');var config=require(_0x014a('0x11'));var db=require(_0x014a('0x12'))['db'];var jayson=require(_0x014a('0x13'));var client=jayson[_0x014a('0x14')][_0x014a('0x15')]({'port':0x232a});function checkPasswordPattern(_0x20cb56,_0x200ab8,_0x23c917){if(_0x23c917){var _0x1e5366=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1e5366[_0x014a('0x16')](_0x200ab8)){return _0x20cb56;}else{throw new Error(_0x014a('0x17'));}}else{return _0x20cb56;}}function respondWithRpcPromise(_0x3c54c8,_0x4fe87c,_0x130d13,_0x3cf92f){return new BPromise(function(_0x59f207,_0x3a836f){var _0x128c46=_0x3cf92f||client;return _0x128c46['request'](_0x3c54c8,_0x130d13)[_0x014a('0x18')](function(_0x17e4be){logger[_0x014a('0x19')](_0x014a('0x1a'),_0x4fe87c,_0x014a('0x1b'));logger[_0x014a('0x1c')](_0x014a('0x1d'),_0x4fe87c,_0x014a('0x1b'),JSON[_0x014a('0x1e')](_0x17e4be));if(_0x17e4be[_0x014a('0x1f')]){if(_0x17e4be[_0x014a('0x1f')][_0x014a('0x20')]===0x1f4){logger[_0x014a('0x1f')](_0x014a('0x1a'),_0x4fe87c,_0x17e4be['error'][_0x014a('0x21')]);return _0x3a836f(_0x17e4be[_0x014a('0x1f')][_0x014a('0x21')]);}logger[_0x014a('0x1f')](_0x014a('0x1a'),_0x4fe87c,_0x17e4be[_0x014a('0x1f')][_0x014a('0x21')]);return _0x59f207(_0x17e4be[_0x014a('0x1f')][_0x014a('0x21')]);}else{logger['info'](_0x014a('0x1a'),_0x4fe87c,'request\x20sent');_0x59f207(_0x17e4be[_0x014a('0x22')][_0x014a('0x21')]);}})[_0x014a('0x23')](function(_0x36d52b){logger[_0x014a('0x1f')](_0x014a('0x1a'),_0x4fe87c,_0x36d52b);_0x3a836f(_0x36d52b);});});}function respondWithStatusCode(_0x3fec9f,_0x453545){_0x453545=_0x453545||0xcc;return function(_0x165a42){if(_0x165a42){return _0x3fec9f['sendStatus'](_0x453545);}return _0x3fec9f[_0x014a('0x24')](_0x453545)['end']();};}function respondWithResult(_0x39a432,_0x28701e){_0x28701e=_0x28701e||0xc8;return function(_0x4f1c44){if(_0x4f1c44){return _0x39a432['status'](_0x28701e)[_0x014a('0x25')](_0x4f1c44);}};}function respondWithFilteredResult(_0x3f9719,_0x143346){return function(_0x5ed71b){if(_0x5ed71b){var _0x183f19=_0x5ed71b[_0x014a('0x26')],_0x3c1fa4=_0x143346['offset'],_0x598179=_0x143346['offset']+_0x143346[_0x014a('0x27')],_0x31dc95;if(_0x598179>=_0x183f19){_0x598179=_0x183f19;_0x31dc95=0xc8;}else{_0x31dc95=0xce;}_0x3f9719[_0x014a('0x24')](_0x31dc95);return _0x3f9719[_0x014a('0x28')](_0x014a('0x29'),_0x3c1fa4+'-'+_0x598179+'/'+_0x183f19)['json'](_0x5ed71b);}return null;};}function patchUpdates(_0x434038){return function(_0x147e7e){try{jsonpatch[_0x014a('0x2a')](_0x147e7e,_0x434038,!![]);}catch(_0x402d3b){return BPromise[_0x014a('0x2b')](_0x402d3b);}return _0x147e7e[_0x014a('0x2c')]();};}function saveUpdates(_0x354f4c,_0x1dae8e){return function(_0xc802d5){if(_0xc802d5){return _0xc802d5[_0x014a('0x2d')](_0x354f4c)[_0x014a('0x18')](function(_0x4ed54e){return _0x4ed54e;});}return null;};}function removeEntity(_0x105d4a,_0x41ead8){return function(_0x1f7a3b){if(_0x1f7a3b){return _0x1f7a3b[_0x014a('0x2e')]()[_0x014a('0x18')](function(){_0x105d4a[_0x014a('0x24')](0xcc)[_0x014a('0x2f')]();});}};}function handleEntityNotFound(_0x4dd025,_0x116a24){return function(_0x325b3c){if(!_0x325b3c){_0x4dd025['sendStatus'](0x194);}return _0x325b3c;};}function handleError(_0x415f83,_0x12de94){_0x12de94=_0x12de94||0x1f4;return function(_0x40738f){logger[_0x014a('0x1f')](_0x40738f[_0x014a('0x30')]);if(_0x40738f[_0x014a('0x31')]){delete _0x40738f[_0x014a('0x31')];}_0x415f83[_0x014a('0x24')](_0x12de94)['send'](_0x40738f);};}exports[_0x014a('0x32')]=function(_0x1dfe6e,_0x29f600){var _0x1f31c8={},_0x5127f3={},_0x427c7a={'count':0x0,'rows':[]};var _0x978870=_[_0x014a('0x33')](db[_0x014a('0x34')][_0x014a('0x35')],function(_0x309925){return{'name':_0x309925[_0x014a('0x36')],'type':_0x309925[_0x014a('0x37')][_0x014a('0x38')]};});_0x5127f3['model']=_[_0x014a('0x33')](_0x978870,'name');_0x5127f3[_0x014a('0x39')]=_[_0x014a('0x3a')](_0x1dfe6e[_0x014a('0x39')]);_0x5127f3[_0x014a('0x3b')]=_[_0x014a('0x3c')](_0x5127f3['model'],_0x5127f3[_0x014a('0x39')]);_0x1f31c8[_0x014a('0x3d')]=_['intersection'](_0x5127f3[_0x014a('0x3e')],qs[_0x014a('0x3f')](_0x1dfe6e[_0x014a('0x39')][_0x014a('0x3f')]));_0x1f31c8[_0x014a('0x3d')]=_0x1f31c8[_0x014a('0x3d')][_0x014a('0x40')]?_0x1f31c8[_0x014a('0x3d')]:_0x5127f3[_0x014a('0x3e')];if(!_0x1dfe6e['query'][_0x014a('0x41')](_0x014a('0x42'))){_0x1f31c8[_0x014a('0x27')]=qs[_0x014a('0x27')](_0x1dfe6e['query'][_0x014a('0x27')]);_0x1f31c8[_0x014a('0x43')]=qs[_0x014a('0x43')](_0x1dfe6e[_0x014a('0x39')][_0x014a('0x43')]);}_0x1f31c8[_0x014a('0x44')]=qs['sort'](_0x1dfe6e[_0x014a('0x39')][_0x014a('0x45')]);_0x1f31c8['where']=qs[_0x014a('0x3b')](_[_0x014a('0x46')](_0x1dfe6e[_0x014a('0x39')],_0x5127f3['filters']));if(_0x1dfe6e[_0x014a('0x39')]['filter']){_0x1f31c8['where']=_[_0x014a('0x47')](_0x1f31c8[_0x014a('0x48')],{'$or':_['map'](_0x978870,function(_0x1557ad){if(_0x1557ad[_0x014a('0x37')][_0x014a('0x38')]!==_0x014a('0x49')){var _0x382a5f={};_0x382a5f[_0x1557ad[_0x014a('0x4a')]]={'$like':'%'+_0x1dfe6e['query'][_0x014a('0x4b')]+'%'};return _0x382a5f;}})});}_0x1f31c8=_[_0x014a('0x47')]({},_0x1f31c8,_0x1dfe6e[_0x014a('0x4c')]);var _0x52677e={'where':_0x1f31c8['where']};return db[_0x014a('0x34')]['count'](_0x52677e)['then'](function(_0x42c530){_0x427c7a['count']=_0x42c530;if(_0x1dfe6e[_0x014a('0x39')][_0x014a('0x4d')]){_0x1f31c8[_0x014a('0x4e')]=[{'all':!![]}];}return db['ZendeskConfiguration'][_0x014a('0x4f')](_0x1f31c8);})[_0x014a('0x18')](function(_0x12cd9b){_0x427c7a[_0x014a('0x50')]=_0x12cd9b;return _0x427c7a;})[_0x014a('0x18')](respondWithFilteredResult(_0x29f600,_0x1f31c8))[_0x014a('0x23')](handleError(_0x29f600,null));};exports['show']=function(_0x16e25b,_0x1f7f40){var _0x5a861c={'raw':![],'where':{'id':_0x16e25b[_0x014a('0x51')]['id']}},_0x1a4df9={};_0x1a4df9[_0x014a('0x3e')]=_[_0x014a('0x3a')](db[_0x014a('0x34')][_0x014a('0x35')]);_0x1a4df9[_0x014a('0x39')]=_[_0x014a('0x3a')](_0x16e25b['query']);_0x1a4df9[_0x014a('0x3b')]=_[_0x014a('0x3c')](_0x1a4df9[_0x014a('0x3e')],_0x1a4df9[_0x014a('0x39')]);_0x5a861c[_0x014a('0x3d')]=_['intersection'](_0x1a4df9[_0x014a('0x3e')],qs['fields'](_0x16e25b[_0x014a('0x39')][_0x014a('0x3f')]));_0x5a861c[_0x014a('0x3d')]=_0x5a861c[_0x014a('0x3d')][_0x014a('0x40')]?_0x5a861c['attributes']:_0x1a4df9['model'];if(_0x16e25b['query']['includeAll']){_0x5a861c[_0x014a('0x4e')]=[{'all':!![]}];}_0x5a861c=_['merge']({},_0x5a861c,_0x16e25b[_0x014a('0x4c')]);return db['ZendeskConfiguration']['find'](_0x5a861c)[_0x014a('0x18')](handleEntityNotFound(_0x1f7f40,null))['then'](respondWithResult(_0x1f7f40,null))[_0x014a('0x23')](handleError(_0x1f7f40,null));};exports[_0x014a('0x52')]=function(_0x400633,_0x3c7e06){return db[_0x014a('0x34')][_0x014a('0x52')](_0x400633[_0x014a('0x53')],{})[_0x014a('0x18')](respondWithResult(_0x3c7e06,0xc9))[_0x014a('0x23')](handleError(_0x3c7e06,null));};exports[_0x014a('0x2d')]=function(_0x4de0ec,_0x5d0f77){if(_0x4de0ec[_0x014a('0x53')]['id']){delete _0x4de0ec[_0x014a('0x53')]['id'];}return db[_0x014a('0x34')]['find']({'where':{'id':_0x4de0ec['params']['id']}})[_0x014a('0x18')](handleEntityNotFound(_0x5d0f77,null))['then'](saveUpdates(_0x4de0ec[_0x014a('0x53')],null))[_0x014a('0x18')](respondWithResult(_0x5d0f77,null))[_0x014a('0x23')](handleError(_0x5d0f77,null));};exports[_0x014a('0x2e')]=function(_0x53e631,_0x861fb5){return db[_0x014a('0x34')][_0x014a('0x54')]({'where':{'id':_0x53e631['params']['id']}})[_0x014a('0x18')](handleEntityNotFound(_0x861fb5,null))['then'](removeEntity(_0x861fb5,null))[_0x014a('0x23')](handleError(_0x861fb5,null));};exports[_0x014a('0x55')]=function(_0x34736b,_0x24d433,_0xd0334a){var _0x1a308b={};var _0x4e9260={};var _0x889080;var _0x49d442;return db[_0x014a('0x34')]['findOne']({'where':{'id':_0x34736b[_0x014a('0x51')]['id']}})[_0x014a('0x18')](handleEntityNotFound(_0x24d433,null))[_0x014a('0x18')](function(_0xa4fd8d){if(_0xa4fd8d){_0x889080=_0xa4fd8d;_0x4e9260[_0x014a('0x3e')]=_['keys'](db[_0x014a('0x56')][_0x014a('0x35')]);_0x4e9260[_0x014a('0x39')]=_[_0x014a('0x3a')](_0x34736b[_0x014a('0x39')]);_0x4e9260[_0x014a('0x3b')]=_[_0x014a('0x3c')](_0x4e9260[_0x014a('0x3e')],_0x4e9260[_0x014a('0x39')]);_0x1a308b[_0x014a('0x3d')]=_[_0x014a('0x3c')](_0x4e9260[_0x014a('0x3e')],qs['fields'](_0x34736b[_0x014a('0x39')]['fields']));_0x1a308b['attributes']=_0x1a308b['attributes']['length']?_0x1a308b['attributes']:_0x4e9260[_0x014a('0x3e')];_0x1a308b[_0x014a('0x44')]=qs[_0x014a('0x45')](_0x34736b['query'][_0x014a('0x45')]);_0x1a308b[_0x014a('0x48')]=qs[_0x014a('0x3b')](_[_0x014a('0x46')](_0x34736b['query'],_0x4e9260['filters']));if(_0x34736b[_0x014a('0x39')][_0x014a('0x4b')]){_0x1a308b[_0x014a('0x48')]=_[_0x014a('0x47')](_0x1a308b[_0x014a('0x48')],{'$or':_[_0x014a('0x33')](_0x1a308b[_0x014a('0x3d')],function(_0x1eee3e){var _0x387d12={};_0x387d12[_0x1eee3e]={'$like':'%'+_0x34736b[_0x014a('0x39')][_0x014a('0x4b')]+'%'};return _0x387d12;})});}_0x1a308b=_['merge']({},_0x1a308b,_0x34736b[_0x014a('0x4c')]);return _0x889080[_0x014a('0x55')](_0x1a308b);}})['then'](function(_0x2f3da3){if(_0x2f3da3){_0x49d442=_0x2f3da3[_0x014a('0x40')];if(!_0x34736b['query'][_0x014a('0x41')]('nolimit')){_0x1a308b[_0x014a('0x27')]=qs[_0x014a('0x27')](_0x34736b[_0x014a('0x39')][_0x014a('0x27')]);_0x1a308b[_0x014a('0x43')]=qs['offset'](_0x34736b[_0x014a('0x39')][_0x014a('0x43')]);}return _0x889080[_0x014a('0x55')](_0x1a308b);}})[_0x014a('0x18')](function(_0xbad5ef){if(_0xbad5ef){return _0xbad5ef?{'count':_0x49d442,'rows':_0xbad5ef}:null;}})['then'](respondWithResult(_0x24d433,null))[_0x014a('0x23')](handleError(_0x24d433,null));};exports[_0x014a('0x57')]=function(_0x3c796f,_0x5f3224,_0x160e71){var _0x5abffe={};var _0x39e06e={};var _0x1caefa;var _0x267026;return db[_0x014a('0x34')][_0x014a('0x58')]({'where':{'id':_0x3c796f[_0x014a('0x51')]['id']}})[_0x014a('0x18')](handleEntityNotFound(_0x5f3224,null))['then'](function(_0x59ba21){if(_0x59ba21){_0x1caefa=_0x59ba21;_0x39e06e[_0x014a('0x3e')]=_['keys'](db[_0x014a('0x56')]['rawAttributes']);_0x39e06e[_0x014a('0x39')]=_[_0x014a('0x3a')](_0x3c796f['query']);_0x39e06e['filters']=_[_0x014a('0x3c')](_0x39e06e[_0x014a('0x3e')],_0x39e06e['query']);_0x5abffe[_0x014a('0x3d')]=_[_0x014a('0x3c')](_0x39e06e['model'],qs['fields'](_0x3c796f[_0x014a('0x39')][_0x014a('0x3f')]));_0x5abffe[_0x014a('0x3d')]=_0x5abffe[_0x014a('0x3d')][_0x014a('0x40')]?_0x5abffe[_0x014a('0x3d')]:_0x39e06e['model'];_0x5abffe[_0x014a('0x44')]=qs['sort'](_0x3c796f['query'][_0x014a('0x45')]);_0x5abffe[_0x014a('0x48')]=qs['filters'](_[_0x014a('0x46')](_0x3c796f[_0x014a('0x39')],_0x39e06e[_0x014a('0x3b')]));if(_0x3c796f[_0x014a('0x39')][_0x014a('0x4b')]){_0x5abffe['where']=_[_0x014a('0x47')](_0x5abffe[_0x014a('0x48')],{'$or':_[_0x014a('0x33')](_0x5abffe[_0x014a('0x3d')],function(_0x4aefeb){var _0x8716b={};_0x8716b[_0x4aefeb]={'$like':'%'+_0x3c796f['query'][_0x014a('0x4b')]+'%'};return _0x8716b;})});}_0x5abffe=_[_0x014a('0x47')]({},_0x5abffe,_0x3c796f[_0x014a('0x4c')]);return _0x1caefa[_0x014a('0x57')](_0x5abffe);}})[_0x014a('0x18')](function(_0x29377e){if(_0x29377e){_0x267026=_0x29377e['length'];if(!_0x3c796f[_0x014a('0x39')][_0x014a('0x41')](_0x014a('0x42'))){_0x5abffe[_0x014a('0x27')]=qs[_0x014a('0x27')](_0x3c796f[_0x014a('0x39')][_0x014a('0x27')]);_0x5abffe[_0x014a('0x43')]=qs['offset'](_0x3c796f[_0x014a('0x39')][_0x014a('0x43')]);}return _0x1caefa[_0x014a('0x57')](_0x5abffe);}})['then'](function(_0x2fbaf3){if(_0x2fbaf3){return _0x2fbaf3?{'count':_0x267026,'rows':_0x2fbaf3}:null;}})[_0x014a('0x18')](respondWithResult(_0x5f3224,null))[_0x014a('0x23')](handleError(_0x5f3224,null));};exports[_0x014a('0x59')]=function(_0x6f7932,_0x161094,_0x29b061){var _0x48cec1={};var _0x5891cf={};var _0x54767d;var _0x547710;return db[_0x014a('0x34')][_0x014a('0x58')]({'where':{'id':_0x6f7932[_0x014a('0x51')]['id']}})[_0x014a('0x18')](handleEntityNotFound(_0x161094,null))[_0x014a('0x18')](function(_0x7cd599){if(_0x7cd599){_0x54767d=_0x7cd599;_0x5891cf[_0x014a('0x3e')]=_['keys'](db[_0x014a('0x56')][_0x014a('0x35')]);_0x5891cf[_0x014a('0x39')]=_[_0x014a('0x3a')](_0x6f7932['query']);_0x5891cf['filters']=_[_0x014a('0x3c')](_0x5891cf[_0x014a('0x3e')],_0x5891cf['query']);_0x48cec1['attributes']=_[_0x014a('0x3c')](_0x5891cf['model'],qs['fields'](_0x6f7932[_0x014a('0x39')][_0x014a('0x3f')]));_0x48cec1['attributes']=_0x48cec1[_0x014a('0x3d')][_0x014a('0x40')]?_0x48cec1[_0x014a('0x3d')]:_0x5891cf[_0x014a('0x3e')];_0x48cec1[_0x014a('0x44')]=qs[_0x014a('0x45')](_0x6f7932[_0x014a('0x39')][_0x014a('0x45')]);_0x48cec1['where']=qs['filters'](_[_0x014a('0x46')](_0x6f7932['query'],_0x5891cf['filters']));if(_0x6f7932['query'][_0x014a('0x4b')]){_0x48cec1[_0x014a('0x48')]=_[_0x014a('0x47')](_0x48cec1['where'],{'$or':_[_0x014a('0x33')](_0x48cec1[_0x014a('0x3d')],function(_0x30e89b){var _0x2a16c7={};_0x2a16c7[_0x30e89b]={'$like':'%'+_0x6f7932['query'][_0x014a('0x4b')]+'%'};return _0x2a16c7;})});}_0x48cec1=_[_0x014a('0x47')]({},_0x48cec1,_0x6f7932[_0x014a('0x4c')]);return _0x54767d['getDescriptions'](_0x48cec1);}})[_0x014a('0x18')](function(_0x52a3a8){if(_0x52a3a8){_0x547710=_0x52a3a8['length'];if(!_0x6f7932[_0x014a('0x39')][_0x014a('0x41')](_0x014a('0x42'))){_0x48cec1['limit']=qs[_0x014a('0x27')](_0x6f7932[_0x014a('0x39')]['limit']);_0x48cec1[_0x014a('0x43')]=qs[_0x014a('0x43')](_0x6f7932[_0x014a('0x39')][_0x014a('0x43')]);}return _0x54767d[_0x014a('0x59')](_0x48cec1);}})[_0x014a('0x18')](function(_0x89076a){if(_0x89076a){return _0x89076a?{'count':_0x547710,'rows':_0x89076a}:null;}})[_0x014a('0x18')](respondWithResult(_0x161094,null))['catch'](handleError(_0x161094,null));};exports[_0x014a('0x5a')]=function(_0x1806d0,_0x50fa83,_0x53d49d){var _0x30d141={};var _0x45a093={};var _0x47f3c7;var _0x577ca4;return db[_0x014a('0x34')][_0x014a('0x58')]({'where':{'id':_0x1806d0['params']['id']}})[_0x014a('0x18')](handleEntityNotFound(_0x50fa83,null))[_0x014a('0x18')](function(_0x5dedaf){if(_0x5dedaf){_0x47f3c7=_0x5dedaf;_0x45a093['model']=_[_0x014a('0x3a')](db['Tag'][_0x014a('0x35')]);_0x45a093['query']=_[_0x014a('0x3a')](_0x1806d0[_0x014a('0x39')]);_0x45a093[_0x014a('0x3b')]=_[_0x014a('0x3c')](_0x45a093[_0x014a('0x3e')],_0x45a093['query']);_0x30d141[_0x014a('0x3d')]=_[_0x014a('0x3c')](_0x45a093[_0x014a('0x3e')],qs[_0x014a('0x3f')](_0x1806d0[_0x014a('0x39')][_0x014a('0x3f')]));_0x30d141[_0x014a('0x3d')]=_0x30d141[_0x014a('0x3d')]['length']?_0x30d141[_0x014a('0x3d')]:_0x45a093['model'];_0x30d141[_0x014a('0x44')]=qs['sort'](_0x1806d0['query']['sort']);_0x30d141['where']=qs[_0x014a('0x3b')](_[_0x014a('0x46')](_0x1806d0[_0x014a('0x39')],_0x45a093[_0x014a('0x3b')]));if(_0x1806d0[_0x014a('0x39')][_0x014a('0x4b')]){_0x30d141[_0x014a('0x48')]=_[_0x014a('0x47')](_0x30d141['where'],{'$or':_['map'](_0x30d141[_0x014a('0x3d')],function(_0x172cc5){var _0x15d686={};_0x15d686[_0x172cc5]={'$like':'%'+_0x1806d0[_0x014a('0x39')][_0x014a('0x4b')]+'%'};return _0x15d686;})});}_0x30d141=_[_0x014a('0x47')]({},_0x30d141,_0x1806d0[_0x014a('0x4c')]);return _0x47f3c7[_0x014a('0x5a')](_0x30d141);}})['then'](function(_0x27431c){if(_0x27431c){_0x577ca4=_0x27431c[_0x014a('0x40')];if(!_0x1806d0[_0x014a('0x39')][_0x014a('0x41')](_0x014a('0x42'))){_0x30d141['limit']=qs[_0x014a('0x27')](_0x1806d0[_0x014a('0x39')][_0x014a('0x27')]);_0x30d141[_0x014a('0x43')]=qs[_0x014a('0x43')](_0x1806d0[_0x014a('0x39')][_0x014a('0x43')]);}return _0x47f3c7['getTags'](_0x30d141);}})[_0x014a('0x18')](function(_0x5a83ab){if(_0x5a83ab){return _0x5a83ab?{'count':_0x577ca4,'rows':_0x5a83ab}:null;}})['then'](respondWithResult(_0x50fa83,null))[_0x014a('0x23')](handleError(_0x50fa83,null));};exports[_0x014a('0x5b')]=function(_0x4af6d4,_0x129c22,_0x3199b9){if(_0x4af6d4[_0x014a('0x53')]['id']){delete _0x4af6d4['body']['id'];}return db[_0x014a('0x34')][_0x014a('0x58')]({'where':{'id':_0x4af6d4[_0x014a('0x51')]['id']}})[_0x014a('0x18')](handleEntityNotFound(_0x129c22,null))[_0x014a('0x18')](function(_0x263212){if(_0x263212){return _0x263212[_0x014a('0x5b')](_0x4af6d4[_0x014a('0x53')][_0x014a('0x5c')]||[]);}return null;})['then'](respondWithResult(_0x129c22,null))['catch'](handleError(_0x129c22,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index fcb6d14..f7392b2 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 _0x6580=['moment','bluebird','request-promise','define','int_zendesk_configurations','lodash','util','../../config/logger','api'];(function(_0x5338d3,_0x470835){var _0x8beb32=function(_0x718ac9){while(--_0x718ac9){_0x5338d3['push'](_0x5338d3['shift']());}};_0x8beb32(++_0x470835);}(_0x6580,0x15b));var _0x0658=function(_0x8d55ee,_0x3b03e5){_0x8d55ee=_0x8d55ee-0x0;var _0x3f9aca=_0x6580[_0x8d55ee];return _0x3f9aca;};'use strict';var _=require(_0x0658('0x0'));var util=require(_0x0658('0x1'));var logger=require(_0x0658('0x2'))(_0x0658('0x3'));var moment=require(_0x0658('0x4'));var BPromise=require(_0x0658('0x5'));var rp=require(_0x0658('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intZendeskConfiguration.attributes');module['exports']=function(_0x27c503,_0x5b5601){return _0x27c503[_0x0658('0x7')]('ZendeskConfiguration',attributes,{'tableName':_0x0658('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9575=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ZendeskConfiguration'];(function(_0x44268d,_0xad8443){var _0x4be92d=function(_0x8a57ff){while(--_0x8a57ff){_0x44268d['push'](_0x44268d['shift']());}};_0x4be92d(++_0xad8443);}(_0x9575,0x11e));var _0x5957=function(_0x1c828f,_0x284cc7){_0x1c828f=_0x1c828f-0x0;var _0x5a672d=_0x9575[_0x1c828f];return _0x5a672d;};'use strict';var _=require('lodash');var util=require(_0x5957('0x0'));var logger=require(_0x5957('0x1'))(_0x5957('0x2'));var moment=require('moment');var BPromise=require(_0x5957('0x3'));var rp=require(_0x5957('0x4'));var fs=require('fs');var path=require(_0x5957('0x5'));var rimraf=require(_0x5957('0x6'));var config=require(_0x5957('0x7'));var attributes=require('./intZendeskConfiguration.attributes');module[_0x5957('0x8')]=function(_0x490729,_0x34a5dc){return _0x490729[_0x5957('0x9')](_0x5957('0xa'),attributes,{'tableName':'int_zendesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js index d04e8b4..a1c3934 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 _0xc141=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring'];(function(_0x2cab9c,_0x509fe){var _0x1d67e7=function(_0x5337cb){while(--_0x5337cb){_0x2cab9c['push'](_0x2cab9c['shift']());}};_0x1d67e7(++_0x509fe);}(_0xc141,0x159));var _0x1c14=function(_0x23be51,_0xc02a1b){_0x23be51=_0x23be51-0x0;var _0x47a26d=_0xc141[_0x23be51];return _0x47a26d;};'use strict';var _=require(_0x1c14('0x0'));var util=require(_0x1c14('0x1'));var moment=require(_0x1c14('0x2'));var BPromise=require(_0x1c14('0x3'));var rs=require(_0x1c14('0x4'));var fs=require('fs');var Redis=require(_0x1c14('0x5'));var db=require(_0x1c14('0x6'))['db'];var utils=require(_0x1c14('0x7'));var logger=require(_0x1c14('0x8'))(_0x1c14('0x9'));var config=require(_0x1c14('0xa'));var jayson=require(_0x1c14('0xb'));var client=jayson[_0x1c14('0xc')][_0x1c14('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x40cf7b,_0x1bf94c,_0x583b3b){return new BPromise(function(_0x4afdc8,_0x1d2da2){return client['request'](_0x40cf7b,_0x583b3b)[_0x1c14('0xe')](function(_0xb4bcf9){logger[_0x1c14('0xf')](_0x1c14('0x10'),_0x1bf94c,_0x1c14('0x11'));logger[_0x1c14('0x12')](_0x1c14('0x13'),_0x1bf94c,'request\x20sent',JSON[_0x1c14('0x14')](_0xb4bcf9));if(_0xb4bcf9['error']){if(_0xb4bcf9[_0x1c14('0x15')][_0x1c14('0x16')]===0x1f4){logger[_0x1c14('0x15')](_0x1c14('0x10'),_0x1bf94c,_0xb4bcf9['error'][_0x1c14('0x17')]);return _0x1d2da2(_0xb4bcf9[_0x1c14('0x15')][_0x1c14('0x17')]);}logger[_0x1c14('0x15')](_0x1c14('0x10'),_0x1bf94c,_0xb4bcf9['error'][_0x1c14('0x17')]);return _0x4afdc8(_0xb4bcf9['error'][_0x1c14('0x17')]);}else{logger[_0x1c14('0xf')](_0x1c14('0x10'),_0x1bf94c,_0x1c14('0x11'));_0x4afdc8(_0xb4bcf9[_0x1c14('0x18')][_0x1c14('0x17')]);}})['catch'](function(_0x14e433){logger[_0x1c14('0x15')](_0x1c14('0x10'),_0x1bf94c,_0x14e433);_0x1d2da2(_0x14e433);});});} \ No newline at end of file +var _0x97af=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ZendeskConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x549b35,_0x24fc55){var _0x22c38c=function(_0x147e0b){while(--_0x147e0b){_0x549b35['push'](_0x549b35['shift']());}};_0x22c38c(++_0x24fc55);}(_0x97af,0xb2));var _0xf97a=function(_0x16f1be,_0x2830ac){_0x16f1be=_0x16f1be-0x0;var _0x43da5a=_0x97af[_0x16f1be];return _0x43da5a;};'use strict';var _=require(_0xf97a('0x0'));var util=require(_0xf97a('0x1'));var moment=require(_0xf97a('0x2'));var BPromise=require(_0xf97a('0x3'));var rs=require(_0xf97a('0x4'));var fs=require('fs');var Redis=require(_0xf97a('0x5'));var db=require(_0xf97a('0x6'))['db'];var utils=require(_0xf97a('0x7'));var logger=require(_0xf97a('0x8'))(_0xf97a('0x9'));var config=require('../../config/environment');var jayson=require(_0xf97a('0xa'));var client=jayson[_0xf97a('0xb')][_0xf97a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x41dbe4,_0x36241e,_0x9b057b){return new BPromise(function(_0x39aa9d,_0x5d3f9e){return client[_0xf97a('0xd')](_0x41dbe4,_0x9b057b)['then'](function(_0x3c1699){logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x36241e,'request\x20sent');logger[_0xf97a('0xe')](_0xf97a('0xf'),_0x36241e,_0xf97a('0x10'),JSON[_0xf97a('0x11')](_0x3c1699));if(_0x3c1699['error']){if(_0x3c1699[_0xf97a('0x12')]['code']===0x1f4){logger[_0xf97a('0x12')](_0xf97a('0x13'),_0x36241e,_0x3c1699[_0xf97a('0x12')][_0xf97a('0x14')]);return _0x5d3f9e(_0x3c1699[_0xf97a('0x12')][_0xf97a('0x14')]);}logger[_0xf97a('0x12')](_0xf97a('0x13'),_0x36241e,_0x3c1699[_0xf97a('0x12')]['message']);return _0x39aa9d(_0x3c1699[_0xf97a('0x12')][_0xf97a('0x14')]);}else{logger['info'](_0xf97a('0x13'),_0x36241e,_0xf97a('0x10'));_0x39aa9d(_0x3c1699[_0xf97a('0x15')]['message']);}})[_0xf97a('0x16')](function(_0x1189ce){logger[_0xf97a('0x12')](_0xf97a('0x13'),_0x36241e,_0x1189ce);_0x5d3f9e(_0x1189ce);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 79a4bb8..cc2c11e 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 _0xef1c=['multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','delete','exports'];(function(_0x219477,_0x18892c){var _0xe8d621=function(_0x48ea21){while(--_0x48ea21){_0x219477['push'](_0x219477['shift']());}};_0xe8d621(++_0x18892c);}(_0xef1c,0x176));var _0xcef1=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xef1c[_0x1035c1];return _0x308d67;};'use strict';var multer=require(_0xcef1('0x0'));var util=require(_0xcef1('0x1'));var path=require('path');var timeout=require(_0xcef1('0x2'));var express=require(_0xcef1('0x3'));var router=express[_0xcef1('0x4')]();var auth=require(_0xcef1('0x5'));var interaction=require(_0xcef1('0x6'));var config=require(_0xcef1('0x7'));var controller=require('./intZendeskField.controller');router[_0xcef1('0x8')]('/',auth[_0xcef1('0x9')](),controller[_0xcef1('0xa')]);router['get'](_0xcef1('0xb'),auth['isAuthenticated'](),controller[_0xcef1('0xc')]);router[_0xcef1('0xd')]('/',auth[_0xcef1('0x9')](),controller[_0xcef1('0xe')]);router['put'](_0xcef1('0xb'),auth[_0xcef1('0x9')](),controller['update']);router[_0xcef1('0xf')](_0xcef1('0xb'),auth[_0xcef1('0x9')](),controller['destroy']);module[_0xcef1('0x10')]=router; \ No newline at end of file +var _0xa1e4=['put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./intZendeskField.controller','isAuthenticated','index','get','/:id','show','create'];(function(_0x3544bc,_0x58ac24){var _0x57cd17=function(_0x594f2a){while(--_0x594f2a){_0x3544bc['push'](_0x3544bc['shift']());}};_0x57cd17(++_0x58ac24);}(_0xa1e4,0xb8));var _0x4a1e=function(_0x5d0792,_0x486759){_0x5d0792=_0x5d0792-0x0;var _0x2885a6=_0xa1e4[_0x5d0792];return _0x2885a6;};'use strict';var multer=require(_0x4a1e('0x0'));var util=require(_0x4a1e('0x1'));var path=require(_0x4a1e('0x2'));var timeout=require(_0x4a1e('0x3'));var express=require(_0x4a1e('0x4'));var router=express[_0x4a1e('0x5')]();var auth=require(_0x4a1e('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4a1e('0x7'));router['get']('/',auth[_0x4a1e('0x8')](),controller[_0x4a1e('0x9')]);router[_0x4a1e('0xa')](_0x4a1e('0xb'),auth[_0x4a1e('0x8')](),controller[_0x4a1e('0xc')]);router['post']('/',auth[_0x4a1e('0x8')](),controller[_0x4a1e('0xd')]);router[_0x4a1e('0xe')]('/:id',auth[_0x4a1e('0x8')](),controller[_0x4a1e('0xf')]);router[_0x4a1e('0x10')](_0x4a1e('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x4a1e('0x11')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 51e9a55..e92620e 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 _0x92f0=['STRING','string','BOOLEAN','exports','ENUM','variable','customVariable'];(function(_0x3c255b,_0x5a7900){var _0x6d7591=function(_0x222cda){while(--_0x222cda){_0x3c255b['push'](_0x3c255b['shift']());}};_0x6d7591(++_0x5a7900);}(_0x92f0,0x10d));var _0x092f=function(_0x4de9e8,_0x565ffa){_0x4de9e8=_0x4de9e8-0x0;var _0x4db0de=_0x92f0[_0x4de9e8];return _0x4db0de;};'use strict';var Sequelize=require('sequelize');module[_0x092f('0x0')]={'type':{'type':Sequelize[_0x092f('0x1')]('string',_0x092f('0x2'),_0x092f('0x3'),'keyValue'),'defaultValue':'string'},'content':{'type':Sequelize[_0x092f('0x4')]},'key':{'type':Sequelize[_0x092f('0x4')]},'keyType':{'type':Sequelize[_0x092f('0x1')](_0x092f('0x5'),_0x092f('0x2'),_0x092f('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x092f('0x4')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x092f('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1da1=['variable','STRING','customVariable','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x147738,_0x1c9386){var _0x5807f4=function(_0x4397ce){while(--_0x4397ce){_0x147738['push'](_0x147738['shift']());}};_0x5807f4(++_0x1c9386);}(_0x1da1,0x1a4));var _0x11da=function(_0x2dd29f,_0x1f0603){_0x2dd29f=_0x2dd29f-0x0;var _0x180125=_0x1da1[_0x2dd29f];return _0x180125;};'use strict';var Sequelize=require(_0x11da('0x0'));module[_0x11da('0x1')]={'type':{'type':Sequelize[_0x11da('0x2')](_0x11da('0x3'),_0x11da('0x4'),'customVariable','keyValue'),'defaultValue':_0x11da('0x3')},'content':{'type':Sequelize[_0x11da('0x5')]},'key':{'type':Sequelize[_0x11da('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x11da('0x3'),_0x11da('0x4'),_0x11da('0x6'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x11da('0x5')]},'customField':{'type':Sequelize[_0x11da('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index ce5c57b..525a67a 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 _0x979f=['util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','update','destroy','then','error','stack','name','send','index','map','ZendeskField','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','field','options','include','findAll','catch','params','keys','includeAll','find','create','body','html-pdf','eml-format','rimraf','request-promise','moment','bluebird'];(function(_0x587783,_0x6296e6){var _0x1cca44=function(_0x2c5082){while(--_0x2c5082){_0x587783['push'](_0x587783['shift']());}};_0x1cca44(++_0x6296e6);}(_0x979f,0x176));var _0xf979=function(_0x35247f,_0x242131){_0x35247f=_0x35247f-0x0;var _0x4c76f2=_0x979f[_0x35247f];return _0x4c76f2;};'use strict';var pdf=require(_0xf979('0x0'));var emlformat=require(_0xf979('0x1'));var rimraf=require(_0xf979('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf979('0x3'));var moment=require(_0xf979('0x4'));var BPromise=require(_0xf979('0x5'));var Mustache=require('mustache');var util=require(_0xf979('0x6'));var path=require(_0xf979('0x7'));var sox=require(_0xf979('0x8'));var csv=require(_0xf979('0x9'));var ejs=require(_0xf979('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xf979('0xb'));var crypto=require(_0xf979('0xc'));var jsforce=require(_0xf979('0xd'));var deskjs=require(_0xf979('0xe'));var toCsv=require(_0xf979('0x9'));var querystring=require(_0xf979('0xf'));var Papa=require(_0xf979('0x10'));var Redis=require(_0xf979('0x11'));var authService=require(_0xf979('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf979('0x13'));var hardwareService=require(_0xf979('0x14'));var logger=require(_0xf979('0x15'))(_0xf979('0x16'));var utils=require(_0xf979('0x17'));var config=require(_0xf979('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x37a736,_0x281740){_0x281740=_0x281740||0xcc;return function(_0x46620a){if(_0x46620a){return _0x37a736[_0xf979('0x19')](_0x281740);}return _0x37a736[_0xf979('0x1a')](_0x281740)[_0xf979('0x1b')]();};}function respondWithResult(_0x27b989,_0x2e3bcb){_0x2e3bcb=_0x2e3bcb||0xc8;return function(_0x124eb1){if(_0x124eb1){return _0x27b989[_0xf979('0x1a')](_0x2e3bcb)['json'](_0x124eb1);}};}function respondWithFilteredResult(_0xc4a5dd,_0xd04991){return function(_0x4c0b38){if(_0x4c0b38){var _0x237559=_0x4c0b38[_0xf979('0x1c')],_0xcfad7c=_0xd04991[_0xf979('0x1d')],_0x31a782=_0xd04991[_0xf979('0x1d')]+_0xd04991[_0xf979('0x1e')],_0x29c8a0;if(_0x31a782>=_0x237559){_0x31a782=_0x237559;_0x29c8a0=0xc8;}else{_0x29c8a0=0xce;}_0xc4a5dd[_0xf979('0x1a')](_0x29c8a0);return _0xc4a5dd[_0xf979('0x1f')](_0xf979('0x20'),_0xcfad7c+'-'+_0x31a782+'/'+_0x237559)[_0xf979('0x21')](_0x4c0b38);}return null;};}function patchUpdates(_0x3be144){return function(_0x5131c1){try{jsonpatch[_0xf979('0x22')](_0x5131c1,_0x3be144,!![]);}catch(_0x2042e3){return BPromise[_0xf979('0x23')](_0x2042e3);}return _0x5131c1['save']();};}function saveUpdates(_0x45c3a0,_0x2ffbff){return function(_0x22ba64){if(_0x22ba64){return _0x22ba64[_0xf979('0x24')](_0x45c3a0)['then'](function(_0x2da73c){return _0x2da73c;});}return null;};}function removeEntity(_0x34de39,_0x2c1a82){return function(_0x2d6fe6){if(_0x2d6fe6){return _0x2d6fe6[_0xf979('0x25')]()[_0xf979('0x26')](function(){_0x34de39[_0xf979('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x267423,_0x16ef6b){return function(_0xad73d5){if(!_0xad73d5){_0x267423['sendStatus'](0x194);}return _0xad73d5;};}function handleError(_0x28b9af,_0x3bc97d){_0x3bc97d=_0x3bc97d||0x1f4;return function(_0x18d550){logger[_0xf979('0x27')](_0x18d550[_0xf979('0x28')]);if(_0x18d550[_0xf979('0x29')]){delete _0x18d550[_0xf979('0x29')];}_0x28b9af[_0xf979('0x1a')](_0x3bc97d)[_0xf979('0x2a')](_0x18d550);};}exports[_0xf979('0x2b')]=function(_0x50803a,_0x21d624){var _0x1c4916={},_0x45e896={},_0x39ef7c={'count':0x0,'rows':[]};var _0x1d8681=_[_0xf979('0x2c')](db[_0xf979('0x2d')][_0xf979('0x2e')],function(_0xfbd4c3){return{'name':_0xfbd4c3[_0xf979('0x2f')],'type':_0xfbd4c3[_0xf979('0x30')][_0xf979('0x31')]};});_0x45e896[_0xf979('0x32')]=_[_0xf979('0x2c')](_0x1d8681,_0xf979('0x29'));_0x45e896[_0xf979('0x33')]=_['keys'](_0x50803a[_0xf979('0x33')]);_0x45e896[_0xf979('0x34')]=_['intersection'](_0x45e896[_0xf979('0x32')],_0x45e896['query']);_0x1c4916[_0xf979('0x35')]=_[_0xf979('0x36')](_0x45e896['model'],qs['fields'](_0x50803a[_0xf979('0x33')][_0xf979('0x37')]));_0x1c4916[_0xf979('0x35')]=_0x1c4916[_0xf979('0x35')][_0xf979('0x38')]?_0x1c4916[_0xf979('0x35')]:_0x45e896[_0xf979('0x32')];if(!_0x50803a[_0xf979('0x33')]['hasOwnProperty'](_0xf979('0x39'))){_0x1c4916[_0xf979('0x1e')]=qs[_0xf979('0x1e')](_0x50803a['query'][_0xf979('0x1e')]);_0x1c4916['offset']=qs['offset'](_0x50803a[_0xf979('0x33')]['offset']);}_0x1c4916[_0xf979('0x3a')]=qs[_0xf979('0x3b')](_0x50803a['query'][_0xf979('0x3b')]);_0x1c4916['where']=qs[_0xf979('0x34')](_[_0xf979('0x3c')](_0x50803a[_0xf979('0x33')],_0x45e896[_0xf979('0x34')]));if(_0x50803a['query'][_0xf979('0x3d')]){_0x1c4916[_0xf979('0x3e')]=_[_0xf979('0x3f')](_0x1c4916[_0xf979('0x3e')],{'$or':_[_0xf979('0x2c')](_0x1d8681,function(_0xf9f934){if(_0xf9f934[_0xf979('0x30')][_0xf979('0x31')]!==_0xf979('0x40')){var _0x35aa0d={};_0x35aa0d[_0xf9f934[_0xf979('0x41')]]={'$like':'%'+_0x50803a[_0xf979('0x33')][_0xf979('0x3d')]+'%'};return _0x35aa0d;}})});}_0x1c4916=_['merge']({},_0x1c4916,_0x50803a[_0xf979('0x42')]);var _0x3de093={'where':_0x1c4916[_0xf979('0x3e')]};return db[_0xf979('0x2d')]['count'](_0x3de093)[_0xf979('0x26')](function(_0x50c83d){_0x39ef7c[_0xf979('0x1c')]=_0x50c83d;if(_0x50803a[_0xf979('0x33')]['includeAll']){_0x1c4916[_0xf979('0x43')]=[{'all':!![]}];}return db[_0xf979('0x2d')][_0xf979('0x44')](_0x1c4916);})['then'](function(_0x28976a){_0x39ef7c['rows']=_0x28976a;return _0x39ef7c;})[_0xf979('0x26')](respondWithFilteredResult(_0x21d624,_0x1c4916))[_0xf979('0x45')](handleError(_0x21d624,null));};exports['show']=function(_0x2ffceb,_0x1fd479){var _0xa05e33={'raw':!![],'where':{'id':_0x2ffceb[_0xf979('0x46')]['id']}},_0x542a46={};_0x542a46[_0xf979('0x32')]=_[_0xf979('0x47')](db[_0xf979('0x2d')][_0xf979('0x2e')]);_0x542a46[_0xf979('0x33')]=_[_0xf979('0x47')](_0x2ffceb[_0xf979('0x33')]);_0x542a46['filters']=_[_0xf979('0x36')](_0x542a46[_0xf979('0x32')],_0x542a46['query']);_0xa05e33['attributes']=_[_0xf979('0x36')](_0x542a46[_0xf979('0x32')],qs[_0xf979('0x37')](_0x2ffceb[_0xf979('0x33')][_0xf979('0x37')]));_0xa05e33[_0xf979('0x35')]=_0xa05e33[_0xf979('0x35')][_0xf979('0x38')]?_0xa05e33['attributes']:_0x542a46[_0xf979('0x32')];if(_0x2ffceb[_0xf979('0x33')][_0xf979('0x48')]){_0xa05e33['include']=[{'all':!![]}];}_0xa05e33=_['merge']({},_0xa05e33,_0x2ffceb[_0xf979('0x42')]);return db[_0xf979('0x2d')][_0xf979('0x49')](_0xa05e33)[_0xf979('0x26')](handleEntityNotFound(_0x1fd479,null))['then'](respondWithResult(_0x1fd479,null))['catch'](handleError(_0x1fd479,null));};exports[_0xf979('0x4a')]=function(_0x314872,_0x2ea010){return db['ZendeskField'][_0xf979('0x4a')](_0x314872[_0xf979('0x4b')],{})[_0xf979('0x26')](respondWithResult(_0x2ea010,0xc9))[_0xf979('0x45')](handleError(_0x2ea010,null));};exports['update']=function(_0x1e5334,_0x4310e1){if(_0x1e5334['body']['id']){delete _0x1e5334['body']['id'];}return db['ZendeskField'][_0xf979('0x49')]({'where':{'id':_0x1e5334[_0xf979('0x46')]['id']}})[_0xf979('0x26')](handleEntityNotFound(_0x4310e1,null))['then'](saveUpdates(_0x1e5334[_0xf979('0x4b')],null))[_0xf979('0x26')](respondWithResult(_0x4310e1,null))[_0xf979('0x45')](handleError(_0x4310e1,null));};exports['destroy']=function(_0x73d02a,_0x9fbbe4){return db['ZendeskField'][_0xf979('0x49')]({'where':{'id':_0x73d02a[_0xf979('0x46')]['id']}})[_0xf979('0x26')](handleEntityNotFound(_0x9fbbe4,null))['then'](removeEntity(_0x9fbbe4,null))[_0xf979('0x45')](handleError(_0x9fbbe4,null));}; \ No newline at end of file +var _0xa25f=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','count','offset','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','index','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','limit','sort','where','filter','merge','VIRTUAL','field','options','includeAll','include','ZendeskField','catch','show','params','find','create','body','destroy','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel'];(function(_0x33e0a6,_0x464abd){var _0x1b9c65=function(_0x3efdb1){while(--_0x3efdb1){_0x33e0a6['push'](_0x33e0a6['shift']());}};_0x1b9c65(++_0x464abd);}(_0xa25f,0x1d2));var _0xfa25=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa25f[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xfa25('0x0'));var emlformat=require(_0xfa25('0x1'));var rimraf=require(_0xfa25('0x2'));var zipdir=require(_0xfa25('0x3'));var jsonpatch=require(_0xfa25('0x4'));var rp=require(_0xfa25('0x5'));var moment=require(_0xfa25('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xfa25('0x7'));var util=require(_0xfa25('0x8'));var path=require(_0xfa25('0x9'));var sox=require(_0xfa25('0xa'));var csv=require(_0xfa25('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xfa25('0xc'));var squel=require(_0xfa25('0xd'));var crypto=require(_0xfa25('0xe'));var jsforce=require(_0xfa25('0xf'));var deskjs=require(_0xfa25('0x10'));var toCsv=require(_0xfa25('0xb'));var querystring=require(_0xfa25('0x11'));var Papa=require(_0xfa25('0x12'));var Redis=require(_0xfa25('0x13'));var authService=require(_0xfa25('0x14'));var qs=require(_0xfa25('0x15'));var as=require(_0xfa25('0x16'));var hardwareService=require(_0xfa25('0x17'));var logger=require(_0xfa25('0x18'))(_0xfa25('0x19'));var utils=require(_0xfa25('0x1a'));var config=require(_0xfa25('0x1b'));var db=require(_0xfa25('0x1c'))['db'];function respondWithStatusCode(_0x1b9cad,_0x1dc97e){_0x1dc97e=_0x1dc97e||0xcc;return function(_0x2b420a){if(_0x2b420a){return _0x1b9cad[_0xfa25('0x1d')](_0x1dc97e);}return _0x1b9cad['status'](_0x1dc97e)[_0xfa25('0x1e')]();};}function respondWithResult(_0x442de6,_0x22b485){_0x22b485=_0x22b485||0xc8;return function(_0x30f883){if(_0x30f883){return _0x442de6[_0xfa25('0x1f')](_0x22b485)['json'](_0x30f883);}};}function respondWithFilteredResult(_0x31639d,_0x55b70e){return function(_0x160c53){if(_0x160c53){var _0xbd060=_0x160c53[_0xfa25('0x20')],_0x426492=_0x55b70e[_0xfa25('0x21')],_0x50757f=_0x55b70e[_0xfa25('0x21')]+_0x55b70e['limit'],_0x4a211a;if(_0x50757f>=_0xbd060){_0x50757f=_0xbd060;_0x4a211a=0xc8;}else{_0x4a211a=0xce;}_0x31639d[_0xfa25('0x1f')](_0x4a211a);return _0x31639d[_0xfa25('0x22')](_0xfa25('0x23'),_0x426492+'-'+_0x50757f+'/'+_0xbd060)[_0xfa25('0x24')](_0x160c53);}return null;};}function patchUpdates(_0x1bd9e3){return function(_0x57285c){try{jsonpatch[_0xfa25('0x25')](_0x57285c,_0x1bd9e3,!![]);}catch(_0x52afe3){return BPromise[_0xfa25('0x26')](_0x52afe3);}return _0x57285c[_0xfa25('0x27')]();};}function saveUpdates(_0x51a729,_0x511b77){return function(_0x72bc5d){if(_0x72bc5d){return _0x72bc5d[_0xfa25('0x28')](_0x51a729)[_0xfa25('0x29')](function(_0x3a6652){return _0x3a6652;});}return null;};}function removeEntity(_0xf497a1,_0x3ed451){return function(_0x998ce2){if(_0x998ce2){return _0x998ce2['destroy']()[_0xfa25('0x29')](function(){_0xf497a1[_0xfa25('0x1f')](0xcc)[_0xfa25('0x1e')]();});}};}function handleEntityNotFound(_0xe89134,_0x247fc1){return function(_0x1a8aa6){if(!_0x1a8aa6){_0xe89134['sendStatus'](0x194);}return _0x1a8aa6;};}function handleError(_0x46ecf3,_0x298312){_0x298312=_0x298312||0x1f4;return function(_0xbcf756){logger[_0xfa25('0x2a')](_0xbcf756[_0xfa25('0x2b')]);if(_0xbcf756[_0xfa25('0x2c')]){delete _0xbcf756[_0xfa25('0x2c')];}_0x46ecf3[_0xfa25('0x1f')](_0x298312)[_0xfa25('0x2d')](_0xbcf756);};}exports[_0xfa25('0x2e')]=function(_0x4c944b,_0xae7305){var _0x11c19b={},_0x593845={},_0x184274={'count':0x0,'rows':[]};var _0x16755b=_['map'](db['ZendeskField'][_0xfa25('0x2f')],function(_0x73603c){return{'name':_0x73603c[_0xfa25('0x30')],'type':_0x73603c[_0xfa25('0x31')][_0xfa25('0x32')]};});_0x593845['model']=_[_0xfa25('0x33')](_0x16755b,'name');_0x593845[_0xfa25('0x34')]=_[_0xfa25('0x35')](_0x4c944b[_0xfa25('0x34')]);_0x593845[_0xfa25('0x36')]=_[_0xfa25('0x37')](_0x593845['model'],_0x593845['query']);_0x11c19b[_0xfa25('0x38')]=_[_0xfa25('0x37')](_0x593845[_0xfa25('0x39')],qs[_0xfa25('0x3a')](_0x4c944b[_0xfa25('0x34')][_0xfa25('0x3a')]));_0x11c19b[_0xfa25('0x38')]=_0x11c19b[_0xfa25('0x38')][_0xfa25('0x3b')]?_0x11c19b[_0xfa25('0x38')]:_0x593845[_0xfa25('0x39')];if(!_0x4c944b['query'][_0xfa25('0x3c')](_0xfa25('0x3d'))){_0x11c19b[_0xfa25('0x3e')]=qs[_0xfa25('0x3e')](_0x4c944b[_0xfa25('0x34')][_0xfa25('0x3e')]);_0x11c19b[_0xfa25('0x21')]=qs['offset'](_0x4c944b[_0xfa25('0x34')][_0xfa25('0x21')]);}_0x11c19b['order']=qs[_0xfa25('0x3f')](_0x4c944b[_0xfa25('0x34')][_0xfa25('0x3f')]);_0x11c19b[_0xfa25('0x40')]=qs[_0xfa25('0x36')](_['pick'](_0x4c944b[_0xfa25('0x34')],_0x593845[_0xfa25('0x36')]));if(_0x4c944b[_0xfa25('0x34')][_0xfa25('0x41')]){_0x11c19b[_0xfa25('0x40')]=_[_0xfa25('0x42')](_0x11c19b['where'],{'$or':_[_0xfa25('0x33')](_0x16755b,function(_0x30d05e){if(_0x30d05e[_0xfa25('0x31')][_0xfa25('0x32')]!==_0xfa25('0x43')){var _0x4fddd1={};_0x4fddd1[_0x30d05e[_0xfa25('0x44')]]={'$like':'%'+_0x4c944b[_0xfa25('0x34')]['filter']+'%'};return _0x4fddd1;}})});}_0x11c19b=_[_0xfa25('0x42')]({},_0x11c19b,_0x4c944b[_0xfa25('0x45')]);var _0x1397de={'where':_0x11c19b[_0xfa25('0x40')]};return db['ZendeskField'][_0xfa25('0x20')](_0x1397de)['then'](function(_0x3af9bc){_0x184274[_0xfa25('0x20')]=_0x3af9bc;if(_0x4c944b[_0xfa25('0x34')][_0xfa25('0x46')]){_0x11c19b[_0xfa25('0x47')]=[{'all':!![]}];}return db[_0xfa25('0x48')]['findAll'](_0x11c19b);})[_0xfa25('0x29')](function(_0x92692e){_0x184274['rows']=_0x92692e;return _0x184274;})[_0xfa25('0x29')](respondWithFilteredResult(_0xae7305,_0x11c19b))[_0xfa25('0x49')](handleError(_0xae7305,null));};exports[_0xfa25('0x4a')]=function(_0x4ed3e7,_0x576a1b){var _0xd8443b={'raw':!![],'where':{'id':_0x4ed3e7[_0xfa25('0x4b')]['id']}},_0x15b4eb={};_0x15b4eb[_0xfa25('0x39')]=_['keys'](db['ZendeskField'][_0xfa25('0x2f')]);_0x15b4eb[_0xfa25('0x34')]=_[_0xfa25('0x35')](_0x4ed3e7[_0xfa25('0x34')]);_0x15b4eb[_0xfa25('0x36')]=_[_0xfa25('0x37')](_0x15b4eb[_0xfa25('0x39')],_0x15b4eb[_0xfa25('0x34')]);_0xd8443b['attributes']=_[_0xfa25('0x37')](_0x15b4eb[_0xfa25('0x39')],qs[_0xfa25('0x3a')](_0x4ed3e7[_0xfa25('0x34')]['fields']));_0xd8443b[_0xfa25('0x38')]=_0xd8443b[_0xfa25('0x38')][_0xfa25('0x3b')]?_0xd8443b['attributes']:_0x15b4eb[_0xfa25('0x39')];if(_0x4ed3e7[_0xfa25('0x34')]['includeAll']){_0xd8443b[_0xfa25('0x47')]=[{'all':!![]}];}_0xd8443b=_[_0xfa25('0x42')]({},_0xd8443b,_0x4ed3e7[_0xfa25('0x45')]);return db[_0xfa25('0x48')][_0xfa25('0x4c')](_0xd8443b)['then'](handleEntityNotFound(_0x576a1b,null))[_0xfa25('0x29')](respondWithResult(_0x576a1b,null))[_0xfa25('0x49')](handleError(_0x576a1b,null));};exports['create']=function(_0x2b8b0d,_0x4bff81){return db[_0xfa25('0x48')][_0xfa25('0x4d')](_0x2b8b0d['body'],{})['then'](respondWithResult(_0x4bff81,0xc9))['catch'](handleError(_0x4bff81,null));};exports[_0xfa25('0x28')]=function(_0x29a013,_0x1789ac){if(_0x29a013[_0xfa25('0x4e')]['id']){delete _0x29a013[_0xfa25('0x4e')]['id'];}return db[_0xfa25('0x48')][_0xfa25('0x4c')]({'where':{'id':_0x29a013[_0xfa25('0x4b')]['id']}})[_0xfa25('0x29')](handleEntityNotFound(_0x1789ac,null))[_0xfa25('0x29')](saveUpdates(_0x29a013[_0xfa25('0x4e')],null))[_0xfa25('0x29')](respondWithResult(_0x1789ac,null))[_0xfa25('0x49')](handleError(_0x1789ac,null));};exports[_0xfa25('0x4f')]=function(_0x181ae3,_0x104955){return db[_0xfa25('0x48')][_0xfa25('0x4c')]({'where':{'id':_0x181ae3[_0xfa25('0x4b')]['id']}})[_0xfa25('0x29')](handleEntityNotFound(_0x104955,null))[_0xfa25('0x29')](removeEntity(_0x104955,null))['catch'](handleError(_0x104955,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 14a4ee7..a5fac9d 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 _0x34b2=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskField.attributes','exports','int_zendesk_fields','zendesk_unique_index','idField','FieldId','lodash','util','../../config/logger','api'];(function(_0x135573,_0x479526){var _0x13ea56=function(_0x49c990){while(--_0x49c990){_0x135573['push'](_0x135573['shift']());}};_0x13ea56(++_0x479526);}(_0x34b2,0x11c));var _0x234b=function(_0xcad01d,_0xef9abc){_0xcad01d=_0xcad01d-0x0;var _0x76a4a6=_0x34b2[_0xcad01d];return _0x76a4a6;};'use strict';var _=require(_0x234b('0x0'));var util=require(_0x234b('0x1'));var logger=require(_0x234b('0x2'))(_0x234b('0x3'));var moment=require(_0x234b('0x4'));var BPromise=require(_0x234b('0x5'));var rp=require(_0x234b('0x6'));var fs=require('fs');var path=require(_0x234b('0x7'));var rimraf=require(_0x234b('0x8'));var config=require(_0x234b('0x9'));var attributes=require(_0x234b('0xa'));module[_0x234b('0xb')]=function(_0x412014,_0x4e814f){return _0x412014['define']('ZendeskField',attributes,{'tableName':_0x234b('0xc'),'paranoid':![],'indexes':[{'name':_0x234b('0xd'),'fields':[_0x234b('0xe'),_0x234b('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2948=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intZendeskField.attributes','define','FieldId','lodash'];(function(_0x36e7c0,_0x270d77){var _0xbab3f1=function(_0x4bcb5d){while(--_0x4bcb5d){_0x36e7c0['push'](_0x36e7c0['shift']());}};_0xbab3f1(++_0x270d77);}(_0x2948,0xcb));var _0x8294=function(_0x445e25,_0x341651){_0x445e25=_0x445e25-0x0;var _0x40eb53=_0x2948[_0x445e25];return _0x40eb53;};'use strict';var _=require(_0x8294('0x0'));var util=require(_0x8294('0x1'));var logger=require(_0x8294('0x2'))(_0x8294('0x3'));var moment=require(_0x8294('0x4'));var BPromise=require(_0x8294('0x5'));var rp=require(_0x8294('0x6'));var fs=require('fs');var path=require(_0x8294('0x7'));var rimraf=require(_0x8294('0x8'));var config=require('../../config/environment');var attributes=require(_0x8294('0x9'));module['exports']=function(_0x11c415,_0x26128c){return _0x11c415[_0x8294('0xa')]('ZendeskField',attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':['idField',_0x8294('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.rpc.js b/server/api/intZendeskField/intZendeskField.rpc.js index f2fb783..f25d0a3 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 _0x1829=['stringify','error','message','info','ZendeskField,\x20%s,\x20%s','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','http','request','then','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0x1829,0x132));var _0x9182=function(_0x4ae829,_0x2c842c){_0x4ae829=_0x4ae829-0x0;var _0x256b31=_0x1829[_0x4ae829];return _0x256b31;};'use strict';var _=require(_0x9182('0x0'));var util=require(_0x9182('0x1'));var moment=require(_0x9182('0x2'));var BPromise=require(_0x9182('0x3'));var rs=require(_0x9182('0x4'));var fs=require('fs');var Redis=require(_0x9182('0x5'));var db=require(_0x9182('0x6'))['db'];var utils=require(_0x9182('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x9182('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x474e42,_0x297c98,_0xa71656){return new BPromise(function(_0x3b27c6,_0x2615b9){return client[_0x9182('0x9')](_0x474e42,_0xa71656)[_0x9182('0xa')](function(_0x1f7b57){logger['info']('ZendeskField,\x20%s,\x20%s',_0x297c98,_0x9182('0xb'));logger[_0x9182('0xc')](_0x9182('0xd'),_0x297c98,_0x9182('0xb'),JSON[_0x9182('0xe')](_0x1f7b57));if(_0x1f7b57[_0x9182('0xf')]){if(_0x1f7b57[_0x9182('0xf')]['code']===0x1f4){logger[_0x9182('0xf')]('ZendeskField,\x20%s,\x20%s',_0x297c98,_0x1f7b57[_0x9182('0xf')][_0x9182('0x10')]);return _0x2615b9(_0x1f7b57[_0x9182('0xf')][_0x9182('0x10')]);}logger[_0x9182('0xf')]('ZendeskField,\x20%s,\x20%s',_0x297c98,_0x1f7b57[_0x9182('0xf')][_0x9182('0x10')]);return _0x3b27c6(_0x1f7b57[_0x9182('0xf')][_0x9182('0x10')]);}else{logger[_0x9182('0x11')](_0x9182('0x12'),_0x297c98,'request\x20sent');_0x3b27c6(_0x1f7b57[_0x9182('0x13')][_0x9182('0x10')]);}})['catch'](function(_0x4b4a54){logger[_0x9182('0xf')](_0x9182('0x12'),_0x297c98,_0x4b4a54);_0x2615b9(_0x4b4a54);});});} \ No newline at end of file +var _0xcd57=['../../config/environment','http','request','info','ZendeskField,\x20%s,\x20%s','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x1af482,_0x1af5b7){var _0x7e7580=function(_0x5ed4a7){while(--_0x5ed4a7){_0x1af482['push'](_0x1af482['shift']());}};_0x7e7580(++_0x1af5b7);}(_0xcd57,0x163));var _0x7cd5=function(_0x74745d,_0x177606){_0x74745d=_0x74745d-0x0;var _0x174ab3=_0xcd57[_0x74745d];return _0x174ab3;};'use strict';var _=require('lodash');var util=require(_0x7cd5('0x0'));var moment=require(_0x7cd5('0x1'));var BPromise=require(_0x7cd5('0x2'));var rs=require(_0x7cd5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7cd5('0x4'))['db'];var utils=require(_0x7cd5('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x7cd5('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7cd5('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5f2053,_0x4fe8db,_0x1a35ce){return new BPromise(function(_0x26bf04,_0x49f416){return client[_0x7cd5('0x8')](_0x5f2053,_0x1a35ce)['then'](function(_0x19a335){logger[_0x7cd5('0x9')](_0x7cd5('0xa'),_0x4fe8db,'request\x20sent');logger['debug'](_0x7cd5('0xb'),_0x4fe8db,'request\x20sent',JSON[_0x7cd5('0xc')](_0x19a335));if(_0x19a335[_0x7cd5('0xd')]){if(_0x19a335[_0x7cd5('0xd')][_0x7cd5('0xe')]===0x1f4){logger[_0x7cd5('0xd')](_0x7cd5('0xa'),_0x4fe8db,_0x19a335[_0x7cd5('0xd')]['message']);return _0x49f416(_0x19a335[_0x7cd5('0xd')][_0x7cd5('0xf')]);}logger[_0x7cd5('0xd')](_0x7cd5('0xa'),_0x4fe8db,_0x19a335[_0x7cd5('0xd')][_0x7cd5('0xf')]);return _0x26bf04(_0x19a335[_0x7cd5('0xd')]['message']);}else{logger[_0x7cd5('0x9')](_0x7cd5('0xa'),_0x4fe8db,_0x7cd5('0x10'));_0x26bf04(_0x19a335[_0x7cd5('0x11')][_0x7cd5('0xf')]);}})[_0x7cd5('0x12')](function(_0x1ac22c){logger[_0x7cd5('0xd')]('ZendeskField,\x20%s,\x20%s',_0x4fe8db,_0x1ac22c);_0x49f416(_0x1ac22c);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 1c43bc0..098f7d6 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 _0x4f28=['show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','/:id','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index'];(function(_0x16fda5,_0x2443f3){var _0x5d0af5=function(_0x104730){while(--_0x104730){_0x16fda5['push'](_0x16fda5['shift']());}};_0x5d0af5(++_0x2443f3);}(_0x4f28,0x1d5));var _0x84f2=function(_0x5ad190,_0xd39c9e){_0x5ad190=_0x5ad190-0x0;var _0x518ed3=_0x4f28[_0x5ad190];return _0x518ed3;};'use strict';var multer=require(_0x84f2('0x0'));var util=require(_0x84f2('0x1'));var path=require(_0x84f2('0x2'));var timeout=require('connect-timeout');var express=require(_0x84f2('0x3'));var router=express[_0x84f2('0x4')]();var auth=require(_0x84f2('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x84f2('0x6'));var controller=require(_0x84f2('0x7'));router[_0x84f2('0x8')]('/',auth[_0x84f2('0x9')](),controller[_0x84f2('0xa')]);router[_0x84f2('0x8')]('/:id',auth[_0x84f2('0x9')](),controller[_0x84f2('0xb')]);router[_0x84f2('0x8')](_0x84f2('0xc'),auth[_0x84f2('0x9')](),controller[_0x84f2('0xd')]);router['get'](_0x84f2('0xe'),auth['isAuthenticated'](),controller['getFields']);router[_0x84f2('0xf')]('/',auth[_0x84f2('0x9')](),controller[_0x84f2('0x10')]);router[_0x84f2('0xf')](_0x84f2('0xc'),auth[_0x84f2('0x9')](),controller[_0x84f2('0x11')]);router[_0x84f2('0x12')](_0x84f2('0x13'),auth[_0x84f2('0x9')](),controller[_0x84f2('0x14')]);router[_0x84f2('0x15')]('/:id',auth[_0x84f2('0x9')](),controller[_0x84f2('0x16')]);module[_0x84f2('0x17')]=router; \ No newline at end of file +var _0xb25c=['delete','/:id','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./intZohoAccount.controller','get','isAuthenticated','/:id/configurations','getConfigurations','getFields','create','put'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb25c,0xb7));var _0xcb25=function(_0x5f4139,_0x4d38b2){_0x5f4139=_0x5f4139-0x0;var _0x30a26c=_0xb25c[_0x5f4139];return _0x30a26c;};'use strict';var multer=require(_0xcb25('0x0'));var util=require(_0xcb25('0x1'));var path=require(_0xcb25('0x2'));var timeout=require(_0xcb25('0x3'));var express=require(_0xcb25('0x4'));var router=express[_0xcb25('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xcb25('0x6'));var config=require('../../config/environment');var controller=require(_0xcb25('0x7'));router[_0xcb25('0x8')]('/',auth[_0xcb25('0x9')](),controller['index']);router[_0xcb25('0x8')]('/:id',auth[_0xcb25('0x9')](),controller['show']);router[_0xcb25('0x8')](_0xcb25('0xa'),auth[_0xcb25('0x9')](),controller[_0xcb25('0xb')]);router[_0xcb25('0x8')]('/:id/fields',auth[_0xcb25('0x9')](),controller[_0xcb25('0xc')]);router['post']('/',auth[_0xcb25('0x9')](),controller[_0xcb25('0xd')]);router['post'](_0xcb25('0xa'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0xcb25('0xe')]('/:id',auth[_0xcb25('0x9')](),controller['update']);router[_0xcb25('0xf')](_0xcb25('0x10'),auth[_0xcb25('0x9')](),controller['destroy']);module[_0xcb25('0x11')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index a341262..7da16b2 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 _0x3d2e=['STRING','sequelize'];(function(_0x26b8f1,_0x12d1e5){var _0x15de33=function(_0x286e1a){while(--_0x286e1a){_0x26b8f1['push'](_0x26b8f1['shift']());}};_0x15de33(++_0x12d1e5);}(_0x3d2e,0x199));var _0xe3d2=function(_0x358575,_0x36fe9b){_0x358575=_0x358575-0x0;var _0x44962b=_0x3d2e[_0x358575];return _0x44962b;};'use strict';var Sequelize=require(_0xe3d2('0x0'));module['exports']={'name':{'type':Sequelize[_0xe3d2('0x1')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xe3d2('0x1')]},'zone':{'type':Sequelize[_0xe3d2('0x1')]},'clientId':{'type':Sequelize[_0xe3d2('0x1')]},'clientSecret':{'type':Sequelize[_0xe3d2('0x1')]},'serverUrl':{'type':Sequelize['STRING']},'code':{'type':Sequelize[_0xe3d2('0x1')]},'refreshToken':{'type':Sequelize[_0xe3d2('0x1')]}}; \ No newline at end of file +var _0xc0e9=['exports','STRING'];(function(_0x12ee25,_0x5c9798){var _0x1cb510=function(_0x521274){while(--_0x521274){_0x12ee25['push'](_0x12ee25['shift']());}};_0x1cb510(++_0x5c9798);}(_0xc0e9,0xbc));var _0x9c0e=function(_0x58f792,_0x5aa5f7){_0x58f792=_0x58f792-0x0;var _0x328c0c=_0xc0e9[_0x58f792];return _0x328c0c;};'use strict';var Sequelize=require('sequelize');module[_0x9c0e('0x0')]={'name':{'type':Sequelize[_0x9c0e('0x1')]},'description':{'type':Sequelize[_0x9c0e('0x1')]},'host':{'type':Sequelize[_0x9c0e('0x1')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x9c0e('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x9c0e('0x1')]},'code':{'type':Sequelize[_0x9c0e('0x1')]},'refreshToken':{'type':Sequelize[_0x9c0e('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index bfc2136..283608c 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 _0xa143=['https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','clientSecret','refresh_token','access_token','getFields','host','zone','clientId','serverUrl','refreshToken','zoho.eu','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','Subject','Call_Duration','Call_Result','Call_Start_Time','includes','system_mandatory','push','display_label','custom_field','data_type','pick_list_values','statusCode','getFields,\x20%s,\x20%s,\x20%s','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../components/integrations/configuration','jayson/promise','http','test','then','info','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoAccount,\x20%s,\x20%s','message','result','sendStatus','status','end','offset','limit','set','Content-Range','apply','reject','save','update','name','send','index','map','ZohoAccount','rawAttributes','type','key','keys','filters','model','attributes','intersection','query','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','field','options','count','includeAll','include','findAll','rows','catch','show','length','find','create','body','params','getConfigurations','ZohoConfiguration','order','addConfiguration','findOne','AccountId','Subjects','getSubjects','getDescriptions','channel','ZohoField','Descriptions','https://accounts.zoho.com.au','https://accounts.zoho.eu'];(function(_0x44b212,_0xa92197){var _0x1d4edc=function(_0x3d293a){while(--_0x3d293a){_0x44b212['push'](_0x44b212['shift']());}};_0x1d4edc(++_0xa92197);}(_0xa143,0x1bc));var _0x3a14=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xa143[_0x40a045];return _0x1a687c;};'use strict';var pdf=require(_0x3a14('0x0'));var emlformat=require(_0x3a14('0x1'));var rimraf=require(_0x3a14('0x2'));var zipdir=require(_0x3a14('0x3'));var jsonpatch=require(_0x3a14('0x4'));var rp=require(_0x3a14('0x5'));var moment=require(_0x3a14('0x6'));var BPromise=require(_0x3a14('0x7'));var Mustache=require(_0x3a14('0x8'));var util=require('util');var path=require(_0x3a14('0x9'));var sox=require('sox');var csv=require(_0x3a14('0xa'));var ejs=require(_0x3a14('0xb'));var fs=require('fs');var _=require(_0x3a14('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3a14('0xd'));var deskjs=require(_0x3a14('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3a14('0xf'));var Papa=require('papaparse');var Redis=require(_0x3a14('0x10'));var authService=require(_0x3a14('0x11'));var qs=require(_0x3a14('0x12'));var as=require(_0x3a14('0x13'));var hardwareService=require(_0x3a14('0x14'));var logger=require('../../config/logger')(_0x3a14('0x15'));var utils=require('../../config/utils');var config=require(_0x3a14('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0x3a14('0x17'));var jayson=require(_0x3a14('0x18'));var client=jayson['client'][_0x3a14('0x19')]({'port':0x232a});function checkPasswordPattern(_0x1c80ca,_0x11ef67,_0x554b4f){if(_0x554b4f){var _0x513ebf=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x513ebf[_0x3a14('0x1a')](_0x11ef67)){return _0x1c80ca;}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 _0x1c80ca;}}function respondWithRpcPromise(_0xff4ac9,_0x4f2e32,_0xefc480,_0x2e0dee){return new BPromise(function(_0x4985af,_0x5d4dd1){var _0x5b0f60=_0x2e0dee||client;return _0x5b0f60['request'](_0xff4ac9,_0xefc480)[_0x3a14('0x1b')](function(_0x26e3cb){logger[_0x3a14('0x1c')]('ZohoAccount,\x20%s,\x20%s',_0x4f2e32,_0x3a14('0x1d'));logger[_0x3a14('0x1e')](_0x3a14('0x1f'),_0x4f2e32,_0x3a14('0x1d'),JSON[_0x3a14('0x20')](_0x26e3cb));if(_0x26e3cb[_0x3a14('0x21')]){if(_0x26e3cb['error'][_0x3a14('0x22')]===0x1f4){logger[_0x3a14('0x21')](_0x3a14('0x23'),_0x4f2e32,_0x26e3cb[_0x3a14('0x21')][_0x3a14('0x24')]);return _0x5d4dd1(_0x26e3cb[_0x3a14('0x21')][_0x3a14('0x24')]);}logger[_0x3a14('0x21')](_0x3a14('0x23'),_0x4f2e32,_0x26e3cb[_0x3a14('0x21')][_0x3a14('0x24')]);return _0x4985af(_0x26e3cb[_0x3a14('0x21')][_0x3a14('0x24')]);}else{logger[_0x3a14('0x1c')](_0x3a14('0x23'),_0x4f2e32,'request\x20sent');_0x4985af(_0x26e3cb[_0x3a14('0x25')][_0x3a14('0x24')]);}})['catch'](function(_0x3c1601){logger[_0x3a14('0x21')](_0x3a14('0x23'),_0x4f2e32,_0x3c1601);_0x5d4dd1(_0x3c1601);});});}function respondWithStatusCode(_0x16ead6,_0x196657){_0x196657=_0x196657||0xcc;return function(_0x533a12){if(_0x533a12){return _0x16ead6[_0x3a14('0x26')](_0x196657);}return _0x16ead6[_0x3a14('0x27')](_0x196657)[_0x3a14('0x28')]();};}function respondWithResult(_0x4f99ca,_0x35db96){_0x35db96=_0x35db96||0xc8;return function(_0x131b34){if(_0x131b34){return _0x4f99ca[_0x3a14('0x27')](_0x35db96)['json'](_0x131b34);}};}function respondWithFilteredResult(_0x3b28ef,_0x119bd1){return function(_0x48ac96){if(_0x48ac96){var _0x1b6fc7=_0x48ac96['count'],_0x1eb6d1=_0x119bd1[_0x3a14('0x29')],_0x5368ca=_0x119bd1[_0x3a14('0x29')]+_0x119bd1[_0x3a14('0x2a')],_0x211641;if(_0x5368ca>=_0x1b6fc7){_0x5368ca=_0x1b6fc7;_0x211641=0xc8;}else{_0x211641=0xce;}_0x3b28ef[_0x3a14('0x27')](_0x211641);return _0x3b28ef[_0x3a14('0x2b')](_0x3a14('0x2c'),_0x1eb6d1+'-'+_0x5368ca+'/'+_0x1b6fc7)['json'](_0x48ac96);}return null;};}function patchUpdates(_0x512511){return function(_0x34b139){try{jsonpatch[_0x3a14('0x2d')](_0x34b139,_0x512511,!![]);}catch(_0xcd110e){return BPromise[_0x3a14('0x2e')](_0xcd110e);}return _0x34b139[_0x3a14('0x2f')]();};}function saveUpdates(_0x31af16,_0x4a5688){return function(_0x410a42){if(_0x410a42){return _0x410a42[_0x3a14('0x30')](_0x31af16)[_0x3a14('0x1b')](function(_0x1b6127){return _0x1b6127;});}return null;};}function removeEntity(_0x346e59,_0x2eebc4){return function(_0x46d4f5){if(_0x46d4f5){return _0x46d4f5['destroy']()[_0x3a14('0x1b')](function(){_0x346e59[_0x3a14('0x27')](0xcc)[_0x3a14('0x28')]();});}};}function handleEntityNotFound(_0xc30007,_0x328adb){return function(_0x4a25ec){if(!_0x4a25ec){_0xc30007['sendStatus'](0x194);}return _0x4a25ec;};}function handleError(_0x29be4b,_0x8c99d4){_0x8c99d4=_0x8c99d4||0x1f4;return function(_0x366564){logger[_0x3a14('0x21')](_0x366564['stack']);if(_0x366564[_0x3a14('0x31')]){delete _0x366564[_0x3a14('0x31')];}_0x29be4b['status'](_0x8c99d4)[_0x3a14('0x32')](_0x366564);};}exports[_0x3a14('0x33')]=function(_0x1df7b7,_0x439b72){var _0x3db9b7={},_0x20f132={},_0x5280b7={'count':0x0,'rows':[]};var _0x4e8173=_[_0x3a14('0x34')](db[_0x3a14('0x35')][_0x3a14('0x36')],function(_0x4756ec){return{'name':_0x4756ec['fieldName'],'type':_0x4756ec[_0x3a14('0x37')][_0x3a14('0x38')]};});_0x20f132['model']=_[_0x3a14('0x34')](_0x4e8173,_0x3a14('0x31'));_0x20f132['query']=_[_0x3a14('0x39')](_0x1df7b7['query']);_0x20f132[_0x3a14('0x3a')]=_['intersection'](_0x20f132[_0x3a14('0x3b')],_0x20f132['query']);_0x3db9b7[_0x3a14('0x3c')]=_[_0x3a14('0x3d')](_0x20f132[_0x3a14('0x3b')],qs['fields'](_0x1df7b7[_0x3a14('0x3e')][_0x3a14('0x3f')]));_0x3db9b7['attributes']=_0x3db9b7[_0x3a14('0x3c')]['length']?_0x3db9b7[_0x3a14('0x3c')]:_0x20f132[_0x3a14('0x3b')];if(!_0x1df7b7[_0x3a14('0x3e')][_0x3a14('0x40')](_0x3a14('0x41'))){_0x3db9b7[_0x3a14('0x2a')]=qs['limit'](_0x1df7b7[_0x3a14('0x3e')][_0x3a14('0x2a')]);_0x3db9b7[_0x3a14('0x29')]=qs['offset'](_0x1df7b7[_0x3a14('0x3e')]['offset']);}_0x3db9b7['order']=qs[_0x3a14('0x42')](_0x1df7b7[_0x3a14('0x3e')][_0x3a14('0x42')]);_0x3db9b7[_0x3a14('0x43')]=qs[_0x3a14('0x3a')](_[_0x3a14('0x44')](_0x1df7b7[_0x3a14('0x3e')],_0x20f132[_0x3a14('0x3a')]));if(_0x1df7b7['query'][_0x3a14('0x45')]){_0x3db9b7[_0x3a14('0x43')]=_[_0x3a14('0x46')](_0x3db9b7['where'],{'$or':_[_0x3a14('0x34')](_0x4e8173,function(_0x11126d){if(_0x11126d[_0x3a14('0x37')]['key']!==_0x3a14('0x47')){var _0x5bac22={};_0x5bac22[_0x11126d[_0x3a14('0x48')]]={'$like':'%'+_0x1df7b7[_0x3a14('0x3e')]['filter']+'%'};return _0x5bac22;}})});}_0x3db9b7=_[_0x3a14('0x46')]({},_0x3db9b7,_0x1df7b7[_0x3a14('0x49')]);var _0xedc88d={'where':_0x3db9b7[_0x3a14('0x43')]};return db[_0x3a14('0x35')][_0x3a14('0x4a')](_0xedc88d)[_0x3a14('0x1b')](function(_0x5331bc){_0x5280b7[_0x3a14('0x4a')]=_0x5331bc;if(_0x1df7b7[_0x3a14('0x3e')][_0x3a14('0x4b')]){_0x3db9b7[_0x3a14('0x4c')]=[{'all':!![]}];}return db['ZohoAccount'][_0x3a14('0x4d')](_0x3db9b7);})[_0x3a14('0x1b')](function(_0x5c08c2){_0x5280b7[_0x3a14('0x4e')]=_0x5c08c2;return _0x5280b7;})[_0x3a14('0x1b')](respondWithFilteredResult(_0x439b72,_0x3db9b7))[_0x3a14('0x4f')](handleError(_0x439b72,null));};exports[_0x3a14('0x50')]=function(_0xd69559,_0xe9772c){var _0x5b64b4={'raw':![],'where':{'id':_0xd69559['params']['id']}},_0x2dc35d={};_0x2dc35d[_0x3a14('0x3b')]=_[_0x3a14('0x39')](db[_0x3a14('0x35')][_0x3a14('0x36')]);_0x2dc35d[_0x3a14('0x3e')]=_[_0x3a14('0x39')](_0xd69559['query']);_0x2dc35d['filters']=_[_0x3a14('0x3d')](_0x2dc35d[_0x3a14('0x3b')],_0x2dc35d[_0x3a14('0x3e')]);_0x5b64b4[_0x3a14('0x3c')]=_['intersection'](_0x2dc35d['model'],qs[_0x3a14('0x3f')](_0xd69559[_0x3a14('0x3e')][_0x3a14('0x3f')]));_0x5b64b4['attributes']=_0x5b64b4[_0x3a14('0x3c')][_0x3a14('0x51')]?_0x5b64b4[_0x3a14('0x3c')]:_0x2dc35d[_0x3a14('0x3b')];if(_0xd69559[_0x3a14('0x3e')][_0x3a14('0x4b')]){_0x5b64b4[_0x3a14('0x4c')]=[{'all':!![]}];}_0x5b64b4=_[_0x3a14('0x46')]({},_0x5b64b4,_0xd69559['options']);return db[_0x3a14('0x35')][_0x3a14('0x52')](_0x5b64b4)['then'](handleEntityNotFound(_0xe9772c,null))['then'](respondWithResult(_0xe9772c,null))[_0x3a14('0x4f')](handleError(_0xe9772c,null));};exports[_0x3a14('0x53')]=function(_0x5f1b45,_0x5f130b){return db[_0x3a14('0x35')][_0x3a14('0x53')](_0x5f1b45[_0x3a14('0x54')],{})[_0x3a14('0x1b')](respondWithResult(_0x5f130b,0xc9))[_0x3a14('0x4f')](handleError(_0x5f130b,null));};exports[_0x3a14('0x30')]=function(_0x14e1d6,_0x50b0b5){if(_0x14e1d6[_0x3a14('0x54')]['id']){delete _0x14e1d6[_0x3a14('0x54')]['id'];}return db['ZohoAccount'][_0x3a14('0x52')]({'where':{'id':_0x14e1d6[_0x3a14('0x55')]['id']}})[_0x3a14('0x1b')](handleEntityNotFound(_0x50b0b5,null))[_0x3a14('0x1b')](saveUpdates(_0x14e1d6['body'],null))['then'](respondWithResult(_0x50b0b5,null))[_0x3a14('0x4f')](handleError(_0x50b0b5,null));};exports['destroy']=function(_0x20b0e5,_0x5bf387){return db[_0x3a14('0x35')][_0x3a14('0x52')]({'where':{'id':_0x20b0e5['params']['id']}})[_0x3a14('0x1b')](handleEntityNotFound(_0x5bf387,null))['then'](removeEntity(_0x5bf387,null))[_0x3a14('0x4f')](handleError(_0x5bf387,null));};exports[_0x3a14('0x56')]=function(_0x3eca2f,_0x3c2e8e,_0x519cbd){var _0x4da633={};var _0x39b67e={};var _0x1a1634;var _0xa0fcb4;return db['ZohoAccount']['findOne']({'where':{'id':_0x3eca2f['params']['id']}})[_0x3a14('0x1b')](handleEntityNotFound(_0x3c2e8e,null))['then'](function(_0x3d4cce){if(_0x3d4cce){_0x1a1634=_0x3d4cce;_0x39b67e['model']=_[_0x3a14('0x39')](db[_0x3a14('0x57')][_0x3a14('0x36')]);_0x39b67e['query']=_[_0x3a14('0x39')](_0x3eca2f[_0x3a14('0x3e')]);_0x39b67e[_0x3a14('0x3a')]=_[_0x3a14('0x3d')](_0x39b67e[_0x3a14('0x3b')],_0x39b67e[_0x3a14('0x3e')]);_0x4da633['attributes']=_[_0x3a14('0x3d')](_0x39b67e['model'],qs[_0x3a14('0x3f')](_0x3eca2f[_0x3a14('0x3e')][_0x3a14('0x3f')]));_0x4da633[_0x3a14('0x3c')]=_0x4da633[_0x3a14('0x3c')][_0x3a14('0x51')]?_0x4da633[_0x3a14('0x3c')]:_0x39b67e[_0x3a14('0x3b')];_0x4da633[_0x3a14('0x58')]=qs[_0x3a14('0x42')](_0x3eca2f['query']['sort']);_0x4da633[_0x3a14('0x43')]=qs['filters'](_[_0x3a14('0x44')](_0x3eca2f[_0x3a14('0x3e')],_0x39b67e[_0x3a14('0x3a')]));if(_0x3eca2f[_0x3a14('0x3e')][_0x3a14('0x45')]){_0x4da633['where']=_[_0x3a14('0x46')](_0x4da633[_0x3a14('0x43')],{'$or':_[_0x3a14('0x34')](_0x4da633[_0x3a14('0x3c')],function(_0x66e405){var _0x726a02={};_0x726a02[_0x66e405]={'$like':'%'+_0x3eca2f[_0x3a14('0x3e')][_0x3a14('0x45')]+'%'};return _0x726a02;})});}_0x4da633=_[_0x3a14('0x46')]({},_0x4da633,_0x3eca2f['options']);return _0x1a1634[_0x3a14('0x56')](_0x4da633);}})[_0x3a14('0x1b')](function(_0x175c5b){if(_0x175c5b){_0xa0fcb4=_0x175c5b[_0x3a14('0x51')];if(!_0x3eca2f[_0x3a14('0x3e')][_0x3a14('0x40')]('nolimit')){_0x4da633[_0x3a14('0x2a')]=qs[_0x3a14('0x2a')](_0x3eca2f[_0x3a14('0x3e')][_0x3a14('0x2a')]);_0x4da633[_0x3a14('0x29')]=qs[_0x3a14('0x29')](_0x3eca2f[_0x3a14('0x3e')][_0x3a14('0x29')]);}return _0x1a1634[_0x3a14('0x56')](_0x4da633);}})[_0x3a14('0x1b')](function(_0x502949){if(_0x502949){return _0x502949?{'count':_0xa0fcb4,'rows':_0x502949}:null;}})[_0x3a14('0x1b')](respondWithResult(_0x3c2e8e,null))['catch'](handleError(_0x3c2e8e,null));};exports[_0x3a14('0x59')]=function(_0x2462a9,_0x37beb5,_0x19c5b7){if(_0x2462a9[_0x3a14('0x54')]['id']){delete _0x2462a9[_0x3a14('0x54')]['id'];}return db[_0x3a14('0x35')][_0x3a14('0x5a')]({'where':{'id':_0x2462a9[_0x3a14('0x55')]['id']}})['then'](handleEntityNotFound(_0x37beb5,null))[_0x3a14('0x1b')](function(_0x506e4c){if(_0x506e4c){_0x2462a9['body'][_0x3a14('0x5b')]=_0x506e4c['id'];_0x2462a9[_0x3a14('0x54')][_0x3a14('0x5c')]=integrations[_0x3a14('0x5d')](_0x2462a9[_0x3a14('0x54')]['channel'],_0x2462a9[_0x3a14('0x54')][_0x3a14('0x37')]);_0x2462a9[_0x3a14('0x54')]['Descriptions']=integrations[_0x3a14('0x5e')](_0x2462a9[_0x3a14('0x54')][_0x3a14('0x5f')],_0x2462a9['body'][_0x3a14('0x37')]);return db[_0x3a14('0x57')][_0x3a14('0x53')](_0x2462a9[_0x3a14('0x54')],{'include':[{'model':db['ZohoField'],'as':_0x3a14('0x5c')},{'model':db[_0x3a14('0x60')],'as':_0x3a14('0x61')}]});}return null;})['then'](respondWithResult(_0x37beb5,null))[_0x3a14('0x4f')](handleError(_0x37beb5,null));};function getAccessToken(_0x2a7614){return new Promise(function(_0x3a4f91,_0x4b7f27){var _0x2ae95e;switch(_0x2a7614['zone']){case'US':_0x2ae95e='https://accounts.zoho.com';break;case'AU':_0x2ae95e=_0x3a14('0x62');break;case'EU':_0x2ae95e=_0x3a14('0x63');break;case'IN':_0x2ae95e=_0x3a14('0x64');break;case'CN':_0x2ae95e=_0x3a14('0x65');break;default:_0x2ae95e=_0x3a14('0x63');break;}var _0x579b54={'method':_0x3a14('0x66'),'uri':_0x2ae95e+_0x3a14('0x67'),'qs':{'refresh_token':_0x2a7614['refreshToken'],'client_id':_0x2a7614['clientId'],'client_secret':_0x2a7614[_0x3a14('0x68')],'grant_type':_0x3a14('0x69')},'json':!![]};return rp(_0x579b54)['then'](function(_0x3e70f0){if(_0x3e70f0[_0x3a14('0x6a')]){_0x3a4f91(_0x3e70f0[_0x3a14('0x6a')]);}else{_0x4b7f27('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})[_0x3a14('0x4f')](function(_0x35a126){_0x4b7f27(_0x35a126);});});}exports[_0x3a14('0x6b')]=function(_0x30679c,_0x160524,_0x1bdada){var _0x5c3f3f,_0x44f3ba,_0xe9dfd,_0xe99a8b,_0x341018;return db[_0x3a14('0x35')][_0x3a14('0x5a')]({'where':{'id':_0x30679c[_0x3a14('0x55')]['id']},'attributes':['id',_0x3a14('0x6c'),_0x3a14('0x6d'),_0x3a14('0x6e'),_0x3a14('0x68'),_0x3a14('0x6f'),'code',_0x3a14('0x70')]})['then'](handleEntityNotFound(_0x160524,null))[_0x3a14('0x1b')](function(_0x5be6d9){_0x341018=_0x5be6d9;_0x5c3f3f=_0x341018[_0x3a14('0x6c')];_0x44f3ba=_0x5c3f3f===_0x3a14('0x71')?'eu':'com';_0xe9dfd=_0x341018[_0x3a14('0x6f')];var _0x266eb2=_0xe9dfd[_0x3a14('0x72')](-0x1);if(_0x266eb2==='/'||_0x266eb2==='\x5c'||_0x266eb2===':'){_0xe9dfd=_0xe9dfd[_0x3a14('0x73')](0x0,_0xe9dfd[_0x3a14('0x74')](_0x266eb2));}if(!_0x341018[_0x3a14('0x70')]){throw new Error(_0x3a14('0x75'));}return getAccessToken(_0x341018);})[_0x3a14('0x1b')](function(_0x3e6664){if(_0x3e6664){return rp({'method':'GET','uri':util[_0x3a14('0x76')](_0x3a14('0x77'),_0x44f3ba),'qs':{'module':_0x3a14('0x78')},'headers':{'Authorization':_0x3a14('0x79')+_0x3e6664},'json':!![]});}})[_0x3a14('0x1b')](function(_0x10fadc){if(_0x10fadc){if(_0x10fadc[_0x3a14('0x7a')]&&_0x10fadc[_0x3a14('0x7a')][_0x3a14('0x21')]){throw new Error(_0x10fadc[_0x3a14('0x7a')][_0x3a14('0x21')]['message']);}var _0x3ea58a=[];var _0x2d90da=[];var _0x370504=['Owner',_0x3a14('0x7b'),'Description','WhoId',_0x3a14('0x7c'),_0x3a14('0x7d'),_0x3a14('0x7e'),'Call_Type'];_0x2d90da=_['remove'](_0x10fadc[_0x3a14('0x3f')],function(_0x3355be){return _0x370504[_0x3a14('0x7f')](_0x3355be['api_name']);});for(var _0x5ba592=0x0;_0x5ba592<_0x2d90da['length'];_0x5ba592++){if(_0x2d90da[_0x5ba592][_0x3a14('0x80')]===![]){_0x3ea58a[_0x3a14('0x81')]({'id':_0x2d90da[_0x5ba592]['id'],'name':_0x2d90da[_0x5ba592][_0x3a14('0x82')],'custom':_0x2d90da[_0x5ba592][_0x3a14('0x83')],'options':_0x2d90da[_0x5ba592][_0x3a14('0x84')]==='picklist'&&_0x2d90da[_0x5ba592][_0x3a14('0x85')]['length']>-0x1?_[_0x3a14('0x34')](_0x2d90da[_0x5ba592][_0x3a14('0x85')],function(_0x682d7b){return{'name':_0x682d7b,'value':_0x682d7b};}):[]});}}return{'count':_0x3ea58a[_0x3a14('0x51')],'rows':_0x3ea58a};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x160524,null))['catch'](function(_0x6c9b18){var _0x5be765=_0x30679c[_0x3a14('0x3e')]['test']?0x1f4:_0x6c9b18[_0x3a14('0x86')]||0x1f4;logger[_0x3a14('0x21')](_0x3a14('0x87'),_0x3a14('0x6b'),_0x5be765,JSON[_0x3a14('0x20')](_0x6c9b18));delete _0x6c9b18['name'];if(_0x5be765===0x191){_0x5be765=0x190;}_0x160524[_0x3a14('0x27')](_0x5be765)[_0x3a14('0x32')](_0x30679c[_0x3a14('0x3e')][_0x3a14('0x1a')]?{'message':'Wrong\x20credentials','statusCode':_0x6c9b18[_0x3a14('0x86')]}:_0x6c9b18);});}; \ No newline at end of file +var _0x1c77=['reject','save','update','destroy','sendStatus','stack','name','send','index','ZohoAccount','rawAttributes','fieldName','type','key','map','query','intersection','model','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','field','options','count','rows','show','params','keys','include','find','create','body','findOne','ZohoConfiguration','getConfigurations','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','ZohoField','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','zone','zoho.eu','serverUrl','substring','lastIndexOf','GET','format','Zoho-oauthtoken\x20','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','remove','system_mandatory','display_label','data_type','pick_list_values','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','client','http','test','request','then','ZohoAccount,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','end','status','json','offset','limit','set','Content-Range','apply'];(function(_0x44fd24,_0x4ee07e){var _0x49264c=function(_0x4fbdd8){while(--_0x4fbdd8){_0x44fd24['push'](_0x44fd24['shift']());}};_0x49264c(++_0x4ee07e);}(_0x1c77,0xdc));var _0x71c7=function(_0x441f7a,_0x576321){_0x441f7a=_0x441f7a-0x0;var _0x4821da=_0x1c77[_0x441f7a];return _0x4821da;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x71c7('0x0'));var rimraf=require(_0x71c7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x71c7('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x71c7('0x3'));var Mustache=require(_0x71c7('0x4'));var util=require(_0x71c7('0x5'));var path=require(_0x71c7('0x6'));var sox=require(_0x71c7('0x7'));var csv=require(_0x71c7('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x71c7('0x9'));var squel=require(_0x71c7('0xa'));var crypto=require('crypto');var jsforce=require(_0x71c7('0xb'));var deskjs=require(_0x71c7('0xc'));var toCsv=require(_0x71c7('0x8'));var querystring=require('querystring');var Papa=require(_0x71c7('0xd'));var Redis=require(_0x71c7('0xe'));var authService=require(_0x71c7('0xf'));var qs=require(_0x71c7('0x10'));var as=require(_0x71c7('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x71c7('0x12'))(_0x71c7('0x13'));var utils=require(_0x71c7('0x14'));var config=require(_0x71c7('0x15'));var db=require(_0x71c7('0x16'))['db'];var integrations=require(_0x71c7('0x17'));var jayson=require('jayson/promise');var client=jayson[_0x71c7('0x18')][_0x71c7('0x19')]({'port':0x232a});function checkPasswordPattern(_0x111fa8,_0x347a76,_0x46ae4f){if(_0x46ae4f){var _0x5a0b8c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5a0b8c[_0x71c7('0x1a')](_0x347a76)){return _0x111fa8;}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 _0x111fa8;}}function respondWithRpcPromise(_0x10f64b,_0x5048a5,_0x3d955c,_0x5624f9){return new BPromise(function(_0x381cd8,_0x1b91d1){var _0x38f16c=_0x5624f9||client;return _0x38f16c[_0x71c7('0x1b')](_0x10f64b,_0x3d955c)[_0x71c7('0x1c')](function(_0x56c9b6){logger['info'](_0x71c7('0x1d'),_0x5048a5,_0x71c7('0x1e'));logger['debug']('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x5048a5,'request\x20sent',JSON['stringify'](_0x56c9b6));if(_0x56c9b6[_0x71c7('0x1f')]){if(_0x56c9b6[_0x71c7('0x1f')][_0x71c7('0x20')]===0x1f4){logger[_0x71c7('0x1f')]('ZohoAccount,\x20%s,\x20%s',_0x5048a5,_0x56c9b6[_0x71c7('0x1f')][_0x71c7('0x21')]);return _0x1b91d1(_0x56c9b6[_0x71c7('0x1f')][_0x71c7('0x21')]);}logger[_0x71c7('0x1f')](_0x71c7('0x1d'),_0x5048a5,_0x56c9b6[_0x71c7('0x1f')][_0x71c7('0x21')]);return _0x381cd8(_0x56c9b6[_0x71c7('0x1f')][_0x71c7('0x21')]);}else{logger['info'](_0x71c7('0x1d'),_0x5048a5,_0x71c7('0x1e'));_0x381cd8(_0x56c9b6[_0x71c7('0x22')][_0x71c7('0x21')]);}})[_0x71c7('0x23')](function(_0x21e0be){logger[_0x71c7('0x1f')]('ZohoAccount,\x20%s,\x20%s',_0x5048a5,_0x21e0be);_0x1b91d1(_0x21e0be);});});}function respondWithStatusCode(_0x4409f1,_0x3cbbb1){_0x3cbbb1=_0x3cbbb1||0xcc;return function(_0x482a6a){if(_0x482a6a){return _0x4409f1['sendStatus'](_0x3cbbb1);}return _0x4409f1['status'](_0x3cbbb1)[_0x71c7('0x24')]();};}function respondWithResult(_0x5246dc,_0x37aea1){_0x37aea1=_0x37aea1||0xc8;return function(_0x2778c6){if(_0x2778c6){return _0x5246dc[_0x71c7('0x25')](_0x37aea1)[_0x71c7('0x26')](_0x2778c6);}};}function respondWithFilteredResult(_0x4fbb61,_0x558915){return function(_0x4fd6e9){if(_0x4fd6e9){var _0x1c6ec0=_0x4fd6e9['count'],_0x54d01b=_0x558915[_0x71c7('0x27')],_0x5f57fa=_0x558915[_0x71c7('0x27')]+_0x558915[_0x71c7('0x28')],_0x367c3e;if(_0x5f57fa>=_0x1c6ec0){_0x5f57fa=_0x1c6ec0;_0x367c3e=0xc8;}else{_0x367c3e=0xce;}_0x4fbb61[_0x71c7('0x25')](_0x367c3e);return _0x4fbb61[_0x71c7('0x29')](_0x71c7('0x2a'),_0x54d01b+'-'+_0x5f57fa+'/'+_0x1c6ec0)['json'](_0x4fd6e9);}return null;};}function patchUpdates(_0x4454e9){return function(_0x37a966){try{jsonpatch[_0x71c7('0x2b')](_0x37a966,_0x4454e9,!![]);}catch(_0x2432e8){return BPromise[_0x71c7('0x2c')](_0x2432e8);}return _0x37a966[_0x71c7('0x2d')]();};}function saveUpdates(_0x531a26,_0x201011){return function(_0x76a211){if(_0x76a211){return _0x76a211[_0x71c7('0x2e')](_0x531a26)['then'](function(_0x2efbaf){return _0x2efbaf;});}return null;};}function removeEntity(_0x571a10,_0x3ecaf6){return function(_0x578c93){if(_0x578c93){return _0x578c93[_0x71c7('0x2f')]()[_0x71c7('0x1c')](function(){_0x571a10[_0x71c7('0x25')](0xcc)[_0x71c7('0x24')]();});}};}function handleEntityNotFound(_0x284ecb,_0x4e8547){return function(_0xa6c697){if(!_0xa6c697){_0x284ecb[_0x71c7('0x30')](0x194);}return _0xa6c697;};}function handleError(_0x382a24,_0x2b1b21){_0x2b1b21=_0x2b1b21||0x1f4;return function(_0x592944){logger[_0x71c7('0x1f')](_0x592944[_0x71c7('0x31')]);if(_0x592944['name']){delete _0x592944[_0x71c7('0x32')];}_0x382a24[_0x71c7('0x25')](_0x2b1b21)[_0x71c7('0x33')](_0x592944);};}exports[_0x71c7('0x34')]=function(_0x3d8b0c,_0x288cb8){var _0x8e417f={},_0x1c3cc5={},_0x206dc0={'count':0x0,'rows':[]};var _0x28e2f1=_['map'](db[_0x71c7('0x35')][_0x71c7('0x36')],function(_0x461c24){return{'name':_0x461c24[_0x71c7('0x37')],'type':_0x461c24[_0x71c7('0x38')][_0x71c7('0x39')]};});_0x1c3cc5['model']=_[_0x71c7('0x3a')](_0x28e2f1,'name');_0x1c3cc5[_0x71c7('0x3b')]=_['keys'](_0x3d8b0c[_0x71c7('0x3b')]);_0x1c3cc5['filters']=_[_0x71c7('0x3c')](_0x1c3cc5[_0x71c7('0x3d')],_0x1c3cc5[_0x71c7('0x3b')]);_0x8e417f[_0x71c7('0x3e')]=_[_0x71c7('0x3c')](_0x1c3cc5[_0x71c7('0x3d')],qs[_0x71c7('0x3f')](_0x3d8b0c[_0x71c7('0x3b')][_0x71c7('0x3f')]));_0x8e417f[_0x71c7('0x3e')]=_0x8e417f[_0x71c7('0x3e')][_0x71c7('0x40')]?_0x8e417f[_0x71c7('0x3e')]:_0x1c3cc5['model'];if(!_0x3d8b0c[_0x71c7('0x3b')]['hasOwnProperty'](_0x71c7('0x41'))){_0x8e417f[_0x71c7('0x28')]=qs[_0x71c7('0x28')](_0x3d8b0c['query'][_0x71c7('0x28')]);_0x8e417f['offset']=qs['offset'](_0x3d8b0c[_0x71c7('0x3b')][_0x71c7('0x27')]);}_0x8e417f[_0x71c7('0x42')]=qs[_0x71c7('0x43')](_0x3d8b0c[_0x71c7('0x3b')][_0x71c7('0x43')]);_0x8e417f[_0x71c7('0x44')]=qs[_0x71c7('0x45')](_[_0x71c7('0x46')](_0x3d8b0c['query'],_0x1c3cc5[_0x71c7('0x45')]));if(_0x3d8b0c['query'][_0x71c7('0x47')]){_0x8e417f['where']=_[_0x71c7('0x48')](_0x8e417f['where'],{'$or':_[_0x71c7('0x3a')](_0x28e2f1,function(_0x3186f9){if(_0x3186f9[_0x71c7('0x38')][_0x71c7('0x39')]!==_0x71c7('0x49')){var _0x386313={};_0x386313[_0x3186f9[_0x71c7('0x4a')]]={'$like':'%'+_0x3d8b0c[_0x71c7('0x3b')]['filter']+'%'};return _0x386313;}})});}_0x8e417f=_[_0x71c7('0x48')]({},_0x8e417f,_0x3d8b0c[_0x71c7('0x4b')]);var _0x423824={'where':_0x8e417f[_0x71c7('0x44')]};return db[_0x71c7('0x35')]['count'](_0x423824)[_0x71c7('0x1c')](function(_0x2a85f5){_0x206dc0[_0x71c7('0x4c')]=_0x2a85f5;if(_0x3d8b0c['query']['includeAll']){_0x8e417f['include']=[{'all':!![]}];}return db['ZohoAccount']['findAll'](_0x8e417f);})[_0x71c7('0x1c')](function(_0x2684ba){_0x206dc0[_0x71c7('0x4d')]=_0x2684ba;return _0x206dc0;})[_0x71c7('0x1c')](respondWithFilteredResult(_0x288cb8,_0x8e417f))[_0x71c7('0x23')](handleError(_0x288cb8,null));};exports[_0x71c7('0x4e')]=function(_0x168f78,_0x2b6b08){var _0x443511={'raw':![],'where':{'id':_0x168f78[_0x71c7('0x4f')]['id']}},_0x5da57a={};_0x5da57a[_0x71c7('0x3d')]=_[_0x71c7('0x50')](db[_0x71c7('0x35')][_0x71c7('0x36')]);_0x5da57a[_0x71c7('0x3b')]=_['keys'](_0x168f78[_0x71c7('0x3b')]);_0x5da57a[_0x71c7('0x45')]=_[_0x71c7('0x3c')](_0x5da57a[_0x71c7('0x3d')],_0x5da57a[_0x71c7('0x3b')]);_0x443511[_0x71c7('0x3e')]=_[_0x71c7('0x3c')](_0x5da57a[_0x71c7('0x3d')],qs[_0x71c7('0x3f')](_0x168f78[_0x71c7('0x3b')][_0x71c7('0x3f')]));_0x443511[_0x71c7('0x3e')]=_0x443511[_0x71c7('0x3e')][_0x71c7('0x40')]?_0x443511[_0x71c7('0x3e')]:_0x5da57a['model'];if(_0x168f78[_0x71c7('0x3b')]['includeAll']){_0x443511[_0x71c7('0x51')]=[{'all':!![]}];}_0x443511=_[_0x71c7('0x48')]({},_0x443511,_0x168f78[_0x71c7('0x4b')]);return db[_0x71c7('0x35')][_0x71c7('0x52')](_0x443511)['then'](handleEntityNotFound(_0x2b6b08,null))['then'](respondWithResult(_0x2b6b08,null))[_0x71c7('0x23')](handleError(_0x2b6b08,null));};exports[_0x71c7('0x53')]=function(_0xe36898,_0x1813b0){return db['ZohoAccount'][_0x71c7('0x53')](_0xe36898['body'],{})[_0x71c7('0x1c')](respondWithResult(_0x1813b0,0xc9))['catch'](handleError(_0x1813b0,null));};exports[_0x71c7('0x2e')]=function(_0x8eaeca,_0x24c916){if(_0x8eaeca[_0x71c7('0x54')]['id']){delete _0x8eaeca[_0x71c7('0x54')]['id'];}return db[_0x71c7('0x35')][_0x71c7('0x52')]({'where':{'id':_0x8eaeca['params']['id']}})['then'](handleEntityNotFound(_0x24c916,null))[_0x71c7('0x1c')](saveUpdates(_0x8eaeca[_0x71c7('0x54')],null))['then'](respondWithResult(_0x24c916,null))[_0x71c7('0x23')](handleError(_0x24c916,null));};exports[_0x71c7('0x2f')]=function(_0x1f2f54,_0x27db1c){return db[_0x71c7('0x35')][_0x71c7('0x52')]({'where':{'id':_0x1f2f54[_0x71c7('0x4f')]['id']}})['then'](handleEntityNotFound(_0x27db1c,null))['then'](removeEntity(_0x27db1c,null))['catch'](handleError(_0x27db1c,null));};exports['getConfigurations']=function(_0x42dd6d,_0x5e81c6,_0x3d680c){var _0x119d87={};var _0x6e8cc5={};var _0x321432;var _0x2d4456;return db[_0x71c7('0x35')][_0x71c7('0x55')]({'where':{'id':_0x42dd6d[_0x71c7('0x4f')]['id']}})[_0x71c7('0x1c')](handleEntityNotFound(_0x5e81c6,null))[_0x71c7('0x1c')](function(_0x5b919d){if(_0x5b919d){_0x321432=_0x5b919d;_0x6e8cc5[_0x71c7('0x3d')]=_['keys'](db[_0x71c7('0x56')][_0x71c7('0x36')]);_0x6e8cc5[_0x71c7('0x3b')]=_[_0x71c7('0x50')](_0x42dd6d[_0x71c7('0x3b')]);_0x6e8cc5[_0x71c7('0x45')]=_[_0x71c7('0x3c')](_0x6e8cc5['model'],_0x6e8cc5[_0x71c7('0x3b')]);_0x119d87['attributes']=_[_0x71c7('0x3c')](_0x6e8cc5[_0x71c7('0x3d')],qs[_0x71c7('0x3f')](_0x42dd6d[_0x71c7('0x3b')]['fields']));_0x119d87[_0x71c7('0x3e')]=_0x119d87[_0x71c7('0x3e')][_0x71c7('0x40')]?_0x119d87['attributes']:_0x6e8cc5[_0x71c7('0x3d')];_0x119d87[_0x71c7('0x42')]=qs[_0x71c7('0x43')](_0x42dd6d[_0x71c7('0x3b')][_0x71c7('0x43')]);_0x119d87[_0x71c7('0x44')]=qs['filters'](_[_0x71c7('0x46')](_0x42dd6d[_0x71c7('0x3b')],_0x6e8cc5[_0x71c7('0x45')]));if(_0x42dd6d[_0x71c7('0x3b')][_0x71c7('0x47')]){_0x119d87[_0x71c7('0x44')]=_['merge'](_0x119d87[_0x71c7('0x44')],{'$or':_[_0x71c7('0x3a')](_0x119d87[_0x71c7('0x3e')],function(_0x7101ec){var _0x22be08={};_0x22be08[_0x7101ec]={'$like':'%'+_0x42dd6d[_0x71c7('0x3b')][_0x71c7('0x47')]+'%'};return _0x22be08;})});}_0x119d87=_[_0x71c7('0x48')]({},_0x119d87,_0x42dd6d['options']);return _0x321432[_0x71c7('0x57')](_0x119d87);}})['then'](function(_0x312038){if(_0x312038){_0x2d4456=_0x312038[_0x71c7('0x40')];if(!_0x42dd6d[_0x71c7('0x3b')][_0x71c7('0x58')]('nolimit')){_0x119d87[_0x71c7('0x28')]=qs[_0x71c7('0x28')](_0x42dd6d[_0x71c7('0x3b')][_0x71c7('0x28')]);_0x119d87[_0x71c7('0x27')]=qs[_0x71c7('0x27')](_0x42dd6d[_0x71c7('0x3b')][_0x71c7('0x27')]);}return _0x321432['getConfigurations'](_0x119d87);}})[_0x71c7('0x1c')](function(_0x228170){if(_0x228170){return _0x228170?{'count':_0x2d4456,'rows':_0x228170}:null;}})[_0x71c7('0x1c')](respondWithResult(_0x5e81c6,null))['catch'](handleError(_0x5e81c6,null));};exports[_0x71c7('0x59')]=function(_0x36aa00,_0x3a75aa,_0x13772e){if(_0x36aa00['body']['id']){delete _0x36aa00[_0x71c7('0x54')]['id'];}return db[_0x71c7('0x35')][_0x71c7('0x55')]({'where':{'id':_0x36aa00[_0x71c7('0x4f')]['id']}})['then'](handleEntityNotFound(_0x3a75aa,null))[_0x71c7('0x1c')](function(_0xab044b){if(_0xab044b){_0x36aa00['body'][_0x71c7('0x5a')]=_0xab044b['id'];_0x36aa00['body'][_0x71c7('0x5b')]=integrations[_0x71c7('0x5c')](_0x36aa00['body'][_0x71c7('0x5d')],_0x36aa00[_0x71c7('0x54')][_0x71c7('0x38')]);_0x36aa00['body'][_0x71c7('0x5e')]=integrations['getDescriptions'](_0x36aa00[_0x71c7('0x54')][_0x71c7('0x5d')],_0x36aa00[_0x71c7('0x54')][_0x71c7('0x38')]);return db['ZohoConfiguration'][_0x71c7('0x53')](_0x36aa00['body'],{'include':[{'model':db[_0x71c7('0x5f')],'as':_0x71c7('0x5b')},{'model':db[_0x71c7('0x5f')],'as':_0x71c7('0x5e')}]});}return null;})['then'](respondWithResult(_0x3a75aa,null))[_0x71c7('0x23')](handleError(_0x3a75aa,null));};function getAccessToken(_0x42c676){return new Promise(function(_0x3702be,_0x5ae0d9){var _0x560bb3;switch(_0x42c676['zone']){case'US':_0x560bb3=_0x71c7('0x60');break;case'AU':_0x560bb3=_0x71c7('0x61');break;case'EU':_0x560bb3='https://accounts.zoho.eu';break;case'IN':_0x560bb3=_0x71c7('0x62');break;case'CN':_0x560bb3=_0x71c7('0x63');break;default:_0x560bb3=_0x71c7('0x64');break;}var _0x3d0884={'method':'POST','uri':_0x560bb3+_0x71c7('0x65'),'qs':{'refresh_token':_0x42c676[_0x71c7('0x66')],'client_id':_0x42c676[_0x71c7('0x67')],'client_secret':_0x42c676[_0x71c7('0x68')],'grant_type':_0x71c7('0x69')},'json':!![]};return rp(_0x3d0884)[_0x71c7('0x1c')](function(_0x3aa8ec){if(_0x3aa8ec[_0x71c7('0x6a')]){_0x3702be(_0x3aa8ec[_0x71c7('0x6a')]);}else{_0x5ae0d9(_0x71c7('0x6b'));}})[_0x71c7('0x23')](function(_0x395f72){_0x5ae0d9(_0x395f72);});});}exports[_0x71c7('0x6c')]=function(_0x4dbbfd,_0x300450,_0x1885cb){var _0x4a5954,_0x23360e,_0x362b9c,_0x3fe1b8,_0x250aa4;return db[_0x71c7('0x35')][_0x71c7('0x55')]({'where':{'id':_0x4dbbfd[_0x71c7('0x4f')]['id']},'attributes':['id',_0x71c7('0x6d'),_0x71c7('0x6e'),_0x71c7('0x67'),_0x71c7('0x68'),'serverUrl',_0x71c7('0x20'),_0x71c7('0x66')]})[_0x71c7('0x1c')](handleEntityNotFound(_0x300450,null))[_0x71c7('0x1c')](function(_0x7f0bd5){_0x250aa4=_0x7f0bd5;_0x4a5954=_0x250aa4[_0x71c7('0x6d')];_0x23360e=_0x4a5954===_0x71c7('0x6f')?'eu':'com';_0x362b9c=_0x250aa4[_0x71c7('0x70')];var _0x3b6383=_0x362b9c['slice'](-0x1);if(_0x3b6383==='/'||_0x3b6383==='\x5c'||_0x3b6383===':'){_0x362b9c=_0x362b9c[_0x71c7('0x71')](0x0,_0x362b9c[_0x71c7('0x72')](_0x3b6383));}if(!_0x250aa4[_0x71c7('0x66')]){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x250aa4);})['then'](function(_0x34ebca){if(_0x34ebca){return rp({'method':_0x71c7('0x73'),'uri':util[_0x71c7('0x74')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x23360e),'qs':{'module':'Calls'},'headers':{'Authorization':_0x71c7('0x75')+_0x34ebca},'json':!![]});}})[_0x71c7('0x1c')](function(_0x358c01){if(_0x358c01){if(_0x358c01['response']&&_0x358c01['response']['error']){throw new Error(_0x358c01['response'][_0x71c7('0x1f')]['message']);}var _0x2e723c=[];var _0x3b4e1c=[];var _0xa10bcf=['Owner',_0x71c7('0x76'),_0x71c7('0x77'),_0x71c7('0x78'),_0x71c7('0x79'),_0x71c7('0x7a'),_0x71c7('0x7b'),'Call_Type'];_0x3b4e1c=_[_0x71c7('0x7c')](_0x358c01[_0x71c7('0x3f')],function(_0x409a6e){return _0xa10bcf['includes'](_0x409a6e['api_name']);});for(var _0x2412aa=0x0;_0x2412aa<_0x3b4e1c[_0x71c7('0x40')];_0x2412aa++){if(_0x3b4e1c[_0x2412aa][_0x71c7('0x7d')]===![]){_0x2e723c['push']({'id':_0x3b4e1c[_0x2412aa]['id'],'name':_0x3b4e1c[_0x2412aa][_0x71c7('0x7e')],'custom':_0x3b4e1c[_0x2412aa]['custom_field'],'options':_0x3b4e1c[_0x2412aa][_0x71c7('0x7f')]==='picklist'&&_0x3b4e1c[_0x2412aa][_0x71c7('0x80')][_0x71c7('0x40')]>-0x1?_[_0x71c7('0x3a')](_0x3b4e1c[_0x2412aa][_0x71c7('0x80')],function(_0x30aae3){return{'name':_0x30aae3,'value':_0x30aae3};}):[]});}}return{'count':_0x2e723c[_0x71c7('0x40')],'rows':_0x2e723c};}else{return{'count':0x0,'rows':[]};}})[_0x71c7('0x1c')](respondWithResult(_0x300450,null))[_0x71c7('0x23')](function(_0x5a309a){var _0x49a749=_0x4dbbfd[_0x71c7('0x3b')][_0x71c7('0x1a')]?0x1f4:_0x5a309a[_0x71c7('0x81')]||0x1f4;logger['error'](_0x71c7('0x82'),_0x71c7('0x6c'),_0x49a749,JSON['stringify'](_0x5a309a));delete _0x5a309a[_0x71c7('0x32')];if(_0x49a749===0x191){_0x49a749=0x190;}_0x300450[_0x71c7('0x25')](_0x49a749)[_0x71c7('0x33')](_0x4dbbfd[_0x71c7('0x3b')][_0x71c7('0x1a')]?{'message':_0x71c7('0x83'),'statusCode':_0x5a309a['statusCode']}:_0x5a309a);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index daa8dab..e5e86fb 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 _0x4db1=['../../config/logger','bluebird','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','changed','zone','clientId','host','serverUrl','slice','substring','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','clientSecret','code','application/x-www-form-urlencoded','then','parse','refreshToken','refresh_token','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','inspect','catch','https://accounts.zoho.com','authorization_code','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','lodash','util'];(function(_0x5121ee,_0x59833a){var _0xfdc296=function(_0x5a7420){while(--_0x5a7420){_0x5121ee['push'](_0x5121ee['shift']());}};_0xfdc296(++_0x59833a);}(_0x4db1,0xa6));var _0x14db=function(_0x5a7618,_0x3f44c2){_0x5a7618=_0x5a7618-0x0;var _0x12dc65=_0x4db1[_0x5a7618];return _0x12dc65;};'use strict';var _=require(_0x14db('0x0'));var util=require(_0x14db('0x1'));var logger=require(_0x14db('0x2'))('api');var moment=require('moment');var BPromise=require(_0x14db('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x14db('0x4'));var rimraf=require(_0x14db('0x5'));var config=require(_0x14db('0x6'));var attributes=require(_0x14db('0x7'));var integrations=require(_0x14db('0x8'));module[_0x14db('0x9')]=function(_0x2168d6,_0xa5269e){return _0x2168d6[_0x14db('0xa')](_0x14db('0xb'),attributes,{'tableName':_0x14db('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0xd3d034,_0x5261a5,_0x1c3e14){if(_0xd3d034[_0x14db('0xd')](_0x14db('0xe'))||_0xd3d034[_0x14db('0xd')]('serverUrl')||_0xd3d034[_0x14db('0xd')](_0x14db('0xf'))||_0xd3d034[_0x14db('0xd')]('clientSecret')||_0xd3d034[_0x14db('0xd')]('code')||_0xd3d034[_0x14db('0xd')](_0x14db('0x10'))){var _0x50b6e5,_0x3b5236;_0x50b6e5=_0xd3d034[_0x14db('0x11')];var _0x2ab2f9=_0x50b6e5[_0x14db('0x12')](-0x1);if(_0x2ab2f9==='/'||_0x2ab2f9==='\x5c'||_0x2ab2f9===':'){_0x50b6e5=_0x50b6e5[_0x14db('0x13')](0x0,_0x50b6e5['lastIndexOf'](_0x2ab2f9));}switch(_0xd3d034[_0x14db('0xe')]){case'US':_0x3b5236='https://accounts.zoho.com';break;case'AU':_0x3b5236=_0x14db('0x14');break;case'IN':_0x3b5236=_0x14db('0x15');break;case'CN':_0x3b5236=_0x14db('0x16');break;default:_0x3b5236='https://accounts.zoho.eu';break;}var _0x307f4d={'method':_0x14db('0x17'),'uri':_0x3b5236+_0x14db('0x18'),'form':{'grant_type':'authorization_code','client_id':_0xd3d034[_0x14db('0xf')],'client_secret':_0xd3d034[_0x14db('0x19')],'redirect_uri':_0xd3d034[_0x14db('0x11')],'code':_0xd3d034[_0x14db('0x1a')]},'headers':{'Content-Type':_0x14db('0x1b')}};return rp(_0x307f4d)[_0x14db('0x1c')](function(_0x50c028){var _0x22a007=JSON[_0x14db('0x1d')](_0x50c028);if(_0x22a007['refresh_token']){_0xd3d034[_0x14db('0x1e')]=_0x22a007[_0x14db('0x1f')];logger[_0x14db('0x20')](util[_0x14db('0x21')](_0x14db('0x22'),_0xd3d034[_0x14db('0x23')],_0xd3d034['id']));}else{logger[_0x14db('0x24')](util[_0x14db('0x21')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0xd3d034[_0x14db('0x23')],_0xd3d034['id']),util[_0x14db('0x25')](_0x22a007,{'showHidden':![],'depth':null}));}return _0x1c3e14(null,_0x5261a5);})[_0x14db('0x26')](function(_0x866746){logger['error'](util[_0x14db('0x21')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0xd3d034['name'],_0xd3d034['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x1c3e14(_0x866746);});}else{return _0x1c3e14(null,_0x5261a5);}},'beforeUpdate':function(_0x1158b1,_0x48046b,_0x3ee23d){if(_0x1158b1[_0x14db('0xd')]('zone')||_0x1158b1['changed'](_0x14db('0x11'))||_0x1158b1[_0x14db('0xd')](_0x14db('0xf'))||_0x1158b1['changed'](_0x14db('0x19'))||_0x1158b1[_0x14db('0xd')](_0x14db('0x1a'))||_0x1158b1[_0x14db('0xd')](_0x14db('0x10'))){var _0x43f3e6,_0xeb4810;_0x43f3e6=_0x1158b1['serverUrl'];var _0x21f203=_0x43f3e6['slice'](-0x1);if(_0x21f203==='/'||_0x21f203==='\x5c'||_0x21f203===':'){_0x43f3e6=_0x43f3e6[_0x14db('0x13')](0x0,_0x43f3e6['lastIndexOf'](_0x21f203));}switch(_0x1158b1[_0x14db('0xe')]){case'US':_0xeb4810=_0x14db('0x27');break;case'AU':_0xeb4810='https://accounts.zoho.com.au';break;case'IN':_0xeb4810=_0x14db('0x15');break;case'CN':_0xeb4810=_0x14db('0x16');break;default:_0xeb4810='https://accounts.zoho.eu';break;}var _0x4be8b4={'method':'POST','uri':_0xeb4810+_0x14db('0x18'),'form':{'grant_type':_0x14db('0x28'),'client_id':_0x1158b1[_0x14db('0xf')],'client_secret':_0x1158b1[_0x14db('0x19')],'redirect_uri':_0x1158b1['serverUrl'],'code':_0x1158b1[_0x14db('0x1a')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x4be8b4)[_0x14db('0x1c')](function(_0x68705c){var _0xbcad6b=JSON['parse'](_0x68705c);if(_0xbcad6b[_0x14db('0x1f')]){_0x1158b1[_0x14db('0x1e')]=_0xbcad6b[_0x14db('0x1f')];logger[_0x14db('0x20')](util[_0x14db('0x21')](_0x14db('0x22'),_0x1158b1['name'],_0x1158b1['id']));}else{logger[_0x14db('0x24')](util[_0x14db('0x21')](_0x14db('0x29'),_0x1158b1[_0x14db('0x23')],_0x1158b1['id']),util['inspect'](_0xbcad6b,{'showHidden':![],'depth':null}));}return _0x3ee23d(null,_0x48046b);})[_0x14db('0x26')](function(_0x1e1d57){logger[_0x14db('0x24')](util['format'](_0x14db('0x29'),_0x1158b1['name'],_0x1158b1['id']),util[_0x14db('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x3ee23d(_0x1e1d57);});}else{return _0x3ee23d(null,_0x48046b);}}}});}; \ No newline at end of file +var _0xfe02=['../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','changed','zone','clientSecret','code','host','serverUrl','slice','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.in','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','clientId','application/x-www-form-urlencoded','then','info','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','format','inspect','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','parse','refresh_token','refreshToken','lodash','util','../../config/logger','api','moment','request-promise','rimraf'];(function(_0x266e98,_0x597291){var _0x29e243=function(_0x29b00b){while(--_0x29b00b){_0x266e98['push'](_0x266e98['shift']());}};_0x29e243(++_0x597291);}(_0xfe02,0x159));var _0x2fe0=function(_0x14af49,_0x4eaf2d){_0x14af49=_0x14af49-0x0;var _0x33b9e6=_0xfe02[_0x14af49];return _0x33b9e6;};'use strict';var _=require(_0x2fe0('0x0'));var util=require(_0x2fe0('0x1'));var logger=require(_0x2fe0('0x2'))(_0x2fe0('0x3'));var moment=require(_0x2fe0('0x4'));var BPromise=require('bluebird');var rp=require(_0x2fe0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2fe0('0x6'));var config=require(_0x2fe0('0x7'));var attributes=require(_0x2fe0('0x8'));var integrations=require(_0x2fe0('0x9'));module[_0x2fe0('0xa')]=function(_0x320395,_0x384d06){return _0x320395[_0x2fe0('0xb')](_0x2fe0('0xc'),attributes,{'tableName':_0x2fe0('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x132041,_0x28f4e3,_0x563ea2){if(_0x132041[_0x2fe0('0xe')](_0x2fe0('0xf'))||_0x132041[_0x2fe0('0xe')]('serverUrl')||_0x132041[_0x2fe0('0xe')]('clientId')||_0x132041[_0x2fe0('0xe')](_0x2fe0('0x10'))||_0x132041[_0x2fe0('0xe')](_0x2fe0('0x11'))||_0x132041['changed'](_0x2fe0('0x12'))){var _0x57d632,_0x5ae454;_0x57d632=_0x132041[_0x2fe0('0x13')];var _0xd04735=_0x57d632[_0x2fe0('0x14')](-0x1);if(_0xd04735==='/'||_0xd04735==='\x5c'||_0xd04735===':'){_0x57d632=_0x57d632[_0x2fe0('0x15')](0x0,_0x57d632[_0x2fe0('0x16')](_0xd04735));}switch(_0x132041[_0x2fe0('0xf')]){case'US':_0x5ae454=_0x2fe0('0x17');break;case'AU':_0x5ae454='https://accounts.zoho.com.au';break;case'IN':_0x5ae454=_0x2fe0('0x18');break;case'CN':_0x5ae454='https://accounts.zoho.com.cn';break;default:_0x5ae454=_0x2fe0('0x19');break;}var _0x2ea998={'method':_0x2fe0('0x1a'),'uri':_0x5ae454+_0x2fe0('0x1b'),'form':{'grant_type':_0x2fe0('0x1c'),'client_id':_0x132041[_0x2fe0('0x1d')],'client_secret':_0x132041[_0x2fe0('0x10')],'redirect_uri':_0x132041[_0x2fe0('0x13')],'code':_0x132041[_0x2fe0('0x11')]},'headers':{'Content-Type':_0x2fe0('0x1e')}};return rp(_0x2ea998)[_0x2fe0('0x1f')](function(_0x3cbbf7){var _0x24e29f=JSON['parse'](_0x3cbbf7);if(_0x24e29f['refresh_token']){_0x132041['refreshToken']=_0x24e29f['refresh_token'];logger[_0x2fe0('0x20')](util['format'](_0x2fe0('0x21'),_0x132041[_0x2fe0('0x22')],_0x132041['id']));}else{logger[_0x2fe0('0x23')](util[_0x2fe0('0x24')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x132041[_0x2fe0('0x22')],_0x132041['id']),util[_0x2fe0('0x25')](_0x24e29f,{'showHidden':![],'depth':null}));}return _0x563ea2(null,_0x28f4e3);})['catch'](function(_0x4b073d){logger[_0x2fe0('0x23')](util[_0x2fe0('0x24')](_0x2fe0('0x26'),_0x132041[_0x2fe0('0x22')],_0x132041['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x563ea2(_0x4b073d);});}else{return _0x563ea2(null,_0x28f4e3);}},'beforeUpdate':function(_0x4f676d,_0x156a83,_0xd49e99){if(_0x4f676d['changed'](_0x2fe0('0xf'))||_0x4f676d[_0x2fe0('0xe')](_0x2fe0('0x13'))||_0x4f676d['changed'](_0x2fe0('0x1d'))||_0x4f676d[_0x2fe0('0xe')](_0x2fe0('0x10'))||_0x4f676d[_0x2fe0('0xe')](_0x2fe0('0x11'))||_0x4f676d[_0x2fe0('0xe')](_0x2fe0('0x12'))){var _0x118a2d,_0x3901b6;_0x118a2d=_0x4f676d[_0x2fe0('0x13')];var _0x1550f9=_0x118a2d[_0x2fe0('0x14')](-0x1);if(_0x1550f9==='/'||_0x1550f9==='\x5c'||_0x1550f9===':'){_0x118a2d=_0x118a2d[_0x2fe0('0x15')](0x0,_0x118a2d['lastIndexOf'](_0x1550f9));}switch(_0x4f676d[_0x2fe0('0xf')]){case'US':_0x3901b6='https://accounts.zoho.com';break;case'AU':_0x3901b6=_0x2fe0('0x27');break;case'IN':_0x3901b6='https://accounts.zoho.in';break;case'CN':_0x3901b6=_0x2fe0('0x28');break;default:_0x3901b6=_0x2fe0('0x19');break;}var _0x528411={'method':_0x2fe0('0x1a'),'uri':_0x3901b6+_0x2fe0('0x1b'),'form':{'grant_type':_0x2fe0('0x1c'),'client_id':_0x4f676d[_0x2fe0('0x1d')],'client_secret':_0x4f676d['clientSecret'],'redirect_uri':_0x4f676d[_0x2fe0('0x13')],'code':_0x4f676d[_0x2fe0('0x11')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x528411)[_0x2fe0('0x1f')](function(_0x4d3795){var _0xa4166a=JSON[_0x2fe0('0x29')](_0x4d3795);if(_0xa4166a[_0x2fe0('0x2a')]){_0x4f676d[_0x2fe0('0x2b')]=_0xa4166a[_0x2fe0('0x2a')];logger[_0x2fe0('0x20')](util[_0x2fe0('0x24')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x4f676d['name'],_0x4f676d['id']));}else{logger[_0x2fe0('0x23')](util[_0x2fe0('0x24')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x4f676d['name'],_0x4f676d['id']),util[_0x2fe0('0x25')](_0xa4166a,{'showHidden':![],'depth':null}));}return _0xd49e99(null,_0x156a83);})['catch'](function(_0x2fc87c){logger[_0x2fe0('0x23')](util[_0x2fe0('0x24')](_0x2fe0('0x26'),_0x4f676d[_0x2fe0('0x22')],_0x4f676d['id']),util[_0x2fe0('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0xd49e99(_0x2fc87c);});}else{return _0xd49e99(null,_0x156a83);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 82a8aa0..62d27a4 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 _0x26e4=['options','raw','where','attributes','limit','include','map','model','then','catch','find','ShowZohoAccount','util','bluebird','ioredis','../../config/logger','rpc','jayson/promise','client','http','info','ZohoAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','GetZohoAccount','findAll'];(function(_0x322ee0,_0x2e2f29){var _0x4f519a=function(_0x64d2d2){while(--_0x64d2d2){_0x322ee0['push'](_0x322ee0['shift']());}};_0x4f519a(++_0x2e2f29);}(_0x26e4,0x1be));var _0x426e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x26e4[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require('lodash');var util=require(_0x426e('0x0'));var moment=require('moment');var BPromise=require(_0x426e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x426e('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x426e('0x3'))(_0x426e('0x4'));var config=require('../../config/environment');var jayson=require(_0x426e('0x5'));var client=jayson[_0x426e('0x6')][_0x426e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15d0e0,_0x5ad855,_0x597472){return new BPromise(function(_0x5b9808,_0x1a3b1b){return client['request'](_0x15d0e0,_0x597472)['then'](function(_0x347953){logger[_0x426e('0x8')](_0x426e('0x9'),_0x5ad855,'request\x20sent');logger[_0x426e('0xa')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x5ad855,_0x426e('0xb'),JSON[_0x426e('0xc')](_0x347953));if(_0x347953['error']){if(_0x347953[_0x426e('0xd')][_0x426e('0xe')]===0x1f4){logger[_0x426e('0xd')](_0x426e('0x9'),_0x5ad855,_0x347953[_0x426e('0xd')][_0x426e('0xf')]);return _0x1a3b1b(_0x347953[_0x426e('0xd')][_0x426e('0xf')]);}logger[_0x426e('0xd')](_0x426e('0x9'),_0x5ad855,_0x347953[_0x426e('0xd')]['message']);return _0x5b9808(_0x347953[_0x426e('0xd')][_0x426e('0xf')]);}else{logger[_0x426e('0x8')]('ZohoAccount,\x20%s,\x20%s',_0x5ad855,_0x426e('0xb'));_0x5b9808(_0x347953[_0x426e('0x10')][_0x426e('0xf')]);}})['catch'](function(_0x28a65d){logger['error']('ZohoAccount,\x20%s,\x20%s',_0x5ad855,_0x28a65d);_0x1a3b1b(_0x28a65d);});});}exports[_0x426e('0x11')]=function(_0xb8d39b){var _0x5f4c98=this;return new Promise(function(_0x15d68f,_0x3070e9){return db['ZohoAccount'][_0x426e('0x12')]({'raw':_0xb8d39b[_0x426e('0x13')]?_0xb8d39b[_0x426e('0x13')][_0x426e('0x14')]===undefined?!![]:![]:!![],'where':_0xb8d39b[_0x426e('0x13')]?_0xb8d39b[_0x426e('0x13')][_0x426e('0x15')]||null:null,'attributes':_0xb8d39b['options']?_0xb8d39b[_0x426e('0x13')][_0x426e('0x16')]||null:null,'limit':_0xb8d39b[_0x426e('0x13')]?_0xb8d39b[_0x426e('0x13')][_0x426e('0x17')]||null:null,'include':_0xb8d39b[_0x426e('0x13')]?_0xb8d39b[_0x426e('0x13')][_0x426e('0x18')]?_[_0x426e('0x19')](_0xb8d39b[_0x426e('0x13')][_0x426e('0x18')],function(_0x3640c3){return{'model':db[_0x3640c3['model']],'as':_0x3640c3['as'],'attributes':_0x3640c3[_0x426e('0x16')],'include':_0x3640c3['include']?_[_0x426e('0x19')](_0x3640c3[_0x426e('0x18')],function(_0x2939b1){return{'model':db[_0x2939b1[_0x426e('0x1a')]],'as':_0x2939b1['as'],'attributes':_0x2939b1[_0x426e('0x16')],'include':_0x2939b1['include']?_[_0x426e('0x19')](_0x2939b1[_0x426e('0x18')],function(_0x48ae4d){return{'model':db[_0x48ae4d[_0x426e('0x1a')]],'as':_0x48ae4d['as'],'attributes':_0x48ae4d[_0x426e('0x16')]};}):[]};}):[]};}):[]:[]})[_0x426e('0x1b')](function(_0xf5f017){logger[_0x426e('0x8')](_0x426e('0x11'),_0xb8d39b);logger[_0x426e('0xa')](_0x426e('0x11'),_0xb8d39b,JSON[_0x426e('0xc')](_0xf5f017));_0x15d68f(_0xf5f017);})[_0x426e('0x1c')](function(_0x19b75d){logger[_0x426e('0xd')](_0x426e('0x11'),_0x19b75d[_0x426e('0xf')],_0xb8d39b);_0x3070e9(_0x5f4c98[_0x426e('0xd')](0x1f4,_0x19b75d[_0x426e('0xf')]));});});};exports['ShowZohoAccount']=function(_0x11b7cc){var _0x4392d2=this;return new Promise(function(_0x273bd1,_0x4e6f80){return db['ZohoAccount'][_0x426e('0x1d')]({'raw':_0x11b7cc[_0x426e('0x13')]?_0x11b7cc[_0x426e('0x13')][_0x426e('0x14')]===undefined?!![]:![]:!![],'where':_0x11b7cc[_0x426e('0x13')]?_0x11b7cc[_0x426e('0x13')]['where']||null:null,'attributes':_0x11b7cc[_0x426e('0x13')]?_0x11b7cc[_0x426e('0x13')][_0x426e('0x16')]||null:null,'include':_0x11b7cc[_0x426e('0x13')]?_0x11b7cc[_0x426e('0x13')][_0x426e('0x18')]?_['map'](_0x11b7cc[_0x426e('0x13')][_0x426e('0x18')],function(_0x3c71a6){return{'model':db[_0x3c71a6[_0x426e('0x1a')]],'as':_0x3c71a6['as'],'attributes':_0x3c71a6[_0x426e('0x16')],'include':_0x3c71a6['include']?_[_0x426e('0x19')](_0x3c71a6[_0x426e('0x18')],function(_0xdebee9){return{'model':db[_0xdebee9[_0x426e('0x1a')]],'as':_0xdebee9['as'],'attributes':_0xdebee9[_0x426e('0x16')],'include':_0xdebee9[_0x426e('0x18')]?_[_0x426e('0x19')](_0xdebee9[_0x426e('0x18')],function(_0x5d857d){return{'model':db[_0x5d857d[_0x426e('0x1a')]],'as':_0x5d857d['as'],'attributes':_0x5d857d[_0x426e('0x16')]};}):[]};}):[]};}):[]:[]})[_0x426e('0x1b')](function(_0x4317e3){logger['info'](_0x426e('0x1e'),_0x11b7cc);logger[_0x426e('0xa')](_0x426e('0x1e'),_0x11b7cc,JSON[_0x426e('0xc')](_0x4317e3));_0x273bd1(_0x4317e3);})[_0x426e('0x1c')](function(_0x420c90){logger[_0x426e('0xd')](_0x426e('0x1e'),_0x420c90[_0x426e('0xf')],_0x11b7cc);_0x4e6f80(_0x4392d2[_0x426e('0xd')](0x1f4,_0x420c90[_0x426e('0xf')]));});});}; \ No newline at end of file +var _0xf5ee=['ZohoAccount','find','info','lodash','util','moment','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetZohoAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowZohoAccount'];(function(_0x40e83f,_0x4f467a){var _0x17207f=function(_0xbeb1f0){while(--_0xbeb1f0){_0x40e83f['push'](_0x40e83f['shift']());}};_0x17207f(++_0x4f467a);}(_0xf5ee,0x1b3));var _0xef5e=function(_0x1a7697,_0x469f4e){_0x1a7697=_0x1a7697-0x0;var _0x4d2dc8=_0xf5ee[_0x1a7697];return _0x4d2dc8;};'use strict';var _=require(_0xef5e('0x0'));var util=require(_0xef5e('0x1'));var moment=require(_0xef5e('0x2'));var BPromise=require('bluebird');var rs=require(_0xef5e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xef5e('0x4'));var logger=require('../../config/logger')(_0xef5e('0x5'));var config=require(_0xef5e('0x6'));var jayson=require(_0xef5e('0x7'));var client=jayson[_0xef5e('0x8')][_0xef5e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1b7773,_0x5dadbe,_0xf3ca87){return new BPromise(function(_0xfad450,_0x358f92){return client[_0xef5e('0xa')](_0x1b7773,_0xf3ca87)[_0xef5e('0xb')](function(_0x245773){logger['info'](_0xef5e('0xc'),_0x5dadbe,_0xef5e('0xd'));logger[_0xef5e('0xe')](_0xef5e('0xf'),_0x5dadbe,'request\x20sent',JSON[_0xef5e('0x10')](_0x245773));if(_0x245773[_0xef5e('0x11')]){if(_0x245773[_0xef5e('0x11')][_0xef5e('0x12')]===0x1f4){logger[_0xef5e('0x11')](_0xef5e('0xc'),_0x5dadbe,_0x245773[_0xef5e('0x11')][_0xef5e('0x13')]);return _0x358f92(_0x245773[_0xef5e('0x11')][_0xef5e('0x13')]);}logger[_0xef5e('0x11')]('ZohoAccount,\x20%s,\x20%s',_0x5dadbe,_0x245773[_0xef5e('0x11')][_0xef5e('0x13')]);return _0xfad450(_0x245773[_0xef5e('0x11')][_0xef5e('0x13')]);}else{logger['info'](_0xef5e('0xc'),_0x5dadbe,_0xef5e('0xd'));_0xfad450(_0x245773[_0xef5e('0x14')][_0xef5e('0x13')]);}})[_0xef5e('0x15')](function(_0x5ba4a4){logger[_0xef5e('0x11')](_0xef5e('0xc'),_0x5dadbe,_0x5ba4a4);_0x358f92(_0x5ba4a4);});});}exports[_0xef5e('0x16')]=function(_0x4e0108){var _0x54ac71=this;return new Promise(function(_0x54b51c,_0x1dc5a5){return db['ZohoAccount'][_0xef5e('0x17')]({'raw':_0x4e0108[_0xef5e('0x18')]?_0x4e0108['options'][_0xef5e('0x19')]===undefined?!![]:![]:!![],'where':_0x4e0108[_0xef5e('0x18')]?_0x4e0108['options'][_0xef5e('0x1a')]||null:null,'attributes':_0x4e0108[_0xef5e('0x18')]?_0x4e0108[_0xef5e('0x18')][_0xef5e('0x1b')]||null:null,'limit':_0x4e0108[_0xef5e('0x18')]?_0x4e0108['options'][_0xef5e('0x1c')]||null:null,'include':_0x4e0108[_0xef5e('0x18')]?_0x4e0108[_0xef5e('0x18')][_0xef5e('0x1d')]?_[_0xef5e('0x1e')](_0x4e0108['options']['include'],function(_0x1c09fe){return{'model':db[_0x1c09fe[_0xef5e('0x1f')]],'as':_0x1c09fe['as'],'attributes':_0x1c09fe[_0xef5e('0x1b')],'include':_0x1c09fe[_0xef5e('0x1d')]?_[_0xef5e('0x1e')](_0x1c09fe[_0xef5e('0x1d')],function(_0x52bb35){return{'model':db[_0x52bb35[_0xef5e('0x1f')]],'as':_0x52bb35['as'],'attributes':_0x52bb35[_0xef5e('0x1b')],'include':_0x52bb35[_0xef5e('0x1d')]?_['map'](_0x52bb35['include'],function(_0x37629){return{'model':db[_0x37629[_0xef5e('0x1f')]],'as':_0x37629['as'],'attributes':_0x37629['attributes']};}):[]};}):[]};}):[]:[]})[_0xef5e('0xb')](function(_0x3869e5){logger['info'](_0xef5e('0x16'),_0x4e0108);logger[_0xef5e('0xe')](_0xef5e('0x16'),_0x4e0108,JSON[_0xef5e('0x10')](_0x3869e5));_0x54b51c(_0x3869e5);})['catch'](function(_0x37a589){logger[_0xef5e('0x11')](_0xef5e('0x16'),_0x37a589[_0xef5e('0x13')],_0x4e0108);_0x1dc5a5(_0x54ac71[_0xef5e('0x11')](0x1f4,_0x37a589[_0xef5e('0x13')]));});});};exports[_0xef5e('0x20')]=function(_0x6ce6ac){var _0x1bec6c=this;return new Promise(function(_0x17d148,_0x3e584d){return db[_0xef5e('0x21')][_0xef5e('0x22')]({'raw':_0x6ce6ac[_0xef5e('0x18')]?_0x6ce6ac['options'][_0xef5e('0x19')]===undefined?!![]:![]:!![],'where':_0x6ce6ac['options']?_0x6ce6ac[_0xef5e('0x18')]['where']||null:null,'attributes':_0x6ce6ac[_0xef5e('0x18')]?_0x6ce6ac[_0xef5e('0x18')][_0xef5e('0x1b')]||null:null,'include':_0x6ce6ac[_0xef5e('0x18')]?_0x6ce6ac[_0xef5e('0x18')][_0xef5e('0x1d')]?_[_0xef5e('0x1e')](_0x6ce6ac[_0xef5e('0x18')][_0xef5e('0x1d')],function(_0x2d6963){return{'model':db[_0x2d6963['model']],'as':_0x2d6963['as'],'attributes':_0x2d6963[_0xef5e('0x1b')],'include':_0x2d6963[_0xef5e('0x1d')]?_['map'](_0x2d6963[_0xef5e('0x1d')],function(_0x330c0e){return{'model':db[_0x330c0e[_0xef5e('0x1f')]],'as':_0x330c0e['as'],'attributes':_0x330c0e['attributes'],'include':_0x330c0e[_0xef5e('0x1d')]?_[_0xef5e('0x1e')](_0x330c0e[_0xef5e('0x1d')],function(_0x3f1e2a){return{'model':db[_0x3f1e2a[_0xef5e('0x1f')]],'as':_0x3f1e2a['as'],'attributes':_0x3f1e2a[_0xef5e('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xef5e('0xb')](function(_0x583cec){logger[_0xef5e('0x23')]('ShowZohoAccount',_0x6ce6ac);logger['debug'](_0xef5e('0x20'),_0x6ce6ac,JSON[_0xef5e('0x10')](_0x583cec));_0x17d148(_0x583cec);})['catch'](function(_0x201679){logger[_0xef5e('0x11')](_0xef5e('0x20'),_0x201679[_0xef5e('0x13')],_0x6ce6ac);_0x3e584d(_0x1bec6c['error'](0x1f4,_0x201679['message']));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index f63c016..91363ca 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 _0xfef3=['getSubjects','/:id/descriptions','getDescriptions','post','create','put','delete','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','/:id/subjects'];(function(_0x3c9459,_0x337c4){var _0x28b295=function(_0x350b46){while(--_0x350b46){_0x3c9459['push'](_0x3c9459['shift']());}};_0x28b295(++_0x337c4);}(_0xfef3,0x193));var _0x3fef=function(_0x27ebe8,_0x21dd01){_0x27ebe8=_0x27ebe8-0x0;var _0x431778=_0xfef3[_0x27ebe8];return _0x431778;};'use strict';var multer=require(_0x3fef('0x0'));var util=require('util');var path=require(_0x3fef('0x1'));var timeout=require(_0x3fef('0x2'));var express=require(_0x3fef('0x3'));var router=express[_0x3fef('0x4')]();var auth=require(_0x3fef('0x5'));var interaction=require(_0x3fef('0x6'));var config=require(_0x3fef('0x7'));var controller=require('./intZohoConfiguration.controller');router[_0x3fef('0x8')]('/',auth[_0x3fef('0x9')](),controller[_0x3fef('0xa')]);router[_0x3fef('0x8')](_0x3fef('0xb'),auth[_0x3fef('0x9')](),controller[_0x3fef('0xc')]);router['get'](_0x3fef('0xd'),auth[_0x3fef('0x9')](),controller['getFields']);router['get'](_0x3fef('0xe'),auth[_0x3fef('0x9')](),controller[_0x3fef('0xf')]);router[_0x3fef('0x8')](_0x3fef('0x10'),auth['isAuthenticated'](),controller[_0x3fef('0x11')]);router[_0x3fef('0x12')]('/',auth[_0x3fef('0x9')](),controller[_0x3fef('0x13')]);router[_0x3fef('0x14')](_0x3fef('0xb'),auth[_0x3fef('0x9')](),controller['update']);router[_0x3fef('0x15')](_0x3fef('0xb'),auth[_0x3fef('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x70a3=['/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','../../components/interaction/service','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id','show'];(function(_0x7eac63,_0x2da992){var _0x23de16=function(_0x1e5cc5){while(--_0x1e5cc5){_0x7eac63['push'](_0x7eac63['shift']());}};_0x23de16(++_0x2da992);}(_0x70a3,0x165));var _0x370a=function(_0x38fffb,_0x346a97){_0x38fffb=_0x38fffb-0x0;var _0x2f1814=_0x70a3[_0x38fffb];return _0x2f1814;};'use strict';var multer=require(_0x370a('0x0'));var util=require(_0x370a('0x1'));var path=require(_0x370a('0x2'));var timeout=require(_0x370a('0x3'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x370a('0x4'));var config=require('../../config/environment');var controller=require(_0x370a('0x5'));router[_0x370a('0x6')]('/',auth[_0x370a('0x7')](),controller[_0x370a('0x8')]);router[_0x370a('0x6')](_0x370a('0x9'),auth['isAuthenticated'](),controller[_0x370a('0xa')]);router[_0x370a('0x6')](_0x370a('0xb'),auth['isAuthenticated'](),controller[_0x370a('0xc')]);router[_0x370a('0x6')](_0x370a('0xd'),auth[_0x370a('0x7')](),controller[_0x370a('0xe')]);router[_0x370a('0x6')](_0x370a('0xf'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0x370a('0x10')]('/',auth['isAuthenticated'](),controller[_0x370a('0x11')]);router[_0x370a('0x12')]('/:id',auth[_0x370a('0x7')](),controller[_0x370a('0x13')]);router[_0x370a('0x14')](_0x370a('0x9'),auth['isAuthenticated'](),controller[_0x370a('0x15')]);module[_0x370a('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 05653af..907bf04 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 _0xfd62=['sequelize','exports','STRING','Contacts','Leads'];(function(_0xa24491,_0x5f33bf){var _0x2368b8=function(_0x53c7a3){while(--_0x53c7a3){_0xa24491['push'](_0xa24491['shift']());}};_0x2368b8(++_0x5f33bf);}(_0xfd62,0xd2));var _0x2fd6=function(_0x2aa732,_0x40df2f){_0x2aa732=_0x2aa732-0x0;var _0x14df97=_0xfd62[_0x2aa732];return _0x14df97;};'use strict';var Sequelize=require(_0x2fd6('0x0'));module[_0x2fd6('0x1')]={'name':{'type':Sequelize[_0x2fd6('0x2')]},'moduleCreate':{'type':Sequelize['ENUM']('Leads',_0x2fd6('0x3')),'defaultValue':_0x2fd6('0x4')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1611=['exports','STRING','ENUM','Leads','Contacts','sequelize'];(function(_0x316457,_0x3a8f7c){var _0x4755a8=function(_0x48161a){while(--_0x48161a){_0x316457['push'](_0x316457['shift']());}};_0x4755a8(++_0x3a8f7c);}(_0x1611,0xb9));var _0x1161=function(_0x263eed,_0x3b5c7d){_0x263eed=_0x263eed-0x0;var _0xadf6ed=_0x1611[_0x263eed];return _0xadf6ed;};'use strict';var Sequelize=require(_0x1161('0x0'));module[_0x1161('0x1')]={'name':{'type':Sequelize[_0x1161('0x2')]},'moduleCreate':{'type':Sequelize[_0x1161('0x3')](_0x1161('0x4'),_0x1161('0x5')),'defaultValue':_0x1161('0x4')},'description':{'type':Sequelize[_0x1161('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 8214d38..22a0618 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 _0xf4c9=['crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','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','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','status','end','json','count','offset','limit','set','Content-Range','reject','sendStatus','stack','name','send','index','ZohoConfiguration','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','filters','pick','merge','where','filter','include','findAll','rows','show','includeAll','find','catch','create','body','update','destroy','params','findOne','ZohoField','order','options','getFields','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','to-csv'];(function(_0x5cc234,_0x1407ad){var _0x884d57=function(_0x1bd639){while(--_0x1bd639){_0x5cc234['push'](_0x5cc234['shift']());}};_0x884d57(++_0x1407ad);}(_0xf4c9,0x1aa));var _0x9f4c=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0xf4c9[_0xbd08b4];return _0x314f1e;};'use strict';var pdf=require(_0x9f4c('0x0'));var emlformat=require(_0x9f4c('0x1'));var rimraf=require(_0x9f4c('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9f4c('0x3'));var rp=require('request-promise');var moment=require(_0x9f4c('0x4'));var BPromise=require(_0x9f4c('0x5'));var Mustache=require(_0x9f4c('0x6'));var util=require('util');var path=require(_0x9f4c('0x7'));var sox=require('sox');var csv=require(_0x9f4c('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x9f4c('0x9'));var jsforce=require(_0x9f4c('0xa'));var deskjs=require(_0x9f4c('0xb'));var toCsv=require(_0x9f4c('0x8'));var querystring=require(_0x9f4c('0xc'));var Papa=require(_0x9f4c('0xd'));var Redis=require('ioredis');var authService=require(_0x9f4c('0xe'));var qs=require(_0x9f4c('0xf'));var as=require(_0x9f4c('0x10'));var hardwareService=require(_0x9f4c('0x11'));var logger=require(_0x9f4c('0x12'))(_0x9f4c('0x13'));var utils=require(_0x9f4c('0x14'));var config=require(_0x9f4c('0x15'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0x9f4c('0x16')]({'port':0x232a});function checkPasswordPattern(_0x53159a,_0x4b66e6,_0x32db23){if(_0x32db23){var _0x4df46b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4df46b['test'](_0x4b66e6)){return _0x53159a;}else{throw new Error(_0x9f4c('0x17'));}}else{return _0x53159a;}}function respondWithRpcPromise(_0x4ce352,_0x4d68ff,_0x1bcf14,_0x516787){return new BPromise(function(_0x25f8ed,_0x336fc2){var _0x46abfe=_0x516787||client;return _0x46abfe[_0x9f4c('0x18')](_0x4ce352,_0x1bcf14)[_0x9f4c('0x19')](function(_0xb61bdf){logger['info'](_0x9f4c('0x1a'),_0x4d68ff,_0x9f4c('0x1b'));logger[_0x9f4c('0x1c')](_0x9f4c('0x1d'),_0x4d68ff,_0x9f4c('0x1b'),JSON['stringify'](_0xb61bdf));if(_0xb61bdf[_0x9f4c('0x1e')]){if(_0xb61bdf[_0x9f4c('0x1e')][_0x9f4c('0x1f')]===0x1f4){logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x4d68ff,_0xb61bdf['error']['message']);return _0x336fc2(_0xb61bdf[_0x9f4c('0x1e')]['message']);}logger['error'](_0x9f4c('0x1a'),_0x4d68ff,_0xb61bdf[_0x9f4c('0x1e')]['message']);return _0x25f8ed(_0xb61bdf[_0x9f4c('0x1e')][_0x9f4c('0x20')]);}else{logger['info'](_0x9f4c('0x1a'),_0x4d68ff,'request\x20sent');_0x25f8ed(_0xb61bdf['result'][_0x9f4c('0x20')]);}})['catch'](function(_0xa4a8e9){logger[_0x9f4c('0x1e')](_0x9f4c('0x1a'),_0x4d68ff,_0xa4a8e9);_0x336fc2(_0xa4a8e9);});});}function respondWithStatusCode(_0x4698b3,_0x43164c){_0x43164c=_0x43164c||0xcc;return function(_0x10c9a9){if(_0x10c9a9){return _0x4698b3['sendStatus'](_0x43164c);}return _0x4698b3[_0x9f4c('0x21')](_0x43164c)[_0x9f4c('0x22')]();};}function respondWithResult(_0x174552,_0x167126){_0x167126=_0x167126||0xc8;return function(_0x2c7b7e){if(_0x2c7b7e){return _0x174552[_0x9f4c('0x21')](_0x167126)[_0x9f4c('0x23')](_0x2c7b7e);}};}function respondWithFilteredResult(_0xadd84c,_0x3bcc3f){return function(_0x12e558){if(_0x12e558){var _0x4712c7=_0x12e558[_0x9f4c('0x24')],_0x4f0d37=_0x3bcc3f[_0x9f4c('0x25')],_0x168ed8=_0x3bcc3f[_0x9f4c('0x25')]+_0x3bcc3f[_0x9f4c('0x26')],_0x3702bf;if(_0x168ed8>=_0x4712c7){_0x168ed8=_0x4712c7;_0x3702bf=0xc8;}else{_0x3702bf=0xce;}_0xadd84c[_0x9f4c('0x21')](_0x3702bf);return _0xadd84c[_0x9f4c('0x27')](_0x9f4c('0x28'),_0x4f0d37+'-'+_0x168ed8+'/'+_0x4712c7)[_0x9f4c('0x23')](_0x12e558);}return null;};}function patchUpdates(_0x4e9b77){return function(_0x4b6d91){try{jsonpatch['apply'](_0x4b6d91,_0x4e9b77,!![]);}catch(_0x101c13){return BPromise[_0x9f4c('0x29')](_0x101c13);}return _0x4b6d91['save']();};}function saveUpdates(_0x24ba75,_0x8cd2b3){return function(_0x2ca433){if(_0x2ca433){return _0x2ca433['update'](_0x24ba75)['then'](function(_0xa7ebad){return _0xa7ebad;});}return null;};}function removeEntity(_0x3eeaae,_0x4ee7aa){return function(_0x341a91){if(_0x341a91){return _0x341a91['destroy']()['then'](function(){_0x3eeaae[_0x9f4c('0x21')](0xcc)[_0x9f4c('0x22')]();});}};}function handleEntityNotFound(_0x259b71,_0x1ee746){return function(_0x3bb4c4){if(!_0x3bb4c4){_0x259b71[_0x9f4c('0x2a')](0x194);}return _0x3bb4c4;};}function handleError(_0x4eb368,_0x17f8a7){_0x17f8a7=_0x17f8a7||0x1f4;return function(_0x348e91){logger[_0x9f4c('0x1e')](_0x348e91[_0x9f4c('0x2b')]);if(_0x348e91[_0x9f4c('0x2c')]){delete _0x348e91[_0x9f4c('0x2c')];}_0x4eb368[_0x9f4c('0x21')](_0x17f8a7)[_0x9f4c('0x2d')](_0x348e91);};}exports[_0x9f4c('0x2e')]=function(_0x3b7d8e,_0xd31d5d){var _0x352b2b={},_0x26b54d={},_0x54309a={'count':0x0,'rows':[]};var _0x3bc5cf=_['map'](db[_0x9f4c('0x2f')][_0x9f4c('0x30')],function(_0x2e2e72){return{'name':_0x2e2e72[_0x9f4c('0x31')],'type':_0x2e2e72[_0x9f4c('0x32')][_0x9f4c('0x33')]};});_0x26b54d[_0x9f4c('0x34')]=_[_0x9f4c('0x35')](_0x3bc5cf,_0x9f4c('0x2c'));_0x26b54d[_0x9f4c('0x36')]=_[_0x9f4c('0x37')](_0x3b7d8e[_0x9f4c('0x36')]);_0x26b54d['filters']=_[_0x9f4c('0x38')](_0x26b54d[_0x9f4c('0x34')],_0x26b54d[_0x9f4c('0x36')]);_0x352b2b['attributes']=_[_0x9f4c('0x38')](_0x26b54d[_0x9f4c('0x34')],qs[_0x9f4c('0x39')](_0x3b7d8e['query'][_0x9f4c('0x39')]));_0x352b2b[_0x9f4c('0x3a')]=_0x352b2b[_0x9f4c('0x3a')][_0x9f4c('0x3b')]?_0x352b2b[_0x9f4c('0x3a')]:_0x26b54d[_0x9f4c('0x34')];if(!_0x3b7d8e[_0x9f4c('0x36')][_0x9f4c('0x3c')](_0x9f4c('0x3d'))){_0x352b2b[_0x9f4c('0x26')]=qs['limit'](_0x3b7d8e[_0x9f4c('0x36')][_0x9f4c('0x26')]);_0x352b2b['offset']=qs[_0x9f4c('0x25')](_0x3b7d8e[_0x9f4c('0x36')][_0x9f4c('0x25')]);}_0x352b2b['order']=qs[_0x9f4c('0x3e')](_0x3b7d8e['query'][_0x9f4c('0x3e')]);_0x352b2b['where']=qs[_0x9f4c('0x3f')](_[_0x9f4c('0x40')](_0x3b7d8e[_0x9f4c('0x36')],_0x26b54d[_0x9f4c('0x3f')]));if(_0x3b7d8e[_0x9f4c('0x36')]['filter']){_0x352b2b['where']=_[_0x9f4c('0x41')](_0x352b2b[_0x9f4c('0x42')],{'$or':_[_0x9f4c('0x35')](_0x3bc5cf,function(_0x5f0514){if(_0x5f0514[_0x9f4c('0x32')]['key']!=='VIRTUAL'){var _0x3e334f={};_0x3e334f[_0x5f0514['field']]={'$like':'%'+_0x3b7d8e[_0x9f4c('0x36')][_0x9f4c('0x43')]+'%'};return _0x3e334f;}})});}_0x352b2b=_[_0x9f4c('0x41')]({},_0x352b2b,_0x3b7d8e['options']);var _0x2111e3={'where':_0x352b2b['where']};return db[_0x9f4c('0x2f')][_0x9f4c('0x24')](_0x2111e3)[_0x9f4c('0x19')](function(_0x13ffcd){_0x54309a['count']=_0x13ffcd;if(_0x3b7d8e[_0x9f4c('0x36')]['includeAll']){_0x352b2b[_0x9f4c('0x44')]=[{'all':!![]}];}return db['ZohoConfiguration'][_0x9f4c('0x45')](_0x352b2b);})[_0x9f4c('0x19')](function(_0x5f13c8){_0x54309a[_0x9f4c('0x46')]=_0x5f13c8;return _0x54309a;})[_0x9f4c('0x19')](respondWithFilteredResult(_0xd31d5d,_0x352b2b))['catch'](handleError(_0xd31d5d,null));};exports[_0x9f4c('0x47')]=function(_0x51a547,_0x42a8f0){var _0x384f47={'raw':![],'where':{'id':_0x51a547['params']['id']}},_0x5b8fca={};_0x5b8fca['model']=_[_0x9f4c('0x37')](db[_0x9f4c('0x2f')]['rawAttributes']);_0x5b8fca[_0x9f4c('0x36')]=_[_0x9f4c('0x37')](_0x51a547[_0x9f4c('0x36')]);_0x5b8fca['filters']=_[_0x9f4c('0x38')](_0x5b8fca['model'],_0x5b8fca[_0x9f4c('0x36')]);_0x384f47[_0x9f4c('0x3a')]=_['intersection'](_0x5b8fca['model'],qs[_0x9f4c('0x39')](_0x51a547[_0x9f4c('0x36')]['fields']));_0x384f47[_0x9f4c('0x3a')]=_0x384f47[_0x9f4c('0x3a')][_0x9f4c('0x3b')]?_0x384f47['attributes']:_0x5b8fca['model'];if(_0x51a547[_0x9f4c('0x36')][_0x9f4c('0x48')]){_0x384f47[_0x9f4c('0x44')]=[{'all':!![]}];}_0x384f47=_[_0x9f4c('0x41')]({},_0x384f47,_0x51a547['options']);return db[_0x9f4c('0x2f')][_0x9f4c('0x49')](_0x384f47)[_0x9f4c('0x19')](handleEntityNotFound(_0x42a8f0,null))[_0x9f4c('0x19')](respondWithResult(_0x42a8f0,null))[_0x9f4c('0x4a')](handleError(_0x42a8f0,null));};exports[_0x9f4c('0x4b')]=function(_0x2fbaaa,_0x1e88b0){return db[_0x9f4c('0x2f')][_0x9f4c('0x4b')](_0x2fbaaa[_0x9f4c('0x4c')],{})['then'](respondWithResult(_0x1e88b0,0xc9))[_0x9f4c('0x4a')](handleError(_0x1e88b0,null));};exports[_0x9f4c('0x4d')]=function(_0x2cc8bf,_0x10f277){if(_0x2cc8bf[_0x9f4c('0x4c')]['id']){delete _0x2cc8bf['body']['id'];}return db['ZohoConfiguration'][_0x9f4c('0x49')]({'where':{'id':_0x2cc8bf['params']['id']}})[_0x9f4c('0x19')](handleEntityNotFound(_0x10f277,null))['then'](saveUpdates(_0x2cc8bf[_0x9f4c('0x4c')],null))[_0x9f4c('0x19')](respondWithResult(_0x10f277,null))[_0x9f4c('0x4a')](handleError(_0x10f277,null));};exports[_0x9f4c('0x4e')]=function(_0x37a985,_0x15bd19){return db['ZohoConfiguration'][_0x9f4c('0x49')]({'where':{'id':_0x37a985[_0x9f4c('0x4f')]['id']}})[_0x9f4c('0x19')](handleEntityNotFound(_0x15bd19,null))[_0x9f4c('0x19')](removeEntity(_0x15bd19,null))[_0x9f4c('0x4a')](handleError(_0x15bd19,null));};exports['getFields']=function(_0xfd42ef,_0x1d6bbc,_0x3e4c79){var _0x1557c1={};var _0x13c74b={};var _0x2f0329;var _0x215458;return db[_0x9f4c('0x2f')][_0x9f4c('0x50')]({'where':{'id':_0xfd42ef['params']['id']}})[_0x9f4c('0x19')](handleEntityNotFound(_0x1d6bbc,null))[_0x9f4c('0x19')](function(_0x2263e1){if(_0x2263e1){_0x2f0329=_0x2263e1;_0x13c74b[_0x9f4c('0x34')]=_[_0x9f4c('0x37')](db[_0x9f4c('0x51')]['rawAttributes']);_0x13c74b[_0x9f4c('0x36')]=_[_0x9f4c('0x37')](_0xfd42ef[_0x9f4c('0x36')]);_0x13c74b[_0x9f4c('0x3f')]=_[_0x9f4c('0x38')](_0x13c74b[_0x9f4c('0x34')],_0x13c74b['query']);_0x1557c1['attributes']=_['intersection'](_0x13c74b[_0x9f4c('0x34')],qs[_0x9f4c('0x39')](_0xfd42ef[_0x9f4c('0x36')]['fields']));_0x1557c1[_0x9f4c('0x3a')]=_0x1557c1[_0x9f4c('0x3a')][_0x9f4c('0x3b')]?_0x1557c1[_0x9f4c('0x3a')]:_0x13c74b[_0x9f4c('0x34')];_0x1557c1[_0x9f4c('0x52')]=qs[_0x9f4c('0x3e')](_0xfd42ef[_0x9f4c('0x36')][_0x9f4c('0x3e')]);_0x1557c1[_0x9f4c('0x42')]=qs['filters'](_[_0x9f4c('0x40')](_0xfd42ef[_0x9f4c('0x36')],_0x13c74b[_0x9f4c('0x3f')]));if(_0xfd42ef[_0x9f4c('0x36')]['filter']){_0x1557c1['where']=_['merge'](_0x1557c1[_0x9f4c('0x42')],{'$or':_[_0x9f4c('0x35')](_0x1557c1['attributes'],function(_0x40847e){var _0x5a3b8a={};_0x5a3b8a[_0x40847e]={'$like':'%'+_0xfd42ef['query'][_0x9f4c('0x43')]+'%'};return _0x5a3b8a;})});}_0x1557c1=_['merge']({},_0x1557c1,_0xfd42ef[_0x9f4c('0x53')]);return _0x2f0329[_0x9f4c('0x54')](_0x1557c1);}})['then'](function(_0x13c7a7){if(_0x13c7a7){_0x215458=_0x13c7a7['length'];if(!_0xfd42ef['query'][_0x9f4c('0x3c')](_0x9f4c('0x3d'))){_0x1557c1[_0x9f4c('0x26')]=qs[_0x9f4c('0x26')](_0xfd42ef['query'][_0x9f4c('0x26')]);_0x1557c1[_0x9f4c('0x25')]=qs['offset'](_0xfd42ef[_0x9f4c('0x36')]['offset']);}return _0x2f0329[_0x9f4c('0x54')](_0x1557c1);}})[_0x9f4c('0x19')](function(_0x21b568){if(_0x21b568){return _0x21b568?{'count':_0x215458,'rows':_0x21b568}:null;}})[_0x9f4c('0x19')](respondWithResult(_0x1d6bbc,null))[_0x9f4c('0x4a')](handleError(_0x1d6bbc,null));};exports['getSubjects']=function(_0x5c0366,_0x5a73d6,_0x3adf10){var _0x55067d={};var _0x13115f={};var _0x169e46;var _0x4d8007;return db['ZohoConfiguration'][_0x9f4c('0x50')]({'where':{'id':_0x5c0366[_0x9f4c('0x4f')]['id']}})[_0x9f4c('0x19')](handleEntityNotFound(_0x5a73d6,null))[_0x9f4c('0x19')](function(_0x525242){if(_0x525242){_0x169e46=_0x525242;_0x13115f[_0x9f4c('0x34')]=_[_0x9f4c('0x37')](db[_0x9f4c('0x51')][_0x9f4c('0x30')]);_0x13115f['query']=_['keys'](_0x5c0366['query']);_0x13115f['filters']=_['intersection'](_0x13115f[_0x9f4c('0x34')],_0x13115f['query']);_0x55067d[_0x9f4c('0x3a')]=_[_0x9f4c('0x38')](_0x13115f['model'],qs['fields'](_0x5c0366[_0x9f4c('0x36')][_0x9f4c('0x39')]));_0x55067d[_0x9f4c('0x3a')]=_0x55067d[_0x9f4c('0x3a')]['length']?_0x55067d[_0x9f4c('0x3a')]:_0x13115f['model'];_0x55067d['order']=qs['sort'](_0x5c0366[_0x9f4c('0x36')][_0x9f4c('0x3e')]);_0x55067d['where']=qs[_0x9f4c('0x3f')](_[_0x9f4c('0x40')](_0x5c0366[_0x9f4c('0x36')],_0x13115f[_0x9f4c('0x3f')]));if(_0x5c0366[_0x9f4c('0x36')][_0x9f4c('0x43')]){_0x55067d[_0x9f4c('0x42')]=_[_0x9f4c('0x41')](_0x55067d[_0x9f4c('0x42')],{'$or':_[_0x9f4c('0x35')](_0x55067d[_0x9f4c('0x3a')],function(_0x187c52){var _0x289028={};_0x289028[_0x187c52]={'$like':'%'+_0x5c0366['query'][_0x9f4c('0x43')]+'%'};return _0x289028;})});}_0x55067d=_[_0x9f4c('0x41')]({},_0x55067d,_0x5c0366[_0x9f4c('0x53')]);return _0x169e46[_0x9f4c('0x55')](_0x55067d);}})[_0x9f4c('0x19')](function(_0x4e305d){if(_0x4e305d){_0x4d8007=_0x4e305d[_0x9f4c('0x3b')];if(!_0x5c0366['query'][_0x9f4c('0x3c')](_0x9f4c('0x3d'))){_0x55067d['limit']=qs[_0x9f4c('0x26')](_0x5c0366['query']['limit']);_0x55067d['offset']=qs['offset'](_0x5c0366[_0x9f4c('0x36')][_0x9f4c('0x25')]);}return _0x169e46[_0x9f4c('0x55')](_0x55067d);}})[_0x9f4c('0x19')](function(_0x4ec44c){if(_0x4ec44c){return _0x4ec44c?{'count':_0x4d8007,'rows':_0x4ec44c}:null;}})[_0x9f4c('0x19')](respondWithResult(_0x5a73d6,null))[_0x9f4c('0x4a')](handleError(_0x5a73d6,null));};exports[_0x9f4c('0x56')]=function(_0x55a4ac,_0x2aa997,_0x1ffbd6){var _0x2d2916={};var _0x4a06d3={};var _0xead0ee;var _0x564237;return db['ZohoConfiguration'][_0x9f4c('0x50')]({'where':{'id':_0x55a4ac[_0x9f4c('0x4f')]['id']}})[_0x9f4c('0x19')](handleEntityNotFound(_0x2aa997,null))['then'](function(_0x2dce16){if(_0x2dce16){_0xead0ee=_0x2dce16;_0x4a06d3[_0x9f4c('0x34')]=_[_0x9f4c('0x37')](db['ZohoField'][_0x9f4c('0x30')]);_0x4a06d3[_0x9f4c('0x36')]=_[_0x9f4c('0x37')](_0x55a4ac['query']);_0x4a06d3['filters']=_[_0x9f4c('0x38')](_0x4a06d3[_0x9f4c('0x34')],_0x4a06d3[_0x9f4c('0x36')]);_0x2d2916['attributes']=_[_0x9f4c('0x38')](_0x4a06d3[_0x9f4c('0x34')],qs['fields'](_0x55a4ac[_0x9f4c('0x36')][_0x9f4c('0x39')]));_0x2d2916[_0x9f4c('0x3a')]=_0x2d2916[_0x9f4c('0x3a')]['length']?_0x2d2916[_0x9f4c('0x3a')]:_0x4a06d3[_0x9f4c('0x34')];_0x2d2916[_0x9f4c('0x52')]=qs[_0x9f4c('0x3e')](_0x55a4ac['query'][_0x9f4c('0x3e')]);_0x2d2916['where']=qs[_0x9f4c('0x3f')](_[_0x9f4c('0x40')](_0x55a4ac[_0x9f4c('0x36')],_0x4a06d3[_0x9f4c('0x3f')]));if(_0x55a4ac[_0x9f4c('0x36')][_0x9f4c('0x43')]){_0x2d2916[_0x9f4c('0x42')]=_[_0x9f4c('0x41')](_0x2d2916[_0x9f4c('0x42')],{'$or':_[_0x9f4c('0x35')](_0x2d2916['attributes'],function(_0x2e4ea5){var _0x5c3f5b={};_0x5c3f5b[_0x2e4ea5]={'$like':'%'+_0x55a4ac[_0x9f4c('0x36')][_0x9f4c('0x43')]+'%'};return _0x5c3f5b;})});}_0x2d2916=_[_0x9f4c('0x41')]({},_0x2d2916,_0x55a4ac[_0x9f4c('0x53')]);return _0xead0ee[_0x9f4c('0x56')](_0x2d2916);}})[_0x9f4c('0x19')](function(_0x649415){if(_0x649415){_0x564237=_0x649415['length'];if(!_0x55a4ac[_0x9f4c('0x36')][_0x9f4c('0x3c')]('nolimit')){_0x2d2916[_0x9f4c('0x26')]=qs[_0x9f4c('0x26')](_0x55a4ac[_0x9f4c('0x36')][_0x9f4c('0x26')]);_0x2d2916[_0x9f4c('0x25')]=qs[_0x9f4c('0x25')](_0x55a4ac[_0x9f4c('0x36')][_0x9f4c('0x25')]);}return _0xead0ee[_0x9f4c('0x56')](_0x2d2916);}})['then'](function(_0x2f3957){if(_0x2f3957){return _0x2f3957?{'count':_0x564237,'rows':_0x2f3957}:null;}})[_0x9f4c('0x19')](respondWithResult(_0x2aa997,null))[_0x9f4c('0x4a')](handleError(_0x2aa997,null));}; \ No newline at end of file +var _0xb350=['pick','merge','VIRTUAL','field','filter','options','ZohoConfiguration','count','findAll','rows','show','params','keys','includeAll','include','create','body','find','findOne','getFields','ZohoField','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','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~!@#$%^&-_=+[{]}.','then','info','ZohoConfiguration,\x20%s,\x20%s','ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','result','catch','status','json','offset','limit','set','save','update','destroy','end','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x403c20,_0x4a7b99){var _0x2b271a=function(_0x106ecb){while(--_0x106ecb){_0x403c20['push'](_0x403c20['shift']());}};_0x2b271a(++_0x4a7b99);}(_0xb350,0x6f));var _0x0b35=function(_0x5e0926,_0x5f5ca7){_0x5e0926=_0x5e0926-0x0;var _0x2ffe9e=_0xb350[_0x5e0926];return _0x2ffe9e;};'use strict';var pdf=require(_0x0b35('0x0'));var emlformat=require(_0x0b35('0x1'));var rimraf=require(_0x0b35('0x2'));var zipdir=require(_0x0b35('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0b35('0x4'));var moment=require('moment');var BPromise=require(_0x0b35('0x5'));var Mustache=require('mustache');var util=require(_0x0b35('0x6'));var path=require(_0x0b35('0x7'));var sox=require(_0x0b35('0x8'));var csv=require(_0x0b35('0x9'));var ejs=require(_0x0b35('0xa'));var fs=require('fs');var _=require(_0x0b35('0xb'));var squel=require(_0x0b35('0xc'));var crypto=require(_0x0b35('0xd'));var jsforce=require(_0x0b35('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0b35('0xf'));var Papa=require(_0x0b35('0x10'));var Redis=require(_0x0b35('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0b35('0x12'));var hardwareService=require(_0x0b35('0x13'));var logger=require(_0x0b35('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x0b35('0x15'));var db=require('../../mysqldb')['db'];var jayson=require(_0x0b35('0x16'));var client=jayson['client'][_0x0b35('0x17')]({'port':0x232a});function checkPasswordPattern(_0x5e39cd,_0x4ff93f,_0x589057){if(_0x589057){var _0x3755fc=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3755fc[_0x0b35('0x18')](_0x4ff93f)){return _0x5e39cd;}else{throw new Error(_0x0b35('0x19'));}}else{return _0x5e39cd;}}function respondWithRpcPromise(_0x3064ea,_0x2c0872,_0x3f3e7e,_0x45fe39){return new BPromise(function(_0x373263,_0x568f37){var _0x6b1c41=_0x45fe39||client;return _0x6b1c41['request'](_0x3064ea,_0x3f3e7e)[_0x0b35('0x1a')](function(_0x47121e){logger[_0x0b35('0x1b')](_0x0b35('0x1c'),_0x2c0872,'request\x20sent');logger['debug'](_0x0b35('0x1d'),_0x2c0872,_0x0b35('0x1e'),JSON[_0x0b35('0x1f')](_0x47121e));if(_0x47121e[_0x0b35('0x20')]){if(_0x47121e[_0x0b35('0x20')]['code']===0x1f4){logger[_0x0b35('0x20')](_0x0b35('0x1c'),_0x2c0872,_0x47121e[_0x0b35('0x20')]['message']);return _0x568f37(_0x47121e[_0x0b35('0x20')]['message']);}logger[_0x0b35('0x20')]('ZohoConfiguration,\x20%s,\x20%s',_0x2c0872,_0x47121e[_0x0b35('0x20')]['message']);return _0x373263(_0x47121e['error']['message']);}else{logger['info'](_0x0b35('0x1c'),_0x2c0872,_0x0b35('0x1e'));_0x373263(_0x47121e[_0x0b35('0x21')]['message']);}})[_0x0b35('0x22')](function(_0x2ce7ba){logger[_0x0b35('0x20')](_0x0b35('0x1c'),_0x2c0872,_0x2ce7ba);_0x568f37(_0x2ce7ba);});});}function respondWithStatusCode(_0x3d7440,_0x5ce442){_0x5ce442=_0x5ce442||0xcc;return function(_0x4eb1fa){if(_0x4eb1fa){return _0x3d7440['sendStatus'](_0x5ce442);}return _0x3d7440[_0x0b35('0x23')](_0x5ce442)['end']();};}function respondWithResult(_0x75f2f4,_0x5a63f3){_0x5a63f3=_0x5a63f3||0xc8;return function(_0x17f21b){if(_0x17f21b){return _0x75f2f4[_0x0b35('0x23')](_0x5a63f3)[_0x0b35('0x24')](_0x17f21b);}};}function respondWithFilteredResult(_0x143c65,_0x3a9e08){return function(_0x3947d9){if(_0x3947d9){var _0x20945f=_0x3947d9['count'],_0x195dd1=_0x3a9e08[_0x0b35('0x25')],_0x306c48=_0x3a9e08[_0x0b35('0x25')]+_0x3a9e08[_0x0b35('0x26')],_0x40061a;if(_0x306c48>=_0x20945f){_0x306c48=_0x20945f;_0x40061a=0xc8;}else{_0x40061a=0xce;}_0x143c65[_0x0b35('0x23')](_0x40061a);return _0x143c65[_0x0b35('0x27')]('Content-Range',_0x195dd1+'-'+_0x306c48+'/'+_0x20945f)[_0x0b35('0x24')](_0x3947d9);}return null;};}function patchUpdates(_0x1b90b2){return function(_0x4d9d76){try{jsonpatch['apply'](_0x4d9d76,_0x1b90b2,!![]);}catch(_0x3ccfb2){return BPromise['reject'](_0x3ccfb2);}return _0x4d9d76[_0x0b35('0x28')]();};}function saveUpdates(_0x19cc52,_0x21d21c){return function(_0x21a2e5){if(_0x21a2e5){return _0x21a2e5[_0x0b35('0x29')](_0x19cc52)[_0x0b35('0x1a')](function(_0x1db71f){return _0x1db71f;});}return null;};}function removeEntity(_0x5a2a20,_0x12726f){return function(_0x19419c){if(_0x19419c){return _0x19419c[_0x0b35('0x2a')]()['then'](function(){_0x5a2a20[_0x0b35('0x23')](0xcc)[_0x0b35('0x2b')]();});}};}function handleEntityNotFound(_0x2d13bb,_0x3a6ee6){return function(_0x3a5578){if(!_0x3a5578){_0x2d13bb['sendStatus'](0x194);}return _0x3a5578;};}function handleError(_0x527abc,_0xb5ecab){_0xb5ecab=_0xb5ecab||0x1f4;return function(_0x2b5156){logger[_0x0b35('0x20')](_0x2b5156[_0x0b35('0x2c')]);if(_0x2b5156[_0x0b35('0x2d')]){delete _0x2b5156['name'];}_0x527abc[_0x0b35('0x23')](_0xb5ecab)[_0x0b35('0x2e')](_0x2b5156);};}exports[_0x0b35('0x2f')]=function(_0x39c5fe,_0x2ed74e){var _0x45c60f={},_0x27e796={},_0x344e38={'count':0x0,'rows':[]};var _0x186a80=_['map'](db['ZohoConfiguration'][_0x0b35('0x30')],function(_0x50686a){return{'name':_0x50686a[_0x0b35('0x31')],'type':_0x50686a[_0x0b35('0x32')][_0x0b35('0x33')]};});_0x27e796[_0x0b35('0x34')]=_[_0x0b35('0x35')](_0x186a80,_0x0b35('0x2d'));_0x27e796['query']=_['keys'](_0x39c5fe[_0x0b35('0x36')]);_0x27e796[_0x0b35('0x37')]=_[_0x0b35('0x38')](_0x27e796[_0x0b35('0x34')],_0x27e796[_0x0b35('0x36')]);_0x45c60f[_0x0b35('0x39')]=_[_0x0b35('0x38')](_0x27e796['model'],qs[_0x0b35('0x3a')](_0x39c5fe[_0x0b35('0x36')][_0x0b35('0x3a')]));_0x45c60f[_0x0b35('0x39')]=_0x45c60f['attributes'][_0x0b35('0x3b')]?_0x45c60f[_0x0b35('0x39')]:_0x27e796[_0x0b35('0x34')];if(!_0x39c5fe['query'][_0x0b35('0x3c')](_0x0b35('0x3d'))){_0x45c60f[_0x0b35('0x26')]=qs['limit'](_0x39c5fe['query']['limit']);_0x45c60f[_0x0b35('0x25')]=qs['offset'](_0x39c5fe[_0x0b35('0x36')][_0x0b35('0x25')]);}_0x45c60f[_0x0b35('0x3e')]=qs[_0x0b35('0x3f')](_0x39c5fe['query'][_0x0b35('0x3f')]);_0x45c60f[_0x0b35('0x40')]=qs[_0x0b35('0x37')](_[_0x0b35('0x41')](_0x39c5fe[_0x0b35('0x36')],_0x27e796[_0x0b35('0x37')]));if(_0x39c5fe[_0x0b35('0x36')]['filter']){_0x45c60f[_0x0b35('0x40')]=_[_0x0b35('0x42')](_0x45c60f[_0x0b35('0x40')],{'$or':_[_0x0b35('0x35')](_0x186a80,function(_0x4e3d1c){if(_0x4e3d1c[_0x0b35('0x32')][_0x0b35('0x33')]!==_0x0b35('0x43')){var _0x26ef45={};_0x26ef45[_0x4e3d1c[_0x0b35('0x44')]]={'$like':'%'+_0x39c5fe['query'][_0x0b35('0x45')]+'%'};return _0x26ef45;}})});}_0x45c60f=_[_0x0b35('0x42')]({},_0x45c60f,_0x39c5fe[_0x0b35('0x46')]);var _0x4c1a3a={'where':_0x45c60f[_0x0b35('0x40')]};return db[_0x0b35('0x47')]['count'](_0x4c1a3a)[_0x0b35('0x1a')](function(_0x550585){_0x344e38[_0x0b35('0x48')]=_0x550585;if(_0x39c5fe[_0x0b35('0x36')]['includeAll']){_0x45c60f['include']=[{'all':!![]}];}return db[_0x0b35('0x47')][_0x0b35('0x49')](_0x45c60f);})['then'](function(_0x5320fe){_0x344e38[_0x0b35('0x4a')]=_0x5320fe;return _0x344e38;})['then'](respondWithFilteredResult(_0x2ed74e,_0x45c60f))['catch'](handleError(_0x2ed74e,null));};exports[_0x0b35('0x4b')]=function(_0x4556f3,_0x30a6af){var _0x465b8e={'raw':![],'where':{'id':_0x4556f3[_0x0b35('0x4c')]['id']}},_0x7f1df2={};_0x7f1df2[_0x0b35('0x34')]=_['keys'](db[_0x0b35('0x47')][_0x0b35('0x30')]);_0x7f1df2[_0x0b35('0x36')]=_[_0x0b35('0x4d')](_0x4556f3[_0x0b35('0x36')]);_0x7f1df2['filters']=_[_0x0b35('0x38')](_0x7f1df2[_0x0b35('0x34')],_0x7f1df2[_0x0b35('0x36')]);_0x465b8e[_0x0b35('0x39')]=_[_0x0b35('0x38')](_0x7f1df2[_0x0b35('0x34')],qs[_0x0b35('0x3a')](_0x4556f3[_0x0b35('0x36')][_0x0b35('0x3a')]));_0x465b8e[_0x0b35('0x39')]=_0x465b8e[_0x0b35('0x39')][_0x0b35('0x3b')]?_0x465b8e[_0x0b35('0x39')]:_0x7f1df2['model'];if(_0x4556f3[_0x0b35('0x36')][_0x0b35('0x4e')]){_0x465b8e[_0x0b35('0x4f')]=[{'all':!![]}];}_0x465b8e=_[_0x0b35('0x42')]({},_0x465b8e,_0x4556f3[_0x0b35('0x46')]);return db['ZohoConfiguration']['find'](_0x465b8e)[_0x0b35('0x1a')](handleEntityNotFound(_0x30a6af,null))[_0x0b35('0x1a')](respondWithResult(_0x30a6af,null))['catch'](handleError(_0x30a6af,null));};exports[_0x0b35('0x50')]=function(_0x324a05,_0x153795){return db[_0x0b35('0x47')]['create'](_0x324a05[_0x0b35('0x51')],{})[_0x0b35('0x1a')](respondWithResult(_0x153795,0xc9))['catch'](handleError(_0x153795,null));};exports['update']=function(_0x81b927,_0x5e841f){if(_0x81b927[_0x0b35('0x51')]['id']){delete _0x81b927[_0x0b35('0x51')]['id'];}return db['ZohoConfiguration'][_0x0b35('0x52')]({'where':{'id':_0x81b927[_0x0b35('0x4c')]['id']}})[_0x0b35('0x1a')](handleEntityNotFound(_0x5e841f,null))[_0x0b35('0x1a')](saveUpdates(_0x81b927[_0x0b35('0x51')],null))['then'](respondWithResult(_0x5e841f,null))[_0x0b35('0x22')](handleError(_0x5e841f,null));};exports[_0x0b35('0x2a')]=function(_0x143004,_0x3780cf){return db[_0x0b35('0x47')]['find']({'where':{'id':_0x143004[_0x0b35('0x4c')]['id']}})[_0x0b35('0x1a')](handleEntityNotFound(_0x3780cf,null))[_0x0b35('0x1a')](removeEntity(_0x3780cf,null))['catch'](handleError(_0x3780cf,null));};exports['getFields']=function(_0x48c533,_0x203049,_0x127521){var _0x4c270f={};var _0x46e989={};var _0x2c55c4;var _0x531a26;return db[_0x0b35('0x47')][_0x0b35('0x53')]({'where':{'id':_0x48c533[_0x0b35('0x4c')]['id']}})['then'](handleEntityNotFound(_0x203049,null))[_0x0b35('0x1a')](function(_0x51c262){if(_0x51c262){_0x2c55c4=_0x51c262;_0x46e989[_0x0b35('0x34')]=_[_0x0b35('0x4d')](db['ZohoField']['rawAttributes']);_0x46e989[_0x0b35('0x36')]=_['keys'](_0x48c533[_0x0b35('0x36')]);_0x46e989['filters']=_[_0x0b35('0x38')](_0x46e989['model'],_0x46e989[_0x0b35('0x36')]);_0x4c270f[_0x0b35('0x39')]=_[_0x0b35('0x38')](_0x46e989[_0x0b35('0x34')],qs[_0x0b35('0x3a')](_0x48c533['query']['fields']));_0x4c270f[_0x0b35('0x39')]=_0x4c270f[_0x0b35('0x39')][_0x0b35('0x3b')]?_0x4c270f[_0x0b35('0x39')]:_0x46e989[_0x0b35('0x34')];_0x4c270f[_0x0b35('0x3e')]=qs[_0x0b35('0x3f')](_0x48c533['query'][_0x0b35('0x3f')]);_0x4c270f[_0x0b35('0x40')]=qs[_0x0b35('0x37')](_[_0x0b35('0x41')](_0x48c533['query'],_0x46e989['filters']));if(_0x48c533[_0x0b35('0x36')]['filter']){_0x4c270f[_0x0b35('0x40')]=_['merge'](_0x4c270f['where'],{'$or':_[_0x0b35('0x35')](_0x4c270f[_0x0b35('0x39')],function(_0x37cf57){var _0x22a899={};_0x22a899[_0x37cf57]={'$like':'%'+_0x48c533[_0x0b35('0x36')]['filter']+'%'};return _0x22a899;})});}_0x4c270f=_['merge']({},_0x4c270f,_0x48c533[_0x0b35('0x46')]);return _0x2c55c4[_0x0b35('0x54')](_0x4c270f);}})[_0x0b35('0x1a')](function(_0x3ec8ea){if(_0x3ec8ea){_0x531a26=_0x3ec8ea[_0x0b35('0x3b')];if(!_0x48c533['query'][_0x0b35('0x3c')](_0x0b35('0x3d'))){_0x4c270f['limit']=qs[_0x0b35('0x26')](_0x48c533[_0x0b35('0x36')][_0x0b35('0x26')]);_0x4c270f[_0x0b35('0x25')]=qs['offset'](_0x48c533[_0x0b35('0x36')][_0x0b35('0x25')]);}return _0x2c55c4[_0x0b35('0x54')](_0x4c270f);}})[_0x0b35('0x1a')](function(_0x3fd9fd){if(_0x3fd9fd){return _0x3fd9fd?{'count':_0x531a26,'rows':_0x3fd9fd}:null;}})[_0x0b35('0x1a')](respondWithResult(_0x203049,null))[_0x0b35('0x22')](handleError(_0x203049,null));};exports['getSubjects']=function(_0x15f169,_0x59841b,_0x529fd3){var _0x25eb46={};var _0x22a5fc={};var _0x3a6767;var _0x321b0e;return db[_0x0b35('0x47')][_0x0b35('0x53')]({'where':{'id':_0x15f169[_0x0b35('0x4c')]['id']}})['then'](handleEntityNotFound(_0x59841b,null))[_0x0b35('0x1a')](function(_0x4684d7){if(_0x4684d7){_0x3a6767=_0x4684d7;_0x22a5fc['model']=_[_0x0b35('0x4d')](db[_0x0b35('0x55')][_0x0b35('0x30')]);_0x22a5fc[_0x0b35('0x36')]=_[_0x0b35('0x4d')](_0x15f169[_0x0b35('0x36')]);_0x22a5fc['filters']=_[_0x0b35('0x38')](_0x22a5fc['model'],_0x22a5fc['query']);_0x25eb46['attributes']=_[_0x0b35('0x38')](_0x22a5fc[_0x0b35('0x34')],qs[_0x0b35('0x3a')](_0x15f169[_0x0b35('0x36')][_0x0b35('0x3a')]));_0x25eb46[_0x0b35('0x39')]=_0x25eb46[_0x0b35('0x39')]['length']?_0x25eb46['attributes']:_0x22a5fc['model'];_0x25eb46['order']=qs['sort'](_0x15f169[_0x0b35('0x36')][_0x0b35('0x3f')]);_0x25eb46[_0x0b35('0x40')]=qs[_0x0b35('0x37')](_[_0x0b35('0x41')](_0x15f169[_0x0b35('0x36')],_0x22a5fc[_0x0b35('0x37')]));if(_0x15f169[_0x0b35('0x36')][_0x0b35('0x45')]){_0x25eb46[_0x0b35('0x40')]=_[_0x0b35('0x42')](_0x25eb46[_0x0b35('0x40')],{'$or':_['map'](_0x25eb46[_0x0b35('0x39')],function(_0x530f9b){var _0xc0343={};_0xc0343[_0x530f9b]={'$like':'%'+_0x15f169[_0x0b35('0x36')][_0x0b35('0x45')]+'%'};return _0xc0343;})});}_0x25eb46=_[_0x0b35('0x42')]({},_0x25eb46,_0x15f169[_0x0b35('0x46')]);return _0x3a6767[_0x0b35('0x56')](_0x25eb46);}})[_0x0b35('0x1a')](function(_0x15cd88){if(_0x15cd88){_0x321b0e=_0x15cd88[_0x0b35('0x3b')];if(!_0x15f169[_0x0b35('0x36')][_0x0b35('0x3c')](_0x0b35('0x3d'))){_0x25eb46[_0x0b35('0x26')]=qs[_0x0b35('0x26')](_0x15f169[_0x0b35('0x36')][_0x0b35('0x26')]);_0x25eb46[_0x0b35('0x25')]=qs['offset'](_0x15f169['query'][_0x0b35('0x25')]);}return _0x3a6767[_0x0b35('0x56')](_0x25eb46);}})[_0x0b35('0x1a')](function(_0x9c6543){if(_0x9c6543){return _0x9c6543?{'count':_0x321b0e,'rows':_0x9c6543}:null;}})['then'](respondWithResult(_0x59841b,null))[_0x0b35('0x22')](handleError(_0x59841b,null));};exports[_0x0b35('0x57')]=function(_0x496e68,_0x3710b7,_0x4ca789){var _0x2ed62e={};var _0x41971c={};var _0x57c118;var _0x45d381;return db[_0x0b35('0x47')][_0x0b35('0x53')]({'where':{'id':_0x496e68[_0x0b35('0x4c')]['id']}})[_0x0b35('0x1a')](handleEntityNotFound(_0x3710b7,null))[_0x0b35('0x1a')](function(_0x1ee340){if(_0x1ee340){_0x57c118=_0x1ee340;_0x41971c[_0x0b35('0x34')]=_[_0x0b35('0x4d')](db[_0x0b35('0x55')][_0x0b35('0x30')]);_0x41971c[_0x0b35('0x36')]=_['keys'](_0x496e68['query']);_0x41971c[_0x0b35('0x37')]=_[_0x0b35('0x38')](_0x41971c[_0x0b35('0x34')],_0x41971c[_0x0b35('0x36')]);_0x2ed62e[_0x0b35('0x39')]=_[_0x0b35('0x38')](_0x41971c[_0x0b35('0x34')],qs[_0x0b35('0x3a')](_0x496e68['query']['fields']));_0x2ed62e[_0x0b35('0x39')]=_0x2ed62e[_0x0b35('0x39')]['length']?_0x2ed62e['attributes']:_0x41971c[_0x0b35('0x34')];_0x2ed62e[_0x0b35('0x3e')]=qs['sort'](_0x496e68['query'][_0x0b35('0x3f')]);_0x2ed62e['where']=qs[_0x0b35('0x37')](_[_0x0b35('0x41')](_0x496e68[_0x0b35('0x36')],_0x41971c[_0x0b35('0x37')]));if(_0x496e68['query'][_0x0b35('0x45')]){_0x2ed62e[_0x0b35('0x40')]=_[_0x0b35('0x42')](_0x2ed62e[_0x0b35('0x40')],{'$or':_[_0x0b35('0x35')](_0x2ed62e[_0x0b35('0x39')],function(_0x4aa224){var _0x38ee31={};_0x38ee31[_0x4aa224]={'$like':'%'+_0x496e68[_0x0b35('0x36')][_0x0b35('0x45')]+'%'};return _0x38ee31;})});}_0x2ed62e=_[_0x0b35('0x42')]({},_0x2ed62e,_0x496e68['options']);return _0x57c118[_0x0b35('0x57')](_0x2ed62e);}})[_0x0b35('0x1a')](function(_0x30a5ef){if(_0x30a5ef){_0x45d381=_0x30a5ef['length'];if(!_0x496e68[_0x0b35('0x36')][_0x0b35('0x3c')](_0x0b35('0x3d'))){_0x2ed62e[_0x0b35('0x26')]=qs[_0x0b35('0x26')](_0x496e68[_0x0b35('0x36')]['limit']);_0x2ed62e['offset']=qs[_0x0b35('0x25')](_0x496e68[_0x0b35('0x36')]['offset']);}return _0x57c118['getDescriptions'](_0x2ed62e);}})['then'](function(_0x23e95a){if(_0x23e95a){return _0x23e95a?{'count':_0x45d381,'rows':_0x23e95a}:null;}})[_0x0b35('0x1a')](respondWithResult(_0x3710b7,null))[_0x0b35('0x22')](handleError(_0x3710b7,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 7d56a41..5975cf4 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 _0x1a95=['path','rimraf','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x56aa6e,_0x5ea402){var _0x16bc9b=function(_0x30463e){while(--_0x30463e){_0x56aa6e['push'](_0x56aa6e['shift']());}};_0x16bc9b(++_0x5ea402);}(_0x1a95,0x96));var _0x51a9=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x1a95[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x51a9('0x0'));var util=require(_0x51a9('0x1'));var logger=require(_0x51a9('0x2'))(_0x51a9('0x3'));var moment=require(_0x51a9('0x4'));var BPromise=require('bluebird');var rp=require(_0x51a9('0x5'));var fs=require('fs');var path=require(_0x51a9('0x6'));var rimraf=require(_0x51a9('0x7'));var config=require('../../config/environment');var attributes=require(_0x51a9('0x8'));module[_0x51a9('0x9')]=function(_0x5c364b,_0x5b4f11){return _0x5c364b[_0x51a9('0xa')](_0x51a9('0xb'),attributes,{'tableName':_0x51a9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x794f=['rimraf','../../config/environment','./intZohoConfiguration.attributes','lodash','util','../../config/logger','bluebird','path'];(function(_0x519915,_0x537802){var _0x479c82=function(_0xabbfd){while(--_0xabbfd){_0x519915['push'](_0x519915['shift']());}};_0x479c82(++_0x537802);}(_0x794f,0x153));var _0xf794=function(_0x43fc20,_0x16c69f){_0x43fc20=_0x43fc20-0x0;var _0x4b994d=_0x794f[_0x43fc20];return _0x4b994d;};'use strict';var _=require(_0xf794('0x0'));var util=require(_0xf794('0x1'));var logger=require(_0xf794('0x2'))('api');var moment=require('moment');var BPromise=require(_0xf794('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf794('0x4'));var rimraf=require(_0xf794('0x5'));var config=require(_0xf794('0x6'));var attributes=require(_0xf794('0x7'));module['exports']=function(_0x4ebe8f,_0x3094ae){return _0x4ebe8f['define']('ZohoConfiguration',attributes,{'tableName':'int_zoho_configurations','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 0aa6c65..dd01698 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 _0x14e4=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x5b5181,_0x12aee0){var _0x2a9fef=function(_0x5b5e28){while(--_0x5b5e28){_0x5b5181['push'](_0x5b5181['shift']());}};_0x2a9fef(++_0x12aee0);}(_0x14e4,0x137));var _0x414e=function(_0x38eeb9,_0xd99664){_0x38eeb9=_0x38eeb9-0x0;var _0x1818e0=_0x14e4[_0x38eeb9];return _0x1818e0;};'use strict';var _=require(_0x414e('0x0'));var util=require('util');var moment=require(_0x414e('0x1'));var BPromise=require(_0x414e('0x2'));var rs=require(_0x414e('0x3'));var fs=require('fs');var Redis=require(_0x414e('0x4'));var db=require(_0x414e('0x5'))['db'];var utils=require(_0x414e('0x6'));var logger=require(_0x414e('0x7'))(_0x414e('0x8'));var config=require(_0x414e('0x9'));var jayson=require(_0x414e('0xa'));var client=jayson['client'][_0x414e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2cef69,_0x48b3db,_0xba50d5){return new BPromise(function(_0x15280d,_0x2ec9ca){return client[_0x414e('0xc')](_0x2cef69,_0xba50d5)[_0x414e('0xd')](function(_0x1b86a5){logger[_0x414e('0xe')](_0x414e('0xf'),_0x48b3db,_0x414e('0x10'));logger[_0x414e('0x11')](_0x414e('0x12'),_0x48b3db,_0x414e('0x10'),JSON[_0x414e('0x13')](_0x1b86a5));if(_0x1b86a5[_0x414e('0x14')]){if(_0x1b86a5[_0x414e('0x14')][_0x414e('0x15')]===0x1f4){logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x48b3db,_0x1b86a5[_0x414e('0x14')][_0x414e('0x16')]);return _0x2ec9ca(_0x1b86a5[_0x414e('0x14')][_0x414e('0x16')]);}logger['error'](_0x414e('0xf'),_0x48b3db,_0x1b86a5['error'][_0x414e('0x16')]);return _0x15280d(_0x1b86a5[_0x414e('0x14')][_0x414e('0x16')]);}else{logger['info'](_0x414e('0xf'),_0x48b3db,_0x414e('0x10'));_0x15280d(_0x1b86a5[_0x414e('0x17')][_0x414e('0x16')]);}})['catch'](function(_0x387f22){logger[_0x414e('0x14')](_0x414e('0xf'),_0x48b3db,_0x387f22);_0x2ec9ca(_0x387f22);});});} \ No newline at end of file +var _0x0ef8=['../../config/logger','../../config/environment','client','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x35591a,_0x1ddd66){var _0x33a589=function(_0x5999f7){while(--_0x5999f7){_0x35591a['push'](_0x35591a['shift']());}};_0x33a589(++_0x1ddd66);}(_0x0ef8,0x1de));var _0x80ef=function(_0x1d9c23,_0x103d17){_0x1d9c23=_0x1d9c23-0x0;var _0x58d121=_0x0ef8[_0x1d9c23];return _0x58d121;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x80ef('0x0'));var rs=require(_0x80ef('0x1'));var fs=require('fs');var Redis=require(_0x80ef('0x2'));var db=require(_0x80ef('0x3'))['db'];var utils=require(_0x80ef('0x4'));var logger=require(_0x80ef('0x5'))('rpc');var config=require(_0x80ef('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x80ef('0x7')][_0x80ef('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x45b4a8,_0x5da719,_0x1fe8d3){return new BPromise(function(_0x5dcf9b,_0x2fc9ff){return client[_0x80ef('0x9')](_0x45b4a8,_0x1fe8d3)[_0x80ef('0xa')](function(_0x193f72){logger[_0x80ef('0xb')](_0x80ef('0xc'),_0x5da719,_0x80ef('0xd'));logger[_0x80ef('0xe')](_0x80ef('0xf'),_0x5da719,_0x80ef('0xd'),JSON[_0x80ef('0x10')](_0x193f72));if(_0x193f72['error']){if(_0x193f72[_0x80ef('0x11')]['code']===0x1f4){logger[_0x80ef('0x11')](_0x80ef('0xc'),_0x5da719,_0x193f72[_0x80ef('0x11')][_0x80ef('0x12')]);return _0x2fc9ff(_0x193f72[_0x80ef('0x11')]['message']);}logger[_0x80ef('0x11')]('ZohoConfiguration,\x20%s,\x20%s',_0x5da719,_0x193f72[_0x80ef('0x11')]['message']);return _0x5dcf9b(_0x193f72[_0x80ef('0x11')][_0x80ef('0x12')]);}else{logger['info'](_0x80ef('0xc'),_0x5da719,_0x80ef('0xd'));_0x5dcf9b(_0x193f72[_0x80ef('0x13')][_0x80ef('0x12')]);}})[_0x80ef('0x14')](function(_0x3d97f0){logger[_0x80ef('0x11')](_0x80ef('0xc'),_0x5da719,_0x3d97f0);_0x2fc9ff(_0x3d97f0);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 1153f7a..442fe34 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 _0x160f=['get','index','show','put','/:id','isAuthenticated','update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller'];(function(_0x46149f,_0x26ac82){var _0x1b3af6=function(_0x28a00b){while(--_0x28a00b){_0x46149f['push'](_0x46149f['shift']());}};_0x1b3af6(++_0x26ac82);}(_0x160f,0x1ef));var _0xf160=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x160f[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xf160('0x0'));var util=require(_0xf160('0x1'));var path=require(_0xf160('0x2'));var timeout=require(_0xf160('0x3'));var express=require('express');var router=express[_0xf160('0x4')]();var auth=require(_0xf160('0x5'));var interaction=require(_0xf160('0x6'));var config=require(_0xf160('0x7'));var controller=require(_0xf160('0x8'));router[_0xf160('0x9')]('/',auth['isAuthenticated'](),controller[_0xf160('0xa')]);router[_0xf160('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xf160('0xb')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xf160('0xc')](_0xf160('0xd'),auth[_0xf160('0xe')](),controller[_0xf160('0xf')]);router['delete']('/:id',auth[_0xf160('0xe')](),controller[_0xf160('0x10')]);module[_0xf160('0x11')]=router; \ No newline at end of file +var _0x6343=['./intZohoField.controller','isAuthenticated','index','/:id','create','put','update','destroy','path','connect-timeout','../../config/environment'];(function(_0x3d8b1f,_0x27a3e8){var _0xcc7771=function(_0x5104df){while(--_0x5104df){_0x3d8b1f['push'](_0x3d8b1f['shift']());}};_0xcc7771(++_0x27a3e8);}(_0x6343,0x168));var _0x3634=function(_0x4f5fc6,_0xc35436){_0x4f5fc6=_0x4f5fc6-0x0;var _0x39683d=_0x6343[_0x4f5fc6];return _0x39683d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3634('0x0'));var timeout=require(_0x3634('0x1'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3634('0x2'));var controller=require(_0x3634('0x3'));router['get']('/',auth[_0x3634('0x4')](),controller[_0x3634('0x5')]);router['get'](_0x3634('0x6'),auth[_0x3634('0x4')](),controller['show']);router['post']('/',auth[_0x3634('0x4')](),controller[_0x3634('0x7')]);router[_0x3634('0x8')](_0x3634('0x6'),auth[_0x3634('0x4')](),controller[_0x3634('0x9')]);router['delete']('/:id',auth[_0x3634('0x4')](),controller[_0x3634('0xa')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index ae04ec4..0942b3f 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 _0x6523=['string','variable','customVariable','STRING','ENUM','BOOLEAN','sequelize','exports'];(function(_0xebabc5,_0x149459){var _0x4d1bf1=function(_0x4bcdb7){while(--_0x4bcdb7){_0xebabc5['push'](_0xebabc5['shift']());}};_0x4d1bf1(++_0x149459);}(_0x6523,0x1a6));var _0x3652=function(_0x1b925b,_0x1ab3c9){_0x1b925b=_0x1b925b-0x0;var _0x275f07=_0x6523[_0x1b925b];return _0x275f07;};'use strict';var Sequelize=require(_0x3652('0x0'));module[_0x3652('0x1')]={'type':{'type':Sequelize['ENUM'](_0x3652('0x2'),_0x3652('0x3'),_0x3652('0x4'),'keyValue'),'defaultValue':_0x3652('0x2')},'content':{'type':Sequelize[_0x3652('0x5')]},'key':{'type':Sequelize[_0x3652('0x5')]},'keyType':{'type':Sequelize[_0x3652('0x6')]('string',_0x3652('0x3'),_0x3652('0x4'))},'keyContent':{'type':Sequelize[_0x3652('0x5')]},'idField':{'type':Sequelize[_0x3652('0x5')]},'nameField':{'type':Sequelize[_0x3652('0x5')]},'customField':{'type':Sequelize[_0x3652('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3652('0x5')]}}; \ No newline at end of file +var _0x7e81=['string','variable','customVariable','keyValue','STRING','sequelize','exports','ENUM'];(function(_0x31e2aa,_0x8fdcf){var _0x2a3553=function(_0x122479){while(--_0x122479){_0x31e2aa['push'](_0x31e2aa['shift']());}};_0x2a3553(++_0x8fdcf);}(_0x7e81,0xc5));var _0x17e8=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x7e81[_0x580576];return _0x3f55a0;};'use strict';var Sequelize=require(_0x17e8('0x0'));module[_0x17e8('0x1')]={'type':{'type':Sequelize[_0x17e8('0x2')](_0x17e8('0x3'),_0x17e8('0x4'),_0x17e8('0x5'),_0x17e8('0x6')),'defaultValue':_0x17e8('0x3')},'content':{'type':Sequelize[_0x17e8('0x7')]},'key':{'type':Sequelize[_0x17e8('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x17e8('0x3'),_0x17e8('0x4'),_0x17e8('0x5'))},'keyContent':{'type':Sequelize[_0x17e8('0x7')]},'idField':{'type':Sequelize[_0x17e8('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x17e8('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 9bad8fa..9ebfa39 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 _0x5afd=['pick','filter','merge','options','include','findAll','rows','catch','params','keys','length','includeAll','create','body','find','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','Content-Range','json','save','update','then','destroy','error','stack','name','send','map','ZohoField','rawAttributes','type','key','query','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x369151,_0x179f72){var _0x4292d5=function(_0x330422){while(--_0x330422){_0x369151['push'](_0x369151['shift']());}};_0x4292d5(++_0x179f72);}(_0x5afd,0xa3));var _0xd5af=function(_0x190cfe,_0x16f92e){_0x190cfe=_0x190cfe-0x0;var _0x22716e=_0x5afd[_0x190cfe];return _0x22716e;};'use strict';var pdf=require(_0xd5af('0x0'));var emlformat=require(_0xd5af('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xd5af('0x2'));var jsonpatch=require(_0xd5af('0x3'));var rp=require(_0xd5af('0x4'));var moment=require(_0xd5af('0x5'));var BPromise=require(_0xd5af('0x6'));var Mustache=require(_0xd5af('0x7'));var util=require(_0xd5af('0x8'));var path=require('path');var sox=require(_0xd5af('0x9'));var csv=require('to-csv');var ejs=require(_0xd5af('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd5af('0xb'));var crypto=require(_0xd5af('0xc'));var jsforce=require(_0xd5af('0xd'));var deskjs=require(_0xd5af('0xe'));var toCsv=require('to-csv');var querystring=require(_0xd5af('0xf'));var Papa=require(_0xd5af('0x10'));var Redis=require(_0xd5af('0x11'));var authService=require(_0xd5af('0x12'));var qs=require(_0xd5af('0x13'));var as=require(_0xd5af('0x14'));var hardwareService=require(_0xd5af('0x15'));var logger=require(_0xd5af('0x16'))(_0xd5af('0x17'));var utils=require(_0xd5af('0x18'));var config=require(_0xd5af('0x19'));var db=require(_0xd5af('0x1a'))['db'];function respondWithStatusCode(_0x341734,_0x987b38){_0x987b38=_0x987b38||0xcc;return function(_0x10a0f2){if(_0x10a0f2){return _0x341734[_0xd5af('0x1b')](_0x987b38);}return _0x341734[_0xd5af('0x1c')](_0x987b38)[_0xd5af('0x1d')]();};}function respondWithResult(_0x315ef9,_0x5d7d8b){_0x5d7d8b=_0x5d7d8b||0xc8;return function(_0x4cea28){if(_0x4cea28){return _0x315ef9[_0xd5af('0x1c')](_0x5d7d8b)['json'](_0x4cea28);}};}function respondWithFilteredResult(_0x382f9f,_0x556bcf){return function(_0x282e0b){if(_0x282e0b){var _0x4b0ef0=_0x282e0b[_0xd5af('0x1e')],_0x3766b2=_0x556bcf[_0xd5af('0x1f')],_0x5c55f5=_0x556bcf[_0xd5af('0x1f')]+_0x556bcf[_0xd5af('0x20')],_0x2163d7;if(_0x5c55f5>=_0x4b0ef0){_0x5c55f5=_0x4b0ef0;_0x2163d7=0xc8;}else{_0x2163d7=0xce;}_0x382f9f[_0xd5af('0x1c')](_0x2163d7);return _0x382f9f['set'](_0xd5af('0x21'),_0x3766b2+'-'+_0x5c55f5+'/'+_0x4b0ef0)[_0xd5af('0x22')](_0x282e0b);}return null;};}function patchUpdates(_0x59a77b){return function(_0x56f9ad){try{jsonpatch['apply'](_0x56f9ad,_0x59a77b,!![]);}catch(_0x5889b6){return BPromise['reject'](_0x5889b6);}return _0x56f9ad[_0xd5af('0x23')]();};}function saveUpdates(_0x3f15f8,_0x5e46d7){return function(_0x3d59e2){if(_0x3d59e2){return _0x3d59e2[_0xd5af('0x24')](_0x3f15f8)[_0xd5af('0x25')](function(_0x31bd19){return _0x31bd19;});}return null;};}function removeEntity(_0x297511,_0x539723){return function(_0x20d2ac){if(_0x20d2ac){return _0x20d2ac[_0xd5af('0x26')]()[_0xd5af('0x25')](function(){_0x297511[_0xd5af('0x1c')](0xcc)[_0xd5af('0x1d')]();});}};}function handleEntityNotFound(_0x35234c,_0x28e607){return function(_0x423f8c){if(!_0x423f8c){_0x35234c[_0xd5af('0x1b')](0x194);}return _0x423f8c;};}function handleError(_0x1fc89c,_0x377794){_0x377794=_0x377794||0x1f4;return function(_0x4779f6){logger[_0xd5af('0x27')](_0x4779f6[_0xd5af('0x28')]);if(_0x4779f6[_0xd5af('0x29')]){delete _0x4779f6['name'];}_0x1fc89c['status'](_0x377794)[_0xd5af('0x2a')](_0x4779f6);};}exports['index']=function(_0x554b78,_0x4a76a8){var _0xda66b4={},_0xccbdd5={},_0x2f3cc0={'count':0x0,'rows':[]};var _0x240f43=_[_0xd5af('0x2b')](db[_0xd5af('0x2c')][_0xd5af('0x2d')],function(_0x10a674){return{'name':_0x10a674['fieldName'],'type':_0x10a674[_0xd5af('0x2e')][_0xd5af('0x2f')]};});_0xccbdd5['model']=_['map'](_0x240f43,'name');_0xccbdd5[_0xd5af('0x30')]=_['keys'](_0x554b78[_0xd5af('0x30')]);_0xccbdd5[_0xd5af('0x31')]=_['intersection'](_0xccbdd5[_0xd5af('0x32')],_0xccbdd5[_0xd5af('0x30')]);_0xda66b4[_0xd5af('0x33')]=_[_0xd5af('0x34')](_0xccbdd5[_0xd5af('0x32')],qs[_0xd5af('0x35')](_0x554b78[_0xd5af('0x30')][_0xd5af('0x35')]));_0xda66b4[_0xd5af('0x33')]=_0xda66b4[_0xd5af('0x33')]['length']?_0xda66b4['attributes']:_0xccbdd5[_0xd5af('0x32')];if(!_0x554b78[_0xd5af('0x30')][_0xd5af('0x36')](_0xd5af('0x37'))){_0xda66b4[_0xd5af('0x20')]=qs[_0xd5af('0x20')](_0x554b78['query']['limit']);_0xda66b4[_0xd5af('0x1f')]=qs[_0xd5af('0x1f')](_0x554b78[_0xd5af('0x30')][_0xd5af('0x1f')]);}_0xda66b4[_0xd5af('0x38')]=qs[_0xd5af('0x39')](_0x554b78[_0xd5af('0x30')][_0xd5af('0x39')]);_0xda66b4[_0xd5af('0x3a')]=qs[_0xd5af('0x31')](_[_0xd5af('0x3b')](_0x554b78['query'],_0xccbdd5[_0xd5af('0x31')]));if(_0x554b78[_0xd5af('0x30')][_0xd5af('0x3c')]){_0xda66b4[_0xd5af('0x3a')]=_[_0xd5af('0x3d')](_0xda66b4[_0xd5af('0x3a')],{'$or':_[_0xd5af('0x2b')](_0x240f43,function(_0x4cea3d){if(_0x4cea3d[_0xd5af('0x2e')][_0xd5af('0x2f')]!=='VIRTUAL'){var _0x2e0b1d={};_0x2e0b1d[_0x4cea3d['field']]={'$like':'%'+_0x554b78[_0xd5af('0x30')][_0xd5af('0x3c')]+'%'};return _0x2e0b1d;}})});}_0xda66b4=_[_0xd5af('0x3d')]({},_0xda66b4,_0x554b78[_0xd5af('0x3e')]);var _0x3dd0ea={'where':_0xda66b4['where']};return db[_0xd5af('0x2c')][_0xd5af('0x1e')](_0x3dd0ea)[_0xd5af('0x25')](function(_0x2e7d09){_0x2f3cc0[_0xd5af('0x1e')]=_0x2e7d09;if(_0x554b78[_0xd5af('0x30')]['includeAll']){_0xda66b4[_0xd5af('0x3f')]=[{'all':!![]}];}return db[_0xd5af('0x2c')][_0xd5af('0x40')](_0xda66b4);})[_0xd5af('0x25')](function(_0x442519){_0x2f3cc0[_0xd5af('0x41')]=_0x442519;return _0x2f3cc0;})[_0xd5af('0x25')](respondWithFilteredResult(_0x4a76a8,_0xda66b4))[_0xd5af('0x42')](handleError(_0x4a76a8,null));};exports['show']=function(_0x55a517,_0x20401f){var _0x196ac8={'raw':!![],'where':{'id':_0x55a517[_0xd5af('0x43')]['id']}},_0x45d543={};_0x45d543[_0xd5af('0x32')]=_['keys'](db[_0xd5af('0x2c')][_0xd5af('0x2d')]);_0x45d543[_0xd5af('0x30')]=_[_0xd5af('0x44')](_0x55a517[_0xd5af('0x30')]);_0x45d543[_0xd5af('0x31')]=_[_0xd5af('0x34')](_0x45d543[_0xd5af('0x32')],_0x45d543['query']);_0x196ac8[_0xd5af('0x33')]=_[_0xd5af('0x34')](_0x45d543['model'],qs[_0xd5af('0x35')](_0x55a517[_0xd5af('0x30')][_0xd5af('0x35')]));_0x196ac8['attributes']=_0x196ac8[_0xd5af('0x33')][_0xd5af('0x45')]?_0x196ac8[_0xd5af('0x33')]:_0x45d543[_0xd5af('0x32')];if(_0x55a517[_0xd5af('0x30')][_0xd5af('0x46')]){_0x196ac8[_0xd5af('0x3f')]=[{'all':!![]}];}_0x196ac8=_['merge']({},_0x196ac8,_0x55a517[_0xd5af('0x3e')]);return db[_0xd5af('0x2c')]['find'](_0x196ac8)['then'](handleEntityNotFound(_0x20401f,null))[_0xd5af('0x25')](respondWithResult(_0x20401f,null))[_0xd5af('0x42')](handleError(_0x20401f,null));};exports[_0xd5af('0x47')]=function(_0x46ce0c,_0x53293b){return db[_0xd5af('0x2c')]['create'](_0x46ce0c[_0xd5af('0x48')],{})[_0xd5af('0x25')](respondWithResult(_0x53293b,0xc9))['catch'](handleError(_0x53293b,null));};exports[_0xd5af('0x24')]=function(_0x532878,_0xbe3414){if(_0x532878['body']['id']){delete _0x532878[_0xd5af('0x48')]['id'];}return db['ZohoField'][_0xd5af('0x49')]({'where':{'id':_0x532878[_0xd5af('0x43')]['id']}})[_0xd5af('0x25')](handleEntityNotFound(_0xbe3414,null))[_0xd5af('0x25')](saveUpdates(_0x532878[_0xd5af('0x48')],null))[_0xd5af('0x25')](respondWithResult(_0xbe3414,null))[_0xd5af('0x42')](handleError(_0xbe3414,null));};exports[_0xd5af('0x26')]=function(_0x3361ba,_0x192fa0){return db['ZohoField'][_0xd5af('0x49')]({'where':{'id':_0x3361ba[_0xd5af('0x43')]['id']}})[_0xd5af('0x25')](handleEntityNotFound(_0x192fa0,null))[_0xd5af('0x25')](removeEntity(_0x192fa0,null))[_0xd5af('0x42')](handleError(_0x192fa0,null));}; \ No newline at end of file +var _0x49b7=['rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','sendStatus','status','end','count','offset','limit','Content-Range','json','reject','save','update','then','destroy','error','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','filter','VIRTUAL','field','merge','options','ZohoField','includeAll','include','catch','show','params','find','create','body','html-pdf'];(function(_0x39e84d,_0x11931d){var _0x1991bc=function(_0xc81e32){while(--_0xc81e32){_0x39e84d['push'](_0x39e84d['shift']());}};_0x1991bc(++_0x11931d);}(_0x49b7,0x10f));var _0x749b=function(_0x52b7b9,_0x43ed4b){_0x52b7b9=_0x52b7b9-0x0;var _0x5b5d30=_0x49b7[_0x52b7b9];return _0x5b5d30;};'use strict';var pdf=require(_0x749b('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x749b('0x1'));var zipdir=require(_0x749b('0x2'));var jsonpatch=require(_0x749b('0x3'));var rp=require(_0x749b('0x4'));var moment=require(_0x749b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x749b('0x6'));var util=require(_0x749b('0x7'));var path=require(_0x749b('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x749b('0x9'));var squel=require(_0x749b('0xa'));var crypto=require('crypto');var jsforce=require(_0x749b('0xb'));var deskjs=require(_0x749b('0xc'));var toCsv=require(_0x749b('0xd'));var querystring=require(_0x749b('0xe'));var Papa=require(_0x749b('0xf'));var Redis=require(_0x749b('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x749b('0x11'));var as=require(_0x749b('0x12'));var hardwareService=require(_0x749b('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x749b('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x243c97,_0x1fd20d){_0x1fd20d=_0x1fd20d||0xcc;return function(_0x2c6028){if(_0x2c6028){return _0x243c97[_0x749b('0x15')](_0x1fd20d);}return _0x243c97[_0x749b('0x16')](_0x1fd20d)[_0x749b('0x17')]();};}function respondWithResult(_0x34c18d,_0x146aaf){_0x146aaf=_0x146aaf||0xc8;return function(_0x109838){if(_0x109838){return _0x34c18d[_0x749b('0x16')](_0x146aaf)['json'](_0x109838);}};}function respondWithFilteredResult(_0x1e8bc5,_0x4446ed){return function(_0x1fccae){if(_0x1fccae){var _0x579f35=_0x1fccae[_0x749b('0x18')],_0x313718=_0x4446ed['offset'],_0x3600d0=_0x4446ed[_0x749b('0x19')]+_0x4446ed[_0x749b('0x1a')],_0x347e51;if(_0x3600d0>=_0x579f35){_0x3600d0=_0x579f35;_0x347e51=0xc8;}else{_0x347e51=0xce;}_0x1e8bc5['status'](_0x347e51);return _0x1e8bc5['set'](_0x749b('0x1b'),_0x313718+'-'+_0x3600d0+'/'+_0x579f35)[_0x749b('0x1c')](_0x1fccae);}return null;};}function patchUpdates(_0x5e2f3e){return function(_0x1a0e38){try{jsonpatch['apply'](_0x1a0e38,_0x5e2f3e,!![]);}catch(_0x146b89){return BPromise[_0x749b('0x1d')](_0x146b89);}return _0x1a0e38[_0x749b('0x1e')]();};}function saveUpdates(_0x237a08,_0x42c263){return function(_0x21d617){if(_0x21d617){return _0x21d617[_0x749b('0x1f')](_0x237a08)[_0x749b('0x20')](function(_0x4fc1a0){return _0x4fc1a0;});}return null;};}function removeEntity(_0x3bc3ac,_0x1e8372){return function(_0x27f855){if(_0x27f855){return _0x27f855[_0x749b('0x21')]()[_0x749b('0x20')](function(){_0x3bc3ac[_0x749b('0x16')](0xcc)[_0x749b('0x17')]();});}};}function handleEntityNotFound(_0x15dda9,_0x396e2f){return function(_0x491969){if(!_0x491969){_0x15dda9[_0x749b('0x15')](0x194);}return _0x491969;};}function handleError(_0x19f2e6,_0xe9f2c3){_0xe9f2c3=_0xe9f2c3||0x1f4;return function(_0x49c69c){logger[_0x749b('0x22')](_0x49c69c['stack']);if(_0x49c69c[_0x749b('0x23')]){delete _0x49c69c['name'];}_0x19f2e6[_0x749b('0x16')](_0xe9f2c3)[_0x749b('0x24')](_0x49c69c);};}exports[_0x749b('0x25')]=function(_0x2c84c9,_0x4c156e){var _0x4aa3da={},_0x1c1739={},_0x42902e={'count':0x0,'rows':[]};var _0x46bfba=_[_0x749b('0x26')](db['ZohoField'][_0x749b('0x27')],function(_0x1dd9f1){return{'name':_0x1dd9f1[_0x749b('0x28')],'type':_0x1dd9f1[_0x749b('0x29')]['key']};});_0x1c1739[_0x749b('0x2a')]=_['map'](_0x46bfba,'name');_0x1c1739[_0x749b('0x2b')]=_[_0x749b('0x2c')](_0x2c84c9[_0x749b('0x2b')]);_0x1c1739[_0x749b('0x2d')]=_['intersection'](_0x1c1739['model'],_0x1c1739[_0x749b('0x2b')]);_0x4aa3da[_0x749b('0x2e')]=_[_0x749b('0x2f')](_0x1c1739['model'],qs[_0x749b('0x30')](_0x2c84c9[_0x749b('0x2b')]['fields']));_0x4aa3da['attributes']=_0x4aa3da['attributes'][_0x749b('0x31')]?_0x4aa3da['attributes']:_0x1c1739[_0x749b('0x2a')];if(!_0x2c84c9[_0x749b('0x2b')]['hasOwnProperty'](_0x749b('0x32'))){_0x4aa3da[_0x749b('0x1a')]=qs[_0x749b('0x1a')](_0x2c84c9[_0x749b('0x2b')][_0x749b('0x1a')]);_0x4aa3da['offset']=qs[_0x749b('0x19')](_0x2c84c9['query'][_0x749b('0x19')]);}_0x4aa3da[_0x749b('0x33')]=qs[_0x749b('0x34')](_0x2c84c9[_0x749b('0x2b')]['sort']);_0x4aa3da[_0x749b('0x35')]=qs[_0x749b('0x2d')](_['pick'](_0x2c84c9[_0x749b('0x2b')],_0x1c1739[_0x749b('0x2d')]));if(_0x2c84c9[_0x749b('0x2b')][_0x749b('0x36')]){_0x4aa3da['where']=_['merge'](_0x4aa3da[_0x749b('0x35')],{'$or':_['map'](_0x46bfba,function(_0x5f1b60){if(_0x5f1b60[_0x749b('0x29')]['key']!==_0x749b('0x37')){var _0x2f35d5={};_0x2f35d5[_0x5f1b60[_0x749b('0x38')]]={'$like':'%'+_0x2c84c9[_0x749b('0x2b')]['filter']+'%'};return _0x2f35d5;}})});}_0x4aa3da=_[_0x749b('0x39')]({},_0x4aa3da,_0x2c84c9[_0x749b('0x3a')]);var _0x3c30af={'where':_0x4aa3da['where']};return db[_0x749b('0x3b')][_0x749b('0x18')](_0x3c30af)[_0x749b('0x20')](function(_0x525c2b){_0x42902e['count']=_0x525c2b;if(_0x2c84c9[_0x749b('0x2b')][_0x749b('0x3c')]){_0x4aa3da[_0x749b('0x3d')]=[{'all':!![]}];}return db[_0x749b('0x3b')]['findAll'](_0x4aa3da);})[_0x749b('0x20')](function(_0x3381ac){_0x42902e['rows']=_0x3381ac;return _0x42902e;})[_0x749b('0x20')](respondWithFilteredResult(_0x4c156e,_0x4aa3da))[_0x749b('0x3e')](handleError(_0x4c156e,null));};exports[_0x749b('0x3f')]=function(_0x444de7,_0x10d882){var _0x5f1f2a={'raw':!![],'where':{'id':_0x444de7[_0x749b('0x40')]['id']}},_0x3b1294={};_0x3b1294['model']=_[_0x749b('0x2c')](db['ZohoField'][_0x749b('0x27')]);_0x3b1294[_0x749b('0x2b')]=_[_0x749b('0x2c')](_0x444de7[_0x749b('0x2b')]);_0x3b1294[_0x749b('0x2d')]=_[_0x749b('0x2f')](_0x3b1294[_0x749b('0x2a')],_0x3b1294[_0x749b('0x2b')]);_0x5f1f2a[_0x749b('0x2e')]=_[_0x749b('0x2f')](_0x3b1294['model'],qs[_0x749b('0x30')](_0x444de7[_0x749b('0x2b')]['fields']));_0x5f1f2a[_0x749b('0x2e')]=_0x5f1f2a[_0x749b('0x2e')][_0x749b('0x31')]?_0x5f1f2a[_0x749b('0x2e')]:_0x3b1294[_0x749b('0x2a')];if(_0x444de7[_0x749b('0x2b')][_0x749b('0x3c')]){_0x5f1f2a[_0x749b('0x3d')]=[{'all':!![]}];}_0x5f1f2a=_[_0x749b('0x39')]({},_0x5f1f2a,_0x444de7[_0x749b('0x3a')]);return db['ZohoField'][_0x749b('0x41')](_0x5f1f2a)[_0x749b('0x20')](handleEntityNotFound(_0x10d882,null))['then'](respondWithResult(_0x10d882,null))[_0x749b('0x3e')](handleError(_0x10d882,null));};exports[_0x749b('0x42')]=function(_0x117a09,_0x327552){return db[_0x749b('0x3b')][_0x749b('0x42')](_0x117a09[_0x749b('0x43')],{})[_0x749b('0x20')](respondWithResult(_0x327552,0xc9))['catch'](handleError(_0x327552,null));};exports[_0x749b('0x1f')]=function(_0x42b30d,_0x3e52fe){if(_0x42b30d[_0x749b('0x43')]['id']){delete _0x42b30d[_0x749b('0x43')]['id'];}return db[_0x749b('0x3b')][_0x749b('0x41')]({'where':{'id':_0x42b30d[_0x749b('0x40')]['id']}})['then'](handleEntityNotFound(_0x3e52fe,null))[_0x749b('0x20')](saveUpdates(_0x42b30d[_0x749b('0x43')],null))['then'](respondWithResult(_0x3e52fe,null))['catch'](handleError(_0x3e52fe,null));};exports[_0x749b('0x21')]=function(_0x16fc53,_0x59180f){return db[_0x749b('0x3b')][_0x749b('0x41')]({'where':{'id':_0x16fc53[_0x749b('0x40')]['id']}})[_0x749b('0x20')](handleEntityNotFound(_0x59180f,null))[_0x749b('0x20')](removeEntity(_0x59180f,null))['catch'](handleError(_0x59180f,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index d90ff3b..a1b1389 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 _0x252e=['util','../../config/logger','moment','rimraf','../../config/environment','./intZohoField.attributes','define','int_zoho_fields','idField','FieldId','lodash'];(function(_0x51de83,_0x258ed8){var _0x29640c=function(_0x1dad92){while(--_0x1dad92){_0x51de83['push'](_0x51de83['shift']());}};_0x29640c(++_0x258ed8);}(_0x252e,0x99));var _0xe252=function(_0x1a5ef1,_0x5b7070){_0x1a5ef1=_0x1a5ef1-0x0;var _0x357a6a=_0x252e[_0x1a5ef1];return _0x357a6a;};'use strict';var _=require(_0xe252('0x0'));var util=require(_0xe252('0x1'));var logger=require(_0xe252('0x2'))('api');var moment=require(_0xe252('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe252('0x4'));var config=require(_0xe252('0x5'));var attributes=require(_0xe252('0x6'));module['exports']=function(_0x49368b,_0x49cf97){return _0x49368b[_0xe252('0x7')]('ZohoField',attributes,{'tableName':_0xe252('0x8'),'paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':[_0xe252('0x9'),_0xe252('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0c10=['ZohoField','int_zoho_fields','zoho_unique_index','idField','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define'];(function(_0x4eb72c,_0x11fd9a){var _0x2431a6=function(_0x3e1293){while(--_0x3e1293){_0x4eb72c['push'](_0x4eb72c['shift']());}};_0x2431a6(++_0x11fd9a);}(_0x0c10,0x138));var _0x00c1=function(_0x2236dc,_0x43c7f9){_0x2236dc=_0x2236dc-0x0;var _0x20583f=_0x0c10[_0x2236dc];return _0x20583f;};'use strict';var _=require(_0x00c1('0x0'));var util=require(_0x00c1('0x1'));var logger=require(_0x00c1('0x2'))('api');var moment=require(_0x00c1('0x3'));var BPromise=require(_0x00c1('0x4'));var rp=require(_0x00c1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x00c1('0x6'));var config=require(_0x00c1('0x7'));var attributes=require('./intZohoField.attributes');module[_0x00c1('0x8')]=function(_0x1b69d4,_0x2d5325){return _0x1b69d4[_0x00c1('0x9')](_0x00c1('0xa'),attributes,{'tableName':_0x00c1('0xb'),'paranoid':![],'indexes':[{'name':_0x00c1('0xc'),'fields':[_0x00c1('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.rpc.js b/server/api/intZohoField/intZohoField.rpc.js index 47d4467..f0baac0 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 _0x4bc3=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','debug','ZohoField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','ZohoField,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x16390c,_0x462ee9){var _0x1f01d7=function(_0x238737){while(--_0x238737){_0x16390c['push'](_0x16390c['shift']());}};_0x1f01d7(++_0x462ee9);}(_0x4bc3,0x16e));var _0x34bc=function(_0x5627e1,_0x1b2dbf){_0x5627e1=_0x5627e1-0x0;var _0x2f013f=_0x4bc3[_0x5627e1];return _0x2f013f;};'use strict';var _=require(_0x34bc('0x0'));var util=require(_0x34bc('0x1'));var moment=require('moment');var BPromise=require(_0x34bc('0x2'));var rs=require(_0x34bc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x34bc('0x4'))['db'];var utils=require(_0x34bc('0x5'));var logger=require(_0x34bc('0x6'))(_0x34bc('0x7'));var config=require(_0x34bc('0x8'));var jayson=require(_0x34bc('0x9'));var client=jayson[_0x34bc('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x21451b,_0x50320d,_0x502087){return new BPromise(function(_0x18a01c,_0x474108){return client[_0x34bc('0xb')](_0x21451b,_0x502087)[_0x34bc('0xc')](function(_0x409105){logger[_0x34bc('0xd')]('ZohoField,\x20%s,\x20%s',_0x50320d,'request\x20sent');logger[_0x34bc('0xe')](_0x34bc('0xf'),_0x50320d,_0x34bc('0x10'),JSON['stringify'](_0x409105));if(_0x409105[_0x34bc('0x11')]){if(_0x409105['error'][_0x34bc('0x12')]===0x1f4){logger[_0x34bc('0x11')](_0x34bc('0x13'),_0x50320d,_0x409105['error'][_0x34bc('0x14')]);return _0x474108(_0x409105['error'][_0x34bc('0x14')]);}logger[_0x34bc('0x11')](_0x34bc('0x13'),_0x50320d,_0x409105['error']['message']);return _0x18a01c(_0x409105[_0x34bc('0x11')]['message']);}else{logger[_0x34bc('0xd')](_0x34bc('0x13'),_0x50320d,_0x34bc('0x10'));_0x18a01c(_0x409105[_0x34bc('0x15')][_0x34bc('0x14')]);}})[_0x34bc('0x16')](function(_0x5e132d){logger['error']('ZohoField,\x20%s,\x20%s',_0x50320d,_0x5e132d);_0x474108(_0x5e132d);});});} \ No newline at end of file +var _0xeec6=['then','info','ZohoField,\x20%s,\x20%s,\x20%s','request\x20sent','error','ZohoField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x5037ab,_0x43209e){var _0x512adb=function(_0x261783){while(--_0x261783){_0x5037ab['push'](_0x5037ab['shift']());}};_0x512adb(++_0x43209e);}(_0xeec6,0x1c2));var _0x6eec=function(_0xcdf809,_0x2881f0){_0xcdf809=_0xcdf809-0x0;var _0x4d4d70=_0xeec6[_0xcdf809];return _0x4d4d70;};'use strict';var _=require(_0x6eec('0x0'));var util=require(_0x6eec('0x1'));var moment=require(_0x6eec('0x2'));var BPromise=require(_0x6eec('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6eec('0x4'));var db=require(_0x6eec('0x5'))['db'];var utils=require(_0x6eec('0x6'));var logger=require(_0x6eec('0x7'))(_0x6eec('0x8'));var config=require(_0x6eec('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6eec('0xa')][_0x6eec('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x48064a,_0x5a5e47,_0x1c810e){return new BPromise(function(_0x3443c2,_0x834c2){return client['request'](_0x48064a,_0x1c810e)[_0x6eec('0xc')](function(_0x3aca38){logger[_0x6eec('0xd')]('ZohoField,\x20%s,\x20%s',_0x5a5e47,'request\x20sent');logger['debug'](_0x6eec('0xe'),_0x5a5e47,_0x6eec('0xf'),JSON['stringify'](_0x3aca38));if(_0x3aca38['error']){if(_0x3aca38[_0x6eec('0x10')]['code']===0x1f4){logger[_0x6eec('0x10')](_0x6eec('0x11'),_0x5a5e47,_0x3aca38[_0x6eec('0x10')][_0x6eec('0x12')]);return _0x834c2(_0x3aca38[_0x6eec('0x10')]['message']);}logger[_0x6eec('0x10')](_0x6eec('0x11'),_0x5a5e47,_0x3aca38[_0x6eec('0x10')][_0x6eec('0x12')]);return _0x3443c2(_0x3aca38[_0x6eec('0x10')][_0x6eec('0x12')]);}else{logger[_0x6eec('0xd')](_0x6eec('0x11'),_0x5a5e47,_0x6eec('0xf'));_0x3443c2(_0x3aca38[_0x6eec('0x13')]['message']);}})[_0x6eec('0x14')](function(_0x5f1f33){logger[_0x6eec('0x10')](_0x6eec('0x11'),_0x5a5e47,_0x5f1f33);_0x834c2(_0x5f1f33);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 0820636..9cefb3f 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 _0x0a50=['Router','../../components/interaction/service','../../config/environment','exports','multer','util','connect-timeout','express'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x0a50,0x154));var _0x00a5=function(_0x5453a5,_0xd90cd6){_0x5453a5=_0x5453a5-0x0;var _0x18a128=_0x0a50[_0x5453a5];return _0x18a128;};'use strict';var multer=require(_0x00a5('0x0'));var util=require(_0x00a5('0x1'));var path=require('path');var timeout=require(_0x00a5('0x2'));var express=require(_0x00a5('0x3'));var router=express[_0x00a5('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x00a5('0x5'));var config=require(_0x00a5('0x6'));module[_0x00a5('0x7')]=router; \ No newline at end of file +var _0xc418=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','util','connect-timeout','express'];(function(_0x2e5a96,_0x5f5c5c){var _0x381f1b=function(_0x2422e0){while(--_0x2422e0){_0x2e5a96['push'](_0x2e5a96['shift']());}};_0x381f1b(++_0x5f5c5c);}(_0xc418,0xad));var _0x8c41=function(_0x4653da,_0x2fb9a3){_0x4653da=_0x4653da-0x0;var _0x1df655=_0xc418[_0x4653da];return _0x1df655;};'use strict';var multer=require('multer');var util=require(_0x8c41('0x0'));var path=require('path');var timeout=require(_0x8c41('0x1'));var express=require(_0x8c41('0x2'));var router=express[_0x8c41('0x3')]();var auth=require(_0x8c41('0x4'));var interaction=require(_0x8c41('0x5'));var config=require(_0x8c41('0x6'));module[_0x8c41('0x7')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 2c703c6..0a1f68d 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 _0xe720=['STRING','unique_name_and_version','app.js','INTEGER','BOOLEAN','exports'];(function(_0x4a1323,_0x251797){var _0x27ddec=function(_0x292371){while(--_0x292371){_0x4a1323['push'](_0x4a1323['shift']());}};_0x27ddec(++_0x251797);}(_0xe720,0xad));var _0x0e72=function(_0x3bacb4,_0x2018e2){_0x3bacb4=_0x3bacb4-0x0;var _0x576ec5=_0xe720[_0x3bacb4];return _0x576ec5;};'use strict';var Sequelize=require('sequelize');module[_0x0e72('0x0')]={'name':{'type':Sequelize[_0x0e72('0x1')],'allowNull':![],'unique':_0x0e72('0x2')},'version':{'type':Sequelize[_0x0e72('0x1')],'allowNull':![],'unique':_0x0e72('0x2')},'main':{'type':Sequelize['STRING'],'defaultValue':_0x0e72('0x3')},'filename':{'type':Sequelize[_0x0e72('0x1')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize[_0x0e72('0x4')]},'active':{'type':Sequelize[_0x0e72('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0x0e72('0x1')]},'logo':{'type':Sequelize[_0x0e72('0x1')]},'state':{'type':Sequelize[_0x0e72('0x1')],'unique':'state'},'description':{'type':Sequelize[_0x0e72('0x1')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0e72('0x1')]},'link':{'type':Sequelize[_0x0e72('0x1')],'defaultValue':'#'}}; \ No newline at end of file +var _0xe711=['BOOLEAN','state','sequelize','exports','STRING','unique_name_and_version','app.js','INTEGER'];(function(_0x2e04b6,_0xd8ff75){var _0x3ef5cc=function(_0x11ffe3){while(--_0x11ffe3){_0x2e04b6['push'](_0x2e04b6['shift']());}};_0x3ef5cc(++_0xd8ff75);}(_0xe711,0x102));var _0x1e71=function(_0x43b4d4,_0x156bb9){_0x43b4d4=_0x43b4d4-0x0;var _0xf19b92=_0xe711[_0x43b4d4];return _0xf19b92;};'use strict';var Sequelize=require(_0x1e71('0x0'));module[_0x1e71('0x1')]={'name':{'type':Sequelize[_0x1e71('0x2')],'allowNull':![],'unique':_0x1e71('0x3')},'version':{'type':Sequelize[_0x1e71('0x2')],'allowNull':![],'unique':_0x1e71('0x3')},'main':{'type':Sequelize[_0x1e71('0x2')],'defaultValue':_0x1e71('0x4')},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0x1e71('0x2')]},'type':{'type':Sequelize[_0x1e71('0x2')]},'size':{'type':Sequelize[_0x1e71('0x5')]},'active':{'type':Sequelize[_0x1e71('0x6')],'defaultValue':![]},'author':{'type':Sequelize[_0x1e71('0x2')]},'logo':{'type':Sequelize[_0x1e71('0x2')]},'state':{'type':Sequelize[_0x1e71('0x2')],'unique':_0x1e71('0x7')},'description':{'type':Sequelize[_0x1e71('0x2')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x1e71('0x2')]},'link':{'type':Sequelize[_0x1e71('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 a2e51fb..0c1af74 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 _0x44f8=['findAll','rows','catch','params','include','find','create','update','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/utils','../../config/environment','end','status','json','offset','set','apply','reject','save','then','destroy','error','stack','name','send','index','map','Integration','fieldName','type','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter','merge','field','options','count','includeAll'];(function(_0x3c4d42,_0x198aa4){var _0x236817=function(_0x19d686){while(--_0x19d686){_0x3c4d42['push'](_0x3c4d42['shift']());}};_0x236817(++_0x198aa4);}(_0x44f8,0x1de));var _0x844f=function(_0x4dfefe,_0xdca72){_0x4dfefe=_0x4dfefe-0x0;var _0x452847=_0x44f8[_0x4dfefe];return _0x452847;};'use strict';var pdf=require(_0x844f('0x0'));var emlformat=require(_0x844f('0x1'));var rimraf=require(_0x844f('0x2'));var zipdir=require(_0x844f('0x3'));var jsonpatch=require(_0x844f('0x4'));var rp=require(_0x844f('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x844f('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x844f('0x7'));var ejs=require(_0x844f('0x8'));var fs=require('fs');var _=require(_0x844f('0x9'));var squel=require(_0x844f('0xa'));var crypto=require(_0x844f('0xb'));var jsforce=require(_0x844f('0xc'));var deskjs=require(_0x844f('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x844f('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x844f('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x844f('0x10'));var config=require(_0x844f('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a67fd,_0x110dc2){_0x110dc2=_0x110dc2||0xcc;return function(_0x2320fc){if(_0x2320fc){return _0x2a67fd['sendStatus'](_0x110dc2);}return _0x2a67fd['status'](_0x110dc2)[_0x844f('0x12')]();};}function respondWithResult(_0x4dfe2e,_0x3137c1){_0x3137c1=_0x3137c1||0xc8;return function(_0x31a0d9){if(_0x31a0d9){return _0x4dfe2e[_0x844f('0x13')](_0x3137c1)[_0x844f('0x14')](_0x31a0d9);}};}function respondWithFilteredResult(_0xb61e4f,_0x486fa0){return function(_0x5da4ab){if(_0x5da4ab){var _0x1b04a9=_0x5da4ab['count'],_0x149f21=_0x486fa0[_0x844f('0x15')],_0x37a208=_0x486fa0['offset']+_0x486fa0['limit'],_0x9f7182;if(_0x37a208>=_0x1b04a9){_0x37a208=_0x1b04a9;_0x9f7182=0xc8;}else{_0x9f7182=0xce;}_0xb61e4f[_0x844f('0x13')](_0x9f7182);return _0xb61e4f[_0x844f('0x16')]('Content-Range',_0x149f21+'-'+_0x37a208+'/'+_0x1b04a9)[_0x844f('0x14')](_0x5da4ab);}return null;};}function patchUpdates(_0x5154ba){return function(_0x51900c){try{jsonpatch[_0x844f('0x17')](_0x51900c,_0x5154ba,!![]);}catch(_0x541997){return BPromise[_0x844f('0x18')](_0x541997);}return _0x51900c[_0x844f('0x19')]();};}function saveUpdates(_0x468bec,_0x38e732){return function(_0x3f5060){if(_0x3f5060){return _0x3f5060['update'](_0x468bec)[_0x844f('0x1a')](function(_0x5e1e88){return _0x5e1e88;});}return null;};}function removeEntity(_0x558cc2,_0x3f83cd){return function(_0x4261b6){if(_0x4261b6){return _0x4261b6[_0x844f('0x1b')]()[_0x844f('0x1a')](function(){_0x558cc2[_0x844f('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x189523,_0x4bd66d){return function(_0x22c055){if(!_0x22c055){_0x189523['sendStatus'](0x194);}return _0x22c055;};}function handleError(_0xfe678b,_0x19b96a){_0x19b96a=_0x19b96a||0x1f4;return function(_0x1fcc0f){logger[_0x844f('0x1c')](_0x1fcc0f[_0x844f('0x1d')]);if(_0x1fcc0f[_0x844f('0x1e')]){delete _0x1fcc0f[_0x844f('0x1e')];}_0xfe678b['status'](_0x19b96a)[_0x844f('0x1f')](_0x1fcc0f);};}exports[_0x844f('0x20')]=function(_0x2a6b37,_0x1ad3da){var _0x29c4c3={},_0x29d224={},_0x4caee1={'count':0x0,'rows':[]};var _0x3d8bc1=_[_0x844f('0x21')](db[_0x844f('0x22')]['rawAttributes'],function(_0x520102){return{'name':_0x520102[_0x844f('0x23')],'type':_0x520102[_0x844f('0x24')][_0x844f('0x25')]};});_0x29d224['model']=_[_0x844f('0x21')](_0x3d8bc1,'name');_0x29d224[_0x844f('0x26')]=_[_0x844f('0x27')](_0x2a6b37['query']);_0x29d224['filters']=_[_0x844f('0x28')](_0x29d224[_0x844f('0x29')],_0x29d224['query']);_0x29c4c3['attributes']=_[_0x844f('0x28')](_0x29d224[_0x844f('0x29')],qs[_0x844f('0x2a')](_0x2a6b37['query'][_0x844f('0x2a')]));_0x29c4c3[_0x844f('0x2b')]=_0x29c4c3[_0x844f('0x2b')][_0x844f('0x2c')]?_0x29c4c3['attributes']:_0x29d224[_0x844f('0x29')];if(!_0x2a6b37[_0x844f('0x26')][_0x844f('0x2d')](_0x844f('0x2e'))){_0x29c4c3[_0x844f('0x2f')]=qs[_0x844f('0x2f')](_0x2a6b37[_0x844f('0x26')][_0x844f('0x2f')]);_0x29c4c3['offset']=qs[_0x844f('0x15')](_0x2a6b37['query'][_0x844f('0x15')]);}_0x29c4c3[_0x844f('0x30')]=qs[_0x844f('0x31')](_0x2a6b37[_0x844f('0x26')]['sort']);_0x29c4c3[_0x844f('0x32')]=qs[_0x844f('0x33')](_['pick'](_0x2a6b37[_0x844f('0x26')],_0x29d224[_0x844f('0x33')]));if(_0x2a6b37[_0x844f('0x26')][_0x844f('0x34')]){_0x29c4c3[_0x844f('0x32')]=_[_0x844f('0x35')](_0x29c4c3['where'],{'$or':_[_0x844f('0x21')](_0x3d8bc1,function(_0x596f74){if(_0x596f74['type'][_0x844f('0x25')]!=='VIRTUAL'){var _0x4120be={};_0x4120be[_0x596f74[_0x844f('0x36')]]={'$like':'%'+_0x2a6b37[_0x844f('0x26')][_0x844f('0x34')]+'%'};return _0x4120be;}})});}_0x29c4c3=_[_0x844f('0x35')]({},_0x29c4c3,_0x2a6b37[_0x844f('0x37')]);var _0x249b2d={'where':_0x29c4c3[_0x844f('0x32')]};return db[_0x844f('0x22')][_0x844f('0x38')](_0x249b2d)[_0x844f('0x1a')](function(_0x366ebf){_0x4caee1[_0x844f('0x38')]=_0x366ebf;if(_0x2a6b37[_0x844f('0x26')][_0x844f('0x39')]){_0x29c4c3['include']=[{'all':!![]}];}return db['Integration'][_0x844f('0x3a')](_0x29c4c3);})['then'](function(_0x97cc7d){_0x4caee1[_0x844f('0x3b')]=_0x97cc7d;return _0x4caee1;})['then'](respondWithFilteredResult(_0x1ad3da,_0x29c4c3))[_0x844f('0x3c')](handleError(_0x1ad3da,null));};exports['show']=function(_0x50f762,_0x2b3b4d){var _0x4ba742={'raw':![],'where':{'id':_0x50f762[_0x844f('0x3d')]['id']}},_0x5a2a83={};_0x5a2a83[_0x844f('0x29')]=_[_0x844f('0x27')](db[_0x844f('0x22')]['rawAttributes']);_0x5a2a83[_0x844f('0x26')]=_[_0x844f('0x27')](_0x50f762[_0x844f('0x26')]);_0x5a2a83[_0x844f('0x33')]=_['intersection'](_0x5a2a83[_0x844f('0x29')],_0x5a2a83['query']);_0x4ba742['attributes']=_[_0x844f('0x28')](_0x5a2a83[_0x844f('0x29')],qs[_0x844f('0x2a')](_0x50f762[_0x844f('0x26')][_0x844f('0x2a')]));_0x4ba742['attributes']=_0x4ba742[_0x844f('0x2b')][_0x844f('0x2c')]?_0x4ba742['attributes']:_0x5a2a83[_0x844f('0x29')];if(_0x50f762[_0x844f('0x26')][_0x844f('0x39')]){_0x4ba742[_0x844f('0x3e')]=[{'all':!![]}];}_0x4ba742=_[_0x844f('0x35')]({},_0x4ba742,_0x50f762[_0x844f('0x37')]);return db[_0x844f('0x22')][_0x844f('0x3f')](_0x4ba742)[_0x844f('0x1a')](handleEntityNotFound(_0x2b3b4d,null))[_0x844f('0x1a')](respondWithResult(_0x2b3b4d,null))[_0x844f('0x3c')](handleError(_0x2b3b4d,null));};exports['create']=function(_0x2e14cb,_0x4c6749){return db[_0x844f('0x22')][_0x844f('0x40')](_0x2e14cb['body'],{})[_0x844f('0x1a')](respondWithResult(_0x4c6749,0xc9))[_0x844f('0x3c')](handleError(_0x4c6749,null));};exports[_0x844f('0x41')]=function(_0x78a687,_0x1ba780){if(_0x78a687['body']['id']){delete _0x78a687[_0x844f('0x42')]['id'];}return db['Integration'][_0x844f('0x3f')]({'where':{'id':_0x78a687[_0x844f('0x3d')]['id']}})[_0x844f('0x1a')](handleEntityNotFound(_0x1ba780,null))['then'](saveUpdates(_0x78a687[_0x844f('0x42')],null))[_0x844f('0x1a')](respondWithResult(_0x1ba780,null))[_0x844f('0x3c')](handleError(_0x1ba780,null));};exports['destroy']=function(_0x17c388,_0x320832){return db[_0x844f('0x22')][_0x844f('0x3f')]({'where':{'id':_0x17c388[_0x844f('0x3d')]['id']}})['then'](handleEntityNotFound(_0x320832,null))[_0x844f('0x1a')](removeEntity(_0x320832,null))[_0x844f('0x3c')](handleError(_0x320832,null));}; \ No newline at end of file +var _0x0f69=['options','Integration','include','show','includeAll','find','catch','body','update','params','destroy','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','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','../../mysqldb','status','end','count','offset','set','json','apply','reject','save','then','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','field'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x0f69,0x173));var _0x90f6=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0x0f69[_0x3070dc];return _0x431489;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x90f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x90f6('0x1'));var rp=require(_0x90f6('0x2'));var moment=require('moment');var BPromise=require(_0x90f6('0x3'));var Mustache=require(_0x90f6('0x4'));var util=require('util');var path=require(_0x90f6('0x5'));var sox=require('sox');var csv=require(_0x90f6('0x6'));var ejs=require(_0x90f6('0x7'));var fs=require('fs');var _=require(_0x90f6('0x8'));var squel=require(_0x90f6('0x9'));var crypto=require(_0x90f6('0xa'));var jsforce=require(_0x90f6('0xb'));var deskjs=require(_0x90f6('0xc'));var toCsv=require(_0x90f6('0x6'));var querystring=require(_0x90f6('0xd'));var Papa=require(_0x90f6('0xe'));var Redis=require(_0x90f6('0xf'));var authService=require(_0x90f6('0x10'));var qs=require(_0x90f6('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x90f6('0x12'));var logger=require(_0x90f6('0x13'))('api');var utils=require(_0x90f6('0x14'));var config=require('../../config/environment');var db=require(_0x90f6('0x15'))['db'];function respondWithStatusCode(_0x4834ae,_0x4aa86a){_0x4aa86a=_0x4aa86a||0xcc;return function(_0x13ca42){if(_0x13ca42){return _0x4834ae['sendStatus'](_0x4aa86a);}return _0x4834ae[_0x90f6('0x16')](_0x4aa86a)[_0x90f6('0x17')]();};}function respondWithResult(_0x45794b,_0x189351){_0x189351=_0x189351||0xc8;return function(_0x47fd3c){if(_0x47fd3c){return _0x45794b[_0x90f6('0x16')](_0x189351)['json'](_0x47fd3c);}};}function respondWithFilteredResult(_0x5d7ab9,_0x36803b){return function(_0x598737){if(_0x598737){var _0x85ba42=_0x598737[_0x90f6('0x18')],_0x16d692=_0x36803b[_0x90f6('0x19')],_0x18ae4b=_0x36803b[_0x90f6('0x19')]+_0x36803b['limit'],_0x2844bd;if(_0x18ae4b>=_0x85ba42){_0x18ae4b=_0x85ba42;_0x2844bd=0xc8;}else{_0x2844bd=0xce;}_0x5d7ab9[_0x90f6('0x16')](_0x2844bd);return _0x5d7ab9[_0x90f6('0x1a')]('Content-Range',_0x16d692+'-'+_0x18ae4b+'/'+_0x85ba42)[_0x90f6('0x1b')](_0x598737);}return null;};}function patchUpdates(_0x1da2ea){return function(_0x1bc06f){try{jsonpatch[_0x90f6('0x1c')](_0x1bc06f,_0x1da2ea,!![]);}catch(_0x3e6dc0){return BPromise[_0x90f6('0x1d')](_0x3e6dc0);}return _0x1bc06f[_0x90f6('0x1e')]();};}function saveUpdates(_0x47def2,_0x1beb61){return function(_0x3bec2e){if(_0x3bec2e){return _0x3bec2e['update'](_0x47def2)['then'](function(_0x3a8cfe){return _0x3a8cfe;});}return null;};}function removeEntity(_0x585a03,_0x480cd5){return function(_0x763a9b){if(_0x763a9b){return _0x763a9b['destroy']()[_0x90f6('0x1f')](function(){_0x585a03[_0x90f6('0x16')](0xcc)[_0x90f6('0x17')]();});}};}function handleEntityNotFound(_0x31f4ac,_0x31bec5){return function(_0x209244){if(!_0x209244){_0x31f4ac['sendStatus'](0x194);}return _0x209244;};}function handleError(_0xfdeb49,_0x5d2925){_0x5d2925=_0x5d2925||0x1f4;return function(_0x553805){logger[_0x90f6('0x20')](_0x553805[_0x90f6('0x21')]);if(_0x553805[_0x90f6('0x22')]){delete _0x553805[_0x90f6('0x22')];}_0xfdeb49[_0x90f6('0x16')](_0x5d2925)[_0x90f6('0x23')](_0x553805);};}exports[_0x90f6('0x24')]=function(_0x5ee801,_0x4553e3){var _0x4b3f50={},_0x4f7e54={},_0x5b52fe={'count':0x0,'rows':[]};var _0x311824=_[_0x90f6('0x25')](db['Integration'][_0x90f6('0x26')],function(_0x16a770){return{'name':_0x16a770[_0x90f6('0x27')],'type':_0x16a770['type'][_0x90f6('0x28')]};});_0x4f7e54[_0x90f6('0x29')]=_[_0x90f6('0x25')](_0x311824,_0x90f6('0x22'));_0x4f7e54[_0x90f6('0x2a')]=_[_0x90f6('0x2b')](_0x5ee801[_0x90f6('0x2a')]);_0x4f7e54[_0x90f6('0x2c')]=_['intersection'](_0x4f7e54['model'],_0x4f7e54['query']);_0x4b3f50['attributes']=_[_0x90f6('0x2d')](_0x4f7e54['model'],qs[_0x90f6('0x2e')](_0x5ee801[_0x90f6('0x2a')]['fields']));_0x4b3f50['attributes']=_0x4b3f50['attributes'][_0x90f6('0x2f')]?_0x4b3f50[_0x90f6('0x30')]:_0x4f7e54[_0x90f6('0x29')];if(!_0x5ee801[_0x90f6('0x2a')][_0x90f6('0x31')](_0x90f6('0x32'))){_0x4b3f50[_0x90f6('0x33')]=qs['limit'](_0x5ee801[_0x90f6('0x2a')][_0x90f6('0x33')]);_0x4b3f50[_0x90f6('0x19')]=qs[_0x90f6('0x19')](_0x5ee801[_0x90f6('0x2a')]['offset']);}_0x4b3f50[_0x90f6('0x34')]=qs[_0x90f6('0x35')](_0x5ee801[_0x90f6('0x2a')][_0x90f6('0x35')]);_0x4b3f50[_0x90f6('0x36')]=qs[_0x90f6('0x2c')](_[_0x90f6('0x37')](_0x5ee801['query'],_0x4f7e54[_0x90f6('0x2c')]));if(_0x5ee801[_0x90f6('0x2a')][_0x90f6('0x38')]){_0x4b3f50[_0x90f6('0x36')]=_[_0x90f6('0x39')](_0x4b3f50[_0x90f6('0x36')],{'$or':_[_0x90f6('0x25')](_0x311824,function(_0x23588f){if(_0x23588f[_0x90f6('0x3a')][_0x90f6('0x28')]!==_0x90f6('0x3b')){var _0x1c5d17={};_0x1c5d17[_0x23588f[_0x90f6('0x3c')]]={'$like':'%'+_0x5ee801['query'][_0x90f6('0x38')]+'%'};return _0x1c5d17;}})});}_0x4b3f50=_[_0x90f6('0x39')]({},_0x4b3f50,_0x5ee801[_0x90f6('0x3d')]);var _0x3bcb39={'where':_0x4b3f50[_0x90f6('0x36')]};return db[_0x90f6('0x3e')]['count'](_0x3bcb39)['then'](function(_0x4634a7){_0x5b52fe[_0x90f6('0x18')]=_0x4634a7;if(_0x5ee801[_0x90f6('0x2a')]['includeAll']){_0x4b3f50[_0x90f6('0x3f')]=[{'all':!![]}];}return db[_0x90f6('0x3e')]['findAll'](_0x4b3f50);})[_0x90f6('0x1f')](function(_0x23e7b5){_0x5b52fe['rows']=_0x23e7b5;return _0x5b52fe;})['then'](respondWithFilteredResult(_0x4553e3,_0x4b3f50))['catch'](handleError(_0x4553e3,null));};exports[_0x90f6('0x40')]=function(_0x57e7d1,_0x47dbef){var _0x1d691c={'raw':![],'where':{'id':_0x57e7d1['params']['id']}},_0x3e747f={};_0x3e747f['model']=_[_0x90f6('0x2b')](db[_0x90f6('0x3e')][_0x90f6('0x26')]);_0x3e747f[_0x90f6('0x2a')]=_[_0x90f6('0x2b')](_0x57e7d1[_0x90f6('0x2a')]);_0x3e747f[_0x90f6('0x2c')]=_[_0x90f6('0x2d')](_0x3e747f[_0x90f6('0x29')],_0x3e747f[_0x90f6('0x2a')]);_0x1d691c[_0x90f6('0x30')]=_[_0x90f6('0x2d')](_0x3e747f[_0x90f6('0x29')],qs[_0x90f6('0x2e')](_0x57e7d1[_0x90f6('0x2a')][_0x90f6('0x2e')]));_0x1d691c[_0x90f6('0x30')]=_0x1d691c['attributes'][_0x90f6('0x2f')]?_0x1d691c['attributes']:_0x3e747f['model'];if(_0x57e7d1['query'][_0x90f6('0x41')]){_0x1d691c[_0x90f6('0x3f')]=[{'all':!![]}];}_0x1d691c=_[_0x90f6('0x39')]({},_0x1d691c,_0x57e7d1['options']);return db['Integration'][_0x90f6('0x42')](_0x1d691c)[_0x90f6('0x1f')](handleEntityNotFound(_0x47dbef,null))[_0x90f6('0x1f')](respondWithResult(_0x47dbef,null))[_0x90f6('0x43')](handleError(_0x47dbef,null));};exports['create']=function(_0x5d39b6,_0x1b2a45){return db['Integration']['create'](_0x5d39b6[_0x90f6('0x44')],{})[_0x90f6('0x1f')](respondWithResult(_0x1b2a45,0xc9))['catch'](handleError(_0x1b2a45,null));};exports[_0x90f6('0x45')]=function(_0x45e455,_0x5cf2a3){if(_0x45e455[_0x90f6('0x44')]['id']){delete _0x45e455[_0x90f6('0x44')]['id'];}return db[_0x90f6('0x3e')][_0x90f6('0x42')]({'where':{'id':_0x45e455[_0x90f6('0x46')]['id']}})[_0x90f6('0x1f')](handleEntityNotFound(_0x5cf2a3,null))[_0x90f6('0x1f')](saveUpdates(_0x45e455[_0x90f6('0x44')],null))[_0x90f6('0x1f')](respondWithResult(_0x5cf2a3,null))[_0x90f6('0x43')](handleError(_0x5cf2a3,null));};exports[_0x90f6('0x47')]=function(_0x31af78,_0x355c05){return db[_0x90f6('0x3e')]['find']({'where':{'id':_0x31af78[_0x90f6('0x46')]['id']}})[_0x90f6('0x1f')](handleEntityNotFound(_0x355c05,null))['then'](removeEntity(_0x355c05,null))[_0x90f6('0x43')](handleError(_0x355c05,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 8e702c4..f807a4c 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 _0xef0b=['define','integrations','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./integration.attributes','exports'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xef0b,0x106));var _0xbef0=function(_0x5e3054,_0xbc78f1){_0x5e3054=_0x5e3054-0x0;var _0x222747=_0xef0b[_0x5e3054];return _0x222747;};'use strict';var _=require(_0xbef0('0x0'));var util=require(_0xbef0('0x1'));var logger=require(_0xbef0('0x2'))(_0xbef0('0x3'));var moment=require('moment');var BPromise=require(_0xbef0('0x4'));var rp=require(_0xbef0('0x5'));var fs=require('fs');var path=require(_0xbef0('0x6'));var rimraf=require(_0xbef0('0x7'));var config=require(_0xbef0('0x8'));var attributes=require(_0xbef0('0x9'));module[_0xbef0('0xa')]=function(_0xba162,_0x914ec9){return _0xba162[_0xbef0('0xb')]('Integration',attributes,{'tableName':_0xbef0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfb5d=['exports','define','../../config/logger','moment','request-promise','rimraf','../../config/environment','./integration.attributes'];(function(_0x1d7557,_0xda42c7){var _0x66fa85=function(_0x3382f5){while(--_0x3382f5){_0x1d7557['push'](_0x1d7557['shift']());}};_0x66fa85(++_0xda42c7);}(_0xfb5d,0x172));var _0xdfb5=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xfb5d[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xdfb5('0x0'))('api');var moment=require(_0xdfb5('0x1'));var BPromise=require('bluebird');var rp=require(_0xdfb5('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdfb5('0x3'));var config=require(_0xdfb5('0x4'));var attributes=require(_0xdfb5('0x5'));module[_0xdfb5('0x6')]=function(_0x1d503b,_0x14f8b7){return _0x1d503b[_0xdfb5('0x7')]('Integration',attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index 5998159..3a2b984 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 _0xe5bc=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x39a71e,_0x128d6c){var _0x1d62fb=function(_0x5206a0){while(--_0x5206a0){_0x39a71e['push'](_0x39a71e['shift']());}};_0x1d62fb(++_0x128d6c);}(_0xe5bc,0x8c));var _0xce5b=function(_0x1ae4a9,_0x4c0ed9){_0x1ae4a9=_0x1ae4a9-0x0;var _0x54d0b0=_0xe5bc[_0x1ae4a9];return _0x54d0b0;};'use strict';var _=require(_0xce5b('0x0'));var util=require(_0xce5b('0x1'));var moment=require(_0xce5b('0x2'));var BPromise=require(_0xce5b('0x3'));var rs=require(_0xce5b('0x4'));var fs=require('fs');var Redis=require(_0xce5b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xce5b('0x6'));var logger=require(_0xce5b('0x7'))(_0xce5b('0x8'));var config=require(_0xce5b('0x9'));var jayson=require(_0xce5b('0xa'));var client=jayson[_0xce5b('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d556d,_0x533266,_0x35a210){return new BPromise(function(_0x456f10,_0x4eb03a){return client[_0xce5b('0xc')](_0x1d556d,_0x35a210)['then'](function(_0x164905){logger[_0xce5b('0xd')](_0xce5b('0xe'),_0x533266,_0xce5b('0xf'));logger[_0xce5b('0x10')](_0xce5b('0x11'),_0x533266,_0xce5b('0xf'),JSON[_0xce5b('0x12')](_0x164905));if(_0x164905[_0xce5b('0x13')]){if(_0x164905[_0xce5b('0x13')][_0xce5b('0x14')]===0x1f4){logger[_0xce5b('0x13')](_0xce5b('0xe'),_0x533266,_0x164905[_0xce5b('0x13')]['message']);return _0x4eb03a(_0x164905['error'][_0xce5b('0x15')]);}logger[_0xce5b('0x13')]('Integration,\x20%s,\x20%s',_0x533266,_0x164905[_0xce5b('0x13')]['message']);return _0x456f10(_0x164905[_0xce5b('0x13')][_0xce5b('0x15')]);}else{logger['info'](_0xce5b('0xe'),_0x533266,_0xce5b('0xf'));_0x456f10(_0x164905[_0xce5b('0x16')][_0xce5b('0x15')]);}})[_0xce5b('0x17')](function(_0x5ba1a7){logger[_0xce5b('0x13')](_0xce5b('0xe'),_0x533266,_0x5ba1a7);_0x4eb03a(_0x5ba1a7);});});} \ No newline at end of file +var _0x9ec3=['debug','stringify','error','Integration,\x20%s,\x20%s','message','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x3b4ca7,_0x129ac7){var _0x2200e2=function(_0x188582){while(--_0x188582){_0x3b4ca7['push'](_0x3b4ca7['shift']());}};_0x2200e2(++_0x129ac7);}(_0x9ec3,0xcd));var _0x39ec=function(_0xc769bd,_0x6dee19){_0xc769bd=_0xc769bd-0x0;var _0x55d784=_0x9ec3[_0xc769bd];return _0x55d784;};'use strict';var _=require(_0x39ec('0x0'));var util=require(_0x39ec('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x39ec('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x39ec('0x3'))['db'];var utils=require(_0x39ec('0x4'));var logger=require(_0x39ec('0x5'))(_0x39ec('0x6'));var config=require(_0x39ec('0x7'));var jayson=require(_0x39ec('0x8'));var client=jayson[_0x39ec('0x9')][_0x39ec('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x58db37,_0x4e745c,_0x1ea981){return new BPromise(function(_0x482679,_0x272a29){return client[_0x39ec('0xb')](_0x58db37,_0x1ea981)[_0x39ec('0xc')](function(_0x484be7){logger[_0x39ec('0xd')]('Integration,\x20%s,\x20%s',_0x4e745c,_0x39ec('0xe'));logger[_0x39ec('0xf')]('Integration,\x20%s,\x20%s,\x20%s',_0x4e745c,_0x39ec('0xe'),JSON[_0x39ec('0x10')](_0x484be7));if(_0x484be7[_0x39ec('0x11')]){if(_0x484be7['error']['code']===0x1f4){logger[_0x39ec('0x11')](_0x39ec('0x12'),_0x4e745c,_0x484be7['error'][_0x39ec('0x13')]);return _0x272a29(_0x484be7[_0x39ec('0x11')][_0x39ec('0x13')]);}logger['error'](_0x39ec('0x12'),_0x4e745c,_0x484be7[_0x39ec('0x11')][_0x39ec('0x13')]);return _0x482679(_0x484be7[_0x39ec('0x11')][_0x39ec('0x13')]);}else{logger['info'](_0x39ec('0x12'),_0x4e745c,_0x39ec('0xe'));_0x482679(_0x484be7['result'][_0x39ec('0x13')]);}})['catch'](function(_0x303173){logger[_0x39ec('0x11')](_0x39ec('0x12'),_0x4e745c,_0x303173);_0x272a29(_0x303173);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index d43f25d..4cbb465 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 _0xda5b=['../../config/environment','./integrationReport.controller','isAuthenticated','index','/describe','describe','get','/:id','show','post','create','put','update','destroy','exports','multer','path','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x11fb9c,_0x31eca8){var _0x421d09=function(_0x2968c2){while(--_0x2968c2){_0x11fb9c['push'](_0x11fb9c['shift']());}};_0x421d09(++_0x31eca8);}(_0xda5b,0x163));var _0xbda5=function(_0x559add,_0x153177){_0x559add=_0x559add-0x0;var _0x1892af=_0xda5b[_0x559add];return _0x1892af;};'use strict';var multer=require(_0xbda5('0x0'));var util=require('util');var path=require(_0xbda5('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbda5('0x2')]();var auth=require(_0xbda5('0x3'));var interaction=require(_0xbda5('0x4'));var config=require(_0xbda5('0x5'));var controller=require(_0xbda5('0x6'));router['get']('/',auth[_0xbda5('0x7')](),controller[_0xbda5('0x8')]);router['get'](_0xbda5('0x9'),auth[_0xbda5('0x7')](),controller[_0xbda5('0xa')]);router[_0xbda5('0xb')](_0xbda5('0xc'),auth['isAuthenticated'](),controller[_0xbda5('0xd')]);router[_0xbda5('0xe')]('/',auth['isAuthenticated'](),controller[_0xbda5('0xf')]);router[_0xbda5('0x10')]('/:id',auth[_0xbda5('0x7')](),controller[_0xbda5('0x11')]);router['delete'](_0xbda5('0xc'),auth['isAuthenticated'](),controller[_0xbda5('0x12')]);module[_0xbda5('0x13')]=router; \ No newline at end of file +var _0xd4bb=['/describe','describe','/:id','show','create','put','update','delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','isAuthenticated','index','get'];(function(_0xe7664d,_0x170d53){var _0x164eec=function(_0x51a1a9){while(--_0x51a1a9){_0xe7664d['push'](_0xe7664d['shift']());}};_0x164eec(++_0x170d53);}(_0xd4bb,0x144));var _0xbd4b=function(_0x24b051,_0x184552){_0x24b051=_0x24b051-0x0;var _0x3320f9=_0xd4bb[_0x24b051];return _0x3320f9;};'use strict';var multer=require(_0xbd4b('0x0'));var util=require(_0xbd4b('0x1'));var path=require(_0xbd4b('0x2'));var timeout=require(_0xbd4b('0x3'));var express=require('express');var router=express[_0xbd4b('0x4')]();var auth=require(_0xbd4b('0x5'));var interaction=require(_0xbd4b('0x6'));var config=require(_0xbd4b('0x7'));var controller=require(_0xbd4b('0x8'));router['get']('/',auth[_0xbd4b('0x9')](),controller[_0xbd4b('0xa')]);router[_0xbd4b('0xb')](_0xbd4b('0xc'),auth[_0xbd4b('0x9')](),controller[_0xbd4b('0xd')]);router[_0xbd4b('0xb')](_0xbd4b('0xe'),auth[_0xbd4b('0x9')](),controller[_0xbd4b('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xbd4b('0x10')]);router[_0xbd4b('0x11')](_0xbd4b('0xe'),auth[_0xbd4b('0x9')](),controller[_0xbd4b('0x12')]);router[_0xbd4b('0x13')](_0xbd4b('0xe'),auth['isAuthenticated'](),controller[_0xbd4b('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 4fda7e6..fb772d4 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 _0x058f=['ENUM','SENT','SENDING','RECEIVED','FAILED','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT'];(function(_0xda7c64,_0x6e05d8){var _0x5cb2c8=function(_0x5c9166){while(--_0x5c9166){_0xda7c64['push'](_0xda7c64['shift']());}};_0x5cb2c8(++_0x6e05d8);}(_0x058f,0x1cd));var _0xf058=function(_0xd4af91,_0x4148a6){_0xd4af91=_0xd4af91-0x0;var _0x17c656=_0x058f[_0xd4af91];return _0x17c656;};'use strict';var Sequelize=require(_0xf058('0x0'));module[_0xf058('0x1')]={'integration':{'type':Sequelize[_0xf058('0x2')]},'eventChannel':{'type':Sequelize[_0xf058('0x2')]},'exitStatus':{'type':Sequelize[_0xf058('0x2')]},'ticketId':{'type':Sequelize[_0xf058('0x2')]},'integrationId':{'type':Sequelize[_0xf058('0x3')]},'contacts':{'type':Sequelize[_0xf058('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xf058('0x2')]},'queue':{'type':Sequelize[_0xf058('0x2')]},'interface':{'type':Sequelize[_0xf058('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0xf058('0x4')]},'agentconnectAt':{'type':Sequelize[_0xf058('0x4')]},'holdtime':{'type':Sequelize[_0xf058('0x3')]},'agentcomplete':{'type':Sequelize[_0xf058('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xf058('0x4')]},'talktime':{'type':Sequelize[_0xf058('0x3')]},'agentacw':{'type':Sequelize[_0xf058('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0xf058('0x2')]},'agentringnoanswer':{'type':Sequelize[_0xf058('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xf058('0x4')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0xf058('0x2')]},'channel':{'type':Sequelize[_0xf058('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xf058('0x2')]},'connectedlinenum':{'type':Sequelize[_0xf058('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xf058('0x2')]},'accountcode':{'type':Sequelize[_0xf058('0x2')]},'context':{'type':Sequelize[_0xf058('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xf058('0x2')]},'destchannel':{'type':Sequelize[_0xf058('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xf058('0x2')]},'destcalleridnum':{'type':Sequelize[_0xf058('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xf058('0x2')]},'destpriority':{'type':Sequelize[_0xf058('0x2')]},'destuniqueid':{'type':Sequelize[_0xf058('0x2')]},'messageId':{'type':Sequelize[_0xf058('0x2')]},'inReplyTo':{'type':Sequelize[_0xf058('0x2')]},'subject':{'type':Sequelize[_0xf058('0x2')]},'from':{'type':Sequelize[_0xf058('0x2')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0xf058('0x2')]},'attachment':{'type':Sequelize[_0xf058('0x6')]},'html':{'type':Sequelize[_0xf058('0x6')]},'text':{'type':Sequelize[_0xf058('0x6')]},'status':{'type':Sequelize[_0xf058('0x7')](_0xf058('0x8'),_0xf058('0x9'),_0xf058('0xa'),_0xf058('0xb'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0xf058('0x2')]},'appdata':{'type':Sequelize[_0xf058('0x2')]},'projectId':{'type':Sequelize[_0xf058('0x3')]}}; \ No newline at end of file +var _0x948f=['exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','SENDING','RECEIVED','FAILED','sequelize'];(function(_0x4f14ed,_0x44864c){var _0x317279=function(_0x41e375){while(--_0x41e375){_0x4f14ed['push'](_0x4f14ed['shift']());}};_0x317279(++_0x44864c);}(_0x948f,0x14f));var _0xf948=function(_0x2261ce,_0x9ed8b6){_0x2261ce=_0x2261ce-0x0;var _0x524640=_0x948f[_0x2261ce];return _0x524640;};'use strict';var Sequelize=require(_0xf948('0x0'));module[_0xf948('0x1')]={'integration':{'type':Sequelize[_0xf948('0x2')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0xf948('0x2')]},'ticketId':{'type':Sequelize[_0xf948('0x2')]},'integrationId':{'type':Sequelize[_0xf948('0x3')]},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xf948('0x2')]},'calleridnum':{'type':Sequelize[_0xf948('0x2')]},'calleridname':{'type':Sequelize[_0xf948('0x2')]},'queue':{'type':Sequelize[_0xf948('0x2')]},'interface':{'type':Sequelize[_0xf948('0x2')]},'membername':{'type':Sequelize[_0xf948('0x2')]},'agentcalledAt':{'type':Sequelize[_0xf948('0x4')]},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0xf948('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xf948('0x4')]},'talktime':{'type':Sequelize[_0xf948('0x3')]},'agentacw':{'type':Sequelize[_0xf948('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0xf948('0x2')]},'agentringnoanswer':{'type':Sequelize[_0xf948('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xf948('0x4')]},'agentdump':{'type':Sequelize[_0xf948('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xf948('0x4')]},'lastevent':{'type':Sequelize[_0xf948('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0xf948('0x3')]},'channelstatedesc':{'type':Sequelize[_0xf948('0x2')]},'connectedlinenum':{'type':Sequelize[_0xf948('0x2')]},'connectedlinename':{'type':Sequelize[_0xf948('0x2')]},'language':{'type':Sequelize[_0xf948('0x2')]},'accountcode':{'type':Sequelize[_0xf948('0x2')]},'context':{'type':Sequelize[_0xf948('0x2')]},'exten':{'type':Sequelize[_0xf948('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xf948('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xf948('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xf948('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xf948('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0xf948('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xf948('0x2')]},'destpriority':{'type':Sequelize[_0xf948('0x2')]},'destuniqueid':{'type':Sequelize[_0xf948('0x2')]},'messageId':{'type':Sequelize[_0xf948('0x2')]},'inReplyTo':{'type':Sequelize[_0xf948('0x2')]},'subject':{'type':Sequelize[_0xf948('0x2')]},'from':{'type':Sequelize[_0xf948('0x2')]},'to':{'type':Sequelize[_0xf948('0x2')]},'cc':{'type':Sequelize[_0xf948('0x2')]},'attachment':{'type':Sequelize[_0xf948('0x6')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0xf948('0x7')](_0xf948('0x8'),_0xf948('0x9'),_0xf948('0xa'),_0xf948('0xb'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize[_0xf948('0x3')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index bd39dae..7d132ba 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 _0x5b26=['describe','html-pdf','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','squel','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../mysqldb','sendStatus','end','status','count','offset','limit','set','apply','reject','save','update','then','destroy','error','stack','name','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','IntegrationReport','includeAll','findAll','rows','catch','show','params','include','options','create','body','find'];(function(_0x5db8f0,_0x4cffb7){var _0x3af860=function(_0x3dd59f){while(--_0x3dd59f){_0x5db8f0['push'](_0x5db8f0['shift']());}};_0x3af860(++_0x4cffb7);}(_0x5b26,0x89));var _0x65b2=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x5b26[_0x40a045];return _0x1a687c;};'use strict';var pdf=require(_0x65b2('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x65b2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65b2('0x2'));var rp=require(_0x65b2('0x3'));var moment=require(_0x65b2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x65b2('0x5'));var util=require(_0x65b2('0x6'));var path=require(_0x65b2('0x7'));var sox=require('sox');var csv=require(_0x65b2('0x8'));var ejs=require(_0x65b2('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x65b2('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x65b2('0xb'));var toCsv=require(_0x65b2('0x8'));var querystring=require(_0x65b2('0xc'));var Papa=require('papaparse');var Redis=require(_0x65b2('0xd'));var authService=require(_0x65b2('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x65b2('0xf'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x65b2('0x10'))['db'];function respondWithStatusCode(_0x18eb11,_0x1ef863){_0x1ef863=_0x1ef863||0xcc;return function(_0x38400b){if(_0x38400b){return _0x18eb11[_0x65b2('0x11')](_0x1ef863);}return _0x18eb11['status'](_0x1ef863)[_0x65b2('0x12')]();};}function respondWithResult(_0x278734,_0xf8b5e){_0xf8b5e=_0xf8b5e||0xc8;return function(_0x467db7){if(_0x467db7){return _0x278734[_0x65b2('0x13')](_0xf8b5e)['json'](_0x467db7);}};}function respondWithFilteredResult(_0x1ce640,_0x5c5c5c){return function(_0x159abf){if(_0x159abf){var _0x394352=_0x159abf[_0x65b2('0x14')],_0x34e32d=_0x5c5c5c[_0x65b2('0x15')],_0x2106a3=_0x5c5c5c[_0x65b2('0x15')]+_0x5c5c5c[_0x65b2('0x16')],_0x5cd3f2;if(_0x2106a3>=_0x394352){_0x2106a3=_0x394352;_0x5cd3f2=0xc8;}else{_0x5cd3f2=0xce;}_0x1ce640['status'](_0x5cd3f2);return _0x1ce640[_0x65b2('0x17')]('Content-Range',_0x34e32d+'-'+_0x2106a3+'/'+_0x394352)['json'](_0x159abf);}return null;};}function patchUpdates(_0x506c8f){return function(_0x21ddff){try{jsonpatch[_0x65b2('0x18')](_0x21ddff,_0x506c8f,!![]);}catch(_0x4d8d31){return BPromise[_0x65b2('0x19')](_0x4d8d31);}return _0x21ddff[_0x65b2('0x1a')]();};}function saveUpdates(_0x5a9264,_0x4334cd){return function(_0x231ef5){if(_0x231ef5){return _0x231ef5[_0x65b2('0x1b')](_0x5a9264)[_0x65b2('0x1c')](function(_0x1b3532){return _0x1b3532;});}return null;};}function removeEntity(_0x3031ee,_0x4877f4){return function(_0x1faa00){if(_0x1faa00){return _0x1faa00[_0x65b2('0x1d')]()[_0x65b2('0x1c')](function(){_0x3031ee[_0x65b2('0x13')](0xcc)[_0x65b2('0x12')]();});}};}function handleEntityNotFound(_0x221442,_0x42c89b){return function(_0x74385e){if(!_0x74385e){_0x221442[_0x65b2('0x11')](0x194);}return _0x74385e;};}function handleError(_0x4845ff,_0x21be68){_0x21be68=_0x21be68||0x1f4;return function(_0x29eaf8){logger[_0x65b2('0x1e')](_0x29eaf8[_0x65b2('0x1f')]);if(_0x29eaf8[_0x65b2('0x20')]){delete _0x29eaf8[_0x65b2('0x20')];}_0x4845ff[_0x65b2('0x13')](_0x21be68)['send'](_0x29eaf8);};}exports['index']=function(_0x109880,_0xcf8dd5){var _0x58f2f0={},_0x39460f={},_0x4a7d06={'count':0x0,'rows':[]};var _0x3dce46=_[_0x65b2('0x21')](db['IntegrationReport'][_0x65b2('0x22')],function(_0x5aa2df){return{'name':_0x5aa2df[_0x65b2('0x23')],'type':_0x5aa2df[_0x65b2('0x24')][_0x65b2('0x25')]};});_0x39460f['model']=_[_0x65b2('0x21')](_0x3dce46,_0x65b2('0x20'));_0x39460f[_0x65b2('0x26')]=_[_0x65b2('0x27')](_0x109880['query']);_0x39460f[_0x65b2('0x28')]=_[_0x65b2('0x29')](_0x39460f[_0x65b2('0x2a')],_0x39460f[_0x65b2('0x26')]);_0x58f2f0[_0x65b2('0x2b')]=_[_0x65b2('0x29')](_0x39460f[_0x65b2('0x2a')],qs[_0x65b2('0x2c')](_0x109880[_0x65b2('0x26')][_0x65b2('0x2c')]));_0x58f2f0[_0x65b2('0x2b')]=_0x58f2f0['attributes'][_0x65b2('0x2d')]?_0x58f2f0[_0x65b2('0x2b')]:_0x39460f[_0x65b2('0x2a')];if(!_0x109880[_0x65b2('0x26')][_0x65b2('0x2e')](_0x65b2('0x2f'))){_0x58f2f0[_0x65b2('0x16')]=qs[_0x65b2('0x16')](_0x109880[_0x65b2('0x26')][_0x65b2('0x16')]);_0x58f2f0['offset']=qs['offset'](_0x109880['query'][_0x65b2('0x15')]);}_0x58f2f0[_0x65b2('0x30')]=qs[_0x65b2('0x31')](_0x109880[_0x65b2('0x26')][_0x65b2('0x31')]);_0x58f2f0[_0x65b2('0x32')]=qs[_0x65b2('0x28')](_[_0x65b2('0x33')](_0x109880['query'],_0x39460f[_0x65b2('0x28')]));if(_0x109880[_0x65b2('0x26')]['filter']){_0x58f2f0[_0x65b2('0x32')]=_['merge'](_0x58f2f0['where'],{'$or':_['map'](_0x3dce46,function(_0x1e8af7){if(_0x1e8af7['type'][_0x65b2('0x25')]!==_0x65b2('0x34')){var _0x1fda5b={};_0x1fda5b[_0x1e8af7['field']]={'$like':'%'+_0x109880[_0x65b2('0x26')][_0x65b2('0x35')]+'%'};return _0x1fda5b;}})});}_0x58f2f0=_[_0x65b2('0x36')]({},_0x58f2f0,_0x109880['options']);var _0x5b9e7e={'where':_0x58f2f0[_0x65b2('0x32')]};return db[_0x65b2('0x37')][_0x65b2('0x14')](_0x5b9e7e)[_0x65b2('0x1c')](function(_0x4a6546){_0x4a7d06[_0x65b2('0x14')]=_0x4a6546;if(_0x109880[_0x65b2('0x26')][_0x65b2('0x38')]){_0x58f2f0['include']=[{'all':!![]}];}return db[_0x65b2('0x37')][_0x65b2('0x39')](_0x58f2f0);})['then'](function(_0x249208){_0x4a7d06[_0x65b2('0x3a')]=_0x249208;return _0x4a7d06;})[_0x65b2('0x1c')](respondWithFilteredResult(_0xcf8dd5,_0x58f2f0))[_0x65b2('0x3b')](handleError(_0xcf8dd5,null));};exports[_0x65b2('0x3c')]=function(_0x336621,_0x3cfede){var _0x3a19cb={'raw':![],'where':{'id':_0x336621[_0x65b2('0x3d')]['id']}},_0x4da32b={};_0x4da32b[_0x65b2('0x2a')]=_['keys'](db[_0x65b2('0x37')][_0x65b2('0x22')]);_0x4da32b['query']=_[_0x65b2('0x27')](_0x336621[_0x65b2('0x26')]);_0x4da32b[_0x65b2('0x28')]=_[_0x65b2('0x29')](_0x4da32b[_0x65b2('0x2a')],_0x4da32b[_0x65b2('0x26')]);_0x3a19cb['attributes']=_[_0x65b2('0x29')](_0x4da32b[_0x65b2('0x2a')],qs[_0x65b2('0x2c')](_0x336621[_0x65b2('0x26')]['fields']));_0x3a19cb[_0x65b2('0x2b')]=_0x3a19cb['attributes'][_0x65b2('0x2d')]?_0x3a19cb[_0x65b2('0x2b')]:_0x4da32b[_0x65b2('0x2a')];if(_0x336621[_0x65b2('0x26')][_0x65b2('0x38')]){_0x3a19cb[_0x65b2('0x3e')]=[{'all':!![]}];}_0x3a19cb=_[_0x65b2('0x36')]({},_0x3a19cb,_0x336621[_0x65b2('0x3f')]);return db[_0x65b2('0x37')]['find'](_0x3a19cb)[_0x65b2('0x1c')](handleEntityNotFound(_0x3cfede,null))['then'](respondWithResult(_0x3cfede,null))[_0x65b2('0x3b')](handleError(_0x3cfede,null));};exports[_0x65b2('0x40')]=function(_0x44998d,_0x1dde20){return db[_0x65b2('0x37')][_0x65b2('0x40')](_0x44998d[_0x65b2('0x41')],{})['then'](respondWithResult(_0x1dde20,0xc9))[_0x65b2('0x3b')](handleError(_0x1dde20,null));};exports['update']=function(_0x1d2f5c,_0x2d13b3){if(_0x1d2f5c['body']['id']){delete _0x1d2f5c[_0x65b2('0x41')]['id'];}return db['IntegrationReport'][_0x65b2('0x42')]({'where':{'id':_0x1d2f5c[_0x65b2('0x3d')]['id']}})[_0x65b2('0x1c')](handleEntityNotFound(_0x2d13b3,null))[_0x65b2('0x1c')](saveUpdates(_0x1d2f5c[_0x65b2('0x41')],null))['then'](respondWithResult(_0x2d13b3,null))[_0x65b2('0x3b')](handleError(_0x2d13b3,null));};exports[_0x65b2('0x1d')]=function(_0x59bb9f,_0x312075){return db[_0x65b2('0x37')]['find']({'where':{'id':_0x59bb9f[_0x65b2('0x3d')]['id']}})[_0x65b2('0x1c')](handleEntityNotFound(_0x312075,null))[_0x65b2('0x1c')](removeEntity(_0x312075,null))[_0x65b2('0x3b')](handleError(_0x312075,null));};exports[_0x65b2('0x43')]=function(_0x588e95,_0x5e6c23){return db['IntegrationReport']['describe']()[_0x65b2('0x1c')](respondWithResult(_0x5e6c23,null))[_0x65b2('0x3b')](handleError(_0x5e6c23,null));}; \ No newline at end of file +var _0x609a=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','Content-Range','reject','save','update','then','name','send','map','IntegrationReport','rawAttributes','fieldName','type','key','model','query','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','field','options','count','includeAll','findAll','catch','show','keys','fields','find','create','body','params','destroy','describe','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0x609a,0x11c));var _0xa609=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x609a[_0x17d9e3];return _0x14192d;};'use strict';var pdf=require(_0xa609('0x0'));var emlformat=require(_0xa609('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xa609('0x2'));var jsonpatch=require(_0xa609('0x3'));var rp=require('request-promise');var moment=require(_0xa609('0x4'));var BPromise=require(_0xa609('0x5'));var Mustache=require(_0xa609('0x6'));var util=require('util');var path=require('path');var sox=require(_0xa609('0x7'));var csv=require(_0xa609('0x8'));var ejs=require(_0xa609('0x9'));var fs=require('fs');var _=require(_0xa609('0xa'));var squel=require(_0xa609('0xb'));var crypto=require(_0xa609('0xc'));var jsforce=require(_0xa609('0xd'));var deskjs=require(_0xa609('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa609('0xf'));var Papa=require(_0xa609('0x10'));var Redis=require(_0xa609('0x11'));var authService=require(_0xa609('0x12'));var qs=require(_0xa609('0x13'));var as=require(_0xa609('0x14'));var hardwareService=require(_0xa609('0x15'));var logger=require(_0xa609('0x16'))(_0xa609('0x17'));var utils=require(_0xa609('0x18'));var config=require(_0xa609('0x19'));var db=require(_0xa609('0x1a'))['db'];function respondWithStatusCode(_0x362aba,_0x2ab28e){_0x2ab28e=_0x2ab28e||0xcc;return function(_0x2c4293){if(_0x2c4293){return _0x362aba[_0xa609('0x1b')](_0x2ab28e);}return _0x362aba[_0xa609('0x1c')](_0x2ab28e)[_0xa609('0x1d')]();};}function respondWithResult(_0x53665c,_0x1676c9){_0x1676c9=_0x1676c9||0xc8;return function(_0x6b1f38){if(_0x6b1f38){return _0x53665c[_0xa609('0x1c')](_0x1676c9)[_0xa609('0x1e')](_0x6b1f38);}};}function respondWithFilteredResult(_0x4899ee,_0x928cdc){return function(_0x3439f7){if(_0x3439f7){var _0x3e45b4=_0x3439f7['count'],_0x2ad7b3=_0x928cdc[_0xa609('0x1f')],_0x3b41b3=_0x928cdc[_0xa609('0x1f')]+_0x928cdc[_0xa609('0x20')],_0x561be7;if(_0x3b41b3>=_0x3e45b4){_0x3b41b3=_0x3e45b4;_0x561be7=0xc8;}else{_0x561be7=0xce;}_0x4899ee[_0xa609('0x1c')](_0x561be7);return _0x4899ee['set'](_0xa609('0x21'),_0x2ad7b3+'-'+_0x3b41b3+'/'+_0x3e45b4)[_0xa609('0x1e')](_0x3439f7);}return null;};}function patchUpdates(_0x14f9ee){return function(_0x4b8280){try{jsonpatch['apply'](_0x4b8280,_0x14f9ee,!![]);}catch(_0x22f233){return BPromise[_0xa609('0x22')](_0x22f233);}return _0x4b8280[_0xa609('0x23')]();};}function saveUpdates(_0x1c0ba6,_0x28515c){return function(_0x272ea8){if(_0x272ea8){return _0x272ea8[_0xa609('0x24')](_0x1c0ba6)['then'](function(_0x486f2b){return _0x486f2b;});}return null;};}function removeEntity(_0x2425c5,_0x5f3fa2){return function(_0x523638){if(_0x523638){return _0x523638['destroy']()[_0xa609('0x25')](function(){_0x2425c5[_0xa609('0x1c')](0xcc)[_0xa609('0x1d')]();});}};}function handleEntityNotFound(_0x4223cf,_0xdca5e){return function(_0x54dd3c){if(!_0x54dd3c){_0x4223cf['sendStatus'](0x194);}return _0x54dd3c;};}function handleError(_0x475237,_0x4eefce){_0x4eefce=_0x4eefce||0x1f4;return function(_0x33a10a){logger['error'](_0x33a10a['stack']);if(_0x33a10a[_0xa609('0x26')]){delete _0x33a10a['name'];}_0x475237[_0xa609('0x1c')](_0x4eefce)[_0xa609('0x27')](_0x33a10a);};}exports['index']=function(_0x5872fb,_0x15ec2c){var _0x21adf4={},_0x1b0db3={},_0x4ea7f2={'count':0x0,'rows':[]};var _0x24ef0c=_[_0xa609('0x28')](db[_0xa609('0x29')][_0xa609('0x2a')],function(_0x400e9d){return{'name':_0x400e9d[_0xa609('0x2b')],'type':_0x400e9d[_0xa609('0x2c')][_0xa609('0x2d')]};});_0x1b0db3[_0xa609('0x2e')]=_[_0xa609('0x28')](_0x24ef0c,_0xa609('0x26'));_0x1b0db3['query']=_['keys'](_0x5872fb[_0xa609('0x2f')]);_0x1b0db3['filters']=_[_0xa609('0x30')](_0x1b0db3['model'],_0x1b0db3[_0xa609('0x2f')]);_0x21adf4[_0xa609('0x31')]=_[_0xa609('0x30')](_0x1b0db3[_0xa609('0x2e')],qs['fields'](_0x5872fb['query']['fields']));_0x21adf4[_0xa609('0x31')]=_0x21adf4[_0xa609('0x31')][_0xa609('0x32')]?_0x21adf4[_0xa609('0x31')]:_0x1b0db3[_0xa609('0x2e')];if(!_0x5872fb[_0xa609('0x2f')][_0xa609('0x33')](_0xa609('0x34'))){_0x21adf4[_0xa609('0x20')]=qs[_0xa609('0x20')](_0x5872fb['query']['limit']);_0x21adf4['offset']=qs[_0xa609('0x1f')](_0x5872fb[_0xa609('0x2f')][_0xa609('0x1f')]);}_0x21adf4[_0xa609('0x35')]=qs[_0xa609('0x36')](_0x5872fb['query'][_0xa609('0x36')]);_0x21adf4[_0xa609('0x37')]=qs[_0xa609('0x38')](_[_0xa609('0x39')](_0x5872fb['query'],_0x1b0db3[_0xa609('0x38')]));if(_0x5872fb[_0xa609('0x2f')][_0xa609('0x3a')]){_0x21adf4[_0xa609('0x37')]=_[_0xa609('0x3b')](_0x21adf4['where'],{'$or':_[_0xa609('0x28')](_0x24ef0c,function(_0x42b4cb){if(_0x42b4cb[_0xa609('0x2c')][_0xa609('0x2d')]!==_0xa609('0x3c')){var _0x3dc827={};_0x3dc827[_0x42b4cb[_0xa609('0x3d')]]={'$like':'%'+_0x5872fb[_0xa609('0x2f')][_0xa609('0x3a')]+'%'};return _0x3dc827;}})});}_0x21adf4=_[_0xa609('0x3b')]({},_0x21adf4,_0x5872fb[_0xa609('0x3e')]);var _0x2f17f6={'where':_0x21adf4[_0xa609('0x37')]};return db[_0xa609('0x29')][_0xa609('0x3f')](_0x2f17f6)[_0xa609('0x25')](function(_0x379792){_0x4ea7f2[_0xa609('0x3f')]=_0x379792;if(_0x5872fb[_0xa609('0x2f')][_0xa609('0x40')]){_0x21adf4['include']=[{'all':!![]}];}return db[_0xa609('0x29')][_0xa609('0x41')](_0x21adf4);})[_0xa609('0x25')](function(_0x3de135){_0x4ea7f2['rows']=_0x3de135;return _0x4ea7f2;})[_0xa609('0x25')](respondWithFilteredResult(_0x15ec2c,_0x21adf4))[_0xa609('0x42')](handleError(_0x15ec2c,null));};exports[_0xa609('0x43')]=function(_0x47770b,_0x100893){var _0x3c2087={'raw':![],'where':{'id':_0x47770b['params']['id']}},_0x10bd1e={};_0x10bd1e[_0xa609('0x2e')]=_[_0xa609('0x44')](db[_0xa609('0x29')]['rawAttributes']);_0x10bd1e['query']=_[_0xa609('0x44')](_0x47770b[_0xa609('0x2f')]);_0x10bd1e['filters']=_['intersection'](_0x10bd1e[_0xa609('0x2e')],_0x10bd1e[_0xa609('0x2f')]);_0x3c2087[_0xa609('0x31')]=_[_0xa609('0x30')](_0x10bd1e[_0xa609('0x2e')],qs[_0xa609('0x45')](_0x47770b[_0xa609('0x2f')][_0xa609('0x45')]));_0x3c2087[_0xa609('0x31')]=_0x3c2087[_0xa609('0x31')][_0xa609('0x32')]?_0x3c2087[_0xa609('0x31')]:_0x10bd1e[_0xa609('0x2e')];if(_0x47770b[_0xa609('0x2f')][_0xa609('0x40')]){_0x3c2087['include']=[{'all':!![]}];}_0x3c2087=_[_0xa609('0x3b')]({},_0x3c2087,_0x47770b[_0xa609('0x3e')]);return db[_0xa609('0x29')][_0xa609('0x46')](_0x3c2087)[_0xa609('0x25')](handleEntityNotFound(_0x100893,null))[_0xa609('0x25')](respondWithResult(_0x100893,null))[_0xa609('0x42')](handleError(_0x100893,null));};exports[_0xa609('0x47')]=function(_0x3d4e64,_0x99f42d){return db[_0xa609('0x29')][_0xa609('0x47')](_0x3d4e64[_0xa609('0x48')],{})[_0xa609('0x25')](respondWithResult(_0x99f42d,0xc9))['catch'](handleError(_0x99f42d,null));};exports[_0xa609('0x24')]=function(_0x39af54,_0x4fe30b){if(_0x39af54[_0xa609('0x48')]['id']){delete _0x39af54[_0xa609('0x48')]['id'];}return db[_0xa609('0x29')][_0xa609('0x46')]({'where':{'id':_0x39af54[_0xa609('0x49')]['id']}})[_0xa609('0x25')](handleEntityNotFound(_0x4fe30b,null))[_0xa609('0x25')](saveUpdates(_0x39af54[_0xa609('0x48')],null))[_0xa609('0x25')](respondWithResult(_0x4fe30b,null))['catch'](handleError(_0x4fe30b,null));};exports[_0xa609('0x4a')]=function(_0x6f92a1,_0x3626ce){return db[_0xa609('0x29')][_0xa609('0x46')]({'where':{'id':_0x6f92a1['params']['id']}})[_0xa609('0x25')](handleEntityNotFound(_0x3626ce,null))[_0xa609('0x25')](removeEntity(_0x3626ce,null))[_0xa609('0x42')](handleError(_0x3626ce,null));};exports[_0xa609('0x4b')]=function(_0x2d9e44,_0x2b8867){return db[_0xa609('0x29')][_0xa609('0x4b')]()[_0xa609('0x25')](respondWithResult(_0x2b8867,null))[_0xa609('0x42')](handleError(_0x2b8867,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 2fd8365..d7977ce 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 _0x1b7b=['api','bluebird','request-promise','path','rimraf','../../config/environment','./integrationReport.attributes','exports','define','report_integration','../../config/logger'];(function(_0x1ce335,_0x12add7){var _0xcb3d16=function(_0xcdf6bf){while(--_0xcdf6bf){_0x1ce335['push'](_0x1ce335['shift']());}};_0xcb3d16(++_0x12add7);}(_0x1b7b,0xe6));var _0xb1b7=function(_0x3ced27,_0x3833f6){_0x3ced27=_0x3ced27-0x0;var _0x2e3841=_0x1b7b[_0x3ced27];return _0x2e3841;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb1b7('0x0'))(_0xb1b7('0x1'));var moment=require('moment');var BPromise=require(_0xb1b7('0x2'));var rp=require(_0xb1b7('0x3'));var fs=require('fs');var path=require(_0xb1b7('0x4'));var rimraf=require(_0xb1b7('0x5'));var config=require(_0xb1b7('0x6'));var attributes=require(_0xb1b7('0x7'));module[_0xb1b7('0x8')]=function(_0xb5e31e,_0x36a81e){return _0xb5e31e[_0xb1b7('0x9')]('IntegrationReport',attributes,{'tableName':_0xb1b7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8116=['rimraf','../../config/environment','./integrationReport.attributes','exports','define','IntegrationReport','lodash','util','../../config/logger','api','bluebird','path'];(function(_0x5038fe,_0x27c518){var _0x136aad=function(_0x48e1ab){while(--_0x48e1ab){_0x5038fe['push'](_0x5038fe['shift']());}};_0x136aad(++_0x27c518);}(_0x8116,0x10e));var _0x6811=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x8116[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x6811('0x0'));var util=require(_0x6811('0x1'));var logger=require(_0x6811('0x2'))(_0x6811('0x3'));var moment=require('moment');var BPromise=require(_0x6811('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6811('0x5'));var rimraf=require(_0x6811('0x6'));var config=require(_0x6811('0x7'));var attributes=require(_0x6811('0x8'));module[_0x6811('0x9')]=function(_0x346154,_0x6bb82e){return _0x346154[_0x6811('0xa')](_0x6811('0xb'),attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.rpc.js b/server/api/integrationReport/integrationReport.rpc.js index 3afbda6..e32f3ae 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 _0xac4a=['IntegrationReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','then','info','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xac4a,0x13f));var _0xaac4=function(_0x3ccb18,_0x5eae0a){_0x3ccb18=_0x3ccb18-0x0;var _0x122509=_0xac4a[_0x3ccb18];return _0x122509;};'use strict';var _=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var moment=require(_0xaac4('0x2'));var BPromise=require(_0xaac4('0x3'));var rs=require(_0xaac4('0x4'));var fs=require('fs');var Redis=require(_0xaac4('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaac4('0x6'))(_0xaac4('0x7'));var config=require(_0xaac4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xaac4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cdfc5,_0x5870e8,_0x1e4283){return new BPromise(function(_0x27354c,_0x567295){return client['request'](_0x1cdfc5,_0x1e4283)[_0xaac4('0xa')](function(_0x50d114){logger[_0xaac4('0xb')]('IntegrationReport,\x20%s,\x20%s',_0x5870e8,'request\x20sent');logger[_0xaac4('0xc')](_0xaac4('0xd'),_0x5870e8,_0xaac4('0xe'),JSON[_0xaac4('0xf')](_0x50d114));if(_0x50d114[_0xaac4('0x10')]){if(_0x50d114['error']['code']===0x1f4){logger[_0xaac4('0x10')](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')]['message']);return _0x567295(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}logger['error'](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);return _0x27354c(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}else{logger[_0xaac4('0xb')](_0xaac4('0x11'),_0x5870e8,_0xaac4('0xe'));_0x27354c(_0x50d114[_0xaac4('0x13')][_0xaac4('0x12')]);}})[_0xaac4('0x14')](function(_0x1766c2){logger[_0xaac4('0x10')]('IntegrationReport,\x20%s,\x20%s',_0x5870e8,_0x1766c2);_0x567295(_0x1766c2);});});} \ No newline at end of file +var _0xb10b=['stringify','error','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','IntegrationReport,\x20%s,\x20%s','IntegrationReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x4a1b24,_0x2c7acd){var _0x47dbf2=function(_0x205cde){while(--_0x205cde){_0x4a1b24['push'](_0x4a1b24['shift']());}};_0x47dbf2(++_0x2c7acd);}(_0xb10b,0x12a));var _0xbb10=function(_0x5cf94d,_0x3e9b52){_0x5cf94d=_0x5cf94d-0x0;var _0x3242a6=_0xb10b[_0x5cf94d];return _0x3242a6;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 97c59e5..f4a8ab2 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 _0x55ca=['/:id/sub_intervals','addInterval','/:id/sub_intervals/create_many','addIntervals','put','update','destroy','exports','multer','util','Router','../../components/auth/service','../../config/environment','./interval.controller','get','isAuthenticated','index','/:id','show','getIntervals','create','post'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x55ca,0x126));var _0xa55c=function(_0x9733df,_0x450c75){_0x9733df=_0x9733df-0x0;var _0x1abfad=_0x55ca[_0x9733df];return _0x1abfad;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var auth=require(_0xa55c('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xa55c('0x4'));var controller=require(_0xa55c('0x5'));router[_0xa55c('0x6')]('/',auth[_0xa55c('0x7')](),controller[_0xa55c('0x8')]);router[_0xa55c('0x6')](_0xa55c('0x9'),auth['isAuthenticated'](),controller[_0xa55c('0xa')]);router[_0xa55c('0x6')]('/:id/sub_intervals',auth[_0xa55c('0x7')](),controller[_0xa55c('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa55c('0xc')]);router[_0xa55c('0xd')](_0xa55c('0xe'),auth[_0xa55c('0x7')](),controller[_0xa55c('0xf')]);router[_0xa55c('0xd')](_0xa55c('0x10'),auth[_0xa55c('0x7')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xa55c('0x13')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xa55c('0x14')]);module[_0xa55c('0x15')]=router; \ No newline at end of file +var _0x008c=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','get','isAuthenticated','index','/:id','show','/:id/sub_intervals','post','addInterval','/:id/sub_intervals/create_many','addIntervals','put','update','exports','multer','util','path','connect-timeout'];(function(_0x13b832,_0x4bf639){var _0x523c86=function(_0x740cf9){while(--_0x740cf9){_0x13b832['push'](_0x13b832['shift']());}};_0x523c86(++_0x4bf639);}(_0x008c,0x188));var _0xc008=function(_0x188bfe,_0x2517cc){_0x188bfe=_0x188bfe-0x0;var _0x1a9efa=_0x008c[_0x188bfe];return _0x1a9efa;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var auth=require(_0xc008('0x5'));var interaction=require(_0xc008('0x6'));var config=require(_0xc008('0x7'));var controller=require(_0xc008('0x8'));router[_0xc008('0x9')]('/',auth[_0xc008('0xa')](),controller[_0xc008('0xb')]);router[_0xc008('0x9')](_0xc008('0xc'),auth['isAuthenticated'](),controller[_0xc008('0xd')]);router['get'](_0xc008('0xe'),auth['isAuthenticated'](),controller['getIntervals']);router[_0xc008('0xf')]('/',auth[_0xc008('0xa')](),controller['create']);router['post']('/:id/sub_intervals',auth[_0xc008('0xa')](),controller[_0xc008('0x10')]);router['post'](_0xc008('0x11'),auth[_0xc008('0xa')](),controller[_0xc008('0x12')]);router[_0xc008('0x13')](_0xc008('0xc'),auth[_0xc008('0xa')](),controller[_0xc008('0x14')]);router['delete']('/:id',auth[_0xc008('0xa')](),controller['destroy']);module[_0xc008('0x15')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 58d39d6..a56e70c 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 _0x9670=['sequelize','STRING'];(function(_0xb4e01f,_0x3a62d2){var _0xe364cd=function(_0x9c6fd0){while(--_0x9c6fd0){_0xb4e01f['push'](_0xb4e01f['shift']());}};_0xe364cd(++_0x3a62d2);}(_0x9670,0xea));var _0x0967=function(_0x407814,_0x36ed9d){_0x407814=_0x407814-0x0;var _0x1324a8=_0x9670[_0x407814];return _0x1324a8;};'use strict';var Sequelize=require(_0x0967('0x0'));module['exports']={'name':{'type':Sequelize[_0x0967('0x1')]},'description':{'type':Sequelize[_0x0967('0x1')]},'interval':{'type':Sequelize[_0x0967('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0x3a6b=['sequelize','STRING'];(function(_0x5aaba8,_0x248b94){var _0x13f7e3=function(_0x2db2c5){while(--_0x2db2c5){_0x5aaba8['push'](_0x5aaba8['shift']());}};_0x13f7e3(++_0x248b94);}(_0x3a6b,0x1bc));var _0xb3a6=function(_0x4a2c6c,_0x4899bb){_0x4a2c6c=_0x4a2c6c-0x0;var _0x5d204a=_0x3a6b[_0x4a2c6c];return _0x5d204a;};'use strict';var Sequelize=require(_0xb3a6('0x0'));module['exports']={'name':{'type':Sequelize[_0xb3a6('0x1')]},'description':{'type':Sequelize[_0xb3a6('0x1')]},'interval':{'type':Sequelize[_0xb3a6('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index 4c289d4..9159251 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 _0xa39a=['set','Content-Range','save','update','destroy','get','Intervals','UserProfileResource','then','error','stack','name','send','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','sort','pick','filter','where','VIRTUAL','field','merge','options','Interval','includeAll','include','rows','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','addInterval','IntervalId','getIntervals','findOne','order','nolimit','sequelize','transaction','bulkCreate','findAll','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../components/extensions/rewrite','sendStatus','status','end','json','count','offset','limit'];(function(_0x34b951,_0x554a89){var _0x2b259f=function(_0x39bf00){while(--_0x39bf00){_0x34b951['push'](_0x34b951['shift']());}};_0x2b259f(++_0x554a89);}(_0xa39a,0x148));var _0xaa39=function(_0x48718d,_0x27f2a0){_0x48718d=_0x48718d-0x0;var _0x2c8523=_0xa39a[_0x48718d];return _0x2c8523;};'use strict';var pdf=require(_0xaa39('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xaa39('0x1'));var zipdir=require(_0xaa39('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaa39('0x3'));var moment=require(_0xaa39('0x4'));var BPromise=require(_0xaa39('0x5'));var Mustache=require('mustache');var util=require(_0xaa39('0x6'));var path=require('path');var sox=require(_0xaa39('0x7'));var csv=require(_0xaa39('0x8'));var ejs=require(_0xaa39('0x9'));var fs=require('fs');var _=require(_0xaa39('0xa'));var squel=require(_0xaa39('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xaa39('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xaa39('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xaa39('0xe'));var as=require(_0xaa39('0xf'));var hardwareService=require(_0xaa39('0x10'));var logger=require(_0xaa39('0x11'))(_0xaa39('0x12'));var utils=require('../../config/utils');var config=require(_0xaa39('0x13'));var db=require('../../mysqldb')['db'];var extensions=require(_0xaa39('0x14'));function respondWithStatusCode(_0x285f56,_0x5054d0){_0x5054d0=_0x5054d0||0xcc;return function(_0xc2418a){if(_0xc2418a){return _0x285f56[_0xaa39('0x15')](_0x5054d0);}return _0x285f56[_0xaa39('0x16')](_0x5054d0)[_0xaa39('0x17')]();};}function respondWithResult(_0x247c91,_0x1480de){_0x1480de=_0x1480de||0xc8;return function(_0x50b591){if(_0x50b591){return _0x247c91['status'](_0x1480de)[_0xaa39('0x18')](_0x50b591);}};}function respondWithFilteredResult(_0x262ee5,_0x347107){return function(_0x10a289){if(_0x10a289){var _0x183e3c=_0x10a289[_0xaa39('0x19')],_0x130254=_0x347107[_0xaa39('0x1a')],_0x50733f=_0x347107['offset']+_0x347107[_0xaa39('0x1b')],_0xbde331;if(_0x50733f>=_0x183e3c){_0x50733f=_0x183e3c;_0xbde331=0xc8;}else{_0xbde331=0xce;}_0x262ee5[_0xaa39('0x16')](_0xbde331);return _0x262ee5[_0xaa39('0x1c')](_0xaa39('0x1d'),_0x130254+'-'+_0x50733f+'/'+_0x183e3c)[_0xaa39('0x18')](_0x10a289);}return null;};}function patchUpdates(_0x52bb26){return function(_0x45dacd){try{jsonpatch['apply'](_0x45dacd,_0x52bb26,!![]);}catch(_0xc5a5d4){return BPromise['reject'](_0xc5a5d4);}return _0x45dacd[_0xaa39('0x1e')]();};}function saveUpdates(_0x105cb4,_0x567004){return function(_0x5ea981){if(_0x5ea981){return _0x5ea981[_0xaa39('0x1f')](_0x105cb4)['then'](function(_0x318b61){return _0x318b61;});}return null;};}function removeEntity(_0x264ae1,_0xe746bf){return function(_0x4532c5){if(_0x4532c5){return _0x4532c5[_0xaa39('0x20')]()['then'](function(){var _0x2a5f9d=_0x4532c5[_0xaa39('0x21')]({'plain':!![]});var _0x446a4f=_0xaa39('0x22');return db[_0xaa39('0x23')][_0xaa39('0x20')]({'where':{'type':_0x446a4f,'resourceId':_0x2a5f9d['id']}})[_0xaa39('0x24')](function(){return _0x4532c5;});})[_0xaa39('0x24')](function(){_0x264ae1[_0xaa39('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b700a,_0x37d14a){return function(_0x5ace1d){if(!_0x5ace1d){_0x1b700a[_0xaa39('0x15')](0x194);}return _0x5ace1d;};}function handleError(_0x18e779,_0x1fb932){_0x1fb932=_0x1fb932||0x1f4;return function(_0x1668b0){logger[_0xaa39('0x25')](_0x1668b0[_0xaa39('0x26')]);if(_0x1668b0[_0xaa39('0x27')]){delete _0x1668b0[_0xaa39('0x27')];}_0x18e779[_0xaa39('0x16')](_0x1fb932)[_0xaa39('0x28')](_0x1668b0);};}exports['index']=function(_0x50072e,_0x9a7266){var _0x597d38={},_0x585d00={},_0x1d4c85={'count':0x0,'rows':[]};var _0x31516b=_['map'](db['Interval'][_0xaa39('0x29')],function(_0x5bbcf1){return{'name':_0x5bbcf1[_0xaa39('0x2a')],'type':_0x5bbcf1[_0xaa39('0x2b')][_0xaa39('0x2c')]};});_0x585d00[_0xaa39('0x2d')]=_[_0xaa39('0x2e')](_0x31516b,_0xaa39('0x27'));_0x585d00[_0xaa39('0x2f')]=_[_0xaa39('0x30')](_0x50072e[_0xaa39('0x2f')]);_0x585d00[_0xaa39('0x31')]=_['intersection'](_0x585d00[_0xaa39('0x2d')],_0x585d00['query']);_0x597d38[_0xaa39('0x32')]=_[_0xaa39('0x33')](_0x585d00[_0xaa39('0x2d')],qs['fields'](_0x50072e[_0xaa39('0x2f')][_0xaa39('0x34')]));_0x597d38[_0xaa39('0x32')]=_0x597d38['attributes'][_0xaa39('0x35')]?_0x597d38['attributes']:_0x585d00[_0xaa39('0x2d')];if(!_0x50072e[_0xaa39('0x2f')][_0xaa39('0x36')]('nolimit')){_0x597d38[_0xaa39('0x1b')]=qs[_0xaa39('0x1b')](_0x50072e[_0xaa39('0x2f')]['limit']);_0x597d38['offset']=qs[_0xaa39('0x1a')](_0x50072e[_0xaa39('0x2f')][_0xaa39('0x1a')]);}_0x597d38['order']=qs[_0xaa39('0x37')](_0x50072e[_0xaa39('0x2f')][_0xaa39('0x37')]);_0x597d38['where']=qs[_0xaa39('0x31')](_[_0xaa39('0x38')](_0x50072e[_0xaa39('0x2f')],_0x585d00[_0xaa39('0x31')]));if(_0x50072e[_0xaa39('0x2f')][_0xaa39('0x39')]){_0x597d38[_0xaa39('0x3a')]=_['merge'](_0x597d38[_0xaa39('0x3a')],{'$or':_[_0xaa39('0x2e')](_0x31516b,function(_0x4cc826){if(_0x4cc826[_0xaa39('0x2b')][_0xaa39('0x2c')]!==_0xaa39('0x3b')){var _0x174089={};_0x174089[_0x4cc826[_0xaa39('0x3c')]]={'$like':'%'+_0x50072e[_0xaa39('0x2f')][_0xaa39('0x39')]+'%'};return _0x174089;}})});}_0x597d38=_[_0xaa39('0x3d')]({},_0x597d38,_0x50072e[_0xaa39('0x3e')]);var _0x56c0e4={'where':_0x597d38['where']};return db[_0xaa39('0x3f')][_0xaa39('0x19')](_0x56c0e4)['then'](function(_0x5e244a){_0x1d4c85[_0xaa39('0x19')]=_0x5e244a;if(_0x50072e['query'][_0xaa39('0x40')]){_0x597d38[_0xaa39('0x41')]=[{'all':!![]}];}return db[_0xaa39('0x3f')]['findAll'](_0x597d38);})[_0xaa39('0x24')](function(_0x3d40ee){_0x1d4c85[_0xaa39('0x42')]=_0x3d40ee;return _0x1d4c85;})[_0xaa39('0x24')](respondWithFilteredResult(_0x9a7266,_0x597d38))[_0xaa39('0x43')](handleError(_0x9a7266,null));};exports[_0xaa39('0x44')]=function(_0x41c392,_0x210624){var _0x40269a={'raw':!![],'where':{'id':_0x41c392[_0xaa39('0x45')]['id']}},_0x41ddfe={};_0x41ddfe[_0xaa39('0x2d')]=_[_0xaa39('0x30')](db[_0xaa39('0x3f')]['rawAttributes']);_0x41ddfe[_0xaa39('0x2f')]=_[_0xaa39('0x30')](_0x41c392[_0xaa39('0x2f')]);_0x41ddfe['filters']=_[_0xaa39('0x33')](_0x41ddfe[_0xaa39('0x2d')],_0x41ddfe['query']);_0x40269a[_0xaa39('0x32')]=_['intersection'](_0x41ddfe['model'],qs[_0xaa39('0x34')](_0x41c392['query']['fields']));_0x40269a[_0xaa39('0x32')]=_0x40269a[_0xaa39('0x32')][_0xaa39('0x35')]?_0x40269a[_0xaa39('0x32')]:_0x41ddfe[_0xaa39('0x2d')];if(_0x41c392[_0xaa39('0x2f')][_0xaa39('0x40')]){_0x40269a[_0xaa39('0x41')]=[{'all':!![]}];}_0x40269a=_[_0xaa39('0x3d')]({},_0x40269a,_0x41c392[_0xaa39('0x3e')]);return db[_0xaa39('0x3f')]['find'](_0x40269a)[_0xaa39('0x24')](handleEntityNotFound(_0x210624,null))[_0xaa39('0x24')](respondWithResult(_0x210624,null))[_0xaa39('0x43')](handleError(_0x210624,null));};exports[_0xaa39('0x46')]=function(_0x366141,_0x413bf7){return db[_0xaa39('0x3f')][_0xaa39('0x46')](_0x366141[_0xaa39('0x47')],{})[_0xaa39('0x24')](function(_0x229cbe){var _0x342f23=_0x366141[_0xaa39('0x48')][_0xaa39('0x21')]({'plain':!![]});if(!_0x342f23)throw new Error(_0xaa39('0x49'));if(_0x342f23[_0xaa39('0x4a')]===_0xaa39('0x48')){var _0x4b6c7d=_0x229cbe[_0xaa39('0x21')]({'plain':!![]});var _0xc5c206=_0xaa39('0x22');return db[_0xaa39('0x4b')][_0xaa39('0x4c')]({'where':{'name':_0xc5c206,'userProfileId':_0x342f23[_0xaa39('0x4d')]},'raw':!![]})[_0xaa39('0x24')](function(_0x2c7172){if(_0x2c7172&&_0x2c7172[_0xaa39('0x4e')]===0x0){return db[_0xaa39('0x23')][_0xaa39('0x46')]({'name':_0x4b6c7d['name'],'resourceId':_0x4b6c7d['id'],'type':_0x2c7172[_0xaa39('0x27')],'sectionId':_0x2c7172['id']},{})['then'](function(){return _0x229cbe;});}else{return _0x229cbe;}})['catch'](function(_0x2edbd1){logger[_0xaa39('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2edbd1);throw _0x2edbd1;});}return _0x229cbe;})[_0xaa39('0x24')](respondWithResult(_0x413bf7,0xc9))['catch'](handleError(_0x413bf7,null));};exports['update']=function(_0x5088a3,_0x12c16b){if(_0x5088a3[_0xaa39('0x47')]['id']){delete _0x5088a3[_0xaa39('0x47')]['id'];}return db[_0xaa39('0x3f')][_0xaa39('0x4c')]({'where':{'id':_0x5088a3[_0xaa39('0x45')]['id']}})[_0xaa39('0x24')](handleEntityNotFound(_0x12c16b,null))[_0xaa39('0x24')](saveUpdates(_0x5088a3[_0xaa39('0x47')],null))['then'](respondWithResult(_0x12c16b,null))[_0xaa39('0x43')](handleError(_0x12c16b,null));};exports[_0xaa39('0x20')]=function(_0x1eef1b,_0x4e48e5){return db[_0xaa39('0x3f')][_0xaa39('0x4c')]({'where':{'id':_0x1eef1b['params']['id']}})[_0xaa39('0x24')](handleEntityNotFound(_0x4e48e5,null))['then'](removeEntity(_0x4e48e5,null))[_0xaa39('0x43')](handleError(_0x4e48e5,null));};exports[_0xaa39('0x4f')]=function(_0x3bf2c5,_0x14bc17,_0x119b90){if(_0x3bf2c5[_0xaa39('0x47')]['id']){delete _0x3bf2c5[_0xaa39('0x47')]['id'];}return db[_0xaa39('0x3f')][_0xaa39('0x4c')]({'where':{'id':_0x3bf2c5['params']['id']}})[_0xaa39('0x24')](handleEntityNotFound(_0x14bc17,null))[_0xaa39('0x24')](function(_0x1238a1){if(_0x1238a1){_0x3bf2c5[_0xaa39('0x47')][_0xaa39('0x50')]=_0x1238a1['id'];return db['Interval'][_0xaa39('0x46')](_0x3bf2c5[_0xaa39('0x47')]);}})[_0xaa39('0x24')](respondWithResult(_0x14bc17,null))[_0xaa39('0x43')](handleError(_0x14bc17,null));};exports[_0xaa39('0x51')]=function(_0x34bedf,_0x288626,_0x557075){var _0x4f457d={};var _0x22dc10={};var _0xdb4fde;var _0x5c5f73;return db['Interval'][_0xaa39('0x52')]({'where':{'id':_0x34bedf[_0xaa39('0x45')]['id']}})[_0xaa39('0x24')](handleEntityNotFound(_0x288626,null))[_0xaa39('0x24')](function(_0x2a914c){if(_0x2a914c){_0xdb4fde=_0x2a914c;_0x22dc10[_0xaa39('0x2d')]=_[_0xaa39('0x30')](db[_0xaa39('0x3f')][_0xaa39('0x29')]);_0x22dc10[_0xaa39('0x2f')]=_[_0xaa39('0x30')](_0x34bedf[_0xaa39('0x2f')]);_0x22dc10[_0xaa39('0x31')]=_[_0xaa39('0x33')](_0x22dc10[_0xaa39('0x2d')],_0x22dc10['query']);_0x4f457d[_0xaa39('0x32')]=_[_0xaa39('0x33')](_0x22dc10['model'],qs[_0xaa39('0x34')](_0x34bedf[_0xaa39('0x2f')][_0xaa39('0x34')]));_0x4f457d['attributes']=_0x4f457d['attributes'][_0xaa39('0x35')]?_0x4f457d[_0xaa39('0x32')]:_0x22dc10['model'];_0x4f457d[_0xaa39('0x53')]=qs[_0xaa39('0x37')](_0x34bedf[_0xaa39('0x2f')][_0xaa39('0x37')]);_0x4f457d[_0xaa39('0x3a')]=qs[_0xaa39('0x31')](_[_0xaa39('0x38')](_0x34bedf[_0xaa39('0x2f')],_0x22dc10['filters']));if(_0x34bedf[_0xaa39('0x2f')][_0xaa39('0x39')]){_0x4f457d[_0xaa39('0x3a')]=_[_0xaa39('0x3d')](_0x4f457d[_0xaa39('0x3a')],{'$or':_['map'](_0x4f457d['attributes'],function(_0x496853){var _0x4431df={};_0x4431df[_0x496853]={'$like':'%'+_0x34bedf[_0xaa39('0x2f')][_0xaa39('0x39')]+'%'};return _0x4431df;})});}_0x4f457d=_[_0xaa39('0x3d')]({},_0x4f457d,_0x34bedf[_0xaa39('0x3e')]);return _0xdb4fde[_0xaa39('0x51')](_0x4f457d);}})['then'](function(_0x16b032){if(_0x16b032){_0x5c5f73=_0x16b032['length'];if(!_0x34bedf[_0xaa39('0x2f')][_0xaa39('0x36')](_0xaa39('0x54'))){_0x4f457d[_0xaa39('0x1b')]=qs[_0xaa39('0x1b')](_0x34bedf['query'][_0xaa39('0x1b')]);_0x4f457d['offset']=qs[_0xaa39('0x1a')](_0x34bedf['query'][_0xaa39('0x1a')]);}return _0xdb4fde[_0xaa39('0x51')](_0x4f457d);}})[_0xaa39('0x24')](function(_0xd0c6e3){if(_0xd0c6e3){return _0xd0c6e3?{'count':_0x5c5f73,'rows':_0xd0c6e3}:null;}})['then'](respondWithResult(_0x288626,null))['catch'](handleError(_0x288626,null));};exports['addIntervals']=function(_0x3bf5f8,_0x33a416,_0x381569){return db[_0xaa39('0x3f')][_0xaa39('0x52')]({'where':{'id':_0x3bf5f8[_0xaa39('0x45')]['id']}})[_0xaa39('0x24')](handleEntityNotFound(_0x33a416,null))[_0xaa39('0x24')](function(_0x53317b){if(_0x53317b){return db[_0xaa39('0x55')][_0xaa39('0x56')](function(_0x30b539){return db[_0xaa39('0x3f')][_0xaa39('0x20')]({'where':{'IntervalId':_0x3bf5f8['params']['id']},'transaction':_0x30b539})[_0xaa39('0x24')](function(_0x1a1ddf){var _0x2a1454=_[_0xaa39('0x2e')](_0x3bf5f8[_0xaa39('0x47')],function(_0xab6a72){delete _0xab6a72['id'];_0xab6a72[_0xaa39('0x50')]=_0x3bf5f8[_0xaa39('0x45')]['id'];return _0xab6a72;});return db[_0xaa39('0x3f')][_0xaa39('0x57')](_0x2a1454,{'transaction':_0x30b539});});})[_0xaa39('0x24')](function(){return db[_0xaa39('0x3f')][_0xaa39('0x58')]({'where':{'IntervalId':_0x3bf5f8[_0xaa39('0x45')]['id']}});});}})[_0xaa39('0x24')](respondWithResult(_0x33a416,null))[_0xaa39('0x43')](handleError(_0x33a416,null));}; \ No newline at end of file +var _0x2f94=['addInterval','IntervalId','getIntervals','findOne','addIntervals','sequelize','bulkCreate','findAll','html-pdf','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','desk.js','to-csv','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','Intervals','UserProfileResource','destroy','stack','name','send','index','map','Interval','rawAttributes','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','type','VIRTUAL','field','includeAll','include','rows','catch','show','params','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2f94,0x174));var _0x42f9=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2f94[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require(_0x42f9('0x0'));var emlformat=require(_0x42f9('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x42f9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x42f9('0x3'));var moment=require(_0x42f9('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x42f9('0x5'));var util=require(_0x42f9('0x6'));var path=require(_0x42f9('0x7'));var sox=require(_0x42f9('0x8'));var csv=require('to-csv');var ejs=require(_0x42f9('0x9'));var fs=require('fs');var _=require(_0x42f9('0xa'));var squel=require(_0x42f9('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x42f9('0xc'));var toCsv=require(_0x42f9('0xd'));var querystring=require('querystring');var Papa=require(_0x42f9('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x42f9('0xf'));var as=require(_0x42f9('0x10'));var hardwareService=require(_0x42f9('0x11'));var logger=require(_0x42f9('0x12'))('api');var utils=require(_0x42f9('0x13'));var config=require(_0x42f9('0x14'));var db=require(_0x42f9('0x15'))['db'];var extensions=require(_0x42f9('0x16'));function respondWithStatusCode(_0x2f9511,_0x544373){_0x544373=_0x544373||0xcc;return function(_0x4d9359){if(_0x4d9359){return _0x2f9511[_0x42f9('0x17')](_0x544373);}return _0x2f9511[_0x42f9('0x18')](_0x544373)[_0x42f9('0x19')]();};}function respondWithResult(_0x3f64c7,_0x451808){_0x451808=_0x451808||0xc8;return function(_0x445299){if(_0x445299){return _0x3f64c7[_0x42f9('0x18')](_0x451808)['json'](_0x445299);}};}function respondWithFilteredResult(_0x234d64,_0x153656){return function(_0x605c1d){if(_0x605c1d){var _0xe09bc3=_0x605c1d[_0x42f9('0x1a')],_0x36329b=_0x153656[_0x42f9('0x1b')],_0x3d457b=_0x153656[_0x42f9('0x1b')]+_0x153656[_0x42f9('0x1c')],_0x4f0bf4;if(_0x3d457b>=_0xe09bc3){_0x3d457b=_0xe09bc3;_0x4f0bf4=0xc8;}else{_0x4f0bf4=0xce;}_0x234d64[_0x42f9('0x18')](_0x4f0bf4);return _0x234d64[_0x42f9('0x1d')](_0x42f9('0x1e'),_0x36329b+'-'+_0x3d457b+'/'+_0xe09bc3)[_0x42f9('0x1f')](_0x605c1d);}return null;};}function patchUpdates(_0x3bc2d5){return function(_0x332157){try{jsonpatch[_0x42f9('0x20')](_0x332157,_0x3bc2d5,!![]);}catch(_0x481ff8){return BPromise[_0x42f9('0x21')](_0x481ff8);}return _0x332157[_0x42f9('0x22')]();};}function saveUpdates(_0x45c60c,_0x4ec5f2){return function(_0x24294d){if(_0x24294d){return _0x24294d[_0x42f9('0x23')](_0x45c60c)['then'](function(_0x9d251b){return _0x9d251b;});}return null;};}function removeEntity(_0x2e5820,_0x3776b5){return function(_0x399091){if(_0x399091){return _0x399091['destroy']()[_0x42f9('0x24')](function(){var _0x3c3374=_0x399091['get']({'plain':!![]});var _0x3c140e=_0x42f9('0x25');return db[_0x42f9('0x26')][_0x42f9('0x27')]({'where':{'type':_0x3c140e,'resourceId':_0x3c3374['id']}})[_0x42f9('0x24')](function(){return _0x399091;});})[_0x42f9('0x24')](function(){_0x2e5820[_0x42f9('0x18')](0xcc)[_0x42f9('0x19')]();});}};}function handleEntityNotFound(_0x393cbe,_0x25b8c6){return function(_0x1fd056){if(!_0x1fd056){_0x393cbe[_0x42f9('0x17')](0x194);}return _0x1fd056;};}function handleError(_0x549864,_0x63e079){_0x63e079=_0x63e079||0x1f4;return function(_0x2547cf){logger['error'](_0x2547cf[_0x42f9('0x28')]);if(_0x2547cf[_0x42f9('0x29')]){delete _0x2547cf['name'];}_0x549864[_0x42f9('0x18')](_0x63e079)[_0x42f9('0x2a')](_0x2547cf);};}exports[_0x42f9('0x2b')]=function(_0x2a3faa,_0x39e00d){var _0xc55d8c={},_0x13fe77={},_0x458034={'count':0x0,'rows':[]};var _0x4d04a3=_[_0x42f9('0x2c')](db[_0x42f9('0x2d')][_0x42f9('0x2e')],function(_0x37b992){return{'name':_0x37b992['fieldName'],'type':_0x37b992['type'][_0x42f9('0x2f')]};});_0x13fe77[_0x42f9('0x30')]=_[_0x42f9('0x2c')](_0x4d04a3,_0x42f9('0x29'));_0x13fe77[_0x42f9('0x31')]=_[_0x42f9('0x32')](_0x2a3faa['query']);_0x13fe77[_0x42f9('0x33')]=_['intersection'](_0x13fe77[_0x42f9('0x30')],_0x13fe77['query']);_0xc55d8c[_0x42f9('0x34')]=_[_0x42f9('0x35')](_0x13fe77[_0x42f9('0x30')],qs['fields'](_0x2a3faa[_0x42f9('0x31')][_0x42f9('0x36')]));_0xc55d8c[_0x42f9('0x34')]=_0xc55d8c[_0x42f9('0x34')][_0x42f9('0x37')]?_0xc55d8c[_0x42f9('0x34')]:_0x13fe77['model'];if(!_0x2a3faa['query'][_0x42f9('0x38')](_0x42f9('0x39'))){_0xc55d8c[_0x42f9('0x1c')]=qs[_0x42f9('0x1c')](_0x2a3faa['query'][_0x42f9('0x1c')]);_0xc55d8c[_0x42f9('0x1b')]=qs[_0x42f9('0x1b')](_0x2a3faa[_0x42f9('0x31')][_0x42f9('0x1b')]);}_0xc55d8c[_0x42f9('0x3a')]=qs[_0x42f9('0x3b')](_0x2a3faa['query']['sort']);_0xc55d8c['where']=qs[_0x42f9('0x33')](_['pick'](_0x2a3faa['query'],_0x13fe77[_0x42f9('0x33')]));if(_0x2a3faa[_0x42f9('0x31')][_0x42f9('0x3c')]){_0xc55d8c[_0x42f9('0x3d')]=_[_0x42f9('0x3e')](_0xc55d8c[_0x42f9('0x3d')],{'$or':_[_0x42f9('0x2c')](_0x4d04a3,function(_0x8a2703){if(_0x8a2703[_0x42f9('0x3f')][_0x42f9('0x2f')]!==_0x42f9('0x40')){var _0x5424cb={};_0x5424cb[_0x8a2703[_0x42f9('0x41')]]={'$like':'%'+_0x2a3faa[_0x42f9('0x31')][_0x42f9('0x3c')]+'%'};return _0x5424cb;}})});}_0xc55d8c=_[_0x42f9('0x3e')]({},_0xc55d8c,_0x2a3faa['options']);var _0x4a23e6={'where':_0xc55d8c[_0x42f9('0x3d')]};return db[_0x42f9('0x2d')][_0x42f9('0x1a')](_0x4a23e6)['then'](function(_0x10581d){_0x458034[_0x42f9('0x1a')]=_0x10581d;if(_0x2a3faa[_0x42f9('0x31')][_0x42f9('0x42')]){_0xc55d8c[_0x42f9('0x43')]=[{'all':!![]}];}return db['Interval']['findAll'](_0xc55d8c);})['then'](function(_0x765350){_0x458034[_0x42f9('0x44')]=_0x765350;return _0x458034;})[_0x42f9('0x24')](respondWithFilteredResult(_0x39e00d,_0xc55d8c))[_0x42f9('0x45')](handleError(_0x39e00d,null));};exports[_0x42f9('0x46')]=function(_0x5f5441,_0x3880f2){var _0x3e7fe2={'raw':!![],'where':{'id':_0x5f5441[_0x42f9('0x47')]['id']}},_0x2827a5={};_0x2827a5[_0x42f9('0x30')]=_[_0x42f9('0x32')](db['Interval']['rawAttributes']);_0x2827a5[_0x42f9('0x31')]=_[_0x42f9('0x32')](_0x5f5441[_0x42f9('0x31')]);_0x2827a5[_0x42f9('0x33')]=_['intersection'](_0x2827a5[_0x42f9('0x30')],_0x2827a5[_0x42f9('0x31')]);_0x3e7fe2[_0x42f9('0x34')]=_[_0x42f9('0x35')](_0x2827a5['model'],qs[_0x42f9('0x36')](_0x5f5441[_0x42f9('0x31')][_0x42f9('0x36')]));_0x3e7fe2['attributes']=_0x3e7fe2[_0x42f9('0x34')]['length']?_0x3e7fe2['attributes']:_0x2827a5[_0x42f9('0x30')];if(_0x5f5441[_0x42f9('0x31')][_0x42f9('0x42')]){_0x3e7fe2[_0x42f9('0x43')]=[{'all':!![]}];}_0x3e7fe2=_['merge']({},_0x3e7fe2,_0x5f5441[_0x42f9('0x48')]);return db['Interval'][_0x42f9('0x49')](_0x3e7fe2)[_0x42f9('0x24')](handleEntityNotFound(_0x3880f2,null))['then'](respondWithResult(_0x3880f2,null))['catch'](handleError(_0x3880f2,null));};exports[_0x42f9('0x4a')]=function(_0x4107ca,_0x3da9a0){return db[_0x42f9('0x2d')][_0x42f9('0x4a')](_0x4107ca[_0x42f9('0x4b')],{})[_0x42f9('0x24')](function(_0x382f7d){var _0x3b868a=_0x4107ca[_0x42f9('0x4c')][_0x42f9('0x4d')]({'plain':!![]});if(!_0x3b868a)throw new Error(_0x42f9('0x4e'));if(_0x3b868a[_0x42f9('0x4f')]==='user'){var _0x456256=_0x382f7d[_0x42f9('0x4d')]({'plain':!![]});var _0x382abc='Intervals';return db[_0x42f9('0x50')][_0x42f9('0x49')]({'where':{'name':_0x382abc,'userProfileId':_0x3b868a['userProfileId']},'raw':!![]})[_0x42f9('0x24')](function(_0x479b3b){if(_0x479b3b&&_0x479b3b[_0x42f9('0x51')]===0x0){return db[_0x42f9('0x26')][_0x42f9('0x4a')]({'name':_0x456256[_0x42f9('0x29')],'resourceId':_0x456256['id'],'type':_0x479b3b[_0x42f9('0x29')],'sectionId':_0x479b3b['id']},{})[_0x42f9('0x24')](function(){return _0x382f7d;});}else{return _0x382f7d;}})[_0x42f9('0x45')](function(_0x270ea8){logger['error'](_0x42f9('0x52'),_0x270ea8);throw _0x270ea8;});}return _0x382f7d;})['then'](respondWithResult(_0x3da9a0,0xc9))[_0x42f9('0x45')](handleError(_0x3da9a0,null));};exports['update']=function(_0x33d3b0,_0x46aecc){if(_0x33d3b0[_0x42f9('0x4b')]['id']){delete _0x33d3b0['body']['id'];}return db[_0x42f9('0x2d')][_0x42f9('0x49')]({'where':{'id':_0x33d3b0[_0x42f9('0x47')]['id']}})[_0x42f9('0x24')](handleEntityNotFound(_0x46aecc,null))[_0x42f9('0x24')](saveUpdates(_0x33d3b0[_0x42f9('0x4b')],null))[_0x42f9('0x24')](respondWithResult(_0x46aecc,null))[_0x42f9('0x45')](handleError(_0x46aecc,null));};exports[_0x42f9('0x27')]=function(_0x38ed21,_0x2f721e){return db['Interval']['find']({'where':{'id':_0x38ed21[_0x42f9('0x47')]['id']}})[_0x42f9('0x24')](handleEntityNotFound(_0x2f721e,null))['then'](removeEntity(_0x2f721e,null))['catch'](handleError(_0x2f721e,null));};exports[_0x42f9('0x53')]=function(_0x23668c,_0x39a479,_0x25ef7f){if(_0x23668c['body']['id']){delete _0x23668c[_0x42f9('0x4b')]['id'];}return db['Interval'][_0x42f9('0x49')]({'where':{'id':_0x23668c['params']['id']}})[_0x42f9('0x24')](handleEntityNotFound(_0x39a479,null))[_0x42f9('0x24')](function(_0x43f144){if(_0x43f144){_0x23668c[_0x42f9('0x4b')][_0x42f9('0x54')]=_0x43f144['id'];return db['Interval']['create'](_0x23668c['body']);}})['then'](respondWithResult(_0x39a479,null))[_0x42f9('0x45')](handleError(_0x39a479,null));};exports[_0x42f9('0x55')]=function(_0x205558,_0x5d3e28,_0x1aca18){var _0x16e4f1={};var _0x5831ab={};var _0x23caf4;var _0x2a52c9;return db[_0x42f9('0x2d')][_0x42f9('0x56')]({'where':{'id':_0x205558[_0x42f9('0x47')]['id']}})[_0x42f9('0x24')](handleEntityNotFound(_0x5d3e28,null))[_0x42f9('0x24')](function(_0x46462f){if(_0x46462f){_0x23caf4=_0x46462f;_0x5831ab[_0x42f9('0x30')]=_[_0x42f9('0x32')](db[_0x42f9('0x2d')][_0x42f9('0x2e')]);_0x5831ab['query']=_[_0x42f9('0x32')](_0x205558[_0x42f9('0x31')]);_0x5831ab['filters']=_[_0x42f9('0x35')](_0x5831ab[_0x42f9('0x30')],_0x5831ab['query']);_0x16e4f1[_0x42f9('0x34')]=_['intersection'](_0x5831ab['model'],qs[_0x42f9('0x36')](_0x205558[_0x42f9('0x31')]['fields']));_0x16e4f1[_0x42f9('0x34')]=_0x16e4f1[_0x42f9('0x34')][_0x42f9('0x37')]?_0x16e4f1[_0x42f9('0x34')]:_0x5831ab[_0x42f9('0x30')];_0x16e4f1[_0x42f9('0x3a')]=qs[_0x42f9('0x3b')](_0x205558[_0x42f9('0x31')][_0x42f9('0x3b')]);_0x16e4f1['where']=qs[_0x42f9('0x33')](_['pick'](_0x205558[_0x42f9('0x31')],_0x5831ab['filters']));if(_0x205558['query']['filter']){_0x16e4f1[_0x42f9('0x3d')]=_[_0x42f9('0x3e')](_0x16e4f1[_0x42f9('0x3d')],{'$or':_['map'](_0x16e4f1['attributes'],function(_0xa27939){var _0x1f94fe={};_0x1f94fe[_0xa27939]={'$like':'%'+_0x205558['query'][_0x42f9('0x3c')]+'%'};return _0x1f94fe;})});}_0x16e4f1=_[_0x42f9('0x3e')]({},_0x16e4f1,_0x205558[_0x42f9('0x48')]);return _0x23caf4[_0x42f9('0x55')](_0x16e4f1);}})[_0x42f9('0x24')](function(_0x476ec7){if(_0x476ec7){_0x2a52c9=_0x476ec7[_0x42f9('0x37')];if(!_0x205558['query']['hasOwnProperty']('nolimit')){_0x16e4f1[_0x42f9('0x1c')]=qs[_0x42f9('0x1c')](_0x205558['query'][_0x42f9('0x1c')]);_0x16e4f1[_0x42f9('0x1b')]=qs[_0x42f9('0x1b')](_0x205558[_0x42f9('0x31')][_0x42f9('0x1b')]);}return _0x23caf4[_0x42f9('0x55')](_0x16e4f1);}})[_0x42f9('0x24')](function(_0xdb8d6e){if(_0xdb8d6e){return _0xdb8d6e?{'count':_0x2a52c9,'rows':_0xdb8d6e}:null;}})[_0x42f9('0x24')](respondWithResult(_0x5d3e28,null))[_0x42f9('0x45')](handleError(_0x5d3e28,null));};exports[_0x42f9('0x57')]=function(_0x21a663,_0x2c5a34,_0x4f27f8){return db['Interval'][_0x42f9('0x56')]({'where':{'id':_0x21a663[_0x42f9('0x47')]['id']}})[_0x42f9('0x24')](handleEntityNotFound(_0x2c5a34,null))[_0x42f9('0x24')](function(_0xffaf22){if(_0xffaf22){return db[_0x42f9('0x58')]['transaction'](function(_0x44a6c0){return db[_0x42f9('0x2d')]['destroy']({'where':{'IntervalId':_0x21a663[_0x42f9('0x47')]['id']},'transaction':_0x44a6c0})['then'](function(_0x544b28){var _0xb5be8f=_['map'](_0x21a663[_0x42f9('0x4b')],function(_0xc5fe8){delete _0xc5fe8['id'];_0xc5fe8[_0x42f9('0x54')]=_0x21a663[_0x42f9('0x47')]['id'];return _0xc5fe8;});return db[_0x42f9('0x2d')][_0x42f9('0x59')](_0xb5be8f,{'transaction':_0x44a6c0});});})['then'](function(){return db[_0x42f9('0x2d')][_0x42f9('0x5a')]({'where':{'IntervalId':_0x21a663[_0x42f9('0x47')]['id']}});});}})[_0x42f9('0x24')](respondWithResult(_0x2c5a34,null))[_0x42f9('0x45')](handleError(_0x2c5a34,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index e226bab..5f13146 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 _0xae75=['define','Interval','tools_intervals','rewrite','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./interval.attributes','exports'];(function(_0x481ee8,_0x5aa574){var _0x5ad55f=function(_0x81c176){while(--_0x81c176){_0x481ee8['push'](_0x481ee8['shift']());}};_0x5ad55f(++_0x5aa574);}(_0xae75,0x1a8));var _0x5ae7=function(_0x45fef5,_0x309525){_0x45fef5=_0x45fef5-0x0;var _0x1487b4=_0xae75[_0x45fef5];return _0x1487b4;};'use strict';var _=require(_0x5ae7('0x0'));var util=require(_0x5ae7('0x1'));var logger=require(_0x5ae7('0x2'))('api');var moment=require(_0x5ae7('0x3'));var BPromise=require(_0x5ae7('0x4'));var rp=require(_0x5ae7('0x5'));var fs=require('fs');var path=require(_0x5ae7('0x6'));var rimraf=require(_0x5ae7('0x7'));var config=require(_0x5ae7('0x8'));var attributes=require(_0x5ae7('0x9'));var extensions=require('../../components/extensions/rewrite');module[_0x5ae7('0xa')]=function(_0x6f17f2,_0x5c1529){return _0x6f17f2[_0x5ae7('0xb')](_0x5ae7('0xc'),attributes,{'tableName':_0x5ae7('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x529528,_0x4b8588){extensions['rewrite'](_0x6f17f2,_0x529528);},'afterBulkCreate':function(_0x5da715,_0x5c3247,_0x72148c){_0x72148c();extensions['rewrite'](_0x6f17f2,_0x5da715[0x0]);},'afterUpdate':function(_0x3c24fd,_0x5e89de){extensions[_0x5ae7('0xe')](_0x6f17f2,_0x3c24fd);},'afterDestroy':function(_0x183b2d,_0xc8d37d){extensions[_0x5ae7('0xe')](_0x6f17f2,_0x183b2d);}}});}; \ No newline at end of file +var _0xedb4=['../../config/environment','./interval.attributes','exports','define','Interval','rewrite','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x36a0de,_0x575144){var _0x380d1c=function(_0x2e36cb){while(--_0x2e36cb){_0x36a0de['push'](_0x36a0de['shift']());}};_0x380d1c(++_0x575144);}(_0xedb4,0x156));var _0x4edb=function(_0x19ac6e,_0x435862){_0x19ac6e=_0x19ac6e-0x0;var _0x1cdcf3=_0xedb4[_0x19ac6e];return _0x1cdcf3;};'use strict';var _=require('lodash');var util=require(_0x4edb('0x0'));var logger=require(_0x4edb('0x1'))(_0x4edb('0x2'));var moment=require(_0x4edb('0x3'));var BPromise=require(_0x4edb('0x4'));var rp=require(_0x4edb('0x5'));var fs=require('fs');var path=require(_0x4edb('0x6'));var rimraf=require(_0x4edb('0x7'));var config=require(_0x4edb('0x8'));var attributes=require(_0x4edb('0x9'));var extensions=require('../../components/extensions/rewrite');module[_0x4edb('0xa')]=function(_0xe7762c,_0x48f537){return _0xe7762c[_0x4edb('0xb')](_0x4edb('0xc'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x41fc06,_0x2313af){extensions['rewrite'](_0xe7762c,_0x41fc06);},'afterBulkCreate':function(_0x103718,_0x7b717f,_0x86d377){_0x86d377();extensions[_0x4edb('0xd')](_0xe7762c,_0x103718[0x0]);},'afterUpdate':function(_0xf4fb7c,_0x265db3){extensions[_0x4edb('0xd')](_0xe7762c,_0xf4fb7c);},'afterDestroy':function(_0x84e179,_0x2186a5){extensions[_0x4edb('0xd')](_0xe7762c,_0x84e179);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 8711182..4156592 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 _0x8a03=['attributes','GetInterval','debug','ShowInterval','find','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','Interval,\x20%s,\x20%s','request\x20sent','Interval,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','Interval','options','raw','where','limit','include','map','model'];(function(_0x17282c,_0x1c5bb0){var _0x489a8f=function(_0x180b84){while(--_0x180b84){_0x17282c['push'](_0x17282c['shift']());}};_0x489a8f(++_0x1c5bb0);}(_0x8a03,0x16d));var _0x38a0=function(_0x4cae62,_0x3bb687){_0x4cae62=_0x4cae62-0x0;var _0x434162=_0x8a03[_0x4cae62];return _0x434162;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x38a0('0x0'));var BPromise=require(_0x38a0('0x1'));var rs=require(_0x38a0('0x2'));var fs=require('fs');var Redis=require(_0x38a0('0x3'));var db=require(_0x38a0('0x4'))['db'];var utils=require(_0x38a0('0x5'));var logger=require(_0x38a0('0x6'))(_0x38a0('0x7'));var config=require(_0x38a0('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x38a0('0x9')][_0x38a0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3387f0,_0x57a72d,_0x47fac4){return new BPromise(function(_0x2e1507,_0x401e77){return client[_0x38a0('0xb')](_0x3387f0,_0x47fac4)[_0x38a0('0xc')](function(_0x2cdf90){logger['info'](_0x38a0('0xd'),_0x57a72d,_0x38a0('0xe'));logger['debug'](_0x38a0('0xf'),_0x57a72d,_0x38a0('0xe'),JSON[_0x38a0('0x10')](_0x2cdf90));if(_0x2cdf90[_0x38a0('0x11')]){if(_0x2cdf90[_0x38a0('0x11')][_0x38a0('0x12')]===0x1f4){logger[_0x38a0('0x11')](_0x38a0('0xd'),_0x57a72d,_0x2cdf90[_0x38a0('0x11')][_0x38a0('0x13')]);return _0x401e77(_0x2cdf90[_0x38a0('0x11')]['message']);}logger[_0x38a0('0x11')](_0x38a0('0xd'),_0x57a72d,_0x2cdf90[_0x38a0('0x11')]['message']);return _0x2e1507(_0x2cdf90[_0x38a0('0x11')][_0x38a0('0x13')]);}else{logger[_0x38a0('0x14')](_0x38a0('0xd'),_0x57a72d,_0x38a0('0xe'));_0x2e1507(_0x2cdf90[_0x38a0('0x15')][_0x38a0('0x13')]);}})[_0x38a0('0x16')](function(_0x5ce63b){logger[_0x38a0('0x11')]('Interval,\x20%s,\x20%s',_0x57a72d,_0x5ce63b);_0x401e77(_0x5ce63b);});});}exports['GetInterval']=function(_0x3d8010){var _0x5c8660=this;return new Promise(function(_0x2f923f,_0xdd1dd1){return db[_0x38a0('0x17')]['findAll']({'raw':_0x3d8010[_0x38a0('0x18')]?_0x3d8010[_0x38a0('0x18')][_0x38a0('0x19')]===undefined?!![]:![]:!![],'where':_0x3d8010[_0x38a0('0x18')]?_0x3d8010['options'][_0x38a0('0x1a')]||null:null,'attributes':_0x3d8010[_0x38a0('0x18')]?_0x3d8010['options']['attributes']||null:null,'limit':_0x3d8010[_0x38a0('0x18')]?_0x3d8010['options'][_0x38a0('0x1b')]||null:null,'include':_0x3d8010[_0x38a0('0x18')]?_0x3d8010[_0x38a0('0x18')][_0x38a0('0x1c')]?_[_0x38a0('0x1d')](_0x3d8010[_0x38a0('0x18')]['include'],function(_0x55834d){return{'model':db[_0x55834d[_0x38a0('0x1e')]],'as':_0x55834d['as'],'attributes':_0x55834d[_0x38a0('0x1f')],'include':_0x55834d[_0x38a0('0x1c')]?_['map'](_0x55834d[_0x38a0('0x1c')],function(_0x158723){return{'model':db[_0x158723[_0x38a0('0x1e')]],'as':_0x158723['as'],'attributes':_0x158723[_0x38a0('0x1f')],'include':_0x158723[_0x38a0('0x1c')]?_['map'](_0x158723[_0x38a0('0x1c')],function(_0x4a2298){return{'model':db[_0x4a2298['model']],'as':_0x4a2298['as'],'attributes':_0x4a2298[_0x38a0('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x38a0('0xc')](function(_0x1ace0b){logger['info'](_0x38a0('0x20'),_0x3d8010);logger[_0x38a0('0x21')](_0x38a0('0x20'),_0x3d8010,JSON[_0x38a0('0x10')](_0x1ace0b));_0x2f923f(_0x1ace0b);})[_0x38a0('0x16')](function(_0x44a585){logger['error'](_0x38a0('0x20'),_0x44a585[_0x38a0('0x13')],_0x3d8010);_0xdd1dd1(_0x5c8660[_0x38a0('0x11')](0x1f4,_0x44a585['message']));});});};exports[_0x38a0('0x22')]=function(_0x258364){var _0xf16fc7=this;return new Promise(function(_0x8e59a9,_0x1d666b){return db['Interval'][_0x38a0('0x23')]({'raw':_0x258364[_0x38a0('0x18')]?_0x258364[_0x38a0('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x258364[_0x38a0('0x18')]?_0x258364[_0x38a0('0x18')]['where']||null:null,'attributes':_0x258364['options']?_0x258364['options'][_0x38a0('0x1f')]||null:null,'include':_0x258364[_0x38a0('0x18')]?_0x258364[_0x38a0('0x18')][_0x38a0('0x1c')]?_['map'](_0x258364[_0x38a0('0x18')]['include'],function(_0x5c211d){return{'model':db[_0x5c211d['model']],'as':_0x5c211d['as'],'attributes':_0x5c211d[_0x38a0('0x1f')],'include':_0x5c211d[_0x38a0('0x1c')]?_[_0x38a0('0x1d')](_0x5c211d['include'],function(_0x243850){return{'model':db[_0x243850[_0x38a0('0x1e')]],'as':_0x243850['as'],'attributes':_0x243850[_0x38a0('0x1f')],'include':_0x243850[_0x38a0('0x1c')]?_[_0x38a0('0x1d')](_0x243850[_0x38a0('0x1c')],function(_0x3c0bfb){return{'model':db[_0x3c0bfb[_0x38a0('0x1e')]],'as':_0x3c0bfb['as'],'attributes':_0x3c0bfb[_0x38a0('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x38a0('0xc')](function(_0x1f06ff){logger[_0x38a0('0x14')]('ShowInterval',_0x258364);logger[_0x38a0('0x21')]('ShowInterval',_0x258364,JSON[_0x38a0('0x10')](_0x1f06ff));_0x8e59a9(_0x1f06ff);})[_0x38a0('0x16')](function(_0x1f900b){logger[_0x38a0('0x11')](_0x38a0('0x22'),_0x1f900b[_0x38a0('0x13')],_0x258364);_0x1d666b(_0xf16fc7[_0x38a0('0x11')](0x1f4,_0x1f900b[_0x38a0('0x13')]));});});}; \ No newline at end of file +var _0x05b9=['error','code','message','catch','GetInterval','Interval','findAll','options','attributes','limit','include','map','model','ShowInterval','find','raw','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x15efce,_0x5a45a3){var _0x323443=function(_0x143f79){while(--_0x143f79){_0x15efce['push'](_0x15efce['shift']());}};_0x323443(++_0x5a45a3);}(_0x05b9,0x141));var _0x905b=function(_0x28a766,_0x5f98cf){_0x28a766=_0x28a766-0x0;var _0x43f2df=_0x05b9[_0x28a766];return _0x43f2df;};'use strict';var _=require(_0x905b('0x0'));var util=require(_0x905b('0x1'));var moment=require(_0x905b('0x2'));var BPromise=require(_0x905b('0x3'));var rs=require(_0x905b('0x4'));var fs=require('fs');var Redis=require(_0x905b('0x5'));var db=require(_0x905b('0x6'))['db'];var utils=require(_0x905b('0x7'));var logger=require('../../config/logger')(_0x905b('0x8'));var config=require(_0x905b('0x9'));var jayson=require(_0x905b('0xa'));var client=jayson[_0x905b('0xb')][_0x905b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x89054f,_0x461261,_0x3ef1a9){return new BPromise(function(_0x374f1f,_0x5d8184){return client[_0x905b('0xd')](_0x89054f,_0x3ef1a9)[_0x905b('0xe')](function(_0x433b4a){logger[_0x905b('0xf')](_0x905b('0x10'),_0x461261,_0x905b('0x11'));logger[_0x905b('0x12')](_0x905b('0x13'),_0x461261,_0x905b('0x11'),JSON[_0x905b('0x14')](_0x433b4a));if(_0x433b4a[_0x905b('0x15')]){if(_0x433b4a[_0x905b('0x15')][_0x905b('0x16')]===0x1f4){logger[_0x905b('0x15')](_0x905b('0x10'),_0x461261,_0x433b4a['error'][_0x905b('0x17')]);return _0x5d8184(_0x433b4a[_0x905b('0x15')][_0x905b('0x17')]);}logger[_0x905b('0x15')](_0x905b('0x10'),_0x461261,_0x433b4a[_0x905b('0x15')]['message']);return _0x374f1f(_0x433b4a[_0x905b('0x15')][_0x905b('0x17')]);}else{logger[_0x905b('0xf')]('Interval,\x20%s,\x20%s',_0x461261,'request\x20sent');_0x374f1f(_0x433b4a['result'][_0x905b('0x17')]);}})[_0x905b('0x18')](function(_0x3bd26b){logger[_0x905b('0x15')]('Interval,\x20%s,\x20%s',_0x461261,_0x3bd26b);_0x5d8184(_0x3bd26b);});});}exports[_0x905b('0x19')]=function(_0x4d35e7){var _0x3a1e04=this;return new Promise(function(_0x2c16a8,_0x323bf0){return db[_0x905b('0x1a')][_0x905b('0x1b')]({'raw':_0x4d35e7[_0x905b('0x1c')]?_0x4d35e7[_0x905b('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x4d35e7[_0x905b('0x1c')]?_0x4d35e7[_0x905b('0x1c')]['where']||null:null,'attributes':_0x4d35e7['options']?_0x4d35e7[_0x905b('0x1c')][_0x905b('0x1d')]||null:null,'limit':_0x4d35e7[_0x905b('0x1c')]?_0x4d35e7[_0x905b('0x1c')][_0x905b('0x1e')]||null:null,'include':_0x4d35e7['options']?_0x4d35e7[_0x905b('0x1c')][_0x905b('0x1f')]?_[_0x905b('0x20')](_0x4d35e7[_0x905b('0x1c')]['include'],function(_0x45eded){return{'model':db[_0x45eded[_0x905b('0x21')]],'as':_0x45eded['as'],'attributes':_0x45eded[_0x905b('0x1d')],'include':_0x45eded[_0x905b('0x1f')]?_[_0x905b('0x20')](_0x45eded[_0x905b('0x1f')],function(_0x125936){return{'model':db[_0x125936[_0x905b('0x21')]],'as':_0x125936['as'],'attributes':_0x125936[_0x905b('0x1d')],'include':_0x125936[_0x905b('0x1f')]?_[_0x905b('0x20')](_0x125936['include'],function(_0x3e9ae9){return{'model':db[_0x3e9ae9[_0x905b('0x21')]],'as':_0x3e9ae9['as'],'attributes':_0x3e9ae9[_0x905b('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x905b('0xe')](function(_0x5d2950){logger['info'](_0x905b('0x19'),_0x4d35e7);logger[_0x905b('0x12')]('GetInterval',_0x4d35e7,JSON[_0x905b('0x14')](_0x5d2950));_0x2c16a8(_0x5d2950);})[_0x905b('0x18')](function(_0x1abdc5){logger['error'](_0x905b('0x19'),_0x1abdc5[_0x905b('0x17')],_0x4d35e7);_0x323bf0(_0x3a1e04[_0x905b('0x15')](0x1f4,_0x1abdc5['message']));});});};exports[_0x905b('0x22')]=function(_0x4ba46b){var _0x1e9a84=this;return new Promise(function(_0x3f7ab6,_0x2ef19f){return db[_0x905b('0x1a')][_0x905b('0x23')]({'raw':_0x4ba46b[_0x905b('0x1c')]?_0x4ba46b[_0x905b('0x1c')][_0x905b('0x24')]===undefined?!![]:![]:!![],'where':_0x4ba46b[_0x905b('0x1c')]?_0x4ba46b[_0x905b('0x1c')][_0x905b('0x25')]||null:null,'attributes':_0x4ba46b[_0x905b('0x1c')]?_0x4ba46b[_0x905b('0x1c')][_0x905b('0x1d')]||null:null,'include':_0x4ba46b[_0x905b('0x1c')]?_0x4ba46b[_0x905b('0x1c')][_0x905b('0x1f')]?_['map'](_0x4ba46b[_0x905b('0x1c')][_0x905b('0x1f')],function(_0x528f16){return{'model':db[_0x528f16[_0x905b('0x21')]],'as':_0x528f16['as'],'attributes':_0x528f16['attributes'],'include':_0x528f16['include']?_[_0x905b('0x20')](_0x528f16[_0x905b('0x1f')],function(_0x1a19d1){return{'model':db[_0x1a19d1[_0x905b('0x21')]],'as':_0x1a19d1['as'],'attributes':_0x1a19d1[_0x905b('0x1d')],'include':_0x1a19d1['include']?_['map'](_0x1a19d1[_0x905b('0x1f')],function(_0x1f12c2){return{'model':db[_0x1f12c2[_0x905b('0x21')]],'as':_0x1f12c2['as'],'attributes':_0x1f12c2[_0x905b('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x905b('0xe')](function(_0x4cd46e){logger[_0x905b('0xf')]('ShowInterval',_0x4ba46b);logger[_0x905b('0x12')]('ShowInterval',_0x4ba46b,JSON[_0x905b('0x14')](_0x4cd46e));_0x3f7ab6(_0x4cd46e);})[_0x905b('0x18')](function(_0x1d440b){logger['error'](_0x905b('0x22'),_0x1d440b['message'],_0x4ba46b);_0x2ef19f(_0x1e9a84[_0x905b('0x15')](0x1f4,_0x1d440b['message']));});});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index 44c5e72..47b5735 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 _0x5aee=['isAuthenticated','send','exports','express','Router','./jira.controller'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x5aee,0x111));var _0xe5ae=function(_0xc6934e,_0x90f933){_0xc6934e=_0xc6934e-0x0;var _0x1afffd=_0x5aee[_0xc6934e];return _0x1afffd;};'use strict';var express=require(_0xe5ae('0x0'));var router=express[_0xe5ae('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xe5ae('0x2'));router['post']('/',auth[_0xe5ae('0x3')](),controller[_0xe5ae('0x4')]);module[_0xe5ae('0x5')]=router; \ No newline at end of file +var _0xd955=['Router','../../components/auth/service','./jira.controller','post','isAuthenticated','send','express'];(function(_0x2ae8bb,_0x4656a8){var _0x3c2599=function(_0x901a3a){while(--_0x901a3a){_0x2ae8bb['push'](_0x2ae8bb['shift']());}};_0x3c2599(++_0x4656a8);}(_0xd955,0x156));var _0x5d95=function(_0x3a8847,_0x56e88c){_0x3a8847=_0x3a8847-0x0;var _0x11d51d=_0xd955[_0x3a8847];return _0x11d51d;};'use strict';var express=require(_0x5d95('0x0'));var router=express[_0x5d95('0x1')]();var auth=require(_0x5d95('0x2'));var controller=require(_0x5d95('0x3'));router[_0x5d95('0x4')]('/',auth[_0x5d95('0x5')](),controller[_0x5d95('0x6')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 992c4dc..6341590 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 _0xf5e3=['customfield_10102','track.xcallymotion.com','POST','application/json','toString','base64','stringify','setEncoding','utf8','statusCode','parse','status','json','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','connection','remoteAddress','socket','bluebird','https','../../config/logger','api','support','3eAmWpBVP0','key','MOTGUI','Report','\x20from\x20','description','issuetype','Bug','customfield_11500','email','oldToken','fields','customfield_11502','newToken','customfield_11503','customfield_11504','reason'];(function(_0x45d12d,_0x60e5f1){var _0x16a4fe=function(_0x4e6239){while(--_0x4e6239){_0x45d12d['push'](_0x45d12d['shift']());}};_0x16a4fe(++_0x60e5f1);}(_0xf5e3,0x74));var _0x3f5e=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0xf5e3[_0x543084];return _0x306a57;};'use strict';var BPromise=require(_0x3f5e('0x0'));var https=require(_0x3f5e('0x1'));var logger=require(_0x3f5e('0x2'))(_0x3f5e('0x3'));var USERNAME=_0x3f5e('0x4');var PASSWORD=_0x3f5e('0x5');function openIssue(_0x37a235,_0x3b58f6){var _0x4f3a24={'fields':{'project':{'key':_0x37a235[_0x3f5e('0x6')]||_0x3f5e('0x7')},'summary':(_0x37a235['summary']||_0x3f5e('0x8'))+_0x3f5e('0x9')+_0x37a235['ip'],'description':_0x37a235[_0x3f5e('0xa')]||JSON['stringify'](_0x37a235),'issuetype':{'name':_0x37a235[_0x3f5e('0xb')]||_0x3f5e('0xc')}}};_0x4f3a24['fields'][_0x3f5e('0xd')]=_0x37a235[_0x3f5e('0xe')];_0x4f3a24['fields']['customfield_11501']=_0x37a235[_0x3f5e('0xf')];_0x4f3a24[_0x3f5e('0x10')][_0x3f5e('0x11')]=_0x37a235[_0x3f5e('0x12')];_0x4f3a24[_0x3f5e('0x10')][_0x3f5e('0x13')]=_0x37a235['name'];_0x4f3a24['fields'][_0x3f5e('0x14')]=_0x37a235[_0x3f5e('0x15')];_0x4f3a24[_0x3f5e('0x10')][_0x3f5e('0x16')]=_0x37a235['ip'];var _0x16e393={'host':_0x3f5e('0x17'),'port':0x1bb,'path':'/rest/api/2/issue','method':_0x3f5e('0x18'),'timeout':0x4e20,'headers':{'Content-Type':_0x3f5e('0x19'),'Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0x3f5e('0x1a')](_0x3f5e('0x1b'))}};var _0x119dcf=JSON[_0x3f5e('0x1c')](_0x4f3a24);var _0x201486=https['request'](_0x16e393,function(_0x4039b9){_0x4039b9[_0x3f5e('0x1d')](_0x3f5e('0x1e'));var _0x52ea6d='';_0x4039b9['on']('data',function(_0xc59265){_0x52ea6d+=_0xc59265;});_0x4039b9['on']('end',function(){if(_0x3b58f6){return _0x3b58f6['status'](_0x4039b9[_0x3f5e('0x1f')])['json'](JSON[_0x3f5e('0x20')](_0x52ea6d));}});});_0x201486['on']('error',function(_0x36fc94){if(_0x3b58f6){return _0x3b58f6[_0x3f5e('0x21')](0x1f4)[_0x3f5e('0x22')]({'errors':[{'message':_0x3f5e('0x23'),'type':_0x3f5e('0x24')}]});}});_0x201486[_0x3f5e('0x25')](_0x119dcf);_0x201486['end']();}exports[_0x3f5e('0x26')]=openIssue;exports[_0x3f5e('0x27')]=function(_0x3c000e,_0x1ae0dd){_0x3c000e[_0x3f5e('0x28')]['ip']=_0x3c000e[_0x3f5e('0x29')][_0x3f5e('0x2a')]||_0x3c000e[_0x3f5e('0x2b')][_0x3f5e('0x2c')]||_0x3c000e[_0x3f5e('0x2d')][_0x3f5e('0x2c')]||_0x3c000e['connection'][_0x3f5e('0x2d')]['remoteAddress'];return openIssue(_0x3c000e[_0x3f5e('0x28')],_0x1ae0dd);}; \ No newline at end of file +var _0x9409=['email','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','name','customfield_11504','reason','track.xcallymotion.com','POST','Basic\x20','toString','base64','utf8','data','end','status','json','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','body','headers','x-forwarded-for','connection','remoteAddress','socket','bluebird','https','../../config/logger','api','support','\x20from\x20','description','stringify','Bug','fields'];(function(_0x5c5a35,_0x2929fa){var _0x38e4e9=function(_0xc35078){while(--_0xc35078){_0x5c5a35['push'](_0x5c5a35['shift']());}};_0x38e4e9(++_0x2929fa);}(_0x9409,0x190));var _0x9940=function(_0x4c9cc4,_0x1b6528){_0x4c9cc4=_0x4c9cc4-0x0;var _0x4384fb=_0x9409[_0x4c9cc4];return _0x4384fb;};'use strict';var BPromise=require(_0x9940('0x0'));var https=require(_0x9940('0x1'));var logger=require(_0x9940('0x2'))(_0x9940('0x3'));var USERNAME=_0x9940('0x4');var PASSWORD='3eAmWpBVP0';function openIssue(_0x45ec9b,_0x524ec5){var _0x2c9284={'fields':{'project':{'key':_0x45ec9b['key']||'MOTGUI'},'summary':(_0x45ec9b['summary']||'Report')+_0x9940('0x5')+_0x45ec9b['ip'],'description':_0x45ec9b[_0x9940('0x6')]||JSON[_0x9940('0x7')](_0x45ec9b),'issuetype':{'name':_0x45ec9b['issuetype']||_0x9940('0x8')}}};_0x2c9284[_0x9940('0x9')]['customfield_11500']=_0x45ec9b[_0x9940('0xa')];_0x2c9284[_0x9940('0x9')][_0x9940('0xb')]=_0x45ec9b[_0x9940('0xc')];_0x2c9284[_0x9940('0x9')][_0x9940('0xd')]=_0x45ec9b[_0x9940('0xe')];_0x2c9284[_0x9940('0x9')][_0x9940('0xf')]=_0x45ec9b[_0x9940('0x10')];_0x2c9284[_0x9940('0x9')][_0x9940('0x11')]=_0x45ec9b[_0x9940('0x12')];_0x2c9284[_0x9940('0x9')]['customfield_10102']=_0x45ec9b['ip'];var _0x592f02={'host':_0x9940('0x13'),'port':0x1bb,'path':'/rest/api/2/issue','method':_0x9940('0x14'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':_0x9940('0x15')+new Buffer(USERNAME+':'+PASSWORD)[_0x9940('0x16')](_0x9940('0x17'))}};var _0x5b8118=JSON['stringify'](_0x2c9284);var _0x561c99=https['request'](_0x592f02,function(_0x4b8486){_0x4b8486['setEncoding'](_0x9940('0x18'));var _0x31a276='';_0x4b8486['on'](_0x9940('0x19'),function(_0x291a58){_0x31a276+=_0x291a58;});_0x4b8486['on'](_0x9940('0x1a'),function(){if(_0x524ec5){return _0x524ec5[_0x9940('0x1b')](_0x4b8486['statusCode'])[_0x9940('0x1c')](JSON['parse'](_0x31a276));}});});_0x561c99['on'](_0x9940('0x1d'),function(_0x4efd0c){if(_0x524ec5){return _0x524ec5[_0x9940('0x1b')](0x1f4)[_0x9940('0x1c')]({'errors':[{'message':_0x9940('0x1e'),'type':_0x9940('0x1f')}]});}});_0x561c99[_0x9940('0x20')](_0x5b8118);_0x561c99[_0x9940('0x1a')]();}exports[_0x9940('0x21')]=openIssue;exports[_0x9940('0x22')]=function(_0x2a6049,_0x465b1d){_0x2a6049[_0x9940('0x23')]['ip']=_0x2a6049[_0x9940('0x24')][_0x9940('0x25')]||_0x2a6049[_0x9940('0x26')][_0x9940('0x27')]||_0x2a6049[_0x9940('0x28')][_0x9940('0x27')]||_0x2a6049[_0x9940('0x26')][_0x9940('0x28')]['remoteAddress'];return openIssue(_0x2a6049[_0x9940('0x23')],_0x465b1d);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index d542d77..c5f1a59 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 _0x073e=['multer','util','path','connect-timeout','express','Router','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','index','/:id','show','post','create','delete'];(function(_0x4db020,_0x30ed94){var _0x3f314f=function(_0x3339b4){while(--_0x3339b4){_0x4db020['push'](_0x4db020['shift']());}};_0x3f314f(++_0x30ed94);}(_0x073e,0x110));var _0xe073=function(_0x2b2365,_0x4f072d){_0x2b2365=_0x2b2365-0x0;var _0x1941ad=_0x073e[_0x2b2365];return _0x1941ad;};'use strict';var multer=require(_0xe073('0x0'));var util=require(_0xe073('0x1'));var path=require(_0xe073('0x2'));var timeout=require(_0xe073('0x3'));var express=require(_0xe073('0x4'));var router=express[_0xe073('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe073('0x6'));var controller=require(_0xe073('0x7'));router[_0xe073('0x8')]('/',auth[_0xe073('0x9')](),controller[_0xe073('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0xe073('0xb'),auth[_0xe073('0x9')](),controller[_0xe073('0xc')]);router[_0xe073('0xd')]('/',auth[_0xe073('0x9')](),controller[_0xe073('0xe')]);router['put']('/:id',auth[_0xe073('0x9')](),controller['update']);router[_0xe073('0xf')](_0xe073('0xb'),auth[_0xe073('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x57c7=['post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','./jscriptyAnswerReport.controller','index','get','/describe','isAuthenticated','describe','/:id','show'];(function(_0x230e39,_0x5341){var _0xa804e=function(_0xe14796){while(--_0xe14796){_0x230e39['push'](_0x230e39['shift']());}};_0xa804e(++_0x5341);}(_0x57c7,0x1e6));var _0x757c=function(_0x3aac2a,_0x330433){_0x3aac2a=_0x3aac2a-0x0;var _0xa6b602=_0x57c7[_0x3aac2a];return _0xa6b602;};'use strict';var multer=require(_0x757c('0x0'));var util=require(_0x757c('0x1'));var path=require(_0x757c('0x2'));var timeout=require(_0x757c('0x3'));var express=require(_0x757c('0x4'));var router=express[_0x757c('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x757c('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x757c('0x7')]);router[_0x757c('0x8')](_0x757c('0x9'),auth[_0x757c('0xa')](),controller[_0x757c('0xb')]);router[_0x757c('0x8')](_0x757c('0xc'),auth[_0x757c('0xa')](),controller[_0x757c('0xd')]);router[_0x757c('0xe')]('/',auth[_0x757c('0xa')](),controller[_0x757c('0xf')]);router['put'](_0x757c('0xc'),auth[_0x757c('0xa')](),controller[_0x757c('0x10')]);router[_0x757c('0x11')](_0x757c('0xc'),auth[_0x757c('0xa')](),controller[_0x757c('0x12')]);module[_0x757c('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 cfad71a..0c62523 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 _0x36a9=['sequelize','exports','STRING','TEXT','long'];(function(_0x5275b8,_0x51e5dd){var _0x568a9b=function(_0x583a71){while(--_0x583a71){_0x5275b8['push'](_0x5275b8['shift']());}};_0x568a9b(++_0x51e5dd);}(_0x36a9,0xdc));var _0x936a=function(_0x9797f5,_0x3df1c0){_0x9797f5=_0x9797f5-0x0;var _0x5625d8=_0x36a9[_0x9797f5];return _0x5625d8;};'use strict';var Sequelize=require(_0x936a('0x0'));module[_0x936a('0x1')]={'question':{'type':Sequelize[_0x936a('0x2')]},'answer':{'type':Sequelize[_0x936a('0x3')](_0x936a('0x4'))},'membername':{'type':Sequelize[_0x936a('0x2')]},'projectname':{'type':Sequelize[_0x936a('0x2')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x936a('0x2')]},'calleridnum':{'type':Sequelize[_0x936a('0x2')]},'questionId':{'type':Sequelize[_0x936a('0x2')]}}; \ No newline at end of file +var _0x2767=['STRING','sequelize','long'];(function(_0x35fe5b,_0x108cce){var _0x130d51=function(_0x5355a2){while(--_0x5355a2){_0x35fe5b['push'](_0x35fe5b['shift']());}};_0x130d51(++_0x108cce);}(_0x2767,0xf1));var _0x7276=function(_0x490d49,_0x36173a){_0x490d49=_0x490d49-0x0;var _0x28f6be=_0x2767[_0x490d49];return _0x28f6be;};'use strict';var Sequelize=require(_0x7276('0x0'));module['exports']={'question':{'type':Sequelize['STRING']},'answer':{'type':Sequelize['TEXT'](_0x7276('0x1'))},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0x7276('0x2')]},'queue':{'type':Sequelize[_0x7276('0x2')]},'uniqueid':{'type':Sequelize[_0x7276('0x2')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x7276('0x2')]},'questionId':{'type':Sequelize[_0x7276('0x2')]}}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js index 475320f..7f0d95b 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 _0xbdea=['hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','field','options','JscriptyAnswerReport','include','findAll','catch','show','params','intersection','fields','length','includeAll','find','create','body','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','then','stack','name','send','index','rawAttributes','fieldName','type','key','map','keys','query','filters','model','attributes'];(function(_0x15786f,_0x1d9b84){var _0xca3080=function(_0x41ebb0){while(--_0x41ebb0){_0x15786f['push'](_0x15786f['shift']());}};_0xca3080(++_0x1d9b84);}(_0xbdea,0x139));var _0xabde=function(_0x272d8a,_0x45184b){_0x272d8a=_0x272d8a-0x0;var _0x26286e=_0xbdea[_0x272d8a];return _0x26286e;};'use strict';var pdf=require(_0xabde('0x0'));var emlformat=require(_0xabde('0x1'));var rimraf=require(_0xabde('0x2'));var zipdir=require(_0xabde('0x3'));var jsonpatch=require(_0xabde('0x4'));var rp=require(_0xabde('0x5'));var moment=require(_0xabde('0x6'));var BPromise=require(_0xabde('0x7'));var Mustache=require('mustache');var util=require(_0xabde('0x8'));var path=require(_0xabde('0x9'));var sox=require(_0xabde('0xa'));var csv=require(_0xabde('0xb'));var ejs=require(_0xabde('0xc'));var fs=require('fs');var _=require(_0xabde('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xabde('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xabde('0xf'));var Redis=require(_0xabde('0x10'));var authService=require(_0xabde('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xabde('0x12'));var logger=require(_0xabde('0x13'))(_0xabde('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x352974,_0x478840){_0x478840=_0x478840||0xcc;return function(_0x1ddb98){if(_0x1ddb98){return _0x352974[_0xabde('0x15')](_0x478840);}return _0x352974[_0xabde('0x16')](_0x478840)[_0xabde('0x17')]();};}function respondWithResult(_0x59cd12,_0x449cb6){_0x449cb6=_0x449cb6||0xc8;return function(_0x82ec73){if(_0x82ec73){return _0x59cd12[_0xabde('0x16')](_0x449cb6)[_0xabde('0x18')](_0x82ec73);}};}function respondWithFilteredResult(_0x4b7f09,_0x1f52f8){return function(_0x17788c){if(_0x17788c){var _0xa41071=_0x17788c[_0xabde('0x19')],_0x5f185d=_0x1f52f8[_0xabde('0x1a')],_0xade94c=_0x1f52f8[_0xabde('0x1a')]+_0x1f52f8[_0xabde('0x1b')],_0x2842f8;if(_0xade94c>=_0xa41071){_0xade94c=_0xa41071;_0x2842f8=0xc8;}else{_0x2842f8=0xce;}_0x4b7f09['status'](_0x2842f8);return _0x4b7f09[_0xabde('0x1c')](_0xabde('0x1d'),_0x5f185d+'-'+_0xade94c+'/'+_0xa41071)[_0xabde('0x18')](_0x17788c);}return null;};}function patchUpdates(_0x4ba42b){return function(_0x491909){try{jsonpatch['apply'](_0x491909,_0x4ba42b,!![]);}catch(_0x1f7866){return BPromise[_0xabde('0x1e')](_0x1f7866);}return _0x491909[_0xabde('0x1f')]();};}function saveUpdates(_0x1f9d55,_0xc8d642){return function(_0x2a45b2){if(_0x2a45b2){return _0x2a45b2['update'](_0x1f9d55)['then'](function(_0x5f48d6){return _0x5f48d6;});}return null;};}function removeEntity(_0x37b74a,_0x5943ca){return function(_0x16fb69){if(_0x16fb69){return _0x16fb69['destroy']()[_0xabde('0x20')](function(){_0x37b74a[_0xabde('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x34ec83,_0x112eff){return function(_0x861ade){if(!_0x861ade){_0x34ec83[_0xabde('0x15')](0x194);}return _0x861ade;};}function handleError(_0x369e09,_0x398390){_0x398390=_0x398390||0x1f4;return function(_0x4943f8){logger['error'](_0x4943f8[_0xabde('0x21')]);if(_0x4943f8['name']){delete _0x4943f8[_0xabde('0x22')];}_0x369e09[_0xabde('0x16')](_0x398390)[_0xabde('0x23')](_0x4943f8);};}exports[_0xabde('0x24')]=function(_0x11912c,_0x262ffc){var _0xcf02ef={},_0x12ffb3={},_0xbfa87f={'count':0x0,'rows':[]};var _0x5f2a06=_['map'](db['JscriptyAnswerReport'][_0xabde('0x25')],function(_0x128826){return{'name':_0x128826[_0xabde('0x26')],'type':_0x128826[_0xabde('0x27')][_0xabde('0x28')]};});_0x12ffb3['model']=_[_0xabde('0x29')](_0x5f2a06,'name');_0x12ffb3['query']=_[_0xabde('0x2a')](_0x11912c[_0xabde('0x2b')]);_0x12ffb3[_0xabde('0x2c')]=_['intersection'](_0x12ffb3[_0xabde('0x2d')],_0x12ffb3[_0xabde('0x2b')]);_0xcf02ef[_0xabde('0x2e')]=_['intersection'](_0x12ffb3[_0xabde('0x2d')],qs['fields'](_0x11912c[_0xabde('0x2b')]['fields']));_0xcf02ef[_0xabde('0x2e')]=_0xcf02ef[_0xabde('0x2e')]['length']?_0xcf02ef[_0xabde('0x2e')]:_0x12ffb3['model'];if(!_0x11912c['query'][_0xabde('0x2f')](_0xabde('0x30'))){_0xcf02ef[_0xabde('0x1b')]=qs['limit'](_0x11912c[_0xabde('0x2b')][_0xabde('0x1b')]);_0xcf02ef['offset']=qs[_0xabde('0x1a')](_0x11912c[_0xabde('0x2b')][_0xabde('0x1a')]);}_0xcf02ef[_0xabde('0x31')]=qs[_0xabde('0x32')](_0x11912c[_0xabde('0x2b')][_0xabde('0x32')]);_0xcf02ef[_0xabde('0x33')]=qs[_0xabde('0x2c')](_[_0xabde('0x34')](_0x11912c['query'],_0x12ffb3[_0xabde('0x2c')]));if(_0x11912c[_0xabde('0x2b')]['filter']){_0xcf02ef['where']=_[_0xabde('0x35')](_0xcf02ef[_0xabde('0x33')],{'$or':_[_0xabde('0x29')](_0x5f2a06,function(_0x3c2d92){if(_0x3c2d92['type'][_0xabde('0x28')]!==_0xabde('0x36')){var _0x25fe2b={};_0x25fe2b[_0x3c2d92[_0xabde('0x37')]]={'$like':'%'+_0x11912c[_0xabde('0x2b')]['filter']+'%'};return _0x25fe2b;}})});}_0xcf02ef=_['merge']({},_0xcf02ef,_0x11912c[_0xabde('0x38')]);var _0x1d5815={'where':_0xcf02ef[_0xabde('0x33')]};return db[_0xabde('0x39')][_0xabde('0x19')](_0x1d5815)[_0xabde('0x20')](function(_0x27a43e){_0xbfa87f[_0xabde('0x19')]=_0x27a43e;if(_0x11912c[_0xabde('0x2b')]['includeAll']){_0xcf02ef[_0xabde('0x3a')]=[{'all':!![]}];}return db[_0xabde('0x39')][_0xabde('0x3b')](_0xcf02ef);})[_0xabde('0x20')](function(_0x5bab5a){_0xbfa87f['rows']=_0x5bab5a;return _0xbfa87f;})[_0xabde('0x20')](respondWithFilteredResult(_0x262ffc,_0xcf02ef))[_0xabde('0x3c')](handleError(_0x262ffc,null));};exports[_0xabde('0x3d')]=function(_0x582df6,_0x3933bc){var _0x5199c6={'raw':!![],'where':{'id':_0x582df6[_0xabde('0x3e')]['id']}},_0x1b8275={};_0x1b8275[_0xabde('0x2d')]=_[_0xabde('0x2a')](db['JscriptyAnswerReport'][_0xabde('0x25')]);_0x1b8275['query']=_[_0xabde('0x2a')](_0x582df6[_0xabde('0x2b')]);_0x1b8275[_0xabde('0x2c')]=_[_0xabde('0x3f')](_0x1b8275[_0xabde('0x2d')],_0x1b8275[_0xabde('0x2b')]);_0x5199c6[_0xabde('0x2e')]=_[_0xabde('0x3f')](_0x1b8275[_0xabde('0x2d')],qs[_0xabde('0x40')](_0x582df6[_0xabde('0x2b')][_0xabde('0x40')]));_0x5199c6[_0xabde('0x2e')]=_0x5199c6['attributes'][_0xabde('0x41')]?_0x5199c6[_0xabde('0x2e')]:_0x1b8275[_0xabde('0x2d')];if(_0x582df6[_0xabde('0x2b')][_0xabde('0x42')]){_0x5199c6[_0xabde('0x3a')]=[{'all':!![]}];}_0x5199c6=_[_0xabde('0x35')]({},_0x5199c6,_0x582df6['options']);return db[_0xabde('0x39')][_0xabde('0x43')](_0x5199c6)['then'](handleEntityNotFound(_0x3933bc,null))['then'](respondWithResult(_0x3933bc,null))['catch'](handleError(_0x3933bc,null));};exports[_0xabde('0x44')]=function(_0x5b3be4,_0x4136bd){return db[_0xabde('0x39')][_0xabde('0x44')](_0x5b3be4[_0xabde('0x45')],{})[_0xabde('0x20')](respondWithResult(_0x4136bd,0xc9))[_0xabde('0x3c')](handleError(_0x4136bd,null));};exports['update']=function(_0x431121,_0x440bd3){if(_0x431121[_0xabde('0x45')]['id']){delete _0x431121[_0xabde('0x45')]['id'];}return db[_0xabde('0x39')][_0xabde('0x43')]({'where':{'id':_0x431121[_0xabde('0x3e')]['id']}})[_0xabde('0x20')](handleEntityNotFound(_0x440bd3,null))[_0xabde('0x20')](saveUpdates(_0x431121[_0xabde('0x45')],null))[_0xabde('0x20')](respondWithResult(_0x440bd3,null))[_0xabde('0x3c')](handleError(_0x440bd3,null));};exports[_0xabde('0x46')]=function(_0x11a80c,_0xa83bdd){return db[_0xabde('0x39')][_0xabde('0x43')]({'where':{'id':_0x11a80c['params']['id']}})[_0xabde('0x20')](handleEntityNotFound(_0xa83bdd,null))[_0xabde('0x20')](removeEntity(_0xa83bdd,null))[_0xabde('0x3c')](handleError(_0xa83bdd,null));};exports[_0xabde('0x47')]=function(_0x481827,_0x202e3c){return db[_0xabde('0x39')][_0xabde('0x47')]()[_0xabde('0x20')](respondWithResult(_0x202e3c,null))[_0xabde('0x3c')](handleError(_0x202e3c,null));}; \ No newline at end of file +var _0x07fd=['query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','field','options','JscriptyAnswerReport','findAll','rows','catch','show','params','intersection','includeAll','include','create','update','body','find','describe','html-pdf','rimraf','request-promise','moment','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','count','offset','limit','set','Content-Range','apply','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys'];(function(_0x5e8897,_0x3bc63d){var _0x16a588=function(_0x494da6){while(--_0x494da6){_0x5e8897['push'](_0x5e8897['shift']());}};_0x16a588(++_0x3bc63d);}(_0x07fd,0x19f));var _0xd07f=function(_0x4478b3,_0x3fb886){_0x4478b3=_0x4478b3-0x0;var _0x58d699=_0x07fd[_0x4478b3];return _0x58d699;};'use strict';var pdf=require(_0xd07f('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xd07f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd07f('0x2'));var moment=require(_0xd07f('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xd07f('0x4'));var sox=require(_0xd07f('0x5'));var csv=require(_0xd07f('0x6'));var ejs=require(_0xd07f('0x7'));var fs=require('fs');var _=require(_0xd07f('0x8'));var squel=require(_0xd07f('0x9'));var crypto=require(_0xd07f('0xa'));var jsforce=require(_0xd07f('0xb'));var deskjs=require(_0xd07f('0xc'));var toCsv=require(_0xd07f('0x6'));var querystring=require(_0xd07f('0xd'));var Papa=require(_0xd07f('0xe'));var Redis=require(_0xd07f('0xf'));var authService=require(_0xd07f('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xd07f('0x11'));var hardwareService=require(_0xd07f('0x12'));var logger=require(_0xd07f('0x13'))(_0xd07f('0x14'));var utils=require(_0xd07f('0x15'));var config=require(_0xd07f('0x16'));var db=require(_0xd07f('0x17'))['db'];function respondWithStatusCode(_0x51aaba,_0x341746){_0x341746=_0x341746||0xcc;return function(_0x59705a){if(_0x59705a){return _0x51aaba[_0xd07f('0x18')](_0x341746);}return _0x51aaba['status'](_0x341746)[_0xd07f('0x19')]();};}function respondWithResult(_0x5b96cc,_0x42244c){_0x42244c=_0x42244c||0xc8;return function(_0x10942d){if(_0x10942d){return _0x5b96cc[_0xd07f('0x1a')](_0x42244c)['json'](_0x10942d);}};}function respondWithFilteredResult(_0x3e65fc,_0xe4ec78){return function(_0x4953af){if(_0x4953af){var _0x3f498c=_0x4953af[_0xd07f('0x1b')],_0x3f3928=_0xe4ec78[_0xd07f('0x1c')],_0xa10cda=_0xe4ec78[_0xd07f('0x1c')]+_0xe4ec78[_0xd07f('0x1d')],_0x31788b;if(_0xa10cda>=_0x3f498c){_0xa10cda=_0x3f498c;_0x31788b=0xc8;}else{_0x31788b=0xce;}_0x3e65fc[_0xd07f('0x1a')](_0x31788b);return _0x3e65fc[_0xd07f('0x1e')](_0xd07f('0x1f'),_0x3f3928+'-'+_0xa10cda+'/'+_0x3f498c)['json'](_0x4953af);}return null;};}function patchUpdates(_0x47681d){return function(_0x32ba34){try{jsonpatch[_0xd07f('0x20')](_0x32ba34,_0x47681d,!![]);}catch(_0x474833){return BPromise['reject'](_0x474833);}return _0x32ba34['save']();};}function saveUpdates(_0x37af3f,_0x5a7c50){return function(_0x32c30d){if(_0x32c30d){return _0x32c30d['update'](_0x37af3f)[_0xd07f('0x21')](function(_0x3b4fcf){return _0x3b4fcf;});}return null;};}function removeEntity(_0x1a9258,_0x3bbbc2){return function(_0x1d07d7){if(_0x1d07d7){return _0x1d07d7[_0xd07f('0x22')]()[_0xd07f('0x21')](function(){_0x1a9258[_0xd07f('0x1a')](0xcc)[_0xd07f('0x19')]();});}};}function handleEntityNotFound(_0x28b0c4,_0xa9611b){return function(_0x42b47c){if(!_0x42b47c){_0x28b0c4['sendStatus'](0x194);}return _0x42b47c;};}function handleError(_0x5a18da,_0x547687){_0x547687=_0x547687||0x1f4;return function(_0x12a3eb){logger[_0xd07f('0x23')](_0x12a3eb[_0xd07f('0x24')]);if(_0x12a3eb[_0xd07f('0x25')]){delete _0x12a3eb[_0xd07f('0x25')];}_0x5a18da[_0xd07f('0x1a')](_0x547687)[_0xd07f('0x26')](_0x12a3eb);};}exports[_0xd07f('0x27')]=function(_0x3730eb,_0x5561d1){var _0xf37411={},_0xdb55d4={},_0x373cc8={'count':0x0,'rows':[]};var _0x46a457=_[_0xd07f('0x28')](db['JscriptyAnswerReport'][_0xd07f('0x29')],function(_0xd2e14b){return{'name':_0xd2e14b[_0xd07f('0x2a')],'type':_0xd2e14b[_0xd07f('0x2b')][_0xd07f('0x2c')]};});_0xdb55d4[_0xd07f('0x2d')]=_['map'](_0x46a457,'name');_0xdb55d4['query']=_[_0xd07f('0x2e')](_0x3730eb[_0xd07f('0x2f')]);_0xdb55d4[_0xd07f('0x30')]=_['intersection'](_0xdb55d4[_0xd07f('0x2d')],_0xdb55d4['query']);_0xf37411[_0xd07f('0x31')]=_['intersection'](_0xdb55d4[_0xd07f('0x2d')],qs['fields'](_0x3730eb[_0xd07f('0x2f')][_0xd07f('0x32')]));_0xf37411[_0xd07f('0x31')]=_0xf37411[_0xd07f('0x31')][_0xd07f('0x33')]?_0xf37411[_0xd07f('0x31')]:_0xdb55d4['model'];if(!_0x3730eb[_0xd07f('0x2f')][_0xd07f('0x34')](_0xd07f('0x35'))){_0xf37411[_0xd07f('0x1d')]=qs[_0xd07f('0x1d')](_0x3730eb[_0xd07f('0x2f')]['limit']);_0xf37411[_0xd07f('0x1c')]=qs['offset'](_0x3730eb[_0xd07f('0x2f')][_0xd07f('0x1c')]);}_0xf37411[_0xd07f('0x36')]=qs[_0xd07f('0x37')](_0x3730eb[_0xd07f('0x2f')][_0xd07f('0x37')]);_0xf37411[_0xd07f('0x38')]=qs[_0xd07f('0x30')](_[_0xd07f('0x39')](_0x3730eb[_0xd07f('0x2f')],_0xdb55d4['filters']));if(_0x3730eb[_0xd07f('0x2f')][_0xd07f('0x3a')]){_0xf37411['where']=_[_0xd07f('0x3b')](_0xf37411[_0xd07f('0x38')],{'$or':_['map'](_0x46a457,function(_0x200d34){if(_0x200d34[_0xd07f('0x2b')][_0xd07f('0x2c')]!==_0xd07f('0x3c')){var _0x551803={};_0x551803[_0x200d34[_0xd07f('0x3d')]]={'$like':'%'+_0x3730eb[_0xd07f('0x2f')]['filter']+'%'};return _0x551803;}})});}_0xf37411=_['merge']({},_0xf37411,_0x3730eb[_0xd07f('0x3e')]);var _0xb1d6b1={'where':_0xf37411['where']};return db[_0xd07f('0x3f')][_0xd07f('0x1b')](_0xb1d6b1)[_0xd07f('0x21')](function(_0x256269){_0x373cc8[_0xd07f('0x1b')]=_0x256269;if(_0x3730eb[_0xd07f('0x2f')]['includeAll']){_0xf37411['include']=[{'all':!![]}];}return db[_0xd07f('0x3f')][_0xd07f('0x40')](_0xf37411);})[_0xd07f('0x21')](function(_0xa3a75b){_0x373cc8[_0xd07f('0x41')]=_0xa3a75b;return _0x373cc8;})[_0xd07f('0x21')](respondWithFilteredResult(_0x5561d1,_0xf37411))[_0xd07f('0x42')](handleError(_0x5561d1,null));};exports[_0xd07f('0x43')]=function(_0x59f66e,_0x5774eb){var _0x533475={'raw':!![],'where':{'id':_0x59f66e[_0xd07f('0x44')]['id']}},_0x26e582={};_0x26e582[_0xd07f('0x2d')]=_['keys'](db[_0xd07f('0x3f')][_0xd07f('0x29')]);_0x26e582[_0xd07f('0x2f')]=_[_0xd07f('0x2e')](_0x59f66e[_0xd07f('0x2f')]);_0x26e582[_0xd07f('0x30')]=_[_0xd07f('0x45')](_0x26e582['model'],_0x26e582[_0xd07f('0x2f')]);_0x533475['attributes']=_[_0xd07f('0x45')](_0x26e582[_0xd07f('0x2d')],qs[_0xd07f('0x32')](_0x59f66e[_0xd07f('0x2f')]['fields']));_0x533475['attributes']=_0x533475[_0xd07f('0x31')][_0xd07f('0x33')]?_0x533475[_0xd07f('0x31')]:_0x26e582['model'];if(_0x59f66e['query'][_0xd07f('0x46')]){_0x533475[_0xd07f('0x47')]=[{'all':!![]}];}_0x533475=_[_0xd07f('0x3b')]({},_0x533475,_0x59f66e[_0xd07f('0x3e')]);return db[_0xd07f('0x3f')]['find'](_0x533475)[_0xd07f('0x21')](handleEntityNotFound(_0x5774eb,null))['then'](respondWithResult(_0x5774eb,null))['catch'](handleError(_0x5774eb,null));};exports[_0xd07f('0x48')]=function(_0x113bb4,_0x2eff0e){return db['JscriptyAnswerReport'][_0xd07f('0x48')](_0x113bb4['body'],{})[_0xd07f('0x21')](respondWithResult(_0x2eff0e,0xc9))['catch'](handleError(_0x2eff0e,null));};exports[_0xd07f('0x49')]=function(_0x5b434c,_0x5cdf38){if(_0x5b434c[_0xd07f('0x4a')]['id']){delete _0x5b434c[_0xd07f('0x4a')]['id'];}return db[_0xd07f('0x3f')]['find']({'where':{'id':_0x5b434c[_0xd07f('0x44')]['id']}})[_0xd07f('0x21')](handleEntityNotFound(_0x5cdf38,null))[_0xd07f('0x21')](saveUpdates(_0x5b434c[_0xd07f('0x4a')],null))['then'](respondWithResult(_0x5cdf38,null))['catch'](handleError(_0x5cdf38,null));};exports['destroy']=function(_0x4cf726,_0x159538){return db[_0xd07f('0x3f')][_0xd07f('0x4b')]({'where':{'id':_0x4cf726[_0xd07f('0x44')]['id']}})[_0xd07f('0x21')](handleEntityNotFound(_0x159538,null))[_0xd07f('0x21')](removeEntity(_0x159538,null))[_0xd07f('0x42')](handleError(_0x159538,null));};exports[_0xd07f('0x4c')]=function(_0x40a7c4,_0x1fed3c){return db[_0xd07f('0x3f')][_0xd07f('0x4c')]()[_0xd07f('0x21')](respondWithResult(_0x1fed3c,null))[_0xd07f('0x42')](handleError(_0x1fed3c,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index dd088ca..0bbc872 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 _0x94ed=['JscriptyAnswerReport','lodash','util','../../config/logger','moment','bluebird','../../config/environment','./jscriptyAnswerReport.attributes','define'];(function(_0x11dc16,_0x5d8e9d){var _0x46c7fb=function(_0x164379){while(--_0x164379){_0x11dc16['push'](_0x11dc16['shift']());}};_0x46c7fb(++_0x5d8e9d);}(_0x94ed,0x145));var _0xd94e=function(_0x4e94b2,_0x4e0528){_0x4e94b2=_0x4e94b2-0x0;var _0x560fb4=_0x94ed[_0x4e94b2];return _0x560fb4;};'use strict';var _=require(_0xd94e('0x0'));var util=require(_0xd94e('0x1'));var logger=require(_0xd94e('0x2'))('api');var moment=require(_0xd94e('0x3'));var BPromise=require(_0xd94e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd94e('0x5'));var attributes=require(_0xd94e('0x6'));module['exports']=function(_0x4880b0,_0x414bcd){return _0x4880b0[_0xd94e('0x7')](_0xd94e('0x8'),attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x406a=['path','../../config/environment','exports','define','JscriptyAnswerReport','report_jscripty_answers','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x413aac,_0x5e2430){var _0x569b11=function(_0x52e060){while(--_0x52e060){_0x413aac['push'](_0x413aac['shift']());}};_0x569b11(++_0x5e2430);}(_0x406a,0x1c2));var _0xa406=function(_0x5d860f,_0x467498){_0x5d860f=_0x5d860f-0x0;var _0x236490=_0x406a[_0x5d860f];return _0x236490;};'use strict';var _=require(_0xa406('0x0'));var util=require(_0xa406('0x1'));var logger=require(_0xa406('0x2'))(_0xa406('0x3'));var moment=require(_0xa406('0x4'));var BPromise=require('bluebird');var rp=require(_0xa406('0x5'));var fs=require('fs');var path=require(_0xa406('0x6'));var rimraf=require('rimraf');var config=require(_0xa406('0x7'));var attributes=require('./jscriptyAnswerReport.attributes');module[_0xa406('0x8')]=function(_0x4ea11c,_0x4c88b4){return _0x4ea11c[_0xa406('0x9')](_0xa406('0xa'),attributes,{'tableName':_0xa406('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 0192fdf..73d5644 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 _0x1915=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','moment'];(function(_0x496738,_0x3f1a9f){var _0xee1381=function(_0x4dc50c){while(--_0x4dc50c){_0x496738['push'](_0x496738['shift']());}};_0xee1381(++_0x3f1a9f);}(_0x1915,0x18a));var _0x5191=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x1915[_0x19950b];return _0x3c6b41;};'use strict';var _=require('lodash');var util=require(_0x5191('0x0'));var moment=require(_0x5191('0x1'));var BPromise=require('bluebird');var rs=require(_0x5191('0x2'));var fs=require('fs');var Redis=require(_0x5191('0x3'));var db=require(_0x5191('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5191('0x5'))(_0x5191('0x6'));var config=require(_0x5191('0x7'));var jayson=require(_0x5191('0x8'));var client=jayson['client'][_0x5191('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36c483,_0x52cc02,_0x2745c1){return new BPromise(function(_0x4a617e,_0x8801c8){return client[_0x5191('0xa')](_0x36c483,_0x2745c1)[_0x5191('0xb')](function(_0x59091d){logger[_0x5191('0xc')](_0x5191('0xd'),_0x52cc02,_0x5191('0xe'));logger[_0x5191('0xf')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x52cc02,_0x5191('0xe'),JSON[_0x5191('0x10')](_0x59091d));if(_0x59091d['error']){if(_0x59091d[_0x5191('0x11')][_0x5191('0x12')]===0x1f4){logger['error'](_0x5191('0xd'),_0x52cc02,_0x59091d['error'][_0x5191('0x13')]);return _0x8801c8(_0x59091d[_0x5191('0x11')][_0x5191('0x13')]);}logger[_0x5191('0x11')](_0x5191('0xd'),_0x52cc02,_0x59091d[_0x5191('0x11')][_0x5191('0x13')]);return _0x4a617e(_0x59091d[_0x5191('0x11')]['message']);}else{logger[_0x5191('0xc')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x52cc02,_0x5191('0xe'));_0x4a617e(_0x59091d[_0x5191('0x14')][_0x5191('0x13')]);}})[_0x5191('0x15')](function(_0x30f951){logger['error'](_0x5191('0xd'),_0x52cc02,_0x30f951);_0x8801c8(_0x30f951);});});} \ No newline at end of file +var _0xde21=['stringify','error','JscriptyAnswerReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','info','debug','request\x20sent'];(function(_0x2a7d02,_0x136e24){var _0x3cd79d=function(_0x1b2722){while(--_0x1b2722){_0x2a7d02['push'](_0x2a7d02['shift']());}};_0x3cd79d(++_0x136e24);}(_0xde21,0x180));var _0x1de2=function(_0xb98a64,_0x4c5fab){_0xb98a64=_0xb98a64-0x0;var _0x411ce1=_0xde21[_0xb98a64];return _0x411ce1;};'use strict';var _=require(_0x1de2('0x0'));var util=require(_0x1de2('0x1'));var moment=require(_0x1de2('0x2'));var BPromise=require(_0x1de2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1de2('0x4'));var db=require(_0x1de2('0x5'))['db'];var utils=require(_0x1de2('0x6'));var logger=require(_0x1de2('0x7'))(_0x1de2('0x8'));var config=require('../../config/environment');var jayson=require(_0x1de2('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3255e1,_0x39f9a3,_0x427266){return new BPromise(function(_0x3bc9e7,_0x2ee495){return client[_0x1de2('0xa')](_0x3255e1,_0x427266)[_0x1de2('0xb')](function(_0x219045){logger[_0x1de2('0xc')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x39f9a3,'request\x20sent');logger[_0x1de2('0xd')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x39f9a3,_0x1de2('0xe'),JSON[_0x1de2('0xf')](_0x219045));if(_0x219045[_0x1de2('0x10')]){if(_0x219045[_0x1de2('0x10')]['code']===0x1f4){logger['error'](_0x1de2('0x11'),_0x39f9a3,_0x219045['error'][_0x1de2('0x12')]);return _0x2ee495(_0x219045[_0x1de2('0x10')][_0x1de2('0x12')]);}logger[_0x1de2('0x10')](_0x1de2('0x11'),_0x39f9a3,_0x219045['error'][_0x1de2('0x12')]);return _0x3bc9e7(_0x219045[_0x1de2('0x10')][_0x1de2('0x12')]);}else{logger[_0x1de2('0xc')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x39f9a3,_0x1de2('0xe'));_0x3bc9e7(_0x219045[_0x1de2('0x13')][_0x1de2('0x12')]);}})[_0x1de2('0x14')](function(_0x2f2c19){logger[_0x1de2('0x10')](_0x1de2('0x11'),_0x39f9a3,_0x2f2c19);_0x2ee495(_0x2f2c19);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 94e37cd..0d631a8 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 _0x3e6d=['create','/:id/clone','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./jscriptyProject.controller','get','isAuthenticated','index','show','/:id/sessions','getSessions','getAnswers','getSummary','post'];(function(_0x24c097,_0x154c36){var _0x3d4a64=function(_0x505d90){while(--_0x505d90){_0x24c097['push'](_0x24c097['shift']());}};_0x3d4a64(++_0x154c36);}(_0x3e6d,0x1a0));var _0xd3e6=function(_0x475892,_0x4277f5){_0x475892=_0x475892-0x0;var _0x4862d3=_0x3e6d[_0x475892];return _0x4862d3;};'use strict';var multer=require('multer');var util=require(_0xd3e6('0x0'));var path=require(_0xd3e6('0x1'));var timeout=require(_0xd3e6('0x2'));var express=require('express');var router=express[_0xd3e6('0x3')]();var auth=require(_0xd3e6('0x4'));var interaction=require(_0xd3e6('0x5'));var config=require('../../config/environment');var controller=require(_0xd3e6('0x6'));router[_0xd3e6('0x7')]('/',auth[_0xd3e6('0x8')](),controller[_0xd3e6('0x9')]);router[_0xd3e6('0x7')]('/:id',auth[_0xd3e6('0x8')](),controller[_0xd3e6('0xa')]);router[_0xd3e6('0x7')](_0xd3e6('0xb'),auth['isAuthenticated'](),controller[_0xd3e6('0xc')]);router[_0xd3e6('0x7')]('/:id/answers',auth[_0xd3e6('0x8')](),controller[_0xd3e6('0xd')]);router['get']('/:id/summary',auth[_0xd3e6('0x8')](),timeout('30s'),controller[_0xd3e6('0xe')]);router[_0xd3e6('0xf')]('/',auth[_0xd3e6('0x8')](),controller[_0xd3e6('0x10')]);router[_0xd3e6('0xf')](_0xd3e6('0x11'),auth[_0xd3e6('0x8')](),controller['clone']);router[_0xd3e6('0x12')](_0xd3e6('0x13'),auth[_0xd3e6('0x8')](),controller[_0xd3e6('0x14')]);router[_0xd3e6('0x15')](_0xd3e6('0x13'),auth[_0xd3e6('0x8')](),controller[_0xd3e6('0x16')]);module[_0xd3e6('0x17')]=router; \ No newline at end of file +var _0xd6a0=['show','/:id/sessions','/:id/summary','30s','getSummary','post','create','/:id/clone','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','./jscriptyProject.controller','get','isAuthenticated','index','/:id'];(function(_0x43f5c7,_0x118763){var _0x46be5f=function(_0x1a43f2){while(--_0x1a43f2){_0x43f5c7['push'](_0x43f5c7['shift']());}};_0x46be5f(++_0x118763);}(_0xd6a0,0x15d));var _0x0d6a=function(_0x449549,_0x4c3447){_0x449549=_0x449549-0x0;var _0x13c026=_0xd6a0[_0x449549];return _0x13c026;};'use strict';var multer=require(_0x0d6a('0x0'));var util=require(_0x0d6a('0x1'));var path=require('path');var timeout=require(_0x0d6a('0x2'));var express=require(_0x0d6a('0x3'));var router=express[_0x0d6a('0x4')]();var auth=require(_0x0d6a('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0d6a('0x6'));router[_0x0d6a('0x7')]('/',auth[_0x0d6a('0x8')](),controller[_0x0d6a('0x9')]);router['get'](_0x0d6a('0xa'),auth[_0x0d6a('0x8')](),controller[_0x0d6a('0xb')]);router[_0x0d6a('0x7')](_0x0d6a('0xc'),auth[_0x0d6a('0x8')](),controller['getSessions']);router[_0x0d6a('0x7')]('/:id/answers',auth[_0x0d6a('0x8')](),controller['getAnswers']);router['get'](_0x0d6a('0xd'),auth[_0x0d6a('0x8')](),timeout(_0x0d6a('0xe')),controller[_0x0d6a('0xf')]);router[_0x0d6a('0x10')]('/',auth['isAuthenticated'](),controller[_0x0d6a('0x11')]);router[_0x0d6a('0x10')](_0x0d6a('0x12'),auth['isAuthenticated'](),controller['clone']);router[_0x0d6a('0x13')](_0x0d6a('0xa'),auth[_0x0d6a('0x8')](),controller[_0x0d6a('0x14')]);router[_0x0d6a('0x15')](_0x0d6a('0xa'),auth[_0x0d6a('0x8')](),controller[_0x0d6a('0x16')]);module[_0x0d6a('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 2594aa5..9a282a2 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 _0xff19=['STRING','TEXT','isObjectLike','setDataValue','stringify','isString','formData','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','name','description','lodash','util'];(function(_0x4bed75,_0x211cc7){var _0x2dd8e8=function(_0x6369c7){while(--_0x6369c7){_0x4bed75['push'](_0x4bed75['shift']());}};_0x2dd8e8(++_0x211cc7);}(_0xff19,0x14e));var _0x9ff1=function(_0x2695f9,_0x17213a){_0x2695f9=_0x2695f9-0x0;var _0x4deb38=_0xff19[_0x2695f9];return _0x4deb38;};'use strict';var Sequelize=require('sequelize');var _=require(_0x9ff1('0x0'));var util=require(_0x9ff1('0x1'));module['exports']={'name':{'type':Sequelize[_0x9ff1('0x2')],'unique':'name'},'description':{'type':Sequelize[_0x9ff1('0x2')]},'formData':{'type':Sequelize[_0x9ff1('0x3')]('long'),'set':function(_0x31a8e6){if(_[_0x9ff1('0x4')](_0x31a8e6)){this[_0x9ff1('0x5')]('formData',JSON[_0x9ff1('0x6')](_0x31a8e6));}else if(_[_0x9ff1('0x7')](_0x31a8e6)){this[_0x9ff1('0x5')](_0x9ff1('0x8'),_0x31a8e6);}else{this[_0x9ff1('0x5')](_0x9ff1('0x8'),util[_0x9ff1('0x9')](_0x9ff1('0xa'),this[_0x9ff1('0xb')](_0x9ff1('0xc'))||'',this[_0x9ff1('0xb')](_0x9ff1('0xd'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xa728=['sequelize','util','exports','STRING','name','TEXT','long','isObjectLike','setDataValue','stringify','isString','formData','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN'];(function(_0x5987a2,_0x3e049a){var _0x3b8a1d=function(_0x5dc476){while(--_0x5dc476){_0x5987a2['push'](_0x5987a2['shift']());}};_0x3b8a1d(++_0x3e049a);}(_0xa728,0xff));var _0x8a72=function(_0x4c24fc,_0x46ba9b){_0x4c24fc=_0x4c24fc-0x0;var _0x245c0e=_0xa728[_0x4c24fc];return _0x245c0e;};'use strict';var Sequelize=require(_0x8a72('0x0'));var _=require('lodash');var util=require(_0x8a72('0x1'));module[_0x8a72('0x2')]={'name':{'type':Sequelize[_0x8a72('0x3')],'unique':_0x8a72('0x4')},'description':{'type':Sequelize[_0x8a72('0x3')]},'formData':{'type':Sequelize[_0x8a72('0x5')](_0x8a72('0x6')),'set':function(_0x4c5fd5){if(_[_0x8a72('0x7')](_0x4c5fd5)){this[_0x8a72('0x8')]('formData',JSON[_0x8a72('0x9')](_0x4c5fd5));}else if(_[_0x8a72('0xa')](_0x4c5fd5)){this['setDataValue'](_0x8a72('0xb'),_0x4c5fd5);}else{this[_0x8a72('0x8')](_0x8a72('0xb'),util[_0x8a72('0xc')](_0x8a72('0xd'),this[_0x8a72('0xe')]('name')||'',this[_0x8a72('0xe')](_0x8a72('0xf'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x8a72('0x10')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 57f3d12..2b03000 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 _0x4975=['SessionId','push','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-type','text/csv','download','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','sendStatus','status','end','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','error','name','index','rawAttributes','fieldName','map','query','keys','intersection','model','attributes','fields','length','nolimit','limit','order','sort','filters','pick','filter','merge','where','type','key','VIRTUAL','field','options','JscriptyProject','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','createdAt','role','Projects','findOne','JscriptySessionReport','hasOwnProperty','ProjectId','JscriptyAnswerReport','number','fromCharCode','indexOf','toString','replace','getSummary','startTime','starttime','parse','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0x4975,0x86));var _0x5497=function(_0x5ac8fb,_0x3f1e4a){_0x5ac8fb=_0x5ac8fb-0x0;var _0x29d6b0=_0x4975[_0x5ac8fb];return _0x29d6b0;};'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 as=require(_0x5497('0x14'));var hardwareService=require(_0x5497('0x15'));var logger=require(_0x5497('0x16'))(_0x5497('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xc250bb,_0x1b23df){_0x1b23df=_0x1b23df||0xcc;return function(_0x1bb794){if(_0x1bb794){return _0xc250bb[_0x5497('0x18')](_0x1b23df);}return _0xc250bb[_0x5497('0x19')](_0x1b23df)[_0x5497('0x1a')]();};}function respondWithResult(_0x1f7169,_0xaca97d){_0xaca97d=_0xaca97d||0xc8;return function(_0x363a5b){if(_0x363a5b){return _0x1f7169[_0x5497('0x19')](_0xaca97d)['json'](_0x363a5b);}};}function respondWithFilteredResult(_0x11b0a9,_0x4fb8e9){return function(_0x4237a9){if(_0x4237a9){var _0x2bfd8a=_0x4237a9[_0x5497('0x1b')],_0x19e5f3=_0x4fb8e9[_0x5497('0x1c')],_0x3ce50b=_0x4fb8e9['offset']+_0x4fb8e9['limit'],_0x37c18e;if(_0x3ce50b>=_0x2bfd8a){_0x3ce50b=_0x2bfd8a;_0x37c18e=0xc8;}else{_0x37c18e=0xce;}_0x11b0a9[_0x5497('0x19')](_0x37c18e);return _0x11b0a9[_0x5497('0x1d')](_0x5497('0x1e'),_0x19e5f3+'-'+_0x3ce50b+'/'+_0x2bfd8a)['json'](_0x4237a9);}return null;};}function patchUpdates(_0xbf1ba7){return function(_0xcbd71d){try{jsonpatch[_0x5497('0x1f')](_0xcbd71d,_0xbf1ba7,!![]);}catch(_0x43da2c){return BPromise[_0x5497('0x20')](_0x43da2c);}return _0xcbd71d[_0x5497('0x21')]();};}function saveUpdates(_0x16d378,_0x10226f){return function(_0x2e3960){if(_0x2e3960){return _0x2e3960[_0x5497('0x22')](_0x16d378)[_0x5497('0x23')](function(_0x52c049){return _0x52c049;});}return null;};}function removeEntity(_0x720767,_0x4d1b27){return function(_0x19200a){if(_0x19200a){return _0x19200a[_0x5497('0x24')]()[_0x5497('0x23')](function(){var _0x2f587d=_0x19200a[_0x5497('0x25')]({'plain':!![]});var _0x3b2fbc='Projects';return db['UserProfileResource'][_0x5497('0x24')]({'where':{'type':_0x3b2fbc,'resourceId':_0x2f587d['id']}})[_0x5497('0x23')](function(){return _0x19200a;});})[_0x5497('0x23')](function(){_0x720767[_0x5497('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x13b7a4,_0x57268c){return function(_0x1f3198){if(!_0x1f3198){_0x13b7a4[_0x5497('0x18')](0x194);}return _0x1f3198;};}function handleError(_0x429d36,_0x34a1a5){_0x34a1a5=_0x34a1a5||0x1f4;return function(_0x163a30){logger[_0x5497('0x26')](_0x163a30['stack']);if(_0x163a30[_0x5497('0x27')]){delete _0x163a30['name'];}_0x429d36['status'](_0x34a1a5)['send'](_0x163a30);};}exports[_0x5497('0x28')]=function(_0x48d146,_0x5e9356){var _0xc3465={},_0xb14593={},_0x1cf908={'count':0x0,'rows':[]};var _0x4c442a=_['map'](db['JscriptyProject'][_0x5497('0x29')],function(_0x471e0b){return{'name':_0x471e0b[_0x5497('0x2a')],'type':_0x471e0b['type']['key']};});_0xb14593['model']=_[_0x5497('0x2b')](_0x4c442a,'name');_0xb14593[_0x5497('0x2c')]=_[_0x5497('0x2d')](_0x48d146[_0x5497('0x2c')]);_0xb14593['filters']=_[_0x5497('0x2e')](_0xb14593[_0x5497('0x2f')],_0xb14593['query']);_0xc3465[_0x5497('0x30')]=_[_0x5497('0x2e')](_0xb14593[_0x5497('0x2f')],qs['fields'](_0x48d146[_0x5497('0x2c')][_0x5497('0x31')]));_0xc3465[_0x5497('0x30')]=_0xc3465[_0x5497('0x30')][_0x5497('0x32')]?_0xc3465['attributes']:_0xb14593[_0x5497('0x2f')];if(!_0x48d146[_0x5497('0x2c')]['hasOwnProperty'](_0x5497('0x33'))){_0xc3465[_0x5497('0x34')]=qs[_0x5497('0x34')](_0x48d146[_0x5497('0x2c')][_0x5497('0x34')]);_0xc3465[_0x5497('0x1c')]=qs['offset'](_0x48d146[_0x5497('0x2c')]['offset']);}_0xc3465[_0x5497('0x35')]=qs[_0x5497('0x36')](_0x48d146[_0x5497('0x2c')]['sort']);_0xc3465['where']=qs[_0x5497('0x37')](_[_0x5497('0x38')](_0x48d146[_0x5497('0x2c')],_0xb14593[_0x5497('0x37')]));if(_0x48d146[_0x5497('0x2c')][_0x5497('0x39')]){_0xc3465['where']=_[_0x5497('0x3a')](_0xc3465[_0x5497('0x3b')],{'$or':_[_0x5497('0x2b')](_0x4c442a,function(_0x2bd07a){if(_0x2bd07a[_0x5497('0x3c')][_0x5497('0x3d')]!==_0x5497('0x3e')){var _0x179635={};_0x179635[_0x2bd07a[_0x5497('0x3f')]]={'$like':'%'+_0x48d146['query'][_0x5497('0x39')]+'%'};return _0x179635;}})});}_0xc3465=_[_0x5497('0x3a')]({},_0xc3465,_0x48d146[_0x5497('0x40')]);var _0x3c0339={'where':_0xc3465[_0x5497('0x3b')]};return db[_0x5497('0x41')][_0x5497('0x1b')](_0x3c0339)['then'](function(_0x3e5f7d){_0x1cf908[_0x5497('0x1b')]=_0x3e5f7d;if(_0x48d146[_0x5497('0x2c')][_0x5497('0x42')]){_0xc3465[_0x5497('0x43')]=[{'all':!![]}];}return db[_0x5497('0x41')][_0x5497('0x44')](_0xc3465);})['then'](function(_0x2137bd){_0x1cf908[_0x5497('0x45')]=_0x2137bd;return _0x1cf908;})[_0x5497('0x23')](respondWithFilteredResult(_0x5e9356,_0xc3465))[_0x5497('0x46')](handleError(_0x5e9356,null));};exports[_0x5497('0x47')]=function(_0xd90608,_0xc1a999){var _0x3eda22={'raw':![],'where':{'id':_0xd90608[_0x5497('0x48')]['id']}},_0x2021ae={};_0x2021ae['model']=_[_0x5497('0x2d')](db['JscriptyProject'][_0x5497('0x29')]);_0x2021ae[_0x5497('0x2c')]=_[_0x5497('0x2d')](_0xd90608[_0x5497('0x2c')]);_0x2021ae[_0x5497('0x37')]=_['intersection'](_0x2021ae[_0x5497('0x2f')],_0x2021ae[_0x5497('0x2c')]);_0x3eda22['attributes']=_[_0x5497('0x2e')](_0x2021ae['model'],qs[_0x5497('0x31')](_0xd90608['query'][_0x5497('0x31')]));_0x3eda22[_0x5497('0x30')]=_0x3eda22[_0x5497('0x30')][_0x5497('0x32')]?_0x3eda22[_0x5497('0x30')]:_0x2021ae['model'];if(_0xd90608['query']['includeAll']){_0x3eda22['include']=[{'all':!![]}];}_0x3eda22=_[_0x5497('0x3a')]({},_0x3eda22,_0xd90608[_0x5497('0x40')]);return db[_0x5497('0x41')][_0x5497('0x49')](_0x3eda22)[_0x5497('0x23')](handleEntityNotFound(_0xc1a999,null))[_0x5497('0x23')](respondWithResult(_0xc1a999,null))[_0x5497('0x46')](handleError(_0xc1a999,null));};exports[_0x5497('0x4a')]=function(_0x2626bf,_0x57350a){return db[_0x5497('0x41')][_0x5497('0x4a')](_0x2626bf[_0x5497('0x4b')],{})['then'](function(_0x3e4da2){var _0x530475=_0x2626bf[_0x5497('0x4c')][_0x5497('0x25')]({'plain':!![]});if(!_0x530475)throw new Error(_0x5497('0x4d'));if(_0x530475['role']===_0x5497('0x4c')){var _0x356d61=_0x3e4da2['get']({'plain':!![]});var _0x3abc92='Projects';return db[_0x5497('0x4e')]['find']({'where':{'name':_0x3abc92,'userProfileId':_0x530475[_0x5497('0x4f')]},'raw':!![]})[_0x5497('0x23')](function(_0x26fd9f){if(_0x26fd9f&&_0x26fd9f[_0x5497('0x50')]===0x0){return db[_0x5497('0x51')][_0x5497('0x4a')]({'name':_0x356d61[_0x5497('0x27')],'resourceId':_0x356d61['id'],'type':_0x26fd9f[_0x5497('0x27')],'sectionId':_0x26fd9f['id']},{})['then'](function(){return _0x3e4da2;});}else{return _0x3e4da2;}})[_0x5497('0x46')](function(_0x5b2c22){logger['error'](_0x5497('0x52'),_0x5b2c22);throw _0x5b2c22;});}return _0x3e4da2;})[_0x5497('0x23')](respondWithResult(_0x57350a,0xc9))['catch'](handleError(_0x57350a,null));};exports[_0x5497('0x53')]=function(_0x3df816,_0x436a83){var _0x3094c7={'raw':![],'where':{'id':_0x3df816[_0x5497('0x48')]['id']}},_0x4ccf0e={};_0x4ccf0e['model']=_['keys'](db[_0x5497('0x41')][_0x5497('0x29')]);_0x3094c7[_0x5497('0x30')]=_['intersection'](_0x4ccf0e['model'],qs[_0x5497('0x31')](_0x3df816['query'][_0x5497('0x31')]));_0x3094c7['attributes']=_0x3094c7[_0x5497('0x30')]['length']?_0x3094c7[_0x5497('0x30')]:_0x4ccf0e[_0x5497('0x2f')];if(_0x3df816['query'][_0x5497('0x42')]){_0x3094c7['include']=[{'all':!![]}];}_0x3094c7=_['merge']({},_0x3094c7,_0x3df816[_0x5497('0x40')]);return db[_0x5497('0x41')]['find'](_0x3094c7)[_0x5497('0x23')](handleEntityNotFound(_0x436a83,null))[_0x5497('0x23')](function(_0x1dbab2){if(_0x1dbab2){var _0x28b2a3=_0x1dbab2[_0x5497('0x25')]({'plain':!![]});_0x28b2a3=qs[_0x5497('0x54')](_0x28b2a3,['id','createdAt',_0x5497('0x55')]);_0x3df816['body']=_['omit'](_0x3df816['body'],['id',_0x5497('0x56'),_0x5497('0x55')]);return db[_0x5497('0x41')]['create'](_[_0x5497('0x3a')](_0x28b2a3,_0x3df816['body']),{'include':_0x3df816['query'][_0x5497('0x42')]?[{'all':!![]}]:undefined})[_0x5497('0x23')](function(_0x3c54e3){var _0x25f349=_0x3df816[_0x5497('0x4c')][_0x5497('0x25')]({'plain':!![]});if(!_0x25f349)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x25f349[_0x5497('0x57')]===_0x5497('0x4c')){var _0x425995=_0x3c54e3[_0x5497('0x25')]({'plain':!![]});var _0x4b86a8=_0x5497('0x58');return db[_0x5497('0x4e')][_0x5497('0x49')]({'where':{'name':_0x4b86a8,'userProfileId':_0x25f349[_0x5497('0x4f')]},'raw':!![]})['then'](function(_0x31271c){if(_0x31271c&&_0x31271c[_0x5497('0x50')]===0x0){return db[_0x5497('0x51')]['create']({'name':_0x425995[_0x5497('0x27')],'resourceId':_0x425995['id'],'type':_0x31271c['name'],'sectionId':_0x31271c['id']},{})['then'](function(){return _0x3c54e3;});}else{return _0x3c54e3;}})['catch'](function(_0x3bcc59){logger[_0x5497('0x26')](_0x5497('0x52'),_0x3bcc59);throw _0x3bcc59;});}return _0x3c54e3;});}})['then'](respondWithResult(_0x436a83,0xc9))[_0x5497('0x46')](handleError(_0x436a83,null));};exports[_0x5497('0x22')]=function(_0x3cfebc,_0x35e75a){if(_0x3cfebc['body']['id']){delete _0x3cfebc[_0x5497('0x4b')]['id'];}return db[_0x5497('0x41')][_0x5497('0x49')]({'where':{'id':_0x3cfebc['params']['id']}})[_0x5497('0x23')](handleEntityNotFound(_0x35e75a,null))[_0x5497('0x23')](saveUpdates(_0x3cfebc[_0x5497('0x4b')],null))[_0x5497('0x23')](respondWithResult(_0x35e75a,null))[_0x5497('0x46')](handleError(_0x35e75a,null));};exports[_0x5497('0x24')]=function(_0x15c05b,_0x4b4cfe){return db[_0x5497('0x41')][_0x5497('0x49')]({'where':{'id':_0x15c05b[_0x5497('0x48')]['id']}})[_0x5497('0x23')](handleEntityNotFound(_0x4b4cfe,null))['then'](removeEntity(_0x4b4cfe,null))['catch'](handleError(_0x4b4cfe,null));};exports['getSessions']=function(_0x305d5b,_0x1d1405,_0x179bbc){var _0x4f49cf={'raw':!![],'where':{}};var _0xc7fa29={};var _0x950d78={'count':0x0,'rows':[]};return db[_0x5497('0x41')][_0x5497('0x59')]({'where':{'id':_0x305d5b[_0x5497('0x48')]['id']}})[_0x5497('0x23')](handleEntityNotFound(_0x1d1405,null))[_0x5497('0x23')](function(_0x23bd32){if(_0x23bd32){_0xc7fa29[_0x5497('0x2f')]=_[_0x5497('0x2d')](db[_0x5497('0x5a')]['rawAttributes']);_0xc7fa29[_0x5497('0x2c')]=_[_0x5497('0x2d')](_0x305d5b[_0x5497('0x2c')]);_0xc7fa29['filters']=_[_0x5497('0x2e')](_0xc7fa29['model'],_0xc7fa29[_0x5497('0x2c')]);_0x4f49cf[_0x5497('0x30')]=_['intersection'](_0xc7fa29[_0x5497('0x2f')],qs[_0x5497('0x31')](_0x305d5b[_0x5497('0x2c')][_0x5497('0x31')]));_0x4f49cf['attributes']=_0x4f49cf[_0x5497('0x30')][_0x5497('0x32')]?_0x4f49cf[_0x5497('0x30')]:_0xc7fa29['model'];if(!_0x305d5b[_0x5497('0x2c')][_0x5497('0x5b')]('nolimit')){_0x4f49cf[_0x5497('0x34')]=qs[_0x5497('0x34')](_0x305d5b[_0x5497('0x2c')]['limit']);_0x4f49cf['offset']=qs[_0x5497('0x1c')](_0x305d5b[_0x5497('0x2c')][_0x5497('0x1c')]);}_0x4f49cf[_0x5497('0x35')]=qs[_0x5497('0x36')](_0x305d5b[_0x5497('0x2c')][_0x5497('0x36')]);_0x4f49cf['where']=qs['filters'](_[_0x5497('0x38')](_0x305d5b[_0x5497('0x2c')],_0xc7fa29['filters']));_0x4f49cf[_0x5497('0x3b')][_0x5497('0x5c')]=_0x23bd32['id'];if(_0x305d5b[_0x5497('0x2c')]['filter']){_0x4f49cf[_0x5497('0x3b')]=_[_0x5497('0x3a')](_0x4f49cf['where'],{'$or':_[_0x5497('0x2b')](_0x4f49cf[_0x5497('0x30')],function(_0x9458d7){var _0x42d745={};_0x42d745[_0x9458d7]={'$like':'%'+_0x305d5b[_0x5497('0x2c')]['filter']+'%'};return _0x42d745;})});}_0x4f49cf=_[_0x5497('0x3a')]({},_0x4f49cf,_0x305d5b[_0x5497('0x40')]);return db[_0x5497('0x5a')][_0x5497('0x1b')]({'where':_0x4f49cf[_0x5497('0x3b')]})['then'](function(_0x394bf3){_0x950d78[_0x5497('0x1b')]=_0x394bf3;if(_0x305d5b[_0x5497('0x2c')][_0x5497('0x42')]){_0x4f49cf['include']=[{'all':!![]}];}return db[_0x5497('0x5a')][_0x5497('0x44')](_0x4f49cf);})['then'](function(_0xb72eed){_0x950d78[_0x5497('0x45')]=_0xb72eed;return _0x950d78;});}})[_0x5497('0x23')](respondWithFilteredResult(_0x1d1405,_0x4f49cf))[_0x5497('0x46')](handleError(_0x1d1405,null));};exports['getAnswers']=function(_0x547de7,_0x4ff64f,_0x5343d5){var _0x594761={'raw':!![],'where':{}};var _0x2d5543={};var _0x2375cc={'count':0x0,'rows':[]};return db[_0x5497('0x41')][_0x5497('0x59')]({'where':{'id':_0x547de7[_0x5497('0x48')]['id']}})['then'](handleEntityNotFound(_0x4ff64f,null))['then'](function(_0x392987){if(_0x392987){_0x2d5543[_0x5497('0x2f')]=_[_0x5497('0x2d')](db[_0x5497('0x5d')][_0x5497('0x29')]);_0x2d5543[_0x5497('0x2c')]=_[_0x5497('0x2d')](_0x547de7[_0x5497('0x2c')]);_0x2d5543[_0x5497('0x37')]=_[_0x5497('0x2e')](_0x2d5543['model'],_0x2d5543[_0x5497('0x2c')]);_0x594761[_0x5497('0x30')]=_[_0x5497('0x2e')](_0x2d5543[_0x5497('0x2f')],qs[_0x5497('0x31')](_0x547de7[_0x5497('0x2c')]['fields']));_0x594761[_0x5497('0x30')]=_0x594761['attributes'][_0x5497('0x32')]?_0x594761[_0x5497('0x30')]:_0x2d5543[_0x5497('0x2f')];if(!_0x547de7['query']['hasOwnProperty'](_0x5497('0x33'))){_0x594761[_0x5497('0x34')]=qs[_0x5497('0x34')](_0x547de7[_0x5497('0x2c')][_0x5497('0x34')]);_0x594761[_0x5497('0x1c')]=qs[_0x5497('0x1c')](_0x547de7[_0x5497('0x2c')]['offset']);}_0x594761['order']=qs['sort'](_0x547de7[_0x5497('0x2c')][_0x5497('0x36')]);_0x594761[_0x5497('0x3b')]=qs[_0x5497('0x37')](_['pick'](_0x547de7['query'],_0x2d5543[_0x5497('0x37')]));_0x594761[_0x5497('0x3b')]['ProjectId']=_0x392987['id'];if(_0x547de7[_0x5497('0x2c')][_0x5497('0x39')]){_0x594761[_0x5497('0x3b')]=_[_0x5497('0x3a')](_0x594761['where'],{'$or':_['map'](_0x594761['attributes'],function(_0x5d914c){var _0x50a75b={};_0x50a75b[_0x5d914c]={'$like':'%'+_0x547de7[_0x5497('0x2c')]['filter']+'%'};return _0x50a75b;})});}_0x594761=_[_0x5497('0x3a')]({},_0x594761,_0x547de7['options']);return db[_0x5497('0x5d')][_0x5497('0x1b')]({'where':_0x594761[_0x5497('0x3b')]})[_0x5497('0x23')](function(_0x103b0c){_0x2375cc[_0x5497('0x1b')]=_0x103b0c;if(_0x547de7['query'][_0x5497('0x42')]){_0x594761['include']=[{'all':!![]}];}return db[_0x5497('0x5d')][_0x5497('0x44')](_0x594761);})[_0x5497('0x23')](function(_0xb5a807){_0x2375cc[_0x5497('0x45')]=_0xb5a807;return _0x2375cc;});}})[_0x5497('0x23')](respondWithFilteredResult(_0x4ff64f,_0x594761))[_0x5497('0x46')](handleError(_0x4ff64f,null));};function char(_0x21371b){return _0x5497('0x5e')===typeof _0x21371b?String[_0x5497('0x5f')]['apply'](null,arguments):_0x21371b;}function needsEncapsulation(_0x41120c){return!!_0x41120c&&(_0x41120c['toString']()[_0x5497('0x60')](char(0xd))>=0x0||_0x41120c[_0x5497('0x61')]()['indexOf'](char(0xa))>=0x0||_0x41120c[_0x5497('0x61')]()[_0x5497('0x60')](char(0x2c))>=0x0||_0x41120c[_0x5497('0x61')]()[_0x5497('0x60')](char(0x22))>=0x0);}function encapsulate(_0x42a5bd){var _0x4641ae=char(0x22),_0x3e0b9f='\x5c'+char(0x22),_0xe44f98=_0x42a5bd[_0x5497('0x61')]()[_0x5497('0x62')](new RegExp(_0x4641ae,'g'),_0x3e0b9f);return _0x4641ae+_0xe44f98+_0x4641ae;}exports[_0x5497('0x63')]=function(_0x926bc1,_0x38d9fe,_0x22426e){var _0x5e047d,_0x37c17e;var _0x163b5b={'where':{'ProjectId':_0x926bc1[_0x5497('0x48')]['id']}};if(_0x926bc1[_0x5497('0x2c')][_0x5497('0x64')]){_0x163b5b['where'][_0x5497('0x65')]=JSON[_0x5497('0x66')](_0x926bc1['query']['startTime']);}return db[_0x5497('0x5a')][_0x5497('0x44')](_0x163b5b)[_0x5497('0x23')](handleEntityNotFound(_0x38d9fe,null))[_0x5497('0x23')](function(_0x3d649c){if(_0x3d649c){_0x5e047d=_0x3d649c;return db['JscriptyQuestionReport']['findAll']({'where':{'SessionId':{'$in':_[_0x5497('0x2b')](_0x5e047d,'id')},'ProjectId':_0x926bc1['params']['id']},'order':_0x5497('0x67')});}})[_0x5497('0x23')](handleEntityNotFound(_0x38d9fe,null))[_0x5497('0x23')](function(_0x12fd96){if(_0x12fd96){_0x37c17e=_0x12fd96;var _0x2bdedb={};for(var _0x13350b=0x0,_0x53acd4=_0x37c17e['length'];_0x13350b<_0x53acd4;_0x13350b++){if(!_0x2bdedb[_0x5497('0x5b')](_0x37c17e[_0x13350b][_0x5497('0x68')])){_0x2bdedb[_0x37c17e[_0x13350b][_0x5497('0x68')]]=needsEncapsulation(_0x37c17e[_0x13350b]['question'])?encapsulate(_0x37c17e[_0x13350b][_0x5497('0x69')]):_0x37c17e[_0x13350b]['question'];}}var _0x1a2f7c=[],_0x5ec87d={};for(var _0x57961a=0x0,_0x39d79c=_0x5e047d[_0x5497('0x32')];_0x57961a<_0x39d79c;_0x57961a++){_0x5ec87d={'ProjectId':_0x926bc1['params']['id'],'SessionId':_0x5e047d[_0x57961a]['id'],'StartTime':moment(_0x5e047d[_0x57961a][_0x5497('0x65')])[_0x5497('0x6a')](_0x5497('0x6b'))};for(var _0x268b7b=0x0,_0x5bff6e=_0x37c17e[_0x5497('0x32')];_0x268b7b<_0x5bff6e;_0x268b7b++){if(_0x37c17e[_0x268b7b][_0x5497('0x6c')]==_0x5e047d[_0x57961a]['id']&&_0x2bdedb[_0x5497('0x5b')](_0x37c17e[_0x268b7b][_0x5497('0x68')])){_0x5ec87d[_0x2bdedb[_0x37c17e[_0x268b7b][_0x5497('0x68')]]]=_0x37c17e[_0x268b7b]['answer'];}}for(var _0x204763 in _0x2bdedb){if(!_0x5ec87d['hasOwnProperty'](_0x2bdedb[_0x204763])){_0x5ec87d[_0x2bdedb[_0x204763]]=null;}}_0x1a2f7c[_0x5497('0x6d')](_0x5ec87d);}return _0x1a2f7c;}})[_0x5497('0x23')](function(_0x1cfbc8){if(!_[_0x5497('0x6e')](_0x1cfbc8)){var _0x380bed=toCsv(_0x1cfbc8);var _0x3070c7=Date[_0x5497('0x6f')]();fs[_0x5497('0x70')](util[_0x5497('0x6a')](_0x5497('0x71'),_0x926bc1[_0x5497('0x48')]['id'],_0x3070c7),_0x380bed);_0x38d9fe['setHeader'](_0x5497('0x72'),_0x5497('0x73')+util[_0x5497('0x6a')](_0x5497('0x74'),_0x926bc1[_0x5497('0x48')]['id'],_0x3070c7));_0x38d9fe[_0x5497('0x75')](_0x5497('0x76'),_0x5497('0x77'));return _0x38d9fe[_0x5497('0x78')](util[_0x5497('0x6a')](_0x5497('0x71'),_0x926bc1['params']['id'],_0x3070c7));}else{return _0x38d9fe[_0x5497('0x18')](0xcc);}})[_0x5497('0x46')](handleError(_0x38d9fe,null));}; \ No newline at end of file +var _0x0295=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','pick','ProjectId','JscriptySessionReport','getAnswers','JscriptyAnswerReport','fromCharCode','toString','indexOf','replace','getSummary','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','questionId','question','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','now','writeFileSync','format','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','download','html-pdf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','status','json','count','offset','set','Content-Range','apply','reject','update','destroy','then','get','Projects','UserProfileResource','end','sendStatus','error','stack','name','send','JscriptyProject','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter','merge','VIRTUAL','field','options','includeAll','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','clone','include','omit','updatedAt','userProfileId','autoAssociation'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x0295,0x1f0));var _0x5029=function(_0x3f6c29,_0x370d86){_0x3f6c29=_0x3f6c29-0x0;var _0x4af959=_0x0295[_0x3f6c29];return _0x4af959;};'use strict';var pdf=require(_0x5029('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5029('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5029('0x2'));var BPromise=require(_0x5029('0x3'));var Mustache=require(_0x5029('0x4'));var util=require(_0x5029('0x5'));var path=require(_0x5029('0x6'));var sox=require(_0x5029('0x7'));var csv=require(_0x5029('0x8'));var ejs=require(_0x5029('0x9'));var fs=require('fs');var _=require(_0x5029('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5029('0xb'));var toCsv=require('to-csv');var querystring=require(_0x5029('0xc'));var Papa=require('papaparse');var Redis=require(_0x5029('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x5029('0xe'));var as=require(_0x5029('0xf'));var hardwareService=require(_0x5029('0x10'));var logger=require('../../config/logger')(_0x5029('0x11'));var utils=require(_0x5029('0x12'));var config=require(_0x5029('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3bc005,_0x2442b2){_0x2442b2=_0x2442b2||0xcc;return function(_0x4cced9){if(_0x4cced9){return _0x3bc005['sendStatus'](_0x2442b2);}return _0x3bc005['status'](_0x2442b2)['end']();};}function respondWithResult(_0x2484ac,_0x2e0369){_0x2e0369=_0x2e0369||0xc8;return function(_0x12c237){if(_0x12c237){return _0x2484ac[_0x5029('0x14')](_0x2e0369)[_0x5029('0x15')](_0x12c237);}};}function respondWithFilteredResult(_0x11c24b,_0xe278b7){return function(_0x317c20){if(_0x317c20){var _0x10bf55=_0x317c20[_0x5029('0x16')],_0x326923=_0xe278b7[_0x5029('0x17')],_0x457c73=_0xe278b7[_0x5029('0x17')]+_0xe278b7['limit'],_0x353cba;if(_0x457c73>=_0x10bf55){_0x457c73=_0x10bf55;_0x353cba=0xc8;}else{_0x353cba=0xce;}_0x11c24b[_0x5029('0x14')](_0x353cba);return _0x11c24b[_0x5029('0x18')](_0x5029('0x19'),_0x326923+'-'+_0x457c73+'/'+_0x10bf55)[_0x5029('0x15')](_0x317c20);}return null;};}function patchUpdates(_0x8cea01){return function(_0x5e115f){try{jsonpatch[_0x5029('0x1a')](_0x5e115f,_0x8cea01,!![]);}catch(_0x4adbb3){return BPromise[_0x5029('0x1b')](_0x4adbb3);}return _0x5e115f['save']();};}function saveUpdates(_0x16485c,_0x8a414c){return function(_0x2710aa){if(_0x2710aa){return _0x2710aa[_0x5029('0x1c')](_0x16485c)['then'](function(_0x47ecca){return _0x47ecca;});}return null;};}function removeEntity(_0x4c9184,_0x4a49b6){return function(_0x3f657d){if(_0x3f657d){return _0x3f657d[_0x5029('0x1d')]()[_0x5029('0x1e')](function(){var _0x2bbbcb=_0x3f657d[_0x5029('0x1f')]({'plain':!![]});var _0x3a3e52=_0x5029('0x20');return db[_0x5029('0x21')][_0x5029('0x1d')]({'where':{'type':_0x3a3e52,'resourceId':_0x2bbbcb['id']}})['then'](function(){return _0x3f657d;});})['then'](function(){_0x4c9184['status'](0xcc)[_0x5029('0x22')]();});}};}function handleEntityNotFound(_0x45666c,_0x51093c){return function(_0x5727e9){if(!_0x5727e9){_0x45666c[_0x5029('0x23')](0x194);}return _0x5727e9;};}function handleError(_0x1e7e61,_0x36d810){_0x36d810=_0x36d810||0x1f4;return function(_0x5527fc){logger[_0x5029('0x24')](_0x5527fc[_0x5029('0x25')]);if(_0x5527fc['name']){delete _0x5527fc[_0x5029('0x26')];}_0x1e7e61[_0x5029('0x14')](_0x36d810)[_0x5029('0x27')](_0x5527fc);};}exports['index']=function(_0x32da06,_0x251f99){var _0xe5313e={},_0x4b6f92={},_0x2cedf6={'count':0x0,'rows':[]};var _0x2bb398=_['map'](db[_0x5029('0x28')][_0x5029('0x29')],function(_0x4434ff){return{'name':_0x4434ff[_0x5029('0x2a')],'type':_0x4434ff[_0x5029('0x2b')][_0x5029('0x2c')]};});_0x4b6f92[_0x5029('0x2d')]=_[_0x5029('0x2e')](_0x2bb398,_0x5029('0x26'));_0x4b6f92[_0x5029('0x2f')]=_[_0x5029('0x30')](_0x32da06[_0x5029('0x2f')]);_0x4b6f92['filters']=_[_0x5029('0x31')](_0x4b6f92['model'],_0x4b6f92[_0x5029('0x2f')]);_0xe5313e['attributes']=_['intersection'](_0x4b6f92[_0x5029('0x2d')],qs[_0x5029('0x32')](_0x32da06[_0x5029('0x2f')]['fields']));_0xe5313e[_0x5029('0x33')]=_0xe5313e[_0x5029('0x33')][_0x5029('0x34')]?_0xe5313e[_0x5029('0x33')]:_0x4b6f92[_0x5029('0x2d')];if(!_0x32da06[_0x5029('0x2f')][_0x5029('0x35')](_0x5029('0x36'))){_0xe5313e[_0x5029('0x37')]=qs['limit'](_0x32da06[_0x5029('0x2f')][_0x5029('0x37')]);_0xe5313e[_0x5029('0x17')]=qs[_0x5029('0x17')](_0x32da06['query'][_0x5029('0x17')]);}_0xe5313e[_0x5029('0x38')]=qs[_0x5029('0x39')](_0x32da06['query']['sort']);_0xe5313e[_0x5029('0x3a')]=qs[_0x5029('0x3b')](_['pick'](_0x32da06['query'],_0x4b6f92[_0x5029('0x3b')]));if(_0x32da06[_0x5029('0x2f')][_0x5029('0x3c')]){_0xe5313e[_0x5029('0x3a')]=_[_0x5029('0x3d')](_0xe5313e[_0x5029('0x3a')],{'$or':_[_0x5029('0x2e')](_0x2bb398,function(_0x2f13b1){if(_0x2f13b1[_0x5029('0x2b')][_0x5029('0x2c')]!==_0x5029('0x3e')){var _0xbdb3fa={};_0xbdb3fa[_0x2f13b1[_0x5029('0x3f')]]={'$like':'%'+_0x32da06[_0x5029('0x2f')]['filter']+'%'};return _0xbdb3fa;}})});}_0xe5313e=_['merge']({},_0xe5313e,_0x32da06[_0x5029('0x40')]);var _0x1b64da={'where':_0xe5313e[_0x5029('0x3a')]};return db['JscriptyProject'][_0x5029('0x16')](_0x1b64da)[_0x5029('0x1e')](function(_0x52572a){_0x2cedf6[_0x5029('0x16')]=_0x52572a;if(_0x32da06['query'][_0x5029('0x41')]){_0xe5313e['include']=[{'all':!![]}];}return db[_0x5029('0x28')][_0x5029('0x42')](_0xe5313e);})[_0x5029('0x1e')](function(_0x78768){_0x2cedf6[_0x5029('0x43')]=_0x78768;return _0x2cedf6;})[_0x5029('0x1e')](respondWithFilteredResult(_0x251f99,_0xe5313e))[_0x5029('0x44')](handleError(_0x251f99,null));};exports[_0x5029('0x45')]=function(_0x2ae047,_0x5a3e4d){var _0x103dfb={'raw':![],'where':{'id':_0x2ae047[_0x5029('0x46')]['id']}},_0x236455={};_0x236455[_0x5029('0x2d')]=_[_0x5029('0x30')](db[_0x5029('0x28')]['rawAttributes']);_0x236455[_0x5029('0x2f')]=_[_0x5029('0x30')](_0x2ae047[_0x5029('0x2f')]);_0x236455[_0x5029('0x3b')]=_[_0x5029('0x31')](_0x236455['model'],_0x236455[_0x5029('0x2f')]);_0x103dfb[_0x5029('0x33')]=_[_0x5029('0x31')](_0x236455[_0x5029('0x2d')],qs[_0x5029('0x32')](_0x2ae047[_0x5029('0x2f')][_0x5029('0x32')]));_0x103dfb[_0x5029('0x33')]=_0x103dfb[_0x5029('0x33')]['length']?_0x103dfb[_0x5029('0x33')]:_0x236455[_0x5029('0x2d')];if(_0x2ae047[_0x5029('0x2f')][_0x5029('0x41')]){_0x103dfb['include']=[{'all':!![]}];}_0x103dfb=_['merge']({},_0x103dfb,_0x2ae047[_0x5029('0x40')]);return db[_0x5029('0x28')][_0x5029('0x47')](_0x103dfb)[_0x5029('0x1e')](handleEntityNotFound(_0x5a3e4d,null))[_0x5029('0x1e')](respondWithResult(_0x5a3e4d,null))[_0x5029('0x44')](handleError(_0x5a3e4d,null));};exports[_0x5029('0x48')]=function(_0x19a6ca,_0x1257a4){return db[_0x5029('0x28')][_0x5029('0x48')](_0x19a6ca[_0x5029('0x49')],{})[_0x5029('0x1e')](function(_0x18f1f5){var _0x3168bd=_0x19a6ca[_0x5029('0x4a')][_0x5029('0x1f')]({'plain':!![]});if(!_0x3168bd)throw new Error(_0x5029('0x4b'));if(_0x3168bd[_0x5029('0x4c')]===_0x5029('0x4a')){var _0x1d0a38=_0x18f1f5['get']({'plain':!![]});var _0x1069c4='Projects';return db[_0x5029('0x4d')][_0x5029('0x47')]({'where':{'name':_0x1069c4,'userProfileId':_0x3168bd['userProfileId']},'raw':!![]})['then'](function(_0x319bff){if(_0x319bff&&_0x319bff['autoAssociation']===0x0){return db['UserProfileResource'][_0x5029('0x48')]({'name':_0x1d0a38[_0x5029('0x26')],'resourceId':_0x1d0a38['id'],'type':_0x319bff[_0x5029('0x26')],'sectionId':_0x319bff['id']},{})['then'](function(){return _0x18f1f5;});}else{return _0x18f1f5;}})['catch'](function(_0x1510bb){logger[_0x5029('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1510bb);throw _0x1510bb;});}return _0x18f1f5;})[_0x5029('0x1e')](respondWithResult(_0x1257a4,0xc9))['catch'](handleError(_0x1257a4,null));};exports[_0x5029('0x4e')]=function(_0x5f1e4f,_0x2340b0){var _0x27e1c0={'raw':![],'where':{'id':_0x5f1e4f[_0x5029('0x46')]['id']}},_0x358c8a={};_0x358c8a[_0x5029('0x2d')]=_[_0x5029('0x30')](db[_0x5029('0x28')][_0x5029('0x29')]);_0x27e1c0['attributes']=_[_0x5029('0x31')](_0x358c8a['model'],qs[_0x5029('0x32')](_0x5f1e4f[_0x5029('0x2f')]['fields']));_0x27e1c0[_0x5029('0x33')]=_0x27e1c0['attributes']['length']?_0x27e1c0['attributes']:_0x358c8a[_0x5029('0x2d')];if(_0x5f1e4f['query'][_0x5029('0x41')]){_0x27e1c0[_0x5029('0x4f')]=[{'all':!![]}];}_0x27e1c0=_[_0x5029('0x3d')]({},_0x27e1c0,_0x5f1e4f['options']);return db[_0x5029('0x28')]['find'](_0x27e1c0)['then'](handleEntityNotFound(_0x2340b0,null))[_0x5029('0x1e')](function(_0x98abd1){if(_0x98abd1){var _0x81e39c=_0x98abd1[_0x5029('0x1f')]({'plain':!![]});_0x81e39c=qs[_0x5029('0x50')](_0x81e39c,['id','createdAt',_0x5029('0x51')]);_0x5f1e4f[_0x5029('0x49')]=_[_0x5029('0x50')](_0x5f1e4f[_0x5029('0x49')],['id','createdAt',_0x5029('0x51')]);return db[_0x5029('0x28')]['create'](_['merge'](_0x81e39c,_0x5f1e4f[_0x5029('0x49')]),{'include':_0x5f1e4f[_0x5029('0x2f')][_0x5029('0x41')]?[{'all':!![]}]:undefined})[_0x5029('0x1e')](function(_0x50a9d1){var _0x4208ab=_0x5f1e4f[_0x5029('0x4a')][_0x5029('0x1f')]({'plain':!![]});if(!_0x4208ab)throw new Error(_0x5029('0x4b'));if(_0x4208ab[_0x5029('0x4c')]===_0x5029('0x4a')){var _0x59a718=_0x50a9d1['get']({'plain':!![]});var _0x4314c0=_0x5029('0x20');return db[_0x5029('0x4d')]['find']({'where':{'name':_0x4314c0,'userProfileId':_0x4208ab[_0x5029('0x52')]},'raw':!![]})[_0x5029('0x1e')](function(_0x105638){if(_0x105638&&_0x105638[_0x5029('0x53')]===0x0){return db[_0x5029('0x21')]['create']({'name':_0x59a718[_0x5029('0x26')],'resourceId':_0x59a718['id'],'type':_0x105638[_0x5029('0x26')],'sectionId':_0x105638['id']},{})[_0x5029('0x1e')](function(){return _0x50a9d1;});}else{return _0x50a9d1;}})['catch'](function(_0x853407){logger['error'](_0x5029('0x54'),_0x853407);throw _0x853407;});}return _0x50a9d1;});}})['then'](respondWithResult(_0x2340b0,0xc9))[_0x5029('0x44')](handleError(_0x2340b0,null));};exports[_0x5029('0x1c')]=function(_0x2ad2e3,_0x2f5301){if(_0x2ad2e3[_0x5029('0x49')]['id']){delete _0x2ad2e3[_0x5029('0x49')]['id'];}return db['JscriptyProject'][_0x5029('0x47')]({'where':{'id':_0x2ad2e3[_0x5029('0x46')]['id']}})[_0x5029('0x1e')](handleEntityNotFound(_0x2f5301,null))[_0x5029('0x1e')](saveUpdates(_0x2ad2e3[_0x5029('0x49')],null))['then'](respondWithResult(_0x2f5301,null))[_0x5029('0x44')](handleError(_0x2f5301,null));};exports['destroy']=function(_0x2780e2,_0x539f80){return db[_0x5029('0x28')]['find']({'where':{'id':_0x2780e2[_0x5029('0x46')]['id']}})['then'](handleEntityNotFound(_0x539f80,null))['then'](removeEntity(_0x539f80,null))[_0x5029('0x44')](handleError(_0x539f80,null));};exports['getSessions']=function(_0x2d2a40,_0xd0175d,_0x382994){var _0x554e30={'raw':!![],'where':{}};var _0x234831={};var _0x490821={'count':0x0,'rows':[]};return db[_0x5029('0x28')][_0x5029('0x55')]({'where':{'id':_0x2d2a40[_0x5029('0x46')]['id']}})[_0x5029('0x1e')](handleEntityNotFound(_0xd0175d,null))[_0x5029('0x1e')](function(_0x51492f){if(_0x51492f){_0x234831[_0x5029('0x2d')]=_[_0x5029('0x30')](db['JscriptySessionReport'][_0x5029('0x29')]);_0x234831[_0x5029('0x2f')]=_[_0x5029('0x30')](_0x2d2a40[_0x5029('0x2f')]);_0x234831[_0x5029('0x3b')]=_[_0x5029('0x31')](_0x234831['model'],_0x234831['query']);_0x554e30[_0x5029('0x33')]=_['intersection'](_0x234831[_0x5029('0x2d')],qs[_0x5029('0x32')](_0x2d2a40['query'][_0x5029('0x32')]));_0x554e30['attributes']=_0x554e30['attributes'][_0x5029('0x34')]?_0x554e30[_0x5029('0x33')]:_0x234831[_0x5029('0x2d')];if(!_0x2d2a40[_0x5029('0x2f')]['hasOwnProperty'](_0x5029('0x36'))){_0x554e30[_0x5029('0x37')]=qs['limit'](_0x2d2a40[_0x5029('0x2f')][_0x5029('0x37')]);_0x554e30['offset']=qs['offset'](_0x2d2a40['query'][_0x5029('0x17')]);}_0x554e30[_0x5029('0x38')]=qs[_0x5029('0x39')](_0x2d2a40[_0x5029('0x2f')][_0x5029('0x39')]);_0x554e30[_0x5029('0x3a')]=qs[_0x5029('0x3b')](_[_0x5029('0x56')](_0x2d2a40[_0x5029('0x2f')],_0x234831['filters']));_0x554e30['where'][_0x5029('0x57')]=_0x51492f['id'];if(_0x2d2a40[_0x5029('0x2f')][_0x5029('0x3c')]){_0x554e30[_0x5029('0x3a')]=_[_0x5029('0x3d')](_0x554e30[_0x5029('0x3a')],{'$or':_[_0x5029('0x2e')](_0x554e30['attributes'],function(_0x31a1fd){var _0x3a0d6f={};_0x3a0d6f[_0x31a1fd]={'$like':'%'+_0x2d2a40[_0x5029('0x2f')]['filter']+'%'};return _0x3a0d6f;})});}_0x554e30=_[_0x5029('0x3d')]({},_0x554e30,_0x2d2a40[_0x5029('0x40')]);return db[_0x5029('0x58')]['count']({'where':_0x554e30[_0x5029('0x3a')]})[_0x5029('0x1e')](function(_0x343c0a){_0x490821['count']=_0x343c0a;if(_0x2d2a40[_0x5029('0x2f')][_0x5029('0x41')]){_0x554e30['include']=[{'all':!![]}];}return db[_0x5029('0x58')][_0x5029('0x42')](_0x554e30);})[_0x5029('0x1e')](function(_0x124631){_0x490821[_0x5029('0x43')]=_0x124631;return _0x490821;});}})['then'](respondWithFilteredResult(_0xd0175d,_0x554e30))[_0x5029('0x44')](handleError(_0xd0175d,null));};exports[_0x5029('0x59')]=function(_0x426d70,_0xe6ac28,_0x153cdc){var _0x5e7f50={'raw':!![],'where':{}};var _0x455464={};var _0x202c51={'count':0x0,'rows':[]};return db[_0x5029('0x28')]['findOne']({'where':{'id':_0x426d70[_0x5029('0x46')]['id']}})[_0x5029('0x1e')](handleEntityNotFound(_0xe6ac28,null))[_0x5029('0x1e')](function(_0x3e47bd){if(_0x3e47bd){_0x455464[_0x5029('0x2d')]=_[_0x5029('0x30')](db[_0x5029('0x5a')]['rawAttributes']);_0x455464[_0x5029('0x2f')]=_[_0x5029('0x30')](_0x426d70[_0x5029('0x2f')]);_0x455464[_0x5029('0x3b')]=_[_0x5029('0x31')](_0x455464['model'],_0x455464[_0x5029('0x2f')]);_0x5e7f50[_0x5029('0x33')]=_[_0x5029('0x31')](_0x455464['model'],qs[_0x5029('0x32')](_0x426d70[_0x5029('0x2f')]['fields']));_0x5e7f50['attributes']=_0x5e7f50['attributes'][_0x5029('0x34')]?_0x5e7f50[_0x5029('0x33')]:_0x455464[_0x5029('0x2d')];if(!_0x426d70[_0x5029('0x2f')][_0x5029('0x35')]('nolimit')){_0x5e7f50[_0x5029('0x37')]=qs[_0x5029('0x37')](_0x426d70[_0x5029('0x2f')]['limit']);_0x5e7f50['offset']=qs[_0x5029('0x17')](_0x426d70[_0x5029('0x2f')][_0x5029('0x17')]);}_0x5e7f50[_0x5029('0x38')]=qs['sort'](_0x426d70[_0x5029('0x2f')][_0x5029('0x39')]);_0x5e7f50[_0x5029('0x3a')]=qs[_0x5029('0x3b')](_[_0x5029('0x56')](_0x426d70[_0x5029('0x2f')],_0x455464[_0x5029('0x3b')]));_0x5e7f50[_0x5029('0x3a')]['ProjectId']=_0x3e47bd['id'];if(_0x426d70[_0x5029('0x2f')]['filter']){_0x5e7f50['where']=_[_0x5029('0x3d')](_0x5e7f50['where'],{'$or':_[_0x5029('0x2e')](_0x5e7f50[_0x5029('0x33')],function(_0x296c19){var _0x42d02a={};_0x42d02a[_0x296c19]={'$like':'%'+_0x426d70[_0x5029('0x2f')][_0x5029('0x3c')]+'%'};return _0x42d02a;})});}_0x5e7f50=_[_0x5029('0x3d')]({},_0x5e7f50,_0x426d70[_0x5029('0x40')]);return db['JscriptyAnswerReport']['count']({'where':_0x5e7f50[_0x5029('0x3a')]})['then'](function(_0x5a2027){_0x202c51[_0x5029('0x16')]=_0x5a2027;if(_0x426d70['query']['includeAll']){_0x5e7f50[_0x5029('0x4f')]=[{'all':!![]}];}return db[_0x5029('0x5a')][_0x5029('0x42')](_0x5e7f50);})[_0x5029('0x1e')](function(_0x324493){_0x202c51['rows']=_0x324493;return _0x202c51;});}})[_0x5029('0x1e')](respondWithFilteredResult(_0xe6ac28,_0x5e7f50))[_0x5029('0x44')](handleError(_0xe6ac28,null));};function char(_0x7c87a2){return'number'===typeof _0x7c87a2?String[_0x5029('0x5b')][_0x5029('0x1a')](null,arguments):_0x7c87a2;}function needsEncapsulation(_0xec8dc3){return!!_0xec8dc3&&(_0xec8dc3[_0x5029('0x5c')]()[_0x5029('0x5d')](char(0xd))>=0x0||_0xec8dc3['toString']()['indexOf'](char(0xa))>=0x0||_0xec8dc3[_0x5029('0x5c')]()[_0x5029('0x5d')](char(0x2c))>=0x0||_0xec8dc3['toString']()[_0x5029('0x5d')](char(0x22))>=0x0);}function encapsulate(_0x332bfb){var _0x3d0d7a=char(0x22),_0x1b62f3='\x5c'+char(0x22),_0x13d02e=_0x332bfb[_0x5029('0x5c')]()[_0x5029('0x5e')](new RegExp(_0x3d0d7a,'g'),_0x1b62f3);return _0x3d0d7a+_0x13d02e+_0x3d0d7a;}exports[_0x5029('0x5f')]=function(_0x51aaad,_0x523bee,_0x4243c3){var _0x57b4e7,_0x20a259;var _0x5e5f88={'where':{'ProjectId':_0x51aaad[_0x5029('0x46')]['id']}};if(_0x51aaad[_0x5029('0x2f')][_0x5029('0x60')]){_0x5e5f88['where'][_0x5029('0x61')]=JSON[_0x5029('0x62')](_0x51aaad[_0x5029('0x2f')]['startTime']);}return db[_0x5029('0x58')][_0x5029('0x42')](_0x5e5f88)[_0x5029('0x1e')](handleEntityNotFound(_0x523bee,null))[_0x5029('0x1e')](function(_0x466934){if(_0x466934){_0x57b4e7=_0x466934;return db[_0x5029('0x63')][_0x5029('0x42')]({'where':{'SessionId':{'$in':_[_0x5029('0x2e')](_0x57b4e7,'id')},'ProjectId':_0x51aaad[_0x5029('0x46')]['id']},'order':_0x5029('0x64')});}})[_0x5029('0x1e')](handleEntityNotFound(_0x523bee,null))[_0x5029('0x1e')](function(_0x21a590){if(_0x21a590){_0x20a259=_0x21a590;var _0x412d00={};for(var _0x1ae896=0x0,_0x15435d=_0x20a259[_0x5029('0x34')];_0x1ae896<_0x15435d;_0x1ae896++){if(!_0x412d00[_0x5029('0x35')](_0x20a259[_0x1ae896]['questionId'])){_0x412d00[_0x20a259[_0x1ae896][_0x5029('0x65')]]=needsEncapsulation(_0x20a259[_0x1ae896][_0x5029('0x66')])?encapsulate(_0x20a259[_0x1ae896][_0x5029('0x66')]):_0x20a259[_0x1ae896][_0x5029('0x66')];}}var _0x34494c=[],_0x546b19={};for(var _0xe0aa6d=0x0,_0x13aede=_0x57b4e7[_0x5029('0x34')];_0xe0aa6d<_0x13aede;_0xe0aa6d++){_0x546b19={'ProjectId':_0x51aaad[_0x5029('0x46')]['id'],'SessionId':_0x57b4e7[_0xe0aa6d]['id'],'StartTime':moment(_0x57b4e7[_0xe0aa6d][_0x5029('0x61')])['format'](_0x5029('0x67'))};for(var _0x46be82=0x0,_0x20b00e=_0x20a259[_0x5029('0x34')];_0x46be82<_0x20b00e;_0x46be82++){if(_0x20a259[_0x46be82][_0x5029('0x68')]==_0x57b4e7[_0xe0aa6d]['id']&&_0x412d00['hasOwnProperty'](_0x20a259[_0x46be82][_0x5029('0x65')])){_0x546b19[_0x412d00[_0x20a259[_0x46be82][_0x5029('0x65')]]]=_0x20a259[_0x46be82][_0x5029('0x69')];}}for(var _0x349b18 in _0x412d00){if(!_0x546b19[_0x5029('0x35')](_0x412d00[_0x349b18])){_0x546b19[_0x412d00[_0x349b18]]=null;}}_0x34494c[_0x5029('0x6a')](_0x546b19);}return _0x34494c;}})[_0x5029('0x1e')](function(_0xdd5b9c){if(!_['isEmpty'](_0xdd5b9c)){var _0x53150a=toCsv(_0xdd5b9c);var _0x3a3737=Date[_0x5029('0x6b')]();fs[_0x5029('0x6c')](util[_0x5029('0x6d')](_0x5029('0x6e'),_0x51aaad['params']['id'],_0x3a3737),_0x53150a);_0x523bee[_0x5029('0x6f')]('Content-disposition',_0x5029('0x70')+util[_0x5029('0x6d')](_0x5029('0x71'),_0x51aaad[_0x5029('0x46')]['id'],_0x3a3737));_0x523bee[_0x5029('0x6f')](_0x5029('0x72'),'text/csv');return _0x523bee[_0x5029('0x73')](util[_0x5029('0x6d')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x51aaad[_0x5029('0x46')]['id'],_0x3a3737));}else{return _0x523bee[_0x5029('0x23')](0xcc);}})['catch'](handleError(_0x523bee,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 78cf1d8..2584a3d 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 _0x0e4e=['bluebird','request-promise','path','../../config/environment','./jscriptyProject.attributes','exports','define','jscripty_projects','util','../../config/logger','moment'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0x0e4e,0xb8));var _0xe0e4=function(_0x519228,_0x2bcbc2){_0x519228=_0x519228-0x0;var _0xc3c605=_0x0e4e[_0x519228];return _0xc3c605;};'use strict';var _=require('lodash');var util=require(_0xe0e4('0x0'));var logger=require(_0xe0e4('0x1'))('api');var moment=require(_0xe0e4('0x2'));var BPromise=require(_0xe0e4('0x3'));var rp=require(_0xe0e4('0x4'));var fs=require('fs');var path=require(_0xe0e4('0x5'));var rimraf=require('rimraf');var config=require(_0xe0e4('0x6'));var attributes=require(_0xe0e4('0x7'));module[_0xe0e4('0x8')]=function(_0x396679,_0x135db1){return _0x396679[_0xe0e4('0x9')]('JscriptyProject',attributes,{'tableName':_0xe0e4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x67b1=['../../config/environment','./jscriptyProject.attributes','exports','define','JscriptyProject','jscripty_projects','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x67b1,0xfd));var _0x167b=function(_0x3eb630,_0x552586){_0x3eb630=_0x3eb630-0x0;var _0x1b840d=_0x67b1[_0x3eb630];return _0x1b840d;};'use strict';var _=require('lodash');var util=require(_0x167b('0x0'));var logger=require(_0x167b('0x1'))(_0x167b('0x2'));var moment=require(_0x167b('0x3'));var BPromise=require('bluebird');var rp=require(_0x167b('0x4'));var fs=require('fs');var path=require(_0x167b('0x5'));var rimraf=require(_0x167b('0x6'));var config=require(_0x167b('0x7'));var attributes=require(_0x167b('0x8'));module[_0x167b('0x9')]=function(_0x344517,_0x124b37){return _0x344517[_0x167b('0xa')](_0x167b('0xb'),attributes,{'tableName':_0x167b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.rpc.js b/server/api/jscriptyProject/jscriptyProject.rpc.js index 29d024b..6c2fd3a 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 _0x6a2e=['message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','JscriptyProject,\x20%s,\x20%s,\x20%s','error'];(function(_0x1ba43c,_0x5bd2e8){var _0x2f60eb=function(_0x349dff){while(--_0x349dff){_0x1ba43c['push'](_0x1ba43c['shift']());}};_0x2f60eb(++_0x5bd2e8);}(_0x6a2e,0x1e6));var _0xe6a2=function(_0x348b2a,_0x1bfda4){_0x348b2a=_0x348b2a-0x0;var _0x33e0dd=_0x6a2e[_0x348b2a];return _0x33e0dd;};'use strict';var _=require(_0xe6a2('0x0'));var util=require(_0xe6a2('0x1'));var moment=require(_0xe6a2('0x2'));var BPromise=require(_0xe6a2('0x3'));var rs=require(_0xe6a2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe6a2('0x5'))['db'];var utils=require(_0xe6a2('0x6'));var logger=require(_0xe6a2('0x7'))(_0xe6a2('0x8'));var config=require(_0xe6a2('0x9'));var jayson=require(_0xe6a2('0xa'));var client=jayson[_0xe6a2('0xb')][_0xe6a2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4f7fd9,_0x41b592,_0x535a09){return new BPromise(function(_0x50f1ce,_0x25a263){return client[_0xe6a2('0xd')](_0x4f7fd9,_0x535a09)[_0xe6a2('0xe')](function(_0x44f9c2){logger[_0xe6a2('0xf')](_0xe6a2('0x10'),_0x41b592,_0xe6a2('0x11'));logger['debug'](_0xe6a2('0x12'),_0x41b592,_0xe6a2('0x11'),JSON['stringify'](_0x44f9c2));if(_0x44f9c2[_0xe6a2('0x13')]){if(_0x44f9c2[_0xe6a2('0x13')]['code']===0x1f4){logger[_0xe6a2('0x13')](_0xe6a2('0x10'),_0x41b592,_0x44f9c2[_0xe6a2('0x13')][_0xe6a2('0x14')]);return _0x25a263(_0x44f9c2[_0xe6a2('0x13')][_0xe6a2('0x14')]);}logger[_0xe6a2('0x13')](_0xe6a2('0x10'),_0x41b592,_0x44f9c2[_0xe6a2('0x13')][_0xe6a2('0x14')]);return _0x50f1ce(_0x44f9c2[_0xe6a2('0x13')]['message']);}else{logger[_0xe6a2('0xf')](_0xe6a2('0x10'),_0x41b592,_0xe6a2('0x11'));_0x50f1ce(_0x44f9c2[_0xe6a2('0x15')][_0xe6a2('0x14')]);}})[_0xe6a2('0x16')](function(_0x2e26b4){logger[_0xe6a2('0x13')](_0xe6a2('0x10'),_0x41b592,_0x2e26b4);_0x25a263(_0x2e26b4);});});} \ No newline at end of file +var _0xc74c=['result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','error','code','message','info'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0xc74c,0x1b9));var _0xcc74=function(_0xf417aa,_0x1433b8){_0xf417aa=_0xf417aa-0x0;var _0x1ed21c=_0xc74c[_0xf417aa];return _0x1ed21c;};'use strict';var _=require('lodash');var util=require(_0xcc74('0x0'));var moment=require(_0xcc74('0x1'));var BPromise=require(_0xcc74('0x2'));var rs=require(_0xcc74('0x3'));var fs=require('fs');var Redis=require(_0xcc74('0x4'));var db=require(_0xcc74('0x5'))['db'];var utils=require(_0xcc74('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xcc74('0x7'));var client=jayson[_0xcc74('0x8')][_0xcc74('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x157ea1,_0x2ee434,_0x38fab7){return new BPromise(function(_0x51752f,_0x4a63e9){return client[_0xcc74('0xa')](_0x157ea1,_0x38fab7)['then'](function(_0x579131){logger['info'](_0xcc74('0xb'),_0x2ee434,_0xcc74('0xc'));logger[_0xcc74('0xd')](_0xcc74('0xe'),_0x2ee434,_0xcc74('0xc'),JSON['stringify'](_0x579131));if(_0x579131[_0xcc74('0xf')]){if(_0x579131[_0xcc74('0xf')][_0xcc74('0x10')]===0x1f4){logger[_0xcc74('0xf')]('JscriptyProject,\x20%s,\x20%s',_0x2ee434,_0x579131[_0xcc74('0xf')][_0xcc74('0x11')]);return _0x4a63e9(_0x579131[_0xcc74('0xf')][_0xcc74('0x11')]);}logger[_0xcc74('0xf')](_0xcc74('0xb'),_0x2ee434,_0x579131[_0xcc74('0xf')][_0xcc74('0x11')]);return _0x51752f(_0x579131[_0xcc74('0xf')]['message']);}else{logger[_0xcc74('0x12')](_0xcc74('0xb'),_0x2ee434,_0xcc74('0xc'));_0x51752f(_0x579131[_0xcc74('0x13')]['message']);}})['catch'](function(_0x4836de){logger['error'](_0xcc74('0xb'),_0x2ee434,_0x4836de);_0x4a63e9(_0x4836de);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 74ba94e..8d08231 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 _0xd41b=['/:id','show','post','create','put','update','delete','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','describe'];(function(_0x47b563,_0x1a6699){var _0x18d8af=function(_0x421035){while(--_0x421035){_0x47b563['push'](_0x47b563['shift']());}};_0x18d8af(++_0x1a6699);}(_0xd41b,0x9f));var _0xbd41=function(_0x3aab49,_0x5eea98){_0x3aab49=_0x3aab49-0x0;var _0xf0c971=_0xd41b[_0x3aab49];return _0xf0c971;};'use strict';var multer=require(_0xbd41('0x0'));var util=require('util');var path=require(_0xbd41('0x1'));var timeout=require(_0xbd41('0x2'));var express=require(_0xbd41('0x3'));var router=express[_0xbd41('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xbd41('0x5'));var config=require(_0xbd41('0x6'));var controller=require(_0xbd41('0x7'));router[_0xbd41('0x8')]('/',auth[_0xbd41('0x9')](),controller[_0xbd41('0xa')]);router[_0xbd41('0x8')]('/describe',auth[_0xbd41('0x9')](),controller[_0xbd41('0xb')]);router[_0xbd41('0x8')](_0xbd41('0xc'),auth['isAuthenticated'](),controller[_0xbd41('0xd')]);router[_0xbd41('0xe')]('/',auth['isAuthenticated'](),controller[_0xbd41('0xf')]);router[_0xbd41('0x10')]('/:id',auth[_0xbd41('0x9')](),controller[_0xbd41('0x11')]);router[_0xbd41('0x12')](_0xbd41('0xc'),auth[_0xbd41('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xa827=['/:id','show','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','/describe','describe'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa827,0xc6));var _0x7a82=function(_0x28019e,_0x1647e3){_0x28019e=_0x28019e-0x0;var _0x4a2c17=_0xa827[_0x28019e];return _0x4a2c17;};'use strict';var multer=require('multer');var util=require(_0x7a82('0x0'));var path=require(_0x7a82('0x1'));var timeout=require(_0x7a82('0x2'));var express=require(_0x7a82('0x3'));var router=express['Router']();var auth=require(_0x7a82('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x7a82('0x5'));var controller=require(_0x7a82('0x6'));router[_0x7a82('0x7')]('/',auth[_0x7a82('0x8')](),controller['index']);router[_0x7a82('0x7')](_0x7a82('0x9'),auth[_0x7a82('0x8')](),controller[_0x7a82('0xa')]);router[_0x7a82('0x7')](_0x7a82('0xb'),auth[_0x7a82('0x8')](),controller[_0x7a82('0xc')]);router['post']('/',auth[_0x7a82('0x8')](),controller[_0x7a82('0xd')]);router[_0x7a82('0xe')](_0x7a82('0xb'),auth['isAuthenticated'](),controller[_0x7a82('0xf')]);router[_0x7a82('0x10')]('/:id',auth[_0x7a82('0x8')](),controller[_0x7a82('0x11')]);module[_0x7a82('0x12')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 4411fa0..9d6579f 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 _0x7c97=['long','sequelize','exports','STRING','TEXT'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7c97,0x1c3));var _0x77c9=function(_0x5bb3d9,_0x2912cb){_0x5bb3d9=_0x5bb3d9-0x0;var _0x5dcdae=_0x7c97[_0x5bb3d9];return _0x5dcdae;};'use strict';var Sequelize=require(_0x77c9('0x0'));module[_0x77c9('0x1')]={'question':{'type':Sequelize[_0x77c9('0x2')]},'answer':{'type':Sequelize[_0x77c9('0x3')](_0x77c9('0x4'))},'membername':{'type':Sequelize[_0x77c9('0x2')]},'projectname':{'type':Sequelize[_0x77c9('0x2')]},'queue':{'type':Sequelize[_0x77c9('0x2')]},'uniqueid':{'type':Sequelize[_0x77c9('0x2')]},'calleridname':{'type':Sequelize[_0x77c9('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'questionId':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2842=['long','STRING','exports','TEXT'];(function(_0xfc3efb,_0x58aa14){var _0xfcd987=function(_0x4b80ce){while(--_0x4b80ce){_0xfc3efb['push'](_0xfc3efb['shift']());}};_0xfcd987(++_0x58aa14);}(_0x2842,0x1de));var _0x2284=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x2842[_0xbca1b1];return _0x4e1686;};'use strict';var Sequelize=require('sequelize');module[_0x2284('0x0')]={'question':{'type':Sequelize['STRING']},'answer':{'type':Sequelize[_0x2284('0x1')](_0x2284('0x2'))},'membername':{'type':Sequelize[_0x2284('0x3')]},'projectname':{'type':Sequelize[_0x2284('0x3')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x2284('0x3')]},'calleridname':{'type':Sequelize[_0x2284('0x3')]},'calleridnum':{'type':Sequelize[_0x2284('0x3')]},'questionId':{'type':Sequelize[_0x2284('0x3')]}}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js index ccf712c..f271bd3 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 _0x6aa7=['describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','JscriptyQuestionReport','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','filter','where','VIRTUAL','field','merge','options','count','findAll','catch','show','includeAll','find','create','body','params'];(function(_0xc37c76,_0xfe50f6){var _0x1a5f01=function(_0x87668){while(--_0x87668){_0xc37c76['push'](_0xc37c76['shift']());}};_0x1a5f01(++_0xfe50f6);}(_0x6aa7,0x178));var _0x76aa=function(_0x5ba6f9,_0x4eb9ae){_0x5ba6f9=_0x5ba6f9-0x0;var _0x4b53a2=_0x6aa7[_0x5ba6f9];return _0x4b53a2;};'use strict';var pdf=require(_0x76aa('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x76aa('0x1'));var zipdir=require(_0x76aa('0x2'));var jsonpatch=require(_0x76aa('0x3'));var rp=require(_0x76aa('0x4'));var moment=require('moment');var BPromise=require(_0x76aa('0x5'));var Mustache=require(_0x76aa('0x6'));var util=require(_0x76aa('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x76aa('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x76aa('0x9'));var squel=require(_0x76aa('0xa'));var crypto=require(_0x76aa('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x76aa('0xc'));var toCsv=require(_0x76aa('0x8'));var querystring=require(_0x76aa('0xd'));var Papa=require('papaparse');var Redis=require(_0x76aa('0xe'));var authService=require(_0x76aa('0xf'));var qs=require(_0x76aa('0x10'));var as=require(_0x76aa('0x11'));var hardwareService=require(_0x76aa('0x12'));var logger=require(_0x76aa('0x13'))(_0x76aa('0x14'));var utils=require(_0x76aa('0x15'));var config=require(_0x76aa('0x16'));var db=require(_0x76aa('0x17'))['db'];function respondWithStatusCode(_0x5e5f47,_0x112c39){_0x112c39=_0x112c39||0xcc;return function(_0x5df49c){if(_0x5df49c){return _0x5e5f47[_0x76aa('0x18')](_0x112c39);}return _0x5e5f47[_0x76aa('0x19')](_0x112c39)[_0x76aa('0x1a')]();};}function respondWithResult(_0x8e44ed,_0x10432c){_0x10432c=_0x10432c||0xc8;return function(_0x4e309f){if(_0x4e309f){return _0x8e44ed['status'](_0x10432c)[_0x76aa('0x1b')](_0x4e309f);}};}function respondWithFilteredResult(_0x4cfc34,_0x180d92){return function(_0x319bf1){if(_0x319bf1){var _0x5cf594=_0x319bf1['count'],_0x2111c7=_0x180d92[_0x76aa('0x1c')],_0x550d9a=_0x180d92[_0x76aa('0x1c')]+_0x180d92[_0x76aa('0x1d')],_0x328381;if(_0x550d9a>=_0x5cf594){_0x550d9a=_0x5cf594;_0x328381=0xc8;}else{_0x328381=0xce;}_0x4cfc34[_0x76aa('0x19')](_0x328381);return _0x4cfc34[_0x76aa('0x1e')](_0x76aa('0x1f'),_0x2111c7+'-'+_0x550d9a+'/'+_0x5cf594)['json'](_0x319bf1);}return null;};}function patchUpdates(_0x5d6202){return function(_0x256636){try{jsonpatch[_0x76aa('0x20')](_0x256636,_0x5d6202,!![]);}catch(_0xf0711){return BPromise[_0x76aa('0x21')](_0xf0711);}return _0x256636[_0x76aa('0x22')]();};}function saveUpdates(_0x191560,_0x19af92){return function(_0x2eaf48){if(_0x2eaf48){return _0x2eaf48[_0x76aa('0x23')](_0x191560)['then'](function(_0x39ac5a){return _0x39ac5a;});}return null;};}function removeEntity(_0x21064c,_0x338a6b){return function(_0x5b3f55){if(_0x5b3f55){return _0x5b3f55[_0x76aa('0x24')]()[_0x76aa('0x25')](function(){_0x21064c[_0x76aa('0x19')](0xcc)[_0x76aa('0x1a')]();});}};}function handleEntityNotFound(_0x29c50c,_0xc1044c){return function(_0x3cd039){if(!_0x3cd039){_0x29c50c[_0x76aa('0x18')](0x194);}return _0x3cd039;};}function handleError(_0x32bf9f,_0x2cba6d){_0x2cba6d=_0x2cba6d||0x1f4;return function(_0x37f1ab){logger[_0x76aa('0x26')](_0x37f1ab[_0x76aa('0x27')]);if(_0x37f1ab['name']){delete _0x37f1ab[_0x76aa('0x28')];}_0x32bf9f[_0x76aa('0x19')](_0x2cba6d)[_0x76aa('0x29')](_0x37f1ab);};}exports[_0x76aa('0x2a')]=function(_0xa1e6,_0x2f9316){var _0x25a803={},_0x282d0a={},_0xd12a99={'count':0x0,'rows':[]};var _0x1bdc3d=_['map'](db[_0x76aa('0x2b')]['rawAttributes'],function(_0x994550){return{'name':_0x994550[_0x76aa('0x2c')],'type':_0x994550[_0x76aa('0x2d')][_0x76aa('0x2e')]};});_0x282d0a[_0x76aa('0x2f')]=_[_0x76aa('0x30')](_0x1bdc3d,_0x76aa('0x28'));_0x282d0a[_0x76aa('0x31')]=_[_0x76aa('0x32')](_0xa1e6[_0x76aa('0x31')]);_0x282d0a['filters']=_[_0x76aa('0x33')](_0x282d0a[_0x76aa('0x2f')],_0x282d0a[_0x76aa('0x31')]);_0x25a803[_0x76aa('0x34')]=_[_0x76aa('0x33')](_0x282d0a[_0x76aa('0x2f')],qs[_0x76aa('0x35')](_0xa1e6['query'][_0x76aa('0x35')]));_0x25a803[_0x76aa('0x34')]=_0x25a803['attributes'][_0x76aa('0x36')]?_0x25a803['attributes']:_0x282d0a[_0x76aa('0x2f')];if(!_0xa1e6['query'][_0x76aa('0x37')]('nolimit')){_0x25a803['limit']=qs[_0x76aa('0x1d')](_0xa1e6[_0x76aa('0x31')][_0x76aa('0x1d')]);_0x25a803[_0x76aa('0x1c')]=qs['offset'](_0xa1e6['query'][_0x76aa('0x1c')]);}_0x25a803[_0x76aa('0x38')]=qs[_0x76aa('0x39')](_0xa1e6[_0x76aa('0x31')][_0x76aa('0x39')]);_0x25a803['where']=qs[_0x76aa('0x3a')](_['pick'](_0xa1e6['query'],_0x282d0a[_0x76aa('0x3a')]));if(_0xa1e6[_0x76aa('0x31')][_0x76aa('0x3b')]){_0x25a803[_0x76aa('0x3c')]=_['merge'](_0x25a803[_0x76aa('0x3c')],{'$or':_[_0x76aa('0x30')](_0x1bdc3d,function(_0x2eea79){if(_0x2eea79['type'][_0x76aa('0x2e')]!==_0x76aa('0x3d')){var _0x2f7726={};_0x2f7726[_0x2eea79[_0x76aa('0x3e')]]={'$like':'%'+_0xa1e6[_0x76aa('0x31')][_0x76aa('0x3b')]+'%'};return _0x2f7726;}})});}_0x25a803=_[_0x76aa('0x3f')]({},_0x25a803,_0xa1e6[_0x76aa('0x40')]);var _0x283179={'where':_0x25a803['where']};return db[_0x76aa('0x2b')][_0x76aa('0x41')](_0x283179)[_0x76aa('0x25')](function(_0xa824e8){_0xd12a99[_0x76aa('0x41')]=_0xa824e8;if(_0xa1e6[_0x76aa('0x31')]['includeAll']){_0x25a803['include']=[{'all':!![]}];}return db[_0x76aa('0x2b')][_0x76aa('0x42')](_0x25a803);})[_0x76aa('0x25')](function(_0x365612){_0xd12a99['rows']=_0x365612;return _0xd12a99;})[_0x76aa('0x25')](respondWithFilteredResult(_0x2f9316,_0x25a803))[_0x76aa('0x43')](handleError(_0x2f9316,null));};exports[_0x76aa('0x44')]=function(_0x30cdcb,_0x1138b5){var _0x4aa2f3={'raw':!![],'where':{'id':_0x30cdcb['params']['id']}},_0x13dafe={};_0x13dafe[_0x76aa('0x2f')]=_['keys'](db['JscriptyQuestionReport']['rawAttributes']);_0x13dafe[_0x76aa('0x31')]=_['keys'](_0x30cdcb['query']);_0x13dafe['filters']=_[_0x76aa('0x33')](_0x13dafe[_0x76aa('0x2f')],_0x13dafe[_0x76aa('0x31')]);_0x4aa2f3[_0x76aa('0x34')]=_[_0x76aa('0x33')](_0x13dafe['model'],qs[_0x76aa('0x35')](_0x30cdcb[_0x76aa('0x31')][_0x76aa('0x35')]));_0x4aa2f3[_0x76aa('0x34')]=_0x4aa2f3[_0x76aa('0x34')]['length']?_0x4aa2f3[_0x76aa('0x34')]:_0x13dafe[_0x76aa('0x2f')];if(_0x30cdcb['query'][_0x76aa('0x45')]){_0x4aa2f3['include']=[{'all':!![]}];}_0x4aa2f3=_[_0x76aa('0x3f')]({},_0x4aa2f3,_0x30cdcb[_0x76aa('0x40')]);return db[_0x76aa('0x2b')][_0x76aa('0x46')](_0x4aa2f3)[_0x76aa('0x25')](handleEntityNotFound(_0x1138b5,null))[_0x76aa('0x25')](respondWithResult(_0x1138b5,null))[_0x76aa('0x43')](handleError(_0x1138b5,null));};exports[_0x76aa('0x47')]=function(_0xb8d052,_0x3946bd){return db['JscriptyQuestionReport'][_0x76aa('0x47')](_0xb8d052['body'],{})[_0x76aa('0x25')](respondWithResult(_0x3946bd,0xc9))[_0x76aa('0x43')](handleError(_0x3946bd,null));};exports[_0x76aa('0x23')]=function(_0x156d4e,_0x5ca721){if(_0x156d4e['body']['id']){delete _0x156d4e[_0x76aa('0x48')]['id'];}return db['JscriptyQuestionReport'][_0x76aa('0x46')]({'where':{'id':_0x156d4e[_0x76aa('0x49')]['id']}})[_0x76aa('0x25')](handleEntityNotFound(_0x5ca721,null))[_0x76aa('0x25')](saveUpdates(_0x156d4e[_0x76aa('0x48')],null))[_0x76aa('0x25')](respondWithResult(_0x5ca721,null))['catch'](handleError(_0x5ca721,null));};exports['destroy']=function(_0x2fcf8f,_0x1eafb2){return db[_0x76aa('0x2b')][_0x76aa('0x46')]({'where':{'id':_0x2fcf8f[_0x76aa('0x49')]['id']}})[_0x76aa('0x25')](handleEntityNotFound(_0x1eafb2,null))['then'](removeEntity(_0x1eafb2,null))[_0x76aa('0x43')](handleError(_0x1eafb2,null));};exports[_0x76aa('0x4a')]=function(_0x26db69,_0x4b3d2a){return db[_0x76aa('0x2b')]['describe']()[_0x76aa('0x25')](respondWithResult(_0x4b3d2a,null))['catch'](handleError(_0x4b3d2a,null));}; \ No newline at end of file +var _0x4bc3=['params','find','catch','create','body','describe','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','end','json','limit','status','set','Content-Range','reject','update','then','destroy','error','stack','name','send','JscriptyQuestionReport','rawAttributes','fieldName','type','key','map','query','keys','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','offset','sort','where','merge','VIRTUAL','field','filter','options','count','include','findAll','rows','show'];(function(_0x28f153,_0x4852ed){var _0x56b861=function(_0x3cbf02){while(--_0x3cbf02){_0x28f153['push'](_0x28f153['shift']());}};_0x56b861(++_0x4852ed);}(_0x4bc3,0x16e));var _0x34bc=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x4bc3[_0x1928c9];return _0x51b5fb;};'use strict';var pdf=require(_0x34bc('0x0'));var emlformat=require(_0x34bc('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x34bc('0x2'));var jsonpatch=require(_0x34bc('0x3'));var rp=require('request-promise');var moment=require(_0x34bc('0x4'));var BPromise=require(_0x34bc('0x5'));var Mustache=require(_0x34bc('0x6'));var util=require(_0x34bc('0x7'));var path=require(_0x34bc('0x8'));var sox=require(_0x34bc('0x9'));var csv=require(_0x34bc('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x34bc('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x34bc('0xc'));var deskjs=require(_0x34bc('0xd'));var toCsv=require(_0x34bc('0xa'));var querystring=require(_0x34bc('0xe'));var Papa=require(_0x34bc('0xf'));var Redis=require(_0x34bc('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x34bc('0x11'));var hardwareService=require(_0x34bc('0x12'));var logger=require(_0x34bc('0x13'))('api');var utils=require(_0x34bc('0x14'));var config=require('../../config/environment');var db=require(_0x34bc('0x15'))['db'];function respondWithStatusCode(_0x124b87,_0x164fb2){_0x164fb2=_0x164fb2||0xcc;return function(_0x536ebd){if(_0x536ebd){return _0x124b87[_0x34bc('0x16')](_0x164fb2);}return _0x124b87['status'](_0x164fb2)[_0x34bc('0x17')]();};}function respondWithResult(_0x43ff68,_0xc77013){_0xc77013=_0xc77013||0xc8;return function(_0x5a22a3){if(_0x5a22a3){return _0x43ff68['status'](_0xc77013)[_0x34bc('0x18')](_0x5a22a3);}};}function respondWithFilteredResult(_0x5e691b,_0x3e93bf){return function(_0x217605){if(_0x217605){var _0x1da8eb=_0x217605['count'],_0x25da29=_0x3e93bf['offset'],_0x2db2dd=_0x3e93bf['offset']+_0x3e93bf[_0x34bc('0x19')],_0x69542f;if(_0x2db2dd>=_0x1da8eb){_0x2db2dd=_0x1da8eb;_0x69542f=0xc8;}else{_0x69542f=0xce;}_0x5e691b[_0x34bc('0x1a')](_0x69542f);return _0x5e691b[_0x34bc('0x1b')](_0x34bc('0x1c'),_0x25da29+'-'+_0x2db2dd+'/'+_0x1da8eb)['json'](_0x217605);}return null;};}function patchUpdates(_0x46aa24){return function(_0x3ca9e8){try{jsonpatch['apply'](_0x3ca9e8,_0x46aa24,!![]);}catch(_0x2b069b){return BPromise[_0x34bc('0x1d')](_0x2b069b);}return _0x3ca9e8['save']();};}function saveUpdates(_0x14cec8,_0x26cdec){return function(_0x2d18ea){if(_0x2d18ea){return _0x2d18ea[_0x34bc('0x1e')](_0x14cec8)[_0x34bc('0x1f')](function(_0x42c814){return _0x42c814;});}return null;};}function removeEntity(_0x48087e,_0x40e128){return function(_0x3c9939){if(_0x3c9939){return _0x3c9939[_0x34bc('0x20')]()['then'](function(){_0x48087e['status'](0xcc)[_0x34bc('0x17')]();});}};}function handleEntityNotFound(_0x1b820a,_0x4263de){return function(_0x410800){if(!_0x410800){_0x1b820a[_0x34bc('0x16')](0x194);}return _0x410800;};}function handleError(_0x2e22e3,_0x3f3653){_0x3f3653=_0x3f3653||0x1f4;return function(_0x3294aa){logger[_0x34bc('0x21')](_0x3294aa[_0x34bc('0x22')]);if(_0x3294aa[_0x34bc('0x23')]){delete _0x3294aa[_0x34bc('0x23')];}_0x2e22e3['status'](_0x3f3653)[_0x34bc('0x24')](_0x3294aa);};}exports['index']=function(_0x4b76c7,_0x3da96b){var _0x5332c8={},_0x4082c3={},_0x446b58={'count':0x0,'rows':[]};var _0x46fd76=_['map'](db[_0x34bc('0x25')][_0x34bc('0x26')],function(_0x384fd7){return{'name':_0x384fd7[_0x34bc('0x27')],'type':_0x384fd7[_0x34bc('0x28')][_0x34bc('0x29')]};});_0x4082c3['model']=_[_0x34bc('0x2a')](_0x46fd76,_0x34bc('0x23'));_0x4082c3[_0x34bc('0x2b')]=_[_0x34bc('0x2c')](_0x4b76c7[_0x34bc('0x2b')]);_0x4082c3[_0x34bc('0x2d')]=_['intersection'](_0x4082c3[_0x34bc('0x2e')],_0x4082c3['query']);_0x5332c8['attributes']=_[_0x34bc('0x2f')](_0x4082c3['model'],qs[_0x34bc('0x30')](_0x4b76c7[_0x34bc('0x2b')][_0x34bc('0x30')]));_0x5332c8[_0x34bc('0x31')]=_0x5332c8[_0x34bc('0x31')][_0x34bc('0x32')]?_0x5332c8[_0x34bc('0x31')]:_0x4082c3['model'];if(!_0x4b76c7[_0x34bc('0x2b')][_0x34bc('0x33')](_0x34bc('0x34'))){_0x5332c8[_0x34bc('0x19')]=qs[_0x34bc('0x19')](_0x4b76c7['query'][_0x34bc('0x19')]);_0x5332c8[_0x34bc('0x35')]=qs[_0x34bc('0x35')](_0x4b76c7[_0x34bc('0x2b')][_0x34bc('0x35')]);}_0x5332c8['order']=qs['sort'](_0x4b76c7[_0x34bc('0x2b')][_0x34bc('0x36')]);_0x5332c8[_0x34bc('0x37')]=qs[_0x34bc('0x2d')](_['pick'](_0x4b76c7[_0x34bc('0x2b')],_0x4082c3[_0x34bc('0x2d')]));if(_0x4b76c7[_0x34bc('0x2b')]['filter']){_0x5332c8[_0x34bc('0x37')]=_[_0x34bc('0x38')](_0x5332c8[_0x34bc('0x37')],{'$or':_[_0x34bc('0x2a')](_0x46fd76,function(_0x53a43a){if(_0x53a43a[_0x34bc('0x28')][_0x34bc('0x29')]!==_0x34bc('0x39')){var _0x4ddef6={};_0x4ddef6[_0x53a43a[_0x34bc('0x3a')]]={'$like':'%'+_0x4b76c7[_0x34bc('0x2b')][_0x34bc('0x3b')]+'%'};return _0x4ddef6;}})});}_0x5332c8=_[_0x34bc('0x38')]({},_0x5332c8,_0x4b76c7[_0x34bc('0x3c')]);var _0x4fc2dc={'where':_0x5332c8[_0x34bc('0x37')]};return db[_0x34bc('0x25')][_0x34bc('0x3d')](_0x4fc2dc)[_0x34bc('0x1f')](function(_0xbaf32){_0x446b58['count']=_0xbaf32;if(_0x4b76c7[_0x34bc('0x2b')]['includeAll']){_0x5332c8[_0x34bc('0x3e')]=[{'all':!![]}];}return db[_0x34bc('0x25')][_0x34bc('0x3f')](_0x5332c8);})[_0x34bc('0x1f')](function(_0x53feca){_0x446b58[_0x34bc('0x40')]=_0x53feca;return _0x446b58;})[_0x34bc('0x1f')](respondWithFilteredResult(_0x3da96b,_0x5332c8))['catch'](handleError(_0x3da96b,null));};exports[_0x34bc('0x41')]=function(_0x2d30f6,_0xa2cbd0){var _0x49f325={'raw':!![],'where':{'id':_0x2d30f6[_0x34bc('0x42')]['id']}},_0x31afd3={};_0x31afd3[_0x34bc('0x2e')]=_[_0x34bc('0x2c')](db[_0x34bc('0x25')][_0x34bc('0x26')]);_0x31afd3[_0x34bc('0x2b')]=_[_0x34bc('0x2c')](_0x2d30f6[_0x34bc('0x2b')]);_0x31afd3[_0x34bc('0x2d')]=_[_0x34bc('0x2f')](_0x31afd3['model'],_0x31afd3['query']);_0x49f325[_0x34bc('0x31')]=_[_0x34bc('0x2f')](_0x31afd3[_0x34bc('0x2e')],qs[_0x34bc('0x30')](_0x2d30f6[_0x34bc('0x2b')][_0x34bc('0x30')]));_0x49f325['attributes']=_0x49f325[_0x34bc('0x31')]['length']?_0x49f325[_0x34bc('0x31')]:_0x31afd3[_0x34bc('0x2e')];if(_0x2d30f6[_0x34bc('0x2b')]['includeAll']){_0x49f325[_0x34bc('0x3e')]=[{'all':!![]}];}_0x49f325=_[_0x34bc('0x38')]({},_0x49f325,_0x2d30f6[_0x34bc('0x3c')]);return db[_0x34bc('0x25')][_0x34bc('0x43')](_0x49f325)[_0x34bc('0x1f')](handleEntityNotFound(_0xa2cbd0,null))[_0x34bc('0x1f')](respondWithResult(_0xa2cbd0,null))[_0x34bc('0x44')](handleError(_0xa2cbd0,null));};exports[_0x34bc('0x45')]=function(_0x4257df,_0x100c70){return db[_0x34bc('0x25')]['create'](_0x4257df['body'],{})[_0x34bc('0x1f')](respondWithResult(_0x100c70,0xc9))[_0x34bc('0x44')](handleError(_0x100c70,null));};exports[_0x34bc('0x1e')]=function(_0x51116e,_0x4aafd4){if(_0x51116e[_0x34bc('0x46')]['id']){delete _0x51116e[_0x34bc('0x46')]['id'];}return db[_0x34bc('0x25')]['find']({'where':{'id':_0x51116e[_0x34bc('0x42')]['id']}})[_0x34bc('0x1f')](handleEntityNotFound(_0x4aafd4,null))['then'](saveUpdates(_0x51116e[_0x34bc('0x46')],null))['then'](respondWithResult(_0x4aafd4,null))[_0x34bc('0x44')](handleError(_0x4aafd4,null));};exports['destroy']=function(_0x281d6f,_0xbed144){return db[_0x34bc('0x25')][_0x34bc('0x43')]({'where':{'id':_0x281d6f['params']['id']}})[_0x34bc('0x1f')](handleEntityNotFound(_0xbed144,null))[_0x34bc('0x1f')](removeEntity(_0xbed144,null))[_0x34bc('0x44')](handleError(_0xbed144,null));};exports[_0x34bc('0x47')]=function(_0x13ce50,_0x943e1c){return db[_0x34bc('0x25')][_0x34bc('0x47')]()['then'](respondWithResult(_0x943e1c,null))['catch'](handleError(_0x943e1c,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 28cfdef..6edbdb3 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 _0xd554=['api','bluebird','request-promise','path','../../config/environment','./jscriptyQuestionReport.attributes','define','JscriptyQuestionReport','report_jscripty_questions','lodash','util','../../config/logger'];(function(_0x20190a,_0x51bb1f){var _0xd1b341=function(_0x4c22d5){while(--_0x4c22d5){_0x20190a['push'](_0x20190a['shift']());}};_0xd1b341(++_0x51bb1f);}(_0xd554,0x81));var _0x4d55=function(_0x1662ff,_0x163e0f){_0x1662ff=_0x1662ff-0x0;var _0x21efea=_0xd554[_0x1662ff];return _0x21efea;};'use strict';var _=require(_0x4d55('0x0'));var util=require(_0x4d55('0x1'));var logger=require(_0x4d55('0x2'))(_0x4d55('0x3'));var moment=require('moment');var BPromise=require(_0x4d55('0x4'));var rp=require(_0x4d55('0x5'));var fs=require('fs');var path=require(_0x4d55('0x6'));var rimraf=require('rimraf');var config=require(_0x4d55('0x7'));var attributes=require(_0x4d55('0x8'));module['exports']=function(_0x26e430,_0x31981b){return _0x26e430[_0x4d55('0x9')](_0x4d55('0xa'),attributes,{'tableName':_0x4d55('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7583=['./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7583,0x160));var _0x3758=function(_0x3a90b6,_0x782086){_0x3a90b6=_0x3a90b6-0x0;var _0x56f71a=_0x7583[_0x3a90b6];return _0x56f71a;};'use strict';var _=require('lodash');var util=require(_0x3758('0x0'));var logger=require(_0x3758('0x1'))(_0x3758('0x2'));var moment=require(_0x3758('0x3'));var BPromise=require(_0x3758('0x4'));var rp=require(_0x3758('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3758('0x6'));var config=require(_0x3758('0x7'));var attributes=require(_0x3758('0x8'));module[_0x3758('0x9')]=function(_0x2f25c4,_0x4b5599){return _0x2f25c4[_0x3758('0xa')](_0x3758('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 883bed8..5e68f35 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 _0x6c43=['jayson/promise','client','http','request','info','JscriptyQuestionReport,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0xefd3d0,_0x5ed02a){var _0x554c57=function(_0x52efd8){while(--_0x52efd8){_0xefd3d0['push'](_0xefd3d0['shift']());}};_0x554c57(++_0x5ed02a);}(_0x6c43,0xd4));var _0x36c4=function(_0x4f5d29,_0x58c507){_0x4f5d29=_0x4f5d29-0x0;var _0x52d907=_0x6c43[_0x4f5d29];return _0x52d907;};'use strict';var _=require('lodash');var util=require(_0x36c4('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x36c4('0x1'));var fs=require('fs');var Redis=require(_0x36c4('0x2'));var db=require(_0x36c4('0x3'))['db'];var utils=require(_0x36c4('0x4'));var logger=require(_0x36c4('0x5'))(_0x36c4('0x6'));var config=require(_0x36c4('0x7'));var jayson=require(_0x36c4('0x8'));var client=jayson[_0x36c4('0x9')][_0x36c4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x28daf0,_0x572025,_0x27d596){return new BPromise(function(_0x474885,_0x595fc1){return client[_0x36c4('0xb')](_0x28daf0,_0x27d596)['then'](function(_0x24dc3e){logger[_0x36c4('0xc')](_0x36c4('0xd'),_0x572025,'request\x20sent');logger[_0x36c4('0xe')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x572025,_0x36c4('0xf'),JSON['stringify'](_0x24dc3e));if(_0x24dc3e['error']){if(_0x24dc3e[_0x36c4('0x10')][_0x36c4('0x11')]===0x1f4){logger[_0x36c4('0x10')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x572025,_0x24dc3e[_0x36c4('0x10')][_0x36c4('0x12')]);return _0x595fc1(_0x24dc3e[_0x36c4('0x10')]['message']);}logger[_0x36c4('0x10')](_0x36c4('0xd'),_0x572025,_0x24dc3e[_0x36c4('0x10')][_0x36c4('0x12')]);return _0x474885(_0x24dc3e[_0x36c4('0x10')]['message']);}else{logger['info'](_0x36c4('0xd'),_0x572025,_0x36c4('0xf'));_0x474885(_0x24dc3e[_0x36c4('0x13')]['message']);}})['catch'](function(_0x5427e0){logger['error'](_0x36c4('0xd'),_0x572025,_0x5427e0);_0x595fc1(_0x5427e0);});});} \ No newline at end of file +var _0x9683=['http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x39346a,_0x5c3ed1){var _0x335564=function(_0x24b5c4){while(--_0x24b5c4){_0x39346a['push'](_0x39346a['shift']());}};_0x335564(++_0x5c3ed1);}(_0x9683,0x156));var _0x3968=function(_0x53a975,_0x3d6841){_0x53a975=_0x53a975-0x0;var _0x4176bf=_0x9683[_0x53a975];return _0x4176bf;};'use strict';var _=require('lodash');var util=require(_0x3968('0x0'));var moment=require(_0x3968('0x1'));var BPromise=require(_0x3968('0x2'));var rs=require(_0x3968('0x3'));var fs=require('fs');var Redis=require(_0x3968('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3968('0x5'));var logger=require(_0x3968('0x6'))('rpc');var config=require(_0x3968('0x7'));var jayson=require(_0x3968('0x8'));var client=jayson[_0x3968('0x9')][_0x3968('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xa62faf,_0xdb48f7,_0x4ec83f){return new BPromise(function(_0x3d2377,_0x226161){return client[_0x3968('0xb')](_0xa62faf,_0x4ec83f)[_0x3968('0xc')](function(_0x5aeac2){logger[_0x3968('0xd')](_0x3968('0xe'),_0xdb48f7,'request\x20sent');logger['debug']('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0xdb48f7,_0x3968('0xf'),JSON[_0x3968('0x10')](_0x5aeac2));if(_0x5aeac2[_0x3968('0x11')]){if(_0x5aeac2[_0x3968('0x11')][_0x3968('0x12')]===0x1f4){logger[_0x3968('0x11')]('JscriptyQuestionReport,\x20%s,\x20%s',_0xdb48f7,_0x5aeac2['error'][_0x3968('0x13')]);return _0x226161(_0x5aeac2[_0x3968('0x11')][_0x3968('0x13')]);}logger[_0x3968('0x11')]('JscriptyQuestionReport,\x20%s,\x20%s',_0xdb48f7,_0x5aeac2[_0x3968('0x11')][_0x3968('0x13')]);return _0x3d2377(_0x5aeac2[_0x3968('0x11')][_0x3968('0x13')]);}else{logger['info'](_0x3968('0xe'),_0xdb48f7,'request\x20sent');_0x3d2377(_0x5aeac2[_0x3968('0x14')]['message']);}})[_0x3968('0x15')](function(_0x50fc2b){logger[_0x3968('0x11')](_0x3968('0xe'),_0xdb48f7,_0x50fc2b);_0x226161(_0x50fc2b);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 58039e0..8d82db2 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 _0x2029=['getQuestions','post','create','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','index','/describe','show','/:id/questions'];(function(_0x3705fa,_0x25f295){var _0x21c2d4=function(_0x3e47ca){while(--_0x3e47ca){_0x3705fa['push'](_0x3705fa['shift']());}};_0x21c2d4(++_0x25f295);}(_0x2029,0x171));var _0x9202=function(_0x3c0c6c,_0x27e297){_0x3c0c6c=_0x3c0c6c-0x0;var _0x2706cf=_0x2029[_0x3c0c6c];return _0x2706cf;};'use strict';var multer=require(_0x9202('0x0'));var util=require(_0x9202('0x1'));var path=require('path');var timeout=require(_0x9202('0x2'));var express=require(_0x9202('0x3'));var router=express[_0x9202('0x4')]();var auth=require(_0x9202('0x5'));var interaction=require(_0x9202('0x6'));var config=require(_0x9202('0x7'));var controller=require(_0x9202('0x8'));router[_0x9202('0x9')]('/',auth[_0x9202('0xa')](),controller[_0x9202('0xb')]);router[_0x9202('0x9')](_0x9202('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x9202('0x9')]('/:id',auth[_0x9202('0xa')](),controller[_0x9202('0xd')]);router['get'](_0x9202('0xe'),auth[_0x9202('0xa')](),controller[_0x9202('0xf')]);router[_0x9202('0x10')]('/',auth[_0x9202('0xa')](),controller[_0x9202('0x11')]);router[_0x9202('0x12')](_0x9202('0x13'),auth[_0x9202('0xa')](),controller[_0x9202('0x14')]);router[_0x9202('0x15')](_0x9202('0x13'),auth[_0x9202('0xa')](),controller[_0x9202('0x16')]);module[_0x9202('0x17')]=router; \ No newline at end of file +var _0x430e=['/:id','show','/:id/questions','getQuestions','create','put','delete','destroy','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./jscriptySessionReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x4877d9,_0x2eb0b3){var _0x3cdac9=function(_0x4f5a19){while(--_0x4f5a19){_0x4877d9['push'](_0x4877d9['shift']());}};_0x3cdac9(++_0x2eb0b3);}(_0x430e,0x105));var _0xe430=function(_0x9d9f9e,_0x52a029){_0x9d9f9e=_0x9d9f9e-0x0;var _0x48cb13=_0x430e[_0x9d9f9e];return _0x48cb13;};'use strict';var multer=require('multer');var util=require(_0xe430('0x0'));var path=require(_0xe430('0x1'));var timeout=require('connect-timeout');var express=require(_0xe430('0x2'));var router=express[_0xe430('0x3')]();var auth=require(_0xe430('0x4'));var interaction=require(_0xe430('0x5'));var config=require('../../config/environment');var controller=require(_0xe430('0x6'));router[_0xe430('0x7')]('/',auth[_0xe430('0x8')](),controller[_0xe430('0x9')]);router['get'](_0xe430('0xa'),auth[_0xe430('0x8')](),controller[_0xe430('0xb')]);router[_0xe430('0x7')](_0xe430('0xc'),auth['isAuthenticated'](),controller[_0xe430('0xd')]);router[_0xe430('0x7')](_0xe430('0xe'),auth[_0xe430('0x8')](),controller[_0xe430('0xf')]);router['post']('/',auth[_0xe430('0x8')](),controller[_0xe430('0x10')]);router[_0xe430('0x11')](_0xe430('0xc'),auth[_0xe430('0x8')](),controller['update']);router[_0xe430('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xe430('0x13')]);module[_0xe430('0x14')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 3fbcb63..e776e2f 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 _0xea3c=['setDataValue','starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','DATE','STRING','BOOLEAN','moment','sequelize'];(function(_0x303d6e,_0x3a67b9){var _0xab077=function(_0x353d39){while(--_0x353d39){_0x303d6e['push'](_0x303d6e['shift']());}};_0xab077(++_0x3a67b9);}(_0xea3c,0xee));var _0xcea3=function(_0x2991c7,_0x484cd2){_0x2991c7=_0x2991c7-0x0;var _0x492186=_0xea3c[_0x2991c7];return _0x492186;};'use strict';var moment=require(_0xcea3('0x0'));var Sequelize=require(_0xcea3('0x1'));module['exports']={'starttime':{'type':Sequelize['DATE'],'set':function(_0x2534fa){this[_0xcea3('0x2')](_0xcea3('0x3'),_0x2534fa);this[_0xcea3('0x2')](_0xcea3('0x4'),moment()[_0xcea3('0x5')](_0xcea3('0x6')));}},'endtime':{'type':Sequelize[_0xcea3('0x7')]},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0xcea3('0x8')]},'queue':{'type':Sequelize[_0xcea3('0x8')]},'uniqueid':{'type':Sequelize[_0xcea3('0x8')]},'calleridname':{'type':Sequelize[_0xcea3('0x8')]},'calleridnum':{'type':Sequelize[_0xcea3('0x8')]},'completed':{'type':Sequelize[_0xcea3('0x9')],'defaultValue':![]}}; \ No newline at end of file +var _0x7a1a=['sequelize','exports','setDataValue','endtime','format','YYYY-MM-DD\x20HH:mm:ss','DATE','BOOLEAN','moment'];(function(_0xfdec60,_0x259059){var _0xe37222=function(_0x19105d){while(--_0x19105d){_0xfdec60['push'](_0xfdec60['shift']());}};_0xe37222(++_0x259059);}(_0x7a1a,0x10d));var _0xa7a1=function(_0x4e86dd,_0x2c4352){_0x4e86dd=_0x4e86dd-0x0;var _0x1e5752=_0x7a1a[_0x4e86dd];return _0x1e5752;};'use strict';var moment=require(_0xa7a1('0x0'));var Sequelize=require(_0xa7a1('0x1'));module[_0xa7a1('0x2')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x5ecd41){this['setDataValue']('starttime',_0x5ecd41);this[_0xa7a1('0x3')](_0xa7a1('0x4'),moment()[_0xa7a1('0x5')](_0xa7a1('0x6')));}},'endtime':{'type':Sequelize[_0xa7a1('0x7')]},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize[_0xa7a1('0x8')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 595c552..f976424 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 _0x8cf7=['save','then','destroy','end','error','stack','name','send','index','map','JscriptySessionReport','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','field','options','count','includeAll','include','rows','catch','show','rawAttributes','create','body','update','params','find','describe','getQuestions','findOne','JscriptyQuestionReport','SessionId','findAll','html-pdf','eml-format','rimraf','request-promise','moment','mustache','sox','to-csv','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','sendStatus','status','json','offset','limit','set','Content-Range','reject'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0x8cf7,0xcc));var _0x78cf=function(_0x264823,_0x68b1c7){_0x264823=_0x264823-0x0;var _0x7cfa03=_0x8cf7[_0x264823];return _0x7cfa03;};'use strict';var pdf=require(_0x78cf('0x0'));var emlformat=require(_0x78cf('0x1'));var rimraf=require(_0x78cf('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x78cf('0x3'));var moment=require(_0x78cf('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x78cf('0x5'));var util=require('util');var path=require('path');var sox=require(_0x78cf('0x6'));var csv=require(_0x78cf('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x78cf('0x8'));var squel=require(_0x78cf('0x9'));var crypto=require(_0x78cf('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x78cf('0xb'));var toCsv=require(_0x78cf('0x7'));var querystring=require('querystring');var Papa=require(_0x78cf('0xc'));var Redis=require(_0x78cf('0xd'));var authService=require(_0x78cf('0xe'));var qs=require(_0x78cf('0xf'));var as=require(_0x78cf('0x10'));var hardwareService=require(_0x78cf('0x11'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x78cf('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2874f7,_0x4afc88){_0x4afc88=_0x4afc88||0xcc;return function(_0x19666b){if(_0x19666b){return _0x2874f7[_0x78cf('0x13')](_0x4afc88);}return _0x2874f7[_0x78cf('0x14')](_0x4afc88)['end']();};}function respondWithResult(_0x278b12,_0x719c60){_0x719c60=_0x719c60||0xc8;return function(_0x31afc2){if(_0x31afc2){return _0x278b12['status'](_0x719c60)[_0x78cf('0x15')](_0x31afc2);}};}function respondWithFilteredResult(_0x3e2ed6,_0x1ff7d5){return function(_0x563218){if(_0x563218){var _0x3cf38a=_0x563218['count'],_0x282efd=_0x1ff7d5[_0x78cf('0x16')],_0x4d1385=_0x1ff7d5[_0x78cf('0x16')]+_0x1ff7d5[_0x78cf('0x17')],_0x308043;if(_0x4d1385>=_0x3cf38a){_0x4d1385=_0x3cf38a;_0x308043=0xc8;}else{_0x308043=0xce;}_0x3e2ed6[_0x78cf('0x14')](_0x308043);return _0x3e2ed6[_0x78cf('0x18')](_0x78cf('0x19'),_0x282efd+'-'+_0x4d1385+'/'+_0x3cf38a)['json'](_0x563218);}return null;};}function patchUpdates(_0x2d7d48){return function(_0x261e86){try{jsonpatch['apply'](_0x261e86,_0x2d7d48,!![]);}catch(_0x51eedc){return BPromise[_0x78cf('0x1a')](_0x51eedc);}return _0x261e86[_0x78cf('0x1b')]();};}function saveUpdates(_0x35a30d,_0x120a7c){return function(_0x286f74){if(_0x286f74){return _0x286f74['update'](_0x35a30d)[_0x78cf('0x1c')](function(_0x1f6f23){return _0x1f6f23;});}return null;};}function removeEntity(_0x106279,_0x35928e){return function(_0x37c86c){if(_0x37c86c){return _0x37c86c[_0x78cf('0x1d')]()[_0x78cf('0x1c')](function(){_0x106279[_0x78cf('0x14')](0xcc)[_0x78cf('0x1e')]();});}};}function handleEntityNotFound(_0x4e4812,_0x31fb67){return function(_0x5b442d){if(!_0x5b442d){_0x4e4812[_0x78cf('0x13')](0x194);}return _0x5b442d;};}function handleError(_0x164cf7,_0x4b9fcf){_0x4b9fcf=_0x4b9fcf||0x1f4;return function(_0x1bbc9b){logger[_0x78cf('0x1f')](_0x1bbc9b[_0x78cf('0x20')]);if(_0x1bbc9b[_0x78cf('0x21')]){delete _0x1bbc9b['name'];}_0x164cf7[_0x78cf('0x14')](_0x4b9fcf)[_0x78cf('0x22')](_0x1bbc9b);};}exports[_0x78cf('0x23')]=function(_0x190ffb,_0x37ca7c){var _0x37cdbb={},_0x391799={},_0x76405b={'count':0x0,'rows':[]};var _0x508a2a=_[_0x78cf('0x24')](db[_0x78cf('0x25')]['rawAttributes'],function(_0x42887d){return{'name':_0x42887d[_0x78cf('0x26')],'type':_0x42887d[_0x78cf('0x27')][_0x78cf('0x28')]};});_0x391799[_0x78cf('0x29')]=_[_0x78cf('0x24')](_0x508a2a,'name');_0x391799['query']=_[_0x78cf('0x2a')](_0x190ffb[_0x78cf('0x2b')]);_0x391799[_0x78cf('0x2c')]=_[_0x78cf('0x2d')](_0x391799[_0x78cf('0x29')],_0x391799[_0x78cf('0x2b')]);_0x37cdbb[_0x78cf('0x2e')]=_['intersection'](_0x391799[_0x78cf('0x29')],qs[_0x78cf('0x2f')](_0x190ffb[_0x78cf('0x2b')][_0x78cf('0x2f')]));_0x37cdbb[_0x78cf('0x2e')]=_0x37cdbb[_0x78cf('0x2e')][_0x78cf('0x30')]?_0x37cdbb['attributes']:_0x391799[_0x78cf('0x29')];if(!_0x190ffb[_0x78cf('0x2b')][_0x78cf('0x31')](_0x78cf('0x32'))){_0x37cdbb[_0x78cf('0x17')]=qs['limit'](_0x190ffb['query'][_0x78cf('0x17')]);_0x37cdbb[_0x78cf('0x16')]=qs[_0x78cf('0x16')](_0x190ffb[_0x78cf('0x2b')]['offset']);}_0x37cdbb[_0x78cf('0x33')]=qs[_0x78cf('0x34')](_0x190ffb['query'][_0x78cf('0x34')]);_0x37cdbb[_0x78cf('0x35')]=qs[_0x78cf('0x2c')](_[_0x78cf('0x36')](_0x190ffb[_0x78cf('0x2b')],_0x391799[_0x78cf('0x2c')]));if(_0x190ffb[_0x78cf('0x2b')][_0x78cf('0x37')]){_0x37cdbb[_0x78cf('0x35')]=_[_0x78cf('0x38')](_0x37cdbb['where'],{'$or':_[_0x78cf('0x24')](_0x508a2a,function(_0x4a385a){if(_0x4a385a[_0x78cf('0x27')][_0x78cf('0x28')]!=='VIRTUAL'){var _0x35d68a={};_0x35d68a[_0x4a385a[_0x78cf('0x39')]]={'$like':'%'+_0x190ffb['query'][_0x78cf('0x37')]+'%'};return _0x35d68a;}})});}_0x37cdbb=_[_0x78cf('0x38')]({},_0x37cdbb,_0x190ffb[_0x78cf('0x3a')]);var _0x953183={'where':_0x37cdbb[_0x78cf('0x35')]};return db[_0x78cf('0x25')][_0x78cf('0x3b')](_0x953183)[_0x78cf('0x1c')](function(_0x46503b){_0x76405b['count']=_0x46503b;if(_0x190ffb[_0x78cf('0x2b')][_0x78cf('0x3c')]){_0x37cdbb[_0x78cf('0x3d')]=[{'all':!![]}];}return db['JscriptySessionReport']['findAll'](_0x37cdbb);})[_0x78cf('0x1c')](function(_0xa71cef){_0x76405b[_0x78cf('0x3e')]=_0xa71cef;return _0x76405b;})[_0x78cf('0x1c')](respondWithFilteredResult(_0x37ca7c,_0x37cdbb))[_0x78cf('0x3f')](handleError(_0x37ca7c,null));};exports[_0x78cf('0x40')]=function(_0x3664ea,_0x507f44){var _0x414ff9={'raw':!![],'where':{'id':_0x3664ea['params']['id']}},_0x2f0192={};_0x2f0192['model']=_['keys'](db['JscriptySessionReport'][_0x78cf('0x41')]);_0x2f0192[_0x78cf('0x2b')]=_[_0x78cf('0x2a')](_0x3664ea[_0x78cf('0x2b')]);_0x2f0192[_0x78cf('0x2c')]=_[_0x78cf('0x2d')](_0x2f0192[_0x78cf('0x29')],_0x2f0192['query']);_0x414ff9['attributes']=_[_0x78cf('0x2d')](_0x2f0192[_0x78cf('0x29')],qs['fields'](_0x3664ea[_0x78cf('0x2b')]['fields']));_0x414ff9['attributes']=_0x414ff9[_0x78cf('0x2e')]['length']?_0x414ff9['attributes']:_0x2f0192['model'];if(_0x3664ea[_0x78cf('0x2b')][_0x78cf('0x3c')]){_0x414ff9[_0x78cf('0x3d')]=[{'all':!![]}];}_0x414ff9=_[_0x78cf('0x38')]({},_0x414ff9,_0x3664ea[_0x78cf('0x3a')]);return db['JscriptySessionReport']['find'](_0x414ff9)[_0x78cf('0x1c')](handleEntityNotFound(_0x507f44,null))[_0x78cf('0x1c')](respondWithResult(_0x507f44,null))[_0x78cf('0x3f')](handleError(_0x507f44,null));};exports['create']=function(_0x3ff566,_0x1641e0){return db['JscriptySessionReport'][_0x78cf('0x42')](_0x3ff566[_0x78cf('0x43')],{})[_0x78cf('0x1c')](respondWithResult(_0x1641e0,0xc9))[_0x78cf('0x3f')](handleError(_0x1641e0,null));};exports[_0x78cf('0x44')]=function(_0xeb4f42,_0x7134ef){if(_0xeb4f42[_0x78cf('0x43')]['id']){delete _0xeb4f42[_0x78cf('0x43')]['id'];}return db[_0x78cf('0x25')]['find']({'where':{'id':_0xeb4f42[_0x78cf('0x45')]['id']}})[_0x78cf('0x1c')](handleEntityNotFound(_0x7134ef,null))[_0x78cf('0x1c')](saveUpdates(_0xeb4f42[_0x78cf('0x43')],null))[_0x78cf('0x1c')](respondWithResult(_0x7134ef,null))['catch'](handleError(_0x7134ef,null));};exports[_0x78cf('0x1d')]=function(_0x3e535d,_0x1746de){return db[_0x78cf('0x25')][_0x78cf('0x46')]({'where':{'id':_0x3e535d[_0x78cf('0x45')]['id']}})['then'](handleEntityNotFound(_0x1746de,null))['then'](removeEntity(_0x1746de,null))[_0x78cf('0x3f')](handleError(_0x1746de,null));};exports[_0x78cf('0x47')]=function(_0x5f23c3,_0x3baf1d){return db[_0x78cf('0x25')][_0x78cf('0x47')]()['then'](respondWithResult(_0x3baf1d,null))[_0x78cf('0x3f')](handleError(_0x3baf1d,null));};exports[_0x78cf('0x48')]=function(_0x2b849e,_0x129c43,_0x27b458){var _0x44fa57={'raw':!![],'where':{}};var _0x1698ea={};var _0x240281={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0x78cf('0x49')]({'where':{'id':_0x2b849e['params']['id']}})['then'](handleEntityNotFound(_0x129c43,null))['then'](function(_0x177738){if(_0x177738){_0x1698ea['model']=_[_0x78cf('0x2a')](db[_0x78cf('0x4a')][_0x78cf('0x41')]);_0x1698ea[_0x78cf('0x2b')]=_[_0x78cf('0x2a')](_0x2b849e['query']);_0x1698ea[_0x78cf('0x2c')]=_[_0x78cf('0x2d')](_0x1698ea['model'],_0x1698ea['query']);_0x44fa57[_0x78cf('0x2e')]=_['intersection'](_0x1698ea['model'],qs['fields'](_0x2b849e[_0x78cf('0x2b')][_0x78cf('0x2f')]));_0x44fa57[_0x78cf('0x2e')]=_0x44fa57['attributes'][_0x78cf('0x30')]?_0x44fa57[_0x78cf('0x2e')]:_0x1698ea[_0x78cf('0x29')];if(!_0x2b849e[_0x78cf('0x2b')][_0x78cf('0x31')](_0x78cf('0x32'))){_0x44fa57[_0x78cf('0x17')]=qs['limit'](_0x2b849e['query'][_0x78cf('0x17')]);_0x44fa57['offset']=qs[_0x78cf('0x16')](_0x2b849e[_0x78cf('0x2b')][_0x78cf('0x16')]);}_0x44fa57[_0x78cf('0x33')]=qs[_0x78cf('0x34')](_0x2b849e[_0x78cf('0x2b')][_0x78cf('0x34')]);_0x44fa57[_0x78cf('0x35')]=qs[_0x78cf('0x2c')](_[_0x78cf('0x36')](_0x2b849e[_0x78cf('0x2b')],_0x1698ea[_0x78cf('0x2c')]));_0x44fa57['where'][_0x78cf('0x4b')]=_0x177738['id'];if(_0x2b849e[_0x78cf('0x2b')][_0x78cf('0x37')]){_0x44fa57[_0x78cf('0x35')]=_[_0x78cf('0x38')](_0x44fa57[_0x78cf('0x35')],{'$or':_[_0x78cf('0x24')](_0x44fa57[_0x78cf('0x2e')],function(_0x37f1b2){var _0x27e102={};_0x27e102[_0x37f1b2]={'$like':'%'+_0x2b849e[_0x78cf('0x2b')][_0x78cf('0x37')]+'%'};return _0x27e102;})});}_0x44fa57=_['merge']({},_0x44fa57,_0x2b849e['options']);return db[_0x78cf('0x4a')][_0x78cf('0x3b')]({'where':_0x44fa57['where']})[_0x78cf('0x1c')](function(_0x55be0b){_0x240281[_0x78cf('0x3b')]=_0x55be0b;if(_0x2b849e['query']['includeAll']){_0x44fa57[_0x78cf('0x3d')]=[{'all':!![]}];}return db[_0x78cf('0x4a')][_0x78cf('0x4c')](_0x44fa57);})[_0x78cf('0x1c')](function(_0x2c57b9){_0x240281[_0x78cf('0x3e')]=_0x2c57b9;return _0x240281;});}})[_0x78cf('0x1c')](respondWithFilteredResult(_0x129c43,_0x44fa57))[_0x78cf('0x3f')](handleError(_0x129c43,null));}; \ No newline at end of file +var _0xe5b5=['query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','field','filter','options','count','includeAll','include','findAll','rows','catch','show','params','keys','create','body','find','describe','findOne','length','SessionId','JscriptyQuestionReport','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','save','update','then','destroy','stack','name','send','JscriptySessionReport','fieldName','type','key','map'];(function(_0x5709e1,_0x265d2a){var _0x2b79c4=function(_0x406789){while(--_0x406789){_0x5709e1['push'](_0x5709e1['shift']());}};_0x2b79c4(++_0x265d2a);}(_0xe5b5,0xc0));var _0x5e5b=function(_0x2074db,_0x10b81b){_0x2074db=_0x2074db-0x0;var _0x27324c=_0xe5b5[_0x2074db];return _0x27324c;};'use strict';var pdf=require(_0x5e5b('0x0'));var emlformat=require(_0x5e5b('0x1'));var rimraf=require(_0x5e5b('0x2'));var zipdir=require(_0x5e5b('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5e5b('0x4'));var moment=require(_0x5e5b('0x5'));var BPromise=require(_0x5e5b('0x6'));var Mustache=require(_0x5e5b('0x7'));var util=require(_0x5e5b('0x8'));var path=require(_0x5e5b('0x9'));var sox=require('sox');var csv=require(_0x5e5b('0xa'));var ejs=require(_0x5e5b('0xb'));var fs=require('fs');var _=require(_0x5e5b('0xc'));var squel=require('squel');var crypto=require(_0x5e5b('0xd'));var jsforce=require(_0x5e5b('0xe'));var deskjs=require(_0x5e5b('0xf'));var toCsv=require(_0x5e5b('0xa'));var querystring=require(_0x5e5b('0x10'));var Papa=require('papaparse');var Redis=require(_0x5e5b('0x11'));var authService=require(_0x5e5b('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5e5b('0x13'));var hardwareService=require(_0x5e5b('0x14'));var logger=require(_0x5e5b('0x15'))(_0x5e5b('0x16'));var utils=require(_0x5e5b('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x95bd94,_0x363b78){_0x363b78=_0x363b78||0xcc;return function(_0x13004f){if(_0x13004f){return _0x95bd94[_0x5e5b('0x18')](_0x363b78);}return _0x95bd94[_0x5e5b('0x19')](_0x363b78)[_0x5e5b('0x1a')]();};}function respondWithResult(_0x2f1eae,_0x2fd920){_0x2fd920=_0x2fd920||0xc8;return function(_0x27982c){if(_0x27982c){return _0x2f1eae['status'](_0x2fd920)[_0x5e5b('0x1b')](_0x27982c);}};}function respondWithFilteredResult(_0x53e836,_0x52316b){return function(_0x430d88){if(_0x430d88){var _0x223c62=_0x430d88['count'],_0x8a9447=_0x52316b[_0x5e5b('0x1c')],_0x1f6f79=_0x52316b['offset']+_0x52316b[_0x5e5b('0x1d')],_0xc32808;if(_0x1f6f79>=_0x223c62){_0x1f6f79=_0x223c62;_0xc32808=0xc8;}else{_0xc32808=0xce;}_0x53e836[_0x5e5b('0x19')](_0xc32808);return _0x53e836[_0x5e5b('0x1e')](_0x5e5b('0x1f'),_0x8a9447+'-'+_0x1f6f79+'/'+_0x223c62)[_0x5e5b('0x1b')](_0x430d88);}return null;};}function patchUpdates(_0x311801){return function(_0xe770ea){try{jsonpatch['apply'](_0xe770ea,_0x311801,!![]);}catch(_0x214584){return BPromise[_0x5e5b('0x20')](_0x214584);}return _0xe770ea[_0x5e5b('0x21')]();};}function saveUpdates(_0xa78d89,_0x5ab99e){return function(_0x4781bb){if(_0x4781bb){return _0x4781bb[_0x5e5b('0x22')](_0xa78d89)[_0x5e5b('0x23')](function(_0xf2578b){return _0xf2578b;});}return null;};}function removeEntity(_0x7b5645,_0x28453a){return function(_0x524b6b){if(_0x524b6b){return _0x524b6b[_0x5e5b('0x24')]()['then'](function(){_0x7b5645[_0x5e5b('0x19')](0xcc)[_0x5e5b('0x1a')]();});}};}function handleEntityNotFound(_0x4e7d49,_0x2c8a2c){return function(_0x5177e8){if(!_0x5177e8){_0x4e7d49[_0x5e5b('0x18')](0x194);}return _0x5177e8;};}function handleError(_0x13119b,_0x3ce7cc){_0x3ce7cc=_0x3ce7cc||0x1f4;return function(_0x3e8856){logger['error'](_0x3e8856[_0x5e5b('0x25')]);if(_0x3e8856[_0x5e5b('0x26')]){delete _0x3e8856['name'];}_0x13119b[_0x5e5b('0x19')](_0x3ce7cc)[_0x5e5b('0x27')](_0x3e8856);};}exports['index']=function(_0x19885a,_0x55dd77){var _0x3de682={},_0xf66093={},_0x852b94={'count':0x0,'rows':[]};var _0xa5b561=_['map'](db[_0x5e5b('0x28')]['rawAttributes'],function(_0x2bcabd){return{'name':_0x2bcabd[_0x5e5b('0x29')],'type':_0x2bcabd[_0x5e5b('0x2a')][_0x5e5b('0x2b')]};});_0xf66093['model']=_[_0x5e5b('0x2c')](_0xa5b561,_0x5e5b('0x26'));_0xf66093['query']=_['keys'](_0x19885a[_0x5e5b('0x2d')]);_0xf66093[_0x5e5b('0x2e')]=_[_0x5e5b('0x2f')](_0xf66093[_0x5e5b('0x30')],_0xf66093[_0x5e5b('0x2d')]);_0x3de682[_0x5e5b('0x31')]=_[_0x5e5b('0x2f')](_0xf66093[_0x5e5b('0x30')],qs[_0x5e5b('0x32')](_0x19885a[_0x5e5b('0x2d')]['fields']));_0x3de682[_0x5e5b('0x31')]=_0x3de682[_0x5e5b('0x31')]['length']?_0x3de682[_0x5e5b('0x31')]:_0xf66093[_0x5e5b('0x30')];if(!_0x19885a[_0x5e5b('0x2d')][_0x5e5b('0x33')](_0x5e5b('0x34'))){_0x3de682[_0x5e5b('0x1d')]=qs[_0x5e5b('0x1d')](_0x19885a[_0x5e5b('0x2d')][_0x5e5b('0x1d')]);_0x3de682[_0x5e5b('0x1c')]=qs[_0x5e5b('0x1c')](_0x19885a['query'][_0x5e5b('0x1c')]);}_0x3de682[_0x5e5b('0x35')]=qs[_0x5e5b('0x36')](_0x19885a[_0x5e5b('0x2d')][_0x5e5b('0x36')]);_0x3de682['where']=qs[_0x5e5b('0x2e')](_[_0x5e5b('0x37')](_0x19885a['query'],_0xf66093[_0x5e5b('0x2e')]));if(_0x19885a['query']['filter']){_0x3de682[_0x5e5b('0x38')]=_[_0x5e5b('0x39')](_0x3de682['where'],{'$or':_[_0x5e5b('0x2c')](_0xa5b561,function(_0x46ef45){if(_0x46ef45[_0x5e5b('0x2a')][_0x5e5b('0x2b')]!==_0x5e5b('0x3a')){var _0x22fe6a={};_0x22fe6a[_0x46ef45[_0x5e5b('0x3b')]]={'$like':'%'+_0x19885a[_0x5e5b('0x2d')][_0x5e5b('0x3c')]+'%'};return _0x22fe6a;}})});}_0x3de682=_[_0x5e5b('0x39')]({},_0x3de682,_0x19885a[_0x5e5b('0x3d')]);var _0x41e2b3={'where':_0x3de682[_0x5e5b('0x38')]};return db[_0x5e5b('0x28')][_0x5e5b('0x3e')](_0x41e2b3)[_0x5e5b('0x23')](function(_0x3609ef){_0x852b94['count']=_0x3609ef;if(_0x19885a[_0x5e5b('0x2d')][_0x5e5b('0x3f')]){_0x3de682[_0x5e5b('0x40')]=[{'all':!![]}];}return db[_0x5e5b('0x28')][_0x5e5b('0x41')](_0x3de682);})[_0x5e5b('0x23')](function(_0x13a2a8){_0x852b94[_0x5e5b('0x42')]=_0x13a2a8;return _0x852b94;})['then'](respondWithFilteredResult(_0x55dd77,_0x3de682))[_0x5e5b('0x43')](handleError(_0x55dd77,null));};exports[_0x5e5b('0x44')]=function(_0x159ea1,_0x451d9c){var _0x43832e={'raw':!![],'where':{'id':_0x159ea1[_0x5e5b('0x45')]['id']}},_0x2b54f8={};_0x2b54f8[_0x5e5b('0x30')]=_['keys'](db[_0x5e5b('0x28')]['rawAttributes']);_0x2b54f8[_0x5e5b('0x2d')]=_[_0x5e5b('0x46')](_0x159ea1['query']);_0x2b54f8['filters']=_[_0x5e5b('0x2f')](_0x2b54f8[_0x5e5b('0x30')],_0x2b54f8[_0x5e5b('0x2d')]);_0x43832e[_0x5e5b('0x31')]=_[_0x5e5b('0x2f')](_0x2b54f8[_0x5e5b('0x30')],qs[_0x5e5b('0x32')](_0x159ea1[_0x5e5b('0x2d')][_0x5e5b('0x32')]));_0x43832e['attributes']=_0x43832e[_0x5e5b('0x31')]['length']?_0x43832e[_0x5e5b('0x31')]:_0x2b54f8[_0x5e5b('0x30')];if(_0x159ea1[_0x5e5b('0x2d')][_0x5e5b('0x3f')]){_0x43832e[_0x5e5b('0x40')]=[{'all':!![]}];}_0x43832e=_['merge']({},_0x43832e,_0x159ea1[_0x5e5b('0x3d')]);return db['JscriptySessionReport']['find'](_0x43832e)[_0x5e5b('0x23')](handleEntityNotFound(_0x451d9c,null))[_0x5e5b('0x23')](respondWithResult(_0x451d9c,null))['catch'](handleError(_0x451d9c,null));};exports[_0x5e5b('0x47')]=function(_0x3fd85e,_0x2d88e5){return db['JscriptySessionReport'][_0x5e5b('0x47')](_0x3fd85e[_0x5e5b('0x48')],{})[_0x5e5b('0x23')](respondWithResult(_0x2d88e5,0xc9))[_0x5e5b('0x43')](handleError(_0x2d88e5,null));};exports[_0x5e5b('0x22')]=function(_0x59d106,_0x13b430){if(_0x59d106[_0x5e5b('0x48')]['id']){delete _0x59d106[_0x5e5b('0x48')]['id'];}return db['JscriptySessionReport'][_0x5e5b('0x49')]({'where':{'id':_0x59d106[_0x5e5b('0x45')]['id']}})[_0x5e5b('0x23')](handleEntityNotFound(_0x13b430,null))['then'](saveUpdates(_0x59d106[_0x5e5b('0x48')],null))[_0x5e5b('0x23')](respondWithResult(_0x13b430,null))[_0x5e5b('0x43')](handleError(_0x13b430,null));};exports['destroy']=function(_0x76d49c,_0x30daf5){return db[_0x5e5b('0x28')][_0x5e5b('0x49')]({'where':{'id':_0x76d49c['params']['id']}})[_0x5e5b('0x23')](handleEntityNotFound(_0x30daf5,null))[_0x5e5b('0x23')](removeEntity(_0x30daf5,null))[_0x5e5b('0x43')](handleError(_0x30daf5,null));};exports[_0x5e5b('0x4a')]=function(_0xfa3bb,_0xb2dc4f){return db['JscriptySessionReport'][_0x5e5b('0x4a')]()[_0x5e5b('0x23')](respondWithResult(_0xb2dc4f,null))['catch'](handleError(_0xb2dc4f,null));};exports['getQuestions']=function(_0x5de6f3,_0x1743a4,_0xb094e0){var _0x2b3a9d={'raw':!![],'where':{}};var _0x3706cc={};var _0x2b99ce={'count':0x0,'rows':[]};return db[_0x5e5b('0x28')][_0x5e5b('0x4b')]({'where':{'id':_0x5de6f3[_0x5e5b('0x45')]['id']}})['then'](handleEntityNotFound(_0x1743a4,null))[_0x5e5b('0x23')](function(_0x5be11c){if(_0x5be11c){_0x3706cc['model']=_['keys'](db['JscriptyQuestionReport']['rawAttributes']);_0x3706cc[_0x5e5b('0x2d')]=_[_0x5e5b('0x46')](_0x5de6f3['query']);_0x3706cc[_0x5e5b('0x2e')]=_[_0x5e5b('0x2f')](_0x3706cc['model'],_0x3706cc[_0x5e5b('0x2d')]);_0x2b3a9d['attributes']=_[_0x5e5b('0x2f')](_0x3706cc[_0x5e5b('0x30')],qs[_0x5e5b('0x32')](_0x5de6f3[_0x5e5b('0x2d')][_0x5e5b('0x32')]));_0x2b3a9d['attributes']=_0x2b3a9d['attributes'][_0x5e5b('0x4c')]?_0x2b3a9d['attributes']:_0x3706cc[_0x5e5b('0x30')];if(!_0x5de6f3[_0x5e5b('0x2d')][_0x5e5b('0x33')](_0x5e5b('0x34'))){_0x2b3a9d[_0x5e5b('0x1d')]=qs[_0x5e5b('0x1d')](_0x5de6f3[_0x5e5b('0x2d')][_0x5e5b('0x1d')]);_0x2b3a9d['offset']=qs['offset'](_0x5de6f3[_0x5e5b('0x2d')]['offset']);}_0x2b3a9d['order']=qs[_0x5e5b('0x36')](_0x5de6f3['query'][_0x5e5b('0x36')]);_0x2b3a9d[_0x5e5b('0x38')]=qs[_0x5e5b('0x2e')](_[_0x5e5b('0x37')](_0x5de6f3[_0x5e5b('0x2d')],_0x3706cc[_0x5e5b('0x2e')]));_0x2b3a9d['where'][_0x5e5b('0x4d')]=_0x5be11c['id'];if(_0x5de6f3[_0x5e5b('0x2d')][_0x5e5b('0x3c')]){_0x2b3a9d[_0x5e5b('0x38')]=_[_0x5e5b('0x39')](_0x2b3a9d[_0x5e5b('0x38')],{'$or':_['map'](_0x2b3a9d['attributes'],function(_0x3b7e47){var _0x103a7a={};_0x103a7a[_0x3b7e47]={'$like':'%'+_0x5de6f3[_0x5e5b('0x2d')][_0x5e5b('0x3c')]+'%'};return _0x103a7a;})});}_0x2b3a9d=_[_0x5e5b('0x39')]({},_0x2b3a9d,_0x5de6f3[_0x5e5b('0x3d')]);return db['JscriptyQuestionReport']['count']({'where':_0x2b3a9d[_0x5e5b('0x38')]})[_0x5e5b('0x23')](function(_0x4db9cd){_0x2b99ce[_0x5e5b('0x3e')]=_0x4db9cd;if(_0x5de6f3['query'][_0x5e5b('0x3f')]){_0x2b3a9d[_0x5e5b('0x40')]=[{'all':!![]}];}return db[_0x5e5b('0x4e')][_0x5e5b('0x41')](_0x2b3a9d);})[_0x5e5b('0x23')](function(_0x104ee5){_0x2b99ce[_0x5e5b('0x42')]=_0x104ee5;return _0x2b99ce;});}})[_0x5e5b('0x23')](respondWithFilteredResult(_0x1743a4,_0x2b3a9d))[_0x5e5b('0x43')](handleError(_0x1743a4,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 4367ac4..84af18a 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 _0xc9df=['JscriptySessionReport','report_jscripty_sessions','util','../../config/logger','api','exports','define'];(function(_0x40b263,_0x36e1d4){var _0x45f933=function(_0x18a280){while(--_0x18a280){_0x40b263['push'](_0x40b263['shift']());}};_0x45f933(++_0x36e1d4);}(_0xc9df,0x121));var _0xfc9d=function(_0x5e1379,_0x2250f8){_0x5e1379=_0x5e1379-0x0;var _0x5c6387=_0xc9df[_0x5e1379];return _0x5c6387;};'use strict';var _=require('lodash');var util=require(_0xfc9d('0x0'));var logger=require(_0xfc9d('0x1'))(_0xfc9d('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./jscriptySessionReport.attributes');module[_0xfc9d('0x3')]=function(_0x190cc1,_0x2e7243){return _0x190cc1[_0xfc9d('0x4')](_0xfc9d('0x5'),attributes,{'tableName':_0xfc9d('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xff10=['util','moment','bluebird','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','report_jscripty_sessions','lodash'];(function(_0x1a08ae,_0x16862c){var _0x117fe2=function(_0x5b4453){while(--_0x5b4453){_0x1a08ae['push'](_0x1a08ae['shift']());}};_0x117fe2(++_0x16862c);}(_0xff10,0x77));var _0x0ff1=function(_0x185f07,_0x4a5e75){_0x185f07=_0x185f07-0x0;var _0x4b7842=_0xff10[_0x185f07];return _0x4b7842;};'use strict';var _=require(_0x0ff1('0x0'));var util=require(_0x0ff1('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0ff1('0x2'));var BPromise=require(_0x0ff1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0ff1('0x4'));var config=require(_0x0ff1('0x5'));var attributes=require(_0x0ff1('0x6'));module[_0x0ff1('0x7')]=function(_0x1082fa,_0x47880a){return _0x1082fa[_0x0ff1('0x8')]('JscriptySessionReport',attributes,{'tableName':_0x0ff1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index 84d5bc4..d897224 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 _0xd589=['request','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','http'];(function(_0x59f033,_0x56f79a){var _0x378fe7=function(_0x4ff0d1){while(--_0x4ff0d1){_0x59f033['push'](_0x59f033['shift']());}};_0x378fe7(++_0x56f79a);}(_0xd589,0xde));var _0x9d58=function(_0x30e3fe,_0x270bbd){_0x30e3fe=_0x30e3fe-0x0;var _0x1f5e73=_0xd589[_0x30e3fe];return _0x1f5e73;};'use strict';var _=require('lodash');var util=require(_0x9d58('0x0'));var moment=require(_0x9d58('0x1'));var BPromise=require(_0x9d58('0x2'));var rs=require(_0x9d58('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9d58('0x4'))['db'];var utils=require(_0x9d58('0x5'));var logger=require('../../config/logger')(_0x9d58('0x6'));var config=require('../../config/environment');var jayson=require(_0x9d58('0x7'));var client=jayson['client'][_0x9d58('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2a5345,_0x10d865,_0x55a8a2){return new BPromise(function(_0x5e7ca2,_0x3229eb){return client[_0x9d58('0x9')](_0x2a5345,_0x55a8a2)['then'](function(_0x47e080){logger[_0x9d58('0xa')](_0x9d58('0xb'),_0x10d865,_0x9d58('0xc'));logger[_0x9d58('0xd')](_0x9d58('0xe'),_0x10d865,_0x9d58('0xc'),JSON[_0x9d58('0xf')](_0x47e080));if(_0x47e080[_0x9d58('0x10')]){if(_0x47e080[_0x9d58('0x10')][_0x9d58('0x11')]===0x1f4){logger['error'](_0x9d58('0xb'),_0x10d865,_0x47e080['error'][_0x9d58('0x12')]);return _0x3229eb(_0x47e080[_0x9d58('0x10')][_0x9d58('0x12')]);}logger['error']('JscriptySessionReport,\x20%s,\x20%s',_0x10d865,_0x47e080[_0x9d58('0x10')]['message']);return _0x5e7ca2(_0x47e080[_0x9d58('0x10')]['message']);}else{logger['info']('JscriptySessionReport,\x20%s,\x20%s',_0x10d865,_0x9d58('0xc'));_0x5e7ca2(_0x47e080[_0x9d58('0x13')][_0x9d58('0x12')]);}})[_0x9d58('0x14')](function(_0x5ec430){logger['error'](_0x9d58('0xb'),_0x10d865,_0x5ec430);_0x3229eb(_0x5ec430);});});} \ No newline at end of file +var _0x7162=['info','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','JscriptySessionReport,\x20%s,\x20%s','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x4769ff,_0x127733){var _0x2362ba=function(_0x5deeaf){while(--_0x5deeaf){_0x4769ff['push'](_0x4769ff['shift']());}};_0x2362ba(++_0x127733);}(_0x7162,0xe2));var _0x2716=function(_0x315ac6,_0x592553){_0x315ac6=_0x315ac6-0x0;var _0x193345=_0x7162[_0x315ac6];return _0x193345;};'use strict';var _=require(_0x2716('0x0'));var util=require(_0x2716('0x1'));var moment=require('moment');var BPromise=require(_0x2716('0x2'));var rs=require(_0x2716('0x3'));var fs=require('fs');var Redis=require(_0x2716('0x4'));var db=require(_0x2716('0x5'))['db'];var utils=require(_0x2716('0x6'));var logger=require(_0x2716('0x7'))(_0x2716('0x8'));var config=require('../../config/environment');var jayson=require(_0x2716('0x9'));var client=jayson[_0x2716('0xa')][_0x2716('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5e769f,_0xc957b4,_0x3656){return new BPromise(function(_0x907375,_0xe34ff0){return client[_0x2716('0xc')](_0x5e769f,_0x3656)[_0x2716('0xd')](function(_0x30932b){logger[_0x2716('0xe')]('JscriptySessionReport,\x20%s,\x20%s',_0xc957b4,_0x2716('0xf'));logger[_0x2716('0x10')](_0x2716('0x11'),_0xc957b4,_0x2716('0xf'),JSON[_0x2716('0x12')](_0x30932b));if(_0x30932b[_0x2716('0x13')]){if(_0x30932b['error'][_0x2716('0x14')]===0x1f4){logger[_0x2716('0x13')](_0x2716('0x15'),_0xc957b4,_0x30932b[_0x2716('0x13')][_0x2716('0x16')]);return _0xe34ff0(_0x30932b['error']['message']);}logger[_0x2716('0x13')](_0x2716('0x15'),_0xc957b4,_0x30932b[_0x2716('0x13')]['message']);return _0x907375(_0x30932b[_0x2716('0x13')][_0x2716('0x16')]);}else{logger[_0x2716('0xe')](_0x2716('0x15'),_0xc957b4,_0x2716('0xf'));_0x907375(_0x30932b['result'][_0x2716('0x16')]);}})[_0x2716('0x17')](function(_0x308823){logger[_0x2716('0x13')](_0x2716('0x15'),_0xc957b4,_0x308823);_0xe34ff0(_0x308823);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 40c10e9..152b486 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 _0xa388=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','get','index','put','isAuthenticated','exports','multer','util','path'];(function(_0x47cfd0,_0x211b20){var _0x47104f=function(_0x56a802){while(--_0x56a802){_0x47cfd0['push'](_0x47cfd0['shift']());}};_0x47104f(++_0x211b20);}(_0xa388,0x99));var _0x8a38=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa388[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x8a38('0x0'));var util=require(_0x8a38('0x1'));var path=require(_0x8a38('0x2'));var timeout=require('connect-timeout');var express=require(_0x8a38('0x3'));var router=express['Router']();var auth=require(_0x8a38('0x4'));var interaction=require(_0x8a38('0x5'));var config=require(_0x8a38('0x6'));var controller=require(_0x8a38('0x7'));router[_0x8a38('0x8')]('/',controller[_0x8a38('0x9')]);router[_0x8a38('0xa')]('/:id',auth[_0x8a38('0xb')](),controller['update']);module[_0x8a38('0xc')]=router; \ No newline at end of file +var _0x4ddf=['update','util','path','connect-timeout','Router','../../components/interaction/service','./license.controller','index','put','/:id'];(function(_0x31876b,_0x132a16){var _0x2ae05b=function(_0x4fa54d){while(--_0x4fa54d){_0x31876b['push'](_0x31876b['shift']());}};_0x2ae05b(++_0x132a16);}(_0x4ddf,0x137));var _0xf4dd=function(_0x29955c,_0x56794b){_0x29955c=_0x29955c-0x0;var _0x29d88f=_0x4ddf[_0x29955c];return _0x29d88f;};'use strict';var multer=require('multer');var util=require(_0xf4dd('0x0'));var path=require(_0xf4dd('0x1'));var timeout=require(_0xf4dd('0x2'));var express=require('express');var router=express[_0xf4dd('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xf4dd('0x4'));var config=require('../../config/environment');var controller=require(_0xf4dd('0x5'));router['get']('/',controller[_0xf4dd('0x6')]);router[_0xf4dd('0x7')](_0xf4dd('0x8'),auth['isAuthenticated'](),controller[_0xf4dd('0x9')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 54a685a..ee0422d 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 _0x5fab=['exports','STRING','INTEGER','sequelize'];(function(_0x22920e,_0x224e46){var _0x2bfc99=function(_0xac1003){while(--_0xac1003){_0x22920e['push'](_0x22920e['shift']());}};_0x2bfc99(++_0x224e46);}(_0x5fab,0x177));var _0xb5fa=function(_0xea6c20,_0x5a0de8){_0xea6c20=_0xea6c20-0x0;var _0x458655=_0x5fab[_0xea6c20];return _0x458655;};'use strict';var Sequelize=require(_0xb5fa('0x0'));module[_0xb5fa('0x1')]={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize[_0xb5fa('0x2')]},'data2':{'type':Sequelize[_0xb5fa('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0xb5fa('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x46ed=['sequelize','exports','STRING','INTEGER'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0x46ed,0x168));var _0xd46e=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x46ed[_0x2070da];return _0x4f9fe1;};'use strict';var Sequelize=require(_0xd46e('0x0'));module[_0xd46e('0x1')]={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize[_0xd46e('0x2')]},'data2':{'type':Sequelize[_0xd46e('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0xd46e('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index eb4a2c3..e7d40d2 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 _0x2945=['sendStatus','end','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','keys','rawAttributes','query','filters','intersection','model','attributes','length','merge','options','getLicense','catch','body','demo','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0xbc6464,_0x171837){var _0x1c4e91=function(_0x3f236c){while(--_0x3f236c){_0xbc6464['push'](_0xbc6464['shift']());}};_0x1c4e91(++_0x171837);}(_0x2945,0x90));var _0x5294=function(_0x230639,_0x20f428){_0x230639=_0x230639-0x0;var _0x5248d7=_0x2945[_0x230639];return _0x5248d7;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5294('0x0'));var rimraf=require(_0x5294('0x1'));var zipdir=require(_0x5294('0x2'));var jsonpatch=require(_0x5294('0x3'));var rp=require(_0x5294('0x4'));var moment=require(_0x5294('0x5'));var BPromise=require(_0x5294('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5294('0x7'));var sox=require(_0x5294('0x8'));var csv=require('to-csv');var ejs=require(_0x5294('0x9'));var fs=require('fs');var _=require(_0x5294('0xa'));var squel=require(_0x5294('0xb'));var crypto=require(_0x5294('0xc'));var jsforce=require(_0x5294('0xd'));var deskjs=require(_0x5294('0xe'));var toCsv=require(_0x5294('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5294('0x10'));var authService=require(_0x5294('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x5294('0x12'));var hardwareService=require(_0x5294('0x13'));var logger=require('../../config/logger')(_0x5294('0x14'));var utils=require(_0x5294('0x15'));var config=require(_0x5294('0x16'));var db=require(_0x5294('0x17'))['db'];function respondWithStatusCode(_0x3dd8e6,_0x511ddc){_0x511ddc=_0x511ddc||0xcc;return function(_0x382778){if(_0x382778){return _0x3dd8e6[_0x5294('0x18')](_0x511ddc);}return _0x3dd8e6['status'](_0x511ddc)[_0x5294('0x19')]();};}function respondWithResult(_0x1925b6,_0x1b5e95){_0x1b5e95=_0x1b5e95||0xc8;return function(_0x4d7680){if(_0x4d7680){return _0x1925b6[_0x5294('0x1a')](_0x1b5e95)[_0x5294('0x1b')](_0x4d7680);}};}function respondWithFilteredResult(_0x584829,_0x286b45){return function(_0x484c8f){if(_0x484c8f){var _0x3d6504=_0x484c8f[_0x5294('0x1c')],_0x354823=_0x286b45['offset'],_0x2bc763=_0x286b45[_0x5294('0x1d')]+_0x286b45['limit'],_0x2c769b;if(_0x2bc763>=_0x3d6504){_0x2bc763=_0x3d6504;_0x2c769b=0xc8;}else{_0x2c769b=0xce;}_0x584829[_0x5294('0x1a')](_0x2c769b);return _0x584829[_0x5294('0x1e')](_0x5294('0x1f'),_0x354823+'-'+_0x2bc763+'/'+_0x3d6504)[_0x5294('0x1b')](_0x484c8f);}return null;};}function patchUpdates(_0x419105){return function(_0x57b264){try{jsonpatch[_0x5294('0x20')](_0x57b264,_0x419105,!![]);}catch(_0x239911){return BPromise[_0x5294('0x21')](_0x239911);}return _0x57b264[_0x5294('0x22')]();};}function saveUpdates(_0x30123d,_0x2b7b09){return function(_0x5f0881){if(_0x5f0881){return _0x5f0881[_0x5294('0x23')](_0x30123d)[_0x5294('0x24')](function(_0x2d9670){return _0x2d9670;});}return null;};}function removeEntity(_0x35642b,_0x16a811){return function(_0x3a4be7){if(_0x3a4be7){return _0x3a4be7[_0x5294('0x25')]()[_0x5294('0x24')](function(){_0x35642b[_0x5294('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5406b2,_0x2cbdc3){return function(_0x3993e1){if(!_0x3993e1){_0x5406b2[_0x5294('0x18')](0x194);}return _0x3993e1;};}function handleError(_0x2f2f55,_0x597b7f){_0x597b7f=_0x597b7f||0x1f4;return function(_0x37dfbb){logger['error'](_0x37dfbb[_0x5294('0x26')]);if(_0x37dfbb['name']){delete _0x37dfbb[_0x5294('0x27')];}_0x2f2f55['status'](_0x597b7f)[_0x5294('0x28')](_0x37dfbb);};}var utilLicense=require('../../config/license/util');exports[_0x5294('0x29')]=function(_0x5ab62c,_0x3e75a9){var _0x37f035={'raw':!![],'where':{'id':0x1}},_0x1fa339={};_0x1fa339['model']=_[_0x5294('0x2a')](db['License'][_0x5294('0x2b')]);_0x1fa339[_0x5294('0x2c')]=_[_0x5294('0x2a')](_0x5ab62c[_0x5294('0x2c')]);_0x1fa339[_0x5294('0x2d')]=_[_0x5294('0x2e')](_0x1fa339[_0x5294('0x2f')],_0x1fa339[_0x5294('0x2c')]);_0x37f035[_0x5294('0x30')]=_[_0x5294('0x2e')](_0x1fa339[_0x5294('0x2f')],qs['fields'](_0x5ab62c[_0x5294('0x2c')]['fields']));_0x37f035[_0x5294('0x30')]=_0x37f035[_0x5294('0x30')][_0x5294('0x31')]?_0x37f035[_0x5294('0x30')]:_0x1fa339[_0x5294('0x2f')];_0x37f035=_[_0x5294('0x32')]({},_0x37f035,_0x5ab62c[_0x5294('0x33')]);return utilLicense[_0x5294('0x34')](_0x37f035)['then'](respondWithResult(_0x3e75a9,null))[_0x5294('0x35')](handleError(_0x3e75a9,null));};exports[_0x5294('0x23')]=function(_0x5afbde,_0x41179b){if(_0x5afbde[_0x5294('0x36')]['id']){delete _0x5afbde[_0x5294('0x36')]['id'];}return db['License']['find']({'where':{'id':_0x5afbde['params']['id']}})['then'](handleEntityNotFound(_0x41179b,null))['then'](function(_0x1d9f55){var _0x41787b=_0x1d9f55['get']({'plain':!![]});return utilLicense['checkLicense'](_0x41787b,_0x5afbde[_0x5294('0x36')]['key']);})['then'](function(_0x3bda89){if(!_0x3bda89[_0x5294('0x37')]){return saveUpdates(_0x5afbde['body'],null);}return _0x3bda89;})['then'](respondWithResult(_0x41179b,null))[_0x5294('0x35')](handleError(_0x41179b,null));}; \ No newline at end of file +var _0x5b71=['License','rawAttributes','query','filters','intersection','fields','attributes','length','options','getLicense','catch','body','find','params','get','checkLicense','key','demo','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','status','json','count','offset','Content-Range','apply','reject','save','update','destroy','then','end','stack','name','send','../../config/license/util','index','model','keys'];(function(_0x5d5f11,_0x42f8bb){var _0x51e357=function(_0x5ab7ca){while(--_0x5ab7ca){_0x5d5f11['push'](_0x5d5f11['shift']());}};_0x51e357(++_0x42f8bb);}(_0x5b71,0x180));var _0x15b7=function(_0x1498a8,_0x48e84f){_0x1498a8=_0x1498a8-0x0;var _0xf4d684=_0x5b71[_0x1498a8];return _0xf4d684;};'use strict';var pdf=require(_0x15b7('0x0'));var emlformat=require(_0x15b7('0x1'));var rimraf=require(_0x15b7('0x2'));var zipdir=require(_0x15b7('0x3'));var jsonpatch=require(_0x15b7('0x4'));var rp=require(_0x15b7('0x5'));var moment=require('moment');var BPromise=require(_0x15b7('0x6'));var Mustache=require(_0x15b7('0x7'));var util=require(_0x15b7('0x8'));var path=require(_0x15b7('0x9'));var sox=require(_0x15b7('0xa'));var csv=require(_0x15b7('0xb'));var ejs=require(_0x15b7('0xc'));var fs=require('fs');var _=require(_0x15b7('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x15b7('0xe'));var deskjs=require(_0x15b7('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x15b7('0x10'));var Redis=require('ioredis');var authService=require(_0x15b7('0x11'));var qs=require(_0x15b7('0x12'));var as=require(_0x15b7('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x15b7('0x14'))(_0x15b7('0x15'));var utils=require('../../config/utils');var config=require(_0x15b7('0x16'));var db=require(_0x15b7('0x17'))['db'];function respondWithStatusCode(_0x39ba23,_0x205fc3){_0x205fc3=_0x205fc3||0xcc;return function(_0x694ea0){if(_0x694ea0){return _0x39ba23['sendStatus'](_0x205fc3);}return _0x39ba23[_0x15b7('0x18')](_0x205fc3)['end']();};}function respondWithResult(_0x29ade5,_0x2e32b2){_0x2e32b2=_0x2e32b2||0xc8;return function(_0x5c77ab){if(_0x5c77ab){return _0x29ade5['status'](_0x2e32b2)[_0x15b7('0x19')](_0x5c77ab);}};}function respondWithFilteredResult(_0x3800a4,_0x2993fb){return function(_0x41a2f3){if(_0x41a2f3){var _0x28c7c8=_0x41a2f3[_0x15b7('0x1a')],_0x1680c7=_0x2993fb[_0x15b7('0x1b')],_0x26c20f=_0x2993fb['offset']+_0x2993fb['limit'],_0x1cd14f;if(_0x26c20f>=_0x28c7c8){_0x26c20f=_0x28c7c8;_0x1cd14f=0xc8;}else{_0x1cd14f=0xce;}_0x3800a4['status'](_0x1cd14f);return _0x3800a4['set'](_0x15b7('0x1c'),_0x1680c7+'-'+_0x26c20f+'/'+_0x28c7c8)['json'](_0x41a2f3);}return null;};}function patchUpdates(_0xbdfc43){return function(_0x505a0e){try{jsonpatch[_0x15b7('0x1d')](_0x505a0e,_0xbdfc43,!![]);}catch(_0x8d2701){return BPromise[_0x15b7('0x1e')](_0x8d2701);}return _0x505a0e[_0x15b7('0x1f')]();};}function saveUpdates(_0x11ea00,_0x397f22){return function(_0x1baa21){if(_0x1baa21){return _0x1baa21[_0x15b7('0x20')](_0x11ea00)['then'](function(_0x1d9e42){return _0x1d9e42;});}return null;};}function removeEntity(_0x49b22e,_0x3258dd){return function(_0x35739b){if(_0x35739b){return _0x35739b[_0x15b7('0x21')]()[_0x15b7('0x22')](function(){_0x49b22e[_0x15b7('0x18')](0xcc)[_0x15b7('0x23')]();});}};}function handleEntityNotFound(_0x15a796,_0x430dab){return function(_0x528d9e){if(!_0x528d9e){_0x15a796['sendStatus'](0x194);}return _0x528d9e;};}function handleError(_0x1a6b16,_0x2246fa){_0x2246fa=_0x2246fa||0x1f4;return function(_0x34aa61){logger['error'](_0x34aa61[_0x15b7('0x24')]);if(_0x34aa61['name']){delete _0x34aa61[_0x15b7('0x25')];}_0x1a6b16[_0x15b7('0x18')](_0x2246fa)[_0x15b7('0x26')](_0x34aa61);};}var utilLicense=require(_0x15b7('0x27'));exports[_0x15b7('0x28')]=function(_0xea6ff8,_0x507df7){var _0x2b843e={'raw':!![],'where':{'id':0x1}},_0x1d4467={};_0x1d4467[_0x15b7('0x29')]=_[_0x15b7('0x2a')](db[_0x15b7('0x2b')][_0x15b7('0x2c')]);_0x1d4467[_0x15b7('0x2d')]=_[_0x15b7('0x2a')](_0xea6ff8[_0x15b7('0x2d')]);_0x1d4467[_0x15b7('0x2e')]=_[_0x15b7('0x2f')](_0x1d4467[_0x15b7('0x29')],_0x1d4467['query']);_0x2b843e['attributes']=_[_0x15b7('0x2f')](_0x1d4467[_0x15b7('0x29')],qs[_0x15b7('0x30')](_0xea6ff8[_0x15b7('0x2d')][_0x15b7('0x30')]));_0x2b843e[_0x15b7('0x31')]=_0x2b843e[_0x15b7('0x31')][_0x15b7('0x32')]?_0x2b843e[_0x15b7('0x31')]:_0x1d4467[_0x15b7('0x29')];_0x2b843e=_['merge']({},_0x2b843e,_0xea6ff8[_0x15b7('0x33')]);return utilLicense[_0x15b7('0x34')](_0x2b843e)[_0x15b7('0x22')](respondWithResult(_0x507df7,null))[_0x15b7('0x35')](handleError(_0x507df7,null));};exports[_0x15b7('0x20')]=function(_0x346fdb,_0x235481){if(_0x346fdb[_0x15b7('0x36')]['id']){delete _0x346fdb[_0x15b7('0x36')]['id'];}return db[_0x15b7('0x2b')][_0x15b7('0x37')]({'where':{'id':_0x346fdb[_0x15b7('0x38')]['id']}})[_0x15b7('0x22')](handleEntityNotFound(_0x235481,null))[_0x15b7('0x22')](function(_0x21b775){var _0x298adf=_0x21b775[_0x15b7('0x39')]({'plain':!![]});return utilLicense[_0x15b7('0x3a')](_0x298adf,_0x346fdb[_0x15b7('0x36')][_0x15b7('0x3b')]);})[_0x15b7('0x22')](function(_0x5849d0){if(!_0x5849d0[_0x15b7('0x3c')]){return saveUpdates(_0x346fdb[_0x15b7('0x36')],null);}return _0x5849d0;})['then'](respondWithResult(_0x235481,null))[_0x15b7('0x35')](handleError(_0x235481,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 7c5a119..6490f20 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 _0x48db=['./license.attributes','exports','License','license','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment'];(function(_0x1ad225,_0x4bd61d){var _0x4277e0=function(_0x4ade1f){while(--_0x4ade1f){_0x1ad225['push'](_0x1ad225['shift']());}};_0x4277e0(++_0x4bd61d);}(_0x48db,0x1e4));var _0xb48d=function(_0x194b3,_0xa8b85){_0x194b3=_0x194b3-0x0;var _0x4e854e=_0x48db[_0x194b3];return _0x4e854e;};'use strict';var _=require(_0xb48d('0x0'));var util=require(_0xb48d('0x1'));var logger=require(_0xb48d('0x2'))(_0xb48d('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb48d('0x4'));var fs=require('fs');var path=require(_0xb48d('0x5'));var rimraf=require(_0xb48d('0x6'));var config=require(_0xb48d('0x7'));var attributes=require(_0xb48d('0x8'));module[_0xb48d('0x9')]=function(_0x36ef09,_0x188676){return _0x36ef09['define'](_0xb48d('0xa'),attributes,{'tableName':_0xb48d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xad9b=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','./license.attributes','License','license'];(function(_0x534b50,_0x1cd55d){var _0x2590d4=function(_0x2e7fca){while(--_0x2e7fca){_0x534b50['push'](_0x534b50['shift']());}};_0x2590d4(++_0x1cd55d);}(_0xad9b,0x10e));var _0xbad9=function(_0x3d3198,_0x1777da){_0x3d3198=_0x3d3198-0x0;var _0x42882c=_0xad9b[_0x3d3198];return _0x42882c;};'use strict';var _=require(_0xbad9('0x0'));var util=require('util');var logger=require(_0xbad9('0x1'))(_0xbad9('0x2'));var moment=require(_0xbad9('0x3'));var BPromise=require(_0xbad9('0x4'));var rp=require(_0xbad9('0x5'));var fs=require('fs');var path=require(_0xbad9('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbad9('0x7'));module['exports']=function(_0xbca672,_0x4a77f1){return _0xbca672['define'](_0xbad9('0x8'),attributes,{'tableName':_0xbad9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index c1369ec..1227d68 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 _0x8c50=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','then','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','util','moment','randomstring','ioredis'];(function(_0x54b670,_0x7b57c2){var _0xbe3c1=function(_0x2ff1b9){while(--_0x2ff1b9){_0x54b670['push'](_0x54b670['shift']());}};_0xbe3c1(++_0x7b57c2);}(_0x8c50,0xcd));var _0x08c5=function(_0x50e4c4,_0x2af59f){_0x50e4c4=_0x50e4c4-0x0;var _0x304775=_0x8c50[_0x50e4c4];return _0x304775;};'use strict';var _=require('lodash');var util=require(_0x08c5('0x0'));var moment=require(_0x08c5('0x1'));var BPromise=require('bluebird');var rs=require(_0x08c5('0x2'));var fs=require('fs');var Redis=require(_0x08c5('0x3'));var db=require(_0x08c5('0x4'))['db'];var utils=require(_0x08c5('0x5'));var logger=require(_0x08c5('0x6'))('rpc');var config=require(_0x08c5('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x08c5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x42c7da,_0x49bfcd,_0x3f32b4){return new BPromise(function(_0x4b179d,_0xd91fea){return client['request'](_0x42c7da,_0x3f32b4)[_0x08c5('0x9')](function(_0x316143){logger['info'](_0x08c5('0xa'),_0x49bfcd,_0x08c5('0xb'));logger[_0x08c5('0xc')](_0x08c5('0xd'),_0x49bfcd,_0x08c5('0xb'),JSON[_0x08c5('0xe')](_0x316143));if(_0x316143[_0x08c5('0xf')]){if(_0x316143[_0x08c5('0xf')]['code']===0x1f4){logger['error'](_0x08c5('0xa'),_0x49bfcd,_0x316143[_0x08c5('0xf')][_0x08c5('0x10')]);return _0xd91fea(_0x316143[_0x08c5('0xf')]['message']);}logger[_0x08c5('0xf')](_0x08c5('0xa'),_0x49bfcd,_0x316143[_0x08c5('0xf')][_0x08c5('0x10')]);return _0x4b179d(_0x316143[_0x08c5('0xf')][_0x08c5('0x10')]);}else{logger[_0x08c5('0x11')]('License,\x20%s,\x20%s',_0x49bfcd,_0x08c5('0xb'));_0x4b179d(_0x316143['result'][_0x08c5('0x10')]);}})[_0x08c5('0x12')](function(_0x2ed833){logger[_0x08c5('0xf')]('License,\x20%s,\x20%s',_0x49bfcd,_0x2ed833);_0xd91fea(_0x2ed833);});});} \ No newline at end of file +var _0xad13=['catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','License,\x20%s,\x20%s','debug','License,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result'];(function(_0x225f1f,_0x324b88){var _0x598dd2=function(_0x896965){while(--_0x896965){_0x225f1f['push'](_0x225f1f['shift']());}};_0x598dd2(++_0x324b88);}(_0xad13,0x79));var _0x3ad1=function(_0x22272e,_0x3b4c97){_0x22272e=_0x22272e-0x0;var _0x40d7d7=_0xad13[_0x22272e];return _0x40d7d7;};'use strict';var _=require(_0x3ad1('0x0'));var util=require('util');var moment=require(_0x3ad1('0x1'));var BPromise=require(_0x3ad1('0x2'));var rs=require(_0x3ad1('0x3'));var fs=require('fs');var Redis=require(_0x3ad1('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3ad1('0x5'));var logger=require(_0x3ad1('0x6'))(_0x3ad1('0x7'));var config=require(_0x3ad1('0x8'));var jayson=require(_0x3ad1('0x9'));var client=jayson[_0x3ad1('0xa')][_0x3ad1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x23ed63,_0x44fd50,_0x313ad9){return new BPromise(function(_0x4d27b0,_0x2429f4){return client[_0x3ad1('0xc')](_0x23ed63,_0x313ad9)[_0x3ad1('0xd')](function(_0x4e93df){logger[_0x3ad1('0xe')](_0x3ad1('0xf'),_0x44fd50,'request\x20sent');logger[_0x3ad1('0x10')](_0x3ad1('0x11'),_0x44fd50,_0x3ad1('0x12'),JSON[_0x3ad1('0x13')](_0x4e93df));if(_0x4e93df[_0x3ad1('0x14')]){if(_0x4e93df[_0x3ad1('0x14')]['code']===0x1f4){logger['error'](_0x3ad1('0xf'),_0x44fd50,_0x4e93df[_0x3ad1('0x14')][_0x3ad1('0x15')]);return _0x2429f4(_0x4e93df[_0x3ad1('0x14')]['message']);}logger[_0x3ad1('0x14')]('License,\x20%s,\x20%s',_0x44fd50,_0x4e93df[_0x3ad1('0x14')][_0x3ad1('0x15')]);return _0x4d27b0(_0x4e93df[_0x3ad1('0x14')][_0x3ad1('0x15')]);}else{logger[_0x3ad1('0xe')](_0x3ad1('0xf'),_0x44fd50,_0x3ad1('0x12'));_0x4d27b0(_0x4e93df[_0x3ad1('0x16')][_0x3ad1('0x15')]);}})[_0x3ad1('0x17')](function(_0x1d924e){logger[_0x3ad1('0x14')]('License,\x20%s,\x20%s',_0x44fd50,_0x1d924e);_0x2429f4(_0x1d924e);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 1e1b457..61313af 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 _0x06e0=['isAuthenticated','/describe','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','/:id/verify','verifySmtp','/:id/users','getAgents','post','addDisposition','create','addImap','addInteraction','/:id/send','addAgents','put','update','delete','removeAnswers','removeImap','removeSmtp','destroy','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x34a2d7,_0x3a185f){var _0x250f94=function(_0x21c1ae){while(--_0x21c1ae){_0x34a2d7['push'](_0x34a2d7['shift']());}};_0x250f94(++_0x3a185f);}(_0x06e0,0x80));var _0x006e=function(_0x18c55f,_0x327651){_0x18c55f=_0x18c55f-0x0;var _0x334690=_0x06e0[_0x18c55f];return _0x334690;};'use strict';var multer=require(_0x006e('0x0'));var util=require(_0x006e('0x1'));var path=require(_0x006e('0x2'));var timeout=require(_0x006e('0x3'));var express=require(_0x006e('0x4'));var router=express[_0x006e('0x5')]();var auth=require(_0x006e('0x6'));var interaction=require(_0x006e('0x7'));var config=require(_0x006e('0x8'));var controller=require('./mailAccount.controller');router[_0x006e('0x9')]('/',auth[_0x006e('0xa')](),controller['index']);router[_0x006e('0x9')](_0x006e('0xb'),auth[_0x006e('0xa')](),controller[_0x006e('0xc')]);router[_0x006e('0x9')](_0x006e('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x006e('0x9')](_0x006e('0xe'),auth[_0x006e('0xa')](),controller[_0x006e('0xf')]);router[_0x006e('0x9')](_0x006e('0x10'),auth['isAuthenticated'](),controller[_0x006e('0x11')]);router['get'](_0x006e('0x12'),auth[_0x006e('0xa')](),controller[_0x006e('0x13')]);router[_0x006e('0x9')](_0x006e('0x14'),auth[_0x006e('0xa')](),controller[_0x006e('0x15')]);router['get'](_0x006e('0x16'),auth[_0x006e('0xa')](),controller[_0x006e('0x17')]);router[_0x006e('0x9')](_0x006e('0x18'),auth['isAuthenticated'](),controller[_0x006e('0x19')]);router[_0x006e('0x9')](_0x006e('0x1a'),auth['isAuthenticated'](),controller['getMessages']);router[_0x006e('0x9')](_0x006e('0x1b'),auth[_0x006e('0xa')](),controller[_0x006e('0x1c')]);router['get'](_0x006e('0x1d'),auth[_0x006e('0xa')](),controller[_0x006e('0x1e')]);router[_0x006e('0x1f')](_0x006e('0xe'),auth[_0x006e('0xa')](),controller[_0x006e('0x20')]);router[_0x006e('0x1f')](_0x006e('0x10'),auth[_0x006e('0xa')](),controller['addAnswer']);router[_0x006e('0x1f')]('/',auth[_0x006e('0xa')](),controller[_0x006e('0x21')]);router[_0x006e('0x1f')](_0x006e('0x12'),auth[_0x006e('0xa')](),controller[_0x006e('0x22')]);router[_0x006e('0x1f')](_0x006e('0x14'),auth[_0x006e('0xa')](),controller['addSmtp']);router[_0x006e('0x1f')](_0x006e('0x16'),auth['isAuthenticated'](),controller[_0x006e('0x23')]);router[_0x006e('0x1f')](_0x006e('0x18'),auth['isAuthenticated'](),controller['addApplications']);router[_0x006e('0x1f')](_0x006e('0x24'),auth['isAuthenticated'](),controller['send']);router[_0x006e('0x1f')](_0x006e('0x1d'),auth[_0x006e('0xa')](),controller[_0x006e('0x25')]);router[_0x006e('0x26')](_0x006e('0xd'),auth[_0x006e('0xa')](),controller[_0x006e('0x27')]);router[_0x006e('0x28')](_0x006e('0xe'),auth[_0x006e('0xa')](),controller['removeDispositions']);router[_0x006e('0x28')](_0x006e('0x10'),auth['isAuthenticated'](),controller[_0x006e('0x29')]);router[_0x006e('0x28')](_0x006e('0x12'),auth[_0x006e('0xa')](),controller[_0x006e('0x2a')]);router[_0x006e('0x28')](_0x006e('0x14'),auth[_0x006e('0xa')](),controller[_0x006e('0x2b')]);router[_0x006e('0x28')](_0x006e('0xd'),auth[_0x006e('0xa')](),controller[_0x006e('0x2c')]);router[_0x006e('0x28')](_0x006e('0x1d'),auth[_0x006e('0xa')](),controller[_0x006e('0x2d')]);module['exports']=router; \ No newline at end of file +var _0xe039=['delete','removeImap','/:id/out_servers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','index','/describe','isAuthenticated','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','/:id/users','post','addAnswer','create','addImap','addSmtp','addInteraction','addApplications','/:id/send','send','addAgents','update','removeDispositions'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe039,0x1a3));var _0x9e03=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0xe039[_0x4e9628];return _0x27bc8c;};'use strict';var multer=require(_0x9e03('0x0'));var util=require(_0x9e03('0x1'));var path=require(_0x9e03('0x2'));var timeout=require(_0x9e03('0x3'));var express=require(_0x9e03('0x4'));var router=express[_0x9e03('0x5')]();var auth=require(_0x9e03('0x6'));var interaction=require(_0x9e03('0x7'));var config=require(_0x9e03('0x8'));var controller=require(_0x9e03('0x9'));router[_0x9e03('0xa')]('/',auth['isAuthenticated'](),controller[_0x9e03('0xb')]);router['get'](_0x9e03('0xc'),auth[_0x9e03('0xd')](),controller['describe']);router['get'](_0x9e03('0xe'),auth['isAuthenticated'](),controller[_0x9e03('0xf')]);router[_0x9e03('0xa')](_0x9e03('0x10'),auth['isAuthenticated'](),controller['getDispositions']);router[_0x9e03('0xa')](_0x9e03('0x11'),auth['isAuthenticated'](),controller[_0x9e03('0x12')]);router[_0x9e03('0xa')](_0x9e03('0x13'),auth[_0x9e03('0xd')](),controller[_0x9e03('0x14')]);router[_0x9e03('0xa')]('/:id/out_servers',auth[_0x9e03('0xd')](),controller['getSmtp']);router['get'](_0x9e03('0x15'),auth[_0x9e03('0xd')](),controller[_0x9e03('0x16')]);router['get'](_0x9e03('0x17'),auth['isAuthenticated'](),controller[_0x9e03('0x18')]);router[_0x9e03('0xa')](_0x9e03('0x19'),auth['isAuthenticated'](),controller[_0x9e03('0x1a')]);router[_0x9e03('0xa')](_0x9e03('0x1b'),auth[_0x9e03('0xd')](),controller['verifySmtp']);router[_0x9e03('0xa')](_0x9e03('0x1c'),auth[_0x9e03('0xd')](),controller['getAgents']);router['post'](_0x9e03('0x10'),auth[_0x9e03('0xd')](),controller['addDisposition']);router[_0x9e03('0x1d')](_0x9e03('0x11'),auth[_0x9e03('0xd')](),controller[_0x9e03('0x1e')]);router[_0x9e03('0x1d')]('/',auth[_0x9e03('0xd')](),controller[_0x9e03('0x1f')]);router[_0x9e03('0x1d')](_0x9e03('0x13'),auth[_0x9e03('0xd')](),controller[_0x9e03('0x20')]);router['post']('/:id/out_servers',auth['isAuthenticated'](),controller[_0x9e03('0x21')]);router[_0x9e03('0x1d')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x9e03('0x22')]);router[_0x9e03('0x1d')]('/:id/applications',auth[_0x9e03('0xd')](),controller[_0x9e03('0x23')]);router[_0x9e03('0x1d')](_0x9e03('0x24'),auth[_0x9e03('0xd')](),controller[_0x9e03('0x25')]);router['post'](_0x9e03('0x1c'),auth['isAuthenticated'](),controller[_0x9e03('0x26')]);router['put']('/:id',auth[_0x9e03('0xd')](),controller[_0x9e03('0x27')]);router['delete'](_0x9e03('0x10'),auth[_0x9e03('0xd')](),controller[_0x9e03('0x28')]);router[_0x9e03('0x29')](_0x9e03('0x11'),auth[_0x9e03('0xd')](),controller['removeAnswers']);router[_0x9e03('0x29')](_0x9e03('0x13'),auth['isAuthenticated'](),controller[_0x9e03('0x2a')]);router[_0x9e03('0x29')](_0x9e03('0x2b'),auth[_0x9e03('0xd')](),controller['removeSmtp']);router[_0x9e03('0x29')](_0x9e03('0xe'),auth[_0x9e03('0xd')](),controller['destroy']);router[_0x9e03('0x29')](_0x9e03('0x1c'),auth[_0x9e03('0xd')](),controller[_0x9e03('0x2c')]);module[_0x9e03('0x2d')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 903d2cd..208e149 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 _0xbd9f=['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','mandatoryDisposition','sequelize','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER'];(function(_0x2cdea4,_0x5a8fae){var _0x100dda=function(_0xcb7498){while(--_0xcb7498){_0x2cdea4['push'](_0x2cdea4['shift']());}};_0x100dda(++_0x5a8fae);}(_0xbd9f,0x68));var _0xfbd9=function(_0x41ebe9,_0x450a7e){_0x41ebe9=_0x41ebe9-0x0;var _0x4ffe5b=_0xbd9f[_0x41ebe9];return _0x4ffe5b;};'use strict';var Sequelize=require(_0xfbd9('0x0'));module['exports']={'description':{'type':Sequelize[_0xfbd9('0x1')]},'name':{'type':Sequelize[_0xfbd9('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0xfbd9('0x2')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize[_0xfbd9('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0xfbd9('0x3')]},'markAsUnread':{'type':Sequelize[_0xfbd9('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xfbd9('0x1')],'allowNull':![],'defaultValue':_0xfbd9('0x4')},'fontSize':{'type':Sequelize[_0xfbd9('0x5')](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xfbd9('0x6');}},'notificationSound':{'type':Sequelize[_0xfbd9('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xfbd9('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xfbd9('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xfbd9('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xfbd9('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0xfbd9('0x7')},'mandatoryDisposition':{'type':Sequelize[_0xfbd9('0x2')],'defaultValue':![],'comment':_0xfbd9('0x8'),'set':function(_0x4bef42){if(!_0x4bef42)this['setDataValue']('mandatoryDispositionPauseId',null);this['setDataValue'](_0xfbd9('0x9'),_0x4bef42);}}}; \ No newline at end of file +var _0x031c=['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','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER'];(function(_0xa89d9c,_0x375f83){var _0x2cfe5e=function(_0x29fe06){while(--_0x29fe06){_0xa89d9c['push'](_0xa89d9c['shift']());}};_0x2cfe5e(++_0x375f83);}(_0x031c,0x126));var _0xc031=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x031c[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require(_0xc031('0x0'));module['exports']={'description':{'type':Sequelize[_0xc031('0x1')]},'name':{'type':Sequelize[_0xc031('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0xc031('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0xc031('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xc031('0x2')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0xc031('0x3')]},'markAsUnread':{'type':Sequelize[_0xc031('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xc031('0x1')],'allowNull':![],'defaultValue':_0xc031('0x4')},'fontSize':{'type':Sequelize[_0xc031('0x5')](0x2)[_0xc031('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xc031('0x7');}},'notificationSound':{'type':Sequelize[_0xc031('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xc031('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xc031('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc031('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc031('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xc031('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0xc031('0x8')},'mandatoryDisposition':{'type':Sequelize[_0xc031('0x2')],'defaultValue':![],'comment':_0xc031('0x9'),'set':function(_0x11a018){if(!_0x11a018)this[_0xc031('0xa')](_0xc031('0xb'),null);this[_0xc031('0xa')]('mandatoryDisposition',_0x11a018);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index f1f8647..109c592 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 _0xc22b=['html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailAccount.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','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','limit','set','apply','reject','update','destroy','get','MailAccounts','UserProfileResource','then','sendStatus','stack','name','send','index','Smtp','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','pick','filters','filter','where','merge','field','count','include','rows','show','params','MailServerIn','MailServerOut','includeAll','find','body','Imap','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','removeDispositions','ids','CannedAnswer','getAnswers','options','findAll','removeAnswers','email','ListId','isNil','active','description','cuser','password','pass','cpassword','authentication','host','port','service','cservice','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','omit','getInteractions','MailInteraction','CmContact','Contact','User','Owner','fullname','internal','Tag','tag','addApplications','sequelize','transaction','MailApplication','bulkCreate','findAndCountAll','priority','getApplications','getMessages','MailMessage','$gte','format','split','CmList','Contacts','updatedAt','DESC','from','%s\x20<%s>','attachments','join','root','server/files/attachments','auth','secure','List\x20not\x20found','List','messageId','subject','attach','YYYY-MM-DD\x20HH:mm:ss','out','Interaction','Messages','verifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','emit','getAgents'];(function(_0x3cd41a,_0x37f713){var _0x4cee11=function(_0x30c2a6){while(--_0x30c2a6){_0x3cd41a['push'](_0x3cd41a['shift']());}};_0x4cee11(++_0x37f713);}(_0xc22b,0x18e));var _0xbc22=function(_0x154940,_0x1b13bb){_0x154940=_0x154940-0x0;var _0x3741af=_0xc22b[_0x154940];return _0x3741af;};'use strict';var pdf=require(_0xbc22('0x0'));var emlformat=require(_0xbc22('0x1'));var rimraf=require(_0xbc22('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbc22('0x3'));var rp=require(_0xbc22('0x4'));var moment=require('moment');var BPromise=require(_0xbc22('0x5'));var Mustache=require(_0xbc22('0x6'));var util=require(_0xbc22('0x7'));var path=require(_0xbc22('0x8'));var sox=require(_0xbc22('0x9'));var csv=require(_0xbc22('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xbc22('0xb'));var squel=require(_0xbc22('0xc'));var crypto=require(_0xbc22('0xd'));var jsforce=require(_0xbc22('0xe'));var deskjs=require(_0xbc22('0xf'));var toCsv=require(_0xbc22('0xa'));var querystring=require(_0xbc22('0x10'));var Papa=require('papaparse');var Redis=require(_0xbc22('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xbc22('0x12'))(_0xbc22('0x13'));var utils=require(_0xbc22('0x14'));var config=require(_0xbc22('0x15'));var db=require(_0xbc22('0x16'))['db'];config[_0xbc22('0x17')]=_[_0xbc22('0x18')](config[_0xbc22('0x17')],{'host':_0xbc22('0x19'),'port':0x18eb});var socket=require(_0xbc22('0x1a'))(new Redis(config[_0xbc22('0x17')]));require(_0xbc22('0x1b'))[_0xbc22('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0xbc22('0x1d')][_0xbc22('0x1e')]({'port':0x232b});function checkPasswordPattern(_0x3ffdef,_0x1c14c9,_0x1a64a5){if(_0x1a64a5){var _0xd1c5a0=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xd1c5a0[_0xbc22('0x1f')](_0x1c14c9)){return _0x3ffdef;}else{throw new Error(_0xbc22('0x20'));}}else{return _0x3ffdef;}}function respondWithRpcPromise(_0x5dbd57,_0x53ebe7,_0x2d43dd,_0x1304c5){return new BPromise(function(_0x3dc229,_0x522124){var _0x5b7375=_0x1304c5||client;return _0x5b7375[_0xbc22('0x21')](_0x5dbd57,_0x2d43dd)['then'](function(_0xbf7f2f){logger[_0xbc22('0x22')](_0xbc22('0x23'),_0x53ebe7,_0xbc22('0x24'));logger[_0xbc22('0x25')](_0xbc22('0x26'),_0x53ebe7,_0xbc22('0x24'),JSON[_0xbc22('0x27')](_0xbf7f2f));if(_0xbf7f2f['error']){if(_0xbf7f2f[_0xbc22('0x28')][_0xbc22('0x29')]===0x1f4){logger[_0xbc22('0x28')]('MailAccount,\x20%s,\x20%s',_0x53ebe7,_0xbf7f2f[_0xbc22('0x28')][_0xbc22('0x2a')]);return _0x522124(_0xbf7f2f[_0xbc22('0x28')]['message']);}logger[_0xbc22('0x28')]('MailAccount,\x20%s,\x20%s',_0x53ebe7,_0xbf7f2f[_0xbc22('0x28')][_0xbc22('0x2a')]);return _0x3dc229(_0xbf7f2f[_0xbc22('0x28')]['message']);}else{logger[_0xbc22('0x22')]('MailAccount,\x20%s,\x20%s',_0x53ebe7,_0xbc22('0x24'));_0x3dc229(_0xbf7f2f[_0xbc22('0x2b')][_0xbc22('0x2a')]);}})[_0xbc22('0x2c')](function(_0x487a4d){logger['error'](_0xbc22('0x23'),_0x53ebe7,_0x487a4d);_0x522124(_0x487a4d);});});}function respondWithStatusCode(_0x1d1a4a,_0x391a13){_0x391a13=_0x391a13||0xcc;return function(_0x6cb5e5){if(_0x6cb5e5){return _0x1d1a4a['sendStatus'](_0x391a13);}return _0x1d1a4a[_0xbc22('0x2d')](_0x391a13)[_0xbc22('0x2e')]();};}function respondWithResult(_0x3a7e7c,_0x278503){_0x278503=_0x278503||0xc8;return function(_0x175a37){if(_0x175a37){return _0x3a7e7c[_0xbc22('0x2d')](_0x278503)[_0xbc22('0x2f')](_0x175a37);}};}function respondWithFilteredResult(_0x57f19c,_0x5b5032){return function(_0x10dcbf){if(_0x10dcbf){var _0x73a58a=_0x10dcbf['count'],_0x388fce=_0x5b5032['offset'],_0x332c39=_0x5b5032['offset']+_0x5b5032[_0xbc22('0x30')],_0x5047e8;if(_0x332c39>=_0x73a58a){_0x332c39=_0x73a58a;_0x5047e8=0xc8;}else{_0x5047e8=0xce;}_0x57f19c[_0xbc22('0x2d')](_0x5047e8);return _0x57f19c[_0xbc22('0x31')]('Content-Range',_0x388fce+'-'+_0x332c39+'/'+_0x73a58a)[_0xbc22('0x2f')](_0x10dcbf);}return null;};}function patchUpdates(_0x3f07d1){return function(_0xca78b6){try{jsonpatch[_0xbc22('0x32')](_0xca78b6,_0x3f07d1,!![]);}catch(_0x2d5976){return BPromise[_0xbc22('0x33')](_0x2d5976);}return _0xca78b6['save']();};}function saveUpdates(_0x19a3a9,_0x57acd9){return function(_0x137427){if(_0x137427){return _0x137427[_0xbc22('0x34')](_0x19a3a9)['then'](function(_0x188157){return _0x188157;});}return null;};}function removeEntity(_0x2b3a5d,_0x47e7d4){return function(_0x48ac0f){if(_0x48ac0f){return _0x48ac0f[_0xbc22('0x35')]()['then'](function(){var _0x20e6c6=_0x48ac0f[_0xbc22('0x36')]({'plain':!![]});var _0x438b7b=_0xbc22('0x37');return db[_0xbc22('0x38')][_0xbc22('0x35')]({'where':{'type':_0x438b7b,'resourceId':_0x20e6c6['id']}})[_0xbc22('0x39')](function(){return _0x48ac0f;});})[_0xbc22('0x39')](function(){_0x2b3a5d[_0xbc22('0x2d')](0xcc)[_0xbc22('0x2e')]();});}};}function handleEntityNotFound(_0x32a7de,_0x5104a8){return function(_0x197698){if(!_0x197698){_0x32a7de[_0xbc22('0x3a')](0x194);}return _0x197698;};}function handleError(_0x517d73,_0x487eee){_0x487eee=_0x487eee||0x1f4;return function(_0x280474){logger[_0xbc22('0x28')](_0x280474[_0xbc22('0x3b')]);if(_0x280474['name']){delete _0x280474[_0xbc22('0x3c')];}_0x517d73[_0xbc22('0x2d')](_0x487eee)[_0xbc22('0x3d')](_0x280474);};}exports[_0xbc22('0x3e')]=function(_0x4384bd,_0x5a7a94){var _0x2166d6={'include':[{'model':db['MailServerIn'],'as':'Imap'},{'model':db['MailServerOut'],'as':_0xbc22('0x3f')},{'model':db[_0xbc22('0x40')],'as':_0xbc22('0x41')}]},_0x4b73ba={},_0x185343={'count':0x0,'rows':[]};var _0x52a417=_[_0xbc22('0x42')](db[_0xbc22('0x43')][_0xbc22('0x44')],function(_0x4b8d2e){return{'name':_0x4b8d2e[_0xbc22('0x45')],'type':_0x4b8d2e['type'][_0xbc22('0x46')]};});_0x4b73ba[_0xbc22('0x47')]=_[_0xbc22('0x42')](_0x52a417,'name');_0x4b73ba[_0xbc22('0x48')]=_[_0xbc22('0x49')](_0x4384bd[_0xbc22('0x48')]);_0x4b73ba['filters']=_[_0xbc22('0x4a')](_0x4b73ba[_0xbc22('0x47')],_0x4b73ba[_0xbc22('0x48')]);_0x2166d6[_0xbc22('0x4b')]=_[_0xbc22('0x4a')](_0x4b73ba[_0xbc22('0x47')],qs['fields'](_0x4384bd[_0xbc22('0x48')][_0xbc22('0x4c')]));_0x2166d6['attributes']=_0x2166d6[_0xbc22('0x4b')][_0xbc22('0x4d')]?_0x2166d6[_0xbc22('0x4b')]:_0x4b73ba[_0xbc22('0x47')];if(!_0x4384bd[_0xbc22('0x48')][_0xbc22('0x4e')](_0xbc22('0x4f'))){_0x2166d6[_0xbc22('0x30')]=qs[_0xbc22('0x30')](_0x4384bd[_0xbc22('0x48')][_0xbc22('0x30')]);_0x2166d6[_0xbc22('0x50')]=qs[_0xbc22('0x50')](_0x4384bd[_0xbc22('0x48')][_0xbc22('0x50')]);}_0x2166d6[_0xbc22('0x51')]=qs[_0xbc22('0x52')](_0x4384bd['query'][_0xbc22('0x52')]);_0x2166d6['where']=qs['filters'](_[_0xbc22('0x53')](_0x4384bd[_0xbc22('0x48')],_0x4b73ba[_0xbc22('0x54')]));if(_0x4384bd[_0xbc22('0x48')][_0xbc22('0x55')]){_0x2166d6[_0xbc22('0x56')]=_[_0xbc22('0x57')](_0x2166d6[_0xbc22('0x56')],{'$or':_['map'](_0x52a417,function(_0x29dc77){if(_0x29dc77['type']['key']!=='VIRTUAL'){var _0xba3f38={};_0xba3f38[_0x29dc77[_0xbc22('0x58')]]={'$like':'%'+_0x4384bd[_0xbc22('0x48')][_0xbc22('0x55')]+'%'};return _0xba3f38;}})});}_0x2166d6=_[_0xbc22('0x57')]({},_0x2166d6,_0x4384bd['options']);var _0x5aab30={'where':_0x2166d6[_0xbc22('0x56')]};return db['MailAccount']['count'](_0x5aab30)[_0xbc22('0x39')](function(_0x2b8147){_0x185343[_0xbc22('0x59')]=_0x2b8147;if(_0x4384bd['query']['includeAll']){_0x2166d6[_0xbc22('0x5a')]=[{'all':!![]}];}return db[_0xbc22('0x43')]['findAll'](_0x2166d6);})[_0xbc22('0x39')](function(_0x1ae668){_0x185343[_0xbc22('0x5b')]=_0x1ae668;return _0x185343;})[_0xbc22('0x39')](respondWithFilteredResult(_0x5a7a94,_0x2166d6))['catch'](handleError(_0x5a7a94,null));};exports[_0xbc22('0x5c')]=function(_0x1eb3fb,_0x13c557){var _0x572207={'raw':![],'where':{'id':_0x1eb3fb[_0xbc22('0x5d')]['id']},'include':[{'model':db[_0xbc22('0x5e')],'as':'Imap'},{'model':db[_0xbc22('0x5f')],'as':_0xbc22('0x3f')},{'model':db[_0xbc22('0x40')],'as':'mandatoryDispositionPause'}]},_0x59f819={};_0x59f819['model']=_[_0xbc22('0x49')](db['MailAccount'][_0xbc22('0x44')]);_0x59f819[_0xbc22('0x48')]=_[_0xbc22('0x49')](_0x1eb3fb[_0xbc22('0x48')]);_0x59f819[_0xbc22('0x54')]=_['intersection'](_0x59f819[_0xbc22('0x47')],_0x59f819[_0xbc22('0x48')]);_0x572207['attributes']=_[_0xbc22('0x4a')](_0x59f819[_0xbc22('0x47')],qs[_0xbc22('0x4c')](_0x1eb3fb['query'][_0xbc22('0x4c')]));_0x572207[_0xbc22('0x4b')]=_0x572207[_0xbc22('0x4b')]['length']?_0x572207['attributes']:_0x59f819[_0xbc22('0x47')];if(_0x1eb3fb[_0xbc22('0x48')][_0xbc22('0x60')]){_0x572207[_0xbc22('0x5a')]=[{'all':!![]}];}_0x572207=_['merge']({},_0x572207,_0x1eb3fb['options']);return db['MailAccount'][_0xbc22('0x61')](_0x572207)[_0xbc22('0x39')](handleEntityNotFound(_0x13c557,null))[_0xbc22('0x39')](respondWithResult(_0x13c557,null))[_0xbc22('0x2c')](handleError(_0x13c557,null));};exports['update']=function(_0x9a0800,_0x4526fd){if(_0x9a0800['body']['id']){delete _0x9a0800[_0xbc22('0x62')]['id'];}return db[_0xbc22('0x43')][_0xbc22('0x61')]({'where':{'id':_0x9a0800[_0xbc22('0x5d')]['id']},'include':[{'model':db[_0xbc22('0x5e')],'as':'Imap'},{'model':db[_0xbc22('0x5f')],'as':_0xbc22('0x3f')},{'model':db[_0xbc22('0x40')],'as':_0xbc22('0x41')}]})['then'](handleEntityNotFound(_0x4526fd,null))[_0xbc22('0x39')](saveUpdates(_0x9a0800[_0xbc22('0x62')],null))['then'](function(_0x1f659f){if(_0x1f659f&&_0x9a0800[_0xbc22('0x62')]['Imap']){return db[_0xbc22('0x5e')][_0xbc22('0x34')](_0x9a0800[_0xbc22('0x62')][_0xbc22('0x63')],{'where':{'MailAccountId':_0x1f659f['id']}})[_0xbc22('0x39')](function(){return _0x1f659f;});}return _0x1f659f;})['then'](function(_0x3fe090){if(_0x3fe090&&_0x9a0800[_0xbc22('0x62')][_0xbc22('0x3f')]){return db['MailServerOut'][_0xbc22('0x34')](_0x9a0800[_0xbc22('0x62')][_0xbc22('0x3f')],{'where':{'MailAccountId':_0x3fe090['id']}})['then'](function(){return _0x3fe090;});}return _0x3fe090;})[_0xbc22('0x39')](respondWithResult(_0x4526fd,null))[_0xbc22('0x2c')](handleError(_0x4526fd,null));};exports[_0xbc22('0x64')]=function(_0x40f627,_0x2d032c){return db['MailAccount']['describe']()[_0xbc22('0x39')](respondWithResult(_0x2d032c,null))[_0xbc22('0x2c')](handleError(_0x2d032c,null));};exports[_0xbc22('0x65')]=function(_0x10976e,_0x3085eb,_0x450446){if(_0x10976e[_0xbc22('0x62')]['id']){delete _0x10976e[_0xbc22('0x62')]['id'];}return db['MailAccount'][_0xbc22('0x61')]({'where':{'id':_0x10976e[_0xbc22('0x5d')]['id']}})[_0xbc22('0x39')](handleEntityNotFound(_0x3085eb,null))[_0xbc22('0x39')](function(_0x23dbb2){if(_0x23dbb2){_0x10976e[_0xbc22('0x62')][_0xbc22('0x66')]=_0x23dbb2['id'];return db[_0xbc22('0x67')][_0xbc22('0x68')](_0x10976e[_0xbc22('0x62')]);}})[_0xbc22('0x39')](respondWithResult(_0x3085eb,null))[_0xbc22('0x2c')](handleError(_0x3085eb,null));};exports[_0xbc22('0x69')]=function(_0x2717a1,_0x142aac,_0x31f345){var _0x1c10da={'raw':![],'where':{}};var _0x3578c8={};var _0x54ce30={'count':0x0,'rows':[]};return db[_0xbc22('0x43')][_0xbc22('0x6a')]({'where':{'id':_0x2717a1['params']['id']}})[_0xbc22('0x39')](handleEntityNotFound(_0x142aac,null))['then'](function(_0x187450){if(_0x187450){_0x3578c8[_0xbc22('0x47')]=_[_0xbc22('0x49')](db[_0xbc22('0x67')][_0xbc22('0x44')]);_0x3578c8[_0xbc22('0x48')]=_['keys'](_0x2717a1[_0xbc22('0x48')]);_0x3578c8[_0xbc22('0x54')]=_[_0xbc22('0x4a')](_0x3578c8['model'],_0x3578c8[_0xbc22('0x48')]);_0x1c10da[_0xbc22('0x4b')]=_[_0xbc22('0x4a')](_0x3578c8[_0xbc22('0x47')],qs[_0xbc22('0x4c')](_0x2717a1[_0xbc22('0x48')][_0xbc22('0x4c')]));_0x1c10da['attributes']=_0x1c10da[_0xbc22('0x4b')][_0xbc22('0x4d')]?_0x1c10da['attributes']:_0x3578c8['model'];if(!_0x2717a1[_0xbc22('0x48')]['hasOwnProperty'](_0xbc22('0x4f'))){_0x1c10da[_0xbc22('0x30')]=qs['limit'](_0x2717a1[_0xbc22('0x48')]['limit']);_0x1c10da[_0xbc22('0x50')]=qs[_0xbc22('0x50')](_0x2717a1[_0xbc22('0x48')][_0xbc22('0x50')]);}_0x1c10da['order']=qs[_0xbc22('0x52')](_0x2717a1[_0xbc22('0x48')][_0xbc22('0x52')]);_0x1c10da[_0xbc22('0x56')]=qs[_0xbc22('0x54')](_[_0xbc22('0x53')](_0x2717a1[_0xbc22('0x48')],_0x3578c8['filters']));_0x1c10da[_0xbc22('0x56')]['MailAccountId']=_0x187450['id'];if(_0x2717a1[_0xbc22('0x48')][_0xbc22('0x55')]){_0x1c10da[_0xbc22('0x56')]=_[_0xbc22('0x57')](_0x1c10da['where'],{'$or':_['map'](_0x1c10da[_0xbc22('0x4b')],function(_0x28f1d4){var _0x5c83cd={};_0x5c83cd[_0x28f1d4]={'$like':'%'+_0x2717a1[_0xbc22('0x48')][_0xbc22('0x55')]+'%'};return _0x5c83cd;})});}_0x1c10da=_[_0xbc22('0x57')]({},_0x1c10da,_0x2717a1['options']);return db['Disposition'][_0xbc22('0x59')]({'where':_0x1c10da['where']})['then'](function(_0x5561d2){_0x54ce30[_0xbc22('0x59')]=_0x5561d2;if(_0x2717a1[_0xbc22('0x48')][_0xbc22('0x60')]){_0x1c10da[_0xbc22('0x5a')]=[{'all':!![]}];}return db[_0xbc22('0x67')]['findAll'](_0x1c10da);})['then'](function(_0x254136){_0x54ce30[_0xbc22('0x5b')]=_0x254136;return _0x54ce30;});}})[_0xbc22('0x39')](respondWithFilteredResult(_0x142aac,_0x1c10da))[_0xbc22('0x2c')](handleError(_0x142aac,null));};exports['removeDispositions']=function(_0x4d15bb,_0x5c581c,_0x15cd23){return db[_0xbc22('0x43')][_0xbc22('0x61')]({'where':{'id':_0x4d15bb['params']['id']}})[_0xbc22('0x39')](handleEntityNotFound(_0x5c581c,null))[_0xbc22('0x39')](function(_0x4f8984){if(_0x4f8984){return _0x4f8984[_0xbc22('0x6b')](_0x4d15bb['query'][_0xbc22('0x6c')]);}})[_0xbc22('0x39')](respondWithStatusCode(_0x5c581c,null))[_0xbc22('0x2c')](handleError(_0x5c581c,null));};exports['addAnswer']=function(_0x29ae87,_0x2c25c4,_0x1d7b49){if(_0x29ae87[_0xbc22('0x62')]['id']){delete _0x29ae87[_0xbc22('0x62')]['id'];}return db['MailAccount'][_0xbc22('0x61')]({'where':{'id':_0x29ae87[_0xbc22('0x5d')]['id']}})[_0xbc22('0x39')](handleEntityNotFound(_0x2c25c4,null))[_0xbc22('0x39')](function(_0x129f85){if(_0x129f85){_0x29ae87[_0xbc22('0x62')][_0xbc22('0x66')]=_0x129f85['id'];return db[_0xbc22('0x6d')][_0xbc22('0x68')](_0x29ae87['body']);}})[_0xbc22('0x39')](respondWithResult(_0x2c25c4,null))[_0xbc22('0x2c')](handleError(_0x2c25c4,null));};exports[_0xbc22('0x6e')]=function(_0x517706,_0x349318,_0x4d3952){var _0x5c3e96={'raw':![],'where':{}};var _0x1b0eea={};var _0x3878ba={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x517706[_0xbc22('0x5d')]['id']}})[_0xbc22('0x39')](handleEntityNotFound(_0x349318,null))[_0xbc22('0x39')](function(_0x2b2998){if(_0x2b2998){_0x1b0eea['model']=_[_0xbc22('0x49')](db[_0xbc22('0x6d')][_0xbc22('0x44')]);_0x1b0eea[_0xbc22('0x48')]=_['keys'](_0x517706[_0xbc22('0x48')]);_0x1b0eea['filters']=_['intersection'](_0x1b0eea[_0xbc22('0x47')],_0x1b0eea['query']);_0x5c3e96[_0xbc22('0x4b')]=_[_0xbc22('0x4a')](_0x1b0eea[_0xbc22('0x47')],qs[_0xbc22('0x4c')](_0x517706[_0xbc22('0x48')]['fields']));_0x5c3e96['attributes']=_0x5c3e96[_0xbc22('0x4b')]['length']?_0x5c3e96[_0xbc22('0x4b')]:_0x1b0eea[_0xbc22('0x47')];if(!_0x517706[_0xbc22('0x48')]['hasOwnProperty'](_0xbc22('0x4f'))){_0x5c3e96[_0xbc22('0x30')]=qs[_0xbc22('0x30')](_0x517706[_0xbc22('0x48')][_0xbc22('0x30')]);_0x5c3e96[_0xbc22('0x50')]=qs['offset'](_0x517706[_0xbc22('0x48')]['offset']);}_0x5c3e96['order']=qs[_0xbc22('0x52')](_0x517706[_0xbc22('0x48')][_0xbc22('0x52')]);_0x5c3e96[_0xbc22('0x56')]=qs['filters'](_[_0xbc22('0x53')](_0x517706[_0xbc22('0x48')],_0x1b0eea[_0xbc22('0x54')]));_0x5c3e96[_0xbc22('0x56')][_0xbc22('0x66')]=_0x2b2998['id'];if(_0x517706['query'][_0xbc22('0x55')]){_0x5c3e96[_0xbc22('0x56')]=_['merge'](_0x5c3e96[_0xbc22('0x56')],{'$or':_[_0xbc22('0x42')](_0x5c3e96[_0xbc22('0x4b')],function(_0x3a60ed){var _0xa0fa3c={};_0xa0fa3c[_0x3a60ed]={'$like':'%'+_0x517706[_0xbc22('0x48')][_0xbc22('0x55')]+'%'};return _0xa0fa3c;})});}_0x5c3e96=_['merge']({},_0x5c3e96,_0x517706[_0xbc22('0x6f')]);return db['CannedAnswer'][_0xbc22('0x59')]({'where':_0x5c3e96[_0xbc22('0x56')]})['then'](function(_0x158787){_0x3878ba['count']=_0x158787;if(_0x517706['query']['includeAll']){_0x5c3e96[_0xbc22('0x5a')]=[{'all':!![]}];}return db[_0xbc22('0x6d')][_0xbc22('0x70')](_0x5c3e96);})['then'](function(_0x4d3a7b){_0x3878ba[_0xbc22('0x5b')]=_0x4d3a7b;return _0x3878ba;});}})[_0xbc22('0x39')](respondWithFilteredResult(_0x349318,_0x5c3e96))[_0xbc22('0x2c')](handleError(_0x349318,null));};exports[_0xbc22('0x71')]=function(_0x394202,_0x359777,_0x195724){return db[_0xbc22('0x43')][_0xbc22('0x61')]({'where':{'id':_0x394202['params']['id']}})['then'](handleEntityNotFound(_0x359777,null))['then'](function(_0xdfe1b0){if(_0xdfe1b0){return _0xdfe1b0[_0xbc22('0x71')](_0x394202[_0xbc22('0x48')][_0xbc22('0x6c')]);}})[_0xbc22('0x39')](respondWithStatusCode(_0x359777,null))[_0xbc22('0x2c')](handleError(_0x359777,null));};exports[_0xbc22('0x68')]=function(_0x592d61,_0x1f7669){var _0x91f052={'name':_0x592d61[_0xbc22('0x62')][_0xbc22('0x3c')],'key':_0x592d61[_0xbc22('0x62')][_0xbc22('0x46')],'email':_0x592d61[_0xbc22('0x62')][_0xbc22('0x72')],'ListId':_0x592d61[_0xbc22('0x62')][_0xbc22('0x73')],'active':!_[_0xbc22('0x74')](_0x592d61[_0xbc22('0x62')][_0xbc22('0x75')])?_0x592d61[_0xbc22('0x62')][_0xbc22('0x75')]:!![],'description':_0x592d61[_0xbc22('0x62')][_0xbc22('0x76')]||null,'Imap':{},'Smtp':{}};if(_[_0xbc22('0x74')](_0x592d61['body']['cservice'])){if(_0x592d61['body']['cauthentication']){_0x91f052['Imap']['user']=_0x91f052['Smtp']['user']=_0x592d61[_0xbc22('0x62')][_0xbc22('0x77')];_0x91f052['Imap'][_0xbc22('0x78')]=_0x91f052[_0xbc22('0x3f')][_0xbc22('0x79')]=_0x592d61[_0xbc22('0x62')][_0xbc22('0x7a')];}else{_0x91f052[_0xbc22('0x63')][_0xbc22('0x7b')]=_0x91f052['Smtp'][_0xbc22('0x7b')]=![];}_0x91f052['Imap'][_0xbc22('0x7c')]=_0x592d61[_0xbc22('0x62')][_0xbc22('0x63')][_0xbc22('0x7c')];_0x91f052['Imap'][_0xbc22('0x7d')]=_0x592d61['body']['Imap']['port'];_0x91f052[_0xbc22('0x3f')][_0xbc22('0x7c')]=_0x592d61[_0xbc22('0x62')][_0xbc22('0x3f')][_0xbc22('0x7c')];_0x91f052['Smtp']['port']=_0x592d61[_0xbc22('0x62')][_0xbc22('0x3f')][_0xbc22('0x7d')];}else{_0x91f052[_0xbc22('0x63')][_0xbc22('0x7e')]=_0x91f052[_0xbc22('0x3f')][_0xbc22('0x7e')]=_0x592d61['body'][_0xbc22('0x7f')];_0x91f052[_0xbc22('0x63')][_0xbc22('0x80')]=_0x91f052['Smtp'][_0xbc22('0x80')]=_0x592d61[_0xbc22('0x62')][_0xbc22('0x77')];_0x91f052[_0xbc22('0x63')][_0xbc22('0x78')]=_0x91f052['Smtp'][_0xbc22('0x79')]=_0x592d61['body'][_0xbc22('0x7a')];}return db[_0xbc22('0x43')][_0xbc22('0x68')](_0x91f052,{'include':[{'model':db['MailServerOut'],'as':'Smtp'},{'model':db[_0xbc22('0x5e')],'as':'Imap'}]})[_0xbc22('0x39')](function(_0x2d4e84){var _0x4ce51c=_0x592d61[_0xbc22('0x80')][_0xbc22('0x36')]({'plain':!![]});if(!_0x4ce51c)throw new Error(_0xbc22('0x81'));if(_0x4ce51c[_0xbc22('0x82')]===_0xbc22('0x80')){var _0x4f2759=_0x2d4e84[_0xbc22('0x36')]({'plain':!![]});return db[_0xbc22('0x83')][_0xbc22('0x61')]({'where':{'name':_0xbc22('0x37'),'userProfileId':_0x4ce51c[_0xbc22('0x84')]},'raw':!![]})[_0xbc22('0x39')](function(_0x19f6f5){if(_0x19f6f5&&_0x19f6f5['autoAssociation']===0x0){return db[_0xbc22('0x38')][_0xbc22('0x68')]({'name':_0x4f2759[_0xbc22('0x3c')],'resourceId':_0x4f2759['id'],'type':_0x19f6f5[_0xbc22('0x3c')],'sectionId':_0x19f6f5['id']},{})[_0xbc22('0x39')](function(){return _0x2d4e84;});}else{return _0x2d4e84;}})[_0xbc22('0x2c')](function(_0x468bc3){logger['error'](_0xbc22('0x85'),_0x468bc3);throw _0x468bc3;});}return _0x2d4e84;})['then'](respondWithResult(_0x1f7669,0xc9))[_0xbc22('0x2c')](handleError(_0x1f7669,null));};exports['getImap']=function(_0x3a4de3,_0x203b39,_0x37f6ed){return db[_0xbc22('0x43')]['findOne']({'where':{'id':_0x3a4de3[_0xbc22('0x5d')]['id']}})['then'](handleEntityNotFound(_0x203b39,null))['then'](function(_0x30af6f){if(_0x30af6f){return _0x30af6f[_0xbc22('0x86')]();}return null;})['then'](respondWithResult(_0x203b39,null))[_0xbc22('0x2c')](handleError(_0x203b39,null));};exports[_0xbc22('0x87')]=function(_0x59850e,_0x557391,_0x5eccdc){if(_0x59850e['body']['id']){delete _0x59850e[_0xbc22('0x62')]['id'];}return db[_0xbc22('0x43')][_0xbc22('0x61')]({'where':{'id':_0x59850e[_0xbc22('0x5d')]['id']}})['then'](handleEntityNotFound(_0x557391,null))['then'](function(_0x510f75){if(_0x510f75){_0x59850e['body'][_0xbc22('0x66')]=_0x510f75['id'];return db['MailServerIn']['create'](_0x59850e[_0xbc22('0x62')]);}})[_0xbc22('0x39')](respondWithResult(_0x557391,null))[_0xbc22('0x2c')](handleError(_0x557391,null));};exports['removeImap']=function(_0x2b107a,_0x25bfd4,_0x561b4e){return db[_0xbc22('0x43')][_0xbc22('0x6a')]({'where':{'id':_0x2b107a[_0xbc22('0x5d')]['id']}})[_0xbc22('0x39')](handleEntityNotFound(_0x25bfd4,null))[_0xbc22('0x39')](function(_0x460844){if(_0x460844){return _0x460844[_0xbc22('0x88')](null);}return null;})[_0xbc22('0x39')](respondWithStatusCode(_0x25bfd4,null))[_0xbc22('0x2c')](handleError(_0x25bfd4,null));};exports['getSmtp']=function(_0x1035ce,_0x192f3f,_0x192e18){return db[_0xbc22('0x43')]['findOne']({'where':{'id':_0x1035ce[_0xbc22('0x5d')]['id']}})[_0xbc22('0x39')](handleEntityNotFound(_0x192f3f,null))[_0xbc22('0x39')](function(_0x19acab){if(_0x19acab){return _0x19acab[_0xbc22('0x89')]();}return null;})[_0xbc22('0x39')](respondWithResult(_0x192f3f,null))['catch'](handleError(_0x192f3f,null));};exports[_0xbc22('0x8a')]=function(_0x4b1b3c,_0x37b59b,_0xfef0cf){if(_0x4b1b3c['body']['id']){delete _0x4b1b3c[_0xbc22('0x62')]['id'];}return db[_0xbc22('0x43')][_0xbc22('0x61')]({'where':{'id':_0x4b1b3c['params']['id']}})[_0xbc22('0x39')](handleEntityNotFound(_0x37b59b,null))[_0xbc22('0x39')](function(_0x5eb2ae){if(_0x5eb2ae){_0x4b1b3c[_0xbc22('0x62')][_0xbc22('0x66')]=_0x5eb2ae['id'];return db['MailServerOut']['create'](_0x4b1b3c[_0xbc22('0x62')]);}})[_0xbc22('0x39')](respondWithResult(_0x37b59b,null))['catch'](handleError(_0x37b59b,null));};exports[_0xbc22('0x8b')]=function(_0x3f4bbc,_0x3f8d87,_0x4ef9fe){return db[_0xbc22('0x43')][_0xbc22('0x6a')]({'where':{'id':_0x3f4bbc[_0xbc22('0x5d')]['id']}})['then'](handleEntityNotFound(_0x3f8d87,null))[_0xbc22('0x39')](function(_0x24a50f){if(_0x24a50f){return _0x24a50f[_0xbc22('0x8c')](null);}return null;})[_0xbc22('0x39')](respondWithStatusCode(_0x3f8d87,null))[_0xbc22('0x2c')](handleError(_0x3f8d87,null));};exports[_0xbc22('0x8d')]=function(_0x2001f4,_0x59789f,_0x2b4b9b){return db['MailInteraction']['find']({'where':{'id':_0x2001f4[_0xbc22('0x5d')]['id']}})[_0xbc22('0x39')](handleEntityNotFound(_0x59789f,null))['then'](function(_0x5a7fcc){if(_0x5a7fcc){return _0x5a7fcc[_0xbc22('0x8d')](_0x2001f4[_0xbc22('0x62')][_0xbc22('0x6c')],_[_0xbc22('0x8e')](_0x2001f4[_0xbc22('0x62')],[_0xbc22('0x6c'),'id'])||{});}})[_0xbc22('0x39')](respondWithResult(_0x59789f,null))[_0xbc22('0x2c')](handleError(_0x59789f,null));};exports[_0xbc22('0x8f')]=function(_0x1aac26,_0x48d7c9,_0x3d4c7b){var _0xccfb62={'raw':![],'where':{}};var _0x2591a4={};var _0x58b091={'count':0x0,'rows':[]};return db['MailAccount'][_0xbc22('0x6a')]({'where':{'id':_0x1aac26['params']['id']}})[_0xbc22('0x39')](handleEntityNotFound(_0x48d7c9,null))[_0xbc22('0x39')](function(_0x10d05b){if(_0x10d05b){_0x2591a4['model']=_[_0xbc22('0x49')](db['MailInteraction'][_0xbc22('0x44')]);_0x2591a4[_0xbc22('0x48')]=_[_0xbc22('0x49')](_0x1aac26[_0xbc22('0x48')]);_0x2591a4[_0xbc22('0x54')]=_[_0xbc22('0x4a')](_0x2591a4['model'],_0x2591a4[_0xbc22('0x48')]);_0xccfb62[_0xbc22('0x4b')]=_[_0xbc22('0x4a')](_0x2591a4[_0xbc22('0x47')],qs['fields'](_0x1aac26[_0xbc22('0x48')][_0xbc22('0x4c')]));_0xccfb62['attributes']=_0xccfb62['attributes']['length']?_0xccfb62['attributes']:_0x2591a4[_0xbc22('0x47')];if(!_0x1aac26['query'][_0xbc22('0x4e')](_0xbc22('0x4f'))){_0xccfb62[_0xbc22('0x30')]=qs[_0xbc22('0x30')](_0x1aac26['query']['limit']);_0xccfb62[_0xbc22('0x50')]=qs['offset'](_0x1aac26[_0xbc22('0x48')][_0xbc22('0x50')]);}_0xccfb62[_0xbc22('0x51')]=qs[_0xbc22('0x52')](_0x1aac26['query'][_0xbc22('0x52')]);_0xccfb62['where']=qs[_0xbc22('0x54')](_[_0xbc22('0x53')](_0x1aac26[_0xbc22('0x48')],_0x2591a4['filters']));_0xccfb62[_0xbc22('0x56')]['MailAccountId']=_0x10d05b['id'];if(_0x1aac26[_0xbc22('0x48')][_0xbc22('0x55')]){_0xccfb62[_0xbc22('0x56')]=_[_0xbc22('0x57')](_0xccfb62[_0xbc22('0x56')],{'$or':_['map'](_0xccfb62['attributes'],function(_0x208a1c){var _0xbb5bb={};_0xbb5bb[_0x208a1c]={'$like':'%'+_0x1aac26[_0xbc22('0x48')][_0xbc22('0x55')]+'%'};return _0xbb5bb;})});}_0xccfb62=_[_0xbc22('0x57')]({},_0xccfb62,_0x1aac26[_0xbc22('0x6f')]);return db[_0xbc22('0x90')]['count']({'where':_0xccfb62['where']})[_0xbc22('0x39')](function(_0x5b9d31){_0x58b091[_0xbc22('0x59')]=_0x5b9d31;if(_0x1aac26[_0xbc22('0x48')][_0xbc22('0x60')]){_0xccfb62['include']=[{'model':db[_0xbc22('0x91')],'as':_0xbc22('0x92'),'required':![]},{'model':db[_0xbc22('0x93')],'as':_0xbc22('0x94'),'attributes':[_0xbc22('0x3c'),_0xbc22('0x95'),_0xbc22('0x96')],'required':![]},{'model':db[_0xbc22('0x97')],'as':'Tags','attributes':['id','name','color'],'where':_0x1aac26[_0xbc22('0x48')]['tag']?{'id':_0x1aac26[_0xbc22('0x48')][_0xbc22('0x98')]}:undefined,'required':_0x1aac26['query'][_0xbc22('0x98')]?!![]:![]}];}return db[_0xbc22('0x90')][_0xbc22('0x70')](_0xccfb62);})[_0xbc22('0x39')](function(_0x536d9d){_0x58b091[_0xbc22('0x5b')]=_0x536d9d;return _0x58b091;});}})['then'](respondWithFilteredResult(_0x48d7c9,_0xccfb62))[_0xbc22('0x2c')](handleError(_0x48d7c9,null));};exports[_0xbc22('0x99')]=function(_0x247d81,_0x215d5d,_0x222dce){return db['MailAccount']['findOne']({'where':{'id':_0x247d81[_0xbc22('0x5d')]['id']}})[_0xbc22('0x39')](handleEntityNotFound(_0x215d5d,null))[_0xbc22('0x39')](function(_0x54afc2){if(_0x54afc2){return db[_0xbc22('0x9a')][_0xbc22('0x9b')](function(_0x5b7ce2){return db[_0xbc22('0x9c')][_0xbc22('0x35')]({'where':{'MailAccountId':_0x247d81['params']['id']},'transaction':_0x5b7ce2})[_0xbc22('0x39')](function(_0x26a01c){var _0x471a04=_[_0xbc22('0x42')](_0x247d81[_0xbc22('0x62')],function(_0x248a85){_0x248a85['MailAccountId']=_0x247d81['params']['id'];return _0x248a85;});return db[_0xbc22('0x9c')][_0xbc22('0x9d')](_0x471a04,{'transaction':_0x5b7ce2});});})[_0xbc22('0x39')](function(){return db['MailApplication'][_0xbc22('0x9e')]({'where':{'MailAccountId':_0x247d81[_0xbc22('0x5d')]['id']},'order':_0xbc22('0x9f')});});}})['then'](respondWithResult(_0x215d5d,null))[_0xbc22('0x2c')](handleError(_0x215d5d,null));};exports[_0xbc22('0xa0')]=function(_0x11adb4,_0x58e348,_0x30dcd1){var _0x2d3f7f={};var _0x599217={};var _0x50774d;var _0x32610c;return db[_0xbc22('0x43')][_0xbc22('0x6a')]({'where':{'id':_0x11adb4[_0xbc22('0x5d')]['id']}})['then'](handleEntityNotFound(_0x58e348,null))['then'](function(_0x56ff37){if(_0x56ff37){_0x50774d=_0x56ff37;_0x599217[_0xbc22('0x47')]=_['keys'](db[_0xbc22('0x9c')]['rawAttributes']);_0x599217[_0xbc22('0x48')]=_[_0xbc22('0x49')](_0x11adb4[_0xbc22('0x48')]);_0x599217[_0xbc22('0x54')]=_[_0xbc22('0x4a')](_0x599217[_0xbc22('0x47')],_0x599217[_0xbc22('0x48')]);_0x2d3f7f[_0xbc22('0x4b')]=_['intersection'](_0x599217['model'],qs['fields'](_0x11adb4[_0xbc22('0x48')][_0xbc22('0x4c')]));_0x2d3f7f['attributes']=_0x2d3f7f['attributes'][_0xbc22('0x4d')]?_0x2d3f7f[_0xbc22('0x4b')]:_0x599217[_0xbc22('0x47')];_0x2d3f7f[_0xbc22('0x51')]=qs['sort'](_0x11adb4[_0xbc22('0x48')][_0xbc22('0x52')]);_0x2d3f7f[_0xbc22('0x56')]=qs[_0xbc22('0x54')](_[_0xbc22('0x53')](_0x11adb4[_0xbc22('0x48')],_0x599217[_0xbc22('0x54')]));if(_0x11adb4[_0xbc22('0x48')][_0xbc22('0x55')]){_0x2d3f7f['where']=_[_0xbc22('0x57')](_0x2d3f7f[_0xbc22('0x56')],{'$or':_[_0xbc22('0x42')](_0x2d3f7f[_0xbc22('0x4b')],function(_0x384ecd){var _0x4d7114={};_0x4d7114[_0x384ecd]={'$like':'%'+_0x11adb4['query'][_0xbc22('0x55')]+'%'};return _0x4d7114;})});}_0x2d3f7f=_[_0xbc22('0x57')]({},_0x2d3f7f,_0x11adb4['options']);return _0x50774d['getApplications'](_0x2d3f7f);}})[_0xbc22('0x39')](function(_0x51b27a){if(_0x51b27a){_0x32610c=_0x51b27a[_0xbc22('0x4d')];if(!_0x11adb4[_0xbc22('0x48')]['hasOwnProperty'](_0xbc22('0x4f'))){_0x2d3f7f[_0xbc22('0x30')]=qs[_0xbc22('0x30')](_0x11adb4[_0xbc22('0x48')]['limit']);_0x2d3f7f[_0xbc22('0x50')]=qs['offset'](_0x11adb4[_0xbc22('0x48')][_0xbc22('0x50')]);}return _0x50774d[_0xbc22('0xa0')](_0x2d3f7f);}})[_0xbc22('0x39')](function(_0x53253c){if(_0x53253c){return _0x53253c?{'count':_0x32610c,'rows':_0x53253c}:null;}})[_0xbc22('0x39')](respondWithResult(_0x58e348,null))[_0xbc22('0x2c')](handleError(_0x58e348,null));};exports[_0xbc22('0xa1')]=function(_0x11050a,_0x2686f3,_0x4d6dd4){var _0x291848={'raw':!![],'where':{}};var _0x282cb1={};var _0x34b007={'count':0x0,'rows':[]};return db[_0xbc22('0x43')][_0xbc22('0x6a')]({'where':{'id':_0x11050a[_0xbc22('0x5d')]['id']}})['then'](handleEntityNotFound(_0x2686f3,null))[_0xbc22('0x39')](function(_0x3119e8){if(_0x3119e8){_0x282cb1['model']=_[_0xbc22('0x49')](db[_0xbc22('0xa2')][_0xbc22('0x44')]);_0x282cb1[_0xbc22('0x48')]=_[_0xbc22('0x49')](_0x11050a[_0xbc22('0x48')]);_0x282cb1['filters']=_[_0xbc22('0x4a')](_0x282cb1[_0xbc22('0x47')],_0x282cb1['query']);_0x291848[_0xbc22('0x4b')]=_[_0xbc22('0x4a')](_0x282cb1[_0xbc22('0x47')],qs[_0xbc22('0x4c')](_0x11050a[_0xbc22('0x48')][_0xbc22('0x4c')]));_0x291848[_0xbc22('0x4b')]=_0x291848['attributes'][_0xbc22('0x4d')]?_0x291848[_0xbc22('0x4b')]:_0x282cb1['model'];if(!_0x11050a[_0xbc22('0x48')][_0xbc22('0x4e')](_0xbc22('0x4f'))){_0x291848[_0xbc22('0x30')]=qs[_0xbc22('0x30')](_0x11050a[_0xbc22('0x48')][_0xbc22('0x30')]);_0x291848[_0xbc22('0x50')]=qs[_0xbc22('0x50')](_0x11050a[_0xbc22('0x48')][_0xbc22('0x50')]);}_0x291848[_0xbc22('0x51')]=qs[_0xbc22('0x52')](_0x11050a[_0xbc22('0x48')][_0xbc22('0x52')]);_0x291848[_0xbc22('0x56')]=qs[_0xbc22('0x54')](_['pick'](_0x11050a[_0xbc22('0x48')],_0x282cb1['filters']));_0x291848[_0xbc22('0x56')][_0xbc22('0x66')]=_0x3119e8['id'];if(_0x11050a[_0xbc22('0x48')][_0xbc22('0x55')]){_0x291848['where']=_[_0xbc22('0x57')](_0x291848[_0xbc22('0x56')],{'$or':_[_0xbc22('0x42')](_0x291848['attributes'],function(_0x128834){var _0x1a00bb={};_0x1a00bb[_0x128834]={'$like':'%'+_0x11050a[_0xbc22('0x48')]['filter']+'%'};return _0x1a00bb;})});}if(_0x11050a[_0xbc22('0x48')][_0xbc22('0xa3')]){var _0x28ab1b=_0x11050a['query'][_0xbc22('0xa3')]['split'](',');var _0x277adc={};_0x277adc[_0x28ab1b[0x0]]={'$gte':moment(_0x28ab1b[0x1])[_0xbc22('0xa4')]('YYYY-MM-DD\x20HH:mm:ss')};_0x291848['where']=_[_0xbc22('0x57')](_0x291848['where'],_0x277adc);}_0x291848=_[_0xbc22('0x57')]({},_0x291848,_0x11050a[_0xbc22('0x6f')]);return db['MailMessage'][_0xbc22('0x59')]({'where':_0x291848['where']})[_0xbc22('0x39')](function(_0x456897){_0x34b007[_0xbc22('0x59')]=_0x456897;if(_0x11050a['query'][_0xbc22('0x60')]){_0x291848[_0xbc22('0x5a')]=[{'all':!![]}];}return db[_0xbc22('0xa2')][_0xbc22('0x70')](_0x291848);})[_0xbc22('0x39')](function(_0x420558){_0x34b007['rows']=_0x420558;return _0x34b007;});}})[_0xbc22('0x39')](respondWithFilteredResult(_0x2686f3,_0x291848))[_0xbc22('0x2c')](handleError(_0x2686f3,null));};exports[_0xbc22('0x3d')]=function(_0x2d59c5,_0x9ba7f4,_0x24e2fc){var _0xc155d1,_0x3a8bee={},_0x210ab4;if(_0x2d59c5[_0xbc22('0x62')]['to']){_0x210ab4=_0x2d59c5[_0xbc22('0x62')]['to'][_0xbc22('0xa5')](',')[0x0];}return db[_0xbc22('0x43')][_0xbc22('0x61')]({'where':{'id':_0x2d59c5[_0xbc22('0x5d')]['id']},'include':[{'model':db[_0xbc22('0xa6')],'as':'List','include':[{'model':db['CmContact'],'as':_0xbc22('0xa7'),'where':{'email':_0x210ab4},'limit':0x1,'order':[[_0xbc22('0xa8'),_0xbc22('0xa9')]]}]},{'model':db[_0xbc22('0x5f')],'as':_0xbc22('0x3f'),'raw':!![]}]})[_0xbc22('0x39')](handleEntityNotFound(_0x9ba7f4,null))[_0xbc22('0x39')](function(_0x53728f){if(_0x53728f){_0xc155d1=_0x53728f;if(_0x53728f[_0xbc22('0x3f')]){if(_[_0xbc22('0x74')](_0x2d59c5['body'][_0xbc22('0xaa')])){_0x2d59c5[_0xbc22('0x62')][_0xbc22('0xaa')]=util['format'](_0xbc22('0xab'),_0x53728f[_0xbc22('0x3c')],_0x53728f['email']||_0x53728f[_0xbc22('0x3f')]['user']);}if(_0x2d59c5[_0xbc22('0x62')][_0xbc22('0xac')]&&_0x2d59c5[_0xbc22('0x62')][_0xbc22('0xac')][_0xbc22('0x4d')]){for(var _0x242b5f=0x0;_0x242b5f<_0x2d59c5[_0xbc22('0x62')][_0xbc22('0xac')][_0xbc22('0x4d')];_0x242b5f+=0x1){_0x2d59c5[_0xbc22('0x62')]['attachments'][_0x242b5f]={'filename':_0x2d59c5['body'][_0xbc22('0xac')][_0x242b5f]['name'],'path':path[_0xbc22('0xad')](config[_0xbc22('0xae')],_0xbc22('0xaf'),_0x2d59c5[_0xbc22('0x62')][_0xbc22('0xac')][_0x242b5f]['basename'])};}}var _0x23682f={'tls':{'rejectUnauthorized':![]}};if(_[_0xbc22('0x74')](_0x53728f['Smtp'][_0xbc22('0x7e')])){if(_0x53728f[_0xbc22('0x3f')][_0xbc22('0x7b')]){_0x23682f[_0xbc22('0xb0')]={'user':_0x53728f[_0xbc22('0x3f')][_0xbc22('0x80')],'pass':_0x53728f[_0xbc22('0x3f')]['pass']};}_0x23682f[_0xbc22('0x7c')]=_0x53728f[_0xbc22('0x3f')][_0xbc22('0x7c')];_0x23682f[_0xbc22('0x7d')]=_0x53728f[_0xbc22('0x3f')][_0xbc22('0x7d')];_0x23682f['secure']=_0x53728f[_0xbc22('0x3f')][_0xbc22('0xb1')];}else{_0x23682f[_0xbc22('0x7e')]=_0x53728f['Smtp']['service'];_0x23682f[_0xbc22('0xb0')]={'user':_0x53728f[_0xbc22('0x3f')][_0xbc22('0x80')],'pass':_0x53728f[_0xbc22('0x3f')]['pass']};}return respondWithRpcPromise('SendMail','sendMail',{'account':_0x23682f,'message':_0x2d59c5[_0xbc22('0x62')]});}else{throw new Error(_0xbc22('0xb2'));}}})[_0xbc22('0x39')](function(_0x13e794){if(_0x13e794){_0x3a8bee=_0x13e794;if(_0xc155d1[_0xbc22('0xb3')]){if(_0xc155d1['List'][_0xbc22('0xa7')]['length']){return _0xc155d1[_0xbc22('0xb3')][_0xbc22('0xa7')][0x0];}else{return db[_0xbc22('0x91')][_0xbc22('0x68')](_[_0xbc22('0x18')](_0x2d59c5[_0xbc22('0x62')],{'firstName':_0x2d59c5['body']['to'],'email':_0x2d59c5[_0xbc22('0x62')]['to'],'phone':_0x2d59c5[_0xbc22('0x62')]['to'],'ListId':_0xc155d1[_0xbc22('0x73')]}));}}else{throw new Error(_0xbc22('0xb2'));}}})[_0xbc22('0x39')](function(_0x5c7f82){if(_0x5c7f82){var _0x11a99c={'UserId':_0x2d59c5[_0xbc22('0x80')]['id'],'ContactId':_0x5c7f82['id'],'MailAccountId':_0xc155d1['id'],'inReplyTo':_0x3a8bee[_0xbc22('0xb4')],'to':_0x2d59c5[_0xbc22('0x62')][_0xbc22('0xaa')],'cc':_0x2d59c5['body']['cc'],'subject':_0x2d59c5[_0xbc22('0x62')][_0xbc22('0xb5')],'attach':_0x2d59c5[_0xbc22('0x62')][_0xbc22('0xb6')],'firstMsgDirection':'out','lastMsgAt':moment()[_0xbc22('0xa4')](_0xbc22('0xb7')),'lastMsgDirection':_0xbc22('0xb8'),'lastMsgBody':_0x2d59c5['body'][_0xbc22('0x62')],'Messages':[_[_0xbc22('0x57')](_0x2d59c5[_0xbc22('0x62')],{'messageId':_0x3a8bee[_0xbc22('0xb4')],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0xc155d1['id'],'UserId':_0x2d59c5[_0xbc22('0x80')]['id'],'ContactId':_0x5c7f82['id']})]};if(_0x2d59c5[_0xbc22('0x62')][_0xbc22('0xb9')]){_0x11a99c=_['merge'](_0x11a99c,_0x2d59c5[_0xbc22('0x62')][_0xbc22('0xb9')]);}return db['MailInteraction'][_0xbc22('0x68')](_0x11a99c,{'include':[{'model':db[_0xbc22('0xa2')],'as':_0xbc22('0xba')}]});}})[_0xbc22('0x39')](respondWithResult(_0x9ba7f4,null))['catch'](handleError(_0x9ba7f4,null));};exports[_0xbc22('0xbb')]=function(_0x2a7013,_0x3971d2,_0x223f33){return db[_0xbc22('0x43')][_0xbc22('0x61')]({'where':{'id':_0x2a7013[_0xbc22('0x5d')]['id']},'include':[{'model':db[_0xbc22('0x5f')],'as':_0xbc22('0x3f'),'raw':!![]}]})[_0xbc22('0x39')](handleEntityNotFound(_0x3971d2,null))['then'](function(_0x4e45cf){if(_0x4e45cf&&_0x4e45cf[_0xbc22('0x3f')]){var _0xd7c987={'id':_0x4e45cf['id'],'tls':{'rejectUnauthorized':![]}};if(_0x4e45cf[_0xbc22('0x3f')][_0xbc22('0x7e')]){_0xd7c987[_0xbc22('0x7e')]=_0x4e45cf[_0xbc22('0x3f')]['service'];}else{_0xd7c987[_0xbc22('0x7c')]=_0x4e45cf[_0xbc22('0x3f')][_0xbc22('0x7c')];_0xd7c987['port']=_0x4e45cf[_0xbc22('0x3f')][_0xbc22('0x7d')];_0xd7c987[_0xbc22('0xb1')]=_0x4e45cf['Smtp'][_0xbc22('0xb1')];}if(_0x4e45cf[_0xbc22('0x3f')]['authentication']){_0xd7c987[_0xbc22('0xb0')]={'user':_0x4e45cf[_0xbc22('0x3f')]['user'],'pass':_0x4e45cf[_0xbc22('0x3f')][_0xbc22('0x79')]};}return respondWithRpcPromise('VerifySmtp','verifySmtp',{'account':_0xd7c987});}})['then'](respondWithResult(_0x3971d2,null))[_0xbc22('0x2c')](handleError(_0x3971d2,null));};exports[_0xbc22('0x35')]=function(_0x556678,_0x5e3002){return db['MailAccount']['find']({'where':{'id':_0x556678[_0xbc22('0x5d')]['id']}})[_0xbc22('0x39')](handleEntityNotFound(_0x5e3002,null))['then'](function(_0x4dad7f){if(_0x4dad7f&&_0x4dad7f['service']){throw new db[(_0xbc22('0xbc'))][(_0xbc22('0xbd'))](_0xbc22('0xbe'));}return _0x4dad7f;})[_0xbc22('0x39')](removeEntity(_0x5e3002,null))['catch'](handleError(_0x5e3002,null));};exports[_0xbc22('0xbf')]=function(_0xb73dda,_0x17d8e2,_0x326694){return db['MailAccount'][_0xbc22('0x61')]({'where':{'id':_0xb73dda['params']['id']}})[_0xbc22('0x39')](handleEntityNotFound(_0x17d8e2,null))[_0xbc22('0x39')](function(_0x4b4ebe){if(_0x4b4ebe){return _0x4b4ebe[_0xbc22('0xbf')](_0xb73dda['body'][_0xbc22('0x6c')],_['omit'](_0xb73dda[_0xbc22('0x62')],[_0xbc22('0x6c'),'id'])||{})[_0xbc22('0xc0')](function(_0x3b1696){for(var _0xe11a27=0x0;_0xe11a27<_0xb73dda[_0xbc22('0x62')][_0xbc22('0x6c')][_0xbc22('0x4d')];_0xe11a27+=0x1){socket['emit'](_0xbc22('0xc1'),{'UserId':_0xb73dda['body'][_0xbc22('0x6c')][_0xe11a27],'MailAccountId':_0xb73dda['params']['id']});}return _0x3b1696;});}})[_0xbc22('0x39')](respondWithResult(_0x17d8e2,null))[_0xbc22('0x2c')](handleError(_0x17d8e2,null));};exports[_0xbc22('0xc2')]=function(_0x1ded00,_0x7b2bb,_0x5ec032){return db[_0xbc22('0x43')]['find']({'where':{'id':_0x1ded00[_0xbc22('0x5d')]['id']}})[_0xbc22('0x39')](handleEntityNotFound(_0x7b2bb,null))[_0xbc22('0x39')](function(_0x46ca7c){if(_0x46ca7c){return _0x46ca7c[_0xbc22('0xc2')](_0x1ded00[_0xbc22('0x48')][_0xbc22('0x6c')])['then'](function(){if(_[_0xbc22('0xc3')](_0x1ded00[_0xbc22('0x48')][_0xbc22('0x6c')])){for(var _0x139ba4=0x0;_0x139ba4<_0x1ded00[_0xbc22('0x48')][_0xbc22('0x6c')][_0xbc22('0x4d')];_0x139ba4+=0x1){socket['emit'](_0xbc22('0xc4'),{'UserId':Number(_0x1ded00[_0xbc22('0x48')][_0xbc22('0x6c')][_0x139ba4]),'MailAccountId':Number(_0x1ded00[_0xbc22('0x5d')]['id'])});}}else{socket[_0xbc22('0xc5')]('userMailAccount:remove',{'UserId':Number(_0x1ded00['query']['ids']),'MailAccountId':Number(_0x1ded00[_0xbc22('0x5d')]['id'])});}});}})[_0xbc22('0x39')](respondWithStatusCode(_0x7b2bb,null))['catch'](handleError(_0x7b2bb,null));};exports['getAgents']=function(_0xdf03f,_0x11ec37,_0x4130be){var _0x461fe3={};var _0x413751={};var _0x523878;var _0xaa8f1b;return db[_0xbc22('0x43')][_0xbc22('0x6a')]({'where':{'id':_0xdf03f[_0xbc22('0x5d')]['id']}})['then'](handleEntityNotFound(_0x11ec37,null))[_0xbc22('0x39')](function(_0x586ae5){if(_0x586ae5){_0x523878=_0x586ae5;_0x413751[_0xbc22('0x47')]=_[_0xbc22('0x49')](db[_0xbc22('0x93')][_0xbc22('0x44')]);_0x413751[_0xbc22('0x48')]=_[_0xbc22('0x49')](_0xdf03f[_0xbc22('0x48')]);_0x413751['filters']=_[_0xbc22('0x4a')](_0x413751[_0xbc22('0x47')],_0x413751[_0xbc22('0x48')]);_0x461fe3['attributes']=_[_0xbc22('0x4a')](_0x413751['model'],qs[_0xbc22('0x4c')](_0xdf03f[_0xbc22('0x48')]['fields']));_0x461fe3[_0xbc22('0x4b')]=_0x461fe3[_0xbc22('0x4b')][_0xbc22('0x4d')]?_0x461fe3['attributes']:_0x413751[_0xbc22('0x47')];_0x461fe3['order']=qs['sort'](_0xdf03f[_0xbc22('0x48')]['sort']);_0x461fe3[_0xbc22('0x56')]=qs[_0xbc22('0x54')](_['pick'](_0xdf03f['query'],_0x413751[_0xbc22('0x54')]));if(_0xdf03f[_0xbc22('0x48')][_0xbc22('0x55')]){_0x461fe3[_0xbc22('0x56')]=_[_0xbc22('0x57')](_0x461fe3['where'],{'$or':_[_0xbc22('0x42')](_0x461fe3[_0xbc22('0x4b')],function(_0x49a538){var _0x585f28={};_0x585f28[_0x49a538]={'$like':'%'+_0xdf03f[_0xbc22('0x48')][_0xbc22('0x55')]+'%'};return _0x585f28;})});}_0x461fe3=_[_0xbc22('0x57')]({},_0x461fe3,_0xdf03f['options']);return _0x523878[_0xbc22('0xc6')](_0x461fe3);}})['then'](function(_0x38365c){if(_0x38365c){_0xaa8f1b=_0x38365c['length'];if(!_0xdf03f[_0xbc22('0x48')][_0xbc22('0x4e')](_0xbc22('0x4f'))){_0x461fe3[_0xbc22('0x30')]=qs[_0xbc22('0x30')](_0xdf03f[_0xbc22('0x48')][_0xbc22('0x30')]);_0x461fe3[_0xbc22('0x50')]=qs[_0xbc22('0x50')](_0xdf03f['query'][_0xbc22('0x50')]);}return _0x523878[_0xbc22('0xc6')](_0x461fe3);}})[_0xbc22('0x39')](function(_0x2852f7){if(_0x2852f7){return _0x2852f7?{'count':_0xaa8f1b,'rows':_0x2852f7}:null;}})['then'](respondWithResult(_0x11ec37,null))[_0xbc22('0x2c')](handleError(_0x11ec37,null));}; \ No newline at end of file +var _0x5355=['CannedAnswer','getAnswers','removeAnswers','email','isNil','active','description','cservice','cauthentication','user','cuser','password','authentication','host','port','service','pass','role','UserProfileSection','userProfileId','UserProfileResource','getImap','addImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','MailInteraction','addInteraction','omit','getInteractions','CmContact','User','Owner','fullname','Tag','Tags','color','tag','addApplications','sequelize','transaction','MailApplication','findAndCountAll','priority','getApplications','hasOwnProperty','getMessages','MailMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','send','split','CmList','List','Contacts','updatedAt','DESC','from','attachments','join','root','server/files/attachments','auth','secure','SendMail','sendMail','List\x20not\x20found','messageId','subject','attach','out','Interaction','VerifySmtp','verifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','emit','removeAgents','isArray','userMailAccount:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./mailAccount.socket','register','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','request\x20sent','error','code','MailAccount,\x20%s,\x20%s','message','info','result','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','destroy','get','MailAccounts','stack','name','index','MailServerIn','Smtp','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','sort','pick','filter','where','merge','key','VIRTUAL','field','options','includeAll','show','include','find','catch','body','params','MailServerOut','Imap','describe','addDisposition','Disposition','create','getDispositions','findOne','nolimit','order','MailAccountId','findAll','rows','removeDispositions','ids','addAnswer'];(function(_0x1db1b4,_0x13fde4){var _0x19155f=function(_0x2cd279){while(--_0x2cd279){_0x1db1b4['push'](_0x1db1b4['shift']());}};_0x19155f(++_0x13fde4);}(_0x5355,0x1e0));var _0x5535=function(_0x3ada0a,_0x5e94e9){_0x3ada0a=_0x3ada0a-0x0;var _0x41ffc0=_0x5355[_0x3ada0a];return _0x41ffc0;};'use strict';var pdf=require(_0x5535('0x0'));var emlformat=require(_0x5535('0x1'));var rimraf=require(_0x5535('0x2'));var zipdir=require(_0x5535('0x3'));var jsonpatch=require(_0x5535('0x4'));var rp=require(_0x5535('0x5'));var moment=require(_0x5535('0x6'));var BPromise=require(_0x5535('0x7'));var Mustache=require(_0x5535('0x8'));var util=require(_0x5535('0x9'));var path=require('path');var sox=require(_0x5535('0xa'));var csv=require('to-csv');var ejs=require(_0x5535('0xb'));var fs=require('fs');var _=require(_0x5535('0xc'));var squel=require(_0x5535('0xd'));var crypto=require(_0x5535('0xe'));var jsforce=require(_0x5535('0xf'));var deskjs=require(_0x5535('0x10'));var toCsv=require(_0x5535('0x11'));var querystring=require(_0x5535('0x12'));var Papa=require(_0x5535('0x13'));var Redis=require(_0x5535('0x14'));var authService=require(_0x5535('0x15'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5535('0x16'));var logger=require(_0x5535('0x17'))(_0x5535('0x18'));var utils=require(_0x5535('0x19'));var config=require(_0x5535('0x1a'));var db=require(_0x5535('0x1b'))['db'];config[_0x5535('0x1c')]=_[_0x5535('0x1d')](config[_0x5535('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0x5535('0x1e'))(new Redis(config[_0x5535('0x1c')]));require(_0x5535('0x1f'))[_0x5535('0x20')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x5535('0x21')]({'port':0x232b});function checkPasswordPattern(_0xe6fa09,_0x2eff8d,_0x568b2f){if(_0x568b2f){var _0x4400b0=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4400b0[_0x5535('0x22')](_0x2eff8d)){return _0xe6fa09;}else{throw new Error(_0x5535('0x23'));}}else{return _0xe6fa09;}}function respondWithRpcPromise(_0x30ac62,_0x298d62,_0x3887d8,_0x4c0351){return new BPromise(function(_0x378d8b,_0x773dc1){var _0x1a879a=_0x4c0351||client;return _0x1a879a[_0x5535('0x24')](_0x30ac62,_0x3887d8)[_0x5535('0x25')](function(_0x1341c3){logger['info']('MailAccount,\x20%s,\x20%s',_0x298d62,_0x5535('0x26'));logger['debug']('MailAccount,\x20%s,\x20%s,\x20%s',_0x298d62,_0x5535('0x26'),JSON['stringify'](_0x1341c3));if(_0x1341c3[_0x5535('0x27')]){if(_0x1341c3[_0x5535('0x27')][_0x5535('0x28')]===0x1f4){logger[_0x5535('0x27')](_0x5535('0x29'),_0x298d62,_0x1341c3['error'][_0x5535('0x2a')]);return _0x773dc1(_0x1341c3[_0x5535('0x27')][_0x5535('0x2a')]);}logger[_0x5535('0x27')](_0x5535('0x29'),_0x298d62,_0x1341c3[_0x5535('0x27')][_0x5535('0x2a')]);return _0x378d8b(_0x1341c3[_0x5535('0x27')][_0x5535('0x2a')]);}else{logger[_0x5535('0x2b')](_0x5535('0x29'),_0x298d62,_0x5535('0x26'));_0x378d8b(_0x1341c3[_0x5535('0x2c')]['message']);}})['catch'](function(_0x500d74){logger['error'](_0x5535('0x29'),_0x298d62,_0x500d74);_0x773dc1(_0x500d74);});});}function respondWithStatusCode(_0x2d0046,_0x346ba1){_0x346ba1=_0x346ba1||0xcc;return function(_0x1f0c9d){if(_0x1f0c9d){return _0x2d0046[_0x5535('0x2d')](_0x346ba1);}return _0x2d0046[_0x5535('0x2e')](_0x346ba1)[_0x5535('0x2f')]();};}function respondWithResult(_0x54443a,_0x214819){_0x214819=_0x214819||0xc8;return function(_0x3801d9){if(_0x3801d9){return _0x54443a[_0x5535('0x2e')](_0x214819)[_0x5535('0x30')](_0x3801d9);}};}function respondWithFilteredResult(_0x4831b1,_0x2230ca){return function(_0x100533){if(_0x100533){var _0x30672d=_0x100533[_0x5535('0x31')],_0x34d99d=_0x2230ca['offset'],_0xa3cf58=_0x2230ca[_0x5535('0x32')]+_0x2230ca[_0x5535('0x33')],_0x159cf7;if(_0xa3cf58>=_0x30672d){_0xa3cf58=_0x30672d;_0x159cf7=0xc8;}else{_0x159cf7=0xce;}_0x4831b1[_0x5535('0x2e')](_0x159cf7);return _0x4831b1[_0x5535('0x34')]('Content-Range',_0x34d99d+'-'+_0xa3cf58+'/'+_0x30672d)['json'](_0x100533);}return null;};}function patchUpdates(_0x13b24e){return function(_0x15adb5){try{jsonpatch[_0x5535('0x35')](_0x15adb5,_0x13b24e,!![]);}catch(_0x3b953d){return BPromise[_0x5535('0x36')](_0x3b953d);}return _0x15adb5[_0x5535('0x37')]();};}function saveUpdates(_0x466357,_0x2075db){return function(_0x368d94){if(_0x368d94){return _0x368d94[_0x5535('0x38')](_0x466357)[_0x5535('0x25')](function(_0x5495dc){return _0x5495dc;});}return null;};}function removeEntity(_0x2192b9,_0x292b60){return function(_0x1bba10){if(_0x1bba10){return _0x1bba10[_0x5535('0x39')]()[_0x5535('0x25')](function(){var _0x27883a=_0x1bba10[_0x5535('0x3a')]({'plain':!![]});var _0x4e923b=_0x5535('0x3b');return db['UserProfileResource']['destroy']({'where':{'type':_0x4e923b,'resourceId':_0x27883a['id']}})[_0x5535('0x25')](function(){return _0x1bba10;});})[_0x5535('0x25')](function(){_0x2192b9[_0x5535('0x2e')](0xcc)[_0x5535('0x2f')]();});}};}function handleEntityNotFound(_0x2bd3e9,_0x581f4b){return function(_0x24e94b){if(!_0x24e94b){_0x2bd3e9['sendStatus'](0x194);}return _0x24e94b;};}function handleError(_0x4e3e39,_0x529e81){_0x529e81=_0x529e81||0x1f4;return function(_0x4bf8c9){logger[_0x5535('0x27')](_0x4bf8c9[_0x5535('0x3c')]);if(_0x4bf8c9[_0x5535('0x3d')]){delete _0x4bf8c9['name'];}_0x4e3e39[_0x5535('0x2e')](_0x529e81)['send'](_0x4bf8c9);};}exports[_0x5535('0x3e')]=function(_0x104ef5,_0x34c20d){var _0xcfdd8={'include':[{'model':db[_0x5535('0x3f')],'as':'Imap'},{'model':db['MailServerOut'],'as':_0x5535('0x40')},{'model':db[_0x5535('0x41')],'as':_0x5535('0x42')}]},_0x441b5a={},_0x481979={'count':0x0,'rows':[]};var _0x572f2a=_[_0x5535('0x43')](db[_0x5535('0x44')][_0x5535('0x45')],function(_0x24578b){return{'name':_0x24578b['fieldName'],'type':_0x24578b[_0x5535('0x46')]['key']};});_0x441b5a[_0x5535('0x47')]=_[_0x5535('0x43')](_0x572f2a,_0x5535('0x3d'));_0x441b5a[_0x5535('0x48')]=_[_0x5535('0x49')](_0x104ef5['query']);_0x441b5a[_0x5535('0x4a')]=_[_0x5535('0x4b')](_0x441b5a['model'],_0x441b5a[_0x5535('0x48')]);_0xcfdd8[_0x5535('0x4c')]=_[_0x5535('0x4b')](_0x441b5a[_0x5535('0x47')],qs[_0x5535('0x4d')](_0x104ef5[_0x5535('0x48')][_0x5535('0x4d')]));_0xcfdd8[_0x5535('0x4c')]=_0xcfdd8[_0x5535('0x4c')][_0x5535('0x4e')]?_0xcfdd8[_0x5535('0x4c')]:_0x441b5a[_0x5535('0x47')];if(!_0x104ef5['query']['hasOwnProperty']('nolimit')){_0xcfdd8['limit']=qs[_0x5535('0x33')](_0x104ef5['query'][_0x5535('0x33')]);_0xcfdd8[_0x5535('0x32')]=qs[_0x5535('0x32')](_0x104ef5['query']['offset']);}_0xcfdd8['order']=qs['sort'](_0x104ef5[_0x5535('0x48')][_0x5535('0x4f')]);_0xcfdd8['where']=qs[_0x5535('0x4a')](_[_0x5535('0x50')](_0x104ef5[_0x5535('0x48')],_0x441b5a[_0x5535('0x4a')]));if(_0x104ef5[_0x5535('0x48')][_0x5535('0x51')]){_0xcfdd8[_0x5535('0x52')]=_[_0x5535('0x53')](_0xcfdd8[_0x5535('0x52')],{'$or':_['map'](_0x572f2a,function(_0x484868){if(_0x484868['type'][_0x5535('0x54')]!==_0x5535('0x55')){var _0x2f9434={};_0x2f9434[_0x484868[_0x5535('0x56')]]={'$like':'%'+_0x104ef5['query'][_0x5535('0x51')]+'%'};return _0x2f9434;}})});}_0xcfdd8=_['merge']({},_0xcfdd8,_0x104ef5[_0x5535('0x57')]);var _0x3dd5a2={'where':_0xcfdd8['where']};return db[_0x5535('0x44')][_0x5535('0x31')](_0x3dd5a2)['then'](function(_0x263627){_0x481979[_0x5535('0x31')]=_0x263627;if(_0x104ef5['query'][_0x5535('0x58')]){_0xcfdd8['include']=[{'all':!![]}];}return db[_0x5535('0x44')]['findAll'](_0xcfdd8);})['then'](function(_0x1a3df8){_0x481979['rows']=_0x1a3df8;return _0x481979;})['then'](respondWithFilteredResult(_0x34c20d,_0xcfdd8))['catch'](handleError(_0x34c20d,null));};exports[_0x5535('0x59')]=function(_0x5e3fbe,_0x10c427){var _0x2ac88c={'raw':![],'where':{'id':_0x5e3fbe['params']['id']},'include':[{'model':db[_0x5535('0x3f')],'as':'Imap'},{'model':db['MailServerOut'],'as':'Smtp'},{'model':db[_0x5535('0x41')],'as':'mandatoryDispositionPause'}]},_0x50684={};_0x50684[_0x5535('0x47')]=_['keys'](db[_0x5535('0x44')][_0x5535('0x45')]);_0x50684[_0x5535('0x48')]=_['keys'](_0x5e3fbe[_0x5535('0x48')]);_0x50684[_0x5535('0x4a')]=_['intersection'](_0x50684[_0x5535('0x47')],_0x50684['query']);_0x2ac88c['attributes']=_['intersection'](_0x50684[_0x5535('0x47')],qs[_0x5535('0x4d')](_0x5e3fbe[_0x5535('0x48')][_0x5535('0x4d')]));_0x2ac88c['attributes']=_0x2ac88c[_0x5535('0x4c')]['length']?_0x2ac88c['attributes']:_0x50684[_0x5535('0x47')];if(_0x5e3fbe[_0x5535('0x48')]['includeAll']){_0x2ac88c[_0x5535('0x5a')]=[{'all':!![]}];}_0x2ac88c=_[_0x5535('0x53')]({},_0x2ac88c,_0x5e3fbe[_0x5535('0x57')]);return db[_0x5535('0x44')][_0x5535('0x5b')](_0x2ac88c)[_0x5535('0x25')](handleEntityNotFound(_0x10c427,null))['then'](respondWithResult(_0x10c427,null))[_0x5535('0x5c')](handleError(_0x10c427,null));};exports[_0x5535('0x38')]=function(_0x1cd2e1,_0x57d4aa){if(_0x1cd2e1[_0x5535('0x5d')]['id']){delete _0x1cd2e1[_0x5535('0x5d')]['id'];}return db[_0x5535('0x44')][_0x5535('0x5b')]({'where':{'id':_0x1cd2e1[_0x5535('0x5e')]['id']},'include':[{'model':db[_0x5535('0x3f')],'as':'Imap'},{'model':db[_0x5535('0x5f')],'as':_0x5535('0x40')},{'model':db['Pause'],'as':_0x5535('0x42')}]})[_0x5535('0x25')](handleEntityNotFound(_0x57d4aa,null))[_0x5535('0x25')](saveUpdates(_0x1cd2e1[_0x5535('0x5d')],null))[_0x5535('0x25')](function(_0x577294){if(_0x577294&&_0x1cd2e1[_0x5535('0x5d')][_0x5535('0x60')]){return db['MailServerIn'][_0x5535('0x38')](_0x1cd2e1[_0x5535('0x5d')][_0x5535('0x60')],{'where':{'MailAccountId':_0x577294['id']}})['then'](function(){return _0x577294;});}return _0x577294;})[_0x5535('0x25')](function(_0xa15bad){if(_0xa15bad&&_0x1cd2e1[_0x5535('0x5d')][_0x5535('0x40')]){return db[_0x5535('0x5f')][_0x5535('0x38')](_0x1cd2e1['body'][_0x5535('0x40')],{'where':{'MailAccountId':_0xa15bad['id']}})[_0x5535('0x25')](function(){return _0xa15bad;});}return _0xa15bad;})[_0x5535('0x25')](respondWithResult(_0x57d4aa,null))['catch'](handleError(_0x57d4aa,null));};exports[_0x5535('0x61')]=function(_0x5a5f57,_0x30093c){return db[_0x5535('0x44')]['describe']()[_0x5535('0x25')](respondWithResult(_0x30093c,null))[_0x5535('0x5c')](handleError(_0x30093c,null));};exports[_0x5535('0x62')]=function(_0x4ee3a9,_0x3548f0,_0x469ede){if(_0x4ee3a9[_0x5535('0x5d')]['id']){delete _0x4ee3a9[_0x5535('0x5d')]['id'];}return db[_0x5535('0x44')][_0x5535('0x5b')]({'where':{'id':_0x4ee3a9['params']['id']}})[_0x5535('0x25')](handleEntityNotFound(_0x3548f0,null))[_0x5535('0x25')](function(_0x2ac855){if(_0x2ac855){_0x4ee3a9['body']['MailAccountId']=_0x2ac855['id'];return db[_0x5535('0x63')][_0x5535('0x64')](_0x4ee3a9[_0x5535('0x5d')]);}})[_0x5535('0x25')](respondWithResult(_0x3548f0,null))['catch'](handleError(_0x3548f0,null));};exports[_0x5535('0x65')]=function(_0x2c62be,_0x362349,_0x3cf216){var _0x20e092={'raw':![],'where':{}};var _0x4ebe15={};var _0x571204={'count':0x0,'rows':[]};return db['MailAccount'][_0x5535('0x66')]({'where':{'id':_0x2c62be[_0x5535('0x5e')]['id']}})[_0x5535('0x25')](handleEntityNotFound(_0x362349,null))['then'](function(_0x31a470){if(_0x31a470){_0x4ebe15[_0x5535('0x47')]=_['keys'](db['Disposition'][_0x5535('0x45')]);_0x4ebe15[_0x5535('0x48')]=_[_0x5535('0x49')](_0x2c62be[_0x5535('0x48')]);_0x4ebe15[_0x5535('0x4a')]=_[_0x5535('0x4b')](_0x4ebe15[_0x5535('0x47')],_0x4ebe15['query']);_0x20e092['attributes']=_[_0x5535('0x4b')](_0x4ebe15[_0x5535('0x47')],qs[_0x5535('0x4d')](_0x2c62be[_0x5535('0x48')][_0x5535('0x4d')]));_0x20e092[_0x5535('0x4c')]=_0x20e092[_0x5535('0x4c')]['length']?_0x20e092[_0x5535('0x4c')]:_0x4ebe15[_0x5535('0x47')];if(!_0x2c62be[_0x5535('0x48')]['hasOwnProperty'](_0x5535('0x67'))){_0x20e092['limit']=qs[_0x5535('0x33')](_0x2c62be[_0x5535('0x48')][_0x5535('0x33')]);_0x20e092[_0x5535('0x32')]=qs[_0x5535('0x32')](_0x2c62be[_0x5535('0x48')][_0x5535('0x32')]);}_0x20e092[_0x5535('0x68')]=qs['sort'](_0x2c62be[_0x5535('0x48')]['sort']);_0x20e092[_0x5535('0x52')]=qs[_0x5535('0x4a')](_[_0x5535('0x50')](_0x2c62be[_0x5535('0x48')],_0x4ebe15[_0x5535('0x4a')]));_0x20e092[_0x5535('0x52')][_0x5535('0x69')]=_0x31a470['id'];if(_0x2c62be['query']['filter']){_0x20e092[_0x5535('0x52')]=_['merge'](_0x20e092['where'],{'$or':_[_0x5535('0x43')](_0x20e092[_0x5535('0x4c')],function(_0x5b9277){var _0x58f262={};_0x58f262[_0x5b9277]={'$like':'%'+_0x2c62be[_0x5535('0x48')][_0x5535('0x51')]+'%'};return _0x58f262;})});}_0x20e092=_['merge']({},_0x20e092,_0x2c62be[_0x5535('0x57')]);return db[_0x5535('0x63')]['count']({'where':_0x20e092[_0x5535('0x52')]})[_0x5535('0x25')](function(_0x595fb8){_0x571204[_0x5535('0x31')]=_0x595fb8;if(_0x2c62be[_0x5535('0x48')][_0x5535('0x58')]){_0x20e092[_0x5535('0x5a')]=[{'all':!![]}];}return db['Disposition'][_0x5535('0x6a')](_0x20e092);})['then'](function(_0x4d0406){_0x571204[_0x5535('0x6b')]=_0x4d0406;return _0x571204;});}})[_0x5535('0x25')](respondWithFilteredResult(_0x362349,_0x20e092))['catch'](handleError(_0x362349,null));};exports['removeDispositions']=function(_0x5e00e2,_0x5412c8,_0x64107c){return db['MailAccount'][_0x5535('0x5b')]({'where':{'id':_0x5e00e2[_0x5535('0x5e')]['id']}})[_0x5535('0x25')](handleEntityNotFound(_0x5412c8,null))[_0x5535('0x25')](function(_0x525799){if(_0x525799){return _0x525799[_0x5535('0x6c')](_0x5e00e2[_0x5535('0x48')][_0x5535('0x6d')]);}})[_0x5535('0x25')](respondWithStatusCode(_0x5412c8,null))['catch'](handleError(_0x5412c8,null));};exports[_0x5535('0x6e')]=function(_0x4de751,_0x2fdc65,_0x4ffe93){if(_0x4de751[_0x5535('0x5d')]['id']){delete _0x4de751[_0x5535('0x5d')]['id'];}return db[_0x5535('0x44')][_0x5535('0x5b')]({'where':{'id':_0x4de751[_0x5535('0x5e')]['id']}})[_0x5535('0x25')](handleEntityNotFound(_0x2fdc65,null))[_0x5535('0x25')](function(_0x163a0d){if(_0x163a0d){_0x4de751[_0x5535('0x5d')][_0x5535('0x69')]=_0x163a0d['id'];return db[_0x5535('0x6f')]['create'](_0x4de751[_0x5535('0x5d')]);}})[_0x5535('0x25')](respondWithResult(_0x2fdc65,null))[_0x5535('0x5c')](handleError(_0x2fdc65,null));};exports[_0x5535('0x70')]=function(_0x121c71,_0x129b25,_0x2b2d0f){var _0x3a253e={'raw':![],'where':{}};var _0x583449={};var _0x54af58={'count':0x0,'rows':[]};return db['MailAccount'][_0x5535('0x66')]({'where':{'id':_0x121c71[_0x5535('0x5e')]['id']}})[_0x5535('0x25')](handleEntityNotFound(_0x129b25,null))['then'](function(_0x58f19b){if(_0x58f19b){_0x583449[_0x5535('0x47')]=_[_0x5535('0x49')](db['CannedAnswer'][_0x5535('0x45')]);_0x583449[_0x5535('0x48')]=_[_0x5535('0x49')](_0x121c71[_0x5535('0x48')]);_0x583449['filters']=_[_0x5535('0x4b')](_0x583449[_0x5535('0x47')],_0x583449[_0x5535('0x48')]);_0x3a253e[_0x5535('0x4c')]=_['intersection'](_0x583449[_0x5535('0x47')],qs[_0x5535('0x4d')](_0x121c71[_0x5535('0x48')][_0x5535('0x4d')]));_0x3a253e[_0x5535('0x4c')]=_0x3a253e[_0x5535('0x4c')]['length']?_0x3a253e[_0x5535('0x4c')]:_0x583449[_0x5535('0x47')];if(!_0x121c71[_0x5535('0x48')]['hasOwnProperty']('nolimit')){_0x3a253e['limit']=qs[_0x5535('0x33')](_0x121c71[_0x5535('0x48')][_0x5535('0x33')]);_0x3a253e[_0x5535('0x32')]=qs[_0x5535('0x32')](_0x121c71[_0x5535('0x48')][_0x5535('0x32')]);}_0x3a253e[_0x5535('0x68')]=qs[_0x5535('0x4f')](_0x121c71[_0x5535('0x48')][_0x5535('0x4f')]);_0x3a253e[_0x5535('0x52')]=qs[_0x5535('0x4a')](_[_0x5535('0x50')](_0x121c71[_0x5535('0x48')],_0x583449[_0x5535('0x4a')]));_0x3a253e['where']['MailAccountId']=_0x58f19b['id'];if(_0x121c71[_0x5535('0x48')][_0x5535('0x51')]){_0x3a253e[_0x5535('0x52')]=_[_0x5535('0x53')](_0x3a253e[_0x5535('0x52')],{'$or':_['map'](_0x3a253e[_0x5535('0x4c')],function(_0x252ac9){var _0x5de117={};_0x5de117[_0x252ac9]={'$like':'%'+_0x121c71[_0x5535('0x48')]['filter']+'%'};return _0x5de117;})});}_0x3a253e=_[_0x5535('0x53')]({},_0x3a253e,_0x121c71[_0x5535('0x57')]);return db[_0x5535('0x6f')][_0x5535('0x31')]({'where':_0x3a253e[_0x5535('0x52')]})[_0x5535('0x25')](function(_0x4e52c0){_0x54af58[_0x5535('0x31')]=_0x4e52c0;if(_0x121c71[_0x5535('0x48')][_0x5535('0x58')]){_0x3a253e[_0x5535('0x5a')]=[{'all':!![]}];}return db[_0x5535('0x6f')]['findAll'](_0x3a253e);})[_0x5535('0x25')](function(_0x45947f){_0x54af58['rows']=_0x45947f;return _0x54af58;});}})[_0x5535('0x25')](respondWithFilteredResult(_0x129b25,_0x3a253e))[_0x5535('0x5c')](handleError(_0x129b25,null));};exports[_0x5535('0x71')]=function(_0x3d208a,_0x11d0da,_0xa248cf){return db[_0x5535('0x44')][_0x5535('0x5b')]({'where':{'id':_0x3d208a[_0x5535('0x5e')]['id']}})[_0x5535('0x25')](handleEntityNotFound(_0x11d0da,null))[_0x5535('0x25')](function(_0x43f068){if(_0x43f068){return _0x43f068[_0x5535('0x71')](_0x3d208a[_0x5535('0x48')]['ids']);}})[_0x5535('0x25')](respondWithStatusCode(_0x11d0da,null))['catch'](handleError(_0x11d0da,null));};exports[_0x5535('0x64')]=function(_0x3b7ebe,_0x30955e){var _0x2b9ead={'name':_0x3b7ebe[_0x5535('0x5d')][_0x5535('0x3d')],'key':_0x3b7ebe[_0x5535('0x5d')]['key'],'email':_0x3b7ebe[_0x5535('0x5d')][_0x5535('0x72')],'ListId':_0x3b7ebe['body']['ListId'],'active':!_[_0x5535('0x73')](_0x3b7ebe[_0x5535('0x5d')][_0x5535('0x74')])?_0x3b7ebe[_0x5535('0x5d')][_0x5535('0x74')]:!![],'description':_0x3b7ebe['body'][_0x5535('0x75')]||null,'Imap':{},'Smtp':{}};if(_[_0x5535('0x73')](_0x3b7ebe[_0x5535('0x5d')][_0x5535('0x76')])){if(_0x3b7ebe[_0x5535('0x5d')][_0x5535('0x77')]){_0x2b9ead['Imap'][_0x5535('0x78')]=_0x2b9ead[_0x5535('0x40')][_0x5535('0x78')]=_0x3b7ebe['body'][_0x5535('0x79')];_0x2b9ead[_0x5535('0x60')][_0x5535('0x7a')]=_0x2b9ead['Smtp']['pass']=_0x3b7ebe[_0x5535('0x5d')]['cpassword'];}else{_0x2b9ead['Imap'][_0x5535('0x7b')]=_0x2b9ead[_0x5535('0x40')]['authentication']=![];}_0x2b9ead[_0x5535('0x60')][_0x5535('0x7c')]=_0x3b7ebe[_0x5535('0x5d')][_0x5535('0x60')]['host'];_0x2b9ead[_0x5535('0x60')][_0x5535('0x7d')]=_0x3b7ebe[_0x5535('0x5d')]['Imap']['port'];_0x2b9ead['Smtp'][_0x5535('0x7c')]=_0x3b7ebe[_0x5535('0x5d')]['Smtp']['host'];_0x2b9ead[_0x5535('0x40')]['port']=_0x3b7ebe[_0x5535('0x5d')][_0x5535('0x40')]['port'];}else{_0x2b9ead['Imap'][_0x5535('0x7e')]=_0x2b9ead[_0x5535('0x40')][_0x5535('0x7e')]=_0x3b7ebe['body']['cservice'];_0x2b9ead['Imap'][_0x5535('0x78')]=_0x2b9ead[_0x5535('0x40')][_0x5535('0x78')]=_0x3b7ebe[_0x5535('0x5d')]['cuser'];_0x2b9ead[_0x5535('0x60')][_0x5535('0x7a')]=_0x2b9ead[_0x5535('0x40')][_0x5535('0x7f')]=_0x3b7ebe[_0x5535('0x5d')]['cpassword'];}return db['MailAccount'][_0x5535('0x64')](_0x2b9ead,{'include':[{'model':db[_0x5535('0x5f')],'as':_0x5535('0x40')},{'model':db[_0x5535('0x3f')],'as':_0x5535('0x60')}]})[_0x5535('0x25')](function(_0x3eff5e){var _0x2c2c51=_0x3b7ebe[_0x5535('0x78')]['get']({'plain':!![]});if(!_0x2c2c51)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2c2c51[_0x5535('0x80')]===_0x5535('0x78')){var _0x3132c8=_0x3eff5e['get']({'plain':!![]});return db[_0x5535('0x81')][_0x5535('0x5b')]({'where':{'name':_0x5535('0x3b'),'userProfileId':_0x2c2c51[_0x5535('0x82')]},'raw':!![]})[_0x5535('0x25')](function(_0x54fb0f){if(_0x54fb0f&&_0x54fb0f['autoAssociation']===0x0){return db[_0x5535('0x83')]['create']({'name':_0x3132c8[_0x5535('0x3d')],'resourceId':_0x3132c8['id'],'type':_0x54fb0f[_0x5535('0x3d')],'sectionId':_0x54fb0f['id']},{})[_0x5535('0x25')](function(){return _0x3eff5e;});}else{return _0x3eff5e;}})[_0x5535('0x5c')](function(_0x2bfd03){logger[_0x5535('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2bfd03);throw _0x2bfd03;});}return _0x3eff5e;})['then'](respondWithResult(_0x30955e,0xc9))['catch'](handleError(_0x30955e,null));};exports[_0x5535('0x84')]=function(_0x5c014e,_0x463192,_0x36455c){return db[_0x5535('0x44')][_0x5535('0x66')]({'where':{'id':_0x5c014e[_0x5535('0x5e')]['id']}})[_0x5535('0x25')](handleEntityNotFound(_0x463192,null))[_0x5535('0x25')](function(_0x28a37a){if(_0x28a37a){return _0x28a37a[_0x5535('0x84')]();}return null;})[_0x5535('0x25')](respondWithResult(_0x463192,null))[_0x5535('0x5c')](handleError(_0x463192,null));};exports[_0x5535('0x85')]=function(_0x5b6d52,_0x2e55e4,_0x289656){if(_0x5b6d52[_0x5535('0x5d')]['id']){delete _0x5b6d52[_0x5535('0x5d')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x5b6d52['params']['id']}})[_0x5535('0x25')](handleEntityNotFound(_0x2e55e4,null))[_0x5535('0x25')](function(_0x36aa0a){if(_0x36aa0a){_0x5b6d52[_0x5535('0x5d')][_0x5535('0x69')]=_0x36aa0a['id'];return db[_0x5535('0x3f')][_0x5535('0x64')](_0x5b6d52['body']);}})[_0x5535('0x25')](respondWithResult(_0x2e55e4,null))['catch'](handleError(_0x2e55e4,null));};exports['removeImap']=function(_0x1363bc,_0x103dcc,_0x4ce00d){return db[_0x5535('0x44')][_0x5535('0x66')]({'where':{'id':_0x1363bc['params']['id']}})[_0x5535('0x25')](handleEntityNotFound(_0x103dcc,null))[_0x5535('0x25')](function(_0x40c408){if(_0x40c408){return _0x40c408[_0x5535('0x86')](null);}return null;})['then'](respondWithStatusCode(_0x103dcc,null))[_0x5535('0x5c')](handleError(_0x103dcc,null));};exports['getSmtp']=function(_0x49b811,_0x5751a6,_0x6d90c3){return db[_0x5535('0x44')]['findOne']({'where':{'id':_0x49b811[_0x5535('0x5e')]['id']}})[_0x5535('0x25')](handleEntityNotFound(_0x5751a6,null))[_0x5535('0x25')](function(_0x1836db){if(_0x1836db){return _0x1836db[_0x5535('0x87')]();}return null;})[_0x5535('0x25')](respondWithResult(_0x5751a6,null))[_0x5535('0x5c')](handleError(_0x5751a6,null));};exports[_0x5535('0x88')]=function(_0x5c8756,_0x3b900a,_0x27b8b5){if(_0x5c8756[_0x5535('0x5d')]['id']){delete _0x5c8756[_0x5535('0x5d')]['id'];}return db[_0x5535('0x44')]['find']({'where':{'id':_0x5c8756[_0x5535('0x5e')]['id']}})[_0x5535('0x25')](handleEntityNotFound(_0x3b900a,null))[_0x5535('0x25')](function(_0x15d37d){if(_0x15d37d){_0x5c8756[_0x5535('0x5d')][_0x5535('0x69')]=_0x15d37d['id'];return db[_0x5535('0x5f')][_0x5535('0x64')](_0x5c8756[_0x5535('0x5d')]);}})[_0x5535('0x25')](respondWithResult(_0x3b900a,null))[_0x5535('0x5c')](handleError(_0x3b900a,null));};exports[_0x5535('0x89')]=function(_0x26f0a2,_0x44149f,_0x584378){return db['MailAccount'][_0x5535('0x66')]({'where':{'id':_0x26f0a2[_0x5535('0x5e')]['id']}})[_0x5535('0x25')](handleEntityNotFound(_0x44149f,null))[_0x5535('0x25')](function(_0x333961){if(_0x333961){return _0x333961[_0x5535('0x8a')](null);}return null;})[_0x5535('0x25')](respondWithStatusCode(_0x44149f,null))[_0x5535('0x5c')](handleError(_0x44149f,null));};exports['addInteraction']=function(_0x238007,_0x35cb0c,_0x6af2d2){return db[_0x5535('0x8b')][_0x5535('0x5b')]({'where':{'id':_0x238007['params']['id']}})[_0x5535('0x25')](handleEntityNotFound(_0x35cb0c,null))[_0x5535('0x25')](function(_0x720b20){if(_0x720b20){return _0x720b20[_0x5535('0x8c')](_0x238007[_0x5535('0x5d')][_0x5535('0x6d')],_[_0x5535('0x8d')](_0x238007[_0x5535('0x5d')],[_0x5535('0x6d'),'id'])||{});}})[_0x5535('0x25')](respondWithResult(_0x35cb0c,null))[_0x5535('0x5c')](handleError(_0x35cb0c,null));};exports[_0x5535('0x8e')]=function(_0x525677,_0x4df639,_0x1cc005){var _0x3c5064={'raw':![],'where':{}};var _0x109028={};var _0x4099e3={'count':0x0,'rows':[]};return db['MailAccount'][_0x5535('0x66')]({'where':{'id':_0x525677[_0x5535('0x5e')]['id']}})['then'](handleEntityNotFound(_0x4df639,null))[_0x5535('0x25')](function(_0x368bf8){if(_0x368bf8){_0x109028[_0x5535('0x47')]=_[_0x5535('0x49')](db[_0x5535('0x8b')]['rawAttributes']);_0x109028[_0x5535('0x48')]=_[_0x5535('0x49')](_0x525677[_0x5535('0x48')]);_0x109028[_0x5535('0x4a')]=_['intersection'](_0x109028['model'],_0x109028['query']);_0x3c5064[_0x5535('0x4c')]=_[_0x5535('0x4b')](_0x109028[_0x5535('0x47')],qs[_0x5535('0x4d')](_0x525677['query'][_0x5535('0x4d')]));_0x3c5064[_0x5535('0x4c')]=_0x3c5064[_0x5535('0x4c')]['length']?_0x3c5064[_0x5535('0x4c')]:_0x109028[_0x5535('0x47')];if(!_0x525677[_0x5535('0x48')]['hasOwnProperty'](_0x5535('0x67'))){_0x3c5064[_0x5535('0x33')]=qs[_0x5535('0x33')](_0x525677[_0x5535('0x48')][_0x5535('0x33')]);_0x3c5064[_0x5535('0x32')]=qs[_0x5535('0x32')](_0x525677[_0x5535('0x48')]['offset']);}_0x3c5064[_0x5535('0x68')]=qs['sort'](_0x525677['query'][_0x5535('0x4f')]);_0x3c5064[_0x5535('0x52')]=qs[_0x5535('0x4a')](_[_0x5535('0x50')](_0x525677['query'],_0x109028['filters']));_0x3c5064[_0x5535('0x52')]['MailAccountId']=_0x368bf8['id'];if(_0x525677[_0x5535('0x48')]['filter']){_0x3c5064[_0x5535('0x52')]=_['merge'](_0x3c5064[_0x5535('0x52')],{'$or':_[_0x5535('0x43')](_0x3c5064[_0x5535('0x4c')],function(_0xbeb5c3){var _0x54c4b3={};_0x54c4b3[_0xbeb5c3]={'$like':'%'+_0x525677[_0x5535('0x48')]['filter']+'%'};return _0x54c4b3;})});}_0x3c5064=_['merge']({},_0x3c5064,_0x525677['options']);return db[_0x5535('0x8b')][_0x5535('0x31')]({'where':_0x3c5064['where']})[_0x5535('0x25')](function(_0x14ecfa){_0x4099e3['count']=_0x14ecfa;if(_0x525677['query'][_0x5535('0x58')]){_0x3c5064[_0x5535('0x5a')]=[{'model':db[_0x5535('0x8f')],'as':'Contact','required':![]},{'model':db[_0x5535('0x90')],'as':_0x5535('0x91'),'attributes':[_0x5535('0x3d'),_0x5535('0x92'),'internal'],'required':![]},{'model':db[_0x5535('0x93')],'as':_0x5535('0x94'),'attributes':['id',_0x5535('0x3d'),_0x5535('0x95')],'where':_0x525677[_0x5535('0x48')][_0x5535('0x96')]?{'id':_0x525677[_0x5535('0x48')][_0x5535('0x96')]}:undefined,'required':_0x525677[_0x5535('0x48')][_0x5535('0x96')]?!![]:![]}];}return db['MailInteraction'][_0x5535('0x6a')](_0x3c5064);})[_0x5535('0x25')](function(_0x48c952){_0x4099e3['rows']=_0x48c952;return _0x4099e3;});}})[_0x5535('0x25')](respondWithFilteredResult(_0x4df639,_0x3c5064))[_0x5535('0x5c')](handleError(_0x4df639,null));};exports[_0x5535('0x97')]=function(_0x407c99,_0x4b12a8,_0x2a626e){return db[_0x5535('0x44')][_0x5535('0x66')]({'where':{'id':_0x407c99['params']['id']}})[_0x5535('0x25')](handleEntityNotFound(_0x4b12a8,null))[_0x5535('0x25')](function(_0x2d0c83){if(_0x2d0c83){return db[_0x5535('0x98')][_0x5535('0x99')](function(_0x464e54){return db['MailApplication'][_0x5535('0x39')]({'where':{'MailAccountId':_0x407c99[_0x5535('0x5e')]['id']},'transaction':_0x464e54})[_0x5535('0x25')](function(_0x2dcde5){var _0x192c3e=_[_0x5535('0x43')](_0x407c99[_0x5535('0x5d')],function(_0x290585){_0x290585[_0x5535('0x69')]=_0x407c99['params']['id'];return _0x290585;});return db[_0x5535('0x9a')]['bulkCreate'](_0x192c3e,{'transaction':_0x464e54});});})[_0x5535('0x25')](function(){return db[_0x5535('0x9a')][_0x5535('0x9b')]({'where':{'MailAccountId':_0x407c99[_0x5535('0x5e')]['id']},'order':_0x5535('0x9c')});});}})[_0x5535('0x25')](respondWithResult(_0x4b12a8,null))[_0x5535('0x5c')](handleError(_0x4b12a8,null));};exports[_0x5535('0x9d')]=function(_0x3b6694,_0x4f3b7e,_0x424430){var _0x4afed0={};var _0x4a4ae9={};var _0x520048;var _0x49ad42;return db[_0x5535('0x44')]['findOne']({'where':{'id':_0x3b6694[_0x5535('0x5e')]['id']}})[_0x5535('0x25')](handleEntityNotFound(_0x4f3b7e,null))[_0x5535('0x25')](function(_0x1ef86f){if(_0x1ef86f){_0x520048=_0x1ef86f;_0x4a4ae9[_0x5535('0x47')]=_[_0x5535('0x49')](db['MailApplication'][_0x5535('0x45')]);_0x4a4ae9['query']=_[_0x5535('0x49')](_0x3b6694[_0x5535('0x48')]);_0x4a4ae9[_0x5535('0x4a')]=_[_0x5535('0x4b')](_0x4a4ae9[_0x5535('0x47')],_0x4a4ae9[_0x5535('0x48')]);_0x4afed0[_0x5535('0x4c')]=_[_0x5535('0x4b')](_0x4a4ae9['model'],qs[_0x5535('0x4d')](_0x3b6694[_0x5535('0x48')]['fields']));_0x4afed0['attributes']=_0x4afed0['attributes'][_0x5535('0x4e')]?_0x4afed0[_0x5535('0x4c')]:_0x4a4ae9['model'];_0x4afed0[_0x5535('0x68')]=qs[_0x5535('0x4f')](_0x3b6694[_0x5535('0x48')][_0x5535('0x4f')]);_0x4afed0['where']=qs[_0x5535('0x4a')](_[_0x5535('0x50')](_0x3b6694['query'],_0x4a4ae9[_0x5535('0x4a')]));if(_0x3b6694['query'][_0x5535('0x51')]){_0x4afed0['where']=_[_0x5535('0x53')](_0x4afed0['where'],{'$or':_[_0x5535('0x43')](_0x4afed0[_0x5535('0x4c')],function(_0x345c1d){var _0x1ad659={};_0x1ad659[_0x345c1d]={'$like':'%'+_0x3b6694[_0x5535('0x48')]['filter']+'%'};return _0x1ad659;})});}_0x4afed0=_[_0x5535('0x53')]({},_0x4afed0,_0x3b6694[_0x5535('0x57')]);return _0x520048['getApplications'](_0x4afed0);}})['then'](function(_0x2da0d0){if(_0x2da0d0){_0x49ad42=_0x2da0d0['length'];if(!_0x3b6694[_0x5535('0x48')][_0x5535('0x9e')](_0x5535('0x67'))){_0x4afed0['limit']=qs['limit'](_0x3b6694[_0x5535('0x48')]['limit']);_0x4afed0['offset']=qs[_0x5535('0x32')](_0x3b6694[_0x5535('0x48')][_0x5535('0x32')]);}return _0x520048[_0x5535('0x9d')](_0x4afed0);}})['then'](function(_0x5bdec6){if(_0x5bdec6){return _0x5bdec6?{'count':_0x49ad42,'rows':_0x5bdec6}:null;}})[_0x5535('0x25')](respondWithResult(_0x4f3b7e,null))[_0x5535('0x5c')](handleError(_0x4f3b7e,null));};exports[_0x5535('0x9f')]=function(_0x229f0c,_0x196b64,_0x28a1c7){var _0x5dca0b={'raw':!![],'where':{}};var _0x11263c={};var _0x34ab31={'count':0x0,'rows':[]};return db[_0x5535('0x44')]['findOne']({'where':{'id':_0x229f0c[_0x5535('0x5e')]['id']}})[_0x5535('0x25')](handleEntityNotFound(_0x196b64,null))[_0x5535('0x25')](function(_0x50e8eb){if(_0x50e8eb){_0x11263c[_0x5535('0x47')]=_['keys'](db[_0x5535('0xa0')][_0x5535('0x45')]);_0x11263c['query']=_[_0x5535('0x49')](_0x229f0c['query']);_0x11263c[_0x5535('0x4a')]=_[_0x5535('0x4b')](_0x11263c[_0x5535('0x47')],_0x11263c[_0x5535('0x48')]);_0x5dca0b[_0x5535('0x4c')]=_[_0x5535('0x4b')](_0x11263c[_0x5535('0x47')],qs[_0x5535('0x4d')](_0x229f0c[_0x5535('0x48')][_0x5535('0x4d')]));_0x5dca0b[_0x5535('0x4c')]=_0x5dca0b[_0x5535('0x4c')]['length']?_0x5dca0b[_0x5535('0x4c')]:_0x11263c['model'];if(!_0x229f0c[_0x5535('0x48')][_0x5535('0x9e')]('nolimit')){_0x5dca0b[_0x5535('0x33')]=qs['limit'](_0x229f0c[_0x5535('0x48')][_0x5535('0x33')]);_0x5dca0b[_0x5535('0x32')]=qs[_0x5535('0x32')](_0x229f0c[_0x5535('0x48')][_0x5535('0x32')]);}_0x5dca0b['order']=qs[_0x5535('0x4f')](_0x229f0c['query'][_0x5535('0x4f')]);_0x5dca0b[_0x5535('0x52')]=qs[_0x5535('0x4a')](_['pick'](_0x229f0c['query'],_0x11263c[_0x5535('0x4a')]));_0x5dca0b[_0x5535('0x52')][_0x5535('0x69')]=_0x50e8eb['id'];if(_0x229f0c[_0x5535('0x48')][_0x5535('0x51')]){_0x5dca0b['where']=_[_0x5535('0x53')](_0x5dca0b[_0x5535('0x52')],{'$or':_['map'](_0x5dca0b[_0x5535('0x4c')],function(_0x3f6116){var _0x13cb88={};_0x13cb88[_0x3f6116]={'$like':'%'+_0x229f0c['query'][_0x5535('0x51')]+'%'};return _0x13cb88;})});}if(_0x229f0c[_0x5535('0x48')][_0x5535('0xa1')]){var _0x42f1f2=_0x229f0c[_0x5535('0x48')][_0x5535('0xa1')]['split'](',');var _0x4215e7={};_0x4215e7[_0x42f1f2[0x0]]={'$gte':moment(_0x42f1f2[0x1])[_0x5535('0xa2')](_0x5535('0xa3'))};_0x5dca0b['where']=_[_0x5535('0x53')](_0x5dca0b[_0x5535('0x52')],_0x4215e7);}_0x5dca0b=_[_0x5535('0x53')]({},_0x5dca0b,_0x229f0c['options']);return db[_0x5535('0xa0')][_0x5535('0x31')]({'where':_0x5dca0b[_0x5535('0x52')]})['then'](function(_0x3c2eab){_0x34ab31['count']=_0x3c2eab;if(_0x229f0c[_0x5535('0x48')][_0x5535('0x58')]){_0x5dca0b[_0x5535('0x5a')]=[{'all':!![]}];}return db['MailMessage'][_0x5535('0x6a')](_0x5dca0b);})[_0x5535('0x25')](function(_0xc012bc){_0x34ab31['rows']=_0xc012bc;return _0x34ab31;});}})[_0x5535('0x25')](respondWithFilteredResult(_0x196b64,_0x5dca0b))[_0x5535('0x5c')](handleError(_0x196b64,null));};exports[_0x5535('0xa4')]=function(_0x78b876,_0x454fdf,_0x41d26d){var _0x54472a,_0x325a05={},_0x1fec15;if(_0x78b876['body']['to']){_0x1fec15=_0x78b876[_0x5535('0x5d')]['to'][_0x5535('0xa5')](',')[0x0];}return db[_0x5535('0x44')][_0x5535('0x5b')]({'where':{'id':_0x78b876[_0x5535('0x5e')]['id']},'include':[{'model':db[_0x5535('0xa6')],'as':_0x5535('0xa7'),'include':[{'model':db[_0x5535('0x8f')],'as':_0x5535('0xa8'),'where':{'email':_0x1fec15},'limit':0x1,'order':[[_0x5535('0xa9'),_0x5535('0xaa')]]}]},{'model':db[_0x5535('0x5f')],'as':'Smtp','raw':!![]}]})[_0x5535('0x25')](handleEntityNotFound(_0x454fdf,null))[_0x5535('0x25')](function(_0x4ad580){if(_0x4ad580){_0x54472a=_0x4ad580;if(_0x4ad580['Smtp']){if(_[_0x5535('0x73')](_0x78b876[_0x5535('0x5d')]['from'])){_0x78b876['body'][_0x5535('0xab')]=util['format']('%s\x20<%s>',_0x4ad580[_0x5535('0x3d')],_0x4ad580[_0x5535('0x72')]||_0x4ad580[_0x5535('0x40')][_0x5535('0x78')]);}if(_0x78b876[_0x5535('0x5d')][_0x5535('0xac')]&&_0x78b876[_0x5535('0x5d')]['attachments']['length']){for(var _0x479ee8=0x0;_0x479ee8<_0x78b876['body'][_0x5535('0xac')][_0x5535('0x4e')];_0x479ee8+=0x1){_0x78b876[_0x5535('0x5d')]['attachments'][_0x479ee8]={'filename':_0x78b876['body'][_0x5535('0xac')][_0x479ee8]['name'],'path':path[_0x5535('0xad')](config[_0x5535('0xae')],_0x5535('0xaf'),_0x78b876[_0x5535('0x5d')][_0x5535('0xac')][_0x479ee8]['basename'])};}}var _0x487ab2={'tls':{'rejectUnauthorized':![]}};if(_[_0x5535('0x73')](_0x4ad580['Smtp'][_0x5535('0x7e')])){if(_0x4ad580[_0x5535('0x40')][_0x5535('0x7b')]){_0x487ab2[_0x5535('0xb0')]={'user':_0x4ad580[_0x5535('0x40')][_0x5535('0x78')],'pass':_0x4ad580['Smtp'][_0x5535('0x7f')]};}_0x487ab2['host']=_0x4ad580[_0x5535('0x40')][_0x5535('0x7c')];_0x487ab2[_0x5535('0x7d')]=_0x4ad580[_0x5535('0x40')][_0x5535('0x7d')];_0x487ab2['secure']=_0x4ad580[_0x5535('0x40')][_0x5535('0xb1')];}else{_0x487ab2[_0x5535('0x7e')]=_0x4ad580[_0x5535('0x40')][_0x5535('0x7e')];_0x487ab2[_0x5535('0xb0')]={'user':_0x4ad580['Smtp']['user'],'pass':_0x4ad580[_0x5535('0x40')][_0x5535('0x7f')]};}return respondWithRpcPromise(_0x5535('0xb2'),_0x5535('0xb3'),{'account':_0x487ab2,'message':_0x78b876['body']});}else{throw new Error(_0x5535('0xb4'));}}})['then'](function(_0x4af9a1){if(_0x4af9a1){_0x325a05=_0x4af9a1;if(_0x54472a[_0x5535('0xa7')]){if(_0x54472a[_0x5535('0xa7')][_0x5535('0xa8')][_0x5535('0x4e')]){return _0x54472a['List'][_0x5535('0xa8')][0x0];}else{return db[_0x5535('0x8f')]['create'](_[_0x5535('0x1d')](_0x78b876['body'],{'firstName':_0x78b876['body']['to'],'email':_0x78b876[_0x5535('0x5d')]['to'],'phone':_0x78b876[_0x5535('0x5d')]['to'],'ListId':_0x54472a['ListId']}));}}else{throw new Error('List\x20not\x20found');}}})[_0x5535('0x25')](function(_0xaefc6d){if(_0xaefc6d){var _0x3fcfcd={'UserId':_0x78b876[_0x5535('0x78')]['id'],'ContactId':_0xaefc6d['id'],'MailAccountId':_0x54472a['id'],'inReplyTo':_0x325a05[_0x5535('0xb5')],'to':_0x78b876[_0x5535('0x5d')][_0x5535('0xab')],'cc':_0x78b876[_0x5535('0x5d')]['cc'],'subject':_0x78b876[_0x5535('0x5d')][_0x5535('0xb6')],'attach':_0x78b876[_0x5535('0x5d')][_0x5535('0xb7')],'firstMsgDirection':_0x5535('0xb8'),'lastMsgAt':moment()['format'](_0x5535('0xa3')),'lastMsgDirection':'out','lastMsgBody':_0x78b876[_0x5535('0x5d')][_0x5535('0x5d')],'Messages':[_[_0x5535('0x53')](_0x78b876[_0x5535('0x5d')],{'messageId':_0x325a05[_0x5535('0xb5')],'sentAt':moment()[_0x5535('0xa2')](_0x5535('0xa3')),'read':!![],'MailAccountId':_0x54472a['id'],'UserId':_0x78b876[_0x5535('0x78')]['id'],'ContactId':_0xaefc6d['id']})]};if(_0x78b876[_0x5535('0x5d')][_0x5535('0xb9')]){_0x3fcfcd=_[_0x5535('0x53')](_0x3fcfcd,_0x78b876[_0x5535('0x5d')][_0x5535('0xb9')]);}return db[_0x5535('0x8b')]['create'](_0x3fcfcd,{'include':[{'model':db['MailMessage'],'as':'Messages'}]});}})[_0x5535('0x25')](respondWithResult(_0x454fdf,null))[_0x5535('0x5c')](handleError(_0x454fdf,null));};exports['verifySmtp']=function(_0x169740,_0x382ac7,_0xbd805f){return db[_0x5535('0x44')][_0x5535('0x5b')]({'where':{'id':_0x169740[_0x5535('0x5e')]['id']},'include':[{'model':db[_0x5535('0x5f')],'as':_0x5535('0x40'),'raw':!![]}]})[_0x5535('0x25')](handleEntityNotFound(_0x382ac7,null))[_0x5535('0x25')](function(_0x41c98d){if(_0x41c98d&&_0x41c98d[_0x5535('0x40')]){var _0x4a0ef5={'id':_0x41c98d['id'],'tls':{'rejectUnauthorized':![]}};if(_0x41c98d[_0x5535('0x40')][_0x5535('0x7e')]){_0x4a0ef5[_0x5535('0x7e')]=_0x41c98d['Smtp'][_0x5535('0x7e')];}else{_0x4a0ef5[_0x5535('0x7c')]=_0x41c98d[_0x5535('0x40')][_0x5535('0x7c')];_0x4a0ef5[_0x5535('0x7d')]=_0x41c98d['Smtp'][_0x5535('0x7d')];_0x4a0ef5[_0x5535('0xb1')]=_0x41c98d['Smtp'][_0x5535('0xb1')];}if(_0x41c98d[_0x5535('0x40')][_0x5535('0x7b')]){_0x4a0ef5[_0x5535('0xb0')]={'user':_0x41c98d[_0x5535('0x40')][_0x5535('0x78')],'pass':_0x41c98d[_0x5535('0x40')]['pass']};}return respondWithRpcPromise(_0x5535('0xba'),_0x5535('0xbb'),{'account':_0x4a0ef5});}})[_0x5535('0x25')](respondWithResult(_0x382ac7,null))[_0x5535('0x5c')](handleError(_0x382ac7,null));};exports['destroy']=function(_0x4d8cbb,_0xd7aab0){return db[_0x5535('0x44')][_0x5535('0x5b')]({'where':{'id':_0x4d8cbb[_0x5535('0x5e')]['id']}})[_0x5535('0x25')](handleEntityNotFound(_0xd7aab0,null))[_0x5535('0x25')](function(_0x20e743){if(_0x20e743&&_0x20e743['service']){throw new db[(_0x5535('0xbc'))][(_0x5535('0xbd'))](_0x5535('0xbe'));}return _0x20e743;})[_0x5535('0x25')](removeEntity(_0xd7aab0,null))['catch'](handleError(_0xd7aab0,null));};exports['addAgents']=function(_0x178d09,_0x182890,_0x52bb2c){return db['MailAccount'][_0x5535('0x5b')]({'where':{'id':_0x178d09['params']['id']}})[_0x5535('0x25')](handleEntityNotFound(_0x182890,null))[_0x5535('0x25')](function(_0x1bc629){if(_0x1bc629){return _0x1bc629[_0x5535('0xbf')](_0x178d09[_0x5535('0x5d')]['ids'],_['omit'](_0x178d09[_0x5535('0x5d')],[_0x5535('0x6d'),'id'])||{})['spread'](function(_0x4bc6b0){for(var _0x5b172b=0x0;_0x5b172b<_0x178d09[_0x5535('0x5d')][_0x5535('0x6d')][_0x5535('0x4e')];_0x5b172b+=0x1){socket[_0x5535('0xc0')]('userMailAccount:save',{'UserId':_0x178d09[_0x5535('0x5d')][_0x5535('0x6d')][_0x5b172b],'MailAccountId':_0x178d09[_0x5535('0x5e')]['id']});}return _0x4bc6b0;});}})[_0x5535('0x25')](respondWithResult(_0x182890,null))['catch'](handleError(_0x182890,null));};exports[_0x5535('0xc1')]=function(_0x368a81,_0xf0be29,_0x1d0c2a){return db[_0x5535('0x44')][_0x5535('0x5b')]({'where':{'id':_0x368a81[_0x5535('0x5e')]['id']}})['then'](handleEntityNotFound(_0xf0be29,null))[_0x5535('0x25')](function(_0x270e56){if(_0x270e56){return _0x270e56[_0x5535('0xc1')](_0x368a81[_0x5535('0x48')][_0x5535('0x6d')])[_0x5535('0x25')](function(){if(_[_0x5535('0xc2')](_0x368a81['query'][_0x5535('0x6d')])){for(var _0x4abbbe=0x0;_0x4abbbe<_0x368a81[_0x5535('0x48')][_0x5535('0x6d')][_0x5535('0x4e')];_0x4abbbe+=0x1){socket[_0x5535('0xc0')](_0x5535('0xc3'),{'UserId':Number(_0x368a81[_0x5535('0x48')][_0x5535('0x6d')][_0x4abbbe]),'MailAccountId':Number(_0x368a81[_0x5535('0x5e')]['id'])});}}else{socket[_0x5535('0xc0')](_0x5535('0xc3'),{'UserId':Number(_0x368a81[_0x5535('0x48')]['ids']),'MailAccountId':Number(_0x368a81[_0x5535('0x5e')]['id'])});}});}})['then'](respondWithStatusCode(_0xf0be29,null))[_0x5535('0x5c')](handleError(_0xf0be29,null));};exports[_0x5535('0xc4')]=function(_0x4dcda2,_0x4387c9,_0x1cf613){var _0x411238={};var _0x100247={};var _0x169e34;var _0x4a366a;return db['MailAccount'][_0x5535('0x66')]({'where':{'id':_0x4dcda2['params']['id']}})[_0x5535('0x25')](handleEntityNotFound(_0x4387c9,null))[_0x5535('0x25')](function(_0x3e4bfb){if(_0x3e4bfb){_0x169e34=_0x3e4bfb;_0x100247['model']=_[_0x5535('0x49')](db[_0x5535('0x90')][_0x5535('0x45')]);_0x100247['query']=_[_0x5535('0x49')](_0x4dcda2[_0x5535('0x48')]);_0x100247['filters']=_[_0x5535('0x4b')](_0x100247[_0x5535('0x47')],_0x100247[_0x5535('0x48')]);_0x411238[_0x5535('0x4c')]=_[_0x5535('0x4b')](_0x100247[_0x5535('0x47')],qs[_0x5535('0x4d')](_0x4dcda2['query'][_0x5535('0x4d')]));_0x411238[_0x5535('0x4c')]=_0x411238['attributes'][_0x5535('0x4e')]?_0x411238[_0x5535('0x4c')]:_0x100247['model'];_0x411238[_0x5535('0x68')]=qs[_0x5535('0x4f')](_0x4dcda2[_0x5535('0x48')]['sort']);_0x411238[_0x5535('0x52')]=qs[_0x5535('0x4a')](_[_0x5535('0x50')](_0x4dcda2['query'],_0x100247[_0x5535('0x4a')]));if(_0x4dcda2[_0x5535('0x48')][_0x5535('0x51')]){_0x411238['where']=_[_0x5535('0x53')](_0x411238[_0x5535('0x52')],{'$or':_['map'](_0x411238['attributes'],function(_0xff202e){var _0x5b20ff={};_0x5b20ff[_0xff202e]={'$like':'%'+_0x4dcda2[_0x5535('0x48')]['filter']+'%'};return _0x5b20ff;})});}_0x411238=_[_0x5535('0x53')]({},_0x411238,_0x4dcda2[_0x5535('0x57')]);return _0x169e34[_0x5535('0xc4')](_0x411238);}})['then'](function(_0x534578){if(_0x534578){_0x4a366a=_0x534578['length'];if(!_0x4dcda2[_0x5535('0x48')][_0x5535('0x9e')](_0x5535('0x67'))){_0x411238[_0x5535('0x33')]=qs[_0x5535('0x33')](_0x4dcda2[_0x5535('0x48')][_0x5535('0x33')]);_0x411238[_0x5535('0x32')]=qs[_0x5535('0x32')](_0x4dcda2[_0x5535('0x48')][_0x5535('0x32')]);}return _0x169e34[_0x5535('0xc4')](_0x411238);}})['then'](function(_0x325bf2){if(_0x325bf2){return _0x325bf2?{'count':_0x4a366a,'rows':_0x325bf2}:null;}})[_0x5535('0x25')](respondWithResult(_0x4387c9,null))['catch'](handleError(_0x4387c9,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index b349b66..18530be 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 _0x207c=['hook','exports','../../mysqldb','MailAccount','setMaxListeners','save','update','remove','hasOwnProperty'];(function(_0x3a1256,_0x1fe2db){var _0x1bd352=function(_0x509c54){while(--_0x509c54){_0x3a1256['push'](_0x3a1256['shift']());}};_0x1bd352(++_0x1fe2db);}(_0x207c,0x1e8));var _0xc207=function(_0x47c89e,_0x18692c){_0x47c89e=_0x47c89e-0x0;var _0x1de51e=_0x207c[_0x47c89e];return _0x1de51e;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0xc207('0x0'))['db'][_0xc207('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xc207('0x2')](0x0);var events={'afterCreate':_0xc207('0x3'),'afterUpdate':_0xc207('0x4'),'afterDestroy':_0xc207('0x5')};function emitEvent(_0x1dd107){return function(_0x4b9daa,_0x38ff02,_0x59bc89){MailAccountEvents['emit'](_0x1dd107+':'+_0x4b9daa['id'],_0x4b9daa);MailAccountEvents['emit'](_0x1dd107,_0x4b9daa);_0x59bc89(null);};}for(var e in events){if(events[_0xc207('0x6')](e)){var event=events[e];MailAccount[_0xc207('0x7')](e,emitEvent(event));}}module[_0xc207('0x8')]=MailAccountEvents; \ No newline at end of file +var _0x8ef6=['hook','exports','events','../../mysqldb','MailAccount','setMaxListeners','save','update','remove','emit'];(function(_0x17809c,_0xa6ceb9){var _0x144a29=function(_0x44b044){while(--_0x44b044){_0x17809c['push'](_0x17809c['shift']());}};_0x144a29(++_0xa6ceb9);}(_0x8ef6,0xf2));var _0x68ef=function(_0x351c94,_0x559d18){_0x351c94=_0x351c94-0x0;var _0x452724=_0x8ef6[_0x351c94];return _0x452724;};'use strict';var EventEmitter=require(_0x68ef('0x0'));var MailAccount=require(_0x68ef('0x1'))['db'][_0x68ef('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x68ef('0x3')](0x0);var events={'afterCreate':_0x68ef('0x4'),'afterUpdate':_0x68ef('0x5'),'afterDestroy':_0x68ef('0x6')};function emitEvent(_0x4a72b8){return function(_0x27d0af,_0x129ce,_0xbab618){MailAccountEvents[_0x68ef('0x7')](_0x4a72b8+':'+_0x27d0af['id'],_0x27d0af);MailAccountEvents['emit'](_0x4a72b8,_0x27d0af);_0xbab618(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount[_0x68ef('0x8')](e,emitEvent(event));}}module[_0x68ef('0x9')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index c4debd5..7ef5a6e 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 _0x3e40=['../../config/logger','api','moment','bluebird','path','rimraf','./mailAccount.attributes','exports','define','MailAccount','mail_accounts','lodash'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x3e40,0xef));var _0x03e4=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0x3e40[_0x3b5250];return _0xc844a1;};'use strict';var _=require(_0x03e4('0x0'));var util=require('util');var logger=require(_0x03e4('0x1'))(_0x03e4('0x2'));var moment=require(_0x03e4('0x3'));var BPromise=require(_0x03e4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x03e4('0x5'));var rimraf=require(_0x03e4('0x6'));var config=require('../../config/environment');var attributes=require(_0x03e4('0x7'));module[_0x03e4('0x8')]=function(_0xc3aef1,_0x55a049){return _0xc3aef1[_0x03e4('0x9')](_0x03e4('0xa'),attributes,{'tableName':_0x03e4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0f2f=['lodash','util','../../config/logger','api','bluebird','rimraf','../../config/environment','./mailAccount.attributes','exports','define','mail_accounts'];(function(_0xf04c6d,_0xe98786){var _0x4a804e=function(_0x431a0a){while(--_0x431a0a){_0xf04c6d['push'](_0xf04c6d['shift']());}};_0x4a804e(++_0xe98786);}(_0x0f2f,0x6e));var _0xf0f2=function(_0x2c6137,_0x1e423a){_0x2c6137=_0x2c6137-0x0;var _0x7b57c4=_0x0f2f[_0x2c6137];return _0x7b57c4;};'use strict';var _=require(_0xf0f2('0x0'));var util=require(_0xf0f2('0x1'));var logger=require(_0xf0f2('0x2'))(_0xf0f2('0x3'));var moment=require('moment');var BPromise=require(_0xf0f2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf0f2('0x5'));var config=require(_0xf0f2('0x6'));var attributes=require(_0xf0f2('0x7'));module[_0xf0f2('0x8')]=function(_0x2a9523,_0x5d27a9){return _0x2a9523[_0xf0f2('0x9')]('MailAccount',attributes,{'tableName':_0xf0f2('0xa'),'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 f9344cd..36df5d6 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 _0xbca8=['attach','originTo','originCc','bcc','Attachment','Attachments','UserId','User','unshift','agent','name','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','localhost','socket.io-emitter','./mailAccount.socket','register','MailAccount,\x20%s,\x20%s','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','MailAccount','findAll','options','where','limit','include','map','attributes','model','then','GetMailAccount','find','ShowMailAccount','debug','NotifyMailAccount','body','mail','keys','CmContact','createdAt','updatedAt','CompanyId','ListId','isNil','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','Contacts','DESC','MailApplication','Applications','Smtp','get','account','list','applications','priority','autoclose','length','*,*,*,*','defaults','mapKey','create','List\x20not\x20found','contact','messageId','generate','subject','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','inReplyTo','Contact\x20not\x20found','update','interaction'];(function(_0x295264,_0x4eaa36){var _0x6ee77e=function(_0x5efef7){while(--_0x5efef7){_0x295264['push'](_0x295264['shift']());}};_0x6ee77e(++_0x4eaa36);}(_0xbca8,0xcc));var _0x8bca=function(_0x2cea95,_0x5c89d3){_0x2cea95=_0x2cea95-0x0;var _0x51fe10=_0xbca8[_0x2cea95];return _0x51fe10;};'use strict';var _=require(_0x8bca('0x0'));var util=require(_0x8bca('0x1'));var moment=require(_0x8bca('0x2'));var BPromise=require(_0x8bca('0x3'));var rs=require(_0x8bca('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8bca('0x5'))['db'];var utils=require(_0x8bca('0x6'));var logger=require(_0x8bca('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8bca('0x8'));var client=jayson[_0x8bca('0x9')][_0x8bca('0xa')]({'port':0x232c});config[_0x8bca('0xb')]=_['defaults'](config[_0x8bca('0xb')],{'host':_0x8bca('0xc'),'port':0x18eb});var socket=require(_0x8bca('0xd'))(new Redis(config[_0x8bca('0xb')]));require(_0x8bca('0xe'))[_0x8bca('0xf')](socket);function respondWithRpcPromise(_0x229cc4,_0x4ee4a0,_0x4ff0b1){return new BPromise(function(_0x18c1ca,_0x38c607){return client['request'](_0x229cc4,_0x4ff0b1)['then'](function(_0x31afa0){logger['info'](_0x8bca('0x10'),_0x4ee4a0,_0x8bca('0x11'));logger['debug'](_0x8bca('0x12'),_0x4ee4a0,_0x8bca('0x11'),JSON[_0x8bca('0x13')](_0x31afa0));if(_0x31afa0[_0x8bca('0x14')]){if(_0x31afa0['error']['code']===0x1f4){logger[_0x8bca('0x14')]('MailAccount,\x20%s,\x20%s',_0x4ee4a0,_0x31afa0[_0x8bca('0x14')][_0x8bca('0x15')]);return _0x38c607(_0x31afa0[_0x8bca('0x14')][_0x8bca('0x15')]);}logger[_0x8bca('0x14')](_0x8bca('0x10'),_0x4ee4a0,_0x31afa0['error']['message']);return _0x18c1ca(_0x31afa0[_0x8bca('0x14')]['message']);}else{logger[_0x8bca('0x16')](_0x8bca('0x10'),_0x4ee4a0,'request\x20sent');_0x18c1ca(_0x31afa0['result']['message']);}})[_0x8bca('0x17')](function(_0xcc6ee5){logger['error'](_0x8bca('0x10'),_0x4ee4a0,_0xcc6ee5);_0x38c607(_0xcc6ee5);});});}exports['GetMailAccount']=function(_0x47b27c){var _0x5e95e4=this;return new Promise(function(_0x423db3,_0x17046f){return db[_0x8bca('0x18')][_0x8bca('0x19')]({'raw':_0x47b27c[_0x8bca('0x1a')]?_0x47b27c[_0x8bca('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x47b27c[_0x8bca('0x1a')]?_0x47b27c[_0x8bca('0x1a')][_0x8bca('0x1b')]||null:null,'attributes':_0x47b27c['options']?_0x47b27c[_0x8bca('0x1a')]['attributes']||null:null,'limit':_0x47b27c[_0x8bca('0x1a')]?_0x47b27c['options'][_0x8bca('0x1c')]||null:null,'include':_0x47b27c[_0x8bca('0x1a')]?_0x47b27c[_0x8bca('0x1a')][_0x8bca('0x1d')]?_[_0x8bca('0x1e')](_0x47b27c[_0x8bca('0x1a')][_0x8bca('0x1d')],function(_0x5f056b){return{'model':db[_0x5f056b['model']],'as':_0x5f056b['as'],'attributes':_0x5f056b[_0x8bca('0x1f')],'include':_0x5f056b[_0x8bca('0x1d')]?_['map'](_0x5f056b[_0x8bca('0x1d')],function(_0x706106){return{'model':db[_0x706106[_0x8bca('0x20')]],'as':_0x706106['as'],'attributes':_0x706106[_0x8bca('0x1f')],'include':_0x706106[_0x8bca('0x1d')]?_['map'](_0x706106[_0x8bca('0x1d')],function(_0x58bfda){return{'model':db[_0x58bfda[_0x8bca('0x20')]],'as':_0x58bfda['as'],'attributes':_0x58bfda['attributes']};}):[]};}):[]};}):[]:[]})[_0x8bca('0x21')](function(_0x134f1d){logger[_0x8bca('0x16')](_0x8bca('0x22'),_0x47b27c);logger['debug'](_0x8bca('0x22'),_0x47b27c,JSON[_0x8bca('0x13')](_0x134f1d));_0x423db3(_0x134f1d);})[_0x8bca('0x17')](function(_0x543897){logger['error']('GetMailAccount',_0x543897[_0x8bca('0x15')],_0x47b27c);_0x17046f(_0x5e95e4[_0x8bca('0x14')](0x1f4,_0x543897[_0x8bca('0x15')]));});});};exports['ShowMailAccount']=function(_0x85b9bc){var _0x1e32c4=this;return new Promise(function(_0x5d147b,_0x352667){return db[_0x8bca('0x18')][_0x8bca('0x23')]({'raw':_0x85b9bc[_0x8bca('0x1a')]?_0x85b9bc[_0x8bca('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x85b9bc[_0x8bca('0x1a')]?_0x85b9bc[_0x8bca('0x1a')][_0x8bca('0x1b')]||null:null,'attributes':_0x85b9bc[_0x8bca('0x1a')]?_0x85b9bc[_0x8bca('0x1a')]['attributes']||null:null,'include':_0x85b9bc[_0x8bca('0x1a')]?_0x85b9bc['options']['include']?_[_0x8bca('0x1e')](_0x85b9bc[_0x8bca('0x1a')]['include'],function(_0x51bb8a){return{'model':db[_0x51bb8a[_0x8bca('0x20')]],'as':_0x51bb8a['as'],'attributes':_0x51bb8a[_0x8bca('0x1f')],'include':_0x51bb8a[_0x8bca('0x1d')]?_['map'](_0x51bb8a[_0x8bca('0x1d')],function(_0x4dd772){return{'model':db[_0x4dd772[_0x8bca('0x20')]],'as':_0x4dd772['as'],'attributes':_0x4dd772[_0x8bca('0x1f')],'include':_0x4dd772['include']?_[_0x8bca('0x1e')](_0x4dd772[_0x8bca('0x1d')],function(_0x1a66c6){return{'model':db[_0x1a66c6['model']],'as':_0x1a66c6['as'],'attributes':_0x1a66c6[_0x8bca('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x8bca('0x21')](function(_0x507309){logger['info'](_0x8bca('0x24'),_0x85b9bc);logger[_0x8bca('0x25')]('ShowMailAccount',_0x85b9bc,JSON['stringify'](_0x507309));_0x5d147b(_0x507309);})[_0x8bca('0x17')](function(_0x2b7439){logger[_0x8bca('0x14')](_0x8bca('0x24'),_0x2b7439[_0x8bca('0x15')],_0x85b9bc);_0x352667(_0x1e32c4[_0x8bca('0x14')](0x1f4,_0x2b7439['message']));});});};exports[_0x8bca('0x26')]=function(_0x1eabe2){var _0x462312=this;return new Promise(function(_0x8873d1,_0x250bb8){var _0x255204={'body':_0x1eabe2[_0x8bca('0x27')],'channel':_0x8bca('0x28')};var _0x508d16=_['difference'](_[_0x8bca('0x29')](db[_0x8bca('0x2a')]['rawAttributes']),[_0x8bca('0x2b'),_0x8bca('0x2c'),_0x8bca('0x2d'),_0x8bca('0x2e')]);var _0x476521=![];if(_0x1eabe2[_0x8bca('0x27')]['id']){delete _0x1eabe2[_0x8bca('0x27')]['id'];}if(_[_0x8bca('0x2f')](_0x1eabe2[_0x8bca('0x27')]['from'])){return _0x250bb8(_0x462312[_0x8bca('0x14')](0x1f4,'from\x20is\x20mandatory'));}if(_[_0x8bca('0x2f')](_0x1eabe2[_0x8bca('0x27')][_0x8bca('0x27')])||_0x1eabe2[_0x8bca('0x27')][_0x8bca('0x27')]===''){return _0x250bb8(_0x462312[_0x8bca('0x14')](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x8bca('0x2f')](_0x1eabe2[_0x8bca('0x27')]['mapKey'])){return _0x250bb8(_0x462312[_0x8bca('0x14')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x508d16));}if(!_['includes'](_0x508d16,_0x1eabe2['body']['mapKey'])){return _0x250bb8(_0x462312[_0x8bca('0x14')](0x1f4,_0x8bca('0x30')+_0x508d16));}var _0x2608f3={};_0x2608f3[_0x1eabe2[_0x8bca('0x27')]['mapKey']]=_0x1eabe2[_0x8bca('0x27')][_0x8bca('0x31')];return db[_0x8bca('0x18')][_0x8bca('0x23')]({'where':{'id':_0x1eabe2['account']['id']},'include':[{'model':db[_0x8bca('0x32')],'as':_0x8bca('0x33'),'include':[{'model':db[_0x8bca('0x2a')],'as':_0x8bca('0x34'),'where':_0x2608f3,'limit':0x1,'order':[[_0x8bca('0x2c'),_0x8bca('0x35')]]}]},{'model':db[_0x8bca('0x36')],'as':_0x8bca('0x37')},{'model':db['MailServerOut'],'as':_0x8bca('0x38')}]})[_0x8bca('0x21')](function(_0x504e67){if(_0x504e67&&_0x504e67['List']){var _0x2730b0=_0x504e67[_0x8bca('0x39')]({'plain':!![]});_0x255204[_0x8bca('0x3a')]=_['omit'](_0x2730b0,[_0x8bca('0x37'),_0x8bca('0x33')]);_0x255204['applications']=_0x2730b0[_0x8bca('0x37')];_0x255204[_0x8bca('0x3b')]=_0x2730b0[_0x8bca('0x33')];_0x255204[_0x8bca('0x3c')]=_['orderBy'](_0x255204[_0x8bca('0x3c')],[_0x8bca('0x3d')],['asc']);if(_0x255204[_0x8bca('0x3a')]&&_0x255204[_0x8bca('0x3a')][_0x8bca('0x3e')]){_0x255204['applications']['push']({'id':0x0,'priority':_0x255204['applications'][_0x8bca('0x3f')]+0x1,'app':'close','appdata':_0x8bca('0x3e'),'interval':_0x8bca('0x40')});}if(_0x255204['account'][_0x8bca('0x37')]){delete _0x255204[_0x8bca('0x3a')]['Applications'];}if(_0x255204[_0x8bca('0x3a')][_0x8bca('0x33')]){delete _0x255204['account']['List'];}if(_0x2730b0['List'][_0x8bca('0x34')][_0x8bca('0x3f')]){return _0x2730b0[_0x8bca('0x33')][_0x8bca('0x34')][0x0];}var _0x5c14dd=_[_0x8bca('0x41')](_0x1eabe2[_0x8bca('0x27')],{'firstName':_0x1eabe2[_0x8bca('0x27')][_0x8bca('0x31')],'ListId':_0x2730b0[_0x8bca('0x2e')]});_0x5c14dd[_0x1eabe2[_0x8bca('0x27')][_0x8bca('0x42')]]=_0x1eabe2[_0x8bca('0x27')][_0x8bca('0x31')];return db[_0x8bca('0x2a')][_0x8bca('0x43')](_0x5c14dd);}else{throw new Error(_0x8bca('0x44'));}})[_0x8bca('0x21')](function(_0x2a7ac2){_0x255204[_0x8bca('0x45')]=_0x2a7ac2;if(_0x2a7ac2){if(!_0x1eabe2['body'][_0x8bca('0x15')][_0x8bca('0x46')]){_0x1eabe2['body'][_0x8bca('0x15')][_0x8bca('0x46')]=rs[_0x8bca('0x47')]()+'\x20'+_0x1eabe2[_0x8bca('0x27')][_0x8bca('0x15')][_0x8bca('0x31')];}var _0x443873={'ContactId':_0x2a7ac2['id'],'MailAccountId':_0x1eabe2[_0x8bca('0x3a')]['id'],'inReplyTo':_0x1eabe2[_0x8bca('0x27')][_0x8bca('0x15')][_0x8bca('0x46')],'to':_0x1eabe2['body'][_0x8bca('0x15')][_0x8bca('0x31')],'cc':_0x1eabe2[_0x8bca('0x27')][_0x8bca('0x15')]['cc'],'subject':_0x1eabe2['body'][_0x8bca('0x15')][_0x8bca('0x48')],'attach':_0x1eabe2[_0x8bca('0x27')][_0x8bca('0x15')]['attach'],'lastMsgAt':moment()[_0x8bca('0x49')](_0x8bca('0x4a')),'lastMsgDirection':'in','lastMsgBody':_0x1eabe2[_0x8bca('0x27')][_0x8bca('0x27')]};return db[_0x8bca('0x4b')][_0x8bca('0x23')]({'where':{'closed':![],'MailAccountId':_0x1eabe2[_0x8bca('0x3a')]['id']},'include':[{'model':db[_0x8bca('0x4c')],'as':'Messages','attributes':['messageId'],'where':{'messageId':_0x1eabe2[_0x8bca('0x27')][_0x8bca('0x15')][_0x8bca('0x4d')]}}]})[_0x8bca('0x21')](function(_0x194586){if(_0x194586){return[_0x194586,![]];}return db[_0x8bca('0x4b')]['create'](_0x443873)[_0x8bca('0x21')](function(_0x53e01e){return[_0x53e01e,!![]];});});}else{throw new Error(_0x8bca('0x4e'));}})['spread'](function(_0x58beb3,_0x5cb0a6){if(_0x58beb3){_0x476521=_0x5cb0a6;if(!_0x5cb0a6){return _0x58beb3[_0x8bca('0x4f')]({'inReplyTo':_0x1eabe2[_0x8bca('0x27')][_0x8bca('0x15')][_0x8bca('0x46')],'to':_0x1eabe2[_0x8bca('0x27')]['message'][_0x8bca('0x31')],'cc':_0x1eabe2[_0x8bca('0x27')][_0x8bca('0x15')]['cc'],'subject':_0x1eabe2[_0x8bca('0x27')][_0x8bca('0x15')][_0x8bca('0x48')],'attach':_0x58beb3['attach']?_0x58beb3['attach']:_0x1eabe2[_0x8bca('0x27')][_0x8bca('0x15')]['attach'],'substatus':null,'substatusAt':moment()[_0x8bca('0x49')](_0x8bca('0x4a')),'lastMsgAt':moment()[_0x8bca('0x49')](_0x8bca('0x4a')),'lastMsgDirection':'in','lastMsgBody':_0x1eabe2[_0x8bca('0x27')][_0x8bca('0x27')]});}else{return _0x58beb3;}}})[_0x8bca('0x21')](function(_0x3e8058){_0x255204[_0x8bca('0x50')]=_0x3e8058[_0x8bca('0x39')]({'plain':!![]});_0x255204['interaction']['created']=_0x476521;return db[_0x8bca('0x4c')][_0x8bca('0x43')]({'body':_0x1eabe2[_0x8bca('0x27')][_0x8bca('0x27')],'MailAccountId':_0x1eabe2[_0x8bca('0x3a')]['id'],'MailInteractionId':_0x3e8058['id'],'direction':'in','ContactId':_0x255204[_0x8bca('0x45')]['id'],'messageId':_0x1eabe2[_0x8bca('0x27')]['message'][_0x8bca('0x46')],'from':_0x1eabe2[_0x8bca('0x27')]['message'][_0x8bca('0x31')],'to':_0x1eabe2[_0x8bca('0x27')][_0x8bca('0x15')]['to'],'cc':_0x1eabe2[_0x8bca('0x27')]['message']['cc'],'subject':_0x1eabe2[_0x8bca('0x27')][_0x8bca('0x15')][_0x8bca('0x48')],'attach':_0x1eabe2[_0x8bca('0x27')][_0x8bca('0x15')][_0x8bca('0x51')],'Attachments':_0x1eabe2[_0x8bca('0x27')]['message']['attachments'],'originTo':_0x1eabe2[_0x8bca('0x27')][_0x8bca('0x15')][_0x8bca('0x52')],'originCc':_0x1eabe2[_0x8bca('0x27')][_0x8bca('0x15')][_0x8bca('0x53')],'bcc':_0x1eabe2[_0x8bca('0x27')]['message'][_0x8bca('0x54')]},{'include':[{'model':db[_0x8bca('0x55')],'as':_0x8bca('0x56')}]});})[_0x8bca('0x21')](function(_0x16ae05){_0x255204[_0x8bca('0x15')]=_0x16ae05;if(_0x255204['interaction'][_0x8bca('0x57')]){return db[_0x8bca('0x58')][_0x8bca('0x23')]({'attributes':['id','name'],'where':{'id':_0x255204[_0x8bca('0x50')][_0x8bca('0x57')]}})['then'](function(_0x2d3456){if(_0x2d3456){_0x255204[_0x8bca('0x3c')][_0x8bca('0x59')]({'id':0x0,'priority':0x0,'app':_0x8bca('0x5a'),'appdata':_0x2d3456[_0x8bca('0x5b')]+','+(_0x255204['account'][_0x8bca('0x5c')]||0xa),'interval':_0x8bca('0x40')});}return respondWithRpcPromise(_0x8bca('0x5d'),_0x8bca('0x5e'),_0x255204);});}return respondWithRpcPromise(_0x8bca('0x5d'),_0x8bca('0x5e'),_0x255204);})['then'](function(_0x20d890){_0x8873d1(_0x20d890);})[_0x8bca('0x17')](function(_0x35dcad){_0x250bb8(_0x462312[_0x8bca('0x14')](0x1f4,_0x35dcad[_0x8bca('0x15')]));});});}; \ No newline at end of file +var _0xeebe=['Contacts','DESC','MailApplication','MailServerOut','Smtp','omit','Applications','applications','list','orderBy','priority','asc','autoclose','push','length','close','*,*,*,*','ListId','CmContact','create','List\x20not\x20found','messageId','generate','subject','format','YYYY-MM-DD\x20HH:mm:ss','Messages','inReplyTo','MailInteraction','Contact\x20not\x20found','spread','update','attach','get','interaction','created','MailMessage','contact','attachments','originTo','originCc','UserId','User','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','then','info','request\x20sent','stringify','error','code','MailAccount,\x20%s,\x20%s','message','result','catch','GetMailAccount','options','raw','attributes','limit','include','model','map','debug','ShowMailAccount','MailAccount','find','where','mail','rawAttributes','createdAt','updatedAt','CompanyId','body','isNil','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','account','List'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xeebe,0xff));var _0xeeeb=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0xeebe[_0x2ec461];return _0x28603d;};'use strict';var _=require(_0xeeeb('0x0'));var util=require('util');var moment=require(_0xeeeb('0x1'));var BPromise=require('bluebird');var rs=require(_0xeeeb('0x2'));var fs=require('fs');var Redis=require(_0xeeeb('0x3'));var db=require(_0xeeeb('0x4'))['db'];var utils=require(_0xeeeb('0x5'));var logger=require(_0xeeeb('0x6'))(_0xeeeb('0x7'));var config=require(_0xeeeb('0x8'));var jayson=require(_0xeeeb('0x9'));var client=jayson[_0xeeeb('0xa')][_0xeeeb('0xb')]({'port':0x232c});config[_0xeeeb('0xc')]=_[_0xeeeb('0xd')](config[_0xeeeb('0xc')],{'host':_0xeeeb('0xe'),'port':0x18eb});var socket=require(_0xeeeb('0xf'))(new Redis(config[_0xeeeb('0xc')]));require(_0xeeeb('0x10'))[_0xeeeb('0x11')](socket);function respondWithRpcPromise(_0x4a1161,_0x4f4bb7,_0x2564e0){return new BPromise(function(_0x3f98db,_0x29ea4c){return client['request'](_0x4a1161,_0x2564e0)[_0xeeeb('0x12')](function(_0x34b67b){logger[_0xeeeb('0x13')]('MailAccount,\x20%s,\x20%s',_0x4f4bb7,_0xeeeb('0x14'));logger['debug']('MailAccount,\x20%s,\x20%s,\x20%s',_0x4f4bb7,_0xeeeb('0x14'),JSON[_0xeeeb('0x15')](_0x34b67b));if(_0x34b67b[_0xeeeb('0x16')]){if(_0x34b67b[_0xeeeb('0x16')][_0xeeeb('0x17')]===0x1f4){logger[_0xeeeb('0x16')](_0xeeeb('0x18'),_0x4f4bb7,_0x34b67b[_0xeeeb('0x16')][_0xeeeb('0x19')]);return _0x29ea4c(_0x34b67b[_0xeeeb('0x16')][_0xeeeb('0x19')]);}logger[_0xeeeb('0x16')](_0xeeeb('0x18'),_0x4f4bb7,_0x34b67b[_0xeeeb('0x16')][_0xeeeb('0x19')]);return _0x3f98db(_0x34b67b[_0xeeeb('0x16')][_0xeeeb('0x19')]);}else{logger[_0xeeeb('0x13')](_0xeeeb('0x18'),_0x4f4bb7,_0xeeeb('0x14'));_0x3f98db(_0x34b67b[_0xeeeb('0x1a')][_0xeeeb('0x19')]);}})[_0xeeeb('0x1b')](function(_0x313862){logger[_0xeeeb('0x16')](_0xeeeb('0x18'),_0x4f4bb7,_0x313862);_0x29ea4c(_0x313862);});});}exports[_0xeeeb('0x1c')]=function(_0x50a1a5){var _0x282d61=this;return new Promise(function(_0x496311,_0x5ec06e){return db['MailAccount']['findAll']({'raw':_0x50a1a5[_0xeeeb('0x1d')]?_0x50a1a5[_0xeeeb('0x1d')][_0xeeeb('0x1e')]===undefined?!![]:![]:!![],'where':_0x50a1a5[_0xeeeb('0x1d')]?_0x50a1a5[_0xeeeb('0x1d')]['where']||null:null,'attributes':_0x50a1a5['options']?_0x50a1a5[_0xeeeb('0x1d')][_0xeeeb('0x1f')]||null:null,'limit':_0x50a1a5[_0xeeeb('0x1d')]?_0x50a1a5[_0xeeeb('0x1d')][_0xeeeb('0x20')]||null:null,'include':_0x50a1a5['options']?_0x50a1a5[_0xeeeb('0x1d')][_0xeeeb('0x21')]?_['map'](_0x50a1a5['options'][_0xeeeb('0x21')],function(_0x3df022){return{'model':db[_0x3df022[_0xeeeb('0x22')]],'as':_0x3df022['as'],'attributes':_0x3df022[_0xeeeb('0x1f')],'include':_0x3df022[_0xeeeb('0x21')]?_[_0xeeeb('0x23')](_0x3df022[_0xeeeb('0x21')],function(_0x2f5854){return{'model':db[_0x2f5854[_0xeeeb('0x22')]],'as':_0x2f5854['as'],'attributes':_0x2f5854[_0xeeeb('0x1f')],'include':_0x2f5854[_0xeeeb('0x21')]?_['map'](_0x2f5854['include'],function(_0x881744){return{'model':db[_0x881744[_0xeeeb('0x22')]],'as':_0x881744['as'],'attributes':_0x881744[_0xeeeb('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1d7c1e){logger[_0xeeeb('0x13')]('GetMailAccount',_0x50a1a5);logger[_0xeeeb('0x24')](_0xeeeb('0x1c'),_0x50a1a5,JSON[_0xeeeb('0x15')](_0x1d7c1e));_0x496311(_0x1d7c1e);})[_0xeeeb('0x1b')](function(_0x725b79){logger[_0xeeeb('0x16')]('GetMailAccount',_0x725b79[_0xeeeb('0x19')],_0x50a1a5);_0x5ec06e(_0x282d61['error'](0x1f4,_0x725b79[_0xeeeb('0x19')]));});});};exports[_0xeeeb('0x25')]=function(_0x2e0072){var _0x276313=this;return new Promise(function(_0x5d08d0,_0x5f0456){return db[_0xeeeb('0x26')][_0xeeeb('0x27')]({'raw':_0x2e0072[_0xeeeb('0x1d')]?_0x2e0072[_0xeeeb('0x1d')][_0xeeeb('0x1e')]===undefined?!![]:![]:!![],'where':_0x2e0072[_0xeeeb('0x1d')]?_0x2e0072['options'][_0xeeeb('0x28')]||null:null,'attributes':_0x2e0072['options']?_0x2e0072[_0xeeeb('0x1d')][_0xeeeb('0x1f')]||null:null,'include':_0x2e0072[_0xeeeb('0x1d')]?_0x2e0072[_0xeeeb('0x1d')]['include']?_['map'](_0x2e0072[_0xeeeb('0x1d')][_0xeeeb('0x21')],function(_0x2bb03c){return{'model':db[_0x2bb03c[_0xeeeb('0x22')]],'as':_0x2bb03c['as'],'attributes':_0x2bb03c[_0xeeeb('0x1f')],'include':_0x2bb03c[_0xeeeb('0x21')]?_[_0xeeeb('0x23')](_0x2bb03c[_0xeeeb('0x21')],function(_0x4c674e){return{'model':db[_0x4c674e[_0xeeeb('0x22')]],'as':_0x4c674e['as'],'attributes':_0x4c674e[_0xeeeb('0x1f')],'include':_0x4c674e[_0xeeeb('0x21')]?_['map'](_0x4c674e['include'],function(_0x3dd54a){return{'model':db[_0x3dd54a['model']],'as':_0x3dd54a['as'],'attributes':_0x3dd54a[_0xeeeb('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x370ee9){logger['info']('ShowMailAccount',_0x2e0072);logger[_0xeeeb('0x24')]('ShowMailAccount',_0x2e0072,JSON[_0xeeeb('0x15')](_0x370ee9));_0x5d08d0(_0x370ee9);})['catch'](function(_0x373daf){logger[_0xeeeb('0x16')](_0xeeeb('0x25'),_0x373daf['message'],_0x2e0072);_0x5f0456(_0x276313[_0xeeeb('0x16')](0x1f4,_0x373daf[_0xeeeb('0x19')]));});});};exports['NotifyMailAccount']=function(_0x2cb1de){var _0x1735e4=this;return new Promise(function(_0xfe4a35,_0x2ccaa3){var _0x22ddf6={'body':_0x2cb1de['body'],'channel':_0xeeeb('0x29')};var _0x4df294=_['difference'](_['keys'](db['CmContact'][_0xeeeb('0x2a')]),[_0xeeeb('0x2b'),_0xeeeb('0x2c'),_0xeeeb('0x2d'),'ListId']);var _0x1f2b76=![];if(_0x2cb1de[_0xeeeb('0x2e')]['id']){delete _0x2cb1de[_0xeeeb('0x2e')]['id'];}if(_[_0xeeeb('0x2f')](_0x2cb1de['body']['from'])){return _0x2ccaa3(_0x1735e4['error'](0x1f4,'from\x20is\x20mandatory'));}if(_[_0xeeeb('0x2f')](_0x2cb1de[_0xeeeb('0x2e')][_0xeeeb('0x2e')])||_0x2cb1de[_0xeeeb('0x2e')][_0xeeeb('0x2e')]===''){return _0x2ccaa3(_0x1735e4[_0xeeeb('0x16')](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0xeeeb('0x2f')](_0x2cb1de[_0xeeeb('0x2e')][_0xeeeb('0x30')])){return _0x2ccaa3(_0x1735e4[_0xeeeb('0x16')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4df294));}if(!_[_0xeeeb('0x31')](_0x4df294,_0x2cb1de[_0xeeeb('0x2e')][_0xeeeb('0x30')])){return _0x2ccaa3(_0x1735e4['error'](0x1f4,_0xeeeb('0x32')+_0x4df294));}var _0x43007a={};_0x43007a[_0x2cb1de['body'][_0xeeeb('0x30')]]=_0x2cb1de[_0xeeeb('0x2e')][_0xeeeb('0x33')];return db[_0xeeeb('0x26')][_0xeeeb('0x27')]({'where':{'id':_0x2cb1de[_0xeeeb('0x34')]['id']},'include':[{'model':db['CmList'],'as':_0xeeeb('0x35'),'include':[{'model':db['CmContact'],'as':_0xeeeb('0x36'),'where':_0x43007a,'limit':0x1,'order':[[_0xeeeb('0x2c'),_0xeeeb('0x37')]]}]},{'model':db[_0xeeeb('0x38')],'as':'Applications'},{'model':db[_0xeeeb('0x39')],'as':_0xeeeb('0x3a')}]})[_0xeeeb('0x12')](function(_0x29fd1d){if(_0x29fd1d&&_0x29fd1d[_0xeeeb('0x35')]){var _0x2d365f=_0x29fd1d['get']({'plain':!![]});_0x22ddf6[_0xeeeb('0x34')]=_[_0xeeeb('0x3b')](_0x2d365f,[_0xeeeb('0x3c'),_0xeeeb('0x35')]);_0x22ddf6[_0xeeeb('0x3d')]=_0x2d365f[_0xeeeb('0x3c')];_0x22ddf6[_0xeeeb('0x3e')]=_0x2d365f['List'];_0x22ddf6[_0xeeeb('0x3d')]=_[_0xeeeb('0x3f')](_0x22ddf6['applications'],[_0xeeeb('0x40')],[_0xeeeb('0x41')]);if(_0x22ddf6[_0xeeeb('0x34')]&&_0x22ddf6[_0xeeeb('0x34')][_0xeeeb('0x42')]){_0x22ddf6[_0xeeeb('0x3d')][_0xeeeb('0x43')]({'id':0x0,'priority':_0x22ddf6[_0xeeeb('0x3d')][_0xeeeb('0x44')]+0x1,'app':_0xeeeb('0x45'),'appdata':'autoclose','interval':_0xeeeb('0x46')});}if(_0x22ddf6[_0xeeeb('0x34')][_0xeeeb('0x3c')]){delete _0x22ddf6['account']['Applications'];}if(_0x22ddf6[_0xeeeb('0x34')]['List']){delete _0x22ddf6['account'][_0xeeeb('0x35')];}if(_0x2d365f[_0xeeeb('0x35')][_0xeeeb('0x36')]['length']){return _0x2d365f[_0xeeeb('0x35')][_0xeeeb('0x36')][0x0];}var _0x1e1230=_[_0xeeeb('0xd')](_0x2cb1de[_0xeeeb('0x2e')],{'firstName':_0x2cb1de[_0xeeeb('0x2e')]['from'],'ListId':_0x2d365f[_0xeeeb('0x47')]});_0x1e1230[_0x2cb1de['body'][_0xeeeb('0x30')]]=_0x2cb1de[_0xeeeb('0x2e')][_0xeeeb('0x33')];return db[_0xeeeb('0x48')][_0xeeeb('0x49')](_0x1e1230);}else{throw new Error(_0xeeeb('0x4a'));}})['then'](function(_0x4ec59e){_0x22ddf6['contact']=_0x4ec59e;if(_0x4ec59e){if(!_0x2cb1de['body'][_0xeeeb('0x19')][_0xeeeb('0x4b')]){_0x2cb1de[_0xeeeb('0x2e')][_0xeeeb('0x19')][_0xeeeb('0x4b')]=rs[_0xeeeb('0x4c')]()+'\x20'+_0x2cb1de[_0xeeeb('0x2e')][_0xeeeb('0x19')]['from'];}var _0x587570={'ContactId':_0x4ec59e['id'],'MailAccountId':_0x2cb1de['account']['id'],'inReplyTo':_0x2cb1de[_0xeeeb('0x2e')][_0xeeeb('0x19')]['messageId'],'to':_0x2cb1de[_0xeeeb('0x2e')]['message'][_0xeeeb('0x33')],'cc':_0x2cb1de[_0xeeeb('0x2e')]['message']['cc'],'subject':_0x2cb1de['body'][_0xeeeb('0x19')][_0xeeeb('0x4d')],'attach':_0x2cb1de[_0xeeeb('0x2e')][_0xeeeb('0x19')]['attach'],'lastMsgAt':moment()[_0xeeeb('0x4e')](_0xeeeb('0x4f')),'lastMsgDirection':'in','lastMsgBody':_0x2cb1de[_0xeeeb('0x2e')][_0xeeeb('0x2e')]};return db['MailInteraction'][_0xeeeb('0x27')]({'where':{'closed':![],'MailAccountId':_0x2cb1de[_0xeeeb('0x34')]['id']},'include':[{'model':db['MailMessage'],'as':_0xeeeb('0x50'),'attributes':[_0xeeeb('0x4b')],'where':{'messageId':_0x2cb1de[_0xeeeb('0x2e')][_0xeeeb('0x19')][_0xeeeb('0x51')]}}]})[_0xeeeb('0x12')](function(_0x4e762c){if(_0x4e762c){return[_0x4e762c,![]];}return db[_0xeeeb('0x52')][_0xeeeb('0x49')](_0x587570)['then'](function(_0xc679ac){return[_0xc679ac,!![]];});});}else{throw new Error(_0xeeeb('0x53'));}})[_0xeeeb('0x54')](function(_0x1267b9,_0x1672a7){if(_0x1267b9){_0x1f2b76=_0x1672a7;if(!_0x1672a7){return _0x1267b9[_0xeeeb('0x55')]({'inReplyTo':_0x2cb1de[_0xeeeb('0x2e')][_0xeeeb('0x19')][_0xeeeb('0x4b')],'to':_0x2cb1de[_0xeeeb('0x2e')]['message'][_0xeeeb('0x33')],'cc':_0x2cb1de['body'][_0xeeeb('0x19')]['cc'],'subject':_0x2cb1de[_0xeeeb('0x2e')]['message']['subject'],'attach':_0x1267b9[_0xeeeb('0x56')]?_0x1267b9['attach']:_0x2cb1de[_0xeeeb('0x2e')][_0xeeeb('0x19')]['attach'],'substatus':null,'substatusAt':moment()[_0xeeeb('0x4e')](_0xeeeb('0x4f')),'lastMsgAt':moment()[_0xeeeb('0x4e')](_0xeeeb('0x4f')),'lastMsgDirection':'in','lastMsgBody':_0x2cb1de[_0xeeeb('0x2e')][_0xeeeb('0x2e')]});}else{return _0x1267b9;}}})[_0xeeeb('0x12')](function(_0x3a5557){_0x22ddf6['interaction']=_0x3a5557[_0xeeeb('0x57')]({'plain':!![]});_0x22ddf6[_0xeeeb('0x58')][_0xeeeb('0x59')]=_0x1f2b76;return db[_0xeeeb('0x5a')][_0xeeeb('0x49')]({'body':_0x2cb1de[_0xeeeb('0x2e')]['body'],'MailAccountId':_0x2cb1de[_0xeeeb('0x34')]['id'],'MailInteractionId':_0x3a5557['id'],'direction':'in','ContactId':_0x22ddf6[_0xeeeb('0x5b')]['id'],'messageId':_0x2cb1de[_0xeeeb('0x2e')][_0xeeeb('0x19')][_0xeeeb('0x4b')],'from':_0x2cb1de[_0xeeeb('0x2e')][_0xeeeb('0x19')]['from'],'to':_0x2cb1de['body'][_0xeeeb('0x19')]['to'],'cc':_0x2cb1de['body'][_0xeeeb('0x19')]['cc'],'subject':_0x2cb1de[_0xeeeb('0x2e')][_0xeeeb('0x19')]['subject'],'attach':_0x2cb1de[_0xeeeb('0x2e')][_0xeeeb('0x19')]['attach'],'Attachments':_0x2cb1de[_0xeeeb('0x2e')]['message'][_0xeeeb('0x5c')],'originTo':_0x2cb1de['body'][_0xeeeb('0x19')][_0xeeeb('0x5d')],'originCc':_0x2cb1de[_0xeeeb('0x2e')]['message'][_0xeeeb('0x5e')],'bcc':_0x2cb1de['body'][_0xeeeb('0x19')]['bcc']},{'include':[{'model':db['Attachment'],'as':'Attachments'}]});})[_0xeeeb('0x12')](function(_0x2d0cd5){_0x22ddf6[_0xeeeb('0x19')]=_0x2d0cd5;if(_0x22ddf6['interaction'][_0xeeeb('0x5f')]){return db[_0xeeeb('0x60')]['find']({'attributes':['id',_0xeeeb('0x61')],'where':{'id':_0x22ddf6[_0xeeeb('0x58')][_0xeeeb('0x5f')]}})[_0xeeeb('0x12')](function(_0x569b9a){if(_0x569b9a){_0x22ddf6['applications'][_0xeeeb('0x62')]({'id':0x0,'priority':0x0,'app':_0xeeeb('0x63'),'appdata':_0x569b9a[_0xeeeb('0x61')]+','+(_0x22ddf6['account'][_0xeeeb('0x64')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xeeeb('0x65'),'startRouting',_0x22ddf6);});}return respondWithRpcPromise(_0xeeeb('0x65'),_0xeeeb('0x66'),_0x22ddf6);})[_0xeeeb('0x12')](function(_0x237c9e){_0xfe4a35(_0x237c9e);})[_0xeeeb('0x1b')](function(_0x1be024){_0x2ccaa3(_0x1735e4['error'](0x1f4,_0x1be024[_0xeeeb('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 33305bf..a779083 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 _0xa1f6=['save','remove','update','register','length','./mailAccount.events'];(function(_0xd723,_0x164010){var _0x5179d2=function(_0x43b1cb){while(--_0x43b1cb){_0xd723['push'](_0xd723['shift']());}};_0x5179d2(++_0x164010);}(_0xa1f6,0x19d));var _0x6a1f=function(_0x58ee19,_0xdf0765){_0x58ee19=_0x58ee19-0x0;var _0x49af25=_0xa1f6[_0x58ee19];return _0x49af25;};'use strict';var MailAccountEvents=require(_0x6a1f('0x0'));var events=[_0x6a1f('0x1'),_0x6a1f('0x2'),_0x6a1f('0x3')];function createListener(_0x198e14,_0x123ad4){return function(_0x5cf561){_0x123ad4['emit'](_0x198e14,_0x5cf561);};}function removeListener(_0x521944,_0x5d4ad7){return function(){MailAccountEvents['removeListener'](_0x521944,_0x5d4ad7);};}exports[_0x6a1f('0x4')]=function(_0x426ae1){for(var _0xa1c928=0x0,_0x3a772b=events[_0x6a1f('0x5')];_0xa1c928<_0x3a772b;_0xa1c928++){var _0x3ecd63=events[_0xa1c928];var _0x36c00b=createListener('mailAccount:'+_0x3ecd63,_0x426ae1);MailAccountEvents['on'](_0x3ecd63,_0x36c00b);}}; \ No newline at end of file +var _0xd6bb=['update','removeListener','length','mailAccount:','./mailAccount.events','remove'];(function(_0x43a37c,_0x25a567){var _0x5d1d40=function(_0x3ec673){while(--_0x3ec673){_0x43a37c['push'](_0x43a37c['shift']());}};_0x5d1d40(++_0x25a567);}(_0xd6bb,0x1cc));var _0xbd6b=function(_0x61b3ab,_0x1fc298){_0x61b3ab=_0x61b3ab-0x0;var _0x57097f=_0xd6bb[_0x61b3ab];return _0x57097f;};'use strict';var MailAccountEvents=require(_0xbd6b('0x0'));var events=['save',_0xbd6b('0x1'),_0xbd6b('0x2')];function createListener(_0x3c0eb7,_0x29f456){return function(_0x426b33){_0x29f456['emit'](_0x3c0eb7,_0x426b33);};}function removeListener(_0x43b80d,_0x1785c7){return function(){MailAccountEvents[_0xbd6b('0x3')](_0x43b80d,_0x1785c7);};}exports['register']=function(_0x256a94){for(var _0x15d0eb=0x0,_0xc309ad=events[_0xbd6b('0x4')];_0x15d0eb<_0xc309ad;_0x15d0eb++){var _0x31cae6=events[_0x15d0eb];var _0x315761=createListener(_0xbd6b('0x5')+_0x31cae6,_0x256a94);MailAccountEvents['on'](_0x31cae6,_0x315761);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 8441a4e..3982df5 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 _0x2f68=['util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./mailApplication.controller','/:id','isAuthenticated','delete','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2f68,0x9a));var _0x82f6=function(_0x1172e7,_0x2a18c8){_0x1172e7=_0x1172e7-0x0;var _0x22e45e=_0x2f68[_0x1172e7];return _0x22e45e;};'use strict';var multer=require('multer');var util=require(_0x82f6('0x0'));var path=require(_0x82f6('0x1'));var timeout=require(_0x82f6('0x2'));var express=require(_0x82f6('0x3'));var router=express['Router']();var auth=require(_0x82f6('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x82f6('0x5'));var controller=require(_0x82f6('0x6'));router['get'](_0x82f6('0x7'),auth[_0x82f6('0x8')](),controller['show']);router['put'](_0x82f6('0x7'),auth['isAuthenticated'](),controller['update']);router[_0x82f6('0x9')](_0x82f6('0x7'),auth[_0x82f6('0x8')](),controller['destroy']);module[_0x82f6('0xa')]=router; \ No newline at end of file +var _0x5ff3=['show','put','delete','exports','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated'];(function(_0x42c403,_0x4fc2d5){var _0x3fa1c6=function(_0x3d0258){while(--_0x3d0258){_0x42c403['push'](_0x42c403['shift']());}};_0x3fa1c6(++_0x4fc2d5);}(_0x5ff3,0x17d));var _0x35ff=function(_0x32583f,_0x28ddb7){_0x32583f=_0x32583f-0x0;var _0x46d9d4=_0x5ff3[_0x32583f];return _0x46d9d4;};'use strict';var multer=require('multer');var util=require(_0x35ff('0x0'));var path=require('path');var timeout=require(_0x35ff('0x1'));var express=require('express');var router=express[_0x35ff('0x2')]();var auth=require(_0x35ff('0x3'));var interaction=require(_0x35ff('0x4'));var config=require(_0x35ff('0x5'));var controller=require('./mailApplication.controller');router[_0x35ff('0x6')](_0x35ff('0x7'),auth[_0x35ff('0x8')](),controller[_0x35ff('0x9')]);router[_0x35ff('0xa')]('/:id',auth[_0x35ff('0x8')](),controller['update']);router[_0x35ff('0xb')](_0x35ff('0x7'),auth[_0x35ff('0x8')](),controller['destroy']);module[_0x35ff('0xc')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 68cd54d..300e7cb 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 _0xfc47=['STRING','TEXT','*,*,*,*','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfc47,0x177));var _0x7fc4=function(_0x206ca8,_0x34739a){_0x206ca8=_0x206ca8-0x0;var _0x508d10=_0xfc47[_0x206ca8];return _0x508d10;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x7fc4('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0x7fc4('0x1')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x7fc4('0x2')]()},'description':{'type':Sequelize[_0x7fc4('0x1')]},'interval':{'type':Sequelize[_0x7fc4('0x1')],'defaultValue':_0x7fc4('0x3')}}; \ No newline at end of file +var _0x8807=['noop','TEXT','exports','INTEGER','STRING'];(function(_0x5d9ea4,_0x57b4f2){var _0xbac026=function(_0x34f6e9){while(--_0x34f6e9){_0x5d9ea4['push'](_0x5d9ea4['shift']());}};_0xbac026(++_0x57b4f2);}(_0x8807,0xac));var _0x7880=function(_0x4e0c67,_0x5bc8e3){_0x4e0c67=_0x4e0c67-0x0;var _0x3455e5=_0x8807[_0x4e0c67];return _0x3455e5;};'use strict';var Sequelize=require('sequelize');module[_0x7880('0x0')]={'priority':{'type':Sequelize[_0x7880('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x7880('0x2')],'allowNull':![],'defaultValue':_0x7880('0x3')},'appdata':{'type':Sequelize[_0x7880('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x7880('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 110885c..9e2d75a 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 _0x35ed=['end','error','stack','name','send','show','keys','MailApplication','filters','intersection','model','attributes','fields','query','length','includeAll','include','merge','find','catch','body','destroy','params','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','apply','reject','save','then'];(function(_0x441679,_0x52a4da){var _0x5de55a=function(_0x5b5d60){while(--_0x5b5d60){_0x441679['push'](_0x441679['shift']());}};_0x5de55a(++_0x52a4da);}(_0x35ed,0x173));var _0xd35e=function(_0x18c406,_0x5e1fdc){_0x18c406=_0x18c406-0x0;var _0x4ce70f=_0x35ed[_0x18c406];return _0x4ce70f;};'use strict';var pdf=require(_0xd35e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xd35e('0x1'));var zipdir=require(_0xd35e('0x2'));var jsonpatch=require(_0xd35e('0x3'));var rp=require(_0xd35e('0x4'));var moment=require(_0xd35e('0x5'));var BPromise=require(_0xd35e('0x6'));var Mustache=require(_0xd35e('0x7'));var util=require('util');var path=require(_0xd35e('0x8'));var sox=require('sox');var csv=require(_0xd35e('0x9'));var ejs=require(_0xd35e('0xa'));var fs=require('fs');var _=require(_0xd35e('0xb'));var squel=require(_0xd35e('0xc'));var crypto=require('crypto');var jsforce=require(_0xd35e('0xd'));var deskjs=require(_0xd35e('0xe'));var toCsv=require(_0xd35e('0x9'));var querystring=require(_0xd35e('0xf'));var Papa=require('papaparse');var Redis=require(_0xd35e('0x10'));var authService=require(_0xd35e('0x11'));var qs=require(_0xd35e('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd35e('0x13'));var logger=require(_0xd35e('0x14'))('api');var utils=require(_0xd35e('0x15'));var config=require(_0xd35e('0x16'));var db=require(_0xd35e('0x17'))['db'];function respondWithStatusCode(_0x3143a1,_0x30425e){_0x30425e=_0x30425e||0xcc;return function(_0x469c34){if(_0x469c34){return _0x3143a1[_0xd35e('0x18')](_0x30425e);}return _0x3143a1[_0xd35e('0x19')](_0x30425e)['end']();};}function respondWithResult(_0x310b9c,_0x5c842a){_0x5c842a=_0x5c842a||0xc8;return function(_0x4c1046){if(_0x4c1046){return _0x310b9c['status'](_0x5c842a)[_0xd35e('0x1a')](_0x4c1046);}};}function respondWithFilteredResult(_0x4c8a90,_0x3d50e6){return function(_0x4fb303){if(_0x4fb303){var _0x43480d=_0x4fb303[_0xd35e('0x1b')],_0x54a0ed=_0x3d50e6[_0xd35e('0x1c')],_0x5ac519=_0x3d50e6['offset']+_0x3d50e6[_0xd35e('0x1d')],_0x346ce6;if(_0x5ac519>=_0x43480d){_0x5ac519=_0x43480d;_0x346ce6=0xc8;}else{_0x346ce6=0xce;}_0x4c8a90[_0xd35e('0x19')](_0x346ce6);return _0x4c8a90[_0xd35e('0x1e')]('Content-Range',_0x54a0ed+'-'+_0x5ac519+'/'+_0x43480d)[_0xd35e('0x1a')](_0x4fb303);}return null;};}function patchUpdates(_0x2e82df){return function(_0x513c96){try{jsonpatch[_0xd35e('0x1f')](_0x513c96,_0x2e82df,!![]);}catch(_0x58bead){return BPromise[_0xd35e('0x20')](_0x58bead);}return _0x513c96[_0xd35e('0x21')]();};}function saveUpdates(_0x1553c0,_0x1715a6){return function(_0x20107a){if(_0x20107a){return _0x20107a['update'](_0x1553c0)[_0xd35e('0x22')](function(_0x2905b){return _0x2905b;});}return null;};}function removeEntity(_0xe17e20,_0x411617){return function(_0x122a8d){if(_0x122a8d){return _0x122a8d['destroy']()[_0xd35e('0x22')](function(){_0xe17e20[_0xd35e('0x19')](0xcc)[_0xd35e('0x23')]();});}};}function handleEntityNotFound(_0x2d0813,_0x27f622){return function(_0x2a91e5){if(!_0x2a91e5){_0x2d0813[_0xd35e('0x18')](0x194);}return _0x2a91e5;};}function handleError(_0x7cd438,_0x54dc28){_0x54dc28=_0x54dc28||0x1f4;return function(_0x590c84){logger[_0xd35e('0x24')](_0x590c84[_0xd35e('0x25')]);if(_0x590c84[_0xd35e('0x26')]){delete _0x590c84[_0xd35e('0x26')];}_0x7cd438[_0xd35e('0x19')](_0x54dc28)[_0xd35e('0x27')](_0x590c84);};}exports[_0xd35e('0x28')]=function(_0x550524,_0x5aa973){var _0x202c4a={'raw':!![],'where':{'id':_0x550524['params']['id']}},_0x349a97={};_0x349a97['model']=_[_0xd35e('0x29')](db[_0xd35e('0x2a')]['rawAttributes']);_0x349a97['query']=_[_0xd35e('0x29')](_0x550524['query']);_0x349a97[_0xd35e('0x2b')]=_[_0xd35e('0x2c')](_0x349a97[_0xd35e('0x2d')],_0x349a97['query']);_0x202c4a[_0xd35e('0x2e')]=_[_0xd35e('0x2c')](_0x349a97[_0xd35e('0x2d')],qs[_0xd35e('0x2f')](_0x550524[_0xd35e('0x30')][_0xd35e('0x2f')]));_0x202c4a[_0xd35e('0x2e')]=_0x202c4a[_0xd35e('0x2e')][_0xd35e('0x31')]?_0x202c4a[_0xd35e('0x2e')]:_0x349a97[_0xd35e('0x2d')];if(_0x550524[_0xd35e('0x30')][_0xd35e('0x32')]){_0x202c4a[_0xd35e('0x33')]=[{'all':!![]}];}_0x202c4a=_[_0xd35e('0x34')]({},_0x202c4a,_0x550524['options']);return db[_0xd35e('0x2a')][_0xd35e('0x35')](_0x202c4a)[_0xd35e('0x22')](handleEntityNotFound(_0x5aa973,null))[_0xd35e('0x22')](respondWithResult(_0x5aa973,null))[_0xd35e('0x36')](handleError(_0x5aa973,null));};exports['update']=function(_0x2f4871,_0x11dfaf){if(_0x2f4871[_0xd35e('0x37')]['id']){delete _0x2f4871[_0xd35e('0x37')]['id'];}return db[_0xd35e('0x2a')]['find']({'where':{'id':_0x2f4871['params']['id']}})[_0xd35e('0x22')](handleEntityNotFound(_0x11dfaf,null))['then'](saveUpdates(_0x2f4871['body'],null))[_0xd35e('0x22')](respondWithResult(_0x11dfaf,null))[_0xd35e('0x36')](handleError(_0x11dfaf,null));};exports[_0xd35e('0x38')]=function(_0x17e4e4,_0x381298){return db[_0xd35e('0x2a')]['find']({'where':{'id':_0x17e4e4[_0xd35e('0x39')]['id']}})[_0xd35e('0x22')](handleEntityNotFound(_0x381298,null))[_0xd35e('0x22')](removeEntity(_0x381298,null))[_0xd35e('0x36')](handleError(_0x381298,null));}; \ No newline at end of file +var _0xa521=['count','offset','limit','set','Content-Range','json','reject','save','update','then','error','stack','name','send','model','keys','MailApplication','query','intersection','fields','attributes','includeAll','merge','options','catch','body','find','html-pdf','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa521,0xeb));var _0x1a52=function(_0x34d0d2,_0x156dec){_0x34d0d2=_0x34d0d2-0x0;var _0xe7b39c=_0xa521[_0x34d0d2];return _0xe7b39c;};'use strict';var pdf=require(_0x1a52('0x0'));var emlformat=require(_0x1a52('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1a52('0x2'));var rp=require(_0x1a52('0x3'));var moment=require('moment');var BPromise=require(_0x1a52('0x4'));var Mustache=require(_0x1a52('0x5'));var util=require(_0x1a52('0x6'));var path=require(_0x1a52('0x7'));var sox=require(_0x1a52('0x8'));var csv=require(_0x1a52('0x9'));var ejs=require(_0x1a52('0xa'));var fs=require('fs');var _=require(_0x1a52('0xb'));var squel=require(_0x1a52('0xc'));var crypto=require(_0x1a52('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1a52('0xe'));var Redis=require('ioredis');var authService=require(_0x1a52('0xf'));var qs=require(_0x1a52('0x10'));var as=require(_0x1a52('0x11'));var hardwareService=require(_0x1a52('0x12'));var logger=require('../../config/logger')(_0x1a52('0x13'));var utils=require('../../config/utils');var config=require(_0x1a52('0x14'));var db=require(_0x1a52('0x15'))['db'];function respondWithStatusCode(_0x328812,_0xbc8a53){_0xbc8a53=_0xbc8a53||0xcc;return function(_0x51d510){if(_0x51d510){return _0x328812[_0x1a52('0x16')](_0xbc8a53);}return _0x328812[_0x1a52('0x17')](_0xbc8a53)[_0x1a52('0x18')]();};}function respondWithResult(_0x3e67b6,_0x20e56e){_0x20e56e=_0x20e56e||0xc8;return function(_0x4fb67f){if(_0x4fb67f){return _0x3e67b6['status'](_0x20e56e)['json'](_0x4fb67f);}};}function respondWithFilteredResult(_0x5ed514,_0x1f7fca){return function(_0x438ac5){if(_0x438ac5){var _0x428a94=_0x438ac5[_0x1a52('0x19')],_0x280bb2=_0x1f7fca[_0x1a52('0x1a')],_0x50bbab=_0x1f7fca[_0x1a52('0x1a')]+_0x1f7fca[_0x1a52('0x1b')],_0x11be1a;if(_0x50bbab>=_0x428a94){_0x50bbab=_0x428a94;_0x11be1a=0xc8;}else{_0x11be1a=0xce;}_0x5ed514[_0x1a52('0x17')](_0x11be1a);return _0x5ed514[_0x1a52('0x1c')](_0x1a52('0x1d'),_0x280bb2+'-'+_0x50bbab+'/'+_0x428a94)[_0x1a52('0x1e')](_0x438ac5);}return null;};}function patchUpdates(_0x4392ff){return function(_0x2c0d0b){try{jsonpatch['apply'](_0x2c0d0b,_0x4392ff,!![]);}catch(_0x5201e4){return BPromise[_0x1a52('0x1f')](_0x5201e4);}return _0x2c0d0b[_0x1a52('0x20')]();};}function saveUpdates(_0x104e97,_0x59db0a){return function(_0x5b771e){if(_0x5b771e){return _0x5b771e[_0x1a52('0x21')](_0x104e97)[_0x1a52('0x22')](function(_0x227e95){return _0x227e95;});}return null;};}function removeEntity(_0x559d04,_0x5835f8){return function(_0x224b8d){if(_0x224b8d){return _0x224b8d['destroy']()[_0x1a52('0x22')](function(){_0x559d04[_0x1a52('0x17')](0xcc)[_0x1a52('0x18')]();});}};}function handleEntityNotFound(_0x20d574,_0xdffd26){return function(_0x250f43){if(!_0x250f43){_0x20d574[_0x1a52('0x16')](0x194);}return _0x250f43;};}function handleError(_0x563f59,_0x308866){_0x308866=_0x308866||0x1f4;return function(_0x4e845c){logger[_0x1a52('0x23')](_0x4e845c[_0x1a52('0x24')]);if(_0x4e845c[_0x1a52('0x25')]){delete _0x4e845c[_0x1a52('0x25')];}_0x563f59[_0x1a52('0x17')](_0x308866)[_0x1a52('0x26')](_0x4e845c);};}exports['show']=function(_0x1b98e5,_0x1fd2b5){var _0x46baf3={'raw':!![],'where':{'id':_0x1b98e5['params']['id']}},_0xdf1ef5={};_0xdf1ef5[_0x1a52('0x27')]=_[_0x1a52('0x28')](db[_0x1a52('0x29')]['rawAttributes']);_0xdf1ef5[_0x1a52('0x2a')]=_['keys'](_0x1b98e5['query']);_0xdf1ef5['filters']=_[_0x1a52('0x2b')](_0xdf1ef5[_0x1a52('0x27')],_0xdf1ef5['query']);_0x46baf3['attributes']=_[_0x1a52('0x2b')](_0xdf1ef5['model'],qs[_0x1a52('0x2c')](_0x1b98e5[_0x1a52('0x2a')][_0x1a52('0x2c')]));_0x46baf3[_0x1a52('0x2d')]=_0x46baf3[_0x1a52('0x2d')]['length']?_0x46baf3[_0x1a52('0x2d')]:_0xdf1ef5[_0x1a52('0x27')];if(_0x1b98e5[_0x1a52('0x2a')][_0x1a52('0x2e')]){_0x46baf3['include']=[{'all':!![]}];}_0x46baf3=_[_0x1a52('0x2f')]({},_0x46baf3,_0x1b98e5[_0x1a52('0x30')]);return db['MailApplication']['find'](_0x46baf3)[_0x1a52('0x22')](handleEntityNotFound(_0x1fd2b5,null))[_0x1a52('0x22')](respondWithResult(_0x1fd2b5,null))[_0x1a52('0x31')](handleError(_0x1fd2b5,null));};exports[_0x1a52('0x21')]=function(_0x2ce8fe,_0x2d604f){if(_0x2ce8fe[_0x1a52('0x32')]['id']){delete _0x2ce8fe[_0x1a52('0x32')]['id'];}return db[_0x1a52('0x29')][_0x1a52('0x33')]({'where':{'id':_0x2ce8fe['params']['id']}})[_0x1a52('0x22')](handleEntityNotFound(_0x2d604f,null))[_0x1a52('0x22')](saveUpdates(_0x2ce8fe['body'],null))[_0x1a52('0x22')](respondWithResult(_0x2d604f,null))[_0x1a52('0x31')](handleError(_0x2d604f,null));};exports['destroy']=function(_0x486c8b,_0x5e5748){return db[_0x1a52('0x29')][_0x1a52('0x33')]({'where':{'id':_0x486c8b['params']['id']}})[_0x1a52('0x22')](handleEntityNotFound(_0x5e5748,null))[_0x1a52('0x22')](removeEntity(_0x5e5748,null))[_0x1a52('0x31')](handleError(_0x5e5748,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index becdabe..4aea79e 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 _0x0ac0=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailApplication.attributes','exports','define','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x584291,_0x24b5b3){var _0x4e7d08=function(_0x59e0b1){while(--_0x59e0b1){_0x584291['push'](_0x584291['shift']());}};_0x4e7d08(++_0x24b5b3);}(_0x0ac0,0x130));var _0x00ac=function(_0x28e74e,_0x53fdf1){_0x28e74e=_0x28e74e-0x0;var _0xb45ac1=_0x0ac0[_0x28e74e];return _0xb45ac1;};'use strict';var _=require(_0x00ac('0x0'));var util=require(_0x00ac('0x1'));var logger=require(_0x00ac('0x2'))('api');var moment=require(_0x00ac('0x3'));var BPromise=require(_0x00ac('0x4'));var rp=require(_0x00ac('0x5'));var fs=require('fs');var path=require(_0x00ac('0x6'));var rimraf=require(_0x00ac('0x7'));var config=require(_0x00ac('0x8'));var attributes=require(_0x00ac('0x9'));module[_0x00ac('0xa')]=function(_0x4caaa8,_0x464817){return _0x4caaa8[_0x00ac('0xb')](_0x00ac('0xc'),attributes,{'tableName':_0x00ac('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x00ac('0xe'),'collate':_0x00ac('0xf')});}; \ No newline at end of file +var _0xbc36=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailApplication.attributes','MailApplication','mail_applications','utf8mb4','lodash','../../config/logger','api'];(function(_0x92a65c,_0x652e2f){var _0x534dc3=function(_0x40b3a2){while(--_0x40b3a2){_0x92a65c['push'](_0x92a65c['shift']());}};_0x534dc3(++_0x652e2f);}(_0xbc36,0x169));var _0x6bc3=function(_0x5f5cce,_0x138cc5){_0x5f5cce=_0x5f5cce-0x0;var _0x705ecf=_0xbc36[_0x5f5cce];return _0x705ecf;};'use strict';var _=require(_0x6bc3('0x0'));var util=require('util');var logger=require(_0x6bc3('0x1'))(_0x6bc3('0x2'));var moment=require(_0x6bc3('0x3'));var BPromise=require(_0x6bc3('0x4'));var rp=require(_0x6bc3('0x5'));var fs=require('fs');var path=require(_0x6bc3('0x6'));var rimraf=require(_0x6bc3('0x7'));var config=require(_0x6bc3('0x8'));var attributes=require(_0x6bc3('0x9'));module['exports']=function(_0x1c47e8,_0x4715c8){return _0x1c47e8['define'](_0x6bc3('0xa'),attributes,{'tableName':_0x6bc3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6bc3('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 0ad7e4a..3d77cca 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 _0x5981=['http','request','then','request\x20sent','MailApplication,\x20%s,\x20%s,\x20%s','error','code','MailApplication,\x20%s,\x20%s','message','catch','UpdateMailApplication','MailApplication','update','options','where','attributes','limit','info','stringify','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5981,0x118));var _0x1598=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5981[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x1598('0x0'));var moment=require(_0x1598('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1598('0x2'));var db=require(_0x1598('0x3'))['db'];var utils=require(_0x1598('0x4'));var logger=require(_0x1598('0x5'))(_0x1598('0x6'));var config=require(_0x1598('0x7'));var jayson=require(_0x1598('0x8'));var client=jayson[_0x1598('0x9')][_0x1598('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x58c237,_0x11d9e5,_0x1fa32f){return new BPromise(function(_0x4c6cdb,_0x287102){return client[_0x1598('0xb')](_0x58c237,_0x1fa32f)[_0x1598('0xc')](function(_0x26cd1f){logger['info']('MailApplication,\x20%s,\x20%s',_0x11d9e5,_0x1598('0xd'));logger['debug'](_0x1598('0xe'),_0x11d9e5,_0x1598('0xd'),JSON['stringify'](_0x26cd1f));if(_0x26cd1f[_0x1598('0xf')]){if(_0x26cd1f['error'][_0x1598('0x10')]===0x1f4){logger[_0x1598('0xf')](_0x1598('0x11'),_0x11d9e5,_0x26cd1f[_0x1598('0xf')][_0x1598('0x12')]);return _0x287102(_0x26cd1f[_0x1598('0xf')][_0x1598('0x12')]);}logger[_0x1598('0xf')](_0x1598('0x11'),_0x11d9e5,_0x26cd1f[_0x1598('0xf')][_0x1598('0x12')]);return _0x4c6cdb(_0x26cd1f[_0x1598('0xf')][_0x1598('0x12')]);}else{logger['info'](_0x1598('0x11'),_0x11d9e5,_0x1598('0xd'));_0x4c6cdb(_0x26cd1f['result'][_0x1598('0x12')]);}})[_0x1598('0x13')](function(_0x4b5e13){logger[_0x1598('0xf')](_0x1598('0x11'),_0x11d9e5,_0x4b5e13);_0x287102(_0x4b5e13);});});}exports[_0x1598('0x14')]=function(_0x4808db){var _0x59276b=this;return new Promise(function(_0x32aa5b,_0x58b2d7){return db[_0x1598('0x15')][_0x1598('0x16')](_0x4808db['body'],{'raw':_0x4808db[_0x1598('0x17')]?_0x4808db[_0x1598('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4808db[_0x1598('0x17')]?_0x4808db['options'][_0x1598('0x18')]||null:null,'attributes':_0x4808db[_0x1598('0x17')]?_0x4808db['options'][_0x1598('0x19')]||null:null,'limit':_0x4808db[_0x1598('0x17')]?_0x4808db[_0x1598('0x17')][_0x1598('0x1a')]||null:null})[_0x1598('0xc')](function(_0x22b3e4){logger[_0x1598('0x1b')](_0x1598('0x14'),_0x4808db);logger['debug'](_0x1598('0x14'),_0x4808db,JSON[_0x1598('0x1c')](_0x22b3e4));_0x32aa5b(_0x22b3e4);})[_0x1598('0x13')](function(_0x423922){logger['error'](_0x1598('0x14'),_0x423922['message'],_0x4808db);_0x58b2d7(_0x59276b[_0x1598('0xf')](0x1f4,_0x423922[_0x1598('0x12')]));});});}; \ No newline at end of file +var _0xd95f=['MailApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','MailApplication','update','body','options','raw','where','limit','UpdateMailApplication','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','MailApplication,\x20%s,\x20%s','debug'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd95f,0x188));var _0xfd95=function(_0xdfcfe2,_0x7abb48){_0xdfcfe2=_0xdfcfe2-0x0;var _0x2420c0=_0xd95f[_0xdfcfe2];return _0x2420c0;};'use strict';var _=require(_0xfd95('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xfd95('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfd95('0x2'));var db=require(_0xfd95('0x3'))['db'];var utils=require(_0xfd95('0x4'));var logger=require(_0xfd95('0x5'))('rpc');var config=require(_0xfd95('0x6'));var jayson=require(_0xfd95('0x7'));var client=jayson[_0xfd95('0x8')][_0xfd95('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x48aa88,_0x4c2194,_0x178645){return new BPromise(function(_0x2aa943,_0x149226){return client['request'](_0x48aa88,_0x178645)[_0xfd95('0xa')](function(_0x5d3680){logger[_0xfd95('0xb')](_0xfd95('0xc'),_0x4c2194,'request\x20sent');logger[_0xfd95('0xd')](_0xfd95('0xe'),_0x4c2194,_0xfd95('0xf'),JSON[_0xfd95('0x10')](_0x5d3680));if(_0x5d3680[_0xfd95('0x11')]){if(_0x5d3680[_0xfd95('0x11')]['code']===0x1f4){logger[_0xfd95('0x11')](_0xfd95('0xc'),_0x4c2194,_0x5d3680[_0xfd95('0x11')]['message']);return _0x149226(_0x5d3680[_0xfd95('0x11')][_0xfd95('0x12')]);}logger[_0xfd95('0x11')](_0xfd95('0xc'),_0x4c2194,_0x5d3680[_0xfd95('0x11')][_0xfd95('0x12')]);return _0x2aa943(_0x5d3680['error'][_0xfd95('0x12')]);}else{logger[_0xfd95('0xb')](_0xfd95('0xc'),_0x4c2194,'request\x20sent');_0x2aa943(_0x5d3680[_0xfd95('0x13')][_0xfd95('0x12')]);}})[_0xfd95('0x14')](function(_0x14a263){logger['error']('MailApplication,\x20%s,\x20%s',_0x4c2194,_0x14a263);_0x149226(_0x14a263);});});}exports['UpdateMailApplication']=function(_0x31c44c){var _0x2b9ad0=this;return new Promise(function(_0x52fc12,_0x16434c){return db[_0xfd95('0x15')][_0xfd95('0x16')](_0x31c44c[_0xfd95('0x17')],{'raw':_0x31c44c[_0xfd95('0x18')]?_0x31c44c[_0xfd95('0x18')][_0xfd95('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x31c44c['options']?_0x31c44c['options'][_0xfd95('0x1a')]||null:null,'attributes':_0x31c44c[_0xfd95('0x18')]?_0x31c44c[_0xfd95('0x18')]['attributes']||null:null,'limit':_0x31c44c['options']?_0x31c44c['options'][_0xfd95('0x1b')]||null:null})[_0xfd95('0xa')](function(_0x575e67){logger[_0xfd95('0xb')](_0xfd95('0x1c'),_0x31c44c);logger[_0xfd95('0xd')](_0xfd95('0x1c'),_0x31c44c,JSON[_0xfd95('0x10')](_0x575e67));_0x52fc12(_0x575e67);})[_0xfd95('0x14')](function(_0x3c4472){logger[_0xfd95('0x11')](_0xfd95('0x1c'),_0x3c4472[_0xfd95('0x12')],_0x31c44c);_0x16434c(_0x2b9ad0['error'](0x1f4,_0x3c4472[_0xfd95('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 7fa5b94..c7bc972 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 _0x34f8=['addTags','put','mailinteraction:update','update','delete','mailinteraction:destroy','destroy','removeTags','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','mail'];(function(_0x71b765,_0x3053f8){var _0x34cb24=function(_0x2dd237){while(--_0x2dd237){_0x71b765['push'](_0x71b765['shift']());}};_0x34cb24(++_0x3053f8);}(_0x34f8,0x80));var _0x834f=function(_0x5175fe,_0x10144d){_0x5175fe=_0x5175fe-0x0;var _0x106a5b=_0x34f8[_0x5175fe];return _0x106a5b;};'use strict';var multer=require(_0x834f('0x0'));var util=require(_0x834f('0x1'));var path=require(_0x834f('0x2'));var timeout=require(_0x834f('0x3'));var express=require(_0x834f('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x834f('0x5'));var config=require(_0x834f('0x6'));var controller=require('./mailInteraction.controller');router[_0x834f('0x7')]('/',auth[_0x834f('0x8')](),controller[_0x834f('0x9')]);router[_0x834f('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x834f('0xa')]);router[_0x834f('0x7')](_0x834f('0xb'),auth[_0x834f('0x8')](),controller['show']);router[_0x834f('0x7')](_0x834f('0xc'),auth['isAuthenticated'](),controller[_0x834f('0xd')]);router[_0x834f('0x7')](_0x834f('0xe'),auth[_0x834f('0x8')](),controller[_0x834f('0xf')]);router[_0x834f('0x10')]('/',auth[_0x834f('0x8')](),controller[_0x834f('0x11')]);router['post'](_0x834f('0xc'),auth[_0x834f('0x8')](),controller[_0x834f('0x12')]);router[_0x834f('0x10')](_0x834f('0x13'),auth['isAuthenticated'](),interaction[_0x834f('0x14')](_0x834f('0x15'),'mailinteraction:addtags'),controller[_0x834f('0x16')]);router[_0x834f('0x17')]('/:id',auth[_0x834f('0x8')](),interaction['tracked'](_0x834f('0x15'),_0x834f('0x18')),controller[_0x834f('0x19')]);router[_0x834f('0x1a')]('/:id',auth['isAuthenticated'](),interaction[_0x834f('0x14')](_0x834f('0x15'),_0x834f('0x1b')),controller[_0x834f('0x1c')]);router['delete'](_0x834f('0x13'),auth[_0x834f('0x8')](),controller[_0x834f('0x1d')]);module['exports']=router; \ No newline at end of file +var _0x9a6b=['util','path','connect-timeout','express','Router','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMessages','/:id/download','post','addMessage','/:id/tags','tracked','mail','mailinteraction:addtags','addTags','update','delete','mailinteraction:destroy','destroy','removeTags','exports','multer'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x9a6b,0x77));var _0xb9a6=function(_0x4951a3,_0xc7bb2c){_0x4951a3=_0x4951a3-0x0;var _0x1566a1=_0x9a6b[_0x4951a3];return _0x1566a1;};'use strict';var multer=require(_0xb9a6('0x0'));var util=require(_0xb9a6('0x1'));var path=require(_0xb9a6('0x2'));var timeout=require(_0xb9a6('0x3'));var express=require(_0xb9a6('0x4'));var router=express[_0xb9a6('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xb9a6('0x6'));var config=require('../../config/environment');var controller=require(_0xb9a6('0x7'));router[_0xb9a6('0x8')]('/',auth[_0xb9a6('0x9')](),controller[_0xb9a6('0xa')]);router[_0xb9a6('0x8')](_0xb9a6('0xb'),auth[_0xb9a6('0x9')](),controller[_0xb9a6('0xc')]);router[_0xb9a6('0x8')](_0xb9a6('0xd'),auth['isAuthenticated'](),controller[_0xb9a6('0xe')]);router[_0xb9a6('0x8')]('/:id/messages',auth[_0xb9a6('0x9')](),controller[_0xb9a6('0xf')]);router[_0xb9a6('0x8')](_0xb9a6('0x10'),auth['isAuthenticated'](),controller['download']);router['post']('/',auth[_0xb9a6('0x9')](),controller['create']);router[_0xb9a6('0x11')]('/:id/messages',auth[_0xb9a6('0x9')](),controller[_0xb9a6('0x12')]);router[_0xb9a6('0x11')](_0xb9a6('0x13'),auth[_0xb9a6('0x9')](),interaction[_0xb9a6('0x14')](_0xb9a6('0x15'),_0xb9a6('0x16')),controller[_0xb9a6('0x17')]);router['put'](_0xb9a6('0xd'),auth[_0xb9a6('0x9')](),interaction[_0xb9a6('0x14')](_0xb9a6('0x15'),'mailinteraction:update'),controller[_0xb9a6('0x18')]);router[_0xb9a6('0x19')](_0xb9a6('0xd'),auth['isAuthenticated'](),interaction[_0xb9a6('0x14')](_0xb9a6('0x15'),_0xb9a6('0x1a')),controller[_0xb9a6('0x1b')]);router[_0xb9a6('0x19')]('/:id/tags',auth[_0xb9a6('0x9')](),controller[_0xb9a6('0x1c')]);module[_0xb9a6('0x1d')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index bc94137..c57459f 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 _0xd3ad=['sequelize','iconv','BOOLEAN','DATE','STRING','TEXT','long','ENUM','out'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xd3ad,0x90));var _0xdd3a=function(_0x5b3fb8,_0x348060){_0x5b3fb8=_0x5b3fb8-0x0;var _0xd739c0=_0xd3ad[_0x5b3fb8];return _0xd739c0;};'use strict';var Sequelize=require(_0xdd3a('0x0'));var iconv=require(_0xdd3a('0x1'));module['exports']={'closed':{'type':Sequelize[_0xdd3a('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xdd3a('0x3')]},'disposition':{'type':Sequelize[_0xdd3a('0x4')]},'note':{'type':Sequelize[_0xdd3a('0x4')]},'inReplyTo':{'type':Sequelize[_0xdd3a('0x4')](0x1fe)},'to':{'type':Sequelize[_0xdd3a('0x4')]},'cc':{'type':Sequelize[_0xdd3a('0x5')](_0xdd3a('0x6'))},'subject':{'type':Sequelize[_0xdd3a('0x5')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xdd3a('0x3')]},'substatus':{'type':Sequelize[_0xdd3a('0x4')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0xdd3a('0x7')]('in',_0xdd3a('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xdd3a('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xdd3a('0x7')]('in',_0xdd3a('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize[_0xdd3a('0x5')]('long')},'lastMsgText':{'type':Sequelize[_0xdd3a('0x5')](_0xdd3a('0x6'))}}; \ No newline at end of file +var _0x9603=['STRING','TEXT','long','ENUM','out','sequelize','iconv','exports','BOOLEAN','DATE'];(function(_0x4fae69,_0x1d1d6b){var _0x3d2983=function(_0x437da9){while(--_0x437da9){_0x4fae69['push'](_0x4fae69['shift']());}};_0x3d2983(++_0x1d1d6b);}(_0x9603,0x181));var _0x3960=function(_0x31233f,_0x43f101){_0x31233f=_0x31233f-0x0;var _0x4c4404=_0x9603[_0x31233f];return _0x4c4404;};'use strict';var Sequelize=require(_0x3960('0x0'));var iconv=require(_0x3960('0x1'));module[_0x3960('0x2')]={'closed':{'type':Sequelize[_0x3960('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x3960('0x4')]},'disposition':{'type':Sequelize[_0x3960('0x5')]},'note':{'type':Sequelize[_0x3960('0x5')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0x3960('0x5')]},'cc':{'type':Sequelize[_0x3960('0x6')](_0x3960('0x7'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize[_0x3960('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x3960('0x4')]},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0x3960('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x3960('0x8')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x3960('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x3960('0x8')]('in',_0x3960('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize[_0x3960('0x6')]('long')},'lastMsgText':{'type':Sequelize['TEXT'](_0x3960('0x7'))}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 1f33853..4563c9b 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 _0xe706=['trimStart','fromString','catch','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','select','field','color','from','tools_tags','u.id','ui.MailInteractionId','user_has_mail_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','UserId','filter','isNil','isEmpty','MailAccountId','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','toString','join','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','order','DESC','t.id\x20IN\x20?','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.substatus','i.to','i.ContactId','i.MailAccountId','i.UserId','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.phone','c.mobile','Contact.mobile','Contact.fax','sequelize','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','enableEmailPreview','all','show','include','options','create','body','params','describe','addMessage','ids','omit','MailMessage','nolimit','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','emit','mailInteractionTags:save','removeTags','unix','files','attachments','root','server','tmp','interaction-%s.zip','bcc','subject','Attachments','mkdirSync','each','headers','basename','existsSync','readFileSync','build','message%d.eml','log','err','unlinkSync','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','html-to-text','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','count','offset','limit','set','Content-Range','json','reject','save','update','destroy','then','end','error','stack','name','Users','map','Tags','split','forEach','push','TagIds','MailInteraction','findOne','lastMsgBody','lastMsgText'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe706,0xa3));var _0x6e70=function(_0x10a1ac,_0x25f5b0){_0x10a1ac=_0x10a1ac-0x0;var _0x45b99e=_0xe706[_0x10a1ac];return _0x45b99e;};'use strict';var pdf=require(_0x6e70('0x0'));var emlformat=require(_0x6e70('0x1'));var rimraf=require(_0x6e70('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6e70('0x3'));var rp=require(_0x6e70('0x4'));var moment=require(_0x6e70('0x5'));var BPromise=require(_0x6e70('0x6'));var Mustache=require(_0x6e70('0x7'));var util=require(_0x6e70('0x8'));var path=require(_0x6e70('0x9'));var sox=require(_0x6e70('0xa'));var csv=require(_0x6e70('0xb'));var ejs=require(_0x6e70('0xc'));var fs=require('fs');var _=require(_0x6e70('0xd'));var squel=require(_0x6e70('0xe'));var crypto=require(_0x6e70('0xf'));var jsforce=require(_0x6e70('0x10'));var deskjs=require(_0x6e70('0x11'));var toCsv=require(_0x6e70('0xb'));var querystring=require(_0x6e70('0x12'));var Papa=require(_0x6e70('0x13'));var htmlToText=require(_0x6e70('0x14'));var Redis=require(_0x6e70('0x15'));var authService=require(_0x6e70('0x16'));var qs=require(_0x6e70('0x17'));var as=require(_0x6e70('0x18'));var hardwareService=require(_0x6e70('0x19'));var logger=require('../../config/logger')('api');var utils=require(_0x6e70('0x1a'));var config=require(_0x6e70('0x1b'));var db=require(_0x6e70('0x1c'))['db'];config[_0x6e70('0x1d')]=_[_0x6e70('0x1e')](config[_0x6e70('0x1d')],{'host':_0x6e70('0x1f'),'port':0x18eb});var socket=require(_0x6e70('0x20'))(new Redis(config['redis']));require('./mailInteraction.socket')['register'](socket);function respondWithStatusCode(_0x257e81,_0x5a37a6){_0x5a37a6=_0x5a37a6||0xcc;return function(_0x53aed0){if(_0x53aed0){return _0x257e81[_0x6e70('0x21')](_0x5a37a6);}return _0x257e81[_0x6e70('0x22')](_0x5a37a6)['end']();};}function respondWithResult(_0x24f3ac,_0x5c3fe7){_0x5c3fe7=_0x5c3fe7||0xc8;return function(_0x2efc0f){if(_0x2efc0f){return _0x24f3ac[_0x6e70('0x22')](_0x5c3fe7)['json'](_0x2efc0f);}};}function respondWithFilteredResult(_0x49029f,_0x3bd572){return function(_0x5ea7a5){if(_0x5ea7a5){var _0x28a21f=_0x5ea7a5[_0x6e70('0x23')],_0x173afe=_0x3bd572[_0x6e70('0x24')],_0x53acdc=_0x3bd572[_0x6e70('0x24')]+_0x3bd572[_0x6e70('0x25')],_0x497d61;if(_0x53acdc>=_0x28a21f){_0x53acdc=_0x28a21f;_0x497d61=0xc8;}else{_0x497d61=0xce;}_0x49029f[_0x6e70('0x22')](_0x497d61);return _0x49029f[_0x6e70('0x26')](_0x6e70('0x27'),_0x173afe+'-'+_0x53acdc+'/'+_0x28a21f)[_0x6e70('0x28')](_0x5ea7a5);}return null;};}function patchUpdates(_0x29326f){return function(_0xb29a2a){try{jsonpatch['apply'](_0xb29a2a,_0x29326f,!![]);}catch(_0x228350){return BPromise[_0x6e70('0x29')](_0x228350);}return _0xb29a2a[_0x6e70('0x2a')]();};}function saveUpdates(_0x502b2d,_0x3ccd87){return function(_0xa5d49){if(_0xa5d49){return _0xa5d49[_0x6e70('0x2b')](_0x502b2d)['then'](function(_0x10fc91){return _0x10fc91;});}return null;};}function removeEntity(_0x538b9c,_0x50aec2){return function(_0x4e97c7){if(_0x4e97c7){return _0x4e97c7[_0x6e70('0x2c')]()[_0x6e70('0x2d')](function(){_0x538b9c['status'](0xcc)[_0x6e70('0x2e')]();});}};}function handleEntityNotFound(_0x1196ed,_0x5f268f){return function(_0x338ad6){if(!_0x338ad6){_0x1196ed[_0x6e70('0x21')](0x194);}return _0x338ad6;};}function handleError(_0x2bb231,_0x4a67ac){_0x4a67ac=_0x4a67ac||0x1f4;return function(_0x54a5fe){logger[_0x6e70('0x2f')](_0x54a5fe[_0x6e70('0x30')]);if(_0x54a5fe[_0x6e70('0x31')]){delete _0x54a5fe[_0x6e70('0x31')];}_0x2bb231[_0x6e70('0x22')](_0x4a67ac)['send'](_0x54a5fe);};}function getInteractionUsers(_0x1952ea,_0x406f29){return new BPromise(function(_0xecf336,_0x2864a0){try{if(_0x406f29[_0x1952ea['id']]){_0x1952ea[_0x6e70('0x32')]=_[_0x6e70('0x33')](_0x406f29[_0x1952ea['id']],function(_0x3f78d2){return{'id':_0x3f78d2['id']};});}}catch(_0x24114a){_0x2864a0(_0x24114a);}_0xecf336(_0x1952ea);});}function getInteractionTags(_0x3a0821,_0x3a5d30){return new BPromise(function(_0x4b1229,_0x1b27d8){try{if(_0x3a0821['TagIds']){_0x3a0821[_0x6e70('0x34')]=[];_0x3a0821['TagIds'][_0x6e70('0x35')](',')[_0x6e70('0x36')](function(_0x30fa0b){_0x3a0821['Tags'][_0x6e70('0x37')](_0x3a5d30[_0x30fa0b]);});}delete _0x3a0821[_0x6e70('0x38')];}catch(_0x5780a1){_0x1b27d8(_0x5780a1);}_0x4b1229(_0x3a0821);});}function getLastMessageText(_0x13d673){return new BPromise(function(_0x154925,_0x52b457){return db[_0x6e70('0x39')][_0x6e70('0x3a')]({'where':{'id':_0x13d673['id']},'attributes':[_0x6e70('0x3b'),_0x6e70('0x3c')],'raw':!![]})[_0x6e70('0x2d')](function(_0x1e3e76){if(!_0x1e3e76[_0x6e70('0x3c')]){_0x13d673[_0x6e70('0x3c')]=_[_0x6e70('0x3d')](htmlToText[_0x6e70('0x3e')](_0x1e3e76['lastMsgBody'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]}));}else{_0x13d673[_0x6e70('0x3c')]=_0x1e3e76['lastMsgText'];}_0x154925(_0x13d673);})[_0x6e70('0x3f')](function(_0x3222a2){_0x52b457(_0x3222a2);});});}function updateMailInteraction(_0x98c683,_0x32d12d,_0x233a83,_0x989b80){return new BPromise(function(_0x2440be,_0xdd0bee){return getInteractionUsers(_0x98c683,_0x233a83)[_0x6e70('0x2d')](function(_0x198dd1){return getInteractionTags(_0x198dd1,_0x32d12d);})[_0x6e70('0x2d')](function(_0x23d5e2){if(_0x989b80){_0x2440be(getLastMessageText(_0x23d5e2));}else{_0x2440be(_0x23d5e2);}})[_0x6e70('0x3f')](function(_0x501b53){_0xdd0bee(_0x501b53);});});}exports['index']=function(_0x5424eb,_0x155a46){var _0x3841a0={},_0x2cb5b0={},_0x1f6955={'count':0x0,'rows':[]};var _0x1872e9=_[_0x6e70('0x33')](db['MailInteraction'][_0x6e70('0x40')],function(_0x9e7ad2){return{'name':_0x9e7ad2[_0x6e70('0x41')],'type':_0x9e7ad2[_0x6e70('0x42')][_0x6e70('0x43')]};});_0x2cb5b0[_0x6e70('0x44')]=_[_0x6e70('0x33')](_0x1872e9,_0x6e70('0x31'));_0x2cb5b0['query']=_[_0x6e70('0x45')](_0x5424eb[_0x6e70('0x46')]);_0x2cb5b0[_0x6e70('0x47')]=_[_0x6e70('0x48')](_0x2cb5b0[_0x6e70('0x44')],_0x2cb5b0[_0x6e70('0x46')]);_0x3841a0[_0x6e70('0x49')]=_['intersection'](_0x2cb5b0['model'],qs['fields'](_0x5424eb[_0x6e70('0x46')][_0x6e70('0x4a')]));_0x3841a0[_0x6e70('0x49')]=_0x3841a0[_0x6e70('0x49')][_0x6e70('0x4b')]?_0x3841a0['attributes']:_0x2cb5b0[_0x6e70('0x44')];if(!_0x5424eb[_0x6e70('0x46')][_0x6e70('0x4c')]('nolimit')){_0x3841a0['limit']=qs['limit'](_0x5424eb[_0x6e70('0x46')]['limit']);_0x3841a0[_0x6e70('0x24')]=qs[_0x6e70('0x24')](_0x5424eb[_0x6e70('0x46')][_0x6e70('0x24')]);}_0x3841a0['order']=qs[_0x6e70('0x4d')](_0x5424eb['query'][_0x6e70('0x4d')]);_0x3841a0[_0x6e70('0x4e')]=qs[_0x6e70('0x47')](_[_0x6e70('0x4f')](_0x5424eb['query'],_0x2cb5b0[_0x6e70('0x47')]));var _0x44b637=[];var _0x3d39c3=squel[_0x6e70('0x50')]()[_0x6e70('0x51')]('id')[_0x6e70('0x51')](_0x6e70('0x31'))['field'](_0x6e70('0x52'))[_0x6e70('0x53')](_0x6e70('0x54'));var _0x2f99cb=squel[_0x6e70('0x50')]()[_0x6e70('0x51')](_0x6e70('0x55'))['field'](_0x6e70('0x56'))['from'](_0x6e70('0x57'),'ui')[_0x6e70('0x58')]('users','u','u.id\x20=\x20ui.UserId');var _0x333abd=squel[_0x6e70('0x50')]()[_0x6e70('0x53')]('mail_interactions','i')['left_join'](_0x6e70('0x59'),'c',_0x6e70('0x5a'))[_0x6e70('0x58')](_0x6e70('0x5b'),'o',_0x6e70('0x5c'))[_0x6e70('0x58')]('mail_accounts','a',_0x6e70('0x5d'))[_0x6e70('0x58')](_0x6e70('0x5e'),'me',_0x6e70('0x5f'))[_0x6e70('0x58')]('mail_interaction_has_tags','it','it.MailInteractionId\x20=\x20i.id')[_0x6e70('0x58')](_0x6e70('0x54'),'t',_0x6e70('0x60'));var _0x15f994=squel[_0x6e70('0x61')]();var _0x5dd73e=[];var _0x41bd0b=squel[_0x6e70('0x61')]();if(_0x5424eb[_0x6e70('0x46')][_0x6e70('0x62')]){var _0x3aba34=as['parseSearch'](_0x5424eb[_0x6e70('0x46')][_0x6e70('0x62')]);var _0x2c20d3=_0x3aba34[_0x6e70('0x63')];for(var _0x8ef4f7=0x0;_0x8ef4f7<_0x3aba34[_0x6e70('0x64')]['length'];_0x8ef4f7++){var _0x40e7c6=_0x3aba34[_0x6e70('0x64')][_0x8ef4f7];var _0x5c2396='i';var _0x382fde=_[_0x6e70('0x65')](_0x1872e9,['name',_0x40e7c6[_0x6e70('0x51')]]);if(!_0x382fde){switch(_0x40e7c6[_0x6e70('0x51')]){case _0x6e70('0x66'):if(_0x40e7c6[_0x6e70('0x67')]==0x1){_0x333abd[_0x6e70('0x68')]('`'+_0x40e7c6['field']+_0x6e70('0x69'));}else{_0x333abd[_0x6e70('0x68')]('`'+_0x40e7c6[_0x6e70('0x51')]+_0x6e70('0x6a'));}break;case _0x6e70('0x6b'):if(_0x40e7c6[_0x6e70('0x6c')]===_0x6e70('0x6d')){_0x15f994[_0x2c20d3](_0x6e70('0x6e'),_0x40e7c6[_0x6e70('0x67')],null);}else{_0x382fde=_[_0x6e70('0x65')](_0x1872e9,[_0x6e70('0x31'),_0x6e70('0x6f')]);_0x40e7c6[_0x6e70('0x51')]=_0x6e70('0x6f');_0x2ad395=as[_0x6e70('0x70')](_0x5c2396,_0x382fde[_0x6e70('0x42')],_0x40e7c6);_0x15f994[_0x2c20d3](_0x2ad395[_0x6e70('0x71')],_0x2ad395[_0x6e70('0x67')][_0x6e70('0x72')],_0x2ad395[_0x6e70('0x67')]['end']);}break;case _0x6e70('0x73'):var _0x4434dd=_0x40e7c6[_0x6e70('0x67')][_0x6e70('0x35')](',')[_0x6e70('0x33')](function(_0x3880dd){return Number(_0x3880dd);});_0x4434dd['forEach'](function(_0x42bd85){_0x41bd0b['or'](_0x6e70('0x74'),'%,'+_0x42bd85+',%');});_0x5dd73e=_['union'](_0x5dd73e,_0x4434dd);break;case _0x6e70('0x75'):if(_0x40e7c6[_0x6e70('0x6c')]===_0x6e70('0x6d')){_0x15f994[_0x2c20d3]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x40e7c6['value']+'%',null);}else{_0x382fde=_[_0x6e70('0x65')](_0x1872e9,[_0x6e70('0x31'),_0x6e70('0x76')]);_0x40e7c6[_0x6e70('0x51')]=_0x6e70('0x76');_0x2ad395=as[_0x6e70('0x70')](_0x5c2396,_0x382fde[_0x6e70('0x42')],_0x40e7c6);_0x15f994[_0x2c20d3](_0x2ad395['text'],_0x2ad395['value'][_0x6e70('0x72')],_0x2ad395[_0x6e70('0x67')][_0x6e70('0x2e')]);}break;}}else{var _0x2ad395=as['buildExpression'](_0x5c2396,_0x382fde['type'],_0x40e7c6);_0x15f994[_0x2c20d3](_0x2ad395[_0x6e70('0x71')],_0x2ad395[_0x6e70('0x67')]['start'],_0x2ad395['value'][_0x6e70('0x2e')]);}}}else{var _0x47fbed=_(Object[_0x6e70('0x45')](_0x5424eb[_0x6e70('0x46')]))[_0x6e70('0x33')](function(_0x2f3626){return _0x1872e9[_0x6e70('0x4c')](_0x2f3626)?_0x2f3626:undefined;})[_0x6e70('0x77')](function(_0x2a9876){return!_[_0x6e70('0x78')](_0x2a9876);})['value']();if(!_[_0x6e70('0x79')](_0x47fbed)){_0x47fbed[_0x6e70('0x36')](function(_0x22c836){if(_0x22c836===_0x6e70('0x7a')){_0x333abd[_0x6e70('0x4e')]('i.MailAccountId\x20IN\x20?',[]['concat'](_0x5424eb['query'][_0x22c836]));}else if(_0x22c836===_0x6e70('0x7b')){var _0xd91b9=JSON[_0x6e70('0x7c')](_0x5424eb['query'][_0x22c836])['$gte'];var _0x2fc2a2=JSON[_0x6e70('0x7c')](_0x5424eb[_0x6e70('0x46')][_0x22c836])[_0x6e70('0x7d')];_0x333abd[_0x6e70('0x4e')](_0x6e70('0x7e'),_0xd91b9,_0x2fc2a2);}else{if(_0x5424eb['query'][_0x22c836]===_0x6e70('0x7f')){_0x333abd[_0x6e70('0x4e')]('i.'+_0x22c836+_0x6e70('0x80'));}else{_0x333abd[_0x6e70('0x4e')]('i.'+_0x22c836+'\x20=\x20?',_0x5424eb[_0x6e70('0x46')][_0x22c836]);}}});}if(_0x5424eb['query']['read']){if(_0x5424eb[_0x6e70('0x46')][_0x6e70('0x81')]==0x1){_0x333abd[_0x6e70('0x68')](_0x6e70('0x82'));}else{_0x333abd[_0x6e70('0x68')](_0x6e70('0x83'));}}if(_0x5424eb['query'][_0x6e70('0x84')]){_0x5dd73e=_[_0x6e70('0x85')](_0x5424eb[_0x6e70('0x46')][_0x6e70('0x84')])?_0x5424eb[_0x6e70('0x46')][_0x6e70('0x84')]:new Array(_0x5424eb[_0x6e70('0x46')][_0x6e70('0x84')]);_0x5dd73e[_0x6e70('0x36')](function(_0x29621a){_0x41bd0b['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x29621a+',%');});}if(_0x5424eb[_0x6e70('0x46')][_0x6e70('0x77')]){var _0x577c3b=_0x5424eb['query']['filter'][_0x6e70('0x86')]('\x5c','\x5c\x5c')[_0x6e70('0x86')]('\x27\x27',_0x6e70('0x87'));if(qs[_0x6e70('0x88')](_0x577c3b)){_0x15f994['or'](_0x6e70('0x89'),_0x577c3b+'%');}else if(qs['isEmail'](_0x577c3b)){_0x15f994['or']('c.email\x20LIKE\x20?',_0x577c3b+'%');}else{var _0xe0073f=[];_0x577c3b[_0x6e70('0x35')]('\x20')['forEach'](function(_0x58666a){_0xe0073f[_0x6e70('0x37')]('+'+_0x58666a[_0x6e70('0x8a')]());});var _0x3280ea=_0xe0073f[_0x6e70('0x8b')]('\x20');_0x15f994['or'](_0x6e70('0x8c'),_0x3280ea)['or'](_0x6e70('0x8d'),_0x3280ea);}}}_0x333abd[_0x6e70('0x4e')](_0x15f994);_0x333abd[_0x6e70('0x8e')](_0x6e70('0x8f'));var _0x347cc4={'type':db[_0x6e70('0x90')][_0x6e70('0x91')][_0x6e70('0x92')],'raw':!![]};var _0x511658=_0x333abd['clone']();_0x511658[_0x6e70('0x51')]('i.id');_0x511658[_0x6e70('0x51')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x3841a0[_0x6e70('0x93')]){_0x3841a0['order']['forEach'](function(_0x3c77d8){_0x333abd[_0x6e70('0x93')]('i.'+_0x3c77d8[0x0],_0x3c77d8[0x1]===_0x6e70('0x94')?![]:!![]);});}if(!_['isEmpty'](_0x5dd73e)){_0x333abd['having'](_0x41bd0b);_0x511658['where'](_0x6e70('0x95'),_0x5dd73e);}db['sequelize'][_0x6e70('0x46')](_0x511658[_0x6e70('0x8a')](),_0x347cc4)[_0x6e70('0x2d')](function(_0x3fe93d){_0x1f6955[_0x6e70('0x23')]=_0x3fe93d[_0x6e70('0x4b')];if(_0x1f6955[_0x6e70('0x23')]===0x0)return[];return db['sequelize'][_0x6e70('0x46')](_0x3d39c3[_0x6e70('0x8a')](),_0x347cc4)[_0x6e70('0x2d')](function(_0x551904){_0x44b637=_[_0x6e70('0x96')](_0x551904,'id');_0x347cc4=_[_0x6e70('0x97')](_0x347cc4,{'model':db[_0x6e70('0x39')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x333abd[_0x6e70('0x51')](_0x6e70('0x98'),_0x6e70('0x66'));_0x333abd[_0x6e70('0x51')](_0x6e70('0x99'),_0x6e70('0x9a'));_0x333abd['field'](_0x6e70('0x9b'),_0x6e70('0x9c'));_0x333abd['field'](_0x6e70('0x8f'));_0x333abd[_0x6e70('0x51')]('i.createdAt');_0x333abd['field'](_0x6e70('0x9d'));_0x333abd['field'](_0x6e70('0x9e'));_0x333abd['field'](_0x6e70('0x9f'));_0x333abd[_0x6e70('0x51')](_0x6e70('0xa0'));_0x333abd[_0x6e70('0x51')](_0x6e70('0xa1'));_0x333abd[_0x6e70('0x51')](_0x6e70('0xa2'));_0x333abd['field']('i.subject');_0x333abd[_0x6e70('0x51')]('i.disposition');_0x333abd[_0x6e70('0x51')](_0x6e70('0xa3'));_0x333abd[_0x6e70('0x51')](_0x6e70('0xa4'));_0x333abd['field'](_0x6e70('0xa5'));_0x333abd['field'](_0x6e70('0xa6'));_0x333abd[_0x6e70('0x51')](_0x6e70('0xa7'));_0x333abd[_0x6e70('0x51')](_0x6e70('0xa8'),_0x6e70('0xa9'));_0x333abd[_0x6e70('0x51')]('c.lastName',_0x6e70('0xaa'));_0x333abd['field'](_0x6e70('0xab'),'Contact.email');_0x333abd['field']('c.phone',_0x6e70('0xac'));_0x333abd[_0x6e70('0x51')](_0x6e70('0xad'),_0x6e70('0xae'));_0x333abd[_0x6e70('0x51')]('c.fax',_0x6e70('0xaf'));_0x333abd[_0x6e70('0x51')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x6e70('0x38'));_0x333abd['limit'](_0x3841a0[_0x6e70('0x25')]);_0x333abd['offset'](_0x3841a0['offset']);return db[_0x6e70('0xb0')][_0x6e70('0x46')](_0x333abd[_0x6e70('0x8a')](),_0x347cc4);})[_0x6e70('0x2d')](function(_0x3e6661){_0x2f99cb[_0x6e70('0x4e')](_0x6e70('0xb1'),_['map'](_0x3e6661,'id'));return db[_0x6e70('0xb0')]['query'](_0x2f99cb[_0x6e70('0x8a')](),_0x347cc4)[_0x6e70('0x2d')](function(_0x2bd364){var _0x3269ce=_[_0x6e70('0xb2')](_0x2bd364,_0x6e70('0xb3'));var _0x2012ee=[];return db['Setting'][_0x6e70('0x3a')]({'attributes':['enableEmailPreview'],'raw':!![]})[_0x6e70('0x2d')](function(_0x44f913){var _0x7d81f=_0x44f913[_0x6e70('0xb4')];_0x3e6661[_0x6e70('0x36')](function(_0x12c567){_0x2012ee[_0x6e70('0x37')](updateMailInteraction(_0x12c567,_0x44b637,_0x3269ce,_0x7d81f));});return BPromise[_0x6e70('0xb5')](_0x2012ee);});});});})[_0x6e70('0x2d')](function(_0x162bc3){_0x1f6955['rows']=_0x162bc3;return _0x1f6955;})[_0x6e70('0x2d')](respondWithFilteredResult(_0x155a46,_0x3841a0))[_0x6e70('0x3f')](handleError(_0x155a46,null));};exports[_0x6e70('0xb6')]=function(_0x181802,_0xbd8324){var _0x4c3782={'raw':![],'where':{'id':_0x181802['params']['id']}},_0x4ec3ff={};_0x4ec3ff[_0x6e70('0x44')]=_[_0x6e70('0x45')](db[_0x6e70('0x39')][_0x6e70('0x40')]);_0x4ec3ff[_0x6e70('0x46')]=_[_0x6e70('0x45')](_0x181802[_0x6e70('0x46')]);_0x4ec3ff[_0x6e70('0x47')]=_[_0x6e70('0x48')](_0x4ec3ff[_0x6e70('0x44')],_0x4ec3ff[_0x6e70('0x46')]);_0x4c3782[_0x6e70('0x49')]=_[_0x6e70('0x48')](_0x4ec3ff[_0x6e70('0x44')],qs[_0x6e70('0x4a')](_0x181802['query'][_0x6e70('0x4a')]));_0x4c3782[_0x6e70('0x49')]=_0x4c3782[_0x6e70('0x49')][_0x6e70('0x4b')]?_0x4c3782[_0x6e70('0x49')]:_0x4ec3ff[_0x6e70('0x44')];if(_0x181802['query']['includeAll']){_0x4c3782[_0x6e70('0xb7')]=[{'all':!![]}];}_0x4c3782=_[_0x6e70('0x97')]({},_0x4c3782,_0x181802[_0x6e70('0xb8')]);return db[_0x6e70('0x39')][_0x6e70('0x65')](_0x4c3782)[_0x6e70('0x2d')](handleEntityNotFound(_0xbd8324,null))[_0x6e70('0x2d')](respondWithResult(_0xbd8324,null))['catch'](handleError(_0xbd8324,null));};exports[_0x6e70('0xb9')]=function(_0x511830,_0x3296d2){return db[_0x6e70('0x39')][_0x6e70('0xb9')](_0x511830[_0x6e70('0xba')],{})['then'](respondWithResult(_0x3296d2,0xc9))[_0x6e70('0x3f')](handleError(_0x3296d2,null));};exports[_0x6e70('0x2b')]=function(_0x5ee5a5,_0x43cc26){if(_0x5ee5a5['body']['id']){delete _0x5ee5a5[_0x6e70('0xba')]['id'];}return db['MailInteraction']['find']({'where':{'id':_0x5ee5a5[_0x6e70('0xbb')]['id']}})[_0x6e70('0x2d')](handleEntityNotFound(_0x43cc26,null))[_0x6e70('0x2d')](saveUpdates(_0x5ee5a5['body'],null))[_0x6e70('0x2d')](respondWithResult(_0x43cc26,null))[_0x6e70('0x3f')](handleError(_0x43cc26,null));};exports['destroy']=function(_0x30acfb,_0x540362){return db[_0x6e70('0x39')][_0x6e70('0x65')]({'where':{'id':_0x30acfb[_0x6e70('0xbb')]['id']}})[_0x6e70('0x2d')](handleEntityNotFound(_0x540362,null))[_0x6e70('0x2d')](removeEntity(_0x540362,null))[_0x6e70('0x3f')](handleError(_0x540362,null));};exports[_0x6e70('0xbc')]=function(_0x534ffb,_0x4e7a56){return db[_0x6e70('0x39')]['describe']()[_0x6e70('0x2d')](respondWithResult(_0x4e7a56,null))[_0x6e70('0x3f')](handleError(_0x4e7a56,null));};exports['addMessage']=function(_0x31efea,_0x1dce0b,_0x43c0a7){return db['MailMessage'][_0x6e70('0x65')]({'where':{'id':_0x31efea[_0x6e70('0xbb')]['id']}})[_0x6e70('0x2d')](handleEntityNotFound(_0x1dce0b,null))[_0x6e70('0x2d')](function(_0x628ec9){if(_0x628ec9){return _0x628ec9[_0x6e70('0xbd')](_0x31efea[_0x6e70('0xba')][_0x6e70('0xbe')],_[_0x6e70('0xbf')](_0x31efea[_0x6e70('0xba')],[_0x6e70('0xbe'),'id'])||{});}})[_0x6e70('0x2d')](respondWithResult(_0x1dce0b,null))[_0x6e70('0x3f')](handleError(_0x1dce0b,null));};exports['getMessages']=function(_0x306b4d,_0x33ad49,_0x267b85){var _0x349691={'raw':![],'where':{}};var _0xbf2eb8={};var _0x4a37f8={'count':0x0,'rows':[]};return db[_0x6e70('0x39')][_0x6e70('0x3a')]({'where':{'id':_0x306b4d[_0x6e70('0xbb')]['id']}})['then'](handleEntityNotFound(_0x33ad49,null))[_0x6e70('0x2d')](function(_0x5f12d3){if(_0x5f12d3){_0xbf2eb8['model']=_[_0x6e70('0x45')](db[_0x6e70('0xc0')][_0x6e70('0x40')]);_0xbf2eb8[_0x6e70('0x46')]=_['keys'](_0x306b4d[_0x6e70('0x46')]);_0xbf2eb8[_0x6e70('0x47')]=_['intersection'](_0xbf2eb8['model'],_0xbf2eb8['query']);_0x349691[_0x6e70('0x49')]=_[_0x6e70('0x48')](_0xbf2eb8[_0x6e70('0x44')],qs[_0x6e70('0x4a')](_0x306b4d[_0x6e70('0x46')][_0x6e70('0x4a')]));_0x349691[_0x6e70('0x49')]=_0x349691['attributes'][_0x6e70('0x4b')]?_0x349691[_0x6e70('0x49')]:_0xbf2eb8[_0x6e70('0x44')];if(!_0x306b4d[_0x6e70('0x46')][_0x6e70('0x4c')](_0x6e70('0xc1'))){_0x349691[_0x6e70('0x25')]=qs[_0x6e70('0x25')](_0x306b4d[_0x6e70('0x46')][_0x6e70('0x25')]);_0x349691[_0x6e70('0x24')]=qs[_0x6e70('0x24')](_0x306b4d['query'][_0x6e70('0x24')]);}_0x349691[_0x6e70('0x93')]=qs[_0x6e70('0x4d')](_0x306b4d['query'][_0x6e70('0x4d')]);_0x349691[_0x6e70('0x4e')]=qs[_0x6e70('0x47')](_[_0x6e70('0x4f')](_0x306b4d[_0x6e70('0x46')],_0xbf2eb8[_0x6e70('0x47')]));_0x349691['where']['MailInteractionId']=_0x5f12d3['id'];if(_0x306b4d[_0x6e70('0x46')][_0x6e70('0x77')]){_0x349691[_0x6e70('0x4e')]=_[_0x6e70('0x97')](_0x349691[_0x6e70('0x4e')],{'$or':_[_0x6e70('0x33')](_0x349691['attributes'],function(_0x3df7bd){var _0xdaad1a={};_0xdaad1a[_0x3df7bd]={'$like':'%'+_0x306b4d[_0x6e70('0x46')][_0x6e70('0x77')]+'%'};return _0xdaad1a;})});}if(_0x306b4d[_0x6e70('0x46')][_0x6e70('0xc2')]){var _0x3d0234=_0x306b4d[_0x6e70('0x46')][_0x6e70('0xc2')][_0x6e70('0x35')](',');var _0xd2d74f={};_0xd2d74f[_0x3d0234[0x0]]={'$gte':moment(_0x3d0234[0x1])[_0x6e70('0xc3')](_0x6e70('0xc4'))};_0x349691[_0x6e70('0x4e')]=_[_0x6e70('0x97')](_0x349691[_0x6e70('0x4e')],_0xd2d74f);}_0x349691=_[_0x6e70('0x97')]({},_0x349691,_0x306b4d['options']);return db['MailMessage'][_0x6e70('0x23')]({'where':_0x349691[_0x6e70('0x4e')]})[_0x6e70('0x2d')](function(_0x25550d){_0x4a37f8[_0x6e70('0x23')]=_0x25550d;if(_0x306b4d[_0x6e70('0x46')]['includeAll']){_0x349691[_0x6e70('0xb7')]=[{'all':!![]}];}return db['MailMessage'][_0x6e70('0xc5')](_0x349691);})['then'](function(_0x2f2b92){_0x4a37f8['rows']=_0x2f2b92;return _0x4a37f8;});}})[_0x6e70('0x2d')](respondWithFilteredResult(_0x33ad49,_0x349691))[_0x6e70('0x3f')](handleError(_0x33ad49,null));};exports[_0x6e70('0xc6')]=function(_0x49f93f,_0x3e9cf7,_0x21209e){return db[_0x6e70('0x39')][_0x6e70('0x65')]({'where':{'id':_0x49f93f[_0x6e70('0xbb')]['id']}})[_0x6e70('0x2d')](handleEntityNotFound(_0x3e9cf7,null))[_0x6e70('0x2d')](function(_0x5002ba){if(_0x5002ba){return _0x5002ba[_0x6e70('0xc7')](_0x49f93f[_0x6e70('0xba')]['ids'],_[_0x6e70('0xbf')](_0x49f93f[_0x6e70('0xba')],['ids','id'])||{})['spread'](function(){return db[_0x6e70('0x73')]['findAll']({'attributes':['id',_0x6e70('0x31'),_0x6e70('0x52')],'where':{'id':_0x49f93f[_0x6e70('0xba')][_0x6e70('0xbe')]}});})[_0x6e70('0x2d')](function(_0x87a870){socket[_0x6e70('0xc8')](_0x6e70('0xc9'),{'id':Number(_0x49f93f[_0x6e70('0xbb')]['id']),'tags':_0x87a870||[]});return{'id':Number(_0x49f93f[_0x6e70('0xbb')]['id']),'tags':_0x87a870||[]};});}})[_0x6e70('0x2d')](respondWithResult(_0x3e9cf7,null))[_0x6e70('0x3f')](handleError(_0x3e9cf7,null));};exports[_0x6e70('0xca')]=function(_0x507750,_0x3d64dc,_0x3fb786){return db[_0x6e70('0x39')][_0x6e70('0x65')]({'where':{'id':_0x507750[_0x6e70('0xbb')]['id']}})[_0x6e70('0x2d')](handleEntityNotFound(_0x3d64dc,null))[_0x6e70('0x2d')](function(_0xac161){if(_0xac161){return _0xac161[_0x6e70('0xca')](_0x507750['query'][_0x6e70('0xbe')]);}})[_0x6e70('0x2d')](respondWithStatusCode(_0x3d64dc,null))[_0x6e70('0x3f')](handleError(_0x3d64dc,null));};exports['download']=function(_0x88522,_0x382b3e){var _0x6af2b1=moment()[_0x6e70('0xcb')]()['toString']();var _0x52bacf=path[_0x6e70('0x8b')](config['root'],'server',_0x6e70('0xcc'),_0x6e70('0xcd'));var _0x35e606=path[_0x6e70('0x8b')](config[_0x6e70('0xce')],_0x6e70('0xcf'),_0x6e70('0xcc'),_0x6e70('0xd0'));var _0x20fe70=path[_0x6e70('0x8b')](_0x35e606,_0x6af2b1);var _0x484806=util[_0x6e70('0xc3')](_0x6e70('0xd1'),_0x6af2b1);var _0xad1b46=path[_0x6e70('0x8b')](_0x35e606,_0x484806);var _0x2d1fcb=![];return db[_0x6e70('0x39')][_0x6e70('0x65')]({'where':{'id':_0x88522[_0x6e70('0xbb')]['id']}})[_0x6e70('0x2d')](handleEntityNotFound(_0x382b3e,null))[_0x6e70('0x2d')](function(_0x4fcbd8){if(_0x4fcbd8){return _0x4fcbd8['getMessages']({'attributes':['id','body','from','to','cc',_0x6e70('0xd2'),_0x6e70('0xd3'),_0x6e70('0x7b')],'where':{'secret':![]},'include':_0x88522['query'][_0x6e70('0xcd')]?[{'model':db['Attachment'],'as':_0x6e70('0xd4')}]:undefined,'order':qs['sort']('id')});}return[];})['then'](function(_0xe4b9f8){_0x2d1fcb=_0xe4b9f8[_0x6e70('0x4b')];if(_0xe4b9f8[_0x6e70('0x4b')]){fs[_0x6e70('0xd5')](_0x20fe70);return BPromise[_0x6e70('0xd6')](_0xe4b9f8,function(_0x12d9b3,_0x2cfb23){var _0x5b94a8=_0x12d9b3;var _0x2ec683={'from':_0x5b94a8[_0x6e70('0x53')],'to':_0x5b94a8['to'],'subject':_0x5b94a8['subject'],'html':_0x5b94a8[_0x6e70('0xba')],'headers':{'Date':moment(_0x5b94a8[_0x6e70('0x7b')])[_0x6e70('0xc3')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x12d9b3['cc']){_0x2ec683[_0x6e70('0xd7')]['Cc']=_0x12d9b3['cc'];}if(_0x12d9b3[_0x6e70('0xd2')]){_0x2ec683['headers']['Bcc']=_0x12d9b3[_0x6e70('0xd2')];}return new BPromise(function(_0x303ae3,_0x747523){if(_0x12d9b3[_0x6e70('0xd4')]){for(var _0x2943a6=0x0;_0x2943a6<_0x12d9b3['Attachments']['length'];_0x2943a6++){var _0x35235c=_0x12d9b3[_0x6e70('0xd4')][_0x2943a6];var _0x472231=path['join'](_0x52bacf,_0x35235c[_0x6e70('0xd8')]);if(fs[_0x6e70('0xd9')](_0x472231)){_0x2ec683[_0x6e70('0xcd')][_0x6e70('0x37')]({'name':_0x35235c[_0x6e70('0x31')],'contentType':_0x35235c[_0x6e70('0x42')],'data':fs[_0x6e70('0xda')](_0x472231)});}}}emlformat[_0x6e70('0xdb')](_0x2ec683,function(_0x4679bb,_0x297ebe){if(_0x4679bb)return _0x747523(_0x4679bb);fs['writeFileSync'](path[_0x6e70('0x8b')](_0x20fe70,util[_0x6e70('0xc3')](_0x6e70('0xdc'),_0x2cfb23)),_0x297ebe);return _0x303ae3(_0x297ebe);});});});}})[_0x6e70('0x2d')](function(){if(_0x2d1fcb){return new BPromise(function(_0x4fddf5,_0x7ffbdf){zipdir(_0x20fe70,{'saveTo':_0xad1b46},function(_0x1eb2ae,_0x13c15f){if(_0x1eb2ae)return _0x7ffbdf(_0x1eb2ae);return _0x4fddf5(_0x13c15f);});});}})['then'](function(){if(_0x2d1fcb){return new BPromise(function(_0x3fbae3,_0x20b50d){rimraf(_0x20fe70,function(_0x29da89){if(_0x29da89)_0x20b50d(_0x29da89);return _0x3fbae3();});});}})[_0x6e70('0x2d')](function(){if(_0x2d1fcb){return _0x382b3e['download'](_0xad1b46,_0x484806,function(_0x26491f){if(_0x26491f){console[_0x6e70('0xdd')](_0x6e70('0xde'),_0x26491f);}else{fs[_0x6e70('0xdf')](_0xad1b46);}});}else{return _0x382b3e[_0x6e70('0x21')](0xc8);}})[_0x6e70('0x3f')](handleError(_0x382b3e,null));}; \ No newline at end of file +var _0xe1e8=['Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','value','ContactId','buildExpression','type','text','start','end','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','some','compact','isEmpty','i.MailAccountId\x20IN\x20?','parse','$gte','$lte','where','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','\x27\x27\x27\x27','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','toString','join','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','QueryTypes','SELECT','clone','i.id','DESC','t.id\x20IN\x20?','sequelize','keyBy','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgDirection','i.subject','i.disposition','i.to','i.MailAccountId','i.UserId','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','GROUP_CONCAT(DISTINCT\x20t.id)','enableEmailPreview','all','rows','show','params','rawAttributes','includeAll','include','merge','options','create','body','describe','MailMessage','addMessage','ids','omit','getMessages','MailInteractionId','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','spread','emit','mailInteractionTags:save','removeTags','download','root','server','files','tmp','interaction-%s.zip','bcc','subject','createdAt','attachments','Attachment','Attachments','each','format','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','readFileSync','build','writeFileSync','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','Users','TagIds','Tags','split','forEach','push','findOne','lastMsgText','trimStart','fromString','lastMsgBody','catch','index','MailInteraction','fieldName','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','select','field','color','from','ui.MailInteractionId','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','parseSearch','search','sqlOperator','conditions','find','having','`\x20=\x200','`\x20>\x200'];(function(_0x373509,_0x46afb7){var _0x50b0aa=function(_0x1f45b8){while(--_0x1f45b8){_0x373509['push'](_0x373509['shift']());}};_0x50b0aa(++_0x46afb7);}(_0xe1e8,0x162));var _0x8e1e=function(_0x18e1bc,_0x2cdc3e){_0x18e1bc=_0x18e1bc-0x0;var _0x481f56=_0xe1e8[_0x18e1bc];return _0x481f56;};'use strict';var pdf=require(_0x8e1e('0x0'));var emlformat=require(_0x8e1e('0x1'));var rimraf=require(_0x8e1e('0x2'));var zipdir=require(_0x8e1e('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8e1e('0x4'));var moment=require(_0x8e1e('0x5'));var BPromise=require(_0x8e1e('0x6'));var Mustache=require('mustache');var util=require(_0x8e1e('0x7'));var path=require(_0x8e1e('0x8'));var sox=require(_0x8e1e('0x9'));var csv=require(_0x8e1e('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x8e1e('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x8e1e('0xc'));var toCsv=require(_0x8e1e('0xa'));var querystring=require(_0x8e1e('0xd'));var Papa=require('papaparse');var htmlToText=require('html-to-text');var Redis=require(_0x8e1e('0xe'));var authService=require(_0x8e1e('0xf'));var qs=require(_0x8e1e('0x10'));var as=require(_0x8e1e('0x11'));var hardwareService=require(_0x8e1e('0x12'));var logger=require(_0x8e1e('0x13'))(_0x8e1e('0x14'));var utils=require('../../config/utils');var config=require(_0x8e1e('0x15'));var db=require('../../mysqldb')['db'];config[_0x8e1e('0x16')]=_[_0x8e1e('0x17')](config[_0x8e1e('0x16')],{'host':_0x8e1e('0x18'),'port':0x18eb});var socket=require(_0x8e1e('0x19'))(new Redis(config[_0x8e1e('0x16')]));require(_0x8e1e('0x1a'))[_0x8e1e('0x1b')](socket);function respondWithStatusCode(_0x4361fa,_0x426abb){_0x426abb=_0x426abb||0xcc;return function(_0x37f66b){if(_0x37f66b){return _0x4361fa['sendStatus'](_0x426abb);}return _0x4361fa[_0x8e1e('0x1c')](_0x426abb)['end']();};}function respondWithResult(_0x591366,_0x2487ad){_0x2487ad=_0x2487ad||0xc8;return function(_0x1ce138){if(_0x1ce138){return _0x591366[_0x8e1e('0x1c')](_0x2487ad)[_0x8e1e('0x1d')](_0x1ce138);}};}function respondWithFilteredResult(_0x1085d5,_0x37f23f){return function(_0x11e1da){if(_0x11e1da){var _0x2ef094=_0x11e1da[_0x8e1e('0x1e')],_0x181322=_0x37f23f['offset'],_0x685ca8=_0x37f23f[_0x8e1e('0x1f')]+_0x37f23f[_0x8e1e('0x20')],_0x780073;if(_0x685ca8>=_0x2ef094){_0x685ca8=_0x2ef094;_0x780073=0xc8;}else{_0x780073=0xce;}_0x1085d5[_0x8e1e('0x1c')](_0x780073);return _0x1085d5[_0x8e1e('0x21')](_0x8e1e('0x22'),_0x181322+'-'+_0x685ca8+'/'+_0x2ef094)[_0x8e1e('0x1d')](_0x11e1da);}return null;};}function patchUpdates(_0x5c6004){return function(_0x16c951){try{jsonpatch[_0x8e1e('0x23')](_0x16c951,_0x5c6004,!![]);}catch(_0x204fd0){return BPromise[_0x8e1e('0x24')](_0x204fd0);}return _0x16c951[_0x8e1e('0x25')]();};}function saveUpdates(_0x59e304,_0x182b62){return function(_0x58b212){if(_0x58b212){return _0x58b212[_0x8e1e('0x26')](_0x59e304)['then'](function(_0x166943){return _0x166943;});}return null;};}function removeEntity(_0x109e63,_0x10f73f){return function(_0x3e5c98){if(_0x3e5c98){return _0x3e5c98[_0x8e1e('0x27')]()[_0x8e1e('0x28')](function(){_0x109e63[_0x8e1e('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x482a46,_0x466b97){return function(_0x1a9ca7){if(!_0x1a9ca7){_0x482a46[_0x8e1e('0x29')](0x194);}return _0x1a9ca7;};}function handleError(_0x2fd096,_0x3fda5e){_0x3fda5e=_0x3fda5e||0x1f4;return function(_0x39252f){logger[_0x8e1e('0x2a')](_0x39252f[_0x8e1e('0x2b')]);if(_0x39252f[_0x8e1e('0x2c')]){delete _0x39252f[_0x8e1e('0x2c')];}_0x2fd096[_0x8e1e('0x1c')](_0x3fda5e)[_0x8e1e('0x2d')](_0x39252f);};}function getInteractionUsers(_0x41737e,_0x4b1e5f){return new BPromise(function(_0x3a1c3d,_0x49b34e){try{if(_0x4b1e5f[_0x41737e['id']]){_0x41737e[_0x8e1e('0x2e')]=_['map'](_0x4b1e5f[_0x41737e['id']],function(_0x370f4e){return{'id':_0x370f4e['id']};});}}catch(_0x8a086d){_0x49b34e(_0x8a086d);}_0x3a1c3d(_0x41737e);});}function getInteractionTags(_0x330971,_0x446648){return new BPromise(function(_0x3d1271,_0x1eb248){try{if(_0x330971[_0x8e1e('0x2f')]){_0x330971[_0x8e1e('0x30')]=[];_0x330971[_0x8e1e('0x2f')][_0x8e1e('0x31')](',')[_0x8e1e('0x32')](function(_0x46e19c){_0x330971[_0x8e1e('0x30')][_0x8e1e('0x33')](_0x446648[_0x46e19c]);});}delete _0x330971[_0x8e1e('0x2f')];}catch(_0x4e4d43){_0x1eb248(_0x4e4d43);}_0x3d1271(_0x330971);});}function getLastMessageText(_0x315f71){return new BPromise(function(_0x5f4cc7,_0x49ae77){return db['MailInteraction'][_0x8e1e('0x34')]({'where':{'id':_0x315f71['id']},'attributes':['lastMsgBody',_0x8e1e('0x35')],'raw':!![]})[_0x8e1e('0x28')](function(_0x32fa4a){if(!_0x32fa4a[_0x8e1e('0x35')]){_0x315f71[_0x8e1e('0x35')]=_[_0x8e1e('0x36')](htmlToText[_0x8e1e('0x37')](_0x32fa4a[_0x8e1e('0x38')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]}));}else{_0x315f71['lastMsgText']=_0x32fa4a['lastMsgText'];}_0x5f4cc7(_0x315f71);})[_0x8e1e('0x39')](function(_0x571e3d){_0x49ae77(_0x571e3d);});});}function updateMailInteraction(_0xc0b6d2,_0xb256ab,_0xd22725,_0x10b649){return new BPromise(function(_0x2f129e,_0x7df26f){return getInteractionUsers(_0xc0b6d2,_0xd22725)[_0x8e1e('0x28')](function(_0x4ef4b5){return getInteractionTags(_0x4ef4b5,_0xb256ab);})[_0x8e1e('0x28')](function(_0x4f3e05){if(_0x10b649){_0x2f129e(getLastMessageText(_0x4f3e05));}else{_0x2f129e(_0x4f3e05);}})['catch'](function(_0x559a89){_0x7df26f(_0x559a89);});});}exports[_0x8e1e('0x3a')]=function(_0x1a0196,_0x49efb5){var _0x56adbc={},_0xc19edd={},_0x24c7e2={'count':0x0,'rows':[]};var _0x5a1f6f=_['map'](db[_0x8e1e('0x3b')]['rawAttributes'],function(_0x4a511d){return{'name':_0x4a511d[_0x8e1e('0x3c')],'type':_0x4a511d['type'][_0x8e1e('0x3d')]};});_0xc19edd[_0x8e1e('0x3e')]=_[_0x8e1e('0x3f')](_0x5a1f6f,_0x8e1e('0x2c'));_0xc19edd[_0x8e1e('0x40')]=_[_0x8e1e('0x41')](_0x1a0196[_0x8e1e('0x40')]);_0xc19edd[_0x8e1e('0x42')]=_['intersection'](_0xc19edd[_0x8e1e('0x3e')],_0xc19edd[_0x8e1e('0x40')]);_0x56adbc[_0x8e1e('0x43')]=_[_0x8e1e('0x44')](_0xc19edd[_0x8e1e('0x3e')],qs[_0x8e1e('0x45')](_0x1a0196[_0x8e1e('0x40')]['fields']));_0x56adbc[_0x8e1e('0x43')]=_0x56adbc[_0x8e1e('0x43')][_0x8e1e('0x46')]?_0x56adbc['attributes']:_0xc19edd[_0x8e1e('0x3e')];if(!_0x1a0196[_0x8e1e('0x40')][_0x8e1e('0x47')]('nolimit')){_0x56adbc[_0x8e1e('0x20')]=qs[_0x8e1e('0x20')](_0x1a0196[_0x8e1e('0x40')][_0x8e1e('0x20')]);_0x56adbc[_0x8e1e('0x1f')]=qs['offset'](_0x1a0196['query'][_0x8e1e('0x1f')]);}_0x56adbc[_0x8e1e('0x48')]=qs[_0x8e1e('0x49')](_0x1a0196[_0x8e1e('0x40')][_0x8e1e('0x49')]);_0x56adbc['where']=qs[_0x8e1e('0x42')](_[_0x8e1e('0x4a')](_0x1a0196[_0x8e1e('0x40')],_0xc19edd['filters']));var _0x359eb4=[];var _0x3cf774=squel[_0x8e1e('0x4b')]()['field']('id')[_0x8e1e('0x4c')](_0x8e1e('0x2c'))['field'](_0x8e1e('0x4d'))[_0x8e1e('0x4e')]('tools_tags');var _0x573f56=squel[_0x8e1e('0x4b')]()['field']('u.id')[_0x8e1e('0x4c')](_0x8e1e('0x4f'))[_0x8e1e('0x4e')](_0x8e1e('0x50'),'ui')[_0x8e1e('0x51')](_0x8e1e('0x52'),'u',_0x8e1e('0x53'));var _0xf4bf91=squel[_0x8e1e('0x4b')]()['from'](_0x8e1e('0x54'),'i')[_0x8e1e('0x51')]('cm_contacts','c',_0x8e1e('0x55'))[_0x8e1e('0x51')]('users','o','o.id\x20=\x20i.UserId')[_0x8e1e('0x51')](_0x8e1e('0x56'),'a',_0x8e1e('0x57'))[_0x8e1e('0x51')]('mail_messages','me','me.MailInteractionId\x20=\x20i.id')[_0x8e1e('0x51')](_0x8e1e('0x58'),'it',_0x8e1e('0x59'))[_0x8e1e('0x51')](_0x8e1e('0x5a'),'t',_0x8e1e('0x5b'));var _0x40f2ae=squel['expr']();var _0x7d9345=[];var _0xec170c=squel['expr']();if(_0x1a0196[_0x8e1e('0x40')]['search']){var _0x56d1d3=as[_0x8e1e('0x5c')](_0x1a0196[_0x8e1e('0x40')][_0x8e1e('0x5d')]);var _0x5f1134=_0x56d1d3[_0x8e1e('0x5e')];for(var _0x4f8274=0x0;_0x4f8274<_0x56d1d3[_0x8e1e('0x5f')][_0x8e1e('0x46')];_0x4f8274++){var _0x1dba02=_0x56d1d3[_0x8e1e('0x5f')][_0x4f8274];var _0xef5980='i';var _0x49ae64=_[_0x8e1e('0x60')](_0x5a1f6f,[_0x8e1e('0x2c'),_0x1dba02['field']]);if(!_0x49ae64){switch(_0x1dba02[_0x8e1e('0x4c')]){case'unreadMessages':if(_0x1dba02['value']==0x1){_0xf4bf91[_0x8e1e('0x61')]('`'+_0x1dba02[_0x8e1e('0x4c')]+_0x8e1e('0x62'));}else{_0xf4bf91[_0x8e1e('0x61')]('`'+_0x1dba02['field']+_0x8e1e('0x63'));}break;case _0x8e1e('0x64'):if(_0x1dba02[_0x8e1e('0x65')]===_0x8e1e('0x66')){_0x40f2ae[_0x5f1134](_0x8e1e('0x67'),_0x1dba02[_0x8e1e('0x68')],null);}else{_0x49ae64=_[_0x8e1e('0x60')](_0x5a1f6f,[_0x8e1e('0x2c'),_0x8e1e('0x69')]);_0x1dba02['field']=_0x8e1e('0x69');_0x419a72=as[_0x8e1e('0x6a')](_0xef5980,_0x49ae64[_0x8e1e('0x6b')],_0x1dba02);_0x40f2ae[_0x5f1134](_0x419a72[_0x8e1e('0x6c')],_0x419a72[_0x8e1e('0x68')][_0x8e1e('0x6d')],_0x419a72['value'][_0x8e1e('0x6e')]);}break;case _0x8e1e('0x6f'):var _0x3994a4=_0x1dba02['value']['split'](',')['map'](function(_0x5d955d){return Number(_0x5d955d);});_0x3994a4[_0x8e1e('0x32')](function(_0x577903){_0xec170c['or'](_0x8e1e('0x70'),'%,'+_0x577903+',%');});_0x7d9345=_[_0x8e1e('0x71')](_0x7d9345,_0x3994a4);break;case _0x8e1e('0x72'):if(_0x1dba02[_0x8e1e('0x65')]===_0x8e1e('0x66')){_0x40f2ae[_0x5f1134](_0x8e1e('0x73'),'%'+_0x1dba02[_0x8e1e('0x68')]+'%',null);}else{_0x49ae64=_[_0x8e1e('0x60')](_0x5a1f6f,[_0x8e1e('0x2c'),_0x8e1e('0x74')]);_0x1dba02[_0x8e1e('0x4c')]=_0x8e1e('0x74');_0x419a72=as['buildExpression'](_0xef5980,_0x49ae64[_0x8e1e('0x6b')],_0x1dba02);_0x40f2ae[_0x5f1134](_0x419a72['text'],_0x419a72['value'][_0x8e1e('0x6d')],_0x419a72['value'][_0x8e1e('0x6e')]);}break;}}else{var _0x419a72=as['buildExpression'](_0xef5980,_0x49ae64[_0x8e1e('0x6b')],_0x1dba02);_0x40f2ae[_0x5f1134](_0x419a72[_0x8e1e('0x6c')],_0x419a72[_0x8e1e('0x68')][_0x8e1e('0x6d')],_0x419a72['value'][_0x8e1e('0x6e')]);}}}else{var _0x4abc59=_(_0x1a0196[_0x8e1e('0x40')])[_0x8e1e('0x41')]()['map'](function(_0x1d68ec){return _[_0x8e1e('0x75')](_0x5a1f6f,[_0x8e1e('0x2c'),_0x1d68ec])?_0x1d68ec:undefined;})[_0x8e1e('0x76')]()[_0x8e1e('0x68')]();if(!_[_0x8e1e('0x77')](_0x4abc59)){_0x4abc59[_0x8e1e('0x32')](function(_0x2e2e5b){if(_0x2e2e5b==='MailAccountId'){_0xf4bf91['where'](_0x8e1e('0x78'),[]['concat'](_0x1a0196['query'][_0x2e2e5b]));}else if(_0x2e2e5b==='createdAt'){var _0x106c40=JSON[_0x8e1e('0x79')](_0x1a0196[_0x8e1e('0x40')][_0x2e2e5b])[_0x8e1e('0x7a')];var _0x581135=JSON[_0x8e1e('0x79')](_0x1a0196['query'][_0x2e2e5b])[_0x8e1e('0x7b')];_0xf4bf91[_0x8e1e('0x7c')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x106c40,_0x581135);}else{if(_0x1a0196['query'][_0x2e2e5b]===_0x8e1e('0x7d')){_0xf4bf91[_0x8e1e('0x7c')]('i.'+_0x2e2e5b+_0x8e1e('0x7e'));}else{_0xf4bf91[_0x8e1e('0x7c')]('i.'+_0x2e2e5b+_0x8e1e('0x7f'),_0x1a0196[_0x8e1e('0x40')][_0x2e2e5b]);}}});}if(_0x1a0196[_0x8e1e('0x40')][_0x8e1e('0x80')]){if(_0x1a0196['query'][_0x8e1e('0x80')]==0x1){_0xf4bf91[_0x8e1e('0x61')](_0x8e1e('0x81'));}else{_0xf4bf91[_0x8e1e('0x61')](_0x8e1e('0x82'));}}if(_0x1a0196['query'][_0x8e1e('0x83')]){_0x7d9345=_[_0x8e1e('0x84')](_0x1a0196[_0x8e1e('0x40')][_0x8e1e('0x83')])?_0x1a0196[_0x8e1e('0x40')][_0x8e1e('0x83')]:new Array(_0x1a0196['query'][_0x8e1e('0x83')]);_0x7d9345[_0x8e1e('0x32')](function(_0x364537){_0xec170c['or'](_0x8e1e('0x70'),'%,'+_0x364537+',%');});}if(_0x1a0196[_0x8e1e('0x40')][_0x8e1e('0x85')]){var _0xa7e7f5=_0x1a0196[_0x8e1e('0x40')]['filter']['replace']('\x5c','\x5c\x5c')[_0x8e1e('0x86')]('\x27\x27',_0x8e1e('0x87'));if(qs['isNumeric'](_0xa7e7f5)){_0x40f2ae['or'](_0x8e1e('0x88'),_0xa7e7f5+'%');}else if(qs[_0x8e1e('0x89')](_0xa7e7f5)){_0x40f2ae['or'](_0x8e1e('0x8a'),_0xa7e7f5+'%');}else{var _0x4ecd8e=[];_0xa7e7f5['split']('\x20')[_0x8e1e('0x32')](function(_0x3032f0){_0x4ecd8e['push']('+'+_0x3032f0[_0x8e1e('0x8b')]());});var _0x25a09e=_0x4ecd8e[_0x8e1e('0x8c')]('\x20');_0x40f2ae['or'](_0x8e1e('0x8d'),_0x25a09e)['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',_0x25a09e);}}}_0xf4bf91['where'](_0x40f2ae);_0xf4bf91[_0x8e1e('0x8e')]('i.id');var _0x2e1163={'type':db['Sequelize'][_0x8e1e('0x8f')][_0x8e1e('0x90')],'raw':!![]};var _0x2974f9=_0xf4bf91[_0x8e1e('0x91')]();_0x2974f9[_0x8e1e('0x4c')](_0x8e1e('0x92'));_0x2974f9[_0x8e1e('0x4c')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x56adbc[_0x8e1e('0x48')]){_0x56adbc[_0x8e1e('0x48')][_0x8e1e('0x32')](function(_0x545a36){_0xf4bf91['order']('i.'+_0x545a36[0x0],_0x545a36[0x1]===_0x8e1e('0x93')?![]:!![]);});}if(!_[_0x8e1e('0x77')](_0x7d9345)){_0xf4bf91[_0x8e1e('0x61')](_0xec170c);_0x2974f9[_0x8e1e('0x7c')](_0x8e1e('0x94'),_0x7d9345);}db['sequelize'][_0x8e1e('0x40')](_0x2974f9[_0x8e1e('0x8b')](),_0x2e1163)[_0x8e1e('0x28')](function(_0x454bc1){_0x24c7e2[_0x8e1e('0x1e')]=_0x454bc1[_0x8e1e('0x46')];if(_0x24c7e2[_0x8e1e('0x1e')]===0x0)return[];return db[_0x8e1e('0x95')]['query'](_0x3cf774[_0x8e1e('0x8b')](),_0x2e1163)[_0x8e1e('0x28')](function(_0x5be5da){_0x359eb4=_[_0x8e1e('0x96')](_0x5be5da,'id');_0x2e1163=_['merge'](_0x2e1163,{'model':db[_0x8e1e('0x3b')],'mapToModel':!![],'raw':!![],'nest':!![]});_0xf4bf91[_0x8e1e('0x4c')](_0x8e1e('0x97'),_0x8e1e('0x98'));_0xf4bf91['field'](_0x8e1e('0x99'),_0x8e1e('0x9a'));_0xf4bf91[_0x8e1e('0x4c')](_0x8e1e('0x9b'),_0x8e1e('0x9c'));_0xf4bf91['field'](_0x8e1e('0x92'));_0xf4bf91[_0x8e1e('0x4c')]('i.createdAt');_0xf4bf91[_0x8e1e('0x4c')](_0x8e1e('0x9d'));_0xf4bf91['field'](_0x8e1e('0x9e'));_0xf4bf91[_0x8e1e('0x4c')](_0x8e1e('0x9f'));_0xf4bf91[_0x8e1e('0x4c')](_0x8e1e('0xa0'));_0xf4bf91[_0x8e1e('0x4c')]('i.lastMsgAt');_0xf4bf91['field'](_0x8e1e('0xa1'));_0xf4bf91[_0x8e1e('0x4c')](_0x8e1e('0xa2'));_0xf4bf91[_0x8e1e('0x4c')](_0x8e1e('0xa3'));_0xf4bf91['field']('i.substatus');_0xf4bf91[_0x8e1e('0x4c')](_0x8e1e('0xa4'));_0xf4bf91[_0x8e1e('0x4c')]('i.ContactId');_0xf4bf91[_0x8e1e('0x4c')](_0x8e1e('0xa5'));_0xf4bf91[_0x8e1e('0x4c')](_0x8e1e('0xa6'));_0xf4bf91[_0x8e1e('0x4c')](_0x8e1e('0xa7'),_0x8e1e('0xa8'));_0xf4bf91[_0x8e1e('0x4c')](_0x8e1e('0xa9'),_0x8e1e('0xaa'));_0xf4bf91[_0x8e1e('0x4c')](_0x8e1e('0xab'),_0x8e1e('0xac'));_0xf4bf91[_0x8e1e('0x4c')](_0x8e1e('0xad'),_0x8e1e('0xae'));_0xf4bf91[_0x8e1e('0x4c')]('c.mobile',_0x8e1e('0xaf'));_0xf4bf91[_0x8e1e('0x4c')](_0x8e1e('0xb0'),'Contact.fax');_0xf4bf91[_0x8e1e('0x4c')](_0x8e1e('0xb1'),_0x8e1e('0x2f'));_0xf4bf91[_0x8e1e('0x20')](_0x56adbc['limit']);_0xf4bf91[_0x8e1e('0x1f')](_0x56adbc[_0x8e1e('0x1f')]);return db['sequelize'][_0x8e1e('0x40')](_0xf4bf91['toString'](),_0x2e1163);})['then'](function(_0x32ec1e){_0x573f56[_0x8e1e('0x7c')]('ui.MailInteractionId\x20IN\x20?',_['map'](_0x32ec1e,'id'));return db[_0x8e1e('0x95')][_0x8e1e('0x40')](_0x573f56[_0x8e1e('0x8b')](),_0x2e1163)[_0x8e1e('0x28')](function(_0x3589f8){var _0x1842d5=_['groupBy'](_0x3589f8,'MailInteractionId');var _0x585cd4=[];return db['Setting'][_0x8e1e('0x34')]({'attributes':[_0x8e1e('0xb2')],'raw':!![]})['then'](function(_0x5dfb83){var _0x515876=_0x5dfb83[_0x8e1e('0xb2')];_0x32ec1e[_0x8e1e('0x32')](function(_0x3631d){_0x585cd4[_0x8e1e('0x33')](updateMailInteraction(_0x3631d,_0x359eb4,_0x1842d5,_0x515876));});return BPromise[_0x8e1e('0xb3')](_0x585cd4);});});});})[_0x8e1e('0x28')](function(_0x128ab2){_0x24c7e2[_0x8e1e('0xb4')]=_0x128ab2;return _0x24c7e2;})['then'](respondWithFilteredResult(_0x49efb5,_0x56adbc))[_0x8e1e('0x39')](handleError(_0x49efb5,null));};exports[_0x8e1e('0xb5')]=function(_0x3b09c6,_0x1540a1){var _0x25fb9c={'raw':![],'where':{'id':_0x3b09c6[_0x8e1e('0xb6')]['id']}},_0x22d985={};_0x22d985[_0x8e1e('0x3e')]=_[_0x8e1e('0x41')](db[_0x8e1e('0x3b')][_0x8e1e('0xb7')]);_0x22d985[_0x8e1e('0x40')]=_[_0x8e1e('0x41')](_0x3b09c6['query']);_0x22d985[_0x8e1e('0x42')]=_[_0x8e1e('0x44')](_0x22d985[_0x8e1e('0x3e')],_0x22d985['query']);_0x25fb9c[_0x8e1e('0x43')]=_[_0x8e1e('0x44')](_0x22d985['model'],qs['fields'](_0x3b09c6['query'][_0x8e1e('0x45')]));_0x25fb9c[_0x8e1e('0x43')]=_0x25fb9c[_0x8e1e('0x43')][_0x8e1e('0x46')]?_0x25fb9c[_0x8e1e('0x43')]:_0x22d985[_0x8e1e('0x3e')];if(_0x3b09c6[_0x8e1e('0x40')][_0x8e1e('0xb8')]){_0x25fb9c[_0x8e1e('0xb9')]=[{'all':!![]}];}_0x25fb9c=_[_0x8e1e('0xba')]({},_0x25fb9c,_0x3b09c6[_0x8e1e('0xbb')]);return db[_0x8e1e('0x3b')][_0x8e1e('0x60')](_0x25fb9c)['then'](handleEntityNotFound(_0x1540a1,null))[_0x8e1e('0x28')](respondWithResult(_0x1540a1,null))[_0x8e1e('0x39')](handleError(_0x1540a1,null));};exports[_0x8e1e('0xbc')]=function(_0x3d488c,_0x463402){return db['MailInteraction']['create'](_0x3d488c['body'],{})['then'](respondWithResult(_0x463402,0xc9))[_0x8e1e('0x39')](handleError(_0x463402,null));};exports['update']=function(_0x160ac6,_0x17a8cf){if(_0x160ac6[_0x8e1e('0xbd')]['id']){delete _0x160ac6[_0x8e1e('0xbd')]['id'];}return db[_0x8e1e('0x3b')][_0x8e1e('0x60')]({'where':{'id':_0x160ac6[_0x8e1e('0xb6')]['id']}})[_0x8e1e('0x28')](handleEntityNotFound(_0x17a8cf,null))[_0x8e1e('0x28')](saveUpdates(_0x160ac6[_0x8e1e('0xbd')],null))[_0x8e1e('0x28')](respondWithResult(_0x17a8cf,null))['catch'](handleError(_0x17a8cf,null));};exports['destroy']=function(_0x578c73,_0xcb361b){return db[_0x8e1e('0x3b')][_0x8e1e('0x60')]({'where':{'id':_0x578c73['params']['id']}})[_0x8e1e('0x28')](handleEntityNotFound(_0xcb361b,null))[_0x8e1e('0x28')](removeEntity(_0xcb361b,null))[_0x8e1e('0x39')](handleError(_0xcb361b,null));};exports[_0x8e1e('0xbe')]=function(_0x121be4,_0x522393){return db[_0x8e1e('0x3b')][_0x8e1e('0xbe')]()['then'](respondWithResult(_0x522393,null))[_0x8e1e('0x39')](handleError(_0x522393,null));};exports['addMessage']=function(_0x2dd8ee,_0x2ba16b,_0x4c0d2e){return db[_0x8e1e('0xbf')]['find']({'where':{'id':_0x2dd8ee[_0x8e1e('0xb6')]['id']}})[_0x8e1e('0x28')](handleEntityNotFound(_0x2ba16b,null))[_0x8e1e('0x28')](function(_0x55bb15){if(_0x55bb15){return _0x55bb15[_0x8e1e('0xc0')](_0x2dd8ee[_0x8e1e('0xbd')][_0x8e1e('0xc1')],_[_0x8e1e('0xc2')](_0x2dd8ee[_0x8e1e('0xbd')],['ids','id'])||{});}})[_0x8e1e('0x28')](respondWithResult(_0x2ba16b,null))[_0x8e1e('0x39')](handleError(_0x2ba16b,null));};exports[_0x8e1e('0xc3')]=function(_0x335a0a,_0x359807,_0x62a2b6){var _0x1d7bc7={'raw':![],'where':{}};var _0x5eb615={};var _0x3681ec={'count':0x0,'rows':[]};return db[_0x8e1e('0x3b')][_0x8e1e('0x34')]({'where':{'id':_0x335a0a[_0x8e1e('0xb6')]['id']}})[_0x8e1e('0x28')](handleEntityNotFound(_0x359807,null))[_0x8e1e('0x28')](function(_0x1562f7){if(_0x1562f7){_0x5eb615[_0x8e1e('0x3e')]=_[_0x8e1e('0x41')](db[_0x8e1e('0xbf')][_0x8e1e('0xb7')]);_0x5eb615['query']=_['keys'](_0x335a0a['query']);_0x5eb615[_0x8e1e('0x42')]=_['intersection'](_0x5eb615[_0x8e1e('0x3e')],_0x5eb615[_0x8e1e('0x40')]);_0x1d7bc7[_0x8e1e('0x43')]=_[_0x8e1e('0x44')](_0x5eb615['model'],qs[_0x8e1e('0x45')](_0x335a0a[_0x8e1e('0x40')][_0x8e1e('0x45')]));_0x1d7bc7['attributes']=_0x1d7bc7['attributes'][_0x8e1e('0x46')]?_0x1d7bc7['attributes']:_0x5eb615['model'];if(!_0x335a0a[_0x8e1e('0x40')][_0x8e1e('0x47')]('nolimit')){_0x1d7bc7[_0x8e1e('0x20')]=qs['limit'](_0x335a0a['query'][_0x8e1e('0x20')]);_0x1d7bc7[_0x8e1e('0x1f')]=qs[_0x8e1e('0x1f')](_0x335a0a[_0x8e1e('0x40')][_0x8e1e('0x1f')]);}_0x1d7bc7[_0x8e1e('0x48')]=qs[_0x8e1e('0x49')](_0x335a0a[_0x8e1e('0x40')][_0x8e1e('0x49')]);_0x1d7bc7[_0x8e1e('0x7c')]=qs[_0x8e1e('0x42')](_[_0x8e1e('0x4a')](_0x335a0a['query'],_0x5eb615[_0x8e1e('0x42')]));_0x1d7bc7['where'][_0x8e1e('0xc4')]=_0x1562f7['id'];if(_0x335a0a[_0x8e1e('0x40')][_0x8e1e('0x85')]){_0x1d7bc7[_0x8e1e('0x7c')]=_[_0x8e1e('0xba')](_0x1d7bc7['where'],{'$or':_['map'](_0x1d7bc7[_0x8e1e('0x43')],function(_0x42a731){var _0x4d9e76={};_0x4d9e76[_0x42a731]={'$like':'%'+_0x335a0a[_0x8e1e('0x40')][_0x8e1e('0x85')]+'%'};return _0x4d9e76;})});}if(_0x335a0a['query'][_0x8e1e('0x7a')]){var _0x175fbf=_0x335a0a[_0x8e1e('0x40')][_0x8e1e('0x7a')][_0x8e1e('0x31')](',');var _0x6a19a5={};_0x6a19a5[_0x175fbf[0x0]]={'$gte':moment(_0x175fbf[0x1])['format'](_0x8e1e('0xc5'))};_0x1d7bc7['where']=_[_0x8e1e('0xba')](_0x1d7bc7[_0x8e1e('0x7c')],_0x6a19a5);}_0x1d7bc7=_[_0x8e1e('0xba')]({},_0x1d7bc7,_0x335a0a[_0x8e1e('0xbb')]);return db['MailMessage'][_0x8e1e('0x1e')]({'where':_0x1d7bc7[_0x8e1e('0x7c')]})[_0x8e1e('0x28')](function(_0x2b6966){_0x3681ec[_0x8e1e('0x1e')]=_0x2b6966;if(_0x335a0a[_0x8e1e('0x40')]['includeAll']){_0x1d7bc7[_0x8e1e('0xb9')]=[{'all':!![]}];}return db[_0x8e1e('0xbf')][_0x8e1e('0xc6')](_0x1d7bc7);})[_0x8e1e('0x28')](function(_0x51b2e9){_0x3681ec[_0x8e1e('0xb4')]=_0x51b2e9;return _0x3681ec;});}})[_0x8e1e('0x28')](respondWithFilteredResult(_0x359807,_0x1d7bc7))[_0x8e1e('0x39')](handleError(_0x359807,null));};exports[_0x8e1e('0xc7')]=function(_0xfdd397,_0x6d7206,_0x4edd92){return db[_0x8e1e('0x3b')]['find']({'where':{'id':_0xfdd397['params']['id']}})[_0x8e1e('0x28')](handleEntityNotFound(_0x6d7206,null))[_0x8e1e('0x28')](function(_0x6e31f0){if(_0x6e31f0){return _0x6e31f0['setTags'](_0xfdd397[_0x8e1e('0xbd')]['ids'],_[_0x8e1e('0xc2')](_0xfdd397[_0x8e1e('0xbd')],[_0x8e1e('0xc1'),'id'])||{})[_0x8e1e('0xc8')](function(){return db['Tag']['findAll']({'attributes':['id',_0x8e1e('0x2c'),_0x8e1e('0x4d')],'where':{'id':_0xfdd397[_0x8e1e('0xbd')][_0x8e1e('0xc1')]}});})[_0x8e1e('0x28')](function(_0x4d3496){socket[_0x8e1e('0xc9')](_0x8e1e('0xca'),{'id':Number(_0xfdd397['params']['id']),'tags':_0x4d3496||[]});return{'id':Number(_0xfdd397[_0x8e1e('0xb6')]['id']),'tags':_0x4d3496||[]};});}})[_0x8e1e('0x28')](respondWithResult(_0x6d7206,null))[_0x8e1e('0x39')](handleError(_0x6d7206,null));};exports[_0x8e1e('0xcb')]=function(_0x1704ce,_0xc660e0,_0x33192a){return db[_0x8e1e('0x3b')][_0x8e1e('0x60')]({'where':{'id':_0x1704ce[_0x8e1e('0xb6')]['id']}})[_0x8e1e('0x28')](handleEntityNotFound(_0xc660e0,null))[_0x8e1e('0x28')](function(_0x24a629){if(_0x24a629){return _0x24a629[_0x8e1e('0xcb')](_0x1704ce['query']['ids']);}})[_0x8e1e('0x28')](respondWithStatusCode(_0xc660e0,null))[_0x8e1e('0x39')](handleError(_0xc660e0,null));};exports[_0x8e1e('0xcc')]=function(_0x1f81c6,_0x358980){var _0x128dd9=moment()['unix']()[_0x8e1e('0x8b')]();var _0x5749ab=path['join'](config[_0x8e1e('0xcd')],_0x8e1e('0xce'),_0x8e1e('0xcf'),'attachments');var _0x22a707=path[_0x8e1e('0x8c')](config[_0x8e1e('0xcd')],'server',_0x8e1e('0xcf'),_0x8e1e('0xd0'));var _0x4ee672=path[_0x8e1e('0x8c')](_0x22a707,_0x128dd9);var _0x18bced=util['format'](_0x8e1e('0xd1'),_0x128dd9);var _0x43220a=path['join'](_0x22a707,_0x18bced);var _0x538bc0=![];return db[_0x8e1e('0x3b')][_0x8e1e('0x60')]({'where':{'id':_0x1f81c6[_0x8e1e('0xb6')]['id']}})[_0x8e1e('0x28')](handleEntityNotFound(_0x358980,null))[_0x8e1e('0x28')](function(_0x4cfbb7){if(_0x4cfbb7){return _0x4cfbb7[_0x8e1e('0xc3')]({'attributes':['id',_0x8e1e('0xbd'),_0x8e1e('0x4e'),'to','cc',_0x8e1e('0xd2'),_0x8e1e('0xd3'),_0x8e1e('0xd4')],'where':{'secret':![]},'include':_0x1f81c6['query'][_0x8e1e('0xd5')]?[{'model':db[_0x8e1e('0xd6')],'as':_0x8e1e('0xd7')}]:undefined,'order':qs['sort']('id')});}return[];})['then'](function(_0x43c282){_0x538bc0=_0x43c282[_0x8e1e('0x46')];if(_0x43c282[_0x8e1e('0x46')]){fs['mkdirSync'](_0x4ee672);return BPromise[_0x8e1e('0xd8')](_0x43c282,function(_0x546446,_0x4c0394){var _0x8d7132=_0x546446;var _0x2dc20c={'from':_0x8d7132[_0x8e1e('0x4e')],'to':_0x8d7132['to'],'subject':_0x8d7132[_0x8e1e('0xd3')],'html':_0x8d7132[_0x8e1e('0xbd')],'headers':{'Date':moment(_0x8d7132[_0x8e1e('0xd4')])[_0x8e1e('0xd9')](_0x8e1e('0xda'))},'attachments':[]};if(_0x546446['cc']){_0x2dc20c[_0x8e1e('0xdb')]['Cc']=_0x546446['cc'];}if(_0x546446[_0x8e1e('0xd2')]){_0x2dc20c[_0x8e1e('0xdb')][_0x8e1e('0xdc')]=_0x546446[_0x8e1e('0xd2')];}return new BPromise(function(_0x1c05f9,_0x4b57b8){if(_0x546446[_0x8e1e('0xd7')]){for(var _0x53ff35=0x0;_0x53ff35<_0x546446[_0x8e1e('0xd7')]['length'];_0x53ff35++){var _0x3f0824=_0x546446[_0x8e1e('0xd7')][_0x53ff35];var _0x3ce6db=path[_0x8e1e('0x8c')](_0x5749ab,_0x3f0824[_0x8e1e('0xdd')]);if(fs['existsSync'](_0x3ce6db)){_0x2dc20c['attachments']['push']({'name':_0x3f0824[_0x8e1e('0x2c')],'contentType':_0x3f0824['type'],'data':fs[_0x8e1e('0xde')](_0x3ce6db)});}}}emlformat[_0x8e1e('0xdf')](_0x2dc20c,function(_0x25fc09,_0x1544c8){if(_0x25fc09)return _0x4b57b8(_0x25fc09);fs[_0x8e1e('0xe0')](path['join'](_0x4ee672,util[_0x8e1e('0xd9')]('message%d.eml',_0x4c0394)),_0x1544c8);return _0x1c05f9(_0x1544c8);});});});}})[_0x8e1e('0x28')](function(){if(_0x538bc0){return new BPromise(function(_0x437b64,_0x36fe0b){zipdir(_0x4ee672,{'saveTo':_0x43220a},function(_0x288cbf,_0xb4315e){if(_0x288cbf)return _0x36fe0b(_0x288cbf);return _0x437b64(_0xb4315e);});});}})[_0x8e1e('0x28')](function(){if(_0x538bc0){return new BPromise(function(_0x41af58,_0x208b38){rimraf(_0x4ee672,function(_0x41a78e){if(_0x41a78e)_0x208b38(_0x41a78e);return _0x41af58();});});}})[_0x8e1e('0x28')](function(){if(_0x538bc0){return _0x358980[_0x8e1e('0xcc')](_0x43220a,_0x18bced,function(_0x26bb38){if(_0x26bb38){console['log'](_0x8e1e('0xe1'),_0x26bb38);}else{fs[_0x8e1e('0xe2')](_0x43220a);}});}else{return _0x358980[_0x8e1e('0x29')](0xc8);}})[_0x8e1e('0x39')](handleError(_0x358980,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 80958a8..7897145 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 _0x004a=['setMaxListeners','save','update','remove','getUsers','then','Users','map','findAll','setDataValue','length','emit','catch','hook','exports','events','../../mysqldb','MailInteraction'];(function(_0x22d54d,_0x16ce19){var _0x558c3e=function(_0x4b75a8){while(--_0x4b75a8){_0x22d54d['push'](_0x22d54d['shift']());}};_0x558c3e(++_0x16ce19);}(_0x004a,0x153));var _0xa004=function(_0x350f13,_0x3f970a){_0x350f13=_0x350f13-0x0;var _0x3be200=_0x004a[_0x350f13];return _0x3be200;};'use strict';var EventEmitter=require(_0xa004('0x0'));var MailInteraction=require(_0xa004('0x1'))['db'][_0xa004('0x2')];var MailMessage=require(_0xa004('0x1'))['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xa004('0x3')](0x0);var events={'afterCreate':_0xa004('0x4'),'afterUpdate':_0xa004('0x5'),'afterDestroy':_0xa004('0x6')};function emitEvent(_0x36ad5b){return function(_0x2b1255,_0x44c980,_0x58dac1){_0x2b1255[_0xa004('0x7')]({'attributes':['id'],'raw':!![]})[_0xa004('0x8')](function(_0x5f5d98){_0x2b1255['setDataValue'](_0xa004('0x9'),_0x5f5d98[_0xa004('0xa')](function(_0x1254fa){return{'id':_0x1254fa['id']};}));return MailMessage[_0xa004('0xb')]({'where':{'MailInteractionId':_0x2b1255['id'],'direction':'in','read':![]},'raw':!![]});})[_0xa004('0x8')](function(_0x270211){_0x2b1255[_0xa004('0xc')]('unreadMessages',_0x270211[_0xa004('0xd')]);MailInteractionEvents['emit'](_0x36ad5b+':'+_0x2b1255['id'],_0x2b1255);MailInteractionEvents[_0xa004('0xe')](_0x36ad5b,_0x2b1255);_0x58dac1(null);})[_0xa004('0xf')](_0x58dac1(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0xa004('0x10')](e,emitEvent(event));}}module[_0xa004('0x11')]=MailInteractionEvents; \ No newline at end of file +var _0xb4b2=['Users','unreadMessages','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','save','update','getUsers','then','setDataValue'];(function(_0x25a118,_0x3a8822){var _0x401de2=function(_0x1818fc){while(--_0x1818fc){_0x25a118['push'](_0x25a118['shift']());}};_0x401de2(++_0x3a8822);}(_0xb4b2,0xb1));var _0x2b4b=function(_0x220bbb,_0xc07fba){_0x220bbb=_0x220bbb-0x0;var _0x2d6b3b=_0xb4b2[_0x220bbb];return _0x2d6b3b;};'use strict';var EventEmitter=require(_0x2b4b('0x0'));var MailInteraction=require(_0x2b4b('0x1'))['db'][_0x2b4b('0x2')];var MailMessage=require(_0x2b4b('0x1'))['db'][_0x2b4b('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x2b4b('0x4')](0x0);var events={'afterCreate':_0x2b4b('0x5'),'afterUpdate':_0x2b4b('0x6'),'afterDestroy':'remove'};function emitEvent(_0x20c1b4){return function(_0x51a165,_0x1d8c1b,_0x2a242e){_0x51a165[_0x2b4b('0x7')]({'attributes':['id'],'raw':!![]})[_0x2b4b('0x8')](function(_0x219b4a){_0x51a165[_0x2b4b('0x9')](_0x2b4b('0xa'),_0x219b4a['map'](function(_0x31c8c5){return{'id':_0x31c8c5['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x51a165['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2b4b('0x8')](function(_0x4d6a45){_0x51a165[_0x2b4b('0x9')](_0x2b4b('0xb'),_0x4d6a45[_0x2b4b('0xc')]);MailInteractionEvents['emit'](_0x20c1b4+':'+_0x51a165['id'],_0x51a165);MailInteractionEvents[_0x2b4b('0xd')](_0x20c1b4,_0x51a165);_0x2a242e(null);})[_0x2b4b('0xe')](_0x2a242e(null));};}for(var e in events){if(events[_0x2b4b('0xf')](e)){var event=events[e];MailInteraction[_0x2b4b('0x10')](e,emitEvent(event));}}module['exports']=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 751dab8..d8659c6 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 _0x84cb=['moment','request-promise','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closedAt','changed','closed','get','MailMessage','update','then','lodash','../../config/logger'];(function(_0x28e621,_0x59ebfe){var _0x16c409=function(_0x333673){while(--_0x333673){_0x28e621['push'](_0x28e621['shift']());}};_0x16c409(++_0x59ebfe);}(_0x84cb,0xf8));var _0xb84c=function(_0x55f816,_0x5dd3c8){_0x55f816=_0x55f816-0x0;var _0x10f25d=_0x84cb[_0x55f816];return _0x10f25d;};'use strict';var _=require(_0xb84c('0x0'));var util=require('util');var logger=require(_0xb84c('0x1'))('api');var moment=require(_0xb84c('0x2'));var BPromise=require('bluebird');var rp=require(_0xb84c('0x3'));var fs=require('fs');var path=require(_0xb84c('0x4'));var rimraf=require(_0xb84c('0x5'));var config=require(_0xb84c('0x6'));var attributes=require(_0xb84c('0x7'));module[_0xb84c('0x8')]=function(_0x1afb9f,_0x20fa18){return _0x1afb9f['define'](_0xb84c('0x9'),attributes,{'tableName':_0xb84c('0xa'),'paranoid':![],'indexes':[{'name':_0xb84c('0xb'),'fields':[_0xb84c('0xc'),'to'],'type':_0xb84c('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1f96e8,_0x2c6e0b,_0x553ed8){if(_0x1f96e8[_0xb84c('0xe')]){_0x1f96e8[_0xb84c('0xf')]=moment()[_0xb84c('0x10')](_0xb84c('0x11'));}if(_0x1f96e8['closed']){_0x1f96e8[_0xb84c('0x12')]=moment()[_0xb84c('0x10')](_0xb84c('0x11'));}_0x553ed8(null,_0x2c6e0b);},'beforeUpdate':function(_0x1ff0c0,_0xfa3bf0,_0x395196){if(_0x1ff0c0[_0xb84c('0x13')]('substatus')){_0x1ff0c0['substatusAt']=moment()[_0xb84c('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x1ff0c0[_0xb84c('0x13')](_0xb84c('0x14'))){_0x1ff0c0[_0xb84c('0x12')]=moment()[_0xb84c('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}_0x395196(null,_0x1ff0c0);},'afterUpdate':function(_0x2f7cc5,_0x4df1d5,_0x27a6b9){var _0x33405c=_0x1afb9f['models'];var _0x401515=_0x2f7cc5[_0xb84c('0x15')]({'plain':!![]});if(_0x401515[_0xb84c('0x14')]){return _0x33405c[_0xb84c('0x16')][_0xb84c('0x17')]({'read':!![]},{'where':{'MailInteractionId':_0x401515['id']}})[_0xb84c('0x18')](function(){_0x27a6b9();})['catch'](function(_0x5ded17){_0x27a6b9(_0x5ded17);});}else{_0x27a6b9();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x703e=['FULLTEXT','substatus','substatusAt','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','format','changed','models','get','update','then','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','MailInteraction','mail_interactions','fti_mail_interactions'];(function(_0x2b45b5,_0x474458){var _0x1d9c06=function(_0x9a3264){while(--_0x9a3264){_0x2b45b5['push'](_0x2b45b5['shift']());}};_0x1d9c06(++_0x474458);}(_0x703e,0x1a5));var _0xe703=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x703e[_0x618414];return _0x21c19a;};'use strict';var _=require(_0xe703('0x0'));var util=require(_0xe703('0x1'));var logger=require(_0xe703('0x2'))(_0xe703('0x3'));var moment=require(_0xe703('0x4'));var BPromise=require(_0xe703('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe703('0x6'));var config=require(_0xe703('0x7'));var attributes=require(_0xe703('0x8'));module[_0xe703('0x9')]=function(_0x4dabfd,_0x2955ed){return _0x4dabfd[_0xe703('0xa')](_0xe703('0xb'),attributes,{'tableName':_0xe703('0xc'),'paranoid':![],'indexes':[{'name':_0xe703('0xd'),'fields':['subject','to'],'type':_0xe703('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x54770f,_0x359aff,_0x190ddc){if(_0x54770f[_0xe703('0xf')]){_0x54770f[_0xe703('0x10')]=moment()['format'](_0xe703('0x11'));}if(_0x54770f[_0xe703('0x12')]){_0x54770f[_0xe703('0x13')]=moment()[_0xe703('0x14')]('YYYY-MM-DD\x20HH:mm:ss');}_0x190ddc(null,_0x359aff);},'beforeUpdate':function(_0xb677fa,_0xd2695,_0x4de16e){if(_0xb677fa['changed']('substatus')){_0xb677fa['substatusAt']=moment()[_0xe703('0x14')](_0xe703('0x11'));}if(_0xb677fa[_0xe703('0x15')](_0xe703('0x12'))){_0xb677fa[_0xe703('0x13')]=moment()[_0xe703('0x14')](_0xe703('0x11'));}_0x4de16e(null,_0xb677fa);},'afterUpdate':function(_0x3c1ce8,_0x2ab9d9,_0x158419){var _0xc05d=_0x4dabfd[_0xe703('0x16')];var _0x226fa1=_0x3c1ce8[_0xe703('0x17')]({'plain':!![]});if(_0x226fa1[_0xe703('0x12')]){return _0xc05d['MailMessage'][_0xe703('0x18')]({'read':!![]},{'where':{'MailInteractionId':_0x226fa1['id']}})[_0xe703('0x19')](function(){_0x158419();})[_0xe703('0x1a')](function(_0x59df42){_0x158419(_0x59df42);});}else{_0x158419();}}},'charset':_0xe703('0x1b'),'collate':_0xe703('0x1c')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index eb2d085..02f4ff9 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 _0x4711=['request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','MailInteraction,\x20%s,\x20%s','result','catch','UpdateMailInteraction','MailInteraction','update','body','options','raw','where','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./mailInteraction.socket','request','then','info'];(function(_0x427352,_0x1bce61){var _0x23e0e6=function(_0x2a42a9){while(--_0x2a42a9){_0x427352['push'](_0x427352['shift']());}};_0x23e0e6(++_0x1bce61);}(_0x4711,0x10c));var _0x1471=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4711[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x1471('0x0'));var util=require(_0x1471('0x1'));var moment=require(_0x1471('0x2'));var BPromise=require(_0x1471('0x3'));var rs=require(_0x1471('0x4'));var fs=require('fs');var Redis=require(_0x1471('0x5'));var db=require(_0x1471('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1471('0x7'))('rpc');var config=require(_0x1471('0x8'));var jayson=require(_0x1471('0x9'));var client=jayson[_0x1471('0xa')][_0x1471('0xb')]({'port':0x232a});config[_0x1471('0xc')]=_['defaults'](config[_0x1471('0xc')],{'host':_0x1471('0xd'),'port':0x18eb});var socket=require(_0x1471('0xe'))(new Redis(config[_0x1471('0xc')]));require(_0x1471('0xf'))['register'](socket);function respondWithRpcPromise(_0x4bdc21,_0x1d1866,_0x744979){return new BPromise(function(_0x92238c,_0x21b503){return client[_0x1471('0x10')](_0x4bdc21,_0x744979)[_0x1471('0x11')](function(_0x738c93){logger[_0x1471('0x12')]('MailInteraction,\x20%s,\x20%s',_0x1d1866,_0x1471('0x13'));logger[_0x1471('0x14')](_0x1471('0x15'),_0x1d1866,_0x1471('0x13'),JSON[_0x1471('0x16')](_0x738c93));if(_0x738c93['error']){if(_0x738c93[_0x1471('0x17')][_0x1471('0x18')]===0x1f4){logger[_0x1471('0x17')]('MailInteraction,\x20%s,\x20%s',_0x1d1866,_0x738c93[_0x1471('0x17')][_0x1471('0x19')]);return _0x21b503(_0x738c93[_0x1471('0x17')][_0x1471('0x19')]);}logger[_0x1471('0x17')](_0x1471('0x1a'),_0x1d1866,_0x738c93[_0x1471('0x17')][_0x1471('0x19')]);return _0x92238c(_0x738c93[_0x1471('0x17')][_0x1471('0x19')]);}else{logger[_0x1471('0x12')]('MailInteraction,\x20%s,\x20%s',_0x1d1866,_0x1471('0x13'));_0x92238c(_0x738c93[_0x1471('0x1b')][_0x1471('0x19')]);}})[_0x1471('0x1c')](function(_0xb3ec11){logger[_0x1471('0x17')](_0x1471('0x1a'),_0x1d1866,_0xb3ec11);_0x21b503(_0xb3ec11);});});}exports[_0x1471('0x1d')]=function(_0x4e57df){var _0x1df202=this;return new Promise(function(_0xf1247,_0xdebb7c){return db[_0x1471('0x1e')][_0x1471('0x1f')](_0x4e57df[_0x1471('0x20')],{'raw':_0x4e57df[_0x1471('0x21')]?_0x4e57df[_0x1471('0x21')][_0x1471('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e57df[_0x1471('0x21')]?_0x4e57df[_0x1471('0x21')][_0x1471('0x23')]||null:null,'attributes':_0x4e57df[_0x1471('0x21')]?_0x4e57df[_0x1471('0x21')]['attributes']||null:null,'limit':_0x4e57df[_0x1471('0x21')]?_0x4e57df[_0x1471('0x21')]['limit']||null:null})[_0x1471('0x11')](function(_0x1f6acb){logger[_0x1471('0x12')](_0x1471('0x1d'),_0x4e57df);logger['debug']('UpdateMailInteraction',_0x4e57df,JSON[_0x1471('0x16')](_0x1f6acb));_0xf1247(_0x1f6acb);})[_0x1471('0x1c')](function(_0x2a081e){logger[_0x1471('0x17')](_0x1471('0x1d'),_0x2a081e[_0x1471('0x19')],_0x4e57df);_0xdebb7c(_0x1df202['error'](0x1f4,_0x2a081e[_0x1471('0x19')]));});});};exports['AddTagsToMailInteraction']=function(_0x2da177){return new Promise(function(_0x2b90f8,_0x372d04){return db['MailInteraction']['find']({'where':_0x2da177[_0x1471('0x21')]?_0x2da177['options']['where']||null:null})[_0x1471('0x11')](function(_0x2758c3){if(_0x2758c3){return _0x2758c3[_0x1471('0x24')](_0x2da177[_0x1471('0x20')][_0x1471('0x25')],_[_0x1471('0x26')](_0x2da177['body'],[_0x1471('0x25'),'id'])||{});}})[_0x1471('0x27')](function(_0x3327ae){logger[_0x1471('0x12')](_0x1471('0x28'),_0x2da177);logger[_0x1471('0x14')]('AddTags',_0x2da177,JSON[_0x1471('0x16')](_0x3327ae));_0x2b90f8(_0x3327ae);})[_0x1471('0x1c')](function(_0x3e4f8c){logger[_0x1471('0x17')](_0x1471('0x28'),_0x3e4f8c['message'],_0x2da177);_0x372d04(_this[_0x1471('0x17')](0x1f4,_0x3e4f8c[_0x1471('0x19')]));});});}; \ No newline at end of file +var _0x847d=['./mailInteraction.socket','register','request','then','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','MailInteraction','update','body','options','raw','where','limit','UpdateMailInteraction','AddTagsToMailInteraction','find','addTags','ids','omit','spread','AddTags','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter'];(function(_0x43fbe6,_0x413b3b){var _0xc5d87f=function(_0xc1ffd6){while(--_0xc1ffd6){_0x43fbe6['push'](_0x43fbe6['shift']());}};_0xc5d87f(++_0x413b3b);}(_0x847d,0x14a));var _0xd847=function(_0x58a4ac,_0x43fd42){_0x58a4ac=_0x58a4ac-0x0;var _0x545810=_0x847d[_0x58a4ac];return _0x545810;};'use strict';var _=require('lodash');var util=require(_0xd847('0x0'));var moment=require(_0xd847('0x1'));var BPromise=require(_0xd847('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd847('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xd847('0x4'));var logger=require(_0xd847('0x5'))('rpc');var config=require(_0xd847('0x6'));var jayson=require(_0xd847('0x7'));var client=jayson[_0xd847('0x8')][_0xd847('0x9')]({'port':0x232a});config['redis']=_[_0xd847('0xa')](config[_0xd847('0xb')],{'host':_0xd847('0xc'),'port':0x18eb});var socket=require(_0xd847('0xd'))(new Redis(config[_0xd847('0xb')]));require(_0xd847('0xe'))[_0xd847('0xf')](socket);function respondWithRpcPromise(_0x5a9998,_0x5b3d7f,_0x522d67){return new BPromise(function(_0x4bec38,_0x2844ec){return client[_0xd847('0x10')](_0x5a9998,_0x522d67)[_0xd847('0x11')](function(_0x4f5ec2){logger['info'](_0xd847('0x12'),_0x5b3d7f,_0xd847('0x13'));logger[_0xd847('0x14')](_0xd847('0x15'),_0x5b3d7f,_0xd847('0x13'),JSON[_0xd847('0x16')](_0x4f5ec2));if(_0x4f5ec2[_0xd847('0x17')]){if(_0x4f5ec2[_0xd847('0x17')][_0xd847('0x18')]===0x1f4){logger[_0xd847('0x17')](_0xd847('0x12'),_0x5b3d7f,_0x4f5ec2['error'][_0xd847('0x19')]);return _0x2844ec(_0x4f5ec2[_0xd847('0x17')][_0xd847('0x19')]);}logger[_0xd847('0x17')](_0xd847('0x12'),_0x5b3d7f,_0x4f5ec2['error'][_0xd847('0x19')]);return _0x4bec38(_0x4f5ec2[_0xd847('0x17')][_0xd847('0x19')]);}else{logger[_0xd847('0x1a')]('MailInteraction,\x20%s,\x20%s',_0x5b3d7f,_0xd847('0x13'));_0x4bec38(_0x4f5ec2['result'][_0xd847('0x19')]);}})[_0xd847('0x1b')](function(_0x26bc44){logger[_0xd847('0x17')](_0xd847('0x12'),_0x5b3d7f,_0x26bc44);_0x2844ec(_0x26bc44);});});}exports['UpdateMailInteraction']=function(_0x6e91ab){var _0x586c8a=this;return new Promise(function(_0x581941,_0x25e139){return db[_0xd847('0x1c')][_0xd847('0x1d')](_0x6e91ab[_0xd847('0x1e')],{'raw':_0x6e91ab[_0xd847('0x1f')]?_0x6e91ab[_0xd847('0x1f')][_0xd847('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x6e91ab[_0xd847('0x1f')]?_0x6e91ab[_0xd847('0x1f')][_0xd847('0x21')]||null:null,'attributes':_0x6e91ab[_0xd847('0x1f')]?_0x6e91ab[_0xd847('0x1f')]['attributes']||null:null,'limit':_0x6e91ab['options']?_0x6e91ab[_0xd847('0x1f')][_0xd847('0x22')]||null:null})[_0xd847('0x11')](function(_0x5075a2){logger[_0xd847('0x1a')](_0xd847('0x23'),_0x6e91ab);logger[_0xd847('0x14')](_0xd847('0x23'),_0x6e91ab,JSON[_0xd847('0x16')](_0x5075a2));_0x581941(_0x5075a2);})[_0xd847('0x1b')](function(_0x24793c){logger[_0xd847('0x17')](_0xd847('0x23'),_0x24793c['message'],_0x6e91ab);_0x25e139(_0x586c8a[_0xd847('0x17')](0x1f4,_0x24793c[_0xd847('0x19')]));});});};exports[_0xd847('0x24')]=function(_0x1a5370){return new Promise(function(_0x19bf66,_0x3301cd){return db['MailInteraction'][_0xd847('0x25')]({'where':_0x1a5370['options']?_0x1a5370['options']['where']||null:null})[_0xd847('0x11')](function(_0x3654e8){if(_0x3654e8){return _0x3654e8[_0xd847('0x26')](_0x1a5370[_0xd847('0x1e')][_0xd847('0x27')],_[_0xd847('0x28')](_0x1a5370[_0xd847('0x1e')],[_0xd847('0x27'),'id'])||{});}})[_0xd847('0x29')](function(_0x15263b){logger[_0xd847('0x1a')](_0xd847('0x2a'),_0x1a5370);logger['debug']('AddTags',_0x1a5370,JSON[_0xd847('0x16')](_0x15263b));_0x19bf66(_0x15263b);})[_0xd847('0x1b')](function(_0x41d1de){logger[_0xd847('0x17')](_0xd847('0x2a'),_0x41d1de['message'],_0x1a5370);_0x3301cd(_this[_0xd847('0x17')](0x1f4,_0x41d1de['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 5e3e32a..9c2703e 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 _0x7da5=['save','remove','update','emit','removeListener','length'];(function(_0x1a72b8,_0x1e4f4b){var _0x39f72d=function(_0x35aef1){while(--_0x35aef1){_0x1a72b8['push'](_0x1a72b8['shift']());}};_0x39f72d(++_0x1e4f4b);}(_0x7da5,0x10e));var _0x57da=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x7da5[_0x30ae5e];return _0x1f2e93;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0x57da('0x0'),_0x57da('0x1'),_0x57da('0x2')];function createListener(_0x275497,_0x350bde){return function(_0x1410c5){_0x350bde[_0x57da('0x3')](_0x275497,_0x1410c5);};}function removeListener(_0x2d655f,_0x2592da){return function(){MailInteractionEvents[_0x57da('0x4')](_0x2d655f,_0x2592da);};}exports['register']=function(_0x17e40b){for(var _0x495bec=0x0,_0x1e0646=events[_0x57da('0x5')];_0x495bec<_0x1e0646;_0x495bec++){var _0x3839ad=events[_0x495bec];var _0x1fa61b=createListener('mailInteraction:'+_0x3839ad,_0x17e40b);MailInteractionEvents['on'](_0x3839ad,_0x1fa61b);}}; \ No newline at end of file +var _0x5dd5=['removeListener','register','length','save','remove','update','emit'];(function(_0x23ca4d,_0x5c2a32){var _0x435432=function(_0xe1a5e5){while(--_0xe1a5e5){_0x23ca4d['push'](_0x23ca4d['shift']());}};_0x435432(++_0x5c2a32);}(_0x5dd5,0x17d));var _0x55dd=function(_0x3529ab,_0x555777){_0x3529ab=_0x3529ab-0x0;var _0x2e3e1c=_0x5dd5[_0x3529ab];return _0x2e3e1c;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0x55dd('0x0'),_0x55dd('0x1'),_0x55dd('0x2')];function createListener(_0x536474,_0xc2849a){return function(_0x32a599){_0xc2849a[_0x55dd('0x3')](_0x536474,_0x32a599);};}function removeListener(_0x1545b6,_0x1b6be5){return function(){MailInteractionEvents[_0x55dd('0x4')](_0x1545b6,_0x1b6be5);};}exports[_0x55dd('0x5')]=function(_0x10d008){for(var _0x17739e=0x0,_0x5f05d7=events[_0x55dd('0x6')];_0x17739e<_0x5f05d7;_0x17739e++){var _0x21142b=events[_0x17739e];var _0x111d31=createListener('mailInteraction:'+_0x21142b,_0x10d008);MailInteractionEvents['on'](_0x21142b,_0x111d31);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 2441202..d166423 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 _0x4b84=['express','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','show','/:id/download','download','post','tracked','mail','mailmessage:create','create','/:id','put','accept','/:id/reject','delete','destroy','multer','util'];(function(_0x38cef8,_0x5957a4){var _0x46cc91=function(_0xabe35d){while(--_0xabe35d){_0x38cef8['push'](_0x38cef8['shift']());}};_0x46cc91(++_0x5957a4);}(_0x4b84,0x1cc));var _0x44b8=function(_0x5e9d35,_0x382c91){_0x5e9d35=_0x5e9d35-0x0;var _0x3beb2e=_0x4b84[_0x5e9d35];return _0x3beb2e;};'use strict';var multer=require(_0x44b8('0x0'));var util=require(_0x44b8('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x44b8('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x44b8('0x3'));var config=require(_0x44b8('0x4'));var controller=require(_0x44b8('0x5'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x44b8('0x6')]('/describe',auth[_0x44b8('0x7')](),controller['describe']);router[_0x44b8('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x44b8('0x8')]);router[_0x44b8('0x6')](_0x44b8('0x9'),auth['isAuthenticated'](),controller[_0x44b8('0xa')]);router[_0x44b8('0xb')]('/',auth[_0x44b8('0x7')](),interaction[_0x44b8('0xc')](_0x44b8('0xd'),_0x44b8('0xe')),controller[_0x44b8('0xf')]);router['put'](_0x44b8('0x10'),auth[_0x44b8('0x7')](),controller['update']);router[_0x44b8('0x11')]('/:id/accept',auth[_0x44b8('0x7')](),controller[_0x44b8('0x12')]);router['put'](_0x44b8('0x13'),auth['isAuthenticated'](),controller['reject']);router[_0x44b8('0x14')](_0x44b8('0x10'),auth[_0x44b8('0x7')](),controller[_0x44b8('0x15')]);module['exports']=router; \ No newline at end of file +var _0xe14b=['create','put','/:id','update','/:id/accept','accept','/:id/reject','destroy','exports','multer','util','express','Router','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','show','/:id/download','tracked','mailmessage:create'];(function(_0x2caae8,_0x378549){var _0x35a480=function(_0x376d3d){while(--_0x376d3d){_0x2caae8['push'](_0x2caae8['shift']());}};_0x35a480(++_0x378549);}(_0xe14b,0x93));var _0xbe14=function(_0x5dcb97,_0x336ea9){_0x5dcb97=_0x5dcb97-0x0;var _0x3186a3=_0xe14b[_0x5dcb97];return _0x3186a3;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xbe14('0x4'));var config=require('../../config/environment');var controller=require('./mailMessage.controller');router[_0xbe14('0x5')]('/',auth[_0xbe14('0x6')](),controller[_0xbe14('0x7')]);router[_0xbe14('0x5')](_0xbe14('0x8'),auth[_0xbe14('0x6')](),controller[_0xbe14('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xbe14('0xa')]);router[_0xbe14('0x5')](_0xbe14('0xb'),auth[_0xbe14('0x6')](),controller['download']);router['post']('/',auth[_0xbe14('0x6')](),interaction[_0xbe14('0xc')]('mail',_0xbe14('0xd')),controller[_0xbe14('0xe')]);router[_0xbe14('0xf')](_0xbe14('0x10'),auth[_0xbe14('0x6')](),controller[_0xbe14('0x11')]);router[_0xbe14('0xf')](_0xbe14('0x12'),auth[_0xbe14('0x6')](),controller[_0xbe14('0x13')]);router[_0xbe14('0xf')](_0xbe14('0x14'),auth[_0xbe14('0x6')](),controller['reject']);router['delete'](_0xbe14('0x10'),auth[_0xbe14('0x6')](),controller[_0xbe14('0x15')]);module[_0xbe14('0x16')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 65ad0ef..9a6ee4b 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 _0xf8f2=['DATE','INTEGER','sequelize','lodash','exports','TEXT','medium','BOOLEAN','ENUM','out','STRING','long'];(function(_0x15247a,_0x15a9b1){var _0x24eef7=function(_0x263008){while(--_0x263008){_0x15247a['push'](_0x15247a['shift']());}};_0x24eef7(++_0x15a9b1);}(_0xf8f2,0xc2));var _0x2f8f=function(_0x49a354,_0x5297d4){_0x49a354=_0x49a354-0x0;var _0x4cdf0b=_0xf8f2[_0x49a354];return _0x4cdf0b;};'use strict';var Sequelize=require(_0x2f8f('0x0'));var _=require(_0x2f8f('0x1'));module[_0x2f8f('0x2')]={'body':{'type':Sequelize[_0x2f8f('0x3')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0x2f8f('0x3')](_0x2f8f('0x4'))},'read':{'type':Sequelize[_0x2f8f('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0x2f8f('0x6')]('in',_0x2f8f('0x7')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x2f8f('0x8')](0x1fe)},'from':{'type':Sequelize[_0x2f8f('0x8')]},'to':{'type':Sequelize[_0x2f8f('0x3')](_0x2f8f('0x9'))},'cc':{'type':Sequelize[_0x2f8f('0x3')](_0x2f8f('0x9'))},'bcc':{'type':Sequelize[_0x2f8f('0x3')](_0x2f8f('0x9'))},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0x2f8f('0xa')]},'attach':{'type':Sequelize[_0x2f8f('0xb')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x2f8f('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x2f8f('0xa')]},'originTo':{'type':Sequelize['TEXT'](_0x2f8f('0x9'))},'originCc':{'type':Sequelize[_0x2f8f('0x3')]('long')}}; \ No newline at end of file +var _0x4f9b=['DATE','sequelize','lodash','exports','TEXT','long','medium','BOOLEAN','STRING'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x4f9b,0x6d));var _0xb4f9=function(_0x54e4f9,_0x35d3ba){_0x54e4f9=_0x54e4f9-0x0;var _0x5de187=_0x4f9b[_0x54e4f9];return _0x5de187;};'use strict';var Sequelize=require(_0xb4f9('0x0'));var _=require(_0xb4f9('0x1'));module[_0xb4f9('0x2')]={'body':{'type':Sequelize[_0xb4f9('0x3')](_0xb4f9('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xb4f9('0x3')](_0xb4f9('0x5'))},'read':{'type':Sequelize[_0xb4f9('0x6')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xb4f9('0x7')](0x1fe)},'from':{'type':Sequelize[_0xb4f9('0x7')]},'to':{'type':Sequelize[_0xb4f9('0x3')](_0xb4f9('0x4'))},'cc':{'type':Sequelize[_0xb4f9('0x3')](_0xb4f9('0x4'))},'bcc':{'type':Sequelize['TEXT'](_0xb4f9('0x4'))},'subject':{'type':Sequelize[_0xb4f9('0x3')]},'sentAt':{'type':Sequelize[_0xb4f9('0x8')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize[_0xb4f9('0x6')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0xb4f9('0x3')](_0xb4f9('0x4'))},'originCc':{'type':Sequelize[_0xb4f9('0x3')](_0xb4f9('0x4'))}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 32f0ebd..d4015ed 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 _0x814b=['body','describe','create','direction','out','secret','MailAccount','findOne','MailAccountId','Smtp','host','port','secure','authentication','user','pass','service','auth','attachments','join','root','server/files/attachments','basename','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','mail-interactions','accept','mail','read','UserId','CmContact','Contact','isNil','interaction','get','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','channel','event','EventManager','acceptmessage','agent','MailInteractionId','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','interface','SIP/%s','download','unix','toString','files','tmp','server','message-%s.eml','from','subject','createdAt','Attachment','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','existsSync','readFileSync','build','writeFileSync','log','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','jayson/promise','client','http','test','request','info','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','limit','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','field','MailMessage','count','includeAll','include','findAll','rows','show','params','keys','rawAttributes','length','options','find'];(function(_0x2fb2be,_0x55c3df){var _0x1459c4=function(_0x3274ba){while(--_0x3274ba){_0x2fb2be['push'](_0x2fb2be['shift']());}};_0x1459c4(++_0x55c3df);}(_0x814b,0x1a2));var _0xb814=function(_0x2c944e,_0x26f659){_0x2c944e=_0x2c944e-0x0;var _0x2cc529=_0x814b[_0x2c944e];return _0x2cc529;};'use strict';var pdf=require(_0xb814('0x0'));var emlformat=require(_0xb814('0x1'));var rimraf=require(_0xb814('0x2'));var zipdir=require(_0xb814('0x3'));var jsonpatch=require(_0xb814('0x4'));var rp=require(_0xb814('0x5'));var moment=require('moment');var BPromise=require(_0xb814('0x6'));var Mustache=require(_0xb814('0x7'));var util=require(_0xb814('0x8'));var path=require(_0xb814('0x9'));var sox=require(_0xb814('0xa'));var csv=require(_0xb814('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb814('0xc'));var squel=require(_0xb814('0xd'));var crypto=require('crypto');var jsforce=require(_0xb814('0xe'));var deskjs=require(_0xb814('0xf'));var toCsv=require(_0xb814('0xb'));var querystring=require(_0xb814('0x10'));var Papa=require(_0xb814('0x11'));var Redis=require(_0xb814('0x12'));var authService=require(_0xb814('0x13'));var qs=require(_0xb814('0x14'));var as=require(_0xb814('0x15'));var hardwareService=require(_0xb814('0x16'));var logger=require(_0xb814('0x17'))('api');var utils=require(_0xb814('0x18'));var config=require('../../config/environment');var db=require(_0xb814('0x19'))['db'];config[_0xb814('0x1a')]=_[_0xb814('0x1b')](config[_0xb814('0x1a')],{'host':_0xb814('0x1c'),'port':0x18eb});var socket=require(_0xb814('0x1d'))(new Redis(config[_0xb814('0x1a')]));require(_0xb814('0x1e'))[_0xb814('0x1f')](socket);var jayson=require(_0xb814('0x20'));var client=jayson[_0xb814('0x21')][_0xb814('0x22')]({'port':0x232c});var client9003=jayson[_0xb814('0x21')][_0xb814('0x22')]({'port':0x232b});var client9002=jayson[_0xb814('0x21')][_0xb814('0x22')]({'port':0x232a});function checkPasswordPattern(_0x45e0d0,_0x265a83,_0x125ce2){if(_0x125ce2){var _0x21b73f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x21b73f[_0xb814('0x23')](_0x265a83)){return _0x45e0d0;}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 _0x45e0d0;}}function respondWithRpcPromise(_0x168a48,_0x55ba16,_0x270598,_0xfac75b){return new BPromise(function(_0x4c3007,_0x4b55a7){var _0x55d63c=_0xfac75b||client;return _0x55d63c[_0xb814('0x24')](_0x168a48,_0x270598)['then'](function(_0x57c128){logger[_0xb814('0x25')](_0xb814('0x26'),_0x55ba16,_0xb814('0x27'));logger['debug'](_0xb814('0x28'),_0x55ba16,'request\x20sent',JSON[_0xb814('0x29')](_0x57c128));if(_0x57c128[_0xb814('0x2a')]){if(_0x57c128[_0xb814('0x2a')][_0xb814('0x2b')]===0x1f4){logger[_0xb814('0x2a')](_0xb814('0x26'),_0x55ba16,_0x57c128[_0xb814('0x2a')]['message']);return _0x4b55a7(_0x57c128[_0xb814('0x2a')]['message']);}logger[_0xb814('0x2a')](_0xb814('0x26'),_0x55ba16,_0x57c128[_0xb814('0x2a')][_0xb814('0x2c')]);return _0x4c3007(_0x57c128[_0xb814('0x2a')][_0xb814('0x2c')]);}else{logger[_0xb814('0x25')]('MailMessage,\x20%s,\x20%s',_0x55ba16,_0xb814('0x27'));_0x4c3007(_0x57c128[_0xb814('0x2d')][_0xb814('0x2c')]);}})[_0xb814('0x2e')](function(_0x32ed56){logger[_0xb814('0x2a')](_0xb814('0x26'),_0x55ba16,_0x32ed56);_0x4b55a7(_0x32ed56);});});}function respondWithStatusCode(_0x1e4e89,_0x5a6291){_0x5a6291=_0x5a6291||0xcc;return function(_0x271aa8){if(_0x271aa8){return _0x1e4e89[_0xb814('0x2f')](_0x5a6291);}return _0x1e4e89['status'](_0x5a6291)[_0xb814('0x30')]();};}function respondWithResult(_0x37d24d,_0x530744){_0x530744=_0x530744||0xc8;return function(_0x499f22){if(_0x499f22){return _0x37d24d[_0xb814('0x31')](_0x530744)[_0xb814('0x32')](_0x499f22);}};}function respondWithFilteredResult(_0x58c3ca,_0x338a28){return function(_0x526610){if(_0x526610){var _0x6efe9a=_0x526610['count'],_0x5f3e9b=_0x338a28[_0xb814('0x33')],_0x4cfc58=_0x338a28[_0xb814('0x33')]+_0x338a28[_0xb814('0x34')],_0x419cd9;if(_0x4cfc58>=_0x6efe9a){_0x4cfc58=_0x6efe9a;_0x419cd9=0xc8;}else{_0x419cd9=0xce;}_0x58c3ca['status'](_0x419cd9);return _0x58c3ca['set'](_0xb814('0x35'),_0x5f3e9b+'-'+_0x4cfc58+'/'+_0x6efe9a)[_0xb814('0x32')](_0x526610);}return null;};}function patchUpdates(_0x523566){return function(_0x2c8943){try{jsonpatch[_0xb814('0x36')](_0x2c8943,_0x523566,!![]);}catch(_0x692c72){return BPromise[_0xb814('0x37')](_0x692c72);}return _0x2c8943[_0xb814('0x38')]();};}function saveUpdates(_0x60024d,_0x3672f3){return function(_0x4df4e6){if(_0x4df4e6){return _0x4df4e6[_0xb814('0x39')](_0x60024d)[_0xb814('0x3a')](function(_0x30de5a){return _0x30de5a;});}return null;};}function removeEntity(_0x424e2b,_0x14100d){return function(_0x4ff31a){if(_0x4ff31a){return _0x4ff31a[_0xb814('0x3b')]()['then'](function(){_0x424e2b[_0xb814('0x31')](0xcc)[_0xb814('0x30')]();});}};}function handleEntityNotFound(_0xe0f509,_0x492d5e){return function(_0x40b885){if(!_0x40b885){_0xe0f509[_0xb814('0x2f')](0x194);}return _0x40b885;};}function handleError(_0x4ea6f8,_0x2fcd92){_0x2fcd92=_0x2fcd92||0x1f4;return function(_0x2d0e27){logger[_0xb814('0x2a')](_0x2d0e27[_0xb814('0x3c')]);if(_0x2d0e27[_0xb814('0x3d')]){delete _0x2d0e27[_0xb814('0x3d')];}_0x4ea6f8['status'](_0x2fcd92)[_0xb814('0x3e')](_0x2d0e27);};}exports['index']=function(_0x2aaf1c,_0x4b5583){var _0x4492ef={},_0x4b9233={},_0x2f8a2e={'count':0x0,'rows':[]};var _0x26675a=_['map'](db['MailMessage']['rawAttributes'],function(_0x57b379){return{'name':_0x57b379[_0xb814('0x3f')],'type':_0x57b379[_0xb814('0x40')][_0xb814('0x41')]};});_0x4b9233[_0xb814('0x42')]=_['map'](_0x26675a,'name');_0x4b9233[_0xb814('0x43')]=_['keys'](_0x2aaf1c[_0xb814('0x43')]);_0x4b9233[_0xb814('0x44')]=_[_0xb814('0x45')](_0x4b9233[_0xb814('0x42')],_0x4b9233[_0xb814('0x43')]);_0x4492ef[_0xb814('0x46')]=_[_0xb814('0x45')](_0x4b9233[_0xb814('0x42')],qs[_0xb814('0x47')](_0x2aaf1c['query']['fields']));_0x4492ef['attributes']=_0x4492ef[_0xb814('0x46')]['length']?_0x4492ef[_0xb814('0x46')]:_0x4b9233['model'];if(!_0x2aaf1c[_0xb814('0x43')][_0xb814('0x48')](_0xb814('0x49'))){_0x4492ef[_0xb814('0x34')]=qs['limit'](_0x2aaf1c[_0xb814('0x43')][_0xb814('0x34')]);_0x4492ef[_0xb814('0x33')]=qs[_0xb814('0x33')](_0x2aaf1c[_0xb814('0x43')][_0xb814('0x33')]);}_0x4492ef['order']=qs[_0xb814('0x4a')](_0x2aaf1c[_0xb814('0x43')][_0xb814('0x4a')]);_0x4492ef[_0xb814('0x4b')]=qs[_0xb814('0x44')](_[_0xb814('0x4c')](_0x2aaf1c[_0xb814('0x43')],_0x4b9233['filters']));if(_0x2aaf1c['query'][_0xb814('0x4d')]){_0x4492ef[_0xb814('0x4b')]=_[_0xb814('0x4e')](_0x4492ef[_0xb814('0x4b')],{'$or':_[_0xb814('0x4f')](_0x26675a,function(_0x40e627){if(_0x40e627[_0xb814('0x40')][_0xb814('0x41')]!==_0xb814('0x50')){var _0x344198={};_0x344198[_0x40e627[_0xb814('0x51')]]={'$like':'%'+_0x2aaf1c['query'][_0xb814('0x4d')]+'%'};return _0x344198;}})});}_0x4492ef=_[_0xb814('0x4e')]({},_0x4492ef,_0x2aaf1c['options']);var _0x338e80={'where':_0x4492ef['where']};return db[_0xb814('0x52')][_0xb814('0x53')](_0x338e80)[_0xb814('0x3a')](function(_0x22b2ef){_0x2f8a2e[_0xb814('0x53')]=_0x22b2ef;if(_0x2aaf1c[_0xb814('0x43')][_0xb814('0x54')]){_0x4492ef[_0xb814('0x55')]=[{'all':!![]}];}return db[_0xb814('0x52')][_0xb814('0x56')](_0x4492ef);})['then'](function(_0x4d4a7e){_0x2f8a2e[_0xb814('0x57')]=_0x4d4a7e;return _0x2f8a2e;})[_0xb814('0x3a')](respondWithFilteredResult(_0x4b5583,_0x4492ef))[_0xb814('0x2e')](handleError(_0x4b5583,null));};exports[_0xb814('0x58')]=function(_0x1b565c,_0x37ffc6){var _0x135208={'raw':!![],'where':{'id':_0x1b565c[_0xb814('0x59')]['id']}},_0x4a4f9a={};_0x4a4f9a[_0xb814('0x42')]=_[_0xb814('0x5a')](db['MailMessage'][_0xb814('0x5b')]);_0x4a4f9a['query']=_[_0xb814('0x5a')](_0x1b565c['query']);_0x4a4f9a[_0xb814('0x44')]=_[_0xb814('0x45')](_0x4a4f9a['model'],_0x4a4f9a[_0xb814('0x43')]);_0x135208[_0xb814('0x46')]=_[_0xb814('0x45')](_0x4a4f9a['model'],qs[_0xb814('0x47')](_0x1b565c['query'][_0xb814('0x47')]));_0x135208[_0xb814('0x46')]=_0x135208['attributes'][_0xb814('0x5c')]?_0x135208['attributes']:_0x4a4f9a['model'];if(_0x1b565c[_0xb814('0x43')][_0xb814('0x54')]){_0x135208[_0xb814('0x55')]=[{'all':!![]}];}_0x135208=_['merge']({},_0x135208,_0x1b565c[_0xb814('0x5d')]);return db['MailMessage'][_0xb814('0x5e')](_0x135208)[_0xb814('0x3a')](handleEntityNotFound(_0x37ffc6,null))['then'](respondWithResult(_0x37ffc6,null))[_0xb814('0x2e')](handleError(_0x37ffc6,null));};exports['update']=function(_0x25a607,_0x1656ed){if(_0x25a607[_0xb814('0x5f')]['id']){delete _0x25a607[_0xb814('0x5f')]['id'];}return db[_0xb814('0x52')][_0xb814('0x5e')]({'where':{'id':_0x25a607[_0xb814('0x59')]['id']}})[_0xb814('0x3a')](handleEntityNotFound(_0x1656ed,null))['then'](saveUpdates(_0x25a607[_0xb814('0x5f')],null))[_0xb814('0x3a')](respondWithResult(_0x1656ed,null))['catch'](handleError(_0x1656ed,null));};exports[_0xb814('0x3b')]=function(_0xe14249,_0x4d13db){return db[_0xb814('0x52')]['find']({'where':{'id':_0xe14249['params']['id']}})[_0xb814('0x3a')](handleEntityNotFound(_0x4d13db,null))['then'](removeEntity(_0x4d13db,null))[_0xb814('0x2e')](handleError(_0x4d13db,null));};exports[_0xb814('0x60')]=function(_0x2dec52,_0x586957){return db[_0xb814('0x52')]['describe']()[_0xb814('0x3a')](respondWithResult(_0x586957,null))[_0xb814('0x2e')](handleError(_0x586957,null));};exports[_0xb814('0x61')]=function(_0x176585,_0x19db3e){return db[_0xb814('0x52')][_0xb814('0x61')](_0x176585[_0xb814('0x5f')])[_0xb814('0x3a')](function(_0x4d611d){if(_0x4d611d){if(_0x4d611d[_0xb814('0x62')]===_0xb814('0x63')&&!_0x4d611d[_0xb814('0x64')]){return db[_0xb814('0x65')][_0xb814('0x66')]({'where':{'id':_0x4d611d[_0xb814('0x67')]},'include':[{'model':db['MailServerOut'],'as':_0xb814('0x68'),'raw':!![]}]})['then'](function(_0x3cd4f7){if(_0x3cd4f7&&_0x3cd4f7[_0xb814('0x68')]){var _0xac95cf={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x3cd4f7[_0xb814('0x68')]['service'])){_0xac95cf[_0xb814('0x69')]=_0x3cd4f7['Smtp'][_0xb814('0x69')];_0xac95cf[_0xb814('0x6a')]=_0x3cd4f7[_0xb814('0x68')][_0xb814('0x6a')];_0xac95cf[_0xb814('0x6b')]=_0x3cd4f7[_0xb814('0x68')][_0xb814('0x6b')];if(_0x3cd4f7['Smtp'][_0xb814('0x6c')]){_0xac95cf['auth']={'user':_0x3cd4f7[_0xb814('0x68')][_0xb814('0x6d')],'pass':_0x3cd4f7[_0xb814('0x68')][_0xb814('0x6e')]};}}else{_0xac95cf[_0xb814('0x6f')]=_0x3cd4f7[_0xb814('0x68')]['service'];_0xac95cf[_0xb814('0x70')]={'user':_0x3cd4f7[_0xb814('0x68')]['user'],'pass':_0x3cd4f7[_0xb814('0x68')][_0xb814('0x6e')]};_0xac95cf[_0xb814('0x6b')]=_0x3cd4f7[_0xb814('0x68')][_0xb814('0x6b')];}if(_0x176585['body'][_0xb814('0x71')]&&_0x176585['body'][_0xb814('0x71')][_0xb814('0x5c')]){for(var _0x2645f6=0x0;_0x2645f6<_0x176585[_0xb814('0x5f')][_0xb814('0x71')][_0xb814('0x5c')];_0x2645f6+=0x1){_0x176585['body']['attachments'][_0x2645f6]={'filename':_0x176585['body'][_0xb814('0x71')][_0x2645f6]['name'],'path':path[_0xb814('0x72')](config[_0xb814('0x73')],_0xb814('0x74'),_0x176585['body'][_0xb814('0x71')][_0x2645f6][_0xb814('0x75')])};}}return{'account':_0xac95cf,'message':_0x176585[_0xb814('0x5f')]};}})['then'](function(_0x30f717){if(_0x30f717){return respondWithRpcPromise(_0xb814('0x76'),_0xb814('0x77'),_0x30f717,client9003)[_0xb814('0x3a')](function(_0x555be0){return _0x4d611d['update']({'read':!![],'messageId':_0x555be0[_0xb814('0x78')],'sentAt':moment()[_0xb814('0x79')](_0xb814('0x7a'))});})[_0xb814('0x2e')](function(_0x42e0e6){logger[_0xb814('0x2a')]('%s',JSON[_0xb814('0x29')](_0x42e0e6));return _0x4d611d;});}return _0x4d611d;});}return _0x4d611d;}})[_0xb814('0x3a')](respondWithResult(_0x19db3e,0xc9))[_0xb814('0x2e')](handleError(_0x19db3e,null));};var interaction_log=require(_0xb814('0x17'))(_0xb814('0x7b'));exports[_0xb814('0x7c')]=function(_0x3ef474,_0x21fc41,_0xc94e99){var _0x55a9c4={'channel':_0xb814('0x7d')};if(_0x3ef474[_0xb814('0x5f')]['id']){delete _0x3ef474[_0xb814('0x5f')]['id'];}_0x3ef474[_0xb814('0x5f')][_0xb814('0x7e')]=!![];_0x3ef474[_0xb814('0x5f')]['readAt']=moment()[_0xb814('0x79')]('YYYY-MM-DD\x20HH:mm:ss');_0x3ef474[_0xb814('0x5f')][_0xb814('0x7f')]=_0x3ef474[_0xb814('0x5f')][_0xb814('0x7f')]||_0x3ef474[_0xb814('0x6d')]['id'];return db['MailMessage']['find']({'where':{'id':_0x3ef474[_0xb814('0x59')]['id'],'UserId':null},'include':[{'model':db[_0xb814('0x80')],'as':_0xb814('0x81')}]})[_0xb814('0x3a')](handleEntityNotFound(_0x21fc41,null))['then'](saveUpdates(_0x3ef474[_0xb814('0x5f')],null))['then'](function(_0x39073c){if(_0x39073c){_0x55a9c4[_0xb814('0x2c')]=_0x39073c['get']({'plain':!![]});return db['MailInteraction'][_0xb814('0x5e')]({'where':{'id':_0x39073c['MailInteractionId']}});}return null;})[_0xb814('0x3a')](handleEntityNotFound(_0x21fc41,null))[_0xb814('0x3a')](function(_0x3c770d){if(_0x3c770d){return _0x3c770d[_0xb814('0x39')]({'UserId':_0x3ef474[_0xb814('0x5f')][_0xb814('0x7f')],'read1stAt':_[_0xb814('0x82')](_0x3c770d['read1stAt'])?moment()[_0xb814('0x79')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xb814('0x3a')](function(_0x590145){if(_0x590145){_0x55a9c4[_0xb814('0x83')]=_0x590145[_0xb814('0x84')]({'plain':!![]});interaction_log['info'](_0xb814('0x85'),_0x3ef474['user']['id'],_0x3ef474[_0xb814('0x6d')][_0xb814('0x3d')],_0x3ef474['user']['role'],_0x55a9c4[_0xb814('0x83')]['id'],_0x3ef474[_0xb814('0x5f')]?JSON[_0xb814('0x29')](_0x3ef474[_0xb814('0x5f')]):_0xb814('0x86'));return respondWithRpcPromise(_0xb814('0x87'),_0xb814('0x88'),_0x55a9c4);}return null;})[_0xb814('0x3a')](function(_0x8cb107){if(_0x8cb107){if(_0x3ef474[_0xb814('0x5f')]['manual']){_0x55a9c4['message']['interface']=util['format']('SIP/%s',_0x3ef474[_0xb814('0x6d')][_0xb814('0x3d')]);_0x55a9c4[_0xb814('0x2c')]['channel']=_0x55a9c4[_0xb814('0x89')];_0x55a9c4[_0xb814('0x2c')][_0xb814('0x8a')]=_0xb814('0x7c');return respondWithRpcPromise(_0xb814('0x8b'),_0xb814('0x8b'),{'event':_0xb814('0x8c'),'message':_0x55a9c4[_0xb814('0x2c')]},client9002)['then'](function(){return _0x55a9c4;});}return _0x55a9c4;}return null;})[_0xb814('0x3a')](respondWithResult(_0x21fc41,null))[_0xb814('0x2e')](handleError(_0x21fc41,null));};var interaction_log=require(_0xb814('0x17'))(_0xb814('0x7b'));exports['reject']=function(_0x29c1a4,_0x280af5,_0x3f4b23){var _0x3037f2={'agent':{},'channel':_0xb814('0x7d')};if(_0x29c1a4['body']['id']){delete _0x29c1a4['body']['id'];}_0x29c1a4[_0xb814('0x5f')]['UserId']=_0x29c1a4[_0xb814('0x5f')][_0xb814('0x7f')]||_0x29c1a4['user']['id'];_0x3037f2[_0xb814('0x8d')]['id']=_0x29c1a4['body'][_0xb814('0x7f')];return db['MailMessage'][_0xb814('0x5e')]({'where':{'id':_0x29c1a4[_0xb814('0x59')]['id'],'UserId':null}})[_0xb814('0x3a')](handleEntityNotFound(_0x280af5,null))[_0xb814('0x3a')](function(_0x2d8899){if(_0x2d8899){_0x3037f2[_0xb814('0x2c')]=_0x2d8899[_0xb814('0x84')]({'plain':!![]});return db['MailInteraction']['find']({'where':{'id':_0x2d8899[_0xb814('0x8e')]}});}return null;})['then'](handleEntityNotFound(_0x280af5,null))['then'](function(_0x2d0061){if(_0x2d0061){_0x3037f2[_0xb814('0x83')]=_0x2d0061[_0xb814('0x84')]({'plain':!![]});interaction_log['info'](_0xb814('0x8f'),_0x29c1a4['user']['id'],_0x29c1a4[_0xb814('0x6d')][_0xb814('0x3d')],_0x29c1a4[_0xb814('0x6d')][_0xb814('0x90')],_0x3037f2['interaction']['id'],_0x29c1a4[_0xb814('0x5f')]?JSON[_0xb814('0x29')](_0x29c1a4[_0xb814('0x5f')]):'null');return respondWithRpcPromise(_0xb814('0x91'),_0xb814('0x92'),_0x3037f2);}return null;})[_0xb814('0x3a')](function(_0x56c024){if(_0x56c024){_0x56c024[_0xb814('0x2c')][_0xb814('0x93')]=util[_0xb814('0x79')](_0xb814('0x94'),_0x29c1a4[_0xb814('0x6d')][_0xb814('0x3d')]);_0x56c024[_0xb814('0x2c')][_0xb814('0x89')]=_0x3037f2[_0xb814('0x89')];_0x56c024[_0xb814('0x2c')][_0xb814('0x8a')]=_0xb814('0x37');respondWithRpcPromise(_0xb814('0x8b'),'EventManager',{'event':'rejectmessage','message':_0x56c024[_0xb814('0x2c')]},client9002);return _0x3037f2;}return null;})['then'](respondWithResult(_0x280af5,null))[_0xb814('0x2e')](handleError(_0x280af5,null));};exports[_0xb814('0x95')]=function(_0x43ab12,_0x2bc95b){var _0x405db7=moment()[_0xb814('0x96')]()[_0xb814('0x97')]();var _0x5db5d0=path['join'](config[_0xb814('0x73')],'server',_0xb814('0x98'),_0xb814('0x99'));var _0x1becf7=path['join'](config[_0xb814('0x73')],_0xb814('0x9a'),_0xb814('0x98'),_0xb814('0x71'));var _0x3860b8=util['format'](_0xb814('0x9b'),_0x405db7);return db[_0xb814('0x52')]['find']({'where':{'id':_0x43ab12[_0xb814('0x59')]['id']},'attributes':['id',_0xb814('0x5f'),_0xb814('0x9c'),'to','cc','bcc',_0xb814('0x9d'),_0xb814('0x9e')],'include':_0x43ab12['query'][_0xb814('0x71')]?[{'model':db[_0xb814('0x9f')],'as':'Attachments'}]:undefined})[_0xb814('0x3a')](handleEntityNotFound(_0x2bc95b,null))[_0xb814('0x3a')](function(_0x3f4cbf){if(_0x3f4cbf){var _0x2365f9=_0x3f4cbf;var _0x35d479={'from':_0x2365f9[_0xb814('0x9c')],'to':_0x2365f9['to'],'subject':_0x2365f9[_0xb814('0x9d')],'html':_0x2365f9[_0xb814('0x5f')],'headers':{'Date':moment(_0x2365f9[_0xb814('0x9e')])[_0xb814('0x79')](_0xb814('0xa0'))},'attachments':[]};if(_0x3f4cbf['cc']){_0x35d479[_0xb814('0xa1')]['Cc']=_0x3f4cbf['cc'];}if(_0x3f4cbf['bcc']){_0x35d479['headers'][_0xb814('0xa2')]=_0x3f4cbf['bcc'];}return new BPromise(function(_0x5bda03,_0x3f2ff9){if(_0x3f4cbf['Attachments']){for(var _0x4f0427=0x0;_0x4f0427<_0x3f4cbf['Attachments'][_0xb814('0x5c')];_0x4f0427++){var _0x2ce4de=_0x3f4cbf[_0xb814('0xa3')][_0x4f0427];var _0x5eb4b1=path[_0xb814('0x72')](_0x1becf7,_0x2ce4de['basename']);if(fs[_0xb814('0xa4')](_0x5eb4b1)){_0x35d479[_0xb814('0x71')]['push']({'name':_0x2ce4de[_0xb814('0x3d')],'contentType':_0x2ce4de['type'],'data':fs[_0xb814('0xa5')](_0x5eb4b1)});}}}emlformat[_0xb814('0xa6')](_0x35d479,function(_0x21d6e5,_0x39ce17){if(_0x21d6e5)return _0x3f2ff9(_0x21d6e5);fs[_0xb814('0xa7')](path[_0xb814('0x72')](_0x5db5d0,_0x3860b8),_0x39ce17);return _0x5bda03(_0x39ce17);});});}})[_0xb814('0x3a')](function(_0x2b7abf){if(_0x2b7abf){return _0x2bc95b[_0xb814('0x95')](path[_0xb814('0x72')](_0x5db5d0,_0x3860b8),_0x3860b8,function(_0x3df3e9){if(_0x3df3e9){console[_0xb814('0xa8')](_0xb814('0xa9'),_0x3df3e9);}else{fs[_0xb814('0xaa')](path[_0xb814('0x72')](_0x5db5d0,_0x3860b8));}});}})['catch'](handleError(_0x2bc95b,null));}; \ No newline at end of file +var _0x7a54=['reject','stack','name','send','MailMessage','rawAttributes','fieldName','type','keys','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','map','key','VIRTUAL','field','rows','catch','show','params','includeAll','options','find','update','body','destroy','describe','direction','out','secret','MailAccount','MailAccountId','Smtp','isNil','host','port','secure','auth','user','pass','service','attachments','root','server/files/attachments','basename','sendMail','messageId','YYYY-MM-DD\x20HH:mm:ss','../../config/logger','mail-interactions','accept','mail','read','readAt','format','UserId','CmContact','Contact','get','MailInteraction','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','manual','interface','channel','acceptmessage','MailInteractionId','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','SIP/%s','event','EventManager','rejectmessage','unix','toString','server','files','tmp','join','message-%s.eml','from','bcc','createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','readFileSync','writeFileSync','download','err','unlinkSync','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./mailMessage.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','then','info','request\x20sent','debug','stringify','error','code','MailMessage,\x20%s,\x20%s','message','sendStatus','status','end','count','offset','set','Content-Range','apply'];(function(_0x1ae96b,_0x3424df){var _0x3ec1a9=function(_0x4cbce1){while(--_0x4cbce1){_0x1ae96b['push'](_0x1ae96b['shift']());}};_0x3ec1a9(++_0x3424df);}(_0x7a54,0x106));var _0x47a5=function(_0x8e4da9,_0x4f7229){_0x8e4da9=_0x8e4da9-0x0;var _0x42fa15=_0x7a54[_0x8e4da9];return _0x42fa15;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var db=require(_0x47a5('0x14'))['db'];config[_0x47a5('0x15')]=_[_0x47a5('0x16')](config[_0x47a5('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x47a5('0x17'))(new Redis(config[_0x47a5('0x15')]));require(_0x47a5('0x18'))[_0x47a5('0x19')](socket);var jayson=require(_0x47a5('0x1a'));var client=jayson[_0x47a5('0x1b')][_0x47a5('0x1c')]({'port':0x232c});var client9003=jayson[_0x47a5('0x1b')]['http']({'port':0x232b});var client9002=jayson[_0x47a5('0x1b')][_0x47a5('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x3b001e,_0x2a2cbb,_0x1ef44c){if(_0x1ef44c){var _0x574af6=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x574af6['test'](_0x2a2cbb)){return _0x3b001e;}else{throw new Error(_0x47a5('0x1d'));}}else{return _0x3b001e;}}function respondWithRpcPromise(_0x4b966e,_0x5247fd,_0x423a81,_0xaf70a6){return new BPromise(function(_0x2ce454,_0x1ef371){var _0x477b1d=_0xaf70a6||client;return _0x477b1d[_0x47a5('0x1e')](_0x4b966e,_0x423a81)[_0x47a5('0x1f')](function(_0xe3c618){logger[_0x47a5('0x20')]('MailMessage,\x20%s,\x20%s',_0x5247fd,_0x47a5('0x21'));logger[_0x47a5('0x22')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x5247fd,_0x47a5('0x21'),JSON[_0x47a5('0x23')](_0xe3c618));if(_0xe3c618[_0x47a5('0x24')]){if(_0xe3c618['error'][_0x47a5('0x25')]===0x1f4){logger[_0x47a5('0x24')](_0x47a5('0x26'),_0x5247fd,_0xe3c618[_0x47a5('0x24')]['message']);return _0x1ef371(_0xe3c618[_0x47a5('0x24')][_0x47a5('0x27')]);}logger['error'](_0x47a5('0x26'),_0x5247fd,_0xe3c618[_0x47a5('0x24')][_0x47a5('0x27')]);return _0x2ce454(_0xe3c618[_0x47a5('0x24')][_0x47a5('0x27')]);}else{logger['info']('MailMessage,\x20%s,\x20%s',_0x5247fd,_0x47a5('0x21'));_0x2ce454(_0xe3c618['result'][_0x47a5('0x27')]);}})['catch'](function(_0x23cb77){logger[_0x47a5('0x24')](_0x47a5('0x26'),_0x5247fd,_0x23cb77);_0x1ef371(_0x23cb77);});});}function respondWithStatusCode(_0x1dac65,_0x21f296){_0x21f296=_0x21f296||0xcc;return function(_0x3ba0b7){if(_0x3ba0b7){return _0x1dac65[_0x47a5('0x28')](_0x21f296);}return _0x1dac65[_0x47a5('0x29')](_0x21f296)[_0x47a5('0x2a')]();};}function respondWithResult(_0x361bfa,_0x1127f8){_0x1127f8=_0x1127f8||0xc8;return function(_0x11a4fa){if(_0x11a4fa){return _0x361bfa[_0x47a5('0x29')](_0x1127f8)['json'](_0x11a4fa);}};}function respondWithFilteredResult(_0x243210,_0x51833b){return function(_0x2ef875){if(_0x2ef875){var _0x9ac908=_0x2ef875[_0x47a5('0x2b')],_0x16901f=_0x51833b[_0x47a5('0x2c')],_0x4d6b57=_0x51833b[_0x47a5('0x2c')]+_0x51833b['limit'],_0x256650;if(_0x4d6b57>=_0x9ac908){_0x4d6b57=_0x9ac908;_0x256650=0xc8;}else{_0x256650=0xce;}_0x243210['status'](_0x256650);return _0x243210[_0x47a5('0x2d')](_0x47a5('0x2e'),_0x16901f+'-'+_0x4d6b57+'/'+_0x9ac908)['json'](_0x2ef875);}return null;};}function patchUpdates(_0x4e1006){return function(_0x836303){try{jsonpatch[_0x47a5('0x2f')](_0x836303,_0x4e1006,!![]);}catch(_0x57bff6){return BPromise[_0x47a5('0x30')](_0x57bff6);}return _0x836303['save']();};}function saveUpdates(_0x122ed6,_0xd972c){return function(_0x5c5162){if(_0x5c5162){return _0x5c5162['update'](_0x122ed6)[_0x47a5('0x1f')](function(_0x5910bb){return _0x5910bb;});}return null;};}function removeEntity(_0x403028,_0x87e4c9){return function(_0xf269a8){if(_0xf269a8){return _0xf269a8['destroy']()[_0x47a5('0x1f')](function(){_0x403028['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x65542e,_0x5a8a7c){return function(_0x25cce0){if(!_0x25cce0){_0x65542e['sendStatus'](0x194);}return _0x25cce0;};}function handleError(_0x21ad34,_0x3534cb){_0x3534cb=_0x3534cb||0x1f4;return function(_0x38c8d4){logger[_0x47a5('0x24')](_0x38c8d4[_0x47a5('0x31')]);if(_0x38c8d4[_0x47a5('0x32')]){delete _0x38c8d4[_0x47a5('0x32')];}_0x21ad34[_0x47a5('0x29')](_0x3534cb)[_0x47a5('0x33')](_0x38c8d4);};}exports['index']=function(_0x396a9a,_0x10f136){var _0x511c06={},_0x2c50d6={},_0x2bf53d={'count':0x0,'rows':[]};var _0x1d4348=_['map'](db[_0x47a5('0x34')][_0x47a5('0x35')],function(_0x596097){return{'name':_0x596097[_0x47a5('0x36')],'type':_0x596097[_0x47a5('0x37')]['key']};});_0x2c50d6['model']=_['map'](_0x1d4348,_0x47a5('0x32'));_0x2c50d6['query']=_[_0x47a5('0x38')](_0x396a9a[_0x47a5('0x39')]);_0x2c50d6[_0x47a5('0x3a')]=_[_0x47a5('0x3b')](_0x2c50d6[_0x47a5('0x3c')],_0x2c50d6[_0x47a5('0x39')]);_0x511c06[_0x47a5('0x3d')]=_[_0x47a5('0x3b')](_0x2c50d6[_0x47a5('0x3c')],qs[_0x47a5('0x3e')](_0x396a9a[_0x47a5('0x39')][_0x47a5('0x3e')]));_0x511c06[_0x47a5('0x3d')]=_0x511c06['attributes'][_0x47a5('0x3f')]?_0x511c06[_0x47a5('0x3d')]:_0x2c50d6[_0x47a5('0x3c')];if(!_0x396a9a[_0x47a5('0x39')]['hasOwnProperty'](_0x47a5('0x40'))){_0x511c06['limit']=qs['limit'](_0x396a9a['query']['limit']);_0x511c06[_0x47a5('0x2c')]=qs['offset'](_0x396a9a[_0x47a5('0x39')][_0x47a5('0x2c')]);}_0x511c06[_0x47a5('0x41')]=qs['sort'](_0x396a9a[_0x47a5('0x39')][_0x47a5('0x42')]);_0x511c06['where']=qs['filters'](_[_0x47a5('0x43')](_0x396a9a['query'],_0x2c50d6[_0x47a5('0x3a')]));if(_0x396a9a[_0x47a5('0x39')][_0x47a5('0x44')]){_0x511c06[_0x47a5('0x45')]=_[_0x47a5('0x46')](_0x511c06[_0x47a5('0x45')],{'$or':_[_0x47a5('0x47')](_0x1d4348,function(_0x17cc42){if(_0x17cc42[_0x47a5('0x37')][_0x47a5('0x48')]!==_0x47a5('0x49')){var _0x3c3ebf={};_0x3c3ebf[_0x17cc42[_0x47a5('0x4a')]]={'$like':'%'+_0x396a9a[_0x47a5('0x39')][_0x47a5('0x44')]+'%'};return _0x3c3ebf;}})});}_0x511c06=_[_0x47a5('0x46')]({},_0x511c06,_0x396a9a['options']);var _0x2d38de={'where':_0x511c06[_0x47a5('0x45')]};return db['MailMessage']['count'](_0x2d38de)[_0x47a5('0x1f')](function(_0x560e4e){_0x2bf53d[_0x47a5('0x2b')]=_0x560e4e;if(_0x396a9a[_0x47a5('0x39')]['includeAll']){_0x511c06['include']=[{'all':!![]}];}return db[_0x47a5('0x34')]['findAll'](_0x511c06);})[_0x47a5('0x1f')](function(_0x1d1039){_0x2bf53d[_0x47a5('0x4b')]=_0x1d1039;return _0x2bf53d;})[_0x47a5('0x1f')](respondWithFilteredResult(_0x10f136,_0x511c06))[_0x47a5('0x4c')](handleError(_0x10f136,null));};exports[_0x47a5('0x4d')]=function(_0x238ebb,_0x53e994){var _0x48a0ef={'raw':!![],'where':{'id':_0x238ebb[_0x47a5('0x4e')]['id']}},_0x2dd1db={};_0x2dd1db[_0x47a5('0x3c')]=_[_0x47a5('0x38')](db[_0x47a5('0x34')][_0x47a5('0x35')]);_0x2dd1db[_0x47a5('0x39')]=_['keys'](_0x238ebb[_0x47a5('0x39')]);_0x2dd1db[_0x47a5('0x3a')]=_[_0x47a5('0x3b')](_0x2dd1db['model'],_0x2dd1db[_0x47a5('0x39')]);_0x48a0ef['attributes']=_[_0x47a5('0x3b')](_0x2dd1db[_0x47a5('0x3c')],qs[_0x47a5('0x3e')](_0x238ebb[_0x47a5('0x39')]['fields']));_0x48a0ef[_0x47a5('0x3d')]=_0x48a0ef[_0x47a5('0x3d')][_0x47a5('0x3f')]?_0x48a0ef[_0x47a5('0x3d')]:_0x2dd1db[_0x47a5('0x3c')];if(_0x238ebb[_0x47a5('0x39')][_0x47a5('0x4f')]){_0x48a0ef['include']=[{'all':!![]}];}_0x48a0ef=_[_0x47a5('0x46')]({},_0x48a0ef,_0x238ebb[_0x47a5('0x50')]);return db[_0x47a5('0x34')][_0x47a5('0x51')](_0x48a0ef)[_0x47a5('0x1f')](handleEntityNotFound(_0x53e994,null))[_0x47a5('0x1f')](respondWithResult(_0x53e994,null))['catch'](handleError(_0x53e994,null));};exports[_0x47a5('0x52')]=function(_0x245a15,_0x1aa581){if(_0x245a15['body']['id']){delete _0x245a15[_0x47a5('0x53')]['id'];}return db[_0x47a5('0x34')][_0x47a5('0x51')]({'where':{'id':_0x245a15['params']['id']}})['then'](handleEntityNotFound(_0x1aa581,null))[_0x47a5('0x1f')](saveUpdates(_0x245a15[_0x47a5('0x53')],null))['then'](respondWithResult(_0x1aa581,null))['catch'](handleError(_0x1aa581,null));};exports[_0x47a5('0x54')]=function(_0x4d6a82,_0x16bb8a){return db['MailMessage']['find']({'where':{'id':_0x4d6a82[_0x47a5('0x4e')]['id']}})[_0x47a5('0x1f')](handleEntityNotFound(_0x16bb8a,null))['then'](removeEntity(_0x16bb8a,null))[_0x47a5('0x4c')](handleError(_0x16bb8a,null));};exports[_0x47a5('0x55')]=function(_0x4b706a,_0x5b6127){return db[_0x47a5('0x34')][_0x47a5('0x55')]()[_0x47a5('0x1f')](respondWithResult(_0x5b6127,null))[_0x47a5('0x4c')](handleError(_0x5b6127,null));};exports['create']=function(_0x199621,_0x2b4255){return db[_0x47a5('0x34')]['create'](_0x199621[_0x47a5('0x53')])['then'](function(_0x485e3c){if(_0x485e3c){if(_0x485e3c[_0x47a5('0x56')]===_0x47a5('0x57')&&!_0x485e3c[_0x47a5('0x58')]){return db[_0x47a5('0x59')]['findOne']({'where':{'id':_0x485e3c[_0x47a5('0x5a')]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]})['then'](function(_0x4f8564){if(_0x4f8564&&_0x4f8564[_0x47a5('0x5b')]){var _0x6cd4ea={'tls':{'rejectUnauthorized':![]}};if(_[_0x47a5('0x5c')](_0x4f8564['Smtp']['service'])){_0x6cd4ea[_0x47a5('0x5d')]=_0x4f8564[_0x47a5('0x5b')][_0x47a5('0x5d')];_0x6cd4ea[_0x47a5('0x5e')]=_0x4f8564[_0x47a5('0x5b')]['port'];_0x6cd4ea[_0x47a5('0x5f')]=_0x4f8564['Smtp'][_0x47a5('0x5f')];if(_0x4f8564[_0x47a5('0x5b')]['authentication']){_0x6cd4ea[_0x47a5('0x60')]={'user':_0x4f8564[_0x47a5('0x5b')][_0x47a5('0x61')],'pass':_0x4f8564[_0x47a5('0x5b')][_0x47a5('0x62')]};}}else{_0x6cd4ea[_0x47a5('0x63')]=_0x4f8564[_0x47a5('0x5b')][_0x47a5('0x63')];_0x6cd4ea['auth']={'user':_0x4f8564[_0x47a5('0x5b')][_0x47a5('0x61')],'pass':_0x4f8564[_0x47a5('0x5b')][_0x47a5('0x62')]};_0x6cd4ea[_0x47a5('0x5f')]=_0x4f8564['Smtp'][_0x47a5('0x5f')];}if(_0x199621[_0x47a5('0x53')][_0x47a5('0x64')]&&_0x199621[_0x47a5('0x53')][_0x47a5('0x64')][_0x47a5('0x3f')]){for(var _0x453191=0x0;_0x453191<_0x199621[_0x47a5('0x53')][_0x47a5('0x64')][_0x47a5('0x3f')];_0x453191+=0x1){_0x199621[_0x47a5('0x53')][_0x47a5('0x64')][_0x453191]={'filename':_0x199621[_0x47a5('0x53')][_0x47a5('0x64')][_0x453191][_0x47a5('0x32')],'path':path['join'](config[_0x47a5('0x65')],_0x47a5('0x66'),_0x199621[_0x47a5('0x53')]['attachments'][_0x453191][_0x47a5('0x67')])};}}return{'account':_0x6cd4ea,'message':_0x199621[_0x47a5('0x53')]};}})[_0x47a5('0x1f')](function(_0x26f1ac){if(_0x26f1ac){return respondWithRpcPromise('SendMail',_0x47a5('0x68'),_0x26f1ac,client9003)['then'](function(_0x2d5ee6){return _0x485e3c['update']({'read':!![],'messageId':_0x2d5ee6[_0x47a5('0x69')],'sentAt':moment()['format'](_0x47a5('0x6a'))});})[_0x47a5('0x4c')](function(_0x2578d6){logger['error']('%s',JSON['stringify'](_0x2578d6));return _0x485e3c;});}return _0x485e3c;});}return _0x485e3c;}})['then'](respondWithResult(_0x2b4255,0xc9))[_0x47a5('0x4c')](handleError(_0x2b4255,null));};var interaction_log=require(_0x47a5('0x6b'))(_0x47a5('0x6c'));exports[_0x47a5('0x6d')]=function(_0x525055,_0x6c0f0,_0xc12a6a){var _0x390bc0={'channel':_0x47a5('0x6e')};if(_0x525055[_0x47a5('0x53')]['id']){delete _0x525055[_0x47a5('0x53')]['id'];}_0x525055[_0x47a5('0x53')][_0x47a5('0x6f')]=!![];_0x525055[_0x47a5('0x53')][_0x47a5('0x70')]=moment()[_0x47a5('0x71')](_0x47a5('0x6a'));_0x525055['body'][_0x47a5('0x72')]=_0x525055['body'][_0x47a5('0x72')]||_0x525055[_0x47a5('0x61')]['id'];return db[_0x47a5('0x34')][_0x47a5('0x51')]({'where':{'id':_0x525055[_0x47a5('0x4e')]['id'],'UserId':null},'include':[{'model':db[_0x47a5('0x73')],'as':_0x47a5('0x74')}]})[_0x47a5('0x1f')](handleEntityNotFound(_0x6c0f0,null))[_0x47a5('0x1f')](saveUpdates(_0x525055[_0x47a5('0x53')],null))[_0x47a5('0x1f')](function(_0x1f07ac){if(_0x1f07ac){_0x390bc0[_0x47a5('0x27')]=_0x1f07ac[_0x47a5('0x75')]({'plain':!![]});return db[_0x47a5('0x76')]['find']({'where':{'id':_0x1f07ac['MailInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x6c0f0,null))['then'](function(_0x490e28){if(_0x490e28){return _0x490e28[_0x47a5('0x52')]({'UserId':_0x525055['body'][_0x47a5('0x72')],'read1stAt':_[_0x47a5('0x5c')](_0x490e28[_0x47a5('0x77')])?moment()[_0x47a5('0x71')](_0x47a5('0x6a')):undefined});}return null;})[_0x47a5('0x1f')](function(_0x218dfa){if(_0x218dfa){_0x390bc0[_0x47a5('0x78')]=_0x218dfa[_0x47a5('0x75')]({'plain':!![]});interaction_log[_0x47a5('0x20')](_0x47a5('0x79'),_0x525055['user']['id'],_0x525055[_0x47a5('0x61')][_0x47a5('0x32')],_0x525055[_0x47a5('0x61')]['role'],_0x390bc0[_0x47a5('0x78')]['id'],_0x525055[_0x47a5('0x53')]?JSON[_0x47a5('0x23')](_0x525055['body']):_0x47a5('0x7a'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x390bc0);}return null;})[_0x47a5('0x1f')](function(_0x292d9c){if(_0x292d9c){if(_0x525055[_0x47a5('0x53')][_0x47a5('0x7b')]){_0x390bc0[_0x47a5('0x27')][_0x47a5('0x7c')]=util['format']('SIP/%s',_0x525055[_0x47a5('0x61')]['name']);_0x390bc0[_0x47a5('0x27')][_0x47a5('0x7d')]=_0x390bc0[_0x47a5('0x7d')];_0x390bc0[_0x47a5('0x27')]['event']=_0x47a5('0x6d');return respondWithRpcPromise('EventManager','EventManager',{'event':_0x47a5('0x7e'),'message':_0x390bc0[_0x47a5('0x27')]},client9002)['then'](function(){return _0x390bc0;});}return _0x390bc0;}return null;})[_0x47a5('0x1f')](respondWithResult(_0x6c0f0,null))[_0x47a5('0x4c')](handleError(_0x6c0f0,null));};var interaction_log=require(_0x47a5('0x6b'))('mail-interactions');exports[_0x47a5('0x30')]=function(_0x578e27,_0x2307da,_0x219beb){var _0x63e2e5={'agent':{},'channel':'mail'};if(_0x578e27[_0x47a5('0x53')]['id']){delete _0x578e27[_0x47a5('0x53')]['id'];}_0x578e27[_0x47a5('0x53')]['UserId']=_0x578e27[_0x47a5('0x53')]['UserId']||_0x578e27[_0x47a5('0x61')]['id'];_0x63e2e5['agent']['id']=_0x578e27[_0x47a5('0x53')][_0x47a5('0x72')];return db[_0x47a5('0x34')][_0x47a5('0x51')]({'where':{'id':_0x578e27['params']['id'],'UserId':null}})[_0x47a5('0x1f')](handleEntityNotFound(_0x2307da,null))[_0x47a5('0x1f')](function(_0x23c393){if(_0x23c393){_0x63e2e5[_0x47a5('0x27')]=_0x23c393[_0x47a5('0x75')]({'plain':!![]});return db['MailInteraction']['find']({'where':{'id':_0x23c393[_0x47a5('0x7f')]}});}return null;})['then'](handleEntityNotFound(_0x2307da,null))[_0x47a5('0x1f')](function(_0xa8809a){if(_0xa8809a){_0x63e2e5[_0x47a5('0x78')]=_0xa8809a['get']({'plain':!![]});interaction_log[_0x47a5('0x20')](_0x47a5('0x80'),_0x578e27['user']['id'],_0x578e27[_0x47a5('0x61')][_0x47a5('0x32')],_0x578e27[_0x47a5('0x61')][_0x47a5('0x81')],_0x63e2e5['interaction']['id'],_0x578e27['body']?JSON[_0x47a5('0x23')](_0x578e27[_0x47a5('0x53')]):'null');return respondWithRpcPromise(_0x47a5('0x82'),_0x47a5('0x83'),_0x63e2e5);}return null;})['then'](function(_0x309a92){if(_0x309a92){_0x309a92[_0x47a5('0x27')][_0x47a5('0x7c')]=util['format'](_0x47a5('0x84'),_0x578e27['user'][_0x47a5('0x32')]);_0x309a92['message'][_0x47a5('0x7d')]=_0x63e2e5[_0x47a5('0x7d')];_0x309a92['message'][_0x47a5('0x85')]='reject';respondWithRpcPromise(_0x47a5('0x86'),_0x47a5('0x86'),{'event':_0x47a5('0x87'),'message':_0x309a92[_0x47a5('0x27')]},client9002);return _0x63e2e5;}return null;})['then'](respondWithResult(_0x2307da,null))[_0x47a5('0x4c')](handleError(_0x2307da,null));};exports['download']=function(_0x52be82,_0x2bb2df){var _0x46bdb1=moment()[_0x47a5('0x88')]()[_0x47a5('0x89')]();var _0x380c8b=path['join'](config[_0x47a5('0x65')],_0x47a5('0x8a'),_0x47a5('0x8b'),_0x47a5('0x8c'));var _0x50b98e=path[_0x47a5('0x8d')](config['root'],_0x47a5('0x8a'),_0x47a5('0x8b'),_0x47a5('0x64'));var _0x18a4c4=util[_0x47a5('0x71')](_0x47a5('0x8e'),_0x46bdb1);return db[_0x47a5('0x34')][_0x47a5('0x51')]({'where':{'id':_0x52be82[_0x47a5('0x4e')]['id']},'attributes':['id','body',_0x47a5('0x8f'),'to','cc',_0x47a5('0x90'),'subject',_0x47a5('0x91')],'include':_0x52be82[_0x47a5('0x39')][_0x47a5('0x64')]?[{'model':db['Attachment'],'as':'Attachments'}]:undefined})[_0x47a5('0x1f')](handleEntityNotFound(_0x2bb2df,null))[_0x47a5('0x1f')](function(_0x47fbb6){if(_0x47fbb6){var _0x537552=_0x47fbb6;var _0x91aa99={'from':_0x537552[_0x47a5('0x8f')],'to':_0x537552['to'],'subject':_0x537552['subject'],'html':_0x537552[_0x47a5('0x53')],'headers':{'Date':moment(_0x537552[_0x47a5('0x91')])['format'](_0x47a5('0x92'))},'attachments':[]};if(_0x47fbb6['cc']){_0x91aa99[_0x47a5('0x93')]['Cc']=_0x47fbb6['cc'];}if(_0x47fbb6[_0x47a5('0x90')]){_0x91aa99[_0x47a5('0x93')][_0x47a5('0x94')]=_0x47fbb6[_0x47a5('0x90')];}return new BPromise(function(_0x5d89a1,_0x4c9894){if(_0x47fbb6['Attachments']){for(var _0x133b7a=0x0;_0x133b7a<_0x47fbb6[_0x47a5('0x95')]['length'];_0x133b7a++){var _0x2006cb=_0x47fbb6[_0x47a5('0x95')][_0x133b7a];var _0x32ca1c=path[_0x47a5('0x8d')](_0x50b98e,_0x2006cb[_0x47a5('0x67')]);if(fs['existsSync'](_0x32ca1c)){_0x91aa99[_0x47a5('0x64')]['push']({'name':_0x2006cb['name'],'contentType':_0x2006cb['type'],'data':fs[_0x47a5('0x96')](_0x32ca1c)});}}}emlformat['build'](_0x91aa99,function(_0xe5fbf8,_0xf3edc8){if(_0xe5fbf8)return _0x4c9894(_0xe5fbf8);fs[_0x47a5('0x97')](path['join'](_0x380c8b,_0x18a4c4),_0xf3edc8);return _0x5d89a1(_0xf3edc8);});});}})[_0x47a5('0x1f')](function(_0x461d32){if(_0x461d32){return _0x2bb2df[_0x47a5('0x98')](path[_0x47a5('0x8d')](_0x380c8b,_0x18a4c4),_0x18a4c4,function(_0x392ad7){if(_0x392ad7){console['log'](_0x47a5('0x99'),_0x392ad7);}else{fs[_0x47a5('0x9a')](path['join'](_0x380c8b,_0x18a4c4));}});}})[_0x47a5('0x4c')](handleError(_0x2bb2df,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 8e612b8..41c1ce1 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 _0x6ea9=['../../mysqldb','save','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x2b99c7,_0xc5f0c0){var _0x3bb58b=function(_0xf3bc6a){while(--_0xf3bc6a){_0x2b99c7['push'](_0x2b99c7['shift']());}};_0x3bb58b(++_0xc5f0c0);}(_0x6ea9,0x117));var _0x96ea=function(_0x2ff8f6,_0x3bd557){_0x2ff8f6=_0x2ff8f6-0x0;var _0x4700b4=_0x6ea9[_0x2ff8f6];return _0x4700b4;};'use strict';var EventEmitter=require(_0x96ea('0x0'));var MailMessage=require(_0x96ea('0x1'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x96ea('0x2'),'afterUpdate':'update','afterDestroy':_0x96ea('0x3')};function emitEvent(_0x5bdeda){return function(_0x1d401e,_0x1afc4c,_0x42cc43){MailMessageEvents[_0x96ea('0x4')](_0x5bdeda+':'+_0x1d401e['id'],_0x1d401e);MailMessageEvents['emit'](_0x5bdeda,_0x1d401e);_0x42cc43(null);};}for(var e in events){if(events[_0x96ea('0x5')](e)){var event=events[e];MailMessage[_0x96ea('0x6')](e,emitEvent(event));}}module[_0x96ea('0x7')]=MailMessageEvents; \ No newline at end of file +var _0x7170=['MailMessage','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0xa45395,_0x5579e6){var _0x3c83d2=function(_0x5d013c){while(--_0x5d013c){_0xa45395['push'](_0xa45395['shift']());}};_0x3c83d2(++_0x5579e6);}(_0x7170,0xce));var _0x0717=function(_0x4c6edd,_0x36d671){_0x4c6edd=_0x4c6edd-0x0;var _0x1b5934=_0x7170[_0x4c6edd];return _0x1b5934;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0x0717('0x0'))['db'][_0x0717('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x0717('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0717('0x3'),'afterDestroy':_0x0717('0x4')};function emitEvent(_0x12b83f){return function(_0x4358ed,_0x4e813a,_0x5ef0ca){MailMessageEvents['emit'](_0x12b83f+':'+_0x4358ed['id'],_0x4358ed);MailMessageEvents[_0x0717('0x5')](_0x12b83f,_0x4358ed);_0x5ef0ca(null);};}for(var e in events){if(events[_0x0717('0x6')](e)){var event=events[e];MailMessage[_0x0717('0x7')](e,emitEvent(event));}}module[_0x0717('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 ff60d33..7842903 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 _0xc738=['define','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','fromString','models','get','direction','toLowerCase','secret','UserId','MailInteraction','findOne','MailInteractionId','then','update','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','html-to-text','rimraf','../../config/environment','./mailMessage.attributes','exports'];(function(_0x33056c,_0xbc21f8){var _0xbd3df9=function(_0x2ff91a){while(--_0x2ff91a){_0x33056c['push'](_0x33056c['shift']());}};_0xbd3df9(++_0xbc21f8);}(_0xc738,0xac));var _0x8c73=function(_0x5c18ef,_0xa2e81d){_0x5c18ef=_0x5c18ef-0x0;var _0x33789d=_0xc738[_0x5c18ef];return _0x33789d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8c73('0x0'))(_0x8c73('0x1'));var moment=require(_0x8c73('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var htmlToText=require(_0x8c73('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8c73('0x4'));var config=require(_0x8c73('0x5'));var attributes=require(_0x8c73('0x6'));module[_0x8c73('0x7')]=function(_0x18b794,_0x3cafeb){return _0x18b794[_0x8c73('0x8')]('MailMessage',attributes,{'tableName':_0x8c73('0x9'),'paranoid':![],'indexes':[{'name':_0x8c73('0xa'),'fields':[_0x8c73('0xa')]},{'name':_0x8c73('0xb'),'fields':[_0x8c73('0xc'),_0x8c73('0xd')],'type':_0x8c73('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x44ce5a,_0x2153ed,_0x34701c){if(_0x44ce5a[_0x8c73('0xf')]){_0x44ce5a[_0x8c73('0xc')]=htmlToText[_0x8c73('0x10')](_0x44ce5a[_0x8c73('0xf')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x34701c(null,_0x2153ed);},'afterCreate':function(_0x34ee1b,_0x500c25,_0x42176d){var _0x132a3c=_0x18b794[_0x8c73('0x11')];var _0x44dd08=_0x34ee1b[_0x8c73('0x12')]({'plain':!![]});if(_0x44dd08[_0x8c73('0x13')][_0x8c73('0x14')]()==='in'||_0x44dd08[_0x8c73('0x13')][_0x8c73('0x14')]()==='out'&&!_0x44dd08[_0x8c73('0x15')]&&!_['isNil'](_0x44dd08[_0x8c73('0x16')])){_0x132a3c[_0x8c73('0x17')][_0x8c73('0x18')]({'where':{'id':_0x44dd08[_0x8c73('0x19')]}})[_0x8c73('0x1a')](function(_0x45fa45){if(_0x45fa45){_0x45fa45[_0x8c73('0x1b')]({'lastMsgAt':_0x44dd08['createdAt'],'lastMsgDirection':_0x44dd08[_0x8c73('0x13')][_0x8c73('0x14')](),'lastMsgBody':_0x44dd08[_0x8c73('0xf')]});}})['catch'](function(_0x49e0ea){console['error'](_0x49e0ea);});}_0x42176d();}},'charset':_0x8c73('0x1c'),'collate':_0x8c73('0x1d')});}; \ No newline at end of file +var _0x7256=['catch','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./mailMessage.attributes','exports','define','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','fromString','models','direction','toLowerCase','secret','UserId','findOne','MailInteractionId','update'];(function(_0xad3c96,_0x1fb81d){var _0x184336=function(_0x3e96da){while(--_0x3e96da){_0xad3c96['push'](_0xad3c96['shift']());}};_0x184336(++_0x1fb81d);}(_0x7256,0x124));var _0x6725=function(_0x529136,_0x2b1aba){_0x529136=_0x529136-0x0;var _0x2e8041=_0x7256[_0x529136];return _0x2e8041;};'use strict';var _=require(_0x6725('0x0'));var util=require(_0x6725('0x1'));var logger=require(_0x6725('0x2'))(_0x6725('0x3'));var moment=require(_0x6725('0x4'));var BPromise=require(_0x6725('0x5'));var rp=require('request-promise');var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0x6725('0x6'));var rimraf=require('rimraf');var config=require(_0x6725('0x7'));var attributes=require(_0x6725('0x8'));module[_0x6725('0x9')]=function(_0x4efd1d,_0x5f33f2){return _0x4efd1d[_0x6725('0xa')]('MailMessage',attributes,{'tableName':_0x6725('0xb'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x6725('0xc')]},{'name':_0x6725('0xd'),'fields':[_0x6725('0xe'),_0x6725('0xf')],'type':_0x6725('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x48180b,_0x5a8e5c,_0x1d534e){if(_0x48180b[_0x6725('0x11')]){_0x48180b[_0x6725('0xe')]=htmlToText[_0x6725('0x12')](_0x48180b[_0x6725('0x11')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x1d534e(null,_0x5a8e5c);},'afterCreate':function(_0x1768cd,_0x35f068,_0x38fd13){var _0x4ed987=_0x4efd1d[_0x6725('0x13')];var _0x4db981=_0x1768cd['get']({'plain':!![]});if(_0x4db981[_0x6725('0x14')][_0x6725('0x15')]()==='in'||_0x4db981['direction']['toLowerCase']()==='out'&&!_0x4db981[_0x6725('0x16')]&&!_['isNil'](_0x4db981[_0x6725('0x17')])){_0x4ed987['MailInteraction'][_0x6725('0x18')]({'where':{'id':_0x4db981[_0x6725('0x19')]}})['then'](function(_0x26db29){if(_0x26db29){_0x26db29[_0x6725('0x1a')]({'lastMsgAt':_0x4db981['createdAt'],'lastMsgDirection':_0x4db981[_0x6725('0x14')][_0x6725('0x15')](),'lastMsgBody':_0x4db981[_0x6725('0x11')]});}})[_0x6725('0x1b')](function(_0x38e4b8){console['error'](_0x38e4b8);});}_0x38fd13();}},'charset':_0x6725('0x1c'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 9450182..c56e074 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 _0x5f6f=['request','then','info','MailMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','MailMessage','body','options','CreateMailMessage','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./mailMessage.socket','register'];(function(_0xc01eef,_0xb8ab42){var _0x702430=function(_0x59a00f){while(--_0x59a00f){_0xc01eef['push'](_0xc01eef['shift']());}};_0x702430(++_0xb8ab42);}(_0x5f6f,0x1ef));var _0xf5f6=function(_0x2ee172,_0x278363){_0x2ee172=_0x2ee172-0x0;var _0x2106e7=_0x5f6f[_0x2ee172];return _0x2106e7;};'use strict';var _=require(_0xf5f6('0x0'));var util=require(_0xf5f6('0x1'));var moment=require(_0xf5f6('0x2'));var BPromise=require(_0xf5f6('0x3'));var rs=require(_0xf5f6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf5f6('0x5'))['db'];var utils=require(_0xf5f6('0x6'));var logger=require(_0xf5f6('0x7'))('rpc');var config=require(_0xf5f6('0x8'));var jayson=require(_0xf5f6('0x9'));var client=jayson[_0xf5f6('0xa')][_0xf5f6('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0xf5f6('0xc')],{'host':_0xf5f6('0xd'),'port':0x18eb});var socket=require(_0xf5f6('0xe'))(new Redis(config[_0xf5f6('0xc')]));require(_0xf5f6('0xf'))[_0xf5f6('0x10')](socket);function respondWithRpcPromise(_0x57fc19,_0x5ba0f5,_0x988c4a){return new BPromise(function(_0x369b18,_0x491c14){return client[_0xf5f6('0x11')](_0x57fc19,_0x988c4a)[_0xf5f6('0x12')](function(_0xeb94fb){logger[_0xf5f6('0x13')](_0xf5f6('0x14'),_0x5ba0f5,'request\x20sent');logger[_0xf5f6('0x15')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x5ba0f5,_0xf5f6('0x16'),JSON[_0xf5f6('0x17')](_0xeb94fb));if(_0xeb94fb[_0xf5f6('0x18')]){if(_0xeb94fb[_0xf5f6('0x18')]['code']===0x1f4){logger[_0xf5f6('0x18')](_0xf5f6('0x14'),_0x5ba0f5,_0xeb94fb[_0xf5f6('0x18')][_0xf5f6('0x19')]);return _0x491c14(_0xeb94fb['error'][_0xf5f6('0x19')]);}logger[_0xf5f6('0x18')](_0xf5f6('0x14'),_0x5ba0f5,_0xeb94fb[_0xf5f6('0x18')]['message']);return _0x369b18(_0xeb94fb['error'][_0xf5f6('0x19')]);}else{logger['info'](_0xf5f6('0x14'),_0x5ba0f5,'request\x20sent');_0x369b18(_0xeb94fb[_0xf5f6('0x1a')][_0xf5f6('0x19')]);}})[_0xf5f6('0x1b')](function(_0x301e2a){logger[_0xf5f6('0x18')](_0xf5f6('0x14'),_0x5ba0f5,_0x301e2a);_0x491c14(_0x301e2a);});});}exports['CreateMailMessage']=function(_0x594162){var _0x3ada74=this;return new Promise(function(_0x332761,_0x261015){return db[_0xf5f6('0x1c')]['create'](_0x594162[_0xf5f6('0x1d')],{'raw':_0x594162[_0xf5f6('0x1e')]?_0x594162[_0xf5f6('0x1e')]['raw']===undefined?!![]:![]:!![]})[_0xf5f6('0x12')](function(_0x32f27e){logger[_0xf5f6('0x13')](_0xf5f6('0x1f'),_0x594162);logger[_0xf5f6('0x15')]('CreateMailMessage',_0x594162,JSON[_0xf5f6('0x17')](_0x32f27e));_0x332761(_0x32f27e);})[_0xf5f6('0x1b')](function(_0xb4f1ec){logger['error'](_0xf5f6('0x1f'),_0xb4f1ec[_0xf5f6('0x19')],_0x594162);_0x261015(_0x3ada74[_0xf5f6('0x18')](0x1f4,_0xb4f1ec['message']));});});}; \ No newline at end of file +var _0xe14b=['http','redis','defaults','./mailMessage.socket','register','request','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateMailMessage','MailMessage','create','body','options','then','lodash','util','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0xe14b,0x93));var _0xbe14=function(_0x55e461,_0x260d5e){_0x55e461=_0x55e461-0x0;var _0x26e885=_0xe14b[_0x55e461];return _0x26e885;};'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);});});}exports[_0xbe14('0x19')]=function(_0x37e4c1){var _0x59a9e3=this;return new Promise(function(_0x24f820,_0x4a1bbd){return db[_0xbe14('0x1a')][_0xbe14('0x1b')](_0x37e4c1[_0xbe14('0x1c')],{'raw':_0x37e4c1['options']?_0x37e4c1[_0xbe14('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0xbe14('0x1e')](function(_0x56e80c){logger[_0xbe14('0xe')]('CreateMailMessage',_0x37e4c1);logger[_0xbe14('0x11')](_0xbe14('0x19'),_0x37e4c1,JSON['stringify'](_0x56e80c));_0x24f820(_0x56e80c);})[_0xbe14('0x18')](function(_0x4d4190){logger[_0xbe14('0x14')]('CreateMailMessage',_0x4d4190[_0xbe14('0x16')],_0x37e4c1);_0x4a1bbd(_0x59a9e3[_0xbe14('0x14')](0x1f4,_0x4d4190[_0xbe14('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 186bb56..a6ca58d 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 _0x1fa8=['removeListener','register','length','mailMessage:','./mailMessage.events','save','remove','emit'];(function(_0x272419,_0x285e34){var _0x16d6e6=function(_0x48a77c){while(--_0x48a77c){_0x272419['push'](_0x272419['shift']());}};_0x16d6e6(++_0x285e34);}(_0x1fa8,0x1cc));var _0x81fa=function(_0x5c49ad,_0x3beb1c){_0x5c49ad=_0x5c49ad-0x0;var _0x3edd8c=_0x1fa8[_0x5c49ad];return _0x3edd8c;};'use strict';var MailMessageEvents=require(_0x81fa('0x0'));var events=[_0x81fa('0x1'),_0x81fa('0x2'),'update'];function createListener(_0x297f86,_0x110710){return function(_0x1053a1){_0x110710[_0x81fa('0x3')](_0x297f86,_0x1053a1);};}function removeListener(_0x234351,_0x39cc96){return function(){MailMessageEvents[_0x81fa('0x4')](_0x234351,_0x39cc96);};}exports[_0x81fa('0x5')]=function(_0x194cc6){for(var _0x3acb95=0x0,_0x234566=events[_0x81fa('0x6')];_0x3acb95<_0x234566;_0x3acb95++){var _0x2c115b=events[_0x3acb95];var _0x5e36d9=createListener(_0x81fa('0x7')+_0x2c115b,_0x194cc6);MailMessageEvents['on'](_0x2c115b,_0x5e36d9);}}; \ No newline at end of file +var _0x8f82=['length','mailMessage:','./mailMessage.events','save','remove','update','emit','removeListener','register'];(function(_0x57f5e5,_0x466d69){var _0x342e86=function(_0x18f64c){while(--_0x18f64c){_0x57f5e5['push'](_0x57f5e5['shift']());}};_0x342e86(++_0x466d69);}(_0x8f82,0x77));var _0x28f8=function(_0x1fa2ca,_0x45df7e){_0x1fa2ca=_0x1fa2ca-0x0;var _0x27bacf=_0x8f82[_0x1fa2ca];return _0x27bacf;};'use strict';var MailMessageEvents=require(_0x28f8('0x0'));var events=[_0x28f8('0x1'),_0x28f8('0x2'),_0x28f8('0x3')];function createListener(_0x3e8baa,_0x4e2fc9){return function(_0x141af5){_0x4e2fc9[_0x28f8('0x4')](_0x3e8baa,_0x141af5);};}function removeListener(_0x30ba43,_0x3cee73){return function(){MailMessageEvents[_0x28f8('0x5')](_0x30ba43,_0x3cee73);};}exports[_0x28f8('0x6')]=function(_0x3da5a7){for(var _0x1ff461=0x0,_0x1f5b97=events[_0x28f8('0x7')];_0x1ff461<_0x1f5b97;_0x1ff461++){var _0x5143a3=events[_0x1ff461];var _0x111411=createListener(_0x28f8('0x8')+_0x5143a3,_0x3da5a7);MailMessageEvents['on'](_0x5143a3,_0x111411);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 9bcaf90..63b6720 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 _0xa849=['post','create','addTeams','/:id/users','addAgents','update','delete','destroy','removeTeams','removeAgents','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','getAgents'];(function(_0x139a3c,_0x4fc883){var _0x2b375b=function(_0x525dbf){while(--_0x525dbf){_0x139a3c['push'](_0x139a3c['shift']());}};_0x2b375b(++_0x4fc883);}(_0xa849,0x17e));var _0x9a84=function(_0x225b40,_0xc6d52a){_0x225b40=_0x225b40-0x0;var _0x5a31bc=_0xa849[_0x225b40];return _0x5a31bc;};'use strict';var multer=require(_0x9a84('0x0'));var util=require(_0x9a84('0x1'));var path=require(_0x9a84('0x2'));var timeout=require(_0x9a84('0x3'));var express=require('express');var router=express[_0x9a84('0x4')]();var auth=require(_0x9a84('0x5'));var interaction=require(_0x9a84('0x6'));var config=require(_0x9a84('0x7'));var controller=require(_0x9a84('0x8'));router[_0x9a84('0x9')]('/',auth[_0x9a84('0xa')](),controller[_0x9a84('0xb')]);router[_0x9a84('0x9')](_0x9a84('0xc'),auth[_0x9a84('0xa')](),controller[_0x9a84('0xd')]);router[_0x9a84('0x9')](_0x9a84('0xe'),auth['isAuthenticated'](),controller[_0x9a84('0xf')]);router[_0x9a84('0x9')](_0x9a84('0x10'),auth[_0x9a84('0xa')](),controller[_0x9a84('0x11')]);router['get'](_0x9a84('0x12'),auth[_0x9a84('0xa')](),controller[_0x9a84('0x13')]);router['get']('/:id/users',auth[_0x9a84('0xa')](),controller[_0x9a84('0x14')]);router[_0x9a84('0x15')]('/',auth['isAuthenticated'](),controller[_0x9a84('0x16')]);router[_0x9a84('0x15')](_0x9a84('0x12'),auth[_0x9a84('0xa')](),controller[_0x9a84('0x17')]);router[_0x9a84('0x15')](_0x9a84('0x18'),auth['isAuthenticated'](),controller[_0x9a84('0x19')]);router['put']('/:id',auth[_0x9a84('0xa')](),controller[_0x9a84('0x1a')]);router[_0x9a84('0x1b')](_0x9a84('0xe'),auth[_0x9a84('0xa')](),controller[_0x9a84('0x1c')]);router[_0x9a84('0x1b')](_0x9a84('0x12'),auth[_0x9a84('0xa')](),controller[_0x9a84('0x1d')]);router[_0x9a84('0x1b')]('/:id/users',auth[_0x9a84('0xa')](),controller[_0x9a84('0x1e')]);module['exports']=router; \ No newline at end of file +var _0xac92=['./mailQueue.controller','get','isAuthenticated','/:id','show','/:id/members','getTeams','/:id/users','getAgents','create','post','/:id/teams','addTeams','addAgents','put','delete','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../config/environment'];(function(_0x242c29,_0x168f0a){var _0x3f4d1c=function(_0x87d119){while(--_0x87d119){_0x242c29['push'](_0x242c29['shift']());}};_0x3f4d1c(++_0x168f0a);}(_0xac92,0x132));var _0x2ac9=function(_0x1718ff,_0x594b2b){_0x1718ff=_0x1718ff-0x0;var _0x562310=_0xac92[_0x1718ff];return _0x562310;};'use strict';var multer=require(_0x2ac9('0x0'));var util=require('util');var path=require(_0x2ac9('0x1'));var timeout=require(_0x2ac9('0x2'));var express=require('express');var router=express[_0x2ac9('0x3')]();var auth=require(_0x2ac9('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2ac9('0x5'));var controller=require(_0x2ac9('0x6'));router[_0x2ac9('0x7')]('/',auth[_0x2ac9('0x8')](),controller['index']);router[_0x2ac9('0x7')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x2ac9('0x7')](_0x2ac9('0x9'),auth[_0x2ac9('0x8')](),controller[_0x2ac9('0xa')]);router[_0x2ac9('0x7')](_0x2ac9('0xb'),auth[_0x2ac9('0x8')](),controller['getMembers']);router[_0x2ac9('0x7')]('/:id/teams',auth[_0x2ac9('0x8')](),controller[_0x2ac9('0xc')]);router['get'](_0x2ac9('0xd'),auth[_0x2ac9('0x8')](),controller[_0x2ac9('0xe')]);router['post']('/',auth[_0x2ac9('0x8')](),controller[_0x2ac9('0xf')]);router[_0x2ac9('0x10')](_0x2ac9('0x11'),auth['isAuthenticated'](),controller[_0x2ac9('0x12')]);router[_0x2ac9('0x10')](_0x2ac9('0xd'),auth[_0x2ac9('0x8')](),controller[_0x2ac9('0x13')]);router[_0x2ac9('0x14')](_0x2ac9('0x9'),auth[_0x2ac9('0x8')](),controller['update']);router[_0x2ac9('0x15')](_0x2ac9('0x9'),auth[_0x2ac9('0x8')](),controller[_0x2ac9('0x16')]);router[_0x2ac9('0x15')](_0x2ac9('0x11'),auth[_0x2ac9('0x8')](),controller[_0x2ac9('0x17')]);router[_0x2ac9('0x15')](_0x2ac9('0xd'),auth[_0x2ac9('0x8')](),controller[_0x2ac9('0x18')]);module[_0x2ac9('0x19')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 43f8c5c..983356f 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 _0x4134=['exports','STRING','rrmemory','roundrobin'];(function(_0x61b9aa,_0x41cb2c){var _0x485ca6=function(_0xcf8b4a){while(--_0xcf8b4a){_0x61b9aa['push'](_0x61b9aa['shift']());}};_0x485ca6(++_0x41cb2c);}(_0x4134,0x17c));var _0x4413=function(_0x4e8b39,_0x373573){_0x4e8b39=_0x4e8b39-0x0;var _0x137c36=_0x4134[_0x4e8b39];return _0x137c36;};'use strict';var Sequelize=require('sequelize');module[_0x4413('0x0')]={'name':{'type':Sequelize[_0x4413('0x1')],'unique':'name','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'](_0x4413('0x2'),'beepall',_0x4413('0x3'))}}; \ No newline at end of file +var _0xbd89=['beepall','roundrobin','name','INTEGER','ENUM','rrmemory'];(function(_0x21f46c,_0x164a3e){var _0x64a212=function(_0x500070){while(--_0x500070){_0x21f46c['push'](_0x21f46c['shift']());}};_0x64a212(++_0x164a3e);}(_0xbd89,0x9e));var _0x9bd8=function(_0x19c4e7,_0x426361){_0x19c4e7=_0x19c4e7-0x0;var _0x1ea3b8=_0xbd89[_0x19c4e7];return _0x1ea3b8;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x9bd8('0x0'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x9bd8('0x1')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9bd8('0x2')](_0x9bd8('0x3'),_0x9bd8('0x4'),_0x9bd8('0x5'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index d841bf7..50bcce8 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 _0xeb03=['name','map','MailQueue','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','count','includeAll','include','findAll','rows','catch','show','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','MailQueues','UserProfileSection','userProfileId','params','describe','getMembers','findOne','UserMailQueue','User','UserId','mailPause','updatedAt','createdAt','format','SIP','getTeams','Team','addTeams','ids','Agents','online','interface','flatMap','sequelize','transaction','forEach','emit','removeTeams','select','field','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','TeamId','all','union','compact','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','spread','userMailQueue:save','isArray','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','json','offset','limit','status','apply','reject','save','update','then','destroy','get','UserProfileResource','end','stack'];(function(_0x30f53a,_0x55acf8){var _0x24fd11=function(_0x4e2626){while(--_0x4e2626){_0x30f53a['push'](_0x30f53a['shift']());}};_0x24fd11(++_0x55acf8);}(_0xeb03,0x160));var _0x3eb0=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0xeb03[_0xdea41a];return _0x15d0d8;};'use strict';var pdf=require(_0x3eb0('0x0'));var emlformat=require(_0x3eb0('0x1'));var rimraf=require(_0x3eb0('0x2'));var zipdir=require(_0x3eb0('0x3'));var jsonpatch=require(_0x3eb0('0x4'));var rp=require(_0x3eb0('0x5'));var moment=require(_0x3eb0('0x6'));var BPromise=require(_0x3eb0('0x7'));var Mustache=require('mustache');var util=require(_0x3eb0('0x8'));var path=require(_0x3eb0('0x9'));var sox=require(_0x3eb0('0xa'));var csv=require(_0x3eb0('0xb'));var ejs=require(_0x3eb0('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x3eb0('0xd'));var crypto=require(_0x3eb0('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3eb0('0xb'));var querystring=require(_0x3eb0('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3eb0('0x10'));var qs=require(_0x3eb0('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3eb0('0x12'));var logger=require(_0x3eb0('0x13'))('api');var utils=require(_0x3eb0('0x14'));var config=require(_0x3eb0('0x15'));var db=require('../../mysqldb')['db'];config[_0x3eb0('0x16')]=_[_0x3eb0('0x17')](config[_0x3eb0('0x16')],{'host':_0x3eb0('0x18'),'port':0x18eb});var socket=require(_0x3eb0('0x19'))(new Redis(config[_0x3eb0('0x16')]));require(_0x3eb0('0x1a'))['register'](socket);function respondWithStatusCode(_0x1127c9,_0x20a686){_0x20a686=_0x20a686||0xcc;return function(_0x250f2b){if(_0x250f2b){return _0x1127c9['sendStatus'](_0x20a686);}return _0x1127c9['status'](_0x20a686)['end']();};}function respondWithResult(_0x44d59,_0x261697){_0x261697=_0x261697||0xc8;return function(_0x25ee18){if(_0x25ee18){return _0x44d59['status'](_0x261697)[_0x3eb0('0x1b')](_0x25ee18);}};}function respondWithFilteredResult(_0x28dea0,_0x1345af){return function(_0x5489b1){if(_0x5489b1){var _0x64cac=_0x5489b1['count'],_0x3a6f4c=_0x1345af['offset'],_0x5824a1=_0x1345af[_0x3eb0('0x1c')]+_0x1345af[_0x3eb0('0x1d')],_0x55b4b0;if(_0x5824a1>=_0x64cac){_0x5824a1=_0x64cac;_0x55b4b0=0xc8;}else{_0x55b4b0=0xce;}_0x28dea0[_0x3eb0('0x1e')](_0x55b4b0);return _0x28dea0['set']('Content-Range',_0x3a6f4c+'-'+_0x5824a1+'/'+_0x64cac)[_0x3eb0('0x1b')](_0x5489b1);}return null;};}function patchUpdates(_0x447afe){return function(_0x55a5bf){try{jsonpatch[_0x3eb0('0x1f')](_0x55a5bf,_0x447afe,!![]);}catch(_0x39c7df){return BPromise[_0x3eb0('0x20')](_0x39c7df);}return _0x55a5bf[_0x3eb0('0x21')]();};}function saveUpdates(_0x29f4d2,_0x473092){return function(_0x200dd3){if(_0x200dd3){return _0x200dd3[_0x3eb0('0x22')](_0x29f4d2)[_0x3eb0('0x23')](function(_0x21b203){return _0x21b203;});}return null;};}function removeEntity(_0x4d2950,_0x32d516){return function(_0x31f44f){if(_0x31f44f){return _0x31f44f[_0x3eb0('0x24')]()[_0x3eb0('0x23')](function(){var _0xf00abb=_0x31f44f[_0x3eb0('0x25')]({'plain':!![]});var _0x940b8f='MailQueues';return db[_0x3eb0('0x26')]['destroy']({'where':{'type':_0x940b8f,'resourceId':_0xf00abb['id']}})[_0x3eb0('0x23')](function(){return _0x31f44f;});})[_0x3eb0('0x23')](function(){_0x4d2950[_0x3eb0('0x1e')](0xcc)[_0x3eb0('0x27')]();});}};}function handleEntityNotFound(_0x4a22c9,_0x3a6449){return function(_0x313f2a){if(!_0x313f2a){_0x4a22c9['sendStatus'](0x194);}return _0x313f2a;};}function handleError(_0x3d6702,_0x34836d){_0x34836d=_0x34836d||0x1f4;return function(_0x827e60){logger['error'](_0x827e60[_0x3eb0('0x28')]);if(_0x827e60[_0x3eb0('0x29')]){delete _0x827e60[_0x3eb0('0x29')];}_0x3d6702[_0x3eb0('0x1e')](_0x34836d)['send'](_0x827e60);};}exports['index']=function(_0x1cc86b,_0x42b9df){var _0x142694={},_0x1cc1e7={},_0x59cb19={'count':0x0,'rows':[]};var _0x3d4835=_[_0x3eb0('0x2a')](db[_0x3eb0('0x2b')][_0x3eb0('0x2c')],function(_0x116047){return{'name':_0x116047[_0x3eb0('0x2d')],'type':_0x116047[_0x3eb0('0x2e')][_0x3eb0('0x2f')]};});_0x1cc1e7[_0x3eb0('0x30')]=_[_0x3eb0('0x2a')](_0x3d4835,'name');_0x1cc1e7[_0x3eb0('0x31')]=_['keys'](_0x1cc86b[_0x3eb0('0x31')]);_0x1cc1e7[_0x3eb0('0x32')]=_[_0x3eb0('0x33')](_0x1cc1e7['model'],_0x1cc1e7[_0x3eb0('0x31')]);_0x142694['attributes']=_['intersection'](_0x1cc1e7[_0x3eb0('0x30')],qs[_0x3eb0('0x34')](_0x1cc86b[_0x3eb0('0x31')]['fields']));_0x142694['attributes']=_0x142694[_0x3eb0('0x35')][_0x3eb0('0x36')]?_0x142694[_0x3eb0('0x35')]:_0x1cc1e7[_0x3eb0('0x30')];if(!_0x1cc86b[_0x3eb0('0x31')][_0x3eb0('0x37')](_0x3eb0('0x38'))){_0x142694[_0x3eb0('0x1d')]=qs[_0x3eb0('0x1d')](_0x1cc86b[_0x3eb0('0x31')][_0x3eb0('0x1d')]);_0x142694[_0x3eb0('0x1c')]=qs[_0x3eb0('0x1c')](_0x1cc86b[_0x3eb0('0x31')][_0x3eb0('0x1c')]);}_0x142694[_0x3eb0('0x39')]=qs['sort'](_0x1cc86b[_0x3eb0('0x31')][_0x3eb0('0x3a')]);_0x142694[_0x3eb0('0x3b')]=qs[_0x3eb0('0x32')](_[_0x3eb0('0x3c')](_0x1cc86b['query'],_0x1cc1e7[_0x3eb0('0x32')]));if(_0x1cc86b[_0x3eb0('0x31')][_0x3eb0('0x3d')]){_0x142694['where']=_[_0x3eb0('0x3e')](_0x142694[_0x3eb0('0x3b')],{'$or':_['map'](_0x3d4835,function(_0x206934){if(_0x206934[_0x3eb0('0x2e')][_0x3eb0('0x2f')]!=='VIRTUAL'){var _0x126d9c={};_0x126d9c[_0x206934['field']]={'$like':'%'+_0x1cc86b[_0x3eb0('0x31')][_0x3eb0('0x3d')]+'%'};return _0x126d9c;}})});}_0x142694=_[_0x3eb0('0x3e')]({},_0x142694,_0x1cc86b[_0x3eb0('0x3f')]);var _0x38f7f4={'where':_0x142694[_0x3eb0('0x3b')]};return db[_0x3eb0('0x2b')][_0x3eb0('0x40')](_0x38f7f4)['then'](function(_0x2553eb){_0x59cb19[_0x3eb0('0x40')]=_0x2553eb;if(_0x1cc86b['query'][_0x3eb0('0x41')]){_0x142694[_0x3eb0('0x42')]=[{'all':!![]}];}return db[_0x3eb0('0x2b')][_0x3eb0('0x43')](_0x142694);})[_0x3eb0('0x23')](function(_0x1de3a2){_0x59cb19[_0x3eb0('0x44')]=_0x1de3a2;return _0x59cb19;})[_0x3eb0('0x23')](respondWithFilteredResult(_0x42b9df,_0x142694))[_0x3eb0('0x45')](handleError(_0x42b9df,null));};exports[_0x3eb0('0x46')]=function(_0x1a3807,_0x38547e){var _0x341af3={'raw':!![],'where':{'id':_0x1a3807['params']['id']}},_0x47f717={};_0x47f717[_0x3eb0('0x30')]=_[_0x3eb0('0x47')](db[_0x3eb0('0x2b')][_0x3eb0('0x2c')]);_0x47f717[_0x3eb0('0x31')]=_[_0x3eb0('0x47')](_0x1a3807[_0x3eb0('0x31')]);_0x47f717['filters']=_[_0x3eb0('0x33')](_0x47f717[_0x3eb0('0x30')],_0x47f717[_0x3eb0('0x31')]);_0x341af3[_0x3eb0('0x35')]=_[_0x3eb0('0x33')](_0x47f717[_0x3eb0('0x30')],qs[_0x3eb0('0x34')](_0x1a3807[_0x3eb0('0x31')][_0x3eb0('0x34')]));_0x341af3[_0x3eb0('0x35')]=_0x341af3[_0x3eb0('0x35')]['length']?_0x341af3[_0x3eb0('0x35')]:_0x47f717[_0x3eb0('0x30')];if(_0x1a3807[_0x3eb0('0x31')][_0x3eb0('0x41')]){_0x341af3[_0x3eb0('0x42')]=[{'all':!![]}];}_0x341af3=_[_0x3eb0('0x3e')]({},_0x341af3,_0x1a3807[_0x3eb0('0x3f')]);return db['MailQueue'][_0x3eb0('0x48')](_0x341af3)[_0x3eb0('0x23')](handleEntityNotFound(_0x38547e,null))['then'](respondWithResult(_0x38547e,null))[_0x3eb0('0x45')](handleError(_0x38547e,null));};exports['create']=function(_0x511d57,_0x1fc071){return db[_0x3eb0('0x2b')][_0x3eb0('0x49')](_0x511d57[_0x3eb0('0x4a')],{})[_0x3eb0('0x23')](function(_0x4df2e3){var _0x2515dd=_0x511d57[_0x3eb0('0x4b')]['get']({'plain':!![]});if(!_0x2515dd)throw new Error(_0x3eb0('0x4c'));if(_0x2515dd['role']===_0x3eb0('0x4b')){var _0x38b38f=_0x4df2e3[_0x3eb0('0x25')]({'plain':!![]});var _0x3de914=_0x3eb0('0x4d');return db[_0x3eb0('0x4e')][_0x3eb0('0x48')]({'where':{'name':_0x3de914,'userProfileId':_0x2515dd[_0x3eb0('0x4f')]},'raw':!![]})[_0x3eb0('0x23')](function(_0x3c9bda){if(_0x3c9bda&&_0x3c9bda['autoAssociation']===0x0){return db[_0x3eb0('0x26')][_0x3eb0('0x49')]({'name':_0x38b38f[_0x3eb0('0x29')],'resourceId':_0x38b38f['id'],'type':_0x3c9bda[_0x3eb0('0x29')],'sectionId':_0x3c9bda['id']},{})[_0x3eb0('0x23')](function(){return _0x4df2e3;});}else{return _0x4df2e3;}})[_0x3eb0('0x45')](function(_0x5244aa){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5244aa);throw _0x5244aa;});}return _0x4df2e3;})[_0x3eb0('0x23')](respondWithResult(_0x1fc071,0xc9))[_0x3eb0('0x45')](handleError(_0x1fc071,null));};exports['update']=function(_0x27d495,_0x1d7556){if(_0x27d495[_0x3eb0('0x4a')]['id']){delete _0x27d495[_0x3eb0('0x4a')]['id'];}return db['MailQueue'][_0x3eb0('0x48')]({'where':{'id':_0x27d495[_0x3eb0('0x50')]['id']}})[_0x3eb0('0x23')](handleEntityNotFound(_0x1d7556,null))[_0x3eb0('0x23')](saveUpdates(_0x27d495[_0x3eb0('0x4a')],null))[_0x3eb0('0x23')](respondWithResult(_0x1d7556,null))[_0x3eb0('0x45')](handleError(_0x1d7556,null));};exports[_0x3eb0('0x24')]=function(_0x110780,_0x1d7b2a){return db[_0x3eb0('0x2b')][_0x3eb0('0x48')]({'where':{'id':_0x110780['params']['id']}})[_0x3eb0('0x23')](handleEntityNotFound(_0x1d7b2a,null))[_0x3eb0('0x23')](removeEntity(_0x1d7b2a,null))[_0x3eb0('0x45')](handleError(_0x1d7b2a,null));};exports[_0x3eb0('0x51')]=function(_0x385065,_0xc5443e){return db[_0x3eb0('0x2b')][_0x3eb0('0x51')]()[_0x3eb0('0x23')](respondWithResult(_0xc5443e,null))[_0x3eb0('0x45')](handleError(_0xc5443e,null));};exports[_0x3eb0('0x52')]=function(_0x2bcca2,_0x5b0d66,_0x4ef4cc){var _0x35558b={'raw':!![],'where':{}},_0x11ba4f={},_0xdd5891;return db[_0x3eb0('0x2b')][_0x3eb0('0x53')]({'where':{'id':_0x2bcca2[_0x3eb0('0x50')]['id']}})[_0x3eb0('0x23')](handleEntityNotFound(_0x5b0d66,null))[_0x3eb0('0x23')](function(_0x1547a5){if(_0x1547a5){_0xdd5891=_0x1547a5['get']({'plain':!![]});_0x11ba4f[_0x3eb0('0x30')]=_[_0x3eb0('0x47')](db[_0x3eb0('0x54')]['rawAttributes']);_0x11ba4f[_0x3eb0('0x31')]=_[_0x3eb0('0x47')](_0x2bcca2[_0x3eb0('0x31')]);_0x11ba4f[_0x3eb0('0x32')]=_[_0x3eb0('0x33')](_0x11ba4f['model'],_0x11ba4f['query']);_0x35558b['attributes']=_[_0x3eb0('0x33')](_0x11ba4f[_0x3eb0('0x30')],qs[_0x3eb0('0x34')](_0x2bcca2[_0x3eb0('0x31')]['fields']));_0x35558b[_0x3eb0('0x35')]=_0x35558b[_0x3eb0('0x35')][_0x3eb0('0x36')]?_0x35558b[_0x3eb0('0x35')]:_0x11ba4f[_0x3eb0('0x30')];if(!_0x2bcca2['query'][_0x3eb0('0x37')](_0x3eb0('0x38'))){_0x35558b[_0x3eb0('0x1d')]=qs[_0x3eb0('0x1d')](_0x2bcca2[_0x3eb0('0x31')][_0x3eb0('0x1d')]);_0x35558b[_0x3eb0('0x1c')]=qs[_0x3eb0('0x1c')](_0x2bcca2['query']['offset']);}_0x35558b[_0x3eb0('0x39')]=qs[_0x3eb0('0x3a')](_0x2bcca2[_0x3eb0('0x31')][_0x3eb0('0x3a')]);_0x35558b[_0x3eb0('0x3b')]=qs['filters'](_[_0x3eb0('0x3c')](_0x2bcca2[_0x3eb0('0x31')],_0x11ba4f[_0x3eb0('0x32')]));_0x35558b[_0x3eb0('0x3b')]['MailQueueId']=_0x1547a5['id'];if(_0x2bcca2[_0x3eb0('0x31')][_0x3eb0('0x3d')]){_0x35558b['where']=_[_0x3eb0('0x3e')](_0x35558b['where'],{'$or':_[_0x3eb0('0x2a')](_0x35558b['attributes'],function(_0x4a85fb){var _0x1bac3d={};_0x1bac3d[_0x4a85fb]={'$like':'%'+_0x2bcca2['query'][_0x3eb0('0x3d')]+'%'};return _0x1bac3d;})});}_0x35558b=_['merge']({},_0x35558b,_0x2bcca2[_0x3eb0('0x3f')]);return db[_0x3eb0('0x54')][_0x3eb0('0x43')](_0x35558b);}})['then'](function(_0x9d83da){if(_0x9d83da){return db[_0x3eb0('0x55')]['findAndCountAll']({'where':{'id':_[_0x3eb0('0x2a')](_0x9d83da,_0x3eb0('0x56')),'role':'agent'},'attributes':['id','name',_0x3eb0('0x57'),_0x3eb0('0x58'),_0x3eb0('0x59')]});}})[_0x3eb0('0x23')](function(_0x109c81){if(_0x109c81){return{'count':_0x109c81[_0x3eb0('0x40')],'rows':_[_0x3eb0('0x2a')](_0x109c81[_0x3eb0('0x44')],function(_0x7b09a5){return{'membername':_0x7b09a5[_0x3eb0('0x29')],'UserId':_0x7b09a5['id'],'queue_name':_0xdd5891[_0x3eb0('0x29')],'MailQueueId':_0xdd5891['id'],'interface':util[_0x3eb0('0x5a')]('%s/%s',_0x3eb0('0x5b'),_0x7b09a5[_0x3eb0('0x29')]),'penalty':0x0,'paused':_0x7b09a5[_0x3eb0('0x57')],'createdAt':_0x7b09a5[_0x3eb0('0x59')],'updatedAt':_0x7b09a5[_0x3eb0('0x58')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x3eb0('0x23')](respondWithFilteredResult(_0x5b0d66,_0x35558b))[_0x3eb0('0x45')](handleError(_0x5b0d66,null));};exports[_0x3eb0('0x5c')]=function(_0x189db3,_0x450230,_0x45457d){var _0x26e4c1={};var _0x1cc8fa={};var _0x3cef24;var _0x424ac0;return db[_0x3eb0('0x2b')]['findOne']({'where':{'id':_0x189db3['params']['id']}})['then'](handleEntityNotFound(_0x450230,null))[_0x3eb0('0x23')](function(_0x28253b){if(_0x28253b){_0x3cef24=_0x28253b;_0x1cc8fa[_0x3eb0('0x30')]=_[_0x3eb0('0x47')](db[_0x3eb0('0x5d')][_0x3eb0('0x2c')]);_0x1cc8fa[_0x3eb0('0x31')]=_[_0x3eb0('0x47')](_0x189db3['query']);_0x1cc8fa[_0x3eb0('0x32')]=_[_0x3eb0('0x33')](_0x1cc8fa['model'],_0x1cc8fa[_0x3eb0('0x31')]);_0x26e4c1['attributes']=_[_0x3eb0('0x33')](_0x1cc8fa[_0x3eb0('0x30')],qs['fields'](_0x189db3[_0x3eb0('0x31')][_0x3eb0('0x34')]));_0x26e4c1[_0x3eb0('0x35')]=_0x26e4c1[_0x3eb0('0x35')][_0x3eb0('0x36')]?_0x26e4c1[_0x3eb0('0x35')]:_0x1cc8fa[_0x3eb0('0x30')];_0x26e4c1[_0x3eb0('0x39')]=qs['sort'](_0x189db3[_0x3eb0('0x31')][_0x3eb0('0x3a')]);_0x26e4c1[_0x3eb0('0x3b')]=qs[_0x3eb0('0x32')](_[_0x3eb0('0x3c')](_0x189db3['query'],_0x1cc8fa[_0x3eb0('0x32')]));if(_0x189db3[_0x3eb0('0x31')]['filter']){_0x26e4c1[_0x3eb0('0x3b')]=_[_0x3eb0('0x3e')](_0x26e4c1[_0x3eb0('0x3b')],{'$or':_[_0x3eb0('0x2a')](_0x26e4c1[_0x3eb0('0x35')],function(_0x1116af){var _0x896404={};_0x896404[_0x1116af]={'$like':'%'+_0x189db3['query'][_0x3eb0('0x3d')]+'%'};return _0x896404;})});}_0x26e4c1=_['merge']({},_0x26e4c1,_0x189db3[_0x3eb0('0x3f')]);return _0x3cef24[_0x3eb0('0x5c')](_0x26e4c1);}})[_0x3eb0('0x23')](function(_0x35cf5e){if(_0x35cf5e){_0x424ac0=_0x35cf5e[_0x3eb0('0x36')];if(!_0x189db3[_0x3eb0('0x31')][_0x3eb0('0x37')](_0x3eb0('0x38'))){_0x26e4c1['limit']=qs['limit'](_0x189db3[_0x3eb0('0x31')][_0x3eb0('0x1d')]);_0x26e4c1[_0x3eb0('0x1c')]=qs[_0x3eb0('0x1c')](_0x189db3[_0x3eb0('0x31')]['offset']);}return _0x3cef24['getTeams'](_0x26e4c1);}})[_0x3eb0('0x23')](function(_0xe2cf92){if(_0xe2cf92){return _0xe2cf92?{'count':_0x424ac0,'rows':_0xe2cf92}:null;}})['then'](respondWithResult(_0x450230,null))[_0x3eb0('0x45')](handleError(_0x450230,null));};exports[_0x3eb0('0x5e')]=function(_0x2bd94f,_0x4697bb,_0x33abcb){var _0x3abf6c=_0x2bd94f[_0x3eb0('0x4a')][_0x3eb0('0x5f')];return db[_0x3eb0('0x5d')][_0x3eb0('0x43')]({'where':{'id':_0x3abf6c},'attributes':['id'],'include':[{'model':db[_0x3eb0('0x55')],'as':_0x3eb0('0x60'),'attributes':['id',_0x3eb0('0x29'),_0x3eb0('0x61'),'voicePause',_0x3eb0('0x62')],'raw':!![]}]})[_0x3eb0('0x23')](function(_0x5c570f){if(_0x5c570f){var _0x3c944b=_[_0x3eb0('0x63')](_0x5c570f,function(_0xaa1b4e){var _0x14ff4c=_0xaa1b4e[_0x3eb0('0x25')]({'plain':!![]});return _0x14ff4c['Agents'];});return db[_0x3eb0('0x2b')][_0x3eb0('0x48')]({'where':{'id':_0x2bd94f['params']['id']}})[_0x3eb0('0x23')](function(_0x365329){return db[_0x3eb0('0x64')][_0x3eb0('0x65')](function(_0x5a40e7){return _0x365329[_0x3eb0('0x5e')](_0x3abf6c,{'transaction':_0x5a40e7})['then'](function(){return BPromise['each'](_0x3c944b,function(_0x5b340b){return db[_0x3eb0('0x54')]['findOrCreate']({'where':{'UserId':_0x5b340b['id'],'MailQueueId':_0x2bd94f[_0x3eb0('0x50')]['id']},'transaction':_0x5a40e7});});})['then'](function(){_0x3c944b[_0x3eb0('0x66')](function(_0x36d641){socket[_0x3eb0('0x67')]('userMailQueue:save',{'UserId':_0x36d641['id'],'MailQueueId':_0x365329['id']});});});});});}})[_0x3eb0('0x23')](respondWithStatusCode(_0x4697bb,null))[_0x3eb0('0x45')](handleError(_0x4697bb,null));};exports[_0x3eb0('0x68')]=function(_0x563641,_0x4dfc62,_0x8a365b){return db['Team'][_0x3eb0('0x43')]({'where':{'id':_0x563641[_0x3eb0('0x31')]['ids']},'attributes':['id'],'include':[{'model':db[_0x3eb0('0x55')],'as':_0x3eb0('0x60'),'attributes':['id'],'raw':!![]}]})[_0x3eb0('0x23')](handleEntityNotFound(_0x4dfc62,null))['then'](function(_0x5c8dc4){var _0x58ac53=_[_0x3eb0('0x2a')](_0x5c8dc4,'id');var _0x2015b6=[];var _0x3e8d2b=[];var _0x2a6a5d=squel[_0x3eb0('0x69')]();_0x2a6a5d[_0x3eb0('0x6a')](_0x3eb0('0x6b'))[_0x3eb0('0x6c')](_0x3eb0('0x6d'),'tq')[_0x3eb0('0x6e')](_0x3eb0('0x6f'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x3eb0('0x3b')](_0x3eb0('0x70'),_0x563641['params']['id']);for(var _0x3c5acc=0x0;_0x3c5acc<_0x5c8dc4[_0x3eb0('0x36')];_0x3c5acc+=0x1){let _0xb1215e=_0x5c8dc4[_0x3c5acc];for(var _0x1d7cdc=0x0;_0x1d7cdc<_0xb1215e[_0x3eb0('0x60')][_0x3eb0('0x36')];_0x1d7cdc+=0x1){let _0x23c6e0=_0xb1215e[_0x3eb0('0x60')][_0x1d7cdc];var _0x5a6a04=_0x2a6a5d[_0x3eb0('0x71')]();_0x5a6a04[_0x3eb0('0x3b')](_0x3eb0('0x72'),_0x23c6e0['id']);_0x3e8d2b['push'](db['sequelize'][_0x3eb0('0x31')](_0x5a6a04[_0x3eb0('0x73')](),{'type':db[_0x3eb0('0x64')][_0x3eb0('0x74')][_0x3eb0('0x75')]})[_0x3eb0('0x23')](function(_0x5d932a){if(_0x5d932a[_0x3eb0('0x36')]===0x1){return _0x23c6e0['id'];}else{var _0x1043a4=_['every'](_[_0x3eb0('0x2a')](_0x5d932a,_0x3eb0('0x76')),function(_0x16fb95){return _['includes'](_0x58ac53,_0x16fb95);});if(_0x1043a4){return _0x23c6e0['id'];}}}));}}return BPromise[_0x3eb0('0x77')](_0x3e8d2b)[_0x3eb0('0x23')](function(_0x40e4ae){_0x2015b6=_(_0x2015b6)[_0x3eb0('0x78')](_0x40e4ae)[_0x3eb0('0x79')]()['value']();return db[_0x3eb0('0x2b')][_0x3eb0('0x48')]({'where':{'id':_0x563641[_0x3eb0('0x50')]['id']}})[_0x3eb0('0x23')](function(_0x8be651){return db[_0x3eb0('0x64')]['transaction'](function(_0x31c698){return _0x8be651[_0x3eb0('0x68')](_0x563641[_0x3eb0('0x31')][_0x3eb0('0x5f')],{'transaction':_0x31c698})[_0x3eb0('0x23')](function(){if(!_[_0x3eb0('0x7a')](_0x2015b6)){return _0x8be651[_0x3eb0('0x7b')](_0x2015b6,{'transaction':_0x31c698});}})[_0x3eb0('0x23')](function(){_0x2015b6['forEach'](function(_0x4ee106){socket[_0x3eb0('0x67')](_0x3eb0('0x7c'),{'UserId':_0x4ee106,'MailQueueId':_0x8be651['id']});});});});});});})[_0x3eb0('0x23')](respondWithStatusCode(_0x4dfc62,null))[_0x3eb0('0x45')](handleError(_0x4dfc62,null));};exports[_0x3eb0('0x7d')]=function(_0x323fbd,_0x59751b,_0x144998){return db['MailQueue'][_0x3eb0('0x48')]({'where':{'id':_0x323fbd[_0x3eb0('0x50')]['id']}})['then'](handleEntityNotFound(_0x59751b,null))[_0x3eb0('0x23')](function(_0x15ef00){if(_0x15ef00){return _0x15ef00[_0x3eb0('0x7d')](_0x323fbd[_0x3eb0('0x4a')][_0x3eb0('0x5f')],_[_0x3eb0('0x7e')](_0x323fbd['body'],[_0x3eb0('0x5f'),'id'])||{})[_0x3eb0('0x7f')](function(_0x7fe911){for(var _0x466672=0x0;_0x466672<_0x323fbd[_0x3eb0('0x4a')]['ids'][_0x3eb0('0x36')];_0x466672+=0x1){socket[_0x3eb0('0x67')](_0x3eb0('0x80'),{'UserId':_0x323fbd[_0x3eb0('0x4a')][_0x3eb0('0x5f')][_0x466672],'MailQueueId':_0x323fbd[_0x3eb0('0x50')]['id']});}return _0x7fe911;});}})[_0x3eb0('0x23')](respondWithResult(_0x59751b,null))[_0x3eb0('0x45')](handleError(_0x59751b,null));};exports[_0x3eb0('0x7b')]=function(_0xd68e8a,_0x3613fc,_0x1d235f){return db['MailQueue'][_0x3eb0('0x48')]({'where':{'id':_0xd68e8a[_0x3eb0('0x50')]['id']}})[_0x3eb0('0x23')](handleEntityNotFound(_0x3613fc,null))[_0x3eb0('0x23')](function(_0x312706){if(_0x312706){return _0x312706[_0x3eb0('0x7b')](_0xd68e8a[_0x3eb0('0x31')][_0x3eb0('0x5f')])['then'](function(){if(_[_0x3eb0('0x81')](_0xd68e8a[_0x3eb0('0x31')][_0x3eb0('0x5f')])){for(var _0x301007=0x0;_0x301007<_0xd68e8a[_0x3eb0('0x31')][_0x3eb0('0x5f')][_0x3eb0('0x36')];_0x301007+=0x1){socket['emit'](_0x3eb0('0x7c'),{'UserId':Number(_0xd68e8a[_0x3eb0('0x31')][_0x3eb0('0x5f')][_0x301007]),'MailQueueId':Number(_0xd68e8a['params']['id'])});}}else{socket[_0x3eb0('0x67')]('userMailQueue:remove',{'UserId':Number(_0xd68e8a[_0x3eb0('0x31')]['ids']),'MailQueueId':Number(_0xd68e8a[_0x3eb0('0x50')]['id'])});}});}})[_0x3eb0('0x23')](respondWithStatusCode(_0x3613fc,null))[_0x3eb0('0x45')](handleError(_0x3613fc,null));};exports[_0x3eb0('0x82')]=function(_0x5b24de,_0x32094a,_0x17e1a8){var _0x4f37f2={};var _0x5eb74a={};var _0x24c14a;var _0x4e679e;return db[_0x3eb0('0x2b')][_0x3eb0('0x53')]({'where':{'id':_0x5b24de[_0x3eb0('0x50')]['id']}})[_0x3eb0('0x23')](handleEntityNotFound(_0x32094a,null))['then'](function(_0x150192){if(_0x150192){_0x24c14a=_0x150192;_0x5eb74a[_0x3eb0('0x30')]=_[_0x3eb0('0x47')](db['User']['rawAttributes']);_0x5eb74a[_0x3eb0('0x31')]=_[_0x3eb0('0x47')](_0x5b24de[_0x3eb0('0x31')]);_0x5eb74a['filters']=_['intersection'](_0x5eb74a['model'],_0x5eb74a['query']);_0x4f37f2[_0x3eb0('0x35')]=_[_0x3eb0('0x33')](_0x5eb74a['model'],qs[_0x3eb0('0x34')](_0x5b24de[_0x3eb0('0x31')]['fields']));_0x4f37f2[_0x3eb0('0x35')]=_0x4f37f2['attributes']['length']?_0x4f37f2[_0x3eb0('0x35')]:_0x5eb74a[_0x3eb0('0x30')];_0x4f37f2[_0x3eb0('0x39')]=qs['sort'](_0x5b24de[_0x3eb0('0x31')]['sort']);_0x4f37f2[_0x3eb0('0x3b')]=qs[_0x3eb0('0x32')](_[_0x3eb0('0x3c')](_0x5b24de['query'],_0x5eb74a['filters']));if(_0x5b24de['query'][_0x3eb0('0x3d')]){_0x4f37f2['where']=_[_0x3eb0('0x3e')](_0x4f37f2[_0x3eb0('0x3b')],{'$or':_[_0x3eb0('0x2a')](_0x4f37f2['attributes'],function(_0x516a6b){var _0x4a3b48={};_0x4a3b48[_0x516a6b]={'$like':'%'+_0x5b24de[_0x3eb0('0x31')]['filter']+'%'};return _0x4a3b48;})});}_0x4f37f2=_[_0x3eb0('0x3e')]({},_0x4f37f2,_0x5b24de[_0x3eb0('0x3f')]);return _0x24c14a['getAgents'](_0x4f37f2);}})['then'](function(_0x59259c){if(_0x59259c){_0x4e679e=_0x59259c[_0x3eb0('0x36')];if(!_0x5b24de[_0x3eb0('0x31')][_0x3eb0('0x37')](_0x3eb0('0x38'))){_0x4f37f2['limit']=qs[_0x3eb0('0x1d')](_0x5b24de[_0x3eb0('0x31')]['limit']);_0x4f37f2['offset']=qs[_0x3eb0('0x1c')](_0x5b24de[_0x3eb0('0x31')]['offset']);}return _0x24c14a[_0x3eb0('0x82')](_0x4f37f2);}})[_0x3eb0('0x23')](function(_0x43f943){if(_0x43f943){return _0x43f943?{'count':_0x4e679e,'rows':_0x43f943}:null;}})[_0x3eb0('0x23')](respondWithResult(_0x32094a,null))[_0x3eb0('0x45')](handleError(_0x32094a,null));}; \ No newline at end of file +var _0xeab4=['html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','localhost','socket.io-emitter','redis','./mailQueue.socket','sendStatus','end','status','json','count','offset','set','reject','update','then','get','MailQueues','UserProfileResource','destroy','error','stack','name','send','index','map','MailQueue','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','filter','merge','where','type','key','VIRTUAL','field','options','include','findAll','rows','catch','show','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','findOne','UserMailQueue','pick','MailQueueId','User','UserId','agent','updatedAt','%s/%s','SIP','mailPause','createdAt','getTeams','Team','addTeams','ids','Agents','online','interface','flatMap','each','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','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','TeamId','includes','union','compact','isEmpty','removeAgents','userMailQueue:remove','addAgents','spread','getAgents'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0xeab4,0x110));var _0x4eab=function(_0x508749,_0x259844){_0x508749=_0x508749-0x0;var _0x20eea0=_0xeab4[_0x508749];return _0x20eea0;};'use strict';var pdf=require(_0x4eab('0x0'));var emlformat=require(_0x4eab('0x1'));var rimraf=require(_0x4eab('0x2'));var zipdir=require(_0x4eab('0x3'));var jsonpatch=require(_0x4eab('0x4'));var rp=require('request-promise');var moment=require(_0x4eab('0x5'));var BPromise=require(_0x4eab('0x6'));var Mustache=require(_0x4eab('0x7'));var util=require('util');var path=require(_0x4eab('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4eab('0x9'));var fs=require('fs');var _=require(_0x4eab('0xa'));var squel=require(_0x4eab('0xb'));var crypto=require(_0x4eab('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x4eab('0xd'));var toCsv=require(_0x4eab('0xe'));var querystring=require(_0x4eab('0xf'));var Papa=require(_0x4eab('0x10'));var Redis=require(_0x4eab('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4eab('0x12'));var hardwareService=require(_0x4eab('0x13'));var logger=require(_0x4eab('0x14'))(_0x4eab('0x15'));var utils=require(_0x4eab('0x16'));var config=require('../../config/environment');var db=require(_0x4eab('0x17'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x4eab('0x18'),'port':0x18eb});var socket=require(_0x4eab('0x19'))(new Redis(config[_0x4eab('0x1a')]));require(_0x4eab('0x1b'))['register'](socket);function respondWithStatusCode(_0x11a07f,_0x258245){_0x258245=_0x258245||0xcc;return function(_0x82fb9e){if(_0x82fb9e){return _0x11a07f[_0x4eab('0x1c')](_0x258245);}return _0x11a07f['status'](_0x258245)[_0x4eab('0x1d')]();};}function respondWithResult(_0x125ecf,_0x285f16){_0x285f16=_0x285f16||0xc8;return function(_0x1c5047){if(_0x1c5047){return _0x125ecf[_0x4eab('0x1e')](_0x285f16)[_0x4eab('0x1f')](_0x1c5047);}};}function respondWithFilteredResult(_0x1e79e9,_0x138ae5){return function(_0x5f140c){if(_0x5f140c){var _0x4344eb=_0x5f140c[_0x4eab('0x20')],_0x1045ae=_0x138ae5['offset'],_0x326cd7=_0x138ae5[_0x4eab('0x21')]+_0x138ae5['limit'],_0x6994d7;if(_0x326cd7>=_0x4344eb){_0x326cd7=_0x4344eb;_0x6994d7=0xc8;}else{_0x6994d7=0xce;}_0x1e79e9[_0x4eab('0x1e')](_0x6994d7);return _0x1e79e9[_0x4eab('0x22')]('Content-Range',_0x1045ae+'-'+_0x326cd7+'/'+_0x4344eb)[_0x4eab('0x1f')](_0x5f140c);}return null;};}function patchUpdates(_0x4d9f9b){return function(_0x331ca4){try{jsonpatch['apply'](_0x331ca4,_0x4d9f9b,!![]);}catch(_0x405dec){return BPromise[_0x4eab('0x23')](_0x405dec);}return _0x331ca4['save']();};}function saveUpdates(_0x395868,_0xf310e7){return function(_0x4269ee){if(_0x4269ee){return _0x4269ee[_0x4eab('0x24')](_0x395868)[_0x4eab('0x25')](function(_0x3565bb){return _0x3565bb;});}return null;};}function removeEntity(_0x429c8f,_0x50d133){return function(_0x2ae713){if(_0x2ae713){return _0x2ae713['destroy']()['then'](function(){var _0x49a5bc=_0x2ae713[_0x4eab('0x26')]({'plain':!![]});var _0x4ea6e3=_0x4eab('0x27');return db[_0x4eab('0x28')][_0x4eab('0x29')]({'where':{'type':_0x4ea6e3,'resourceId':_0x49a5bc['id']}})[_0x4eab('0x25')](function(){return _0x2ae713;});})['then'](function(){_0x429c8f[_0x4eab('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d410f,_0x3e509b){return function(_0x465966){if(!_0x465966){_0x3d410f[_0x4eab('0x1c')](0x194);}return _0x465966;};}function handleError(_0x53d6e5,_0x379a47){_0x379a47=_0x379a47||0x1f4;return function(_0x2ee978){logger[_0x4eab('0x2a')](_0x2ee978[_0x4eab('0x2b')]);if(_0x2ee978[_0x4eab('0x2c')]){delete _0x2ee978[_0x4eab('0x2c')];}_0x53d6e5[_0x4eab('0x1e')](_0x379a47)[_0x4eab('0x2d')](_0x2ee978);};}exports[_0x4eab('0x2e')]=function(_0xb60d0f,_0x4dcb3f){var _0x57836a={},_0x1e8355={},_0x4c270f={'count':0x0,'rows':[]};var _0x2d9504=_[_0x4eab('0x2f')](db[_0x4eab('0x30')][_0x4eab('0x31')],function(_0x12ba4e){return{'name':_0x12ba4e['fieldName'],'type':_0x12ba4e['type']['key']};});_0x1e8355[_0x4eab('0x32')]=_['map'](_0x2d9504,_0x4eab('0x2c'));_0x1e8355[_0x4eab('0x33')]=_[_0x4eab('0x34')](_0xb60d0f[_0x4eab('0x33')]);_0x1e8355[_0x4eab('0x35')]=_[_0x4eab('0x36')](_0x1e8355[_0x4eab('0x32')],_0x1e8355['query']);_0x57836a[_0x4eab('0x37')]=_[_0x4eab('0x36')](_0x1e8355[_0x4eab('0x32')],qs[_0x4eab('0x38')](_0xb60d0f[_0x4eab('0x33')]['fields']));_0x57836a[_0x4eab('0x37')]=_0x57836a['attributes'][_0x4eab('0x39')]?_0x57836a[_0x4eab('0x37')]:_0x1e8355[_0x4eab('0x32')];if(!_0xb60d0f[_0x4eab('0x33')][_0x4eab('0x3a')](_0x4eab('0x3b'))){_0x57836a['limit']=qs[_0x4eab('0x3c')](_0xb60d0f['query'][_0x4eab('0x3c')]);_0x57836a[_0x4eab('0x21')]=qs[_0x4eab('0x21')](_0xb60d0f[_0x4eab('0x33')][_0x4eab('0x21')]);}_0x57836a[_0x4eab('0x3d')]=qs[_0x4eab('0x3e')](_0xb60d0f[_0x4eab('0x33')][_0x4eab('0x3e')]);_0x57836a['where']=qs[_0x4eab('0x35')](_['pick'](_0xb60d0f['query'],_0x1e8355[_0x4eab('0x35')]));if(_0xb60d0f[_0x4eab('0x33')][_0x4eab('0x3f')]){_0x57836a['where']=_[_0x4eab('0x40')](_0x57836a[_0x4eab('0x41')],{'$or':_[_0x4eab('0x2f')](_0x2d9504,function(_0x3011b5){if(_0x3011b5[_0x4eab('0x42')][_0x4eab('0x43')]!==_0x4eab('0x44')){var _0x303bd5={};_0x303bd5[_0x3011b5[_0x4eab('0x45')]]={'$like':'%'+_0xb60d0f[_0x4eab('0x33')][_0x4eab('0x3f')]+'%'};return _0x303bd5;}})});}_0x57836a=_[_0x4eab('0x40')]({},_0x57836a,_0xb60d0f[_0x4eab('0x46')]);var _0xbfb496={'where':_0x57836a[_0x4eab('0x41')]};return db[_0x4eab('0x30')][_0x4eab('0x20')](_0xbfb496)['then'](function(_0x5129f0){_0x4c270f[_0x4eab('0x20')]=_0x5129f0;if(_0xb60d0f[_0x4eab('0x33')]['includeAll']){_0x57836a[_0x4eab('0x47')]=[{'all':!![]}];}return db[_0x4eab('0x30')][_0x4eab('0x48')](_0x57836a);})[_0x4eab('0x25')](function(_0x1c1aa8){_0x4c270f[_0x4eab('0x49')]=_0x1c1aa8;return _0x4c270f;})['then'](respondWithFilteredResult(_0x4dcb3f,_0x57836a))[_0x4eab('0x4a')](handleError(_0x4dcb3f,null));};exports[_0x4eab('0x4b')]=function(_0x36e759,_0x3757c1){var _0x50f31b={'raw':!![],'where':{'id':_0x36e759['params']['id']}},_0x3895e8={};_0x3895e8['model']=_['keys'](db['MailQueue'][_0x4eab('0x31')]);_0x3895e8[_0x4eab('0x33')]=_[_0x4eab('0x34')](_0x36e759[_0x4eab('0x33')]);_0x3895e8[_0x4eab('0x35')]=_[_0x4eab('0x36')](_0x3895e8[_0x4eab('0x32')],_0x3895e8[_0x4eab('0x33')]);_0x50f31b[_0x4eab('0x37')]=_[_0x4eab('0x36')](_0x3895e8['model'],qs[_0x4eab('0x38')](_0x36e759[_0x4eab('0x33')][_0x4eab('0x38')]));_0x50f31b['attributes']=_0x50f31b[_0x4eab('0x37')][_0x4eab('0x39')]?_0x50f31b[_0x4eab('0x37')]:_0x3895e8[_0x4eab('0x32')];if(_0x36e759[_0x4eab('0x33')]['includeAll']){_0x50f31b[_0x4eab('0x47')]=[{'all':!![]}];}_0x50f31b=_['merge']({},_0x50f31b,_0x36e759[_0x4eab('0x46')]);return db[_0x4eab('0x30')][_0x4eab('0x4c')](_0x50f31b)[_0x4eab('0x25')](handleEntityNotFound(_0x3757c1,null))[_0x4eab('0x25')](respondWithResult(_0x3757c1,null))[_0x4eab('0x4a')](handleError(_0x3757c1,null));};exports[_0x4eab('0x4d')]=function(_0x585f87,_0x189ee9){return db[_0x4eab('0x30')][_0x4eab('0x4d')](_0x585f87['body'],{})[_0x4eab('0x25')](function(_0x572fc8){var _0x33ef00=_0x585f87[_0x4eab('0x4e')][_0x4eab('0x26')]({'plain':!![]});if(!_0x33ef00)throw new Error(_0x4eab('0x4f'));if(_0x33ef00[_0x4eab('0x50')]==='user'){var _0x403a27=_0x572fc8[_0x4eab('0x26')]({'plain':!![]});var _0x17283b=_0x4eab('0x27');return db['UserProfileSection'][_0x4eab('0x4c')]({'where':{'name':_0x17283b,'userProfileId':_0x33ef00['userProfileId']},'raw':!![]})[_0x4eab('0x25')](function(_0x179784){if(_0x179784&&_0x179784[_0x4eab('0x51')]===0x0){return db[_0x4eab('0x28')]['create']({'name':_0x403a27[_0x4eab('0x2c')],'resourceId':_0x403a27['id'],'type':_0x179784[_0x4eab('0x2c')],'sectionId':_0x179784['id']},{})[_0x4eab('0x25')](function(){return _0x572fc8;});}else{return _0x572fc8;}})[_0x4eab('0x4a')](function(_0xcf3621){logger[_0x4eab('0x2a')](_0x4eab('0x52'),_0xcf3621);throw _0xcf3621;});}return _0x572fc8;})[_0x4eab('0x25')](respondWithResult(_0x189ee9,0xc9))['catch'](handleError(_0x189ee9,null));};exports['update']=function(_0x3f55e3,_0x21752c){if(_0x3f55e3[_0x4eab('0x53')]['id']){delete _0x3f55e3[_0x4eab('0x53')]['id'];}return db[_0x4eab('0x30')][_0x4eab('0x4c')]({'where':{'id':_0x3f55e3[_0x4eab('0x54')]['id']}})['then'](handleEntityNotFound(_0x21752c,null))['then'](saveUpdates(_0x3f55e3[_0x4eab('0x53')],null))[_0x4eab('0x25')](respondWithResult(_0x21752c,null))[_0x4eab('0x4a')](handleError(_0x21752c,null));};exports['destroy']=function(_0x138b06,_0x4fcdc7){return db['MailQueue']['find']({'where':{'id':_0x138b06['params']['id']}})[_0x4eab('0x25')](handleEntityNotFound(_0x4fcdc7,null))[_0x4eab('0x25')](removeEntity(_0x4fcdc7,null))[_0x4eab('0x4a')](handleError(_0x4fcdc7,null));};exports[_0x4eab('0x55')]=function(_0x2e114b,_0x1694cd){return db['MailQueue'][_0x4eab('0x55')]()[_0x4eab('0x25')](respondWithResult(_0x1694cd,null))[_0x4eab('0x4a')](handleError(_0x1694cd,null));};exports['getMembers']=function(_0x46d23f,_0x2deea1,_0x36cb8b){var _0x54936b={'raw':!![],'where':{}},_0x355993={},_0x37ce7b;return db[_0x4eab('0x30')][_0x4eab('0x56')]({'where':{'id':_0x46d23f[_0x4eab('0x54')]['id']}})[_0x4eab('0x25')](handleEntityNotFound(_0x2deea1,null))[_0x4eab('0x25')](function(_0x805ce2){if(_0x805ce2){_0x37ce7b=_0x805ce2[_0x4eab('0x26')]({'plain':!![]});_0x355993['model']=_[_0x4eab('0x34')](db[_0x4eab('0x57')][_0x4eab('0x31')]);_0x355993[_0x4eab('0x33')]=_['keys'](_0x46d23f[_0x4eab('0x33')]);_0x355993[_0x4eab('0x35')]=_[_0x4eab('0x36')](_0x355993['model'],_0x355993['query']);_0x54936b[_0x4eab('0x37')]=_['intersection'](_0x355993[_0x4eab('0x32')],qs['fields'](_0x46d23f['query'][_0x4eab('0x38')]));_0x54936b[_0x4eab('0x37')]=_0x54936b[_0x4eab('0x37')]['length']?_0x54936b[_0x4eab('0x37')]:_0x355993[_0x4eab('0x32')];if(!_0x46d23f[_0x4eab('0x33')][_0x4eab('0x3a')](_0x4eab('0x3b'))){_0x54936b[_0x4eab('0x3c')]=qs['limit'](_0x46d23f['query'][_0x4eab('0x3c')]);_0x54936b[_0x4eab('0x21')]=qs[_0x4eab('0x21')](_0x46d23f[_0x4eab('0x33')][_0x4eab('0x21')]);}_0x54936b[_0x4eab('0x3d')]=qs[_0x4eab('0x3e')](_0x46d23f[_0x4eab('0x33')][_0x4eab('0x3e')]);_0x54936b[_0x4eab('0x41')]=qs[_0x4eab('0x35')](_[_0x4eab('0x58')](_0x46d23f[_0x4eab('0x33')],_0x355993[_0x4eab('0x35')]));_0x54936b['where'][_0x4eab('0x59')]=_0x805ce2['id'];if(_0x46d23f[_0x4eab('0x33')][_0x4eab('0x3f')]){_0x54936b[_0x4eab('0x41')]=_[_0x4eab('0x40')](_0x54936b[_0x4eab('0x41')],{'$or':_[_0x4eab('0x2f')](_0x54936b['attributes'],function(_0x527391){var _0x2bdd6d={};_0x2bdd6d[_0x527391]={'$like':'%'+_0x46d23f['query'][_0x4eab('0x3f')]+'%'};return _0x2bdd6d;})});}_0x54936b=_[_0x4eab('0x40')]({},_0x54936b,_0x46d23f[_0x4eab('0x46')]);return db[_0x4eab('0x57')][_0x4eab('0x48')](_0x54936b);}})['then'](function(_0x1a2fc2){if(_0x1a2fc2){return db[_0x4eab('0x5a')]['findAndCountAll']({'where':{'id':_['map'](_0x1a2fc2,_0x4eab('0x5b')),'role':_0x4eab('0x5c')},'attributes':['id',_0x4eab('0x2c'),'mailPause',_0x4eab('0x5d'),'createdAt']});}})['then'](function(_0x3c721c){if(_0x3c721c){return{'count':_0x3c721c[_0x4eab('0x20')],'rows':_[_0x4eab('0x2f')](_0x3c721c[_0x4eab('0x49')],function(_0x20235e){return{'membername':_0x20235e[_0x4eab('0x2c')],'UserId':_0x20235e['id'],'queue_name':_0x37ce7b['name'],'MailQueueId':_0x37ce7b['id'],'interface':util['format'](_0x4eab('0x5e'),_0x4eab('0x5f'),_0x20235e[_0x4eab('0x2c')]),'penalty':0x0,'paused':_0x20235e[_0x4eab('0x60')],'createdAt':_0x20235e[_0x4eab('0x61')],'updatedAt':_0x20235e['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x4eab('0x25')](respondWithFilteredResult(_0x2deea1,_0x54936b))[_0x4eab('0x4a')](handleError(_0x2deea1,null));};exports[_0x4eab('0x62')]=function(_0x2beba4,_0x3a2b2a,_0x577279){var _0x3b6728={};var _0x5bf005={};var _0x5d3b81;var _0x3affa7;return db[_0x4eab('0x30')]['findOne']({'where':{'id':_0x2beba4[_0x4eab('0x54')]['id']}})['then'](handleEntityNotFound(_0x3a2b2a,null))[_0x4eab('0x25')](function(_0x4745d6){if(_0x4745d6){_0x5d3b81=_0x4745d6;_0x5bf005[_0x4eab('0x32')]=_[_0x4eab('0x34')](db[_0x4eab('0x63')][_0x4eab('0x31')]);_0x5bf005[_0x4eab('0x33')]=_[_0x4eab('0x34')](_0x2beba4[_0x4eab('0x33')]);_0x5bf005[_0x4eab('0x35')]=_['intersection'](_0x5bf005[_0x4eab('0x32')],_0x5bf005[_0x4eab('0x33')]);_0x3b6728[_0x4eab('0x37')]=_[_0x4eab('0x36')](_0x5bf005['model'],qs[_0x4eab('0x38')](_0x2beba4[_0x4eab('0x33')]['fields']));_0x3b6728[_0x4eab('0x37')]=_0x3b6728['attributes'][_0x4eab('0x39')]?_0x3b6728[_0x4eab('0x37')]:_0x5bf005['model'];_0x3b6728[_0x4eab('0x3d')]=qs[_0x4eab('0x3e')](_0x2beba4[_0x4eab('0x33')][_0x4eab('0x3e')]);_0x3b6728[_0x4eab('0x41')]=qs[_0x4eab('0x35')](_[_0x4eab('0x58')](_0x2beba4['query'],_0x5bf005[_0x4eab('0x35')]));if(_0x2beba4[_0x4eab('0x33')][_0x4eab('0x3f')]){_0x3b6728[_0x4eab('0x41')]=_['merge'](_0x3b6728[_0x4eab('0x41')],{'$or':_[_0x4eab('0x2f')](_0x3b6728[_0x4eab('0x37')],function(_0x1bcc03){var _0x5c24c8={};_0x5c24c8[_0x1bcc03]={'$like':'%'+_0x2beba4[_0x4eab('0x33')][_0x4eab('0x3f')]+'%'};return _0x5c24c8;})});}_0x3b6728=_[_0x4eab('0x40')]({},_0x3b6728,_0x2beba4[_0x4eab('0x46')]);return _0x5d3b81[_0x4eab('0x62')](_0x3b6728);}})[_0x4eab('0x25')](function(_0x515382){if(_0x515382){_0x3affa7=_0x515382[_0x4eab('0x39')];if(!_0x2beba4['query']['hasOwnProperty'](_0x4eab('0x3b'))){_0x3b6728[_0x4eab('0x3c')]=qs[_0x4eab('0x3c')](_0x2beba4[_0x4eab('0x33')]['limit']);_0x3b6728[_0x4eab('0x21')]=qs[_0x4eab('0x21')](_0x2beba4[_0x4eab('0x33')][_0x4eab('0x21')]);}return _0x5d3b81[_0x4eab('0x62')](_0x3b6728);}})[_0x4eab('0x25')](function(_0x3ce1e8){if(_0x3ce1e8){return _0x3ce1e8?{'count':_0x3affa7,'rows':_0x3ce1e8}:null;}})[_0x4eab('0x25')](respondWithResult(_0x3a2b2a,null))[_0x4eab('0x4a')](handleError(_0x3a2b2a,null));};exports[_0x4eab('0x64')]=function(_0x36b88a,_0x4c5fc6,_0x2d69ec){var _0x73bad1=_0x36b88a[_0x4eab('0x53')][_0x4eab('0x65')];return db['Team'][_0x4eab('0x48')]({'where':{'id':_0x73bad1},'attributes':['id'],'include':[{'model':db[_0x4eab('0x5a')],'as':_0x4eab('0x66'),'attributes':['id',_0x4eab('0x2c'),_0x4eab('0x67'),'voicePause',_0x4eab('0x68')],'raw':!![]}]})['then'](function(_0x388904){if(_0x388904){var _0x120eff=_[_0x4eab('0x69')](_0x388904,function(_0x8b20a){var _0x178da8=_0x8b20a[_0x4eab('0x26')]({'plain':!![]});return _0x178da8['Agents'];});return db[_0x4eab('0x30')][_0x4eab('0x4c')]({'where':{'id':_0x36b88a[_0x4eab('0x54')]['id']}})['then'](function(_0x265de6){return db['sequelize']['transaction'](function(_0x4f5502){return _0x265de6[_0x4eab('0x64')](_0x73bad1,{'transaction':_0x4f5502})['then'](function(){return BPromise[_0x4eab('0x6a')](_0x120eff,function(_0x384d5c){return db[_0x4eab('0x57')][_0x4eab('0x6b')]({'where':{'UserId':_0x384d5c['id'],'MailQueueId':_0x36b88a[_0x4eab('0x54')]['id']},'transaction':_0x4f5502});});})[_0x4eab('0x25')](function(){_0x120eff[_0x4eab('0x6c')](function(_0xf80d5c){socket[_0x4eab('0x6d')](_0x4eab('0x6e'),{'UserId':_0xf80d5c['id'],'MailQueueId':_0x265de6['id']});});});});});}})[_0x4eab('0x25')](respondWithStatusCode(_0x4c5fc6,null))[_0x4eab('0x4a')](handleError(_0x4c5fc6,null));};exports[_0x4eab('0x6f')]=function(_0x2cec0b,_0x4e95d2,_0x45b5ad){return db[_0x4eab('0x63')][_0x4eab('0x48')]({'where':{'id':_0x2cec0b[_0x4eab('0x33')]['ids']},'attributes':['id'],'include':[{'model':db[_0x4eab('0x5a')],'as':_0x4eab('0x66'),'attributes':['id'],'raw':!![]}]})[_0x4eab('0x25')](handleEntityNotFound(_0x4e95d2,null))[_0x4eab('0x25')](function(_0x5321f8){var _0x24341d=_[_0x4eab('0x2f')](_0x5321f8,'id');var _0x4ed760=[];var _0x1dc362=[];var _0x164bd8=squel['select']();_0x164bd8[_0x4eab('0x45')](_0x4eab('0x70'))[_0x4eab('0x71')](_0x4eab('0x72'),'tq')[_0x4eab('0x73')](_0x4eab('0x74'),'ut',_0x4eab('0x75'))['where'](_0x4eab('0x76'),_0x2cec0b[_0x4eab('0x54')]['id']);for(var _0x472f80=0x0;_0x472f80<_0x5321f8[_0x4eab('0x39')];_0x472f80+=0x1){let _0xf36ea1=_0x5321f8[_0x472f80];for(var _0x2d6dcb=0x0;_0x2d6dcb<_0xf36ea1[_0x4eab('0x66')][_0x4eab('0x39')];_0x2d6dcb+=0x1){let _0x20ee1f=_0xf36ea1['Agents'][_0x2d6dcb];var _0x319723=_0x164bd8[_0x4eab('0x77')]();_0x319723['where'](_0x4eab('0x78'),_0x20ee1f['id']);_0x1dc362[_0x4eab('0x79')](db[_0x4eab('0x7a')]['query'](_0x319723[_0x4eab('0x7b')](),{'type':db['sequelize'][_0x4eab('0x7c')][_0x4eab('0x7d')]})[_0x4eab('0x25')](function(_0x2ea5e5){if(_0x2ea5e5[_0x4eab('0x39')]===0x1){return _0x20ee1f['id'];}else{var _0x533a2c=_['every'](_['map'](_0x2ea5e5,_0x4eab('0x7e')),function(_0xe2369e){return _[_0x4eab('0x7f')](_0x24341d,_0xe2369e);});if(_0x533a2c){return _0x20ee1f['id'];}}}));}}return BPromise['all'](_0x1dc362)[_0x4eab('0x25')](function(_0x4d104d){_0x4ed760=_(_0x4ed760)[_0x4eab('0x80')](_0x4d104d)[_0x4eab('0x81')]()['value']();return db[_0x4eab('0x30')][_0x4eab('0x4c')]({'where':{'id':_0x2cec0b[_0x4eab('0x54')]['id']}})[_0x4eab('0x25')](function(_0x4d8a33){return db['sequelize']['transaction'](function(_0x1ce217){return _0x4d8a33[_0x4eab('0x6f')](_0x2cec0b['query'][_0x4eab('0x65')],{'transaction':_0x1ce217})['then'](function(){if(!_[_0x4eab('0x82')](_0x4ed760)){return _0x4d8a33[_0x4eab('0x83')](_0x4ed760,{'transaction':_0x1ce217});}})[_0x4eab('0x25')](function(){_0x4ed760[_0x4eab('0x6c')](function(_0x3f5443){socket['emit'](_0x4eab('0x84'),{'UserId':_0x3f5443,'MailQueueId':_0x4d8a33['id']});});});});});});})[_0x4eab('0x25')](respondWithStatusCode(_0x4e95d2,null))['catch'](handleError(_0x4e95d2,null));};exports[_0x4eab('0x85')]=function(_0x144159,_0xc406fa,_0x2fa591){return db[_0x4eab('0x30')][_0x4eab('0x4c')]({'where':{'id':_0x144159[_0x4eab('0x54')]['id']}})[_0x4eab('0x25')](handleEntityNotFound(_0xc406fa,null))[_0x4eab('0x25')](function(_0x237380){if(_0x237380){return _0x237380[_0x4eab('0x85')](_0x144159[_0x4eab('0x53')]['ids'],_['omit'](_0x144159[_0x4eab('0x53')],['ids','id'])||{})[_0x4eab('0x86')](function(_0x11fe9d){for(var _0xe0e824=0x0;_0xe0e824<_0x144159[_0x4eab('0x53')][_0x4eab('0x65')][_0x4eab('0x39')];_0xe0e824+=0x1){socket[_0x4eab('0x6d')](_0x4eab('0x6e'),{'UserId':_0x144159[_0x4eab('0x53')][_0x4eab('0x65')][_0xe0e824],'MailQueueId':_0x144159[_0x4eab('0x54')]['id']});}return _0x11fe9d;});}})[_0x4eab('0x25')](respondWithResult(_0xc406fa,null))[_0x4eab('0x4a')](handleError(_0xc406fa,null));};exports['removeAgents']=function(_0x3d8b30,_0x48659a,_0x3200c0){return db['MailQueue'][_0x4eab('0x4c')]({'where':{'id':_0x3d8b30[_0x4eab('0x54')]['id']}})[_0x4eab('0x25')](handleEntityNotFound(_0x48659a,null))['then'](function(_0x56950b){if(_0x56950b){return _0x56950b[_0x4eab('0x83')](_0x3d8b30[_0x4eab('0x33')][_0x4eab('0x65')])[_0x4eab('0x25')](function(){if(_['isArray'](_0x3d8b30[_0x4eab('0x33')][_0x4eab('0x65')])){for(var _0x57b541=0x0;_0x57b541<_0x3d8b30['query'][_0x4eab('0x65')][_0x4eab('0x39')];_0x57b541+=0x1){socket[_0x4eab('0x6d')](_0x4eab('0x84'),{'UserId':Number(_0x3d8b30[_0x4eab('0x33')][_0x4eab('0x65')][_0x57b541]),'MailQueueId':Number(_0x3d8b30[_0x4eab('0x54')]['id'])});}}else{socket[_0x4eab('0x6d')](_0x4eab('0x84'),{'UserId':Number(_0x3d8b30['query'][_0x4eab('0x65')]),'MailQueueId':Number(_0x3d8b30[_0x4eab('0x54')]['id'])});}});}})['then'](respondWithStatusCode(_0x48659a,null))['catch'](handleError(_0x48659a,null));};exports[_0x4eab('0x87')]=function(_0x2e2521,_0x22172a,_0x4de96b){var _0x46d5d9={};var _0x47c7b1={};var _0x37cdbf;var _0x28f1ed;return db[_0x4eab('0x30')]['findOne']({'where':{'id':_0x2e2521[_0x4eab('0x54')]['id']}})[_0x4eab('0x25')](handleEntityNotFound(_0x22172a,null))[_0x4eab('0x25')](function(_0x4f160f){if(_0x4f160f){_0x37cdbf=_0x4f160f;_0x47c7b1[_0x4eab('0x32')]=_['keys'](db[_0x4eab('0x5a')]['rawAttributes']);_0x47c7b1['query']=_['keys'](_0x2e2521[_0x4eab('0x33')]);_0x47c7b1[_0x4eab('0x35')]=_['intersection'](_0x47c7b1[_0x4eab('0x32')],_0x47c7b1['query']);_0x46d5d9[_0x4eab('0x37')]=_[_0x4eab('0x36')](_0x47c7b1[_0x4eab('0x32')],qs[_0x4eab('0x38')](_0x2e2521[_0x4eab('0x33')]['fields']));_0x46d5d9[_0x4eab('0x37')]=_0x46d5d9[_0x4eab('0x37')]['length']?_0x46d5d9[_0x4eab('0x37')]:_0x47c7b1[_0x4eab('0x32')];_0x46d5d9[_0x4eab('0x3d')]=qs[_0x4eab('0x3e')](_0x2e2521[_0x4eab('0x33')][_0x4eab('0x3e')]);_0x46d5d9[_0x4eab('0x41')]=qs[_0x4eab('0x35')](_[_0x4eab('0x58')](_0x2e2521[_0x4eab('0x33')],_0x47c7b1['filters']));if(_0x2e2521[_0x4eab('0x33')]['filter']){_0x46d5d9[_0x4eab('0x41')]=_['merge'](_0x46d5d9[_0x4eab('0x41')],{'$or':_[_0x4eab('0x2f')](_0x46d5d9[_0x4eab('0x37')],function(_0x2d703a){var _0x49073b={};_0x49073b[_0x2d703a]={'$like':'%'+_0x2e2521[_0x4eab('0x33')]['filter']+'%'};return _0x49073b;})});}_0x46d5d9=_[_0x4eab('0x40')]({},_0x46d5d9,_0x2e2521[_0x4eab('0x46')]);return _0x37cdbf['getAgents'](_0x46d5d9);}})[_0x4eab('0x25')](function(_0x2cbe90){if(_0x2cbe90){_0x28f1ed=_0x2cbe90[_0x4eab('0x39')];if(!_0x2e2521[_0x4eab('0x33')]['hasOwnProperty'](_0x4eab('0x3b'))){_0x46d5d9[_0x4eab('0x3c')]=qs[_0x4eab('0x3c')](_0x2e2521[_0x4eab('0x33')][_0x4eab('0x3c')]);_0x46d5d9['offset']=qs[_0x4eab('0x21')](_0x2e2521[_0x4eab('0x33')][_0x4eab('0x21')]);}return _0x37cdbf[_0x4eab('0x87')](_0x46d5d9);}})[_0x4eab('0x25')](function(_0x4e7e45){if(_0x4e7e45){return _0x4e7e45?{'count':_0x28f1ed,'rows':_0x4e7e45}:null;}})[_0x4eab('0x25')](respondWithResult(_0x22172a,null))[_0x4eab('0x4a')](handleError(_0x22172a,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index d139bca..7512f0d 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 _0x1094=['../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x35a4db,_0x499be1){var _0x243dac=function(_0x1729c5){while(--_0x1729c5){_0x35a4db['push'](_0x35a4db['shift']());}};_0x243dac(++_0x499be1);}(_0x1094,0x143));var _0x4109=function(_0x3861f7,_0x995b22){_0x3861f7=_0x3861f7-0x0;var _0x50879f=_0x1094[_0x3861f7];return _0x50879f;};'use strict';var EventEmitter=require(_0x4109('0x0'));var MailQueue=require(_0x4109('0x1'))['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x4109('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4109('0x3'),'afterDestroy':_0x4109('0x4')};function emitEvent(_0x308136){return function(_0x181d79,_0x36e917,_0x5684ce){MailQueueEvents[_0x4109('0x5')](_0x308136+':'+_0x181d79['id'],_0x181d79);MailQueueEvents[_0x4109('0x5')](_0x308136,_0x181d79);_0x5684ce(null);};}for(var e in events){if(events[_0x4109('0x6')](e)){var event=events[e];MailQueue[_0x4109('0x7')](e,emitEvent(event));}}module[_0x4109('0x8')]=MailQueueEvents; \ No newline at end of file +var _0x8a9d=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x2babf1,_0x259cea){var _0x4e3735=function(_0x11c5d7){while(--_0x11c5d7){_0x2babf1['push'](_0x2babf1['shift']());}};_0x4e3735(++_0x259cea);}(_0x8a9d,0x1ed));var _0xd8a9=function(_0x187924,_0x17e8e1){_0x187924=_0x187924-0x0;var _0x434cff=_0x8a9d[_0x187924];return _0x434cff;};'use strict';var EventEmitter=require(_0xd8a9('0x0'));var MailQueue=require(_0xd8a9('0x1'))['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xd8a9('0x2')](0x0);var events={'afterCreate':_0xd8a9('0x3'),'afterUpdate':'update','afterDestroy':_0xd8a9('0x4')};function emitEvent(_0x4c3805){return function(_0x5ee117,_0x1b6f39,_0x2982fe){MailQueueEvents[_0xd8a9('0x5')](_0x4c3805+':'+_0x5ee117['id'],_0x5ee117);MailQueueEvents['emit'](_0x4c3805,_0x5ee117);_0x2982fe(null);};}for(var e in events){if(events[_0xd8a9('0x6')](e)){var event=events[e];MailQueue[_0xd8a9('0x7')](e,emitEvent(event));}}module[_0xd8a9('0x8')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index ae68d8a..9df5518 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 _0x1475=['mail_queues','lodash','util','api','moment','bluebird','request-promise','path','rimraf','exports','define','MailQueue'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x1475,0x175));var _0x5147=function(_0x786e9,_0x1a029){_0x786e9=_0x786e9-0x0;var _0x1f891b=_0x1475[_0x786e9];return _0x1f891b;};'use strict';var _=require(_0x5147('0x0'));var util=require(_0x5147('0x1'));var logger=require('../../config/logger')(_0x5147('0x2'));var moment=require(_0x5147('0x3'));var BPromise=require(_0x5147('0x4'));var rp=require(_0x5147('0x5'));var fs=require('fs');var path=require(_0x5147('0x6'));var rimraf=require(_0x5147('0x7'));var config=require('../../config/environment');var attributes=require('./mailQueue.attributes');module[_0x5147('0x8')]=function(_0x2d87f9,_0x2d2218){return _0x2d87f9[_0x5147('0x9')](_0x5147('0xa'),attributes,{'tableName':_0x5147('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcfa1=['bluebird','request-promise','path','rimraf','../../config/environment','./mailQueue.attributes','exports','mail_queues','lodash','util','../../config/logger','api'];(function(_0x410a9b,_0xac513e){var _0x2878b6=function(_0x44f79a){while(--_0x44f79a){_0x410a9b['push'](_0x410a9b['shift']());}};_0x2878b6(++_0xac513e);}(_0xcfa1,0xb0));var _0x1cfa=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xcfa1[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x1cfa('0x0'));var util=require(_0x1cfa('0x1'));var logger=require(_0x1cfa('0x2'))(_0x1cfa('0x3'));var moment=require('moment');var BPromise=require(_0x1cfa('0x4'));var rp=require(_0x1cfa('0x5'));var fs=require('fs');var path=require(_0x1cfa('0x6'));var rimraf=require(_0x1cfa('0x7'));var config=require(_0x1cfa('0x8'));var attributes=require(_0x1cfa('0x9'));module[_0x1cfa('0xa')]=function(_0x20e216,_0x45c6ae){return _0x20e216['define']('MailQueue',attributes,{'tableName':_0x1cfa('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.rpc.js b/server/api/mailQueue/mailQueue.rpc.js index 2c574e9..7f6c796 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 _0x15b6=['then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','GetMailQueue','MailQueue','options','raw','where','limit','include','model','attributes','find','map','ShowMailQueue','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','request'];(function(_0x2247ab,_0x3f4162){var _0x430062=function(_0x591dd7){while(--_0x591dd7){_0x2247ab['push'](_0x2247ab['shift']());}};_0x430062(++_0x3f4162);}(_0x15b6,0x180));var _0x615b=function(_0x2e108a,_0x2dd2bf){_0x2e108a=_0x2e108a-0x0;var _0x6975c1=_0x15b6[_0x2e108a];return _0x6975c1;};'use strict';var _=require(_0x615b('0x0'));var util=require(_0x615b('0x1'));var moment=require(_0x615b('0x2'));var BPromise=require(_0x615b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x615b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x615b('0x5'));var logger=require('../../config/logger')(_0x615b('0x6'));var config=require(_0x615b('0x7'));var jayson=require(_0x615b('0x8'));var client=jayson[_0x615b('0x9')][_0x615b('0xa')]({'port':0x232a});config[_0x615b('0xb')]=_[_0x615b('0xc')](config['redis'],{'host':_0x615b('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x615b('0xb')]));require('./mailQueue.socket')[_0x615b('0xe')](socket);function respondWithRpcPromise(_0x596bd5,_0x16d09a,_0x22c9a0){return new BPromise(function(_0x44226b,_0x752f2d){return client[_0x615b('0xf')](_0x596bd5,_0x22c9a0)[_0x615b('0x10')](function(_0x5f0e6){logger[_0x615b('0x11')](_0x615b('0x12'),_0x16d09a,_0x615b('0x13'));logger[_0x615b('0x14')](_0x615b('0x15'),_0x16d09a,'request\x20sent',JSON[_0x615b('0x16')](_0x5f0e6));if(_0x5f0e6['error']){if(_0x5f0e6['error'][_0x615b('0x17')]===0x1f4){logger['error']('MailQueue,\x20%s,\x20%s',_0x16d09a,_0x5f0e6[_0x615b('0x18')][_0x615b('0x19')]);return _0x752f2d(_0x5f0e6[_0x615b('0x18')][_0x615b('0x19')]);}logger['error'](_0x615b('0x12'),_0x16d09a,_0x5f0e6[_0x615b('0x18')]['message']);return _0x44226b(_0x5f0e6[_0x615b('0x18')][_0x615b('0x19')]);}else{logger['info'](_0x615b('0x12'),_0x16d09a,'request\x20sent');_0x44226b(_0x5f0e6[_0x615b('0x1a')]['message']);}})[_0x615b('0x1b')](function(_0x4fccfe){logger['error'](_0x615b('0x12'),_0x16d09a,_0x4fccfe);_0x752f2d(_0x4fccfe);});});}exports[_0x615b('0x1c')]=function(_0x1279fa){var _0x3af30d=this;return new Promise(function(_0xfc3a68,_0x40ef2c){return db[_0x615b('0x1d')]['findAll']({'raw':_0x1279fa['options']?_0x1279fa[_0x615b('0x1e')][_0x615b('0x1f')]===undefined?!![]:![]:!![],'where':_0x1279fa[_0x615b('0x1e')]?_0x1279fa[_0x615b('0x1e')][_0x615b('0x20')]||null:null,'attributes':_0x1279fa['options']?_0x1279fa['options']['attributes']||null:null,'limit':_0x1279fa[_0x615b('0x1e')]?_0x1279fa[_0x615b('0x1e')][_0x615b('0x21')]||null:null,'include':_0x1279fa[_0x615b('0x1e')]?_0x1279fa[_0x615b('0x1e')][_0x615b('0x22')]?_['map'](_0x1279fa['options'][_0x615b('0x22')],function(_0x3be034){return{'model':db[_0x3be034[_0x615b('0x23')]],'as':_0x3be034['as'],'attributes':_0x3be034[_0x615b('0x24')],'include':_0x3be034[_0x615b('0x22')]?_['map'](_0x3be034[_0x615b('0x22')],function(_0x30f008){return{'model':db[_0x30f008['model']],'as':_0x30f008['as'],'attributes':_0x30f008[_0x615b('0x24')],'include':_0x30f008[_0x615b('0x22')]?_['map'](_0x30f008[_0x615b('0x22')],function(_0x3b7df7){return{'model':db[_0x3b7df7['model']],'as':_0x3b7df7['as'],'attributes':_0x3b7df7[_0x615b('0x24')]};}):[]};}):[]};}):[]:[]})[_0x615b('0x10')](function(_0x3f0b76){logger['info'](_0x615b('0x1c'),_0x1279fa);logger[_0x615b('0x14')](_0x615b('0x1c'),_0x1279fa,JSON['stringify'](_0x3f0b76));_0xfc3a68(_0x3f0b76);})[_0x615b('0x1b')](function(_0x3bb276){logger[_0x615b('0x18')]('GetMailQueue',_0x3bb276[_0x615b('0x19')],_0x1279fa);_0x40ef2c(_0x3af30d[_0x615b('0x18')](0x1f4,_0x3bb276[_0x615b('0x19')]));});});};exports['ShowMailQueue']=function(_0x487c38){var _0x2d3d95=this;return new Promise(function(_0x40334e,_0x4e6f14){return db['MailQueue'][_0x615b('0x25')]({'raw':_0x487c38[_0x615b('0x1e')]?_0x487c38[_0x615b('0x1e')][_0x615b('0x1f')]===undefined?!![]:![]:!![],'where':_0x487c38['options']?_0x487c38['options']['where']||null:null,'attributes':_0x487c38[_0x615b('0x1e')]?_0x487c38[_0x615b('0x1e')]['attributes']||null:null,'include':_0x487c38['options']?_0x487c38['options'][_0x615b('0x22')]?_['map'](_0x487c38[_0x615b('0x1e')][_0x615b('0x22')],function(_0xf5a61e){return{'model':db[_0xf5a61e[_0x615b('0x23')]],'as':_0xf5a61e['as'],'attributes':_0xf5a61e[_0x615b('0x24')],'include':_0xf5a61e['include']?_[_0x615b('0x26')](_0xf5a61e[_0x615b('0x22')],function(_0x418ad1){return{'model':db[_0x418ad1[_0x615b('0x23')]],'as':_0x418ad1['as'],'attributes':_0x418ad1[_0x615b('0x24')],'include':_0x418ad1[_0x615b('0x22')]?_[_0x615b('0x26')](_0x418ad1['include'],function(_0x25a34f){return{'model':db[_0x25a34f[_0x615b('0x23')]],'as':_0x25a34f['as'],'attributes':_0x25a34f['attributes']};}):[]};}):[]};}):[]:[]})[_0x615b('0x10')](function(_0x1d534b){logger[_0x615b('0x11')]('ShowMailQueue',_0x487c38);logger[_0x615b('0x14')](_0x615b('0x27'),_0x487c38,JSON[_0x615b('0x16')](_0x1d534b));_0x40334e(_0x1d534b);})['catch'](function(_0x32189f){logger['error'](_0x615b('0x27'),_0x32189f[_0x615b('0x19')],_0x487c38);_0x4e6f14(_0x2d3d95[_0x615b('0x18')](0x1f4,_0x32189f['message']));});});}; \ No newline at end of file +var _0x1789=['../../config/utils','../../config/logger','jayson/promise','client','http','redis','localhost','socket.io-emitter','then','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','MailQueue,\x20%s,\x20%s','message','info','request\x20sent','result','catch','GetMailQueue','MailQueue','findAll','options','raw','limit','include','map','model','attributes','ShowMailQueue','find','where','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x878406,_0x124c5c){var _0x4fd978=function(_0x40d11e){while(--_0x40d11e){_0x878406['push'](_0x878406['shift']());}};_0x4fd978(++_0x124c5c);}(_0x1789,0x92));var _0x9178=function(_0x447f33,_0x489af1){_0x447f33=_0x447f33-0x0;var _0x4e0bc7=_0x1789[_0x447f33];return _0x4e0bc7;};'use strict';var _=require(_0x9178('0x0'));var util=require(_0x9178('0x1'));var moment=require(_0x9178('0x2'));var BPromise=require('bluebird');var rs=require(_0x9178('0x3'));var fs=require('fs');var Redis=require(_0x9178('0x4'));var db=require(_0x9178('0x5'))['db'];var utils=require(_0x9178('0x6'));var logger=require(_0x9178('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9178('0x8'));var client=jayson[_0x9178('0x9')][_0x9178('0xa')]({'port':0x232a});config[_0x9178('0xb')]=_['defaults'](config[_0x9178('0xb')],{'host':_0x9178('0xc'),'port':0x18eb});var socket=require(_0x9178('0xd'))(new Redis(config[_0x9178('0xb')]));require('./mailQueue.socket')['register'](socket);function respondWithRpcPromise(_0x537261,_0xdd2085,_0x320615){return new BPromise(function(_0x49efc8,_0x27f968){return client['request'](_0x537261,_0x320615)[_0x9178('0xe')](function(_0x80d440){logger['info']('MailQueue,\x20%s,\x20%s',_0xdd2085,'request\x20sent');logger[_0x9178('0xf')](_0x9178('0x10'),_0xdd2085,'request\x20sent',JSON[_0x9178('0x11')](_0x80d440));if(_0x80d440[_0x9178('0x12')]){if(_0x80d440[_0x9178('0x12')]['code']===0x1f4){logger[_0x9178('0x12')](_0x9178('0x13'),_0xdd2085,_0x80d440['error'][_0x9178('0x14')]);return _0x27f968(_0x80d440['error'][_0x9178('0x14')]);}logger[_0x9178('0x12')](_0x9178('0x13'),_0xdd2085,_0x80d440[_0x9178('0x12')][_0x9178('0x14')]);return _0x49efc8(_0x80d440[_0x9178('0x12')][_0x9178('0x14')]);}else{logger[_0x9178('0x15')](_0x9178('0x13'),_0xdd2085,_0x9178('0x16'));_0x49efc8(_0x80d440[_0x9178('0x17')][_0x9178('0x14')]);}})[_0x9178('0x18')](function(_0x30c430){logger['error'](_0x9178('0x13'),_0xdd2085,_0x30c430);_0x27f968(_0x30c430);});});}exports[_0x9178('0x19')]=function(_0x567e52){var _0x384b48=this;return new Promise(function(_0x59b1d2,_0x94c136){return db[_0x9178('0x1a')][_0x9178('0x1b')]({'raw':_0x567e52[_0x9178('0x1c')]?_0x567e52[_0x9178('0x1c')][_0x9178('0x1d')]===undefined?!![]:![]:!![],'where':_0x567e52[_0x9178('0x1c')]?_0x567e52[_0x9178('0x1c')]['where']||null:null,'attributes':_0x567e52[_0x9178('0x1c')]?_0x567e52['options']['attributes']||null:null,'limit':_0x567e52[_0x9178('0x1c')]?_0x567e52[_0x9178('0x1c')][_0x9178('0x1e')]||null:null,'include':_0x567e52[_0x9178('0x1c')]?_0x567e52[_0x9178('0x1c')][_0x9178('0x1f')]?_[_0x9178('0x20')](_0x567e52[_0x9178('0x1c')][_0x9178('0x1f')],function(_0x2114ec){return{'model':db[_0x2114ec[_0x9178('0x21')]],'as':_0x2114ec['as'],'attributes':_0x2114ec[_0x9178('0x22')],'include':_0x2114ec[_0x9178('0x1f')]?_[_0x9178('0x20')](_0x2114ec['include'],function(_0x1af84b){return{'model':db[_0x1af84b[_0x9178('0x21')]],'as':_0x1af84b['as'],'attributes':_0x1af84b['attributes'],'include':_0x1af84b[_0x9178('0x1f')]?_[_0x9178('0x20')](_0x1af84b[_0x9178('0x1f')],function(_0x2b977b){return{'model':db[_0x2b977b[_0x9178('0x21')]],'as':_0x2b977b['as'],'attributes':_0x2b977b[_0x9178('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x267f42){logger[_0x9178('0x15')]('GetMailQueue',_0x567e52);logger[_0x9178('0xf')](_0x9178('0x19'),_0x567e52,JSON[_0x9178('0x11')](_0x267f42));_0x59b1d2(_0x267f42);})[_0x9178('0x18')](function(_0x403f4d){logger[_0x9178('0x12')](_0x9178('0x19'),_0x403f4d['message'],_0x567e52);_0x94c136(_0x384b48[_0x9178('0x12')](0x1f4,_0x403f4d['message']));});});};exports[_0x9178('0x23')]=function(_0x4615f1){var _0x499156=this;return new Promise(function(_0xb8681,_0x31e3ba){return db[_0x9178('0x1a')][_0x9178('0x24')]({'raw':_0x4615f1['options']?_0x4615f1[_0x9178('0x1c')][_0x9178('0x1d')]===undefined?!![]:![]:!![],'where':_0x4615f1[_0x9178('0x1c')]?_0x4615f1[_0x9178('0x1c')][_0x9178('0x25')]||null:null,'attributes':_0x4615f1[_0x9178('0x1c')]?_0x4615f1[_0x9178('0x1c')][_0x9178('0x22')]||null:null,'include':_0x4615f1['options']?_0x4615f1[_0x9178('0x1c')][_0x9178('0x1f')]?_['map'](_0x4615f1[_0x9178('0x1c')]['include'],function(_0x16a71d){return{'model':db[_0x16a71d['model']],'as':_0x16a71d['as'],'attributes':_0x16a71d['attributes'],'include':_0x16a71d[_0x9178('0x1f')]?_[_0x9178('0x20')](_0x16a71d['include'],function(_0x1d7c24){return{'model':db[_0x1d7c24[_0x9178('0x21')]],'as':_0x1d7c24['as'],'attributes':_0x1d7c24['attributes'],'include':_0x1d7c24['include']?_[_0x9178('0x20')](_0x1d7c24[_0x9178('0x1f')],function(_0x348762){return{'model':db[_0x348762[_0x9178('0x21')]],'as':_0x348762['as'],'attributes':_0x348762['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xd5a485){logger['info']('ShowMailQueue',_0x4615f1);logger[_0x9178('0xf')](_0x9178('0x23'),_0x4615f1,JSON[_0x9178('0x11')](_0xd5a485));_0xb8681(_0xd5a485);})['catch'](function(_0x1aaab3){logger[_0x9178('0x12')](_0x9178('0x23'),_0x1aaab3['message'],_0x4615f1);_0x31e3ba(_0x499156[_0x9178('0x12')](0x1f4,_0x1aaab3[_0x9178('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index adb711b..6cd9335 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 _0xbfe3=['emit','removeListener','./mailQueue.events','save','remove','update'];(function(_0x2cbfc5,_0x533fbc){var _0x14cbcc=function(_0x6216aa){while(--_0x6216aa){_0x2cbfc5['push'](_0x2cbfc5['shift']());}};_0x14cbcc(++_0x533fbc);}(_0xbfe3,0x92));var _0x3bfe=function(_0x42b786,_0x52a8a5){_0x42b786=_0x42b786-0x0;var _0x54cbeb=_0xbfe3[_0x42b786];return _0x54cbeb;};'use strict';var MailQueueEvents=require(_0x3bfe('0x0'));var events=[_0x3bfe('0x1'),_0x3bfe('0x2'),_0x3bfe('0x3')];function createListener(_0x4b1f08,_0x4d8bec){return function(_0x4ed6d7){_0x4d8bec[_0x3bfe('0x4')](_0x4b1f08,_0x4ed6d7);};}function removeListener(_0x214f8f,_0x150ebc){return function(){MailQueueEvents[_0x3bfe('0x5')](_0x214f8f,_0x150ebc);};}exports['register']=function(_0x5a7db7){for(var _0x54b24c=0x0,_0x442290=events['length'];_0x54b24c<_0x442290;_0x54b24c++){var _0x5d78f3=events[_0x54b24c];var _0x31bf1f=createListener('mailQueue:'+_0x5d78f3,_0x5a7db7);MailQueueEvents['on'](_0x5d78f3,_0x31bf1f);}}; \ No newline at end of file +var _0x2bff=['removeListener','register','length','mailQueue:','./mailQueue.events','save','update','emit'];(function(_0x261522,_0x1adc1f){var _0x98a25a=function(_0x1b0f9c){while(--_0x1b0f9c){_0x261522['push'](_0x261522['shift']());}};_0x98a25a(++_0x1adc1f);}(_0x2bff,0x1cc));var _0xf2bf=function(_0x29161d,_0x14116f){_0x29161d=_0x29161d-0x0;var _0x1ebd7d=_0x2bff[_0x29161d];return _0x1ebd7d;};'use strict';var MailQueueEvents=require(_0xf2bf('0x0'));var events=[_0xf2bf('0x1'),'remove',_0xf2bf('0x2')];function createListener(_0x16a499,_0x5984fe){return function(_0x14c2a0){_0x5984fe[_0xf2bf('0x3')](_0x16a499,_0x14c2a0);};}function removeListener(_0x3448aa,_0x4bf347){return function(){MailQueueEvents[_0xf2bf('0x4')](_0x3448aa,_0x4bf347);};}exports[_0xf2bf('0x5')]=function(_0xdd6937){for(var _0xee5731=0x0,_0x26f8ba=events[_0xf2bf('0x6')];_0xee5731<_0x26f8ba;_0xee5731++){var _0x39af48=events[_0xee5731];var _0x4168be=createListener(_0xf2bf('0x7')+_0x39af48,_0xdd6937);MailQueueEvents['on'](_0x39af48,_0x4168be);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index e4094dc..79c8708 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 _0xf9d8=['./mailQueueReport.controller','get','index','/describe','isAuthenticated','/:id','show','post','create','put','delete','destroy','multer','path','express','Router','../../components/auth/service','../../config/environment'];(function(_0x33e090,_0x34968b){var _0x1b41c2=function(_0x432eb3){while(--_0x432eb3){_0x33e090['push'](_0x33e090['shift']());}};_0x1b41c2(++_0x34968b);}(_0xf9d8,0x162));var _0x8f9d=function(_0x4592ca,_0x329325){_0x4592ca=_0x4592ca-0x0;var _0x56c64b=_0xf9d8[_0x4592ca];return _0x56c64b;};'use strict';var multer=require(_0x8f9d('0x0'));var util=require('util');var path=require(_0x8f9d('0x1'));var timeout=require('connect-timeout');var express=require(_0x8f9d('0x2'));var router=express[_0x8f9d('0x3')]();var auth=require(_0x8f9d('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x8f9d('0x5'));var controller=require(_0x8f9d('0x6'));router[_0x8f9d('0x7')]('/',auth['isAuthenticated'](),controller[_0x8f9d('0x8')]);router[_0x8f9d('0x7')](_0x8f9d('0x9'),auth[_0x8f9d('0xa')](),controller['describe']);router[_0x8f9d('0x7')](_0x8f9d('0xb'),auth['isAuthenticated'](),controller[_0x8f9d('0xc')]);router[_0x8f9d('0xd')]('/',auth[_0x8f9d('0xa')](),controller[_0x8f9d('0xe')]);router[_0x8f9d('0xf')](_0x8f9d('0xb'),auth[_0x8f9d('0xa')](),controller['update']);router[_0x8f9d('0x10')](_0x8f9d('0xb'),auth['isAuthenticated'](),controller[_0x8f9d('0x11')]);module['exports']=router; \ No newline at end of file +var _0x63c7=['/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./mailQueueReport.controller','isAuthenticated','index','get'];(function(_0x438487,_0x41f017){var _0x4900ce=function(_0x255bd3){while(--_0x255bd3){_0x438487['push'](_0x438487['shift']());}};_0x4900ce(++_0x41f017);}(_0x63c7,0x15b));var _0x763c=function(_0x5476f6,_0x5ea695){_0x5476f6=_0x5476f6-0x0;var _0x216cc0=_0x63c7[_0x5476f6];return _0x216cc0;};'use strict';var multer=require(_0x763c('0x0'));var util=require(_0x763c('0x1'));var path=require(_0x763c('0x2'));var timeout=require(_0x763c('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x763c('0x4'));var interaction=require(_0x763c('0x5'));var config=require('../../config/environment');var controller=require(_0x763c('0x6'));router['get']('/',auth[_0x763c('0x7')](),controller[_0x763c('0x8')]);router[_0x763c('0x9')](_0x763c('0xa'),auth[_0x763c('0x7')](),controller[_0x763c('0xb')]);router['get'](_0x763c('0xc'),auth[_0x763c('0x7')](),controller[_0x763c('0xd')]);router[_0x763c('0xe')]('/',auth[_0x763c('0x7')](),controller[_0x763c('0xf')]);router[_0x763c('0x10')](_0x763c('0xc'),auth[_0x763c('0x7')](),controller[_0x763c('0x11')]);router[_0x763c('0x12')]('/:id',auth[_0x763c('0x7')](),controller[_0x763c('0x13')]);module[_0x763c('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index b6c06b5..d4305a2 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 _0xb724=['moment','exports','STRING','DATE'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0xb724,0x7c));var _0x4b72=function(_0x84f44d,_0x17a8c2){_0x84f44d=_0x84f44d-0x0;var _0x1f7e31=_0xb724[_0x84f44d];return _0x1f7e31;};'use strict';var moment=require(_0x4b72('0x0'));var Sequelize=require('sequelize');module[_0x4b72('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x4b72('0x2')]},'joinAt':{'type':Sequelize[_0x4b72('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x4b72('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xecf9=['exports','STRING','DATE','moment'];(function(_0x1ccb95,_0x1b3be8){var _0x1a9725=function(_0x1a6bf7){while(--_0x1a6bf7){_0x1ccb95['push'](_0x1ccb95['shift']());}};_0x1a9725(++_0x1b3be8);}(_0xecf9,0x97));var _0x9ecf=function(_0x77d2e2,_0x2c420f){_0x77d2e2=_0x77d2e2-0x0;var _0x3dff2b=_0xecf9[_0x77d2e2];return _0x3dff2b;};'use strict';var moment=require(_0x9ecf('0x0'));var Sequelize=require('sequelize');module[_0x9ecf('0x1')]={'uniqueid':{'type':Sequelize[_0x9ecf('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x9ecf('0x2')]},'joinAt':{'type':Sequelize[_0x9ecf('0x3')]},'leaveAt':{'type':Sequelize[_0x9ecf('0x3')]},'acceptAt':{'type':Sequelize[_0x9ecf('0x3')]},'exitAt':{'type':Sequelize[_0x9ecf('0x3')]},'reason':{'type':Sequelize[_0x9ecf('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 6d4f529..2b73e27 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 _0x7a54=['Content-Range','apply','reject','save','then','destroy','sendStatus','error','name','send','map','MailQueueReport','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','field','options','count','include','findAll','rows','catch','show','includeAll','find','create','body','update','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','set'];(function(_0x52d0bb,_0x1f318b){var _0x3321c6=function(_0x495732){while(--_0x495732){_0x52d0bb['push'](_0x52d0bb['shift']());}};_0x3321c6(++_0x1f318b);}(_0x7a54,0x106));var _0x47a5=function(_0x5b79e3,_0x1c2d1d){_0x5b79e3=_0x5b79e3-0x0;var _0x2d3a1c=_0x7a54[_0x5b79e3];return _0x2d3a1c;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var db=require(_0x47a5('0x14'))['db'];function respondWithStatusCode(_0xd612dd,_0xd308b8){_0xd308b8=_0xd308b8||0xcc;return function(_0x1eae59){if(_0x1eae59){return _0xd612dd['sendStatus'](_0xd308b8);}return _0xd612dd[_0x47a5('0x15')](_0xd308b8)[_0x47a5('0x16')]();};}function respondWithResult(_0x1cf309,_0x711793){_0x711793=_0x711793||0xc8;return function(_0x139f25){if(_0x139f25){return _0x1cf309[_0x47a5('0x15')](_0x711793)[_0x47a5('0x17')](_0x139f25);}};}function respondWithFilteredResult(_0x190faa,_0x4e99a8){return function(_0x362359){if(_0x362359){var _0x11faf5=_0x362359['count'],_0x3b001e=_0x4e99a8['offset'],_0x2a2cbb=_0x4e99a8[_0x47a5('0x18')]+_0x4e99a8['limit'],_0x1ef44c;if(_0x2a2cbb>=_0x11faf5){_0x2a2cbb=_0x11faf5;_0x1ef44c=0xc8;}else{_0x1ef44c=0xce;}_0x190faa['status'](_0x1ef44c);return _0x190faa[_0x47a5('0x19')](_0x47a5('0x1a'),_0x3b001e+'-'+_0x2a2cbb+'/'+_0x11faf5)[_0x47a5('0x17')](_0x362359);}return null;};}function patchUpdates(_0x1ef371){return function(_0x477b1d){try{jsonpatch[_0x47a5('0x1b')](_0x477b1d,_0x1ef371,!![]);}catch(_0x2763d6){return BPromise[_0x47a5('0x1c')](_0x2763d6);}return _0x477b1d[_0x47a5('0x1d')]();};}function saveUpdates(_0x4a9fcb,_0x1570bc){return function(_0xf160ba){if(_0xf160ba){return _0xf160ba['update'](_0x4a9fcb)[_0x47a5('0x1e')](function(_0x1f03f7){return _0x1f03f7;});}return null;};}function removeEntity(_0x36874d,_0x4c5910){return function(_0xb8ae6c){if(_0xb8ae6c){return _0xb8ae6c[_0x47a5('0x1f')]()[_0x47a5('0x1e')](function(){_0x36874d[_0x47a5('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe2dea9,_0x385687){return function(_0x513981){if(!_0x513981){_0xe2dea9[_0x47a5('0x20')](0x194);}return _0x513981;};}function handleError(_0xc4cd63,_0x4437f1){_0x4437f1=_0x4437f1||0x1f4;return function(_0x129ce5){logger[_0x47a5('0x21')](_0x129ce5['stack']);if(_0x129ce5['name']){delete _0x129ce5[_0x47a5('0x22')];}_0xc4cd63['status'](_0x4437f1)[_0x47a5('0x23')](_0x129ce5);};}exports['index']=function(_0x23cb77,_0x378208){var _0x36ad34={},_0x1dac65={},_0x21f296={'count':0x0,'rows':[]};var _0x3ba0b7=_[_0x47a5('0x24')](db[_0x47a5('0x25')][_0x47a5('0x26')],function(_0x361bfa){return{'name':_0x361bfa[_0x47a5('0x27')],'type':_0x361bfa[_0x47a5('0x28')][_0x47a5('0x29')]};});_0x1dac65['model']=_[_0x47a5('0x24')](_0x3ba0b7,'name');_0x1dac65[_0x47a5('0x2a')]=_[_0x47a5('0x2b')](_0x23cb77[_0x47a5('0x2a')]);_0x1dac65['filters']=_[_0x47a5('0x2c')](_0x1dac65[_0x47a5('0x2d')],_0x1dac65[_0x47a5('0x2a')]);_0x36ad34[_0x47a5('0x2e')]=_['intersection'](_0x1dac65['model'],qs[_0x47a5('0x2f')](_0x23cb77[_0x47a5('0x2a')]['fields']));_0x36ad34['attributes']=_0x36ad34[_0x47a5('0x2e')][_0x47a5('0x30')]?_0x36ad34['attributes']:_0x1dac65[_0x47a5('0x2d')];if(!_0x23cb77['query'][_0x47a5('0x31')](_0x47a5('0x32'))){_0x36ad34['limit']=qs['limit'](_0x23cb77[_0x47a5('0x2a')]['limit']);_0x36ad34[_0x47a5('0x18')]=qs[_0x47a5('0x18')](_0x23cb77[_0x47a5('0x2a')]['offset']);}_0x36ad34[_0x47a5('0x33')]=qs['sort'](_0x23cb77['query'][_0x47a5('0x34')]);_0x36ad34['where']=qs[_0x47a5('0x35')](_['pick'](_0x23cb77[_0x47a5('0x2a')],_0x1dac65[_0x47a5('0x35')]));if(_0x23cb77[_0x47a5('0x2a')][_0x47a5('0x36')]){_0x36ad34[_0x47a5('0x37')]=_[_0x47a5('0x38')](_0x36ad34[_0x47a5('0x37')],{'$or':_[_0x47a5('0x24')](_0x3ba0b7,function(_0x1a0d23){if(_0x1a0d23['type'][_0x47a5('0x29')]!==_0x47a5('0x39')){var _0x511c06={};_0x511c06[_0x1a0d23[_0x47a5('0x3a')]]={'$like':'%'+_0x23cb77[_0x47a5('0x2a')][_0x47a5('0x36')]+'%'};return _0x511c06;}})});}_0x36ad34=_['merge']({},_0x36ad34,_0x23cb77[_0x47a5('0x3b')]);var _0x10f660={'where':_0x36ad34['where']};return db[_0x47a5('0x25')][_0x47a5('0x3c')](_0x10f660)['then'](function(_0x55c5eb){_0x21f296['count']=_0x55c5eb;if(_0x23cb77[_0x47a5('0x2a')]['includeAll']){_0x36ad34[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x25')][_0x47a5('0x3e')](_0x36ad34);})[_0x47a5('0x1e')](function(_0x1b2c80){_0x21f296[_0x47a5('0x3f')]=_0x1b2c80;return _0x21f296;})[_0x47a5('0x1e')](respondWithFilteredResult(_0x378208,_0x36ad34))[_0x47a5('0x40')](handleError(_0x378208,null));};exports[_0x47a5('0x41')]=function(_0x36a24e,_0x280500){var _0x1658e8={'raw':!![],'where':{'id':_0x36a24e['params']['id']}},_0x23d6d8={};_0x23d6d8[_0x47a5('0x2d')]=_[_0x47a5('0x2b')](db[_0x47a5('0x25')][_0x47a5('0x26')]);_0x23d6d8['query']=_[_0x47a5('0x2b')](_0x36a24e['query']);_0x23d6d8['filters']=_['intersection'](_0x23d6d8['model'],_0x23d6d8[_0x47a5('0x2a')]);_0x1658e8['attributes']=_[_0x47a5('0x2c')](_0x23d6d8[_0x47a5('0x2d')],qs[_0x47a5('0x2f')](_0x36a24e['query'][_0x47a5('0x2f')]));_0x1658e8[_0x47a5('0x2e')]=_0x1658e8['attributes']['length']?_0x1658e8[_0x47a5('0x2e')]:_0x23d6d8['model'];if(_0x36a24e[_0x47a5('0x2a')][_0x47a5('0x42')]){_0x1658e8[_0x47a5('0x3d')]=[{'all':!![]}];}_0x1658e8=_[_0x47a5('0x38')]({},_0x1658e8,_0x36a24e[_0x47a5('0x3b')]);return db[_0x47a5('0x25')][_0x47a5('0x43')](_0x1658e8)[_0x47a5('0x1e')](handleEntityNotFound(_0x280500,null))[_0x47a5('0x1e')](respondWithResult(_0x280500,null))[_0x47a5('0x40')](handleError(_0x280500,null));};exports[_0x47a5('0x44')]=function(_0x3c3ebf,_0xe28d76){return db[_0x47a5('0x25')][_0x47a5('0x44')](_0x3c3ebf[_0x47a5('0x45')],{})['then'](respondWithResult(_0xe28d76,0xc9))[_0x47a5('0x40')](handleError(_0xe28d76,null));};exports[_0x47a5('0x46')]=function(_0x49eab1,_0x52b3a8){if(_0x49eab1[_0x47a5('0x45')]['id']){delete _0x49eab1['body']['id'];}return db[_0x47a5('0x25')][_0x47a5('0x43')]({'where':{'id':_0x49eab1['params']['id']}})['then'](handleEntityNotFound(_0x52b3a8,null))[_0x47a5('0x1e')](saveUpdates(_0x49eab1['body'],null))[_0x47a5('0x1e')](respondWithResult(_0x52b3a8,null))[_0x47a5('0x40')](handleError(_0x52b3a8,null));};exports[_0x47a5('0x1f')]=function(_0x3e12a7,_0x44fe8a){return db[_0x47a5('0x25')][_0x47a5('0x43')]({'where':{'id':_0x3e12a7['params']['id']}})['then'](handleEntityNotFound(_0x44fe8a,null))[_0x47a5('0x1e')](removeEntity(_0x44fe8a,null))[_0x47a5('0x40')](handleError(_0x44fe8a,null));};exports[_0x47a5('0x47')]=function(_0x9ea93e,_0x2c7020){return db[_0x47a5('0x25')][_0x47a5('0x47')]()['then'](respondWithResult(_0x2c7020,null))[_0x47a5('0x40')](handleError(_0x2c7020,null));}; \ No newline at end of file +var _0x7a54=['Content-Range','apply','reject','save','then','destroy','sendStatus','error','name','send','map','MailQueueReport','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','field','options','count','include','findAll','rows','catch','show','includeAll','find','create','body','update','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','set'];(function(_0x1f72a6,_0x54dfb8){var _0x365faa=function(_0x10df38){while(--_0x10df38){_0x1f72a6['push'](_0x1f72a6['shift']());}};_0x365faa(++_0x54dfb8);}(_0x7a54,0x106));var _0x47a5=function(_0x6c7bb3,_0x438741){_0x6c7bb3=_0x6c7bb3-0x0;var _0x4f19ee=_0x7a54[_0x6c7bb3];return _0x4f19ee;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var db=require(_0x47a5('0x14'))['db'];function respondWithStatusCode(_0xd612dd,_0xd308b8){_0xd308b8=_0xd308b8||0xcc;return function(_0x1eae59){if(_0x1eae59){return _0xd612dd['sendStatus'](_0xd308b8);}return _0xd612dd[_0x47a5('0x15')](_0xd308b8)[_0x47a5('0x16')]();};}function respondWithResult(_0x1cf309,_0x711793){_0x711793=_0x711793||0xc8;return function(_0x139f25){if(_0x139f25){return _0x1cf309[_0x47a5('0x15')](_0x711793)[_0x47a5('0x17')](_0x139f25);}};}function respondWithFilteredResult(_0x190faa,_0x4e99a8){return function(_0x362359){if(_0x362359){var _0x11faf5=_0x362359['count'],_0x3b001e=_0x4e99a8['offset'],_0x2a2cbb=_0x4e99a8[_0x47a5('0x18')]+_0x4e99a8['limit'],_0x1ef44c;if(_0x2a2cbb>=_0x11faf5){_0x2a2cbb=_0x11faf5;_0x1ef44c=0xc8;}else{_0x1ef44c=0xce;}_0x190faa['status'](_0x1ef44c);return _0x190faa[_0x47a5('0x19')](_0x47a5('0x1a'),_0x3b001e+'-'+_0x2a2cbb+'/'+_0x11faf5)[_0x47a5('0x17')](_0x362359);}return null;};}function patchUpdates(_0x1ef371){return function(_0x477b1d){try{jsonpatch[_0x47a5('0x1b')](_0x477b1d,_0x1ef371,!![]);}catch(_0x2763d6){return BPromise[_0x47a5('0x1c')](_0x2763d6);}return _0x477b1d[_0x47a5('0x1d')]();};}function saveUpdates(_0x4a9fcb,_0x1570bc){return function(_0xf160ba){if(_0xf160ba){return _0xf160ba['update'](_0x4a9fcb)[_0x47a5('0x1e')](function(_0x1f03f7){return _0x1f03f7;});}return null;};}function removeEntity(_0x36874d,_0x4c5910){return function(_0xb8ae6c){if(_0xb8ae6c){return _0xb8ae6c[_0x47a5('0x1f')]()[_0x47a5('0x1e')](function(){_0x36874d[_0x47a5('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe2dea9,_0x385687){return function(_0x513981){if(!_0x513981){_0xe2dea9[_0x47a5('0x20')](0x194);}return _0x513981;};}function handleError(_0xc4cd63,_0x4437f1){_0x4437f1=_0x4437f1||0x1f4;return function(_0x129ce5){logger[_0x47a5('0x21')](_0x129ce5['stack']);if(_0x129ce5['name']){delete _0x129ce5[_0x47a5('0x22')];}_0xc4cd63['status'](_0x4437f1)[_0x47a5('0x23')](_0x129ce5);};}exports['index']=function(_0x23cb77,_0x378208){var _0x36ad34={},_0x1dac65={},_0x21f296={'count':0x0,'rows':[]};var _0x3ba0b7=_[_0x47a5('0x24')](db[_0x47a5('0x25')][_0x47a5('0x26')],function(_0x361bfa){return{'name':_0x361bfa[_0x47a5('0x27')],'type':_0x361bfa[_0x47a5('0x28')][_0x47a5('0x29')]};});_0x1dac65['model']=_[_0x47a5('0x24')](_0x3ba0b7,'name');_0x1dac65[_0x47a5('0x2a')]=_[_0x47a5('0x2b')](_0x23cb77[_0x47a5('0x2a')]);_0x1dac65['filters']=_[_0x47a5('0x2c')](_0x1dac65[_0x47a5('0x2d')],_0x1dac65[_0x47a5('0x2a')]);_0x36ad34[_0x47a5('0x2e')]=_['intersection'](_0x1dac65['model'],qs[_0x47a5('0x2f')](_0x23cb77[_0x47a5('0x2a')]['fields']));_0x36ad34['attributes']=_0x36ad34[_0x47a5('0x2e')][_0x47a5('0x30')]?_0x36ad34['attributes']:_0x1dac65[_0x47a5('0x2d')];if(!_0x23cb77['query'][_0x47a5('0x31')](_0x47a5('0x32'))){_0x36ad34['limit']=qs['limit'](_0x23cb77[_0x47a5('0x2a')]['limit']);_0x36ad34[_0x47a5('0x18')]=qs[_0x47a5('0x18')](_0x23cb77[_0x47a5('0x2a')]['offset']);}_0x36ad34[_0x47a5('0x33')]=qs['sort'](_0x23cb77['query'][_0x47a5('0x34')]);_0x36ad34['where']=qs[_0x47a5('0x35')](_['pick'](_0x23cb77[_0x47a5('0x2a')],_0x1dac65[_0x47a5('0x35')]));if(_0x23cb77[_0x47a5('0x2a')][_0x47a5('0x36')]){_0x36ad34[_0x47a5('0x37')]=_[_0x47a5('0x38')](_0x36ad34[_0x47a5('0x37')],{'$or':_[_0x47a5('0x24')](_0x3ba0b7,function(_0x1a0d23){if(_0x1a0d23['type'][_0x47a5('0x29')]!==_0x47a5('0x39')){var _0x511c06={};_0x511c06[_0x1a0d23[_0x47a5('0x3a')]]={'$like':'%'+_0x23cb77[_0x47a5('0x2a')][_0x47a5('0x36')]+'%'};return _0x511c06;}})});}_0x36ad34=_['merge']({},_0x36ad34,_0x23cb77[_0x47a5('0x3b')]);var _0x10f660={'where':_0x36ad34['where']};return db[_0x47a5('0x25')][_0x47a5('0x3c')](_0x10f660)['then'](function(_0x55c5eb){_0x21f296['count']=_0x55c5eb;if(_0x23cb77[_0x47a5('0x2a')]['includeAll']){_0x36ad34[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x25')][_0x47a5('0x3e')](_0x36ad34);})[_0x47a5('0x1e')](function(_0x1b2c80){_0x21f296[_0x47a5('0x3f')]=_0x1b2c80;return _0x21f296;})[_0x47a5('0x1e')](respondWithFilteredResult(_0x378208,_0x36ad34))[_0x47a5('0x40')](handleError(_0x378208,null));};exports[_0x47a5('0x41')]=function(_0x36a24e,_0x280500){var _0x1658e8={'raw':!![],'where':{'id':_0x36a24e['params']['id']}},_0x23d6d8={};_0x23d6d8[_0x47a5('0x2d')]=_[_0x47a5('0x2b')](db[_0x47a5('0x25')][_0x47a5('0x26')]);_0x23d6d8['query']=_[_0x47a5('0x2b')](_0x36a24e['query']);_0x23d6d8['filters']=_['intersection'](_0x23d6d8['model'],_0x23d6d8[_0x47a5('0x2a')]);_0x1658e8['attributes']=_[_0x47a5('0x2c')](_0x23d6d8[_0x47a5('0x2d')],qs[_0x47a5('0x2f')](_0x36a24e['query'][_0x47a5('0x2f')]));_0x1658e8[_0x47a5('0x2e')]=_0x1658e8['attributes']['length']?_0x1658e8[_0x47a5('0x2e')]:_0x23d6d8['model'];if(_0x36a24e[_0x47a5('0x2a')][_0x47a5('0x42')]){_0x1658e8[_0x47a5('0x3d')]=[{'all':!![]}];}_0x1658e8=_[_0x47a5('0x38')]({},_0x1658e8,_0x36a24e[_0x47a5('0x3b')]);return db[_0x47a5('0x25')][_0x47a5('0x43')](_0x1658e8)[_0x47a5('0x1e')](handleEntityNotFound(_0x280500,null))[_0x47a5('0x1e')](respondWithResult(_0x280500,null))[_0x47a5('0x40')](handleError(_0x280500,null));};exports[_0x47a5('0x44')]=function(_0x3c3ebf,_0xe28d76){return db[_0x47a5('0x25')][_0x47a5('0x44')](_0x3c3ebf[_0x47a5('0x45')],{})['then'](respondWithResult(_0xe28d76,0xc9))[_0x47a5('0x40')](handleError(_0xe28d76,null));};exports[_0x47a5('0x46')]=function(_0x49eab1,_0x52b3a8){if(_0x49eab1[_0x47a5('0x45')]['id']){delete _0x49eab1['body']['id'];}return db[_0x47a5('0x25')][_0x47a5('0x43')]({'where':{'id':_0x49eab1['params']['id']}})['then'](handleEntityNotFound(_0x52b3a8,null))[_0x47a5('0x1e')](saveUpdates(_0x49eab1['body'],null))[_0x47a5('0x1e')](respondWithResult(_0x52b3a8,null))[_0x47a5('0x40')](handleError(_0x52b3a8,null));};exports[_0x47a5('0x1f')]=function(_0x3e12a7,_0x44fe8a){return db[_0x47a5('0x25')][_0x47a5('0x43')]({'where':{'id':_0x3e12a7['params']['id']}})['then'](handleEntityNotFound(_0x44fe8a,null))[_0x47a5('0x1e')](removeEntity(_0x44fe8a,null))[_0x47a5('0x40')](handleError(_0x44fe8a,null));};exports[_0x47a5('0x47')]=function(_0x9ea93e,_0x2c7020){return db[_0x47a5('0x25')][_0x47a5('0x47')]()['then'](respondWithResult(_0x2c7020,null))[_0x47a5('0x40')](handleError(_0x2c7020,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 8efb4cc..4d9b722 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 _0x9933=['util','api','bluebird','request-promise','path','exports','define','MailQueueReport','uniqueid','lodash'];(function(_0x1ee62e,_0x159bb2){var _0x27c6c8=function(_0x31a5d4){while(--_0x31a5d4){_0x1ee62e['push'](_0x1ee62e['shift']());}};_0x27c6c8(++_0x159bb2);}(_0x9933,0xe5));var _0x3993=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x9933[_0x1035c1];return _0x308d67;};'use strict';var _=require(_0x3993('0x0'));var util=require(_0x3993('0x1'));var logger=require('../../config/logger')(_0x3993('0x2'));var moment=require('moment');var BPromise=require(_0x3993('0x3'));var rp=require(_0x3993('0x4'));var fs=require('fs');var path=require(_0x3993('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./mailQueueReport.attributes');module[_0x3993('0x6')]=function(_0x537de0,_0x43d802){return _0x537de0[_0x3993('0x7')](_0x3993('0x8'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x3993('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4917=['../../config/logger','bluebird','request-promise','path','rimraf','./mailQueueReport.attributes','exports','report_mail_queue','lodash','util'];(function(_0x4962fa,_0x6f34da){var _0x19a2f0=function(_0x37f2ba){while(--_0x37f2ba){_0x4962fa['push'](_0x4962fa['shift']());}};_0x19a2f0(++_0x6f34da);}(_0x4917,0x116));var _0x7491=function(_0x1bede7,_0x518f32){_0x1bede7=_0x1bede7-0x0;var _0x914a90=_0x4917[_0x1bede7];return _0x914a90;};'use strict';var _=require(_0x7491('0x0'));var util=require(_0x7491('0x1'));var logger=require(_0x7491('0x2'))('api');var moment=require('moment');var BPromise=require(_0x7491('0x3'));var rp=require(_0x7491('0x4'));var fs=require('fs');var path=require(_0x7491('0x5'));var rimraf=require(_0x7491('0x6'));var config=require('../../config/environment');var attributes=require(_0x7491('0x7'));module[_0x7491('0x8')]=function(_0x180b02,_0x257dad){return _0x180b02['define']('MailQueueReport',attributes,{'tableName':_0x7491('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index f44a553..e0bf1c6 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 _0xeda8=['body','options','raw','then','UpdateMailQueueReport','update','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','MailQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','MailQueueReport,\x20%s,\x20%s','message','info','result','catch','CreateMailQueueReport','MailQueueReport','create'];(function(_0x449d8d,_0x2943ea){var _0x38c960=function(_0x3a1dd8){while(--_0x3a1dd8){_0x449d8d['push'](_0x449d8d['shift']());}};_0x38c960(++_0x2943ea);}(_0xeda8,0x104));var _0x8eda=function(_0x4637d7,_0x562d97){_0x4637d7=_0x4637d7-0x0;var _0x46de30=_0xeda8[_0x4637d7];return _0x46de30;};'use strict';var _=require(_0x8eda('0x0'));var util=require(_0x8eda('0x1'));var moment=require('moment');var BPromise=require(_0x8eda('0x2'));var rs=require(_0x8eda('0x3'));var fs=require('fs');var Redis=require(_0x8eda('0x4'));var db=require(_0x8eda('0x5'))['db'];var utils=require(_0x8eda('0x6'));var logger=require(_0x8eda('0x7'))(_0x8eda('0x8'));var config=require(_0x8eda('0x9'));var jayson=require(_0x8eda('0xa'));var client=jayson[_0x8eda('0xb')][_0x8eda('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x32abe8,_0x4e2ebb,_0x28b721){return new BPromise(function(_0x1b6a1d,_0x5aa93d){return client[_0x8eda('0xd')](_0x32abe8,_0x28b721)['then'](function(_0x4f7893){logger['info']('MailQueueReport,\x20%s,\x20%s',_0x4e2ebb,_0x8eda('0xe'));logger[_0x8eda('0xf')](_0x8eda('0x10'),_0x4e2ebb,'request\x20sent',JSON[_0x8eda('0x11')](_0x4f7893));if(_0x4f7893['error']){if(_0x4f7893[_0x8eda('0x12')][_0x8eda('0x13')]===0x1f4){logger[_0x8eda('0x12')](_0x8eda('0x14'),_0x4e2ebb,_0x4f7893[_0x8eda('0x12')][_0x8eda('0x15')]);return _0x5aa93d(_0x4f7893[_0x8eda('0x12')][_0x8eda('0x15')]);}logger['error']('MailQueueReport,\x20%s,\x20%s',_0x4e2ebb,_0x4f7893[_0x8eda('0x12')][_0x8eda('0x15')]);return _0x1b6a1d(_0x4f7893['error'][_0x8eda('0x15')]);}else{logger[_0x8eda('0x16')](_0x8eda('0x14'),_0x4e2ebb,'request\x20sent');_0x1b6a1d(_0x4f7893[_0x8eda('0x17')]['message']);}})[_0x8eda('0x18')](function(_0x553382){logger[_0x8eda('0x12')]('MailQueueReport,\x20%s,\x20%s',_0x4e2ebb,_0x553382);_0x5aa93d(_0x553382);});});}exports[_0x8eda('0x19')]=function(_0x2a4d2b){var _0x496c77=this;return new Promise(function(_0x5e44b7,_0x6a6282){return db[_0x8eda('0x1a')][_0x8eda('0x1b')](_0x2a4d2b[_0x8eda('0x1c')],{'raw':_0x2a4d2b[_0x8eda('0x1d')]?_0x2a4d2b[_0x8eda('0x1d')][_0x8eda('0x1e')]===undefined?!![]:![]:!![]})[_0x8eda('0x1f')](function(_0x850cce){logger[_0x8eda('0x16')](_0x8eda('0x19'),_0x2a4d2b);logger['debug'](_0x8eda('0x19'),_0x2a4d2b,JSON['stringify'](_0x850cce));_0x5e44b7(_0x850cce);})[_0x8eda('0x18')](function(_0x5183bc){logger[_0x8eda('0x12')](_0x8eda('0x19'),_0x5183bc['message'],_0x2a4d2b);_0x6a6282(_0x496c77['error'](0x1f4,_0x5183bc['message']));});});};exports[_0x8eda('0x20')]=function(_0x17cae8){var _0x5be84f=this;return new Promise(function(_0x978502,_0x37a8ab){return db['MailQueueReport'][_0x8eda('0x21')](_0x17cae8[_0x8eda('0x1c')],{'raw':_0x17cae8[_0x8eda('0x1d')]?_0x17cae8[_0x8eda('0x1d')][_0x8eda('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x17cae8['options']?_0x17cae8[_0x8eda('0x1d')]['where']||null:null,'attributes':_0x17cae8[_0x8eda('0x1d')]?_0x17cae8[_0x8eda('0x1d')][_0x8eda('0x22')]||null:null,'limit':_0x17cae8['options']?_0x17cae8[_0x8eda('0x1d')][_0x8eda('0x23')]||null:null})[_0x8eda('0x1f')](function(_0x4cdd2e){logger[_0x8eda('0x16')](_0x8eda('0x20'),_0x17cae8);logger['debug'](_0x8eda('0x20'),_0x17cae8,JSON[_0x8eda('0x11')](_0x4cdd2e));_0x978502(_0x4cdd2e);})[_0x8eda('0x18')](function(_0x3cf3f7){logger['error']('UpdateMailQueueReport',_0x3cf3f7['message'],_0x17cae8);_0x37a8ab(_0x5be84f[_0x8eda('0x12')](0x1f4,_0x3cf3f7[_0x8eda('0x15')]));});});}; \ No newline at end of file +var _0xeda8=['body','options','raw','then','UpdateMailQueueReport','update','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','MailQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','MailQueueReport,\x20%s,\x20%s','message','info','result','catch','CreateMailQueueReport','MailQueueReport','create'];(function(_0x18d772,_0x27da78){var _0x24556b=function(_0x5b8182){while(--_0x5b8182){_0x18d772['push'](_0x18d772['shift']());}};_0x24556b(++_0x27da78);}(_0xeda8,0x104));var _0x8eda=function(_0x53e1a7,_0x1e38ad){_0x53e1a7=_0x53e1a7-0x0;var _0x7b09fe=_0xeda8[_0x53e1a7];return _0x7b09fe;};'use strict';var _=require(_0x8eda('0x0'));var util=require(_0x8eda('0x1'));var moment=require('moment');var BPromise=require(_0x8eda('0x2'));var rs=require(_0x8eda('0x3'));var fs=require('fs');var Redis=require(_0x8eda('0x4'));var db=require(_0x8eda('0x5'))['db'];var utils=require(_0x8eda('0x6'));var logger=require(_0x8eda('0x7'))(_0x8eda('0x8'));var config=require(_0x8eda('0x9'));var jayson=require(_0x8eda('0xa'));var client=jayson[_0x8eda('0xb')][_0x8eda('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x32abe8,_0x4e2ebb,_0x28b721){return new BPromise(function(_0x1b6a1d,_0x5aa93d){return client[_0x8eda('0xd')](_0x32abe8,_0x28b721)['then'](function(_0x4f7893){logger['info']('MailQueueReport,\x20%s,\x20%s',_0x4e2ebb,_0x8eda('0xe'));logger[_0x8eda('0xf')](_0x8eda('0x10'),_0x4e2ebb,'request\x20sent',JSON[_0x8eda('0x11')](_0x4f7893));if(_0x4f7893['error']){if(_0x4f7893[_0x8eda('0x12')][_0x8eda('0x13')]===0x1f4){logger[_0x8eda('0x12')](_0x8eda('0x14'),_0x4e2ebb,_0x4f7893[_0x8eda('0x12')][_0x8eda('0x15')]);return _0x5aa93d(_0x4f7893[_0x8eda('0x12')][_0x8eda('0x15')]);}logger['error']('MailQueueReport,\x20%s,\x20%s',_0x4e2ebb,_0x4f7893[_0x8eda('0x12')][_0x8eda('0x15')]);return _0x1b6a1d(_0x4f7893['error'][_0x8eda('0x15')]);}else{logger[_0x8eda('0x16')](_0x8eda('0x14'),_0x4e2ebb,'request\x20sent');_0x1b6a1d(_0x4f7893[_0x8eda('0x17')]['message']);}})[_0x8eda('0x18')](function(_0x553382){logger[_0x8eda('0x12')]('MailQueueReport,\x20%s,\x20%s',_0x4e2ebb,_0x553382);_0x5aa93d(_0x553382);});});}exports[_0x8eda('0x19')]=function(_0x2a4d2b){var _0x496c77=this;return new Promise(function(_0x5e44b7,_0x6a6282){return db[_0x8eda('0x1a')][_0x8eda('0x1b')](_0x2a4d2b[_0x8eda('0x1c')],{'raw':_0x2a4d2b[_0x8eda('0x1d')]?_0x2a4d2b[_0x8eda('0x1d')][_0x8eda('0x1e')]===undefined?!![]:![]:!![]})[_0x8eda('0x1f')](function(_0x850cce){logger[_0x8eda('0x16')](_0x8eda('0x19'),_0x2a4d2b);logger['debug'](_0x8eda('0x19'),_0x2a4d2b,JSON['stringify'](_0x850cce));_0x5e44b7(_0x850cce);})[_0x8eda('0x18')](function(_0x5183bc){logger[_0x8eda('0x12')](_0x8eda('0x19'),_0x5183bc['message'],_0x2a4d2b);_0x6a6282(_0x496c77['error'](0x1f4,_0x5183bc['message']));});});};exports[_0x8eda('0x20')]=function(_0x17cae8){var _0x5be84f=this;return new Promise(function(_0x978502,_0x37a8ab){return db['MailQueueReport'][_0x8eda('0x21')](_0x17cae8[_0x8eda('0x1c')],{'raw':_0x17cae8[_0x8eda('0x1d')]?_0x17cae8[_0x8eda('0x1d')][_0x8eda('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x17cae8['options']?_0x17cae8[_0x8eda('0x1d')]['where']||null:null,'attributes':_0x17cae8[_0x8eda('0x1d')]?_0x17cae8[_0x8eda('0x1d')][_0x8eda('0x22')]||null:null,'limit':_0x17cae8['options']?_0x17cae8[_0x8eda('0x1d')][_0x8eda('0x23')]||null:null})[_0x8eda('0x1f')](function(_0x4cdd2e){logger[_0x8eda('0x16')](_0x8eda('0x20'),_0x17cae8);logger['debug'](_0x8eda('0x20'),_0x17cae8,JSON[_0x8eda('0x11')](_0x4cdd2e));_0x978502(_0x4cdd2e);})[_0x8eda('0x18')](function(_0x3cf3f7){logger['error']('UpdateMailQueueReport',_0x3cf3f7['message'],_0x17cae8);_0x37a8ab(_0x5be84f[_0x8eda('0x12')](0x1f4,_0x3cf3f7[_0x8eda('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index bb8d1d2..27b0650 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 _0x3c26=['../../components/interaction/service','exports','multer','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x3271fd,_0x339249){var _0x44b97b=function(_0x365655){while(--_0x365655){_0x3271fd['push'](_0x3271fd['shift']());}};_0x44b97b(++_0x339249);}(_0x3c26,0x16a));var _0x63c2=function(_0x4d0634,_0x33646b){_0x4d0634=_0x4d0634-0x0;var _0x489271=_0x3c26[_0x4d0634];return _0x489271;};'use strict';var multer=require(_0x63c2('0x0'));var util=require('util');var path=require(_0x63c2('0x1'));var timeout=require(_0x63c2('0x2'));var express=require(_0x63c2('0x3'));var router=express[_0x63c2('0x4')]();var auth=require(_0x63c2('0x5'));var interaction=require(_0x63c2('0x6'));var config=require('../../config/environment');module[_0x63c2('0x7')]=router; \ No newline at end of file +var _0x1e6a=['../../components/interaction/service','../../config/environment','exports','multer','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x499e9b,_0x1dc822){var _0x8c0a12=function(_0x102a85){while(--_0x102a85){_0x499e9b['push'](_0x499e9b['shift']());}};_0x8c0a12(++_0x1dc822);}(_0x1e6a,0x135));var _0xa1e6=function(_0x37fc9b,_0x59e879){_0x37fc9b=_0x37fc9b-0x0;var _0x309088=_0x1e6a[_0x37fc9b];return _0x309088;};'use strict';var multer=require(_0xa1e6('0x0'));var util=require('util');var path=require(_0xa1e6('0x1'));var timeout=require(_0xa1e6('0x2'));var express=require(_0xa1e6('0x3'));var router=express[_0xa1e6('0x4')]();var auth=require(_0xa1e6('0x5'));var interaction=require(_0xa1e6('0x6'));var config=require(_0xa1e6('0x7'));module[_0xa1e6('0x8')]=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index bdcecb2..8d0e97b 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 _0x5a86=['exports','STRING','INTEGER','INBOX','sequelize'];(function(_0x556645,_0x120f65){var _0x2b6dd6=function(_0x214ee7){while(--_0x214ee7){_0x556645['push'](_0x556645['shift']());}};_0x2b6dd6(++_0x120f65);}(_0x5a86,0xea));var _0x65a8=function(_0x57143f,_0x3d4c49){_0x57143f=_0x57143f-0x0;var _0x648cde=_0x5a86[_0x57143f];return _0x648cde;};'use strict';var Sequelize=require(_0x65a8('0x0'));module[_0x65a8('0x1')]={'description':{'type':Sequelize[_0x65a8('0x2')]},'host':{'type':Sequelize[_0x65a8('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize[_0x65a8('0x2')],'unique':'username'},'password':{'type':Sequelize[_0x65a8('0x2')]},'port':{'type':Sequelize[_0x65a8('0x3')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x65a8('0x2')],'defaultValue':_0x65a8('0x4')},'connTimeout':{'type':Sequelize[_0x65a8('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0ad0=['username','INTEGER','sequelize','STRING'];(function(_0x84f182,_0x2746ac){var _0x5a29be=function(_0x463a5a){while(--_0x463a5a){_0x84f182['push'](_0x84f182['shift']());}};_0x5a29be(++_0x2746ac);}(_0x0ad0,0x1d6));var _0x00ad=function(_0x44d498,_0x405ad7){_0x44d498=_0x44d498-0x0;var _0x31c1d4=_0x0ad0[_0x44d498];return _0x31c1d4;};'use strict';var Sequelize=require(_0x00ad('0x0'));module['exports']={'description':{'type':Sequelize[_0x00ad('0x1')]},'host':{'type':Sequelize[_0x00ad('0x1')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize[_0x00ad('0x1')],'unique':_0x00ad('0x2')},'password':{'type':Sequelize[_0x00ad('0x1')]},'port':{'type':Sequelize[_0x00ad('0x3')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x00ad('0x1')],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize[_0x00ad('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index fb46532..379dc2b 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 _0x51c5=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./mailServerIn.attributes','exports','define','MailServerIn'];(function(_0x57c813,_0x47c053){var _0x42bd3b=function(_0x49364e){while(--_0x49364e){_0x57c813['push'](_0x57c813['shift']());}};_0x42bd3b(++_0x47c053);}(_0x51c5,0x8f));var _0x551c=function(_0x40a825,_0x3bac79){_0x40a825=_0x40a825-0x0;var _0x273a54=_0x51c5[_0x40a825];return _0x273a54;};'use strict';var _=require(_0x551c('0x0'));var util=require(_0x551c('0x1'));var logger=require(_0x551c('0x2'))(_0x551c('0x3'));var moment=require(_0x551c('0x4'));var BPromise=require(_0x551c('0x5'));var rp=require(_0x551c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x551c('0x7'));var config=require(_0x551c('0x8'));var attributes=require(_0x551c('0x9'));module[_0x551c('0xa')]=function(_0xe0272c,_0x1aa8df){return _0xe0272c[_0x551c('0xb')](_0x551c('0xc'),attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb6fa=['lodash','api','request-promise','path','../../config/environment','./mailServerIn.attributes','exports','define','MailServerIn','mail_servers_in'];(function(_0x1f2c1e,_0x23213e){var _0x53afce=function(_0x386da6){while(--_0x386da6){_0x1f2c1e['push'](_0x1f2c1e['shift']());}};_0x53afce(++_0x23213e);}(_0xb6fa,0x1c2));var _0xab6f=function(_0x57add2,_0x4f2b7d){_0x57add2=_0x57add2-0x0;var _0x4e3670=_0xb6fa[_0x57add2];return _0x4e3670;};'use strict';var _=require(_0xab6f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xab6f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xab6f('0x2'));var fs=require('fs');var path=require(_0xab6f('0x3'));var rimraf=require('rimraf');var config=require(_0xab6f('0x4'));var attributes=require(_0xab6f('0x5'));module[_0xab6f('0x6')]=function(_0x2d9d01,_0x156df7){return _0x2d9d01[_0xab6f('0x7')](_0xab6f('0x8'),attributes,{'tableName':_0xab6f('0x9'),'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 cb01ad1..189032c 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 _0x7276=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetMailServerIn','MailServerIn','findAll','options','where','attributes','limit','include','map','model','stringify','lodash','util','moment','bluebird','randomstring'];(function(_0x44fb4f,_0x27627b){var _0x4c520f=function(_0xb0b4f4){while(--_0xb0b4f4){_0x44fb4f['push'](_0x44fb4f['shift']());}};_0x4c520f(++_0x27627b);}(_0x7276,0xfb));var _0x6727=function(_0x1ee501,_0x16537c){_0x1ee501=_0x1ee501-0x0;var _0x11fdb0=_0x7276[_0x1ee501];return _0x11fdb0;};'use strict';var _=require(_0x6727('0x0'));var util=require(_0x6727('0x1'));var moment=require(_0x6727('0x2'));var BPromise=require(_0x6727('0x3'));var rs=require(_0x6727('0x4'));var fs=require('fs');var Redis=require(_0x6727('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6727('0x6'));var logger=require(_0x6727('0x7'))(_0x6727('0x8'));var config=require(_0x6727('0x9'));var jayson=require(_0x6727('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1b0fa3,_0xd8fea6,_0x1f2cc4){return new BPromise(function(_0x571b74,_0x36e332){return client['request'](_0x1b0fa3,_0x1f2cc4)[_0x6727('0xb')](function(_0x1432ae){logger[_0x6727('0xc')](_0x6727('0xd'),_0xd8fea6,_0x6727('0xe'));logger[_0x6727('0xf')](_0x6727('0x10'),_0xd8fea6,'request\x20sent',JSON['stringify'](_0x1432ae));if(_0x1432ae[_0x6727('0x11')]){if(_0x1432ae[_0x6727('0x11')][_0x6727('0x12')]===0x1f4){logger[_0x6727('0x11')](_0x6727('0xd'),_0xd8fea6,_0x1432ae[_0x6727('0x11')]['message']);return _0x36e332(_0x1432ae[_0x6727('0x11')][_0x6727('0x13')]);}logger[_0x6727('0x11')]('MailServerIn,\x20%s,\x20%s',_0xd8fea6,_0x1432ae[_0x6727('0x11')][_0x6727('0x13')]);return _0x571b74(_0x1432ae[_0x6727('0x11')][_0x6727('0x13')]);}else{logger[_0x6727('0xc')]('MailServerIn,\x20%s,\x20%s',_0xd8fea6,_0x6727('0xe'));_0x571b74(_0x1432ae['result'][_0x6727('0x13')]);}})[_0x6727('0x14')](function(_0x2007cc){logger[_0x6727('0x11')](_0x6727('0xd'),_0xd8fea6,_0x2007cc);_0x36e332(_0x2007cc);});});}exports[_0x6727('0x15')]=function(_0x26b9ff){var _0x5cadf9=this;return new Promise(function(_0x142f3c,_0x187d8e){return db[_0x6727('0x16')][_0x6727('0x17')]({'raw':_0x26b9ff[_0x6727('0x18')]?_0x26b9ff[_0x6727('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x26b9ff[_0x6727('0x18')]?_0x26b9ff[_0x6727('0x18')][_0x6727('0x19')]||null:null,'attributes':_0x26b9ff[_0x6727('0x18')]?_0x26b9ff[_0x6727('0x18')][_0x6727('0x1a')]||null:null,'limit':_0x26b9ff[_0x6727('0x18')]?_0x26b9ff[_0x6727('0x18')][_0x6727('0x1b')]||null:null,'include':_0x26b9ff[_0x6727('0x18')]?_0x26b9ff[_0x6727('0x18')][_0x6727('0x1c')]?_[_0x6727('0x1d')](_0x26b9ff[_0x6727('0x18')][_0x6727('0x1c')],function(_0x4183e4){return{'model':db[_0x4183e4['model']],'as':_0x4183e4['as'],'attributes':_0x4183e4['attributes'],'include':_0x4183e4[_0x6727('0x1c')]?_['map'](_0x4183e4[_0x6727('0x1c')],function(_0x4ea71e){return{'model':db[_0x4ea71e[_0x6727('0x1e')]],'as':_0x4ea71e['as'],'attributes':_0x4ea71e[_0x6727('0x1a')],'include':_0x4ea71e[_0x6727('0x1c')]?_[_0x6727('0x1d')](_0x4ea71e[_0x6727('0x1c')],function(_0x5093e7){return{'model':db[_0x5093e7[_0x6727('0x1e')]],'as':_0x5093e7['as'],'attributes':_0x5093e7['attributes']};}):[]};}):[]};}):[]:[]})[_0x6727('0xb')](function(_0x1d6b12){logger['info'](_0x6727('0x15'),_0x26b9ff);logger[_0x6727('0xf')]('GetMailServerIn',_0x26b9ff,JSON[_0x6727('0x1f')](_0x1d6b12));_0x142f3c(_0x1d6b12);})[_0x6727('0x14')](function(_0xc5c3cb){logger[_0x6727('0x11')]('GetMailServerIn',_0xc5c3cb[_0x6727('0x13')],_0x26b9ff);_0x187d8e(_0x5cadf9['error'](0x1f4,_0xc5c3cb[_0x6727('0x13')]));});});}; \ No newline at end of file +var _0xb33c=['GetMailServerIn','MailServerIn','options','raw','where','attributes','limit','map','include','model','then','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','message','MailServerIn,\x20%s,\x20%s','info','catch'];(function(_0x45f36a,_0x2402a9){var _0x436ea0=function(_0x2a7ab3){while(--_0x2a7ab3){_0x45f36a['push'](_0x45f36a['shift']());}};_0x436ea0(++_0x2402a9);}(_0xb33c,0x71));var _0xcb33=function(_0x455b91,_0x5c31dc){_0x455b91=_0x455b91-0x0;var _0x309d5f=_0xb33c[_0x455b91];return _0x309d5f;};'use strict';var _=require(_0xcb33('0x0'));var util=require(_0xcb33('0x1'));var moment=require(_0xcb33('0x2'));var BPromise=require('bluebird');var rs=require(_0xcb33('0x3'));var fs=require('fs');var Redis=require(_0xcb33('0x4'));var db=require(_0xcb33('0x5'))['db'];var utils=require(_0xcb33('0x6'));var logger=require(_0xcb33('0x7'))(_0xcb33('0x8'));var config=require(_0xcb33('0x9'));var jayson=require(_0xcb33('0xa'));var client=jayson[_0xcb33('0xb')][_0xcb33('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x291865,_0x1b9fb8,_0x4847ce){return new BPromise(function(_0x10b5b6,_0x171985){return client[_0xcb33('0xd')](_0x291865,_0x4847ce)['then'](function(_0x31cbc3){logger['info']('MailServerIn,\x20%s,\x20%s',_0x1b9fb8,_0xcb33('0xe'));logger[_0xcb33('0xf')](_0xcb33('0x10'),_0x1b9fb8,_0xcb33('0xe'),JSON[_0xcb33('0x11')](_0x31cbc3));if(_0x31cbc3['error']){if(_0x31cbc3[_0xcb33('0x12')]['code']===0x1f4){logger[_0xcb33('0x12')]('MailServerIn,\x20%s,\x20%s',_0x1b9fb8,_0x31cbc3['error'][_0xcb33('0x13')]);return _0x171985(_0x31cbc3['error']['message']);}logger[_0xcb33('0x12')](_0xcb33('0x14'),_0x1b9fb8,_0x31cbc3[_0xcb33('0x12')][_0xcb33('0x13')]);return _0x10b5b6(_0x31cbc3['error'][_0xcb33('0x13')]);}else{logger[_0xcb33('0x15')]('MailServerIn,\x20%s,\x20%s',_0x1b9fb8,_0xcb33('0xe'));_0x10b5b6(_0x31cbc3['result'][_0xcb33('0x13')]);}})[_0xcb33('0x16')](function(_0x3c8711){logger['error']('MailServerIn,\x20%s,\x20%s',_0x1b9fb8,_0x3c8711);_0x171985(_0x3c8711);});});}exports[_0xcb33('0x17')]=function(_0x49f3a1){var _0x2c4095=this;return new Promise(function(_0xf4614d,_0x43e358){return db[_0xcb33('0x18')]['findAll']({'raw':_0x49f3a1['options']?_0x49f3a1[_0xcb33('0x19')][_0xcb33('0x1a')]===undefined?!![]:![]:!![],'where':_0x49f3a1[_0xcb33('0x19')]?_0x49f3a1['options'][_0xcb33('0x1b')]||null:null,'attributes':_0x49f3a1[_0xcb33('0x19')]?_0x49f3a1[_0xcb33('0x19')][_0xcb33('0x1c')]||null:null,'limit':_0x49f3a1['options']?_0x49f3a1[_0xcb33('0x19')][_0xcb33('0x1d')]||null:null,'include':_0x49f3a1[_0xcb33('0x19')]?_0x49f3a1[_0xcb33('0x19')]['include']?_[_0xcb33('0x1e')](_0x49f3a1['options'][_0xcb33('0x1f')],function(_0x39476f){return{'model':db[_0x39476f['model']],'as':_0x39476f['as'],'attributes':_0x39476f[_0xcb33('0x1c')],'include':_0x39476f[_0xcb33('0x1f')]?_[_0xcb33('0x1e')](_0x39476f['include'],function(_0x20015c){return{'model':db[_0x20015c[_0xcb33('0x20')]],'as':_0x20015c['as'],'attributes':_0x20015c[_0xcb33('0x1c')],'include':_0x20015c[_0xcb33('0x1f')]?_['map'](_0x20015c[_0xcb33('0x1f')],function(_0x3ffeae){return{'model':db[_0x3ffeae[_0xcb33('0x20')]],'as':_0x3ffeae['as'],'attributes':_0x3ffeae[_0xcb33('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xcb33('0x21')](function(_0x1a7f0f){logger[_0xcb33('0x15')](_0xcb33('0x17'),_0x49f3a1);logger[_0xcb33('0xf')](_0xcb33('0x17'),_0x49f3a1,JSON[_0xcb33('0x11')](_0x1a7f0f));_0xf4614d(_0x1a7f0f);})['catch'](function(_0x2cb462){logger[_0xcb33('0x12')](_0xcb33('0x17'),_0x2cb462['message'],_0x49f3a1);_0x43e358(_0x2c4095['error'](0x1f4,_0x2cb462[_0xcb33('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index ee2bddf..814f6e5 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 _0xeaa9=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','isAuthenticated','get','/:id','show','post','create'];(function(_0x5dd133,_0x4256a7){var _0x54566d=function(_0x2d9462){while(--_0x2d9462){_0x5dd133['push'](_0x5dd133['shift']());}};_0x54566d(++_0x4256a7);}(_0xeaa9,0x116));var _0x9eaa=function(_0x5d56f7,_0xba0275){_0x5d56f7=_0x5d56f7-0x0;var _0x2101db=_0xeaa9[_0x5d56f7];return _0x2101db;};'use strict';var multer=require(_0x9eaa('0x0'));var util=require(_0x9eaa('0x1'));var path=require(_0x9eaa('0x2'));var timeout=require(_0x9eaa('0x3'));var express=require(_0x9eaa('0x4'));var router=express[_0x9eaa('0x5')]();var auth=require(_0x9eaa('0x6'));var interaction=require(_0x9eaa('0x7'));var config=require(_0x9eaa('0x8'));var controller=require(_0x9eaa('0x9'));router['get']('/',auth[_0x9eaa('0xa')](),controller['index']);router[_0x9eaa('0xb')](_0x9eaa('0xc'),auth['isAuthenticated'](),controller[_0x9eaa('0xd')]);router[_0x9eaa('0xe')]('/',auth[_0x9eaa('0xa')](),controller[_0x9eaa('0xf')]);router[_0x9eaa('0x10')](_0x9eaa('0xc'),auth[_0x9eaa('0xa')](),controller[_0x9eaa('0x11')]);router[_0x9eaa('0x12')](_0x9eaa('0xc'),auth[_0x9eaa('0xa')](),controller[_0x9eaa('0x13')]);module[_0x9eaa('0x14')]=router; \ No newline at end of file +var _0xec9d=['post','create','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./mailServerOut.controller','isAuthenticated','index','get','show'];(function(_0x57f37c,_0x509412){var _0x4b3535=function(_0x3aae68){while(--_0x3aae68){_0x57f37c['push'](_0x57f37c['shift']());}};_0x4b3535(++_0x509412);}(_0xec9d,0x192));var _0xdec9=function(_0x192eec,_0x85d5c3){_0x192eec=_0x192eec-0x0;var _0x267ce7=_0xec9d[_0x192eec];return _0x267ce7;};'use strict';var multer=require(_0xdec9('0x0'));var util=require(_0xdec9('0x1'));var path=require(_0xdec9('0x2'));var timeout=require(_0xdec9('0x3'));var express=require(_0xdec9('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xdec9('0x5'));var config=require(_0xdec9('0x6'));var controller=require(_0xdec9('0x7'));router['get']('/',auth[_0xdec9('0x8')](),controller[_0xdec9('0x9')]);router[_0xdec9('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xdec9('0xb')]);router[_0xdec9('0xc')]('/',auth[_0xdec9('0x8')](),controller[_0xdec9('0xd')]);router['put'](_0xdec9('0xe'),auth[_0xdec9('0x8')](),controller[_0xdec9('0xf')]);router[_0xdec9('0x10')]('/:id',auth[_0xdec9('0x8')](),controller[_0xdec9('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index aba89fb..d599054 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 _0x9fe7=['exports','STRING','INTEGER','BOOLEAN','sequelize'];(function(_0x11deb5,_0x46b0f0){var _0x5ee90f=function(_0x20fbf8){while(--_0x20fbf8){_0x11deb5['push'](_0x11deb5['shift']());}};_0x5ee90f(++_0x46b0f0);}(_0x9fe7,0x1df));var _0x79fe=function(_0x2f7100,_0x5f1e3c){_0x2f7100=_0x2f7100-0x0;var _0x1a7324=_0x9fe7[_0x2f7100];return _0x1a7324;};'use strict';var Sequelize=require(_0x79fe('0x0'));module[_0x79fe('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x79fe('0x2')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0x79fe('0x2')]},'port':{'type':Sequelize[_0x79fe('0x3')]},'secure':{'type':Sequelize[_0x79fe('0x4')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x79fe('0x4')],'defaultValue':!![]}}; \ No newline at end of file +var _0x2706=['STRING','INTEGER','BOOLEAN','exports'];(function(_0x48999d,_0x1e02cb){var _0x1ad0d1=function(_0x3f974e){while(--_0x3f974e){_0x48999d['push'](_0x48999d['shift']());}};_0x1ad0d1(++_0x1e02cb);}(_0x2706,0x107));var _0x6270=function(_0x22dd4b,_0x39742c){_0x22dd4b=_0x22dd4b-0x0;var _0x36438f=_0x2706[_0x22dd4b];return _0x36438f;};'use strict';var Sequelize=require('sequelize');module[_0x6270('0x0')]={'description':{'type':Sequelize[_0x6270('0x1')]},'host':{'type':Sequelize[_0x6270('0x1')]},'user':{'type':Sequelize[_0x6270('0x1')]},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x6270('0x2')]},'secure':{'type':Sequelize[_0x6270('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0x6270('0x1')]},'authentication':{'type':Sequelize[_0x6270('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index 3e5c2c1..1e44504 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 _0x992d=['length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','key','VIRTUAL','field','options','count','includeAll','include','rows','catch','show','params','find','create','update','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','end','status','json','offset','set','apply','reject','then','destroy','sendStatus','error','stack','name','send','index','map','MailServerOut','rawAttributes','model','query','keys','filters','intersection','attributes','fields'];(function(_0x23ee07,_0x474c26){var _0x11bf25=function(_0x1911f9){while(--_0x1911f9){_0x23ee07['push'](_0x23ee07['shift']());}};_0x11bf25(++_0x474c26);}(_0x992d,0xae));var _0xd992=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x992d[_0x502c7d];return _0x30b7ed;};'use strict';var pdf=require(_0xd992('0x0'));var emlformat=require(_0xd992('0x1'));var rimraf=require(_0xd992('0x2'));var zipdir=require(_0xd992('0x3'));var jsonpatch=require(_0xd992('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd992('0x5'));var Mustache=require(_0xd992('0x6'));var util=require(_0xd992('0x7'));var path=require(_0xd992('0x8'));var sox=require(_0xd992('0x9'));var csv=require(_0xd992('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xd992('0xb'));var crypto=require(_0xd992('0xc'));var jsforce=require(_0xd992('0xd'));var deskjs=require(_0xd992('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd992('0xf'));var qs=require(_0xd992('0x10'));var as=require(_0xd992('0x11'));var hardwareService=require(_0xd992('0x12'));var logger=require(_0xd992('0x13'))(_0xd992('0x14'));var utils=require('../../config/utils');var config=require(_0xd992('0x15'));var db=require(_0xd992('0x16'))['db'];function respondWithStatusCode(_0x2af561,_0x15b988){_0x15b988=_0x15b988||0xcc;return function(_0x2c6002){if(_0x2c6002){return _0x2af561['sendStatus'](_0x15b988);}return _0x2af561['status'](_0x15b988)[_0xd992('0x17')]();};}function respondWithResult(_0x12c39b,_0x1dcef9){_0x1dcef9=_0x1dcef9||0xc8;return function(_0x5cd585){if(_0x5cd585){return _0x12c39b[_0xd992('0x18')](_0x1dcef9)[_0xd992('0x19')](_0x5cd585);}};}function respondWithFilteredResult(_0x2cf323,_0x1f8ba6){return function(_0x399821){if(_0x399821){var _0x4c5f2c=_0x399821['count'],_0x3a1ec6=_0x1f8ba6[_0xd992('0x1a')],_0xb3059f=_0x1f8ba6['offset']+_0x1f8ba6['limit'],_0x46e7f2;if(_0xb3059f>=_0x4c5f2c){_0xb3059f=_0x4c5f2c;_0x46e7f2=0xc8;}else{_0x46e7f2=0xce;}_0x2cf323['status'](_0x46e7f2);return _0x2cf323[_0xd992('0x1b')]('Content-Range',_0x3a1ec6+'-'+_0xb3059f+'/'+_0x4c5f2c)[_0xd992('0x19')](_0x399821);}return null;};}function patchUpdates(_0x2fd46c){return function(_0x2594b4){try{jsonpatch[_0xd992('0x1c')](_0x2594b4,_0x2fd46c,!![]);}catch(_0x17d213){return BPromise[_0xd992('0x1d')](_0x17d213);}return _0x2594b4['save']();};}function saveUpdates(_0x1cb20f,_0x489445){return function(_0x3ead3e){if(_0x3ead3e){return _0x3ead3e['update'](_0x1cb20f)[_0xd992('0x1e')](function(_0x408714){return _0x408714;});}return null;};}function removeEntity(_0x607689,_0x3018d5){return function(_0x11b0a4){if(_0x11b0a4){return _0x11b0a4[_0xd992('0x1f')]()[_0xd992('0x1e')](function(){_0x607689[_0xd992('0x18')](0xcc)[_0xd992('0x17')]();});}};}function handleEntityNotFound(_0x1a7a20,_0x5d2e57){return function(_0x59cce4){if(!_0x59cce4){_0x1a7a20[_0xd992('0x20')](0x194);}return _0x59cce4;};}function handleError(_0x362efd,_0x18054f){_0x18054f=_0x18054f||0x1f4;return function(_0x64725){logger[_0xd992('0x21')](_0x64725[_0xd992('0x22')]);if(_0x64725[_0xd992('0x23')]){delete _0x64725[_0xd992('0x23')];}_0x362efd[_0xd992('0x18')](_0x18054f)[_0xd992('0x24')](_0x64725);};}exports[_0xd992('0x25')]=function(_0x2b28f6,_0x5e9d51){var _0xe3ab15={},_0xfd61cd={},_0x4dd89a={'count':0x0,'rows':[]};var _0x5b75b2=_[_0xd992('0x26')](db[_0xd992('0x27')][_0xd992('0x28')],function(_0x7da637){return{'name':_0x7da637['fieldName'],'type':_0x7da637['type']['key']};});_0xfd61cd[_0xd992('0x29')]=_[_0xd992('0x26')](_0x5b75b2,_0xd992('0x23'));_0xfd61cd[_0xd992('0x2a')]=_[_0xd992('0x2b')](_0x2b28f6['query']);_0xfd61cd[_0xd992('0x2c')]=_[_0xd992('0x2d')](_0xfd61cd['model'],_0xfd61cd[_0xd992('0x2a')]);_0xe3ab15[_0xd992('0x2e')]=_[_0xd992('0x2d')](_0xfd61cd[_0xd992('0x29')],qs['fields'](_0x2b28f6[_0xd992('0x2a')][_0xd992('0x2f')]));_0xe3ab15[_0xd992('0x2e')]=_0xe3ab15['attributes'][_0xd992('0x30')]?_0xe3ab15['attributes']:_0xfd61cd['model'];if(!_0x2b28f6['query'][_0xd992('0x31')](_0xd992('0x32'))){_0xe3ab15[_0xd992('0x33')]=qs[_0xd992('0x33')](_0x2b28f6[_0xd992('0x2a')]['limit']);_0xe3ab15[_0xd992('0x1a')]=qs[_0xd992('0x1a')](_0x2b28f6['query'][_0xd992('0x1a')]);}_0xe3ab15[_0xd992('0x34')]=qs[_0xd992('0x35')](_0x2b28f6[_0xd992('0x2a')][_0xd992('0x35')]);_0xe3ab15[_0xd992('0x36')]=qs[_0xd992('0x2c')](_[_0xd992('0x37')](_0x2b28f6[_0xd992('0x2a')],_0xfd61cd[_0xd992('0x2c')]));if(_0x2b28f6['query'][_0xd992('0x38')]){_0xe3ab15[_0xd992('0x36')]=_[_0xd992('0x39')](_0xe3ab15['where'],{'$or':_[_0xd992('0x26')](_0x5b75b2,function(_0x2e090d){if(_0x2e090d[_0xd992('0x3a')][_0xd992('0x3b')]!==_0xd992('0x3c')){var _0x25e7fd={};_0x25e7fd[_0x2e090d[_0xd992('0x3d')]]={'$like':'%'+_0x2b28f6[_0xd992('0x2a')][_0xd992('0x38')]+'%'};return _0x25e7fd;}})});}_0xe3ab15=_['merge']({},_0xe3ab15,_0x2b28f6[_0xd992('0x3e')]);var _0x144a42={'where':_0xe3ab15['where']};return db[_0xd992('0x27')][_0xd992('0x3f')](_0x144a42)[_0xd992('0x1e')](function(_0x459b86){_0x4dd89a[_0xd992('0x3f')]=_0x459b86;if(_0x2b28f6['query'][_0xd992('0x40')]){_0xe3ab15[_0xd992('0x41')]=[{'all':!![]}];}return db[_0xd992('0x27')]['findAll'](_0xe3ab15);})[_0xd992('0x1e')](function(_0x2767c9){_0x4dd89a[_0xd992('0x42')]=_0x2767c9;return _0x4dd89a;})[_0xd992('0x1e')](respondWithFilteredResult(_0x5e9d51,_0xe3ab15))[_0xd992('0x43')](handleError(_0x5e9d51,null));};exports[_0xd992('0x44')]=function(_0x31ca4f,_0x1269bf){var _0x1602a3={'raw':!![],'where':{'id':_0x31ca4f[_0xd992('0x45')]['id']}},_0x17e179={};_0x17e179['model']=_['keys'](db[_0xd992('0x27')][_0xd992('0x28')]);_0x17e179[_0xd992('0x2a')]=_[_0xd992('0x2b')](_0x31ca4f[_0xd992('0x2a')]);_0x17e179[_0xd992('0x2c')]=_[_0xd992('0x2d')](_0x17e179[_0xd992('0x29')],_0x17e179['query']);_0x1602a3[_0xd992('0x2e')]=_[_0xd992('0x2d')](_0x17e179[_0xd992('0x29')],qs[_0xd992('0x2f')](_0x31ca4f[_0xd992('0x2a')]['fields']));_0x1602a3['attributes']=_0x1602a3[_0xd992('0x2e')][_0xd992('0x30')]?_0x1602a3[_0xd992('0x2e')]:_0x17e179[_0xd992('0x29')];if(_0x31ca4f[_0xd992('0x2a')][_0xd992('0x40')]){_0x1602a3['include']=[{'all':!![]}];}_0x1602a3=_['merge']({},_0x1602a3,_0x31ca4f[_0xd992('0x3e')]);return db[_0xd992('0x27')][_0xd992('0x46')](_0x1602a3)[_0xd992('0x1e')](handleEntityNotFound(_0x1269bf,null))[_0xd992('0x1e')](respondWithResult(_0x1269bf,null))[_0xd992('0x43')](handleError(_0x1269bf,null));};exports[_0xd992('0x47')]=function(_0x34c96c,_0x48cc1b){return db[_0xd992('0x27')][_0xd992('0x47')](_0x34c96c['body'],{})[_0xd992('0x1e')](respondWithResult(_0x48cc1b,0xc9))['catch'](handleError(_0x48cc1b,null));};exports[_0xd992('0x48')]=function(_0x4bdd1d,_0x279d36){if(_0x4bdd1d[_0xd992('0x49')]['id']){delete _0x4bdd1d['body']['id'];}return db['MailServerOut'][_0xd992('0x46')]({'where':{'id':_0x4bdd1d['params']['id']}})[_0xd992('0x1e')](handleEntityNotFound(_0x279d36,null))[_0xd992('0x1e')](saveUpdates(_0x4bdd1d['body'],null))['then'](respondWithResult(_0x279d36,null))[_0xd992('0x43')](handleError(_0x279d36,null));};exports[_0xd992('0x1f')]=function(_0x5e1815,_0x5b0675){return db[_0xd992('0x27')][_0xd992('0x46')]({'where':{'id':_0x5e1815[_0xd992('0x45')]['id']}})[_0xd992('0x1e')](handleEntityNotFound(_0x5b0675,null))[_0xd992('0x1e')](removeEntity(_0x5b0675,null))[_0xd992('0x43')](handleError(_0x5b0675,null));}; \ No newline at end of file +var _0x437b=['include','MailServerOut','findAll','rows','catch','show','params','body','find','destroy','html-pdf','zip-dir','request-promise','moment','bluebird','util','sox','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','status','end','json','offset','set','reject','save','update','then','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','limit','order','sort','where','pick','filter','merge','type','field','options','count'];(function(_0x5e4837,_0x2d53b7){var _0x1f3615=function(_0x7fb4d1){while(--_0x7fb4d1){_0x5e4837['push'](_0x5e4837['shift']());}};_0x1f3615(++_0x2d53b7);}(_0x437b,0x1a8));var _0xb437=function(_0x552fce,_0x3f24bc){_0x552fce=_0x552fce-0x0;var _0x3e27a2=_0x437b[_0x552fce];return _0x3e27a2;};'use strict';var pdf=require(_0xb437('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb437('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb437('0x2'));var moment=require(_0xb437('0x3'));var BPromise=require(_0xb437('0x4'));var Mustache=require('mustache');var util=require(_0xb437('0x5'));var path=require('path');var sox=require(_0xb437('0x6'));var csv=require('to-csv');var ejs=require(_0xb437('0x7'));var fs=require('fs');var _=require(_0xb437('0x8'));var squel=require(_0xb437('0x9'));var crypto=require(_0xb437('0xa'));var jsforce=require(_0xb437('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb437('0xc'));var Papa=require(_0xb437('0xd'));var Redis=require(_0xb437('0xe'));var authService=require(_0xb437('0xf'));var qs=require(_0xb437('0x10'));var as=require(_0xb437('0x11'));var hardwareService=require(_0xb437('0x12'));var logger=require(_0xb437('0x13'))(_0xb437('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5b133d,_0x2eb4c2){_0x2eb4c2=_0x2eb4c2||0xcc;return function(_0x286dbd){if(_0x286dbd){return _0x5b133d['sendStatus'](_0x2eb4c2);}return _0x5b133d[_0xb437('0x15')](_0x2eb4c2)[_0xb437('0x16')]();};}function respondWithResult(_0x45d9a5,_0x2aa76e){_0x2aa76e=_0x2aa76e||0xc8;return function(_0x1ea6de){if(_0x1ea6de){return _0x45d9a5[_0xb437('0x15')](_0x2aa76e)[_0xb437('0x17')](_0x1ea6de);}};}function respondWithFilteredResult(_0x1db474,_0x5311a9){return function(_0x1e6589){if(_0x1e6589){var _0x39fb99=_0x1e6589['count'],_0x5e4c9f=_0x5311a9[_0xb437('0x18')],_0x2e82b8=_0x5311a9['offset']+_0x5311a9['limit'],_0x66b531;if(_0x2e82b8>=_0x39fb99){_0x2e82b8=_0x39fb99;_0x66b531=0xc8;}else{_0x66b531=0xce;}_0x1db474[_0xb437('0x15')](_0x66b531);return _0x1db474[_0xb437('0x19')]('Content-Range',_0x5e4c9f+'-'+_0x2e82b8+'/'+_0x39fb99)[_0xb437('0x17')](_0x1e6589);}return null;};}function patchUpdates(_0xfd7068){return function(_0x3bbe85){try{jsonpatch['apply'](_0x3bbe85,_0xfd7068,!![]);}catch(_0x1a2eee){return BPromise[_0xb437('0x1a')](_0x1a2eee);}return _0x3bbe85[_0xb437('0x1b')]();};}function saveUpdates(_0x1083ee,_0x5a8888){return function(_0x5adb78){if(_0x5adb78){return _0x5adb78[_0xb437('0x1c')](_0x1083ee)['then'](function(_0x5c0f7a){return _0x5c0f7a;});}return null;};}function removeEntity(_0x4304b1,_0x4a01bf){return function(_0x136140){if(_0x136140){return _0x136140['destroy']()[_0xb437('0x1d')](function(){_0x4304b1['status'](0xcc)[_0xb437('0x16')]();});}};}function handleEntityNotFound(_0xcebd70,_0x56f4d6){return function(_0x4c4969){if(!_0x4c4969){_0xcebd70[_0xb437('0x1e')](0x194);}return _0x4c4969;};}function handleError(_0x434100,_0xb1685d){_0xb1685d=_0xb1685d||0x1f4;return function(_0x68dd62){logger[_0xb437('0x1f')](_0x68dd62[_0xb437('0x20')]);if(_0x68dd62[_0xb437('0x21')]){delete _0x68dd62[_0xb437('0x21')];}_0x434100['status'](_0xb1685d)[_0xb437('0x22')](_0x68dd62);};}exports[_0xb437('0x23')]=function(_0x44fe80,_0x45b213){var _0xf969d3={},_0x431a15={},_0x51b244={'count':0x0,'rows':[]};var _0x431e3c=_[_0xb437('0x24')](db['MailServerOut'][_0xb437('0x25')],function(_0x10eb36){return{'name':_0x10eb36[_0xb437('0x26')],'type':_0x10eb36['type'][_0xb437('0x27')]};});_0x431a15[_0xb437('0x28')]=_[_0xb437('0x24')](_0x431e3c,_0xb437('0x21'));_0x431a15[_0xb437('0x29')]=_[_0xb437('0x2a')](_0x44fe80[_0xb437('0x29')]);_0x431a15[_0xb437('0x2b')]=_[_0xb437('0x2c')](_0x431a15[_0xb437('0x28')],_0x431a15[_0xb437('0x29')]);_0xf969d3[_0xb437('0x2d')]=_[_0xb437('0x2c')](_0x431a15[_0xb437('0x28')],qs[_0xb437('0x2e')](_0x44fe80[_0xb437('0x29')]['fields']));_0xf969d3[_0xb437('0x2d')]=_0xf969d3[_0xb437('0x2d')][_0xb437('0x2f')]?_0xf969d3[_0xb437('0x2d')]:_0x431a15['model'];if(!_0x44fe80['query']['hasOwnProperty']('nolimit')){_0xf969d3[_0xb437('0x30')]=qs[_0xb437('0x30')](_0x44fe80[_0xb437('0x29')]['limit']);_0xf969d3[_0xb437('0x18')]=qs[_0xb437('0x18')](_0x44fe80[_0xb437('0x29')][_0xb437('0x18')]);}_0xf969d3[_0xb437('0x31')]=qs[_0xb437('0x32')](_0x44fe80[_0xb437('0x29')][_0xb437('0x32')]);_0xf969d3[_0xb437('0x33')]=qs[_0xb437('0x2b')](_[_0xb437('0x34')](_0x44fe80[_0xb437('0x29')],_0x431a15[_0xb437('0x2b')]));if(_0x44fe80[_0xb437('0x29')][_0xb437('0x35')]){_0xf969d3[_0xb437('0x33')]=_[_0xb437('0x36')](_0xf969d3[_0xb437('0x33')],{'$or':_['map'](_0x431e3c,function(_0x54dbf0){if(_0x54dbf0[_0xb437('0x37')]['key']!=='VIRTUAL'){var _0x2b1782={};_0x2b1782[_0x54dbf0[_0xb437('0x38')]]={'$like':'%'+_0x44fe80[_0xb437('0x29')][_0xb437('0x35')]+'%'};return _0x2b1782;}})});}_0xf969d3=_[_0xb437('0x36')]({},_0xf969d3,_0x44fe80[_0xb437('0x39')]);var _0xf4cb6b={'where':_0xf969d3[_0xb437('0x33')]};return db['MailServerOut'][_0xb437('0x3a')](_0xf4cb6b)[_0xb437('0x1d')](function(_0x454a2d){_0x51b244[_0xb437('0x3a')]=_0x454a2d;if(_0x44fe80[_0xb437('0x29')]['includeAll']){_0xf969d3[_0xb437('0x3b')]=[{'all':!![]}];}return db[_0xb437('0x3c')][_0xb437('0x3d')](_0xf969d3);})[_0xb437('0x1d')](function(_0x383a1a){_0x51b244[_0xb437('0x3e')]=_0x383a1a;return _0x51b244;})[_0xb437('0x1d')](respondWithFilteredResult(_0x45b213,_0xf969d3))[_0xb437('0x3f')](handleError(_0x45b213,null));};exports[_0xb437('0x40')]=function(_0x1dd56a,_0x9976a1){var _0xf71837={'raw':!![],'where':{'id':_0x1dd56a[_0xb437('0x41')]['id']}},_0x31373e={};_0x31373e['model']=_[_0xb437('0x2a')](db[_0xb437('0x3c')][_0xb437('0x25')]);_0x31373e[_0xb437('0x29')]=_[_0xb437('0x2a')](_0x1dd56a['query']);_0x31373e[_0xb437('0x2b')]=_[_0xb437('0x2c')](_0x31373e[_0xb437('0x28')],_0x31373e[_0xb437('0x29')]);_0xf71837[_0xb437('0x2d')]=_[_0xb437('0x2c')](_0x31373e[_0xb437('0x28')],qs[_0xb437('0x2e')](_0x1dd56a[_0xb437('0x29')][_0xb437('0x2e')]));_0xf71837[_0xb437('0x2d')]=_0xf71837['attributes'][_0xb437('0x2f')]?_0xf71837['attributes']:_0x31373e[_0xb437('0x28')];if(_0x1dd56a['query']['includeAll']){_0xf71837[_0xb437('0x3b')]=[{'all':!![]}];}_0xf71837=_[_0xb437('0x36')]({},_0xf71837,_0x1dd56a[_0xb437('0x39')]);return db[_0xb437('0x3c')]['find'](_0xf71837)[_0xb437('0x1d')](handleEntityNotFound(_0x9976a1,null))['then'](respondWithResult(_0x9976a1,null))[_0xb437('0x3f')](handleError(_0x9976a1,null));};exports['create']=function(_0x2ddcac,_0x578a38){return db[_0xb437('0x3c')]['create'](_0x2ddcac['body'],{})[_0xb437('0x1d')](respondWithResult(_0x578a38,0xc9))['catch'](handleError(_0x578a38,null));};exports['update']=function(_0x33c3e6,_0x4c025c){if(_0x33c3e6[_0xb437('0x42')]['id']){delete _0x33c3e6[_0xb437('0x42')]['id'];}return db[_0xb437('0x3c')][_0xb437('0x43')]({'where':{'id':_0x33c3e6[_0xb437('0x41')]['id']}})['then'](handleEntityNotFound(_0x4c025c,null))['then'](saveUpdates(_0x33c3e6[_0xb437('0x42')],null))[_0xb437('0x1d')](respondWithResult(_0x4c025c,null))[_0xb437('0x3f')](handleError(_0x4c025c,null));};exports[_0xb437('0x44')]=function(_0x50b618,_0x3e3d89){return db['MailServerOut'][_0xb437('0x43')]({'where':{'id':_0x50b618['params']['id']}})['then'](handleEntityNotFound(_0x3e3d89,null))['then'](removeEntity(_0x3e3d89,null))[_0xb437('0x3f')](handleError(_0x3e3d89,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 252d462..a85eba3 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 _0x7da7=['util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','exports','define','mail_servers_out','lodash'];(function(_0x16cc3e,_0x21d15f){var _0x216852=function(_0x544d08){while(--_0x544d08){_0x16cc3e['push'](_0x16cc3e['shift']());}};_0x216852(++_0x21d15f);}(_0x7da7,0x10d));var _0x77da=function(_0x458363,_0x1675db){_0x458363=_0x458363-0x0;var _0x4d0290=_0x7da7[_0x458363];return _0x4d0290;};'use strict';var _=require(_0x77da('0x0'));var util=require(_0x77da('0x1'));var logger=require(_0x77da('0x2'))('api');var moment=require('moment');var BPromise=require(_0x77da('0x3'));var rp=require(_0x77da('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x77da('0x5'));var config=require(_0x77da('0x6'));var attributes=require('./mailServerOut.attributes');module[_0x77da('0x7')]=function(_0xc54a12,_0x47da81){return _0xc54a12[_0x77da('0x8')]('MailServerOut',attributes,{'tableName':_0x77da('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5fc3=['lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./mailServerOut.attributes','exports','define','mail_servers_out'];(function(_0x27e27c,_0x5f3c93){var _0x507916=function(_0x13f5d5){while(--_0x13f5d5){_0x27e27c['push'](_0x27e27c['shift']());}};_0x507916(++_0x5f3c93);}(_0x5fc3,0xa8));var _0x35fc=function(_0x4bfade,_0xb26c0e){_0x4bfade=_0x4bfade-0x0;var _0x272465=_0x5fc3[_0x4bfade];return _0x272465;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var logger=require('../../config/logger')(_0x35fc('0x2'));var moment=require(_0x35fc('0x3'));var BPromise=require(_0x35fc('0x4'));var rp=require(_0x35fc('0x5'));var fs=require('fs');var path=require(_0x35fc('0x6'));var rimraf=require('rimraf');var config=require(_0x35fc('0x7'));var attributes=require(_0x35fc('0x8'));module[_0x35fc('0x9')]=function(_0x5b85ad,_0x5754be){return _0x5b85ad[_0x35fc('0xa')]('MailServerOut',attributes,{'tableName':_0x35fc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index 0b4ba84..3e4267d 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 _0xf4f8=['util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','debug','MailServerOut,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','MailServerOut,\x20%s,\x20%s','catch'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0xf4f8,0x126));var _0x8f4f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf4f8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x8f4f('0x0'));var moment=require(_0x8f4f('0x1'));var BPromise=require('bluebird');var rs=require(_0x8f4f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8f4f('0x3'))['db'];var utils=require(_0x8f4f('0x4'));var logger=require(_0x8f4f('0x5'))('rpc');var config=require(_0x8f4f('0x6'));var jayson=require(_0x8f4f('0x7'));var client=jayson[_0x8f4f('0x8')][_0x8f4f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xf7e726,_0x23fea5,_0x1b7a3b){return new BPromise(function(_0x22267e,_0x321ec7){return client[_0x8f4f('0xa')](_0xf7e726,_0x1b7a3b)[_0x8f4f('0xb')](function(_0x1934da){logger[_0x8f4f('0xc')]('MailServerOut,\x20%s,\x20%s',_0x23fea5,'request\x20sent');logger[_0x8f4f('0xd')](_0x8f4f('0xe'),_0x23fea5,_0x8f4f('0xf'),JSON['stringify'](_0x1934da));if(_0x1934da[_0x8f4f('0x10')]){if(_0x1934da[_0x8f4f('0x10')][_0x8f4f('0x11')]===0x1f4){logger[_0x8f4f('0x10')]('MailServerOut,\x20%s,\x20%s',_0x23fea5,_0x1934da[_0x8f4f('0x10')][_0x8f4f('0x12')]);return _0x321ec7(_0x1934da['error'][_0x8f4f('0x12')]);}logger['error'](_0x8f4f('0x13'),_0x23fea5,_0x1934da['error'][_0x8f4f('0x12')]);return _0x22267e(_0x1934da[_0x8f4f('0x10')]['message']);}else{logger[_0x8f4f('0xc')](_0x8f4f('0x13'),_0x23fea5,'request\x20sent');_0x22267e(_0x1934da['result'][_0x8f4f('0x12')]);}})[_0x8f4f('0x14')](function(_0x41ece0){logger[_0x8f4f('0x10')](_0x8f4f('0x13'),_0x23fea5,_0x41ece0);_0x321ec7(_0x41ece0);});});} \ No newline at end of file +var _0xfc79=['client','http','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','MailServerOut,\x20%s,\x20%s,\x20%s','error','message','result','lodash','util','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1f448,_0x4c41d6){var _0x344eb4=function(_0x194769){while(--_0x194769){_0x1f448['push'](_0x1f448['shift']());}};_0x344eb4(++_0x4c41d6);}(_0xfc79,0xac));var _0x9fc7=function(_0x33b81d,_0x3a828b){_0x33b81d=_0x33b81d-0x0;var _0x2f1d2a=_0xfc79[_0x33b81d];return _0x2f1d2a;};'use strict';var _=require(_0x9fc7('0x0'));var util=require(_0x9fc7('0x1'));var moment=require('moment');var BPromise=require(_0x9fc7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9fc7('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9fc7('0x4'))(_0x9fc7('0x5'));var config=require(_0x9fc7('0x6'));var jayson=require(_0x9fc7('0x7'));var client=jayson[_0x9fc7('0x8')][_0x9fc7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x38ec65,_0x2ca987,_0x1f0635){return new BPromise(function(_0x4902ef,_0x2e67c0){return client[_0x9fc7('0xa')](_0x38ec65,_0x1f0635)[_0x9fc7('0xb')](function(_0x86273e){logger['info'](_0x9fc7('0xc'),_0x2ca987,_0x9fc7('0xd'));logger['debug'](_0x9fc7('0xe'),_0x2ca987,_0x9fc7('0xd'),JSON['stringify'](_0x86273e));if(_0x86273e[_0x9fc7('0xf')]){if(_0x86273e[_0x9fc7('0xf')]['code']===0x1f4){logger['error'](_0x9fc7('0xc'),_0x2ca987,_0x86273e[_0x9fc7('0xf')][_0x9fc7('0x10')]);return _0x2e67c0(_0x86273e[_0x9fc7('0xf')][_0x9fc7('0x10')]);}logger[_0x9fc7('0xf')](_0x9fc7('0xc'),_0x2ca987,_0x86273e['error'][_0x9fc7('0x10')]);return _0x4902ef(_0x86273e[_0x9fc7('0xf')][_0x9fc7('0x10')]);}else{logger['info'](_0x9fc7('0xc'),_0x2ca987,_0x9fc7('0xd'));_0x4902ef(_0x86273e[_0x9fc7('0x11')][_0x9fc7('0x10')]);}})['catch'](function(_0x1a8e9b){logger[_0x9fc7('0xf')](_0x9fc7('0xc'),_0x2ca987,_0x1a8e9b);_0x2e67c0(_0x1a8e9b);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index e5c02ca..3cfc624 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 _0xc630=['create','put','update','delete','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','get','isAuthenticated','describe','/:id','show','post'];(function(_0x42a757,_0xa8f02a){var _0x3be380=function(_0x2b0933){while(--_0x2b0933){_0x42a757['push'](_0x42a757['shift']());}};_0x3be380(++_0xa8f02a);}(_0xc630,0x105));var _0x0c63=function(_0x5459c1,_0x36f6f0){_0x5459c1=_0x5459c1-0x0;var _0x3f99b5=_0xc630[_0x5459c1];return _0x3f99b5;};'use strict';var multer=require(_0x0c63('0x0'));var util=require('util');var path=require(_0x0c63('0x1'));var timeout=require(_0x0c63('0x2'));var express=require('express');var router=express[_0x0c63('0x3')]();var auth=require(_0x0c63('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./mailSubstatus.controller');router[_0x0c63('0x5')]('/',auth[_0x0c63('0x6')](),controller['index']);router[_0x0c63('0x5')]('/describe',auth[_0x0c63('0x6')](),controller[_0x0c63('0x7')]);router[_0x0c63('0x5')](_0x0c63('0x8'),auth[_0x0c63('0x6')](),controller[_0x0c63('0x9')]);router[_0x0c63('0xa')]('/',auth['isAuthenticated'](),controller[_0x0c63('0xb')]);router[_0x0c63('0xc')](_0x0c63('0x8'),auth[_0x0c63('0x6')](),controller[_0x0c63('0xd')]);router[_0x0c63('0xe')](_0x0c63('0x8'),auth[_0x0c63('0x6')](),controller[_0x0c63('0xf')]);module[_0x0c63('0x10')]=router; \ No newline at end of file +var _0x2dff=['./mailSubstatus.controller','get','isAuthenticated','index','describe','/:id','show','post','create','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2b6600,_0x24c497){var _0x912ee2=function(_0x5d6484){while(--_0x5d6484){_0x2b6600['push'](_0x2b6600['shift']());}};_0x912ee2(++_0x24c497);}(_0x2dff,0x8b));var _0xf2df=function(_0x29219e,_0x361e47){_0x29219e=_0x29219e-0x0;var _0x2d2540=_0x2dff[_0x29219e];return _0x2d2540;};'use strict';var multer=require('multer');var util=require(_0xf2df('0x0'));var path=require(_0xf2df('0x1'));var timeout=require(_0xf2df('0x2'));var express=require(_0xf2df('0x3'));var router=express[_0xf2df('0x4')]();var auth=require(_0xf2df('0x5'));var interaction=require(_0xf2df('0x6'));var config=require(_0xf2df('0x7'));var controller=require(_0xf2df('0x8'));router[_0xf2df('0x9')]('/',auth[_0xf2df('0xa')](),controller[_0xf2df('0xb')]);router['get']('/describe',auth[_0xf2df('0xa')](),controller[_0xf2df('0xc')]);router[_0xf2df('0x9')](_0xf2df('0xd'),auth['isAuthenticated'](),controller[_0xf2df('0xe')]);router[_0xf2df('0xf')]('/',auth[_0xf2df('0xa')](),controller[_0xf2df('0x10')]);router['put'](_0xf2df('0xd'),auth[_0xf2df('0xa')](),controller[_0xf2df('0x11')]);router[_0xf2df('0x12')](_0xf2df('0xd'),auth[_0xf2df('0xa')](),controller[_0xf2df('0x13')]);module[_0xf2df('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 20cb545..c3ede02 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 _0xc0d7=['STRING','name'];(function(_0x436ead,_0x327abf){var _0x5f3914=function(_0x4076de){while(--_0x4076de){_0x436ead['push'](_0x436ead['shift']());}};_0x5f3914(++_0x327abf);}(_0xc0d7,0x7f));var _0x7c0d=function(_0x53f93f,_0x523c49){_0x53f93f=_0x53f93f-0x0;var _0x56670d=_0xc0d7[_0x53f93f];return _0x56670d;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x7c0d('0x0'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x7c0d('0x1')]}}; \ No newline at end of file +var _0x225b=['STRING','sequelize','exports','name'];(function(_0x2faab7,_0x432fab){var _0x26902f=function(_0x103f99){while(--_0x103f99){_0x2faab7['push'](_0x2faab7['shift']());}};_0x26902f(++_0x432fab);}(_0x225b,0xb1));var _0xb225=function(_0x3905d9,_0x21bec1){_0x3905d9=_0x3905d9-0x0;var _0xb53d91=_0x225b[_0x3905d9];return _0xb53d91;};'use strict';var Sequelize=require(_0xb225('0x0'));module[_0xb225('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xb225('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xb225('0x3')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 69b803e..60077ef 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 _0x68d6=['index','MailSubstatus','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','field','merge','includeAll','findAll','rows','catch','show','params','include','options','find','create','body','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','status','end','count','offset','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send'];(function(_0xf66725,_0x255917){var _0x2b4eb5=function(_0x38a570){while(--_0x38a570){_0xf66725['push'](_0xf66725['shift']());}};_0x2b4eb5(++_0x255917);}(_0x68d6,0x71));var _0x668d=function(_0x36ed3c,_0x44a00a){_0x36ed3c=_0x36ed3c-0x0;var _0x52a2e0=_0x68d6[_0x36ed3c];return _0x52a2e0;};'use strict';var pdf=require(_0x668d('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x668d('0x1'));var zipdir=require(_0x668d('0x2'));var jsonpatch=require(_0x668d('0x3'));var rp=require(_0x668d('0x4'));var moment=require(_0x668d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x668d('0x6'));var util=require('util');var path=require(_0x668d('0x7'));var sox=require(_0x668d('0x8'));var csv=require(_0x668d('0x9'));var ejs=require(_0x668d('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x668d('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x668d('0x9'));var querystring=require(_0x668d('0xc'));var Papa=require(_0x668d('0xd'));var Redis=require('ioredis');var authService=require(_0x668d('0xe'));var qs=require(_0x668d('0xf'));var as=require(_0x668d('0x10'));var hardwareService=require(_0x668d('0x11'));var logger=require('../../config/logger')(_0x668d('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x668d('0x13'))['db'];function respondWithStatusCode(_0x338f59,_0x480c50){_0x480c50=_0x480c50||0xcc;return function(_0x1c1e2c){if(_0x1c1e2c){return _0x338f59[_0x668d('0x14')](_0x480c50);}return _0x338f59[_0x668d('0x15')](_0x480c50)[_0x668d('0x16')]();};}function respondWithResult(_0x1f67a9,_0x124d8b){_0x124d8b=_0x124d8b||0xc8;return function(_0x1a1335){if(_0x1a1335){return _0x1f67a9['status'](_0x124d8b)['json'](_0x1a1335);}};}function respondWithFilteredResult(_0x523f32,_0x3c546d){return function(_0x5ae7f5){if(_0x5ae7f5){var _0x3a15f8=_0x5ae7f5[_0x668d('0x17')],_0x5326b6=_0x3c546d[_0x668d('0x18')],_0x1f5d33=_0x3c546d[_0x668d('0x18')]+_0x3c546d['limit'],_0x43917d;if(_0x1f5d33>=_0x3a15f8){_0x1f5d33=_0x3a15f8;_0x43917d=0xc8;}else{_0x43917d=0xce;}_0x523f32[_0x668d('0x15')](_0x43917d);return _0x523f32[_0x668d('0x19')](_0x668d('0x1a'),_0x5326b6+'-'+_0x1f5d33+'/'+_0x3a15f8)[_0x668d('0x1b')](_0x5ae7f5);}return null;};}function patchUpdates(_0x3ed745){return function(_0x26ca39){try{jsonpatch[_0x668d('0x1c')](_0x26ca39,_0x3ed745,!![]);}catch(_0x521310){return BPromise['reject'](_0x521310);}return _0x26ca39[_0x668d('0x1d')]();};}function saveUpdates(_0x18512e,_0x10c3c0){return function(_0x3b5f1a){if(_0x3b5f1a){return _0x3b5f1a[_0x668d('0x1e')](_0x18512e)[_0x668d('0x1f')](function(_0x212a1c){return _0x212a1c;});}return null;};}function removeEntity(_0xcc7db1,_0x23ec67){return function(_0x427cc8){if(_0x427cc8){return _0x427cc8[_0x668d('0x20')]()['then'](function(){_0xcc7db1[_0x668d('0x15')](0xcc)[_0x668d('0x16')]();});}};}function handleEntityNotFound(_0x5a5655,_0x22db0f){return function(_0x10f83a){if(!_0x10f83a){_0x5a5655[_0x668d('0x14')](0x194);}return _0x10f83a;};}function handleError(_0x2e348b,_0x501c69){_0x501c69=_0x501c69||0x1f4;return function(_0xffaba8){logger[_0x668d('0x21')](_0xffaba8[_0x668d('0x22')]);if(_0xffaba8[_0x668d('0x23')]){delete _0xffaba8[_0x668d('0x23')];}_0x2e348b['status'](_0x501c69)[_0x668d('0x24')](_0xffaba8);};}exports[_0x668d('0x25')]=function(_0x1cb0dc,_0x3894f9){var _0x119881={},_0x2922f9={},_0x4839c6={'count':0x0,'rows':[]};var _0xf725da=_['map'](db[_0x668d('0x26')][_0x668d('0x27')],function(_0x1fe2d7){return{'name':_0x1fe2d7[_0x668d('0x28')],'type':_0x1fe2d7[_0x668d('0x29')][_0x668d('0x2a')]};});_0x2922f9['model']=_[_0x668d('0x2b')](_0xf725da,'name');_0x2922f9[_0x668d('0x2c')]=_[_0x668d('0x2d')](_0x1cb0dc[_0x668d('0x2c')]);_0x2922f9[_0x668d('0x2e')]=_[_0x668d('0x2f')](_0x2922f9[_0x668d('0x30')],_0x2922f9[_0x668d('0x2c')]);_0x119881[_0x668d('0x31')]=_[_0x668d('0x2f')](_0x2922f9[_0x668d('0x30')],qs['fields'](_0x1cb0dc[_0x668d('0x2c')][_0x668d('0x32')]));_0x119881[_0x668d('0x31')]=_0x119881['attributes'][_0x668d('0x33')]?_0x119881[_0x668d('0x31')]:_0x2922f9[_0x668d('0x30')];if(!_0x1cb0dc[_0x668d('0x2c')][_0x668d('0x34')](_0x668d('0x35'))){_0x119881[_0x668d('0x36')]=qs['limit'](_0x1cb0dc['query'][_0x668d('0x36')]);_0x119881['offset']=qs['offset'](_0x1cb0dc[_0x668d('0x2c')][_0x668d('0x18')]);}_0x119881[_0x668d('0x37')]=qs[_0x668d('0x38')](_0x1cb0dc[_0x668d('0x2c')][_0x668d('0x38')]);_0x119881[_0x668d('0x39')]=qs[_0x668d('0x2e')](_[_0x668d('0x3a')](_0x1cb0dc[_0x668d('0x2c')],_0x2922f9[_0x668d('0x2e')]));if(_0x1cb0dc[_0x668d('0x2c')][_0x668d('0x3b')]){_0x119881[_0x668d('0x39')]=_['merge'](_0x119881[_0x668d('0x39')],{'$or':_[_0x668d('0x2b')](_0xf725da,function(_0x38b357){if(_0x38b357[_0x668d('0x29')][_0x668d('0x2a')]!==_0x668d('0x3c')){var _0x5357a6={};_0x5357a6[_0x38b357[_0x668d('0x3d')]]={'$like':'%'+_0x1cb0dc[_0x668d('0x2c')][_0x668d('0x3b')]+'%'};return _0x5357a6;}})});}_0x119881=_[_0x668d('0x3e')]({},_0x119881,_0x1cb0dc['options']);var _0x29ea96={'where':_0x119881[_0x668d('0x39')]};return db[_0x668d('0x26')][_0x668d('0x17')](_0x29ea96)[_0x668d('0x1f')](function(_0x570f52){_0x4839c6['count']=_0x570f52;if(_0x1cb0dc[_0x668d('0x2c')][_0x668d('0x3f')]){_0x119881['include']=[{'all':!![]}];}return db[_0x668d('0x26')][_0x668d('0x40')](_0x119881);})[_0x668d('0x1f')](function(_0x353070){_0x4839c6[_0x668d('0x41')]=_0x353070;return _0x4839c6;})[_0x668d('0x1f')](respondWithFilteredResult(_0x3894f9,_0x119881))[_0x668d('0x42')](handleError(_0x3894f9,null));};exports[_0x668d('0x43')]=function(_0x226575,_0x482ffc){var _0x212257={'raw':!![],'where':{'id':_0x226575[_0x668d('0x44')]['id']}},_0x2caadc={};_0x2caadc[_0x668d('0x30')]=_[_0x668d('0x2d')](db['MailSubstatus'][_0x668d('0x27')]);_0x2caadc[_0x668d('0x2c')]=_['keys'](_0x226575[_0x668d('0x2c')]);_0x2caadc[_0x668d('0x2e')]=_[_0x668d('0x2f')](_0x2caadc[_0x668d('0x30')],_0x2caadc[_0x668d('0x2c')]);_0x212257['attributes']=_[_0x668d('0x2f')](_0x2caadc[_0x668d('0x30')],qs[_0x668d('0x32')](_0x226575['query'][_0x668d('0x32')]));_0x212257[_0x668d('0x31')]=_0x212257['attributes'][_0x668d('0x33')]?_0x212257['attributes']:_0x2caadc[_0x668d('0x30')];if(_0x226575[_0x668d('0x2c')][_0x668d('0x3f')]){_0x212257[_0x668d('0x45')]=[{'all':!![]}];}_0x212257=_[_0x668d('0x3e')]({},_0x212257,_0x226575[_0x668d('0x46')]);return db['MailSubstatus'][_0x668d('0x47')](_0x212257)[_0x668d('0x1f')](handleEntityNotFound(_0x482ffc,null))['then'](respondWithResult(_0x482ffc,null))[_0x668d('0x42')](handleError(_0x482ffc,null));};exports[_0x668d('0x48')]=function(_0x2df86e,_0x6949ec){return db[_0x668d('0x26')][_0x668d('0x48')](_0x2df86e['body'],{})['then'](respondWithResult(_0x6949ec,0xc9))[_0x668d('0x42')](handleError(_0x6949ec,null));};exports[_0x668d('0x1e')]=function(_0x2880ae,_0x5864ca){if(_0x2880ae['body']['id']){delete _0x2880ae[_0x668d('0x49')]['id'];}return db[_0x668d('0x26')]['find']({'where':{'id':_0x2880ae[_0x668d('0x44')]['id']}})[_0x668d('0x1f')](handleEntityNotFound(_0x5864ca,null))[_0x668d('0x1f')](saveUpdates(_0x2880ae[_0x668d('0x49')],null))[_0x668d('0x1f')](respondWithResult(_0x5864ca,null))[_0x668d('0x42')](handleError(_0x5864ca,null));};exports['destroy']=function(_0x502bf5,_0x357a46){return db[_0x668d('0x26')][_0x668d('0x47')]({'where':{'id':_0x502bf5[_0x668d('0x44')]['id']}})['then'](handleEntityNotFound(_0x357a46,null))[_0x668d('0x1f')](removeEntity(_0x357a46,null))[_0x668d('0x42')](handleError(_0x357a46,null));};exports[_0x668d('0x4a')]=function(_0x10bc39,_0x258ccb){return db[_0x668d('0x26')][_0x668d('0x4a')]()[_0x668d('0x1f')](respondWithResult(_0x258ccb,null))['catch'](handleError(_0x258ccb,null));}; \ No newline at end of file +var _0x3af6=['eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','error','stack','name','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','field','options','MailSubstatus','includeAll','include','findAll','catch','show','find','create','body','update','params','destroy','describe','html-pdf'];(function(_0x12fde6,_0x495409){var _0x4f19fd=function(_0x37e6fd){while(--_0x37e6fd){_0x12fde6['push'](_0x12fde6['shift']());}};_0x4f19fd(++_0x495409);}(_0x3af6,0x11f));var _0x63af=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x3af6[_0x432682];return _0x463d05;};'use strict';var pdf=require(_0x63af('0x0'));var emlformat=require(_0x63af('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x63af('0x2'));var rp=require(_0x63af('0x3'));var moment=require(_0x63af('0x4'));var BPromise=require(_0x63af('0x5'));var Mustache=require(_0x63af('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x63af('0x7'));var ejs=require(_0x63af('0x8'));var fs=require('fs');var _=require(_0x63af('0x9'));var squel=require(_0x63af('0xa'));var crypto=require('crypto');var jsforce=require(_0x63af('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x63af('0x7'));var querystring=require(_0x63af('0xc'));var Papa=require(_0x63af('0xd'));var Redis=require(_0x63af('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x63af('0xf'));var hardwareService=require(_0x63af('0x10'));var logger=require(_0x63af('0x11'))(_0x63af('0x12'));var utils=require(_0x63af('0x13'));var config=require(_0x63af('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x24011a,_0x340a85){_0x340a85=_0x340a85||0xcc;return function(_0x16fd48){if(_0x16fd48){return _0x24011a[_0x63af('0x15')](_0x340a85);}return _0x24011a[_0x63af('0x16')](_0x340a85)[_0x63af('0x17')]();};}function respondWithResult(_0x1bef09,_0x5ce1b3){_0x5ce1b3=_0x5ce1b3||0xc8;return function(_0x402f7e){if(_0x402f7e){return _0x1bef09[_0x63af('0x16')](_0x5ce1b3)[_0x63af('0x18')](_0x402f7e);}};}function respondWithFilteredResult(_0x391375,_0x181ef3){return function(_0x4fd6dd){if(_0x4fd6dd){var _0x53eea2=_0x4fd6dd[_0x63af('0x19')],_0x1b850e=_0x181ef3[_0x63af('0x1a')],_0x45a6f8=_0x181ef3['offset']+_0x181ef3[_0x63af('0x1b')],_0x3fae23;if(_0x45a6f8>=_0x53eea2){_0x45a6f8=_0x53eea2;_0x3fae23=0xc8;}else{_0x3fae23=0xce;}_0x391375['status'](_0x3fae23);return _0x391375[_0x63af('0x1c')](_0x63af('0x1d'),_0x1b850e+'-'+_0x45a6f8+'/'+_0x53eea2)['json'](_0x4fd6dd);}return null;};}function patchUpdates(_0x32d666){return function(_0x3a3c55){try{jsonpatch[_0x63af('0x1e')](_0x3a3c55,_0x32d666,!![]);}catch(_0x130255){return BPromise[_0x63af('0x1f')](_0x130255);}return _0x3a3c55[_0x63af('0x20')]();};}function saveUpdates(_0x50f50c,_0xa463a4){return function(_0x42d9d5){if(_0x42d9d5){return _0x42d9d5['update'](_0x50f50c)[_0x63af('0x21')](function(_0x20e0d7){return _0x20e0d7;});}return null;};}function removeEntity(_0x252106,_0x488ba1){return function(_0x3dab5e){if(_0x3dab5e){return _0x3dab5e['destroy']()[_0x63af('0x21')](function(){_0x252106[_0x63af('0x16')](0xcc)[_0x63af('0x17')]();});}};}function handleEntityNotFound(_0x589326,_0x359428){return function(_0x5e2045){if(!_0x5e2045){_0x589326[_0x63af('0x15')](0x194);}return _0x5e2045;};}function handleError(_0x33222a,_0x10b5fb){_0x10b5fb=_0x10b5fb||0x1f4;return function(_0x39b67e){logger[_0x63af('0x22')](_0x39b67e[_0x63af('0x23')]);if(_0x39b67e[_0x63af('0x24')]){delete _0x39b67e[_0x63af('0x24')];}_0x33222a['status'](_0x10b5fb)['send'](_0x39b67e);};}exports['index']=function(_0xb596a9,_0xc1c299){var _0x3deb17={},_0x508b91={},_0x5c6112={'count':0x0,'rows':[]};var _0x264367=_['map'](db['MailSubstatus'][_0x63af('0x25')],function(_0x13c62c){return{'name':_0x13c62c['fieldName'],'type':_0x13c62c[_0x63af('0x26')][_0x63af('0x27')]};});_0x508b91[_0x63af('0x28')]=_[_0x63af('0x29')](_0x264367,_0x63af('0x24'));_0x508b91[_0x63af('0x2a')]=_[_0x63af('0x2b')](_0xb596a9[_0x63af('0x2a')]);_0x508b91[_0x63af('0x2c')]=_[_0x63af('0x2d')](_0x508b91[_0x63af('0x28')],_0x508b91['query']);_0x3deb17[_0x63af('0x2e')]=_['intersection'](_0x508b91[_0x63af('0x28')],qs[_0x63af('0x2f')](_0xb596a9['query'][_0x63af('0x2f')]));_0x3deb17[_0x63af('0x2e')]=_0x3deb17['attributes'][_0x63af('0x30')]?_0x3deb17[_0x63af('0x2e')]:_0x508b91[_0x63af('0x28')];if(!_0xb596a9[_0x63af('0x2a')][_0x63af('0x31')]('nolimit')){_0x3deb17['limit']=qs[_0x63af('0x1b')](_0xb596a9[_0x63af('0x2a')][_0x63af('0x1b')]);_0x3deb17[_0x63af('0x1a')]=qs['offset'](_0xb596a9[_0x63af('0x2a')]['offset']);}_0x3deb17[_0x63af('0x32')]=qs['sort'](_0xb596a9[_0x63af('0x2a')][_0x63af('0x33')]);_0x3deb17[_0x63af('0x34')]=qs['filters'](_[_0x63af('0x35')](_0xb596a9[_0x63af('0x2a')],_0x508b91[_0x63af('0x2c')]));if(_0xb596a9[_0x63af('0x2a')][_0x63af('0x36')]){_0x3deb17['where']=_[_0x63af('0x37')](_0x3deb17['where'],{'$or':_['map'](_0x264367,function(_0x2a5e8a){if(_0x2a5e8a[_0x63af('0x26')][_0x63af('0x27')]!==_0x63af('0x38')){var _0x1ca293={};_0x1ca293[_0x2a5e8a[_0x63af('0x39')]]={'$like':'%'+_0xb596a9[_0x63af('0x2a')][_0x63af('0x36')]+'%'};return _0x1ca293;}})});}_0x3deb17=_['merge']({},_0x3deb17,_0xb596a9[_0x63af('0x3a')]);var _0x5ae21f={'where':_0x3deb17[_0x63af('0x34')]};return db[_0x63af('0x3b')]['count'](_0x5ae21f)[_0x63af('0x21')](function(_0x4b7808){_0x5c6112['count']=_0x4b7808;if(_0xb596a9[_0x63af('0x2a')][_0x63af('0x3c')]){_0x3deb17[_0x63af('0x3d')]=[{'all':!![]}];}return db[_0x63af('0x3b')][_0x63af('0x3e')](_0x3deb17);})[_0x63af('0x21')](function(_0x5becbb){_0x5c6112['rows']=_0x5becbb;return _0x5c6112;})[_0x63af('0x21')](respondWithFilteredResult(_0xc1c299,_0x3deb17))[_0x63af('0x3f')](handleError(_0xc1c299,null));};exports[_0x63af('0x40')]=function(_0x37c131,_0x57e410){var _0x56fddd={'raw':!![],'where':{'id':_0x37c131['params']['id']}},_0x160ca5={};_0x160ca5[_0x63af('0x28')]=_[_0x63af('0x2b')](db[_0x63af('0x3b')]['rawAttributes']);_0x160ca5['query']=_[_0x63af('0x2b')](_0x37c131[_0x63af('0x2a')]);_0x160ca5[_0x63af('0x2c')]=_[_0x63af('0x2d')](_0x160ca5[_0x63af('0x28')],_0x160ca5[_0x63af('0x2a')]);_0x56fddd['attributes']=_[_0x63af('0x2d')](_0x160ca5[_0x63af('0x28')],qs[_0x63af('0x2f')](_0x37c131['query']['fields']));_0x56fddd[_0x63af('0x2e')]=_0x56fddd[_0x63af('0x2e')][_0x63af('0x30')]?_0x56fddd[_0x63af('0x2e')]:_0x160ca5['model'];if(_0x37c131[_0x63af('0x2a')]['includeAll']){_0x56fddd[_0x63af('0x3d')]=[{'all':!![]}];}_0x56fddd=_[_0x63af('0x37')]({},_0x56fddd,_0x37c131[_0x63af('0x3a')]);return db[_0x63af('0x3b')][_0x63af('0x41')](_0x56fddd)['then'](handleEntityNotFound(_0x57e410,null))[_0x63af('0x21')](respondWithResult(_0x57e410,null))['catch'](handleError(_0x57e410,null));};exports[_0x63af('0x42')]=function(_0x4570de,_0x515286){return db[_0x63af('0x3b')][_0x63af('0x42')](_0x4570de[_0x63af('0x43')],{})['then'](respondWithResult(_0x515286,0xc9))[_0x63af('0x3f')](handleError(_0x515286,null));};exports[_0x63af('0x44')]=function(_0x951d6b,_0x25c5d0){if(_0x951d6b[_0x63af('0x43')]['id']){delete _0x951d6b[_0x63af('0x43')]['id'];}return db[_0x63af('0x3b')]['find']({'where':{'id':_0x951d6b[_0x63af('0x45')]['id']}})['then'](handleEntityNotFound(_0x25c5d0,null))[_0x63af('0x21')](saveUpdates(_0x951d6b[_0x63af('0x43')],null))[_0x63af('0x21')](respondWithResult(_0x25c5d0,null))['catch'](handleError(_0x25c5d0,null));};exports[_0x63af('0x46')]=function(_0x1a6bb1,_0x46df2d){return db[_0x63af('0x3b')]['find']({'where':{'id':_0x1a6bb1[_0x63af('0x45')]['id']}})[_0x63af('0x21')](handleEntityNotFound(_0x46df2d,null))[_0x63af('0x21')](removeEntity(_0x46df2d,null))[_0x63af('0x3f')](handleError(_0x46df2d,null));};exports[_0x63af('0x47')]=function(_0x2629f8,_0x386e11){return db['MailSubstatus'][_0x63af('0x47')]()[_0x63af('0x21')](respondWithResult(_0x386e11,null))['catch'](handleError(_0x386e11,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index f2412e7..9a915fb 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 _0x7df3=['define','lodash','util','api','bluebird','path','../../config/environment','./mailSubstatus.attributes','exports'];(function(_0xe19227,_0xc01bc7){var _0x5745b8=function(_0x46c47a){while(--_0x46c47a){_0xe19227['push'](_0xe19227['shift']());}};_0x5745b8(++_0xc01bc7);}(_0x7df3,0x1cc));var _0x37df=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x7df3[_0x4243a3];return _0x1b2a33;};'use strict';var _=require(_0x37df('0x0'));var util=require(_0x37df('0x1'));var logger=require('../../config/logger')(_0x37df('0x2'));var moment=require('moment');var BPromise=require(_0x37df('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x37df('0x4'));var rimraf=require('rimraf');var config=require(_0x37df('0x5'));var attributes=require(_0x37df('0x6'));module[_0x37df('0x7')]=function(_0x368888,_0x194c89){return _0x368888[_0x37df('0x8')]('MailSubstatus',attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc893=['path','rimraf','../../config/environment','./mailSubstatus.attributes','exports','define','MailSubstatus','mail_substatuses','util','../../config/logger','bluebird','request-promise'];(function(_0x1c127b,_0x324ada){var _0x847382=function(_0x651251){while(--_0x651251){_0x1c127b['push'](_0x1c127b['shift']());}};_0x847382(++_0x324ada);}(_0xc893,0x194));var _0x3c89=function(_0x521627,_0x58aadd){_0x521627=_0x521627-0x0;var _0xc2dacd=_0xc893[_0x521627];return _0xc2dacd;};'use strict';var _=require('lodash');var util=require(_0x3c89('0x0'));var logger=require(_0x3c89('0x1'))('api');var moment=require('moment');var BPromise=require(_0x3c89('0x2'));var rp=require(_0x3c89('0x3'));var fs=require('fs');var path=require(_0x3c89('0x4'));var rimraf=require(_0x3c89('0x5'));var config=require(_0x3c89('0x6'));var attributes=require(_0x3c89('0x7'));module[_0x3c89('0x8')]=function(_0x5f2803,_0x2e156d){return _0x5f2803[_0x3c89('0x9')](_0x3c89('0xa'),attributes,{'tableName':_0x3c89('0xb'),'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 40e6585..e27752f 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 _0xee5b=['../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','then','info','MailSubstatus,\x20%s,\x20%s','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','moment','bluebird','ioredis'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xee5b,0x1f4));var _0xbee5=function(_0x298212,_0x1ff4ee){_0x298212=_0x298212-0x0;var _0x5d26fa=_0xee5b[_0x298212];return _0x5d26fa;};'use strict';var _=require(_0xbee5('0x0'));var util=require('util');var moment=require(_0xbee5('0x1'));var BPromise=require(_0xbee5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbee5('0x3'));var db=require(_0xbee5('0x4'))['db'];var utils=require(_0xbee5('0x5'));var logger=require(_0xbee5('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbee5('0x7'));var client=jayson[_0xbee5('0x8')][_0xbee5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x804ab8,_0x4f5065,_0x5505e3){return new BPromise(function(_0x53d5b9,_0x5baf5c){return client['request'](_0x804ab8,_0x5505e3)[_0xbee5('0xa')](function(_0x7dda04){logger[_0xbee5('0xb')](_0xbee5('0xc'),_0x4f5065,'request\x20sent');logger[_0xbee5('0xd')](_0xbee5('0xe'),_0x4f5065,_0xbee5('0xf'),JSON[_0xbee5('0x10')](_0x7dda04));if(_0x7dda04[_0xbee5('0x11')]){if(_0x7dda04[_0xbee5('0x11')][_0xbee5('0x12')]===0x1f4){logger[_0xbee5('0x11')](_0xbee5('0xc'),_0x4f5065,_0x7dda04['error'][_0xbee5('0x13')]);return _0x5baf5c(_0x7dda04['error'][_0xbee5('0x13')]);}logger[_0xbee5('0x11')](_0xbee5('0xc'),_0x4f5065,_0x7dda04['error']['message']);return _0x53d5b9(_0x7dda04[_0xbee5('0x11')]['message']);}else{logger[_0xbee5('0xb')]('MailSubstatus,\x20%s,\x20%s',_0x4f5065,_0xbee5('0xf'));_0x53d5b9(_0x7dda04[_0xbee5('0x14')][_0xbee5('0x13')]);}})['catch'](function(_0x27e034){logger[_0xbee5('0x11')]('MailSubstatus,\x20%s,\x20%s',_0x4f5065,_0x27e034);_0x5baf5c(_0x27e034);});});} \ No newline at end of file +var _0xec56=['http','request','then','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\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(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0xec56,0x1bd));var _0x6ec5=function(_0x477b04,_0x42afb4){_0x477b04=_0x477b04-0x0;var _0x3e25bd=_0xec56[_0x477b04];return _0x3e25bd;};'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')]('MailSubstatus,\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/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 2568061..d5ea883 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 _0x923e=['update','delete','destroy','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./mailTransferReport.controller','get','isAuthenticated','/describe','/:id','show','post','create'];(function(_0x4b318e,_0x15fe4f){var _0x3b6a2f=function(_0x3b2c44){while(--_0x3b2c44){_0x4b318e['push'](_0x4b318e['shift']());}};_0x3b6a2f(++_0x15fe4f);}(_0x923e,0xbe));var _0xe923=function(_0x8161c8,_0x50dfbd){_0x8161c8=_0x8161c8-0x0;var _0x4bcacf=_0x923e[_0x8161c8];return _0x4bcacf;};'use strict';var multer=require(_0xe923('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xe923('0x1'));var express=require(_0xe923('0x2'));var router=express[_0xe923('0x3')]();var auth=require(_0xe923('0x4'));var interaction=require(_0xe923('0x5'));var config=require('../../config/environment');var controller=require(_0xe923('0x6'));router[_0xe923('0x7')]('/',auth[_0xe923('0x8')](),controller['index']);router['get'](_0xe923('0x9'),auth[_0xe923('0x8')](),controller['describe']);router[_0xe923('0x7')](_0xe923('0xa'),auth['isAuthenticated'](),controller[_0xe923('0xb')]);router[_0xe923('0xc')]('/',auth['isAuthenticated'](),controller[_0xe923('0xd')]);router['put'](_0xe923('0xa'),auth[_0xe923('0x8')](),controller[_0xe923('0xe')]);router[_0xe923('0xf')](_0xe923('0xa'),auth[_0xe923('0x8')](),controller[_0xe923('0x10')]);module['exports']=router; \ No newline at end of file +var _0xa54e=['create','put','update','delete','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show'];(function(_0x4cfdb0,_0x2dd36c){var _0x1d17b5=function(_0x24cb1a){while(--_0x24cb1a){_0x4cfdb0['push'](_0x4cfdb0['shift']());}};_0x1d17b5(++_0x2dd36c);}(_0xa54e,0x16c));var _0xea54=function(_0xead5f0,_0x30581c){_0xead5f0=_0xead5f0-0x0;var _0x73c2a6=_0xa54e[_0xead5f0];return _0x73c2a6;};'use strict';var multer=require(_0xea54('0x0'));var util=require(_0xea54('0x1'));var path=require('path');var timeout=require(_0xea54('0x2'));var express=require('express');var router=express[_0xea54('0x3')]();var auth=require(_0xea54('0x4'));var interaction=require(_0xea54('0x5'));var config=require(_0xea54('0x6'));var controller=require(_0xea54('0x7'));router[_0xea54('0x8')]('/',auth[_0xea54('0x9')](),controller[_0xea54('0xa')]);router[_0xea54('0x8')](_0xea54('0xb'),auth[_0xea54('0x9')](),controller['describe']);router['get'](_0xea54('0xc'),auth[_0xea54('0x9')](),controller[_0xea54('0xd')]);router['post']('/',auth[_0xea54('0x9')](),controller[_0xea54('0xe')]);router[_0xea54('0xf')](_0xea54('0xc'),auth[_0xea54('0x9')](),controller[_0xea54('0x10')]);router[_0xea54('0x11')](_0xea54('0xc'),auth[_0xea54('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 7f784ea..e687797 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 _0x7d89=['sequelize','exports','STRING','ENUM','account','agent','queue','NOW','moment'];(function(_0x561018,_0x2756bc){var _0x460239=function(_0x166841){while(--_0x166841){_0x561018['push'](_0x561018['shift']());}};_0x460239(++_0x2756bc);}(_0x7d89,0x19d));var _0x97d8=function(_0x477323,_0x2c1de5){_0x477323=_0x477323-0x0;var _0x141f39=_0x7d89[_0x477323];return _0x141f39;};'use strict';var moment=require(_0x97d8('0x0'));var Sequelize=require(_0x97d8('0x1'));module[_0x97d8('0x2')]={'uniqueid':{'type':Sequelize[_0x97d8('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x97d8('0x4')](_0x97d8('0x5'),_0x97d8('0x6'),_0x97d8('0x7')),'allowNull':![],'defaultValue':_0x97d8('0x7')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x97d8('0x8')]}}; \ No newline at end of file +var _0xfc48=['queue','DATE','NOW','moment','exports','STRING','ENUM','account'];(function(_0x3125e4,_0x493986){var _0x4508b0=function(_0x26185f){while(--_0x26185f){_0x3125e4['push'](_0x3125e4['shift']());}};_0x4508b0(++_0x493986);}(_0xfc48,0x1d3));var _0x8fc4=function(_0x40ade7,_0x53dba8){_0x40ade7=_0x40ade7-0x0;var _0x187887=_0xfc48[_0x40ade7];return _0x187887;};'use strict';var moment=require(_0x8fc4('0x0'));var Sequelize=require('sequelize');module[_0x8fc4('0x1')]={'uniqueid':{'type':Sequelize[_0x8fc4('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x8fc4('0x3')](_0x8fc4('0x4'),'agent',_0x8fc4('0x5')),'allowNull':![],'defaultValue':_0x8fc4('0x5')},'transferredAt':{'type':Sequelize[_0x8fc4('0x6')],'allowNull':![],'defaultValue':Sequelize[_0x8fc4('0x7')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index fa1e802..b55d57e 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 _0xe706=['destroy','find','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','count','limit','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','offset','sort','where','pick','filter','merge','VIRTUAL','field','options','MailTransferReport','includeAll','include','findAll','rows','params','catch','create','body'];(function(_0x3b0dbd,_0x2b884c){var _0x7cb5e1=function(_0xea49ee){while(--_0xea49ee){_0x3b0dbd['push'](_0x3b0dbd['shift']());}};_0x7cb5e1(++_0x2b884c);}(_0xe706,0xa3));var _0x6e70=function(_0x27c248,_0x384dff){_0x27c248=_0x27c248-0x0;var _0x1b2fc2=_0xe706[_0x27c248];return _0x1b2fc2;};'use strict';var pdf=require(_0x6e70('0x0'));var emlformat=require(_0x6e70('0x1'));var rimraf=require(_0x6e70('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6e70('0x3'));var rp=require(_0x6e70('0x4'));var moment=require(_0x6e70('0x5'));var BPromise=require(_0x6e70('0x6'));var Mustache=require(_0x6e70('0x7'));var util=require(_0x6e70('0x8'));var path=require(_0x6e70('0x9'));var sox=require(_0x6e70('0xa'));var csv=require(_0x6e70('0xb'));var ejs=require(_0x6e70('0xc'));var fs=require('fs');var _=require(_0x6e70('0xd'));var squel=require(_0x6e70('0xe'));var crypto=require(_0x6e70('0xf'));var jsforce=require(_0x6e70('0x10'));var deskjs=require(_0x6e70('0x11'));var toCsv=require(_0x6e70('0xb'));var querystring=require(_0x6e70('0x12'));var Papa=require(_0x6e70('0x13'));var Redis=require(_0x6e70('0x14'));var authService=require(_0x6e70('0x15'));var qs=require(_0x6e70('0x16'));var as=require(_0x6e70('0x17'));var hardwareService=require(_0x6e70('0x18'));var logger=require(_0x6e70('0x19'))('api');var utils=require('../../config/utils');var config=require(_0x6e70('0x1a'));var db=require(_0x6e70('0x1b'))['db'];function respondWithStatusCode(_0x18cf27,_0x27dd9b){_0x27dd9b=_0x27dd9b||0xcc;return function(_0x3b38f3){if(_0x3b38f3){return _0x18cf27[_0x6e70('0x1c')](_0x27dd9b);}return _0x18cf27[_0x6e70('0x1d')](_0x27dd9b)[_0x6e70('0x1e')]();};}function respondWithResult(_0x5dfbaa,_0x52737e){_0x52737e=_0x52737e||0xc8;return function(_0x48bc72){if(_0x48bc72){return _0x5dfbaa[_0x6e70('0x1d')](_0x52737e)['json'](_0x48bc72);}};}function respondWithFilteredResult(_0x53aed0,_0x304716){return function(_0x22c50c){if(_0x22c50c){var _0x5d9263=_0x22c50c[_0x6e70('0x1f')],_0x24f3ac=_0x304716['offset'],_0x5c3fe7=_0x304716['offset']+_0x304716[_0x6e70('0x20')],_0x2efc0f;if(_0x5c3fe7>=_0x5d9263){_0x5c3fe7=_0x5d9263;_0x2efc0f=0xc8;}else{_0x2efc0f=0xce;}_0x53aed0['status'](_0x2efc0f);return _0x53aed0[_0x6e70('0x21')](_0x6e70('0x22'),_0x24f3ac+'-'+_0x5c3fe7+'/'+_0x5d9263)['json'](_0x22c50c);}return null;};}function patchUpdates(_0x497d61){return function(_0xc238ba){try{jsonpatch[_0x6e70('0x23')](_0xc238ba,_0x497d61,!![]);}catch(_0x2368eb){return BPromise[_0x6e70('0x24')](_0x2368eb);}return _0xc238ba[_0x6e70('0x25')]();};}function saveUpdates(_0xcdf9f2,_0x1b2453){return function(_0x44a49f){if(_0x44a49f){return _0x44a49f[_0x6e70('0x26')](_0xcdf9f2)[_0x6e70('0x27')](function(_0x4a0cfe){return _0x4a0cfe;});}return null;};}function removeEntity(_0x228350,_0x344b65){return function(_0x27b294){if(_0x27b294){return _0x27b294['destroy']()[_0x6e70('0x27')](function(){_0x228350[_0x6e70('0x1d')](0xcc)[_0x6e70('0x1e')]();});}};}function handleEntityNotFound(_0x50da2c,_0x10fc91){return function(_0x538b9c){if(!_0x538b9c){_0x50da2c['sendStatus'](0x194);}return _0x538b9c;};}function handleError(_0x4e97c7,_0x41e352){_0x41e352=_0x41e352||0x1f4;return function(_0x19c5ae){logger['error'](_0x19c5ae[_0x6e70('0x28')]);if(_0x19c5ae[_0x6e70('0x29')]){delete _0x19c5ae['name'];}_0x4e97c7[_0x6e70('0x1d')](_0x41e352)[_0x6e70('0x2a')](_0x19c5ae);};}exports[_0x6e70('0x2b')]=function(_0x4a67ac,_0x54a5fe){var _0x2c4d37={},_0x3af17f={},_0x83c836={'count':0x0,'rows':[]};var _0x114344=_[_0x6e70('0x2c')](db['MailTransferReport'][_0x6e70('0x2d')],function(_0x406f29){return{'name':_0x406f29[_0x6e70('0x2e')],'type':_0x406f29[_0x6e70('0x2f')][_0x6e70('0x30')]};});_0x3af17f[_0x6e70('0x31')]=_[_0x6e70('0x2c')](_0x114344,_0x6e70('0x29'));_0x3af17f[_0x6e70('0x32')]=_[_0x6e70('0x33')](_0x4a67ac['query']);_0x3af17f[_0x6e70('0x34')]=_['intersection'](_0x3af17f[_0x6e70('0x31')],_0x3af17f['query']);_0x2c4d37[_0x6e70('0x35')]=_[_0x6e70('0x36')](_0x3af17f[_0x6e70('0x31')],qs['fields'](_0x4a67ac[_0x6e70('0x32')][_0x6e70('0x37')]));_0x2c4d37['attributes']=_0x2c4d37[_0x6e70('0x35')][_0x6e70('0x38')]?_0x2c4d37['attributes']:_0x3af17f[_0x6e70('0x31')];if(!_0x4a67ac[_0x6e70('0x32')][_0x6e70('0x39')](_0x6e70('0x3a'))){_0x2c4d37[_0x6e70('0x20')]=qs[_0x6e70('0x20')](_0x4a67ac[_0x6e70('0x32')][_0x6e70('0x20')]);_0x2c4d37[_0x6e70('0x3b')]=qs[_0x6e70('0x3b')](_0x4a67ac['query'][_0x6e70('0x3b')]);}_0x2c4d37['order']=qs[_0x6e70('0x3c')](_0x4a67ac[_0x6e70('0x32')][_0x6e70('0x3c')]);_0x2c4d37[_0x6e70('0x3d')]=qs[_0x6e70('0x34')](_[_0x6e70('0x3e')](_0x4a67ac[_0x6e70('0x32')],_0x3af17f[_0x6e70('0x34')]));if(_0x4a67ac[_0x6e70('0x32')][_0x6e70('0x3f')]){_0x2c4d37[_0x6e70('0x3d')]=_[_0x6e70('0x40')](_0x2c4d37[_0x6e70('0x3d')],{'$or':_['map'](_0x114344,function(_0x5446a2){if(_0x5446a2['type'][_0x6e70('0x30')]!==_0x6e70('0x41')){var _0x2cb5b0={};_0x2cb5b0[_0x5446a2[_0x6e70('0x42')]]={'$like':'%'+_0x4a67ac[_0x6e70('0x32')][_0x6e70('0x3f')]+'%'};return _0x2cb5b0;}})});}_0x2c4d37=_['merge']({},_0x2c4d37,_0x4a67ac[_0x6e70('0x43')]);var _0x9e7ad2={'where':_0x2c4d37[_0x6e70('0x3d')]};return db[_0x6e70('0x44')][_0x6e70('0x1f')](_0x9e7ad2)[_0x6e70('0x27')](function(_0x246e61){_0x83c836[_0x6e70('0x1f')]=_0x246e61;if(_0x4a67ac['query'][_0x6e70('0x45')]){_0x2c4d37[_0x6e70('0x46')]=[{'all':!![]}];}return db[_0x6e70('0x44')][_0x6e70('0x47')](_0x2c4d37);})[_0x6e70('0x27')](function(_0x1de947){_0x83c836[_0x6e70('0x48')]=_0x1de947;return _0x83c836;})['then'](respondWithFilteredResult(_0x54a5fe,_0x2c4d37))['catch'](handleError(_0x54a5fe,null));};exports['show']=function(_0x154e0c,_0x2b63cc){var _0x83847b={'raw':!![],'where':{'id':_0x154e0c[_0x6e70('0x49')]['id']}},_0x64ff8e={};_0x64ff8e['model']=_[_0x6e70('0x33')](db[_0x6e70('0x44')][_0x6e70('0x2d')]);_0x64ff8e['query']=_['keys'](_0x154e0c['query']);_0x64ff8e[_0x6e70('0x34')]=_['intersection'](_0x64ff8e[_0x6e70('0x31')],_0x64ff8e[_0x6e70('0x32')]);_0x83847b[_0x6e70('0x35')]=_[_0x6e70('0x36')](_0x64ff8e['model'],qs[_0x6e70('0x37')](_0x154e0c['query'][_0x6e70('0x37')]));_0x83847b[_0x6e70('0x35')]=_0x83847b[_0x6e70('0x35')][_0x6e70('0x38')]?_0x83847b['attributes']:_0x64ff8e[_0x6e70('0x31')];if(_0x154e0c[_0x6e70('0x32')][_0x6e70('0x45')]){_0x83847b[_0x6e70('0x46')]=[{'all':!![]}];}_0x83847b=_[_0x6e70('0x40')]({},_0x83847b,_0x154e0c[_0x6e70('0x43')]);return db[_0x6e70('0x44')]['find'](_0x83847b)[_0x6e70('0x27')](handleEntityNotFound(_0x2b63cc,null))[_0x6e70('0x27')](respondWithResult(_0x2b63cc,null))[_0x6e70('0x4a')](handleError(_0x2b63cc,null));};exports[_0x6e70('0x4b')]=function(_0x3f86cf,_0x172e8a){return db[_0x6e70('0x44')]['create'](_0x3f86cf[_0x6e70('0x4c')],{})['then'](respondWithResult(_0x172e8a,0xc9))[_0x6e70('0x4a')](handleError(_0x172e8a,null));};exports[_0x6e70('0x26')]=function(_0x4b351e,_0x53efc3){if(_0x4b351e[_0x6e70('0x4c')]['id']){delete _0x4b351e[_0x6e70('0x4c')]['id'];}return db[_0x6e70('0x44')]['find']({'where':{'id':_0x4b351e['params']['id']}})[_0x6e70('0x27')](handleEntityNotFound(_0x53efc3,null))[_0x6e70('0x27')](saveUpdates(_0x4b351e[_0x6e70('0x4c')],null))[_0x6e70('0x27')](respondWithResult(_0x53efc3,null))[_0x6e70('0x4a')](handleError(_0x53efc3,null));};exports[_0x6e70('0x4d')]=function(_0x4ad5a9,_0x756a5b){return db[_0x6e70('0x44')][_0x6e70('0x4e')]({'where':{'id':_0x4ad5a9[_0x6e70('0x49')]['id']}})[_0x6e70('0x27')](handleEntityNotFound(_0x756a5b,null))['then'](removeEntity(_0x756a5b,null))['catch'](handleError(_0x756a5b,null));};exports[_0x6e70('0x4f')]=function(_0x2e3ea6,_0x34fdba){return db[_0x6e70('0x44')][_0x6e70('0x4f')]()['then'](respondWithResult(_0x34fdba,null))[_0x6e70('0x4a')](handleError(_0x34fdba,null));}; \ No newline at end of file +var _0xe706=['destroy','find','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','count','limit','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','offset','sort','where','pick','filter','merge','VIRTUAL','field','options','MailTransferReport','includeAll','include','findAll','rows','params','catch','create','body'];(function(_0x1f06da,_0x38d35e){var _0x4d556b=function(_0x1ef14b){while(--_0x1ef14b){_0x1f06da['push'](_0x1f06da['shift']());}};_0x4d556b(++_0x38d35e);}(_0xe706,0xa3));var _0x6e70=function(_0x151f72,_0x3117de){_0x151f72=_0x151f72-0x0;var _0x3ee71b=_0xe706[_0x151f72];return _0x3ee71b;};'use strict';var pdf=require(_0x6e70('0x0'));var emlformat=require(_0x6e70('0x1'));var rimraf=require(_0x6e70('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6e70('0x3'));var rp=require(_0x6e70('0x4'));var moment=require(_0x6e70('0x5'));var BPromise=require(_0x6e70('0x6'));var Mustache=require(_0x6e70('0x7'));var util=require(_0x6e70('0x8'));var path=require(_0x6e70('0x9'));var sox=require(_0x6e70('0xa'));var csv=require(_0x6e70('0xb'));var ejs=require(_0x6e70('0xc'));var fs=require('fs');var _=require(_0x6e70('0xd'));var squel=require(_0x6e70('0xe'));var crypto=require(_0x6e70('0xf'));var jsforce=require(_0x6e70('0x10'));var deskjs=require(_0x6e70('0x11'));var toCsv=require(_0x6e70('0xb'));var querystring=require(_0x6e70('0x12'));var Papa=require(_0x6e70('0x13'));var Redis=require(_0x6e70('0x14'));var authService=require(_0x6e70('0x15'));var qs=require(_0x6e70('0x16'));var as=require(_0x6e70('0x17'));var hardwareService=require(_0x6e70('0x18'));var logger=require(_0x6e70('0x19'))('api');var utils=require('../../config/utils');var config=require(_0x6e70('0x1a'));var db=require(_0x6e70('0x1b'))['db'];function respondWithStatusCode(_0x18cf27,_0x27dd9b){_0x27dd9b=_0x27dd9b||0xcc;return function(_0x3b38f3){if(_0x3b38f3){return _0x18cf27[_0x6e70('0x1c')](_0x27dd9b);}return _0x18cf27[_0x6e70('0x1d')](_0x27dd9b)[_0x6e70('0x1e')]();};}function respondWithResult(_0x5dfbaa,_0x52737e){_0x52737e=_0x52737e||0xc8;return function(_0x48bc72){if(_0x48bc72){return _0x5dfbaa[_0x6e70('0x1d')](_0x52737e)['json'](_0x48bc72);}};}function respondWithFilteredResult(_0x53aed0,_0x304716){return function(_0x22c50c){if(_0x22c50c){var _0x5d9263=_0x22c50c[_0x6e70('0x1f')],_0x24f3ac=_0x304716['offset'],_0x5c3fe7=_0x304716['offset']+_0x304716[_0x6e70('0x20')],_0x2efc0f;if(_0x5c3fe7>=_0x5d9263){_0x5c3fe7=_0x5d9263;_0x2efc0f=0xc8;}else{_0x2efc0f=0xce;}_0x53aed0['status'](_0x2efc0f);return _0x53aed0[_0x6e70('0x21')](_0x6e70('0x22'),_0x24f3ac+'-'+_0x5c3fe7+'/'+_0x5d9263)['json'](_0x22c50c);}return null;};}function patchUpdates(_0x497d61){return function(_0xc238ba){try{jsonpatch[_0x6e70('0x23')](_0xc238ba,_0x497d61,!![]);}catch(_0x2368eb){return BPromise[_0x6e70('0x24')](_0x2368eb);}return _0xc238ba[_0x6e70('0x25')]();};}function saveUpdates(_0xcdf9f2,_0x1b2453){return function(_0x44a49f){if(_0x44a49f){return _0x44a49f[_0x6e70('0x26')](_0xcdf9f2)[_0x6e70('0x27')](function(_0x4a0cfe){return _0x4a0cfe;});}return null;};}function removeEntity(_0x228350,_0x344b65){return function(_0x27b294){if(_0x27b294){return _0x27b294['destroy']()[_0x6e70('0x27')](function(){_0x228350[_0x6e70('0x1d')](0xcc)[_0x6e70('0x1e')]();});}};}function handleEntityNotFound(_0x50da2c,_0x10fc91){return function(_0x538b9c){if(!_0x538b9c){_0x50da2c['sendStatus'](0x194);}return _0x538b9c;};}function handleError(_0x4e97c7,_0x41e352){_0x41e352=_0x41e352||0x1f4;return function(_0x19c5ae){logger['error'](_0x19c5ae[_0x6e70('0x28')]);if(_0x19c5ae[_0x6e70('0x29')]){delete _0x19c5ae['name'];}_0x4e97c7[_0x6e70('0x1d')](_0x41e352)[_0x6e70('0x2a')](_0x19c5ae);};}exports[_0x6e70('0x2b')]=function(_0x4a67ac,_0x54a5fe){var _0x2c4d37={},_0x3af17f={},_0x83c836={'count':0x0,'rows':[]};var _0x114344=_[_0x6e70('0x2c')](db['MailTransferReport'][_0x6e70('0x2d')],function(_0x406f29){return{'name':_0x406f29[_0x6e70('0x2e')],'type':_0x406f29[_0x6e70('0x2f')][_0x6e70('0x30')]};});_0x3af17f[_0x6e70('0x31')]=_[_0x6e70('0x2c')](_0x114344,_0x6e70('0x29'));_0x3af17f[_0x6e70('0x32')]=_[_0x6e70('0x33')](_0x4a67ac['query']);_0x3af17f[_0x6e70('0x34')]=_['intersection'](_0x3af17f[_0x6e70('0x31')],_0x3af17f['query']);_0x2c4d37[_0x6e70('0x35')]=_[_0x6e70('0x36')](_0x3af17f[_0x6e70('0x31')],qs['fields'](_0x4a67ac[_0x6e70('0x32')][_0x6e70('0x37')]));_0x2c4d37['attributes']=_0x2c4d37[_0x6e70('0x35')][_0x6e70('0x38')]?_0x2c4d37['attributes']:_0x3af17f[_0x6e70('0x31')];if(!_0x4a67ac[_0x6e70('0x32')][_0x6e70('0x39')](_0x6e70('0x3a'))){_0x2c4d37[_0x6e70('0x20')]=qs[_0x6e70('0x20')](_0x4a67ac[_0x6e70('0x32')][_0x6e70('0x20')]);_0x2c4d37[_0x6e70('0x3b')]=qs[_0x6e70('0x3b')](_0x4a67ac['query'][_0x6e70('0x3b')]);}_0x2c4d37['order']=qs[_0x6e70('0x3c')](_0x4a67ac[_0x6e70('0x32')][_0x6e70('0x3c')]);_0x2c4d37[_0x6e70('0x3d')]=qs[_0x6e70('0x34')](_[_0x6e70('0x3e')](_0x4a67ac[_0x6e70('0x32')],_0x3af17f[_0x6e70('0x34')]));if(_0x4a67ac[_0x6e70('0x32')][_0x6e70('0x3f')]){_0x2c4d37[_0x6e70('0x3d')]=_[_0x6e70('0x40')](_0x2c4d37[_0x6e70('0x3d')],{'$or':_['map'](_0x114344,function(_0x5446a2){if(_0x5446a2['type'][_0x6e70('0x30')]!==_0x6e70('0x41')){var _0x2cb5b0={};_0x2cb5b0[_0x5446a2[_0x6e70('0x42')]]={'$like':'%'+_0x4a67ac[_0x6e70('0x32')][_0x6e70('0x3f')]+'%'};return _0x2cb5b0;}})});}_0x2c4d37=_['merge']({},_0x2c4d37,_0x4a67ac[_0x6e70('0x43')]);var _0x9e7ad2={'where':_0x2c4d37[_0x6e70('0x3d')]};return db[_0x6e70('0x44')][_0x6e70('0x1f')](_0x9e7ad2)[_0x6e70('0x27')](function(_0x246e61){_0x83c836[_0x6e70('0x1f')]=_0x246e61;if(_0x4a67ac['query'][_0x6e70('0x45')]){_0x2c4d37[_0x6e70('0x46')]=[{'all':!![]}];}return db[_0x6e70('0x44')][_0x6e70('0x47')](_0x2c4d37);})[_0x6e70('0x27')](function(_0x1de947){_0x83c836[_0x6e70('0x48')]=_0x1de947;return _0x83c836;})['then'](respondWithFilteredResult(_0x54a5fe,_0x2c4d37))['catch'](handleError(_0x54a5fe,null));};exports['show']=function(_0x154e0c,_0x2b63cc){var _0x83847b={'raw':!![],'where':{'id':_0x154e0c[_0x6e70('0x49')]['id']}},_0x64ff8e={};_0x64ff8e['model']=_[_0x6e70('0x33')](db[_0x6e70('0x44')][_0x6e70('0x2d')]);_0x64ff8e['query']=_['keys'](_0x154e0c['query']);_0x64ff8e[_0x6e70('0x34')]=_['intersection'](_0x64ff8e[_0x6e70('0x31')],_0x64ff8e[_0x6e70('0x32')]);_0x83847b[_0x6e70('0x35')]=_[_0x6e70('0x36')](_0x64ff8e['model'],qs[_0x6e70('0x37')](_0x154e0c['query'][_0x6e70('0x37')]));_0x83847b[_0x6e70('0x35')]=_0x83847b[_0x6e70('0x35')][_0x6e70('0x38')]?_0x83847b['attributes']:_0x64ff8e[_0x6e70('0x31')];if(_0x154e0c[_0x6e70('0x32')][_0x6e70('0x45')]){_0x83847b[_0x6e70('0x46')]=[{'all':!![]}];}_0x83847b=_[_0x6e70('0x40')]({},_0x83847b,_0x154e0c[_0x6e70('0x43')]);return db[_0x6e70('0x44')]['find'](_0x83847b)[_0x6e70('0x27')](handleEntityNotFound(_0x2b63cc,null))[_0x6e70('0x27')](respondWithResult(_0x2b63cc,null))[_0x6e70('0x4a')](handleError(_0x2b63cc,null));};exports[_0x6e70('0x4b')]=function(_0x3f86cf,_0x172e8a){return db[_0x6e70('0x44')]['create'](_0x3f86cf[_0x6e70('0x4c')],{})['then'](respondWithResult(_0x172e8a,0xc9))[_0x6e70('0x4a')](handleError(_0x172e8a,null));};exports[_0x6e70('0x26')]=function(_0x4b351e,_0x53efc3){if(_0x4b351e[_0x6e70('0x4c')]['id']){delete _0x4b351e[_0x6e70('0x4c')]['id'];}return db[_0x6e70('0x44')]['find']({'where':{'id':_0x4b351e['params']['id']}})[_0x6e70('0x27')](handleEntityNotFound(_0x53efc3,null))[_0x6e70('0x27')](saveUpdates(_0x4b351e[_0x6e70('0x4c')],null))[_0x6e70('0x27')](respondWithResult(_0x53efc3,null))[_0x6e70('0x4a')](handleError(_0x53efc3,null));};exports[_0x6e70('0x4d')]=function(_0x4ad5a9,_0x756a5b){return db[_0x6e70('0x44')][_0x6e70('0x4e')]({'where':{'id':_0x4ad5a9[_0x6e70('0x49')]['id']}})[_0x6e70('0x27')](handleEntityNotFound(_0x756a5b,null))['then'](removeEntity(_0x756a5b,null))['catch'](handleError(_0x756a5b,null));};exports[_0x6e70('0x4f')]=function(_0x2e3ea6,_0x34fdba){return db[_0x6e70('0x44')][_0x6e70('0x4f')]()['then'](respondWithResult(_0x34fdba,null))[_0x6e70('0x4a')](handleError(_0x34fdba,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index f005396..4784c26 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 _0x8eb7=['api','path','rimraf','./mailTransferReport.attributes','exports','MailTransferReport','report_mail_transfer','uniqueid','lodash','util'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x8eb7,0x1f2));var _0x78eb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8eb7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x78eb('0x0'));var util=require(_0x78eb('0x1'));var logger=require('../../config/logger')(_0x78eb('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x78eb('0x3'));var rimraf=require(_0x78eb('0x4'));var config=require('../../config/environment');var attributes=require(_0x78eb('0x5'));module[_0x78eb('0x6')]=function(_0x23d22e,_0x33c478){return _0x23d22e['define'](_0x78eb('0x7'),attributes,{'tableName':_0x78eb('0x8'),'paranoid':![],'indexes':[{'name':_0x78eb('0x9'),'fields':[_0x78eb('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x676d=['../../config/environment','./mailTransferReport.attributes','exports','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','api','moment','bluebird','rimraf'];(function(_0x1bb0b8,_0x24add2){var _0x22fc67=function(_0x2e051d){while(--_0x2e051d){_0x1bb0b8['push'](_0x1bb0b8['shift']());}};_0x22fc67(++_0x24add2);}(_0x676d,0xaf));var _0xd676=function(_0x21bb9b,_0x356f8a){_0x21bb9b=_0x21bb9b-0x0;var _0xda9639=_0x676d[_0x21bb9b];return _0xda9639;};'use strict';var _=require(_0xd676('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd676('0x1'));var moment=require(_0xd676('0x2'));var BPromise=require(_0xd676('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd676('0x4'));var config=require(_0xd676('0x5'));var attributes=require(_0xd676('0x6'));module[_0xd676('0x7')]=function(_0x1056f4,_0xb810c){return _0x1056f4[_0xd676('0x8')](_0xd676('0x9'),attributes,{'tableName':_0xd676('0xa'),'paranoid':![],'indexes':[{'name':_0xd676('0xb'),'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 66b5b32..c79ec4a 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 _0xeaef=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xeaef,0x137));var _0xfeae=function(_0x1dc703,_0x5708ff){_0x1dc703=_0x1dc703-0x0;var _0x2e53c5=_0xeaef[_0x1dc703];return _0x2e53c5;};'use strict';var _=require('lodash');var util=require(_0xfeae('0x0'));var moment=require(_0xfeae('0x1'));var BPromise=require(_0xfeae('0x2'));var rs=require(_0xfeae('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfeae('0x4'))['db'];var utils=require(_0xfeae('0x5'));var logger=require(_0xfeae('0x6'))('rpc');var config=require(_0xfeae('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xfeae('0x8')][_0xfeae('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2bc597,_0x1cb82f,_0x18fa96){return new BPromise(function(_0x416d1b,_0x19cf3e){return client[_0xfeae('0xa')](_0x2bc597,_0x18fa96)['then'](function(_0x272e12){logger[_0xfeae('0xb')](_0xfeae('0xc'),_0x1cb82f,_0xfeae('0xd'));logger[_0xfeae('0xe')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x1cb82f,_0xfeae('0xd'),JSON[_0xfeae('0xf')](_0x272e12));if(_0x272e12[_0xfeae('0x10')]){if(_0x272e12['error'][_0xfeae('0x11')]===0x1f4){logger[_0xfeae('0x10')](_0xfeae('0xc'),_0x1cb82f,_0x272e12[_0xfeae('0x10')][_0xfeae('0x12')]);return _0x19cf3e(_0x272e12[_0xfeae('0x10')]['message']);}logger[_0xfeae('0x10')](_0xfeae('0xc'),_0x1cb82f,_0x272e12[_0xfeae('0x10')][_0xfeae('0x12')]);return _0x416d1b(_0x272e12[_0xfeae('0x10')][_0xfeae('0x12')]);}else{logger[_0xfeae('0xb')](_0xfeae('0xc'),_0x1cb82f,_0xfeae('0xd'));_0x416d1b(_0x272e12[_0xfeae('0x13')][_0xfeae('0x12')]);}})[_0xfeae('0x14')](function(_0x1a4f6b){logger[_0xfeae('0x10')](_0xfeae('0xc'),_0x1cb82f,_0x1a4f6b);_0x19cf3e(_0x1a4f6b);});});} \ No newline at end of file +var _0x247f=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x2deac4,_0xc27a2b){var _0x1c0bda=function(_0x1deceb){while(--_0x1deceb){_0x2deac4['push'](_0x2deac4['shift']());}};_0x1c0bda(++_0xc27a2b);}(_0x247f,0x73));var _0xf247=function(_0x11a014,_0x1d343b){_0x11a014=_0x11a014-0x0;var _0x4f238c=_0x247f[_0x11a014];return _0x4f238c;};'use strict';var _=require(_0xf247('0x0'));var util=require(_0xf247('0x1'));var moment=require('moment');var BPromise=require(_0xf247('0x2'));var rs=require(_0xf247('0x3'));var fs=require('fs');var Redis=require(_0xf247('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf247('0x5'));var logger=require(_0xf247('0x6'))(_0xf247('0x7'));var config=require('../../config/environment');var jayson=require(_0xf247('0x8'));var client=jayson[_0xf247('0x9')][_0xf247('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x33b5e3,_0x4bad8f,_0x5582d1){return new BPromise(function(_0x466df3,_0x1df6b3){return client['request'](_0x33b5e3,_0x5582d1)[_0xf247('0xb')](function(_0x142ebd){logger[_0xf247('0xc')](_0xf247('0xd'),_0x4bad8f,_0xf247('0xe'));logger[_0xf247('0xf')](_0xf247('0x10'),_0x4bad8f,_0xf247('0xe'),JSON['stringify'](_0x142ebd));if(_0x142ebd[_0xf247('0x11')]){if(_0x142ebd[_0xf247('0x11')]['code']===0x1f4){logger[_0xf247('0x11')](_0xf247('0xd'),_0x4bad8f,_0x142ebd[_0xf247('0x11')][_0xf247('0x12')]);return _0x1df6b3(_0x142ebd[_0xf247('0x11')][_0xf247('0x12')]);}logger['error']('MailTransferReport,\x20%s,\x20%s',_0x4bad8f,_0x142ebd[_0xf247('0x11')][_0xf247('0x12')]);return _0x466df3(_0x142ebd[_0xf247('0x11')][_0xf247('0x12')]);}else{logger['info'](_0xf247('0xd'),_0x4bad8f,'request\x20sent');_0x466df3(_0x142ebd['result'][_0xf247('0x12')]);}})[_0xf247('0x13')](function(_0x192f45){logger['error'](_0xf247('0xd'),_0x4bad8f,_0x192f45);_0x1df6b3(_0x192f45);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index a6910fb..042ed2b 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 _0xf819=['get','isAuthenticated','index','/describe','describe','show','post','create','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller'];(function(_0x4d5a2f,_0x2b3f5a){var _0x50e26a=function(_0x1f8c38){while(--_0x1f8c38){_0x4d5a2f['push'](_0x4d5a2f['shift']());}};_0x50e26a(++_0x2b3f5a);}(_0xf819,0xe9));var _0x9f81=function(_0x1a5cd7,_0x3811e9){_0x1a5cd7=_0x1a5cd7-0x0;var _0x399402=_0xf819[_0x1a5cd7];return _0x399402;};'use strict';var multer=require('multer');var util=require(_0x9f81('0x0'));var path=require(_0x9f81('0x1'));var timeout=require(_0x9f81('0x2'));var express=require(_0x9f81('0x3'));var router=express[_0x9f81('0x4')]();var auth=require(_0x9f81('0x5'));var interaction=require(_0x9f81('0x6'));var config=require(_0x9f81('0x7'));var controller=require(_0x9f81('0x8'));router[_0x9f81('0x9')]('/',auth[_0x9f81('0xa')](),controller[_0x9f81('0xb')]);router['get'](_0x9f81('0xc'),auth['isAuthenticated'](),controller[_0x9f81('0xd')]);router[_0x9f81('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x9f81('0xe')]);router[_0x9f81('0xf')]('/',auth['isAuthenticated'](),controller[_0x9f81('0x10')]);router['put'](_0x9f81('0x11'),auth[_0x9f81('0xa')](),controller[_0x9f81('0x12')]);router[_0x9f81('0x13')](_0x9f81('0x11'),auth['isAuthenticated'](),controller[_0x9f81('0x14')]);module[_0x9f81('0x15')]=router; \ No newline at end of file +var _0xb2dd=['delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get','isAuthenticated','index','/describe','describe','/:id','create','put','update'];(function(_0x5d4abd,_0x192b98){var _0x46b2a8=function(_0x209e71){while(--_0x209e71){_0x5d4abd['push'](_0x5d4abd['shift']());}};_0x46b2a8(++_0x192b98);}(_0xb2dd,0x11a));var _0xdb2d=function(_0x416a38,_0x5004e0){_0x416a38=_0x416a38-0x0;var _0xec6c28=_0xb2dd[_0x416a38];return _0xec6c28;};'use strict';var multer=require(_0xdb2d('0x0'));var util=require(_0xdb2d('0x1'));var path=require(_0xdb2d('0x2'));var timeout=require(_0xdb2d('0x3'));var express=require('express');var router=express[_0xdb2d('0x4')]();var auth=require(_0xdb2d('0x5'));var interaction=require(_0xdb2d('0x6'));var config=require(_0xdb2d('0x7'));var controller=require(_0xdb2d('0x8'));router[_0xdb2d('0x9')]('/',auth[_0xdb2d('0xa')](),controller[_0xdb2d('0xb')]);router[_0xdb2d('0x9')](_0xdb2d('0xc'),auth[_0xdb2d('0xa')](),controller[_0xdb2d('0xd')]);router[_0xdb2d('0x9')](_0xdb2d('0xe'),auth[_0xdb2d('0xa')](),controller['show']);router['post']('/',auth[_0xdb2d('0xa')](),controller[_0xdb2d('0xf')]);router[_0xdb2d('0x10')](_0xdb2d('0xe'),auth[_0xdb2d('0xa')](),controller[_0xdb2d('0x11')]);router[_0xdb2d('0x12')](_0xdb2d('0xe'),auth[_0xdb2d('0xa')](),controller[_0xdb2d('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 5363db2..d7d0257 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 _0xd073=['talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','moment','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','getDataValue','seconds','setDataValue','duration'];(function(_0x4b4614,_0x2f6b81){var _0x375142=function(_0x5a6c95){while(--_0x5a6c95){_0x4b4614['push'](_0x4b4614['shift']());}};_0x375142(++_0x2f6b81);}(_0xd073,0x155));var _0x3d07=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd073[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x3d07('0x0'));module['exports']={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x3d07('0x1')]},'interface':{'type':Sequelize[_0x3d07('0x1')]},'type':{'type':Sequelize[_0x3d07('0x1')],'defaultValue':_0x3d07('0x2'),'comment':_0x3d07('0x3')},'duration':{'type':Sequelize[_0x3d07('0x4')]},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x557f8e){var _0x412d19=moment(_0x557f8e);var _0x56aa1e=moment(this[_0x3d07('0x5')]('enterAt'));var _0x29ee5d=_0x412d19['diff'](_0x56aa1e,_0x3d07('0x6'));this['setDataValue']('exitAt',_0x557f8e);this[_0x3d07('0x7')](_0x3d07('0x8'),_0x29ee5d||null);}},'data1':{'type':Sequelize[_0x3d07('0x1')],'comment':_0x3d07('0x9')},'data2':{'type':Sequelize[_0x3d07('0x1')],'comment':_0x3d07('0xa')},'data3':{'type':Sequelize[_0x3d07('0x1')],'comment':_0x3d07('0xb')},'data4':{'type':Sequelize[_0x3d07('0x1')],'comment':_0x3d07('0xc')},'data5':{'type':Sequelize['STRING'],'comment':_0x3d07('0xd')},'role':{'type':Sequelize[_0x3d07('0x1')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x3d07('0x1')]}}; \ No newline at end of file +var _0x0c9b=['exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','DATE','getDataValue','enterAt','diff','setDataValue','exitAt','duration','talk:[start]','talk:[queue]','INTEGER','sequelize','moment'];(function(_0x4650d1,_0x45482d){var _0xae78f9=function(_0x22d8de){while(--_0x22d8de){_0x4650d1['push'](_0x4650d1['shift']());}};_0xae78f9(++_0x45482d);}(_0x0c9b,0x1be));var _0xb0c9=function(_0x5c1184,_0x371500){_0x5c1184=_0x5c1184-0x0;var _0x26581c=_0x0c9b[_0x5c1184];return _0x26581c;};'use strict';var Sequelize=require(_0xb0c9('0x0'));var moment=require(_0xb0c9('0x1'));module[_0xb0c9('0x2')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xb0c9('0x3')]},'interface':{'type':Sequelize[_0xb0c9('0x3')]},'type':{'type':Sequelize[_0xb0c9('0x3')],'defaultValue':_0xb0c9('0x4'),'comment':_0xb0c9('0x5')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0xb0c9('0x6')]},'exitAt':{'type':Sequelize[_0xb0c9('0x6')],'set':function(_0x678f97){var _0x435bee=moment(_0x678f97);var _0x5e0476=moment(this[_0xb0c9('0x7')](_0xb0c9('0x8')));var _0x3a1863=_0x435bee[_0xb0c9('0x9')](_0x5e0476,'seconds');this[_0xb0c9('0xa')](_0xb0c9('0xb'),_0x678f97);this['setDataValue'](_0xb0c9('0xc'),_0x3a1863||null);}},'data1':{'type':Sequelize[_0xb0c9('0x3')],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize[_0xb0c9('0x3')],'comment':_0xb0c9('0xd')},'data3':{'type':Sequelize[_0xb0c9('0x3')],'comment':'talk:[destination]'},'data4':{'type':Sequelize[_0xb0c9('0x3')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize['STRING'],'comment':_0xb0c9('0xe')},'role':{'type':Sequelize[_0xb0c9('0x3')]},'internal':{'type':Sequelize[_0xb0c9('0xf')]},'uniqueid':{'type':Sequelize[_0xb0c9('0x3')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 1569920..e14069e 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 _0x4f7a=['json','offset','limit','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','nolimit','sort','where','pick','filter','VIRTUAL','field','merge','options','MemberReport','count','findAll','rows','catch','show','params','length','includeAll','create','body','find','describe','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','ejs','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status'];(function(_0x107d8b,_0x249159){var _0x3983ac=function(_0x4d2449){while(--_0x4d2449){_0x107d8b['push'](_0x107d8b['shift']());}};_0x3983ac(++_0x249159);}(_0x4f7a,0x105));var _0xa4f7=function(_0x2c79f6,_0x46ab75){_0x2c79f6=_0x2c79f6-0x0;var _0x5d54e3=_0x4f7a[_0x2c79f6];return _0x5d54e3;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xa4f7('0x0'));var zipdir=require(_0xa4f7('0x1'));var jsonpatch=require(_0xa4f7('0x2'));var rp=require('request-promise');var moment=require(_0xa4f7('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa4f7('0x4'));var util=require(_0xa4f7('0x5'));var path=require(_0xa4f7('0x6'));var sox=require('sox');var csv=require(_0xa4f7('0x7'));var ejs=require(_0xa4f7('0x8'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xa4f7('0x9'));var jsforce=require(_0xa4f7('0xa'));var deskjs=require(_0xa4f7('0xb'));var toCsv=require(_0xa4f7('0x7'));var querystring=require(_0xa4f7('0xc'));var Papa=require('papaparse');var Redis=require(_0xa4f7('0xd'));var authService=require(_0xa4f7('0xe'));var qs=require(_0xa4f7('0xf'));var as=require(_0xa4f7('0x10'));var hardwareService=require(_0xa4f7('0x11'));var logger=require(_0xa4f7('0x12'))(_0xa4f7('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xa4f7('0x14'))['db'];function respondWithStatusCode(_0x1917f6,_0x4a8cf9){_0x4a8cf9=_0x4a8cf9||0xcc;return function(_0x14e435){if(_0x14e435){return _0x1917f6[_0xa4f7('0x15')](_0x4a8cf9);}return _0x1917f6[_0xa4f7('0x16')](_0x4a8cf9)['end']();};}function respondWithResult(_0x1f60b3,_0x321bd7){_0x321bd7=_0x321bd7||0xc8;return function(_0x3666c8){if(_0x3666c8){return _0x1f60b3['status'](_0x321bd7)[_0xa4f7('0x17')](_0x3666c8);}};}function respondWithFilteredResult(_0x1ddb6b,_0x2a255f){return function(_0x39d437){if(_0x39d437){var _0x492500=_0x39d437['count'],_0x3e9fc7=_0x2a255f[_0xa4f7('0x18')],_0x1e13ab=_0x2a255f['offset']+_0x2a255f[_0xa4f7('0x19')],_0x4bf839;if(_0x1e13ab>=_0x492500){_0x1e13ab=_0x492500;_0x4bf839=0xc8;}else{_0x4bf839=0xce;}_0x1ddb6b[_0xa4f7('0x16')](_0x4bf839);return _0x1ddb6b['set'](_0xa4f7('0x1a'),_0x3e9fc7+'-'+_0x1e13ab+'/'+_0x492500)['json'](_0x39d437);}return null;};}function patchUpdates(_0x143dac){return function(_0xac81c9){try{jsonpatch[_0xa4f7('0x1b')](_0xac81c9,_0x143dac,!![]);}catch(_0x28f90a){return BPromise[_0xa4f7('0x1c')](_0x28f90a);}return _0xac81c9[_0xa4f7('0x1d')]();};}function saveUpdates(_0x48ec43,_0x18bb7a){return function(_0x2ffd9a){if(_0x2ffd9a){return _0x2ffd9a[_0xa4f7('0x1e')](_0x48ec43)[_0xa4f7('0x1f')](function(_0x56b730){return _0x56b730;});}return null;};}function removeEntity(_0x13106d,_0x392312){return function(_0x3bee6b){if(_0x3bee6b){return _0x3bee6b[_0xa4f7('0x20')]()[_0xa4f7('0x1f')](function(){_0x13106d[_0xa4f7('0x16')](0xcc)[_0xa4f7('0x21')]();});}};}function handleEntityNotFound(_0xdbc437,_0x16a342){return function(_0x1201ee){if(!_0x1201ee){_0xdbc437[_0xa4f7('0x15')](0x194);}return _0x1201ee;};}function handleError(_0x119709,_0x53dd1d){_0x53dd1d=_0x53dd1d||0x1f4;return function(_0x88f269){logger[_0xa4f7('0x22')](_0x88f269[_0xa4f7('0x23')]);if(_0x88f269[_0xa4f7('0x24')]){delete _0x88f269[_0xa4f7('0x24')];}_0x119709['status'](_0x53dd1d)['send'](_0x88f269);};}exports['index']=function(_0x311463,_0x4e6c36){var _0x4859d={},_0x23ffe5={},_0x1b8cac={'count':0x0,'rows':[]};var _0x488152=_[_0xa4f7('0x25')](db['MemberReport'][_0xa4f7('0x26')],function(_0x513a41){return{'name':_0x513a41[_0xa4f7('0x27')],'type':_0x513a41[_0xa4f7('0x28')][_0xa4f7('0x29')]};});_0x23ffe5[_0xa4f7('0x2a')]=_['map'](_0x488152,_0xa4f7('0x24'));_0x23ffe5[_0xa4f7('0x2b')]=_[_0xa4f7('0x2c')](_0x311463[_0xa4f7('0x2b')]);_0x23ffe5[_0xa4f7('0x2d')]=_['intersection'](_0x23ffe5[_0xa4f7('0x2a')],_0x23ffe5[_0xa4f7('0x2b')]);_0x4859d['attributes']=_[_0xa4f7('0x2e')](_0x23ffe5[_0xa4f7('0x2a')],qs[_0xa4f7('0x2f')](_0x311463['query'][_0xa4f7('0x2f')]));_0x4859d[_0xa4f7('0x30')]=_0x4859d['attributes']['length']?_0x4859d[_0xa4f7('0x30')]:_0x23ffe5[_0xa4f7('0x2a')];if(!_0x311463[_0xa4f7('0x2b')]['hasOwnProperty'](_0xa4f7('0x31'))){_0x4859d[_0xa4f7('0x19')]=qs[_0xa4f7('0x19')](_0x311463[_0xa4f7('0x2b')][_0xa4f7('0x19')]);_0x4859d[_0xa4f7('0x18')]=qs[_0xa4f7('0x18')](_0x311463[_0xa4f7('0x2b')][_0xa4f7('0x18')]);}_0x4859d['order']=qs[_0xa4f7('0x32')](_0x311463[_0xa4f7('0x2b')][_0xa4f7('0x32')]);_0x4859d[_0xa4f7('0x33')]=qs[_0xa4f7('0x2d')](_[_0xa4f7('0x34')](_0x311463[_0xa4f7('0x2b')],_0x23ffe5[_0xa4f7('0x2d')]));if(_0x311463['query'][_0xa4f7('0x35')]){_0x4859d[_0xa4f7('0x33')]=_['merge'](_0x4859d['where'],{'$or':_[_0xa4f7('0x25')](_0x488152,function(_0x780880){if(_0x780880[_0xa4f7('0x28')]['key']!==_0xa4f7('0x36')){var _0x24488e={};_0x24488e[_0x780880[_0xa4f7('0x37')]]={'$like':'%'+_0x311463[_0xa4f7('0x2b')]['filter']+'%'};return _0x24488e;}})});}_0x4859d=_[_0xa4f7('0x38')]({},_0x4859d,_0x311463[_0xa4f7('0x39')]);var _0x1a5bd3={'where':_0x4859d[_0xa4f7('0x33')]};return db[_0xa4f7('0x3a')][_0xa4f7('0x3b')](_0x1a5bd3)[_0xa4f7('0x1f')](function(_0x1dc644){_0x1b8cac[_0xa4f7('0x3b')]=_0x1dc644;if(_0x311463[_0xa4f7('0x2b')]['includeAll']){_0x4859d['include']=[{'all':!![]}];}return db['MemberReport'][_0xa4f7('0x3c')](_0x4859d);})['then'](function(_0x21f672){_0x1b8cac[_0xa4f7('0x3d')]=_0x21f672;return _0x1b8cac;})[_0xa4f7('0x1f')](respondWithFilteredResult(_0x4e6c36,_0x4859d))[_0xa4f7('0x3e')](handleError(_0x4e6c36,null));};exports[_0xa4f7('0x3f')]=function(_0x48a467,_0x1698f2){var _0x29646d={'raw':!![],'where':{'id':_0x48a467[_0xa4f7('0x40')]['id']}},_0x2bf89a={};_0x2bf89a[_0xa4f7('0x2a')]=_[_0xa4f7('0x2c')](db[_0xa4f7('0x3a')][_0xa4f7('0x26')]);_0x2bf89a[_0xa4f7('0x2b')]=_[_0xa4f7('0x2c')](_0x48a467['query']);_0x2bf89a[_0xa4f7('0x2d')]=_['intersection'](_0x2bf89a['model'],_0x2bf89a[_0xa4f7('0x2b')]);_0x29646d[_0xa4f7('0x30')]=_[_0xa4f7('0x2e')](_0x2bf89a[_0xa4f7('0x2a')],qs[_0xa4f7('0x2f')](_0x48a467['query'][_0xa4f7('0x2f')]));_0x29646d[_0xa4f7('0x30')]=_0x29646d[_0xa4f7('0x30')][_0xa4f7('0x41')]?_0x29646d[_0xa4f7('0x30')]:_0x2bf89a['model'];if(_0x48a467[_0xa4f7('0x2b')][_0xa4f7('0x42')]){_0x29646d['include']=[{'all':!![]}];}_0x29646d=_[_0xa4f7('0x38')]({},_0x29646d,_0x48a467[_0xa4f7('0x39')]);return db[_0xa4f7('0x3a')]['find'](_0x29646d)['then'](handleEntityNotFound(_0x1698f2,null))[_0xa4f7('0x1f')](respondWithResult(_0x1698f2,null))[_0xa4f7('0x3e')](handleError(_0x1698f2,null));};exports[_0xa4f7('0x43')]=function(_0x5b1974,_0x299491){return db[_0xa4f7('0x3a')][_0xa4f7('0x43')](_0x5b1974[_0xa4f7('0x44')],{})[_0xa4f7('0x1f')](respondWithResult(_0x299491,0xc9))['catch'](handleError(_0x299491,null));};exports[_0xa4f7('0x1e')]=function(_0x3d631b,_0xa700cc){if(_0x3d631b['body']['id']){delete _0x3d631b['body']['id'];}return db[_0xa4f7('0x3a')][_0xa4f7('0x45')]({'where':{'id':_0x3d631b[_0xa4f7('0x40')]['id']}})[_0xa4f7('0x1f')](handleEntityNotFound(_0xa700cc,null))[_0xa4f7('0x1f')](saveUpdates(_0x3d631b[_0xa4f7('0x44')],null))[_0xa4f7('0x1f')](respondWithResult(_0xa700cc,null))[_0xa4f7('0x3e')](handleError(_0xa700cc,null));};exports[_0xa4f7('0x20')]=function(_0x521eac,_0x5c0e43){return db['MemberReport'][_0xa4f7('0x45')]({'where':{'id':_0x521eac[_0xa4f7('0x40')]['id']}})[_0xa4f7('0x1f')](handleEntityNotFound(_0x5c0e43,null))[_0xa4f7('0x1f')](removeEntity(_0x5c0e43,null))[_0xa4f7('0x3e')](handleError(_0x5c0e43,null));};exports[_0xa4f7('0x46')]=function(_0x2d199e,_0x179fb3){return db[_0xa4f7('0x3a')]['describe']()['then'](respondWithResult(_0x179fb3,null))[_0xa4f7('0x3e')](handleError(_0x179fb3,null));}; \ No newline at end of file +var _0xc7bd=['api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','reject','save','destroy','then','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','field','options','MemberReport','includeAll','include','findAll','rows','catch','show','length','create','update','body','find','params','describe','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x3aaa5a,_0x413a5b){var _0x5617c6=function(_0x390695){while(--_0x390695){_0x3aaa5a['push'](_0x3aaa5a['shift']());}};_0x5617c6(++_0x413a5b);}(_0xc7bd,0x86));var _0xdc7b=function(_0x152f93,_0x5a8395){_0x152f93=_0x152f93-0x0;var _0x416edc=_0xc7bd[_0x152f93];return _0x416edc;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xdc7b('0x0'));var rimraf=require(_0xdc7b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdc7b('0x2'));var rp=require('request-promise');var moment=require(_0xdc7b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xdc7b('0x4'));var util=require(_0xdc7b('0x5'));var path=require(_0xdc7b('0x6'));var sox=require(_0xdc7b('0x7'));var csv=require(_0xdc7b('0x8'));var ejs=require(_0xdc7b('0x9'));var fs=require('fs');var _=require(_0xdc7b('0xa'));var squel=require('squel');var crypto=require(_0xdc7b('0xb'));var jsforce=require(_0xdc7b('0xc'));var deskjs=require(_0xdc7b('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xdc7b('0xe'));var Redis=require(_0xdc7b('0xf'));var authService=require(_0xdc7b('0x10'));var qs=require(_0xdc7b('0x11'));var as=require(_0xdc7b('0x12'));var hardwareService=require(_0xdc7b('0x13'));var logger=require('../../config/logger')(_0xdc7b('0x14'));var utils=require(_0xdc7b('0x15'));var config=require(_0xdc7b('0x16'));var db=require(_0xdc7b('0x17'))['db'];function respondWithStatusCode(_0x2071ff,_0x159e5a){_0x159e5a=_0x159e5a||0xcc;return function(_0x5eacf3){if(_0x5eacf3){return _0x2071ff[_0xdc7b('0x18')](_0x159e5a);}return _0x2071ff[_0xdc7b('0x19')](_0x159e5a)['end']();};}function respondWithResult(_0x3ea038,_0x5eb8d9){_0x5eb8d9=_0x5eb8d9||0xc8;return function(_0x2407e7){if(_0x2407e7){return _0x3ea038[_0xdc7b('0x19')](_0x5eb8d9)[_0xdc7b('0x1a')](_0x2407e7);}};}function respondWithFilteredResult(_0x355090,_0x5afa1e){return function(_0x152ec8){if(_0x152ec8){var _0x2088f1=_0x152ec8[_0xdc7b('0x1b')],_0x5e0281=_0x5afa1e[_0xdc7b('0x1c')],_0x35c671=_0x5afa1e[_0xdc7b('0x1c')]+_0x5afa1e[_0xdc7b('0x1d')],_0x12b8ca;if(_0x35c671>=_0x2088f1){_0x35c671=_0x2088f1;_0x12b8ca=0xc8;}else{_0x12b8ca=0xce;}_0x355090[_0xdc7b('0x19')](_0x12b8ca);return _0x355090[_0xdc7b('0x1e')]('Content-Range',_0x5e0281+'-'+_0x35c671+'/'+_0x2088f1)[_0xdc7b('0x1a')](_0x152ec8);}return null;};}function patchUpdates(_0x54a99b){return function(_0x15bd61){try{jsonpatch['apply'](_0x15bd61,_0x54a99b,!![]);}catch(_0x46e187){return BPromise[_0xdc7b('0x1f')](_0x46e187);}return _0x15bd61[_0xdc7b('0x20')]();};}function saveUpdates(_0x372728,_0x1f516d){return function(_0x4c39db){if(_0x4c39db){return _0x4c39db['update'](_0x372728)['then'](function(_0x3e6972){return _0x3e6972;});}return null;};}function removeEntity(_0x2b3723,_0x4c3231){return function(_0x2665cb){if(_0x2665cb){return _0x2665cb[_0xdc7b('0x21')]()[_0xdc7b('0x22')](function(){_0x2b3723['status'](0xcc)[_0xdc7b('0x23')]();});}};}function handleEntityNotFound(_0x4c6d14,_0x3b3d3d){return function(_0x2a1fca){if(!_0x2a1fca){_0x4c6d14[_0xdc7b('0x18')](0x194);}return _0x2a1fca;};}function handleError(_0x46255c,_0x1ce512){_0x1ce512=_0x1ce512||0x1f4;return function(_0xcca95d){logger[_0xdc7b('0x24')](_0xcca95d[_0xdc7b('0x25')]);if(_0xcca95d[_0xdc7b('0x26')]){delete _0xcca95d['name'];}_0x46255c[_0xdc7b('0x19')](_0x1ce512)[_0xdc7b('0x27')](_0xcca95d);};}exports[_0xdc7b('0x28')]=function(_0x169dd7,_0x52b346){var _0x30b37d={},_0x5be3e4={},_0x4525d4={'count':0x0,'rows':[]};var _0x2c5ec8=_[_0xdc7b('0x29')](db['MemberReport'][_0xdc7b('0x2a')],function(_0x102288){return{'name':_0x102288[_0xdc7b('0x2b')],'type':_0x102288[_0xdc7b('0x2c')][_0xdc7b('0x2d')]};});_0x5be3e4['model']=_[_0xdc7b('0x29')](_0x2c5ec8,_0xdc7b('0x26'));_0x5be3e4[_0xdc7b('0x2e')]=_[_0xdc7b('0x2f')](_0x169dd7['query']);_0x5be3e4[_0xdc7b('0x30')]=_[_0xdc7b('0x31')](_0x5be3e4[_0xdc7b('0x32')],_0x5be3e4[_0xdc7b('0x2e')]);_0x30b37d['attributes']=_[_0xdc7b('0x31')](_0x5be3e4[_0xdc7b('0x32')],qs[_0xdc7b('0x33')](_0x169dd7[_0xdc7b('0x2e')][_0xdc7b('0x33')]));_0x30b37d['attributes']=_0x30b37d[_0xdc7b('0x34')]['length']?_0x30b37d[_0xdc7b('0x34')]:_0x5be3e4[_0xdc7b('0x32')];if(!_0x169dd7[_0xdc7b('0x2e')]['hasOwnProperty'](_0xdc7b('0x35'))){_0x30b37d[_0xdc7b('0x1d')]=qs[_0xdc7b('0x1d')](_0x169dd7['query'][_0xdc7b('0x1d')]);_0x30b37d[_0xdc7b('0x1c')]=qs['offset'](_0x169dd7[_0xdc7b('0x2e')]['offset']);}_0x30b37d[_0xdc7b('0x36')]=qs[_0xdc7b('0x37')](_0x169dd7['query'][_0xdc7b('0x37')]);_0x30b37d[_0xdc7b('0x38')]=qs[_0xdc7b('0x30')](_[_0xdc7b('0x39')](_0x169dd7[_0xdc7b('0x2e')],_0x5be3e4[_0xdc7b('0x30')]));if(_0x169dd7[_0xdc7b('0x2e')][_0xdc7b('0x3a')]){_0x30b37d['where']=_[_0xdc7b('0x3b')](_0x30b37d[_0xdc7b('0x38')],{'$or':_[_0xdc7b('0x29')](_0x2c5ec8,function(_0x5abd48){if(_0x5abd48['type']['key']!==_0xdc7b('0x3c')){var _0x3038b5={};_0x3038b5[_0x5abd48[_0xdc7b('0x3d')]]={'$like':'%'+_0x169dd7[_0xdc7b('0x2e')][_0xdc7b('0x3a')]+'%'};return _0x3038b5;}})});}_0x30b37d=_[_0xdc7b('0x3b')]({},_0x30b37d,_0x169dd7[_0xdc7b('0x3e')]);var _0x239ffe={'where':_0x30b37d[_0xdc7b('0x38')]};return db[_0xdc7b('0x3f')]['count'](_0x239ffe)[_0xdc7b('0x22')](function(_0x22e6fa){_0x4525d4['count']=_0x22e6fa;if(_0x169dd7['query'][_0xdc7b('0x40')]){_0x30b37d[_0xdc7b('0x41')]=[{'all':!![]}];}return db[_0xdc7b('0x3f')][_0xdc7b('0x42')](_0x30b37d);})[_0xdc7b('0x22')](function(_0x265df8){_0x4525d4[_0xdc7b('0x43')]=_0x265df8;return _0x4525d4;})[_0xdc7b('0x22')](respondWithFilteredResult(_0x52b346,_0x30b37d))[_0xdc7b('0x44')](handleError(_0x52b346,null));};exports[_0xdc7b('0x45')]=function(_0x59ef9e,_0x3005ac){var _0x1f0c6b={'raw':!![],'where':{'id':_0x59ef9e['params']['id']}},_0x18fe74={};_0x18fe74[_0xdc7b('0x32')]=_[_0xdc7b('0x2f')](db[_0xdc7b('0x3f')][_0xdc7b('0x2a')]);_0x18fe74[_0xdc7b('0x2e')]=_[_0xdc7b('0x2f')](_0x59ef9e[_0xdc7b('0x2e')]);_0x18fe74[_0xdc7b('0x30')]=_[_0xdc7b('0x31')](_0x18fe74[_0xdc7b('0x32')],_0x18fe74['query']);_0x1f0c6b[_0xdc7b('0x34')]=_[_0xdc7b('0x31')](_0x18fe74[_0xdc7b('0x32')],qs[_0xdc7b('0x33')](_0x59ef9e[_0xdc7b('0x2e')]['fields']));_0x1f0c6b[_0xdc7b('0x34')]=_0x1f0c6b[_0xdc7b('0x34')][_0xdc7b('0x46')]?_0x1f0c6b['attributes']:_0x18fe74[_0xdc7b('0x32')];if(_0x59ef9e[_0xdc7b('0x2e')][_0xdc7b('0x40')]){_0x1f0c6b[_0xdc7b('0x41')]=[{'all':!![]}];}_0x1f0c6b=_['merge']({},_0x1f0c6b,_0x59ef9e['options']);return db[_0xdc7b('0x3f')]['find'](_0x1f0c6b)['then'](handleEntityNotFound(_0x3005ac,null))[_0xdc7b('0x22')](respondWithResult(_0x3005ac,null))[_0xdc7b('0x44')](handleError(_0x3005ac,null));};exports[_0xdc7b('0x47')]=function(_0x10c9e3,_0x3338f2){return db[_0xdc7b('0x3f')]['create'](_0x10c9e3['body'],{})[_0xdc7b('0x22')](respondWithResult(_0x3338f2,0xc9))[_0xdc7b('0x44')](handleError(_0x3338f2,null));};exports[_0xdc7b('0x48')]=function(_0x83cf77,_0x2dfd57){if(_0x83cf77[_0xdc7b('0x49')]['id']){delete _0x83cf77[_0xdc7b('0x49')]['id'];}return db[_0xdc7b('0x3f')][_0xdc7b('0x4a')]({'where':{'id':_0x83cf77[_0xdc7b('0x4b')]['id']}})[_0xdc7b('0x22')](handleEntityNotFound(_0x2dfd57,null))['then'](saveUpdates(_0x83cf77[_0xdc7b('0x49')],null))[_0xdc7b('0x22')](respondWithResult(_0x2dfd57,null))['catch'](handleError(_0x2dfd57,null));};exports['destroy']=function(_0x320cb7,_0x3a6b7f){return db[_0xdc7b('0x3f')][_0xdc7b('0x4a')]({'where':{'id':_0x320cb7[_0xdc7b('0x4b')]['id']}})[_0xdc7b('0x22')](handleEntityNotFound(_0x3a6b7f,null))[_0xdc7b('0x22')](removeEntity(_0x3a6b7f,null))[_0xdc7b('0x44')](handleError(_0x3a6b7f,null));};exports['describe']=function(_0x4839b2,_0x30dcdf){return db[_0xdc7b('0x3f')][_0xdc7b('0x4c')]()['then'](respondWithResult(_0x30dcdf,null))['catch'](handleError(_0x30dcdf,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 6b7b082..86f41eb 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 _0x408c=['interface','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','membername_interface','membername'];(function(_0x1bc013,_0x7771c6){var _0x55df36=function(_0x1c02e0){while(--_0x1c02e0){_0x1bc013['push'](_0x1bc013['shift']());}};_0x55df36(++_0x7771c6);}(_0x408c,0xb7));var _0xc408=function(_0x2d8723,_0x549860){_0x2d8723=_0x2d8723-0x0;var _0x307fb1=_0x408c[_0x2d8723];return _0x307fb1;};'use strict';var _=require(_0xc408('0x0'));var util=require('util');var logger=require(_0xc408('0x1'))(_0xc408('0x2'));var moment=require(_0xc408('0x3'));var BPromise=require(_0xc408('0x4'));var rp=require(_0xc408('0x5'));var fs=require('fs');var path=require(_0xc408('0x6'));var rimraf=require(_0xc408('0x7'));var config=require('../../config/environment');var attributes=require('./memberReport.attributes');module[_0xc408('0x8')]=function(_0x3926bd,_0x3e1f1e){return _0x3926bd[_0xc408('0x9')]('MemberReport',attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':_0xc408('0xa'),'fields':[_0xc408('0xb'),_0xc408('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x78bb=['MemberReport','report_member','membername_interface','api','moment','bluebird','request-promise','path','rimraf','./memberReport.attributes','exports'];(function(_0x51a003,_0x4a3880){var _0x469d6a=function(_0xab65b3){while(--_0xab65b3){_0x51a003['push'](_0x51a003['shift']());}};_0x469d6a(++_0x4a3880);}(_0x78bb,0x142));var _0xb78b=function(_0x4df6f9,_0x44bd65){_0x4df6f9=_0x4df6f9-0x0;var _0x4b1a73=_0x78bb[_0x4df6f9];return _0x4b1a73;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xb78b('0x0'));var moment=require(_0xb78b('0x1'));var BPromise=require(_0xb78b('0x2'));var rp=require(_0xb78b('0x3'));var fs=require('fs');var path=require(_0xb78b('0x4'));var rimraf=require(_0xb78b('0x5'));var config=require('../../config/environment');var attributes=require(_0xb78b('0x6'));module[_0xb78b('0x7')]=function(_0x1314ea,_0x5d0ab3){return _0x1314ea['define'](_0xb78b('0x8'),attributes,{'tableName':_0xb78b('0x9'),'paranoid':![],'indexes':[{'name':_0xb78b('0xa'),'fields':['membername','interface']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 64ecf1c..e225dfa 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 _0xe84b=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetMemberReport','MemberReport','findAll','options','attributes','limit','map','model','include','then','CreateMemberReport','create','body','raw','UpdateMemberReport','update'];(function(_0xea98ab,_0x297344){var _0x39058e=function(_0x27524a){while(--_0x27524a){_0xea98ab['push'](_0xea98ab['shift']());}};_0x39058e(++_0x297344);}(_0xe84b,0x172));var _0xbe84=function(_0x240552,_0x43d97f){_0x240552=_0x240552-0x0;var _0x6d4e3b=_0xe84b[_0x240552];return _0x6d4e3b;};'use strict';var _=require(_0xbe84('0x0'));var util=require(_0xbe84('0x1'));var moment=require(_0xbe84('0x2'));var BPromise=require(_0xbe84('0x3'));var rs=require(_0xbe84('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbe84('0x5'))['db'];var utils=require(_0xbe84('0x6'));var logger=require(_0xbe84('0x7'))('rpc');var config=require(_0xbe84('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xbe84('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x418636,_0x1ba069,_0x1f8a8f){return new BPromise(function(_0x401fc7,_0x2d6ee2){return client[_0xbe84('0xa')](_0x418636,_0x1f8a8f)['then'](function(_0x563301){logger[_0xbe84('0xb')](_0xbe84('0xc'),_0x1ba069,_0xbe84('0xd'));logger[_0xbe84('0xe')](_0xbe84('0xf'),_0x1ba069,_0xbe84('0xd'),JSON[_0xbe84('0x10')](_0x563301));if(_0x563301[_0xbe84('0x11')]){if(_0x563301['error']['code']===0x1f4){logger[_0xbe84('0x11')](_0xbe84('0xc'),_0x1ba069,_0x563301[_0xbe84('0x11')][_0xbe84('0x12')]);return _0x2d6ee2(_0x563301[_0xbe84('0x11')][_0xbe84('0x12')]);}logger[_0xbe84('0x11')]('MemberReport,\x20%s,\x20%s',_0x1ba069,_0x563301[_0xbe84('0x11')][_0xbe84('0x12')]);return _0x401fc7(_0x563301[_0xbe84('0x11')]['message']);}else{logger[_0xbe84('0xb')](_0xbe84('0xc'),_0x1ba069,_0xbe84('0xd'));_0x401fc7(_0x563301[_0xbe84('0x13')]['message']);}})[_0xbe84('0x14')](function(_0x25f3e3){logger[_0xbe84('0x11')](_0xbe84('0xc'),_0x1ba069,_0x25f3e3);_0x2d6ee2(_0x25f3e3);});});}exports[_0xbe84('0x15')]=function(_0x4c62a6){var _0x27b199=this;return new Promise(function(_0x1ac43b,_0x5097a0){return db[_0xbe84('0x16')][_0xbe84('0x17')]({'raw':_0x4c62a6['options']?_0x4c62a6[_0xbe84('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x4c62a6[_0xbe84('0x18')]?_0x4c62a6[_0xbe84('0x18')]['where']||null:null,'attributes':_0x4c62a6[_0xbe84('0x18')]?_0x4c62a6[_0xbe84('0x18')][_0xbe84('0x19')]||null:null,'limit':_0x4c62a6[_0xbe84('0x18')]?_0x4c62a6[_0xbe84('0x18')][_0xbe84('0x1a')]||null:null,'include':_0x4c62a6[_0xbe84('0x18')]?_0x4c62a6['options']['include']?_[_0xbe84('0x1b')](_0x4c62a6[_0xbe84('0x18')]['include'],function(_0x10c66e){return{'model':db[_0x10c66e[_0xbe84('0x1c')]],'as':_0x10c66e['as'],'attributes':_0x10c66e[_0xbe84('0x19')],'include':_0x10c66e['include']?_[_0xbe84('0x1b')](_0x10c66e[_0xbe84('0x1d')],function(_0x1bc34c){return{'model':db[_0x1bc34c['model']],'as':_0x1bc34c['as'],'attributes':_0x1bc34c[_0xbe84('0x19')],'include':_0x1bc34c[_0xbe84('0x1d')]?_[_0xbe84('0x1b')](_0x1bc34c[_0xbe84('0x1d')],function(_0x3e0145){return{'model':db[_0x3e0145[_0xbe84('0x1c')]],'as':_0x3e0145['as'],'attributes':_0x3e0145[_0xbe84('0x19')]};}):[]};}):[]};}):[]:[]})[_0xbe84('0x1e')](function(_0x3e50de){logger['info'](_0xbe84('0x15'),_0x4c62a6);logger[_0xbe84('0xe')](_0xbe84('0x15'),_0x4c62a6,JSON[_0xbe84('0x10')](_0x3e50de));_0x1ac43b(_0x3e50de);})[_0xbe84('0x14')](function(_0x21e137){logger['error']('GetMemberReport',_0x21e137['message'],_0x4c62a6);_0x5097a0(_0x27b199[_0xbe84('0x11')](0x1f4,_0x21e137[_0xbe84('0x12')]));});});};exports[_0xbe84('0x1f')]=function(_0x256c20){var _0x217d7f=this;return new Promise(function(_0x10e861,_0x257fc1){return db[_0xbe84('0x16')][_0xbe84('0x20')](_0x256c20[_0xbe84('0x21')],{'raw':_0x256c20[_0xbe84('0x18')]?_0x256c20[_0xbe84('0x18')][_0xbe84('0x22')]===undefined?!![]:![]:!![]})[_0xbe84('0x1e')](function(_0x120642){logger[_0xbe84('0xb')]('CreateMemberReport',_0x256c20);logger[_0xbe84('0xe')](_0xbe84('0x1f'),_0x256c20,JSON['stringify'](_0x120642));_0x10e861(_0x120642);})[_0xbe84('0x14')](function(_0x192cc9){logger[_0xbe84('0x11')](_0xbe84('0x1f'),_0x192cc9[_0xbe84('0x12')],_0x256c20);_0x257fc1(_0x217d7f[_0xbe84('0x11')](0x1f4,_0x192cc9[_0xbe84('0x12')]));});});};exports[_0xbe84('0x23')]=function(_0x54a7ec){var _0x304cbb=this;return new Promise(function(_0x45dfff,_0x535e94){return db['MemberReport'][_0xbe84('0x24')](_0x54a7ec[_0xbe84('0x21')],{'raw':_0x54a7ec[_0xbe84('0x18')]?_0x54a7ec[_0xbe84('0x18')][_0xbe84('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x54a7ec[_0xbe84('0x18')]?_0x54a7ec[_0xbe84('0x18')]['where']||null:null,'attributes':_0x54a7ec['options']?_0x54a7ec[_0xbe84('0x18')]['attributes']||null:null,'limit':_0x54a7ec[_0xbe84('0x18')]?_0x54a7ec[_0xbe84('0x18')][_0xbe84('0x1a')]||null:null})[_0xbe84('0x1e')](function(_0x1c6acd){logger['info']('UpdateMemberReport',_0x54a7ec);logger[_0xbe84('0xe')](_0xbe84('0x23'),_0x54a7ec,JSON[_0xbe84('0x10')](_0x1c6acd));_0x45dfff(_0x1c6acd);})[_0xbe84('0x14')](function(_0x4628dc){logger[_0xbe84('0x11')](_0xbe84('0x23'),_0x4628dc[_0xbe84('0x12')],_0x54a7ec);_0x535e94(_0x304cbb[_0xbe84('0x11')](0x1f4,_0x4628dc[_0xbe84('0x12')]));});});}; \ No newline at end of file +var _0xe992=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetMemberReport','MemberReport','findAll','options','raw','where','attributes','limit','include','map','model','stringify','create','body','CreateMemberReport','UpdateMemberReport','update','lodash','util','moment'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xe992,0x95));var _0x2e99=function(_0x1c1e44,_0x162405){_0x1c1e44=_0x1c1e44-0x0;var _0x53db1b=_0xe992[_0x1c1e44];return _0x53db1b;};'use strict';var _=require(_0x2e99('0x0'));var util=require(_0x2e99('0x1'));var moment=require(_0x2e99('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2e99('0x3'));var db=require(_0x2e99('0x4'))['db'];var utils=require(_0x2e99('0x5'));var logger=require(_0x2e99('0x6'))(_0x2e99('0x7'));var config=require(_0x2e99('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x2e99('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x24ddfe,_0x207abe,_0x2c25aa){return new BPromise(function(_0x3f0bc4,_0x70035b){return client[_0x2e99('0xa')](_0x24ddfe,_0x2c25aa)[_0x2e99('0xb')](function(_0x5dd10b){logger[_0x2e99('0xc')](_0x2e99('0xd'),_0x207abe,_0x2e99('0xe'));logger[_0x2e99('0xf')](_0x2e99('0x10'),_0x207abe,_0x2e99('0xe'),JSON['stringify'](_0x5dd10b));if(_0x5dd10b[_0x2e99('0x11')]){if(_0x5dd10b['error']['code']===0x1f4){logger[_0x2e99('0x11')](_0x2e99('0xd'),_0x207abe,_0x5dd10b['error']['message']);return _0x70035b(_0x5dd10b[_0x2e99('0x11')]['message']);}logger['error'](_0x2e99('0xd'),_0x207abe,_0x5dd10b[_0x2e99('0x11')][_0x2e99('0x12')]);return _0x3f0bc4(_0x5dd10b[_0x2e99('0x11')][_0x2e99('0x12')]);}else{logger[_0x2e99('0xc')](_0x2e99('0xd'),_0x207abe,_0x2e99('0xe'));_0x3f0bc4(_0x5dd10b[_0x2e99('0x13')][_0x2e99('0x12')]);}})[_0x2e99('0x14')](function(_0x5b9e64){logger[_0x2e99('0x11')](_0x2e99('0xd'),_0x207abe,_0x5b9e64);_0x70035b(_0x5b9e64);});});}exports[_0x2e99('0x15')]=function(_0x83fafa){var _0x577b96=this;return new Promise(function(_0x593861,_0x44118e){return db[_0x2e99('0x16')][_0x2e99('0x17')]({'raw':_0x83fafa[_0x2e99('0x18')]?_0x83fafa[_0x2e99('0x18')][_0x2e99('0x19')]===undefined?!![]:![]:!![],'where':_0x83fafa[_0x2e99('0x18')]?_0x83fafa['options'][_0x2e99('0x1a')]||null:null,'attributes':_0x83fafa[_0x2e99('0x18')]?_0x83fafa[_0x2e99('0x18')][_0x2e99('0x1b')]||null:null,'limit':_0x83fafa[_0x2e99('0x18')]?_0x83fafa[_0x2e99('0x18')][_0x2e99('0x1c')]||null:null,'include':_0x83fafa[_0x2e99('0x18')]?_0x83fafa['options'][_0x2e99('0x1d')]?_[_0x2e99('0x1e')](_0x83fafa[_0x2e99('0x18')]['include'],function(_0x5e7dba){return{'model':db[_0x5e7dba[_0x2e99('0x1f')]],'as':_0x5e7dba['as'],'attributes':_0x5e7dba[_0x2e99('0x1b')],'include':_0x5e7dba[_0x2e99('0x1d')]?_[_0x2e99('0x1e')](_0x5e7dba[_0x2e99('0x1d')],function(_0x54e4b6){return{'model':db[_0x54e4b6[_0x2e99('0x1f')]],'as':_0x54e4b6['as'],'attributes':_0x54e4b6['attributes'],'include':_0x54e4b6['include']?_[_0x2e99('0x1e')](_0x54e4b6[_0x2e99('0x1d')],function(_0x40d574){return{'model':db[_0x40d574['model']],'as':_0x40d574['as'],'attributes':_0x40d574[_0x2e99('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x2e99('0xb')](function(_0x309c1b){logger[_0x2e99('0xc')](_0x2e99('0x15'),_0x83fafa);logger[_0x2e99('0xf')]('GetMemberReport',_0x83fafa,JSON[_0x2e99('0x20')](_0x309c1b));_0x593861(_0x309c1b);})[_0x2e99('0x14')](function(_0x3c62c0){logger[_0x2e99('0x11')](_0x2e99('0x15'),_0x3c62c0[_0x2e99('0x12')],_0x83fafa);_0x44118e(_0x577b96['error'](0x1f4,_0x3c62c0[_0x2e99('0x12')]));});});};exports['CreateMemberReport']=function(_0x12b060){var _0xebb2ce=this;return new Promise(function(_0x4e273e,_0x526dd6){return db[_0x2e99('0x16')][_0x2e99('0x21')](_0x12b060[_0x2e99('0x22')],{'raw':_0x12b060[_0x2e99('0x18')]?_0x12b060[_0x2e99('0x18')][_0x2e99('0x19')]===undefined?!![]:![]:!![]})[_0x2e99('0xb')](function(_0x27ee48){logger[_0x2e99('0xc')]('CreateMemberReport',_0x12b060);logger[_0x2e99('0xf')](_0x2e99('0x23'),_0x12b060,JSON['stringify'](_0x27ee48));_0x4e273e(_0x27ee48);})[_0x2e99('0x14')](function(_0x23f0af){logger[_0x2e99('0x11')](_0x2e99('0x23'),_0x23f0af[_0x2e99('0x12')],_0x12b060);_0x526dd6(_0xebb2ce[_0x2e99('0x11')](0x1f4,_0x23f0af[_0x2e99('0x12')]));});});};exports[_0x2e99('0x24')]=function(_0x41c03e){var _0x5d4d19=this;return new Promise(function(_0x3dca7f,_0x5e4233){return db[_0x2e99('0x16')][_0x2e99('0x25')](_0x41c03e[_0x2e99('0x22')],{'raw':_0x41c03e['options']?_0x41c03e['options'][_0x2e99('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x41c03e[_0x2e99('0x18')]?_0x41c03e['options']['where']||null:null,'attributes':_0x41c03e[_0x2e99('0x18')]?_0x41c03e[_0x2e99('0x18')]['attributes']||null:null,'limit':_0x41c03e[_0x2e99('0x18')]?_0x41c03e[_0x2e99('0x18')][_0x2e99('0x1c')]||null:null})['then'](function(_0x4ad387){logger['info']('UpdateMemberReport',_0x41c03e);logger[_0x2e99('0xf')](_0x2e99('0x24'),_0x41c03e,JSON['stringify'](_0x4ad387));_0x3dca7f(_0x4ad387);})[_0x2e99('0x14')](function(_0x43ae14){logger[_0x2e99('0x11')]('UpdateMemberReport',_0x43ae14['message'],_0x41c03e);_0x5e4233(_0x5d4d19[_0x2e99('0x11')](0x1f4,_0x43ae14['message']));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 27de361..44da76b 100644 --- a/server/api/migration/index.js +++ b/server/api/migration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7af2=['../../components/interaction/service','../../config/environment','./migration.controller','get','index','exports','util','path','connect-timeout','express','../../components/auth/service'];(function(_0x2493f7,_0x49c670){var _0x594ab2=function(_0x344ec2){while(--_0x344ec2){_0x2493f7['push'](_0x2493f7['shift']());}};_0x594ab2(++_0x49c670);}(_0x7af2,0x119));var _0x27af=function(_0x4175e2,_0x3e015e){_0x4175e2=_0x4175e2-0x0;var _0x3813cb=_0x7af2[_0x4175e2];return _0x3813cb;};'use strict';var multer=require('multer');var util=require(_0x27af('0x0'));var path=require(_0x27af('0x1'));var timeout=require(_0x27af('0x2'));var express=require(_0x27af('0x3'));var router=express['Router']();var auth=require(_0x27af('0x4'));var interaction=require(_0x27af('0x5'));var config=require(_0x27af('0x6'));var controller=require(_0x27af('0x7'));router[_0x27af('0x8')]('/',controller[_0x27af('0x9')]);module[_0x27af('0xa')]=router; \ No newline at end of file +var _0x4e81=['./migration.controller','get','index','multer','util','path','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3522c8,_0x1e7c82){var _0x22f498=function(_0x5bf143){while(--_0x5bf143){_0x3522c8['push'](_0x3522c8['shift']());}};_0x22f498(++_0x1e7c82);}(_0x4e81,0x1bc));var _0x14e8=function(_0x5575cd,_0x73ab7a){_0x5575cd=_0x5575cd-0x0;var _0x4979a0=_0x4e81[_0x5575cd];return _0x4979a0;};'use strict';var multer=require(_0x14e8('0x0'));var util=require(_0x14e8('0x1'));var path=require(_0x14e8('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x14e8('0x3'));var interaction=require(_0x14e8('0x4'));var config=require(_0x14e8('0x5'));var controller=require(_0x14e8('0x6'));router[_0x14e8('0x7')]('/',controller[_0x14e8('0x8')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index b2b118c..bd75203 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 _0x6358=['exports','version','sequelize'];(function(_0x13e7a8,_0x222865){var _0x3ece7c=function(_0x194f1f){while(--_0x194f1f){_0x13e7a8['push'](_0x13e7a8['shift']());}};_0x3ece7c(++_0x222865);}(_0x6358,0x77));var _0x8635=function(_0x4cfb69,_0x3da94e){_0x4cfb69=_0x4cfb69-0x0;var _0x244261=_0x6358[_0x4cfb69];return _0x244261;};'use strict';var Sequelize=require(_0x8635('0x0'));module[_0x8635('0x1')]={'version':{'type':Sequelize['STRING'],'unique':_0x8635('0x2')}}; \ No newline at end of file +var _0xb980=['STRING','version','sequelize','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb980,0x12a));var _0x0b98=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb980[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x0b98('0x0'));module[_0x0b98('0x1')]={'version':{'type':Sequelize[_0x0b98('0x2')],'unique':_0x0b98('0x3')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 07dbbc1..ff7af9b 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 _0xd54e=['filter','merge','where','type','options','Migration','include','findAll','rows','catch','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','Content-Range','reject','save','update','then','destroy','end','error','stack','name','index','map','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick'];(function(_0x5d88c0,_0x5d7d83){var _0x1b40f0=function(_0x3fde10){while(--_0x3fde10){_0x5d88c0['push'](_0x5d88c0['shift']());}};_0x1b40f0(++_0x5d7d83);}(_0xd54e,0x168));var _0xed54=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd54e[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require(_0xed54('0x0'));var emlformat=require(_0xed54('0x1'));var rimraf=require(_0xed54('0x2'));var zipdir=require(_0xed54('0x3'));var jsonpatch=require(_0xed54('0x4'));var rp=require(_0xed54('0x5'));var moment=require(_0xed54('0x6'));var BPromise=require(_0xed54('0x7'));var Mustache=require(_0xed54('0x8'));var util=require(_0xed54('0x9'));var path=require(_0xed54('0xa'));var sox=require(_0xed54('0xb'));var csv=require(_0xed54('0xc'));var ejs=require(_0xed54('0xd'));var fs=require('fs');var _=require(_0xed54('0xe'));var squel=require(_0xed54('0xf'));var crypto=require(_0xed54('0x10'));var jsforce=require(_0xed54('0x11'));var deskjs=require(_0xed54('0x12'));var toCsv=require('to-csv');var querystring=require(_0xed54('0x13'));var Papa=require(_0xed54('0x14'));var Redis=require('ioredis');var authService=require(_0xed54('0x15'));var qs=require(_0xed54('0x16'));var as=require(_0xed54('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xed54('0x18'));var config=require(_0xed54('0x19'));var db=require(_0xed54('0x1a'))['db'];function respondWithStatusCode(_0x3fc877,_0x1dabf4){_0x1dabf4=_0x1dabf4||0xcc;return function(_0x1d1fc5){if(_0x1d1fc5){return _0x3fc877[_0xed54('0x1b')](_0x1dabf4);}return _0x3fc877[_0xed54('0x1c')](_0x1dabf4)['end']();};}function respondWithResult(_0x1fd2fa,_0x552f27){_0x552f27=_0x552f27||0xc8;return function(_0x57bd92){if(_0x57bd92){return _0x1fd2fa[_0xed54('0x1c')](_0x552f27)[_0xed54('0x1d')](_0x57bd92);}};}function respondWithFilteredResult(_0x41d916,_0x18a444){return function(_0x84fcbc){if(_0x84fcbc){var _0x7021c9=_0x84fcbc[_0xed54('0x1e')],_0xe3cfca=_0x18a444[_0xed54('0x1f')],_0x5a1ea8=_0x18a444[_0xed54('0x1f')]+_0x18a444[_0xed54('0x20')],_0x45beab;if(_0x5a1ea8>=_0x7021c9){_0x5a1ea8=_0x7021c9;_0x45beab=0xc8;}else{_0x45beab=0xce;}_0x41d916['status'](_0x45beab);return _0x41d916['set'](_0xed54('0x21'),_0xe3cfca+'-'+_0x5a1ea8+'/'+_0x7021c9)[_0xed54('0x1d')](_0x84fcbc);}return null;};}function patchUpdates(_0x11e1c4){return function(_0x4dbfb6){try{jsonpatch['apply'](_0x4dbfb6,_0x11e1c4,!![]);}catch(_0x524ae6){return BPromise[_0xed54('0x22')](_0x524ae6);}return _0x4dbfb6[_0xed54('0x23')]();};}function saveUpdates(_0x56305b,_0x4915d5){return function(_0x28725e){if(_0x28725e){return _0x28725e[_0xed54('0x24')](_0x56305b)[_0xed54('0x25')](function(_0x17dede){return _0x17dede;});}return null;};}function removeEntity(_0x15e8cf,_0x22f02d){return function(_0x2b43ad){if(_0x2b43ad){return _0x2b43ad[_0xed54('0x26')]()[_0xed54('0x25')](function(){_0x15e8cf[_0xed54('0x1c')](0xcc)[_0xed54('0x27')]();});}};}function handleEntityNotFound(_0x3d2158,_0x12e4de){return function(_0x5d1e02){if(!_0x5d1e02){_0x3d2158[_0xed54('0x1b')](0x194);}return _0x5d1e02;};}function handleError(_0x42db4e,_0x5e0f2b){_0x5e0f2b=_0x5e0f2b||0x1f4;return function(_0x338526){logger[_0xed54('0x28')](_0x338526[_0xed54('0x29')]);if(_0x338526[_0xed54('0x2a')]){delete _0x338526[_0xed54('0x2a')];}_0x42db4e[_0xed54('0x1c')](_0x5e0f2b)['send'](_0x338526);};}exports[_0xed54('0x2b')]=function(_0x4e4941,_0x37e166){var _0x2a7585={},_0x50398a={},_0x39d641={'count':0x0,'rows':[]};var _0x73f3c7=_[_0xed54('0x2c')](db['Migration'][_0xed54('0x2d')],function(_0x2420f9){return{'name':_0x2420f9[_0xed54('0x2e')],'type':_0x2420f9['type'][_0xed54('0x2f')]};});_0x50398a[_0xed54('0x30')]=_[_0xed54('0x2c')](_0x73f3c7,_0xed54('0x2a'));_0x50398a['query']=_[_0xed54('0x31')](_0x4e4941[_0xed54('0x32')]);_0x50398a[_0xed54('0x33')]=_[_0xed54('0x34')](_0x50398a[_0xed54('0x30')],_0x50398a[_0xed54('0x32')]);_0x2a7585[_0xed54('0x35')]=_['intersection'](_0x50398a[_0xed54('0x30')],qs['fields'](_0x4e4941[_0xed54('0x32')][_0xed54('0x36')]));_0x2a7585['attributes']=_0x2a7585['attributes'][_0xed54('0x37')]?_0x2a7585[_0xed54('0x35')]:_0x50398a[_0xed54('0x30')];if(!_0x4e4941[_0xed54('0x32')][_0xed54('0x38')]('nolimit')){_0x2a7585[_0xed54('0x20')]=qs[_0xed54('0x20')](_0x4e4941['query'][_0xed54('0x20')]);_0x2a7585[_0xed54('0x1f')]=qs[_0xed54('0x1f')](_0x4e4941['query']['offset']);}_0x2a7585[_0xed54('0x39')]=qs[_0xed54('0x3a')](_0x4e4941[_0xed54('0x32')][_0xed54('0x3a')]);_0x2a7585['where']=qs[_0xed54('0x33')](_[_0xed54('0x3b')](_0x4e4941[_0xed54('0x32')],_0x50398a['filters']));if(_0x4e4941[_0xed54('0x32')][_0xed54('0x3c')]){_0x2a7585['where']=_[_0xed54('0x3d')](_0x2a7585[_0xed54('0x3e')],{'$or':_[_0xed54('0x2c')](_0x73f3c7,function(_0xb5795d){if(_0xb5795d[_0xed54('0x3f')][_0xed54('0x2f')]!=='VIRTUAL'){var _0x1adc00={};_0x1adc00[_0xb5795d['field']]={'$like':'%'+_0x4e4941[_0xed54('0x32')][_0xed54('0x3c')]+'%'};return _0x1adc00;}})});}_0x2a7585=_[_0xed54('0x3d')]({},_0x2a7585,_0x4e4941[_0xed54('0x40')]);var _0x44e28a={'where':_0x2a7585['where']};return db[_0xed54('0x41')][_0xed54('0x1e')](_0x44e28a)[_0xed54('0x25')](function(_0x2a9fe8){_0x39d641[_0xed54('0x1e')]=_0x2a9fe8;if(_0x4e4941[_0xed54('0x32')]['includeAll']){_0x2a7585[_0xed54('0x42')]=[{'all':!![]}];}return db['Migration'][_0xed54('0x43')](_0x2a7585);})['then'](function(_0x4d74e9){_0x39d641[_0xed54('0x44')]=_0x4d74e9;return _0x39d641;})[_0xed54('0x25')](respondWithFilteredResult(_0x37e166,_0x2a7585))[_0xed54('0x45')](handleError(_0x37e166,null));}; \ No newline at end of file +var _0xfa42=['then','destroy','stack','name','send','map','Migration','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','type','VIRTUAL','field','filter','merge','options','includeAll','rows','catch','eml-format','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','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','apply','reject','save','update'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0xfa42,0x11e));var _0x2fa4=function(_0x151b7d,_0x43a079){_0x151b7d=_0x151b7d-0x0;var _0x167ca3=_0xfa42[_0x151b7d];return _0x167ca3;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2fa4('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2fa4('0x1'));var moment=require(_0x2fa4('0x2'));var BPromise=require(_0x2fa4('0x3'));var Mustache=require(_0x2fa4('0x4'));var util=require(_0x2fa4('0x5'));var path=require(_0x2fa4('0x6'));var sox=require(_0x2fa4('0x7'));var csv=require('to-csv');var ejs=require(_0x2fa4('0x8'));var fs=require('fs');var _=require(_0x2fa4('0x9'));var squel=require(_0x2fa4('0xa'));var crypto=require(_0x2fa4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x2fa4('0xc'));var toCsv=require(_0x2fa4('0xd'));var querystring=require(_0x2fa4('0xe'));var Papa=require(_0x2fa4('0xf'));var Redis=require(_0x2fa4('0x10'));var authService=require(_0x2fa4('0x11'));var qs=require(_0x2fa4('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2fa4('0x13'));var logger=require(_0x2fa4('0x14'))('api');var utils=require(_0x2fa4('0x15'));var config=require('../../config/environment');var db=require(_0x2fa4('0x16'))['db'];function respondWithStatusCode(_0x3ca354,_0x38ae82){_0x38ae82=_0x38ae82||0xcc;return function(_0x26c38){if(_0x26c38){return _0x3ca354[_0x2fa4('0x17')](_0x38ae82);}return _0x3ca354[_0x2fa4('0x18')](_0x38ae82)[_0x2fa4('0x19')]();};}function respondWithResult(_0x1a9285,_0x2a462c){_0x2a462c=_0x2a462c||0xc8;return function(_0x129960){if(_0x129960){return _0x1a9285[_0x2fa4('0x18')](_0x2a462c)[_0x2fa4('0x1a')](_0x129960);}};}function respondWithFilteredResult(_0x3b1928,_0xfa367a){return function(_0x4e3d8b){if(_0x4e3d8b){var _0x23d926=_0x4e3d8b[_0x2fa4('0x1b')],_0x2bdbf6=_0xfa367a[_0x2fa4('0x1c')],_0x4f31f3=_0xfa367a['offset']+_0xfa367a[_0x2fa4('0x1d')],_0xc83337;if(_0x4f31f3>=_0x23d926){_0x4f31f3=_0x23d926;_0xc83337=0xc8;}else{_0xc83337=0xce;}_0x3b1928[_0x2fa4('0x18')](_0xc83337);return _0x3b1928['set']('Content-Range',_0x2bdbf6+'-'+_0x4f31f3+'/'+_0x23d926)[_0x2fa4('0x1a')](_0x4e3d8b);}return null;};}function patchUpdates(_0x26261b){return function(_0x1d5c5e){try{jsonpatch[_0x2fa4('0x1e')](_0x1d5c5e,_0x26261b,!![]);}catch(_0x5bdc9c){return BPromise[_0x2fa4('0x1f')](_0x5bdc9c);}return _0x1d5c5e[_0x2fa4('0x20')]();};}function saveUpdates(_0x516ff2,_0x3905ee){return function(_0x152892){if(_0x152892){return _0x152892[_0x2fa4('0x21')](_0x516ff2)[_0x2fa4('0x22')](function(_0x3b9d67){return _0x3b9d67;});}return null;};}function removeEntity(_0x426610,_0x26456a){return function(_0x24889b){if(_0x24889b){return _0x24889b[_0x2fa4('0x23')]()[_0x2fa4('0x22')](function(){_0x426610[_0x2fa4('0x18')](0xcc)[_0x2fa4('0x19')]();});}};}function handleEntityNotFound(_0x4d7833,_0x1cbdcc){return function(_0x469ceb){if(!_0x469ceb){_0x4d7833['sendStatus'](0x194);}return _0x469ceb;};}function handleError(_0x87c8df,_0x29ffdb){_0x29ffdb=_0x29ffdb||0x1f4;return function(_0x5935d8){logger['error'](_0x5935d8[_0x2fa4('0x24')]);if(_0x5935d8[_0x2fa4('0x25')]){delete _0x5935d8[_0x2fa4('0x25')];}_0x87c8df[_0x2fa4('0x18')](_0x29ffdb)[_0x2fa4('0x26')](_0x5935d8);};}exports['index']=function(_0x1ac9eb,_0x95ae18){var _0x451242={},_0x27bf12={},_0x172f74={'count':0x0,'rows':[]};var _0x3070d9=_[_0x2fa4('0x27')](db[_0x2fa4('0x28')][_0x2fa4('0x29')],function(_0x4406a2){return{'name':_0x4406a2[_0x2fa4('0x2a')],'type':_0x4406a2['type'][_0x2fa4('0x2b')]};});_0x27bf12[_0x2fa4('0x2c')]=_[_0x2fa4('0x27')](_0x3070d9,_0x2fa4('0x25'));_0x27bf12[_0x2fa4('0x2d')]=_[_0x2fa4('0x2e')](_0x1ac9eb[_0x2fa4('0x2d')]);_0x27bf12[_0x2fa4('0x2f')]=_[_0x2fa4('0x30')](_0x27bf12[_0x2fa4('0x2c')],_0x27bf12[_0x2fa4('0x2d')]);_0x451242[_0x2fa4('0x31')]=_[_0x2fa4('0x30')](_0x27bf12['model'],qs['fields'](_0x1ac9eb['query'][_0x2fa4('0x32')]));_0x451242['attributes']=_0x451242[_0x2fa4('0x31')][_0x2fa4('0x33')]?_0x451242[_0x2fa4('0x31')]:_0x27bf12[_0x2fa4('0x2c')];if(!_0x1ac9eb[_0x2fa4('0x2d')][_0x2fa4('0x34')]('nolimit')){_0x451242[_0x2fa4('0x1d')]=qs[_0x2fa4('0x1d')](_0x1ac9eb[_0x2fa4('0x2d')][_0x2fa4('0x1d')]);_0x451242[_0x2fa4('0x1c')]=qs[_0x2fa4('0x1c')](_0x1ac9eb['query'][_0x2fa4('0x1c')]);}_0x451242['order']=qs[_0x2fa4('0x35')](_0x1ac9eb[_0x2fa4('0x2d')][_0x2fa4('0x35')]);_0x451242[_0x2fa4('0x36')]=qs[_0x2fa4('0x2f')](_['pick'](_0x1ac9eb['query'],_0x27bf12[_0x2fa4('0x2f')]));if(_0x1ac9eb[_0x2fa4('0x2d')]['filter']){_0x451242[_0x2fa4('0x36')]=_['merge'](_0x451242[_0x2fa4('0x36')],{'$or':_[_0x2fa4('0x27')](_0x3070d9,function(_0x331e98){if(_0x331e98[_0x2fa4('0x37')][_0x2fa4('0x2b')]!==_0x2fa4('0x38')){var _0x541e25={};_0x541e25[_0x331e98[_0x2fa4('0x39')]]={'$like':'%'+_0x1ac9eb[_0x2fa4('0x2d')][_0x2fa4('0x3a')]+'%'};return _0x541e25;}})});}_0x451242=_[_0x2fa4('0x3b')]({},_0x451242,_0x1ac9eb[_0x2fa4('0x3c')]);var _0x299653={'where':_0x451242[_0x2fa4('0x36')]};return db[_0x2fa4('0x28')]['count'](_0x299653)[_0x2fa4('0x22')](function(_0x26158a){_0x172f74['count']=_0x26158a;if(_0x1ac9eb[_0x2fa4('0x2d')][_0x2fa4('0x3d')]){_0x451242['include']=[{'all':!![]}];}return db[_0x2fa4('0x28')]['findAll'](_0x451242);})[_0x2fa4('0x22')](function(_0x42beac){_0x172f74[_0x2fa4('0x3e')]=_0x42beac;return _0x172f74;})[_0x2fa4('0x22')](respondWithFilteredResult(_0x95ae18,_0x451242))[_0x2fa4('0x3f')](handleError(_0x95ae18,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 4785f56..c0db54d 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 _0x4484=['../../config/logger','api','bluebird','request-promise','path','../../config/environment','define','Migration','migrations','lodash'];(function(_0x3598b5,_0x419f0){var _0x4bd112=function(_0x442c09){while(--_0x442c09){_0x3598b5['push'](_0x3598b5['shift']());}};_0x4bd112(++_0x419f0);}(_0x4484,0x12b));var _0x4448=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4484[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4448('0x0'));var util=require('util');var logger=require(_0x4448('0x1'))(_0x4448('0x2'));var moment=require('moment');var BPromise=require(_0x4448('0x3'));var rp=require(_0x4448('0x4'));var fs=require('fs');var path=require(_0x4448('0x5'));var rimraf=require('rimraf');var config=require(_0x4448('0x6'));var attributes=require('./migration.attributes');module['exports']=function(_0x3b7922,_0x1e3624){return _0x3b7922[_0x4448('0x7')](_0x4448('0x8'),attributes,{'tableName':_0x4448('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x445a=['api','bluebird','request-promise','path','../../config/environment','./migration.attributes','Migration','migrations'];(function(_0x7a0aca,_0x2b4d5a){var _0x12be1d=function(_0x76db06){while(--_0x76db06){_0x7a0aca['push'](_0x7a0aca['shift']());}};_0x12be1d(++_0x2b4d5a);}(_0x445a,0x88));var _0xa445=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x445a[_0x3947c9];return _0x2e7871;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xa445('0x0'));var moment=require('moment');var BPromise=require(_0xa445('0x1'));var rp=require(_0xa445('0x2'));var fs=require('fs');var path=require(_0xa445('0x3'));var rimraf=require('rimraf');var config=require(_0xa445('0x4'));var attributes=require(_0xa445('0x5'));module['exports']=function(_0x4e78ac,_0xb0ac74){return _0x4e78ac['define'](_0xa445('0x6'),attributes,{'tableName':_0xa445('0x7'),'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 c7f12ca..dd2e8e3 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 _0x8e3f=['../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','randomstring','ioredis'];(function(_0x34fbee,_0xc24eaa){var _0x289c90=function(_0x2ac46e){while(--_0x2ac46e){_0x34fbee['push'](_0x34fbee['shift']());}};_0x289c90(++_0xc24eaa);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x8e3f[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0xf8e3('0x0'));var util=require(_0xf8e3('0x1'));var moment=require(_0xf8e3('0x2'));var BPromise=require('bluebird');var rs=require(_0xf8e3('0x3'));var fs=require('fs');var Redis=require(_0xf8e3('0x4'));var db=require(_0xf8e3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf8e3('0x6'))(_0xf8e3('0x7'));var config=require('../../config/environment');var jayson=require(_0xf8e3('0x8'));var client=jayson[_0xf8e3('0x9')][_0xf8e3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1ee9f3,_0x4e9e57,_0x4504dd){return new BPromise(function(_0x2e39b7,_0x17f56c){return client[_0xf8e3('0xb')](_0x1ee9f3,_0x4504dd)[_0xf8e3('0xc')](function(_0x4055e2){logger[_0xf8e3('0xd')](_0xf8e3('0xe'),_0x4e9e57,_0xf8e3('0xf'));logger[_0xf8e3('0x10')](_0xf8e3('0x11'),_0x4e9e57,_0xf8e3('0xf'),JSON['stringify'](_0x4055e2));if(_0x4055e2[_0xf8e3('0x12')]){if(_0x4055e2[_0xf8e3('0x12')][_0xf8e3('0x13')]===0x1f4){logger['error'](_0xf8e3('0xe'),_0x4e9e57,_0x4055e2[_0xf8e3('0x12')][_0xf8e3('0x14')]);return _0x17f56c(_0x4055e2[_0xf8e3('0x12')]['message']);}logger[_0xf8e3('0x12')](_0xf8e3('0xe'),_0x4e9e57,_0x4055e2[_0xf8e3('0x12')]['message']);return _0x2e39b7(_0x4055e2[_0xf8e3('0x12')]['message']);}else{logger[_0xf8e3('0xd')](_0xf8e3('0xe'),_0x4e9e57,_0xf8e3('0xf'));_0x2e39b7(_0x4055e2['result']['message']);}})[_0xf8e3('0x15')](function(_0x385dde){logger[_0xf8e3('0x12')](_0xf8e3('0xe'),_0x4e9e57,_0x385dde);_0x17f56c(_0x385dde);});});} \ No newline at end of file +var _0xeec6=['jayson/promise','client','request','then','Migration,\x20%s,\x20%s','debug','Migration,\x20%s,\x20%s,\x20%s','request\x20sent','code','message','error','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x184759,_0x1cc38a){var _0xf26d5f=function(_0x1010c8){while(--_0x1010c8){_0x184759['push'](_0x184759['shift']());}};_0xf26d5f(++_0x1cc38a);}(_0xeec6,0x125));var _0x6eec=function(_0x47b7c9,_0x3848b2){_0x47b7c9=_0x47b7c9-0x0;var _0x435aaf=_0xeec6[_0x47b7c9];return _0x435aaf;};'use strict';var _=require(_0x6eec('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6eec('0x1'));var rs=require(_0x6eec('0x2'));var fs=require('fs');var Redis=require(_0x6eec('0x3'));var db=require(_0x6eec('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6eec('0x5'))(_0x6eec('0x6'));var config=require('../../config/environment');var jayson=require(_0x6eec('0x7'));var client=jayson[_0x6eec('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x174706,_0x34192c,_0x244491){return new BPromise(function(_0x1d30e1,_0x58a966){return client[_0x6eec('0x9')](_0x174706,_0x244491)[_0x6eec('0xa')](function(_0x422d71){logger['info'](_0x6eec('0xb'),_0x34192c,'request\x20sent');logger[_0x6eec('0xc')](_0x6eec('0xd'),_0x34192c,_0x6eec('0xe'),JSON['stringify'](_0x422d71));if(_0x422d71['error']){if(_0x422d71['error'][_0x6eec('0xf')]===0x1f4){logger['error']('Migration,\x20%s,\x20%s',_0x34192c,_0x422d71['error'][_0x6eec('0x10')]);return _0x58a966(_0x422d71[_0x6eec('0x11')][_0x6eec('0x10')]);}logger['error'](_0x6eec('0xb'),_0x34192c,_0x422d71[_0x6eec('0x11')][_0x6eec('0x10')]);return _0x1d30e1(_0x422d71[_0x6eec('0x11')]['message']);}else{logger['info'](_0x6eec('0xb'),_0x34192c,_0x6eec('0xe'));_0x1d30e1(_0x422d71[_0x6eec('0x12')][_0x6eec('0x10')]);}})[_0x6eec('0x13')](function(_0x36135e){logger[_0x6eec('0x11')](_0x6eec('0xb'),_0x34192c,_0x36135e);_0x58a966(_0x36135e);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 18b39b4..7155a95 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 _0xe2eb=['exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get','isAuthenticated','/:id','show','create','put','update','delete','destroy'];(function(_0x4b12ae,_0xf2b3b){var _0x16957b=function(_0x51932c){while(--_0x51932c){_0x4b12ae['push'](_0x4b12ae['shift']());}};_0x16957b(++_0xf2b3b);}(_0xe2eb,0xac));var _0xbe2e=function(_0x51ec14,_0x141c56){_0x51ec14=_0x51ec14-0x0;var _0x1736d3=_0xe2eb[_0x51ec14];return _0x1736d3;};'use strict';var multer=require(_0xbe2e('0x0'));var util=require(_0xbe2e('0x1'));var path=require('path');var timeout=require(_0xbe2e('0x2'));var express=require(_0xbe2e('0x3'));var router=express[_0xbe2e('0x4')]();var auth=require(_0xbe2e('0x5'));var interaction=require(_0xbe2e('0x6'));var config=require(_0xbe2e('0x7'));var controller=require(_0xbe2e('0x8'));router[_0xbe2e('0x9')]('/',auth[_0xbe2e('0xa')](),controller['index']);router['get'](_0xbe2e('0xb'),auth[_0xbe2e('0xa')](),controller[_0xbe2e('0xc')]);router['post']('/',auth[_0xbe2e('0xa')](),controller[_0xbe2e('0xd')]);router[_0xbe2e('0xe')]('/:id',auth[_0xbe2e('0xa')](),controller[_0xbe2e('0xf')]);router[_0xbe2e('0x10')](_0xbe2e('0xb'),auth[_0xbe2e('0xa')](),controller[_0xbe2e('0x11')]);module[_0xbe2e('0x12')]=router; \ No newline at end of file +var _0xad91=['util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get','isAuthenticated','index','/:id','create','put','update','delete','destroy','exports','multer'];(function(_0x550972,_0x2b38c6){var _0x4a1a42=function(_0x30a097){while(--_0x30a097){_0x550972['push'](_0x550972['shift']());}};_0x4a1a42(++_0x2b38c6);}(_0xad91,0xd0));var _0x1ad9=function(_0x1c5385,_0x3aba1a){_0x1c5385=_0x1c5385-0x0;var _0x478ddb=_0xad91[_0x1c5385];return _0x478ddb;};'use strict';var multer=require(_0x1ad9('0x0'));var util=require(_0x1ad9('0x1'));var path=require(_0x1ad9('0x2'));var timeout=require(_0x1ad9('0x3'));var express=require('express');var router=express[_0x1ad9('0x4')]();var auth=require(_0x1ad9('0x5'));var interaction=require(_0x1ad9('0x6'));var config=require(_0x1ad9('0x7'));var controller=require(_0x1ad9('0x8'));router[_0x1ad9('0x9')]('/',auth[_0x1ad9('0xa')](),controller[_0x1ad9('0xb')]);router[_0x1ad9('0x9')](_0x1ad9('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x1ad9('0xa')](),controller[_0x1ad9('0xd')]);router[_0x1ad9('0xe')]('/:id',auth[_0x1ad9('0xa')](),controller[_0x1ad9('0xf')]);router[_0x1ad9('0x10')]('/:id',auth[_0x1ad9('0xa')](),controller[_0x1ad9('0x11')]);module[_0x1ad9('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 8291ec0..0abe29d 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 _0x26be=['ENUM','externip','STRING','sequelize'];(function(_0x6f5768,_0x4e2676){var _0x1cb961=function(_0xc4c1cc){while(--_0xc4c1cc){_0x6f5768['push'](_0x6f5768['shift']());}};_0x1cb961(++_0x4e2676);}(_0x26be,0x17f));var _0xe26b=function(_0x23c2a1,_0x301a9b){_0x23c2a1=_0x23c2a1-0x0;var _0x588920=_0x26be[_0x23c2a1];return _0x588920;};'use strict';var Sequelize=require(_0xe26b('0x0'));module['exports']={'type':{'type':Sequelize[_0xe26b('0x1')]('localnet',_0xe26b('0x2'))},'value':{'type':Sequelize[_0xe26b('0x3')]}}; \ No newline at end of file +var _0x0fb6=['STRING','sequelize','exports','ENUM','externip'];(function(_0x3597e4,_0x1e096d){var _0x3a53d5=function(_0x4b0931){while(--_0x4b0931){_0x3597e4['push'](_0x3597e4['shift']());}};_0x3a53d5(++_0x1e096d);}(_0x0fb6,0xfb));var _0x60fb=function(_0x19c709,_0x5c00ae){_0x19c709=_0x19c709-0x0;var _0x4f201a=_0x0fb6[_0x19c709];return _0x4f201a;};'use strict';var Sequelize=require(_0x60fb('0x0'));module[_0x60fb('0x1')]={'type':{'type':Sequelize[_0x60fb('0x2')]('localnet',_0x60fb('0x3'))},'value':{'type':Sequelize[_0x60fb('0x4')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 0c16fde..c25c880 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 _0xa9e0=['util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../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~!@#$%^&-_=+[{]}.','then','Network,\x20%s,\x20%s','debug','Network,\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','map','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL','field','merge','options','Network','includeAll','rows','show','params','rawAttributes','find','create','sequelize','body','readFileSync','root','render','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','Reload','findAll','server/files/templates/network.ejs','utf8','writeFileSync','chan_sip.so','join','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache'];(function(_0x51c944,_0x1259f6){var _0x44385a=function(_0x5c3e12){while(--_0x5c3e12){_0x51c944['push'](_0x51c944['shift']());}};_0x44385a(++_0x1259f6);}(_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 as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];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=_[_0x0a9e('0x37')](db['Network']['rawAttributes'],function(_0x1e8694){return{'name':_0x1e8694['fieldName'],'type':_0x1e8694[_0x0a9e('0x38')][_0x0a9e('0x39')]};});_0x191e91[_0x0a9e('0x3a')]=_[_0x0a9e('0x37')](_0x1fa90d,'name');_0x191e91[_0x0a9e('0x3b')]=_[_0x0a9e('0x3c')](_0x2b7e7f[_0x0a9e('0x3b')]);_0x191e91['filters']=_[_0x0a9e('0x3d')](_0x191e91[_0x0a9e('0x3a')],_0x191e91[_0x0a9e('0x3b')]);_0x567193['attributes']=_['intersection'](_0x191e91[_0x0a9e('0x3a')],qs[_0x0a9e('0x3e')](_0x2b7e7f['query'][_0x0a9e('0x3e')]));_0x567193[_0x0a9e('0x3f')]=_0x567193[_0x0a9e('0x3f')][_0x0a9e('0x40')]?_0x567193['attributes']:_0x191e91['model'];if(!_0x2b7e7f[_0x0a9e('0x3b')][_0x0a9e('0x41')]('nolimit')){_0x567193[_0x0a9e('0x29')]=qs[_0x0a9e('0x29')](_0x2b7e7f[_0x0a9e('0x3b')]['limit']);_0x567193[_0x0a9e('0x28')]=qs[_0x0a9e('0x28')](_0x2b7e7f[_0x0a9e('0x3b')][_0x0a9e('0x28')]);}_0x567193[_0x0a9e('0x42')]=qs[_0x0a9e('0x43')](_0x2b7e7f[_0x0a9e('0x3b')][_0x0a9e('0x43')]);_0x567193[_0x0a9e('0x44')]=qs[_0x0a9e('0x45')](_[_0x0a9e('0x46')](_0x2b7e7f[_0x0a9e('0x3b')],_0x191e91[_0x0a9e('0x45')]));if(_0x2b7e7f[_0x0a9e('0x3b')][_0x0a9e('0x47')]){_0x567193['where']=_['merge'](_0x567193[_0x0a9e('0x44')],{'$or':_[_0x0a9e('0x37')](_0x1fa90d,function(_0x405c8f){if(_0x405c8f[_0x0a9e('0x38')][_0x0a9e('0x39')]!==_0x0a9e('0x48')){var _0x10b040={};_0x10b040[_0x405c8f[_0x0a9e('0x49')]]={'$like':'%'+_0x2b7e7f[_0x0a9e('0x3b')][_0x0a9e('0x47')]+'%'};return _0x10b040;}})});}_0x567193=_[_0x0a9e('0x4a')]({},_0x567193,_0x2b7e7f[_0x0a9e('0x4b')]);var _0x5026aa={'where':_0x567193[_0x0a9e('0x44')]};return db[_0x0a9e('0x4c')][_0x0a9e('0x27')](_0x5026aa)[_0x0a9e('0x19')](function(_0x2e8caf){_0xd1836d[_0x0a9e('0x27')]=_0x2e8caf;if(_0x2b7e7f[_0x0a9e('0x3b')][_0x0a9e('0x4d')]){_0x567193['include']=[{'all':!![]}];}return db[_0x0a9e('0x4c')]['findAll'](_0x567193);})[_0x0a9e('0x19')](function(_0x476688){_0xd1836d[_0x0a9e('0x4e')]=_0x476688;return _0xd1836d;})['then'](respondWithFilteredResult(_0x3f3d41,_0x567193))[_0x0a9e('0x24')](handleError(_0x3f3d41,null));};exports[_0x0a9e('0x4f')]=function(_0x4774f4,_0x34aa5a){var _0x45c845={'raw':!![],'where':{'id':_0x4774f4[_0x0a9e('0x50')]['id']}},_0x37be73={};_0x37be73['model']=_[_0x0a9e('0x3c')](db[_0x0a9e('0x4c')][_0x0a9e('0x51')]);_0x37be73[_0x0a9e('0x3b')]=_[_0x0a9e('0x3c')](_0x4774f4[_0x0a9e('0x3b')]);_0x37be73[_0x0a9e('0x45')]=_[_0x0a9e('0x3d')](_0x37be73[_0x0a9e('0x3a')],_0x37be73['query']);_0x45c845[_0x0a9e('0x3f')]=_[_0x0a9e('0x3d')](_0x37be73['model'],qs['fields'](_0x4774f4['query'][_0x0a9e('0x3e')]));_0x45c845[_0x0a9e('0x3f')]=_0x45c845[_0x0a9e('0x3f')][_0x0a9e('0x40')]?_0x45c845[_0x0a9e('0x3f')]:_0x37be73[_0x0a9e('0x3a')];if(_0x4774f4[_0x0a9e('0x3b')][_0x0a9e('0x4d')]){_0x45c845['include']=[{'all':!![]}];}_0x45c845=_['merge']({},_0x45c845,_0x4774f4['options']);return db[_0x0a9e('0x4c')][_0x0a9e('0x52')](_0x45c845)[_0x0a9e('0x19')](handleEntityNotFound(_0x34aa5a,null))['then'](respondWithResult(_0x34aa5a,null))[_0x0a9e('0x24')](handleError(_0x34aa5a,null));};exports[_0x0a9e('0x53')]=function(_0x53d113,_0x5a88da,_0x2ef381){var _0x59c6ff;return db[_0x0a9e('0x54')]['transaction'](function(_0x2e5e62){return db[_0x0a9e('0x4c')][_0x0a9e('0x53')](_0x53d113['body'],{'raw':!![]})[_0x0a9e('0x19')](function(_0x1bf38a){_0x59c6ff=_0x1bf38a;return db['Network']['findAll']({'where':{'type':_0x53d113[_0x0a9e('0x55')][_0x0a9e('0x38')]},'raw':!![]});})['then'](function(_0x145931){var _0x5ce9ac=fs[_0x0a9e('0x56')](path['join'](config[_0x0a9e('0x57')],'server/files/templates/network.ejs'),'utf8');var _0x5df0ad=ejs[_0x0a9e('0x58')](_0x5ce9ac,{'networks':_0x145931||[]});fs['writeFileSync'](util[_0x0a9e('0x59')](_0x0a9e('0x5a'),_0x53d113[_0x0a9e('0x55')][_0x0a9e('0x38')][_0x0a9e('0x5b')]()),_0x5df0ad);})[_0x0a9e('0x19')](function(){return respondWithRpcPromise(_0x0a9e('0x5c'),_0x0a9e('0x53'),{'module':'chan_sip.so'});})[_0x0a9e('0x19')](function(){return _0x59c6ff;});})[_0x0a9e('0x19')](respondWithResult(_0x5a88da,0xc9))[_0x0a9e('0x24')](handleError(_0x5a88da,null));};exports[_0x0a9e('0x2f')]=function(_0xb83dfd,_0x156662,_0x5d86e9){var _0x956fbe;return db[_0x0a9e('0x54')]['transaction'](function(_0x3649cc){return db['Network'][_0x0a9e('0x52')]({'where':{'id':_0xb83dfd['params']['id']}})['then'](handleEntityNotFound(_0x156662,null))['then'](saveUpdates(_0xb83dfd[_0x0a9e('0x55')],null))['then'](function(_0x2244d6){if(_0x2244d6){_0x956fbe=_0x2244d6;return db[_0x0a9e('0x4c')][_0x0a9e('0x5d')]({'where':{'type':_0x956fbe[_0x0a9e('0x38')]},'raw':!![]});}return null;})[_0x0a9e('0x19')](function(_0x26d7db){if(_0x26d7db){var _0x49eed0=fs[_0x0a9e('0x56')](path['join'](config[_0x0a9e('0x57')],_0x0a9e('0x5e')),_0x0a9e('0x5f'));var _0x5adf8f=ejs[_0x0a9e('0x58')](_0x49eed0,{'networks':_0x26d7db||[]});fs[_0x0a9e('0x60')](util[_0x0a9e('0x59')](_0x0a9e('0x5a'),_0x956fbe['type'][_0x0a9e('0x5b')]()),_0x5adf8f);return respondWithRpcPromise(_0x0a9e('0x5c'),'update',{'module':_0x0a9e('0x61')});}return null;})[_0x0a9e('0x19')](function(_0x88dcbf){if(_0x88dcbf){return _0x956fbe;}return null;});})[_0x0a9e('0x19')](respondWithResult(_0x156662,null))[_0x0a9e('0x24')](handleError(_0x156662,null));};exports['destroy']=function(_0x176840,_0x2937e0,_0x281c7d){var _0x47bb43;return db[_0x0a9e('0x4c')]['find']({'where':{'id':_0x176840['params']['id']}})[_0x0a9e('0x19')](function(_0x4556c5){_0x47bb43=_0x4556c5;return _0x4556c5;})[_0x0a9e('0x19')](handleEntityNotFound(_0x2937e0,null))[_0x0a9e('0x19')](removeEntity(_0x2937e0,null))[_0x0a9e('0x19')](function(){if(_0x47bb43){return db[_0x0a9e('0x4c')][_0x0a9e('0x5d')]({'where':{'type':_0x47bb43[_0x0a9e('0x38')]},'raw':!![]});}})[_0x0a9e('0x19')](function(_0x1cc4f3){if(_0x1cc4f3){var _0x2e89b7=fs[_0x0a9e('0x56')](path[_0x0a9e('0x62')](config[_0x0a9e('0x57')],_0x0a9e('0x5e')),_0x0a9e('0x5f'));var _0x2a28c0=ejs[_0x0a9e('0x58')](_0x2e89b7,{'networks':_0x1cc4f3||[]});fs['writeFileSync'](util[_0x0a9e('0x59')](_0x0a9e('0x5a'),_0x47bb43[_0x0a9e('0x38')]['toLowerCase']()),_0x2a28c0);return respondWithRpcPromise(_0x0a9e('0x5c'),_0x0a9e('0x30'),{'module':'chan_sip.so'});}})[_0x0a9e('0x24')](handleError(_0x2937e0,null));}; \ No newline at end of file +var _0xa9e0=['util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../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~!@#$%^&-_=+[{]}.','then','Network,\x20%s,\x20%s','debug','Network,\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','map','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL','field','merge','options','Network','includeAll','rows','show','params','rawAttributes','find','create','sequelize','body','readFileSync','root','render','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','Reload','findAll','server/files/templates/network.ejs','utf8','writeFileSync','chan_sip.so','join','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache'];(function(_0x1aed28,_0x506de0){var _0x4e9750=function(_0x2f5593){while(--_0x2f5593){_0x1aed28['push'](_0x1aed28['shift']());}};_0x4e9750(++_0x506de0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];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=_[_0x0a9e('0x37')](db['Network']['rawAttributes'],function(_0x1e8694){return{'name':_0x1e8694['fieldName'],'type':_0x1e8694[_0x0a9e('0x38')][_0x0a9e('0x39')]};});_0x191e91[_0x0a9e('0x3a')]=_[_0x0a9e('0x37')](_0x1fa90d,'name');_0x191e91[_0x0a9e('0x3b')]=_[_0x0a9e('0x3c')](_0x2b7e7f[_0x0a9e('0x3b')]);_0x191e91['filters']=_[_0x0a9e('0x3d')](_0x191e91[_0x0a9e('0x3a')],_0x191e91[_0x0a9e('0x3b')]);_0x567193['attributes']=_['intersection'](_0x191e91[_0x0a9e('0x3a')],qs[_0x0a9e('0x3e')](_0x2b7e7f['query'][_0x0a9e('0x3e')]));_0x567193[_0x0a9e('0x3f')]=_0x567193[_0x0a9e('0x3f')][_0x0a9e('0x40')]?_0x567193['attributes']:_0x191e91['model'];if(!_0x2b7e7f[_0x0a9e('0x3b')][_0x0a9e('0x41')]('nolimit')){_0x567193[_0x0a9e('0x29')]=qs[_0x0a9e('0x29')](_0x2b7e7f[_0x0a9e('0x3b')]['limit']);_0x567193[_0x0a9e('0x28')]=qs[_0x0a9e('0x28')](_0x2b7e7f[_0x0a9e('0x3b')][_0x0a9e('0x28')]);}_0x567193[_0x0a9e('0x42')]=qs[_0x0a9e('0x43')](_0x2b7e7f[_0x0a9e('0x3b')][_0x0a9e('0x43')]);_0x567193[_0x0a9e('0x44')]=qs[_0x0a9e('0x45')](_[_0x0a9e('0x46')](_0x2b7e7f[_0x0a9e('0x3b')],_0x191e91[_0x0a9e('0x45')]));if(_0x2b7e7f[_0x0a9e('0x3b')][_0x0a9e('0x47')]){_0x567193['where']=_['merge'](_0x567193[_0x0a9e('0x44')],{'$or':_[_0x0a9e('0x37')](_0x1fa90d,function(_0x405c8f){if(_0x405c8f[_0x0a9e('0x38')][_0x0a9e('0x39')]!==_0x0a9e('0x48')){var _0x10b040={};_0x10b040[_0x405c8f[_0x0a9e('0x49')]]={'$like':'%'+_0x2b7e7f[_0x0a9e('0x3b')][_0x0a9e('0x47')]+'%'};return _0x10b040;}})});}_0x567193=_[_0x0a9e('0x4a')]({},_0x567193,_0x2b7e7f[_0x0a9e('0x4b')]);var _0x5026aa={'where':_0x567193[_0x0a9e('0x44')]};return db[_0x0a9e('0x4c')][_0x0a9e('0x27')](_0x5026aa)[_0x0a9e('0x19')](function(_0x2e8caf){_0xd1836d[_0x0a9e('0x27')]=_0x2e8caf;if(_0x2b7e7f[_0x0a9e('0x3b')][_0x0a9e('0x4d')]){_0x567193['include']=[{'all':!![]}];}return db[_0x0a9e('0x4c')]['findAll'](_0x567193);})[_0x0a9e('0x19')](function(_0x476688){_0xd1836d[_0x0a9e('0x4e')]=_0x476688;return _0xd1836d;})['then'](respondWithFilteredResult(_0x3f3d41,_0x567193))[_0x0a9e('0x24')](handleError(_0x3f3d41,null));};exports[_0x0a9e('0x4f')]=function(_0x4774f4,_0x34aa5a){var _0x45c845={'raw':!![],'where':{'id':_0x4774f4[_0x0a9e('0x50')]['id']}},_0x37be73={};_0x37be73['model']=_[_0x0a9e('0x3c')](db[_0x0a9e('0x4c')][_0x0a9e('0x51')]);_0x37be73[_0x0a9e('0x3b')]=_[_0x0a9e('0x3c')](_0x4774f4[_0x0a9e('0x3b')]);_0x37be73[_0x0a9e('0x45')]=_[_0x0a9e('0x3d')](_0x37be73[_0x0a9e('0x3a')],_0x37be73['query']);_0x45c845[_0x0a9e('0x3f')]=_[_0x0a9e('0x3d')](_0x37be73['model'],qs['fields'](_0x4774f4['query'][_0x0a9e('0x3e')]));_0x45c845[_0x0a9e('0x3f')]=_0x45c845[_0x0a9e('0x3f')][_0x0a9e('0x40')]?_0x45c845[_0x0a9e('0x3f')]:_0x37be73[_0x0a9e('0x3a')];if(_0x4774f4[_0x0a9e('0x3b')][_0x0a9e('0x4d')]){_0x45c845['include']=[{'all':!![]}];}_0x45c845=_['merge']({},_0x45c845,_0x4774f4['options']);return db[_0x0a9e('0x4c')][_0x0a9e('0x52')](_0x45c845)[_0x0a9e('0x19')](handleEntityNotFound(_0x34aa5a,null))['then'](respondWithResult(_0x34aa5a,null))[_0x0a9e('0x24')](handleError(_0x34aa5a,null));};exports[_0x0a9e('0x53')]=function(_0x53d113,_0x5a88da,_0x2ef381){var _0x59c6ff;return db[_0x0a9e('0x54')]['transaction'](function(_0x2e5e62){return db[_0x0a9e('0x4c')][_0x0a9e('0x53')](_0x53d113['body'],{'raw':!![]})[_0x0a9e('0x19')](function(_0x1bf38a){_0x59c6ff=_0x1bf38a;return db['Network']['findAll']({'where':{'type':_0x53d113[_0x0a9e('0x55')][_0x0a9e('0x38')]},'raw':!![]});})['then'](function(_0x145931){var _0x5ce9ac=fs[_0x0a9e('0x56')](path['join'](config[_0x0a9e('0x57')],'server/files/templates/network.ejs'),'utf8');var _0x5df0ad=ejs[_0x0a9e('0x58')](_0x5ce9ac,{'networks':_0x145931||[]});fs['writeFileSync'](util[_0x0a9e('0x59')](_0x0a9e('0x5a'),_0x53d113[_0x0a9e('0x55')][_0x0a9e('0x38')][_0x0a9e('0x5b')]()),_0x5df0ad);})[_0x0a9e('0x19')](function(){return respondWithRpcPromise(_0x0a9e('0x5c'),_0x0a9e('0x53'),{'module':'chan_sip.so'});})[_0x0a9e('0x19')](function(){return _0x59c6ff;});})[_0x0a9e('0x19')](respondWithResult(_0x5a88da,0xc9))[_0x0a9e('0x24')](handleError(_0x5a88da,null));};exports[_0x0a9e('0x2f')]=function(_0xb83dfd,_0x156662,_0x5d86e9){var _0x956fbe;return db[_0x0a9e('0x54')]['transaction'](function(_0x3649cc){return db['Network'][_0x0a9e('0x52')]({'where':{'id':_0xb83dfd['params']['id']}})['then'](handleEntityNotFound(_0x156662,null))['then'](saveUpdates(_0xb83dfd[_0x0a9e('0x55')],null))['then'](function(_0x2244d6){if(_0x2244d6){_0x956fbe=_0x2244d6;return db[_0x0a9e('0x4c')][_0x0a9e('0x5d')]({'where':{'type':_0x956fbe[_0x0a9e('0x38')]},'raw':!![]});}return null;})[_0x0a9e('0x19')](function(_0x26d7db){if(_0x26d7db){var _0x49eed0=fs[_0x0a9e('0x56')](path['join'](config[_0x0a9e('0x57')],_0x0a9e('0x5e')),_0x0a9e('0x5f'));var _0x5adf8f=ejs[_0x0a9e('0x58')](_0x49eed0,{'networks':_0x26d7db||[]});fs[_0x0a9e('0x60')](util[_0x0a9e('0x59')](_0x0a9e('0x5a'),_0x956fbe['type'][_0x0a9e('0x5b')]()),_0x5adf8f);return respondWithRpcPromise(_0x0a9e('0x5c'),'update',{'module':_0x0a9e('0x61')});}return null;})[_0x0a9e('0x19')](function(_0x88dcbf){if(_0x88dcbf){return _0x956fbe;}return null;});})[_0x0a9e('0x19')](respondWithResult(_0x156662,null))[_0x0a9e('0x24')](handleError(_0x156662,null));};exports['destroy']=function(_0x176840,_0x2937e0,_0x281c7d){var _0x47bb43;return db[_0x0a9e('0x4c')]['find']({'where':{'id':_0x176840['params']['id']}})[_0x0a9e('0x19')](function(_0x4556c5){_0x47bb43=_0x4556c5;return _0x4556c5;})[_0x0a9e('0x19')](handleEntityNotFound(_0x2937e0,null))[_0x0a9e('0x19')](removeEntity(_0x2937e0,null))[_0x0a9e('0x19')](function(){if(_0x47bb43){return db[_0x0a9e('0x4c')][_0x0a9e('0x5d')]({'where':{'type':_0x47bb43[_0x0a9e('0x38')]},'raw':!![]});}})[_0x0a9e('0x19')](function(_0x1cc4f3){if(_0x1cc4f3){var _0x2e89b7=fs[_0x0a9e('0x56')](path[_0x0a9e('0x62')](config[_0x0a9e('0x57')],_0x0a9e('0x5e')),_0x0a9e('0x5f'));var _0x2a28c0=ejs[_0x0a9e('0x58')](_0x2e89b7,{'networks':_0x1cc4f3||[]});fs['writeFileSync'](util[_0x0a9e('0x59')](_0x0a9e('0x5a'),_0x47bb43[_0x0a9e('0x38')]['toLowerCase']()),_0x2a28c0);return respondWithRpcPromise(_0x0a9e('0x5c'),_0x0a9e('0x30'),{'module':'chan_sip.so'});}})[_0x0a9e('0x24')](handleError(_0x2937e0,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index f74bb75..d271658 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 _0xa116=['../../config/logger','moment','request-promise','rimraf','exports','Network','lodash','util'];(function(_0x1d60d0,_0x2cfa88){var _0x1a0917=function(_0x24dc91){while(--_0x24dc91){_0x1d60d0['push'](_0x1d60d0['shift']());}};_0x1a0917(++_0x2cfa88);}(_0xa116,0xc6));var _0x6a11=function(_0x37cc51,_0x46313f){_0x37cc51=_0x37cc51-0x0;var _0x3493e6=_0xa116[_0x37cc51];return _0x3493e6;};'use strict';var _=require(_0x6a11('0x0'));var util=require(_0x6a11('0x1'));var logger=require(_0x6a11('0x2'))('api');var moment=require(_0x6a11('0x3'));var BPromise=require('bluebird');var rp=require(_0x6a11('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6a11('0x5'));var config=require('../../config/environment');var attributes=require('./network.attributes');module[_0x6a11('0x6')]=function(_0x3878f9,_0x9a2b34){return _0x3878f9['define'](_0x6a11('0x7'),attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd3e2=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','Network'];(function(_0x36585d,_0x24d96e){var _0x450532=function(_0x16908e){while(--_0x16908e){_0x36585d['push'](_0x36585d['shift']());}};_0x450532(++_0x24d96e);}(_0xd3e2,0x1e0));var _0x2d3e=function(_0x4b3354,_0x122266){_0x4b3354=_0x4b3354-0x0;var _0x1aea89=_0xd3e2[_0x4b3354];return _0x1aea89;};'use strict';var _=require(_0x2d3e('0x0'));var util=require(_0x2d3e('0x1'));var logger=require(_0x2d3e('0x2'))(_0x2d3e('0x3'));var moment=require(_0x2d3e('0x4'));var BPromise=require(_0x2d3e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2d3e('0x6'));var rimraf=require(_0x2d3e('0x7'));var config=require(_0x2d3e('0x8'));var attributes=require('./network.attributes');module[_0x2d3e('0x9')]=function(_0x7b1a35,_0x1607a8){return _0x7b1a35[_0x2d3e('0xa')](_0x2d3e('0xb'),attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index f56cabd..c62db14 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 _0x3c4b=['Network,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Network,\x20%s,\x20%s','debug'];(function(_0x2278a9,_0x38ef7c){var _0x3dfc64=function(_0x587160){while(--_0x587160){_0x2278a9['push'](_0x2278a9['shift']());}};_0x3dfc64(++_0x38ef7c);}(_0x3c4b,0x134));var _0xb3c4=function(_0x1b7089,_0xc5a1ad){_0x1b7089=_0x1b7089-0x0;var _0x5ca950=_0x3c4b[_0x1b7089];return _0x5ca950;};'use strict';var _=require(_0xb3c4('0x0'));var util=require(_0xb3c4('0x1'));var moment=require(_0xb3c4('0x2'));var BPromise=require(_0xb3c4('0x3'));var rs=require(_0xb3c4('0x4'));var fs=require('fs');var Redis=require(_0xb3c4('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb3c4('0x6'));var logger=require(_0xb3c4('0x7'))(_0xb3c4('0x8'));var config=require(_0xb3c4('0x9'));var jayson=require(_0xb3c4('0xa'));var client=jayson[_0xb3c4('0xb')][_0xb3c4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x18649a,_0x66600f,_0x284259){return new BPromise(function(_0x55d1cc,_0x2a7ce7){return client[_0xb3c4('0xd')](_0x18649a,_0x284259)[_0xb3c4('0xe')](function(_0x4d8162){logger['info'](_0xb3c4('0xf'),_0x66600f,'request\x20sent');logger[_0xb3c4('0x10')](_0xb3c4('0x11'),_0x66600f,_0xb3c4('0x12'),JSON[_0xb3c4('0x13')](_0x4d8162));if(_0x4d8162[_0xb3c4('0x14')]){if(_0x4d8162[_0xb3c4('0x14')][_0xb3c4('0x15')]===0x1f4){logger['error'](_0xb3c4('0xf'),_0x66600f,_0x4d8162[_0xb3c4('0x14')][_0xb3c4('0x16')]);return _0x2a7ce7(_0x4d8162[_0xb3c4('0x14')][_0xb3c4('0x16')]);}logger[_0xb3c4('0x14')](_0xb3c4('0xf'),_0x66600f,_0x4d8162[_0xb3c4('0x14')][_0xb3c4('0x16')]);return _0x55d1cc(_0x4d8162[_0xb3c4('0x14')]['message']);}else{logger[_0xb3c4('0x17')](_0xb3c4('0xf'),_0x66600f,_0xb3c4('0x12'));_0x55d1cc(_0x4d8162['result']['message']);}})[_0xb3c4('0x18')](function(_0x448639){logger[_0xb3c4('0x14')](_0xb3c4('0xf'),_0x66600f,_0x448639);_0x2a7ce7(_0x448639);});});} \ No newline at end of file +var _0xc322=['message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/environment','jayson/promise','http','request','then','Network,\x20%s,\x20%s','request\x20sent','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x2bf5bd,_0x120787){var _0xc810c0=function(_0xba9dd3){while(--_0xba9dd3){_0x2bf5bd['push'](_0x2bf5bd['shift']());}};_0xc810c0(++_0x120787);}(_0xc322,0x1de));var _0x2c32=function(_0x1ac120,_0x3e7e45){_0x1ac120=_0x1ac120-0x0;var _0x19b703=_0xc322[_0x1ac120];return _0x19b703;};'use strict';var _=require(_0x2c32('0x0'));var util=require(_0x2c32('0x1'));var moment=require('moment');var BPromise=require(_0x2c32('0x2'));var rs=require(_0x2c32('0x3'));var fs=require('fs');var Redis=require(_0x2c32('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x2c32('0x5'));var jayson=require(_0x2c32('0x6'));var client=jayson['client'][_0x2c32('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x117e82,_0x3f74ff,_0x222bf5){return new BPromise(function(_0x1d1248,_0x18e25b){return client[_0x2c32('0x8')](_0x117e82,_0x222bf5)[_0x2c32('0x9')](function(_0xdd9691){logger['info'](_0x2c32('0xa'),_0x3f74ff,_0x2c32('0xb'));logger['debug'](_0x2c32('0xc'),_0x3f74ff,_0x2c32('0xb'),JSON[_0x2c32('0xd')](_0xdd9691));if(_0xdd9691[_0x2c32('0xe')]){if(_0xdd9691['error'][_0x2c32('0xf')]===0x1f4){logger[_0x2c32('0xe')]('Network,\x20%s,\x20%s',_0x3f74ff,_0xdd9691[_0x2c32('0xe')][_0x2c32('0x10')]);return _0x18e25b(_0xdd9691[_0x2c32('0xe')][_0x2c32('0x10')]);}logger[_0x2c32('0xe')]('Network,\x20%s,\x20%s',_0x3f74ff,_0xdd9691[_0x2c32('0xe')]['message']);return _0x1d1248(_0xdd9691[_0x2c32('0xe')][_0x2c32('0x10')]);}else{logger['info'](_0x2c32('0xa'),_0x3f74ff,_0x2c32('0xb'));_0x1d1248(_0xdd9691[_0x2c32('0x11')][_0x2c32('0x10')]);}})[_0x2c32('0x12')](function(_0x58c4e2){logger['error']('Network,\x20%s,\x20%s',_0x3f74ff,_0x58c4e2);_0x18e25b(_0x58c4e2);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 2e0e383..96be41f 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 _0x72ee=['connect-timeout','express','Router','../../components/auth/service','../../config/environment','./openchannelAccount.controller','isAuthenticated','get','/describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','post','create','/:id/dispositions','addDisposition','/:id/notify','notify','/:id/users','/:id/send','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','multer','util','path'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0x72ee,0x66));var _0xe72e=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x72ee[_0x4a9fb1];return _0x348672;};'use strict';var multer=require(_0xe72e('0x0'));var util=require(_0xe72e('0x1'));var path=require(_0xe72e('0x2'));var timeout=require(_0xe72e('0x3'));var express=require(_0xe72e('0x4'));var router=express[_0xe72e('0x5')]();var auth=require(_0xe72e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe72e('0x7'));var controller=require(_0xe72e('0x8'));router['get']('/',auth[_0xe72e('0x9')](),controller['index']);router[_0xe72e('0xa')](_0xe72e('0xb'),auth[_0xe72e('0x9')](),controller['describe']);router[_0xe72e('0xa')](_0xe72e('0xc'),auth[_0xe72e('0x9')](),controller[_0xe72e('0xd')]);router[_0xe72e('0xa')]('/:id/dispositions',auth[_0xe72e('0x9')](),controller[_0xe72e('0xe')]);router['get'](_0xe72e('0xf'),auth['isAuthenticated'](),controller[_0xe72e('0x10')]);router['get'](_0xe72e('0x11'),auth['isAuthenticated'](),controller[_0xe72e('0x12')]);router[_0xe72e('0xa')](_0xe72e('0x13'),auth[_0xe72e('0x9')](),controller[_0xe72e('0x14')]);router[_0xe72e('0xa')]('/:id/users',auth[_0xe72e('0x9')](),controller['getAgents']);router[_0xe72e('0x15')]('/',auth['isAuthenticated'](),controller[_0xe72e('0x16')]);router['post'](_0xe72e('0x17'),auth[_0xe72e('0x9')](),controller[_0xe72e('0x18')]);router[_0xe72e('0x15')](_0xe72e('0xf'),auth[_0xe72e('0x9')](),controller['addAnswer']);router[_0xe72e('0x15')](_0xe72e('0x19'),controller[_0xe72e('0x1a')]);router[_0xe72e('0x15')](_0xe72e('0x11'),auth['isAuthenticated'](),controller['addApplications']);router[_0xe72e('0x15')](_0xe72e('0x1b'),auth[_0xe72e('0x9')](),controller['addAgents']);router[_0xe72e('0x15')](_0xe72e('0x1c'),auth[_0xe72e('0x9')](),controller['send']);router['put'](_0xe72e('0xc'),auth[_0xe72e('0x9')](),controller[_0xe72e('0x1d')]);router[_0xe72e('0x1e')]('/:id',auth[_0xe72e('0x9')](),controller[_0xe72e('0x1f')]);router[_0xe72e('0x1e')](_0xe72e('0x17'),auth[_0xe72e('0x9')](),controller[_0xe72e('0x20')]);router[_0xe72e('0x1e')](_0xe72e('0xf'),auth[_0xe72e('0x9')](),controller[_0xe72e('0x21')]);router[_0xe72e('0x1e')](_0xe72e('0x1b'),auth[_0xe72e('0x9')](),controller[_0xe72e('0x22')]);module['exports']=router; \ No newline at end of file +var _0xee06=['/:id/users','post','/:id/dispositions','addDisposition','addAnswer','notify','/:id/applications','addApplications','addAgents','/:id/send','send','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','/describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','getApplications'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xee06,0x13a));var _0x6ee0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xee06[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x6ee0('0x0'));var path=require(_0x6ee0('0x1'));var timeout=require(_0x6ee0('0x2'));var express=require(_0x6ee0('0x3'));var router=express[_0x6ee0('0x4')]();var auth=require(_0x6ee0('0x5'));var interaction=require(_0x6ee0('0x6'));var config=require(_0x6ee0('0x7'));var controller=require(_0x6ee0('0x8'));router[_0x6ee0('0x9')]('/',auth[_0x6ee0('0xa')](),controller[_0x6ee0('0xb')]);router['get'](_0x6ee0('0xc'),auth[_0x6ee0('0xa')](),controller['describe']);router[_0x6ee0('0x9')](_0x6ee0('0xd'),auth['isAuthenticated'](),controller[_0x6ee0('0xe')]);router[_0x6ee0('0x9')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x6ee0('0xf')]);router[_0x6ee0('0x9')](_0x6ee0('0x10'),auth[_0x6ee0('0xa')](),controller[_0x6ee0('0x11')]);router[_0x6ee0('0x9')]('/:id/applications',auth[_0x6ee0('0xa')](),controller[_0x6ee0('0x12')]);router['get']('/:id/interactions',auth[_0x6ee0('0xa')](),controller['getInteractions']);router['get'](_0x6ee0('0x13'),auth[_0x6ee0('0xa')](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x6ee0('0x14')](_0x6ee0('0x15'),auth[_0x6ee0('0xa')](),controller[_0x6ee0('0x16')]);router[_0x6ee0('0x14')](_0x6ee0('0x10'),auth[_0x6ee0('0xa')](),controller[_0x6ee0('0x17')]);router['post']('/:id/notify',controller[_0x6ee0('0x18')]);router[_0x6ee0('0x14')](_0x6ee0('0x19'),auth['isAuthenticated'](),controller[_0x6ee0('0x1a')]);router[_0x6ee0('0x14')](_0x6ee0('0x13'),auth[_0x6ee0('0xa')](),controller[_0x6ee0('0x1b')]);router[_0x6ee0('0x14')](_0x6ee0('0x1c'),auth['isAuthenticated'](),controller[_0x6ee0('0x1d')]);router['put']('/:id',auth[_0x6ee0('0xa')](),controller[_0x6ee0('0x1e')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x6ee0('0x1f')]);router[_0x6ee0('0x20')](_0x6ee0('0x15'),auth['isAuthenticated'](),controller[_0x6ee0('0x21')]);router[_0x6ee0('0x20')](_0x6ee0('0x10'),auth[_0x6ee0('0xa')](),controller[_0x6ee0('0x22')]);router[_0x6ee0('0x20')](_0x6ee0('0x13'),auth[_0x6ee0('0xa')](),controller[_0x6ee0('0x23')]);module[_0x6ee0('0x24')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index b2d4ab7..4ea4515 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 _0xf68b=['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','mandatoryDispositionPauseId','mandatoryDisposition','sequelize'];(function(_0x15b78c,_0x49bc55){var _0x41c852=function(_0x273d7e){while(--_0x273d7e){_0x15b78c['push'](_0x15b78c['shift']());}};_0x41c852(++_0x49bc55);}(_0xf68b,0x95));var _0xbf68=function(_0x3a4035,_0x4303b8){_0x3a4035=_0x3a4035-0x0;var _0x654339=_0xf68b[_0x3a4035];return _0x654339;};'use strict';var Sequelize=require(_0xbf68('0x0'));var rs=require(_0xbf68('0x1'));module[_0xbf68('0x2')]={'name':{'type':Sequelize[_0xbf68('0x3')],'unique':_0xbf68('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0xbf68('0x3')]},'token':{'type':Sequelize[_0xbf68('0x3')],'defaultValue':function(){return rs[_0xbf68('0x5')]();}},'replyUri':{'type':Sequelize[_0xbf68('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xbf68('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xbf68('0x6')],'defaultValue':function(){return _0xbf68('0x7');}},'notificationSound':{'type':Sequelize[_0xbf68('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xbf68('0x3')]},'queueTransfer':{'type':Sequelize[_0xbf68('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xbf68('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xbf68('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xbf68('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xbf68('0x9')],'allowNull':!![],'defaultValue':null,'comment':_0xbf68('0xa')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xbf68('0xb'),'set':function(_0x49ec51){if(!_0x49ec51)this[_0xbf68('0xc')](_0xbf68('0xd'),null);this['setDataValue'](_0xbf68('0xe'),_0x49ec51);}}}; \ No newline at end of file +var _0x975f=['STRING','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports'];(function(_0x2da357,_0x1f9b2f){var _0x138fdd=function(_0xe3077d){while(--_0xe3077d){_0x2da357['push'](_0x2da357['shift']());}};_0x138fdd(++_0x1f9b2f);}(_0x975f,0x15c));var _0xf975=function(_0x18b5e8,_0x51e875){_0x18b5e8=_0x18b5e8-0x0;var _0x25baed=_0x975f[_0x18b5e8];return _0x25baed;};'use strict';var Sequelize=require(_0xf975('0x0'));var rs=require(_0xf975('0x1'));module[_0xf975('0x2')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xf975('0x3')]},'token':{'type':Sequelize[_0xf975('0x3')],'defaultValue':function(){return rs[_0xf975('0x4')]();}},'replyUri':{'type':Sequelize[_0xf975('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xf975('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xf975('0x5')],'defaultValue':function(){return _0xf975('0x6');}},'notificationSound':{'type':Sequelize[_0xf975('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xf975('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xf975('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xf975('0x3')]},'queueTransfer':{'type':Sequelize[_0xf975('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf975('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xf975('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf975('0x8')],'allowNull':!![],'defaultValue':null,'comment':_0xf975('0x9')},'mandatoryDisposition':{'type':Sequelize[_0xf975('0x7')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x4e2c26){if(!_0x4e2c26)this[_0xf975('0xa')](_0xf975('0xb'),null);this[_0xf975('0xa')](_0xf975('0xc'),_0x4e2c26);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 585c5ae..75a3a73 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 _0xbd44=['rawAttributes','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','field','options','include','findAll','rows','show','params','Pause','mandatoryDispositionPause','fields','includeAll','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','OpnechannelAccountId','Disposition','getDispositions','findOne','ids','addAnswer','getAnswers','OpenchannelAccountId','CannedAnswer','removeAnswers','notify','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','List','Contacts','DESC','OpenchannelApplication','applications','Applications','orderBy','priority','asc','account','contact','lastName','threadId','OpenchannelInteraction','spread','messageId','interaction','created','push','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','transaction','bulkCreate','getApplications','User','Tag','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','CmList','Messages','dataValues','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','defaults','./openchannelAccount.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','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','OpenchannelAccounts','UserProfileResource','end','stack','name','send','index','map','OpenchannelAccount'];(function(_0x121fef,_0x52a864){var _0x34a7c7=function(_0x3ca2a8){while(--_0x3ca2a8){_0x121fef['push'](_0x121fef['shift']());}};_0x34a7c7(++_0x52a864);}(_0xbd44,0x7a));var _0x4bd4=function(_0x2ecd93,_0x312e2e){_0x2ecd93=_0x2ecd93-0x0;var _0x421e67=_0xbd44[_0x2ecd93];return _0x421e67;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x4bd4('0x0'));var rimraf=require(_0x4bd4('0x1'));var zipdir=require(_0x4bd4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4bd4('0x3'));var moment=require(_0x4bd4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4bd4('0x5'));var util=require(_0x4bd4('0x6'));var path=require(_0x4bd4('0x7'));var sox=require(_0x4bd4('0x8'));var csv=require('to-csv');var ejs=require(_0x4bd4('0x9'));var fs=require('fs');var _=require(_0x4bd4('0xa'));var squel=require('squel');var crypto=require(_0x4bd4('0xb'));var jsforce=require(_0x4bd4('0xc'));var deskjs=require(_0x4bd4('0xd'));var toCsv=require(_0x4bd4('0xe'));var querystring=require(_0x4bd4('0xf'));var Papa=require(_0x4bd4('0x10'));var Redis=require(_0x4bd4('0x11'));var authService=require(_0x4bd4('0x12'));var qs=require(_0x4bd4('0x13'));var as=require(_0x4bd4('0x14'));var hardwareService=require(_0x4bd4('0x15'));var logger=require('../../config/logger')(_0x4bd4('0x16'));var utils=require(_0x4bd4('0x17'));var config=require('../../config/environment');var db=require(_0x4bd4('0x18'))['db'];config[_0x4bd4('0x19')]=_[_0x4bd4('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4bd4('0x19')]));require(_0x4bd4('0x1b'))[_0x4bd4('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x4bd4('0x1d')][_0x4bd4('0x1e')]({'port':0x232a});function checkPasswordPattern(_0xdf5ded,_0x2de307,_0x179918){if(_0x179918){var _0x24be7b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x24be7b[_0x4bd4('0x1f')](_0x2de307)){return _0xdf5ded;}else{throw new Error(_0x4bd4('0x20'));}}else{return _0xdf5ded;}}function respondWithRpcPromise(_0x224492,_0x3b55bd,_0x21dd0f,_0x41ae09){return new BPromise(function(_0x5c2e74,_0x29de1e){var _0x1e3605=_0x41ae09||client;return _0x1e3605[_0x4bd4('0x21')](_0x224492,_0x21dd0f)[_0x4bd4('0x22')](function(_0x4ffe67){logger[_0x4bd4('0x23')](_0x4bd4('0x24'),_0x3b55bd,_0x4bd4('0x25'));logger[_0x4bd4('0x26')](_0x4bd4('0x27'),_0x3b55bd,_0x4bd4('0x25'),JSON[_0x4bd4('0x28')](_0x4ffe67));if(_0x4ffe67[_0x4bd4('0x29')]){if(_0x4ffe67[_0x4bd4('0x29')]['code']===0x1f4){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x3b55bd,_0x4ffe67[_0x4bd4('0x29')][_0x4bd4('0x2a')]);return _0x29de1e(_0x4ffe67[_0x4bd4('0x29')]['message']);}logger[_0x4bd4('0x29')]('OpenchannelAccount,\x20%s,\x20%s',_0x3b55bd,_0x4ffe67[_0x4bd4('0x29')][_0x4bd4('0x2a')]);return _0x5c2e74(_0x4ffe67['error']['message']);}else{logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x3b55bd,_0x4bd4('0x25'));_0x5c2e74(_0x4ffe67[_0x4bd4('0x2b')][_0x4bd4('0x2a')]);}})[_0x4bd4('0x2c')](function(_0x2b159c){logger[_0x4bd4('0x29')](_0x4bd4('0x24'),_0x3b55bd,_0x2b159c);_0x29de1e(_0x2b159c);});});}function respondWithStatusCode(_0x35a81b,_0x2efdec){_0x2efdec=_0x2efdec||0xcc;return function(_0x31abb8){if(_0x31abb8){return _0x35a81b[_0x4bd4('0x2d')](_0x2efdec);}return _0x35a81b[_0x4bd4('0x2e')](_0x2efdec)['end']();};}function respondWithResult(_0x4b27f8,_0x29d937){_0x29d937=_0x29d937||0xc8;return function(_0x48fd6f){if(_0x48fd6f){return _0x4b27f8[_0x4bd4('0x2e')](_0x29d937)[_0x4bd4('0x2f')](_0x48fd6f);}};}function respondWithFilteredResult(_0x46320a,_0x947b79){return function(_0x13c149){if(_0x13c149){var _0xedf285=_0x13c149[_0x4bd4('0x30')],_0xdcd9d9=_0x947b79[_0x4bd4('0x31')],_0x3f09d2=_0x947b79[_0x4bd4('0x31')]+_0x947b79[_0x4bd4('0x32')],_0x3a324d;if(_0x3f09d2>=_0xedf285){_0x3f09d2=_0xedf285;_0x3a324d=0xc8;}else{_0x3a324d=0xce;}_0x46320a[_0x4bd4('0x2e')](_0x3a324d);return _0x46320a[_0x4bd4('0x33')](_0x4bd4('0x34'),_0xdcd9d9+'-'+_0x3f09d2+'/'+_0xedf285)[_0x4bd4('0x2f')](_0x13c149);}return null;};}function patchUpdates(_0x23a786){return function(_0x345219){try{jsonpatch['apply'](_0x345219,_0x23a786,!![]);}catch(_0x208e56){return BPromise[_0x4bd4('0x35')](_0x208e56);}return _0x345219[_0x4bd4('0x36')]();};}function saveUpdates(_0x5840ce,_0x44e571){return function(_0x1a85cb){if(_0x1a85cb){return _0x1a85cb[_0x4bd4('0x37')](_0x5840ce)['then'](function(_0x242f10){return _0x242f10;});}return null;};}function removeEntity(_0x395967,_0x2e2c7d){return function(_0x2ae3df){if(_0x2ae3df){return _0x2ae3df[_0x4bd4('0x38')]()['then'](function(){var _0x5e0bb0=_0x2ae3df['get']({'plain':!![]});var _0x534a37=_0x4bd4('0x39');return db[_0x4bd4('0x3a')][_0x4bd4('0x38')]({'where':{'type':_0x534a37,'resourceId':_0x5e0bb0['id']}})[_0x4bd4('0x22')](function(){return _0x2ae3df;});})[_0x4bd4('0x22')](function(){_0x395967[_0x4bd4('0x2e')](0xcc)[_0x4bd4('0x3b')]();});}};}function handleEntityNotFound(_0x2a5bd1,_0x40c8b8){return function(_0xb1e33b){if(!_0xb1e33b){_0x2a5bd1[_0x4bd4('0x2d')](0x194);}return _0xb1e33b;};}function handleError(_0x114c18,_0x38e56d){_0x38e56d=_0x38e56d||0x1f4;return function(_0x224e92){logger['error'](_0x224e92[_0x4bd4('0x3c')]);if(_0x224e92[_0x4bd4('0x3d')]){delete _0x224e92[_0x4bd4('0x3d')];}_0x114c18[_0x4bd4('0x2e')](_0x38e56d)[_0x4bd4('0x3e')](_0x224e92);};}exports[_0x4bd4('0x3f')]=function(_0x39bdd6,_0x340140){var _0x4ecfeb={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x62fb36={},_0x3423c5={'count':0x0,'rows':[]};var _0x4f368a=_[_0x4bd4('0x40')](db[_0x4bd4('0x41')][_0x4bd4('0x42')],function(_0x352b7e){return{'name':_0x352b7e['fieldName'],'type':_0x352b7e[_0x4bd4('0x43')][_0x4bd4('0x44')]};});_0x62fb36[_0x4bd4('0x45')]=_[_0x4bd4('0x40')](_0x4f368a,_0x4bd4('0x3d'));_0x62fb36[_0x4bd4('0x46')]=_[_0x4bd4('0x47')](_0x39bdd6[_0x4bd4('0x46')]);_0x62fb36['filters']=_[_0x4bd4('0x48')](_0x62fb36[_0x4bd4('0x45')],_0x62fb36[_0x4bd4('0x46')]);_0x4ecfeb[_0x4bd4('0x49')]=_[_0x4bd4('0x48')](_0x62fb36[_0x4bd4('0x45')],qs['fields'](_0x39bdd6[_0x4bd4('0x46')]['fields']));_0x4ecfeb[_0x4bd4('0x49')]=_0x4ecfeb[_0x4bd4('0x49')][_0x4bd4('0x4a')]?_0x4ecfeb[_0x4bd4('0x49')]:_0x62fb36[_0x4bd4('0x45')];if(!_0x39bdd6['query'][_0x4bd4('0x4b')](_0x4bd4('0x4c'))){_0x4ecfeb[_0x4bd4('0x32')]=qs[_0x4bd4('0x32')](_0x39bdd6['query'][_0x4bd4('0x32')]);_0x4ecfeb['offset']=qs['offset'](_0x39bdd6['query']['offset']);}_0x4ecfeb[_0x4bd4('0x4d')]=qs[_0x4bd4('0x4e')](_0x39bdd6[_0x4bd4('0x46')][_0x4bd4('0x4e')]);_0x4ecfeb['where']=qs[_0x4bd4('0x4f')](_[_0x4bd4('0x50')](_0x39bdd6[_0x4bd4('0x46')],_0x62fb36[_0x4bd4('0x4f')]));if(_0x39bdd6[_0x4bd4('0x46')][_0x4bd4('0x51')]){_0x4ecfeb[_0x4bd4('0x52')]=_[_0x4bd4('0x53')](_0x4ecfeb[_0x4bd4('0x52')],{'$or':_['map'](_0x4f368a,function(_0x5e20c6){if(_0x5e20c6[_0x4bd4('0x43')]['key']!==_0x4bd4('0x54')){var _0x426cc8={};_0x426cc8[_0x5e20c6[_0x4bd4('0x55')]]={'$like':'%'+_0x39bdd6[_0x4bd4('0x46')]['filter']+'%'};return _0x426cc8;}})});}_0x4ecfeb=_[_0x4bd4('0x53')]({},_0x4ecfeb,_0x39bdd6[_0x4bd4('0x56')]);var _0x1b60ab={'where':_0x4ecfeb[_0x4bd4('0x52')]};return db[_0x4bd4('0x41')][_0x4bd4('0x30')](_0x1b60ab)[_0x4bd4('0x22')](function(_0x391995){_0x3423c5[_0x4bd4('0x30')]=_0x391995;if(_0x39bdd6[_0x4bd4('0x46')]['includeAll']){_0x4ecfeb[_0x4bd4('0x57')]=[{'all':!![]}];}return db[_0x4bd4('0x41')][_0x4bd4('0x58')](_0x4ecfeb);})[_0x4bd4('0x22')](function(_0x459a78){_0x3423c5[_0x4bd4('0x59')]=_0x459a78;return _0x3423c5;})[_0x4bd4('0x22')](respondWithFilteredResult(_0x340140,_0x4ecfeb))[_0x4bd4('0x2c')](handleError(_0x340140,null));};exports[_0x4bd4('0x5a')]=function(_0xb6db4e,_0x4c9e7f){var _0x1b77a9={'raw':![],'where':{'id':_0xb6db4e[_0x4bd4('0x5b')]['id']},'include':[{'model':db[_0x4bd4('0x5c')],'as':_0x4bd4('0x5d')}]},_0x3200ff={};_0x3200ff['model']=_[_0x4bd4('0x47')](db['OpenchannelAccount']['rawAttributes']);_0x3200ff[_0x4bd4('0x46')]=_[_0x4bd4('0x47')](_0xb6db4e['query']);_0x3200ff[_0x4bd4('0x4f')]=_[_0x4bd4('0x48')](_0x3200ff[_0x4bd4('0x45')],_0x3200ff['query']);_0x1b77a9[_0x4bd4('0x49')]=_[_0x4bd4('0x48')](_0x3200ff[_0x4bd4('0x45')],qs['fields'](_0xb6db4e['query'][_0x4bd4('0x5e')]));_0x1b77a9['attributes']=_0x1b77a9[_0x4bd4('0x49')]['length']?_0x1b77a9[_0x4bd4('0x49')]:_0x3200ff[_0x4bd4('0x45')];if(_0xb6db4e['query'][_0x4bd4('0x5f')]){_0x1b77a9[_0x4bd4('0x57')]=[{'all':!![]}];}_0x1b77a9=_[_0x4bd4('0x53')]({},_0x1b77a9,_0xb6db4e[_0x4bd4('0x56')]);return db['OpenchannelAccount'][_0x4bd4('0x60')](_0x1b77a9)[_0x4bd4('0x22')](handleEntityNotFound(_0x4c9e7f,null))[_0x4bd4('0x22')](respondWithResult(_0x4c9e7f,null))[_0x4bd4('0x2c')](handleError(_0x4c9e7f,null));};exports[_0x4bd4('0x61')]=function(_0x4d4a44,_0x437269){return db['OpenchannelAccount']['create'](_0x4d4a44[_0x4bd4('0x62')],{})[_0x4bd4('0x22')](function(_0x158f64){var _0x23aaa8=_0x4d4a44['user'][_0x4bd4('0x63')]({'plain':!![]});if(!_0x23aaa8)throw new Error(_0x4bd4('0x64'));if(_0x23aaa8[_0x4bd4('0x65')]===_0x4bd4('0x66')){var _0xcac9f7=_0x158f64[_0x4bd4('0x63')]({'plain':!![]});var _0x38dad9=_0x4bd4('0x39');return db[_0x4bd4('0x67')]['find']({'where':{'name':_0x38dad9,'userProfileId':_0x23aaa8[_0x4bd4('0x68')]},'raw':!![]})['then'](function(_0x5119a1){if(_0x5119a1&&_0x5119a1[_0x4bd4('0x69')]===0x0){return db[_0x4bd4('0x3a')]['create']({'name':_0xcac9f7['name'],'resourceId':_0xcac9f7['id'],'type':_0x5119a1[_0x4bd4('0x3d')],'sectionId':_0x5119a1['id']},{})[_0x4bd4('0x22')](function(){return _0x158f64;});}else{return _0x158f64;}})[_0x4bd4('0x2c')](function(_0x120235){logger['error'](_0x4bd4('0x6a'),_0x120235);throw _0x120235;});}return _0x158f64;})[_0x4bd4('0x22')](respondWithResult(_0x437269,0xc9))['catch'](handleError(_0x437269,null));};exports[_0x4bd4('0x37')]=function(_0x250cd9,_0x46676e){if(_0x250cd9[_0x4bd4('0x62')]['id']){delete _0x250cd9[_0x4bd4('0x62')]['id'];}return db['OpenchannelAccount'][_0x4bd4('0x60')]({'where':{'id':_0x250cd9[_0x4bd4('0x5b')]['id']},'include':[{'model':db[_0x4bd4('0x5c')],'as':_0x4bd4('0x5d')}]})[_0x4bd4('0x22')](handleEntityNotFound(_0x46676e,null))[_0x4bd4('0x22')](saveUpdates(_0x250cd9[_0x4bd4('0x62')],null))[_0x4bd4('0x22')](respondWithResult(_0x46676e,null))[_0x4bd4('0x2c')](handleError(_0x46676e,null));};exports[_0x4bd4('0x38')]=function(_0x1302fc,_0xdbb34f){return db['OpenchannelAccount'][_0x4bd4('0x60')]({'where':{'id':_0x1302fc['params']['id']}})[_0x4bd4('0x22')](handleEntityNotFound(_0xdbb34f,null))[_0x4bd4('0x22')](removeEntity(_0xdbb34f,null))[_0x4bd4('0x2c')](handleError(_0xdbb34f,null));};exports[_0x4bd4('0x6b')]=function(_0x1fca27,_0x2c6b2d){return db[_0x4bd4('0x41')][_0x4bd4('0x6b')]()['then'](respondWithResult(_0x2c6b2d,null))[_0x4bd4('0x2c')](handleError(_0x2c6b2d,null));};exports['addDisposition']=function(_0x4eeaea,_0x46d4df,_0x3132c8){if(_0x4eeaea[_0x4bd4('0x62')]['id']){delete _0x4eeaea[_0x4bd4('0x62')]['id'];}return db[_0x4bd4('0x41')][_0x4bd4('0x60')]({'where':{'id':_0x4eeaea['params']['id']}})[_0x4bd4('0x22')](handleEntityNotFound(_0x46d4df,null))[_0x4bd4('0x22')](function(_0x1afd42){if(_0x1afd42){_0x4eeaea[_0x4bd4('0x62')][_0x4bd4('0x6c')]=_0x1afd42['id'];return db[_0x4bd4('0x6d')]['create'](_0x4eeaea['body']);}})[_0x4bd4('0x22')](respondWithResult(_0x46d4df,null))[_0x4bd4('0x2c')](handleError(_0x46d4df,null));};exports[_0x4bd4('0x6e')]=function(_0x1f4f8f,_0x4692f3,_0x10ea59){var _0x2324ac={'raw':![],'where':{}};var _0x5a3592={};var _0xae8738={'count':0x0,'rows':[]};return db[_0x4bd4('0x41')][_0x4bd4('0x6f')]({'where':{'id':_0x1f4f8f['params']['id']}})[_0x4bd4('0x22')](handleEntityNotFound(_0x4692f3,null))['then'](function(_0x53de67){if(_0x53de67){_0x5a3592['model']=_[_0x4bd4('0x47')](db[_0x4bd4('0x6d')]['rawAttributes']);_0x5a3592[_0x4bd4('0x46')]=_['keys'](_0x1f4f8f[_0x4bd4('0x46')]);_0x5a3592[_0x4bd4('0x4f')]=_['intersection'](_0x5a3592[_0x4bd4('0x45')],_0x5a3592[_0x4bd4('0x46')]);_0x2324ac[_0x4bd4('0x49')]=_[_0x4bd4('0x48')](_0x5a3592['model'],qs[_0x4bd4('0x5e')](_0x1f4f8f[_0x4bd4('0x46')][_0x4bd4('0x5e')]));_0x2324ac[_0x4bd4('0x49')]=_0x2324ac['attributes']['length']?_0x2324ac[_0x4bd4('0x49')]:_0x5a3592[_0x4bd4('0x45')];if(!_0x1f4f8f[_0x4bd4('0x46')]['hasOwnProperty']('nolimit')){_0x2324ac[_0x4bd4('0x32')]=qs[_0x4bd4('0x32')](_0x1f4f8f[_0x4bd4('0x46')][_0x4bd4('0x32')]);_0x2324ac[_0x4bd4('0x31')]=qs[_0x4bd4('0x31')](_0x1f4f8f[_0x4bd4('0x46')][_0x4bd4('0x31')]);}_0x2324ac[_0x4bd4('0x4d')]=qs[_0x4bd4('0x4e')](_0x1f4f8f[_0x4bd4('0x46')]['sort']);_0x2324ac[_0x4bd4('0x52')]=qs[_0x4bd4('0x4f')](_[_0x4bd4('0x50')](_0x1f4f8f['query'],_0x5a3592[_0x4bd4('0x4f')]));_0x2324ac[_0x4bd4('0x52')]['OpenchannelAccountId']=_0x53de67['id'];if(_0x1f4f8f[_0x4bd4('0x46')][_0x4bd4('0x51')]){_0x2324ac['where']=_[_0x4bd4('0x53')](_0x2324ac['where'],{'$or':_[_0x4bd4('0x40')](_0x2324ac[_0x4bd4('0x49')],function(_0xf93496){var _0x25ff5d={};_0x25ff5d[_0xf93496]={'$like':'%'+_0x1f4f8f[_0x4bd4('0x46')][_0x4bd4('0x51')]+'%'};return _0x25ff5d;})});}_0x2324ac=_[_0x4bd4('0x53')]({},_0x2324ac,_0x1f4f8f[_0x4bd4('0x56')]);return db[_0x4bd4('0x6d')][_0x4bd4('0x30')]({'where':_0x2324ac['where']})[_0x4bd4('0x22')](function(_0x29657b){_0xae8738[_0x4bd4('0x30')]=_0x29657b;if(_0x1f4f8f[_0x4bd4('0x46')]['includeAll']){_0x2324ac[_0x4bd4('0x57')]=[{'all':!![]}];}return db[_0x4bd4('0x6d')][_0x4bd4('0x58')](_0x2324ac);})[_0x4bd4('0x22')](function(_0x1a1740){_0xae8738['rows']=_0x1a1740;return _0xae8738;});}})[_0x4bd4('0x22')](respondWithFilteredResult(_0x4692f3,_0x2324ac))['catch'](handleError(_0x4692f3,null));};exports['removeDispositions']=function(_0x2c19f1,_0x43a0c0,_0xcb34b7){return db[_0x4bd4('0x41')][_0x4bd4('0x60')]({'where':{'id':_0x2c19f1[_0x4bd4('0x5b')]['id']}})[_0x4bd4('0x22')](handleEntityNotFound(_0x43a0c0,null))[_0x4bd4('0x22')](function(_0x2a3c4c){if(_0x2a3c4c){return _0x2a3c4c['removeDispositions'](_0x2c19f1[_0x4bd4('0x46')][_0x4bd4('0x70')]);}})['then'](respondWithStatusCode(_0x43a0c0,null))[_0x4bd4('0x2c')](handleError(_0x43a0c0,null));};exports[_0x4bd4('0x71')]=function(_0x813cb8,_0x54f86f,_0x5d7056){if(_0x813cb8[_0x4bd4('0x62')]['id']){delete _0x813cb8[_0x4bd4('0x62')]['id'];}return db[_0x4bd4('0x41')]['find']({'where':{'id':_0x813cb8[_0x4bd4('0x5b')]['id']}})[_0x4bd4('0x22')](handleEntityNotFound(_0x54f86f,null))['then'](function(_0x513066){if(_0x513066){_0x813cb8[_0x4bd4('0x62')]['OpenchannelAccountId']=_0x513066['id'];return db['CannedAnswer']['create'](_0x813cb8['body']);}})[_0x4bd4('0x22')](respondWithResult(_0x54f86f,null))[_0x4bd4('0x2c')](handleError(_0x54f86f,null));};exports[_0x4bd4('0x72')]=function(_0x1a232c,_0x24ce92,_0x5884cb){var _0x25daf8={'raw':![],'where':{}};var _0x2a912a={};var _0x1c54f9={'count':0x0,'rows':[]};return db[_0x4bd4('0x41')]['findOne']({'where':{'id':_0x1a232c[_0x4bd4('0x5b')]['id']}})['then'](handleEntityNotFound(_0x24ce92,null))[_0x4bd4('0x22')](function(_0x5f4adf){if(_0x5f4adf){_0x2a912a[_0x4bd4('0x45')]=_[_0x4bd4('0x47')](db['CannedAnswer']['rawAttributes']);_0x2a912a[_0x4bd4('0x46')]=_[_0x4bd4('0x47')](_0x1a232c[_0x4bd4('0x46')]);_0x2a912a['filters']=_[_0x4bd4('0x48')](_0x2a912a[_0x4bd4('0x45')],_0x2a912a[_0x4bd4('0x46')]);_0x25daf8[_0x4bd4('0x49')]=_[_0x4bd4('0x48')](_0x2a912a[_0x4bd4('0x45')],qs['fields'](_0x1a232c['query']['fields']));_0x25daf8[_0x4bd4('0x49')]=_0x25daf8[_0x4bd4('0x49')][_0x4bd4('0x4a')]?_0x25daf8[_0x4bd4('0x49')]:_0x2a912a['model'];if(!_0x1a232c[_0x4bd4('0x46')][_0x4bd4('0x4b')](_0x4bd4('0x4c'))){_0x25daf8['limit']=qs[_0x4bd4('0x32')](_0x1a232c[_0x4bd4('0x46')][_0x4bd4('0x32')]);_0x25daf8[_0x4bd4('0x31')]=qs[_0x4bd4('0x31')](_0x1a232c['query'][_0x4bd4('0x31')]);}_0x25daf8[_0x4bd4('0x4d')]=qs[_0x4bd4('0x4e')](_0x1a232c[_0x4bd4('0x46')][_0x4bd4('0x4e')]);_0x25daf8[_0x4bd4('0x52')]=qs[_0x4bd4('0x4f')](_[_0x4bd4('0x50')](_0x1a232c[_0x4bd4('0x46')],_0x2a912a[_0x4bd4('0x4f')]));_0x25daf8[_0x4bd4('0x52')][_0x4bd4('0x73')]=_0x5f4adf['id'];if(_0x1a232c[_0x4bd4('0x46')][_0x4bd4('0x51')]){_0x25daf8[_0x4bd4('0x52')]=_[_0x4bd4('0x53')](_0x25daf8[_0x4bd4('0x52')],{'$or':_['map'](_0x25daf8[_0x4bd4('0x49')],function(_0x5bad1a){var _0x43364e={};_0x43364e[_0x5bad1a]={'$like':'%'+_0x1a232c[_0x4bd4('0x46')][_0x4bd4('0x51')]+'%'};return _0x43364e;})});}_0x25daf8=_[_0x4bd4('0x53')]({},_0x25daf8,_0x1a232c[_0x4bd4('0x56')]);return db[_0x4bd4('0x74')][_0x4bd4('0x30')]({'where':_0x25daf8[_0x4bd4('0x52')]})['then'](function(_0xb8a76e){_0x1c54f9[_0x4bd4('0x30')]=_0xb8a76e;if(_0x1a232c[_0x4bd4('0x46')][_0x4bd4('0x5f')]){_0x25daf8[_0x4bd4('0x57')]=[{'all':!![]}];}return db['CannedAnswer'][_0x4bd4('0x58')](_0x25daf8);})[_0x4bd4('0x22')](function(_0x1d427d){_0x1c54f9[_0x4bd4('0x59')]=_0x1d427d;return _0x1c54f9;});}})[_0x4bd4('0x22')](respondWithFilteredResult(_0x24ce92,_0x25daf8))[_0x4bd4('0x2c')](handleError(_0x24ce92,null));};exports['removeAnswers']=function(_0x407422,_0x44afe0,_0x47bd9e){return db[_0x4bd4('0x41')][_0x4bd4('0x60')]({'where':{'id':_0x407422[_0x4bd4('0x5b')]['id']}})[_0x4bd4('0x22')](handleEntityNotFound(_0x44afe0,null))[_0x4bd4('0x22')](function(_0x4e5dec){if(_0x4e5dec){return _0x4e5dec[_0x4bd4('0x75')](_0x407422[_0x4bd4('0x46')][_0x4bd4('0x70')]);}})[_0x4bd4('0x22')](respondWithStatusCode(_0x44afe0,null))[_0x4bd4('0x2c')](handleError(_0x44afe0,null));};exports[_0x4bd4('0x76')]=function(_0x2010af,_0x8ff613,_0x3e3581){var _0xaa9952={'body':_0x2010af['body'],'channel':_0x4bd4('0x77')};var _0xec2dd5=[];var _0x3c5786=[];var _0x24d444={};var _0x52917c=![];return db[_0x4bd4('0x78')][_0x4bd4('0x6b')]()[_0x4bd4('0x22')](function(_0x28dc0b){if(!_0x28dc0b){throw new db[(_0x4bd4('0x79'))][(_0x4bd4('0x7a'))](_0x4bd4('0x7b'));}_0xec2dd5=_[_0x4bd4('0x7c')](_[_0x4bd4('0x47')](_0x28dc0b),[_0x4bd4('0x7d'),_0x4bd4('0x7e')]);_0x3c5786=_[_0x4bd4('0x7c')](_[_0x4bd4('0x47')](_0x28dc0b),[_0x4bd4('0x7d'),'updatedAt',_0x4bd4('0x7f'),_0x4bd4('0x80')]);if(_0x2010af['body']['id']){delete _0x2010af[_0x4bd4('0x62')]['id'];}if(_['isNil'](_0x2010af[_0x4bd4('0x62')]['from'])){throw new db[(_0x4bd4('0x79'))][(_0x4bd4('0x7a'))](_0x4bd4('0x81'));}if(_['isNil'](_0x2010af['body'][_0x4bd4('0x62')])||_0x2010af[_0x4bd4('0x62')][_0x4bd4('0x62')]===''){throw new db['Sequelize'][(_0x4bd4('0x7a'))](_0x4bd4('0x82'));}if(_[_0x4bd4('0x83')](_0x2010af[_0x4bd4('0x62')][_0x4bd4('0x84')])){throw new db[(_0x4bd4('0x79'))][(_0x4bd4('0x7a'))](_0x4bd4('0x85')+_0x3c5786);}if(!_['includes'](_0x3c5786,_0x2010af[_0x4bd4('0x62')][_0x4bd4('0x84')])){throw new db[(_0x4bd4('0x79'))][(_0x4bd4('0x7a'))](_0x4bd4('0x86')+_0x3c5786);}_0x24d444[_0x2010af[_0x4bd4('0x62')][_0x4bd4('0x84')]]=_0x2010af[_0x4bd4('0x62')][_0x4bd4('0x87')];})[_0x4bd4('0x22')](function(){return db[_0x4bd4('0x41')][_0x4bd4('0x60')]({'where':{'id':_0x2010af['params']['id']},'include':[{'model':db['CmList'],'as':_0x4bd4('0x88'),'include':[{'model':db['CmContact'],'as':_0x4bd4('0x89'),'where':_0x24d444,'limit':0x1,'order':[[_0x4bd4('0x7e'),_0x4bd4('0x8a')]]}]},{'model':db[_0x4bd4('0x8b')],'as':'Applications'}]});})[_0x4bd4('0x22')](handleEntityNotFound(_0x8ff613,null))['then'](function(_0x38cdc3){if(_0x38cdc3&&_0x38cdc3[_0x4bd4('0x88')]){_0xaa9952['account']=_0x38cdc3;_0xaa9952[_0x4bd4('0x8c')]=_0x38cdc3[_0x4bd4('0x8d')];_0xaa9952['list']=_0x38cdc3[_0x4bd4('0x88')];_0xaa9952['applications']=_[_0x4bd4('0x8e')](_0xaa9952['applications'],[_0x4bd4('0x8f')],[_0x4bd4('0x90')]);if(_0xaa9952[_0x4bd4('0x91')][_0x4bd4('0x8d')]){delete _0xaa9952['account'][_0x4bd4('0x8d')];}if(_0xaa9952[_0x4bd4('0x91')][_0x4bd4('0x88')]&&_0xaa9952[_0x4bd4('0x91')][_0x4bd4('0x88')]['Contacts'][_0x4bd4('0x4a')]){return _0xaa9952[_0x4bd4('0x91')][_0x4bd4('0x88')][_0x4bd4('0x89')][0x0];}var _0x569399=_[_0x4bd4('0x1a')](_0x2010af[_0x4bd4('0x62')],{'firstName':_0x2010af['body'][_0x4bd4('0x87')],'ListId':_0x38cdc3[_0x4bd4('0x80')]});_0x569399[_0x2010af[_0x4bd4('0x62')][_0x4bd4('0x84')]]=_0x2010af['body'][_0x4bd4('0x87')];return db['CmContact'][_0x4bd4('0x61')](_0x569399,{'fields':_0xec2dd5,'raw':!![]});}})[_0x4bd4('0x22')](handleEntityNotFound(_0x8ff613,null))[_0x4bd4('0x22')](function(_0x30d21d){_0xaa9952[_0x4bd4('0x92')]=_0x30d21d;if(_0x30d21d){var _0x138cf9={'ContactId':_0x30d21d['id'],'OpenchannelAccountId':_0x2010af[_0x4bd4('0x5b')]['id'],'from':(_0x30d21d['firstName']||'')+'\x20'+(_0x30d21d[_0x4bd4('0x93')]||'')};var _0x183b91={'OpenchannelAccountId':_0x2010af[_0x4bd4('0x5b')]['id'],'closed':![]};if(_0x2010af['body'][_0x4bd4('0x94')]){_0x183b91['threadId']=_0x2010af['body'][_0x4bd4('0x94')];return db[_0x4bd4('0x95')][_0x4bd4('0x60')]({'where':_0x183b91})[_0x4bd4('0x22')](function(_0x48292d){if(_0x48292d){return[_0x48292d,![]];}_0x138cf9[_0x4bd4('0x94')]=_0x2010af[_0x4bd4('0x62')][_0x4bd4('0x94')];_0x138cf9['externalUrl']=_0x2010af[_0x4bd4('0x62')]['externalUrl'];return db[_0x4bd4('0x95')][_0x4bd4('0x61')](_0x138cf9)[_0x4bd4('0x22')](function(_0x348ec5){return[_0x348ec5,!![]];});});}else{_0x183b91[_0x4bd4('0x94')]=null;}_0x183b91['ContactId']=_0x30d21d['id'];return db[_0x4bd4('0x95')][_0x4bd4('0x60')]({'where':_0x183b91})[_0x4bd4('0x22')](function(_0x529441){if(_0x529441){return[_0x529441,![]];}return db[_0x4bd4('0x95')][_0x4bd4('0x61')](_0x138cf9)[_0x4bd4('0x22')](function(_0x1d4b76){return[_0x1d4b76,!![]];});});}})[_0x4bd4('0x96')](function(_0x53ffb6,_0x4f9ce5){if(_0x53ffb6){_0x52917c=_0x4f9ce5;if(!_0x4f9ce5){var _0x2156a7={'from':(_0xaa9952[_0x4bd4('0x92')]['firstName']||'')+'\x20'+(_0xaa9952[_0x4bd4('0x92')]['lastName']||'')};if(_0x2010af[_0x4bd4('0x62')]['threadId']&&_0x2010af[_0x4bd4('0x62')][_0x4bd4('0x97')]&&_0x2010af[_0x4bd4('0x62')][_0x4bd4('0x94')]!=_0x2010af[_0x4bd4('0x62')][_0x4bd4('0x97')]){_0x2156a7[_0x4bd4('0x94')]=_0x2010af[_0x4bd4('0x62')][_0x4bd4('0x97')];}return _0x53ffb6['update'](_0x2156a7);}else{return _0x53ffb6;}}})[_0x4bd4('0x22')](function(_0x1bd614){_0xaa9952['interaction']=_0x1bd614[_0x4bd4('0x63')]({'plain':!![]});_0xaa9952[_0x4bd4('0x98')][_0x4bd4('0x99')]=_0x52917c;if(_0xaa9952[_0x4bd4('0x98')][_0x4bd4('0x99')]){if(_0xaa9952[_0x4bd4('0x91')]['autoclose']){_0xaa9952['applications'][_0x4bd4('0x9a')]({'id':0x0,'priority':_0xaa9952['applications'][_0x4bd4('0x4a')]+0x1,'app':_0x4bd4('0x9b'),'appdata':_0x4bd4('0x9c'),'interval':_0x4bd4('0x9d')});}}return db[_0x4bd4('0x9e')]['create']({'body':_0x2010af[_0x4bd4('0x62')][_0x4bd4('0x62')],'OpenchannelAccountId':_0x2010af[_0x4bd4('0x5b')]['id'],'OpenchannelInteractionId':_0x1bd614['id'],'direction':'in','ContactId':_0xaa9952[_0x4bd4('0x92')]['id'],'AttachmentId':_0x2010af[_0x4bd4('0x62')][_0x4bd4('0x9f')]});})['then'](function(_0x890177){_0xaa9952[_0x4bd4('0x2a')]=_0x890177;if(_0xaa9952['interaction'][_0x4bd4('0xa0')]){return db['User'][_0x4bd4('0x60')]({'attributes':['id','name'],'where':{'id':_0xaa9952['interaction']['UserId']}})[_0x4bd4('0x22')](function(_0x1106b0){if(_0x1106b0){_0xaa9952['applications'][_0x4bd4('0xa1')]({'id':0x0,'priority':0x0,'app':_0x4bd4('0xa2'),'appdata':_0x1106b0['name']+','+(_0xaa9952[_0x4bd4('0x91')][_0x4bd4('0xa3')]||0xa),'interval':_0x4bd4('0x9d')});_0xaa9952[_0x4bd4('0xa4')]=![];}return respondWithRpcPromise(_0x4bd4('0xa5'),_0x4bd4('0xa6'),_0xaa9952);});}return respondWithRpcPromise(_0x4bd4('0xa5'),'startRouting',_0xaa9952);})['then'](function(_0x49a843){respondWithRpcPromise(_0x4bd4('0xa7'),_0x4bd4('0xa7'),{'event':_0x4bd4('0x76'),'message':_0x49a843},client9002);return _0x49a843;})[_0x4bd4('0x22')](respondWithResult(_0x8ff613,null))['catch'](handleError(_0x8ff613,null));};exports[_0x4bd4('0xa8')]=function(_0x2b0059,_0x53d839,_0x33760a){return db['OpenchannelAccount']['findOne']({'where':{'id':_0x2b0059[_0x4bd4('0x5b')]['id']}})[_0x4bd4('0x22')](handleEntityNotFound(_0x53d839,null))['then'](function(_0x54eefc){if(_0x54eefc){return db[_0x4bd4('0xa9')][_0x4bd4('0xaa')](function(_0x22a38b){return db[_0x4bd4('0x8b')][_0x4bd4('0x38')]({'where':{'OpenchannelAccountId':_0x2b0059[_0x4bd4('0x5b')]['id']},'transaction':_0x22a38b})[_0x4bd4('0x22')](function(_0x4164c9){var _0x2b555b=_['map'](_0x2b0059[_0x4bd4('0x62')],function(_0x3983fd){_0x3983fd[_0x4bd4('0x73')]=_0x2b0059[_0x4bd4('0x5b')]['id'];return _0x3983fd;});return db[_0x4bd4('0x8b')][_0x4bd4('0xab')](_0x2b555b,{'transaction':_0x22a38b});});})['then'](function(){return db[_0x4bd4('0x8b')]['findAndCountAll']({'where':{'OpenchannelAccountId':_0x2b0059[_0x4bd4('0x5b')]['id']},'order':'priority'});});}})[_0x4bd4('0x22')](respondWithResult(_0x53d839,null))[_0x4bd4('0x2c')](handleError(_0x53d839,null));};exports['getApplications']=function(_0x16a4a2,_0x631c0c,_0xb0420){var _0x185849={};var _0x2c3419={};var _0x324fb4;var _0x44248b;return db[_0x4bd4('0x41')][_0x4bd4('0x6f')]({'where':{'id':_0x16a4a2[_0x4bd4('0x5b')]['id']}})[_0x4bd4('0x22')](handleEntityNotFound(_0x631c0c,null))['then'](function(_0x51be5d){if(_0x51be5d){_0x324fb4=_0x51be5d;_0x2c3419[_0x4bd4('0x45')]=_[_0x4bd4('0x47')](db[_0x4bd4('0x8b')][_0x4bd4('0x42')]);_0x2c3419[_0x4bd4('0x46')]=_[_0x4bd4('0x47')](_0x16a4a2[_0x4bd4('0x46')]);_0x2c3419[_0x4bd4('0x4f')]=_[_0x4bd4('0x48')](_0x2c3419[_0x4bd4('0x45')],_0x2c3419['query']);_0x185849[_0x4bd4('0x49')]=_[_0x4bd4('0x48')](_0x2c3419[_0x4bd4('0x45')],qs[_0x4bd4('0x5e')](_0x16a4a2[_0x4bd4('0x46')][_0x4bd4('0x5e')]));_0x185849['attributes']=_0x185849['attributes']['length']?_0x185849[_0x4bd4('0x49')]:_0x2c3419[_0x4bd4('0x45')];_0x185849[_0x4bd4('0x4d')]=qs[_0x4bd4('0x4e')](_0x16a4a2[_0x4bd4('0x46')][_0x4bd4('0x4e')]);_0x185849[_0x4bd4('0x52')]=qs[_0x4bd4('0x4f')](_[_0x4bd4('0x50')](_0x16a4a2['query'],_0x2c3419['filters']));if(_0x16a4a2[_0x4bd4('0x46')]['filter']){_0x185849[_0x4bd4('0x52')]=_[_0x4bd4('0x53')](_0x185849['where'],{'$or':_[_0x4bd4('0x40')](_0x185849['attributes'],function(_0x19428e){var _0x516906={};_0x516906[_0x19428e]={'$like':'%'+_0x16a4a2[_0x4bd4('0x46')]['filter']+'%'};return _0x516906;})});}_0x185849=_[_0x4bd4('0x53')]({},_0x185849,_0x16a4a2[_0x4bd4('0x56')]);return _0x324fb4[_0x4bd4('0xac')](_0x185849);}})[_0x4bd4('0x22')](function(_0x52ac17){if(_0x52ac17){_0x44248b=_0x52ac17[_0x4bd4('0x4a')];if(!_0x16a4a2[_0x4bd4('0x46')]['hasOwnProperty'](_0x4bd4('0x4c'))){_0x185849[_0x4bd4('0x32')]=qs['limit'](_0x16a4a2['query'][_0x4bd4('0x32')]);_0x185849[_0x4bd4('0x31')]=qs[_0x4bd4('0x31')](_0x16a4a2[_0x4bd4('0x46')][_0x4bd4('0x31')]);}return _0x324fb4[_0x4bd4('0xac')](_0x185849);}})[_0x4bd4('0x22')](function(_0x1c8882){if(_0x1c8882){return _0x1c8882?{'count':_0x44248b,'rows':_0x1c8882}:null;}})['then'](respondWithResult(_0x631c0c,null))['catch'](handleError(_0x631c0c,null));};exports['getInteractions']=function(_0x1278da,_0x358112,_0x4e2258){var _0x17751d={'raw':![],'where':{}};var _0x2f120e={};var _0x5b17c2={'count':0x0,'rows':[]};return db[_0x4bd4('0x41')][_0x4bd4('0x6f')]({'where':{'id':_0x1278da['params']['id']}})[_0x4bd4('0x22')](handleEntityNotFound(_0x358112,null))[_0x4bd4('0x22')](function(_0x6387f6){if(_0x6387f6){_0x2f120e[_0x4bd4('0x45')]=_[_0x4bd4('0x47')](db['OpenchannelInteraction'][_0x4bd4('0x42')]);_0x2f120e[_0x4bd4('0x46')]=_[_0x4bd4('0x47')](_0x1278da['query']);_0x2f120e[_0x4bd4('0x4f')]=_['intersection'](_0x2f120e[_0x4bd4('0x45')],_0x2f120e[_0x4bd4('0x46')]);_0x17751d[_0x4bd4('0x49')]=_['intersection'](_0x2f120e[_0x4bd4('0x45')],qs[_0x4bd4('0x5e')](_0x1278da[_0x4bd4('0x46')][_0x4bd4('0x5e')]));_0x17751d[_0x4bd4('0x49')]=_0x17751d[_0x4bd4('0x49')][_0x4bd4('0x4a')]?_0x17751d[_0x4bd4('0x49')]:_0x2f120e[_0x4bd4('0x45')];if(!_0x1278da[_0x4bd4('0x46')]['hasOwnProperty']('nolimit')){_0x17751d[_0x4bd4('0x32')]=qs[_0x4bd4('0x32')](_0x1278da[_0x4bd4('0x46')][_0x4bd4('0x32')]);_0x17751d[_0x4bd4('0x31')]=qs[_0x4bd4('0x31')](_0x1278da[_0x4bd4('0x46')][_0x4bd4('0x31')]);}_0x17751d['order']=qs[_0x4bd4('0x4e')](_0x1278da[_0x4bd4('0x46')]['sort']);_0x17751d[_0x4bd4('0x52')]=qs[_0x4bd4('0x4f')](_['pick'](_0x1278da[_0x4bd4('0x46')],_0x2f120e[_0x4bd4('0x4f')]));_0x17751d['where']['OpenchannelAccountId']=_0x6387f6['id'];if(_0x1278da[_0x4bd4('0x46')]['filter']){_0x17751d[_0x4bd4('0x52')]=_['merge'](_0x17751d[_0x4bd4('0x52')],{'$or':_[_0x4bd4('0x40')](_0x17751d[_0x4bd4('0x49')],function(_0x54b2aa){var _0x5aa187={};_0x5aa187[_0x54b2aa]={'$like':'%'+_0x1278da[_0x4bd4('0x46')][_0x4bd4('0x51')]+'%'};return _0x5aa187;})});}_0x17751d=_[_0x4bd4('0x53')]({},_0x17751d,_0x1278da['options']);return db[_0x4bd4('0x95')]['count']({'where':_0x17751d[_0x4bd4('0x52')]})[_0x4bd4('0x22')](function(_0x2ecd44){_0x5b17c2[_0x4bd4('0x30')]=_0x2ecd44;if(_0x1278da[_0x4bd4('0x46')]['includeAll']){_0x17751d[_0x4bd4('0x57')]=[{'model':db[_0x4bd4('0x78')],'as':'Contact','required':![]},{'model':db[_0x4bd4('0xad')],'as':'Owner','attributes':[_0x4bd4('0x3d'),'fullname','internal'],'required':![]},{'model':db[_0x4bd4('0xae')],'as':'Tags','attributes':['id',_0x4bd4('0x3d'),_0x4bd4('0xaf')],'where':_0x1278da[_0x4bd4('0x46')][_0x4bd4('0xb0')]?{'id':_0x1278da[_0x4bd4('0x46')][_0x4bd4('0xb0')]}:undefined,'required':_0x1278da[_0x4bd4('0x46')][_0x4bd4('0xb0')]?!![]:![]}];}return db['OpenchannelInteraction'][_0x4bd4('0x58')](_0x17751d);})[_0x4bd4('0x22')](function(_0xbb1559){_0x5b17c2[_0x4bd4('0x59')]=_0xbb1559;return _0x5b17c2;});}})['then'](respondWithFilteredResult(_0x358112,_0x17751d))['catch'](handleError(_0x358112,null));};exports[_0x4bd4('0xb1')]=function(_0x5bfab5,_0x122934,_0x2075f2){return db[_0x4bd4('0x41')]['find']({'where':{'id':_0x5bfab5[_0x4bd4('0x5b')]['id']}})[_0x4bd4('0x22')](handleEntityNotFound(_0x122934,null))['then'](function(_0x260d6f){if(_0x260d6f){return _0x260d6f[_0x4bd4('0xb1')](_0x5bfab5['body']['ids'],_[_0x4bd4('0xb2')](_0x5bfab5[_0x4bd4('0x62')],[_0x4bd4('0x70'),'id'])||{})[_0x4bd4('0x96')](function(_0x2764ec){for(var _0x337e06=0x0;_0x337e06<_0x5bfab5[_0x4bd4('0x62')][_0x4bd4('0x70')][_0x4bd4('0x4a')];_0x337e06+=0x1){socket[_0x4bd4('0xb3')](_0x4bd4('0xb4'),{'UserId':_0x5bfab5[_0x4bd4('0x62')][_0x4bd4('0x70')][_0x337e06],'OpenchannelAccountId':_0x5bfab5['params']['id']});}return _0x2764ec;});}})[_0x4bd4('0x22')](respondWithResult(_0x122934,null))['catch'](handleError(_0x122934,null));};exports[_0x4bd4('0xb5')]=function(_0x3bdbb5,_0x519dd2,_0x2a4bc7){return db[_0x4bd4('0x41')][_0x4bd4('0x60')]({'where':{'id':_0x3bdbb5['params']['id']}})['then'](handleEntityNotFound(_0x519dd2,null))['then'](function(_0x522691){if(_0x522691){return _0x522691[_0x4bd4('0xb5')](_0x3bdbb5['query'][_0x4bd4('0x70')])[_0x4bd4('0x22')](function(){if(_[_0x4bd4('0xb6')](_0x3bdbb5['query'][_0x4bd4('0x70')])){for(var _0x504967=0x0;_0x504967<_0x3bdbb5['query']['ids'][_0x4bd4('0x4a')];_0x504967+=0x1){socket['emit'](_0x4bd4('0xb7'),{'UserId':Number(_0x3bdbb5[_0x4bd4('0x46')][_0x4bd4('0x70')][_0x504967]),'OpenchannelAccountId':Number(_0x3bdbb5[_0x4bd4('0x5b')]['id'])});}}else{socket[_0x4bd4('0xb3')](_0x4bd4('0xb7'),{'UserId':Number(_0x3bdbb5['query']['ids']),'OpenchannelAccountId':Number(_0x3bdbb5['params']['id'])});}});}})[_0x4bd4('0x22')](respondWithStatusCode(_0x519dd2,null))[_0x4bd4('0x2c')](handleError(_0x519dd2,null));};exports[_0x4bd4('0xb8')]=function(_0x441725,_0x481af3,_0x4704c2){var _0x845c30={};var _0x1a4bb8={};var _0x4faf43;var _0x221e4c;return db[_0x4bd4('0x41')]['findOne']({'where':{'id':_0x441725['params']['id']}})['then'](handleEntityNotFound(_0x481af3,null))[_0x4bd4('0x22')](function(_0x2ed88b){if(_0x2ed88b){_0x4faf43=_0x2ed88b;_0x1a4bb8['model']=_[_0x4bd4('0x47')](db['User'][_0x4bd4('0x42')]);_0x1a4bb8[_0x4bd4('0x46')]=_[_0x4bd4('0x47')](_0x441725[_0x4bd4('0x46')]);_0x1a4bb8[_0x4bd4('0x4f')]=_[_0x4bd4('0x48')](_0x1a4bb8[_0x4bd4('0x45')],_0x1a4bb8['query']);_0x845c30[_0x4bd4('0x49')]=_['intersection'](_0x1a4bb8[_0x4bd4('0x45')],qs[_0x4bd4('0x5e')](_0x441725[_0x4bd4('0x46')][_0x4bd4('0x5e')]));_0x845c30[_0x4bd4('0x49')]=_0x845c30['attributes']['length']?_0x845c30[_0x4bd4('0x49')]:_0x1a4bb8[_0x4bd4('0x45')];_0x845c30[_0x4bd4('0x4d')]=qs['sort'](_0x441725[_0x4bd4('0x46')][_0x4bd4('0x4e')]);_0x845c30['where']=qs[_0x4bd4('0x4f')](_['pick'](_0x441725[_0x4bd4('0x46')],_0x1a4bb8['filters']));if(_0x441725[_0x4bd4('0x46')][_0x4bd4('0x51')]){_0x845c30[_0x4bd4('0x52')]=_[_0x4bd4('0x53')](_0x845c30['where'],{'$or':_[_0x4bd4('0x40')](_0x845c30[_0x4bd4('0x49')],function(_0x146989){var _0x3194e4={};_0x3194e4[_0x146989]={'$like':'%'+_0x441725[_0x4bd4('0x46')]['filter']+'%'};return _0x3194e4;})});}_0x845c30=_[_0x4bd4('0x53')]({},_0x845c30,_0x441725[_0x4bd4('0x56')]);return _0x4faf43[_0x4bd4('0xb8')](_0x845c30);}})[_0x4bd4('0x22')](function(_0x2121b6){if(_0x2121b6){_0x221e4c=_0x2121b6[_0x4bd4('0x4a')];if(!_0x441725[_0x4bd4('0x46')][_0x4bd4('0x4b')](_0x4bd4('0x4c'))){_0x845c30[_0x4bd4('0x32')]=qs['limit'](_0x441725[_0x4bd4('0x46')][_0x4bd4('0x32')]);_0x845c30['offset']=qs[_0x4bd4('0x31')](_0x441725['query']['offset']);}return _0x4faf43[_0x4bd4('0xb8')](_0x845c30);}})[_0x4bd4('0x22')](function(_0x35ce4b){if(_0x35ce4b){return _0x35ce4b?{'count':_0x221e4c,'rows':_0x35ce4b}:null;}})['then'](respondWithResult(_0x481af3,null))[_0x4bd4('0x2c')](handleError(_0x481af3,null));};exports[_0x4bd4('0x3e')]=function(_0x1678b3,_0x266fe1,_0x5296a7){var _0x59b554,_0x56a30b,_0x52be00;if(_[_0x4bd4('0x83')](_0x1678b3[_0x4bd4('0x62')][_0x4bd4('0x62')])||_0x1678b3['body']['body']===''){throw new db[(_0x4bd4('0x79'))][(_0x4bd4('0x7a'))](_0x4bd4('0x82'));}if(_[_0x4bd4('0x83')](_0x1678b3[_0x4bd4('0x62')]['to'])){}_0x59b554=_0x1678b3['body']['to'];return db[_0x4bd4('0x41')][_0x4bd4('0x6f')]({'where':{'id':_0x1678b3[_0x4bd4('0x5b')]['id']}})[_0x4bd4('0x22')](handleEntityNotFound(_0x266fe1,null))['then'](function(_0x4e3fa8){if(_0x4e3fa8){return db[_0x4bd4('0x41')]['find']({'where':{'id':_0x4e3fa8['id']},'include':[{'model':db[_0x4bd4('0xb9')],'as':_0x4bd4('0x88'),'include':[{'model':db['CmContact'],'as':_0x4bd4('0x89'),'where':{[_0x4e3fa8[_0x4bd4('0x84')]]:_0x59b554},'limit':0x1,'order':[[_0x4bd4('0x7e'),_0x4bd4('0x8a')]]}]}]})[_0x4bd4('0x22')](handleEntityNotFound(_0x266fe1,null))['then'](function(_0x1a9846){if(_0x1a9846&&_0x1a9846[_0x4bd4('0x88')]){_0x56a30b=_0x1a9846[_0x4bd4('0x63')]({'plain':!![]});if(_0x56a30b[_0x4bd4('0x88')]&&_0x56a30b[_0x4bd4('0x88')]['Contacts']['length']){return _0x56a30b['List'][_0x4bd4('0x89')][0x0];}return db['CmContact'][_0x4bd4('0x61')](_[_0x4bd4('0x1a')](_0x1678b3[_0x4bd4('0x62')],{'firstName':_0x59b554,[_0x1a9846[_0x4bd4('0x84')]]:_0x59b554,'phone':_0x59b554,'ListId':_0x56a30b['ListId']}));}})['then'](handleEntityNotFound(_0x266fe1,null))[_0x4bd4('0x22')](function(_0x266895){if(_0x266895){_0x52be00=_0x266895;return db[_0x4bd4('0x95')][_0x4bd4('0x60')]({'where':{'ContactId':_0x52be00['id'],'closed':![],'OpenchannelAccountId':_0x56a30b['id']}})[_0x4bd4('0x22')](function(_0x1f5e67){if(_0x1f5e67){return[_0x1f5e67,![]];}return db[_0x4bd4('0x95')]['create']({'UserId':_0x1678b3[_0x4bd4('0x66')]['id'],'ContactId':_0x52be00['id'],'OpenchannelAccountId':_0x56a30b['id'],'lastMsgDirection':'out','Messages':[_[_0x4bd4('0x53')](_0x1678b3[_0x4bd4('0x62')],{'read':![],'body':_0x1678b3[_0x4bd4('0x62')][_0x4bd4('0x62')],'OpenchannelAccountId':_0x56a30b['id'],'UserId':_0x1678b3['user']['id'],'ContactId':_0x52be00['id']})]},{'include':[{'model':db[_0x4bd4('0x9e')],'as':_0x4bd4('0xba')}]})[_0x4bd4('0x22')](function(_0xb1517a){return[_0xb1517a,!![]];});});}})['spread'](function(_0x24ff14,_0x3c23b8){if(_0x3c23b8){return _0x24ff14;}return db[_0x4bd4('0x9e')]['create'](_[_0x4bd4('0x53')](_0x1678b3[_0x4bd4('0x62')],{'read':![],'body':_0x1678b3['body'][_0x4bd4('0x62')],'OpenchannelAccountId':_0x56a30b['id'],'OpenchannelInteractionId':_0x24ff14['id'],'UserId':_0x1678b3[_0x4bd4('0x66')]['id'],'ContactId':_0x52be00['id']}))[_0x4bd4('0x22')](function(_0x240579){_0x24ff14[_0x4bd4('0xbb')]['Messages']=[];_0x24ff14[_0x4bd4('0xbb')]['Messages'][_0x4bd4('0x9a')](_0x240579[_0x4bd4('0xbb')]);return _0x24ff14;});});}})[_0x4bd4('0x22')](respondWithResult(_0x266fe1,null))[_0x4bd4('0x2c')](handleError(_0x266fe1,null));}; \ No newline at end of file +var _0xd1c3=['reject','save','update','destroy','get','name','send','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','show','params','fields','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OpenchannelAccounts','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','OpnechannelAccountId','Disposition','findOne','rows','removeDispositions','ids','addAnswer','OpenchannelAccountId','CannedAnswer','getAnswers','nolimit','removeAnswers','CmContact','difference','createdAt','CompanyId','ListId','isNil','from','Sequelize','from\x20is\x20mandatory','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','OpenchannelApplication','Applications','account','applications','orderBy','priority','asc','defaults','contact','lastName','threadId','OpenchannelInteraction','externalUrl','spread','firstName','interaction','created','autoclose','close','unmanaged','OpenchannelMessage','AttachmentId','UserId','User','unshift','Start','startRouting','EventManager','notify','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','getInteractions','Owner','fullname','internal','Tag','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','updatedAt','out','dataValues','Messages','push','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','redis','localhost','./openchannelAccount.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','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','apply'];(function(_0x15f1ac,_0x17fa5b){var _0x1b4bd7=function(_0x49913f){while(--_0x49913f){_0x15f1ac['push'](_0x15f1ac['shift']());}};_0x1b4bd7(++_0x17fa5b);}(_0xd1c3,0x143));var _0x3d1c=function(_0x3f387b,_0x3826e4){_0x3f387b=_0x3f387b-0x0;var _0x51ec37=_0xd1c3[_0x3f387b];return _0x51ec37;};'use strict';var pdf=require(_0x3d1c('0x0'));var emlformat=require(_0x3d1c('0x1'));var rimraf=require(_0x3d1c('0x2'));var zipdir=require(_0x3d1c('0x3'));var jsonpatch=require(_0x3d1c('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3d1c('0x5'));var Mustache=require('mustache');var util=require(_0x3d1c('0x6'));var path=require(_0x3d1c('0x7'));var sox=require(_0x3d1c('0x8'));var csv=require(_0x3d1c('0x9'));var ejs=require(_0x3d1c('0xa'));var fs=require('fs');var _=require(_0x3d1c('0xb'));var squel=require(_0x3d1c('0xc'));var crypto=require(_0x3d1c('0xd'));var jsforce=require(_0x3d1c('0xe'));var deskjs=require(_0x3d1c('0xf'));var toCsv=require(_0x3d1c('0x9'));var querystring=require(_0x3d1c('0x10'));var Papa=require(_0x3d1c('0x11'));var Redis=require(_0x3d1c('0x12'));var authService=require(_0x3d1c('0x13'));var qs=require(_0x3d1c('0x14'));var as=require(_0x3d1c('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3d1c('0x16'));var utils=require('../../config/utils');var config=require(_0x3d1c('0x17'));var db=require('../../mysqldb')['db'];config[_0x3d1c('0x18')]=_['defaults'](config[_0x3d1c('0x18')],{'host':_0x3d1c('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3d1c('0x18')]));require(_0x3d1c('0x1a'))[_0x3d1c('0x1b')](socket);var jayson=require(_0x3d1c('0x1c'));var client=jayson[_0x3d1c('0x1d')][_0x3d1c('0x1e')]({'port':0x232c});var client9002=jayson[_0x3d1c('0x1d')][_0x3d1c('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x19d247,_0x29ff7b,_0xd26570){if(_0xd26570){var _0x42d387=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x42d387[_0x3d1c('0x1f')](_0x29ff7b)){return _0x19d247;}else{throw new Error(_0x3d1c('0x20'));}}else{return _0x19d247;}}function respondWithRpcPromise(_0x4845c3,_0x5624ba,_0x1e6481,_0x5f5bc8){return new BPromise(function(_0x16eac3,_0x7b75f){var _0x2996b0=_0x5f5bc8||client;return _0x2996b0[_0x3d1c('0x21')](_0x4845c3,_0x1e6481)[_0x3d1c('0x22')](function(_0x3bca4f){logger['info'](_0x3d1c('0x23'),_0x5624ba,_0x3d1c('0x24'));logger[_0x3d1c('0x25')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x5624ba,'request\x20sent',JSON[_0x3d1c('0x26')](_0x3bca4f));if(_0x3bca4f[_0x3d1c('0x27')]){if(_0x3bca4f['error'][_0x3d1c('0x28')]===0x1f4){logger[_0x3d1c('0x27')](_0x3d1c('0x23'),_0x5624ba,_0x3bca4f[_0x3d1c('0x27')][_0x3d1c('0x29')]);return _0x7b75f(_0x3bca4f['error'][_0x3d1c('0x29')]);}logger[_0x3d1c('0x27')](_0x3d1c('0x23'),_0x5624ba,_0x3bca4f[_0x3d1c('0x27')][_0x3d1c('0x29')]);return _0x16eac3(_0x3bca4f[_0x3d1c('0x27')][_0x3d1c('0x29')]);}else{logger[_0x3d1c('0x2a')](_0x3d1c('0x23'),_0x5624ba,'request\x20sent');_0x16eac3(_0x3bca4f['result'][_0x3d1c('0x29')]);}})[_0x3d1c('0x2b')](function(_0x5bf8ee){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x5624ba,_0x5bf8ee);_0x7b75f(_0x5bf8ee);});});}function respondWithStatusCode(_0x58e0fb,_0x29c12c){_0x29c12c=_0x29c12c||0xcc;return function(_0x841f6f){if(_0x841f6f){return _0x58e0fb[_0x3d1c('0x2c')](_0x29c12c);}return _0x58e0fb[_0x3d1c('0x2d')](_0x29c12c)['end']();};}function respondWithResult(_0x3dca64,_0xfb8914){_0xfb8914=_0xfb8914||0xc8;return function(_0x2c50c7){if(_0x2c50c7){return _0x3dca64[_0x3d1c('0x2d')](_0xfb8914)[_0x3d1c('0x2e')](_0x2c50c7);}};}function respondWithFilteredResult(_0x25c90e,_0x36303e){return function(_0x2d4694){if(_0x2d4694){var _0x32361b=_0x2d4694[_0x3d1c('0x2f')],_0x5781c3=_0x36303e[_0x3d1c('0x30')],_0x3a7530=_0x36303e[_0x3d1c('0x30')]+_0x36303e[_0x3d1c('0x31')],_0x3d26ae;if(_0x3a7530>=_0x32361b){_0x3a7530=_0x32361b;_0x3d26ae=0xc8;}else{_0x3d26ae=0xce;}_0x25c90e[_0x3d1c('0x2d')](_0x3d26ae);return _0x25c90e[_0x3d1c('0x32')](_0x3d1c('0x33'),_0x5781c3+'-'+_0x3a7530+'/'+_0x32361b)[_0x3d1c('0x2e')](_0x2d4694);}return null;};}function patchUpdates(_0x4433ad){return function(_0x52b16b){try{jsonpatch[_0x3d1c('0x34')](_0x52b16b,_0x4433ad,!![]);}catch(_0x19a993){return BPromise[_0x3d1c('0x35')](_0x19a993);}return _0x52b16b[_0x3d1c('0x36')]();};}function saveUpdates(_0xe6f857,_0x23aeaa){return function(_0x1e1276){if(_0x1e1276){return _0x1e1276[_0x3d1c('0x37')](_0xe6f857)['then'](function(_0x40ed0e){return _0x40ed0e;});}return null;};}function removeEntity(_0x1c0f59,_0x42655b){return function(_0x511d15){if(_0x511d15){return _0x511d15[_0x3d1c('0x38')]()[_0x3d1c('0x22')](function(){var _0x37a857=_0x511d15[_0x3d1c('0x39')]({'plain':!![]});var _0x56a14c='OpenchannelAccounts';return db['UserProfileResource'][_0x3d1c('0x38')]({'where':{'type':_0x56a14c,'resourceId':_0x37a857['id']}})[_0x3d1c('0x22')](function(){return _0x511d15;});})[_0x3d1c('0x22')](function(){_0x1c0f59[_0x3d1c('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d7183,_0x490106){return function(_0x397cbd){if(!_0x397cbd){_0x5d7183[_0x3d1c('0x2c')](0x194);}return _0x397cbd;};}function handleError(_0x3e0656,_0x1ffbe7){_0x1ffbe7=_0x1ffbe7||0x1f4;return function(_0x21153d){logger[_0x3d1c('0x27')](_0x21153d['stack']);if(_0x21153d[_0x3d1c('0x3a')]){delete _0x21153d['name'];}_0x3e0656[_0x3d1c('0x2d')](_0x1ffbe7)[_0x3d1c('0x3b')](_0x21153d);};}exports[_0x3d1c('0x3c')]=function(_0x1495cd,_0x5493ab){var _0x197dc5={'include':[{'model':db[_0x3d1c('0x3d')],'as':_0x3d1c('0x3e')}]},_0x56ff04={},_0x2af0c5={'count':0x0,'rows':[]};var _0x12c3ec=_[_0x3d1c('0x3f')](db[_0x3d1c('0x40')][_0x3d1c('0x41')],function(_0x5af79e){return{'name':_0x5af79e[_0x3d1c('0x42')],'type':_0x5af79e[_0x3d1c('0x43')][_0x3d1c('0x44')]};});_0x56ff04[_0x3d1c('0x45')]=_[_0x3d1c('0x3f')](_0x12c3ec,_0x3d1c('0x3a'));_0x56ff04[_0x3d1c('0x46')]=_[_0x3d1c('0x47')](_0x1495cd[_0x3d1c('0x46')]);_0x56ff04[_0x3d1c('0x48')]=_[_0x3d1c('0x49')](_0x56ff04[_0x3d1c('0x45')],_0x56ff04[_0x3d1c('0x46')]);_0x197dc5['attributes']=_[_0x3d1c('0x49')](_0x56ff04[_0x3d1c('0x45')],qs['fields'](_0x1495cd[_0x3d1c('0x46')]['fields']));_0x197dc5['attributes']=_0x197dc5[_0x3d1c('0x4a')][_0x3d1c('0x4b')]?_0x197dc5['attributes']:_0x56ff04[_0x3d1c('0x45')];if(!_0x1495cd[_0x3d1c('0x46')][_0x3d1c('0x4c')]('nolimit')){_0x197dc5['limit']=qs['limit'](_0x1495cd['query'][_0x3d1c('0x31')]);_0x197dc5[_0x3d1c('0x30')]=qs[_0x3d1c('0x30')](_0x1495cd['query'][_0x3d1c('0x30')]);}_0x197dc5[_0x3d1c('0x4d')]=qs[_0x3d1c('0x4e')](_0x1495cd['query'][_0x3d1c('0x4e')]);_0x197dc5['where']=qs['filters'](_[_0x3d1c('0x4f')](_0x1495cd[_0x3d1c('0x46')],_0x56ff04['filters']));if(_0x1495cd[_0x3d1c('0x46')][_0x3d1c('0x50')]){_0x197dc5[_0x3d1c('0x51')]=_[_0x3d1c('0x52')](_0x197dc5[_0x3d1c('0x51')],{'$or':_['map'](_0x12c3ec,function(_0x57a467){if(_0x57a467[_0x3d1c('0x43')][_0x3d1c('0x44')]!==_0x3d1c('0x53')){var _0x530802={};_0x530802[_0x57a467['field']]={'$like':'%'+_0x1495cd[_0x3d1c('0x46')][_0x3d1c('0x50')]+'%'};return _0x530802;}})});}_0x197dc5=_['merge']({},_0x197dc5,_0x1495cd[_0x3d1c('0x54')]);var _0x5b2064={'where':_0x197dc5[_0x3d1c('0x51')]};return db[_0x3d1c('0x40')][_0x3d1c('0x2f')](_0x5b2064)[_0x3d1c('0x22')](function(_0x18a45c){_0x2af0c5[_0x3d1c('0x2f')]=_0x18a45c;if(_0x1495cd[_0x3d1c('0x46')]['includeAll']){_0x197dc5[_0x3d1c('0x55')]=[{'all':!![]}];}return db[_0x3d1c('0x40')][_0x3d1c('0x56')](_0x197dc5);})['then'](function(_0x19e1ed){_0x2af0c5['rows']=_0x19e1ed;return _0x2af0c5;})[_0x3d1c('0x22')](respondWithFilteredResult(_0x5493ab,_0x197dc5))['catch'](handleError(_0x5493ab,null));};exports[_0x3d1c('0x57')]=function(_0x385da9,_0x5bffff){var _0x367f55={'raw':![],'where':{'id':_0x385da9[_0x3d1c('0x58')]['id']},'include':[{'model':db[_0x3d1c('0x3d')],'as':_0x3d1c('0x3e')}]},_0x5ceaa9={};_0x5ceaa9[_0x3d1c('0x45')]=_[_0x3d1c('0x47')](db[_0x3d1c('0x40')][_0x3d1c('0x41')]);_0x5ceaa9['query']=_['keys'](_0x385da9[_0x3d1c('0x46')]);_0x5ceaa9['filters']=_[_0x3d1c('0x49')](_0x5ceaa9[_0x3d1c('0x45')],_0x5ceaa9[_0x3d1c('0x46')]);_0x367f55[_0x3d1c('0x4a')]=_['intersection'](_0x5ceaa9[_0x3d1c('0x45')],qs[_0x3d1c('0x59')](_0x385da9[_0x3d1c('0x46')][_0x3d1c('0x59')]));_0x367f55['attributes']=_0x367f55[_0x3d1c('0x4a')]['length']?_0x367f55[_0x3d1c('0x4a')]:_0x5ceaa9[_0x3d1c('0x45')];if(_0x385da9[_0x3d1c('0x46')][_0x3d1c('0x5a')]){_0x367f55[_0x3d1c('0x55')]=[{'all':!![]}];}_0x367f55=_['merge']({},_0x367f55,_0x385da9[_0x3d1c('0x54')]);return db[_0x3d1c('0x40')][_0x3d1c('0x5b')](_0x367f55)[_0x3d1c('0x22')](handleEntityNotFound(_0x5bffff,null))[_0x3d1c('0x22')](respondWithResult(_0x5bffff,null))[_0x3d1c('0x2b')](handleError(_0x5bffff,null));};exports[_0x3d1c('0x5c')]=function(_0x546d50,_0x2f2049){return db[_0x3d1c('0x40')][_0x3d1c('0x5c')](_0x546d50['body'],{})[_0x3d1c('0x22')](function(_0xac276d){var _0x5c1d0d=_0x546d50[_0x3d1c('0x5d')][_0x3d1c('0x39')]({'plain':!![]});if(!_0x5c1d0d)throw new Error(_0x3d1c('0x5e'));if(_0x5c1d0d[_0x3d1c('0x5f')]===_0x3d1c('0x5d')){var _0x3eca37=_0xac276d[_0x3d1c('0x39')]({'plain':!![]});var _0x44fdb3=_0x3d1c('0x60');return db[_0x3d1c('0x61')][_0x3d1c('0x5b')]({'where':{'name':_0x44fdb3,'userProfileId':_0x5c1d0d[_0x3d1c('0x62')]},'raw':!![]})[_0x3d1c('0x22')](function(_0x456cbd){if(_0x456cbd&&_0x456cbd[_0x3d1c('0x63')]===0x0){return db['UserProfileResource'][_0x3d1c('0x5c')]({'name':_0x3eca37[_0x3d1c('0x3a')],'resourceId':_0x3eca37['id'],'type':_0x456cbd[_0x3d1c('0x3a')],'sectionId':_0x456cbd['id']},{})[_0x3d1c('0x22')](function(){return _0xac276d;});}else{return _0xac276d;}})[_0x3d1c('0x2b')](function(_0x355a39){logger[_0x3d1c('0x27')](_0x3d1c('0x64'),_0x355a39);throw _0x355a39;});}return _0xac276d;})[_0x3d1c('0x22')](respondWithResult(_0x2f2049,0xc9))[_0x3d1c('0x2b')](handleError(_0x2f2049,null));};exports['update']=function(_0x910678,_0x24ee9d){if(_0x910678[_0x3d1c('0x65')]['id']){delete _0x910678[_0x3d1c('0x65')]['id'];}return db[_0x3d1c('0x40')][_0x3d1c('0x5b')]({'where':{'id':_0x910678['params']['id']},'include':[{'model':db[_0x3d1c('0x3d')],'as':_0x3d1c('0x3e')}]})['then'](handleEntityNotFound(_0x24ee9d,null))['then'](saveUpdates(_0x910678[_0x3d1c('0x65')],null))[_0x3d1c('0x22')](respondWithResult(_0x24ee9d,null))[_0x3d1c('0x2b')](handleError(_0x24ee9d,null));};exports[_0x3d1c('0x38')]=function(_0x423bb4,_0x13d118){return db['OpenchannelAccount'][_0x3d1c('0x5b')]({'where':{'id':_0x423bb4['params']['id']}})[_0x3d1c('0x22')](handleEntityNotFound(_0x13d118,null))[_0x3d1c('0x22')](removeEntity(_0x13d118,null))['catch'](handleError(_0x13d118,null));};exports[_0x3d1c('0x66')]=function(_0x1bd4a6,_0x4cdf0d){return db[_0x3d1c('0x40')]['describe']()[_0x3d1c('0x22')](respondWithResult(_0x4cdf0d,null))['catch'](handleError(_0x4cdf0d,null));};exports['addDisposition']=function(_0x5de184,_0x57a35e,_0x4f1c24){if(_0x5de184[_0x3d1c('0x65')]['id']){delete _0x5de184[_0x3d1c('0x65')]['id'];}return db[_0x3d1c('0x40')][_0x3d1c('0x5b')]({'where':{'id':_0x5de184[_0x3d1c('0x58')]['id']}})[_0x3d1c('0x22')](handleEntityNotFound(_0x57a35e,null))['then'](function(_0x4e6d76){if(_0x4e6d76){_0x5de184[_0x3d1c('0x65')][_0x3d1c('0x67')]=_0x4e6d76['id'];return db[_0x3d1c('0x68')][_0x3d1c('0x5c')](_0x5de184[_0x3d1c('0x65')]);}})[_0x3d1c('0x22')](respondWithResult(_0x57a35e,null))[_0x3d1c('0x2b')](handleError(_0x57a35e,null));};exports['getDispositions']=function(_0x824735,_0xc8bf83,_0x519529){var _0x5b7d7c={'raw':![],'where':{}};var _0x403ef1={};var _0x25f5aa={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x3d1c('0x69')]({'where':{'id':_0x824735[_0x3d1c('0x58')]['id']}})['then'](handleEntityNotFound(_0xc8bf83,null))['then'](function(_0x33115f){if(_0x33115f){_0x403ef1['model']=_[_0x3d1c('0x47')](db[_0x3d1c('0x68')][_0x3d1c('0x41')]);_0x403ef1[_0x3d1c('0x46')]=_['keys'](_0x824735[_0x3d1c('0x46')]);_0x403ef1['filters']=_[_0x3d1c('0x49')](_0x403ef1[_0x3d1c('0x45')],_0x403ef1['query']);_0x5b7d7c['attributes']=_[_0x3d1c('0x49')](_0x403ef1[_0x3d1c('0x45')],qs[_0x3d1c('0x59')](_0x824735['query'][_0x3d1c('0x59')]));_0x5b7d7c[_0x3d1c('0x4a')]=_0x5b7d7c['attributes'][_0x3d1c('0x4b')]?_0x5b7d7c[_0x3d1c('0x4a')]:_0x403ef1['model'];if(!_0x824735[_0x3d1c('0x46')][_0x3d1c('0x4c')]('nolimit')){_0x5b7d7c[_0x3d1c('0x31')]=qs[_0x3d1c('0x31')](_0x824735[_0x3d1c('0x46')][_0x3d1c('0x31')]);_0x5b7d7c[_0x3d1c('0x30')]=qs[_0x3d1c('0x30')](_0x824735['query'][_0x3d1c('0x30')]);}_0x5b7d7c[_0x3d1c('0x4d')]=qs['sort'](_0x824735[_0x3d1c('0x46')]['sort']);_0x5b7d7c[_0x3d1c('0x51')]=qs['filters'](_[_0x3d1c('0x4f')](_0x824735['query'],_0x403ef1[_0x3d1c('0x48')]));_0x5b7d7c[_0x3d1c('0x51')]['OpenchannelAccountId']=_0x33115f['id'];if(_0x824735[_0x3d1c('0x46')]['filter']){_0x5b7d7c[_0x3d1c('0x51')]=_[_0x3d1c('0x52')](_0x5b7d7c['where'],{'$or':_[_0x3d1c('0x3f')](_0x5b7d7c[_0x3d1c('0x4a')],function(_0x7954e2){var _0x53a311={};_0x53a311[_0x7954e2]={'$like':'%'+_0x824735[_0x3d1c('0x46')][_0x3d1c('0x50')]+'%'};return _0x53a311;})});}_0x5b7d7c=_[_0x3d1c('0x52')]({},_0x5b7d7c,_0x824735[_0x3d1c('0x54')]);return db[_0x3d1c('0x68')]['count']({'where':_0x5b7d7c[_0x3d1c('0x51')]})['then'](function(_0x184d34){_0x25f5aa[_0x3d1c('0x2f')]=_0x184d34;if(_0x824735[_0x3d1c('0x46')]['includeAll']){_0x5b7d7c[_0x3d1c('0x55')]=[{'all':!![]}];}return db[_0x3d1c('0x68')][_0x3d1c('0x56')](_0x5b7d7c);})['then'](function(_0x4d1b94){_0x25f5aa[_0x3d1c('0x6a')]=_0x4d1b94;return _0x25f5aa;});}})[_0x3d1c('0x22')](respondWithFilteredResult(_0xc8bf83,_0x5b7d7c))[_0x3d1c('0x2b')](handleError(_0xc8bf83,null));};exports[_0x3d1c('0x6b')]=function(_0x9efaf9,_0x30ea71,_0x3c1b78){return db[_0x3d1c('0x40')][_0x3d1c('0x5b')]({'where':{'id':_0x9efaf9['params']['id']}})['then'](handleEntityNotFound(_0x30ea71,null))['then'](function(_0x1f3c22){if(_0x1f3c22){return _0x1f3c22[_0x3d1c('0x6b')](_0x9efaf9[_0x3d1c('0x46')][_0x3d1c('0x6c')]);}})[_0x3d1c('0x22')](respondWithStatusCode(_0x30ea71,null))['catch'](handleError(_0x30ea71,null));};exports[_0x3d1c('0x6d')]=function(_0x146cde,_0x5abe31,_0xef9bda){if(_0x146cde[_0x3d1c('0x65')]['id']){delete _0x146cde[_0x3d1c('0x65')]['id'];}return db[_0x3d1c('0x40')][_0x3d1c('0x5b')]({'where':{'id':_0x146cde[_0x3d1c('0x58')]['id']}})[_0x3d1c('0x22')](handleEntityNotFound(_0x5abe31,null))['then'](function(_0x11f713){if(_0x11f713){_0x146cde[_0x3d1c('0x65')][_0x3d1c('0x6e')]=_0x11f713['id'];return db[_0x3d1c('0x6f')][_0x3d1c('0x5c')](_0x146cde[_0x3d1c('0x65')]);}})[_0x3d1c('0x22')](respondWithResult(_0x5abe31,null))[_0x3d1c('0x2b')](handleError(_0x5abe31,null));};exports[_0x3d1c('0x70')]=function(_0xc6d658,_0x115bfa,_0x5c85e0){var _0xf2e6a9={'raw':![],'where':{}};var _0x181975={};var _0x2f8063={'count':0x0,'rows':[]};return db[_0x3d1c('0x40')][_0x3d1c('0x69')]({'where':{'id':_0xc6d658['params']['id']}})['then'](handleEntityNotFound(_0x115bfa,null))[_0x3d1c('0x22')](function(_0x34cf16){if(_0x34cf16){_0x181975[_0x3d1c('0x45')]=_[_0x3d1c('0x47')](db[_0x3d1c('0x6f')][_0x3d1c('0x41')]);_0x181975[_0x3d1c('0x46')]=_[_0x3d1c('0x47')](_0xc6d658[_0x3d1c('0x46')]);_0x181975[_0x3d1c('0x48')]=_[_0x3d1c('0x49')](_0x181975[_0x3d1c('0x45')],_0x181975['query']);_0xf2e6a9[_0x3d1c('0x4a')]=_[_0x3d1c('0x49')](_0x181975[_0x3d1c('0x45')],qs[_0x3d1c('0x59')](_0xc6d658[_0x3d1c('0x46')][_0x3d1c('0x59')]));_0xf2e6a9['attributes']=_0xf2e6a9['attributes'][_0x3d1c('0x4b')]?_0xf2e6a9['attributes']:_0x181975[_0x3d1c('0x45')];if(!_0xc6d658[_0x3d1c('0x46')][_0x3d1c('0x4c')](_0x3d1c('0x71'))){_0xf2e6a9['limit']=qs[_0x3d1c('0x31')](_0xc6d658[_0x3d1c('0x46')][_0x3d1c('0x31')]);_0xf2e6a9[_0x3d1c('0x30')]=qs[_0x3d1c('0x30')](_0xc6d658[_0x3d1c('0x46')][_0x3d1c('0x30')]);}_0xf2e6a9[_0x3d1c('0x4d')]=qs[_0x3d1c('0x4e')](_0xc6d658[_0x3d1c('0x46')][_0x3d1c('0x4e')]);_0xf2e6a9['where']=qs['filters'](_['pick'](_0xc6d658[_0x3d1c('0x46')],_0x181975[_0x3d1c('0x48')]));_0xf2e6a9[_0x3d1c('0x51')]['OpenchannelAccountId']=_0x34cf16['id'];if(_0xc6d658['query']['filter']){_0xf2e6a9[_0x3d1c('0x51')]=_[_0x3d1c('0x52')](_0xf2e6a9[_0x3d1c('0x51')],{'$or':_[_0x3d1c('0x3f')](_0xf2e6a9[_0x3d1c('0x4a')],function(_0x127c1e){var _0x516592={};_0x516592[_0x127c1e]={'$like':'%'+_0xc6d658['query'][_0x3d1c('0x50')]+'%'};return _0x516592;})});}_0xf2e6a9=_[_0x3d1c('0x52')]({},_0xf2e6a9,_0xc6d658[_0x3d1c('0x54')]);return db[_0x3d1c('0x6f')][_0x3d1c('0x2f')]({'where':_0xf2e6a9[_0x3d1c('0x51')]})[_0x3d1c('0x22')](function(_0x487d8d){_0x2f8063[_0x3d1c('0x2f')]=_0x487d8d;if(_0xc6d658['query']['includeAll']){_0xf2e6a9[_0x3d1c('0x55')]=[{'all':!![]}];}return db['CannedAnswer'][_0x3d1c('0x56')](_0xf2e6a9);})[_0x3d1c('0x22')](function(_0x3c419b){_0x2f8063[_0x3d1c('0x6a')]=_0x3c419b;return _0x2f8063;});}})['then'](respondWithFilteredResult(_0x115bfa,_0xf2e6a9))[_0x3d1c('0x2b')](handleError(_0x115bfa,null));};exports[_0x3d1c('0x72')]=function(_0x5652c0,_0x597621,_0x41f487){return db[_0x3d1c('0x40')][_0x3d1c('0x5b')]({'where':{'id':_0x5652c0[_0x3d1c('0x58')]['id']}})[_0x3d1c('0x22')](handleEntityNotFound(_0x597621,null))[_0x3d1c('0x22')](function(_0x9bb30c){if(_0x9bb30c){return _0x9bb30c[_0x3d1c('0x72')](_0x5652c0['query'][_0x3d1c('0x6c')]);}})[_0x3d1c('0x22')](respondWithStatusCode(_0x597621,null))[_0x3d1c('0x2b')](handleError(_0x597621,null));};exports['notify']=function(_0x5beffc,_0x517142,_0x4171c4){var _0x58fd16={'body':_0x5beffc[_0x3d1c('0x65')],'channel':'openchannel'};var _0x28dd87=[];var _0x878a17=[];var _0x16b096={};var _0x1e8819=![];return db[_0x3d1c('0x73')]['describe']()[_0x3d1c('0x22')](function(_0x4ab61f){if(!_0x4ab61f){throw new db['Sequelize']['ValidationError']('no\x20available\x20attributes');}_0x28dd87=_['difference'](_[_0x3d1c('0x47')](_0x4ab61f),['createdAt','updatedAt']);_0x878a17=_[_0x3d1c('0x74')](_[_0x3d1c('0x47')](_0x4ab61f),[_0x3d1c('0x75'),'updatedAt',_0x3d1c('0x76'),_0x3d1c('0x77')]);if(_0x5beffc['body']['id']){delete _0x5beffc[_0x3d1c('0x65')]['id'];}if(_[_0x3d1c('0x78')](_0x5beffc[_0x3d1c('0x65')][_0x3d1c('0x79')])){throw new db[(_0x3d1c('0x7a'))]['ValidationError'](_0x3d1c('0x7b'));}if(_['isNil'](_0x5beffc[_0x3d1c('0x65')]['body'])||_0x5beffc[_0x3d1c('0x65')]['body']===''){throw new db[(_0x3d1c('0x7a'))][(_0x3d1c('0x7c'))](_0x3d1c('0x7d'));}if(_[_0x3d1c('0x78')](_0x5beffc[_0x3d1c('0x65')][_0x3d1c('0x7e')])){throw new db[(_0x3d1c('0x7a'))]['ValidationError'](_0x3d1c('0x7f')+_0x878a17);}if(!_[_0x3d1c('0x80')](_0x878a17,_0x5beffc[_0x3d1c('0x65')][_0x3d1c('0x7e')])){throw new db[(_0x3d1c('0x7a'))][(_0x3d1c('0x7c'))](_0x3d1c('0x81')+_0x878a17);}_0x16b096[_0x5beffc[_0x3d1c('0x65')][_0x3d1c('0x7e')]]=_0x5beffc['body'][_0x3d1c('0x79')];})['then'](function(){return db[_0x3d1c('0x40')][_0x3d1c('0x5b')]({'where':{'id':_0x5beffc[_0x3d1c('0x58')]['id']},'include':[{'model':db[_0x3d1c('0x82')],'as':_0x3d1c('0x83'),'include':[{'model':db[_0x3d1c('0x73')],'as':_0x3d1c('0x84'),'where':_0x16b096,'limit':0x1,'order':[['updatedAt',_0x3d1c('0x85')]]}]},{'model':db[_0x3d1c('0x86')],'as':_0x3d1c('0x87')}]});})['then'](handleEntityNotFound(_0x517142,null))['then'](function(_0x194d57){if(_0x194d57&&_0x194d57[_0x3d1c('0x83')]){_0x58fd16[_0x3d1c('0x88')]=_0x194d57;_0x58fd16['applications']=_0x194d57[_0x3d1c('0x87')];_0x58fd16['list']=_0x194d57[_0x3d1c('0x83')];_0x58fd16[_0x3d1c('0x89')]=_[_0x3d1c('0x8a')](_0x58fd16['applications'],[_0x3d1c('0x8b')],[_0x3d1c('0x8c')]);if(_0x58fd16['account'][_0x3d1c('0x87')]){delete _0x58fd16['account']['Applications'];}if(_0x58fd16[_0x3d1c('0x88')][_0x3d1c('0x83')]&&_0x58fd16['account']['List']['Contacts'][_0x3d1c('0x4b')]){return _0x58fd16['account'][_0x3d1c('0x83')][_0x3d1c('0x84')][0x0];}var _0x59ffd2=_[_0x3d1c('0x8d')](_0x5beffc[_0x3d1c('0x65')],{'firstName':_0x5beffc['body']['from'],'ListId':_0x194d57['ListId']});_0x59ffd2[_0x5beffc[_0x3d1c('0x65')][_0x3d1c('0x7e')]]=_0x5beffc[_0x3d1c('0x65')][_0x3d1c('0x79')];return db[_0x3d1c('0x73')]['create'](_0x59ffd2,{'fields':_0x28dd87,'raw':!![]});}})[_0x3d1c('0x22')](handleEntityNotFound(_0x517142,null))['then'](function(_0x3bb4a5){_0x58fd16[_0x3d1c('0x8e')]=_0x3bb4a5;if(_0x3bb4a5){var _0x1baf23={'ContactId':_0x3bb4a5['id'],'OpenchannelAccountId':_0x5beffc['params']['id'],'from':(_0x3bb4a5['firstName']||'')+'\x20'+(_0x3bb4a5[_0x3d1c('0x8f')]||'')};var _0x53be9a={'OpenchannelAccountId':_0x5beffc[_0x3d1c('0x58')]['id'],'closed':![]};if(_0x5beffc[_0x3d1c('0x65')]['threadId']){_0x53be9a[_0x3d1c('0x90')]=_0x5beffc[_0x3d1c('0x65')][_0x3d1c('0x90')];return db[_0x3d1c('0x91')]['find']({'where':_0x53be9a})[_0x3d1c('0x22')](function(_0x66f4b6){if(_0x66f4b6){return[_0x66f4b6,![]];}_0x1baf23['threadId']=_0x5beffc[_0x3d1c('0x65')][_0x3d1c('0x90')];_0x1baf23[_0x3d1c('0x92')]=_0x5beffc[_0x3d1c('0x65')][_0x3d1c('0x92')];return db[_0x3d1c('0x91')][_0x3d1c('0x5c')](_0x1baf23)[_0x3d1c('0x22')](function(_0x23f77c){return[_0x23f77c,!![]];});});}else{_0x53be9a[_0x3d1c('0x90')]=null;}_0x53be9a['ContactId']=_0x3bb4a5['id'];return db['OpenchannelInteraction'][_0x3d1c('0x5b')]({'where':_0x53be9a})['then'](function(_0x44bc85){if(_0x44bc85){return[_0x44bc85,![]];}return db['OpenchannelInteraction'][_0x3d1c('0x5c')](_0x1baf23)[_0x3d1c('0x22')](function(_0x1b2020){return[_0x1b2020,!![]];});});}})[_0x3d1c('0x93')](function(_0x1863dd,_0x3e0713){if(_0x1863dd){_0x1e8819=_0x3e0713;if(!_0x3e0713){var _0x1dec60={'from':(_0x58fd16[_0x3d1c('0x8e')][_0x3d1c('0x94')]||'')+'\x20'+(_0x58fd16[_0x3d1c('0x8e')][_0x3d1c('0x8f')]||'')};if(_0x5beffc[_0x3d1c('0x65')]['threadId']&&_0x5beffc[_0x3d1c('0x65')]['messageId']&&_0x5beffc[_0x3d1c('0x65')][_0x3d1c('0x90')]!=_0x5beffc[_0x3d1c('0x65')]['messageId']){_0x1dec60[_0x3d1c('0x90')]=_0x5beffc[_0x3d1c('0x65')]['messageId'];}return _0x1863dd[_0x3d1c('0x37')](_0x1dec60);}else{return _0x1863dd;}}})['then'](function(_0x83e4ff){_0x58fd16[_0x3d1c('0x95')]=_0x83e4ff[_0x3d1c('0x39')]({'plain':!![]});_0x58fd16[_0x3d1c('0x95')][_0x3d1c('0x96')]=_0x1e8819;if(_0x58fd16[_0x3d1c('0x95')][_0x3d1c('0x96')]){if(_0x58fd16['account'][_0x3d1c('0x97')]){_0x58fd16['applications']['push']({'id':0x0,'priority':_0x58fd16[_0x3d1c('0x89')][_0x3d1c('0x4b')]+0x1,'app':_0x3d1c('0x98'),'appdata':_0x3d1c('0x99'),'interval':'*,*,*,*'});}}return db[_0x3d1c('0x9a')][_0x3d1c('0x5c')]({'body':_0x5beffc[_0x3d1c('0x65')][_0x3d1c('0x65')],'OpenchannelAccountId':_0x5beffc[_0x3d1c('0x58')]['id'],'OpenchannelInteractionId':_0x83e4ff['id'],'direction':'in','ContactId':_0x58fd16[_0x3d1c('0x8e')]['id'],'AttachmentId':_0x5beffc[_0x3d1c('0x65')][_0x3d1c('0x9b')]});})['then'](function(_0x399ecb){_0x58fd16['message']=_0x399ecb;if(_0x58fd16[_0x3d1c('0x95')][_0x3d1c('0x9c')]){return db[_0x3d1c('0x9d')]['find']({'attributes':['id','name'],'where':{'id':_0x58fd16[_0x3d1c('0x95')][_0x3d1c('0x9c')]}})[_0x3d1c('0x22')](function(_0x2b4b1b){if(_0x2b4b1b){_0x58fd16[_0x3d1c('0x89')][_0x3d1c('0x9e')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x2b4b1b['name']+','+(_0x58fd16[_0x3d1c('0x88')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});_0x58fd16['forcedOwnership']=![];}return respondWithRpcPromise(_0x3d1c('0x9f'),_0x3d1c('0xa0'),_0x58fd16);});}return respondWithRpcPromise(_0x3d1c('0x9f'),_0x3d1c('0xa0'),_0x58fd16);})[_0x3d1c('0x22')](function(_0x528c66){respondWithRpcPromise(_0x3d1c('0xa1'),'EventManager',{'event':_0x3d1c('0xa2'),'message':_0x528c66},client9002);return _0x528c66;})[_0x3d1c('0x22')](respondWithResult(_0x517142,null))[_0x3d1c('0x2b')](handleError(_0x517142,null));};exports['addApplications']=function(_0x3c87e9,_0x729c01,_0x260206){return db[_0x3d1c('0x40')][_0x3d1c('0x69')]({'where':{'id':_0x3c87e9['params']['id']}})['then'](handleEntityNotFound(_0x729c01,null))['then'](function(_0x2be9ff){if(_0x2be9ff){return db[_0x3d1c('0xa3')][_0x3d1c('0xa4')](function(_0x1d82c6){return db[_0x3d1c('0x86')][_0x3d1c('0x38')]({'where':{'OpenchannelAccountId':_0x3c87e9['params']['id']},'transaction':_0x1d82c6})[_0x3d1c('0x22')](function(_0x2fd1c8){var _0x3f26a1=_[_0x3d1c('0x3f')](_0x3c87e9[_0x3d1c('0x65')],function(_0x1ef2b8){_0x1ef2b8[_0x3d1c('0x6e')]=_0x3c87e9[_0x3d1c('0x58')]['id'];return _0x1ef2b8;});return db[_0x3d1c('0x86')][_0x3d1c('0xa5')](_0x3f26a1,{'transaction':_0x1d82c6});});})['then'](function(){return db['OpenchannelApplication'][_0x3d1c('0xa6')]({'where':{'OpenchannelAccountId':_0x3c87e9['params']['id']},'order':_0x3d1c('0x8b')});});}})['then'](respondWithResult(_0x729c01,null))[_0x3d1c('0x2b')](handleError(_0x729c01,null));};exports[_0x3d1c('0xa7')]=function(_0x5826fb,_0x49c32a,_0x1182be){var _0xa70ca1={};var _0x1d2c1a={};var _0x4af1ec;var _0x2ef58c;return db[_0x3d1c('0x40')][_0x3d1c('0x69')]({'where':{'id':_0x5826fb[_0x3d1c('0x58')]['id']}})[_0x3d1c('0x22')](handleEntityNotFound(_0x49c32a,null))[_0x3d1c('0x22')](function(_0x69bee7){if(_0x69bee7){_0x4af1ec=_0x69bee7;_0x1d2c1a[_0x3d1c('0x45')]=_[_0x3d1c('0x47')](db[_0x3d1c('0x86')]['rawAttributes']);_0x1d2c1a[_0x3d1c('0x46')]=_[_0x3d1c('0x47')](_0x5826fb[_0x3d1c('0x46')]);_0x1d2c1a[_0x3d1c('0x48')]=_[_0x3d1c('0x49')](_0x1d2c1a[_0x3d1c('0x45')],_0x1d2c1a[_0x3d1c('0x46')]);_0xa70ca1[_0x3d1c('0x4a')]=_[_0x3d1c('0x49')](_0x1d2c1a['model'],qs[_0x3d1c('0x59')](_0x5826fb[_0x3d1c('0x46')]['fields']));_0xa70ca1[_0x3d1c('0x4a')]=_0xa70ca1[_0x3d1c('0x4a')][_0x3d1c('0x4b')]?_0xa70ca1[_0x3d1c('0x4a')]:_0x1d2c1a[_0x3d1c('0x45')];_0xa70ca1['order']=qs[_0x3d1c('0x4e')](_0x5826fb['query'][_0x3d1c('0x4e')]);_0xa70ca1[_0x3d1c('0x51')]=qs[_0x3d1c('0x48')](_['pick'](_0x5826fb[_0x3d1c('0x46')],_0x1d2c1a[_0x3d1c('0x48')]));if(_0x5826fb['query'][_0x3d1c('0x50')]){_0xa70ca1[_0x3d1c('0x51')]=_[_0x3d1c('0x52')](_0xa70ca1[_0x3d1c('0x51')],{'$or':_['map'](_0xa70ca1[_0x3d1c('0x4a')],function(_0x59b585){var _0x2fd6c0={};_0x2fd6c0[_0x59b585]={'$like':'%'+_0x5826fb[_0x3d1c('0x46')][_0x3d1c('0x50')]+'%'};return _0x2fd6c0;})});}_0xa70ca1=_[_0x3d1c('0x52')]({},_0xa70ca1,_0x5826fb[_0x3d1c('0x54')]);return _0x4af1ec[_0x3d1c('0xa7')](_0xa70ca1);}})[_0x3d1c('0x22')](function(_0x4ac244){if(_0x4ac244){_0x2ef58c=_0x4ac244[_0x3d1c('0x4b')];if(!_0x5826fb['query'][_0x3d1c('0x4c')](_0x3d1c('0x71'))){_0xa70ca1[_0x3d1c('0x31')]=qs[_0x3d1c('0x31')](_0x5826fb[_0x3d1c('0x46')][_0x3d1c('0x31')]);_0xa70ca1['offset']=qs['offset'](_0x5826fb['query'][_0x3d1c('0x30')]);}return _0x4af1ec[_0x3d1c('0xa7')](_0xa70ca1);}})['then'](function(_0x51af28){if(_0x51af28){return _0x51af28?{'count':_0x2ef58c,'rows':_0x51af28}:null;}})[_0x3d1c('0x22')](respondWithResult(_0x49c32a,null))['catch'](handleError(_0x49c32a,null));};exports[_0x3d1c('0xa8')]=function(_0x2c711a,_0x4118b8,_0x6b7a3f){var _0x5a3c26={'raw':![],'where':{}};var _0xa269fd={};var _0x5ad5fc={'count':0x0,'rows':[]};return db[_0x3d1c('0x40')][_0x3d1c('0x69')]({'where':{'id':_0x2c711a['params']['id']}})[_0x3d1c('0x22')](handleEntityNotFound(_0x4118b8,null))[_0x3d1c('0x22')](function(_0x280228){if(_0x280228){_0xa269fd[_0x3d1c('0x45')]=_[_0x3d1c('0x47')](db[_0x3d1c('0x91')][_0x3d1c('0x41')]);_0xa269fd['query']=_[_0x3d1c('0x47')](_0x2c711a[_0x3d1c('0x46')]);_0xa269fd[_0x3d1c('0x48')]=_[_0x3d1c('0x49')](_0xa269fd[_0x3d1c('0x45')],_0xa269fd[_0x3d1c('0x46')]);_0x5a3c26[_0x3d1c('0x4a')]=_['intersection'](_0xa269fd[_0x3d1c('0x45')],qs[_0x3d1c('0x59')](_0x2c711a[_0x3d1c('0x46')]['fields']));_0x5a3c26[_0x3d1c('0x4a')]=_0x5a3c26[_0x3d1c('0x4a')][_0x3d1c('0x4b')]?_0x5a3c26['attributes']:_0xa269fd[_0x3d1c('0x45')];if(!_0x2c711a[_0x3d1c('0x46')][_0x3d1c('0x4c')]('nolimit')){_0x5a3c26['limit']=qs[_0x3d1c('0x31')](_0x2c711a['query'][_0x3d1c('0x31')]);_0x5a3c26['offset']=qs[_0x3d1c('0x30')](_0x2c711a[_0x3d1c('0x46')]['offset']);}_0x5a3c26['order']=qs[_0x3d1c('0x4e')](_0x2c711a[_0x3d1c('0x46')]['sort']);_0x5a3c26[_0x3d1c('0x51')]=qs[_0x3d1c('0x48')](_['pick'](_0x2c711a['query'],_0xa269fd['filters']));_0x5a3c26[_0x3d1c('0x51')][_0x3d1c('0x6e')]=_0x280228['id'];if(_0x2c711a[_0x3d1c('0x46')][_0x3d1c('0x50')]){_0x5a3c26[_0x3d1c('0x51')]=_[_0x3d1c('0x52')](_0x5a3c26[_0x3d1c('0x51')],{'$or':_['map'](_0x5a3c26['attributes'],function(_0x443870){var _0x164df7={};_0x164df7[_0x443870]={'$like':'%'+_0x2c711a[_0x3d1c('0x46')][_0x3d1c('0x50')]+'%'};return _0x164df7;})});}_0x5a3c26=_[_0x3d1c('0x52')]({},_0x5a3c26,_0x2c711a[_0x3d1c('0x54')]);return db['OpenchannelInteraction'][_0x3d1c('0x2f')]({'where':_0x5a3c26[_0x3d1c('0x51')]})[_0x3d1c('0x22')](function(_0x35041a){_0x5ad5fc[_0x3d1c('0x2f')]=_0x35041a;if(_0x2c711a['query']['includeAll']){_0x5a3c26[_0x3d1c('0x55')]=[{'model':db[_0x3d1c('0x73')],'as':'Contact','required':![]},{'model':db[_0x3d1c('0x9d')],'as':_0x3d1c('0xa9'),'attributes':[_0x3d1c('0x3a'),_0x3d1c('0xaa'),_0x3d1c('0xab')],'required':![]},{'model':db[_0x3d1c('0xac')],'as':'Tags','attributes':['id',_0x3d1c('0x3a'),_0x3d1c('0xad')],'where':_0x2c711a['query']['tag']?{'id':_0x2c711a[_0x3d1c('0x46')][_0x3d1c('0xae')]}:undefined,'required':_0x2c711a[_0x3d1c('0x46')]['tag']?!![]:![]}];}return db[_0x3d1c('0x91')][_0x3d1c('0x56')](_0x5a3c26);})['then'](function(_0x39acbf){_0x5ad5fc[_0x3d1c('0x6a')]=_0x39acbf;return _0x5ad5fc;});}})['then'](respondWithFilteredResult(_0x4118b8,_0x5a3c26))['catch'](handleError(_0x4118b8,null));};exports[_0x3d1c('0xaf')]=function(_0xd90edb,_0x4e78d9,_0x270a82){return db['OpenchannelAccount'][_0x3d1c('0x5b')]({'where':{'id':_0xd90edb['params']['id']}})['then'](handleEntityNotFound(_0x4e78d9,null))[_0x3d1c('0x22')](function(_0x4a95d3){if(_0x4a95d3){return _0x4a95d3[_0x3d1c('0xaf')](_0xd90edb[_0x3d1c('0x65')][_0x3d1c('0x6c')],_[_0x3d1c('0xb0')](_0xd90edb[_0x3d1c('0x65')],[_0x3d1c('0x6c'),'id'])||{})[_0x3d1c('0x93')](function(_0x38b47e){for(var _0x175e85=0x0;_0x175e85<_0xd90edb[_0x3d1c('0x65')][_0x3d1c('0x6c')][_0x3d1c('0x4b')];_0x175e85+=0x1){socket[_0x3d1c('0xb1')](_0x3d1c('0xb2'),{'UserId':_0xd90edb['body'][_0x3d1c('0x6c')][_0x175e85],'OpenchannelAccountId':_0xd90edb[_0x3d1c('0x58')]['id']});}return _0x38b47e;});}})[_0x3d1c('0x22')](respondWithResult(_0x4e78d9,null))[_0x3d1c('0x2b')](handleError(_0x4e78d9,null));};exports[_0x3d1c('0xb3')]=function(_0x4c7831,_0x4278ee,_0x4e2254){return db['OpenchannelAccount']['find']({'where':{'id':_0x4c7831[_0x3d1c('0x58')]['id']}})['then'](handleEntityNotFound(_0x4278ee,null))[_0x3d1c('0x22')](function(_0x4dd96c){if(_0x4dd96c){return _0x4dd96c[_0x3d1c('0xb3')](_0x4c7831[_0x3d1c('0x46')]['ids'])[_0x3d1c('0x22')](function(){if(_[_0x3d1c('0xb4')](_0x4c7831[_0x3d1c('0x46')]['ids'])){for(var _0x12ff6b=0x0;_0x12ff6b<_0x4c7831['query'][_0x3d1c('0x6c')]['length'];_0x12ff6b+=0x1){socket[_0x3d1c('0xb1')]('userOpenchannelAccount:remove',{'UserId':Number(_0x4c7831[_0x3d1c('0x46')][_0x3d1c('0x6c')][_0x12ff6b]),'OpenchannelAccountId':Number(_0x4c7831[_0x3d1c('0x58')]['id'])});}}else{socket[_0x3d1c('0xb1')](_0x3d1c('0xb5'),{'UserId':Number(_0x4c7831['query'][_0x3d1c('0x6c')]),'OpenchannelAccountId':Number(_0x4c7831[_0x3d1c('0x58')]['id'])});}});}})[_0x3d1c('0x22')](respondWithStatusCode(_0x4278ee,null))['catch'](handleError(_0x4278ee,null));};exports['getAgents']=function(_0x1cc298,_0x27d19d,_0x1b0614){var _0x54f20d={};var _0x5ffb73={};var _0x266d0c;var _0x5876bd;return db[_0x3d1c('0x40')][_0x3d1c('0x69')]({'where':{'id':_0x1cc298[_0x3d1c('0x58')]['id']}})[_0x3d1c('0x22')](handleEntityNotFound(_0x27d19d,null))[_0x3d1c('0x22')](function(_0x55bd8f){if(_0x55bd8f){_0x266d0c=_0x55bd8f;_0x5ffb73[_0x3d1c('0x45')]=_[_0x3d1c('0x47')](db[_0x3d1c('0x9d')][_0x3d1c('0x41')]);_0x5ffb73['query']=_[_0x3d1c('0x47')](_0x1cc298['query']);_0x5ffb73['filters']=_[_0x3d1c('0x49')](_0x5ffb73[_0x3d1c('0x45')],_0x5ffb73[_0x3d1c('0x46')]);_0x54f20d['attributes']=_[_0x3d1c('0x49')](_0x5ffb73[_0x3d1c('0x45')],qs[_0x3d1c('0x59')](_0x1cc298[_0x3d1c('0x46')]['fields']));_0x54f20d[_0x3d1c('0x4a')]=_0x54f20d[_0x3d1c('0x4a')]['length']?_0x54f20d[_0x3d1c('0x4a')]:_0x5ffb73[_0x3d1c('0x45')];_0x54f20d[_0x3d1c('0x4d')]=qs[_0x3d1c('0x4e')](_0x1cc298[_0x3d1c('0x46')][_0x3d1c('0x4e')]);_0x54f20d[_0x3d1c('0x51')]=qs['filters'](_[_0x3d1c('0x4f')](_0x1cc298[_0x3d1c('0x46')],_0x5ffb73[_0x3d1c('0x48')]));if(_0x1cc298[_0x3d1c('0x46')][_0x3d1c('0x50')]){_0x54f20d[_0x3d1c('0x51')]=_['merge'](_0x54f20d[_0x3d1c('0x51')],{'$or':_['map'](_0x54f20d[_0x3d1c('0x4a')],function(_0x5a8e5a){var _0x426338={};_0x426338[_0x5a8e5a]={'$like':'%'+_0x1cc298[_0x3d1c('0x46')][_0x3d1c('0x50')]+'%'};return _0x426338;})});}_0x54f20d=_[_0x3d1c('0x52')]({},_0x54f20d,_0x1cc298[_0x3d1c('0x54')]);return _0x266d0c[_0x3d1c('0xb6')](_0x54f20d);}})['then'](function(_0x377ca8){if(_0x377ca8){_0x5876bd=_0x377ca8[_0x3d1c('0x4b')];if(!_0x1cc298[_0x3d1c('0x46')][_0x3d1c('0x4c')](_0x3d1c('0x71'))){_0x54f20d[_0x3d1c('0x31')]=qs[_0x3d1c('0x31')](_0x1cc298['query'][_0x3d1c('0x31')]);_0x54f20d[_0x3d1c('0x30')]=qs[_0x3d1c('0x30')](_0x1cc298[_0x3d1c('0x46')][_0x3d1c('0x30')]);}return _0x266d0c[_0x3d1c('0xb6')](_0x54f20d);}})['then'](function(_0x5a8b4c){if(_0x5a8b4c){return _0x5a8b4c?{'count':_0x5876bd,'rows':_0x5a8b4c}:null;}})['then'](respondWithResult(_0x27d19d,null))[_0x3d1c('0x2b')](handleError(_0x27d19d,null));};exports[_0x3d1c('0x3b')]=function(_0xabccb2,_0x2cdad9,_0xd79ac4){var _0x3736b5,_0x45fc90,_0x18aafb;if(_['isNil'](_0xabccb2[_0x3d1c('0x65')][_0x3d1c('0x65')])||_0xabccb2[_0x3d1c('0x65')][_0x3d1c('0x65')]===''){throw new db['Sequelize']['ValidationError'](_0x3d1c('0x7d'));}if(_[_0x3d1c('0x78')](_0xabccb2[_0x3d1c('0x65')]['to'])){}_0x3736b5=_0xabccb2[_0x3d1c('0x65')]['to'];return db[_0x3d1c('0x40')][_0x3d1c('0x69')]({'where':{'id':_0xabccb2['params']['id']}})[_0x3d1c('0x22')](handleEntityNotFound(_0x2cdad9,null))[_0x3d1c('0x22')](function(_0x5f1d3a){if(_0x5f1d3a){return db[_0x3d1c('0x40')][_0x3d1c('0x5b')]({'where':{'id':_0x5f1d3a['id']},'include':[{'model':db[_0x3d1c('0x82')],'as':_0x3d1c('0x83'),'include':[{'model':db[_0x3d1c('0x73')],'as':_0x3d1c('0x84'),'where':{[_0x5f1d3a[_0x3d1c('0x7e')]]:_0x3736b5},'limit':0x1,'order':[[_0x3d1c('0xb7'),_0x3d1c('0x85')]]}]}]})['then'](handleEntityNotFound(_0x2cdad9,null))['then'](function(_0x5307c3){if(_0x5307c3&&_0x5307c3[_0x3d1c('0x83')]){_0x45fc90=_0x5307c3[_0x3d1c('0x39')]({'plain':!![]});if(_0x45fc90['List']&&_0x45fc90[_0x3d1c('0x83')][_0x3d1c('0x84')][_0x3d1c('0x4b')]){return _0x45fc90[_0x3d1c('0x83')][_0x3d1c('0x84')][0x0];}return db[_0x3d1c('0x73')][_0x3d1c('0x5c')](_['defaults'](_0xabccb2[_0x3d1c('0x65')],{'firstName':_0x3736b5,[_0x5307c3[_0x3d1c('0x7e')]]:_0x3736b5,'phone':_0x3736b5,'ListId':_0x45fc90[_0x3d1c('0x77')]}));}})[_0x3d1c('0x22')](handleEntityNotFound(_0x2cdad9,null))[_0x3d1c('0x22')](function(_0x2eccf5){if(_0x2eccf5){_0x18aafb=_0x2eccf5;return db[_0x3d1c('0x91')][_0x3d1c('0x5b')]({'where':{'ContactId':_0x18aafb['id'],'closed':![],'OpenchannelAccountId':_0x45fc90['id']}})[_0x3d1c('0x22')](function(_0x4458af){if(_0x4458af){return[_0x4458af,![]];}return db['OpenchannelInteraction'][_0x3d1c('0x5c')]({'UserId':_0xabccb2[_0x3d1c('0x5d')]['id'],'ContactId':_0x18aafb['id'],'OpenchannelAccountId':_0x45fc90['id'],'lastMsgDirection':_0x3d1c('0xb8'),'Messages':[_[_0x3d1c('0x52')](_0xabccb2[_0x3d1c('0x65')],{'read':![],'body':_0xabccb2[_0x3d1c('0x65')][_0x3d1c('0x65')],'OpenchannelAccountId':_0x45fc90['id'],'UserId':_0xabccb2[_0x3d1c('0x5d')]['id'],'ContactId':_0x18aafb['id']})]},{'include':[{'model':db[_0x3d1c('0x9a')],'as':'Messages'}]})[_0x3d1c('0x22')](function(_0x9bcbb9){return[_0x9bcbb9,!![]];});});}})[_0x3d1c('0x93')](function(_0x5099ad,_0xb5c3f0){if(_0xb5c3f0){return _0x5099ad;}return db[_0x3d1c('0x9a')][_0x3d1c('0x5c')](_[_0x3d1c('0x52')](_0xabccb2['body'],{'read':![],'body':_0xabccb2[_0x3d1c('0x65')][_0x3d1c('0x65')],'OpenchannelAccountId':_0x45fc90['id'],'OpenchannelInteractionId':_0x5099ad['id'],'UserId':_0xabccb2['user']['id'],'ContactId':_0x18aafb['id']}))[_0x3d1c('0x22')](function(_0x149ef8){_0x5099ad[_0x3d1c('0xb9')][_0x3d1c('0xba')]=[];_0x5099ad[_0x3d1c('0xb9')][_0x3d1c('0xba')][_0x3d1c('0xbb')](_0x149ef8['dataValues']);return _0x5099ad;});});}})[_0x3d1c('0x22')](respondWithResult(_0x2cdad9,null))[_0x3d1c('0x2b')](handleError(_0x2cdad9,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 35ef877..771d33a 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 _0x05fd=['setMaxListeners','save','update','remove','hook','exports','events','OpenchannelAccount'];(function(_0x5a3cf0,_0x160a68){var _0x5a64ee=function(_0x34cd1d){while(--_0x34cd1d){_0x5a3cf0['push'](_0x5a3cf0['shift']());}};_0x5a64ee(++_0x160a68);}(_0x05fd,0x1e6));var _0xd05f=function(_0x3ffd53,_0x1ac8ff){_0x3ffd53=_0x3ffd53-0x0;var _0x19ff4a=_0x05fd[_0x3ffd53];return _0x19ff4a;};'use strict';var EventEmitter=require(_0xd05f('0x0'));var OpenchannelAccount=require('../../mysqldb')['db'][_0xd05f('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xd05f('0x2')](0x0);var events={'afterCreate':_0xd05f('0x3'),'afterUpdate':_0xd05f('0x4'),'afterDestroy':_0xd05f('0x5')};function emitEvent(_0x3df6e3){return function(_0x39ca80,_0x2d7962,_0x1757e4){OpenchannelAccountEvents['emit'](_0x3df6e3+':'+_0x39ca80['id'],_0x39ca80);OpenchannelAccountEvents['emit'](_0x3df6e3,_0x39ca80);_0x1757e4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0xd05f('0x6')](e,emitEvent(event));}}module[_0xd05f('0x7')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x2db6=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit'];(function(_0x432b6f,_0xf0a097){var _0x579357=function(_0x280aa0){while(--_0x280aa0){_0x432b6f['push'](_0x432b6f['shift']());}};_0x579357(++_0xf0a097);}(_0x2db6,0x16b));var _0x62db=function(_0x14addb,_0x4a5ecb){_0x14addb=_0x14addb-0x0;var _0x50facf=_0x2db6[_0x14addb];return _0x50facf;};'use strict';var EventEmitter=require(_0x62db('0x0'));var OpenchannelAccount=require(_0x62db('0x1'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x62db('0x2')](0x0);var events={'afterCreate':_0x62db('0x3'),'afterUpdate':_0x62db('0x4'),'afterDestroy':_0x62db('0x5')};function emitEvent(_0x595624){return function(_0x415155,_0x549bd1,_0x3a5f20){OpenchannelAccountEvents[_0x62db('0x6')](_0x595624+':'+_0x415155['id'],_0x415155);OpenchannelAccountEvents[_0x62db('0x6')](_0x595624,_0x415155);_0x3a5f20(null);};}for(var e in events){if(events[_0x62db('0x7')](e)){var event=events[e];OpenchannelAccount[_0x62db('0x8')](e,emitEvent(event));}}module[_0x62db('0x9')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 25bc18b..fda90aa 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 _0x057a=['./openchannelAccount.attributes','define','OpenchannelAccount','openchannel_accounts','lodash','util','../../config/logger','moment','request-promise','path','../../config/environment'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x057a,0x1a6));var _0xa057=function(_0x415aa1,_0x335f85){_0x415aa1=_0x415aa1-0x0;var _0x3922f4=_0x057a[_0x415aa1];return _0x3922f4;};'use strict';var _=require(_0xa057('0x0'));var util=require(_0xa057('0x1'));var logger=require(_0xa057('0x2'))('api');var moment=require(_0xa057('0x3'));var BPromise=require('bluebird');var rp=require(_0xa057('0x4'));var fs=require('fs');var path=require(_0xa057('0x5'));var rimraf=require('rimraf');var config=require(_0xa057('0x6'));var attributes=require(_0xa057('0x7'));module['exports']=function(_0x55b99c,_0x466f7d){return _0x55b99c[_0xa057('0x8')](_0xa057('0x9'),attributes,{'tableName':_0xa057('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaa4d=['define','OpenchannelAccount','openchannel_accounts','lodash','util','../../config/logger','bluebird','rimraf','../../config/environment','./openchannelAccount.attributes'];(function(_0x172948,_0x4262cc){var _0x4aeaa9=function(_0x5ec4b3){while(--_0x5ec4b3){_0x172948['push'](_0x172948['shift']());}};_0x4aeaa9(++_0x4262cc);}(_0xaa4d,0xb7));var _0xdaa4=function(_0x415b51,_0x1a29ee){_0x415b51=_0x415b51-0x0;var _0x1dd82c=_0xaa4d[_0x415b51];return _0x1dd82c;};'use strict';var _=require(_0xdaa4('0x0'));var util=require(_0xdaa4('0x1'));var logger=require(_0xdaa4('0x2'))('api');var moment=require('moment');var BPromise=require(_0xdaa4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xdaa4('0x4'));var config=require(_0xdaa4('0x5'));var attributes=require(_0xdaa4('0x6'));module['exports']=function(_0x3fe2fa,_0x189223){return _0x3fe2fa[_0xdaa4('0x7')](_0xdaa4('0x8'),attributes,{'tableName':_0xdaa4('0x9'),'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 262f735..8705b8f 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 _0x6ace=['message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','request','then','OpenchannelAccount,\x20%s,\x20%s','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x5bc98f,_0x189c7f){var _0x208237=function(_0x5322ac){while(--_0x5322ac){_0x5bc98f['push'](_0x5bc98f['shift']());}};_0x208237(++_0x189c7f);}(_0x6ace,0x17c));var _0xe6ac=function(_0x1ec548,_0x2908f7){_0x1ec548=_0x1ec548-0x0;var _0x2cebbf=_0x6ace[_0x1ec548];return _0x2cebbf;};'use strict';var _=require('lodash');var util=require(_0xe6ac('0x0'));var moment=require(_0xe6ac('0x1'));var BPromise=require(_0xe6ac('0x2'));var rs=require(_0xe6ac('0x3'));var fs=require('fs');var Redis=require(_0xe6ac('0x4'));var db=require(_0xe6ac('0x5'))['db'];var utils=require(_0xe6ac('0x6'));var logger=require(_0xe6ac('0x7'))(_0xe6ac('0x8'));var config=require(_0xe6ac('0x9'));var jayson=require(_0xe6ac('0xa'));var client=jayson[_0xe6ac('0xb')][_0xe6ac('0xc')]({'port':0x232a});config[_0xe6ac('0xd')]=_[_0xe6ac('0xe')](config[_0xe6ac('0xd')],{'host':_0xe6ac('0xf'),'port':0x18eb});var socket=require(_0xe6ac('0x10'))(new Redis(config[_0xe6ac('0xd')]));require(_0xe6ac('0x11'))['register'](socket);function respondWithRpcPromise(_0x484e55,_0x52b380,_0x96f1fd){return new BPromise(function(_0x4ae17e,_0x519597){return client[_0xe6ac('0x12')](_0x484e55,_0x96f1fd)[_0xe6ac('0x13')](function(_0x5905cb){logger['info'](_0xe6ac('0x14'),_0x52b380,'request\x20sent');logger['debug'](_0xe6ac('0x15'),_0x52b380,_0xe6ac('0x16'),JSON[_0xe6ac('0x17')](_0x5905cb));if(_0x5905cb['error']){if(_0x5905cb['error']['code']===0x1f4){logger[_0xe6ac('0x18')]('OpenchannelAccount,\x20%s,\x20%s',_0x52b380,_0x5905cb['error'][_0xe6ac('0x19')]);return _0x519597(_0x5905cb[_0xe6ac('0x18')][_0xe6ac('0x19')]);}logger[_0xe6ac('0x18')](_0xe6ac('0x14'),_0x52b380,_0x5905cb[_0xe6ac('0x18')]['message']);return _0x4ae17e(_0x5905cb['error'][_0xe6ac('0x19')]);}else{logger['info'](_0xe6ac('0x14'),_0x52b380,_0xe6ac('0x16'));_0x4ae17e(_0x5905cb[_0xe6ac('0x1a')][_0xe6ac('0x19')]);}})['catch'](function(_0x4dfd8f){logger[_0xe6ac('0x18')]('OpenchannelAccount,\x20%s,\x20%s',_0x52b380,_0x4dfd8f);_0x519597(_0x4dfd8f);});});} \ No newline at end of file +var _0xcf38=['request\x20sent','error','code','message','result','catch','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','http','redis','defaults','localhost','register','request','info','OpenchannelAccount,\x20%s,\x20%s','OpenchannelAccount,\x20%s,\x20%s,\x20%s'];(function(_0x16ebeb,_0x37c544){var _0x12e1cb=function(_0x29fd74){while(--_0x29fd74){_0x16ebeb['push'](_0x16ebeb['shift']());}};_0x12e1cb(++_0x37c544);}(_0xcf38,0x17c));var _0x8cf3=function(_0x4bd19f,_0x312aa8){_0x4bd19f=_0x4bd19f-0x0;var _0x107023=_0xcf38[_0x4bd19f];return _0x107023;};'use strict';var _=require('lodash');var util=require(_0x8cf3('0x0'));var moment=require(_0x8cf3('0x1'));var BPromise=require('bluebird');var rs=require(_0x8cf3('0x2'));var fs=require('fs');var Redis=require(_0x8cf3('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8cf3('0x4'));var logger=require(_0x8cf3('0x5'))(_0x8cf3('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x8cf3('0x7')]({'port':0x232a});config[_0x8cf3('0x8')]=_[_0x8cf3('0x9')](config[_0x8cf3('0x8')],{'host':_0x8cf3('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8cf3('0x8')]));require('./openchannelAccount.socket')[_0x8cf3('0xb')](socket);function respondWithRpcPromise(_0x306bb9,_0x20901d,_0x26db37){return new BPromise(function(_0x29c823,_0x3e80e5){return client[_0x8cf3('0xc')](_0x306bb9,_0x26db37)['then'](function(_0x361e8e){logger[_0x8cf3('0xd')](_0x8cf3('0xe'),_0x20901d,'request\x20sent');logger['debug'](_0x8cf3('0xf'),_0x20901d,_0x8cf3('0x10'),JSON['stringify'](_0x361e8e));if(_0x361e8e[_0x8cf3('0x11')]){if(_0x361e8e[_0x8cf3('0x11')][_0x8cf3('0x12')]===0x1f4){logger[_0x8cf3('0x11')](_0x8cf3('0xe'),_0x20901d,_0x361e8e[_0x8cf3('0x11')][_0x8cf3('0x13')]);return _0x3e80e5(_0x361e8e[_0x8cf3('0x11')][_0x8cf3('0x13')]);}logger[_0x8cf3('0x11')]('OpenchannelAccount,\x20%s,\x20%s',_0x20901d,_0x361e8e['error'][_0x8cf3('0x13')]);return _0x29c823(_0x361e8e['error'][_0x8cf3('0x13')]);}else{logger[_0x8cf3('0xd')](_0x8cf3('0xe'),_0x20901d,_0x8cf3('0x10'));_0x29c823(_0x361e8e[_0x8cf3('0x14')][_0x8cf3('0x13')]);}})[_0x8cf3('0x15')](function(_0x5a6067){logger[_0x8cf3('0x11')](_0x8cf3('0xe'),_0x20901d,_0x5a6067);_0x3e80e5(_0x5a6067);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 7f9b0fe..c4bf026 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 _0x1078=['removeListener','openchannelAccount:','./openchannelAccount.events','remove','update','emit'];(function(_0x5be3bc,_0x4cf06d){var _0x3ebbb3=function(_0x175e4d){while(--_0x175e4d){_0x5be3bc['push'](_0x5be3bc['shift']());}};_0x3ebbb3(++_0x4cf06d);}(_0x1078,0x1d0));var _0x8107=function(_0x13579c,_0x2c2f50){_0x13579c=_0x13579c-0x0;var _0x27b770=_0x1078[_0x13579c];return _0x27b770;};'use strict';var OpenchannelAccountEvents=require(_0x8107('0x0'));var events=['save',_0x8107('0x1'),_0x8107('0x2')];function createListener(_0x504955,_0xfc8e28){return function(_0x3213d3){_0xfc8e28[_0x8107('0x3')](_0x504955,_0x3213d3);};}function removeListener(_0x31e9c1,_0x3a6aa9){return function(){OpenchannelAccountEvents[_0x8107('0x4')](_0x31e9c1,_0x3a6aa9);};}exports['register']=function(_0x45dd20){for(var _0x317c89=0x0,_0x1c2d22=events['length'];_0x317c89<_0x1c2d22;_0x317c89++){var _0x35ce20=events[_0x317c89];var _0x56e920=createListener(_0x8107('0x5')+_0x35ce20,_0x45dd20);OpenchannelAccountEvents['on'](_0x35ce20,_0x56e920);}}; \ No newline at end of file +var _0x6a3d=['openchannelAccount:','./openchannelAccount.events','save','update','register','length'];(function(_0x23bcd4,_0xd3deb0){var _0x4cb792=function(_0x48d4c8){while(--_0x48d4c8){_0x23bcd4['push'](_0x23bcd4['shift']());}};_0x4cb792(++_0xd3deb0);}(_0x6a3d,0x1db));var _0xd6a3=function(_0x38b3e3,_0x5e2d17){_0x38b3e3=_0x38b3e3-0x0;var _0x39f352=_0x6a3d[_0x38b3e3];return _0x39f352;};'use strict';var OpenchannelAccountEvents=require(_0xd6a3('0x0'));var events=[_0xd6a3('0x1'),'remove',_0xd6a3('0x2')];function createListener(_0x4c4379,_0x51fcf0){return function(_0x2da256){_0x51fcf0['emit'](_0x4c4379,_0x2da256);};}function removeListener(_0x4e8fab,_0x1b87f){return function(){OpenchannelAccountEvents['removeListener'](_0x4e8fab,_0x1b87f);};}exports[_0xd6a3('0x3')]=function(_0x104057){for(var _0x5e38d7=0x0,_0x276154=events[_0xd6a3('0x4')];_0x5e38d7<_0x276154;_0x5e38d7++){var _0x2e2af1=events[_0x5e38d7];var _0x2a0efa=createListener(_0xd6a3('0x5')+_0x2e2af1,_0x104057);OpenchannelAccountEvents['on'](_0x2e2af1,_0x2a0efa);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 31292fa..f462da5 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 _0x3e3f=['exports','multer','util','connect-timeout','express','Router','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','show','post','create','/:id','update','delete'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x3e3f,0xef));var _0xf3e3=function(_0x2a7210,_0x337576){_0x2a7210=_0x2a7210-0x0;var _0x4f1f3f=_0x3e3f[_0x2a7210];return _0x4f1f3f;};'use strict';var multer=require(_0xf3e3('0x0'));var util=require(_0xf3e3('0x1'));var path=require('path');var timeout=require(_0xf3e3('0x2'));var express=require(_0xf3e3('0x3'));var router=express[_0xf3e3('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf3e3('0x5'));var controller=require(_0xf3e3('0x6'));router[_0xf3e3('0x7')]('/',auth[_0xf3e3('0x8')](),controller[_0xf3e3('0x9')]);router[_0xf3e3('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xf3e3('0xa')]);router[_0xf3e3('0xb')]('/',auth[_0xf3e3('0x8')](),controller[_0xf3e3('0xc')]);router['put'](_0xf3e3('0xd'),auth[_0xf3e3('0x8')](),controller[_0xf3e3('0xe')]);router[_0xf3e3('0xf')](_0xf3e3('0xd'),auth[_0xf3e3('0x8')](),controller['destroy']);module[_0xf3e3('0x10')]=router; \ No newline at end of file +var _0x16d2=['show','isAuthenticated','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','../../components/interaction/service','./openchannelApplication.controller','get','index','/:id'];(function(_0x4f3da4,_0x121375){var _0x1df1a1=function(_0x329dfc){while(--_0x329dfc){_0x4f3da4['push'](_0x4f3da4['shift']());}};_0x1df1a1(++_0x121375);}(_0x16d2,0xa1));var _0x216d=function(_0x5727d1,_0x366c31){_0x5727d1=_0x5727d1-0x0;var _0x895542=_0x16d2[_0x5727d1];return _0x895542;};'use strict';var multer=require('multer');var util=require(_0x216d('0x0'));var path=require(_0x216d('0x1'));var timeout=require(_0x216d('0x2'));var express=require('express');var router=express[_0x216d('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x216d('0x4'));var config=require('../../config/environment');var controller=require(_0x216d('0x5'));router[_0x216d('0x6')]('/',auth['isAuthenticated'](),controller[_0x216d('0x7')]);router[_0x216d('0x6')](_0x216d('0x8'),auth['isAuthenticated'](),controller[_0x216d('0x9')]);router['post']('/',auth[_0x216d('0xa')](),controller[_0x216d('0xb')]);router[_0x216d('0xc')]('/:id',auth[_0x216d('0xa')](),controller[_0x216d('0xd')]);router[_0x216d('0xe')](_0x216d('0x8'),auth[_0x216d('0xa')](),controller[_0x216d('0xf')]);module[_0x216d('0x10')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 3b764a8..6fa9974 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 _0xb61b=['STRING','*,*,*,*','exports','INTEGER','noop','TEXT'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xb61b,0xc8));var _0xbb61=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xb61b[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require('sequelize');module[_0xbb61('0x0')]={'priority':{'type':Sequelize[_0xbb61('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xbb61('0x2')},'appdata':{'type':Sequelize[_0xbb61('0x3')]()},'description':{'type':Sequelize[_0xbb61('0x4')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xbb61('0x5')}}; \ No newline at end of file +var _0x3c7b=['TEXT','*,*,*,*','sequelize','exports','STRING'];(function(_0x3da7ab,_0x2e00dc){var _0x4819ed=function(_0x484ce3){while(--_0x484ce3){_0x3da7ab['push'](_0x3da7ab['shift']());}};_0x4819ed(++_0x2e00dc);}(_0x3c7b,0x1ba));var _0xb3c7=function(_0x39f34a,_0x45a8ca){_0x39f34a=_0x39f34a-0x0;var _0x119155=_0x3c7b[_0x39f34a];return _0x119155;};'use strict';var Sequelize=require(_0xb3c7('0x0'));module[_0xb3c7('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xb3c7('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xb3c7('0x3')]()},'description':{'type':Sequelize[_0xb3c7('0x2')]},'interval':{'type':Sequelize[_0xb3c7('0x2')],'defaultValue':_0xb3c7('0x4')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 0ec34a2..b822ba5 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 _0x6369=['request-promise','bluebird','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','update','then','destroy','error','stack','name','index','map','OpenchannelApplication','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x286726,_0x20a337){var _0xcd4fe9=function(_0x4d7da6){while(--_0x4d7da6){_0x286726['push'](_0x286726['shift']());}};_0xcd4fe9(++_0x20a337);}(_0x6369,0x97));var _0x9636=function(_0x35e15a,_0x321e66){_0x35e15a=_0x35e15a-0x0;var _0x15b571=_0x6369[_0x35e15a];return _0x15b571;};'use strict';var pdf=require(_0x9636('0x0'));var emlformat=require(_0x9636('0x1'));var rimraf=require(_0x9636('0x2'));var zipdir=require(_0x9636('0x3'));var jsonpatch=require(_0x9636('0x4'));var rp=require(_0x9636('0x5'));var moment=require('moment');var BPromise=require(_0x9636('0x6'));var Mustache=require('mustache');var util=require(_0x9636('0x7'));var path=require(_0x9636('0x8'));var sox=require(_0x9636('0x9'));var csv=require('to-csv');var ejs=require(_0x9636('0xa'));var fs=require('fs');var _=require(_0x9636('0xb'));var squel=require(_0x9636('0xc'));var crypto=require(_0x9636('0xd'));var jsforce=require(_0x9636('0xe'));var deskjs=require(_0x9636('0xf'));var toCsv=require(_0x9636('0x10'));var querystring=require('querystring');var Papa=require(_0x9636('0x11'));var Redis=require(_0x9636('0x12'));var authService=require(_0x9636('0x13'));var qs=require(_0x9636('0x14'));var as=require(_0x9636('0x15'));var hardwareService=require(_0x9636('0x16'));var logger=require(_0x9636('0x17'))(_0x9636('0x18'));var utils=require(_0x9636('0x19'));var config=require(_0x9636('0x1a'));var db=require(_0x9636('0x1b'))['db'];function respondWithStatusCode(_0x4b2bc7,_0x15027d){_0x15027d=_0x15027d||0xcc;return function(_0x48705c){if(_0x48705c){return _0x4b2bc7[_0x9636('0x1c')](_0x15027d);}return _0x4b2bc7[_0x9636('0x1d')](_0x15027d)[_0x9636('0x1e')]();};}function respondWithResult(_0x137420,_0x4cdf1a){_0x4cdf1a=_0x4cdf1a||0xc8;return function(_0x10ae0b){if(_0x10ae0b){return _0x137420[_0x9636('0x1d')](_0x4cdf1a)[_0x9636('0x1f')](_0x10ae0b);}};}function respondWithFilteredResult(_0x932c47,_0x45d03e){return function(_0x3f3a0f){if(_0x3f3a0f){var _0x354772=_0x3f3a0f[_0x9636('0x20')],_0x1b8435=_0x45d03e[_0x9636('0x21')],_0x5ee242=_0x45d03e[_0x9636('0x21')]+_0x45d03e[_0x9636('0x22')],_0xc9da37;if(_0x5ee242>=_0x354772){_0x5ee242=_0x354772;_0xc9da37=0xc8;}else{_0xc9da37=0xce;}_0x932c47[_0x9636('0x1d')](_0xc9da37);return _0x932c47['set'](_0x9636('0x23'),_0x1b8435+'-'+_0x5ee242+'/'+_0x354772)[_0x9636('0x1f')](_0x3f3a0f);}return null;};}function patchUpdates(_0x444b25){return function(_0x36d8c4){try{jsonpatch['apply'](_0x36d8c4,_0x444b25,!![]);}catch(_0x5a952b){return BPromise['reject'](_0x5a952b);}return _0x36d8c4['save']();};}function saveUpdates(_0x2382a1,_0x295f1f){return function(_0x44c6e0){if(_0x44c6e0){return _0x44c6e0[_0x9636('0x24')](_0x2382a1)[_0x9636('0x25')](function(_0x449755){return _0x449755;});}return null;};}function removeEntity(_0x12ed0b,_0x251cea){return function(_0x1c1d44){if(_0x1c1d44){return _0x1c1d44[_0x9636('0x26')]()[_0x9636('0x25')](function(){_0x12ed0b[_0x9636('0x1d')](0xcc)[_0x9636('0x1e')]();});}};}function handleEntityNotFound(_0x55d716,_0x139ac9){return function(_0x10c3e8){if(!_0x10c3e8){_0x55d716[_0x9636('0x1c')](0x194);}return _0x10c3e8;};}function handleError(_0x1735a7,_0x5f3cdb){_0x5f3cdb=_0x5f3cdb||0x1f4;return function(_0x450029){logger[_0x9636('0x27')](_0x450029[_0x9636('0x28')]);if(_0x450029[_0x9636('0x29')]){delete _0x450029[_0x9636('0x29')];}_0x1735a7['status'](_0x5f3cdb)['send'](_0x450029);};}exports[_0x9636('0x2a')]=function(_0x49b4bb,_0x517ebc){var _0x38c60f={},_0xe176b9={},_0x497faf={'count':0x0,'rows':[]};var _0x4c4b57=_[_0x9636('0x2b')](db[_0x9636('0x2c')]['rawAttributes'],function(_0x20e577){return{'name':_0x20e577[_0x9636('0x2d')],'type':_0x20e577[_0x9636('0x2e')][_0x9636('0x2f')]};});_0xe176b9[_0x9636('0x30')]=_[_0x9636('0x2b')](_0x4c4b57,_0x9636('0x29'));_0xe176b9[_0x9636('0x31')]=_[_0x9636('0x32')](_0x49b4bb[_0x9636('0x31')]);_0xe176b9['filters']=_[_0x9636('0x33')](_0xe176b9[_0x9636('0x30')],_0xe176b9[_0x9636('0x31')]);_0x38c60f[_0x9636('0x34')]=_[_0x9636('0x33')](_0xe176b9[_0x9636('0x30')],qs[_0x9636('0x35')](_0x49b4bb[_0x9636('0x31')][_0x9636('0x35')]));_0x38c60f['attributes']=_0x38c60f['attributes']['length']?_0x38c60f[_0x9636('0x34')]:_0xe176b9[_0x9636('0x30')];if(!_0x49b4bb[_0x9636('0x31')][_0x9636('0x36')](_0x9636('0x37'))){_0x38c60f[_0x9636('0x22')]=qs['limit'](_0x49b4bb[_0x9636('0x31')]['limit']);_0x38c60f[_0x9636('0x21')]=qs[_0x9636('0x21')](_0x49b4bb[_0x9636('0x31')][_0x9636('0x21')]);}_0x38c60f[_0x9636('0x38')]=qs[_0x9636('0x39')](_0x49b4bb[_0x9636('0x31')]['sort']);_0x38c60f[_0x9636('0x3a')]=qs[_0x9636('0x3b')](_[_0x9636('0x3c')](_0x49b4bb[_0x9636('0x31')],_0xe176b9[_0x9636('0x3b')]));if(_0x49b4bb['query'][_0x9636('0x3d')]){_0x38c60f[_0x9636('0x3a')]=_[_0x9636('0x3e')](_0x38c60f[_0x9636('0x3a')],{'$or':_['map'](_0x4c4b57,function(_0x540d09){if(_0x540d09['type']['key']!==_0x9636('0x3f')){var _0x19e271={};_0x19e271[_0x540d09[_0x9636('0x40')]]={'$like':'%'+_0x49b4bb[_0x9636('0x31')]['filter']+'%'};return _0x19e271;}})});}_0x38c60f=_[_0x9636('0x3e')]({},_0x38c60f,_0x49b4bb[_0x9636('0x41')]);var _0x1ad5db={'where':_0x38c60f[_0x9636('0x3a')]};return db['OpenchannelApplication'][_0x9636('0x20')](_0x1ad5db)[_0x9636('0x25')](function(_0x3c36b2){_0x497faf['count']=_0x3c36b2;if(_0x49b4bb[_0x9636('0x31')][_0x9636('0x42')]){_0x38c60f[_0x9636('0x43')]=[{'all':!![]}];}return db[_0x9636('0x2c')][_0x9636('0x44')](_0x38c60f);})[_0x9636('0x25')](function(_0x2b2295){_0x497faf[_0x9636('0x45')]=_0x2b2295;return _0x497faf;})['then'](respondWithFilteredResult(_0x517ebc,_0x38c60f))[_0x9636('0x46')](handleError(_0x517ebc,null));};exports[_0x9636('0x47')]=function(_0x460c23,_0x53b8d0){var _0x4189b7={'raw':!![],'where':{'id':_0x460c23[_0x9636('0x48')]['id']}},_0x546b36={};_0x546b36[_0x9636('0x30')]=_[_0x9636('0x32')](db[_0x9636('0x2c')][_0x9636('0x49')]);_0x546b36[_0x9636('0x31')]=_[_0x9636('0x32')](_0x460c23[_0x9636('0x31')]);_0x546b36[_0x9636('0x3b')]=_['intersection'](_0x546b36[_0x9636('0x30')],_0x546b36['query']);_0x4189b7[_0x9636('0x34')]=_[_0x9636('0x33')](_0x546b36[_0x9636('0x30')],qs[_0x9636('0x35')](_0x460c23[_0x9636('0x31')][_0x9636('0x35')]));_0x4189b7['attributes']=_0x4189b7[_0x9636('0x34')][_0x9636('0x4a')]?_0x4189b7[_0x9636('0x34')]:_0x546b36[_0x9636('0x30')];if(_0x460c23[_0x9636('0x31')]['includeAll']){_0x4189b7[_0x9636('0x43')]=[{'all':!![]}];}_0x4189b7=_[_0x9636('0x3e')]({},_0x4189b7,_0x460c23[_0x9636('0x41')]);return db[_0x9636('0x2c')][_0x9636('0x4b')](_0x4189b7)[_0x9636('0x25')](handleEntityNotFound(_0x53b8d0,null))[_0x9636('0x25')](respondWithResult(_0x53b8d0,null))['catch'](handleError(_0x53b8d0,null));};exports[_0x9636('0x4c')]=function(_0x4ded28,_0x5553a6){return db[_0x9636('0x2c')]['create'](_0x4ded28[_0x9636('0x4d')],{})[_0x9636('0x25')](respondWithResult(_0x5553a6,0xc9))[_0x9636('0x46')](handleError(_0x5553a6,null));};exports[_0x9636('0x24')]=function(_0x2a3cfe,_0xb9db40){if(_0x2a3cfe[_0x9636('0x4d')]['id']){delete _0x2a3cfe[_0x9636('0x4d')]['id'];}return db['OpenchannelApplication'][_0x9636('0x4b')]({'where':{'id':_0x2a3cfe[_0x9636('0x48')]['id']}})[_0x9636('0x25')](handleEntityNotFound(_0xb9db40,null))[_0x9636('0x25')](saveUpdates(_0x2a3cfe[_0x9636('0x4d')],null))[_0x9636('0x25')](respondWithResult(_0xb9db40,null))[_0x9636('0x46')](handleError(_0xb9db40,null));};exports[_0x9636('0x26')]=function(_0x4cc3fd,_0x5266c6){return db[_0x9636('0x2c')][_0x9636('0x4b')]({'where':{'id':_0x4cc3fd['params']['id']}})[_0x9636('0x25')](handleEntityNotFound(_0x5266c6,null))[_0x9636('0x25')](removeEntity(_0x5266c6,null))['catch'](handleError(_0x5266c6,null));}; \ No newline at end of file +var _0x5127=['moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','pick','where','merge','VIRTUAL','filter','options','OpenchannelApplication','includeAll','include','findAll','catch','show','params','keys','find','create','body','html-pdf','eml-format','zip-dir','fast-json-patch'];(function(_0x1fd4b0,_0x5998c8){var _0x25fcc3=function(_0x13f4c3){while(--_0x13f4c3){_0x1fd4b0['push'](_0x1fd4b0['shift']());}};_0x25fcc3(++_0x5998c8);}(_0x5127,0x16e));var _0x7512=function(_0x568a61,_0x2124f8){_0x568a61=_0x568a61-0x0;var _0x334c3b=_0x5127[_0x568a61];return _0x334c3b;};'use strict';var pdf=require(_0x7512('0x0'));var emlformat=require(_0x7512('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x7512('0x2'));var jsonpatch=require(_0x7512('0x3'));var rp=require('request-promise');var moment=require(_0x7512('0x4'));var BPromise=require(_0x7512('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7512('0x6'));var sox=require(_0x7512('0x7'));var csv=require(_0x7512('0x8'));var ejs=require(_0x7512('0x9'));var fs=require('fs');var _=require(_0x7512('0xa'));var squel=require(_0x7512('0xb'));var crypto=require(_0x7512('0xc'));var jsforce=require(_0x7512('0xd'));var deskjs=require(_0x7512('0xe'));var toCsv=require('to-csv');var querystring=require(_0x7512('0xf'));var Papa=require(_0x7512('0x10'));var Redis=require(_0x7512('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7512('0x12'));var logger=require(_0x7512('0x13'))(_0x7512('0x14'));var utils=require('../../config/utils');var config=require(_0x7512('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x21535d,_0x45e322){_0x45e322=_0x45e322||0xcc;return function(_0x3c9bf2){if(_0x3c9bf2){return _0x21535d[_0x7512('0x16')](_0x45e322);}return _0x21535d[_0x7512('0x17')](_0x45e322)[_0x7512('0x18')]();};}function respondWithResult(_0x3865b3,_0x1b2e09){_0x1b2e09=_0x1b2e09||0xc8;return function(_0x1de4c2){if(_0x1de4c2){return _0x3865b3[_0x7512('0x17')](_0x1b2e09)[_0x7512('0x19')](_0x1de4c2);}};}function respondWithFilteredResult(_0xb65299,_0x12ccdc){return function(_0x373d54){if(_0x373d54){var _0x131fe0=_0x373d54[_0x7512('0x1a')],_0x9ed714=_0x12ccdc[_0x7512('0x1b')],_0x18574d=_0x12ccdc[_0x7512('0x1b')]+_0x12ccdc['limit'],_0x495549;if(_0x18574d>=_0x131fe0){_0x18574d=_0x131fe0;_0x495549=0xc8;}else{_0x495549=0xce;}_0xb65299[_0x7512('0x17')](_0x495549);return _0xb65299[_0x7512('0x1c')](_0x7512('0x1d'),_0x9ed714+'-'+_0x18574d+'/'+_0x131fe0)[_0x7512('0x19')](_0x373d54);}return null;};}function patchUpdates(_0x3ee720){return function(_0x32467e){try{jsonpatch[_0x7512('0x1e')](_0x32467e,_0x3ee720,!![]);}catch(_0x25eedf){return BPromise[_0x7512('0x1f')](_0x25eedf);}return _0x32467e[_0x7512('0x20')]();};}function saveUpdates(_0x5c1dac,_0x445dca){return function(_0x4b64ae){if(_0x4b64ae){return _0x4b64ae[_0x7512('0x21')](_0x5c1dac)[_0x7512('0x22')](function(_0x448aa4){return _0x448aa4;});}return null;};}function removeEntity(_0x5b87a9,_0xd00fa3){return function(_0x5de1c7){if(_0x5de1c7){return _0x5de1c7['destroy']()[_0x7512('0x22')](function(){_0x5b87a9[_0x7512('0x17')](0xcc)[_0x7512('0x18')]();});}};}function handleEntityNotFound(_0x23286f,_0x1bd74a){return function(_0x3484df){if(!_0x3484df){_0x23286f[_0x7512('0x16')](0x194);}return _0x3484df;};}function handleError(_0x2bc30e,_0x2a4d86){_0x2a4d86=_0x2a4d86||0x1f4;return function(_0x3e0dc4){logger[_0x7512('0x23')](_0x3e0dc4[_0x7512('0x24')]);if(_0x3e0dc4[_0x7512('0x25')]){delete _0x3e0dc4[_0x7512('0x25')];}_0x2bc30e[_0x7512('0x17')](_0x2a4d86)[_0x7512('0x26')](_0x3e0dc4);};}exports[_0x7512('0x27')]=function(_0x32a990,_0x332278){var _0x4ef099={},_0x3c95fa={},_0x1e4664={'count':0x0,'rows':[]};var _0x464ad0=_[_0x7512('0x28')](db['OpenchannelApplication'][_0x7512('0x29')],function(_0x4f5ecc){return{'name':_0x4f5ecc[_0x7512('0x2a')],'type':_0x4f5ecc[_0x7512('0x2b')][_0x7512('0x2c')]};});_0x3c95fa[_0x7512('0x2d')]=_['map'](_0x464ad0,_0x7512('0x25'));_0x3c95fa[_0x7512('0x2e')]=_['keys'](_0x32a990['query']);_0x3c95fa[_0x7512('0x2f')]=_[_0x7512('0x30')](_0x3c95fa[_0x7512('0x2d')],_0x3c95fa[_0x7512('0x2e')]);_0x4ef099['attributes']=_[_0x7512('0x30')](_0x3c95fa[_0x7512('0x2d')],qs[_0x7512('0x31')](_0x32a990[_0x7512('0x2e')][_0x7512('0x31')]));_0x4ef099['attributes']=_0x4ef099[_0x7512('0x32')][_0x7512('0x33')]?_0x4ef099[_0x7512('0x32')]:_0x3c95fa['model'];if(!_0x32a990[_0x7512('0x2e')][_0x7512('0x34')](_0x7512('0x35'))){_0x4ef099['limit']=qs[_0x7512('0x36')](_0x32a990[_0x7512('0x2e')][_0x7512('0x36')]);_0x4ef099['offset']=qs[_0x7512('0x1b')](_0x32a990[_0x7512('0x2e')][_0x7512('0x1b')]);}_0x4ef099[_0x7512('0x37')]=qs[_0x7512('0x38')](_0x32a990[_0x7512('0x2e')][_0x7512('0x38')]);_0x4ef099['where']=qs[_0x7512('0x2f')](_[_0x7512('0x39')](_0x32a990[_0x7512('0x2e')],_0x3c95fa['filters']));if(_0x32a990['query']['filter']){_0x4ef099[_0x7512('0x3a')]=_[_0x7512('0x3b')](_0x4ef099[_0x7512('0x3a')],{'$or':_[_0x7512('0x28')](_0x464ad0,function(_0x4aaa64){if(_0x4aaa64[_0x7512('0x2b')]['key']!==_0x7512('0x3c')){var _0x48a9a0={};_0x48a9a0[_0x4aaa64['field']]={'$like':'%'+_0x32a990[_0x7512('0x2e')][_0x7512('0x3d')]+'%'};return _0x48a9a0;}})});}_0x4ef099=_[_0x7512('0x3b')]({},_0x4ef099,_0x32a990[_0x7512('0x3e')]);var _0x225fc0={'where':_0x4ef099[_0x7512('0x3a')]};return db[_0x7512('0x3f')][_0x7512('0x1a')](_0x225fc0)[_0x7512('0x22')](function(_0x2ddad1){_0x1e4664['count']=_0x2ddad1;if(_0x32a990['query'][_0x7512('0x40')]){_0x4ef099[_0x7512('0x41')]=[{'all':!![]}];}return db[_0x7512('0x3f')][_0x7512('0x42')](_0x4ef099);})[_0x7512('0x22')](function(_0x247c8d){_0x1e4664['rows']=_0x247c8d;return _0x1e4664;})[_0x7512('0x22')](respondWithFilteredResult(_0x332278,_0x4ef099))[_0x7512('0x43')](handleError(_0x332278,null));};exports[_0x7512('0x44')]=function(_0x5cbf22,_0x364aed){var _0x8337b2={'raw':!![],'where':{'id':_0x5cbf22[_0x7512('0x45')]['id']}},_0x313291={};_0x313291[_0x7512('0x2d')]=_[_0x7512('0x46')](db['OpenchannelApplication'][_0x7512('0x29')]);_0x313291[_0x7512('0x2e')]=_[_0x7512('0x46')](_0x5cbf22[_0x7512('0x2e')]);_0x313291['filters']=_[_0x7512('0x30')](_0x313291[_0x7512('0x2d')],_0x313291[_0x7512('0x2e')]);_0x8337b2[_0x7512('0x32')]=_['intersection'](_0x313291[_0x7512('0x2d')],qs[_0x7512('0x31')](_0x5cbf22[_0x7512('0x2e')][_0x7512('0x31')]));_0x8337b2[_0x7512('0x32')]=_0x8337b2['attributes']['length']?_0x8337b2[_0x7512('0x32')]:_0x313291[_0x7512('0x2d')];if(_0x5cbf22[_0x7512('0x2e')]['includeAll']){_0x8337b2['include']=[{'all':!![]}];}_0x8337b2=_[_0x7512('0x3b')]({},_0x8337b2,_0x5cbf22[_0x7512('0x3e')]);return db[_0x7512('0x3f')][_0x7512('0x47')](_0x8337b2)[_0x7512('0x22')](handleEntityNotFound(_0x364aed,null))[_0x7512('0x22')](respondWithResult(_0x364aed,null))[_0x7512('0x43')](handleError(_0x364aed,null));};exports[_0x7512('0x48')]=function(_0x33ab0a,_0x28e803){return db['OpenchannelApplication'][_0x7512('0x48')](_0x33ab0a[_0x7512('0x49')],{})[_0x7512('0x22')](respondWithResult(_0x28e803,0xc9))[_0x7512('0x43')](handleError(_0x28e803,null));};exports[_0x7512('0x21')]=function(_0x1b6fd0,_0x212972){if(_0x1b6fd0[_0x7512('0x49')]['id']){delete _0x1b6fd0[_0x7512('0x49')]['id'];}return db[_0x7512('0x3f')]['find']({'where':{'id':_0x1b6fd0[_0x7512('0x45')]['id']}})[_0x7512('0x22')](handleEntityNotFound(_0x212972,null))[_0x7512('0x22')](saveUpdates(_0x1b6fd0[_0x7512('0x49')],null))[_0x7512('0x22')](respondWithResult(_0x212972,null))['catch'](handleError(_0x212972,null));};exports['destroy']=function(_0x2708e7,_0x46abbe){return db[_0x7512('0x3f')][_0x7512('0x47')]({'where':{'id':_0x2708e7[_0x7512('0x45')]['id']}})[_0x7512('0x22')](handleEntityNotFound(_0x46abbe,null))[_0x7512('0x22')](removeEntity(_0x46abbe,null))['catch'](handleError(_0x46abbe,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 4f6fd36..04c24ca 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 _0x5289=['./openchannelApplication.attributes','define','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','bluebird','path','../../config/environment'];(function(_0x118d39,_0x43be87){var _0x47958b=function(_0x5aaceb){while(--_0x5aaceb){_0x118d39['push'](_0x118d39['shift']());}};_0x47958b(++_0x43be87);}(_0x5289,0x66));var _0x9528=function(_0x9cdebc,_0x5be55c){_0x9cdebc=_0x9cdebc-0x0;var _0x4a551a=_0x5289[_0x9cdebc];return _0x4a551a;};'use strict';var _=require(_0x9528('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9528('0x1'));var moment=require(_0x9528('0x2'));var BPromise=require(_0x9528('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9528('0x4'));var rimraf=require('rimraf');var config=require(_0x9528('0x5'));var attributes=require(_0x9528('0x6'));module['exports']=function(_0x213b9b,_0x574aff){return _0x213b9b[_0x9528('0x7')](_0x9528('0x8'),attributes,{'tableName':_0x9528('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9528('0xa'),'collate':_0x9528('0xb')});}; \ No newline at end of file +var _0x9d83=['utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','request-promise','../../config/environment','./openchannelApplication.attributes','exports','OpenchannelApplication','openchannel_applications','utf8mb4'];(function(_0x57f7ea,_0x54da6b){var _0x54a7e4=function(_0x2c9d4f){while(--_0x2c9d4f){_0x57f7ea['push'](_0x57f7ea['shift']());}};_0x54a7e4(++_0x54da6b);}(_0x9d83,0x6d));var _0x39d8=function(_0x33bcdb,_0x11846b){_0x33bcdb=_0x33bcdb-0x0;var _0x18a9bf=_0x9d83[_0x33bcdb];return _0x18a9bf;};'use strict';var _=require(_0x39d8('0x0'));var util=require(_0x39d8('0x1'));var logger=require(_0x39d8('0x2'))('api');var moment=require(_0x39d8('0x3'));var BPromise=require('bluebird');var rp=require(_0x39d8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x39d8('0x5'));var attributes=require(_0x39d8('0x6'));module[_0x39d8('0x7')]=function(_0x1dfe89,_0x20ec96){return _0x1dfe89['define'](_0x39d8('0x8'),attributes,{'tableName':_0x39d8('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x39d8('0xa'),'collate':_0x39d8('0xb')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 2696e1c..84714ba 100644 --- a/server/api/openchannelApplication/openchannelApplication.rpc.js +++ b/server/api/openchannelApplication/openchannelApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['then','info','OpenchannelApplication,\x20%s,\x20%s','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','UpdateOpenchannelApplication','OpenchannelApplication','update','options','raw','where','attributes','limit','debug','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x2cc459,_0x366f6b){var _0x173f60=function(_0x55ebca){while(--_0x55ebca){_0x2cc459['push'](_0x2cc459['shift']());}};_0x173f60(++_0x366f6b);}(_0xb10b,0x12a));var _0xbb10=function(_0x208c01,_0x2dd63d){_0x208c01=_0x208c01-0x0;var _0x54a5fc=_0xb10b[_0x208c01];return _0x54a5fc;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1b')]||null:null,'limit':_0x378da8['options']?_0x378da8['options'][_0xbb10('0x1c')]||null:null})[_0xbb10('0xc')](function(_0x2e911d){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1d')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2e911d));_0x575cca(_0x2e911d);})[_0xbb10('0x1e')](function(_0x395404){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x395404['message'],_0x378da8);_0x30efc6(_0x1682a4['error'](0x1f4,_0x395404['message']));});});}; \ No newline at end of file +var _0xb10b=['then','info','OpenchannelApplication,\x20%s,\x20%s','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','UpdateOpenchannelApplication','OpenchannelApplication','update','options','raw','where','attributes','limit','debug','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x5f47ea,_0x2e5c20){var _0x26b92b=function(_0x3656ad){while(--_0x3656ad){_0x5f47ea['push'](_0x5f47ea['shift']());}};_0x26b92b(++_0x2e5c20);}(_0xb10b,0x12a));var _0xbb10=function(_0x332ddf,_0x1ed1b5){_0x332ddf=_0x332ddf-0x0;var _0x4798a9=_0xb10b[_0x332ddf];return _0x4798a9;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1b')]||null:null,'limit':_0x378da8['options']?_0x378da8['options'][_0xbb10('0x1c')]||null:null})[_0xbb10('0xc')](function(_0x2e911d){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1d')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2e911d));_0x575cca(_0x2e911d);})[_0xbb10('0x1e')](function(_0x395404){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x395404['message'],_0x378da8);_0x30efc6(_0x1682a4['error'](0x1f4,_0x395404['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index f2b283c..f9bd87f 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 _0x8768=['update','delete','openchannelinteraction:destroy','destroy','/:id/tags','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','post','create','addMessage','tracked','openchannel','put','openchannelinteraction:update'];(function(_0x1120c7,_0x18f931){var _0x436f8a=function(_0x19f1dd){while(--_0x19f1dd){_0x1120c7['push'](_0x1120c7['shift']());}};_0x436f8a(++_0x18f931);}(_0x8768,0xd8));var _0x8876=function(_0x5db1d8,_0x3558a7){_0x5db1d8=_0x5db1d8-0x0;var _0xcbfbef=_0x8768[_0x5db1d8];return _0xcbfbef;};'use strict';var multer=require(_0x8876('0x0'));var util=require(_0x8876('0x1'));var path=require('path');var timeout=require(_0x8876('0x2'));var express=require(_0x8876('0x3'));var router=express['Router']();var auth=require(_0x8876('0x4'));var interaction=require(_0x8876('0x5'));var config=require('../../config/environment');var controller=require(_0x8876('0x6'));router[_0x8876('0x7')]('/',auth[_0x8876('0x8')](),controller[_0x8876('0x9')]);router[_0x8876('0x7')](_0x8876('0xa'),auth[_0x8876('0x8')](),controller[_0x8876('0xb')]);router[_0x8876('0x7')](_0x8876('0xc'),auth['isAuthenticated'](),controller[_0x8876('0xd')]);router[_0x8876('0x7')](_0x8876('0xe'),auth[_0x8876('0x8')](),controller[_0x8876('0xf')]);router[_0x8876('0x7')](_0x8876('0x10'),auth[_0x8876('0x8')](),controller['download']);router[_0x8876('0x11')]('/',auth[_0x8876('0x8')](),controller[_0x8876('0x12')]);router[_0x8876('0x11')](_0x8876('0xe'),auth[_0x8876('0x8')](),controller[_0x8876('0x13')]);router[_0x8876('0x11')]('/:id/tags',auth[_0x8876('0x8')](),interaction[_0x8876('0x14')](_0x8876('0x15'),'openchannelinteraction:addtags'),controller['addTags']);router[_0x8876('0x16')](_0x8876('0xc'),auth[_0x8876('0x8')](),interaction[_0x8876('0x14')](_0x8876('0x15'),_0x8876('0x17')),controller[_0x8876('0x18')]);router[_0x8876('0x19')](_0x8876('0xc'),auth['isAuthenticated'](),interaction[_0x8876('0x14')](_0x8876('0x15'),_0x8876('0x1a')),controller[_0x8876('0x1b')]);router['delete'](_0x8876('0x1c'),auth[_0x8876('0x8')](),controller['removeTags']);module[_0x8876('0x1d')]=router; \ No newline at end of file +var _0x84d9=['show','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked','openchannelinteraction:addtags','put','openchannel','openchannelinteraction:update','update','openchannelinteraction:destroy','destroy','delete','removeTags','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x4ff58d,_0x2c7c5b){var _0x514a09=function(_0x4baa0b){while(--_0x4baa0b){_0x4ff58d['push'](_0x4ff58d['shift']());}};_0x514a09(++_0x2c7c5b);}(_0x84d9,0xf3));var _0x984d=function(_0x74e807,_0x1ea211){_0x74e807=_0x74e807-0x0;var _0x2d805b=_0x84d9[_0x74e807];return _0x2d805b;};'use strict';var multer=require('multer');var util=require(_0x984d('0x0'));var path=require(_0x984d('0x1'));var timeout=require(_0x984d('0x2'));var express=require('express');var router=express[_0x984d('0x3')]();var auth=require(_0x984d('0x4'));var interaction=require(_0x984d('0x5'));var config=require(_0x984d('0x6'));var controller=require('./openchannelInteraction.controller');router[_0x984d('0x7')]('/',auth[_0x984d('0x8')](),controller[_0x984d('0x9')]);router[_0x984d('0x7')](_0x984d('0xa'),auth[_0x984d('0x8')](),controller[_0x984d('0xb')]);router[_0x984d('0x7')](_0x984d('0xc'),auth['isAuthenticated'](),controller[_0x984d('0xd')]);router[_0x984d('0x7')](_0x984d('0xe'),auth[_0x984d('0x8')](),controller[_0x984d('0xf')]);router[_0x984d('0x7')](_0x984d('0x10'),auth['isAuthenticated'](),controller[_0x984d('0x11')]);router[_0x984d('0x12')]('/',auth[_0x984d('0x8')](),controller['create']);router[_0x984d('0x12')]('/:id/messages',auth['isAuthenticated'](),controller[_0x984d('0x13')]);router[_0x984d('0x12')](_0x984d('0x14'),auth[_0x984d('0x8')](),interaction[_0x984d('0x15')]('openchannel',_0x984d('0x16')),controller['addTags']);router[_0x984d('0x17')](_0x984d('0xc'),auth['isAuthenticated'](),interaction['tracked'](_0x984d('0x18'),_0x984d('0x19')),controller[_0x984d('0x1a')]);router['delete'](_0x984d('0xc'),auth['isAuthenticated'](),interaction['tracked'](_0x984d('0x18'),_0x984d('0x1b')),controller[_0x984d('0x1c')]);router[_0x984d('0x1d')](_0x984d('0x14'),auth[_0x984d('0x8')](),controller[_0x984d('0x1e')]);module[_0x984d('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 4ce422b..721ca51 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 _0xdc9a=['sequelize','BOOLEAN','DATE','STRING','ENUM'];(function(_0x46a61e,_0x1f3890){var _0x4b9881=function(_0x14aba3){while(--_0x14aba3){_0x46a61e['push'](_0x46a61e['shift']());}};_0x4b9881(++_0x1f3890);}(_0xdc9a,0x1a4));var _0xadc9=function(_0x5a2c7b,_0x441265){_0x5a2c7b=_0x5a2c7b-0x0;var _0x3ad931=_0xdc9a[_0x5a2c7b];return _0x3ad931;};'use strict';var Sequelize=require(_0xadc9('0x0'));module['exports']={'closed':{'type':Sequelize[_0xadc9('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xadc9('0x2')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xadc9('0x3')]},'read1stAt':{'type':Sequelize[_0xadc9('0x2')]},'threadId':{'type':Sequelize[_0xadc9('0x3')]},'externalUrl':{'type':Sequelize[_0xadc9('0x3')]},'lastMsgAt':{'type':Sequelize[_0xadc9('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xadc9('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xadc9('0x3')]}}; \ No newline at end of file +var _0xbc4c=['exports','BOOLEAN','DATE','STRING','ENUM','sequelize'];(function(_0x1adc59,_0xadc2bc){var _0x4d746f=function(_0x1cd022){while(--_0x1cd022){_0x1adc59['push'](_0x1adc59['shift']());}};_0x4d746f(++_0xadc2bc);}(_0xbc4c,0x1a9));var _0xcbc4=function(_0x8e9386,_0x3cc60f){_0x8e9386=_0x8e9386-0x0;var _0x4abf26=_0xbc4c[_0x8e9386];return _0x4abf26;};'use strict';var Sequelize=require(_0xcbc4('0x0'));module[_0xcbc4('0x1')]={'closed':{'type':Sequelize[_0xcbc4('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xcbc4('0x3')]},'disposition':{'type':Sequelize[_0xcbc4('0x4')]},'note':{'type':Sequelize[_0xcbc4('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0xcbc4('0x4')]},'externalUrl':{'type':Sequelize[_0xcbc4('0x4')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xcbc4('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 4172478..9d442b4 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 _0x8085=['i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','filter','\x27\x27\x27\x27','i.id\x20LIKE\x20?','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?','i.id','Sequelize','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','sequelize','count','keyBy','OpenchannelInteraction','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.mobile','c.fax','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','all','rows','show','rawAttributes','intersection','includeAll','include','merge','options','catch','body','params','destroy','describe','addMessage','ids','omit','getMessages','OpenchannelMessage','nolimit','pick','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','spread','Tag','emit','removeTags','unix','root','server','tmp','files','attachments','format','transcript-%d-%s.zip','Messages','direction','secret','fullname','CmContact','firstName','lastName','Attachment','OpenchannelAccount','Account','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\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','mkdirSync','Owner','N.A.','closedAt','disposition','Private','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','renderFile','views','downloadInteraction.html','create','toFile','transcript-','.pdf','download','log','html-pdf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./openchannelInteraction.socket','register','sendStatus','status','end','json','offset','set','Content-Range','apply','reject','save','update','then','error','name','send','map','TagIds','Tags','forEach','fieldName','type','keys','query','filters','model','attributes','fields','length','hasOwnProperty','limit','order','sort','where','field','color','from','tools_tags','select','u.id','ui.OpenchannelInteractionId','left_join','users','u.id\x20=\x20ui.UserId','openchannel_interactions','cm_contacts','o.id\x20=\x20i.UserId','openchannel_messages','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','expr','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20>\x200','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','ContactId','buildExpression','split','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','UserId','text','start','isNil','isEmpty','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','$gte','parse'];(function(_0x4073c0,_0x10c162){var _0x4f5601=function(_0x1ace9d){while(--_0x1ace9d){_0x4073c0['push'](_0x4073c0['shift']());}};_0x4f5601(++_0x10c162);}(_0x8085,0x71));var _0x5808=function(_0x1ebce2,_0x10e903){_0x1ebce2=_0x1ebce2-0x0;var _0x4a330c=_0x8085[_0x1ebce2];return _0x4a330c;};'use strict';var pdf=require(_0x5808('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5808('0x1'));var jsonpatch=require(_0x5808('0x2'));var rp=require(_0x5808('0x3'));var moment=require(_0x5808('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5808('0x5'));var path=require(_0x5808('0x6'));var sox=require('sox');var csv=require(_0x5808('0x7'));var ejs=require(_0x5808('0x8'));var fs=require('fs');var _=require(_0x5808('0x9'));var squel=require(_0x5808('0xa'));var crypto=require(_0x5808('0xb'));var jsforce=require(_0x5808('0xc'));var deskjs=require(_0x5808('0xd'));var toCsv=require(_0x5808('0x7'));var querystring=require(_0x5808('0xe'));var Papa=require(_0x5808('0xf'));var Redis=require(_0x5808('0x10'));var authService=require(_0x5808('0x11'));var qs=require(_0x5808('0x12'));var as=require(_0x5808('0x13'));var hardwareService=require(_0x5808('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x5808('0x15'));var config=require(_0x5808('0x16'));var db=require(_0x5808('0x17'))['db'];config[_0x5808('0x18')]=_[_0x5808('0x19')](config[_0x5808('0x18')],{'host':_0x5808('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x5808('0x1b'))[_0x5808('0x1c')](socket);function respondWithStatusCode(_0x3582d6,_0x3e7c09){_0x3e7c09=_0x3e7c09||0xcc;return function(_0x89198e){if(_0x89198e){return _0x3582d6[_0x5808('0x1d')](_0x3e7c09);}return _0x3582d6[_0x5808('0x1e')](_0x3e7c09)[_0x5808('0x1f')]();};}function respondWithResult(_0x1dda8d,_0x46dd8a){_0x46dd8a=_0x46dd8a||0xc8;return function(_0x29785d){if(_0x29785d){return _0x1dda8d['status'](_0x46dd8a)[_0x5808('0x20')](_0x29785d);}};}function respondWithFilteredResult(_0x5cd687,_0x406e65){return function(_0x25dc4e){if(_0x25dc4e){var _0x3bf0ee=_0x25dc4e['count'],_0x529a0d=_0x406e65['offset'],_0x9e58d4=_0x406e65[_0x5808('0x21')]+_0x406e65['limit'],_0x37919b;if(_0x9e58d4>=_0x3bf0ee){_0x9e58d4=_0x3bf0ee;_0x37919b=0xc8;}else{_0x37919b=0xce;}_0x5cd687[_0x5808('0x1e')](_0x37919b);return _0x5cd687[_0x5808('0x22')](_0x5808('0x23'),_0x529a0d+'-'+_0x9e58d4+'/'+_0x3bf0ee)[_0x5808('0x20')](_0x25dc4e);}return null;};}function patchUpdates(_0x578d70){return function(_0x56e67e){try{jsonpatch[_0x5808('0x24')](_0x56e67e,_0x578d70,!![]);}catch(_0x314e78){return BPromise[_0x5808('0x25')](_0x314e78);}return _0x56e67e[_0x5808('0x26')]();};}function saveUpdates(_0x409337,_0x33b583){return function(_0x1027ba){if(_0x1027ba){return _0x1027ba[_0x5808('0x27')](_0x409337)[_0x5808('0x28')](function(_0x4e1dfc){return _0x4e1dfc;});}return null;};}function removeEntity(_0x5b5175,_0x130590){return function(_0x168a67){if(_0x168a67){return _0x168a67['destroy']()['then'](function(){_0x5b5175[_0x5808('0x1e')](0xcc)[_0x5808('0x1f')]();});}};}function handleEntityNotFound(_0x1dddbd,_0x4a4d05){return function(_0x49fc46){if(!_0x49fc46){_0x1dddbd[_0x5808('0x1d')](0x194);}return _0x49fc46;};}function handleError(_0x2c2cb5,_0x27c991){_0x27c991=_0x27c991||0x1f4;return function(_0x37a21f){logger[_0x5808('0x29')](_0x37a21f['stack']);if(_0x37a21f[_0x5808('0x2a')]){delete _0x37a21f[_0x5808('0x2a')];}_0x2c2cb5[_0x5808('0x1e')](_0x27c991)[_0x5808('0x2b')](_0x37a21f);};}function getInteractionUsers(_0x28c1eb,_0x19ac63){return new BPromise(function(_0x1117ac,_0x4ad6d8){try{if(_0x19ac63[_0x28c1eb['id']]){_0x28c1eb['Users']=_[_0x5808('0x2c')](_0x19ac63[_0x28c1eb['id']],function(_0x1d9adc){return{'id':_0x1d9adc['id']};});}}catch(_0x5cfc6b){_0x4ad6d8(_0x5cfc6b);}_0x1117ac(_0x28c1eb);});}function getInteractionTags(_0x5ad84b,_0x3faa07){return new BPromise(function(_0x3438be,_0x269810){try{if(_0x5ad84b[_0x5808('0x2d')]){_0x5ad84b[_0x5808('0x2e')]=[];_0x5ad84b[_0x5808('0x2d')]['split'](',')[_0x5808('0x2f')](function(_0x5da6a4){_0x5ad84b[_0x5808('0x2e')]['push'](_0x3faa07[_0x5da6a4]);});}delete _0x5ad84b['TagIds'];}catch(_0x315bb1){_0x269810(_0x315bb1);}_0x3438be(_0x5ad84b);});}function updateOpenchannelInteraction(_0x49eafd,_0x28bae4,_0x459b48){return new BPromise(function(_0x4e8580,_0x3dfd9a){return getInteractionUsers(_0x49eafd,_0x459b48)[_0x5808('0x28')](function(_0x581be8){return getInteractionTags(_0x581be8,_0x28bae4);})['then'](function(_0x2a4d10){_0x4e8580(_0x2a4d10);})['catch'](function(_0x103f72){_0x3dfd9a(_0x103f72);});});}exports['index']=function(_0x35f547,_0x334cd5){var _0x2b6fc8={},_0x5e0696={},_0x317aba={'count':0x0,'rows':[]};var _0x568610=_[_0x5808('0x2c')](db['OpenchannelInteraction']['rawAttributes'],function(_0x12268a){return{'name':_0x12268a[_0x5808('0x30')],'type':_0x12268a[_0x5808('0x31')]['key']};});_0x5e0696['model']=_[_0x5808('0x2c')](_0x568610,_0x5808('0x2a'));_0x5e0696['query']=_[_0x5808('0x32')](_0x35f547[_0x5808('0x33')]);_0x5e0696[_0x5808('0x34')]=_['intersection'](_0x5e0696[_0x5808('0x35')],_0x5e0696[_0x5808('0x33')]);_0x2b6fc8[_0x5808('0x36')]=_['intersection'](_0x5e0696[_0x5808('0x35')],qs[_0x5808('0x37')](_0x35f547['query']['fields']));_0x2b6fc8[_0x5808('0x36')]=_0x2b6fc8['attributes'][_0x5808('0x38')]?_0x2b6fc8[_0x5808('0x36')]:_0x5e0696[_0x5808('0x35')];if(!_0x35f547[_0x5808('0x33')][_0x5808('0x39')]('nolimit')){_0x2b6fc8['limit']=qs[_0x5808('0x3a')](_0x35f547[_0x5808('0x33')][_0x5808('0x3a')]);_0x2b6fc8['offset']=qs[_0x5808('0x21')](_0x35f547[_0x5808('0x33')][_0x5808('0x21')]);}_0x2b6fc8[_0x5808('0x3b')]=qs[_0x5808('0x3c')](_0x35f547['query'][_0x5808('0x3c')]);_0x2b6fc8[_0x5808('0x3d')]=qs[_0x5808('0x34')](_['pick'](_0x35f547[_0x5808('0x33')],_0x5e0696[_0x5808('0x34')]));var _0xc62608=[];var _0x5e1230=squel['select']()[_0x5808('0x3e')]('id')[_0x5808('0x3e')](_0x5808('0x2a'))[_0x5808('0x3e')](_0x5808('0x3f'))[_0x5808('0x40')](_0x5808('0x41'));var _0x26c40c=squel[_0x5808('0x42')]()[_0x5808('0x3e')](_0x5808('0x43'))[_0x5808('0x3e')](_0x5808('0x44'))['from']('user_has_openchannel_interactions','ui')[_0x5808('0x45')](_0x5808('0x46'),'u',_0x5808('0x47'));var _0x181a38=squel[_0x5808('0x42')]()[_0x5808('0x40')](_0x5808('0x48'),'i')['left_join'](_0x5808('0x49'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x5808('0x45')]('users','o',_0x5808('0x4a'))['left_join']('openchannel_accounts','a','a.id\x20=\x20i.OpenchannelAccountId')[_0x5808('0x45')](_0x5808('0x4b'),'me','me.OpenchannelInteractionId\x20=\x20i.id')[_0x5808('0x45')](_0x5808('0x4c'),'it',_0x5808('0x4d'))['left_join'](_0x5808('0x41'),'t','t.id\x20=\x20it.TagId');var _0x175578=squel[_0x5808('0x4e')]();var _0x13fe11=[];var _0x5cc977=squel[_0x5808('0x4e')]();if(_0x35f547[_0x5808('0x33')][_0x5808('0x4f')]){var _0x29920f=as['parseSearch'](_0x35f547[_0x5808('0x33')][_0x5808('0x4f')]);var _0x3be2e9=_0x29920f[_0x5808('0x50')];for(var _0x251c6a=0x0;_0x251c6a<_0x29920f[_0x5808('0x51')]['length'];_0x251c6a++){var _0x23d2fe=_0x29920f[_0x5808('0x51')][_0x251c6a];var _0x31f1d3='i';var _0x29fd45=_[_0x5808('0x52')](_0x568610,['name',_0x23d2fe[_0x5808('0x3e')]]);if(!_0x29fd45){switch(_0x23d2fe[_0x5808('0x3e')]){case _0x5808('0x53'):if(_0x23d2fe[_0x5808('0x54')]==0x1){_0x181a38[_0x5808('0x55')]('`'+_0x23d2fe[_0x5808('0x3e')]+'`\x20=\x200');}else{_0x181a38[_0x5808('0x55')]('`'+_0x23d2fe['field']+_0x5808('0x56'));}break;case _0x5808('0x57'):if(_0x23d2fe['operator']===_0x5808('0x58')){_0x175578[_0x3be2e9](_0x5808('0x59'),_0x23d2fe[_0x5808('0x54')],null);}else{_0x29fd45=_['find'](_0x568610,[_0x5808('0x2a'),_0x5808('0x5a')]);_0x23d2fe['field']=_0x5808('0x5a');_0x1c8d31=as[_0x5808('0x5b')](_0x31f1d3,_0x29fd45['type'],_0x23d2fe);_0x175578[_0x3be2e9](_0x1c8d31['text'],_0x1c8d31[_0x5808('0x54')]['start'],_0x1c8d31[_0x5808('0x54')]['end']);}break;case'Tag':var _0x158015=_0x23d2fe[_0x5808('0x54')][_0x5808('0x5c')](',')[_0x5808('0x2c')](function(_0x3ac53d){return Number(_0x3ac53d);});_0x158015[_0x5808('0x2f')](function(_0x41ebf0){_0x5cc977['or'](_0x5808('0x5d'),'%,'+_0x41ebf0+',%');});_0x13fe11=_[_0x5808('0x5e')](_0x13fe11,_0x158015);break;case _0x5808('0x5f'):if(_0x23d2fe['operator']==='$substring'){_0x175578[_0x3be2e9]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x23d2fe[_0x5808('0x54')]+'%',null);}else{_0x29fd45=_[_0x5808('0x52')](_0x568610,['name',_0x5808('0x60')]);_0x23d2fe['field']=_0x5808('0x60');_0x1c8d31=as[_0x5808('0x5b')](_0x31f1d3,_0x29fd45[_0x5808('0x31')],_0x23d2fe);_0x175578[_0x3be2e9](_0x1c8d31[_0x5808('0x61')],_0x1c8d31[_0x5808('0x54')][_0x5808('0x62')],_0x1c8d31[_0x5808('0x54')][_0x5808('0x1f')]);}break;}}else{var _0x1c8d31=as[_0x5808('0x5b')](_0x31f1d3,_0x29fd45['type'],_0x23d2fe);_0x175578[_0x3be2e9](_0x1c8d31[_0x5808('0x61')],_0x1c8d31[_0x5808('0x54')][_0x5808('0x62')],_0x1c8d31[_0x5808('0x54')][_0x5808('0x1f')]);}}}else{var _0x387c86=_(Object['keys'](_0x35f547['query']))['map'](function(_0x2c6688){return _0x568610[_0x5808('0x39')](_0x2c6688)?_0x2c6688:undefined;})['filter'](function(_0x1b140a){return!_[_0x5808('0x63')](_0x1b140a);})[_0x5808('0x54')]();if(!_[_0x5808('0x64')](_0x387c86)){_0x387c86[_0x5808('0x2f')](function(_0x179880){if(_0x179880==='OpenchannelAccountId'){_0x181a38['where'](_0x5808('0x65'),[][_0x5808('0x66')](_0x35f547[_0x5808('0x33')][_0x179880]));}else if(_0x179880===_0x5808('0x67')){var _0x227367=JSON['parse'](_0x35f547[_0x5808('0x33')][_0x179880])[_0x5808('0x68')];var _0x3cc7f7=JSON[_0x5808('0x69')](_0x35f547[_0x5808('0x33')][_0x179880])['$lte'];_0x181a38[_0x5808('0x3d')](_0x5808('0x6a'),_0x227367,_0x3cc7f7);}else{if(_0x35f547[_0x5808('0x33')][_0x179880]===_0x5808('0x6b')){_0x181a38[_0x5808('0x3d')]('i.'+_0x179880+_0x5808('0x6c'));}else{_0x181a38[_0x5808('0x3d')]('i.'+_0x179880+_0x5808('0x6d'),_0x35f547[_0x5808('0x33')][_0x179880]);}}});}if(_0x35f547[_0x5808('0x33')][_0x5808('0x6e')]){if(_0x35f547['query']['read']==0x1){_0x181a38[_0x5808('0x55')](_0x5808('0x6f'));}else{_0x181a38[_0x5808('0x55')]('`unreadMessages`\x20>\x200');}}if(_0x35f547[_0x5808('0x33')][_0x5808('0x70')]){_0x13fe11=_['isArray'](_0x35f547[_0x5808('0x33')][_0x5808('0x70')])?_0x35f547['query'][_0x5808('0x70')]:new Array(_0x35f547[_0x5808('0x33')][_0x5808('0x70')]);_0x13fe11[_0x5808('0x2f')](function(_0x4bdc43){_0x5cc977['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x4bdc43+',%');});}if(_0x35f547[_0x5808('0x33')][_0x5808('0x71')]){var _0x1b5453=_0x35f547[_0x5808('0x33')][_0x5808('0x71')]['replace']('\x5c','\x5c\x5c')['replace']('\x27\x27',_0x5808('0x72'));if(qs['isNumeric'](_0x1b5453)){_0x175578['or'](_0x5808('0x73'),_0x1b5453+'%');}else{var _0x51f52f=[];_0x1b5453[_0x5808('0x5c')]('\x20')[_0x5808('0x2f')](function(_0x4fecf9){_0x51f52f[_0x5808('0x74')]('+'+_0x4fecf9[_0x5808('0x75')]());});var _0x38d1fd=_0x51f52f[_0x5808('0x76')]('\x20');_0x175578['or'](_0x5808('0x77'),_0x38d1fd)['or'](_0x5808('0x78'),_0x1b5453+'%')['or'](_0x5808('0x79'),_0x1b5453+'%');}}}_0x181a38['where'](_0x175578);_0x181a38['group'](_0x5808('0x7a'));var _0x343462={'type':db[_0x5808('0x7b')]['QueryTypes'][_0x5808('0x7c')],'raw':!![]};var _0x5e5e1c=_0x181a38['clone']();_0x5e5e1c['field'](_0x5808('0x7a'));_0x5e5e1c['field'](_0x5808('0x7d'),_0x5808('0x53'));if(_0x2b6fc8[_0x5808('0x3b')]){_0x2b6fc8[_0x5808('0x3b')][_0x5808('0x2f')](function(_0x41f8a5){_0x181a38['order']('i.'+_0x41f8a5[0x0],_0x41f8a5[0x1]===_0x5808('0x7e')?![]:!![]);});}if(!_[_0x5808('0x64')](_0x13fe11)){_0x181a38[_0x5808('0x55')](_0x5cc977);_0x5e5e1c[_0x5808('0x3d')]('t.id\x20IN\x20?',_0x13fe11);}db[_0x5808('0x7f')]['query'](_0x5e5e1c[_0x5808('0x75')](),_0x343462)['then'](function(_0x880b53){_0x317aba[_0x5808('0x80')]=_0x880b53['length'];if(_0x317aba[_0x5808('0x80')]===0x0)return[];return db[_0x5808('0x7f')][_0x5808('0x33')](_0x5e1230[_0x5808('0x75')](),_0x343462)[_0x5808('0x28')](function(_0x312f32){_0xc62608=_[_0x5808('0x81')](_0x312f32,'id');_0x343462=_['merge'](_0x343462,{'model':db[_0x5808('0x82')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x181a38[_0x5808('0x3e')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x5808('0x53'));_0x181a38[_0x5808('0x3e')](_0x5808('0x83'),'Account.key');_0x181a38[_0x5808('0x3e')](_0x5808('0x84'),_0x5808('0x85'));_0x181a38[_0x5808('0x3e')](_0x5808('0x86'));_0x181a38[_0x5808('0x3e')](_0x5808('0x87'),_0x5808('0x88'));_0x181a38[_0x5808('0x3e')](_0x5808('0x89'),'Contact.lastName');_0x181a38[_0x5808('0x3e')](_0x5808('0x8a'),_0x5808('0x8b'));_0x181a38['field'](_0x5808('0x8c'),'Contact.phone');_0x181a38[_0x5808('0x3e')]('c.mobile',_0x5808('0x8d'));_0x181a38[_0x5808('0x3e')](_0x5808('0x8e'),'Contact.fax');_0x181a38['field']('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');_0x181a38[_0x5808('0x3a')](_0x2b6fc8[_0x5808('0x3a')]);_0x181a38['offset'](_0x2b6fc8[_0x5808('0x21')]);return db[_0x5808('0x7f')][_0x5808('0x33')](_0x181a38[_0x5808('0x75')](),_0x343462);})[_0x5808('0x28')](function(_0x56e9e2){_0x26c40c[_0x5808('0x3d')](_0x5808('0x8f'),_[_0x5808('0x2c')](_0x56e9e2,'id'));return db[_0x5808('0x7f')][_0x5808('0x33')](_0x26c40c['toString'](),_0x343462)[_0x5808('0x28')](function(_0x7f341c){var _0x1f7486=_[_0x5808('0x90')](_0x7f341c,_0x5808('0x91'));var _0x468fe9=[];_0x56e9e2[_0x5808('0x2f')](function(_0x8d1ba2){_0x468fe9[_0x5808('0x74')](updateOpenchannelInteraction(_0x8d1ba2,_0xc62608,_0x1f7486));});return BPromise[_0x5808('0x92')](_0x468fe9);});});})[_0x5808('0x28')](function(_0x30f199){_0x317aba[_0x5808('0x93')]=_0x30f199;return _0x317aba;})[_0x5808('0x28')](respondWithFilteredResult(_0x334cd5,_0x2b6fc8))['catch'](handleError(_0x334cd5,null));};exports[_0x5808('0x94')]=function(_0x2daf55,_0x359091){var _0x8455bb={'raw':![],'where':{'id':_0x2daf55['params']['id']}},_0x52ca9e={};_0x52ca9e[_0x5808('0x35')]=_[_0x5808('0x32')](db[_0x5808('0x82')][_0x5808('0x95')]);_0x52ca9e[_0x5808('0x33')]=_[_0x5808('0x32')](_0x2daf55[_0x5808('0x33')]);_0x52ca9e[_0x5808('0x34')]=_[_0x5808('0x96')](_0x52ca9e[_0x5808('0x35')],_0x52ca9e[_0x5808('0x33')]);_0x8455bb[_0x5808('0x36')]=_['intersection'](_0x52ca9e[_0x5808('0x35')],qs['fields'](_0x2daf55[_0x5808('0x33')]['fields']));_0x8455bb['attributes']=_0x8455bb['attributes'][_0x5808('0x38')]?_0x8455bb[_0x5808('0x36')]:_0x52ca9e['model'];if(_0x2daf55['query'][_0x5808('0x97')]){_0x8455bb[_0x5808('0x98')]=[{'all':!![]}];}_0x8455bb=_[_0x5808('0x99')]({},_0x8455bb,_0x2daf55[_0x5808('0x9a')]);return db['OpenchannelInteraction'][_0x5808('0x52')](_0x8455bb)[_0x5808('0x28')](handleEntityNotFound(_0x359091,null))['then'](respondWithResult(_0x359091,null))[_0x5808('0x9b')](handleError(_0x359091,null));};exports['create']=function(_0x1e6e4a,_0x567748){return db['OpenchannelInteraction']['create'](_0x1e6e4a['body'],{})[_0x5808('0x28')](respondWithResult(_0x567748,0xc9))[_0x5808('0x9b')](handleError(_0x567748,null));};exports[_0x5808('0x27')]=function(_0x5d9875,_0xdbc9ac){if(_0x5d9875[_0x5808('0x9c')]['id']){delete _0x5d9875[_0x5808('0x9c')]['id'];}return db[_0x5808('0x82')][_0x5808('0x52')]({'where':{'id':_0x5d9875[_0x5808('0x9d')]['id']}})[_0x5808('0x28')](handleEntityNotFound(_0xdbc9ac,null))['then'](saveUpdates(_0x5d9875[_0x5808('0x9c')],null))['then'](respondWithResult(_0xdbc9ac,null))[_0x5808('0x9b')](handleError(_0xdbc9ac,null));};exports[_0x5808('0x9e')]=function(_0x5c8a6a,_0x555ef0){return db[_0x5808('0x82')][_0x5808('0x52')]({'where':{'id':_0x5c8a6a[_0x5808('0x9d')]['id']}})[_0x5808('0x28')](handleEntityNotFound(_0x555ef0,null))[_0x5808('0x28')](removeEntity(_0x555ef0,null))[_0x5808('0x9b')](handleError(_0x555ef0,null));};exports[_0x5808('0x9f')]=function(_0x377a78,_0x4dc79d){return db[_0x5808('0x82')][_0x5808('0x9f')]()[_0x5808('0x28')](respondWithResult(_0x4dc79d,null))[_0x5808('0x9b')](handleError(_0x4dc79d,null));};exports[_0x5808('0xa0')]=function(_0x34a739,_0x28b6ac,_0x5d2c90){return db['OpenchannelMessage']['find']({'where':{'id':_0x34a739['params']['id']}})['then'](handleEntityNotFound(_0x28b6ac,null))['then'](function(_0x57b9a9){if(_0x57b9a9){return _0x57b9a9[_0x5808('0xa0')](_0x34a739[_0x5808('0x9c')][_0x5808('0xa1')],_[_0x5808('0xa2')](_0x34a739[_0x5808('0x9c')],[_0x5808('0xa1'),'id'])||{});}})[_0x5808('0x28')](respondWithResult(_0x28b6ac,null))[_0x5808('0x9b')](handleError(_0x28b6ac,null));};exports[_0x5808('0xa3')]=function(_0x5d0542,_0x517791,_0x178ea2){var _0x320436={'raw':![],'where':{}};var _0x2a87b7={};var _0x208e4c={'count':0x0,'rows':[]};return db[_0x5808('0x82')]['findOne']({'where':{'id':_0x5d0542[_0x5808('0x9d')]['id']}})[_0x5808('0x28')](handleEntityNotFound(_0x517791,null))['then'](function(_0x1ba7c5){if(_0x1ba7c5){_0x2a87b7[_0x5808('0x35')]=_['keys'](db[_0x5808('0xa4')][_0x5808('0x95')]);_0x2a87b7[_0x5808('0x33')]=_['keys'](_0x5d0542[_0x5808('0x33')]);_0x2a87b7[_0x5808('0x34')]=_[_0x5808('0x96')](_0x2a87b7[_0x5808('0x35')],_0x2a87b7['query']);_0x320436[_0x5808('0x36')]=_[_0x5808('0x96')](_0x2a87b7[_0x5808('0x35')],qs['fields'](_0x5d0542[_0x5808('0x33')]['fields']));_0x320436[_0x5808('0x36')]=_0x320436['attributes'][_0x5808('0x38')]?_0x320436[_0x5808('0x36')]:_0x2a87b7[_0x5808('0x35')];if(!_0x5d0542[_0x5808('0x33')]['hasOwnProperty'](_0x5808('0xa5'))){_0x320436[_0x5808('0x3a')]=qs[_0x5808('0x3a')](_0x5d0542[_0x5808('0x33')][_0x5808('0x3a')]);_0x320436[_0x5808('0x21')]=qs[_0x5808('0x21')](_0x5d0542[_0x5808('0x33')][_0x5808('0x21')]);}_0x320436['order']=qs[_0x5808('0x3c')](_0x5d0542[_0x5808('0x33')]['sort']);_0x320436[_0x5808('0x3d')]=qs['filters'](_[_0x5808('0xa6')](_0x5d0542[_0x5808('0x33')],_0x2a87b7['filters']));_0x320436[_0x5808('0x3d')]['OpenchannelInteractionId']=_0x1ba7c5['id'];if(_0x5d0542[_0x5808('0x33')][_0x5808('0x71')]){_0x320436['where']=_[_0x5808('0x99')](_0x320436[_0x5808('0x3d')],{'$or':_[_0x5808('0x2c')](_0x320436['attributes'],function(_0x1f5a18){var _0x2fc2fc={};_0x2fc2fc[_0x1f5a18]={'$like':'%'+_0x5d0542[_0x5808('0x33')][_0x5808('0x71')]+'%'};return _0x2fc2fc;})});}if(_0x5d0542[_0x5808('0x33')][_0x5808('0x68')]){var _0x372e80=_0x5d0542[_0x5808('0x33')][_0x5808('0x68')][_0x5808('0x5c')](',');var _0x558684={};_0x558684[_0x372e80[0x0]]={'$gte':moment(_0x372e80[0x1])['format'](_0x5808('0xa7'))};_0x320436[_0x5808('0x3d')]=_[_0x5808('0x99')](_0x320436[_0x5808('0x3d')],_0x558684);}_0x320436=_[_0x5808('0x99')]({},_0x320436,_0x5d0542[_0x5808('0x9a')]);return db['OpenchannelMessage']['count']({'where':_0x320436['where']})['then'](function(_0x20b351){_0x208e4c[_0x5808('0x80')]=_0x20b351;if(_0x5d0542[_0x5808('0x33')]['includeAll']){_0x320436[_0x5808('0x98')]=[{'all':!![]}];}return db[_0x5808('0xa4')][_0x5808('0xa8')](_0x320436);})[_0x5808('0x28')](function(_0x26d0f4){_0x208e4c[_0x5808('0x93')]=_0x26d0f4;return _0x208e4c;});}})[_0x5808('0x28')](respondWithFilteredResult(_0x517791,_0x320436))[_0x5808('0x9b')](handleError(_0x517791,null));};exports[_0x5808('0xa9')]=function(_0x2597d5,_0x4e2661,_0x5a2461){return db[_0x5808('0x82')][_0x5808('0x52')]({'where':{'id':_0x2597d5['params']['id']}})[_0x5808('0x28')](handleEntityNotFound(_0x4e2661,null))[_0x5808('0x28')](function(_0x5a9625){if(_0x5a9625){return _0x5a9625[_0x5808('0xaa')](_0x2597d5[_0x5808('0x9c')][_0x5808('0xa1')],_['omit'](_0x2597d5[_0x5808('0x9c')],[_0x5808('0xa1'),'id'])||{})[_0x5808('0xab')](function(){return db[_0x5808('0xac')][_0x5808('0xa8')]({'attributes':['id','name',_0x5808('0x3f')],'where':{'id':_0x2597d5[_0x5808('0x9c')][_0x5808('0xa1')]}});})[_0x5808('0x28')](function(_0x12bc9d){socket[_0x5808('0xad')]('openchannelInteractionTags:save',{'id':Number(_0x2597d5[_0x5808('0x9d')]['id']),'tags':_0x12bc9d||[]});return{'id':Number(_0x2597d5[_0x5808('0x9d')]['id']),'tags':_0x12bc9d||[]};});}})[_0x5808('0x28')](respondWithResult(_0x4e2661,null))[_0x5808('0x9b')](handleError(_0x4e2661,null));};exports[_0x5808('0xae')]=function(_0x382631,_0x3b258b,_0x266706){return db['OpenchannelInteraction'][_0x5808('0x52')]({'where':{'id':_0x382631['params']['id']}})[_0x5808('0x28')](handleEntityNotFound(_0x3b258b,null))[_0x5808('0x28')](function(_0x18c4fa){if(_0x18c4fa){return _0x18c4fa[_0x5808('0xae')](_0x382631[_0x5808('0x33')]['ids']);}})[_0x5808('0x28')](respondWithStatusCode(_0x3b258b,null))['catch'](handleError(_0x3b258b,null));};exports['download']=function(_0x47510a,_0x3d74b6){var _0x4725cf=moment()[_0x5808('0xaf')]()[_0x5808('0x75')]();var _0x21df6e=path[_0x5808('0x76')](config[_0x5808('0xb0')],_0x5808('0xb1'),'files',_0x5808('0xb2'));var _0x5a11ec=path[_0x5808('0x76')](config[_0x5808('0xb0')],_0x5808('0xb1'),_0x5808('0xb3'),_0x5808('0xb4'));var _0x253357=path[_0x5808('0x76')](_0x21df6e,_0x4725cf);var _0x315a28=util[_0x5808('0xb5')](_0x5808('0xb6'),_0x47510a[_0x5808('0x9d')]['id'],_0x4725cf);var _0x19e5af=path[_0x5808('0x76')](_0x21df6e,_0x315a28);var _0x43b336=![];return db[_0x5808('0x82')][_0x5808('0x52')]({'where':{'id':_0x47510a['params']['id']},'include':[{'model':db[_0x5808('0xa4')],'as':_0x5808('0xb7'),'attributes':['id',_0x5808('0x9c'),_0x5808('0x67'),_0x5808('0xb8'),_0x5808('0xb9'),_0x5808('0x6e')],'include':[{'model':db[_0x5808('0x5f')],'as':_0x5808('0x5f'),'attributes':['id',_0x5808('0xba')],'raw':!![]},{'model':db[_0x5808('0xbb')],'as':_0x5808('0x57'),'attributes':['id',_0x5808('0xbc'),_0x5808('0xbd')],'raw':!![]},{'model':db[_0x5808('0xbe')],'as':_0x5808('0xbe'),'raw':!![]}]},{'model':db[_0x5808('0xbf')],'as':_0x5808('0xc0'),'attributes':['id',_0x5808('0x2a')]},{'model':db[_0x5808('0x5f')],'as':'Owner','attributes':['id',_0x5808('0xba')]}]})[_0x5808('0x28')](handleEntityNotFound(_0x3d74b6,null))[_0x5808('0x28')](function(_0x1fcaa2){if(_0x1fcaa2){var _0x3a6c35=_0x1fcaa2['get']({'plain':!![]});_0x43b336=!![];var _0x11933d={'format':'A4','border':'10px','header':{'height':_0x5808('0xc1'),'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':'30px','contents':{'default':util['format'](_0x5808('0xc2'),util[_0x5808('0xb5')](_0x5808('0xc3'),_0x5808('0xc4'),_0x3a6c35['id']),moment()['format']('YYYY-MM-DD')['toString']())}}};fs[_0x5808('0xc5')](_0x253357);var _0x3d9683={'channel':_0x5808('0xc4'),'account':_0x3a6c35[_0x5808('0xc0')]['name'],'agent':_0x3a6c35[_0x5808('0xc6')]?_0x3a6c35[_0x5808('0xc6')][_0x5808('0xba')]:_0x5808('0xc7'),'createdAt':moment(_0x3a6c35[_0x5808('0x67')])[_0x5808('0xb5')](_0x5808('0xa7'))[_0x5808('0x75')](),'closedAt':_0x3a6c35['closed']?moment(_0x3a6c35[_0x5808('0xc8')])[_0x5808('0xb5')](_0x5808('0xa7'))[_0x5808('0x75')]():'','disposition':_0x3a6c35[_0x5808('0xc9')],'visibility':_0x3a6c35['threadId']?'Public':_0x5808('0xca'),'messages':_(_0x3a6c35[_0x5808('0xb7')])[_0x5808('0x71')]({'secret':![]})[_0x5808('0x2c')](function(_0x77f707){if(_0x77f707[_0x5808('0xbe')]){var _0x2f502c=path[_0x5808('0x76')](_0x5a11ec,_0x77f707[_0x5808('0xbe')][_0x5808('0xcb')]);if(fs[_0x5808('0xcc')](_0x2f502c)){fs[_0x5808('0xcd')](_0x2f502c)[_0x5808('0xce')](fs[_0x5808('0xcf')](path[_0x5808('0x76')](_0x253357,_0x77f707[_0x5808('0xbe')][_0x5808('0xcb')])));}}return{'date':moment(_0x77f707[_0x5808('0x67')])[_0x5808('0xb5')](_0x5808('0xa7'))[_0x5808('0x75')](),'sender':_0x77f707['direction']===_0x5808('0xd0')?_0x77f707['User']?_0x77f707[_0x5808('0x5f')]['fullname']:_0x5808('0xd1'):_0x77f707[_0x5808('0x57')][_0x5808('0xbc')]+(_0x77f707[_0x5808('0x57')][_0x5808('0xbd')]?'\x20'+_0x77f707[_0x5808('0x57')]['lastName']:''),'body':_0x77f707[_0x5808('0xbe')]?_0x77f707[_0x5808('0xbe')]['basename']:_0x77f707[_0x5808('0x9c')],'direction':_0x77f707['direction']==='out'?'A':'C','secret':_0x77f707[_0x5808('0xb9')],'read':_0x77f707[_0x5808('0x6e')],'attachment':_0x77f707['Attachment']};})['value']()};return ejs[_0x5808('0xd2')](path[_0x5808('0x76')](config['root'],'server',_0x5808('0xd3'),_0x5808('0xd4')),{'interaction':_0x3d9683})[_0x5808('0x28')](function(_0x2f3215){return new BPromise(function(_0x4fa0ab,_0x198b81){pdf[_0x5808('0xd5')](_0x2f3215,_0x11933d)[_0x5808('0xd6')](path[_0x5808('0x76')](_0x253357,_0x5808('0xd7')+_0x3a6c35['id']+'-'+_0x4725cf+_0x5808('0xd8')),function(_0xb20768,_0x18a3b5){if(_0xb20768)return _0x198b81(_0xb20768);_0x4fa0ab(_0x18a3b5);});});});}})[_0x5808('0x28')](function(){if(_0x43b336){return new BPromise(function(_0x120e91,_0x11ca3d){zipdir(_0x253357,{'saveTo':_0x19e5af},function(_0x1a294e,_0x341416){if(_0x1a294e)return _0x11ca3d(_0x1a294e);return _0x120e91(_0x341416);});})['then'](function(){return new BPromise(function(_0x4bb024,_0x55b282){rimraf(_0x253357,function(_0x4002c7){if(_0x4002c7)_0x55b282(_0x4002c7);return _0x4bb024();});});})[_0x5808('0x28')](function(){return _0x3d74b6[_0x5808('0xd9')](_0x19e5af,_0x315a28,function(_0x210b59){if(_0x210b59){console[_0x5808('0xda')]('err',_0x210b59);}else{fs['unlinkSync'](_0x19e5af);}});});}else{return _0x3d74b6[_0x5808('0x1d')](0xc8);}})[_0x5808('0x9b')](handleError(_0x3d74b6,null));}; \ No newline at end of file +var _0xe4b9=['key','query','keys','filters','intersection','model','attributes','fields','order','sort','select','field','color','from','tools_tags','u.id','user_has_openchannel_interactions','left_join','openchannel_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','expr','search','sqlOperator','conditions','length','find','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','Contact','operator','$substring','ContactId','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','UserId','buildExpression','start','some','isEmpty','OpenchannelAccountId','where','i.OpenchannelAccountId\x20IN\x20?','concat','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','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','Sequelize','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','sequelize','merge','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','rows','params','includeAll','include','options','create','body','describe','addMessage','ids','omit','getMessages','$gte','format','OpenchannelMessage','findAll','addTags','setTags','emit','openchannelInteractionTags:save','download','root','server','files','attachments','transcript-%d-%s.zip','Messages','createdAt','secret','User','CmContact','lastName','Attachment','OpenchannelAccount','Account','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','30px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Openchannel','YYYY-MM-DD','mkdirSync','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','disposition','threadId','Public','Private','basename','existsSync','direction','out','System','views','downloadInteraction.html','toFile','transcript-','log','err','unlinkSync','html-pdf','eml-format','rimraf','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','sendStatus','status','end','json','count','offset','limit','set','apply','save','update','then','destroy','error','stack','name','map','TagIds','Tags','split','forEach','push','catch','index','OpenchannelInteraction','rawAttributes','fieldName','type'];(function(_0x22b5f0,_0x1f610f){var _0x36af2b=function(_0x4c93a0){while(--_0x4c93a0){_0x22b5f0['push'](_0x22b5f0['shift']());}};_0x36af2b(++_0x1f610f);}(_0xe4b9,0x182));var _0x9e4b=function(_0x5d71fb,_0x5b3f42){_0x5d71fb=_0x5d71fb-0x0;var _0x19bac8=_0xe4b9[_0x5d71fb];return _0x19bac8;};'use strict';var pdf=require(_0x9e4b('0x0'));var emlformat=require(_0x9e4b('0x1'));var rimraf=require(_0x9e4b('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9e4b('0x3'));var rp=require('request-promise');var moment=require(_0x9e4b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9e4b('0x5'));var util=require('util');var path=require(_0x9e4b('0x6'));var sox=require(_0x9e4b('0x7'));var csv=require(_0x9e4b('0x8'));var ejs=require(_0x9e4b('0x9'));var fs=require('fs');var _=require(_0x9e4b('0xa'));var squel=require(_0x9e4b('0xb'));var crypto=require('crypto');var jsforce=require(_0x9e4b('0xc'));var deskjs=require(_0x9e4b('0xd'));var toCsv=require('to-csv');var querystring=require(_0x9e4b('0xe'));var Papa=require(_0x9e4b('0xf'));var Redis=require(_0x9e4b('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9e4b('0x11'));var as=require(_0x9e4b('0x12'));var hardwareService=require(_0x9e4b('0x13'));var logger=require(_0x9e4b('0x14'))('api');var utils=require(_0x9e4b('0x15'));var config=require(_0x9e4b('0x16'));var db=require(_0x9e4b('0x17'))['db'];config[_0x9e4b('0x18')]=_['defaults'](config['redis'],{'host':_0x9e4b('0x19'),'port':0x18eb});var socket=require(_0x9e4b('0x1a'))(new Redis(config['redis']));require(_0x9e4b('0x1b'))['register'](socket);function respondWithStatusCode(_0x1b1f96,_0x34ff5a){_0x34ff5a=_0x34ff5a||0xcc;return function(_0x3e9561){if(_0x3e9561){return _0x1b1f96[_0x9e4b('0x1c')](_0x34ff5a);}return _0x1b1f96[_0x9e4b('0x1d')](_0x34ff5a)[_0x9e4b('0x1e')]();};}function respondWithResult(_0x597fd8,_0x4e9fee){_0x4e9fee=_0x4e9fee||0xc8;return function(_0x209c50){if(_0x209c50){return _0x597fd8[_0x9e4b('0x1d')](_0x4e9fee)[_0x9e4b('0x1f')](_0x209c50);}};}function respondWithFilteredResult(_0x118103,_0x15ff3b){return function(_0x233030){if(_0x233030){var _0x5535a0=_0x233030[_0x9e4b('0x20')],_0x867462=_0x15ff3b[_0x9e4b('0x21')],_0x536b99=_0x15ff3b[_0x9e4b('0x21')]+_0x15ff3b[_0x9e4b('0x22')],_0x48fd92;if(_0x536b99>=_0x5535a0){_0x536b99=_0x5535a0;_0x48fd92=0xc8;}else{_0x48fd92=0xce;}_0x118103['status'](_0x48fd92);return _0x118103[_0x9e4b('0x23')]('Content-Range',_0x867462+'-'+_0x536b99+'/'+_0x5535a0)[_0x9e4b('0x1f')](_0x233030);}return null;};}function patchUpdates(_0x23c963){return function(_0x479099){try{jsonpatch[_0x9e4b('0x24')](_0x479099,_0x23c963,!![]);}catch(_0x4ea240){return BPromise['reject'](_0x4ea240);}return _0x479099[_0x9e4b('0x25')]();};}function saveUpdates(_0x4d0d41,_0x502beb){return function(_0x370b1f){if(_0x370b1f){return _0x370b1f[_0x9e4b('0x26')](_0x4d0d41)[_0x9e4b('0x27')](function(_0x190b45){return _0x190b45;});}return null;};}function removeEntity(_0x3c4ed3,_0x27c0c8){return function(_0xf85ddb){if(_0xf85ddb){return _0xf85ddb[_0x9e4b('0x28')]()[_0x9e4b('0x27')](function(){_0x3c4ed3[_0x9e4b('0x1d')](0xcc)[_0x9e4b('0x1e')]();});}};}function handleEntityNotFound(_0x1cdf1a,_0x45272b){return function(_0x123b98){if(!_0x123b98){_0x1cdf1a[_0x9e4b('0x1c')](0x194);}return _0x123b98;};}function handleError(_0x3c6c6f,_0x33eb00){_0x33eb00=_0x33eb00||0x1f4;return function(_0x4a6d63){logger[_0x9e4b('0x29')](_0x4a6d63[_0x9e4b('0x2a')]);if(_0x4a6d63[_0x9e4b('0x2b')]){delete _0x4a6d63['name'];}_0x3c6c6f[_0x9e4b('0x1d')](_0x33eb00)['send'](_0x4a6d63);};}function getInteractionUsers(_0xde4c84,_0x48713f){return new BPromise(function(_0x5f4724,_0xe018){try{if(_0x48713f[_0xde4c84['id']]){_0xde4c84['Users']=_[_0x9e4b('0x2c')](_0x48713f[_0xde4c84['id']],function(_0x2e070c){return{'id':_0x2e070c['id']};});}}catch(_0x1c10c8){_0xe018(_0x1c10c8);}_0x5f4724(_0xde4c84);});}function getInteractionTags(_0x153d39,_0x2ce101){return new BPromise(function(_0x41f145,_0x376140){try{if(_0x153d39[_0x9e4b('0x2d')]){_0x153d39[_0x9e4b('0x2e')]=[];_0x153d39[_0x9e4b('0x2d')][_0x9e4b('0x2f')](',')[_0x9e4b('0x30')](function(_0x40e9cf){_0x153d39[_0x9e4b('0x2e')][_0x9e4b('0x31')](_0x2ce101[_0x40e9cf]);});}delete _0x153d39[_0x9e4b('0x2d')];}catch(_0x2b00a3){_0x376140(_0x2b00a3);}_0x41f145(_0x153d39);});}function updateOpenchannelInteraction(_0x58cdc9,_0x470fde,_0x4084c2){return new BPromise(function(_0x1525c5,_0x312234){return getInteractionUsers(_0x58cdc9,_0x4084c2)[_0x9e4b('0x27')](function(_0x15ffb6){return getInteractionTags(_0x15ffb6,_0x470fde);})['then'](function(_0x1ffc44){_0x1525c5(_0x1ffc44);})[_0x9e4b('0x32')](function(_0x2eb443){_0x312234(_0x2eb443);});});}exports[_0x9e4b('0x33')]=function(_0x9f4d22,_0x2e868e){var _0xd04717={},_0x3fa6cd={},_0x12d52e={'count':0x0,'rows':[]};var _0x4a100e=_[_0x9e4b('0x2c')](db[_0x9e4b('0x34')][_0x9e4b('0x35')],function(_0x31630a){return{'name':_0x31630a[_0x9e4b('0x36')],'type':_0x31630a[_0x9e4b('0x37')][_0x9e4b('0x38')]};});_0x3fa6cd['model']=_[_0x9e4b('0x2c')](_0x4a100e,_0x9e4b('0x2b'));_0x3fa6cd[_0x9e4b('0x39')]=_[_0x9e4b('0x3a')](_0x9f4d22[_0x9e4b('0x39')]);_0x3fa6cd[_0x9e4b('0x3b')]=_[_0x9e4b('0x3c')](_0x3fa6cd[_0x9e4b('0x3d')],_0x3fa6cd[_0x9e4b('0x39')]);_0xd04717[_0x9e4b('0x3e')]=_[_0x9e4b('0x3c')](_0x3fa6cd[_0x9e4b('0x3d')],qs[_0x9e4b('0x3f')](_0x9f4d22[_0x9e4b('0x39')][_0x9e4b('0x3f')]));_0xd04717[_0x9e4b('0x3e')]=_0xd04717[_0x9e4b('0x3e')]['length']?_0xd04717[_0x9e4b('0x3e')]:_0x3fa6cd[_0x9e4b('0x3d')];if(!_0x9f4d22[_0x9e4b('0x39')]['hasOwnProperty']('nolimit')){_0xd04717[_0x9e4b('0x22')]=qs[_0x9e4b('0x22')](_0x9f4d22[_0x9e4b('0x39')][_0x9e4b('0x22')]);_0xd04717[_0x9e4b('0x21')]=qs[_0x9e4b('0x21')](_0x9f4d22[_0x9e4b('0x39')]['offset']);}_0xd04717[_0x9e4b('0x40')]=qs[_0x9e4b('0x41')](_0x9f4d22[_0x9e4b('0x39')][_0x9e4b('0x41')]);_0xd04717['where']=qs[_0x9e4b('0x3b')](_['pick'](_0x9f4d22[_0x9e4b('0x39')],_0x3fa6cd[_0x9e4b('0x3b')]));var _0x1c2397=[];var _0x1f8192=squel[_0x9e4b('0x42')]()[_0x9e4b('0x43')]('id')[_0x9e4b('0x43')]('name')[_0x9e4b('0x43')](_0x9e4b('0x44'))[_0x9e4b('0x45')](_0x9e4b('0x46'));var _0x94e57a=squel['select']()[_0x9e4b('0x43')](_0x9e4b('0x47'))['field']('ui.OpenchannelInteractionId')[_0x9e4b('0x45')](_0x9e4b('0x48'),'ui')[_0x9e4b('0x49')]('users','u','u.id\x20=\x20ui.UserId');var _0x5a363b=squel['select']()[_0x9e4b('0x45')](_0x9e4b('0x4a'),'i')[_0x9e4b('0x49')]('cm_contacts','c',_0x9e4b('0x4b'))[_0x9e4b('0x49')](_0x9e4b('0x4c'),'o',_0x9e4b('0x4d'))[_0x9e4b('0x49')](_0x9e4b('0x4e'),'a',_0x9e4b('0x4f'))[_0x9e4b('0x49')](_0x9e4b('0x50'),'me',_0x9e4b('0x51'))[_0x9e4b('0x49')](_0x9e4b('0x52'),'it',_0x9e4b('0x53'))[_0x9e4b('0x49')](_0x9e4b('0x46'),'t','t.id\x20=\x20it.TagId');var _0x195c5c=squel[_0x9e4b('0x54')]();var _0x591cf0=[];var _0x518c73=squel[_0x9e4b('0x54')]();if(_0x9f4d22[_0x9e4b('0x39')][_0x9e4b('0x55')]){var _0x1484fe=as['parseSearch'](_0x9f4d22['query'][_0x9e4b('0x55')]);var _0xfca34d=_0x1484fe[_0x9e4b('0x56')];for(var _0x4bc0d4=0x0;_0x4bc0d4<_0x1484fe[_0x9e4b('0x57')][_0x9e4b('0x58')];_0x4bc0d4++){var _0x488441=_0x1484fe['conditions'][_0x4bc0d4];var _0x49e76b='i';var _0x3b60af=_[_0x9e4b('0x59')](_0x4a100e,[_0x9e4b('0x2b'),_0x488441['field']]);if(!_0x3b60af){switch(_0x488441[_0x9e4b('0x43')]){case _0x9e4b('0x5a'):if(_0x488441[_0x9e4b('0x5b')]==0x1){_0x5a363b['having']('`'+_0x488441[_0x9e4b('0x43')]+_0x9e4b('0x5c'));}else{_0x5a363b[_0x9e4b('0x5d')]('`'+_0x488441[_0x9e4b('0x43')]+_0x9e4b('0x5e'));}break;case _0x9e4b('0x5f'):if(_0x488441[_0x9e4b('0x60')]===_0x9e4b('0x61')){_0x195c5c[_0xfca34d]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',_0x488441['value'],null);}else{_0x3b60af=_[_0x9e4b('0x59')](_0x4a100e,[_0x9e4b('0x2b'),_0x9e4b('0x62')]);_0x488441[_0x9e4b('0x43')]=_0x9e4b('0x62');_0xf408f3=as['buildExpression'](_0x49e76b,_0x3b60af['type'],_0x488441);_0x195c5c[_0xfca34d](_0xf408f3[_0x9e4b('0x63')],_0xf408f3[_0x9e4b('0x5b')]['start'],_0xf408f3['value'][_0x9e4b('0x1e')]);}break;case _0x9e4b('0x64'):var _0x5ed52a=_0x488441['value'][_0x9e4b('0x2f')](',')[_0x9e4b('0x2c')](function(_0x32e6ba){return Number(_0x32e6ba);});_0x5ed52a[_0x9e4b('0x30')](function(_0x3a1d14){_0x518c73['or'](_0x9e4b('0x65'),'%,'+_0x3a1d14+',%');});_0x591cf0=_[_0x9e4b('0x66')](_0x591cf0,_0x5ed52a);break;case'User':if(_0x488441[_0x9e4b('0x60')]==='$substring'){_0x195c5c[_0xfca34d]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x488441[_0x9e4b('0x5b')]+'%',null);}else{_0x3b60af=_[_0x9e4b('0x59')](_0x4a100e,[_0x9e4b('0x2b'),_0x9e4b('0x67')]);_0x488441['field']=_0x9e4b('0x67');_0xf408f3=as[_0x9e4b('0x68')](_0x49e76b,_0x3b60af['type'],_0x488441);_0x195c5c[_0xfca34d](_0xf408f3['text'],_0xf408f3[_0x9e4b('0x5b')][_0x9e4b('0x69')],_0xf408f3['value'][_0x9e4b('0x1e')]);}break;}}else{var _0xf408f3=as[_0x9e4b('0x68')](_0x49e76b,_0x3b60af[_0x9e4b('0x37')],_0x488441);_0x195c5c[_0xfca34d](_0xf408f3[_0x9e4b('0x63')],_0xf408f3[_0x9e4b('0x5b')][_0x9e4b('0x69')],_0xf408f3[_0x9e4b('0x5b')][_0x9e4b('0x1e')]);}}}else{var _0x1f5618=_(_0x9f4d22[_0x9e4b('0x39')])[_0x9e4b('0x3a')]()[_0x9e4b('0x2c')](function(_0x11248e){return _[_0x9e4b('0x6a')](_0x4a100e,['name',_0x11248e])?_0x11248e:undefined;})['compact']()['value']();if(!_[_0x9e4b('0x6b')](_0x1f5618)){_0x1f5618[_0x9e4b('0x30')](function(_0x3f5510){if(_0x3f5510===_0x9e4b('0x6c')){_0x5a363b[_0x9e4b('0x6d')](_0x9e4b('0x6e'),[][_0x9e4b('0x6f')](_0x9f4d22[_0x9e4b('0x39')][_0x3f5510]));}else if(_0x3f5510==='createdAt'){var _0x35760c=JSON[_0x9e4b('0x70')](_0x9f4d22['query'][_0x3f5510])['$gte'];var _0x4d81f3=JSON['parse'](_0x9f4d22['query'][_0x3f5510])['$lte'];_0x5a363b['where'](_0x9e4b('0x71'),_0x35760c,_0x4d81f3);}else{if(_0x9f4d22[_0x9e4b('0x39')][_0x3f5510]===_0x9e4b('0x72')){_0x5a363b[_0x9e4b('0x6d')]('i.'+_0x3f5510+'\x20IS\x20NULL');}else{_0x5a363b['where']('i.'+_0x3f5510+_0x9e4b('0x73'),_0x9f4d22[_0x9e4b('0x39')][_0x3f5510]);}}});}if(_0x9f4d22[_0x9e4b('0x39')][_0x9e4b('0x74')]){if(_0x9f4d22[_0x9e4b('0x39')]['read']==0x1){_0x5a363b[_0x9e4b('0x5d')](_0x9e4b('0x75'));}else{_0x5a363b[_0x9e4b('0x5d')](_0x9e4b('0x76'));}}if(_0x9f4d22['query'][_0x9e4b('0x77')]){_0x591cf0=_[_0x9e4b('0x78')](_0x9f4d22[_0x9e4b('0x39')][_0x9e4b('0x77')])?_0x9f4d22[_0x9e4b('0x39')][_0x9e4b('0x77')]:new Array(_0x9f4d22[_0x9e4b('0x39')][_0x9e4b('0x77')]);_0x591cf0[_0x9e4b('0x30')](function(_0x38a43e){_0x518c73['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x38a43e+',%');});}if(_0x9f4d22[_0x9e4b('0x39')][_0x9e4b('0x79')]){var _0x1129a6=_0x9f4d22[_0x9e4b('0x39')][_0x9e4b('0x79')][_0x9e4b('0x7a')]('\x5c','\x5c\x5c')['replace']('\x27\x27',_0x9e4b('0x7b'));if(qs[_0x9e4b('0x7c')](_0x1129a6)){_0x195c5c['or'](_0x9e4b('0x7d'),_0x1129a6+'%');}else{var _0x211b4c=[];_0x1129a6[_0x9e4b('0x2f')]('\x20')['forEach'](function(_0x10340d){_0x211b4c[_0x9e4b('0x31')]('+'+_0x10340d[_0x9e4b('0x7e')]());});var _0x226fc7=_0x211b4c[_0x9e4b('0x7f')]('\x20');_0x195c5c['or'](_0x9e4b('0x80'),_0x226fc7)['or']('i.from\x20LIKE\x20?',_0x1129a6+'%')['or'](_0x9e4b('0x81'),_0x1129a6+'%');}}}_0x5a363b[_0x9e4b('0x6d')](_0x195c5c);_0x5a363b[_0x9e4b('0x82')](_0x9e4b('0x83'));var _0x4dc66b={'type':db[_0x9e4b('0x84')][_0x9e4b('0x85')]['SELECT'],'raw':!![]};var _0x17a722=_0x5a363b[_0x9e4b('0x86')]();_0x17a722[_0x9e4b('0x43')](_0x9e4b('0x83'));_0x17a722['field'](_0x9e4b('0x87'),_0x9e4b('0x5a'));if(_0xd04717[_0x9e4b('0x40')]){_0xd04717['order']['forEach'](function(_0x1b5b0b){_0x5a363b[_0x9e4b('0x40')]('i.'+_0x1b5b0b[0x0],_0x1b5b0b[0x1]===_0x9e4b('0x88')?![]:!![]);});}if(!_['isEmpty'](_0x591cf0)){_0x5a363b[_0x9e4b('0x5d')](_0x518c73);_0x17a722[_0x9e4b('0x6d')](_0x9e4b('0x89'),_0x591cf0);}db['sequelize'][_0x9e4b('0x39')](_0x17a722[_0x9e4b('0x7e')](),_0x4dc66b)[_0x9e4b('0x27')](function(_0x5d093a){_0x12d52e[_0x9e4b('0x20')]=_0x5d093a['length'];if(_0x12d52e[_0x9e4b('0x20')]===0x0)return[];return db[_0x9e4b('0x8a')][_0x9e4b('0x39')](_0x1f8192['toString'](),_0x4dc66b)[_0x9e4b('0x27')](function(_0x3a1ce4){_0x1c2397=_['keyBy'](_0x3a1ce4,'id');_0x4dc66b=_[_0x9e4b('0x8b')](_0x4dc66b,{'model':db['OpenchannelInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});_0x5a363b[_0x9e4b('0x43')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x9e4b('0x5a'));_0x5a363b[_0x9e4b('0x43')](_0x9e4b('0x8c'),'Account.key');_0x5a363b[_0x9e4b('0x43')](_0x9e4b('0x8d'),_0x9e4b('0x8e'));_0x5a363b['field'](_0x9e4b('0x8f'));_0x5a363b[_0x9e4b('0x43')](_0x9e4b('0x90'),_0x9e4b('0x91'));_0x5a363b['field']('c.lastName',_0x9e4b('0x92'));_0x5a363b[_0x9e4b('0x43')](_0x9e4b('0x93'),'Contact.email');_0x5a363b[_0x9e4b('0x43')](_0x9e4b('0x94'),_0x9e4b('0x95'));_0x5a363b[_0x9e4b('0x43')](_0x9e4b('0x96'),_0x9e4b('0x97'));_0x5a363b[_0x9e4b('0x43')](_0x9e4b('0x98'),'Contact.fax');_0x5a363b['field'](_0x9e4b('0x99'),_0x9e4b('0x2d'));_0x5a363b[_0x9e4b('0x22')](_0xd04717[_0x9e4b('0x22')]);_0x5a363b[_0x9e4b('0x21')](_0xd04717[_0x9e4b('0x21')]);return db[_0x9e4b('0x8a')][_0x9e4b('0x39')](_0x5a363b[_0x9e4b('0x7e')](),_0x4dc66b);})[_0x9e4b('0x27')](function(_0x407ea1){_0x94e57a[_0x9e4b('0x6d')](_0x9e4b('0x9a'),_[_0x9e4b('0x2c')](_0x407ea1,'id'));return db['sequelize'][_0x9e4b('0x39')](_0x94e57a[_0x9e4b('0x7e')](),_0x4dc66b)[_0x9e4b('0x27')](function(_0x5a5b3c){var _0x113816=_[_0x9e4b('0x9b')](_0x5a5b3c,'OpenchannelInteractionId');var _0x299058=[];_0x407ea1[_0x9e4b('0x30')](function(_0x3ef4d7){_0x299058[_0x9e4b('0x31')](updateOpenchannelInteraction(_0x3ef4d7,_0x1c2397,_0x113816));});return BPromise['all'](_0x299058);});});})[_0x9e4b('0x27')](function(_0x2001ce){_0x12d52e[_0x9e4b('0x9c')]=_0x2001ce;return _0x12d52e;})[_0x9e4b('0x27')](respondWithFilteredResult(_0x2e868e,_0xd04717))[_0x9e4b('0x32')](handleError(_0x2e868e,null));};exports['show']=function(_0xeb10d0,_0xb521fe){var _0xb5b196={'raw':![],'where':{'id':_0xeb10d0[_0x9e4b('0x9d')]['id']}},_0x2ec3a4={};_0x2ec3a4[_0x9e4b('0x3d')]=_[_0x9e4b('0x3a')](db[_0x9e4b('0x34')]['rawAttributes']);_0x2ec3a4[_0x9e4b('0x39')]=_[_0x9e4b('0x3a')](_0xeb10d0[_0x9e4b('0x39')]);_0x2ec3a4[_0x9e4b('0x3b')]=_[_0x9e4b('0x3c')](_0x2ec3a4[_0x9e4b('0x3d')],_0x2ec3a4[_0x9e4b('0x39')]);_0xb5b196['attributes']=_[_0x9e4b('0x3c')](_0x2ec3a4[_0x9e4b('0x3d')],qs[_0x9e4b('0x3f')](_0xeb10d0[_0x9e4b('0x39')][_0x9e4b('0x3f')]));_0xb5b196[_0x9e4b('0x3e')]=_0xb5b196['attributes'][_0x9e4b('0x58')]?_0xb5b196['attributes']:_0x2ec3a4['model'];if(_0xeb10d0[_0x9e4b('0x39')][_0x9e4b('0x9e')]){_0xb5b196[_0x9e4b('0x9f')]=[{'all':!![]}];}_0xb5b196=_[_0x9e4b('0x8b')]({},_0xb5b196,_0xeb10d0[_0x9e4b('0xa0')]);return db[_0x9e4b('0x34')][_0x9e4b('0x59')](_0xb5b196)[_0x9e4b('0x27')](handleEntityNotFound(_0xb521fe,null))[_0x9e4b('0x27')](respondWithResult(_0xb521fe,null))[_0x9e4b('0x32')](handleError(_0xb521fe,null));};exports['create']=function(_0x5055a0,_0x5bb657){return db[_0x9e4b('0x34')][_0x9e4b('0xa1')](_0x5055a0[_0x9e4b('0xa2')],{})[_0x9e4b('0x27')](respondWithResult(_0x5bb657,0xc9))[_0x9e4b('0x32')](handleError(_0x5bb657,null));};exports[_0x9e4b('0x26')]=function(_0x288d25,_0x547fc7){if(_0x288d25[_0x9e4b('0xa2')]['id']){delete _0x288d25[_0x9e4b('0xa2')]['id'];}return db['OpenchannelInteraction'][_0x9e4b('0x59')]({'where':{'id':_0x288d25[_0x9e4b('0x9d')]['id']}})[_0x9e4b('0x27')](handleEntityNotFound(_0x547fc7,null))['then'](saveUpdates(_0x288d25[_0x9e4b('0xa2')],null))[_0x9e4b('0x27')](respondWithResult(_0x547fc7,null))[_0x9e4b('0x32')](handleError(_0x547fc7,null));};exports[_0x9e4b('0x28')]=function(_0x437603,_0x416d76){return db[_0x9e4b('0x34')]['find']({'where':{'id':_0x437603[_0x9e4b('0x9d')]['id']}})[_0x9e4b('0x27')](handleEntityNotFound(_0x416d76,null))[_0x9e4b('0x27')](removeEntity(_0x416d76,null))[_0x9e4b('0x32')](handleError(_0x416d76,null));};exports[_0x9e4b('0xa3')]=function(_0x29afbc,_0x56c578){return db[_0x9e4b('0x34')][_0x9e4b('0xa3')]()[_0x9e4b('0x27')](respondWithResult(_0x56c578,null))['catch'](handleError(_0x56c578,null));};exports[_0x9e4b('0xa4')]=function(_0xdc693c,_0x3d7b75,_0x21058){return db['OpenchannelMessage'][_0x9e4b('0x59')]({'where':{'id':_0xdc693c['params']['id']}})[_0x9e4b('0x27')](handleEntityNotFound(_0x3d7b75,null))['then'](function(_0x3dc759){if(_0x3dc759){return _0x3dc759[_0x9e4b('0xa4')](_0xdc693c[_0x9e4b('0xa2')][_0x9e4b('0xa5')],_[_0x9e4b('0xa6')](_0xdc693c['body'],[_0x9e4b('0xa5'),'id'])||{});}})['then'](respondWithResult(_0x3d7b75,null))[_0x9e4b('0x32')](handleError(_0x3d7b75,null));};exports[_0x9e4b('0xa7')]=function(_0x1e64ba,_0x556ced,_0x18a5ad){var _0x56e099={'raw':![],'where':{}};var _0x3fe5df={};var _0x29d6e8={'count':0x0,'rows':[]};return db[_0x9e4b('0x34')]['findOne']({'where':{'id':_0x1e64ba[_0x9e4b('0x9d')]['id']}})[_0x9e4b('0x27')](handleEntityNotFound(_0x556ced,null))[_0x9e4b('0x27')](function(_0x578c14){if(_0x578c14){_0x3fe5df['model']=_[_0x9e4b('0x3a')](db['OpenchannelMessage'][_0x9e4b('0x35')]);_0x3fe5df[_0x9e4b('0x39')]=_[_0x9e4b('0x3a')](_0x1e64ba[_0x9e4b('0x39')]);_0x3fe5df[_0x9e4b('0x3b')]=_[_0x9e4b('0x3c')](_0x3fe5df[_0x9e4b('0x3d')],_0x3fe5df[_0x9e4b('0x39')]);_0x56e099[_0x9e4b('0x3e')]=_[_0x9e4b('0x3c')](_0x3fe5df[_0x9e4b('0x3d')],qs['fields'](_0x1e64ba[_0x9e4b('0x39')]['fields']));_0x56e099[_0x9e4b('0x3e')]=_0x56e099['attributes']['length']?_0x56e099['attributes']:_0x3fe5df[_0x9e4b('0x3d')];if(!_0x1e64ba[_0x9e4b('0x39')]['hasOwnProperty']('nolimit')){_0x56e099[_0x9e4b('0x22')]=qs[_0x9e4b('0x22')](_0x1e64ba[_0x9e4b('0x39')][_0x9e4b('0x22')]);_0x56e099['offset']=qs[_0x9e4b('0x21')](_0x1e64ba[_0x9e4b('0x39')][_0x9e4b('0x21')]);}_0x56e099['order']=qs[_0x9e4b('0x41')](_0x1e64ba[_0x9e4b('0x39')][_0x9e4b('0x41')]);_0x56e099[_0x9e4b('0x6d')]=qs[_0x9e4b('0x3b')](_['pick'](_0x1e64ba[_0x9e4b('0x39')],_0x3fe5df[_0x9e4b('0x3b')]));_0x56e099[_0x9e4b('0x6d')]['OpenchannelInteractionId']=_0x578c14['id'];if(_0x1e64ba[_0x9e4b('0x39')][_0x9e4b('0x79')]){_0x56e099[_0x9e4b('0x6d')]=_[_0x9e4b('0x8b')](_0x56e099[_0x9e4b('0x6d')],{'$or':_[_0x9e4b('0x2c')](_0x56e099['attributes'],function(_0x2b1c0c){var _0x4f4a03={};_0x4f4a03[_0x2b1c0c]={'$like':'%'+_0x1e64ba['query'][_0x9e4b('0x79')]+'%'};return _0x4f4a03;})});}if(_0x1e64ba[_0x9e4b('0x39')][_0x9e4b('0xa8')]){var _0x28171b=_0x1e64ba[_0x9e4b('0x39')][_0x9e4b('0xa8')][_0x9e4b('0x2f')](',');var _0x100181={};_0x100181[_0x28171b[0x0]]={'$gte':moment(_0x28171b[0x1])[_0x9e4b('0xa9')]('YYYY-MM-DD\x20HH:mm:ss')};_0x56e099[_0x9e4b('0x6d')]=_['merge'](_0x56e099[_0x9e4b('0x6d')],_0x100181);}_0x56e099=_[_0x9e4b('0x8b')]({},_0x56e099,_0x1e64ba['options']);return db['OpenchannelMessage'][_0x9e4b('0x20')]({'where':_0x56e099['where']})['then'](function(_0x253d4f){_0x29d6e8[_0x9e4b('0x20')]=_0x253d4f;if(_0x1e64ba[_0x9e4b('0x39')]['includeAll']){_0x56e099[_0x9e4b('0x9f')]=[{'all':!![]}];}return db[_0x9e4b('0xaa')][_0x9e4b('0xab')](_0x56e099);})[_0x9e4b('0x27')](function(_0x20669e){_0x29d6e8[_0x9e4b('0x9c')]=_0x20669e;return _0x29d6e8;});}})[_0x9e4b('0x27')](respondWithFilteredResult(_0x556ced,_0x56e099))['catch'](handleError(_0x556ced,null));};exports[_0x9e4b('0xac')]=function(_0x3be000,_0x10967b,_0x1a76bf){return db[_0x9e4b('0x34')][_0x9e4b('0x59')]({'where':{'id':_0x3be000[_0x9e4b('0x9d')]['id']}})[_0x9e4b('0x27')](handleEntityNotFound(_0x10967b,null))[_0x9e4b('0x27')](function(_0xc588da){if(_0xc588da){return _0xc588da[_0x9e4b('0xad')](_0x3be000['body'][_0x9e4b('0xa5')],_['omit'](_0x3be000[_0x9e4b('0xa2')],['ids','id'])||{})['spread'](function(){return db[_0x9e4b('0x64')][_0x9e4b('0xab')]({'attributes':['id',_0x9e4b('0x2b'),_0x9e4b('0x44')],'where':{'id':_0x3be000[_0x9e4b('0xa2')]['ids']}});})[_0x9e4b('0x27')](function(_0xf25ee1){socket[_0x9e4b('0xae')](_0x9e4b('0xaf'),{'id':Number(_0x3be000['params']['id']),'tags':_0xf25ee1||[]});return{'id':Number(_0x3be000[_0x9e4b('0x9d')]['id']),'tags':_0xf25ee1||[]};});}})['then'](respondWithResult(_0x10967b,null))[_0x9e4b('0x32')](handleError(_0x10967b,null));};exports['removeTags']=function(_0xf6c98e,_0x24a29d,_0x345742){return db[_0x9e4b('0x34')][_0x9e4b('0x59')]({'where':{'id':_0xf6c98e['params']['id']}})['then'](handleEntityNotFound(_0x24a29d,null))[_0x9e4b('0x27')](function(_0x2652bf){if(_0x2652bf){return _0x2652bf['removeTags'](_0xf6c98e[_0x9e4b('0x39')][_0x9e4b('0xa5')]);}})[_0x9e4b('0x27')](respondWithStatusCode(_0x24a29d,null))[_0x9e4b('0x32')](handleError(_0x24a29d,null));};exports[_0x9e4b('0xb0')]=function(_0x18697e,_0x59c80b){var _0x551c95=moment()['unix']()[_0x9e4b('0x7e')]();var _0x39cef2=path[_0x9e4b('0x7f')](config[_0x9e4b('0xb1')],_0x9e4b('0xb2'),_0x9e4b('0xb3'),'tmp');var _0x30bbc8=path['join'](config[_0x9e4b('0xb1')],_0x9e4b('0xb2'),'files',_0x9e4b('0xb4'));var _0x3cd173=path['join'](_0x39cef2,_0x551c95);var _0x4f382c=util[_0x9e4b('0xa9')](_0x9e4b('0xb5'),_0x18697e[_0x9e4b('0x9d')]['id'],_0x551c95);var _0x5f7798=path[_0x9e4b('0x7f')](_0x39cef2,_0x4f382c);var _0x5f0c5e=![];return db['OpenchannelInteraction'][_0x9e4b('0x59')]({'where':{'id':_0x18697e['params']['id']},'include':[{'model':db[_0x9e4b('0xaa')],'as':_0x9e4b('0xb6'),'attributes':['id',_0x9e4b('0xa2'),_0x9e4b('0xb7'),'direction',_0x9e4b('0xb8'),'read'],'include':[{'model':db[_0x9e4b('0xb9')],'as':_0x9e4b('0xb9'),'attributes':['id','fullname'],'raw':!![]},{'model':db[_0x9e4b('0xba')],'as':'Contact','attributes':['id','firstName',_0x9e4b('0xbb')],'raw':!![]},{'model':db[_0x9e4b('0xbc')],'as':_0x9e4b('0xbc'),'raw':!![]}]},{'model':db[_0x9e4b('0xbd')],'as':_0x9e4b('0xbe'),'attributes':['id','name']},{'model':db[_0x9e4b('0xb9')],'as':_0x9e4b('0xbf'),'attributes':['id',_0x9e4b('0xc0')]}]})['then'](handleEntityNotFound(_0x59c80b,null))[_0x9e4b('0x27')](function(_0x58db0){if(_0x58db0){var _0x57b9bf=_0x58db0[_0x9e4b('0xc1')]({'plain':!![]});_0x5f0c5e=!![];var _0x5f4ef4={'format':'A4','border':_0x9e4b('0xc2'),'header':{'height':_0x9e4b('0xc3'),'contents':{'first':_0x9e4b('0xc4')}},'footer':{'height':_0x9e4b('0xc5'),'contents':{'default':util[_0x9e4b('0xa9')](_0x9e4b('0xc6'),util[_0x9e4b('0xa9')]('%s\x20#%d',_0x9e4b('0xc7'),_0x57b9bf['id']),moment()[_0x9e4b('0xa9')](_0x9e4b('0xc8'))[_0x9e4b('0x7e')]())}}};fs[_0x9e4b('0xc9')](_0x3cd173);var _0x50378d={'channel':_0x9e4b('0xc7'),'account':_0x57b9bf[_0x9e4b('0xbe')][_0x9e4b('0x2b')],'agent':_0x57b9bf[_0x9e4b('0xbf')]?_0x57b9bf[_0x9e4b('0xbf')][_0x9e4b('0xc0')]:'N.A.','createdAt':moment(_0x57b9bf[_0x9e4b('0xb7')])[_0x9e4b('0xa9')](_0x9e4b('0xca'))[_0x9e4b('0x7e')](),'closedAt':_0x57b9bf[_0x9e4b('0xcb')]?moment(_0x57b9bf[_0x9e4b('0xcc')])[_0x9e4b('0xa9')](_0x9e4b('0xca'))[_0x9e4b('0x7e')]():'','disposition':_0x57b9bf[_0x9e4b('0xcd')],'visibility':_0x57b9bf[_0x9e4b('0xce')]?_0x9e4b('0xcf'):_0x9e4b('0xd0'),'messages':_(_0x57b9bf[_0x9e4b('0xb6')])[_0x9e4b('0x79')]({'secret':![]})[_0x9e4b('0x2c')](function(_0x288828){if(_0x288828[_0x9e4b('0xbc')]){var _0x3edff3=path[_0x9e4b('0x7f')](_0x30bbc8,_0x288828['Attachment'][_0x9e4b('0xd1')]);if(fs[_0x9e4b('0xd2')](_0x3edff3)){fs['createReadStream'](_0x3edff3)['pipe'](fs['createWriteStream'](path['join'](_0x3cd173,_0x288828[_0x9e4b('0xbc')][_0x9e4b('0xd1')])));}}return{'date':moment(_0x288828[_0x9e4b('0xb7')])[_0x9e4b('0xa9')]('YYYY-MM-DD\x20HH:mm:ss')[_0x9e4b('0x7e')](),'sender':_0x288828[_0x9e4b('0xd3')]===_0x9e4b('0xd4')?_0x288828[_0x9e4b('0xb9')]?_0x288828[_0x9e4b('0xb9')][_0x9e4b('0xc0')]:_0x9e4b('0xd5'):_0x288828[_0x9e4b('0x5f')]['firstName']+(_0x288828[_0x9e4b('0x5f')]['lastName']?'\x20'+_0x288828[_0x9e4b('0x5f')][_0x9e4b('0xbb')]:''),'body':_0x288828[_0x9e4b('0xbc')]?_0x288828[_0x9e4b('0xbc')][_0x9e4b('0xd1')]:_0x288828['body'],'direction':_0x288828[_0x9e4b('0xd3')]===_0x9e4b('0xd4')?'A':'C','secret':_0x288828[_0x9e4b('0xb8')],'read':_0x288828[_0x9e4b('0x74')],'attachment':_0x288828['Attachment']};})[_0x9e4b('0x5b')]()};return ejs['renderFile'](path['join'](config[_0x9e4b('0xb1')],'server',_0x9e4b('0xd6'),_0x9e4b('0xd7')),{'interaction':_0x50378d})[_0x9e4b('0x27')](function(_0x4ae496){return new BPromise(function(_0x2a59d8,_0x744295){pdf[_0x9e4b('0xa1')](_0x4ae496,_0x5f4ef4)[_0x9e4b('0xd8')](path[_0x9e4b('0x7f')](_0x3cd173,_0x9e4b('0xd9')+_0x57b9bf['id']+'-'+_0x551c95+'.pdf'),function(_0xef1f08,_0x5941d5){if(_0xef1f08)return _0x744295(_0xef1f08);_0x2a59d8(_0x5941d5);});});});}})[_0x9e4b('0x27')](function(){if(_0x5f0c5e){return new BPromise(function(_0x1c2fee,_0x4e1db6){zipdir(_0x3cd173,{'saveTo':_0x5f7798},function(_0x3e45c6,_0x418437){if(_0x3e45c6)return _0x4e1db6(_0x3e45c6);return _0x1c2fee(_0x418437);});})[_0x9e4b('0x27')](function(){return new BPromise(function(_0x5163fb,_0x4be806){rimraf(_0x3cd173,function(_0x386c9c){if(_0x386c9c)_0x4be806(_0x386c9c);return _0x5163fb();});});})['then'](function(){return _0x59c80b[_0x9e4b('0xb0')](_0x5f7798,_0x4f382c,function(_0x360263){if(_0x360263){console[_0x9e4b('0xda')](_0x9e4b('0xdb'),_0x360263);}else{fs[_0x9e4b('0xdc')](_0x5f7798);}});});}else{return _0x59c80b[_0x9e4b('0x1c')](0xc8);}})[_0x9e4b('0x32')](handleError(_0x59c80b,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index a700408..6c2bf21 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 _0x240c=['setMaxListeners','save','remove','getUsers','then','Users','findAll','unreadMessages','length','catch','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelMessage'];(function(_0x868b7c,_0xfa438b){var _0x21683c=function(_0x21bc66){while(--_0x21bc66){_0x868b7c['push'](_0x868b7c['shift']());}};_0x21683c(++_0xfa438b);}(_0x240c,0x7d));var _0xc240=function(_0x158e08,_0x4dd7d3){_0x158e08=_0x158e08-0x0;var _0x3b8d05=_0x240c[_0x158e08];return _0x3b8d05;};'use strict';var EventEmitter=require(_0xc240('0x0'));var OpenchannelInteraction=require(_0xc240('0x1'))['db']['OpenchannelInteraction'];var OpenchannelMessage=require(_0xc240('0x1'))['db'][_0xc240('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xc240('0x3')](0x0);var events={'afterCreate':_0xc240('0x4'),'afterUpdate':'update','afterDestroy':_0xc240('0x5')};function emitEvent(_0x339753){return function(_0x23ec1a,_0x3cd74d,_0x1a40fd){_0x23ec1a[_0xc240('0x6')]({'attributes':['id'],'raw':!![]})[_0xc240('0x7')](function(_0x4e9118){_0x23ec1a['setDataValue'](_0xc240('0x8'),_0x4e9118['map'](function(_0x112200){return{'id':_0x112200['id']};}));return OpenchannelMessage[_0xc240('0x9')]({'where':{'OpenchannelInteractionId':_0x23ec1a['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x3277e4){_0x23ec1a['setDataValue'](_0xc240('0xa'),_0x3277e4[_0xc240('0xb')]);OpenchannelInteractionEvents['emit'](_0x339753+':'+_0x23ec1a['id'],_0x23ec1a);OpenchannelInteractionEvents['emit'](_0x339753,_0x23ec1a);_0x1a40fd(null);})[_0xc240('0xc')](_0x1a40fd(null));};}for(var e in events){if(events[_0xc240('0xd')](e)){var event=events[e];OpenchannelInteraction[_0xc240('0xe')](e,emitEvent(event));}}module[_0xc240('0xf')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x0cc0=['Users','map','findAll','unreadMessages','length','emit','hook','exports','events','../../mysqldb','OpenchannelMessage','setMaxListeners','save','update','getUsers','then','setDataValue'];(function(_0x303d74,_0x3493ab){var _0x58b065=function(_0x275af5){while(--_0x275af5){_0x303d74['push'](_0x303d74['shift']());}};_0x58b065(++_0x3493ab);}(_0x0cc0,0xa1));var _0x00cc=function(_0x397dab,_0x20ded8){_0x397dab=_0x397dab-0x0;var _0x3a61aa=_0x0cc0[_0x397dab];return _0x3a61aa;};'use strict';var EventEmitter=require(_0x00cc('0x0'));var OpenchannelInteraction=require(_0x00cc('0x1'))['db']['OpenchannelInteraction'];var OpenchannelMessage=require(_0x00cc('0x1'))['db'][_0x00cc('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x00cc('0x3')](0x0);var events={'afterCreate':_0x00cc('0x4'),'afterUpdate':_0x00cc('0x5'),'afterDestroy':'remove'};function emitEvent(_0x34a35c){return function(_0x4c1968,_0x416b82,_0x41ba6c){_0x4c1968[_0x00cc('0x6')]({'attributes':['id'],'raw':!![]})[_0x00cc('0x7')](function(_0x2d7eb2){_0x4c1968[_0x00cc('0x8')](_0x00cc('0x9'),_0x2d7eb2[_0x00cc('0xa')](function(_0xf1e268){return{'id':_0xf1e268['id']};}));return OpenchannelMessage[_0x00cc('0xb')]({'where':{'OpenchannelInteractionId':_0x4c1968['id'],'direction':'in','read':![]},'raw':!![]});})[_0x00cc('0x7')](function(_0x2932db){_0x4c1968[_0x00cc('0x8')](_0x00cc('0xc'),_0x2932db[_0x00cc('0xd')]);OpenchannelInteractionEvents[_0x00cc('0xe')](_0x34a35c+':'+_0x4c1968['id'],_0x4c1968);OpenchannelInteractionEvents[_0x00cc('0xe')](_0x34a35c,_0x4c1968);_0x41ba6c(null);})['catch'](_0x41ba6c(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0x00cc('0xf')](e,emitEvent(event));}}module[_0x00cc('0x10')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 8b37517..5dc221d 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 _0xe181=['format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./openchannelInteraction.attributes','define','OpenchannelInteraction','openchannel_interactions','changed','closed','closedAt'];(function(_0x93b619,_0x246097){var _0x3b654d=function(_0x145bd2){while(--_0x145bd2){_0x93b619['push'](_0x93b619['shift']());}};_0x3b654d(++_0x246097);}(_0xe181,0x68));var _0x1e18=function(_0x264609,_0x7609b9){_0x264609=_0x264609-0x0;var _0x1f38b9=_0xe181[_0x264609];return _0x1f38b9;};'use strict';var _=require(_0x1e18('0x0'));var util=require('util');var logger=require(_0x1e18('0x1'))(_0x1e18('0x2'));var moment=require(_0x1e18('0x3'));var BPromise=require(_0x1e18('0x4'));var rp=require(_0x1e18('0x5'));var fs=require('fs');var path=require(_0x1e18('0x6'));var rimraf=require(_0x1e18('0x7'));var config=require('../../config/environment');var attributes=require(_0x1e18('0x8'));module['exports']=function(_0x512343,_0x18fabb){return _0x512343[_0x1e18('0x9')](_0x1e18('0xa'),attributes,{'tableName':_0x1e18('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x9f9541,_0x398f77,_0x5e6cd3){if(_0x9f9541[_0x1e18('0xc')](_0x1e18('0xd'))){_0x9f9541[_0x1e18('0xe')]=moment()[_0x1e18('0xf')](_0x1e18('0x10'));}_0x5e6cd3(null,_0x9f9541);}}});}; \ No newline at end of file +var _0x8f9d=['../../config/environment','./openchannelInteraction.attributes','define','OpenchannelInteraction','openchannel_interactions','closed','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x5cba10,_0x38a732){var _0x58eea8=function(_0x5d8c2f){while(--_0x5d8c2f){_0x5cba10['push'](_0x5cba10['shift']());}};_0x58eea8(++_0x38a732);}(_0x8f9d,0x93));var _0xd8f9=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x8f9d[_0x122ef9];return _0x42fba0;};'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':!![],'hooks':{'beforeUpdate':function(_0x5c410f,_0x46babd,_0x6691e){if(_0x5c410f['changed'](_0xd8f9('0xc'))){_0x5c410f['closedAt']=moment()['format'](_0xd8f9('0xd'));}_0x6691e(null,_0x5c410f);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index c4bf199..303ee03 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 _0xe04f=['../../config/utils','../../config/logger','rpc','client','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','where','limit','find','addTags','omit','ids','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0xbfcffb,_0x118124){var _0x5180f4=function(_0x1104f6){while(--_0x1104f6){_0xbfcffb['push'](_0xbfcffb['shift']());}};_0x5180f4(++_0x118124);}(_0xe04f,0xf0));var _0xfe04=function(_0x5d6482,_0x1c9b00){_0x5d6482=_0x5d6482-0x0;var _0x32e681=_0xe04f[_0x5d6482];return _0x32e681;};'use strict';var _=require(_0xfe04('0x0'));var util=require(_0xfe04('0x1'));var moment=require(_0xfe04('0x2'));var BPromise=require(_0xfe04('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfe04('0x4'));var db=require(_0xfe04('0x5'))['db'];var utils=require(_0xfe04('0x6'));var logger=require(_0xfe04('0x7'))(_0xfe04('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xfe04('0x9')]['http']({'port':0x232a});config[_0xfe04('0xa')]=_[_0xfe04('0xb')](config['redis'],{'host':_0xfe04('0xc'),'port':0x18eb});var socket=require(_0xfe04('0xd'))(new Redis(config['redis']));require(_0xfe04('0xe'))[_0xfe04('0xf')](socket);function respondWithRpcPromise(_0xb9626,_0x418b53,_0x4e7a43){return new BPromise(function(_0x5503e1,_0x4c36bb){return client[_0xfe04('0x10')](_0xb9626,_0x4e7a43)[_0xfe04('0x11')](function(_0x2cbf65){logger[_0xfe04('0x12')](_0xfe04('0x13'),_0x418b53,_0xfe04('0x14'));logger[_0xfe04('0x15')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x418b53,_0xfe04('0x14'),JSON[_0xfe04('0x16')](_0x2cbf65));if(_0x2cbf65['error']){if(_0x2cbf65[_0xfe04('0x17')][_0xfe04('0x18')]===0x1f4){logger['error'](_0xfe04('0x13'),_0x418b53,_0x2cbf65['error'][_0xfe04('0x19')]);return _0x4c36bb(_0x2cbf65[_0xfe04('0x17')]['message']);}logger[_0xfe04('0x17')](_0xfe04('0x13'),_0x418b53,_0x2cbf65[_0xfe04('0x17')][_0xfe04('0x19')]);return _0x5503e1(_0x2cbf65['error'][_0xfe04('0x19')]);}else{logger['info']('OpenchannelInteraction,\x20%s,\x20%s',_0x418b53,_0xfe04('0x14'));_0x5503e1(_0x2cbf65[_0xfe04('0x1a')][_0xfe04('0x19')]);}})[_0xfe04('0x1b')](function(_0x1f3531){logger[_0xfe04('0x17')](_0xfe04('0x13'),_0x418b53,_0x1f3531);_0x4c36bb(_0x1f3531);});});}exports[_0xfe04('0x1c')]=function(_0x28d110){var _0x332575=this;return new Promise(function(_0x127242,_0x4de0e2){return db[_0xfe04('0x1d')][_0xfe04('0x1e')](_0x28d110[_0xfe04('0x1f')],{'raw':_0x28d110[_0xfe04('0x20')]?_0x28d110['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x28d110[_0xfe04('0x20')]?_0x28d110[_0xfe04('0x20')][_0xfe04('0x21')]||null:null,'attributes':_0x28d110[_0xfe04('0x20')]?_0x28d110[_0xfe04('0x20')]['attributes']||null:null,'limit':_0x28d110[_0xfe04('0x20')]?_0x28d110[_0xfe04('0x20')][_0xfe04('0x22')]||null:null})[_0xfe04('0x11')](function(_0x518aae){logger[_0xfe04('0x12')](_0xfe04('0x1c'),_0x28d110);logger['debug'](_0xfe04('0x1c'),_0x28d110,JSON[_0xfe04('0x16')](_0x518aae));_0x127242(_0x518aae);})[_0xfe04('0x1b')](function(_0x1f26db){logger['error'](_0xfe04('0x1c'),_0x1f26db['message'],_0x28d110);_0x4de0e2(_0x332575['error'](0x1f4,_0x1f26db[_0xfe04('0x19')]));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x36c95f){return new Promise(function(_0xc86906,_0x18f23c){return db[_0xfe04('0x1d')][_0xfe04('0x23')]({'where':_0x36c95f[_0xfe04('0x20')]?_0x36c95f[_0xfe04('0x20')][_0xfe04('0x21')]||null:null})[_0xfe04('0x11')](function(_0xf67333){if(_0xf67333){return _0xf67333[_0xfe04('0x24')](_0x36c95f[_0xfe04('0x1f')]['ids'],_[_0xfe04('0x25')](_0x36c95f['body'],[_0xfe04('0x26'),'id'])||{});}})[_0xfe04('0x27')](function(_0x274bf4){logger[_0xfe04('0x12')](_0xfe04('0x28'),_0x36c95f);logger[_0xfe04('0x15')](_0xfe04('0x28'),_0x36c95f,JSON[_0xfe04('0x16')](_0x274bf4));_0xc86906(_0x274bf4);})['catch'](function(_0x2a2d15){logger[_0xfe04('0x17')](_0xfe04('0x28'),_0x2a2d15['message'],_0x36c95f);_0x18f23c(_this[_0xfe04('0x17')](0x1f4,_0x2a2d15[_0xfe04('0x19')]));});});}; \ No newline at end of file +var _0x5108=['where','limit','catch','AddTagsToOpenchannelInteraction','addTags','ids','omit','spread','AddTags','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateOpenchannelInteraction','update','body','options'];(function(_0x5aa1f8,_0x23549c){var _0x5c4f81=function(_0x38b2f9){while(--_0x38b2f9){_0x5aa1f8['push'](_0x5aa1f8['shift']());}};_0x5c4f81(++_0x23549c);}(_0x5108,0x1e9));var _0x8510=function(_0x389836,_0x5f106e){_0x389836=_0x389836-0x0;var _0x17c42d=_0x5108[_0x389836];return _0x17c42d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8510('0x0'));var BPromise=require(_0x8510('0x1'));var rs=require(_0x8510('0x2'));var fs=require('fs');var Redis=require(_0x8510('0x3'));var db=require(_0x8510('0x4'))['db'];var utils=require(_0x8510('0x5'));var logger=require(_0x8510('0x6'))(_0x8510('0x7'));var config=require(_0x8510('0x8'));var jayson=require(_0x8510('0x9'));var client=jayson[_0x8510('0xa')]['http']({'port':0x232a});config['redis']=_[_0x8510('0xb')](config[_0x8510('0xc')],{'host':_0x8510('0xd'),'port':0x18eb});var socket=require(_0x8510('0xe'))(new Redis(config[_0x8510('0xc')]));require('./openchannelInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x8ce9d7,_0x56a29c,_0x356bd4){return new BPromise(function(_0xd4a2d3,_0xa897ee){return client[_0x8510('0xf')](_0x8ce9d7,_0x356bd4)[_0x8510('0x10')](function(_0x11d23e){logger[_0x8510('0x11')](_0x8510('0x12'),_0x56a29c,_0x8510('0x13'));logger[_0x8510('0x14')](_0x8510('0x15'),_0x56a29c,_0x8510('0x13'),JSON[_0x8510('0x16')](_0x11d23e));if(_0x11d23e[_0x8510('0x17')]){if(_0x11d23e['error'][_0x8510('0x18')]===0x1f4){logger[_0x8510('0x17')]('OpenchannelInteraction,\x20%s,\x20%s',_0x56a29c,_0x11d23e[_0x8510('0x17')]['message']);return _0xa897ee(_0x11d23e[_0x8510('0x17')][_0x8510('0x19')]);}logger[_0x8510('0x17')](_0x8510('0x12'),_0x56a29c,_0x11d23e['error'][_0x8510('0x19')]);return _0xd4a2d3(_0x11d23e[_0x8510('0x17')]['message']);}else{logger[_0x8510('0x11')](_0x8510('0x12'),_0x56a29c,_0x8510('0x13'));_0xd4a2d3(_0x11d23e[_0x8510('0x1a')][_0x8510('0x19')]);}})['catch'](function(_0x153191){logger['error'](_0x8510('0x12'),_0x56a29c,_0x153191);_0xa897ee(_0x153191);});});}exports[_0x8510('0x1b')]=function(_0x2fd791){var _0x4fc98b=this;return new Promise(function(_0x2632c5,_0x381ab0){return db['OpenchannelInteraction'][_0x8510('0x1c')](_0x2fd791[_0x8510('0x1d')],{'raw':_0x2fd791[_0x8510('0x1e')]?_0x2fd791[_0x8510('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2fd791['options']?_0x2fd791[_0x8510('0x1e')][_0x8510('0x1f')]||null:null,'attributes':_0x2fd791[_0x8510('0x1e')]?_0x2fd791[_0x8510('0x1e')]['attributes']||null:null,'limit':_0x2fd791[_0x8510('0x1e')]?_0x2fd791[_0x8510('0x1e')][_0x8510('0x20')]||null:null})['then'](function(_0xdb6b77){logger[_0x8510('0x11')](_0x8510('0x1b'),_0x2fd791);logger['debug'](_0x8510('0x1b'),_0x2fd791,JSON[_0x8510('0x16')](_0xdb6b77));_0x2632c5(_0xdb6b77);})[_0x8510('0x21')](function(_0x587629){logger['error']('UpdateOpenchannelInteraction',_0x587629[_0x8510('0x19')],_0x2fd791);_0x381ab0(_0x4fc98b['error'](0x1f4,_0x587629[_0x8510('0x19')]));});});};exports[_0x8510('0x22')]=function(_0x29dea3){return new Promise(function(_0x583bb1,_0x11c257){return db['OpenchannelInteraction']['find']({'where':_0x29dea3[_0x8510('0x1e')]?_0x29dea3['options'][_0x8510('0x1f')]||null:null})['then'](function(_0x37a523){if(_0x37a523){return _0x37a523[_0x8510('0x23')](_0x29dea3[_0x8510('0x1d')][_0x8510('0x24')],_[_0x8510('0x25')](_0x29dea3[_0x8510('0x1d')],['ids','id'])||{});}})[_0x8510('0x26')](function(_0x453f07){logger['info'](_0x8510('0x27'),_0x29dea3);logger[_0x8510('0x14')](_0x8510('0x27'),_0x29dea3,JSON[_0x8510('0x16')](_0x453f07));_0x583bb1(_0x453f07);})[_0x8510('0x21')](function(_0x569600){logger['error'](_0x8510('0x27'),_0x569600['message'],_0x29dea3);_0x11c257(_this[_0x8510('0x17')](0x1f4,_0x569600['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index b9ee1c2..6eca1f4 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 _0x7f38=['removeListener','register','length','./openchannelInteraction.events','save','update','emit'];(function(_0x12620f,_0xde595d){var _0x5326c5=function(_0x5b322b){while(--_0x5b322b){_0x12620f['push'](_0x12620f['shift']());}};_0x5326c5(++_0xde595d);}(_0x7f38,0x106));var _0x87f3=function(_0x5cf693,_0x448926){_0x5cf693=_0x5cf693-0x0;var _0x48352d=_0x7f38[_0x5cf693];return _0x48352d;};'use strict';var OpenchannelInteractionEvents=require(_0x87f3('0x0'));var events=[_0x87f3('0x1'),'remove',_0x87f3('0x2')];function createListener(_0x49b89c,_0x5db363){return function(_0x570969){_0x5db363[_0x87f3('0x3')](_0x49b89c,_0x570969);};}function removeListener(_0x1ce182,_0x35799b){return function(){OpenchannelInteractionEvents[_0x87f3('0x4')](_0x1ce182,_0x35799b);};}exports[_0x87f3('0x5')]=function(_0x5cf48f){for(var _0x389138=0x0,_0xfdbe6b=events[_0x87f3('0x6')];_0x389138<_0xfdbe6b;_0x389138++){var _0x2ab403=events[_0x389138];var _0x51724f=createListener('openchannelInteraction:'+_0x2ab403,_0x5cf48f);OpenchannelInteractionEvents['on'](_0x2ab403,_0x51724f);}}; \ No newline at end of file +var _0x4a54=['emit','removeListener','length','./openchannelInteraction.events','remove'];(function(_0x1d5c12,_0x12777e){var _0x553d6f=function(_0x5d0f53){while(--_0x5d0f53){_0x1d5c12['push'](_0x1d5c12['shift']());}};_0x553d6f(++_0x12777e);}(_0x4a54,0x14d));var _0x44a5=function(_0x22ba79,_0x441b13){_0x22ba79=_0x22ba79-0x0;var _0x55365e=_0x4a54[_0x22ba79];return _0x55365e;};'use strict';var OpenchannelInteractionEvents=require(_0x44a5('0x0'));var events=['save',_0x44a5('0x1'),'update'];function createListener(_0x1b52f0,_0x2162be){return function(_0x5b78ef){_0x2162be[_0x44a5('0x2')](_0x1b52f0,_0x5b78ef);};}function removeListener(_0x1c8c8c,_0x3d89b0){return function(){OpenchannelInteractionEvents[_0x44a5('0x3')](_0x1c8c8c,_0x3d89b0);};}exports['register']=function(_0x5dad83){for(var _0x2839d9=0x0,_0x56934e=events[_0x44a5('0x4')];_0x2839d9<_0x56934e;_0x2839d9++){var _0x1fd592=events[_0x2839d9];var _0x1bbe89=createListener('openchannelInteraction:'+_0x1fd592,_0x5dad83);OpenchannelInteractionEvents['on'](_0x1fd592,_0x1bbe89);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 02d1538..e846300 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 _0xe7e4=['../../components/auth/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','post','tracked','create','update','put','/:id/accept','accept','/:id/reject','delete','destroy','exports','multer','connect-timeout','express','Router'];(function(_0x5b71a6,_0x587f99){var _0x10208b=function(_0x207d1e){while(--_0x207d1e){_0x5b71a6['push'](_0x5b71a6['shift']());}};_0x10208b(++_0x587f99);}(_0xe7e4,0x13e));var _0x4e7e=function(_0x4e9fd9,_0x6b66c0){_0x4e9fd9=_0x4e9fd9-0x0;var _0x530438=_0xe7e4[_0x4e9fd9];return _0x530438;};'use strict';var multer=require(_0x4e7e('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4e7e('0x1'));var express=require(_0x4e7e('0x2'));var router=express[_0x4e7e('0x3')]();var auth=require(_0x4e7e('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4e7e('0x5'));var controller=require('./openchannelMessage.controller');router[_0x4e7e('0x6')]('/',auth['isAuthenticated'](),controller[_0x4e7e('0x7')]);router[_0x4e7e('0x6')](_0x4e7e('0x8'),auth[_0x4e7e('0x9')](),controller[_0x4e7e('0xa')]);router[_0x4e7e('0x6')](_0x4e7e('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x4e7e('0xc')]('/',auth[_0x4e7e('0x9')](),interaction[_0x4e7e('0xd')]('openchannel','openchannelmessage:create'),controller[_0x4e7e('0xe')]);router['put'](_0x4e7e('0xb'),auth[_0x4e7e('0x9')](),controller[_0x4e7e('0xf')]);router[_0x4e7e('0x10')](_0x4e7e('0x11'),auth[_0x4e7e('0x9')](),controller[_0x4e7e('0x12')]);router[_0x4e7e('0x10')](_0x4e7e('0x13'),auth[_0x4e7e('0x9')](),controller['reject']);router[_0x4e7e('0x14')](_0x4e7e('0xb'),auth[_0x4e7e('0x9')](),controller[_0x4e7e('0x15')]);module[_0x4e7e('0x16')]=router; \ No newline at end of file +var _0xa68a=['path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get','isAuthenticated','index','describe','/:id','show','openchannel','openchannelmessage:create','put','update','accept','/:id/reject','reject','delete','destroy','exports','util'];(function(_0xf4f2c2,_0x1dd81a){var _0x405a15=function(_0x116667){while(--_0x116667){_0xf4f2c2['push'](_0xf4f2c2['shift']());}};_0x405a15(++_0x1dd81a);}(_0xa68a,0x137));var _0xaa68=function(_0x3b5ae4,_0x3a0b8a){_0x3b5ae4=_0x3b5ae4-0x0;var _0x132c74=_0xa68a[_0x3b5ae4];return _0x132c74;};'use strict';var multer=require('multer');var util=require(_0xaa68('0x0'));var path=require(_0xaa68('0x1'));var timeout=require(_0xaa68('0x2'));var express=require(_0xaa68('0x3'));var router=express[_0xaa68('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xaa68('0x5'));var config=require(_0xaa68('0x6'));var controller=require(_0xaa68('0x7'));router[_0xaa68('0x8')]('/',auth[_0xaa68('0x9')](),controller[_0xaa68('0xa')]);router[_0xaa68('0x8')]('/describe',auth[_0xaa68('0x9')](),controller[_0xaa68('0xb')]);router[_0xaa68('0x8')](_0xaa68('0xc'),auth[_0xaa68('0x9')](),controller[_0xaa68('0xd')]);router['post']('/',auth[_0xaa68('0x9')](),interaction['tracked'](_0xaa68('0xe'),_0xaa68('0xf')),controller['create']);router[_0xaa68('0x10')](_0xaa68('0xc'),auth[_0xaa68('0x9')](),controller[_0xaa68('0x11')]);router[_0xaa68('0x10')]('/:id/accept',auth[_0xaa68('0x9')](),controller[_0xaa68('0x12')]);router[_0xaa68('0x10')](_0xaa68('0x13'),auth[_0xaa68('0x9')](),controller[_0xaa68('0x14')]);router[_0xaa68('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xaa68('0x16')]);module[_0xaa68('0x17')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 9a06f3f..f172b6c 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 _0x5bbf=['exports','TEXT','medium','BOOLEAN','ENUM','out','DATE','sequelize'];(function(_0x5cc8,_0x1faa02){var _0x450661=function(_0x237b05){while(--_0x237b05){_0x5cc8['push'](_0x5cc8['shift']());}};_0x450661(++_0x1faa02);}(_0x5bbf,0xdf));var _0xf5bb=function(_0x1b017e,_0x2d9433){_0x1b017e=_0x1b017e-0x0;var _0x3bf16e=_0x5bbf[_0x1b017e];return _0x3bf16e;};'use strict';var Sequelize=require(_0xf5bb('0x0'));module[_0xf5bb('0x1')]={'body':{'type':Sequelize[_0xf5bb('0x2')](_0xf5bb('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xf5bb('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0xf5bb('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xf5bb('0x5')]('in',_0xf5bb('0x6')),'defaultValue':_0xf5bb('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0xf5bb('0x7')]}}; \ No newline at end of file +var _0xe788=['ENUM','out','BOOLEAN'];(function(_0x1d3275,_0x402bbf){var _0x356dca=function(_0x3bed08){while(--_0x3bed08){_0x1d3275['push'](_0x1d3275['shift']());}};_0x356dca(++_0x402bbf);}(_0xe788,0x164));var _0x8e78=function(_0x5974c3,_0x9865c1){_0x5974c3=_0x5974c3-0x0;var _0x23f8cd=_0xe788[_0x5974c3];return _0x23f8cd;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x8e78('0x0')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x8e78('0x1')]('in',_0x8e78('0x2')),'defaultValue':_0x8e78('0x2'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 7c0672e..17f6c6c 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 _0xc037=['options','create','body','destroy','describe','openchannel-interactions','openchannel','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','find','Contact','OpenchannelInteraction','OpenchannelInteractionId','isNil','interaction','role','null','acceptMessage','manual','interface','format','SIP/%s','channel','event','EventManager','acceptmessage','agent','get','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','html-pdf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.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','request\x20sent','debug','stringify','error','message','OpenchannelMessage,\x20%s,\x20%s','result','catch','sendStatus','end','status','count','offset','limit','set','Content-Range','reject','save','update','stack','name','send','index','OpenchannelMessage','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','type','field','filter','includeAll','findAll','rows','show','params'];(function(_0x318663,_0x18193f){var _0x4b7cff=function(_0x58314e){while(--_0x58314e){_0x318663['push'](_0x318663['shift']());}};_0x4b7cff(++_0x18193f);}(_0xc037,0x112));var _0x7c03=function(_0x2e0931,_0x4590ad){_0x2e0931=_0x2e0931-0x0;var _0x2a52a0=_0xc037[_0x2e0931];return _0x2a52a0;};'use strict';var pdf=require(_0x7c03('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7c03('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7c03('0x2'));var moment=require(_0x7c03('0x3'));var BPromise=require(_0x7c03('0x4'));var Mustache=require(_0x7c03('0x5'));var util=require(_0x7c03('0x6'));var path=require(_0x7c03('0x7'));var sox=require(_0x7c03('0x8'));var csv=require(_0x7c03('0x9'));var ejs=require(_0x7c03('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x7c03('0xb'));var jsforce=require(_0x7c03('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7c03('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7c03('0xe'));var qs=require(_0x7c03('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7c03('0x10'));var logger=require(_0x7c03('0x11'))(_0x7c03('0x12'));var utils=require(_0x7c03('0x13'));var config=require(_0x7c03('0x14'));var db=require(_0x7c03('0x15'))['db'];config[_0x7c03('0x16')]=_[_0x7c03('0x17')](config[_0x7c03('0x16')],{'host':_0x7c03('0x18'),'port':0x18eb});var socket=require(_0x7c03('0x19'))(new Redis(config[_0x7c03('0x16')]));require(_0x7c03('0x1a'))[_0x7c03('0x1b')](socket);var jayson=require(_0x7c03('0x1c'));var client=jayson[_0x7c03('0x1d')][_0x7c03('0x1e')]({'port':0x232c});var client9002=jayson[_0x7c03('0x1d')][_0x7c03('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x123c2e,_0xa7d07,_0x28f586){if(_0x28f586){var _0xcc6708=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xcc6708[_0x7c03('0x1f')](_0xa7d07)){return _0x123c2e;}else{throw new Error(_0x7c03('0x20'));}}else{return _0x123c2e;}}function respondWithRpcPromise(_0x5a2fda,_0x437878,_0x332014,_0x59431b){return new BPromise(function(_0x10343d,_0x26788c){var _0x30f450=_0x59431b||client;return _0x30f450[_0x7c03('0x21')](_0x5a2fda,_0x332014)[_0x7c03('0x22')](function(_0x3e91a0){logger[_0x7c03('0x23')]('OpenchannelMessage,\x20%s,\x20%s',_0x437878,_0x7c03('0x24'));logger[_0x7c03('0x25')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x437878,'request\x20sent',JSON[_0x7c03('0x26')](_0x3e91a0));if(_0x3e91a0[_0x7c03('0x27')]){if(_0x3e91a0['error']['code']===0x1f4){logger[_0x7c03('0x27')]('OpenchannelMessage,\x20%s,\x20%s',_0x437878,_0x3e91a0[_0x7c03('0x27')][_0x7c03('0x28')]);return _0x26788c(_0x3e91a0[_0x7c03('0x27')][_0x7c03('0x28')]);}logger['error'](_0x7c03('0x29'),_0x437878,_0x3e91a0[_0x7c03('0x27')][_0x7c03('0x28')]);return _0x10343d(_0x3e91a0[_0x7c03('0x27')]['message']);}else{logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x437878,_0x7c03('0x24'));_0x10343d(_0x3e91a0[_0x7c03('0x2a')]['message']);}})[_0x7c03('0x2b')](function(_0x48e318){logger['error'](_0x7c03('0x29'),_0x437878,_0x48e318);_0x26788c(_0x48e318);});});}function respondWithStatusCode(_0x2f87c3,_0x3d3e63){_0x3d3e63=_0x3d3e63||0xcc;return function(_0x159858){if(_0x159858){return _0x2f87c3[_0x7c03('0x2c')](_0x3d3e63);}return _0x2f87c3['status'](_0x3d3e63)[_0x7c03('0x2d')]();};}function respondWithResult(_0x32c655,_0x2f94d4){_0x2f94d4=_0x2f94d4||0xc8;return function(_0x4c34a2){if(_0x4c34a2){return _0x32c655[_0x7c03('0x2e')](_0x2f94d4)['json'](_0x4c34a2);}};}function respondWithFilteredResult(_0x25a4b2,_0x2b7763){return function(_0xa47992){if(_0xa47992){var _0x3d6f2b=_0xa47992[_0x7c03('0x2f')],_0x53f710=_0x2b7763[_0x7c03('0x30')],_0x7a30a0=_0x2b7763[_0x7c03('0x30')]+_0x2b7763[_0x7c03('0x31')],_0xdc6e14;if(_0x7a30a0>=_0x3d6f2b){_0x7a30a0=_0x3d6f2b;_0xdc6e14=0xc8;}else{_0xdc6e14=0xce;}_0x25a4b2[_0x7c03('0x2e')](_0xdc6e14);return _0x25a4b2[_0x7c03('0x32')](_0x7c03('0x33'),_0x53f710+'-'+_0x7a30a0+'/'+_0x3d6f2b)['json'](_0xa47992);}return null;};}function patchUpdates(_0x3fc1f5){return function(_0x563cbf){try{jsonpatch['apply'](_0x563cbf,_0x3fc1f5,!![]);}catch(_0x146983){return BPromise[_0x7c03('0x34')](_0x146983);}return _0x563cbf[_0x7c03('0x35')]();};}function saveUpdates(_0x2a537c,_0x24546c){return function(_0x739dd9){if(_0x739dd9){return _0x739dd9[_0x7c03('0x36')](_0x2a537c)[_0x7c03('0x22')](function(_0x571593){return _0x571593;});}return null;};}function removeEntity(_0x457569,_0x3a5351){return function(_0x1a46b6){if(_0x1a46b6){return _0x1a46b6['destroy']()[_0x7c03('0x22')](function(){_0x457569['status'](0xcc)[_0x7c03('0x2d')]();});}};}function handleEntityNotFound(_0x1cfbe4,_0x547a70){return function(_0x2766f6){if(!_0x2766f6){_0x1cfbe4['sendStatus'](0x194);}return _0x2766f6;};}function handleError(_0x1581ed,_0x329010){_0x329010=_0x329010||0x1f4;return function(_0xb66419){logger[_0x7c03('0x27')](_0xb66419[_0x7c03('0x37')]);if(_0xb66419[_0x7c03('0x38')]){delete _0xb66419['name'];}_0x1581ed[_0x7c03('0x2e')](_0x329010)[_0x7c03('0x39')](_0xb66419);};}exports[_0x7c03('0x3a')]=function(_0x4eebfd,_0x47267a){var _0xb5a028={},_0x16bdff={},_0x2effe6={'count':0x0,'rows':[]};var _0x313951=_['map'](db[_0x7c03('0x3b')][_0x7c03('0x3c')],function(_0x390932){return{'name':_0x390932[_0x7c03('0x3d')],'type':_0x390932['type'][_0x7c03('0x3e')]};});_0x16bdff[_0x7c03('0x3f')]=_[_0x7c03('0x40')](_0x313951,_0x7c03('0x38'));_0x16bdff[_0x7c03('0x41')]=_[_0x7c03('0x42')](_0x4eebfd[_0x7c03('0x41')]);_0x16bdff[_0x7c03('0x43')]=_[_0x7c03('0x44')](_0x16bdff[_0x7c03('0x3f')],_0x16bdff[_0x7c03('0x41')]);_0xb5a028[_0x7c03('0x45')]=_[_0x7c03('0x44')](_0x16bdff[_0x7c03('0x3f')],qs[_0x7c03('0x46')](_0x4eebfd[_0x7c03('0x41')][_0x7c03('0x46')]));_0xb5a028['attributes']=_0xb5a028[_0x7c03('0x45')][_0x7c03('0x47')]?_0xb5a028[_0x7c03('0x45')]:_0x16bdff[_0x7c03('0x3f')];if(!_0x4eebfd[_0x7c03('0x41')]['hasOwnProperty'](_0x7c03('0x48'))){_0xb5a028['limit']=qs[_0x7c03('0x31')](_0x4eebfd[_0x7c03('0x41')][_0x7c03('0x31')]);_0xb5a028[_0x7c03('0x30')]=qs[_0x7c03('0x30')](_0x4eebfd[_0x7c03('0x41')]['offset']);}_0xb5a028[_0x7c03('0x49')]=qs[_0x7c03('0x4a')](_0x4eebfd[_0x7c03('0x41')]['sort']);_0xb5a028[_0x7c03('0x4b')]=qs['filters'](_[_0x7c03('0x4c')](_0x4eebfd[_0x7c03('0x41')],_0x16bdff[_0x7c03('0x43')]));if(_0x4eebfd[_0x7c03('0x41')]['filter']){_0xb5a028[_0x7c03('0x4b')]=_[_0x7c03('0x4d')](_0xb5a028['where'],{'$or':_['map'](_0x313951,function(_0x7de5b7){if(_0x7de5b7[_0x7c03('0x4e')][_0x7c03('0x3e')]!=='VIRTUAL'){var _0x12233e={};_0x12233e[_0x7de5b7[_0x7c03('0x4f')]]={'$like':'%'+_0x4eebfd[_0x7c03('0x41')][_0x7c03('0x50')]+'%'};return _0x12233e;}})});}_0xb5a028=_[_0x7c03('0x4d')]({},_0xb5a028,_0x4eebfd['options']);var _0x43a0e4={'where':_0xb5a028['where']};return db[_0x7c03('0x3b')][_0x7c03('0x2f')](_0x43a0e4)['then'](function(_0xa8d09c){_0x2effe6[_0x7c03('0x2f')]=_0xa8d09c;if(_0x4eebfd['query'][_0x7c03('0x51')]){_0xb5a028['include']=[{'all':!![]}];}return db[_0x7c03('0x3b')][_0x7c03('0x52')](_0xb5a028);})['then'](function(_0x3a4b51){_0x2effe6[_0x7c03('0x53')]=_0x3a4b51;return _0x2effe6;})['then'](respondWithFilteredResult(_0x47267a,_0xb5a028))['catch'](handleError(_0x47267a,null));};exports[_0x7c03('0x54')]=function(_0x4cbfd5,_0x503d39){var _0x17441b={'raw':!![],'where':{'id':_0x4cbfd5[_0x7c03('0x55')]['id']}},_0x5f589f={};_0x5f589f[_0x7c03('0x3f')]=_['keys'](db[_0x7c03('0x3b')][_0x7c03('0x3c')]);_0x5f589f['query']=_[_0x7c03('0x42')](_0x4cbfd5[_0x7c03('0x41')]);_0x5f589f[_0x7c03('0x43')]=_[_0x7c03('0x44')](_0x5f589f['model'],_0x5f589f['query']);_0x17441b[_0x7c03('0x45')]=_[_0x7c03('0x44')](_0x5f589f['model'],qs[_0x7c03('0x46')](_0x4cbfd5['query'][_0x7c03('0x46')]));_0x17441b[_0x7c03('0x45')]=_0x17441b[_0x7c03('0x45')][_0x7c03('0x47')]?_0x17441b[_0x7c03('0x45')]:_0x5f589f[_0x7c03('0x3f')];if(_0x4cbfd5['query'][_0x7c03('0x51')]){_0x17441b['include']=[{'all':!![]}];}_0x17441b=_[_0x7c03('0x4d')]({},_0x17441b,_0x4cbfd5[_0x7c03('0x56')]);return db['OpenchannelMessage']['find'](_0x17441b)['then'](handleEntityNotFound(_0x503d39,null))[_0x7c03('0x22')](respondWithResult(_0x503d39,null))['catch'](handleError(_0x503d39,null));};exports[_0x7c03('0x57')]=function(_0x3b5bd2,_0x31e5d3){return db[_0x7c03('0x3b')]['create'](_0x3b5bd2[_0x7c03('0x58')],{})[_0x7c03('0x22')](respondWithResult(_0x31e5d3,0xc9))[_0x7c03('0x2b')](handleError(_0x31e5d3,null));};exports[_0x7c03('0x36')]=function(_0x591065,_0x3b561f){if(_0x591065[_0x7c03('0x58')]['id']){delete _0x591065[_0x7c03('0x58')]['id'];}return db['OpenchannelMessage']['find']({'where':{'id':_0x591065['params']['id']}})['then'](handleEntityNotFound(_0x3b561f,null))[_0x7c03('0x22')](saveUpdates(_0x591065[_0x7c03('0x58')],null))['then'](respondWithResult(_0x3b561f,null))[_0x7c03('0x2b')](handleError(_0x3b561f,null));};exports[_0x7c03('0x59')]=function(_0x4c5cc1,_0x554ea3){return db[_0x7c03('0x3b')]['find']({'where':{'id':_0x4c5cc1[_0x7c03('0x55')]['id']}})[_0x7c03('0x22')](handleEntityNotFound(_0x554ea3,null))[_0x7c03('0x22')](removeEntity(_0x554ea3,null))[_0x7c03('0x2b')](handleError(_0x554ea3,null));};exports[_0x7c03('0x5a')]=function(_0x48f155,_0xcd4902){return db[_0x7c03('0x3b')][_0x7c03('0x5a')]()[_0x7c03('0x22')](respondWithResult(_0xcd4902,null))['catch'](handleError(_0xcd4902,null));};var interaction_log=require(_0x7c03('0x11'))(_0x7c03('0x5b'));exports['accept']=function(_0x16ddb3,_0x27ad42,_0x379752){var _0x4994fe={'channel':_0x7c03('0x5c')};if(_0x16ddb3['body']['id']){delete _0x16ddb3[_0x7c03('0x58')]['id'];}_0x16ddb3[_0x7c03('0x58')][_0x7c03('0x5d')]=!![];_0x16ddb3[_0x7c03('0x58')][_0x7c03('0x5e')]=moment()['format'](_0x7c03('0x5f'));_0x16ddb3[_0x7c03('0x58')][_0x7c03('0x60')]=_0x16ddb3['body']['UserId']||_0x16ddb3[_0x7c03('0x61')]['id'];return db[_0x7c03('0x3b')][_0x7c03('0x62')]({'where':{'id':_0x16ddb3[_0x7c03('0x55')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0x7c03('0x63')}]})[_0x7c03('0x22')](handleEntityNotFound(_0x27ad42,null))[_0x7c03('0x22')](saveUpdates(_0x16ddb3[_0x7c03('0x58')],null))[_0x7c03('0x22')](function(_0x5ec1b1){if(_0x5ec1b1){_0x4994fe['message']=_0x5ec1b1['get']({'plain':!![]});return db[_0x7c03('0x64')][_0x7c03('0x62')]({'where':{'id':_0x5ec1b1[_0x7c03('0x65')]}});}return null;})[_0x7c03('0x22')](handleEntityNotFound(_0x27ad42,null))['then'](function(_0x457998){if(_0x457998){return _0x457998['update']({'UserId':_0x16ddb3['body'][_0x7c03('0x60')],'read1stAt':_[_0x7c03('0x66')](_0x457998['read1stAt'])?moment()['format'](_0x7c03('0x5f')):undefined});}return null;})[_0x7c03('0x22')](function(_0x10cc3a){if(_0x10cc3a){_0x4994fe[_0x7c03('0x67')]=_0x10cc3a['get']({'plain':!![]});interaction_log[_0x7c03('0x23')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x16ddb3['user']['id'],_0x16ddb3['user']['name'],_0x16ddb3[_0x7c03('0x61')][_0x7c03('0x68')],_0x4994fe[_0x7c03('0x67')]['id'],_0x16ddb3[_0x7c03('0x58')]?JSON[_0x7c03('0x26')](_0x16ddb3[_0x7c03('0x58')]):_0x7c03('0x69'));return respondWithRpcPromise('AcceptMessage',_0x7c03('0x6a'),_0x4994fe);}return null;})['then'](function(_0x5d5c39){if(_0x5d5c39){if(_0x16ddb3[_0x7c03('0x58')][_0x7c03('0x6b')]){_0x4994fe[_0x7c03('0x28')][_0x7c03('0x6c')]=util[_0x7c03('0x6d')](_0x7c03('0x6e'),_0x16ddb3[_0x7c03('0x61')]['name']);_0x4994fe[_0x7c03('0x28')][_0x7c03('0x6f')]=_0x4994fe[_0x7c03('0x6f')];_0x4994fe[_0x7c03('0x28')][_0x7c03('0x70')]='accept';return respondWithRpcPromise(_0x7c03('0x71'),'EventManager',{'event':_0x7c03('0x72'),'message':_0x4994fe[_0x7c03('0x28')]},client9002)[_0x7c03('0x22')](function(){return _0x4994fe;});}return _0x4994fe;}return null;})[_0x7c03('0x22')](respondWithResult(_0x27ad42,null))['catch'](handleError(_0x27ad42,null));};var interaction_log=require(_0x7c03('0x11'))(_0x7c03('0x5b'));exports[_0x7c03('0x34')]=function(_0x3f689e,_0x5b998c,_0x4c09ff){var _0xac6f66={'agent':{},'channel':'openchannel'};if(_0x3f689e[_0x7c03('0x58')]['id']){delete _0x3f689e[_0x7c03('0x58')]['id'];}_0x3f689e[_0x7c03('0x58')][_0x7c03('0x60')]=_0x3f689e[_0x7c03('0x58')][_0x7c03('0x60')]||_0x3f689e[_0x7c03('0x61')]['id'];_0xac6f66[_0x7c03('0x73')]['id']=_0x3f689e[_0x7c03('0x58')][_0x7c03('0x60')];return db['OpenchannelMessage']['find']({'where':{'id':_0x3f689e[_0x7c03('0x55')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5b998c,null))['then'](function(_0x1a716f){if(_0x1a716f){_0xac6f66[_0x7c03('0x28')]=_0x1a716f[_0x7c03('0x74')]({'plain':!![]});return db[_0x7c03('0x64')]['find']({'where':{'id':_0x1a716f['OpenchannelInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x5b998c,null))[_0x7c03('0x22')](function(_0x71915e){if(_0x71915e){_0xac6f66['interaction']=_0x71915e[_0x7c03('0x74')]({'plain':!![]});interaction_log['info'](_0x7c03('0x75'),_0x3f689e[_0x7c03('0x61')]['id'],_0x3f689e[_0x7c03('0x61')][_0x7c03('0x38')],_0x3f689e[_0x7c03('0x61')][_0x7c03('0x68')],_0xac6f66['interaction']['id'],_0x3f689e[_0x7c03('0x58')]?JSON['stringify'](_0x3f689e[_0x7c03('0x58')]):_0x7c03('0x69'));return respondWithRpcPromise(_0x7c03('0x76'),_0x7c03('0x77'),_0xac6f66);}return null;})[_0x7c03('0x22')](function(_0x1b980d){if(_0x1b980d){_0x1b980d[_0x7c03('0x28')][_0x7c03('0x6c')]=util[_0x7c03('0x6d')]('SIP/%s',_0x3f689e[_0x7c03('0x61')]['name']);_0x1b980d[_0x7c03('0x28')][_0x7c03('0x6f')]=_0xac6f66[_0x7c03('0x6f')];_0x1b980d['message'][_0x7c03('0x70')]=_0x7c03('0x34');respondWithRpcPromise(_0x7c03('0x71'),_0x7c03('0x71'),{'event':'rejectmessage','message':_0x1b980d[_0x7c03('0x28')]},client9002);return _0xac6f66;}return null;})['then'](respondWithResult(_0x5b998c,null))[_0x7c03('0x2b')](handleError(_0x5b998c,null));}; \ No newline at end of file +var _0x5200=['result','catch','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','save','update','destroy','stack','name','index','OpenchannelMessage','rawAttributes','fieldName','type','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','key','field','count','includeAll','params','include','find','create','body','describe','openchannel-interactions','accept','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','get','OpenchannelInteraction','OpenchannelInteractionId','read1stAt','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','reject','interaction','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','rejectmessage','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','defaults','redis','localhost','register','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','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x29dfa5,_0xd3078e){var _0x41c15a=function(_0x10802b){while(--_0x10802b){_0x29dfa5['push'](_0x29dfa5['shift']());}};_0x41c15a(++_0xd3078e);}(_0x5200,0x1c2));var _0x0520=function(_0x993a27,_0x2374b1){_0x993a27=_0x993a27-0x0;var _0x2cc9ba=_0x5200[_0x993a27];return _0x2cc9ba;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0520('0x0'));var rimraf=require(_0x0520('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0520('0x2'));var rp=require('request-promise');var moment=require(_0x0520('0x3'));var BPromise=require(_0x0520('0x4'));var Mustache=require(_0x0520('0x5'));var util=require('util');var path=require(_0x0520('0x6'));var sox=require(_0x0520('0x7'));var csv=require(_0x0520('0x8'));var ejs=require(_0x0520('0x9'));var fs=require('fs');var _=require(_0x0520('0xa'));var squel=require('squel');var crypto=require(_0x0520('0xb'));var jsforce=require(_0x0520('0xc'));var deskjs=require(_0x0520('0xd'));var toCsv=require(_0x0520('0x8'));var querystring=require(_0x0520('0xe'));var Papa=require(_0x0520('0xf'));var Redis=require(_0x0520('0x10'));var authService=require(_0x0520('0x11'));var qs=require(_0x0520('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0520('0x13'))(_0x0520('0x14'));var utils=require(_0x0520('0x15'));var config=require(_0x0520('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x0520('0x17')](config[_0x0520('0x18')],{'host':_0x0520('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0520('0x18')]));require('./openchannelMessage.socket')[_0x0520('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x0520('0x1b')]({'port':0x232c});var client9002=jayson[_0x0520('0x1c')][_0x0520('0x1b')]({'port':0x232a});function checkPasswordPattern(_0xaa50ee,_0x33e24b,_0x34e871){if(_0x34e871){var _0x3f44ad=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3f44ad[_0x0520('0x1d')](_0x33e24b)){return _0xaa50ee;}else{throw new Error(_0x0520('0x1e'));}}else{return _0xaa50ee;}}function respondWithRpcPromise(_0x4fe1f2,_0x1989b0,_0x38884c,_0x2ad314){return new BPromise(function(_0x392da8,_0xa4eedf){var _0x293c13=_0x2ad314||client;return _0x293c13[_0x0520('0x1f')](_0x4fe1f2,_0x38884c)[_0x0520('0x20')](function(_0x4bce36){logger[_0x0520('0x21')](_0x0520('0x22'),_0x1989b0,_0x0520('0x23'));logger[_0x0520('0x24')](_0x0520('0x25'),_0x1989b0,_0x0520('0x23'),JSON[_0x0520('0x26')](_0x4bce36));if(_0x4bce36[_0x0520('0x27')]){if(_0x4bce36[_0x0520('0x27')][_0x0520('0x28')]===0x1f4){logger[_0x0520('0x27')](_0x0520('0x22'),_0x1989b0,_0x4bce36[_0x0520('0x27')]['message']);return _0xa4eedf(_0x4bce36[_0x0520('0x27')][_0x0520('0x29')]);}logger[_0x0520('0x27')](_0x0520('0x22'),_0x1989b0,_0x4bce36[_0x0520('0x27')][_0x0520('0x29')]);return _0x392da8(_0x4bce36[_0x0520('0x27')][_0x0520('0x29')]);}else{logger['info'](_0x0520('0x22'),_0x1989b0,_0x0520('0x23'));_0x392da8(_0x4bce36[_0x0520('0x2a')][_0x0520('0x29')]);}})[_0x0520('0x2b')](function(_0x65cc7b){logger[_0x0520('0x27')](_0x0520('0x22'),_0x1989b0,_0x65cc7b);_0xa4eedf(_0x65cc7b);});});}function respondWithStatusCode(_0x210c0b,_0x420a02){_0x420a02=_0x420a02||0xcc;return function(_0x23b7de){if(_0x23b7de){return _0x210c0b[_0x0520('0x2c')](_0x420a02);}return _0x210c0b[_0x0520('0x2d')](_0x420a02)[_0x0520('0x2e')]();};}function respondWithResult(_0x48f7ad,_0x3ec107){_0x3ec107=_0x3ec107||0xc8;return function(_0x4710a2){if(_0x4710a2){return _0x48f7ad[_0x0520('0x2d')](_0x3ec107)[_0x0520('0x2f')](_0x4710a2);}};}function respondWithFilteredResult(_0x5162fd,_0x3670a1){return function(_0xd2df83){if(_0xd2df83){var _0xf4b0a7=_0xd2df83['count'],_0x2ffeb4=_0x3670a1['offset'],_0x426ed9=_0x3670a1[_0x0520('0x30')]+_0x3670a1[_0x0520('0x31')],_0x589b1e;if(_0x426ed9>=_0xf4b0a7){_0x426ed9=_0xf4b0a7;_0x589b1e=0xc8;}else{_0x589b1e=0xce;}_0x5162fd[_0x0520('0x2d')](_0x589b1e);return _0x5162fd[_0x0520('0x32')](_0x0520('0x33'),_0x2ffeb4+'-'+_0x426ed9+'/'+_0xf4b0a7)['json'](_0xd2df83);}return null;};}function patchUpdates(_0x124fd6){return function(_0x13f55b){try{jsonpatch[_0x0520('0x34')](_0x13f55b,_0x124fd6,!![]);}catch(_0x494fd6){return BPromise['reject'](_0x494fd6);}return _0x13f55b[_0x0520('0x35')]();};}function saveUpdates(_0x14b63b,_0x1618ae){return function(_0x26a998){if(_0x26a998){return _0x26a998[_0x0520('0x36')](_0x14b63b)[_0x0520('0x20')](function(_0xb32969){return _0xb32969;});}return null;};}function removeEntity(_0x2e4820,_0x442391){return function(_0x2d3f5b){if(_0x2d3f5b){return _0x2d3f5b[_0x0520('0x37')]()[_0x0520('0x20')](function(){_0x2e4820['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x117ec0,_0x386d1e){return function(_0x72dec3){if(!_0x72dec3){_0x117ec0['sendStatus'](0x194);}return _0x72dec3;};}function handleError(_0x617045,_0x4f87bd){_0x4f87bd=_0x4f87bd||0x1f4;return function(_0x5f42bf){logger[_0x0520('0x27')](_0x5f42bf[_0x0520('0x38')]);if(_0x5f42bf['name']){delete _0x5f42bf[_0x0520('0x39')];}_0x617045['status'](_0x4f87bd)['send'](_0x5f42bf);};}exports[_0x0520('0x3a')]=function(_0x262715,_0x3dbefc){var _0x55aad2={},_0x3f575a={},_0x1cd736={'count':0x0,'rows':[]};var _0x3f884f=_['map'](db[_0x0520('0x3b')][_0x0520('0x3c')],function(_0x1918b){return{'name':_0x1918b[_0x0520('0x3d')],'type':_0x1918b[_0x0520('0x3e')]['key']};});_0x3f575a[_0x0520('0x3f')]=_[_0x0520('0x40')](_0x3f884f,_0x0520('0x39'));_0x3f575a['query']=_[_0x0520('0x41')](_0x262715[_0x0520('0x42')]);_0x3f575a[_0x0520('0x43')]=_[_0x0520('0x44')](_0x3f575a[_0x0520('0x3f')],_0x3f575a[_0x0520('0x42')]);_0x55aad2['attributes']=_['intersection'](_0x3f575a[_0x0520('0x3f')],qs[_0x0520('0x45')](_0x262715[_0x0520('0x42')][_0x0520('0x45')]));_0x55aad2[_0x0520('0x46')]=_0x55aad2['attributes'][_0x0520('0x47')]?_0x55aad2[_0x0520('0x46')]:_0x3f575a[_0x0520('0x3f')];if(!_0x262715[_0x0520('0x42')][_0x0520('0x48')](_0x0520('0x49'))){_0x55aad2[_0x0520('0x31')]=qs[_0x0520('0x31')](_0x262715['query'][_0x0520('0x31')]);_0x55aad2[_0x0520('0x30')]=qs['offset'](_0x262715[_0x0520('0x42')][_0x0520('0x30')]);}_0x55aad2[_0x0520('0x4a')]=qs[_0x0520('0x4b')](_0x262715[_0x0520('0x42')][_0x0520('0x4b')]);_0x55aad2['where']=qs[_0x0520('0x43')](_[_0x0520('0x4c')](_0x262715[_0x0520('0x42')],_0x3f575a[_0x0520('0x43')]));if(_0x262715[_0x0520('0x42')][_0x0520('0x4d')]){_0x55aad2['where']=_[_0x0520('0x4e')](_0x55aad2[_0x0520('0x4f')],{'$or':_['map'](_0x3f884f,function(_0x25ad58){if(_0x25ad58[_0x0520('0x3e')][_0x0520('0x50')]!=='VIRTUAL'){var _0x28e159={};_0x28e159[_0x25ad58[_0x0520('0x51')]]={'$like':'%'+_0x262715['query'][_0x0520('0x4d')]+'%'};return _0x28e159;}})});}_0x55aad2=_['merge']({},_0x55aad2,_0x262715['options']);var _0x46cc63={'where':_0x55aad2['where']};return db[_0x0520('0x3b')][_0x0520('0x52')](_0x46cc63)[_0x0520('0x20')](function(_0x495891){_0x1cd736[_0x0520('0x52')]=_0x495891;if(_0x262715[_0x0520('0x42')][_0x0520('0x53')]){_0x55aad2['include']=[{'all':!![]}];}return db[_0x0520('0x3b')]['findAll'](_0x55aad2);})[_0x0520('0x20')](function(_0x5e3b0d){_0x1cd736['rows']=_0x5e3b0d;return _0x1cd736;})[_0x0520('0x20')](respondWithFilteredResult(_0x3dbefc,_0x55aad2))[_0x0520('0x2b')](handleError(_0x3dbefc,null));};exports['show']=function(_0x298c80,_0x4161fe){var _0x515088={'raw':!![],'where':{'id':_0x298c80[_0x0520('0x54')]['id']}},_0x11b879={};_0x11b879['model']=_[_0x0520('0x41')](db[_0x0520('0x3b')][_0x0520('0x3c')]);_0x11b879[_0x0520('0x42')]=_[_0x0520('0x41')](_0x298c80[_0x0520('0x42')]);_0x11b879['filters']=_[_0x0520('0x44')](_0x11b879['model'],_0x11b879[_0x0520('0x42')]);_0x515088[_0x0520('0x46')]=_[_0x0520('0x44')](_0x11b879['model'],qs[_0x0520('0x45')](_0x298c80[_0x0520('0x42')]['fields']));_0x515088[_0x0520('0x46')]=_0x515088[_0x0520('0x46')][_0x0520('0x47')]?_0x515088[_0x0520('0x46')]:_0x11b879[_0x0520('0x3f')];if(_0x298c80[_0x0520('0x42')][_0x0520('0x53')]){_0x515088[_0x0520('0x55')]=[{'all':!![]}];}_0x515088=_[_0x0520('0x4e')]({},_0x515088,_0x298c80['options']);return db['OpenchannelMessage'][_0x0520('0x56')](_0x515088)['then'](handleEntityNotFound(_0x4161fe,null))[_0x0520('0x20')](respondWithResult(_0x4161fe,null))[_0x0520('0x2b')](handleError(_0x4161fe,null));};exports[_0x0520('0x57')]=function(_0x343182,_0x48b058){return db[_0x0520('0x3b')][_0x0520('0x57')](_0x343182[_0x0520('0x58')],{})['then'](respondWithResult(_0x48b058,0xc9))[_0x0520('0x2b')](handleError(_0x48b058,null));};exports['update']=function(_0x53fe71,_0x41cb75){if(_0x53fe71['body']['id']){delete _0x53fe71[_0x0520('0x58')]['id'];}return db[_0x0520('0x3b')][_0x0520('0x56')]({'where':{'id':_0x53fe71[_0x0520('0x54')]['id']}})[_0x0520('0x20')](handleEntityNotFound(_0x41cb75,null))['then'](saveUpdates(_0x53fe71['body'],null))[_0x0520('0x20')](respondWithResult(_0x41cb75,null))['catch'](handleError(_0x41cb75,null));};exports[_0x0520('0x37')]=function(_0x2a0047,_0x828581){return db[_0x0520('0x3b')]['find']({'where':{'id':_0x2a0047['params']['id']}})['then'](handleEntityNotFound(_0x828581,null))[_0x0520('0x20')](removeEntity(_0x828581,null))[_0x0520('0x2b')](handleError(_0x828581,null));};exports[_0x0520('0x59')]=function(_0x16d94f,_0x7c3537){return db['OpenchannelMessage'][_0x0520('0x59')]()[_0x0520('0x20')](respondWithResult(_0x7c3537,null))[_0x0520('0x2b')](handleError(_0x7c3537,null));};var interaction_log=require(_0x0520('0x13'))(_0x0520('0x5a'));exports[_0x0520('0x5b')]=function(_0x30015f,_0x46c6a3,_0x1334bf){var _0x422393={'channel':_0x0520('0x5c')};if(_0x30015f['body']['id']){delete _0x30015f[_0x0520('0x58')]['id'];}_0x30015f[_0x0520('0x58')][_0x0520('0x5d')]=!![];_0x30015f[_0x0520('0x58')][_0x0520('0x5e')]=moment()[_0x0520('0x5f')](_0x0520('0x60'));_0x30015f[_0x0520('0x58')][_0x0520('0x61')]=_0x30015f[_0x0520('0x58')][_0x0520('0x61')]||_0x30015f[_0x0520('0x62')]['id'];return db[_0x0520('0x3b')][_0x0520('0x56')]({'where':{'id':_0x30015f['params']['id'],'UserId':null},'include':[{'model':db[_0x0520('0x63')],'as':_0x0520('0x64')}]})['then'](handleEntityNotFound(_0x46c6a3,null))[_0x0520('0x20')](saveUpdates(_0x30015f['body'],null))['then'](function(_0x9c79bc){if(_0x9c79bc){_0x422393[_0x0520('0x29')]=_0x9c79bc[_0x0520('0x65')]({'plain':!![]});return db[_0x0520('0x66')][_0x0520('0x56')]({'where':{'id':_0x9c79bc[_0x0520('0x67')]}});}return null;})[_0x0520('0x20')](handleEntityNotFound(_0x46c6a3,null))['then'](function(_0x3aad5d){if(_0x3aad5d){return _0x3aad5d['update']({'UserId':_0x30015f[_0x0520('0x58')]['UserId'],'read1stAt':_['isNil'](_0x3aad5d[_0x0520('0x68')])?moment()[_0x0520('0x5f')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x0520('0x20')](function(_0x5ae3bb){if(_0x5ae3bb){_0x422393['interaction']=_0x5ae3bb[_0x0520('0x65')]({'plain':!![]});interaction_log[_0x0520('0x21')](_0x0520('0x69'),_0x30015f[_0x0520('0x62')]['id'],_0x30015f[_0x0520('0x62')][_0x0520('0x39')],_0x30015f[_0x0520('0x62')]['role'],_0x422393['interaction']['id'],_0x30015f[_0x0520('0x58')]?JSON[_0x0520('0x26')](_0x30015f[_0x0520('0x58')]):_0x0520('0x6a'));return respondWithRpcPromise(_0x0520('0x6b'),_0x0520('0x6c'),_0x422393);}return null;})[_0x0520('0x20')](function(_0x233079){if(_0x233079){if(_0x30015f[_0x0520('0x58')][_0x0520('0x6d')]){_0x422393['message'][_0x0520('0x6e')]=util[_0x0520('0x5f')](_0x0520('0x6f'),_0x30015f[_0x0520('0x62')]['name']);_0x422393['message'][_0x0520('0x70')]=_0x422393[_0x0520('0x70')];_0x422393['message'][_0x0520('0x71')]='accept';return respondWithRpcPromise(_0x0520('0x72'),_0x0520('0x72'),{'event':_0x0520('0x73'),'message':_0x422393[_0x0520('0x29')]},client9002)[_0x0520('0x20')](function(){return _0x422393;});}return _0x422393;}return null;})['then'](respondWithResult(_0x46c6a3,null))[_0x0520('0x2b')](handleError(_0x46c6a3,null));};var interaction_log=require(_0x0520('0x13'))(_0x0520('0x5a'));exports[_0x0520('0x74')]=function(_0x150696,_0x2a087c,_0x30e676){var _0x222d70={'agent':{},'channel':_0x0520('0x5c')};if(_0x150696['body']['id']){delete _0x150696[_0x0520('0x58')]['id'];}_0x150696[_0x0520('0x58')][_0x0520('0x61')]=_0x150696['body'][_0x0520('0x61')]||_0x150696[_0x0520('0x62')]['id'];_0x222d70['agent']['id']=_0x150696[_0x0520('0x58')]['UserId'];return db['OpenchannelMessage'][_0x0520('0x56')]({'where':{'id':_0x150696[_0x0520('0x54')]['id'],'UserId':null}})[_0x0520('0x20')](handleEntityNotFound(_0x2a087c,null))[_0x0520('0x20')](function(_0x4704dc){if(_0x4704dc){_0x222d70[_0x0520('0x29')]=_0x4704dc[_0x0520('0x65')]({'plain':!![]});return db[_0x0520('0x66')][_0x0520('0x56')]({'where':{'id':_0x4704dc['OpenchannelInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x2a087c,null))[_0x0520('0x20')](function(_0x2f50c7){if(_0x2f50c7){_0x222d70[_0x0520('0x75')]=_0x2f50c7[_0x0520('0x65')]({'plain':!![]});interaction_log[_0x0520('0x21')](_0x0520('0x76'),_0x150696[_0x0520('0x62')]['id'],_0x150696[_0x0520('0x62')][_0x0520('0x39')],_0x150696[_0x0520('0x62')][_0x0520('0x77')],_0x222d70['interaction']['id'],_0x150696[_0x0520('0x58')]?JSON[_0x0520('0x26')](_0x150696[_0x0520('0x58')]):_0x0520('0x6a'));return respondWithRpcPromise(_0x0520('0x78'),_0x0520('0x79'),_0x222d70);}return null;})[_0x0520('0x20')](function(_0xc199){if(_0xc199){_0xc199[_0x0520('0x29')][_0x0520('0x6e')]=util[_0x0520('0x5f')](_0x0520('0x6f'),_0x150696[_0x0520('0x62')][_0x0520('0x39')]);_0xc199[_0x0520('0x29')][_0x0520('0x70')]=_0x222d70[_0x0520('0x70')];_0xc199[_0x0520('0x29')][_0x0520('0x71')]=_0x0520('0x74');respondWithRpcPromise(_0x0520('0x72'),'EventManager',{'event':_0x0520('0x7a'),'message':_0xc199['message']},client9002);return _0x222d70;}return null;})[_0x0520('0x20')](respondWithResult(_0x2a087c,null))[_0x0520('0x2b')](handleError(_0x2a087c,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index e2c98b8..656eab6 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 _0x793d=['OpenchannelMessage','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0xda6ad1,_0x5f09e3){var _0xedc3a5=function(_0x5459d7){while(--_0x5459d7){_0xda6ad1['push'](_0xda6ad1['shift']());}};_0xedc3a5(++_0x5f09e3);}(_0x793d,0x15d));var _0xd793=function(_0x494f2e,_0x33b0b4){_0x494f2e=_0x494f2e-0x0;var _0x532a3c=_0x793d[_0x494f2e];return _0x532a3c;};'use strict';var EventEmitter=require(_0xd793('0x0'));var OpenchannelMessage=require(_0xd793('0x1'))['db'][_0xd793('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd793('0x3'),'afterUpdate':_0xd793('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1e0ada){return function(_0x2fd8d6,_0x52b681,_0x1bdaea){OpenchannelMessageEvents[_0xd793('0x5')](_0x1e0ada+':'+_0x2fd8d6['id'],_0x2fd8d6);OpenchannelMessageEvents[_0xd793('0x5')](_0x1e0ada,_0x2fd8d6);_0x1bdaea(null);};}for(var e in events){if(events[_0xd793('0x6')](e)){var event=events[e];OpenchannelMessage[_0xd793('0x7')](e,emitEvent(event));}}module[_0xd793('0x8')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x9300=['update','remove','emit','hasOwnProperty','hook','exports','events','setMaxListeners','save'];(function(_0x221b8c,_0x2c7afc){var _0x3fab9f=function(_0x28bab0){while(--_0x28bab0){_0x221b8c['push'](_0x221b8c['shift']());}};_0x3fab9f(++_0x2c7afc);}(_0x9300,0x153));var _0x0930=function(_0xdb0316,_0x1699ee){_0xdb0316=_0xdb0316-0x0;var _0xe43c0d=_0x9300[_0xdb0316];return _0xe43c0d;};'use strict';var EventEmitter=require(_0x0930('0x0'));var OpenchannelMessage=require('../../mysqldb')['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x0930('0x1')](0x0);var events={'afterCreate':_0x0930('0x2'),'afterUpdate':_0x0930('0x3'),'afterDestroy':_0x0930('0x4')};function emitEvent(_0x4130f8){return function(_0x49d993,_0x298c01,_0x1a61a6){OpenchannelMessageEvents['emit'](_0x4130f8+':'+_0x49d993['id'],_0x49d993);OpenchannelMessageEvents[_0x0930('0x5')](_0x4130f8,_0x49d993);_0x1a61a6(null);};}for(var e in events){if(events[_0x0930('0x6')](e)){var event=events[e];OpenchannelMessage[_0x0930('0x7')](e,emitEvent(event));}}module[_0x0930('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 7fa29ab..7362d76 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 _0x02c2=['length','omit','Contact','POST','GET','body','Message\x20%d\x20forwarded\x20to\x20%s','threadId','Interaction','catch','error','inspect','finally','utf8mb4','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','FULLTEXT','models','get','toLowerCase','direction','out','secret','isNil','UserId','OpenchannelInteraction','findOne','update','createdAt','CmContact','describe','then','find','OpenchannelAccountId','Interactions','OpenchannelInteractionId','keys','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','replyUri'];(function(_0x362f9b,_0x160259){var _0x520b4b=function(_0x4edf5b){while(--_0x4edf5b){_0x362f9b['push'](_0x362f9b['shift']());}};_0x520b4b(++_0x160259);}(_0x02c2,0x17a));var _0x202c=function(_0x1c7486,_0x5af42b){_0x1c7486=_0x1c7486-0x0;var _0x124122=_0x02c2[_0x1c7486];return _0x124122;};'use strict';var _=require('lodash');var util=require(_0x202c('0x0'));var logger=require(_0x202c('0x1'))('api');var moment=require(_0x202c('0x2'));var BPromise=require('bluebird');var rp=require(_0x202c('0x3'));var fs=require('fs');var path=require(_0x202c('0x4'));var rimraf=require(_0x202c('0x5'));var config=require(_0x202c('0x6'));var attributes=require(_0x202c('0x7'));module[_0x202c('0x8')]=function(_0x168290,_0x42b982){return _0x168290['define'](_0x202c('0x9'),attributes,{'tableName':_0x202c('0xa'),'paranoid':![],'indexes':[{'name':_0x202c('0xb'),'fields':['body'],'type':_0x202c('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x51db17,_0x2f3ab0,_0x1a39d0){var _0x137c24=_0x168290[_0x202c('0xd')];var _0x5d0352=_0x51db17[_0x202c('0xe')]({'plain':!![]});if(_0x5d0352['direction'][_0x202c('0xf')]()==='in'||_0x5d0352[_0x202c('0x10')][_0x202c('0xf')]()===_0x202c('0x11')&&!_0x5d0352[_0x202c('0x12')]&&!_[_0x202c('0x13')](_0x5d0352[_0x202c('0x14')])){_0x137c24[_0x202c('0x15')][_0x202c('0x16')]({'where':{'id':_0x5d0352['OpenchannelInteractionId']}})['then'](function(_0x3b5f67){if(_0x3b5f67){_0x3b5f67[_0x202c('0x17')]({'lastMsgAt':_0x5d0352[_0x202c('0x18')],'lastMsgDirection':_0x5d0352['direction'][_0x202c('0xf')]()});}})['catch'](function(_0x17cf61){console['error'](_0x17cf61);});}if(_0x5d0352[_0x202c('0x10')]===_0x202c('0x11')&&!_0x5d0352['secret']){var _0x3ed158;_0x137c24[_0x202c('0x19')][_0x202c('0x1a')]()[_0x202c('0x1b')](function(_0x46c0d0){return _0x137c24['OpenchannelAccount'][_0x202c('0x1c')]({'where':{'id':_0x5d0352[_0x202c('0x1d')]},'include':[{'model':_0x137c24['OpenchannelInteraction'],'as':_0x202c('0x1e'),'where':{'id':_0x5d0352[_0x202c('0x1f')]},'limit':0x1,'include':[{'model':_0x137c24[_0x202c('0x19')],'as':'Contact','attributes':_[_0x202c('0x20')](_0x46c0d0)}]}]});})[_0x202c('0x1b')](function(_0x5875b0){_0x3ed158=_0x5875b0['get']({'plain':!![]});if(_0x3ed158&&_0x3ed158['replyUri']){logger[_0x202c('0x21')](_0x202c('0x22'),_0x202c('0x23'),util[_0x202c('0x24')]('Forwarding\x20message\x20%d\x20to\x20%s',_0x5d0352['id'],_0x3ed158[_0x202c('0x25')]));if(_0x3ed158[_0x202c('0x1e')]&&_0x3ed158[_0x202c('0x1e')][_0x202c('0x26')]){_0x5d0352['Interaction']=_[_0x202c('0x27')](_0x3ed158[_0x202c('0x1e')][0x0],'Contact');_0x5d0352[_0x202c('0x28')]=_0x3ed158['Interactions'][0x0][_0x202c('0x28')];}var _0x2f3ab0={'method':_0x202c('0x29'),'uri':encodeURI(_0x3ed158[_0x202c('0x25')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x2f3ab0['method']){case _0x202c('0x2a'):_0x2f3ab0['qs']=_0x5d0352;break;case _0x202c('0x29'):_0x2f3ab0[_0x202c('0x2b')]=_0x5d0352;break;}return rp(_0x2f3ab0)[_0x202c('0x1b')](function(_0x1d2892){logger[_0x202c('0x21')]('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util[_0x202c('0x24')](_0x202c('0x2c'),_0x5d0352['id'],_0x3ed158[_0x202c('0x25')]));if(_0x1d2892[_0x202c('0x2b')][_0x202c('0x2d')]&&_0x1d2892[_0x202c('0x2b')][_0x202c('0x2d')]!=_0x5d0352[_0x202c('0x2e')]['threadId']){return _0x137c24[_0x202c('0x15')][_0x202c('0x17')]({'threadId':_0x1d2892[_0x202c('0x2b')][_0x202c('0x2d')]},{'logging':!![],'where':{'id':_0x5d0352[_0x202c('0x2e')]['id']}});}else{return;}})[_0x202c('0x1b')](function(){return _0x51db17[_0x202c('0x17')]({'read':!![]});})[_0x202c('0x2f')](function(_0x2ffef3){logger[_0x202c('0x30')]('OpenchannelMessage,\x20%s,\x20%s',_0x202c('0x23'),util[_0x202c('0x31')](_0x2ffef3,{'showHidden':![],'depth':null}));_0x1a39d0();});}else{_0x1a39d0();}})[_0x202c('0x32')](function(){_0x1a39d0();});}else{_0x1a39d0();}}},'charset':_0x202c('0x33'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x948a=['OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','Interactions','length','Interaction','omit','POST','method','GET','body','Message\x20%d\x20forwarded\x20to\x20%s','threadId','update','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','UserId','OpenchannelInteractionId','then','createdAt','catch','error','out','describe','OpenchannelAccount','find','OpenchannelAccountId','OpenchannelInteraction','CmContact','Contact','keys','replyUri','info'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0x948a,0xbb));var _0xa948=function(_0x247402,_0x301715){_0x247402=_0x247402-0x0;var _0x5b91a9=_0x948a[_0x247402];return _0x5b91a9;};'use strict';var _=require(_0xa948('0x0'));var util=require(_0xa948('0x1'));var logger=require(_0xa948('0x2'))(_0xa948('0x3'));var moment=require(_0xa948('0x4'));var BPromise=require(_0xa948('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa948('0x6'));var rimraf=require('rimraf');var config=require(_0xa948('0x7'));var attributes=require(_0xa948('0x8'));module[_0xa948('0x9')]=function(_0x96c191,_0xb14923){return _0x96c191[_0xa948('0xa')](_0xa948('0xb'),attributes,{'tableName':_0xa948('0xc'),'paranoid':![],'indexes':[{'name':'fti_openchannel_messages','fields':['body'],'type':_0xa948('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x664d11,_0x2aa563,_0x4df8bb){var _0x46ac4d=_0x96c191[_0xa948('0xe')];var _0x5099eb=_0x664d11[_0xa948('0xf')]({'plain':!![]});if(_0x5099eb['direction']['toLowerCase']()==='in'||_0x5099eb[_0xa948('0x10')][_0xa948('0x11')]()==='out'&&!_0x5099eb[_0xa948('0x12')]&&!_[_0xa948('0x13')](_0x5099eb[_0xa948('0x14')])){_0x46ac4d['OpenchannelInteraction']['findOne']({'where':{'id':_0x5099eb[_0xa948('0x15')]}})[_0xa948('0x16')](function(_0x2a7134){if(_0x2a7134){_0x2a7134['update']({'lastMsgAt':_0x5099eb[_0xa948('0x17')],'lastMsgDirection':_0x5099eb[_0xa948('0x10')]['toLowerCase']()});}})[_0xa948('0x18')](function(_0xff2ee7){console[_0xa948('0x19')](_0xff2ee7);});}if(_0x5099eb[_0xa948('0x10')]===_0xa948('0x1a')&&!_0x5099eb['secret']){var _0x50d243;_0x46ac4d['CmContact'][_0xa948('0x1b')]()[_0xa948('0x16')](function(_0x29ba2f){return _0x46ac4d[_0xa948('0x1c')][_0xa948('0x1d')]({'where':{'id':_0x5099eb[_0xa948('0x1e')]},'include':[{'model':_0x46ac4d[_0xa948('0x1f')],'as':'Interactions','where':{'id':_0x5099eb[_0xa948('0x15')]},'limit':0x1,'include':[{'model':_0x46ac4d[_0xa948('0x20')],'as':_0xa948('0x21'),'attributes':_[_0xa948('0x22')](_0x29ba2f)}]}]});})[_0xa948('0x16')](function(_0x5e91e4){_0x50d243=_0x5e91e4[_0xa948('0xf')]({'plain':!![]});if(_0x50d243&&_0x50d243[_0xa948('0x23')]){logger[_0xa948('0x24')](_0xa948('0x25'),_0xa948('0x26'),util[_0xa948('0x27')](_0xa948('0x28'),_0x5099eb['id'],_0x50d243[_0xa948('0x23')]));if(_0x50d243[_0xa948('0x29')]&&_0x50d243[_0xa948('0x29')][_0xa948('0x2a')]){_0x5099eb[_0xa948('0x2b')]=_[_0xa948('0x2c')](_0x50d243[_0xa948('0x29')][0x0],_0xa948('0x21'));_0x5099eb[_0xa948('0x21')]=_0x50d243['Interactions'][0x0]['Contact'];}var _0x2aa563={'method':_0xa948('0x2d'),'uri':encodeURI(_0x50d243[_0xa948('0x23')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x2aa563[_0xa948('0x2e')]){case _0xa948('0x2f'):_0x2aa563['qs']=_0x5099eb;break;case'POST':_0x2aa563[_0xa948('0x30')]=_0x5099eb;break;}return rp(_0x2aa563)[_0xa948('0x16')](function(_0x25e257){logger[_0xa948('0x24')]('OpenchannelMessage,\x20%s,\x20%s',_0xa948('0x26'),util[_0xa948('0x27')](_0xa948('0x31'),_0x5099eb['id'],_0x50d243[_0xa948('0x23')]));if(_0x25e257[_0xa948('0x30')]['threadId']&&_0x25e257[_0xa948('0x30')]['threadId']!=_0x5099eb[_0xa948('0x2b')][_0xa948('0x32')]){return _0x46ac4d[_0xa948('0x1f')][_0xa948('0x33')]({'threadId':_0x25e257['body'][_0xa948('0x32')]},{'logging':!![],'where':{'id':_0x5099eb['Interaction']['id']}});}else{return;}})['then'](function(){return _0x664d11['update']({'read':!![]});})['catch'](function(_0x4e5c84){logger[_0xa948('0x19')](_0xa948('0x25'),'afterCreate',util[_0xa948('0x34')](_0x4e5c84,{'showHidden':![],'depth':null}));_0x4df8bb();});}else{_0x4df8bb();}})[_0xa948('0x35')](function(){_0x4df8bb();});}else{_0x4df8bb();}}},'charset':_0xa948('0x36'),'collate':_0xa948('0x37')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index c59963f..912424d 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 _0xea4e=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','request','then','info','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelMessage,\x20%s,\x20%s','message','result','catch','CreateOpenchannelMessage','body','options','raw','lodash','randomstring'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0xea4e,0x10c));var _0xeea4=function(_0x1a6c7f,_0x5aee3f){_0x1a6c7f=_0x1a6c7f-0x0;var _0x1d378d=_0xea4e[_0x1a6c7f];return _0x1d378d;};'use strict';var _=require(_0xeea4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xeea4('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeea4('0x2'))['db'];var utils=require(_0xeea4('0x3'));var logger=require('../../config/logger')(_0xeea4('0x4'));var config=require(_0xeea4('0x5'));var jayson=require(_0xeea4('0x6'));var client=jayson[_0xeea4('0x7')][_0xeea4('0x8')]({'port':0x232a});config[_0xeea4('0x9')]=_[_0xeea4('0xa')](config[_0xeea4('0x9')],{'host':_0xeea4('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xeea4('0x9')]));require('./openchannelMessage.socket')[_0xeea4('0xc')](socket);function respondWithRpcPromise(_0x114d6e,_0x279b9,_0x367d41){return new BPromise(function(_0x16a077,_0x3f9846){return client[_0xeea4('0xd')](_0x114d6e,_0x367d41)[_0xeea4('0xe')](function(_0x48a0db){logger[_0xeea4('0xf')]('OpenchannelMessage,\x20%s,\x20%s',_0x279b9,_0xeea4('0x10'));logger[_0xeea4('0x11')](_0xeea4('0x12'),_0x279b9,_0xeea4('0x10'),JSON[_0xeea4('0x13')](_0x48a0db));if(_0x48a0db[_0xeea4('0x14')]){if(_0x48a0db[_0xeea4('0x14')][_0xeea4('0x15')]===0x1f4){logger['error'](_0xeea4('0x16'),_0x279b9,_0x48a0db[_0xeea4('0x14')]['message']);return _0x3f9846(_0x48a0db[_0xeea4('0x14')]['message']);}logger[_0xeea4('0x14')](_0xeea4('0x16'),_0x279b9,_0x48a0db[_0xeea4('0x14')][_0xeea4('0x17')]);return _0x16a077(_0x48a0db[_0xeea4('0x14')][_0xeea4('0x17')]);}else{logger[_0xeea4('0xf')](_0xeea4('0x16'),_0x279b9,_0xeea4('0x10'));_0x16a077(_0x48a0db[_0xeea4('0x18')]['message']);}})[_0xeea4('0x19')](function(_0x8e29fb){logger['error'](_0xeea4('0x16'),_0x279b9,_0x8e29fb);_0x3f9846(_0x8e29fb);});});}exports[_0xeea4('0x1a')]=function(_0x4c039c){var _0x23ef6a=this;return new Promise(function(_0x53a734,_0x3f7316){return db['OpenchannelMessage']['create'](_0x4c039c[_0xeea4('0x1b')],{'raw':_0x4c039c['options']?_0x4c039c[_0xeea4('0x1c')][_0xeea4('0x1d')]===undefined?!![]:![]:!![]})[_0xeea4('0xe')](function(_0x19b2a8){logger[_0xeea4('0xf')]('CreateOpenchannelMessage',_0x4c039c);logger[_0xeea4('0x11')](_0xeea4('0x1a'),_0x4c039c,JSON[_0xeea4('0x13')](_0x19b2a8));_0x53a734(_0x19b2a8);})[_0xeea4('0x19')](function(_0x498933){logger[_0xeea4('0x14')](_0xeea4('0x1a'),_0x498933[_0xeea4('0x17')],_0x4c039c);_0x3f7316(_0x23ef6a[_0xeea4('0x14')](0x1f4,_0x498933['message']));});});}; \ No newline at end of file +var _0x3588=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','socket.io-emitter','./openchannelMessage.socket','register','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateOpenchannelMessage','OpenchannelMessage','create','body','raw','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x4ae459,_0x3bf329){var _0x51d0c9=function(_0x1ce66b){while(--_0x1ce66b){_0x4ae459['push'](_0x4ae459['shift']());}};_0x51d0c9(++_0x3bf329);}(_0x3588,0x82));var _0x8358=function(_0x5989e9,_0xef6905){_0x5989e9=_0x5989e9-0x0;var _0xac49f2=_0x3588[_0x5989e9];return _0xac49f2;};'use strict';var _=require(_0x8358('0x0'));var util=require(_0x8358('0x1'));var moment=require(_0x8358('0x2'));var BPromise=require(_0x8358('0x3'));var rs=require(_0x8358('0x4'));var fs=require('fs');var Redis=require(_0x8358('0x5'));var db=require(_0x8358('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x8358('0x7'))(_0x8358('0x8'));var config=require(_0x8358('0x9'));var jayson=require(_0x8358('0xa'));var client=jayson['client'][_0x8358('0xb')]({'port':0x232a});config[_0x8358('0xc')]=_['defaults'](config[_0x8358('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x8358('0xd'))(new Redis(config[_0x8358('0xc')]));require(_0x8358('0xe'))[_0x8358('0xf')](socket);function respondWithRpcPromise(_0x5e083f,_0xa70bd2,_0x577748){return new BPromise(function(_0x398ab0,_0x3a0bd9){return client[_0x8358('0x10')](_0x5e083f,_0x577748)[_0x8358('0x11')](function(_0x12fd8f){logger[_0x8358('0x12')](_0x8358('0x13'),_0xa70bd2,_0x8358('0x14'));logger[_0x8358('0x15')](_0x8358('0x16'),_0xa70bd2,_0x8358('0x14'),JSON[_0x8358('0x17')](_0x12fd8f));if(_0x12fd8f[_0x8358('0x18')]){if(_0x12fd8f[_0x8358('0x18')][_0x8358('0x19')]===0x1f4){logger[_0x8358('0x18')]('OpenchannelMessage,\x20%s,\x20%s',_0xa70bd2,_0x12fd8f['error'][_0x8358('0x1a')]);return _0x3a0bd9(_0x12fd8f['error'][_0x8358('0x1a')]);}logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0xa70bd2,_0x12fd8f['error'][_0x8358('0x1a')]);return _0x398ab0(_0x12fd8f[_0x8358('0x18')][_0x8358('0x1a')]);}else{logger[_0x8358('0x12')](_0x8358('0x13'),_0xa70bd2,_0x8358('0x14'));_0x398ab0(_0x12fd8f[_0x8358('0x1b')]['message']);}})[_0x8358('0x1c')](function(_0x3f2701){logger['error'](_0x8358('0x13'),_0xa70bd2,_0x3f2701);_0x3a0bd9(_0x3f2701);});});}exports[_0x8358('0x1d')]=function(_0x1ab119){var _0x1a0e1a=this;return new Promise(function(_0x4a9296,_0x56d435){return db[_0x8358('0x1e')][_0x8358('0x1f')](_0x1ab119[_0x8358('0x20')],{'raw':_0x1ab119['options']?_0x1ab119['options'][_0x8358('0x21')]===undefined?!![]:![]:!![]})['then'](function(_0x218537){logger[_0x8358('0x12')](_0x8358('0x1d'),_0x1ab119);logger[_0x8358('0x15')](_0x8358('0x1d'),_0x1ab119,JSON[_0x8358('0x17')](_0x218537));_0x4a9296(_0x218537);})[_0x8358('0x1c')](function(_0x4c457b){logger[_0x8358('0x18')]('CreateOpenchannelMessage',_0x4c457b[_0x8358('0x1a')],_0x1ab119);_0x56d435(_0x1a0e1a['error'](0x1f4,_0x4c457b[_0x8358('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 9d2dde4..bdf3289 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 _0x0713=['removeListener','register','length','openchannelMessage:','remove','update'];(function(_0x22b68a,_0x2bffc3){var _0x1ac67a=function(_0x25f9d5){while(--_0x25f9d5){_0x22b68a['push'](_0x22b68a['shift']());}};_0x1ac67a(++_0x2bffc3);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=['save',_0x3071('0x0'),_0x3071('0x1')];function createListener(_0x27405a,_0x305d85){return function(_0x864539){_0x305d85['emit'](_0x27405a,_0x864539);};}function removeListener(_0x2c547f,_0x7b18a4){return function(){OpenchannelMessageEvents[_0x3071('0x2')](_0x2c547f,_0x7b18a4);};}exports[_0x3071('0x3')]=function(_0xabd7b6){for(var _0x41cf76=0x0,_0x1d3dd6=events[_0x3071('0x4')];_0x41cf76<_0x1d3dd6;_0x41cf76++){var _0xbd737f=events[_0x41cf76];var _0x22274c=createListener(_0x3071('0x5')+_0xbd737f,_0xabd7b6);OpenchannelMessageEvents['on'](_0xbd737f,_0x22274c);}}; \ No newline at end of file +var _0x9c44=['emit','removeListener','length','openchannelMessage:','remove','update'];(function(_0x4d8885,_0x4f5f7c){var _0xda232c=function(_0x1e8aa3){while(--_0x1e8aa3){_0x4d8885['push'](_0x4d8885['shift']());}};_0xda232c(++_0x4f5f7c);}(_0x9c44,0x178));var _0x49c4=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x9c44[_0x1d1779];return _0x2377e9;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=['save',_0x49c4('0x0'),_0x49c4('0x1')];function createListener(_0x26844b,_0x1ba0bb){return function(_0x455700){_0x1ba0bb[_0x49c4('0x2')](_0x26844b,_0x455700);};}function removeListener(_0x4e0313,_0x4941f1){return function(){OpenchannelMessageEvents[_0x49c4('0x3')](_0x4e0313,_0x4941f1);};}exports['register']=function(_0xc1278f){for(var _0x6030ae=0x0,_0x69bc41=events[_0x49c4('0x4')];_0x6030ae<_0x69bc41;_0x6030ae++){var _0x436234=events[_0x6030ae];var _0x511d53=createListener(_0x49c4('0x5')+_0x436234,_0xc1278f);OpenchannelMessageEvents['on'](_0x436234,_0x511d53);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 324bfdb..4dcf44c 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 _0xc21c=['../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/teams','/:id/users','getAgents','create','post','addAgents','put','destroy','delete','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x19d73f,_0x1a1196){var _0x4c56aa=function(_0x3b35a4){while(--_0x3b35a4){_0x19d73f['push'](_0x19d73f['shift']());}};_0x4c56aa(++_0x1a1196);}(_0xc21c,0x166));var _0xcc21=function(_0xaed07a,_0x2a5aba){_0xaed07a=_0xaed07a-0x0;var _0x382831=_0xc21c[_0xaed07a];return _0x382831;};'use strict';var multer=require(_0xcc21('0x0'));var util=require(_0xcc21('0x1'));var path=require('path');var timeout=require(_0xcc21('0x2'));var express=require(_0xcc21('0x3'));var router=express[_0xcc21('0x4')]();var auth=require(_0xcc21('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xcc21('0x6'));var controller=require(_0xcc21('0x7'));router[_0xcc21('0x8')]('/',auth[_0xcc21('0x9')](),controller[_0xcc21('0xa')]);router[_0xcc21('0x8')](_0xcc21('0xb'),auth['isAuthenticated'](),controller[_0xcc21('0xc')]);router[_0xcc21('0x8')](_0xcc21('0xd'),auth[_0xcc21('0x9')](),controller['show']);router[_0xcc21('0x8')]('/:id/members',auth[_0xcc21('0x9')](),controller['getMembers']);router[_0xcc21('0x8')](_0xcc21('0xe'),auth['isAuthenticated'](),controller['getTeams']);router[_0xcc21('0x8')](_0xcc21('0xf'),auth['isAuthenticated'](),controller[_0xcc21('0x10')]);router['post']('/',auth[_0xcc21('0x9')](),controller[_0xcc21('0x11')]);router[_0xcc21('0x12')]('/:id/teams',auth[_0xcc21('0x9')](),controller['addTeams']);router[_0xcc21('0x12')](_0xcc21('0xf'),auth[_0xcc21('0x9')](),controller[_0xcc21('0x13')]);router[_0xcc21('0x14')](_0xcc21('0xd'),auth[_0xcc21('0x9')](),controller['update']);router['delete'](_0xcc21('0xd'),auth['isAuthenticated'](),controller[_0xcc21('0x15')]);router[_0xcc21('0x16')](_0xcc21('0xe'),auth[_0xcc21('0x9')](),controller[_0xcc21('0x17')]);router['delete'](_0xcc21('0xf'),auth[_0xcc21('0x9')](),controller[_0xcc21('0x18')]);module[_0xcc21('0x19')]=router; \ No newline at end of file +var _0x63f2=['update','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','/:id','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','/:id/teams','addTeams','put'];(function(_0x56c779,_0x1b33f4){var _0x19e676=function(_0x2fac4f){while(--_0x2fac4f){_0x56c779['push'](_0x56c779['shift']());}};_0x19e676(++_0x1b33f4);}(_0x63f2,0x19b));var _0x263f=function(_0x19bf75,_0x48710a){_0x19bf75=_0x19bf75-0x0;var _0x57d392=_0x63f2[_0x19bf75];return _0x57d392;};'use strict';var multer=require(_0x263f('0x0'));var util=require(_0x263f('0x1'));var path=require(_0x263f('0x2'));var timeout=require(_0x263f('0x3'));var express=require(_0x263f('0x4'));var router=express[_0x263f('0x5')]();var auth=require(_0x263f('0x6'));var interaction=require(_0x263f('0x7'));var config=require(_0x263f('0x8'));var controller=require('./openchannelQueue.controller');router[_0x263f('0x9')]('/',auth[_0x263f('0xa')](),controller['index']);router[_0x263f('0x9')](_0x263f('0xb'),auth[_0x263f('0xa')](),controller['describe']);router[_0x263f('0x9')](_0x263f('0xc'),auth[_0x263f('0xa')](),controller[_0x263f('0xd')]);router[_0x263f('0x9')](_0x263f('0xe'),auth['isAuthenticated'](),controller[_0x263f('0xf')]);router[_0x263f('0x9')]('/:id/teams',auth[_0x263f('0xa')](),controller[_0x263f('0x10')]);router[_0x263f('0x9')](_0x263f('0x11'),auth[_0x263f('0xa')](),controller[_0x263f('0x12')]);router[_0x263f('0x13')]('/',auth[_0x263f('0xa')](),controller[_0x263f('0x14')]);router['post'](_0x263f('0x15'),auth[_0x263f('0xa')](),controller[_0x263f('0x16')]);router[_0x263f('0x13')]('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x263f('0x17')](_0x263f('0xc'),auth['isAuthenticated'](),controller[_0x263f('0x18')]);router[_0x263f('0x19')](_0x263f('0xc'),auth[_0x263f('0xa')](),controller['destroy']);router[_0x263f('0x19')](_0x263f('0x15'),auth[_0x263f('0xa')](),controller[_0x263f('0x1a')]);router['delete'](_0x263f('0x11'),auth[_0x263f('0xa')](),controller[_0x263f('0x1b')]);module[_0x263f('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 fa1ad98..03b1dda 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 _0xfca0=['roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x1a3f92,_0x3d443f){var _0x272cd2=function(_0x3303d3){while(--_0x3303d3){_0x1a3f92['push'](_0x1a3f92['shift']());}};_0x272cd2(++_0x3d443f);}(_0xfca0,0x171));var _0x0fca=function(_0x48db8c,_0x4a1555){_0x48db8c=_0x48db8c-0x0;var _0x232929=_0xfca0[_0x48db8c];return _0x232929;};'use strict';var Sequelize=require(_0x0fca('0x0'));module[_0x0fca('0x1')]={'name':{'type':Sequelize[_0x0fca('0x2')],'unique':_0x0fca('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x0fca('0x2')]},'timeout':{'type':Sequelize[_0x0fca('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0fca('0x5')](_0x0fca('0x6'),'beepall',_0x0fca('0x7'))}}; \ No newline at end of file +var _0x6a95=['exports','STRING','name','INTEGER','ENUM','roundrobin','sequelize'];(function(_0x1446fc,_0x13d287){var _0x184ce1=function(_0x607563){while(--_0x607563){_0x1446fc['push'](_0x1446fc['shift']());}};_0x184ce1(++_0x13d287);}(_0x6a95,0x1db));var _0x56a9=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x6a95[_0x30ae5e];return _0x1f2e93;};'use strict';var Sequelize=require(_0x56a9('0x0'));module[_0x56a9('0x1')]={'name':{'type':Sequelize[_0x56a9('0x2')],'unique':_0x56a9('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x56a9('0x2')]},'timeout':{'type':Sequelize[_0x56a9('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x56a9('0x5')]('rrmemory','beepall',_0x56a9('0x6'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index f6205b5..8e40082 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 _0xaef3=['key','model','keys','query','attributes','intersection','fields','length','nolimit','limit','offset','order','sort','where','filters','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','rawAttributes','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','hasOwnProperty','pick','OpenchannelQueueId','UserOpenchannelQueue','User','UserId','agent','openchannelPause','updatedAt','createdAt','format','%s/%s','getTeams','Team','addTeams','Agents','online','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','ids','select','field','tq.TeamId','from','team_has_openchannel_queues','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','union','value','isEmpty','removeAgents','addAgents','omit','spread','userOpenchannelQueue:remove','getAgents','html-pdf','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','count','set','Content-Range','json','update','then','destroy','get','OpenchannelQueues','UserProfileResource','end','error','stack','name','send','map','OpenchannelQueue','type'];(function(_0x5847dd,_0x37a90c){var _0x389f15=function(_0x329e9d){while(--_0x329e9d){_0x5847dd['push'](_0x5847dd['shift']());}};_0x389f15(++_0x37a90c);}(_0xaef3,0x16b));var _0x3aef=function(_0x100682,_0x11afec){_0x100682=_0x100682-0x0;var _0xcb6e87=_0xaef3[_0x100682];return _0xcb6e87;};'use strict';var pdf=require(_0x3aef('0x0'));var emlformat=require(_0x3aef('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3aef('0x2'));var rp=require('request-promise');var moment=require(_0x3aef('0x3'));var BPromise=require(_0x3aef('0x4'));var Mustache=require(_0x3aef('0x5'));var util=require(_0x3aef('0x6'));var path=require(_0x3aef('0x7'));var sox=require(_0x3aef('0x8'));var csv=require(_0x3aef('0x9'));var ejs=require(_0x3aef('0xa'));var fs=require('fs');var _=require(_0x3aef('0xb'));var squel=require('squel');var crypto=require(_0x3aef('0xc'));var jsforce=require(_0x3aef('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3aef('0xe'));var Redis=require(_0x3aef('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x3aef('0x10'));var as=require(_0x3aef('0x11'));var hardwareService=require(_0x3aef('0x12'));var logger=require(_0x3aef('0x13'))(_0x3aef('0x14'));var utils=require('../../config/utils');var config=require(_0x3aef('0x15'));var db=require('../../mysqldb')['db'];config[_0x3aef('0x16')]=_[_0x3aef('0x17')](config['redis'],{'host':_0x3aef('0x18'),'port':0x18eb});var socket=require(_0x3aef('0x19'))(new Redis(config[_0x3aef('0x16')]));require(_0x3aef('0x1a'))[_0x3aef('0x1b')](socket);function respondWithStatusCode(_0x35949e,_0x331b49){_0x331b49=_0x331b49||0xcc;return function(_0xddee57){if(_0xddee57){return _0x35949e[_0x3aef('0x1c')](_0x331b49);}return _0x35949e[_0x3aef('0x1d')](_0x331b49)['end']();};}function respondWithResult(_0x17a2ca,_0x52fed7){_0x52fed7=_0x52fed7||0xc8;return function(_0x38a338){if(_0x38a338){return _0x17a2ca['status'](_0x52fed7)['json'](_0x38a338);}};}function respondWithFilteredResult(_0x54c455,_0x23b4a3){return function(_0x54aa31){if(_0x54aa31){var _0x2bfad2=_0x54aa31[_0x3aef('0x1e')],_0x1c2f89=_0x23b4a3['offset'],_0x3a68b5=_0x23b4a3['offset']+_0x23b4a3['limit'],_0x2a2aa9;if(_0x3a68b5>=_0x2bfad2){_0x3a68b5=_0x2bfad2;_0x2a2aa9=0xc8;}else{_0x2a2aa9=0xce;}_0x54c455[_0x3aef('0x1d')](_0x2a2aa9);return _0x54c455[_0x3aef('0x1f')](_0x3aef('0x20'),_0x1c2f89+'-'+_0x3a68b5+'/'+_0x2bfad2)[_0x3aef('0x21')](_0x54aa31);}return null;};}function patchUpdates(_0x243c35){return function(_0x3e36ca){try{jsonpatch['apply'](_0x3e36ca,_0x243c35,!![]);}catch(_0x1dccc3){return BPromise['reject'](_0x1dccc3);}return _0x3e36ca['save']();};}function saveUpdates(_0x529d3c,_0x246cb5){return function(_0xb5f7fa){if(_0xb5f7fa){return _0xb5f7fa[_0x3aef('0x22')](_0x529d3c)[_0x3aef('0x23')](function(_0x16b0b1){return _0x16b0b1;});}return null;};}function removeEntity(_0x20197a,_0x1d6cf5){return function(_0x4b283a){if(_0x4b283a){return _0x4b283a[_0x3aef('0x24')]()[_0x3aef('0x23')](function(){var _0x465d89=_0x4b283a[_0x3aef('0x25')]({'plain':!![]});var _0x3fdeec=_0x3aef('0x26');return db[_0x3aef('0x27')][_0x3aef('0x24')]({'where':{'type':_0x3fdeec,'resourceId':_0x465d89['id']}})['then'](function(){return _0x4b283a;});})['then'](function(){_0x20197a['status'](0xcc)[_0x3aef('0x28')]();});}};}function handleEntityNotFound(_0x5a6ba7,_0x1edde7){return function(_0x1b4833){if(!_0x1b4833){_0x5a6ba7[_0x3aef('0x1c')](0x194);}return _0x1b4833;};}function handleError(_0x28e144,_0xa69b6c){_0xa69b6c=_0xa69b6c||0x1f4;return function(_0xcf2ba5){logger[_0x3aef('0x29')](_0xcf2ba5[_0x3aef('0x2a')]);if(_0xcf2ba5['name']){delete _0xcf2ba5[_0x3aef('0x2b')];}_0x28e144[_0x3aef('0x1d')](_0xa69b6c)[_0x3aef('0x2c')](_0xcf2ba5);};}exports['index']=function(_0x1a0cc9,_0x458839){var _0x5ea67f={},_0x5be0c2={},_0x47b301={'count':0x0,'rows':[]};var _0x2a383f=_[_0x3aef('0x2d')](db[_0x3aef('0x2e')]['rawAttributes'],function(_0x320967){return{'name':_0x320967['fieldName'],'type':_0x320967[_0x3aef('0x2f')][_0x3aef('0x30')]};});_0x5be0c2[_0x3aef('0x31')]=_[_0x3aef('0x2d')](_0x2a383f,_0x3aef('0x2b'));_0x5be0c2['query']=_[_0x3aef('0x32')](_0x1a0cc9[_0x3aef('0x33')]);_0x5be0c2['filters']=_['intersection'](_0x5be0c2[_0x3aef('0x31')],_0x5be0c2[_0x3aef('0x33')]);_0x5ea67f[_0x3aef('0x34')]=_[_0x3aef('0x35')](_0x5be0c2[_0x3aef('0x31')],qs[_0x3aef('0x36')](_0x1a0cc9['query'][_0x3aef('0x36')]));_0x5ea67f['attributes']=_0x5ea67f[_0x3aef('0x34')][_0x3aef('0x37')]?_0x5ea67f[_0x3aef('0x34')]:_0x5be0c2[_0x3aef('0x31')];if(!_0x1a0cc9['query']['hasOwnProperty'](_0x3aef('0x38'))){_0x5ea67f['limit']=qs[_0x3aef('0x39')](_0x1a0cc9[_0x3aef('0x33')][_0x3aef('0x39')]);_0x5ea67f['offset']=qs['offset'](_0x1a0cc9[_0x3aef('0x33')][_0x3aef('0x3a')]);}_0x5ea67f[_0x3aef('0x3b')]=qs[_0x3aef('0x3c')](_0x1a0cc9[_0x3aef('0x33')][_0x3aef('0x3c')]);_0x5ea67f[_0x3aef('0x3d')]=qs['filters'](_['pick'](_0x1a0cc9[_0x3aef('0x33')],_0x5be0c2[_0x3aef('0x3e')]));if(_0x1a0cc9['query'][_0x3aef('0x3f')]){_0x5ea67f[_0x3aef('0x3d')]=_[_0x3aef('0x40')](_0x5ea67f['where'],{'$or':_[_0x3aef('0x2d')](_0x2a383f,function(_0x56973a){if(_0x56973a[_0x3aef('0x2f')][_0x3aef('0x30')]!==_0x3aef('0x41')){var _0x20a9b8={};_0x20a9b8[_0x56973a['field']]={'$like':'%'+_0x1a0cc9[_0x3aef('0x33')][_0x3aef('0x3f')]+'%'};return _0x20a9b8;}})});}_0x5ea67f=_[_0x3aef('0x40')]({},_0x5ea67f,_0x1a0cc9[_0x3aef('0x42')]);var _0x111182={'where':_0x5ea67f[_0x3aef('0x3d')]};return db[_0x3aef('0x2e')]['count'](_0x111182)[_0x3aef('0x23')](function(_0x189d14){_0x47b301['count']=_0x189d14;if(_0x1a0cc9[_0x3aef('0x33')]['includeAll']){_0x5ea67f[_0x3aef('0x43')]=[{'all':!![]}];}return db[_0x3aef('0x2e')][_0x3aef('0x44')](_0x5ea67f);})[_0x3aef('0x23')](function(_0x1157d1){_0x47b301[_0x3aef('0x45')]=_0x1157d1;return _0x47b301;})[_0x3aef('0x23')](respondWithFilteredResult(_0x458839,_0x5ea67f))['catch'](handleError(_0x458839,null));};exports[_0x3aef('0x46')]=function(_0x45b846,_0x51831c){var _0x2a772e={'raw':!![],'where':{'id':_0x45b846[_0x3aef('0x47')]['id']}},_0x32dc43={};_0x32dc43[_0x3aef('0x31')]=_[_0x3aef('0x32')](db['OpenchannelQueue'][_0x3aef('0x48')]);_0x32dc43['query']=_[_0x3aef('0x32')](_0x45b846[_0x3aef('0x33')]);_0x32dc43[_0x3aef('0x3e')]=_['intersection'](_0x32dc43[_0x3aef('0x31')],_0x32dc43[_0x3aef('0x33')]);_0x2a772e['attributes']=_[_0x3aef('0x35')](_0x32dc43['model'],qs[_0x3aef('0x36')](_0x45b846[_0x3aef('0x33')]['fields']));_0x2a772e[_0x3aef('0x34')]=_0x2a772e[_0x3aef('0x34')]['length']?_0x2a772e['attributes']:_0x32dc43['model'];if(_0x45b846[_0x3aef('0x33')][_0x3aef('0x49')]){_0x2a772e[_0x3aef('0x43')]=[{'all':!![]}];}_0x2a772e=_[_0x3aef('0x40')]({},_0x2a772e,_0x45b846[_0x3aef('0x42')]);return db[_0x3aef('0x2e')][_0x3aef('0x4a')](_0x2a772e)[_0x3aef('0x23')](handleEntityNotFound(_0x51831c,null))['then'](respondWithResult(_0x51831c,null))['catch'](handleError(_0x51831c,null));};exports[_0x3aef('0x4b')]=function(_0x501f20,_0x1ae8e2){return db[_0x3aef('0x2e')][_0x3aef('0x4b')](_0x501f20[_0x3aef('0x4c')],{})[_0x3aef('0x23')](function(_0x48a9d4){var _0x347122=_0x501f20[_0x3aef('0x4d')]['get']({'plain':!![]});if(!_0x347122)throw new Error(_0x3aef('0x4e'));if(_0x347122[_0x3aef('0x4f')]==='user'){var _0x381c26=_0x48a9d4[_0x3aef('0x25')]({'plain':!![]});var _0x7a4c05=_0x3aef('0x26');return db['UserProfileSection'][_0x3aef('0x4a')]({'where':{'name':_0x7a4c05,'userProfileId':_0x347122['userProfileId']},'raw':!![]})['then'](function(_0x4f9c4d){if(_0x4f9c4d&&_0x4f9c4d[_0x3aef('0x50')]===0x0){return db[_0x3aef('0x27')]['create']({'name':_0x381c26[_0x3aef('0x2b')],'resourceId':_0x381c26['id'],'type':_0x4f9c4d['name'],'sectionId':_0x4f9c4d['id']},{})[_0x3aef('0x23')](function(){return _0x48a9d4;});}else{return _0x48a9d4;}})[_0x3aef('0x51')](function(_0x2a3110){logger['error'](_0x3aef('0x52'),_0x2a3110);throw _0x2a3110;});}return _0x48a9d4;})['then'](respondWithResult(_0x1ae8e2,0xc9))[_0x3aef('0x51')](handleError(_0x1ae8e2,null));};exports['update']=function(_0x4ef392,_0x24c8ca){if(_0x4ef392[_0x3aef('0x4c')]['id']){delete _0x4ef392[_0x3aef('0x4c')]['id'];}return db['OpenchannelQueue'][_0x3aef('0x4a')]({'where':{'id':_0x4ef392[_0x3aef('0x47')]['id']}})[_0x3aef('0x23')](handleEntityNotFound(_0x24c8ca,null))[_0x3aef('0x23')](saveUpdates(_0x4ef392['body'],null))[_0x3aef('0x23')](respondWithResult(_0x24c8ca,null))['catch'](handleError(_0x24c8ca,null));};exports[_0x3aef('0x24')]=function(_0x1c8635,_0x352f74){return db[_0x3aef('0x2e')][_0x3aef('0x4a')]({'where':{'id':_0x1c8635[_0x3aef('0x47')]['id']}})[_0x3aef('0x23')](handleEntityNotFound(_0x352f74,null))[_0x3aef('0x23')](removeEntity(_0x352f74,null))[_0x3aef('0x51')](handleError(_0x352f74,null));};exports[_0x3aef('0x53')]=function(_0x5673af,_0x1785bd){return db[_0x3aef('0x2e')][_0x3aef('0x53')]()[_0x3aef('0x23')](respondWithResult(_0x1785bd,null))[_0x3aef('0x51')](handleError(_0x1785bd,null));};exports[_0x3aef('0x54')]=function(_0x4103e8,_0x3e0665,_0x142038){var _0x201dd6={'raw':!![],'where':{}},_0x3a21f2={},_0x1be43d;return db[_0x3aef('0x2e')][_0x3aef('0x55')]({'where':{'id':_0x4103e8['params']['id']}})[_0x3aef('0x23')](handleEntityNotFound(_0x3e0665,null))[_0x3aef('0x23')](function(_0x7f77b1){if(_0x7f77b1){_0x1be43d=_0x7f77b1[_0x3aef('0x25')]({'plain':!![]});_0x3a21f2['model']=_['keys'](db['UserOpenchannelQueue'][_0x3aef('0x48')]);_0x3a21f2[_0x3aef('0x33')]=_[_0x3aef('0x32')](_0x4103e8[_0x3aef('0x33')]);_0x3a21f2[_0x3aef('0x3e')]=_[_0x3aef('0x35')](_0x3a21f2[_0x3aef('0x31')],_0x3a21f2[_0x3aef('0x33')]);_0x201dd6[_0x3aef('0x34')]=_[_0x3aef('0x35')](_0x3a21f2[_0x3aef('0x31')],qs[_0x3aef('0x36')](_0x4103e8[_0x3aef('0x33')][_0x3aef('0x36')]));_0x201dd6[_0x3aef('0x34')]=_0x201dd6[_0x3aef('0x34')][_0x3aef('0x37')]?_0x201dd6['attributes']:_0x3a21f2[_0x3aef('0x31')];if(!_0x4103e8[_0x3aef('0x33')][_0x3aef('0x56')]('nolimit')){_0x201dd6[_0x3aef('0x39')]=qs[_0x3aef('0x39')](_0x4103e8[_0x3aef('0x33')][_0x3aef('0x39')]);_0x201dd6[_0x3aef('0x3a')]=qs['offset'](_0x4103e8[_0x3aef('0x33')][_0x3aef('0x3a')]);}_0x201dd6[_0x3aef('0x3b')]=qs[_0x3aef('0x3c')](_0x4103e8[_0x3aef('0x33')][_0x3aef('0x3c')]);_0x201dd6[_0x3aef('0x3d')]=qs[_0x3aef('0x3e')](_[_0x3aef('0x57')](_0x4103e8[_0x3aef('0x33')],_0x3a21f2[_0x3aef('0x3e')]));_0x201dd6['where'][_0x3aef('0x58')]=_0x7f77b1['id'];if(_0x4103e8[_0x3aef('0x33')][_0x3aef('0x3f')]){_0x201dd6['where']=_[_0x3aef('0x40')](_0x201dd6[_0x3aef('0x3d')],{'$or':_['map'](_0x201dd6[_0x3aef('0x34')],function(_0x7ae913){var _0xdd8397={};_0xdd8397[_0x7ae913]={'$like':'%'+_0x4103e8[_0x3aef('0x33')][_0x3aef('0x3f')]+'%'};return _0xdd8397;})});}_0x201dd6=_[_0x3aef('0x40')]({},_0x201dd6,_0x4103e8[_0x3aef('0x42')]);return db[_0x3aef('0x59')]['findAll'](_0x201dd6);}})[_0x3aef('0x23')](function(_0x48daa1){if(_0x48daa1){return db[_0x3aef('0x5a')]['findAndCountAll']({'where':{'id':_[_0x3aef('0x2d')](_0x48daa1,_0x3aef('0x5b')),'role':_0x3aef('0x5c')},'attributes':['id',_0x3aef('0x2b'),_0x3aef('0x5d'),_0x3aef('0x5e'),_0x3aef('0x5f')]});}})[_0x3aef('0x23')](function(_0x157f83){if(_0x157f83){return{'count':_0x157f83[_0x3aef('0x1e')],'rows':_['map'](_0x157f83[_0x3aef('0x45')],function(_0xc26e7b){return{'membername':_0xc26e7b[_0x3aef('0x2b')],'UserId':_0xc26e7b['id'],'queue_name':_0x1be43d[_0x3aef('0x2b')],'OpenchannelQueueId':_0x1be43d['id'],'interface':util[_0x3aef('0x60')](_0x3aef('0x61'),'SIP',_0xc26e7b[_0x3aef('0x2b')]),'penalty':0x0,'paused':_0xc26e7b['openchannelPause'],'createdAt':_0xc26e7b[_0x3aef('0x5f')],'updatedAt':_0xc26e7b[_0x3aef('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x3aef('0x23')](respondWithFilteredResult(_0x3e0665,_0x201dd6))[_0x3aef('0x51')](handleError(_0x3e0665,null));};exports[_0x3aef('0x62')]=function(_0x209732,_0x1ef1c9,_0x58773b){var _0x156a74={};var _0x3b8e40={};var _0x35455e;var _0x429176;return db[_0x3aef('0x2e')][_0x3aef('0x55')]({'where':{'id':_0x209732[_0x3aef('0x47')]['id']}})[_0x3aef('0x23')](handleEntityNotFound(_0x1ef1c9,null))[_0x3aef('0x23')](function(_0x16483d){if(_0x16483d){_0x35455e=_0x16483d;_0x3b8e40['model']=_['keys'](db[_0x3aef('0x63')]['rawAttributes']);_0x3b8e40[_0x3aef('0x33')]=_[_0x3aef('0x32')](_0x209732[_0x3aef('0x33')]);_0x3b8e40[_0x3aef('0x3e')]=_[_0x3aef('0x35')](_0x3b8e40[_0x3aef('0x31')],_0x3b8e40[_0x3aef('0x33')]);_0x156a74[_0x3aef('0x34')]=_[_0x3aef('0x35')](_0x3b8e40['model'],qs[_0x3aef('0x36')](_0x209732[_0x3aef('0x33')][_0x3aef('0x36')]));_0x156a74['attributes']=_0x156a74[_0x3aef('0x34')][_0x3aef('0x37')]?_0x156a74[_0x3aef('0x34')]:_0x3b8e40[_0x3aef('0x31')];_0x156a74[_0x3aef('0x3b')]=qs[_0x3aef('0x3c')](_0x209732['query']['sort']);_0x156a74[_0x3aef('0x3d')]=qs[_0x3aef('0x3e')](_[_0x3aef('0x57')](_0x209732[_0x3aef('0x33')],_0x3b8e40[_0x3aef('0x3e')]));if(_0x209732['query'][_0x3aef('0x3f')]){_0x156a74[_0x3aef('0x3d')]=_['merge'](_0x156a74[_0x3aef('0x3d')],{'$or':_[_0x3aef('0x2d')](_0x156a74[_0x3aef('0x34')],function(_0x9eb851){var _0x28ffa6={};_0x28ffa6[_0x9eb851]={'$like':'%'+_0x209732[_0x3aef('0x33')][_0x3aef('0x3f')]+'%'};return _0x28ffa6;})});}_0x156a74=_[_0x3aef('0x40')]({},_0x156a74,_0x209732[_0x3aef('0x42')]);return _0x35455e['getTeams'](_0x156a74);}})[_0x3aef('0x23')](function(_0x10b5e5){if(_0x10b5e5){_0x429176=_0x10b5e5[_0x3aef('0x37')];if(!_0x209732[_0x3aef('0x33')][_0x3aef('0x56')](_0x3aef('0x38'))){_0x156a74[_0x3aef('0x39')]=qs[_0x3aef('0x39')](_0x209732[_0x3aef('0x33')]['limit']);_0x156a74[_0x3aef('0x3a')]=qs[_0x3aef('0x3a')](_0x209732[_0x3aef('0x33')][_0x3aef('0x3a')]);}return _0x35455e[_0x3aef('0x62')](_0x156a74);}})[_0x3aef('0x23')](function(_0x5d38a4){if(_0x5d38a4){return _0x5d38a4?{'count':_0x429176,'rows':_0x5d38a4}:null;}})['then'](respondWithResult(_0x1ef1c9,null))[_0x3aef('0x51')](handleError(_0x1ef1c9,null));};exports[_0x3aef('0x64')]=function(_0x27e27d,_0x3e3669,_0x18f185){var _0x31c5e0=_0x27e27d['body']['ids'];return db[_0x3aef('0x63')][_0x3aef('0x44')]({'where':{'id':_0x31c5e0},'attributes':['id'],'include':[{'model':db[_0x3aef('0x5a')],'as':_0x3aef('0x65'),'attributes':['id','name',_0x3aef('0x66'),'voicePause',_0x3aef('0x67')],'raw':!![]}]})[_0x3aef('0x23')](function(_0x101bf4){if(_0x101bf4){var _0x4ae969=_[_0x3aef('0x68')](_0x101bf4,function(_0x1cc4fb){var _0x41f98b=_0x1cc4fb[_0x3aef('0x25')]({'plain':!![]});return _0x41f98b['Agents'];});return db[_0x3aef('0x2e')]['find']({'where':{'id':_0x27e27d['params']['id']}})[_0x3aef('0x23')](function(_0x54e8bc){return db[_0x3aef('0x69')][_0x3aef('0x6a')](function(_0xbc8d2){return _0x54e8bc['addTeams'](_0x31c5e0,{'transaction':_0xbc8d2})[_0x3aef('0x23')](function(){return BPromise[_0x3aef('0x6b')](_0x4ae969,function(_0x3a2e62){return db[_0x3aef('0x59')][_0x3aef('0x6c')]({'where':{'UserId':_0x3a2e62['id'],'OpenchannelQueueId':_0x27e27d[_0x3aef('0x47')]['id']},'transaction':_0xbc8d2});});})[_0x3aef('0x23')](function(){_0x4ae969[_0x3aef('0x6d')](function(_0x545181){socket[_0x3aef('0x6e')](_0x3aef('0x6f'),{'UserId':_0x545181['id'],'OpenchannelQueueId':_0x54e8bc['id']});});});});});}})[_0x3aef('0x23')](respondWithStatusCode(_0x3e3669,null))[_0x3aef('0x51')](handleError(_0x3e3669,null));};exports[_0x3aef('0x70')]=function(_0x4266dc,_0x35e30c,_0x3bf615){return db[_0x3aef('0x63')][_0x3aef('0x44')]({'where':{'id':_0x4266dc[_0x3aef('0x33')][_0x3aef('0x71')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x3aef('0x65'),'attributes':['id'],'raw':!![]}]})[_0x3aef('0x23')](handleEntityNotFound(_0x35e30c,null))['then'](function(_0x12ded1){var _0x2d7aab=_[_0x3aef('0x2d')](_0x12ded1,'id');var _0x1c8960=[];var _0x32cf71=[];var _0x3e67a2=squel[_0x3aef('0x72')]();_0x3e67a2[_0x3aef('0x73')](_0x3aef('0x74'))[_0x3aef('0x75')](_0x3aef('0x76'),'tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x3aef('0x3d')](_0x3aef('0x77'),_0x4266dc[_0x3aef('0x47')]['id']);for(var _0xa3b3de=0x0;_0xa3b3de<_0x12ded1[_0x3aef('0x37')];_0xa3b3de+=0x1){let _0x434c33=_0x12ded1[_0xa3b3de];for(var _0x24e731=0x0;_0x24e731<_0x434c33[_0x3aef('0x65')][_0x3aef('0x37')];_0x24e731+=0x1){let _0x6cb88f=_0x434c33['Agents'][_0x24e731];var _0x5bf474=_0x3e67a2[_0x3aef('0x78')]();_0x5bf474[_0x3aef('0x3d')](_0x3aef('0x79'),_0x6cb88f['id']);_0x32cf71[_0x3aef('0x7a')](db[_0x3aef('0x69')][_0x3aef('0x33')](_0x5bf474[_0x3aef('0x7b')](),{'type':db[_0x3aef('0x69')][_0x3aef('0x7c')]['SELECT']})['then'](function(_0x4742bd){if(_0x4742bd[_0x3aef('0x37')]===0x1){return _0x6cb88f['id'];}else{var _0x4b3abb=_[_0x3aef('0x7d')](_[_0x3aef('0x2d')](_0x4742bd,_0x3aef('0x7e')),function(_0x64da83){return _[_0x3aef('0x7f')](_0x2d7aab,_0x64da83);});if(_0x4b3abb){return _0x6cb88f['id'];}}}));}}return BPromise['all'](_0x32cf71)[_0x3aef('0x23')](function(_0x17ab07){_0x1c8960=_(_0x1c8960)[_0x3aef('0x80')](_0x17ab07)['compact']()[_0x3aef('0x81')]();return db[_0x3aef('0x2e')][_0x3aef('0x4a')]({'where':{'id':_0x4266dc[_0x3aef('0x47')]['id']}})['then'](function(_0x172771){return db[_0x3aef('0x69')][_0x3aef('0x6a')](function(_0x58f8f9){return _0x172771[_0x3aef('0x70')](_0x4266dc[_0x3aef('0x33')][_0x3aef('0x71')],{'transaction':_0x58f8f9})[_0x3aef('0x23')](function(){if(!_[_0x3aef('0x82')](_0x1c8960)){return _0x172771[_0x3aef('0x83')](_0x1c8960,{'transaction':_0x58f8f9});}})[_0x3aef('0x23')](function(){_0x1c8960[_0x3aef('0x6d')](function(_0x593ec8){socket[_0x3aef('0x6e')]('userOpenchannelQueue:remove',{'UserId':_0x593ec8,'OpenchannelQueueId':_0x172771['id']});});});});});});})[_0x3aef('0x23')](respondWithStatusCode(_0x35e30c,null))['catch'](handleError(_0x35e30c,null));};exports[_0x3aef('0x84')]=function(_0x2b17a3,_0x84fac1,_0x270edc){return db[_0x3aef('0x2e')]['find']({'where':{'id':_0x2b17a3[_0x3aef('0x47')]['id']}})['then'](handleEntityNotFound(_0x84fac1,null))[_0x3aef('0x23')](function(_0x45ac7c){if(_0x45ac7c){return _0x45ac7c[_0x3aef('0x84')](_0x2b17a3[_0x3aef('0x4c')][_0x3aef('0x71')],_[_0x3aef('0x85')](_0x2b17a3[_0x3aef('0x4c')],[_0x3aef('0x71'),'id'])||{})[_0x3aef('0x86')](function(_0x1f8746){for(var _0x364f16=0x0;_0x364f16<_0x2b17a3['body'][_0x3aef('0x71')][_0x3aef('0x37')];_0x364f16+=0x1){socket[_0x3aef('0x6e')]('userOpenchannelQueue:save',{'UserId':_0x2b17a3[_0x3aef('0x4c')]['ids'][_0x364f16],'OpenchannelQueueId':_0x2b17a3[_0x3aef('0x47')]['id']});}return _0x1f8746;});}})[_0x3aef('0x23')](respondWithResult(_0x84fac1,null))[_0x3aef('0x51')](handleError(_0x84fac1,null));};exports[_0x3aef('0x83')]=function(_0x30a9e2,_0x43e2a7,_0x4095c3){return db[_0x3aef('0x2e')]['find']({'where':{'id':_0x30a9e2[_0x3aef('0x47')]['id']}})[_0x3aef('0x23')](handleEntityNotFound(_0x43e2a7,null))['then'](function(_0x542d9d){if(_0x542d9d){return _0x542d9d[_0x3aef('0x83')](_0x30a9e2['query'][_0x3aef('0x71')])[_0x3aef('0x23')](function(){if(_['isArray'](_0x30a9e2[_0x3aef('0x33')][_0x3aef('0x71')])){for(var _0x502b7d=0x0;_0x502b7d<_0x30a9e2[_0x3aef('0x33')][_0x3aef('0x71')][_0x3aef('0x37')];_0x502b7d+=0x1){socket['emit'](_0x3aef('0x87'),{'UserId':Number(_0x30a9e2['query'][_0x3aef('0x71')][_0x502b7d]),'OpenchannelQueueId':Number(_0x30a9e2[_0x3aef('0x47')]['id'])});}}else{socket[_0x3aef('0x6e')](_0x3aef('0x87'),{'UserId':Number(_0x30a9e2[_0x3aef('0x33')]['ids']),'OpenchannelQueueId':Number(_0x30a9e2[_0x3aef('0x47')]['id'])});}});}})[_0x3aef('0x23')](respondWithStatusCode(_0x43e2a7,null))['catch'](handleError(_0x43e2a7,null));};exports[_0x3aef('0x88')]=function(_0x2e3cf7,_0x18580d,_0x596016){var _0x20a1d1={};var _0x436c9f={};var _0x15eadd;var _0x34752a;return db[_0x3aef('0x2e')][_0x3aef('0x55')]({'where':{'id':_0x2e3cf7['params']['id']}})[_0x3aef('0x23')](handleEntityNotFound(_0x18580d,null))[_0x3aef('0x23')](function(_0x7f778){if(_0x7f778){_0x15eadd=_0x7f778;_0x436c9f['model']=_[_0x3aef('0x32')](db[_0x3aef('0x5a')][_0x3aef('0x48')]);_0x436c9f[_0x3aef('0x33')]=_[_0x3aef('0x32')](_0x2e3cf7[_0x3aef('0x33')]);_0x436c9f[_0x3aef('0x3e')]=_[_0x3aef('0x35')](_0x436c9f[_0x3aef('0x31')],_0x436c9f[_0x3aef('0x33')]);_0x20a1d1[_0x3aef('0x34')]=_[_0x3aef('0x35')](_0x436c9f['model'],qs[_0x3aef('0x36')](_0x2e3cf7['query'][_0x3aef('0x36')]));_0x20a1d1[_0x3aef('0x34')]=_0x20a1d1['attributes']['length']?_0x20a1d1[_0x3aef('0x34')]:_0x436c9f['model'];_0x20a1d1['order']=qs[_0x3aef('0x3c')](_0x2e3cf7['query']['sort']);_0x20a1d1[_0x3aef('0x3d')]=qs[_0x3aef('0x3e')](_[_0x3aef('0x57')](_0x2e3cf7[_0x3aef('0x33')],_0x436c9f[_0x3aef('0x3e')]));if(_0x2e3cf7[_0x3aef('0x33')][_0x3aef('0x3f')]){_0x20a1d1[_0x3aef('0x3d')]=_[_0x3aef('0x40')](_0x20a1d1[_0x3aef('0x3d')],{'$or':_['map'](_0x20a1d1[_0x3aef('0x34')],function(_0x55b601){var _0x38aee7={};_0x38aee7[_0x55b601]={'$like':'%'+_0x2e3cf7[_0x3aef('0x33')][_0x3aef('0x3f')]+'%'};return _0x38aee7;})});}_0x20a1d1=_[_0x3aef('0x40')]({},_0x20a1d1,_0x2e3cf7[_0x3aef('0x42')]);return _0x15eadd[_0x3aef('0x88')](_0x20a1d1);}})['then'](function(_0x4f1367){if(_0x4f1367){_0x34752a=_0x4f1367[_0x3aef('0x37')];if(!_0x2e3cf7['query']['hasOwnProperty'](_0x3aef('0x38'))){_0x20a1d1[_0x3aef('0x39')]=qs[_0x3aef('0x39')](_0x2e3cf7[_0x3aef('0x33')][_0x3aef('0x39')]);_0x20a1d1[_0x3aef('0x3a')]=qs['offset'](_0x2e3cf7['query'][_0x3aef('0x3a')]);}return _0x15eadd[_0x3aef('0x88')](_0x20a1d1);}})['then'](function(_0x41b89c){if(_0x41b89c){return _0x41b89c?{'count':_0x34752a,'rows':_0x41b89c}:null;}})[_0x3aef('0x23')](respondWithResult(_0x18580d,null))['catch'](handleError(_0x18580d,null));}; \ No newline at end of file +var _0x6628=['../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','status','json','count','offset','Content-Range','apply','reject','save','update','destroy','OpenchannelQueues','then','end','error','stack','index','map','OpenchannelQueue','rawAttributes','fieldName','type','key','model','query','intersection','attributes','length','hasOwnProperty','nolimit','limit','order','where','filters','pick','merge','field','options','includeAll','findAll','rows','catch','show','params','fields','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','keys','UserOpenchannelQueue','sort','OpenchannelQueueId','filter','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','createdAt','%s/%s','SIP','getTeams','addTeams','ids','Team','Agents','online','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','from','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','toString','QueryTypes','SELECT','every','TeamId','includes','compact','value','removeTeams','removeAgents','userOpenchannelQueue:remove','addAgents','omit','spread','userOpenchannelQueue:save','isArray','getAgents','findOne','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x6628,0xf7));var _0x8662=function(_0x61ae3f,_0x8afc33){_0x61ae3f=_0x61ae3f-0x0;var _0x45fcbc=_0x6628[_0x61ae3f];return _0x45fcbc;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8662('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8662('0x1'));var jsonpatch=require(_0x8662('0x2'));var rp=require(_0x8662('0x3'));var moment=require('moment');var BPromise=require(_0x8662('0x4'));var Mustache=require('mustache');var util=require(_0x8662('0x5'));var path=require(_0x8662('0x6'));var sox=require(_0x8662('0x7'));var csv=require(_0x8662('0x8'));var ejs=require(_0x8662('0x9'));var fs=require('fs');var _=require(_0x8662('0xa'));var squel=require('squel');var crypto=require(_0x8662('0xb'));var jsforce=require(_0x8662('0xc'));var deskjs=require(_0x8662('0xd'));var toCsv=require(_0x8662('0x8'));var querystring=require(_0x8662('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8662('0xf'));var qs=require(_0x8662('0x10'));var as=require(_0x8662('0x11'));var hardwareService=require(_0x8662('0x12'));var logger=require(_0x8662('0x13'))('api');var utils=require(_0x8662('0x14'));var config=require(_0x8662('0x15'));var db=require(_0x8662('0x16'))['db'];config[_0x8662('0x17')]=_['defaults'](config[_0x8662('0x17')],{'host':_0x8662('0x18'),'port':0x18eb});var socket=require(_0x8662('0x19'))(new Redis(config[_0x8662('0x17')]));require('./openchannelQueue.socket')[_0x8662('0x1a')](socket);function respondWithStatusCode(_0x3d9d52,_0x429d11){_0x429d11=_0x429d11||0xcc;return function(_0x1caf19){if(_0x1caf19){return _0x3d9d52['sendStatus'](_0x429d11);}return _0x3d9d52[_0x8662('0x1b')](_0x429d11)['end']();};}function respondWithResult(_0x746986,_0x2ceb6c){_0x2ceb6c=_0x2ceb6c||0xc8;return function(_0x69ac77){if(_0x69ac77){return _0x746986[_0x8662('0x1b')](_0x2ceb6c)[_0x8662('0x1c')](_0x69ac77);}};}function respondWithFilteredResult(_0x5bd75d,_0x35f990){return function(_0x21bb58){if(_0x21bb58){var _0x1ac0bc=_0x21bb58[_0x8662('0x1d')],_0x8ba0b0=_0x35f990[_0x8662('0x1e')],_0x455841=_0x35f990['offset']+_0x35f990['limit'],_0x23ddda;if(_0x455841>=_0x1ac0bc){_0x455841=_0x1ac0bc;_0x23ddda=0xc8;}else{_0x23ddda=0xce;}_0x5bd75d[_0x8662('0x1b')](_0x23ddda);return _0x5bd75d['set'](_0x8662('0x1f'),_0x8ba0b0+'-'+_0x455841+'/'+_0x1ac0bc)[_0x8662('0x1c')](_0x21bb58);}return null;};}function patchUpdates(_0x379f00){return function(_0x4fd379){try{jsonpatch[_0x8662('0x20')](_0x4fd379,_0x379f00,!![]);}catch(_0x496660){return BPromise[_0x8662('0x21')](_0x496660);}return _0x4fd379[_0x8662('0x22')]();};}function saveUpdates(_0x27f716,_0xb6a77d){return function(_0x461649){if(_0x461649){return _0x461649[_0x8662('0x23')](_0x27f716)['then'](function(_0x333ce8){return _0x333ce8;});}return null;};}function removeEntity(_0x5136f2,_0x51a9b5){return function(_0x4637c6){if(_0x4637c6){return _0x4637c6[_0x8662('0x24')]()['then'](function(){var _0x4cf33a=_0x4637c6['get']({'plain':!![]});var _0x312263=_0x8662('0x25');return db['UserProfileResource'][_0x8662('0x24')]({'where':{'type':_0x312263,'resourceId':_0x4cf33a['id']}})[_0x8662('0x26')](function(){return _0x4637c6;});})[_0x8662('0x26')](function(){_0x5136f2[_0x8662('0x1b')](0xcc)[_0x8662('0x27')]();});}};}function handleEntityNotFound(_0x14b770,_0x1c0a47){return function(_0x1ad3b9){if(!_0x1ad3b9){_0x14b770['sendStatus'](0x194);}return _0x1ad3b9;};}function handleError(_0x4a0fea,_0x47cb23){_0x47cb23=_0x47cb23||0x1f4;return function(_0x591b35){logger[_0x8662('0x28')](_0x591b35[_0x8662('0x29')]);if(_0x591b35['name']){delete _0x591b35['name'];}_0x4a0fea[_0x8662('0x1b')](_0x47cb23)['send'](_0x591b35);};}exports[_0x8662('0x2a')]=function(_0x1ff468,_0xb88eba){var _0x4cdcb5={},_0x131503={},_0x395710={'count':0x0,'rows':[]};var _0x2723d3=_[_0x8662('0x2b')](db[_0x8662('0x2c')][_0x8662('0x2d')],function(_0x579257){return{'name':_0x579257[_0x8662('0x2e')],'type':_0x579257[_0x8662('0x2f')][_0x8662('0x30')]};});_0x131503[_0x8662('0x31')]=_[_0x8662('0x2b')](_0x2723d3,'name');_0x131503[_0x8662('0x32')]=_['keys'](_0x1ff468['query']);_0x131503['filters']=_[_0x8662('0x33')](_0x131503[_0x8662('0x31')],_0x131503[_0x8662('0x32')]);_0x4cdcb5['attributes']=_[_0x8662('0x33')](_0x131503[_0x8662('0x31')],qs['fields'](_0x1ff468[_0x8662('0x32')]['fields']));_0x4cdcb5[_0x8662('0x34')]=_0x4cdcb5['attributes'][_0x8662('0x35')]?_0x4cdcb5[_0x8662('0x34')]:_0x131503[_0x8662('0x31')];if(!_0x1ff468[_0x8662('0x32')][_0x8662('0x36')](_0x8662('0x37'))){_0x4cdcb5[_0x8662('0x38')]=qs[_0x8662('0x38')](_0x1ff468[_0x8662('0x32')][_0x8662('0x38')]);_0x4cdcb5[_0x8662('0x1e')]=qs[_0x8662('0x1e')](_0x1ff468['query'][_0x8662('0x1e')]);}_0x4cdcb5[_0x8662('0x39')]=qs['sort'](_0x1ff468['query']['sort']);_0x4cdcb5[_0x8662('0x3a')]=qs[_0x8662('0x3b')](_[_0x8662('0x3c')](_0x1ff468[_0x8662('0x32')],_0x131503[_0x8662('0x3b')]));if(_0x1ff468[_0x8662('0x32')]['filter']){_0x4cdcb5['where']=_[_0x8662('0x3d')](_0x4cdcb5['where'],{'$or':_[_0x8662('0x2b')](_0x2723d3,function(_0x4630ad){if(_0x4630ad[_0x8662('0x2f')][_0x8662('0x30')]!=='VIRTUAL'){var _0x2d1e80={};_0x2d1e80[_0x4630ad[_0x8662('0x3e')]]={'$like':'%'+_0x1ff468[_0x8662('0x32')]['filter']+'%'};return _0x2d1e80;}})});}_0x4cdcb5=_[_0x8662('0x3d')]({},_0x4cdcb5,_0x1ff468[_0x8662('0x3f')]);var _0x35d081={'where':_0x4cdcb5[_0x8662('0x3a')]};return db[_0x8662('0x2c')][_0x8662('0x1d')](_0x35d081)[_0x8662('0x26')](function(_0x2eae61){_0x395710[_0x8662('0x1d')]=_0x2eae61;if(_0x1ff468[_0x8662('0x32')][_0x8662('0x40')]){_0x4cdcb5['include']=[{'all':!![]}];}return db[_0x8662('0x2c')][_0x8662('0x41')](_0x4cdcb5);})['then'](function(_0x146b69){_0x395710[_0x8662('0x42')]=_0x146b69;return _0x395710;})[_0x8662('0x26')](respondWithFilteredResult(_0xb88eba,_0x4cdcb5))[_0x8662('0x43')](handleError(_0xb88eba,null));};exports[_0x8662('0x44')]=function(_0x1ba462,_0x4210f4){var _0xee2f72={'raw':!![],'where':{'id':_0x1ba462[_0x8662('0x45')]['id']}},_0x17a4bf={};_0x17a4bf[_0x8662('0x31')]=_['keys'](db['OpenchannelQueue'][_0x8662('0x2d')]);_0x17a4bf[_0x8662('0x32')]=_['keys'](_0x1ba462[_0x8662('0x32')]);_0x17a4bf[_0x8662('0x3b')]=_['intersection'](_0x17a4bf['model'],_0x17a4bf[_0x8662('0x32')]);_0xee2f72[_0x8662('0x34')]=_[_0x8662('0x33')](_0x17a4bf['model'],qs['fields'](_0x1ba462[_0x8662('0x32')][_0x8662('0x46')]));_0xee2f72['attributes']=_0xee2f72['attributes'][_0x8662('0x35')]?_0xee2f72[_0x8662('0x34')]:_0x17a4bf['model'];if(_0x1ba462['query']['includeAll']){_0xee2f72['include']=[{'all':!![]}];}_0xee2f72=_[_0x8662('0x3d')]({},_0xee2f72,_0x1ba462['options']);return db[_0x8662('0x2c')][_0x8662('0x47')](_0xee2f72)[_0x8662('0x26')](handleEntityNotFound(_0x4210f4,null))[_0x8662('0x26')](respondWithResult(_0x4210f4,null))[_0x8662('0x43')](handleError(_0x4210f4,null));};exports[_0x8662('0x48')]=function(_0x3ea21d,_0x5585aa){return db[_0x8662('0x2c')]['create'](_0x3ea21d[_0x8662('0x49')],{})[_0x8662('0x26')](function(_0x3b8534){var _0x32314d=_0x3ea21d['user'][_0x8662('0x4a')]({'plain':!![]});if(!_0x32314d)throw new Error(_0x8662('0x4b'));if(_0x32314d[_0x8662('0x4c')]===_0x8662('0x4d')){var _0x32e1d0=_0x3b8534[_0x8662('0x4a')]({'plain':!![]});var _0x39b41c=_0x8662('0x25');return db[_0x8662('0x4e')][_0x8662('0x47')]({'where':{'name':_0x39b41c,'userProfileId':_0x32314d['userProfileId']},'raw':!![]})['then'](function(_0x30105a){if(_0x30105a&&_0x30105a['autoAssociation']===0x0){return db['UserProfileResource'][_0x8662('0x48')]({'name':_0x32e1d0[_0x8662('0x4f')],'resourceId':_0x32e1d0['id'],'type':_0x30105a['name'],'sectionId':_0x30105a['id']},{})[_0x8662('0x26')](function(){return _0x3b8534;});}else{return _0x3b8534;}})['catch'](function(_0x4eb25e){logger[_0x8662('0x28')](_0x8662('0x50'),_0x4eb25e);throw _0x4eb25e;});}return _0x3b8534;})[_0x8662('0x26')](respondWithResult(_0x5585aa,0xc9))[_0x8662('0x43')](handleError(_0x5585aa,null));};exports[_0x8662('0x23')]=function(_0x5f2d3,_0x4195c3){if(_0x5f2d3[_0x8662('0x49')]['id']){delete _0x5f2d3[_0x8662('0x49')]['id'];}return db[_0x8662('0x2c')]['find']({'where':{'id':_0x5f2d3[_0x8662('0x45')]['id']}})[_0x8662('0x26')](handleEntityNotFound(_0x4195c3,null))['then'](saveUpdates(_0x5f2d3[_0x8662('0x49')],null))[_0x8662('0x26')](respondWithResult(_0x4195c3,null))[_0x8662('0x43')](handleError(_0x4195c3,null));};exports[_0x8662('0x24')]=function(_0x1a2300,_0x27a924){return db[_0x8662('0x2c')][_0x8662('0x47')]({'where':{'id':_0x1a2300['params']['id']}})[_0x8662('0x26')](handleEntityNotFound(_0x27a924,null))[_0x8662('0x26')](removeEntity(_0x27a924,null))[_0x8662('0x43')](handleError(_0x27a924,null));};exports[_0x8662('0x51')]=function(_0xb93937,_0x51a519){return db['OpenchannelQueue'][_0x8662('0x51')]()[_0x8662('0x26')](respondWithResult(_0x51a519,null))[_0x8662('0x43')](handleError(_0x51a519,null));};exports['getMembers']=function(_0x349b0e,_0xa900ee,_0x2aea93){var _0x112dcf={'raw':!![],'where':{}},_0x2f893e={},_0x4602d1;return db[_0x8662('0x2c')]['findOne']({'where':{'id':_0x349b0e[_0x8662('0x45')]['id']}})[_0x8662('0x26')](handleEntityNotFound(_0xa900ee,null))[_0x8662('0x26')](function(_0x6211ba){if(_0x6211ba){_0x4602d1=_0x6211ba[_0x8662('0x4a')]({'plain':!![]});_0x2f893e['model']=_[_0x8662('0x52')](db[_0x8662('0x53')][_0x8662('0x2d')]);_0x2f893e[_0x8662('0x32')]=_['keys'](_0x349b0e['query']);_0x2f893e[_0x8662('0x3b')]=_[_0x8662('0x33')](_0x2f893e[_0x8662('0x31')],_0x2f893e['query']);_0x112dcf[_0x8662('0x34')]=_[_0x8662('0x33')](_0x2f893e[_0x8662('0x31')],qs[_0x8662('0x46')](_0x349b0e[_0x8662('0x32')][_0x8662('0x46')]));_0x112dcf[_0x8662('0x34')]=_0x112dcf[_0x8662('0x34')]['length']?_0x112dcf[_0x8662('0x34')]:_0x2f893e['model'];if(!_0x349b0e[_0x8662('0x32')][_0x8662('0x36')]('nolimit')){_0x112dcf[_0x8662('0x38')]=qs['limit'](_0x349b0e['query'][_0x8662('0x38')]);_0x112dcf['offset']=qs['offset'](_0x349b0e[_0x8662('0x32')][_0x8662('0x1e')]);}_0x112dcf['order']=qs[_0x8662('0x54')](_0x349b0e[_0x8662('0x32')][_0x8662('0x54')]);_0x112dcf['where']=qs['filters'](_[_0x8662('0x3c')](_0x349b0e[_0x8662('0x32')],_0x2f893e[_0x8662('0x3b')]));_0x112dcf['where'][_0x8662('0x55')]=_0x6211ba['id'];if(_0x349b0e[_0x8662('0x32')]['filter']){_0x112dcf[_0x8662('0x3a')]=_['merge'](_0x112dcf[_0x8662('0x3a')],{'$or':_[_0x8662('0x2b')](_0x112dcf[_0x8662('0x34')],function(_0x191c81){var _0x4e08b1={};_0x4e08b1[_0x191c81]={'$like':'%'+_0x349b0e[_0x8662('0x32')][_0x8662('0x56')]+'%'};return _0x4e08b1;})});}_0x112dcf=_['merge']({},_0x112dcf,_0x349b0e[_0x8662('0x3f')]);return db[_0x8662('0x53')][_0x8662('0x41')](_0x112dcf);}})['then'](function(_0x13f55c){if(_0x13f55c){return db[_0x8662('0x57')][_0x8662('0x58')]({'where':{'id':_[_0x8662('0x2b')](_0x13f55c,_0x8662('0x59')),'role':_0x8662('0x5a')},'attributes':['id',_0x8662('0x4f'),_0x8662('0x5b'),_0x8662('0x5c'),_0x8662('0x5d')]});}})[_0x8662('0x26')](function(_0x2ad01a){if(_0x2ad01a){return{'count':_0x2ad01a['count'],'rows':_['map'](_0x2ad01a[_0x8662('0x42')],function(_0x19a783){return{'membername':_0x19a783[_0x8662('0x4f')],'UserId':_0x19a783['id'],'queue_name':_0x4602d1[_0x8662('0x4f')],'OpenchannelQueueId':_0x4602d1['id'],'interface':util['format'](_0x8662('0x5e'),_0x8662('0x5f'),_0x19a783[_0x8662('0x4f')]),'penalty':0x0,'paused':_0x19a783['openchannelPause'],'createdAt':_0x19a783[_0x8662('0x5d')],'updatedAt':_0x19a783[_0x8662('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8662('0x26')](respondWithFilteredResult(_0xa900ee,_0x112dcf))[_0x8662('0x43')](handleError(_0xa900ee,null));};exports[_0x8662('0x60')]=function(_0x57e2c6,_0x17e3ef,_0x180d7b){var _0x13d6ee={};var _0x520a5a={};var _0x46c710;var _0x54c303;return db['OpenchannelQueue']['findOne']({'where':{'id':_0x57e2c6['params']['id']}})['then'](handleEntityNotFound(_0x17e3ef,null))[_0x8662('0x26')](function(_0xd32657){if(_0xd32657){_0x46c710=_0xd32657;_0x520a5a['model']=_[_0x8662('0x52')](db['Team']['rawAttributes']);_0x520a5a[_0x8662('0x32')]=_['keys'](_0x57e2c6[_0x8662('0x32')]);_0x520a5a[_0x8662('0x3b')]=_[_0x8662('0x33')](_0x520a5a[_0x8662('0x31')],_0x520a5a[_0x8662('0x32')]);_0x13d6ee[_0x8662('0x34')]=_[_0x8662('0x33')](_0x520a5a[_0x8662('0x31')],qs[_0x8662('0x46')](_0x57e2c6[_0x8662('0x32')][_0x8662('0x46')]));_0x13d6ee[_0x8662('0x34')]=_0x13d6ee[_0x8662('0x34')][_0x8662('0x35')]?_0x13d6ee['attributes']:_0x520a5a[_0x8662('0x31')];_0x13d6ee[_0x8662('0x39')]=qs[_0x8662('0x54')](_0x57e2c6[_0x8662('0x32')]['sort']);_0x13d6ee[_0x8662('0x3a')]=qs[_0x8662('0x3b')](_['pick'](_0x57e2c6[_0x8662('0x32')],_0x520a5a[_0x8662('0x3b')]));if(_0x57e2c6['query'][_0x8662('0x56')]){_0x13d6ee[_0x8662('0x3a')]=_[_0x8662('0x3d')](_0x13d6ee[_0x8662('0x3a')],{'$or':_[_0x8662('0x2b')](_0x13d6ee[_0x8662('0x34')],function(_0x255ab0){var _0x200d1d={};_0x200d1d[_0x255ab0]={'$like':'%'+_0x57e2c6['query'][_0x8662('0x56')]+'%'};return _0x200d1d;})});}_0x13d6ee=_[_0x8662('0x3d')]({},_0x13d6ee,_0x57e2c6[_0x8662('0x3f')]);return _0x46c710['getTeams'](_0x13d6ee);}})[_0x8662('0x26')](function(_0x180cfd){if(_0x180cfd){_0x54c303=_0x180cfd[_0x8662('0x35')];if(!_0x57e2c6['query'][_0x8662('0x36')](_0x8662('0x37'))){_0x13d6ee[_0x8662('0x38')]=qs[_0x8662('0x38')](_0x57e2c6['query']['limit']);_0x13d6ee['offset']=qs[_0x8662('0x1e')](_0x57e2c6['query'][_0x8662('0x1e')]);}return _0x46c710['getTeams'](_0x13d6ee);}})[_0x8662('0x26')](function(_0x1734b3){if(_0x1734b3){return _0x1734b3?{'count':_0x54c303,'rows':_0x1734b3}:null;}})[_0x8662('0x26')](respondWithResult(_0x17e3ef,null))[_0x8662('0x43')](handleError(_0x17e3ef,null));};exports[_0x8662('0x61')]=function(_0x1364b0,_0x3620de,_0x4ad07c){var _0x1eeebc=_0x1364b0['body'][_0x8662('0x62')];return db[_0x8662('0x63')][_0x8662('0x41')]({'where':{'id':_0x1eeebc},'attributes':['id'],'include':[{'model':db['User'],'as':_0x8662('0x64'),'attributes':['id',_0x8662('0x4f'),_0x8662('0x65'),'voicePause','interface'],'raw':!![]}]})[_0x8662('0x26')](function(_0x26e587){if(_0x26e587){var _0x189393=_[_0x8662('0x66')](_0x26e587,function(_0x13c877){var _0x82c702=_0x13c877[_0x8662('0x4a')]({'plain':!![]});return _0x82c702[_0x8662('0x64')];});return db[_0x8662('0x2c')][_0x8662('0x47')]({'where':{'id':_0x1364b0[_0x8662('0x45')]['id']}})[_0x8662('0x26')](function(_0x4cc443){return db[_0x8662('0x67')][_0x8662('0x68')](function(_0x2c054f){return _0x4cc443[_0x8662('0x61')](_0x1eeebc,{'transaction':_0x2c054f})[_0x8662('0x26')](function(){return BPromise[_0x8662('0x69')](_0x189393,function(_0x1d7348){return db[_0x8662('0x53')][_0x8662('0x6a')]({'where':{'UserId':_0x1d7348['id'],'OpenchannelQueueId':_0x1364b0['params']['id']},'transaction':_0x2c054f});});})[_0x8662('0x26')](function(){_0x189393[_0x8662('0x6b')](function(_0x946c13){socket[_0x8662('0x6c')]('userOpenchannelQueue:save',{'UserId':_0x946c13['id'],'OpenchannelQueueId':_0x4cc443['id']});});});});});}})[_0x8662('0x26')](respondWithStatusCode(_0x3620de,null))[_0x8662('0x43')](handleError(_0x3620de,null));};exports['removeTeams']=function(_0x2318de,_0x3a0633,_0x5db1e9){return db[_0x8662('0x63')][_0x8662('0x41')]({'where':{'id':_0x2318de['query'][_0x8662('0x62')]},'attributes':['id'],'include':[{'model':db[_0x8662('0x57')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x8662('0x26')](handleEntityNotFound(_0x3a0633,null))[_0x8662('0x26')](function(_0x3c77e6){var _0x3244e6=_[_0x8662('0x2b')](_0x3c77e6,'id');var _0x1b51b7=[];var _0xdd8bd1=[];var _0x1a55d9=squel['select']();_0x1a55d9[_0x8662('0x3e')]('tq.TeamId')[_0x8662('0x6d')](_0x8662('0x6e'),'tq')[_0x8662('0x6f')](_0x8662('0x70'),'ut',_0x8662('0x71'))[_0x8662('0x3a')](_0x8662('0x72'),_0x2318de[_0x8662('0x45')]['id']);for(var _0x5acfd3=0x0;_0x5acfd3<_0x3c77e6[_0x8662('0x35')];_0x5acfd3+=0x1){let _0x3ba4ec=_0x3c77e6[_0x5acfd3];for(var _0x3914ab=0x0;_0x3914ab<_0x3ba4ec[_0x8662('0x64')][_0x8662('0x35')];_0x3914ab+=0x1){let _0x3b39fe=_0x3ba4ec[_0x8662('0x64')][_0x3914ab];var _0x2be2c5=_0x1a55d9[_0x8662('0x73')]();_0x2be2c5[_0x8662('0x3a')]('ut.UserId\x20=\x20?',_0x3b39fe['id']);_0xdd8bd1['push'](db[_0x8662('0x67')][_0x8662('0x32')](_0x2be2c5[_0x8662('0x74')](),{'type':db[_0x8662('0x67')][_0x8662('0x75')][_0x8662('0x76')]})['then'](function(_0x4d59cf){if(_0x4d59cf[_0x8662('0x35')]===0x1){return _0x3b39fe['id'];}else{var _0x588025=_[_0x8662('0x77')](_[_0x8662('0x2b')](_0x4d59cf,_0x8662('0x78')),function(_0x2dd1bf){return _[_0x8662('0x79')](_0x3244e6,_0x2dd1bf);});if(_0x588025){return _0x3b39fe['id'];}}}));}}return BPromise['all'](_0xdd8bd1)[_0x8662('0x26')](function(_0x214d92){_0x1b51b7=_(_0x1b51b7)['union'](_0x214d92)[_0x8662('0x7a')]()[_0x8662('0x7b')]();return db[_0x8662('0x2c')][_0x8662('0x47')]({'where':{'id':_0x2318de['params']['id']}})[_0x8662('0x26')](function(_0x598cf2){return db[_0x8662('0x67')][_0x8662('0x68')](function(_0x45eaa5){return _0x598cf2[_0x8662('0x7c')](_0x2318de[_0x8662('0x32')][_0x8662('0x62')],{'transaction':_0x45eaa5})['then'](function(){if(!_['isEmpty'](_0x1b51b7)){return _0x598cf2[_0x8662('0x7d')](_0x1b51b7,{'transaction':_0x45eaa5});}})['then'](function(){_0x1b51b7[_0x8662('0x6b')](function(_0x38bbf2){socket[_0x8662('0x6c')](_0x8662('0x7e'),{'UserId':_0x38bbf2,'OpenchannelQueueId':_0x598cf2['id']});});});});});});})[_0x8662('0x26')](respondWithStatusCode(_0x3a0633,null))[_0x8662('0x43')](handleError(_0x3a0633,null));};exports[_0x8662('0x7f')]=function(_0x32d21d,_0x3bd06e,_0x5c7cc2){return db['OpenchannelQueue'][_0x8662('0x47')]({'where':{'id':_0x32d21d[_0x8662('0x45')]['id']}})['then'](handleEntityNotFound(_0x3bd06e,null))[_0x8662('0x26')](function(_0x363218){if(_0x363218){return _0x363218[_0x8662('0x7f')](_0x32d21d[_0x8662('0x49')][_0x8662('0x62')],_[_0x8662('0x80')](_0x32d21d['body'],[_0x8662('0x62'),'id'])||{})[_0x8662('0x81')](function(_0x43dc91){for(var _0x5740f6=0x0;_0x5740f6<_0x32d21d[_0x8662('0x49')][_0x8662('0x62')][_0x8662('0x35')];_0x5740f6+=0x1){socket['emit'](_0x8662('0x82'),{'UserId':_0x32d21d[_0x8662('0x49')][_0x8662('0x62')][_0x5740f6],'OpenchannelQueueId':_0x32d21d[_0x8662('0x45')]['id']});}return _0x43dc91;});}})['then'](respondWithResult(_0x3bd06e,null))['catch'](handleError(_0x3bd06e,null));};exports[_0x8662('0x7d')]=function(_0x4e07df,_0x1b0c3a,_0xaeb6b8){return db[_0x8662('0x2c')][_0x8662('0x47')]({'where':{'id':_0x4e07df[_0x8662('0x45')]['id']}})['then'](handleEntityNotFound(_0x1b0c3a,null))[_0x8662('0x26')](function(_0x160385){if(_0x160385){return _0x160385[_0x8662('0x7d')](_0x4e07df[_0x8662('0x32')][_0x8662('0x62')])['then'](function(){if(_[_0x8662('0x83')](_0x4e07df['query'][_0x8662('0x62')])){for(var _0x4139e0=0x0;_0x4139e0<_0x4e07df[_0x8662('0x32')][_0x8662('0x62')][_0x8662('0x35')];_0x4139e0+=0x1){socket[_0x8662('0x6c')]('userOpenchannelQueue:remove',{'UserId':Number(_0x4e07df[_0x8662('0x32')][_0x8662('0x62')][_0x4139e0]),'OpenchannelQueueId':Number(_0x4e07df[_0x8662('0x45')]['id'])});}}else{socket[_0x8662('0x6c')](_0x8662('0x7e'),{'UserId':Number(_0x4e07df[_0x8662('0x32')][_0x8662('0x62')]),'OpenchannelQueueId':Number(_0x4e07df['params']['id'])});}});}})[_0x8662('0x26')](respondWithStatusCode(_0x1b0c3a,null))['catch'](handleError(_0x1b0c3a,null));};exports[_0x8662('0x84')]=function(_0x336676,_0x3696b7,_0x59b878){var _0x1e03c0={};var _0xcbe85d={};var _0x364a0b;var _0x404d27;return db['OpenchannelQueue'][_0x8662('0x85')]({'where':{'id':_0x336676[_0x8662('0x45')]['id']}})[_0x8662('0x26')](handleEntityNotFound(_0x3696b7,null))[_0x8662('0x26')](function(_0x3a5bb6){if(_0x3a5bb6){_0x364a0b=_0x3a5bb6;_0xcbe85d[_0x8662('0x31')]=_[_0x8662('0x52')](db[_0x8662('0x57')][_0x8662('0x2d')]);_0xcbe85d[_0x8662('0x32')]=_[_0x8662('0x52')](_0x336676[_0x8662('0x32')]);_0xcbe85d[_0x8662('0x3b')]=_['intersection'](_0xcbe85d[_0x8662('0x31')],_0xcbe85d[_0x8662('0x32')]);_0x1e03c0[_0x8662('0x34')]=_['intersection'](_0xcbe85d[_0x8662('0x31')],qs[_0x8662('0x46')](_0x336676[_0x8662('0x32')][_0x8662('0x46')]));_0x1e03c0[_0x8662('0x34')]=_0x1e03c0[_0x8662('0x34')][_0x8662('0x35')]?_0x1e03c0[_0x8662('0x34')]:_0xcbe85d[_0x8662('0x31')];_0x1e03c0[_0x8662('0x39')]=qs[_0x8662('0x54')](_0x336676[_0x8662('0x32')][_0x8662('0x54')]);_0x1e03c0[_0x8662('0x3a')]=qs[_0x8662('0x3b')](_['pick'](_0x336676[_0x8662('0x32')],_0xcbe85d[_0x8662('0x3b')]));if(_0x336676[_0x8662('0x32')][_0x8662('0x56')]){_0x1e03c0[_0x8662('0x3a')]=_[_0x8662('0x3d')](_0x1e03c0[_0x8662('0x3a')],{'$or':_['map'](_0x1e03c0['attributes'],function(_0x570bcb){var _0x20323d={};_0x20323d[_0x570bcb]={'$like':'%'+_0x336676[_0x8662('0x32')]['filter']+'%'};return _0x20323d;})});}_0x1e03c0=_[_0x8662('0x3d')]({},_0x1e03c0,_0x336676[_0x8662('0x3f')]);return _0x364a0b[_0x8662('0x84')](_0x1e03c0);}})[_0x8662('0x26')](function(_0x4c47a7){if(_0x4c47a7){_0x404d27=_0x4c47a7[_0x8662('0x35')];if(!_0x336676[_0x8662('0x32')][_0x8662('0x36')](_0x8662('0x37'))){_0x1e03c0[_0x8662('0x38')]=qs[_0x8662('0x38')](_0x336676[_0x8662('0x32')]['limit']);_0x1e03c0[_0x8662('0x1e')]=qs[_0x8662('0x1e')](_0x336676[_0x8662('0x32')][_0x8662('0x1e')]);}return _0x364a0b[_0x8662('0x84')](_0x1e03c0);}})[_0x8662('0x26')](function(_0x329386){if(_0x329386){return _0x329386?{'count':_0x404d27,'rows':_0x329386}:null;}})[_0x8662('0x26')](respondWithResult(_0x3696b7,null))['catch'](handleError(_0x3696b7,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index fd420a8..930e7f2 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 _0x3bd7=['emit','hasOwnProperty','exports','OpenchannelQueue','setMaxListeners','save','remove'];(function(_0x4f0a3a,_0x14f8d9){var _0x430cca=function(_0x48ae46){while(--_0x48ae46){_0x4f0a3a['push'](_0x4f0a3a['shift']());}};_0x430cca(++_0x14f8d9);}(_0x3bd7,0x199));var _0x73bd=function(_0xf16b1,_0x33c637){_0xf16b1=_0xf16b1-0x0;var _0x26f94d=_0x3bd7[_0xf16b1];return _0x26f94d;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require('../../mysqldb')['db'][_0x73bd('0x0')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x73bd('0x1')](0x0);var events={'afterCreate':_0x73bd('0x2'),'afterUpdate':'update','afterDestroy':_0x73bd('0x3')};function emitEvent(_0x355cd5){return function(_0x1b4214,_0x56fbc2,_0x16c7b5){OpenchannelQueueEvents['emit'](_0x355cd5+':'+_0x1b4214['id'],_0x1b4214);OpenchannelQueueEvents[_0x73bd('0x4')](_0x355cd5,_0x1b4214);_0x16c7b5(null);};}for(var e in events){if(events[_0x73bd('0x5')](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module[_0x73bd('0x6')]=OpenchannelQueueEvents; \ No newline at end of file +var _0xa23f=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','save','update'];(function(_0xf4a886,_0x2c5d9a){var _0x5baf0e=function(_0x21ec8c){while(--_0x21ec8c){_0xf4a886['push'](_0xf4a886['shift']());}};_0x5baf0e(++_0x2c5d9a);}(_0xa23f,0x7c));var _0xfa23=function(_0x36d1f1,_0x3bfdcc){_0x36d1f1=_0x36d1f1-0x0;var _0x1086ff=_0xa23f[_0x36d1f1];return _0x1086ff;};'use strict';var EventEmitter=require(_0xfa23('0x0'));var OpenchannelQueue=require(_0xfa23('0x1'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xfa23('0x2'),'afterUpdate':_0xfa23('0x3'),'afterDestroy':_0xfa23('0x4')};function emitEvent(_0x3fe466){return function(_0x5643b1,_0x86778e,_0x53d8c8){OpenchannelQueueEvents[_0xfa23('0x5')](_0x3fe466+':'+_0x5643b1['id'],_0x5643b1);OpenchannelQueueEvents[_0xfa23('0x5')](_0x3fe466,_0x5643b1);_0x53d8c8(null);};}for(var e in events){if(events[_0xfa23('0x6')](e)){var event=events[e];OpenchannelQueue[_0xfa23('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 662af40..0237574 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 _0x3451=['path','rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','openchannel_queues','lodash','util','api','moment','bluebird','request-promise'];(function(_0x432b91,_0x54f63c){var _0x36479d=function(_0x1f01d4){while(--_0x1f01d4){_0x432b91['push'](_0x432b91['shift']());}};_0x36479d(++_0x54f63c);}(_0x3451,0x19a));var _0x1345=function(_0x4e4566,_0x5b62dc){_0x4e4566=_0x4e4566-0x0;var _0x2875a2=_0x3451[_0x4e4566];return _0x2875a2;};'use strict';var _=require(_0x1345('0x0'));var util=require(_0x1345('0x1'));var logger=require('../../config/logger')(_0x1345('0x2'));var moment=require(_0x1345('0x3'));var BPromise=require(_0x1345('0x4'));var rp=require(_0x1345('0x5'));var fs=require('fs');var path=require(_0x1345('0x6'));var rimraf=require(_0x1345('0x7'));var config=require(_0x1345('0x8'));var attributes=require(_0x1345('0x9'));module[_0x1345('0xa')]=function(_0x30f76b,_0x1b67de){return _0x30f76b[_0x1345('0xb')]('OpenchannelQueue',attributes,{'tableName':_0x1345('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7ec8=['lodash','util','moment','bluebird','request-promise','path','../../config/environment','./openchannelQueue.attributes','exports','OpenchannelQueue','openchannel_queues'];(function(_0xcfd89f,_0x106e8f){var _0x59acd4=function(_0x2e187c){while(--_0x2e187c){_0xcfd89f['push'](_0xcfd89f['shift']());}};_0x59acd4(++_0x106e8f);}(_0x7ec8,0xb0));var _0x87ec=function(_0x2f2ff5,_0x352b1c){_0x2f2ff5=_0x2f2ff5-0x0;var _0x1df50c=_0x7ec8[_0x2f2ff5];return _0x1df50c;};'use strict';var _=require(_0x87ec('0x0'));var util=require(_0x87ec('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x87ec('0x2'));var BPromise=require(_0x87ec('0x3'));var rp=require(_0x87ec('0x4'));var fs=require('fs');var path=require(_0x87ec('0x5'));var rimraf=require('rimraf');var config=require(_0x87ec('0x6'));var attributes=require(_0x87ec('0x7'));module[_0x87ec('0x8')]=function(_0x2643a8,_0x5a7c4f){return _0x2643a8['define'](_0x87ec('0x9'),attributes,{'tableName':_0x87ec('0xa'),'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 c656403..a9a2551 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 _0xea39=['model','GetOpenchannelQueue','stringify','find','ShowOpenchannelQueue','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','OpenchannelQueue','findAll','options','raw','where','attributes','limit','map','include'];(function(_0x4ef5d7,_0x9e2db3){var _0x203459=function(_0x47855c){while(--_0x47855c){_0x4ef5d7['push'](_0x4ef5d7['shift']());}};_0x203459(++_0x9e2db3);}(_0xea39,0x77));var _0x9ea3=function(_0x290cd4,_0x49737d){_0x290cd4=_0x290cd4-0x0;var _0xe23028=_0xea39[_0x290cd4];return _0xe23028;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9ea3('0x0'));var fs=require('fs');var Redis=require(_0x9ea3('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x9ea3('0x2'));var logger=require(_0x9ea3('0x3'))('rpc');var config=require(_0x9ea3('0x4'));var jayson=require(_0x9ea3('0x5'));var client=jayson[_0x9ea3('0x6')]['http']({'port':0x232a});config['redis']=_[_0x9ea3('0x7')](config[_0x9ea3('0x8')],{'host':_0x9ea3('0x9'),'port':0x18eb});var socket=require(_0x9ea3('0xa'))(new Redis(config['redis']));require(_0x9ea3('0xb'))[_0x9ea3('0xc')](socket);function respondWithRpcPromise(_0x3e233d,_0x4c0f76,_0x572b34){return new BPromise(function(_0x5b203a,_0x37c604){return client[_0x9ea3('0xd')](_0x3e233d,_0x572b34)[_0x9ea3('0xe')](function(_0x132e60){logger[_0x9ea3('0xf')](_0x9ea3('0x10'),_0x4c0f76,_0x9ea3('0x11'));logger[_0x9ea3('0x12')]('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x4c0f76,_0x9ea3('0x11'),JSON['stringify'](_0x132e60));if(_0x132e60[_0x9ea3('0x13')]){if(_0x132e60[_0x9ea3('0x13')][_0x9ea3('0x14')]===0x1f4){logger[_0x9ea3('0x13')](_0x9ea3('0x10'),_0x4c0f76,_0x132e60[_0x9ea3('0x13')][_0x9ea3('0x15')]);return _0x37c604(_0x132e60['error'][_0x9ea3('0x15')]);}logger[_0x9ea3('0x13')](_0x9ea3('0x10'),_0x4c0f76,_0x132e60[_0x9ea3('0x13')][_0x9ea3('0x15')]);return _0x5b203a(_0x132e60['error'][_0x9ea3('0x15')]);}else{logger['info'](_0x9ea3('0x10'),_0x4c0f76,'request\x20sent');_0x5b203a(_0x132e60[_0x9ea3('0x16')][_0x9ea3('0x15')]);}})[_0x9ea3('0x17')](function(_0x441052){logger[_0x9ea3('0x13')](_0x9ea3('0x10'),_0x4c0f76,_0x441052);_0x37c604(_0x441052);});});}exports['GetOpenchannelQueue']=function(_0x473adb){var _0x276397=this;return new Promise(function(_0x7816da,_0x20c4bb){return db[_0x9ea3('0x18')][_0x9ea3('0x19')]({'raw':_0x473adb[_0x9ea3('0x1a')]?_0x473adb[_0x9ea3('0x1a')][_0x9ea3('0x1b')]===undefined?!![]:![]:!![],'where':_0x473adb[_0x9ea3('0x1a')]?_0x473adb['options'][_0x9ea3('0x1c')]||null:null,'attributes':_0x473adb[_0x9ea3('0x1a')]?_0x473adb[_0x9ea3('0x1a')][_0x9ea3('0x1d')]||null:null,'limit':_0x473adb[_0x9ea3('0x1a')]?_0x473adb[_0x9ea3('0x1a')][_0x9ea3('0x1e')]||null:null,'include':_0x473adb[_0x9ea3('0x1a')]?_0x473adb[_0x9ea3('0x1a')]['include']?_[_0x9ea3('0x1f')](_0x473adb[_0x9ea3('0x1a')][_0x9ea3('0x20')],function(_0x271d57){return{'model':db[_0x271d57[_0x9ea3('0x21')]],'as':_0x271d57['as'],'attributes':_0x271d57[_0x9ea3('0x1d')],'include':_0x271d57['include']?_[_0x9ea3('0x1f')](_0x271d57[_0x9ea3('0x20')],function(_0x13cbaa){return{'model':db[_0x13cbaa[_0x9ea3('0x21')]],'as':_0x13cbaa['as'],'attributes':_0x13cbaa[_0x9ea3('0x1d')],'include':_0x13cbaa[_0x9ea3('0x20')]?_['map'](_0x13cbaa[_0x9ea3('0x20')],function(_0x4e168e){return{'model':db[_0x4e168e[_0x9ea3('0x21')]],'as':_0x4e168e['as'],'attributes':_0x4e168e['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2862b5){logger[_0x9ea3('0xf')](_0x9ea3('0x22'),_0x473adb);logger[_0x9ea3('0x12')](_0x9ea3('0x22'),_0x473adb,JSON[_0x9ea3('0x23')](_0x2862b5));_0x7816da(_0x2862b5);})[_0x9ea3('0x17')](function(_0x33a5c5){logger[_0x9ea3('0x13')](_0x9ea3('0x22'),_0x33a5c5[_0x9ea3('0x15')],_0x473adb);_0x20c4bb(_0x276397[_0x9ea3('0x13')](0x1f4,_0x33a5c5[_0x9ea3('0x15')]));});});};exports['ShowOpenchannelQueue']=function(_0x253534){var _0x5735ce=this;return new Promise(function(_0x2b6732,_0x1a48b7){return db[_0x9ea3('0x18')][_0x9ea3('0x24')]({'raw':_0x253534[_0x9ea3('0x1a')]?_0x253534[_0x9ea3('0x1a')][_0x9ea3('0x1b')]===undefined?!![]:![]:!![],'where':_0x253534['options']?_0x253534['options'][_0x9ea3('0x1c')]||null:null,'attributes':_0x253534['options']?_0x253534['options']['attributes']||null:null,'include':_0x253534[_0x9ea3('0x1a')]?_0x253534[_0x9ea3('0x1a')][_0x9ea3('0x20')]?_[_0x9ea3('0x1f')](_0x253534[_0x9ea3('0x1a')][_0x9ea3('0x20')],function(_0x4574f4){return{'model':db[_0x4574f4[_0x9ea3('0x21')]],'as':_0x4574f4['as'],'attributes':_0x4574f4['attributes'],'include':_0x4574f4[_0x9ea3('0x20')]?_[_0x9ea3('0x1f')](_0x4574f4[_0x9ea3('0x20')],function(_0x5e2b22){return{'model':db[_0x5e2b22[_0x9ea3('0x21')]],'as':_0x5e2b22['as'],'attributes':_0x5e2b22[_0x9ea3('0x1d')],'include':_0x5e2b22['include']?_[_0x9ea3('0x1f')](_0x5e2b22[_0x9ea3('0x20')],function(_0x34b55e){return{'model':db[_0x34b55e[_0x9ea3('0x21')]],'as':_0x34b55e['as'],'attributes':_0x34b55e[_0x9ea3('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x9ea3('0xe')](function(_0x3f0ed8){logger['info'](_0x9ea3('0x25'),_0x253534);logger[_0x9ea3('0x12')](_0x9ea3('0x25'),_0x253534,JSON['stringify'](_0x3f0ed8));_0x2b6732(_0x3f0ed8);})[_0x9ea3('0x17')](function(_0x5bbe4a){logger[_0x9ea3('0x13')](_0x9ea3('0x25'),_0x5bbe4a['message'],_0x253534);_0x1a48b7(_0x5735ce['error'](0x1f4,_0x5bbe4a[_0x9ea3('0x15')]));});});}; \ No newline at end of file +var _0xb577=['OpenchannelQueue','findAll','options','raw','where','attributes','limit','map','include','model','catch','ShowOpenchannelQueue','find','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','http','redis','defaults','socket.io-emitter','./openchannelQueue.socket','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetOpenchannelQueue'];(function(_0x4a3898,_0x4c9853){var _0x25ceb0=function(_0x528b6d){while(--_0x528b6d){_0x4a3898['push'](_0x4a3898['shift']());}};_0x25ceb0(++_0x4c9853);}(_0xb577,0xa9));var _0x7b57=function(_0x43469e,_0x4e69d6){_0x43469e=_0x43469e-0x0;var _0xcefd2a=_0xb577[_0x43469e];return _0xcefd2a;};'use strict';var _=require('lodash');var util=require(_0x7b57('0x0'));var moment=require(_0x7b57('0x1'));var BPromise=require('bluebird');var rs=require(_0x7b57('0x2'));var fs=require('fs');var Redis=require(_0x7b57('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7b57('0x4'));var logger=require(_0x7b57('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7b57('0x6'));var client=jayson['client'][_0x7b57('0x7')]({'port':0x232a});config[_0x7b57('0x8')]=_[_0x7b57('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x7b57('0xa'))(new Redis(config[_0x7b57('0x8')]));require(_0x7b57('0xb'))[_0x7b57('0xc')](socket);function respondWithRpcPromise(_0x2187f4,_0x48fb7c,_0x2d3eca){return new BPromise(function(_0x424110,_0x1f25af){return client[_0x7b57('0xd')](_0x2187f4,_0x2d3eca)[_0x7b57('0xe')](function(_0x184750){logger[_0x7b57('0xf')](_0x7b57('0x10'),_0x48fb7c,_0x7b57('0x11'));logger[_0x7b57('0x12')](_0x7b57('0x13'),_0x48fb7c,_0x7b57('0x11'),JSON[_0x7b57('0x14')](_0x184750));if(_0x184750[_0x7b57('0x15')]){if(_0x184750['error'][_0x7b57('0x16')]===0x1f4){logger[_0x7b57('0x15')]('OpenchannelQueue,\x20%s,\x20%s',_0x48fb7c,_0x184750['error']['message']);return _0x1f25af(_0x184750[_0x7b57('0x15')][_0x7b57('0x17')]);}logger[_0x7b57('0x15')](_0x7b57('0x10'),_0x48fb7c,_0x184750['error'][_0x7b57('0x17')]);return _0x424110(_0x184750[_0x7b57('0x15')][_0x7b57('0x17')]);}else{logger['info']('OpenchannelQueue,\x20%s,\x20%s',_0x48fb7c,_0x7b57('0x11'));_0x424110(_0x184750[_0x7b57('0x18')][_0x7b57('0x17')]);}})['catch'](function(_0x2062b7){logger[_0x7b57('0x15')](_0x7b57('0x10'),_0x48fb7c,_0x2062b7);_0x1f25af(_0x2062b7);});});}exports[_0x7b57('0x19')]=function(_0x4a1175){var _0x29fda0=this;return new Promise(function(_0x1a7f81,_0x58b4a4){return db[_0x7b57('0x1a')][_0x7b57('0x1b')]({'raw':_0x4a1175['options']?_0x4a1175[_0x7b57('0x1c')][_0x7b57('0x1d')]===undefined?!![]:![]:!![],'where':_0x4a1175[_0x7b57('0x1c')]?_0x4a1175[_0x7b57('0x1c')][_0x7b57('0x1e')]||null:null,'attributes':_0x4a1175[_0x7b57('0x1c')]?_0x4a1175[_0x7b57('0x1c')][_0x7b57('0x1f')]||null:null,'limit':_0x4a1175[_0x7b57('0x1c')]?_0x4a1175['options'][_0x7b57('0x20')]||null:null,'include':_0x4a1175[_0x7b57('0x1c')]?_0x4a1175['options']['include']?_[_0x7b57('0x21')](_0x4a1175[_0x7b57('0x1c')][_0x7b57('0x22')],function(_0x149c6e){return{'model':db[_0x149c6e['model']],'as':_0x149c6e['as'],'attributes':_0x149c6e[_0x7b57('0x1f')],'include':_0x149c6e['include']?_['map'](_0x149c6e[_0x7b57('0x22')],function(_0x220739){return{'model':db[_0x220739[_0x7b57('0x23')]],'as':_0x220739['as'],'attributes':_0x220739[_0x7b57('0x1f')],'include':_0x220739[_0x7b57('0x22')]?_[_0x7b57('0x21')](_0x220739[_0x7b57('0x22')],function(_0x4e510b){return{'model':db[_0x4e510b[_0x7b57('0x23')]],'as':_0x4e510b['as'],'attributes':_0x4e510b[_0x7b57('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x7b57('0xe')](function(_0x11378d){logger[_0x7b57('0xf')](_0x7b57('0x19'),_0x4a1175);logger[_0x7b57('0x12')](_0x7b57('0x19'),_0x4a1175,JSON[_0x7b57('0x14')](_0x11378d));_0x1a7f81(_0x11378d);})[_0x7b57('0x24')](function(_0x1f6f38){logger[_0x7b57('0x15')](_0x7b57('0x19'),_0x1f6f38[_0x7b57('0x17')],_0x4a1175);_0x58b4a4(_0x29fda0[_0x7b57('0x15')](0x1f4,_0x1f6f38['message']));});});};exports[_0x7b57('0x25')]=function(_0x4ec781){var _0x19c969=this;return new Promise(function(_0x3f9107,_0xf6478c){return db[_0x7b57('0x1a')][_0x7b57('0x26')]({'raw':_0x4ec781['options']?_0x4ec781[_0x7b57('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x4ec781[_0x7b57('0x1c')]?_0x4ec781[_0x7b57('0x1c')][_0x7b57('0x1e')]||null:null,'attributes':_0x4ec781[_0x7b57('0x1c')]?_0x4ec781[_0x7b57('0x1c')][_0x7b57('0x1f')]||null:null,'include':_0x4ec781[_0x7b57('0x1c')]?_0x4ec781[_0x7b57('0x1c')][_0x7b57('0x22')]?_['map'](_0x4ec781['options']['include'],function(_0xd486d3){return{'model':db[_0xd486d3[_0x7b57('0x23')]],'as':_0xd486d3['as'],'attributes':_0xd486d3[_0x7b57('0x1f')],'include':_0xd486d3[_0x7b57('0x22')]?_[_0x7b57('0x21')](_0xd486d3[_0x7b57('0x22')],function(_0x1c5da6){return{'model':db[_0x1c5da6[_0x7b57('0x23')]],'as':_0x1c5da6['as'],'attributes':_0x1c5da6[_0x7b57('0x1f')],'include':_0x1c5da6[_0x7b57('0x22')]?_[_0x7b57('0x21')](_0x1c5da6['include'],function(_0x4a4d93){return{'model':db[_0x4a4d93[_0x7b57('0x23')]],'as':_0x4a4d93['as'],'attributes':_0x4a4d93['attributes']};}):[]};}):[]};}):[]:[]})[_0x7b57('0xe')](function(_0x537d96){logger[_0x7b57('0xf')](_0x7b57('0x25'),_0x4ec781);logger[_0x7b57('0x12')](_0x7b57('0x25'),_0x4ec781,JSON[_0x7b57('0x14')](_0x537d96));_0x3f9107(_0x537d96);})[_0x7b57('0x24')](function(_0x4fb1e7){logger[_0x7b57('0x15')](_0x7b57('0x25'),_0x4fb1e7['message'],_0x4ec781);_0xf6478c(_0x19c969[_0x7b57('0x15')](0x1f4,_0x4fb1e7[_0x7b57('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 2ea9b7b..ef77c08 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 _0xc912=['length','save','update','emit','removeListener'];(function(_0x56dc49,_0x42698d){var _0x5e28fd=function(_0x882a5d){while(--_0x882a5d){_0x56dc49['push'](_0x56dc49['shift']());}};_0x5e28fd(++_0x42698d);}(_0xc912,0x1dc));var _0x2c91=function(_0xb5f5e7,_0x2f6dde){_0xb5f5e7=_0xb5f5e7-0x0;var _0x376c0c=_0xc912[_0xb5f5e7];return _0x376c0c;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=[_0x2c91('0x0'),'remove',_0x2c91('0x1')];function createListener(_0x1d9a87,_0x52868c){return function(_0x4bc9e9){_0x52868c[_0x2c91('0x2')](_0x1d9a87,_0x4bc9e9);};}function removeListener(_0x3d1e9e,_0x23a82b){return function(){OpenchannelQueueEvents[_0x2c91('0x3')](_0x3d1e9e,_0x23a82b);};}exports['register']=function(_0x498f0f){for(var _0x583a27=0x0,_0x1440b4=events[_0x2c91('0x4')];_0x583a27<_0x1440b4;_0x583a27++){var _0x22f4e0=events[_0x583a27];var _0x71aae5=createListener('openchannelQueue:'+_0x22f4e0,_0x498f0f);OpenchannelQueueEvents['on'](_0x22f4e0,_0x71aae5);}}; \ No newline at end of file +var _0x1cdd=['length','openchannelQueue:','./openchannelQueue.events','remove','emit','removeListener','register'];(function(_0x268206,_0x557a4c){var _0x54887d=function(_0x1167fb){while(--_0x1167fb){_0x268206['push'](_0x268206['shift']());}};_0x54887d(++_0x557a4c);}(_0x1cdd,0x64));var _0xd1cd=function(_0x1149c6,_0x32d361){_0x1149c6=_0x1149c6-0x0;var _0x156401=_0x1cdd[_0x1149c6];return _0x156401;};'use strict';var OpenchannelQueueEvents=require(_0xd1cd('0x0'));var events=['save',_0xd1cd('0x1'),'update'];function createListener(_0x3eaf73,_0x4025cc){return function(_0x50c2b4){_0x4025cc[_0xd1cd('0x2')](_0x3eaf73,_0x50c2b4);};}function removeListener(_0x20dacb,_0x1dc2ea){return function(){OpenchannelQueueEvents[_0xd1cd('0x3')](_0x20dacb,_0x1dc2ea);};}exports[_0xd1cd('0x4')]=function(_0x5c20d7){for(var _0x54806b=0x0,_0xd2fe6f=events[_0xd1cd('0x5')];_0x54806b<_0xd2fe6f;_0x54806b++){var _0x5f135d=events[_0x54806b];var _0x465aab=createListener(_0xd1cd('0x6')+_0x5f135d,_0x5c20d7);OpenchannelQueueEvents['on'](_0x5f135d,_0x465aab);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 31f86a4..097282d 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 _0xda63=['isAuthenticated','/describe','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','get'];(function(_0x4e681d,_0x22fa7e){var _0x56c535=function(_0x211a81){while(--_0x211a81){_0x4e681d['push'](_0x4e681d['shift']());}};_0x56c535(++_0x22fa7e);}(_0xda63,0x92));var _0x3da6=function(_0x4821df,_0x50df79){_0x4821df=_0x4821df-0x0;var _0x4b05da=_0xda63[_0x4821df];return _0x4b05da;};'use strict';var multer=require(_0x3da6('0x0'));var util=require(_0x3da6('0x1'));var path=require(_0x3da6('0x2'));var timeout=require(_0x3da6('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x3da6('0x4'));var interaction=require(_0x3da6('0x5'));var config=require('../../config/environment');var controller=require('./openchannelQueueReport.controller');router[_0x3da6('0x6')]('/',auth[_0x3da6('0x7')](),controller['index']);router[_0x3da6('0x6')](_0x3da6('0x8'),auth['isAuthenticated'](),controller['describe']);router[_0x3da6('0x6')](_0x3da6('0x9'),auth[_0x3da6('0x7')](),controller['show']);router[_0x3da6('0xa')]('/',auth[_0x3da6('0x7')](),controller[_0x3da6('0xb')]);router[_0x3da6('0xc')](_0x3da6('0x9'),auth['isAuthenticated'](),controller[_0x3da6('0xd')]);router[_0x3da6('0xe')](_0x3da6('0x9'),auth[_0x3da6('0x7')](),controller[_0x3da6('0xf')]);module[_0x3da6('0x10')]=router; \ No newline at end of file +var _0x8583=['isAuthenticated','show','post','create','put','update','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','index','/:id'];(function(_0x240da8,_0x112b31){var _0x24356a=function(_0x138b6d){while(--_0x138b6d){_0x240da8['push'](_0x240da8['shift']());}};_0x24356a(++_0x112b31);}(_0x8583,0xeb));var _0x3858=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8583[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x3858('0x0'));var util=require(_0x3858('0x1'));var path=require(_0x3858('0x2'));var timeout=require(_0x3858('0x3'));var express=require(_0x3858('0x4'));var router=express['Router']();var auth=require(_0x3858('0x5'));var interaction=require(_0x3858('0x6'));var config=require(_0x3858('0x7'));var controller=require(_0x3858('0x8'));router[_0x3858('0x9')]('/',auth['isAuthenticated'](),controller[_0x3858('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x3858('0x9')](_0x3858('0xb'),auth[_0x3858('0xc')](),controller[_0x3858('0xd')]);router[_0x3858('0xe')]('/',auth[_0x3858('0xc')](),controller[_0x3858('0xf')]);router[_0x3858('0x10')](_0x3858('0xb'),auth[_0x3858('0xc')](),controller[_0x3858('0x11')]);router['delete']('/:id',auth[_0x3858('0xc')](),controller[_0x3858('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index a67c159..eebe590 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 _0x3264=['sequelize','STRING','DATE'];(function(_0x169283,_0x3d1036){var _0x44e43b=function(_0x505426){while(--_0x505426){_0x169283['push'](_0x169283['shift']());}};_0x44e43b(++_0x3d1036);}(_0x3264,0x1e0));var _0x4326=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x3264[_0x565c49];return _0x20ca34;};'use strict';var moment=require('moment');var Sequelize=require(_0x4326('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x4326('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x4326('0x1')]},'joinAt':{'type':Sequelize[_0x4326('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x4326('0x2')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x4326('0x1')]}}; \ No newline at end of file +var _0x05cf=['moment','sequelize','exports','STRING','DATE'];(function(_0x176329,_0x568c84){var _0x31997c=function(_0x3d64df){while(--_0x3d64df){_0x176329['push'](_0x176329['shift']());}};_0x31997c(++_0x568c84);}(_0x05cf,0xa0));var _0xf05c=function(_0x1804d3,_0x116bd1){_0x1804d3=_0x1804d3-0x0;var _0x5933cf=_0x05cf[_0x1804d3];return _0x5933cf;};'use strict';var moment=require(_0xf05c('0x0'));var Sequelize=require(_0xf05c('0x1'));module[_0xf05c('0x2')]={'uniqueid':{'type':Sequelize[_0xf05c('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xf05c('0x3')]},'joinAt':{'type':Sequelize[_0xf05c('0x4')]},'leaveAt':{'type':Sequelize[_0xf05c('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xf05c('0x4')]},'reason':{'type':Sequelize[_0xf05c('0x3')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 99a0fd6..af20025 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 _0xb10b=['include','findAll','rows','catch','OpenchannelQueueReport','find','create','body','update','describe','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','then','destroy','name','send','map','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','field','options','includeAll'];(function(_0x4ce302,_0x13f899){var _0x22ac01=function(_0x188166){while(--_0x188166){_0x4ce302['push'](_0x4ce302['shift']());}};_0x22ac01(++_0x13f899);}(_0xb10b,0x12a));var _0xbb10=function(_0x4fa916,_0x3ec36a){_0x4fa916=_0x4fa916-0x0;var _0x576439=_0xb10b[_0x4fa916];return _0x576439;};'use strict';var pdf=require(_0xbb10('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbb10('0x1'));var zipdir=require(_0xbb10('0x2'));var jsonpatch=require(_0xbb10('0x3'));var rp=require('request-promise');var moment=require(_0xbb10('0x4'));var BPromise=require(_0xbb10('0x5'));var Mustache=require(_0xbb10('0x6'));var util=require(_0xbb10('0x7'));var path=require(_0xbb10('0x8'));var sox=require(_0xbb10('0x9'));var csv=require('to-csv');var ejs=require(_0xbb10('0xa'));var fs=require('fs');var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0xf'));var querystring=require(_0xbb10('0x10'));var Papa=require(_0xbb10('0x11'));var Redis=require(_0xbb10('0x12'));var authService=require(_0xbb10('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb10('0x14'));var logger=require(_0xbb10('0x15'))(_0xbb10('0x16'));var utils=require('../../config/utils');var config=require(_0xbb10('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x44fb19,_0x916a32){_0x916a32=_0x916a32||0xcc;return function(_0x285009){if(_0x285009){return _0x44fb19[_0xbb10('0x18')](_0x916a32);}return _0x44fb19[_0xbb10('0x19')](_0x916a32)[_0xbb10('0x1a')]();};}function respondWithResult(_0x58a612,_0x26e021){_0x26e021=_0x26e021||0xc8;return function(_0x42d7e4){if(_0x42d7e4){return _0x58a612[_0xbb10('0x19')](_0x26e021)[_0xbb10('0x1b')](_0x42d7e4);}};}function respondWithFilteredResult(_0x3df17b,_0x2f2ebf){return function(_0x24a57b){if(_0x24a57b){var _0x36b5e8=_0x24a57b[_0xbb10('0x1c')],_0x3e26f4=_0x2f2ebf[_0xbb10('0x1d')],_0x2b184e=_0x2f2ebf[_0xbb10('0x1d')]+_0x2f2ebf[_0xbb10('0x1e')],_0x4a2bfc;if(_0x2b184e>=_0x36b5e8){_0x2b184e=_0x36b5e8;_0x4a2bfc=0xc8;}else{_0x4a2bfc=0xce;}_0x3df17b[_0xbb10('0x19')](_0x4a2bfc);return _0x3df17b[_0xbb10('0x1f')](_0xbb10('0x20'),_0x3e26f4+'-'+_0x2b184e+'/'+_0x36b5e8)[_0xbb10('0x1b')](_0x24a57b);}return null;};}function patchUpdates(_0xbf2906){return function(_0xe1c665){try{jsonpatch['apply'](_0xe1c665,_0xbf2906,!![]);}catch(_0x5ff0cf){return BPromise[_0xbb10('0x21')](_0x5ff0cf);}return _0xe1c665[_0xbb10('0x22')]();};}function saveUpdates(_0x109908,_0xdf237d){return function(_0x44e563){if(_0x44e563){return _0x44e563['update'](_0x109908)[_0xbb10('0x23')](function(_0x12ef77){return _0x12ef77;});}return null;};}function removeEntity(_0x50aea1,_0x4c4b0d){return function(_0x8e2b97){if(_0x8e2b97){return _0x8e2b97[_0xbb10('0x24')]()[_0xbb10('0x23')](function(){_0x50aea1[_0xbb10('0x19')](0xcc)[_0xbb10('0x1a')]();});}};}function handleEntityNotFound(_0x1824b7,_0x407cb4){return function(_0x436104){if(!_0x436104){_0x1824b7[_0xbb10('0x18')](0x194);}return _0x436104;};}function handleError(_0x395404,_0x3ba6cd){_0x3ba6cd=_0x3ba6cd||0x1f4;return function(_0x26ad93){logger['error'](_0x26ad93['stack']);if(_0x26ad93['name']){delete _0x26ad93[_0xbb10('0x25')];}_0x395404[_0xbb10('0x19')](_0x3ba6cd)[_0xbb10('0x26')](_0x26ad93);};}exports['index']=function(_0x2fdde9,_0x24d586){var _0x6ed43b={},_0x1d5e95={},_0x1acce9={'count':0x0,'rows':[]};var _0x20d946=_[_0xbb10('0x27')](db['OpenchannelQueueReport'][_0xbb10('0x28')],function(_0x21ac54){return{'name':_0x21ac54[_0xbb10('0x29')],'type':_0x21ac54[_0xbb10('0x2a')][_0xbb10('0x2b')]};});_0x1d5e95[_0xbb10('0x2c')]=_['map'](_0x20d946,_0xbb10('0x25'));_0x1d5e95['query']=_[_0xbb10('0x2d')](_0x2fdde9['query']);_0x1d5e95[_0xbb10('0x2e')]=_[_0xbb10('0x2f')](_0x1d5e95[_0xbb10('0x2c')],_0x1d5e95['query']);_0x6ed43b['attributes']=_[_0xbb10('0x2f')](_0x1d5e95[_0xbb10('0x2c')],qs['fields'](_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x31')]));_0x6ed43b[_0xbb10('0x32')]=_0x6ed43b[_0xbb10('0x32')][_0xbb10('0x33')]?_0x6ed43b[_0xbb10('0x32')]:_0x1d5e95[_0xbb10('0x2c')];if(!_0x2fdde9['query'][_0xbb10('0x34')](_0xbb10('0x35'))){_0x6ed43b[_0xbb10('0x1e')]=qs[_0xbb10('0x1e')](_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x1e')]);_0x6ed43b[_0xbb10('0x1d')]=qs[_0xbb10('0x1d')](_0x2fdde9[_0xbb10('0x30')]['offset']);}_0x6ed43b[_0xbb10('0x36')]=qs[_0xbb10('0x37')](_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x37')]);_0x6ed43b['where']=qs[_0xbb10('0x2e')](_['pick'](_0x2fdde9['query'],_0x1d5e95[_0xbb10('0x2e')]));if(_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x38')]){_0x6ed43b[_0xbb10('0x39')]=_[_0xbb10('0x3a')](_0x6ed43b[_0xbb10('0x39')],{'$or':_['map'](_0x20d946,function(_0x1e5bbd){if(_0x1e5bbd[_0xbb10('0x2a')]['key']!=='VIRTUAL'){var _0x5cd55f={};_0x5cd55f[_0x1e5bbd[_0xbb10('0x3b')]]={'$like':'%'+_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x38')]+'%'};return _0x5cd55f;}})});}_0x6ed43b=_['merge']({},_0x6ed43b,_0x2fdde9[_0xbb10('0x3c')]);var _0x3e8538={'where':_0x6ed43b[_0xbb10('0x39')]};return db['OpenchannelQueueReport'][_0xbb10('0x1c')](_0x3e8538)[_0xbb10('0x23')](function(_0x1dcd38){_0x1acce9[_0xbb10('0x1c')]=_0x1dcd38;if(_0x2fdde9['query'][_0xbb10('0x3d')]){_0x6ed43b[_0xbb10('0x3e')]=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0xbb10('0x3f')](_0x6ed43b);})[_0xbb10('0x23')](function(_0x44d6ae){_0x1acce9[_0xbb10('0x40')]=_0x44d6ae;return _0x1acce9;})[_0xbb10('0x23')](respondWithFilteredResult(_0x24d586,_0x6ed43b))[_0xbb10('0x41')](handleError(_0x24d586,null));};exports['show']=function(_0x1e8f79,_0x1c7fae){var _0x3e7b4c={'raw':!![],'where':{'id':_0x1e8f79['params']['id']}},_0x3d3c41={};_0x3d3c41[_0xbb10('0x2c')]=_[_0xbb10('0x2d')](db[_0xbb10('0x42')][_0xbb10('0x28')]);_0x3d3c41['query']=_[_0xbb10('0x2d')](_0x1e8f79[_0xbb10('0x30')]);_0x3d3c41['filters']=_['intersection'](_0x3d3c41[_0xbb10('0x2c')],_0x3d3c41['query']);_0x3e7b4c[_0xbb10('0x32')]=_[_0xbb10('0x2f')](_0x3d3c41['model'],qs[_0xbb10('0x31')](_0x1e8f79[_0xbb10('0x30')][_0xbb10('0x31')]));_0x3e7b4c['attributes']=_0x3e7b4c[_0xbb10('0x32')][_0xbb10('0x33')]?_0x3e7b4c[_0xbb10('0x32')]:_0x3d3c41[_0xbb10('0x2c')];if(_0x1e8f79[_0xbb10('0x30')][_0xbb10('0x3d')]){_0x3e7b4c[_0xbb10('0x3e')]=[{'all':!![]}];}_0x3e7b4c=_[_0xbb10('0x3a')]({},_0x3e7b4c,_0x1e8f79[_0xbb10('0x3c')]);return db[_0xbb10('0x42')][_0xbb10('0x43')](_0x3e7b4c)[_0xbb10('0x23')](handleEntityNotFound(_0x1c7fae,null))['then'](respondWithResult(_0x1c7fae,null))[_0xbb10('0x41')](handleError(_0x1c7fae,null));};exports[_0xbb10('0x44')]=function(_0x4a1248,_0x14e1cb){return db[_0xbb10('0x42')][_0xbb10('0x44')](_0x4a1248[_0xbb10('0x45')],{})[_0xbb10('0x23')](respondWithResult(_0x14e1cb,0xc9))[_0xbb10('0x41')](handleError(_0x14e1cb,null));};exports[_0xbb10('0x46')]=function(_0x5be85e,_0x4a9793){if(_0x5be85e[_0xbb10('0x45')]['id']){delete _0x5be85e[_0xbb10('0x45')]['id'];}return db[_0xbb10('0x42')]['find']({'where':{'id':_0x5be85e['params']['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0x4a9793,null))[_0xbb10('0x23')](saveUpdates(_0x5be85e[_0xbb10('0x45')],null))[_0xbb10('0x23')](respondWithResult(_0x4a9793,null))[_0xbb10('0x41')](handleError(_0x4a9793,null));};exports[_0xbb10('0x24')]=function(_0x2f2552,_0x460788){return db[_0xbb10('0x42')][_0xbb10('0x43')]({'where':{'id':_0x2f2552['params']['id']}})['then'](handleEntityNotFound(_0x460788,null))[_0xbb10('0x23')](removeEntity(_0x460788,null))[_0xbb10('0x41')](handleError(_0x460788,null));};exports[_0xbb10('0x47')]=function(_0xb014b0,_0x36aa7d){return db[_0xbb10('0x42')][_0xbb10('0x47')]()[_0xbb10('0x23')](respondWithResult(_0x36aa7d,null))[_0xbb10('0x41')](handleError(_0x36aa7d,null));}; \ No newline at end of file +var _0xb10b=['include','findAll','rows','catch','OpenchannelQueueReport','find','create','body','update','describe','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','then','destroy','name','send','map','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','field','options','includeAll'];(function(_0x37d8ef,_0x53fdea){var _0x520900=function(_0x314b09){while(--_0x314b09){_0x37d8ef['push'](_0x37d8ef['shift']());}};_0x520900(++_0x53fdea);}(_0xb10b,0x12a));var _0xbb10=function(_0x1f38c6,_0x428650){_0x1f38c6=_0x1f38c6-0x0;var _0x259367=_0xb10b[_0x1f38c6];return _0x259367;};'use strict';var pdf=require(_0xbb10('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbb10('0x1'));var zipdir=require(_0xbb10('0x2'));var jsonpatch=require(_0xbb10('0x3'));var rp=require('request-promise');var moment=require(_0xbb10('0x4'));var BPromise=require(_0xbb10('0x5'));var Mustache=require(_0xbb10('0x6'));var util=require(_0xbb10('0x7'));var path=require(_0xbb10('0x8'));var sox=require(_0xbb10('0x9'));var csv=require('to-csv');var ejs=require(_0xbb10('0xa'));var fs=require('fs');var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0xf'));var querystring=require(_0xbb10('0x10'));var Papa=require(_0xbb10('0x11'));var Redis=require(_0xbb10('0x12'));var authService=require(_0xbb10('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb10('0x14'));var logger=require(_0xbb10('0x15'))(_0xbb10('0x16'));var utils=require('../../config/utils');var config=require(_0xbb10('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x44fb19,_0x916a32){_0x916a32=_0x916a32||0xcc;return function(_0x285009){if(_0x285009){return _0x44fb19[_0xbb10('0x18')](_0x916a32);}return _0x44fb19[_0xbb10('0x19')](_0x916a32)[_0xbb10('0x1a')]();};}function respondWithResult(_0x58a612,_0x26e021){_0x26e021=_0x26e021||0xc8;return function(_0x42d7e4){if(_0x42d7e4){return _0x58a612[_0xbb10('0x19')](_0x26e021)[_0xbb10('0x1b')](_0x42d7e4);}};}function respondWithFilteredResult(_0x3df17b,_0x2f2ebf){return function(_0x24a57b){if(_0x24a57b){var _0x36b5e8=_0x24a57b[_0xbb10('0x1c')],_0x3e26f4=_0x2f2ebf[_0xbb10('0x1d')],_0x2b184e=_0x2f2ebf[_0xbb10('0x1d')]+_0x2f2ebf[_0xbb10('0x1e')],_0x4a2bfc;if(_0x2b184e>=_0x36b5e8){_0x2b184e=_0x36b5e8;_0x4a2bfc=0xc8;}else{_0x4a2bfc=0xce;}_0x3df17b[_0xbb10('0x19')](_0x4a2bfc);return _0x3df17b[_0xbb10('0x1f')](_0xbb10('0x20'),_0x3e26f4+'-'+_0x2b184e+'/'+_0x36b5e8)[_0xbb10('0x1b')](_0x24a57b);}return null;};}function patchUpdates(_0xbf2906){return function(_0xe1c665){try{jsonpatch['apply'](_0xe1c665,_0xbf2906,!![]);}catch(_0x5ff0cf){return BPromise[_0xbb10('0x21')](_0x5ff0cf);}return _0xe1c665[_0xbb10('0x22')]();};}function saveUpdates(_0x109908,_0xdf237d){return function(_0x44e563){if(_0x44e563){return _0x44e563['update'](_0x109908)[_0xbb10('0x23')](function(_0x12ef77){return _0x12ef77;});}return null;};}function removeEntity(_0x50aea1,_0x4c4b0d){return function(_0x8e2b97){if(_0x8e2b97){return _0x8e2b97[_0xbb10('0x24')]()[_0xbb10('0x23')](function(){_0x50aea1[_0xbb10('0x19')](0xcc)[_0xbb10('0x1a')]();});}};}function handleEntityNotFound(_0x1824b7,_0x407cb4){return function(_0x436104){if(!_0x436104){_0x1824b7[_0xbb10('0x18')](0x194);}return _0x436104;};}function handleError(_0x395404,_0x3ba6cd){_0x3ba6cd=_0x3ba6cd||0x1f4;return function(_0x26ad93){logger['error'](_0x26ad93['stack']);if(_0x26ad93['name']){delete _0x26ad93[_0xbb10('0x25')];}_0x395404[_0xbb10('0x19')](_0x3ba6cd)[_0xbb10('0x26')](_0x26ad93);};}exports['index']=function(_0x2fdde9,_0x24d586){var _0x6ed43b={},_0x1d5e95={},_0x1acce9={'count':0x0,'rows':[]};var _0x20d946=_[_0xbb10('0x27')](db['OpenchannelQueueReport'][_0xbb10('0x28')],function(_0x21ac54){return{'name':_0x21ac54[_0xbb10('0x29')],'type':_0x21ac54[_0xbb10('0x2a')][_0xbb10('0x2b')]};});_0x1d5e95[_0xbb10('0x2c')]=_['map'](_0x20d946,_0xbb10('0x25'));_0x1d5e95['query']=_[_0xbb10('0x2d')](_0x2fdde9['query']);_0x1d5e95[_0xbb10('0x2e')]=_[_0xbb10('0x2f')](_0x1d5e95[_0xbb10('0x2c')],_0x1d5e95['query']);_0x6ed43b['attributes']=_[_0xbb10('0x2f')](_0x1d5e95[_0xbb10('0x2c')],qs['fields'](_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x31')]));_0x6ed43b[_0xbb10('0x32')]=_0x6ed43b[_0xbb10('0x32')][_0xbb10('0x33')]?_0x6ed43b[_0xbb10('0x32')]:_0x1d5e95[_0xbb10('0x2c')];if(!_0x2fdde9['query'][_0xbb10('0x34')](_0xbb10('0x35'))){_0x6ed43b[_0xbb10('0x1e')]=qs[_0xbb10('0x1e')](_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x1e')]);_0x6ed43b[_0xbb10('0x1d')]=qs[_0xbb10('0x1d')](_0x2fdde9[_0xbb10('0x30')]['offset']);}_0x6ed43b[_0xbb10('0x36')]=qs[_0xbb10('0x37')](_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x37')]);_0x6ed43b['where']=qs[_0xbb10('0x2e')](_['pick'](_0x2fdde9['query'],_0x1d5e95[_0xbb10('0x2e')]));if(_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x38')]){_0x6ed43b[_0xbb10('0x39')]=_[_0xbb10('0x3a')](_0x6ed43b[_0xbb10('0x39')],{'$or':_['map'](_0x20d946,function(_0x1e5bbd){if(_0x1e5bbd[_0xbb10('0x2a')]['key']!=='VIRTUAL'){var _0x5cd55f={};_0x5cd55f[_0x1e5bbd[_0xbb10('0x3b')]]={'$like':'%'+_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x38')]+'%'};return _0x5cd55f;}})});}_0x6ed43b=_['merge']({},_0x6ed43b,_0x2fdde9[_0xbb10('0x3c')]);var _0x3e8538={'where':_0x6ed43b[_0xbb10('0x39')]};return db['OpenchannelQueueReport'][_0xbb10('0x1c')](_0x3e8538)[_0xbb10('0x23')](function(_0x1dcd38){_0x1acce9[_0xbb10('0x1c')]=_0x1dcd38;if(_0x2fdde9['query'][_0xbb10('0x3d')]){_0x6ed43b[_0xbb10('0x3e')]=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0xbb10('0x3f')](_0x6ed43b);})[_0xbb10('0x23')](function(_0x44d6ae){_0x1acce9[_0xbb10('0x40')]=_0x44d6ae;return _0x1acce9;})[_0xbb10('0x23')](respondWithFilteredResult(_0x24d586,_0x6ed43b))[_0xbb10('0x41')](handleError(_0x24d586,null));};exports['show']=function(_0x1e8f79,_0x1c7fae){var _0x3e7b4c={'raw':!![],'where':{'id':_0x1e8f79['params']['id']}},_0x3d3c41={};_0x3d3c41[_0xbb10('0x2c')]=_[_0xbb10('0x2d')](db[_0xbb10('0x42')][_0xbb10('0x28')]);_0x3d3c41['query']=_[_0xbb10('0x2d')](_0x1e8f79[_0xbb10('0x30')]);_0x3d3c41['filters']=_['intersection'](_0x3d3c41[_0xbb10('0x2c')],_0x3d3c41['query']);_0x3e7b4c[_0xbb10('0x32')]=_[_0xbb10('0x2f')](_0x3d3c41['model'],qs[_0xbb10('0x31')](_0x1e8f79[_0xbb10('0x30')][_0xbb10('0x31')]));_0x3e7b4c['attributes']=_0x3e7b4c[_0xbb10('0x32')][_0xbb10('0x33')]?_0x3e7b4c[_0xbb10('0x32')]:_0x3d3c41[_0xbb10('0x2c')];if(_0x1e8f79[_0xbb10('0x30')][_0xbb10('0x3d')]){_0x3e7b4c[_0xbb10('0x3e')]=[{'all':!![]}];}_0x3e7b4c=_[_0xbb10('0x3a')]({},_0x3e7b4c,_0x1e8f79[_0xbb10('0x3c')]);return db[_0xbb10('0x42')][_0xbb10('0x43')](_0x3e7b4c)[_0xbb10('0x23')](handleEntityNotFound(_0x1c7fae,null))['then'](respondWithResult(_0x1c7fae,null))[_0xbb10('0x41')](handleError(_0x1c7fae,null));};exports[_0xbb10('0x44')]=function(_0x4a1248,_0x14e1cb){return db[_0xbb10('0x42')][_0xbb10('0x44')](_0x4a1248[_0xbb10('0x45')],{})[_0xbb10('0x23')](respondWithResult(_0x14e1cb,0xc9))[_0xbb10('0x41')](handleError(_0x14e1cb,null));};exports[_0xbb10('0x46')]=function(_0x5be85e,_0x4a9793){if(_0x5be85e[_0xbb10('0x45')]['id']){delete _0x5be85e[_0xbb10('0x45')]['id'];}return db[_0xbb10('0x42')]['find']({'where':{'id':_0x5be85e['params']['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0x4a9793,null))[_0xbb10('0x23')](saveUpdates(_0x5be85e[_0xbb10('0x45')],null))[_0xbb10('0x23')](respondWithResult(_0x4a9793,null))[_0xbb10('0x41')](handleError(_0x4a9793,null));};exports[_0xbb10('0x24')]=function(_0x2f2552,_0x460788){return db[_0xbb10('0x42')][_0xbb10('0x43')]({'where':{'id':_0x2f2552['params']['id']}})['then'](handleEntityNotFound(_0x460788,null))[_0xbb10('0x23')](removeEntity(_0x460788,null))[_0xbb10('0x41')](handleError(_0x460788,null));};exports[_0xbb10('0x47')]=function(_0xb014b0,_0x36aa7d){return db[_0xbb10('0x42')][_0xbb10('0x47')]()[_0xbb10('0x23')](respondWithResult(_0x36aa7d,null))[_0xbb10('0x41')](handleError(_0x36aa7d,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 1dced9b..25b9a9e 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 _0x8d97=['moment','bluebird','request-promise','path','rimraf','./openchannelQueueReport.attributes','exports','report_openchannel_queue','uniqueid','util','../../config/logger'];(function(_0x3ba9ec,_0x49c244){var _0x39f681=function(_0x5da9c0){while(--_0x5da9c0){_0x3ba9ec['push'](_0x3ba9ec['shift']());}};_0x39f681(++_0x49c244);}(_0x8d97,0x82));var _0x78d9=function(_0x226887,_0x2309ca){_0x226887=_0x226887-0x0;var _0x4c2a04=_0x8d97[_0x226887];return _0x4c2a04;};'use strict';var _=require('lodash');var util=require(_0x78d9('0x0'));var logger=require(_0x78d9('0x1'))('api');var moment=require(_0x78d9('0x2'));var BPromise=require(_0x78d9('0x3'));var rp=require(_0x78d9('0x4'));var fs=require('fs');var path=require(_0x78d9('0x5'));var rimraf=require(_0x78d9('0x6'));var config=require('../../config/environment');var attributes=require(_0x78d9('0x7'));module[_0x78d9('0x8')]=function(_0x7bf859,_0x59b38c){return _0x7bf859['define']('OpenchannelQueueReport',attributes,{'tableName':_0x78d9('0x9'),'paranoid':![],'indexes':[{'name':_0x78d9('0xa'),'fields':[_0x78d9('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc7a9=['moment','bluebird','request-promise','path','rimraf','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash','util','../../config/logger','api'];(function(_0x11ac79,_0x302a89){var _0x2a3063=function(_0x252b46){while(--_0x252b46){_0x11ac79['push'](_0x11ac79['shift']());}};_0x2a3063(++_0x302a89);}(_0xc7a9,0x134));var _0x9c7a=function(_0xc9acd9,_0x176421){_0xc9acd9=_0xc9acd9-0x0;var _0x403136=_0xc7a9[_0xc9acd9];return _0x403136;};'use strict';var _=require(_0x9c7a('0x0'));var util=require(_0x9c7a('0x1'));var logger=require(_0x9c7a('0x2'))(_0x9c7a('0x3'));var moment=require(_0x9c7a('0x4'));var BPromise=require(_0x9c7a('0x5'));var rp=require(_0x9c7a('0x6'));var fs=require('fs');var path=require(_0x9c7a('0x7'));var rimraf=require(_0x9c7a('0x8'));var config=require('../../config/environment');var attributes=require('./openchannelQueueReport.attributes');module['exports']=function(_0x1f3bbf,_0x3e95ab){return _0x1f3bbf['define'](_0x9c7a('0x9'),attributes,{'tableName':_0x9c7a('0xa'),'paranoid':![],'indexes':[{'name':_0x9c7a('0xb'),'fields':[_0x9c7a('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 70e3d46..3931731 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 _0x34bd=['debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateOpenchannelQueueReport','body','options','raw','where','attributes','limit','UpdateOpenchannelQueueReport','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent'];(function(_0x1d177f,_0x2752d4){var _0x2f55b5=function(_0x2da11b){while(--_0x2da11b){_0x1d177f['push'](_0x1d177f['shift']());}};_0x2f55b5(++_0x2752d4);}(_0x34bd,0x1d2));var _0xd34b=function(_0x1f0714,_0xde0530){_0x1f0714=_0x1f0714-0x0;var _0x33669d=_0x34bd[_0x1f0714];return _0x33669d;};'use strict';var _=require(_0xd34b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd34b('0x1'));var rs=require(_0xd34b('0x2'));var fs=require('fs');var Redis=require(_0xd34b('0x3'));var db=require(_0xd34b('0x4'))['db'];var utils=require(_0xd34b('0x5'));var logger=require(_0xd34b('0x6'))(_0xd34b('0x7'));var config=require('../../config/environment');var jayson=require(_0xd34b('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x56e3eb,_0x30d93b,_0x3654a5){return new BPromise(function(_0xf51a08,_0x25bce7){return client[_0xd34b('0x9')](_0x56e3eb,_0x3654a5)[_0xd34b('0xa')](function(_0x738328){logger[_0xd34b('0xb')](_0xd34b('0xc'),_0x30d93b,_0xd34b('0xd'));logger[_0xd34b('0xe')](_0xd34b('0xf'),_0x30d93b,'request\x20sent',JSON[_0xd34b('0x10')](_0x738328));if(_0x738328['error']){if(_0x738328[_0xd34b('0x11')][_0xd34b('0x12')]===0x1f4){logger[_0xd34b('0x11')](_0xd34b('0xc'),_0x30d93b,_0x738328[_0xd34b('0x11')][_0xd34b('0x13')]);return _0x25bce7(_0x738328['error'][_0xd34b('0x13')]);}logger[_0xd34b('0x11')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x30d93b,_0x738328[_0xd34b('0x11')][_0xd34b('0x13')]);return _0xf51a08(_0x738328[_0xd34b('0x11')]['message']);}else{logger[_0xd34b('0xb')](_0xd34b('0xc'),_0x30d93b,'request\x20sent');_0xf51a08(_0x738328[_0xd34b('0x14')]['message']);}})[_0xd34b('0x15')](function(_0x438b61){logger[_0xd34b('0x11')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x30d93b,_0x438b61);_0x25bce7(_0x438b61);});});}exports[_0xd34b('0x16')]=function(_0x193965){var _0x1bbbb1=this;return new Promise(function(_0x105f67,_0x206f16){return db['OpenchannelQueueReport']['create'](_0x193965[_0xd34b('0x17')],{'raw':_0x193965[_0xd34b('0x18')]?_0x193965[_0xd34b('0x18')][_0xd34b('0x19')]===undefined?!![]:![]:!![]})[_0xd34b('0xa')](function(_0x3152a9){logger['info'](_0xd34b('0x16'),_0x193965);logger[_0xd34b('0xe')](_0xd34b('0x16'),_0x193965,JSON[_0xd34b('0x10')](_0x3152a9));_0x105f67(_0x3152a9);})['catch'](function(_0x45c569){logger[_0xd34b('0x11')](_0xd34b('0x16'),_0x45c569[_0xd34b('0x13')],_0x193965);_0x206f16(_0x1bbbb1[_0xd34b('0x11')](0x1f4,_0x45c569[_0xd34b('0x13')]));});});};exports['UpdateOpenchannelQueueReport']=function(_0x50da22){var _0x49c485=this;return new Promise(function(_0x2187c0,_0x2ae0e1){return db['OpenchannelQueueReport']['update'](_0x50da22['body'],{'raw':_0x50da22[_0xd34b('0x18')]?_0x50da22[_0xd34b('0x18')][_0xd34b('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x50da22['options']?_0x50da22[_0xd34b('0x18')][_0xd34b('0x1a')]||null:null,'attributes':_0x50da22['options']?_0x50da22[_0xd34b('0x18')][_0xd34b('0x1b')]||null:null,'limit':_0x50da22[_0xd34b('0x18')]?_0x50da22['options'][_0xd34b('0x1c')]||null:null})['then'](function(_0x182266){logger[_0xd34b('0xb')](_0xd34b('0x1d'),_0x50da22);logger['debug'](_0xd34b('0x1d'),_0x50da22,JSON['stringify'](_0x182266));_0x2187c0(_0x182266);})[_0xd34b('0x15')](function(_0x47c0b3){logger[_0xd34b('0x11')]('UpdateOpenchannelQueueReport',_0x47c0b3[_0xd34b('0x13')],_0x50da22);_0x2ae0e1(_0x49c485[_0xd34b('0x11')](0x1f4,_0x47c0b3['message']));});});}; \ No newline at end of file +var _0xb2f3=['create','body','options','raw','info','UpdateOpenchannelQueueReport','update','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelQueueReport,\x20%s,\x20%s','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport'];(function(_0x3c9c31,_0x4c6b0f){var _0x39d0ca=function(_0x46be88){while(--_0x46be88){_0x3c9c31['push'](_0x3c9c31['shift']());}};_0x39d0ca(++_0x4c6b0f);}(_0xb2f3,0xfd));var _0x3b2f=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0xb2f3[_0x35885a];return _0xe86249;};'use strict';var _=require(_0x3b2f('0x0'));var util=require(_0x3b2f('0x1'));var moment=require(_0x3b2f('0x2'));var BPromise=require(_0x3b2f('0x3'));var rs=require(_0x3b2f('0x4'));var fs=require('fs');var Redis=require(_0x3b2f('0x5'));var db=require(_0x3b2f('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x3b2f('0x7'))(_0x3b2f('0x8'));var config=require(_0x3b2f('0x9'));var jayson=require(_0x3b2f('0xa'));var client=jayson[_0x3b2f('0xb')][_0x3b2f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x26719d,_0x4b3632,_0x200ca4){return new BPromise(function(_0x56e425,_0x266ed2){return client[_0x3b2f('0xd')](_0x26719d,_0x200ca4)[_0x3b2f('0xe')](function(_0x25134f){logger['info']('OpenchannelQueueReport,\x20%s,\x20%s',_0x4b3632,_0x3b2f('0xf'));logger[_0x3b2f('0x10')](_0x3b2f('0x11'),_0x4b3632,_0x3b2f('0xf'),JSON[_0x3b2f('0x12')](_0x25134f));if(_0x25134f[_0x3b2f('0x13')]){if(_0x25134f[_0x3b2f('0x13')][_0x3b2f('0x14')]===0x1f4){logger[_0x3b2f('0x13')](_0x3b2f('0x15'),_0x4b3632,_0x25134f[_0x3b2f('0x13')][_0x3b2f('0x16')]);return _0x266ed2(_0x25134f[_0x3b2f('0x13')][_0x3b2f('0x16')]);}logger[_0x3b2f('0x13')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x4b3632,_0x25134f[_0x3b2f('0x13')]['message']);return _0x56e425(_0x25134f[_0x3b2f('0x13')][_0x3b2f('0x16')]);}else{logger['info'](_0x3b2f('0x15'),_0x4b3632,'request\x20sent');_0x56e425(_0x25134f[_0x3b2f('0x17')][_0x3b2f('0x16')]);}})[_0x3b2f('0x18')](function(_0xd2b1e9){logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0x4b3632,_0xd2b1e9);_0x266ed2(_0xd2b1e9);});});}exports[_0x3b2f('0x19')]=function(_0x6d8948){var _0x3ff190=this;return new Promise(function(_0x3040d3,_0x3dea8b){return db[_0x3b2f('0x1a')][_0x3b2f('0x1b')](_0x6d8948[_0x3b2f('0x1c')],{'raw':_0x6d8948[_0x3b2f('0x1d')]?_0x6d8948[_0x3b2f('0x1d')][_0x3b2f('0x1e')]===undefined?!![]:![]:!![]})[_0x3b2f('0xe')](function(_0x1688f4){logger[_0x3b2f('0x1f')]('CreateOpenchannelQueueReport',_0x6d8948);logger[_0x3b2f('0x10')](_0x3b2f('0x19'),_0x6d8948,JSON[_0x3b2f('0x12')](_0x1688f4));_0x3040d3(_0x1688f4);})[_0x3b2f('0x18')](function(_0x57e96a){logger[_0x3b2f('0x13')](_0x3b2f('0x19'),_0x57e96a['message'],_0x6d8948);_0x3dea8b(_0x3ff190[_0x3b2f('0x13')](0x1f4,_0x57e96a['message']));});});};exports[_0x3b2f('0x20')]=function(_0x94aced){var _0x267fa5=this;return new Promise(function(_0x409401,_0x51c00a){return db[_0x3b2f('0x1a')][_0x3b2f('0x21')](_0x94aced['body'],{'raw':_0x94aced['options']?_0x94aced[_0x3b2f('0x1d')][_0x3b2f('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x94aced[_0x3b2f('0x1d')]?_0x94aced[_0x3b2f('0x1d')]['where']||null:null,'attributes':_0x94aced['options']?_0x94aced[_0x3b2f('0x1d')][_0x3b2f('0x22')]||null:null,'limit':_0x94aced[_0x3b2f('0x1d')]?_0x94aced[_0x3b2f('0x1d')]['limit']||null:null})[_0x3b2f('0xe')](function(_0x4b76ea){logger[_0x3b2f('0x1f')](_0x3b2f('0x20'),_0x94aced);logger[_0x3b2f('0x10')](_0x3b2f('0x20'),_0x94aced,JSON[_0x3b2f('0x12')](_0x4b76ea));_0x409401(_0x4b76ea);})[_0x3b2f('0x18')](function(_0x593f3d){logger[_0x3b2f('0x13')](_0x3b2f('0x20'),_0x593f3d['message'],_0x94aced);_0x51c00a(_0x267fa5['error'](0x1f4,_0x593f3d[_0x3b2f('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 28addaf..f7f704e 100644 --- a/server/api/openchannelTransferReport/index.js +++ b/server/api/openchannelTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['put','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','/describe','/:id','post','create'];(function(_0x47bc5e,_0x6fc500){var _0x323a59=function(_0x32df89){while(--_0x32df89){_0x47bc5e['push'](_0x47bc5e['shift']());}};_0x323a59(++_0x6fc500);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['describe']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0xd')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);module[_0x0a9e('0xf')]=router; \ No newline at end of file +var _0xa9e0=['put','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','/describe','/:id','post','create'];(function(_0x2eb3db,_0x4a32c0){var _0x358f33=function(_0x1d0588){while(--_0x1d0588){_0x2eb3db['push'](_0x2eb3db['shift']());}};_0x358f33(++_0x4a32c0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['describe']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0xd')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);module[_0x0a9e('0xf')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 314ccf1..cd99edb 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 _0x5894=['STRING','ENUM','account','agent','queue','DATE','moment','sequelize','exports'];(function(_0x172747,_0x1732bd){var _0x509692=function(_0x448c56){while(--_0x448c56){_0x172747['push'](_0x172747['shift']());}};_0x509692(++_0x1732bd);}(_0x5894,0x1b6));var _0x4589=function(_0x682476,_0x4123d6){_0x682476=_0x682476-0x0;var _0x7a5123=_0x5894[_0x682476];return _0x7a5123;};'use strict';var moment=require(_0x4589('0x0'));var Sequelize=require(_0x4589('0x1'));module[_0x4589('0x2')]={'uniqueid':{'type':Sequelize[_0x4589('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x4589('0x4')](_0x4589('0x5'),_0x4589('0x6'),_0x4589('0x7')),'allowNull':![],'defaultValue':_0x4589('0x7')},'transferredAt':{'type':Sequelize[_0x4589('0x8')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0x2855=['ENUM','account','agent','queue','NOW','moment','sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2855,0x176));var _0x5285=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0x2855[_0x12d033];return _0x3b4e80;};'use strict';var moment=require(_0x5285('0x0'));var Sequelize=require(_0x5285('0x1'));module[_0x5285('0x2')]={'uniqueid':{'type':Sequelize[_0x5285('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x5285('0x4')](_0x5285('0x5'),_0x5285('0x6'),_0x5285('0x7')),'allowNull':![],'defaultValue':_0x5285('0x7')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x5285('0x8')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 6dba452..c2b8d5a 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 _0xb10b=['include','findAll','rows','catch','OpenchannelTransferReport','find','create','body','update','describe','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','then','destroy','name','send','map','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','field','options','includeAll'];(function(_0x35e7fb,_0x57b674){var _0x4257e1=function(_0x4a6e04){while(--_0x4a6e04){_0x35e7fb['push'](_0x35e7fb['shift']());}};_0x4257e1(++_0x57b674);}(_0xb10b,0x12a));var _0xbb10=function(_0x4226d6,_0x3864ca){_0x4226d6=_0x4226d6-0x0;var _0x19655b=_0xb10b[_0x4226d6];return _0x19655b;};'use strict';var pdf=require(_0xbb10('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbb10('0x1'));var zipdir=require(_0xbb10('0x2'));var jsonpatch=require(_0xbb10('0x3'));var rp=require('request-promise');var moment=require(_0xbb10('0x4'));var BPromise=require(_0xbb10('0x5'));var Mustache=require(_0xbb10('0x6'));var util=require(_0xbb10('0x7'));var path=require(_0xbb10('0x8'));var sox=require(_0xbb10('0x9'));var csv=require('to-csv');var ejs=require(_0xbb10('0xa'));var fs=require('fs');var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0xf'));var querystring=require(_0xbb10('0x10'));var Papa=require(_0xbb10('0x11'));var Redis=require(_0xbb10('0x12'));var authService=require(_0xbb10('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb10('0x14'));var logger=require(_0xbb10('0x15'))(_0xbb10('0x16'));var utils=require('../../config/utils');var config=require(_0xbb10('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x44fb19,_0x916a32){_0x916a32=_0x916a32||0xcc;return function(_0x285009){if(_0x285009){return _0x44fb19[_0xbb10('0x18')](_0x916a32);}return _0x44fb19[_0xbb10('0x19')](_0x916a32)[_0xbb10('0x1a')]();};}function respondWithResult(_0x58a612,_0x26e021){_0x26e021=_0x26e021||0xc8;return function(_0x42d7e4){if(_0x42d7e4){return _0x58a612[_0xbb10('0x19')](_0x26e021)[_0xbb10('0x1b')](_0x42d7e4);}};}function respondWithFilteredResult(_0x3df17b,_0x2f2ebf){return function(_0x24a57b){if(_0x24a57b){var _0x36b5e8=_0x24a57b[_0xbb10('0x1c')],_0x3e26f4=_0x2f2ebf[_0xbb10('0x1d')],_0x2b184e=_0x2f2ebf[_0xbb10('0x1d')]+_0x2f2ebf[_0xbb10('0x1e')],_0x4a2bfc;if(_0x2b184e>=_0x36b5e8){_0x2b184e=_0x36b5e8;_0x4a2bfc=0xc8;}else{_0x4a2bfc=0xce;}_0x3df17b[_0xbb10('0x19')](_0x4a2bfc);return _0x3df17b[_0xbb10('0x1f')](_0xbb10('0x20'),_0x3e26f4+'-'+_0x2b184e+'/'+_0x36b5e8)[_0xbb10('0x1b')](_0x24a57b);}return null;};}function patchUpdates(_0xbf2906){return function(_0xe1c665){try{jsonpatch['apply'](_0xe1c665,_0xbf2906,!![]);}catch(_0x5ff0cf){return BPromise[_0xbb10('0x21')](_0x5ff0cf);}return _0xe1c665[_0xbb10('0x22')]();};}function saveUpdates(_0x109908,_0xdf237d){return function(_0x44e563){if(_0x44e563){return _0x44e563['update'](_0x109908)[_0xbb10('0x23')](function(_0x12ef77){return _0x12ef77;});}return null;};}function removeEntity(_0x50aea1,_0x4c4b0d){return function(_0x8e2b97){if(_0x8e2b97){return _0x8e2b97[_0xbb10('0x24')]()[_0xbb10('0x23')](function(){_0x50aea1[_0xbb10('0x19')](0xcc)[_0xbb10('0x1a')]();});}};}function handleEntityNotFound(_0x1824b7,_0x407cb4){return function(_0x436104){if(!_0x436104){_0x1824b7[_0xbb10('0x18')](0x194);}return _0x436104;};}function handleError(_0x395404,_0x3ba6cd){_0x3ba6cd=_0x3ba6cd||0x1f4;return function(_0x26ad93){logger['error'](_0x26ad93['stack']);if(_0x26ad93['name']){delete _0x26ad93[_0xbb10('0x25')];}_0x395404[_0xbb10('0x19')](_0x3ba6cd)[_0xbb10('0x26')](_0x26ad93);};}exports['index']=function(_0x2fdde9,_0x24d586){var _0x6ed43b={},_0x1d5e95={},_0x1acce9={'count':0x0,'rows':[]};var _0x20d946=_[_0xbb10('0x27')](db['OpenchannelTransferReport'][_0xbb10('0x28')],function(_0x21ac54){return{'name':_0x21ac54[_0xbb10('0x29')],'type':_0x21ac54[_0xbb10('0x2a')][_0xbb10('0x2b')]};});_0x1d5e95[_0xbb10('0x2c')]=_['map'](_0x20d946,_0xbb10('0x25'));_0x1d5e95['query']=_[_0xbb10('0x2d')](_0x2fdde9['query']);_0x1d5e95[_0xbb10('0x2e')]=_[_0xbb10('0x2f')](_0x1d5e95[_0xbb10('0x2c')],_0x1d5e95['query']);_0x6ed43b['attributes']=_[_0xbb10('0x2f')](_0x1d5e95[_0xbb10('0x2c')],qs['fields'](_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x31')]));_0x6ed43b[_0xbb10('0x32')]=_0x6ed43b[_0xbb10('0x32')][_0xbb10('0x33')]?_0x6ed43b[_0xbb10('0x32')]:_0x1d5e95[_0xbb10('0x2c')];if(!_0x2fdde9['query'][_0xbb10('0x34')](_0xbb10('0x35'))){_0x6ed43b[_0xbb10('0x1e')]=qs[_0xbb10('0x1e')](_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x1e')]);_0x6ed43b[_0xbb10('0x1d')]=qs[_0xbb10('0x1d')](_0x2fdde9[_0xbb10('0x30')]['offset']);}_0x6ed43b[_0xbb10('0x36')]=qs[_0xbb10('0x37')](_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x37')]);_0x6ed43b['where']=qs[_0xbb10('0x2e')](_['pick'](_0x2fdde9['query'],_0x1d5e95[_0xbb10('0x2e')]));if(_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x38')]){_0x6ed43b[_0xbb10('0x39')]=_[_0xbb10('0x3a')](_0x6ed43b[_0xbb10('0x39')],{'$or':_['map'](_0x20d946,function(_0x1e5bbd){if(_0x1e5bbd[_0xbb10('0x2a')]['key']!=='VIRTUAL'){var _0x5cd55f={};_0x5cd55f[_0x1e5bbd[_0xbb10('0x3b')]]={'$like':'%'+_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x38')]+'%'};return _0x5cd55f;}})});}_0x6ed43b=_['merge']({},_0x6ed43b,_0x2fdde9[_0xbb10('0x3c')]);var _0x3e8538={'where':_0x6ed43b[_0xbb10('0x39')]};return db['OpenchannelTransferReport'][_0xbb10('0x1c')](_0x3e8538)[_0xbb10('0x23')](function(_0x1dcd38){_0x1acce9[_0xbb10('0x1c')]=_0x1dcd38;if(_0x2fdde9['query'][_0xbb10('0x3d')]){_0x6ed43b[_0xbb10('0x3e')]=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0xbb10('0x3f')](_0x6ed43b);})[_0xbb10('0x23')](function(_0x44d6ae){_0x1acce9[_0xbb10('0x40')]=_0x44d6ae;return _0x1acce9;})[_0xbb10('0x23')](respondWithFilteredResult(_0x24d586,_0x6ed43b))[_0xbb10('0x41')](handleError(_0x24d586,null));};exports['show']=function(_0x1e8f79,_0x1c7fae){var _0x3e7b4c={'raw':!![],'where':{'id':_0x1e8f79['params']['id']}},_0x3d3c41={};_0x3d3c41[_0xbb10('0x2c')]=_[_0xbb10('0x2d')](db[_0xbb10('0x42')][_0xbb10('0x28')]);_0x3d3c41['query']=_[_0xbb10('0x2d')](_0x1e8f79[_0xbb10('0x30')]);_0x3d3c41['filters']=_['intersection'](_0x3d3c41[_0xbb10('0x2c')],_0x3d3c41['query']);_0x3e7b4c[_0xbb10('0x32')]=_[_0xbb10('0x2f')](_0x3d3c41['model'],qs[_0xbb10('0x31')](_0x1e8f79[_0xbb10('0x30')][_0xbb10('0x31')]));_0x3e7b4c['attributes']=_0x3e7b4c[_0xbb10('0x32')][_0xbb10('0x33')]?_0x3e7b4c[_0xbb10('0x32')]:_0x3d3c41[_0xbb10('0x2c')];if(_0x1e8f79[_0xbb10('0x30')][_0xbb10('0x3d')]){_0x3e7b4c[_0xbb10('0x3e')]=[{'all':!![]}];}_0x3e7b4c=_[_0xbb10('0x3a')]({},_0x3e7b4c,_0x1e8f79[_0xbb10('0x3c')]);return db[_0xbb10('0x42')][_0xbb10('0x43')](_0x3e7b4c)[_0xbb10('0x23')](handleEntityNotFound(_0x1c7fae,null))['then'](respondWithResult(_0x1c7fae,null))[_0xbb10('0x41')](handleError(_0x1c7fae,null));};exports[_0xbb10('0x44')]=function(_0x4a1248,_0x14e1cb){return db[_0xbb10('0x42')][_0xbb10('0x44')](_0x4a1248[_0xbb10('0x45')],{})[_0xbb10('0x23')](respondWithResult(_0x14e1cb,0xc9))[_0xbb10('0x41')](handleError(_0x14e1cb,null));};exports[_0xbb10('0x46')]=function(_0x5be85e,_0x4a9793){if(_0x5be85e[_0xbb10('0x45')]['id']){delete _0x5be85e[_0xbb10('0x45')]['id'];}return db[_0xbb10('0x42')]['find']({'where':{'id':_0x5be85e['params']['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0x4a9793,null))[_0xbb10('0x23')](saveUpdates(_0x5be85e[_0xbb10('0x45')],null))[_0xbb10('0x23')](respondWithResult(_0x4a9793,null))[_0xbb10('0x41')](handleError(_0x4a9793,null));};exports[_0xbb10('0x24')]=function(_0x2f2552,_0x460788){return db[_0xbb10('0x42')][_0xbb10('0x43')]({'where':{'id':_0x2f2552['params']['id']}})['then'](handleEntityNotFound(_0x460788,null))[_0xbb10('0x23')](removeEntity(_0x460788,null))[_0xbb10('0x41')](handleError(_0x460788,null));};exports[_0xbb10('0x47')]=function(_0xb014b0,_0x36aa7d){return db[_0xbb10('0x42')][_0xbb10('0x47')]()[_0xbb10('0x23')](respondWithResult(_0x36aa7d,null))[_0xbb10('0x41')](handleError(_0x36aa7d,null));}; \ No newline at end of file +var _0xb10b=['include','findAll','rows','catch','OpenchannelTransferReport','find','create','body','update','describe','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','then','destroy','name','send','map','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','field','options','includeAll'];(function(_0x16d3f2,_0x2bb33e){var _0x2ac270=function(_0x2dbda4){while(--_0x2dbda4){_0x16d3f2['push'](_0x16d3f2['shift']());}};_0x2ac270(++_0x2bb33e);}(_0xb10b,0x12a));var _0xbb10=function(_0x17aa78,_0x1ca1ef){_0x17aa78=_0x17aa78-0x0;var _0x4e0514=_0xb10b[_0x17aa78];return _0x4e0514;};'use strict';var pdf=require(_0xbb10('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbb10('0x1'));var zipdir=require(_0xbb10('0x2'));var jsonpatch=require(_0xbb10('0x3'));var rp=require('request-promise');var moment=require(_0xbb10('0x4'));var BPromise=require(_0xbb10('0x5'));var Mustache=require(_0xbb10('0x6'));var util=require(_0xbb10('0x7'));var path=require(_0xbb10('0x8'));var sox=require(_0xbb10('0x9'));var csv=require('to-csv');var ejs=require(_0xbb10('0xa'));var fs=require('fs');var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0xf'));var querystring=require(_0xbb10('0x10'));var Papa=require(_0xbb10('0x11'));var Redis=require(_0xbb10('0x12'));var authService=require(_0xbb10('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb10('0x14'));var logger=require(_0xbb10('0x15'))(_0xbb10('0x16'));var utils=require('../../config/utils');var config=require(_0xbb10('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x44fb19,_0x916a32){_0x916a32=_0x916a32||0xcc;return function(_0x285009){if(_0x285009){return _0x44fb19[_0xbb10('0x18')](_0x916a32);}return _0x44fb19[_0xbb10('0x19')](_0x916a32)[_0xbb10('0x1a')]();};}function respondWithResult(_0x58a612,_0x26e021){_0x26e021=_0x26e021||0xc8;return function(_0x42d7e4){if(_0x42d7e4){return _0x58a612[_0xbb10('0x19')](_0x26e021)[_0xbb10('0x1b')](_0x42d7e4);}};}function respondWithFilteredResult(_0x3df17b,_0x2f2ebf){return function(_0x24a57b){if(_0x24a57b){var _0x36b5e8=_0x24a57b[_0xbb10('0x1c')],_0x3e26f4=_0x2f2ebf[_0xbb10('0x1d')],_0x2b184e=_0x2f2ebf[_0xbb10('0x1d')]+_0x2f2ebf[_0xbb10('0x1e')],_0x4a2bfc;if(_0x2b184e>=_0x36b5e8){_0x2b184e=_0x36b5e8;_0x4a2bfc=0xc8;}else{_0x4a2bfc=0xce;}_0x3df17b[_0xbb10('0x19')](_0x4a2bfc);return _0x3df17b[_0xbb10('0x1f')](_0xbb10('0x20'),_0x3e26f4+'-'+_0x2b184e+'/'+_0x36b5e8)[_0xbb10('0x1b')](_0x24a57b);}return null;};}function patchUpdates(_0xbf2906){return function(_0xe1c665){try{jsonpatch['apply'](_0xe1c665,_0xbf2906,!![]);}catch(_0x5ff0cf){return BPromise[_0xbb10('0x21')](_0x5ff0cf);}return _0xe1c665[_0xbb10('0x22')]();};}function saveUpdates(_0x109908,_0xdf237d){return function(_0x44e563){if(_0x44e563){return _0x44e563['update'](_0x109908)[_0xbb10('0x23')](function(_0x12ef77){return _0x12ef77;});}return null;};}function removeEntity(_0x50aea1,_0x4c4b0d){return function(_0x8e2b97){if(_0x8e2b97){return _0x8e2b97[_0xbb10('0x24')]()[_0xbb10('0x23')](function(){_0x50aea1[_0xbb10('0x19')](0xcc)[_0xbb10('0x1a')]();});}};}function handleEntityNotFound(_0x1824b7,_0x407cb4){return function(_0x436104){if(!_0x436104){_0x1824b7[_0xbb10('0x18')](0x194);}return _0x436104;};}function handleError(_0x395404,_0x3ba6cd){_0x3ba6cd=_0x3ba6cd||0x1f4;return function(_0x26ad93){logger['error'](_0x26ad93['stack']);if(_0x26ad93['name']){delete _0x26ad93[_0xbb10('0x25')];}_0x395404[_0xbb10('0x19')](_0x3ba6cd)[_0xbb10('0x26')](_0x26ad93);};}exports['index']=function(_0x2fdde9,_0x24d586){var _0x6ed43b={},_0x1d5e95={},_0x1acce9={'count':0x0,'rows':[]};var _0x20d946=_[_0xbb10('0x27')](db['OpenchannelTransferReport'][_0xbb10('0x28')],function(_0x21ac54){return{'name':_0x21ac54[_0xbb10('0x29')],'type':_0x21ac54[_0xbb10('0x2a')][_0xbb10('0x2b')]};});_0x1d5e95[_0xbb10('0x2c')]=_['map'](_0x20d946,_0xbb10('0x25'));_0x1d5e95['query']=_[_0xbb10('0x2d')](_0x2fdde9['query']);_0x1d5e95[_0xbb10('0x2e')]=_[_0xbb10('0x2f')](_0x1d5e95[_0xbb10('0x2c')],_0x1d5e95['query']);_0x6ed43b['attributes']=_[_0xbb10('0x2f')](_0x1d5e95[_0xbb10('0x2c')],qs['fields'](_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x31')]));_0x6ed43b[_0xbb10('0x32')]=_0x6ed43b[_0xbb10('0x32')][_0xbb10('0x33')]?_0x6ed43b[_0xbb10('0x32')]:_0x1d5e95[_0xbb10('0x2c')];if(!_0x2fdde9['query'][_0xbb10('0x34')](_0xbb10('0x35'))){_0x6ed43b[_0xbb10('0x1e')]=qs[_0xbb10('0x1e')](_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x1e')]);_0x6ed43b[_0xbb10('0x1d')]=qs[_0xbb10('0x1d')](_0x2fdde9[_0xbb10('0x30')]['offset']);}_0x6ed43b[_0xbb10('0x36')]=qs[_0xbb10('0x37')](_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x37')]);_0x6ed43b['where']=qs[_0xbb10('0x2e')](_['pick'](_0x2fdde9['query'],_0x1d5e95[_0xbb10('0x2e')]));if(_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x38')]){_0x6ed43b[_0xbb10('0x39')]=_[_0xbb10('0x3a')](_0x6ed43b[_0xbb10('0x39')],{'$or':_['map'](_0x20d946,function(_0x1e5bbd){if(_0x1e5bbd[_0xbb10('0x2a')]['key']!=='VIRTUAL'){var _0x5cd55f={};_0x5cd55f[_0x1e5bbd[_0xbb10('0x3b')]]={'$like':'%'+_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x38')]+'%'};return _0x5cd55f;}})});}_0x6ed43b=_['merge']({},_0x6ed43b,_0x2fdde9[_0xbb10('0x3c')]);var _0x3e8538={'where':_0x6ed43b[_0xbb10('0x39')]};return db['OpenchannelTransferReport'][_0xbb10('0x1c')](_0x3e8538)[_0xbb10('0x23')](function(_0x1dcd38){_0x1acce9[_0xbb10('0x1c')]=_0x1dcd38;if(_0x2fdde9['query'][_0xbb10('0x3d')]){_0x6ed43b[_0xbb10('0x3e')]=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0xbb10('0x3f')](_0x6ed43b);})[_0xbb10('0x23')](function(_0x44d6ae){_0x1acce9[_0xbb10('0x40')]=_0x44d6ae;return _0x1acce9;})[_0xbb10('0x23')](respondWithFilteredResult(_0x24d586,_0x6ed43b))[_0xbb10('0x41')](handleError(_0x24d586,null));};exports['show']=function(_0x1e8f79,_0x1c7fae){var _0x3e7b4c={'raw':!![],'where':{'id':_0x1e8f79['params']['id']}},_0x3d3c41={};_0x3d3c41[_0xbb10('0x2c')]=_[_0xbb10('0x2d')](db[_0xbb10('0x42')][_0xbb10('0x28')]);_0x3d3c41['query']=_[_0xbb10('0x2d')](_0x1e8f79[_0xbb10('0x30')]);_0x3d3c41['filters']=_['intersection'](_0x3d3c41[_0xbb10('0x2c')],_0x3d3c41['query']);_0x3e7b4c[_0xbb10('0x32')]=_[_0xbb10('0x2f')](_0x3d3c41['model'],qs[_0xbb10('0x31')](_0x1e8f79[_0xbb10('0x30')][_0xbb10('0x31')]));_0x3e7b4c['attributes']=_0x3e7b4c[_0xbb10('0x32')][_0xbb10('0x33')]?_0x3e7b4c[_0xbb10('0x32')]:_0x3d3c41[_0xbb10('0x2c')];if(_0x1e8f79[_0xbb10('0x30')][_0xbb10('0x3d')]){_0x3e7b4c[_0xbb10('0x3e')]=[{'all':!![]}];}_0x3e7b4c=_[_0xbb10('0x3a')]({},_0x3e7b4c,_0x1e8f79[_0xbb10('0x3c')]);return db[_0xbb10('0x42')][_0xbb10('0x43')](_0x3e7b4c)[_0xbb10('0x23')](handleEntityNotFound(_0x1c7fae,null))['then'](respondWithResult(_0x1c7fae,null))[_0xbb10('0x41')](handleError(_0x1c7fae,null));};exports[_0xbb10('0x44')]=function(_0x4a1248,_0x14e1cb){return db[_0xbb10('0x42')][_0xbb10('0x44')](_0x4a1248[_0xbb10('0x45')],{})[_0xbb10('0x23')](respondWithResult(_0x14e1cb,0xc9))[_0xbb10('0x41')](handleError(_0x14e1cb,null));};exports[_0xbb10('0x46')]=function(_0x5be85e,_0x4a9793){if(_0x5be85e[_0xbb10('0x45')]['id']){delete _0x5be85e[_0xbb10('0x45')]['id'];}return db[_0xbb10('0x42')]['find']({'where':{'id':_0x5be85e['params']['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0x4a9793,null))[_0xbb10('0x23')](saveUpdates(_0x5be85e[_0xbb10('0x45')],null))[_0xbb10('0x23')](respondWithResult(_0x4a9793,null))[_0xbb10('0x41')](handleError(_0x4a9793,null));};exports[_0xbb10('0x24')]=function(_0x2f2552,_0x460788){return db[_0xbb10('0x42')][_0xbb10('0x43')]({'where':{'id':_0x2f2552['params']['id']}})['then'](handleEntityNotFound(_0x460788,null))[_0xbb10('0x23')](removeEntity(_0x460788,null))[_0xbb10('0x41')](handleError(_0x460788,null));};exports[_0xbb10('0x47')]=function(_0xb014b0,_0x36aa7d){return db[_0xbb10('0x42')][_0xbb10('0x47')]()[_0xbb10('0x23')](respondWithResult(_0x36aa7d,null))[_0xbb10('0x41')](handleError(_0x36aa7d,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index ac5290f..0c7fab9 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 _0x6ec1=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','uniqueid','lodash','util'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x6ec1,0x8e));var _0x16ec=function(_0x2b27b4,_0x5098c1){_0x2b27b4=_0x2b27b4-0x0;var _0x28103=_0x6ec1[_0x2b27b4];return _0x28103;};'use strict';var _=require(_0x16ec('0x0'));var util=require(_0x16ec('0x1'));var logger=require('../../config/logger')(_0x16ec('0x2'));var moment=require(_0x16ec('0x3'));var BPromise=require(_0x16ec('0x4'));var rp=require(_0x16ec('0x5'));var fs=require('fs');var path=require(_0x16ec('0x6'));var rimraf=require(_0x16ec('0x7'));var config=require(_0x16ec('0x8'));var attributes=require(_0x16ec('0x9'));module[_0x16ec('0xa')]=function(_0x2ec82c,_0x531e98){return _0x2ec82c['define']('OpenchannelTransferReport',attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0x16ec('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x44d0=['util','api','moment','request-promise','path','../../config/environment','./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash'];(function(_0xc0638b,_0x2fccf4){var _0xd57dfa=function(_0x322fba){while(--_0x322fba){_0xc0638b['push'](_0xc0638b['shift']());}};_0xd57dfa(++_0x2fccf4);}(_0x44d0,0x185));var _0x044d=function(_0x49ac66,_0x2e36a1){_0x49ac66=_0x49ac66-0x0;var _0x1e3090=_0x44d0[_0x49ac66];return _0x1e3090;};'use strict';var _=require(_0x044d('0x0'));var util=require(_0x044d('0x1'));var logger=require('../../config/logger')(_0x044d('0x2'));var moment=require(_0x044d('0x3'));var BPromise=require('bluebird');var rp=require(_0x044d('0x4'));var fs=require('fs');var path=require(_0x044d('0x5'));var rimraf=require('rimraf');var config=require(_0x044d('0x6'));var attributes=require(_0x044d('0x7'));module[_0x044d('0x8')]=function(_0x6feec5,_0x60a951){return _0x6feec5[_0x044d('0x9')](_0x044d('0xa'),attributes,{'tableName':_0x044d('0xb'),'paranoid':![],'indexes':[{'name':_0x044d('0xc'),'fields':[_0x044d('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 85d9c91..7d44cd0 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 _0xa39d=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','randomstring','ioredis'];(function(_0x354f25,_0x360641){var _0x1c5e96=function(_0x18141c){while(--_0x18141c){_0x354f25['push'](_0x354f25['shift']());}};_0x1c5e96(++_0x360641);}(_0xa39d,0xf7));var _0xda39=function(_0x459224,_0x26a6d8){_0x459224=_0x459224-0x0;var _0x332717=_0xa39d[_0x459224];return _0x332717;};'use strict';var _=require(_0xda39('0x0'));var util=require(_0xda39('0x1'));var moment=require(_0xda39('0x2'));var BPromise=require('bluebird');var rs=require(_0xda39('0x3'));var fs=require('fs');var Redis=require(_0xda39('0x4'));var db=require(_0xda39('0x5'))['db'];var utils=require(_0xda39('0x6'));var logger=require(_0xda39('0x7'))('rpc');var config=require(_0xda39('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xda39('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2f97fc,_0x26ca16,_0x333cc1){return new BPromise(function(_0x310599,_0x5e55cb){return client[_0xda39('0xa')](_0x2f97fc,_0x333cc1)[_0xda39('0xb')](function(_0x35b820){logger[_0xda39('0xc')](_0xda39('0xd'),_0x26ca16,_0xda39('0xe'));logger[_0xda39('0xf')]('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x26ca16,'request\x20sent',JSON[_0xda39('0x10')](_0x35b820));if(_0x35b820[_0xda39('0x11')]){if(_0x35b820['error'][_0xda39('0x12')]===0x1f4){logger[_0xda39('0x11')](_0xda39('0xd'),_0x26ca16,_0x35b820[_0xda39('0x11')][_0xda39('0x13')]);return _0x5e55cb(_0x35b820[_0xda39('0x11')]['message']);}logger[_0xda39('0x11')](_0xda39('0xd'),_0x26ca16,_0x35b820[_0xda39('0x11')][_0xda39('0x13')]);return _0x310599(_0x35b820['error']['message']);}else{logger['info'](_0xda39('0xd'),_0x26ca16,_0xda39('0xe'));_0x310599(_0x35b820[_0xda39('0x14')][_0xda39('0x13')]);}})['catch'](function(_0x1c52dc){logger[_0xda39('0x11')](_0xda39('0xd'),_0x26ca16,_0x1c52dc);_0x5e55cb(_0x1c52dc);});});} \ No newline at end of file +var _0x3baf=['http','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0xea68da,_0x102982){var _0x252d8e=function(_0xf1fe7f){while(--_0xf1fe7f){_0xea68da['push'](_0xea68da['shift']());}};_0x252d8e(++_0x102982);}(_0x3baf,0xf7));var _0xf3ba=function(_0x3e2fcf,_0x579110){_0x3e2fcf=_0x3e2fcf-0x0;var _0x497db7=_0x3baf[_0x3e2fcf];return _0x497db7;};'use strict';var _=require(_0xf3ba('0x0'));var util=require(_0xf3ba('0x1'));var moment=require(_0xf3ba('0x2'));var BPromise=require(_0xf3ba('0x3'));var rs=require(_0xf3ba('0x4'));var fs=require('fs');var Redis=require(_0xf3ba('0x5'));var db=require(_0xf3ba('0x6'))['db'];var utils=require(_0xf3ba('0x7'));var logger=require(_0xf3ba('0x8'))(_0xf3ba('0x9'));var config=require(_0xf3ba('0xa'));var jayson=require(_0xf3ba('0xb'));var client=jayson[_0xf3ba('0xc')][_0xf3ba('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x1284b7,_0x4de144,_0x579135){return new BPromise(function(_0x5ab058,_0x32f810){return client['request'](_0x1284b7,_0x579135)[_0xf3ba('0xe')](function(_0x1a2166){logger[_0xf3ba('0xf')](_0xf3ba('0x10'),_0x4de144,_0xf3ba('0x11'));logger[_0xf3ba('0x12')](_0xf3ba('0x13'),_0x4de144,_0xf3ba('0x11'),JSON[_0xf3ba('0x14')](_0x1a2166));if(_0x1a2166[_0xf3ba('0x15')]){if(_0x1a2166[_0xf3ba('0x15')][_0xf3ba('0x16')]===0x1f4){logger[_0xf3ba('0x15')](_0xf3ba('0x10'),_0x4de144,_0x1a2166[_0xf3ba('0x15')][_0xf3ba('0x17')]);return _0x32f810(_0x1a2166[_0xf3ba('0x15')][_0xf3ba('0x17')]);}logger['error'](_0xf3ba('0x10'),_0x4de144,_0x1a2166['error'][_0xf3ba('0x17')]);return _0x5ab058(_0x1a2166[_0xf3ba('0x15')][_0xf3ba('0x17')]);}else{logger[_0xf3ba('0xf')](_0xf3ba('0x10'),_0x4de144,'request\x20sent');_0x5ab058(_0x1a2166[_0xf3ba('0x18')][_0xf3ba('0x17')]);}})[_0xf3ba('0x19')](function(_0x550dd3){logger[_0xf3ba('0x15')](_0xf3ba('0x10'),_0x4de144,_0x550dd3);_0x32f810(_0x550dd3);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 4572aee..19cd880 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 _0x04ef=['post','create','put','destroy','exports','multer','util','path','connect-timeout','express','../../config/environment','./pause.controller','get','isAuthenticated','index','/:id','show'];(function(_0x39d544,_0x35c14f){var _0x5a5ff2=function(_0x2271fb){while(--_0x2271fb){_0x39d544['push'](_0x39d544['shift']());}};_0x5a5ff2(++_0x35c14f);}(_0x04ef,0x17b));var _0xf04e=function(_0x33c29f,_0xea9ba8){_0x33c29f=_0x33c29f-0x0;var _0x56a91d=_0x04ef[_0x33c29f];return _0x56a91d;};'use strict';var multer=require(_0xf04e('0x0'));var util=require(_0xf04e('0x1'));var path=require(_0xf04e('0x2'));var timeout=require(_0xf04e('0x3'));var express=require(_0xf04e('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf04e('0x5'));var controller=require(_0xf04e('0x6'));router[_0xf04e('0x7')]('/',auth[_0xf04e('0x8')](),controller[_0xf04e('0x9')]);router[_0xf04e('0x7')](_0xf04e('0xa'),auth['isAuthenticated'](),controller[_0xf04e('0xb')]);router[_0xf04e('0xc')]('/',auth[_0xf04e('0x8')](),controller[_0xf04e('0xd')]);router[_0xf04e('0xe')](_0xf04e('0xa'),auth[_0xf04e('0x8')](),controller['update']);router['delete'](_0xf04e('0xa'),auth['isAuthenticated'](),controller[_0xf04e('0xf')]);module[_0xf04e('0x10')]=router; \ No newline at end of file +var _0x25f7=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','show','isAuthenticated','put','update','delete','/:id','destroy','exports','multer','util','path','express','Router'];(function(_0x56975d,_0x2e7661){var _0x4a3e26=function(_0xa530c9){while(--_0xa530c9){_0x56975d['push'](_0x56975d['shift']());}};_0x4a3e26(++_0x2e7661);}(_0x25f7,0x1bd));var _0x725f=function(_0x2bcfb0,_0x327d3e){_0x2bcfb0=_0x2bcfb0-0x0;var _0x339207=_0x25f7[_0x2bcfb0];return _0x339207;};'use strict';var multer=require(_0x725f('0x0'));var util=require(_0x725f('0x1'));var path=require(_0x725f('0x2'));var timeout=require('connect-timeout');var express=require(_0x725f('0x3'));var router=express[_0x725f('0x4')]();var auth=require(_0x725f('0x5'));var interaction=require(_0x725f('0x6'));var config=require(_0x725f('0x7'));var controller=require('./pause.controller');router[_0x725f('0x8')]('/',auth['isAuthenticated'](),controller[_0x725f('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x725f('0xa')]);router['post']('/',auth[_0x725f('0xb')](),controller['create']);router[_0x725f('0xc')]('/:id',auth[_0x725f('0xb')](),controller[_0x725f('0xd')]);router[_0x725f('0xe')](_0x725f('0xf'),auth[_0x725f('0xb')](),controller[_0x725f('0x10')]);module[_0x725f('0x11')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 0802d43..c28ad9f 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 _0xb875=['exports','name','STRING','sequelize'];(function(_0x1cf42f,_0x1fcc88){var _0x1871e8=function(_0x17ad88){while(--_0x17ad88){_0x1cf42f['push'](_0x1cf42f['shift']());}};_0x1871e8(++_0x1fcc88);}(_0xb875,0x103));var _0x5b87=function(_0x118014,_0x4aa892){_0x118014=_0x118014-0x0;var _0x51432c=_0xb875[_0x118014];return _0x51432c;};'use strict';var Sequelize=require(_0x5b87('0x0'));module[_0x5b87('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x5b87('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x5b87('0x3')]}}; \ No newline at end of file +var _0x37e5=['exports','STRING','sequelize'];(function(_0x278cdd,_0x35a45f){var _0x27fae7=function(_0x5bacb8){while(--_0x5bacb8){_0x278cdd['push'](_0x278cdd['shift']());}};_0x27fae7(++_0x35a45f);}(_0x37e5,0xb6));var _0x537e=function(_0x4a8072,_0x435bab){_0x4a8072=_0x4a8072-0x0;var _0x11a4fe=_0x37e5[_0x4a8072];return _0x11a4fe;};'use strict';var Sequelize=require(_0x537e('0x0'));module[_0x537e('0x1')]={'name':{'type':Sequelize[_0x537e('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index de28c0e..23efafe 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 _0x37c5=['UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','limit','set','update','then','get','Pauses','UserProfileResource','error','stack','name','send','index','fieldName','type','key','map','query','filters','intersection','attributes','model','fields','nolimit','offset','sort','where','pick','filter','merge','field','options','Pause','includeAll','include','findAll','rows','catch','show','keys','rawAttributes','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x353f2f,_0x5aeccb){var _0xe6bdd2=function(_0x53bb61){while(--_0x53bb61){_0x353f2f['push'](_0x353f2f['shift']());}};_0xe6bdd2(++_0x5aeccb);}(_0x37c5,0xa7));var _0x537c=function(_0x5be315,_0x3326d4){_0x5be315=_0x5be315-0x0;var _0x5e0880=_0x37c5[_0x5be315];return _0x5e0880;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x537c('0x0'));var rimraf=require(_0x537c('0x1'));var zipdir=require(_0x537c('0x2'));var jsonpatch=require(_0x537c('0x3'));var rp=require(_0x537c('0x4'));var moment=require(_0x537c('0x5'));var BPromise=require(_0x537c('0x6'));var Mustache=require(_0x537c('0x7'));var util=require(_0x537c('0x8'));var path=require(_0x537c('0x9'));var sox=require('sox');var csv=require(_0x537c('0xa'));var ejs=require(_0x537c('0xb'));var fs=require('fs');var _=require(_0x537c('0xc'));var squel=require('squel');var crypto=require(_0x537c('0xd'));var jsforce=require(_0x537c('0xe'));var deskjs=require(_0x537c('0xf'));var toCsv=require(_0x537c('0xa'));var querystring=require('querystring');var Papa=require(_0x537c('0x10'));var Redis=require(_0x537c('0x11'));var authService=require(_0x537c('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x537c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x537c('0x14'));var utils=require('../../config/utils');var config=require(_0x537c('0x15'));var db=require(_0x537c('0x16'))['db'];function respondWithStatusCode(_0x3fa3a6,_0x473606){_0x473606=_0x473606||0xcc;return function(_0x1ecb98){if(_0x1ecb98){return _0x3fa3a6[_0x537c('0x17')](_0x473606);}return _0x3fa3a6[_0x537c('0x18')](_0x473606)[_0x537c('0x19')]();};}function respondWithResult(_0x15aaca,_0x577981){_0x577981=_0x577981||0xc8;return function(_0x8d0c3){if(_0x8d0c3){return _0x15aaca[_0x537c('0x18')](_0x577981)[_0x537c('0x1a')](_0x8d0c3);}};}function respondWithFilteredResult(_0x131226,_0x116453){return function(_0x392421){if(_0x392421){var _0x2158e2=_0x392421[_0x537c('0x1b')],_0x3776c3=_0x116453['offset'],_0x445763=_0x116453['offset']+_0x116453[_0x537c('0x1c')],_0x5bd4c9;if(_0x445763>=_0x2158e2){_0x445763=_0x2158e2;_0x5bd4c9=0xc8;}else{_0x5bd4c9=0xce;}_0x131226[_0x537c('0x18')](_0x5bd4c9);return _0x131226[_0x537c('0x1d')]('Content-Range',_0x3776c3+'-'+_0x445763+'/'+_0x2158e2)[_0x537c('0x1a')](_0x392421);}return null;};}function patchUpdates(_0x229ffd){return function(_0x581cbc){try{jsonpatch['apply'](_0x581cbc,_0x229ffd,!![]);}catch(_0xc83ece){return BPromise['reject'](_0xc83ece);}return _0x581cbc['save']();};}function saveUpdates(_0x2307c7,_0x32be40){return function(_0x5cfd81){if(_0x5cfd81){return _0x5cfd81[_0x537c('0x1e')](_0x2307c7)[_0x537c('0x1f')](function(_0x528042){return _0x528042;});}return null;};}function removeEntity(_0x576330,_0x1a91d1){return function(_0x47bece){if(_0x47bece){return _0x47bece['destroy']()[_0x537c('0x1f')](function(){var _0x121331=_0x47bece[_0x537c('0x20')]({'plain':!![]});var _0x28a35a=_0x537c('0x21');return db[_0x537c('0x22')]['destroy']({'where':{'type':_0x28a35a,'resourceId':_0x121331['id']}})[_0x537c('0x1f')](function(){return _0x47bece;});})[_0x537c('0x1f')](function(){_0x576330[_0x537c('0x18')](0xcc)[_0x537c('0x19')]();});}};}function handleEntityNotFound(_0x428e5d,_0x4b6af1){return function(_0x552375){if(!_0x552375){_0x428e5d['sendStatus'](0x194);}return _0x552375;};}function handleError(_0x403ff6,_0x1fa0ca){_0x1fa0ca=_0x1fa0ca||0x1f4;return function(_0x54569f){logger[_0x537c('0x23')](_0x54569f[_0x537c('0x24')]);if(_0x54569f[_0x537c('0x25')]){delete _0x54569f['name'];}_0x403ff6['status'](_0x1fa0ca)[_0x537c('0x26')](_0x54569f);};}exports[_0x537c('0x27')]=function(_0x11c11e,_0x4e5f18){var _0x49d60b={},_0x5ca8f6={},_0x22f82e={'count':0x0,'rows':[]};var _0xb3795f=_['map'](db['Pause']['rawAttributes'],function(_0x49138c){return{'name':_0x49138c[_0x537c('0x28')],'type':_0x49138c[_0x537c('0x29')][_0x537c('0x2a')]};});_0x5ca8f6['model']=_[_0x537c('0x2b')](_0xb3795f,_0x537c('0x25'));_0x5ca8f6[_0x537c('0x2c')]=_['keys'](_0x11c11e[_0x537c('0x2c')]);_0x5ca8f6[_0x537c('0x2d')]=_[_0x537c('0x2e')](_0x5ca8f6['model'],_0x5ca8f6['query']);_0x49d60b[_0x537c('0x2f')]=_[_0x537c('0x2e')](_0x5ca8f6[_0x537c('0x30')],qs[_0x537c('0x31')](_0x11c11e[_0x537c('0x2c')][_0x537c('0x31')]));_0x49d60b[_0x537c('0x2f')]=_0x49d60b[_0x537c('0x2f')]['length']?_0x49d60b['attributes']:_0x5ca8f6[_0x537c('0x30')];if(!_0x11c11e[_0x537c('0x2c')]['hasOwnProperty'](_0x537c('0x32'))){_0x49d60b[_0x537c('0x1c')]=qs[_0x537c('0x1c')](_0x11c11e[_0x537c('0x2c')][_0x537c('0x1c')]);_0x49d60b['offset']=qs[_0x537c('0x33')](_0x11c11e['query']['offset']);}_0x49d60b['order']=qs['sort'](_0x11c11e[_0x537c('0x2c')][_0x537c('0x34')]);_0x49d60b[_0x537c('0x35')]=qs[_0x537c('0x2d')](_[_0x537c('0x36')](_0x11c11e[_0x537c('0x2c')],_0x5ca8f6[_0x537c('0x2d')]));if(_0x11c11e[_0x537c('0x2c')][_0x537c('0x37')]){_0x49d60b[_0x537c('0x35')]=_[_0x537c('0x38')](_0x49d60b[_0x537c('0x35')],{'$or':_[_0x537c('0x2b')](_0xb3795f,function(_0x1e452d){if(_0x1e452d['type'][_0x537c('0x2a')]!=='VIRTUAL'){var _0x1a55f8={};_0x1a55f8[_0x1e452d[_0x537c('0x39')]]={'$like':'%'+_0x11c11e['query'][_0x537c('0x37')]+'%'};return _0x1a55f8;}})});}_0x49d60b=_[_0x537c('0x38')]({},_0x49d60b,_0x11c11e[_0x537c('0x3a')]);var _0x1234f1={'where':_0x49d60b['where']};return db[_0x537c('0x3b')][_0x537c('0x1b')](_0x1234f1)[_0x537c('0x1f')](function(_0x48a77b){_0x22f82e[_0x537c('0x1b')]=_0x48a77b;if(_0x11c11e[_0x537c('0x2c')][_0x537c('0x3c')]){_0x49d60b[_0x537c('0x3d')]=[{'all':!![]}];}return db[_0x537c('0x3b')][_0x537c('0x3e')](_0x49d60b);})['then'](function(_0xe8d78c){_0x22f82e[_0x537c('0x3f')]=_0xe8d78c;return _0x22f82e;})[_0x537c('0x1f')](respondWithFilteredResult(_0x4e5f18,_0x49d60b))[_0x537c('0x40')](handleError(_0x4e5f18,null));};exports[_0x537c('0x41')]=function(_0x2590f,_0x2f236e){var _0x4817eb={'raw':!![],'where':{'id':_0x2590f['params']['id']}},_0x3a4c4d={};_0x3a4c4d[_0x537c('0x30')]=_[_0x537c('0x42')](db[_0x537c('0x3b')][_0x537c('0x43')]);_0x3a4c4d[_0x537c('0x2c')]=_['keys'](_0x2590f['query']);_0x3a4c4d[_0x537c('0x2d')]=_[_0x537c('0x2e')](_0x3a4c4d[_0x537c('0x30')],_0x3a4c4d[_0x537c('0x2c')]);_0x4817eb[_0x537c('0x2f')]=_[_0x537c('0x2e')](_0x3a4c4d['model'],qs[_0x537c('0x31')](_0x2590f[_0x537c('0x2c')][_0x537c('0x31')]));_0x4817eb[_0x537c('0x2f')]=_0x4817eb[_0x537c('0x2f')][_0x537c('0x44')]?_0x4817eb[_0x537c('0x2f')]:_0x3a4c4d[_0x537c('0x30')];if(_0x2590f[_0x537c('0x2c')][_0x537c('0x3c')]){_0x4817eb[_0x537c('0x3d')]=[{'all':!![]}];}_0x4817eb=_[_0x537c('0x38')]({},_0x4817eb,_0x2590f[_0x537c('0x3a')]);return db[_0x537c('0x3b')]['find'](_0x4817eb)[_0x537c('0x1f')](handleEntityNotFound(_0x2f236e,null))[_0x537c('0x1f')](respondWithResult(_0x2f236e,null))['catch'](handleError(_0x2f236e,null));};exports[_0x537c('0x45')]=function(_0xcd7018,_0x3c86eb){return db['Pause'][_0x537c('0x45')](_0xcd7018[_0x537c('0x46')],{})[_0x537c('0x1f')](function(_0x432c00){var _0x5b0dad=_0xcd7018[_0x537c('0x47')][_0x537c('0x20')]({'plain':!![]});if(!_0x5b0dad)throw new Error(_0x537c('0x48'));if(_0x5b0dad['role']===_0x537c('0x47')){var _0x4f70d4=_0x432c00[_0x537c('0x20')]({'plain':!![]});var _0x30d00e=_0x537c('0x21');return db[_0x537c('0x49')][_0x537c('0x4a')]({'where':{'name':_0x30d00e,'userProfileId':_0x5b0dad[_0x537c('0x4b')]},'raw':!![]})[_0x537c('0x1f')](function(_0x13c029){if(_0x13c029&&_0x13c029[_0x537c('0x4c')]===0x0){return db[_0x537c('0x22')]['create']({'name':_0x4f70d4['name'],'resourceId':_0x4f70d4['id'],'type':_0x13c029[_0x537c('0x25')],'sectionId':_0x13c029['id']},{})[_0x537c('0x1f')](function(){return _0x432c00;});}else{return _0x432c00;}})[_0x537c('0x40')](function(_0xfa8d30){logger[_0x537c('0x23')](_0x537c('0x4d'),_0xfa8d30);throw _0xfa8d30;});}return _0x432c00;})[_0x537c('0x1f')](respondWithResult(_0x3c86eb,0xc9))['catch'](handleError(_0x3c86eb,null));};exports['update']=function(_0xea6c78,_0x20a633){if(_0xea6c78[_0x537c('0x46')]['id']){delete _0xea6c78['body']['id'];}return db['Pause'][_0x537c('0x4a')]({'where':{'id':_0xea6c78['params']['id']}})[_0x537c('0x1f')](handleEntityNotFound(_0x20a633,null))[_0x537c('0x1f')](saveUpdates(_0xea6c78[_0x537c('0x46')],null))[_0x537c('0x1f')](respondWithResult(_0x20a633,null))[_0x537c('0x40')](handleError(_0x20a633,null));};exports[_0x537c('0x4e')]=function(_0x250dd2,_0x3bf1dc){return db[_0x537c('0x3b')][_0x537c('0x4a')]({'where':{'id':_0x250dd2[_0x537c('0x4f')]['id']}})[_0x537c('0x1f')](handleEntityNotFound(_0x3bf1dc,null))['then'](removeEntity(_0x3bf1dc,null))[_0x537c('0x40')](handleError(_0x3bf1dc,null));}; \ No newline at end of file +var _0x71ab=['../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','update','then','destroy','get','Pauses','UserProfileResource','error','stack','name','send','map','Pause','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','key','VIRTUAL','field','includeAll','include','findAll','catch','show','params','rawAttributes','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api'];(function(_0xf50142,_0x367876){var _0x596f1e=function(_0xc9a56f){while(--_0xc9a56f){_0xf50142['push'](_0xf50142['shift']());}};_0x596f1e(++_0x367876);}(_0x71ab,0x1df));var _0xb71a=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x71ab[_0x17d9e3];return _0x14192d;};'use strict';var pdf=require(_0xb71a('0x0'));var emlformat=require(_0xb71a('0x1'));var rimraf=require(_0xb71a('0x2'));var zipdir=require(_0xb71a('0x3'));var jsonpatch=require(_0xb71a('0x4'));var rp=require('request-promise');var moment=require(_0xb71a('0x5'));var BPromise=require(_0xb71a('0x6'));var Mustache=require(_0xb71a('0x7'));var util=require(_0xb71a('0x8'));var path=require(_0xb71a('0x9'));var sox=require(_0xb71a('0xa'));var csv=require('to-csv');var ejs=require(_0xb71a('0xb'));var fs=require('fs');var _=require(_0xb71a('0xc'));var squel=require(_0xb71a('0xd'));var crypto=require(_0xb71a('0xe'));var jsforce=require(_0xb71a('0xf'));var deskjs=require(_0xb71a('0x10'));var toCsv=require('to-csv');var querystring=require(_0xb71a('0x11'));var Papa=require(_0xb71a('0x12'));var Redis=require(_0xb71a('0x13'));var authService=require(_0xb71a('0x14'));var qs=require(_0xb71a('0x15'));var as=require(_0xb71a('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb71a('0x17'))(_0xb71a('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xb71a('0x19'))['db'];function respondWithStatusCode(_0x52a116,_0x19056a){_0x19056a=_0x19056a||0xcc;return function(_0x40c2c0){if(_0x40c2c0){return _0x52a116[_0xb71a('0x1a')](_0x19056a);}return _0x52a116[_0xb71a('0x1b')](_0x19056a)[_0xb71a('0x1c')]();};}function respondWithResult(_0x1604c0,_0x381be5){_0x381be5=_0x381be5||0xc8;return function(_0x4462a1){if(_0x4462a1){return _0x1604c0[_0xb71a('0x1b')](_0x381be5)[_0xb71a('0x1d')](_0x4462a1);}};}function respondWithFilteredResult(_0x1dce9a,_0x4149e2){return function(_0x1aab59){if(_0x1aab59){var _0x44403d=_0x1aab59[_0xb71a('0x1e')],_0x30cf9f=_0x4149e2[_0xb71a('0x1f')],_0x4d719a=_0x4149e2['offset']+_0x4149e2[_0xb71a('0x20')],_0x5ea992;if(_0x4d719a>=_0x44403d){_0x4d719a=_0x44403d;_0x5ea992=0xc8;}else{_0x5ea992=0xce;}_0x1dce9a[_0xb71a('0x1b')](_0x5ea992);return _0x1dce9a['set'](_0xb71a('0x21'),_0x30cf9f+'-'+_0x4d719a+'/'+_0x44403d)[_0xb71a('0x1d')](_0x1aab59);}return null;};}function patchUpdates(_0x3a1e2a){return function(_0x465519){try{jsonpatch[_0xb71a('0x22')](_0x465519,_0x3a1e2a,!![]);}catch(_0x123718){return BPromise['reject'](_0x123718);}return _0x465519['save']();};}function saveUpdates(_0x14cb3f,_0x504451){return function(_0x6f42c){if(_0x6f42c){return _0x6f42c[_0xb71a('0x23')](_0x14cb3f)[_0xb71a('0x24')](function(_0x3947f1){return _0x3947f1;});}return null;};}function removeEntity(_0x9998f6,_0x5f4b21){return function(_0x4377d0){if(_0x4377d0){return _0x4377d0[_0xb71a('0x25')]()[_0xb71a('0x24')](function(){var _0x5b1845=_0x4377d0[_0xb71a('0x26')]({'plain':!![]});var _0x205f3d=_0xb71a('0x27');return db[_0xb71a('0x28')][_0xb71a('0x25')]({'where':{'type':_0x205f3d,'resourceId':_0x5b1845['id']}})['then'](function(){return _0x4377d0;});})['then'](function(){_0x9998f6[_0xb71a('0x1b')](0xcc)[_0xb71a('0x1c')]();});}};}function handleEntityNotFound(_0x2062ab,_0x46d159){return function(_0x5dd96a){if(!_0x5dd96a){_0x2062ab[_0xb71a('0x1a')](0x194);}return _0x5dd96a;};}function handleError(_0x26d8de,_0x559d7d){_0x559d7d=_0x559d7d||0x1f4;return function(_0x3af038){logger[_0xb71a('0x29')](_0x3af038[_0xb71a('0x2a')]);if(_0x3af038[_0xb71a('0x2b')]){delete _0x3af038[_0xb71a('0x2b')];}_0x26d8de[_0xb71a('0x1b')](_0x559d7d)[_0xb71a('0x2c')](_0x3af038);};}exports['index']=function(_0x265f25,_0x376daf){var _0x303d5e={},_0x40a3f0={},_0x44ae14={'count':0x0,'rows':[]};var _0x3b0b71=_[_0xb71a('0x2d')](db[_0xb71a('0x2e')]['rawAttributes'],function(_0x5f1009){return{'name':_0x5f1009[_0xb71a('0x2f')],'type':_0x5f1009[_0xb71a('0x30')]['key']};});_0x40a3f0[_0xb71a('0x31')]=_[_0xb71a('0x2d')](_0x3b0b71,'name');_0x40a3f0[_0xb71a('0x32')]=_[_0xb71a('0x33')](_0x265f25['query']);_0x40a3f0[_0xb71a('0x34')]=_[_0xb71a('0x35')](_0x40a3f0[_0xb71a('0x31')],_0x40a3f0['query']);_0x303d5e[_0xb71a('0x36')]=_[_0xb71a('0x35')](_0x40a3f0[_0xb71a('0x31')],qs[_0xb71a('0x37')](_0x265f25[_0xb71a('0x32')]['fields']));_0x303d5e[_0xb71a('0x36')]=_0x303d5e['attributes'][_0xb71a('0x38')]?_0x303d5e['attributes']:_0x40a3f0[_0xb71a('0x31')];if(!_0x265f25[_0xb71a('0x32')][_0xb71a('0x39')](_0xb71a('0x3a'))){_0x303d5e[_0xb71a('0x20')]=qs[_0xb71a('0x20')](_0x265f25[_0xb71a('0x32')][_0xb71a('0x20')]);_0x303d5e[_0xb71a('0x1f')]=qs[_0xb71a('0x1f')](_0x265f25['query'][_0xb71a('0x1f')]);}_0x303d5e['order']=qs[_0xb71a('0x3b')](_0x265f25[_0xb71a('0x32')][_0xb71a('0x3b')]);_0x303d5e[_0xb71a('0x3c')]=qs[_0xb71a('0x34')](_[_0xb71a('0x3d')](_0x265f25[_0xb71a('0x32')],_0x40a3f0['filters']));if(_0x265f25[_0xb71a('0x32')][_0xb71a('0x3e')]){_0x303d5e['where']=_[_0xb71a('0x3f')](_0x303d5e[_0xb71a('0x3c')],{'$or':_[_0xb71a('0x2d')](_0x3b0b71,function(_0x2c48d9){if(_0x2c48d9[_0xb71a('0x30')][_0xb71a('0x40')]!==_0xb71a('0x41')){var _0x145217={};_0x145217[_0x2c48d9[_0xb71a('0x42')]]={'$like':'%'+_0x265f25[_0xb71a('0x32')]['filter']+'%'};return _0x145217;}})});}_0x303d5e=_[_0xb71a('0x3f')]({},_0x303d5e,_0x265f25['options']);var _0x3a023b={'where':_0x303d5e[_0xb71a('0x3c')]};return db[_0xb71a('0x2e')]['count'](_0x3a023b)['then'](function(_0x54036e){_0x44ae14['count']=_0x54036e;if(_0x265f25['query'][_0xb71a('0x43')]){_0x303d5e[_0xb71a('0x44')]=[{'all':!![]}];}return db[_0xb71a('0x2e')][_0xb71a('0x45')](_0x303d5e);})[_0xb71a('0x24')](function(_0x291f2e){_0x44ae14['rows']=_0x291f2e;return _0x44ae14;})[_0xb71a('0x24')](respondWithFilteredResult(_0x376daf,_0x303d5e))[_0xb71a('0x46')](handleError(_0x376daf,null));};exports[_0xb71a('0x47')]=function(_0x50ac82,_0x26ac84){var _0x18dd47={'raw':!![],'where':{'id':_0x50ac82[_0xb71a('0x48')]['id']}},_0x237310={};_0x237310[_0xb71a('0x31')]=_[_0xb71a('0x33')](db[_0xb71a('0x2e')][_0xb71a('0x49')]);_0x237310[_0xb71a('0x32')]=_[_0xb71a('0x33')](_0x50ac82[_0xb71a('0x32')]);_0x237310[_0xb71a('0x34')]=_[_0xb71a('0x35')](_0x237310['model'],_0x237310[_0xb71a('0x32')]);_0x18dd47[_0xb71a('0x36')]=_[_0xb71a('0x35')](_0x237310['model'],qs[_0xb71a('0x37')](_0x50ac82['query']['fields']));_0x18dd47[_0xb71a('0x36')]=_0x18dd47[_0xb71a('0x36')][_0xb71a('0x38')]?_0x18dd47[_0xb71a('0x36')]:_0x237310[_0xb71a('0x31')];if(_0x50ac82['query']['includeAll']){_0x18dd47[_0xb71a('0x44')]=[{'all':!![]}];}_0x18dd47=_['merge']({},_0x18dd47,_0x50ac82[_0xb71a('0x4a')]);return db[_0xb71a('0x2e')][_0xb71a('0x4b')](_0x18dd47)[_0xb71a('0x24')](handleEntityNotFound(_0x26ac84,null))[_0xb71a('0x24')](respondWithResult(_0x26ac84,null))['catch'](handleError(_0x26ac84,null));};exports['create']=function(_0x2507f2,_0x4453d6){return db['Pause'][_0xb71a('0x4c')](_0x2507f2['body'],{})['then'](function(_0x33e210){var _0x593ca5=_0x2507f2[_0xb71a('0x4d')][_0xb71a('0x26')]({'plain':!![]});if(!_0x593ca5)throw new Error(_0xb71a('0x4e'));if(_0x593ca5[_0xb71a('0x4f')]===_0xb71a('0x4d')){var _0x3069f4=_0x33e210[_0xb71a('0x26')]({'plain':!![]});var _0x18fb4c=_0xb71a('0x27');return db['UserProfileSection'][_0xb71a('0x4b')]({'where':{'name':_0x18fb4c,'userProfileId':_0x593ca5[_0xb71a('0x50')]},'raw':!![]})[_0xb71a('0x24')](function(_0x33fbe8){if(_0x33fbe8&&_0x33fbe8[_0xb71a('0x51')]===0x0){return db[_0xb71a('0x28')][_0xb71a('0x4c')]({'name':_0x3069f4[_0xb71a('0x2b')],'resourceId':_0x3069f4['id'],'type':_0x33fbe8[_0xb71a('0x2b')],'sectionId':_0x33fbe8['id']},{})['then'](function(){return _0x33e210;});}else{return _0x33e210;}})['catch'](function(_0x2c1e6d){logger[_0xb71a('0x29')](_0xb71a('0x52'),_0x2c1e6d);throw _0x2c1e6d;});}return _0x33e210;})[_0xb71a('0x24')](respondWithResult(_0x4453d6,0xc9))[_0xb71a('0x46')](handleError(_0x4453d6,null));};exports[_0xb71a('0x23')]=function(_0x511b42,_0x59deea){if(_0x511b42['body']['id']){delete _0x511b42['body']['id'];}return db['Pause'][_0xb71a('0x4b')]({'where':{'id':_0x511b42[_0xb71a('0x48')]['id']}})['then'](handleEntityNotFound(_0x59deea,null))[_0xb71a('0x24')](saveUpdates(_0x511b42[_0xb71a('0x53')],null))[_0xb71a('0x24')](respondWithResult(_0x59deea,null))[_0xb71a('0x46')](handleError(_0x59deea,null));};exports[_0xb71a('0x25')]=function(_0x50ff9a,_0x4cb5c0){return db[_0xb71a('0x2e')]['find']({'where':{'id':_0x50ff9a[_0xb71a('0x48')]['id']}})[_0xb71a('0x24')](handleEntityNotFound(_0x4cb5c0,null))[_0xb71a('0x24')](removeEntity(_0x4cb5c0,null))[_0xb71a('0x46')](handleError(_0x4cb5c0,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index eaf8f6f..09d626f 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 _0xaa5e=['moment','bluebird','request-promise','path','../../config/environment','./pause.attributes','exports','Pause','tools_pauses','lodash','util','api'];(function(_0x101fc6,_0x42a133){var _0xd47d1e=function(_0x3242a7){while(--_0x3242a7){_0x101fc6['push'](_0x101fc6['shift']());}};_0xd47d1e(++_0x42a133);}(_0xaa5e,0xa5));var _0xeaa5=function(_0x33c5f3,_0x1f3701){_0x33c5f3=_0x33c5f3-0x0;var _0xdd09eb=_0xaa5e[_0x33c5f3];return _0xdd09eb;};'use strict';var _=require(_0xeaa5('0x0'));var util=require(_0xeaa5('0x1'));var logger=require('../../config/logger')(_0xeaa5('0x2'));var moment=require(_0xeaa5('0x3'));var BPromise=require(_0xeaa5('0x4'));var rp=require(_0xeaa5('0x5'));var fs=require('fs');var path=require(_0xeaa5('0x6'));var rimraf=require('rimraf');var config=require(_0xeaa5('0x7'));var attributes=require(_0xeaa5('0x8'));module[_0xeaa5('0x9')]=function(_0x382868,_0x553f20){return _0x382868['define'](_0xeaa5('0xa'),attributes,{'tableName':_0xeaa5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdaa8=['api','./pause.attributes','exports','Pause','lodash','util','../../config/logger'];(function(_0x5cbe8a,_0x41c132){var _0x4b07a1=function(_0x112ff9){while(--_0x112ff9){_0x5cbe8a['push'](_0x5cbe8a['shift']());}};_0x4b07a1(++_0x41c132);}(_0xdaa8,0xe4));var _0x8daa=function(_0x38baa6,_0xdbd80a){_0x38baa6=_0x38baa6-0x0;var _0x3803bf=_0xdaa8[_0x38baa6];return _0x3803bf;};'use strict';var _=require(_0x8daa('0x0'));var util=require(_0x8daa('0x1'));var logger=require(_0x8daa('0x2'))(_0x8daa('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8daa('0x4'));module[_0x8daa('0x5')]=function(_0x46f753,_0x4d2392){return _0x46f753['define'](_0x8daa('0x6'),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 3f4f37d..e5e1da1 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 _0x20bc=['map','model','debug','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','ShowPause','Pause','find','options','raw','attributes','include'];(function(_0x3c0e9a,_0x27a0c5){var _0x2c3f4b=function(_0x4b2494){while(--_0x4b2494){_0x3c0e9a['push'](_0x3c0e9a['shift']());}};_0x2c3f4b(++_0x27a0c5);}(_0x20bc,0x1c5));var _0xc20b=function(_0x1633e9,_0x50a939){_0x1633e9=_0x1633e9-0x0;var _0x549ace=_0x20bc[_0x1633e9];return _0x549ace;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc20b('0x0'));var BPromise=require(_0xc20b('0x1'));var rs=require(_0xc20b('0x2'));var fs=require('fs');var Redis=require(_0xc20b('0x3'));var db=require(_0xc20b('0x4'))['db'];var utils=require(_0xc20b('0x5'));var logger=require('../../config/logger')(_0xc20b('0x6'));var config=require('../../config/environment');var jayson=require(_0xc20b('0x7'));var client=jayson[_0xc20b('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x576f40,_0x23b519,_0x437446){return new BPromise(function(_0x5b15d5,_0x2faf8b){return client[_0xc20b('0x9')](_0x576f40,_0x437446)['then'](function(_0x2c5d43){logger['info'](_0xc20b('0xa'),_0x23b519,'request\x20sent');logger['debug'](_0xc20b('0xb'),_0x23b519,_0xc20b('0xc'),JSON[_0xc20b('0xd')](_0x2c5d43));if(_0x2c5d43[_0xc20b('0xe')]){if(_0x2c5d43[_0xc20b('0xe')][_0xc20b('0xf')]===0x1f4){logger[_0xc20b('0xe')]('Pause,\x20%s,\x20%s',_0x23b519,_0x2c5d43[_0xc20b('0xe')][_0xc20b('0x10')]);return _0x2faf8b(_0x2c5d43[_0xc20b('0xe')][_0xc20b('0x10')]);}logger[_0xc20b('0xe')](_0xc20b('0xa'),_0x23b519,_0x2c5d43[_0xc20b('0xe')][_0xc20b('0x10')]);return _0x5b15d5(_0x2c5d43[_0xc20b('0xe')]['message']);}else{logger[_0xc20b('0x11')](_0xc20b('0xa'),_0x23b519,_0xc20b('0xc'));_0x5b15d5(_0x2c5d43[_0xc20b('0x12')]['message']);}})[_0xc20b('0x13')](function(_0x3a08a7){logger['error']('Pause,\x20%s,\x20%s',_0x23b519,_0x3a08a7);_0x2faf8b(_0x3a08a7);});});}exports[_0xc20b('0x14')]=function(_0x261bcc){var _0x516f60=this;return new Promise(function(_0x35cf08,_0x325910){return db[_0xc20b('0x15')][_0xc20b('0x16')]({'raw':_0x261bcc[_0xc20b('0x17')]?_0x261bcc[_0xc20b('0x17')][_0xc20b('0x18')]===undefined?!![]:![]:!![],'where':_0x261bcc['options']?_0x261bcc[_0xc20b('0x17')]['where']||null:null,'attributes':_0x261bcc[_0xc20b('0x17')]?_0x261bcc['options'][_0xc20b('0x19')]||null:null,'include':_0x261bcc[_0xc20b('0x17')]?_0x261bcc[_0xc20b('0x17')][_0xc20b('0x1a')]?_[_0xc20b('0x1b')](_0x261bcc[_0xc20b('0x17')][_0xc20b('0x1a')],function(_0x3eee5b){return{'model':db[_0x3eee5b[_0xc20b('0x1c')]],'as':_0x3eee5b['as'],'attributes':_0x3eee5b[_0xc20b('0x19')],'include':_0x3eee5b[_0xc20b('0x1a')]?_['map'](_0x3eee5b[_0xc20b('0x1a')],function(_0x4eca88){return{'model':db[_0x4eca88[_0xc20b('0x1c')]],'as':_0x4eca88['as'],'attributes':_0x4eca88['attributes'],'include':_0x4eca88[_0xc20b('0x1a')]?_[_0xc20b('0x1b')](_0x4eca88[_0xc20b('0x1a')],function(_0x153b2e){return{'model':db[_0x153b2e['model']],'as':_0x153b2e['as'],'attributes':_0x153b2e[_0xc20b('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2abf01){logger[_0xc20b('0x11')](_0xc20b('0x14'),_0x261bcc);logger[_0xc20b('0x1d')](_0xc20b('0x14'),_0x261bcc,JSON[_0xc20b('0xd')](_0x2abf01));_0x35cf08(_0x2abf01);})[_0xc20b('0x13')](function(_0x52f349){logger[_0xc20b('0xe')](_0xc20b('0x14'),_0x52f349[_0xc20b('0x10')],_0x261bcc);_0x325910(_0x516f60[_0xc20b('0xe')](0x1f4,_0x52f349['message']));});});}; \ No newline at end of file +var _0x0fa5=['error','code','Pause,\x20%s,\x20%s','message','info','result','catch','ShowPause','Pause','options','where','attributes','include','map','model','then','debug','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','request\x20sent','Pause,\x20%s,\x20%s,\x20%s'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0x0fa5,0x132));var _0x50fa=function(_0x129b52,_0x29a8f3){_0x129b52=_0x129b52-0x0;var _0x5e0266=_0x0fa5[_0x129b52];return _0x5e0266;};'use strict';var _=require(_0x50fa('0x0'));var util=require(_0x50fa('0x1'));var moment=require(_0x50fa('0x2'));var BPromise=require(_0x50fa('0x3'));var rs=require(_0x50fa('0x4'));var fs=require('fs');var Redis=require(_0x50fa('0x5'));var db=require(_0x50fa('0x6'))['db'];var utils=require(_0x50fa('0x7'));var logger=require(_0x50fa('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x50fa('0x9'));var client=jayson[_0x50fa('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x7cf292,_0x54eae3,_0x566f61){return new BPromise(function(_0x348a8a,_0x4c1368){return client[_0x50fa('0xb')](_0x7cf292,_0x566f61)['then'](function(_0x49d53d){logger['info']('Pause,\x20%s,\x20%s',_0x54eae3,_0x50fa('0xc'));logger['debug'](_0x50fa('0xd'),_0x54eae3,_0x50fa('0xc'),JSON['stringify'](_0x49d53d));if(_0x49d53d[_0x50fa('0xe')]){if(_0x49d53d[_0x50fa('0xe')][_0x50fa('0xf')]===0x1f4){logger[_0x50fa('0xe')](_0x50fa('0x10'),_0x54eae3,_0x49d53d[_0x50fa('0xe')][_0x50fa('0x11')]);return _0x4c1368(_0x49d53d[_0x50fa('0xe')][_0x50fa('0x11')]);}logger['error']('Pause,\x20%s,\x20%s',_0x54eae3,_0x49d53d[_0x50fa('0xe')][_0x50fa('0x11')]);return _0x348a8a(_0x49d53d[_0x50fa('0xe')][_0x50fa('0x11')]);}else{logger[_0x50fa('0x12')](_0x50fa('0x10'),_0x54eae3,_0x50fa('0xc'));_0x348a8a(_0x49d53d[_0x50fa('0x13')][_0x50fa('0x11')]);}})[_0x50fa('0x14')](function(_0x385222){logger[_0x50fa('0xe')](_0x50fa('0x10'),_0x54eae3,_0x385222);_0x4c1368(_0x385222);});});}exports[_0x50fa('0x15')]=function(_0x64142f){var _0x58315f=this;return new Promise(function(_0x35fad5,_0x5b8014){return db[_0x50fa('0x16')]['find']({'raw':_0x64142f[_0x50fa('0x17')]?_0x64142f[_0x50fa('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x64142f[_0x50fa('0x17')]?_0x64142f[_0x50fa('0x17')][_0x50fa('0x18')]||null:null,'attributes':_0x64142f['options']?_0x64142f[_0x50fa('0x17')][_0x50fa('0x19')]||null:null,'include':_0x64142f[_0x50fa('0x17')]?_0x64142f[_0x50fa('0x17')][_0x50fa('0x1a')]?_[_0x50fa('0x1b')](_0x64142f['options'][_0x50fa('0x1a')],function(_0x3d1454){return{'model':db[_0x3d1454[_0x50fa('0x1c')]],'as':_0x3d1454['as'],'attributes':_0x3d1454[_0x50fa('0x19')],'include':_0x3d1454[_0x50fa('0x1a')]?_[_0x50fa('0x1b')](_0x3d1454['include'],function(_0x57e917){return{'model':db[_0x57e917['model']],'as':_0x57e917['as'],'attributes':_0x57e917[_0x50fa('0x19')],'include':_0x57e917[_0x50fa('0x1a')]?_['map'](_0x57e917[_0x50fa('0x1a')],function(_0x4c1040){return{'model':db[_0x4c1040[_0x50fa('0x1c')]],'as':_0x4c1040['as'],'attributes':_0x4c1040[_0x50fa('0x19')]};}):[]};}):[]};}):[]:[]})[_0x50fa('0x1d')](function(_0x2d7958){logger[_0x50fa('0x12')](_0x50fa('0x15'),_0x64142f);logger[_0x50fa('0x1e')](_0x50fa('0x15'),_0x64142f,JSON[_0x50fa('0x1f')](_0x2d7958));_0x35fad5(_0x2d7958);})['catch'](function(_0x2e51ac){logger[_0x50fa('0xe')](_0x50fa('0x15'),_0x2e51ac[_0x50fa('0x11')],_0x64142f);_0x5b8014(_0x58315f[_0x50fa('0xe')](0x1f4,_0x2e51ac[_0x50fa('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index 18610a9..4eb504d 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 _0x61ab=['../../config/environment','./plugin.controller','get','isAuthenticated','index','webhookGet','/:id','show','download','diskStorage','join','root','originalname','replace','format','%s-%s%s','basename','extname','post','single','file','upload','/webhook','webhookPost','put','update','delete','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x355dc7,_0x2b73a1){var _0x29b2fb=function(_0x23e678){while(--_0x23e678){_0x355dc7['push'](_0x355dc7['shift']());}};_0x29b2fb(++_0x2b73a1);}(_0x61ab,0x109));var _0xb61a=function(_0x3eb3ad,_0x2b3c21){_0x3eb3ad=_0x3eb3ad-0x0;var _0x1be5b8=_0x61ab[_0x3eb3ad];return _0x1be5b8;};'use strict';var multer=require(_0xb61a('0x0'));var util=require(_0xb61a('0x1'));var path=require(_0xb61a('0x2'));var timeout=require(_0xb61a('0x3'));var express=require('express');var router=express[_0xb61a('0x4')]();var auth=require(_0xb61a('0x5'));var interaction=require(_0xb61a('0x6'));var config=require(_0xb61a('0x7'));var controller=require(_0xb61a('0x8'));router[_0xb61a('0x9')]('/',auth[_0xb61a('0xa')](),controller[_0xb61a('0xb')]);router['get']('/webhook',controller[_0xb61a('0xc')]);router[_0xb61a('0x9')](_0xb61a('0xd'),auth[_0xb61a('0xa')](),controller[_0xb61a('0xe')]);router[_0xb61a('0x9')]('/:id/download',auth['isAuthenticated'](),controller[_0xb61a('0xf')]);var upload=multer({'storage':multer[_0xb61a('0x10')]({'destination':function(_0x4515a6,_0x281ce3,_0x56f9cc){_0x56f9cc(null,path[_0xb61a('0x11')](config[_0xb61a('0x12')],'server/files/plugins'));},'filename':function(_0x48ff0a,_0x3810f8,_0x237c19){_0x3810f8[_0xb61a('0x13')]=_0x3810f8['originalname'][_0xb61a('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x237c19(null,util[_0xb61a('0x15')](_0xb61a('0x16'),path[_0xb61a('0x17')](_0x3810f8[_0xb61a('0x13')],path[_0xb61a('0x18')](_0x3810f8[_0xb61a('0x13')])),Date['now'](),path[_0xb61a('0x18')](_0x3810f8[_0xb61a('0x13')])));}})});router[_0xb61a('0x19')]('/',upload[_0xb61a('0x1a')](_0xb61a('0x1b')),controller[_0xb61a('0x1c')]);router[_0xb61a('0x19')](_0xb61a('0x1d'),controller[_0xb61a('0x1e')]);router[_0xb61a('0x1f')](_0xb61a('0xd'),auth['isAuthenticated'](),controller[_0xb61a('0x20')]);router[_0xb61a('0x21')](_0xb61a('0xd'),auth[_0xb61a('0xa')](),controller[_0xb61a('0x21')]);module['exports']=router; \ No newline at end of file +var _0xb822=['put','update','delete','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./plugin.controller','isAuthenticated','index','get','/webhook','webhookGet','/:id','/:id/download','download','diskStorage','server/files/plugins','originalname','format','basename','now','extname','post','single','file','upload','webhookPost'];(function(_0x148897,_0x35a352){var _0xb8903c=function(_0x4d1f33){while(--_0x4d1f33){_0x148897['push'](_0x148897['shift']());}};_0xb8903c(++_0x35a352);}(_0xb822,0x184));var _0x2b82=function(_0x80d563,_0x229647){_0x80d563=_0x80d563-0x0;var _0x4be196=_0xb822[_0x80d563];return _0x4be196;};'use strict';var multer=require(_0x2b82('0x0'));var util=require('util');var path=require(_0x2b82('0x1'));var timeout=require(_0x2b82('0x2'));var express=require(_0x2b82('0x3'));var router=express[_0x2b82('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x2b82('0x5'));var config=require(_0x2b82('0x6'));var controller=require(_0x2b82('0x7'));router['get']('/',auth[_0x2b82('0x8')](),controller[_0x2b82('0x9')]);router[_0x2b82('0xa')](_0x2b82('0xb'),controller[_0x2b82('0xc')]);router['get'](_0x2b82('0xd'),auth['isAuthenticated'](),controller['show']);router['get'](_0x2b82('0xe'),auth['isAuthenticated'](),controller[_0x2b82('0xf')]);var upload=multer({'storage':multer[_0x2b82('0x10')]({'destination':function(_0x1cddf3,_0x595a85,_0x514032){_0x514032(null,path['join'](config['root'],_0x2b82('0x11')));},'filename':function(_0x9f0c74,_0xb3c66e,_0x401d21){_0xb3c66e[_0x2b82('0x12')]=_0xb3c66e[_0x2b82('0x12')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x401d21(null,util[_0x2b82('0x13')]('%s-%s%s',path[_0x2b82('0x14')](_0xb3c66e[_0x2b82('0x12')],path['extname'](_0xb3c66e[_0x2b82('0x12')])),Date[_0x2b82('0x15')](),path[_0x2b82('0x16')](_0xb3c66e[_0x2b82('0x12')])));}})});router[_0x2b82('0x17')]('/',upload[_0x2b82('0x18')](_0x2b82('0x19')),controller[_0x2b82('0x1a')]);router[_0x2b82('0x17')](_0x2b82('0xb'),controller[_0x2b82('0x1b')]);router[_0x2b82('0x1c')]('/:id',auth[_0x2b82('0x8')](),controller[_0x2b82('0x1d')]);router[_0x2b82('0x1e')]('/:id',auth[_0x2b82('0x8')](),controller['delete']);module[_0x2b82('0x1f')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index b65beb5..e25a123 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 _0xb010=['adminOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','ENUM','html','TEXT','STRING','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0xb010,0x70));var _0x0b01=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xb010[_0x2070da];return _0x4f9fe1;};'use strict';var Sequelize=require(_0x0b01('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x0b01('0x1')](_0x0b01('0x2'),'script')},'description':{'type':Sequelize[_0x0b01('0x3')]},'version':{'type':Sequelize[_0x0b01('0x3')]},'path':{'type':Sequelize[_0x0b01('0x4')],'comment':_0x0b01('0x5')},'active':{'type':Sequelize[_0x0b01('0x6')],'defaultValue':0x0,'comment':_0x0b01('0x7')},'sidebar':{'type':Sequelize[_0x0b01('0x1')](_0x0b01('0x8'),'agentOnly',_0x0b01('0x9'),_0x0b01('0xa')),'defaultValue':_0x0b01('0x9'),'comment':_0x0b01('0xb')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0x0b01('0x4')]},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0x0b01('0x4')]},'scriptPath':{'type':Sequelize[_0x0b01('0x4')]}}; \ No newline at end of file +var _0xef75=['BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','sequelize','exports','STRING','ENUM','html','script','TEXT'];(function(_0x561026,_0x13ea0e){var _0x3afbb9=function(_0x58201b){while(--_0x58201b){_0x561026['push'](_0x561026['shift']());}};_0x3afbb9(++_0x13ea0e);}(_0xef75,0x125));var _0x5ef7=function(_0x11e94a,_0x546819){_0x11e94a=_0x11e94a-0x0;var _0xf5383b=_0xef75[_0x11e94a];return _0xf5383b;};'use strict';var Sequelize=require(_0x5ef7('0x0'));module[_0x5ef7('0x1')]={'name':{'type':Sequelize[_0x5ef7('0x2')]},'type':{'type':Sequelize[_0x5ef7('0x3')](_0x5ef7('0x4'),_0x5ef7('0x5'))},'description':{'type':Sequelize[_0x5ef7('0x6')]},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize[_0x5ef7('0x2')],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize[_0x5ef7('0x7')],'defaultValue':0x0,'comment':_0x5ef7('0x8')},'sidebar':{'type':Sequelize['ENUM'](_0x5ef7('0x9'),_0x5ef7('0xa'),_0x5ef7('0xb'),'never'),'defaultValue':'always','comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize[_0x5ef7('0x2')]},'adminUrl':{'type':Sequelize[_0x5ef7('0x2')]},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0x5ef7('0x2')]},'scriptPath':{'type':Sequelize[_0x5ef7('0x2')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index f430119..08975b4 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 _0x354f=['file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','0777','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','Plugin\x20manifest\x20missing','manifest.json','parse','Invalid\x20manifest:\x20name\x20missing','undefined','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','admin','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','plugins','Warning:\x20admin\x20view\x20not\x20specified','agent','test','Warning:\x20agent\x20view\x20not\x20specified','create','body','userProfileId','role','user','UserProfileSection','Extracted\x20folder\x20removed','delete','webhookGet','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','set','endsWith','statusCode','webhookPost','resolve','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','count','offset','limit','Content-Range','apply','save','update','destroy','then','get','Plugins','UserProfileResource','end','error','stack','name','send','map','rawAttributes','fieldName','key','query','keys','model','attributes','fields','order','sort','where','filters','filter','merge','type','VIRTUAL','options','Plugin','includeAll','include','findAll','params','intersection','length','find','catch','join','root','server/files/plugins','%s.zip','createWriteStream','zip','warning','code','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','dirname','basename','node_modules/**/*','attachments/**/*','existsSync','Plugin\x20not\x20found','download','format','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Temporary\x20file\x20removed'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x354f,0xee));var _0xf354=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0x354f[_0x4b2436];return _0x4f5ab2;};'use strict';var pdf=require(_0xf354('0x0'));var emlformat=require(_0xf354('0x1'));var rimraf=require(_0xf354('0x2'));var zipdir=require(_0xf354('0x3'));var jsonpatch=require(_0xf354('0x4'));var rp=require(_0xf354('0x5'));var moment=require(_0xf354('0x6'));var BPromise=require(_0xf354('0x7'));var Mustache=require(_0xf354('0x8'));var util=require(_0xf354('0x9'));var path=require(_0xf354('0xa'));var sox=require(_0xf354('0xb'));var csv=require(_0xf354('0xc'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf354('0xd'));var squel=require('squel');var crypto=require(_0xf354('0xe'));var jsforce=require(_0xf354('0xf'));var deskjs=require(_0xf354('0x10'));var toCsv=require(_0xf354('0xc'));var querystring=require(_0xf354('0x11'));var Papa=require(_0xf354('0x12'));var extract=require(_0xf354('0x13'));var rimraf=require(_0xf354('0x2'));var archiver=require(_0xf354('0x14'));var Redis=require(_0xf354('0x15'));var authService=require(_0xf354('0x16'));var qs=require('../../components/parsers/qs');var as=require(_0xf354('0x17'));var hardwareService=require(_0xf354('0x18'));var logger=require(_0xf354('0x19'))(_0xf354('0x1a'));var utils=require(_0xf354('0x1b'));var config=require(_0xf354('0x1c'));var db=require('../../mysqldb')['db'];config[_0xf354('0x1d')]=_[_0xf354('0x1e')](config[_0xf354('0x1d')],{'host':_0xf354('0x1f'),'port':0x18eb});var socket=require(_0xf354('0x20'))(new Redis(config[_0xf354('0x1d')]));require('./plugin.socket')[_0xf354('0x21')](socket);function respondWithStatusCode(_0x48730b,_0x4f7eb7){_0x4f7eb7=_0x4f7eb7||0xcc;return function(_0x46428f){if(_0x46428f){return _0x48730b[_0xf354('0x22')](_0x4f7eb7);}return _0x48730b[_0xf354('0x23')](_0x4f7eb7)['end']();};}function respondWithResult(_0x2f9712,_0x46fcd7){_0x46fcd7=_0x46fcd7||0xc8;return function(_0x5379ea){if(_0x5379ea){return _0x2f9712[_0xf354('0x23')](_0x46fcd7)[_0xf354('0x24')](_0x5379ea);}};}function respondWithFilteredResult(_0x12776a,_0x37483b){return function(_0x57b198){if(_0x57b198){var _0x1546da=_0x57b198[_0xf354('0x25')],_0x4d47a4=_0x37483b[_0xf354('0x26')],_0x4803be=_0x37483b[_0xf354('0x26')]+_0x37483b[_0xf354('0x27')],_0x326a71;if(_0x4803be>=_0x1546da){_0x4803be=_0x1546da;_0x326a71=0xc8;}else{_0x326a71=0xce;}_0x12776a['status'](_0x326a71);return _0x12776a['set'](_0xf354('0x28'),_0x4d47a4+'-'+_0x4803be+'/'+_0x1546da)[_0xf354('0x24')](_0x57b198);}return null;};}function patchUpdates(_0x11d2bb){return function(_0x573e0b){try{jsonpatch[_0xf354('0x29')](_0x573e0b,_0x11d2bb,!![]);}catch(_0x18fd08){return BPromise['reject'](_0x18fd08);}return _0x573e0b[_0xf354('0x2a')]();};}function saveUpdates(_0xb63b1b,_0x5b651d){return function(_0x7f10ce){if(_0x7f10ce){return _0x7f10ce[_0xf354('0x2b')](_0xb63b1b)['then'](function(_0x1d36e4){return _0x1d36e4;});}return null;};}function removeEntity(_0x154ff7,_0x339d3c){return function(_0x2433ba){if(_0x2433ba){return _0x2433ba[_0xf354('0x2c')]()[_0xf354('0x2d')](function(){var _0x522638=_0x2433ba[_0xf354('0x2e')]({'plain':!![]});var _0xa9cbf6=_0xf354('0x2f');return db[_0xf354('0x30')][_0xf354('0x2c')]({'where':{'type':_0xa9cbf6,'resourceId':_0x522638['id']}})[_0xf354('0x2d')](function(){return _0x2433ba;});})[_0xf354('0x2d')](function(){_0x154ff7[_0xf354('0x23')](0xcc)[_0xf354('0x31')]();});}};}function handleEntityNotFound(_0x4126fd,_0x26377e){return function(_0x53adb1){if(!_0x53adb1){_0x4126fd[_0xf354('0x22')](0x194);}return _0x53adb1;};}function handleError(_0x3a73f5,_0x1bf245){_0x1bf245=_0x1bf245||0x1f4;return function(_0x5175f6){logger[_0xf354('0x32')](_0x5175f6[_0xf354('0x33')]);if(_0x5175f6['name']){delete _0x5175f6[_0xf354('0x34')];}_0x3a73f5[_0xf354('0x23')](_0x1bf245)[_0xf354('0x35')](_0x5175f6);};}exports['index']=function(_0x27fa4f,_0x2e01ff){var _0x443e18={},_0x355f2c={},_0xf2d0e8={'count':0x0,'rows':[]};var _0x5b92b7=_[_0xf354('0x36')](db['Plugin'][_0xf354('0x37')],function(_0x15fda){return{'name':_0x15fda[_0xf354('0x38')],'type':_0x15fda['type'][_0xf354('0x39')]};});_0x355f2c['model']=_['map'](_0x5b92b7,_0xf354('0x34'));_0x355f2c[_0xf354('0x3a')]=_[_0xf354('0x3b')](_0x27fa4f[_0xf354('0x3a')]);_0x355f2c['filters']=_['intersection'](_0x355f2c[_0xf354('0x3c')],_0x355f2c[_0xf354('0x3a')]);_0x443e18[_0xf354('0x3d')]=_['intersection'](_0x355f2c[_0xf354('0x3c')],qs['fields'](_0x27fa4f[_0xf354('0x3a')][_0xf354('0x3e')]));_0x443e18['attributes']=_0x443e18[_0xf354('0x3d')]['length']?_0x443e18[_0xf354('0x3d')]:_0x355f2c[_0xf354('0x3c')];if(!_0x27fa4f['query']['hasOwnProperty']('nolimit')){_0x443e18['limit']=qs[_0xf354('0x27')](_0x27fa4f[_0xf354('0x3a')][_0xf354('0x27')]);_0x443e18[_0xf354('0x26')]=qs[_0xf354('0x26')](_0x27fa4f[_0xf354('0x3a')][_0xf354('0x26')]);}_0x443e18[_0xf354('0x3f')]=qs[_0xf354('0x40')](_0x27fa4f[_0xf354('0x3a')][_0xf354('0x40')]);_0x443e18[_0xf354('0x41')]=qs[_0xf354('0x42')](_['pick'](_0x27fa4f[_0xf354('0x3a')],_0x355f2c[_0xf354('0x42')]));if(_0x27fa4f[_0xf354('0x3a')][_0xf354('0x43')]){_0x443e18[_0xf354('0x41')]=_[_0xf354('0x44')](_0x443e18['where'],{'$or':_[_0xf354('0x36')](_0x5b92b7,function(_0x32a3d0){if(_0x32a3d0[_0xf354('0x45')][_0xf354('0x39')]!==_0xf354('0x46')){var _0x310029={};_0x310029[_0x32a3d0['field']]={'$like':'%'+_0x27fa4f['query'][_0xf354('0x43')]+'%'};return _0x310029;}})});}_0x443e18=_[_0xf354('0x44')]({},_0x443e18,_0x27fa4f[_0xf354('0x47')]);var _0x334450={'where':_0x443e18[_0xf354('0x41')]};return db[_0xf354('0x48')]['count'](_0x334450)['then'](function(_0x10966f){_0xf2d0e8[_0xf354('0x25')]=_0x10966f;if(_0x27fa4f[_0xf354('0x3a')][_0xf354('0x49')]){_0x443e18[_0xf354('0x4a')]=[{'all':!![]}];}return db['Plugin'][_0xf354('0x4b')](_0x443e18);})['then'](function(_0x47a2d6){_0xf2d0e8['rows']=_0x47a2d6;return _0xf2d0e8;})[_0xf354('0x2d')](respondWithFilteredResult(_0x2e01ff,_0x443e18))['catch'](handleError(_0x2e01ff,null));};exports['show']=function(_0xa7c614,_0x270b70){var _0x1f6382={'raw':!![],'where':{'id':_0xa7c614[_0xf354('0x4c')]['id']}},_0x169e6f={};_0x169e6f['model']=_[_0xf354('0x3b')](db['Plugin']['rawAttributes']);_0x169e6f['query']=_['keys'](_0xa7c614[_0xf354('0x3a')]);_0x169e6f[_0xf354('0x42')]=_['intersection'](_0x169e6f[_0xf354('0x3c')],_0x169e6f[_0xf354('0x3a')]);_0x1f6382[_0xf354('0x3d')]=_[_0xf354('0x4d')](_0x169e6f[_0xf354('0x3c')],qs['fields'](_0xa7c614[_0xf354('0x3a')][_0xf354('0x3e')]));_0x1f6382['attributes']=_0x1f6382['attributes'][_0xf354('0x4e')]?_0x1f6382['attributes']:_0x169e6f[_0xf354('0x3c')];if(_0xa7c614[_0xf354('0x3a')]['includeAll']){_0x1f6382[_0xf354('0x4a')]=[{'all':!![]}];}_0x1f6382=_[_0xf354('0x44')]({},_0x1f6382,_0xa7c614[_0xf354('0x47')]);return db[_0xf354('0x48')][_0xf354('0x4f')](_0x1f6382)[_0xf354('0x2d')](handleEntityNotFound(_0x270b70,null))['then'](respondWithResult(_0x270b70,null))[_0xf354('0x50')](handleError(_0x270b70,null));};exports['download']=function(_0x2684e8,_0x45361d,_0x418599){return db[_0xf354('0x48')][_0xf354('0x4f')]({'where':{'id':_0x2684e8['params']['id']},'attributes':[_0xf354('0x34'),_0xf354('0xa')],'raw':!![]})[_0xf354('0x2d')](handleEntityNotFound(_0x45361d,null))['then'](function(_0x333525){if(_0x333525){var _0xf27663=path[_0xf354('0x51')](config[_0xf354('0x52')],_0xf354('0x53'),util['format'](_0xf354('0x54'),path['basename'](_0x333525['path'])));var _0x106432=fs[_0xf354('0x55')](_0xf27663);var _0x194988=archiver(_0xf354('0x56'),{'zlib':{'level':0x9}});_0x194988['on'](_0xf354('0x57'),function(_0x1dca89){if(_0x1dca89[_0xf354('0x58')]==='ENOENT'){logger[_0xf354('0x32')](_0x1dca89);}else{throw new db[(_0xf354('0x59'))][(_0xf354('0x5a'))](_0xf354('0x5b'));}});_0x194988['on']('error',function(_0x5562ff){throw new db['Sequelize']['Error'](_0xf354('0x5b'));});_0x194988[_0xf354('0x5c')](_0x106432);_0x194988[_0xf354('0x5d')]('**/*',{'cwd':path['join'](config['root'],_0xf354('0x53'),path[_0xf354('0x5e')](_0x333525[_0xf354('0xa')])),'ignore':[path['join'](path[_0xf354('0x5f')](_0x333525[_0xf354('0xa')]),_0xf354('0x60')),path[_0xf354('0x51')](path[_0xf354('0x5f')](_0x333525[_0xf354('0xa')]),_0xf354('0x61'))],'nodir':!![]})['finalize']();_0x106432['on']('close',function(){if(!fs[_0xf354('0x62')](_0xf27663)){throw new db[(_0xf354('0x59'))]['Error'](_0xf354('0x63'));}return _0x45361d[_0xf354('0x64')](_0xf27663,util[_0xf354('0x65')](_0xf354('0x54'),path['basename'](_0x333525[_0xf354('0xa')])),function(_0x102bc1){if(_0x102bc1){throw new db[(_0xf354('0x59'))][(_0xf354('0x5a'))](_0xf354('0x66'));}fs[_0xf354('0x67')](_0xf27663);logger[_0xf354('0x68')]('Download\x20completed');logger[_0xf354('0x68')](_0xf354('0x69'));});});}return null;})['catch'](handleError(_0x45361d,null));};exports['upload']=function(_0x3e409e,_0x2a9094,_0x4d79cb){var _0x26ea36=path[_0xf354('0x5f')](_0x3e409e[_0xf354('0x6a')][_0xf354('0x6b')],path[_0xf354('0x6c')](_0x3e409e[_0xf354('0x6a')]['filename']));var _0x493d78=path[_0xf354('0x51')](config[_0xf354('0x52')],_0xf354('0x53'),_0x3e409e[_0xf354('0x6a')]['filename']);var _0x1a0777=path['join'](config['root'],_0xf354('0x53'),_0x26ea36);logger[_0xf354('0x68')](_0xf354('0x6d'),_0x493d78);logger[_0xf354('0x68')](_0xf354('0x6e'),_0x1a0777);try{fs['chmodSync'](_0x493d78,parseInt(_0xf354('0x6f'),0x8));extract(_0x493d78,{'dir':_0x1a0777},function(_0x2f7bc8){if(_0x2f7bc8){logger[_0xf354('0x32')](_0x2f7bc8);handleError(_0x2f7bc8,!![]);};var _0x233903=fs['readdirSync'](_0x1a0777);if(_0x233903[_0xf354('0x4e')]>0x1){removeReferences(_0x493d78,_0x1a0777);logger[_0xf354('0x32')](_0xf354('0x70'));return _0x4d79cb(new Error('Invalid\x20plugin\x20structure'));}var _0x28a852=fs[_0xf354('0x71')](path['join'](_0x1a0777,_0x233903[0x0]));if(_0x28a852[_0xf354('0x72')]()){removeReferences(_0x493d78,_0x1a0777);logger[_0xf354('0x32')]('Invalid\x20plugin\x20structure');return _0x4d79cb(new Error(_0xf354('0x70')));}if(_0x28a852[_0xf354('0x73')]()){var _0x15ae3c=fs['readdirSync'](path[_0xf354('0x51')](_0x1a0777,_0x233903[0x0]));if(_0x15ae3c[_0xf354('0x4e')]===0x0){removeReferences(_0x493d78,_0x1a0777);logger[_0xf354('0x32')](_0xf354('0x70'));return _0x4d79cb(new Error(_0xf354('0x70')));}var _0x117660=_0x15ae3c[_0xf354('0x74')](function(_0x48908f){return _0x48908f==='manifest.json';});if(!_0x117660){return _0x4d79cb(new Error(_0xf354('0x75')));}var _0x152efd=fs['readFileSync'](path['join'](_0x1a0777,_0x233903[0x0],_0xf354('0x76')));var _0x57c4ac=JSON[_0xf354('0x77')](_0x152efd);if('undefined'==typeof _0x57c4ac['name']){return _0x4d79cb(new Error(_0xf354('0x78')));}if(_0xf354('0x79')==typeof _0x57c4ac[_0xf354('0x45')]){return _0x4d79cb(new Error(_0xf354('0x7a')));}if(_0xf354('0x79')==typeof _0x57c4ac[_0xf354('0x7b')]){return _0x4d79cb(new Error(_0xf354('0x7c')));}if(_0xf354('0x79')==typeof _0x57c4ac[_0xf354('0x7d')]){return _0x4d79cb(new Error(_0xf354('0x7e')));}if(_0x57c4ac[_0xf354('0x45')]===_0xf354('0x7f')){if('undefined'==typeof _0x57c4ac[_0xf354('0x7d')][_0xf354('0x80')]){return _0x4d79cb(new Error(_0xf354('0x81')));}if('undefined'==typeof _0x57c4ac[_0xf354('0x7d')][_0xf354('0x80')][_0xf354('0x82')]&&'undefined'==typeof _0x57c4ac[_0xf354('0x7d')][_0xf354('0x80')]['agent']){return _0x4d79cb(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x57c4ac['type']===_0xf354('0x83')){if(_0xf354('0x79')==typeof _0x57c4ac['parameters'][_0xf354('0x84')]){return _0x4d79cb(new Error(_0xf354('0x85')));}if(_0xf354('0x79')==typeof _0x57c4ac[_0xf354('0x7d')][_0xf354('0x86')]){return _0x4d79cb(new Error(_0xf354('0x87')));}}else{return _0x4d79cb(new Error(_0xf354('0x88')));}var _0x353220=_0x57c4ac['name'];var _0x5088de=_0x57c4ac[_0xf354('0x89')];var _0x2f6994=_0x57c4ac[_0xf354('0x45')];var _0x189dd3=_0x57c4ac[_0xf354('0x8a')]?_0x57c4ac[_0xf354('0x8a')]:_0xf354('0x8b');var _0x52b401=_0x57c4ac[_0xf354('0x8c')]?_0x57c4ac['icon']:_0xf354('0x8d');var _0x26a412='';var _0x298d92='';var _0x2c877a='';var _0x44eeed='';var _0x22c2c0=_0x57c4ac['version'];if(_0x2f6994===_0xf354('0x7f')){if(_0xf354('0x79')!=typeof _0x57c4ac[_0xf354('0x7d')]['views'][_0xf354('0x82')]){var _0x4ac8aa=_0x57c4ac['parameters'][_0xf354('0x80')][_0xf354('0x82')];if(!/^(f|ht)tps?:\/\//i['test'](_0x4ac8aa)){_0x26a412=path[_0xf354('0x51')](_0xf354('0x8e'),_0x26ea36,_0x233903[0x0],_0x4ac8aa);}else{_0x26a412=_0x4ac8aa;}}else{logger[_0xf354('0x68')](_0xf354('0x8f'));}if('undefined'!=typeof _0x57c4ac[_0xf354('0x7d')][_0xf354('0x80')][_0xf354('0x90')]){var _0x3c9b5d=_0x57c4ac['parameters'][_0xf354('0x80')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0xf354('0x91')](_0x3c9b5d)){_0x298d92=path[_0xf354('0x51')]('plugins',_0x26ea36,_0x233903[0x0],_0x3c9b5d);}else{_0x298d92=_0x3c9b5d;}}else{logger[_0xf354('0x68')](_0xf354('0x92'));}}else if(_0x2f6994==='script'){_0x2c877a=_0x57c4ac[_0xf354('0x7d')][_0xf354('0x84')];_0x44eeed=_0x57c4ac[_0xf354('0x7d')][_0xf354('0x86')];if(_0xf354('0x79')!=typeof _0x57c4ac[_0xf354('0x7d')][_0xf354('0x80')]){if(_0xf354('0x79')!=typeof _0x57c4ac[_0xf354('0x7d')][_0xf354('0x80')][_0xf354('0x82')]){var _0x4ac8aa=_0x57c4ac[_0xf354('0x7d')]['views'][_0xf354('0x82')];if(!/^(f|ht)tps?:\/\//i[_0xf354('0x91')](_0x4ac8aa)){_0x26a412=path[_0xf354('0x51')]('plugins',_0x26ea36,_0x233903[0x0],_0x4ac8aa);}else{_0x26a412=_0x4ac8aa;}}if('undefined'!=typeof _0x57c4ac[_0xf354('0x7d')][_0xf354('0x80')][_0xf354('0x90')]){var _0x3c9b5d=_0x57c4ac[_0xf354('0x7d')][_0xf354('0x80')][_0xf354('0x90')];if(!/^(f|ht)tps?:\/\//i[_0xf354('0x91')](_0x3c9b5d)){_0x298d92=path['join'](_0xf354('0x8e'),_0x26ea36,_0x233903[0x0],_0x3c9b5d);}else{_0x298d92=_0x3c9b5d;}}}}var _0x4f0a9d={'name':_0x353220,'description':_0x5088de,'path':path[_0xf354('0x51')](_0x26ea36,_0x233903[0x0]),'type':_0x2f6994,'sidebar':_0x189dd3,'icon':_0x52b401,'adminUrl':_0x26a412,'agentUrl':_0x298d92,'scriptName':_0x2c877a,'scriptPath':_0x44eeed,'version':_0x22c2c0};removeReferences(_0x493d78,null);return db[_0xf354('0x48')][_0xf354('0x93')](_0x4f0a9d)[_0xf354('0x2d')](function(_0x26942b){var _0x5ecb8c={'role':_0x3e409e[_0xf354('0x94')]['role'],'userProfileId':_0x3e409e[_0xf354('0x94')][_0xf354('0x95')]};if(!_0x5ecb8c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5ecb8c[_0xf354('0x96')]===_0xf354('0x97')){var _0x4be48a=_0x26942b[_0xf354('0x2e')]({'plain':!![]});return db[_0xf354('0x98')][_0xf354('0x4f')]({'where':{'name':_0xf354('0x2f'),'userProfileId':_0x5ecb8c[_0xf354('0x95')]},'raw':!![]})['then'](function(_0xbfff08){if(_0xbfff08&&_0xbfff08['autoAssociation']===0x0){return db[_0xf354('0x30')][_0xf354('0x93')]({'name':_0x4be48a[_0xf354('0x34')],'resourceId':_0x4be48a['id'],'type':_0xbfff08['name'],'sectionId':_0xbfff08['id']},{})[_0xf354('0x2d')](function(){return _0x26942b;});}else{return _0x26942b;}})[_0xf354('0x50')](function(_0x59c916){logger[_0xf354('0x32')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x59c916);throw _0x59c916;});}return _0x26942b;})[_0xf354('0x2d')](respondWithResult(_0x2a9094,null))['catch'](handleError(_0x2a9094,null));}});}catch(_0x2bec21){_0x2a9094[_0xf354('0x23')](0x1f4)[_0xf354('0x35')](_0x2bec21);}};function removeReferences(_0x2a7ecb,_0x2a1204){try{if(_0x2a7ecb){fs[_0xf354('0x67')](_0x2a7ecb);logger[_0xf354('0x68')]('Zip\x20archive\x20removed');}if(_0x2a1204){rimraf(_0x2a1204,function(){});logger[_0xf354('0x68')](_0xf354('0x99'));}}catch(_0x35c6a1){logger[_0xf354('0x32')](_0x35c6a1);}}exports[_0xf354('0x2b')]=function(_0x3d8a87,_0x4cbcbe,_0x5eb830){return db['Plugin'][_0xf354('0x4f')]({'where':{'id':_0x3d8a87[_0xf354('0x4c')]['id']}})[_0xf354('0x2d')](handleEntityNotFound(_0x4cbcbe,null))[_0xf354('0x2d')](saveUpdates(_0x3d8a87[_0xf354('0x94')],null))[_0xf354('0x2d')](respondWithResult(_0x4cbcbe,null))[_0xf354('0x50')](handleError(_0x4cbcbe,null));};exports[_0xf354('0x9a')]=function(_0x13779c,_0x2b667c,_0x44416){return db[_0xf354('0x48')][_0xf354('0x4f')]({'where':{'id':_0x13779c[_0xf354('0x4c')]['id']}})['then'](function(_0xcb9166){if(_0xcb9166){return _0xcb9166[_0xf354('0x2c')]();}})[_0xf354('0x2d')](function(_0x1ba51d){rimraf(path[_0xf354('0x51')](config[_0xf354('0x52')],_0xf354('0x53'),path[_0xf354('0x5e')](_0x1ba51d[_0xf354('0xa')])),function(){});return _0x1ba51d;})[_0xf354('0x2d')](handleEntityNotFound(_0x2b667c,null))[_0xf354('0x2d')](respondWithStatusCode(_0x2b667c,null))[_0xf354('0x50')](handleError(_0x2b667c,null));};exports[_0xf354('0x9b')]=function(_0xae1098,_0x530162,_0x52a86f){return BPromise['resolve']()['then'](function(){if(!_0xae1098['query']['path']){throw new Error(_0xf354('0x9c'));}if(!_0xae1098['query'][_0xf354('0x9d')]){throw new Error(_0xf354('0x9e'));}var _0x3f868b=_0xae1098[_0xf354('0x3a')][_0xf354('0x9f')]?_0xae1098[_0xf354('0x3a')][_0xf354('0x9f')]+':'+_0xae1098[_0xf354('0x3a')][_0xf354('0x9d')]:_0xf354('0xa0')+_0xae1098['query']['port'];var _0x3c1ca7=_0xae1098[_0xf354('0x3a')]['json']?_0xae1098['query'][_0xf354('0x24')]:!![];var _0xe169ad=_0xae1098['query'][_0xf354('0xa1')]?_0xae1098[_0xf354('0x3a')][_0xf354('0xa1')]:null;var _0x2134c8={'method':_0xae1098[_0xf354('0xa2')],'uri':util['format'](_0xf354('0xa3'),_0x3f868b,_0xae1098['query']['path']),'json':_0x3c1ca7,'resolveWithFullResponse':!![],'encoding':_0xe169ad,'qs':_0xae1098['query']};if(_0xae1098[_0xf354('0xa4')]){_0x2134c8['headers']=_0xae1098[_0xf354('0xa4')];if(_0x2134c8[_0xf354('0xa4')][_0xf354('0xa5')]){delete _0x2134c8[_0xf354('0xa4')][_0xf354('0xa5')];}}if(_0x2134c8[_0xf354('0xa4')][_0xf354('0xa6')]){delete _0x2134c8[_0xf354('0xa4')]['content-type'];}return rp(_0x2134c8);})[_0xf354('0x2d')](function(_0x113e11){if(_0x113e11){_0x530162[_0xf354('0xa7')](_0x113e11[_0xf354('0xa4')]);logger['info'](_0x113e11[_0xf354('0x94')]);if(_[_0xf354('0xa8')](_0xae1098[_0xf354('0x3a')][_0xf354('0xa')],_0xf354('0x64'))&&_0x113e11[_0xf354('0xa9')]==0x1f4){return _0x530162[_0xf354('0x22')](_0x113e11[_0xf354('0xa9')]);}else{return _0x530162[_0xf354('0x23')](_0x113e11[_0xf354('0xa9')])[_0xf354('0x35')](_0x113e11[_0xf354('0x94')]);}}else{return _0x530162[_0xf354('0x22')](0xc8);}})[_0xf354('0x50')](handleError(_0x530162,null));};exports[_0xf354('0xaa')]=function(_0x27cc3e,_0x3261a8,_0x13a808){return BPromise[_0xf354('0xab')]()[_0xf354('0x2d')](function(){if(!_0x27cc3e[_0xf354('0x3a')][_0xf354('0xa')]){throw new Error(_0xf354('0x9c'));}if(!_0x27cc3e['query'][_0xf354('0x9d')]){throw new Error(_0xf354('0x9e'));}var _0x4ec77b=_0x27cc3e[_0xf354('0x3a')][_0xf354('0x9f')]?_0x27cc3e[_0xf354('0x3a')][_0xf354('0x9f')]+':'+_0x27cc3e[_0xf354('0x3a')][_0xf354('0x9d')]:_0xf354('0xa0')+_0x27cc3e[_0xf354('0x3a')]['port'];var _0x1c6d10=_0x27cc3e[_0xf354('0x3a')]['json']?_0x27cc3e[_0xf354('0x3a')][_0xf354('0x24')]:!![];var _0x1b36b8=_0x27cc3e[_0xf354('0x3a')][_0xf354('0xa1')]?_0x27cc3e['query']['encoding']:null;var _0x1edcf4={'method':_0x27cc3e[_0xf354('0xa2')],'uri':util[_0xf354('0x65')](_0xf354('0xa3'),_0x4ec77b,_0x27cc3e['query'][_0xf354('0xa')]),'json':_0x1c6d10,'resolveWithFullResponse':!![],'encoding':_0x1b36b8,'body':_0x27cc3e[_0xf354('0x94')]};if(_0x27cc3e[_0xf354('0xa4')]){_0x1edcf4[_0xf354('0xa4')]=_0x27cc3e['headers'];if(_0x1edcf4[_0xf354('0xa4')][_0xf354('0xa5')]){delete _0x1edcf4[_0xf354('0xa4')][_0xf354('0xa5')];}}if(_0x1edcf4[_0xf354('0xa4')]['content-type']){delete _0x1edcf4[_0xf354('0xa4')][_0xf354('0xa6')];}return rp(_0x1edcf4);})[_0xf354('0x2d')](function(_0x215dba){if(_0x215dba){_0x3261a8[_0xf354('0xa7')](_0x215dba[_0xf354('0xa4')]);logger[_0xf354('0x68')](_0x215dba[_0xf354('0x94')]);return _0x3261a8['status'](_0x215dba[_0xf354('0xa9')])['send'](_0x215dba[_0xf354('0x94')]);}else{return _0x3261a8['sendStatus'](0xc8);}})[_0xf354('0x50')](handleError(_0x3261a8,null));}; \ No newline at end of file +var _0xeb24=['encoding','%s%s','headers','content-length','content-type','set','statusCode','webhookPost','method','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./plugin.socket','register','sendStatus','status','end','json','count','limit','Content-Range','update','then','destroy','get','Plugins','stack','name','send','map','Plugin','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','offset','order','sort','pick','filter','where','merge','VIRTUAL','field','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','download','root','server/files/plugins','basename','createWriteStream','warning','ENOENT','error','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','join','dirname','attachments/**/*','finalize','close','Plugin\x20not\x20found','format','Error\x20while\x20downloading\x20the\x20plugin','info','Download\x20completed','Temporary\x20file\x20removed','upload','filename','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','isFile','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','undefined','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','plugins','Warning:\x20admin\x20view\x20not\x20specified','test','scriptName','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Extracted\x20folder\x20removed','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:'];(function(_0x2ae16a,_0x12dae0){var _0x11ac8a=function(_0x2d0992){while(--_0x2d0992){_0x2ae16a['push'](_0x2ae16a['shift']());}};_0x11ac8a(++_0x12dae0);}(_0xeb24,0x16b));var _0x4eb2=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xeb24[_0x19950b];return _0x3c6b41;};'use strict';var pdf=require(_0x4eb2('0x0'));var emlformat=require(_0x4eb2('0x1'));var rimraf=require(_0x4eb2('0x2'));var zipdir=require(_0x4eb2('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4eb2('0x4'));var moment=require(_0x4eb2('0x5'));var BPromise=require(_0x4eb2('0x6'));var Mustache=require(_0x4eb2('0x7'));var util=require(_0x4eb2('0x8'));var path=require(_0x4eb2('0x9'));var sox=require(_0x4eb2('0xa'));var csv=require(_0x4eb2('0xb'));var ejs=require(_0x4eb2('0xc'));var fs=require('fs');var _=require(_0x4eb2('0xd'));var squel=require(_0x4eb2('0xe'));var crypto=require(_0x4eb2('0xf'));var jsforce=require(_0x4eb2('0x10'));var deskjs=require(_0x4eb2('0x11'));var toCsv=require(_0x4eb2('0xb'));var querystring=require('querystring');var Papa=require(_0x4eb2('0x12'));var extract=require(_0x4eb2('0x13'));var rimraf=require(_0x4eb2('0x2'));var archiver=require(_0x4eb2('0x14'));var Redis=require(_0x4eb2('0x15'));var authService=require(_0x4eb2('0x16'));var qs=require(_0x4eb2('0x17'));var as=require(_0x4eb2('0x18'));var hardwareService=require(_0x4eb2('0x19'));var logger=require(_0x4eb2('0x1a'))(_0x4eb2('0x1b'));var utils=require(_0x4eb2('0x1c'));var config=require(_0x4eb2('0x1d'));var db=require(_0x4eb2('0x1e'))['db'];config[_0x4eb2('0x1f')]=_[_0x4eb2('0x20')](config[_0x4eb2('0x1f')],{'host':_0x4eb2('0x21'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x4eb2('0x22'))[_0x4eb2('0x23')](socket);function respondWithStatusCode(_0x483093,_0x2df443){_0x2df443=_0x2df443||0xcc;return function(_0x56f8cb){if(_0x56f8cb){return _0x483093[_0x4eb2('0x24')](_0x2df443);}return _0x483093[_0x4eb2('0x25')](_0x2df443)[_0x4eb2('0x26')]();};}function respondWithResult(_0x39b2d9,_0x2bdd49){_0x2bdd49=_0x2bdd49||0xc8;return function(_0x21c9e3){if(_0x21c9e3){return _0x39b2d9[_0x4eb2('0x25')](_0x2bdd49)[_0x4eb2('0x27')](_0x21c9e3);}};}function respondWithFilteredResult(_0x2912d8,_0x5e665e){return function(_0x4985f8){if(_0x4985f8){var _0x42282f=_0x4985f8[_0x4eb2('0x28')],_0x31197a=_0x5e665e['offset'],_0xb07db3=_0x5e665e['offset']+_0x5e665e[_0x4eb2('0x29')],_0x22bb94;if(_0xb07db3>=_0x42282f){_0xb07db3=_0x42282f;_0x22bb94=0xc8;}else{_0x22bb94=0xce;}_0x2912d8['status'](_0x22bb94);return _0x2912d8['set'](_0x4eb2('0x2a'),_0x31197a+'-'+_0xb07db3+'/'+_0x42282f)[_0x4eb2('0x27')](_0x4985f8);}return null;};}function patchUpdates(_0x5ab09c){return function(_0x21222d){try{jsonpatch['apply'](_0x21222d,_0x5ab09c,!![]);}catch(_0x47ef9f){return BPromise['reject'](_0x47ef9f);}return _0x21222d['save']();};}function saveUpdates(_0x2ee336,_0x37c2ee){return function(_0x4345d9){if(_0x4345d9){return _0x4345d9[_0x4eb2('0x2b')](_0x2ee336)[_0x4eb2('0x2c')](function(_0x529103){return _0x529103;});}return null;};}function removeEntity(_0x2fe9c2,_0x46d0d2){return function(_0x99c53e){if(_0x99c53e){return _0x99c53e[_0x4eb2('0x2d')]()['then'](function(){var _0x289d4c=_0x99c53e[_0x4eb2('0x2e')]({'plain':!![]});var _0xc65d6c=_0x4eb2('0x2f');return db['UserProfileResource']['destroy']({'where':{'type':_0xc65d6c,'resourceId':_0x289d4c['id']}})['then'](function(){return _0x99c53e;});})['then'](function(){_0x2fe9c2[_0x4eb2('0x25')](0xcc)[_0x4eb2('0x26')]();});}};}function handleEntityNotFound(_0x350384,_0x336fd3){return function(_0x8ed028){if(!_0x8ed028){_0x350384['sendStatus'](0x194);}return _0x8ed028;};}function handleError(_0x5dd701,_0x48fd20){_0x48fd20=_0x48fd20||0x1f4;return function(_0x8d80b5){logger['error'](_0x8d80b5[_0x4eb2('0x30')]);if(_0x8d80b5[_0x4eb2('0x31')]){delete _0x8d80b5[_0x4eb2('0x31')];}_0x5dd701['status'](_0x48fd20)[_0x4eb2('0x32')](_0x8d80b5);};}exports['index']=function(_0x51b9b2,_0x5aae6a){var _0x327fe2={},_0x327379={},_0x3cb668={'count':0x0,'rows':[]};var _0x4fbdf4=_[_0x4eb2('0x33')](db[_0x4eb2('0x34')]['rawAttributes'],function(_0x24eb25){return{'name':_0x24eb25['fieldName'],'type':_0x24eb25[_0x4eb2('0x35')][_0x4eb2('0x36')]};});_0x327379[_0x4eb2('0x37')]=_[_0x4eb2('0x33')](_0x4fbdf4,_0x4eb2('0x31'));_0x327379[_0x4eb2('0x38')]=_[_0x4eb2('0x39')](_0x51b9b2[_0x4eb2('0x38')]);_0x327379[_0x4eb2('0x3a')]=_[_0x4eb2('0x3b')](_0x327379[_0x4eb2('0x37')],_0x327379[_0x4eb2('0x38')]);_0x327fe2[_0x4eb2('0x3c')]=_[_0x4eb2('0x3b')](_0x327379[_0x4eb2('0x37')],qs[_0x4eb2('0x3d')](_0x51b9b2[_0x4eb2('0x38')][_0x4eb2('0x3d')]));_0x327fe2[_0x4eb2('0x3c')]=_0x327fe2['attributes'][_0x4eb2('0x3e')]?_0x327fe2[_0x4eb2('0x3c')]:_0x327379[_0x4eb2('0x37')];if(!_0x51b9b2[_0x4eb2('0x38')]['hasOwnProperty'](_0x4eb2('0x3f'))){_0x327fe2[_0x4eb2('0x29')]=qs['limit'](_0x51b9b2['query'][_0x4eb2('0x29')]);_0x327fe2[_0x4eb2('0x40')]=qs[_0x4eb2('0x40')](_0x51b9b2['query']['offset']);}_0x327fe2[_0x4eb2('0x41')]=qs[_0x4eb2('0x42')](_0x51b9b2[_0x4eb2('0x38')][_0x4eb2('0x42')]);_0x327fe2['where']=qs[_0x4eb2('0x3a')](_[_0x4eb2('0x43')](_0x51b9b2[_0x4eb2('0x38')],_0x327379[_0x4eb2('0x3a')]));if(_0x51b9b2[_0x4eb2('0x38')][_0x4eb2('0x44')]){_0x327fe2[_0x4eb2('0x45')]=_[_0x4eb2('0x46')](_0x327fe2['where'],{'$or':_[_0x4eb2('0x33')](_0x4fbdf4,function(_0x12a588){if(_0x12a588['type'][_0x4eb2('0x36')]!==_0x4eb2('0x47')){var _0xa0f7e5={};_0xa0f7e5[_0x12a588[_0x4eb2('0x48')]]={'$like':'%'+_0x51b9b2['query'][_0x4eb2('0x44')]+'%'};return _0xa0f7e5;}})});}_0x327fe2=_[_0x4eb2('0x46')]({},_0x327fe2,_0x51b9b2[_0x4eb2('0x49')]);var _0x244fbb={'where':_0x327fe2[_0x4eb2('0x45')]};return db[_0x4eb2('0x34')][_0x4eb2('0x28')](_0x244fbb)[_0x4eb2('0x2c')](function(_0x1cdb77){_0x3cb668[_0x4eb2('0x28')]=_0x1cdb77;if(_0x51b9b2[_0x4eb2('0x38')][_0x4eb2('0x4a')]){_0x327fe2[_0x4eb2('0x4b')]=[{'all':!![]}];}return db['Plugin'][_0x4eb2('0x4c')](_0x327fe2);})[_0x4eb2('0x2c')](function(_0x1a837c){_0x3cb668[_0x4eb2('0x4d')]=_0x1a837c;return _0x3cb668;})[_0x4eb2('0x2c')](respondWithFilteredResult(_0x5aae6a,_0x327fe2))['catch'](handleError(_0x5aae6a,null));};exports[_0x4eb2('0x4e')]=function(_0x56114d,_0x34f2ef){var _0x430032={'raw':!![],'where':{'id':_0x56114d[_0x4eb2('0x4f')]['id']}},_0xcfeead={};_0xcfeead[_0x4eb2('0x37')]=_[_0x4eb2('0x39')](db[_0x4eb2('0x34')][_0x4eb2('0x50')]);_0xcfeead[_0x4eb2('0x38')]=_['keys'](_0x56114d[_0x4eb2('0x38')]);_0xcfeead[_0x4eb2('0x3a')]=_[_0x4eb2('0x3b')](_0xcfeead[_0x4eb2('0x37')],_0xcfeead[_0x4eb2('0x38')]);_0x430032[_0x4eb2('0x3c')]=_[_0x4eb2('0x3b')](_0xcfeead[_0x4eb2('0x37')],qs[_0x4eb2('0x3d')](_0x56114d[_0x4eb2('0x38')][_0x4eb2('0x3d')]));_0x430032[_0x4eb2('0x3c')]=_0x430032[_0x4eb2('0x3c')][_0x4eb2('0x3e')]?_0x430032[_0x4eb2('0x3c')]:_0xcfeead[_0x4eb2('0x37')];if(_0x56114d[_0x4eb2('0x38')][_0x4eb2('0x4a')]){_0x430032['include']=[{'all':!![]}];}_0x430032=_[_0x4eb2('0x46')]({},_0x430032,_0x56114d[_0x4eb2('0x49')]);return db[_0x4eb2('0x34')][_0x4eb2('0x51')](_0x430032)['then'](handleEntityNotFound(_0x34f2ef,null))[_0x4eb2('0x2c')](respondWithResult(_0x34f2ef,null))[_0x4eb2('0x52')](handleError(_0x34f2ef,null));};exports[_0x4eb2('0x53')]=function(_0x6f3e16,_0x54b5a9,_0x442f97){return db[_0x4eb2('0x34')]['find']({'where':{'id':_0x6f3e16[_0x4eb2('0x4f')]['id']},'attributes':[_0x4eb2('0x31'),_0x4eb2('0x9')],'raw':!![]})[_0x4eb2('0x2c')](handleEntityNotFound(_0x54b5a9,null))[_0x4eb2('0x2c')](function(_0x4b4363){if(_0x4b4363){var _0x18e819=path['join'](config[_0x4eb2('0x54')],_0x4eb2('0x55'),util['format']('%s.zip',path[_0x4eb2('0x56')](_0x4b4363[_0x4eb2('0x9')])));var _0x3a7a85=fs[_0x4eb2('0x57')](_0x18e819);var _0x334d4f=archiver('zip',{'zlib':{'level':0x9}});_0x334d4f['on'](_0x4eb2('0x58'),function(_0x115fbb){if(_0x115fbb['code']===_0x4eb2('0x59')){logger[_0x4eb2('0x5a')](_0x115fbb);}else{throw new db[(_0x4eb2('0x5b'))][(_0x4eb2('0x5c'))](_0x4eb2('0x5d'));}});_0x334d4f['on'](_0x4eb2('0x5a'),function(_0x39b5c8){throw new db[(_0x4eb2('0x5b'))][(_0x4eb2('0x5c'))](_0x4eb2('0x5d'));});_0x334d4f[_0x4eb2('0x5e')](_0x3a7a85);_0x334d4f[_0x4eb2('0x5f')](_0x4eb2('0x60'),{'cwd':path[_0x4eb2('0x61')](config[_0x4eb2('0x54')],_0x4eb2('0x55'),path[_0x4eb2('0x62')](_0x4b4363[_0x4eb2('0x9')])),'ignore':[path[_0x4eb2('0x61')](path['basename'](_0x4b4363[_0x4eb2('0x9')]),'node_modules/**/*'),path[_0x4eb2('0x61')](path[_0x4eb2('0x56')](_0x4b4363[_0x4eb2('0x9')]),_0x4eb2('0x63'))],'nodir':!![]})[_0x4eb2('0x64')]();_0x3a7a85['on'](_0x4eb2('0x65'),function(){if(!fs['existsSync'](_0x18e819)){throw new db[(_0x4eb2('0x5b'))][(_0x4eb2('0x5c'))](_0x4eb2('0x66'));}return _0x54b5a9[_0x4eb2('0x53')](_0x18e819,util[_0x4eb2('0x67')]('%s.zip',path[_0x4eb2('0x56')](_0x4b4363[_0x4eb2('0x9')])),function(_0x4f55b5){if(_0x4f55b5){throw new db[(_0x4eb2('0x5b'))][(_0x4eb2('0x5c'))](_0x4eb2('0x68'));}fs['unlinkSync'](_0x18e819);logger[_0x4eb2('0x69')](_0x4eb2('0x6a'));logger[_0x4eb2('0x69')](_0x4eb2('0x6b'));});});}return null;})[_0x4eb2('0x52')](handleError(_0x54b5a9,null));};exports[_0x4eb2('0x6c')]=function(_0xb1c197,_0x5ac8cd,_0x3acab9){var _0x5bca7c=path[_0x4eb2('0x56')](_0xb1c197['file'][_0x4eb2('0x6d')],path['extname'](_0xb1c197['file']['filename']));var _0x2bbf3c=path[_0x4eb2('0x61')](config['root'],'server/files/plugins',_0xb1c197['file'][_0x4eb2('0x6d')]);var _0x5fc4d2=path[_0x4eb2('0x61')](config[_0x4eb2('0x54')],_0x4eb2('0x55'),_0x5bca7c);logger[_0x4eb2('0x69')](_0x4eb2('0x6e'),_0x2bbf3c);logger[_0x4eb2('0x69')](_0x4eb2('0x6f'),_0x5fc4d2);try{fs[_0x4eb2('0x70')](_0x2bbf3c,parseInt(_0x4eb2('0x71'),0x8));extract(_0x2bbf3c,{'dir':_0x5fc4d2},function(_0x3961a4){if(_0x3961a4){logger[_0x4eb2('0x5a')](_0x3961a4);handleError(_0x3961a4,!![]);};var _0x40ed2c=fs[_0x4eb2('0x72')](_0x5fc4d2);if(_0x40ed2c[_0x4eb2('0x3e')]>0x1){removeReferences(_0x2bbf3c,_0x5fc4d2);logger[_0x4eb2('0x5a')](_0x4eb2('0x73'));return _0x3acab9(new Error(_0x4eb2('0x73')));}var _0x144c56=fs['lstatSync'](path[_0x4eb2('0x61')](_0x5fc4d2,_0x40ed2c[0x0]));if(_0x144c56[_0x4eb2('0x74')]()){removeReferences(_0x2bbf3c,_0x5fc4d2);logger['error'](_0x4eb2('0x73'));return _0x3acab9(new Error('Invalid\x20plugin\x20structure'));}if(_0x144c56[_0x4eb2('0x75')]()){var _0x56f387=fs['readdirSync'](path['join'](_0x5fc4d2,_0x40ed2c[0x0]));if(_0x56f387[_0x4eb2('0x3e')]===0x0){removeReferences(_0x2bbf3c,_0x5fc4d2);logger[_0x4eb2('0x5a')]('Invalid\x20plugin\x20structure');return _0x3acab9(new Error('Invalid\x20plugin\x20structure'));}var _0x2f3d74=_0x56f387[_0x4eb2('0x76')](function(_0x259eb8){return _0x259eb8===_0x4eb2('0x77');});if(!_0x2f3d74){return _0x3acab9(new Error(_0x4eb2('0x78')));}var _0x47c509=fs[_0x4eb2('0x79')](path['join'](_0x5fc4d2,_0x40ed2c[0x0],'manifest.json'));var _0x567fc8=JSON[_0x4eb2('0x7a')](_0x47c509);if(_0x4eb2('0x7b')==typeof _0x567fc8['name']){return _0x3acab9(new Error(_0x4eb2('0x7c')));}if(_0x4eb2('0x7b')==typeof _0x567fc8[_0x4eb2('0x35')]){return _0x3acab9(new Error(_0x4eb2('0x7d')));}if(_0x4eb2('0x7b')==typeof _0x567fc8[_0x4eb2('0x7e')]){return _0x3acab9(new Error(_0x4eb2('0x7f')));}if(_0x4eb2('0x7b')==typeof _0x567fc8[_0x4eb2('0x80')]){return _0x3acab9(new Error(_0x4eb2('0x81')));}if(_0x567fc8[_0x4eb2('0x35')]===_0x4eb2('0x82')){if(_0x4eb2('0x7b')==typeof _0x567fc8[_0x4eb2('0x80')][_0x4eb2('0x83')]){return _0x3acab9(new Error(_0x4eb2('0x84')));}if(_0x4eb2('0x7b')==typeof _0x567fc8['parameters'][_0x4eb2('0x83')][_0x4eb2('0x85')]&&'undefined'==typeof _0x567fc8[_0x4eb2('0x80')]['views'][_0x4eb2('0x86')]){return _0x3acab9(new Error(_0x4eb2('0x87')));}}else if(_0x567fc8[_0x4eb2('0x35')]===_0x4eb2('0x88')){if(_0x4eb2('0x7b')==typeof _0x567fc8[_0x4eb2('0x80')]['scriptName']){return _0x3acab9(new Error(_0x4eb2('0x89')));}if(_0x4eb2('0x7b')==typeof _0x567fc8['parameters'][_0x4eb2('0x8a')]){return _0x3acab9(new Error(_0x4eb2('0x8b')));}}else{return _0x3acab9(new Error(_0x4eb2('0x8c')));}var _0x201a8c=_0x567fc8[_0x4eb2('0x31')];var _0x5907c9=_0x567fc8[_0x4eb2('0x8d')];var _0x5555a3=_0x567fc8[_0x4eb2('0x35')];var _0x3d73d7=_0x567fc8[_0x4eb2('0x8e')]?_0x567fc8[_0x4eb2('0x8e')]:_0x4eb2('0x8f');var _0x5ed20d=_0x567fc8[_0x4eb2('0x90')]?_0x567fc8[_0x4eb2('0x90')]:_0x4eb2('0x91');var _0xfccbc0='';var _0x190011='';var _0x3e5ade='';var _0x189802='';var _0x42ff10=_0x567fc8[_0x4eb2('0x7e')];if(_0x5555a3===_0x4eb2('0x82')){if(_0x4eb2('0x7b')!=typeof _0x567fc8['parameters']['views']['admin']){var _0x38a4a0=_0x567fc8[_0x4eb2('0x80')][_0x4eb2('0x83')][_0x4eb2('0x85')];if(!/^(f|ht)tps?:\/\//i['test'](_0x38a4a0)){_0xfccbc0=path[_0x4eb2('0x61')](_0x4eb2('0x92'),_0x5bca7c,_0x40ed2c[0x0],_0x38a4a0);}else{_0xfccbc0=_0x38a4a0;}}else{logger[_0x4eb2('0x69')](_0x4eb2('0x93'));}if(_0x4eb2('0x7b')!=typeof _0x567fc8[_0x4eb2('0x80')][_0x4eb2('0x83')][_0x4eb2('0x86')]){var _0x48cd5d=_0x567fc8[_0x4eb2('0x80')][_0x4eb2('0x83')][_0x4eb2('0x86')];if(!/^(f|ht)tps?:\/\//i[_0x4eb2('0x94')](_0x48cd5d)){_0x190011=path['join'](_0x4eb2('0x92'),_0x5bca7c,_0x40ed2c[0x0],_0x48cd5d);}else{_0x190011=_0x48cd5d;}}else{logger[_0x4eb2('0x69')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x5555a3===_0x4eb2('0x88')){_0x3e5ade=_0x567fc8[_0x4eb2('0x80')][_0x4eb2('0x95')];_0x189802=_0x567fc8['parameters'][_0x4eb2('0x8a')];if(_0x4eb2('0x7b')!=typeof _0x567fc8[_0x4eb2('0x80')]['views']){if(_0x4eb2('0x7b')!=typeof _0x567fc8[_0x4eb2('0x80')]['views'][_0x4eb2('0x85')]){var _0x38a4a0=_0x567fc8[_0x4eb2('0x80')][_0x4eb2('0x83')][_0x4eb2('0x85')];if(!/^(f|ht)tps?:\/\//i[_0x4eb2('0x94')](_0x38a4a0)){_0xfccbc0=path[_0x4eb2('0x61')]('plugins',_0x5bca7c,_0x40ed2c[0x0],_0x38a4a0);}else{_0xfccbc0=_0x38a4a0;}}if(_0x4eb2('0x7b')!=typeof _0x567fc8[_0x4eb2('0x80')]['views'][_0x4eb2('0x86')]){var _0x48cd5d=_0x567fc8[_0x4eb2('0x80')]['views'][_0x4eb2('0x86')];if(!/^(f|ht)tps?:\/\//i['test'](_0x48cd5d)){_0x190011=path[_0x4eb2('0x61')](_0x4eb2('0x92'),_0x5bca7c,_0x40ed2c[0x0],_0x48cd5d);}else{_0x190011=_0x48cd5d;}}}}var _0x468699={'name':_0x201a8c,'description':_0x5907c9,'path':path[_0x4eb2('0x61')](_0x5bca7c,_0x40ed2c[0x0]),'type':_0x5555a3,'sidebar':_0x3d73d7,'icon':_0x5ed20d,'adminUrl':_0xfccbc0,'agentUrl':_0x190011,'scriptName':_0x3e5ade,'scriptPath':_0x189802,'version':_0x42ff10};removeReferences(_0x2bbf3c,null);return db[_0x4eb2('0x34')]['create'](_0x468699)[_0x4eb2('0x2c')](function(_0x1cb778){var _0x250ffc={'role':_0xb1c197[_0x4eb2('0x96')][_0x4eb2('0x97')],'userProfileId':_0xb1c197[_0x4eb2('0x96')]['userProfileId']};if(!_0x250ffc)throw new Error(_0x4eb2('0x98'));if(_0x250ffc[_0x4eb2('0x97')]===_0x4eb2('0x99')){var _0x59e39a=_0x1cb778[_0x4eb2('0x2e')]({'plain':!![]});return db[_0x4eb2('0x9a')][_0x4eb2('0x51')]({'where':{'name':_0x4eb2('0x2f'),'userProfileId':_0x250ffc[_0x4eb2('0x9b')]},'raw':!![]})[_0x4eb2('0x2c')](function(_0x5705ea){if(_0x5705ea&&_0x5705ea[_0x4eb2('0x9c')]===0x0){return db[_0x4eb2('0x9d')]['create']({'name':_0x59e39a[_0x4eb2('0x31')],'resourceId':_0x59e39a['id'],'type':_0x5705ea[_0x4eb2('0x31')],'sectionId':_0x5705ea['id']},{})[_0x4eb2('0x2c')](function(){return _0x1cb778;});}else{return _0x1cb778;}})['catch'](function(_0x4819f){logger[_0x4eb2('0x5a')](_0x4eb2('0x9e'),_0x4819f);throw _0x4819f;});}return _0x1cb778;})['then'](respondWithResult(_0x5ac8cd,null))[_0x4eb2('0x52')](handleError(_0x5ac8cd,null));}});}catch(_0x2c2a77){_0x5ac8cd[_0x4eb2('0x25')](0x1f4)[_0x4eb2('0x32')](_0x2c2a77);}};function removeReferences(_0x19a7c4,_0x2a1647){try{if(_0x19a7c4){fs['unlinkSync'](_0x19a7c4);logger['info']('Zip\x20archive\x20removed');}if(_0x2a1647){rimraf(_0x2a1647,function(){});logger[_0x4eb2('0x69')](_0x4eb2('0x9f'));}}catch(_0x371b4e){logger[_0x4eb2('0x5a')](_0x371b4e);}}exports[_0x4eb2('0x2b')]=function(_0x4b34bf,_0x3acacd,_0x24a82a){return db['Plugin'][_0x4eb2('0x51')]({'where':{'id':_0x4b34bf[_0x4eb2('0x4f')]['id']}})[_0x4eb2('0x2c')](handleEntityNotFound(_0x3acacd,null))[_0x4eb2('0x2c')](saveUpdates(_0x4b34bf['body'],null))['then'](respondWithResult(_0x3acacd,null))[_0x4eb2('0x52')](handleError(_0x3acacd,null));};exports[_0x4eb2('0xa0')]=function(_0x243412,_0x53af3d,_0x91a472){return db['Plugin'][_0x4eb2('0x51')]({'where':{'id':_0x243412[_0x4eb2('0x4f')]['id']}})[_0x4eb2('0x2c')](function(_0x2149c5){if(_0x2149c5){return _0x2149c5['destroy']();}})[_0x4eb2('0x2c')](function(_0x187d18){rimraf(path[_0x4eb2('0x61')](config['root'],_0x4eb2('0x55'),path[_0x4eb2('0x62')](_0x187d18[_0x4eb2('0x9')])),function(){});return _0x187d18;})[_0x4eb2('0x2c')](handleEntityNotFound(_0x53af3d,null))[_0x4eb2('0x2c')](respondWithStatusCode(_0x53af3d,null))[_0x4eb2('0x52')](handleError(_0x53af3d,null));};exports[_0x4eb2('0xa1')]=function(_0x31998e,_0x42fac8,_0x489dc8){return BPromise[_0x4eb2('0xa2')]()[_0x4eb2('0x2c')](function(){if(!_0x31998e[_0x4eb2('0x38')][_0x4eb2('0x9')]){throw new Error(_0x4eb2('0xa3'));}if(!_0x31998e[_0x4eb2('0x38')][_0x4eb2('0xa4')]){throw new Error(_0x4eb2('0xa5'));}var _0x1d3a11=_0x31998e[_0x4eb2('0x38')]['hostname']?_0x31998e[_0x4eb2('0x38')][_0x4eb2('0xa6')]+':'+_0x31998e[_0x4eb2('0x38')]['port']:_0x4eb2('0xa7')+_0x31998e['query']['port'];var _0x22dc9d=_0x31998e[_0x4eb2('0x38')][_0x4eb2('0x27')]?_0x31998e[_0x4eb2('0x38')][_0x4eb2('0x27')]:!![];var _0x711b9f=_0x31998e[_0x4eb2('0x38')]['encoding']?_0x31998e[_0x4eb2('0x38')][_0x4eb2('0xa8')]:null;var _0x17c1a4={'method':_0x31998e['method'],'uri':util[_0x4eb2('0x67')](_0x4eb2('0xa9'),_0x1d3a11,_0x31998e[_0x4eb2('0x38')]['path']),'json':_0x22dc9d,'resolveWithFullResponse':!![],'encoding':_0x711b9f,'qs':_0x31998e['query']};if(_0x31998e[_0x4eb2('0xaa')]){_0x17c1a4['headers']=_0x31998e[_0x4eb2('0xaa')];if(_0x17c1a4['headers']['content-length']){delete _0x17c1a4[_0x4eb2('0xaa')][_0x4eb2('0xab')];}}if(_0x17c1a4[_0x4eb2('0xaa')][_0x4eb2('0xac')]){delete _0x17c1a4['headers'][_0x4eb2('0xac')];}return rp(_0x17c1a4);})['then'](function(_0xbed9b7){if(_0xbed9b7){_0x42fac8[_0x4eb2('0xad')](_0xbed9b7[_0x4eb2('0xaa')]);logger[_0x4eb2('0x69')](_0xbed9b7['body']);if(_['endsWith'](_0x31998e['query'][_0x4eb2('0x9')],_0x4eb2('0x53'))&&_0xbed9b7['statusCode']==0x1f4){return _0x42fac8[_0x4eb2('0x24')](_0xbed9b7[_0x4eb2('0xae')]);}else{return _0x42fac8[_0x4eb2('0x25')](_0xbed9b7['statusCode'])['send'](_0xbed9b7[_0x4eb2('0x96')]);}}else{return _0x42fac8[_0x4eb2('0x24')](0xc8);}})[_0x4eb2('0x52')](handleError(_0x42fac8,null));};exports[_0x4eb2('0xaf')]=function(_0x1ca60b,_0x3b62c6,_0x4fc502){return BPromise['resolve']()[_0x4eb2('0x2c')](function(){if(!_0x1ca60b[_0x4eb2('0x38')][_0x4eb2('0x9')]){throw new Error(_0x4eb2('0xa3'));}if(!_0x1ca60b[_0x4eb2('0x38')][_0x4eb2('0xa4')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x3fda34=_0x1ca60b['query'][_0x4eb2('0xa6')]?_0x1ca60b[_0x4eb2('0x38')][_0x4eb2('0xa6')]+':'+_0x1ca60b[_0x4eb2('0x38')][_0x4eb2('0xa4')]:'http://localhost:'+_0x1ca60b['query'][_0x4eb2('0xa4')];var _0x20fff0=_0x1ca60b[_0x4eb2('0x38')][_0x4eb2('0x27')]?_0x1ca60b[_0x4eb2('0x38')][_0x4eb2('0x27')]:!![];var _0x2110e1=_0x1ca60b['query'][_0x4eb2('0xa8')]?_0x1ca60b[_0x4eb2('0x38')]['encoding']:null;var _0x1a58c2={'method':_0x1ca60b[_0x4eb2('0xb0')],'uri':util[_0x4eb2('0x67')](_0x4eb2('0xa9'),_0x3fda34,_0x1ca60b[_0x4eb2('0x38')]['path']),'json':_0x20fff0,'resolveWithFullResponse':!![],'encoding':_0x2110e1,'body':_0x1ca60b[_0x4eb2('0x96')]};if(_0x1ca60b['headers']){_0x1a58c2[_0x4eb2('0xaa')]=_0x1ca60b[_0x4eb2('0xaa')];if(_0x1a58c2[_0x4eb2('0xaa')][_0x4eb2('0xab')]){delete _0x1a58c2[_0x4eb2('0xaa')]['content-length'];}}if(_0x1a58c2[_0x4eb2('0xaa')][_0x4eb2('0xac')]){delete _0x1a58c2[_0x4eb2('0xaa')][_0x4eb2('0xac')];}return rp(_0x1a58c2);})['then'](function(_0x1328a6){if(_0x1328a6){_0x3b62c6[_0x4eb2('0xad')](_0x1328a6[_0x4eb2('0xaa')]);logger[_0x4eb2('0x69')](_0x1328a6[_0x4eb2('0x96')]);return _0x3b62c6['status'](_0x1328a6[_0x4eb2('0xae')])['send'](_0x1328a6[_0x4eb2('0x96')]);}else{return _0x3b62c6[_0x4eb2('0x24')](0xc8);}})[_0x4eb2('0x52')](handleError(_0x3b62c6,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index a4eb3f0..52089e3 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 _0x66c3=['remove','emit','exports','events','../../mysqldb','Plugin','setMaxListeners','save'];(function(_0x26a518,_0x11f10a){var _0x1313c8=function(_0x18640b){while(--_0x18640b){_0x26a518['push'](_0x26a518['shift']());}};_0x1313c8(++_0x11f10a);}(_0x66c3,0x1cb));var _0x366c=function(_0x95cd63,_0x9c23b2){_0x95cd63=_0x95cd63-0x0;var _0x35ec35=_0x66c3[_0x95cd63];return _0x35ec35;};'use strict';var EventEmitter=require(_0x366c('0x0'));var Plugin=require(_0x366c('0x1'))['db'][_0x366c('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x366c('0x3')](0x0);var events={'afterCreate':_0x366c('0x4'),'afterUpdate':'update','afterDestroy':_0x366c('0x5')};function emitEvent(_0xdd0806){return function(_0x839f76,_0x15846c,_0x6d5372){PluginEvents[_0x366c('0x6')](_0xdd0806+':'+_0x839f76['id'],_0x839f76);PluginEvents[_0x366c('0x6')](_0xdd0806,_0x839f76);_0x6d5372(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0x366c('0x7')]=PluginEvents; \ No newline at end of file +var _0x8556=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','Plugin','setMaxListeners','save'];(function(_0x513db9,_0x37c2cd){var _0x36c769=function(_0x1e6a84){while(--_0x1e6a84){_0x513db9['push'](_0x513db9['shift']());}};_0x36c769(++_0x37c2cd);}(_0x8556,0x7f));var _0x6855=function(_0x169ea9,_0xf9fc24){_0x169ea9=_0x169ea9-0x0;var _0x1ab3e3=_0x8556[_0x169ea9];return _0x1ab3e3;};'use strict';var EventEmitter=require(_0x6855('0x0'));var Plugin=require(_0x6855('0x1'))['db'][_0x6855('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x6855('0x3')](0x0);var events={'afterCreate':_0x6855('0x4'),'afterUpdate':_0x6855('0x5'),'afterDestroy':_0x6855('0x6')};function emitEvent(_0x433e9e){return function(_0x8ce00,_0x259780,_0x1af95c){PluginEvents[_0x6855('0x7')](_0x433e9e+':'+_0x8ce00['id'],_0x8ce00);PluginEvents[_0x6855('0x7')](_0x433e9e,_0x8ce00);_0x1af95c(null);};}for(var e in events){if(events[_0x6855('0x8')](e)){var event=events[e];Plugin[_0x6855('0x9')](e,emitEvent(event));}}module[_0x6855('0xa')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 31257dd..eb69690 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 _0xb458=['path','rimraf','./plugin.attributes','define','Plugin','plugins','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x53f72d,_0x51afa3){var _0x193580=function(_0x54f86b){while(--_0x54f86b){_0x53f72d['push'](_0x53f72d['shift']());}};_0x193580(++_0x51afa3);}(_0xb458,0x103));var _0x8b45=function(_0x469ed3,_0x3c1e7b){_0x469ed3=_0x469ed3-0x0;var _0x11dff4=_0xb458[_0x469ed3];return _0x11dff4;};'use strict';var _=require(_0x8b45('0x0'));var util=require(_0x8b45('0x1'));var logger=require(_0x8b45('0x2'))('api');var moment=require('moment');var BPromise=require(_0x8b45('0x3'));var rp=require(_0x8b45('0x4'));var fs=require('fs');var path=require(_0x8b45('0x5'));var rimraf=require(_0x8b45('0x6'));var config=require('../../config/environment');var attributes=require(_0x8b45('0x7'));module['exports']=function(_0x5cc2d5,_0xe8d774){return _0x5cc2d5[_0x8b45('0x8')](_0x8b45('0x9'),attributes,{'tableName':_0x8b45('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x84ab=['request-promise','path','../../config/environment','./plugin.attributes','exports','Plugin','lodash','util','../../config/logger','api','moment'];(function(_0x357398,_0x5727f9){var _0x561d9a=function(_0x5176c5){while(--_0x5176c5){_0x357398['push'](_0x357398['shift']());}};_0x561d9a(++_0x5727f9);}(_0x84ab,0x12f));var _0xb84a=function(_0xccf869,_0x2556a5){_0xccf869=_0xccf869-0x0;var _0x21a9db=_0x84ab[_0xccf869];return _0x21a9db;};'use strict';var _=require(_0xb84a('0x0'));var util=require(_0xb84a('0x1'));var logger=require(_0xb84a('0x2'))(_0xb84a('0x3'));var moment=require(_0xb84a('0x4'));var BPromise=require('bluebird');var rp=require(_0xb84a('0x5'));var fs=require('fs');var path=require(_0xb84a('0x6'));var rimraf=require('rimraf');var config=require(_0xb84a('0x7'));var attributes=require(_0xb84a('0x8'));module[_0xb84a('0x9')]=function(_0x5b9def,_0x521a64){return _0x5b9def['define'](_0xb84a('0xa'),attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index c5eb2f8..407f229 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 _0xbc9d=['register','request','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','CreatePlugin','Plugin','create','body','options','raw','then','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','localhost','socket.io-emitter','./plugin.socket'];(function(_0x3e926e,_0x22d0af){var _0x5432b7=function(_0x29eaa6){while(--_0x29eaa6){_0x3e926e['push'](_0x3e926e['shift']());}};_0x5432b7(++_0x22d0af);}(_0xbc9d,0x17d));var _0xdbc9=function(_0x57b13b,_0x2dfec5){_0x57b13b=_0x57b13b-0x0;var _0x5afcb0=_0xbc9d[_0x57b13b];return _0x5afcb0;};'use strict';var _=require(_0xdbc9('0x0'));var util=require(_0xdbc9('0x1'));var moment=require(_0xdbc9('0x2'));var BPromise=require(_0xdbc9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdbc9('0x4'));var db=require(_0xdbc9('0x5'))['db'];var utils=require(_0xdbc9('0x6'));var logger=require(_0xdbc9('0x7'))(_0xdbc9('0x8'));var config=require(_0xdbc9('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xdbc9('0xa')]({'port':0x232a});config[_0xdbc9('0xb')]=_['defaults'](config['redis'],{'host':_0xdbc9('0xc'),'port':0x18eb});var socket=require(_0xdbc9('0xd'))(new Redis(config[_0xdbc9('0xb')]));require(_0xdbc9('0xe'))[_0xdbc9('0xf')](socket);function respondWithRpcPromise(_0x5bbfee,_0x3b95af,_0x21065c){return new BPromise(function(_0x1112c3,_0xb01163){return client[_0xdbc9('0x10')](_0x5bbfee,_0x21065c)['then'](function(_0x405fdc){logger[_0xdbc9('0x11')](_0xdbc9('0x12'),_0x3b95af,_0xdbc9('0x13'));logger[_0xdbc9('0x14')]('Plugin,\x20%s,\x20%s,\x20%s',_0x3b95af,_0xdbc9('0x13'),JSON[_0xdbc9('0x15')](_0x405fdc));if(_0x405fdc[_0xdbc9('0x16')]){if(_0x405fdc['error']['code']===0x1f4){logger[_0xdbc9('0x16')](_0xdbc9('0x12'),_0x3b95af,_0x405fdc[_0xdbc9('0x16')][_0xdbc9('0x17')]);return _0xb01163(_0x405fdc[_0xdbc9('0x16')][_0xdbc9('0x17')]);}logger[_0xdbc9('0x16')](_0xdbc9('0x12'),_0x3b95af,_0x405fdc[_0xdbc9('0x16')]['message']);return _0x1112c3(_0x405fdc[_0xdbc9('0x16')][_0xdbc9('0x17')]);}else{logger['info']('Plugin,\x20%s,\x20%s',_0x3b95af,_0xdbc9('0x13'));_0x1112c3(_0x405fdc[_0xdbc9('0x18')][_0xdbc9('0x17')]);}})['catch'](function(_0xd7d84d){logger[_0xdbc9('0x16')](_0xdbc9('0x12'),_0x3b95af,_0xd7d84d);_0xb01163(_0xd7d84d);});});}exports[_0xdbc9('0x19')]=function(_0x541939){var _0x2ab3c6=this;return new Promise(function(_0x5c2142,_0x13a3f7){return db[_0xdbc9('0x1a')][_0xdbc9('0x1b')](_0x541939[_0xdbc9('0x1c')],{'raw':_0x541939[_0xdbc9('0x1d')]?_0x541939[_0xdbc9('0x1d')][_0xdbc9('0x1e')]===undefined?!![]:![]:!![]})[_0xdbc9('0x1f')](function(_0x42b1eb){logger[_0xdbc9('0x11')](_0xdbc9('0x19'),_0x541939);logger[_0xdbc9('0x14')](_0xdbc9('0x19'),_0x541939,JSON['stringify'](_0x42b1eb));_0x5c2142(_0x42b1eb);})[_0xdbc9('0x20')](function(_0x30ffcd){logger[_0xdbc9('0x16')](_0xdbc9('0x19'),_0x30ffcd[_0xdbc9('0x17')],_0x541939);_0x13a3f7(_0x2ab3c6['error'](0x1f4,_0x30ffcd['message']));});});}; \ No newline at end of file +var _0x00f1=['jayson/promise','redis','defaults','socket.io-emitter','./plugin.socket','register','request','then','info','debug','Plugin,\x20%s,\x20%s,\x20%s','error','code','Plugin,\x20%s,\x20%s','message','result','catch','CreatePlugin','Plugin','create','body','options','raw','stringify','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0xdd45,_0x2daf10){var _0x106736=function(_0xe27a56){while(--_0xe27a56){_0xdd45['push'](_0xdd45['shift']());}};_0x106736(++_0x2daf10);}(_0x00f1,0x120));var _0x100f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x00f1[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x100f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x100f('0x1'));var rs=require(_0x100f('0x2'));var fs=require('fs');var Redis=require(_0x100f('0x3'));var db=require(_0x100f('0x4'))['db'];var utils=require(_0x100f('0x5'));var logger=require(_0x100f('0x6'))(_0x100f('0x7'));var config=require(_0x100f('0x8'));var jayson=require(_0x100f('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x100f('0xa')]=_[_0x100f('0xb')](config[_0x100f('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x100f('0xc'))(new Redis(config['redis']));require(_0x100f('0xd'))[_0x100f('0xe')](socket);function respondWithRpcPromise(_0x47a5a2,_0x350e20,_0x272059){return new BPromise(function(_0x2e072a,_0x4f6a3f){return client[_0x100f('0xf')](_0x47a5a2,_0x272059)[_0x100f('0x10')](function(_0x44e0e1){logger[_0x100f('0x11')]('Plugin,\x20%s,\x20%s',_0x350e20,'request\x20sent');logger[_0x100f('0x12')](_0x100f('0x13'),_0x350e20,'request\x20sent',JSON['stringify'](_0x44e0e1));if(_0x44e0e1['error']){if(_0x44e0e1[_0x100f('0x14')][_0x100f('0x15')]===0x1f4){logger['error'](_0x100f('0x16'),_0x350e20,_0x44e0e1[_0x100f('0x14')][_0x100f('0x17')]);return _0x4f6a3f(_0x44e0e1[_0x100f('0x14')][_0x100f('0x17')]);}logger['error'](_0x100f('0x16'),_0x350e20,_0x44e0e1[_0x100f('0x14')][_0x100f('0x17')]);return _0x2e072a(_0x44e0e1[_0x100f('0x14')][_0x100f('0x17')]);}else{logger[_0x100f('0x11')](_0x100f('0x16'),_0x350e20,'request\x20sent');_0x2e072a(_0x44e0e1[_0x100f('0x18')][_0x100f('0x17')]);}})[_0x100f('0x19')](function(_0x422f3f){logger['error'](_0x100f('0x16'),_0x350e20,_0x422f3f);_0x4f6a3f(_0x422f3f);});});}exports[_0x100f('0x1a')]=function(_0x3cf4c5){var _0xa47ec3=this;return new Promise(function(_0x382dba,_0x461f8a){return db[_0x100f('0x1b')][_0x100f('0x1c')](_0x3cf4c5[_0x100f('0x1d')],{'raw':_0x3cf4c5['options']?_0x3cf4c5[_0x100f('0x1e')][_0x100f('0x1f')]===undefined?!![]:![]:!![]})[_0x100f('0x10')](function(_0x1855e5){logger[_0x100f('0x11')](_0x100f('0x1a'),_0x3cf4c5);logger[_0x100f('0x12')](_0x100f('0x1a'),_0x3cf4c5,JSON[_0x100f('0x20')](_0x1855e5));_0x382dba(_0x1855e5);})['catch'](function(_0x5a3e81){logger[_0x100f('0x14')](_0x100f('0x1a'),_0x5a3e81[_0x100f('0x17')],_0x3cf4c5);_0x461f8a(_0xa47ec3[_0x100f('0x14')](0x1f4,_0x5a3e81[_0x100f('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 8bd7af8..d6dd9fe 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 _0x4429=['emit','plugin:','save','remove','update'];(function(_0x20df90,_0x57ad32){var _0x2f30fd=function(_0x824166){while(--_0x824166){_0x20df90['push'](_0x20df90['shift']());}};_0x2f30fd(++_0x57ad32);}(_0x4429,0x1ce));var _0x9442=function(_0x3cc576,_0x39a269){_0x3cc576=_0x3cc576-0x0;var _0x53b2fa=_0x4429[_0x3cc576];return _0x53b2fa;};'use strict';var PluginEvents=require('./plugin.events');var events=[_0x9442('0x0'),_0x9442('0x1'),_0x9442('0x2')];function createListener(_0x2bfb2f,_0x59425d){return function(_0x2842a1){_0x59425d[_0x9442('0x3')](_0x2bfb2f,_0x2842a1);};}function removeListener(_0x1205a4,_0x24a9f9){return function(){PluginEvents['removeListener'](_0x1205a4,_0x24a9f9);};}exports['register']=function(_0x4bee35){for(var _0x1a5aa7=0x0,_0x26192a=events['length'];_0x1a5aa7<_0x26192a;_0x1a5aa7++){var _0x491c12=events[_0x1a5aa7];var _0x3234fa=createListener(_0x9442('0x4')+_0x491c12,_0x4bee35);PluginEvents['on'](_0x491c12,_0x3234fa);}}; \ No newline at end of file +var _0x8c7a=['register','plugin:','./plugin.events','update','emit','removeListener'];(function(_0x8bed08,_0x37db8d){var _0x428369=function(_0x5bd10e){while(--_0x5bd10e){_0x8bed08['push'](_0x8bed08['shift']());}};_0x428369(++_0x37db8d);}(_0x8c7a,0x8c));var _0xa8c7=function(_0x30e806,_0x353a5e){_0x30e806=_0x30e806-0x0;var _0x5b717b=_0x8c7a[_0x30e806];return _0x5b717b;};'use strict';var PluginEvents=require(_0xa8c7('0x0'));var events=['save','remove',_0xa8c7('0x1')];function createListener(_0x485112,_0x1d2011){return function(_0x3bf4c4){_0x1d2011[_0xa8c7('0x2')](_0x485112,_0x3bf4c4);};}function removeListener(_0x582b2c,_0x4a58b9){return function(){PluginEvents[_0xa8c7('0x3')](_0x582b2c,_0x4a58b9);};}exports[_0xa8c7('0x4')]=function(_0x1afbe0){for(var _0x2ecdf1=0x0,_0x416db0=events['length'];_0x2ecdf1<_0x416db0;_0x2ecdf1++){var _0x37d743=events[_0x2ecdf1];var _0x5b85e2=createListener(_0xa8c7('0x5')+_0x37d743,_0x1afbe0);PluginEvents['on'](_0x37d743,_0x5b85e2);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 2733d87..b1f9ef7 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 _0x9d17=['./pm2.controller','get','/:id','show','post','isAuthenticated','update','destroy','exports','../../components/auth/service'];(function(_0x31efe7,_0x52fe9e){var _0x24b6ee=function(_0x65ae94){while(--_0x65ae94){_0x31efe7['push'](_0x31efe7['shift']());}};_0x24b6ee(++_0x52fe9e);}(_0x9d17,0x117));var _0x79d1=function(_0x53ef61,_0x44cda6){_0x53ef61=_0x53ef61-0x0;var _0x4e4207=_0x9d17[_0x53ef61];return _0x4e4207;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0x79d1('0x0'));var controller=require(_0x79d1('0x1'));router[_0x79d1('0x2')]('/',auth['isAuthenticated'](),controller['index']);router[_0x79d1('0x2')](_0x79d1('0x3'),auth['isAuthenticated'](),controller[_0x79d1('0x4')]);router[_0x79d1('0x5')]('/',auth[_0x79d1('0x6')](),controller['create']);router['put']('/:id',auth[_0x79d1('0x6')](),controller[_0x79d1('0x7')]);router['delete'](_0x79d1('0x3'),auth['isAuthenticated'](),controller[_0x79d1('0x8')]);module[_0x79d1('0x9')]=router; \ No newline at end of file +var _0xf3b4=['exports','express','../../components/auth/service','./pm2.controller','get','index','/:id','isAuthenticated','show','put','update','delete','destroy'];(function(_0x4fa912,_0x2b6c4c){var _0xfef55c=function(_0x2f1d53){while(--_0x2f1d53){_0x4fa912['push'](_0x4fa912['shift']());}};_0xfef55c(++_0x2b6c4c);}(_0xf3b4,0x146));var _0x4f3b=function(_0x4b3533,_0x19a589){_0x4b3533=_0x4b3533-0x0;var _0x206e9f=_0xf3b4[_0x4b3533];return _0x206e9f;};'use strict';var express=require(_0x4f3b('0x0'));var router=express['Router']();var auth=require(_0x4f3b('0x1'));var controller=require(_0x4f3b('0x2'));router[_0x4f3b('0x3')]('/',auth['isAuthenticated'](),controller[_0x4f3b('0x4')]);router[_0x4f3b('0x3')](_0x4f3b('0x5'),auth[_0x4f3b('0x6')](),controller[_0x4f3b('0x7')]);router['post']('/',auth[_0x4f3b('0x6')](),controller['create']);router[_0x4f3b('0x8')]('/:id',auth[_0x4f3b('0x6')](),controller[_0x4f3b('0x9')]);router[_0x4f3b('0xa')]('/:id',auth[_0x4f3b('0x6')](),controller[_0x4f3b('0xb')]);module[_0x4f3b('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 24eddf1..3a8be1b 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 _0xa719=['chdir','dirname','dump','send','update','restart','stop','hasOwnProperty','params','Unknown\x20status','destroy','delete','Unknown\x20id','lodash','path','exec','bluebird','status','json','stack','name','npm\x20install','info','error','index','list','then','reject','express','motion2','length','catch','show','describe','create','body','join','../../files/plugins','script','cwd'];(function(_0x3038be,_0x425d69){var _0x581d4e=function(_0x1f0731){while(--_0x1f0731){_0x3038be['push'](_0x3038be['shift']());}};_0x581d4e(++_0x425d69);}(_0xa719,0xd5));var _0x9a71=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xa719[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x9a71('0x0'));var pm2=require('../../config/pm2');var logger=require('../../config/logger')('api');var path=require(_0x9a71('0x1'));var exec=require('child_process')[_0x9a71('0x2')];var BPromise=require(_0x9a71('0x3'));function handleEntityNotFound(_0x54c9d7,_0x20898e){return function(_0xb7037d){if(!_0xb7037d){_0x54c9d7['sendStatus'](0x194);;}return _0xb7037d;};}function respondWithResult(_0x29cd7d,_0x5eb279){_0x5eb279=_0x5eb279||0xc8;return function(_0x505b77){if(_0x505b77){return _0x29cd7d[_0x9a71('0x4')](_0x5eb279)[_0x9a71('0x5')](_0x505b77);}return null;};}function handleError(_0x4038af,_0x237bc0){_0x237bc0=_0x237bc0||0x1f4;return function(_0x1b9684){logger['error'](_0x1b9684[_0x9a71('0x6')]);if(_0x1b9684[_0x9a71('0x7')]){delete _0x1b9684[_0x9a71('0x7')];}_0x4038af[_0x9a71('0x4')](_0x237bc0)['send'](_0x1b9684);};}function execChildProcess(){return new BPromise(function(_0x3cf874,_0x13a26d){exec(_0x9a71('0x8'),function(_0x321d3f,_0x21e742,_0x550ddf){logger[_0x9a71('0x9')](_0x21e742);logger[_0x9a71('0x9')](_0x550ddf);if(_0x321d3f){logger[_0x9a71('0xa')](_0x321d3f);return _0x13a26d(_0x321d3f);}return _0x3cf874(_0x21e742);});});}exports[_0x9a71('0xb')]=function(_0x2f26c1,_0x3ac9d4){return pm2[_0x9a71('0xc')]()[_0x9a71('0xd')](function(_0x71f5f6){if(_0x71f5f6){var _0x315d35=_[_0x9a71('0xe')](_0x71f5f6,function(_0x356584){return _0x356584['name']===_0x9a71('0xf')||_0x356584[_0x9a71('0x7')]===_0x9a71('0x10');});return{'rows':_0x315d35,'count':_0x315d35[_0x9a71('0x11')]};}return null;})[_0x9a71('0xd')](respondWithResult(_0x3ac9d4,null))[_0x9a71('0x12')](handleError(_0x3ac9d4,null));};exports[_0x9a71('0x13')]=function(_0xe35048,_0x2fe132){return pm2[_0x9a71('0x14')](_0xe35048['params']['id'])[_0x9a71('0xd')](respondWithResult(_0x2fe132,null))[_0x9a71('0xd')](handleEntityNotFound(_0x2fe132,null))[_0x9a71('0x12')](handleError(_0x2fe132,null));};exports[_0x9a71('0x15')]=function(_0x281568,_0x13d843){if(_0x281568['body'][_0x9a71('0x7')]&&_0x281568[_0x9a71('0x16')]['script']){var _0x115186=path[_0x9a71('0x17')](__dirname,_0x9a71('0x18'),_0x281568['body'][_0x9a71('0x19')]);var _0x7ea7af=process[_0x9a71('0x1a')]();process[_0x9a71('0x1b')](path[_0x9a71('0x1c')](_0x115186));return execChildProcess()['then'](function(_0x1833a3){process[_0x9a71('0x1b')](_0x7ea7af);return pm2['start']({'name':_0x281568[_0x9a71('0x16')][_0x9a71('0x7')],'script':_0x115186});})['then'](function(_0x20167c){pm2[_0x9a71('0x1d')]();return _0x20167c[0x0];})['then'](respondWithResult(_0x13d843,0xc9))[_0x9a71('0x12')](handleError(_0x13d843,null));}else{return _0x13d843[_0x9a71('0x4')](0x1f4)[_0x9a71('0x1e')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0x9a71('0x1f')]=function(_0x536fd4,_0x3f15aa){if(_0x536fd4[_0x9a71('0x16')]['id']){delete _0x536fd4[_0x9a71('0x16')]['id'];}var _0x17bf3a={'online':_0x9a71('0x20'),'stopped':_0x9a71('0x21')};if(_0x17bf3a[_0x9a71('0x22')](_0x536fd4[_0x9a71('0x16')][_0x9a71('0x4')])){return pm2[_0x17bf3a[_0x536fd4[_0x9a71('0x16')][_0x9a71('0x4')]]](_0x536fd4[_0x9a71('0x23')]['id'])['then'](respondWithResult(_0x3f15aa,0xc8))[_0x9a71('0x12')](handleError(_0x3f15aa,null));}else{return _0x3f15aa[_0x9a71('0x4')](0x1f4)['send']({'message':_0x9a71('0x24')});}};exports[_0x9a71('0x25')]=function(_0x235ed0,_0x255bb7){if(_0x235ed0[_0x9a71('0x16')]['id']){delete _0x235ed0['body']['id'];}if(_0x235ed0[_0x9a71('0x23')]['id']){return pm2[_0x9a71('0x26')](_0x235ed0['params']['id'])[_0x9a71('0xd')](function(_0x50377d){pm2['dump']();return _0x50377d[0x0];})[_0x9a71('0xd')](respondWithResult(_0x255bb7,null))['catch'](handleError(_0x255bb7,null));}else{return _0x255bb7['status'](0x1f4)['send']({'message':_0x9a71('0x27')});}}; \ No newline at end of file +var _0xb174=['reject','express','length','catch','show','describe','create','body','script','join','../../files/plugins','chdir','dirname','dump','Missing\x20name\x20and/or\x20path','restart','hasOwnProperty','params','Unknown\x20status','destroy','delete','Unknown\x20id','../../config/pm2','api','path','child_process','bluebird','sendStatus','json','error','stack','name','status','send','npm\x20install','info','index','list','then'];(function(_0xbe200f,_0x4b50eb){var _0x192597=function(_0x106cfd){while(--_0x106cfd){_0xbe200f['push'](_0xbe200f['shift']());}};_0x192597(++_0x4b50eb);}(_0xb174,0x19c));var _0x4b17=function(_0x1913d6,_0x490f64){_0x1913d6=_0x1913d6-0x0;var _0x3494ec=_0xb174[_0x1913d6];return _0x3494ec;};'use strict';var _=require('lodash');var pm2=require(_0x4b17('0x0'));var logger=require('../../config/logger')(_0x4b17('0x1'));var path=require(_0x4b17('0x2'));var exec=require(_0x4b17('0x3'))['exec'];var BPromise=require(_0x4b17('0x4'));function handleEntityNotFound(_0x523b6b,_0x53da64){return function(_0x50c8e1){if(!_0x50c8e1){_0x523b6b[_0x4b17('0x5')](0x194);;}return _0x50c8e1;};}function respondWithResult(_0x4beb4a,_0xd18575){_0xd18575=_0xd18575||0xc8;return function(_0x21f424){if(_0x21f424){return _0x4beb4a['status'](_0xd18575)[_0x4b17('0x6')](_0x21f424);}return null;};}function handleError(_0x5acea3,_0x4bd7ab){_0x4bd7ab=_0x4bd7ab||0x1f4;return function(_0x289379){logger[_0x4b17('0x7')](_0x289379[_0x4b17('0x8')]);if(_0x289379[_0x4b17('0x9')]){delete _0x289379['name'];}_0x5acea3[_0x4b17('0xa')](_0x4bd7ab)[_0x4b17('0xb')](_0x289379);};}function execChildProcess(){return new BPromise(function(_0xe04285,_0x2bc12e){exec(_0x4b17('0xc'),function(_0x56ac1f,_0x1de8ab,_0x1cfe0f){logger['info'](_0x1de8ab);logger[_0x4b17('0xd')](_0x1cfe0f);if(_0x56ac1f){logger[_0x4b17('0x7')](_0x56ac1f);return _0x2bc12e(_0x56ac1f);}return _0xe04285(_0x1de8ab);});});}exports[_0x4b17('0xe')]=function(_0x246ad0,_0x22f1d2){return pm2[_0x4b17('0xf')]()[_0x4b17('0x10')](function(_0x148eaa){if(_0x148eaa){var _0x8eb834=_[_0x4b17('0x11')](_0x148eaa,function(_0x2b97bf){return _0x2b97bf[_0x4b17('0x9')]===_0x4b17('0x12')||_0x2b97bf['name']==='motion2';});return{'rows':_0x8eb834,'count':_0x8eb834[_0x4b17('0x13')]};}return null;})['then'](respondWithResult(_0x22f1d2,null))[_0x4b17('0x14')](handleError(_0x22f1d2,null));};exports[_0x4b17('0x15')]=function(_0x42a7ac,_0x41279c){return pm2[_0x4b17('0x16')](_0x42a7ac['params']['id'])[_0x4b17('0x10')](respondWithResult(_0x41279c,null))[_0x4b17('0x10')](handleEntityNotFound(_0x41279c,null))[_0x4b17('0x14')](handleError(_0x41279c,null));};exports[_0x4b17('0x17')]=function(_0x53888f,_0x409815){if(_0x53888f[_0x4b17('0x18')][_0x4b17('0x9')]&&_0x53888f[_0x4b17('0x18')][_0x4b17('0x19')]){var _0x5bc375=path[_0x4b17('0x1a')](__dirname,_0x4b17('0x1b'),_0x53888f['body'][_0x4b17('0x19')]);var _0x1941a9=process['cwd']();process[_0x4b17('0x1c')](path[_0x4b17('0x1d')](_0x5bc375));return execChildProcess()[_0x4b17('0x10')](function(_0x192436){process[_0x4b17('0x1c')](_0x1941a9);return pm2['start']({'name':_0x53888f[_0x4b17('0x18')][_0x4b17('0x9')],'script':_0x5bc375});})[_0x4b17('0x10')](function(_0x35dc81){pm2[_0x4b17('0x1e')]();return _0x35dc81[0x0];})[_0x4b17('0x10')](respondWithResult(_0x409815,0xc9))[_0x4b17('0x14')](handleError(_0x409815,null));}else{return _0x409815['status'](0x1f4)[_0x4b17('0xb')]({'message':_0x4b17('0x1f')});}};exports['update']=function(_0x25291d,_0x1ae721){if(_0x25291d[_0x4b17('0x18')]['id']){delete _0x25291d['body']['id'];}var _0x57c867={'online':_0x4b17('0x20'),'stopped':'stop'};if(_0x57c867[_0x4b17('0x21')](_0x25291d[_0x4b17('0x18')][_0x4b17('0xa')])){return pm2[_0x57c867[_0x25291d[_0x4b17('0x18')][_0x4b17('0xa')]]](_0x25291d[_0x4b17('0x22')]['id'])[_0x4b17('0x10')](respondWithResult(_0x1ae721,0xc8))[_0x4b17('0x14')](handleError(_0x1ae721,null));}else{return _0x1ae721['status'](0x1f4)['send']({'message':_0x4b17('0x23')});}};exports[_0x4b17('0x24')]=function(_0x42b8f4,_0xfa8415){if(_0x42b8f4[_0x4b17('0x18')]['id']){delete _0x42b8f4[_0x4b17('0x18')]['id'];}if(_0x42b8f4[_0x4b17('0x22')]['id']){return pm2[_0x4b17('0x25')](_0x42b8f4[_0x4b17('0x22')]['id'])[_0x4b17('0x10')](function(_0x3a07ca){pm2[_0x4b17('0x1e')]();return _0x3a07ca[0x0];})['then'](respondWithResult(_0xfa8415,null))[_0x4b17('0x14')](handleError(_0xfa8415,null));}else{return _0xfa8415[_0x4b17('0xa')](0x1f4)[_0x4b17('0xb')]({'message':_0x4b17('0x26')});}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 83b9635..dfb7b14 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 _0x00d5=['util','connect-timeout','../../components/interaction/service','../../config/environment','exports'];(function(_0x503ffc,_0x38c59b){var _0x4c4a56=function(_0x5acaad){while(--_0x5acaad){_0x503ffc['push'](_0x503ffc['shift']());}};_0x4c4a56(++_0x38c59b);}(_0x00d5,0x78));var _0x500d=function(_0x15f590,_0x42b288){_0x15f590=_0x15f590-0x0;var _0x53671c=_0x00d5[_0x15f590];return _0x53671c;};'use strict';var multer=require('multer');var util=require(_0x500d('0x0'));var path=require('path');var timeout=require(_0x500d('0x1'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x500d('0x2'));var config=require(_0x500d('0x3'));module[_0x500d('0x4')]=router; \ No newline at end of file +var _0xe053=['multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports'];(function(_0x275d4b,_0x53a574){var _0x13f34b=function(_0x100ff9){while(--_0x100ff9){_0x275d4b['push'](_0x275d4b['shift']());}};_0x13f34b(++_0x53a574);}(_0xe053,0x1d4));var _0x3e05=function(_0x143a91,_0x235332){_0x143a91=_0x143a91-0x0;var _0x1906f5=_0xe053[_0x143a91];return _0x1906f5;};'use strict';var multer=require(_0x3e05('0x0'));var util=require(_0x3e05('0x1'));var path=require(_0x3e05('0x2'));var timeout=require(_0x3e05('0x3'));var express=require('express');var router=express[_0x3e05('0x4')]();var auth=require(_0x3e05('0x5'));var interaction=require(_0x3e05('0x6'));var config=require(_0x3e05('0x7'));module[_0x3e05('0x8')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index e1045e9..3c175a1 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 _0x3574=['sequelize','exports','INTEGER','DATE','STRING'];(function(_0xef89d,_0x287047){var _0x23d599=function(_0x20ebad){while(--_0x20ebad){_0xef89d['push'](_0xef89d['shift']());}};_0x23d599(++_0x287047);}(_0x3574,0x82));var _0x4357=function(_0x358d5a,_0x420b8f){_0x358d5a=_0x358d5a-0x0;var _0x11254d=_0x3574[_0x358d5a];return _0x11254d;};'use strict';var Sequelize=require(_0x4357('0x0'));module[_0x4357('0x1')]={'state':{'type':Sequelize[_0x4357('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x4357('0x3')]},'uniqueid':{'type':Sequelize[_0x4357('0x4')]},'starttime':{'type':Sequelize[_0x4357('0x3')]},'responsetime':{'type':Sequelize[_0x4357('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x4357('0x4')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x4357('0x4')]}}; \ No newline at end of file +var _0xf5ca=['DATE','sequelize','INTEGER','STRING'];(function(_0x3c9a71,_0x37140d){var _0x4761cd=function(_0x32e990){while(--_0x32e990){_0x3c9a71['push'](_0x3c9a71['shift']());}};_0x4761cd(++_0x37140d);}(_0xf5ca,0x131));var _0xaf5c=function(_0x4d65d8,_0x56cd64){_0x4d65d8=_0x4d65d8-0x0;var _0x37ca6f=_0xf5ca[_0x4d65d8];return _0x37ca6f;};'use strict';var Sequelize=require(_0xaf5c('0x0'));module['exports']={'state':{'type':Sequelize[_0xaf5c('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xaf5c('0x2')]},'scheduledat':{'type':Sequelize[_0xaf5c('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xaf5c('0x3')]},'responsetime':{'type':Sequelize[_0xaf5c('0x3')]},'ringtime':{'type':Sequelize[_0xaf5c('0x1')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xaf5c('0x2')]},'campaigntype':{'type':Sequelize[_0xaf5c('0x2')]},'membername':{'type':Sequelize[_0xaf5c('0x2')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 275b8ba..0f3c80e 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 _0x80fe=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','report_agent_preview','lodash','util','api'];(function(_0x50fadb,_0x1260c3){var _0x9e0b8b=function(_0x574cf4){while(--_0x574cf4){_0x50fadb['push'](_0x50fadb['shift']());}};_0x9e0b8b(++_0x1260c3);}(_0x80fe,0x185));var _0xe80f=function(_0x37c21f,_0x1f8ff6){_0x37c21f=_0x37c21f-0x0;var _0xebb514=_0x80fe[_0x37c21f];return _0xebb514;};'use strict';var _=require(_0xe80f('0x0'));var util=require(_0xe80f('0x1'));var logger=require('../../config/logger')(_0xe80f('0x2'));var moment=require(_0xe80f('0x3'));var BPromise=require(_0xe80f('0x4'));var rp=require(_0xe80f('0x5'));var fs=require('fs');var path=require(_0xe80f('0x6'));var rimraf=require(_0xe80f('0x7'));var config=require(_0xe80f('0x8'));var attributes=require(_0xe80f('0x9'));module[_0xe80f('0xa')]=function(_0x3f157e,_0x567488){return _0x3f157e[_0xe80f('0xb')](_0xe80f('0xc'),attributes,{'tableName':_0xe80f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xffa4=['request-promise','rimraf','../../config/environment','lodash','util','../../config/logger','moment','bluebird'];(function(_0x187d72,_0xa3a82){var _0x3b3fea=function(_0x45ee56){while(--_0x45ee56){_0x187d72['push'](_0x187d72['shift']());}};_0x3b3fea(++_0xa3a82);}(_0xffa4,0xeb));var _0x4ffa=function(_0x44334a,_0x181bce){_0x44334a=_0x44334a-0x0;var _0x20a140=_0xffa4[_0x44334a];return _0x20a140;};'use strict';var _=require(_0x4ffa('0x0'));var util=require(_0x4ffa('0x1'));var logger=require(_0x4ffa('0x2'))('api');var moment=require(_0x4ffa('0x3'));var BPromise=require(_0x4ffa('0x4'));var rp=require(_0x4ffa('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4ffa('0x6'));var config=require(_0x4ffa('0x7'));var attributes=require('./reportAgentPreview.attributes');module['exports']=function(_0x3ee928,_0x3a9600){return _0x3ee928['define']('ReportAgentPreview',attributes,{'tableName':'report_agent_preview','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 a6258f5..de169ec 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 _0x7e3d=['CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','ReportAgentPreview,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch'];(function(_0x4f9ae8,_0x1e0972){var _0x5cb56e=function(_0x5571b0){while(--_0x5571b0){_0x4f9ae8['push'](_0x4f9ae8['shift']());}};_0x5cb56e(++_0x1e0972);}(_0x7e3d,0xf9));var _0xd7e3=function(_0x3ae3aa,_0x5cbfaa){_0x3ae3aa=_0x3ae3aa-0x0;var _0x2a9dd7=_0x7e3d[_0x3ae3aa];return _0x2a9dd7;};'use strict';var _=require(_0xd7e3('0x0'));var util=require('util');var moment=require(_0xd7e3('0x1'));var BPromise=require(_0xd7e3('0x2'));var rs=require(_0xd7e3('0x3'));var fs=require('fs');var Redis=require(_0xd7e3('0x4'));var db=require(_0xd7e3('0x5'))['db'];var utils=require(_0xd7e3('0x6'));var logger=require(_0xd7e3('0x7'))('rpc');var config=require(_0xd7e3('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd7e3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x449586,_0x284900,_0x15904f){return new BPromise(function(_0x8b65c8,_0x22f575){return client[_0xd7e3('0xa')](_0x449586,_0x15904f)[_0xd7e3('0xb')](function(_0x3c4478){logger[_0xd7e3('0xc')](_0xd7e3('0xd'),_0x284900,'request\x20sent');logger[_0xd7e3('0xe')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x284900,_0xd7e3('0xf'),JSON[_0xd7e3('0x10')](_0x3c4478));if(_0x3c4478[_0xd7e3('0x11')]){if(_0x3c4478['error']['code']===0x1f4){logger[_0xd7e3('0x11')](_0xd7e3('0xd'),_0x284900,_0x3c4478[_0xd7e3('0x11')][_0xd7e3('0x12')]);return _0x22f575(_0x3c4478[_0xd7e3('0x11')]['message']);}logger[_0xd7e3('0x11')](_0xd7e3('0xd'),_0x284900,_0x3c4478['error'][_0xd7e3('0x12')]);return _0x8b65c8(_0x3c4478[_0xd7e3('0x11')][_0xd7e3('0x12')]);}else{logger['info'](_0xd7e3('0xd'),_0x284900,'request\x20sent');_0x8b65c8(_0x3c4478[_0xd7e3('0x13')]['message']);}})[_0xd7e3('0x14')](function(_0x1b02da){logger[_0xd7e3('0x11')]('ReportAgentPreview,\x20%s,\x20%s',_0x284900,_0x1b02da);_0x22f575(_0x1b02da);});});}exports[_0xd7e3('0x15')]=function(_0x537624){var _0xe9cb1f=this;return new Promise(function(_0x21d7c1,_0x188b02){return db[_0xd7e3('0x16')][_0xd7e3('0x17')](_0x537624[_0xd7e3('0x18')],{'raw':_0x537624[_0xd7e3('0x19')]?_0x537624[_0xd7e3('0x19')][_0xd7e3('0x1a')]===undefined?!![]:![]:!![]})[_0xd7e3('0xb')](function(_0x105bed){logger[_0xd7e3('0xc')](_0xd7e3('0x15'),_0x537624);logger[_0xd7e3('0xe')](_0xd7e3('0x15'),_0x537624,JSON[_0xd7e3('0x10')](_0x105bed));_0x21d7c1(_0x105bed);})[_0xd7e3('0x14')](function(_0x3aad9d){logger['error'](_0xd7e3('0x15'),_0x3aad9d['message'],_0x537624);_0x188b02(_0xe9cb1f['error'](0x1f4,_0x3aad9d[_0xd7e3('0x12')]));});});}; \ No newline at end of file +var _0x2304=['raw','then','lodash','util','moment','bluebird','ioredis','../../config/environment','jayson/promise','client','request','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateReportAgentPreview','options'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2304,0xaa));var _0x4230=function(_0xad5bdb,_0x37f85a){_0xad5bdb=_0xad5bdb-0x0;var _0x5bc2da=_0x2304[_0xad5bdb];return _0x5bc2da;};'use strict';var _=require(_0x4230('0x0'));var util=require(_0x4230('0x1'));var moment=require(_0x4230('0x2'));var BPromise=require(_0x4230('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4230('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x4230('0x5'));var jayson=require(_0x4230('0x6'));var client=jayson[_0x4230('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x16eee2,_0x42b58d,_0x58d795){return new BPromise(function(_0xd05fda,_0x3ba813){return client[_0x4230('0x8')](_0x16eee2,_0x58d795)['then'](function(_0x3a4562){logger[_0x4230('0x9')](_0x4230('0xa'),_0x42b58d,_0x4230('0xb'));logger[_0x4230('0xc')](_0x4230('0xd'),_0x42b58d,_0x4230('0xb'),JSON[_0x4230('0xe')](_0x3a4562));if(_0x3a4562[_0x4230('0xf')]){if(_0x3a4562[_0x4230('0xf')][_0x4230('0x10')]===0x1f4){logger[_0x4230('0xf')](_0x4230('0xa'),_0x42b58d,_0x3a4562[_0x4230('0xf')]['message']);return _0x3ba813(_0x3a4562[_0x4230('0xf')][_0x4230('0x11')]);}logger['error'](_0x4230('0xa'),_0x42b58d,_0x3a4562[_0x4230('0xf')][_0x4230('0x11')]);return _0xd05fda(_0x3a4562[_0x4230('0xf')][_0x4230('0x11')]);}else{logger[_0x4230('0x9')]('ReportAgentPreview,\x20%s,\x20%s',_0x42b58d,_0x4230('0xb'));_0xd05fda(_0x3a4562[_0x4230('0x12')][_0x4230('0x11')]);}})[_0x4230('0x13')](function(_0x517a9c){logger['error'](_0x4230('0xa'),_0x42b58d,_0x517a9c);_0x3ba813(_0x517a9c);});});}exports[_0x4230('0x14')]=function(_0x2e8ebe){var _0x150c8f=this;return new Promise(function(_0x5efd10,_0x46a026){return db['ReportAgentPreview']['create'](_0x2e8ebe['body'],{'raw':_0x2e8ebe[_0x4230('0x15')]?_0x2e8ebe[_0x4230('0x15')][_0x4230('0x16')]===undefined?!![]:![]:!![]})[_0x4230('0x17')](function(_0x312d37){logger[_0x4230('0x9')](_0x4230('0x14'),_0x2e8ebe);logger[_0x4230('0xc')](_0x4230('0x14'),_0x2e8ebe,JSON[_0x4230('0xe')](_0x312d37));_0x5efd10(_0x312d37);})['catch'](function(_0x4169cd){logger[_0x4230('0xf')](_0x4230('0x14'),_0x4169cd[_0x4230('0x11')],_0x2e8ebe);_0x46a026(_0x150c8f[_0x4230('0xf')](0x1f4,_0x4169cd[_0x4230('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 68770a7..5dc1b1a 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 _0x9050=['outboundChannels','/agents','agents','put','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/fax/queues/waitinginteractions','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','showFaxQueues','/openchannel/queues/:id/notify','/openchannel/queues/:id','showOpenchannelQueues','sms','/sms/queues/:id','showSmsQueues','/agents/:id/notify','exports','multer','path','express','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','/mail/queues','mailAccounts','/openchannel/queues','/sms/queues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','/outbound','outbound','/outbound/channels'];(function(_0x3ccc27,_0x4a1ff9){var _0x2794b3=function(_0x1116e5){while(--_0x1116e5){_0x3ccc27['push'](_0x3ccc27['shift']());}};_0x2794b3(++_0x4a1ff9);}(_0x9050,0x1ec));var _0x0905=function(_0x499430,_0x3ef884){_0x499430=_0x499430-0x0;var _0x312f01=_0x9050[_0x499430];return _0x312f01;};'use strict';var multer=require(_0x0905('0x0'));var util=require('util');var path=require(_0x0905('0x1'));var express=require(_0x0905('0x2'));var router=express[_0x0905('0x3')]();var auth=require(_0x0905('0x4'));var controller=require(_0x0905('0x5'));router[_0x0905('0x6')](_0x0905('0x7'),auth[_0x0905('0x8')](),controller['voiceChannels']);router[_0x0905('0x6')](_0x0905('0x9'),auth['isAuthenticated'](),controller[_0x0905('0xa')]);router[_0x0905('0x6')](_0x0905('0xb'),auth[_0x0905('0x8')](),controller[_0x0905('0xc')]);router['get'](_0x0905('0xd'),auth[_0x0905('0x8')](),controller[_0x0905('0xe')]);router[_0x0905('0x6')](_0x0905('0xf'),auth[_0x0905('0x8')](),controller['chatQueues']);router[_0x0905('0x6')](_0x0905('0x10'),auth[_0x0905('0x8')](),controller['mailQueues']);router[_0x0905('0x6')]('/mail/accounts',auth[_0x0905('0x8')](),controller[_0x0905('0x11')]);router['get'](_0x0905('0x12'),auth['isAuthenticated'](),controller['openchannelQueues']);router[_0x0905('0x6')](_0x0905('0x13'),auth[_0x0905('0x8')](),controller['smsQueues']);router['get'](_0x0905('0x14'),auth[_0x0905('0x8')](),controller[_0x0905('0x15')]);router[_0x0905('0x6')](_0x0905('0x16'),auth[_0x0905('0x8')](),controller[_0x0905('0x17')]);router[_0x0905('0x6')](_0x0905('0x18'),auth[_0x0905('0x8')](),controller['voiceQueuesChannels']);router['get']('/voice/queues/channels/:uniqueid',auth[_0x0905('0x8')](),controller[_0x0905('0x19')]);router[_0x0905('0x6')](_0x0905('0x1a'),auth[_0x0905('0x8')](),controller['voiceQueuesChannelHangup']);router['get'](_0x0905('0x1b'),auth['isAuthenticated'](),controller[_0x0905('0x1c')]);router[_0x0905('0x6')](_0x0905('0x1d'),auth[_0x0905('0x8')](),controller['showVoiceQueues']);router[_0x0905('0x6')](_0x0905('0x1e'),auth[_0x0905('0x8')](),controller[_0x0905('0x1f')]);router['get'](_0x0905('0x20'),auth['isAuthenticated'](),controller[_0x0905('0x21')]);router[_0x0905('0x6')](_0x0905('0x22'),auth[_0x0905('0x8')](),controller[_0x0905('0x23')]);router[_0x0905('0x24')](_0x0905('0x25'),auth[_0x0905('0x8')](),controller[_0x0905('0x26')]);router[_0x0905('0x6')](_0x0905('0x27'),auth['isAuthenticated'](),controller[_0x0905('0x28')]);router['get'](_0x0905('0x29'),auth[_0x0905('0x8')](),controller[_0x0905('0x2a')]);router['get'](_0x0905('0x2b'),auth['isAuthenticated'](),controller[_0x0905('0x2c')]);router[_0x0905('0x6')](_0x0905('0x2d'),auth[_0x0905('0x8')](),controller[_0x0905('0x2e')]);router['get']('/chat/queues/waitinginteractions',auth[_0x0905('0x8')](),controller[_0x0905('0x2f')]);router[_0x0905('0x6')](_0x0905('0x30'),auth[_0x0905('0x8')](),controller[_0x0905('0x31')]);router[_0x0905('0x6')]('/openchannel/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0x0905('0x32')]);router[_0x0905('0x6')](_0x0905('0x33'),auth[_0x0905('0x8')](),controller[_0x0905('0x34')]);router[_0x0905('0x6')](_0x0905('0x35'),auth['isAuthenticated'](),controller['faxQueuesWaitingInteractions']);router[_0x0905('0x36')](_0x0905('0x37'),auth[_0x0905('0x8')](),controller[_0x0905('0x38')](_0x0905('0x39')));router['get'](_0x0905('0x3a'),auth[_0x0905('0x8')](),controller[_0x0905('0x3b')]);router[_0x0905('0x36')](_0x0905('0x3c'),auth[_0x0905('0x8')](),controller[_0x0905('0x38')](_0x0905('0x3d')));router[_0x0905('0x6')](_0x0905('0x3e'),auth[_0x0905('0x8')](),controller[_0x0905('0x3f')]);router[_0x0905('0x36')](_0x0905('0x40'),auth[_0x0905('0x8')](),controller[_0x0905('0x38')](_0x0905('0x41')));router['get']('/fax/queues/:id',auth[_0x0905('0x8')](),controller[_0x0905('0x42')]);router[_0x0905('0x36')](_0x0905('0x43'),auth[_0x0905('0x8')](),controller['queueNotify']('openchannel'));router['get'](_0x0905('0x44'),auth['isAuthenticated'](),controller[_0x0905('0x45')]);router[_0x0905('0x36')]('/sms/queues/:id/notify',auth[_0x0905('0x8')](),controller[_0x0905('0x38')](_0x0905('0x46')));router['get'](_0x0905('0x47'),auth[_0x0905('0x8')](),controller[_0x0905('0x48')]);router['post'](_0x0905('0x49'),auth[_0x0905('0x8')](),controller['agentNotify']);module[_0x0905('0x4a')]=router; \ No newline at end of file +var _0x2507=['openchannelQueuesWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','mail','/mail/queues/:id','queueNotify','showChatQueues','/fax/queues/:id/notify','fax','showFaxQueues','/openchannel/queues/:id/notify','/openchannel/queues/:id','showOpenchannelQueues','sms','showSmsQueues','/agents/:id/notify','exports','multer','util','path','express','Router','./rpc.controller','/voice/channels','isAuthenticated','voiceChannels','get','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/chat/queues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/sms/queues','smsQueues','/fax/queues','faxQueues','/voice/queues/channels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/outbound','outboundChannels','agents','put','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/openchannel/queues/waitinginteractions'];(function(_0x300e96,_0x329b01){var _0x3a4fe6=function(_0x558e83){while(--_0x558e83){_0x300e96['push'](_0x300e96['shift']());}};_0x3a4fe6(++_0x329b01);}(_0x2507,0xda));var _0x7250=function(_0x505338,_0xf58ad9){_0x505338=_0x505338-0x0;var _0x5c2e50=_0x2507[_0x505338];return _0x5c2e50;};'use strict';var multer=require(_0x7250('0x0'));var util=require(_0x7250('0x1'));var path=require(_0x7250('0x2'));var express=require(_0x7250('0x3'));var router=express[_0x7250('0x4')]();var auth=require('../../components/auth/service');var controller=require(_0x7250('0x5'));router['get'](_0x7250('0x6'),auth[_0x7250('0x7')](),controller[_0x7250('0x8')]);router[_0x7250('0x9')](_0x7250('0xa'),auth[_0x7250('0x7')](),controller[_0x7250('0xb')]);router['get'](_0x7250('0xc'),auth[_0x7250('0x7')](),controller[_0x7250('0xd')]);router[_0x7250('0x9')]('/voice/queues',auth[_0x7250('0x7')](),controller['voiceQueues']);router[_0x7250('0x9')](_0x7250('0xe'),auth[_0x7250('0x7')](),controller['chatQueues']);router[_0x7250('0x9')](_0x7250('0xf'),auth[_0x7250('0x7')](),controller[_0x7250('0x10')]);router[_0x7250('0x9')](_0x7250('0x11'),auth['isAuthenticated'](),controller[_0x7250('0x12')]);router[_0x7250('0x9')]('/openchannel/queues',auth['isAuthenticated'](),controller['openchannelQueues']);router['get'](_0x7250('0x13'),auth[_0x7250('0x7')](),controller[_0x7250('0x14')]);router[_0x7250('0x9')](_0x7250('0x15'),auth[_0x7250('0x7')](),controller[_0x7250('0x16')]);router[_0x7250('0x9')]('/voice/queues/preview/:id',auth[_0x7250('0x7')](),controller['voiceQueuesPreview']);router[_0x7250('0x9')](_0x7250('0x17'),auth[_0x7250('0x7')](),controller['voiceQueuesChannels']);router[_0x7250('0x9')](_0x7250('0x18'),auth[_0x7250('0x7')](),controller[_0x7250('0x19')]);router[_0x7250('0x9')](_0x7250('0x1a'),auth['isAuthenticated'](),controller['voiceQueuesChannelHangup']);router[_0x7250('0x9')](_0x7250('0x1b'),auth[_0x7250('0x7')](),controller[_0x7250('0x1c')]);router['get']('/voice/queues/:id',auth['isAuthenticated'](),controller['showVoiceQueues']);router[_0x7250('0x9')](_0x7250('0x1d'),auth['isAuthenticated'](),controller['outbound']);router['get']('/outbound/channels',auth[_0x7250('0x7')](),controller[_0x7250('0x1e')]);router[_0x7250('0x9')]('/agents',auth[_0x7250('0x7')](),controller[_0x7250('0x1f')]);router[_0x7250('0x20')](_0x7250('0x21'),auth[_0x7250('0x7')](),controller[_0x7250('0x22')]);router[_0x7250('0x9')](_0x7250('0x23'),auth[_0x7250('0x7')](),controller[_0x7250('0x24')]);router[_0x7250('0x9')](_0x7250('0x25'),auth[_0x7250('0x7')](),controller[_0x7250('0x26')]);router[_0x7250('0x9')](_0x7250('0x27'),auth[_0x7250('0x7')](),controller[_0x7250('0x28')]);router[_0x7250('0x9')](_0x7250('0x29'),auth['isAuthenticated'](),controller[_0x7250('0x2a')]);router[_0x7250('0x9')](_0x7250('0x2b'),auth['isAuthenticated'](),controller[_0x7250('0x2c')]);router[_0x7250('0x9')]('/mail/queues/waitinginteractions',auth[_0x7250('0x7')](),controller['mailQueuesWaitingInteractions']);router[_0x7250('0x9')](_0x7250('0x2d'),auth[_0x7250('0x7')](),controller[_0x7250('0x2e')]);router['get'](_0x7250('0x2f'),auth[_0x7250('0x7')](),controller[_0x7250('0x30')]);router['get']('/fax/queues/waitinginteractions',auth[_0x7250('0x7')](),controller[_0x7250('0x31')]);router[_0x7250('0x32')](_0x7250('0x33'),auth['isAuthenticated'](),controller['queueNotify'](_0x7250('0x34')));router[_0x7250('0x9')](_0x7250('0x35'),auth[_0x7250('0x7')](),controller['showMailQueues']);router[_0x7250('0x32')]('/chat/queues/:id/notify',auth['isAuthenticated'](),controller[_0x7250('0x36')]('chat'));router[_0x7250('0x9')]('/chat/queues/:id',auth['isAuthenticated'](),controller[_0x7250('0x37')]);router[_0x7250('0x32')](_0x7250('0x38'),auth[_0x7250('0x7')](),controller[_0x7250('0x36')](_0x7250('0x39')));router[_0x7250('0x9')]('/fax/queues/:id',auth[_0x7250('0x7')](),controller[_0x7250('0x3a')]);router[_0x7250('0x32')](_0x7250('0x3b'),auth[_0x7250('0x7')](),controller[_0x7250('0x36')]('openchannel'));router[_0x7250('0x9')](_0x7250('0x3c'),auth[_0x7250('0x7')](),controller[_0x7250('0x3d')]);router['post']('/sms/queues/:id/notify',auth[_0x7250('0x7')](),controller['queueNotify'](_0x7250('0x3e')));router[_0x7250('0x9')]('/sms/queues/:id',auth[_0x7250('0x7')](),controller[_0x7250('0x3f')]);router['post'](_0x7250('0x40'),auth[_0x7250('0x7')](),controller['agentNotify']);module[_0x7250('0x41')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 04e831a..99d1c0c 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 _0xebf6=['length','format','YYYY-MM-DD\x20HH:mm:ss','interface','agent','internal','AgentCapacity','capacity','telephones','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','showChatQueues','mailQueues','mailAccounts','MailAccounts','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','faxQueues','FaxQueues','faxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','SmsQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','Message','Interaction','\x20Message\x20not\x20found','update','queue','MessageId','InteractionId','From','QueueId','TransferReport','create','Start','queueTransferTimeout','agentNotify','channel','Channel\x20field\x20is\x20mandatory','User','Agent\x20not\x20found','agentTransferTimeout','*,*,*,*','bluebird','moment','lodash','../../config/logger','api','jayson/promise','http','client','then','error','code','message','result','status','json','sendStatus','stack','name','send','isNil','find','rows','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','params','catch','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','voiceQueuesPreview','merge','voiceQueuesChannels','VoiceQueuesChannels','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','Outbound','outboundChannels','OutboundChannels','Agents','agentCapacity','user','body','interaction','hasOwnProperty','MemberReport','findAll','INTERACTION'];(function(_0x1854ba,_0x33a502){var _0x284de4=function(_0x1a5297){while(--_0x1a5297){_0x1854ba['push'](_0x1854ba['shift']());}};_0x284de4(++_0x33a502);}(_0xebf6,0xaf));var _0x6ebf=function(_0x1ae1fb,_0x81c2ec){_0x1ae1fb=_0x1ae1fb-0x0;var _0x57166=_0xebf6[_0x1ae1fb];return _0x57166;};'use strict';var BPromise=require(_0x6ebf('0x0'));var moment=require(_0x6ebf('0x1'));var _=require(_0x6ebf('0x2'));var util=require('util');var db=require('../../mysqldb')['db'];var logger=require(_0x6ebf('0x3'))(_0x6ebf('0x4'));var jayson=require(_0x6ebf('0x5'));var amiClient=jayson['client'][_0x6ebf('0x6')]({'port':0x232a});var mailClient=jayson[_0x6ebf('0x7')]['http']({'port':0x232b});var routingClient=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x1264e9,_0x124734,_0xc13910){return new BPromise(function(_0x3365f9,_0x16757b){var _0x3b4c6d=_0xc13910?_0xc13910:amiClient;return _0x3b4c6d['request'](_0x1264e9,_0x124734)[_0x6ebf('0x8')](function(_0x4aba11){if(_0x4aba11[_0x6ebf('0x9')]){if(_0x4aba11['error'][_0x6ebf('0xa')]===0x1f4){return _0x16757b(_0x4aba11['error'][_0x6ebf('0xb')]);}return _0x3365f9(_0x4aba11[_0x6ebf('0x9')][_0x6ebf('0xb')]);}else{_0x3365f9(_0x4aba11[_0x6ebf('0xc')]);}})['catch'](function(_0x4f03ef){_0x16757b(_0x4f03ef);});});}function respondWithResult(_0x24a1b6,_0x3c9d95){_0x3c9d95=_0x3c9d95||0xc8;return function(_0x2684cc){if(_0x2684cc){return _0x24a1b6[_0x6ebf('0xd')](_0x3c9d95)[_0x6ebf('0xe')](_0x2684cc);}return _0x24a1b6[_0x6ebf('0xf')](0x194);};}function handleError(_0x83a493,_0x355de1){_0x355de1=_0x355de1||0x1f4;return function(_0x1c09e){logger[_0x6ebf('0x9')](_0x1c09e[_0x6ebf('0x10')]);if(_0x1c09e[_0x6ebf('0x11')]){delete _0x1c09e[_0x6ebf('0x11')];}_0x83a493['status'](_0x355de1)[_0x6ebf('0x12')](_0x1c09e);};}function findById(_0xe876ca){return function(_0x3cbc7b){if(!_[_0x6ebf('0x13')](_0xe876ca)&&!_[_0x6ebf('0x13')](_0x3cbc7b)&&!_[_0x6ebf('0x13')](_0x3cbc7b['rows'])){return _[_0x6ebf('0x14')](_0x3cbc7b[_0x6ebf('0x15')],function(_0x1fc924){return _0x1fc924['id']==_0xe876ca;});}return null;};}exports['voiceChannels']=function(_0x385cf9,_0x30c26a){return respondWithRpcPromise(_0x6ebf('0x16'),_0x385cf9[_0x6ebf('0x17')])[_0x6ebf('0x8')](respondWithResult(_0x30c26a,null))['catch'](handleError(_0x30c26a,null));};exports[_0x6ebf('0x18')]=function(_0xa8d9f1,_0x101ac0){return respondWithRpcPromise(_0x6ebf('0x19'),_['merge'](_0xa8d9f1['query'],_0xa8d9f1[_0x6ebf('0x1a')]))['then'](respondWithResult(_0x101ac0,null))[_0x6ebf('0x1b')](handleError(_0x101ac0,null));};exports['voiceChannelStopMixMonitor']=function(_0x3d75c5,_0x4da1ba){return respondWithRpcPromise(_0x6ebf('0x1c'),_['merge'](_0x3d75c5[_0x6ebf('0x17')],_0x3d75c5[_0x6ebf('0x1a')]))[_0x6ebf('0x8')](respondWithResult(_0x4da1ba,null))[_0x6ebf('0x1b')](handleError(_0x4da1ba,null));};exports[_0x6ebf('0x1d')]=function(_0x1113aa,_0x3018a1){return respondWithRpcPromise(_0x6ebf('0x1e'),_0x1113aa['query'])[_0x6ebf('0x8')](respondWithResult(_0x3018a1,null))[_0x6ebf('0x1b')](handleError(_0x3018a1,null));};exports[_0x6ebf('0x1f')]=function(_0x1c5113,_0x429849){return respondWithRpcPromise('VoiceQueues',_0x1c5113[_0x6ebf('0x17')])[_0x6ebf('0x8')](findById(_0x1c5113[_0x6ebf('0x1a')]['id']))[_0x6ebf('0x8')](respondWithResult(_0x429849,null))[_0x6ebf('0x1b')](handleError(_0x429849,null));};exports[_0x6ebf('0x20')]=function(_0x5a6b44,_0x1f574a){return respondWithRpcPromise('VoiceQueuesPreview',_[_0x6ebf('0x21')](_0x5a6b44[_0x6ebf('0x17')],_0x5a6b44[_0x6ebf('0x1a')]))[_0x6ebf('0x8')](respondWithResult(_0x1f574a,null))['catch'](handleError(_0x1f574a,null));};exports[_0x6ebf('0x22')]=function(_0x61dd12,_0x1ded1e){return respondWithRpcPromise(_0x6ebf('0x23'),_0x61dd12[_0x6ebf('0x17')])[_0x6ebf('0x8')](respondWithResult(_0x1ded1e,null))['catch'](handleError(_0x1ded1e,null));};exports['voiceQueuesChannel']=function(_0x2cb810,_0x115d07){return respondWithRpcPromise(_0x6ebf('0x24'),_[_0x6ebf('0x21')](_0x2cb810[_0x6ebf('0x17')],_0x2cb810[_0x6ebf('0x1a')]))['then'](respondWithResult(_0x115d07,null))[_0x6ebf('0x1b')](handleError(_0x115d07,null));};exports[_0x6ebf('0x25')]=function(_0x19c867,_0x3a40eb){return respondWithRpcPromise(_0x6ebf('0x26'),_['merge'](_0x19c867[_0x6ebf('0x17')],_0x19c867[_0x6ebf('0x1a')]))[_0x6ebf('0x8')](respondWithResult(_0x3a40eb,null))[_0x6ebf('0x1b')](handleError(_0x3a40eb,null));};exports['voiceQueuesChannelRedirect']=function(_0x744eaa,_0x596623){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0x6ebf('0x21')](_0x744eaa['query'],_0x744eaa[_0x6ebf('0x1a')]))[_0x6ebf('0x8')](respondWithResult(_0x596623,null))['catch'](handleError(_0x596623,null));};exports['outbound']=function(_0x2395da,_0x268df0){return respondWithRpcPromise(_0x6ebf('0x27'),_0x2395da[_0x6ebf('0x17')])[_0x6ebf('0x8')](respondWithResult(_0x268df0,null))[_0x6ebf('0x1b')](handleError(_0x268df0,null));};exports[_0x6ebf('0x28')]=function(_0x51e25d,_0x338b07){return respondWithRpcPromise(_0x6ebf('0x29'),_0x51e25d[_0x6ebf('0x17')])[_0x6ebf('0x8')](respondWithResult(_0x338b07,null))[_0x6ebf('0x1b')](handleError(_0x338b07,null));};exports['agents']=function(_0x6eeff0,_0x2c8228){var _0xaa877a;return respondWithRpcPromise(_0x6ebf('0x2a'),_0x6eeff0[_0x6ebf('0x17')])['then'](function(_0x1ce09e){_0xaa877a=_0x1ce09e;return respondWithRpcPromise(_0x6ebf('0x2a'),_0x6eeff0[_0x6ebf('0x17')],routingClient);})[_0x6ebf('0x8')](function(_0x38186d){return _[_0x6ebf('0x21')]({},_0x38186d,_0xaa877a);})[_0x6ebf('0x8')](respondWithResult(_0x2c8228,null))[_0x6ebf('0x1b')](handleError(_0x2c8228,null));};exports[_0x6ebf('0x2b')]=function(_0x24154d,_0xaf18f5){if(_0x24154d['body']&&_0x24154d['body']['interaction']&&_0x24154d[_0x6ebf('0x2c')]&&_0x24154d['user'][_0x6ebf('0x11')]){for(var _0x3f1f14 in _0x24154d[_0x6ebf('0x2d')][_0x6ebf('0x2e')]){if(_0x24154d['body'][_0x6ebf('0x2e')][_0x6ebf('0x2f')](_0x3f1f14)){db[_0x6ebf('0x30')][_0x6ebf('0x31')]({'where':{'channel':_0x3f1f14,'membername':_0x24154d['user'][_0x6ebf('0x11')],'type':_0x6ebf('0x32'),'exitAt':null,'uniqueid':_0x24154d[_0x6ebf('0x2d')][_0x6ebf('0x2e')][_0x3f1f14]&&_0x24154d[_0x6ebf('0x2d')]['interaction'][_0x3f1f14][_0x6ebf('0x33')]?{'$notIn':_0x24154d['body'][_0x6ebf('0x2e')][_0x3f1f14]}:{'$ne':null}}})[_0x6ebf('0x8')](function(_0x4a33d5){var _0x27f6da=moment()[_0x6ebf('0x34')](_0x6ebf('0x35'));for(var _0x9e07d3=0x0,_0x48c6eb=_0x4a33d5[_0x6ebf('0x33')];_0x9e07d3<_0x48c6eb;_0x9e07d3+=0x1){_0x4a33d5[_0x9e07d3]['updateAttributes']({'exitAt':_0x27f6da});}});for(var _0x1229f3=0x0;_0x1229f3<_0x24154d[_0x6ebf('0x2d')][_0x6ebf('0x2e')][_0x3f1f14][_0x6ebf('0x33')];_0x1229f3+=0x1){db[_0x6ebf('0x30')]['findOrCreate']({'where':{'channel':_0x3f1f14,'membername':_0x24154d[_0x6ebf('0x2c')][_0x6ebf('0x11')],'type':'INTERACTION','uniqueid':_0x24154d['body'][_0x6ebf('0x2e')][_0x3f1f14][_0x1229f3],'exitAt':null},'defaults':{'channel':_0x3f1f14,'membername':_0x24154d[_0x6ebf('0x2c')][_0x6ebf('0x11')],'interface':_[_0x6ebf('0x13')](_0x24154d[_0x6ebf('0x2c')]['interface'])?util[_0x6ebf('0x34')]('SIP/%s',_0x24154d[_0x6ebf('0x2c')][_0x6ebf('0x11')]):_0x24154d['user'][_0x6ebf('0x36')],'type':_0x6ebf('0x32'),'enterAt':moment()[_0x6ebf('0x34')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x6ebf('0x37'),'internal':_0x24154d[_0x6ebf('0x2c')][_0x6ebf('0x38')],'uniqueid':_0x24154d[_0x6ebf('0x2d')][_0x6ebf('0x2e')][_0x3f1f14][_0x1229f3]}});}}}}return respondWithRpcPromise(_0x6ebf('0x39'),{'id':_0x24154d[_0x6ebf('0x1a')]['id'],'capacity':_0x24154d[_0x6ebf('0x2d')][_0x6ebf('0x3a')]},routingClient)[_0x6ebf('0x8')](respondWithResult(_0xaf18f5,null))['catch'](handleError(_0xaf18f5,null));};exports[_0x6ebf('0x3b')]=function(_0x4d0bec,_0x12772a){return respondWithRpcPromise(_0x6ebf('0x3c'),_0x4d0bec[_0x6ebf('0x17')])[_0x6ebf('0x8')](respondWithResult(_0x12772a,null))['catch'](handleError(_0x12772a,null));};exports[_0x6ebf('0x3d')]=function(_0x432fb0,_0x25c626){return respondWithRpcPromise(_0x6ebf('0x3e'),_0x432fb0[_0x6ebf('0x17')])[_0x6ebf('0x8')](respondWithResult(_0x25c626,null))[_0x6ebf('0x1b')](handleError(_0x25c626,null));};exports[_0x6ebf('0x3f')]=function(_0x2ae7dd,_0x280487){return respondWithRpcPromise(_0x6ebf('0x40'),_0x2ae7dd['query'])[_0x6ebf('0x8')](respondWithResult(_0x280487,null))[_0x6ebf('0x1b')](handleError(_0x280487,null));};exports[_0x6ebf('0x41')]=function(_0x3b5e2b,_0x369b58){return respondWithRpcPromise('ChatQueues',_0x3b5e2b['query'],routingClient)[_0x6ebf('0x8')](respondWithResult(_0x369b58,null))[_0x6ebf('0x1b')](handleError(_0x369b58,null));};exports[_0x6ebf('0x42')]=function(_0x40a2de,_0x49b5cf){return respondWithRpcPromise('ChatQueues',_0x40a2de[_0x6ebf('0x17')],routingClient)[_0x6ebf('0x8')](findById(_0x40a2de['params']['id']))[_0x6ebf('0x8')](respondWithResult(_0x49b5cf,null))[_0x6ebf('0x1b')](handleError(_0x49b5cf,null));};exports[_0x6ebf('0x43')]=function(_0x224239,_0x5033fb){return respondWithRpcPromise('MailQueues',_0x224239[_0x6ebf('0x17')],routingClient)['then'](respondWithResult(_0x5033fb,null))[_0x6ebf('0x1b')](handleError(_0x5033fb,null));};exports['showMailQueues']=function(_0x29e0ba,_0x48e6f8){return respondWithRpcPromise('MailQueues',_0x29e0ba[_0x6ebf('0x17')],routingClient)[_0x6ebf('0x8')](findById(_0x29e0ba[_0x6ebf('0x1a')]['id']))[_0x6ebf('0x8')](respondWithResult(_0x48e6f8,null))[_0x6ebf('0x1b')](handleError(_0x48e6f8,null));};exports[_0x6ebf('0x44')]=function(_0x1de6ae,_0x4d9739){return respondWithRpcPromise(_0x6ebf('0x45'),_0x1de6ae[_0x6ebf('0x17')],mailClient)[_0x6ebf('0x8')](respondWithResult(_0x4d9739,null))[_0x6ebf('0x1b')](handleError(_0x4d9739,null));};exports['openchannelQueues']=function(_0x3fa7e5,_0x29a0f9){return respondWithRpcPromise(_0x6ebf('0x46'),_0x3fa7e5[_0x6ebf('0x17')],routingClient)[_0x6ebf('0x8')](respondWithResult(_0x29a0f9,null))[_0x6ebf('0x1b')](handleError(_0x29a0f9,null));};exports[_0x6ebf('0x47')]=function(_0x10af99,_0x1050aa){return respondWithRpcPromise(_0x6ebf('0x46'),_0x10af99[_0x6ebf('0x17')],routingClient)[_0x6ebf('0x8')](findById(_0x10af99[_0x6ebf('0x1a')]['id']))[_0x6ebf('0x8')](respondWithResult(_0x1050aa,null))[_0x6ebf('0x1b')](handleError(_0x1050aa,null));};exports[_0x6ebf('0x48')]=function(_0x3f5707,_0x4663f3){return respondWithRpcPromise(_0x6ebf('0x49'),_0x3f5707[_0x6ebf('0x17')],routingClient)['then'](respondWithResult(_0x4663f3,null))[_0x6ebf('0x1b')](handleError(_0x4663f3,null));};exports[_0x6ebf('0x4a')]=function(_0x1bb395,_0x5e0e37){return respondWithRpcPromise('SmsQueues',_0x1bb395[_0x6ebf('0x17')],routingClient)[_0x6ebf('0x8')](findById(_0x1bb395[_0x6ebf('0x1a')]['id']))['then'](respondWithResult(_0x5e0e37,null))['catch'](handleError(_0x5e0e37,null));};exports[_0x6ebf('0x4b')]=function(_0x5e525a,_0xfb65aa){return respondWithRpcPromise(_0x6ebf('0x4c'),_0x5e525a[_0x6ebf('0x17')],routingClient)['then'](respondWithResult(_0xfb65aa,null))[_0x6ebf('0x1b')](handleError(_0xfb65aa,null));};exports['showFaxQueues']=function(_0x3f07e2,_0x5ceb70){return respondWithRpcPromise('FaxQueues',_0x3f07e2['query'],routingClient)[_0x6ebf('0x8')](findById(_0x3f07e2[_0x6ebf('0x1a')]['id']))[_0x6ebf('0x8')](respondWithResult(_0x5ceb70,null))[_0x6ebf('0x1b')](handleError(_0x5ceb70,null));};exports[_0x6ebf('0x4d')]=function(_0x3cdae9,_0x30500e){return respondWithRpcPromise('FaxAccounts',_0x3cdae9['query'])[_0x6ebf('0x8')](respondWithResult(_0x30500e,null))[_0x6ebf('0x1b')](handleError(_0x30500e,null));};exports[_0x6ebf('0x4e')]=function(_0xd1133b,_0x243b57){return respondWithRpcPromise(_0x6ebf('0x4f'),_0xd1133b[_0x6ebf('0x17')],routingClient)['then'](respondWithResult(_0x243b57,null))[_0x6ebf('0x1b')](handleError(_0x243b57,null));};exports['mailQueuesWaitingInteractions']=function(_0x2c8c17,_0x314bf1){return respondWithRpcPromise(_0x6ebf('0x50'),_0x2c8c17[_0x6ebf('0x17')],routingClient)[_0x6ebf('0x8')](respondWithResult(_0x314bf1,null))['catch'](handleError(_0x314bf1,null));};exports[_0x6ebf('0x51')]=function(_0x46c620,_0x5aeaee){return respondWithRpcPromise(_0x6ebf('0x52'),_0x46c620[_0x6ebf('0x17')],routingClient)['then'](respondWithResult(_0x5aeaee,null))[_0x6ebf('0x1b')](handleError(_0x5aeaee,null));};exports['smsQueuesWaitingInteractions']=function(_0x2ab123,_0x284da2){return respondWithRpcPromise(_0x6ebf('0x53'),_0x2ab123['query'],routingClient)[_0x6ebf('0x8')](respondWithResult(_0x284da2,null))['catch'](handleError(_0x284da2,null));};exports['faxQueuesWaitingInteractions']=function(_0x43b3be,_0x1fb19d){return respondWithRpcPromise(_0x6ebf('0x54'),_0x43b3be['query'],routingClient)[_0x6ebf('0x8')](respondWithResult(_0x1fb19d,null))['catch'](handleError(_0x1fb19d,null));};exports[_0x6ebf('0x55')]=function(_0x5da3b8){return function(_0x179fe6,_0x2e32d3){var _0x15f3ee,_0x232f27;var _0x2c99a1=_[_0x6ebf('0x56')](_0x5da3b8);var _0x12ecb9=_0x5da3b8===_0x6ebf('0x57')?_0x6ebf('0x58'):_0x6ebf('0x59');return db[_0x2c99a1+_0x6ebf('0x5a')][_0x6ebf('0x5b')]({'raw':!![],'where':{'id':_0x179fe6[_0x6ebf('0x1a')]['id']}})[_0x6ebf('0x8')](function(_0x4b5ecf){if(_[_0x6ebf('0x13')](_0x4b5ecf)){throw new Error(_0x2c99a1+_0x6ebf('0x5c'));}_0x15f3ee=_0x4b5ecf;return db[_0x2c99a1+_0x6ebf('0x5d')]['findOne']({'where':{'id':_0x179fe6[_0x6ebf('0x2d')]['messageId']},'include':[{'model':db[_0x2c99a1+_0x6ebf('0x5e')],'as':_0x6ebf('0x5e')},{'model':db[_0x2c99a1+_0x12ecb9],'as':'Account'}]});})[_0x6ebf('0x8')](function(_0x27317b){if(_[_0x6ebf('0x13')](_0x27317b)){throw new Error(_0x2c99a1+_0x6ebf('0x5f'));}_0x232f27=_0x27317b;return _0x27317b[_0x6ebf('0x60')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x44da47={'uniqueid':_0x5da3b8+'.'+_0x232f27['id']+'.'+_0x232f27[_0x6ebf('0x5e')]['id'],'FromUserId':_0x179fe6['user']['id'],'type':_0x6ebf('0x61')};_0x44da47[_0x2c99a1+_0x6ebf('0x62')]=_0x232f27['id'];_0x44da47[_0x2c99a1+_0x6ebf('0x63')]=_0x232f27[_0x6ebf('0x5e')]['id'];_0x44da47[_0x6ebf('0x64')+_0x2c99a1+_0x12ecb9+'Id']=_0x232f27[_0x6ebf('0x59')]['id'];_0x44da47['To'+_0x2c99a1+_0x6ebf('0x65')]=_0x15f3ee['id'];return db[_0x2c99a1+_0x6ebf('0x66')][_0x6ebf('0x67')](_0x44da47);})[_0x6ebf('0x8')](function(){return respondWithRpcPromise(_0x6ebf('0x68'),{'channel':_0x5da3b8,'interaction':_0x232f27[_0x6ebf('0x5e')],'message':_0x232f27,'account':_0x232f27[_0x6ebf('0x59')],'applications':[{'id':0x0,'priority':0x1,'app':_0x6ebf('0x61'),'appdata':_0x15f3ee[_0x6ebf('0x11')]+','+(_0x232f27[_0x6ebf('0x59')][_0x6ebf('0x69')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x6ebf('0x8')](respondWithResult(_0x2e32d3,null))['catch'](handleError(_0x2e32d3,null));};};exports[_0x6ebf('0x6a')]=function(_0x59a4ca,_0x18568f){var _0x2de79d,_0x41d920;if(_['isNil'](_0x59a4ca[_0x6ebf('0x2d')][_0x6ebf('0x6b')])){throw new Error(_0x6ebf('0x6c'));}var _0x395d1e=_0x59a4ca[_0x6ebf('0x2d')][_0x6ebf('0x6b')];var _0x10966c=_[_0x6ebf('0x56')](_0x395d1e);var _0x25b36b=_0x395d1e===_0x6ebf('0x57')?_0x6ebf('0x58'):_0x6ebf('0x59');return db[_0x6ebf('0x6d')][_0x6ebf('0x5b')]({'raw':!![],'where':{'id':_0x59a4ca[_0x6ebf('0x1a')]['id'],'role':_0x6ebf('0x37')}})[_0x6ebf('0x8')](function(_0x145fec){if(_[_0x6ebf('0x13')](_0x145fec)){throw new Error(_0x6ebf('0x6e'));}_0x2de79d=_0x145fec;return db[_0x10966c+_0x6ebf('0x5d')][_0x6ebf('0x5b')]({'where':{'id':_0x59a4ca['body']['messageId']},'include':[{'model':db[_0x10966c+_0x6ebf('0x5e')],'as':_0x6ebf('0x5e')},{'model':db[_0x10966c+_0x25b36b],'as':_0x6ebf('0x59')}]});})['then'](function(_0x4f2b3c){if(_[_0x6ebf('0x13')](_0x4f2b3c)){throw new Error(_0x10966c+_0x6ebf('0x5f'));}_0x41d920=_0x4f2b3c;return _0x4f2b3c[_0x6ebf('0x60')]({'read':0x0,'readAt':null,'UserId':null});})[_0x6ebf('0x8')](function(){var _0x919b50={'uniqueid':_0x395d1e+'.'+_0x41d920['id']+'.'+_0x41d920[_0x6ebf('0x5e')]['id'],'FromUserId':_0x59a4ca[_0x6ebf('0x2c')]['id'],'type':_0x6ebf('0x61'),'ToUserId':_0x2de79d['id']};_0x919b50[_0x10966c+_0x6ebf('0x62')]=_0x41d920['id'];_0x919b50[_0x10966c+_0x6ebf('0x63')]=_0x41d920[_0x6ebf('0x5e')]['id'];_0x919b50[_0x6ebf('0x64')+_0x10966c+_0x25b36b+'Id']=_0x41d920[_0x6ebf('0x59')]['id'];return db[_0x10966c+_0x6ebf('0x66')][_0x6ebf('0x67')](_0x919b50);})['then'](function(){return respondWithRpcPromise(_0x6ebf('0x68'),{'channel':_0x395d1e,'interaction':_0x41d920[_0x6ebf('0x5e')],'message':_0x41d920,'account':_0x41d920['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0x6ebf('0x37'),'appdata':_0x2de79d[_0x6ebf('0x11')]+','+(_0x41d920[_0x6ebf('0x59')][_0x6ebf('0x6f')]||0x12c),'interval':_0x6ebf('0x70')}]},routingClient);})['then'](respondWithResult(_0x18568f,null))['catch'](handleError(_0x18568f,null));}; \ No newline at end of file +var _0xd1ce=['Interaction','\x20Message\x20not\x20found','update','queue','InteractionId','From','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','channel','Website','User','Agent\x20not\x20found','agentTransferTimeout','bluebird','lodash','util','../../mysqldb','../../config/logger','jayson/promise','http','client','then','error','code','message','result','catch','status','json','stack','name','send','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','VoiceQueues','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','agents','Agents','agentCapacity','body','user','interaction','hasOwnProperty','MemberReport','findAll','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','interface','SIP/%s','agent','internal','AgentCapacity','telephones','Telephones','trunks','Trunks','campaigns','Campaigns','ChatQueues','showChatQueues','mailQueues','showMailQueues','MailQueues','mailAccounts','MailAccounts','openchannelQueues','showOpenchannelQueues','OpenchannelQueues','SmsQueues','faxQueues','showFaxQueues','FaxQueues','faxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Account','Queue','findOne','Message','messageId'];(function(_0xfbfcfd,_0x3cc8c5){var _0x1971a5=function(_0x16b3b8){while(--_0x16b3b8){_0xfbfcfd['push'](_0xfbfcfd['shift']());}};_0x1971a5(++_0x3cc8c5);}(_0xd1ce,0x173));var _0xed1c=function(_0x440a33,_0x318025){_0x440a33=_0x440a33-0x0;var _0x40f493=_0xd1ce[_0x440a33];return _0x40f493;};'use strict';var BPromise=require(_0xed1c('0x0'));var moment=require('moment');var _=require(_0xed1c('0x1'));var util=require(_0xed1c('0x2'));var db=require(_0xed1c('0x3'))['db'];var logger=require(_0xed1c('0x4'))('api');var jayson=require(_0xed1c('0x5'));var amiClient=jayson['client'][_0xed1c('0x6')]({'port':0x232a});var mailClient=jayson[_0xed1c('0x7')]['http']({'port':0x232b});var routingClient=jayson[_0xed1c('0x7')][_0xed1c('0x6')]({'port':0x232c});function respondWithRpcPromise(_0x4d5f9c,_0x44edc8,_0xef01a9){return new BPromise(function(_0x4965a0,_0x5be734){var _0x577f65=_0xef01a9?_0xef01a9:amiClient;return _0x577f65['request'](_0x4d5f9c,_0x44edc8)[_0xed1c('0x8')](function(_0x58c370){if(_0x58c370[_0xed1c('0x9')]){if(_0x58c370[_0xed1c('0x9')][_0xed1c('0xa')]===0x1f4){return _0x5be734(_0x58c370[_0xed1c('0x9')]['message']);}return _0x4965a0(_0x58c370[_0xed1c('0x9')][_0xed1c('0xb')]);}else{_0x4965a0(_0x58c370[_0xed1c('0xc')]);}})[_0xed1c('0xd')](function(_0x184d9d){_0x5be734(_0x184d9d);});});}function respondWithResult(_0xd6273,_0x5456c1){_0x5456c1=_0x5456c1||0xc8;return function(_0xf5afa6){if(_0xf5afa6){return _0xd6273[_0xed1c('0xe')](_0x5456c1)[_0xed1c('0xf')](_0xf5afa6);}return _0xd6273['sendStatus'](0x194);};}function handleError(_0x3b0085,_0x27c7c3){_0x27c7c3=_0x27c7c3||0x1f4;return function(_0x2da01c){logger[_0xed1c('0x9')](_0x2da01c[_0xed1c('0x10')]);if(_0x2da01c[_0xed1c('0x11')]){delete _0x2da01c['name'];}_0x3b0085[_0xed1c('0xe')](_0x27c7c3)[_0xed1c('0x12')](_0x2da01c);};}function findById(_0x4403a3){return function(_0x2b708d){if(!_[_0xed1c('0x13')](_0x4403a3)&&!_['isNil'](_0x2b708d)&&!_[_0xed1c('0x13')](_0x2b708d[_0xed1c('0x14')])){return _[_0xed1c('0x15')](_0x2b708d[_0xed1c('0x14')],function(_0x35f316){return _0x35f316['id']==_0x4403a3;});}return null;};}exports[_0xed1c('0x16')]=function(_0x52ae80,_0x2c56fe){return respondWithRpcPromise(_0xed1c('0x17'),_0x52ae80[_0xed1c('0x18')])[_0xed1c('0x8')](respondWithResult(_0x2c56fe,null))[_0xed1c('0xd')](handleError(_0x2c56fe,null));};exports[_0xed1c('0x19')]=function(_0x1e3b22,_0x3d867d){return respondWithRpcPromise(_0xed1c('0x1a'),_[_0xed1c('0x1b')](_0x1e3b22['query'],_0x1e3b22[_0xed1c('0x1c')]))['then'](respondWithResult(_0x3d867d,null))[_0xed1c('0xd')](handleError(_0x3d867d,null));};exports[_0xed1c('0x1d')]=function(_0x1230c2,_0x50f76f){return respondWithRpcPromise(_0xed1c('0x1e'),_[_0xed1c('0x1b')](_0x1230c2['query'],_0x1230c2[_0xed1c('0x1c')]))[_0xed1c('0x8')](respondWithResult(_0x50f76f,null))[_0xed1c('0xd')](handleError(_0x50f76f,null));};exports['voiceQueues']=function(_0x554cd2,_0x7ff47){return respondWithRpcPromise(_0xed1c('0x1f'),_0x554cd2[_0xed1c('0x18')])[_0xed1c('0x8')](respondWithResult(_0x7ff47,null))[_0xed1c('0xd')](handleError(_0x7ff47,null));};exports['showVoiceQueues']=function(_0x231c3a,_0x182aae){return respondWithRpcPromise(_0xed1c('0x1f'),_0x231c3a[_0xed1c('0x18')])[_0xed1c('0x8')](findById(_0x231c3a[_0xed1c('0x1c')]['id']))[_0xed1c('0x8')](respondWithResult(_0x182aae,null))[_0xed1c('0xd')](handleError(_0x182aae,null));};exports[_0xed1c('0x20')]=function(_0x3579d5,_0x3f4362){return respondWithRpcPromise(_0xed1c('0x21'),_[_0xed1c('0x1b')](_0x3579d5[_0xed1c('0x18')],_0x3579d5[_0xed1c('0x1c')]))[_0xed1c('0x8')](respondWithResult(_0x3f4362,null))[_0xed1c('0xd')](handleError(_0x3f4362,null));};exports[_0xed1c('0x22')]=function(_0x51d2fb,_0xb53865){return respondWithRpcPromise(_0xed1c('0x23'),_0x51d2fb['query'])[_0xed1c('0x8')](respondWithResult(_0xb53865,null))['catch'](handleError(_0xb53865,null));};exports[_0xed1c('0x24')]=function(_0x1ada65,_0x3cd29f){return respondWithRpcPromise('VoiceQueuesChannel',_[_0xed1c('0x1b')](_0x1ada65['query'],_0x1ada65[_0xed1c('0x1c')]))[_0xed1c('0x8')](respondWithResult(_0x3cd29f,null))[_0xed1c('0xd')](handleError(_0x3cd29f,null));};exports['voiceQueuesChannelHangup']=function(_0x1abc59,_0x5f3a36){return respondWithRpcPromise(_0xed1c('0x25'),_[_0xed1c('0x1b')](_0x1abc59[_0xed1c('0x18')],_0x1abc59[_0xed1c('0x1c')]))['then'](respondWithResult(_0x5f3a36,null))['catch'](handleError(_0x5f3a36,null));};exports[_0xed1c('0x26')]=function(_0x470754,_0x589a6f){return respondWithRpcPromise(_0xed1c('0x27'),_[_0xed1c('0x1b')](_0x470754[_0xed1c('0x18')],_0x470754[_0xed1c('0x1c')]))[_0xed1c('0x8')](respondWithResult(_0x589a6f,null))['catch'](handleError(_0x589a6f,null));};exports[_0xed1c('0x28')]=function(_0x88cc3b,_0x4b994f){return respondWithRpcPromise(_0xed1c('0x29'),_0x88cc3b[_0xed1c('0x18')])[_0xed1c('0x8')](respondWithResult(_0x4b994f,null))['catch'](handleError(_0x4b994f,null));};exports[_0xed1c('0x2a')]=function(_0x39d21b,_0x4a8729){return respondWithRpcPromise('OutboundChannels',_0x39d21b[_0xed1c('0x18')])[_0xed1c('0x8')](respondWithResult(_0x4a8729,null))['catch'](handleError(_0x4a8729,null));};exports[_0xed1c('0x2b')]=function(_0x454f6d,_0x43c9af){var _0xfef819;return respondWithRpcPromise(_0xed1c('0x2c'),_0x454f6d[_0xed1c('0x18')])[_0xed1c('0x8')](function(_0x30adc3){_0xfef819=_0x30adc3;return respondWithRpcPromise(_0xed1c('0x2c'),_0x454f6d[_0xed1c('0x18')],routingClient);})[_0xed1c('0x8')](function(_0x13d895){return _[_0xed1c('0x1b')]({},_0x13d895,_0xfef819);})[_0xed1c('0x8')](respondWithResult(_0x43c9af,null))['catch'](handleError(_0x43c9af,null));};exports[_0xed1c('0x2d')]=function(_0x1b6dce,_0xb0c3dc){if(_0x1b6dce[_0xed1c('0x2e')]&&_0x1b6dce['body']['interaction']&&_0x1b6dce[_0xed1c('0x2f')]&&_0x1b6dce['user']['name']){for(var _0x8c172d in _0x1b6dce[_0xed1c('0x2e')]['interaction']){if(_0x1b6dce[_0xed1c('0x2e')][_0xed1c('0x30')][_0xed1c('0x31')](_0x8c172d)){db[_0xed1c('0x32')][_0xed1c('0x33')]({'where':{'channel':_0x8c172d,'membername':_0x1b6dce[_0xed1c('0x2f')][_0xed1c('0x11')],'type':_0xed1c('0x34'),'exitAt':null,'uniqueid':_0x1b6dce['body'][_0xed1c('0x30')][_0x8c172d]&&_0x1b6dce[_0xed1c('0x2e')]['interaction'][_0x8c172d][_0xed1c('0x35')]?{'$notIn':_0x1b6dce[_0xed1c('0x2e')][_0xed1c('0x30')][_0x8c172d]}:{'$ne':null}}})[_0xed1c('0x8')](function(_0x42a5fd){var _0x4c6db5=moment()[_0xed1c('0x36')](_0xed1c('0x37'));for(var _0x2931af=0x0,_0x366be2=_0x42a5fd['length'];_0x2931af<_0x366be2;_0x2931af+=0x1){_0x42a5fd[_0x2931af][_0xed1c('0x38')]({'exitAt':_0x4c6db5});}});for(var _0x5d950d=0x0;_0x5d950d<_0x1b6dce['body'][_0xed1c('0x30')][_0x8c172d]['length'];_0x5d950d+=0x1){db['MemberReport'][_0xed1c('0x39')]({'where':{'channel':_0x8c172d,'membername':_0x1b6dce['user'][_0xed1c('0x11')],'type':'INTERACTION','uniqueid':_0x1b6dce['body'][_0xed1c('0x30')][_0x8c172d][_0x5d950d],'exitAt':null},'defaults':{'channel':_0x8c172d,'membername':_0x1b6dce[_0xed1c('0x2f')]['name'],'interface':_[_0xed1c('0x13')](_0x1b6dce[_0xed1c('0x2f')][_0xed1c('0x3a')])?util['format'](_0xed1c('0x3b'),_0x1b6dce[_0xed1c('0x2f')][_0xed1c('0x11')]):_0x1b6dce[_0xed1c('0x2f')][_0xed1c('0x3a')],'type':_0xed1c('0x34'),'enterAt':moment()[_0xed1c('0x36')](_0xed1c('0x37')),'role':_0xed1c('0x3c'),'internal':_0x1b6dce['user'][_0xed1c('0x3d')],'uniqueid':_0x1b6dce[_0xed1c('0x2e')][_0xed1c('0x30')][_0x8c172d][_0x5d950d]}});}}}}return respondWithRpcPromise(_0xed1c('0x3e'),{'id':_0x1b6dce[_0xed1c('0x1c')]['id'],'capacity':_0x1b6dce[_0xed1c('0x2e')]['capacity']},routingClient)['then'](respondWithResult(_0xb0c3dc,null))[_0xed1c('0xd')](handleError(_0xb0c3dc,null));};exports[_0xed1c('0x3f')]=function(_0x33cc1a,_0x555287){return respondWithRpcPromise(_0xed1c('0x40'),_0x33cc1a[_0xed1c('0x18')])[_0xed1c('0x8')](respondWithResult(_0x555287,null))[_0xed1c('0xd')](handleError(_0x555287,null));};exports[_0xed1c('0x41')]=function(_0x261bdf,_0x1e7768){return respondWithRpcPromise(_0xed1c('0x42'),_0x261bdf[_0xed1c('0x18')])[_0xed1c('0x8')](respondWithResult(_0x1e7768,null))[_0xed1c('0xd')](handleError(_0x1e7768,null));};exports[_0xed1c('0x43')]=function(_0x333eec,_0x5c27d3){return respondWithRpcPromise(_0xed1c('0x44'),_0x333eec[_0xed1c('0x18')])[_0xed1c('0x8')](respondWithResult(_0x5c27d3,null))[_0xed1c('0xd')](handleError(_0x5c27d3,null));};exports['chatQueues']=function(_0x19587a,_0x2c205f){return respondWithRpcPromise(_0xed1c('0x45'),_0x19587a[_0xed1c('0x18')],routingClient)['then'](respondWithResult(_0x2c205f,null))[_0xed1c('0xd')](handleError(_0x2c205f,null));};exports[_0xed1c('0x46')]=function(_0x1b7214,_0x2f1edd){return respondWithRpcPromise(_0xed1c('0x45'),_0x1b7214[_0xed1c('0x18')],routingClient)[_0xed1c('0x8')](findById(_0x1b7214['params']['id']))[_0xed1c('0x8')](respondWithResult(_0x2f1edd,null))[_0xed1c('0xd')](handleError(_0x2f1edd,null));};exports[_0xed1c('0x47')]=function(_0x366e4c,_0x4d1c19){return respondWithRpcPromise('MailQueues',_0x366e4c[_0xed1c('0x18')],routingClient)[_0xed1c('0x8')](respondWithResult(_0x4d1c19,null))[_0xed1c('0xd')](handleError(_0x4d1c19,null));};exports[_0xed1c('0x48')]=function(_0x39b79f,_0x5ad7e0){return respondWithRpcPromise(_0xed1c('0x49'),_0x39b79f[_0xed1c('0x18')],routingClient)[_0xed1c('0x8')](findById(_0x39b79f['params']['id']))[_0xed1c('0x8')](respondWithResult(_0x5ad7e0,null))[_0xed1c('0xd')](handleError(_0x5ad7e0,null));};exports[_0xed1c('0x4a')]=function(_0x1e0c2a,_0x2c1b63){return respondWithRpcPromise(_0xed1c('0x4b'),_0x1e0c2a[_0xed1c('0x18')],mailClient)[_0xed1c('0x8')](respondWithResult(_0x2c1b63,null))[_0xed1c('0xd')](handleError(_0x2c1b63,null));};exports[_0xed1c('0x4c')]=function(_0x43c34,_0x37f025){return respondWithRpcPromise('OpenchannelQueues',_0x43c34[_0xed1c('0x18')],routingClient)[_0xed1c('0x8')](respondWithResult(_0x37f025,null))['catch'](handleError(_0x37f025,null));};exports[_0xed1c('0x4d')]=function(_0x178212,_0x31500f){return respondWithRpcPromise(_0xed1c('0x4e'),_0x178212[_0xed1c('0x18')],routingClient)[_0xed1c('0x8')](findById(_0x178212[_0xed1c('0x1c')]['id']))[_0xed1c('0x8')](respondWithResult(_0x31500f,null))['catch'](handleError(_0x31500f,null));};exports['smsQueues']=function(_0x42f576,_0x282f34){return respondWithRpcPromise(_0xed1c('0x4f'),_0x42f576['query'],routingClient)['then'](respondWithResult(_0x282f34,null))[_0xed1c('0xd')](handleError(_0x282f34,null));};exports['showSmsQueues']=function(_0x45f392,_0x58a566){return respondWithRpcPromise(_0xed1c('0x4f'),_0x45f392['query'],routingClient)[_0xed1c('0x8')](findById(_0x45f392[_0xed1c('0x1c')]['id']))['then'](respondWithResult(_0x58a566,null))[_0xed1c('0xd')](handleError(_0x58a566,null));};exports[_0xed1c('0x50')]=function(_0x8e3f95,_0x3134fb){return respondWithRpcPromise('FaxQueues',_0x8e3f95['query'],routingClient)[_0xed1c('0x8')](respondWithResult(_0x3134fb,null))[_0xed1c('0xd')](handleError(_0x3134fb,null));};exports[_0xed1c('0x51')]=function(_0x3922a4,_0x231e6c){return respondWithRpcPromise(_0xed1c('0x52'),_0x3922a4[_0xed1c('0x18')],routingClient)[_0xed1c('0x8')](findById(_0x3922a4[_0xed1c('0x1c')]['id']))[_0xed1c('0x8')](respondWithResult(_0x231e6c,null))[_0xed1c('0xd')](handleError(_0x231e6c,null));};exports[_0xed1c('0x53')]=function(_0x6f8cf3,_0x5e00e1){return respondWithRpcPromise('FaxAccounts',_0x6f8cf3['query'])[_0xed1c('0x8')](respondWithResult(_0x5e00e1,null))[_0xed1c('0xd')](handleError(_0x5e00e1,null));};exports[_0xed1c('0x54')]=function(_0x1be0db,_0x36560b){return respondWithRpcPromise(_0xed1c('0x55'),_0x1be0db[_0xed1c('0x18')],routingClient)[_0xed1c('0x8')](respondWithResult(_0x36560b,null))[_0xed1c('0xd')](handleError(_0x36560b,null));};exports[_0xed1c('0x56')]=function(_0x7f496c,_0x910486){return respondWithRpcPromise(_0xed1c('0x57'),_0x7f496c[_0xed1c('0x18')],routingClient)['then'](respondWithResult(_0x910486,null))[_0xed1c('0xd')](handleError(_0x910486,null));};exports[_0xed1c('0x58')]=function(_0x55c5aa,_0x349199){return respondWithRpcPromise(_0xed1c('0x59'),_0x55c5aa[_0xed1c('0x18')],routingClient)[_0xed1c('0x8')](respondWithResult(_0x349199,null))[_0xed1c('0xd')](handleError(_0x349199,null));};exports[_0xed1c('0x5a')]=function(_0x351b91,_0x26a8df){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x351b91[_0xed1c('0x18')],routingClient)['then'](respondWithResult(_0x26a8df,null))[_0xed1c('0xd')](handleError(_0x26a8df,null));};exports[_0xed1c('0x5b')]=function(_0x192ded,_0x4d4e6a){return respondWithRpcPromise(_0xed1c('0x5c'),_0x192ded['query'],routingClient)[_0xed1c('0x8')](respondWithResult(_0x4d4e6a,null))[_0xed1c('0xd')](handleError(_0x4d4e6a,null));};exports[_0xed1c('0x5d')]=function(_0x3a20f9){return function(_0x44266c,_0x253498){var _0x928605,_0x515f36;var _0x275a82=_[_0xed1c('0x5e')](_0x3a20f9);var _0x16b2d3=_0x3a20f9===_0xed1c('0x5f')?'Website':_0xed1c('0x60');return db[_0x275a82+_0xed1c('0x61')][_0xed1c('0x62')]({'raw':!![],'where':{'id':_0x44266c[_0xed1c('0x1c')]['id']}})[_0xed1c('0x8')](function(_0x7b510){if(_[_0xed1c('0x13')](_0x7b510)){throw new Error(_0x275a82+'\x20Queue\x20not\x20found');}_0x928605=_0x7b510;return db[_0x275a82+_0xed1c('0x63')]['findOne']({'where':{'id':_0x44266c[_0xed1c('0x2e')][_0xed1c('0x64')]},'include':[{'model':db[_0x275a82+_0xed1c('0x65')],'as':_0xed1c('0x65')},{'model':db[_0x275a82+_0x16b2d3],'as':'Account'}]});})[_0xed1c('0x8')](function(_0x28878b){if(_[_0xed1c('0x13')](_0x28878b)){throw new Error(_0x275a82+_0xed1c('0x66'));}_0x515f36=_0x28878b;return _0x28878b[_0xed1c('0x67')]({'read':0x0,'readAt':null,'UserId':null});})[_0xed1c('0x8')](function(){var _0x2efd87={'uniqueid':_0x3a20f9+'.'+_0x515f36['id']+'.'+_0x515f36[_0xed1c('0x65')]['id'],'FromUserId':_0x44266c[_0xed1c('0x2f')]['id'],'type':_0xed1c('0x68')};_0x2efd87[_0x275a82+'MessageId']=_0x515f36['id'];_0x2efd87[_0x275a82+_0xed1c('0x69')]=_0x515f36[_0xed1c('0x65')]['id'];_0x2efd87[_0xed1c('0x6a')+_0x275a82+_0x16b2d3+'Id']=_0x515f36['Account']['id'];_0x2efd87['To'+_0x275a82+_0xed1c('0x6b')]=_0x928605['id'];return db[_0x275a82+_0xed1c('0x6c')][_0xed1c('0x6d')](_0x2efd87);})[_0xed1c('0x8')](function(){return respondWithRpcPromise(_0xed1c('0x6e'),{'channel':_0x3a20f9,'interaction':_0x515f36[_0xed1c('0x65')],'message':_0x515f36,'account':_0x515f36[_0xed1c('0x60')],'applications':[{'id':0x0,'priority':0x1,'app':_0xed1c('0x68'),'appdata':_0x928605['name']+','+(_0x515f36[_0xed1c('0x60')][_0xed1c('0x6f')]||0x12c),'interval':_0xed1c('0x70')}]},routingClient);})[_0xed1c('0x8')](respondWithResult(_0x253498,null))['catch'](handleError(_0x253498,null));};};exports['agentNotify']=function(_0x1d3e3b,_0x10e576){var _0x116b50,_0x579408;if(_[_0xed1c('0x13')](_0x1d3e3b[_0xed1c('0x2e')][_0xed1c('0x71')])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x41aa14=_0x1d3e3b[_0xed1c('0x2e')][_0xed1c('0x71')];var _0x1d7b5b=_[_0xed1c('0x5e')](_0x41aa14);var _0x32032c=_0x41aa14===_0xed1c('0x5f')?_0xed1c('0x72'):_0xed1c('0x60');return db[_0xed1c('0x73')][_0xed1c('0x62')]({'raw':!![],'where':{'id':_0x1d3e3b[_0xed1c('0x1c')]['id'],'role':'agent'}})['then'](function(_0x4f53ee){if(_['isNil'](_0x4f53ee)){throw new Error(_0xed1c('0x74'));}_0x116b50=_0x4f53ee;return db[_0x1d7b5b+'Message'][_0xed1c('0x62')]({'where':{'id':_0x1d3e3b[_0xed1c('0x2e')][_0xed1c('0x64')]},'include':[{'model':db[_0x1d7b5b+_0xed1c('0x65')],'as':_0xed1c('0x65')},{'model':db[_0x1d7b5b+_0x32032c],'as':'Account'}]});})[_0xed1c('0x8')](function(_0x2b9826){if(_[_0xed1c('0x13')](_0x2b9826)){throw new Error(_0x1d7b5b+_0xed1c('0x66'));}_0x579408=_0x2b9826;return _0x2b9826[_0xed1c('0x67')]({'read':0x0,'readAt':null,'UserId':null});})[_0xed1c('0x8')](function(){var _0x1de7aa={'uniqueid':_0x41aa14+'.'+_0x579408['id']+'.'+_0x579408[_0xed1c('0x65')]['id'],'FromUserId':_0x1d3e3b[_0xed1c('0x2f')]['id'],'type':'queue','ToUserId':_0x116b50['id']};_0x1de7aa[_0x1d7b5b+'MessageId']=_0x579408['id'];_0x1de7aa[_0x1d7b5b+_0xed1c('0x69')]=_0x579408[_0xed1c('0x65')]['id'];_0x1de7aa['From'+_0x1d7b5b+_0x32032c+'Id']=_0x579408[_0xed1c('0x60')]['id'];return db[_0x1d7b5b+_0xed1c('0x6c')]['create'](_0x1de7aa);})[_0xed1c('0x8')](function(){return respondWithRpcPromise('Start',{'channel':_0x41aa14,'interaction':_0x579408[_0xed1c('0x65')],'message':_0x579408,'account':_0x579408[_0xed1c('0x60')],'applications':[{'id':0x0,'priority':0x1,'app':_0xed1c('0x3c'),'appdata':_0x116b50[_0xed1c('0x11')]+','+(_0x579408['Account'][_0xed1c('0x75')]||0x12c),'interval':_0xed1c('0x70')}]},routingClient);})[_0xed1c('0x8')](respondWithResult(_0x10e576,null))[_0xed1c('0xd')](handleError(_0x10e576,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index db13345..b91188f 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 _0x4a99=['connect-timeout','express','Router','../../components/auth/service','./schedule.controller','isAuthenticated','show','get','/:id/run','run','post','put','/:id','delete','destroy','exports','path'];(function(_0x1f543f,_0x5bcd4c){var _0x1e8bbf=function(_0x42c83d){while(--_0x42c83d){_0x1f543f['push'](_0x1f543f['shift']());}};_0x1e8bbf(++_0x5bcd4c);}(_0x4a99,0x131));var _0x94a9=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x4a99[_0x4243a3];return _0x1b2a33;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x94a9('0x0'));var timeout=require(_0x94a9('0x1'));var express=require(_0x94a9('0x2'));var router=express[_0x94a9('0x3')]();var auth=require(_0x94a9('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x94a9('0x5'));router['get']('/',auth[_0x94a9('0x6')](),controller['index']);router['get']('/:id',auth[_0x94a9('0x6')](),controller[_0x94a9('0x7')]);router[_0x94a9('0x8')](_0x94a9('0x9'),auth[_0x94a9('0x6')](),controller[_0x94a9('0xa')]);router[_0x94a9('0xb')]('/',auth[_0x94a9('0x6')](),controller['create']);router[_0x94a9('0xc')](_0x94a9('0xd'),auth[_0x94a9('0x6')](),controller['update']);router[_0x94a9('0xe')](_0x94a9('0xd'),auth[_0x94a9('0x6')](),controller[_0x94a9('0xf')]);module[_0x94a9('0x10')]=router; \ No newline at end of file +var _0x68f7=['./schedule.controller','index','/:id','isAuthenticated','show','get','post','create','put','update','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../config/environment'];(function(_0x496738,_0x3f1a9f){var _0xee1381=function(_0x4dc50c){while(--_0x4dc50c){_0x496738['push'](_0x496738['shift']());}};_0xee1381(++_0x3f1a9f);}(_0x68f7,0xc6));var _0x768f=function(_0x3d9fcd,_0x36ed8a){_0x3d9fcd=_0x3d9fcd-0x0;var _0x197525=_0x68f7[_0x3d9fcd];return _0x197525;};'use strict';var multer=require(_0x768f('0x0'));var util=require(_0x768f('0x1'));var path=require('path');var timeout=require(_0x768f('0x2'));var express=require('express');var router=express[_0x768f('0x3')]();var auth=require(_0x768f('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x768f('0x5'));var controller=require(_0x768f('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x768f('0x7')]);router['get'](_0x768f('0x8'),auth[_0x768f('0x9')](),controller[_0x768f('0xa')]);router[_0x768f('0xb')]('/:id/run',auth[_0x768f('0x9')](),controller['run']);router[_0x768f('0xc')]('/',auth[_0x768f('0x9')](),controller[_0x768f('0xd')]);router[_0x768f('0xe')](_0x768f('0x8'),auth[_0x768f('0x9')](),controller[_0x768f('0xf')]);router['delete'](_0x768f('0x8'),auth[_0x768f('0x9')](),controller['destroy']);module[_0x768f('0x10')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 9e6246a..a52da51 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 _0xfc17=['exports','STRING','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','quarters','months','weeks','days','hours','minutes','csv','pdf','xlsx','custom','BOOLEAN','TEXT','sequelize'];(function(_0x1f9551,_0x2bd0c3){var _0x45120f=function(_0x2d63c5){while(--_0x2d63c5){_0x1f9551['push'](_0x1f9551['shift']());}};_0x45120f(++_0x2bd0c3);}(_0xfc17,0x1b4));var _0x7fc1=function(_0x522055,_0x1e7bbb){_0x522055=_0x522055-0x0;var _0xa9cdf8=_0xfc17[_0x522055];return _0xa9cdf8;};'use strict';var Sequelize=require(_0x7fc1('0x0'));module[_0x7fc1('0x1')]={'name':{'type':Sequelize[_0x7fc1('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x7fc1('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x7fc1('0x2')],'allowNull':![],'defaultValue':_0x7fc1('0x3')},'startAt':{'type':Sequelize[_0x7fc1('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0x7fc1('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x7fc1('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x7fc1('0x6')]('years',_0x7fc1('0x7'),_0x7fc1('0x8'),_0x7fc1('0x9'),_0x7fc1('0xa'),_0x7fc1('0xb'),_0x7fc1('0xc')),'allowNull':![],'defaultValue':_0x7fc1('0xa')},'output':{'type':Sequelize['ENUM'](_0x7fc1('0xd'),_0x7fc1('0xe'),_0x7fc1('0xf')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0x7fc1('0x6')]('custom','default'),'allowNull':![],'defaultValue':_0x7fc1('0x10')},'sendMail':{'type':Sequelize[_0x7fc1('0x11')],'defaultValue':![]},'email':{'type':Sequelize[_0x7fc1('0x2')]},'cc':{'type':Sequelize[_0x7fc1('0x12')]},'bcc':{'type':Sequelize[_0x7fc1('0x12')]},'sendIfEmpty':{'type':Sequelize[_0x7fc1('0x11')],'defaultValue':!![]}}; \ No newline at end of file +var _0xba0d=['BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','weeks','days','hours','minutes','xlsx','default','custom','TEXT','sequelize','STRING'];(function(_0x35e9b8,_0xf59bc){var _0x4e3c6f=function(_0x27661a){while(--_0x27661a){_0x35e9b8['push'](_0x35e9b8['shift']());}};_0x4e3c6f(++_0xf59bc);}(_0xba0d,0x8e));var _0xdba0=function(_0x5a3774,_0xd79c9a){_0x5a3774=_0x5a3774-0x0;var _0x13770a=_0xba0d[_0x5a3774];return _0x13770a;};'use strict';var Sequelize=require(_0xdba0('0x0'));module['exports']={'name':{'type':Sequelize[_0xdba0('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xdba0('0x1')]},'active':{'type':Sequelize[_0xdba0('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xdba0('0x3')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0xdba0('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xdba0('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xdba0('0x6')](_0xdba0('0x7'),'quarters','months',_0xdba0('0x8'),_0xdba0('0x9'),_0xdba0('0xa'),_0xdba0('0xb')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0xdba0('0x6')]('csv','pdf',_0xdba0('0xc')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0xdba0('0x6')]('custom',_0xdba0('0xd')),'allowNull':![],'defaultValue':_0xdba0('0xe')},'sendMail':{'type':Sequelize[_0xdba0('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0xdba0('0x1')]},'cc':{'type':Sequelize[_0xdba0('0xf')]},'bcc':{'type':Sequelize[_0xdba0('0xf')]},'sendIfEmpty':{'type':Sequelize[_0xdba0('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 8842dcf..e86011e 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 _0x2d17=['model','map','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','limit','sort','filters','pick','filter','where','VIRTUAL','merge','options','count','includeAll','include','findAll','catch','show','fields','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','run','../../config/schedule','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','sox','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','set','Content-Range','apply','reject','save','update','destroy','get','Scheduler','UserProfileResource','then','stack','name','send','Schedule','rawAttributes','fieldName','type','key'];(function(_0x18c627,_0x926f18){var _0x1e9cbf=function(_0x63fb22){while(--_0x63fb22){_0x18c627['push'](_0x18c627['shift']());}};_0x1e9cbf(++_0x926f18);}(_0x2d17,0x17e));var _0x72d1=function(_0x5f4ee5,_0x2f144d){_0x5f4ee5=_0x5f4ee5-0x0;var _0x2c8500=_0x2d17[_0x5f4ee5];return _0x2c8500;};'use strict';var pdf=require(_0x72d1('0x0'));var emlformat=require(_0x72d1('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x72d1('0x2'));var jsonpatch=require(_0x72d1('0x3'));var rp=require('request-promise');var moment=require(_0x72d1('0x4'));var BPromise=require(_0x72d1('0x5'));var Mustache=require('mustache');var util=require(_0x72d1('0x6'));var path=require('path');var sox=require(_0x72d1('0x7'));var csv=require('to-csv');var ejs=require(_0x72d1('0x8'));var fs=require('fs');var _=require(_0x72d1('0x9'));var squel=require('squel');var crypto=require(_0x72d1('0xa'));var jsforce=require(_0x72d1('0xb'));var deskjs=require(_0x72d1('0xc'));var toCsv=require('to-csv');var querystring=require(_0x72d1('0xd'));var Papa=require(_0x72d1('0xe'));var Redis=require(_0x72d1('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x72d1('0x10'));var as=require(_0x72d1('0x11'));var hardwareService=require(_0x72d1('0x12'));var logger=require(_0x72d1('0x13'))(_0x72d1('0x14'));var utils=require(_0x72d1('0x15'));var config=require(_0x72d1('0x16'));var db=require(_0x72d1('0x17'))['db'];function respondWithStatusCode(_0x273ccf,_0x2f5a78){_0x2f5a78=_0x2f5a78||0xcc;return function(_0x5ad4df){if(_0x5ad4df){return _0x273ccf[_0x72d1('0x18')](_0x2f5a78);}return _0x273ccf[_0x72d1('0x19')](_0x2f5a78)[_0x72d1('0x1a')]();};}function respondWithResult(_0x115cd7,_0x22ac6f){_0x22ac6f=_0x22ac6f||0xc8;return function(_0x685a27){if(_0x685a27){return _0x115cd7[_0x72d1('0x19')](_0x22ac6f)[_0x72d1('0x1b')](_0x685a27);}};}function respondWithFilteredResult(_0x172fae,_0x3f190f){return function(_0x21c85e){if(_0x21c85e){var _0x23a238=_0x21c85e['count'],_0x8d458=_0x3f190f[_0x72d1('0x1c')],_0x491af4=_0x3f190f[_0x72d1('0x1c')]+_0x3f190f['limit'],_0x46fa3d;if(_0x491af4>=_0x23a238){_0x491af4=_0x23a238;_0x46fa3d=0xc8;}else{_0x46fa3d=0xce;}_0x172fae[_0x72d1('0x19')](_0x46fa3d);return _0x172fae[_0x72d1('0x1d')](_0x72d1('0x1e'),_0x8d458+'-'+_0x491af4+'/'+_0x23a238)['json'](_0x21c85e);}return null;};}function patchUpdates(_0x4925f6){return function(_0x313d7b){try{jsonpatch[_0x72d1('0x1f')](_0x313d7b,_0x4925f6,!![]);}catch(_0x2233cb){return BPromise[_0x72d1('0x20')](_0x2233cb);}return _0x313d7b[_0x72d1('0x21')]();};}function saveUpdates(_0x2253fd,_0x1e2411){return function(_0x5c7982){if(_0x5c7982){return _0x5c7982[_0x72d1('0x22')](_0x2253fd)['then'](function(_0x506062){return _0x506062;});}return null;};}function removeEntity(_0x5b85cc,_0x585243){return function(_0x445985){if(_0x445985){return _0x445985[_0x72d1('0x23')]()['then'](function(){var _0x2a421a=_0x445985[_0x72d1('0x24')]({'plain':!![]});var _0x492086=_0x72d1('0x25');return db[_0x72d1('0x26')]['destroy']({'where':{'type':_0x492086,'resourceId':_0x2a421a['id']}})['then'](function(){return _0x445985;});})[_0x72d1('0x27')](function(){_0x5b85cc[_0x72d1('0x19')](0xcc)[_0x72d1('0x1a')]();});}};}function handleEntityNotFound(_0x2f879f,_0xdf6a69){return function(_0x33d530){if(!_0x33d530){_0x2f879f[_0x72d1('0x18')](0x194);}return _0x33d530;};}function handleError(_0x589f7c,_0x57ec9e){_0x57ec9e=_0x57ec9e||0x1f4;return function(_0x1ba258){logger['error'](_0x1ba258[_0x72d1('0x28')]);if(_0x1ba258[_0x72d1('0x29')]){delete _0x1ba258[_0x72d1('0x29')];}_0x589f7c['status'](_0x57ec9e)[_0x72d1('0x2a')](_0x1ba258);};}exports['index']=function(_0x707cd0,_0x20055f){var _0x32588f={},_0x2cc0c8={},_0x51242b={'count':0x0,'rows':[]};var _0x37617e=_['map'](db[_0x72d1('0x2b')][_0x72d1('0x2c')],function(_0x5cec3f){return{'name':_0x5cec3f[_0x72d1('0x2d')],'type':_0x5cec3f[_0x72d1('0x2e')][_0x72d1('0x2f')]};});_0x2cc0c8[_0x72d1('0x30')]=_[_0x72d1('0x31')](_0x37617e,'name');_0x2cc0c8[_0x72d1('0x32')]=_[_0x72d1('0x33')](_0x707cd0[_0x72d1('0x32')]);_0x2cc0c8['filters']=_[_0x72d1('0x34')](_0x2cc0c8[_0x72d1('0x30')],_0x2cc0c8['query']);_0x32588f[_0x72d1('0x35')]=_[_0x72d1('0x34')](_0x2cc0c8[_0x72d1('0x30')],qs['fields'](_0x707cd0[_0x72d1('0x32')]['fields']));_0x32588f[_0x72d1('0x35')]=_0x32588f[_0x72d1('0x35')][_0x72d1('0x36')]?_0x32588f[_0x72d1('0x35')]:_0x2cc0c8[_0x72d1('0x30')];if(!_0x707cd0[_0x72d1('0x32')][_0x72d1('0x37')](_0x72d1('0x38'))){_0x32588f[_0x72d1('0x39')]=qs[_0x72d1('0x39')](_0x707cd0[_0x72d1('0x32')]['limit']);_0x32588f[_0x72d1('0x1c')]=qs[_0x72d1('0x1c')](_0x707cd0[_0x72d1('0x32')][_0x72d1('0x1c')]);}_0x32588f['order']=qs[_0x72d1('0x3a')](_0x707cd0[_0x72d1('0x32')][_0x72d1('0x3a')]);_0x32588f['where']=qs[_0x72d1('0x3b')](_[_0x72d1('0x3c')](_0x707cd0[_0x72d1('0x32')],_0x2cc0c8['filters']));if(_0x707cd0[_0x72d1('0x32')][_0x72d1('0x3d')]){_0x32588f[_0x72d1('0x3e')]=_['merge'](_0x32588f[_0x72d1('0x3e')],{'$or':_[_0x72d1('0x31')](_0x37617e,function(_0x1e083e){if(_0x1e083e[_0x72d1('0x2e')][_0x72d1('0x2f')]!==_0x72d1('0x3f')){var _0xd7ec0f={};_0xd7ec0f[_0x1e083e['field']]={'$like':'%'+_0x707cd0[_0x72d1('0x32')][_0x72d1('0x3d')]+'%'};return _0xd7ec0f;}})});}_0x32588f=_[_0x72d1('0x40')]({},_0x32588f,_0x707cd0[_0x72d1('0x41')]);var _0x20fb2f={'where':_0x32588f[_0x72d1('0x3e')]};return db[_0x72d1('0x2b')][_0x72d1('0x42')](_0x20fb2f)['then'](function(_0x44d5b2){_0x51242b[_0x72d1('0x42')]=_0x44d5b2;if(_0x707cd0[_0x72d1('0x32')][_0x72d1('0x43')]){_0x32588f[_0x72d1('0x44')]=[{'all':!![]}];}return db[_0x72d1('0x2b')][_0x72d1('0x45')](_0x32588f);})[_0x72d1('0x27')](function(_0x5620f0){_0x51242b['rows']=_0x5620f0;return _0x51242b;})[_0x72d1('0x27')](respondWithFilteredResult(_0x20055f,_0x32588f))[_0x72d1('0x46')](handleError(_0x20055f,null));};exports[_0x72d1('0x47')]=function(_0x21d361,_0x5a6bc4){var _0x3fe286={'raw':![],'where':{'id':_0x21d361['params']['id']}},_0x3e80e0={};_0x3e80e0[_0x72d1('0x30')]=_['keys'](db[_0x72d1('0x2b')][_0x72d1('0x2c')]);_0x3e80e0['query']=_[_0x72d1('0x33')](_0x21d361['query']);_0x3e80e0['filters']=_['intersection'](_0x3e80e0[_0x72d1('0x30')],_0x3e80e0['query']);_0x3fe286[_0x72d1('0x35')]=_[_0x72d1('0x34')](_0x3e80e0[_0x72d1('0x30')],qs['fields'](_0x21d361['query'][_0x72d1('0x48')]));_0x3fe286['attributes']=_0x3fe286['attributes'][_0x72d1('0x36')]?_0x3fe286[_0x72d1('0x35')]:_0x3e80e0[_0x72d1('0x30')];if(_0x21d361['query']['includeAll']){_0x3fe286['include']=[{'all':!![]}];}_0x3fe286=_['merge']({},_0x3fe286,_0x21d361[_0x72d1('0x41')]);return db[_0x72d1('0x2b')][_0x72d1('0x49')](_0x3fe286)[_0x72d1('0x27')](handleEntityNotFound(_0x5a6bc4,null))[_0x72d1('0x27')](respondWithResult(_0x5a6bc4,null))[_0x72d1('0x46')](handleError(_0x5a6bc4,null));};exports[_0x72d1('0x4a')]=function(_0x5924c,_0x1e2c11){return db['Schedule'][_0x72d1('0x4a')](_0x5924c[_0x72d1('0x4b')],{})[_0x72d1('0x27')](function(_0x51b1a9){var _0x418e6f=_0x5924c[_0x72d1('0x4c')][_0x72d1('0x24')]({'plain':!![]});if(!_0x418e6f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x418e6f[_0x72d1('0x4d')]===_0x72d1('0x4c')){var _0x343da3=_0x51b1a9[_0x72d1('0x24')]({'plain':!![]});var _0x48c20d='Scheduler';return db[_0x72d1('0x4e')][_0x72d1('0x49')]({'where':{'name':_0x48c20d,'userProfileId':_0x418e6f[_0x72d1('0x4f')]},'raw':!![]})['then'](function(_0x402a04){if(_0x402a04&&_0x402a04[_0x72d1('0x50')]===0x0){return db[_0x72d1('0x26')][_0x72d1('0x4a')]({'name':_0x343da3[_0x72d1('0x29')],'resourceId':_0x343da3['id'],'type':_0x402a04[_0x72d1('0x29')],'sectionId':_0x402a04['id']},{})[_0x72d1('0x27')](function(){return _0x51b1a9;});}else{return _0x51b1a9;}})[_0x72d1('0x46')](function(_0x12870c){logger[_0x72d1('0x51')](_0x72d1('0x52'),_0x12870c);throw _0x12870c;});}return _0x51b1a9;})['then'](respondWithResult(_0x1e2c11,0xc9))[_0x72d1('0x46')](handleError(_0x1e2c11,null));};exports['update']=function(_0x5dd7b0,_0x356196){if(_0x5dd7b0['body']['id']){delete _0x5dd7b0[_0x72d1('0x4b')]['id'];}return db[_0x72d1('0x2b')][_0x72d1('0x49')]({'where':{'id':_0x5dd7b0[_0x72d1('0x53')]['id']}})[_0x72d1('0x27')](handleEntityNotFound(_0x356196,null))[_0x72d1('0x27')](saveUpdates(_0x5dd7b0[_0x72d1('0x4b')],null))[_0x72d1('0x27')](respondWithResult(_0x356196,null))[_0x72d1('0x46')](handleError(_0x356196,null));};exports[_0x72d1('0x23')]=function(_0x14f9de,_0x52102e){return db[_0x72d1('0x2b')][_0x72d1('0x49')]({'where':{'id':_0x14f9de[_0x72d1('0x53')]['id']}})['then'](handleEntityNotFound(_0x52102e,null))['then'](removeEntity(_0x52102e,null))[_0x72d1('0x46')](handleError(_0x52102e,null));};exports[_0x72d1('0x54')]=function(_0x16e9e7,_0x4b168,_0x444583){var _0x480b5d=require(_0x72d1('0x55'));return db['Schedule'][_0x72d1('0x49')]({'where':{'id':_0x16e9e7[_0x72d1('0x53')]['id']},'raw':!![]})[_0x72d1('0x27')](handleEntityNotFound(_0x4b168,null))[_0x72d1('0x27')](function(){_0x480b5d[_0x72d1('0x54')](_0x16e9e7[_0x72d1('0x53')]['id']);})[_0x72d1('0x27')](respondWithStatusCode(_0x4b168,null))[_0x72d1('0x46')](handleError(_0x4b168,null));}; \ No newline at end of file +var _0x5075=['intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','type','VIRTUAL','field','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','../../config/schedule','run','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','Scheduler','UserProfileResource','name','send','index','map','Schedule','rawAttributes','key','model','keys','query','filters'];(function(_0xc6971f,_0x53138a){var _0x28ca53=function(_0xa0f0b4){while(--_0xa0f0b4){_0xc6971f['push'](_0xc6971f['shift']());}};_0x28ca53(++_0x53138a);}(_0x5075,0x73));var _0x5507=function(_0x58547b,_0x4b89c2){_0x58547b=_0x58547b-0x0;var _0x1d3fd2=_0x5075[_0x58547b];return _0x1d3fd2;};'use strict';var pdf=require(_0x5507('0x0'));var emlformat=require(_0x5507('0x1'));var rimraf=require(_0x5507('0x2'));var zipdir=require(_0x5507('0x3'));var jsonpatch=require(_0x5507('0x4'));var rp=require(_0x5507('0x5'));var moment=require(_0x5507('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x5507('0x7'));var util=require(_0x5507('0x8'));var path=require(_0x5507('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5507('0xa'));var fs=require('fs');var _=require(_0x5507('0xb'));var squel=require('squel');var crypto=require(_0x5507('0xc'));var jsforce=require(_0x5507('0xd'));var deskjs=require(_0x5507('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5507('0xf'));var Redis=require(_0x5507('0x10'));var authService=require(_0x5507('0x11'));var qs=require(_0x5507('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5507('0x13'));var logger=require(_0x5507('0x14'))('api');var utils=require(_0x5507('0x15'));var config=require(_0x5507('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x37a1de,_0x2a2ea0){_0x2a2ea0=_0x2a2ea0||0xcc;return function(_0x32c872){if(_0x32c872){return _0x37a1de[_0x5507('0x17')](_0x2a2ea0);}return _0x37a1de[_0x5507('0x18')](_0x2a2ea0)[_0x5507('0x19')]();};}function respondWithResult(_0x59889b,_0x9cc3f9){_0x9cc3f9=_0x9cc3f9||0xc8;return function(_0x2b7c43){if(_0x2b7c43){return _0x59889b[_0x5507('0x18')](_0x9cc3f9)[_0x5507('0x1a')](_0x2b7c43);}};}function respondWithFilteredResult(_0x4df473,_0x49e400){return function(_0x10d7b9){if(_0x10d7b9){var _0x2dfd06=_0x10d7b9[_0x5507('0x1b')],_0x1ab167=_0x49e400[_0x5507('0x1c')],_0xa6e4b3=_0x49e400[_0x5507('0x1c')]+_0x49e400[_0x5507('0x1d')],_0x2ede34;if(_0xa6e4b3>=_0x2dfd06){_0xa6e4b3=_0x2dfd06;_0x2ede34=0xc8;}else{_0x2ede34=0xce;}_0x4df473[_0x5507('0x18')](_0x2ede34);return _0x4df473[_0x5507('0x1e')](_0x5507('0x1f'),_0x1ab167+'-'+_0xa6e4b3+'/'+_0x2dfd06)['json'](_0x10d7b9);}return null;};}function patchUpdates(_0x14dab0){return function(_0x276a81){try{jsonpatch[_0x5507('0x20')](_0x276a81,_0x14dab0,!![]);}catch(_0x193eda){return BPromise['reject'](_0x193eda);}return _0x276a81[_0x5507('0x21')]();};}function saveUpdates(_0x1af06e,_0x1a54b0){return function(_0x3ca1f7){if(_0x3ca1f7){return _0x3ca1f7[_0x5507('0x22')](_0x1af06e)[_0x5507('0x23')](function(_0x501a94){return _0x501a94;});}return null;};}function removeEntity(_0x475970,_0x105535){return function(_0x1f6325){if(_0x1f6325){return _0x1f6325[_0x5507('0x24')]()[_0x5507('0x23')](function(){var _0x2de482=_0x1f6325[_0x5507('0x25')]({'plain':!![]});var _0x10f149=_0x5507('0x26');return db[_0x5507('0x27')][_0x5507('0x24')]({'where':{'type':_0x10f149,'resourceId':_0x2de482['id']}})[_0x5507('0x23')](function(){return _0x1f6325;});})[_0x5507('0x23')](function(){_0x475970[_0x5507('0x18')](0xcc)[_0x5507('0x19')]();});}};}function handleEntityNotFound(_0x4915ed,_0x4e8906){return function(_0x5b74c0){if(!_0x5b74c0){_0x4915ed[_0x5507('0x17')](0x194);}return _0x5b74c0;};}function handleError(_0x4ea271,_0xa66a01){_0xa66a01=_0xa66a01||0x1f4;return function(_0x24668b){logger['error'](_0x24668b['stack']);if(_0x24668b[_0x5507('0x28')]){delete _0x24668b[_0x5507('0x28')];}_0x4ea271['status'](_0xa66a01)[_0x5507('0x29')](_0x24668b);};}exports[_0x5507('0x2a')]=function(_0x85d383,_0x38f4d9){var _0x1e5ce6={},_0x14fdea={},_0x55e889={'count':0x0,'rows':[]};var _0x4422ef=_[_0x5507('0x2b')](db[_0x5507('0x2c')][_0x5507('0x2d')],function(_0x29dd58){return{'name':_0x29dd58['fieldName'],'type':_0x29dd58['type'][_0x5507('0x2e')]};});_0x14fdea[_0x5507('0x2f')]=_[_0x5507('0x2b')](_0x4422ef,_0x5507('0x28'));_0x14fdea['query']=_[_0x5507('0x30')](_0x85d383[_0x5507('0x31')]);_0x14fdea[_0x5507('0x32')]=_[_0x5507('0x33')](_0x14fdea[_0x5507('0x2f')],_0x14fdea[_0x5507('0x31')]);_0x1e5ce6[_0x5507('0x34')]=_[_0x5507('0x33')](_0x14fdea['model'],qs[_0x5507('0x35')](_0x85d383[_0x5507('0x31')][_0x5507('0x35')]));_0x1e5ce6['attributes']=_0x1e5ce6['attributes'][_0x5507('0x36')]?_0x1e5ce6[_0x5507('0x34')]:_0x14fdea[_0x5507('0x2f')];if(!_0x85d383[_0x5507('0x31')][_0x5507('0x37')]('nolimit')){_0x1e5ce6['limit']=qs[_0x5507('0x1d')](_0x85d383[_0x5507('0x31')][_0x5507('0x1d')]);_0x1e5ce6[_0x5507('0x1c')]=qs['offset'](_0x85d383['query'][_0x5507('0x1c')]);}_0x1e5ce6['order']=qs[_0x5507('0x38')](_0x85d383[_0x5507('0x31')][_0x5507('0x38')]);_0x1e5ce6[_0x5507('0x39')]=qs[_0x5507('0x32')](_[_0x5507('0x3a')](_0x85d383[_0x5507('0x31')],_0x14fdea[_0x5507('0x32')]));if(_0x85d383[_0x5507('0x31')][_0x5507('0x3b')]){_0x1e5ce6['where']=_['merge'](_0x1e5ce6['where'],{'$or':_['map'](_0x4422ef,function(_0x526022){if(_0x526022[_0x5507('0x3c')][_0x5507('0x2e')]!==_0x5507('0x3d')){var _0x2b32a5={};_0x2b32a5[_0x526022[_0x5507('0x3e')]]={'$like':'%'+_0x85d383[_0x5507('0x31')][_0x5507('0x3b')]+'%'};return _0x2b32a5;}})});}_0x1e5ce6=_[_0x5507('0x3f')]({},_0x1e5ce6,_0x85d383[_0x5507('0x40')]);var _0x3ec0ed={'where':_0x1e5ce6[_0x5507('0x39')]};return db[_0x5507('0x2c')][_0x5507('0x1b')](_0x3ec0ed)['then'](function(_0x53b3f3){_0x55e889['count']=_0x53b3f3;if(_0x85d383[_0x5507('0x31')][_0x5507('0x41')]){_0x1e5ce6[_0x5507('0x42')]=[{'all':!![]}];}return db[_0x5507('0x2c')][_0x5507('0x43')](_0x1e5ce6);})[_0x5507('0x23')](function(_0x340c4c){_0x55e889[_0x5507('0x44')]=_0x340c4c;return _0x55e889;})[_0x5507('0x23')](respondWithFilteredResult(_0x38f4d9,_0x1e5ce6))[_0x5507('0x45')](handleError(_0x38f4d9,null));};exports[_0x5507('0x46')]=function(_0x192a00,_0x24d7b5){var _0x25496b={'raw':![],'where':{'id':_0x192a00[_0x5507('0x47')]['id']}},_0x1b3006={};_0x1b3006[_0x5507('0x2f')]=_[_0x5507('0x30')](db[_0x5507('0x2c')]['rawAttributes']);_0x1b3006[_0x5507('0x31')]=_[_0x5507('0x30')](_0x192a00['query']);_0x1b3006['filters']=_[_0x5507('0x33')](_0x1b3006[_0x5507('0x2f')],_0x1b3006[_0x5507('0x31')]);_0x25496b[_0x5507('0x34')]=_[_0x5507('0x33')](_0x1b3006['model'],qs[_0x5507('0x35')](_0x192a00[_0x5507('0x31')][_0x5507('0x35')]));_0x25496b['attributes']=_0x25496b[_0x5507('0x34')][_0x5507('0x36')]?_0x25496b[_0x5507('0x34')]:_0x1b3006[_0x5507('0x2f')];if(_0x192a00[_0x5507('0x31')]['includeAll']){_0x25496b[_0x5507('0x42')]=[{'all':!![]}];}_0x25496b=_['merge']({},_0x25496b,_0x192a00[_0x5507('0x40')]);return db[_0x5507('0x2c')][_0x5507('0x48')](_0x25496b)[_0x5507('0x23')](handleEntityNotFound(_0x24d7b5,null))[_0x5507('0x23')](respondWithResult(_0x24d7b5,null))[_0x5507('0x45')](handleError(_0x24d7b5,null));};exports[_0x5507('0x49')]=function(_0x3452e4,_0x549cf0){return db[_0x5507('0x2c')][_0x5507('0x49')](_0x3452e4['body'],{})['then'](function(_0x4e5825){var _0x39b20f=_0x3452e4['user'][_0x5507('0x25')]({'plain':!![]});if(!_0x39b20f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x39b20f[_0x5507('0x4a')]==='user'){var _0x5ef341=_0x4e5825[_0x5507('0x25')]({'plain':!![]});var _0x350c7e=_0x5507('0x26');return db[_0x5507('0x4b')][_0x5507('0x48')]({'where':{'name':_0x350c7e,'userProfileId':_0x39b20f[_0x5507('0x4c')]},'raw':!![]})['then'](function(_0x41f874){if(_0x41f874&&_0x41f874[_0x5507('0x4d')]===0x0){return db[_0x5507('0x27')]['create']({'name':_0x5ef341[_0x5507('0x28')],'resourceId':_0x5ef341['id'],'type':_0x41f874[_0x5507('0x28')],'sectionId':_0x41f874['id']},{})[_0x5507('0x23')](function(){return _0x4e5825;});}else{return _0x4e5825;}})[_0x5507('0x45')](function(_0x300c9f){logger[_0x5507('0x4e')](_0x5507('0x4f'),_0x300c9f);throw _0x300c9f;});}return _0x4e5825;})[_0x5507('0x23')](respondWithResult(_0x549cf0,0xc9))[_0x5507('0x45')](handleError(_0x549cf0,null));};exports[_0x5507('0x22')]=function(_0x1bb575,_0x49a2f8){if(_0x1bb575['body']['id']){delete _0x1bb575[_0x5507('0x50')]['id'];}return db[_0x5507('0x2c')][_0x5507('0x48')]({'where':{'id':_0x1bb575[_0x5507('0x47')]['id']}})[_0x5507('0x23')](handleEntityNotFound(_0x49a2f8,null))[_0x5507('0x23')](saveUpdates(_0x1bb575[_0x5507('0x50')],null))[_0x5507('0x23')](respondWithResult(_0x49a2f8,null))[_0x5507('0x45')](handleError(_0x49a2f8,null));};exports[_0x5507('0x24')]=function(_0x40cda2,_0x13dc8b){return db[_0x5507('0x2c')][_0x5507('0x48')]({'where':{'id':_0x40cda2[_0x5507('0x47')]['id']}})[_0x5507('0x23')](handleEntityNotFound(_0x13dc8b,null))['then'](removeEntity(_0x13dc8b,null))[_0x5507('0x45')](handleError(_0x13dc8b,null));};exports['run']=function(_0x5af5f5,_0x42be15,_0xf15d25){var _0x132bf9=require(_0x5507('0x51'));return db['Schedule'][_0x5507('0x48')]({'where':{'id':_0x5af5f5[_0x5507('0x47')]['id']},'raw':!![]})[_0x5507('0x23')](handleEntityNotFound(_0x42be15,null))[_0x5507('0x23')](function(){_0x132bf9[_0x5507('0x52')](_0x5af5f5[_0x5507('0x47')]['id']);})['then'](respondWithStatusCode(_0x42be15,null))[_0x5507('0x45')](handleError(_0x42be15,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 13c0fc4..9b50d44 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 _0xec76=['Schedule','tools_schedules','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./schedule.attributes','define'];(function(_0xf8874b,_0x5e2940){var _0x11adcd=function(_0x331973){while(--_0x331973){_0xf8874b['push'](_0xf8874b['shift']());}};_0x11adcd(++_0x5e2940);}(_0xec76,0xec));var _0x6ec7=function(_0x2cfd16,_0x6fc52){_0x2cfd16=_0x2cfd16-0x0;var _0x1e43fd=_0xec76[_0x2cfd16];return _0x1e43fd;};'use strict';var _=require(_0x6ec7('0x0'));var util=require(_0x6ec7('0x1'));var logger=require(_0x6ec7('0x2'))(_0x6ec7('0x3'));var moment=require(_0x6ec7('0x4'));var BPromise=require(_0x6ec7('0x5'));var rp=require(_0x6ec7('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6ec7('0x7'));var config=require(_0x6ec7('0x8'));var attributes=require(_0x6ec7('0x9'));module['exports']=function(_0x5e222a,_0xeff83d){return _0x5e222a[_0x6ec7('0xa')](_0x6ec7('0xb'),attributes,{'tableName':_0x6ec7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfddf=['tools_schedules','lodash','api','moment','bluebird','request-promise','path','./schedule.attributes','exports','define','Schedule'];(function(_0x28f2dc,_0x2c300e){var _0x17b986=function(_0x131573){while(--_0x131573){_0x28f2dc['push'](_0x28f2dc['shift']());}};_0x17b986(++_0x2c300e);}(_0xfddf,0x135));var _0xffdd=function(_0x369bb7,_0xc64de6){_0x369bb7=_0x369bb7-0x0;var _0x359971=_0xfddf[_0x369bb7];return _0x359971;};'use strict';var _=require(_0xffdd('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xffdd('0x1'));var moment=require(_0xffdd('0x2'));var BPromise=require(_0xffdd('0x3'));var rp=require(_0xffdd('0x4'));var fs=require('fs');var path=require(_0xffdd('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xffdd('0x6'));module[_0xffdd('0x7')]=function(_0x38297b,_0x227a51){return _0x38297b[_0xffdd('0x8')](_0xffdd('0x9'),attributes,{'tableName':_0xffdd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js index 2720ed2..179df8f 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 _0x4e41=['Schedule,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','debug','Schedule,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0xde4c3d,_0xb2b7d7){var _0x43af56=function(_0x24fddb){while(--_0x24fddb){_0xde4c3d['push'](_0xde4c3d['shift']());}};_0x43af56(++_0xb2b7d7);}(_0x4e41,0x12e));var _0x14e4=function(_0x931979,_0x50cbfa){_0x931979=_0x931979-0x0;var _0x5b9a4b=_0x4e41[_0x931979];return _0x5b9a4b;};'use strict';var _=require(_0x14e4('0x0'));var util=require(_0x14e4('0x1'));var moment=require(_0x14e4('0x2'));var BPromise=require(_0x14e4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x14e4('0x4'));var db=require(_0x14e4('0x5'))['db'];var utils=require(_0x14e4('0x6'));var logger=require(_0x14e4('0x7'))(_0x14e4('0x8'));var config=require(_0x14e4('0x9'));var jayson=require(_0x14e4('0xa'));var client=jayson['client'][_0x14e4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xb43ac4,_0x17bddf,_0x599656){return new BPromise(function(_0x220cf5,_0x49f450){return client['request'](_0xb43ac4,_0x599656)[_0x14e4('0xc')](function(_0x20fc99){logger[_0x14e4('0xd')]('Schedule,\x20%s,\x20%s',_0x17bddf,'request\x20sent');logger[_0x14e4('0xe')](_0x14e4('0xf'),_0x17bddf,_0x14e4('0x10'),JSON[_0x14e4('0x11')](_0x20fc99));if(_0x20fc99[_0x14e4('0x12')]){if(_0x20fc99[_0x14e4('0x12')][_0x14e4('0x13')]===0x1f4){logger[_0x14e4('0x12')](_0x14e4('0x14'),_0x17bddf,_0x20fc99[_0x14e4('0x12')][_0x14e4('0x15')]);return _0x49f450(_0x20fc99['error'][_0x14e4('0x15')]);}logger[_0x14e4('0x12')](_0x14e4('0x14'),_0x17bddf,_0x20fc99['error'][_0x14e4('0x15')]);return _0x220cf5(_0x20fc99[_0x14e4('0x12')]['message']);}else{logger[_0x14e4('0xd')](_0x14e4('0x14'),_0x17bddf,_0x14e4('0x10'));_0x220cf5(_0x20fc99['result'][_0x14e4('0x15')]);}})[_0x14e4('0x16')](function(_0x539b1f){logger[_0x14e4('0x12')](_0x14e4('0x14'),_0x17bddf,_0x539b1f);_0x49f450(_0x539b1f);});});} \ No newline at end of file +var _0x110e=['../../config/environment','client','http','info','request\x20sent','debug','error','code','Schedule,\x20%s,\x20%s','message','catch','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x29fac0,_0x2587cc){var _0xf9b284=function(_0x3bae42){while(--_0x3bae42){_0x29fac0['push'](_0x29fac0['shift']());}};_0xf9b284(++_0x2587cc);}(_0x110e,0x13d));var _0xe110=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x110e[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0xe110('0x0'));var util=require(_0xe110('0x1'));var moment=require(_0xe110('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe110('0x3'))['db'];var utils=require(_0xe110('0x4'));var logger=require(_0xe110('0x5'))(_0xe110('0x6'));var config=require(_0xe110('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe110('0x8')][_0xe110('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x22fead,_0x4c4069,_0x2273ee){return new BPromise(function(_0x35ac76,_0x1e6b5a){return client['request'](_0x22fead,_0x2273ee)['then'](function(_0xc063eb){logger[_0xe110('0xa')]('Schedule,\x20%s,\x20%s',_0x4c4069,_0xe110('0xb'));logger[_0xe110('0xc')]('Schedule,\x20%s,\x20%s,\x20%s',_0x4c4069,_0xe110('0xb'),JSON['stringify'](_0xc063eb));if(_0xc063eb[_0xe110('0xd')]){if(_0xc063eb['error'][_0xe110('0xe')]===0x1f4){logger[_0xe110('0xd')](_0xe110('0xf'),_0x4c4069,_0xc063eb[_0xe110('0xd')]['message']);return _0x1e6b5a(_0xc063eb[_0xe110('0xd')][_0xe110('0x10')]);}logger[_0xe110('0xd')]('Schedule,\x20%s,\x20%s',_0x4c4069,_0xc063eb['error'][_0xe110('0x10')]);return _0x35ac76(_0xc063eb[_0xe110('0xd')][_0xe110('0x10')]);}else{logger[_0xe110('0xa')]('Schedule,\x20%s,\x20%s',_0x4c4069,'request\x20sent');_0x35ac76(_0xc063eb['result']['message']);}})[_0xe110('0x11')](function(_0x291b83){logger[_0xe110('0xd')](_0xe110('0xf'),_0x4c4069,_0x291b83);_0x1e6b5a(_0x291b83);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index ab2807f..a6e4480 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 _0x4f5d=['update','delete','/:id','destroy','exports','multer','util','connect-timeout','express','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','/describe','describe','/:id/download','download','post','create','put'];(function(_0x1d11ea,_0x19e83d){var _0x552d30=function(_0x3c04f7){while(--_0x3c04f7){_0x1d11ea['push'](_0x1d11ea['shift']());}};_0x552d30(++_0x19e83d);}(_0x4f5d,0x139));var _0xd4f5=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x4f5d[_0x16b9ed];return _0x66b1f8;};'use strict';var multer=require(_0xd4f5('0x0'));var util=require(_0xd4f5('0x1'));var path=require('path');var timeout=require(_0xd4f5('0x2'));var express=require(_0xd4f5('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xd4f5('0x4'));var config=require(_0xd4f5('0x5'));var controller=require(_0xd4f5('0x6'));router[_0xd4f5('0x7')]('/',auth[_0xd4f5('0x8')](),controller[_0xd4f5('0x9')]);router[_0xd4f5('0x7')](_0xd4f5('0xa'),auth[_0xd4f5('0x8')](),controller[_0xd4f5('0xb')]);router['get']('/:id',auth[_0xd4f5('0x8')](),controller['show']);router[_0xd4f5('0x7')](_0xd4f5('0xc'),auth[_0xd4f5('0x8')](),controller[_0xd4f5('0xd')]);router[_0xd4f5('0xe')]('/',auth[_0xd4f5('0x8')](),controller[_0xd4f5('0xf')]);router[_0xd4f5('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xd4f5('0x11')]);router[_0xd4f5('0x12')](_0xd4f5('0x13'),auth[_0xd4f5('0x8')](),controller[_0xd4f5('0x14')]);module[_0xd4f5('0x15')]=router; \ No newline at end of file +var _0x980c=['./screenRecording.controller','get','isAuthenticated','index','/describe','/:id','show','download','post','create','put','destroy','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x48d213,_0x400e7d){var _0x3dc0cd=function(_0x28bf85){while(--_0x28bf85){_0x48d213['push'](_0x48d213['shift']());}};_0x3dc0cd(++_0x400e7d);}(_0x980c,0x189));var _0xc980=function(_0x17242d,_0x3345ce){_0x17242d=_0x17242d-0x0;var _0x43836a=_0x980c[_0x17242d];return _0x43836a;};'use strict';var multer=require(_0xc980('0x0'));var util=require(_0xc980('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc980('0x2'));var router=express[_0xc980('0x3')]();var auth=require(_0xc980('0x4'));var interaction=require(_0xc980('0x5'));var config=require(_0xc980('0x6'));var controller=require(_0xc980('0x7'));router[_0xc980('0x8')]('/',auth[_0xc980('0x9')](),controller[_0xc980('0xa')]);router[_0xc980('0x8')](_0xc980('0xb'),auth[_0xc980('0x9')](),controller['describe']);router[_0xc980('0x8')](_0xc980('0xc'),auth['isAuthenticated'](),controller[_0xc980('0xd')]);router[_0xc980('0x8')]('/:id/download',auth[_0xc980('0x9')](),controller[_0xc980('0xe')]);router[_0xc980('0xf')]('/',auth[_0xc980('0x9')](),controller[_0xc980('0x10')]);router[_0xc980('0x11')](_0xc980('0xc'),auth[_0xc980('0x9')](),controller['update']);router['delete'](_0xc980('0xc'),auth[_0xc980('0x9')](),controller[_0xc980('0x12')]);module[_0xc980('0x13')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 5c5370e..5ce1263 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 _0x425d=['exports','VIRTUAL','getDataValue','value','extname','STRING','setDataValue','INTEGER','startedAt','subtract','closedAt','duration','DATE','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','updatedAt','sequelize','path','../../config/environment'];(function(_0x16b9f8,_0x1aa39f){var _0x3ef1f6=function(_0x412169){while(--_0x412169){_0x16b9f8['push'](_0x16b9f8['shift']());}};_0x3ef1f6(++_0x1aa39f);}(_0x425d,0x1e0));var _0xd425=function(_0x26df48,_0x22aa50){_0x26df48=_0x26df48-0x0;var _0x209047=_0x425d[_0x26df48];return _0x209047;};'use strict';var Sequelize=require(_0xd425('0x0'));var moment=require('moment');var path=require(_0xd425('0x1'));var config=require(_0xd425('0x2'));module[_0xd425('0x3')]={'format':{'type':Sequelize[_0xd425('0x4')],'get':function(){return this[_0xd425('0x5')](_0xd425('0x6'))?path[_0xd425('0x7')](this['getDataValue'](_0xd425('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0xd425('0x8')]},'channel':{'type':Sequelize[_0xd425('0x8')]},'value':{'type':Sequelize[_0xd425('0x8')],'set':function(_0x1d97d9){var _0x1d2ed0=_0x1d97d9['replace'](/\\/g,'/');this[_0xd425('0x9')](_0xd425('0x6'),_0x1d2ed0);}},'rating':{'type':Sequelize[_0xd425('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xd425('0xa')],'set':function(_0x2db9da){this[_0xd425('0x9')](_0xd425('0xb'),moment()[_0xd425('0xc')](_0x2db9da,'ms'));this[_0xd425('0x9')](_0xd425('0xd'),moment());this[_0xd425('0x9')](_0xd425('0xe'),_0x2db9da);}},'startedAt':{'type':Sequelize[_0xd425('0xf')],'get':function(){return moment(this[_0xd425('0x5')](_0xd425('0xb')))[_0xd425('0x10')](_0xd425('0x11'))[_0xd425('0x12')]();}},'closedAt':{'type':Sequelize[_0xd425('0xf')],'get':function(){return moment(this[_0xd425('0x5')]('closedAt'))[_0xd425('0x10')](_0xd425('0x11'))[_0xd425('0x12')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xd425('0x5')](_0xd425('0x13')))[_0xd425('0x10')](_0xd425('0x11'))[_0xd425('0x12')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xd425('0x5')](_0xd425('0x14')))[_0xd425('0x10')](_0xd425('0x11'))['toString']();}}}; \ No newline at end of file +var _0x00bb=['exports','getDataValue','value','replace','setDataValue','INTEGER','startedAt','subtract','closedAt','duration','format','MM-DD-YYYY\x20HH:mm','toString','DATE','createdAt','updatedAt','sequelize','moment','path'];(function(_0x3427dc,_0x2b9c60){var _0x1ca79e=function(_0x56c5f4){while(--_0x56c5f4){_0x3427dc['push'](_0x3427dc['shift']());}};_0x1ca79e(++_0x2b9c60);}(_0x00bb,0x1d8));var _0xb00b=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x00bb[_0x618414];return _0x21c19a;};'use strict';var Sequelize=require(_0xb00b('0x0'));var moment=require(_0xb00b('0x1'));var path=require(_0xb00b('0x2'));var config=require('../../config/environment');module[_0xb00b('0x3')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xb00b('0x4')](_0xb00b('0x5'))?path['extname'](this[_0xb00b('0x4')](_0xb00b('0x5'))):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize['STRING'],'set':function(_0x36e363){var _0xf737d0=_0x36e363[_0xb00b('0x6')](/\\/g,'/');this[_0xb00b('0x7')](_0xb00b('0x5'),_0xf737d0);}},'rating':{'type':Sequelize[_0xb00b('0x8')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x51d12b){this[_0xb00b('0x7')](_0xb00b('0x9'),moment()[_0xb00b('0xa')](_0x51d12b,'ms'));this[_0xb00b('0x7')](_0xb00b('0xb'),moment());this['setDataValue'](_0xb00b('0xc'),_0x51d12b);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue']('startedAt'))[_0xb00b('0xd')](_0xb00b('0xe'))[_0xb00b('0xf')]();}},'closedAt':{'type':Sequelize[_0xb00b('0x10')],'get':function(){return moment(this[_0xb00b('0x4')](_0xb00b('0xb')))['format'](_0xb00b('0xe'))[_0xb00b('0xf')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xb00b('0x4')](_0xb00b('0x11')))['format']('MM-DD-YYYY\x20HH:mm')[_0xb00b('0xf')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue'](_0xb00b('0x12')))[_0xb00b('0xd')](_0xb00b('0xe'))[_0xb00b('0xf')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index f437d29..6d59932 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 _0xa9e0=['value','describe','download','uniqueid','join','server/files/screen_recordings','%s.cypher','decryptFile','secrets','recording','existsSync','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','unlink','message','Not\x20found','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','map','ScreenRecording','rawAttributes','fieldName','type','key','differenceBy','format','keys','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','limit','sort','where','pick','merge','field','options','includeAll','include','catch','show','params','fields','find','create','body','duration','closedAt'];(function(_0x117f02,_0x20c66e){var _0x5d1f4b=function(_0x278e7f){while(--_0x278e7f){_0x117f02['push'](_0x117f02['shift']());}};_0x5d1f4b(++_0x20c66e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];function respondWithStatusCode(_0x36471c,_0xd5b662){_0xd5b662=_0xd5b662||0xcc;return function(_0x26d672){if(_0x26d672){return _0x36471c[_0x0a9e('0x14')](_0xd5b662);}return _0x36471c[_0x0a9e('0x15')](_0xd5b662)['end']();};}function respondWithResult(_0x4283ce,_0x239b12){_0x239b12=_0x239b12||0xc8;return function(_0x2b4227){if(_0x2b4227){return _0x4283ce[_0x0a9e('0x15')](_0x239b12)[_0x0a9e('0x16')](_0x2b4227);}};}function respondWithFilteredResult(_0x4d5611,_0x52a03d){return function(_0x22dccb){if(_0x22dccb){var _0x5d0880=_0x22dccb[_0x0a9e('0x17')],_0x1985b6=_0x52a03d['offset'],_0x519dfd=_0x52a03d[_0x0a9e('0x18')]+_0x52a03d['limit'],_0x16033c;if(_0x519dfd>=_0x5d0880){_0x519dfd=_0x5d0880;_0x16033c=0xc8;}else{_0x16033c=0xce;}_0x4d5611[_0x0a9e('0x15')](_0x16033c);return _0x4d5611[_0x0a9e('0x19')](_0x0a9e('0x1a'),_0x1985b6+'-'+_0x519dfd+'/'+_0x5d0880)[_0x0a9e('0x16')](_0x22dccb);}return null;};}function patchUpdates(_0x31b1ca){return function(_0x2eb11f){try{jsonpatch[_0x0a9e('0x1b')](_0x2eb11f,_0x31b1ca,!![]);}catch(_0x20559e){return BPromise[_0x0a9e('0x1c')](_0x20559e);}return _0x2eb11f[_0x0a9e('0x1d')]();};}function saveUpdates(_0x1c696a,_0x105080){return function(_0x4bb1e3){if(_0x4bb1e3){return _0x4bb1e3[_0x0a9e('0x1e')](_0x1c696a)[_0x0a9e('0x1f')](function(_0x53682f){return _0x53682f;});}return null;};}function removeEntity(_0x20f109,_0x5a09ef){return function(_0x588269){if(_0x588269){return _0x588269[_0x0a9e('0x20')]()[_0x0a9e('0x1f')](function(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x21')]();});}};}function handleEntityNotFound(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(!_0x2fb0e4){_0x4abc77[_0x0a9e('0x14')](0x194);}return _0x2fb0e4;};}function handleError(_0x4d00e6,_0x370d86){_0x370d86=_0x370d86||0x1f4;return function(_0x42ac8f){logger[_0x0a9e('0x22')](_0x42ac8f['stack']);if(_0x42ac8f['name']){delete _0x42ac8f[_0x0a9e('0x23')];}_0x4d00e6[_0x0a9e('0x15')](_0x370d86)[_0x0a9e('0x24')](_0x42ac8f);};}exports[_0x0a9e('0x25')]=function(_0x526cf3,_0x384319){var _0x479bc4={},_0x45a1e7={},_0x5bfb33={'count':0x0,'rows':[]};var _0x1dc186=_[_0x0a9e('0x26')](db[_0x0a9e('0x27')][_0x0a9e('0x28')],function(_0x140511){return{'name':_0x140511[_0x0a9e('0x29')],'type':_0x140511[_0x0a9e('0x2a')][_0x0a9e('0x2b')]};});_0x45a1e7['model']=_[_0x0a9e('0x2c')](_[_0x0a9e('0x26')](_0x1dc186,_0x0a9e('0x23')),[_0x0a9e('0x2d')]);_0x45a1e7['query']=_[_0x0a9e('0x2e')](_0x526cf3[_0x0a9e('0x2f')]);_0x45a1e7[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x45a1e7[_0x0a9e('0x32')],_0x45a1e7[_0x0a9e('0x2f')]);_0x479bc4[_0x0a9e('0x33')]=_[_0x0a9e('0x31')](_0x45a1e7[_0x0a9e('0x32')],qs['fields'](_0x526cf3[_0x0a9e('0x2f')]['fields']));_0x479bc4[_0x0a9e('0x33')]=_0x479bc4[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x479bc4[_0x0a9e('0x33')]:_0x45a1e7[_0x0a9e('0x32')];if(!_0x526cf3['query'][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x479bc4[_0x0a9e('0x37')]=qs[_0x0a9e('0x37')](_0x526cf3[_0x0a9e('0x2f')][_0x0a9e('0x37')]);_0x479bc4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x526cf3['query'][_0x0a9e('0x18')]);}_0x479bc4['order']=qs[_0x0a9e('0x38')](_0x526cf3[_0x0a9e('0x2f')][_0x0a9e('0x38')]);_0x479bc4[_0x0a9e('0x39')]=qs['filters'](_[_0x0a9e('0x3a')](_0x526cf3[_0x0a9e('0x2f')],_0x45a1e7[_0x0a9e('0x30')]));if(_0x526cf3[_0x0a9e('0x2f')]['filter']){_0x479bc4['where']=_[_0x0a9e('0x3b')](_0x479bc4['where'],{'$or':_[_0x0a9e('0x26')](_0x1dc186,function(_0x3d9717){if(_0x3d9717[_0x0a9e('0x2a')][_0x0a9e('0x2b')]!=='VIRTUAL'){var _0x31916f={};_0x31916f[_0x3d9717[_0x0a9e('0x3c')]]={'$like':'%'+_0x526cf3[_0x0a9e('0x2f')]['filter']+'%'};return _0x31916f;}})});}_0x479bc4=_[_0x0a9e('0x3b')]({},_0x479bc4,_0x526cf3[_0x0a9e('0x3d')]);var _0x289467={'where':_0x479bc4['where']};return db['ScreenRecording'][_0x0a9e('0x17')](_0x289467)[_0x0a9e('0x1f')](function(_0x5adda1){_0x5bfb33[_0x0a9e('0x17')]=_0x5adda1;if(_0x526cf3[_0x0a9e('0x2f')][_0x0a9e('0x3e')]){_0x479bc4[_0x0a9e('0x3f')]=[{'all':!![]}];}return db['ScreenRecording']['findAll'](_0x479bc4);})[_0x0a9e('0x1f')](function(_0x45b3d0){_0x5bfb33['rows']=_0x45b3d0;return _0x5bfb33;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x384319,_0x479bc4))[_0x0a9e('0x40')](handleError(_0x384319,null));};exports[_0x0a9e('0x41')]=function(_0x5b4f5e,_0x316c8f){var _0x2cfea9={'raw':![],'where':{'id':_0x5b4f5e[_0x0a9e('0x42')]['id']}},_0x274e8e={};_0x274e8e[_0x0a9e('0x32')]=_[_0x0a9e('0x2e')](db[_0x0a9e('0x27')][_0x0a9e('0x28')]);_0x274e8e[_0x0a9e('0x2f')]=_[_0x0a9e('0x2e')](_0x5b4f5e[_0x0a9e('0x2f')]);_0x274e8e[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x274e8e[_0x0a9e('0x32')],_0x274e8e[_0x0a9e('0x2f')]);_0x2cfea9['attributes']=_['intersection'](_0x274e8e[_0x0a9e('0x32')],qs[_0x0a9e('0x43')](_0x5b4f5e[_0x0a9e('0x2f')][_0x0a9e('0x43')]));_0x2cfea9[_0x0a9e('0x33')]=_0x2cfea9[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x2cfea9[_0x0a9e('0x33')]:_0x274e8e[_0x0a9e('0x32')];if(_0x5b4f5e[_0x0a9e('0x2f')][_0x0a9e('0x3e')]){_0x2cfea9[_0x0a9e('0x3f')]=[{'all':!![]}];}_0x2cfea9=_['merge']({},_0x2cfea9,_0x5b4f5e[_0x0a9e('0x3d')]);return db[_0x0a9e('0x27')][_0x0a9e('0x44')](_0x2cfea9)[_0x0a9e('0x1f')](handleEntityNotFound(_0x316c8f,null))[_0x0a9e('0x1f')](respondWithResult(_0x316c8f,null))[_0x0a9e('0x40')](handleError(_0x316c8f,null));};exports[_0x0a9e('0x45')]=function(_0x44dd99,_0x59afe8){return db[_0x0a9e('0x27')]['create'](_0x44dd99[_0x0a9e('0x46')],{})[_0x0a9e('0x1f')](respondWithResult(_0x59afe8,0xc9))[_0x0a9e('0x40')](handleError(_0x59afe8,null));};exports['update']=function(_0x14bec2,_0x7f6eb1){if(_0x14bec2[_0x0a9e('0x46')]['id']){delete _0x14bec2[_0x0a9e('0x46')]['id'];}delete _0x14bec2[_0x0a9e('0x46')][_0x0a9e('0x47')];delete _0x14bec2[_0x0a9e('0x46')]['createdAt'];delete _0x14bec2[_0x0a9e('0x46')][_0x0a9e('0x48')];delete _0x14bec2[_0x0a9e('0x46')][_0x0a9e('0x49')];return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x14bec2[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x7f6eb1,null))[_0x0a9e('0x1f')](saveUpdates(_0x14bec2['body'],null))[_0x0a9e('0x1f')](respondWithResult(_0x7f6eb1,null))[_0x0a9e('0x40')](handleError(_0x7f6eb1,null));};exports['destroy']=function(_0x4ae14b,_0x5ddf84){return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x4ae14b[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x5ddf84,null))[_0x0a9e('0x1f')](removeEntity(_0x5ddf84,null))[_0x0a9e('0x40')](handleError(_0x5ddf84,null));};exports[_0x0a9e('0x4a')]=function(_0x375c18,_0x5d38ae){return db['ScreenRecording']['describe']()[_0x0a9e('0x1f')](respondWithResult(_0x5d38ae,null))[_0x0a9e('0x40')](handleError(_0x5d38ae,null));};exports[_0x0a9e('0x4b')]=function(_0x5bb3ed,_0x2b69d9,_0x161aa7){var _0x53d113=require('../../components/encryptor');var _0x2ef381=![];var _0x59c6ff={};if(_0x5bb3ed[_0x0a9e('0x2f')]['type']&&_0x5bb3ed[_0x0a9e('0x2f')][_0x0a9e('0x2a')]===_0x0a9e('0x4c')){_0x59c6ff['uniqueid']=_0x5bb3ed[_0x0a9e('0x42')]['id'];}else{_0x59c6ff['id']=_0x5bb3ed[_0x0a9e('0x42')]['id'];}return db['ScreenRecording']['find']({'where':_0x59c6ff,'attributes':['id',_0x0a9e('0x49')],'raw':!![]})[_0x0a9e('0x1f')](handleEntityNotFound(_0x2b69d9,null))['then'](function(_0x145931){if(_0x145931){var _0x5ce9ac=path[_0x0a9e('0x4d')](config['root'],_0x0a9e('0x4e'),_0x145931['value']);var _0x5da27d=util['format'](_0x0a9e('0x4f'),_0x5ce9ac);if(fs['existsSync'](_0x5da27d)){_0x2ef381=!![];return _0x53d113[_0x0a9e('0x50')](_0x5da27d,_0x5ce9ac,config[_0x0a9e('0x51')][_0x0a9e('0x52')])[_0x0a9e('0x1f')](function(){return _0x145931;});}return _0x145931;}})[_0x0a9e('0x1f')](function(_0x272738){if(_0x272738){var _0xd10662=path[_0x0a9e('0x4d')](config['root'],_0x0a9e('0x4e'),_0x272738[_0x0a9e('0x49')]);if(!fs[_0x0a9e('0x53')](_0xd10662)){throw new db[(_0x0a9e('0x54'))][(_0x0a9e('0x55'))](_0x0a9e('0x56'));}if(_0x272738['filename']){return _0x2b69d9[_0x0a9e('0x4b')](_0xd10662,_0x272738[_0x0a9e('0x57')]+path['extname'](_0xd10662),function(){if(_0x2ef381){fs[_0x0a9e('0x58')](_0xd10662);}});}else{return _0x2b69d9['download'](_0xd10662,function(_0x20c668){if(_0x2ef381){fs['unlink'](_0xd10662);}});}}})['catch'](function(_0x5674ee){if(_0x5674ee[_0x0a9e('0x59')]==='ScreenRecording\x20not\x20found'){_0x2b69d9[_0x0a9e('0x15')](0x194)[_0x0a9e('0x24')](_0x0a9e('0x5a'));}else{return handleError(_0x2b69d9,null);}});}; \ No newline at end of file +var _0xa9e0=['value','describe','download','uniqueid','join','server/files/screen_recordings','%s.cypher','decryptFile','secrets','recording','existsSync','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','unlink','message','Not\x20found','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','map','ScreenRecording','rawAttributes','fieldName','type','key','differenceBy','format','keys','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','limit','sort','where','pick','merge','field','options','includeAll','include','catch','show','params','fields','find','create','body','duration','closedAt'];(function(_0x3caed5,_0x9bd6a5){var _0x11f9fc=function(_0x2e74d3){while(--_0x2e74d3){_0x3caed5['push'](_0x3caed5['shift']());}};_0x11f9fc(++_0x9bd6a5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];function respondWithStatusCode(_0x36471c,_0xd5b662){_0xd5b662=_0xd5b662||0xcc;return function(_0x26d672){if(_0x26d672){return _0x36471c[_0x0a9e('0x14')](_0xd5b662);}return _0x36471c[_0x0a9e('0x15')](_0xd5b662)['end']();};}function respondWithResult(_0x4283ce,_0x239b12){_0x239b12=_0x239b12||0xc8;return function(_0x2b4227){if(_0x2b4227){return _0x4283ce[_0x0a9e('0x15')](_0x239b12)[_0x0a9e('0x16')](_0x2b4227);}};}function respondWithFilteredResult(_0x4d5611,_0x52a03d){return function(_0x22dccb){if(_0x22dccb){var _0x5d0880=_0x22dccb[_0x0a9e('0x17')],_0x1985b6=_0x52a03d['offset'],_0x519dfd=_0x52a03d[_0x0a9e('0x18')]+_0x52a03d['limit'],_0x16033c;if(_0x519dfd>=_0x5d0880){_0x519dfd=_0x5d0880;_0x16033c=0xc8;}else{_0x16033c=0xce;}_0x4d5611[_0x0a9e('0x15')](_0x16033c);return _0x4d5611[_0x0a9e('0x19')](_0x0a9e('0x1a'),_0x1985b6+'-'+_0x519dfd+'/'+_0x5d0880)[_0x0a9e('0x16')](_0x22dccb);}return null;};}function patchUpdates(_0x31b1ca){return function(_0x2eb11f){try{jsonpatch[_0x0a9e('0x1b')](_0x2eb11f,_0x31b1ca,!![]);}catch(_0x20559e){return BPromise[_0x0a9e('0x1c')](_0x20559e);}return _0x2eb11f[_0x0a9e('0x1d')]();};}function saveUpdates(_0x1c696a,_0x105080){return function(_0x4bb1e3){if(_0x4bb1e3){return _0x4bb1e3[_0x0a9e('0x1e')](_0x1c696a)[_0x0a9e('0x1f')](function(_0x53682f){return _0x53682f;});}return null;};}function removeEntity(_0x20f109,_0x5a09ef){return function(_0x588269){if(_0x588269){return _0x588269[_0x0a9e('0x20')]()[_0x0a9e('0x1f')](function(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x21')]();});}};}function handleEntityNotFound(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(!_0x2fb0e4){_0x4abc77[_0x0a9e('0x14')](0x194);}return _0x2fb0e4;};}function handleError(_0x4d00e6,_0x370d86){_0x370d86=_0x370d86||0x1f4;return function(_0x42ac8f){logger[_0x0a9e('0x22')](_0x42ac8f['stack']);if(_0x42ac8f['name']){delete _0x42ac8f[_0x0a9e('0x23')];}_0x4d00e6[_0x0a9e('0x15')](_0x370d86)[_0x0a9e('0x24')](_0x42ac8f);};}exports[_0x0a9e('0x25')]=function(_0x526cf3,_0x384319){var _0x479bc4={},_0x45a1e7={},_0x5bfb33={'count':0x0,'rows':[]};var _0x1dc186=_[_0x0a9e('0x26')](db[_0x0a9e('0x27')][_0x0a9e('0x28')],function(_0x140511){return{'name':_0x140511[_0x0a9e('0x29')],'type':_0x140511[_0x0a9e('0x2a')][_0x0a9e('0x2b')]};});_0x45a1e7['model']=_[_0x0a9e('0x2c')](_[_0x0a9e('0x26')](_0x1dc186,_0x0a9e('0x23')),[_0x0a9e('0x2d')]);_0x45a1e7['query']=_[_0x0a9e('0x2e')](_0x526cf3[_0x0a9e('0x2f')]);_0x45a1e7[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x45a1e7[_0x0a9e('0x32')],_0x45a1e7[_0x0a9e('0x2f')]);_0x479bc4[_0x0a9e('0x33')]=_[_0x0a9e('0x31')](_0x45a1e7[_0x0a9e('0x32')],qs['fields'](_0x526cf3[_0x0a9e('0x2f')]['fields']));_0x479bc4[_0x0a9e('0x33')]=_0x479bc4[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x479bc4[_0x0a9e('0x33')]:_0x45a1e7[_0x0a9e('0x32')];if(!_0x526cf3['query'][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x479bc4[_0x0a9e('0x37')]=qs[_0x0a9e('0x37')](_0x526cf3[_0x0a9e('0x2f')][_0x0a9e('0x37')]);_0x479bc4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x526cf3['query'][_0x0a9e('0x18')]);}_0x479bc4['order']=qs[_0x0a9e('0x38')](_0x526cf3[_0x0a9e('0x2f')][_0x0a9e('0x38')]);_0x479bc4[_0x0a9e('0x39')]=qs['filters'](_[_0x0a9e('0x3a')](_0x526cf3[_0x0a9e('0x2f')],_0x45a1e7[_0x0a9e('0x30')]));if(_0x526cf3[_0x0a9e('0x2f')]['filter']){_0x479bc4['where']=_[_0x0a9e('0x3b')](_0x479bc4['where'],{'$or':_[_0x0a9e('0x26')](_0x1dc186,function(_0x3d9717){if(_0x3d9717[_0x0a9e('0x2a')][_0x0a9e('0x2b')]!=='VIRTUAL'){var _0x31916f={};_0x31916f[_0x3d9717[_0x0a9e('0x3c')]]={'$like':'%'+_0x526cf3[_0x0a9e('0x2f')]['filter']+'%'};return _0x31916f;}})});}_0x479bc4=_[_0x0a9e('0x3b')]({},_0x479bc4,_0x526cf3[_0x0a9e('0x3d')]);var _0x289467={'where':_0x479bc4['where']};return db['ScreenRecording'][_0x0a9e('0x17')](_0x289467)[_0x0a9e('0x1f')](function(_0x5adda1){_0x5bfb33[_0x0a9e('0x17')]=_0x5adda1;if(_0x526cf3[_0x0a9e('0x2f')][_0x0a9e('0x3e')]){_0x479bc4[_0x0a9e('0x3f')]=[{'all':!![]}];}return db['ScreenRecording']['findAll'](_0x479bc4);})[_0x0a9e('0x1f')](function(_0x45b3d0){_0x5bfb33['rows']=_0x45b3d0;return _0x5bfb33;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x384319,_0x479bc4))[_0x0a9e('0x40')](handleError(_0x384319,null));};exports[_0x0a9e('0x41')]=function(_0x5b4f5e,_0x316c8f){var _0x2cfea9={'raw':![],'where':{'id':_0x5b4f5e[_0x0a9e('0x42')]['id']}},_0x274e8e={};_0x274e8e[_0x0a9e('0x32')]=_[_0x0a9e('0x2e')](db[_0x0a9e('0x27')][_0x0a9e('0x28')]);_0x274e8e[_0x0a9e('0x2f')]=_[_0x0a9e('0x2e')](_0x5b4f5e[_0x0a9e('0x2f')]);_0x274e8e[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x274e8e[_0x0a9e('0x32')],_0x274e8e[_0x0a9e('0x2f')]);_0x2cfea9['attributes']=_['intersection'](_0x274e8e[_0x0a9e('0x32')],qs[_0x0a9e('0x43')](_0x5b4f5e[_0x0a9e('0x2f')][_0x0a9e('0x43')]));_0x2cfea9[_0x0a9e('0x33')]=_0x2cfea9[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x2cfea9[_0x0a9e('0x33')]:_0x274e8e[_0x0a9e('0x32')];if(_0x5b4f5e[_0x0a9e('0x2f')][_0x0a9e('0x3e')]){_0x2cfea9[_0x0a9e('0x3f')]=[{'all':!![]}];}_0x2cfea9=_['merge']({},_0x2cfea9,_0x5b4f5e[_0x0a9e('0x3d')]);return db[_0x0a9e('0x27')][_0x0a9e('0x44')](_0x2cfea9)[_0x0a9e('0x1f')](handleEntityNotFound(_0x316c8f,null))[_0x0a9e('0x1f')](respondWithResult(_0x316c8f,null))[_0x0a9e('0x40')](handleError(_0x316c8f,null));};exports[_0x0a9e('0x45')]=function(_0x44dd99,_0x59afe8){return db[_0x0a9e('0x27')]['create'](_0x44dd99[_0x0a9e('0x46')],{})[_0x0a9e('0x1f')](respondWithResult(_0x59afe8,0xc9))[_0x0a9e('0x40')](handleError(_0x59afe8,null));};exports['update']=function(_0x14bec2,_0x7f6eb1){if(_0x14bec2[_0x0a9e('0x46')]['id']){delete _0x14bec2[_0x0a9e('0x46')]['id'];}delete _0x14bec2[_0x0a9e('0x46')][_0x0a9e('0x47')];delete _0x14bec2[_0x0a9e('0x46')]['createdAt'];delete _0x14bec2[_0x0a9e('0x46')][_0x0a9e('0x48')];delete _0x14bec2[_0x0a9e('0x46')][_0x0a9e('0x49')];return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x14bec2[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x7f6eb1,null))[_0x0a9e('0x1f')](saveUpdates(_0x14bec2['body'],null))[_0x0a9e('0x1f')](respondWithResult(_0x7f6eb1,null))[_0x0a9e('0x40')](handleError(_0x7f6eb1,null));};exports['destroy']=function(_0x4ae14b,_0x5ddf84){return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x4ae14b[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x5ddf84,null))[_0x0a9e('0x1f')](removeEntity(_0x5ddf84,null))[_0x0a9e('0x40')](handleError(_0x5ddf84,null));};exports[_0x0a9e('0x4a')]=function(_0x375c18,_0x5d38ae){return db['ScreenRecording']['describe']()[_0x0a9e('0x1f')](respondWithResult(_0x5d38ae,null))[_0x0a9e('0x40')](handleError(_0x5d38ae,null));};exports[_0x0a9e('0x4b')]=function(_0x5bb3ed,_0x2b69d9,_0x161aa7){var _0x53d113=require('../../components/encryptor');var _0x2ef381=![];var _0x59c6ff={};if(_0x5bb3ed[_0x0a9e('0x2f')]['type']&&_0x5bb3ed[_0x0a9e('0x2f')][_0x0a9e('0x2a')]===_0x0a9e('0x4c')){_0x59c6ff['uniqueid']=_0x5bb3ed[_0x0a9e('0x42')]['id'];}else{_0x59c6ff['id']=_0x5bb3ed[_0x0a9e('0x42')]['id'];}return db['ScreenRecording']['find']({'where':_0x59c6ff,'attributes':['id',_0x0a9e('0x49')],'raw':!![]})[_0x0a9e('0x1f')](handleEntityNotFound(_0x2b69d9,null))['then'](function(_0x145931){if(_0x145931){var _0x5ce9ac=path[_0x0a9e('0x4d')](config['root'],_0x0a9e('0x4e'),_0x145931['value']);var _0x5da27d=util['format'](_0x0a9e('0x4f'),_0x5ce9ac);if(fs['existsSync'](_0x5da27d)){_0x2ef381=!![];return _0x53d113[_0x0a9e('0x50')](_0x5da27d,_0x5ce9ac,config[_0x0a9e('0x51')][_0x0a9e('0x52')])[_0x0a9e('0x1f')](function(){return _0x145931;});}return _0x145931;}})[_0x0a9e('0x1f')](function(_0x272738){if(_0x272738){var _0xd10662=path[_0x0a9e('0x4d')](config['root'],_0x0a9e('0x4e'),_0x272738[_0x0a9e('0x49')]);if(!fs[_0x0a9e('0x53')](_0xd10662)){throw new db[(_0x0a9e('0x54'))][(_0x0a9e('0x55'))](_0x0a9e('0x56'));}if(_0x272738['filename']){return _0x2b69d9[_0x0a9e('0x4b')](_0xd10662,_0x272738[_0x0a9e('0x57')]+path['extname'](_0xd10662),function(){if(_0x2ef381){fs[_0x0a9e('0x58')](_0xd10662);}});}else{return _0x2b69d9['download'](_0xd10662,function(_0x20c668){if(_0x2ef381){fs['unlink'](_0xd10662);}});}}})['catch'](function(_0x5674ee){if(_0x5674ee[_0x0a9e('0x59')]==='ScreenRecording\x20not\x20found'){_0x2b69d9[_0x0a9e('0x15')](0x194)[_0x0a9e('0x24')](_0x0a9e('0x5a'));}else{return handleError(_0x2b69d9,null);}});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index be3b176..a87cbeb 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 _0x5e19=['root','server','files','screen_recordings','existsSync','log','resolve','finally','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./screenRecording.attributes','exports','define','ScreenRecording','interactionid','isNil','join'];(function(_0x4ae6b3,_0x1ec1b6){var _0x28479f=function(_0x367720){while(--_0x367720){_0x4ae6b3['push'](_0x4ae6b3['shift']());}};_0x28479f(++_0x1ec1b6);}(_0x5e19,0xd7));var _0x95e1=function(_0x4ea831,_0x5d47d8){_0x4ea831=_0x4ea831-0x0;var _0x5485b9=_0x5e19[_0x4ea831];return _0x5485b9;};'use strict';var _=require(_0x95e1('0x0'));var util=require('util');var logger=require(_0x95e1('0x1'))(_0x95e1('0x2'));var moment=require(_0x95e1('0x3'));var BPromise=require(_0x95e1('0x4'));var rp=require(_0x95e1('0x5'));var fs=require('fs');var path=require(_0x95e1('0x6'));var rimraf=require(_0x95e1('0x7'));var config=require('../../config/environment');var attributes=require(_0x95e1('0x8'));module[_0x95e1('0x9')]=function(_0x5500c1,_0x29e760){return _0x5500c1[_0x95e1('0xa')](_0x95e1('0xb'),attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':_0x95e1('0xc'),'fields':['interactionid']}],'timestamps':!![],'hooks':{'afterDestroy':function(_0x446e51,_0x3eea04,_0x3a0ebc){return new BPromise(function(_0x5830b2,_0x24cdb9){if(!_[_0x95e1('0xd')](_0x446e51['value'])){var _0x566cd4=path[_0x95e1('0xe')](config[_0x95e1('0xf')],_0x95e1('0x10'),_0x95e1('0x11'),_0x95e1('0x12'),_0x446e51['value']);if(fs[_0x95e1('0x13')](_0x566cd4)){rimraf(_0x566cd4,function(_0x8ef7fd){if(_0x8ef7fd){console[_0x95e1('0x14')](_0x8ef7fd);}});}}_0x5830b2();})['catch'](function(_0x5d39b0){BPromise[_0x95e1('0x15')]();})[_0x95e1('0x16')](function(){_0x3a0ebc();});}}});}; \ No newline at end of file +var _0xe47b=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./screenRecording.attributes','exports','define','ScreenRecording','interactionid','isNil','value','files','existsSync','log','catch','resolve','finally'];(function(_0x33138c,_0x444695){var _0x21554a=function(_0xc6f4d4){while(--_0xc6f4d4){_0x33138c['push'](_0x33138c['shift']());}};_0x21554a(++_0x444695);}(_0xe47b,0x11e));var _0xbe47=function(_0x4a1641,_0x12e977){_0x4a1641=_0x4a1641-0x0;var _0x4a808b=_0xe47b[_0x4a1641];return _0x4a808b;};'use strict';var _=require(_0xbe47('0x0'));var util=require('util');var logger=require(_0xbe47('0x1'))(_0xbe47('0x2'));var moment=require(_0xbe47('0x3'));var BPromise=require(_0xbe47('0x4'));var rp=require(_0xbe47('0x5'));var fs=require('fs');var path=require(_0xbe47('0x6'));var rimraf=require(_0xbe47('0x7'));var config=require(_0xbe47('0x8'));var attributes=require(_0xbe47('0x9'));module[_0xbe47('0xa')]=function(_0x24ae86,_0x326492){return _0x24ae86[_0xbe47('0xb')](_0xbe47('0xc'),attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':_0xbe47('0xd'),'fields':['interactionid']}],'timestamps':!![],'hooks':{'afterDestroy':function(_0x9875d8,_0x1af617,_0x3e3d85){return new BPromise(function(_0x360e7f,_0x12ff46){if(!_[_0xbe47('0xe')](_0x9875d8[_0xbe47('0xf')])){var _0x16c66f=path['join'](config['root'],'server',_0xbe47('0x10'),'screen_recordings',_0x9875d8[_0xbe47('0xf')]);if(fs[_0xbe47('0x11')](_0x16c66f)){rimraf(_0x16c66f,function(_0x393bbf){if(_0x393bbf){console[_0xbe47('0x12')](_0x393bbf);}});}}_0x360e7f();})[_0xbe47('0x13')](function(_0x352272){BPromise[_0xbe47('0x14')]();})[_0xbe47('0x15')](function(){_0x3e3d85();});}}});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 0a85c97..2aaf209 100644 --- a/server/api/screenRecording/screenRecording.rpc.js +++ b/server/api/screenRecording/screenRecording.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['http','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2224de,_0xab9553){var _0x1ed749=function(_0x3ecda5){while(--_0x3ecda5){_0x2224de['push'](_0x2224de['shift']());}};_0x1ed749(++_0xab9553);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +var _0xa9e0=['http','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x103880,_0x32cbe5){var _0xb9eeab=function(_0x518f4a){while(--_0x518f4a){_0x103880['push'](_0x103880['shift']());}};_0xb9eeab(++_0x32cbe5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 2798602..d18b03a 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 _0xaabb=['getPreferred','/:id/favicon','getFavicon','diskStorage','root','server/files/images/logos/','%s%s','originalname','post','single','file','addLogo','join','format','logologin','extname','addLogoLogin','preferred','/:id/preferred','addPreferred','addFavicon','put','isAuthenticated','update','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./setting.controller','get','/:id','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr'];(function(_0x357728,_0x238539){var _0x34a5d5=function(_0x59d5bc){while(--_0x59d5bc){_0x357728['push'](_0x357728['shift']());}};_0x34a5d5(++_0x238539);}(_0xaabb,0xe6));var _0xbaab=function(_0x5108fb,_0x53b8d2){_0x5108fb=_0x5108fb-0x0;var _0x35fee7=_0xaabb[_0x5108fb];return _0x35fee7;};'use strict';var multer=require('multer');var util=require(_0xbaab('0x0'));var path=require('path');var timeout=require(_0xbaab('0x1'));var express=require(_0xbaab('0x2'));var router=express[_0xbaab('0x3')]();var auth=require(_0xbaab('0x4'));var interaction=require(_0xbaab('0x5'));var config=require('../../config/environment');var controller=require(_0xbaab('0x6'));router[_0xbaab('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xbaab('0x7')](_0xbaab('0x8'),controller[_0xbaab('0x9')]);router['get'](_0xbaab('0xa'),controller[_0xbaab('0xb')]);router[_0xbaab('0x7')](_0xbaab('0xc'),controller[_0xbaab('0xd')]);router[_0xbaab('0x7')](_0xbaab('0xe'),controller[_0xbaab('0xf')]);router[_0xbaab('0x7')]('/:id/preferred',controller[_0xbaab('0x10')]);router[_0xbaab('0x7')](_0xbaab('0x11'),controller[_0xbaab('0x12')]);var upload=multer({'storage':multer[_0xbaab('0x13')]({'destination':function(_0x3266b4,_0x540ca7,_0x11bcbd){_0x11bcbd(null,path['join'](config[_0xbaab('0x14')],_0xbaab('0x15')));},'filename':function(_0x727faf,_0x2099a1,_0x337b5f){_0x337b5f(null,util['format'](_0xbaab('0x16'),'logo',path['extname'](_0x2099a1[_0xbaab('0x17')])));}})});router[_0xbaab('0x18')](_0xbaab('0xa'),upload[_0xbaab('0x19')](_0xbaab('0x1a')),controller[_0xbaab('0x1b')]);var upload=multer({'storage':multer[_0xbaab('0x13')]({'destination':function(_0x29634d,_0x56b1f5,_0x31848f){_0x31848f(null,path[_0xbaab('0x1c')](config[_0xbaab('0x14')],_0xbaab('0x15')));},'filename':function(_0x486171,_0x336953,_0x70b1d0){_0x70b1d0(null,util[_0xbaab('0x1d')](_0xbaab('0x16'),_0xbaab('0x1e'),path[_0xbaab('0x1f')](_0x336953[_0xbaab('0x17')])));}})});router['post'](_0xbaab('0xc'),upload[_0xbaab('0x19')]('file'),controller[_0xbaab('0x20')]);var upload=multer({'storage':multer[_0xbaab('0x13')]({'destination':function(_0x40b9b1,_0x1b6900,_0x333de6){_0x333de6(null,path[_0xbaab('0x1c')](config[_0xbaab('0x14')],_0xbaab('0x15')));},'filename':function(_0x20b09b,_0x3e7c24,_0x55707b){_0x55707b(null,util[_0xbaab('0x1d')]('%s%s',_0xbaab('0x21'),path[_0xbaab('0x1f')](_0x3e7c24[_0xbaab('0x17')])));}})});router[_0xbaab('0x18')](_0xbaab('0x22'),upload[_0xbaab('0x19')](_0xbaab('0x1a')),controller[_0xbaab('0x23')]);var upload=multer({'storage':multer[_0xbaab('0x13')]({'destination':function(_0x1240d2,_0x2c7c78,_0x22328c){_0x22328c(null,path[_0xbaab('0x1c')](config[_0xbaab('0x14')],_0xbaab('0x15')));},'filename':function(_0x4dd6dd,_0x318c2e,_0x232926){_0x232926(null,util[_0xbaab('0x1d')](_0xbaab('0x16'),'favicon',path[_0xbaab('0x1f')](_0x318c2e[_0xbaab('0x17')])));}})});router['post']('/:id/favicon',upload['single'](_0xbaab('0x1a')),controller[_0xbaab('0x24')]);router[_0xbaab('0x25')](_0xbaab('0x8'),auth[_0xbaab('0x26')](),controller[_0xbaab('0x27')]);module[_0xbaab('0x28')]=router; \ No newline at end of file +var _0x2c8b=['show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','join','server/files/images/logos/','format','%s%s','logo','extname','originalname','post','single','file','addLogo','root','addLogoLogin','preferred','addPreferred','addFavicon','put','update','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','index','/:id'];(function(_0x40c010,_0x4e903d){var _0x17921b=function(_0x1f094f){while(--_0x1f094f){_0x40c010['push'](_0x40c010['shift']());}};_0x17921b(++_0x4e903d);}(_0x2c8b,0x198));var _0xb2c8=function(_0x1ec183,_0xe42aba){_0x1ec183=_0x1ec183-0x0;var _0x237b7c=_0x2c8b[_0x1ec183];return _0x237b7c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb2c8('0x0'));var timeout=require(_0xb2c8('0x1'));var express=require(_0xb2c8('0x2'));var router=express[_0xb2c8('0x3')]();var auth=require(_0xb2c8('0x4'));var interaction=require(_0xb2c8('0x5'));var config=require(_0xb2c8('0x6'));var controller=require(_0xb2c8('0x7'));router[_0xb2c8('0x8')]('/',auth[_0xb2c8('0x9')](),controller[_0xb2c8('0xa')]);router[_0xb2c8('0x8')](_0xb2c8('0xb'),controller[_0xb2c8('0xc')]);router[_0xb2c8('0x8')](_0xb2c8('0xd'),controller[_0xb2c8('0xe')]);router[_0xb2c8('0x8')](_0xb2c8('0xf'),controller[_0xb2c8('0x10')]);router['get'](_0xb2c8('0x11'),controller[_0xb2c8('0x12')]);router[_0xb2c8('0x8')](_0xb2c8('0x13'),controller[_0xb2c8('0x14')]);router['get'](_0xb2c8('0x15'),controller[_0xb2c8('0x16')]);var upload=multer({'storage':multer[_0xb2c8('0x17')]({'destination':function(_0x5b27b5,_0x3e630c,_0x5c6136){_0x5c6136(null,path[_0xb2c8('0x18')](config['root'],_0xb2c8('0x19')));},'filename':function(_0x7755e8,_0x245272,_0x267a6e){_0x267a6e(null,util[_0xb2c8('0x1a')](_0xb2c8('0x1b'),_0xb2c8('0x1c'),path[_0xb2c8('0x1d')](_0x245272[_0xb2c8('0x1e')])));}})});router[_0xb2c8('0x1f')]('/:id/logo',upload[_0xb2c8('0x20')](_0xb2c8('0x21')),controller[_0xb2c8('0x22')]);var upload=multer({'storage':multer[_0xb2c8('0x17')]({'destination':function(_0x3913ab,_0x482173,_0x1f131b){_0x1f131b(null,path[_0xb2c8('0x18')](config[_0xb2c8('0x23')],_0xb2c8('0x19')));},'filename':function(_0x1d8ff9,_0x5f74c0,_0x3b1c9c){_0x3b1c9c(null,util['format'](_0xb2c8('0x1b'),'logologin',path['extname'](_0x5f74c0[_0xb2c8('0x1e')])));}})});router['post'](_0xb2c8('0xf'),upload[_0xb2c8('0x20')](_0xb2c8('0x21')),controller[_0xb2c8('0x24')]);var upload=multer({'storage':multer[_0xb2c8('0x17')]({'destination':function(_0x429e91,_0x2e7568,_0x44da8b){_0x44da8b(null,path[_0xb2c8('0x18')](config[_0xb2c8('0x23')],'server/files/images/logos/'));},'filename':function(_0x508476,_0x42929d,_0x185c8a){_0x185c8a(null,util[_0xb2c8('0x1a')](_0xb2c8('0x1b'),_0xb2c8('0x25'),path[_0xb2c8('0x1d')](_0x42929d[_0xb2c8('0x1e')])));}})});router[_0xb2c8('0x1f')]('/:id/preferred',upload[_0xb2c8('0x20')]('file'),controller[_0xb2c8('0x26')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x580115,_0x1f2ddf,_0x113556){_0x113556(null,path[_0xb2c8('0x18')](config['root'],_0xb2c8('0x19')));},'filename':function(_0x3515ce,_0x155358,_0xd3f43c){_0xd3f43c(null,util[_0xb2c8('0x1a')](_0xb2c8('0x1b'),'favicon',path[_0xb2c8('0x1d')](_0x155358[_0xb2c8('0x1e')])));}})});router['post'](_0xb2c8('0x15'),upload[_0xb2c8('0x20')](_0xb2c8('0x21')),controller[_0xb2c8('0x27')]);router[_0xb2c8('0x28')](_0xb2c8('0xb'),auth[_0xb2c8('0x9')](),controller[_0xb2c8('0x29')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index ec91f0d..831c255 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 _0x390c=['https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','sequelize','exports','INTEGER','/var/opt/motion2/server/files/sounds/converted','STRING','BOOLEAN'];(function(_0x507fb9,_0xc1dd73){var _0x68007=function(_0x25e9cc){while(--_0x25e9cc){_0x507fb9['push'](_0x507fb9['shift']());}};_0x68007(++_0xc1dd73);}(_0x390c,0x17a));var _0xc390=function(_0x5043f2,_0x64d10b){_0x5043f2=_0x5043f2-0x0;var _0x139541=_0x390c[_0x5043f2];return _0x139541;};'use strict';var Sequelize=require(_0xc390('0x0'));module[_0xc390('0x1')]={'min_internal':{'type':Sequelize[_0xc390('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0xc390('0x2')](0xb),'unique':'min_mailbox','defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0xc390('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize['STRING'],'defaultValue':_0xc390('0x3')},'logo':{'type':Sequelize[_0xc390('0x4')]},'defaultLogo':{'type':Sequelize[_0xc390('0x5')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0xc390('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize['STRING']},'defaultHeaderWhiteLabel':{'type':Sequelize[_0xc390('0x5')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0xc390('0x5')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0xc390('0x5')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0xc390('0x4')]},'turnaddr':{'type':Sequelize[_0xc390('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0xc390('0x4')]},'defaultPageTitle':{'type':Sequelize[_0xc390('0x5')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0xc390('0x5')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0xc390('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0xc390('0x5')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':_0xc390('0x6')},'enableEmailPreview':{'type':Sequelize[_0xc390('0x5')],'defaultValue':![]},'split':{'type':Sequelize[_0xc390('0x5')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0xc390('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0xc390('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0xc390('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0xc390('0x4')],'defaultValue':_0xc390('0x7')},'chatTimeout':{'type':Sequelize[_0xc390('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0xc390('0x5')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0xc390('0x4')]},'defaultPreferred':{'type':Sequelize[_0xc390('0x5')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0xc390('0x5')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0xc390('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0xc390('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0xc390('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0xc390('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0xc390('0x2')],'defaultValue':0xa,'validate':{'min':0xa}}}; \ No newline at end of file +var _0x5517=['BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','sequelize','exports','min_internal','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x13874a,_0x15f40a){var _0x21f232=function(_0x58c3f3){while(--_0x58c3f3){_0x13874a['push'](_0x13874a['shift']());}};_0x21f232(++_0x15f40a);}(_0x5517,0xad));var _0x7551=function(_0x21f203,_0x390407){_0x21f203=_0x21f203-0x0;var _0x2b918f=_0x5517[_0x21f203];return _0x2b918f;};'use strict';var Sequelize=require(_0x7551('0x0'));module[_0x7551('0x1')]={'min_internal':{'type':Sequelize['INTEGER'](0xb),'unique':_0x7551('0x2'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x7551('0x3')](0xb),'unique':_0x7551('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x7551('0x3')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x7551('0x5')],'defaultValue':_0x7551('0x6')},'logo':{'type':Sequelize[_0x7551('0x5')]},'defaultLogo':{'type':Sequelize[_0x7551('0x7')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x7551('0x5')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize['STRING']},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x7551('0x7')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x7551('0x7')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x7551('0x7')],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x7551('0x5')]},'turnusername':{'type':Sequelize[_0x7551('0x5')]},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize['STRING']},'defaultPageTitle':{'type':Sequelize[_0x7551('0x7')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x7551('0x7')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x7551('0x7')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x7551('0x5')],'defaultValue':_0x7551('0x8')},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize[_0x7551('0x7')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x7551('0x3')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x7551('0x3')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x7551('0x5')],'defaultValue':_0x7551('0x9')},'chatTimeout':{'type':Sequelize[_0x7551('0x3')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x7551('0x5')]},'defaultPreferred':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x7551('0x7')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x7551('0x5')]},'allowedLoginAttempts':{'type':Sequelize[_0x7551('0x3')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x7551('0x3')],'defaultValue':0xa},'favicon':{'type':Sequelize['STRING']},'defaultFavicon':{'type':Sequelize[_0x7551('0x7')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x7551('0x3')],'defaultValue':0xa,'validate':{'min':0xa}}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index ca1c875..7527f34 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 _0x12c9=['../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','jayson/promise','client','test','request','then','info','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','Setting,\x20%s,\x20%s','message','catch','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','sendStatus','name','index','map','Setting','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','filters','pick','filter','where','VIRTUAL','field','includeAll','findAll','rows','show','params','include','merge','find','body','get','server/files/templates/stun.ejs','render','readFileSync','join','root','utf8','writeFileSync','/etc/asterisk/stun_xcally.conf','/etc/asterisk/turn_xcally.conf','Reload','res_stun_monitor.so','res_rtp_asterisk.so','addLogo','file','filename','addLogoLogin','loginLogo','../../config/license/util','getLogo','server/files/images/logos','getLicense','logo','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','toLower','default_logo.png','default','upperFirst','custom','ValidationError','\x20not\x20found','download','getLogoLogin','default_loginLogo.png','Sequelize','gdpr','addPreferred','getPreferred','default_preferred.png','default_favicon.ico','html-pdf','eml-format','rimraf','zip-dir','moment','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x12c9,0x16d));var _0x912c=function(_0x1b8852,_0x2c9117){_0x1b8852=_0x1b8852-0x0;var _0x5764f5=_0x12c9[_0x1b8852];return _0x5764f5;};'use strict';var pdf=require(_0x912c('0x0'));var emlformat=require(_0x912c('0x1'));var rimraf=require(_0x912c('0x2'));var zipdir=require(_0x912c('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x912c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x912c('0x5'));var util=require(_0x912c('0x6'));var path=require('path');var sox=require(_0x912c('0x7'));var csv=require(_0x912c('0x8'));var ejs=require(_0x912c('0x9'));var fs=require('fs');var _=require(_0x912c('0xa'));var squel=require(_0x912c('0xb'));var crypto=require(_0x912c('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x912c('0xd'));var toCsv=require(_0x912c('0x8'));var querystring=require(_0x912c('0xe'));var Papa=require(_0x912c('0xf'));var Redis=require(_0x912c('0x10'));var authService=require(_0x912c('0x11'));var qs=require(_0x912c('0x12'));var as=require(_0x912c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x912c('0x14'))('api');var utils=require(_0x912c('0x15'));var config=require('../../config/environment');var db=require(_0x912c('0x16'))['db'];var jayson=require(_0x912c('0x17'));var client=jayson[_0x912c('0x18')]['http']({'port':0x232a});function checkPasswordPattern(_0x4af597,_0xe63217,_0x152699){if(_0x152699){var _0x353dc0=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x353dc0[_0x912c('0x19')](_0xe63217)){return _0x4af597;}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 _0x4af597;}}function respondWithRpcPromise(_0x106d42,_0x3425ab,_0x59f592,_0x402bd9){return new BPromise(function(_0x18be53,_0x481735){var _0x1517f3=_0x402bd9||client;return _0x1517f3[_0x912c('0x1a')](_0x106d42,_0x59f592)[_0x912c('0x1b')](function(_0x325673){logger[_0x912c('0x1c')]('Setting,\x20%s,\x20%s',_0x3425ab,_0x912c('0x1d'));logger[_0x912c('0x1e')](_0x912c('0x1f'),_0x3425ab,_0x912c('0x1d'),JSON[_0x912c('0x20')](_0x325673));if(_0x325673['error']){if(_0x325673[_0x912c('0x21')]['code']===0x1f4){logger['error'](_0x912c('0x22'),_0x3425ab,_0x325673[_0x912c('0x21')][_0x912c('0x23')]);return _0x481735(_0x325673[_0x912c('0x21')][_0x912c('0x23')]);}logger[_0x912c('0x21')](_0x912c('0x22'),_0x3425ab,_0x325673[_0x912c('0x21')][_0x912c('0x23')]);return _0x18be53(_0x325673['error']['message']);}else{logger[_0x912c('0x1c')](_0x912c('0x22'),_0x3425ab,'request\x20sent');_0x18be53(_0x325673['result']['message']);}})[_0x912c('0x24')](function(_0x508e03){logger[_0x912c('0x21')](_0x912c('0x22'),_0x3425ab,_0x508e03);_0x481735(_0x508e03);});});}function respondWithStatusCode(_0xf2fa1c,_0x115e50){_0x115e50=_0x115e50||0xcc;return function(_0x52508c){if(_0x52508c){return _0xf2fa1c['sendStatus'](_0x115e50);}return _0xf2fa1c[_0x912c('0x25')](_0x115e50)[_0x912c('0x26')]();};}function respondWithResult(_0x432b2f,_0x383d80){_0x383d80=_0x383d80||0xc8;return function(_0x67b123){if(_0x67b123){return _0x432b2f[_0x912c('0x25')](_0x383d80)[_0x912c('0x27')](_0x67b123);}};}function respondWithFilteredResult(_0x3452a6,_0xefdaec){return function(_0xabb5e2){if(_0xabb5e2){var _0x2afef2=_0xabb5e2[_0x912c('0x28')],_0x1cc7e8=_0xefdaec[_0x912c('0x29')],_0x560e73=_0xefdaec[_0x912c('0x29')]+_0xefdaec[_0x912c('0x2a')],_0x4a4362;if(_0x560e73>=_0x2afef2){_0x560e73=_0x2afef2;_0x4a4362=0xc8;}else{_0x4a4362=0xce;}_0x3452a6['status'](_0x4a4362);return _0x3452a6[_0x912c('0x2b')](_0x912c('0x2c'),_0x1cc7e8+'-'+_0x560e73+'/'+_0x2afef2)[_0x912c('0x27')](_0xabb5e2);}return null;};}function patchUpdates(_0x4d5630){return function(_0x368c6c){try{jsonpatch[_0x912c('0x2d')](_0x368c6c,_0x4d5630,!![]);}catch(_0x2e2102){return BPromise[_0x912c('0x2e')](_0x2e2102);}return _0x368c6c[_0x912c('0x2f')]();};}function saveUpdates(_0x1170c0,_0x2257d8){return function(_0x42110c){if(_0x42110c){return _0x42110c[_0x912c('0x30')](_0x1170c0)['then'](function(_0x481219){return _0x481219;});}return null;};}function removeEntity(_0x35d1fc,_0x11ffbf){return function(_0x5ae022){if(_0x5ae022){return _0x5ae022['destroy']()[_0x912c('0x1b')](function(){_0x35d1fc[_0x912c('0x25')](0xcc)[_0x912c('0x26')]();});}};}function handleEntityNotFound(_0xbc3b98,_0xdbd18d){return function(_0x41ac43){if(!_0x41ac43){_0xbc3b98[_0x912c('0x31')](0x194);}return _0x41ac43;};}function handleError(_0x5a6b5c,_0x20a4c1){_0x20a4c1=_0x20a4c1||0x1f4;return function(_0x2b9410){logger[_0x912c('0x21')](_0x2b9410['stack']);if(_0x2b9410['name']){delete _0x2b9410[_0x912c('0x32')];}_0x5a6b5c[_0x912c('0x25')](_0x20a4c1)['send'](_0x2b9410);};}exports[_0x912c('0x33')]=function(_0x4fa1a7,_0x5f4d10){var _0x53c45b={},_0x36c58f={},_0x4897b7={'count':0x0,'rows':[]};var _0x20593b=_[_0x912c('0x34')](db[_0x912c('0x35')][_0x912c('0x36')],function(_0x31e4d6){return{'name':_0x31e4d6['fieldName'],'type':_0x31e4d6[_0x912c('0x37')][_0x912c('0x38')]};});_0x36c58f[_0x912c('0x39')]=_[_0x912c('0x34')](_0x20593b,_0x912c('0x32'));_0x36c58f[_0x912c('0x3a')]=_[_0x912c('0x3b')](_0x4fa1a7[_0x912c('0x3a')]);_0x36c58f['filters']=_[_0x912c('0x3c')](_0x36c58f['model'],_0x36c58f[_0x912c('0x3a')]);_0x53c45b[_0x912c('0x3d')]=_['intersection'](_0x36c58f[_0x912c('0x39')],qs['fields'](_0x4fa1a7[_0x912c('0x3a')][_0x912c('0x3e')]));_0x53c45b[_0x912c('0x3d')]=_0x53c45b[_0x912c('0x3d')][_0x912c('0x3f')]?_0x53c45b[_0x912c('0x3d')]:_0x36c58f['model'];if(!_0x4fa1a7[_0x912c('0x3a')][_0x912c('0x40')](_0x912c('0x41'))){_0x53c45b[_0x912c('0x2a')]=qs['limit'](_0x4fa1a7['query']['limit']);_0x53c45b[_0x912c('0x29')]=qs[_0x912c('0x29')](_0x4fa1a7[_0x912c('0x3a')][_0x912c('0x29')]);}_0x53c45b[_0x912c('0x42')]=qs['sort'](_0x4fa1a7[_0x912c('0x3a')]['sort']);_0x53c45b['where']=qs[_0x912c('0x43')](_[_0x912c('0x44')](_0x4fa1a7[_0x912c('0x3a')],_0x36c58f[_0x912c('0x43')]));if(_0x4fa1a7[_0x912c('0x3a')][_0x912c('0x45')]){_0x53c45b[_0x912c('0x46')]=_['merge'](_0x53c45b[_0x912c('0x46')],{'$or':_[_0x912c('0x34')](_0x20593b,function(_0x4c813e){if(_0x4c813e[_0x912c('0x37')]['key']!==_0x912c('0x47')){var _0x4d8ed1={};_0x4d8ed1[_0x4c813e[_0x912c('0x48')]]={'$like':'%'+_0x4fa1a7[_0x912c('0x3a')][_0x912c('0x45')]+'%'};return _0x4d8ed1;}})});}_0x53c45b=_['merge']({},_0x53c45b,_0x4fa1a7['options']);var _0x358e12={'where':_0x53c45b['where']};return db[_0x912c('0x35')][_0x912c('0x28')](_0x358e12)[_0x912c('0x1b')](function(_0x163313){_0x4897b7['count']=_0x163313;if(_0x4fa1a7['query'][_0x912c('0x49')]){_0x53c45b['include']=[{'all':!![]}];}return db[_0x912c('0x35')][_0x912c('0x4a')](_0x53c45b);})[_0x912c('0x1b')](function(_0x2f0b6e){_0x4897b7[_0x912c('0x4b')]=_0x2f0b6e;return _0x4897b7;})[_0x912c('0x1b')](respondWithFilteredResult(_0x5f4d10,_0x53c45b))['catch'](handleError(_0x5f4d10,null));};exports[_0x912c('0x4c')]=function(_0x46b786,_0x59b8f0){var _0x1c82e2={'raw':![],'where':{'id':_0x46b786[_0x912c('0x4d')]['id']}},_0x26348e={};_0x26348e['model']=_['keys'](db[_0x912c('0x35')][_0x912c('0x36')]);_0x26348e[_0x912c('0x3a')]=_[_0x912c('0x3b')](_0x46b786[_0x912c('0x3a')]);_0x26348e[_0x912c('0x43')]=_[_0x912c('0x3c')](_0x26348e[_0x912c('0x39')],_0x26348e['query']);_0x1c82e2[_0x912c('0x3d')]=_[_0x912c('0x3c')](_0x26348e[_0x912c('0x39')],qs['fields'](_0x46b786[_0x912c('0x3a')][_0x912c('0x3e')]));_0x1c82e2[_0x912c('0x3d')]=_0x1c82e2[_0x912c('0x3d')][_0x912c('0x3f')]?_0x1c82e2[_0x912c('0x3d')]:_0x26348e[_0x912c('0x39')];if(_0x46b786[_0x912c('0x3a')]['includeAll']){_0x1c82e2[_0x912c('0x4e')]=[{'all':!![]}];}_0x1c82e2=_[_0x912c('0x4f')]({},_0x1c82e2,_0x46b786['options']);return db[_0x912c('0x35')][_0x912c('0x50')](_0x1c82e2)[_0x912c('0x1b')](handleEntityNotFound(_0x59b8f0,null))[_0x912c('0x1b')](respondWithResult(_0x59b8f0,null))['catch'](handleError(_0x59b8f0,null));};exports['update']=function(_0x2e2c4c,_0x56b81d,_0x109d54){var _0x4920a5;return db['Setting'][_0x912c('0x50')]({'where':{'id':_0x2e2c4c['params']['id']}})['then'](handleEntityNotFound(_0x56b81d,null))['then'](saveUpdates(_0x2e2c4c[_0x912c('0x51')],null))[_0x912c('0x1b')](function(_0x48073a){if(_0x48073a){_0x4920a5=_0x48073a[_0x912c('0x52')]({'plain':!![]});var _0x519a3c=fs['readFileSync'](path['join'](config['root'],_0x912c('0x53')),'utf8');var _0x22239c=ejs[_0x912c('0x54')](_0x519a3c,_0x4920a5);var _0xb4fc5a=fs[_0x912c('0x55')](path[_0x912c('0x56')](config[_0x912c('0x57')],'server/files/templates/turn.ejs'),_0x912c('0x58'));var _0x5593b4=ejs[_0x912c('0x54')](_0xb4fc5a,_0x4920a5);fs[_0x912c('0x59')](_0x912c('0x5a'),_0x22239c);fs[_0x912c('0x59')](_0x912c('0x5b'),_0x5593b4);return respondWithRpcPromise(_0x912c('0x5c'),'update',{'module':_0x912c('0x5d')});}})[_0x912c('0x1b')](function(){return respondWithRpcPromise(_0x912c('0x5c'),_0x912c('0x30'),{'module':_0x912c('0x5e')});})[_0x912c('0x1b')](function(){return _0x4920a5||null;})['then'](respondWithResult(_0x56b81d,null))['catch'](handleError(_0x56b81d,null));};exports[_0x912c('0x5f')]=function(_0x2bf253,_0x5d3f7c,_0x3e82f1){if(_0x2bf253[_0x912c('0x60')]&&_0x2bf253['file'][_0x912c('0x61')]){_0x2bf253[_0x912c('0x51')]['logo']=_0x2bf253[_0x912c('0x60')][_0x912c('0x61')];}return db[_0x912c('0x35')]['find']({'where':{'id':_0x2bf253['params']['id']}})['then'](handleEntityNotFound(_0x5d3f7c,null))[_0x912c('0x1b')](saveUpdates(_0x2bf253['body'],null))[_0x912c('0x1b')](respondWithResult(_0x5d3f7c,null))['catch'](handleError(_0x5d3f7c,null));};exports[_0x912c('0x62')]=function(_0x14f414,_0x3386cd,_0x1dd0fa){if(_0x14f414[_0x912c('0x60')]&&_0x14f414[_0x912c('0x60')][_0x912c('0x61')]){_0x14f414['body'][_0x912c('0x63')]=_0x14f414[_0x912c('0x60')][_0x912c('0x61')];}return db[_0x912c('0x35')][_0x912c('0x50')]({'where':{'id':_0x14f414['params']['id']}})[_0x912c('0x1b')](handleEntityNotFound(_0x3386cd,null))[_0x912c('0x1b')](saveUpdates(_0x14f414[_0x912c('0x51')],null))[_0x912c('0x1b')](respondWithResult(_0x3386cd,null))[_0x912c('0x24')](handleError(_0x3386cd,null));};var utilLicense=require(_0x912c('0x64'));exports[_0x912c('0x65')]=function(_0x154c2b,_0x21d71b,_0x5823d0){var _0x1dd688=_0x912c('0x66');var _0x30198d={'custom':![]};return utilLicense[_0x912c('0x67')]()['then'](function(_0x584d7a){if(_0x584d7a){_0x30198d=_0x584d7a;}return db[_0x912c('0x35')][_0x912c('0x50')]({'where':{'id':_0x154c2b[_0x912c('0x4d')]['id']},'attributes':[_0x912c('0x68'),_0x912c('0x63'),_0x912c('0x69'),_0x912c('0x6a'),_0x912c('0x6b'),_0x912c('0x6c'),_0x912c('0x6d'),_0x912c('0x6e')],'raw':!![]});})[_0x912c('0x1b')](handleEntityNotFound(_0x21d71b,null))[_0x912c('0x1b')](function(_0xf15bb9){if(_0xf15bb9){var _0x2ec61d=_0xf15bb9[_0x912c('0x68')]&&fs[_0x912c('0x6f')](path[_0x912c('0x56')](config[_0x912c('0x57')],_0x1dd688,_[_0x912c('0x70')](_0xf15bb9[_0x912c('0x68')])))?path[_0x912c('0x56')](config['root'],_0x1dd688,_[_0x912c('0x70')](_0xf15bb9[_0x912c('0x68')])):path[_0x912c('0x56')](config[_0x912c('0x57')],_0x1dd688,_[_0x912c('0x70')](_0x912c('0x71')));var _0x4e1268=_0x912c('0x72')+_[_0x912c('0x73')]('logo');if(_0xf15bb9[_0x4e1268]||!_0x30198d[_0x912c('0x74')]){_0x2ec61d=path[_0x912c('0x56')](config['root'],_0x1dd688,_[_0x912c('0x70')](_0x912c('0x71')));}if(!fs['existsSync'](_0x2ec61d)){throw new db['Sequelize'][(_0x912c('0x75'))](_[_0x912c('0x73')](_0x912c('0x68'))+_0x912c('0x76'));}return _0x21d71b[_0x912c('0x77')](_0x2ec61d);}})[_0x912c('0x24')](handleError(_0x21d71b,null));};var utilLicense=require('../../config/license/util');exports[_0x912c('0x78')]=function(_0x1ba54d,_0x2ff1dc,_0x518b02){var _0x433563=_0x912c('0x66');var _0x374a58={'custom':![]};return utilLicense[_0x912c('0x67')]()['then'](function(_0x3c9836){if(_0x3c9836){_0x374a58=_0x3c9836;}return db[_0x912c('0x35')][_0x912c('0x50')]({'where':{'id':_0x1ba54d['params']['id']},'attributes':[_0x912c('0x68'),_0x912c('0x63'),_0x912c('0x69'),_0x912c('0x6a'),_0x912c('0x6b'),_0x912c('0x6c'),_0x912c('0x6d'),_0x912c('0x6e')],'raw':!![]});})[_0x912c('0x1b')](handleEntityNotFound(_0x2ff1dc,null))[_0x912c('0x1b')](function(_0x1a4aaf){if(_0x1a4aaf){var _0x2ec587=_0x1a4aaf[_0x912c('0x63')]&&fs[_0x912c('0x6f')](path[_0x912c('0x56')](config[_0x912c('0x57')],_0x433563,_[_0x912c('0x70')](_0x1a4aaf[_0x912c('0x63')])))?path['join'](config[_0x912c('0x57')],_0x433563,_['toLower'](_0x1a4aaf['loginLogo'])):path['join'](config[_0x912c('0x57')],_0x433563,_['toLower'](_0x912c('0x79')));var _0x196fc3=_0x912c('0x72')+_[_0x912c('0x73')]('loginLogo');if(_0x1a4aaf[_0x196fc3]||!_0x374a58[_0x912c('0x74')]){_0x2ec587=path[_0x912c('0x56')](config[_0x912c('0x57')],_0x433563,_[_0x912c('0x70')](_0x912c('0x79')));}if(!fs[_0x912c('0x6f')](_0x2ec587)){throw new db[(_0x912c('0x7a'))][(_0x912c('0x75'))](_[_0x912c('0x73')](_0x912c('0x63'))+_0x912c('0x76'));}return _0x2ff1dc[_0x912c('0x77')](_0x2ec587);}})[_0x912c('0x24')](handleError(_0x2ff1dc,null));};exports[_0x912c('0x7b')]=function(_0x6f7ff,_0x53d2fa){return db[_0x912c('0x35')][_0x912c('0x50')]({'where':{'id':_0x6f7ff[_0x912c('0x4d')]['id']},'attributes':['securePassword']})[_0x912c('0x1b')](respondWithResult(_0x53d2fa,null))['catch'](handleError(_0x53d2fa,null));};exports[_0x912c('0x7c')]=function(_0x446f75,_0x9f9580,_0x50d9a8){if(_0x446f75[_0x912c('0x60')]&&_0x446f75[_0x912c('0x60')][_0x912c('0x61')]){_0x446f75[_0x912c('0x51')]['preferred']=_0x446f75[_0x912c('0x60')][_0x912c('0x61')];}return db[_0x912c('0x35')][_0x912c('0x50')]({'where':{'id':_0x446f75[_0x912c('0x4d')]['id']}})[_0x912c('0x1b')](handleEntityNotFound(_0x9f9580,null))['then'](saveUpdates(_0x446f75['body'],null))[_0x912c('0x1b')](respondWithResult(_0x9f9580,null))[_0x912c('0x24')](handleError(_0x9f9580,null));};var utilLicense=require(_0x912c('0x64'));exports[_0x912c('0x7d')]=function(_0x34356d,_0x225102,_0x5752db){var _0x294c00=_0x912c('0x66');var _0x5b35c5={'custom':![]};return utilLicense['getLicense']()[_0x912c('0x1b')](function(_0xea75f6){if(_0xea75f6){_0x5b35c5=_0xea75f6;}return db['Setting']['find']({'where':{'id':_0x34356d[_0x912c('0x4d')]['id']},'attributes':['logo',_0x912c('0x63'),_0x912c('0x69'),'favicon',_0x912c('0x6b'),'defaultLoginLogo',_0x912c('0x6d'),_0x912c('0x6e')],'raw':!![]});})[_0x912c('0x1b')](handleEntityNotFound(_0x225102,null))['then'](function(_0x3837dd){if(_0x3837dd){var _0x15125e=_0x3837dd[_0x912c('0x69')]&&fs[_0x912c('0x6f')](path[_0x912c('0x56')](config['root'],_0x294c00,_[_0x912c('0x70')](_0x3837dd[_0x912c('0x69')])))?path[_0x912c('0x56')](config[_0x912c('0x57')],_0x294c00,_[_0x912c('0x70')](_0x3837dd['preferred'])):path[_0x912c('0x56')](config['root'],_0x294c00,_[_0x912c('0x70')](_0x912c('0x7e')));var _0x1f0544=_0x912c('0x72')+_[_0x912c('0x73')](_0x912c('0x69'));if(_0x3837dd[_0x1f0544]||!_0x5b35c5[_0x912c('0x74')]||!_0x5b35c5[_0x912c('0x69')]){_0x15125e=path[_0x912c('0x56')](config[_0x912c('0x57')],_0x294c00,_[_0x912c('0x70')](_0x912c('0x7e')));}if(!fs[_0x912c('0x6f')](_0x15125e)){throw new db[(_0x912c('0x7a'))][(_0x912c('0x75'))](_['upperFirst']('preferred')+_0x912c('0x76'));}return _0x225102[_0x912c('0x77')](_0x15125e);}})['catch'](handleError(_0x225102,null));};exports['addFavicon']=function(_0x5aa64d,_0x10c450,_0xa08a91){if(_0x5aa64d[_0x912c('0x60')]&&_0x5aa64d[_0x912c('0x60')][_0x912c('0x61')]){_0x5aa64d[_0x912c('0x51')][_0x912c('0x6a')]=_0x5aa64d[_0x912c('0x60')]['filename'];}return db[_0x912c('0x35')]['find']({'where':{'id':_0x5aa64d['params']['id']}})[_0x912c('0x1b')](handleEntityNotFound(_0x10c450,null))[_0x912c('0x1b')](saveUpdates(_0x5aa64d[_0x912c('0x51')],null))[_0x912c('0x1b')](respondWithResult(_0x10c450,null))[_0x912c('0x24')](handleError(_0x10c450,null));};var utilLicense=require(_0x912c('0x64'));exports['getFavicon']=function(_0x5fa511,_0x372e99,_0x3102dd){var _0xa4b11f='server/files/images/logos';var _0x367f51={'custom':![]};return utilLicense[_0x912c('0x67')]()[_0x912c('0x1b')](function(_0x50eaaf){if(_0x50eaaf){_0x367f51=_0x50eaaf;}return db['Setting'][_0x912c('0x50')]({'where':{'id':_0x5fa511[_0x912c('0x4d')]['id']},'attributes':[_0x912c('0x68'),_0x912c('0x63'),_0x912c('0x69'),_0x912c('0x6a'),_0x912c('0x6b'),'defaultLoginLogo',_0x912c('0x6d'),_0x912c('0x6e')],'raw':!![]});})[_0x912c('0x1b')](handleEntityNotFound(_0x372e99,null))['then'](function(_0x234a27){if(_0x234a27){var _0x1aa431=_0x234a27['favicon']&&fs[_0x912c('0x6f')](path[_0x912c('0x56')](config[_0x912c('0x57')],_0xa4b11f,_['toLower'](_0x234a27['favicon'])))?path[_0x912c('0x56')](config['root'],_0xa4b11f,_['toLower'](_0x234a27[_0x912c('0x6a')])):path[_0x912c('0x56')](config[_0x912c('0x57')],_0xa4b11f,_[_0x912c('0x70')](_0x912c('0x7f')));var _0x20e207=_0x912c('0x72')+_[_0x912c('0x73')](_0x912c('0x6a'));if(_0x234a27[_0x20e207]||!_0x367f51['custom']){_0x1aa431=path[_0x912c('0x56')](config[_0x912c('0x57')],_0xa4b11f,_[_0x912c('0x70')](_0x912c('0x7f')));}if(!fs[_0x912c('0x6f')](_0x1aa431)){throw new db[(_0x912c('0x7a'))]['ValidationError'](_[_0x912c('0x73')]('favicon')+'\x20not\x20found');}return _0x372e99[_0x912c('0x77')](_0x1aa431);}})['catch'](handleError(_0x372e99,null));}; \ No newline at end of file +var _0x89d9=['nolimit','sort','where','pick','filter','merge','key','options','count','includeAll','include','findAll','rows','show','params','rawAttributes','find','update','body','get','readFileSync','root','server/files/templates/stun.ejs','join','utf8','render','/etc/asterisk/stun_xcally.conf','/etc/asterisk/turn_xcally.conf','Reload','res_stun_monitor.so','res_rtp_asterisk.so','addLogo','file','filename','logo','addLogoLogin','loginLogo','getLogo','server/files/images/logos','preferred','defaultLogo','toLower','default_logo.png','default','upperFirst','custom','existsSync','ValidationError','\x20not\x20found','download','getLogoLogin','favicon','defaultLoginLogo','defaultPreferred','defaultFavicon','default_loginLogo.png','Sequelize','gdpr','addPreferred','../../config/license/util','getLicense','default_preferred.png','getFavicon','default_favicon.ico','html-pdf','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../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~!@#$%^&-_=+[{]}.','then','Setting,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','sendStatus','end','json','offset','limit','status','apply','save','stack','name','send','index','map','Setting','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty'];(function(_0x3984fa,_0x1d88a9){var _0x361743=function(_0x240084){while(--_0x240084){_0x3984fa['push'](_0x3984fa['shift']());}};_0x361743(++_0x1d88a9);}(_0x89d9,0x1c0));var _0x989d=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x89d9[_0x138adb];return _0x1b27f2;};'use strict';var pdf=require(_0x989d('0x0'));var emlformat=require(_0x989d('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x989d('0x2'));var jsonpatch=require(_0x989d('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x989d('0x4'));var Mustache=require(_0x989d('0x5'));var util=require(_0x989d('0x6'));var path=require(_0x989d('0x7'));var sox=require(_0x989d('0x8'));var csv=require(_0x989d('0x9'));var ejs=require(_0x989d('0xa'));var fs=require('fs');var _=require(_0x989d('0xb'));var squel=require(_0x989d('0xc'));var crypto=require(_0x989d('0xd'));var jsforce=require(_0x989d('0xe'));var deskjs=require(_0x989d('0xf'));var toCsv=require('to-csv');var querystring=require(_0x989d('0x10'));var Papa=require(_0x989d('0x11'));var Redis=require(_0x989d('0x12'));var authService=require(_0x989d('0x13'));var qs=require(_0x989d('0x14'));var as=require(_0x989d('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x989d('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x989d('0x17'));var db=require(_0x989d('0x18'))['db'];var jayson=require(_0x989d('0x19'));var client=jayson[_0x989d('0x1a')][_0x989d('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x17df33,_0x525c04,_0x30b620){if(_0x30b620){var _0x437a53=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x437a53[_0x989d('0x1c')](_0x525c04)){return _0x17df33;}else{throw new Error(_0x989d('0x1d'));}}else{return _0x17df33;}}function respondWithRpcPromise(_0x3cbcf1,_0x1181af,_0x409923,_0x593776){return new BPromise(function(_0x15645e,_0x38f061){var _0x5751c5=_0x593776||client;return _0x5751c5['request'](_0x3cbcf1,_0x409923)[_0x989d('0x1e')](function(_0xb71b5d){logger['info'](_0x989d('0x1f'),_0x1181af,_0x989d('0x20'));logger[_0x989d('0x21')]('Setting,\x20%s,\x20%s,\x20%s',_0x1181af,_0x989d('0x20'),JSON[_0x989d('0x22')](_0xb71b5d));if(_0xb71b5d[_0x989d('0x23')]){if(_0xb71b5d[_0x989d('0x23')][_0x989d('0x24')]===0x1f4){logger['error']('Setting,\x20%s,\x20%s',_0x1181af,_0xb71b5d[_0x989d('0x23')][_0x989d('0x25')]);return _0x38f061(_0xb71b5d['error'][_0x989d('0x25')]);}logger[_0x989d('0x23')](_0x989d('0x1f'),_0x1181af,_0xb71b5d[_0x989d('0x23')]['message']);return _0x15645e(_0xb71b5d[_0x989d('0x23')][_0x989d('0x25')]);}else{logger['info'](_0x989d('0x1f'),_0x1181af,'request\x20sent');_0x15645e(_0xb71b5d['result'][_0x989d('0x25')]);}})[_0x989d('0x26')](function(_0x4c67f8){logger[_0x989d('0x23')](_0x989d('0x1f'),_0x1181af,_0x4c67f8);_0x38f061(_0x4c67f8);});});}function respondWithStatusCode(_0x5218ab,_0x816dc9){_0x816dc9=_0x816dc9||0xcc;return function(_0x56a736){if(_0x56a736){return _0x5218ab[_0x989d('0x27')](_0x816dc9);}return _0x5218ab['status'](_0x816dc9)[_0x989d('0x28')]();};}function respondWithResult(_0x220a20,_0x1948c3){_0x1948c3=_0x1948c3||0xc8;return function(_0x1be05b){if(_0x1be05b){return _0x220a20['status'](_0x1948c3)[_0x989d('0x29')](_0x1be05b);}};}function respondWithFilteredResult(_0x534f3d,_0x3b1bc7){return function(_0x4dd562){if(_0x4dd562){var _0x516b69=_0x4dd562['count'],_0x5b5423=_0x3b1bc7[_0x989d('0x2a')],_0x2d0064=_0x3b1bc7[_0x989d('0x2a')]+_0x3b1bc7[_0x989d('0x2b')],_0x4647f;if(_0x2d0064>=_0x516b69){_0x2d0064=_0x516b69;_0x4647f=0xc8;}else{_0x4647f=0xce;}_0x534f3d[_0x989d('0x2c')](_0x4647f);return _0x534f3d['set']('Content-Range',_0x5b5423+'-'+_0x2d0064+'/'+_0x516b69)[_0x989d('0x29')](_0x4dd562);}return null;};}function patchUpdates(_0x25b7c0){return function(_0xe39844){try{jsonpatch[_0x989d('0x2d')](_0xe39844,_0x25b7c0,!![]);}catch(_0x15178c){return BPromise['reject'](_0x15178c);}return _0xe39844[_0x989d('0x2e')]();};}function saveUpdates(_0x48d71c,_0x533dbb){return function(_0x5b4a5b){if(_0x5b4a5b){return _0x5b4a5b['update'](_0x48d71c)[_0x989d('0x1e')](function(_0x5007ac){return _0x5007ac;});}return null;};}function removeEntity(_0x59ca56,_0x13ff84){return function(_0x5b659d){if(_0x5b659d){return _0x5b659d['destroy']()['then'](function(){_0x59ca56[_0x989d('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c268a,_0x3aed20){return function(_0x500928){if(!_0x500928){_0x2c268a['sendStatus'](0x194);}return _0x500928;};}function handleError(_0x44398d,_0x4ef720){_0x4ef720=_0x4ef720||0x1f4;return function(_0x3da0b5){logger[_0x989d('0x23')](_0x3da0b5[_0x989d('0x2f')]);if(_0x3da0b5[_0x989d('0x30')]){delete _0x3da0b5[_0x989d('0x30')];}_0x44398d[_0x989d('0x2c')](_0x4ef720)[_0x989d('0x31')](_0x3da0b5);};}exports[_0x989d('0x32')]=function(_0xb10a2e,_0x20e83b){var _0x5a2d9a={},_0x274918={},_0x5c7288={'count':0x0,'rows':[]};var _0x170364=_[_0x989d('0x33')](db[_0x989d('0x34')]['rawAttributes'],function(_0x3921da){return{'name':_0x3921da[_0x989d('0x35')],'type':_0x3921da[_0x989d('0x36')]['key']};});_0x274918[_0x989d('0x37')]=_[_0x989d('0x33')](_0x170364,_0x989d('0x30'));_0x274918[_0x989d('0x38')]=_[_0x989d('0x39')](_0xb10a2e[_0x989d('0x38')]);_0x274918[_0x989d('0x3a')]=_[_0x989d('0x3b')](_0x274918[_0x989d('0x37')],_0x274918['query']);_0x5a2d9a['attributes']=_['intersection'](_0x274918['model'],qs['fields'](_0xb10a2e[_0x989d('0x38')][_0x989d('0x3c')]));_0x5a2d9a[_0x989d('0x3d')]=_0x5a2d9a['attributes'][_0x989d('0x3e')]?_0x5a2d9a[_0x989d('0x3d')]:_0x274918[_0x989d('0x37')];if(!_0xb10a2e['query'][_0x989d('0x3f')](_0x989d('0x40'))){_0x5a2d9a['limit']=qs[_0x989d('0x2b')](_0xb10a2e['query'][_0x989d('0x2b')]);_0x5a2d9a[_0x989d('0x2a')]=qs['offset'](_0xb10a2e[_0x989d('0x38')][_0x989d('0x2a')]);}_0x5a2d9a['order']=qs['sort'](_0xb10a2e[_0x989d('0x38')][_0x989d('0x41')]);_0x5a2d9a[_0x989d('0x42')]=qs[_0x989d('0x3a')](_[_0x989d('0x43')](_0xb10a2e[_0x989d('0x38')],_0x274918[_0x989d('0x3a')]));if(_0xb10a2e['query'][_0x989d('0x44')]){_0x5a2d9a[_0x989d('0x42')]=_[_0x989d('0x45')](_0x5a2d9a['where'],{'$or':_[_0x989d('0x33')](_0x170364,function(_0x32f2bf){if(_0x32f2bf[_0x989d('0x36')][_0x989d('0x46')]!=='VIRTUAL'){var _0x2c7692={};_0x2c7692[_0x32f2bf['field']]={'$like':'%'+_0xb10a2e[_0x989d('0x38')][_0x989d('0x44')]+'%'};return _0x2c7692;}})});}_0x5a2d9a=_['merge']({},_0x5a2d9a,_0xb10a2e[_0x989d('0x47')]);var _0x5ab03d={'where':_0x5a2d9a[_0x989d('0x42')]};return db[_0x989d('0x34')][_0x989d('0x48')](_0x5ab03d)[_0x989d('0x1e')](function(_0x242b7b){_0x5c7288['count']=_0x242b7b;if(_0xb10a2e[_0x989d('0x38')][_0x989d('0x49')]){_0x5a2d9a[_0x989d('0x4a')]=[{'all':!![]}];}return db[_0x989d('0x34')][_0x989d('0x4b')](_0x5a2d9a);})['then'](function(_0x55f4a6){_0x5c7288[_0x989d('0x4c')]=_0x55f4a6;return _0x5c7288;})['then'](respondWithFilteredResult(_0x20e83b,_0x5a2d9a))[_0x989d('0x26')](handleError(_0x20e83b,null));};exports[_0x989d('0x4d')]=function(_0x4f00a2,_0xc2887d){var _0x13faa4={'raw':![],'where':{'id':_0x4f00a2[_0x989d('0x4e')]['id']}},_0x53d7d6={};_0x53d7d6['model']=_[_0x989d('0x39')](db['Setting'][_0x989d('0x4f')]);_0x53d7d6[_0x989d('0x38')]=_['keys'](_0x4f00a2[_0x989d('0x38')]);_0x53d7d6[_0x989d('0x3a')]=_['intersection'](_0x53d7d6[_0x989d('0x37')],_0x53d7d6[_0x989d('0x38')]);_0x13faa4['attributes']=_[_0x989d('0x3b')](_0x53d7d6[_0x989d('0x37')],qs[_0x989d('0x3c')](_0x4f00a2[_0x989d('0x38')][_0x989d('0x3c')]));_0x13faa4[_0x989d('0x3d')]=_0x13faa4['attributes'][_0x989d('0x3e')]?_0x13faa4[_0x989d('0x3d')]:_0x53d7d6[_0x989d('0x37')];if(_0x4f00a2[_0x989d('0x38')][_0x989d('0x49')]){_0x13faa4[_0x989d('0x4a')]=[{'all':!![]}];}_0x13faa4=_[_0x989d('0x45')]({},_0x13faa4,_0x4f00a2[_0x989d('0x47')]);return db['Setting'][_0x989d('0x50')](_0x13faa4)[_0x989d('0x1e')](handleEntityNotFound(_0xc2887d,null))[_0x989d('0x1e')](respondWithResult(_0xc2887d,null))[_0x989d('0x26')](handleError(_0xc2887d,null));};exports[_0x989d('0x51')]=function(_0x260f2b,_0x60e781,_0x468d79){var _0x3efe88;return db[_0x989d('0x34')]['find']({'where':{'id':_0x260f2b[_0x989d('0x4e')]['id']}})[_0x989d('0x1e')](handleEntityNotFound(_0x60e781,null))[_0x989d('0x1e')](saveUpdates(_0x260f2b[_0x989d('0x52')],null))['then'](function(_0x2d0b76){if(_0x2d0b76){_0x3efe88=_0x2d0b76[_0x989d('0x53')]({'plain':!![]});var _0x5bfdd2=fs[_0x989d('0x54')](path['join'](config[_0x989d('0x55')],_0x989d('0x56')),'utf8');var _0x2de22c=ejs['render'](_0x5bfdd2,_0x3efe88);var _0x160d3a=fs[_0x989d('0x54')](path[_0x989d('0x57')](config['root'],'server/files/templates/turn.ejs'),_0x989d('0x58'));var _0xb56607=ejs[_0x989d('0x59')](_0x160d3a,_0x3efe88);fs['writeFileSync'](_0x989d('0x5a'),_0x2de22c);fs['writeFileSync'](_0x989d('0x5b'),_0xb56607);return respondWithRpcPromise(_0x989d('0x5c'),_0x989d('0x51'),{'module':_0x989d('0x5d')});}})['then'](function(){return respondWithRpcPromise('Reload','update',{'module':_0x989d('0x5e')});})['then'](function(){return _0x3efe88||null;})[_0x989d('0x1e')](respondWithResult(_0x60e781,null))[_0x989d('0x26')](handleError(_0x60e781,null));};exports[_0x989d('0x5f')]=function(_0x26eca3,_0x258b63,_0x5907e2){if(_0x26eca3['file']&&_0x26eca3[_0x989d('0x60')][_0x989d('0x61')]){_0x26eca3[_0x989d('0x52')][_0x989d('0x62')]=_0x26eca3[_0x989d('0x60')]['filename'];}return db[_0x989d('0x34')]['find']({'where':{'id':_0x26eca3[_0x989d('0x4e')]['id']}})[_0x989d('0x1e')](handleEntityNotFound(_0x258b63,null))[_0x989d('0x1e')](saveUpdates(_0x26eca3[_0x989d('0x52')],null))[_0x989d('0x1e')](respondWithResult(_0x258b63,null))[_0x989d('0x26')](handleError(_0x258b63,null));};exports[_0x989d('0x63')]=function(_0x27eb37,_0x101cc1,_0x56ccb){if(_0x27eb37['file']&&_0x27eb37[_0x989d('0x60')][_0x989d('0x61')]){_0x27eb37[_0x989d('0x52')][_0x989d('0x64')]=_0x27eb37[_0x989d('0x60')][_0x989d('0x61')];}return db[_0x989d('0x34')]['find']({'where':{'id':_0x27eb37[_0x989d('0x4e')]['id']}})[_0x989d('0x1e')](handleEntityNotFound(_0x101cc1,null))[_0x989d('0x1e')](saveUpdates(_0x27eb37[_0x989d('0x52')],null))[_0x989d('0x1e')](respondWithResult(_0x101cc1,null))[_0x989d('0x26')](handleError(_0x101cc1,null));};var utilLicense=require('../../config/license/util');exports[_0x989d('0x65')]=function(_0x258e62,_0x5d80a5,_0x52fbcb){var _0xd681c2=_0x989d('0x66');var _0x3594b3={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x47897e){if(_0x47897e){_0x3594b3=_0x47897e;}return db[_0x989d('0x34')][_0x989d('0x50')]({'where':{'id':_0x258e62[_0x989d('0x4e')]['id']},'attributes':['logo',_0x989d('0x64'),_0x989d('0x67'),'favicon',_0x989d('0x68'),'defaultLoginLogo','defaultPreferred','defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x5d80a5,null))[_0x989d('0x1e')](function(_0x2fbf7f){if(_0x2fbf7f){var _0xbf969c=_0x2fbf7f[_0x989d('0x62')]&&fs['existsSync'](path[_0x989d('0x57')](config['root'],_0xd681c2,_[_0x989d('0x69')](_0x2fbf7f[_0x989d('0x62')])))?path[_0x989d('0x57')](config[_0x989d('0x55')],_0xd681c2,_['toLower'](_0x2fbf7f['logo'])):path[_0x989d('0x57')](config[_0x989d('0x55')],_0xd681c2,_[_0x989d('0x69')](_0x989d('0x6a')));var _0x12f741=_0x989d('0x6b')+_[_0x989d('0x6c')](_0x989d('0x62'));if(_0x2fbf7f[_0x12f741]||!_0x3594b3[_0x989d('0x6d')]){_0xbf969c=path[_0x989d('0x57')](config[_0x989d('0x55')],_0xd681c2,_['toLower'](_0x989d('0x6a')));}if(!fs[_0x989d('0x6e')](_0xbf969c)){throw new db['Sequelize'][(_0x989d('0x6f'))](_[_0x989d('0x6c')]('logo')+_0x989d('0x70'));}return _0x5d80a5[_0x989d('0x71')](_0xbf969c);}})[_0x989d('0x26')](handleError(_0x5d80a5,null));};var utilLicense=require('../../config/license/util');exports[_0x989d('0x72')]=function(_0x8fb748,_0x263ed6,_0x28863f){var _0x3f277a=_0x989d('0x66');var _0x44f8fa={'custom':![]};return utilLicense['getLicense']()[_0x989d('0x1e')](function(_0xbc7842){if(_0xbc7842){_0x44f8fa=_0xbc7842;}return db[_0x989d('0x34')]['find']({'where':{'id':_0x8fb748['params']['id']},'attributes':[_0x989d('0x62'),'loginLogo',_0x989d('0x67'),_0x989d('0x73'),_0x989d('0x68'),_0x989d('0x74'),_0x989d('0x75'),_0x989d('0x76')],'raw':!![]});})['then'](handleEntityNotFound(_0x263ed6,null))[_0x989d('0x1e')](function(_0x4b0b0a){if(_0x4b0b0a){var _0x120029=_0x4b0b0a['loginLogo']&&fs['existsSync'](path[_0x989d('0x57')](config['root'],_0x3f277a,_[_0x989d('0x69')](_0x4b0b0a['loginLogo'])))?path['join'](config[_0x989d('0x55')],_0x3f277a,_[_0x989d('0x69')](_0x4b0b0a[_0x989d('0x64')])):path['join'](config[_0x989d('0x55')],_0x3f277a,_[_0x989d('0x69')](_0x989d('0x77')));var _0x37be87=_0x989d('0x6b')+_[_0x989d('0x6c')]('loginLogo');if(_0x4b0b0a[_0x37be87]||!_0x44f8fa[_0x989d('0x6d')]){_0x120029=path[_0x989d('0x57')](config[_0x989d('0x55')],_0x3f277a,_['toLower'](_0x989d('0x77')));}if(!fs[_0x989d('0x6e')](_0x120029)){throw new db[(_0x989d('0x78'))][(_0x989d('0x6f'))](_[_0x989d('0x6c')](_0x989d('0x64'))+_0x989d('0x70'));}return _0x263ed6[_0x989d('0x71')](_0x120029);}})[_0x989d('0x26')](handleError(_0x263ed6,null));};exports[_0x989d('0x79')]=function(_0x2d07ce,_0x5e8ddb){return db['Setting']['find']({'where':{'id':_0x2d07ce[_0x989d('0x4e')]['id']},'attributes':['securePassword']})[_0x989d('0x1e')](respondWithResult(_0x5e8ddb,null))[_0x989d('0x26')](handleError(_0x5e8ddb,null));};exports[_0x989d('0x7a')]=function(_0x5f1ab8,_0x9e4f6c,_0x5712a2){if(_0x5f1ab8[_0x989d('0x60')]&&_0x5f1ab8[_0x989d('0x60')][_0x989d('0x61')]){_0x5f1ab8[_0x989d('0x52')][_0x989d('0x67')]=_0x5f1ab8[_0x989d('0x60')]['filename'];}return db[_0x989d('0x34')]['find']({'where':{'id':_0x5f1ab8[_0x989d('0x4e')]['id']}})[_0x989d('0x1e')](handleEntityNotFound(_0x9e4f6c,null))[_0x989d('0x1e')](saveUpdates(_0x5f1ab8[_0x989d('0x52')],null))[_0x989d('0x1e')](respondWithResult(_0x9e4f6c,null))['catch'](handleError(_0x9e4f6c,null));};var utilLicense=require(_0x989d('0x7b'));exports['getPreferred']=function(_0x6a7a69,_0x23a3f0,_0x3ae357){var _0x1d1fb4=_0x989d('0x66');var _0x170600={'custom':![]};return utilLicense[_0x989d('0x7c')]()[_0x989d('0x1e')](function(_0x434d8d){if(_0x434d8d){_0x170600=_0x434d8d;}return db[_0x989d('0x34')][_0x989d('0x50')]({'where':{'id':_0x6a7a69['params']['id']},'attributes':[_0x989d('0x62'),_0x989d('0x64'),_0x989d('0x67'),_0x989d('0x73'),_0x989d('0x68'),_0x989d('0x74'),'defaultPreferred',_0x989d('0x76')],'raw':!![]});})['then'](handleEntityNotFound(_0x23a3f0,null))[_0x989d('0x1e')](function(_0xd6dcdd){if(_0xd6dcdd){var _0x547ab4=_0xd6dcdd[_0x989d('0x67')]&&fs[_0x989d('0x6e')](path['join'](config['root'],_0x1d1fb4,_[_0x989d('0x69')](_0xd6dcdd['preferred'])))?path[_0x989d('0x57')](config[_0x989d('0x55')],_0x1d1fb4,_[_0x989d('0x69')](_0xd6dcdd[_0x989d('0x67')])):path[_0x989d('0x57')](config[_0x989d('0x55')],_0x1d1fb4,_[_0x989d('0x69')](_0x989d('0x7d')));var _0xecdc6c=_0x989d('0x6b')+_['upperFirst'](_0x989d('0x67'));if(_0xd6dcdd[_0xecdc6c]||!_0x170600[_0x989d('0x6d')]||!_0x170600[_0x989d('0x67')]){_0x547ab4=path[_0x989d('0x57')](config[_0x989d('0x55')],_0x1d1fb4,_[_0x989d('0x69')](_0x989d('0x7d')));}if(!fs[_0x989d('0x6e')](_0x547ab4)){throw new db[(_0x989d('0x78'))]['ValidationError'](_['upperFirst']('preferred')+_0x989d('0x70'));}return _0x23a3f0['download'](_0x547ab4);}})[_0x989d('0x26')](handleError(_0x23a3f0,null));};exports['addFavicon']=function(_0x4d186b,_0x50db4d,_0x1aa177){if(_0x4d186b[_0x989d('0x60')]&&_0x4d186b[_0x989d('0x60')][_0x989d('0x61')]){_0x4d186b[_0x989d('0x52')][_0x989d('0x73')]=_0x4d186b[_0x989d('0x60')][_0x989d('0x61')];}return db[_0x989d('0x34')][_0x989d('0x50')]({'where':{'id':_0x4d186b[_0x989d('0x4e')]['id']}})['then'](handleEntityNotFound(_0x50db4d,null))[_0x989d('0x1e')](saveUpdates(_0x4d186b[_0x989d('0x52')],null))['then'](respondWithResult(_0x50db4d,null))[_0x989d('0x26')](handleError(_0x50db4d,null));};var utilLicense=require(_0x989d('0x7b'));exports[_0x989d('0x7e')]=function(_0x5e130f,_0x1d2920,_0x1407e1){var _0x233d98=_0x989d('0x66');var _0x3ca95f={'custom':![]};return utilLicense[_0x989d('0x7c')]()[_0x989d('0x1e')](function(_0x192ce3){if(_0x192ce3){_0x3ca95f=_0x192ce3;}return db[_0x989d('0x34')]['find']({'where':{'id':_0x5e130f[_0x989d('0x4e')]['id']},'attributes':[_0x989d('0x62'),_0x989d('0x64'),_0x989d('0x67'),_0x989d('0x73'),_0x989d('0x68'),_0x989d('0x74'),_0x989d('0x75'),_0x989d('0x76')],'raw':!![]});})['then'](handleEntityNotFound(_0x1d2920,null))[_0x989d('0x1e')](function(_0x58c4ad){if(_0x58c4ad){var _0x2e81a6=_0x58c4ad['favicon']&&fs['existsSync'](path[_0x989d('0x57')](config[_0x989d('0x55')],_0x233d98,_[_0x989d('0x69')](_0x58c4ad['favicon'])))?path[_0x989d('0x57')](config[_0x989d('0x55')],_0x233d98,_[_0x989d('0x69')](_0x58c4ad[_0x989d('0x73')])):path[_0x989d('0x57')](config['root'],_0x233d98,_[_0x989d('0x69')](_0x989d('0x7f')));var _0x509fc9=_0x989d('0x6b')+_[_0x989d('0x6c')](_0x989d('0x73'));if(_0x58c4ad[_0x509fc9]||!_0x3ca95f[_0x989d('0x6d')]){_0x2e81a6=path[_0x989d('0x57')](config[_0x989d('0x55')],_0x233d98,_[_0x989d('0x69')](_0x989d('0x7f')));}if(!fs[_0x989d('0x6e')](_0x2e81a6)){throw new db['Sequelize']['ValidationError'](_[_0x989d('0x6c')](_0x989d('0x73'))+'\x20not\x20found');}return _0x1d2920[_0x989d('0x71')](_0x2e81a6);}})[_0x989d('0x26')](handleError(_0x1d2920,null));}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index e175b24..e513de4 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 _0xc830=['../../config/logger','moment','request-promise','path','rimraf','exports','settings','lodash','util'];(function(_0x2e3187,_0x5b2556){var _0x31de8c=function(_0xd8564a){while(--_0xd8564a){_0x2e3187['push'](_0x2e3187['shift']());}};_0x31de8c(++_0x5b2556);}(_0xc830,0xbb));var _0x0c83=function(_0x1b3517,_0x28e980){_0x1b3517=_0x1b3517-0x0;var _0xe712ad=_0xc830[_0x1b3517];return _0xe712ad;};'use strict';var _=require(_0x0c83('0x0'));var util=require(_0x0c83('0x1'));var logger=require(_0x0c83('0x2'))('api');var moment=require(_0x0c83('0x3'));var BPromise=require('bluebird');var rp=require(_0x0c83('0x4'));var fs=require('fs');var path=require(_0x0c83('0x5'));var rimraf=require(_0x0c83('0x6'));var config=require('../../config/environment');var attributes=require('./setting.attributes');module[_0x0c83('0x7')]=function(_0x3aa6ba,_0x3966f9){return _0x3aa6ba['define']('Setting',attributes,{'tableName':_0x0c83('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x815c=['./setting.attributes','exports','define','Setting','settings','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x1a9026,_0x4b8b89){var _0x8623e9=function(_0x3df900){while(--_0x3df900){_0x1a9026['push'](_0x1a9026['shift']());}};_0x8623e9(++_0x4b8b89);}(_0x815c,0x19b));var _0xc815=function(_0x499792,_0x20bf22){_0x499792=_0x499792-0x0;var _0x1ba806=_0x815c[_0x499792];return _0x1ba806;};'use strict';var _=require(_0xc815('0x0'));var util=require(_0xc815('0x1'));var logger=require(_0xc815('0x2'))(_0xc815('0x3'));var moment=require(_0xc815('0x4'));var BPromise=require(_0xc815('0x5'));var rp=require(_0xc815('0x6'));var fs=require('fs');var path=require(_0xc815('0x7'));var rimraf=require('rimraf');var config=require(_0xc815('0x8'));var attributes=require(_0xc815('0x9'));module[_0xc815('0xa')]=function(_0x3467d9,_0x1bfde8){return _0x3467d9[_0xc815('0xb')](_0xc815('0xc'),attributes,{'tableName':_0xc815('0xd'),'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 0e2d976..7bc49be 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 _0xcd3c=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','Setting,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird'];(function(_0x550695,_0x17c5b3){var _0x5b760d=function(_0x454620){while(--_0x454620){_0x550695['push'](_0x550695['shift']());}};_0x5b760d(++_0x17c5b3);}(_0xcd3c,0x188));var _0xccd3=function(_0xaaabd,_0x1b1cf1){_0xaaabd=_0xaaabd-0x0;var _0x59bb52=_0xcd3c[_0xaaabd];return _0x59bb52;};'use strict';var _=require(_0xccd3('0x0'));var util=require(_0xccd3('0x1'));var moment=require(_0xccd3('0x2'));var BPromise=require(_0xccd3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xccd3('0x4'));var db=require(_0xccd3('0x5'))['db'];var utils=require(_0xccd3('0x6'));var logger=require(_0xccd3('0x7'))('rpc');var config=require(_0xccd3('0x8'));var jayson=require(_0xccd3('0x9'));var client=jayson[_0xccd3('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x30fa9c,_0x54b60f,_0x3e62d3){return new BPromise(function(_0x4e6f8e,_0x1bdbbe){return client['request'](_0x30fa9c,_0x3e62d3)[_0xccd3('0xb')](function(_0x232bec){logger[_0xccd3('0xc')]('Setting,\x20%s,\x20%s',_0x54b60f,'request\x20sent');logger[_0xccd3('0xd')](_0xccd3('0xe'),_0x54b60f,_0xccd3('0xf'),JSON['stringify'](_0x232bec));if(_0x232bec[_0xccd3('0x10')]){if(_0x232bec['error'][_0xccd3('0x11')]===0x1f4){logger[_0xccd3('0x10')](_0xccd3('0x12'),_0x54b60f,_0x232bec['error'][_0xccd3('0x13')]);return _0x1bdbbe(_0x232bec['error'][_0xccd3('0x13')]);}logger[_0xccd3('0x10')](_0xccd3('0x12'),_0x54b60f,_0x232bec[_0xccd3('0x10')][_0xccd3('0x13')]);return _0x4e6f8e(_0x232bec['error'][_0xccd3('0x13')]);}else{logger['info'](_0xccd3('0x12'),_0x54b60f,_0xccd3('0xf'));_0x4e6f8e(_0x232bec[_0xccd3('0x14')][_0xccd3('0x13')]);}})[_0xccd3('0x15')](function(_0x21efca){logger[_0xccd3('0x10')](_0xccd3('0x12'),_0x54b60f,_0x21efca);_0x1bdbbe(_0x21efca);});});} \ No newline at end of file +var _0x893a=['request\x20sent','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','Setting,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x4c0e73,_0x24e0d2){var _0x5adf35=function(_0x4ed699){while(--_0x4ed699){_0x4c0e73['push'](_0x4c0e73['shift']());}};_0x5adf35(++_0x24e0d2);}(_0x893a,0xaa));var _0xa893=function(_0x468ccf,_0x3d3ed6){_0x468ccf=_0x468ccf-0x0;var _0xbbb1d8=_0x893a[_0x468ccf];return _0xbbb1d8;};'use strict';var _=require('lodash');var util=require(_0xa893('0x0'));var moment=require(_0xa893('0x1'));var BPromise=require(_0xa893('0x2'));var rs=require(_0xa893('0x3'));var fs=require('fs');var Redis=require(_0xa893('0x4'));var db=require(_0xa893('0x5'))['db'];var utils=require(_0xa893('0x6'));var logger=require(_0xa893('0x7'))(_0xa893('0x8'));var config=require(_0xa893('0x9'));var jayson=require(_0xa893('0xa'));var client=jayson['client'][_0xa893('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x989cad,_0x4a2d43,_0x3633db){return new BPromise(function(_0x1d8a37,_0x5b48c7){return client['request'](_0x989cad,_0x3633db)[_0xa893('0xc')](function(_0x5ad535){logger['info'](_0xa893('0xd'),_0x4a2d43,'request\x20sent');logger['debug']('Setting,\x20%s,\x20%s,\x20%s',_0x4a2d43,'request\x20sent',JSON[_0xa893('0xe')](_0x5ad535));if(_0x5ad535[_0xa893('0xf')]){if(_0x5ad535[_0xa893('0xf')][_0xa893('0x10')]===0x1f4){logger['error'](_0xa893('0xd'),_0x4a2d43,_0x5ad535[_0xa893('0xf')][_0xa893('0x11')]);return _0x5b48c7(_0x5ad535[_0xa893('0xf')][_0xa893('0x11')]);}logger[_0xa893('0xf')](_0xa893('0xd'),_0x4a2d43,_0x5ad535[_0xa893('0xf')][_0xa893('0x11')]);return _0x1d8a37(_0x5ad535['error'][_0xa893('0x11')]);}else{logger[_0xa893('0x12')]('Setting,\x20%s,\x20%s',_0x4a2d43,_0xa893('0x13'));_0x1d8a37(_0x5ad535[_0xa893('0x14')][_0xa893('0x11')]);}})['catch'](function(_0x558c3c){logger['error'](_0xa893('0xd'),_0x4a2d43,_0x558c3c);_0x5b48c7(_0x558c3c);});});} \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 8ef4f8f..ad9731f 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 _0xbbea=['addAnswer','notify','addApplications','/:id/send','status','addAgents','put','update','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','/:id/users','getAgents','post','create','addDisposition'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbbea,0xda));var _0xabbe=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xbbea[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require(_0xabbe('0x0'));var util=require(_0xabbe('0x1'));var path=require(_0xabbe('0x2'));var timeout=require(_0xabbe('0x3'));var express=require(_0xabbe('0x4'));var router=express[_0xabbe('0x5')]();var auth=require(_0xabbe('0x6'));var interaction=require(_0xabbe('0x7'));var config=require(_0xabbe('0x8'));var controller=require(_0xabbe('0x9'));router[_0xabbe('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xabbe('0xa')](_0xabbe('0xb'),auth[_0xabbe('0xc')](),controller[_0xabbe('0xd')]);router[_0xabbe('0xa')](_0xabbe('0xe'),auth['isAuthenticated'](),controller[_0xabbe('0xf')]);router[_0xabbe('0xa')](_0xabbe('0x10'),auth['isAuthenticated'](),controller[_0xabbe('0x11')]);router[_0xabbe('0xa')](_0xabbe('0x12'),auth[_0xabbe('0xc')](),controller[_0xabbe('0x13')]);router[_0xabbe('0xa')](_0xabbe('0x14'),auth[_0xabbe('0xc')](),controller[_0xabbe('0x15')]);router[_0xabbe('0xa')](_0xabbe('0x16'),auth[_0xabbe('0xc')](),controller['getInteractions']);router['get']('/:id/status',controller['statusGet']);router[_0xabbe('0xa')](_0xabbe('0x17'),auth['isAuthenticated'](),controller[_0xabbe('0x18')]);router[_0xabbe('0x19')]('/',auth[_0xabbe('0xc')](),controller[_0xabbe('0x1a')]);router[_0xabbe('0x19')](_0xabbe('0x10'),auth[_0xabbe('0xc')](),controller[_0xabbe('0x1b')]);router[_0xabbe('0x19')](_0xabbe('0x12'),auth['isAuthenticated'](),controller[_0xabbe('0x1c')]);router['post']('/:id/notify',controller[_0xabbe('0x1d')]);router[_0xabbe('0x19')](_0xabbe('0x14'),auth[_0xabbe('0xc')](),controller[_0xabbe('0x1e')]);router[_0xabbe('0x19')](_0xabbe('0x1f'),auth[_0xabbe('0xc')](),controller['send']);router[_0xabbe('0x19')]('/:id/status',controller[_0xabbe('0x20')]);router[_0xabbe('0x19')](_0xabbe('0x17'),auth['isAuthenticated'](),controller[_0xabbe('0x21')]);router[_0xabbe('0x22')](_0xabbe('0xe'),auth[_0xabbe('0xc')](),controller[_0xabbe('0x23')]);router[_0xabbe('0x24')](_0xabbe('0xe'),auth[_0xabbe('0xc')](),controller['destroy']);router['delete'](_0xabbe('0x10'),auth['isAuthenticated'](),controller[_0xabbe('0x25')]);router[_0xabbe('0x24')](_0xabbe('0x12'),auth['isAuthenticated'](),controller[_0xabbe('0x26')]);router[_0xabbe('0x24')](_0xabbe('0x17'),auth['isAuthenticated'](),controller[_0xabbe('0x27')]);module[_0xabbe('0x28')]=router; \ No newline at end of file +var _0x1d33=['/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/applications','/:id/status','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','/:id/notify','notify','addApplications','/:id/send','send','status','addAgents','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe'];(function(_0x1cd172,_0x25a324){var _0x46970b=function(_0xd3a9b1){while(--_0xd3a9b1){_0x1cd172['push'](_0x1cd172['shift']());}};_0x46970b(++_0x25a324);}(_0x1d33,0x1b2));var _0x31d3=function(_0x55a1cc,_0x41fff6){_0x55a1cc=_0x55a1cc-0x0;var _0x14165a=_0x1d33[_0x55a1cc];return _0x14165a;};'use strict';var multer=require(_0x31d3('0x0'));var util=require(_0x31d3('0x1'));var path=require(_0x31d3('0x2'));var timeout=require(_0x31d3('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x31d3('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x31d3('0x5'));var controller=require('./smsAccount.controller');router[_0x31d3('0x6')]('/',auth[_0x31d3('0x7')](),controller[_0x31d3('0x8')]);router[_0x31d3('0x6')](_0x31d3('0x9'),auth[_0x31d3('0x7')](),controller['describe']);router[_0x31d3('0x6')](_0x31d3('0xa'),auth[_0x31d3('0x7')](),controller[_0x31d3('0xb')]);router['get'](_0x31d3('0xc'),auth[_0x31d3('0x7')](),controller[_0x31d3('0xd')]);router[_0x31d3('0x6')]('/:id/canned_answers',auth[_0x31d3('0x7')](),controller[_0x31d3('0xe')]);router[_0x31d3('0x6')](_0x31d3('0xf'),auth[_0x31d3('0x7')](),controller['getApplications']);router[_0x31d3('0x6')]('/:id/interactions',auth[_0x31d3('0x7')](),controller['getInteractions']);router[_0x31d3('0x6')](_0x31d3('0x10'),controller['statusGet']);router[_0x31d3('0x6')](_0x31d3('0x11'),auth[_0x31d3('0x7')](),controller[_0x31d3('0x12')]);router[_0x31d3('0x13')]('/',auth[_0x31d3('0x7')](),controller['create']);router[_0x31d3('0x13')]('/:id/dispositions',auth[_0x31d3('0x7')](),controller[_0x31d3('0x14')]);router['post'](_0x31d3('0x15'),auth[_0x31d3('0x7')](),controller[_0x31d3('0x16')]);router[_0x31d3('0x13')](_0x31d3('0x17'),controller[_0x31d3('0x18')]);router[_0x31d3('0x13')](_0x31d3('0xf'),auth['isAuthenticated'](),controller[_0x31d3('0x19')]);router[_0x31d3('0x13')](_0x31d3('0x1a'),auth[_0x31d3('0x7')](),controller[_0x31d3('0x1b')]);router['post'](_0x31d3('0x10'),controller[_0x31d3('0x1c')]);router[_0x31d3('0x13')](_0x31d3('0x11'),auth['isAuthenticated'](),controller[_0x31d3('0x1d')]);router['put'](_0x31d3('0xa'),auth[_0x31d3('0x7')](),controller[_0x31d3('0x1e')]);router[_0x31d3('0x1f')](_0x31d3('0xa'),auth[_0x31d3('0x7')](),controller[_0x31d3('0x20')]);router[_0x31d3('0x1f')](_0x31d3('0xc'),auth[_0x31d3('0x7')](),controller[_0x31d3('0x21')]);router[_0x31d3('0x1f')](_0x31d3('0x15'),auth[_0x31d3('0x7')](),controller[_0x31d3('0x22')]);router[_0x31d3('0x1f')](_0x31d3('0x11'),auth[_0x31d3('0x7')](),controller[_0x31d3('0x23')]);module[_0x31d3('0x24')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index c8c52a6..34fa1a2 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 _0xe14d=['csc','infobip','intelepeer','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','STRING','generate','ENUM','twilio','skebby','connectel','clickatell'];(function(_0x389a98,_0x49173a){var _0x5169cf=function(_0x26e608){while(--_0x26e608){_0x389a98['push'](_0x389a98['shift']());}};_0x5169cf(++_0x49173a);}(_0xe14d,0x1ee));var _0xde14=function(_0x31cb5f,_0x2df766){_0x31cb5f=_0x31cb5f-0x0;var _0x586042=_0xe14d[_0x31cb5f];return _0x586042;};'use strict';var Sequelize=require(_0xde14('0x0'));var rs=require(_0xde14('0x1'));module[_0xde14('0x2')]={'name':{'type':Sequelize[_0xde14('0x3')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0xde14('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0xde14('0x3')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xde14('0x4')]();}},'phone':{'type':Sequelize[_0xde14('0x3')]},'type':{'type':Sequelize[_0xde14('0x5')](_0xde14('0x6'),_0xde14('0x7'),_0xde14('0x8'),'clicksend','plivo',_0xde14('0x9'),_0xde14('0xa'),_0xde14('0xb'),_0xde14('0xc'))},'accountSid':{'type':Sequelize[_0xde14('0x3')]},'authId':{'type':Sequelize[_0xde14('0x3')]},'authToken':{'type':Sequelize[_0xde14('0x3')]},'smsMethod':{'type':Sequelize[_0xde14('0x5')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xde14('0x3')]},'apiKey':{'type':Sequelize[_0xde14('0x3')]},'senderString':{'type':Sequelize[_0xde14('0x3')]},'deliveryReport':{'type':Sequelize[_0xde14('0xd')],'defaultValue':![]},'description':{'type':Sequelize[_0xde14('0x3')]},'notificationTemplate':{'type':Sequelize[_0xde14('0xe')],'defaultValue':function(){return _0xde14('0xf');}},'notificationSound':{'type':Sequelize[_0xde14('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xde14('0xd')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xde14('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xde14('0xd')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xde14('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xde14('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xde14('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xde14('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xde14('0xd')],'defaultValue':![],'comment':_0xde14('0x11'),'set':function(_0x26c1ec){if(!_0x26c1ec)this['setDataValue'](_0xde14('0x12'),null);this[_0xde14('0x13')](_0xde14('0x14'),_0x26c1ec);}}}; \ No newline at end of file +var _0x0bb5=['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','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','name','STRING','generate','ENUM','twilio','clicksend','plivo','clickatell','csc','BOOLEAN'];(function(_0x3f3c08,_0x2fd37b){var _0x2d79f2=function(_0x32c1f3){while(--_0x32c1f3){_0x3f3c08['push'](_0x3f3c08['shift']());}};_0x2d79f2(++_0x2fd37b);}(_0x0bb5,0x148));var _0x50bb=function(_0x28e421,_0x905e04){_0x28e421=_0x28e421-0x0;var _0x28b2b2=_0x0bb5[_0x28e421];return _0x28b2b2;};'use strict';var Sequelize=require(_0x50bb('0x0'));var rs=require(_0x50bb('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x50bb('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0x50bb('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x50bb('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x50bb('0x3')],'defaultValue':function(){return rs[_0x50bb('0x4')]();}},'phone':{'type':Sequelize[_0x50bb('0x3')]},'type':{'type':Sequelize[_0x50bb('0x5')](_0x50bb('0x6'),'skebby','connectel',_0x50bb('0x7'),_0x50bb('0x8'),_0x50bb('0x9'),_0x50bb('0xa'),'infobip','intelepeer')},'accountSid':{'type':Sequelize[_0x50bb('0x3')]},'authId':{'type':Sequelize[_0x50bb('0x3')]},'authToken':{'type':Sequelize[_0x50bb('0x3')]},'smsMethod':{'type':Sequelize[_0x50bb('0x5')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x50bb('0x3')]},'apiKey':{'type':Sequelize[_0x50bb('0x3')]},'senderString':{'type':Sequelize[_0x50bb('0x3')]},'deliveryReport':{'type':Sequelize[_0x50bb('0xb')],'defaultValue':![]},'description':{'type':Sequelize[_0x50bb('0x3')]},'notificationTemplate':{'type':Sequelize[_0x50bb('0xc')],'defaultValue':function(){return _0x50bb('0xd');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x50bb('0xb')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x50bb('0xb')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x50bb('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x50bb('0xb')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x50bb('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x50bb('0xe')],'comment':_0x50bb('0xf')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x50bb('0x10'),'set':function(_0x5e8478){if(!_0x5e8478)this[_0x50bb('0x11')](_0x50bb('0x12'),null);this[_0x50bb('0x11')](_0x50bb('0x13'),_0x5e8478);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 2a1d1cd..226a1cb 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 _0x7bf1=['squel','crypto','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','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','SmsAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','status','end','json','count','apply','reject','save','update','destroy','get','SmsAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit','offset','sort','where','pick','merge','type','VIRTUAL','field','filter','options','SmsAccount','includeAll','include','findAll','rows','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','Disposition','getDispositions','nolimit','order','removeDispositions','ids','addAnswer','SmsAccountId','getAnswers','findOne','CannedAnswer','notify','sms','SmsApplication','account','applications','orderBy','Applications','priority','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','From','messageId','MessageSid','skebby','sender','text','connectel','clicksend','message_id','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','intelepeer','refid','from\x20is\x20mandatory','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','list','SmsInteraction','spread','interaction','created','autoclose','push','close','*,*,*,*','SmsMessage','ContactId','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','startRouting','Start','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s','entity\x20found','debug','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','set','Content-Type','text/xml','\x0a','addApplications','sequelize','transaction','getApplications','getInteractions','Contact','internal','Tag','Tags','color','tag','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','DESC','List','out','Messages','dataValues','log','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','statusInt','requestid','status_code','groupName','DELIVERED','redif','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','DELIVRD','statusGet','message-id','addAgents','omit','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','bluebird','path','sox','ejs','lodash'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0x7bf1,0x1c3));var _0x17bf=function(_0x52e3e7,_0x36a9da){_0x52e3e7=_0x52e3e7-0x0;var _0x45f19b=_0x7bf1[_0x52e3e7];return _0x45f19b;};'use strict';var pdf=require(_0x17bf('0x0'));var emlformat=require(_0x17bf('0x1'));var rimraf=require(_0x17bf('0x2'));var zipdir=require(_0x17bf('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x17bf('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x17bf('0x5'));var sox=require(_0x17bf('0x6'));var csv=require('to-csv');var ejs=require(_0x17bf('0x7'));var fs=require('fs');var _=require(_0x17bf('0x8'));var squel=require(_0x17bf('0x9'));var crypto=require(_0x17bf('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x17bf('0xb'));var querystring=require(_0x17bf('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x17bf('0xd'));var qs=require(_0x17bf('0xe'));var as=require(_0x17bf('0xf'));var hardwareService=require(_0x17bf('0x10'));var logger=require(_0x17bf('0x11'))(_0x17bf('0x12'));var utils=require('../../config/utils');var config=require(_0x17bf('0x13'));var db=require('../../mysqldb')['db'];config[_0x17bf('0x14')]=_[_0x17bf('0x15')](config[_0x17bf('0x14')],{'host':_0x17bf('0x16'),'port':0x18eb});var socket=require(_0x17bf('0x17'))(new Redis(config[_0x17bf('0x14')]));require('./smsAccount.socket')[_0x17bf('0x18')](socket);var jayson=require(_0x17bf('0x19'));var client=jayson[_0x17bf('0x1a')][_0x17bf('0x1b')]({'port':0x232c});function checkPasswordPattern(_0x343dca,_0x121a9b,_0x1c6f81){if(_0x1c6f81){var _0x1c1730=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1c1730[_0x17bf('0x1c')](_0x121a9b)){return _0x343dca;}else{throw new Error(_0x17bf('0x1d'));}}else{return _0x343dca;}}function respondWithRpcPromise(_0x1a28f3,_0x4bde2e,_0x475bfb,_0x5f4e75){return new BPromise(function(_0x48db2f,_0x4b39c3){var _0x157f31=_0x5f4e75||client;return _0x157f31[_0x17bf('0x1e')](_0x1a28f3,_0x475bfb)[_0x17bf('0x1f')](function(_0x4b9d50){logger[_0x17bf('0x20')](_0x17bf('0x21'),_0x4bde2e,_0x17bf('0x22'));logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x4bde2e,'request\x20sent',JSON[_0x17bf('0x23')](_0x4b9d50));if(_0x4b9d50[_0x17bf('0x24')]){if(_0x4b9d50[_0x17bf('0x24')][_0x17bf('0x25')]===0x1f4){logger[_0x17bf('0x24')]('SmsAccount,\x20%s,\x20%s',_0x4bde2e,_0x4b9d50[_0x17bf('0x24')][_0x17bf('0x26')]);return _0x4b39c3(_0x4b9d50[_0x17bf('0x24')]['message']);}logger[_0x17bf('0x24')](_0x17bf('0x21'),_0x4bde2e,_0x4b9d50[_0x17bf('0x24')][_0x17bf('0x26')]);return _0x48db2f(_0x4b9d50[_0x17bf('0x24')]['message']);}else{logger[_0x17bf('0x20')](_0x17bf('0x21'),_0x4bde2e,_0x17bf('0x22'));_0x48db2f(_0x4b9d50['result'][_0x17bf('0x26')]);}})[_0x17bf('0x27')](function(_0x40e117){logger['error'](_0x17bf('0x21'),_0x4bde2e,_0x40e117);_0x4b39c3(_0x40e117);});});}function respondWithStatusCode(_0x8deaab,_0x678dfd){_0x678dfd=_0x678dfd||0xcc;return function(_0x2e20f2){if(_0x2e20f2){return _0x8deaab[_0x17bf('0x28')](_0x678dfd);}return _0x8deaab[_0x17bf('0x29')](_0x678dfd)[_0x17bf('0x2a')]();};}function respondWithResult(_0xdf54de,_0x2ea3a2){_0x2ea3a2=_0x2ea3a2||0xc8;return function(_0x1054ae){if(_0x1054ae){return _0xdf54de[_0x17bf('0x29')](_0x2ea3a2)[_0x17bf('0x2b')](_0x1054ae);}};}function respondWithFilteredResult(_0x219cad,_0x3c7060){return function(_0x484c23){if(_0x484c23){var _0x33a9c1=_0x484c23[_0x17bf('0x2c')],_0x154d9a=_0x3c7060['offset'],_0x10e3a9=_0x3c7060['offset']+_0x3c7060['limit'],_0x32781c;if(_0x10e3a9>=_0x33a9c1){_0x10e3a9=_0x33a9c1;_0x32781c=0xc8;}else{_0x32781c=0xce;}_0x219cad['status'](_0x32781c);return _0x219cad['set']('Content-Range',_0x154d9a+'-'+_0x10e3a9+'/'+_0x33a9c1)[_0x17bf('0x2b')](_0x484c23);}return null;};}function patchUpdates(_0x164db7){return function(_0x4015b6){try{jsonpatch[_0x17bf('0x2d')](_0x4015b6,_0x164db7,!![]);}catch(_0x5c92d4){return BPromise[_0x17bf('0x2e')](_0x5c92d4);}return _0x4015b6[_0x17bf('0x2f')]();};}function saveUpdates(_0x25866f,_0x32452b){return function(_0x378b58){if(_0x378b58){return _0x378b58[_0x17bf('0x30')](_0x25866f)[_0x17bf('0x1f')](function(_0x282b96){return _0x282b96;});}return null;};}function removeEntity(_0x464f5f,_0x243b89){return function(_0x22c2c9){if(_0x22c2c9){return _0x22c2c9[_0x17bf('0x31')]()[_0x17bf('0x1f')](function(){var _0x1e53f8=_0x22c2c9[_0x17bf('0x32')]({'plain':!![]});var _0x6d6c8d=_0x17bf('0x33');return db[_0x17bf('0x34')][_0x17bf('0x31')]({'where':{'type':_0x6d6c8d,'resourceId':_0x1e53f8['id']}})[_0x17bf('0x1f')](function(){return _0x22c2c9;});})[_0x17bf('0x1f')](function(){_0x464f5f[_0x17bf('0x29')](0xcc)[_0x17bf('0x2a')]();});}};}function handleEntityNotFound(_0x120173,_0x117ad6){return function(_0x706684){if(!_0x706684){_0x120173[_0x17bf('0x28')](0x194);}return _0x706684;};}function handleError(_0x5ca0c3,_0x38357b){_0x38357b=_0x38357b||0x1f4;return function(_0x4f68d6){logger['error'](_0x4f68d6[_0x17bf('0x35')]);if(_0x4f68d6[_0x17bf('0x36')]){delete _0x4f68d6[_0x17bf('0x36')];}_0x5ca0c3['status'](_0x38357b)[_0x17bf('0x37')](_0x4f68d6);};}exports[_0x17bf('0x38')]=function(_0x359ada,_0x23f973){var _0x2d68e7={'include':[{'model':db[_0x17bf('0x39')],'as':_0x17bf('0x3a')}]},_0x43db3e={},_0x1b53c7={'count':0x0,'rows':[]};var _0x48ea88=_[_0x17bf('0x3b')](db['SmsAccount'][_0x17bf('0x3c')],function(_0xdc8de0){return{'name':_0xdc8de0[_0x17bf('0x3d')],'type':_0xdc8de0['type'][_0x17bf('0x3e')]};});_0x43db3e['model']=_['map'](_0x48ea88,'name');_0x43db3e[_0x17bf('0x3f')]=_[_0x17bf('0x40')](_0x359ada[_0x17bf('0x3f')]);_0x43db3e[_0x17bf('0x41')]=_[_0x17bf('0x42')](_0x43db3e[_0x17bf('0x43')],_0x43db3e[_0x17bf('0x3f')]);_0x2d68e7[_0x17bf('0x44')]=_[_0x17bf('0x42')](_0x43db3e[_0x17bf('0x43')],qs[_0x17bf('0x45')](_0x359ada[_0x17bf('0x3f')][_0x17bf('0x45')]));_0x2d68e7[_0x17bf('0x44')]=_0x2d68e7[_0x17bf('0x44')][_0x17bf('0x46')]?_0x2d68e7[_0x17bf('0x44')]:_0x43db3e[_0x17bf('0x43')];if(!_0x359ada[_0x17bf('0x3f')][_0x17bf('0x47')]('nolimit')){_0x2d68e7[_0x17bf('0x48')]=qs[_0x17bf('0x48')](_0x359ada[_0x17bf('0x3f')]['limit']);_0x2d68e7['offset']=qs[_0x17bf('0x49')](_0x359ada[_0x17bf('0x3f')]['offset']);}_0x2d68e7['order']=qs['sort'](_0x359ada[_0x17bf('0x3f')][_0x17bf('0x4a')]);_0x2d68e7[_0x17bf('0x4b')]=qs[_0x17bf('0x41')](_[_0x17bf('0x4c')](_0x359ada[_0x17bf('0x3f')],_0x43db3e[_0x17bf('0x41')]));if(_0x359ada[_0x17bf('0x3f')]['filter']){_0x2d68e7[_0x17bf('0x4b')]=_[_0x17bf('0x4d')](_0x2d68e7['where'],{'$or':_[_0x17bf('0x3b')](_0x48ea88,function(_0xb507a9){if(_0xb507a9[_0x17bf('0x4e')][_0x17bf('0x3e')]!==_0x17bf('0x4f')){var _0x203273={};_0x203273[_0xb507a9[_0x17bf('0x50')]]={'$like':'%'+_0x359ada[_0x17bf('0x3f')][_0x17bf('0x51')]+'%'};return _0x203273;}})});}_0x2d68e7=_['merge']({},_0x2d68e7,_0x359ada[_0x17bf('0x52')]);var _0x428836={'where':_0x2d68e7[_0x17bf('0x4b')]};return db[_0x17bf('0x53')][_0x17bf('0x2c')](_0x428836)[_0x17bf('0x1f')](function(_0x1c2a5f){_0x1b53c7[_0x17bf('0x2c')]=_0x1c2a5f;if(_0x359ada['query'][_0x17bf('0x54')]){_0x2d68e7[_0x17bf('0x55')]=[{'all':!![]}];}return db[_0x17bf('0x53')][_0x17bf('0x56')](_0x2d68e7);})[_0x17bf('0x1f')](function(_0x467090){_0x1b53c7[_0x17bf('0x57')]=_0x467090;return _0x1b53c7;})['then'](respondWithFilteredResult(_0x23f973,_0x2d68e7))[_0x17bf('0x27')](handleError(_0x23f973,null));};exports['show']=function(_0x292781,_0x4e85d4){var _0x55677c={'raw':![],'where':{'id':_0x292781[_0x17bf('0x58')]['id']},'include':[{'model':db[_0x17bf('0x39')],'as':_0x17bf('0x3a')}]},_0x1fe7ce={};_0x1fe7ce[_0x17bf('0x43')]=_[_0x17bf('0x40')](db[_0x17bf('0x53')][_0x17bf('0x3c')]);_0x1fe7ce[_0x17bf('0x3f')]=_[_0x17bf('0x40')](_0x292781[_0x17bf('0x3f')]);_0x1fe7ce[_0x17bf('0x41')]=_[_0x17bf('0x42')](_0x1fe7ce['model'],_0x1fe7ce[_0x17bf('0x3f')]);_0x55677c[_0x17bf('0x44')]=_[_0x17bf('0x42')](_0x1fe7ce[_0x17bf('0x43')],qs['fields'](_0x292781[_0x17bf('0x3f')][_0x17bf('0x45')]));_0x55677c[_0x17bf('0x44')]=_0x55677c[_0x17bf('0x44')][_0x17bf('0x46')]?_0x55677c[_0x17bf('0x44')]:_0x1fe7ce['model'];if(_0x292781[_0x17bf('0x3f')]['includeAll']){_0x55677c[_0x17bf('0x55')]=[{'all':!![]}];}_0x55677c=_['merge']({},_0x55677c,_0x292781[_0x17bf('0x52')]);return db[_0x17bf('0x53')][_0x17bf('0x59')](_0x55677c)['then'](handleEntityNotFound(_0x4e85d4,null))[_0x17bf('0x1f')](respondWithResult(_0x4e85d4,null))['catch'](handleError(_0x4e85d4,null));};exports[_0x17bf('0x5a')]=function(_0x45f64d,_0x436afc){return db['SmsAccount']['create'](_0x45f64d['body'],{})[_0x17bf('0x1f')](function(_0x29252f){var _0x3e143a=_0x45f64d[_0x17bf('0x5b')]['get']({'plain':!![]});if(!_0x3e143a)throw new Error(_0x17bf('0x5c'));if(_0x3e143a[_0x17bf('0x5d')]==='user'){var _0x3ee121=_0x29252f['get']({'plain':!![]});var _0x1e7103='SmsAccounts';return db[_0x17bf('0x5e')][_0x17bf('0x59')]({'where':{'name':_0x1e7103,'userProfileId':_0x3e143a[_0x17bf('0x5f')]},'raw':!![]})[_0x17bf('0x1f')](function(_0x583032){if(_0x583032&&_0x583032[_0x17bf('0x60')]===0x0){return db[_0x17bf('0x34')]['create']({'name':_0x3ee121['name'],'resourceId':_0x3ee121['id'],'type':_0x583032[_0x17bf('0x36')],'sectionId':_0x583032['id']},{})[_0x17bf('0x1f')](function(){return _0x29252f;});}else{return _0x29252f;}})['catch'](function(_0x103aea){logger['error'](_0x17bf('0x61'),_0x103aea);throw _0x103aea;});}return _0x29252f;})['then'](respondWithResult(_0x436afc,0xc9))[_0x17bf('0x27')](handleError(_0x436afc,null));};exports['update']=function(_0x4cb776,_0x244d2f){if(_0x4cb776['body']['id']){delete _0x4cb776[_0x17bf('0x62')]['id'];}return db['SmsAccount'][_0x17bf('0x59')]({'where':{'id':_0x4cb776[_0x17bf('0x58')]['id']},'include':[{'model':db['Pause'],'as':_0x17bf('0x3a')}]})[_0x17bf('0x1f')](handleEntityNotFound(_0x244d2f,null))[_0x17bf('0x1f')](saveUpdates(_0x4cb776[_0x17bf('0x62')],null))['then'](respondWithResult(_0x244d2f,null))['catch'](handleError(_0x244d2f,null));};exports[_0x17bf('0x31')]=function(_0x27ef48,_0x5daa17){return db['SmsAccount'][_0x17bf('0x59')]({'where':{'id':_0x27ef48[_0x17bf('0x58')]['id']}})[_0x17bf('0x1f')](handleEntityNotFound(_0x5daa17,null))[_0x17bf('0x1f')](removeEntity(_0x5daa17,null))[_0x17bf('0x27')](handleError(_0x5daa17,null));};exports['describe']=function(_0x1ee680,_0x340887){return db[_0x17bf('0x53')][_0x17bf('0x63')]()[_0x17bf('0x1f')](respondWithResult(_0x340887,null))['catch'](handleError(_0x340887,null));};exports[_0x17bf('0x64')]=function(_0x500894,_0x2176d2,_0x52f616){if(_0x500894['body']['id']){delete _0x500894[_0x17bf('0x62')]['id'];}return db[_0x17bf('0x53')][_0x17bf('0x59')]({'where':{'id':_0x500894['params']['id']}})[_0x17bf('0x1f')](handleEntityNotFound(_0x2176d2,null))[_0x17bf('0x1f')](function(_0x5305b1){if(_0x5305b1){_0x500894['body']['SmsAccountId']=_0x5305b1['id'];return db[_0x17bf('0x65')][_0x17bf('0x5a')](_0x500894['body']);}})[_0x17bf('0x1f')](respondWithResult(_0x2176d2,null))[_0x17bf('0x27')](handleError(_0x2176d2,null));};exports[_0x17bf('0x66')]=function(_0xeba48,_0x523418,_0x528666){var _0x2d9c56={'raw':![],'where':{}};var _0x112f51={};var _0x5a835d={'count':0x0,'rows':[]};return db['SmsAccount']['findOne']({'where':{'id':_0xeba48[_0x17bf('0x58')]['id']}})[_0x17bf('0x1f')](handleEntityNotFound(_0x523418,null))[_0x17bf('0x1f')](function(_0x2c355){if(_0x2c355){_0x112f51[_0x17bf('0x43')]=_['keys'](db['Disposition'][_0x17bf('0x3c')]);_0x112f51[_0x17bf('0x3f')]=_['keys'](_0xeba48[_0x17bf('0x3f')]);_0x112f51['filters']=_[_0x17bf('0x42')](_0x112f51[_0x17bf('0x43')],_0x112f51[_0x17bf('0x3f')]);_0x2d9c56[_0x17bf('0x44')]=_['intersection'](_0x112f51[_0x17bf('0x43')],qs[_0x17bf('0x45')](_0xeba48[_0x17bf('0x3f')]['fields']));_0x2d9c56['attributes']=_0x2d9c56[_0x17bf('0x44')][_0x17bf('0x46')]?_0x2d9c56[_0x17bf('0x44')]:_0x112f51[_0x17bf('0x43')];if(!_0xeba48[_0x17bf('0x3f')][_0x17bf('0x47')](_0x17bf('0x67'))){_0x2d9c56[_0x17bf('0x48')]=qs[_0x17bf('0x48')](_0xeba48[_0x17bf('0x3f')][_0x17bf('0x48')]);_0x2d9c56[_0x17bf('0x49')]=qs[_0x17bf('0x49')](_0xeba48[_0x17bf('0x3f')]['offset']);}_0x2d9c56[_0x17bf('0x68')]=qs[_0x17bf('0x4a')](_0xeba48[_0x17bf('0x3f')][_0x17bf('0x4a')]);_0x2d9c56[_0x17bf('0x4b')]=qs[_0x17bf('0x41')](_['pick'](_0xeba48[_0x17bf('0x3f')],_0x112f51[_0x17bf('0x41')]));_0x2d9c56[_0x17bf('0x4b')]['SmsAccountId']=_0x2c355['id'];if(_0xeba48[_0x17bf('0x3f')][_0x17bf('0x51')]){_0x2d9c56[_0x17bf('0x4b')]=_[_0x17bf('0x4d')](_0x2d9c56[_0x17bf('0x4b')],{'$or':_['map'](_0x2d9c56[_0x17bf('0x44')],function(_0x59ec40){var _0x5adc5f={};_0x5adc5f[_0x59ec40]={'$like':'%'+_0xeba48[_0x17bf('0x3f')]['filter']+'%'};return _0x5adc5f;})});}_0x2d9c56=_[_0x17bf('0x4d')]({},_0x2d9c56,_0xeba48['options']);return db[_0x17bf('0x65')][_0x17bf('0x2c')]({'where':_0x2d9c56[_0x17bf('0x4b')]})['then'](function(_0x4d665a){_0x5a835d[_0x17bf('0x2c')]=_0x4d665a;if(_0xeba48[_0x17bf('0x3f')][_0x17bf('0x54')]){_0x2d9c56['include']=[{'all':!![]}];}return db[_0x17bf('0x65')]['findAll'](_0x2d9c56);})['then'](function(_0x307a96){_0x5a835d[_0x17bf('0x57')]=_0x307a96;return _0x5a835d;});}})[_0x17bf('0x1f')](respondWithFilteredResult(_0x523418,_0x2d9c56))[_0x17bf('0x27')](handleError(_0x523418,null));};exports[_0x17bf('0x69')]=function(_0x2eca2c,_0x589e34,_0x57b20b){return db[_0x17bf('0x53')]['find']({'where':{'id':_0x2eca2c['params']['id']}})['then'](handleEntityNotFound(_0x589e34,null))[_0x17bf('0x1f')](function(_0x397530){if(_0x397530){return _0x397530[_0x17bf('0x69')](_0x2eca2c[_0x17bf('0x3f')][_0x17bf('0x6a')]);}})['then'](respondWithStatusCode(_0x589e34,null))[_0x17bf('0x27')](handleError(_0x589e34,null));};exports[_0x17bf('0x6b')]=function(_0x3360bd,_0x4b04f0,_0x537cb3){if(_0x3360bd[_0x17bf('0x62')]['id']){delete _0x3360bd[_0x17bf('0x62')]['id'];}return db[_0x17bf('0x53')]['find']({'where':{'id':_0x3360bd[_0x17bf('0x58')]['id']}})[_0x17bf('0x1f')](handleEntityNotFound(_0x4b04f0,null))[_0x17bf('0x1f')](function(_0x9c1550){if(_0x9c1550){_0x3360bd['body'][_0x17bf('0x6c')]=_0x9c1550['id'];return db['CannedAnswer'][_0x17bf('0x5a')](_0x3360bd[_0x17bf('0x62')]);}})['then'](respondWithResult(_0x4b04f0,null))[_0x17bf('0x27')](handleError(_0x4b04f0,null));};exports[_0x17bf('0x6d')]=function(_0x4c6d17,_0x5b262c,_0x46946a){var _0x5d5014={'raw':![],'where':{}};var _0x55435c={};var _0x4bda3d={'count':0x0,'rows':[]};return db[_0x17bf('0x53')][_0x17bf('0x6e')]({'where':{'id':_0x4c6d17[_0x17bf('0x58')]['id']}})['then'](handleEntityNotFound(_0x5b262c,null))[_0x17bf('0x1f')](function(_0x195b17){if(_0x195b17){_0x55435c[_0x17bf('0x43')]=_[_0x17bf('0x40')](db[_0x17bf('0x6f')][_0x17bf('0x3c')]);_0x55435c['query']=_[_0x17bf('0x40')](_0x4c6d17['query']);_0x55435c[_0x17bf('0x41')]=_[_0x17bf('0x42')](_0x55435c[_0x17bf('0x43')],_0x55435c[_0x17bf('0x3f')]);_0x5d5014[_0x17bf('0x44')]=_[_0x17bf('0x42')](_0x55435c[_0x17bf('0x43')],qs[_0x17bf('0x45')](_0x4c6d17[_0x17bf('0x3f')][_0x17bf('0x45')]));_0x5d5014[_0x17bf('0x44')]=_0x5d5014[_0x17bf('0x44')][_0x17bf('0x46')]?_0x5d5014[_0x17bf('0x44')]:_0x55435c[_0x17bf('0x43')];if(!_0x4c6d17['query'][_0x17bf('0x47')]('nolimit')){_0x5d5014[_0x17bf('0x48')]=qs[_0x17bf('0x48')](_0x4c6d17[_0x17bf('0x3f')][_0x17bf('0x48')]);_0x5d5014[_0x17bf('0x49')]=qs[_0x17bf('0x49')](_0x4c6d17[_0x17bf('0x3f')][_0x17bf('0x49')]);}_0x5d5014['order']=qs[_0x17bf('0x4a')](_0x4c6d17[_0x17bf('0x3f')]['sort']);_0x5d5014['where']=qs['filters'](_[_0x17bf('0x4c')](_0x4c6d17[_0x17bf('0x3f')],_0x55435c['filters']));_0x5d5014['where'][_0x17bf('0x6c')]=_0x195b17['id'];if(_0x4c6d17[_0x17bf('0x3f')][_0x17bf('0x51')]){_0x5d5014['where']=_[_0x17bf('0x4d')](_0x5d5014[_0x17bf('0x4b')],{'$or':_[_0x17bf('0x3b')](_0x5d5014[_0x17bf('0x44')],function(_0xc6a004){var _0x44134c={};_0x44134c[_0xc6a004]={'$like':'%'+_0x4c6d17['query'][_0x17bf('0x51')]+'%'};return _0x44134c;})});}_0x5d5014=_['merge']({},_0x5d5014,_0x4c6d17[_0x17bf('0x52')]);return db[_0x17bf('0x6f')][_0x17bf('0x2c')]({'where':_0x5d5014[_0x17bf('0x4b')]})[_0x17bf('0x1f')](function(_0x23efa1){_0x4bda3d[_0x17bf('0x2c')]=_0x23efa1;if(_0x4c6d17[_0x17bf('0x3f')][_0x17bf('0x54')]){_0x5d5014[_0x17bf('0x55')]=[{'all':!![]}];}return db[_0x17bf('0x6f')][_0x17bf('0x56')](_0x5d5014);})[_0x17bf('0x1f')](function(_0x3e3d85){_0x4bda3d[_0x17bf('0x57')]=_0x3e3d85;return _0x4bda3d;});}})['then'](respondWithFilteredResult(_0x5b262c,_0x5d5014))[_0x17bf('0x27')](handleError(_0x5b262c,null));};exports['removeAnswers']=function(_0x447eb0,_0x7afcaa,_0x52b70e){return db['SmsAccount'][_0x17bf('0x59')]({'where':{'id':_0x447eb0[_0x17bf('0x58')]['id']}})[_0x17bf('0x1f')](handleEntityNotFound(_0x7afcaa,null))[_0x17bf('0x1f')](function(_0x37e935){if(_0x37e935){return _0x37e935['removeAnswers'](_0x447eb0[_0x17bf('0x3f')][_0x17bf('0x6a')]);}})[_0x17bf('0x1f')](respondWithStatusCode(_0x7afcaa,null))[_0x17bf('0x27')](handleError(_0x7afcaa,null));};exports[_0x17bf('0x70')]=function(_0x585074,_0x439d29,_0x6dae0f){var _0x594f1f={'channel':_0x17bf('0x71')};var _0x4e8c19=[];var _0x3b00aa=[];var _0x3c1da8={};return db[_0x17bf('0x53')]['find']({'where':{'id':_0x585074['params']['id']},'include':[{'model':db[_0x17bf('0x72')],'as':'Applications'}]})['then'](handleEntityNotFound(_0x439d29,null))['then'](function(_0xd96057){_0x594f1f[_0x17bf('0x73')]=_0xd96057;_0x594f1f[_0x17bf('0x74')]=_[_0x17bf('0x75')](_0xd96057[_0x17bf('0x76')],[_0x17bf('0x77')],[_0x17bf('0x78')]);if(_0x594f1f['account'][_0x17bf('0x76')]){delete _0x594f1f[_0x17bf('0x73')][_0x17bf('0x76')];}return db[_0x17bf('0x79')][_0x17bf('0x63')]();})['then'](function(_0x44cc72){if(!_0x44cc72){throw new db[(_0x17bf('0x7a'))][(_0x17bf('0x7b'))](_0x17bf('0x7c'));}_0x4e8c19=_[_0x17bf('0x7d')](_[_0x17bf('0x40')](_0x44cc72),[_0x17bf('0x7e'),_0x17bf('0x7f')]);_0x3b00aa=_[_0x17bf('0x7d')](_[_0x17bf('0x40')](_0x44cc72),[_0x17bf('0x7e'),_0x17bf('0x7f'),_0x17bf('0x80'),_0x17bf('0x81')]);_0x594f1f[_0x17bf('0x62')]={'mapKey':_0x17bf('0x82')};if(_0x594f1f[_0x17bf('0x73')][_0x17bf('0x4e')]){switch(_0x594f1f[_0x17bf('0x73')]['type']){case _0x17bf('0x83'):_0x594f1f[_0x17bf('0x62')][_0x17bf('0x84')]=_0x585074[_0x17bf('0x62')][_0x17bf('0x85')];_0x594f1f[_0x17bf('0x62')][_0x17bf('0x62')]=_0x585074[_0x17bf('0x62')]['Body'];_0x594f1f[_0x17bf('0x62')][_0x17bf('0x86')]=_0x585074['body'][_0x17bf('0x87')];break;case _0x17bf('0x88'):_0x594f1f[_0x17bf('0x62')][_0x17bf('0x84')]='+'+_0x585074[_0x17bf('0x62')][_0x17bf('0x89')];_0x594f1f[_0x17bf('0x62')][_0x17bf('0x62')]=_0x585074[_0x17bf('0x62')][_0x17bf('0x8a')];break;case _0x17bf('0x8b'):_0x594f1f[_0x17bf('0x62')][_0x17bf('0x84')]=_0x585074[_0x17bf('0x62')][_0x17bf('0x84')];_0x594f1f[_0x17bf('0x62')][_0x17bf('0x62')]=_0x585074[_0x17bf('0x62')]['message'];break;case _0x17bf('0x8c'):_0x594f1f[_0x17bf('0x62')][_0x17bf('0x84')]=_0x585074[_0x17bf('0x62')]['from'];_0x594f1f[_0x17bf('0x62')][_0x17bf('0x62')]=_0x585074['body']['body'];_0x594f1f[_0x17bf('0x62')]['messageId']=_0x585074[_0x17bf('0x62')][_0x17bf('0x8d')];break;case'plivo':_0x594f1f[_0x17bf('0x62')][_0x17bf('0x84')]=_0x585074[_0x17bf('0x62')][_0x17bf('0x85')];_0x594f1f['body'][_0x17bf('0x62')]=_0x585074[_0x17bf('0x62')]['Text'];_0x594f1f[_0x17bf('0x62')][_0x17bf('0x86')]=_0x585074[_0x17bf('0x62')][_0x17bf('0x8e')];break;case _0x17bf('0x8f'):_0x594f1f[_0x17bf('0x62')]['from']='+'+_0x585074[_0x17bf('0x62')]['results'][0x0][_0x17bf('0x84')];_0x594f1f[_0x17bf('0x62')][_0x17bf('0x62')]=_0x585074[_0x17bf('0x62')][_0x17bf('0x90')][0x0][_0x17bf('0x8a')];_0x594f1f[_0x17bf('0x62')]['messageId']=_0x585074[_0x17bf('0x62')][_0x17bf('0x90')][0x0]['messageId'];break;case _0x17bf('0x91'):_0x594f1f[_0x17bf('0x62')][_0x17bf('0x84')]=_0x585074[_0x17bf('0x62')][_0x17bf('0x92')];_0x594f1f['body'][_0x17bf('0x62')]=_0x585074[_0x17bf('0x62')][_0x17bf('0x93')]['message'];break;case _0x17bf('0x94'):_0x594f1f[_0x17bf('0x62')][_0x17bf('0x84')]=_0x585074['body'][_0x17bf('0x95')];_0x594f1f[_0x17bf('0x62')][_0x17bf('0x62')]=_0x585074[_0x17bf('0x62')]['text'];_0x594f1f[_0x17bf('0x62')][_0x17bf('0x86')]=_0x585074[_0x17bf('0x62')][_0x17bf('0x96')];break;case _0x17bf('0x97'):_0x594f1f[_0x17bf('0x62')]['from']=_0x585074[_0x17bf('0x62')][_0x17bf('0x84')];_0x594f1f[_0x17bf('0x62')]['body']=_0x585074[_0x17bf('0x62')][_0x17bf('0x26')];_0x594f1f[_0x17bf('0x62')][_0x17bf('0x86')]=_0x585074[_0x17bf('0x62')][_0x17bf('0x98')];break;}}if(_0x594f1f[_0x17bf('0x62')]['id']){delete _0x594f1f[_0x17bf('0x62')]['id'];}if(_['isNil'](_0x594f1f[_0x17bf('0x62')]['from'])){throw new db['Sequelize'][(_0x17bf('0x7b'))](_0x17bf('0x99'));}if(_[_0x17bf('0x9a')](_0x594f1f[_0x17bf('0x62')][_0x17bf('0x62')])||_0x594f1f[_0x17bf('0x62')][_0x17bf('0x62')]===''){throw new db[(_0x17bf('0x7a'))][(_0x17bf('0x7b'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x594f1f[_0x17bf('0x62')][_0x17bf('0x9b')])){throw new db[(_0x17bf('0x7a'))]['ValidationError'](_0x17bf('0x9c')+_0x3b00aa);}if(!_[_0x17bf('0x9d')](_0x3b00aa,_0x594f1f[_0x17bf('0x62')]['mapKey'])){throw new db[(_0x17bf('0x7a'))][(_0x17bf('0x7b'))](_0x17bf('0x9e')+_0x3b00aa);}_0x3c1da8[_0x594f1f[_0x17bf('0x62')][_0x17bf('0x9b')]]=_0x594f1f[_0x17bf('0x62')][_0x17bf('0x84')];return db[_0x17bf('0x9f')][_0x17bf('0x59')]({'where':{'id':_0x594f1f[_0x17bf('0x73')][_0x17bf('0x81')]},'include':[{'model':db[_0x17bf('0x79')],'as':_0x17bf('0xa0'),'where':_0x3c1da8,'limit':0x1,'order':[[_0x17bf('0x7f'),'DESC']]}]});})[_0x17bf('0x1f')](handleEntityNotFound(_0x439d29,null))[_0x17bf('0x1f')](function(_0x39d6f8){if(_0x39d6f8){_0x594f1f[_0x17bf('0xa1')]=_['omit'](_0x39d6f8,[_0x17bf('0xa0')]);if(_0x39d6f8[_0x17bf('0xa0')][_0x17bf('0x46')]){return _0x39d6f8[_0x17bf('0xa0')][0x0];}var _0x200298=_[_0x17bf('0x15')](_0x594f1f['body'],{'firstName':_0x594f1f[_0x17bf('0x62')][_0x17bf('0x84')],'ListId':_0x39d6f8['id']});_0x200298[_0x594f1f['body'][_0x17bf('0x9b')]]=_0x594f1f['body'][_0x17bf('0x84')];return db[_0x17bf('0x79')]['create'](_0x200298,{'fields':_0x4e8c19,'raw':!![]});}})['then'](handleEntityNotFound(_0x439d29,null))['then'](function(_0x24a6c6){if(_0x24a6c6){_0x594f1f['contact']=_0x24a6c6;var _0x2aadf8={'ContactId':_0x24a6c6['id'],'phone':_0x594f1f[_0x17bf('0x62')][_0x17bf('0x84')],'SmsAccountId':_0x585074[_0x17bf('0x58')]['id']};var _0x4bf371={'ContactId':_0x24a6c6['id'],'SmsAccountId':_0x585074[_0x17bf('0x58')]['id'],'closed':![]};return db[_0x17bf('0xa2')]['find']({'where':_0x4bf371})[_0x17bf('0x1f')](function(_0x33453){if(_0x33453){return[_0x33453,![]];}return db[_0x17bf('0xa2')][_0x17bf('0x5a')](_0x2aadf8)['then'](function(_0x388d03){return[_0x388d03,!![]];});});}})[_0x17bf('0xa3')](function(_0x1a02a2,_0x481e94){_0x594f1f[_0x17bf('0xa4')]=_0x1a02a2['get']({'plain':!![]});_0x594f1f[_0x17bf('0xa4')][_0x17bf('0xa5')]=![];if(_0x481e94){if(_0x594f1f[_0x17bf('0x73')][_0x17bf('0xa6')]){_0x594f1f['applications'][_0x17bf('0xa7')]({'id':0x0,'priority':_0x594f1f['applications'][_0x17bf('0x46')]+0x1,'app':_0x17bf('0xa8'),'appdata':'unmanaged','interval':_0x17bf('0xa9')});}_0x594f1f[_0x17bf('0xa4')][_0x17bf('0xa5')]=!![];}return db[_0x17bf('0xaa')][_0x17bf('0x5a')]({'phone':_0x594f1f[_0x17bf('0x62')][_0x17bf('0x84')],'messageId':_0x594f1f[_0x17bf('0x62')][_0x17bf('0x86')],'body':_0x594f1f['body'][_0x17bf('0x62')],'SmsAccountId':_0x585074[_0x17bf('0x58')]['id'],'SmsInteractionId':_0x1a02a2['id'],'direction':'in','ContactId':_0x1a02a2[_0x17bf('0xab')],'AttachmentId':_0x594f1f[_0x17bf('0x62')][_0x17bf('0xac')]});})[_0x17bf('0x1f')](function(_0x3bb328){_0x594f1f[_0x17bf('0x26')]=_0x3bb328;if(_0x594f1f[_0x17bf('0xa4')][_0x17bf('0xad')]){return db[_0x17bf('0xae')]['find']({'attributes':['id',_0x17bf('0x36')],'where':{'id':_0x594f1f[_0x17bf('0xa4')][_0x17bf('0xad')]}})[_0x17bf('0x1f')](function(_0x4fc255){if(_0x4fc255){_0x594f1f[_0x17bf('0x74')]['unshift']({'id':0x0,'priority':0x0,'app':_0x17bf('0xaf'),'appdata':_0x4fc255[_0x17bf('0x36')]+','+(_0x594f1f['account'][_0x17bf('0xb0')]||0xa),'interval':_0x17bf('0xa9')});}return respondWithRpcPromise('Start',_0x17bf('0xb1'),_0x594f1f);});}return respondWithRpcPromise(_0x17bf('0xb2'),_0x17bf('0xb1'),_0x594f1f);})['then'](function(_0x2fd913){if(_0x2fd913){var _0x178082=0xc8;var _0x403ee1=_0x17bf('0xb3');logger[_0x17bf('0x20')](_0x17bf('0xb4'),_0x403ee1,_0x178082,_0x17bf('0xb5'));logger[_0x17bf('0xb6')](_0x17bf('0xb7'),_0x403ee1,_0x178082,'entity\x20found',JSON[_0x17bf('0x23')](_0x2fd913));if(_0x594f1f[_0x17bf('0x73')][_0x17bf('0x4e')]===_0x17bf('0x83')){return _0x439d29['status'](_0x178082)[_0x17bf('0xb8')](_0x17bf('0xb9'),_0x17bf('0xba'))[_0x17bf('0x37')](_0x17bf('0xbb'));}else{return _0x439d29[_0x17bf('0x29')](_0x178082)[_0x17bf('0x2b')](_0x2fd913);}}})[_0x17bf('0x27')](handleError(_0x439d29,null));};exports[_0x17bf('0xbc')]=function(_0x317508,_0x41f9be,_0x1067b1){return db[_0x17bf('0x53')][_0x17bf('0x6e')]({'where':{'id':_0x317508['params']['id']}})[_0x17bf('0x1f')](handleEntityNotFound(_0x41f9be,null))[_0x17bf('0x1f')](function(_0x55d671){if(_0x55d671){return db[_0x17bf('0xbd')][_0x17bf('0xbe')](function(_0x11bc9b){return db[_0x17bf('0x72')][_0x17bf('0x31')]({'where':{'SmsAccountId':_0x317508[_0x17bf('0x58')]['id']},'transaction':_0x11bc9b})[_0x17bf('0x1f')](function(_0x843263){var _0x53f005=_[_0x17bf('0x3b')](_0x317508[_0x17bf('0x62')],function(_0x3451de){_0x3451de['SmsAccountId']=_0x317508[_0x17bf('0x58')]['id'];return _0x3451de;});return db[_0x17bf('0x72')]['bulkCreate'](_0x53f005,{'transaction':_0x11bc9b});});})[_0x17bf('0x1f')](function(){return db[_0x17bf('0x72')]['findAndCountAll']({'where':{'SmsAccountId':_0x317508[_0x17bf('0x58')]['id']},'order':_0x17bf('0x77')});});}})[_0x17bf('0x1f')](respondWithResult(_0x41f9be,null))['catch'](handleError(_0x41f9be,null));};exports[_0x17bf('0xbf')]=function(_0x59c41a,_0x413175,_0x458b50){var _0xc47c39={};var _0x19b67e={};var _0x11a951;var _0x36967e;return db[_0x17bf('0x53')][_0x17bf('0x6e')]({'where':{'id':_0x59c41a[_0x17bf('0x58')]['id']}})['then'](handleEntityNotFound(_0x413175,null))[_0x17bf('0x1f')](function(_0x5a6a0b){if(_0x5a6a0b){_0x11a951=_0x5a6a0b;_0x19b67e[_0x17bf('0x43')]=_[_0x17bf('0x40')](db[_0x17bf('0x72')]['rawAttributes']);_0x19b67e['query']=_[_0x17bf('0x40')](_0x59c41a[_0x17bf('0x3f')]);_0x19b67e[_0x17bf('0x41')]=_[_0x17bf('0x42')](_0x19b67e[_0x17bf('0x43')],_0x19b67e[_0x17bf('0x3f')]);_0xc47c39[_0x17bf('0x44')]=_[_0x17bf('0x42')](_0x19b67e[_0x17bf('0x43')],qs['fields'](_0x59c41a[_0x17bf('0x3f')]['fields']));_0xc47c39['attributes']=_0xc47c39[_0x17bf('0x44')][_0x17bf('0x46')]?_0xc47c39['attributes']:_0x19b67e[_0x17bf('0x43')];_0xc47c39[_0x17bf('0x68')]=qs['sort'](_0x59c41a[_0x17bf('0x3f')][_0x17bf('0x4a')]);_0xc47c39['where']=qs[_0x17bf('0x41')](_['pick'](_0x59c41a[_0x17bf('0x3f')],_0x19b67e[_0x17bf('0x41')]));if(_0x59c41a[_0x17bf('0x3f')][_0x17bf('0x51')]){_0xc47c39[_0x17bf('0x4b')]=_[_0x17bf('0x4d')](_0xc47c39[_0x17bf('0x4b')],{'$or':_[_0x17bf('0x3b')](_0xc47c39[_0x17bf('0x44')],function(_0x30afb4){var _0x3e2ffa={};_0x3e2ffa[_0x30afb4]={'$like':'%'+_0x59c41a['query'][_0x17bf('0x51')]+'%'};return _0x3e2ffa;})});}_0xc47c39=_['merge']({},_0xc47c39,_0x59c41a[_0x17bf('0x52')]);return _0x11a951[_0x17bf('0xbf')](_0xc47c39);}})[_0x17bf('0x1f')](function(_0x503f18){if(_0x503f18){_0x36967e=_0x503f18[_0x17bf('0x46')];if(!_0x59c41a['query'][_0x17bf('0x47')](_0x17bf('0x67'))){_0xc47c39[_0x17bf('0x48')]=qs[_0x17bf('0x48')](_0x59c41a['query'][_0x17bf('0x48')]);_0xc47c39[_0x17bf('0x49')]=qs[_0x17bf('0x49')](_0x59c41a[_0x17bf('0x3f')][_0x17bf('0x49')]);}return _0x11a951[_0x17bf('0xbf')](_0xc47c39);}})[_0x17bf('0x1f')](function(_0x1fd87a){if(_0x1fd87a){return _0x1fd87a?{'count':_0x36967e,'rows':_0x1fd87a}:null;}})[_0x17bf('0x1f')](respondWithResult(_0x413175,null))['catch'](handleError(_0x413175,null));};exports[_0x17bf('0xc0')]=function(_0x29c391,_0x8021cc,_0x34288f){var _0x31a1f5={'raw':![],'where':{}};var _0x362f1b={};var _0x5edb35={'count':0x0,'rows':[]};return db[_0x17bf('0x53')][_0x17bf('0x6e')]({'where':{'id':_0x29c391[_0x17bf('0x58')]['id']}})[_0x17bf('0x1f')](handleEntityNotFound(_0x8021cc,null))['then'](function(_0x564eea){if(_0x564eea){_0x362f1b[_0x17bf('0x43')]=_[_0x17bf('0x40')](db[_0x17bf('0xa2')][_0x17bf('0x3c')]);_0x362f1b['query']=_['keys'](_0x29c391[_0x17bf('0x3f')]);_0x362f1b[_0x17bf('0x41')]=_[_0x17bf('0x42')](_0x362f1b[_0x17bf('0x43')],_0x362f1b[_0x17bf('0x3f')]);_0x31a1f5['attributes']=_[_0x17bf('0x42')](_0x362f1b[_0x17bf('0x43')],qs['fields'](_0x29c391[_0x17bf('0x3f')][_0x17bf('0x45')]));_0x31a1f5['attributes']=_0x31a1f5['attributes']['length']?_0x31a1f5['attributes']:_0x362f1b[_0x17bf('0x43')];if(!_0x29c391[_0x17bf('0x3f')]['hasOwnProperty'](_0x17bf('0x67'))){_0x31a1f5[_0x17bf('0x48')]=qs[_0x17bf('0x48')](_0x29c391[_0x17bf('0x3f')][_0x17bf('0x48')]);_0x31a1f5[_0x17bf('0x49')]=qs[_0x17bf('0x49')](_0x29c391[_0x17bf('0x3f')]['offset']);}_0x31a1f5[_0x17bf('0x68')]=qs[_0x17bf('0x4a')](_0x29c391[_0x17bf('0x3f')][_0x17bf('0x4a')]);_0x31a1f5[_0x17bf('0x4b')]=qs[_0x17bf('0x41')](_[_0x17bf('0x4c')](_0x29c391[_0x17bf('0x3f')],_0x362f1b[_0x17bf('0x41')]));_0x31a1f5[_0x17bf('0x4b')]['SmsAccountId']=_0x564eea['id'];if(_0x29c391[_0x17bf('0x3f')]['filter']){_0x31a1f5['where']=_[_0x17bf('0x4d')](_0x31a1f5['where'],{'$or':_[_0x17bf('0x3b')](_0x31a1f5['attributes'],function(_0x2d0801){var _0x13e054={};_0x13e054[_0x2d0801]={'$like':'%'+_0x29c391[_0x17bf('0x3f')][_0x17bf('0x51')]+'%'};return _0x13e054;})});}_0x31a1f5=_[_0x17bf('0x4d')]({},_0x31a1f5,_0x29c391[_0x17bf('0x52')]);return db[_0x17bf('0xa2')][_0x17bf('0x2c')]({'where':_0x31a1f5['where']})['then'](function(_0x5e9eea){_0x5edb35['count']=_0x5e9eea;if(_0x29c391[_0x17bf('0x3f')]['includeAll']){_0x31a1f5[_0x17bf('0x55')]=[{'model':db[_0x17bf('0x79')],'as':_0x17bf('0xc1'),'required':![]},{'model':db[_0x17bf('0xae')],'as':'Owner','attributes':[_0x17bf('0x36'),'fullname',_0x17bf('0xc2')],'required':![]},{'model':db[_0x17bf('0xc3')],'as':_0x17bf('0xc4'),'attributes':['id','name',_0x17bf('0xc5')],'where':_0x29c391[_0x17bf('0x3f')][_0x17bf('0xc6')]?{'id':_0x29c391[_0x17bf('0x3f')]['tag']}:undefined,'required':_0x29c391[_0x17bf('0x3f')][_0x17bf('0xc6')]?!![]:![]}];}return db[_0x17bf('0xa2')][_0x17bf('0x56')](_0x31a1f5);})[_0x17bf('0x1f')](function(_0xa12db3){_0x5edb35['rows']=_0xa12db3;return _0x5edb35;});}})['then'](respondWithFilteredResult(_0x8021cc,_0x31a1f5))[_0x17bf('0x27')](handleError(_0x8021cc,null));};exports[_0x17bf('0x37')]=function(_0x323f1d,_0x18662b,_0x5b33d1){var _0x1f3b1f,_0x29e345,_0x2a6014;if(_[_0x17bf('0x9a')](_0x323f1d[_0x17bf('0x62')][_0x17bf('0x62')])||_0x323f1d[_0x17bf('0x62')][_0x17bf('0x62')]===''){throw new db[(_0x17bf('0x7a'))][(_0x17bf('0x7b'))](_0x17bf('0xc7'));}if(_[_0x17bf('0x9a')](_0x323f1d[_0x17bf('0x62')]['to'])){throw new db[(_0x17bf('0x7a'))][(_0x17bf('0x7b'))](_0x17bf('0xc8'));}_0x1f3b1f=_0x323f1d['body']['to'];return db[_0x17bf('0x53')][_0x17bf('0x59')]({'where':{'id':_0x323f1d[_0x17bf('0x58')]['id']},'include':[{'model':db[_0x17bf('0x9f')],'as':'List','include':[{'model':db[_0x17bf('0x79')],'as':_0x17bf('0xa0'),'where':{'mobile':_0x1f3b1f},'limit':0x1,'order':[[_0x17bf('0x7f'),_0x17bf('0xc9')]]}]}]})[_0x17bf('0x1f')](handleEntityNotFound(_0x18662b,null))[_0x17bf('0x1f')](function(_0x7d6a6){if(_0x7d6a6&&_0x7d6a6[_0x17bf('0xca')]){_0x29e345=_0x7d6a6[_0x17bf('0x32')]({'plain':!![]});if(_0x29e345[_0x17bf('0xca')]&&_0x29e345[_0x17bf('0xca')][_0x17bf('0xa0')][_0x17bf('0x46')]){return _0x29e345[_0x17bf('0xca')][_0x17bf('0xa0')][0x0];}return db['CmContact'][_0x17bf('0x5a')](_[_0x17bf('0x15')](_0x323f1d[_0x17bf('0x62')],{'firstName':_0x1f3b1f,'mobile':_0x1f3b1f,'phone':_0x1f3b1f,'ListId':_0x29e345['ListId']}));}})[_0x17bf('0x1f')](handleEntityNotFound(_0x18662b,null))[_0x17bf('0x1f')](function(_0x1a932e){if(_0x1a932e){_0x2a6014=_0x1a932e;return db[_0x17bf('0xa2')][_0x17bf('0x59')]({'where':{'ContactId':_0x2a6014['id'],'closed':![],'SmsAccountId':_0x29e345['id']}})[_0x17bf('0x1f')](function(_0x1f79b9){if(_0x1f79b9){return[_0x1f79b9,![]];}return db[_0x17bf('0xa2')]['create']({'UserId':_0x323f1d[_0x17bf('0x5b')]['id'],'ContactId':_0x2a6014['id'],'SmsAccountId':_0x29e345['id'],'phone':_0x1f3b1f,'firstMsgDirection':_0x17bf('0xcb'),'Messages':[_[_0x17bf('0x4d')](_0x323f1d[_0x17bf('0x62')],{'read':![],'body':_0x323f1d[_0x17bf('0x62')][_0x17bf('0x62')],'phone':_0x1f3b1f,'SmsAccountId':_0x29e345['id'],'UserId':_0x323f1d[_0x17bf('0x5b')]['id'],'ContactId':_0x2a6014['id']})]},{'include':[{'model':db['SmsMessage'],'as':_0x17bf('0xcc')}]})[_0x17bf('0x1f')](function(_0x5d23ef){return[_0x5d23ef,!![]];});});}})[_0x17bf('0xa3')](function(_0x1c881d,_0x56895c){if(_0x56895c){return _0x1c881d;}return db[_0x17bf('0xaa')][_0x17bf('0x5a')](_[_0x17bf('0x4d')](_0x323f1d[_0x17bf('0x62')],{'read':![],'body':_0x323f1d[_0x17bf('0x62')][_0x17bf('0x62')],'phone':_0x1f3b1f,'SmsAccountId':_0x29e345['id'],'SmsInteractionId':_0x1c881d['id'],'UserId':_0x323f1d['user']['id'],'ContactId':_0x2a6014['id']}))[_0x17bf('0x1f')](function(_0x16a97c){_0x1c881d[_0x17bf('0xcd')][_0x17bf('0xcc')]=[];_0x1c881d[_0x17bf('0xcd')][_0x17bf('0xcc')][_0x17bf('0xa7')](_0x16a97c['dataValues']);return _0x1c881d;});})[_0x17bf('0x1f')](respondWithResult(_0x18662b,null))[_0x17bf('0x27')](handleError(_0x18662b,null));};exports['status']=function(_0x3b8b8a,_0x2ea530,_0x1bdf92){if(_0x3b8b8a[_0x17bf('0x62')]['id']){delete _0x3b8b8a[_0x17bf('0x62')]['id'];}console[_0x17bf('0xce')]('endpoint\x20/status\x20POST\x20/',_0x3b8b8a[_0x17bf('0x62')]);var _0x45637c,_0x4e48ec,_0x26dd14;return db[_0x17bf('0x53')][_0x17bf('0x59')]({'where':{'id':_0x3b8b8a[_0x17bf('0x58')]['id']}})[_0x17bf('0x1f')](handleEntityNotFound(_0x2ea530,null))[_0x17bf('0x1f')](function(_0x115810){if(_0x115810){_0x26dd14=_0x115810;logger[_0x17bf('0xb6')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x17bf('0xcf'),_0x115810[_0x17bf('0x4e')],util[_0x17bf('0xd0')](_0x3b8b8a[_0x17bf('0x62')],{'showHidden':![],'depth':null}));switch(_0x115810[_0x17bf('0x4e')]){case _0x17bf('0x88'):if(_0x3b8b8a[_0x17bf('0x62')][_0x17bf('0xd1')]&&_0x3b8b8a[_0x17bf('0x62')][_0x17bf('0x29')]){_0x4e48ec=_0x3b8b8a['body']['status'];return db[_0x17bf('0xaa')][_0x17bf('0x59')]({'where':{'messageId':_0x3b8b8a[_0x17bf('0x62')]['skebby_dispatch_id']}});}break;case _0x17bf('0x8b'):if(_0x3b8b8a['body']['requestid']&&_0x3b8b8a[_0x17bf('0x62')]['statusInt']){_0x4e48ec=_0x3b8b8a[_0x17bf('0x62')][_0x17bf('0xd2')];return db[_0x17bf('0xaa')][_0x17bf('0x59')]({'where':{'messageId':_0x3b8b8a['body'][_0x17bf('0xd3')]}});}break;case _0x17bf('0x8c'):if(_0x3b8b8a['body'][_0x17bf('0x8d')]&&_0x3b8b8a['body'][_0x17bf('0xd4')]){_0x4e48ec=_0x3b8b8a[_0x17bf('0x62')][_0x17bf('0xd4')];return db['SmsMessage']['find']({'where':{'messageId':_0x3b8b8a[_0x17bf('0x62')][_0x17bf('0x8d')]}});}break;case'infobip':var _0x46c966=_0x3b8b8a[_0x17bf('0x62')][_0x17bf('0x90')][0x0];if(_0x46c966[_0x17bf('0x86')]&&_0x46c966['status'][_0x17bf('0xd5')]===_0x17bf('0xd6')){_0x4e48ec=_0x46c966[_0x17bf('0x29')][_0x17bf('0xd5')];return db['SmsMessage'][_0x17bf('0x59')]({'where':{'messageId':_0x46c966['messageId']}});}break;case _0x17bf('0x94'):if(_0x3b8b8a[_0x17bf('0x62')]['messageId']&&_0x3b8b8a[_0x17bf('0x62')][_0x17bf('0x29')]){_0x4e48ec=_0x3b8b8a[_0x17bf('0x62')]['status'];return db[_0x17bf('0xaa')][_0x17bf('0x59')]({'where':{'messageId':_0x3b8b8a[_0x17bf('0x62')][_0x17bf('0x86')]}});}break;case _0x17bf('0x97'):if(_0x3b8b8a[_0x17bf('0x62')]['redif']&&_0x3b8b8a[_0x17bf('0x62')]['status']){_0x4e48ec=_0x3b8b8a['body'][_0x17bf('0x29')];return db[_0x17bf('0xaa')][_0x17bf('0x59')]({'where':{'messageId':_0x3b8b8a[_0x17bf('0x62')][_0x17bf('0xd7')]}});}break;}}})['then'](handleEntityNotFound(_0x2ea530,null))[_0x17bf('0x1f')](function(_0x5948e7){if(_0x5948e7){_0x45637c=_0x5948e7;switch(_0x26dd14[_0x17bf('0x4e')]){case _0x17bf('0x88'):if(_0x4e48ec===_0x17bf('0xd6')){return _0x45637c[_0x17bf('0x30')]({'read':!![]});}else{logger[_0x17bf('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x17bf('0x29'),'skebby',util[_0x17bf('0xd0')](_0x3b8b8a['body'],{'showHidden':![],'depth':null}));}break;case _0x17bf('0x8b'):if(_0x4e48ec==='1'){return _0x45637c['update']({'read':!![]});}else{logger['error'](_0x17bf('0xb4'),_0x17bf('0x29'),_0x17bf('0x88'),util[_0x17bf('0xd0')](_0x3b8b8a['body'],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x3b8b8a[_0x17bf('0x62')][_0x17bf('0xd8')]&&_0x4e48ec>=0xc8&&_0x4e48ec<=0xce){return _0x45637c[_0x17bf('0x30')]({'read':!![]});}else{logger[_0x17bf('0x24')](_0x17bf('0xb4'),'status',_0x17bf('0x8c'),util[_0x17bf('0xd0')](_0x3b8b8a[_0x17bf('0x62')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x598b6a=_0x3b8b8a[_0x17bf('0x62')][_0x17bf('0x90')][0x0];if(_0x598b6a[_0x17bf('0x29')]['groupName']===_0x17bf('0xd6')){return _0x45637c[_0x17bf('0x30')]({'read':!![]});}else{logger[_0x17bf('0x24')](_0x17bf('0xb4'),_0x17bf('0x29'),_0x17bf('0x8f'),util['inspect'](_0x3b8b8a[_0x17bf('0x62')],{'showHidden':![],'depth':null}));}break;case _0x17bf('0x94'):if(_0x4e48ec==_0x17bf('0xd9')||_0x4e48ec==_0x17bf('0xda')){return _0x45637c[_0x17bf('0x30')]({'read':!![]});}else{logger[_0x17bf('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x17bf('0x29'),_0x17bf('0x94'),util['inspect'](_0x3b8b8a[_0x17bf('0x62')],{'showHidden':![],'depth':null}));}break;case _0x17bf('0x97'):if(_0x4e48ec===_0x17bf('0xdb')||_0x4e48ec==='ACCEPTD'){return _0x45637c[_0x17bf('0x30')]({'read':!![]});}else{logger[_0x17bf('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x17bf('0x29'),_0x17bf('0x97'),util[_0x17bf('0xd0')](_0x3b8b8a[_0x17bf('0x62')],{'showHidden':![],'depth':null}));}break;}return _0x45637c;}})[_0x17bf('0x1f')](respondWithResult(_0x2ea530,null))[_0x17bf('0x27')](handleError(_0x2ea530,null));};exports[_0x17bf('0xdc')]=function(_0x28b235,_0x31b321,_0x11ad11){var _0x2b21c0,_0x2eee47,_0x1a5974;return db['SmsAccount']['find']({'where':{'id':_0x28b235['params']['id']}})[_0x17bf('0x1f')](handleEntityNotFound(_0x31b321,null))['then'](function(_0x20eff5){if(_0x20eff5){_0x1a5974=_0x20eff5;logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x17bf('0x29'),_0x17bf('0xcf'),_0x20eff5[_0x17bf('0x4e')],util['inspect'](_0x28b235['query'],{'showHidden':![],'depth':null}));switch(_0x20eff5[_0x17bf('0x4e')]){case _0x17bf('0x91'):if(_0x28b235[_0x17bf('0x3f')][_0x17bf('0xdd')]&&_0x28b235[_0x17bf('0x3f')]['state']){_0x2eee47=_0x28b235[_0x17bf('0x3f')]['state'];return db[_0x17bf('0xaa')][_0x17bf('0x59')]({'where':{'messageId':_0x28b235['query']['message-id']}});}break;}}})[_0x17bf('0x1f')](handleEntityNotFound(_0x31b321,null))['then'](function(_0xfea246){if(_0xfea246){_0x2b21c0=_0xfea246;switch(_0x1a5974[_0x17bf('0x4e')]){case _0x17bf('0x91'):if(_0x2eee47==='2'||_0x2eee47==='6'){return _0x2b21c0[_0x17bf('0x30')]({'read':!![]});}else{logger[_0x17bf('0x24')](_0x17bf('0xb4'),_0x17bf('0x29'),'csc',util[_0x17bf('0xd0')](_0x28b235[_0x17bf('0x3f')],{'showHidden':![],'depth':null}));};break;}return _0x2b21c0;}})['then'](respondWithResult(_0x31b321,null))[_0x17bf('0x27')](handleError(_0x31b321,null));};exports[_0x17bf('0xde')]=function(_0x4ed285,_0x33a67e,_0x179d2b){return db[_0x17bf('0x53')][_0x17bf('0x59')]({'where':{'id':_0x4ed285[_0x17bf('0x58')]['id']}})[_0x17bf('0x1f')](handleEntityNotFound(_0x33a67e,null))[_0x17bf('0x1f')](function(_0x203b51){if(_0x203b51){return _0x203b51['addAgents'](_0x4ed285[_0x17bf('0x62')][_0x17bf('0x6a')],_[_0x17bf('0xdf')](_0x4ed285[_0x17bf('0x62')],[_0x17bf('0x6a'),'id'])||{})[_0x17bf('0xa3')](function(_0xed45e4){for(var _0x3265b2=0x0;_0x3265b2<_0x4ed285[_0x17bf('0x62')][_0x17bf('0x6a')][_0x17bf('0x46')];_0x3265b2+=0x1){socket[_0x17bf('0xe0')](_0x17bf('0xe1'),{'UserId':_0x4ed285[_0x17bf('0x62')]['ids'][_0x3265b2],'SmsAccountId':_0x4ed285[_0x17bf('0x58')]['id']});}return _0xed45e4;});}})[_0x17bf('0x1f')](respondWithResult(_0x33a67e,null))['catch'](handleError(_0x33a67e,null));};exports[_0x17bf('0xe2')]=function(_0x3321e4,_0x581958,_0x38e8cf){return db['SmsAccount'][_0x17bf('0x59')]({'where':{'id':_0x3321e4[_0x17bf('0x58')]['id']}})[_0x17bf('0x1f')](handleEntityNotFound(_0x581958,null))[_0x17bf('0x1f')](function(_0x2e64f1){if(_0x2e64f1){return _0x2e64f1['removeAgents'](_0x3321e4[_0x17bf('0x3f')][_0x17bf('0x6a')])[_0x17bf('0x1f')](function(){if(_[_0x17bf('0xe3')](_0x3321e4[_0x17bf('0x3f')][_0x17bf('0x6a')])){for(var _0x53b249=0x0;_0x53b249<_0x3321e4[_0x17bf('0x3f')]['ids'][_0x17bf('0x46')];_0x53b249+=0x1){socket['emit']('userSmsAccount:remove',{'UserId':Number(_0x3321e4[_0x17bf('0x3f')][_0x17bf('0x6a')][_0x53b249]),'SmsAccountId':Number(_0x3321e4[_0x17bf('0x58')]['id'])});}}else{socket[_0x17bf('0xe0')](_0x17bf('0xe4'),{'UserId':Number(_0x3321e4[_0x17bf('0x3f')][_0x17bf('0x6a')]),'SmsAccountId':Number(_0x3321e4[_0x17bf('0x58')]['id'])});}});}})[_0x17bf('0x1f')](respondWithStatusCode(_0x581958,null))['catch'](handleError(_0x581958,null));};exports[_0x17bf('0xe5')]=function(_0x283d77,_0x229ab,_0x1b85cf){var _0x4f6bae={};var _0x100e9f={};var _0xcf5f41;var _0x2d1953;return db['SmsAccount'][_0x17bf('0x6e')]({'where':{'id':_0x283d77[_0x17bf('0x58')]['id']}})[_0x17bf('0x1f')](handleEntityNotFound(_0x229ab,null))[_0x17bf('0x1f')](function(_0x4ca916){if(_0x4ca916){_0xcf5f41=_0x4ca916;_0x100e9f[_0x17bf('0x43')]=_[_0x17bf('0x40')](db[_0x17bf('0xae')][_0x17bf('0x3c')]);_0x100e9f[_0x17bf('0x3f')]=_[_0x17bf('0x40')](_0x283d77[_0x17bf('0x3f')]);_0x100e9f[_0x17bf('0x41')]=_[_0x17bf('0x42')](_0x100e9f[_0x17bf('0x43')],_0x100e9f['query']);_0x4f6bae[_0x17bf('0x44')]=_[_0x17bf('0x42')](_0x100e9f[_0x17bf('0x43')],qs['fields'](_0x283d77['query']['fields']));_0x4f6bae[_0x17bf('0x44')]=_0x4f6bae['attributes']['length']?_0x4f6bae[_0x17bf('0x44')]:_0x100e9f[_0x17bf('0x43')];_0x4f6bae[_0x17bf('0x68')]=qs[_0x17bf('0x4a')](_0x283d77[_0x17bf('0x3f')][_0x17bf('0x4a')]);_0x4f6bae[_0x17bf('0x4b')]=qs[_0x17bf('0x41')](_['pick'](_0x283d77[_0x17bf('0x3f')],_0x100e9f[_0x17bf('0x41')]));if(_0x283d77[_0x17bf('0x3f')][_0x17bf('0x51')]){_0x4f6bae[_0x17bf('0x4b')]=_[_0x17bf('0x4d')](_0x4f6bae[_0x17bf('0x4b')],{'$or':_['map'](_0x4f6bae[_0x17bf('0x44')],function(_0x3f5d53){var _0x1cfc03={};_0x1cfc03[_0x3f5d53]={'$like':'%'+_0x283d77[_0x17bf('0x3f')][_0x17bf('0x51')]+'%'};return _0x1cfc03;})});}_0x4f6bae=_['merge']({},_0x4f6bae,_0x283d77['options']);return _0xcf5f41[_0x17bf('0xe5')](_0x4f6bae);}})['then'](function(_0x2e83ec){if(_0x2e83ec){_0x2d1953=_0x2e83ec[_0x17bf('0x46')];if(!_0x283d77[_0x17bf('0x3f')]['hasOwnProperty'](_0x17bf('0x67'))){_0x4f6bae[_0x17bf('0x48')]=qs[_0x17bf('0x48')](_0x283d77['query'][_0x17bf('0x48')]);_0x4f6bae[_0x17bf('0x49')]=qs[_0x17bf('0x49')](_0x283d77[_0x17bf('0x3f')][_0x17bf('0x49')]);}return _0xcf5f41[_0x17bf('0xe5')](_0x4f6bae);}})[_0x17bf('0x1f')](function(_0x433d79){if(_0x433d79){return _0x433d79?{'count':_0x2d1953,'rows':_0x433d79}:null;}})[_0x17bf('0x1f')](respondWithResult(_0x229ab,null))[_0x17bf('0x27')](handleError(_0x229ab,null));}; \ No newline at end of file +var _0x7464=['CannedAnswer','getAnswers','findOne','notify','sms','SmsApplication','Applications','account','priority','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','ListId','mobile','twilio','from','From','Body','messageId','MessageSid','skebby','text','connectel','clicksend','message_id','plivo','Text','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','intelepeer','refid','body\x20is\x20mandatory\x20and\x20not\x20empty','isNil','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','DESC','list','Contacts','contact','SmsInteraction','interaction','autoclose','applications','unmanaged','created','ContactId','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','stringify','Content-Type','text/xml','addApplications','sequelize','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','Owner','internal','Tag','Tags','color','tag','to\x20is\x20mandatory','List','out','spread','SmsMessage','Messages','push','dataValues','log','endpoint\x20/status\x20POST\x20/','received\x20delivery\x20report\x20from','skebby_dispatch_id','requestid','statusInt','status_code','infobip','groupName','DELIVERED','redif','inspect','DELIVERED_TO_GATEWAY','DELIVRD','statusGet','message-id','state','addAgents','omit','userSmsAccount:save','removeAgents','isArray','emit','userSmsAccount:remove','getAgents','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','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','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','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','get','stack','name','index','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','field','options','includeAll','findAll','rows','show','params','Pause','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','SmsAccounts','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','SmsAccountId','Disposition','include','ids','addAnswer'];(function(_0x5e75ec,_0x53402b){var _0x5977ba=function(_0x327fa7){while(--_0x327fa7){_0x5e75ec['push'](_0x5e75ec['shift']());}};_0x5977ba(++_0x53402b);}(_0x7464,0x158));var _0x4746=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7464[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require(_0x4746('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x4746('0x1'));var zipdir=require(_0x4746('0x2'));var jsonpatch=require(_0x4746('0x3'));var rp=require('request-promise');var moment=require(_0x4746('0x4'));var BPromise=require(_0x4746('0x5'));var Mustache=require('mustache');var util=require(_0x4746('0x6'));var path=require(_0x4746('0x7'));var sox=require(_0x4746('0x8'));var csv=require(_0x4746('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x4746('0xa'));var squel=require('squel');var crypto=require(_0x4746('0xb'));var jsforce=require(_0x4746('0xc'));var deskjs=require(_0x4746('0xd'));var toCsv=require(_0x4746('0x9'));var querystring=require(_0x4746('0xe'));var Papa=require(_0x4746('0xf'));var Redis=require('ioredis');var authService=require(_0x4746('0x10'));var qs=require(_0x4746('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4746('0x12'));var logger=require(_0x4746('0x13'))(_0x4746('0x14'));var utils=require(_0x4746('0x15'));var config=require(_0x4746('0x16'));var db=require(_0x4746('0x17'))['db'];config[_0x4746('0x18')]=_[_0x4746('0x19')](config[_0x4746('0x18')],{'host':_0x4746('0x1a'),'port':0x18eb});var socket=require(_0x4746('0x1b'))(new Redis(config[_0x4746('0x18')]));require('./smsAccount.socket')[_0x4746('0x1c')](socket);var jayson=require(_0x4746('0x1d'));var client=jayson[_0x4746('0x1e')]['http']({'port':0x232c});function checkPasswordPattern(_0x125a0,_0x632b6,_0x56bb9b){if(_0x56bb9b){var _0x1c1f23=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1c1f23['test'](_0x632b6)){return _0x125a0;}else{throw new Error(_0x4746('0x1f'));}}else{return _0x125a0;}}function respondWithRpcPromise(_0x2720b2,_0x5e86dd,_0x5f48cc,_0x41cdf3){return new BPromise(function(_0x2ef084,_0x2387e0){var _0x4e2d90=_0x41cdf3||client;return _0x4e2d90[_0x4746('0x20')](_0x2720b2,_0x5f48cc)[_0x4746('0x21')](function(_0x19632a){logger[_0x4746('0x22')](_0x4746('0x23'),_0x5e86dd,_0x4746('0x24'));logger[_0x4746('0x25')](_0x4746('0x26'),_0x5e86dd,_0x4746('0x24'),JSON['stringify'](_0x19632a));if(_0x19632a[_0x4746('0x27')]){if(_0x19632a[_0x4746('0x27')][_0x4746('0x28')]===0x1f4){logger[_0x4746('0x27')](_0x4746('0x23'),_0x5e86dd,_0x19632a[_0x4746('0x27')]['message']);return _0x2387e0(_0x19632a[_0x4746('0x27')][_0x4746('0x29')]);}logger[_0x4746('0x27')](_0x4746('0x23'),_0x5e86dd,_0x19632a[_0x4746('0x27')][_0x4746('0x29')]);return _0x2ef084(_0x19632a[_0x4746('0x27')][_0x4746('0x29')]);}else{logger[_0x4746('0x22')](_0x4746('0x23'),_0x5e86dd,_0x4746('0x24'));_0x2ef084(_0x19632a['result'][_0x4746('0x29')]);}})[_0x4746('0x2a')](function(_0x5b8373){logger['error'](_0x4746('0x23'),_0x5e86dd,_0x5b8373);_0x2387e0(_0x5b8373);});});}function respondWithStatusCode(_0x19a349,_0x57d446){_0x57d446=_0x57d446||0xcc;return function(_0x7f0a1f){if(_0x7f0a1f){return _0x19a349[_0x4746('0x2b')](_0x57d446);}return _0x19a349[_0x4746('0x2c')](_0x57d446)[_0x4746('0x2d')]();};}function respondWithResult(_0x1e4934,_0x45cd12){_0x45cd12=_0x45cd12||0xc8;return function(_0x2cc2a3){if(_0x2cc2a3){return _0x1e4934[_0x4746('0x2c')](_0x45cd12)['json'](_0x2cc2a3);}};}function respondWithFilteredResult(_0x2022a5,_0x56f755){return function(_0x58be33){if(_0x58be33){var _0x619c5f=_0x58be33[_0x4746('0x2e')],_0x443f9f=_0x56f755[_0x4746('0x2f')],_0x585d36=_0x56f755[_0x4746('0x2f')]+_0x56f755[_0x4746('0x30')],_0x4a44b2;if(_0x585d36>=_0x619c5f){_0x585d36=_0x619c5f;_0x4a44b2=0xc8;}else{_0x4a44b2=0xce;}_0x2022a5['status'](_0x4a44b2);return _0x2022a5[_0x4746('0x31')](_0x4746('0x32'),_0x443f9f+'-'+_0x585d36+'/'+_0x619c5f)[_0x4746('0x33')](_0x58be33);}return null;};}function patchUpdates(_0x58f67a){return function(_0x142089){try{jsonpatch[_0x4746('0x34')](_0x142089,_0x58f67a,!![]);}catch(_0x539799){return BPromise[_0x4746('0x35')](_0x539799);}return _0x142089[_0x4746('0x36')]();};}function saveUpdates(_0x396c71,_0x432bea){return function(_0x368e50){if(_0x368e50){return _0x368e50[_0x4746('0x37')](_0x396c71)['then'](function(_0x507150){return _0x507150;});}return null;};}function removeEntity(_0x4eb9d6,_0x49b8ad){return function(_0x267e99){if(_0x267e99){return _0x267e99[_0x4746('0x38')]()[_0x4746('0x21')](function(){var _0x38366f=_0x267e99[_0x4746('0x39')]({'plain':!![]});var _0x36d665='SmsAccounts';return db['UserProfileResource']['destroy']({'where':{'type':_0x36d665,'resourceId':_0x38366f['id']}})[_0x4746('0x21')](function(){return _0x267e99;});})['then'](function(){_0x4eb9d6[_0x4746('0x2c')](0xcc)[_0x4746('0x2d')]();});}};}function handleEntityNotFound(_0x533273,_0x4fd82e){return function(_0x1845ee){if(!_0x1845ee){_0x533273[_0x4746('0x2b')](0x194);}return _0x1845ee;};}function handleError(_0xe9121e,_0x5002bd){_0x5002bd=_0x5002bd||0x1f4;return function(_0x269064){logger['error'](_0x269064[_0x4746('0x3a')]);if(_0x269064[_0x4746('0x3b')]){delete _0x269064[_0x4746('0x3b')];}_0xe9121e['status'](_0x5002bd)['send'](_0x269064);};}exports[_0x4746('0x3c')]=function(_0x3690bd,_0x3d914b){var _0x1da982={'include':[{'model':db['Pause'],'as':_0x4746('0x3d')}]},_0x3e376b={},_0x33b796={'count':0x0,'rows':[]};var _0x4615a1=_[_0x4746('0x3e')](db[_0x4746('0x3f')][_0x4746('0x40')],function(_0x49731f){return{'name':_0x49731f[_0x4746('0x41')],'type':_0x49731f[_0x4746('0x42')][_0x4746('0x43')]};});_0x3e376b[_0x4746('0x44')]=_[_0x4746('0x3e')](_0x4615a1,_0x4746('0x3b'));_0x3e376b[_0x4746('0x45')]=_[_0x4746('0x46')](_0x3690bd[_0x4746('0x45')]);_0x3e376b[_0x4746('0x47')]=_[_0x4746('0x48')](_0x3e376b[_0x4746('0x44')],_0x3e376b[_0x4746('0x45')]);_0x1da982['attributes']=_[_0x4746('0x48')](_0x3e376b[_0x4746('0x44')],qs['fields'](_0x3690bd['query'][_0x4746('0x49')]));_0x1da982['attributes']=_0x1da982[_0x4746('0x4a')][_0x4746('0x4b')]?_0x1da982[_0x4746('0x4a')]:_0x3e376b[_0x4746('0x44')];if(!_0x3690bd[_0x4746('0x45')][_0x4746('0x4c')](_0x4746('0x4d'))){_0x1da982['limit']=qs['limit'](_0x3690bd[_0x4746('0x45')]['limit']);_0x1da982[_0x4746('0x2f')]=qs[_0x4746('0x2f')](_0x3690bd[_0x4746('0x45')][_0x4746('0x2f')]);}_0x1da982[_0x4746('0x4e')]=qs[_0x4746('0x4f')](_0x3690bd['query'][_0x4746('0x4f')]);_0x1da982[_0x4746('0x50')]=qs[_0x4746('0x47')](_[_0x4746('0x51')](_0x3690bd[_0x4746('0x45')],_0x3e376b['filters']));if(_0x3690bd[_0x4746('0x45')][_0x4746('0x52')]){_0x1da982[_0x4746('0x50')]=_[_0x4746('0x53')](_0x1da982[_0x4746('0x50')],{'$or':_[_0x4746('0x3e')](_0x4615a1,function(_0x5c5e46){if(_0x5c5e46[_0x4746('0x42')]['key']!=='VIRTUAL'){var _0x25b296={};_0x25b296[_0x5c5e46[_0x4746('0x54')]]={'$like':'%'+_0x3690bd[_0x4746('0x45')]['filter']+'%'};return _0x25b296;}})});}_0x1da982=_[_0x4746('0x53')]({},_0x1da982,_0x3690bd[_0x4746('0x55')]);var _0x4afca3={'where':_0x1da982[_0x4746('0x50')]};return db['SmsAccount'][_0x4746('0x2e')](_0x4afca3)['then'](function(_0x342eab){_0x33b796['count']=_0x342eab;if(_0x3690bd['query'][_0x4746('0x56')]){_0x1da982['include']=[{'all':!![]}];}return db['SmsAccount'][_0x4746('0x57')](_0x1da982);})[_0x4746('0x21')](function(_0x1baee8){_0x33b796[_0x4746('0x58')]=_0x1baee8;return _0x33b796;})[_0x4746('0x21')](respondWithFilteredResult(_0x3d914b,_0x1da982))[_0x4746('0x2a')](handleError(_0x3d914b,null));};exports[_0x4746('0x59')]=function(_0xdd2d8a,_0x4c753b){var _0x502725={'raw':![],'where':{'id':_0xdd2d8a[_0x4746('0x5a')]['id']},'include':[{'model':db[_0x4746('0x5b')],'as':_0x4746('0x3d')}]},_0x5da1e8={};_0x5da1e8[_0x4746('0x44')]=_[_0x4746('0x46')](db['SmsAccount'][_0x4746('0x40')]);_0x5da1e8[_0x4746('0x45')]=_['keys'](_0xdd2d8a[_0x4746('0x45')]);_0x5da1e8[_0x4746('0x47')]=_[_0x4746('0x48')](_0x5da1e8[_0x4746('0x44')],_0x5da1e8[_0x4746('0x45')]);_0x502725[_0x4746('0x4a')]=_[_0x4746('0x48')](_0x5da1e8[_0x4746('0x44')],qs[_0x4746('0x49')](_0xdd2d8a['query'][_0x4746('0x49')]));_0x502725[_0x4746('0x4a')]=_0x502725['attributes'][_0x4746('0x4b')]?_0x502725['attributes']:_0x5da1e8[_0x4746('0x44')];if(_0xdd2d8a[_0x4746('0x45')]['includeAll']){_0x502725['include']=[{'all':!![]}];}_0x502725=_['merge']({},_0x502725,_0xdd2d8a['options']);return db[_0x4746('0x3f')][_0x4746('0x5c')](_0x502725)[_0x4746('0x21')](handleEntityNotFound(_0x4c753b,null))[_0x4746('0x21')](respondWithResult(_0x4c753b,null))[_0x4746('0x2a')](handleError(_0x4c753b,null));};exports[_0x4746('0x5d')]=function(_0x3afc25,_0x5b724c){return db[_0x4746('0x3f')][_0x4746('0x5d')](_0x3afc25[_0x4746('0x5e')],{})[_0x4746('0x21')](function(_0x409b8d){var _0x496cd8=_0x3afc25[_0x4746('0x5f')][_0x4746('0x39')]({'plain':!![]});if(!_0x496cd8)throw new Error(_0x4746('0x60'));if(_0x496cd8['role']===_0x4746('0x5f')){var _0x34936c=_0x409b8d['get']({'plain':!![]});var _0x48e796=_0x4746('0x61');return db[_0x4746('0x62')][_0x4746('0x5c')]({'where':{'name':_0x48e796,'userProfileId':_0x496cd8[_0x4746('0x63')]},'raw':!![]})[_0x4746('0x21')](function(_0x272215){if(_0x272215&&_0x272215[_0x4746('0x64')]===0x0){return db[_0x4746('0x65')]['create']({'name':_0x34936c['name'],'resourceId':_0x34936c['id'],'type':_0x272215[_0x4746('0x3b')],'sectionId':_0x272215['id']},{})['then'](function(){return _0x409b8d;});}else{return _0x409b8d;}})[_0x4746('0x2a')](function(_0x111a62){logger[_0x4746('0x27')](_0x4746('0x66'),_0x111a62);throw _0x111a62;});}return _0x409b8d;})[_0x4746('0x21')](respondWithResult(_0x5b724c,0xc9))[_0x4746('0x2a')](handleError(_0x5b724c,null));};exports[_0x4746('0x37')]=function(_0x3317b8,_0x4a492d){if(_0x3317b8['body']['id']){delete _0x3317b8[_0x4746('0x5e')]['id'];}return db[_0x4746('0x3f')]['find']({'where':{'id':_0x3317b8[_0x4746('0x5a')]['id']},'include':[{'model':db[_0x4746('0x5b')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x4a492d,null))['then'](saveUpdates(_0x3317b8[_0x4746('0x5e')],null))[_0x4746('0x21')](respondWithResult(_0x4a492d,null))[_0x4746('0x2a')](handleError(_0x4a492d,null));};exports[_0x4746('0x38')]=function(_0x44a98c,_0x45c6f7){return db[_0x4746('0x3f')][_0x4746('0x5c')]({'where':{'id':_0x44a98c['params']['id']}})[_0x4746('0x21')](handleEntityNotFound(_0x45c6f7,null))[_0x4746('0x21')](removeEntity(_0x45c6f7,null))['catch'](handleError(_0x45c6f7,null));};exports['describe']=function(_0x443a41,_0x35526e){return db[_0x4746('0x3f')][_0x4746('0x67')]()['then'](respondWithResult(_0x35526e,null))[_0x4746('0x2a')](handleError(_0x35526e,null));};exports[_0x4746('0x68')]=function(_0x2d8551,_0x5242d3,_0x428638){if(_0x2d8551[_0x4746('0x5e')]['id']){delete _0x2d8551[_0x4746('0x5e')]['id'];}return db['SmsAccount'][_0x4746('0x5c')]({'where':{'id':_0x2d8551[_0x4746('0x5a')]['id']}})[_0x4746('0x21')](handleEntityNotFound(_0x5242d3,null))[_0x4746('0x21')](function(_0x12747b){if(_0x12747b){_0x2d8551[_0x4746('0x5e')][_0x4746('0x69')]=_0x12747b['id'];return db[_0x4746('0x6a')][_0x4746('0x5d')](_0x2d8551[_0x4746('0x5e')]);}})[_0x4746('0x21')](respondWithResult(_0x5242d3,null))[_0x4746('0x2a')](handleError(_0x5242d3,null));};exports['getDispositions']=function(_0x43a4e5,_0x329906,_0x5eb529){var _0x14a90e={'raw':![],'where':{}};var _0x36f91b={};var _0x39ee9c={'count':0x0,'rows':[]};return db[_0x4746('0x3f')]['findOne']({'where':{'id':_0x43a4e5['params']['id']}})[_0x4746('0x21')](handleEntityNotFound(_0x329906,null))[_0x4746('0x21')](function(_0x32161c){if(_0x32161c){_0x36f91b[_0x4746('0x44')]=_[_0x4746('0x46')](db[_0x4746('0x6a')][_0x4746('0x40')]);_0x36f91b[_0x4746('0x45')]=_[_0x4746('0x46')](_0x43a4e5[_0x4746('0x45')]);_0x36f91b[_0x4746('0x47')]=_[_0x4746('0x48')](_0x36f91b[_0x4746('0x44')],_0x36f91b['query']);_0x14a90e[_0x4746('0x4a')]=_[_0x4746('0x48')](_0x36f91b['model'],qs['fields'](_0x43a4e5[_0x4746('0x45')][_0x4746('0x49')]));_0x14a90e[_0x4746('0x4a')]=_0x14a90e[_0x4746('0x4a')][_0x4746('0x4b')]?_0x14a90e[_0x4746('0x4a')]:_0x36f91b['model'];if(!_0x43a4e5['query'][_0x4746('0x4c')]('nolimit')){_0x14a90e[_0x4746('0x30')]=qs[_0x4746('0x30')](_0x43a4e5[_0x4746('0x45')]['limit']);_0x14a90e[_0x4746('0x2f')]=qs[_0x4746('0x2f')](_0x43a4e5[_0x4746('0x45')][_0x4746('0x2f')]);}_0x14a90e[_0x4746('0x4e')]=qs['sort'](_0x43a4e5[_0x4746('0x45')][_0x4746('0x4f')]);_0x14a90e[_0x4746('0x50')]=qs[_0x4746('0x47')](_[_0x4746('0x51')](_0x43a4e5[_0x4746('0x45')],_0x36f91b['filters']));_0x14a90e[_0x4746('0x50')]['SmsAccountId']=_0x32161c['id'];if(_0x43a4e5[_0x4746('0x45')][_0x4746('0x52')]){_0x14a90e['where']=_['merge'](_0x14a90e[_0x4746('0x50')],{'$or':_[_0x4746('0x3e')](_0x14a90e[_0x4746('0x4a')],function(_0x15f046){var _0x32c154={};_0x32c154[_0x15f046]={'$like':'%'+_0x43a4e5[_0x4746('0x45')][_0x4746('0x52')]+'%'};return _0x32c154;})});}_0x14a90e=_[_0x4746('0x53')]({},_0x14a90e,_0x43a4e5[_0x4746('0x55')]);return db[_0x4746('0x6a')][_0x4746('0x2e')]({'where':_0x14a90e[_0x4746('0x50')]})[_0x4746('0x21')](function(_0xcc1972){_0x39ee9c[_0x4746('0x2e')]=_0xcc1972;if(_0x43a4e5[_0x4746('0x45')]['includeAll']){_0x14a90e[_0x4746('0x6b')]=[{'all':!![]}];}return db['Disposition'][_0x4746('0x57')](_0x14a90e);})[_0x4746('0x21')](function(_0x179fe8){_0x39ee9c[_0x4746('0x58')]=_0x179fe8;return _0x39ee9c;});}})[_0x4746('0x21')](respondWithFilteredResult(_0x329906,_0x14a90e))[_0x4746('0x2a')](handleError(_0x329906,null));};exports['removeDispositions']=function(_0x52a0fe,_0x13444f,_0x10a129){return db[_0x4746('0x3f')][_0x4746('0x5c')]({'where':{'id':_0x52a0fe[_0x4746('0x5a')]['id']}})[_0x4746('0x21')](handleEntityNotFound(_0x13444f,null))['then'](function(_0x343527){if(_0x343527){return _0x343527['removeDispositions'](_0x52a0fe[_0x4746('0x45')][_0x4746('0x6c')]);}})['then'](respondWithStatusCode(_0x13444f,null))[_0x4746('0x2a')](handleError(_0x13444f,null));};exports[_0x4746('0x6d')]=function(_0x3fbf33,_0x12bb59,_0x428e3d){if(_0x3fbf33[_0x4746('0x5e')]['id']){delete _0x3fbf33[_0x4746('0x5e')]['id'];}return db['SmsAccount'][_0x4746('0x5c')]({'where':{'id':_0x3fbf33[_0x4746('0x5a')]['id']}})[_0x4746('0x21')](handleEntityNotFound(_0x12bb59,null))['then'](function(_0x5b6ca9){if(_0x5b6ca9){_0x3fbf33[_0x4746('0x5e')][_0x4746('0x69')]=_0x5b6ca9['id'];return db[_0x4746('0x6e')][_0x4746('0x5d')](_0x3fbf33[_0x4746('0x5e')]);}})[_0x4746('0x21')](respondWithResult(_0x12bb59,null))[_0x4746('0x2a')](handleError(_0x12bb59,null));};exports[_0x4746('0x6f')]=function(_0x818286,_0x2f5d75,_0xb8d62b){var _0x5b7364={'raw':![],'where':{}};var _0x1b2117={};var _0x1f404a={'count':0x0,'rows':[]};return db[_0x4746('0x3f')][_0x4746('0x70')]({'where':{'id':_0x818286['params']['id']}})[_0x4746('0x21')](handleEntityNotFound(_0x2f5d75,null))['then'](function(_0x5b88ed){if(_0x5b88ed){_0x1b2117[_0x4746('0x44')]=_[_0x4746('0x46')](db['CannedAnswer'][_0x4746('0x40')]);_0x1b2117[_0x4746('0x45')]=_[_0x4746('0x46')](_0x818286[_0x4746('0x45')]);_0x1b2117[_0x4746('0x47')]=_[_0x4746('0x48')](_0x1b2117['model'],_0x1b2117[_0x4746('0x45')]);_0x5b7364[_0x4746('0x4a')]=_[_0x4746('0x48')](_0x1b2117[_0x4746('0x44')],qs[_0x4746('0x49')](_0x818286[_0x4746('0x45')][_0x4746('0x49')]));_0x5b7364[_0x4746('0x4a')]=_0x5b7364[_0x4746('0x4a')][_0x4746('0x4b')]?_0x5b7364['attributes']:_0x1b2117[_0x4746('0x44')];if(!_0x818286[_0x4746('0x45')]['hasOwnProperty']('nolimit')){_0x5b7364['limit']=qs[_0x4746('0x30')](_0x818286[_0x4746('0x45')][_0x4746('0x30')]);_0x5b7364[_0x4746('0x2f')]=qs['offset'](_0x818286['query'][_0x4746('0x2f')]);}_0x5b7364['order']=qs[_0x4746('0x4f')](_0x818286[_0x4746('0x45')][_0x4746('0x4f')]);_0x5b7364[_0x4746('0x50')]=qs['filters'](_[_0x4746('0x51')](_0x818286['query'],_0x1b2117[_0x4746('0x47')]));_0x5b7364['where']['SmsAccountId']=_0x5b88ed['id'];if(_0x818286[_0x4746('0x45')][_0x4746('0x52')]){_0x5b7364['where']=_[_0x4746('0x53')](_0x5b7364[_0x4746('0x50')],{'$or':_[_0x4746('0x3e')](_0x5b7364[_0x4746('0x4a')],function(_0x19045a){var _0x121523={};_0x121523[_0x19045a]={'$like':'%'+_0x818286['query'][_0x4746('0x52')]+'%'};return _0x121523;})});}_0x5b7364=_['merge']({},_0x5b7364,_0x818286[_0x4746('0x55')]);return db[_0x4746('0x6e')]['count']({'where':_0x5b7364[_0x4746('0x50')]})['then'](function(_0x2eff49){_0x1f404a[_0x4746('0x2e')]=_0x2eff49;if(_0x818286['query']['includeAll']){_0x5b7364['include']=[{'all':!![]}];}return db[_0x4746('0x6e')]['findAll'](_0x5b7364);})[_0x4746('0x21')](function(_0x2612cf){_0x1f404a[_0x4746('0x58')]=_0x2612cf;return _0x1f404a;});}})['then'](respondWithFilteredResult(_0x2f5d75,_0x5b7364))[_0x4746('0x2a')](handleError(_0x2f5d75,null));};exports['removeAnswers']=function(_0x182f9a,_0x9712c7,_0x2ff30c){return db[_0x4746('0x3f')][_0x4746('0x5c')]({'where':{'id':_0x182f9a['params']['id']}})[_0x4746('0x21')](handleEntityNotFound(_0x9712c7,null))[_0x4746('0x21')](function(_0x172e93){if(_0x172e93){return _0x172e93['removeAnswers'](_0x182f9a[_0x4746('0x45')][_0x4746('0x6c')]);}})[_0x4746('0x21')](respondWithStatusCode(_0x9712c7,null))[_0x4746('0x2a')](handleError(_0x9712c7,null));};exports[_0x4746('0x71')]=function(_0x32e002,_0x369387,_0x1c81af){var _0x5abeb2={'channel':_0x4746('0x72')};var _0x1e22f8=[];var _0x24977d=[];var _0x833bb2={};return db['SmsAccount'][_0x4746('0x5c')]({'where':{'id':_0x32e002[_0x4746('0x5a')]['id']},'include':[{'model':db[_0x4746('0x73')],'as':_0x4746('0x74')}]})[_0x4746('0x21')](handleEntityNotFound(_0x369387,null))[_0x4746('0x21')](function(_0x57b7b5){_0x5abeb2[_0x4746('0x75')]=_0x57b7b5;_0x5abeb2['applications']=_['orderBy'](_0x57b7b5['Applications'],[_0x4746('0x76')],[_0x4746('0x77')]);if(_0x5abeb2[_0x4746('0x75')][_0x4746('0x74')]){delete _0x5abeb2[_0x4746('0x75')][_0x4746('0x74')];}return db[_0x4746('0x78')][_0x4746('0x67')]();})[_0x4746('0x21')](function(_0x58ee40){if(!_0x58ee40){throw new db[(_0x4746('0x79'))][(_0x4746('0x7a'))](_0x4746('0x7b'));}_0x1e22f8=_['difference'](_[_0x4746('0x46')](_0x58ee40),[_0x4746('0x7c'),_0x4746('0x7d')]);_0x24977d=_[_0x4746('0x7e')](_[_0x4746('0x46')](_0x58ee40),[_0x4746('0x7c'),'updatedAt','CompanyId',_0x4746('0x7f')]);_0x5abeb2[_0x4746('0x5e')]={'mapKey':_0x4746('0x80')};if(_0x5abeb2['account'][_0x4746('0x42')]){switch(_0x5abeb2[_0x4746('0x75')]['type']){case _0x4746('0x81'):_0x5abeb2[_0x4746('0x5e')][_0x4746('0x82')]=_0x32e002['body'][_0x4746('0x83')];_0x5abeb2[_0x4746('0x5e')]['body']=_0x32e002[_0x4746('0x5e')][_0x4746('0x84')];_0x5abeb2[_0x4746('0x5e')][_0x4746('0x85')]=_0x32e002['body'][_0x4746('0x86')];break;case _0x4746('0x87'):_0x5abeb2['body'][_0x4746('0x82')]='+'+_0x32e002[_0x4746('0x5e')]['sender'];_0x5abeb2[_0x4746('0x5e')]['body']=_0x32e002[_0x4746('0x5e')][_0x4746('0x88')];break;case _0x4746('0x89'):_0x5abeb2[_0x4746('0x5e')][_0x4746('0x82')]=_0x32e002[_0x4746('0x5e')][_0x4746('0x82')];_0x5abeb2[_0x4746('0x5e')][_0x4746('0x5e')]=_0x32e002[_0x4746('0x5e')][_0x4746('0x29')];break;case _0x4746('0x8a'):_0x5abeb2['body'][_0x4746('0x82')]=_0x32e002[_0x4746('0x5e')][_0x4746('0x82')];_0x5abeb2['body']['body']=_0x32e002[_0x4746('0x5e')][_0x4746('0x5e')];_0x5abeb2[_0x4746('0x5e')][_0x4746('0x85')]=_0x32e002[_0x4746('0x5e')][_0x4746('0x8b')];break;case _0x4746('0x8c'):_0x5abeb2[_0x4746('0x5e')]['from']=_0x32e002['body'][_0x4746('0x83')];_0x5abeb2[_0x4746('0x5e')][_0x4746('0x5e')]=_0x32e002['body'][_0x4746('0x8d')];_0x5abeb2[_0x4746('0x5e')][_0x4746('0x85')]=_0x32e002[_0x4746('0x5e')]['MessageUUID'];break;case'infobip':_0x5abeb2[_0x4746('0x5e')][_0x4746('0x82')]='+'+_0x32e002[_0x4746('0x5e')]['results'][0x0][_0x4746('0x82')];_0x5abeb2[_0x4746('0x5e')][_0x4746('0x5e')]=_0x32e002[_0x4746('0x5e')][_0x4746('0x8e')][0x0][_0x4746('0x88')];_0x5abeb2[_0x4746('0x5e')][_0x4746('0x85')]=_0x32e002[_0x4746('0x5e')]['results'][0x0][_0x4746('0x85')];break;case _0x4746('0x8f'):_0x5abeb2['body'][_0x4746('0x82')]=_0x32e002['body'][_0x4746('0x90')];_0x5abeb2['body'][_0x4746('0x5e')]=_0x32e002[_0x4746('0x5e')][_0x4746('0x91')][_0x4746('0x29')];break;case _0x4746('0x92'):_0x5abeb2[_0x4746('0x5e')][_0x4746('0x82')]=_0x32e002[_0x4746('0x5e')][_0x4746('0x93')];_0x5abeb2[_0x4746('0x5e')][_0x4746('0x5e')]=_0x32e002[_0x4746('0x5e')][_0x4746('0x88')];_0x5abeb2['body'][_0x4746('0x85')]=_0x32e002[_0x4746('0x5e')][_0x4746('0x94')];break;case _0x4746('0x95'):_0x5abeb2['body'][_0x4746('0x82')]=_0x32e002['body'][_0x4746('0x82')];_0x5abeb2[_0x4746('0x5e')]['body']=_0x32e002[_0x4746('0x5e')][_0x4746('0x29')];_0x5abeb2[_0x4746('0x5e')][_0x4746('0x85')]=_0x32e002['body'][_0x4746('0x96')];break;}}if(_0x5abeb2['body']['id']){delete _0x5abeb2['body']['id'];}if(_['isNil'](_0x5abeb2[_0x4746('0x5e')][_0x4746('0x82')])){throw new db['Sequelize'][(_0x4746('0x7a'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x5abeb2[_0x4746('0x5e')][_0x4746('0x5e')])||_0x5abeb2['body'][_0x4746('0x5e')]===''){throw new db[(_0x4746('0x79'))]['ValidationError'](_0x4746('0x97'));}if(_[_0x4746('0x98')](_0x5abeb2[_0x4746('0x5e')]['mapKey'])){throw new db['Sequelize'][(_0x4746('0x7a'))](_0x4746('0x99')+_0x24977d);}if(!_[_0x4746('0x9a')](_0x24977d,_0x5abeb2[_0x4746('0x5e')][_0x4746('0x9b')])){throw new db['Sequelize']['ValidationError'](_0x4746('0x9c')+_0x24977d);}_0x833bb2[_0x5abeb2['body']['mapKey']]=_0x5abeb2[_0x4746('0x5e')][_0x4746('0x82')];return db[_0x4746('0x9d')][_0x4746('0x5c')]({'where':{'id':_0x5abeb2[_0x4746('0x75')][_0x4746('0x7f')]},'include':[{'model':db[_0x4746('0x78')],'as':'Contacts','where':_0x833bb2,'limit':0x1,'order':[[_0x4746('0x7d'),_0x4746('0x9e')]]}]});})[_0x4746('0x21')](handleEntityNotFound(_0x369387,null))[_0x4746('0x21')](function(_0x19374d){if(_0x19374d){_0x5abeb2[_0x4746('0x9f')]=_['omit'](_0x19374d,['Contacts']);if(_0x19374d[_0x4746('0xa0')][_0x4746('0x4b')]){return _0x19374d['Contacts'][0x0];}var _0x1b93d0=_[_0x4746('0x19')](_0x5abeb2['body'],{'firstName':_0x5abeb2[_0x4746('0x5e')][_0x4746('0x82')],'ListId':_0x19374d['id']});_0x1b93d0[_0x5abeb2[_0x4746('0x5e')][_0x4746('0x9b')]]=_0x5abeb2[_0x4746('0x5e')][_0x4746('0x82')];return db[_0x4746('0x78')][_0x4746('0x5d')](_0x1b93d0,{'fields':_0x1e22f8,'raw':!![]});}})[_0x4746('0x21')](handleEntityNotFound(_0x369387,null))[_0x4746('0x21')](function(_0x44f736){if(_0x44f736){_0x5abeb2[_0x4746('0xa1')]=_0x44f736;var _0x2b1125={'ContactId':_0x44f736['id'],'phone':_0x5abeb2[_0x4746('0x5e')][_0x4746('0x82')],'SmsAccountId':_0x32e002[_0x4746('0x5a')]['id']};var _0x51ecb1={'ContactId':_0x44f736['id'],'SmsAccountId':_0x32e002[_0x4746('0x5a')]['id'],'closed':![]};return db[_0x4746('0xa2')][_0x4746('0x5c')]({'where':_0x51ecb1})['then'](function(_0x5ea62c){if(_0x5ea62c){return[_0x5ea62c,![]];}return db[_0x4746('0xa2')][_0x4746('0x5d')](_0x2b1125)['then'](function(_0x25cb8a){return[_0x25cb8a,!![]];});});}})['spread'](function(_0x2af8fe,_0x561f60){_0x5abeb2[_0x4746('0xa3')]=_0x2af8fe[_0x4746('0x39')]({'plain':!![]});_0x5abeb2[_0x4746('0xa3')]['created']=![];if(_0x561f60){if(_0x5abeb2['account'][_0x4746('0xa4')]){_0x5abeb2[_0x4746('0xa5')]['push']({'id':0x0,'priority':_0x5abeb2[_0x4746('0xa5')][_0x4746('0x4b')]+0x1,'app':'close','appdata':_0x4746('0xa6'),'interval':'*,*,*,*'});}_0x5abeb2[_0x4746('0xa3')][_0x4746('0xa7')]=!![];}return db['SmsMessage'][_0x4746('0x5d')]({'phone':_0x5abeb2[_0x4746('0x5e')][_0x4746('0x82')],'messageId':_0x5abeb2[_0x4746('0x5e')][_0x4746('0x85')],'body':_0x5abeb2[_0x4746('0x5e')][_0x4746('0x5e')],'SmsAccountId':_0x32e002[_0x4746('0x5a')]['id'],'SmsInteractionId':_0x2af8fe['id'],'direction':'in','ContactId':_0x2af8fe[_0x4746('0xa8')],'AttachmentId':_0x5abeb2[_0x4746('0x5e')][_0x4746('0xa9')]});})[_0x4746('0x21')](function(_0x5a8331){_0x5abeb2[_0x4746('0x29')]=_0x5a8331;if(_0x5abeb2['interaction'][_0x4746('0xaa')]){return db[_0x4746('0xab')][_0x4746('0x5c')]({'attributes':['id',_0x4746('0x3b')],'where':{'id':_0x5abeb2[_0x4746('0xa3')][_0x4746('0xaa')]}})[_0x4746('0x21')](function(_0x35d400){if(_0x35d400){_0x5abeb2['applications'][_0x4746('0xac')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x35d400[_0x4746('0x3b')]+','+(_0x5abeb2[_0x4746('0x75')][_0x4746('0xad')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x4746('0xae'),_0x4746('0xaf'),_0x5abeb2);});}return respondWithRpcPromise(_0x4746('0xae'),_0x4746('0xaf'),_0x5abeb2);})[_0x4746('0x21')](function(_0x1bbe07){if(_0x1bbe07){var _0x53bf5f=0xc8;var _0x3ec276=_0x4746('0xb0');logger[_0x4746('0x22')](_0x4746('0x26'),_0x3ec276,_0x53bf5f,'entity\x20found');logger[_0x4746('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x3ec276,_0x53bf5f,_0x4746('0xb1'),JSON[_0x4746('0xb2')](_0x1bbe07));if(_0x5abeb2[_0x4746('0x75')][_0x4746('0x42')]===_0x4746('0x81')){return _0x369387[_0x4746('0x2c')](_0x53bf5f)[_0x4746('0x31')](_0x4746('0xb3'),_0x4746('0xb4'))['send']('\x0a');}else{return _0x369387['status'](_0x53bf5f)[_0x4746('0x33')](_0x1bbe07);}}})['catch'](handleError(_0x369387,null));};exports[_0x4746('0xb5')]=function(_0x43d129,_0x334a52,_0x4db1df){return db[_0x4746('0x3f')][_0x4746('0x70')]({'where':{'id':_0x43d129[_0x4746('0x5a')]['id']}})['then'](handleEntityNotFound(_0x334a52,null))[_0x4746('0x21')](function(_0x2402cf){if(_0x2402cf){return db[_0x4746('0xb6')]['transaction'](function(_0x464be7){return db[_0x4746('0x73')][_0x4746('0x38')]({'where':{'SmsAccountId':_0x43d129[_0x4746('0x5a')]['id']},'transaction':_0x464be7})[_0x4746('0x21')](function(_0x202c2a){var _0x115d4d=_[_0x4746('0x3e')](_0x43d129[_0x4746('0x5e')],function(_0x4ce2fa){_0x4ce2fa[_0x4746('0x69')]=_0x43d129[_0x4746('0x5a')]['id'];return _0x4ce2fa;});return db[_0x4746('0x73')][_0x4746('0xb7')](_0x115d4d,{'transaction':_0x464be7});});})[_0x4746('0x21')](function(){return db[_0x4746('0x73')][_0x4746('0xb8')]({'where':{'SmsAccountId':_0x43d129[_0x4746('0x5a')]['id']},'order':_0x4746('0x76')});});}})[_0x4746('0x21')](respondWithResult(_0x334a52,null))[_0x4746('0x2a')](handleError(_0x334a52,null));};exports[_0x4746('0xb9')]=function(_0x546d5a,_0xfbf3c1,_0xe68dd4){var _0x45015a={};var _0xfaeaab={};var _0x42ecaf;var _0x1b3b46;return db[_0x4746('0x3f')][_0x4746('0x70')]({'where':{'id':_0x546d5a[_0x4746('0x5a')]['id']}})['then'](handleEntityNotFound(_0xfbf3c1,null))[_0x4746('0x21')](function(_0x4eae36){if(_0x4eae36){_0x42ecaf=_0x4eae36;_0xfaeaab[_0x4746('0x44')]=_[_0x4746('0x46')](db[_0x4746('0x73')][_0x4746('0x40')]);_0xfaeaab[_0x4746('0x45')]=_[_0x4746('0x46')](_0x546d5a['query']);_0xfaeaab[_0x4746('0x47')]=_[_0x4746('0x48')](_0xfaeaab[_0x4746('0x44')],_0xfaeaab['query']);_0x45015a[_0x4746('0x4a')]=_[_0x4746('0x48')](_0xfaeaab[_0x4746('0x44')],qs[_0x4746('0x49')](_0x546d5a[_0x4746('0x45')][_0x4746('0x49')]));_0x45015a['attributes']=_0x45015a[_0x4746('0x4a')]['length']?_0x45015a[_0x4746('0x4a')]:_0xfaeaab['model'];_0x45015a['order']=qs[_0x4746('0x4f')](_0x546d5a[_0x4746('0x45')][_0x4746('0x4f')]);_0x45015a[_0x4746('0x50')]=qs[_0x4746('0x47')](_[_0x4746('0x51')](_0x546d5a[_0x4746('0x45')],_0xfaeaab[_0x4746('0x47')]));if(_0x546d5a[_0x4746('0x45')][_0x4746('0x52')]){_0x45015a[_0x4746('0x50')]=_['merge'](_0x45015a[_0x4746('0x50')],{'$or':_['map'](_0x45015a[_0x4746('0x4a')],function(_0x19d0b3){var _0x560819={};_0x560819[_0x19d0b3]={'$like':'%'+_0x546d5a['query'][_0x4746('0x52')]+'%'};return _0x560819;})});}_0x45015a=_['merge']({},_0x45015a,_0x546d5a[_0x4746('0x55')]);return _0x42ecaf[_0x4746('0xb9')](_0x45015a);}})['then'](function(_0x59f48e){if(_0x59f48e){_0x1b3b46=_0x59f48e['length'];if(!_0x546d5a[_0x4746('0x45')][_0x4746('0x4c')]('nolimit')){_0x45015a[_0x4746('0x30')]=qs[_0x4746('0x30')](_0x546d5a['query'][_0x4746('0x30')]);_0x45015a['offset']=qs['offset'](_0x546d5a[_0x4746('0x45')][_0x4746('0x2f')]);}return _0x42ecaf[_0x4746('0xb9')](_0x45015a);}})[_0x4746('0x21')](function(_0x21d08c){if(_0x21d08c){return _0x21d08c?{'count':_0x1b3b46,'rows':_0x21d08c}:null;}})[_0x4746('0x21')](respondWithResult(_0xfbf3c1,null))[_0x4746('0x2a')](handleError(_0xfbf3c1,null));};exports[_0x4746('0xba')]=function(_0x42a9e5,_0x534967,_0x1a80b6){var _0x62fb83={'raw':![],'where':{}};var _0x518eb9={};var _0x10a450={'count':0x0,'rows':[]};return db[_0x4746('0x3f')][_0x4746('0x70')]({'where':{'id':_0x42a9e5[_0x4746('0x5a')]['id']}})['then'](handleEntityNotFound(_0x534967,null))[_0x4746('0x21')](function(_0x1dd072){if(_0x1dd072){_0x518eb9[_0x4746('0x44')]=_[_0x4746('0x46')](db[_0x4746('0xa2')][_0x4746('0x40')]);_0x518eb9[_0x4746('0x45')]=_[_0x4746('0x46')](_0x42a9e5[_0x4746('0x45')]);_0x518eb9[_0x4746('0x47')]=_[_0x4746('0x48')](_0x518eb9[_0x4746('0x44')],_0x518eb9[_0x4746('0x45')]);_0x62fb83['attributes']=_[_0x4746('0x48')](_0x518eb9[_0x4746('0x44')],qs[_0x4746('0x49')](_0x42a9e5[_0x4746('0x45')][_0x4746('0x49')]));_0x62fb83[_0x4746('0x4a')]=_0x62fb83['attributes'][_0x4746('0x4b')]?_0x62fb83['attributes']:_0x518eb9[_0x4746('0x44')];if(!_0x42a9e5[_0x4746('0x45')]['hasOwnProperty'](_0x4746('0x4d'))){_0x62fb83[_0x4746('0x30')]=qs['limit'](_0x42a9e5[_0x4746('0x45')][_0x4746('0x30')]);_0x62fb83[_0x4746('0x2f')]=qs[_0x4746('0x2f')](_0x42a9e5[_0x4746('0x45')][_0x4746('0x2f')]);}_0x62fb83['order']=qs[_0x4746('0x4f')](_0x42a9e5['query'][_0x4746('0x4f')]);_0x62fb83['where']=qs['filters'](_['pick'](_0x42a9e5['query'],_0x518eb9[_0x4746('0x47')]));_0x62fb83['where'][_0x4746('0x69')]=_0x1dd072['id'];if(_0x42a9e5['query'][_0x4746('0x52')]){_0x62fb83[_0x4746('0x50')]=_['merge'](_0x62fb83[_0x4746('0x50')],{'$or':_[_0x4746('0x3e')](_0x62fb83[_0x4746('0x4a')],function(_0x592743){var _0x20a1f2={};_0x20a1f2[_0x592743]={'$like':'%'+_0x42a9e5[_0x4746('0x45')]['filter']+'%'};return _0x20a1f2;})});}_0x62fb83=_[_0x4746('0x53')]({},_0x62fb83,_0x42a9e5['options']);return db[_0x4746('0xa2')][_0x4746('0x2e')]({'where':_0x62fb83[_0x4746('0x50')]})[_0x4746('0x21')](function(_0x3a33b5){_0x10a450[_0x4746('0x2e')]=_0x3a33b5;if(_0x42a9e5[_0x4746('0x45')]['includeAll']){_0x62fb83[_0x4746('0x6b')]=[{'model':db[_0x4746('0x78')],'as':_0x4746('0xbb'),'required':![]},{'model':db[_0x4746('0xab')],'as':_0x4746('0xbc'),'attributes':[_0x4746('0x3b'),'fullname',_0x4746('0xbd')],'required':![]},{'model':db[_0x4746('0xbe')],'as':_0x4746('0xbf'),'attributes':['id',_0x4746('0x3b'),_0x4746('0xc0')],'where':_0x42a9e5[_0x4746('0x45')][_0x4746('0xc1')]?{'id':_0x42a9e5[_0x4746('0x45')][_0x4746('0xc1')]}:undefined,'required':_0x42a9e5[_0x4746('0x45')][_0x4746('0xc1')]?!![]:![]}];}return db[_0x4746('0xa2')][_0x4746('0x57')](_0x62fb83);})[_0x4746('0x21')](function(_0x3ad9a3){_0x10a450['rows']=_0x3ad9a3;return _0x10a450;});}})['then'](respondWithFilteredResult(_0x534967,_0x62fb83))['catch'](handleError(_0x534967,null));};exports['send']=function(_0x1bfdbb,_0x19fa11,_0x2ca3df){var _0x8edb27,_0x356e6b,_0x654a2a;if(_[_0x4746('0x98')](_0x1bfdbb[_0x4746('0x5e')][_0x4746('0x5e')])||_0x1bfdbb['body'][_0x4746('0x5e')]===''){throw new db[(_0x4746('0x79'))]['ValidationError'](_0x4746('0x97'));}if(_['isNil'](_0x1bfdbb['body']['to'])){throw new db[(_0x4746('0x79'))][(_0x4746('0x7a'))](_0x4746('0xc2'));}_0x8edb27=_0x1bfdbb['body']['to'];return db[_0x4746('0x3f')][_0x4746('0x5c')]({'where':{'id':_0x1bfdbb[_0x4746('0x5a')]['id']},'include':[{'model':db[_0x4746('0x9d')],'as':'List','include':[{'model':db[_0x4746('0x78')],'as':_0x4746('0xa0'),'where':{'mobile':_0x8edb27},'limit':0x1,'order':[[_0x4746('0x7d'),_0x4746('0x9e')]]}]}]})[_0x4746('0x21')](handleEntityNotFound(_0x19fa11,null))['then'](function(_0x2dc32f){if(_0x2dc32f&&_0x2dc32f['List']){_0x356e6b=_0x2dc32f[_0x4746('0x39')]({'plain':!![]});if(_0x356e6b[_0x4746('0xc3')]&&_0x356e6b[_0x4746('0xc3')][_0x4746('0xa0')][_0x4746('0x4b')]){return _0x356e6b[_0x4746('0xc3')][_0x4746('0xa0')][0x0];}return db[_0x4746('0x78')][_0x4746('0x5d')](_['defaults'](_0x1bfdbb[_0x4746('0x5e')],{'firstName':_0x8edb27,'mobile':_0x8edb27,'phone':_0x8edb27,'ListId':_0x356e6b[_0x4746('0x7f')]}));}})[_0x4746('0x21')](handleEntityNotFound(_0x19fa11,null))[_0x4746('0x21')](function(_0x522a1c){if(_0x522a1c){_0x654a2a=_0x522a1c;return db[_0x4746('0xa2')][_0x4746('0x5c')]({'where':{'ContactId':_0x654a2a['id'],'closed':![],'SmsAccountId':_0x356e6b['id']}})[_0x4746('0x21')](function(_0x205526){if(_0x205526){return[_0x205526,![]];}return db[_0x4746('0xa2')][_0x4746('0x5d')]({'UserId':_0x1bfdbb['user']['id'],'ContactId':_0x654a2a['id'],'SmsAccountId':_0x356e6b['id'],'phone':_0x8edb27,'firstMsgDirection':_0x4746('0xc4'),'Messages':[_[_0x4746('0x53')](_0x1bfdbb[_0x4746('0x5e')],{'read':![],'body':_0x1bfdbb[_0x4746('0x5e')][_0x4746('0x5e')],'phone':_0x8edb27,'SmsAccountId':_0x356e6b['id'],'UserId':_0x1bfdbb[_0x4746('0x5f')]['id'],'ContactId':_0x654a2a['id']})]},{'include':[{'model':db['SmsMessage'],'as':'Messages'}]})['then'](function(_0x136863){return[_0x136863,!![]];});});}})[_0x4746('0xc5')](function(_0x148c23,_0x4fc859){if(_0x4fc859){return _0x148c23;}return db[_0x4746('0xc6')][_0x4746('0x5d')](_[_0x4746('0x53')](_0x1bfdbb[_0x4746('0x5e')],{'read':![],'body':_0x1bfdbb['body'][_0x4746('0x5e')],'phone':_0x8edb27,'SmsAccountId':_0x356e6b['id'],'SmsInteractionId':_0x148c23['id'],'UserId':_0x1bfdbb[_0x4746('0x5f')]['id'],'ContactId':_0x654a2a['id']}))[_0x4746('0x21')](function(_0x7123cc){_0x148c23['dataValues'][_0x4746('0xc7')]=[];_0x148c23['dataValues'][_0x4746('0xc7')][_0x4746('0xc8')](_0x7123cc[_0x4746('0xc9')]);return _0x148c23;});})[_0x4746('0x21')](respondWithResult(_0x19fa11,null))[_0x4746('0x2a')](handleError(_0x19fa11,null));};exports[_0x4746('0x2c')]=function(_0x4ff3af,_0xdf63c,_0x54b0e2){if(_0x4ff3af[_0x4746('0x5e')]['id']){delete _0x4ff3af[_0x4746('0x5e')]['id'];}console[_0x4746('0xca')](_0x4746('0xcb'),_0x4ff3af[_0x4746('0x5e')]);var _0x4e7b7b,_0x1bb88e,_0x43731d;return db[_0x4746('0x3f')][_0x4746('0x5c')]({'where':{'id':_0x4ff3af[_0x4746('0x5a')]['id']}})[_0x4746('0x21')](handleEntityNotFound(_0xdf63c,null))[_0x4746('0x21')](function(_0x5436c3){if(_0x5436c3){_0x43731d=_0x5436c3;logger[_0x4746('0x25')](_0x4746('0x26'),_0x4746('0x2c'),_0x4746('0xcc'),_0x5436c3[_0x4746('0x42')],util['inspect'](_0x4ff3af[_0x4746('0x5e')],{'showHidden':![],'depth':null}));switch(_0x5436c3['type']){case _0x4746('0x87'):if(_0x4ff3af[_0x4746('0x5e')][_0x4746('0xcd')]&&_0x4ff3af['body']['status']){_0x1bb88e=_0x4ff3af['body'][_0x4746('0x2c')];return db['SmsMessage'][_0x4746('0x5c')]({'where':{'messageId':_0x4ff3af[_0x4746('0x5e')][_0x4746('0xcd')]}});}break;case _0x4746('0x89'):if(_0x4ff3af[_0x4746('0x5e')][_0x4746('0xce')]&&_0x4ff3af[_0x4746('0x5e')][_0x4746('0xcf')]){_0x1bb88e=_0x4ff3af[_0x4746('0x5e')][_0x4746('0xcf')];return db[_0x4746('0xc6')][_0x4746('0x5c')]({'where':{'messageId':_0x4ff3af['body'][_0x4746('0xce')]}});}break;case'clicksend':if(_0x4ff3af[_0x4746('0x5e')][_0x4746('0x8b')]&&_0x4ff3af[_0x4746('0x5e')][_0x4746('0xd0')]){_0x1bb88e=_0x4ff3af['body'][_0x4746('0xd0')];return db[_0x4746('0xc6')][_0x4746('0x5c')]({'where':{'messageId':_0x4ff3af[_0x4746('0x5e')]['message_id']}});}break;case _0x4746('0xd1'):var _0x582943=_0x4ff3af['body'][_0x4746('0x8e')][0x0];if(_0x582943[_0x4746('0x85')]&&_0x582943[_0x4746('0x2c')][_0x4746('0xd2')]===_0x4746('0xd3')){_0x1bb88e=_0x582943[_0x4746('0x2c')][_0x4746('0xd2')];return db[_0x4746('0xc6')][_0x4746('0x5c')]({'where':{'messageId':_0x582943['messageId']}});}break;case'clickatell':if(_0x4ff3af[_0x4746('0x5e')][_0x4746('0x85')]&&_0x4ff3af[_0x4746('0x5e')][_0x4746('0x2c')]){_0x1bb88e=_0x4ff3af['body']['status'];return db[_0x4746('0xc6')][_0x4746('0x5c')]({'where':{'messageId':_0x4ff3af[_0x4746('0x5e')][_0x4746('0x85')]}});}break;case _0x4746('0x95'):if(_0x4ff3af['body']['redif']&&_0x4ff3af[_0x4746('0x5e')][_0x4746('0x2c')]){_0x1bb88e=_0x4ff3af[_0x4746('0x5e')][_0x4746('0x2c')];return db[_0x4746('0xc6')]['find']({'where':{'messageId':_0x4ff3af[_0x4746('0x5e')][_0x4746('0xd4')]}});}break;}}})[_0x4746('0x21')](handleEntityNotFound(_0xdf63c,null))['then'](function(_0x3e7b21){if(_0x3e7b21){_0x4e7b7b=_0x3e7b21;switch(_0x43731d[_0x4746('0x42')]){case _0x4746('0x87'):if(_0x1bb88e===_0x4746('0xd3')){return _0x4e7b7b[_0x4746('0x37')]({'read':!![]});}else{logger[_0x4746('0x27')](_0x4746('0x26'),_0x4746('0x2c'),_0x4746('0x87'),util['inspect'](_0x4ff3af[_0x4746('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x4746('0x89'):if(_0x1bb88e==='1'){return _0x4e7b7b['update']({'read':!![]});}else{logger['error'](_0x4746('0x26'),_0x4746('0x2c'),'skebby',util['inspect'](_0x4ff3af[_0x4746('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x4746('0x8a'):if(!_0x4ff3af[_0x4746('0x5e')]['error_code']&&_0x1bb88e>=0xc8&&_0x1bb88e<=0xce){return _0x4e7b7b[_0x4746('0x37')]({'read':!![]});}else{logger['error'](_0x4746('0x26'),_0x4746('0x2c'),_0x4746('0x8a'),util['inspect'](_0x4ff3af[_0x4746('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x4746('0xd1'):var _0x3572ba=_0x4ff3af['body'][_0x4746('0x8e')][0x0];if(_0x3572ba[_0x4746('0x2c')][_0x4746('0xd2')]===_0x4746('0xd3')){return _0x4e7b7b['update']({'read':!![]});}else{logger[_0x4746('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x4746('0x2c'),'infobip',util[_0x4746('0xd5')](_0x4ff3af['body'],{'showHidden':![],'depth':null}));}break;case _0x4746('0x92'):if(_0x1bb88e==_0x4746('0xd6')||_0x1bb88e=='RECEIVED_BY_RECIPIENT'){return _0x4e7b7b[_0x4746('0x37')]({'read':!![]});}else{logger[_0x4746('0x27')](_0x4746('0x26'),_0x4746('0x2c'),_0x4746('0x92'),util[_0x4746('0xd5')](_0x4ff3af[_0x4746('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x4746('0x95'):if(_0x1bb88e===_0x4746('0xd7')||_0x1bb88e==='ACCEPTD'){return _0x4e7b7b[_0x4746('0x37')]({'read':!![]});}else{logger[_0x4746('0x27')](_0x4746('0x26'),'status',_0x4746('0x95'),util[_0x4746('0xd5')](_0x4ff3af[_0x4746('0x5e')],{'showHidden':![],'depth':null}));}break;}return _0x4e7b7b;}})['then'](respondWithResult(_0xdf63c,null))[_0x4746('0x2a')](handleError(_0xdf63c,null));};exports[_0x4746('0xd8')]=function(_0x3f4990,_0x449b3e,_0x2c73d7){var _0x556fbc,_0x2203e0,_0x5e2adc;return db[_0x4746('0x3f')][_0x4746('0x5c')]({'where':{'id':_0x3f4990[_0x4746('0x5a')]['id']}})['then'](handleEntityNotFound(_0x449b3e,null))['then'](function(_0x29d3fe){if(_0x29d3fe){_0x5e2adc=_0x29d3fe;logger[_0x4746('0x25')](_0x4746('0x26'),'status','received\x20delivery\x20report\x20from',_0x29d3fe[_0x4746('0x42')],util[_0x4746('0xd5')](_0x3f4990[_0x4746('0x45')],{'showHidden':![],'depth':null}));switch(_0x29d3fe[_0x4746('0x42')]){case _0x4746('0x8f'):if(_0x3f4990[_0x4746('0x45')][_0x4746('0xd9')]&&_0x3f4990[_0x4746('0x45')][_0x4746('0xda')]){_0x2203e0=_0x3f4990['query'][_0x4746('0xda')];return db[_0x4746('0xc6')][_0x4746('0x5c')]({'where':{'messageId':_0x3f4990[_0x4746('0x45')][_0x4746('0xd9')]}});}break;}}})[_0x4746('0x21')](handleEntityNotFound(_0x449b3e,null))[_0x4746('0x21')](function(_0x3e8ec8){if(_0x3e8ec8){_0x556fbc=_0x3e8ec8;switch(_0x5e2adc['type']){case _0x4746('0x8f'):if(_0x2203e0==='2'||_0x2203e0==='6'){return _0x556fbc[_0x4746('0x37')]({'read':!![]});}else{logger[_0x4746('0x27')](_0x4746('0x26'),_0x4746('0x2c'),_0x4746('0x8f'),util[_0x4746('0xd5')](_0x3f4990[_0x4746('0x45')],{'showHidden':![],'depth':null}));};break;}return _0x556fbc;}})[_0x4746('0x21')](respondWithResult(_0x449b3e,null))['catch'](handleError(_0x449b3e,null));};exports[_0x4746('0xdb')]=function(_0x3455af,_0x1b868d,_0x40579d){return db['SmsAccount'][_0x4746('0x5c')]({'where':{'id':_0x3455af[_0x4746('0x5a')]['id']}})[_0x4746('0x21')](handleEntityNotFound(_0x1b868d,null))[_0x4746('0x21')](function(_0x16e60c){if(_0x16e60c){return _0x16e60c['addAgents'](_0x3455af[_0x4746('0x5e')][_0x4746('0x6c')],_[_0x4746('0xdc')](_0x3455af[_0x4746('0x5e')],[_0x4746('0x6c'),'id'])||{})[_0x4746('0xc5')](function(_0x3c9fc6){for(var _0x9810b2=0x0;_0x9810b2<_0x3455af[_0x4746('0x5e')][_0x4746('0x6c')][_0x4746('0x4b')];_0x9810b2+=0x1){socket['emit'](_0x4746('0xdd'),{'UserId':_0x3455af[_0x4746('0x5e')][_0x4746('0x6c')][_0x9810b2],'SmsAccountId':_0x3455af[_0x4746('0x5a')]['id']});}return _0x3c9fc6;});}})[_0x4746('0x21')](respondWithResult(_0x1b868d,null))[_0x4746('0x2a')](handleError(_0x1b868d,null));};exports[_0x4746('0xde')]=function(_0x2e8ae9,_0x2828a9,_0x117199){return db[_0x4746('0x3f')]['find']({'where':{'id':_0x2e8ae9[_0x4746('0x5a')]['id']}})['then'](handleEntityNotFound(_0x2828a9,null))[_0x4746('0x21')](function(_0x448beb){if(_0x448beb){return _0x448beb[_0x4746('0xde')](_0x2e8ae9[_0x4746('0x45')][_0x4746('0x6c')])[_0x4746('0x21')](function(){if(_[_0x4746('0xdf')](_0x2e8ae9['query'][_0x4746('0x6c')])){for(var _0x35f951=0x0;_0x35f951<_0x2e8ae9[_0x4746('0x45')]['ids'][_0x4746('0x4b')];_0x35f951+=0x1){socket[_0x4746('0xe0')](_0x4746('0xe1'),{'UserId':Number(_0x2e8ae9[_0x4746('0x45')][_0x4746('0x6c')][_0x35f951]),'SmsAccountId':Number(_0x2e8ae9['params']['id'])});}}else{socket['emit'](_0x4746('0xe1'),{'UserId':Number(_0x2e8ae9[_0x4746('0x45')]['ids']),'SmsAccountId':Number(_0x2e8ae9[_0x4746('0x5a')]['id'])});}});}})[_0x4746('0x21')](respondWithStatusCode(_0x2828a9,null))[_0x4746('0x2a')](handleError(_0x2828a9,null));};exports['getAgents']=function(_0x158548,_0x4f28f1,_0x33c520){var _0x28a78d={};var _0x367452={};var _0x3ba77b;var _0x398dd0;return db['SmsAccount'][_0x4746('0x70')]({'where':{'id':_0x158548[_0x4746('0x5a')]['id']}})['then'](handleEntityNotFound(_0x4f28f1,null))[_0x4746('0x21')](function(_0x5d7c9b){if(_0x5d7c9b){_0x3ba77b=_0x5d7c9b;_0x367452[_0x4746('0x44')]=_['keys'](db[_0x4746('0xab')][_0x4746('0x40')]);_0x367452[_0x4746('0x45')]=_['keys'](_0x158548[_0x4746('0x45')]);_0x367452[_0x4746('0x47')]=_['intersection'](_0x367452[_0x4746('0x44')],_0x367452['query']);_0x28a78d['attributes']=_[_0x4746('0x48')](_0x367452[_0x4746('0x44')],qs[_0x4746('0x49')](_0x158548[_0x4746('0x45')][_0x4746('0x49')]));_0x28a78d[_0x4746('0x4a')]=_0x28a78d[_0x4746('0x4a')][_0x4746('0x4b')]?_0x28a78d[_0x4746('0x4a')]:_0x367452['model'];_0x28a78d[_0x4746('0x4e')]=qs[_0x4746('0x4f')](_0x158548[_0x4746('0x45')]['sort']);_0x28a78d[_0x4746('0x50')]=qs[_0x4746('0x47')](_[_0x4746('0x51')](_0x158548['query'],_0x367452[_0x4746('0x47')]));if(_0x158548[_0x4746('0x45')][_0x4746('0x52')]){_0x28a78d[_0x4746('0x50')]=_[_0x4746('0x53')](_0x28a78d['where'],{'$or':_[_0x4746('0x3e')](_0x28a78d[_0x4746('0x4a')],function(_0x449271){var _0x4c6907={};_0x4c6907[_0x449271]={'$like':'%'+_0x158548[_0x4746('0x45')]['filter']+'%'};return _0x4c6907;})});}_0x28a78d=_[_0x4746('0x53')]({},_0x28a78d,_0x158548[_0x4746('0x55')]);return _0x3ba77b[_0x4746('0xe2')](_0x28a78d);}})[_0x4746('0x21')](function(_0x4846ec){if(_0x4846ec){_0x398dd0=_0x4846ec['length'];if(!_0x158548['query']['hasOwnProperty'](_0x4746('0x4d'))){_0x28a78d[_0x4746('0x30')]=qs['limit'](_0x158548['query'][_0x4746('0x30')]);_0x28a78d['offset']=qs['offset'](_0x158548[_0x4746('0x45')]['offset']);}return _0x3ba77b[_0x4746('0xe2')](_0x28a78d);}})[_0x4746('0x21')](function(_0x2a5ff4){if(_0x2a5ff4){return _0x2a5ff4?{'count':_0x398dd0,'rows':_0x2a5ff4}:null;}})[_0x4746('0x21')](respondWithResult(_0x4f28f1,null))['catch'](handleError(_0x4f28f1,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 810ec50..47f9a2d 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 _0x2fc9=['emit','exports','../../mysqldb','SmsAccount','setMaxListeners','save','update','remove'];(function(_0x56c7c5,_0x538778){var _0xd9aa65=function(_0x1f0546){while(--_0x1f0546){_0x56c7c5['push'](_0x56c7c5['shift']());}};_0xd9aa65(++_0x538778);}(_0x2fc9,0xc2));var _0x92fc=function(_0x367336,_0x18c229){_0x367336=_0x367336-0x0;var _0x3423a7=_0x2fc9[_0x367336];return _0x3423a7;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0x92fc('0x0'))['db'][_0x92fc('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x92fc('0x2')](0x0);var events={'afterCreate':_0x92fc('0x3'),'afterUpdate':_0x92fc('0x4'),'afterDestroy':_0x92fc('0x5')};function emitEvent(_0x460229){return function(_0x4267ab,_0x2307a2,_0x2872f5){SmsAccountEvents[_0x92fc('0x6')](_0x460229+':'+_0x4267ab['id'],_0x4267ab);SmsAccountEvents['emit'](_0x460229,_0x4267ab);_0x2872f5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0x92fc('0x7')]=SmsAccountEvents; \ No newline at end of file +var _0xd786=['../../mysqldb','SmsAccount','setMaxListeners','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xd786,0x1dc));var _0x6d78=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xd786[_0x2f5ac5];return _0x37c9a8;};'use strict';var EventEmitter=require(_0x6d78('0x0'));var SmsAccount=require(_0x6d78('0x1'))['db'][_0x6d78('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x6d78('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6d78('0x4'),'afterDestroy':_0x6d78('0x5')};function emitEvent(_0x25116c){return function(_0x26db86,_0x3e8dfd,_0x431c67){SmsAccountEvents[_0x6d78('0x6')](_0x25116c+':'+_0x26db86['id'],_0x26db86);SmsAccountEvents['emit'](_0x25116c,_0x26db86);_0x431c67(null);};}for(var e in events){if(events[_0x6d78('0x7')](e)){var event=events[e];SmsAccount[_0x6d78('0x8')](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index a22211a..76ed5ac 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 _0x1c4c=['exports','define','SmsAccount','sms_accounts','lodash','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x1c4c,0xf6));var _0xc1c4=function(_0x5756c6,_0x58290a){_0x5756c6=_0x5756c6-0x0;var _0x4b5806=_0x1c4c[_0x5756c6];return _0x4b5806;};'use strict';var _=require(_0xc1c4('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc1c4('0x1'));var moment=require(_0xc1c4('0x2'));var BPromise=require(_0xc1c4('0x3'));var rp=require(_0xc1c4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc1c4('0x5'));var config=require(_0xc1c4('0x6'));var attributes=require('./smsAccount.attributes');module[_0xc1c4('0x7')]=function(_0x1c7241,_0xacd549){return _0x1c7241[_0xc1c4('0x8')](_0xc1c4('0x9'),attributes,{'tableName':_0xc1c4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6790=['util','moment','request-promise','path','../../config/environment','./smsAccount.attributes','exports','define','SmsAccount','sms_accounts'];(function(_0x4d33b5,_0x2d65a6){var _0x181b5c=function(_0x112782){while(--_0x112782){_0x4d33b5['push'](_0x4d33b5['shift']());}};_0x181b5c(++_0x2d65a6);}(_0x6790,0x1b8));var _0x0679=function(_0x31f220,_0x3dd8fb){_0x31f220=_0x31f220-0x0;var _0x6547c4=_0x6790[_0x31f220];return _0x6547c4;};'use strict';var _=require('lodash');var util=require(_0x0679('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x0679('0x1'));var BPromise=require('bluebird');var rp=require(_0x0679('0x2'));var fs=require('fs');var path=require(_0x0679('0x3'));var rimraf=require('rimraf');var config=require(_0x0679('0x4'));var attributes=require(_0x0679('0x5'));module[_0x0679('0x6')]=function(_0x23aa72,_0x42cb44){return _0x23aa72[_0x0679('0x7')](_0x0679('0x8'),attributes,{'tableName':_0x0679('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.rpc.js b/server/api/smsAccount/smsAccount.rpc.js index 4f0ba5a..3f57b74 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 _0xdf75=['error','message','result','catch','ShowSmsAccount','find','options','raw','attributes','include','model','map','debug','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1ceba7,_0x4bf430){var _0x2771c1=function(_0x2184f7){while(--_0x2184f7){_0x1ceba7['push'](_0x1ceba7['shift']());}};_0x2771c1(++_0x4bf430);}(_0xdf75,0x1e9));var _0x5df7=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xdf75[_0x432682];return _0x463d05;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x5df7('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5df7('0x1'));var db=require(_0x5df7('0x2'))['db'];var utils=require(_0x5df7('0x3'));var logger=require(_0x5df7('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5df7('0x5'));var client=jayson[_0x5df7('0x6')][_0x5df7('0x7')]({'port':0x232a});config[_0x5df7('0x8')]=_[_0x5df7('0x9')](config['redis'],{'host':_0x5df7('0xa'),'port':0x18eb});var socket=require(_0x5df7('0xb'))(new Redis(config[_0x5df7('0x8')]));require(_0x5df7('0xc'))[_0x5df7('0xd')](socket);function respondWithRpcPromise(_0x128f5a,_0x885863,_0x848b79){return new BPromise(function(_0x123a70,_0x3c765a){return client[_0x5df7('0xe')](_0x128f5a,_0x848b79)[_0x5df7('0xf')](function(_0x31bb62){logger[_0x5df7('0x10')](_0x5df7('0x11'),_0x885863,_0x5df7('0x12'));logger['debug'](_0x5df7('0x13'),_0x885863,'request\x20sent',JSON[_0x5df7('0x14')](_0x31bb62));if(_0x31bb62[_0x5df7('0x15')]){if(_0x31bb62['error']['code']===0x1f4){logger['error'](_0x5df7('0x11'),_0x885863,_0x31bb62['error'][_0x5df7('0x16')]);return _0x3c765a(_0x31bb62[_0x5df7('0x15')][_0x5df7('0x16')]);}logger[_0x5df7('0x15')]('SmsAccount,\x20%s,\x20%s',_0x885863,_0x31bb62[_0x5df7('0x15')][_0x5df7('0x16')]);return _0x123a70(_0x31bb62[_0x5df7('0x15')][_0x5df7('0x16')]);}else{logger['info']('SmsAccount,\x20%s,\x20%s',_0x885863,_0x5df7('0x12'));_0x123a70(_0x31bb62[_0x5df7('0x17')][_0x5df7('0x16')]);}})[_0x5df7('0x18')](function(_0x313b3e){logger[_0x5df7('0x15')](_0x5df7('0x11'),_0x885863,_0x313b3e);_0x3c765a(_0x313b3e);});});}exports[_0x5df7('0x19')]=function(_0x9ea098){var _0x2c23a4=this;return new Promise(function(_0x40bb64,_0x267076){return db['SmsAccount'][_0x5df7('0x1a')]({'raw':_0x9ea098[_0x5df7('0x1b')]?_0x9ea098[_0x5df7('0x1b')][_0x5df7('0x1c')]===undefined?!![]:![]:!![],'where':_0x9ea098[_0x5df7('0x1b')]?_0x9ea098[_0x5df7('0x1b')]['where']||null:null,'attributes':_0x9ea098[_0x5df7('0x1b')]?_0x9ea098[_0x5df7('0x1b')][_0x5df7('0x1d')]||null:null,'include':_0x9ea098['options']?_0x9ea098[_0x5df7('0x1b')]['include']?_['map'](_0x9ea098[_0x5df7('0x1b')][_0x5df7('0x1e')],function(_0x3a0dfd){return{'model':db[_0x3a0dfd[_0x5df7('0x1f')]],'as':_0x3a0dfd['as'],'attributes':_0x3a0dfd[_0x5df7('0x1d')],'include':_0x3a0dfd[_0x5df7('0x1e')]?_['map'](_0x3a0dfd[_0x5df7('0x1e')],function(_0x5dab0f){return{'model':db[_0x5dab0f[_0x5df7('0x1f')]],'as':_0x5dab0f['as'],'attributes':_0x5dab0f['attributes'],'include':_0x5dab0f['include']?_[_0x5df7('0x20')](_0x5dab0f[_0x5df7('0x1e')],function(_0x3dafe5){return{'model':db[_0x3dafe5[_0x5df7('0x1f')]],'as':_0x3dafe5['as'],'attributes':_0x3dafe5[_0x5df7('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x5df7('0xf')](function(_0x3ed17e){logger[_0x5df7('0x10')]('ShowSmsAccount',_0x9ea098);logger[_0x5df7('0x21')](_0x5df7('0x19'),_0x9ea098,JSON[_0x5df7('0x14')](_0x3ed17e));_0x40bb64(_0x3ed17e);})['catch'](function(_0x4117df){logger[_0x5df7('0x15')]('ShowSmsAccount',_0x4117df[_0x5df7('0x16')],_0x9ea098);_0x267076(_0x2c23a4[_0x5df7('0x15')](0x1f4,_0x4117df[_0x5df7('0x16')]));});});}; \ No newline at end of file +var _0xa876=['client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','error','code','SmsAccount,\x20%s,\x20%s','message','result','ShowSmsAccount','SmsAccount','find','options','raw','attributes','map','include','model','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x2f870c,_0x41d135){var _0x5298ed=function(_0x3e82a6){while(--_0x3e82a6){_0x2f870c['push'](_0x2f870c['shift']());}};_0x5298ed(++_0x41d135);}(_0xa876,0x10f));var _0x6a87=function(_0x4f2658,_0x525842){_0x4f2658=_0x4f2658-0x0;var _0x2d0018=_0xa876[_0x4f2658];return _0x2d0018;};'use strict';var _=require(_0x6a87('0x0'));var util=require(_0x6a87('0x1'));var moment=require('moment');var BPromise=require(_0x6a87('0x2'));var rs=require(_0x6a87('0x3'));var fs=require('fs');var Redis=require(_0x6a87('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6a87('0x5'));var logger=require(_0x6a87('0x6'))('rpc');var config=require(_0x6a87('0x7'));var jayson=require(_0x6a87('0x8'));var client=jayson[_0x6a87('0x9')][_0x6a87('0xa')]({'port':0x232a});config[_0x6a87('0xb')]=_[_0x6a87('0xc')](config['redis'],{'host':_0x6a87('0xd'),'port':0x18eb});var socket=require(_0x6a87('0xe'))(new Redis(config[_0x6a87('0xb')]));require('./smsAccount.socket')[_0x6a87('0xf')](socket);function respondWithRpcPromise(_0x2d0161,_0x5e193e,_0x44b26e){return new BPromise(function(_0x2355b8,_0xc0164f){return client[_0x6a87('0x10')](_0x2d0161,_0x44b26e)[_0x6a87('0x11')](function(_0xf29a0d){logger[_0x6a87('0x12')]('SmsAccount,\x20%s,\x20%s',_0x5e193e,_0x6a87('0x13'));logger[_0x6a87('0x14')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x5e193e,_0x6a87('0x13'),JSON['stringify'](_0xf29a0d));if(_0xf29a0d['error']){if(_0xf29a0d[_0x6a87('0x15')][_0x6a87('0x16')]===0x1f4){logger['error'](_0x6a87('0x17'),_0x5e193e,_0xf29a0d[_0x6a87('0x15')][_0x6a87('0x18')]);return _0xc0164f(_0xf29a0d[_0x6a87('0x15')][_0x6a87('0x18')]);}logger[_0x6a87('0x15')](_0x6a87('0x17'),_0x5e193e,_0xf29a0d[_0x6a87('0x15')]['message']);return _0x2355b8(_0xf29a0d[_0x6a87('0x15')][_0x6a87('0x18')]);}else{logger[_0x6a87('0x12')]('SmsAccount,\x20%s,\x20%s',_0x5e193e,_0x6a87('0x13'));_0x2355b8(_0xf29a0d[_0x6a87('0x19')]['message']);}})['catch'](function(_0x4a9188){logger[_0x6a87('0x15')](_0x6a87('0x17'),_0x5e193e,_0x4a9188);_0xc0164f(_0x4a9188);});});}exports[_0x6a87('0x1a')]=function(_0x272653){var _0x1bdb61=this;return new Promise(function(_0x2d343a,_0x4b8719){return db[_0x6a87('0x1b')][_0x6a87('0x1c')]({'raw':_0x272653[_0x6a87('0x1d')]?_0x272653[_0x6a87('0x1d')][_0x6a87('0x1e')]===undefined?!![]:![]:!![],'where':_0x272653['options']?_0x272653[_0x6a87('0x1d')]['where']||null:null,'attributes':_0x272653[_0x6a87('0x1d')]?_0x272653[_0x6a87('0x1d')][_0x6a87('0x1f')]||null:null,'include':_0x272653[_0x6a87('0x1d')]?_0x272653[_0x6a87('0x1d')]['include']?_[_0x6a87('0x20')](_0x272653[_0x6a87('0x1d')][_0x6a87('0x21')],function(_0x44001f){return{'model':db[_0x44001f[_0x6a87('0x22')]],'as':_0x44001f['as'],'attributes':_0x44001f['attributes'],'include':_0x44001f[_0x6a87('0x21')]?_[_0x6a87('0x20')](_0x44001f[_0x6a87('0x21')],function(_0x28e06c){return{'model':db[_0x28e06c[_0x6a87('0x22')]],'as':_0x28e06c['as'],'attributes':_0x28e06c[_0x6a87('0x1f')],'include':_0x28e06c['include']?_[_0x6a87('0x20')](_0x28e06c['include'],function(_0x7b37f8){return{'model':db[_0x7b37f8[_0x6a87('0x22')]],'as':_0x7b37f8['as'],'attributes':_0x7b37f8['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x233cce){logger['info']('ShowSmsAccount',_0x272653);logger['debug'](_0x6a87('0x1a'),_0x272653,JSON['stringify'](_0x233cce));_0x2d343a(_0x233cce);})['catch'](function(_0x31dda6){logger['error'](_0x6a87('0x1a'),_0x31dda6[_0x6a87('0x18')],_0x272653);_0x4b8719(_0x1bdb61[_0x6a87('0x15')](0x1f4,_0x31dda6['message']));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 2c3abe1..f1567af 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 _0xf116=['register','length','smsAccount:','save','remove','update','removeListener'];(function(_0x19886f,_0x1019d1){var _0x4c0144=function(_0x31855b){while(--_0x31855b){_0x19886f['push'](_0x19886f['shift']());}};_0x4c0144(++_0x1019d1);}(_0xf116,0x16f));var _0x6f11=function(_0x49c699,_0x314403){_0x49c699=_0x49c699-0x0;var _0x2853ea=_0xf116[_0x49c699];return _0x2853ea;};'use strict';var SmsAccountEvents=require('./smsAccount.events');var events=[_0x6f11('0x0'),_0x6f11('0x1'),_0x6f11('0x2')];function createListener(_0x467cd2,_0x278619){return function(_0x31bce0){_0x278619['emit'](_0x467cd2,_0x31bce0);};}function removeListener(_0x2189df,_0x47642c){return function(){SmsAccountEvents[_0x6f11('0x3')](_0x2189df,_0x47642c);};}exports[_0x6f11('0x4')]=function(_0xe6f39){for(var _0x48c0e8=0x0,_0x1ece0b=events[_0x6f11('0x5')];_0x48c0e8<_0x1ece0b;_0x48c0e8++){var _0x2deb88=events[_0x48c0e8];var _0x407bdd=createListener(_0x6f11('0x6')+_0x2deb88,_0xe6f39);SmsAccountEvents['on'](_0x2deb88,_0x407bdd);}}; \ No newline at end of file +var _0x84c4=['./smsAccount.events','save','remove','update','emit','register','smsAccount:'];(function(_0x277492,_0x199fd1){var _0x4b8c46=function(_0x19f8dd){while(--_0x19f8dd){_0x277492['push'](_0x277492['shift']());}};_0x4b8c46(++_0x199fd1);}(_0x84c4,0x157));var _0x484c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x84c4[_0x3dd15e];return _0x231fd0;};'use strict';var SmsAccountEvents=require(_0x484c('0x0'));var events=[_0x484c('0x1'),_0x484c('0x2'),_0x484c('0x3')];function createListener(_0x260751,_0x12fc24){return function(_0x141d36){_0x12fc24[_0x484c('0x4')](_0x260751,_0x141d36);};}function removeListener(_0x23efd9,_0x534c7a){return function(){SmsAccountEvents['removeListener'](_0x23efd9,_0x534c7a);};}exports[_0x484c('0x5')]=function(_0x339a80){for(var _0x55a29b=0x0,_0x375ead=events['length'];_0x55a29b<_0x375ead;_0x55a29b++){var _0x1b4960=events[_0x55a29b];var _0x3d47ea=createListener(_0x484c('0x6')+_0x1b4960,_0x339a80);SmsAccountEvents['on'](_0x1b4960,_0x3d47ea);}}; \ No newline at end of file diff --git a/server/api/smsApplication/index.js b/server/api/smsApplication/index.js index ae864f3..57340c6 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 _0x6a09=['get','isAuthenticated','index','/:id','create','put','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','./smsApplication.controller'];(function(_0x65c4a,_0x26aa2b){var _0x1e3f16=function(_0x372fe7){while(--_0x372fe7){_0x65c4a['push'](_0x65c4a['shift']());}};_0x1e3f16(++_0x26aa2b);}(_0x6a09,0xf9));var _0x96a0=function(_0x1d47c3,_0x856818){_0x1d47c3=_0x1d47c3-0x0;var _0x220130=_0x6a09[_0x1d47c3];return _0x220130;};'use strict';var multer=require(_0x96a0('0x0'));var util=require(_0x96a0('0x1'));var path=require(_0x96a0('0x2'));var timeout=require(_0x96a0('0x3'));var express=require('express');var router=express[_0x96a0('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x96a0('0x5'));var config=require('../../config/environment');var controller=require(_0x96a0('0x6'));router[_0x96a0('0x7')]('/',auth[_0x96a0('0x8')](),controller[_0x96a0('0x9')]);router[_0x96a0('0x7')](_0x96a0('0xa'),auth[_0x96a0('0x8')](),controller['show']);router['post']('/',auth[_0x96a0('0x8')](),controller[_0x96a0('0xb')]);router[_0x96a0('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x96a0('0xd')]);router[_0x96a0('0xe')](_0x96a0('0xa'),auth[_0x96a0('0x8')](),controller['destroy']);module[_0x96a0('0xf')]=router; \ No newline at end of file +var _0x569c=['create','put','update','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0x569c,0x83));var _0xc569=function(_0x57afca,_0x16d16c){_0x57afca=_0x57afca-0x0;var _0x1ffc51=_0x569c[_0x57afca];return _0x1ffc51;};'use strict';var multer=require(_0xc569('0x0'));var util=require('util');var path=require(_0xc569('0x1'));var timeout=require(_0xc569('0x2'));var express=require(_0xc569('0x3'));var router=express[_0xc569('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xc569('0x5'));var config=require('../../config/environment');var controller=require(_0xc569('0x6'));router[_0xc569('0x7')]('/',auth[_0xc569('0x8')](),controller[_0xc569('0x9')]);router['get'](_0xc569('0xa'),auth['isAuthenticated'](),controller[_0xc569('0xb')]);router[_0xc569('0xc')]('/',auth['isAuthenticated'](),controller[_0xc569('0xd')]);router[_0xc569('0xe')]('/:id',auth[_0xc569('0x8')](),controller[_0xc569('0xf')]);router['delete'](_0xc569('0xa'),auth[_0xc569('0x8')](),controller[_0xc569('0x10')]);module[_0xc569('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 2ab66a0..b38ce8d 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 _0x1320=['sequelize','exports','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x1dcb3b,_0x568ad5){var _0x1763f7=function(_0x284018){while(--_0x284018){_0x1dcb3b['push'](_0x1dcb3b['shift']());}};_0x1763f7(++_0x568ad5);}(_0x1320,0x10a));var _0x0132=function(_0xfae262,_0x5210d3){_0xfae262=_0xfae262-0x0;var _0x5e4705=_0x1320[_0xfae262];return _0x5e4705;};'use strict';var Sequelize=require(_0x0132('0x0'));module[_0x0132('0x1')]={'priority':{'type':Sequelize[_0x0132('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x0132('0x3')],'allowNull':![],'defaultValue':_0x0132('0x4')},'appdata':{'type':Sequelize[_0x0132('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x0132('0x3')],'defaultValue':_0x0132('0x6')}}; \ No newline at end of file +var _0xd3d7=['TEXT','*,*,*,*','sequelize','INTEGER','STRING','noop'];(function(_0x3f265e,_0x34e3fe){var _0x3b1634=function(_0x4f27da){while(--_0x4f27da){_0x3f265e['push'](_0x3f265e['shift']());}};_0x3b1634(++_0x34e3fe);}(_0xd3d7,0x176));var _0x7d3d=function(_0x3f3288,_0x22fe57){_0x3f3288=_0x3f3288-0x0;var _0x46fe31=_0xd3d7[_0x3f3288];return _0x46fe31;};'use strict';var Sequelize=require(_0x7d3d('0x0'));module['exports']={'priority':{'type':Sequelize[_0x7d3d('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x7d3d('0x2')],'allowNull':![],'defaultValue':_0x7d3d('0x3')},'appdata':{'type':Sequelize[_0x7d3d('0x4')]()},'description':{'type':Sequelize[_0x7d3d('0x2')]},'interval':{'type':Sequelize[_0x7d3d('0x2')],'defaultValue':_0x7d3d('0x5')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index c6d839b..2bf61ff 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 _0xfb8e=['rimraf','fast-json-patch','moment','util','path','to-csv','ejs','lodash','squel','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','map','rawAttributes','type','key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','filters','pick','filter','where','VIRTUAL','field','merge','options','SmsApplication','includeAll','include','findAll','rows','catch','show','find','create','body','params','html-pdf','eml-format'];(function(_0x4d476e,_0x3fe3b0){var _0x579187=function(_0x1f9d16){while(--_0x1f9d16){_0x4d476e['push'](_0x4d476e['shift']());}};_0x579187(++_0x3fe3b0);}(_0xfb8e,0xd6));var _0xefb8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfb8e[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xefb8('0x0'));var emlformat=require(_0xefb8('0x1'));var rimraf=require(_0xefb8('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xefb8('0x3'));var rp=require('request-promise');var moment=require(_0xefb8('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xefb8('0x5'));var path=require(_0xefb8('0x6'));var sox=require('sox');var csv=require(_0xefb8('0x7'));var ejs=require(_0xefb8('0x8'));var fs=require('fs');var _=require(_0xefb8('0x9'));var squel=require(_0xefb8('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xefb8('0x7'));var querystring=require(_0xefb8('0xb'));var Papa=require('papaparse');var Redis=require(_0xefb8('0xc'));var authService=require('../../components/auth/service');var qs=require(_0xefb8('0xd'));var as=require(_0xefb8('0xe'));var hardwareService=require(_0xefb8('0xf'));var logger=require('../../config/logger')(_0xefb8('0x10'));var utils=require(_0xefb8('0x11'));var config=require(_0xefb8('0x12'));var db=require(_0xefb8('0x13'))['db'];function respondWithStatusCode(_0x4f7160,_0x4561db){_0x4561db=_0x4561db||0xcc;return function(_0x363011){if(_0x363011){return _0x4f7160['sendStatus'](_0x4561db);}return _0x4f7160[_0xefb8('0x14')](_0x4561db)[_0xefb8('0x15')]();};}function respondWithResult(_0x397a2f,_0x57e020){_0x57e020=_0x57e020||0xc8;return function(_0x48913c){if(_0x48913c){return _0x397a2f['status'](_0x57e020)[_0xefb8('0x16')](_0x48913c);}};}function respondWithFilteredResult(_0x11871e,_0x1a002f){return function(_0x57a021){if(_0x57a021){var _0x502324=_0x57a021[_0xefb8('0x17')],_0x165639=_0x1a002f[_0xefb8('0x18')],_0x67979b=_0x1a002f['offset']+_0x1a002f[_0xefb8('0x19')],_0xec54fb;if(_0x67979b>=_0x502324){_0x67979b=_0x502324;_0xec54fb=0xc8;}else{_0xec54fb=0xce;}_0x11871e[_0xefb8('0x14')](_0xec54fb);return _0x11871e[_0xefb8('0x1a')](_0xefb8('0x1b'),_0x165639+'-'+_0x67979b+'/'+_0x502324)['json'](_0x57a021);}return null;};}function patchUpdates(_0xab8ed9){return function(_0x271d5d){try{jsonpatch[_0xefb8('0x1c')](_0x271d5d,_0xab8ed9,!![]);}catch(_0x2d2b57){return BPromise[_0xefb8('0x1d')](_0x2d2b57);}return _0x271d5d[_0xefb8('0x1e')]();};}function saveUpdates(_0x51e575,_0x52ee17){return function(_0x4fe7b3){if(_0x4fe7b3){return _0x4fe7b3[_0xefb8('0x1f')](_0x51e575)['then'](function(_0x56b23e){return _0x56b23e;});}return null;};}function removeEntity(_0x6c5dc4,_0x553696){return function(_0x52b62d){if(_0x52b62d){return _0x52b62d[_0xefb8('0x20')]()[_0xefb8('0x21')](function(){_0x6c5dc4['status'](0xcc)[_0xefb8('0x15')]();});}};}function handleEntityNotFound(_0x3c649b,_0x3923b0){return function(_0x5d0322){if(!_0x5d0322){_0x3c649b[_0xefb8('0x22')](0x194);}return _0x5d0322;};}function handleError(_0x5823fd,_0x5379de){_0x5379de=_0x5379de||0x1f4;return function(_0x94ca32){logger[_0xefb8('0x23')](_0x94ca32[_0xefb8('0x24')]);if(_0x94ca32['name']){delete _0x94ca32[_0xefb8('0x25')];}_0x5823fd[_0xefb8('0x14')](_0x5379de)[_0xefb8('0x26')](_0x94ca32);};}exports['index']=function(_0x261def,_0x58768a){var _0x4afcf7={},_0x1cfde5={},_0x4619cc={'count':0x0,'rows':[]};var _0x1479bb=_[_0xefb8('0x27')](db['SmsApplication'][_0xefb8('0x28')],function(_0x1d2120){return{'name':_0x1d2120['fieldName'],'type':_0x1d2120[_0xefb8('0x29')][_0xefb8('0x2a')]};});_0x1cfde5[_0xefb8('0x2b')]=_[_0xefb8('0x27')](_0x1479bb,_0xefb8('0x25'));_0x1cfde5['query']=_[_0xefb8('0x2c')](_0x261def['query']);_0x1cfde5['filters']=_[_0xefb8('0x2d')](_0x1cfde5[_0xefb8('0x2b')],_0x1cfde5[_0xefb8('0x2e')]);_0x4afcf7[_0xefb8('0x2f')]=_[_0xefb8('0x2d')](_0x1cfde5[_0xefb8('0x2b')],qs[_0xefb8('0x30')](_0x261def['query']['fields']));_0x4afcf7[_0xefb8('0x2f')]=_0x4afcf7[_0xefb8('0x2f')][_0xefb8('0x31')]?_0x4afcf7[_0xefb8('0x2f')]:_0x1cfde5['model'];if(!_0x261def['query'][_0xefb8('0x32')](_0xefb8('0x33'))){_0x4afcf7['limit']=qs[_0xefb8('0x19')](_0x261def['query'][_0xefb8('0x19')]);_0x4afcf7['offset']=qs['offset'](_0x261def[_0xefb8('0x2e')][_0xefb8('0x18')]);}_0x4afcf7[_0xefb8('0x34')]=qs['sort'](_0x261def['query']['sort']);_0x4afcf7['where']=qs[_0xefb8('0x35')](_[_0xefb8('0x36')](_0x261def[_0xefb8('0x2e')],_0x1cfde5[_0xefb8('0x35')]));if(_0x261def[_0xefb8('0x2e')][_0xefb8('0x37')]){_0x4afcf7[_0xefb8('0x38')]=_['merge'](_0x4afcf7[_0xefb8('0x38')],{'$or':_[_0xefb8('0x27')](_0x1479bb,function(_0x16c0d6){if(_0x16c0d6[_0xefb8('0x29')]['key']!==_0xefb8('0x39')){var _0x2a19a3={};_0x2a19a3[_0x16c0d6[_0xefb8('0x3a')]]={'$like':'%'+_0x261def[_0xefb8('0x2e')][_0xefb8('0x37')]+'%'};return _0x2a19a3;}})});}_0x4afcf7=_[_0xefb8('0x3b')]({},_0x4afcf7,_0x261def[_0xefb8('0x3c')]);var _0x299b44={'where':_0x4afcf7[_0xefb8('0x38')]};return db[_0xefb8('0x3d')][_0xefb8('0x17')](_0x299b44)[_0xefb8('0x21')](function(_0xe0ca4f){_0x4619cc[_0xefb8('0x17')]=_0xe0ca4f;if(_0x261def[_0xefb8('0x2e')][_0xefb8('0x3e')]){_0x4afcf7[_0xefb8('0x3f')]=[{'all':!![]}];}return db[_0xefb8('0x3d')][_0xefb8('0x40')](_0x4afcf7);})['then'](function(_0x57781f){_0x4619cc[_0xefb8('0x41')]=_0x57781f;return _0x4619cc;})[_0xefb8('0x21')](respondWithFilteredResult(_0x58768a,_0x4afcf7))[_0xefb8('0x42')](handleError(_0x58768a,null));};exports[_0xefb8('0x43')]=function(_0x545d36,_0x5dcf30){var _0x3d191a={'raw':!![],'where':{'id':_0x545d36['params']['id']}},_0x53c72c={};_0x53c72c[_0xefb8('0x2b')]=_['keys'](db['SmsApplication'][_0xefb8('0x28')]);_0x53c72c['query']=_['keys'](_0x545d36[_0xefb8('0x2e')]);_0x53c72c['filters']=_['intersection'](_0x53c72c[_0xefb8('0x2b')],_0x53c72c[_0xefb8('0x2e')]);_0x3d191a[_0xefb8('0x2f')]=_[_0xefb8('0x2d')](_0x53c72c['model'],qs[_0xefb8('0x30')](_0x545d36[_0xefb8('0x2e')]['fields']));_0x3d191a['attributes']=_0x3d191a[_0xefb8('0x2f')]['length']?_0x3d191a[_0xefb8('0x2f')]:_0x53c72c['model'];if(_0x545d36[_0xefb8('0x2e')][_0xefb8('0x3e')]){_0x3d191a[_0xefb8('0x3f')]=[{'all':!![]}];}_0x3d191a=_[_0xefb8('0x3b')]({},_0x3d191a,_0x545d36['options']);return db[_0xefb8('0x3d')][_0xefb8('0x44')](_0x3d191a)[_0xefb8('0x21')](handleEntityNotFound(_0x5dcf30,null))[_0xefb8('0x21')](respondWithResult(_0x5dcf30,null))[_0xefb8('0x42')](handleError(_0x5dcf30,null));};exports[_0xefb8('0x45')]=function(_0xc5d0a3,_0x3975e3){return db[_0xefb8('0x3d')][_0xefb8('0x45')](_0xc5d0a3[_0xefb8('0x46')],{})[_0xefb8('0x21')](respondWithResult(_0x3975e3,0xc9))[_0xefb8('0x42')](handleError(_0x3975e3,null));};exports[_0xefb8('0x1f')]=function(_0xcd24a7,_0x25ff30){if(_0xcd24a7[_0xefb8('0x46')]['id']){delete _0xcd24a7[_0xefb8('0x46')]['id'];}return db[_0xefb8('0x3d')][_0xefb8('0x44')]({'where':{'id':_0xcd24a7[_0xefb8('0x47')]['id']}})[_0xefb8('0x21')](handleEntityNotFound(_0x25ff30,null))['then'](saveUpdates(_0xcd24a7[_0xefb8('0x46')],null))[_0xefb8('0x21')](respondWithResult(_0x25ff30,null))['catch'](handleError(_0x25ff30,null));};exports[_0xefb8('0x20')]=function(_0x3c9c80,_0x5cfcdc){return db[_0xefb8('0x3d')][_0xefb8('0x44')]({'where':{'id':_0x3c9c80[_0xefb8('0x47')]['id']}})[_0xefb8('0x21')](handleEntityNotFound(_0x5cfcdc,null))[_0xefb8('0x21')](removeEntity(_0x5cfcdc,null))[_0xefb8('0x42')](handleError(_0x5cfcdc,null));}; \ No newline at end of file +var _0xd41f=['name','send','index','map','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','pick','merge','key','VIRTUAL','field','options','SmsApplication','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','api','../../mysqldb','end','status','json','offset','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error'];(function(_0x4d45c1,_0x2beda1){var _0x244478=function(_0x11304c){while(--_0x11304c){_0x4d45c1['push'](_0x4d45c1['shift']());}};_0x244478(++_0x2beda1);}(_0xd41f,0xf1));var _0xfd41=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd41f[_0x321bb2];return _0x9c12ed;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xfd41('0x0'));var rimraf=require(_0xfd41('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfd41('0x2'));var rp=require(_0xfd41('0x3'));var moment=require(_0xfd41('0x4'));var BPromise=require(_0xfd41('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xfd41('0x6'));var csv=require('to-csv');var ejs=require(_0xfd41('0x7'));var fs=require('fs');var _=require(_0xfd41('0x8'));var squel=require(_0xfd41('0x9'));var crypto=require(_0xfd41('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xfd41('0xb'));var toCsv=require(_0xfd41('0xc'));var querystring=require(_0xfd41('0xd'));var Papa=require('papaparse');var Redis=require(_0xfd41('0xe'));var authService=require(_0xfd41('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xfd41('0x10'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xfd41('0x11'))['db'];function respondWithStatusCode(_0x2f2c5c,_0x5526b7){_0x5526b7=_0x5526b7||0xcc;return function(_0x5a02a3){if(_0x5a02a3){return _0x2f2c5c['sendStatus'](_0x5526b7);}return _0x2f2c5c['status'](_0x5526b7)[_0xfd41('0x12')]();};}function respondWithResult(_0x56f0b7,_0x516bf9){_0x516bf9=_0x516bf9||0xc8;return function(_0x1afe6d){if(_0x1afe6d){return _0x56f0b7[_0xfd41('0x13')](_0x516bf9)[_0xfd41('0x14')](_0x1afe6d);}};}function respondWithFilteredResult(_0x37c0cd,_0x2c94c8){return function(_0x2e84a9){if(_0x2e84a9){var _0x46c5c8=_0x2e84a9['count'],_0x4034bf=_0x2c94c8[_0xfd41('0x15')],_0x17a904=_0x2c94c8[_0xfd41('0x15')]+_0x2c94c8['limit'],_0x18a783;if(_0x17a904>=_0x46c5c8){_0x17a904=_0x46c5c8;_0x18a783=0xc8;}else{_0x18a783=0xce;}_0x37c0cd[_0xfd41('0x13')](_0x18a783);return _0x37c0cd[_0xfd41('0x16')](_0xfd41('0x17'),_0x4034bf+'-'+_0x17a904+'/'+_0x46c5c8)['json'](_0x2e84a9);}return null;};}function patchUpdates(_0x37b630){return function(_0x6c1f4b){try{jsonpatch[_0xfd41('0x18')](_0x6c1f4b,_0x37b630,!![]);}catch(_0x3401b4){return BPromise[_0xfd41('0x19')](_0x3401b4);}return _0x6c1f4b[_0xfd41('0x1a')]();};}function saveUpdates(_0x370d72,_0x542863){return function(_0x24a367){if(_0x24a367){return _0x24a367['update'](_0x370d72)[_0xfd41('0x1b')](function(_0x3b86a1){return _0x3b86a1;});}return null;};}function removeEntity(_0x5e7ee9,_0xd3f33e){return function(_0x281be1){if(_0x281be1){return _0x281be1[_0xfd41('0x1c')]()[_0xfd41('0x1b')](function(){_0x5e7ee9[_0xfd41('0x13')](0xcc)[_0xfd41('0x12')]();});}};}function handleEntityNotFound(_0x56f8d8,_0x10330b){return function(_0x34c078){if(!_0x34c078){_0x56f8d8[_0xfd41('0x1d')](0x194);}return _0x34c078;};}function handleError(_0x2ea394,_0x18ec63){_0x18ec63=_0x18ec63||0x1f4;return function(_0x3fe989){logger[_0xfd41('0x1e')](_0x3fe989['stack']);if(_0x3fe989['name']){delete _0x3fe989[_0xfd41('0x1f')];}_0x2ea394['status'](_0x18ec63)[_0xfd41('0x20')](_0x3fe989);};}exports[_0xfd41('0x21')]=function(_0x50bb3a,_0x494745){var _0x39da8a={},_0x1a1957={},_0x4788e7={'count':0x0,'rows':[]};var _0x4dfaaf=_[_0xfd41('0x22')](db['SmsApplication']['rawAttributes'],function(_0x35ba3c){return{'name':_0x35ba3c['fieldName'],'type':_0x35ba3c[_0xfd41('0x23')]['key']};});_0x1a1957[_0xfd41('0x24')]=_[_0xfd41('0x22')](_0x4dfaaf,'name');_0x1a1957[_0xfd41('0x25')]=_[_0xfd41('0x26')](_0x50bb3a[_0xfd41('0x25')]);_0x1a1957[_0xfd41('0x27')]=_['intersection'](_0x1a1957[_0xfd41('0x24')],_0x1a1957[_0xfd41('0x25')]);_0x39da8a['attributes']=_[_0xfd41('0x28')](_0x1a1957[_0xfd41('0x24')],qs[_0xfd41('0x29')](_0x50bb3a[_0xfd41('0x25')][_0xfd41('0x29')]));_0x39da8a['attributes']=_0x39da8a[_0xfd41('0x2a')][_0xfd41('0x2b')]?_0x39da8a['attributes']:_0x1a1957[_0xfd41('0x24')];if(!_0x50bb3a['query'][_0xfd41('0x2c')](_0xfd41('0x2d'))){_0x39da8a[_0xfd41('0x2e')]=qs['limit'](_0x50bb3a[_0xfd41('0x25')][_0xfd41('0x2e')]);_0x39da8a[_0xfd41('0x15')]=qs[_0xfd41('0x15')](_0x50bb3a[_0xfd41('0x25')][_0xfd41('0x15')]);}_0x39da8a['order']=qs[_0xfd41('0x2f')](_0x50bb3a[_0xfd41('0x25')][_0xfd41('0x2f')]);_0x39da8a[_0xfd41('0x30')]=qs[_0xfd41('0x27')](_[_0xfd41('0x31')](_0x50bb3a[_0xfd41('0x25')],_0x1a1957['filters']));if(_0x50bb3a['query']['filter']){_0x39da8a[_0xfd41('0x30')]=_[_0xfd41('0x32')](_0x39da8a['where'],{'$or':_[_0xfd41('0x22')](_0x4dfaaf,function(_0x6fd98f){if(_0x6fd98f[_0xfd41('0x23')][_0xfd41('0x33')]!==_0xfd41('0x34')){var _0x3caaf5={};_0x3caaf5[_0x6fd98f[_0xfd41('0x35')]]={'$like':'%'+_0x50bb3a[_0xfd41('0x25')]['filter']+'%'};return _0x3caaf5;}})});}_0x39da8a=_[_0xfd41('0x32')]({},_0x39da8a,_0x50bb3a[_0xfd41('0x36')]);var _0x469658={'where':_0x39da8a[_0xfd41('0x30')]};return db[_0xfd41('0x37')][_0xfd41('0x38')](_0x469658)[_0xfd41('0x1b')](function(_0x51e01b){_0x4788e7[_0xfd41('0x38')]=_0x51e01b;if(_0x50bb3a[_0xfd41('0x25')][_0xfd41('0x39')]){_0x39da8a[_0xfd41('0x3a')]=[{'all':!![]}];}return db[_0xfd41('0x37')][_0xfd41('0x3b')](_0x39da8a);})[_0xfd41('0x1b')](function(_0x14f2fe){_0x4788e7[_0xfd41('0x3c')]=_0x14f2fe;return _0x4788e7;})[_0xfd41('0x1b')](respondWithFilteredResult(_0x494745,_0x39da8a))[_0xfd41('0x3d')](handleError(_0x494745,null));};exports[_0xfd41('0x3e')]=function(_0x5f3b09,_0x21a6d2){var _0x5b71fe={'raw':!![],'where':{'id':_0x5f3b09[_0xfd41('0x3f')]['id']}},_0x14dbba={};_0x14dbba[_0xfd41('0x24')]=_['keys'](db[_0xfd41('0x37')][_0xfd41('0x40')]);_0x14dbba[_0xfd41('0x25')]=_['keys'](_0x5f3b09['query']);_0x14dbba[_0xfd41('0x27')]=_[_0xfd41('0x28')](_0x14dbba['model'],_0x14dbba[_0xfd41('0x25')]);_0x5b71fe[_0xfd41('0x2a')]=_[_0xfd41('0x28')](_0x14dbba[_0xfd41('0x24')],qs[_0xfd41('0x29')](_0x5f3b09[_0xfd41('0x25')][_0xfd41('0x29')]));_0x5b71fe[_0xfd41('0x2a')]=_0x5b71fe[_0xfd41('0x2a')][_0xfd41('0x2b')]?_0x5b71fe[_0xfd41('0x2a')]:_0x14dbba['model'];if(_0x5f3b09[_0xfd41('0x25')][_0xfd41('0x39')]){_0x5b71fe[_0xfd41('0x3a')]=[{'all':!![]}];}_0x5b71fe=_[_0xfd41('0x32')]({},_0x5b71fe,_0x5f3b09[_0xfd41('0x36')]);return db[_0xfd41('0x37')][_0xfd41('0x41')](_0x5b71fe)['then'](handleEntityNotFound(_0x21a6d2,null))[_0xfd41('0x1b')](respondWithResult(_0x21a6d2,null))[_0xfd41('0x3d')](handleError(_0x21a6d2,null));};exports[_0xfd41('0x42')]=function(_0x23ef56,_0x5a6e9a){return db[_0xfd41('0x37')]['create'](_0x23ef56[_0xfd41('0x43')],{})[_0xfd41('0x1b')](respondWithResult(_0x5a6e9a,0xc9))[_0xfd41('0x3d')](handleError(_0x5a6e9a,null));};exports['update']=function(_0x3a1113,_0x43873e){if(_0x3a1113['body']['id']){delete _0x3a1113[_0xfd41('0x43')]['id'];}return db['SmsApplication'][_0xfd41('0x41')]({'where':{'id':_0x3a1113['params']['id']}})[_0xfd41('0x1b')](handleEntityNotFound(_0x43873e,null))[_0xfd41('0x1b')](saveUpdates(_0x3a1113[_0xfd41('0x43')],null))['then'](respondWithResult(_0x43873e,null))[_0xfd41('0x3d')](handleError(_0x43873e,null));};exports[_0xfd41('0x1c')]=function(_0x3534f8,_0x4c40da){return db[_0xfd41('0x37')][_0xfd41('0x41')]({'where':{'id':_0x3534f8[_0xfd41('0x3f')]['id']}})[_0xfd41('0x1b')](handleEntityNotFound(_0x4c40da,null))[_0xfd41('0x1b')](removeEntity(_0x4c40da,null))['catch'](handleError(_0x4c40da,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index af7e735..11076f7 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 _0x54cb=['sms_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsApplication.attributes','define'];(function(_0xe7b812,_0xf1c61){var _0x1fcf73=function(_0x251ffa){while(--_0x251ffa){_0xe7b812['push'](_0xe7b812['shift']());}};_0x1fcf73(++_0xf1c61);}(_0x54cb,0x1ec));var _0xb54c=function(_0x46cb32,_0x4dcba3){_0x46cb32=_0x46cb32-0x0;var _0x4281aa=_0x54cb[_0x46cb32];return _0x4281aa;};'use strict';var _=require(_0xb54c('0x0'));var util=require(_0xb54c('0x1'));var logger=require(_0xb54c('0x2'))(_0xb54c('0x3'));var moment=require(_0xb54c('0x4'));var BPromise=require(_0xb54c('0x5'));var rp=require(_0xb54c('0x6'));var fs=require('fs');var path=require(_0xb54c('0x7'));var rimraf=require(_0xb54c('0x8'));var config=require(_0xb54c('0x9'));var attributes=require(_0xb54c('0xa'));module['exports']=function(_0x5a59e7,_0x540424){return _0x5a59e7[_0xb54c('0xb')]('SmsApplication',attributes,{'tableName':_0xb54c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xb54c('0xd')});}; \ No newline at end of file +var _0x4d7b=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./smsApplication.attributes','define','SmsApplication'];(function(_0xc2607f,_0x47d88f){var _0x54d08b=function(_0x4c8e9c){while(--_0x4c8e9c){_0xc2607f['push'](_0xc2607f['shift']());}};_0x54d08b(++_0x47d88f);}(_0x4d7b,0x1a1));var _0xb4d7=function(_0x39b470,_0x416a34){_0x39b470=_0x39b470-0x0;var _0x25ecdd=_0x4d7b[_0x39b470];return _0x25ecdd;};'use strict';var _=require(_0xb4d7('0x0'));var util=require(_0xb4d7('0x1'));var logger=require(_0xb4d7('0x2'))(_0xb4d7('0x3'));var moment=require('moment');var BPromise=require(_0xb4d7('0x4'));var rp=require(_0xb4d7('0x5'));var fs=require('fs');var path=require(_0xb4d7('0x6'));var rimraf=require(_0xb4d7('0x7'));var config=require(_0xb4d7('0x8'));var attributes=require(_0xb4d7('0x9'));module['exports']=function(_0xd4041b,_0x467b27){return _0xd4041b[_0xb4d7('0xa')](_0xb4d7('0xb'),attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xb4d7('0xc')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index dbf84ed..02e79a5 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 _0xdf98=['lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x5e0501,_0x43ec3f){var _0x287f2d=function(_0x1c7925){while(--_0x1c7925){_0x5e0501['push'](_0x5e0501['shift']());}};_0x287f2d(++_0x43ec3f);}(_0xdf98,0xcf));var _0x8df9=function(_0x346caa,_0x46888d){_0x346caa=_0x346caa-0x0;var _0x1f4548=_0xdf98[_0x346caa];return _0x1f4548;};'use strict';var _=require(_0x8df9('0x0'));var util=require('util');var moment=require(_0x8df9('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8df9('0x2'));var db=require(_0x8df9('0x3'))['db'];var utils=require(_0x8df9('0x4'));var logger=require(_0x8df9('0x5'))(_0x8df9('0x6'));var config=require(_0x8df9('0x7'));var jayson=require(_0x8df9('0x8'));var client=jayson[_0x8df9('0x9')][_0x8df9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5e79af,_0x1ffe3b,_0x393533){return new BPromise(function(_0x410568,_0x48bc8e){return client['request'](_0x5e79af,_0x393533)[_0x8df9('0xb')](function(_0x513b37){logger[_0x8df9('0xc')](_0x8df9('0xd'),_0x1ffe3b,_0x8df9('0xe'));logger[_0x8df9('0xf')](_0x8df9('0x10'),_0x1ffe3b,_0x8df9('0xe'),JSON[_0x8df9('0x11')](_0x513b37));if(_0x513b37[_0x8df9('0x12')]){if(_0x513b37['error'][_0x8df9('0x13')]===0x1f4){logger[_0x8df9('0x12')](_0x8df9('0xd'),_0x1ffe3b,_0x513b37['error'][_0x8df9('0x14')]);return _0x48bc8e(_0x513b37[_0x8df9('0x12')][_0x8df9('0x14')]);}logger[_0x8df9('0x12')]('SmsApplication,\x20%s,\x20%s',_0x1ffe3b,_0x513b37['error'][_0x8df9('0x14')]);return _0x410568(_0x513b37[_0x8df9('0x12')][_0x8df9('0x14')]);}else{logger['info'](_0x8df9('0xd'),_0x1ffe3b,'request\x20sent');_0x410568(_0x513b37[_0x8df9('0x15')]['message']);}})[_0x8df9('0x16')](function(_0x8e547d){logger[_0x8df9('0x12')](_0x8df9('0xd'),_0x1ffe3b,_0x8e547d);_0x48bc8e(_0x8e547d);});});} \ No newline at end of file +var _0xa261=['error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2e7522,_0x5b1548){var _0x200019=function(_0x4aebdd){while(--_0x4aebdd){_0x2e7522['push'](_0x2e7522['shift']());}};_0x200019(++_0x5b1548);}(_0xa261,0x1a3));var _0x1a26=function(_0x2bf214,_0x5c275a){_0x2bf214=_0x2bf214-0x0;var _0x4b9646=_0xa261[_0x2bf214];return _0x4b9646;};'use strict';var _=require(_0x1a26('0x0'));var util=require('util');var moment=require(_0x1a26('0x1'));var BPromise=require(_0x1a26('0x2'));var rs=require(_0x1a26('0x3'));var fs=require('fs');var Redis=require(_0x1a26('0x4'));var db=require(_0x1a26('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x1a26('0x6'));var jayson=require(_0x1a26('0x7'));var client=jayson[_0x1a26('0x8')][_0x1a26('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x120837,_0x480d59,_0x2dfa27){return new BPromise(function(_0x53064d,_0x197c24){return client[_0x1a26('0xa')](_0x120837,_0x2dfa27)[_0x1a26('0xb')](function(_0x48aee0){logger[_0x1a26('0xc')](_0x1a26('0xd'),_0x480d59,_0x1a26('0xe'));logger[_0x1a26('0xf')](_0x1a26('0x10'),_0x480d59,'request\x20sent',JSON[_0x1a26('0x11')](_0x48aee0));if(_0x48aee0[_0x1a26('0x12')]){if(_0x48aee0[_0x1a26('0x12')][_0x1a26('0x13')]===0x1f4){logger[_0x1a26('0x12')](_0x1a26('0xd'),_0x480d59,_0x48aee0['error'][_0x1a26('0x14')]);return _0x197c24(_0x48aee0['error'][_0x1a26('0x14')]);}logger[_0x1a26('0x12')](_0x1a26('0xd'),_0x480d59,_0x48aee0['error'][_0x1a26('0x14')]);return _0x53064d(_0x48aee0[_0x1a26('0x12')][_0x1a26('0x14')]);}else{logger[_0x1a26('0xc')](_0x1a26('0xd'),_0x480d59,'request\x20sent');_0x53064d(_0x48aee0[_0x1a26('0x15')][_0x1a26('0x14')]);}})[_0x1a26('0x16')](function(_0x43495c){logger[_0x1a26('0x12')](_0x1a26('0xd'),_0x480d59,_0x43495c);_0x197c24(_0x43495c);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index f10881e..6a87a44 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 _0x720f=['/:id/tags','tracked','smsinteraction:addtags','put','/:id','smsinteraction:update','update','sms','smsinteraction:destroy','destroy','removeTags','multer','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','describe','show','/:id/messages','create','addMessage','post'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x720f,0x185));var _0xf720=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0x720f[_0x433a86];return _0x23000c;};'use strict';var multer=require(_0xf720('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf720('0x1'));var router=express[_0xf720('0x2')]();var auth=require(_0xf720('0x3'));var interaction=require(_0xf720('0x4'));var config=require(_0xf720('0x5'));var controller=require(_0xf720('0x6'));router[_0xf720('0x7')]('/',auth[_0xf720('0x8')](),controller[_0xf720('0x9')]);router[_0xf720('0x7')]('/describe',auth[_0xf720('0x8')](),controller[_0xf720('0xa')]);router['get']('/:id',auth[_0xf720('0x8')](),controller[_0xf720('0xb')]);router['get'](_0xf720('0xc'),auth[_0xf720('0x8')](),controller['getMessages']);router[_0xf720('0x7')]('/:id/download',auth['isAuthenticated'](),controller['download']);router['post']('/',auth[_0xf720('0x8')](),controller[_0xf720('0xd')]);router['post'](_0xf720('0xc'),auth[_0xf720('0x8')](),controller[_0xf720('0xe')]);router[_0xf720('0xf')](_0xf720('0x10'),auth[_0xf720('0x8')](),interaction[_0xf720('0x11')]('sms',_0xf720('0x12')),controller['addTags']);router[_0xf720('0x13')](_0xf720('0x14'),auth[_0xf720('0x8')](),interaction['tracked']('sms',_0xf720('0x15')),controller[_0xf720('0x16')]);router['delete'](_0xf720('0x14'),auth[_0xf720('0x8')](),interaction[_0xf720('0x11')](_0xf720('0x17'),_0xf720('0x18')),controller[_0xf720('0x19')]);router['delete'](_0xf720('0x10'),auth[_0xf720('0x8')](),controller[_0xf720('0x1a')]);module['exports']=router; \ No newline at end of file +var _0x173d=['create','addMessage','/:id/tags','sms','addTags','put','tracked','smsinteraction:update','smsinteraction:destroy','destroy','delete','exports','util','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','index','/describe','describe','/:id','/:id/messages','getMessages','isAuthenticated','download','post'];(function(_0x10b5c3,_0x812497){var _0xb47e04=function(_0x172303){while(--_0x172303){_0x10b5c3['push'](_0x10b5c3['shift']());}};_0xb47e04(++_0x812497);}(_0x173d,0x108));var _0xd173=function(_0x5808ac,_0x42580b){_0x5808ac=_0x5808ac-0x0;var _0x527762=_0x173d[_0x5808ac];return _0x527762;};'use strict';var multer=require('multer');var util=require(_0xd173('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd173('0x1'));var router=express['Router']();var auth=require(_0xd173('0x2'));var interaction=require(_0xd173('0x3'));var config=require(_0xd173('0x4'));var controller=require(_0xd173('0x5'));router[_0xd173('0x6')]('/',auth['isAuthenticated'](),controller[_0xd173('0x7')]);router[_0xd173('0x6')](_0xd173('0x8'),auth['isAuthenticated'](),controller[_0xd173('0x9')]);router['get'](_0xd173('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xd173('0x6')](_0xd173('0xb'),auth['isAuthenticated'](),controller[_0xd173('0xc')]);router[_0xd173('0x6')]('/:id/download',auth[_0xd173('0xd')](),controller[_0xd173('0xe')]);router[_0xd173('0xf')]('/',auth[_0xd173('0xd')](),controller[_0xd173('0x10')]);router[_0xd173('0xf')](_0xd173('0xb'),auth[_0xd173('0xd')](),controller[_0xd173('0x11')]);router[_0xd173('0xf')](_0xd173('0x12'),auth[_0xd173('0xd')](),interaction['tracked'](_0xd173('0x13'),'smsinteraction:addtags'),controller[_0xd173('0x14')]);router[_0xd173('0x15')]('/:id',auth[_0xd173('0xd')](),interaction[_0xd173('0x16')](_0xd173('0x13'),_0xd173('0x17')),controller['update']);router['delete'](_0xd173('0xa'),auth[_0xd173('0xd')](),interaction[_0xd173('0x16')]('sms',_0xd173('0x18')),controller[_0xd173('0x19')]);router[_0xd173('0x1a')](_0xd173('0x12'),auth['isAuthenticated'](),controller['removeTags']);module[_0xd173('0x1b')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 015d563..f91bdb7 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 _0xe706=['ENUM','out','sequelize','moment','exports','DATE','STRING'];(function(_0x561199,_0x1740e6){var _0x31c139=function(_0x3917fd){while(--_0x3917fd){_0x561199['push'](_0x561199['shift']());}};_0x31c139(++_0x1740e6);}(_0xe706,0xa3));var _0x6e70=function(_0x4c3f1c,_0x30d1a5){_0x4c3f1c=_0x4c3f1c-0x0;var _0x2119b4=_0xe706[_0x4c3f1c];return _0x2119b4;};'use strict';var Sequelize=require(_0x6e70('0x0'));var moment=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x6e70('0x3')]},'disposition':{'type':Sequelize[_0x6e70('0x4')]},'note':{'type':Sequelize[_0x6e70('0x4')]},'phone':{'type':Sequelize[_0x6e70('0x4')]},'read1stAt':{'type':Sequelize[_0x6e70('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x6e70('0x5')]('in',_0x6e70('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x6e70('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x6e70('0x5')]('in',_0x6e70('0x6')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x0713=['DATE','STRING','ENUM','out','exports','BOOLEAN'];(function(_0x33080e,_0x1c600a){var _0x407395=function(_0x5b62fd){while(--_0x5b62fd){_0x33080e['push'](_0x33080e['shift']());}};_0x407395(++_0x1c600a);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x3071('0x0')]={'closed':{'type':Sequelize[_0x3071('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x3071('0x2')]},'disposition':{'type':Sequelize[_0x3071('0x3')]},'note':{'type':Sequelize[_0x3071('0x3')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x3071('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x3071('0x4')]('in',_0x3071('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x3071('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x3071('0x4')]('in',_0x3071('0x5')),'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 af23014..bbb415d 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 _0x808c=['sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','ContactId','text','Tag','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','start','filter','isNil','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','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','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','sequelize','keyBy','SmsInteraction','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','groupBy','SmsInteractionId','all','rows','catch','show','params','include','merge','options','body','destroy','describe','addMessage','SmsMessage','ids','omit','getMessages','findOne','pick','$gte','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','spread','removeTags','unix','server','files','root','attachments','transcript-%d-%s.zip','Messages','direction','secret','CmContact','Contact','lastName','Owner','get','30px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','%s\x20#%d','Sms','YYYY-MM-DD','mkdirSync','Account','fullname','N.A.','disposition','out','System','firstName','renderFile','views','downloadInteraction.html','create','transcript-','.pdf','download','log','err','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','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','end','status','json','count','limit','set','Content-Range','reject','update','then','stack','name','Users','TagIds','Tags','split','forEach','push','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','field','select','u.id','ui.SmsInteractionId','from','left_join','users','u.id\x20=\x20ui.UserId','sms_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId'];(function(_0x205beb,_0x2ca6b7){var _0x56d4a2=function(_0x4a51d3){while(--_0x4a51d3){_0x205beb['push'](_0x205beb['shift']());}};_0x56d4a2(++_0x2ca6b7);}(_0x808c,0x8c));var _0xc808=function(_0x599e60,_0x5b6519){_0x599e60=_0x599e60-0x0;var _0x468e19=_0x808c[_0x599e60];return _0x468e19;};'use strict';var pdf=require(_0xc808('0x0'));var emlformat=require(_0xc808('0x1'));var rimraf=require(_0xc808('0x2'));var zipdir=require(_0xc808('0x3'));var jsonpatch=require(_0xc808('0x4'));var rp=require(_0xc808('0x5'));var moment=require('moment');var BPromise=require(_0xc808('0x6'));var Mustache=require(_0xc808('0x7'));var util=require(_0xc808('0x8'));var path=require(_0xc808('0x9'));var sox=require(_0xc808('0xa'));var csv=require(_0xc808('0xb'));var ejs=require(_0xc808('0xc'));var fs=require('fs');var _=require(_0xc808('0xd'));var squel=require(_0xc808('0xe'));var crypto=require(_0xc808('0xf'));var jsforce=require(_0xc808('0x10'));var deskjs=require(_0xc808('0x11'));var toCsv=require(_0xc808('0xb'));var querystring=require(_0xc808('0x12'));var Papa=require(_0xc808('0x13'));var Redis=require(_0xc808('0x14'));var authService=require(_0xc808('0x15'));var qs=require(_0xc808('0x16'));var as=require(_0xc808('0x17'));var hardwareService=require(_0xc808('0x18'));var logger=require(_0xc808('0x19'))(_0xc808('0x1a'));var utils=require(_0xc808('0x1b'));var config=require('../../config/environment');var db=require(_0xc808('0x1c'))['db'];config[_0xc808('0x1d')]=_[_0xc808('0x1e')](config[_0xc808('0x1d')],{'host':_0xc808('0x1f'),'port':0x18eb});var socket=require(_0xc808('0x20'))(new Redis(config['redis']));require(_0xc808('0x21'))[_0xc808('0x22')](socket);function respondWithStatusCode(_0x378259,_0xfe3927){_0xfe3927=_0xfe3927||0xcc;return function(_0x30aaf4){if(_0x30aaf4){return _0x378259[_0xc808('0x23')](_0xfe3927);}return _0x378259['status'](_0xfe3927)[_0xc808('0x24')]();};}function respondWithResult(_0x56ad99,_0xb8f8f2){_0xb8f8f2=_0xb8f8f2||0xc8;return function(_0x18165e){if(_0x18165e){return _0x56ad99[_0xc808('0x25')](_0xb8f8f2)[_0xc808('0x26')](_0x18165e);}};}function respondWithFilteredResult(_0x18cc6d,_0x5248ab){return function(_0x17bc1c){if(_0x17bc1c){var _0x525b12=_0x17bc1c[_0xc808('0x27')],_0x467d4f=_0x5248ab['offset'],_0xf8bb41=_0x5248ab['offset']+_0x5248ab[_0xc808('0x28')],_0x3d39b4;if(_0xf8bb41>=_0x525b12){_0xf8bb41=_0x525b12;_0x3d39b4=0xc8;}else{_0x3d39b4=0xce;}_0x18cc6d[_0xc808('0x25')](_0x3d39b4);return _0x18cc6d[_0xc808('0x29')](_0xc808('0x2a'),_0x467d4f+'-'+_0xf8bb41+'/'+_0x525b12)['json'](_0x17bc1c);}return null;};}function patchUpdates(_0x5cb377){return function(_0xde0886){try{jsonpatch['apply'](_0xde0886,_0x5cb377,!![]);}catch(_0x371393){return BPromise[_0xc808('0x2b')](_0x371393);}return _0xde0886['save']();};}function saveUpdates(_0x404a84,_0xbf3f8){return function(_0x245542){if(_0x245542){return _0x245542[_0xc808('0x2c')](_0x404a84)[_0xc808('0x2d')](function(_0x3883b7){return _0x3883b7;});}return null;};}function removeEntity(_0x34add8,_0x502f14){return function(_0x36c161){if(_0x36c161){return _0x36c161['destroy']()[_0xc808('0x2d')](function(){_0x34add8[_0xc808('0x25')](0xcc)[_0xc808('0x24')]();});}};}function handleEntityNotFound(_0x59f4bf,_0x404193){return function(_0x4f6bd3){if(!_0x4f6bd3){_0x59f4bf['sendStatus'](0x194);}return _0x4f6bd3;};}function handleError(_0x25f084,_0x57a34a){_0x57a34a=_0x57a34a||0x1f4;return function(_0x12d49e){logger['error'](_0x12d49e[_0xc808('0x2e')]);if(_0x12d49e[_0xc808('0x2f')]){delete _0x12d49e[_0xc808('0x2f')];}_0x25f084[_0xc808('0x25')](_0x57a34a)['send'](_0x12d49e);};}function getInteractionUsers(_0xb4311b,_0x4faefd){return new BPromise(function(_0x307308,_0x21eb52){try{if(_0x4faefd[_0xb4311b['id']]){_0xb4311b[_0xc808('0x30')]=_['map'](_0x4faefd[_0xb4311b['id']],function(_0x52ee7b){return{'id':_0x52ee7b['id']};});}}catch(_0x4f1d7b){_0x21eb52(_0x4f1d7b);}_0x307308(_0xb4311b);});}function getInteractionTags(_0x3a2a1f,_0x211904){return new BPromise(function(_0x234f52,_0x26bcf0){try{if(_0x3a2a1f[_0xc808('0x31')]){_0x3a2a1f[_0xc808('0x32')]=[];_0x3a2a1f['TagIds'][_0xc808('0x33')](',')[_0xc808('0x34')](function(_0x12f47c){_0x3a2a1f['Tags'][_0xc808('0x35')](_0x211904[_0x12f47c]);});}delete _0x3a2a1f[_0xc808('0x31')];}catch(_0x44b10a){_0x26bcf0(_0x44b10a);}_0x234f52(_0x3a2a1f);});}function updateSmsInteraction(_0x89dc36,_0x3f6788,_0x25a2ab){return new BPromise(function(_0x5b301e,_0x2e9c6e){return getInteractionUsers(_0x89dc36,_0x25a2ab)['then'](function(_0x26eb73){return getInteractionTags(_0x26eb73,_0x3f6788);})[_0xc808('0x2d')](function(_0x43bef7){_0x5b301e(_0x43bef7);})['catch'](function(_0x22122a){_0x2e9c6e(_0x22122a);});});}exports[_0xc808('0x36')]=function(_0x53651a,_0x516efd){var _0x519f23={},_0x3c70a3={},_0x54b710={'count':0x0,'rows':[]};var _0x5ca54b=_[_0xc808('0x37')](db['SmsInteraction'][_0xc808('0x38')],function(_0x4bf026){return{'name':_0x4bf026[_0xc808('0x39')],'type':_0x4bf026[_0xc808('0x3a')][_0xc808('0x3b')]};});_0x3c70a3[_0xc808('0x3c')]=_[_0xc808('0x37')](_0x5ca54b,_0xc808('0x2f'));_0x3c70a3[_0xc808('0x3d')]=_[_0xc808('0x3e')](_0x53651a['query']);_0x3c70a3[_0xc808('0x3f')]=_['intersection'](_0x3c70a3['model'],_0x3c70a3['query']);_0x519f23[_0xc808('0x40')]=_[_0xc808('0x41')](_0x3c70a3[_0xc808('0x3c')],qs[_0xc808('0x42')](_0x53651a[_0xc808('0x3d')][_0xc808('0x42')]));_0x519f23[_0xc808('0x40')]=_0x519f23[_0xc808('0x40')][_0xc808('0x43')]?_0x519f23[_0xc808('0x40')]:_0x3c70a3[_0xc808('0x3c')];if(!_0x53651a[_0xc808('0x3d')][_0xc808('0x44')](_0xc808('0x45'))){_0x519f23[_0xc808('0x28')]=qs[_0xc808('0x28')](_0x53651a[_0xc808('0x3d')]['limit']);_0x519f23['offset']=qs[_0xc808('0x46')](_0x53651a[_0xc808('0x3d')][_0xc808('0x46')]);}_0x519f23[_0xc808('0x47')]=qs[_0xc808('0x48')](_0x53651a[_0xc808('0x3d')][_0xc808('0x48')]);_0x519f23[_0xc808('0x49')]=qs['filters'](_['pick'](_0x53651a[_0xc808('0x3d')],_0x3c70a3[_0xc808('0x3f')]));var _0x25d36b=[];var _0x45aac0=squel['select']()[_0xc808('0x4a')]('id')['field'](_0xc808('0x2f'))['field']('color')['from']('tools_tags');var _0x1e397a=squel[_0xc808('0x4b')]()[_0xc808('0x4a')](_0xc808('0x4c'))[_0xc808('0x4a')](_0xc808('0x4d'))[_0xc808('0x4e')]('user_has_sms_interactions','ui')[_0xc808('0x4f')](_0xc808('0x50'),'u',_0xc808('0x51'));var _0x246e8d=squel[_0xc808('0x4b')]()['from'](_0xc808('0x52'),'i')[_0xc808('0x4f')]('cm_contacts','c',_0xc808('0x53'))[_0xc808('0x4f')]('users','o',_0xc808('0x54'))[_0xc808('0x4f')](_0xc808('0x55'),'a',_0xc808('0x56'))[_0xc808('0x4f')](_0xc808('0x57'),'me',_0xc808('0x58'))[_0xc808('0x4f')](_0xc808('0x59'),'it',_0xc808('0x5a'))[_0xc808('0x4f')](_0xc808('0x5b'),'t',_0xc808('0x5c'));var _0x411175=squel[_0xc808('0x5d')]();var _0x5efe93=[];var _0x45f466=squel[_0xc808('0x5d')]();if(_0x53651a[_0xc808('0x3d')]['search']){var _0xdf1602=as['parseSearch'](_0x53651a[_0xc808('0x3d')][_0xc808('0x5e')]);var _0x538cae=_0xdf1602['sqlOperator'];for(var _0x5e4e0c=0x0;_0x5e4e0c<_0xdf1602[_0xc808('0x5f')][_0xc808('0x43')];_0x5e4e0c++){var _0x4e689e=_0xdf1602[_0xc808('0x5f')][_0x5e4e0c];var _0x2627d8='i';var _0x34f5a2=_[_0xc808('0x60')](_0x5ca54b,[_0xc808('0x2f'),_0x4e689e[_0xc808('0x4a')]]);if(!_0x34f5a2){switch(_0x4e689e[_0xc808('0x4a')]){case _0xc808('0x61'):if(_0x4e689e[_0xc808('0x62')]==0x1){_0x246e8d[_0xc808('0x63')]('`'+_0x4e689e[_0xc808('0x4a')]+_0xc808('0x64'));}else{_0x246e8d[_0xc808('0x63')]('`'+_0x4e689e[_0xc808('0x4a')]+_0xc808('0x65'));}break;case'Contact':if(_0x4e689e[_0xc808('0x66')]==='$substring'){_0x411175[_0x538cae](_0xc808('0x67'),_0x4e689e[_0xc808('0x62')],null);}else{_0x34f5a2=_[_0xc808('0x60')](_0x5ca54b,[_0xc808('0x2f'),_0xc808('0x68')]);_0x4e689e[_0xc808('0x4a')]=_0xc808('0x68');_0x48b8c0=as['buildExpression'](_0x2627d8,_0x34f5a2[_0xc808('0x3a')],_0x4e689e);_0x411175[_0x538cae](_0x48b8c0[_0xc808('0x69')],_0x48b8c0[_0xc808('0x62')]['start'],_0x48b8c0[_0xc808('0x62')][_0xc808('0x24')]);}break;case _0xc808('0x6a'):var _0x660f32=_0x4e689e[_0xc808('0x62')][_0xc808('0x33')](',')[_0xc808('0x37')](function(_0x32881c){return Number(_0x32881c);});_0x660f32['forEach'](function(_0x4f3fa6){_0x45f466['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x4f3fa6+',%');});_0x5efe93=_[_0xc808('0x6b')](_0x5efe93,_0x660f32);break;case _0xc808('0x6c'):if(_0x4e689e[_0xc808('0x66')]===_0xc808('0x6d')){_0x411175[_0x538cae](_0xc808('0x6e'),'%'+_0x4e689e[_0xc808('0x62')]+'%',null);}else{_0x34f5a2=_[_0xc808('0x60')](_0x5ca54b,['name',_0xc808('0x6f')]);_0x4e689e[_0xc808('0x4a')]=_0xc808('0x6f');_0x48b8c0=as[_0xc808('0x70')](_0x2627d8,_0x34f5a2[_0xc808('0x3a')],_0x4e689e);_0x411175[_0x538cae](_0x48b8c0[_0xc808('0x69')],_0x48b8c0[_0xc808('0x62')][_0xc808('0x71')],_0x48b8c0[_0xc808('0x62')][_0xc808('0x24')]);}break;}}else{var _0x48b8c0=as[_0xc808('0x70')](_0x2627d8,_0x34f5a2[_0xc808('0x3a')],_0x4e689e);_0x411175[_0x538cae](_0x48b8c0[_0xc808('0x69')],_0x48b8c0[_0xc808('0x62')][_0xc808('0x71')],_0x48b8c0[_0xc808('0x62')]['end']);}}}else{var _0x26dc76=_(Object[_0xc808('0x3e')](_0x53651a[_0xc808('0x3d')]))[_0xc808('0x37')](function(_0x2afed0){return _0x5ca54b['hasOwnProperty'](_0x2afed0)?_0x2afed0:undefined;})[_0xc808('0x72')](function(_0x46dbfc){return!_[_0xc808('0x73')](_0x46dbfc);})[_0xc808('0x62')]();if(!_[_0xc808('0x74')](_0x26dc76)){_0x26dc76[_0xc808('0x34')](function(_0x50c4bd){if(_0x50c4bd===_0xc808('0x75')){_0x246e8d[_0xc808('0x49')](_0xc808('0x76'),[][_0xc808('0x77')](_0x53651a['query'][_0x50c4bd]));}else if(_0x50c4bd===_0xc808('0x78')){var _0xae9e21=JSON[_0xc808('0x79')](_0x53651a[_0xc808('0x3d')][_0x50c4bd])['$gte'];var _0x5ce03d=JSON['parse'](_0x53651a[_0xc808('0x3d')][_0x50c4bd])[_0xc808('0x7a')];_0x246e8d['where'](_0xc808('0x7b'),_0xae9e21,_0x5ce03d);}else{if(_0x53651a['query'][_0x50c4bd]==='null'){_0x246e8d[_0xc808('0x49')]('i.'+_0x50c4bd+_0xc808('0x7c'));}else{_0x246e8d[_0xc808('0x49')]('i.'+_0x50c4bd+_0xc808('0x7d'),_0x53651a[_0xc808('0x3d')][_0x50c4bd]);}}});}if(_0x53651a['query'][_0xc808('0x7e')]){if(_0x53651a[_0xc808('0x3d')]['read']==0x1){_0x246e8d[_0xc808('0x63')]('`unreadMessages`\x20=\x200');}else{_0x246e8d[_0xc808('0x63')](_0xc808('0x7f'));}}if(_0x53651a[_0xc808('0x3d')][_0xc808('0x80')]){_0x5efe93=_[_0xc808('0x81')](_0x53651a[_0xc808('0x3d')][_0xc808('0x80')])?_0x53651a[_0xc808('0x3d')][_0xc808('0x80')]:new Array(_0x53651a['query'][_0xc808('0x80')]);_0x5efe93[_0xc808('0x34')](function(_0x589f16){_0x45f466['or'](_0xc808('0x82'),'%,'+_0x589f16+',%');});}if(_0x53651a['query'][_0xc808('0x72')]){var _0x5ed217=_0x53651a[_0xc808('0x3d')][_0xc808('0x72')][_0xc808('0x83')]('\x5c','\x5c\x5c')['replace']('\x27\x27','\x27\x27\x27\x27');if(qs['isNumeric'](_0x5ed217)){_0x411175['or']('i.id\x20LIKE\x20?',_0x5ed217+'%')['or']('i.phone\x20LIKE\x20?',_0x5ed217+'%');}else{var _0x5b2a4f=[];_0x5ed217[_0xc808('0x33')]('\x20')[_0xc808('0x34')](function(_0x54bfd3){_0x5b2a4f['push']('+'+_0x54bfd3[_0xc808('0x84')]());});var _0x3c1013=_0x5b2a4f[_0xc808('0x85')]('\x20');_0x411175['or'](_0xc808('0x86'),_0x3c1013)['or'](_0xc808('0x87'),_0x5ed217+'%');}}}_0x246e8d['where'](_0x411175);_0x246e8d[_0xc808('0x88')](_0xc808('0x89'));var _0x4609fb={'type':db[_0xc808('0x8a')][_0xc808('0x8b')][_0xc808('0x8c')],'raw':!![]};var _0x17070b=_0x246e8d[_0xc808('0x8d')]();_0x17070b[_0xc808('0x4a')](_0xc808('0x89'));_0x17070b[_0xc808('0x4a')](_0xc808('0x8e'),_0xc808('0x61'));if(_0x519f23[_0xc808('0x47')]){_0x519f23[_0xc808('0x47')]['forEach'](function(_0x4603f0){_0x246e8d[_0xc808('0x47')]('i.'+_0x4603f0[0x0],_0x4603f0[0x1]===_0xc808('0x8f')?![]:!![]);});}if(!_[_0xc808('0x74')](_0x5efe93)){_0x246e8d['having'](_0x45f466);_0x17070b[_0xc808('0x49')](_0xc808('0x90'),_0x5efe93);}db[_0xc808('0x91')]['query'](_0x17070b[_0xc808('0x84')](),_0x4609fb)[_0xc808('0x2d')](function(_0x479cf3){_0x54b710[_0xc808('0x27')]=_0x479cf3[_0xc808('0x43')];if(_0x54b710[_0xc808('0x27')]===0x0)return[];return db[_0xc808('0x91')][_0xc808('0x3d')](_0x45aac0[_0xc808('0x84')](),_0x4609fb)[_0xc808('0x2d')](function(_0x5c52ee){_0x25d36b=_[_0xc808('0x92')](_0x5c52ee,'id');_0x4609fb=_['merge'](_0x4609fb,{'model':db[_0xc808('0x93')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x246e8d[_0xc808('0x4a')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x246e8d['field'](_0xc808('0x94'),'Account.key');_0x246e8d[_0xc808('0x4a')](_0xc808('0x95'),_0xc808('0x96'));_0x246e8d[_0xc808('0x4a')]('i.*');_0x246e8d[_0xc808('0x4a')]('c.firstName',_0xc808('0x97'));_0x246e8d['field'](_0xc808('0x98'),_0xc808('0x99'));_0x246e8d[_0xc808('0x4a')](_0xc808('0x9a'),_0xc808('0x9b'));_0x246e8d[_0xc808('0x4a')](_0xc808('0x9c'),_0xc808('0x9d'));_0x246e8d[_0xc808('0x4a')](_0xc808('0x9e'),_0xc808('0x9f'));_0x246e8d[_0xc808('0x4a')](_0xc808('0xa0'),_0xc808('0xa1'));_0x246e8d[_0xc808('0x4a')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xc808('0x31'));_0x246e8d[_0xc808('0x28')](_0x519f23['limit']);_0x246e8d['offset'](_0x519f23[_0xc808('0x46')]);return db[_0xc808('0x91')][_0xc808('0x3d')](_0x246e8d[_0xc808('0x84')](),_0x4609fb);})['then'](function(_0x185126){_0x1e397a[_0xc808('0x49')]('ui.SmsInteractionId\x20IN\x20?',_['map'](_0x185126,'id'));return db[_0xc808('0x91')][_0xc808('0x3d')](_0x1e397a[_0xc808('0x84')](),_0x4609fb)[_0xc808('0x2d')](function(_0xc51763){var _0x54605f=_[_0xc808('0xa2')](_0xc51763,_0xc808('0xa3'));var _0x3b4aed=[];_0x185126[_0xc808('0x34')](function(_0x21dd26){_0x3b4aed[_0xc808('0x35')](updateSmsInteraction(_0x21dd26,_0x25d36b,_0x54605f));});return BPromise[_0xc808('0xa4')](_0x3b4aed);});});})[_0xc808('0x2d')](function(_0x3c94aa){_0x54b710[_0xc808('0xa5')]=_0x3c94aa;return _0x54b710;})[_0xc808('0x2d')](respondWithFilteredResult(_0x516efd,_0x519f23))[_0xc808('0xa6')](handleError(_0x516efd,null));};exports[_0xc808('0xa7')]=function(_0x16b95c,_0x311b62){var _0x144bc5={'raw':![],'where':{'id':_0x16b95c[_0xc808('0xa8')]['id']}},_0x45f1de={};_0x45f1de['model']=_['keys'](db[_0xc808('0x93')][_0xc808('0x38')]);_0x45f1de[_0xc808('0x3d')]=_[_0xc808('0x3e')](_0x16b95c['query']);_0x45f1de[_0xc808('0x3f')]=_[_0xc808('0x41')](_0x45f1de[_0xc808('0x3c')],_0x45f1de[_0xc808('0x3d')]);_0x144bc5[_0xc808('0x40')]=_[_0xc808('0x41')](_0x45f1de['model'],qs[_0xc808('0x42')](_0x16b95c[_0xc808('0x3d')][_0xc808('0x42')]));_0x144bc5[_0xc808('0x40')]=_0x144bc5[_0xc808('0x40')][_0xc808('0x43')]?_0x144bc5[_0xc808('0x40')]:_0x45f1de[_0xc808('0x3c')];if(_0x16b95c[_0xc808('0x3d')]['includeAll']){_0x144bc5[_0xc808('0xa9')]=[{'all':!![]}];}_0x144bc5=_[_0xc808('0xaa')]({},_0x144bc5,_0x16b95c[_0xc808('0xab')]);return db[_0xc808('0x93')][_0xc808('0x60')](_0x144bc5)['then'](handleEntityNotFound(_0x311b62,null))['then'](respondWithResult(_0x311b62,null))[_0xc808('0xa6')](handleError(_0x311b62,null));};exports['create']=function(_0x2f4928,_0x368369){return db[_0xc808('0x93')]['create'](_0x2f4928['body'],{})[_0xc808('0x2d')](respondWithResult(_0x368369,0xc9))[_0xc808('0xa6')](handleError(_0x368369,null));};exports[_0xc808('0x2c')]=function(_0xcdc6ab,_0x18d898){if(_0xcdc6ab[_0xc808('0xac')]['id']){delete _0xcdc6ab[_0xc808('0xac')]['id'];}return db[_0xc808('0x93')][_0xc808('0x60')]({'where':{'id':_0xcdc6ab[_0xc808('0xa8')]['id']}})[_0xc808('0x2d')](handleEntityNotFound(_0x18d898,null))[_0xc808('0x2d')](saveUpdates(_0xcdc6ab[_0xc808('0xac')],null))['then'](respondWithResult(_0x18d898,null))['catch'](handleError(_0x18d898,null));};exports[_0xc808('0xad')]=function(_0x4465ad,_0xbaa2e0){return db['SmsInteraction'][_0xc808('0x60')]({'where':{'id':_0x4465ad['params']['id']}})[_0xc808('0x2d')](handleEntityNotFound(_0xbaa2e0,null))[_0xc808('0x2d')](removeEntity(_0xbaa2e0,null))[_0xc808('0xa6')](handleError(_0xbaa2e0,null));};exports[_0xc808('0xae')]=function(_0x5ba305,_0x509fa5){return db['SmsInteraction'][_0xc808('0xae')]()['then'](respondWithResult(_0x509fa5,null))[_0xc808('0xa6')](handleError(_0x509fa5,null));};exports[_0xc808('0xaf')]=function(_0x4305d7,_0x5114f1,_0x2a6193){return db[_0xc808('0xb0')][_0xc808('0x60')]({'where':{'id':_0x4305d7[_0xc808('0xa8')]['id']}})[_0xc808('0x2d')](handleEntityNotFound(_0x5114f1,null))[_0xc808('0x2d')](function(_0xaf826){if(_0xaf826){return _0xaf826['addMessage'](_0x4305d7[_0xc808('0xac')][_0xc808('0xb1')],_[_0xc808('0xb2')](_0x4305d7[_0xc808('0xac')],[_0xc808('0xb1'),'id'])||{});}})[_0xc808('0x2d')](respondWithResult(_0x5114f1,null))[_0xc808('0xa6')](handleError(_0x5114f1,null));};exports[_0xc808('0xb3')]=function(_0x419d3b,_0x4c80a9,_0x1026ee){var _0x103e8b={'raw':![],'where':{}};var _0x3bc87a={};var _0x32b9ca={'count':0x0,'rows':[]};return db['SmsInteraction'][_0xc808('0xb4')]({'where':{'id':_0x419d3b[_0xc808('0xa8')]['id']}})[_0xc808('0x2d')](handleEntityNotFound(_0x4c80a9,null))['then'](function(_0x531485){if(_0x531485){_0x3bc87a[_0xc808('0x3c')]=_['keys'](db[_0xc808('0xb0')][_0xc808('0x38')]);_0x3bc87a[_0xc808('0x3d')]=_[_0xc808('0x3e')](_0x419d3b[_0xc808('0x3d')]);_0x3bc87a['filters']=_[_0xc808('0x41')](_0x3bc87a[_0xc808('0x3c')],_0x3bc87a['query']);_0x103e8b[_0xc808('0x40')]=_['intersection'](_0x3bc87a['model'],qs[_0xc808('0x42')](_0x419d3b[_0xc808('0x3d')][_0xc808('0x42')]));_0x103e8b[_0xc808('0x40')]=_0x103e8b['attributes'][_0xc808('0x43')]?_0x103e8b[_0xc808('0x40')]:_0x3bc87a[_0xc808('0x3c')];if(!_0x419d3b[_0xc808('0x3d')][_0xc808('0x44')](_0xc808('0x45'))){_0x103e8b[_0xc808('0x28')]=qs[_0xc808('0x28')](_0x419d3b[_0xc808('0x3d')][_0xc808('0x28')]);_0x103e8b[_0xc808('0x46')]=qs['offset'](_0x419d3b[_0xc808('0x3d')][_0xc808('0x46')]);}_0x103e8b[_0xc808('0x47')]=qs[_0xc808('0x48')](_0x419d3b[_0xc808('0x3d')]['sort']);_0x103e8b[_0xc808('0x49')]=qs[_0xc808('0x3f')](_[_0xc808('0xb5')](_0x419d3b[_0xc808('0x3d')],_0x3bc87a[_0xc808('0x3f')]));_0x103e8b['where']['SmsInteractionId']=_0x531485['id'];if(_0x419d3b[_0xc808('0x3d')]['filter']){_0x103e8b['where']=_[_0xc808('0xaa')](_0x103e8b[_0xc808('0x49')],{'$or':_[_0xc808('0x37')](_0x103e8b[_0xc808('0x40')],function(_0x470627){var _0x1eec8e={};_0x1eec8e[_0x470627]={'$like':'%'+_0x419d3b['query'][_0xc808('0x72')]+'%'};return _0x1eec8e;})});}if(_0x419d3b[_0xc808('0x3d')][_0xc808('0xb6')]){var _0x4c63f0=_0x419d3b['query'][_0xc808('0xb6')][_0xc808('0x33')](',');var _0x5dfc73={};_0x5dfc73[_0x4c63f0[0x0]]={'$gte':moment(_0x4c63f0[0x1])[_0xc808('0xb7')](_0xc808('0xb8'))};_0x103e8b[_0xc808('0x49')]=_[_0xc808('0xaa')](_0x103e8b[_0xc808('0x49')],_0x5dfc73);}_0x103e8b=_[_0xc808('0xaa')]({},_0x103e8b,_0x419d3b[_0xc808('0xab')]);return db[_0xc808('0xb0')][_0xc808('0x27')]({'where':_0x103e8b[_0xc808('0x49')]})['then'](function(_0x39b62d){_0x32b9ca[_0xc808('0x27')]=_0x39b62d;if(_0x419d3b['query'][_0xc808('0xb9')]){_0x103e8b[_0xc808('0xa9')]=[{'all':!![]}];}return db[_0xc808('0xb0')][_0xc808('0xba')](_0x103e8b);})['then'](function(_0x1d98cf){_0x32b9ca[_0xc808('0xa5')]=_0x1d98cf;return _0x32b9ca;});}})[_0xc808('0x2d')](respondWithFilteredResult(_0x4c80a9,_0x103e8b))[_0xc808('0xa6')](handleError(_0x4c80a9,null));};exports['addTags']=function(_0x37c626,_0x49e791,_0x26922c){return db[_0xc808('0x93')][_0xc808('0x60')]({'where':{'id':_0x37c626['params']['id']}})[_0xc808('0x2d')](handleEntityNotFound(_0x49e791,null))['then'](function(_0x46882b){if(_0x46882b){return _0x46882b['setTags'](_0x37c626[_0xc808('0xac')][_0xc808('0xb1')],_['omit'](_0x37c626[_0xc808('0xac')],[_0xc808('0xb1'),'id'])||{})[_0xc808('0xbb')](function(){return db[_0xc808('0x6a')][_0xc808('0xba')]({'attributes':['id',_0xc808('0x2f'),'color'],'where':{'id':_0x37c626[_0xc808('0xac')][_0xc808('0xb1')]}});})[_0xc808('0x2d')](function(_0x4baa5e){socket['emit']('smsInteractionTags:save',{'id':Number(_0x37c626[_0xc808('0xa8')]['id']),'tags':_0x4baa5e||[]});return{'id':Number(_0x37c626[_0xc808('0xa8')]['id']),'tags':_0x4baa5e||[]};});}})[_0xc808('0x2d')](respondWithResult(_0x49e791,null))[_0xc808('0xa6')](handleError(_0x49e791,null));};exports[_0xc808('0xbc')]=function(_0x1d6678,_0x1e248e,_0x28eec5){return db['SmsInteraction'][_0xc808('0x60')]({'where':{'id':_0x1d6678[_0xc808('0xa8')]['id']}})['then'](handleEntityNotFound(_0x1e248e,null))['then'](function(_0x12b940){if(_0x12b940){return _0x12b940[_0xc808('0xbc')](_0x1d6678[_0xc808('0x3d')][_0xc808('0xb1')]);}})[_0xc808('0x2d')](respondWithStatusCode(_0x1e248e,null))[_0xc808('0xa6')](handleError(_0x1e248e,null));};exports['download']=function(_0x129abf,_0x4bfcf4){var _0x3bb5c7=moment()[_0xc808('0xbd')]()[_0xc808('0x84')]();var _0xf26fed=path[_0xc808('0x85')](config['root'],_0xc808('0xbe'),_0xc808('0xbf'),'tmp');var _0x420e6a=path[_0xc808('0x85')](config[_0xc808('0xc0')],_0xc808('0xbe'),_0xc808('0xbf'),_0xc808('0xc1'));var _0x375742=path[_0xc808('0x85')](_0xf26fed,_0x3bb5c7);var _0x5c11fe=util[_0xc808('0xb7')](_0xc808('0xc2'),_0x129abf[_0xc808('0xa8')]['id'],_0x3bb5c7);var _0x2952f1=path[_0xc808('0x85')](_0xf26fed,_0x5c11fe);var _0x70365d=![];return db[_0xc808('0x93')][_0xc808('0x60')]({'where':{'id':_0x129abf[_0xc808('0xa8')]['id']},'include':[{'model':db['SmsMessage'],'as':_0xc808('0xc3'),'attributes':['id',_0xc808('0xac'),_0xc808('0x78'),_0xc808('0xc4'),_0xc808('0xc5'),'read'],'include':[{'model':db[_0xc808('0x6c')],'as':_0xc808('0x6c'),'attributes':['id','fullname'],'raw':!![]},{'model':db[_0xc808('0xc6')],'as':_0xc808('0xc7'),'attributes':['id','firstName',_0xc808('0xc8')],'raw':!![]}]},{'model':db['SmsAccount'],'as':'Account','attributes':['id',_0xc808('0x2f')]},{'model':db['User'],'as':_0xc808('0xc9'),'attributes':['id','fullname']}]})[_0xc808('0x2d')](handleEntityNotFound(_0x4bfcf4,null))[_0xc808('0x2d')](function(_0x56eaca){if(_0x56eaca){var _0xda280b=_0x56eaca[_0xc808('0xca')]({'plain':!![]});_0x70365d=!![];var _0xeee382={'format':'A4','border':'10px','header':{'height':'40px','contents':{'first':'\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'}},'footer':{'height':_0xc808('0xcb'),'contents':{'default':util[_0xc808('0xb7')](_0xc808('0xcc'),util[_0xc808('0xb7')](_0xc808('0xcd'),_0xc808('0xce'),_0xda280b['id']),moment()['format'](_0xc808('0xcf'))[_0xc808('0x84')]())}}};fs[_0xc808('0xd0')](_0x375742);var _0x31fc7c={'channel':'Sms','account':_0xda280b[_0xc808('0xd1')][_0xc808('0x2f')],'agent':_0xda280b['Owner']?_0xda280b[_0xc808('0xc9')][_0xc808('0xd2')]:_0xc808('0xd3'),'createdAt':moment(_0xda280b['createdAt'])[_0xc808('0xb7')](_0xc808('0xb8'))[_0xc808('0x84')](),'closedAt':_0xda280b['closed']?moment(_0xda280b['closedAt'])[_0xc808('0xb7')](_0xc808('0xb8'))[_0xc808('0x84')]():'','disposition':_0xda280b[_0xc808('0xd4')],'messages':_(_0xda280b[_0xc808('0xc3')])[_0xc808('0x72')]({'secret':![]})['map'](function(_0x2c2a9a){return{'date':moment(_0x2c2a9a[_0xc808('0x78')])[_0xc808('0xb7')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x2c2a9a[_0xc808('0xc4')]===_0xc808('0xd5')?_0x2c2a9a[_0xc808('0x6c')]?_0x2c2a9a['User'][_0xc808('0xd2')]:_0xc808('0xd6'):_0x2c2a9a[_0xc808('0xc7')][_0xc808('0xd7')]+(_0x2c2a9a[_0xc808('0xc7')][_0xc808('0xc8')]?'\x20'+_0x2c2a9a[_0xc808('0xc7')][_0xc808('0xc8')]:''),'body':_0x2c2a9a[_0xc808('0xac')],'direction':_0x2c2a9a['direction']===_0xc808('0xd5')?'A':'C','secret':_0x2c2a9a[_0xc808('0xc5')],'read':_0x2c2a9a[_0xc808('0x7e')]};})[_0xc808('0x62')]()};return ejs[_0xc808('0xd8')](path[_0xc808('0x85')](config[_0xc808('0xc0')],'server',_0xc808('0xd9'),_0xc808('0xda')),{'interaction':_0x31fc7c})[_0xc808('0x2d')](function(_0x1b8214){return new BPromise(function(_0x566109,_0x1034a3){pdf[_0xc808('0xdb')](_0x1b8214,_0xeee382)['toFile'](path['join'](_0x375742,_0xc808('0xdc')+_0xda280b['id']+'-'+_0x3bb5c7+_0xc808('0xdd')),function(_0x350a7f,_0x24ddb1){if(_0x350a7f)return _0x1034a3(_0x350a7f);_0x566109(_0x24ddb1);});});});}})['then'](function(){if(_0x70365d){return new BPromise(function(_0x178979,_0x453abd){zipdir(_0x375742,{'saveTo':_0x2952f1},function(_0x416c5c,_0x5069b2){if(_0x416c5c)return _0x453abd(_0x416c5c);return _0x178979(_0x5069b2);});})[_0xc808('0x2d')](function(){return new BPromise(function(_0x52faab,_0x57452a){rimraf(_0x375742,function(_0x56ba11){if(_0x56ba11)_0x57452a(_0x56ba11);return _0x52faab();});});})[_0xc808('0x2d')](function(){return _0x4bfcf4[_0xc808('0xde')](_0x2952f1,_0x5c11fe,function(_0x493829){if(_0x493829){console[_0xc808('0xdf')](_0xc808('0xe0'),_0x493829);}else{fs['unlinkSync'](_0x2952f1);}});});}else{return _0x4bfcf4[_0xc808('0x23')](0xc8);}})[_0xc808('0xa6')](handleError(_0x4bfcf4,null));}; \ No newline at end of file +var _0x4a40=['createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','tag','filter','replace','\x27\x27\x27\x27','isNumeric','join','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','DESC','t.id\x20IN\x20?','sequelize','count','keyBy','SmsInteraction','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','toString','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','catch','show','include','merge','create','body','params','destroy','describe','SmsMessage','omit','ids','getMessages','findOne','YYYY-MM-DD\x20HH:mm:ss','options','includeAll','findAll','rows','setTags','emit','smsInteractionTags:save','download','root','server','files','tmp','attachments','format','transcript-%d-%s.zip','Messages','secret','CmContact','firstName','lastName','SmsAccount','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','30px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','%s\x20#%d','Sms','YYYY-MM-DD','mkdirSync','closed','closedAt','direction','out','System','renderFile','views','downloadInteraction.html','toFile','transcript-','.pdf','err','unlinkSync','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','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','defaults','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','end','json','offset','limit','set','apply','reject','save','update','then','error','stack','name','send','Users','map','TagIds','Tags','forEach','push','index','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','select','field','color','from','u.id','ui.SmsInteractionId','user_has_sms_interactions','users','sms_interactions','left_join','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','find','unreadMessages','having','`\x20=\x200','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','value','ContactId','buildExpression','type','Tag','split','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','text','start','some','isEmpty','SmsAccountId'];(function(_0x417a1e,_0x31cbf3){var _0x3e0f56=function(_0x3d3785){while(--_0x3d3785){_0x417a1e['push'](_0x417a1e['shift']());}};_0x3e0f56(++_0x31cbf3);}(_0x4a40,0x14a));var _0x04a4=function(_0x69ede,_0x3f8e97){_0x69ede=_0x69ede-0x0;var _0x13e7e1=_0x4a40[_0x69ede];return _0x13e7e1;};'use strict';var pdf=require(_0x04a4('0x0'));var emlformat=require(_0x04a4('0x1'));var rimraf=require(_0x04a4('0x2'));var zipdir=require(_0x04a4('0x3'));var jsonpatch=require(_0x04a4('0x4'));var rp=require(_0x04a4('0x5'));var moment=require(_0x04a4('0x6'));var BPromise=require(_0x04a4('0x7'));var Mustache=require(_0x04a4('0x8'));var util=require(_0x04a4('0x9'));var path=require(_0x04a4('0xa'));var sox=require(_0x04a4('0xb'));var csv=require(_0x04a4('0xc'));var ejs=require(_0x04a4('0xd'));var fs=require('fs');var _=require(_0x04a4('0xe'));var squel=require(_0x04a4('0xf'));var crypto=require(_0x04a4('0x10'));var jsforce=require(_0x04a4('0x11'));var deskjs=require('desk.js');var toCsv=require(_0x04a4('0xc'));var querystring=require('querystring');var Papa=require(_0x04a4('0x12'));var Redis=require('ioredis');var authService=require(_0x04a4('0x13'));var qs=require(_0x04a4('0x14'));var as=require(_0x04a4('0x15'));var hardwareService=require(_0x04a4('0x16'));var logger=require(_0x04a4('0x17'))(_0x04a4('0x18'));var utils=require('../../config/utils');var config=require(_0x04a4('0x19'));var db=require(_0x04a4('0x1a'))['db'];config['redis']=_[_0x04a4('0x1b')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x04a4('0x1c'))(new Redis(config['redis']));require(_0x04a4('0x1d'))[_0x04a4('0x1e')](socket);function respondWithStatusCode(_0x2bfca3,_0x106494){_0x106494=_0x106494||0xcc;return function(_0x5e52c5){if(_0x5e52c5){return _0x2bfca3[_0x04a4('0x1f')](_0x106494);}return _0x2bfca3[_0x04a4('0x20')](_0x106494)[_0x04a4('0x21')]();};}function respondWithResult(_0x18a284,_0x1831a0){_0x1831a0=_0x1831a0||0xc8;return function(_0x231ef0){if(_0x231ef0){return _0x18a284[_0x04a4('0x20')](_0x1831a0)[_0x04a4('0x22')](_0x231ef0);}};}function respondWithFilteredResult(_0x4a296e,_0x1527cf){return function(_0x5bfdde){if(_0x5bfdde){var _0x54f60e=_0x5bfdde['count'],_0x364529=_0x1527cf[_0x04a4('0x23')],_0x50096a=_0x1527cf[_0x04a4('0x23')]+_0x1527cf[_0x04a4('0x24')],_0x2e00c3;if(_0x50096a>=_0x54f60e){_0x50096a=_0x54f60e;_0x2e00c3=0xc8;}else{_0x2e00c3=0xce;}_0x4a296e[_0x04a4('0x20')](_0x2e00c3);return _0x4a296e[_0x04a4('0x25')]('Content-Range',_0x364529+'-'+_0x50096a+'/'+_0x54f60e)['json'](_0x5bfdde);}return null;};}function patchUpdates(_0x44018f){return function(_0xf1e58d){try{jsonpatch[_0x04a4('0x26')](_0xf1e58d,_0x44018f,!![]);}catch(_0x3e2f70){return BPromise[_0x04a4('0x27')](_0x3e2f70);}return _0xf1e58d[_0x04a4('0x28')]();};}function saveUpdates(_0x39da8c,_0x53b0ee){return function(_0x30b8cf){if(_0x30b8cf){return _0x30b8cf[_0x04a4('0x29')](_0x39da8c)[_0x04a4('0x2a')](function(_0x14bae7){return _0x14bae7;});}return null;};}function removeEntity(_0x5ee614,_0x2df9c6){return function(_0x14b652){if(_0x14b652){return _0x14b652['destroy']()['then'](function(){_0x5ee614[_0x04a4('0x20')](0xcc)[_0x04a4('0x21')]();});}};}function handleEntityNotFound(_0x5b1204,_0x6ce37f){return function(_0x2ad5f5){if(!_0x2ad5f5){_0x5b1204[_0x04a4('0x1f')](0x194);}return _0x2ad5f5;};}function handleError(_0x50e4af,_0x5bbe8c){_0x5bbe8c=_0x5bbe8c||0x1f4;return function(_0x439e32){logger[_0x04a4('0x2b')](_0x439e32[_0x04a4('0x2c')]);if(_0x439e32[_0x04a4('0x2d')]){delete _0x439e32[_0x04a4('0x2d')];}_0x50e4af[_0x04a4('0x20')](_0x5bbe8c)[_0x04a4('0x2e')](_0x439e32);};}function getInteractionUsers(_0x405cdf,_0x473c9d){return new BPromise(function(_0x1f4e7c,_0x33dac3){try{if(_0x473c9d[_0x405cdf['id']]){_0x405cdf[_0x04a4('0x2f')]=_[_0x04a4('0x30')](_0x473c9d[_0x405cdf['id']],function(_0x19c1d6){return{'id':_0x19c1d6['id']};});}}catch(_0x5937ca){_0x33dac3(_0x5937ca);}_0x1f4e7c(_0x405cdf);});}function getInteractionTags(_0x2554ab,_0x37f37a){return new BPromise(function(_0xf5e50c,_0x1d82f0){try{if(_0x2554ab[_0x04a4('0x31')]){_0x2554ab[_0x04a4('0x32')]=[];_0x2554ab[_0x04a4('0x31')]['split'](',')[_0x04a4('0x33')](function(_0x2b29af){_0x2554ab[_0x04a4('0x32')][_0x04a4('0x34')](_0x37f37a[_0x2b29af]);});}delete _0x2554ab[_0x04a4('0x31')];}catch(_0xca8660){_0x1d82f0(_0xca8660);}_0xf5e50c(_0x2554ab);});}function updateSmsInteraction(_0x332006,_0x2e8f18,_0x48e2ed){return new BPromise(function(_0x58048a,_0x5d6aa6){return getInteractionUsers(_0x332006,_0x48e2ed)[_0x04a4('0x2a')](function(_0x3ec172){return getInteractionTags(_0x3ec172,_0x2e8f18);})[_0x04a4('0x2a')](function(_0x42bf41){_0x58048a(_0x42bf41);})['catch'](function(_0x44d761){_0x5d6aa6(_0x44d761);});});}exports[_0x04a4('0x35')]=function(_0x10450f,_0x36bd18){var _0x4b6eba={},_0x1c9ca6={},_0x5dd3fc={'count':0x0,'rows':[]};var _0x4c01be=_[_0x04a4('0x30')](db['SmsInteraction']['rawAttributes'],function(_0x4289a0){return{'name':_0x4289a0['fieldName'],'type':_0x4289a0['type'][_0x04a4('0x36')]};});_0x1c9ca6[_0x04a4('0x37')]=_[_0x04a4('0x30')](_0x4c01be,_0x04a4('0x2d'));_0x1c9ca6[_0x04a4('0x38')]=_[_0x04a4('0x39')](_0x10450f['query']);_0x1c9ca6[_0x04a4('0x3a')]=_[_0x04a4('0x3b')](_0x1c9ca6[_0x04a4('0x37')],_0x1c9ca6[_0x04a4('0x38')]);_0x4b6eba[_0x04a4('0x3c')]=_[_0x04a4('0x3b')](_0x1c9ca6[_0x04a4('0x37')],qs[_0x04a4('0x3d')](_0x10450f[_0x04a4('0x38')][_0x04a4('0x3d')]));_0x4b6eba[_0x04a4('0x3c')]=_0x4b6eba['attributes'][_0x04a4('0x3e')]?_0x4b6eba[_0x04a4('0x3c')]:_0x1c9ca6[_0x04a4('0x37')];if(!_0x10450f[_0x04a4('0x38')][_0x04a4('0x3f')](_0x04a4('0x40'))){_0x4b6eba[_0x04a4('0x24')]=qs[_0x04a4('0x24')](_0x10450f[_0x04a4('0x38')]['limit']);_0x4b6eba[_0x04a4('0x23')]=qs[_0x04a4('0x23')](_0x10450f[_0x04a4('0x38')]['offset']);}_0x4b6eba['order']=qs[_0x04a4('0x41')](_0x10450f[_0x04a4('0x38')][_0x04a4('0x41')]);_0x4b6eba[_0x04a4('0x42')]=qs['filters'](_[_0x04a4('0x43')](_0x10450f[_0x04a4('0x38')],_0x1c9ca6[_0x04a4('0x3a')]));var _0x2ec192=[];var _0x1b8ce1=squel[_0x04a4('0x44')]()[_0x04a4('0x45')]('id')[_0x04a4('0x45')](_0x04a4('0x2d'))[_0x04a4('0x45')](_0x04a4('0x46'))[_0x04a4('0x47')]('tools_tags');var _0x40d08f=squel[_0x04a4('0x44')]()[_0x04a4('0x45')](_0x04a4('0x48'))[_0x04a4('0x45')](_0x04a4('0x49'))['from'](_0x04a4('0x4a'),'ui')['left_join'](_0x04a4('0x4b'),'u','u.id\x20=\x20ui.UserId');var _0xa5d2a6=squel['select']()['from'](_0x04a4('0x4c'),'i')[_0x04a4('0x4d')]('cm_contacts','c',_0x04a4('0x4e'))[_0x04a4('0x4d')](_0x04a4('0x4b'),'o','o.id\x20=\x20i.UserId')[_0x04a4('0x4d')](_0x04a4('0x4f'),'a',_0x04a4('0x50'))[_0x04a4('0x4d')](_0x04a4('0x51'),'me',_0x04a4('0x52'))[_0x04a4('0x4d')](_0x04a4('0x53'),'it',_0x04a4('0x54'))['left_join'](_0x04a4('0x55'),'t',_0x04a4('0x56'));var _0x511ac3=squel[_0x04a4('0x57')]();var _0x2c1dc2=[];var _0xa0c130=squel[_0x04a4('0x57')]();if(_0x10450f[_0x04a4('0x38')]['search']){var _0x53ffb6=as['parseSearch'](_0x10450f['query'][_0x04a4('0x58')]);var _0x14c101=_0x53ffb6[_0x04a4('0x59')];for(var _0x2f53d5=0x0;_0x2f53d5<_0x53ffb6[_0x04a4('0x5a')][_0x04a4('0x3e')];_0x2f53d5++){var _0x544ff5=_0x53ffb6[_0x04a4('0x5a')][_0x2f53d5];var _0x4c7cf3='i';var _0x137667=_[_0x04a4('0x5b')](_0x4c01be,['name',_0x544ff5[_0x04a4('0x45')]]);if(!_0x137667){switch(_0x544ff5[_0x04a4('0x45')]){case _0x04a4('0x5c'):if(_0x544ff5['value']==0x1){_0xa5d2a6[_0x04a4('0x5d')]('`'+_0x544ff5['field']+_0x04a4('0x5e'));}else{_0xa5d2a6['having']('`'+_0x544ff5[_0x04a4('0x45')]+'`\x20>\x200');}break;case _0x04a4('0x5f'):if(_0x544ff5['operator']===_0x04a4('0x60')){_0x511ac3[_0x14c101](_0x04a4('0x61'),_0x544ff5[_0x04a4('0x62')],null);}else{_0x137667=_[_0x04a4('0x5b')](_0x4c01be,[_0x04a4('0x2d'),_0x04a4('0x63')]);_0x544ff5[_0x04a4('0x45')]=_0x04a4('0x63');_0x4b2586=as[_0x04a4('0x64')](_0x4c7cf3,_0x137667[_0x04a4('0x65')],_0x544ff5);_0x511ac3[_0x14c101](_0x4b2586['text'],_0x4b2586['value']['start'],_0x4b2586[_0x04a4('0x62')][_0x04a4('0x21')]);}break;case _0x04a4('0x66'):var _0x1e5d6d=_0x544ff5['value'][_0x04a4('0x67')](',')['map'](function(_0x5b8be9){return Number(_0x5b8be9);});_0x1e5d6d['forEach'](function(_0x254561){_0xa0c130['or'](_0x04a4('0x68'),'%,'+_0x254561+',%');});_0x2c1dc2=_[_0x04a4('0x69')](_0x2c1dc2,_0x1e5d6d);break;case _0x04a4('0x6a'):if(_0x544ff5[_0x04a4('0x6b')]==='$substring'){_0x511ac3[_0x14c101](_0x04a4('0x6c'),'%'+_0x544ff5['value']+'%',null);}else{_0x137667=_[_0x04a4('0x5b')](_0x4c01be,[_0x04a4('0x2d'),'UserId']);_0x544ff5['field']='UserId';_0x4b2586=as[_0x04a4('0x64')](_0x4c7cf3,_0x137667[_0x04a4('0x65')],_0x544ff5);_0x511ac3[_0x14c101](_0x4b2586[_0x04a4('0x6d')],_0x4b2586[_0x04a4('0x62')][_0x04a4('0x6e')],_0x4b2586['value'][_0x04a4('0x21')]);}break;}}else{var _0x4b2586=as[_0x04a4('0x64')](_0x4c7cf3,_0x137667['type'],_0x544ff5);_0x511ac3[_0x14c101](_0x4b2586[_0x04a4('0x6d')],_0x4b2586[_0x04a4('0x62')][_0x04a4('0x6e')],_0x4b2586[_0x04a4('0x62')][_0x04a4('0x21')]);}}}else{var _0x5cc01e=_(_0x10450f[_0x04a4('0x38')])[_0x04a4('0x39')]()['map'](function(_0xeb27b6){return _[_0x04a4('0x6f')](_0x4c01be,[_0x04a4('0x2d'),_0xeb27b6])?_0xeb27b6:undefined;})['compact']()[_0x04a4('0x62')]();if(!_[_0x04a4('0x70')](_0x5cc01e)){_0x5cc01e[_0x04a4('0x33')](function(_0x564bd5){if(_0x564bd5===_0x04a4('0x71')){_0xa5d2a6[_0x04a4('0x42')]('i.SmsAccountId\x20IN\x20?',[]['concat'](_0x10450f[_0x04a4('0x38')][_0x564bd5]));}else if(_0x564bd5===_0x04a4('0x72')){var _0xa718a9=JSON[_0x04a4('0x73')](_0x10450f['query'][_0x564bd5])[_0x04a4('0x74')];var _0x3f8738=JSON['parse'](_0x10450f[_0x04a4('0x38')][_0x564bd5])[_0x04a4('0x75')];_0xa5d2a6['where'](_0x04a4('0x76'),_0xa718a9,_0x3f8738);}else{if(_0x10450f[_0x04a4('0x38')][_0x564bd5]===_0x04a4('0x77')){_0xa5d2a6[_0x04a4('0x42')]('i.'+_0x564bd5+_0x04a4('0x78'));}else{_0xa5d2a6[_0x04a4('0x42')]('i.'+_0x564bd5+'\x20=\x20?',_0x10450f['query'][_0x564bd5]);}}});}if(_0x10450f[_0x04a4('0x38')][_0x04a4('0x79')]){if(_0x10450f[_0x04a4('0x38')]['read']==0x1){_0xa5d2a6['having'](_0x04a4('0x7a'));}else{_0xa5d2a6[_0x04a4('0x5d')]('`unreadMessages`\x20>\x200');}}if(_0x10450f[_0x04a4('0x38')][_0x04a4('0x7b')]){_0x2c1dc2=_['isArray'](_0x10450f[_0x04a4('0x38')][_0x04a4('0x7b')])?_0x10450f[_0x04a4('0x38')][_0x04a4('0x7b')]:new Array(_0x10450f[_0x04a4('0x38')][_0x04a4('0x7b')]);_0x2c1dc2['forEach'](function(_0x19f533){_0xa0c130['or'](_0x04a4('0x68'),'%,'+_0x19f533+',%');});}if(_0x10450f['query'][_0x04a4('0x7c')]){var _0x4ac19f=_0x10450f[_0x04a4('0x38')]['filter']['replace']('\x5c','\x5c\x5c')[_0x04a4('0x7d')]('\x27\x27',_0x04a4('0x7e'));if(qs[_0x04a4('0x7f')](_0x4ac19f)){_0x511ac3['or']('i.id\x20LIKE\x20?',_0x4ac19f+'%')['or']('i.phone\x20LIKE\x20?',_0x4ac19f+'%');}else{var _0xa17189=[];_0x4ac19f[_0x04a4('0x67')]('\x20')[_0x04a4('0x33')](function(_0x5ac0d1){_0xa17189[_0x04a4('0x34')]('+'+_0x5ac0d1['toString']());});var _0x388d3b=_0xa17189[_0x04a4('0x80')]('\x20');_0x511ac3['or'](_0x04a4('0x81'),_0x388d3b)['or'](_0x04a4('0x82'),_0x4ac19f+'%');}}}_0xa5d2a6[_0x04a4('0x42')](_0x511ac3);_0xa5d2a6[_0x04a4('0x83')](_0x04a4('0x84'));var _0x264c0a={'type':db[_0x04a4('0x85')]['QueryTypes']['SELECT'],'raw':!![]};var _0x402c77=_0xa5d2a6[_0x04a4('0x86')]();_0x402c77[_0x04a4('0x45')](_0x04a4('0x84'));_0x402c77[_0x04a4('0x45')](_0x04a4('0x87'),_0x04a4('0x5c'));if(_0x4b6eba['order']){_0x4b6eba[_0x04a4('0x88')][_0x04a4('0x33')](function(_0x4ef483){_0xa5d2a6[_0x04a4('0x88')]('i.'+_0x4ef483[0x0],_0x4ef483[0x1]===_0x04a4('0x89')?![]:!![]);});}if(!_[_0x04a4('0x70')](_0x2c1dc2)){_0xa5d2a6[_0x04a4('0x5d')](_0xa0c130);_0x402c77['where'](_0x04a4('0x8a'),_0x2c1dc2);}db[_0x04a4('0x8b')][_0x04a4('0x38')](_0x402c77['toString'](),_0x264c0a)['then'](function(_0x3c50b6){_0x5dd3fc['count']=_0x3c50b6[_0x04a4('0x3e')];if(_0x5dd3fc[_0x04a4('0x8c')]===0x0)return[];return db['sequelize'][_0x04a4('0x38')](_0x1b8ce1['toString'](),_0x264c0a)[_0x04a4('0x2a')](function(_0x5279b3){_0x2ec192=_[_0x04a4('0x8d')](_0x5279b3,'id');_0x264c0a=_['merge'](_0x264c0a,{'model':db[_0x04a4('0x8e')],'mapToModel':!![],'raw':!![],'nest':!![]});_0xa5d2a6[_0x04a4('0x45')](_0x04a4('0x87'),_0x04a4('0x5c'));_0xa5d2a6['field'](_0x04a4('0x8f'),_0x04a4('0x90'));_0xa5d2a6['field'](_0x04a4('0x91'),_0x04a4('0x92'));_0xa5d2a6[_0x04a4('0x45')](_0x04a4('0x93'));_0xa5d2a6[_0x04a4('0x45')](_0x04a4('0x94'),'Contact.firstName');_0xa5d2a6[_0x04a4('0x45')]('c.lastName',_0x04a4('0x95'));_0xa5d2a6[_0x04a4('0x45')](_0x04a4('0x96'),_0x04a4('0x97'));_0xa5d2a6[_0x04a4('0x45')]('c.phone',_0x04a4('0x98'));_0xa5d2a6['field'](_0x04a4('0x99'),_0x04a4('0x9a'));_0xa5d2a6[_0x04a4('0x45')](_0x04a4('0x9b'),_0x04a4('0x9c'));_0xa5d2a6[_0x04a4('0x45')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x04a4('0x31'));_0xa5d2a6['limit'](_0x4b6eba['limit']);_0xa5d2a6[_0x04a4('0x23')](_0x4b6eba[_0x04a4('0x23')]);return db['sequelize'][_0x04a4('0x38')](_0xa5d2a6[_0x04a4('0x9d')](),_0x264c0a);})['then'](function(_0x337e07){_0x40d08f['where'](_0x04a4('0x9e'),_[_0x04a4('0x30')](_0x337e07,'id'));return db['sequelize']['query'](_0x40d08f[_0x04a4('0x9d')](),_0x264c0a)[_0x04a4('0x2a')](function(_0x51b6de){var _0x1d8779=_[_0x04a4('0x9f')](_0x51b6de,_0x04a4('0xa0'));var _0x5a6773=[];_0x337e07[_0x04a4('0x33')](function(_0x32ae51){_0x5a6773[_0x04a4('0x34')](updateSmsInteraction(_0x32ae51,_0x2ec192,_0x1d8779));});return BPromise['all'](_0x5a6773);});});})[_0x04a4('0x2a')](function(_0x1181aa){_0x5dd3fc['rows']=_0x1181aa;return _0x5dd3fc;})['then'](respondWithFilteredResult(_0x36bd18,_0x4b6eba))[_0x04a4('0xa1')](handleError(_0x36bd18,null));};exports[_0x04a4('0xa2')]=function(_0x413861,_0xdc3d03){var _0x5340a9={'raw':![],'where':{'id':_0x413861['params']['id']}},_0x10738c={};_0x10738c[_0x04a4('0x37')]=_['keys'](db['SmsInteraction']['rawAttributes']);_0x10738c[_0x04a4('0x38')]=_[_0x04a4('0x39')](_0x413861[_0x04a4('0x38')]);_0x10738c[_0x04a4('0x3a')]=_[_0x04a4('0x3b')](_0x10738c[_0x04a4('0x37')],_0x10738c['query']);_0x5340a9[_0x04a4('0x3c')]=_[_0x04a4('0x3b')](_0x10738c[_0x04a4('0x37')],qs[_0x04a4('0x3d')](_0x413861[_0x04a4('0x38')][_0x04a4('0x3d')]));_0x5340a9['attributes']=_0x5340a9['attributes'][_0x04a4('0x3e')]?_0x5340a9['attributes']:_0x10738c[_0x04a4('0x37')];if(_0x413861['query']['includeAll']){_0x5340a9[_0x04a4('0xa3')]=[{'all':!![]}];}_0x5340a9=_[_0x04a4('0xa4')]({},_0x5340a9,_0x413861['options']);return db[_0x04a4('0x8e')][_0x04a4('0x5b')](_0x5340a9)['then'](handleEntityNotFound(_0xdc3d03,null))[_0x04a4('0x2a')](respondWithResult(_0xdc3d03,null))['catch'](handleError(_0xdc3d03,null));};exports[_0x04a4('0xa5')]=function(_0x3a6b4c,_0x49420e){return db[_0x04a4('0x8e')]['create'](_0x3a6b4c[_0x04a4('0xa6')],{})[_0x04a4('0x2a')](respondWithResult(_0x49420e,0xc9))['catch'](handleError(_0x49420e,null));};exports[_0x04a4('0x29')]=function(_0x3220b2,_0x3a999f){if(_0x3220b2[_0x04a4('0xa6')]['id']){delete _0x3220b2['body']['id'];}return db['SmsInteraction'][_0x04a4('0x5b')]({'where':{'id':_0x3220b2[_0x04a4('0xa7')]['id']}})[_0x04a4('0x2a')](handleEntityNotFound(_0x3a999f,null))[_0x04a4('0x2a')](saveUpdates(_0x3220b2[_0x04a4('0xa6')],null))['then'](respondWithResult(_0x3a999f,null))['catch'](handleError(_0x3a999f,null));};exports[_0x04a4('0xa8')]=function(_0x2bd727,_0x12b3a7){return db['SmsInteraction'][_0x04a4('0x5b')]({'where':{'id':_0x2bd727['params']['id']}})[_0x04a4('0x2a')](handleEntityNotFound(_0x12b3a7,null))[_0x04a4('0x2a')](removeEntity(_0x12b3a7,null))[_0x04a4('0xa1')](handleError(_0x12b3a7,null));};exports[_0x04a4('0xa9')]=function(_0x1daea1,_0x24edbb){return db[_0x04a4('0x8e')][_0x04a4('0xa9')]()[_0x04a4('0x2a')](respondWithResult(_0x24edbb,null))[_0x04a4('0xa1')](handleError(_0x24edbb,null));};exports['addMessage']=function(_0x3886ab,_0x2a3e59,_0x5b2191){return db[_0x04a4('0xaa')][_0x04a4('0x5b')]({'where':{'id':_0x3886ab['params']['id']}})[_0x04a4('0x2a')](handleEntityNotFound(_0x2a3e59,null))[_0x04a4('0x2a')](function(_0x1f8a94){if(_0x1f8a94){return _0x1f8a94['addMessage'](_0x3886ab[_0x04a4('0xa6')]['ids'],_[_0x04a4('0xab')](_0x3886ab[_0x04a4('0xa6')],[_0x04a4('0xac'),'id'])||{});}})[_0x04a4('0x2a')](respondWithResult(_0x2a3e59,null))[_0x04a4('0xa1')](handleError(_0x2a3e59,null));};exports[_0x04a4('0xad')]=function(_0x1774fc,_0x1ad49b,_0x14cd88){var _0x44d45b={'raw':![],'where':{}};var _0x52da82={};var _0x58e7c9={'count':0x0,'rows':[]};return db[_0x04a4('0x8e')][_0x04a4('0xae')]({'where':{'id':_0x1774fc[_0x04a4('0xa7')]['id']}})[_0x04a4('0x2a')](handleEntityNotFound(_0x1ad49b,null))['then'](function(_0x4c5a0b){if(_0x4c5a0b){_0x52da82[_0x04a4('0x37')]=_[_0x04a4('0x39')](db[_0x04a4('0xaa')]['rawAttributes']);_0x52da82['query']=_[_0x04a4('0x39')](_0x1774fc[_0x04a4('0x38')]);_0x52da82[_0x04a4('0x3a')]=_[_0x04a4('0x3b')](_0x52da82[_0x04a4('0x37')],_0x52da82['query']);_0x44d45b[_0x04a4('0x3c')]=_[_0x04a4('0x3b')](_0x52da82['model'],qs[_0x04a4('0x3d')](_0x1774fc['query']['fields']));_0x44d45b[_0x04a4('0x3c')]=_0x44d45b[_0x04a4('0x3c')][_0x04a4('0x3e')]?_0x44d45b[_0x04a4('0x3c')]:_0x52da82['model'];if(!_0x1774fc['query']['hasOwnProperty'](_0x04a4('0x40'))){_0x44d45b[_0x04a4('0x24')]=qs[_0x04a4('0x24')](_0x1774fc[_0x04a4('0x38')][_0x04a4('0x24')]);_0x44d45b[_0x04a4('0x23')]=qs['offset'](_0x1774fc[_0x04a4('0x38')][_0x04a4('0x23')]);}_0x44d45b['order']=qs[_0x04a4('0x41')](_0x1774fc[_0x04a4('0x38')][_0x04a4('0x41')]);_0x44d45b[_0x04a4('0x42')]=qs[_0x04a4('0x3a')](_['pick'](_0x1774fc[_0x04a4('0x38')],_0x52da82[_0x04a4('0x3a')]));_0x44d45b[_0x04a4('0x42')][_0x04a4('0xa0')]=_0x4c5a0b['id'];if(_0x1774fc[_0x04a4('0x38')][_0x04a4('0x7c')]){_0x44d45b[_0x04a4('0x42')]=_[_0x04a4('0xa4')](_0x44d45b[_0x04a4('0x42')],{'$or':_[_0x04a4('0x30')](_0x44d45b[_0x04a4('0x3c')],function(_0x4ab993){var _0x220394={};_0x220394[_0x4ab993]={'$like':'%'+_0x1774fc[_0x04a4('0x38')][_0x04a4('0x7c')]+'%'};return _0x220394;})});}if(_0x1774fc['query'][_0x04a4('0x74')]){var _0x7b698=_0x1774fc['query']['$gte']['split'](',');var _0xa64097={};_0xa64097[_0x7b698[0x0]]={'$gte':moment(_0x7b698[0x1])['format'](_0x04a4('0xaf'))};_0x44d45b[_0x04a4('0x42')]=_[_0x04a4('0xa4')](_0x44d45b[_0x04a4('0x42')],_0xa64097);}_0x44d45b=_[_0x04a4('0xa4')]({},_0x44d45b,_0x1774fc[_0x04a4('0xb0')]);return db[_0x04a4('0xaa')][_0x04a4('0x8c')]({'where':_0x44d45b[_0x04a4('0x42')]})[_0x04a4('0x2a')](function(_0x55a106){_0x58e7c9[_0x04a4('0x8c')]=_0x55a106;if(_0x1774fc[_0x04a4('0x38')][_0x04a4('0xb1')]){_0x44d45b[_0x04a4('0xa3')]=[{'all':!![]}];}return db['SmsMessage'][_0x04a4('0xb2')](_0x44d45b);})[_0x04a4('0x2a')](function(_0xe4336a){_0x58e7c9[_0x04a4('0xb3')]=_0xe4336a;return _0x58e7c9;});}})['then'](respondWithFilteredResult(_0x1ad49b,_0x44d45b))[_0x04a4('0xa1')](handleError(_0x1ad49b,null));};exports['addTags']=function(_0x13a2bf,_0x3e0ca7,_0x1cce96){return db[_0x04a4('0x8e')]['find']({'where':{'id':_0x13a2bf[_0x04a4('0xa7')]['id']}})[_0x04a4('0x2a')](handleEntityNotFound(_0x3e0ca7,null))[_0x04a4('0x2a')](function(_0x54554c){if(_0x54554c){return _0x54554c[_0x04a4('0xb4')](_0x13a2bf[_0x04a4('0xa6')][_0x04a4('0xac')],_['omit'](_0x13a2bf[_0x04a4('0xa6')],[_0x04a4('0xac'),'id'])||{})['spread'](function(){return db[_0x04a4('0x66')][_0x04a4('0xb2')]({'attributes':['id',_0x04a4('0x2d'),_0x04a4('0x46')],'where':{'id':_0x13a2bf[_0x04a4('0xa6')][_0x04a4('0xac')]}});})[_0x04a4('0x2a')](function(_0x47f046){socket[_0x04a4('0xb5')](_0x04a4('0xb6'),{'id':Number(_0x13a2bf[_0x04a4('0xa7')]['id']),'tags':_0x47f046||[]});return{'id':Number(_0x13a2bf['params']['id']),'tags':_0x47f046||[]};});}})[_0x04a4('0x2a')](respondWithResult(_0x3e0ca7,null))[_0x04a4('0xa1')](handleError(_0x3e0ca7,null));};exports['removeTags']=function(_0x302a72,_0x19e681,_0x144e01){return db[_0x04a4('0x8e')][_0x04a4('0x5b')]({'where':{'id':_0x302a72['params']['id']}})[_0x04a4('0x2a')](handleEntityNotFound(_0x19e681,null))[_0x04a4('0x2a')](function(_0x2bcd91){if(_0x2bcd91){return _0x2bcd91['removeTags'](_0x302a72[_0x04a4('0x38')]['ids']);}})[_0x04a4('0x2a')](respondWithStatusCode(_0x19e681,null))[_0x04a4('0xa1')](handleError(_0x19e681,null));};exports[_0x04a4('0xb7')]=function(_0x411225,_0x285ef2){var _0x36e309=moment()['unix']()[_0x04a4('0x9d')]();var _0x2ac0a4=path[_0x04a4('0x80')](config[_0x04a4('0xb8')],_0x04a4('0xb9'),_0x04a4('0xba'),_0x04a4('0xbb'));var _0x2f37b0=path[_0x04a4('0x80')](config[_0x04a4('0xb8')],_0x04a4('0xb9'),'files',_0x04a4('0xbc'));var _0x519703=path['join'](_0x2ac0a4,_0x36e309);var _0x36354f=util[_0x04a4('0xbd')](_0x04a4('0xbe'),_0x411225[_0x04a4('0xa7')]['id'],_0x36e309);var _0x31a6fa=path[_0x04a4('0x80')](_0x2ac0a4,_0x36354f);var _0x1dea84=![];return db[_0x04a4('0x8e')][_0x04a4('0x5b')]({'where':{'id':_0x411225[_0x04a4('0xa7')]['id']},'include':[{'model':db[_0x04a4('0xaa')],'as':_0x04a4('0xbf'),'attributes':['id','body',_0x04a4('0x72'),'direction',_0x04a4('0xc0'),_0x04a4('0x79')],'include':[{'model':db[_0x04a4('0x6a')],'as':'User','attributes':['id','fullname'],'raw':!![]},{'model':db[_0x04a4('0xc1')],'as':'Contact','attributes':['id',_0x04a4('0xc2'),_0x04a4('0xc3')],'raw':!![]}]},{'model':db[_0x04a4('0xc4')],'as':'Account','attributes':['id','name']},{'model':db[_0x04a4('0x6a')],'as':_0x04a4('0xc5'),'attributes':['id',_0x04a4('0xc6')]}]})[_0x04a4('0x2a')](handleEntityNotFound(_0x285ef2,null))[_0x04a4('0x2a')](function(_0xa9e0c9){if(_0xa9e0c9){var _0x57b40d=_0xa9e0c9[_0x04a4('0xc7')]({'plain':!![]});_0x1dea84=!![];var _0x5dc407={'format':'A4','border':_0x04a4('0xc8'),'header':{'height':_0x04a4('0xc9'),'contents':{'first':_0x04a4('0xca')}},'footer':{'height':_0x04a4('0xcb'),'contents':{'default':util[_0x04a4('0xbd')](_0x04a4('0xcc'),util[_0x04a4('0xbd')](_0x04a4('0xcd'),_0x04a4('0xce'),_0x57b40d['id']),moment()['format'](_0x04a4('0xcf'))[_0x04a4('0x9d')]())}}};fs[_0x04a4('0xd0')](_0x519703);var _0x240e71={'channel':'Sms','account':_0x57b40d['Account'][_0x04a4('0x2d')],'agent':_0x57b40d['Owner']?_0x57b40d[_0x04a4('0xc5')][_0x04a4('0xc6')]:'N.A.','createdAt':moment(_0x57b40d[_0x04a4('0x72')])[_0x04a4('0xbd')](_0x04a4('0xaf'))['toString'](),'closedAt':_0x57b40d[_0x04a4('0xd1')]?moment(_0x57b40d[_0x04a4('0xd2')])[_0x04a4('0xbd')]('YYYY-MM-DD\x20HH:mm:ss')[_0x04a4('0x9d')]():'','disposition':_0x57b40d['disposition'],'messages':_(_0x57b40d[_0x04a4('0xbf')])[_0x04a4('0x7c')]({'secret':![]})[_0x04a4('0x30')](function(_0x327ab1){return{'date':moment(_0x327ab1[_0x04a4('0x72')])[_0x04a4('0xbd')](_0x04a4('0xaf'))[_0x04a4('0x9d')](),'sender':_0x327ab1[_0x04a4('0xd3')]===_0x04a4('0xd4')?_0x327ab1[_0x04a4('0x6a')]?_0x327ab1[_0x04a4('0x6a')][_0x04a4('0xc6')]:_0x04a4('0xd5'):_0x327ab1[_0x04a4('0x5f')]['firstName']+(_0x327ab1['Contact'][_0x04a4('0xc3')]?'\x20'+_0x327ab1['Contact']['lastName']:''),'body':_0x327ab1['body'],'direction':_0x327ab1[_0x04a4('0xd3')]===_0x04a4('0xd4')?'A':'C','secret':_0x327ab1[_0x04a4('0xc0')],'read':_0x327ab1[_0x04a4('0x79')]};})['value']()};return ejs[_0x04a4('0xd6')](path[_0x04a4('0x80')](config[_0x04a4('0xb8')],_0x04a4('0xb9'),_0x04a4('0xd7'),_0x04a4('0xd8')),{'interaction':_0x240e71})[_0x04a4('0x2a')](function(_0x2b49b1){return new BPromise(function(_0x1321d1,_0x1de991){pdf[_0x04a4('0xa5')](_0x2b49b1,_0x5dc407)[_0x04a4('0xd9')](path[_0x04a4('0x80')](_0x519703,_0x04a4('0xda')+_0x57b40d['id']+'-'+_0x36e309+_0x04a4('0xdb')),function(_0x3c0c45,_0x5b63e2){if(_0x3c0c45)return _0x1de991(_0x3c0c45);_0x1321d1(_0x5b63e2);});});});}})[_0x04a4('0x2a')](function(){if(_0x1dea84){return new BPromise(function(_0x1d181b,_0x490839){zipdir(_0x519703,{'saveTo':_0x31a6fa},function(_0x2eee07,_0x3f7191){if(_0x2eee07)return _0x490839(_0x2eee07);return _0x1d181b(_0x3f7191);});})[_0x04a4('0x2a')](function(){return new BPromise(function(_0x20a53e,_0x354a43){rimraf(_0x519703,function(_0x45169d){if(_0x45169d)_0x354a43(_0x45169d);return _0x20a53e();});});})[_0x04a4('0x2a')](function(){return _0x285ef2[_0x04a4('0xb7')](_0x31a6fa,_0x36354f,function(_0xb801f4){if(_0xb801f4){console['log'](_0x04a4('0xdc'),_0xb801f4);}else{fs[_0x04a4('0xdd')](_0x31a6fa);}});});}else{return _0x285ef2[_0x04a4('0x1f')](0xc8);}})['catch'](handleError(_0x285ef2,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index d224a04..ded282e 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 _0x1d78=['map','length','emit','catch','hasOwnProperty','hook','exports','events','SmsInteraction','SmsMessage','setMaxListeners','remove','getUsers','setDataValue'];(function(_0x42e79a,_0x263ca1){var _0x21bb28=function(_0x527c14){while(--_0x527c14){_0x42e79a['push'](_0x42e79a['shift']());}};_0x21bb28(++_0x263ca1);}(_0x1d78,0x85));var _0x81d7=function(_0x3e86a4,_0x5a24e0){_0x3e86a4=_0x3e86a4-0x0;var _0x200fac=_0x1d78[_0x3e86a4];return _0x200fac;};'use strict';var EventEmitter=require(_0x81d7('0x0'));var SmsInteraction=require('../../mysqldb')['db'][_0x81d7('0x1')];var SmsMessage=require('../../mysqldb')['db'][_0x81d7('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x81d7('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x81d7('0x4')};function emitEvent(_0x58a2d6){return function(_0x89d149,_0x358ad6,_0x44c651){_0x89d149[_0x81d7('0x5')]({'attributes':['id'],'raw':!![]})['then'](function(_0xadd255){_0x89d149[_0x81d7('0x6')]('Users',_0xadd255[_0x81d7('0x7')](function(_0x3ed0cc){return{'id':_0x3ed0cc['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x89d149['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x20a035){_0x89d149['setDataValue']('unreadMessages',_0x20a035[_0x81d7('0x8')]);SmsInteractionEvents[_0x81d7('0x9')](_0x58a2d6+':'+_0x89d149['id'],_0x89d149);SmsInteractionEvents[_0x81d7('0x9')](_0x58a2d6,_0x89d149);_0x44c651(null);})[_0x81d7('0xa')](_0x44c651(null));};}for(var e in events){if(events[_0x81d7('0xb')](e)){var event=events[e];SmsInteraction[_0x81d7('0xc')](e,emitEvent(event));}}module[_0x81d7('0xd')]=SmsInteractionEvents; \ No newline at end of file +var _0xe8d6=['update','remove','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb','SmsInteraction','setMaxListeners','save'];(function(_0x4551f6,_0x48151b){var _0x581dc2=function(_0x1842af){while(--_0x1842af){_0x4551f6['push'](_0x4551f6['shift']());}};_0x581dc2(++_0x48151b);}(_0xe8d6,0x163));var _0x6e8d=function(_0x37ef5b,_0x565998){_0x37ef5b=_0x37ef5b-0x0;var _0x54e521=_0xe8d6[_0x37ef5b];return _0x54e521;};'use strict';var EventEmitter=require(_0x6e8d('0x0'));var SmsInteraction=require(_0x6e8d('0x1'))['db'][_0x6e8d('0x2')];var SmsMessage=require(_0x6e8d('0x1'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x6e8d('0x3')](0x0);var events={'afterCreate':_0x6e8d('0x4'),'afterUpdate':_0x6e8d('0x5'),'afterDestroy':_0x6e8d('0x6')};function emitEvent(_0x3f94cc){return function(_0x432b94,_0x4d99fd,_0x5e3c8b){_0x432b94['getUsers']({'attributes':['id'],'raw':!![]})[_0x6e8d('0x7')](function(_0x308d09){_0x432b94[_0x6e8d('0x8')](_0x6e8d('0x9'),_0x308d09[_0x6e8d('0xa')](function(_0x588d54){return{'id':_0x588d54['id']};}));return SmsMessage[_0x6e8d('0xb')]({'where':{'SmsInteractionId':_0x432b94['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x1e1fce){_0x432b94[_0x6e8d('0x8')](_0x6e8d('0xc'),_0x1e1fce[_0x6e8d('0xd')]);SmsInteractionEvents[_0x6e8d('0xe')](_0x3f94cc+':'+_0x432b94['id'],_0x432b94);SmsInteractionEvents['emit'](_0x3f94cc,_0x432b94);_0x5e3c8b(null);})[_0x6e8d('0xf')](_0x5e3c8b(null));};}for(var e in events){if(events[_0x6e8d('0x10')](e)){var event=events[e];SmsInteraction[_0x6e8d('0x11')](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 3c60f12..29a84dd 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 _0x37bf=['changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./smsInteraction.attributes'];(function(_0x1a245e,_0x520b32){var _0x53e151=function(_0x592ba4){while(--_0x592ba4){_0x1a245e['push'](_0x1a245e['shift']());}};_0x53e151(++_0x520b32);}(_0x37bf,0xd7));var _0xf37b=function(_0x203336,_0x2b1ce0){_0x203336=_0x203336-0x0;var _0x518493=_0x37bf[_0x203336];return _0x518493;};'use strict';var _=require(_0xf37b('0x0'));var util=require(_0xf37b('0x1'));var logger=require(_0xf37b('0x2'))(_0xf37b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf37b('0x4'));var fs=require('fs');var path=require(_0xf37b('0x5'));var rimraf=require(_0xf37b('0x6'));var config=require(_0xf37b('0x7'));var attributes=require(_0xf37b('0x8'));module['exports']=function(_0x567987,_0x6df583){return _0x567987['define']('SmsInteraction',attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5f4879,_0x242387,_0x4f7c61){if(_0x5f4879[_0xf37b('0x9')](_0xf37b('0xa'))){_0x5f4879[_0xf37b('0xb')]=moment()[_0xf37b('0xc')](_0xf37b('0xd'));}_0x4f7c61(null,_0x5f4879);}}});}; \ No newline at end of file +var _0x39cd=['moment','path','rimraf','../../config/environment','exports','define','SmsInteraction','sms_interactions','closed','lodash','util','api'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x39cd,0x1b9));var _0xd39c=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0x39cd[_0x2e4e19];return _0x9ba20b;};'use strict';var _=require(_0xd39c('0x0'));var util=require(_0xd39c('0x1'));var logger=require('../../config/logger')(_0xd39c('0x2'));var moment=require(_0xd39c('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd39c('0x4'));var rimraf=require(_0xd39c('0x5'));var config=require(_0xd39c('0x6'));var attributes=require('./smsInteraction.attributes');module[_0xd39c('0x7')]=function(_0x29de2c,_0x205390){return _0x29de2c[_0xd39c('0x8')](_0xd39c('0x9'),attributes,{'tableName':_0xd39c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1046c7,_0x1b0b2b,_0x1b9950){if(_0x1046c7['changed'](_0xd39c('0xb'))){_0x1046c7['closedAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x1b9950(null,_0x1046c7);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 52eb555..e5807b2 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 _0x6cc7=['attributes','then','AddTagsToSmsInteraction','where','addTags','body','ids','omit','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','socket.io-emitter','./smsInteraction.socket','register','debug','stringify','error','code','SmsInteraction,\x20%s,\x20%s','message','info','result','catch','UpdateSmsInteraction','SmsInteraction','update','options'];(function(_0x2ecb3e,_0x8105b4){var _0x4888f5=function(_0x20d632){while(--_0x20d632){_0x2ecb3e['push'](_0x2ecb3e['shift']());}};_0x4888f5(++_0x8105b4);}(_0x6cc7,0x10c));var _0x76cc=function(_0x3de8a4,_0x289a5c){_0x3de8a4=_0x3de8a4-0x0;var _0x4635cf=_0x6cc7[_0x3de8a4];return _0x4635cf;};'use strict';var _=require(_0x76cc('0x0'));var util=require('util');var moment=require(_0x76cc('0x1'));var BPromise=require(_0x76cc('0x2'));var rs=require(_0x76cc('0x3'));var fs=require('fs');var Redis=require(_0x76cc('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x76cc('0x5'));var logger=require(_0x76cc('0x6'))(_0x76cc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x76cc('0x8')][_0x76cc('0x9')]({'port':0x232a});config[_0x76cc('0xa')]=_[_0x76cc('0xb')](config[_0x76cc('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x76cc('0xc'))(new Redis(config['redis']));require(_0x76cc('0xd'))[_0x76cc('0xe')](socket);function respondWithRpcPromise(_0x49bae8,_0x531aeb,_0x53a5a5){return new BPromise(function(_0x244f0a,_0x19a333){return client['request'](_0x49bae8,_0x53a5a5)['then'](function(_0x5901a7){logger['info']('SmsInteraction,\x20%s,\x20%s',_0x531aeb,'request\x20sent');logger[_0x76cc('0xf')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x531aeb,'request\x20sent',JSON[_0x76cc('0x10')](_0x5901a7));if(_0x5901a7[_0x76cc('0x11')]){if(_0x5901a7[_0x76cc('0x11')][_0x76cc('0x12')]===0x1f4){logger[_0x76cc('0x11')](_0x76cc('0x13'),_0x531aeb,_0x5901a7[_0x76cc('0x11')][_0x76cc('0x14')]);return _0x19a333(_0x5901a7['error'][_0x76cc('0x14')]);}logger['error'](_0x76cc('0x13'),_0x531aeb,_0x5901a7[_0x76cc('0x11')]['message']);return _0x244f0a(_0x5901a7['error'][_0x76cc('0x14')]);}else{logger[_0x76cc('0x15')](_0x76cc('0x13'),_0x531aeb,'request\x20sent');_0x244f0a(_0x5901a7[_0x76cc('0x16')]['message']);}})[_0x76cc('0x17')](function(_0x1c3428){logger[_0x76cc('0x11')](_0x76cc('0x13'),_0x531aeb,_0x1c3428);_0x19a333(_0x1c3428);});});}exports[_0x76cc('0x18')]=function(_0x5b995f){var _0x5ccc15=this;return new Promise(function(_0x238918,_0x114d42){return db[_0x76cc('0x19')][_0x76cc('0x1a')](_0x5b995f['body'],{'raw':_0x5b995f[_0x76cc('0x1b')]?_0x5b995f[_0x76cc('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5b995f[_0x76cc('0x1b')]?_0x5b995f['options']['where']||null:null,'attributes':_0x5b995f[_0x76cc('0x1b')]?_0x5b995f['options'][_0x76cc('0x1c')]||null:null,'limit':_0x5b995f['options']?_0x5b995f[_0x76cc('0x1b')]['limit']||null:null})[_0x76cc('0x1d')](function(_0x2ab9ff){logger[_0x76cc('0x15')](_0x76cc('0x18'),_0x5b995f);logger[_0x76cc('0xf')]('UpdateSmsInteraction',_0x5b995f,JSON[_0x76cc('0x10')](_0x2ab9ff));_0x238918(_0x2ab9ff);})[_0x76cc('0x17')](function(_0x10c488){logger['error'](_0x76cc('0x18'),_0x10c488[_0x76cc('0x14')],_0x5b995f);_0x114d42(_0x5ccc15[_0x76cc('0x11')](0x1f4,_0x10c488[_0x76cc('0x14')]));});});};exports[_0x76cc('0x1e')]=function(_0x9ecf44){return new Promise(function(_0x5184b5,_0xc0ac18){return db[_0x76cc('0x19')]['find']({'where':_0x9ecf44[_0x76cc('0x1b')]?_0x9ecf44[_0x76cc('0x1b')][_0x76cc('0x1f')]||null:null})['then'](function(_0x14c7d1){if(_0x14c7d1){return _0x14c7d1[_0x76cc('0x20')](_0x9ecf44[_0x76cc('0x21')][_0x76cc('0x22')],_[_0x76cc('0x23')](_0x9ecf44[_0x76cc('0x21')],[_0x76cc('0x22'),'id'])||{});}})['spread'](function(_0x3b7202){logger[_0x76cc('0x15')](_0x76cc('0x24'),_0x9ecf44);logger['debug']('AddTags',_0x9ecf44,JSON[_0x76cc('0x10')](_0x3b7202));_0x5184b5(_0x3b7202);})[_0x76cc('0x17')](function(_0x444b4d){logger[_0x76cc('0x11')](_0x76cc('0x24'),_0x444b4d['message'],_0x9ecf44);_0xc0ac18(_this[_0x76cc('0x11')](0x1f4,_0x444b4d['message']));});});}; \ No newline at end of file +var _0x531f=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','./smsInteraction.socket','request','info','request\x20sent','debug','stringify','error','code','message','SmsInteraction,\x20%s,\x20%s','result','UpdateSmsInteraction','SmsInteraction','update','body','options','where','attributes','limit','then','catch','AddTagsToSmsInteraction','find','addTags','ids','AddTags','lodash','moment','bluebird','randomstring','../../mysqldb'];(function(_0x78a7aa,_0x32c7bd){var _0x43be21=function(_0x59b8eb){while(--_0x59b8eb){_0x78a7aa['push'](_0x78a7aa['shift']());}};_0x43be21(++_0x32c7bd);}(_0x531f,0x1cf));var _0xf531=function(_0x79c6de,_0x10de94){_0x79c6de=_0x79c6de-0x0;var _0x321a56=_0x531f[_0x79c6de];return _0x321a56;};'use strict';var _=require(_0xf531('0x0'));var util=require('util');var moment=require(_0xf531('0x1'));var BPromise=require(_0xf531('0x2'));var rs=require(_0xf531('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf531('0x4'))['db'];var utils=require(_0xf531('0x5'));var logger=require(_0xf531('0x6'))('rpc');var config=require(_0xf531('0x7'));var jayson=require(_0xf531('0x8'));var client=jayson[_0xf531('0x9')][_0xf531('0xa')]({'port':0x232a});config[_0xf531('0xb')]=_['defaults'](config[_0xf531('0xb')],{'host':_0xf531('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf531('0xb')]));require(_0xf531('0xd'))['register'](socket);function respondWithRpcPromise(_0x1f7258,_0x2a8b75,_0x5cec98){return new BPromise(function(_0x19e516,_0x27093d){return client[_0xf531('0xe')](_0x1f7258,_0x5cec98)['then'](function(_0x3895fd){logger[_0xf531('0xf')]('SmsInteraction,\x20%s,\x20%s',_0x2a8b75,_0xf531('0x10'));logger[_0xf531('0x11')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x2a8b75,_0xf531('0x10'),JSON[_0xf531('0x12')](_0x3895fd));if(_0x3895fd[_0xf531('0x13')]){if(_0x3895fd['error'][_0xf531('0x14')]===0x1f4){logger[_0xf531('0x13')]('SmsInteraction,\x20%s,\x20%s',_0x2a8b75,_0x3895fd['error']['message']);return _0x27093d(_0x3895fd[_0xf531('0x13')][_0xf531('0x15')]);}logger[_0xf531('0x13')](_0xf531('0x16'),_0x2a8b75,_0x3895fd['error']['message']);return _0x19e516(_0x3895fd[_0xf531('0x13')][_0xf531('0x15')]);}else{logger[_0xf531('0xf')](_0xf531('0x16'),_0x2a8b75,_0xf531('0x10'));_0x19e516(_0x3895fd[_0xf531('0x17')][_0xf531('0x15')]);}})['catch'](function(_0x31cf3f){logger[_0xf531('0x13')]('SmsInteraction,\x20%s,\x20%s',_0x2a8b75,_0x31cf3f);_0x27093d(_0x31cf3f);});});}exports[_0xf531('0x18')]=function(_0x45b7ad){var _0x41301c=this;return new Promise(function(_0x43aa76,_0x20481d){return db[_0xf531('0x19')][_0xf531('0x1a')](_0x45b7ad[_0xf531('0x1b')],{'raw':_0x45b7ad[_0xf531('0x1c')]?_0x45b7ad[_0xf531('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x45b7ad['options']?_0x45b7ad[_0xf531('0x1c')][_0xf531('0x1d')]||null:null,'attributes':_0x45b7ad[_0xf531('0x1c')]?_0x45b7ad[_0xf531('0x1c')][_0xf531('0x1e')]||null:null,'limit':_0x45b7ad['options']?_0x45b7ad[_0xf531('0x1c')][_0xf531('0x1f')]||null:null})[_0xf531('0x20')](function(_0x49024d){logger['info'](_0xf531('0x18'),_0x45b7ad);logger['debug']('UpdateSmsInteraction',_0x45b7ad,JSON[_0xf531('0x12')](_0x49024d));_0x43aa76(_0x49024d);})[_0xf531('0x21')](function(_0x3b1def){logger[_0xf531('0x13')]('UpdateSmsInteraction',_0x3b1def[_0xf531('0x15')],_0x45b7ad);_0x20481d(_0x41301c[_0xf531('0x13')](0x1f4,_0x3b1def[_0xf531('0x15')]));});});};exports[_0xf531('0x22')]=function(_0x16ebcd){return new Promise(function(_0x2bd059,_0xa179d3){return db[_0xf531('0x19')][_0xf531('0x23')]({'where':_0x16ebcd['options']?_0x16ebcd[_0xf531('0x1c')]['where']||null:null})[_0xf531('0x20')](function(_0x229a36){if(_0x229a36){return _0x229a36[_0xf531('0x24')](_0x16ebcd[_0xf531('0x1b')][_0xf531('0x25')],_['omit'](_0x16ebcd[_0xf531('0x1b')],[_0xf531('0x25'),'id'])||{});}})['spread'](function(_0x5635bd){logger[_0xf531('0xf')](_0xf531('0x26'),_0x16ebcd);logger['debug']('AddTags',_0x16ebcd,JSON[_0xf531('0x12')](_0x5635bd));_0x2bd059(_0x5635bd);})['catch'](function(_0x45bafa){logger[_0xf531('0x13')](_0xf531('0x26'),_0x45bafa[_0xf531('0x15')],_0x16ebcd);_0xa179d3(_this[_0xf531('0x13')](0x1f4,_0x45bafa[_0xf531('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 8a3f7f3..d4c6a8f 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 _0x757a=['save','remove','emit','removeListener','register','smsInteraction:'];(function(_0x41be4d,_0x2612da){var _0x3ac9dd=function(_0x12e345){while(--_0x12e345){_0x41be4d['push'](_0x41be4d['shift']());}};_0x3ac9dd(++_0x2612da);}(_0x757a,0xde));var _0xa757=function(_0x158c93,_0x4bec38){_0x158c93=_0x158c93-0x0;var _0x1ef84d=_0x757a[_0x158c93];return _0x1ef84d;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0xa757('0x0'),_0xa757('0x1'),'update'];function createListener(_0x5c03c3,_0x5709ed){return function(_0x32be3b){_0x5709ed[_0xa757('0x2')](_0x5c03c3,_0x32be3b);};}function removeListener(_0x1c2932,_0x453d07){return function(){SmsInteractionEvents[_0xa757('0x3')](_0x1c2932,_0x453d07);};}exports[_0xa757('0x4')]=function(_0x5edca8){for(var _0xae0e7c=0x0,_0x4343b6=events['length'];_0xae0e7c<_0x4343b6;_0xae0e7c++){var _0x2930fa=events[_0xae0e7c];var _0x2f7793=createListener(_0xa757('0x5')+_0x2930fa,_0x5edca8);SmsInteractionEvents['on'](_0x2930fa,_0x2f7793);}}; \ No newline at end of file +var _0x0b0e=['smsInteraction:','./smsInteraction.events','remove','emit','removeListener','register'];(function(_0x3b4902,_0x105451){var _0x2aa7d4=function(_0xa5bd29){while(--_0xa5bd29){_0x3b4902['push'](_0x3b4902['shift']());}};_0x2aa7d4(++_0x105451);}(_0x0b0e,0x187));var _0xe0b0=function(_0xf26c2e,_0x56c3ea){_0xf26c2e=_0xf26c2e-0x0;var _0x46ecb4=_0x0b0e[_0xf26c2e];return _0x46ecb4;};'use strict';var SmsInteractionEvents=require(_0xe0b0('0x0'));var events=['save',_0xe0b0('0x1'),'update'];function createListener(_0x7e5a8a,_0xdf715e){return function(_0x3b5e2b){_0xdf715e[_0xe0b0('0x2')](_0x7e5a8a,_0x3b5e2b);};}function removeListener(_0x28040c,_0x38a058){return function(){SmsInteractionEvents[_0xe0b0('0x3')](_0x28040c,_0x38a058);};}exports[_0xe0b0('0x4')]=function(_0x30e20d){for(var _0x28e40f=0x0,_0x219b1c=events['length'];_0x28e40f<_0x219b1c;_0x28e40f++){var _0x50be7f=events[_0x28e40f];var _0x11effc=createListener(_0xe0b0('0x5')+_0x50be7f,_0x30e20d);SmsInteractionEvents['on'](_0x50be7f,_0x11effc);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 148e9d9..84e9a6e 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 _0x97d9=['../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','/describe','describe','/:id','post','tracked','sms','smsmessage:create','create','/:id/status','status','put','update','accept','/:id/reject','reject','delete','destroy','exports','util','express','Router'];(function(_0xe0d6d5,_0x1bae9e){var _0x1dea17=function(_0x1fd6e0){while(--_0x1fd6e0){_0xe0d6d5['push'](_0xe0d6d5['shift']());}};_0x1dea17(++_0x1bae9e);}(_0x97d9,0xf0));var _0x997d=function(_0x5bf4cd,_0x319e7c){_0x5bf4cd=_0x5bf4cd-0x0;var _0x440b10=_0x97d9[_0x5bf4cd];return _0x440b10;};'use strict';var multer=require('multer');var util=require(_0x997d('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x997d('0x1'));var router=express[_0x997d('0x2')]();var auth=require(_0x997d('0x3'));var interaction=require(_0x997d('0x4'));var config=require(_0x997d('0x5'));var controller=require(_0x997d('0x6'));router[_0x997d('0x7')]('/',auth[_0x997d('0x8')](),controller['index']);router[_0x997d('0x7')](_0x997d('0x9'),auth[_0x997d('0x8')](),controller[_0x997d('0xa')]);router[_0x997d('0x7')](_0x997d('0xb'),auth[_0x997d('0x8')](),controller['show']);router[_0x997d('0xc')]('/',auth[_0x997d('0x8')](),interaction[_0x997d('0xd')](_0x997d('0xe'),_0x997d('0xf')),controller[_0x997d('0x10')]);router['post'](_0x997d('0x11'),controller[_0x997d('0x12')]);router[_0x997d('0x13')](_0x997d('0xb'),auth[_0x997d('0x8')](),controller[_0x997d('0x14')]);router[_0x997d('0x13')]('/:id/accept',auth[_0x997d('0x8')](),controller[_0x997d('0x15')]);router[_0x997d('0x13')](_0x997d('0x16'),auth[_0x997d('0x8')](),controller[_0x997d('0x17')]);router[_0x997d('0x18')](_0x997d('0xb'),auth['isAuthenticated'](),controller[_0x997d('0x19')]);module[_0x997d('0x1a')]=router; \ No newline at end of file +var _0xc852=['path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','post','tracked','sms','smsmessage:create','/:id/status','status','put','update','/:id/accept','accept','reject','delete','destroy','exports','multer'];(function(_0x58de82,_0x5125ad){var _0x4cae05=function(_0x58f436){while(--_0x58f436){_0x58de82['push'](_0x58de82['shift']());}};_0x4cae05(++_0x5125ad);}(_0xc852,0x15e));var _0x2c85=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc852[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x2c85('0x0'));var util=require('util');var path=require(_0x2c85('0x1'));var timeout=require('connect-timeout');var express=require(_0x2c85('0x2'));var router=express[_0x2c85('0x3')]();var auth=require(_0x2c85('0x4'));var interaction=require(_0x2c85('0x5'));var config=require(_0x2c85('0x6'));var controller=require('./smsMessage.controller');router[_0x2c85('0x7')]('/',auth[_0x2c85('0x8')](),controller[_0x2c85('0x9')]);router[_0x2c85('0x7')](_0x2c85('0xa'),auth[_0x2c85('0x8')](),controller['describe']);router[_0x2c85('0x7')](_0x2c85('0xb'),auth['isAuthenticated'](),controller[_0x2c85('0xc')]);router[_0x2c85('0xd')]('/',auth[_0x2c85('0x8')](),interaction[_0x2c85('0xe')](_0x2c85('0xf'),_0x2c85('0x10')),controller['create']);router[_0x2c85('0xd')](_0x2c85('0x11'),controller[_0x2c85('0x12')]);router[_0x2c85('0x13')](_0x2c85('0xb'),auth[_0x2c85('0x8')](),controller[_0x2c85('0x14')]);router[_0x2c85('0x13')](_0x2c85('0x15'),auth['isAuthenticated'](),controller[_0x2c85('0x16')]);router[_0x2c85('0x13')]('/:id/reject',auth[_0x2c85('0x8')](),controller[_0x2c85('0x17')]);router[_0x2c85('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x2c85('0x19')]);module[_0x2c85('0x1a')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 723acd8..084d30a 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 _0x7bd5=['ENUM','out','STRING','DATE','BOOLEAN','sequelize','exports','TEXT','medium'];(function(_0x5836be,_0x2c2dc6){var _0x590313=function(_0x4a86ba){while(--_0x4a86ba){_0x5836be['push'](_0x5836be['shift']());}};_0x590313(++_0x2c2dc6);}(_0x7bd5,0xd4));var _0x57bd=function(_0x4a997d,_0x41b34e){_0x4a997d=_0x4a997d-0x0;var _0x1e7ac8=_0x7bd5[_0x4a997d];return _0x1e7ac8;};'use strict';var Sequelize=require(_0x57bd('0x0'));module[_0x57bd('0x1')]={'body':{'type':Sequelize[_0x57bd('0x2')](_0x57bd('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x57bd('0x4')]('in',_0x57bd('0x5')),'defaultValue':_0x57bd('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x57bd('0x6')](0xbe)},'phone':{'type':Sequelize[_0x57bd('0x6')]},'readAt':{'type':Sequelize[_0x57bd('0x7')]},'secret':{'type':Sequelize[_0x57bd('0x8')],'defaultValue':![]}}; \ No newline at end of file +var _0x84f1=['out','STRING','DATE','sequelize','exports','TEXT','medium','ENUM'];(function(_0x2b375c,_0x51e52b){var _0x3fd2f5=function(_0x155637){while(--_0x155637){_0x2b375c['push'](_0x2b375c['shift']());}};_0x3fd2f5(++_0x51e52b);}(_0x84f1,0x1bb));var _0x184f=function(_0x51e8ba,_0x2c3e86){_0x51e8ba=_0x51e8ba-0x0;var _0x594d32=_0x84f1[_0x51e8ba];return _0x594d32;};'use strict';var Sequelize=require(_0x184f('0x0'));module[_0x184f('0x1')]={'body':{'type':Sequelize[_0x184f('0x2')](_0x184f('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x184f('0x4')]('in','out'),'defaultValue':_0x184f('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x184f('0x6')](0xbe)},'phone':{'type':Sequelize[_0x184f('0x6')]},'readAt':{'type':Sequelize[_0x184f('0x7')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 486133e..616303f 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 _0xe599=['include','findAll','rows','params','intersection','find','create','body','destroy','describe','sms-interactions','accept','sms','read','readAt','format','UserId','CmContact','Contact','get','SmsInteraction','SmsInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','stringify','null','AcceptMessage','manual','interface','channel','EventManager','agent','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','SIP/%s','event','rejectmessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','MessageUUID','sent','delivered','Status','plivio','results','groupName','DELIVERED','infobip','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','jayson/promise','client','http','test','request','then','info','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','stack','name','index','map','SmsMessage','rawAttributes','fieldName','type','key','model','query','keys','attributes','fields','length','nolimit','order','sort','filters','pick','merge','where','VIRTUAL','field','includeAll'];(function(_0x2a042b,_0x6568ac){var _0x430335=function(_0x1dd8c5){while(--_0x1dd8c5){_0x2a042b['push'](_0x2a042b['shift']());}};_0x430335(++_0x6568ac);}(_0xe599,0x1e5));var _0x9e59=function(_0x51c995,_0x1c381b){_0x51c995=_0x51c995-0x0;var _0x5bad9f=_0xe599[_0x51c995];return _0x5bad9f;};'use strict';var pdf=require(_0x9e59('0x0'));var emlformat=require(_0x9e59('0x1'));var rimraf=require(_0x9e59('0x2'));var zipdir=require(_0x9e59('0x3'));var jsonpatch=require(_0x9e59('0x4'));var rp=require(_0x9e59('0x5'));var moment=require(_0x9e59('0x6'));var BPromise=require(_0x9e59('0x7'));var Mustache=require(_0x9e59('0x8'));var util=require('util');var path=require(_0x9e59('0x9'));var sox=require(_0x9e59('0xa'));var csv=require('to-csv');var ejs=require(_0x9e59('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x9e59('0xc'));var crypto=require(_0x9e59('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x9e59('0xe'));var toCsv=require(_0x9e59('0xf'));var querystring=require(_0x9e59('0x10'));var Papa=require(_0x9e59('0x11'));var Redis=require(_0x9e59('0x12'));var authService=require(_0x9e59('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x9e59('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9e59('0x15'))(_0x9e59('0x16'));var utils=require(_0x9e59('0x17'));var config=require(_0x9e59('0x18'));var db=require('../../mysqldb')['db'];config[_0x9e59('0x19')]=_[_0x9e59('0x1a')](config['redis'],{'host':_0x9e59('0x1b'),'port':0x18eb});var socket=require(_0x9e59('0x1c'))(new Redis(config[_0x9e59('0x19')]));require(_0x9e59('0x1d'))['register'](socket);var jayson=require(_0x9e59('0x1e'));var client=jayson[_0x9e59('0x1f')][_0x9e59('0x20')]({'port':0x232c});var client9002=jayson[_0x9e59('0x1f')][_0x9e59('0x20')]({'port':0x232a});function checkPasswordPattern(_0x1d1777,_0x1e0f80,_0x82dffd){if(_0x82dffd){var _0x53f73e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x53f73e[_0x9e59('0x21')](_0x1e0f80)){return _0x1d1777;}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 _0x1d1777;}}function respondWithRpcPromise(_0x5808af,_0x5eb34e,_0x29dc13,_0x470f7a){return new BPromise(function(_0x51e05b,_0x224bc7){var _0x3e6c34=_0x470f7a||client;return _0x3e6c34[_0x9e59('0x22')](_0x5808af,_0x29dc13)[_0x9e59('0x23')](function(_0x2fcfa6){logger[_0x9e59('0x24')](_0x9e59('0x25'),_0x5eb34e,'request\x20sent');logger[_0x9e59('0x26')](_0x9e59('0x27'),_0x5eb34e,'request\x20sent',JSON['stringify'](_0x2fcfa6));if(_0x2fcfa6[_0x9e59('0x28')]){if(_0x2fcfa6[_0x9e59('0x28')][_0x9e59('0x29')]===0x1f4){logger['error'](_0x9e59('0x25'),_0x5eb34e,_0x2fcfa6[_0x9e59('0x28')]['message']);return _0x224bc7(_0x2fcfa6['error']['message']);}logger[_0x9e59('0x28')](_0x9e59('0x25'),_0x5eb34e,_0x2fcfa6[_0x9e59('0x28')][_0x9e59('0x2a')]);return _0x51e05b(_0x2fcfa6[_0x9e59('0x28')]['message']);}else{logger['info']('SmsMessage,\x20%s,\x20%s',_0x5eb34e,_0x9e59('0x2b'));_0x51e05b(_0x2fcfa6[_0x9e59('0x2c')][_0x9e59('0x2a')]);}})[_0x9e59('0x2d')](function(_0x4af2f2){logger[_0x9e59('0x28')]('SmsMessage,\x20%s,\x20%s',_0x5eb34e,_0x4af2f2);_0x224bc7(_0x4af2f2);});});}function respondWithStatusCode(_0x5d4be1,_0x3e92ae){_0x3e92ae=_0x3e92ae||0xcc;return function(_0x3c04db){if(_0x3c04db){return _0x5d4be1[_0x9e59('0x2e')](_0x3e92ae);}return _0x5d4be1[_0x9e59('0x2f')](_0x3e92ae)[_0x9e59('0x30')]();};}function respondWithResult(_0x17f4f5,_0x217f93){_0x217f93=_0x217f93||0xc8;return function(_0x2b4ad2){if(_0x2b4ad2){return _0x17f4f5[_0x9e59('0x2f')](_0x217f93)[_0x9e59('0x31')](_0x2b4ad2);}};}function respondWithFilteredResult(_0x2a5d17,_0x22b036){return function(_0x1fdbe9){if(_0x1fdbe9){var _0x49184a=_0x1fdbe9[_0x9e59('0x32')],_0x442f96=_0x22b036[_0x9e59('0x33')],_0x151ec1=_0x22b036[_0x9e59('0x33')]+_0x22b036[_0x9e59('0x34')],_0xced2df;if(_0x151ec1>=_0x49184a){_0x151ec1=_0x49184a;_0xced2df=0xc8;}else{_0xced2df=0xce;}_0x2a5d17[_0x9e59('0x2f')](_0xced2df);return _0x2a5d17[_0x9e59('0x35')]('Content-Range',_0x442f96+'-'+_0x151ec1+'/'+_0x49184a)[_0x9e59('0x31')](_0x1fdbe9);}return null;};}function patchUpdates(_0x5138a6){return function(_0x3d6237){try{jsonpatch[_0x9e59('0x36')](_0x3d6237,_0x5138a6,!![]);}catch(_0x8d73a8){return BPromise[_0x9e59('0x37')](_0x8d73a8);}return _0x3d6237[_0x9e59('0x38')]();};}function saveUpdates(_0xf7dc89,_0x37bc00){return function(_0x2a99eb){if(_0x2a99eb){return _0x2a99eb[_0x9e59('0x39')](_0xf7dc89)[_0x9e59('0x23')](function(_0x2b3d5b){return _0x2b3d5b;});}return null;};}function removeEntity(_0x19a383,_0x11ae09){return function(_0x2933af){if(_0x2933af){return _0x2933af['destroy']()[_0x9e59('0x23')](function(){_0x19a383['status'](0xcc)[_0x9e59('0x30')]();});}};}function handleEntityNotFound(_0x39d8e3,_0x3e564b){return function(_0x530db2){if(!_0x530db2){_0x39d8e3['sendStatus'](0x194);}return _0x530db2;};}function handleError(_0x868348,_0x5f0c0f){_0x5f0c0f=_0x5f0c0f||0x1f4;return function(_0x1c4d27){logger['error'](_0x1c4d27[_0x9e59('0x3a')]);if(_0x1c4d27[_0x9e59('0x3b')]){delete _0x1c4d27['name'];}_0x868348['status'](_0x5f0c0f)['send'](_0x1c4d27);};}exports[_0x9e59('0x3c')]=function(_0x4c0cb6,_0x18f2e6){var _0x121cf4={},_0x1d5dca={},_0x4694ff={'count':0x0,'rows':[]};var _0x4bf69f=_[_0x9e59('0x3d')](db[_0x9e59('0x3e')][_0x9e59('0x3f')],function(_0x452f31){return{'name':_0x452f31[_0x9e59('0x40')],'type':_0x452f31[_0x9e59('0x41')][_0x9e59('0x42')]};});_0x1d5dca[_0x9e59('0x43')]=_[_0x9e59('0x3d')](_0x4bf69f,_0x9e59('0x3b'));_0x1d5dca[_0x9e59('0x44')]=_[_0x9e59('0x45')](_0x4c0cb6[_0x9e59('0x44')]);_0x1d5dca['filters']=_['intersection'](_0x1d5dca[_0x9e59('0x43')],_0x1d5dca['query']);_0x121cf4[_0x9e59('0x46')]=_['intersection'](_0x1d5dca[_0x9e59('0x43')],qs[_0x9e59('0x47')](_0x4c0cb6[_0x9e59('0x44')][_0x9e59('0x47')]));_0x121cf4[_0x9e59('0x46')]=_0x121cf4[_0x9e59('0x46')][_0x9e59('0x48')]?_0x121cf4['attributes']:_0x1d5dca[_0x9e59('0x43')];if(!_0x4c0cb6[_0x9e59('0x44')]['hasOwnProperty'](_0x9e59('0x49'))){_0x121cf4[_0x9e59('0x34')]=qs[_0x9e59('0x34')](_0x4c0cb6['query'][_0x9e59('0x34')]);_0x121cf4[_0x9e59('0x33')]=qs[_0x9e59('0x33')](_0x4c0cb6[_0x9e59('0x44')]['offset']);}_0x121cf4[_0x9e59('0x4a')]=qs[_0x9e59('0x4b')](_0x4c0cb6['query'][_0x9e59('0x4b')]);_0x121cf4['where']=qs[_0x9e59('0x4c')](_[_0x9e59('0x4d')](_0x4c0cb6[_0x9e59('0x44')],_0x1d5dca[_0x9e59('0x4c')]));if(_0x4c0cb6[_0x9e59('0x44')]['filter']){_0x121cf4['where']=_[_0x9e59('0x4e')](_0x121cf4[_0x9e59('0x4f')],{'$or':_[_0x9e59('0x3d')](_0x4bf69f,function(_0x570757){if(_0x570757['type'][_0x9e59('0x42')]!==_0x9e59('0x50')){var _0x196c0e={};_0x196c0e[_0x570757[_0x9e59('0x51')]]={'$like':'%'+_0x4c0cb6[_0x9e59('0x44')]['filter']+'%'};return _0x196c0e;}})});}_0x121cf4=_['merge']({},_0x121cf4,_0x4c0cb6['options']);var _0x5f2fd3={'where':_0x121cf4[_0x9e59('0x4f')]};return db[_0x9e59('0x3e')][_0x9e59('0x32')](_0x5f2fd3)[_0x9e59('0x23')](function(_0x2cc92c){_0x4694ff[_0x9e59('0x32')]=_0x2cc92c;if(_0x4c0cb6[_0x9e59('0x44')][_0x9e59('0x52')]){_0x121cf4[_0x9e59('0x53')]=[{'all':!![]}];}return db[_0x9e59('0x3e')][_0x9e59('0x54')](_0x121cf4);})[_0x9e59('0x23')](function(_0x5bea4e){_0x4694ff[_0x9e59('0x55')]=_0x5bea4e;return _0x4694ff;})[_0x9e59('0x23')](respondWithFilteredResult(_0x18f2e6,_0x121cf4))['catch'](handleError(_0x18f2e6,null));};exports['show']=function(_0x2d2a5c,_0x45cece){var _0x23e3a5={'raw':!![],'where':{'id':_0x2d2a5c[_0x9e59('0x56')]['id']}},_0x2e48aa={};_0x2e48aa[_0x9e59('0x43')]=_[_0x9e59('0x45')](db[_0x9e59('0x3e')][_0x9e59('0x3f')]);_0x2e48aa[_0x9e59('0x44')]=_['keys'](_0x2d2a5c[_0x9e59('0x44')]);_0x2e48aa[_0x9e59('0x4c')]=_[_0x9e59('0x57')](_0x2e48aa[_0x9e59('0x43')],_0x2e48aa[_0x9e59('0x44')]);_0x23e3a5[_0x9e59('0x46')]=_['intersection'](_0x2e48aa[_0x9e59('0x43')],qs[_0x9e59('0x47')](_0x2d2a5c[_0x9e59('0x44')][_0x9e59('0x47')]));_0x23e3a5[_0x9e59('0x46')]=_0x23e3a5['attributes'][_0x9e59('0x48')]?_0x23e3a5['attributes']:_0x2e48aa[_0x9e59('0x43')];if(_0x2d2a5c[_0x9e59('0x44')][_0x9e59('0x52')]){_0x23e3a5['include']=[{'all':!![]}];}_0x23e3a5=_['merge']({},_0x23e3a5,_0x2d2a5c['options']);return db['SmsMessage'][_0x9e59('0x58')](_0x23e3a5)[_0x9e59('0x23')](handleEntityNotFound(_0x45cece,null))[_0x9e59('0x23')](respondWithResult(_0x45cece,null))[_0x9e59('0x2d')](handleError(_0x45cece,null));};exports[_0x9e59('0x59')]=function(_0xa40daf,_0x1aaa52){return db['SmsMessage'][_0x9e59('0x59')](_0xa40daf[_0x9e59('0x5a')],{})['then'](respondWithResult(_0x1aaa52,0xc9))['catch'](handleError(_0x1aaa52,null));};exports[_0x9e59('0x39')]=function(_0x1910f1,_0x4463be){if(_0x1910f1['body']['id']){delete _0x1910f1[_0x9e59('0x5a')]['id'];}return db[_0x9e59('0x3e')][_0x9e59('0x58')]({'where':{'id':_0x1910f1['params']['id']}})[_0x9e59('0x23')](handleEntityNotFound(_0x4463be,null))[_0x9e59('0x23')](saveUpdates(_0x1910f1['body'],null))[_0x9e59('0x23')](respondWithResult(_0x4463be,null))[_0x9e59('0x2d')](handleError(_0x4463be,null));};exports[_0x9e59('0x5b')]=function(_0x360084,_0xdd5a17){return db[_0x9e59('0x3e')][_0x9e59('0x58')]({'where':{'id':_0x360084[_0x9e59('0x56')]['id']}})[_0x9e59('0x23')](handleEntityNotFound(_0xdd5a17,null))[_0x9e59('0x23')](removeEntity(_0xdd5a17,null))[_0x9e59('0x2d')](handleError(_0xdd5a17,null));};exports[_0x9e59('0x5c')]=function(_0x830b77,_0x809f0e){return db[_0x9e59('0x3e')][_0x9e59('0x5c')]()[_0x9e59('0x23')](respondWithResult(_0x809f0e,null))['catch'](handleError(_0x809f0e,null));};var interaction_log=require('../../config/logger')(_0x9e59('0x5d'));exports[_0x9e59('0x5e')]=function(_0x5298dd,_0x5410d0,_0x4b191a){var _0x5c474b={'channel':_0x9e59('0x5f')};if(_0x5298dd['body']['id']){delete _0x5298dd['body']['id'];}_0x5298dd[_0x9e59('0x5a')][_0x9e59('0x60')]=!![];_0x5298dd[_0x9e59('0x5a')][_0x9e59('0x61')]=moment()[_0x9e59('0x62')]('YYYY-MM-DD\x20HH:mm:ss');_0x5298dd['body'][_0x9e59('0x63')]=_0x5298dd['body'][_0x9e59('0x63')]||_0x5298dd['user']['id'];return db[_0x9e59('0x3e')][_0x9e59('0x58')]({'where':{'id':_0x5298dd['params']['id'],'UserId':null},'include':[{'model':db[_0x9e59('0x64')],'as':_0x9e59('0x65')}]})['then'](handleEntityNotFound(_0x5410d0,null))[_0x9e59('0x23')](saveUpdates(_0x5298dd[_0x9e59('0x5a')],null))[_0x9e59('0x23')](function(_0x43a284){if(_0x43a284){_0x5c474b[_0x9e59('0x2a')]=_0x43a284[_0x9e59('0x66')]({'plain':!![]});return db[_0x9e59('0x67')][_0x9e59('0x58')]({'where':{'id':_0x43a284[_0x9e59('0x68')]}});}return null;})['then'](handleEntityNotFound(_0x5410d0,null))[_0x9e59('0x23')](function(_0x2235f3){if(_0x2235f3){return _0x2235f3[_0x9e59('0x39')]({'UserId':_0x5298dd['body'][_0x9e59('0x63')],'read1stAt':_[_0x9e59('0x69')](_0x2235f3[_0x9e59('0x6a')])?moment()['format'](_0x9e59('0x6b')):undefined});}return null;})[_0x9e59('0x23')](function(_0x2657a2){if(_0x2657a2){_0x5c474b[_0x9e59('0x6c')]=_0x2657a2['get']({'plain':!![]});interaction_log[_0x9e59('0x24')](_0x9e59('0x6d'),_0x5298dd['user']['id'],_0x5298dd[_0x9e59('0x6e')][_0x9e59('0x3b')],_0x5298dd[_0x9e59('0x6e')][_0x9e59('0x6f')],_0x5c474b['interaction']['id'],_0x5298dd['body']?JSON[_0x9e59('0x70')](_0x5298dd[_0x9e59('0x5a')]):_0x9e59('0x71'));return respondWithRpcPromise(_0x9e59('0x72'),'acceptMessage',_0x5c474b);}return null;})[_0x9e59('0x23')](function(_0x483b19){if(_0x483b19){if(_0x5298dd[_0x9e59('0x5a')][_0x9e59('0x73')]){_0x5c474b['message'][_0x9e59('0x74')]=util[_0x9e59('0x62')]('SIP/%s',_0x5298dd[_0x9e59('0x6e')][_0x9e59('0x3b')]);_0x5c474b[_0x9e59('0x2a')][_0x9e59('0x75')]=_0x5c474b[_0x9e59('0x75')];_0x5c474b[_0x9e59('0x2a')]['event']='accept';return respondWithRpcPromise(_0x9e59('0x76'),'EventManager',{'event':'acceptmessage','message':_0x5c474b['message']},client9002)[_0x9e59('0x23')](function(){return _0x5c474b;});}return _0x5c474b;}return null;})['then'](respondWithResult(_0x5410d0,null))[_0x9e59('0x2d')](handleError(_0x5410d0,null));};var interaction_log=require(_0x9e59('0x15'))(_0x9e59('0x5d'));exports[_0x9e59('0x37')]=function(_0x6e4fa6,_0x342994,_0x3c318e){var _0x4fc6d7={'agent':{},'channel':'sms'};if(_0x6e4fa6[_0x9e59('0x5a')]['id']){delete _0x6e4fa6['body']['id'];}_0x6e4fa6[_0x9e59('0x5a')][_0x9e59('0x63')]=_0x6e4fa6[_0x9e59('0x5a')][_0x9e59('0x63')]||_0x6e4fa6[_0x9e59('0x6e')]['id'];_0x4fc6d7[_0x9e59('0x77')]['id']=_0x6e4fa6[_0x9e59('0x5a')][_0x9e59('0x63')];return db[_0x9e59('0x3e')][_0x9e59('0x58')]({'where':{'id':_0x6e4fa6[_0x9e59('0x56')]['id'],'UserId':null}})[_0x9e59('0x23')](handleEntityNotFound(_0x342994,null))[_0x9e59('0x23')](function(_0x142a3a){if(_0x142a3a){_0x4fc6d7[_0x9e59('0x2a')]=_0x142a3a[_0x9e59('0x66')]({'plain':!![]});return db[_0x9e59('0x67')]['find']({'where':{'id':_0x142a3a[_0x9e59('0x68')]}});}return null;})[_0x9e59('0x23')](handleEntityNotFound(_0x342994,null))['then'](function(_0xb7d0cc){if(_0xb7d0cc){_0x4fc6d7[_0x9e59('0x6c')]=_0xb7d0cc['get']({'plain':!![]});interaction_log[_0x9e59('0x24')](_0x9e59('0x78'),_0x6e4fa6[_0x9e59('0x6e')]['id'],_0x6e4fa6[_0x9e59('0x6e')][_0x9e59('0x3b')],_0x6e4fa6[_0x9e59('0x6e')][_0x9e59('0x6f')],_0x4fc6d7[_0x9e59('0x6c')]['id'],_0x6e4fa6[_0x9e59('0x5a')]?JSON[_0x9e59('0x70')](_0x6e4fa6[_0x9e59('0x5a')]):_0x9e59('0x71'));return respondWithRpcPromise(_0x9e59('0x79'),'rejectMessage',_0x4fc6d7);}return null;})[_0x9e59('0x23')](function(_0x5bd0a6){if(_0x5bd0a6){_0x5bd0a6[_0x9e59('0x2a')][_0x9e59('0x74')]=util[_0x9e59('0x62')](_0x9e59('0x7a'),_0x6e4fa6[_0x9e59('0x6e')]['name']);_0x5bd0a6['message'][_0x9e59('0x75')]=_0x4fc6d7[_0x9e59('0x75')];_0x5bd0a6[_0x9e59('0x2a')][_0x9e59('0x7b')]=_0x9e59('0x37');respondWithRpcPromise('EventManager','EventManager',{'event':_0x9e59('0x7c'),'message':_0x5bd0a6[_0x9e59('0x2a')]},client9002);return _0x4fc6d7;}return null;})[_0x9e59('0x23')](respondWithResult(_0x342994,null))[_0x9e59('0x2d')](handleError(_0x342994,null));};exports[_0x9e59('0x2f')]=function(_0x3c92e6,_0x47cbcf,_0x110154){if(_0x3c92e6[_0x9e59('0x5a')]['id']){delete _0x3c92e6['body']['id'];}var _0x498cae;return db[_0x9e59('0x3e')]['find']({'where':{'id':_0x3c92e6['params']['id']}})[_0x9e59('0x23')](handleEntityNotFound(_0x47cbcf,null))[_0x9e59('0x23')](function(_0x4fe03d){if(_0x4fe03d){_0x498cae=_0x4fe03d;return db[_0x9e59('0x7d')][_0x9e59('0x58')]({'where':{'id':_0x4fe03d[_0x9e59('0x7e')]}});}})[_0x9e59('0x23')](handleEntityNotFound(_0x47cbcf,null))['then'](function(_0x12ea99){if(_0x12ea99){logger[_0x9e59('0x26')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9e59('0x2f'),_0x9e59('0x7f'),_0x12ea99['type'],util[_0x9e59('0x80')](_0x3c92e6['body'],{'showHidden':![],'depth':null}));switch(_0x12ea99[_0x9e59('0x41')]){case _0x9e59('0x81'):if(_0x3c92e6[_0x9e59('0x5a')][_0x9e59('0x82')]&&_0x3c92e6[_0x9e59('0x5a')]['MessageSid']===_0x498cae[_0x9e59('0x83')]){return _0x498cae['update']({'read':!![]});}else{logger[_0x9e59('0x28')](_0x9e59('0x84'),_0x9e59('0x2f'),'twilio',util[_0x9e59('0x80')](_0x3c92e6[_0x9e59('0x5a')],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x3c92e6[_0x9e59('0x5a')][_0x9e59('0x85')]&&_0x3c92e6[_0x9e59('0x5a')][_0x9e59('0x85')]===_0x498cae[_0x9e59('0x83')]&&_['indexOf']([_0x9e59('0x86'),_0x9e59('0x87')],_0x3c92e6[_0x9e59('0x5a')][_0x9e59('0x88')])>=0x0){return _0x498cae[_0x9e59('0x39')]({'read':!![]});}else{logger[_0x9e59('0x28')](_0x9e59('0x84'),_0x9e59('0x2f'),_0x9e59('0x89'),util[_0x9e59('0x80')](_0x3c92e6[_0x9e59('0x5a')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x1d5ef2=_0x3c92e6[_0x9e59('0x5a')][_0x9e59('0x8a')][0x0];if(_0x1d5ef2[_0x9e59('0x2f')][_0x9e59('0x8b')]===_0x9e59('0x8c')){return _0x498cae['update']({'read':!![]});}else{logger[_0x9e59('0x28')](_0x9e59('0x84'),_0x9e59('0x2f'),_0x9e59('0x8d'),util[_0x9e59('0x80')](_0x3c92e6[_0x9e59('0x5a')],{'showHidden':![],'depth':null}));}break;}return _0x498cae;}})[_0x9e59('0x23')](respondWithResult(_0x47cbcf,null))[_0x9e59('0x2d')](handleError(_0x47cbcf,null));}; \ No newline at end of file +var _0x950a=['DELIVERED','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../config/license/hardware','api','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','http','client','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','save','destroy','stack','name','index','map','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','order','sort','where','filter','VIRTUAL','field','options','SmsMessage','includeAll','include','findAll','rows','show','params','filters','length','merge','find','create','body','update','describe','accept','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','AcceptMessage','acceptMessage','interface','channel','event','EventManager','acceptmessage','../../config/logger','sms-interactions','reject','agent','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','SmsAccount','SmsAccountId','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf','sent','delivered','plivio','infobip','results'];(function(_0x5ef663,_0x496095){var _0x4cfd9b=function(_0x231216){while(--_0x231216){_0x5ef663['push'](_0x5ef663['shift']());}};_0x4cfd9b(++_0x496095);}(_0x950a,0x111));var _0xa950=function(_0xa2d152,_0x5555e6){_0xa2d152=_0xa2d152-0x0;var _0x3e973a=_0x950a[_0xa2d152];return _0x3e973a;};'use strict';var pdf=require(_0xa950('0x0'));var emlformat=require(_0xa950('0x1'));var rimraf=require(_0xa950('0x2'));var zipdir=require(_0xa950('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa950('0x4'));var moment=require(_0xa950('0x5'));var BPromise=require(_0xa950('0x6'));var Mustache=require(_0xa950('0x7'));var util=require('util');var path=require(_0xa950('0x8'));var sox=require(_0xa950('0x9'));var csv=require('to-csv');var ejs=require(_0xa950('0xa'));var fs=require('fs');var _=require(_0xa950('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa950('0xc'));var deskjs=require(_0xa950('0xd'));var toCsv=require(_0xa950('0xe'));var querystring=require(_0xa950('0xf'));var Papa=require(_0xa950('0x10'));var Redis=require(_0xa950('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa950('0x12'));var logger=require('../../config/logger')(_0xa950('0x13'));var utils=require(_0xa950('0x14'));var config=require(_0xa950('0x15'));var db=require('../../mysqldb')['db'];config[_0xa950('0x16')]=_['defaults'](config[_0xa950('0x16')],{'host':_0xa950('0x17'),'port':0x18eb});var socket=require(_0xa950('0x18'))(new Redis(config['redis']));require(_0xa950('0x19'))[_0xa950('0x1a')](socket);var jayson=require(_0xa950('0x1b'));var client=jayson['client'][_0xa950('0x1c')]({'port':0x232c});var client9002=jayson[_0xa950('0x1d')][_0xa950('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x5d5f4c,_0x31b25b,_0x46fca7){if(_0x46fca7){var _0x1598a8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1598a8['test'](_0x31b25b)){return _0x5d5f4c;}else{throw new Error(_0xa950('0x1e'));}}else{return _0x5d5f4c;}}function respondWithRpcPromise(_0x470539,_0x162586,_0x1021da,_0x16aabc){return new BPromise(function(_0x3f4c95,_0x2b0e44){var _0x36e57c=_0x16aabc||client;return _0x36e57c[_0xa950('0x1f')](_0x470539,_0x1021da)[_0xa950('0x20')](function(_0x28fedf){logger[_0xa950('0x21')](_0xa950('0x22'),_0x162586,'request\x20sent');logger[_0xa950('0x23')](_0xa950('0x24'),_0x162586,'request\x20sent',JSON[_0xa950('0x25')](_0x28fedf));if(_0x28fedf[_0xa950('0x26')]){if(_0x28fedf['error'][_0xa950('0x27')]===0x1f4){logger['error'](_0xa950('0x22'),_0x162586,_0x28fedf[_0xa950('0x26')][_0xa950('0x28')]);return _0x2b0e44(_0x28fedf[_0xa950('0x26')]['message']);}logger[_0xa950('0x26')](_0xa950('0x22'),_0x162586,_0x28fedf[_0xa950('0x26')][_0xa950('0x28')]);return _0x3f4c95(_0x28fedf[_0xa950('0x26')][_0xa950('0x28')]);}else{logger[_0xa950('0x21')](_0xa950('0x22'),_0x162586,_0xa950('0x29'));_0x3f4c95(_0x28fedf[_0xa950('0x2a')][_0xa950('0x28')]);}})[_0xa950('0x2b')](function(_0x43f8c8){logger['error'](_0xa950('0x22'),_0x162586,_0x43f8c8);_0x2b0e44(_0x43f8c8);});});}function respondWithStatusCode(_0x288934,_0x3f37f8){_0x3f37f8=_0x3f37f8||0xcc;return function(_0x1aa96a){if(_0x1aa96a){return _0x288934[_0xa950('0x2c')](_0x3f37f8);}return _0x288934[_0xa950('0x2d')](_0x3f37f8)[_0xa950('0x2e')]();};}function respondWithResult(_0x52e133,_0x19ad7a){_0x19ad7a=_0x19ad7a||0xc8;return function(_0x442a94){if(_0x442a94){return _0x52e133['status'](_0x19ad7a)[_0xa950('0x2f')](_0x442a94);}};}function respondWithFilteredResult(_0x2e7674,_0x3e5915){return function(_0x1875eb){if(_0x1875eb){var _0x152f53=_0x1875eb[_0xa950('0x30')],_0x1945ca=_0x3e5915[_0xa950('0x31')],_0x1d6e91=_0x3e5915['offset']+_0x3e5915[_0xa950('0x32')],_0x2d0c59;if(_0x1d6e91>=_0x152f53){_0x1d6e91=_0x152f53;_0x2d0c59=0xc8;}else{_0x2d0c59=0xce;}_0x2e7674['status'](_0x2d0c59);return _0x2e7674['set'](_0xa950('0x33'),_0x1945ca+'-'+_0x1d6e91+'/'+_0x152f53)['json'](_0x1875eb);}return null;};}function patchUpdates(_0x118d96){return function(_0x2b43f5){try{jsonpatch[_0xa950('0x34')](_0x2b43f5,_0x118d96,!![]);}catch(_0x34f7b9){return BPromise['reject'](_0x34f7b9);}return _0x2b43f5[_0xa950('0x35')]();};}function saveUpdates(_0x53333a,_0x45846c){return function(_0x2306f8){if(_0x2306f8){return _0x2306f8['update'](_0x53333a)['then'](function(_0x44c1a9){return _0x44c1a9;});}return null;};}function removeEntity(_0x1ccbed,_0x2c0e69){return function(_0x1de9b0){if(_0x1de9b0){return _0x1de9b0[_0xa950('0x36')]()[_0xa950('0x20')](function(){_0x1ccbed['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x356258,_0x4a0c33){return function(_0x2559e6){if(!_0x2559e6){_0x356258[_0xa950('0x2c')](0x194);}return _0x2559e6;};}function handleError(_0x212863,_0x2c664e){_0x2c664e=_0x2c664e||0x1f4;return function(_0x15931b){logger[_0xa950('0x26')](_0x15931b[_0xa950('0x37')]);if(_0x15931b[_0xa950('0x38')]){delete _0x15931b[_0xa950('0x38')];}_0x212863[_0xa950('0x2d')](_0x2c664e)['send'](_0x15931b);};}exports[_0xa950('0x39')]=function(_0x590ed1,_0x371091){var _0x24bfdc={},_0x5664b8={},_0x4c6588={'count':0x0,'rows':[]};var _0x3d49f4=_[_0xa950('0x3a')](db['SmsMessage'][_0xa950('0x3b')],function(_0x8ef7d7){return{'name':_0x8ef7d7['fieldName'],'type':_0x8ef7d7[_0xa950('0x3c')][_0xa950('0x3d')]};});_0x5664b8[_0xa950('0x3e')]=_[_0xa950('0x3a')](_0x3d49f4,_0xa950('0x38'));_0x5664b8[_0xa950('0x3f')]=_[_0xa950('0x40')](_0x590ed1[_0xa950('0x3f')]);_0x5664b8['filters']=_[_0xa950('0x41')](_0x5664b8[_0xa950('0x3e')],_0x5664b8['query']);_0x24bfdc[_0xa950('0x42')]=_[_0xa950('0x41')](_0x5664b8[_0xa950('0x3e')],qs['fields'](_0x590ed1[_0xa950('0x3f')][_0xa950('0x43')]));_0x24bfdc[_0xa950('0x42')]=_0x24bfdc['attributes']['length']?_0x24bfdc[_0xa950('0x42')]:_0x5664b8[_0xa950('0x3e')];if(!_0x590ed1[_0xa950('0x3f')]['hasOwnProperty']('nolimit')){_0x24bfdc['limit']=qs[_0xa950('0x32')](_0x590ed1[_0xa950('0x3f')][_0xa950('0x32')]);_0x24bfdc[_0xa950('0x31')]=qs[_0xa950('0x31')](_0x590ed1['query'][_0xa950('0x31')]);}_0x24bfdc[_0xa950('0x44')]=qs['sort'](_0x590ed1['query'][_0xa950('0x45')]);_0x24bfdc[_0xa950('0x46')]=qs['filters'](_['pick'](_0x590ed1['query'],_0x5664b8['filters']));if(_0x590ed1[_0xa950('0x3f')][_0xa950('0x47')]){_0x24bfdc['where']=_['merge'](_0x24bfdc[_0xa950('0x46')],{'$or':_['map'](_0x3d49f4,function(_0x2ee8b4){if(_0x2ee8b4[_0xa950('0x3c')][_0xa950('0x3d')]!==_0xa950('0x48')){var _0x437d54={};_0x437d54[_0x2ee8b4[_0xa950('0x49')]]={'$like':'%'+_0x590ed1[_0xa950('0x3f')][_0xa950('0x47')]+'%'};return _0x437d54;}})});}_0x24bfdc=_['merge']({},_0x24bfdc,_0x590ed1[_0xa950('0x4a')]);var _0x4ede77={'where':_0x24bfdc[_0xa950('0x46')]};return db[_0xa950('0x4b')][_0xa950('0x30')](_0x4ede77)[_0xa950('0x20')](function(_0x362b47){_0x4c6588[_0xa950('0x30')]=_0x362b47;if(_0x590ed1[_0xa950('0x3f')][_0xa950('0x4c')]){_0x24bfdc[_0xa950('0x4d')]=[{'all':!![]}];}return db['SmsMessage'][_0xa950('0x4e')](_0x24bfdc);})[_0xa950('0x20')](function(_0x36ddb8){_0x4c6588[_0xa950('0x4f')]=_0x36ddb8;return _0x4c6588;})[_0xa950('0x20')](respondWithFilteredResult(_0x371091,_0x24bfdc))['catch'](handleError(_0x371091,null));};exports[_0xa950('0x50')]=function(_0xde68b2,_0x3f0bb5){var _0x84a54={'raw':!![],'where':{'id':_0xde68b2[_0xa950('0x51')]['id']}},_0x21905a={};_0x21905a[_0xa950('0x3e')]=_['keys'](db[_0xa950('0x4b')][_0xa950('0x3b')]);_0x21905a[_0xa950('0x3f')]=_['keys'](_0xde68b2['query']);_0x21905a[_0xa950('0x52')]=_[_0xa950('0x41')](_0x21905a[_0xa950('0x3e')],_0x21905a[_0xa950('0x3f')]);_0x84a54[_0xa950('0x42')]=_[_0xa950('0x41')](_0x21905a[_0xa950('0x3e')],qs[_0xa950('0x43')](_0xde68b2['query'][_0xa950('0x43')]));_0x84a54[_0xa950('0x42')]=_0x84a54[_0xa950('0x42')][_0xa950('0x53')]?_0x84a54[_0xa950('0x42')]:_0x21905a['model'];if(_0xde68b2[_0xa950('0x3f')]['includeAll']){_0x84a54[_0xa950('0x4d')]=[{'all':!![]}];}_0x84a54=_[_0xa950('0x54')]({},_0x84a54,_0xde68b2[_0xa950('0x4a')]);return db[_0xa950('0x4b')][_0xa950('0x55')](_0x84a54)[_0xa950('0x20')](handleEntityNotFound(_0x3f0bb5,null))['then'](respondWithResult(_0x3f0bb5,null))['catch'](handleError(_0x3f0bb5,null));};exports['create']=function(_0x41e086,_0x18dcd2){return db[_0xa950('0x4b')][_0xa950('0x56')](_0x41e086[_0xa950('0x57')],{})[_0xa950('0x20')](respondWithResult(_0x18dcd2,0xc9))[_0xa950('0x2b')](handleError(_0x18dcd2,null));};exports[_0xa950('0x58')]=function(_0x5e16e7,_0x3631bd){if(_0x5e16e7['body']['id']){delete _0x5e16e7[_0xa950('0x57')]['id'];}return db['SmsMessage'][_0xa950('0x55')]({'where':{'id':_0x5e16e7['params']['id']}})[_0xa950('0x20')](handleEntityNotFound(_0x3631bd,null))['then'](saveUpdates(_0x5e16e7[_0xa950('0x57')],null))[_0xa950('0x20')](respondWithResult(_0x3631bd,null))[_0xa950('0x2b')](handleError(_0x3631bd,null));};exports[_0xa950('0x36')]=function(_0x46cfe4,_0x4ed0be){return db[_0xa950('0x4b')][_0xa950('0x55')]({'where':{'id':_0x46cfe4[_0xa950('0x51')]['id']}})[_0xa950('0x20')](handleEntityNotFound(_0x4ed0be,null))[_0xa950('0x20')](removeEntity(_0x4ed0be,null))['catch'](handleError(_0x4ed0be,null));};exports[_0xa950('0x59')]=function(_0x117a56,_0x4c48b5){return db[_0xa950('0x4b')][_0xa950('0x59')]()['then'](respondWithResult(_0x4c48b5,null))[_0xa950('0x2b')](handleError(_0x4c48b5,null));};var interaction_log=require('../../config/logger')('sms-interactions');exports[_0xa950('0x5a')]=function(_0xcb3b8d,_0x29f27f,_0x132316){var _0x51c195={'channel':'sms'};if(_0xcb3b8d[_0xa950('0x57')]['id']){delete _0xcb3b8d[_0xa950('0x57')]['id'];}_0xcb3b8d[_0xa950('0x57')]['read']=!![];_0xcb3b8d[_0xa950('0x57')][_0xa950('0x5b')]=moment()[_0xa950('0x5c')](_0xa950('0x5d'));_0xcb3b8d[_0xa950('0x57')][_0xa950('0x5e')]=_0xcb3b8d[_0xa950('0x57')][_0xa950('0x5e')]||_0xcb3b8d[_0xa950('0x5f')]['id'];return db['SmsMessage'][_0xa950('0x55')]({'where':{'id':_0xcb3b8d['params']['id'],'UserId':null},'include':[{'model':db[_0xa950('0x60')],'as':_0xa950('0x61')}]})[_0xa950('0x20')](handleEntityNotFound(_0x29f27f,null))[_0xa950('0x20')](saveUpdates(_0xcb3b8d[_0xa950('0x57')],null))[_0xa950('0x20')](function(_0x472bb1){if(_0x472bb1){_0x51c195[_0xa950('0x28')]=_0x472bb1[_0xa950('0x62')]({'plain':!![]});return db[_0xa950('0x63')][_0xa950('0x55')]({'where':{'id':_0x472bb1[_0xa950('0x64')]}});}return null;})[_0xa950('0x20')](handleEntityNotFound(_0x29f27f,null))['then'](function(_0x5a2684){if(_0x5a2684){return _0x5a2684[_0xa950('0x58')]({'UserId':_0xcb3b8d[_0xa950('0x57')][_0xa950('0x5e')],'read1stAt':_[_0xa950('0x65')](_0x5a2684[_0xa950('0x66')])?moment()[_0xa950('0x5c')](_0xa950('0x5d')):undefined});}return null;})['then'](function(_0x3e7805){if(_0x3e7805){_0x51c195[_0xa950('0x67')]=_0x3e7805[_0xa950('0x62')]({'plain':!![]});interaction_log[_0xa950('0x21')](_0xa950('0x68'),_0xcb3b8d[_0xa950('0x5f')]['id'],_0xcb3b8d[_0xa950('0x5f')][_0xa950('0x38')],_0xcb3b8d['user'][_0xa950('0x69')],_0x51c195[_0xa950('0x67')]['id'],_0xcb3b8d[_0xa950('0x57')]?JSON[_0xa950('0x25')](_0xcb3b8d[_0xa950('0x57')]):'null');return respondWithRpcPromise(_0xa950('0x6a'),_0xa950('0x6b'),_0x51c195);}return null;})[_0xa950('0x20')](function(_0x2b8fb2){if(_0x2b8fb2){if(_0xcb3b8d[_0xa950('0x57')]['manual']){_0x51c195[_0xa950('0x28')][_0xa950('0x6c')]=util[_0xa950('0x5c')]('SIP/%s',_0xcb3b8d[_0xa950('0x5f')][_0xa950('0x38')]);_0x51c195[_0xa950('0x28')][_0xa950('0x6d')]=_0x51c195['channel'];_0x51c195[_0xa950('0x28')][_0xa950('0x6e')]='accept';return respondWithRpcPromise(_0xa950('0x6f'),_0xa950('0x6f'),{'event':_0xa950('0x70'),'message':_0x51c195[_0xa950('0x28')]},client9002)[_0xa950('0x20')](function(){return _0x51c195;});}return _0x51c195;}return null;})[_0xa950('0x20')](respondWithResult(_0x29f27f,null))[_0xa950('0x2b')](handleError(_0x29f27f,null));};var interaction_log=require(_0xa950('0x71'))(_0xa950('0x72'));exports[_0xa950('0x73')]=function(_0x20b6ff,_0x14fb0c,_0x6e8019){var _0x59ef65={'agent':{},'channel':'sms'};if(_0x20b6ff['body']['id']){delete _0x20b6ff['body']['id'];}_0x20b6ff[_0xa950('0x57')][_0xa950('0x5e')]=_0x20b6ff[_0xa950('0x57')]['UserId']||_0x20b6ff[_0xa950('0x5f')]['id'];_0x59ef65[_0xa950('0x74')]['id']=_0x20b6ff[_0xa950('0x57')][_0xa950('0x5e')];return db[_0xa950('0x4b')][_0xa950('0x55')]({'where':{'id':_0x20b6ff[_0xa950('0x51')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x14fb0c,null))[_0xa950('0x20')](function(_0x1a703b){if(_0x1a703b){_0x59ef65[_0xa950('0x28')]=_0x1a703b[_0xa950('0x62')]({'plain':!![]});return db[_0xa950('0x63')][_0xa950('0x55')]({'where':{'id':_0x1a703b[_0xa950('0x64')]}});}return null;})['then'](handleEntityNotFound(_0x14fb0c,null))[_0xa950('0x20')](function(_0x11fe28){if(_0x11fe28){_0x59ef65['interaction']=_0x11fe28[_0xa950('0x62')]({'plain':!![]});interaction_log[_0xa950('0x21')](_0xa950('0x75'),_0x20b6ff[_0xa950('0x5f')]['id'],_0x20b6ff[_0xa950('0x5f')][_0xa950('0x38')],_0x20b6ff[_0xa950('0x5f')]['role'],_0x59ef65[_0xa950('0x67')]['id'],_0x20b6ff[_0xa950('0x57')]?JSON[_0xa950('0x25')](_0x20b6ff[_0xa950('0x57')]):_0xa950('0x76'));return respondWithRpcPromise(_0xa950('0x77'),'rejectMessage',_0x59ef65);}return null;})[_0xa950('0x20')](function(_0x3759af){if(_0x3759af){_0x3759af['message']['interface']=util['format']('SIP/%s',_0x20b6ff[_0xa950('0x5f')][_0xa950('0x38')]);_0x3759af['message'][_0xa950('0x6d')]=_0x59ef65[_0xa950('0x6d')];_0x3759af['message'][_0xa950('0x6e')]=_0xa950('0x73');respondWithRpcPromise(_0xa950('0x6f'),'EventManager',{'event':'rejectmessage','message':_0x3759af[_0xa950('0x28')]},client9002);return _0x59ef65;}return null;})[_0xa950('0x20')](respondWithResult(_0x14fb0c,null))[_0xa950('0x2b')](handleError(_0x14fb0c,null));};exports[_0xa950('0x2d')]=function(_0x15b969,_0x1b7664,_0x8905c1){if(_0x15b969[_0xa950('0x57')]['id']){delete _0x15b969[_0xa950('0x57')]['id'];}var _0x4370ca;return db[_0xa950('0x4b')][_0xa950('0x55')]({'where':{'id':_0x15b969['params']['id']}})[_0xa950('0x20')](handleEntityNotFound(_0x1b7664,null))['then'](function(_0x1ca7cd){if(_0x1ca7cd){_0x4370ca=_0x1ca7cd;return db[_0xa950('0x78')]['find']({'where':{'id':_0x1ca7cd[_0xa950('0x79')]}});}})[_0xa950('0x20')](handleEntityNotFound(_0x1b7664,null))['then'](function(_0x321495){if(_0x321495){logger[_0xa950('0x23')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xa950('0x2d'),'received\x20delivery\x20report\x20from',_0x321495[_0xa950('0x3c')],util[_0xa950('0x7a')](_0x15b969['body'],{'showHidden':![],'depth':null}));switch(_0x321495[_0xa950('0x3c')]){case _0xa950('0x7b'):if(_0x15b969[_0xa950('0x57')][_0xa950('0x7c')]&&_0x15b969[_0xa950('0x57')][_0xa950('0x7c')]===_0x4370ca[_0xa950('0x7d')]){return _0x4370ca[_0xa950('0x58')]({'read':!![]});}else{logger['error'](_0xa950('0x7e'),_0xa950('0x2d'),_0xa950('0x7b'),util[_0xa950('0x7a')](_0x15b969[_0xa950('0x57')],{'showHidden':![],'depth':null}));}break;case _0xa950('0x7f'):if(_0x15b969['body'][_0xa950('0x80')]&&_0x15b969[_0xa950('0x57')]['MessageUUID']===_0x4370ca['messageId']&&_[_0xa950('0x81')]([_0xa950('0x82'),_0xa950('0x83')],_0x15b969[_0xa950('0x57')]['Status'])>=0x0){return _0x4370ca['update']({'read':!![]});}else{logger[_0xa950('0x26')](_0xa950('0x7e'),_0xa950('0x2d'),_0xa950('0x84'),util[_0xa950('0x7a')](_0x15b969[_0xa950('0x57')],{'showHidden':![],'depth':null}));}break;case _0xa950('0x85'):var _0x32cc2c=_0x15b969['body'][_0xa950('0x86')][0x0];if(_0x32cc2c[_0xa950('0x2d')]['groupName']===_0xa950('0x87')){return _0x4370ca[_0xa950('0x58')]({'read':!![]});}else{logger[_0xa950('0x26')](_0xa950('0x7e'),_0xa950('0x2d'),'infobip',util['inspect'](_0x15b969[_0xa950('0x57')],{'showHidden':![],'depth':null}));}break;}return _0x4370ca;}})[_0xa950('0x20')](respondWithResult(_0x1b7664,null))['catch'](handleError(_0x1b7664,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 5929c1e..b656af8 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 _0x5f2f=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsMessage','setMaxListeners','save','update'];(function(_0x450b48,_0x317d7d){var _0x34f4f8=function(_0x3e7646){while(--_0x3e7646){_0x450b48['push'](_0x450b48['shift']());}};_0x34f4f8(++_0x317d7d);}(_0x5f2f,0x73));var _0xf5f2=function(_0x576b65,_0x3ead27){_0x576b65=_0x576b65-0x0;var _0x2a443a=_0x5f2f[_0x576b65];return _0x2a443a;};'use strict';var EventEmitter=require(_0xf5f2('0x0'));var SmsMessage=require(_0xf5f2('0x1'))['db'][_0xf5f2('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xf5f2('0x3')](0x0);var events={'afterCreate':_0xf5f2('0x4'),'afterUpdate':_0xf5f2('0x5'),'afterDestroy':_0xf5f2('0x6')};function emitEvent(_0x107cf){return function(_0x501fbd,_0x4854b6,_0x1665c7){SmsMessageEvents[_0xf5f2('0x7')](_0x107cf+':'+_0x501fbd['id'],_0x501fbd);SmsMessageEvents[_0xf5f2('0x7')](_0x107cf,_0x501fbd);_0x1665c7(null);};}for(var e in events){if(events[_0xf5f2('0x8')](e)){var event=events[e];SmsMessage[_0xf5f2('0x9')](e,emitEvent(event));}}module[_0xf5f2('0xa')]=SmsMessageEvents; \ No newline at end of file +var _0xdb28=['SmsMessage','setMaxListeners','update','remove','emit','exports','events','../../mysqldb'];(function(_0x1436e1,_0x1d596d){var _0x4d70c1=function(_0xa70bcc){while(--_0xa70bcc){_0x1436e1['push'](_0x1436e1['shift']());}};_0x4d70c1(++_0x1d596d);}(_0xdb28,0x106));var _0x8db2=function(_0x38382e,_0x3a9d2d){_0x38382e=_0x38382e-0x0;var _0x1f4489=_0xdb28[_0x38382e];return _0x1f4489;};'use strict';var EventEmitter=require(_0x8db2('0x0'));var SmsMessage=require(_0x8db2('0x1'))['db'][_0x8db2('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x8db2('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8db2('0x4'),'afterDestroy':_0x8db2('0x5')};function emitEvent(_0xfcf49f){return function(_0x4426fe,_0x11109e,_0x52bf99){SmsMessageEvents[_0x8db2('0x6')](_0xfcf49f+':'+_0x4426fe['id'],_0x4426fe);SmsMessageEvents[_0x8db2('0x6')](_0xfcf49f,_0x4426fe);_0x52bf99(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0x8db2('0x7')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 7f2c984..852d4f5 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 _0x778a=['update','createdAt','catch','SmsAccount','find','SmsAccountId','then','type','twilio','phone','authToken','messages','create','body','/api/sms/messages/','/status?token=','sid','error','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','&password=','GET','split','sms','POST','user_key','session_key','internal_order_id','deliveryReport','inspect','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/send/','requestid','read','Missing\x20parameters:\x20authToken','xCALLY\x20Motion','%s:%s','toString','base64','http_code','data','queued_count','head','clickSend','plivo','authId','token','format','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','baseUrl','remote','application/json','IBSSO\x20','infobip','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','text','timestamp','keys','sort','createHash','digest','signature=','id_sms','Missing\x20parameters:\x20apiKey','clickatell','uuid','UTF-8','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','status','message','refid','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise','../../config/environment','exports','define','sms_messages','messageId','fti_sms_messages','FULLTEXT','models','get','toLowerCase','direction','out','secret','UserId','SmsInteraction','findOne','SmsInteractionId'];(function(_0x4fe10f,_0x20ea39){var _0x26864c=function(_0x1e5c1c){while(--_0x1e5c1c){_0x4fe10f['push'](_0x4fe10f['shift']());}};_0x26864c(++_0x20ea39);}(_0x778a,0xd2));var _0xa778=function(_0x5199d1,_0x3069d9){_0x5199d1=_0x5199d1-0x0;var _0x5d93ea=_0x778a[_0x5199d1];return _0x5d93ea;};'use strict';var _=require(_0xa778('0x0'));var util=require('util');var logger=require(_0xa778('0x1'))('api');var moment=require(_0xa778('0x2'));var BPromise=require(_0xa778('0x3'));var rp=require(_0xa778('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa778('0x5'));var attributes=require('./smsMessage.attributes');module[_0xa778('0x6')]=function(_0x28924b,_0x4ca8ca){return _0x28924b[_0xa778('0x7')]('SmsMessage',attributes,{'tableName':_0xa778('0x8'),'paranoid':![],'indexes':[{'name':_0xa778('0x9'),'fields':[_0xa778('0x9')]},{'name':_0xa778('0xa'),'fields':['body'],'type':_0xa778('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xb9033f,_0x319946,_0x1d7784){var _0x448121=_0x28924b[_0xa778('0xc')];var _0x139c1d=_0xb9033f[_0xa778('0xd')]({'plain':!![]});if(_0x139c1d['direction'][_0xa778('0xe')]()==='in'||_0x139c1d[_0xa778('0xf')][_0xa778('0xe')]()===_0xa778('0x10')&&!_0x139c1d[_0xa778('0x11')]&&!_['isNil'](_0x139c1d[_0xa778('0x12')])){_0x448121[_0xa778('0x13')][_0xa778('0x14')]({'where':{'id':_0x139c1d[_0xa778('0x15')]}})['then'](function(_0x497ed1){if(_0x497ed1){_0x497ed1[_0xa778('0x16')]({'lastMsgAt':_0x139c1d[_0xa778('0x17')],'lastMsgDirection':_0x139c1d[_0xa778('0xf')]['toLowerCase']()});}})[_0xa778('0x18')](function(_0x1e9540){console['error'](_0x1e9540);});}if(_0x139c1d[_0xa778('0xf')]===_0xa778('0x10')&&!_0x139c1d[_0xa778('0x11')]){var _0x43115c;_0x448121[_0xa778('0x19')][_0xa778('0x1a')]({'where':{'id':_0x139c1d[_0xa778('0x1b')]},'raw':!![]})[_0xa778('0x1c')](function(_0x3d7539){_0x43115c=_0x3d7539;if(_0x43115c&&_0x43115c[_0xa778('0x1d')]){switch(_0x43115c[_0xa778('0x1d')]){case _0xa778('0x1e'):var _0x124eb5=require(_0xa778('0x1e'));if(_0x43115c['accountSid']&&_0x43115c['authToken']&&_0x43115c[_0xa778('0x1f')]){var _0x54fe07=new _0x124eb5(_0x43115c['accountSid'],_0x43115c[_0xa778('0x20')]);_0x54fe07[_0xa778('0x21')][_0xa778('0x22')]({'body':_0x139c1d[_0xa778('0x23')],'to':_0x139c1d[_0xa778('0x1f')],'from':_0x43115c[_0xa778('0x1f')],'statusCallback':_0x43115c['remote']+_0xa778('0x24')+_0x139c1d['id']+_0xa778('0x25')+_0x43115c['token']})[_0xa778('0x1c')](function(_0x26a0c5){if(_0x26a0c5[_0xa778('0x26')]){return _0xb9033f[_0xa778('0x16')]({'messageId':_0x26a0c5['sid']});}})[_0xa778('0x18')](function(_0x3e19cd){logger[_0xa778('0x27')](_0xa778('0x28'),'afterCreate','twilio',util['inspect'](_0x3e19cd,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xa778('0x28'),_0xa778('0x29'),'twilio',_0xa778('0x2a'));}break;case _0xa778('0x2b'):var _0x3ce247=_0xa778('0x2c');if(_0x43115c[_0xa778('0x2d')]&&_0x43115c[_0xa778('0x2e')]){var _0xca547d={'recipient':[_0x139c1d[_0xa778('0x1f')]],'message':_0x139c1d[_0xa778('0x23')],'message_type':_0x43115c[_0xa778('0x2f')]};if(_0x43115c[_0xa778('0x2f')]&&_0x43115c[_0xa778('0x2f')]!=='SI'){_0xca547d[_0xa778('0x30')]=_0x43115c[_0xa778('0x1f')];}var _0x3ee4d9={'url':_0x3ce247+_0xa778('0x31')+_0x43115c['username']+_0xa778('0x32')+_0x43115c[_0xa778('0x2e')],'method':_0xa778('0x33')};rp(_0x3ee4d9)[_0xa778('0x1c')](function(_0x52c960){var _0x3444bf=_0x52c960[_0xa778('0x34')](';');var _0x40bfe3={'user_key':_0x3444bf[0x0],'session_key':_0x3444bf[0x1]};_0x3ee4d9={'url':_0x3ce247+_0xa778('0x35'),'method':_0xa778('0x36'),'headers':{'user_key':_0x40bfe3[_0xa778('0x37')],'Session_key':_0x40bfe3[_0xa778('0x38')]},'json':!![],'body':_0xca547d};return rp(_0x3ee4d9);})[_0xa778('0x1c')](function(_0x219859){if(_0x219859['total_sent']>=0x1){var _0x3f4a69={'messageId':_0x219859[_0xa778('0x39')]};if(_0x43115c[_0xa778('0x2f')]!=='GP'||!_0x43115c[_0xa778('0x3a')]){_0x3f4a69['read']=!![];}return _0xb9033f[_0xa778('0x16')](_0x3f4a69);}else{return logger['error'](_0xa778('0x28'),_0xa778('0x29'),_0xa778('0x2b'),util[_0xa778('0x3b')](_0x219859,{'showHidden':![],'depth':null}));}})['catch'](function(_0xd98a67){return logger[_0xa778('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xa778('0x29'),_0xa778('0x2b'),util['inspect'](_0xd98a67,{'showHidden':![],'depth':null}));});}else{logger[_0xa778('0x27')](_0xa778('0x28'),_0xa778('0x29'),_0xa778('0x2b'),_0xa778('0x3c'));}break;case _0xa778('0x3d'):if(_0x43115c[_0xa778('0x20')]){var _0xc3b7a9={'recipient':_0x139c1d[_0xa778('0x1f')],'message':_0x139c1d[_0xa778('0x23')],'sender':_0x43115c[_0xa778('0x3e')]||_0x43115c[_0xa778('0x1f')],'authorization':_0x43115c[_0xa778('0x20')]};var _0x319946={'method':_0xa778('0x36'),'uri':_0xa778('0x3f'),'body':_0xc3b7a9,'json':!![]};rp(_0x319946)[_0xa778('0x1c')](function(_0x23cbf5){var _0x3c068e={'messageId':_0x23cbf5[_0xa778('0x40')]};if(!_0x43115c['deliveryReport']){_0x3c068e[_0xa778('0x41')]=!![];}return _0xb9033f[_0xa778('0x16')](_0x3c068e);})[_0xa778('0x18')](function(_0x4ee2e6){logger['error'](_0xa778('0x28'),_0xa778('0x29'),'connectel',util['inspect'](_0x4ee2e6,{'showHidden':![],'depth':null}));});}else{logger[_0xa778('0x27')](_0xa778('0x28'),_0xa778('0x29'),_0xa778('0x3d'),_0xa778('0x42'));}break;case'clicksend':if(_0x43115c[_0xa778('0x2d')]&&_0x43115c[_0xa778('0x2e')]){var _0xc3b7a9={'messages':[{'source':_0xa778('0x43'),'to':_0x139c1d[_0xa778('0x1f')],'body':_0x139c1d[_0xa778('0x23')],'from':_0x43115c['senderString']||_0x43115c[_0xa778('0x1f')]}]};var _0x3a0960=util['format'](_0xa778('0x44'),_0x43115c[_0xa778('0x2d')],_0x43115c[_0xa778('0x2e')]);var _0x319946={'method':_0xa778('0x36'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0xc3b7a9,'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(_0x3a0960)[_0xa778('0x45')](_0xa778('0x46')))},'json':!![]};rp(_0x319946)['then'](function(_0x99660d){if(_0x99660d['http_code']>=0xc8&&_0x99660d[_0xa778('0x47')]<=0xce){if(_0x99660d['data']&&_0x99660d[_0xa778('0x48')][_0xa778('0x49')]>0x0){var _0x5b28f2=_[_0xa778('0x4a')](_0x99660d[_0xa778('0x48')][_0xa778('0x21')]);var _0x789448={'messageId':_0x5b28f2['message_id']};if(!_0x43115c[_0xa778('0x3a')]){_0x789448[_0xa778('0x41')]=!![];}return _0xb9033f[_0xa778('0x16')](_0x789448);}else{logger['error'](_0xa778('0x28'),_0xa778('0x29'),'clickSend',util[_0xa778('0x3b')](_0x99660d,{'showHidden':![],'depth':null}));}}else{logger[_0xa778('0x27')](_0xa778('0x28'),_0xa778('0x29'),'clickSend',util['inspect'](_0x99660d,{'showHidden':![],'depth':null}));}})[_0xa778('0x18')](function(_0x9d321f){logger['error'](_0xa778('0x28'),_0xa778('0x29'),_0xa778('0x4b'),util[_0xa778('0x3b')](_0x9d321f,{'showHidden':![],'depth':null}));});}else{logger[_0xa778('0x27')](_0xa778('0x28'),_0xa778('0x29'),_0xa778('0x4b'),_0xa778('0x3c'));}break;case _0xa778('0x4c'):if(_0x43115c[_0xa778('0x4d')]&&_0x43115c[_0xa778('0x20')]){var _0xc3b7a9={'dst':_0x139c1d[_0xa778('0x1f')],'text':_0x139c1d['body'],'src':_0x43115c[_0xa778('0x3e')]||_0x43115c[_0xa778('0x1f')],'url':_0x43115c['remote']+_0xa778('0x24')+_0x139c1d['id']+_0xa778('0x25')+_0x43115c[_0xa778('0x4e')]};var _0x3a0960=util[_0xa778('0x4f')]('%s:%s',_0x43115c[_0xa778('0x4d')],_0x43115c[_0xa778('0x20')]);var _0x319946={'method':_0xa778('0x36'),'uri':util[_0xa778('0x4f')](_0xa778('0x50'),_0x43115c[_0xa778('0x4d')]),'body':_0xc3b7a9,'headers':{'Authorization':util[_0xa778('0x4f')]('Basic\x20%s',new Buffer(_0x3a0960)[_0xa778('0x45')](_0xa778('0x46')))},'json':!![]};rp(_0x319946)[_0xa778('0x1c')](function(_0x167db8){var _0x77491d={'messageId':_0x167db8[_0xa778('0x51')][0x0]};return _0xb9033f[_0xa778('0x16')](_0x77491d);})[_0xa778('0x18')](function(_0x2d3c98){logger['error'](_0xa778('0x28'),'afterCreate',_0xa778('0x4c'),util[_0xa778('0x3b')](_0x2d3c98,{'showHidden':![],'depth':null}));});}else{logger[_0xa778('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xa778('0x29'),_0xa778('0x4c'),_0xa778('0x52'));}break;case'infobip':if(_0x43115c[_0xa778('0x2d')]&&_0x43115c[_0xa778('0x2e')]){if(_0x43115c[_0xa778('0x53')]){var _0x16aa9c={'method':_0xa778('0x36'),'uri':_0x43115c[_0xa778('0x53')]+'/auth/1/session','body':{'username':_0x43115c[_0xa778('0x2d')],'password':_0x43115c[_0xa778('0x2e')]},'json':!![]};return rp(_0x16aa9c)[_0xa778('0x1c')](function(_0x5062fe){var _0x4e49e0={'method':_0xa778('0x36'),'uri':_0x43115c[_0xa778('0x53')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x43115c[_0xa778('0x1f')],'destinations':[{'to':_0x139c1d[_0xa778('0x1f')]}],'text':_0x139c1d['body'],'notifyUrl':_0x43115c[_0xa778('0x54')]+_0xa778('0x24')+_0x139c1d['id']+'/status?token='+_0x43115c[_0xa778('0x4e')],'notifyContentType':_0xa778('0x55'),'callbackData':_0x43115c[_0xa778('0x1f')]+';'+_0x139c1d[_0xa778('0x23')]}]},'headers':{'Authorization':_0xa778('0x56')+_0x5062fe[_0xa778('0x4e')]},'json':!![]};return rp(_0x4e49e0)[_0xa778('0x1c')](function(_0x31fbc2){if(_0x31fbc2[_0xa778('0x21')]){var _0x1895bd={'messageId':_0x31fbc2[_0xa778('0x21')][0x0][_0xa778('0x9')]};if(!_0x43115c['deliveryReport']){_0x1895bd['read']=!![];}return _0xb9033f[_0xa778('0x16')](_0x1895bd);}else{return logger[_0xa778('0x27')](_0xa778('0x28'),'afterCreate',_0xa778('0x57'),util['inspect'](_0x31fbc2,{'showHidden':![],'depth':null}));}});})[_0xa778('0x18')](function(_0x1012f9){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xa778('0x29'),_0xa778('0x57'),util[_0xa778('0x3b')](_0x1012f9,{'showHidden':![],'depth':null}));});}else{logger[_0xa778('0x27')](_0xa778('0x28'),'afterCreate','infobip',_0xa778('0x58'));}}else{logger[_0xa778('0x27')](_0xa778('0x28'),_0xa778('0x29'),_0xa778('0x57'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xa778('0x59'):var _0x2d3699=require(_0xa778('0x5a'));if(_0x43115c[_0xa778('0x5b')]){var _0x1669a7={};_0x1669a7[_0xa778('0x5c')]=_0x43115c['username'];_0x1669a7[_0xa778('0x1f')]=_0x139c1d[_0xa778('0x1f')];_0x1669a7[_0xa778('0x30')]=_0x43115c['phone'];_0x1669a7[_0xa778('0x5d')]=_0x139c1d[_0xa778('0x23')];_0x1669a7[_0xa778('0x5e')]=+new Date();var _0x1ee572='';var _0x406e3a='';var _0x5ec3c2=Object[_0xa778('0x5f')](_0x1669a7);_0x5ec3c2[_0xa778('0x60')]();for(var _0x455c97=0x0;_0x455c97<_0x5ec3c2['length'];_0x455c97++){if(_0x1ee572!=''){_0x1ee572+='&';}_0x1ee572+=_0x5ec3c2[_0x455c97]+'='+encodeURIComponent(_0x1669a7[_0x5ec3c2[_0x455c97]]);_0x406e3a+=_0x1669a7[_0x5ec3c2[_0x455c97]];}_0x406e3a+=_0x43115c[_0xa778('0x5b')];_0x406e3a=_0x2d3699[_0xa778('0x61')]('md5')[_0xa778('0x16')](_0x406e3a)[_0xa778('0x62')]('hex');if(_0x1ee572!==''){_0x1ee572+='&';}_0x1ee572+=_0xa778('0x63')+_0x406e3a;var _0x3ee4d9={'method':_0xa778('0x33'),'uri':'https://sms.csc.lv/external/get/send.php?'+_0x1ee572,'json':!![]};return rp(_0x3ee4d9)[_0xa778('0x1c')](function(_0x1efb7f){var _0x536dfa=Object[_0xa778('0x5f')](_0x1efb7f);if(_0x1efb7f[_0x536dfa[0x0]][_0xa778('0x27')]&&parseInt(_0x1efb7f[_0x536dfa[0x0]][_0xa778('0x27')])===0x0){var _0x10dbd3={'messageId':_0x1efb7f[_0x536dfa[0x0]][_0xa778('0x64')]};if(!_0x43115c[_0xa778('0x3a')]){_0x10dbd3[_0xa778('0x41')]=!![];}return _0xb9033f[_0xa778('0x16')](_0x10dbd3);}else{return logger['error'](_0xa778('0x28'),_0xa778('0x29'),_0xa778('0x59'),util['inspect'](_0x1efb7f['error'],{'showHidden':![],'depth':null}));}})['catch'](function(_0x46f557){return logger[_0xa778('0x27')](_0xa778('0x28'),_0xa778('0x29'),_0xa778('0x59'),util[_0xa778('0x3b')](_0x46f557,{'showHidden':![],'depth':null}));});}else{logger[_0xa778('0x27')](_0xa778('0x28'),_0xa778('0x29'),'csc',_0xa778('0x65'));}break;case _0xa778('0x66'):if(_0x43115c[_0xa778('0x5b')]){var _0x362bee={'method':_0xa778('0x36'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x43115c[_0xa778('0x5b')]},'body':{'content':_0x139c1d[_0xa778('0x23')],'to':[_0x139c1d['phone']],'from':_0x43115c['phone'],'binary':![],'clientMessageId':_0xa778('0x67'),'charset':_0xa778('0x68')},'json':!![]};rp(_0x362bee)[_0xa778('0x1c')](function(_0x369695){if(!_0x369695['error']){var _0x592b6f={'messageId':_0x369695[_0xa778('0x21')][0x0]['apiMessageId']};if(!_0x43115c[_0xa778('0x3a')]){_0x592b6f[_0xa778('0x41')]=!![];}return _0xb9033f[_0xa778('0x16')](_0x592b6f);}else{return logger[_0xa778('0x27')](_0xa778('0x28'),'afterCreate',_0xa778('0x66'),util[_0xa778('0x3b')](_0x369695[_0xa778('0x27')],{'showHidden':![],'depth':null}));}})[_0xa778('0x18')](function(_0x463c94){return logger[_0xa778('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xa778('0x29'),_0xa778('0x66'),util[_0xa778('0x3b')](_0x463c94,{'showHidden':![],'depth':null}));});}else{logger[_0xa778('0x27')](_0xa778('0x28'),_0xa778('0x29'),_0xa778('0x66'),'Missing\x20parameters:\x20apiKey');}break;case _0xa778('0x69'):if(_0x43115c['apiKey']){var _0x336247={};var _0x3ee4d9={'method':_0xa778('0x36'),'uri':_0xa778('0x6a'),'headers':{'Authorization':_0xa778('0x6b')+_0x43115c[_0xa778('0x5b')],'Content-Type':_0xa778('0x55')},'body':{'from':_0x43115c[_0xa778('0x1f')],'to':_0x139c1d[_0xa778('0x1f')],'text':_0x139c1d[_0xa778('0x23')]},'json':!![]};return rp(_0x3ee4d9)[_0xa778('0x1c')](function(_0x3ad1e8){if(_0x3ad1e8[_0xa778('0x6c')]==0xca){_0x336247['message']=_0x3ad1e8;var _0x302b77={'method':_0xa778('0x36'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0xa778('0x6b')+_0x43115c['apiKey'],'Content-Type':_0xa778('0x55')},'body':{'refid':_0x336247['message']['refid']},'json':!![]};return rp(_0x302b77)['then'](function(_0x5a06bc){_0x336247[_0xa778('0x6d')]=_0x5a06bc;var _0x4216dc={'messageId':_0x336247[_0xa778('0x6e')][_0xa778('0x6f')],'read':!![]};return _0xb9033f[_0xa778('0x16')](_0x4216dc);});}else{return logger[_0xa778('0x27')](_0xa778('0x28'),'afterCreate',_0xa778('0x69'),util[_0xa778('0x3b')](_0x3ad1e8,{'showHidden':![],'depth':null}));}})[_0xa778('0x18')](function(_0x3f1b41){return logger[_0xa778('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xa778('0x29'),_0xa778('0x69'),util['inspect'](_0x3f1b41,{'showHidden':![],'depth':null}));});}else{return logger[_0xa778('0x27')](_0xa778('0x28'),'afterCreate',_0xa778('0x69'),_0xa778('0x70'));}break;}}})[_0xa778('0x71')](function(){_0x1d7784();});}else{_0x1d7784();}}},'charset':_0xa778('0x72'),'collate':_0xa778('0x73')});}; \ No newline at end of file +var _0xfc64=['Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','token','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','sender','keys','sort','length','createHash','md5','digest','signature=','GET','id_sms','clickatell','uuid','UTF-8','Missing\x20parameters:\x20apiKey','Bearer\x20','message','application/json','refid','status','intelepeer','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','body','FULLTEXT','models','get','direction','out','secret','UserId','SmsInteraction','findOne','createdAt','toLowerCase','catch','error','SmsAccount','find','then','twilio','accountSid','authToken','phone','create','remote','/api/sms/messages/','/status?token=','update','inspect','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','login?username=','split','sms','session_key','total_sent','deliveryReport','read','Missing\x20parameters:\x20username,\x20password','connectel','senderString','POST','https://smsapi.connectel.se/api/send/','requestid','Missing\x20parameters:\x20authToken','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','data','queued_count','head','messages','clickSend','authId','message_uuid'];(function(_0x5e963d,_0x4cf4cc){var _0x34e4a5=function(_0x3f16a2){while(--_0x3f16a2){_0x5e963d['push'](_0x5e963d['shift']());}};_0x34e4a5(++_0x4cf4cc);}(_0xfc64,0xfd));var _0x4fc6=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xfc64[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x4fc6('0x0'));var util=require(_0x4fc6('0x1'));var logger=require('../../config/logger')(_0x4fc6('0x2'));var moment=require(_0x4fc6('0x3'));var BPromise=require(_0x4fc6('0x4'));var rp=require(_0x4fc6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4fc6('0x6'));var config=require(_0x4fc6('0x7'));var attributes=require(_0x4fc6('0x8'));module[_0x4fc6('0x9')]=function(_0x53217a,_0x50fe34){return _0x53217a[_0x4fc6('0xa')](_0x4fc6('0xb'),attributes,{'tableName':_0x4fc6('0xc'),'paranoid':![],'indexes':[{'name':_0x4fc6('0xd'),'fields':[_0x4fc6('0xd')]},{'name':'fti_sms_messages','fields':[_0x4fc6('0xe')],'type':_0x4fc6('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1aec80,_0x9d47e7,_0x2176ad){var _0x1f1f49=_0x53217a[_0x4fc6('0x10')];var _0xf53bfb=_0x1aec80[_0x4fc6('0x11')]({'plain':!![]});if(_0xf53bfb[_0x4fc6('0x12')]['toLowerCase']()==='in'||_0xf53bfb[_0x4fc6('0x12')]['toLowerCase']()===_0x4fc6('0x13')&&!_0xf53bfb[_0x4fc6('0x14')]&&!_['isNil'](_0xf53bfb[_0x4fc6('0x15')])){_0x1f1f49[_0x4fc6('0x16')][_0x4fc6('0x17')]({'where':{'id':_0xf53bfb['SmsInteractionId']}})['then'](function(_0x39df42){if(_0x39df42){_0x39df42['update']({'lastMsgAt':_0xf53bfb[_0x4fc6('0x18')],'lastMsgDirection':_0xf53bfb[_0x4fc6('0x12')][_0x4fc6('0x19')]()});}})[_0x4fc6('0x1a')](function(_0x5b629e){console[_0x4fc6('0x1b')](_0x5b629e);});}if(_0xf53bfb['direction']===_0x4fc6('0x13')&&!_0xf53bfb[_0x4fc6('0x14')]){var _0x52b9ab;_0x1f1f49[_0x4fc6('0x1c')][_0x4fc6('0x1d')]({'where':{'id':_0xf53bfb['SmsAccountId']},'raw':!![]})[_0x4fc6('0x1e')](function(_0x321686){_0x52b9ab=_0x321686;if(_0x52b9ab&&_0x52b9ab['type']){switch(_0x52b9ab['type']){case _0x4fc6('0x1f'):var _0x2fb64e=require(_0x4fc6('0x1f'));if(_0x52b9ab[_0x4fc6('0x20')]&&_0x52b9ab[_0x4fc6('0x21')]&&_0x52b9ab[_0x4fc6('0x22')]){var _0x15d4e8=new _0x2fb64e(_0x52b9ab[_0x4fc6('0x20')],_0x52b9ab[_0x4fc6('0x21')]);_0x15d4e8['messages'][_0x4fc6('0x23')]({'body':_0xf53bfb[_0x4fc6('0xe')],'to':_0xf53bfb['phone'],'from':_0x52b9ab[_0x4fc6('0x22')],'statusCallback':_0x52b9ab[_0x4fc6('0x24')]+_0x4fc6('0x25')+_0xf53bfb['id']+_0x4fc6('0x26')+_0x52b9ab['token']})['then'](function(_0x16036e){if(_0x16036e['sid']){return _0x1aec80[_0x4fc6('0x27')]({'messageId':_0x16036e['sid']});}})[_0x4fc6('0x1a')](function(_0x4762ec){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x4fc6('0x1f'),util[_0x4fc6('0x28')](_0x4762ec,{'showHidden':![],'depth':null}));});}else{logger[_0x4fc6('0x1b')](_0x4fc6('0x29'),_0x4fc6('0x2a'),_0x4fc6('0x1f'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x4fc6('0x2b'):var _0x36b1e1=_0x4fc6('0x2c');if(_0x52b9ab[_0x4fc6('0x2d')]&&_0x52b9ab[_0x4fc6('0x2e')]){var _0x504756={'recipient':[_0xf53bfb['phone']],'message':_0xf53bfb[_0x4fc6('0xe')],'message_type':_0x52b9ab[_0x4fc6('0x2f')]};if(_0x52b9ab['smsMethod']&&_0x52b9ab[_0x4fc6('0x2f')]!=='SI'){_0x504756['sender']=_0x52b9ab[_0x4fc6('0x22')];}var _0x30ebff={'url':_0x36b1e1+_0x4fc6('0x30')+_0x52b9ab['username']+'&password='+_0x52b9ab[_0x4fc6('0x2e')],'method':'GET'};rp(_0x30ebff)[_0x4fc6('0x1e')](function(_0x5e6776){var _0x2265d0=_0x5e6776[_0x4fc6('0x31')](';');var _0x1be76e={'user_key':_0x2265d0[0x0],'session_key':_0x2265d0[0x1]};_0x30ebff={'url':_0x36b1e1+_0x4fc6('0x32'),'method':'POST','headers':{'user_key':_0x1be76e['user_key'],'Session_key':_0x1be76e[_0x4fc6('0x33')]},'json':!![],'body':_0x504756};return rp(_0x30ebff);})[_0x4fc6('0x1e')](function(_0x16b8d8){if(_0x16b8d8[_0x4fc6('0x34')]>=0x1){var _0x1580df={'messageId':_0x16b8d8['internal_order_id']};if(_0x52b9ab[_0x4fc6('0x2f')]!=='GP'||!_0x52b9ab[_0x4fc6('0x35')]){_0x1580df[_0x4fc6('0x36')]=!![];}return _0x1aec80[_0x4fc6('0x27')](_0x1580df);}else{return logger[_0x4fc6('0x1b')](_0x4fc6('0x29'),'afterCreate','skebby',util[_0x4fc6('0x28')](_0x16b8d8,{'showHidden':![],'depth':null}));}})['catch'](function(_0x112d2b){return logger[_0x4fc6('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4fc6('0x2a'),_0x4fc6('0x2b'),util['inspect'](_0x112d2b,{'showHidden':![],'depth':null}));});}else{logger[_0x4fc6('0x1b')](_0x4fc6('0x29'),_0x4fc6('0x2a'),_0x4fc6('0x2b'),_0x4fc6('0x37'));}break;case _0x4fc6('0x38'):if(_0x52b9ab[_0x4fc6('0x21')]){var _0x15c985={'recipient':_0xf53bfb['phone'],'message':_0xf53bfb[_0x4fc6('0xe')],'sender':_0x52b9ab[_0x4fc6('0x39')]||_0x52b9ab[_0x4fc6('0x22')],'authorization':_0x52b9ab[_0x4fc6('0x21')]};var _0x9d47e7={'method':_0x4fc6('0x3a'),'uri':_0x4fc6('0x3b'),'body':_0x15c985,'json':!![]};rp(_0x9d47e7)[_0x4fc6('0x1e')](function(_0x36076b){var _0x4908c1={'messageId':_0x36076b[_0x4fc6('0x3c')]};if(!_0x52b9ab['deliveryReport']){_0x4908c1[_0x4fc6('0x36')]=!![];}return _0x1aec80[_0x4fc6('0x27')](_0x4908c1);})[_0x4fc6('0x1a')](function(_0x294067){logger[_0x4fc6('0x1b')](_0x4fc6('0x29'),_0x4fc6('0x2a'),_0x4fc6('0x38'),util['inspect'](_0x294067,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x4fc6('0x29'),'afterCreate','connectel',_0x4fc6('0x3d'));}break;case'clicksend':if(_0x52b9ab[_0x4fc6('0x2d')]&&_0x52b9ab[_0x4fc6('0x2e')]){var _0x15c985={'messages':[{'source':_0x4fc6('0x3e'),'to':_0xf53bfb[_0x4fc6('0x22')],'body':_0xf53bfb[_0x4fc6('0xe')],'from':_0x52b9ab[_0x4fc6('0x39')]||_0x52b9ab[_0x4fc6('0x22')]}]};var _0x2ececb=util[_0x4fc6('0x3f')](_0x4fc6('0x40'),_0x52b9ab[_0x4fc6('0x2d')],_0x52b9ab[_0x4fc6('0x2e')]);var _0x9d47e7={'method':_0x4fc6('0x3a'),'uri':_0x4fc6('0x41'),'body':_0x15c985,'headers':{'Authorization':util['format'](_0x4fc6('0x42'),new Buffer(_0x2ececb)[_0x4fc6('0x43')](_0x4fc6('0x44')))},'json':!![]};rp(_0x9d47e7)[_0x4fc6('0x1e')](function(_0x4a7e38){if(_0x4a7e38[_0x4fc6('0x45')]>=0xc8&&_0x4a7e38[_0x4fc6('0x45')]<=0xce){if(_0x4a7e38['data']&&_0x4a7e38[_0x4fc6('0x46')][_0x4fc6('0x47')]>0x0){var _0x25f1bb=_[_0x4fc6('0x48')](_0x4a7e38[_0x4fc6('0x46')][_0x4fc6('0x49')]);var _0x1841bb={'messageId':_0x25f1bb['message_id']};if(!_0x52b9ab['deliveryReport']){_0x1841bb[_0x4fc6('0x36')]=!![];}return _0x1aec80[_0x4fc6('0x27')](_0x1841bb);}else{logger['error'](_0x4fc6('0x29'),_0x4fc6('0x2a'),_0x4fc6('0x4a'),util[_0x4fc6('0x28')](_0x4a7e38,{'showHidden':![],'depth':null}));}}else{logger[_0x4fc6('0x1b')](_0x4fc6('0x29'),_0x4fc6('0x2a'),_0x4fc6('0x4a'),util['inspect'](_0x4a7e38,{'showHidden':![],'depth':null}));}})[_0x4fc6('0x1a')](function(_0x509a6e){logger[_0x4fc6('0x1b')](_0x4fc6('0x29'),_0x4fc6('0x2a'),_0x4fc6('0x4a'),util['inspect'](_0x509a6e,{'showHidden':![],'depth':null}));});}else{logger[_0x4fc6('0x1b')](_0x4fc6('0x29'),_0x4fc6('0x2a'),'clickSend',_0x4fc6('0x37'));}break;case'plivo':if(_0x52b9ab[_0x4fc6('0x4b')]&&_0x52b9ab[_0x4fc6('0x21')]){var _0x15c985={'dst':_0xf53bfb['phone'],'text':_0xf53bfb[_0x4fc6('0xe')],'src':_0x52b9ab[_0x4fc6('0x39')]||_0x52b9ab[_0x4fc6('0x22')],'url':_0x52b9ab[_0x4fc6('0x24')]+_0x4fc6('0x25')+_0xf53bfb['id']+_0x4fc6('0x26')+_0x52b9ab['token']};var _0x2ececb=util[_0x4fc6('0x3f')](_0x4fc6('0x40'),_0x52b9ab['authId'],_0x52b9ab[_0x4fc6('0x21')]);var _0x9d47e7={'method':_0x4fc6('0x3a'),'uri':util[_0x4fc6('0x3f')]('https://api.plivo.com/v1/Account/%s/Message/',_0x52b9ab[_0x4fc6('0x4b')]),'body':_0x15c985,'headers':{'Authorization':util['format'](_0x4fc6('0x42'),new Buffer(_0x2ececb)[_0x4fc6('0x43')]('base64'))},'json':!![]};rp(_0x9d47e7)[_0x4fc6('0x1e')](function(_0x4beadb){var _0x26badd={'messageId':_0x4beadb[_0x4fc6('0x4c')][0x0]};return _0x1aec80[_0x4fc6('0x27')](_0x26badd);})[_0x4fc6('0x1a')](function(_0xa14ef4){logger[_0x4fc6('0x1b')](_0x4fc6('0x29'),'afterCreate','plivo',util[_0x4fc6('0x28')](_0xa14ef4,{'showHidden':![],'depth':null}));});}else{logger[_0x4fc6('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4fc6('0x2a'),'plivo',_0x4fc6('0x4d'));}break;case _0x4fc6('0x4e'):if(_0x52b9ab['username']&&_0x52b9ab['password']){if(_0x52b9ab[_0x4fc6('0x4f')]){var _0x3fabd7={'method':_0x4fc6('0x3a'),'uri':_0x52b9ab['baseUrl']+_0x4fc6('0x50'),'body':{'username':_0x52b9ab[_0x4fc6('0x2d')],'password':_0x52b9ab['password']},'json':!![]};return rp(_0x3fabd7)['then'](function(_0x48d7c1){var _0x3d9fc3={'method':_0x4fc6('0x3a'),'uri':_0x52b9ab['baseUrl']+_0x4fc6('0x51'),'body':{'messages':[{'from':_0x52b9ab[_0x4fc6('0x22')],'destinations':[{'to':_0xf53bfb['phone']}],'text':_0xf53bfb[_0x4fc6('0xe')],'notifyUrl':_0x52b9ab['remote']+_0x4fc6('0x25')+_0xf53bfb['id']+_0x4fc6('0x26')+_0x52b9ab[_0x4fc6('0x52')],'notifyContentType':'application/json','callbackData':_0x52b9ab[_0x4fc6('0x22')]+';'+_0xf53bfb[_0x4fc6('0xe')]}]},'headers':{'Authorization':_0x4fc6('0x53')+_0x48d7c1[_0x4fc6('0x52')]},'json':!![]};return rp(_0x3d9fc3)[_0x4fc6('0x1e')](function(_0x34535c){if(_0x34535c['messages']){var _0x21ad8a={'messageId':_0x34535c[_0x4fc6('0x49')][0x0][_0x4fc6('0xd')]};if(!_0x52b9ab['deliveryReport']){_0x21ad8a['read']=!![];}return _0x1aec80[_0x4fc6('0x27')](_0x21ad8a);}else{return logger[_0x4fc6('0x1b')](_0x4fc6('0x29'),_0x4fc6('0x2a'),_0x4fc6('0x4e'),util[_0x4fc6('0x28')](_0x34535c,{'showHidden':![],'depth':null}));}});})[_0x4fc6('0x1a')](function(_0x269e66){return logger[_0x4fc6('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4fc6('0x2a'),_0x4fc6('0x4e'),util['inspect'](_0x269e66,{'showHidden':![],'depth':null}));});}else{logger[_0x4fc6('0x1b')](_0x4fc6('0x29'),'afterCreate',_0x4fc6('0x4e'),_0x4fc6('0x54'));}}else{logger[_0x4fc6('0x1b')](_0x4fc6('0x29'),_0x4fc6('0x2a'),_0x4fc6('0x4e'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x4fc6('0x55'):var _0x5061d8=require(_0x4fc6('0x56'));if(_0x52b9ab[_0x4fc6('0x57')]){var _0x4c7592={};_0x4c7592[_0x4fc6('0x58')]=_0x52b9ab[_0x4fc6('0x2d')];_0x4c7592['phone']=_0xf53bfb[_0x4fc6('0x22')];_0x4c7592[_0x4fc6('0x59')]=_0x52b9ab[_0x4fc6('0x22')];_0x4c7592['text']=_0xf53bfb[_0x4fc6('0xe')];_0x4c7592['timestamp']=+new Date();var _0x154d1e='';var _0x152092='';var _0x55f357=Object[_0x4fc6('0x5a')](_0x4c7592);_0x55f357[_0x4fc6('0x5b')]();for(var _0x97d7ce=0x0;_0x97d7ce<_0x55f357[_0x4fc6('0x5c')];_0x97d7ce++){if(_0x154d1e!=''){_0x154d1e+='&';}_0x154d1e+=_0x55f357[_0x97d7ce]+'='+encodeURIComponent(_0x4c7592[_0x55f357[_0x97d7ce]]);_0x152092+=_0x4c7592[_0x55f357[_0x97d7ce]];}_0x152092+=_0x52b9ab['apiKey'];_0x152092=_0x5061d8[_0x4fc6('0x5d')](_0x4fc6('0x5e'))[_0x4fc6('0x27')](_0x152092)[_0x4fc6('0x5f')]('hex');if(_0x154d1e!==''){_0x154d1e+='&';}_0x154d1e+=_0x4fc6('0x60')+_0x152092;var _0x30ebff={'method':_0x4fc6('0x61'),'uri':'https://sms.csc.lv/external/get/send.php?'+_0x154d1e,'json':!![]};return rp(_0x30ebff)['then'](function(_0xbc40c9){var _0x427208=Object['keys'](_0xbc40c9);if(_0xbc40c9[_0x427208[0x0]][_0x4fc6('0x1b')]&&parseInt(_0xbc40c9[_0x427208[0x0]][_0x4fc6('0x1b')])===0x0){var _0x49c171={'messageId':_0xbc40c9[_0x427208[0x0]][_0x4fc6('0x62')]};if(!_0x52b9ab[_0x4fc6('0x35')]){_0x49c171[_0x4fc6('0x36')]=!![];}return _0x1aec80[_0x4fc6('0x27')](_0x49c171);}else{return logger[_0x4fc6('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x4fc6('0x55'),util[_0x4fc6('0x28')](_0xbc40c9['error'],{'showHidden':![],'depth':null}));}})[_0x4fc6('0x1a')](function(_0x2778af){return logger[_0x4fc6('0x1b')](_0x4fc6('0x29'),'afterCreate',_0x4fc6('0x55'),util['inspect'](_0x2778af,{'showHidden':![],'depth':null}));});}else{logger[_0x4fc6('0x1b')](_0x4fc6('0x29'),_0x4fc6('0x2a'),_0x4fc6('0x55'),'Missing\x20parameters:\x20apiKey');}break;case _0x4fc6('0x63'):if(_0x52b9ab[_0x4fc6('0x57')]){var _0x398c9b={'method':_0x4fc6('0x3a'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x52b9ab['apiKey']},'body':{'content':_0xf53bfb[_0x4fc6('0xe')],'to':[_0xf53bfb['phone']],'from':_0x52b9ab[_0x4fc6('0x22')],'binary':![],'clientMessageId':_0x4fc6('0x64'),'charset':_0x4fc6('0x65')},'json':!![]};rp(_0x398c9b)['then'](function(_0x3278f5){if(!_0x3278f5[_0x4fc6('0x1b')]){var _0x443a5c={'messageId':_0x3278f5[_0x4fc6('0x49')][0x0]['apiMessageId']};if(!_0x52b9ab[_0x4fc6('0x35')]){_0x443a5c[_0x4fc6('0x36')]=!![];}return _0x1aec80[_0x4fc6('0x27')](_0x443a5c);}else{return logger[_0x4fc6('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4fc6('0x2a'),_0x4fc6('0x63'),util[_0x4fc6('0x28')](_0x3278f5['error'],{'showHidden':![],'depth':null}));}})['catch'](function(_0x4ec7af){return logger[_0x4fc6('0x1b')](_0x4fc6('0x29'),_0x4fc6('0x2a'),_0x4fc6('0x63'),util[_0x4fc6('0x28')](_0x4ec7af,{'showHidden':![],'depth':null}));});}else{logger[_0x4fc6('0x1b')](_0x4fc6('0x29'),_0x4fc6('0x2a'),_0x4fc6('0x63'),_0x4fc6('0x66'));}break;case'intelepeer':if(_0x52b9ab['apiKey']){var _0xcc2253={};var _0x30ebff={'method':_0x4fc6('0x3a'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':_0x4fc6('0x67')+_0x52b9ab[_0x4fc6('0x57')],'Content-Type':'application/json'},'body':{'from':_0x52b9ab[_0x4fc6('0x22')],'to':_0xf53bfb[_0x4fc6('0x22')],'text':_0xf53bfb['body']},'json':!![]};return rp(_0x30ebff)['then'](function(_0x428383){if(_0x428383['code']==0xca){_0xcc2253[_0x4fc6('0x68')]=_0x428383;var _0x139580={'method':_0x4fc6('0x3a'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0x4fc6('0x67')+_0x52b9ab[_0x4fc6('0x57')],'Content-Type':_0x4fc6('0x69')},'body':{'refid':_0xcc2253[_0x4fc6('0x68')][_0x4fc6('0x6a')]},'json':!![]};return rp(_0x139580)[_0x4fc6('0x1e')](function(_0x585824){_0xcc2253[_0x4fc6('0x6b')]=_0x585824;var _0x3cccf8={'messageId':_0xcc2253['message']['refid'],'read':!![]};return _0x1aec80[_0x4fc6('0x27')](_0x3cccf8);});}else{return logger[_0x4fc6('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4fc6('0x2a'),_0x4fc6('0x6c'),util[_0x4fc6('0x28')](_0x428383,{'showHidden':![],'depth':null}));}})[_0x4fc6('0x1a')](function(_0x1e8870){return logger[_0x4fc6('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4fc6('0x2a'),_0x4fc6('0x6c'),util[_0x4fc6('0x28')](_0x1e8870,{'showHidden':![],'depth':null}));});}else{return logger[_0x4fc6('0x1b')](_0x4fc6('0x29'),_0x4fc6('0x2a'),_0x4fc6('0x6c'),'Token\x20not\x20received');}break;}}})['finally'](function(){_0x2176ad();});}else{_0x2176ad();}}},'charset':'utf8mb4','collate':_0x4fc6('0x6d')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 09e750b..f1bdb3b 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 _0x2032=['register','request','SmsMessage,\x20%s,\x20%s','request\x20sent','error','message','info','result','CreateSmsMessage','create','options','then','stringify','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0x2032,0xd9));var _0x2203=function(_0x7c37a5,_0x5dff98){_0x7c37a5=_0x7c37a5-0x0;var _0x27196a=_0x2032[_0x7c37a5];return _0x27196a;};'use strict';var _=require('lodash');var util=require(_0x2203('0x0'));var moment=require(_0x2203('0x1'));var BPromise=require(_0x2203('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2203('0x3'));var db=require(_0x2203('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2203('0x5'))(_0x2203('0x6'));var config=require(_0x2203('0x7'));var jayson=require(_0x2203('0x8'));var client=jayson[_0x2203('0x9')][_0x2203('0xa')]({'port':0x232a});config[_0x2203('0xb')]=_[_0x2203('0xc')](config[_0x2203('0xb')],{'host':_0x2203('0xd'),'port':0x18eb});var socket=require(_0x2203('0xe'))(new Redis(config['redis']));require('./smsMessage.socket')[_0x2203('0xf')](socket);function respondWithRpcPromise(_0x549908,_0x27081c,_0x2972f3){return new BPromise(function(_0x6339c4,_0x5b19df){return client[_0x2203('0x10')](_0x549908,_0x2972f3)['then'](function(_0x3f690a){logger['info'](_0x2203('0x11'),_0x27081c,_0x2203('0x12'));logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x27081c,'request\x20sent',JSON['stringify'](_0x3f690a));if(_0x3f690a['error']){if(_0x3f690a[_0x2203('0x13')]['code']===0x1f4){logger['error'](_0x2203('0x11'),_0x27081c,_0x3f690a[_0x2203('0x13')][_0x2203('0x14')]);return _0x5b19df(_0x3f690a[_0x2203('0x13')][_0x2203('0x14')]);}logger[_0x2203('0x13')](_0x2203('0x11'),_0x27081c,_0x3f690a[_0x2203('0x13')][_0x2203('0x14')]);return _0x6339c4(_0x3f690a[_0x2203('0x13')]['message']);}else{logger[_0x2203('0x15')](_0x2203('0x11'),_0x27081c,'request\x20sent');_0x6339c4(_0x3f690a[_0x2203('0x16')][_0x2203('0x14')]);}})['catch'](function(_0x30c6f7){logger['error'](_0x2203('0x11'),_0x27081c,_0x30c6f7);_0x5b19df(_0x30c6f7);});});}exports[_0x2203('0x17')]=function(_0x3c8c34){var _0x3b4034=this;return new Promise(function(_0x15cb1a,_0x449039){return db['SmsMessage'][_0x2203('0x18')](_0x3c8c34['body'],{'raw':_0x3c8c34['options']?_0x3c8c34[_0x2203('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x2203('0x1a')](function(_0x5bfe61){logger['info'](_0x2203('0x17'),_0x3c8c34);logger['debug']('CreateSmsMessage',_0x3c8c34,JSON[_0x2203('0x1b')](_0x5bfe61));_0x15cb1a(_0x5bfe61);})[_0x2203('0x1c')](function(_0x21f930){logger[_0x2203('0x13')](_0x2203('0x17'),_0x21f930[_0x2203('0x14')],_0x3c8c34);_0x449039(_0x3b4034[_0x2203('0x13')](0x1f4,_0x21f930[_0x2203('0x14')]));});});}; \ No newline at end of file +var _0x5f66=['stringify','error','code','message','info','result','SmsMessage','create','body','options','raw','CreateSmsMessage','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./smsMessage.socket','then','SmsMessage,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x2b192c,_0x4d52a0){var _0x1623ad=function(_0x3083be){while(--_0x3083be){_0x2b192c['push'](_0x2b192c['shift']());}};_0x1623ad(++_0x4d52a0);}(_0x5f66,0x1a0));var _0x65f6=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x5f66[_0x31e29a];return _0x32d892;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});config['redis']=_[_0x65f6('0x9')](config[_0x65f6('0xa')],{'host':_0x65f6('0xb'),'port':0x18eb});var socket=require(_0x65f6('0xc'))(new Redis(config[_0x65f6('0xa')]));require(_0x65f6('0xd'))['register'](socket);function respondWithRpcPromise(_0x5123ee,_0x18fea1,_0x2f6d5b){return new BPromise(function(_0x264647,_0x25c416){return client['request'](_0x5123ee,_0x2f6d5b)[_0x65f6('0xe')](function(_0x571436){logger['info'](_0x65f6('0xf'),_0x18fea1,'request\x20sent');logger[_0x65f6('0x10')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x18fea1,_0x65f6('0x11'),JSON[_0x65f6('0x12')](_0x571436));if(_0x571436[_0x65f6('0x13')]){if(_0x571436[_0x65f6('0x13')][_0x65f6('0x14')]===0x1f4){logger[_0x65f6('0x13')](_0x65f6('0xf'),_0x18fea1,_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);return _0x25c416(_0x571436[_0x65f6('0x13')]['message']);}logger[_0x65f6('0x13')]('SmsMessage,\x20%s,\x20%s',_0x18fea1,_0x571436['error'][_0x65f6('0x15')]);return _0x264647(_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);}else{logger[_0x65f6('0x16')](_0x65f6('0xf'),_0x18fea1,_0x65f6('0x11'));_0x264647(_0x571436[_0x65f6('0x17')][_0x65f6('0x15')]);}})['catch'](function(_0x4d79a1){logger[_0x65f6('0x13')]('SmsMessage,\x20%s,\x20%s',_0x18fea1,_0x4d79a1);_0x25c416(_0x4d79a1);});});}exports['CreateSmsMessage']=function(_0x5c5b91){var _0x365159=this;return new Promise(function(_0x21ea88,_0x5114a4){return db[_0x65f6('0x18')][_0x65f6('0x19')](_0x5c5b91[_0x65f6('0x1a')],{'raw':_0x5c5b91[_0x65f6('0x1b')]?_0x5c5b91[_0x65f6('0x1b')][_0x65f6('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x197a49){logger['info']('CreateSmsMessage',_0x5c5b91);logger[_0x65f6('0x10')](_0x65f6('0x1d'),_0x5c5b91,JSON['stringify'](_0x197a49));_0x21ea88(_0x197a49);})[_0x65f6('0x1e')](function(_0x471a33){logger[_0x65f6('0x13')](_0x65f6('0x1d'),_0x471a33['message'],_0x5c5b91);_0x5114a4(_0x365159[_0x65f6('0x13')](0x1f4,_0x471a33[_0x65f6('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 864e38a..3ce5724 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 _0x486c=['remove','update','emit','removeListener','length','smsMessage:','./smsMessage.events','save'];(function(_0x3203ed,_0x30e504){var _0x53c1b3=function(_0x1a533d){while(--_0x1a533d){_0x3203ed['push'](_0x3203ed['shift']());}};_0x53c1b3(++_0x30e504);}(_0x486c,0x1b6));var _0xc486=function(_0x10d50c,_0x11dc43){_0x10d50c=_0x10d50c-0x0;var _0x2a9cbb=_0x486c[_0x10d50c];return _0x2a9cbb;};'use strict';var SmsMessageEvents=require(_0xc486('0x0'));var events=[_0xc486('0x1'),_0xc486('0x2'),_0xc486('0x3')];function createListener(_0x1e9dc6,_0x2fc71f){return function(_0x42858b){_0x2fc71f[_0xc486('0x4')](_0x1e9dc6,_0x42858b);};}function removeListener(_0xe2efba,_0x3ab728){return function(){SmsMessageEvents[_0xc486('0x5')](_0xe2efba,_0x3ab728);};}exports['register']=function(_0x1c394b){for(var _0x4de158=0x0,_0x3cc1fc=events[_0xc486('0x6')];_0x4de158<_0x3cc1fc;_0x4de158++){var _0x45e5c2=events[_0x4de158];var _0xd785ba=createListener(_0xc486('0x7')+_0x45e5c2,_0x1c394b);SmsMessageEvents['on'](_0x45e5c2,_0xd785ba);}}; \ No newline at end of file +var _0xda46=['./smsMessage.events','save','update','emit','removeListener','length','smsMessage:'];(function(_0x154ffc,_0x51449a){var _0x29253=function(_0x217d90){while(--_0x217d90){_0x154ffc['push'](_0x154ffc['shift']());}};_0x29253(++_0x51449a);}(_0xda46,0x1c0));var _0x6da4=function(_0x5c4b3c,_0x3473ea){_0x5c4b3c=_0x5c4b3c-0x0;var _0x5eb6b9=_0xda46[_0x5c4b3c];return _0x5eb6b9;};'use strict';var SmsMessageEvents=require(_0x6da4('0x0'));var events=[_0x6da4('0x1'),'remove',_0x6da4('0x2')];function createListener(_0x176bb2,_0x57cef6){return function(_0x2ba672){_0x57cef6[_0x6da4('0x3')](_0x176bb2,_0x2ba672);};}function removeListener(_0x5840b6,_0x5d5cb0){return function(){SmsMessageEvents[_0x6da4('0x4')](_0x5840b6,_0x5d5cb0);};}exports['register']=function(_0xff88a9){for(var _0x22ae43=0x0,_0x13932e=events[_0x6da4('0x5')];_0x22ae43<_0x13932e;_0x22ae43++){var _0x462db2=events[_0x22ae43];var _0x5ee101=createListener(_0x6da4('0x6')+_0x462db2,_0xff88a9);SmsMessageEvents['on'](_0x462db2,_0x5ee101);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 69ff628..0838bec 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 _0x1c23=['../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','put','update','delete','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x1c23,0x1d5));var _0x31c2=function(_0x7098eb,_0x354a0a){_0x7098eb=_0x7098eb-0x0;var _0xf36843=_0x1c23[_0x7098eb];return _0xf36843;};'use strict';var multer=require(_0x31c2('0x0'));var util=require(_0x31c2('0x1'));var path=require(_0x31c2('0x2'));var timeout=require(_0x31c2('0x3'));var express=require(_0x31c2('0x4'));var router=express[_0x31c2('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x31c2('0x6'));var config=require(_0x31c2('0x7'));var controller=require('./smsQueue.controller');router[_0x31c2('0x8')]('/',auth[_0x31c2('0x9')](),controller[_0x31c2('0xa')]);router[_0x31c2('0x8')](_0x31c2('0xb'),auth['isAuthenticated'](),controller[_0x31c2('0xc')]);router[_0x31c2('0x8')](_0x31c2('0xd'),auth[_0x31c2('0x9')](),controller[_0x31c2('0xe')]);router['get']('/:id/members',auth[_0x31c2('0x9')](),controller[_0x31c2('0xf')]);router[_0x31c2('0x8')](_0x31c2('0x10'),auth[_0x31c2('0x9')](),controller[_0x31c2('0x11')]);router['get'](_0x31c2('0x12'),auth['isAuthenticated'](),controller[_0x31c2('0x13')]);router[_0x31c2('0x14')]('/',auth[_0x31c2('0x9')](),controller['create']);router[_0x31c2('0x14')](_0x31c2('0x10'),auth['isAuthenticated'](),controller[_0x31c2('0x15')]);router[_0x31c2('0x14')](_0x31c2('0x12'),auth[_0x31c2('0x9')](),controller[_0x31c2('0x16')]);router[_0x31c2('0x17')](_0x31c2('0xd'),auth[_0x31c2('0x9')](),controller[_0x31c2('0x18')]);router[_0x31c2('0x19')](_0x31c2('0xd'),auth['isAuthenticated'](),controller['destroy']);router[_0x31c2('0x19')](_0x31c2('0x10'),auth[_0x31c2('0x9')](),controller['removeTeams']);router['delete'](_0x31c2('0x12'),auth['isAuthenticated'](),controller[_0x31c2('0x1a')]);module[_0x31c2('0x1b')]=router; \ No newline at end of file +var _0x7ed1=['../../components/interaction/service','./smsQueue.controller','get','isAuthenticated','index','describe','/:id','show','/:id/members','getMembers','/:id/users','getAgents','post','/:id/teams','addAgents','update','delete','destroy','removeTeams','removeAgents','multer','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x15270c,_0x2f1ee3){var _0x4e1b86=function(_0x2bbb5e){while(--_0x2bbb5e){_0x15270c['push'](_0x15270c['shift']());}};_0x4e1b86(++_0x2f1ee3);}(_0x7ed1,0xca));var _0x17ed=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x7ed1[_0x2064e5];return _0x21a233;};'use strict';var multer=require(_0x17ed('0x0'));var util=require('util');var path=require(_0x17ed('0x1'));var timeout=require(_0x17ed('0x2'));var express=require(_0x17ed('0x3'));var router=express[_0x17ed('0x4')]();var auth=require(_0x17ed('0x5'));var interaction=require(_0x17ed('0x6'));var config=require('../../config/environment');var controller=require(_0x17ed('0x7'));router[_0x17ed('0x8')]('/',auth[_0x17ed('0x9')](),controller[_0x17ed('0xa')]);router['get']('/describe',auth[_0x17ed('0x9')](),controller[_0x17ed('0xb')]);router[_0x17ed('0x8')](_0x17ed('0xc'),auth['isAuthenticated'](),controller[_0x17ed('0xd')]);router[_0x17ed('0x8')](_0x17ed('0xe'),auth[_0x17ed('0x9')](),controller[_0x17ed('0xf')]);router[_0x17ed('0x8')]('/:id/teams',auth[_0x17ed('0x9')](),controller['getTeams']);router['get'](_0x17ed('0x10'),auth[_0x17ed('0x9')](),controller[_0x17ed('0x11')]);router[_0x17ed('0x12')]('/',auth[_0x17ed('0x9')](),controller['create']);router[_0x17ed('0x12')](_0x17ed('0x13'),auth[_0x17ed('0x9')](),controller['addTeams']);router[_0x17ed('0x12')]('/:id/users',auth['isAuthenticated'](),controller[_0x17ed('0x14')]);router['put'](_0x17ed('0xc'),auth[_0x17ed('0x9')](),controller[_0x17ed('0x15')]);router[_0x17ed('0x16')]('/:id',auth[_0x17ed('0x9')](),controller[_0x17ed('0x17')]);router[_0x17ed('0x16')]('/:id/teams',auth['isAuthenticated'](),controller[_0x17ed('0x18')]);router[_0x17ed('0x16')](_0x17ed('0x10'),auth[_0x17ed('0x9')](),controller[_0x17ed('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 5a3afc9..7d41f59 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 _0x619d=['beepall','roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0x3173ce,_0x3671e2){var _0x3e52a7=function(_0x4e73d1){while(--_0x4e73d1){_0x3173ce['push'](_0x3173ce['shift']());}};_0x3e52a7(++_0x3671e2);}(_0x619d,0x13d));var _0xd619=function(_0x30ead6,_0x922504){_0x30ead6=_0x30ead6-0x0;var _0x1cf337=_0x619d[_0x30ead6];return _0x1cf337;};'use strict';var Sequelize=require(_0xd619('0x0'));module[_0xd619('0x1')]={'name':{'type':Sequelize[_0xd619('0x2')],'unique':_0xd619('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xd619('0x2')]},'timeout':{'type':Sequelize[_0xd619('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0xd619('0x5'),_0xd619('0x6'))}}; \ No newline at end of file +var _0x16d2=['STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize'];(function(_0x5aa410,_0x111b50){var _0x529cad=function(_0x5ad268){while(--_0x5ad268){_0x5aa410['push'](_0x5aa410['shift']());}};_0x529cad(++_0x111b50);}(_0x16d2,0x1af));var _0x216d=function(_0x467878,_0x3c6977){_0x467878=_0x467878-0x0;var _0x309c6c=_0x16d2[_0x467878];return _0x309c6c;};'use strict';var Sequelize=require(_0x216d('0x0'));module['exports']={'name':{'type':Sequelize[_0x216d('0x1')],'unique':_0x216d('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x216d('0x1')]},'timeout':{'type':Sequelize[_0x216d('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x216d('0x4')](_0x216d('0x5'),_0x216d('0x6'),_0x216d('0x7'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index b58e20a..cdaef73 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 _0xd19e=['voicePause','interface','flatMap','transaction','findOrCreate','forEach','emit','User','select','tq.TeamId','from','team_has_sms_queues','join','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','sequelize','QueryTypes','every','TeamId','includes','union','compact','value','removeTeams','isEmpty','addAgents','omit','spread','removeAgents','userSmsQueue:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','json','offset','limit','Content-Range','reject','save','update','destroy','then','get','SmsQueues','UserProfileResource','end','error','stack','send','index','map','SmsQueue','fieldName','type','key','name','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','count','findAll','rows','catch','show','params','rawAttributes','includeAll','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','describe','getMembers','UserSmsQueue','findAndCountAll','UserId','smsPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','findOne','Team','pick','addTeams','ids','Agents'];(function(_0x9f86dd,_0x31c98c){var _0x3f1116=function(_0x45f5e5){while(--_0x45f5e5){_0x9f86dd['push'](_0x9f86dd['shift']());}};_0x3f1116(++_0x31c98c);}(_0xd19e,0x1c1));var _0xed19=function(_0x266d80,_0x39ef9b){_0x266d80=_0x266d80-0x0;var _0x1e72cf=_0xd19e[_0x266d80];return _0x1e72cf;};'use strict';var pdf=require(_0xed19('0x0'));var emlformat=require(_0xed19('0x1'));var rimraf=require(_0xed19('0x2'));var zipdir=require(_0xed19('0x3'));var jsonpatch=require(_0xed19('0x4'));var rp=require('request-promise');var moment=require(_0xed19('0x5'));var BPromise=require(_0xed19('0x6'));var Mustache=require(_0xed19('0x7'));var util=require(_0xed19('0x8'));var path=require(_0xed19('0x9'));var sox=require('sox');var csv=require(_0xed19('0xa'));var ejs=require(_0xed19('0xb'));var fs=require('fs');var _=require(_0xed19('0xc'));var squel=require('squel');var crypto=require(_0xed19('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xed19('0xe'));var toCsv=require(_0xed19('0xa'));var querystring=require(_0xed19('0xf'));var Papa=require(_0xed19('0x10'));var Redis=require(_0xed19('0x11'));var authService=require(_0xed19('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xed19('0x13'));var hardwareService=require(_0xed19('0x14'));var logger=require(_0xed19('0x15'))(_0xed19('0x16'));var utils=require(_0xed19('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xed19('0x18')]=_[_0xed19('0x19')](config['redis'],{'host':_0xed19('0x1a'),'port':0x18eb});var socket=require(_0xed19('0x1b'))(new Redis(config[_0xed19('0x18')]));require(_0xed19('0x1c'))[_0xed19('0x1d')](socket);function respondWithStatusCode(_0x19c37e,_0x36f1dd){_0x36f1dd=_0x36f1dd||0xcc;return function(_0x1f2abc){if(_0x1f2abc){return _0x19c37e[_0xed19('0x1e')](_0x36f1dd);}return _0x19c37e[_0xed19('0x1f')](_0x36f1dd)['end']();};}function respondWithResult(_0x1818f2,_0x18278e){_0x18278e=_0x18278e||0xc8;return function(_0x2b2281){if(_0x2b2281){return _0x1818f2[_0xed19('0x1f')](_0x18278e)[_0xed19('0x20')](_0x2b2281);}};}function respondWithFilteredResult(_0x1f0c60,_0xe7238b){return function(_0x1bb1f9){if(_0x1bb1f9){var _0x983ef9=_0x1bb1f9['count'],_0x2ef36c=_0xe7238b[_0xed19('0x21')],_0x157069=_0xe7238b['offset']+_0xe7238b[_0xed19('0x22')],_0x260cfb;if(_0x157069>=_0x983ef9){_0x157069=_0x983ef9;_0x260cfb=0xc8;}else{_0x260cfb=0xce;}_0x1f0c60[_0xed19('0x1f')](_0x260cfb);return _0x1f0c60['set'](_0xed19('0x23'),_0x2ef36c+'-'+_0x157069+'/'+_0x983ef9)[_0xed19('0x20')](_0x1bb1f9);}return null;};}function patchUpdates(_0x370491){return function(_0x204677){try{jsonpatch['apply'](_0x204677,_0x370491,!![]);}catch(_0x17611b){return BPromise[_0xed19('0x24')](_0x17611b);}return _0x204677[_0xed19('0x25')]();};}function saveUpdates(_0x24b6a4,_0x20ad9a){return function(_0x2483da){if(_0x2483da){return _0x2483da[_0xed19('0x26')](_0x24b6a4)['then'](function(_0x2baec6){return _0x2baec6;});}return null;};}function removeEntity(_0x458d31,_0x2a02f0){return function(_0xe81db0){if(_0xe81db0){return _0xe81db0[_0xed19('0x27')]()[_0xed19('0x28')](function(){var _0x1abc9d=_0xe81db0[_0xed19('0x29')]({'plain':!![]});var _0x1e8b97=_0xed19('0x2a');return db[_0xed19('0x2b')][_0xed19('0x27')]({'where':{'type':_0x1e8b97,'resourceId':_0x1abc9d['id']}})[_0xed19('0x28')](function(){return _0xe81db0;});})[_0xed19('0x28')](function(){_0x458d31['status'](0xcc)[_0xed19('0x2c')]();});}};}function handleEntityNotFound(_0x28babc,_0x204ce9){return function(_0x27afe7){if(!_0x27afe7){_0x28babc['sendStatus'](0x194);}return _0x27afe7;};}function handleError(_0x2bbfb0,_0x45cf13){_0x45cf13=_0x45cf13||0x1f4;return function(_0x59c78f){logger[_0xed19('0x2d')](_0x59c78f[_0xed19('0x2e')]);if(_0x59c78f['name']){delete _0x59c78f['name'];}_0x2bbfb0[_0xed19('0x1f')](_0x45cf13)[_0xed19('0x2f')](_0x59c78f);};}exports[_0xed19('0x30')]=function(_0x34ecf0,_0x1184dd){var _0x471032={},_0x211660={},_0x1cae19={'count':0x0,'rows':[]};var _0x3d8c86=_[_0xed19('0x31')](db[_0xed19('0x32')]['rawAttributes'],function(_0x9e7042){return{'name':_0x9e7042[_0xed19('0x33')],'type':_0x9e7042[_0xed19('0x34')][_0xed19('0x35')]};});_0x211660['model']=_['map'](_0x3d8c86,_0xed19('0x36'));_0x211660[_0xed19('0x37')]=_[_0xed19('0x38')](_0x34ecf0[_0xed19('0x37')]);_0x211660[_0xed19('0x39')]=_[_0xed19('0x3a')](_0x211660[_0xed19('0x3b')],_0x211660[_0xed19('0x37')]);_0x471032['attributes']=_[_0xed19('0x3a')](_0x211660[_0xed19('0x3b')],qs[_0xed19('0x3c')](_0x34ecf0[_0xed19('0x37')]['fields']));_0x471032['attributes']=_0x471032[_0xed19('0x3d')][_0xed19('0x3e')]?_0x471032[_0xed19('0x3d')]:_0x211660[_0xed19('0x3b')];if(!_0x34ecf0[_0xed19('0x37')][_0xed19('0x3f')](_0xed19('0x40'))){_0x471032['limit']=qs['limit'](_0x34ecf0[_0xed19('0x37')][_0xed19('0x22')]);_0x471032['offset']=qs[_0xed19('0x21')](_0x34ecf0[_0xed19('0x37')][_0xed19('0x21')]);}_0x471032[_0xed19('0x41')]=qs['sort'](_0x34ecf0[_0xed19('0x37')][_0xed19('0x42')]);_0x471032[_0xed19('0x43')]=qs['filters'](_['pick'](_0x34ecf0['query'],_0x211660['filters']));if(_0x34ecf0[_0xed19('0x37')][_0xed19('0x44')]){_0x471032[_0xed19('0x43')]=_[_0xed19('0x45')](_0x471032['where'],{'$or':_[_0xed19('0x31')](_0x3d8c86,function(_0x3f3f62){if(_0x3f3f62[_0xed19('0x34')][_0xed19('0x35')]!==_0xed19('0x46')){var _0x25d9f9={};_0x25d9f9[_0x3f3f62['field']]={'$like':'%'+_0x34ecf0[_0xed19('0x37')][_0xed19('0x44')]+'%'};return _0x25d9f9;}})});}_0x471032=_[_0xed19('0x45')]({},_0x471032,_0x34ecf0[_0xed19('0x47')]);var _0x36f66e={'where':_0x471032['where']};return db[_0xed19('0x32')]['count'](_0x36f66e)[_0xed19('0x28')](function(_0x2ab9fe){_0x1cae19[_0xed19('0x48')]=_0x2ab9fe;if(_0x34ecf0[_0xed19('0x37')]['includeAll']){_0x471032['include']=[{'all':!![]}];}return db[_0xed19('0x32')][_0xed19('0x49')](_0x471032);})[_0xed19('0x28')](function(_0x475f5c){_0x1cae19[_0xed19('0x4a')]=_0x475f5c;return _0x1cae19;})[_0xed19('0x28')](respondWithFilteredResult(_0x1184dd,_0x471032))[_0xed19('0x4b')](handleError(_0x1184dd,null));};exports[_0xed19('0x4c')]=function(_0x25a0bc,_0x4b695d){var _0x35376b={'raw':!![],'where':{'id':_0x25a0bc[_0xed19('0x4d')]['id']}},_0x544ad8={};_0x544ad8[_0xed19('0x3b')]=_[_0xed19('0x38')](db[_0xed19('0x32')][_0xed19('0x4e')]);_0x544ad8[_0xed19('0x37')]=_[_0xed19('0x38')](_0x25a0bc[_0xed19('0x37')]);_0x544ad8[_0xed19('0x39')]=_[_0xed19('0x3a')](_0x544ad8[_0xed19('0x3b')],_0x544ad8[_0xed19('0x37')]);_0x35376b[_0xed19('0x3d')]=_[_0xed19('0x3a')](_0x544ad8[_0xed19('0x3b')],qs[_0xed19('0x3c')](_0x25a0bc[_0xed19('0x37')][_0xed19('0x3c')]));_0x35376b[_0xed19('0x3d')]=_0x35376b[_0xed19('0x3d')][_0xed19('0x3e')]?_0x35376b[_0xed19('0x3d')]:_0x544ad8['model'];if(_0x25a0bc[_0xed19('0x37')][_0xed19('0x4f')]){_0x35376b[_0xed19('0x50')]=[{'all':!![]}];}_0x35376b=_['merge']({},_0x35376b,_0x25a0bc[_0xed19('0x47')]);return db[_0xed19('0x32')][_0xed19('0x51')](_0x35376b)[_0xed19('0x28')](handleEntityNotFound(_0x4b695d,null))[_0xed19('0x28')](respondWithResult(_0x4b695d,null))[_0xed19('0x4b')](handleError(_0x4b695d,null));};exports[_0xed19('0x52')]=function(_0x31d7b8,_0x33f894){return db[_0xed19('0x32')][_0xed19('0x52')](_0x31d7b8[_0xed19('0x53')],{})[_0xed19('0x28')](function(_0x4523e6){var _0x3dd017=_0x31d7b8[_0xed19('0x54')][_0xed19('0x29')]({'plain':!![]});if(!_0x3dd017)throw new Error(_0xed19('0x55'));if(_0x3dd017['role']===_0xed19('0x54')){var _0xdb34db=_0x4523e6[_0xed19('0x29')]({'plain':!![]});var _0x276965=_0xed19('0x2a');return db[_0xed19('0x56')][_0xed19('0x51')]({'where':{'name':_0x276965,'userProfileId':_0x3dd017[_0xed19('0x57')]},'raw':!![]})[_0xed19('0x28')](function(_0x60f7d0){if(_0x60f7d0&&_0x60f7d0[_0xed19('0x58')]===0x0){return db[_0xed19('0x2b')]['create']({'name':_0xdb34db[_0xed19('0x36')],'resourceId':_0xdb34db['id'],'type':_0x60f7d0[_0xed19('0x36')],'sectionId':_0x60f7d0['id']},{})['then'](function(){return _0x4523e6;});}else{return _0x4523e6;}})[_0xed19('0x4b')](function(_0x3f78b4){logger[_0xed19('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3f78b4);throw _0x3f78b4;});}return _0x4523e6;})['then'](respondWithResult(_0x33f894,0xc9))['catch'](handleError(_0x33f894,null));};exports['update']=function(_0x3d1175,_0x540331){if(_0x3d1175[_0xed19('0x53')]['id']){delete _0x3d1175[_0xed19('0x53')]['id'];}return db[_0xed19('0x32')][_0xed19('0x51')]({'where':{'id':_0x3d1175[_0xed19('0x4d')]['id']}})[_0xed19('0x28')](handleEntityNotFound(_0x540331,null))[_0xed19('0x28')](saveUpdates(_0x3d1175[_0xed19('0x53')],null))[_0xed19('0x28')](respondWithResult(_0x540331,null))[_0xed19('0x4b')](handleError(_0x540331,null));};exports[_0xed19('0x27')]=function(_0x57a816,_0x8086d0){return db[_0xed19('0x32')][_0xed19('0x51')]({'where':{'id':_0x57a816[_0xed19('0x4d')]['id']}})['then'](handleEntityNotFound(_0x8086d0,null))[_0xed19('0x28')](removeEntity(_0x8086d0,null))[_0xed19('0x4b')](handleError(_0x8086d0,null));};exports[_0xed19('0x59')]=function(_0x266874,_0x1ca80d){return db[_0xed19('0x32')][_0xed19('0x59')]()[_0xed19('0x28')](respondWithResult(_0x1ca80d,null))[_0xed19('0x4b')](handleError(_0x1ca80d,null));};exports[_0xed19('0x5a')]=function(_0x39f7a8,_0x98d1d2,_0x1c97a5){var _0x4295d7={'raw':!![],'where':{}},_0x33f9f6={},_0x432089;return db['SmsQueue']['findOne']({'where':{'id':_0x39f7a8[_0xed19('0x4d')]['id']}})['then'](handleEntityNotFound(_0x98d1d2,null))[_0xed19('0x28')](function(_0x335c3d){if(_0x335c3d){_0x432089=_0x335c3d[_0xed19('0x29')]({'plain':!![]});_0x33f9f6[_0xed19('0x3b')]=_[_0xed19('0x38')](db[_0xed19('0x5b')][_0xed19('0x4e')]);_0x33f9f6[_0xed19('0x37')]=_[_0xed19('0x38')](_0x39f7a8[_0xed19('0x37')]);_0x33f9f6[_0xed19('0x39')]=_[_0xed19('0x3a')](_0x33f9f6[_0xed19('0x3b')],_0x33f9f6[_0xed19('0x37')]);_0x4295d7[_0xed19('0x3d')]=_[_0xed19('0x3a')](_0x33f9f6[_0xed19('0x3b')],qs['fields'](_0x39f7a8['query'][_0xed19('0x3c')]));_0x4295d7[_0xed19('0x3d')]=_0x4295d7[_0xed19('0x3d')][_0xed19('0x3e')]?_0x4295d7[_0xed19('0x3d')]:_0x33f9f6[_0xed19('0x3b')];if(!_0x39f7a8[_0xed19('0x37')][_0xed19('0x3f')](_0xed19('0x40'))){_0x4295d7[_0xed19('0x22')]=qs[_0xed19('0x22')](_0x39f7a8[_0xed19('0x37')]['limit']);_0x4295d7[_0xed19('0x21')]=qs[_0xed19('0x21')](_0x39f7a8[_0xed19('0x37')][_0xed19('0x21')]);}_0x4295d7['order']=qs[_0xed19('0x42')](_0x39f7a8['query']['sort']);_0x4295d7[_0xed19('0x43')]=qs['filters'](_['pick'](_0x39f7a8[_0xed19('0x37')],_0x33f9f6[_0xed19('0x39')]));_0x4295d7[_0xed19('0x43')]['SmsQueueId']=_0x335c3d['id'];if(_0x39f7a8[_0xed19('0x37')]['filter']){_0x4295d7['where']=_['merge'](_0x4295d7[_0xed19('0x43')],{'$or':_[_0xed19('0x31')](_0x4295d7[_0xed19('0x3d')],function(_0x52f1c9){var _0x1148cb={};_0x1148cb[_0x52f1c9]={'$like':'%'+_0x39f7a8[_0xed19('0x37')]['filter']+'%'};return _0x1148cb;})});}_0x4295d7=_[_0xed19('0x45')]({},_0x4295d7,_0x39f7a8[_0xed19('0x47')]);return db['UserSmsQueue'][_0xed19('0x49')](_0x4295d7);}})[_0xed19('0x28')](function(_0x6adc7c){if(_0x6adc7c){return db['User'][_0xed19('0x5c')]({'where':{'id':_[_0xed19('0x31')](_0x6adc7c,_0xed19('0x5d')),'role':'agent'},'attributes':['id',_0xed19('0x36'),_0xed19('0x5e'),_0xed19('0x5f'),_0xed19('0x60')]});}})[_0xed19('0x28')](function(_0x1d8c51){if(_0x1d8c51){return{'count':_0x1d8c51['count'],'rows':_[_0xed19('0x31')](_0x1d8c51['rows'],function(_0x10eea9){return{'membername':_0x10eea9['name'],'UserId':_0x10eea9['id'],'queue_name':_0x432089[_0xed19('0x36')],'SmsQueueId':_0x432089['id'],'interface':util[_0xed19('0x61')](_0xed19('0x62'),_0xed19('0x63'),_0x10eea9[_0xed19('0x36')]),'penalty':0x0,'paused':_0x10eea9[_0xed19('0x5e')],'createdAt':_0x10eea9['createdAt'],'updatedAt':_0x10eea9[_0xed19('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xed19('0x28')](respondWithFilteredResult(_0x98d1d2,_0x4295d7))[_0xed19('0x4b')](handleError(_0x98d1d2,null));};exports[_0xed19('0x64')]=function(_0x12da27,_0x287116,_0x367d73){var _0x1731e2={};var _0x1206b7={};var _0x29fa85;var _0x185294;return db['SmsQueue'][_0xed19('0x65')]({'where':{'id':_0x12da27[_0xed19('0x4d')]['id']}})[_0xed19('0x28')](handleEntityNotFound(_0x287116,null))[_0xed19('0x28')](function(_0x3952a8){if(_0x3952a8){_0x29fa85=_0x3952a8;_0x1206b7[_0xed19('0x3b')]=_[_0xed19('0x38')](db[_0xed19('0x66')][_0xed19('0x4e')]);_0x1206b7[_0xed19('0x37')]=_[_0xed19('0x38')](_0x12da27['query']);_0x1206b7[_0xed19('0x39')]=_[_0xed19('0x3a')](_0x1206b7[_0xed19('0x3b')],_0x1206b7[_0xed19('0x37')]);_0x1731e2['attributes']=_[_0xed19('0x3a')](_0x1206b7[_0xed19('0x3b')],qs[_0xed19('0x3c')](_0x12da27['query'][_0xed19('0x3c')]));_0x1731e2['attributes']=_0x1731e2[_0xed19('0x3d')][_0xed19('0x3e')]?_0x1731e2['attributes']:_0x1206b7[_0xed19('0x3b')];_0x1731e2['order']=qs[_0xed19('0x42')](_0x12da27[_0xed19('0x37')][_0xed19('0x42')]);_0x1731e2[_0xed19('0x43')]=qs['filters'](_[_0xed19('0x67')](_0x12da27['query'],_0x1206b7[_0xed19('0x39')]));if(_0x12da27[_0xed19('0x37')][_0xed19('0x44')]){_0x1731e2[_0xed19('0x43')]=_[_0xed19('0x45')](_0x1731e2[_0xed19('0x43')],{'$or':_[_0xed19('0x31')](_0x1731e2['attributes'],function(_0x198e74){var _0x4c8111={};_0x4c8111[_0x198e74]={'$like':'%'+_0x12da27[_0xed19('0x37')][_0xed19('0x44')]+'%'};return _0x4c8111;})});}_0x1731e2=_['merge']({},_0x1731e2,_0x12da27['options']);return _0x29fa85[_0xed19('0x64')](_0x1731e2);}})[_0xed19('0x28')](function(_0x2a98db){if(_0x2a98db){_0x185294=_0x2a98db['length'];if(!_0x12da27[_0xed19('0x37')][_0xed19('0x3f')](_0xed19('0x40'))){_0x1731e2[_0xed19('0x22')]=qs[_0xed19('0x22')](_0x12da27[_0xed19('0x37')][_0xed19('0x22')]);_0x1731e2['offset']=qs[_0xed19('0x21')](_0x12da27[_0xed19('0x37')][_0xed19('0x21')]);}return _0x29fa85['getTeams'](_0x1731e2);}})[_0xed19('0x28')](function(_0x56e2bd){if(_0x56e2bd){return _0x56e2bd?{'count':_0x185294,'rows':_0x56e2bd}:null;}})[_0xed19('0x28')](respondWithResult(_0x287116,null))[_0xed19('0x4b')](handleError(_0x287116,null));};exports[_0xed19('0x68')]=function(_0x21e757,_0x2f664e,_0xb9914){var _0x9f6a3e=_0x21e757['body'][_0xed19('0x69')];return db[_0xed19('0x66')][_0xed19('0x49')]({'where':{'id':_0x9f6a3e},'attributes':['id'],'include':[{'model':db['User'],'as':_0xed19('0x6a'),'attributes':['id',_0xed19('0x36'),'online',_0xed19('0x6b'),_0xed19('0x6c')],'raw':!![]}]})[_0xed19('0x28')](function(_0x11b1e9){if(_0x11b1e9){var _0x31818d=_[_0xed19('0x6d')](_0x11b1e9,function(_0x55d665){var _0x44ad29=_0x55d665[_0xed19('0x29')]({'plain':!![]});return _0x44ad29['Agents'];});return db[_0xed19('0x32')][_0xed19('0x51')]({'where':{'id':_0x21e757['params']['id']}})[_0xed19('0x28')](function(_0x85602){return db['sequelize'][_0xed19('0x6e')](function(_0x168965){return _0x85602[_0xed19('0x68')](_0x9f6a3e,{'transaction':_0x168965})['then'](function(){return BPromise['each'](_0x31818d,function(_0x187e2c){return db[_0xed19('0x5b')][_0xed19('0x6f')]({'where':{'UserId':_0x187e2c['id'],'SmsQueueId':_0x21e757[_0xed19('0x4d')]['id']},'transaction':_0x168965});});})['then'](function(){_0x31818d[_0xed19('0x70')](function(_0x914509){socket[_0xed19('0x71')]('userSmsQueue:save',{'UserId':_0x914509['id'],'SmsQueueId':_0x85602['id']});});});});});}})[_0xed19('0x28')](respondWithStatusCode(_0x2f664e,null))[_0xed19('0x4b')](handleError(_0x2f664e,null));};exports['removeTeams']=function(_0x17d1a7,_0x55e637,_0xad1f39){return db['Team'][_0xed19('0x49')]({'where':{'id':_0x17d1a7['query'][_0xed19('0x69')]},'attributes':['id'],'include':[{'model':db[_0xed19('0x72')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xed19('0x28')](handleEntityNotFound(_0x55e637,null))[_0xed19('0x28')](function(_0x36106d){var _0x25e7d0=_[_0xed19('0x31')](_0x36106d,'id');var _0x4f897a=[];var _0x5e3593=[];var _0x2224b7=squel[_0xed19('0x73')]();_0x2224b7['field'](_0xed19('0x74'))[_0xed19('0x75')](_0xed19('0x76'),'tq')[_0xed19('0x77')]('user_has_teams','ut',_0xed19('0x78'))[_0xed19('0x43')]('SmsQueueId\x20=\x20?',_0x17d1a7[_0xed19('0x4d')]['id']);for(var _0x28f687=0x0;_0x28f687<_0x36106d['length'];_0x28f687+=0x1){let _0x167027=_0x36106d[_0x28f687];for(var _0x28c6d2=0x0;_0x28c6d2<_0x167027[_0xed19('0x6a')]['length'];_0x28c6d2+=0x1){let _0x1cb154=_0x167027[_0xed19('0x6a')][_0x28c6d2];var _0x171536=_0x2224b7['clone']();_0x171536[_0xed19('0x43')](_0xed19('0x79'),_0x1cb154['id']);_0x5e3593[_0xed19('0x7a')](db[_0xed19('0x7b')][_0xed19('0x37')](_0x171536['toString'](),{'type':db[_0xed19('0x7b')][_0xed19('0x7c')]['SELECT']})[_0xed19('0x28')](function(_0x31485d){if(_0x31485d[_0xed19('0x3e')]===0x1){return _0x1cb154['id'];}else{var _0x1fa3b2=_[_0xed19('0x7d')](_[_0xed19('0x31')](_0x31485d,_0xed19('0x7e')),function(_0x5dc571){return _[_0xed19('0x7f')](_0x25e7d0,_0x5dc571);});if(_0x1fa3b2){return _0x1cb154['id'];}}}));}}return BPromise['all'](_0x5e3593)[_0xed19('0x28')](function(_0x1b2013){_0x4f897a=_(_0x4f897a)[_0xed19('0x80')](_0x1b2013)[_0xed19('0x81')]()[_0xed19('0x82')]();return db[_0xed19('0x32')][_0xed19('0x51')]({'where':{'id':_0x17d1a7[_0xed19('0x4d')]['id']}})[_0xed19('0x28')](function(_0x2899ca){return db[_0xed19('0x7b')][_0xed19('0x6e')](function(_0x3b0575){return _0x2899ca[_0xed19('0x83')](_0x17d1a7['query'][_0xed19('0x69')],{'transaction':_0x3b0575})['then'](function(){if(!_[_0xed19('0x84')](_0x4f897a)){return _0x2899ca['removeAgents'](_0x4f897a,{'transaction':_0x3b0575});}})['then'](function(){_0x4f897a[_0xed19('0x70')](function(_0x177af8){socket[_0xed19('0x71')]('userSmsQueue:remove',{'UserId':_0x177af8,'SmsQueueId':_0x2899ca['id']});});});});});});})[_0xed19('0x28')](respondWithStatusCode(_0x55e637,null))[_0xed19('0x4b')](handleError(_0x55e637,null));};exports[_0xed19('0x85')]=function(_0x43553b,_0x582d9c,_0x8dea79){return db[_0xed19('0x32')][_0xed19('0x51')]({'where':{'id':_0x43553b['params']['id']}})['then'](handleEntityNotFound(_0x582d9c,null))[_0xed19('0x28')](function(_0xce6523){if(_0xce6523){return _0xce6523[_0xed19('0x85')](_0x43553b[_0xed19('0x53')]['ids'],_[_0xed19('0x86')](_0x43553b[_0xed19('0x53')],[_0xed19('0x69'),'id'])||{})[_0xed19('0x87')](function(_0xb0be6){for(var _0x1b3c99=0x0;_0x1b3c99<_0x43553b[_0xed19('0x53')][_0xed19('0x69')][_0xed19('0x3e')];_0x1b3c99+=0x1){socket[_0xed19('0x71')]('userSmsQueue:save',{'UserId':_0x43553b[_0xed19('0x53')][_0xed19('0x69')][_0x1b3c99],'SmsQueueId':_0x43553b['params']['id']});}return _0xb0be6;});}})[_0xed19('0x28')](respondWithResult(_0x582d9c,null))[_0xed19('0x4b')](handleError(_0x582d9c,null));};exports[_0xed19('0x88')]=function(_0x597176,_0x8a48c0,_0xbd4ac0){return db['SmsQueue']['find']({'where':{'id':_0x597176[_0xed19('0x4d')]['id']}})[_0xed19('0x28')](handleEntityNotFound(_0x8a48c0,null))[_0xed19('0x28')](function(_0x3c0828){if(_0x3c0828){return _0x3c0828[_0xed19('0x88')](_0x597176['query']['ids'])[_0xed19('0x28')](function(){if(_['isArray'](_0x597176[_0xed19('0x37')][_0xed19('0x69')])){for(var _0x209033=0x0;_0x209033<_0x597176[_0xed19('0x37')]['ids']['length'];_0x209033+=0x1){socket['emit'](_0xed19('0x89'),{'UserId':Number(_0x597176[_0xed19('0x37')]['ids'][_0x209033]),'SmsQueueId':Number(_0x597176[_0xed19('0x4d')]['id'])});}}else{socket[_0xed19('0x71')]('userSmsQueue:remove',{'UserId':Number(_0x597176[_0xed19('0x37')][_0xed19('0x69')]),'SmsQueueId':Number(_0x597176[_0xed19('0x4d')]['id'])});}});}})[_0xed19('0x28')](respondWithStatusCode(_0x8a48c0,null))['catch'](handleError(_0x8a48c0,null));};exports[_0xed19('0x8a')]=function(_0x58ebe7,_0x54ca1e,_0x31ddb4){var _0x211016={};var _0x554ad8={};var _0x272a19;var _0x3af0e5;return db['SmsQueue'][_0xed19('0x65')]({'where':{'id':_0x58ebe7['params']['id']}})['then'](handleEntityNotFound(_0x54ca1e,null))[_0xed19('0x28')](function(_0x1108b6){if(_0x1108b6){_0x272a19=_0x1108b6;_0x554ad8[_0xed19('0x3b')]=_[_0xed19('0x38')](db[_0xed19('0x72')][_0xed19('0x4e')]);_0x554ad8[_0xed19('0x37')]=_[_0xed19('0x38')](_0x58ebe7[_0xed19('0x37')]);_0x554ad8[_0xed19('0x39')]=_[_0xed19('0x3a')](_0x554ad8['model'],_0x554ad8['query']);_0x211016[_0xed19('0x3d')]=_[_0xed19('0x3a')](_0x554ad8[_0xed19('0x3b')],qs['fields'](_0x58ebe7['query'][_0xed19('0x3c')]));_0x211016[_0xed19('0x3d')]=_0x211016[_0xed19('0x3d')]['length']?_0x211016[_0xed19('0x3d')]:_0x554ad8['model'];_0x211016[_0xed19('0x41')]=qs[_0xed19('0x42')](_0x58ebe7[_0xed19('0x37')][_0xed19('0x42')]);_0x211016[_0xed19('0x43')]=qs[_0xed19('0x39')](_['pick'](_0x58ebe7[_0xed19('0x37')],_0x554ad8[_0xed19('0x39')]));if(_0x58ebe7[_0xed19('0x37')][_0xed19('0x44')]){_0x211016[_0xed19('0x43')]=_[_0xed19('0x45')](_0x211016[_0xed19('0x43')],{'$or':_[_0xed19('0x31')](_0x211016['attributes'],function(_0x3dd3cb){var _0x235d06={};_0x235d06[_0x3dd3cb]={'$like':'%'+_0x58ebe7[_0xed19('0x37')][_0xed19('0x44')]+'%'};return _0x235d06;})});}_0x211016=_[_0xed19('0x45')]({},_0x211016,_0x58ebe7[_0xed19('0x47')]);return _0x272a19[_0xed19('0x8a')](_0x211016);}})[_0xed19('0x28')](function(_0x52b8ce){if(_0x52b8ce){_0x3af0e5=_0x52b8ce[_0xed19('0x3e')];if(!_0x58ebe7[_0xed19('0x37')][_0xed19('0x3f')](_0xed19('0x40'))){_0x211016['limit']=qs[_0xed19('0x22')](_0x58ebe7[_0xed19('0x37')]['limit']);_0x211016[_0xed19('0x21')]=qs[_0xed19('0x21')](_0x58ebe7['query']['offset']);}return _0x272a19['getAgents'](_0x211016);}})[_0xed19('0x28')](function(_0x20d761){if(_0x20d761){return _0x20d761?{'count':_0x3af0e5,'rows':_0x20d761}:null;}})[_0xed19('0x28')](respondWithResult(_0x54ca1e,null))[_0xed19('0x4b')](handleError(_0x54ca1e,null));}; \ No newline at end of file +var _0x8cf3=['omit','isArray','getAgents','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','then','destroy','get','SmsQueues','UserProfileResource','sendStatus','error','stack','name','send','index','map','SmsQueue','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','field','options','findAll','rows','catch','show','params','includeAll','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','describe','getMembers','findOne','UserSmsQueue','sort','User','findAndCountAll','agent','smsPause','updatedAt','format','%s/%s','SIP','createdAt','getTeams','Team','addTeams','Agents','voicePause','interface','sequelize','transaction','each','findOrCreate','forEach','emit','userSmsQueue:save','removeTeams','ids','tq.TeamId','team_has_sms_queues','join','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','userSmsQueue:remove','addAgents'];(function(_0x466af7,_0x2f7551){var _0x348c96=function(_0x2d7477){while(--_0x2d7477){_0x466af7['push'](_0x466af7['shift']());}};_0x348c96(++_0x2f7551);}(_0x8cf3,0x125));var _0x38cf=function(_0x34118f,_0x4f0887){_0x34118f=_0x34118f-0x0;var _0x37baec=_0x8cf3[_0x34118f];return _0x37baec;};'use strict';var pdf=require(_0x38cf('0x0'));var emlformat=require(_0x38cf('0x1'));var rimraf=require(_0x38cf('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x38cf('0x3'));var rp=require(_0x38cf('0x4'));var moment=require(_0x38cf('0x5'));var BPromise=require(_0x38cf('0x6'));var Mustache=require(_0x38cf('0x7'));var util=require(_0x38cf('0x8'));var path=require(_0x38cf('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x38cf('0xa'));var squel=require(_0x38cf('0xb'));var crypto=require(_0x38cf('0xc'));var jsforce=require(_0x38cf('0xd'));var deskjs=require(_0x38cf('0xe'));var toCsv=require(_0x38cf('0xf'));var querystring=require(_0x38cf('0x10'));var Papa=require(_0x38cf('0x11'));var Redis=require(_0x38cf('0x12'));var authService=require(_0x38cf('0x13'));var qs=require(_0x38cf('0x14'));var as=require(_0x38cf('0x15'));var hardwareService=require(_0x38cf('0x16'));var logger=require(_0x38cf('0x17'))(_0x38cf('0x18'));var utils=require(_0x38cf('0x19'));var config=require(_0x38cf('0x1a'));var db=require('../../mysqldb')['db'];config[_0x38cf('0x1b')]=_[_0x38cf('0x1c')](config[_0x38cf('0x1b')],{'host':_0x38cf('0x1d'),'port':0x18eb});var socket=require(_0x38cf('0x1e'))(new Redis(config[_0x38cf('0x1b')]));require(_0x38cf('0x1f'))[_0x38cf('0x20')](socket);function respondWithStatusCode(_0x72760e,_0x26950a){_0x26950a=_0x26950a||0xcc;return function(_0x56b301){if(_0x56b301){return _0x72760e['sendStatus'](_0x26950a);}return _0x72760e[_0x38cf('0x21')](_0x26950a)[_0x38cf('0x22')]();};}function respondWithResult(_0x2e8200,_0x2f3b0d){_0x2f3b0d=_0x2f3b0d||0xc8;return function(_0x36a61a){if(_0x36a61a){return _0x2e8200[_0x38cf('0x21')](_0x2f3b0d)['json'](_0x36a61a);}};}function respondWithFilteredResult(_0x338369,_0x2194bb){return function(_0x241fe3){if(_0x241fe3){var _0x5329ca=_0x241fe3[_0x38cf('0x23')],_0x46c10b=_0x2194bb[_0x38cf('0x24')],_0x3445ac=_0x2194bb[_0x38cf('0x24')]+_0x2194bb[_0x38cf('0x25')],_0x28695e;if(_0x3445ac>=_0x5329ca){_0x3445ac=_0x5329ca;_0x28695e=0xc8;}else{_0x28695e=0xce;}_0x338369[_0x38cf('0x21')](_0x28695e);return _0x338369[_0x38cf('0x26')](_0x38cf('0x27'),_0x46c10b+'-'+_0x3445ac+'/'+_0x5329ca)[_0x38cf('0x28')](_0x241fe3);}return null;};}function patchUpdates(_0x3b45a2){return function(_0x323cb0){try{jsonpatch[_0x38cf('0x29')](_0x323cb0,_0x3b45a2,!![]);}catch(_0xfdc12f){return BPromise[_0x38cf('0x2a')](_0xfdc12f);}return _0x323cb0[_0x38cf('0x2b')]();};}function saveUpdates(_0x209c20,_0x44b7e6){return function(_0x1d8f12){if(_0x1d8f12){return _0x1d8f12['update'](_0x209c20)[_0x38cf('0x2c')](function(_0x174e47){return _0x174e47;});}return null;};}function removeEntity(_0x329fab,_0x384e46){return function(_0x3ecc0c){if(_0x3ecc0c){return _0x3ecc0c[_0x38cf('0x2d')]()[_0x38cf('0x2c')](function(){var _0x1eba36=_0x3ecc0c[_0x38cf('0x2e')]({'plain':!![]});var _0x571753=_0x38cf('0x2f');return db[_0x38cf('0x30')]['destroy']({'where':{'type':_0x571753,'resourceId':_0x1eba36['id']}})[_0x38cf('0x2c')](function(){return _0x3ecc0c;});})[_0x38cf('0x2c')](function(){_0x329fab[_0x38cf('0x21')](0xcc)[_0x38cf('0x22')]();});}};}function handleEntityNotFound(_0x5ba8b8,_0x5e7ca8){return function(_0x5493f4){if(!_0x5493f4){_0x5ba8b8[_0x38cf('0x31')](0x194);}return _0x5493f4;};}function handleError(_0x35c853,_0x175b12){_0x175b12=_0x175b12||0x1f4;return function(_0x35bc0e){logger[_0x38cf('0x32')](_0x35bc0e[_0x38cf('0x33')]);if(_0x35bc0e[_0x38cf('0x34')]){delete _0x35bc0e[_0x38cf('0x34')];}_0x35c853[_0x38cf('0x21')](_0x175b12)[_0x38cf('0x35')](_0x35bc0e);};}exports[_0x38cf('0x36')]=function(_0x255178,_0xfff7c3){var _0x2344bf={},_0x3104fe={},_0x3f0d65={'count':0x0,'rows':[]};var _0x1d20fb=_[_0x38cf('0x37')](db[_0x38cf('0x38')][_0x38cf('0x39')],function(_0x3f12d0){return{'name':_0x3f12d0[_0x38cf('0x3a')],'type':_0x3f12d0[_0x38cf('0x3b')][_0x38cf('0x3c')]};});_0x3104fe[_0x38cf('0x3d')]=_[_0x38cf('0x37')](_0x1d20fb,'name');_0x3104fe['query']=_[_0x38cf('0x3e')](_0x255178[_0x38cf('0x3f')]);_0x3104fe[_0x38cf('0x40')]=_[_0x38cf('0x41')](_0x3104fe[_0x38cf('0x3d')],_0x3104fe['query']);_0x2344bf['attributes']=_[_0x38cf('0x41')](_0x3104fe['model'],qs[_0x38cf('0x42')](_0x255178[_0x38cf('0x3f')]['fields']));_0x2344bf[_0x38cf('0x43')]=_0x2344bf[_0x38cf('0x43')][_0x38cf('0x44')]?_0x2344bf[_0x38cf('0x43')]:_0x3104fe[_0x38cf('0x3d')];if(!_0x255178[_0x38cf('0x3f')][_0x38cf('0x45')](_0x38cf('0x46'))){_0x2344bf['limit']=qs[_0x38cf('0x25')](_0x255178['query']['limit']);_0x2344bf[_0x38cf('0x24')]=qs[_0x38cf('0x24')](_0x255178[_0x38cf('0x3f')][_0x38cf('0x24')]);}_0x2344bf[_0x38cf('0x47')]=qs['sort'](_0x255178[_0x38cf('0x3f')]['sort']);_0x2344bf[_0x38cf('0x48')]=qs[_0x38cf('0x40')](_[_0x38cf('0x49')](_0x255178[_0x38cf('0x3f')],_0x3104fe[_0x38cf('0x40')]));if(_0x255178[_0x38cf('0x3f')][_0x38cf('0x4a')]){_0x2344bf[_0x38cf('0x48')]=_[_0x38cf('0x4b')](_0x2344bf[_0x38cf('0x48')],{'$or':_['map'](_0x1d20fb,function(_0x25bdef){if(_0x25bdef['type'][_0x38cf('0x3c')]!==_0x38cf('0x4c')){var _0x1972fc={};_0x1972fc[_0x25bdef[_0x38cf('0x4d')]]={'$like':'%'+_0x255178[_0x38cf('0x3f')]['filter']+'%'};return _0x1972fc;}})});}_0x2344bf=_['merge']({},_0x2344bf,_0x255178[_0x38cf('0x4e')]);var _0x411a7e={'where':_0x2344bf['where']};return db[_0x38cf('0x38')][_0x38cf('0x23')](_0x411a7e)[_0x38cf('0x2c')](function(_0x37fedd){_0x3f0d65[_0x38cf('0x23')]=_0x37fedd;if(_0x255178[_0x38cf('0x3f')]['includeAll']){_0x2344bf['include']=[{'all':!![]}];}return db[_0x38cf('0x38')][_0x38cf('0x4f')](_0x2344bf);})[_0x38cf('0x2c')](function(_0x3070f0){_0x3f0d65[_0x38cf('0x50')]=_0x3070f0;return _0x3f0d65;})[_0x38cf('0x2c')](respondWithFilteredResult(_0xfff7c3,_0x2344bf))[_0x38cf('0x51')](handleError(_0xfff7c3,null));};exports[_0x38cf('0x52')]=function(_0x58827b,_0x45c5d9){var _0x1604d7={'raw':!![],'where':{'id':_0x58827b[_0x38cf('0x53')]['id']}},_0x539a04={};_0x539a04[_0x38cf('0x3d')]=_[_0x38cf('0x3e')](db[_0x38cf('0x38')][_0x38cf('0x39')]);_0x539a04[_0x38cf('0x3f')]=_[_0x38cf('0x3e')](_0x58827b[_0x38cf('0x3f')]);_0x539a04[_0x38cf('0x40')]=_[_0x38cf('0x41')](_0x539a04['model'],_0x539a04[_0x38cf('0x3f')]);_0x1604d7[_0x38cf('0x43')]=_[_0x38cf('0x41')](_0x539a04[_0x38cf('0x3d')],qs[_0x38cf('0x42')](_0x58827b[_0x38cf('0x3f')][_0x38cf('0x42')]));_0x1604d7[_0x38cf('0x43')]=_0x1604d7[_0x38cf('0x43')][_0x38cf('0x44')]?_0x1604d7['attributes']:_0x539a04['model'];if(_0x58827b[_0x38cf('0x3f')][_0x38cf('0x54')]){_0x1604d7[_0x38cf('0x55')]=[{'all':!![]}];}_0x1604d7=_['merge']({},_0x1604d7,_0x58827b[_0x38cf('0x4e')]);return db[_0x38cf('0x38')]['find'](_0x1604d7)[_0x38cf('0x2c')](handleEntityNotFound(_0x45c5d9,null))[_0x38cf('0x2c')](respondWithResult(_0x45c5d9,null))['catch'](handleError(_0x45c5d9,null));};exports['create']=function(_0x154efc,_0x36812a){return db[_0x38cf('0x38')][_0x38cf('0x56')](_0x154efc[_0x38cf('0x57')],{})[_0x38cf('0x2c')](function(_0x449702){var _0x114f4e=_0x154efc[_0x38cf('0x58')][_0x38cf('0x2e')]({'plain':!![]});if(!_0x114f4e)throw new Error(_0x38cf('0x59'));if(_0x114f4e[_0x38cf('0x5a')]===_0x38cf('0x58')){var _0x54403d=_0x449702[_0x38cf('0x2e')]({'plain':!![]});var _0x5598e9=_0x38cf('0x2f');return db['UserProfileSection'][_0x38cf('0x5b')]({'where':{'name':_0x5598e9,'userProfileId':_0x114f4e[_0x38cf('0x5c')]},'raw':!![]})['then'](function(_0x48d228){if(_0x48d228&&_0x48d228[_0x38cf('0x5d')]===0x0){return db['UserProfileResource'][_0x38cf('0x56')]({'name':_0x54403d['name'],'resourceId':_0x54403d['id'],'type':_0x48d228[_0x38cf('0x34')],'sectionId':_0x48d228['id']},{})[_0x38cf('0x2c')](function(){return _0x449702;});}else{return _0x449702;}})[_0x38cf('0x51')](function(_0x3b5883){logger[_0x38cf('0x32')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3b5883);throw _0x3b5883;});}return _0x449702;})[_0x38cf('0x2c')](respondWithResult(_0x36812a,0xc9))['catch'](handleError(_0x36812a,null));};exports['update']=function(_0x10d0a5,_0x24b1b7){if(_0x10d0a5[_0x38cf('0x57')]['id']){delete _0x10d0a5[_0x38cf('0x57')]['id'];}return db[_0x38cf('0x38')][_0x38cf('0x5b')]({'where':{'id':_0x10d0a5['params']['id']}})[_0x38cf('0x2c')](handleEntityNotFound(_0x24b1b7,null))[_0x38cf('0x2c')](saveUpdates(_0x10d0a5[_0x38cf('0x57')],null))[_0x38cf('0x2c')](respondWithResult(_0x24b1b7,null))[_0x38cf('0x51')](handleError(_0x24b1b7,null));};exports[_0x38cf('0x2d')]=function(_0x1836f7,_0x224a59){return db[_0x38cf('0x38')]['find']({'where':{'id':_0x1836f7[_0x38cf('0x53')]['id']}})[_0x38cf('0x2c')](handleEntityNotFound(_0x224a59,null))[_0x38cf('0x2c')](removeEntity(_0x224a59,null))['catch'](handleError(_0x224a59,null));};exports['describe']=function(_0x2459c2,_0x5138d9){return db[_0x38cf('0x38')][_0x38cf('0x5e')]()['then'](respondWithResult(_0x5138d9,null))[_0x38cf('0x51')](handleError(_0x5138d9,null));};exports[_0x38cf('0x5f')]=function(_0x37abcc,_0x365115,_0x11177e){var _0x2f4d76={'raw':!![],'where':{}},_0x4d2374={},_0x4f8e15;return db[_0x38cf('0x38')][_0x38cf('0x60')]({'where':{'id':_0x37abcc[_0x38cf('0x53')]['id']}})['then'](handleEntityNotFound(_0x365115,null))[_0x38cf('0x2c')](function(_0x1cf16e){if(_0x1cf16e){_0x4f8e15=_0x1cf16e[_0x38cf('0x2e')]({'plain':!![]});_0x4d2374[_0x38cf('0x3d')]=_['keys'](db[_0x38cf('0x61')]['rawAttributes']);_0x4d2374[_0x38cf('0x3f')]=_[_0x38cf('0x3e')](_0x37abcc[_0x38cf('0x3f')]);_0x4d2374[_0x38cf('0x40')]=_[_0x38cf('0x41')](_0x4d2374[_0x38cf('0x3d')],_0x4d2374[_0x38cf('0x3f')]);_0x2f4d76[_0x38cf('0x43')]=_[_0x38cf('0x41')](_0x4d2374[_0x38cf('0x3d')],qs[_0x38cf('0x42')](_0x37abcc['query'][_0x38cf('0x42')]));_0x2f4d76[_0x38cf('0x43')]=_0x2f4d76[_0x38cf('0x43')][_0x38cf('0x44')]?_0x2f4d76['attributes']:_0x4d2374[_0x38cf('0x3d')];if(!_0x37abcc[_0x38cf('0x3f')][_0x38cf('0x45')]('nolimit')){_0x2f4d76[_0x38cf('0x25')]=qs[_0x38cf('0x25')](_0x37abcc[_0x38cf('0x3f')][_0x38cf('0x25')]);_0x2f4d76[_0x38cf('0x24')]=qs[_0x38cf('0x24')](_0x37abcc[_0x38cf('0x3f')][_0x38cf('0x24')]);}_0x2f4d76[_0x38cf('0x47')]=qs[_0x38cf('0x62')](_0x37abcc[_0x38cf('0x3f')][_0x38cf('0x62')]);_0x2f4d76['where']=qs[_0x38cf('0x40')](_[_0x38cf('0x49')](_0x37abcc[_0x38cf('0x3f')],_0x4d2374[_0x38cf('0x40')]));_0x2f4d76['where']['SmsQueueId']=_0x1cf16e['id'];if(_0x37abcc[_0x38cf('0x3f')][_0x38cf('0x4a')]){_0x2f4d76[_0x38cf('0x48')]=_[_0x38cf('0x4b')](_0x2f4d76['where'],{'$or':_['map'](_0x2f4d76[_0x38cf('0x43')],function(_0x5808b0){var _0x28144e={};_0x28144e[_0x5808b0]={'$like':'%'+_0x37abcc[_0x38cf('0x3f')][_0x38cf('0x4a')]+'%'};return _0x28144e;})});}_0x2f4d76=_[_0x38cf('0x4b')]({},_0x2f4d76,_0x37abcc['options']);return db[_0x38cf('0x61')][_0x38cf('0x4f')](_0x2f4d76);}})[_0x38cf('0x2c')](function(_0x306be9){if(_0x306be9){return db[_0x38cf('0x63')][_0x38cf('0x64')]({'where':{'id':_['map'](_0x306be9,'UserId'),'role':_0x38cf('0x65')},'attributes':['id',_0x38cf('0x34'),_0x38cf('0x66'),_0x38cf('0x67'),'createdAt']});}})[_0x38cf('0x2c')](function(_0x22b2ae){if(_0x22b2ae){return{'count':_0x22b2ae[_0x38cf('0x23')],'rows':_[_0x38cf('0x37')](_0x22b2ae[_0x38cf('0x50')],function(_0x254184){return{'membername':_0x254184[_0x38cf('0x34')],'UserId':_0x254184['id'],'queue_name':_0x4f8e15[_0x38cf('0x34')],'SmsQueueId':_0x4f8e15['id'],'interface':util[_0x38cf('0x68')](_0x38cf('0x69'),_0x38cf('0x6a'),_0x254184[_0x38cf('0x34')]),'penalty':0x0,'paused':_0x254184[_0x38cf('0x66')],'createdAt':_0x254184[_0x38cf('0x6b')],'updatedAt':_0x254184[_0x38cf('0x67')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x38cf('0x2c')](respondWithFilteredResult(_0x365115,_0x2f4d76))['catch'](handleError(_0x365115,null));};exports[_0x38cf('0x6c')]=function(_0x3b9d73,_0x49fbd4,_0x19bae4){var _0x1b01c4={};var _0xb58492={};var _0x4c402e;var _0x46c82e;return db[_0x38cf('0x38')][_0x38cf('0x60')]({'where':{'id':_0x3b9d73['params']['id']}})[_0x38cf('0x2c')](handleEntityNotFound(_0x49fbd4,null))[_0x38cf('0x2c')](function(_0x13c3cf){if(_0x13c3cf){_0x4c402e=_0x13c3cf;_0xb58492[_0x38cf('0x3d')]=_[_0x38cf('0x3e')](db[_0x38cf('0x6d')]['rawAttributes']);_0xb58492[_0x38cf('0x3f')]=_[_0x38cf('0x3e')](_0x3b9d73[_0x38cf('0x3f')]);_0xb58492[_0x38cf('0x40')]=_['intersection'](_0xb58492[_0x38cf('0x3d')],_0xb58492[_0x38cf('0x3f')]);_0x1b01c4[_0x38cf('0x43')]=_[_0x38cf('0x41')](_0xb58492[_0x38cf('0x3d')],qs[_0x38cf('0x42')](_0x3b9d73[_0x38cf('0x3f')]['fields']));_0x1b01c4['attributes']=_0x1b01c4['attributes']['length']?_0x1b01c4[_0x38cf('0x43')]:_0xb58492['model'];_0x1b01c4[_0x38cf('0x47')]=qs[_0x38cf('0x62')](_0x3b9d73['query']['sort']);_0x1b01c4[_0x38cf('0x48')]=qs['filters'](_[_0x38cf('0x49')](_0x3b9d73[_0x38cf('0x3f')],_0xb58492[_0x38cf('0x40')]));if(_0x3b9d73[_0x38cf('0x3f')]['filter']){_0x1b01c4[_0x38cf('0x48')]=_[_0x38cf('0x4b')](_0x1b01c4['where'],{'$or':_['map'](_0x1b01c4['attributes'],function(_0x3ee438){var _0x1c01d7={};_0x1c01d7[_0x3ee438]={'$like':'%'+_0x3b9d73[_0x38cf('0x3f')]['filter']+'%'};return _0x1c01d7;})});}_0x1b01c4=_[_0x38cf('0x4b')]({},_0x1b01c4,_0x3b9d73[_0x38cf('0x4e')]);return _0x4c402e[_0x38cf('0x6c')](_0x1b01c4);}})[_0x38cf('0x2c')](function(_0x310a07){if(_0x310a07){_0x46c82e=_0x310a07[_0x38cf('0x44')];if(!_0x3b9d73[_0x38cf('0x3f')][_0x38cf('0x45')](_0x38cf('0x46'))){_0x1b01c4['limit']=qs['limit'](_0x3b9d73[_0x38cf('0x3f')][_0x38cf('0x25')]);_0x1b01c4[_0x38cf('0x24')]=qs[_0x38cf('0x24')](_0x3b9d73[_0x38cf('0x3f')][_0x38cf('0x24')]);}return _0x4c402e['getTeams'](_0x1b01c4);}})['then'](function(_0xa6f6d1){if(_0xa6f6d1){return _0xa6f6d1?{'count':_0x46c82e,'rows':_0xa6f6d1}:null;}})['then'](respondWithResult(_0x49fbd4,null))['catch'](handleError(_0x49fbd4,null));};exports[_0x38cf('0x6e')]=function(_0x451902,_0x1b66c2,_0x50bee4){var _0x504516=_0x451902[_0x38cf('0x57')]['ids'];return db[_0x38cf('0x6d')][_0x38cf('0x4f')]({'where':{'id':_0x504516},'attributes':['id'],'include':[{'model':db[_0x38cf('0x63')],'as':_0x38cf('0x6f'),'attributes':['id',_0x38cf('0x34'),'online',_0x38cf('0x70'),_0x38cf('0x71')],'raw':!![]}]})[_0x38cf('0x2c')](function(_0x4e733b){if(_0x4e733b){var _0x2e045c=_['flatMap'](_0x4e733b,function(_0x5a0e87){var _0x26da74=_0x5a0e87[_0x38cf('0x2e')]({'plain':!![]});return _0x26da74[_0x38cf('0x6f')];});return db[_0x38cf('0x38')][_0x38cf('0x5b')]({'where':{'id':_0x451902[_0x38cf('0x53')]['id']}})['then'](function(_0x1aefc0){return db[_0x38cf('0x72')][_0x38cf('0x73')](function(_0x5cb0a0){return _0x1aefc0[_0x38cf('0x6e')](_0x504516,{'transaction':_0x5cb0a0})[_0x38cf('0x2c')](function(){return BPromise[_0x38cf('0x74')](_0x2e045c,function(_0x52c73c){return db[_0x38cf('0x61')][_0x38cf('0x75')]({'where':{'UserId':_0x52c73c['id'],'SmsQueueId':_0x451902['params']['id']},'transaction':_0x5cb0a0});});})[_0x38cf('0x2c')](function(){_0x2e045c[_0x38cf('0x76')](function(_0x32f01a){socket[_0x38cf('0x77')](_0x38cf('0x78'),{'UserId':_0x32f01a['id'],'SmsQueueId':_0x1aefc0['id']});});});});});}})[_0x38cf('0x2c')](respondWithStatusCode(_0x1b66c2,null))[_0x38cf('0x51')](handleError(_0x1b66c2,null));};exports[_0x38cf('0x79')]=function(_0x19c941,_0x4c545e,_0x2d6c07){return db[_0x38cf('0x6d')][_0x38cf('0x4f')]({'where':{'id':_0x19c941[_0x38cf('0x3f')][_0x38cf('0x7a')]},'attributes':['id'],'include':[{'model':db[_0x38cf('0x63')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x38cf('0x2c')](handleEntityNotFound(_0x4c545e,null))[_0x38cf('0x2c')](function(_0x3389d7){var _0x352635=_['map'](_0x3389d7,'id');var _0x2983d5=[];var _0x51b58e=[];var _0x1250ba=squel['select']();_0x1250ba[_0x38cf('0x4d')](_0x38cf('0x7b'))['from'](_0x38cf('0x7c'),'tq')[_0x38cf('0x7d')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x38cf('0x48')]('SmsQueueId\x20=\x20?',_0x19c941['params']['id']);for(var _0x582ca4=0x0;_0x582ca4<_0x3389d7[_0x38cf('0x44')];_0x582ca4+=0x1){let _0x3ae564=_0x3389d7[_0x582ca4];for(var _0x873820=0x0;_0x873820<_0x3ae564[_0x38cf('0x6f')]['length'];_0x873820+=0x1){let _0x396da5=_0x3ae564[_0x38cf('0x6f')][_0x873820];var _0x55966c=_0x1250ba[_0x38cf('0x7e')]();_0x55966c[_0x38cf('0x48')](_0x38cf('0x7f'),_0x396da5['id']);_0x51b58e[_0x38cf('0x80')](db[_0x38cf('0x72')][_0x38cf('0x3f')](_0x55966c[_0x38cf('0x81')](),{'type':db[_0x38cf('0x72')][_0x38cf('0x82')][_0x38cf('0x83')]})[_0x38cf('0x2c')](function(_0x15c228){if(_0x15c228[_0x38cf('0x44')]===0x1){return _0x396da5['id'];}else{var _0xe6ce80=_[_0x38cf('0x84')](_['map'](_0x15c228,_0x38cf('0x85')),function(_0x105ed0){return _[_0x38cf('0x86')](_0x352635,_0x105ed0);});if(_0xe6ce80){return _0x396da5['id'];}}}));}}return BPromise[_0x38cf('0x87')](_0x51b58e)[_0x38cf('0x2c')](function(_0x7f532d){_0x2983d5=_(_0x2983d5)[_0x38cf('0x88')](_0x7f532d)[_0x38cf('0x89')]()[_0x38cf('0x8a')]();return db['SmsQueue'][_0x38cf('0x5b')]({'where':{'id':_0x19c941[_0x38cf('0x53')]['id']}})[_0x38cf('0x2c')](function(_0x11aada){return db[_0x38cf('0x72')][_0x38cf('0x73')](function(_0x4d6787){return _0x11aada[_0x38cf('0x79')](_0x19c941['query'][_0x38cf('0x7a')],{'transaction':_0x4d6787})[_0x38cf('0x2c')](function(){if(!_[_0x38cf('0x8b')](_0x2983d5)){return _0x11aada['removeAgents'](_0x2983d5,{'transaction':_0x4d6787});}})[_0x38cf('0x2c')](function(){_0x2983d5[_0x38cf('0x76')](function(_0x4ff6a9){socket[_0x38cf('0x77')](_0x38cf('0x8c'),{'UserId':_0x4ff6a9,'SmsQueueId':_0x11aada['id']});});});});});});})[_0x38cf('0x2c')](respondWithStatusCode(_0x4c545e,null))[_0x38cf('0x51')](handleError(_0x4c545e,null));};exports[_0x38cf('0x8d')]=function(_0x20d6a7,_0x3c4a88,_0x1c2bac){return db[_0x38cf('0x38')][_0x38cf('0x5b')]({'where':{'id':_0x20d6a7[_0x38cf('0x53')]['id']}})[_0x38cf('0x2c')](handleEntityNotFound(_0x3c4a88,null))[_0x38cf('0x2c')](function(_0x143bd8){if(_0x143bd8){return _0x143bd8[_0x38cf('0x8d')](_0x20d6a7[_0x38cf('0x57')][_0x38cf('0x7a')],_[_0x38cf('0x8e')](_0x20d6a7[_0x38cf('0x57')],[_0x38cf('0x7a'),'id'])||{})['spread'](function(_0x72f66f){for(var _0x25aa4e=0x0;_0x25aa4e<_0x20d6a7[_0x38cf('0x57')][_0x38cf('0x7a')]['length'];_0x25aa4e+=0x1){socket['emit']('userSmsQueue:save',{'UserId':_0x20d6a7[_0x38cf('0x57')][_0x38cf('0x7a')][_0x25aa4e],'SmsQueueId':_0x20d6a7[_0x38cf('0x53')]['id']});}return _0x72f66f;});}})[_0x38cf('0x2c')](respondWithResult(_0x3c4a88,null))['catch'](handleError(_0x3c4a88,null));};exports['removeAgents']=function(_0x17b132,_0x207573,_0x341803){return db[_0x38cf('0x38')]['find']({'where':{'id':_0x17b132[_0x38cf('0x53')]['id']}})[_0x38cf('0x2c')](handleEntityNotFound(_0x207573,null))[_0x38cf('0x2c')](function(_0x6503cc){if(_0x6503cc){return _0x6503cc['removeAgents'](_0x17b132[_0x38cf('0x3f')][_0x38cf('0x7a')])[_0x38cf('0x2c')](function(){if(_[_0x38cf('0x8f')](_0x17b132['query'][_0x38cf('0x7a')])){for(var _0x5cba29=0x0;_0x5cba29<_0x17b132['query']['ids']['length'];_0x5cba29+=0x1){socket[_0x38cf('0x77')](_0x38cf('0x8c'),{'UserId':Number(_0x17b132[_0x38cf('0x3f')][_0x38cf('0x7a')][_0x5cba29]),'SmsQueueId':Number(_0x17b132['params']['id'])});}}else{socket[_0x38cf('0x77')](_0x38cf('0x8c'),{'UserId':Number(_0x17b132['query'][_0x38cf('0x7a')]),'SmsQueueId':Number(_0x17b132[_0x38cf('0x53')]['id'])});}});}})[_0x38cf('0x2c')](respondWithStatusCode(_0x207573,null))[_0x38cf('0x51')](handleError(_0x207573,null));};exports[_0x38cf('0x90')]=function(_0x4a3e32,_0x1e62a1,_0x516bfd){var _0x189415={};var _0x266754={};var _0x125cb4;var _0xb46196;return db[_0x38cf('0x38')][_0x38cf('0x60')]({'where':{'id':_0x4a3e32[_0x38cf('0x53')]['id']}})[_0x38cf('0x2c')](handleEntityNotFound(_0x1e62a1,null))[_0x38cf('0x2c')](function(_0x36b729){if(_0x36b729){_0x125cb4=_0x36b729;_0x266754[_0x38cf('0x3d')]=_[_0x38cf('0x3e')](db['User'][_0x38cf('0x39')]);_0x266754[_0x38cf('0x3f')]=_['keys'](_0x4a3e32['query']);_0x266754[_0x38cf('0x40')]=_['intersection'](_0x266754[_0x38cf('0x3d')],_0x266754[_0x38cf('0x3f')]);_0x189415[_0x38cf('0x43')]=_[_0x38cf('0x41')](_0x266754[_0x38cf('0x3d')],qs[_0x38cf('0x42')](_0x4a3e32[_0x38cf('0x3f')][_0x38cf('0x42')]));_0x189415[_0x38cf('0x43')]=_0x189415['attributes']['length']?_0x189415[_0x38cf('0x43')]:_0x266754[_0x38cf('0x3d')];_0x189415[_0x38cf('0x47')]=qs[_0x38cf('0x62')](_0x4a3e32['query'][_0x38cf('0x62')]);_0x189415[_0x38cf('0x48')]=qs[_0x38cf('0x40')](_[_0x38cf('0x49')](_0x4a3e32[_0x38cf('0x3f')],_0x266754[_0x38cf('0x40')]));if(_0x4a3e32[_0x38cf('0x3f')][_0x38cf('0x4a')]){_0x189415[_0x38cf('0x48')]=_[_0x38cf('0x4b')](_0x189415[_0x38cf('0x48')],{'$or':_[_0x38cf('0x37')](_0x189415[_0x38cf('0x43')],function(_0x49a09c){var _0x13a533={};_0x13a533[_0x49a09c]={'$like':'%'+_0x4a3e32[_0x38cf('0x3f')][_0x38cf('0x4a')]+'%'};return _0x13a533;})});}_0x189415=_[_0x38cf('0x4b')]({},_0x189415,_0x4a3e32[_0x38cf('0x4e')]);return _0x125cb4[_0x38cf('0x90')](_0x189415);}})[_0x38cf('0x2c')](function(_0x4fdaa7){if(_0x4fdaa7){_0xb46196=_0x4fdaa7[_0x38cf('0x44')];if(!_0x4a3e32[_0x38cf('0x3f')]['hasOwnProperty'](_0x38cf('0x46'))){_0x189415[_0x38cf('0x25')]=qs[_0x38cf('0x25')](_0x4a3e32[_0x38cf('0x3f')][_0x38cf('0x25')]);_0x189415['offset']=qs[_0x38cf('0x24')](_0x4a3e32['query']['offset']);}return _0x125cb4['getAgents'](_0x189415);}})[_0x38cf('0x2c')](function(_0x5ca438){if(_0x5ca438){return _0x5ca438?{'count':_0xb46196,'rows':_0x5ca438}:null;}})['then'](respondWithResult(_0x1e62a1,null))[_0x38cf('0x51')](handleError(_0x1e62a1,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 1a9d28b..396a48c 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 _0x41f7=['update','remove','hasOwnProperty','events','../../mysqldb'];(function(_0x57bd2d,_0x1e805c){var _0x56ec8a=function(_0x5ec72b){while(--_0x5ec72b){_0x57bd2d['push'](_0x57bd2d['shift']());}};_0x56ec8a(++_0x1e805c);}(_0x41f7,0x7b));var _0x741f=function(_0x39fc87,_0x4e3562){_0x39fc87=_0x39fc87-0x0;var _0x3cebf9=_0x41f7[_0x39fc87];return _0x3cebf9;};'use strict';var EventEmitter=require(_0x741f('0x0'));var SmsQueue=require(_0x741f('0x1'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x741f('0x2'),'afterDestroy':_0x741f('0x3')};function emitEvent(_0x17fb84){return function(_0x4bbcfa,_0x31cbf6,_0x3580f5){SmsQueueEvents['emit'](_0x17fb84+':'+_0x4bbcfa['id'],_0x4bbcfa);SmsQueueEvents['emit'](_0x17fb84,_0x4bbcfa);_0x3580f5(null);};}for(var e in events){if(events[_0x741f('0x4')](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module['exports']=SmsQueueEvents; \ No newline at end of file +var _0x059b=['emit','hasOwnProperty','events','../../mysqldb','SmsQueue','setMaxListeners','save'];(function(_0x3c053d,_0x5b61ed){var _0x4c20fc=function(_0x1b18da){while(--_0x1b18da){_0x3c053d['push'](_0x3c053d['shift']());}};_0x4c20fc(++_0x5b61ed);}(_0x059b,0x1bb));var _0xb059=function(_0x26e73c,_0x305b00){_0x26e73c=_0x26e73c-0x0;var _0xc29304=_0x059b[_0x26e73c];return _0xc29304;};'use strict';var EventEmitter=require(_0xb059('0x0'));var SmsQueue=require(_0xb059('0x1'))['db'][_0xb059('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xb059('0x3')](0x0);var events={'afterCreate':_0xb059('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1e4bd7){return function(_0x7bda03,_0x4f0d6e,_0x1d2d3d){SmsQueueEvents['emit'](_0x1e4bd7+':'+_0x7bda03['id'],_0x7bda03);SmsQueueEvents[_0xb059('0x5')](_0x1e4bd7,_0x7bda03);_0x1d2d3d(null);};}for(var e in events){if(events[_0xb059('0x6')](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module['exports']=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 05057d2..215d262 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 _0x9167=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueue.attributes','exports','define','SmsQueue','lodash'];(function(_0x246eeb,_0x149e6a){var _0x644aa=function(_0x57cd0a){while(--_0x57cd0a){_0x246eeb['push'](_0x246eeb['shift']());}};_0x644aa(++_0x149e6a);}(_0x9167,0x16b));var _0x7916=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9167[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7916('0x0'));var util=require(_0x7916('0x1'));var logger=require('../../config/logger')(_0x7916('0x2'));var moment=require(_0x7916('0x3'));var BPromise=require(_0x7916('0x4'));var rp=require(_0x7916('0x5'));var fs=require('fs');var path=require(_0x7916('0x6'));var rimraf=require(_0x7916('0x7'));var config=require(_0x7916('0x8'));var attributes=require(_0x7916('0x9'));module[_0x7916('0xa')]=function(_0x53c355,_0x39421a){return _0x53c355[_0x7916('0xb')](_0x7916('0xc'),attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe35d=['define','SmsQueue','sms_queues','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueue.attributes','exports'];(function(_0xe45b6d,_0x443cac){var _0x4d6f47=function(_0x1c57a6){while(--_0x1c57a6){_0xe45b6d['push'](_0xe45b6d['shift']());}};_0x4d6f47(++_0x443cac);}(_0xe35d,0xe3));var _0xde35=function(_0x47c418,_0x1e3182){_0x47c418=_0x47c418-0x0;var _0x83159=_0xe35d[_0x47c418];return _0x83159;};'use strict';var _=require('lodash');var util=require(_0xde35('0x0'));var logger=require(_0xde35('0x1'))(_0xde35('0x2'));var moment=require(_0xde35('0x3'));var BPromise=require(_0xde35('0x4'));var rp=require(_0xde35('0x5'));var fs=require('fs');var path=require(_0xde35('0x6'));var rimraf=require(_0xde35('0x7'));var config=require(_0xde35('0x8'));var attributes=require(_0xde35('0x9'));module[_0xde35('0xa')]=function(_0x1b45f1,_0x3e5733){return _0x1b45f1[_0xde35('0xb')](_0xde35('0xc'),attributes,{'tableName':_0xde35('0xd'),'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 316c2c5..766df63 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 _0x118d=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','request','then','info','SmsQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','SmsQueue','findAll','options','attributes','limit','include','model','map','GetSmsQueue','ShowSmsQueue','find','raw','where','lodash','util','moment','randomstring'];(function(_0x28e0dd,_0x53147e){var _0xeda635=function(_0x5447e9){while(--_0x5447e9){_0x28e0dd['push'](_0x28e0dd['shift']());}};_0xeda635(++_0x53147e);}(_0x118d,0x11b));var _0xd118=function(_0x2a7388,_0x2a9be2){_0x2a7388=_0x2a7388-0x0;var _0x3f51fe=_0x118d[_0x2a7388];return _0x3f51fe;};'use strict';var _=require(_0xd118('0x0'));var util=require(_0xd118('0x1'));var moment=require(_0xd118('0x2'));var BPromise=require('bluebird');var rs=require(_0xd118('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd118('0x4'))['db'];var utils=require(_0xd118('0x5'));var logger=require(_0xd118('0x6'))(_0xd118('0x7'));var config=require(_0xd118('0x8'));var jayson=require(_0xd118('0x9'));var client=jayson[_0xd118('0xa')][_0xd118('0xb')]({'port':0x232a});config[_0xd118('0xc')]=_[_0xd118('0xd')](config[_0xd118('0xc')],{'host':_0xd118('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd118('0xc')]));require('./smsQueue.socket')[_0xd118('0xf')](socket);function respondWithRpcPromise(_0x272d90,_0x1803f8,_0x18a96e){return new BPromise(function(_0x3b2e3e,_0x33e55d){return client[_0xd118('0x10')](_0x272d90,_0x18a96e)[_0xd118('0x11')](function(_0x54cf1f){logger[_0xd118('0x12')](_0xd118('0x13'),_0x1803f8,'request\x20sent');logger[_0xd118('0x14')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x1803f8,_0xd118('0x15'),JSON[_0xd118('0x16')](_0x54cf1f));if(_0x54cf1f[_0xd118('0x17')]){if(_0x54cf1f[_0xd118('0x17')][_0xd118('0x18')]===0x1f4){logger[_0xd118('0x17')](_0xd118('0x13'),_0x1803f8,_0x54cf1f[_0xd118('0x17')]['message']);return _0x33e55d(_0x54cf1f['error'][_0xd118('0x19')]);}logger['error'](_0xd118('0x13'),_0x1803f8,_0x54cf1f['error']['message']);return _0x3b2e3e(_0x54cf1f[_0xd118('0x17')][_0xd118('0x19')]);}else{logger[_0xd118('0x12')](_0xd118('0x13'),_0x1803f8,'request\x20sent');_0x3b2e3e(_0x54cf1f[_0xd118('0x1a')][_0xd118('0x19')]);}})[_0xd118('0x1b')](function(_0x44f1e0){logger[_0xd118('0x17')](_0xd118('0x13'),_0x1803f8,_0x44f1e0);_0x33e55d(_0x44f1e0);});});}exports['GetSmsQueue']=function(_0x4917b1){var _0x232310=this;return new Promise(function(_0x3411ef,_0x216a46){return db[_0xd118('0x1c')][_0xd118('0x1d')]({'raw':_0x4917b1[_0xd118('0x1e')]?_0x4917b1['options']['raw']===undefined?!![]:![]:!![],'where':_0x4917b1[_0xd118('0x1e')]?_0x4917b1[_0xd118('0x1e')]['where']||null:null,'attributes':_0x4917b1[_0xd118('0x1e')]?_0x4917b1[_0xd118('0x1e')][_0xd118('0x1f')]||null:null,'limit':_0x4917b1[_0xd118('0x1e')]?_0x4917b1[_0xd118('0x1e')][_0xd118('0x20')]||null:null,'include':_0x4917b1[_0xd118('0x1e')]?_0x4917b1['options'][_0xd118('0x21')]?_['map'](_0x4917b1[_0xd118('0x1e')][_0xd118('0x21')],function(_0x2c7741){return{'model':db[_0x2c7741[_0xd118('0x22')]],'as':_0x2c7741['as'],'attributes':_0x2c7741[_0xd118('0x1f')],'include':_0x2c7741['include']?_[_0xd118('0x23')](_0x2c7741['include'],function(_0x5b27d8){return{'model':db[_0x5b27d8[_0xd118('0x22')]],'as':_0x5b27d8['as'],'attributes':_0x5b27d8[_0xd118('0x1f')],'include':_0x5b27d8['include']?_['map'](_0x5b27d8[_0xd118('0x21')],function(_0x1b882f){return{'model':db[_0x1b882f[_0xd118('0x22')]],'as':_0x1b882f['as'],'attributes':_0x1b882f[_0xd118('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x62e8ad){logger[_0xd118('0x12')](_0xd118('0x24'),_0x4917b1);logger['debug'](_0xd118('0x24'),_0x4917b1,JSON['stringify'](_0x62e8ad));_0x3411ef(_0x62e8ad);})['catch'](function(_0x208a03){logger[_0xd118('0x17')](_0xd118('0x24'),_0x208a03[_0xd118('0x19')],_0x4917b1);_0x216a46(_0x232310[_0xd118('0x17')](0x1f4,_0x208a03[_0xd118('0x19')]));});});};exports[_0xd118('0x25')]=function(_0x46acc7){var _0x57e67e=this;return new Promise(function(_0x1dd74f,_0x5983cd){return db['SmsQueue'][_0xd118('0x26')]({'raw':_0x46acc7[_0xd118('0x1e')]?_0x46acc7['options'][_0xd118('0x27')]===undefined?!![]:![]:!![],'where':_0x46acc7[_0xd118('0x1e')]?_0x46acc7[_0xd118('0x1e')][_0xd118('0x28')]||null:null,'attributes':_0x46acc7[_0xd118('0x1e')]?_0x46acc7[_0xd118('0x1e')][_0xd118('0x1f')]||null:null,'include':_0x46acc7['options']?_0x46acc7[_0xd118('0x1e')]['include']?_[_0xd118('0x23')](_0x46acc7['options'][_0xd118('0x21')],function(_0x24ed6b){return{'model':db[_0x24ed6b['model']],'as':_0x24ed6b['as'],'attributes':_0x24ed6b['attributes'],'include':_0x24ed6b['include']?_['map'](_0x24ed6b[_0xd118('0x21')],function(_0x34adfd){return{'model':db[_0x34adfd[_0xd118('0x22')]],'as':_0x34adfd['as'],'attributes':_0x34adfd[_0xd118('0x1f')],'include':_0x34adfd['include']?_[_0xd118('0x23')](_0x34adfd[_0xd118('0x21')],function(_0x95891e){return{'model':db[_0x95891e[_0xd118('0x22')]],'as':_0x95891e['as'],'attributes':_0x95891e['attributes']};}):[]};}):[]};}):[]:[]})[_0xd118('0x11')](function(_0x5473c6){logger['info'](_0xd118('0x25'),_0x46acc7);logger[_0xd118('0x14')](_0xd118('0x25'),_0x46acc7,JSON[_0xd118('0x16')](_0x5473c6));_0x1dd74f(_0x5473c6);})[_0xd118('0x1b')](function(_0x234e58){logger[_0xd118('0x17')](_0xd118('0x25'),_0x234e58[_0xd118('0x19')],_0x46acc7);_0x5983cd(_0x57e67e[_0xd118('0x17')](0x1f4,_0x234e58['message']));});});}; \ No newline at end of file +var _0x34f9=['redis','defaults','localhost','./smsQueue.socket','register','request','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','GetSmsQueue','SmsQueue','findAll','options','raw','where','limit','include','model','attributes','find','map','ShowSmsQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x322522,_0x4db288){var _0x293bcf=function(_0xf108b8){while(--_0xf108b8){_0x322522['push'](_0x322522['shift']());}};_0x293bcf(++_0x4db288);}(_0x34f9,0xea));var _0x934f=function(_0x5b05b5,_0x2ffa84){_0x5b05b5=_0x5b05b5-0x0;var _0x3cd925=_0x34f9[_0x5b05b5];return _0x3cd925;};'use strict';var _=require(_0x934f('0x0'));var util=require(_0x934f('0x1'));var moment=require(_0x934f('0x2'));var BPromise=require(_0x934f('0x3'));var rs=require(_0x934f('0x4'));var fs=require('fs');var Redis=require(_0x934f('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x934f('0x6'))(_0x934f('0x7'));var config=require(_0x934f('0x8'));var jayson=require(_0x934f('0x9'));var client=jayson[_0x934f('0xa')][_0x934f('0xb')]({'port':0x232a});config[_0x934f('0xc')]=_[_0x934f('0xd')](config[_0x934f('0xc')],{'host':_0x934f('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x934f('0xc')]));require(_0x934f('0xf'))[_0x934f('0x10')](socket);function respondWithRpcPromise(_0xb6e641,_0x116655,_0x43564d){return new BPromise(function(_0x48d3d8,_0x1a1d6c){return client[_0x934f('0x11')](_0xb6e641,_0x43564d)[_0x934f('0x12')](function(_0x47829b){logger[_0x934f('0x13')](_0x934f('0x14'),_0x116655,_0x934f('0x15'));logger[_0x934f('0x16')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x116655,_0x934f('0x15'),JSON[_0x934f('0x17')](_0x47829b));if(_0x47829b['error']){if(_0x47829b[_0x934f('0x18')]['code']===0x1f4){logger[_0x934f('0x18')](_0x934f('0x14'),_0x116655,_0x47829b[_0x934f('0x18')][_0x934f('0x19')]);return _0x1a1d6c(_0x47829b[_0x934f('0x18')][_0x934f('0x19')]);}logger['error']('SmsQueue,\x20%s,\x20%s',_0x116655,_0x47829b[_0x934f('0x18')][_0x934f('0x19')]);return _0x48d3d8(_0x47829b[_0x934f('0x18')][_0x934f('0x19')]);}else{logger[_0x934f('0x13')]('SmsQueue,\x20%s,\x20%s',_0x116655,_0x934f('0x15'));_0x48d3d8(_0x47829b[_0x934f('0x1a')][_0x934f('0x19')]);}})[_0x934f('0x1b')](function(_0x4e9a7e){logger[_0x934f('0x18')](_0x934f('0x14'),_0x116655,_0x4e9a7e);_0x1a1d6c(_0x4e9a7e);});});}exports[_0x934f('0x1c')]=function(_0x379835){var _0xce3f5b=this;return new Promise(function(_0x1fb5aa,_0x53fffc){return db[_0x934f('0x1d')][_0x934f('0x1e')]({'raw':_0x379835[_0x934f('0x1f')]?_0x379835['options'][_0x934f('0x20')]===undefined?!![]:![]:!![],'where':_0x379835[_0x934f('0x1f')]?_0x379835[_0x934f('0x1f')][_0x934f('0x21')]||null:null,'attributes':_0x379835[_0x934f('0x1f')]?_0x379835['options']['attributes']||null:null,'limit':_0x379835[_0x934f('0x1f')]?_0x379835[_0x934f('0x1f')][_0x934f('0x22')]||null:null,'include':_0x379835['options']?_0x379835[_0x934f('0x1f')][_0x934f('0x23')]?_['map'](_0x379835['options']['include'],function(_0x1dd625){return{'model':db[_0x1dd625[_0x934f('0x24')]],'as':_0x1dd625['as'],'attributes':_0x1dd625[_0x934f('0x25')],'include':_0x1dd625[_0x934f('0x23')]?_['map'](_0x1dd625[_0x934f('0x23')],function(_0x2a695d){return{'model':db[_0x2a695d['model']],'as':_0x2a695d['as'],'attributes':_0x2a695d['attributes'],'include':_0x2a695d['include']?_['map'](_0x2a695d[_0x934f('0x23')],function(_0x314b2a){return{'model':db[_0x314b2a[_0x934f('0x24')]],'as':_0x314b2a['as'],'attributes':_0x314b2a[_0x934f('0x25')]};}):[]};}):[]};}):[]:[]})[_0x934f('0x12')](function(_0x247e98){logger[_0x934f('0x13')](_0x934f('0x1c'),_0x379835);logger[_0x934f('0x16')](_0x934f('0x1c'),_0x379835,JSON[_0x934f('0x17')](_0x247e98));_0x1fb5aa(_0x247e98);})[_0x934f('0x1b')](function(_0x11d77e){logger[_0x934f('0x18')](_0x934f('0x1c'),_0x11d77e[_0x934f('0x19')],_0x379835);_0x53fffc(_0xce3f5b[_0x934f('0x18')](0x1f4,_0x11d77e['message']));});});};exports['ShowSmsQueue']=function(_0x47b9aa){var _0x2644cd=this;return new Promise(function(_0x4fab87,_0xbafdf1){return db['SmsQueue'][_0x934f('0x26')]({'raw':_0x47b9aa['options']?_0x47b9aa[_0x934f('0x1f')][_0x934f('0x20')]===undefined?!![]:![]:!![],'where':_0x47b9aa[_0x934f('0x1f')]?_0x47b9aa[_0x934f('0x1f')][_0x934f('0x21')]||null:null,'attributes':_0x47b9aa[_0x934f('0x1f')]?_0x47b9aa['options'][_0x934f('0x25')]||null:null,'include':_0x47b9aa['options']?_0x47b9aa[_0x934f('0x1f')][_0x934f('0x23')]?_[_0x934f('0x27')](_0x47b9aa[_0x934f('0x1f')][_0x934f('0x23')],function(_0x97f562){return{'model':db[_0x97f562[_0x934f('0x24')]],'as':_0x97f562['as'],'attributes':_0x97f562[_0x934f('0x25')],'include':_0x97f562['include']?_[_0x934f('0x27')](_0x97f562['include'],function(_0x75b9f1){return{'model':db[_0x75b9f1[_0x934f('0x24')]],'as':_0x75b9f1['as'],'attributes':_0x75b9f1[_0x934f('0x25')],'include':_0x75b9f1[_0x934f('0x23')]?_[_0x934f('0x27')](_0x75b9f1[_0x934f('0x23')],function(_0x492620){return{'model':db[_0x492620['model']],'as':_0x492620['as'],'attributes':_0x492620[_0x934f('0x25')]};}):[]};}):[]};}):[]:[]})[_0x934f('0x12')](function(_0x3e53ff){logger['info'](_0x934f('0x28'),_0x47b9aa);logger['debug'](_0x934f('0x28'),_0x47b9aa,JSON['stringify'](_0x3e53ff));_0x4fab87(_0x3e53ff);})[_0x934f('0x1b')](function(_0x4d2645){logger['error'](_0x934f('0x28'),_0x4d2645[_0x934f('0x19')],_0x47b9aa);_0xbafdf1(_0x2644cd[_0x934f('0x18')](0x1f4,_0x4d2645[_0x934f('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index c7f3551..a3c2ef9 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 _0x3e19=['smsQueue:','./smsQueue.events','save','remove','update','emit','removeListener'];(function(_0x35b44b,_0x2d33b8){var _0x1ccf6a=function(_0xf81a0a){while(--_0xf81a0a){_0x35b44b['push'](_0x35b44b['shift']());}};_0x1ccf6a(++_0x2d33b8);}(_0x3e19,0x1b3));var _0x93e1=function(_0x249e96,_0x3ea39d){_0x249e96=_0x249e96-0x0;var _0x17444c=_0x3e19[_0x249e96];return _0x17444c;};'use strict';var SmsQueueEvents=require(_0x93e1('0x0'));var events=[_0x93e1('0x1'),_0x93e1('0x2'),_0x93e1('0x3')];function createListener(_0x50eb6b,_0x29f51d){return function(_0x4dc514){_0x29f51d[_0x93e1('0x4')](_0x50eb6b,_0x4dc514);};}function removeListener(_0x338ae3,_0x5bde1f){return function(){SmsQueueEvents[_0x93e1('0x5')](_0x338ae3,_0x5bde1f);};}exports['register']=function(_0x5c6026){for(var _0x85ed0e=0x0,_0x5bc053=events['length'];_0x85ed0e<_0x5bc053;_0x85ed0e++){var _0x456fe7=events[_0x85ed0e];var _0x3557dc=createListener(_0x93e1('0x6')+_0x456fe7,_0x5c6026);SmsQueueEvents['on'](_0x456fe7,_0x3557dc);}}; \ No newline at end of file +var _0x1db7=['update','emit','register','length','smsQueue:','./smsQueue.events','save','remove'];(function(_0x1612d6,_0x5577bf){var _0x27a583=function(_0x3dc4a2){while(--_0x3dc4a2){_0x1612d6['push'](_0x1612d6['shift']());}};_0x27a583(++_0x5577bf);}(_0x1db7,0x125));var _0x71db=function(_0x4e1d98,_0x4cee10){_0x4e1d98=_0x4e1d98-0x0;var _0xadbb6=_0x1db7[_0x4e1d98];return _0xadbb6;};'use strict';var SmsQueueEvents=require(_0x71db('0x0'));var events=[_0x71db('0x1'),_0x71db('0x2'),_0x71db('0x3')];function createListener(_0x4b1626,_0x42bdc6){return function(_0x53956c){_0x42bdc6[_0x71db('0x4')](_0x4b1626,_0x53956c);};}function removeListener(_0x1a7306,_0x59e1dc){return function(){SmsQueueEvents['removeListener'](_0x1a7306,_0x59e1dc);};}exports[_0x71db('0x5')]=function(_0x37f9b0){for(var _0x5b758b=0x0,_0x40bc59=events[_0x71db('0x6')];_0x5b758b<_0x40bc59;_0x5b758b++){var _0x46dae7=events[_0x5b758b];var _0x461eee=createListener(_0x71db('0x7')+_0x46dae7,_0x37f9b0);SmsQueueEvents['on'](_0x46dae7,_0x461eee);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 37a9c81..42d6cf1 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 _0x347c=['../../config/environment','./smsQueueReport.controller','isAuthenticated','index','get','describe','/:id','show','post','put','update','delete','exports','util','path','../../components/auth/service','../../components/interaction/service'];(function(_0x4328dd,_0x112860){var _0x3099ab=function(_0x19cca2){while(--_0x19cca2){_0x4328dd['push'](_0x4328dd['shift']());}};_0x3099ab(++_0x112860);}(_0x347c,0xa6));var _0xc347=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x347c[_0x11005e];return _0x29338f;};'use strict';var multer=require('multer');var util=require(_0xc347('0x0'));var path=require(_0xc347('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0xc347('0x2'));var interaction=require(_0xc347('0x3'));var config=require(_0xc347('0x4'));var controller=require(_0xc347('0x5'));router['get']('/',auth[_0xc347('0x6')](),controller[_0xc347('0x7')]);router[_0xc347('0x8')]('/describe',auth[_0xc347('0x6')](),controller[_0xc347('0x9')]);router[_0xc347('0x8')](_0xc347('0xa'),auth[_0xc347('0x6')](),controller[_0xc347('0xb')]);router[_0xc347('0xc')]('/',auth[_0xc347('0x6')](),controller['create']);router[_0xc347('0xd')](_0xc347('0xa'),auth[_0xc347('0x6')](),controller[_0xc347('0xe')]);router[_0xc347('0xf')](_0xc347('0xa'),auth[_0xc347('0x6')](),controller['destroy']);module[_0xc347('0x10')]=router; \ No newline at end of file +var _0x0f4c=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','show','create','put','/:id','update','delete','destroy','exports','multer','util','path','express'];(function(_0x4d2c7e,_0x5df3bc){var _0x1f837f=function(_0xaf0e3b){while(--_0xaf0e3b){_0x4d2c7e['push'](_0x4d2c7e['shift']());}};_0x1f837f(++_0x5df3bc);}(_0x0f4c,0x1f0));var _0xc0f4=function(_0x1a7550,_0x1edace){_0x1a7550=_0x1a7550-0x0;var _0x426e22=_0x0f4c[_0x1a7550];return _0x426e22;};'use strict';var multer=require(_0xc0f4('0x0'));var util=require(_0xc0f4('0x1'));var path=require(_0xc0f4('0x2'));var timeout=require('connect-timeout');var express=require(_0xc0f4('0x3'));var router=express[_0xc0f4('0x4')]();var auth=require(_0xc0f4('0x5'));var interaction=require(_0xc0f4('0x6'));var config=require(_0xc0f4('0x7'));var controller=require(_0xc0f4('0x8'));router[_0xc0f4('0x9')]('/',auth[_0xc0f4('0xa')](),controller[_0xc0f4('0xb')]);router[_0xc0f4('0x9')]('/describe',auth[_0xc0f4('0xa')](),controller['describe']);router['get']('/:id',auth[_0xc0f4('0xa')](),controller[_0xc0f4('0xc')]);router['post']('/',auth[_0xc0f4('0xa')](),controller[_0xc0f4('0xd')]);router[_0xc0f4('0xe')](_0xc0f4('0xf'),auth[_0xc0f4('0xa')](),controller[_0xc0f4('0x10')]);router[_0xc0f4('0x11')](_0xc0f4('0xf'),auth['isAuthenticated'](),controller[_0xc0f4('0x12')]);module[_0xc0f4('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 85610a5..d591837 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 _0xac1d=['DATE','moment','sequelize','exports','STRING'];(function(_0x448f8,_0x2aa1d7){var _0xa73126=function(_0x1fcafa){while(--_0x1fcafa){_0x448f8['push'](_0x448f8['shift']());}};_0xa73126(++_0x2aa1d7);}(_0xac1d,0x12d));var _0xdac1=function(_0x1568d0,_0x2c85c2){_0x1568d0=_0x1568d0-0x0;var _0x422a08=_0xac1d[_0x1568d0];return _0x422a08;};'use strict';var moment=require(_0xdac1('0x0'));var Sequelize=require(_0xdac1('0x1'));module[_0xdac1('0x2')]={'uniqueid':{'type':Sequelize[_0xdac1('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xdac1('0x4')]},'leaveAt':{'type':Sequelize[_0xdac1('0x4')]},'acceptAt':{'type':Sequelize[_0xdac1('0x4')]},'exitAt':{'type':Sequelize[_0xdac1('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xac5e=['exports','STRING','DATE','sequelize'];(function(_0x23c2b7,_0x57b41a){var _0x4c7225=function(_0x165d69){while(--_0x165d69){_0x23c2b7['push'](_0x23c2b7['shift']());}};_0x4c7225(++_0x57b41a);}(_0xac5e,0x143));var _0xeac5=function(_0x381ae0,_0x1e6179){_0x381ae0=_0x381ae0-0x0;var _0x464665=_0xac5e[_0x381ae0];return _0x464665;};'use strict';var moment=require('moment');var Sequelize=require(_0xeac5('0x0'));module[_0xeac5('0x1')]={'uniqueid':{'type':Sequelize[_0xeac5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xeac5('0x3')]},'leaveAt':{'type':Sequelize[_0xeac5('0x3')]},'acceptAt':{'type':Sequelize[_0xeac5('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xeac5('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 0be79a1..1538072 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 _0x7a54=['Content-Range','apply','reject','save','then','destroy','sendStatus','error','name','send','map','SmsQueueReport','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','field','options','count','include','findAll','rows','catch','show','includeAll','find','create','body','update','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','set'];(function(_0x33821c,_0x3088c6){var _0x3f5e70=function(_0x52366f){while(--_0x52366f){_0x33821c['push'](_0x33821c['shift']());}};_0x3f5e70(++_0x3088c6);}(_0x7a54,0x106));var _0x47a5=function(_0x42de85,_0x39d582){_0x42de85=_0x42de85-0x0;var _0x1f2b03=_0x7a54[_0x42de85];return _0x1f2b03;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var db=require(_0x47a5('0x14'))['db'];function respondWithStatusCode(_0xd612dd,_0xd308b8){_0xd308b8=_0xd308b8||0xcc;return function(_0x1eae59){if(_0x1eae59){return _0xd612dd['sendStatus'](_0xd308b8);}return _0xd612dd[_0x47a5('0x15')](_0xd308b8)[_0x47a5('0x16')]();};}function respondWithResult(_0x1cf309,_0x711793){_0x711793=_0x711793||0xc8;return function(_0x139f25){if(_0x139f25){return _0x1cf309[_0x47a5('0x15')](_0x711793)[_0x47a5('0x17')](_0x139f25);}};}function respondWithFilteredResult(_0x190faa,_0x4e99a8){return function(_0x362359){if(_0x362359){var _0x11faf5=_0x362359['count'],_0x3b001e=_0x4e99a8['offset'],_0x2a2cbb=_0x4e99a8[_0x47a5('0x18')]+_0x4e99a8['limit'],_0x1ef44c;if(_0x2a2cbb>=_0x11faf5){_0x2a2cbb=_0x11faf5;_0x1ef44c=0xc8;}else{_0x1ef44c=0xce;}_0x190faa['status'](_0x1ef44c);return _0x190faa[_0x47a5('0x19')](_0x47a5('0x1a'),_0x3b001e+'-'+_0x2a2cbb+'/'+_0x11faf5)[_0x47a5('0x17')](_0x362359);}return null;};}function patchUpdates(_0x1ef371){return function(_0x477b1d){try{jsonpatch[_0x47a5('0x1b')](_0x477b1d,_0x1ef371,!![]);}catch(_0x2763d6){return BPromise[_0x47a5('0x1c')](_0x2763d6);}return _0x477b1d[_0x47a5('0x1d')]();};}function saveUpdates(_0x4a9fcb,_0x1570bc){return function(_0xf160ba){if(_0xf160ba){return _0xf160ba['update'](_0x4a9fcb)[_0x47a5('0x1e')](function(_0x1f03f7){return _0x1f03f7;});}return null;};}function removeEntity(_0x36874d,_0x4c5910){return function(_0xb8ae6c){if(_0xb8ae6c){return _0xb8ae6c[_0x47a5('0x1f')]()[_0x47a5('0x1e')](function(){_0x36874d[_0x47a5('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe2dea9,_0x385687){return function(_0x513981){if(!_0x513981){_0xe2dea9[_0x47a5('0x20')](0x194);}return _0x513981;};}function handleError(_0xc4cd63,_0x4437f1){_0x4437f1=_0x4437f1||0x1f4;return function(_0x129ce5){logger[_0x47a5('0x21')](_0x129ce5['stack']);if(_0x129ce5['name']){delete _0x129ce5[_0x47a5('0x22')];}_0xc4cd63['status'](_0x4437f1)[_0x47a5('0x23')](_0x129ce5);};}exports['index']=function(_0x23cb77,_0x378208){var _0x36ad34={},_0x1dac65={},_0x21f296={'count':0x0,'rows':[]};var _0x3ba0b7=_[_0x47a5('0x24')](db[_0x47a5('0x25')][_0x47a5('0x26')],function(_0x361bfa){return{'name':_0x361bfa[_0x47a5('0x27')],'type':_0x361bfa[_0x47a5('0x28')][_0x47a5('0x29')]};});_0x1dac65['model']=_[_0x47a5('0x24')](_0x3ba0b7,'name');_0x1dac65[_0x47a5('0x2a')]=_[_0x47a5('0x2b')](_0x23cb77[_0x47a5('0x2a')]);_0x1dac65['filters']=_[_0x47a5('0x2c')](_0x1dac65[_0x47a5('0x2d')],_0x1dac65[_0x47a5('0x2a')]);_0x36ad34[_0x47a5('0x2e')]=_['intersection'](_0x1dac65['model'],qs[_0x47a5('0x2f')](_0x23cb77[_0x47a5('0x2a')]['fields']));_0x36ad34['attributes']=_0x36ad34[_0x47a5('0x2e')][_0x47a5('0x30')]?_0x36ad34['attributes']:_0x1dac65[_0x47a5('0x2d')];if(!_0x23cb77['query'][_0x47a5('0x31')](_0x47a5('0x32'))){_0x36ad34['limit']=qs['limit'](_0x23cb77[_0x47a5('0x2a')]['limit']);_0x36ad34[_0x47a5('0x18')]=qs[_0x47a5('0x18')](_0x23cb77[_0x47a5('0x2a')]['offset']);}_0x36ad34[_0x47a5('0x33')]=qs['sort'](_0x23cb77['query'][_0x47a5('0x34')]);_0x36ad34['where']=qs[_0x47a5('0x35')](_['pick'](_0x23cb77[_0x47a5('0x2a')],_0x1dac65[_0x47a5('0x35')]));if(_0x23cb77[_0x47a5('0x2a')][_0x47a5('0x36')]){_0x36ad34[_0x47a5('0x37')]=_[_0x47a5('0x38')](_0x36ad34[_0x47a5('0x37')],{'$or':_[_0x47a5('0x24')](_0x3ba0b7,function(_0x1a0d23){if(_0x1a0d23['type'][_0x47a5('0x29')]!==_0x47a5('0x39')){var _0x511c06={};_0x511c06[_0x1a0d23[_0x47a5('0x3a')]]={'$like':'%'+_0x23cb77[_0x47a5('0x2a')][_0x47a5('0x36')]+'%'};return _0x511c06;}})});}_0x36ad34=_['merge']({},_0x36ad34,_0x23cb77[_0x47a5('0x3b')]);var _0x10f660={'where':_0x36ad34['where']};return db[_0x47a5('0x25')][_0x47a5('0x3c')](_0x10f660)['then'](function(_0x55c5eb){_0x21f296['count']=_0x55c5eb;if(_0x23cb77[_0x47a5('0x2a')]['includeAll']){_0x36ad34[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x25')][_0x47a5('0x3e')](_0x36ad34);})[_0x47a5('0x1e')](function(_0x1b2c80){_0x21f296[_0x47a5('0x3f')]=_0x1b2c80;return _0x21f296;})[_0x47a5('0x1e')](respondWithFilteredResult(_0x378208,_0x36ad34))[_0x47a5('0x40')](handleError(_0x378208,null));};exports[_0x47a5('0x41')]=function(_0x36a24e,_0x280500){var _0x1658e8={'raw':!![],'where':{'id':_0x36a24e['params']['id']}},_0x23d6d8={};_0x23d6d8[_0x47a5('0x2d')]=_[_0x47a5('0x2b')](db[_0x47a5('0x25')][_0x47a5('0x26')]);_0x23d6d8['query']=_[_0x47a5('0x2b')](_0x36a24e['query']);_0x23d6d8['filters']=_['intersection'](_0x23d6d8['model'],_0x23d6d8[_0x47a5('0x2a')]);_0x1658e8['attributes']=_[_0x47a5('0x2c')](_0x23d6d8[_0x47a5('0x2d')],qs[_0x47a5('0x2f')](_0x36a24e['query'][_0x47a5('0x2f')]));_0x1658e8[_0x47a5('0x2e')]=_0x1658e8['attributes']['length']?_0x1658e8[_0x47a5('0x2e')]:_0x23d6d8['model'];if(_0x36a24e[_0x47a5('0x2a')][_0x47a5('0x42')]){_0x1658e8[_0x47a5('0x3d')]=[{'all':!![]}];}_0x1658e8=_[_0x47a5('0x38')]({},_0x1658e8,_0x36a24e[_0x47a5('0x3b')]);return db[_0x47a5('0x25')][_0x47a5('0x43')](_0x1658e8)[_0x47a5('0x1e')](handleEntityNotFound(_0x280500,null))[_0x47a5('0x1e')](respondWithResult(_0x280500,null))[_0x47a5('0x40')](handleError(_0x280500,null));};exports[_0x47a5('0x44')]=function(_0x3c3ebf,_0xe28d76){return db[_0x47a5('0x25')][_0x47a5('0x44')](_0x3c3ebf[_0x47a5('0x45')],{})['then'](respondWithResult(_0xe28d76,0xc9))[_0x47a5('0x40')](handleError(_0xe28d76,null));};exports[_0x47a5('0x46')]=function(_0x49eab1,_0x52b3a8){if(_0x49eab1[_0x47a5('0x45')]['id']){delete _0x49eab1['body']['id'];}return db[_0x47a5('0x25')][_0x47a5('0x43')]({'where':{'id':_0x49eab1['params']['id']}})['then'](handleEntityNotFound(_0x52b3a8,null))[_0x47a5('0x1e')](saveUpdates(_0x49eab1['body'],null))[_0x47a5('0x1e')](respondWithResult(_0x52b3a8,null))[_0x47a5('0x40')](handleError(_0x52b3a8,null));};exports[_0x47a5('0x1f')]=function(_0x3e12a7,_0x44fe8a){return db[_0x47a5('0x25')][_0x47a5('0x43')]({'where':{'id':_0x3e12a7['params']['id']}})['then'](handleEntityNotFound(_0x44fe8a,null))[_0x47a5('0x1e')](removeEntity(_0x44fe8a,null))[_0x47a5('0x40')](handleError(_0x44fe8a,null));};exports[_0x47a5('0x47')]=function(_0x9ea93e,_0x2c7020){return db[_0x47a5('0x25')][_0x47a5('0x47')]()['then'](respondWithResult(_0x2c7020,null))[_0x47a5('0x40')](handleError(_0x2c7020,null));}; \ No newline at end of file +var _0x9957=['describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','save','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','pick','filter','where','merge','field','options','SmsQueueReport','count','includeAll','include','findAll','catch','show','create','update','body','params','find'];(function(_0x405022,_0x2377a8){var _0x3b29e7=function(_0xb927b5){while(--_0xb927b5){_0x405022['push'](_0x405022['shift']());}};_0x3b29e7(++_0x2377a8);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var pdf=require(_0x7995('0x0'));var emlformat=require(_0x7995('0x1'));var rimraf=require(_0x7995('0x2'));var zipdir=require(_0x7995('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7995('0x4'));var moment=require(_0x7995('0x5'));var BPromise=require(_0x7995('0x6'));var Mustache=require(_0x7995('0x7'));var util=require('util');var path=require(_0x7995('0x8'));var sox=require(_0x7995('0x9'));var csv=require(_0x7995('0xa'));var ejs=require(_0x7995('0xb'));var fs=require('fs');var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var db=require(_0x7995('0x19'))['db'];function respondWithStatusCode(_0x2cb37a,_0x19a27e){_0x19a27e=_0x19a27e||0xcc;return function(_0x385f00){if(_0x385f00){return _0x2cb37a[_0x7995('0x1a')](_0x19a27e);}return _0x2cb37a[_0x7995('0x1b')](_0x19a27e)[_0x7995('0x1c')]();};}function respondWithResult(_0x4cc004,_0x58f5ad){_0x58f5ad=_0x58f5ad||0xc8;return function(_0x2b4e94){if(_0x2b4e94){return _0x4cc004[_0x7995('0x1b')](_0x58f5ad)[_0x7995('0x1d')](_0x2b4e94);}};}function respondWithFilteredResult(_0x321ae8,_0x3f1d3e){return function(_0x1a5310){if(_0x1a5310){var _0x2202ce=_0x1a5310['count'],_0x41cbf0=_0x3f1d3e[_0x7995('0x1e')],_0x5377e5=_0x3f1d3e[_0x7995('0x1e')]+_0x3f1d3e[_0x7995('0x1f')],_0x2eeacc;if(_0x5377e5>=_0x2202ce){_0x5377e5=_0x2202ce;_0x2eeacc=0xc8;}else{_0x2eeacc=0xce;}_0x321ae8[_0x7995('0x1b')](_0x2eeacc);return _0x321ae8[_0x7995('0x20')](_0x7995('0x21'),_0x41cbf0+'-'+_0x5377e5+'/'+_0x2202ce)['json'](_0x1a5310);}return null;};}function patchUpdates(_0x54c9ae){return function(_0x2536c8){try{jsonpatch['apply'](_0x2536c8,_0x54c9ae,!![]);}catch(_0x555f74){return BPromise[_0x7995('0x22')](_0x555f74);}return _0x2536c8[_0x7995('0x23')]();};}function saveUpdates(_0x4cbe10,_0x3a9b54){return function(_0x51f276){if(_0x51f276){return _0x51f276['update'](_0x4cbe10)[_0x7995('0x24')](function(_0x327b1f){return _0x327b1f;});}return null;};}function removeEntity(_0x350fd9,_0x1a8568){return function(_0x460924){if(_0x460924){return _0x460924[_0x7995('0x25')]()['then'](function(){_0x350fd9[_0x7995('0x1b')](0xcc)[_0x7995('0x1c')]();});}};}function handleEntityNotFound(_0x204507,_0x285437){return function(_0x563799){if(!_0x563799){_0x204507[_0x7995('0x1a')](0x194);}return _0x563799;};}function handleError(_0x475351,_0x472195){_0x472195=_0x472195||0x1f4;return function(_0x59405a){logger[_0x7995('0x26')](_0x59405a[_0x7995('0x27')]);if(_0x59405a[_0x7995('0x28')]){delete _0x59405a[_0x7995('0x28')];}_0x475351[_0x7995('0x1b')](_0x472195)[_0x7995('0x29')](_0x59405a);};}exports['index']=function(_0x47625f,_0x5911c3){var _0x229742={},_0x49bc7e={},_0xf16cc2={'count':0x0,'rows':[]};var _0x132a42=_[_0x7995('0x2a')](db['SmsQueueReport'][_0x7995('0x2b')],function(_0x514445){return{'name':_0x514445[_0x7995('0x2c')],'type':_0x514445[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x49bc7e['model']=_['map'](_0x132a42,'name');_0x49bc7e[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x47625f[_0x7995('0x2f')]);_0x49bc7e[_0x7995('0x31')]=_[_0x7995('0x32')](_0x49bc7e[_0x7995('0x33')],_0x49bc7e['query']);_0x229742['attributes']=_[_0x7995('0x32')](_0x49bc7e['model'],qs[_0x7995('0x34')](_0x47625f[_0x7995('0x2f')][_0x7995('0x34')]));_0x229742[_0x7995('0x35')]=_0x229742[_0x7995('0x35')]['length']?_0x229742[_0x7995('0x35')]:_0x49bc7e[_0x7995('0x33')];if(!_0x47625f['query']['hasOwnProperty']('nolimit')){_0x229742[_0x7995('0x1f')]=qs[_0x7995('0x1f')](_0x47625f['query'][_0x7995('0x1f')]);_0x229742['offset']=qs[_0x7995('0x1e')](_0x47625f[_0x7995('0x2f')][_0x7995('0x1e')]);}_0x229742['order']=qs['sort'](_0x47625f[_0x7995('0x2f')]['sort']);_0x229742['where']=qs[_0x7995('0x31')](_[_0x7995('0x36')](_0x47625f['query'],_0x49bc7e[_0x7995('0x31')]));if(_0x47625f[_0x7995('0x2f')][_0x7995('0x37')]){_0x229742[_0x7995('0x38')]=_[_0x7995('0x39')](_0x229742['where'],{'$or':_[_0x7995('0x2a')](_0x132a42,function(_0x242713){if(_0x242713[_0x7995('0x2d')][_0x7995('0x2e')]!=='VIRTUAL'){var _0x2be2c0={};_0x2be2c0[_0x242713[_0x7995('0x3a')]]={'$like':'%'+_0x47625f[_0x7995('0x2f')][_0x7995('0x37')]+'%'};return _0x2be2c0;}})});}_0x229742=_[_0x7995('0x39')]({},_0x229742,_0x47625f[_0x7995('0x3b')]);var _0x5688a1={'where':_0x229742[_0x7995('0x38')]};return db[_0x7995('0x3c')][_0x7995('0x3d')](_0x5688a1)[_0x7995('0x24')](function(_0x2e04cd){_0xf16cc2[_0x7995('0x3d')]=_0x2e04cd;if(_0x47625f[_0x7995('0x2f')][_0x7995('0x3e')]){_0x229742[_0x7995('0x3f')]=[{'all':!![]}];}return db[_0x7995('0x3c')][_0x7995('0x40')](_0x229742);})[_0x7995('0x24')](function(_0x7b4e67){_0xf16cc2['rows']=_0x7b4e67;return _0xf16cc2;})['then'](respondWithFilteredResult(_0x5911c3,_0x229742))[_0x7995('0x41')](handleError(_0x5911c3,null));};exports[_0x7995('0x42')]=function(_0x58523e,_0x4b0855){var _0x3f8522={'raw':!![],'where':{'id':_0x58523e['params']['id']}},_0x4a9fef={};_0x4a9fef[_0x7995('0x33')]=_[_0x7995('0x30')](db[_0x7995('0x3c')]['rawAttributes']);_0x4a9fef[_0x7995('0x2f')]=_['keys'](_0x58523e[_0x7995('0x2f')]);_0x4a9fef['filters']=_['intersection'](_0x4a9fef[_0x7995('0x33')],_0x4a9fef[_0x7995('0x2f')]);_0x3f8522[_0x7995('0x35')]=_[_0x7995('0x32')](_0x4a9fef['model'],qs[_0x7995('0x34')](_0x58523e[_0x7995('0x2f')][_0x7995('0x34')]));_0x3f8522[_0x7995('0x35')]=_0x3f8522['attributes']['length']?_0x3f8522[_0x7995('0x35')]:_0x4a9fef['model'];if(_0x58523e[_0x7995('0x2f')]['includeAll']){_0x3f8522[_0x7995('0x3f')]=[{'all':!![]}];}_0x3f8522=_['merge']({},_0x3f8522,_0x58523e[_0x7995('0x3b')]);return db[_0x7995('0x3c')]['find'](_0x3f8522)[_0x7995('0x24')](handleEntityNotFound(_0x4b0855,null))[_0x7995('0x24')](respondWithResult(_0x4b0855,null))[_0x7995('0x41')](handleError(_0x4b0855,null));};exports[_0x7995('0x43')]=function(_0x4c6837,_0x2458cb){return db[_0x7995('0x3c')][_0x7995('0x43')](_0x4c6837['body'],{})[_0x7995('0x24')](respondWithResult(_0x2458cb,0xc9))[_0x7995('0x41')](handleError(_0x2458cb,null));};exports[_0x7995('0x44')]=function(_0x3d8ae3,_0x255313){if(_0x3d8ae3['body']['id']){delete _0x3d8ae3[_0x7995('0x45')]['id'];}return db[_0x7995('0x3c')]['find']({'where':{'id':_0x3d8ae3[_0x7995('0x46')]['id']}})['then'](handleEntityNotFound(_0x255313,null))[_0x7995('0x24')](saveUpdates(_0x3d8ae3[_0x7995('0x45')],null))[_0x7995('0x24')](respondWithResult(_0x255313,null))[_0x7995('0x41')](handleError(_0x255313,null));};exports[_0x7995('0x25')]=function(_0x14b537,_0x1579b9){return db['SmsQueueReport'][_0x7995('0x47')]({'where':{'id':_0x14b537[_0x7995('0x46')]['id']}})[_0x7995('0x24')](handleEntityNotFound(_0x1579b9,null))['then'](removeEntity(_0x1579b9,null))[_0x7995('0x41')](handleError(_0x1579b9,null));};exports[_0x7995('0x48')]=function(_0x12d4b8,_0x47d1d8){return db['SmsQueueReport']['describe']()[_0x7995('0x24')](respondWithResult(_0x47d1d8,null))[_0x7995('0x41')](handleError(_0x47d1d8,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 8254868..e7d2d91 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 _0x76f0=['./smsQueueReport.attributes','exports','SmsQueueReport','report_sms_queue','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x3b8f2e,_0x5a99a8){var _0x1433d5=function(_0x5e0353){while(--_0x5e0353){_0x3b8f2e['push'](_0x3b8f2e['shift']());}};_0x1433d5(++_0x5a99a8);}(_0x76f0,0x157));var _0x076f=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x76f0[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x076f('0x0'));var util=require(_0x076f('0x1'));var logger=require(_0x076f('0x2'))(_0x076f('0x3'));var moment=require('moment');var BPromise=require(_0x076f('0x4'));var rp=require(_0x076f('0x5'));var fs=require('fs');var path=require(_0x076f('0x6'));var rimraf=require(_0x076f('0x7'));var config=require('../../config/environment');var attributes=require(_0x076f('0x8'));module[_0x076f('0x9')]=function(_0x4ec9e6,_0x2f0e2d){return _0x4ec9e6['define'](_0x076f('0xa'),attributes,{'tableName':_0x076f('0xb'),'paranoid':![],'indexes':[{'name':_0x076f('0xc'),'fields':[_0x076f('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0077=['uniqueid','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./smsQueueReport.attributes','exports','define','SmsQueueReport'];(function(_0x3d73ba,_0x356e23){var _0x47e406=function(_0x90df31){while(--_0x90df31){_0x3d73ba['push'](_0x3d73ba['shift']());}};_0x47e406(++_0x356e23);}(_0x0077,0x15d));var _0x7007=function(_0x865846,_0x39ffa5){_0x865846=_0x865846-0x0;var _0x529505=_0x0077[_0x865846];return _0x529505;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7007('0x0'))(_0x7007('0x1'));var moment=require(_0x7007('0x2'));var BPromise=require(_0x7007('0x3'));var rp=require(_0x7007('0x4'));var fs=require('fs');var path=require(_0x7007('0x5'));var rimraf=require(_0x7007('0x6'));var config=require('../../config/environment');var attributes=require(_0x7007('0x7'));module[_0x7007('0x8')]=function(_0x550b91,_0xa95e5b){return _0x550b91[_0x7007('0x9')](_0x7007('0xa'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':_0x7007('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 8a3d093..9dad1c8 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 _0x6e14=['bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','CreateSmsQueueReport','SmsQueueReport','create','options','raw','info','stringify','UpdateSmsQueueReport','update','attributes','limit','then','util','moment'];(function(_0x5421e9,_0x3d04ef){var _0x4cb0b4=function(_0xf096d3){while(--_0xf096d3){_0x5421e9['push'](_0x5421e9['shift']());}};_0x4cb0b4(++_0x3d04ef);}(_0x6e14,0x19e));var _0x46e1=function(_0x261ec6,_0x230b31){_0x261ec6=_0x261ec6-0x0;var _0x1b468e=_0x6e14[_0x261ec6];return _0x1b468e;};'use strict';var _=require('lodash');var util=require(_0x46e1('0x0'));var moment=require(_0x46e1('0x1'));var BPromise=require(_0x46e1('0x2'));var rs=require(_0x46e1('0x3'));var fs=require('fs');var Redis=require(_0x46e1('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x46e1('0x5'));var logger=require('../../config/logger')(_0x46e1('0x6'));var config=require(_0x46e1('0x7'));var jayson=require(_0x46e1('0x8'));var client=jayson[_0x46e1('0x9')][_0x46e1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x453248,_0x147138,_0x4db3da){return new BPromise(function(_0x2b2d40,_0x1c5e48){return client[_0x46e1('0xb')](_0x453248,_0x4db3da)['then'](function(_0x272451){logger['info'](_0x46e1('0xc'),_0x147138,_0x46e1('0xd'));logger[_0x46e1('0xe')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x147138,'request\x20sent',JSON['stringify'](_0x272451));if(_0x272451[_0x46e1('0xf')]){if(_0x272451[_0x46e1('0xf')][_0x46e1('0x10')]===0x1f4){logger['error'](_0x46e1('0xc'),_0x147138,_0x272451[_0x46e1('0xf')][_0x46e1('0x11')]);return _0x1c5e48(_0x272451[_0x46e1('0xf')]['message']);}logger[_0x46e1('0xf')]('SmsQueueReport,\x20%s,\x20%s',_0x147138,_0x272451['error'][_0x46e1('0x11')]);return _0x2b2d40(_0x272451[_0x46e1('0xf')][_0x46e1('0x11')]);}else{logger['info'](_0x46e1('0xc'),_0x147138,_0x46e1('0xd'));_0x2b2d40(_0x272451[_0x46e1('0x12')][_0x46e1('0x11')]);}})[_0x46e1('0x13')](function(_0x518158){logger[_0x46e1('0xf')](_0x46e1('0xc'),_0x147138,_0x518158);_0x1c5e48(_0x518158);});});}exports[_0x46e1('0x14')]=function(_0x1094b9){var _0xf51869=this;return new Promise(function(_0x33e8ee,_0x120b94){return db[_0x46e1('0x15')][_0x46e1('0x16')](_0x1094b9['body'],{'raw':_0x1094b9[_0x46e1('0x17')]?_0x1094b9[_0x46e1('0x17')][_0x46e1('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x3fb97a){logger[_0x46e1('0x19')](_0x46e1('0x14'),_0x1094b9);logger['debug']('CreateSmsQueueReport',_0x1094b9,JSON[_0x46e1('0x1a')](_0x3fb97a));_0x33e8ee(_0x3fb97a);})[_0x46e1('0x13')](function(_0x3c3f82){logger[_0x46e1('0xf')](_0x46e1('0x14'),_0x3c3f82[_0x46e1('0x11')],_0x1094b9);_0x120b94(_0xf51869[_0x46e1('0xf')](0x1f4,_0x3c3f82[_0x46e1('0x11')]));});});};exports[_0x46e1('0x1b')]=function(_0x23e3c9){var _0x363042=this;return new Promise(function(_0x4cfc63,_0x171522){return db[_0x46e1('0x15')][_0x46e1('0x1c')](_0x23e3c9['body'],{'raw':_0x23e3c9[_0x46e1('0x17')]?_0x23e3c9[_0x46e1('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x23e3c9[_0x46e1('0x17')]?_0x23e3c9[_0x46e1('0x17')]['where']||null:null,'attributes':_0x23e3c9[_0x46e1('0x17')]?_0x23e3c9[_0x46e1('0x17')][_0x46e1('0x1d')]||null:null,'limit':_0x23e3c9['options']?_0x23e3c9[_0x46e1('0x17')][_0x46e1('0x1e')]||null:null})[_0x46e1('0x1f')](function(_0x28f74f){logger[_0x46e1('0x19')](_0x46e1('0x1b'),_0x23e3c9);logger[_0x46e1('0xe')](_0x46e1('0x1b'),_0x23e3c9,JSON['stringify'](_0x28f74f));_0x4cfc63(_0x28f74f);})[_0x46e1('0x13')](function(_0x1cc8b6){logger[_0x46e1('0xf')](_0x46e1('0x1b'),_0x1cc8b6['message'],_0x23e3c9);_0x171522(_0x363042[_0x46e1('0xf')](0x1f4,_0x1cc8b6['message']));});});}; \ No newline at end of file +var _0x1311=['request','then','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SmsQueueReport,\x20%s,\x20%s','message','info','result','catch','CreateSmsQueueReport','SmsQueueReport','body','options','raw','UpdateSmsQueueReport','where','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http'];(function(_0x556653,_0x5047a3){var _0x27529a=function(_0x3597ab){while(--_0x3597ab){_0x556653['push'](_0x556653['shift']());}};_0x27529a(++_0x5047a3);}(_0x1311,0x12b));var _0x1131=function(_0x251ee1,_0x3546f3){_0x251ee1=_0x251ee1-0x0;var _0x544c8d=_0x1311[_0x251ee1];return _0x544c8d;};'use strict';var _=require(_0x1131('0x0'));var util=require(_0x1131('0x1'));var moment=require(_0x1131('0x2'));var BPromise=require(_0x1131('0x3'));var rs=require(_0x1131('0x4'));var fs=require('fs');var Redis=require(_0x1131('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x1131('0x6'));var logger=require('../../config/logger')(_0x1131('0x7'));var config=require(_0x1131('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1131('0x9')][_0x1131('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2879dd,_0x1a3659,_0x20531e){return new BPromise(function(_0x4cdc93,_0x334265){return client[_0x1131('0xb')](_0x2879dd,_0x20531e)[_0x1131('0xc')](function(_0x3fe894){logger['info']('SmsQueueReport,\x20%s,\x20%s',_0x1a3659,'request\x20sent');logger[_0x1131('0xd')](_0x1131('0xe'),_0x1a3659,_0x1131('0xf'),JSON[_0x1131('0x10')](_0x3fe894));if(_0x3fe894[_0x1131('0x11')]){if(_0x3fe894['error'][_0x1131('0x12')]===0x1f4){logger[_0x1131('0x11')](_0x1131('0x13'),_0x1a3659,_0x3fe894[_0x1131('0x11')][_0x1131('0x14')]);return _0x334265(_0x3fe894[_0x1131('0x11')][_0x1131('0x14')]);}logger[_0x1131('0x11')]('SmsQueueReport,\x20%s,\x20%s',_0x1a3659,_0x3fe894[_0x1131('0x11')]['message']);return _0x4cdc93(_0x3fe894['error'][_0x1131('0x14')]);}else{logger[_0x1131('0x15')]('SmsQueueReport,\x20%s,\x20%s',_0x1a3659,'request\x20sent');_0x4cdc93(_0x3fe894[_0x1131('0x16')][_0x1131('0x14')]);}})[_0x1131('0x17')](function(_0x23c51a){logger['error']('SmsQueueReport,\x20%s,\x20%s',_0x1a3659,_0x23c51a);_0x334265(_0x23c51a);});});}exports[_0x1131('0x18')]=function(_0x29aebd){var _0x2898a7=this;return new Promise(function(_0x839bb0,_0x1885c9){return db[_0x1131('0x19')]['create'](_0x29aebd[_0x1131('0x1a')],{'raw':_0x29aebd[_0x1131('0x1b')]?_0x29aebd[_0x1131('0x1b')][_0x1131('0x1c')]===undefined?!![]:![]:!![]})[_0x1131('0xc')](function(_0x310f3e){logger['info'](_0x1131('0x18'),_0x29aebd);logger[_0x1131('0xd')](_0x1131('0x18'),_0x29aebd,JSON[_0x1131('0x10')](_0x310f3e));_0x839bb0(_0x310f3e);})[_0x1131('0x17')](function(_0x4d586f){logger['error']('CreateSmsQueueReport',_0x4d586f[_0x1131('0x14')],_0x29aebd);_0x1885c9(_0x2898a7['error'](0x1f4,_0x4d586f[_0x1131('0x14')]));});});};exports[_0x1131('0x1d')]=function(_0x1c48ac){var _0x449daf=this;return new Promise(function(_0x34ff83,_0x78b9ea){return db[_0x1131('0x19')]['update'](_0x1c48ac[_0x1131('0x1a')],{'raw':_0x1c48ac[_0x1131('0x1b')]?_0x1c48ac[_0x1131('0x1b')][_0x1131('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c48ac[_0x1131('0x1b')]?_0x1c48ac[_0x1131('0x1b')][_0x1131('0x1e')]||null:null,'attributes':_0x1c48ac[_0x1131('0x1b')]?_0x1c48ac[_0x1131('0x1b')]['attributes']||null:null,'limit':_0x1c48ac['options']?_0x1c48ac[_0x1131('0x1b')]['limit']||null:null})[_0x1131('0xc')](function(_0x286be6){logger['info'](_0x1131('0x1d'),_0x1c48ac);logger['debug'](_0x1131('0x1d'),_0x1c48ac,JSON[_0x1131('0x10')](_0x286be6));_0x34ff83(_0x286be6);})[_0x1131('0x17')](function(_0x482061){logger['error'](_0x1131('0x1d'),_0x482061[_0x1131('0x14')],_0x1c48ac);_0x78b9ea(_0x449daf[_0x1131('0x11')](0x1f4,_0x482061[_0x1131('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 89e504a..10aa453 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 _0x2547=['../../config/environment','get','isAuthenticated','index','describe','create','put','/:id','update','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x21b5fa,_0x1c11f5){var _0x5b6aa9=function(_0x39393c){while(--_0x39393c){_0x21b5fa['push'](_0x21b5fa['shift']());}};_0x5b6aa9(++_0x1c11f5);}(_0x2547,0x1cd));var _0x7254=function(_0x393b73,_0x1cc548){_0x393b73=_0x393b73-0x0;var _0x1b7ca3=_0x2547[_0x393b73];return _0x1b7ca3;};'use strict';var multer=require('multer');var util=require(_0x7254('0x0'));var path=require(_0x7254('0x1'));var timeout=require(_0x7254('0x2'));var express=require(_0x7254('0x3'));var router=express[_0x7254('0x4')]();var auth=require(_0x7254('0x5'));var interaction=require(_0x7254('0x6'));var config=require(_0x7254('0x7'));var controller=require('./smsTransferReport.controller');router[_0x7254('0x8')]('/',auth[_0x7254('0x9')](),controller[_0x7254('0xa')]);router[_0x7254('0x8')]('/describe',auth[_0x7254('0x9')](),controller[_0x7254('0xb')]);router[_0x7254('0x8')]('/:id',auth[_0x7254('0x9')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x7254('0xc')]);router[_0x7254('0xd')](_0x7254('0xe'),auth[_0x7254('0x9')](),controller[_0x7254('0xf')]);router[_0x7254('0x10')]('/:id',auth[_0x7254('0x9')](),controller['destroy']);module[_0x7254('0x11')]=router; \ No newline at end of file +var _0xe5b5=['show','post','put','update','delete','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x3ba994,_0x3dd46c){var _0x1d0084=function(_0x2bc9df){while(--_0x2bc9df){_0x3ba994['push'](_0x3ba994['shift']());}};_0x1d0084(++_0x3dd46c);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x3cb30b,_0x504b3e){_0x3cb30b=_0x3cb30b-0x0;var _0x2ca717=_0xe5b5[_0x3cb30b];return _0x2ca717;};'use strict';var multer=require(_0x5e5b('0x0'));var util=require(_0x5e5b('0x1'));var path=require(_0x5e5b('0x2'));var timeout=require(_0x5e5b('0x3'));var express=require(_0x5e5b('0x4'));var router=express[_0x5e5b('0x5')]();var auth=require(_0x5e5b('0x6'));var interaction=require(_0x5e5b('0x7'));var config=require(_0x5e5b('0x8'));var controller=require(_0x5e5b('0x9'));router[_0x5e5b('0xa')]('/',auth[_0x5e5b('0xb')](),controller[_0x5e5b('0xc')]);router[_0x5e5b('0xa')](_0x5e5b('0xd'),auth[_0x5e5b('0xb')](),controller[_0x5e5b('0xe')]);router[_0x5e5b('0xa')](_0x5e5b('0xf'),auth[_0x5e5b('0xb')](),controller[_0x5e5b('0x10')]);router[_0x5e5b('0x11')]('/',auth[_0x5e5b('0xb')](),controller['create']);router[_0x5e5b('0x12')]('/:id',auth[_0x5e5b('0xb')](),controller[_0x5e5b('0x13')]);router[_0x5e5b('0x14')](_0x5e5b('0xf'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 95fff8e..3815638 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 _0x79d4=['moment','sequelize','exports','STRING','ENUM','agent','queue','DATE','NOW'];(function(_0x284fa9,_0x472182){var _0x3abfee=function(_0x51a93b){while(--_0x51a93b){_0x284fa9['push'](_0x284fa9['shift']());}};_0x3abfee(++_0x472182);}(_0x79d4,0x1dd));var _0x479d=function(_0x12aac9,_0x542a4f){_0x12aac9=_0x12aac9-0x0;var _0x46faa4=_0x79d4[_0x12aac9];return _0x46faa4;};'use strict';var moment=require(_0x479d('0x0'));var Sequelize=require(_0x479d('0x1'));module[_0x479d('0x2')]={'uniqueid':{'type':Sequelize[_0x479d('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x479d('0x4')]('account',_0x479d('0x5'),_0x479d('0x6')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0x479d('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x479d('0x8')]}}; \ No newline at end of file +var _0xceaa=['agent','NOW','moment','sequelize','exports','STRING','ENUM','account'];(function(_0x54d4fe,_0x55e869){var _0x1ab5bb=function(_0x5b1af2){while(--_0x5b1af2){_0x54d4fe['push'](_0x54d4fe['shift']());}};_0x1ab5bb(++_0x55e869);}(_0xceaa,0xea));var _0xacea=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xceaa[_0x321bb2];return _0x9c12ed;};'use strict';var moment=require(_0xacea('0x0'));var Sequelize=require(_0xacea('0x1'));module[_0xacea('0x2')]={'uniqueid':{'type':Sequelize[_0xacea('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xacea('0x4')](_0xacea('0x5'),_0xacea('0x6'),'queue'),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0xacea('0x7')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 96f6208..519fcc9 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 _0x5779=['bluebird','util','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','sendStatus','status','end','json','offset','limit','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','SmsTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','include','findAll','show','params','includeAll','find','catch','create','body','describe','rimraf','fast-json-patch','moment'];(function(_0x5a7226,_0x138e12){var _0x4fef07=function(_0x4752a7){while(--_0x4752a7){_0x5a7226['push'](_0x5a7226['shift']());}};_0x4fef07(++_0x138e12);}(_0x5779,0x8d));var _0x9577=function(_0x6ab981,_0x3af43b){_0x6ab981=_0x6ab981-0x0;var _0xf46675=_0x5779[_0x6ab981];return _0xf46675;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x9577('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9577('0x1'));var rp=require('request-promise');var moment=require(_0x9577('0x2'));var BPromise=require(_0x9577('0x3'));var Mustache=require('mustache');var util=require(_0x9577('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x9577('0x5'));var ejs=require(_0x9577('0x6'));var fs=require('fs');var _=require(_0x9577('0x7'));var squel=require(_0x9577('0x8'));var crypto=require(_0x9577('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x9577('0xa'));var toCsv=require(_0x9577('0x5'));var querystring=require(_0x9577('0xb'));var Papa=require(_0x9577('0xc'));var Redis=require(_0x9577('0xd'));var authService=require(_0x9577('0xe'));var qs=require(_0x9577('0xf'));var as=require(_0x9577('0x10'));var hardwareService=require(_0x9577('0x11'));var logger=require('../../config/logger')(_0x9577('0x12'));var utils=require(_0x9577('0x13'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3b0c43,_0x53c2f1){_0x53c2f1=_0x53c2f1||0xcc;return function(_0x145a6b){if(_0x145a6b){return _0x3b0c43[_0x9577('0x14')](_0x53c2f1);}return _0x3b0c43[_0x9577('0x15')](_0x53c2f1)[_0x9577('0x16')]();};}function respondWithResult(_0x5b610f,_0x5b3855){_0x5b3855=_0x5b3855||0xc8;return function(_0x1b275c){if(_0x1b275c){return _0x5b610f[_0x9577('0x15')](_0x5b3855)[_0x9577('0x17')](_0x1b275c);}};}function respondWithFilteredResult(_0x46a304,_0x5afc61){return function(_0x2f4135){if(_0x2f4135){var _0x31da43=_0x2f4135['count'],_0x55e8c1=_0x5afc61['offset'],_0x4eb60b=_0x5afc61[_0x9577('0x18')]+_0x5afc61[_0x9577('0x19')],_0x26fb93;if(_0x4eb60b>=_0x31da43){_0x4eb60b=_0x31da43;_0x26fb93=0xc8;}else{_0x26fb93=0xce;}_0x46a304['status'](_0x26fb93);return _0x46a304['set'](_0x9577('0x1a'),_0x55e8c1+'-'+_0x4eb60b+'/'+_0x31da43)['json'](_0x2f4135);}return null;};}function patchUpdates(_0x1dda19){return function(_0x489ec3){try{jsonpatch['apply'](_0x489ec3,_0x1dda19,!![]);}catch(_0x4daee4){return BPromise[_0x9577('0x1b')](_0x4daee4);}return _0x489ec3[_0x9577('0x1c')]();};}function saveUpdates(_0x255862,_0x44c18c){return function(_0x4ac429){if(_0x4ac429){return _0x4ac429[_0x9577('0x1d')](_0x255862)[_0x9577('0x1e')](function(_0x275932){return _0x275932;});}return null;};}function removeEntity(_0x25359f,_0x1f6ab0){return function(_0x510f0f){if(_0x510f0f){return _0x510f0f[_0x9577('0x1f')]()[_0x9577('0x1e')](function(){_0x25359f['status'](0xcc)[_0x9577('0x16')]();});}};}function handleEntityNotFound(_0x26ad4e,_0xdb4531){return function(_0xb46167){if(!_0xb46167){_0x26ad4e[_0x9577('0x14')](0x194);}return _0xb46167;};}function handleError(_0x2ffb7b,_0x134bd4){_0x134bd4=_0x134bd4||0x1f4;return function(_0x4bb303){logger[_0x9577('0x20')](_0x4bb303[_0x9577('0x21')]);if(_0x4bb303[_0x9577('0x22')]){delete _0x4bb303[_0x9577('0x22')];}_0x2ffb7b['status'](_0x134bd4)[_0x9577('0x23')](_0x4bb303);};}exports[_0x9577('0x24')]=function(_0xfc47f2,_0x209538){var _0xca4584={},_0x364d48={},_0x159d10={'count':0x0,'rows':[]};var _0xf403b9=_[_0x9577('0x25')](db[_0x9577('0x26')][_0x9577('0x27')],function(_0x21f871){return{'name':_0x21f871[_0x9577('0x28')],'type':_0x21f871[_0x9577('0x29')][_0x9577('0x2a')]};});_0x364d48[_0x9577('0x2b')]=_['map'](_0xf403b9,_0x9577('0x22'));_0x364d48[_0x9577('0x2c')]=_[_0x9577('0x2d')](_0xfc47f2['query']);_0x364d48[_0x9577('0x2e')]=_[_0x9577('0x2f')](_0x364d48[_0x9577('0x2b')],_0x364d48[_0x9577('0x2c')]);_0xca4584[_0x9577('0x30')]=_[_0x9577('0x2f')](_0x364d48[_0x9577('0x2b')],qs[_0x9577('0x31')](_0xfc47f2[_0x9577('0x2c')][_0x9577('0x31')]));_0xca4584[_0x9577('0x30')]=_0xca4584[_0x9577('0x30')][_0x9577('0x32')]?_0xca4584[_0x9577('0x30')]:_0x364d48[_0x9577('0x2b')];if(!_0xfc47f2[_0x9577('0x2c')][_0x9577('0x33')](_0x9577('0x34'))){_0xca4584[_0x9577('0x19')]=qs[_0x9577('0x19')](_0xfc47f2[_0x9577('0x2c')]['limit']);_0xca4584[_0x9577('0x18')]=qs[_0x9577('0x18')](_0xfc47f2[_0x9577('0x2c')]['offset']);}_0xca4584[_0x9577('0x35')]=qs['sort'](_0xfc47f2[_0x9577('0x2c')][_0x9577('0x36')]);_0xca4584[_0x9577('0x37')]=qs['filters'](_[_0x9577('0x38')](_0xfc47f2['query'],_0x364d48[_0x9577('0x2e')]));if(_0xfc47f2['query'][_0x9577('0x39')]){_0xca4584[_0x9577('0x37')]=_[_0x9577('0x3a')](_0xca4584[_0x9577('0x37')],{'$or':_[_0x9577('0x25')](_0xf403b9,function(_0x7b0980){if(_0x7b0980[_0x9577('0x29')][_0x9577('0x2a')]!==_0x9577('0x3b')){var _0x35e14e={};_0x35e14e[_0x7b0980['field']]={'$like':'%'+_0xfc47f2['query'][_0x9577('0x39')]+'%'};return _0x35e14e;}})});}_0xca4584=_['merge']({},_0xca4584,_0xfc47f2[_0x9577('0x3c')]);var _0x482a2f={'where':_0xca4584[_0x9577('0x37')]};return db[_0x9577('0x26')][_0x9577('0x3d')](_0x482a2f)[_0x9577('0x1e')](function(_0x57df92){_0x159d10[_0x9577('0x3d')]=_0x57df92;if(_0xfc47f2[_0x9577('0x2c')]['includeAll']){_0xca4584[_0x9577('0x3e')]=[{'all':!![]}];}return db[_0x9577('0x26')][_0x9577('0x3f')](_0xca4584);})[_0x9577('0x1e')](function(_0x2686ca){_0x159d10['rows']=_0x2686ca;return _0x159d10;})[_0x9577('0x1e')](respondWithFilteredResult(_0x209538,_0xca4584))['catch'](handleError(_0x209538,null));};exports[_0x9577('0x40')]=function(_0x2a04cd,_0x15acd6){var _0x4363d7={'raw':!![],'where':{'id':_0x2a04cd[_0x9577('0x41')]['id']}},_0x19c7b7={};_0x19c7b7[_0x9577('0x2b')]=_['keys'](db['SmsTransferReport'][_0x9577('0x27')]);_0x19c7b7[_0x9577('0x2c')]=_[_0x9577('0x2d')](_0x2a04cd[_0x9577('0x2c')]);_0x19c7b7[_0x9577('0x2e')]=_['intersection'](_0x19c7b7['model'],_0x19c7b7[_0x9577('0x2c')]);_0x4363d7[_0x9577('0x30')]=_['intersection'](_0x19c7b7[_0x9577('0x2b')],qs['fields'](_0x2a04cd[_0x9577('0x2c')][_0x9577('0x31')]));_0x4363d7['attributes']=_0x4363d7['attributes']['length']?_0x4363d7[_0x9577('0x30')]:_0x19c7b7[_0x9577('0x2b')];if(_0x2a04cd[_0x9577('0x2c')][_0x9577('0x42')]){_0x4363d7['include']=[{'all':!![]}];}_0x4363d7=_[_0x9577('0x3a')]({},_0x4363d7,_0x2a04cd['options']);return db[_0x9577('0x26')][_0x9577('0x43')](_0x4363d7)['then'](handleEntityNotFound(_0x15acd6,null))[_0x9577('0x1e')](respondWithResult(_0x15acd6,null))[_0x9577('0x44')](handleError(_0x15acd6,null));};exports[_0x9577('0x45')]=function(_0x591fa7,_0x1efc4f){return db[_0x9577('0x26')][_0x9577('0x45')](_0x591fa7[_0x9577('0x46')],{})[_0x9577('0x1e')](respondWithResult(_0x1efc4f,0xc9))[_0x9577('0x44')](handleError(_0x1efc4f,null));};exports['update']=function(_0x15f686,_0x1408a9){if(_0x15f686[_0x9577('0x46')]['id']){delete _0x15f686[_0x9577('0x46')]['id'];}return db[_0x9577('0x26')][_0x9577('0x43')]({'where':{'id':_0x15f686[_0x9577('0x41')]['id']}})[_0x9577('0x1e')](handleEntityNotFound(_0x1408a9,null))[_0x9577('0x1e')](saveUpdates(_0x15f686[_0x9577('0x46')],null))[_0x9577('0x1e')](respondWithResult(_0x1408a9,null))[_0x9577('0x44')](handleError(_0x1408a9,null));};exports[_0x9577('0x1f')]=function(_0x3b4890,_0x61ac31){return db[_0x9577('0x26')][_0x9577('0x43')]({'where':{'id':_0x3b4890[_0x9577('0x41')]['id']}})[_0x9577('0x1e')](handleEntityNotFound(_0x61ac31,null))[_0x9577('0x1e')](removeEntity(_0x61ac31,null))[_0x9577('0x44')](handleError(_0x61ac31,null));};exports[_0x9577('0x47')]=function(_0x41f528,_0x414039){return db['SmsTransferReport'][_0x9577('0x47')]()[_0x9577('0x1e')](respondWithResult(_0x414039,null))[_0x9577('0x44')](handleError(_0x414039,null));}; \ No newline at end of file +var _0x0659=['options','find','catch','create','body','params','describe','html-pdf','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','set','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','length','hasOwnProperty','nolimit','limit','sort','pick','filter','where','VIRTUAL','merge','SmsTransferReport','count','includeAll','include','findAll','rows','keys','fields'];(function(_0x1ec9f6,_0x180134){var _0x46982c=function(_0x4976b6){while(--_0x4976b6){_0x1ec9f6['push'](_0x1ec9f6['shift']());}};_0x46982c(++_0x180134);}(_0x0659,0x1bd));var _0x9065=function(_0x336969,_0x5af6da){_0x336969=_0x336969-0x0;var _0x2b05eb=_0x0659[_0x336969];return _0x2b05eb;};'use strict';var pdf=require(_0x9065('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x9065('0x1'));var zipdir=require(_0x9065('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9065('0x3'));var moment=require('moment');var BPromise=require(_0x9065('0x4'));var Mustache=require(_0x9065('0x5'));var util=require(_0x9065('0x6'));var path=require(_0x9065('0x7'));var sox=require(_0x9065('0x8'));var csv=require('to-csv');var ejs=require(_0x9065('0x9'));var fs=require('fs');var _=require(_0x9065('0xa'));var squel=require(_0x9065('0xb'));var crypto=require('crypto');var jsforce=require(_0x9065('0xc'));var deskjs=require(_0x9065('0xd'));var toCsv=require(_0x9065('0xe'));var querystring=require(_0x9065('0xf'));var Papa=require(_0x9065('0x10'));var Redis=require('ioredis');var authService=require(_0x9065('0x11'));var qs=require(_0x9065('0x12'));var as=require(_0x9065('0x13'));var hardwareService=require(_0x9065('0x14'));var logger=require(_0x9065('0x15'))('api');var utils=require(_0x9065('0x16'));var config=require(_0x9065('0x17'));var db=require(_0x9065('0x18'))['db'];function respondWithStatusCode(_0x1d56ca,_0x16f5ce){_0x16f5ce=_0x16f5ce||0xcc;return function(_0x3e31c2){if(_0x3e31c2){return _0x1d56ca[_0x9065('0x19')](_0x16f5ce);}return _0x1d56ca[_0x9065('0x1a')](_0x16f5ce)['end']();};}function respondWithResult(_0x18a84f,_0x174125){_0x174125=_0x174125||0xc8;return function(_0x148973){if(_0x148973){return _0x18a84f[_0x9065('0x1a')](_0x174125)[_0x9065('0x1b')](_0x148973);}};}function respondWithFilteredResult(_0x2b5f37,_0xc26250){return function(_0x487e03){if(_0x487e03){var _0x238885=_0x487e03['count'],_0x3e83c2=_0xc26250[_0x9065('0x1c')],_0x201f9d=_0xc26250['offset']+_0xc26250['limit'],_0x401761;if(_0x201f9d>=_0x238885){_0x201f9d=_0x238885;_0x401761=0xc8;}else{_0x401761=0xce;}_0x2b5f37[_0x9065('0x1a')](_0x401761);return _0x2b5f37[_0x9065('0x1d')]('Content-Range',_0x3e83c2+'-'+_0x201f9d+'/'+_0x238885)[_0x9065('0x1b')](_0x487e03);}return null;};}function patchUpdates(_0x2a1916){return function(_0x2ff1a1){try{jsonpatch['apply'](_0x2ff1a1,_0x2a1916,!![]);}catch(_0xa7121b){return BPromise['reject'](_0xa7121b);}return _0x2ff1a1[_0x9065('0x1e')]();};}function saveUpdates(_0x35f972,_0xa2b361){return function(_0x3ab30a){if(_0x3ab30a){return _0x3ab30a[_0x9065('0x1f')](_0x35f972)[_0x9065('0x20')](function(_0x524e8b){return _0x524e8b;});}return null;};}function removeEntity(_0x1fb682,_0x105cf3){return function(_0x2f8dd1){if(_0x2f8dd1){return _0x2f8dd1[_0x9065('0x21')]()[_0x9065('0x20')](function(){_0x1fb682['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x47a5ca,_0x146cd5){return function(_0x489a9f){if(!_0x489a9f){_0x47a5ca[_0x9065('0x19')](0x194);}return _0x489a9f;};}function handleError(_0x7110c6,_0x407652){_0x407652=_0x407652||0x1f4;return function(_0x58508c){logger['error'](_0x58508c[_0x9065('0x22')]);if(_0x58508c[_0x9065('0x23')]){delete _0x58508c['name'];}_0x7110c6[_0x9065('0x1a')](_0x407652)[_0x9065('0x24')](_0x58508c);};}exports[_0x9065('0x25')]=function(_0x203342,_0x4b306e){var _0x2c6101={},_0x3134f1={},_0x43c264={'count':0x0,'rows':[]};var _0x4fd58a=_[_0x9065('0x26')](db['SmsTransferReport'][_0x9065('0x27')],function(_0x2771a8){return{'name':_0x2771a8[_0x9065('0x28')],'type':_0x2771a8[_0x9065('0x29')][_0x9065('0x2a')]};});_0x3134f1[_0x9065('0x2b')]=_[_0x9065('0x26')](_0x4fd58a,_0x9065('0x23'));_0x3134f1[_0x9065('0x2c')]=_['keys'](_0x203342['query']);_0x3134f1[_0x9065('0x2d')]=_['intersection'](_0x3134f1['model'],_0x3134f1[_0x9065('0x2c')]);_0x2c6101[_0x9065('0x2e')]=_[_0x9065('0x2f')](_0x3134f1[_0x9065('0x2b')],qs['fields'](_0x203342[_0x9065('0x2c')]['fields']));_0x2c6101['attributes']=_0x2c6101['attributes'][_0x9065('0x30')]?_0x2c6101[_0x9065('0x2e')]:_0x3134f1[_0x9065('0x2b')];if(!_0x203342[_0x9065('0x2c')][_0x9065('0x31')](_0x9065('0x32'))){_0x2c6101[_0x9065('0x33')]=qs[_0x9065('0x33')](_0x203342[_0x9065('0x2c')]['limit']);_0x2c6101[_0x9065('0x1c')]=qs[_0x9065('0x1c')](_0x203342[_0x9065('0x2c')][_0x9065('0x1c')]);}_0x2c6101['order']=qs[_0x9065('0x34')](_0x203342[_0x9065('0x2c')][_0x9065('0x34')]);_0x2c6101['where']=qs[_0x9065('0x2d')](_[_0x9065('0x35')](_0x203342[_0x9065('0x2c')],_0x3134f1[_0x9065('0x2d')]));if(_0x203342[_0x9065('0x2c')][_0x9065('0x36')]){_0x2c6101[_0x9065('0x37')]=_['merge'](_0x2c6101['where'],{'$or':_[_0x9065('0x26')](_0x4fd58a,function(_0x3dea48){if(_0x3dea48['type'][_0x9065('0x2a')]!==_0x9065('0x38')){var _0x44050d={};_0x44050d[_0x3dea48['field']]={'$like':'%'+_0x203342['query'][_0x9065('0x36')]+'%'};return _0x44050d;}})});}_0x2c6101=_[_0x9065('0x39')]({},_0x2c6101,_0x203342['options']);var _0x5653e1={'where':_0x2c6101[_0x9065('0x37')]};return db[_0x9065('0x3a')][_0x9065('0x3b')](_0x5653e1)[_0x9065('0x20')](function(_0x39c296){_0x43c264['count']=_0x39c296;if(_0x203342[_0x9065('0x2c')][_0x9065('0x3c')]){_0x2c6101[_0x9065('0x3d')]=[{'all':!![]}];}return db[_0x9065('0x3a')][_0x9065('0x3e')](_0x2c6101);})[_0x9065('0x20')](function(_0x5c105d){_0x43c264[_0x9065('0x3f')]=_0x5c105d;return _0x43c264;})[_0x9065('0x20')](respondWithFilteredResult(_0x4b306e,_0x2c6101))['catch'](handleError(_0x4b306e,null));};exports['show']=function(_0x2d979c,_0x58442f){var _0xba1815={'raw':!![],'where':{'id':_0x2d979c['params']['id']}},_0x1ae876={};_0x1ae876[_0x9065('0x2b')]=_[_0x9065('0x40')](db[_0x9065('0x3a')][_0x9065('0x27')]);_0x1ae876[_0x9065('0x2c')]=_[_0x9065('0x40')](_0x2d979c[_0x9065('0x2c')]);_0x1ae876[_0x9065('0x2d')]=_[_0x9065('0x2f')](_0x1ae876[_0x9065('0x2b')],_0x1ae876[_0x9065('0x2c')]);_0xba1815[_0x9065('0x2e')]=_[_0x9065('0x2f')](_0x1ae876[_0x9065('0x2b')],qs[_0x9065('0x41')](_0x2d979c['query'][_0x9065('0x41')]));_0xba1815[_0x9065('0x2e')]=_0xba1815[_0x9065('0x2e')][_0x9065('0x30')]?_0xba1815[_0x9065('0x2e')]:_0x1ae876['model'];if(_0x2d979c[_0x9065('0x2c')][_0x9065('0x3c')]){_0xba1815[_0x9065('0x3d')]=[{'all':!![]}];}_0xba1815=_['merge']({},_0xba1815,_0x2d979c[_0x9065('0x42')]);return db['SmsTransferReport'][_0x9065('0x43')](_0xba1815)[_0x9065('0x20')](handleEntityNotFound(_0x58442f,null))[_0x9065('0x20')](respondWithResult(_0x58442f,null))[_0x9065('0x44')](handleError(_0x58442f,null));};exports[_0x9065('0x45')]=function(_0x5857e4,_0x4c9c87){return db[_0x9065('0x3a')][_0x9065('0x45')](_0x5857e4[_0x9065('0x46')],{})[_0x9065('0x20')](respondWithResult(_0x4c9c87,0xc9))['catch'](handleError(_0x4c9c87,null));};exports['update']=function(_0x57907f,_0x77fa95){if(_0x57907f[_0x9065('0x46')]['id']){delete _0x57907f[_0x9065('0x46')]['id'];}return db['SmsTransferReport'][_0x9065('0x43')]({'where':{'id':_0x57907f[_0x9065('0x47')]['id']}})[_0x9065('0x20')](handleEntityNotFound(_0x77fa95,null))[_0x9065('0x20')](saveUpdates(_0x57907f[_0x9065('0x46')],null))[_0x9065('0x20')](respondWithResult(_0x77fa95,null))['catch'](handleError(_0x77fa95,null));};exports[_0x9065('0x21')]=function(_0x237f8c,_0x4c9906){return db[_0x9065('0x3a')]['find']({'where':{'id':_0x237f8c[_0x9065('0x47')]['id']}})['then'](handleEntityNotFound(_0x4c9906,null))[_0x9065('0x20')](removeEntity(_0x4c9906,null))[_0x9065('0x44')](handleError(_0x4c9906,null));};exports[_0x9065('0x48')]=function(_0x4d39a6,_0x5cd5a7){return db['SmsTransferReport'][_0x9065('0x48')]()[_0x9065('0x20')](respondWithResult(_0x5cd5a7,null))[_0x9065('0x44')](handleError(_0x5cd5a7,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 69662c1..81d8665 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 _0x8ca9=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','exports','define','SmsTransferReport','report_sms_transfer','uniqueid'];(function(_0x216188,_0x59dc78){var _0x24df27=function(_0x5f1e29){while(--_0x5f1e29){_0x216188['push'](_0x216188['shift']());}};_0x24df27(++_0x59dc78);}(_0x8ca9,0x9c));var _0x98ca=function(_0x2dfcb8,_0x5d54fc){_0x2dfcb8=_0x2dfcb8-0x0;var _0x307ad3=_0x8ca9[_0x2dfcb8];return _0x307ad3;};'use strict';var _=require(_0x98ca('0x0'));var util=require(_0x98ca('0x1'));var logger=require(_0x98ca('0x2'))(_0x98ca('0x3'));var moment=require(_0x98ca('0x4'));var BPromise=require(_0x98ca('0x5'));var rp=require(_0x98ca('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x98ca('0x7'));var attributes=require('./smsTransferReport.attributes');module[_0x98ca('0x8')]=function(_0x48415d,_0x219619){return _0x48415d[_0x98ca('0x9')](_0x98ca('0xa'),attributes,{'tableName':_0x98ca('0xb'),'paranoid':![],'indexes':[{'name':_0x98ca('0xc'),'fields':[_0x98ca('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf69d=['uniqueid','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer'];(function(_0x3d8240,_0x2663d4){var _0x3d0372=function(_0xc47c6b){while(--_0xc47c6b){_0x3d8240['push'](_0x3d8240['shift']());}};_0x3d0372(++_0x2663d4);}(_0xf69d,0xd3));var _0xdf69=function(_0x2a64da,_0x39f02c){_0x2a64da=_0x2a64da-0x0;var _0x26e92c=_0xf69d[_0x2a64da];return _0x26e92c;};'use strict';var _=require(_0xdf69('0x0'));var util=require(_0xdf69('0x1'));var logger=require(_0xdf69('0x2'))(_0xdf69('0x3'));var moment=require(_0xdf69('0x4'));var BPromise=require('bluebird');var rp=require(_0xdf69('0x5'));var fs=require('fs');var path=require(_0xdf69('0x6'));var rimraf=require(_0xdf69('0x7'));var config=require(_0xdf69('0x8'));var attributes=require(_0xdf69('0x9'));module[_0xdf69('0xa')]=function(_0x2d456f,_0x465b1b){return _0x2d456f[_0xdf69('0xb')](_0xdf69('0xc'),attributes,{'tableName':_0xdf69('0xd'),'paranoid':![],'indexes':[{'name':_0xdf69('0xe'),'fields':[_0xdf69('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 ab21a56..a5d79d4 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 _0xd92c=['message','catch','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','info','SmsTransferReport,\x20%s,\x20%s','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x2b3a4c,_0x388118){var _0x30c432=function(_0x3ffbee){while(--_0x3ffbee){_0x2b3a4c['push'](_0x2b3a4c['shift']());}};_0x30c432(++_0x388118);}(_0xd92c,0x80));var _0xcd92=function(_0x9c5a4b,_0x48bdc2){_0x9c5a4b=_0x9c5a4b-0x0;var _0xdb6975=_0xd92c[_0x9c5a4b];return _0xdb6975;};'use strict';var _=require('lodash');var util=require(_0xcd92('0x0'));var moment=require(_0xcd92('0x1'));var BPromise=require('bluebird');var rs=require(_0xcd92('0x2'));var fs=require('fs');var Redis=require(_0xcd92('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xcd92('0x4'));var logger=require(_0xcd92('0x5'))(_0xcd92('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xcd92('0x7')][_0xcd92('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5abac3,_0x46e09c,_0x3122de){return new BPromise(function(_0x2fcf20,_0xab15ad){return client['request'](_0x5abac3,_0x3122de)['then'](function(_0x44160d){logger[_0xcd92('0x9')](_0xcd92('0xa'),_0x46e09c,'request\x20sent');logger[_0xcd92('0xb')](_0xcd92('0xc'),_0x46e09c,_0xcd92('0xd'),JSON['stringify'](_0x44160d));if(_0x44160d[_0xcd92('0xe')]){if(_0x44160d[_0xcd92('0xe')][_0xcd92('0xf')]===0x1f4){logger[_0xcd92('0xe')](_0xcd92('0xa'),_0x46e09c,_0x44160d['error'][_0xcd92('0x10')]);return _0xab15ad(_0x44160d['error'][_0xcd92('0x10')]);}logger[_0xcd92('0xe')](_0xcd92('0xa'),_0x46e09c,_0x44160d['error'][_0xcd92('0x10')]);return _0x2fcf20(_0x44160d[_0xcd92('0xe')][_0xcd92('0x10')]);}else{logger[_0xcd92('0x9')](_0xcd92('0xa'),_0x46e09c,_0xcd92('0xd'));_0x2fcf20(_0x44160d['result'][_0xcd92('0x10')]);}})[_0xcd92('0x11')](function(_0x2f3ef5){logger[_0xcd92('0xe')](_0xcd92('0xa'),_0x46e09c,_0x2f3ef5);_0xab15ad(_0x2f3ef5);});});} \ No newline at end of file +var _0xa61a=['http','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0xf140b7,_0x58aa03){var _0x48e8b6=function(_0x34954d){while(--_0x34954d){_0xf140b7['push'](_0xf140b7['shift']());}};_0x48e8b6(++_0x58aa03);}(_0xa61a,0xab));var _0xaa61=function(_0x419550,_0x15cdf1){_0x419550=_0x419550-0x0;var _0x55f9ef=_0xa61a[_0x419550];return _0x55f9ef;};'use strict';var _=require(_0xaa61('0x0'));var util=require(_0xaa61('0x1'));var moment=require(_0xaa61('0x2'));var BPromise=require(_0xaa61('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaa61('0x4'))['db'];var utils=require(_0xaa61('0x5'));var logger=require('../../config/logger')(_0xaa61('0x6'));var config=require(_0xaa61('0x7'));var jayson=require(_0xaa61('0x8'));var client=jayson['client'][_0xaa61('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x24d491,_0xe2cfc8,_0x3d3fca){return new BPromise(function(_0x12e65c,_0x540d56){return client['request'](_0x24d491,_0x3d3fca)[_0xaa61('0xa')](function(_0x5651b8){logger[_0xaa61('0xb')](_0xaa61('0xc'),_0xe2cfc8,_0xaa61('0xd'));logger['debug'](_0xaa61('0xe'),_0xe2cfc8,_0xaa61('0xd'),JSON[_0xaa61('0xf')](_0x5651b8));if(_0x5651b8[_0xaa61('0x10')]){if(_0x5651b8[_0xaa61('0x10')][_0xaa61('0x11')]===0x1f4){logger['error'](_0xaa61('0xc'),_0xe2cfc8,_0x5651b8[_0xaa61('0x10')][_0xaa61('0x12')]);return _0x540d56(_0x5651b8[_0xaa61('0x10')][_0xaa61('0x12')]);}logger[_0xaa61('0x10')](_0xaa61('0xc'),_0xe2cfc8,_0x5651b8[_0xaa61('0x10')][_0xaa61('0x12')]);return _0x12e65c(_0x5651b8['error'][_0xaa61('0x12')]);}else{logger[_0xaa61('0xb')](_0xaa61('0xc'),_0xe2cfc8,_0xaa61('0xd'));_0x12e65c(_0x5651b8[_0xaa61('0x13')][_0xaa61('0x12')]);}})['catch'](function(_0x269399){logger[_0xaa61('0x10')](_0xaa61('0xc'),_0xe2cfc8,_0x269399);_0x540d56(_0x269399);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index ca6dd56..00c9eac 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 _0x2101=['/:id/download','join','root','originalname','replace','format','%s-%s%s','extname','now','post','single','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./sound.controller','get','index','/:id','isAuthenticated','show'];(function(_0x29d366,_0x4338c1){var _0x3b0cc4=function(_0x371ab8){while(--_0x371ab8){_0x29d366['push'](_0x29d366['shift']());}};_0x3b0cc4(++_0x4338c1);}(_0x2101,0x88));var _0x1210=function(_0x11b405,_0x12e407){_0x11b405=_0x11b405-0x0;var _0x2136bf=_0x2101[_0x11b405];return _0x2136bf;};'use strict';var multer=require(_0x1210('0x0'));var util=require(_0x1210('0x1'));var path=require(_0x1210('0x2'));var timeout=require(_0x1210('0x3'));var express=require(_0x1210('0x4'));var router=express[_0x1210('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x1210('0x6'));var config=require(_0x1210('0x7'));var controller=require(_0x1210('0x8'));router[_0x1210('0x9')]('/',auth['isAuthenticated'](),controller[_0x1210('0xa')]);router[_0x1210('0x9')](_0x1210('0xb'),auth[_0x1210('0xc')](),controller[_0x1210('0xd')]);router['get'](_0x1210('0xe'),auth[_0x1210('0xc')](),controller['download']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5270a3,_0x3b3ad0,_0x5eab98){_0x5eab98(null,path[_0x1210('0xf')](config[_0x1210('0x10')],'server/files/sounds/original/'));},'filename':function(_0x2b210e,_0x6d7e09,_0x4722a7){_0x6d7e09['originalname']=_0x6d7e09[_0x1210('0x11')][_0x1210('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4722a7(null,util[_0x1210('0x13')](_0x1210('0x14'),path['basename'](_0x6d7e09[_0x1210('0x11')],path[_0x1210('0x15')](_0x6d7e09[_0x1210('0x11')])),Date[_0x1210('0x16')](),path[_0x1210('0x15')](_0x6d7e09[_0x1210('0x11')])));}})});router[_0x1210('0x17')]('/',upload[_0x1210('0x18')]('file'),controller[_0x1210('0x19')]);router[_0x1210('0x1a')]('/:id',auth[_0x1210('0xc')](),controller[_0x1210('0x1b')]);router[_0x1210('0x1c')](_0x1210('0xb'),auth[_0x1210('0xc')](),controller['delete']);module[_0x1210('0x1d')]=router; \ No newline at end of file +var _0x8044=['basename','extname','now','post','single','file','create','put','update','delete','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./sound.controller','get','index','/:id','isAuthenticated','show','/:id/download','diskStorage','join','root','server/files/sounds/original/','originalname','format'];(function(_0x3b9570,_0x4ead31){var _0x28acdd=function(_0x59b847){while(--_0x59b847){_0x3b9570['push'](_0x3b9570['shift']());}};_0x28acdd(++_0x4ead31);}(_0x8044,0xb8));var _0x4804=function(_0x595013,_0x65a215){_0x595013=_0x595013-0x0;var _0x2a29e3=_0x8044[_0x595013];return _0x2a29e3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4804('0x0'));var timeout=require(_0x4804('0x1'));var express=require(_0x4804('0x2'));var router=express[_0x4804('0x3')]();var auth=require(_0x4804('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4804('0x5'));var controller=require(_0x4804('0x6'));router[_0x4804('0x7')]('/',auth['isAuthenticated'](),controller[_0x4804('0x8')]);router[_0x4804('0x7')](_0x4804('0x9'),auth[_0x4804('0xa')](),controller[_0x4804('0xb')]);router[_0x4804('0x7')](_0x4804('0xc'),auth[_0x4804('0xa')](),controller['download']);var upload=multer({'storage':multer[_0x4804('0xd')]({'destination':function(_0x370517,_0x3f8aab,_0x3e4e2b){_0x3e4e2b(null,path[_0x4804('0xe')](config[_0x4804('0xf')],_0x4804('0x10')));},'filename':function(_0x371b65,_0x3df930,_0x261dee){_0x3df930[_0x4804('0x11')]=_0x3df930[_0x4804('0x11')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x261dee(null,util[_0x4804('0x12')]('%s-%s%s',path[_0x4804('0x13')](_0x3df930[_0x4804('0x11')],path[_0x4804('0x14')](_0x3df930[_0x4804('0x11')])),Date[_0x4804('0x15')](),path[_0x4804('0x14')](_0x3df930[_0x4804('0x11')])));}})});router[_0x4804('0x16')]('/',upload[_0x4804('0x17')](_0x4804('0x18')),controller[_0x4804('0x19')]);router[_0x4804('0x1a')]('/:id',auth[_0x4804('0xa')](),controller[_0x4804('0x1b')]);router[_0x4804('0x1c')]('/:id',auth[_0x4804('0xa')](),controller[_0x4804('0x1c')]);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 2e95da3..d9d6441 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 _0x5086=['STRING','name','FLOAT','BIGINT','INTEGER','sequelize'];(function(_0x321c7b,_0x589c78){var _0x31e12b=function(_0x2d4ded){while(--_0x2d4ded){_0x321c7b['push'](_0x321c7b['shift']());}};_0x31e12b(++_0x589c78);}(_0x5086,0x65));var _0x6508=function(_0x28aea5,_0x3bb12e){_0x28aea5=_0x28aea5-0x0;var _0x6a55f9=_0x5086[_0x28aea5];return _0x6a55f9;};'use strict';var Sequelize=require(_0x6508('0x0'));module['exports']={'name':{'type':Sequelize[_0x6508('0x1')],'unique':_0x6508('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0x6508('0x1')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize[_0x6508('0x3')]},'original_sampleCount':{'type':Sequelize[_0x6508('0x4')]},'original_channelCount':{'type':Sequelize[_0x6508('0x5')]},'original_bitRate':{'type':Sequelize[_0x6508('0x4')]},'original_sampleRate':{'type':Sequelize['INTEGER']},'converted_format':{'type':Sequelize[_0x6508('0x1')]},'converted_duration':{'type':Sequelize[_0x6508('0x3')]},'converted_sampleCount':{'type':Sequelize[_0x6508('0x4')]},'converted_channelCount':{'type':Sequelize[_0x6508('0x5')]},'converted_bitRate':{'type':Sequelize[_0x6508('0x4')]},'converted_sampleRate':{'type':Sequelize[_0x6508('0x5')]}}; \ No newline at end of file +var _0x16b6=['INTEGER','sequelize','name','STRING','FLOAT','BIGINT'];(function(_0x2322e3,_0x505688){var _0x297705=function(_0x110f47){while(--_0x110f47){_0x2322e3['push'](_0x2322e3['shift']());}};_0x297705(++_0x505688);}(_0x16b6,0x79));var _0x616b=function(_0x4bf0be,_0x5444c0){_0x4bf0be=_0x4bf0be-0x0;var _0x13d426=_0x16b6[_0x4bf0be];return _0x13d426;};'use strict';var Sequelize=require(_0x616b('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x616b('0x1'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0x616b('0x2')]},'original_format':{'type':Sequelize[_0x616b('0x2')]},'original_duration':{'type':Sequelize[_0x616b('0x3')]},'original_sampleCount':{'type':Sequelize[_0x616b('0x4')]},'original_channelCount':{'type':Sequelize[_0x616b('0x5')]},'original_bitRate':{'type':Sequelize[_0x616b('0x4')]},'original_sampleRate':{'type':Sequelize[_0x616b('0x5')]},'converted_format':{'type':Sequelize[_0x616b('0x2')]},'converted_duration':{'type':Sequelize[_0x616b('0x3')]},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize[_0x616b('0x5')]},'converted_bitRate':{'type':Sequelize[_0x616b('0x4')]},'converted_sampleRate':{'type':Sequelize[_0x616b('0x5')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index c67f930..325cf85 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 _0x0e17=['offset','limit','set','apply','reject','save','update','then','destroy','Sounds','UserProfileResource','error','name','send','index','map','Sound','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','sort','where','pick','filter','type','VIRTUAL','field','merge','options','include','rows','catch','params','includeAll','download','find','save_name','converted_format','existsSync','join','root','server/files/sounds/converted','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','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','unlinkSync','src','original_duration','duration','sampleCount','original_channelCount','channelCount','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','description','delete','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','count'];(function(_0x38bbd2,_0x709b0a){var _0x32c72c=function(_0x1db065){while(--_0x1db065){_0x38bbd2['push'](_0x38bbd2['shift']());}};_0x32c72c(++_0x709b0a);}(_0x0e17,0xd6));var _0x70e1=function(_0x22c3ce,_0x1021ec){_0x22c3ce=_0x22c3ce-0x0;var _0x26ddcd=_0x0e17[_0x22c3ce];return _0x26ddcd;};'use strict';var pdf=require(_0x70e1('0x0'));var emlformat=require(_0x70e1('0x1'));var rimraf=require(_0x70e1('0x2'));var zipdir=require(_0x70e1('0x3'));var jsonpatch=require(_0x70e1('0x4'));var rp=require(_0x70e1('0x5'));var moment=require(_0x70e1('0x6'));var BPromise=require(_0x70e1('0x7'));var Mustache=require(_0x70e1('0x8'));var util=require(_0x70e1('0x9'));var path=require(_0x70e1('0xa'));var sox=require(_0x70e1('0xb'));var csv=require('to-csv');var ejs=require(_0x70e1('0xc'));var fs=require('fs');var _=require(_0x70e1('0xd'));var squel=require(_0x70e1('0xe'));var crypto=require(_0x70e1('0xf'));var jsforce=require(_0x70e1('0x10'));var deskjs=require(_0x70e1('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x70e1('0x12'));var Redis=require('ioredis');var authService=require(_0x70e1('0x13'));var qs=require(_0x70e1('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x70e1('0x15'));var logger=require(_0x70e1('0x16'))('api');var utils=require(_0x70e1('0x17'));var config=require('../../config/environment');var db=require(_0x70e1('0x18'))['db'];function respondWithStatusCode(_0x5be96e,_0xcf9668){_0xcf9668=_0xcf9668||0xcc;return function(_0xcf2748){if(_0xcf2748){return _0x5be96e[_0x70e1('0x19')](_0xcf9668);}return _0x5be96e[_0x70e1('0x1a')](_0xcf9668)[_0x70e1('0x1b')]();};}function respondWithResult(_0x439377,_0xec5aea){_0xec5aea=_0xec5aea||0xc8;return function(_0x46e174){if(_0x46e174){return _0x439377[_0x70e1('0x1a')](_0xec5aea)[_0x70e1('0x1c')](_0x46e174);}};}function respondWithFilteredResult(_0x37188b,_0x491c9c){return function(_0x1f50aa){if(_0x1f50aa){var _0x3c645c=_0x1f50aa[_0x70e1('0x1d')],_0x39be1b=_0x491c9c[_0x70e1('0x1e')],_0x141b8f=_0x491c9c[_0x70e1('0x1e')]+_0x491c9c[_0x70e1('0x1f')],_0x33e090;if(_0x141b8f>=_0x3c645c){_0x141b8f=_0x3c645c;_0x33e090=0xc8;}else{_0x33e090=0xce;}_0x37188b[_0x70e1('0x1a')](_0x33e090);return _0x37188b[_0x70e1('0x20')]('Content-Range',_0x39be1b+'-'+_0x141b8f+'/'+_0x3c645c)['json'](_0x1f50aa);}return null;};}function patchUpdates(_0x1002b6){return function(_0x2234a4){try{jsonpatch[_0x70e1('0x21')](_0x2234a4,_0x1002b6,!![]);}catch(_0x16d4e7){return BPromise[_0x70e1('0x22')](_0x16d4e7);}return _0x2234a4[_0x70e1('0x23')]();};}function saveUpdates(_0x1cce5f,_0x17442e){return function(_0xdb1503){if(_0xdb1503){return _0xdb1503[_0x70e1('0x24')](_0x1cce5f)[_0x70e1('0x25')](function(_0x125668){return _0x125668;});}return null;};}function removeEntity(_0x1299a2,_0x17631b){return function(_0x3afc9b){if(_0x3afc9b){return _0x3afc9b[_0x70e1('0x26')]()['then'](function(){var _0x34f89d=_0x3afc9b['get']({'plain':!![]});var _0x583613=_0x70e1('0x27');return db[_0x70e1('0x28')][_0x70e1('0x26')]({'where':{'type':_0x583613,'resourceId':_0x34f89d['id']}})[_0x70e1('0x25')](function(){return _0x3afc9b;});})[_0x70e1('0x25')](function(){_0x1299a2[_0x70e1('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x23e9df,_0x2f418b){return function(_0x13cc1c){if(!_0x13cc1c){_0x23e9df[_0x70e1('0x19')](0x194);}return _0x13cc1c;};}function handleError(_0x5b4ed0,_0x181abc){_0x181abc=_0x181abc||0x1f4;return function(_0x1b5dd0){logger[_0x70e1('0x29')](_0x1b5dd0['stack']);if(_0x1b5dd0[_0x70e1('0x2a')]){delete _0x1b5dd0[_0x70e1('0x2a')];}_0x5b4ed0[_0x70e1('0x1a')](_0x181abc)[_0x70e1('0x2b')](_0x1b5dd0);};}exports[_0x70e1('0x2c')]=function(_0x33aab0,_0x49a5a9){var _0x47c97c={},_0x266fb0={},_0x47a096={'count':0x0,'rows':[]};var _0x5bc816=_[_0x70e1('0x2d')](db[_0x70e1('0x2e')][_0x70e1('0x2f')],function(_0x49d57d){return{'name':_0x49d57d['fieldName'],'type':_0x49d57d['type'][_0x70e1('0x30')]};});_0x266fb0[_0x70e1('0x31')]=_[_0x70e1('0x2d')](_0x5bc816,_0x70e1('0x2a'));_0x266fb0[_0x70e1('0x32')]=_[_0x70e1('0x33')](_0x33aab0[_0x70e1('0x32')]);_0x266fb0[_0x70e1('0x34')]=_['intersection'](_0x266fb0[_0x70e1('0x31')],_0x266fb0[_0x70e1('0x32')]);_0x47c97c['attributes']=_[_0x70e1('0x35')](_0x266fb0[_0x70e1('0x31')],qs[_0x70e1('0x36')](_0x33aab0[_0x70e1('0x32')]['fields']));_0x47c97c[_0x70e1('0x37')]=_0x47c97c[_0x70e1('0x37')][_0x70e1('0x38')]?_0x47c97c[_0x70e1('0x37')]:_0x266fb0[_0x70e1('0x31')];if(!_0x33aab0[_0x70e1('0x32')]['hasOwnProperty']('nolimit')){_0x47c97c['limit']=qs[_0x70e1('0x1f')](_0x33aab0[_0x70e1('0x32')][_0x70e1('0x1f')]);_0x47c97c['offset']=qs['offset'](_0x33aab0[_0x70e1('0x32')][_0x70e1('0x1e')]);}_0x47c97c['order']=qs[_0x70e1('0x39')](_0x33aab0[_0x70e1('0x32')][_0x70e1('0x39')]);_0x47c97c[_0x70e1('0x3a')]=qs[_0x70e1('0x34')](_[_0x70e1('0x3b')](_0x33aab0[_0x70e1('0x32')],_0x266fb0[_0x70e1('0x34')]));if(_0x33aab0['query'][_0x70e1('0x3c')]){_0x47c97c[_0x70e1('0x3a')]=_['merge'](_0x47c97c['where'],{'$or':_['map'](_0x5bc816,function(_0x4b520d){if(_0x4b520d[_0x70e1('0x3d')][_0x70e1('0x30')]!==_0x70e1('0x3e')){var _0x2b600c={};_0x2b600c[_0x4b520d[_0x70e1('0x3f')]]={'$like':'%'+_0x33aab0[_0x70e1('0x32')][_0x70e1('0x3c')]+'%'};return _0x2b600c;}})});}_0x47c97c=_[_0x70e1('0x40')]({},_0x47c97c,_0x33aab0[_0x70e1('0x41')]);var _0x94b47f={'where':_0x47c97c['where']};return db[_0x70e1('0x2e')][_0x70e1('0x1d')](_0x94b47f)['then'](function(_0x30d8a0){_0x47a096[_0x70e1('0x1d')]=_0x30d8a0;if(_0x33aab0['query']['includeAll']){_0x47c97c[_0x70e1('0x42')]=[{'all':!![]}];}return db['Sound']['findAll'](_0x47c97c);})[_0x70e1('0x25')](function(_0x5c903d){_0x47a096[_0x70e1('0x43')]=_0x5c903d;return _0x47a096;})['then'](respondWithFilteredResult(_0x49a5a9,_0x47c97c))[_0x70e1('0x44')](handleError(_0x49a5a9,null));};exports['show']=function(_0x47ac6f,_0x1ad9d3){var _0x443804={'raw':!![],'where':{'id':_0x47ac6f[_0x70e1('0x45')]['id']}},_0x3c9a98={};_0x3c9a98[_0x70e1('0x31')]=_[_0x70e1('0x33')](db[_0x70e1('0x2e')]['rawAttributes']);_0x3c9a98[_0x70e1('0x32')]=_[_0x70e1('0x33')](_0x47ac6f[_0x70e1('0x32')]);_0x3c9a98[_0x70e1('0x34')]=_['intersection'](_0x3c9a98['model'],_0x3c9a98[_0x70e1('0x32')]);_0x443804[_0x70e1('0x37')]=_['intersection'](_0x3c9a98[_0x70e1('0x31')],qs['fields'](_0x47ac6f[_0x70e1('0x32')]['fields']));_0x443804[_0x70e1('0x37')]=_0x443804[_0x70e1('0x37')]['length']?_0x443804[_0x70e1('0x37')]:_0x3c9a98[_0x70e1('0x31')];if(_0x47ac6f['query'][_0x70e1('0x46')]){_0x443804[_0x70e1('0x42')]=[{'all':!![]}];}_0x443804=_[_0x70e1('0x40')]({},_0x443804,_0x47ac6f[_0x70e1('0x41')]);return db[_0x70e1('0x2e')]['find'](_0x443804)[_0x70e1('0x25')](handleEntityNotFound(_0x1ad9d3,null))[_0x70e1('0x25')](respondWithResult(_0x1ad9d3,null))[_0x70e1('0x44')](handleError(_0x1ad9d3,null));};exports[_0x70e1('0x47')]=function(_0xdd7d43,_0x2794d7,_0x21897e){return db[_0x70e1('0x2e')][_0x70e1('0x48')]({'where':{'id':_0xdd7d43[_0x70e1('0x45')]['id']},'attributes':[_0x70e1('0x2a'),_0x70e1('0x49'),_0x70e1('0x4a')],'raw':!![]})[_0x70e1('0x25')](handleEntityNotFound(_0x2794d7,null))[_0x70e1('0x25')](function(_0x25e431){if(_0x25e431){if(!fs[_0x70e1('0x4b')](path[_0x70e1('0x4c')](config[_0x70e1('0x4d')],_0x70e1('0x4e'),_0x25e431['save_name']+'.'+_0x25e431[_0x70e1('0x4a')]))){throw new db['Sequelize'][(_0x70e1('0x4f'))](_0x70e1('0x50'));}return _0x2794d7[_0x70e1('0x47')](path[_0x70e1('0x4c')](config[_0x70e1('0x4d')],_0x70e1('0x4e'),util[_0x70e1('0x51')]('%s.%s',_0x25e431[_0x70e1('0x49')],_0x25e431['converted_format'])),util['format'](_0x70e1('0x52'),_0x25e431[_0x70e1('0x2a')],_0x25e431[_0x70e1('0x4a')]));}return null;})[_0x70e1('0x44')](handleError(_0x2794d7,null));};exports[_0x70e1('0x53')]=function(_0x33af2b,_0x5d1d9f,_0x4383ae){var _0x2df135={'name':path[_0x70e1('0x54')](_0x33af2b[_0x70e1('0x55')][_0x70e1('0x56')],path[_0x70e1('0x57')](_0x33af2b[_0x70e1('0x55')][_0x70e1('0x56')])),'save_name':path[_0x70e1('0x54')](_0x33af2b[_0x70e1('0x55')][_0x70e1('0x58')],path[_0x70e1('0x57')](_0x33af2b[_0x70e1('0x55')][_0x70e1('0x58')])),'original_format':path[_0x70e1('0x57')](_0x33af2b['file'][_0x70e1('0x56')])[_0x70e1('0x59')](0x1),'converted_format':_0x70e1('0x5a')};var _0x4ab620=path[_0x70e1('0x4c')](config['root'],_0x70e1('0x5b'),_0x33af2b[_0x70e1('0x55')]['filename']);var _0x47a0e9=path['join'](config[_0x70e1('0x4d')],'server/files/sounds/converted',util[_0x70e1('0x51')](_0x70e1('0x52'),path[_0x70e1('0x54')](_0x33af2b[_0x70e1('0x55')]['filename'],path[_0x70e1('0x57')](_0x33af2b[_0x70e1('0x55')]['filename'])),_0x2df135['converted_format']));logger[_0x70e1('0x5c')](_0x70e1('0x5d'),_0x4ab620);logger[_0x70e1('0x5c')](_0x70e1('0x5e'),_0x47a0e9);try{fs[_0x70e1('0x5f')](_0x4ab620,parseInt(_0x70e1('0x60'),0x8));var _0x53f7a7=sox['transcode'](_0x4ab620,_0x47a0e9,{'sampleRate':0x1f40,'format':_0x70e1('0x5a'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x53f7a7['on'](_0x70e1('0x29'),function(_0x1d0119){fs[_0x70e1('0x61')](_0x4ab620);_0x5d1d9f[_0x70e1('0x1a')](0x1f4)[_0x70e1('0x2b')](_0x1d0119);});_0x53f7a7['on'](_0x70e1('0x62'),function(_0x2a198a){_0x2df135[_0x70e1('0x63')]=isNaN(_0x2a198a[_0x70e1('0x64')])?null:_0x2a198a[_0x70e1('0x64')]*0x3e8;_0x2df135['original_sampleCount']=isNaN(_0x2a198a[_0x70e1('0x65')])?null:_0x2a198a['sampleCount'];_0x2df135[_0x70e1('0x66')]=isNaN(_0x2a198a[_0x70e1('0x67')])?null:_0x2a198a[_0x70e1('0x67')];_0x2df135['original_bitRate']=isNaN(_0x2a198a[_0x70e1('0x68')])?null:_0x2a198a['bitRate'];_0x2df135[_0x70e1('0x69')]=isNaN(_0x2a198a[_0x70e1('0x6a')])?null:_0x2a198a[_0x70e1('0x6a')];});_0x53f7a7['on'](_0x70e1('0x6b'),function(_0x3dccd8){_0x2df135[_0x70e1('0x6c')]=isNaN(_0x3dccd8[_0x70e1('0x64')])?null:_0x3dccd8[_0x70e1('0x64')]*0x3e8;_0x2df135[_0x70e1('0x6d')]=isNaN(_0x3dccd8['sampleCount'])?null:_0x3dccd8['sampleCount'];_0x2df135[_0x70e1('0x6e')]=isNaN(_0x3dccd8['channelCount'])?null:_0x3dccd8['channelCount'];_0x2df135[_0x70e1('0x6f')]=isNaN(_0x3dccd8[_0x70e1('0x68')])?null:_0x3dccd8['bitRate'];_0x2df135['converted_sampleRate']=isNaN(_0x3dccd8[_0x70e1('0x6a')])?null:_0x3dccd8[_0x70e1('0x6a')];});_0x53f7a7['on'](_0x70e1('0x1b'),function(){fs[_0x70e1('0x5f')](_0x47a0e9,parseInt(_0x70e1('0x60'),0x8));return db['Sound'][_0x70e1('0x53')](_0x2df135)[_0x70e1('0x25')](function(_0x2d6247){var _0x1855ad={'role':_0x33af2b[_0x70e1('0x70')][_0x70e1('0x71')],'userProfileId':_0x33af2b['body'][_0x70e1('0x72')]};if(!_0x1855ad)throw new Error(_0x70e1('0x73'));if(_0x1855ad[_0x70e1('0x71')]===_0x70e1('0x74')){var _0x15ca0f=_0x2d6247[_0x70e1('0x75')]({'plain':!![]});return db['UserProfileSection'][_0x70e1('0x48')]({'where':{'name':_0x70e1('0x27'),'userProfileId':_0x1855ad[_0x70e1('0x72')]},'raw':!![]})[_0x70e1('0x25')](function(_0x20e14e){if(_0x20e14e&&_0x20e14e['autoAssociation']===0x0){return db[_0x70e1('0x28')][_0x70e1('0x53')]({'name':_0x15ca0f[_0x70e1('0x2a')],'resourceId':_0x15ca0f['id'],'type':_0x20e14e[_0x70e1('0x2a')],'sectionId':_0x20e14e['id']},{})['then'](function(){return _0x2d6247;});}else{return _0x2d6247;}})[_0x70e1('0x44')](function(_0xdc3b3a){logger[_0x70e1('0x29')](_0x70e1('0x76'),_0xdc3b3a);throw _0xdc3b3a;});}return _0x2d6247;})['then'](respondWithResult(_0x5d1d9f,null))['catch'](handleError(_0x5d1d9f,null));});_0x53f7a7[_0x70e1('0x77')]();}catch(_0x24fc38){_0x5d1d9f[_0x70e1('0x1a')](0x1f4)['send'](_0x24fc38);}};exports['update']=function(_0x1eaac6,_0x425735,_0x3a43ed){return db[_0x70e1('0x2e')][_0x70e1('0x48')]({'where':{'id':_0x1eaac6[_0x70e1('0x45')]['id']}})[_0x70e1('0x25')](handleEntityNotFound(_0x425735,null))[_0x70e1('0x25')](saveUpdates(_[_0x70e1('0x3b')](_0x1eaac6[_0x70e1('0x70')],['name',_0x70e1('0x78')]),null))[_0x70e1('0x25')](respondWithResult(_0x425735,null))[_0x70e1('0x44')](handleError(_0x425735,null));};exports[_0x70e1('0x79')]=function(_0x415720,_0x1e8a56,_0x10a75a){return db['Sound'][_0x70e1('0x48')]({'where':{'id':_0x415720[_0x70e1('0x45')]['id']}})[_0x70e1('0x25')](function(_0x43d5f8){if(_0x43d5f8){return _0x43d5f8[_0x70e1('0x26')]();}})['then'](function(_0x5a225d){var _0x4da24d=path[_0x70e1('0x4c')](config['root'],_0x70e1('0x5b'),util['format'](_0x70e1('0x52'),_0x5a225d[_0x70e1('0x49')],_0x5a225d['original_format']));var _0x484d9c=path[_0x70e1('0x4c')](config[_0x70e1('0x4d')],_0x70e1('0x4e'),util[_0x70e1('0x51')]('%s.%s',_0x5a225d['save_name'],_0x5a225d[_0x70e1('0x4a')]));fs[_0x70e1('0x61')](_0x4da24d);fs[_0x70e1('0x61')](_0x484d9c);return _0x5a225d;})[_0x70e1('0x25')](function(_0x499a95){if(_0x499a95){return _0x1e8a56['status'](0xcc)[_0x70e1('0x1b')]();}})[_0x70e1('0x25')](handleEntityNotFound(_0x1e8a56,null))[_0x70e1('0x44')](handleError(_0x1e8a56,null));}; \ No newline at end of file +var _0x54c1=['converted_format','existsSync','root','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','join','%s.%s','format','create','file','extname','originalname','basename','filename','substring','server/files/sounds/original','info','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','wav','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','role','body','get','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','pick','original_format','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','count','offset','limit','Content-Range','json','reject','save','update','then','destroy','Sounds','end','error','name','send','index','Sound','rawAttributes','type','model','map','keys','filters','intersection','query','attributes','fields','length','nolimit','order','sort','filter','where','merge','key','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','download','save_name'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x54c1,0x12b));var _0x154c=function(_0x545cce,_0x2ff6c4){_0x545cce=_0x545cce-0x0;var _0x11acc0=_0x54c1[_0x545cce];return _0x11acc0;};'use strict';var pdf=require(_0x154c('0x0'));var emlformat=require(_0x154c('0x1'));var rimraf=require(_0x154c('0x2'));var zipdir=require(_0x154c('0x3'));var jsonpatch=require(_0x154c('0x4'));var rp=require(_0x154c('0x5'));var moment=require(_0x154c('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x154c('0x7'));var util=require(_0x154c('0x8'));var path=require(_0x154c('0x9'));var sox=require(_0x154c('0xa'));var csv=require('to-csv');var ejs=require(_0x154c('0xb'));var fs=require('fs');var _=require(_0x154c('0xc'));var squel=require(_0x154c('0xd'));var crypto=require(_0x154c('0xe'));var jsforce=require(_0x154c('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x154c('0x10'));var Papa=require(_0x154c('0x11'));var Redis=require(_0x154c('0x12'));var authService=require(_0x154c('0x13'));var qs=require(_0x154c('0x14'));var as=require(_0x154c('0x15'));var hardwareService=require(_0x154c('0x16'));var logger=require(_0x154c('0x17'))(_0x154c('0x18'));var utils=require(_0x154c('0x19'));var config=require(_0x154c('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4518ce,_0x2103e4){_0x2103e4=_0x2103e4||0xcc;return function(_0x95c70c){if(_0x95c70c){return _0x4518ce[_0x154c('0x1b')](_0x2103e4);}return _0x4518ce[_0x154c('0x1c')](_0x2103e4)['end']();};}function respondWithResult(_0x228426,_0x553c21){_0x553c21=_0x553c21||0xc8;return function(_0xf10d81){if(_0xf10d81){return _0x228426[_0x154c('0x1c')](_0x553c21)['json'](_0xf10d81);}};}function respondWithFilteredResult(_0x20881a,_0x5b400b){return function(_0x4621bc){if(_0x4621bc){var _0x5c2714=_0x4621bc[_0x154c('0x1d')],_0x394a2c=_0x5b400b[_0x154c('0x1e')],_0x428224=_0x5b400b[_0x154c('0x1e')]+_0x5b400b[_0x154c('0x1f')],_0x5de313;if(_0x428224>=_0x5c2714){_0x428224=_0x5c2714;_0x5de313=0xc8;}else{_0x5de313=0xce;}_0x20881a['status'](_0x5de313);return _0x20881a['set'](_0x154c('0x20'),_0x394a2c+'-'+_0x428224+'/'+_0x5c2714)[_0x154c('0x21')](_0x4621bc);}return null;};}function patchUpdates(_0x4a30df){return function(_0xbcfcbf){try{jsonpatch['apply'](_0xbcfcbf,_0x4a30df,!![]);}catch(_0x383ce4){return BPromise[_0x154c('0x22')](_0x383ce4);}return _0xbcfcbf[_0x154c('0x23')]();};}function saveUpdates(_0x33de0b,_0x1ce217){return function(_0x5fa921){if(_0x5fa921){return _0x5fa921[_0x154c('0x24')](_0x33de0b)[_0x154c('0x25')](function(_0x41132c){return _0x41132c;});}return null;};}function removeEntity(_0x2c57cf,_0x6abc31){return function(_0x1fdc4b){if(_0x1fdc4b){return _0x1fdc4b[_0x154c('0x26')]()[_0x154c('0x25')](function(){var _0x45bc0a=_0x1fdc4b['get']({'plain':!![]});var _0x17f745=_0x154c('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x17f745,'resourceId':_0x45bc0a['id']}})['then'](function(){return _0x1fdc4b;});})[_0x154c('0x25')](function(){_0x2c57cf['status'](0xcc)[_0x154c('0x28')]();});}};}function handleEntityNotFound(_0x1afc3e,_0x530584){return function(_0x5254e5){if(!_0x5254e5){_0x1afc3e[_0x154c('0x1b')](0x194);}return _0x5254e5;};}function handleError(_0x59b7ed,_0x27a426){_0x27a426=_0x27a426||0x1f4;return function(_0xbbfcb9){logger[_0x154c('0x29')](_0xbbfcb9['stack']);if(_0xbbfcb9[_0x154c('0x2a')]){delete _0xbbfcb9[_0x154c('0x2a')];}_0x59b7ed[_0x154c('0x1c')](_0x27a426)[_0x154c('0x2b')](_0xbbfcb9);};}exports[_0x154c('0x2c')]=function(_0x4cbad7,_0x1bd453){var _0x52762a={},_0x8a3733={},_0x4df740={'count':0x0,'rows':[]};var _0x4c2230=_['map'](db[_0x154c('0x2d')][_0x154c('0x2e')],function(_0x22f710){return{'name':_0x22f710['fieldName'],'type':_0x22f710[_0x154c('0x2f')]['key']};});_0x8a3733[_0x154c('0x30')]=_[_0x154c('0x31')](_0x4c2230,_0x154c('0x2a'));_0x8a3733['query']=_[_0x154c('0x32')](_0x4cbad7['query']);_0x8a3733[_0x154c('0x33')]=_[_0x154c('0x34')](_0x8a3733[_0x154c('0x30')],_0x8a3733[_0x154c('0x35')]);_0x52762a[_0x154c('0x36')]=_[_0x154c('0x34')](_0x8a3733[_0x154c('0x30')],qs[_0x154c('0x37')](_0x4cbad7['query']['fields']));_0x52762a[_0x154c('0x36')]=_0x52762a[_0x154c('0x36')][_0x154c('0x38')]?_0x52762a['attributes']:_0x8a3733['model'];if(!_0x4cbad7[_0x154c('0x35')]['hasOwnProperty'](_0x154c('0x39'))){_0x52762a[_0x154c('0x1f')]=qs[_0x154c('0x1f')](_0x4cbad7[_0x154c('0x35')][_0x154c('0x1f')]);_0x52762a[_0x154c('0x1e')]=qs[_0x154c('0x1e')](_0x4cbad7['query'][_0x154c('0x1e')]);}_0x52762a[_0x154c('0x3a')]=qs[_0x154c('0x3b')](_0x4cbad7['query'][_0x154c('0x3b')]);_0x52762a['where']=qs['filters'](_['pick'](_0x4cbad7[_0x154c('0x35')],_0x8a3733[_0x154c('0x33')]));if(_0x4cbad7[_0x154c('0x35')][_0x154c('0x3c')]){_0x52762a[_0x154c('0x3d')]=_[_0x154c('0x3e')](_0x52762a[_0x154c('0x3d')],{'$or':_[_0x154c('0x31')](_0x4c2230,function(_0x2d7ef3){if(_0x2d7ef3['type'][_0x154c('0x3f')]!==_0x154c('0x40')){var _0x4dfd5e={};_0x4dfd5e[_0x2d7ef3['field']]={'$like':'%'+_0x4cbad7[_0x154c('0x35')]['filter']+'%'};return _0x4dfd5e;}})});}_0x52762a=_[_0x154c('0x3e')]({},_0x52762a,_0x4cbad7[_0x154c('0x41')]);var _0x5aa49e={'where':_0x52762a['where']};return db[_0x154c('0x2d')]['count'](_0x5aa49e)[_0x154c('0x25')](function(_0x4c8a2c){_0x4df740['count']=_0x4c8a2c;if(_0x4cbad7[_0x154c('0x35')][_0x154c('0x42')]){_0x52762a[_0x154c('0x43')]=[{'all':!![]}];}return db['Sound'][_0x154c('0x44')](_0x52762a);})[_0x154c('0x25')](function(_0x302fe9){_0x4df740[_0x154c('0x45')]=_0x302fe9;return _0x4df740;})[_0x154c('0x25')](respondWithFilteredResult(_0x1bd453,_0x52762a))[_0x154c('0x46')](handleError(_0x1bd453,null));};exports[_0x154c('0x47')]=function(_0x2e4a38,_0x2ce971){var _0x5c80ba={'raw':!![],'where':{'id':_0x2e4a38[_0x154c('0x48')]['id']}},_0x499f98={};_0x499f98[_0x154c('0x30')]=_[_0x154c('0x32')](db[_0x154c('0x2d')][_0x154c('0x2e')]);_0x499f98['query']=_[_0x154c('0x32')](_0x2e4a38['query']);_0x499f98[_0x154c('0x33')]=_['intersection'](_0x499f98[_0x154c('0x30')],_0x499f98['query']);_0x5c80ba[_0x154c('0x36')]=_[_0x154c('0x34')](_0x499f98[_0x154c('0x30')],qs['fields'](_0x2e4a38[_0x154c('0x35')]['fields']));_0x5c80ba['attributes']=_0x5c80ba[_0x154c('0x36')][_0x154c('0x38')]?_0x5c80ba['attributes']:_0x499f98['model'];if(_0x2e4a38['query']['includeAll']){_0x5c80ba[_0x154c('0x43')]=[{'all':!![]}];}_0x5c80ba=_[_0x154c('0x3e')]({},_0x5c80ba,_0x2e4a38[_0x154c('0x41')]);return db['Sound'][_0x154c('0x49')](_0x5c80ba)[_0x154c('0x25')](handleEntityNotFound(_0x2ce971,null))[_0x154c('0x25')](respondWithResult(_0x2ce971,null))['catch'](handleError(_0x2ce971,null));};exports[_0x154c('0x4a')]=function(_0x16a4b0,_0x4fa3f4,_0x50a978){return db[_0x154c('0x2d')]['find']({'where':{'id':_0x16a4b0[_0x154c('0x48')]['id']},'attributes':[_0x154c('0x2a'),_0x154c('0x4b'),_0x154c('0x4c')],'raw':!![]})[_0x154c('0x25')](handleEntityNotFound(_0x4fa3f4,null))[_0x154c('0x25')](function(_0x3577c1){if(_0x3577c1){if(!fs[_0x154c('0x4d')](path['join'](config[_0x154c('0x4e')],_0x154c('0x4f'),_0x3577c1['save_name']+'.'+_0x3577c1[_0x154c('0x4c')]))){throw new db[(_0x154c('0x50'))][(_0x154c('0x51'))](_0x154c('0x52'));}return _0x4fa3f4[_0x154c('0x4a')](path[_0x154c('0x53')](config[_0x154c('0x4e')],_0x154c('0x4f'),util['format'](_0x154c('0x54'),_0x3577c1['save_name'],_0x3577c1[_0x154c('0x4c')])),util[_0x154c('0x55')](_0x154c('0x54'),_0x3577c1['name'],_0x3577c1[_0x154c('0x4c')]));}return null;})[_0x154c('0x46')](handleError(_0x4fa3f4,null));};exports[_0x154c('0x56')]=function(_0x26b6fa,_0x3f81e4,_0x3b16b4){var _0x50d5dd={'name':path['basename'](_0x26b6fa[_0x154c('0x57')]['originalname'],path[_0x154c('0x58')](_0x26b6fa[_0x154c('0x57')][_0x154c('0x59')])),'save_name':path[_0x154c('0x5a')](_0x26b6fa['file'][_0x154c('0x5b')],path[_0x154c('0x58')](_0x26b6fa['file'][_0x154c('0x5b')])),'original_format':path[_0x154c('0x58')](_0x26b6fa[_0x154c('0x57')][_0x154c('0x59')])[_0x154c('0x5c')](0x1),'converted_format':'wav'};var _0x349f71=path[_0x154c('0x53')](config['root'],_0x154c('0x5d'),_0x26b6fa[_0x154c('0x57')][_0x154c('0x5b')]);var _0x38c9ca=path[_0x154c('0x53')](config[_0x154c('0x4e')],'server/files/sounds/converted',util[_0x154c('0x55')](_0x154c('0x54'),path[_0x154c('0x5a')](_0x26b6fa[_0x154c('0x57')][_0x154c('0x5b')],path[_0x154c('0x58')](_0x26b6fa['file'][_0x154c('0x5b')])),_0x50d5dd['converted_format']));logger['info']('Sound\x20upload\x20filepath:\x20%s',_0x349f71);logger[_0x154c('0x5e')](_0x154c('0x5f'),_0x38c9ca);try{fs[_0x154c('0x60')](_0x349f71,parseInt(_0x154c('0x61'),0x8));var _0x3eda82=sox[_0x154c('0x62')](_0x349f71,_0x38c9ca,{'sampleRate':0x1f40,'format':_0x154c('0x63'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3eda82['on']('error',function(_0x2078be){fs[_0x154c('0x64')](_0x349f71);_0x3f81e4[_0x154c('0x1c')](0x1f4)[_0x154c('0x2b')](_0x2078be);});_0x3eda82['on'](_0x154c('0x65'),function(_0x10f05a){_0x50d5dd[_0x154c('0x66')]=isNaN(_0x10f05a[_0x154c('0x67')])?null:_0x10f05a['duration']*0x3e8;_0x50d5dd[_0x154c('0x68')]=isNaN(_0x10f05a[_0x154c('0x69')])?null:_0x10f05a[_0x154c('0x69')];_0x50d5dd[_0x154c('0x6a')]=isNaN(_0x10f05a[_0x154c('0x6b')])?null:_0x10f05a[_0x154c('0x6b')];_0x50d5dd[_0x154c('0x6c')]=isNaN(_0x10f05a[_0x154c('0x6d')])?null:_0x10f05a[_0x154c('0x6d')];_0x50d5dd['original_sampleRate']=isNaN(_0x10f05a[_0x154c('0x6e')])?null:_0x10f05a[_0x154c('0x6e')];});_0x3eda82['on'](_0x154c('0x6f'),function(_0x10b864){_0x50d5dd[_0x154c('0x70')]=isNaN(_0x10b864[_0x154c('0x67')])?null:_0x10b864[_0x154c('0x67')]*0x3e8;_0x50d5dd[_0x154c('0x71')]=isNaN(_0x10b864[_0x154c('0x69')])?null:_0x10b864[_0x154c('0x69')];_0x50d5dd[_0x154c('0x72')]=isNaN(_0x10b864[_0x154c('0x6b')])?null:_0x10b864[_0x154c('0x6b')];_0x50d5dd[_0x154c('0x73')]=isNaN(_0x10b864[_0x154c('0x6d')])?null:_0x10b864['bitRate'];_0x50d5dd[_0x154c('0x74')]=isNaN(_0x10b864[_0x154c('0x6e')])?null:_0x10b864[_0x154c('0x6e')];});_0x3eda82['on'](_0x154c('0x28'),function(){fs[_0x154c('0x60')](_0x38c9ca,parseInt(_0x154c('0x61'),0x8));return db[_0x154c('0x2d')][_0x154c('0x56')](_0x50d5dd)[_0x154c('0x25')](function(_0x2e2fa2){var _0x5550d9={'role':_0x26b6fa['body'][_0x154c('0x75')],'userProfileId':_0x26b6fa[_0x154c('0x76')]['userProfileId']};if(!_0x5550d9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5550d9[_0x154c('0x75')]==='user'){var _0x2ce2f4=_0x2e2fa2[_0x154c('0x77')]({'plain':!![]});return db[_0x154c('0x78')]['find']({'where':{'name':_0x154c('0x27'),'userProfileId':_0x5550d9['userProfileId']},'raw':!![]})['then'](function(_0x14e1a8){if(_0x14e1a8&&_0x14e1a8['autoAssociation']===0x0){return db[_0x154c('0x79')][_0x154c('0x56')]({'name':_0x2ce2f4['name'],'resourceId':_0x2ce2f4['id'],'type':_0x14e1a8[_0x154c('0x2a')],'sectionId':_0x14e1a8['id']},{})[_0x154c('0x25')](function(){return _0x2e2fa2;});}else{return _0x2e2fa2;}})['catch'](function(_0x290a09){logger[_0x154c('0x29')](_0x154c('0x7a'),_0x290a09);throw _0x290a09;});}return _0x2e2fa2;})[_0x154c('0x25')](respondWithResult(_0x3f81e4,null))[_0x154c('0x46')](handleError(_0x3f81e4,null));});_0x3eda82['start']();}catch(_0x302f8c){_0x3f81e4[_0x154c('0x1c')](0x1f4)[_0x154c('0x2b')](_0x302f8c);}};exports['update']=function(_0x538b0f,_0x154836,_0x7e95b1){return db[_0x154c('0x2d')][_0x154c('0x49')]({'where':{'id':_0x538b0f[_0x154c('0x48')]['id']}})[_0x154c('0x25')](handleEntityNotFound(_0x154836,null))[_0x154c('0x25')](saveUpdates(_[_0x154c('0x7b')](_0x538b0f[_0x154c('0x76')],[_0x154c('0x2a'),'description']),null))[_0x154c('0x25')](respondWithResult(_0x154836,null))[_0x154c('0x46')](handleError(_0x154836,null));};exports['delete']=function(_0x260f78,_0x119c3e,_0x37200d){return db[_0x154c('0x2d')][_0x154c('0x49')]({'where':{'id':_0x260f78[_0x154c('0x48')]['id']}})[_0x154c('0x25')](function(_0xa0ee2){if(_0xa0ee2){return _0xa0ee2[_0x154c('0x26')]();}})[_0x154c('0x25')](function(_0x319cc2){var _0x213ef4=path[_0x154c('0x53')](config[_0x154c('0x4e')],_0x154c('0x5d'),util[_0x154c('0x55')](_0x154c('0x54'),_0x319cc2[_0x154c('0x4b')],_0x319cc2[_0x154c('0x7c')]));var _0x35797c=path[_0x154c('0x53')](config[_0x154c('0x4e')],'server/files/sounds/converted',util[_0x154c('0x55')](_0x154c('0x54'),_0x319cc2[_0x154c('0x4b')],_0x319cc2[_0x154c('0x4c')]));fs[_0x154c('0x64')](_0x213ef4);fs['unlinkSync'](_0x35797c);return _0x319cc2;})['then'](function(_0x4a4852){if(_0x4a4852){return _0x119c3e[_0x154c('0x1c')](0xcc)['end']();}})[_0x154c('0x25')](handleEntityNotFound(_0x119c3e,null))[_0x154c('0x46')](handleError(_0x119c3e,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index efb97d2..e6e48cc 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 _0xce50=['define','Sound','tools_sounds','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./sound.attributes','exports'];(function(_0x4d8789,_0x3fdff1){var _0x404e41=function(_0x33d5a6){while(--_0x33d5a6){_0x4d8789['push'](_0x4d8789['shift']());}};_0x404e41(++_0x3fdff1);}(_0xce50,0xd3));var _0x0ce5=function(_0x411017,_0x4a8117){_0x411017=_0x411017-0x0;var _0x2adeea=_0xce50[_0x411017];return _0x2adeea;};'use strict';var _=require(_0x0ce5('0x0'));var util=require(_0x0ce5('0x1'));var logger=require(_0x0ce5('0x2'))(_0x0ce5('0x3'));var moment=require(_0x0ce5('0x4'));var BPromise=require('bluebird');var rp=require(_0x0ce5('0x5'));var fs=require('fs');var path=require(_0x0ce5('0x6'));var rimraf=require(_0x0ce5('0x7'));var config=require('../../config/environment');var attributes=require(_0x0ce5('0x8'));module[_0x0ce5('0x9')]=function(_0x491ecb,_0x54ffd6){return _0x491ecb[_0x0ce5('0xa')](_0x0ce5('0xb'),attributes,{'tableName':_0x0ce5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8127=['bluebird','request-promise','rimraf','../../config/environment','./sound.attributes','exports','define','lodash','../../config/logger','api','moment'];(function(_0x230306,_0x1bdd20){var _0x2498d6=function(_0x161925){while(--_0x161925){_0x230306['push'](_0x230306['shift']());}};_0x2498d6(++_0x1bdd20);}(_0x8127,0xee));var _0x7812=function(_0x5700d9,_0x2ce09a){_0x5700d9=_0x5700d9-0x0;var _0x1e9b62=_0x8127[_0x5700d9];return _0x1e9b62;};'use strict';var _=require(_0x7812('0x0'));var util=require('util');var logger=require(_0x7812('0x1'))(_0x7812('0x2'));var moment=require(_0x7812('0x3'));var BPromise=require(_0x7812('0x4'));var rp=require(_0x7812('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7812('0x6'));var config=require(_0x7812('0x7'));var attributes=require(_0x7812('0x8'));module[_0x7812('0x9')]=function(_0x5e0a11,_0xbceaa7){return _0x5e0a11[_0x7812('0xa')]('Sound',attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index 7bb89b9..888dfb8 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 _0xb737=['moment','randomstring','../../config/utils','../../config/logger','../../config/environment','http','request','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSound','find','options','raw','where','include','map','model','attributes','util'];(function(_0x5f5059,_0x469cd8){var _0x2245e3=function(_0x5739b9){while(--_0x5739b9){_0x5f5059['push'](_0x5f5059['shift']());}};_0x2245e3(++_0x469cd8);}(_0xb737,0x187));var _0x7b73=function(_0x552097,_0x225983){_0x552097=_0x552097-0x0;var _0x2a98a0=_0xb737[_0x552097];return _0x2a98a0;};'use strict';var _=require('lodash');var util=require(_0x7b73('0x0'));var moment=require(_0x7b73('0x1'));var BPromise=require('bluebird');var rs=require(_0x7b73('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7b73('0x3'));var logger=require(_0x7b73('0x4'))('rpc');var config=require(_0x7b73('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7b73('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x461fdc,_0x3b866,_0x1a6413){return new BPromise(function(_0x250968,_0x99fb4f){return client[_0x7b73('0x7')](_0x461fdc,_0x1a6413)['then'](function(_0x1e65c4){logger[_0x7b73('0x8')](_0x7b73('0x9'),_0x3b866,_0x7b73('0xa'));logger[_0x7b73('0xb')](_0x7b73('0xc'),_0x3b866,'request\x20sent',JSON[_0x7b73('0xd')](_0x1e65c4));if(_0x1e65c4[_0x7b73('0xe')]){if(_0x1e65c4['error'][_0x7b73('0xf')]===0x1f4){logger[_0x7b73('0xe')](_0x7b73('0x9'),_0x3b866,_0x1e65c4['error'][_0x7b73('0x10')]);return _0x99fb4f(_0x1e65c4[_0x7b73('0xe')]['message']);}logger[_0x7b73('0xe')](_0x7b73('0x9'),_0x3b866,_0x1e65c4[_0x7b73('0xe')][_0x7b73('0x10')]);return _0x250968(_0x1e65c4[_0x7b73('0xe')][_0x7b73('0x10')]);}else{logger[_0x7b73('0x8')]('Sound,\x20%s,\x20%s',_0x3b866,_0x7b73('0xa'));_0x250968(_0x1e65c4[_0x7b73('0x11')]['message']);}})[_0x7b73('0x12')](function(_0x239bf4){logger[_0x7b73('0xe')](_0x7b73('0x9'),_0x3b866,_0x239bf4);_0x99fb4f(_0x239bf4);});});}exports[_0x7b73('0x13')]=function(_0xd95111){var _0x6fbd0d=this;return new Promise(function(_0x1087d9,_0x5e2c02){return db['Sound'][_0x7b73('0x14')]({'raw':_0xd95111[_0x7b73('0x15')]?_0xd95111[_0x7b73('0x15')][_0x7b73('0x16')]===undefined?!![]:![]:!![],'where':_0xd95111[_0x7b73('0x15')]?_0xd95111[_0x7b73('0x15')][_0x7b73('0x17')]||null:null,'attributes':_0xd95111[_0x7b73('0x15')]?_0xd95111['options']['attributes']||null:null,'include':_0xd95111[_0x7b73('0x15')]?_0xd95111['options'][_0x7b73('0x18')]?_[_0x7b73('0x19')](_0xd95111[_0x7b73('0x15')][_0x7b73('0x18')],function(_0xd3311c){return{'model':db[_0xd3311c[_0x7b73('0x1a')]],'as':_0xd3311c['as'],'attributes':_0xd3311c[_0x7b73('0x1b')],'include':_0xd3311c[_0x7b73('0x18')]?_[_0x7b73('0x19')](_0xd3311c[_0x7b73('0x18')],function(_0xc85afe){return{'model':db[_0xc85afe['model']],'as':_0xc85afe['as'],'attributes':_0xc85afe[_0x7b73('0x1b')],'include':_0xc85afe[_0x7b73('0x18')]?_['map'](_0xc85afe[_0x7b73('0x18')],function(_0x7e9ccb){return{'model':db[_0x7e9ccb[_0x7b73('0x1a')]],'as':_0x7e9ccb['as'],'attributes':_0x7e9ccb['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3e8af1){logger[_0x7b73('0x8')](_0x7b73('0x13'),_0xd95111);logger['debug'](_0x7b73('0x13'),_0xd95111,JSON['stringify'](_0x3e8af1));_0x1087d9(_0x3e8af1);})[_0x7b73('0x12')](function(_0x41363f){logger[_0x7b73('0xe')](_0x7b73('0x13'),_0x41363f[_0x7b73('0x10')],_0xd95111);_0x5e2c02(_0x6fbd0d[_0x7b73('0xe')](0x1f4,_0x41363f[_0x7b73('0x10')]));});});}; \ No newline at end of file +var _0x3d6b=['message','result','catch','ShowSound','Sound','options','where','attributes','include','map','model','then','lodash','util','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','info','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','error','code','Sound,\x20%s,\x20%s'];(function(_0xa34a9c,_0x392114){var _0x5207c0=function(_0xa723df){while(--_0xa723df){_0xa34a9c['push'](_0xa34a9c['shift']());}};_0x5207c0(++_0x392114);}(_0x3d6b,0x16b));var _0xb3d6=function(_0x328b1c,_0xec0b4f){_0x328b1c=_0x328b1c-0x0;var _0x4dbeaa=_0x3d6b[_0x328b1c];return _0x4dbeaa;};'use strict';var _=require(_0xb3d6('0x0'));var util=require(_0xb3d6('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb3d6('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb3d6('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xb3d6('0x4'))(_0xb3d6('0x5'));var config=require(_0xb3d6('0x6'));var jayson=require(_0xb3d6('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x18f7a9,_0x411b42,_0x4726d4){return new BPromise(function(_0x343bed,_0x4adbcc){return client['request'](_0x18f7a9,_0x4726d4)['then'](function(_0xc094fa){logger[_0xb3d6('0x8')]('Sound,\x20%s,\x20%s',_0x411b42,_0xb3d6('0x9'));logger[_0xb3d6('0xa')](_0xb3d6('0xb'),_0x411b42,_0xb3d6('0x9'),JSON['stringify'](_0xc094fa));if(_0xc094fa[_0xb3d6('0xc')]){if(_0xc094fa[_0xb3d6('0xc')][_0xb3d6('0xd')]===0x1f4){logger[_0xb3d6('0xc')](_0xb3d6('0xe'),_0x411b42,_0xc094fa[_0xb3d6('0xc')][_0xb3d6('0xf')]);return _0x4adbcc(_0xc094fa[_0xb3d6('0xc')][_0xb3d6('0xf')]);}logger[_0xb3d6('0xc')](_0xb3d6('0xe'),_0x411b42,_0xc094fa[_0xb3d6('0xc')][_0xb3d6('0xf')]);return _0x343bed(_0xc094fa[_0xb3d6('0xc')][_0xb3d6('0xf')]);}else{logger['info'](_0xb3d6('0xe'),_0x411b42,_0xb3d6('0x9'));_0x343bed(_0xc094fa[_0xb3d6('0x10')][_0xb3d6('0xf')]);}})[_0xb3d6('0x11')](function(_0x742415){logger[_0xb3d6('0xc')](_0xb3d6('0xe'),_0x411b42,_0x742415);_0x4adbcc(_0x742415);});});}exports[_0xb3d6('0x12')]=function(_0x27b1b8){var _0x333fa8=this;return new Promise(function(_0x49277f,_0x245afa){return db[_0xb3d6('0x13')]['find']({'raw':_0x27b1b8[_0xb3d6('0x14')]?_0x27b1b8[_0xb3d6('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x27b1b8[_0xb3d6('0x14')]?_0x27b1b8[_0xb3d6('0x14')][_0xb3d6('0x15')]||null:null,'attributes':_0x27b1b8[_0xb3d6('0x14')]?_0x27b1b8[_0xb3d6('0x14')][_0xb3d6('0x16')]||null:null,'include':_0x27b1b8[_0xb3d6('0x14')]?_0x27b1b8['options'][_0xb3d6('0x17')]?_[_0xb3d6('0x18')](_0x27b1b8[_0xb3d6('0x14')][_0xb3d6('0x17')],function(_0x3f5bff){return{'model':db[_0x3f5bff['model']],'as':_0x3f5bff['as'],'attributes':_0x3f5bff['attributes'],'include':_0x3f5bff[_0xb3d6('0x17')]?_[_0xb3d6('0x18')](_0x3f5bff[_0xb3d6('0x17')],function(_0x2770cc){return{'model':db[_0x2770cc[_0xb3d6('0x19')]],'as':_0x2770cc['as'],'attributes':_0x2770cc['attributes'],'include':_0x2770cc['include']?_['map'](_0x2770cc[_0xb3d6('0x17')],function(_0x3a495c){return{'model':db[_0x3a495c[_0xb3d6('0x19')]],'as':_0x3a495c['as'],'attributes':_0x3a495c[_0xb3d6('0x16')]};}):[]};}):[]};}):[]:[]})[_0xb3d6('0x1a')](function(_0x276003){logger[_0xb3d6('0x8')](_0xb3d6('0x12'),_0x27b1b8);logger[_0xb3d6('0xa')](_0xb3d6('0x12'),_0x27b1b8,JSON['stringify'](_0x276003));_0x49277f(_0x276003);})[_0xb3d6('0x11')](function(_0x4b4b1d){logger[_0xb3d6('0xc')](_0xb3d6('0x12'),_0x4b4b1d['message'],_0x27b1b8);_0x245afa(_0x333fa8[_0xb3d6('0xc')](0x1f4,_0x4b4b1d[_0xb3d6('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 0de73c9..1692f17 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 _0x3aa2=['../../components/auth/service','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','isAuthenticated','index','/:id','show','create','put','update','destroy','exports','connect-timeout','express','Router'];(function(_0x38537f,_0x252124){var _0x141e23=function(_0x2809b5){while(--_0x2809b5){_0x38537f['push'](_0x38537f['shift']());}};_0x141e23(++_0x252124);}(_0x3aa2,0xb8));var _0x23aa=function(_0x120da6,_0x15f450){_0x120da6=_0x120da6-0x0;var _0x3d6c07=_0x3aa2[_0x120da6];return _0x3d6c07;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x23aa('0x0'));var express=require(_0x23aa('0x1'));var router=express[_0x23aa('0x2')]();var auth=require(_0x23aa('0x3'));var interaction=require(_0x23aa('0x4'));var config=require(_0x23aa('0x5'));var controller=require(_0x23aa('0x6'));router[_0x23aa('0x7')]('/',auth[_0x23aa('0x8')](),controller[_0x23aa('0x9')]);router[_0x23aa('0x7')](_0x23aa('0xa'),auth['isAuthenticated'](),controller[_0x23aa('0xb')]);router['post']('/',auth[_0x23aa('0x8')](),controller[_0x23aa('0xc')]);router[_0x23aa('0xd')](_0x23aa('0xa'),auth[_0x23aa('0x8')](),controller[_0x23aa('0xe')]);router['delete']('/:id',auth[_0x23aa('0x8')](),controller[_0x23aa('0xf')]);module[_0x23aa('0x10')]=router; \ No newline at end of file +var _0xbe93=['index','get','post','create','update','/:id','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./squareMessage.controller','isAuthenticated'];(function(_0xc6a956,_0x3799f9){var _0x4826a5=function(_0x1fb5a2){while(--_0x1fb5a2){_0xc6a956['push'](_0xc6a956['shift']());}};_0x4826a5(++_0x3799f9);}(_0xbe93,0x117));var _0x3be9=function(_0x12b29d,_0x46b20a){_0x12b29d=_0x12b29d-0x0;var _0x13a696=_0xbe93[_0x12b29d];return _0x13a696;};'use strict';var multer=require(_0x3be9('0x0'));var util=require(_0x3be9('0x1'));var path=require(_0x3be9('0x2'));var timeout=require(_0x3be9('0x3'));var express=require(_0x3be9('0x4'));var router=express[_0x3be9('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x3be9('0x6'));var config=require(_0x3be9('0x7'));var controller=require(_0x3be9('0x8'));router['get']('/',auth[_0x3be9('0x9')](),controller[_0x3be9('0xa')]);router[_0x3be9('0xb')]('/:id',auth[_0x3be9('0x9')](),controller['show']);router[_0x3be9('0xc')]('/',auth[_0x3be9('0x9')](),controller[_0x3be9('0xd')]);router['put']('/:id',auth[_0x3be9('0x9')](),controller[_0x3be9('0xe')]);router['delete'](_0x3be9('0xf'),auth[_0x3be9('0x9')](),controller['destroy']);module[_0x3be9('0x10')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index f9cf6b4..26dfbe9 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 _0xfb64=['STRING','TEXT','medium','out','exports'];(function(_0x258756,_0x2c7b9b){var _0x2983c2=function(_0x188fb5){while(--_0x188fb5){_0x258756['push'](_0x258756['shift']());}};_0x2983c2(++_0x2c7b9b);}(_0xfb64,0x167));var _0x4fb6=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xfb64[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require('sequelize');module[_0x4fb6('0x0')]={'uniqueid':{'type':Sequelize[_0x4fb6('0x1')]},'body':{'type':Sequelize[_0x4fb6('0x2')](_0x4fb6('0x3')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0x4fb6('0x4')),'defaultValue':_0x4fb6('0x4'),'allowNull':![]}}; \ No newline at end of file +var _0xe351=['ENUM','out','sequelize','exports','STRING','TEXT'];(function(_0x51a318,_0x27f23c){var _0x281ae9=function(_0x349847){while(--_0x349847){_0x51a318['push'](_0x51a318['shift']());}};_0x281ae9(++_0x27f23c);}(_0xe351,0x188));var _0x1e35=function(_0x332f1f,_0xc7fa69){_0x332f1f=_0x332f1f-0x0;var _0x4365c9=_0xe351[_0x332f1f];return _0x4365c9;};'use strict';var Sequelize=require(_0x1e35('0x0'));module[_0x1e35('0x1')]={'uniqueid':{'type':Sequelize[_0x1e35('0x2')]},'body':{'type':Sequelize[_0x1e35('0x3')]('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0x1e35('0x4')]('in',_0x1e35('0x5')),'defaultValue':_0x1e35('0x5'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 2fb02d8..cd44b64 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 _0x4a47=['query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','catch','show','find','create','body','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','set','apply','reject','save','update','then','destroy','stack','name','index','map','SquareMessage','fieldName','type','key'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x4a47,0xa8));var _0x74a4=function(_0x3b4638,_0x2d8442){_0x3b4638=_0x3b4638-0x0;var _0x445338=_0x4a47[_0x3b4638];return _0x445338;};'use strict';var pdf=require(_0x74a4('0x0'));var emlformat=require(_0x74a4('0x1'));var rimraf=require(_0x74a4('0x2'));var zipdir=require(_0x74a4('0x3'));var jsonpatch=require(_0x74a4('0x4'));var rp=require(_0x74a4('0x5'));var moment=require('moment');var BPromise=require(_0x74a4('0x6'));var Mustache=require('mustache');var util=require(_0x74a4('0x7'));var path=require('path');var sox=require(_0x74a4('0x8'));var csv=require('to-csv');var ejs=require(_0x74a4('0x9'));var fs=require('fs');var _=require(_0x74a4('0xa'));var squel=require(_0x74a4('0xb'));var crypto=require(_0x74a4('0xc'));var jsforce=require(_0x74a4('0xd'));var deskjs=require(_0x74a4('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x74a4('0xf'));var authService=require(_0x74a4('0x10'));var qs=require(_0x74a4('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x74a4('0x12'));var logger=require('../../config/logger')(_0x74a4('0x13'));var utils=require(_0x74a4('0x14'));var config=require(_0x74a4('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x486142,_0x3c5191){_0x3c5191=_0x3c5191||0xcc;return function(_0x20ac7a){if(_0x20ac7a){return _0x486142[_0x74a4('0x16')](_0x3c5191);}return _0x486142[_0x74a4('0x17')](_0x3c5191)[_0x74a4('0x18')]();};}function respondWithResult(_0x20f233,_0x4ec3ce){_0x4ec3ce=_0x4ec3ce||0xc8;return function(_0x227259){if(_0x227259){return _0x20f233[_0x74a4('0x17')](_0x4ec3ce)[_0x74a4('0x19')](_0x227259);}};}function respondWithFilteredResult(_0x220e28,_0x59951d){return function(_0x3b3689){if(_0x3b3689){var _0x2d6081=_0x3b3689['count'],_0x10e819=_0x59951d[_0x74a4('0x1a')],_0x361fdd=_0x59951d[_0x74a4('0x1a')]+_0x59951d['limit'],_0x1cc2ea;if(_0x361fdd>=_0x2d6081){_0x361fdd=_0x2d6081;_0x1cc2ea=0xc8;}else{_0x1cc2ea=0xce;}_0x220e28[_0x74a4('0x17')](_0x1cc2ea);return _0x220e28[_0x74a4('0x1b')]('Content-Range',_0x10e819+'-'+_0x361fdd+'/'+_0x2d6081)[_0x74a4('0x19')](_0x3b3689);}return null;};}function patchUpdates(_0x3b3a23){return function(_0x859046){try{jsonpatch[_0x74a4('0x1c')](_0x859046,_0x3b3a23,!![]);}catch(_0x5ee1dd){return BPromise[_0x74a4('0x1d')](_0x5ee1dd);}return _0x859046[_0x74a4('0x1e')]();};}function saveUpdates(_0xdd67bb,_0x1230cd){return function(_0x1a25de){if(_0x1a25de){return _0x1a25de[_0x74a4('0x1f')](_0xdd67bb)[_0x74a4('0x20')](function(_0x26b954){return _0x26b954;});}return null;};}function removeEntity(_0x169c15,_0x5024db){return function(_0x3b3c44){if(_0x3b3c44){return _0x3b3c44[_0x74a4('0x21')]()['then'](function(){_0x169c15['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e7d5e,_0x464f28){return function(_0x101615){if(!_0x101615){_0x3e7d5e[_0x74a4('0x16')](0x194);}return _0x101615;};}function handleError(_0x3447ab,_0x3853f7){_0x3853f7=_0x3853f7||0x1f4;return function(_0x47fa8b){logger['error'](_0x47fa8b[_0x74a4('0x22')]);if(_0x47fa8b[_0x74a4('0x23')]){delete _0x47fa8b[_0x74a4('0x23')];}_0x3447ab[_0x74a4('0x17')](_0x3853f7)['send'](_0x47fa8b);};}exports[_0x74a4('0x24')]=function(_0x25ca36,_0x1a1da1){var _0x54c62e={},_0x2f4ad1={},_0x123b2e={'count':0x0,'rows':[]};var _0x34ce91=_[_0x74a4('0x25')](db[_0x74a4('0x26')]['rawAttributes'],function(_0x5cb389){return{'name':_0x5cb389[_0x74a4('0x27')],'type':_0x5cb389[_0x74a4('0x28')][_0x74a4('0x29')]};});_0x2f4ad1['model']=_['map'](_0x34ce91,'name');_0x2f4ad1[_0x74a4('0x2a')]=_[_0x74a4('0x2b')](_0x25ca36['query']);_0x2f4ad1[_0x74a4('0x2c')]=_[_0x74a4('0x2d')](_0x2f4ad1[_0x74a4('0x2e')],_0x2f4ad1[_0x74a4('0x2a')]);_0x54c62e[_0x74a4('0x2f')]=_[_0x74a4('0x2d')](_0x2f4ad1[_0x74a4('0x2e')],qs[_0x74a4('0x30')](_0x25ca36[_0x74a4('0x2a')][_0x74a4('0x30')]));_0x54c62e[_0x74a4('0x2f')]=_0x54c62e['attributes'][_0x74a4('0x31')]?_0x54c62e['attributes']:_0x2f4ad1[_0x74a4('0x2e')];if(!_0x25ca36[_0x74a4('0x2a')][_0x74a4('0x32')](_0x74a4('0x33'))){_0x54c62e[_0x74a4('0x34')]=qs[_0x74a4('0x34')](_0x25ca36[_0x74a4('0x2a')][_0x74a4('0x34')]);_0x54c62e[_0x74a4('0x1a')]=qs[_0x74a4('0x1a')](_0x25ca36['query'][_0x74a4('0x1a')]);}_0x54c62e[_0x74a4('0x35')]=qs[_0x74a4('0x36')](_0x25ca36[_0x74a4('0x2a')][_0x74a4('0x36')]);_0x54c62e[_0x74a4('0x37')]=qs[_0x74a4('0x2c')](_[_0x74a4('0x38')](_0x25ca36[_0x74a4('0x2a')],_0x2f4ad1[_0x74a4('0x2c')]));if(_0x25ca36[_0x74a4('0x2a')][_0x74a4('0x39')]){_0x54c62e[_0x74a4('0x37')]=_[_0x74a4('0x3a')](_0x54c62e[_0x74a4('0x37')],{'$or':_['map'](_0x34ce91,function(_0x44abdc){if(_0x44abdc[_0x74a4('0x28')][_0x74a4('0x29')]!==_0x74a4('0x3b')){var _0x2e65e6={};_0x2e65e6[_0x44abdc['field']]={'$like':'%'+_0x25ca36['query']['filter']+'%'};return _0x2e65e6;}})});}_0x54c62e=_['merge']({},_0x54c62e,_0x25ca36[_0x74a4('0x3c')]);var _0x21cfc1={'where':_0x54c62e[_0x74a4('0x37')]};return db[_0x74a4('0x26')][_0x74a4('0x3d')](_0x21cfc1)['then'](function(_0x1558d2){_0x123b2e[_0x74a4('0x3d')]=_0x1558d2;if(_0x25ca36[_0x74a4('0x2a')][_0x74a4('0x3e')]){_0x54c62e[_0x74a4('0x3f')]=[{'all':!![]}];}return db[_0x74a4('0x26')]['findAll'](_0x54c62e);})[_0x74a4('0x20')](function(_0x250a19){_0x123b2e['rows']=_0x250a19;return _0x123b2e;})[_0x74a4('0x20')](respondWithFilteredResult(_0x1a1da1,_0x54c62e))[_0x74a4('0x40')](handleError(_0x1a1da1,null));};exports[_0x74a4('0x41')]=function(_0x30cbb0,_0x1ce3d4){var _0x206219={'raw':!![],'where':{'id':_0x30cbb0['params']['id']}},_0x2f1f13={};_0x2f1f13[_0x74a4('0x2e')]=_[_0x74a4('0x2b')](db[_0x74a4('0x26')]['rawAttributes']);_0x2f1f13[_0x74a4('0x2a')]=_[_0x74a4('0x2b')](_0x30cbb0[_0x74a4('0x2a')]);_0x2f1f13[_0x74a4('0x2c')]=_[_0x74a4('0x2d')](_0x2f1f13['model'],_0x2f1f13['query']);_0x206219[_0x74a4('0x2f')]=_['intersection'](_0x2f1f13['model'],qs['fields'](_0x30cbb0['query']['fields']));_0x206219['attributes']=_0x206219[_0x74a4('0x2f')]['length']?_0x206219[_0x74a4('0x2f')]:_0x2f1f13[_0x74a4('0x2e')];if(_0x30cbb0[_0x74a4('0x2a')]['includeAll']){_0x206219[_0x74a4('0x3f')]=[{'all':!![]}];}_0x206219=_['merge']({},_0x206219,_0x30cbb0[_0x74a4('0x3c')]);return db[_0x74a4('0x26')][_0x74a4('0x42')](_0x206219)[_0x74a4('0x20')](handleEntityNotFound(_0x1ce3d4,null))[_0x74a4('0x20')](respondWithResult(_0x1ce3d4,null))['catch'](handleError(_0x1ce3d4,null));};exports[_0x74a4('0x43')]=function(_0x53af6d,_0x56a50a){return db[_0x74a4('0x26')]['create'](_0x53af6d[_0x74a4('0x44')],{})[_0x74a4('0x20')](respondWithResult(_0x56a50a,0xc9))[_0x74a4('0x40')](handleError(_0x56a50a,null));};exports['update']=function(_0x281b97,_0x59a89f){if(_0x281b97['body']['id']){delete _0x281b97['body']['id'];}return db['SquareMessage'][_0x74a4('0x42')]({'where':{'id':_0x281b97[_0x74a4('0x45')]['id']}})[_0x74a4('0x20')](handleEntityNotFound(_0x59a89f,null))[_0x74a4('0x20')](saveUpdates(_0x281b97[_0x74a4('0x44')],null))['then'](respondWithResult(_0x59a89f,null))[_0x74a4('0x40')](handleError(_0x59a89f,null));};exports[_0x74a4('0x21')]=function(_0x53b59d,_0xc5e58f){return db[_0x74a4('0x26')][_0x74a4('0x42')]({'where':{'id':_0x53b59d[_0x74a4('0x45')]['id']}})['then'](handleEntityNotFound(_0xc5e58f,null))[_0x74a4('0x20')](removeEntity(_0xc5e58f,null))[_0x74a4('0x40')](handleError(_0xc5e58f,null));}; \ No newline at end of file +var _0x738a=['destroy','then','sendStatus','stack','name','send','index','map','SquareMessage','fieldName','type','key','query','filters','attributes','intersection','fields','model','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','field','options','count','includeAll','findAll','show','rawAttributes','keys','find','catch','create','body','update','params','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','set','Content-Range','apply','save'];(function(_0x57b778,_0x4d07c2){var _0x51011f=function(_0x3bd04e){while(--_0x3bd04e){_0x57b778['push'](_0x57b778['shift']());}};_0x51011f(++_0x4d07c2);}(_0x738a,0xc2));var _0xa738=function(_0x1058db,_0x7e3063){_0x1058db=_0x1058db-0x0;var _0x195b98=_0x738a[_0x1058db];return _0x195b98;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xa738('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa738('0x1'));var rp=require(_0xa738('0x2'));var moment=require(_0xa738('0x3'));var BPromise=require(_0xa738('0x4'));var Mustache=require(_0xa738('0x5'));var util=require(_0xa738('0x6'));var path=require(_0xa738('0x7'));var sox=require(_0xa738('0x8'));var csv=require(_0xa738('0x9'));var ejs=require(_0xa738('0xa'));var fs=require('fs');var _=require(_0xa738('0xb'));var squel=require('squel');var crypto=require(_0xa738('0xc'));var jsforce=require(_0xa738('0xd'));var deskjs=require(_0xa738('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa738('0xf'));var Papa=require(_0xa738('0x10'));var Redis=require(_0xa738('0x11'));var authService=require(_0xa738('0x12'));var qs=require(_0xa738('0x13'));var as=require(_0xa738('0x14'));var hardwareService=require(_0xa738('0x15'));var logger=require(_0xa738('0x16'))(_0xa738('0x17'));var utils=require(_0xa738('0x18'));var config=require(_0xa738('0x19'));var db=require(_0xa738('0x1a'))['db'];function respondWithStatusCode(_0x1113b2,_0x440029){_0x440029=_0x440029||0xcc;return function(_0x1fe380){if(_0x1fe380){return _0x1113b2['sendStatus'](_0x440029);}return _0x1113b2[_0xa738('0x1b')](_0x440029)['end']();};}function respondWithResult(_0x58d5c6,_0x4eee33){_0x4eee33=_0x4eee33||0xc8;return function(_0x2b5516){if(_0x2b5516){return _0x58d5c6['status'](_0x4eee33)[_0xa738('0x1c')](_0x2b5516);}};}function respondWithFilteredResult(_0x4c66b5,_0x36727a){return function(_0x348252){if(_0x348252){var _0x1437cc=_0x348252['count'],_0x222878=_0x36727a[_0xa738('0x1d')],_0x17e67b=_0x36727a['offset']+_0x36727a['limit'],_0x289350;if(_0x17e67b>=_0x1437cc){_0x17e67b=_0x1437cc;_0x289350=0xc8;}else{_0x289350=0xce;}_0x4c66b5[_0xa738('0x1b')](_0x289350);return _0x4c66b5[_0xa738('0x1e')](_0xa738('0x1f'),_0x222878+'-'+_0x17e67b+'/'+_0x1437cc)[_0xa738('0x1c')](_0x348252);}return null;};}function patchUpdates(_0x5c7e77){return function(_0x4e2a57){try{jsonpatch[_0xa738('0x20')](_0x4e2a57,_0x5c7e77,!![]);}catch(_0x5b53b0){return BPromise['reject'](_0x5b53b0);}return _0x4e2a57[_0xa738('0x21')]();};}function saveUpdates(_0x4209a0,_0x32d7bf){return function(_0x5d1009){if(_0x5d1009){return _0x5d1009['update'](_0x4209a0)['then'](function(_0x2260fe){return _0x2260fe;});}return null;};}function removeEntity(_0x3bd95a,_0x25be8c){return function(_0x3849a8){if(_0x3849a8){return _0x3849a8[_0xa738('0x22')]()[_0xa738('0x23')](function(){_0x3bd95a[_0xa738('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x33dfec,_0x4b0e6a){return function(_0xe0418b){if(!_0xe0418b){_0x33dfec[_0xa738('0x24')](0x194);}return _0xe0418b;};}function handleError(_0x2f24a7,_0x27a5e7){_0x27a5e7=_0x27a5e7||0x1f4;return function(_0x2f9a6e){logger['error'](_0x2f9a6e[_0xa738('0x25')]);if(_0x2f9a6e[_0xa738('0x26')]){delete _0x2f9a6e['name'];}_0x2f24a7[_0xa738('0x1b')](_0x27a5e7)[_0xa738('0x27')](_0x2f9a6e);};}exports[_0xa738('0x28')]=function(_0x43bbce,_0x17a869){var _0x460d40={},_0xe26635={},_0x16549a={'count':0x0,'rows':[]};var _0x316a8f=_[_0xa738('0x29')](db[_0xa738('0x2a')]['rawAttributes'],function(_0x550f19){return{'name':_0x550f19[_0xa738('0x2b')],'type':_0x550f19[_0xa738('0x2c')][_0xa738('0x2d')]};});_0xe26635['model']=_[_0xa738('0x29')](_0x316a8f,_0xa738('0x26'));_0xe26635[_0xa738('0x2e')]=_['keys'](_0x43bbce[_0xa738('0x2e')]);_0xe26635[_0xa738('0x2f')]=_['intersection'](_0xe26635['model'],_0xe26635[_0xa738('0x2e')]);_0x460d40[_0xa738('0x30')]=_[_0xa738('0x31')](_0xe26635['model'],qs[_0xa738('0x32')](_0x43bbce[_0xa738('0x2e')][_0xa738('0x32')]));_0x460d40[_0xa738('0x30')]=_0x460d40[_0xa738('0x30')]['length']?_0x460d40['attributes']:_0xe26635[_0xa738('0x33')];if(!_0x43bbce['query'][_0xa738('0x34')](_0xa738('0x35'))){_0x460d40[_0xa738('0x36')]=qs[_0xa738('0x36')](_0x43bbce['query'][_0xa738('0x36')]);_0x460d40[_0xa738('0x1d')]=qs[_0xa738('0x1d')](_0x43bbce['query'][_0xa738('0x1d')]);}_0x460d40[_0xa738('0x37')]=qs['sort'](_0x43bbce[_0xa738('0x2e')][_0xa738('0x38')]);_0x460d40['where']=qs['filters'](_[_0xa738('0x39')](_0x43bbce[_0xa738('0x2e')],_0xe26635[_0xa738('0x2f')]));if(_0x43bbce['query'][_0xa738('0x3a')]){_0x460d40[_0xa738('0x3b')]=_[_0xa738('0x3c')](_0x460d40[_0xa738('0x3b')],{'$or':_['map'](_0x316a8f,function(_0x421073){if(_0x421073[_0xa738('0x2c')][_0xa738('0x2d')]!==_0xa738('0x3d')){var _0xb0ee41={};_0xb0ee41[_0x421073[_0xa738('0x3e')]]={'$like':'%'+_0x43bbce[_0xa738('0x2e')][_0xa738('0x3a')]+'%'};return _0xb0ee41;}})});}_0x460d40=_[_0xa738('0x3c')]({},_0x460d40,_0x43bbce[_0xa738('0x3f')]);var _0x315481={'where':_0x460d40['where']};return db[_0xa738('0x2a')][_0xa738('0x40')](_0x315481)['then'](function(_0x227c1b){_0x16549a[_0xa738('0x40')]=_0x227c1b;if(_0x43bbce['query'][_0xa738('0x41')]){_0x460d40['include']=[{'all':!![]}];}return db[_0xa738('0x2a')][_0xa738('0x42')](_0x460d40);})['then'](function(_0x1d105f){_0x16549a['rows']=_0x1d105f;return _0x16549a;})['then'](respondWithFilteredResult(_0x17a869,_0x460d40))['catch'](handleError(_0x17a869,null));};exports[_0xa738('0x43')]=function(_0x1adc6f,_0x57a132){var _0x46af8b={'raw':!![],'where':{'id':_0x1adc6f['params']['id']}},_0x4618ab={};_0x4618ab[_0xa738('0x33')]=_['keys'](db['SquareMessage'][_0xa738('0x44')]);_0x4618ab['query']=_[_0xa738('0x45')](_0x1adc6f['query']);_0x4618ab[_0xa738('0x2f')]=_[_0xa738('0x31')](_0x4618ab[_0xa738('0x33')],_0x4618ab[_0xa738('0x2e')]);_0x46af8b[_0xa738('0x30')]=_[_0xa738('0x31')](_0x4618ab['model'],qs[_0xa738('0x32')](_0x1adc6f[_0xa738('0x2e')][_0xa738('0x32')]));_0x46af8b[_0xa738('0x30')]=_0x46af8b[_0xa738('0x30')]['length']?_0x46af8b[_0xa738('0x30')]:_0x4618ab['model'];if(_0x1adc6f[_0xa738('0x2e')][_0xa738('0x41')]){_0x46af8b['include']=[{'all':!![]}];}_0x46af8b=_[_0xa738('0x3c')]({},_0x46af8b,_0x1adc6f[_0xa738('0x3f')]);return db[_0xa738('0x2a')][_0xa738('0x46')](_0x46af8b)[_0xa738('0x23')](handleEntityNotFound(_0x57a132,null))['then'](respondWithResult(_0x57a132,null))[_0xa738('0x47')](handleError(_0x57a132,null));};exports[_0xa738('0x48')]=function(_0x4ec962,_0x605663){return db[_0xa738('0x2a')][_0xa738('0x48')](_0x4ec962[_0xa738('0x49')],{})[_0xa738('0x23')](respondWithResult(_0x605663,0xc9))[_0xa738('0x47')](handleError(_0x605663,null));};exports[_0xa738('0x4a')]=function(_0x100465,_0x3681de){if(_0x100465['body']['id']){delete _0x100465[_0xa738('0x49')]['id'];}return db['SquareMessage'][_0xa738('0x46')]({'where':{'id':_0x100465[_0xa738('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3681de,null))[_0xa738('0x23')](saveUpdates(_0x100465[_0xa738('0x49')],null))[_0xa738('0x23')](respondWithResult(_0x3681de,null))['catch'](handleError(_0x3681de,null));};exports[_0xa738('0x22')]=function(_0x28430f,_0x44ed26){return db[_0xa738('0x2a')][_0xa738('0x46')]({'where':{'id':_0x28430f[_0xa738('0x4b')]['id']}})[_0xa738('0x23')](handleEntityNotFound(_0x44ed26,null))[_0xa738('0x23')](removeEntity(_0x44ed26,null))[_0xa738('0x47')](handleError(_0x44ed26,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index cfc466a..e92b4aa 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 _0xae7b=['rimraf','../../config/environment','./squareMessage.attributes','exports','define','SquareMessage','square_messages','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x1a3c47,_0x55c170){var _0x2e8714=function(_0x2fb4a1){while(--_0x2fb4a1){_0x1a3c47['push'](_0x1a3c47['shift']());}};_0x2e8714(++_0x55c170);}(_0xae7b,0x85));var _0xbae7=function(_0xedad0f,_0xd2a73d){_0xedad0f=_0xedad0f-0x0;var _0x1d657e=_0xae7b[_0xedad0f];return _0x1d657e;};'use strict';var _=require(_0xbae7('0x0'));var util=require(_0xbae7('0x1'));var logger=require('../../config/logger')(_0xbae7('0x2'));var moment=require(_0xbae7('0x3'));var BPromise=require(_0xbae7('0x4'));var rp=require(_0xbae7('0x5'));var fs=require('fs');var path=require(_0xbae7('0x6'));var rimraf=require(_0xbae7('0x7'));var config=require(_0xbae7('0x8'));var attributes=require(_0xbae7('0x9'));module[_0xbae7('0xa')]=function(_0x1d18c,_0x338708){return _0x1d18c[_0xbae7('0xb')](_0xbae7('0xc'),attributes,{'tableName':_0xbae7('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2c82=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./squareMessage.attributes','define','SquareMessage','square_messages','lodash','util'];(function(_0x4a4202,_0x507c5f){var _0x372d69=function(_0x4bd21b){while(--_0x4bd21b){_0x4a4202['push'](_0x4a4202['shift']());}};_0x372d69(++_0x507c5f);}(_0x2c82,0x73));var _0x22c8=function(_0x2298f0,_0x3bbf4f){_0x2298f0=_0x2298f0-0x0;var _0x39b136=_0x2c82[_0x2298f0];return _0x39b136;};'use strict';var _=require(_0x22c8('0x0'));var util=require(_0x22c8('0x1'));var logger=require(_0x22c8('0x2'))(_0x22c8('0x3'));var moment=require(_0x22c8('0x4'));var BPromise=require(_0x22c8('0x5'));var rp=require(_0x22c8('0x6'));var fs=require('fs');var path=require(_0x22c8('0x7'));var rimraf=require(_0x22c8('0x8'));var config=require('../../config/environment');var attributes=require(_0x22c8('0x9'));module['exports']=function(_0x3a3c3d,_0x4fa68a){return _0x3a3c3d[_0x22c8('0xa')](_0x22c8('0xb'),attributes,{'tableName':_0x22c8('0xc'),'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 bbde7b8..114a210 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 _0x8506=['ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateSquareMessage','SquareMessage','options','raw','info','stringify','util','bluebird'];(function(_0x52b7a2,_0x5458c3){var _0xa34627=function(_0x48849e){while(--_0x48849e){_0x52b7a2['push'](_0x52b7a2['shift']());}};_0xa34627(++_0x5458c3);}(_0x8506,0xe8));var _0x6850=function(_0x4ff05c,_0x4197c4){_0x4ff05c=_0x4ff05c-0x0;var _0x3209d0=_0x8506[_0x4ff05c];return _0x3209d0;};'use strict';var _=require('lodash');var util=require(_0x6850('0x0'));var moment=require('moment');var BPromise=require(_0x6850('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6850('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x6850('0x3'));var logger=require(_0x6850('0x4'))(_0x6850('0x5'));var config=require('../../config/environment');var jayson=require(_0x6850('0x6'));var client=jayson[_0x6850('0x7')][_0x6850('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3c301f,_0x5858ca,_0x51c0ad){return new BPromise(function(_0x5466ee,_0x117706){return client[_0x6850('0x9')](_0x3c301f,_0x51c0ad)[_0x6850('0xa')](function(_0x589417){logger['info'](_0x6850('0xb'),_0x5858ca,_0x6850('0xc'));logger[_0x6850('0xd')](_0x6850('0xe'),_0x5858ca,_0x6850('0xc'),JSON['stringify'](_0x589417));if(_0x589417[_0x6850('0xf')]){if(_0x589417[_0x6850('0xf')][_0x6850('0x10')]===0x1f4){logger[_0x6850('0xf')](_0x6850('0xb'),_0x5858ca,_0x589417[_0x6850('0xf')]['message']);return _0x117706(_0x589417[_0x6850('0xf')][_0x6850('0x11')]);}logger[_0x6850('0xf')](_0x6850('0xb'),_0x5858ca,_0x589417[_0x6850('0xf')][_0x6850('0x11')]);return _0x5466ee(_0x589417['error'][_0x6850('0x11')]);}else{logger['info'](_0x6850('0xb'),_0x5858ca,_0x6850('0xc'));_0x5466ee(_0x589417[_0x6850('0x12')][_0x6850('0x11')]);}})[_0x6850('0x13')](function(_0x32b9d3){logger[_0x6850('0xf')](_0x6850('0xb'),_0x5858ca,_0x32b9d3);_0x117706(_0x32b9d3);});});}exports[_0x6850('0x14')]=function(_0x441f79){var _0xeff8de=this;return new Promise(function(_0x145dbb,_0x44a5e4){return db[_0x6850('0x15')]['create'](_0x441f79['body'],{'raw':_0x441f79[_0x6850('0x16')]?_0x441f79[_0x6850('0x16')][_0x6850('0x17')]===undefined?!![]:![]:!![]})[_0x6850('0xa')](function(_0x12a15d){logger[_0x6850('0x18')]('CreateSquareMessage',_0x441f79);logger[_0x6850('0xd')](_0x6850('0x14'),_0x441f79,JSON[_0x6850('0x19')](_0x12a15d));_0x145dbb(_0x12a15d);})[_0x6850('0x13')](function(_0x2978a1){logger[_0x6850('0xf')](_0x6850('0x14'),_0x2978a1[_0x6850('0x11')],_0x441f79);_0x44a5e4(_0xeff8de[_0x6850('0xf')](0x1f4,_0x2978a1[_0x6850('0x11')]));});});}; \ No newline at end of file +var _0xac6a=['catch','CreateSquareMessage','SquareMessage','create','body','options','raw','then','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0xd02bb,_0x26e2d0){var _0x1cdf23=function(_0x18fd05){while(--_0x18fd05){_0xd02bb['push'](_0xd02bb['shift']());}};_0x1cdf23(++_0x26e2d0);}(_0xac6a,0xc2));var _0xaac6=function(_0x1fbaa7,_0x3d63cf){_0x1fbaa7=_0x1fbaa7-0x0;var _0x4a031b=_0xac6a[_0x1fbaa7];return _0x4a031b;};'use strict';var _=require(_0xaac6('0x0'));var util=require(_0xaac6('0x1'));var moment=require(_0xaac6('0x2'));var BPromise=require(_0xaac6('0x3'));var rs=require(_0xaac6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaac6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xaac6('0x6'))(_0xaac6('0x7'));var config=require(_0xaac6('0x8'));var jayson=require(_0xaac6('0x9'));var client=jayson[_0xaac6('0xa')][_0xaac6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2547b2,_0xbadbe3,_0x3edefc){return new BPromise(function(_0x467bc5,_0x404a53){return client[_0xaac6('0xc')](_0x2547b2,_0x3edefc)['then'](function(_0x6f34a5){logger[_0xaac6('0xd')](_0xaac6('0xe'),_0xbadbe3,_0xaac6('0xf'));logger[_0xaac6('0x10')](_0xaac6('0x11'),_0xbadbe3,'request\x20sent',JSON[_0xaac6('0x12')](_0x6f34a5));if(_0x6f34a5[_0xaac6('0x13')]){if(_0x6f34a5[_0xaac6('0x13')][_0xaac6('0x14')]===0x1f4){logger[_0xaac6('0x13')]('SquareMessage,\x20%s,\x20%s',_0xbadbe3,_0x6f34a5[_0xaac6('0x13')][_0xaac6('0x15')]);return _0x404a53(_0x6f34a5['error']['message']);}logger[_0xaac6('0x13')](_0xaac6('0xe'),_0xbadbe3,_0x6f34a5[_0xaac6('0x13')][_0xaac6('0x15')]);return _0x467bc5(_0x6f34a5[_0xaac6('0x13')][_0xaac6('0x15')]);}else{logger[_0xaac6('0xd')](_0xaac6('0xe'),_0xbadbe3,_0xaac6('0xf'));_0x467bc5(_0x6f34a5[_0xaac6('0x16')][_0xaac6('0x15')]);}})[_0xaac6('0x17')](function(_0x4c2de0){logger['error'](_0xaac6('0xe'),_0xbadbe3,_0x4c2de0);_0x404a53(_0x4c2de0);});});}exports[_0xaac6('0x18')]=function(_0x3cce6f){var _0xaf75d=this;return new Promise(function(_0x3d234a,_0x521e44){return db[_0xaac6('0x19')][_0xaac6('0x1a')](_0x3cce6f[_0xaac6('0x1b')],{'raw':_0x3cce6f[_0xaac6('0x1c')]?_0x3cce6f[_0xaac6('0x1c')][_0xaac6('0x1d')]===undefined?!![]:![]:!![]})[_0xaac6('0x1e')](function(_0x4a6064){logger[_0xaac6('0xd')](_0xaac6('0x18'),_0x3cce6f);logger[_0xaac6('0x10')](_0xaac6('0x18'),_0x3cce6f,JSON[_0xaac6('0x12')](_0x4a6064));_0x3d234a(_0x4a6064);})[_0xaac6('0x17')](function(_0x2afe80){logger['error']('CreateSquareMessage',_0x2afe80[_0xaac6('0x15')],_0x3cce6f);_0x521e44(_0xaf75d['error'](0x1f4,_0x2afe80[_0xaac6('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index bb2866e..c5a9313 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 _0xf4e9=['/:id','/:id/test','15s','test','post','create','put','update','delete','destroy','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated'];(function(_0x3d7be7,_0x15451e){var _0x40acd0=function(_0x2e4373){while(--_0x2e4373){_0x3d7be7['push'](_0x3d7be7['shift']());}};_0x40acd0(++_0x15451e);}(_0xf4e9,0xc8));var _0x9f4e=function(_0x573241,_0x4f363a){_0x573241=_0x573241-0x0;var _0x48060a=_0xf4e9[_0x573241];return _0x48060a;};'use strict';var multer=require('multer');var util=require(_0x9f4e('0x0'));var path=require(_0x9f4e('0x1'));var timeout=require('connect-timeout');var express=require(_0x9f4e('0x2'));var router=express[_0x9f4e('0x3')]();var auth=require(_0x9f4e('0x4'));var interaction=require(_0x9f4e('0x5'));var config=require(_0x9f4e('0x6'));var controller=require(_0x9f4e('0x7'));router[_0x9f4e('0x8')]('/',auth[_0x9f4e('0x9')](),controller['index']);router[_0x9f4e('0x8')](_0x9f4e('0xa'),auth[_0x9f4e('0x9')](),controller['show']);router[_0x9f4e('0x8')](_0x9f4e('0xb'),auth[_0x9f4e('0x9')](),timeout(_0x9f4e('0xc')),controller[_0x9f4e('0xd')]);router[_0x9f4e('0xe')]('/',auth['isAuthenticated'](),controller[_0x9f4e('0xf')]);router[_0x9f4e('0x10')](_0x9f4e('0xa'),auth['isAuthenticated'](),controller[_0x9f4e('0x11')]);router[_0x9f4e('0x12')](_0x9f4e('0xa'),auth[_0x9f4e('0x9')](),controller[_0x9f4e('0x13')]);module[_0x9f4e('0x14')]=router; \ No newline at end of file +var _0x581a=['15s','test','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated','show','/:id/test'];(function(_0x4ef066,_0x4143a0){var _0x12ba64=function(_0x1e4635){while(--_0x1e4635){_0x4ef066['push'](_0x4ef066['shift']());}};_0x12ba64(++_0x4143a0);}(_0x581a,0x127));var _0xa581=function(_0x5228b4,_0x3794b2){_0x5228b4=_0x5228b4-0x0;var _0x29934e=_0x581a[_0x5228b4];return _0x29934e;};'use strict';var multer=require(_0xa581('0x0'));var util=require(_0xa581('0x1'));var path=require('path');var timeout=require(_0xa581('0x2'));var express=require(_0xa581('0x3'));var router=express[_0xa581('0x4')]();var auth=require(_0xa581('0x5'));var interaction=require(_0xa581('0x6'));var config=require('../../config/environment');var controller=require('./squareOdbc.controller');router[_0xa581('0x7')]('/',auth['isAuthenticated'](),controller[_0xa581('0x8')]);router[_0xa581('0x7')](_0xa581('0x9'),auth[_0xa581('0xa')](),controller[_0xa581('0xb')]);router[_0xa581('0x7')](_0xa581('0xc'),auth[_0xa581('0xa')](),timeout(_0xa581('0xd')),controller[_0xa581('0xe')]);router[_0xa581('0xf')]('/',auth['isAuthenticated'](),controller[_0xa581('0x10')]);router[_0xa581('0x11')](_0xa581('0x9'),auth[_0xa581('0xa')](),controller[_0xa581('0x12')]);router[_0xa581('0x13')](_0xa581('0x9'),auth['isAuthenticated'](),controller[_0xa581('0x14')]);module[_0xa581('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index bd0850e..eff9742 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 _0x937b=['name','sequelize','exports','STRING'];(function(_0x2a65d9,_0xddc2ed){var _0x2b53af=function(_0x9e7ac0){while(--_0x9e7ac0){_0x2a65d9['push'](_0x2a65d9['shift']());}};_0x2b53af(++_0xddc2ed);}(_0x937b,0xb1));var _0xb937=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x937b[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xb937('0x0'));module[_0xb937('0x1')]={'name':{'type':Sequelize[_0xb937('0x2')],'unique':_0xb937('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0xb937('0x2')]},'description':{'type':Sequelize[_0xb937('0x2')]}}; \ No newline at end of file +var _0xf4fa=['name','sequelize','STRING'];(function(_0x30351e,_0x2020d2){var _0x5ef9d6=function(_0x5bfaad){while(--_0x5bfaad){_0x30351e['push'](_0x30351e['shift']());}};_0x5ef9d6(++_0x2020d2);}(_0xf4fa,0x11b));var _0xaf4f=function(_0x5862e0,_0x48a17f){_0x5862e0=_0x5862e0-0x0;var _0x4210a7=_0xf4fa[_0x5862e0];return _0x4210a7;};'use strict';var Sequelize=require(_0xaf4f('0x0'));module['exports']={'name':{'type':Sequelize[_0xaf4f('0x1')],'unique':_0xaf4f('0x2'),'allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xaf4f('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 80a4d1b..e62c5f3 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 _0xd597=['dsn','odbc','openSync','closeSync','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','status','set','Content-Range','apply','reject','save','then','destroy','ODBC','UserProfileResource','error','name','send','index','map','SquareOdbc','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','rawAttributes','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','params','test'];(function(_0x394f68,_0x198543){var _0x487357=function(_0x204f28){while(--_0x204f28){_0x394f68['push'](_0x394f68['shift']());}};_0x487357(++_0x198543);}(_0xd597,0x158));var _0x7d59=function(_0x399251,_0xbda926){_0x399251=_0x399251-0x0;var _0x54d9e5=_0xd597[_0x399251];return _0x54d9e5;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x7d59('0x0'));var zipdir=require(_0x7d59('0x1'));var jsonpatch=require(_0x7d59('0x2'));var rp=require(_0x7d59('0x3'));var moment=require('moment');var BPromise=require(_0x7d59('0x4'));var Mustache=require(_0x7d59('0x5'));var util=require(_0x7d59('0x6'));var path=require(_0x7d59('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7d59('0x8'));var fs=require('fs');var _=require(_0x7d59('0x9'));var squel=require('squel');var crypto=require(_0x7d59('0xa'));var jsforce=require(_0x7d59('0xb'));var deskjs=require(_0x7d59('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7d59('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7d59('0xe'));var as=require(_0x7d59('0xf'));var hardwareService=require(_0x7d59('0x10'));var logger=require(_0x7d59('0x11'))(_0x7d59('0x12'));var utils=require(_0x7d59('0x13'));var config=require(_0x7d59('0x14'));var db=require(_0x7d59('0x15'))['db'];function respondWithStatusCode(_0x2475f9,_0x118133){_0x118133=_0x118133||0xcc;return function(_0x164a5a){if(_0x164a5a){return _0x2475f9[_0x7d59('0x16')](_0x118133);}return _0x2475f9['status'](_0x118133)[_0x7d59('0x17')]();};}function respondWithResult(_0x55cbfe,_0x44699e){_0x44699e=_0x44699e||0xc8;return function(_0x1d613d){if(_0x1d613d){return _0x55cbfe['status'](_0x44699e)[_0x7d59('0x18')](_0x1d613d);}};}function respondWithFilteredResult(_0x33f19f,_0x4bb245){return function(_0x211e06){if(_0x211e06){var _0x4a1dec=_0x211e06[_0x7d59('0x19')],_0x3a8fee=_0x4bb245[_0x7d59('0x1a')],_0x4ee1be=_0x4bb245[_0x7d59('0x1a')]+_0x4bb245['limit'],_0x158a9c;if(_0x4ee1be>=_0x4a1dec){_0x4ee1be=_0x4a1dec;_0x158a9c=0xc8;}else{_0x158a9c=0xce;}_0x33f19f[_0x7d59('0x1b')](_0x158a9c);return _0x33f19f[_0x7d59('0x1c')](_0x7d59('0x1d'),_0x3a8fee+'-'+_0x4ee1be+'/'+_0x4a1dec)[_0x7d59('0x18')](_0x211e06);}return null;};}function patchUpdates(_0x14ae0c){return function(_0x5c683c){try{jsonpatch[_0x7d59('0x1e')](_0x5c683c,_0x14ae0c,!![]);}catch(_0x41a7eb){return BPromise[_0x7d59('0x1f')](_0x41a7eb);}return _0x5c683c[_0x7d59('0x20')]();};}function saveUpdates(_0x1b72e9,_0x16ae3b){return function(_0x57018d){if(_0x57018d){return _0x57018d['update'](_0x1b72e9)[_0x7d59('0x21')](function(_0x5a0dc7){return _0x5a0dc7;});}return null;};}function removeEntity(_0x33222f,_0x4426a5){return function(_0x132d44){if(_0x132d44){return _0x132d44[_0x7d59('0x22')]()['then'](function(){var _0x157e33=_0x132d44['get']({'plain':!![]});var _0x231b8a=_0x7d59('0x23');return db[_0x7d59('0x24')][_0x7d59('0x22')]({'where':{'type':_0x231b8a,'resourceId':_0x157e33['id']}})['then'](function(){return _0x132d44;});})[_0x7d59('0x21')](function(){_0x33222f[_0x7d59('0x1b')](0xcc)[_0x7d59('0x17')]();});}};}function handleEntityNotFound(_0x12e812,_0x6c6234){return function(_0x2bc3cd){if(!_0x2bc3cd){_0x12e812[_0x7d59('0x16')](0x194);}return _0x2bc3cd;};}function handleError(_0x45d429,_0x2ce779){_0x2ce779=_0x2ce779||0x1f4;return function(_0x57ff9f){logger[_0x7d59('0x25')](_0x57ff9f['stack']);if(_0x57ff9f['name']){delete _0x57ff9f[_0x7d59('0x26')];}_0x45d429[_0x7d59('0x1b')](_0x2ce779)[_0x7d59('0x27')](_0x57ff9f);};}exports[_0x7d59('0x28')]=function(_0x144d42,_0x2c139d){var _0x50cda1={},_0x53b02d={},_0x55f4f5={'count':0x0,'rows':[]};var _0x5c868f=_[_0x7d59('0x29')](db[_0x7d59('0x2a')]['rawAttributes'],function(_0xe1ec60){return{'name':_0xe1ec60[_0x7d59('0x2b')],'type':_0xe1ec60[_0x7d59('0x2c')][_0x7d59('0x2d')]};});_0x53b02d[_0x7d59('0x2e')]=_[_0x7d59('0x29')](_0x5c868f,'name');_0x53b02d[_0x7d59('0x2f')]=_[_0x7d59('0x30')](_0x144d42[_0x7d59('0x2f')]);_0x53b02d[_0x7d59('0x31')]=_['intersection'](_0x53b02d['model'],_0x53b02d[_0x7d59('0x2f')]);_0x50cda1[_0x7d59('0x32')]=_[_0x7d59('0x33')](_0x53b02d[_0x7d59('0x2e')],qs['fields'](_0x144d42[_0x7d59('0x2f')][_0x7d59('0x34')]));_0x50cda1[_0x7d59('0x32')]=_0x50cda1[_0x7d59('0x32')][_0x7d59('0x35')]?_0x50cda1['attributes']:_0x53b02d[_0x7d59('0x2e')];if(!_0x144d42[_0x7d59('0x2f')]['hasOwnProperty'](_0x7d59('0x36'))){_0x50cda1[_0x7d59('0x37')]=qs[_0x7d59('0x37')](_0x144d42[_0x7d59('0x2f')][_0x7d59('0x37')]);_0x50cda1[_0x7d59('0x1a')]=qs[_0x7d59('0x1a')](_0x144d42['query']['offset']);}_0x50cda1[_0x7d59('0x38')]=qs[_0x7d59('0x39')](_0x144d42[_0x7d59('0x2f')][_0x7d59('0x39')]);_0x50cda1[_0x7d59('0x3a')]=qs['filters'](_[_0x7d59('0x3b')](_0x144d42[_0x7d59('0x2f')],_0x53b02d[_0x7d59('0x31')]));if(_0x144d42[_0x7d59('0x2f')][_0x7d59('0x3c')]){_0x50cda1[_0x7d59('0x3a')]=_[_0x7d59('0x3d')](_0x50cda1[_0x7d59('0x3a')],{'$or':_[_0x7d59('0x29')](_0x5c868f,function(_0x181466){if(_0x181466[_0x7d59('0x2c')][_0x7d59('0x2d')]!==_0x7d59('0x3e')){var _0x165f7d={};_0x165f7d[_0x181466['field']]={'$like':'%'+_0x144d42[_0x7d59('0x2f')]['filter']+'%'};return _0x165f7d;}})});}_0x50cda1=_[_0x7d59('0x3d')]({},_0x50cda1,_0x144d42[_0x7d59('0x3f')]);var _0x323d24={'where':_0x50cda1[_0x7d59('0x3a')]};return db[_0x7d59('0x2a')]['count'](_0x323d24)['then'](function(_0x2a1fd1){_0x55f4f5['count']=_0x2a1fd1;if(_0x144d42[_0x7d59('0x2f')]['includeAll']){_0x50cda1[_0x7d59('0x40')]=[{'all':!![]}];}return db[_0x7d59('0x2a')][_0x7d59('0x41')](_0x50cda1);})[_0x7d59('0x21')](function(_0x1dadb4){_0x55f4f5[_0x7d59('0x42')]=_0x1dadb4;return _0x55f4f5;})[_0x7d59('0x21')](respondWithFilteredResult(_0x2c139d,_0x50cda1))[_0x7d59('0x43')](handleError(_0x2c139d,null));};exports[_0x7d59('0x44')]=function(_0x4af067,_0xbebcf3){var _0x53e3ec={'raw':!![],'where':{'id':_0x4af067['params']['id']}},_0x3d90d2={};_0x3d90d2[_0x7d59('0x2e')]=_[_0x7d59('0x30')](db[_0x7d59('0x2a')][_0x7d59('0x45')]);_0x3d90d2['query']=_[_0x7d59('0x30')](_0x4af067[_0x7d59('0x2f')]);_0x3d90d2[_0x7d59('0x31')]=_[_0x7d59('0x33')](_0x3d90d2['model'],_0x3d90d2[_0x7d59('0x2f')]);_0x53e3ec[_0x7d59('0x32')]=_[_0x7d59('0x33')](_0x3d90d2[_0x7d59('0x2e')],qs[_0x7d59('0x34')](_0x4af067[_0x7d59('0x2f')][_0x7d59('0x34')]));_0x53e3ec[_0x7d59('0x32')]=_0x53e3ec[_0x7d59('0x32')][_0x7d59('0x35')]?_0x53e3ec['attributes']:_0x3d90d2[_0x7d59('0x2e')];if(_0x4af067[_0x7d59('0x2f')]['includeAll']){_0x53e3ec[_0x7d59('0x40')]=[{'all':!![]}];}_0x53e3ec=_[_0x7d59('0x3d')]({},_0x53e3ec,_0x4af067[_0x7d59('0x3f')]);return db[_0x7d59('0x2a')]['find'](_0x53e3ec)[_0x7d59('0x21')](handleEntityNotFound(_0xbebcf3,null))[_0x7d59('0x21')](respondWithResult(_0xbebcf3,null))[_0x7d59('0x43')](handleError(_0xbebcf3,null));};exports[_0x7d59('0x46')]=function(_0x3a78a4,_0x512b74){return db['SquareOdbc'][_0x7d59('0x46')](_0x3a78a4[_0x7d59('0x47')],{})[_0x7d59('0x21')](function(_0x3ce9c6){var _0x1f702b=_0x3a78a4['user'][_0x7d59('0x48')]({'plain':!![]});if(!_0x1f702b)throw new Error(_0x7d59('0x49'));if(_0x1f702b[_0x7d59('0x4a')]===_0x7d59('0x4b')){var _0x4aa626=_0x3ce9c6['get']({'plain':!![]});var _0x29f7e8=_0x7d59('0x23');return db['UserProfileSection']['find']({'where':{'name':_0x29f7e8,'userProfileId':_0x1f702b['userProfileId']},'raw':!![]})[_0x7d59('0x21')](function(_0x4386ec){if(_0x4386ec&&_0x4386ec['autoAssociation']===0x0){return db[_0x7d59('0x24')][_0x7d59('0x46')]({'name':_0x4aa626[_0x7d59('0x26')],'resourceId':_0x4aa626['id'],'type':_0x4386ec[_0x7d59('0x26')],'sectionId':_0x4386ec['id']},{})[_0x7d59('0x21')](function(){return _0x3ce9c6;});}else{return _0x3ce9c6;}})['catch'](function(_0x15383e){logger['error'](_0x7d59('0x4c'),_0x15383e);throw _0x15383e;});}return _0x3ce9c6;})[_0x7d59('0x21')](respondWithResult(_0x512b74,0xc9))[_0x7d59('0x43')](handleError(_0x512b74,null));};exports[_0x7d59('0x4d')]=function(_0x1b95ca,_0x5b7d76){if(_0x1b95ca['body']['id']){delete _0x1b95ca['body']['id'];}return db[_0x7d59('0x2a')][_0x7d59('0x4e')]({'where':{'id':_0x1b95ca[_0x7d59('0x4f')]['id']}})[_0x7d59('0x21')](handleEntityNotFound(_0x5b7d76,null))[_0x7d59('0x21')](saveUpdates(_0x1b95ca[_0x7d59('0x47')],null))[_0x7d59('0x21')](respondWithResult(_0x5b7d76,null))[_0x7d59('0x43')](handleError(_0x5b7d76,null));};exports[_0x7d59('0x22')]=function(_0x37d009,_0x3cc5b8){return db[_0x7d59('0x2a')][_0x7d59('0x4e')]({'where':{'id':_0x37d009[_0x7d59('0x4f')]['id']}})[_0x7d59('0x21')](handleEntityNotFound(_0x3cc5b8,null))[_0x7d59('0x21')](removeEntity(_0x3cc5b8,null))[_0x7d59('0x43')](handleError(_0x3cc5b8,null));};exports[_0x7d59('0x50')]=function(_0x2b372e,_0x4ede6d,_0x22b702){var _0x3b1d9c;return db['SquareOdbc'][_0x7d59('0x4e')]({'where':{'id':_0x2b372e[_0x7d59('0x4f')]['id']},'attributes':['id',_0x7d59('0x51')]})[_0x7d59('0x21')](handleEntityNotFound(_0x4ede6d,null))[_0x7d59('0x21')](function(_0x5047d4){if(_0x5047d4){var _0x3390b1=require(_0x7d59('0x52'))();_0x3390b1[_0x7d59('0x53')](_0x5047d4['dsn']);_0x3390b1[_0x7d59('0x54')]();return _0x5047d4;}})[_0x7d59('0x21')](respondWithResult(_0x4ede6d,null))[_0x7d59('0x43')](handleError(_0x4ede6d,null));}; \ No newline at end of file +var _0x9846=['options','SquareOdbc','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','test','dsn','odbc','openSync','closeSync','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','ejs','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','end','error','stack','name','send','index','rawAttributes','type','keys','query','filters','model','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','where','map','VIRTUAL','field','filter','merge'];(function(_0xdc6b85,_0x45fcf5){var _0x3839a0=function(_0x1f59e4){while(--_0x1f59e4){_0xdc6b85['push'](_0xdc6b85['shift']());}};_0x3839a0(++_0x45fcf5);}(_0x9846,0x1ca));var _0x6984=function(_0x847864,_0x5b1faa){_0x847864=_0x847864-0x0;var _0x48a369=_0x9846[_0x847864];return _0x48a369;};'use strict';var pdf=require(_0x6984('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x6984('0x1'));var zipdir=require(_0x6984('0x2'));var jsonpatch=require(_0x6984('0x3'));var rp=require(_0x6984('0x4'));var moment=require(_0x6984('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6984('0x6'));var fs=require('fs');var _=require(_0x6984('0x7'));var squel=require(_0x6984('0x8'));var crypto=require('crypto');var jsforce=require(_0x6984('0x9'));var deskjs=require(_0x6984('0xa'));var toCsv=require(_0x6984('0xb'));var querystring=require('querystring');var Papa=require(_0x6984('0xc'));var Redis=require(_0x6984('0xd'));var authService=require(_0x6984('0xe'));var qs=require(_0x6984('0xf'));var as=require(_0x6984('0x10'));var hardwareService=require(_0x6984('0x11'));var logger=require(_0x6984('0x12'))(_0x6984('0x13'));var utils=require('../../config/utils');var config=require(_0x6984('0x14'));var db=require(_0x6984('0x15'))['db'];function respondWithStatusCode(_0x5a31a8,_0x5563ac){_0x5563ac=_0x5563ac||0xcc;return function(_0x247532){if(_0x247532){return _0x5a31a8[_0x6984('0x16')](_0x5563ac);}return _0x5a31a8[_0x6984('0x17')](_0x5563ac)['end']();};}function respondWithResult(_0x1f0772,_0x46d3c2){_0x46d3c2=_0x46d3c2||0xc8;return function(_0x14ada7){if(_0x14ada7){return _0x1f0772[_0x6984('0x17')](_0x46d3c2)[_0x6984('0x18')](_0x14ada7);}};}function respondWithFilteredResult(_0x3b9d75,_0x577db3){return function(_0x4c46a3){if(_0x4c46a3){var _0x89602e=_0x4c46a3[_0x6984('0x19')],_0x2cb183=_0x577db3[_0x6984('0x1a')],_0x2b10d3=_0x577db3[_0x6984('0x1a')]+_0x577db3[_0x6984('0x1b')],_0x3abdc1;if(_0x2b10d3>=_0x89602e){_0x2b10d3=_0x89602e;_0x3abdc1=0xc8;}else{_0x3abdc1=0xce;}_0x3b9d75[_0x6984('0x17')](_0x3abdc1);return _0x3b9d75[_0x6984('0x1c')](_0x6984('0x1d'),_0x2cb183+'-'+_0x2b10d3+'/'+_0x89602e)['json'](_0x4c46a3);}return null;};}function patchUpdates(_0x24a5c4){return function(_0x2eb11e){try{jsonpatch[_0x6984('0x1e')](_0x2eb11e,_0x24a5c4,!![]);}catch(_0x187ca1){return BPromise[_0x6984('0x1f')](_0x187ca1);}return _0x2eb11e[_0x6984('0x20')]();};}function saveUpdates(_0x3a7607,_0x1242db){return function(_0x1e43bd){if(_0x1e43bd){return _0x1e43bd[_0x6984('0x21')](_0x3a7607)[_0x6984('0x22')](function(_0x3473ec){return _0x3473ec;});}return null;};}function removeEntity(_0x4b3a3f,_0x4c5320){return function(_0xef29c6){if(_0xef29c6){return _0xef29c6[_0x6984('0x23')]()[_0x6984('0x22')](function(){var _0x2d25e8=_0xef29c6[_0x6984('0x24')]({'plain':!![]});var _0x455f5b='ODBC';return db[_0x6984('0x25')]['destroy']({'where':{'type':_0x455f5b,'resourceId':_0x2d25e8['id']}})[_0x6984('0x22')](function(){return _0xef29c6;});})[_0x6984('0x22')](function(){_0x4b3a3f['status'](0xcc)[_0x6984('0x26')]();});}};}function handleEntityNotFound(_0x5f3577,_0x5ef5ac){return function(_0xe84525){if(!_0xe84525){_0x5f3577[_0x6984('0x16')](0x194);}return _0xe84525;};}function handleError(_0x4b84a6,_0x4bfb58){_0x4bfb58=_0x4bfb58||0x1f4;return function(_0x2f46ae){logger[_0x6984('0x27')](_0x2f46ae[_0x6984('0x28')]);if(_0x2f46ae['name']){delete _0x2f46ae[_0x6984('0x29')];}_0x4b84a6[_0x6984('0x17')](_0x4bfb58)[_0x6984('0x2a')](_0x2f46ae);};}exports[_0x6984('0x2b')]=function(_0x14439a,_0x5ea4fe){var _0x4d147c={},_0x5e3087={},_0x38b3f6={'count':0x0,'rows':[]};var _0xdefc85=_['map'](db['SquareOdbc'][_0x6984('0x2c')],function(_0x387b47){return{'name':_0x387b47['fieldName'],'type':_0x387b47[_0x6984('0x2d')]['key']};});_0x5e3087['model']=_['map'](_0xdefc85,_0x6984('0x29'));_0x5e3087['query']=_[_0x6984('0x2e')](_0x14439a[_0x6984('0x2f')]);_0x5e3087[_0x6984('0x30')]=_['intersection'](_0x5e3087[_0x6984('0x31')],_0x5e3087['query']);_0x4d147c['attributes']=_[_0x6984('0x32')](_0x5e3087[_0x6984('0x31')],qs[_0x6984('0x33')](_0x14439a['query']['fields']));_0x4d147c['attributes']=_0x4d147c[_0x6984('0x34')]['length']?_0x4d147c[_0x6984('0x34')]:_0x5e3087[_0x6984('0x31')];if(!_0x14439a[_0x6984('0x2f')][_0x6984('0x35')](_0x6984('0x36'))){_0x4d147c[_0x6984('0x1b')]=qs[_0x6984('0x1b')](_0x14439a[_0x6984('0x2f')]['limit']);_0x4d147c[_0x6984('0x1a')]=qs[_0x6984('0x1a')](_0x14439a['query'][_0x6984('0x1a')]);}_0x4d147c[_0x6984('0x37')]=qs[_0x6984('0x38')](_0x14439a[_0x6984('0x2f')][_0x6984('0x38')]);_0x4d147c['where']=qs['filters'](_[_0x6984('0x39')](_0x14439a[_0x6984('0x2f')],_0x5e3087[_0x6984('0x30')]));if(_0x14439a['query']['filter']){_0x4d147c[_0x6984('0x3a')]=_['merge'](_0x4d147c[_0x6984('0x3a')],{'$or':_[_0x6984('0x3b')](_0xdefc85,function(_0x2eb141){if(_0x2eb141[_0x6984('0x2d')]['key']!==_0x6984('0x3c')){var _0x4323c9={};_0x4323c9[_0x2eb141[_0x6984('0x3d')]]={'$like':'%'+_0x14439a[_0x6984('0x2f')][_0x6984('0x3e')]+'%'};return _0x4323c9;}})});}_0x4d147c=_[_0x6984('0x3f')]({},_0x4d147c,_0x14439a[_0x6984('0x40')]);var _0x1eab7c={'where':_0x4d147c[_0x6984('0x3a')]};return db[_0x6984('0x41')][_0x6984('0x19')](_0x1eab7c)['then'](function(_0x36ce98){_0x38b3f6[_0x6984('0x19')]=_0x36ce98;if(_0x14439a[_0x6984('0x2f')][_0x6984('0x42')]){_0x4d147c[_0x6984('0x43')]=[{'all':!![]}];}return db[_0x6984('0x41')][_0x6984('0x44')](_0x4d147c);})[_0x6984('0x22')](function(_0x392331){_0x38b3f6[_0x6984('0x45')]=_0x392331;return _0x38b3f6;})[_0x6984('0x22')](respondWithFilteredResult(_0x5ea4fe,_0x4d147c))[_0x6984('0x46')](handleError(_0x5ea4fe,null));};exports[_0x6984('0x47')]=function(_0x143dd7,_0x2b1cf2){var _0x2d0555={'raw':!![],'where':{'id':_0x143dd7[_0x6984('0x48')]['id']}},_0x4e7a95={};_0x4e7a95['model']=_[_0x6984('0x2e')](db[_0x6984('0x41')][_0x6984('0x2c')]);_0x4e7a95[_0x6984('0x2f')]=_[_0x6984('0x2e')](_0x143dd7[_0x6984('0x2f')]);_0x4e7a95[_0x6984('0x30')]=_[_0x6984('0x32')](_0x4e7a95[_0x6984('0x31')],_0x4e7a95['query']);_0x2d0555[_0x6984('0x34')]=_[_0x6984('0x32')](_0x4e7a95['model'],qs[_0x6984('0x33')](_0x143dd7[_0x6984('0x2f')]['fields']));_0x2d0555[_0x6984('0x34')]=_0x2d0555['attributes'][_0x6984('0x49')]?_0x2d0555[_0x6984('0x34')]:_0x4e7a95['model'];if(_0x143dd7[_0x6984('0x2f')][_0x6984('0x42')]){_0x2d0555[_0x6984('0x43')]=[{'all':!![]}];}_0x2d0555=_[_0x6984('0x3f')]({},_0x2d0555,_0x143dd7[_0x6984('0x40')]);return db[_0x6984('0x41')][_0x6984('0x4a')](_0x2d0555)[_0x6984('0x22')](handleEntityNotFound(_0x2b1cf2,null))[_0x6984('0x22')](respondWithResult(_0x2b1cf2,null))[_0x6984('0x46')](handleError(_0x2b1cf2,null));};exports[_0x6984('0x4b')]=function(_0x49b89b,_0xf97877){return db[_0x6984('0x41')]['create'](_0x49b89b[_0x6984('0x4c')],{})[_0x6984('0x22')](function(_0x389919){var _0xeb0ad7=_0x49b89b[_0x6984('0x4d')][_0x6984('0x24')]({'plain':!![]});if(!_0xeb0ad7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xeb0ad7[_0x6984('0x4e')]===_0x6984('0x4d')){var _0x485fef=_0x389919['get']({'plain':!![]});var _0x38dee4='ODBC';return db[_0x6984('0x4f')]['find']({'where':{'name':_0x38dee4,'userProfileId':_0xeb0ad7[_0x6984('0x50')]},'raw':!![]})['then'](function(_0xdc5602){if(_0xdc5602&&_0xdc5602[_0x6984('0x51')]===0x0){return db['UserProfileResource'][_0x6984('0x4b')]({'name':_0x485fef[_0x6984('0x29')],'resourceId':_0x485fef['id'],'type':_0xdc5602[_0x6984('0x29')],'sectionId':_0xdc5602['id']},{})[_0x6984('0x22')](function(){return _0x389919;});}else{return _0x389919;}})[_0x6984('0x46')](function(_0x1e9ac6){logger[_0x6984('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1e9ac6);throw _0x1e9ac6;});}return _0x389919;})[_0x6984('0x22')](respondWithResult(_0xf97877,0xc9))[_0x6984('0x46')](handleError(_0xf97877,null));};exports[_0x6984('0x21')]=function(_0x1b4524,_0x18101f){if(_0x1b4524['body']['id']){delete _0x1b4524['body']['id'];}return db[_0x6984('0x41')][_0x6984('0x4a')]({'where':{'id':_0x1b4524[_0x6984('0x48')]['id']}})['then'](handleEntityNotFound(_0x18101f,null))[_0x6984('0x22')](saveUpdates(_0x1b4524[_0x6984('0x4c')],null))[_0x6984('0x22')](respondWithResult(_0x18101f,null))[_0x6984('0x46')](handleError(_0x18101f,null));};exports['destroy']=function(_0x3a318f,_0x2c9600){return db[_0x6984('0x41')][_0x6984('0x4a')]({'where':{'id':_0x3a318f['params']['id']}})[_0x6984('0x22')](handleEntityNotFound(_0x2c9600,null))['then'](removeEntity(_0x2c9600,null))[_0x6984('0x46')](handleError(_0x2c9600,null));};exports[_0x6984('0x52')]=function(_0x5a7e61,_0x4d4ed9,_0x23af92){var _0x238f5d;return db[_0x6984('0x41')]['find']({'where':{'id':_0x5a7e61[_0x6984('0x48')]['id']},'attributes':['id',_0x6984('0x53')]})[_0x6984('0x22')](handleEntityNotFound(_0x4d4ed9,null))[_0x6984('0x22')](function(_0x10d724){if(_0x10d724){var _0x2fecea=require(_0x6984('0x54'))();_0x2fecea[_0x6984('0x55')](_0x10d724[_0x6984('0x53')]);_0x2fecea[_0x6984('0x56')]();return _0x10d724;}})[_0x6984('0x22')](respondWithResult(_0x4d4ed9,null))[_0x6984('0x46')](handleError(_0x4d4ed9,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 61af982..6de9b8a 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 _0xe086=['exports','define','square_odbc','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./squareOdbc.attributes'];(function(_0x59d89e,_0x55edf5){var _0x554e93=function(_0x3d40bc){while(--_0x3d40bc){_0x59d89e['push'](_0x59d89e['shift']());}};_0x554e93(++_0x55edf5);}(_0xe086,0x15f));var _0x6e08=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe086[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6e08('0x0'));var util=require('util');var logger=require(_0x6e08('0x1'))(_0x6e08('0x2'));var moment=require(_0x6e08('0x3'));var BPromise=require(_0x6e08('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6e08('0x5'));var rimraf=require(_0x6e08('0x6'));var config=require(_0x6e08('0x7'));var attributes=require(_0x6e08('0x8'));module[_0x6e08('0x9')]=function(_0x1a26a9,_0x21319f){return _0x1a26a9[_0x6e08('0xa')]('SquareOdbc',attributes,{'tableName':_0x6e08('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeea2=['rimraf','../../config/environment','./squareOdbc.attributes','exports','define','SquareOdbc','lodash','moment','bluebird','request-promise','path'];(function(_0x1196b0,_0x36c47a){var _0x111c52=function(_0x5604c7){while(--_0x5604c7){_0x1196b0['push'](_0x1196b0['shift']());}};_0x111c52(++_0x36c47a);}(_0xeea2,0x192));var _0x2eea=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xeea2[_0x413feb];return _0x40ee88;};'use strict';var _=require(_0x2eea('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x2eea('0x1'));var BPromise=require(_0x2eea('0x2'));var rp=require(_0x2eea('0x3'));var fs=require('fs');var path=require(_0x2eea('0x4'));var rimraf=require(_0x2eea('0x5'));var config=require(_0x2eea('0x6'));var attributes=require(_0x2eea('0x7'));module[_0x2eea('0x8')]=function(_0xa9626f,_0x283447){return _0xa9626f[_0x2eea('0x9')](_0x2eea('0xa'),attributes,{'tableName':'square_odbc','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 2f1e8e5..7091449 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 _0x7217=['where','attributes','map','include','model','ShowSquareOdbc','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareOdbc,\x20%s,\x20%s','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','SquareOdbc','find','options','raw'];(function(_0x3fdb0a,_0x2662e4){var _0x3baef1=function(_0x1876c4){while(--_0x1876c4){_0x3fdb0a['push'](_0x3fdb0a['shift']());}};_0x3baef1(++_0x2662e4);}(_0x7217,0x19e));var _0x7721=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0x7217[_0x1c546c];return _0x2cc384;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('SquareOdbc,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('SquareOdbc,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});}exports['ShowSquareOdbc']=function(_0x3fc09e){var _0x5cb0e6=this;return new Promise(function(_0xfec626,_0x4e96fb){return db[_0x7721('0x18')][_0x7721('0x19')]({'raw':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1b')]===undefined?!![]:![]:!![],'where':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1c')]||null:null,'attributes':_0x3fc09e['options']?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1d')]||null:null,'include':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')]['include']?_[_0x7721('0x1e')](_0x3fc09e['options'][_0x7721('0x1f')],function(_0x288e3a){return{'model':db[_0x288e3a[_0x7721('0x20')]],'as':_0x288e3a['as'],'attributes':_0x288e3a[_0x7721('0x1d')],'include':_0x288e3a[_0x7721('0x1f')]?_[_0x7721('0x1e')](_0x288e3a[_0x7721('0x1f')],function(_0x5b4d74){return{'model':db[_0x5b4d74[_0x7721('0x20')]],'as':_0x5b4d74['as'],'attributes':_0x5b4d74[_0x7721('0x1d')],'include':_0x5b4d74[_0x7721('0x1f')]?_[_0x7721('0x1e')](_0x5b4d74[_0x7721('0x1f')],function(_0x16355a){return{'model':db[_0x16355a[_0x7721('0x20')]],'as':_0x16355a['as'],'attributes':_0x16355a[_0x7721('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x7721('0xc')](function(_0x52316e){logger[_0x7721('0xd')]('ShowSquareOdbc',_0x3fc09e);logger['debug'](_0x7721('0x21'),_0x3fc09e,JSON[_0x7721('0x12')](_0x52316e));_0xfec626(_0x52316e);})[_0x7721('0x17')](function(_0x158d98){logger[_0x7721('0x13')](_0x7721('0x21'),_0x158d98[_0x7721('0x15')],_0x3fc09e);_0x4e96fb(_0x5cb0e6[_0x7721('0x13')](0x1f4,_0x158d98['message']));});});}; \ No newline at end of file +var _0x9957=['stringify','error','code','message','result','catch','ShowSquareOdbc','find','raw','options','where','attributes','include','map','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s'];(function(_0x541676,_0x3a7a0e){var _0x256f68=function(_0x218aef){while(--_0x218aef){_0x541676['push'](_0x541676['shift']());}};_0x256f68(++_0x3a7a0e);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('SquareOdbc,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});}exports[_0x7995('0x18')]=function(_0x291317){var _0x1e1415=this;return new Promise(function(_0x37a7d4,_0x4faa60){return db['SquareOdbc'][_0x7995('0x19')]({'raw':_0x291317['options']?_0x291317['options'][_0x7995('0x1a')]===undefined?!![]:![]:!![],'where':_0x291317[_0x7995('0x1b')]?_0x291317['options'][_0x7995('0x1c')]||null:null,'attributes':_0x291317['options']?_0x291317['options'][_0x7995('0x1d')]||null:null,'include':_0x291317[_0x7995('0x1b')]?_0x291317[_0x7995('0x1b')][_0x7995('0x1e')]?_[_0x7995('0x1f')](_0x291317[_0x7995('0x1b')]['include'],function(_0x32a09a){return{'model':db[_0x32a09a[_0x7995('0x20')]],'as':_0x32a09a['as'],'attributes':_0x32a09a[_0x7995('0x1d')],'include':_0x32a09a[_0x7995('0x1e')]?_[_0x7995('0x1f')](_0x32a09a[_0x7995('0x1e')],function(_0x475351){return{'model':db[_0x475351[_0x7995('0x20')]],'as':_0x475351['as'],'attributes':_0x475351['attributes'],'include':_0x475351[_0x7995('0x1e')]?_[_0x7995('0x1f')](_0x475351[_0x7995('0x1e')],function(_0x268ce7){return{'model':db[_0x268ce7[_0x7995('0x20')]],'as':_0x268ce7['as'],'attributes':_0x268ce7[_0x7995('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x47625f){logger['info'](_0x7995('0x18'),_0x291317);logger[_0x7995('0x10')](_0x7995('0x18'),_0x291317,JSON[_0x7995('0x12')](_0x47625f));_0x37a7d4(_0x47625f);})[_0x7995('0x17')](function(_0x4b6f99){logger[_0x7995('0x13')]('ShowSquareOdbc',_0x4b6f99[_0x7995('0x15')],_0x291317);_0x4faa60(_0x1e1415[_0x7995('0x13')](0x1f4,_0x4b6f99[_0x7995('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 19a3784..5f13798 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 _0x4024=['express','../../components/auth/service','../../config/environment','./squareProject.controller','index','get','/:id','show','isAuthenticated','post','put','update','delete','destroy','/:id/users','removeUsers','exports','multer','util','connect-timeout'];(function(_0x4fbb15,_0x21be0c){var _0x436338=function(_0x3b5a05){while(--_0x3b5a05){_0x4fbb15['push'](_0x4fbb15['shift']());}};_0x436338(++_0x21be0c);}(_0x4024,0x89));var _0x4402=function(_0x35ebcf,_0x142544){_0x35ebcf=_0x35ebcf-0x0;var _0x102860=_0x4024[_0x35ebcf];return _0x102860;};'use strict';var multer=require(_0x4402('0x0'));var util=require(_0x4402('0x1'));var path=require('path');var timeout=require(_0x4402('0x2'));var express=require(_0x4402('0x3'));var router=express['Router']();var auth=require(_0x4402('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4402('0x5'));var controller=require(_0x4402('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x4402('0x7')]);router[_0x4402('0x8')](_0x4402('0x9'),auth['isAuthenticated'](),controller[_0x4402('0xa')]);router['get']('/:id/users',auth[_0x4402('0xb')](),controller['getUsers']);router['post']('/',auth[_0x4402('0xb')](),controller['create']);router[_0x4402('0xc')]('/:id/users',auth[_0x4402('0xb')](),controller['addUsers']);router[_0x4402('0xd')](_0x4402('0x9'),auth['isAuthenticated'](),controller[_0x4402('0xe')]);router[_0x4402('0xf')](_0x4402('0x9'),auth['isAuthenticated'](),controller[_0x4402('0x10')]);router[_0x4402('0xf')](_0x4402('0x11'),auth[_0x4402('0xb')](),controller[_0x4402('0x12')]);module[_0x4402('0x13')]=router; \ No newline at end of file +var _0x80ed=['create','addUsers','put','/:id','update','delete','removeUsers','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','isAuthenticated','index','get','show','/:id/users','getUsers','post'];(function(_0x840300,_0x3fa1df){var _0x4be032=function(_0x324f0f){while(--_0x324f0f){_0x840300['push'](_0x840300['shift']());}};_0x4be032(++_0x3fa1df);}(_0x80ed,0x11c));var _0xd80e=function(_0x5ec58a,_0x4d4ce8){_0x5ec58a=_0x5ec58a-0x0;var _0x551f1d=_0x80ed[_0x5ec58a];return _0x551f1d;};'use strict';var multer=require(_0xd80e('0x0'));var util=require('util');var path=require(_0xd80e('0x1'));var timeout=require(_0xd80e('0x2'));var express=require(_0xd80e('0x3'));var router=express['Router']();var auth=require(_0xd80e('0x4'));var interaction=require(_0xd80e('0x5'));var config=require(_0xd80e('0x6'));var controller=require(_0xd80e('0x7'));router['get']('/',auth[_0xd80e('0x8')](),controller[_0xd80e('0x9')]);router[_0xd80e('0xa')]('/:id',auth[_0xd80e('0x8')](),controller[_0xd80e('0xb')]);router[_0xd80e('0xa')](_0xd80e('0xc'),auth[_0xd80e('0x8')](),controller[_0xd80e('0xd')]);router[_0xd80e('0xe')]('/',auth[_0xd80e('0x8')](),controller[_0xd80e('0xf')]);router[_0xd80e('0xe')]('/:id/users',auth[_0xd80e('0x8')](),controller[_0xd80e('0x10')]);router[_0xd80e('0x11')](_0xd80e('0x12'),auth[_0xd80e('0x8')](),controller[_0xd80e('0x13')]);router[_0xd80e('0x14')](_0xd80e('0x12'),auth[_0xd80e('0x8')](),controller['destroy']);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xd80e('0x15')]);module[_0xd80e('0x16')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 8f97c6c..4d95771 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 _0xe1ed=['BLOB','long','getDataValue','preproduction','toString','utf8','production','STRING','name'];(function(_0x2fa5ce,_0x3f215a){var _0x46b3e7=function(_0x227c1d){while(--_0x227c1d){_0x2fa5ce['push'](_0x2fa5ce['shift']());}};_0x46b3e7(++_0x3f215a);}(_0xe1ed,0xfa));var _0xde1e=function(_0x5bc368,_0x525aa3){_0x5bc368=_0x5bc368-0x0;var _0x2254b8=_0xe1ed[_0x5bc368];return _0x2254b8;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xde1e('0x0')],'unique':_0xde1e('0x1'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0xde1e('0x2')](_0xde1e('0x3')),'get':function(){if(this[_0xde1e('0x4')](_0xde1e('0x5'))){return this[_0xde1e('0x4')](_0xde1e('0x5'))[_0xde1e('0x6')](_0xde1e('0x7'));}}},'production':{'type':Sequelize[_0xde1e('0x2')](_0xde1e('0x3')),'get':function(){if(this[_0xde1e('0x4')](_0xde1e('0x8'))){return this[_0xde1e('0x4')](_0xde1e('0x8'))[_0xde1e('0x6')](_0xde1e('0x7'));}}}}; \ No newline at end of file +var _0x7985=['preproduction','getDataValue','toString','utf8','BLOB','production','STRING','name','TEXT','long'];(function(_0x3580df,_0x2e0e2d){var _0x592f62=function(_0x288d23){while(--_0x288d23){_0x3580df['push'](_0x3580df['shift']());}};_0x592f62(++_0x2e0e2d);}(_0x7985,0x16e));var _0x5798=function(_0x1465c1,_0xa8fd77){_0x1465c1=_0x1465c1-0x0;var _0x104621=_0x7985[_0x1465c1];return _0x104621;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x5798('0x0')],'unique':_0x5798('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0x5798('0x0')]},'notes':{'type':Sequelize[_0x5798('0x2')]},'preproduction':{'type':Sequelize['BLOB'](_0x5798('0x3')),'get':function(){if(this['getDataValue'](_0x5798('0x4'))){return this[_0x5798('0x5')](_0x5798('0x4'))[_0x5798('0x6')](_0x5798('0x7'));}}},'production':{'type':Sequelize[_0x5798('0x8')]('long'),'get':function(){if(this[_0x5798('0x5')](_0x5798('0x9'))){return this[_0x5798('0x5')](_0x5798('0x9'))[_0x5798('0x6')](_0x5798('0x7'));}}}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 2b37063..1df80d5 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 _0x9957=['rawAttributes','fieldName','type','key','model','map','query','keys','intersection','fields','length','hasOwnProperty','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','field','includeAll','include','findAll','catch','show','params','attributes','options','find','SquareProject','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addUsers','ids','omit','removeUsers','emit','userSquareProject:remove','getUsers','findOne','User','nolimit','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','offset','set','json','apply','reject','save','update','then','destroy','get','SquareProjects','UserProfileResource','stack','name'];(function(_0x29d623,_0x1a5c9c){var _0x242e59=function(_0x2c78ab){while(--_0x2c78ab){_0x29d623['push'](_0x29d623['shift']());}};_0x242e59(++_0x1a5c9c);}(_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 as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var db=require(_0x7995('0x19'))['db'];config[_0x7995('0x1a')]=_[_0x7995('0x1b')](config[_0x7995('0x1a')],{'host':_0x7995('0x1c'),'port':0x18eb});var socket=require(_0x7995('0x1d'))(new Redis(config[_0x7995('0x1a')]));require('./squareProject.socket')['register'](socket);function respondWithStatusCode(_0x2b4e94,_0x2233dd){_0x2233dd=_0x2233dd||0xcc;return function(_0x24b5bb){if(_0x24b5bb){return _0x2b4e94[_0x7995('0x1e')](_0x2233dd);}return _0x2b4e94[_0x7995('0x1f')](_0x2233dd)[_0x7995('0x20')]();};}function respondWithResult(_0x2202ce,_0x41cbf0){_0x41cbf0=_0x41cbf0||0xc8;return function(_0x5377e5){if(_0x5377e5){return _0x2202ce[_0x7995('0x1f')](_0x41cbf0)['json'](_0x5377e5);}};}function respondWithFilteredResult(_0x2f832e,_0x37f297){return function(_0x43d4b8){if(_0x43d4b8){var _0x291317=_0x43d4b8['count'],_0x1e1415=_0x37f297[_0x7995('0x21')],_0x37a7d4=_0x37f297['offset']+_0x37f297['limit'],_0x4faa60;if(_0x37a7d4>=_0x291317){_0x37a7d4=_0x291317;_0x4faa60=0xc8;}else{_0x4faa60=0xce;}_0x2f832e[_0x7995('0x1f')](_0x4faa60);return _0x2f832e[_0x7995('0x22')]('Content-Range',_0x1e1415+'-'+_0x37a7d4+'/'+_0x291317)[_0x7995('0x23')](_0x43d4b8);}return null;};}function patchUpdates(_0x51f276){return function(_0x4b1a8e){try{jsonpatch[_0x7995('0x24')](_0x4b1a8e,_0x51f276,!![]);}catch(_0x327b1f){return BPromise[_0x7995('0x25')](_0x327b1f);}return _0x4b1a8e[_0x7995('0x26')]();};}function saveUpdates(_0x460924,_0x1c278a){return function(_0x5d40ae){if(_0x5d40ae){return _0x5d40ae[_0x7995('0x27')](_0x460924)[_0x7995('0x28')](function(_0x204507){return _0x204507;});}return null;};}function removeEntity(_0x285437,_0x563799){return function(_0x13bc35){if(_0x13bc35){return _0x13bc35[_0x7995('0x29')]()[_0x7995('0x28')](function(){var _0x59405a=_0x13bc35[_0x7995('0x2a')]({'plain':!![]});var _0x34e70c=_0x7995('0x2b');return db[_0x7995('0x2c')][_0x7995('0x29')]({'where':{'type':_0x34e70c,'resourceId':_0x59405a['id']}})[_0x7995('0x28')](function(){return _0x13bc35;});})['then'](function(){_0x285437[_0x7995('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x229742,_0x49bc7e){return function(_0xf16cc2){if(!_0xf16cc2){_0x229742[_0x7995('0x1e')](0x194);}return _0xf16cc2;};}function handleError(_0x11c1eb,_0x4b6f99){_0x4b6f99=_0x4b6f99||0x1f4;return function(_0x9b2a15){logger['error'](_0x9b2a15[_0x7995('0x2d')]);if(_0x9b2a15[_0x7995('0x2e')]){delete _0x9b2a15[_0x7995('0x2e')];}_0x11c1eb['status'](_0x4b6f99)['send'](_0x9b2a15);};}exports['index']=function(_0x3573be,_0xe6b0b3){var _0x327a81={},_0x2b874d={},_0x2e3493={'count':0x0,'rows':[]};var _0x1ca460=_['map'](db['SquareProject'][_0x7995('0x2f')],function(_0x5524af){return{'name':_0x5524af[_0x7995('0x30')],'type':_0x5524af[_0x7995('0x31')][_0x7995('0x32')]};});_0x2b874d[_0x7995('0x33')]=_[_0x7995('0x34')](_0x1ca460,'name');_0x2b874d[_0x7995('0x35')]=_[_0x7995('0x36')](_0x3573be['query']);_0x2b874d['filters']=_['intersection'](_0x2b874d[_0x7995('0x33')],_0x2b874d[_0x7995('0x35')]);_0x327a81['attributes']=_[_0x7995('0x37')](_0x2b874d['model'],qs[_0x7995('0x38')](_0x3573be[_0x7995('0x35')][_0x7995('0x38')]));_0x327a81['attributes']=_0x327a81['attributes'][_0x7995('0x39')]?_0x327a81['attributes']:_0x2b874d['model'];if(!_0x3573be[_0x7995('0x35')][_0x7995('0x3a')]('nolimit')){_0x327a81[_0x7995('0x3b')]=qs[_0x7995('0x3b')](_0x3573be[_0x7995('0x35')][_0x7995('0x3b')]);_0x327a81[_0x7995('0x21')]=qs['offset'](_0x3573be[_0x7995('0x35')][_0x7995('0x21')]);}_0x327a81[_0x7995('0x3c')]=qs[_0x7995('0x3d')](_0x3573be['query'][_0x7995('0x3d')]);_0x327a81[_0x7995('0x3e')]=qs[_0x7995('0x3f')](_[_0x7995('0x40')](_0x3573be[_0x7995('0x35')],_0x2b874d[_0x7995('0x3f')]));if(_0x3573be['query'][_0x7995('0x41')]){_0x327a81[_0x7995('0x3e')]=_[_0x7995('0x42')](_0x327a81[_0x7995('0x3e')],{'$or':_[_0x7995('0x34')](_0x1ca460,function(_0x298fc2){if(_0x298fc2[_0x7995('0x31')][_0x7995('0x32')]!==_0x7995('0x43')){var _0x447981={};_0x447981[_0x298fc2[_0x7995('0x44')]]={'$like':'%'+_0x3573be[_0x7995('0x35')][_0x7995('0x41')]+'%'};return _0x447981;}})});}_0x327a81=_['merge']({},_0x327a81,_0x3573be['options']);var _0x334dff={'where':_0x327a81[_0x7995('0x3e')]};return db['SquareProject']['count'](_0x334dff)[_0x7995('0x28')](function(_0x4a9fef){_0x2e3493['count']=_0x4a9fef;if(_0x3573be[_0x7995('0x35')][_0x7995('0x45')]){_0x327a81[_0x7995('0x46')]=[{'all':!![]}];}return db['SquareProject'][_0x7995('0x47')](_0x327a81);})['then'](function(_0x3993b5){_0x2e3493['rows']=_0x3993b5;return _0x2e3493;})['then'](respondWithFilteredResult(_0xe6b0b3,_0x327a81))[_0x7995('0x48')](handleError(_0xe6b0b3,null));};exports[_0x7995('0x49')]=function(_0xc04e5,_0x3f1c35){var _0x599ecb={'raw':![],'where':{'id':_0xc04e5[_0x7995('0x4a')]['id']}},_0x3c5cde={};_0x3c5cde[_0x7995('0x33')]=_[_0x7995('0x36')](db['SquareProject']['rawAttributes']);_0x3c5cde[_0x7995('0x35')]=_['keys'](_0xc04e5[_0x7995('0x35')]);_0x3c5cde['filters']=_[_0x7995('0x37')](_0x3c5cde['model'],_0x3c5cde[_0x7995('0x35')]);_0x599ecb[_0x7995('0x4b')]=_['intersection'](_0x3c5cde[_0x7995('0x33')],qs[_0x7995('0x38')](_0xc04e5[_0x7995('0x35')][_0x7995('0x38')]));_0x599ecb['attributes']=_0x599ecb[_0x7995('0x4b')][_0x7995('0x39')]?_0x599ecb[_0x7995('0x4b')]:_0x3c5cde['model'];if(_0xc04e5[_0x7995('0x35')][_0x7995('0x45')]){_0x599ecb[_0x7995('0x46')]=[{'all':!![]}];}_0x599ecb=_[_0x7995('0x42')]({},_0x599ecb,_0xc04e5[_0x7995('0x4c')]);return db['SquareProject'][_0x7995('0x4d')](_0x599ecb)[_0x7995('0x28')](handleEntityNotFound(_0x3f1c35,null))['then'](respondWithResult(_0x3f1c35,null))[_0x7995('0x48')](handleError(_0x3f1c35,null));};exports['create']=function(_0x1d87f9,_0x187735){return db[_0x7995('0x4e')][_0x7995('0x4f')](_0x1d87f9[_0x7995('0x50')],{})[_0x7995('0x28')](function(_0x1579b9){var _0x4d46bc=_0x1d87f9[_0x7995('0x51')][_0x7995('0x2a')]({'plain':!![]});if(!_0x4d46bc)throw new Error(_0x7995('0x52'));if(_0x4d46bc['role']===_0x7995('0x51')){var _0x1fe77e=_0x1579b9[_0x7995('0x2a')]({'plain':!![]});var _0x47d1d8='SquareProjects';return db['UserProfileSection'][_0x7995('0x4d')]({'where':{'name':_0x47d1d8,'userProfileId':_0x4d46bc[_0x7995('0x53')]},'raw':!![]})['then'](function(_0x1cd85){if(_0x1cd85&&_0x1cd85[_0x7995('0x54')]===0x0){return db[_0x7995('0x2c')][_0x7995('0x4f')]({'name':_0x1fe77e[_0x7995('0x2e')],'resourceId':_0x1fe77e['id'],'type':_0x1cd85['name'],'sectionId':_0x1cd85['id']},{})[_0x7995('0x28')](function(){return _0x1579b9;});}else{return _0x1579b9;}})['catch'](function(_0x14fe7f){logger[_0x7995('0x55')](_0x7995('0x56'),_0x14fe7f);throw _0x14fe7f;});}return _0x1579b9;})['then'](respondWithResult(_0x187735,0xc9))['catch'](handleError(_0x187735,null));};exports['update']=function(_0x563f8e,_0x2e13b0){if(_0x563f8e[_0x7995('0x50')]['id']){delete _0x563f8e[_0x7995('0x50')]['id'];}return db[_0x7995('0x4e')][_0x7995('0x4d')]({'where':{'id':_0x563f8e[_0x7995('0x4a')]['id']}})[_0x7995('0x28')](handleEntityNotFound(_0x2e13b0,null))[_0x7995('0x28')](saveUpdates(_0x563f8e[_0x7995('0x50')],null))[_0x7995('0x28')](respondWithResult(_0x2e13b0,null))[_0x7995('0x48')](handleError(_0x2e13b0,null));};exports[_0x7995('0x29')]=function(_0x3da72b,_0x35bea3){return db[_0x7995('0x4e')][_0x7995('0x4d')]({'where':{'id':_0x3da72b[_0x7995('0x4a')]['id']}})[_0x7995('0x28')](handleEntityNotFound(_0x35bea3,null))[_0x7995('0x28')](removeEntity(_0x35bea3,null))['catch'](handleError(_0x35bea3,null));};exports[_0x7995('0x57')]=function(_0x630737,_0x3b8a54,_0x32c0d3){return db['SquareProject']['find']({'where':{'id':_0x630737[_0x7995('0x4a')]['id']}})[_0x7995('0x28')](handleEntityNotFound(_0x3b8a54,null))[_0x7995('0x28')](function(_0x332a85){if(_0x332a85){return _0x332a85['addUsers'](_0x630737[_0x7995('0x50')][_0x7995('0x58')],_[_0x7995('0x59')](_0x630737[_0x7995('0x50')],['ids','id'])||{});}})['then'](respondWithResult(_0x3b8a54,null))[_0x7995('0x48')](handleError(_0x3b8a54,null));};exports[_0x7995('0x5a')]=function(_0x6c0221,_0x1d69ce,_0x37072){return db[_0x7995('0x4e')][_0x7995('0x4d')]({'where':{'id':_0x6c0221[_0x7995('0x4a')]['id']}})[_0x7995('0x28')](handleEntityNotFound(_0x1d69ce,null))['then'](function(_0x18f230){if(_0x18f230){return _0x18f230[_0x7995('0x5a')](_0x6c0221[_0x7995('0x35')][_0x7995('0x58')])['then'](function(){if(_['isArray'](_0x6c0221[_0x7995('0x35')][_0x7995('0x58')])){for(var _0x47d5d7=0x0;_0x47d5d7<_0x6c0221[_0x7995('0x35')][_0x7995('0x58')][_0x7995('0x39')];_0x47d5d7+=0x1){socket[_0x7995('0x5b')](_0x7995('0x5c'),{'UserId':Number(_0x6c0221['query'][_0x7995('0x58')][_0x47d5d7]),'SquareProjectId':Number(_0x6c0221['params']['id'])});}}else{socket[_0x7995('0x5b')](_0x7995('0x5c'),{'UserId':Number(_0x6c0221[_0x7995('0x35')][_0x7995('0x58')]),'SquareProjectId':Number(_0x6c0221[_0x7995('0x4a')]['id'])});}});}})[_0x7995('0x28')](respondWithStatusCode(_0x1d69ce,null))[_0x7995('0x48')](handleError(_0x1d69ce,null));};exports[_0x7995('0x5d')]=function(_0x10f012,_0x3f2bde,_0x2618c4){var _0x234d8d={};var _0x56eb85={};var _0x45351d;var _0x23bbc1;return db[_0x7995('0x4e')][_0x7995('0x5e')]({'where':{'id':_0x10f012[_0x7995('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3f2bde,null))['then'](function(_0x268fde){if(_0x268fde){_0x45351d=_0x268fde;_0x56eb85[_0x7995('0x33')]=_[_0x7995('0x36')](db[_0x7995('0x5f')]['rawAttributes']);_0x56eb85[_0x7995('0x35')]=_['keys'](_0x10f012['query']);_0x56eb85[_0x7995('0x3f')]=_[_0x7995('0x37')](_0x56eb85[_0x7995('0x33')],_0x56eb85[_0x7995('0x35')]);_0x234d8d[_0x7995('0x4b')]=_[_0x7995('0x37')](_0x56eb85[_0x7995('0x33')],qs[_0x7995('0x38')](_0x10f012[_0x7995('0x35')][_0x7995('0x38')]));_0x234d8d['attributes']=_0x234d8d[_0x7995('0x4b')][_0x7995('0x39')]?_0x234d8d[_0x7995('0x4b')]:_0x56eb85['model'];_0x234d8d[_0x7995('0x3c')]=qs[_0x7995('0x3d')](_0x10f012[_0x7995('0x35')][_0x7995('0x3d')]);_0x234d8d[_0x7995('0x3e')]=qs[_0x7995('0x3f')](_[_0x7995('0x40')](_0x10f012[_0x7995('0x35')],_0x56eb85[_0x7995('0x3f')]));if(_0x10f012[_0x7995('0x35')][_0x7995('0x41')]){_0x234d8d['where']=_['merge'](_0x234d8d[_0x7995('0x3e')],{'$or':_[_0x7995('0x34')](_0x234d8d[_0x7995('0x4b')],function(_0x35aaec){var _0x4dbab8={};_0x4dbab8[_0x35aaec]={'$like':'%'+_0x10f012[_0x7995('0x35')][_0x7995('0x41')]+'%'};return _0x4dbab8;})});}_0x234d8d=_['merge']({},_0x234d8d,_0x10f012['options']);return _0x45351d[_0x7995('0x5d')](_0x234d8d);}})[_0x7995('0x28')](function(_0x555277){if(_0x555277){_0x23bbc1=_0x555277[_0x7995('0x39')];if(!_0x10f012['query'][_0x7995('0x3a')](_0x7995('0x60'))){_0x234d8d['limit']=qs['limit'](_0x10f012[_0x7995('0x35')]['limit']);_0x234d8d[_0x7995('0x21')]=qs[_0x7995('0x21')](_0x10f012[_0x7995('0x35')][_0x7995('0x21')]);}return _0x45351d[_0x7995('0x5d')](_0x234d8d);}})[_0x7995('0x28')](function(_0x8af865){if(_0x8af865){return _0x8af865?{'count':_0x23bbc1,'rows':_0x8af865}:null;}})[_0x7995('0x28')](respondWithResult(_0x3f2bde,null))[_0x7995('0x48')](handleError(_0x3f2bde,null));}; \ No newline at end of file +var _0x7a54=['path','sox','ejs','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./squareProject.socket','register','sendStatus','end','status','count','offset','limit','set','json','apply','reject','update','destroy','then','get','UserProfileResource','error','stack','name','send','map','SquareProject','fieldName','type','keys','filters','intersection','attributes','model','fields','query','nolimit','sort','where','pick','merge','VIRTUAL','field','filter','options','includeAll','include','show','length','create','body','user','role','SquareProjects','UserProfileSection','userProfileId','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','params','addUsers','ids','removeUsers','emit','userSquareProject:remove','User','rawAttributes','order','getUsers','hasOwnProperty','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0x209b8f,_0x532123){var _0x48096c=function(_0x3bb0a9){while(--_0x3bb0a9){_0x209b8f['push'](_0x209b8f['shift']());}};_0x48096c(++_0x532123);}(_0x7a54,0x106));var _0x47a5=function(_0x1f00d0,_0x36da7a){_0x1f00d0=_0x1f00d0-0x0;var _0x29cdf1=_0x7a54[_0x1f00d0];return _0x29cdf1;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var db=require(_0x47a5('0x14'))['db'];config[_0x47a5('0x15')]=_[_0x47a5('0x16')](config[_0x47a5('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x47a5('0x17'))(new Redis(config[_0x47a5('0x15')]));require(_0x47a5('0x18'))[_0x47a5('0x19')](socket);function respondWithStatusCode(_0x139f25,_0x620ee9){_0x620ee9=_0x620ee9||0xcc;return function(_0x3c6c46){if(_0x3c6c46){return _0x139f25[_0x47a5('0x1a')](_0x620ee9);}return _0x139f25['status'](_0x620ee9)[_0x47a5('0x1b')]();};}function respondWithResult(_0x11faf5,_0x3b001e){_0x3b001e=_0x3b001e||0xc8;return function(_0x2a2cbb){if(_0x2a2cbb){return _0x11faf5[_0x47a5('0x1c')](_0x3b001e)['json'](_0x2a2cbb);}};}function respondWithFilteredResult(_0x549de3,_0x138bc0){return function(_0x4b966e){if(_0x4b966e){var _0x5247fd=_0x4b966e[_0x47a5('0x1d')],_0x423a81=_0x138bc0[_0x47a5('0x1e')],_0xaf70a6=_0x138bc0[_0x47a5('0x1e')]+_0x138bc0[_0x47a5('0x1f')],_0x2ce454;if(_0xaf70a6>=_0x5247fd){_0xaf70a6=_0x5247fd;_0x2ce454=0xc8;}else{_0x2ce454=0xce;}_0x549de3[_0x47a5('0x1c')](_0x2ce454);return _0x549de3[_0x47a5('0x20')]('Content-Range',_0x423a81+'-'+_0xaf70a6+'/'+_0x5247fd)[_0x47a5('0x21')](_0x4b966e);}return null;};}function patchUpdates(_0xf160ba){return function(_0x47cf3c){try{jsonpatch[_0x47a5('0x22')](_0x47cf3c,_0xf160ba,!![]);}catch(_0x1f03f7){return BPromise[_0x47a5('0x23')](_0x1f03f7);}return _0x47cf3c['save']();};}function saveUpdates(_0xb8ae6c,_0x2f142b){return function(_0x23db32){if(_0x23db32){return _0x23db32[_0x47a5('0x24')](_0xb8ae6c)['then'](function(_0xe2dea9){return _0xe2dea9;});}return null;};}function removeEntity(_0x385687,_0x513981){return function(_0x28747d){if(_0x28747d){return _0x28747d[_0x47a5('0x25')]()[_0x47a5('0x26')](function(){var _0x129ce5=_0x28747d[_0x47a5('0x27')]({'plain':!![]});var _0x50bf17='SquareProjects';return db[_0x47a5('0x28')]['destroy']({'where':{'type':_0x50bf17,'resourceId':_0x129ce5['id']}})[_0x47a5('0x26')](function(){return _0x28747d;});})['then'](function(){_0x385687[_0x47a5('0x1c')](0xcc)[_0x47a5('0x1b')]();});}};}function handleEntityNotFound(_0x36ad34,_0x1dac65){return function(_0x21f296){if(!_0x21f296){_0x36ad34[_0x47a5('0x1a')](0x194);}return _0x21f296;};}function handleError(_0x24b162,_0x136b14){_0x136b14=_0x136b14||0x1f4;return function(_0x16631f){logger[_0x47a5('0x29')](_0x16631f[_0x47a5('0x2a')]);if(_0x16631f[_0x47a5('0x2b')]){delete _0x16631f[_0x47a5('0x2b')];}_0x24b162['status'](_0x136b14)[_0x47a5('0x2c')](_0x16631f);};}exports['index']=function(_0x2ef875,_0x9ac908){var _0x16901f={},_0x4d6b57={},_0x256650={'count':0x0,'rows':[]};var _0x625952=_[_0x47a5('0x2d')](db[_0x47a5('0x2e')]['rawAttributes'],function(_0x50d875){return{'name':_0x50d875[_0x47a5('0x2f')],'type':_0x50d875[_0x47a5('0x30')]['key']};});_0x4d6b57['model']=_[_0x47a5('0x2d')](_0x625952,_0x47a5('0x2b'));_0x4d6b57['query']=_[_0x47a5('0x31')](_0x2ef875['query']);_0x4d6b57[_0x47a5('0x32')]=_[_0x47a5('0x33')](_0x4d6b57['model'],_0x4d6b57['query']);_0x16901f[_0x47a5('0x34')]=_['intersection'](_0x4d6b57[_0x47a5('0x35')],qs[_0x47a5('0x36')](_0x2ef875[_0x47a5('0x37')]['fields']));_0x16901f[_0x47a5('0x34')]=_0x16901f['attributes']['length']?_0x16901f[_0x47a5('0x34')]:_0x4d6b57['model'];if(!_0x2ef875[_0x47a5('0x37')]['hasOwnProperty'](_0x47a5('0x38'))){_0x16901f[_0x47a5('0x1f')]=qs[_0x47a5('0x1f')](_0x2ef875[_0x47a5('0x37')][_0x47a5('0x1f')]);_0x16901f[_0x47a5('0x1e')]=qs[_0x47a5('0x1e')](_0x2ef875[_0x47a5('0x37')][_0x47a5('0x1e')]);}_0x16901f['order']=qs[_0x47a5('0x39')](_0x2ef875[_0x47a5('0x37')]['sort']);_0x16901f[_0x47a5('0x3a')]=qs[_0x47a5('0x32')](_[_0x47a5('0x3b')](_0x2ef875['query'],_0x4d6b57[_0x47a5('0x32')]));if(_0x2ef875[_0x47a5('0x37')]['filter']){_0x16901f[_0x47a5('0x3a')]=_[_0x47a5('0x3c')](_0x16901f['where'],{'$or':_['map'](_0x625952,function(_0x5ebd8c){if(_0x5ebd8c[_0x47a5('0x30')]['key']!==_0x47a5('0x3d')){var _0x1f9631={};_0x1f9631[_0x5ebd8c[_0x47a5('0x3e')]]={'$like':'%'+_0x2ef875[_0x47a5('0x37')][_0x47a5('0x3f')]+'%'};return _0x1f9631;}})});}_0x16901f=_[_0x47a5('0x3c')]({},_0x16901f,_0x2ef875[_0x47a5('0x40')]);var _0x1f3d01={'where':_0x16901f[_0x47a5('0x3a')]};return db[_0x47a5('0x2e')][_0x47a5('0x1d')](_0x1f3d01)[_0x47a5('0x26')](function(_0x23d6d8){_0x256650['count']=_0x23d6d8;if(_0x2ef875[_0x47a5('0x37')][_0x47a5('0x41')]){_0x16901f[_0x47a5('0x42')]=[{'all':!![]}];}return db[_0x47a5('0x2e')]['findAll'](_0x16901f);})[_0x47a5('0x26')](function(_0x528ef3){_0x256650['rows']=_0x528ef3;return _0x256650;})['then'](respondWithFilteredResult(_0x9ac908,_0x16901f))['catch'](handleError(_0x9ac908,null));};exports[_0x47a5('0x43')]=function(_0x5ec4e5,_0x2bb502){var _0x3a740b={'raw':![],'where':{'id':_0x5ec4e5['params']['id']}},_0x448610={};_0x448610[_0x47a5('0x35')]=_[_0x47a5('0x31')](db['SquareProject']['rawAttributes']);_0x448610[_0x47a5('0x37')]=_['keys'](_0x5ec4e5[_0x47a5('0x37')]);_0x448610[_0x47a5('0x32')]=_[_0x47a5('0x33')](_0x448610[_0x47a5('0x35')],_0x448610[_0x47a5('0x37')]);_0x3a740b[_0x47a5('0x34')]=_[_0x47a5('0x33')](_0x448610[_0x47a5('0x35')],qs[_0x47a5('0x36')](_0x5ec4e5[_0x47a5('0x37')][_0x47a5('0x36')]));_0x3a740b[_0x47a5('0x34')]=_0x3a740b[_0x47a5('0x34')][_0x47a5('0x44')]?_0x3a740b[_0x47a5('0x34')]:_0x448610[_0x47a5('0x35')];if(_0x5ec4e5['query'][_0x47a5('0x41')]){_0x3a740b[_0x47a5('0x42')]=[{'all':!![]}];}_0x3a740b=_['merge']({},_0x3a740b,_0x5ec4e5['options']);return db[_0x47a5('0x2e')]['find'](_0x3a740b)[_0x47a5('0x26')](handleEntityNotFound(_0x2bb502,null))[_0x47a5('0x26')](respondWithResult(_0x2bb502,null))['catch'](handleError(_0x2bb502,null));};exports['create']=function(_0x3d85cc,_0x52d409){return db[_0x47a5('0x2e')][_0x47a5('0x45')](_0x3d85cc[_0x47a5('0x46')],{})[_0x47a5('0x26')](function(_0x44fe8a){var _0x26acd2=_0x3d85cc[_0x47a5('0x47')]['get']({'plain':!![]});if(!_0x26acd2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x26acd2[_0x47a5('0x48')]===_0x47a5('0x47')){var _0x1163e3=_0x44fe8a[_0x47a5('0x27')]({'plain':!![]});var _0x2c7020=_0x47a5('0x49');return db[_0x47a5('0x4a')]['find']({'where':{'name':_0x2c7020,'userProfileId':_0x26acd2[_0x47a5('0x4b')]},'raw':!![]})[_0x47a5('0x26')](function(_0x5f6a){if(_0x5f6a&&_0x5f6a['autoAssociation']===0x0){return db[_0x47a5('0x28')]['create']({'name':_0x1163e3[_0x47a5('0x2b')],'resourceId':_0x1163e3['id'],'type':_0x5f6a[_0x47a5('0x2b')],'sectionId':_0x5f6a['id']},{})[_0x47a5('0x26')](function(){return _0x44fe8a;});}else{return _0x44fe8a;}})[_0x47a5('0x4c')](function(_0x588551){logger[_0x47a5('0x29')](_0x47a5('0x4d'),_0x588551);throw _0x588551;});}return _0x44fe8a;})[_0x47a5('0x26')](respondWithResult(_0x52d409,0xc9))[_0x47a5('0x4c')](handleError(_0x52d409,null));};exports[_0x47a5('0x24')]=function(_0x6a53b3,_0x24e9f4){if(_0x6a53b3['body']['id']){delete _0x6a53b3[_0x47a5('0x46')]['id'];}return db[_0x47a5('0x2e')][_0x47a5('0x4e')]({'where':{'id':_0x6a53b3[_0x47a5('0x4f')]['id']}})[_0x47a5('0x26')](handleEntityNotFound(_0x24e9f4,null))[_0x47a5('0x26')](saveUpdates(_0x6a53b3['body'],null))[_0x47a5('0x26')](respondWithResult(_0x24e9f4,null))[_0x47a5('0x4c')](handleError(_0x24e9f4,null));};exports[_0x47a5('0x25')]=function(_0x53871e,_0x4c5ed){return db[_0x47a5('0x2e')][_0x47a5('0x4e')]({'where':{'id':_0x53871e['params']['id']}})['then'](handleEntityNotFound(_0x4c5ed,null))[_0x47a5('0x26')](removeEntity(_0x4c5ed,null))[_0x47a5('0x4c')](handleError(_0x4c5ed,null));};exports['addUsers']=function(_0x4cf792,_0x6d6b2b,_0x4d6a82){return db[_0x47a5('0x2e')]['find']({'where':{'id':_0x4cf792['params']['id']}})[_0x47a5('0x26')](handleEntityNotFound(_0x6d6b2b,null))[_0x47a5('0x26')](function(_0x53eedf){if(_0x53eedf){return _0x53eedf[_0x47a5('0x50')](_0x4cf792[_0x47a5('0x46')]['ids'],_['omit'](_0x4cf792[_0x47a5('0x46')],[_0x47a5('0x51'),'id'])||{});}})[_0x47a5('0x26')](respondWithResult(_0x6d6b2b,null))[_0x47a5('0x4c')](handleError(_0x6d6b2b,null));};exports['removeUsers']=function(_0x199621,_0x2b4255,_0x1af800){return db['SquareProject'][_0x47a5('0x4e')]({'where':{'id':_0x199621['params']['id']}})[_0x47a5('0x26')](handleEntityNotFound(_0x2b4255,null))[_0x47a5('0x26')](function(_0x943a15){if(_0x943a15){return _0x943a15[_0x47a5('0x52')](_0x199621[_0x47a5('0x37')]['ids'])[_0x47a5('0x26')](function(){if(_['isArray'](_0x199621['query']['ids'])){for(var _0x4f8564=0x0;_0x4f8564<_0x199621[_0x47a5('0x37')][_0x47a5('0x51')][_0x47a5('0x44')];_0x4f8564+=0x1){socket['emit']('userSquareProject:remove',{'UserId':Number(_0x199621[_0x47a5('0x37')][_0x47a5('0x51')][_0x4f8564]),'SquareProjectId':Number(_0x199621[_0x47a5('0x4f')]['id'])});}}else{socket[_0x47a5('0x53')](_0x47a5('0x54'),{'UserId':Number(_0x199621['query'][_0x47a5('0x51')]),'SquareProjectId':Number(_0x199621['params']['id'])});}});}})[_0x47a5('0x26')](respondWithStatusCode(_0x2b4255,null))[_0x47a5('0x4c')](handleError(_0x2b4255,null));};exports['getUsers']=function(_0x32b4de,_0x345104,_0x132854){var _0x3e8274={};var _0x2d6494={};var _0x215634;var _0x35cca8;return db[_0x47a5('0x2e')]['findOne']({'where':{'id':_0x32b4de[_0x47a5('0x4f')]['id']}})[_0x47a5('0x26')](handleEntityNotFound(_0x345104,null))[_0x47a5('0x26')](function(_0x26e7fc){if(_0x26e7fc){_0x215634=_0x26e7fc;_0x2d6494[_0x47a5('0x35')]=_['keys'](db[_0x47a5('0x55')][_0x47a5('0x56')]);_0x2d6494[_0x47a5('0x37')]=_[_0x47a5('0x31')](_0x32b4de[_0x47a5('0x37')]);_0x2d6494[_0x47a5('0x32')]=_[_0x47a5('0x33')](_0x2d6494[_0x47a5('0x35')],_0x2d6494[_0x47a5('0x37')]);_0x3e8274[_0x47a5('0x34')]=_[_0x47a5('0x33')](_0x2d6494[_0x47a5('0x35')],qs[_0x47a5('0x36')](_0x32b4de[_0x47a5('0x37')][_0x47a5('0x36')]));_0x3e8274['attributes']=_0x3e8274[_0x47a5('0x34')][_0x47a5('0x44')]?_0x3e8274[_0x47a5('0x34')]:_0x2d6494['model'];_0x3e8274[_0x47a5('0x57')]=qs[_0x47a5('0x39')](_0x32b4de[_0x47a5('0x37')][_0x47a5('0x39')]);_0x3e8274['where']=qs[_0x47a5('0x32')](_['pick'](_0x32b4de[_0x47a5('0x37')],_0x2d6494['filters']));if(_0x32b4de[_0x47a5('0x37')]['filter']){_0x3e8274[_0x47a5('0x3a')]=_[_0x47a5('0x3c')](_0x3e8274[_0x47a5('0x3a')],{'$or':_['map'](_0x3e8274['attributes'],function(_0x4b8084){var _0x4164a3={};_0x4164a3[_0x4b8084]={'$like':'%'+_0x32b4de[_0x47a5('0x37')][_0x47a5('0x3f')]+'%'};return _0x4164a3;})});}_0x3e8274=_[_0x47a5('0x3c')]({},_0x3e8274,_0x32b4de['options']);return _0x215634[_0x47a5('0x58')](_0x3e8274);}})[_0x47a5('0x26')](function(_0x390bc0){if(_0x390bc0){_0x35cca8=_0x390bc0[_0x47a5('0x44')];if(!_0x32b4de[_0x47a5('0x37')][_0x47a5('0x59')](_0x47a5('0x38'))){_0x3e8274[_0x47a5('0x1f')]=qs[_0x47a5('0x1f')](_0x32b4de[_0x47a5('0x37')][_0x47a5('0x1f')]);_0x3e8274[_0x47a5('0x1e')]=qs['offset'](_0x32b4de[_0x47a5('0x37')]['offset']);}return _0x215634[_0x47a5('0x58')](_0x3e8274);}})[_0x47a5('0x26')](function(_0x281e5f){if(_0x281e5f){return _0x281e5f?{'count':_0x35cca8,'rows':_0x281e5f}:null;}})[_0x47a5('0x26')](respondWithResult(_0x345104,null))[_0x47a5('0x4c')](handleError(_0x345104,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index de46c06..0f476f1 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 _0x22ba=['events','../../mysqldb','remove','emit','hasOwnProperty','hook','exports'];(function(_0x4bfac3,_0x58324d){var _0x15f0f2=function(_0xf0c511){while(--_0xf0c511){_0x4bfac3['push'](_0x4bfac3['shift']());}};_0x15f0f2(++_0x58324d);}(_0x22ba,0x1b9));var _0xa22b=function(_0x37756b,_0x24db76){_0x37756b=_0x37756b-0x0;var _0x46efec=_0x22ba[_0x37756b];return _0x46efec;};'use strict';var EventEmitter=require(_0xa22b('0x0'));var SquareProject=require(_0xa22b('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xa22b('0x2')};function emitEvent(_0x3f5cb4){return function(_0x4766a6,_0xbb1399,_0x5cda3f){SquareProjectEvents[_0xa22b('0x3')](_0x3f5cb4+':'+_0x4766a6['id'],_0x4766a6);SquareProjectEvents['emit'](_0x3f5cb4,_0x4766a6);_0x5cda3f(null);};}for(var e in events){if(events[_0xa22b('0x4')](e)){var event=events[e];SquareProject[_0xa22b('0x5')](e,emitEvent(event));}}module[_0xa22b('0x6')]=SquareProjectEvents; \ No newline at end of file +var _0xa1a0=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SquareProject','setMaxListeners','update'];(function(_0x58747d,_0x38dd58){var _0x36589e=function(_0x45119e){while(--_0x45119e){_0x58747d['push'](_0x58747d['shift']());}};_0x36589e(++_0x38dd58);}(_0xa1a0,0x18b));var _0x0a1a=function(_0x2ed1a0,_0x36acd9){_0x2ed1a0=_0x2ed1a0-0x0;var _0x3d272e=_0xa1a0[_0x2ed1a0];return _0x3d272e;};'use strict';var EventEmitter=require(_0x0a1a('0x0'));var SquareProject=require(_0x0a1a('0x1'))['db'][_0x0a1a('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x0a1a('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0a1a('0x4'),'afterDestroy':_0x0a1a('0x5')};function emitEvent(_0x3cbdf3){return function(_0x1615b6,_0x356fab,_0x50ac61){SquareProjectEvents[_0x0a1a('0x6')](_0x3cbdf3+':'+_0x1615b6['id'],_0x1615b6);SquareProjectEvents[_0x0a1a('0x6')](_0x3cbdf3,_0x1615b6);_0x50ac61(null);};}for(var e in events){if(events[_0x0a1a('0x7')](e)){var event=events[e];SquareProject[_0x0a1a('0x8')](e,emitEvent(event));}}module[_0x0a1a('0x9')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 86fa490..de4aa05 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 _0xd524=['request-promise','path','rimraf','./squareProject.attributes','exports','define','SquareProject','lodash','../../config/logger','api','moment','bluebird'];(function(_0x15c530,_0x489b22){var _0x3bd24f=function(_0x164499){while(--_0x164499){_0x15c530['push'](_0x15c530['shift']());}};_0x3bd24f(++_0x489b22);}(_0xd524,0xd3));var _0x4d52=function(_0x115891,_0x3a7974){_0x115891=_0x115891-0x0;var _0x7c0a4d=_0xd524[_0x115891];return _0x7c0a4d;};'use strict';var _=require(_0x4d52('0x0'));var util=require('util');var logger=require(_0x4d52('0x1'))(_0x4d52('0x2'));var moment=require(_0x4d52('0x3'));var BPromise=require(_0x4d52('0x4'));var rp=require(_0x4d52('0x5'));var fs=require('fs');var path=require(_0x4d52('0x6'));var rimraf=require(_0x4d52('0x7'));var config=require('../../config/environment');var attributes=require(_0x4d52('0x8'));module[_0x4d52('0x9')]=function(_0x5e5631,_0x54b42c){return _0x5e5631[_0x4d52('0xa')](_0x4d52('0xb'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0f46=['path','rimraf','../../config/environment','exports','define','SquareProject','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x5a60ce,_0x48f080){var _0x393e5e=function(_0x1c58fc){while(--_0x1c58fc){_0x5a60ce['push'](_0x5a60ce['shift']());}};_0x393e5e(++_0x48f080);}(_0x0f46,0xd2));var _0x60f4=function(_0x18852d,_0x5657dc){_0x18852d=_0x18852d-0x0;var _0x549a29=_0x0f46[_0x18852d];return _0x549a29;};'use strict';var _=require(_0x60f4('0x0'));var util=require(_0x60f4('0x1'));var logger=require(_0x60f4('0x2'))('api');var moment=require(_0x60f4('0x3'));var BPromise=require(_0x60f4('0x4'));var rp=require(_0x60f4('0x5'));var fs=require('fs');var path=require(_0x60f4('0x6'));var rimraf=require(_0x60f4('0x7'));var config=require(_0x60f4('0x8'));var attributes=require('./squareProject.attributes');module[_0x60f4('0x9')]=function(_0x204365,_0x26f025){return _0x204365[_0x60f4('0xa')](_0x60f4('0xb'),attributes,{'tableName':'square_projects','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 27475ab..724445a 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 _0xa313=['find','options','raw','where','attributes','include','model','map','info','stringify','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','request','then','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ShowSquareProject','SquareProject'];(function(_0x54e8d7,_0x47718d){var _0x3b3e7a=function(_0x52b9ac){while(--_0x52b9ac){_0x54e8d7['push'](_0x54e8d7['shift']());}};_0x3b3e7a(++_0x47718d);}(_0xa313,0x7f));var _0x3a31=function(_0x810025,_0x34bb04){_0x810025=_0x810025-0x0;var _0x4dbc81=_0xa313[_0x810025];return _0x4dbc81;};'use strict';var _=require('lodash');var util=require(_0x3a31('0x0'));var moment=require(_0x3a31('0x1'));var BPromise=require('bluebird');var rs=require(_0x3a31('0x2'));var fs=require('fs');var Redis=require(_0x3a31('0x3'));var db=require(_0x3a31('0x4'))['db'];var utils=require(_0x3a31('0x5'));var logger=require(_0x3a31('0x6'))(_0x3a31('0x7'));var config=require(_0x3a31('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3a31('0x9')]['http']({'port':0x232a});config[_0x3a31('0xa')]=_[_0x3a31('0xb')](config['redis'],{'host':_0x3a31('0xc'),'port':0x18eb});var socket=require(_0x3a31('0xd'))(new Redis(config[_0x3a31('0xa')]));require(_0x3a31('0xe'))[_0x3a31('0xf')](socket);function respondWithRpcPromise(_0x17a85e,_0x27730a,_0x164496){return new BPromise(function(_0x2a2dbd,_0x1a3063){return client[_0x3a31('0x10')](_0x17a85e,_0x164496)[_0x3a31('0x11')](function(_0x28cb4e){logger['info'](_0x3a31('0x12'),_0x27730a,_0x3a31('0x13'));logger[_0x3a31('0x14')](_0x3a31('0x15'),_0x27730a,_0x3a31('0x13'),JSON['stringify'](_0x28cb4e));if(_0x28cb4e[_0x3a31('0x16')]){if(_0x28cb4e[_0x3a31('0x16')][_0x3a31('0x17')]===0x1f4){logger[_0x3a31('0x16')](_0x3a31('0x12'),_0x27730a,_0x28cb4e[_0x3a31('0x16')][_0x3a31('0x18')]);return _0x1a3063(_0x28cb4e['error']['message']);}logger[_0x3a31('0x16')]('SquareProject,\x20%s,\x20%s',_0x27730a,_0x28cb4e[_0x3a31('0x16')][_0x3a31('0x18')]);return _0x2a2dbd(_0x28cb4e['error'][_0x3a31('0x18')]);}else{logger['info'](_0x3a31('0x12'),_0x27730a,_0x3a31('0x13'));_0x2a2dbd(_0x28cb4e[_0x3a31('0x19')]['message']);}})[_0x3a31('0x1a')](function(_0x4d3f0b){logger['error'](_0x3a31('0x12'),_0x27730a,_0x4d3f0b);_0x1a3063(_0x4d3f0b);});});}exports[_0x3a31('0x1b')]=function(_0x3c9cce){var _0x44166a=this;return new Promise(function(_0x21e0a8,_0x10c7fe){return db[_0x3a31('0x1c')][_0x3a31('0x1d')]({'raw':_0x3c9cce[_0x3a31('0x1e')]?_0x3c9cce[_0x3a31('0x1e')][_0x3a31('0x1f')]===undefined?!![]:![]:!![],'where':_0x3c9cce['options']?_0x3c9cce[_0x3a31('0x1e')][_0x3a31('0x20')]||null:null,'attributes':_0x3c9cce[_0x3a31('0x1e')]?_0x3c9cce['options'][_0x3a31('0x21')]||null:null,'include':_0x3c9cce[_0x3a31('0x1e')]?_0x3c9cce[_0x3a31('0x1e')][_0x3a31('0x22')]?_['map'](_0x3c9cce[_0x3a31('0x1e')]['include'],function(_0x494326){return{'model':db[_0x494326[_0x3a31('0x23')]],'as':_0x494326['as'],'attributes':_0x494326['attributes'],'include':_0x494326[_0x3a31('0x22')]?_[_0x3a31('0x24')](_0x494326['include'],function(_0x2d8afe){return{'model':db[_0x2d8afe['model']],'as':_0x2d8afe['as'],'attributes':_0x2d8afe[_0x3a31('0x21')],'include':_0x2d8afe[_0x3a31('0x22')]?_[_0x3a31('0x24')](_0x2d8afe[_0x3a31('0x22')],function(_0x5d809b){return{'model':db[_0x5d809b[_0x3a31('0x23')]],'as':_0x5d809b['as'],'attributes':_0x5d809b[_0x3a31('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3b3177){logger[_0x3a31('0x25')](_0x3a31('0x1b'),_0x3c9cce);logger[_0x3a31('0x14')]('ShowSquareProject',_0x3c9cce,JSON[_0x3a31('0x26')](_0x3b3177));_0x21e0a8(_0x3b3177);})[_0x3a31('0x1a')](function(_0x57c693){logger[_0x3a31('0x16')](_0x3a31('0x1b'),_0x57c693[_0x3a31('0x18')],_0x3c9cce);_0x10c7fe(_0x44166a[_0x3a31('0x16')](0x1f4,_0x57c693[_0x3a31('0x18')]));});});}; \ No newline at end of file +var _0x22bd=['attributes','then','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','info','SquareProject,\x20%s,\x20%s','request\x20sent','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','message','ShowSquareProject','SquareProject','find','options','map','include','model'];(function(_0x4f6834,_0x49dc55){var _0x244f9e=function(_0x5d1103){while(--_0x5d1103){_0x4f6834['push'](_0x4f6834['shift']());}};_0x244f9e(++_0x49dc55);}(_0x22bd,0x113));var _0xd22b=function(_0x42babf,_0x58e72c){_0x42babf=_0x42babf-0x0;var _0xbae8b6=_0x22bd[_0x42babf];return _0xbae8b6;};'use strict';var _=require(_0xd22b('0x0'));var util=require(_0xd22b('0x1'));var moment=require('moment');var BPromise=require(_0xd22b('0x2'));var rs=require(_0xd22b('0x3'));var fs=require('fs');var Redis=require(_0xd22b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd22b('0x5'));var logger=require(_0xd22b('0x6'))(_0xd22b('0x7'));var config=require(_0xd22b('0x8'));var jayson=require(_0xd22b('0x9'));var client=jayson[_0xd22b('0xa')]['http']({'port':0x232a});config[_0xd22b('0xb')]=_[_0xd22b('0xc')](config[_0xd22b('0xb')],{'host':_0xd22b('0xd'),'port':0x18eb});var socket=require(_0xd22b('0xe'))(new Redis(config[_0xd22b('0xb')]));require(_0xd22b('0xf'))[_0xd22b('0x10')](socket);function respondWithRpcPromise(_0x457468,_0x2a8c16,_0x494b61){return new BPromise(function(_0x5d3bf1,_0x1304d7){return client['request'](_0x457468,_0x494b61)['then'](function(_0x5acc43){logger[_0xd22b('0x11')](_0xd22b('0x12'),_0x2a8c16,_0xd22b('0x13'));logger['debug'](_0xd22b('0x14'),_0x2a8c16,_0xd22b('0x13'),JSON[_0xd22b('0x15')](_0x5acc43));if(_0x5acc43[_0xd22b('0x16')]){if(_0x5acc43[_0xd22b('0x16')]['code']===0x1f4){logger[_0xd22b('0x16')](_0xd22b('0x12'),_0x2a8c16,_0x5acc43['error']['message']);return _0x1304d7(_0x5acc43[_0xd22b('0x16')][_0xd22b('0x17')]);}logger[_0xd22b('0x16')](_0xd22b('0x12'),_0x2a8c16,_0x5acc43['error'][_0xd22b('0x17')]);return _0x5d3bf1(_0x5acc43['error'][_0xd22b('0x17')]);}else{logger['info'](_0xd22b('0x12'),_0x2a8c16,_0xd22b('0x13'));_0x5d3bf1(_0x5acc43['result'][_0xd22b('0x17')]);}})['catch'](function(_0x56e61d){logger[_0xd22b('0x16')](_0xd22b('0x12'),_0x2a8c16,_0x56e61d);_0x1304d7(_0x56e61d);});});}exports[_0xd22b('0x18')]=function(_0x8f1e13){var _0x2333ab=this;return new Promise(function(_0x16f6bb,_0x2259ea){return db[_0xd22b('0x19')][_0xd22b('0x1a')]({'raw':_0x8f1e13[_0xd22b('0x1b')]?_0x8f1e13[_0xd22b('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x8f1e13[_0xd22b('0x1b')]?_0x8f1e13[_0xd22b('0x1b')]['where']||null:null,'attributes':_0x8f1e13[_0xd22b('0x1b')]?_0x8f1e13['options']['attributes']||null:null,'include':_0x8f1e13[_0xd22b('0x1b')]?_0x8f1e13['options']['include']?_[_0xd22b('0x1c')](_0x8f1e13[_0xd22b('0x1b')][_0xd22b('0x1d')],function(_0xd0bc5b){return{'model':db[_0xd0bc5b[_0xd22b('0x1e')]],'as':_0xd0bc5b['as'],'attributes':_0xd0bc5b[_0xd22b('0x1f')],'include':_0xd0bc5b[_0xd22b('0x1d')]?_[_0xd22b('0x1c')](_0xd0bc5b[_0xd22b('0x1d')],function(_0x33d057){return{'model':db[_0x33d057['model']],'as':_0x33d057['as'],'attributes':_0x33d057[_0xd22b('0x1f')],'include':_0x33d057['include']?_[_0xd22b('0x1c')](_0x33d057[_0xd22b('0x1d')],function(_0x79a7c9){return{'model':db[_0x79a7c9[_0xd22b('0x1e')]],'as':_0x79a7c9['as'],'attributes':_0x79a7c9[_0xd22b('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xd22b('0x20')](function(_0x4675f9){logger[_0xd22b('0x11')](_0xd22b('0x18'),_0x8f1e13);logger['debug'](_0xd22b('0x18'),_0x8f1e13,JSON['stringify'](_0x4675f9));_0x16f6bb(_0x4675f9);})[_0xd22b('0x21')](function(_0x342936){logger[_0xd22b('0x16')](_0xd22b('0x18'),_0x342936[_0xd22b('0x17')],_0x8f1e13);_0x2259ea(_0x2333ab[_0xd22b('0x16')](0x1f4,_0x342936[_0xd22b('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 480f1ef..297af52 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 _0xf494=['save','remove','emit','removeListener','register','squareProject:','./squareProject.events'];(function(_0x23498f,_0x4922e5){var _0x190224=function(_0x5df8aa){while(--_0x5df8aa){_0x23498f['push'](_0x23498f['shift']());}};_0x190224(++_0x4922e5);}(_0xf494,0x1c6));var _0x4f49=function(_0x2877e4,_0x6d4d37){_0x2877e4=_0x2877e4-0x0;var _0x4c9172=_0xf494[_0x2877e4];return _0x4c9172;};'use strict';var SquareProjectEvents=require(_0x4f49('0x0'));var events=[_0x4f49('0x1'),_0x4f49('0x2'),'update'];function createListener(_0x3aeeb8,_0x1d54cc){return function(_0x423b25){_0x1d54cc[_0x4f49('0x3')](_0x3aeeb8,_0x423b25);};}function removeListener(_0x20c0d7,_0x2a15fb){return function(){SquareProjectEvents[_0x4f49('0x4')](_0x20c0d7,_0x2a15fb);};}exports[_0x4f49('0x5')]=function(_0xc5e778){for(var _0x413530=0x0,_0x42b0e8=events['length'];_0x413530<_0x42b0e8;_0x413530++){var _0x58e9a0=events[_0x413530];var _0x169c95=createListener(_0x4f49('0x6')+_0x58e9a0,_0xc5e778);SquareProjectEvents['on'](_0x58e9a0,_0x169c95);}}; \ No newline at end of file +var _0xc4aa=['remove','update','removeListener','register','length','./squareProject.events','save'];(function(_0x3d8701,_0x48277b){var _0x29d884=function(_0x23b050){while(--_0x23b050){_0x3d8701['push'](_0x3d8701['shift']());}};_0x29d884(++_0x48277b);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xc4aa[_0x3ab51d];return _0x29a04e;};'use strict';var SquareProjectEvents=require(_0xac4a('0x0'));var events=[_0xac4a('0x1'),_0xac4a('0x2'),_0xac4a('0x3')];function createListener(_0x275161,_0x22469d){return function(_0x58634e){_0x22469d['emit'](_0x275161,_0x58634e);};}function removeListener(_0x47d4f6,_0x2f48ed){return function(){SquareProjectEvents[_0xac4a('0x4')](_0x47d4f6,_0x2f48ed);};}exports[_0xac4a('0x5')]=function(_0x215f39){for(var _0x96be2b=0x0,_0x15cd34=events[_0xac4a('0x6')];_0x96be2b<_0x15cd34;_0x96be2b++){var _0x10525b=events[_0x96be2b];var _0x5c6179=createListener('squareProject:'+_0x10525b,_0x215f39);SquareProjectEvents['on'](_0x10525b,_0x5c6179);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 33efc51..e003406 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 _0x5f66=['delete','destroy','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./squareRecording.controller','isAuthenticated','index','show','get','/:id/download','download','create','put','/:id'];(function(_0x166742,_0x55520c){var _0xb7814a=function(_0x18feaf){while(--_0x18feaf){_0x166742['push'](_0x166742['shift']());}};_0xb7814a(++_0x55520c);}(_0x5f66,0x1a0));var _0x65f6=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x5f66[_0x3e5086];return _0xfeb102;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var auth=require(_0x65f6('0x4'));var interaction=require(_0x65f6('0x5'));var config=require('../../config/environment');var controller=require(_0x65f6('0x6'));router['get']('/',auth[_0x65f6('0x7')](),controller[_0x65f6('0x8')]);router['get']('/:id',auth[_0x65f6('0x7')](),controller[_0x65f6('0x9')]);router[_0x65f6('0xa')](_0x65f6('0xb'),auth[_0x65f6('0x7')](),controller[_0x65f6('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x65f6('0xd')]);router[_0x65f6('0xe')](_0x65f6('0xf'),auth[_0x65f6('0x7')](),controller['update']);router[_0x65f6('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x65f6('0x11')]);module['exports']=router; \ No newline at end of file +var _0x0b0e=['multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','index','/:id','/:id/download','download','create','delete','exports'];(function(_0x26fa57,_0x1123e0){var _0x441ed7=function(_0x1a685d){while(--_0x1a685d){_0x26fa57['push'](_0x26fa57['shift']());}};_0x441ed7(++_0x1123e0);}(_0x0b0e,0x187));var _0xe0b0=function(_0x2261ce,_0x9ed8b6){_0x2261ce=_0x2261ce-0x0;var _0x524640=_0x0b0e[_0x2261ce];return _0x524640;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var auth=require(_0xe0b0('0x4'));var interaction=require(_0xe0b0('0x5'));var config=require(_0xe0b0('0x6'));var controller=require(_0xe0b0('0x7'));router[_0xe0b0('0x8')]('/',auth[_0xe0b0('0x9')](),controller[_0xe0b0('0xa')]);router[_0xe0b0('0x8')](_0xe0b0('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xe0b0('0x8')](_0xe0b0('0xc'),auth[_0xe0b0('0x9')](),controller[_0xe0b0('0xd')]);router['post']('/',auth[_0xe0b0('0x9')](),controller[_0xe0b0('0xe')]);router['put'](_0xe0b0('0xb'),auth[_0xe0b0('0x9')](),controller['update']);router[_0xe0b0('0xf')](_0xe0b0('0xb'),auth[_0xe0b0('0x9')](),controller['destroy']);module[_0xe0b0('0x10')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index f8afeee..79030f3 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 _0x4274=['exports','STRING'];(function(_0x1499d0,_0x3fdde1){var _0x176a26=function(_0x3672d6){while(--_0x3672d6){_0x1499d0['push'](_0x1499d0['shift']());}};_0x176a26(++_0x3fdde1);}(_0x4274,0x1d6));var _0x4427=function(_0x56a86e,_0x51f246){_0x56a86e=_0x56a86e-0x0;var _0x48ae90=_0x4274[_0x56a86e];return _0x48ae90;};'use strict';var Sequelize=require('sequelize');module[_0x4427('0x0')]={'uniqueid':{'type':Sequelize[_0x4427('0x1')]},'callerid':{'type':Sequelize[_0x4427('0x1')]},'calleridname':{'type':Sequelize[_0x4427('0x1')]},'context':{'type':Sequelize[_0x4427('0x1')]},'extension':{'type':Sequelize[_0x4427('0x1')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x4427('0x1')]},'dnid':{'type':Sequelize[_0x4427('0x1')]},'projectName':{'type':Sequelize[_0x4427('0x1')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0x4427('0x1')]},'savePath':{'type':Sequelize[_0x4427('0x1')]}}; \ No newline at end of file +var _0x5b65=['sequelize','STRING'];(function(_0x747771,_0x3d4e02){var _0x1186bc=function(_0x227eb2){while(--_0x227eb2){_0x747771['push'](_0x747771['shift']());}};_0x1186bc(++_0x3d4e02);}(_0x5b65,0xc0));var _0x55b6=function(_0x2ac3ea,_0x1e3f71){_0x2ac3ea=_0x2ac3ea-0x0;var _0xa6d553=_0x5b65[_0x2ac3ea];return _0xa6d553;};'use strict';var Sequelize=require(_0x55b6('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x55b6('0x1')]},'callerid':{'type':Sequelize[_0x55b6('0x1')]},'calleridname':{'type':Sequelize[_0x55b6('0x1')]},'context':{'type':Sequelize[_0x55b6('0x1')]},'extension':{'type':Sequelize[_0x55b6('0x1')]},'priority':{'type':Sequelize[_0x55b6('0x1')]},'accountcode':{'type':Sequelize[_0x55b6('0x1')]},'dnid':{'type':Sequelize[_0x55b6('0x1')]},'projectName':{'type':Sequelize[_0x55b6('0x1')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0x55b6('0x1')]},'savePath':{'type':Sequelize[_0x55b6('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 2559d7c..029a040 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 _0x7d69=['lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','count','offset','limit','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','send','index','map','SquareRecording','rawAttributes','fieldName','type','model','name','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','filter','where','merge','VIRTUAL','field','options','includeAll','include','findAll','show','params','find','create','body','catch','uniqueid','savePath','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','filename','download','extname','unlink','SquareRecording\x20not\x20found','Not\x20found','html-pdf','eml-format','zip-dir','moment','path','to-csv'];(function(_0x5f37ee,_0x1ae21b){var _0xefbede=function(_0x54835e){while(--_0x54835e){_0x5f37ee['push'](_0x5f37ee['shift']());}};_0xefbede(++_0x1ae21b);}(_0x7d69,0xf0));var _0x97d6=function(_0x246162,_0x4804f5){_0x246162=_0x246162-0x0;var _0x2d5106=_0x7d69[_0x246162];return _0x2d5106;};'use strict';var pdf=require(_0x97d6('0x0'));var emlformat=require(_0x97d6('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x97d6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x97d6('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x97d6('0x4'));var sox=require('sox');var csv=require(_0x97d6('0x5'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x97d6('0x6'));var squel=require('squel');var crypto=require(_0x97d6('0x7'));var jsforce=require(_0x97d6('0x8'));var deskjs=require('desk.js');var toCsv=require(_0x97d6('0x5'));var querystring=require(_0x97d6('0x9'));var Papa=require('papaparse');var Redis=require(_0x97d6('0xa'));var authService=require(_0x97d6('0xb'));var qs=require(_0x97d6('0xc'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x97d6('0xd'));var logger=require(_0x97d6('0xe'))(_0x97d6('0xf'));var utils=require(_0x97d6('0x10'));var config=require(_0x97d6('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x28db54,_0x2be5b7){_0x2be5b7=_0x2be5b7||0xcc;return function(_0x4f60f4){if(_0x4f60f4){return _0x28db54[_0x97d6('0x12')](_0x2be5b7);}return _0x28db54['status'](_0x2be5b7)[_0x97d6('0x13')]();};}function respondWithResult(_0x35952d,_0x320d45){_0x320d45=_0x320d45||0xc8;return function(_0x11c7ff){if(_0x11c7ff){return _0x35952d[_0x97d6('0x14')](_0x320d45)['json'](_0x11c7ff);}};}function respondWithFilteredResult(_0x4490f0,_0x59de7f){return function(_0x31d8a9){if(_0x31d8a9){var _0x59ee29=_0x31d8a9[_0x97d6('0x15')],_0x218bed=_0x59de7f[_0x97d6('0x16')],_0x527e8d=_0x59de7f[_0x97d6('0x16')]+_0x59de7f[_0x97d6('0x17')],_0x3a5e3a;if(_0x527e8d>=_0x59ee29){_0x527e8d=_0x59ee29;_0x3a5e3a=0xc8;}else{_0x3a5e3a=0xce;}_0x4490f0['status'](_0x3a5e3a);return _0x4490f0['set'](_0x97d6('0x18'),_0x218bed+'-'+_0x527e8d+'/'+_0x59ee29)[_0x97d6('0x19')](_0x31d8a9);}return null;};}function patchUpdates(_0x47438c){return function(_0xd0fc83){try{jsonpatch[_0x97d6('0x1a')](_0xd0fc83,_0x47438c,!![]);}catch(_0x1fffdb){return BPromise[_0x97d6('0x1b')](_0x1fffdb);}return _0xd0fc83[_0x97d6('0x1c')]();};}function saveUpdates(_0x38ed84,_0x54898a){return function(_0x47dbda){if(_0x47dbda){return _0x47dbda[_0x97d6('0x1d')](_0x38ed84)[_0x97d6('0x1e')](function(_0x309548){return _0x309548;});}return null;};}function removeEntity(_0xa441a4,_0x2fa47a){return function(_0x1e87f2){if(_0x1e87f2){return _0x1e87f2[_0x97d6('0x1f')]()[_0x97d6('0x1e')](function(){_0xa441a4[_0x97d6('0x14')](0xcc)[_0x97d6('0x13')]();});}};}function handleEntityNotFound(_0x3cb2f4,_0x2ccf5c){return function(_0x111af7){if(!_0x111af7){_0x3cb2f4[_0x97d6('0x12')](0x194);}return _0x111af7;};}function handleError(_0x5f13c5,_0x3f0f2f){_0x3f0f2f=_0x3f0f2f||0x1f4;return function(_0x46b019){logger[_0x97d6('0x20')](_0x46b019[_0x97d6('0x21')]);if(_0x46b019['name']){delete _0x46b019['name'];}_0x5f13c5[_0x97d6('0x14')](_0x3f0f2f)[_0x97d6('0x22')](_0x46b019);};}exports[_0x97d6('0x23')]=function(_0x3eacb9,_0x35a4ec){var _0x56f08b={},_0xbef4ed={},_0x57320f={'count':0x0,'rows':[]};var _0x18a022=_[_0x97d6('0x24')](db[_0x97d6('0x25')][_0x97d6('0x26')],function(_0x1b0a2c){return{'name':_0x1b0a2c[_0x97d6('0x27')],'type':_0x1b0a2c[_0x97d6('0x28')]['key']};});_0xbef4ed[_0x97d6('0x29')]=_['map'](_0x18a022,_0x97d6('0x2a'));_0xbef4ed[_0x97d6('0x2b')]=_[_0x97d6('0x2c')](_0x3eacb9['query']);_0xbef4ed[_0x97d6('0x2d')]=_[_0x97d6('0x2e')](_0xbef4ed[_0x97d6('0x29')],_0xbef4ed[_0x97d6('0x2b')]);_0x56f08b['attributes']=_[_0x97d6('0x2e')](_0xbef4ed[_0x97d6('0x29')],qs[_0x97d6('0x2f')](_0x3eacb9[_0x97d6('0x2b')][_0x97d6('0x2f')]));_0x56f08b['attributes']=_0x56f08b[_0x97d6('0x30')][_0x97d6('0x31')]?_0x56f08b[_0x97d6('0x30')]:_0xbef4ed['model'];if(!_0x3eacb9[_0x97d6('0x2b')]['hasOwnProperty'](_0x97d6('0x32'))){_0x56f08b[_0x97d6('0x17')]=qs[_0x97d6('0x17')](_0x3eacb9[_0x97d6('0x2b')][_0x97d6('0x17')]);_0x56f08b[_0x97d6('0x16')]=qs['offset'](_0x3eacb9['query'][_0x97d6('0x16')]);}_0x56f08b['order']=qs[_0x97d6('0x33')](_0x3eacb9[_0x97d6('0x2b')]['sort']);_0x56f08b['where']=qs[_0x97d6('0x2d')](_['pick'](_0x3eacb9[_0x97d6('0x2b')],_0xbef4ed[_0x97d6('0x2d')]));if(_0x3eacb9[_0x97d6('0x2b')][_0x97d6('0x34')]){_0x56f08b[_0x97d6('0x35')]=_[_0x97d6('0x36')](_0x56f08b[_0x97d6('0x35')],{'$or':_[_0x97d6('0x24')](_0x18a022,function(_0x3ff481){if(_0x3ff481[_0x97d6('0x28')]['key']!==_0x97d6('0x37')){var _0x137a43={};_0x137a43[_0x3ff481[_0x97d6('0x38')]]={'$like':'%'+_0x3eacb9['query']['filter']+'%'};return _0x137a43;}})});}_0x56f08b=_[_0x97d6('0x36')]({},_0x56f08b,_0x3eacb9[_0x97d6('0x39')]);var _0x299a61={'where':_0x56f08b[_0x97d6('0x35')]};return db[_0x97d6('0x25')][_0x97d6('0x15')](_0x299a61)[_0x97d6('0x1e')](function(_0x570acb){_0x57320f['count']=_0x570acb;if(_0x3eacb9['query'][_0x97d6('0x3a')]){_0x56f08b[_0x97d6('0x3b')]=[{'all':!![]}];}return db[_0x97d6('0x25')][_0x97d6('0x3c')](_0x56f08b);})[_0x97d6('0x1e')](function(_0x4f0205){_0x57320f['rows']=_0x4f0205;return _0x57320f;})[_0x97d6('0x1e')](respondWithFilteredResult(_0x35a4ec,_0x56f08b))['catch'](handleError(_0x35a4ec,null));};exports[_0x97d6('0x3d')]=function(_0x18bc8a,_0x407d5d){var _0x42710f={'raw':!![],'where':{'id':_0x18bc8a[_0x97d6('0x3e')]['id']}},_0x599ceb={};_0x599ceb[_0x97d6('0x29')]=_[_0x97d6('0x2c')](db[_0x97d6('0x25')][_0x97d6('0x26')]);_0x599ceb[_0x97d6('0x2b')]=_[_0x97d6('0x2c')](_0x18bc8a[_0x97d6('0x2b')]);_0x599ceb[_0x97d6('0x2d')]=_[_0x97d6('0x2e')](_0x599ceb[_0x97d6('0x29')],_0x599ceb[_0x97d6('0x2b')]);_0x42710f[_0x97d6('0x30')]=_['intersection'](_0x599ceb[_0x97d6('0x29')],qs[_0x97d6('0x2f')](_0x18bc8a[_0x97d6('0x2b')][_0x97d6('0x2f')]));_0x42710f[_0x97d6('0x30')]=_0x42710f[_0x97d6('0x30')]['length']?_0x42710f['attributes']:_0x599ceb[_0x97d6('0x29')];if(_0x18bc8a[_0x97d6('0x2b')][_0x97d6('0x3a')]){_0x42710f[_0x97d6('0x3b')]=[{'all':!![]}];}_0x42710f=_[_0x97d6('0x36')]({},_0x42710f,_0x18bc8a['options']);return db[_0x97d6('0x25')][_0x97d6('0x3f')](_0x42710f)['then'](handleEntityNotFound(_0x407d5d,null))[_0x97d6('0x1e')](respondWithResult(_0x407d5d,null))['catch'](handleError(_0x407d5d,null));};exports['create']=function(_0xa51982,_0x51dbc0){return db[_0x97d6('0x25')][_0x97d6('0x40')](_0xa51982['body'],{})['then'](respondWithResult(_0x51dbc0,0xc9))['catch'](handleError(_0x51dbc0,null));};exports['update']=function(_0x20d6d2,_0x191b89){if(_0x20d6d2[_0x97d6('0x41')]['id']){delete _0x20d6d2['body']['id'];}return db['SquareRecording'][_0x97d6('0x3f')]({'where':{'id':_0x20d6d2[_0x97d6('0x3e')]['id']}})[_0x97d6('0x1e')](handleEntityNotFound(_0x191b89,null))[_0x97d6('0x1e')](saveUpdates(_0x20d6d2[_0x97d6('0x41')],null))[_0x97d6('0x1e')](respondWithResult(_0x191b89,null))[_0x97d6('0x42')](handleError(_0x191b89,null));};exports['destroy']=function(_0x147db9,_0x37b883){return db[_0x97d6('0x25')]['find']({'where':{'id':_0x147db9[_0x97d6('0x3e')]['id']}})['then'](handleEntityNotFound(_0x37b883,null))[_0x97d6('0x1e')](removeEntity(_0x37b883,null))[_0x97d6('0x42')](handleError(_0x37b883,null));};exports['download']=function(_0x779807,_0x474ad4,_0x3ca500){var _0x3f9191=require('../../components/encryptor');var _0x12d63d=![];var _0x27514d={};if(_0x779807['query'][_0x97d6('0x28')]&&_0x779807[_0x97d6('0x2b')][_0x97d6('0x28')]===_0x97d6('0x43')){_0x27514d['uniqueid']=_0x779807[_0x97d6('0x3e')]['id'];}else{_0x27514d['id']=_0x779807['params']['id'];}return db[_0x97d6('0x25')][_0x97d6('0x3f')]({'where':_0x27514d,'attributes':['id',_0x97d6('0x44'),'filename'],'raw':!![]})[_0x97d6('0x1e')](handleEntityNotFound(_0x474ad4,null))['then'](function(_0x2c2fc1){if(_0x2c2fc1){var _0x1d793d=_0x2c2fc1['savePath'];var _0x2c35fa=util[_0x97d6('0x45')](_0x97d6('0x46'),_0x1d793d);if(fs[_0x97d6('0x47')](_0x2c35fa)){_0x12d63d=!![];return _0x3f9191[_0x97d6('0x48')](_0x2c35fa,_0x1d793d,config[_0x97d6('0x49')][_0x97d6('0x4a')])[_0x97d6('0x1e')](function(){return _0x2c2fc1;});}return _0x2c2fc1;}})[_0x97d6('0x1e')](function(_0x390616){if(_0x390616){var _0x945987=_0x390616[_0x97d6('0x44')];if(!fs['existsSync'](_0x945987)){throw new db[(_0x97d6('0x4b'))]['ValidationError']('SquareRecording\x20not\x20found');}if(_0x390616[_0x97d6('0x4c')]){return _0x474ad4[_0x97d6('0x4d')](_0x945987,_0x390616['filename']+path[_0x97d6('0x4e')](_0x945987),function(){if(_0x12d63d){fs[_0x97d6('0x4f')](_0x945987);}});}else{return _0x474ad4[_0x97d6('0x4d')](_0x945987,function(_0x293397){if(_0x12d63d){fs[_0x97d6('0x4f')](_0x945987);}});}}})[_0x97d6('0x42')](function(_0x4f1bfc){if(_0x4f1bfc['message']===_0x97d6('0x50')){_0x474ad4[_0x97d6('0x14')](0x194)['send'](_0x97d6('0x51'));}else{return handleError(_0x474ad4,null);}});}; \ No newline at end of file +var _0x26ad=['Not\x20found','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','SquareRecording','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','download','../../components/encryptor','uniqueid','savePath','decryptFile','recording','existsSync','Sequelize','ValidationError','SquareRecording\x20not\x20found','filename','extname','unlink','message'];(function(_0x233322,_0x43b853){var _0x48d794=function(_0x12714e){while(--_0x12714e){_0x233322['push'](_0x233322['shift']());}};_0x48d794(++_0x43b853);}(_0x26ad,0xb1));var _0xd26a=function(_0x1ad12c,_0x5bd618){_0x1ad12c=_0x1ad12c-0x0;var _0xb60e0f=_0x26ad[_0x1ad12c];return _0xb60e0f;};'use strict';var pdf=require(_0xd26a('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xd26a('0x1'));var zipdir=require(_0xd26a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd26a('0x3'));var moment=require(_0xd26a('0x4'));var BPromise=require(_0xd26a('0x5'));var Mustache=require('mustache');var util=require(_0xd26a('0x6'));var path=require('path');var sox=require(_0xd26a('0x7'));var csv=require(_0xd26a('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xd26a('0x9'));var squel=require('squel');var crypto=require(_0xd26a('0xa'));var jsforce=require(_0xd26a('0xb'));var deskjs=require(_0xd26a('0xc'));var toCsv=require(_0xd26a('0x8'));var querystring=require(_0xd26a('0xd'));var Papa=require(_0xd26a('0xe'));var Redis=require('ioredis');var authService=require(_0xd26a('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xd26a('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd26a('0x11'))(_0xd26a('0x12'));var utils=require('../../config/utils');var config=require(_0xd26a('0x13'));var db=require(_0xd26a('0x14'))['db'];function respondWithStatusCode(_0x1f64c3,_0x1e3d3d){_0x1e3d3d=_0x1e3d3d||0xcc;return function(_0x5eba8d){if(_0x5eba8d){return _0x1f64c3[_0xd26a('0x15')](_0x1e3d3d);}return _0x1f64c3[_0xd26a('0x16')](_0x1e3d3d)[_0xd26a('0x17')]();};}function respondWithResult(_0x4eea3a,_0x4b8311){_0x4b8311=_0x4b8311||0xc8;return function(_0x134b5e){if(_0x134b5e){return _0x4eea3a['status'](_0x4b8311)[_0xd26a('0x18')](_0x134b5e);}};}function respondWithFilteredResult(_0x20b1da,_0x5d9afd){return function(_0x26dc58){if(_0x26dc58){var _0x281c3e=_0x26dc58[_0xd26a('0x19')],_0x47c539=_0x5d9afd[_0xd26a('0x1a')],_0x33414e=_0x5d9afd['offset']+_0x5d9afd[_0xd26a('0x1b')],_0x4c714e;if(_0x33414e>=_0x281c3e){_0x33414e=_0x281c3e;_0x4c714e=0xc8;}else{_0x4c714e=0xce;}_0x20b1da['status'](_0x4c714e);return _0x20b1da[_0xd26a('0x1c')](_0xd26a('0x1d'),_0x47c539+'-'+_0x33414e+'/'+_0x281c3e)[_0xd26a('0x18')](_0x26dc58);}return null;};}function patchUpdates(_0x432e78){return function(_0xda7338){try{jsonpatch[_0xd26a('0x1e')](_0xda7338,_0x432e78,!![]);}catch(_0x45363d){return BPromise[_0xd26a('0x1f')](_0x45363d);}return _0xda7338['save']();};}function saveUpdates(_0x452e74,_0xb3562e){return function(_0x102d32){if(_0x102d32){return _0x102d32[_0xd26a('0x20')](_0x452e74)[_0xd26a('0x21')](function(_0x10d995){return _0x10d995;});}return null;};}function removeEntity(_0x2bd8da,_0x255faa){return function(_0x36ec34){if(_0x36ec34){return _0x36ec34[_0xd26a('0x22')]()[_0xd26a('0x21')](function(){_0x2bd8da[_0xd26a('0x16')](0xcc)[_0xd26a('0x17')]();});}};}function handleEntityNotFound(_0x21e3a7,_0x2b937f){return function(_0x2e910f){if(!_0x2e910f){_0x21e3a7[_0xd26a('0x15')](0x194);}return _0x2e910f;};}function handleError(_0x378e18,_0x3a11eb){_0x3a11eb=_0x3a11eb||0x1f4;return function(_0x2444e2){logger[_0xd26a('0x23')](_0x2444e2[_0xd26a('0x24')]);if(_0x2444e2[_0xd26a('0x25')]){delete _0x2444e2[_0xd26a('0x25')];}_0x378e18['status'](_0x3a11eb)[_0xd26a('0x26')](_0x2444e2);};}exports[_0xd26a('0x27')]=function(_0x341738,_0x5a7395){var _0x397127={},_0x54dc0b={},_0x12e83e={'count':0x0,'rows':[]};var _0x5569aa=_['map'](db[_0xd26a('0x28')][_0xd26a('0x29')],function(_0x57064d){return{'name':_0x57064d[_0xd26a('0x2a')],'type':_0x57064d[_0xd26a('0x2b')][_0xd26a('0x2c')]};});_0x54dc0b[_0xd26a('0x2d')]=_[_0xd26a('0x2e')](_0x5569aa,_0xd26a('0x25'));_0x54dc0b[_0xd26a('0x2f')]=_[_0xd26a('0x30')](_0x341738[_0xd26a('0x2f')]);_0x54dc0b[_0xd26a('0x31')]=_['intersection'](_0x54dc0b['model'],_0x54dc0b[_0xd26a('0x2f')]);_0x397127[_0xd26a('0x32')]=_[_0xd26a('0x33')](_0x54dc0b[_0xd26a('0x2d')],qs[_0xd26a('0x34')](_0x341738['query'][_0xd26a('0x34')]));_0x397127[_0xd26a('0x32')]=_0x397127[_0xd26a('0x32')]['length']?_0x397127[_0xd26a('0x32')]:_0x54dc0b[_0xd26a('0x2d')];if(!_0x341738[_0xd26a('0x2f')][_0xd26a('0x35')]('nolimit')){_0x397127[_0xd26a('0x1b')]=qs['limit'](_0x341738[_0xd26a('0x2f')][_0xd26a('0x1b')]);_0x397127[_0xd26a('0x1a')]=qs['offset'](_0x341738[_0xd26a('0x2f')]['offset']);}_0x397127[_0xd26a('0x36')]=qs[_0xd26a('0x37')](_0x341738[_0xd26a('0x2f')][_0xd26a('0x37')]);_0x397127['where']=qs[_0xd26a('0x31')](_[_0xd26a('0x38')](_0x341738[_0xd26a('0x2f')],_0x54dc0b[_0xd26a('0x31')]));if(_0x341738[_0xd26a('0x2f')][_0xd26a('0x39')]){_0x397127[_0xd26a('0x3a')]=_['merge'](_0x397127[_0xd26a('0x3a')],{'$or':_[_0xd26a('0x2e')](_0x5569aa,function(_0x3c8cf2){if(_0x3c8cf2[_0xd26a('0x2b')][_0xd26a('0x2c')]!==_0xd26a('0x3b')){var _0x16df6d={};_0x16df6d[_0x3c8cf2[_0xd26a('0x3c')]]={'$like':'%'+_0x341738[_0xd26a('0x2f')][_0xd26a('0x39')]+'%'};return _0x16df6d;}})});}_0x397127=_['merge']({},_0x397127,_0x341738[_0xd26a('0x3d')]);var _0x3c37ef={'where':_0x397127[_0xd26a('0x3a')]};return db[_0xd26a('0x28')]['count'](_0x3c37ef)['then'](function(_0x340fed){_0x12e83e['count']=_0x340fed;if(_0x341738[_0xd26a('0x2f')][_0xd26a('0x3e')]){_0x397127[_0xd26a('0x3f')]=[{'all':!![]}];}return db[_0xd26a('0x28')][_0xd26a('0x40')](_0x397127);})['then'](function(_0x451528){_0x12e83e[_0xd26a('0x41')]=_0x451528;return _0x12e83e;})['then'](respondWithFilteredResult(_0x5a7395,_0x397127))[_0xd26a('0x42')](handleError(_0x5a7395,null));};exports[_0xd26a('0x43')]=function(_0x50a512,_0x18960a){var _0x44b893={'raw':!![],'where':{'id':_0x50a512[_0xd26a('0x44')]['id']}},_0x12e4cf={};_0x12e4cf['model']=_[_0xd26a('0x30')](db[_0xd26a('0x28')]['rawAttributes']);_0x12e4cf[_0xd26a('0x2f')]=_[_0xd26a('0x30')](_0x50a512[_0xd26a('0x2f')]);_0x12e4cf[_0xd26a('0x31')]=_[_0xd26a('0x33')](_0x12e4cf['model'],_0x12e4cf['query']);_0x44b893[_0xd26a('0x32')]=_[_0xd26a('0x33')](_0x12e4cf['model'],qs[_0xd26a('0x34')](_0x50a512[_0xd26a('0x2f')][_0xd26a('0x34')]));_0x44b893[_0xd26a('0x32')]=_0x44b893[_0xd26a('0x32')]['length']?_0x44b893[_0xd26a('0x32')]:_0x12e4cf[_0xd26a('0x2d')];if(_0x50a512[_0xd26a('0x2f')]['includeAll']){_0x44b893[_0xd26a('0x3f')]=[{'all':!![]}];}_0x44b893=_[_0xd26a('0x45')]({},_0x44b893,_0x50a512[_0xd26a('0x3d')]);return db['SquareRecording'][_0xd26a('0x46')](_0x44b893)[_0xd26a('0x21')](handleEntityNotFound(_0x18960a,null))[_0xd26a('0x21')](respondWithResult(_0x18960a,null))[_0xd26a('0x42')](handleError(_0x18960a,null));};exports[_0xd26a('0x47')]=function(_0xd67c5f,_0x117d9c){return db[_0xd26a('0x28')][_0xd26a('0x47')](_0xd67c5f['body'],{})[_0xd26a('0x21')](respondWithResult(_0x117d9c,0xc9))[_0xd26a('0x42')](handleError(_0x117d9c,null));};exports[_0xd26a('0x20')]=function(_0x113f00,_0x29d84f){if(_0x113f00[_0xd26a('0x48')]['id']){delete _0x113f00[_0xd26a('0x48')]['id'];}return db[_0xd26a('0x28')][_0xd26a('0x46')]({'where':{'id':_0x113f00[_0xd26a('0x44')]['id']}})[_0xd26a('0x21')](handleEntityNotFound(_0x29d84f,null))[_0xd26a('0x21')](saveUpdates(_0x113f00[_0xd26a('0x48')],null))['then'](respondWithResult(_0x29d84f,null))[_0xd26a('0x42')](handleError(_0x29d84f,null));};exports[_0xd26a('0x22')]=function(_0x14ff29,_0xdf069f){return db[_0xd26a('0x28')][_0xd26a('0x46')]({'where':{'id':_0x14ff29['params']['id']}})[_0xd26a('0x21')](handleEntityNotFound(_0xdf069f,null))[_0xd26a('0x21')](removeEntity(_0xdf069f,null))[_0xd26a('0x42')](handleError(_0xdf069f,null));};exports[_0xd26a('0x49')]=function(_0x5d39e9,_0x2d4bae,_0x23f22a){var _0x45f570=require(_0xd26a('0x4a'));var _0x135783=![];var _0x30268e={};if(_0x5d39e9['query'][_0xd26a('0x2b')]&&_0x5d39e9['query']['type']===_0xd26a('0x4b')){_0x30268e[_0xd26a('0x4b')]=_0x5d39e9[_0xd26a('0x44')]['id'];}else{_0x30268e['id']=_0x5d39e9['params']['id'];}return db['SquareRecording'][_0xd26a('0x46')]({'where':_0x30268e,'attributes':['id','savePath','filename'],'raw':!![]})[_0xd26a('0x21')](handleEntityNotFound(_0x2d4bae,null))[_0xd26a('0x21')](function(_0x340229){if(_0x340229){var _0x3f26b6=_0x340229[_0xd26a('0x4c')];var _0x28a578=util['format']('%s.cypher',_0x3f26b6);if(fs['existsSync'](_0x28a578)){_0x135783=!![];return _0x45f570[_0xd26a('0x4d')](_0x28a578,_0x3f26b6,config['secrets'][_0xd26a('0x4e')])[_0xd26a('0x21')](function(){return _0x340229;});}return _0x340229;}})[_0xd26a('0x21')](function(_0x3df935){if(_0x3df935){var _0x311f0b=_0x3df935[_0xd26a('0x4c')];if(!fs[_0xd26a('0x4f')](_0x311f0b)){throw new db[(_0xd26a('0x50'))][(_0xd26a('0x51'))](_0xd26a('0x52'));}if(_0x3df935[_0xd26a('0x53')]){return _0x2d4bae[_0xd26a('0x49')](_0x311f0b,_0x3df935[_0xd26a('0x53')]+path[_0xd26a('0x54')](_0x311f0b),function(){if(_0x135783){fs['unlink'](_0x311f0b);}});}else{return _0x2d4bae['download'](_0x311f0b,function(_0x4d740f){if(_0x135783){fs[_0xd26a('0x55')](_0x311f0b);}});}}})[_0xd26a('0x42')](function(_0x5bef13){if(_0x5bef13[_0xd26a('0x56')]===_0xd26a('0x52')){_0x2d4bae['status'](0x194)[_0xd26a('0x26')](_0xd26a('0x57'));}else{return handleError(_0x2d4bae,null);}});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index e0ee25c..9b01448 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 _0x9a2d=['define','SquareRecording','square_recordings','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareRecording.attributes','exports'];(function(_0x4753c7,_0x29e0bd){var _0x79ac54=function(_0x54b3bd){while(--_0x54b3bd){_0x4753c7['push'](_0x4753c7['shift']());}};_0x79ac54(++_0x29e0bd);}(_0x9a2d,0x123));var _0xd9a2=function(_0x4944f1,_0x11f467){_0x4944f1=_0x4944f1-0x0;var _0x46eac2=_0x9a2d[_0x4944f1];return _0x46eac2;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd9a2('0x0'))('api');var moment=require(_0xd9a2('0x1'));var BPromise=require(_0xd9a2('0x2'));var rp=require(_0xd9a2('0x3'));var fs=require('fs');var path=require(_0xd9a2('0x4'));var rimraf=require(_0xd9a2('0x5'));var config=require(_0xd9a2('0x6'));var attributes=require(_0xd9a2('0x7'));module[_0xd9a2('0x8')]=function(_0x2ff138,_0x11bc70){return _0x2ff138[_0xd9a2('0x9')](_0xd9a2('0xa'),attributes,{'tableName':_0xd9a2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9a2d=['define','SquareRecording','square_recordings','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareRecording.attributes','exports'];(function(_0x239ede,_0x246382){var _0x5bd52a=function(_0x2f5f69){while(--_0x2f5f69){_0x239ede['push'](_0x239ede['shift']());}};_0x5bd52a(++_0x246382);}(_0x9a2d,0x123));var _0xd9a2=function(_0x583b6d,_0x10c830){_0x583b6d=_0x583b6d-0x0;var _0x10fdc8=_0x9a2d[_0x583b6d];return _0x10fdc8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd9a2('0x0'))('api');var moment=require(_0xd9a2('0x1'));var BPromise=require(_0xd9a2('0x2'));var rp=require(_0xd9a2('0x3'));var fs=require('fs');var path=require(_0xd9a2('0x4'));var rimraf=require(_0xd9a2('0x5'));var config=require(_0xd9a2('0x6'));var attributes=require(_0xd9a2('0x7'));module[_0xd9a2('0x8')]=function(_0x2ff138,_0x11bc70){return _0x2ff138[_0xd9a2('0x9')](_0xd9a2('0xa'),attributes,{'tableName':_0xd9a2('0xb'),'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 fc6c736..4973ebf 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 _0x536e=['error','code','message','result','catch','SquareRecording','create','body','options','then','CreateSquareRecording','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x28019b,_0x50ef13){var _0x2c13a4=function(_0x385fc6){while(--_0x385fc6){_0x28019b['push'](_0x28019b['shift']());}};_0x2c13a4(++_0x50ef13);}(_0x536e,0x191));var _0xe536=function(_0x372515,_0xdd11f){_0x372515=_0x372515-0x0;var _0xa3bf4e=_0x536e[_0x372515];return _0xa3bf4e;};'use strict';var _=require(_0xe536('0x0'));var util=require(_0xe536('0x1'));var moment=require(_0xe536('0x2'));var BPromise=require(_0xe536('0x3'));var rs=require(_0xe536('0x4'));var fs=require('fs');var Redis=require(_0xe536('0x5'));var db=require(_0xe536('0x6'))['db'];var utils=require(_0xe536('0x7'));var logger=require(_0xe536('0x8'))('rpc');var config=require(_0xe536('0x9'));var jayson=require(_0xe536('0xa'));var client=jayson[_0xe536('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x57b831,_0x545a24,_0x441809){return new BPromise(function(_0x3f4348,_0x31ff86){return client[_0xe536('0xc')](_0x57b831,_0x441809)['then'](function(_0xa771c7){logger[_0xe536('0xd')](_0xe536('0xe'),_0x545a24,_0xe536('0xf'));logger[_0xe536('0x10')](_0xe536('0x11'),_0x545a24,'request\x20sent',JSON[_0xe536('0x12')](_0xa771c7));if(_0xa771c7['error']){if(_0xa771c7[_0xe536('0x13')][_0xe536('0x14')]===0x1f4){logger[_0xe536('0x13')](_0xe536('0xe'),_0x545a24,_0xa771c7[_0xe536('0x13')][_0xe536('0x15')]);return _0x31ff86(_0xa771c7[_0xe536('0x13')][_0xe536('0x15')]);}logger[_0xe536('0x13')]('SquareRecording,\x20%s,\x20%s',_0x545a24,_0xa771c7[_0xe536('0x13')][_0xe536('0x15')]);return _0x3f4348(_0xa771c7[_0xe536('0x13')][_0xe536('0x15')]);}else{logger[_0xe536('0xd')](_0xe536('0xe'),_0x545a24,'request\x20sent');_0x3f4348(_0xa771c7[_0xe536('0x16')][_0xe536('0x15')]);}})[_0xe536('0x17')](function(_0x4264dc){logger['error'](_0xe536('0xe'),_0x545a24,_0x4264dc);_0x31ff86(_0x4264dc);});});}exports['CreateSquareRecording']=function(_0x37146a){var _0x37d9c1=this;return new Promise(function(_0x370b8d,_0x227d79){return db[_0xe536('0x18')][_0xe536('0x19')](_0x37146a[_0xe536('0x1a')],{'raw':_0x37146a['options']?_0x37146a[_0xe536('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0xe536('0x1c')](function(_0x56779c){logger[_0xe536('0xd')](_0xe536('0x1d'),_0x37146a);logger['debug']('CreateSquareRecording',_0x37146a,JSON[_0xe536('0x12')](_0x56779c));_0x370b8d(_0x56779c);})['catch'](function(_0x1fd216){logger[_0xe536('0x13')]('CreateSquareRecording',_0x1fd216['message'],_0x37146a);_0x227d79(_0x37d9c1[_0xe536('0x13')](0x1f4,_0x1fd216[_0xe536('0x15')]));});});}; \ No newline at end of file +var _0xdd7a=['catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','code','error','message','CreateSquareRecording','create','body','options','raw'];(function(_0x501a6d,_0x4f6bef){var _0x539dde=function(_0x184190){while(--_0x184190){_0x501a6d['push'](_0x501a6d['shift']());}};_0x539dde(++_0x4f6bef);}(_0xdd7a,0x15d));var _0xadd7=function(_0x8b6dc1,_0x15124a){_0x8b6dc1=_0x8b6dc1-0x0;var _0x2396c5=_0xdd7a[_0x8b6dc1];return _0x2396c5;};'use strict';var _=require('lodash');var util=require(_0xadd7('0x0'));var moment=require(_0xadd7('0x1'));var BPromise=require(_0xadd7('0x2'));var rs=require(_0xadd7('0x3'));var fs=require('fs');var Redis=require(_0xadd7('0x4'));var db=require(_0xadd7('0x5'))['db'];var utils=require(_0xadd7('0x6'));var logger=require(_0xadd7('0x7'))(_0xadd7('0x8'));var config=require(_0xadd7('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xadd7('0xa')][_0xadd7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f3fc8,_0x136d99,_0xb6077d){return new BPromise(function(_0x2ae995,_0x20b194){return client[_0xadd7('0xc')](_0x4f3fc8,_0xb6077d)[_0xadd7('0xd')](function(_0x4e7528){logger[_0xadd7('0xe')](_0xadd7('0xf'),_0x136d99,_0xadd7('0x10'));logger[_0xadd7('0x11')](_0xadd7('0x12'),_0x136d99,_0xadd7('0x10'),JSON[_0xadd7('0x13')](_0x4e7528));if(_0x4e7528['error']){if(_0x4e7528['error'][_0xadd7('0x14')]===0x1f4){logger[_0xadd7('0x15')]('SquareRecording,\x20%s,\x20%s',_0x136d99,_0x4e7528[_0xadd7('0x15')][_0xadd7('0x16')]);return _0x20b194(_0x4e7528[_0xadd7('0x15')][_0xadd7('0x16')]);}logger[_0xadd7('0x15')](_0xadd7('0xf'),_0x136d99,_0x4e7528[_0xadd7('0x15')][_0xadd7('0x16')]);return _0x2ae995(_0x4e7528['error'][_0xadd7('0x16')]);}else{logger['info'](_0xadd7('0xf'),_0x136d99,_0xadd7('0x10'));_0x2ae995(_0x4e7528['result'][_0xadd7('0x16')]);}})['catch'](function(_0x14b9cc){logger['error'](_0xadd7('0xf'),_0x136d99,_0x14b9cc);_0x20b194(_0x14b9cc);});});}exports[_0xadd7('0x17')]=function(_0x184b8f){var _0x1d935c=this;return new Promise(function(_0x54b0b2,_0x496378){return db['SquareRecording'][_0xadd7('0x18')](_0x184b8f[_0xadd7('0x19')],{'raw':_0x184b8f[_0xadd7('0x1a')]?_0x184b8f[_0xadd7('0x1a')][_0xadd7('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x4f039e){logger[_0xadd7('0xe')](_0xadd7('0x17'),_0x184b8f);logger['debug'](_0xadd7('0x17'),_0x184b8f,JSON[_0xadd7('0x13')](_0x4f039e));_0x54b0b2(_0x4f039e);})[_0xadd7('0x1c')](function(_0x4db481){logger[_0xadd7('0x15')](_0xadd7('0x17'),_0x4db481[_0xadd7('0x16')],_0x184b8f);_0x496378(_0x1d935c['error'](0x1f4,_0x4db481[_0xadd7('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 3f8467f..2f2fed3 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 _0x32cf=['update','delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','isAuthenticated','/describe','describe','get','/:id','show','post','create','put'];(function(_0x47cd84,_0x3056b9){var _0x800299=function(_0x7a34ba){while(--_0x7a34ba){_0x47cd84['push'](_0x47cd84['shift']());}};_0x800299(++_0x3056b9);}(_0x32cf,0x1cb));var _0xf32c=function(_0x34843e,_0x4c4224){_0x34843e=_0x34843e-0x0;var _0x598f7f=_0x32cf[_0x34843e];return _0x598f7f;};'use strict';var multer=require(_0xf32c('0x0'));var util=require(_0xf32c('0x1'));var path=require(_0xf32c('0x2'));var timeout=require(_0xf32c('0x3'));var express=require('express');var router=express[_0xf32c('0x4')]();var auth=require(_0xf32c('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf32c('0x6'));var controller=require('./squareReport.controller');router['get']('/',auth[_0xf32c('0x7')](),controller['index']);router['get'](_0xf32c('0x8'),auth['isAuthenticated'](),controller[_0xf32c('0x9')]);router[_0xf32c('0xa')](_0xf32c('0xb'),auth[_0xf32c('0x7')](),controller[_0xf32c('0xc')]);router[_0xf32c('0xd')]('/',auth[_0xf32c('0x7')](),controller[_0xf32c('0xe')]);router[_0xf32c('0xf')](_0xf32c('0xb'),auth[_0xf32c('0x7')](),controller[_0xf32c('0x10')]);router[_0xf32c('0x11')](_0xf32c('0xb'),auth[_0xf32c('0x7')](),controller[_0xf32c('0x12')]);module['exports']=router; \ No newline at end of file +var _0x5bda=['update','delete','destroy','util','connect-timeout','Router','../../components/interaction/service','../../config/environment','isAuthenticated','get','post','create','put','/:id'];(function(_0x289a2d,_0x5ed19f){var _0x1a4f09=function(_0x4225f9){while(--_0x4225f9){_0x289a2d['push'](_0x289a2d['shift']());}};_0x1a4f09(++_0x5ed19f);}(_0x5bda,0x153));var _0xa5bd=function(_0x2bb0d9,_0x1fa51c){_0x2bb0d9=_0x2bb0d9-0x0;var _0x43fe14=_0x5bda[_0x2bb0d9];return _0x43fe14;};'use strict';var multer=require('multer');var util=require(_0xa5bd('0x0'));var path=require('path');var timeout=require(_0xa5bd('0x1'));var express=require('express');var router=express[_0xa5bd('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0xa5bd('0x3'));var config=require(_0xa5bd('0x4'));var controller=require('./squareReport.controller');router['get']('/',auth[_0xa5bd('0x5')](),controller['index']);router[_0xa5bd('0x6')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xa5bd('0x6')]('/:id',auth[_0xa5bd('0x5')](),controller['show']);router[_0xa5bd('0x7')]('/',auth[_0xa5bd('0x5')](),controller[_0xa5bd('0x8')]);router[_0xa5bd('0x9')](_0xa5bd('0xa'),auth['isAuthenticated'](),controller[_0xa5bd('0xb')]);router[_0xa5bd('0xc')](_0xa5bd('0xa'),auth[_0xa5bd('0x5')](),controller[_0xa5bd('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 87c5e1f..3b78229 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 _0x87d2=['exports','STRING','DATE','sequelize'];(function(_0x2c0a07,_0x56553b){var _0x515ba5=function(_0x384f1e){while(--_0x384f1e){_0x2c0a07['push'](_0x2c0a07['shift']());}};_0x515ba5(++_0x56553b);}(_0x87d2,0x1ef));var _0x287d=function(_0x4950a1,_0x13a1ad){_0x4950a1=_0x4950a1-0x0;var _0x1b741f=_0x87d2[_0x4950a1];return _0x1b741f;};'use strict';var Sequelize=require(_0x287d('0x0'));module[_0x287d('0x1')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0x287d('0x2')]},'request':{'type':Sequelize[_0x287d('0x2')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x287d('0x2')]},'uniqueid':{'type':Sequelize[_0x287d('0x2')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x287d('0x2')]},'calleridname':{'type':Sequelize[_0x287d('0x2')]},'callingpres':{'type':Sequelize[_0x287d('0x2')]},'callingani2':{'type':Sequelize[_0x287d('0x2')]},'callington':{'type':Sequelize[_0x287d('0x2')]},'callingtns':{'type':Sequelize[_0x287d('0x2')]},'dnid':{'type':Sequelize[_0x287d('0x2')]},'rdnis':{'type':Sequelize[_0x287d('0x2')]},'context':{'type':Sequelize[_0x287d('0x2')]},'extension':{'type':Sequelize[_0x287d('0x2')]},'priority':{'type':Sequelize[_0x287d('0x2')]},'enhanced':{'type':Sequelize[_0x287d('0x2')]},'accountcode':{'type':Sequelize[_0x287d('0x2')]},'threadid':{'type':Sequelize[_0x287d('0x2')]},'project_name':{'type':Sequelize[_0x287d('0x2')]},'joinAt':{'type':Sequelize[_0x287d('0x3')]},'leaveAt':{'type':Sequelize[_0x287d('0x3')]},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x3a9c=['DATE','sequelize','STRING'];(function(_0x286726,_0x20a337){var _0xcd4fe9=function(_0x4d7da6){while(--_0x4d7da6){_0x286726['push'](_0x286726['shift']());}};_0xcd4fe9(++_0x20a337);}(_0x3a9c,0x16f));var _0xc3a9=function(_0x2515fc,_0x5d52be){_0x2515fc=_0x2515fc-0x0;var _0x1cee09=_0x3a9c[_0x2515fc];return _0x1cee09;};'use strict';var Sequelize=require(_0xc3a9('0x0'));module['exports']={'network':{'type':Sequelize[_0xc3a9('0x1')]},'network_script':{'type':Sequelize[_0xc3a9('0x1')]},'request':{'type':Sequelize[_0xc3a9('0x1')]},'channel':{'type':Sequelize[_0xc3a9('0x1')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xc3a9('0x1')]},'uniqueid':{'type':Sequelize[_0xc3a9('0x1')]},'version':{'type':Sequelize[_0xc3a9('0x1')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xc3a9('0x1')]},'callingpres':{'type':Sequelize[_0xc3a9('0x1')]},'callingani2':{'type':Sequelize[_0xc3a9('0x1')]},'callington':{'type':Sequelize[_0xc3a9('0x1')]},'callingtns':{'type':Sequelize[_0xc3a9('0x1')]},'dnid':{'type':Sequelize[_0xc3a9('0x1')]},'rdnis':{'type':Sequelize[_0xc3a9('0x1')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0xc3a9('0x1')]},'priority':{'type':Sequelize[_0xc3a9('0x1')]},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xc3a9('0x1')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0xc3a9('0x1')]},'joinAt':{'type':Sequelize[_0xc3a9('0x2')]},'leaveAt':{'type':Sequelize[_0xc3a9('0x2')]},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index d590a88..bca6385 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 _0x7a2d=['findAll','rows','catch','show','params','create','body','update','find','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','apply','save','destroy','then','error','stack','index','map','SquareReport','rawAttributes','fieldName','type','key','model','name','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','field','merge','options','includeAll','include'];(function(_0x4fa5e6,_0x236461){var _0x325978=function(_0x1afdb9){while(--_0x1afdb9){_0x4fa5e6['push'](_0x4fa5e6['shift']());}};_0x325978(++_0x236461);}(_0x7a2d,0x142));var _0xd7a2=function(_0x1e126e,_0x853c27){_0x1e126e=_0x1e126e-0x0;var _0x371976=_0x7a2d[_0x1e126e];return _0x371976;};'use strict';var pdf=require(_0xd7a2('0x0'));var emlformat=require(_0xd7a2('0x1'));var rimraf=require(_0xd7a2('0x2'));var zipdir=require(_0xd7a2('0x3'));var jsonpatch=require(_0xd7a2('0x4'));var rp=require(_0xd7a2('0x5'));var moment=require(_0xd7a2('0x6'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd7a2('0x7'));var path=require(_0xd7a2('0x8'));var sox=require(_0xd7a2('0x9'));var csv=require(_0xd7a2('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xd7a2('0xb'));var squel=require(_0xd7a2('0xc'));var crypto=require(_0xd7a2('0xd'));var jsforce=require(_0xd7a2('0xe'));var deskjs=require(_0xd7a2('0xf'));var toCsv=require(_0xd7a2('0xa'));var querystring=require(_0xd7a2('0x10'));var Papa=require(_0xd7a2('0x11'));var Redis=require(_0xd7a2('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xd7a2('0x13'));var as=require(_0xd7a2('0x14'));var hardwareService=require(_0xd7a2('0x15'));var logger=require(_0xd7a2('0x16'))(_0xd7a2('0x17'));var utils=require(_0xd7a2('0x18'));var config=require(_0xd7a2('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x56d706,_0x72ff99){_0x72ff99=_0x72ff99||0xcc;return function(_0x4d8a97){if(_0x4d8a97){return _0x56d706[_0xd7a2('0x1a')](_0x72ff99);}return _0x56d706[_0xd7a2('0x1b')](_0x72ff99)[_0xd7a2('0x1c')]();};}function respondWithResult(_0x33131e,_0x3724c5){_0x3724c5=_0x3724c5||0xc8;return function(_0x37f995){if(_0x37f995){return _0x33131e[_0xd7a2('0x1b')](_0x3724c5)[_0xd7a2('0x1d')](_0x37f995);}};}function respondWithFilteredResult(_0x396c07,_0x16e2d6){return function(_0x292f64){if(_0x292f64){var _0x47b226=_0x292f64[_0xd7a2('0x1e')],_0x2dc1b7=_0x16e2d6[_0xd7a2('0x1f')],_0x4c66ef=_0x16e2d6[_0xd7a2('0x1f')]+_0x16e2d6[_0xd7a2('0x20')],_0x5321f5;if(_0x4c66ef>=_0x47b226){_0x4c66ef=_0x47b226;_0x5321f5=0xc8;}else{_0x5321f5=0xce;}_0x396c07[_0xd7a2('0x1b')](_0x5321f5);return _0x396c07[_0xd7a2('0x21')]('Content-Range',_0x2dc1b7+'-'+_0x4c66ef+'/'+_0x47b226)['json'](_0x292f64);}return null;};}function patchUpdates(_0x436fff){return function(_0x1fe867){try{jsonpatch[_0xd7a2('0x22')](_0x1fe867,_0x436fff,!![]);}catch(_0x518429){return BPromise['reject'](_0x518429);}return _0x1fe867[_0xd7a2('0x23')]();};}function saveUpdates(_0x5d455b,_0x4f885a){return function(_0x217c19){if(_0x217c19){return _0x217c19['update'](_0x5d455b)['then'](function(_0x2681f0){return _0x2681f0;});}return null;};}function removeEntity(_0x4b4dd9,_0x5bd05f){return function(_0x4fc69c){if(_0x4fc69c){return _0x4fc69c[_0xd7a2('0x24')]()[_0xd7a2('0x25')](function(){_0x4b4dd9[_0xd7a2('0x1b')](0xcc)[_0xd7a2('0x1c')]();});}};}function handleEntityNotFound(_0x2b17ca,_0x3a2be7){return function(_0x2bfde1){if(!_0x2bfde1){_0x2b17ca[_0xd7a2('0x1a')](0x194);}return _0x2bfde1;};}function handleError(_0x16d04a,_0xd33d0c){_0xd33d0c=_0xd33d0c||0x1f4;return function(_0x2575e2){logger[_0xd7a2('0x26')](_0x2575e2[_0xd7a2('0x27')]);if(_0x2575e2['name']){delete _0x2575e2['name'];}_0x16d04a[_0xd7a2('0x1b')](_0xd33d0c)['send'](_0x2575e2);};}exports[_0xd7a2('0x28')]=function(_0x4e488a,_0x1b2caa){var _0x3d18ce={},_0x3964fa={},_0x243df9={'count':0x0,'rows':[]};var _0x354e62=_[_0xd7a2('0x29')](db[_0xd7a2('0x2a')][_0xd7a2('0x2b')],function(_0x43b81c){return{'name':_0x43b81c[_0xd7a2('0x2c')],'type':_0x43b81c[_0xd7a2('0x2d')][_0xd7a2('0x2e')]};});_0x3964fa[_0xd7a2('0x2f')]=_[_0xd7a2('0x29')](_0x354e62,_0xd7a2('0x30'));_0x3964fa['query']=_[_0xd7a2('0x31')](_0x4e488a[_0xd7a2('0x32')]);_0x3964fa['filters']=_[_0xd7a2('0x33')](_0x3964fa[_0xd7a2('0x2f')],_0x3964fa['query']);_0x3d18ce[_0xd7a2('0x34')]=_[_0xd7a2('0x33')](_0x3964fa[_0xd7a2('0x2f')],qs['fields'](_0x4e488a[_0xd7a2('0x32')][_0xd7a2('0x35')]));_0x3d18ce[_0xd7a2('0x34')]=_0x3d18ce['attributes'][_0xd7a2('0x36')]?_0x3d18ce['attributes']:_0x3964fa[_0xd7a2('0x2f')];if(!_0x4e488a[_0xd7a2('0x32')][_0xd7a2('0x37')](_0xd7a2('0x38'))){_0x3d18ce['limit']=qs[_0xd7a2('0x20')](_0x4e488a[_0xd7a2('0x32')][_0xd7a2('0x20')]);_0x3d18ce[_0xd7a2('0x1f')]=qs['offset'](_0x4e488a[_0xd7a2('0x32')][_0xd7a2('0x1f')]);}_0x3d18ce[_0xd7a2('0x39')]=qs[_0xd7a2('0x3a')](_0x4e488a[_0xd7a2('0x32')][_0xd7a2('0x3a')]);_0x3d18ce[_0xd7a2('0x3b')]=qs[_0xd7a2('0x3c')](_[_0xd7a2('0x3d')](_0x4e488a['query'],_0x3964fa[_0xd7a2('0x3c')]));if(_0x4e488a[_0xd7a2('0x32')][_0xd7a2('0x3e')]){_0x3d18ce[_0xd7a2('0x3b')]=_['merge'](_0x3d18ce['where'],{'$or':_[_0xd7a2('0x29')](_0x354e62,function(_0x5202a5){if(_0x5202a5[_0xd7a2('0x2d')][_0xd7a2('0x2e')]!=='VIRTUAL'){var _0x21a693={};_0x21a693[_0x5202a5[_0xd7a2('0x3f')]]={'$like':'%'+_0x4e488a[_0xd7a2('0x32')][_0xd7a2('0x3e')]+'%'};return _0x21a693;}})});}_0x3d18ce=_[_0xd7a2('0x40')]({},_0x3d18ce,_0x4e488a[_0xd7a2('0x41')]);var _0x15ecaa={'where':_0x3d18ce['where']};return db['SquareReport'][_0xd7a2('0x1e')](_0x15ecaa)[_0xd7a2('0x25')](function(_0x5f2b70){_0x243df9[_0xd7a2('0x1e')]=_0x5f2b70;if(_0x4e488a[_0xd7a2('0x32')][_0xd7a2('0x42')]){_0x3d18ce[_0xd7a2('0x43')]=[{'all':!![]}];}return db[_0xd7a2('0x2a')][_0xd7a2('0x44')](_0x3d18ce);})[_0xd7a2('0x25')](function(_0x1759d3){_0x243df9[_0xd7a2('0x45')]=_0x1759d3;return _0x243df9;})['then'](respondWithFilteredResult(_0x1b2caa,_0x3d18ce))[_0xd7a2('0x46')](handleError(_0x1b2caa,null));};exports[_0xd7a2('0x47')]=function(_0x591116,_0x509e00){var _0x5c86bd={'raw':!![],'where':{'id':_0x591116[_0xd7a2('0x48')]['id']}},_0xa77a40={};_0xa77a40[_0xd7a2('0x2f')]=_[_0xd7a2('0x31')](db[_0xd7a2('0x2a')]['rawAttributes']);_0xa77a40['query']=_[_0xd7a2('0x31')](_0x591116[_0xd7a2('0x32')]);_0xa77a40[_0xd7a2('0x3c')]=_[_0xd7a2('0x33')](_0xa77a40['model'],_0xa77a40[_0xd7a2('0x32')]);_0x5c86bd[_0xd7a2('0x34')]=_[_0xd7a2('0x33')](_0xa77a40[_0xd7a2('0x2f')],qs['fields'](_0x591116[_0xd7a2('0x32')][_0xd7a2('0x35')]));_0x5c86bd['attributes']=_0x5c86bd['attributes']['length']?_0x5c86bd[_0xd7a2('0x34')]:_0xa77a40[_0xd7a2('0x2f')];if(_0x591116[_0xd7a2('0x32')][_0xd7a2('0x42')]){_0x5c86bd[_0xd7a2('0x43')]=[{'all':!![]}];}_0x5c86bd=_[_0xd7a2('0x40')]({},_0x5c86bd,_0x591116['options']);return db[_0xd7a2('0x2a')]['find'](_0x5c86bd)[_0xd7a2('0x25')](handleEntityNotFound(_0x509e00,null))[_0xd7a2('0x25')](respondWithResult(_0x509e00,null))['catch'](handleError(_0x509e00,null));};exports[_0xd7a2('0x49')]=function(_0x24a9a5,_0x3e592b){return db['SquareReport'][_0xd7a2('0x49')](_0x24a9a5[_0xd7a2('0x4a')],{})[_0xd7a2('0x25')](respondWithResult(_0x3e592b,0xc9))[_0xd7a2('0x46')](handleError(_0x3e592b,null));};exports[_0xd7a2('0x4b')]=function(_0x43b156,_0x4504d4){if(_0x43b156[_0xd7a2('0x4a')]['id']){delete _0x43b156['body']['id'];}return db['SquareReport'][_0xd7a2('0x4c')]({'where':{'id':_0x43b156[_0xd7a2('0x48')]['id']}})['then'](handleEntityNotFound(_0x4504d4,null))[_0xd7a2('0x25')](saveUpdates(_0x43b156['body'],null))[_0xd7a2('0x25')](respondWithResult(_0x4504d4,null))[_0xd7a2('0x46')](handleError(_0x4504d4,null));};exports[_0xd7a2('0x24')]=function(_0x177ca2,_0x13d5fb){return db[_0xd7a2('0x2a')][_0xd7a2('0x4c')]({'where':{'id':_0x177ca2['params']['id']}})[_0xd7a2('0x25')](handleEntityNotFound(_0x13d5fb,null))[_0xd7a2('0x25')](removeEntity(_0x13d5fb,null))['catch'](handleError(_0x13d5fb,null));};exports[_0xd7a2('0x4d')]=function(_0x4c52cd,_0x1df5fd){return db['SquareReport'][_0xd7a2('0x4d')]()[_0xd7a2('0x25')](respondWithResult(_0x1df5fd,null))[_0xd7a2('0x46')](handleError(_0x1df5fd,null));}; \ No newline at end of file +var _0xe489=['rows','catch','show','find','create','body','params','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','set','Content-Range','json','apply','reject','update','then','destroy','end','error','name','send','index','map','SquareReport','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filters','merge','field','options','includeAll','include','findAll'];(function(_0x1057c7,_0x2021c1){var _0x3a8ee2=function(_0x178dfb){while(--_0x178dfb){_0x1057c7['push'](_0x1057c7['shift']());}};_0x3a8ee2(++_0x2021c1);}(_0xe489,0x9e));var _0x9e48=function(_0x30c4ec,_0x46a5c7){_0x30c4ec=_0x30c4ec-0x0;var _0x36f585=_0xe489[_0x30c4ec];return _0x36f585;};'use strict';var pdf=require(_0x9e48('0x0'));var emlformat=require(_0x9e48('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x9e48('0x2'));var jsonpatch=require(_0x9e48('0x3'));var rp=require(_0x9e48('0x4'));var moment=require(_0x9e48('0x5'));var BPromise=require(_0x9e48('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x9e48('0x7'));var sox=require('sox');var csv=require(_0x9e48('0x8'));var ejs=require(_0x9e48('0x9'));var fs=require('fs');var _=require(_0x9e48('0xa'));var squel=require(_0x9e48('0xb'));var crypto=require('crypto');var jsforce=require(_0x9e48('0xc'));var deskjs=require(_0x9e48('0xd'));var toCsv=require(_0x9e48('0x8'));var querystring=require(_0x9e48('0xe'));var Papa=require(_0x9e48('0xf'));var Redis=require('ioredis');var authService=require(_0x9e48('0x10'));var qs=require(_0x9e48('0x11'));var as=require(_0x9e48('0x12'));var hardwareService=require(_0x9e48('0x13'));var logger=require('../../config/logger')(_0x9e48('0x14'));var utils=require(_0x9e48('0x15'));var config=require(_0x9e48('0x16'));var db=require(_0x9e48('0x17'))['db'];function respondWithStatusCode(_0x24e709,_0x2e7157){_0x2e7157=_0x2e7157||0xcc;return function(_0x1527de){if(_0x1527de){return _0x24e709[_0x9e48('0x18')](_0x2e7157);}return _0x24e709[_0x9e48('0x19')](_0x2e7157)['end']();};}function respondWithResult(_0x5a352b,_0xa62c43){_0xa62c43=_0xa62c43||0xc8;return function(_0x4613d0){if(_0x4613d0){return _0x5a352b['status'](_0xa62c43)['json'](_0x4613d0);}};}function respondWithFilteredResult(_0x39a264,_0x57d7b6){return function(_0x260121){if(_0x260121){var _0x5ac1ef=_0x260121[_0x9e48('0x1a')],_0x346e50=_0x57d7b6['offset'],_0x4239b2=_0x57d7b6[_0x9e48('0x1b')]+_0x57d7b6[_0x9e48('0x1c')],_0x4108b3;if(_0x4239b2>=_0x5ac1ef){_0x4239b2=_0x5ac1ef;_0x4108b3=0xc8;}else{_0x4108b3=0xce;}_0x39a264['status'](_0x4108b3);return _0x39a264[_0x9e48('0x1d')](_0x9e48('0x1e'),_0x346e50+'-'+_0x4239b2+'/'+_0x5ac1ef)[_0x9e48('0x1f')](_0x260121);}return null;};}function patchUpdates(_0x49c3d3){return function(_0x5f5360){try{jsonpatch[_0x9e48('0x20')](_0x5f5360,_0x49c3d3,!![]);}catch(_0x462d4d){return BPromise[_0x9e48('0x21')](_0x462d4d);}return _0x5f5360['save']();};}function saveUpdates(_0xfb47aa,_0x50b310){return function(_0x4eae65){if(_0x4eae65){return _0x4eae65[_0x9e48('0x22')](_0xfb47aa)[_0x9e48('0x23')](function(_0x134ddc){return _0x134ddc;});}return null;};}function removeEntity(_0x3ac51d,_0x150bf8){return function(_0x572a63){if(_0x572a63){return _0x572a63[_0x9e48('0x24')]()[_0x9e48('0x23')](function(){_0x3ac51d[_0x9e48('0x19')](0xcc)[_0x9e48('0x25')]();});}};}function handleEntityNotFound(_0x43e733,_0x58c54d){return function(_0x4a22d7){if(!_0x4a22d7){_0x43e733[_0x9e48('0x18')](0x194);}return _0x4a22d7;};}function handleError(_0x401e22,_0x4212bf){_0x4212bf=_0x4212bf||0x1f4;return function(_0x1e3df7){logger[_0x9e48('0x26')](_0x1e3df7['stack']);if(_0x1e3df7[_0x9e48('0x27')]){delete _0x1e3df7['name'];}_0x401e22[_0x9e48('0x19')](_0x4212bf)[_0x9e48('0x28')](_0x1e3df7);};}exports[_0x9e48('0x29')]=function(_0xe0a0b8,_0x5d7636){var _0x3292af={},_0x200aab={},_0x1924c3={'count':0x0,'rows':[]};var _0x31cc40=_[_0x9e48('0x2a')](db[_0x9e48('0x2b')][_0x9e48('0x2c')],function(_0x2ffde1){return{'name':_0x2ffde1[_0x9e48('0x2d')],'type':_0x2ffde1[_0x9e48('0x2e')][_0x9e48('0x2f')]};});_0x200aab[_0x9e48('0x30')]=_['map'](_0x31cc40,_0x9e48('0x27'));_0x200aab[_0x9e48('0x31')]=_[_0x9e48('0x32')](_0xe0a0b8[_0x9e48('0x31')]);_0x200aab['filters']=_['intersection'](_0x200aab[_0x9e48('0x30')],_0x200aab[_0x9e48('0x31')]);_0x3292af[_0x9e48('0x33')]=_[_0x9e48('0x34')](_0x200aab[_0x9e48('0x30')],qs[_0x9e48('0x35')](_0xe0a0b8['query'][_0x9e48('0x35')]));_0x3292af[_0x9e48('0x33')]=_0x3292af[_0x9e48('0x33')][_0x9e48('0x36')]?_0x3292af[_0x9e48('0x33')]:_0x200aab[_0x9e48('0x30')];if(!_0xe0a0b8[_0x9e48('0x31')]['hasOwnProperty'](_0x9e48('0x37'))){_0x3292af[_0x9e48('0x1c')]=qs[_0x9e48('0x1c')](_0xe0a0b8[_0x9e48('0x31')]['limit']);_0x3292af[_0x9e48('0x1b')]=qs['offset'](_0xe0a0b8['query'][_0x9e48('0x1b')]);}_0x3292af[_0x9e48('0x38')]=qs['sort'](_0xe0a0b8[_0x9e48('0x31')][_0x9e48('0x39')]);_0x3292af[_0x9e48('0x3a')]=qs['filters'](_[_0x9e48('0x3b')](_0xe0a0b8[_0x9e48('0x31')],_0x200aab[_0x9e48('0x3c')]));if(_0xe0a0b8[_0x9e48('0x31')]['filter']){_0x3292af[_0x9e48('0x3a')]=_[_0x9e48('0x3d')](_0x3292af[_0x9e48('0x3a')],{'$or':_[_0x9e48('0x2a')](_0x31cc40,function(_0x4b876e){if(_0x4b876e[_0x9e48('0x2e')][_0x9e48('0x2f')]!=='VIRTUAL'){var _0x5c1ee1={};_0x5c1ee1[_0x4b876e[_0x9e48('0x3e')]]={'$like':'%'+_0xe0a0b8[_0x9e48('0x31')]['filter']+'%'};return _0x5c1ee1;}})});}_0x3292af=_[_0x9e48('0x3d')]({},_0x3292af,_0xe0a0b8[_0x9e48('0x3f')]);var _0x53cdab={'where':_0x3292af['where']};return db[_0x9e48('0x2b')][_0x9e48('0x1a')](_0x53cdab)[_0x9e48('0x23')](function(_0x8f2f80){_0x1924c3[_0x9e48('0x1a')]=_0x8f2f80;if(_0xe0a0b8['query'][_0x9e48('0x40')]){_0x3292af[_0x9e48('0x41')]=[{'all':!![]}];}return db[_0x9e48('0x2b')][_0x9e48('0x42')](_0x3292af);})['then'](function(_0x24b99b){_0x1924c3[_0x9e48('0x43')]=_0x24b99b;return _0x1924c3;})[_0x9e48('0x23')](respondWithFilteredResult(_0x5d7636,_0x3292af))[_0x9e48('0x44')](handleError(_0x5d7636,null));};exports[_0x9e48('0x45')]=function(_0x29049c,_0x4d1cbe){var _0x8c6999={'raw':!![],'where':{'id':_0x29049c['params']['id']}},_0x284a71={};_0x284a71[_0x9e48('0x30')]=_[_0x9e48('0x32')](db['SquareReport'][_0x9e48('0x2c')]);_0x284a71['query']=_[_0x9e48('0x32')](_0x29049c[_0x9e48('0x31')]);_0x284a71[_0x9e48('0x3c')]=_[_0x9e48('0x34')](_0x284a71[_0x9e48('0x30')],_0x284a71[_0x9e48('0x31')]);_0x8c6999[_0x9e48('0x33')]=_['intersection'](_0x284a71['model'],qs[_0x9e48('0x35')](_0x29049c[_0x9e48('0x31')][_0x9e48('0x35')]));_0x8c6999['attributes']=_0x8c6999[_0x9e48('0x33')]['length']?_0x8c6999[_0x9e48('0x33')]:_0x284a71[_0x9e48('0x30')];if(_0x29049c[_0x9e48('0x31')]['includeAll']){_0x8c6999[_0x9e48('0x41')]=[{'all':!![]}];}_0x8c6999=_['merge']({},_0x8c6999,_0x29049c['options']);return db[_0x9e48('0x2b')][_0x9e48('0x46')](_0x8c6999)[_0x9e48('0x23')](handleEntityNotFound(_0x4d1cbe,null))[_0x9e48('0x23')](respondWithResult(_0x4d1cbe,null))[_0x9e48('0x44')](handleError(_0x4d1cbe,null));};exports[_0x9e48('0x47')]=function(_0x5eeffa,_0x4c4779){return db[_0x9e48('0x2b')]['create'](_0x5eeffa[_0x9e48('0x48')],{})[_0x9e48('0x23')](respondWithResult(_0x4c4779,0xc9))['catch'](handleError(_0x4c4779,null));};exports['update']=function(_0x2f13f0,_0x4f48ec){if(_0x2f13f0[_0x9e48('0x48')]['id']){delete _0x2f13f0[_0x9e48('0x48')]['id'];}return db[_0x9e48('0x2b')][_0x9e48('0x46')]({'where':{'id':_0x2f13f0[_0x9e48('0x49')]['id']}})[_0x9e48('0x23')](handleEntityNotFound(_0x4f48ec,null))[_0x9e48('0x23')](saveUpdates(_0x2f13f0[_0x9e48('0x48')],null))[_0x9e48('0x23')](respondWithResult(_0x4f48ec,null))['catch'](handleError(_0x4f48ec,null));};exports['destroy']=function(_0x1fd4a7,_0x89991f){return db['SquareReport']['find']({'where':{'id':_0x1fd4a7[_0x9e48('0x49')]['id']}})[_0x9e48('0x23')](handleEntityNotFound(_0x89991f,null))[_0x9e48('0x23')](removeEntity(_0x89991f,null))['catch'](handleError(_0x89991f,null));};exports[_0x9e48('0x4a')]=function(_0x37595f,_0x3942d8){return db[_0x9e48('0x2b')][_0x9e48('0x4a')]()[_0x9e48('0x23')](respondWithResult(_0x3942d8,null))['catch'](handleError(_0x3942d8,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 6d833e9..052c259 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 _0x7597=['../../config/logger','api','moment','request-promise','path','../../config/environment','./squareReport.attributes','exports','define','SquareReport','uid_pname','uniqueid','project_name','leaveAt','lodash'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x7597,0xa4));var _0x7759=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x7597[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x7759('0x0'));var util=require('util');var logger=require(_0x7759('0x1'))(_0x7759('0x2'));var moment=require(_0x7759('0x3'));var BPromise=require('bluebird');var rp=require(_0x7759('0x4'));var fs=require('fs');var path=require(_0x7759('0x5'));var rimraf=require('rimraf');var config=require(_0x7759('0x6'));var attributes=require(_0x7759('0x7'));module[_0x7759('0x8')]=function(_0x153cc0,_0x2e2fc5){return _0x153cc0[_0x7759('0x9')](_0x7759('0xa'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0x7759('0xb'),'fields':[_0x7759('0xc'),_0x7759('0xd')]},{'name':_0x7759('0xe'),'fields':[_0x7759('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfa69=['define','SquareReport','report_square','uid_pname','leaveAt','api','moment','bluebird','rimraf','../../config/environment','exports'];(function(_0x25a42a,_0x3d489b){var _0x1129b1=function(_0x4ae61b){while(--_0x4ae61b){_0x25a42a['push'](_0x25a42a['shift']());}};_0x1129b1(++_0x3d489b);}(_0xfa69,0xd6));var _0x9fa6=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xfa69[_0x59ee6f];return _0x4c0979;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x9fa6('0x0'));var moment=require(_0x9fa6('0x1'));var BPromise=require(_0x9fa6('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9fa6('0x3'));var config=require(_0x9fa6('0x4'));var attributes=require('./squareReport.attributes');module[_0x9fa6('0x5')]=function(_0x243fb5,_0x25ee9f){return _0x243fb5[_0x9fa6('0x6')](_0x9fa6('0x7'),attributes,{'tableName':_0x9fa6('0x8'),'paranoid':![],'indexes':[{'name':_0x9fa6('0x9'),'fields':['uniqueid','project_name']},{'name':'leaveAt','fields':[_0x9fa6('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index ebf4a10..34fb0ef 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 _0x599e=['util','moment','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','request','then','info','SquareReport,\x20%s,\x20%s','debug','SquareReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateSquareReport','SquareReport','create','options','UpdateSquareReport','update','body','where','attributes','limit'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x599e,0xd2));var _0xe599=function(_0x308af6,_0x4e08a6){_0x308af6=_0x308af6-0x0;var _0x43a409=_0x599e[_0x308af6];return _0x43a409;};'use strict';var _=require('lodash');var util=require(_0xe599('0x0'));var moment=require(_0xe599('0x1'));var BPromise=require('bluebird');var rs=require(_0xe599('0x2'));var fs=require('fs');var Redis=require(_0xe599('0x3'));var db=require(_0xe599('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe599('0x5'));var config=require('../../config/environment');var jayson=require(_0xe599('0x6'));var client=jayson[_0xe599('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b9d5f,_0x5879c5,_0x68e809){return new BPromise(function(_0x12873d,_0x593eeb){return client[_0xe599('0x8')](_0x5b9d5f,_0x68e809)[_0xe599('0x9')](function(_0xfddfb2){logger[_0xe599('0xa')](_0xe599('0xb'),_0x5879c5,'request\x20sent');logger[_0xe599('0xc')](_0xe599('0xd'),_0x5879c5,_0xe599('0xe'),JSON[_0xe599('0xf')](_0xfddfb2));if(_0xfddfb2[_0xe599('0x10')]){if(_0xfddfb2['error'][_0xe599('0x11')]===0x1f4){logger[_0xe599('0x10')]('SquareReport,\x20%s,\x20%s',_0x5879c5,_0xfddfb2[_0xe599('0x10')][_0xe599('0x12')]);return _0x593eeb(_0xfddfb2[_0xe599('0x10')][_0xe599('0x12')]);}logger[_0xe599('0x10')](_0xe599('0xb'),_0x5879c5,_0xfddfb2[_0xe599('0x10')][_0xe599('0x12')]);return _0x12873d(_0xfddfb2[_0xe599('0x10')]['message']);}else{logger[_0xe599('0xa')]('SquareReport,\x20%s,\x20%s',_0x5879c5,_0xe599('0xe'));_0x12873d(_0xfddfb2['result'][_0xe599('0x12')]);}})[_0xe599('0x13')](function(_0x552119){logger['error']('SquareReport,\x20%s,\x20%s',_0x5879c5,_0x552119);_0x593eeb(_0x552119);});});}exports[_0xe599('0x14')]=function(_0x48c274){var _0x57ba96=this;return new Promise(function(_0x58bcd6,_0x587667){return db[_0xe599('0x15')][_0xe599('0x16')](_0x48c274['body'],{'raw':_0x48c274[_0xe599('0x17')]?_0x48c274[_0xe599('0x17')]['raw']===undefined?!![]:![]:!![]})[_0xe599('0x9')](function(_0x27df99){logger['info'](_0xe599('0x14'),_0x48c274);logger[_0xe599('0xc')]('CreateSquareReport',_0x48c274,JSON[_0xe599('0xf')](_0x27df99));_0x58bcd6(_0x27df99);})['catch'](function(_0x2c54a1){logger[_0xe599('0x10')](_0xe599('0x14'),_0x2c54a1[_0xe599('0x12')],_0x48c274);_0x587667(_0x57ba96[_0xe599('0x10')](0x1f4,_0x2c54a1['message']));});});};exports[_0xe599('0x18')]=function(_0x1ff696){var _0x538395=this;return new Promise(function(_0x1a6adf,_0x1266e2){return db[_0xe599('0x15')][_0xe599('0x19')](_0x1ff696[_0xe599('0x1a')],{'raw':_0x1ff696[_0xe599('0x17')]?_0x1ff696['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ff696[_0xe599('0x17')]?_0x1ff696['options'][_0xe599('0x1b')]||null:null,'attributes':_0x1ff696[_0xe599('0x17')]?_0x1ff696[_0xe599('0x17')][_0xe599('0x1c')]||null:null,'limit':_0x1ff696['options']?_0x1ff696[_0xe599('0x17')][_0xe599('0x1d')]||null:null})['then'](function(_0x8c19c1){logger['info'](_0xe599('0x18'),_0x1ff696);logger[_0xe599('0xc')](_0xe599('0x18'),_0x1ff696,JSON[_0xe599('0xf')](_0x8c19c1));_0x1a6adf(_0x8c19c1);})['catch'](function(_0xe0534){logger[_0xe599('0x10')](_0xe599('0x18'),_0xe0534[_0xe599('0x12')],_0x1ff696);_0x1266e2(_0x538395[_0xe599('0x10')](0x1f4,_0xe0534[_0xe599('0x12')]));});});}; \ No newline at end of file +var _0xcfce=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','SquareReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','create','body','options','raw','debug','CreateSquareReport','UpdateSquareReport','SquareReport','update','where','limit','lodash','util','moment','randomstring'];(function(_0x314453,_0x5a13d5){var _0x5e7da3=function(_0x31ea32){while(--_0x31ea32){_0x314453['push'](_0x314453['shift']());}};_0x5e7da3(++_0x5a13d5);}(_0xcfce,0x17d));var _0xecfc=function(_0x5bd3f2,_0x49f10b){_0x5bd3f2=_0x5bd3f2-0x0;var _0x444bfb=_0xcfce[_0x5bd3f2];return _0x444bfb;};'use strict';var _=require(_0xecfc('0x0'));var util=require(_0xecfc('0x1'));var moment=require(_0xecfc('0x2'));var BPromise=require('bluebird');var rs=require(_0xecfc('0x3'));var fs=require('fs');var Redis=require(_0xecfc('0x4'));var db=require(_0xecfc('0x5'))['db'];var utils=require(_0xecfc('0x6'));var logger=require(_0xecfc('0x7'))(_0xecfc('0x8'));var config=require(_0xecfc('0x9'));var jayson=require(_0xecfc('0xa'));var client=jayson[_0xecfc('0xb')][_0xecfc('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2ff55f,_0x3e2632,_0x1af99b){return new BPromise(function(_0x1cba1e,_0x4804cf){return client['request'](_0x2ff55f,_0x1af99b)[_0xecfc('0xd')](function(_0x29482f){logger[_0xecfc('0xe')](_0xecfc('0xf'),_0x3e2632,_0xecfc('0x10'));logger['debug'](_0xecfc('0x11'),_0x3e2632,_0xecfc('0x10'),JSON[_0xecfc('0x12')](_0x29482f));if(_0x29482f['error']){if(_0x29482f['error'][_0xecfc('0x13')]===0x1f4){logger[_0xecfc('0x14')](_0xecfc('0xf'),_0x3e2632,_0x29482f['error'][_0xecfc('0x15')]);return _0x4804cf(_0x29482f[_0xecfc('0x14')][_0xecfc('0x15')]);}logger[_0xecfc('0x14')](_0xecfc('0xf'),_0x3e2632,_0x29482f[_0xecfc('0x14')][_0xecfc('0x15')]);return _0x1cba1e(_0x29482f[_0xecfc('0x14')][_0xecfc('0x15')]);}else{logger['info'](_0xecfc('0xf'),_0x3e2632,_0xecfc('0x10'));_0x1cba1e(_0x29482f[_0xecfc('0x16')][_0xecfc('0x15')]);}})[_0xecfc('0x17')](function(_0x2906d0){logger[_0xecfc('0x14')](_0xecfc('0xf'),_0x3e2632,_0x2906d0);_0x4804cf(_0x2906d0);});});}exports['CreateSquareReport']=function(_0x51ea73){var _0x34ddad=this;return new Promise(function(_0x5ec831,_0x53acb7){return db['SquareReport'][_0xecfc('0x18')](_0x51ea73[_0xecfc('0x19')],{'raw':_0x51ea73['options']?_0x51ea73[_0xecfc('0x1a')][_0xecfc('0x1b')]===undefined?!![]:![]:!![]})[_0xecfc('0xd')](function(_0x5c2aad){logger[_0xecfc('0xe')]('CreateSquareReport',_0x51ea73);logger[_0xecfc('0x1c')](_0xecfc('0x1d'),_0x51ea73,JSON[_0xecfc('0x12')](_0x5c2aad));_0x5ec831(_0x5c2aad);})[_0xecfc('0x17')](function(_0x3f39cc){logger[_0xecfc('0x14')]('CreateSquareReport',_0x3f39cc[_0xecfc('0x15')],_0x51ea73);_0x53acb7(_0x34ddad[_0xecfc('0x14')](0x1f4,_0x3f39cc['message']));});});};exports[_0xecfc('0x1e')]=function(_0x28916b){var _0x4b0592=this;return new Promise(function(_0x128642,_0x55073a){return db[_0xecfc('0x1f')][_0xecfc('0x20')](_0x28916b['body'],{'raw':_0x28916b['options']?_0x28916b[_0xecfc('0x1a')][_0xecfc('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x28916b[_0xecfc('0x1a')]?_0x28916b[_0xecfc('0x1a')][_0xecfc('0x21')]||null:null,'attributes':_0x28916b['options']?_0x28916b[_0xecfc('0x1a')]['attributes']||null:null,'limit':_0x28916b[_0xecfc('0x1a')]?_0x28916b[_0xecfc('0x1a')][_0xecfc('0x22')]||null:null})['then'](function(_0x1a0464){logger[_0xecfc('0xe')](_0xecfc('0x1e'),_0x28916b);logger[_0xecfc('0x1c')](_0xecfc('0x1e'),_0x28916b,JSON['stringify'](_0x1a0464));_0x128642(_0x1a0464);})[_0xecfc('0x17')](function(_0x4e89b6){logger[_0xecfc('0x14')](_0xecfc('0x1e'),_0x4e89b6['message'],_0x28916b);_0x55073a(_0x4b0592[_0xecfc('0x14')](0x1f4,_0x4e89b6[_0xecfc('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 1080742..f5d7e5f 100644 --- a/server/api/squareReportDetail/index.js +++ b/server/api/squareReportDetail/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['/describe','/:id','post','create','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index'];(function(_0x30e61b,_0x36161a){var _0x5997a5=function(_0xe51d3){while(--_0xe51d3){_0x30e61b['push'](_0x30e61b['shift']());}};_0x5997a5(++_0x36161a);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2012fe,_0x45c15){_0x2012fe=_0x2012fe-0x0;var _0x3ea6b6=_0x5f2f[_0x2012fe];return _0x3ea6b6;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var auth=require(_0xf5f2('0x6'));var interaction=require(_0xf5f2('0x7'));var config=require('../../config/environment');var controller=require('./squareReportDetail.controller');router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0xa')]);router[_0xf5f2('0x8')](_0xf5f2('0xb'),auth[_0xf5f2('0x9')](),controller['describe']);router[_0xf5f2('0x8')](_0xf5f2('0xc'),auth[_0xf5f2('0x9')](),controller['show']);router[_0xf5f2('0xd')]('/',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0xe')]);router['put'](_0xf5f2('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xf5f2('0xf')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0x10')]);module[_0xf5f2('0x11')]=router; \ No newline at end of file +var _0x814b=['path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','destroy','exports','multer','util'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x814b,0x1a2));var _0xb814=function(_0x181dfe,_0xf84557){_0x181dfe=_0x181dfe-0x0;var _0x40c38f=_0x814b[_0x181dfe];return _0x40c38f;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xb814('0x6'));var config=require(_0xb814('0x7'));var controller=require(_0xb814('0x8'));router[_0xb814('0x9')]('/',auth[_0xb814('0xa')](),controller[_0xb814('0xb')]);router['get'](_0xb814('0xc'),auth[_0xb814('0xa')](),controller['describe']);router[_0xb814('0x9')](_0xb814('0xd'),auth[_0xb814('0xa')](),controller[_0xb814('0xe')]);router[_0xb814('0xf')]('/',auth[_0xb814('0xa')](),controller[_0xb814('0x10')]);router[_0xb814('0x11')](_0xb814('0xd'),auth[_0xb814('0xa')](),controller[_0xb814('0x12')]);router['delete'](_0xb814('0xd'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);module[_0xb814('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 2c70653..4b9afb9 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 _0x55ff=['sequelize','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x55ff,0x9e));var _0xf55f=function(_0x5c7e94,_0x5ab353){_0x5c7e94=_0x5c7e94-0x0;var _0x574200=_0x55ff[_0x5c7e94];return _0x574200;};'use strict';var Sequelize=require(_0xf55f('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xf55f('0x1')]},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize[_0xf55f('0x1')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0xf55f('0x1')]},'callerid':{'type':Sequelize[_0xf55f('0x1')]}}; \ No newline at end of file +var _0x3109=['sequelize','exports','STRING'];(function(_0x2eb1f,_0x65332){var _0x45f378=function(_0xa0cdf1){while(--_0xa0cdf1){_0x2eb1f['push'](_0x2eb1f['shift']());}};_0x45f378(++_0x65332);}(_0x3109,0x78));var _0x9310=function(_0x3c4a52,_0x596877){_0x3c4a52=_0x3c4a52-0x0;var _0x535a6f=_0x3109[_0x3c4a52];return _0x535a6f;};'use strict';var Sequelize=require(_0x9310('0x0'));module[_0x9310('0x1')]={'uniqueid':{'type':Sequelize[_0x9310('0x2')]},'node':{'type':Sequelize[_0x9310('0x2')]},'application':{'type':Sequelize[_0x9310('0x2')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0x9310('0x2')]},'callerid':{'type':Sequelize[_0x9310('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 7a8ef9e..93f1a7f 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 _0xf0be=['destroy','end','error','stack','name','send','map','SquareDetailsReport','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','where','filters','pick','VIRTUAL','field','merge','options','count','findAll','rows','show','params','includeAll','include','find','create','body','catch','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','set','Content-Range','apply','reject','save','update','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf0be,0x10e));var _0xef0b=function(_0x428b20,_0x11f96a){_0x428b20=_0x428b20-0x0;var _0x66debc=_0xf0be[_0x428b20];return _0x66debc;};'use strict';var pdf=require(_0xef0b('0x0'));var emlformat=require(_0xef0b('0x1'));var rimraf=require(_0xef0b('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xef0b('0x3'));var rp=require(_0xef0b('0x4'));var moment=require(_0xef0b('0x5'));var BPromise=require(_0xef0b('0x6'));var Mustache=require(_0xef0b('0x7'));var util=require(_0xef0b('0x8'));var path=require(_0xef0b('0x9'));var sox=require('sox');var csv=require(_0xef0b('0xa'));var ejs=require(_0xef0b('0xb'));var fs=require('fs');var _=require(_0xef0b('0xc'));var squel=require(_0xef0b('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xef0b('0xe'));var toCsv=require('to-csv');var querystring=require(_0xef0b('0xf'));var Papa=require(_0xef0b('0x10'));var Redis=require('ioredis');var authService=require(_0xef0b('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xef0b('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xef0b('0x13'));var utils=require(_0xef0b('0x14'));var config=require(_0xef0b('0x15'));var db=require(_0xef0b('0x16'))['db'];function respondWithStatusCode(_0x154c3a,_0x135192){_0x135192=_0x135192||0xcc;return function(_0x1ac2c8){if(_0x1ac2c8){return _0x154c3a[_0xef0b('0x17')](_0x135192);}return _0x154c3a['status'](_0x135192)['end']();};}function respondWithResult(_0x5a01b5,_0x15029d){_0x15029d=_0x15029d||0xc8;return function(_0x43f04a){if(_0x43f04a){return _0x5a01b5[_0xef0b('0x18')](_0x15029d)[_0xef0b('0x19')](_0x43f04a);}};}function respondWithFilteredResult(_0x2b993f,_0x36bd88){return function(_0x4b26da){if(_0x4b26da){var _0x29b0ef=_0x4b26da['count'],_0xd39470=_0x36bd88['offset'],_0x2c084c=_0x36bd88[_0xef0b('0x1a')]+_0x36bd88['limit'],_0x4892dc;if(_0x2c084c>=_0x29b0ef){_0x2c084c=_0x29b0ef;_0x4892dc=0xc8;}else{_0x4892dc=0xce;}_0x2b993f['status'](_0x4892dc);return _0x2b993f[_0xef0b('0x1b')](_0xef0b('0x1c'),_0xd39470+'-'+_0x2c084c+'/'+_0x29b0ef)['json'](_0x4b26da);}return null;};}function patchUpdates(_0x1e8012){return function(_0x394ca8){try{jsonpatch[_0xef0b('0x1d')](_0x394ca8,_0x1e8012,!![]);}catch(_0x456df8){return BPromise[_0xef0b('0x1e')](_0x456df8);}return _0x394ca8[_0xef0b('0x1f')]();};}function saveUpdates(_0x28c24d,_0x1624ca){return function(_0x1307cd){if(_0x1307cd){return _0x1307cd[_0xef0b('0x20')](_0x28c24d)[_0xef0b('0x21')](function(_0x196737){return _0x196737;});}return null;};}function removeEntity(_0x376375,_0x386773){return function(_0x4c2ee1){if(_0x4c2ee1){return _0x4c2ee1[_0xef0b('0x22')]()[_0xef0b('0x21')](function(){_0x376375['status'](0xcc)[_0xef0b('0x23')]();});}};}function handleEntityNotFound(_0x5e147c,_0x2f521d){return function(_0x13049a){if(!_0x13049a){_0x5e147c[_0xef0b('0x17')](0x194);}return _0x13049a;};}function handleError(_0x28fd1b,_0x53cf14){_0x53cf14=_0x53cf14||0x1f4;return function(_0x5ae452){logger[_0xef0b('0x24')](_0x5ae452[_0xef0b('0x25')]);if(_0x5ae452['name']){delete _0x5ae452[_0xef0b('0x26')];}_0x28fd1b[_0xef0b('0x18')](_0x53cf14)[_0xef0b('0x27')](_0x5ae452);};}exports['index']=function(_0x4040ec,_0x4ede7d){var _0x2723fb={},_0x1d4857={},_0x384081={'count':0x0,'rows':[]};var _0x5dbdd9=_[_0xef0b('0x28')](db[_0xef0b('0x29')][_0xef0b('0x2a')],function(_0x597f1a){return{'name':_0x597f1a[_0xef0b('0x2b')],'type':_0x597f1a[_0xef0b('0x2c')][_0xef0b('0x2d')]};});_0x1d4857[_0xef0b('0x2e')]=_[_0xef0b('0x28')](_0x5dbdd9,'name');_0x1d4857[_0xef0b('0x2f')]=_[_0xef0b('0x30')](_0x4040ec[_0xef0b('0x2f')]);_0x1d4857['filters']=_['intersection'](_0x1d4857[_0xef0b('0x2e')],_0x1d4857[_0xef0b('0x2f')]);_0x2723fb[_0xef0b('0x31')]=_[_0xef0b('0x32')](_0x1d4857[_0xef0b('0x2e')],qs['fields'](_0x4040ec['query'][_0xef0b('0x33')]));_0x2723fb['attributes']=_0x2723fb[_0xef0b('0x31')][_0xef0b('0x34')]?_0x2723fb[_0xef0b('0x31')]:_0x1d4857['model'];if(!_0x4040ec[_0xef0b('0x2f')][_0xef0b('0x35')](_0xef0b('0x36'))){_0x2723fb[_0xef0b('0x37')]=qs[_0xef0b('0x37')](_0x4040ec[_0xef0b('0x2f')][_0xef0b('0x37')]);_0x2723fb[_0xef0b('0x1a')]=qs[_0xef0b('0x1a')](_0x4040ec[_0xef0b('0x2f')][_0xef0b('0x1a')]);}_0x2723fb['order']=qs[_0xef0b('0x38')](_0x4040ec['query'][_0xef0b('0x38')]);_0x2723fb[_0xef0b('0x39')]=qs[_0xef0b('0x3a')](_[_0xef0b('0x3b')](_0x4040ec[_0xef0b('0x2f')],_0x1d4857[_0xef0b('0x3a')]));if(_0x4040ec[_0xef0b('0x2f')]['filter']){_0x2723fb[_0xef0b('0x39')]=_['merge'](_0x2723fb[_0xef0b('0x39')],{'$or':_[_0xef0b('0x28')](_0x5dbdd9,function(_0x219d46){if(_0x219d46[_0xef0b('0x2c')][_0xef0b('0x2d')]!==_0xef0b('0x3c')){var _0x26973d={};_0x26973d[_0x219d46[_0xef0b('0x3d')]]={'$like':'%'+_0x4040ec[_0xef0b('0x2f')]['filter']+'%'};return _0x26973d;}})});}_0x2723fb=_[_0xef0b('0x3e')]({},_0x2723fb,_0x4040ec[_0xef0b('0x3f')]);var _0x2b377c={'where':_0x2723fb[_0xef0b('0x39')]};return db[_0xef0b('0x29')][_0xef0b('0x40')](_0x2b377c)[_0xef0b('0x21')](function(_0x5e08a7){_0x384081[_0xef0b('0x40')]=_0x5e08a7;if(_0x4040ec[_0xef0b('0x2f')]['includeAll']){_0x2723fb['include']=[{'all':!![]}];}return db[_0xef0b('0x29')][_0xef0b('0x41')](_0x2723fb);})['then'](function(_0x4b95bb){_0x384081[_0xef0b('0x42')]=_0x4b95bb;return _0x384081;})[_0xef0b('0x21')](respondWithFilteredResult(_0x4ede7d,_0x2723fb))['catch'](handleError(_0x4ede7d,null));};exports[_0xef0b('0x43')]=function(_0x2d6498,_0xb74035){var _0x4f6cef={'raw':!![],'where':{'id':_0x2d6498[_0xef0b('0x44')]['id']}},_0x3da383={};_0x3da383['model']=_[_0xef0b('0x30')](db[_0xef0b('0x29')][_0xef0b('0x2a')]);_0x3da383['query']=_[_0xef0b('0x30')](_0x2d6498[_0xef0b('0x2f')]);_0x3da383[_0xef0b('0x3a')]=_[_0xef0b('0x32')](_0x3da383[_0xef0b('0x2e')],_0x3da383[_0xef0b('0x2f')]);_0x4f6cef[_0xef0b('0x31')]=_['intersection'](_0x3da383[_0xef0b('0x2e')],qs[_0xef0b('0x33')](_0x2d6498[_0xef0b('0x2f')][_0xef0b('0x33')]));_0x4f6cef[_0xef0b('0x31')]=_0x4f6cef[_0xef0b('0x31')]['length']?_0x4f6cef[_0xef0b('0x31')]:_0x3da383[_0xef0b('0x2e')];if(_0x2d6498['query'][_0xef0b('0x45')]){_0x4f6cef[_0xef0b('0x46')]=[{'all':!![]}];}_0x4f6cef=_[_0xef0b('0x3e')]({},_0x4f6cef,_0x2d6498[_0xef0b('0x3f')]);return db[_0xef0b('0x29')][_0xef0b('0x47')](_0x4f6cef)['then'](handleEntityNotFound(_0xb74035,null))['then'](respondWithResult(_0xb74035,null))['catch'](handleError(_0xb74035,null));};exports['create']=function(_0x32d663,_0x5ee685){return db[_0xef0b('0x29')][_0xef0b('0x48')](_0x32d663[_0xef0b('0x49')],{})[_0xef0b('0x21')](respondWithResult(_0x5ee685,0xc9))['catch'](handleError(_0x5ee685,null));};exports[_0xef0b('0x20')]=function(_0x251bd6,_0x53d103){if(_0x251bd6[_0xef0b('0x49')]['id']){delete _0x251bd6[_0xef0b('0x49')]['id'];}return db[_0xef0b('0x29')][_0xef0b('0x47')]({'where':{'id':_0x251bd6['params']['id']}})[_0xef0b('0x21')](handleEntityNotFound(_0x53d103,null))[_0xef0b('0x21')](saveUpdates(_0x251bd6[_0xef0b('0x49')],null))[_0xef0b('0x21')](respondWithResult(_0x53d103,null))[_0xef0b('0x4a')](handleError(_0x53d103,null));};exports['destroy']=function(_0x39dee1,_0x1a84f0){return db['SquareDetailsReport']['find']({'where':{'id':_0x39dee1['params']['id']}})[_0xef0b('0x21')](handleEntityNotFound(_0x1a84f0,null))[_0xef0b('0x21')](removeEntity(_0x1a84f0,null))[_0xef0b('0x4a')](handleError(_0x1a84f0,null));};exports['describe']=function(_0x2644b4,_0x31bce6){return db['SquareDetailsReport'][_0xef0b('0x4b')]()[_0xef0b('0x21')](respondWithResult(_0x31bce6,null))['catch'](handleError(_0x31bce6,null));}; \ No newline at end of file +var _0x7863=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','status','end','json','count','offset','set','Content-Range','apply','reject','save','then','error','stack','name','send','index','map','SquareDetailsReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filter','merge','VIRTUAL','field','includeAll','include','findAll','rows','catch','params','options','find','create','body','update','destroy','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x3e59e3,_0x220f8b){var _0x2fd0f1=function(_0x5bdfba){while(--_0x5bdfba){_0x3e59e3['push'](_0x3e59e3['shift']());}};_0x2fd0f1(++_0x220f8b);}(_0x7863,0x116));var _0x3786=function(_0x34ca5a,_0x2f14b1){_0x34ca5a=_0x34ca5a-0x0;var _0x38c2be=_0x7863[_0x34ca5a];return _0x38c2be;};'use strict';var pdf=require(_0x3786('0x0'));var emlformat=require(_0x3786('0x1'));var rimraf=require(_0x3786('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3786('0x3'));var rp=require(_0x3786('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3786('0x5'));var path=require(_0x3786('0x6'));var sox=require(_0x3786('0x7'));var csv=require(_0x3786('0x8'));var ejs=require(_0x3786('0x9'));var fs=require('fs');var _=require(_0x3786('0xa'));var squel=require('squel');var crypto=require(_0x3786('0xb'));var jsforce=require(_0x3786('0xc'));var deskjs=require(_0x3786('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3786('0xe'));var Redis=require(_0x3786('0xf'));var authService=require(_0x3786('0x10'));var qs=require(_0x3786('0x11'));var as=require(_0x3786('0x12'));var hardwareService=require(_0x3786('0x13'));var logger=require(_0x3786('0x14'))('api');var utils=require(_0x3786('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5edd11,_0x37e303){_0x37e303=_0x37e303||0xcc;return function(_0x490cad){if(_0x490cad){return _0x5edd11['sendStatus'](_0x37e303);}return _0x5edd11[_0x3786('0x16')](_0x37e303)[_0x3786('0x17')]();};}function respondWithResult(_0x53c7dd,_0x56ad9f){_0x56ad9f=_0x56ad9f||0xc8;return function(_0x6b255d){if(_0x6b255d){return _0x53c7dd[_0x3786('0x16')](_0x56ad9f)[_0x3786('0x18')](_0x6b255d);}};}function respondWithFilteredResult(_0xc006be,_0x1bded4){return function(_0x20aef5){if(_0x20aef5){var _0xc72c02=_0x20aef5[_0x3786('0x19')],_0x57ce98=_0x1bded4[_0x3786('0x1a')],_0x50b8b7=_0x1bded4[_0x3786('0x1a')]+_0x1bded4['limit'],_0x494e07;if(_0x50b8b7>=_0xc72c02){_0x50b8b7=_0xc72c02;_0x494e07=0xc8;}else{_0x494e07=0xce;}_0xc006be[_0x3786('0x16')](_0x494e07);return _0xc006be[_0x3786('0x1b')](_0x3786('0x1c'),_0x57ce98+'-'+_0x50b8b7+'/'+_0xc72c02)[_0x3786('0x18')](_0x20aef5);}return null;};}function patchUpdates(_0x867759){return function(_0x257ef1){try{jsonpatch[_0x3786('0x1d')](_0x257ef1,_0x867759,!![]);}catch(_0x1d2e32){return BPromise[_0x3786('0x1e')](_0x1d2e32);}return _0x257ef1[_0x3786('0x1f')]();};}function saveUpdates(_0x26b4ea,_0x2df872){return function(_0x57ba12){if(_0x57ba12){return _0x57ba12['update'](_0x26b4ea)[_0x3786('0x20')](function(_0x2b850c){return _0x2b850c;});}return null;};}function removeEntity(_0x265356,_0x11cede){return function(_0x403856){if(_0x403856){return _0x403856['destroy']()[_0x3786('0x20')](function(){_0x265356[_0x3786('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c3f76,_0x16a0e7){return function(_0x34da05){if(!_0x34da05){_0x1c3f76['sendStatus'](0x194);}return _0x34da05;};}function handleError(_0x35bdcb,_0xea9de3){_0xea9de3=_0xea9de3||0x1f4;return function(_0x9c6e48){logger[_0x3786('0x21')](_0x9c6e48[_0x3786('0x22')]);if(_0x9c6e48['name']){delete _0x9c6e48[_0x3786('0x23')];}_0x35bdcb['status'](_0xea9de3)[_0x3786('0x24')](_0x9c6e48);};}exports[_0x3786('0x25')]=function(_0x19b383,_0xf80aa5){var _0x3c7886={},_0x3a34d6={},_0x19c505={'count':0x0,'rows':[]};var _0x49be70=_[_0x3786('0x26')](db[_0x3786('0x27')][_0x3786('0x28')],function(_0x5ef627){return{'name':_0x5ef627[_0x3786('0x29')],'type':_0x5ef627[_0x3786('0x2a')][_0x3786('0x2b')]};});_0x3a34d6[_0x3786('0x2c')]=_[_0x3786('0x26')](_0x49be70,_0x3786('0x23'));_0x3a34d6[_0x3786('0x2d')]=_[_0x3786('0x2e')](_0x19b383['query']);_0x3a34d6[_0x3786('0x2f')]=_[_0x3786('0x30')](_0x3a34d6['model'],_0x3a34d6[_0x3786('0x2d')]);_0x3c7886[_0x3786('0x31')]=_[_0x3786('0x30')](_0x3a34d6[_0x3786('0x2c')],qs[_0x3786('0x32')](_0x19b383[_0x3786('0x2d')][_0x3786('0x32')]));_0x3c7886['attributes']=_0x3c7886[_0x3786('0x31')][_0x3786('0x33')]?_0x3c7886['attributes']:_0x3a34d6['model'];if(!_0x19b383[_0x3786('0x2d')][_0x3786('0x34')]('nolimit')){_0x3c7886[_0x3786('0x35')]=qs['limit'](_0x19b383[_0x3786('0x2d')][_0x3786('0x35')]);_0x3c7886['offset']=qs[_0x3786('0x1a')](_0x19b383[_0x3786('0x2d')][_0x3786('0x1a')]);}_0x3c7886[_0x3786('0x36')]=qs[_0x3786('0x37')](_0x19b383[_0x3786('0x2d')][_0x3786('0x37')]);_0x3c7886[_0x3786('0x38')]=qs[_0x3786('0x2f')](_['pick'](_0x19b383['query'],_0x3a34d6[_0x3786('0x2f')]));if(_0x19b383[_0x3786('0x2d')][_0x3786('0x39')]){_0x3c7886[_0x3786('0x38')]=_[_0x3786('0x3a')](_0x3c7886[_0x3786('0x38')],{'$or':_['map'](_0x49be70,function(_0x266e39){if(_0x266e39[_0x3786('0x2a')]['key']!==_0x3786('0x3b')){var _0x2504e8={};_0x2504e8[_0x266e39[_0x3786('0x3c')]]={'$like':'%'+_0x19b383[_0x3786('0x2d')][_0x3786('0x39')]+'%'};return _0x2504e8;}})});}_0x3c7886=_[_0x3786('0x3a')]({},_0x3c7886,_0x19b383['options']);var _0xd0adcb={'where':_0x3c7886['where']};return db[_0x3786('0x27')][_0x3786('0x19')](_0xd0adcb)['then'](function(_0x10636a){_0x19c505[_0x3786('0x19')]=_0x10636a;if(_0x19b383[_0x3786('0x2d')][_0x3786('0x3d')]){_0x3c7886[_0x3786('0x3e')]=[{'all':!![]}];}return db['SquareDetailsReport'][_0x3786('0x3f')](_0x3c7886);})['then'](function(_0x103ab2){_0x19c505[_0x3786('0x40')]=_0x103ab2;return _0x19c505;})['then'](respondWithFilteredResult(_0xf80aa5,_0x3c7886))[_0x3786('0x41')](handleError(_0xf80aa5,null));};exports['show']=function(_0x4f8117,_0x3ab80c){var _0xfd5dff={'raw':!![],'where':{'id':_0x4f8117[_0x3786('0x42')]['id']}},_0x1cb3ec={};_0x1cb3ec['model']=_[_0x3786('0x2e')](db[_0x3786('0x27')][_0x3786('0x28')]);_0x1cb3ec['query']=_[_0x3786('0x2e')](_0x4f8117[_0x3786('0x2d')]);_0x1cb3ec[_0x3786('0x2f')]=_['intersection'](_0x1cb3ec[_0x3786('0x2c')],_0x1cb3ec['query']);_0xfd5dff['attributes']=_[_0x3786('0x30')](_0x1cb3ec[_0x3786('0x2c')],qs[_0x3786('0x32')](_0x4f8117[_0x3786('0x2d')][_0x3786('0x32')]));_0xfd5dff[_0x3786('0x31')]=_0xfd5dff[_0x3786('0x31')][_0x3786('0x33')]?_0xfd5dff[_0x3786('0x31')]:_0x1cb3ec[_0x3786('0x2c')];if(_0x4f8117[_0x3786('0x2d')][_0x3786('0x3d')]){_0xfd5dff[_0x3786('0x3e')]=[{'all':!![]}];}_0xfd5dff=_[_0x3786('0x3a')]({},_0xfd5dff,_0x4f8117[_0x3786('0x43')]);return db[_0x3786('0x27')][_0x3786('0x44')](_0xfd5dff)[_0x3786('0x20')](handleEntityNotFound(_0x3ab80c,null))[_0x3786('0x20')](respondWithResult(_0x3ab80c,null))[_0x3786('0x41')](handleError(_0x3ab80c,null));};exports[_0x3786('0x45')]=function(_0x5b0d07,_0x23f414){return db[_0x3786('0x27')][_0x3786('0x45')](_0x5b0d07[_0x3786('0x46')],{})[_0x3786('0x20')](respondWithResult(_0x23f414,0xc9))['catch'](handleError(_0x23f414,null));};exports[_0x3786('0x47')]=function(_0x3b4585,_0x54dab4){if(_0x3b4585[_0x3786('0x46')]['id']){delete _0x3b4585['body']['id'];}return db['SquareDetailsReport']['find']({'where':{'id':_0x3b4585[_0x3786('0x42')]['id']}})['then'](handleEntityNotFound(_0x54dab4,null))[_0x3786('0x20')](saveUpdates(_0x3b4585[_0x3786('0x46')],null))[_0x3786('0x20')](respondWithResult(_0x54dab4,null))['catch'](handleError(_0x54dab4,null));};exports[_0x3786('0x48')]=function(_0x24f402,_0x429622){return db[_0x3786('0x27')][_0x3786('0x44')]({'where':{'id':_0x24f402['params']['id']}})[_0x3786('0x20')](handleEntityNotFound(_0x429622,null))['then'](removeEntity(_0x429622,null))[_0x3786('0x41')](handleError(_0x429622,null));};exports[_0x3786('0x49')]=function(_0x54d1f3,_0x556c0b){return db[_0x3786('0x27')][_0x3786('0x49')]()['then'](respondWithResult(_0x556c0b,null))[_0x3786('0x41')](handleError(_0x556c0b,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 5f4faed..521e1b7 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 _0x3fc6=['define','SquareDetailsReport','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x187547,_0x59b0fc){var _0x66720f=function(_0x1f257d){while(--_0x1f257d){_0x187547['push'](_0x187547['shift']());}};_0x66720f(++_0x59b0fc);}(_0x3fc6,0x115));var _0x63fc=function(_0x2eb5d6,_0x853fc){_0x2eb5d6=_0x2eb5d6-0x0;var _0x4096cb=_0x3fc6[_0x2eb5d6];return _0x4096cb;};'use strict';var _=require(_0x63fc('0x0'));var util=require('util');var logger=require(_0x63fc('0x1'))(_0x63fc('0x2'));var moment=require(_0x63fc('0x3'));var BPromise=require(_0x63fc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x63fc('0x5'));var rimraf=require(_0x63fc('0x6'));var config=require(_0x63fc('0x7'));var attributes=require('./squareReportDetail.attributes');module[_0x63fc('0x8')]=function(_0x4ed9a1,_0x2c9b0b){return _0x4ed9a1[_0x63fc('0x9')](_0x63fc('0xa'),attributes,{'tableName':'report_square_details','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf271=['define','SquareDetailsReport','report_square_details','lodash','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./squareReportDetail.attributes','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf271,0x10b));var _0x1f27=function(_0x2f4dd9,_0x164f1f){_0x2f4dd9=_0x2f4dd9-0x0;var _0x529e2c=_0xf271[_0x2f4dd9];return _0x529e2c;};'use strict';var _=require(_0x1f27('0x0'));var util=require('util');var logger=require(_0x1f27('0x1'))(_0x1f27('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1f27('0x3'));var fs=require('fs');var path=require(_0x1f27('0x4'));var rimraf=require(_0x1f27('0x5'));var config=require(_0x1f27('0x6'));var attributes=require(_0x1f27('0x7'));module[_0x1f27('0x8')]=function(_0x3dbe1d,_0x30a455){return _0x3dbe1d[_0x1f27('0x9')](_0x1f27('0xa'),attributes,{'tableName':_0x1f27('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js index d8de447..06cf0e9 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 _0xa983=['options','raw','then','CreateSquareDetailsReport','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','body'];(function(_0x26f0ed,_0x38b250){var _0x4be8ea=function(_0x59c567){while(--_0x59c567){_0x26f0ed['push'](_0x26f0ed['shift']());}};_0x4be8ea(++_0x38b250);}(_0xa983,0xc1));var _0x3a98=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa983[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x3a98('0x0'));var util=require(_0x3a98('0x1'));var moment=require(_0x3a98('0x2'));var BPromise=require(_0x3a98('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3a98('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3a98('0x5'));var logger=require(_0x3a98('0x6'))(_0x3a98('0x7'));var config=require(_0x3a98('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3a98('0x9')][_0x3a98('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e55af,_0x1ae561,_0x43bc84){return new BPromise(function(_0x3cbdf4,_0x2b1903){return client[_0x3a98('0xb')](_0x1e55af,_0x43bc84)['then'](function(_0x5d0305){logger[_0x3a98('0xc')](_0x3a98('0xd'),_0x1ae561,_0x3a98('0xe'));logger[_0x3a98('0xf')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x1ae561,_0x3a98('0xe'),JSON[_0x3a98('0x10')](_0x5d0305));if(_0x5d0305[_0x3a98('0x11')]){if(_0x5d0305[_0x3a98('0x11')][_0x3a98('0x12')]===0x1f4){logger['error'](_0x3a98('0xd'),_0x1ae561,_0x5d0305[_0x3a98('0x11')][_0x3a98('0x13')]);return _0x2b1903(_0x5d0305[_0x3a98('0x11')][_0x3a98('0x13')]);}logger[_0x3a98('0x11')](_0x3a98('0xd'),_0x1ae561,_0x5d0305['error'][_0x3a98('0x13')]);return _0x3cbdf4(_0x5d0305[_0x3a98('0x11')]['message']);}else{logger[_0x3a98('0xc')](_0x3a98('0xd'),_0x1ae561,_0x3a98('0xe'));_0x3cbdf4(_0x5d0305[_0x3a98('0x14')][_0x3a98('0x13')]);}})[_0x3a98('0x15')](function(_0x3d350a){logger[_0x3a98('0x11')](_0x3a98('0xd'),_0x1ae561,_0x3d350a);_0x2b1903(_0x3d350a);});});}exports['CreateSquareDetailsReport']=function(_0x3643b7){var _0x32cfd7=this;return new Promise(function(_0x5e3190,_0x46a9ad){return db['SquareDetailsReport']['create'](_0x3643b7[_0x3a98('0x16')],{'raw':_0x3643b7[_0x3a98('0x17')]?_0x3643b7[_0x3a98('0x17')][_0x3a98('0x18')]===undefined?!![]:![]:!![]})[_0x3a98('0x19')](function(_0x268387){logger[_0x3a98('0xc')](_0x3a98('0x1a'),_0x3643b7);logger[_0x3a98('0xf')](_0x3a98('0x1a'),_0x3643b7,JSON['stringify'](_0x268387));_0x5e3190(_0x268387);})[_0x3a98('0x15')](function(_0x5e941a){logger[_0x3a98('0x11')](_0x3a98('0x1a'),_0x5e941a[_0x3a98('0x13')],_0x3643b7);_0x46a9ad(_0x32cfd7['error'](0x1f4,_0x5e941a['message']));});});}; \ No newline at end of file +var _0x031b=['info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','debug','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then'];(function(_0x34a32e,_0x26f089){var _0x24ca9b=function(_0x47c1c5){while(--_0x47c1c5){_0x34a32e['push'](_0x34a32e['shift']());}};_0x24ca9b(++_0x26f089);}(_0x031b,0x170));var _0xb031=function(_0x167537,_0x443a08){_0x167537=_0x167537-0x0;var _0x253b4a=_0x031b[_0x167537];return _0x253b4a;};'use strict';var _=require('lodash');var util=require(_0xb031('0x0'));var moment=require(_0xb031('0x1'));var BPromise=require(_0xb031('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb031('0x3'))['db'];var utils=require(_0xb031('0x4'));var logger=require(_0xb031('0x5'))('rpc');var config=require(_0xb031('0x6'));var jayson=require(_0xb031('0x7'));var client=jayson[_0xb031('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x532bfe,_0x422557,_0x34dfb4){return new BPromise(function(_0x35cc79,_0x25a768){return client['request'](_0x532bfe,_0x34dfb4)[_0xb031('0x9')](function(_0x1d9411){logger[_0xb031('0xa')](_0xb031('0xb'),_0x422557,_0xb031('0xc'));logger['debug'](_0xb031('0xd'),_0x422557,'request\x20sent',JSON[_0xb031('0xe')](_0x1d9411));if(_0x1d9411[_0xb031('0xf')]){if(_0x1d9411['error'][_0xb031('0x10')]===0x1f4){logger[_0xb031('0xf')]('SquareDetailsReport,\x20%s,\x20%s',_0x422557,_0x1d9411[_0xb031('0xf')][_0xb031('0x11')]);return _0x25a768(_0x1d9411[_0xb031('0xf')][_0xb031('0x11')]);}logger[_0xb031('0xf')]('SquareDetailsReport,\x20%s,\x20%s',_0x422557,_0x1d9411[_0xb031('0xf')][_0xb031('0x11')]);return _0x35cc79(_0x1d9411[_0xb031('0xf')][_0xb031('0x11')]);}else{logger['info'](_0xb031('0xb'),_0x422557,_0xb031('0xc'));_0x35cc79(_0x1d9411[_0xb031('0x12')]['message']);}})[_0xb031('0x13')](function(_0x5bde1c){logger[_0xb031('0xf')](_0xb031('0xb'),_0x422557,_0x5bde1c);_0x25a768(_0x5bde1c);});});}exports[_0xb031('0x14')]=function(_0x466caa){var _0xf921fd=this;return new Promise(function(_0x175645,_0x3b29fc){return db[_0xb031('0x15')][_0xb031('0x16')](_0x466caa[_0xb031('0x17')],{'raw':_0x466caa[_0xb031('0x18')]?_0x466caa['options'][_0xb031('0x19')]===undefined?!![]:![]:!![]})[_0xb031('0x9')](function(_0x4e7228){logger[_0xb031('0xa')](_0xb031('0x14'),_0x466caa);logger[_0xb031('0x1a')](_0xb031('0x14'),_0x466caa,JSON[_0xb031('0xe')](_0x4e7228));_0x175645(_0x4e7228);})[_0xb031('0x13')](function(_0x8b9136){logger[_0xb031('0xf')](_0xb031('0x14'),_0x8b9136[_0xb031('0x11')],_0x466caa);_0x3b29fc(_0xf921fd['error'](0x1f4,_0x8b9136[_0xb031('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 0b92dbe..939eb1d 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 _0x3cca=['isAuthenticated','index','/process/:pid/kill','express','Router','../../components/auth/service','get'];(function(_0x3df23b,_0x11565a){var _0x323f3f=function(_0x4003a4){while(--_0x4003a4){_0x3df23b['push'](_0x3df23b['shift']());}};_0x323f3f(++_0x11565a);}(_0x3cca,0xce));var _0xa3cc=function(_0x9504,_0x4129bf){_0x9504=_0x9504-0x0;var _0x1c4e37=_0x3cca[_0x9504];return _0x1c4e37;};'use strict';var express=require(_0xa3cc('0x0'));var router=express[_0xa3cc('0x1')]();var auth=require(_0xa3cc('0x2'));var controller=require('./system.controller');router[_0xa3cc('0x3')]('/',auth[_0xa3cc('0x4')](),controller[_0xa3cc('0x5')]);router['get'](_0xa3cc('0x6'),auth['isAuthenticated'](),controller['killProcess']);module['exports']=router; \ No newline at end of file +var _0x2c47=['./system.controller','get','isAuthenticated','index','/process/:pid/kill','killProcess','exports','express','../../components/auth/service'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0x2c47,0xe8));var _0x72c4=function(_0x3a83b8,_0x25cc6b){_0x3a83b8=_0x3a83b8-0x0;var _0x59cd4f=_0x2c47[_0x3a83b8];return _0x59cd4f;};'use strict';var express=require(_0x72c4('0x0'));var router=express['Router']();var auth=require(_0x72c4('0x1'));var controller=require(_0x72c4('0x2'));router[_0x72c4('0x3')]('/',auth[_0x72c4('0x4')](),controller[_0x72c4('0x5')]);router[_0x72c4('0x3')](_0x72c4('0x6'),auth[_0x72c4('0x4')](),controller[_0x72c4('0x7')]);module[_0x72c4('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 8ef68f4..ceb36d0 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 _0x03d3=['killProcess','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','length','indexOf','kill','Process\x20with\x20pid\x20%s\x20killed\x20correctly','catch','systeminformation','child_process','exec','api','util','bluebird','lodash','error','inspect','name','status','send','index','getAllData','then','json'];(function(_0x3d7450,_0x51a35c){var _0x5e895a=function(_0x12fa5e){while(--_0x12fa5e){_0x3d7450['push'](_0x3d7450['shift']());}};_0x5e895a(++_0x51a35c);}(_0x03d3,0xda));var _0x303d=function(_0x3ba1cc,_0x4632b5){_0x3ba1cc=_0x3ba1cc-0x0;var _0x348e14=_0x03d3[_0x3ba1cc];return _0x348e14;};'use strict';var info=require(_0x303d('0x0'));var exec=require(_0x303d('0x1'))[_0x303d('0x2')];var logger=require('../../config/logger')(_0x303d('0x3'));var util=require(_0x303d('0x4'));var BPromise=require(_0x303d('0x5'));var _=require(_0x303d('0x6'));function handleError(_0x3a7496,_0x36b2a2,_0x3c6afd){_0x36b2a2=_0x36b2a2||0x1f4;return function(_0x565afe){logger[_0x303d('0x7')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x3c6afd,_0x36b2a2,util[_0x303d('0x8')](_0x565afe,{'showHidden':![],'depth':null}));delete _0x565afe[_0x303d('0x9')];_0x3a7496[_0x303d('0xa')](_0x36b2a2)[_0x303d('0xb')](_0x565afe);};}exports[_0x303d('0xc')]=function(_0xcd3ba9,_0x3e98ba){return info[_0x303d('0xd')]()[_0x303d('0xe')](function(_0x4c1420){return _0x3e98ba[_0x303d('0xa')](0xc8)['json'](_0x4c1420);})['catch'](function(_0x52cf6b){return _0x3e98ba[_0x303d('0xa')](0x1f4)[_0x303d('0xf')](_0x52cf6b);});};exports[_0x303d('0x10')]=function(_0x14b593,_0x139d59){var _0x360a2a=['components/import/cm'];return new BPromise(function(_0x4c445b,_0x395721){return exec(util[_0x303d('0x11')](_0x303d('0x12'),_0x14b593[_0x303d('0x13')][_0x303d('0x14')]),function(_0x558e69,_0x25c277,_0x468a7e){if(_0x558e69){return _0x395721(_0x558e69);}return _0x4c445b(_0x25c277);});})[_0x303d('0xe')](function(_0x387148){var _0x4d4511=![];var _0x1e551b=_0x387148['split'](/\n/);for(var _0x5a05b2=0x0,_0x53e162=_0x360a2a[_0x303d('0x15')];_0x5a05b2<_0x53e162,_0x4d4511===![];_0x5a05b2+=0x1){if(_0x387148[_0x303d('0x16')](_0x360a2a[_0x5a05b2])>=0x0){_0x4d4511=!![];}}if(!_0x4d4511){throw new Error(util['format']('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x14b593[_0x303d('0x13')][_0x303d('0x14')]));}process[_0x303d('0x17')](_0x14b593[_0x303d('0x13')]['pid'],'SIGINT');return _0x139d59[_0x303d('0xa')](0xc8)[_0x303d('0xf')]({'message':util[_0x303d('0x11')](_0x303d('0x18'),_0x14b593[_0x303d('0x13')][_0x303d('0x14')])});})[_0x303d('0x19')](handleError(_0x139d59,null,_0x303d('0x10')));}; \ No newline at end of file +var _0xd88c=['name','status','send','index','getAllData','then','json','killProcess','components/import/cm','format','params','pid','split','length','indexOf','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','catch','systeminformation','child_process','exec','../../config/logger','api','util','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect'];(function(_0x5d1ae4,_0x4aeb73){var _0x226f3d=function(_0x398311){while(--_0x398311){_0x5d1ae4['push'](_0x5d1ae4['shift']());}};_0x226f3d(++_0x4aeb73);}(_0xd88c,0x1a9));var _0xcd88=function(_0x36f80c,_0x443cdc){_0x36f80c=_0x36f80c-0x0;var _0x28b842=_0xd88c[_0x36f80c];return _0x28b842;};'use strict';var info=require(_0xcd88('0x0'));var exec=require(_0xcd88('0x1'))[_0xcd88('0x2')];var logger=require(_0xcd88('0x3'))(_0xcd88('0x4'));var util=require(_0xcd88('0x5'));var BPromise=require('bluebird');var _=require(_0xcd88('0x6'));function handleError(_0x2e0a45,_0x4a3bb5,_0x5bcbf2){_0x4a3bb5=_0x4a3bb5||0x1f4;return function(_0x4903f2){logger[_0xcd88('0x7')](_0xcd88('0x8'),_0x5bcbf2,_0x4a3bb5,util[_0xcd88('0x9')](_0x4903f2,{'showHidden':![],'depth':null}));delete _0x4903f2[_0xcd88('0xa')];_0x2e0a45[_0xcd88('0xb')](_0x4a3bb5)[_0xcd88('0xc')](_0x4903f2);};}exports[_0xcd88('0xd')]=function(_0x47966f,_0x5837c0){return info[_0xcd88('0xe')]()[_0xcd88('0xf')](function(_0xeee29b){return _0x5837c0[_0xcd88('0xb')](0xc8)['json'](_0xeee29b);})['catch'](function(_0x1ba96f){return _0x5837c0[_0xcd88('0xb')](0x1f4)[_0xcd88('0x10')](_0x1ba96f);});};exports[_0xcd88('0x11')]=function(_0x36bcac,_0x25b868){var _0x11c12d=[_0xcd88('0x12')];return new BPromise(function(_0x3972bc,_0x217ac7){return exec(util[_0xcd88('0x13')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x36bcac[_0xcd88('0x14')][_0xcd88('0x15')]),function(_0xdfc657,_0x7b6211,_0xfda48b){if(_0xdfc657){return _0x217ac7(_0xdfc657);}return _0x3972bc(_0x7b6211);});})[_0xcd88('0xf')](function(_0x6bf467){var _0x17012f=![];var _0x125ed0=_0x6bf467[_0xcd88('0x16')](/\n/);for(var _0x35b749=0x0,_0x230b25=_0x11c12d[_0xcd88('0x17')];_0x35b749<_0x230b25,_0x17012f===![];_0x35b749+=0x1){if(_0x6bf467[_0xcd88('0x18')](_0x11c12d[_0x35b749])>=0x0){_0x17012f=!![];}}if(!_0x17012f){throw new Error(util[_0xcd88('0x13')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x36bcac['params']['pid']));}process[_0xcd88('0x19')](_0x36bcac['params']['pid'],_0xcd88('0x1a'));return _0x25b868[_0xcd88('0xb')](0xc8)[_0xcd88('0x10')]({'message':util[_0xcd88('0x13')](_0xcd88('0x1b'),_0x36bcac['params'][_0xcd88('0x15')])});})[_0xcd88('0x1c')](handleError(_0x25b868,null,_0xcd88('0x11')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 48245c0..dd1af33 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 _0x6f0d=['delete','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','index','/:id','isAuthenticated','show','post','put','update'];(function(_0x770765,_0x50263e){var _0x3e3920=function(_0x11b319){while(--_0x11b319){_0x770765['push'](_0x770765['shift']());}};_0x3e3920(++_0x50263e);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x258dbe,_0x1aba0e){_0x258dbe=_0x258dbe-0x0;var _0xebda07=_0x6f0d[_0x258dbe];return _0xebda07;};'use strict';var multer=require('multer');var util=require(_0xd6f0('0x0'));var path=require(_0xd6f0('0x1'));var timeout=require(_0xd6f0('0x2'));var express=require(_0xd6f0('0x3'));var router=express['Router']();var auth=require(_0xd6f0('0x4'));var interaction=require(_0xd6f0('0x5'));var config=require(_0xd6f0('0x6'));var controller=require(_0xd6f0('0x7'));router[_0xd6f0('0x8')]('/',auth['isAuthenticated'](),controller[_0xd6f0('0x9')]);router['get'](_0xd6f0('0xa'),auth[_0xd6f0('0xb')](),controller[_0xd6f0('0xc')]);router[_0xd6f0('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd6f0('0xe')](_0xd6f0('0xa'),auth[_0xd6f0('0xb')](),controller[_0xd6f0('0xf')]);router[_0xd6f0('0x10')]('/:id',auth[_0xd6f0('0xb')](),controller[_0xd6f0('0x11')]);module[_0xd6f0('0x12')]=router; \ No newline at end of file +var _0x4522=['destroy','exports','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete'];(function(_0x125a8a,_0x490d31){var _0xe767a5=function(_0x2a505c){while(--_0x2a505c){_0x125a8a['push'](_0x125a8a['shift']());}};_0xe767a5(++_0x490d31);}(_0x4522,0x1a0));var _0x2452=function(_0x58fdbf,_0x2ca22e){_0x58fdbf=_0x58fdbf-0x0;var _0x47e511=_0x4522[_0x58fdbf];return _0x47e511;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2452('0x0'));var timeout=require(_0x2452('0x1'));var express=require(_0x2452('0x2'));var router=express['Router']();var auth=require(_0x2452('0x3'));var interaction=require(_0x2452('0x4'));var config=require(_0x2452('0x5'));var controller=require(_0x2452('0x6'));router[_0x2452('0x7')]('/',auth[_0x2452('0x8')](),controller[_0x2452('0x9')]);router[_0x2452('0x7')](_0x2452('0xa'),auth[_0x2452('0x8')](),controller[_0x2452('0xb')]);router[_0x2452('0xc')]('/',auth[_0x2452('0x8')](),controller[_0x2452('0xd')]);router[_0x2452('0xe')](_0x2452('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x2452('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x2452('0x10')]);module[_0x2452('0x11')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index d89d231..524fb0d 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 _0xb7e7=['STRING','sequelize'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xb7e7,0x121));var _0x7b7e=function(_0x710815,_0x520da8){_0x710815=_0x710815-0x0;var _0x5b3b89=_0xb7e7[_0x710815];return _0x5b3b89;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b7e('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x7b7e('0x1')],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0x7b7e('0x1')]}}; \ No newline at end of file +var _0x5eb8=['name','#0091EA','STRING'];(function(_0x4929f8,_0xc8f56a){var _0x354230=function(_0x58d64f){while(--_0x58d64f){_0x4929f8['push'](_0x4929f8['shift']());}};_0x354230(++_0xc8f56a);}(_0x5eb8,0xb0));var _0x85eb=function(_0x19500a,_0x317e84){_0x19500a=_0x19500a-0x0;var _0x21f791=_0x5eb8[_0x19500a];return _0x21f791;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x85eb('0x0')],'unique':_0x85eb('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x85eb('0x0')],'defaultValue':_0x85eb('0x2')},'description':{'type':Sequelize[_0x85eb('0x0')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index b2ed7e6..5f3a32f 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 _0x7e58=['Tag','includeAll','include','findAll','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','html-pdf','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','squel','crypto','desk.js','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','offset','order','sort','where','filters','pick','filter','merge','VIRTUAL','field','options'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x7e58,0x1f1));var _0x87e5=function(_0x51e410,_0x28c23b){_0x51e410=_0x51e410-0x0;var _0x1ed0fa=_0x7e58[_0x51e410];return _0x1ed0fa;};'use strict';var pdf=require(_0x87e5('0x0'));var emlformat=require(_0x87e5('0x1'));var rimraf=require(_0x87e5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x87e5('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x87e5('0x4'));var Mustache=require(_0x87e5('0x5'));var util=require(_0x87e5('0x6'));var path=require(_0x87e5('0x7'));var sox=require(_0x87e5('0x8'));var csv=require(_0x87e5('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x87e5('0xa'));var crypto=require(_0x87e5('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x87e5('0xc'));var toCsv=require('to-csv');var querystring=require(_0x87e5('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x87e5('0xe'));var hardwareService=require(_0x87e5('0xf'));var logger=require(_0x87e5('0x10'))('api');var utils=require(_0x87e5('0x11'));var config=require('../../config/environment');var db=require(_0x87e5('0x12'))['db'];function respondWithStatusCode(_0x464acd,_0x1648da){_0x1648da=_0x1648da||0xcc;return function(_0x587002){if(_0x587002){return _0x464acd[_0x87e5('0x13')](_0x1648da);}return _0x464acd[_0x87e5('0x14')](_0x1648da)[_0x87e5('0x15')]();};}function respondWithResult(_0x42c0f9,_0x4a19a5){_0x4a19a5=_0x4a19a5||0xc8;return function(_0x32b607){if(_0x32b607){return _0x42c0f9[_0x87e5('0x14')](_0x4a19a5)[_0x87e5('0x16')](_0x32b607);}};}function respondWithFilteredResult(_0x286d18,_0x160bb0){return function(_0x1febed){if(_0x1febed){var _0x15afeb=_0x1febed[_0x87e5('0x17')],_0x4e63ba=_0x160bb0['offset'],_0x5c775e=_0x160bb0['offset']+_0x160bb0[_0x87e5('0x18')],_0x1e0a60;if(_0x5c775e>=_0x15afeb){_0x5c775e=_0x15afeb;_0x1e0a60=0xc8;}else{_0x1e0a60=0xce;}_0x286d18[_0x87e5('0x14')](_0x1e0a60);return _0x286d18[_0x87e5('0x19')](_0x87e5('0x1a'),_0x4e63ba+'-'+_0x5c775e+'/'+_0x15afeb)[_0x87e5('0x16')](_0x1febed);}return null;};}function patchUpdates(_0x12045a){return function(_0x194751){try{jsonpatch[_0x87e5('0x1b')](_0x194751,_0x12045a,!![]);}catch(_0x42a48c){return BPromise[_0x87e5('0x1c')](_0x42a48c);}return _0x194751[_0x87e5('0x1d')]();};}function saveUpdates(_0x256de3,_0x13bf29){return function(_0x5bc77c){if(_0x5bc77c){return _0x5bc77c[_0x87e5('0x1e')](_0x256de3)[_0x87e5('0x1f')](function(_0x4cc932){return _0x4cc932;});}return null;};}function removeEntity(_0x247b47,_0x56a75b){return function(_0x37e1b6){if(_0x37e1b6){return _0x37e1b6[_0x87e5('0x20')]()[_0x87e5('0x1f')](function(){var _0x2b4bff=_0x37e1b6[_0x87e5('0x21')]({'plain':!![]});var _0x700460='Tags';return db[_0x87e5('0x22')]['destroy']({'where':{'type':_0x700460,'resourceId':_0x2b4bff['id']}})[_0x87e5('0x1f')](function(){return _0x37e1b6;});})[_0x87e5('0x1f')](function(){_0x247b47[_0x87e5('0x14')](0xcc)[_0x87e5('0x15')]();});}};}function handleEntityNotFound(_0x4a28f5,_0x231a45){return function(_0x244896){if(!_0x244896){_0x4a28f5[_0x87e5('0x13')](0x194);}return _0x244896;};}function handleError(_0x38dd58,_0x2a9ec3){_0x2a9ec3=_0x2a9ec3||0x1f4;return function(_0x238722){logger[_0x87e5('0x23')](_0x238722[_0x87e5('0x24')]);if(_0x238722[_0x87e5('0x25')]){delete _0x238722[_0x87e5('0x25')];}_0x38dd58[_0x87e5('0x14')](_0x2a9ec3)[_0x87e5('0x26')](_0x238722);};}exports[_0x87e5('0x27')]=function(_0x4c263e,_0x435f55){var _0x33e5f9={},_0x43da94={},_0x5ea125={'count':0x0,'rows':[]};var _0x1dd044=_[_0x87e5('0x28')](db['Tag'][_0x87e5('0x29')],function(_0x3bb342){return{'name':_0x3bb342[_0x87e5('0x2a')],'type':_0x3bb342[_0x87e5('0x2b')][_0x87e5('0x2c')]};});_0x43da94['model']=_[_0x87e5('0x28')](_0x1dd044,_0x87e5('0x25'));_0x43da94[_0x87e5('0x2d')]=_[_0x87e5('0x2e')](_0x4c263e[_0x87e5('0x2d')]);_0x43da94['filters']=_[_0x87e5('0x2f')](_0x43da94[_0x87e5('0x30')],_0x43da94[_0x87e5('0x2d')]);_0x33e5f9[_0x87e5('0x31')]=_[_0x87e5('0x2f')](_0x43da94[_0x87e5('0x30')],qs[_0x87e5('0x32')](_0x4c263e[_0x87e5('0x2d')][_0x87e5('0x32')]));_0x33e5f9[_0x87e5('0x31')]=_0x33e5f9[_0x87e5('0x31')][_0x87e5('0x33')]?_0x33e5f9[_0x87e5('0x31')]:_0x43da94[_0x87e5('0x30')];if(!_0x4c263e[_0x87e5('0x2d')]['hasOwnProperty']('nolimit')){_0x33e5f9[_0x87e5('0x18')]=qs['limit'](_0x4c263e[_0x87e5('0x2d')][_0x87e5('0x18')]);_0x33e5f9['offset']=qs['offset'](_0x4c263e[_0x87e5('0x2d')][_0x87e5('0x34')]);}_0x33e5f9[_0x87e5('0x35')]=qs[_0x87e5('0x36')](_0x4c263e['query']['sort']);_0x33e5f9[_0x87e5('0x37')]=qs[_0x87e5('0x38')](_[_0x87e5('0x39')](_0x4c263e[_0x87e5('0x2d')],_0x43da94[_0x87e5('0x38')]));if(_0x4c263e[_0x87e5('0x2d')][_0x87e5('0x3a')]){_0x33e5f9[_0x87e5('0x37')]=_[_0x87e5('0x3b')](_0x33e5f9[_0x87e5('0x37')],{'$or':_[_0x87e5('0x28')](_0x1dd044,function(_0x2235b2){if(_0x2235b2[_0x87e5('0x2b')][_0x87e5('0x2c')]!==_0x87e5('0x3c')){var _0x3d34c5={};_0x3d34c5[_0x2235b2[_0x87e5('0x3d')]]={'$like':'%'+_0x4c263e['query'][_0x87e5('0x3a')]+'%'};return _0x3d34c5;}})});}_0x33e5f9=_['merge']({},_0x33e5f9,_0x4c263e[_0x87e5('0x3e')]);var _0x2c6a03={'where':_0x33e5f9[_0x87e5('0x37')]};return db[_0x87e5('0x3f')][_0x87e5('0x17')](_0x2c6a03)[_0x87e5('0x1f')](function(_0x35a1ad){_0x5ea125['count']=_0x35a1ad;if(_0x4c263e[_0x87e5('0x2d')][_0x87e5('0x40')]){_0x33e5f9[_0x87e5('0x41')]=[{'all':!![]}];}return db[_0x87e5('0x3f')][_0x87e5('0x42')](_0x33e5f9);})['then'](function(_0x3c861f){_0x5ea125[_0x87e5('0x43')]=_0x3c861f;return _0x5ea125;})[_0x87e5('0x1f')](respondWithFilteredResult(_0x435f55,_0x33e5f9))[_0x87e5('0x44')](handleError(_0x435f55,null));};exports[_0x87e5('0x45')]=function(_0x3b7a0c,_0x1eed4b){var _0x94bd38={'raw':!![],'where':{'id':_0x3b7a0c[_0x87e5('0x46')]['id']}},_0x28f26f={};_0x28f26f[_0x87e5('0x30')]=_[_0x87e5('0x2e')](db[_0x87e5('0x3f')][_0x87e5('0x29')]);_0x28f26f[_0x87e5('0x2d')]=_[_0x87e5('0x2e')](_0x3b7a0c[_0x87e5('0x2d')]);_0x28f26f[_0x87e5('0x38')]=_[_0x87e5('0x2f')](_0x28f26f[_0x87e5('0x30')],_0x28f26f[_0x87e5('0x2d')]);_0x94bd38['attributes']=_[_0x87e5('0x2f')](_0x28f26f[_0x87e5('0x30')],qs[_0x87e5('0x32')](_0x3b7a0c['query'][_0x87e5('0x32')]));_0x94bd38[_0x87e5('0x31')]=_0x94bd38[_0x87e5('0x31')]['length']?_0x94bd38[_0x87e5('0x31')]:_0x28f26f[_0x87e5('0x30')];if(_0x3b7a0c[_0x87e5('0x2d')][_0x87e5('0x40')]){_0x94bd38[_0x87e5('0x41')]=[{'all':!![]}];}_0x94bd38=_[_0x87e5('0x3b')]({},_0x94bd38,_0x3b7a0c['options']);return db[_0x87e5('0x3f')][_0x87e5('0x47')](_0x94bd38)[_0x87e5('0x1f')](handleEntityNotFound(_0x1eed4b,null))[_0x87e5('0x1f')](respondWithResult(_0x1eed4b,null))[_0x87e5('0x44')](handleError(_0x1eed4b,null));};exports[_0x87e5('0x48')]=function(_0x5ec6f7,_0x25631a){return db['Tag'][_0x87e5('0x48')](_0x5ec6f7['body'],{})['then'](function(_0x5befa5){var _0x162da8=_0x5ec6f7[_0x87e5('0x49')][_0x87e5('0x21')]({'plain':!![]});if(!_0x162da8)throw new Error(_0x87e5('0x4a'));if(_0x162da8['role']===_0x87e5('0x49')){var _0x2fde6a=_0x5befa5[_0x87e5('0x21')]({'plain':!![]});var _0x420d4a='Tags';return db[_0x87e5('0x4b')][_0x87e5('0x47')]({'where':{'name':_0x420d4a,'userProfileId':_0x162da8[_0x87e5('0x4c')]},'raw':!![]})[_0x87e5('0x1f')](function(_0x40c8f1){if(_0x40c8f1&&_0x40c8f1[_0x87e5('0x4d')]===0x0){return db[_0x87e5('0x22')]['create']({'name':_0x2fde6a[_0x87e5('0x25')],'resourceId':_0x2fde6a['id'],'type':_0x40c8f1['name'],'sectionId':_0x40c8f1['id']},{})[_0x87e5('0x1f')](function(){return _0x5befa5;});}else{return _0x5befa5;}})[_0x87e5('0x44')](function(_0x47a9c2){logger['error'](_0x87e5('0x4e'),_0x47a9c2);throw _0x47a9c2;});}return _0x5befa5;})[_0x87e5('0x1f')](respondWithResult(_0x25631a,0xc9))['catch'](handleError(_0x25631a,null));};exports[_0x87e5('0x1e')]=function(_0xdfb7da,_0x152402){if(_0xdfb7da[_0x87e5('0x4f')]['id']){delete _0xdfb7da[_0x87e5('0x4f')]['id'];}return db[_0x87e5('0x3f')][_0x87e5('0x47')]({'where':{'id':_0xdfb7da[_0x87e5('0x46')]['id']}})[_0x87e5('0x1f')](handleEntityNotFound(_0x152402,null))[_0x87e5('0x1f')](saveUpdates(_0xdfb7da[_0x87e5('0x4f')],null))[_0x87e5('0x1f')](respondWithResult(_0x152402,null))[_0x87e5('0x44')](handleError(_0x152402,null));};exports[_0x87e5('0x20')]=function(_0x3ee081,_0x5960b6){return db[_0x87e5('0x3f')][_0x87e5('0x47')]({'where':{'id':_0x3ee081[_0x87e5('0x46')]['id']}})['then'](handleEntityNotFound(_0x5960b6,null))[_0x87e5('0x1f')](removeEntity(_0x5960b6,null))[_0x87e5('0x44')](handleError(_0x5960b6,null));}; \ No newline at end of file +var _0xb65c=['crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','count','offset','limit','set','json','reject','save','update','then','destroy','get','Tags','UserProfileResource','error','stack','name','send','Tag','rawAttributes','fieldName','type','key','model','map','keys','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','field','merge','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','lodash','squel'];(function(_0x51ab83,_0x2721b9){var _0x14b6de=function(_0x243483){while(--_0x243483){_0x51ab83['push'](_0x51ab83['shift']());}};_0x14b6de(++_0x2721b9);}(_0xb65c,0xed));var _0xcb65=function(_0xcbbc7d,_0x49e121){_0xcbbc7d=_0xcbbc7d-0x0;var _0x2c7d27=_0xb65c[_0xcbbc7d];return _0x2c7d27;};'use strict';var pdf=require(_0xcb65('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xcb65('0x1'));var zipdir=require(_0xcb65('0x2'));var jsonpatch=require(_0xcb65('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xcb65('0x4'));var Mustache=require(_0xcb65('0x5'));var util=require(_0xcb65('0x6'));var path=require(_0xcb65('0x7'));var sox=require('sox');var csv=require(_0xcb65('0x8'));var ejs=require(_0xcb65('0x9'));var fs=require('fs');var _=require(_0xcb65('0xa'));var squel=require(_0xcb65('0xb'));var crypto=require(_0xcb65('0xc'));var jsforce=require(_0xcb65('0xd'));var deskjs=require(_0xcb65('0xe'));var toCsv=require(_0xcb65('0x8'));var querystring=require(_0xcb65('0xf'));var Papa=require(_0xcb65('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xcb65('0x11'));var as=require(_0xcb65('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcb65('0x13'))('api');var utils=require(_0xcb65('0x14'));var config=require('../../config/environment');var db=require(_0xcb65('0x15'))['db'];function respondWithStatusCode(_0xa5cf46,_0x432805){_0x432805=_0x432805||0xcc;return function(_0x2b8dd3){if(_0x2b8dd3){return _0xa5cf46[_0xcb65('0x16')](_0x432805);}return _0xa5cf46[_0xcb65('0x17')](_0x432805)[_0xcb65('0x18')]();};}function respondWithResult(_0x371c14,_0xef93d0){_0xef93d0=_0xef93d0||0xc8;return function(_0x43420b){if(_0x43420b){return _0x371c14[_0xcb65('0x17')](_0xef93d0)['json'](_0x43420b);}};}function respondWithFilteredResult(_0x3cfd87,_0x557022){return function(_0x4d82f2){if(_0x4d82f2){var _0x45cd33=_0x4d82f2[_0xcb65('0x19')],_0x5aa8a4=_0x557022[_0xcb65('0x1a')],_0x439251=_0x557022[_0xcb65('0x1a')]+_0x557022[_0xcb65('0x1b')],_0x5b7eb4;if(_0x439251>=_0x45cd33){_0x439251=_0x45cd33;_0x5b7eb4=0xc8;}else{_0x5b7eb4=0xce;}_0x3cfd87['status'](_0x5b7eb4);return _0x3cfd87[_0xcb65('0x1c')]('Content-Range',_0x5aa8a4+'-'+_0x439251+'/'+_0x45cd33)[_0xcb65('0x1d')](_0x4d82f2);}return null;};}function patchUpdates(_0x218259){return function(_0x182612){try{jsonpatch['apply'](_0x182612,_0x218259,!![]);}catch(_0x31ded3){return BPromise[_0xcb65('0x1e')](_0x31ded3);}return _0x182612[_0xcb65('0x1f')]();};}function saveUpdates(_0x2e0883,_0x89ca1e){return function(_0x107592){if(_0x107592){return _0x107592[_0xcb65('0x20')](_0x2e0883)[_0xcb65('0x21')](function(_0x117e52){return _0x117e52;});}return null;};}function removeEntity(_0x369424,_0xd89693){return function(_0xcd70ab){if(_0xcd70ab){return _0xcd70ab[_0xcb65('0x22')]()[_0xcb65('0x21')](function(){var _0x2b10e4=_0xcd70ab[_0xcb65('0x23')]({'plain':!![]});var _0x45eab3=_0xcb65('0x24');return db[_0xcb65('0x25')]['destroy']({'where':{'type':_0x45eab3,'resourceId':_0x2b10e4['id']}})['then'](function(){return _0xcd70ab;});})['then'](function(){_0x369424[_0xcb65('0x17')](0xcc)[_0xcb65('0x18')]();});}};}function handleEntityNotFound(_0xff4da6,_0x4d44e3){return function(_0x4aebb0){if(!_0x4aebb0){_0xff4da6[_0xcb65('0x16')](0x194);}return _0x4aebb0;};}function handleError(_0x4da59e,_0x3ed0bf){_0x3ed0bf=_0x3ed0bf||0x1f4;return function(_0x32e3c2){logger[_0xcb65('0x26')](_0x32e3c2[_0xcb65('0x27')]);if(_0x32e3c2[_0xcb65('0x28')]){delete _0x32e3c2['name'];}_0x4da59e[_0xcb65('0x17')](_0x3ed0bf)[_0xcb65('0x29')](_0x32e3c2);};}exports['index']=function(_0x383c8c,_0x5185ed){var _0x27e879={},_0x4b6ae2={},_0x259e15={'count':0x0,'rows':[]};var _0x23cee9=_['map'](db[_0xcb65('0x2a')][_0xcb65('0x2b')],function(_0x59f895){return{'name':_0x59f895[_0xcb65('0x2c')],'type':_0x59f895[_0xcb65('0x2d')][_0xcb65('0x2e')]};});_0x4b6ae2[_0xcb65('0x2f')]=_[_0xcb65('0x30')](_0x23cee9,_0xcb65('0x28'));_0x4b6ae2['query']=_[_0xcb65('0x31')](_0x383c8c[_0xcb65('0x32')]);_0x4b6ae2['filters']=_[_0xcb65('0x33')](_0x4b6ae2['model'],_0x4b6ae2[_0xcb65('0x32')]);_0x27e879['attributes']=_[_0xcb65('0x33')](_0x4b6ae2[_0xcb65('0x2f')],qs['fields'](_0x383c8c[_0xcb65('0x32')][_0xcb65('0x34')]));_0x27e879['attributes']=_0x27e879[_0xcb65('0x35')]['length']?_0x27e879[_0xcb65('0x35')]:_0x4b6ae2[_0xcb65('0x2f')];if(!_0x383c8c[_0xcb65('0x32')][_0xcb65('0x36')](_0xcb65('0x37'))){_0x27e879[_0xcb65('0x1b')]=qs[_0xcb65('0x1b')](_0x383c8c[_0xcb65('0x32')]['limit']);_0x27e879[_0xcb65('0x1a')]=qs[_0xcb65('0x1a')](_0x383c8c[_0xcb65('0x32')][_0xcb65('0x1a')]);}_0x27e879[_0xcb65('0x38')]=qs[_0xcb65('0x39')](_0x383c8c['query'][_0xcb65('0x39')]);_0x27e879[_0xcb65('0x3a')]=qs[_0xcb65('0x3b')](_[_0xcb65('0x3c')](_0x383c8c[_0xcb65('0x32')],_0x4b6ae2['filters']));if(_0x383c8c[_0xcb65('0x32')][_0xcb65('0x3d')]){_0x27e879[_0xcb65('0x3a')]=_['merge'](_0x27e879[_0xcb65('0x3a')],{'$or':_['map'](_0x23cee9,function(_0x23b0c9){if(_0x23b0c9[_0xcb65('0x2d')][_0xcb65('0x2e')]!==_0xcb65('0x3e')){var _0x4231e9={};_0x4231e9[_0x23b0c9[_0xcb65('0x3f')]]={'$like':'%'+_0x383c8c[_0xcb65('0x32')][_0xcb65('0x3d')]+'%'};return _0x4231e9;}})});}_0x27e879=_[_0xcb65('0x40')]({},_0x27e879,_0x383c8c['options']);var _0x1891f4={'where':_0x27e879[_0xcb65('0x3a')]};return db['Tag']['count'](_0x1891f4)[_0xcb65('0x21')](function(_0x5e2f1e){_0x259e15[_0xcb65('0x19')]=_0x5e2f1e;if(_0x383c8c[_0xcb65('0x32')][_0xcb65('0x41')]){_0x27e879[_0xcb65('0x42')]=[{'all':!![]}];}return db[_0xcb65('0x2a')][_0xcb65('0x43')](_0x27e879);})[_0xcb65('0x21')](function(_0x55b425){_0x259e15[_0xcb65('0x44')]=_0x55b425;return _0x259e15;})[_0xcb65('0x21')](respondWithFilteredResult(_0x5185ed,_0x27e879))[_0xcb65('0x45')](handleError(_0x5185ed,null));};exports[_0xcb65('0x46')]=function(_0x52e5b9,_0x49812e){var _0x113e8c={'raw':!![],'where':{'id':_0x52e5b9[_0xcb65('0x47')]['id']}},_0x34fc00={};_0x34fc00[_0xcb65('0x2f')]=_[_0xcb65('0x31')](db['Tag'][_0xcb65('0x2b')]);_0x34fc00[_0xcb65('0x32')]=_['keys'](_0x52e5b9[_0xcb65('0x32')]);_0x34fc00[_0xcb65('0x3b')]=_[_0xcb65('0x33')](_0x34fc00[_0xcb65('0x2f')],_0x34fc00[_0xcb65('0x32')]);_0x113e8c['attributes']=_[_0xcb65('0x33')](_0x34fc00['model'],qs['fields'](_0x52e5b9[_0xcb65('0x32')]['fields']));_0x113e8c[_0xcb65('0x35')]=_0x113e8c[_0xcb65('0x35')][_0xcb65('0x48')]?_0x113e8c[_0xcb65('0x35')]:_0x34fc00[_0xcb65('0x2f')];if(_0x52e5b9['query'][_0xcb65('0x41')]){_0x113e8c[_0xcb65('0x42')]=[{'all':!![]}];}_0x113e8c=_[_0xcb65('0x40')]({},_0x113e8c,_0x52e5b9[_0xcb65('0x49')]);return db[_0xcb65('0x2a')][_0xcb65('0x4a')](_0x113e8c)[_0xcb65('0x21')](handleEntityNotFound(_0x49812e,null))[_0xcb65('0x21')](respondWithResult(_0x49812e,null))[_0xcb65('0x45')](handleError(_0x49812e,null));};exports[_0xcb65('0x4b')]=function(_0x169159,_0x1c325e){return db[_0xcb65('0x2a')]['create'](_0x169159[_0xcb65('0x4c')],{})[_0xcb65('0x21')](function(_0x294617){var _0x4b68e9=_0x169159[_0xcb65('0x4d')][_0xcb65('0x23')]({'plain':!![]});if(!_0x4b68e9)throw new Error(_0xcb65('0x4e'));if(_0x4b68e9['role']===_0xcb65('0x4d')){var _0x4d917b=_0x294617['get']({'plain':!![]});var _0x4ee29b=_0xcb65('0x24');return db[_0xcb65('0x4f')][_0xcb65('0x4a')]({'where':{'name':_0x4ee29b,'userProfileId':_0x4b68e9[_0xcb65('0x50')]},'raw':!![]})[_0xcb65('0x21')](function(_0x45bf9b){if(_0x45bf9b&&_0x45bf9b[_0xcb65('0x51')]===0x0){return db[_0xcb65('0x25')][_0xcb65('0x4b')]({'name':_0x4d917b['name'],'resourceId':_0x4d917b['id'],'type':_0x45bf9b['name'],'sectionId':_0x45bf9b['id']},{})['then'](function(){return _0x294617;});}else{return _0x294617;}})['catch'](function(_0x30b851){logger[_0xcb65('0x26')](_0xcb65('0x52'),_0x30b851);throw _0x30b851;});}return _0x294617;})['then'](respondWithResult(_0x1c325e,0xc9))[_0xcb65('0x45')](handleError(_0x1c325e,null));};exports[_0xcb65('0x20')]=function(_0x5f0d30,_0x28afe5){if(_0x5f0d30['body']['id']){delete _0x5f0d30[_0xcb65('0x4c')]['id'];}return db[_0xcb65('0x2a')][_0xcb65('0x4a')]({'where':{'id':_0x5f0d30['params']['id']}})['then'](handleEntityNotFound(_0x28afe5,null))['then'](saveUpdates(_0x5f0d30[_0xcb65('0x4c')],null))['then'](respondWithResult(_0x28afe5,null))[_0xcb65('0x45')](handleError(_0x28afe5,null));};exports[_0xcb65('0x22')]=function(_0x286f07,_0x4e26b1){return db['Tag'][_0xcb65('0x4a')]({'where':{'id':_0x286f07['params']['id']}})[_0xcb65('0x21')](handleEntityNotFound(_0x4e26b1,null))['then'](removeEntity(_0x4e26b1,null))['catch'](handleError(_0x4e26b1,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index d56e0f5..b35ffb1 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 _0xa195=['./tag.attributes','exports','define','Tag','tools_tags','lodash','util','api','moment','request-promise','rimraf'];(function(_0x3ac31a,_0x18f1b9){var _0x4caa11=function(_0x2d2211){while(--_0x2d2211){_0x3ac31a['push'](_0x3ac31a['shift']());}};_0x4caa11(++_0x18f1b9);}(_0xa195,0x1b2));var _0x5a19=function(_0xb00175,_0x2cc01f){_0xb00175=_0xb00175-0x0;var _0x4cf03e=_0xa195[_0xb00175];return _0x4cf03e;};'use strict';var _=require(_0x5a19('0x0'));var util=require(_0x5a19('0x1'));var logger=require('../../config/logger')(_0x5a19('0x2'));var moment=require(_0x5a19('0x3'));var BPromise=require('bluebird');var rp=require(_0x5a19('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5a19('0x5'));var config=require('../../config/environment');var attributes=require(_0x5a19('0x6'));module[_0x5a19('0x7')]=function(_0x59873a,_0x3bdfd4){return _0x59873a[_0x5a19('0x8')](_0x5a19('0x9'),attributes,{'tableName':_0x5a19('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x77c3=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./tag.attributes','exports','define','Tag','tools_tags','lodash','../../config/logger'];(function(_0x290134,_0x889947){var _0xc5666f=function(_0x31c893){while(--_0x31c893){_0x290134['push'](_0x290134['shift']());}};_0xc5666f(++_0x889947);}(_0x77c3,0x1da));var _0x377c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x77c3[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x377c('0x0'));var util=require('util');var logger=require(_0x377c('0x1'))(_0x377c('0x2'));var moment=require(_0x377c('0x3'));var BPromise=require(_0x377c('0x4'));var rp=require(_0x377c('0x5'));var fs=require('fs');var path=require(_0x377c('0x6'));var rimraf=require(_0x377c('0x7'));var config=require(_0x377c('0x8'));var attributes=require(_0x377c('0x9'));module[_0x377c('0xa')]=function(_0x5938bb,_0x4f1713){return _0x5938bb[_0x377c('0xb')](_0x377c('0xc'),attributes,{'tableName':_0x377c('0xd'),'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 b43f8dc..5b1ce77 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 _0xdace=['request\x20sent','debug','stringify','error','code','Tag,\x20%s,\x20%s','message','info','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x1793de,_0x4d7233){var _0x4f0309=function(_0x229ee7){while(--_0x229ee7){_0x1793de['push'](_0x1793de['shift']());}};_0x4f0309(++_0x4d7233);}(_0xdace,0xc5));var _0xedac=function(_0xa6cc5c,_0x239c99){_0xa6cc5c=_0xa6cc5c-0x0;var _0x44803d=_0xdace[_0xa6cc5c];return _0x44803d;};'use strict';var _=require(_0xedac('0x0'));var util=require('util');var moment=require(_0xedac('0x1'));var BPromise=require(_0xedac('0x2'));var rs=require(_0xedac('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xedac('0x4'))['db'];var utils=require(_0xedac('0x5'));var logger=require(_0xedac('0x6'))(_0xedac('0x7'));var config=require('../../config/environment');var jayson=require(_0xedac('0x8'));var client=jayson[_0xedac('0x9')][_0xedac('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ecbd3,_0x4081c6,_0x21440e){return new BPromise(function(_0x162eea,_0x53fa43){return client[_0xedac('0xb')](_0x5ecbd3,_0x21440e)[_0xedac('0xc')](function(_0xc98887){logger['info']('Tag,\x20%s,\x20%s',_0x4081c6,_0xedac('0xd'));logger[_0xedac('0xe')]('Tag,\x20%s,\x20%s,\x20%s',_0x4081c6,'request\x20sent',JSON[_0xedac('0xf')](_0xc98887));if(_0xc98887[_0xedac('0x10')]){if(_0xc98887['error'][_0xedac('0x11')]===0x1f4){logger['error'](_0xedac('0x12'),_0x4081c6,_0xc98887[_0xedac('0x10')][_0xedac('0x13')]);return _0x53fa43(_0xc98887[_0xedac('0x10')][_0xedac('0x13')]);}logger[_0xedac('0x10')](_0xedac('0x12'),_0x4081c6,_0xc98887[_0xedac('0x10')]['message']);return _0x162eea(_0xc98887[_0xedac('0x10')][_0xedac('0x13')]);}else{logger[_0xedac('0x14')](_0xedac('0x12'),_0x4081c6,_0xedac('0xd'));_0x162eea(_0xc98887['result'][_0xedac('0x13')]);}})['catch'](function(_0xddc7b8){logger[_0xedac('0x10')](_0xedac('0x12'),_0x4081c6,_0xddc7b8);_0x53fa43(_0xddc7b8);});});} \ No newline at end of file +var _0xb49a=['info','debug','Tag,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Tag,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x3e32d6,_0x37c0bb){var _0x52af90=function(_0x185bc1){while(--_0x185bc1){_0x3e32d6['push'](_0x3e32d6['shift']());}};_0x52af90(++_0x37c0bb);}(_0xb49a,0xfb));var _0xab49=function(_0x251669,_0x4cfefe){_0x251669=_0x251669-0x0;var _0x476916=_0xb49a[_0x251669];return _0x476916;};'use strict';var _=require(_0xab49('0x0'));var util=require(_0xab49('0x1'));var moment=require(_0xab49('0x2'));var BPromise=require(_0xab49('0x3'));var rs=require(_0xab49('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xab49('0x5'))['db'];var utils=require(_0xab49('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xab49('0x7'));var jayson=require(_0xab49('0x8'));var client=jayson[_0xab49('0x9')][_0xab49('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x57ea72,_0x26a98a,_0xd86a5){return new BPromise(function(_0x4d4d00,_0x15f259){return client[_0xab49('0xb')](_0x57ea72,_0xd86a5)[_0xab49('0xc')](function(_0x79f764){logger[_0xab49('0xd')]('Tag,\x20%s,\x20%s',_0x26a98a,'request\x20sent');logger[_0xab49('0xe')](_0xab49('0xf'),_0x26a98a,_0xab49('0x10'),JSON[_0xab49('0x11')](_0x79f764));if(_0x79f764[_0xab49('0x12')]){if(_0x79f764['error'][_0xab49('0x13')]===0x1f4){logger[_0xab49('0x12')](_0xab49('0x14'),_0x26a98a,_0x79f764[_0xab49('0x12')][_0xab49('0x15')]);return _0x15f259(_0x79f764[_0xab49('0x12')][_0xab49('0x15')]);}logger[_0xab49('0x12')](_0xab49('0x14'),_0x26a98a,_0x79f764[_0xab49('0x12')][_0xab49('0x15')]);return _0x4d4d00(_0x79f764['error'][_0xab49('0x15')]);}else{logger[_0xab49('0xd')](_0xab49('0x14'),_0x26a98a,_0xab49('0x10'));_0x4d4d00(_0x79f764[_0xab49('0x16')]['message']);}})[_0xab49('0x17')](function(_0x2cbcff){logger[_0xab49('0x12')](_0xab49('0x14'),_0x26a98a,_0x2cbcff);_0x15f259(_0x2cbcff);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 708ead1..2acf98e 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 _0x1aab=['util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./team.controller','get','index','/:id','/:id/queues','isAuthenticated','getQueues','/:id/users','getAgents','create','post','addQueues','addAgents','update','delete','removeAgents','exports','multer'];(function(_0x544d4a,_0x52bcb1){var _0x5d0285=function(_0x1c12ae){while(--_0x1c12ae){_0x544d4a['push'](_0x544d4a['shift']());}};_0x5d0285(++_0x52bcb1);}(_0x1aab,0x1df));var _0xb1aa=function(_0x40c7ea,_0x3e213a){_0x40c7ea=_0x40c7ea-0x0;var _0x3ccf63=_0x1aab[_0x40c7ea];return _0x3ccf63;};'use strict';var multer=require(_0xb1aa('0x0'));var util=require(_0xb1aa('0x1'));var path=require('path');var timeout=require(_0xb1aa('0x2'));var express=require(_0xb1aa('0x3'));var router=express[_0xb1aa('0x4')]();var auth=require(_0xb1aa('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb1aa('0x6'));var controller=require(_0xb1aa('0x7'));router[_0xb1aa('0x8')]('/',auth['isAuthenticated'](),controller[_0xb1aa('0x9')]);router[_0xb1aa('0x8')](_0xb1aa('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xb1aa('0x8')](_0xb1aa('0xb'),auth[_0xb1aa('0xc')](),controller[_0xb1aa('0xd')]);router[_0xb1aa('0x8')](_0xb1aa('0xe'),auth['isAuthenticated'](),controller[_0xb1aa('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb1aa('0x10')]);router[_0xb1aa('0x11')](_0xb1aa('0xb'),auth[_0xb1aa('0xc')](),controller[_0xb1aa('0x12')]);router[_0xb1aa('0x11')](_0xb1aa('0xe'),auth[_0xb1aa('0xc')](),controller[_0xb1aa('0x13')]);router['put'](_0xb1aa('0xa'),auth[_0xb1aa('0xc')](),controller[_0xb1aa('0x14')]);router[_0xb1aa('0x15')](_0xb1aa('0xa'),auth[_0xb1aa('0xc')](),controller['destroy']);router[_0xb1aa('0x15')]('/:id/queues',auth['isAuthenticated'](),controller['removeQueues']);router[_0xb1aa('0x15')]('/:id/users',auth[_0xb1aa('0xc')](),controller[_0xb1aa('0x16')]);module[_0xb1aa('0x17')]=router; \ No newline at end of file +var _0xa99b=['getAgents','post','create','/:id/queues','addAgents','put','update','destroy','delete','removeQueues','exports','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./team.controller','get','isAuthenticated','index','/:id','getQueues','/:id/users'];(function(_0x3f4be1,_0x4518a6){var _0x257862=function(_0x480936){while(--_0x480936){_0x3f4be1['push'](_0x3f4be1['shift']());}};_0x257862(++_0x4518a6);}(_0xa99b,0x1eb));var _0xba99=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0xa99b[_0x13b8f3];return _0x1a6d06;};'use strict';var multer=require('multer');var util=require(_0xba99('0x0'));var path=require(_0xba99('0x1'));var timeout=require(_0xba99('0x2'));var express=require('express');var router=express[_0xba99('0x3')]();var auth=require(_0xba99('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xba99('0x5'));var controller=require(_0xba99('0x6'));router[_0xba99('0x7')]('/',auth[_0xba99('0x8')](),controller[_0xba99('0x9')]);router[_0xba99('0x7')](_0xba99('0xa'),auth['isAuthenticated'](),controller['show']);router['get']('/:id/queues',auth[_0xba99('0x8')](),controller[_0xba99('0xb')]);router[_0xba99('0x7')](_0xba99('0xc'),auth[_0xba99('0x8')](),controller[_0xba99('0xd')]);router[_0xba99('0xe')]('/',auth[_0xba99('0x8')](),controller[_0xba99('0xf')]);router[_0xba99('0xe')](_0xba99('0x10'),auth['isAuthenticated'](),controller['addQueues']);router[_0xba99('0xe')](_0xba99('0xc'),auth[_0xba99('0x8')](),controller[_0xba99('0x11')]);router[_0xba99('0x12')](_0xba99('0xa'),auth[_0xba99('0x8')](),controller[_0xba99('0x13')]);router['delete'](_0xba99('0xa'),auth[_0xba99('0x8')](),controller[_0xba99('0x14')]);router[_0xba99('0x15')](_0xba99('0x10'),auth[_0xba99('0x8')](),controller[_0xba99('0x16')]);router[_0xba99('0x15')](_0xba99('0xc'),auth[_0xba99('0x8')](),controller['removeAgents']);module[_0xba99('0x17')]=router; \ No newline at end of file diff --git a/server/api/team/team.attributes.js b/server/api/team/team.attributes.js index b414ac1..b5d9c39 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 _0xa66f=['sequelize','exports','name','STRING'];(function(_0x5da82e,_0x58a6bd){var _0x393ad4=function(_0x47bec9){while(--_0x47bec9){_0x5da82e['push'](_0x5da82e['shift']());}};_0x393ad4(++_0x58a6bd);}(_0xa66f,0xc4));var _0xfa66=function(_0x49ebc2,_0x2476ef){_0x49ebc2=_0x49ebc2-0x0;var _0x1de9e7=_0xa66f[_0x49ebc2];return _0x1de9e7;};'use strict';var Sequelize=require(_0xfa66('0x0'));module[_0xfa66('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xfa66('0x2')},'description':{'type':Sequelize[_0xfa66('0x3')]}}; \ No newline at end of file +var _0x2c04=['exports','STRING','name','sequelize'];(function(_0x284914,_0x43de73){var _0x3480c1=function(_0x53e244){while(--_0x53e244){_0x284914['push'](_0x284914['shift']());}};_0x3480c1(++_0x43de73);}(_0x2c04,0x1af));var _0x42c0=function(_0x48afe9,_0x48dd4a){_0x48afe9=_0x48afe9-0x0;var _0x12d252=_0x2c04[_0x48afe9];return _0x12d252;};'use strict';var Sequelize=require(_0x42c0('0x0'));module[_0x42c0('0x1')]={'name':{'type':Sequelize[_0x42c0('0x2')],'allowNull':![],'unique':_0x42c0('0x3')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index cb9a6f1..d41c015 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 _0x7708=['body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','isValidChannel','channel','Sequelize','Unknown\x20channel','capitalize','Queue','length','toLowerCase','Queues','ValidationError','add','ids','removeQueues','remove','addAgents','Voice','Chat','Mail','Sms','Openchannel','each','interface','UserVoiceQueueRt','format','spread','userTeam:save','removeAgents','voice','chat','mail','fax','isArray','userTeam:remove','getAgents','html-pdf','eml-format','zip-dir','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./team.socket','register','sendStatus','status','count','offset','limit','Content-Range','json','reject','save','update','then','get','Teams','UserProfileResource','destroy','end','error','name','send','index','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','key','field','filter','merge','options','includeAll','Team','findAll','catch','show','params','include','create'];(function(_0x1acc73,_0x132f64){var _0xa43755=function(_0x4f0187){while(--_0x4f0187){_0x1acc73['push'](_0x1acc73['shift']());}};_0xa43755(++_0x132f64);}(_0x7708,0x188));var _0x8770=function(_0x237da8,_0x37b77a){_0x237da8=_0x237da8-0x0;var _0x558825=_0x7708[_0x237da8];return _0x558825;};'use strict';var pdf=require(_0x8770('0x0'));var emlformat=require(_0x8770('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x8770('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8770('0x3'));var util=require(_0x8770('0x4'));var path=require('path');var sox=require(_0x8770('0x5'));var csv=require('to-csv');var ejs=require(_0x8770('0x6'));var fs=require('fs');var _=require(_0x8770('0x7'));var squel=require(_0x8770('0x8'));var crypto=require(_0x8770('0x9'));var jsforce=require(_0x8770('0xa'));var deskjs=require(_0x8770('0xb'));var toCsv=require(_0x8770('0xc'));var querystring=require('querystring');var Papa=require(_0x8770('0xd'));var Redis=require(_0x8770('0xe'));var authService=require(_0x8770('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x8770('0x10'));var hardwareService=require(_0x8770('0x11'));var logger=require(_0x8770('0x12'))(_0x8770('0x13'));var utils=require('../../config/utils');var config=require(_0x8770('0x14'));var db=require(_0x8770('0x15'))['db'];config[_0x8770('0x16')]=_['defaults'](config[_0x8770('0x16')],{'host':_0x8770('0x17'),'port':0x18eb});var socket=require(_0x8770('0x18'))(new Redis(config[_0x8770('0x16')]));require(_0x8770('0x19'))[_0x8770('0x1a')](socket);function respondWithStatusCode(_0x1ce41d,_0x12439f){_0x12439f=_0x12439f||0xcc;return function(_0x5514b5){if(_0x5514b5){return _0x1ce41d[_0x8770('0x1b')](_0x12439f);}return _0x1ce41d[_0x8770('0x1c')](_0x12439f)['end']();};}function respondWithResult(_0x2f7918,_0x52254f){_0x52254f=_0x52254f||0xc8;return function(_0x1c8ab6){if(_0x1c8ab6){return _0x2f7918['status'](_0x52254f)['json'](_0x1c8ab6);}};}function respondWithFilteredResult(_0x50ff57,_0x155e83){return function(_0x3b459a){if(_0x3b459a){var _0x17b634=_0x3b459a[_0x8770('0x1d')],_0xe0d611=_0x155e83[_0x8770('0x1e')],_0x4b0691=_0x155e83[_0x8770('0x1e')]+_0x155e83[_0x8770('0x1f')],_0x550be9;if(_0x4b0691>=_0x17b634){_0x4b0691=_0x17b634;_0x550be9=0xc8;}else{_0x550be9=0xce;}_0x50ff57[_0x8770('0x1c')](_0x550be9);return _0x50ff57['set'](_0x8770('0x20'),_0xe0d611+'-'+_0x4b0691+'/'+_0x17b634)[_0x8770('0x21')](_0x3b459a);}return null;};}function patchUpdates(_0x384b1e){return function(_0xe1cba5){try{jsonpatch['apply'](_0xe1cba5,_0x384b1e,!![]);}catch(_0x5e6709){return BPromise[_0x8770('0x22')](_0x5e6709);}return _0xe1cba5[_0x8770('0x23')]();};}function saveUpdates(_0x443716,_0x2918a7){return function(_0x2760b2){if(_0x2760b2){return _0x2760b2[_0x8770('0x24')](_0x443716)['then'](function(_0x468fc0){return _0x468fc0;});}return null;};}function removeEntity(_0x23ad66,_0x4274dd){return function(_0x2515c5){if(_0x2515c5){return _0x2515c5['destroy']()[_0x8770('0x25')](function(){var _0x5e92e1=_0x2515c5[_0x8770('0x26')]({'plain':!![]});var _0x453804=_0x8770('0x27');return db[_0x8770('0x28')][_0x8770('0x29')]({'where':{'type':_0x453804,'resourceId':_0x5e92e1['id']}})[_0x8770('0x25')](function(){return _0x2515c5;});})[_0x8770('0x25')](function(){_0x23ad66[_0x8770('0x1c')](0xcc)[_0x8770('0x2a')]();});}};}function handleEntityNotFound(_0xa480,_0x5f4973){return function(_0x1a7440){if(!_0x1a7440){_0xa480[_0x8770('0x1b')](0x194);}return _0x1a7440;};}function handleError(_0x1df627,_0x5c7bd){_0x5c7bd=_0x5c7bd||0x1f4;return function(_0x246128){logger[_0x8770('0x2b')](_0x246128['stack']);if(_0x246128['name']){delete _0x246128[_0x8770('0x2c')];}_0x1df627[_0x8770('0x1c')](_0x5c7bd)[_0x8770('0x2d')](_0x246128);};}exports[_0x8770('0x2e')]=function(_0x23f4b0,_0x4bc072){var _0x5282dd={},_0x45fff4={},_0x144c24={'count':0x0,'rows':[]};var _0x9d798a=_[_0x8770('0x2f')](db['Team'][_0x8770('0x30')],function(_0x501741){return{'name':_0x501741['fieldName'],'type':_0x501741[_0x8770('0x31')]['key']};});_0x45fff4[_0x8770('0x32')]=_[_0x8770('0x2f')](_0x9d798a,_0x8770('0x2c'));_0x45fff4[_0x8770('0x33')]=_[_0x8770('0x34')](_0x23f4b0[_0x8770('0x33')]);_0x45fff4[_0x8770('0x35')]=_[_0x8770('0x36')](_0x45fff4[_0x8770('0x32')],_0x45fff4['query']);_0x5282dd[_0x8770('0x37')]=_[_0x8770('0x36')](_0x45fff4[_0x8770('0x32')],qs['fields'](_0x23f4b0['query'][_0x8770('0x38')]));_0x5282dd[_0x8770('0x37')]=_0x5282dd[_0x8770('0x37')]['length']?_0x5282dd[_0x8770('0x37')]:_0x45fff4['model'];if(!_0x23f4b0[_0x8770('0x33')][_0x8770('0x39')](_0x8770('0x3a'))){_0x5282dd[_0x8770('0x1f')]=qs[_0x8770('0x1f')](_0x23f4b0[_0x8770('0x33')][_0x8770('0x1f')]);_0x5282dd[_0x8770('0x1e')]=qs[_0x8770('0x1e')](_0x23f4b0[_0x8770('0x33')]['offset']);}_0x5282dd[_0x8770('0x3b')]=qs[_0x8770('0x3c')](_0x23f4b0[_0x8770('0x33')]['sort']);_0x5282dd[_0x8770('0x3d')]=qs[_0x8770('0x35')](_[_0x8770('0x3e')](_0x23f4b0[_0x8770('0x33')],_0x45fff4[_0x8770('0x35')]));if(_0x23f4b0[_0x8770('0x33')]['filter']){_0x5282dd[_0x8770('0x3d')]=_['merge'](_0x5282dd[_0x8770('0x3d')],{'$or':_['map'](_0x9d798a,function(_0x41134a){if(_0x41134a[_0x8770('0x31')][_0x8770('0x3f')]!=='VIRTUAL'){var _0x13a909={};_0x13a909[_0x41134a[_0x8770('0x40')]]={'$like':'%'+_0x23f4b0[_0x8770('0x33')][_0x8770('0x41')]+'%'};return _0x13a909;}})});}_0x5282dd=_[_0x8770('0x42')]({},_0x5282dd,_0x23f4b0[_0x8770('0x43')]);var _0x5b4fdd={'where':_0x5282dd[_0x8770('0x3d')]};return db['Team']['count'](_0x5b4fdd)[_0x8770('0x25')](function(_0x984748){_0x144c24[_0x8770('0x1d')]=_0x984748;if(_0x23f4b0[_0x8770('0x33')][_0x8770('0x44')]){_0x5282dd['include']=[{'all':!![]}];}return db[_0x8770('0x45')][_0x8770('0x46')](_0x5282dd);})['then'](function(_0x412abb){_0x144c24['rows']=_0x412abb;return _0x144c24;})[_0x8770('0x25')](respondWithFilteredResult(_0x4bc072,_0x5282dd))[_0x8770('0x47')](handleError(_0x4bc072,null));};exports[_0x8770('0x48')]=function(_0x39c0d3,_0x29dae5){var _0x1b390d={'raw':![],'where':{'id':_0x39c0d3[_0x8770('0x49')]['id']}},_0x72166b={};_0x72166b[_0x8770('0x32')]=_[_0x8770('0x34')](db[_0x8770('0x45')]['rawAttributes']);_0x72166b[_0x8770('0x33')]=_[_0x8770('0x34')](_0x39c0d3[_0x8770('0x33')]);_0x72166b[_0x8770('0x35')]=_[_0x8770('0x36')](_0x72166b[_0x8770('0x32')],_0x72166b['query']);_0x1b390d[_0x8770('0x37')]=_[_0x8770('0x36')](_0x72166b[_0x8770('0x32')],qs[_0x8770('0x38')](_0x39c0d3[_0x8770('0x33')][_0x8770('0x38')]));_0x1b390d[_0x8770('0x37')]=_0x1b390d[_0x8770('0x37')]['length']?_0x1b390d[_0x8770('0x37')]:_0x72166b[_0x8770('0x32')];if(_0x39c0d3[_0x8770('0x33')][_0x8770('0x44')]){_0x1b390d[_0x8770('0x4a')]=[{'all':!![]}];}_0x1b390d=_['merge']({},_0x1b390d,_0x39c0d3['options']);return db[_0x8770('0x45')]['find'](_0x1b390d)[_0x8770('0x25')](handleEntityNotFound(_0x29dae5,null))['then'](respondWithResult(_0x29dae5,null))['catch'](handleError(_0x29dae5,null));};exports[_0x8770('0x4b')]=function(_0x1de80e,_0x13b0f2){return db[_0x8770('0x45')]['create'](_0x1de80e[_0x8770('0x4c')],{})[_0x8770('0x25')](function(_0x598aaa){var _0x4d8bde=_0x1de80e[_0x8770('0x4d')][_0x8770('0x26')]({'plain':!![]});if(!_0x4d8bde)throw new Error(_0x8770('0x4e'));if(_0x4d8bde['role']===_0x8770('0x4d')){var _0x5b6638=_0x598aaa[_0x8770('0x26')]({'plain':!![]});var _0x3841bb=_0x8770('0x27');return db['UserProfileSection'][_0x8770('0x4f')]({'where':{'name':_0x3841bb,'userProfileId':_0x4d8bde['userProfileId']},'raw':!![]})['then'](function(_0x4cfacb){if(_0x4cfacb&&_0x4cfacb[_0x8770('0x50')]===0x0){return db[_0x8770('0x28')][_0x8770('0x4b')]({'name':_0x5b6638[_0x8770('0x2c')],'resourceId':_0x5b6638['id'],'type':_0x4cfacb[_0x8770('0x2c')],'sectionId':_0x4cfacb['id']},{})[_0x8770('0x25')](function(){return _0x598aaa;});}else{return _0x598aaa;}})['catch'](function(_0x20aed8){logger['error'](_0x8770('0x51'),_0x20aed8);throw _0x20aed8;});}return _0x598aaa;})[_0x8770('0x25')](respondWithResult(_0x13b0f2,0xc9))[_0x8770('0x47')](handleError(_0x13b0f2,null));};exports[_0x8770('0x24')]=function(_0x5b5cce,_0x1d17b7){if(_0x5b5cce[_0x8770('0x4c')]['id']){delete _0x5b5cce['body']['id'];}return db['Team']['find']({'where':{'id':_0x5b5cce['params']['id']}})[_0x8770('0x25')](handleEntityNotFound(_0x1d17b7,null))[_0x8770('0x25')](saveUpdates(_0x5b5cce['body'],null))[_0x8770('0x25')](respondWithResult(_0x1d17b7,null))[_0x8770('0x47')](handleError(_0x1d17b7,null));};exports[_0x8770('0x29')]=function(_0x35340d,_0x217c9f){return db[_0x8770('0x45')][_0x8770('0x4f')]({'where':{'id':_0x35340d[_0x8770('0x49')]['id']}})[_0x8770('0x25')](handleEntityNotFound(_0x217c9f,null))[_0x8770('0x25')](removeEntity(_0x217c9f,null))[_0x8770('0x47')](handleError(_0x217c9f,null));};exports['getQueues']=function(_0x141c32,_0x255afb,_0x25dc3d){return db['Team'][_0x8770('0x52')]({'where':{'id':_0x141c32[_0x8770('0x49')]['id']}})[_0x8770('0x25')](handleEntityNotFound(_0x255afb,null))['then'](function(_0x2aecc0){if(!_0x141c32[_0x8770('0x33')]['channel']||!utils[_0x8770('0x53')](_0x141c32['query'][_0x8770('0x54')])){throw new db[(_0x8770('0x55'))]['ValidationError'](_0x8770('0x56'));}var _0x258316={};var _0x306586={};_0x306586[_0x8770('0x32')]=_[_0x8770('0x34')](db[_[_0x8770('0x57')](_0x141c32[_0x8770('0x33')][_0x8770('0x54')]['toLowerCase']())+_0x8770('0x58')][_0x8770('0x30')]);_0x306586['query']=_['keys'](_0x141c32[_0x8770('0x33')]);_0x306586['filters']=_[_0x8770('0x36')](_0x306586[_0x8770('0x32')],_0x306586['query']);_0x258316[_0x8770('0x37')]=_[_0x8770('0x36')](_0x306586[_0x8770('0x32')],qs[_0x8770('0x38')](_0x141c32[_0x8770('0x33')][_0x8770('0x38')]));_0x258316[_0x8770('0x37')]=_0x258316[_0x8770('0x37')][_0x8770('0x59')]?_0x258316[_0x8770('0x37')]:_0x306586[_0x8770('0x32')];_0x258316[_0x8770('0x1f')]=qs[_0x8770('0x1f')](_0x141c32['query'][_0x8770('0x1f')]);_0x258316[_0x8770('0x1e')]=qs[_0x8770('0x1e')](_0x141c32[_0x8770('0x33')][_0x8770('0x1e')]);_0x258316[_0x8770('0x3b')]=qs[_0x8770('0x3c')](_0x141c32[_0x8770('0x33')][_0x8770('0x3c')]);_0x258316['where']=qs[_0x8770('0x35')](_[_0x8770('0x3e')](_0x141c32[_0x8770('0x33')],_0x306586['filters']));_0x258316=_[_0x8770('0x42')]({},_0x258316,_0x141c32[_0x8770('0x43')]);return _0x2aecc0['get'+_[_0x8770('0x57')](_0x141c32[_0x8770('0x33')][_0x8770('0x54')][_0x8770('0x5a')]())+_0x8770('0x5b')](_0x258316);})['then'](respondWithResult(_0x255afb,null))[_0x8770('0x47')](handleError(_0x255afb,null));};exports['addQueues']=function(_0x2a45c8,_0x43a87c,_0x272862){return db[_0x8770('0x45')][_0x8770('0x52')]({'where':{'id':_0x2a45c8[_0x8770('0x49')]['id']}})[_0x8770('0x25')](function(_0x372c0c){if(_0x372c0c){if(!_0x2a45c8[_0x8770('0x4c')]['channel']||!utils[_0x8770('0x53')](_0x2a45c8[_0x8770('0x4c')][_0x8770('0x54')])){throw new db[(_0x8770('0x55'))][(_0x8770('0x5c'))](_0x8770('0x56'));}return _0x372c0c[_0x8770('0x5d')+_[_0x8770('0x57')](_0x2a45c8[_0x8770('0x4c')]['channel']['toLowerCase']())+_0x8770('0x5b')](_0x2a45c8['body'][_0x8770('0x5e')]);}return null;})['then'](handleEntityNotFound(_0x43a87c,null))['then'](respondWithStatusCode(_0x43a87c,null))['catch'](handleError(_0x43a87c,null));};exports[_0x8770('0x5f')]=function(_0x2cf610,_0x405272,_0x240467){return db[_0x8770('0x45')][_0x8770('0x52')]({'where':{'id':_0x2cf610[_0x8770('0x49')]['id']}})[_0x8770('0x25')](function(_0x8294ce){if(_0x8294ce){if(!_0x2cf610[_0x8770('0x33')][_0x8770('0x54')]||!utils[_0x8770('0x53')](_0x2cf610[_0x8770('0x33')][_0x8770('0x54')])){throw new db[(_0x8770('0x55'))][(_0x8770('0x5c'))]('Unknown\x20channel');}return _0x8294ce[_0x8770('0x60')+_[_0x8770('0x57')](_0x2cf610[_0x8770('0x33')][_0x8770('0x54')][_0x8770('0x5a')]())+_0x8770('0x5b')](_0x2cf610[_0x8770('0x33')][_0x8770('0x5e')]);}return null;})[_0x8770('0x25')](handleEntityNotFound(_0x405272,null))[_0x8770('0x25')](respondWithStatusCode(_0x405272,null))[_0x8770('0x47')](handleError(_0x405272,null));};exports[_0x8770('0x61')]=function(_0x433c8f,_0x487449,_0x4e92cf){return db['Team'][_0x8770('0x4f')]({'where':{'id':_0x433c8f[_0x8770('0x49')]['id']}})['then'](handleEntityNotFound(_0x487449,null))[_0x8770('0x25')](function(_0x953b01){if(_0x953b01){var _0x3ebea6=[_0x8770('0x62'),_0x8770('0x63'),_0x8770('0x64'),_0x8770('0x65'),'Fax',_0x8770('0x66')];return BPromise[_0x8770('0x67')](_0x3ebea6,function(_0xf5ef52){return _0x953b01['get'+_0xf5ef52+_0x8770('0x5b')]({'attributes':['id',_0x8770('0x2c')]})[_0x8770('0x25')](function(_0x1306d4){return BPromise[_0x8770('0x67')](_0x1306d4,function(_0xf95c81){return _0xf95c81[_0x8770('0x61')](_0x433c8f[_0x8770('0x4c')][_0x8770('0x5e')])[_0x8770('0x25')](function(){if(_0xf5ef52==='Voice'){return db['User'][_0x8770('0x46')]({'where':{'id':_0x433c8f[_0x8770('0x4c')][_0x8770('0x5e')]},'attributes':['id',_0x8770('0x2c'),'online','voicePause',_0x8770('0x68')],'raw':!![]})['then'](function(_0x307db8){return BPromise['each'](_[_0x8770('0x41')](_0x307db8,{'online':0x1}),function(_0xb6193a){return db[_0x8770('0x69')]['upsert']({'membername':_0xb6193a[_0x8770('0x2c')],'UserId':_0xb6193a['id'],'queue_name':_0xf95c81['name'],'VoiceQueueId':_0xf95c81['id'],'interface':_['isNil'](_0xb6193a[_0x8770('0x68')])?util[_0x8770('0x6a')]('SIP/%s',_0xb6193a[_0x8770('0x2c')]):_0xb6193a[_0x8770('0x68')],'paused':_0xb6193a['voicePause']||![],'penalty':0x0});});});}});});})[_0x8770('0x25')](function(){return _0x953b01;});})['then'](function(){return _0x953b01;});}})[_0x8770('0x25')](function(_0x4f7870){if(_0x4f7870){return _0x4f7870['addAgents'](_0x433c8f[_0x8770('0x4c')][_0x8770('0x5e')],_['omit'](_0x433c8f['body'],[_0x8770('0x5e'),'id'])||{})[_0x8770('0x6b')](function(_0x51b829){for(var _0x2b93ec=0x0;_0x2b93ec<_0x433c8f['body'][_0x8770('0x5e')][_0x8770('0x59')];_0x2b93ec+=0x1){socket['emit'](_0x8770('0x6c'),{'UserId':_0x433c8f[_0x8770('0x4c')][_0x8770('0x5e')][_0x2b93ec],'TeamId':_0x433c8f['params']['id']});}return _0x51b829;});}})[_0x8770('0x25')](respondWithResult(_0x487449,null))['catch'](handleError(_0x487449,null));};exports[_0x8770('0x6d')]=function(_0x47d45f,_0x2d2caf,_0x2464c4){return db[_0x8770('0x45')]['find']({'where':{'id':_0x47d45f[_0x8770('0x49')]['id']}})['then'](handleEntityNotFound(_0x2d2caf,null))[_0x8770('0x25')](function(_0x54e8f2){if(_0x54e8f2){return BPromise[_0x8770('0x67')]([_0x8770('0x6e'),_0x8770('0x6f'),_0x8770('0x70'),'sms',_0x8770('0x71'),'openchannel'],function(_0x4478d0){return _0x54e8f2[_0x8770('0x26')+_[_0x8770('0x57')](_0x4478d0)+_0x8770('0x5b')]({'attributes':['id',_0x8770('0x2c')]})['then'](function(_0x22559b){return BPromise['each'](_0x22559b,function(_0x37cc36){return _0x37cc36[_0x8770('0x6d')](_0x47d45f[_0x8770('0x33')]['ids'])['then'](function(){if(_0x4478d0==='voice'){return db[_0x8770('0x69')][_0x8770('0x29')]({'where':{'VoiceQueueId':_0x37cc36['id'],'UserId':_0x47d45f['query'][_0x8770('0x5e')]}});}});});})[_0x8770('0x25')](function(){return _0x54e8f2;});})[_0x8770('0x25')](function(){return _0x54e8f2;});}})[_0x8770('0x25')](function(_0x581b7b){if(_0x581b7b){return _0x581b7b['removeAgents'](_0x47d45f[_0x8770('0x33')]['ids'])[_0x8770('0x25')](function(){if(_[_0x8770('0x72')](_0x47d45f[_0x8770('0x33')][_0x8770('0x5e')])){for(var _0x225353=0x0;_0x225353<_0x47d45f[_0x8770('0x33')][_0x8770('0x5e')]['length'];_0x225353+=0x1){socket['emit'](_0x8770('0x73'),{'UserId':Number(_0x47d45f[_0x8770('0x33')][_0x8770('0x5e')][_0x225353]),'TeamId':Number(_0x47d45f[_0x8770('0x49')]['id'])});}}else{socket['emit'](_0x8770('0x73'),{'UserId':Number(_0x47d45f[_0x8770('0x33')][_0x8770('0x5e')]),'TeamId':Number(_0x47d45f['params']['id'])});}});}})[_0x8770('0x25')](respondWithStatusCode(_0x2d2caf,null))[_0x8770('0x47')](handleError(_0x2d2caf,null));};exports[_0x8770('0x74')]=function(_0x8b243b,_0x2f8f31,_0x384eaa){var _0x4039ba={};var _0x5c02e6={};var _0x65bcd4;var _0x9108db;return db[_0x8770('0x45')][_0x8770('0x52')]({'where':{'id':_0x8b243b[_0x8770('0x49')]['id']}})[_0x8770('0x25')](handleEntityNotFound(_0x2f8f31,null))[_0x8770('0x25')](function(_0x690a0e){if(_0x690a0e){_0x65bcd4=_0x690a0e;_0x5c02e6[_0x8770('0x32')]=_[_0x8770('0x34')](db['User'][_0x8770('0x30')]);_0x5c02e6[_0x8770('0x33')]=_[_0x8770('0x34')](_0x8b243b['query']);_0x5c02e6['filters']=_[_0x8770('0x36')](_0x5c02e6[_0x8770('0x32')],_0x5c02e6[_0x8770('0x33')]);_0x4039ba[_0x8770('0x37')]=_[_0x8770('0x36')](_0x5c02e6[_0x8770('0x32')],qs[_0x8770('0x38')](_0x8b243b[_0x8770('0x33')][_0x8770('0x38')]));_0x4039ba[_0x8770('0x37')]=_0x4039ba[_0x8770('0x37')][_0x8770('0x59')]?_0x4039ba[_0x8770('0x37')]:_0x5c02e6['model'];_0x4039ba[_0x8770('0x3b')]=qs[_0x8770('0x3c')](_0x8b243b[_0x8770('0x33')][_0x8770('0x3c')]);_0x4039ba[_0x8770('0x3d')]=qs['filters'](_[_0x8770('0x3e')](_0x8b243b['query'],_0x5c02e6[_0x8770('0x35')]));if(_0x8b243b[_0x8770('0x33')][_0x8770('0x41')]){_0x4039ba[_0x8770('0x3d')]=_[_0x8770('0x42')](_0x4039ba[_0x8770('0x3d')],{'$or':_[_0x8770('0x2f')](_0x4039ba[_0x8770('0x37')],function(_0x4c9e55){var _0x4f5249={};_0x4f5249[_0x4c9e55]={'$like':'%'+_0x8b243b['query'][_0x8770('0x41')]+'%'};return _0x4f5249;})});}_0x4039ba=_[_0x8770('0x42')]({},_0x4039ba,_0x8b243b[_0x8770('0x43')]);return _0x65bcd4[_0x8770('0x74')](_0x4039ba);}})['then'](function(_0x2696c9){if(_0x2696c9){_0x9108db=_0x2696c9[_0x8770('0x59')];if(!_0x8b243b[_0x8770('0x33')][_0x8770('0x39')](_0x8770('0x3a'))){_0x4039ba[_0x8770('0x1f')]=qs[_0x8770('0x1f')](_0x8b243b[_0x8770('0x33')][_0x8770('0x1f')]);_0x4039ba[_0x8770('0x1e')]=qs['offset'](_0x8b243b[_0x8770('0x33')][_0x8770('0x1e')]);}return _0x65bcd4['getAgents'](_0x4039ba);}})[_0x8770('0x25')](function(_0x3f6b63){if(_0x3f6b63){return _0x3f6b63?{'count':_0x9108db,'rows':_0x3f6b63}:null;}})['then'](respondWithResult(_0x2f8f31,null))[_0x8770('0x47')](handleError(_0x2f8f31,null));}; \ No newline at end of file +var _0x4024=['SIP/%s','spread','emit','userTeam:save','removeAgents','voice','mail','sms','fax','openchannel','UserVoiceQueueRt','userTeam:remove','getAgents','nolimit','html-pdf','eml-format','zip-dir','fast-json-patch','moment','mustache','util','to-csv','ejs','lodash','crypto','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./team.socket','register','sendStatus','status','end','json','count','offset','limit','set','apply','reject','update','then','destroy','Teams','UserProfileResource','stack','name','send','index','map','Team','rawAttributes','fieldName','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','filters','filter','merge','where','type','VIRTUAL','options','include','findAll','rows','catch','show','includeAll','find','create','body','user','get','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','getQueues','findOne','channel','isValidChannel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','pick','Queues','addQueues','Sequelize','add','remove','ids','addAgents','Chat','Sms','Openchannel','each','Voice','User','online','voicePause','interface','upsert','isNil','format'];(function(_0x21cea8,_0x603460){var _0x38ec91=function(_0x34a977){while(--_0x34a977){_0x21cea8['push'](_0x21cea8['shift']());}};_0x38ec91(++_0x603460);}(_0x4024,0x89));var _0x4402=function(_0xd50dff,_0x25a0d9){_0xd50dff=_0xd50dff-0x0;var _0x1b60b3=_0x4024[_0xd50dff];return _0x1b60b3;};'use strict';var pdf=require(_0x4402('0x0'));var emlformat=require(_0x4402('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x4402('0x2'));var jsonpatch=require(_0x4402('0x3'));var rp=require('request-promise');var moment=require(_0x4402('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4402('0x5'));var util=require(_0x4402('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x4402('0x7'));var ejs=require(_0x4402('0x8'));var fs=require('fs');var _=require(_0x4402('0x9'));var squel=require('squel');var crypto=require(_0x4402('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4402('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4402('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x4402('0xc'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4402('0xd'));var logger=require('../../config/logger')(_0x4402('0xe'));var utils=require(_0x4402('0xf'));var config=require('../../config/environment');var db=require(_0x4402('0x10'))['db'];config[_0x4402('0x11')]=_[_0x4402('0x12')](config['redis'],{'host':_0x4402('0x13'),'port':0x18eb});var socket=require(_0x4402('0x14'))(new Redis(config[_0x4402('0x11')]));require(_0x4402('0x15'))[_0x4402('0x16')](socket);function respondWithStatusCode(_0x31710c,_0x18c7a8){_0x18c7a8=_0x18c7a8||0xcc;return function(_0x3c7dd2){if(_0x3c7dd2){return _0x31710c[_0x4402('0x17')](_0x18c7a8);}return _0x31710c[_0x4402('0x18')](_0x18c7a8)[_0x4402('0x19')]();};}function respondWithResult(_0xc03f65,_0x2a2ce8){_0x2a2ce8=_0x2a2ce8||0xc8;return function(_0x19fe7b){if(_0x19fe7b){return _0xc03f65[_0x4402('0x18')](_0x2a2ce8)[_0x4402('0x1a')](_0x19fe7b);}};}function respondWithFilteredResult(_0x399c24,_0x25e88b){return function(_0x186c22){if(_0x186c22){var _0x231382=_0x186c22[_0x4402('0x1b')],_0x5b127f=_0x25e88b['offset'],_0x494389=_0x25e88b[_0x4402('0x1c')]+_0x25e88b[_0x4402('0x1d')],_0x663ab7;if(_0x494389>=_0x231382){_0x494389=_0x231382;_0x663ab7=0xc8;}else{_0x663ab7=0xce;}_0x399c24['status'](_0x663ab7);return _0x399c24[_0x4402('0x1e')]('Content-Range',_0x5b127f+'-'+_0x494389+'/'+_0x231382)['json'](_0x186c22);}return null;};}function patchUpdates(_0x1b9599){return function(_0x46a1ad){try{jsonpatch[_0x4402('0x1f')](_0x46a1ad,_0x1b9599,!![]);}catch(_0x49bc21){return BPromise[_0x4402('0x20')](_0x49bc21);}return _0x46a1ad['save']();};}function saveUpdates(_0x47ab54,_0x6f1f72){return function(_0x275c70){if(_0x275c70){return _0x275c70[_0x4402('0x21')](_0x47ab54)[_0x4402('0x22')](function(_0x258d10){return _0x258d10;});}return null;};}function removeEntity(_0x2e6fee,_0x289a3e){return function(_0x6b1fc5){if(_0x6b1fc5){return _0x6b1fc5[_0x4402('0x23')]()['then'](function(){var _0x1409a9=_0x6b1fc5['get']({'plain':!![]});var _0x3733cd=_0x4402('0x24');return db[_0x4402('0x25')][_0x4402('0x23')]({'where':{'type':_0x3733cd,'resourceId':_0x1409a9['id']}})['then'](function(){return _0x6b1fc5;});})[_0x4402('0x22')](function(){_0x2e6fee['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1be54d,_0x395e49){return function(_0x327d60){if(!_0x327d60){_0x1be54d[_0x4402('0x17')](0x194);}return _0x327d60;};}function handleError(_0x3eb796,_0x514e41){_0x514e41=_0x514e41||0x1f4;return function(_0x41de44){logger['error'](_0x41de44[_0x4402('0x26')]);if(_0x41de44[_0x4402('0x27')]){delete _0x41de44[_0x4402('0x27')];}_0x3eb796['status'](_0x514e41)[_0x4402('0x28')](_0x41de44);};}exports[_0x4402('0x29')]=function(_0x316239,_0x3f4bcb){var _0x2526d1={},_0x605702={},_0x1189b8={'count':0x0,'rows':[]};var _0x435cfe=_[_0x4402('0x2a')](db[_0x4402('0x2b')][_0x4402('0x2c')],function(_0x50748c){return{'name':_0x50748c[_0x4402('0x2d')],'type':_0x50748c['type'][_0x4402('0x2e')]};});_0x605702['model']=_[_0x4402('0x2a')](_0x435cfe,_0x4402('0x27'));_0x605702[_0x4402('0x2f')]=_[_0x4402('0x30')](_0x316239[_0x4402('0x2f')]);_0x605702['filters']=_[_0x4402('0x31')](_0x605702[_0x4402('0x32')],_0x605702[_0x4402('0x2f')]);_0x2526d1['attributes']=_[_0x4402('0x31')](_0x605702[_0x4402('0x32')],qs['fields'](_0x316239[_0x4402('0x2f')][_0x4402('0x33')]));_0x2526d1[_0x4402('0x34')]=_0x2526d1[_0x4402('0x34')][_0x4402('0x35')]?_0x2526d1[_0x4402('0x34')]:_0x605702[_0x4402('0x32')];if(!_0x316239[_0x4402('0x2f')][_0x4402('0x36')]('nolimit')){_0x2526d1[_0x4402('0x1d')]=qs[_0x4402('0x1d')](_0x316239[_0x4402('0x2f')]['limit']);_0x2526d1[_0x4402('0x1c')]=qs[_0x4402('0x1c')](_0x316239['query']['offset']);}_0x2526d1[_0x4402('0x37')]=qs[_0x4402('0x38')](_0x316239[_0x4402('0x2f')][_0x4402('0x38')]);_0x2526d1['where']=qs['filters'](_['pick'](_0x316239[_0x4402('0x2f')],_0x605702[_0x4402('0x39')]));if(_0x316239[_0x4402('0x2f')][_0x4402('0x3a')]){_0x2526d1['where']=_[_0x4402('0x3b')](_0x2526d1[_0x4402('0x3c')],{'$or':_[_0x4402('0x2a')](_0x435cfe,function(_0x57843d){if(_0x57843d[_0x4402('0x3d')]['key']!==_0x4402('0x3e')){var _0x3ef31d={};_0x3ef31d[_0x57843d['field']]={'$like':'%'+_0x316239[_0x4402('0x2f')]['filter']+'%'};return _0x3ef31d;}})});}_0x2526d1=_[_0x4402('0x3b')]({},_0x2526d1,_0x316239[_0x4402('0x3f')]);var _0x5a4e88={'where':_0x2526d1[_0x4402('0x3c')]};return db[_0x4402('0x2b')][_0x4402('0x1b')](_0x5a4e88)[_0x4402('0x22')](function(_0x54e1b7){_0x1189b8['count']=_0x54e1b7;if(_0x316239[_0x4402('0x2f')]['includeAll']){_0x2526d1[_0x4402('0x40')]=[{'all':!![]}];}return db[_0x4402('0x2b')][_0x4402('0x41')](_0x2526d1);})[_0x4402('0x22')](function(_0x1894dd){_0x1189b8[_0x4402('0x42')]=_0x1894dd;return _0x1189b8;})[_0x4402('0x22')](respondWithFilteredResult(_0x3f4bcb,_0x2526d1))[_0x4402('0x43')](handleError(_0x3f4bcb,null));};exports[_0x4402('0x44')]=function(_0x42812b,_0x486e43){var _0x14b94b={'raw':![],'where':{'id':_0x42812b['params']['id']}},_0x3236fc={};_0x3236fc[_0x4402('0x32')]=_[_0x4402('0x30')](db['Team'][_0x4402('0x2c')]);_0x3236fc[_0x4402('0x2f')]=_[_0x4402('0x30')](_0x42812b[_0x4402('0x2f')]);_0x3236fc[_0x4402('0x39')]=_['intersection'](_0x3236fc[_0x4402('0x32')],_0x3236fc[_0x4402('0x2f')]);_0x14b94b[_0x4402('0x34')]=_[_0x4402('0x31')](_0x3236fc[_0x4402('0x32')],qs[_0x4402('0x33')](_0x42812b[_0x4402('0x2f')][_0x4402('0x33')]));_0x14b94b[_0x4402('0x34')]=_0x14b94b[_0x4402('0x34')][_0x4402('0x35')]?_0x14b94b['attributes']:_0x3236fc[_0x4402('0x32')];if(_0x42812b['query'][_0x4402('0x45')]){_0x14b94b[_0x4402('0x40')]=[{'all':!![]}];}_0x14b94b=_['merge']({},_0x14b94b,_0x42812b[_0x4402('0x3f')]);return db[_0x4402('0x2b')][_0x4402('0x46')](_0x14b94b)[_0x4402('0x22')](handleEntityNotFound(_0x486e43,null))[_0x4402('0x22')](respondWithResult(_0x486e43,null))[_0x4402('0x43')](handleError(_0x486e43,null));};exports['create']=function(_0xd0c9a5,_0x342941){return db[_0x4402('0x2b')][_0x4402('0x47')](_0xd0c9a5[_0x4402('0x48')],{})[_0x4402('0x22')](function(_0x43cfbd){var _0x2e3934=_0xd0c9a5[_0x4402('0x49')]['get']({'plain':!![]});if(!_0x2e3934)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2e3934['role']==='user'){var _0x257010=_0x43cfbd[_0x4402('0x4a')]({'plain':!![]});var _0x3876a9=_0x4402('0x24');return db['UserProfileSection'][_0x4402('0x46')]({'where':{'name':_0x3876a9,'userProfileId':_0x2e3934[_0x4402('0x4b')]},'raw':!![]})[_0x4402('0x22')](function(_0x2a4ea7){if(_0x2a4ea7&&_0x2a4ea7[_0x4402('0x4c')]===0x0){return db[_0x4402('0x25')][_0x4402('0x47')]({'name':_0x257010['name'],'resourceId':_0x257010['id'],'type':_0x2a4ea7[_0x4402('0x27')],'sectionId':_0x2a4ea7['id']},{})[_0x4402('0x22')](function(){return _0x43cfbd;});}else{return _0x43cfbd;}})[_0x4402('0x43')](function(_0x11c162){logger[_0x4402('0x4d')](_0x4402('0x4e'),_0x11c162);throw _0x11c162;});}return _0x43cfbd;})['then'](respondWithResult(_0x342941,0xc9))[_0x4402('0x43')](handleError(_0x342941,null));};exports[_0x4402('0x21')]=function(_0x3f45c3,_0x295c9b){if(_0x3f45c3[_0x4402('0x48')]['id']){delete _0x3f45c3[_0x4402('0x48')]['id'];}return db[_0x4402('0x2b')]['find']({'where':{'id':_0x3f45c3['params']['id']}})[_0x4402('0x22')](handleEntityNotFound(_0x295c9b,null))[_0x4402('0x22')](saveUpdates(_0x3f45c3[_0x4402('0x48')],null))['then'](respondWithResult(_0x295c9b,null))['catch'](handleError(_0x295c9b,null));};exports[_0x4402('0x23')]=function(_0x3fd3ed,_0x2d959f){return db[_0x4402('0x2b')][_0x4402('0x46')]({'where':{'id':_0x3fd3ed[_0x4402('0x4f')]['id']}})[_0x4402('0x22')](handleEntityNotFound(_0x2d959f,null))[_0x4402('0x22')](removeEntity(_0x2d959f,null))[_0x4402('0x43')](handleError(_0x2d959f,null));};exports[_0x4402('0x50')]=function(_0x353679,_0x43e876,_0x2d68d3){return db['Team'][_0x4402('0x51')]({'where':{'id':_0x353679['params']['id']}})[_0x4402('0x22')](handleEntityNotFound(_0x43e876,null))['then'](function(_0x3fb9f0){if(!_0x353679[_0x4402('0x2f')][_0x4402('0x52')]||!utils[_0x4402('0x53')](_0x353679[_0x4402('0x2f')][_0x4402('0x52')])){throw new db['Sequelize'][(_0x4402('0x54'))](_0x4402('0x55'));}var _0xa390ce={};var _0x4acb34={};_0x4acb34[_0x4402('0x32')]=_['keys'](db[_[_0x4402('0x56')](_0x353679[_0x4402('0x2f')][_0x4402('0x52')][_0x4402('0x57')]())+_0x4402('0x58')][_0x4402('0x2c')]);_0x4acb34[_0x4402('0x2f')]=_[_0x4402('0x30')](_0x353679['query']);_0x4acb34[_0x4402('0x39')]=_[_0x4402('0x31')](_0x4acb34['model'],_0x4acb34[_0x4402('0x2f')]);_0xa390ce[_0x4402('0x34')]=_['intersection'](_0x4acb34['model'],qs[_0x4402('0x33')](_0x353679[_0x4402('0x2f')][_0x4402('0x33')]));_0xa390ce['attributes']=_0xa390ce[_0x4402('0x34')][_0x4402('0x35')]?_0xa390ce[_0x4402('0x34')]:_0x4acb34['model'];_0xa390ce[_0x4402('0x1d')]=qs[_0x4402('0x1d')](_0x353679[_0x4402('0x2f')]['limit']);_0xa390ce[_0x4402('0x1c')]=qs[_0x4402('0x1c')](_0x353679['query']['offset']);_0xa390ce[_0x4402('0x37')]=qs['sort'](_0x353679[_0x4402('0x2f')][_0x4402('0x38')]);_0xa390ce['where']=qs['filters'](_[_0x4402('0x59')](_0x353679[_0x4402('0x2f')],_0x4acb34[_0x4402('0x39')]));_0xa390ce=_[_0x4402('0x3b')]({},_0xa390ce,_0x353679['options']);return _0x3fb9f0[_0x4402('0x4a')+_[_0x4402('0x56')](_0x353679[_0x4402('0x2f')][_0x4402('0x52')][_0x4402('0x57')]())+_0x4402('0x5a')](_0xa390ce);})[_0x4402('0x22')](respondWithResult(_0x43e876,null))['catch'](handleError(_0x43e876,null));};exports[_0x4402('0x5b')]=function(_0x2ee6e8,_0x559d1c,_0x508111){return db[_0x4402('0x2b')]['findOne']({'where':{'id':_0x2ee6e8[_0x4402('0x4f')]['id']}})['then'](function(_0xc2ac06){if(_0xc2ac06){if(!_0x2ee6e8[_0x4402('0x48')][_0x4402('0x52')]||!utils[_0x4402('0x53')](_0x2ee6e8[_0x4402('0x48')][_0x4402('0x52')])){throw new db[(_0x4402('0x5c'))][(_0x4402('0x54'))](_0x4402('0x55'));}return _0xc2ac06[_0x4402('0x5d')+_[_0x4402('0x56')](_0x2ee6e8[_0x4402('0x48')][_0x4402('0x52')][_0x4402('0x57')]())+_0x4402('0x5a')](_0x2ee6e8[_0x4402('0x48')]['ids']);}return null;})[_0x4402('0x22')](handleEntityNotFound(_0x559d1c,null))[_0x4402('0x22')](respondWithStatusCode(_0x559d1c,null))[_0x4402('0x43')](handleError(_0x559d1c,null));};exports['removeQueues']=function(_0x319166,_0x4a79b6,_0x23980b){return db[_0x4402('0x2b')][_0x4402('0x51')]({'where':{'id':_0x319166[_0x4402('0x4f')]['id']}})['then'](function(_0xac8513){if(_0xac8513){if(!_0x319166['query'][_0x4402('0x52')]||!utils[_0x4402('0x53')](_0x319166[_0x4402('0x2f')]['channel'])){throw new db[(_0x4402('0x5c'))]['ValidationError'](_0x4402('0x55'));}return _0xac8513[_0x4402('0x5e')+_[_0x4402('0x56')](_0x319166[_0x4402('0x2f')][_0x4402('0x52')][_0x4402('0x57')]())+_0x4402('0x5a')](_0x319166[_0x4402('0x2f')][_0x4402('0x5f')]);}return null;})['then'](handleEntityNotFound(_0x4a79b6,null))[_0x4402('0x22')](respondWithStatusCode(_0x4a79b6,null))[_0x4402('0x43')](handleError(_0x4a79b6,null));};exports[_0x4402('0x60')]=function(_0x221889,_0x4734ef,_0x10284a){return db[_0x4402('0x2b')][_0x4402('0x46')]({'where':{'id':_0x221889[_0x4402('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4734ef,null))[_0x4402('0x22')](function(_0x2a6dc1){if(_0x2a6dc1){var _0x2eae1c=['Voice',_0x4402('0x61'),'Mail',_0x4402('0x62'),'Fax',_0x4402('0x63')];return BPromise[_0x4402('0x64')](_0x2eae1c,function(_0x552962){return _0x2a6dc1[_0x4402('0x4a')+_0x552962+'Queues']({'attributes':['id',_0x4402('0x27')]})[_0x4402('0x22')](function(_0x5d6af7){return BPromise[_0x4402('0x64')](_0x5d6af7,function(_0x2df3dc){return _0x2df3dc['addAgents'](_0x221889[_0x4402('0x48')][_0x4402('0x5f')])['then'](function(){if(_0x552962===_0x4402('0x65')){return db[_0x4402('0x66')][_0x4402('0x41')]({'where':{'id':_0x221889[_0x4402('0x48')][_0x4402('0x5f')]},'attributes':['id',_0x4402('0x27'),_0x4402('0x67'),_0x4402('0x68'),_0x4402('0x69')],'raw':!![]})[_0x4402('0x22')](function(_0xac63f6){return BPromise[_0x4402('0x64')](_[_0x4402('0x3a')](_0xac63f6,{'online':0x1}),function(_0x2dd4b7){return db['UserVoiceQueueRt'][_0x4402('0x6a')]({'membername':_0x2dd4b7[_0x4402('0x27')],'UserId':_0x2dd4b7['id'],'queue_name':_0x2df3dc['name'],'VoiceQueueId':_0x2df3dc['id'],'interface':_[_0x4402('0x6b')](_0x2dd4b7['interface'])?util[_0x4402('0x6c')](_0x4402('0x6d'),_0x2dd4b7[_0x4402('0x27')]):_0x2dd4b7['interface'],'paused':_0x2dd4b7[_0x4402('0x68')]||![],'penalty':0x0});});});}});});})[_0x4402('0x22')](function(){return _0x2a6dc1;});})[_0x4402('0x22')](function(){return _0x2a6dc1;});}})['then'](function(_0x2fde94){if(_0x2fde94){return _0x2fde94[_0x4402('0x60')](_0x221889[_0x4402('0x48')][_0x4402('0x5f')],_['omit'](_0x221889[_0x4402('0x48')],[_0x4402('0x5f'),'id'])||{})[_0x4402('0x6e')](function(_0x2e9fca){for(var _0x32b58f=0x0;_0x32b58f<_0x221889[_0x4402('0x48')][_0x4402('0x5f')][_0x4402('0x35')];_0x32b58f+=0x1){socket[_0x4402('0x6f')](_0x4402('0x70'),{'UserId':_0x221889[_0x4402('0x48')][_0x4402('0x5f')][_0x32b58f],'TeamId':_0x221889[_0x4402('0x4f')]['id']});}return _0x2e9fca;});}})['then'](respondWithResult(_0x4734ef,null))[_0x4402('0x43')](handleError(_0x4734ef,null));};exports[_0x4402('0x71')]=function(_0xa58643,_0x1444fa,_0x567bcf){return db['Team'][_0x4402('0x46')]({'where':{'id':_0xa58643[_0x4402('0x4f')]['id']}})[_0x4402('0x22')](handleEntityNotFound(_0x1444fa,null))[_0x4402('0x22')](function(_0x4bdb42){if(_0x4bdb42){return BPromise[_0x4402('0x64')]([_0x4402('0x72'),'chat',_0x4402('0x73'),_0x4402('0x74'),_0x4402('0x75'),_0x4402('0x76')],function(_0x297884){return _0x4bdb42['get'+_[_0x4402('0x56')](_0x297884)+_0x4402('0x5a')]({'attributes':['id',_0x4402('0x27')]})[_0x4402('0x22')](function(_0x27c5d7){return BPromise[_0x4402('0x64')](_0x27c5d7,function(_0x20ffb6){return _0x20ffb6['removeAgents'](_0xa58643[_0x4402('0x2f')][_0x4402('0x5f')])[_0x4402('0x22')](function(){if(_0x297884===_0x4402('0x72')){return db[_0x4402('0x77')]['destroy']({'where':{'VoiceQueueId':_0x20ffb6['id'],'UserId':_0xa58643[_0x4402('0x2f')][_0x4402('0x5f')]}});}});});})['then'](function(){return _0x4bdb42;});})[_0x4402('0x22')](function(){return _0x4bdb42;});}})['then'](function(_0x5bf78a){if(_0x5bf78a){return _0x5bf78a[_0x4402('0x71')](_0xa58643['query'][_0x4402('0x5f')])['then'](function(){if(_['isArray'](_0xa58643[_0x4402('0x2f')][_0x4402('0x5f')])){for(var _0x43c796=0x0;_0x43c796<_0xa58643[_0x4402('0x2f')][_0x4402('0x5f')][_0x4402('0x35')];_0x43c796+=0x1){socket['emit'](_0x4402('0x78'),{'UserId':Number(_0xa58643[_0x4402('0x2f')]['ids'][_0x43c796]),'TeamId':Number(_0xa58643[_0x4402('0x4f')]['id'])});}}else{socket['emit']('userTeam:remove',{'UserId':Number(_0xa58643[_0x4402('0x2f')]['ids']),'TeamId':Number(_0xa58643[_0x4402('0x4f')]['id'])});}});}})[_0x4402('0x22')](respondWithStatusCode(_0x1444fa,null))[_0x4402('0x43')](handleError(_0x1444fa,null));};exports[_0x4402('0x79')]=function(_0x34e96e,_0x5e7e0b,_0x5d5b74){var _0x32fd11={};var _0x3b428e={};var _0x4c5cc6;var _0x2320ed;return db[_0x4402('0x2b')][_0x4402('0x51')]({'where':{'id':_0x34e96e[_0x4402('0x4f')]['id']}})[_0x4402('0x22')](handleEntityNotFound(_0x5e7e0b,null))[_0x4402('0x22')](function(_0x4b63ba){if(_0x4b63ba){_0x4c5cc6=_0x4b63ba;_0x3b428e['model']=_[_0x4402('0x30')](db[_0x4402('0x66')][_0x4402('0x2c')]);_0x3b428e[_0x4402('0x2f')]=_[_0x4402('0x30')](_0x34e96e[_0x4402('0x2f')]);_0x3b428e['filters']=_[_0x4402('0x31')](_0x3b428e[_0x4402('0x32')],_0x3b428e[_0x4402('0x2f')]);_0x32fd11[_0x4402('0x34')]=_[_0x4402('0x31')](_0x3b428e['model'],qs[_0x4402('0x33')](_0x34e96e[_0x4402('0x2f')][_0x4402('0x33')]));_0x32fd11[_0x4402('0x34')]=_0x32fd11[_0x4402('0x34')][_0x4402('0x35')]?_0x32fd11['attributes']:_0x3b428e['model'];_0x32fd11[_0x4402('0x37')]=qs['sort'](_0x34e96e[_0x4402('0x2f')][_0x4402('0x38')]);_0x32fd11[_0x4402('0x3c')]=qs[_0x4402('0x39')](_[_0x4402('0x59')](_0x34e96e[_0x4402('0x2f')],_0x3b428e[_0x4402('0x39')]));if(_0x34e96e[_0x4402('0x2f')][_0x4402('0x3a')]){_0x32fd11[_0x4402('0x3c')]=_[_0x4402('0x3b')](_0x32fd11[_0x4402('0x3c')],{'$or':_[_0x4402('0x2a')](_0x32fd11[_0x4402('0x34')],function(_0x127d5e){var _0x1ba5a1={};_0x1ba5a1[_0x127d5e]={'$like':'%'+_0x34e96e[_0x4402('0x2f')][_0x4402('0x3a')]+'%'};return _0x1ba5a1;})});}_0x32fd11=_[_0x4402('0x3b')]({},_0x32fd11,_0x34e96e[_0x4402('0x3f')]);return _0x4c5cc6[_0x4402('0x79')](_0x32fd11);}})[_0x4402('0x22')](function(_0x418070){if(_0x418070){_0x2320ed=_0x418070['length'];if(!_0x34e96e[_0x4402('0x2f')][_0x4402('0x36')](_0x4402('0x7a'))){_0x32fd11[_0x4402('0x1d')]=qs[_0x4402('0x1d')](_0x34e96e[_0x4402('0x2f')]['limit']);_0x32fd11['offset']=qs[_0x4402('0x1c')](_0x34e96e[_0x4402('0x2f')][_0x4402('0x1c')]);}return _0x4c5cc6['getAgents'](_0x32fd11);}})['then'](function(_0x54fee3){if(_0x54fee3){return _0x54fee3?{'count':_0x2320ed,'rows':_0x54fee3}:null;}})['then'](respondWithResult(_0x5e7e0b,null))[_0x4402('0x43')](handleError(_0x5e7e0b,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 97e1d4a..d79ef4d 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 _0x681d=['remove','emit','hook','exports','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x31df17,_0x76dde){var _0x11fdd0=function(_0x1b813a){while(--_0x1b813a){_0x31df17['push'](_0x31df17['shift']());}};_0x11fdd0(++_0x76dde);}(_0x681d,0x94));var _0xd681=function(_0x59bcb1,_0x5a4b6c){_0x59bcb1=_0x59bcb1-0x0;var _0x4a737f=_0x681d[_0x59bcb1];return _0x4a737f;};'use strict';var EventEmitter=require(_0xd681('0x0'));var Team=require(_0xd681('0x1'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents[_0xd681('0x2')](0x0);var events={'afterCreate':_0xd681('0x3'),'afterUpdate':_0xd681('0x4'),'afterDestroy':_0xd681('0x5')};function emitEvent(_0x2b727a){return function(_0x59d371,_0x395b89,_0xf1c13a){TeamEvents[_0xd681('0x6')](_0x2b727a+':'+_0x59d371['id'],_0x59d371);TeamEvents[_0xd681('0x6')](_0x2b727a,_0x59d371);_0xf1c13a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0xd681('0x7')](e,emitEvent(event));}}module[_0xd681('0x8')]=TeamEvents; \ No newline at end of file +var _0x05f6=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','Team','setMaxListeners','save','remove'];(function(_0x205d4f,_0x1551d7){var _0x2a740b=function(_0x3c9995){while(--_0x3c9995){_0x205d4f['push'](_0x205d4f['shift']());}};_0x2a740b(++_0x1551d7);}(_0x05f6,0x176));var _0x605f=function(_0x5bd7e2,_0x225255){_0x5bd7e2=_0x5bd7e2-0x0;var _0x273020=_0x05f6[_0x5bd7e2];return _0x273020;};'use strict';var EventEmitter=require(_0x605f('0x0'));var Team=require(_0x605f('0x1'))['db'][_0x605f('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x605f('0x3')](0x0);var events={'afterCreate':_0x605f('0x4'),'afterUpdate':'update','afterDestroy':_0x605f('0x5')};function emitEvent(_0xee9e52){return function(_0x283385,_0x3ed712,_0xea4923){TeamEvents['emit'](_0xee9e52+':'+_0x283385['id'],_0x283385);TeamEvents[_0x605f('0x6')](_0xee9e52,_0x283385);_0xea4923(null);};}for(var e in events){if(events[_0x605f('0x7')](e)){var event=events[e];Team[_0x605f('0x8')](e,emitEvent(event));}}module[_0x605f('0x9')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 60f581b..9fa7e24 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 _0x0d2d=['exports','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./team.attributes'];(function(_0x22ad0c,_0x56e8a1){var _0x3787a9=function(_0x1d87a9){while(--_0x1d87a9){_0x22ad0c['push'](_0x22ad0c['shift']());}};_0x3787a9(++_0x56e8a1);}(_0x0d2d,0x1e5));var _0xd0d2=function(_0x43ef2b,_0x127a4e){_0x43ef2b=_0x43ef2b-0x0;var _0x763623=_0x0d2d[_0x43ef2b];return _0x763623;};'use strict';var _=require(_0xd0d2('0x0'));var util=require(_0xd0d2('0x1'));var logger=require(_0xd0d2('0x2'))(_0xd0d2('0x3'));var moment=require('moment');var BPromise=require(_0xd0d2('0x4'));var rp=require(_0xd0d2('0x5'));var fs=require('fs');var path=require(_0xd0d2('0x6'));var rimraf=require(_0xd0d2('0x7'));var config=require(_0xd0d2('0x8'));var attributes=require(_0xd0d2('0x9'));module[_0xd0d2('0xa')]=function(_0x8c805b,_0x2e05c7){return _0x8c805b['define']('Team',attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7177=['lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','define','Team'];(function(_0x115cd4,_0x343685){var _0x1fce89=function(_0x588951){while(--_0x588951){_0x115cd4['push'](_0x115cd4['shift']());}};_0x1fce89(++_0x343685);}(_0x7177,0x15e));var _0x7717=function(_0x4c6e4a,_0x263ab8){_0x4c6e4a=_0x4c6e4a-0x0;var _0x3d69f4=_0x7177[_0x4c6e4a];return _0x3d69f4;};'use strict';var _=require(_0x7717('0x0'));var util=require(_0x7717('0x1'));var logger=require(_0x7717('0x2'))(_0x7717('0x3'));var moment=require(_0x7717('0x4'));var BPromise=require(_0x7717('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7717('0x6'));var config=require(_0x7717('0x7'));var attributes=require('./team.attributes');module['exports']=function(_0x457c71,_0xf2be95){return _0x457c71[_0x7717('0x8')](_0x7717('0x9'),attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 0ed2d65..ad64c16 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 _0x581d=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./team.socket','request','then','info','request\x20sent','debug','stringify','error','Team,\x20%s,\x20%s'];(function(_0x4ad1a9,_0xc817e8){var _0x128337=function(_0x2e097a){while(--_0x2e097a){_0x4ad1a9['push'](_0x4ad1a9['shift']());}};_0x128337(++_0xc817e8);}(_0x581d,0x6f));var _0xd581=function(_0xa5209f,_0x103c6e){_0xa5209f=_0xa5209f-0x0;var _0x53b464=_0x581d[_0xa5209f];return _0x53b464;};'use strict';var _=require(_0xd581('0x0'));var util=require(_0xd581('0x1'));var moment=require(_0xd581('0x2'));var BPromise=require(_0xd581('0x3'));var rs=require(_0xd581('0x4'));var fs=require('fs');var Redis=require(_0xd581('0x5'));var db=require(_0xd581('0x6'))['db'];var utils=require(_0xd581('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xd581('0x8'));var jayson=require(_0xd581('0x9'));var client=jayson[_0xd581('0xa')][_0xd581('0xb')]({'port':0x232a});config[_0xd581('0xc')]=_['defaults'](config['redis'],{'host':_0xd581('0xd'),'port':0x18eb});var socket=require(_0xd581('0xe'))(new Redis(config[_0xd581('0xc')]));require(_0xd581('0xf'))['register'](socket);function respondWithRpcPromise(_0x29dd0c,_0x50b776,_0x1c3f63){return new BPromise(function(_0x35e4b9,_0x294a4c){return client[_0xd581('0x10')](_0x29dd0c,_0x1c3f63)[_0xd581('0x11')](function(_0x225cc9){logger[_0xd581('0x12')]('Team,\x20%s,\x20%s',_0x50b776,_0xd581('0x13'));logger[_0xd581('0x14')]('Team,\x20%s,\x20%s,\x20%s',_0x50b776,_0xd581('0x13'),JSON[_0xd581('0x15')](_0x225cc9));if(_0x225cc9[_0xd581('0x16')]){if(_0x225cc9['error']['code']===0x1f4){logger['error'](_0xd581('0x17'),_0x50b776,_0x225cc9[_0xd581('0x16')][_0xd581('0x18')]);return _0x294a4c(_0x225cc9[_0xd581('0x16')][_0xd581('0x18')]);}logger[_0xd581('0x16')](_0xd581('0x17'),_0x50b776,_0x225cc9[_0xd581('0x16')][_0xd581('0x18')]);return _0x35e4b9(_0x225cc9[_0xd581('0x16')][_0xd581('0x18')]);}else{logger[_0xd581('0x12')]('Team,\x20%s,\x20%s',_0x50b776,_0xd581('0x13'));_0x35e4b9(_0x225cc9[_0xd581('0x19')]['message']);}})[_0xd581('0x1a')](function(_0x17e054){logger[_0xd581('0x16')](_0xd581('0x17'),_0x50b776,_0x17e054);_0x294a4c(_0x17e054);});});} \ No newline at end of file +var _0xaaf4=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./team.socket','then','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x62de03,_0x3e2c44){var _0x2bda04=function(_0x4f0d86){while(--_0x4f0d86){_0x62de03['push'](_0x62de03['shift']());}};_0x2bda04(++_0x3e2c44);}(_0xaaf4,0xb6));var _0x4aaf=function(_0x57f63d,_0x46f188){_0x57f63d=_0x57f63d-0x0;var _0x1fa21=_0xaaf4[_0x57f63d];return _0x1fa21;};'use strict';var _=require(_0x4aaf('0x0'));var util=require(_0x4aaf('0x1'));var moment=require(_0x4aaf('0x2'));var BPromise=require(_0x4aaf('0x3'));var rs=require(_0x4aaf('0x4'));var fs=require('fs');var Redis=require(_0x4aaf('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4aaf('0x6'));var logger=require(_0x4aaf('0x7'))(_0x4aaf('0x8'));var config=require(_0x4aaf('0x9'));var jayson=require(_0x4aaf('0xa'));var client=jayson[_0x4aaf('0xb')][_0x4aaf('0xc')]({'port':0x232a});config[_0x4aaf('0xd')]=_['defaults'](config[_0x4aaf('0xd')],{'host':_0x4aaf('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4aaf('0xd')]));require(_0x4aaf('0xf'))['register'](socket);function respondWithRpcPromise(_0x3ff16b,_0x4155a8,_0x1cfe37){return new BPromise(function(_0x1c0d91,_0x4b04b7){return client['request'](_0x3ff16b,_0x1cfe37)[_0x4aaf('0x10')](function(_0x2d179e){logger['info'](_0x4aaf('0x11'),_0x4155a8,_0x4aaf('0x12'));logger[_0x4aaf('0x13')](_0x4aaf('0x14'),_0x4155a8,_0x4aaf('0x12'),JSON[_0x4aaf('0x15')](_0x2d179e));if(_0x2d179e[_0x4aaf('0x16')]){if(_0x2d179e[_0x4aaf('0x16')][_0x4aaf('0x17')]===0x1f4){logger['error'](_0x4aaf('0x11'),_0x4155a8,_0x2d179e[_0x4aaf('0x16')][_0x4aaf('0x18')]);return _0x4b04b7(_0x2d179e[_0x4aaf('0x16')][_0x4aaf('0x18')]);}logger['error'](_0x4aaf('0x11'),_0x4155a8,_0x2d179e['error'][_0x4aaf('0x18')]);return _0x1c0d91(_0x2d179e[_0x4aaf('0x16')]['message']);}else{logger['info'](_0x4aaf('0x11'),_0x4155a8,_0x4aaf('0x12'));_0x1c0d91(_0x2d179e[_0x4aaf('0x19')]['message']);}})[_0x4aaf('0x1a')](function(_0x452895){logger[_0x4aaf('0x16')](_0x4aaf('0x11'),_0x4155a8,_0x452895);_0x4b04b7(_0x452895);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 65e7e07..54fc712 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 _0x3a6d=['team:','./team.events','save','update','emit','removeListener','register'];(function(_0x2fe94f,_0x3afbe3){var _0x5dbe44=function(_0x3ae997){while(--_0x3ae997){_0x2fe94f['push'](_0x2fe94f['shift']());}};_0x5dbe44(++_0x3afbe3);}(_0x3a6d,0x143));var _0xd3a6=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0x3a6d[_0x4ff09b];return _0x3f5c2e;};'use strict';var TeamEvents=require(_0xd3a6('0x0'));var events=[_0xd3a6('0x1'),'remove',_0xd3a6('0x2')];function createListener(_0x177d8b,_0x31619a){return function(_0x37a8f2){_0x31619a[_0xd3a6('0x3')](_0x177d8b,_0x37a8f2);};}function removeListener(_0x585473,_0x1cb966){return function(){TeamEvents[_0xd3a6('0x4')](_0x585473,_0x1cb966);};}exports[_0xd3a6('0x5')]=function(_0x1fc450){for(var _0x25b042=0x0,_0x282cb1=events['length'];_0x25b042<_0x282cb1;_0x25b042++){var _0x121bd2=events[_0x25b042];var _0x134dd3=createListener(_0xd3a6('0x6')+_0x121bd2,_0x1fc450);TeamEvents['on'](_0x121bd2,_0x134dd3);}}; \ No newline at end of file +var _0x7a12=['register','./team.events','save','remove','update','emit','removeListener'];(function(_0x9d1e6b,_0x3bdc22){var _0x2b3070=function(_0x4c4ced){while(--_0x4c4ced){_0x9d1e6b['push'](_0x9d1e6b['shift']());}};_0x2b3070(++_0x3bdc22);}(_0x7a12,0xe8));var _0x27a1=function(_0x570550,_0x43e80e){_0x570550=_0x570550-0x0;var _0x5363be=_0x7a12[_0x570550];return _0x5363be;};'use strict';var TeamEvents=require(_0x27a1('0x0'));var events=[_0x27a1('0x1'),_0x27a1('0x2'),_0x27a1('0x3')];function createListener(_0x2a27eb,_0x3e4f68){return function(_0x391592){_0x3e4f68[_0x27a1('0x4')](_0x2a27eb,_0x391592);};}function removeListener(_0x516239,_0x8b00f8){return function(){TeamEvents[_0x27a1('0x5')](_0x516239,_0x8b00f8);};}exports[_0x27a1('0x6')]=function(_0x389116){for(var _0x2ccadb=0x0,_0xed784f=events['length'];_0x2ccadb<_0xed784f;_0x2ccadb++){var _0x3f0bbd=events[_0x2ccadb];var _0x34efbb=createListener('team:'+_0x3f0bbd,_0x389116);TeamEvents['on'](_0x3f0bbd,_0x34efbb);}}; \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 4873132..c9d13db 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 _0xae1a=['../../config/environment','./template.controller','get','isAuthenticated','index','create','put','/:id','update','destroy','multer','util','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x45d34a,_0x19b767){var _0x499c41=function(_0xfaacd9){while(--_0xfaacd9){_0x45d34a['push'](_0x45d34a['shift']());}};_0x499c41(++_0x19b767);}(_0xae1a,0xbe));var _0xaae1=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xae1a[_0x3635ce];return _0x97ecd0;};'use strict';var multer=require(_0xaae1('0x0'));var util=require(_0xaae1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xaae1('0x2')]();var auth=require(_0xaae1('0x3'));var interaction=require(_0xaae1('0x4'));var config=require(_0xaae1('0x5'));var controller=require(_0xaae1('0x6'));router[_0xaae1('0x7')]('/',auth[_0xaae1('0x8')](),controller[_0xaae1('0x9')]);router[_0xaae1('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xaae1('0xa')]);router[_0xaae1('0xb')](_0xaae1('0xc'),auth[_0xaae1('0x8')](),controller[_0xaae1('0xd')]);router['delete'](_0xaae1('0xc'),auth[_0xaae1('0x8')](),controller[_0xaae1('0xe')]);module['exports']=router; \ No newline at end of file +var _0xddd8=['util','path','connect-timeout','Router','../../config/environment','./template.controller','get','/:id','isAuthenticated','show','post','create','put','update','destroy','multer'];(function(_0x2136b4,_0x246d72){var _0x7e0f91=function(_0xca0dbd){while(--_0xca0dbd){_0x2136b4['push'](_0x2136b4['shift']());}};_0x7e0f91(++_0x246d72);}(_0xddd8,0x1ef));var _0x8ddd=function(_0x1e2cf8,_0x4fb17f){_0x1e2cf8=_0x1e2cf8-0x0;var _0x482dc6=_0xddd8[_0x1e2cf8];return _0x482dc6;};'use strict';var multer=require(_0x8ddd('0x0'));var util=require(_0x8ddd('0x1'));var path=require(_0x8ddd('0x2'));var timeout=require(_0x8ddd('0x3'));var express=require('express');var router=express[_0x8ddd('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8ddd('0x5'));var controller=require(_0x8ddd('0x6'));router[_0x8ddd('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8ddd('0x7')](_0x8ddd('0x8'),auth[_0x8ddd('0x9')](),controller[_0x8ddd('0xa')]);router[_0x8ddd('0xb')]('/',auth[_0x8ddd('0x9')](),controller[_0x8ddd('0xc')]);router[_0x8ddd('0xd')](_0x8ddd('0x8'),auth['isAuthenticated'](),controller[_0x8ddd('0xe')]);router['delete'](_0x8ddd('0x8'),auth[_0x8ddd('0x9')](),controller[_0x8ddd('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 952d858..360b716 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 _0x7cf3=['STRING','TEXT','sequelize','exports'];(function(_0x3bf925,_0x4dd8e4){var _0x2128a1=function(_0x4d2049){while(--_0x4d2049){_0x3bf925['push'](_0x3bf925['shift']());}};_0x2128a1(++_0x4dd8e4);}(_0x7cf3,0x122));var _0x37cf=function(_0x2daef6,_0xcac228){_0x2daef6=_0x2daef6-0x0;var _0x62d030=_0x7cf3[_0x2daef6];return _0x62d030;};'use strict';var Sequelize=require(_0x37cf('0x0'));module[_0x37cf('0x1')]={'name':{'type':Sequelize[_0x37cf('0x2')]},'description':{'type':Sequelize[_0x37cf('0x2')]},'html':{'type':Sequelize[_0x37cf('0x3')]}}; \ No newline at end of file +var _0x44de=['STRING','sequelize','exports'];(function(_0x16a22b,_0x5210fb){var _0xd667f0=function(_0x2d1085){while(--_0x2d1085){_0x16a22b['push'](_0x16a22b['shift']());}};_0xd667f0(++_0x5210fb);}(_0x44de,0x11b));var _0xe44d=function(_0x549e1c,_0x298cdb){_0x549e1c=_0x549e1c-0x0;var _0x47fde7=_0x44de[_0x549e1c];return _0x47fde7;};'use strict';var Sequelize=require(_0xe44d('0x0'));module[_0xe44d('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe44d('0x2')]},'html':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 49e1e69..44369eb 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 _0x97e4=['map','Template','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','rimraf','zip-dir','fast-json-patch','moment','mustache','util','to-csv','ejs','lodash','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','sendStatus','end','status','json','count','offset','limit','Content-Range','reject','save','destroy','then','get','Templates','UserProfileResource','error','stack','name','send','index'];(function(_0x4273d3,_0x5825f3){var _0x547986=function(_0x245814){while(--_0x245814){_0x4273d3['push'](_0x4273d3['shift']());}};_0x547986(++_0x5825f3);}(_0x97e4,0x13f));var _0x497e=function(_0x18c284,_0x1cd679){_0x18c284=_0x18c284-0x0;var _0x2fdf50=_0x97e4[_0x18c284];return _0x2fdf50;};'use strict';var pdf=require(_0x497e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x497e('0x1'));var zipdir=require(_0x497e('0x2'));var jsonpatch=require(_0x497e('0x3'));var rp=require('request-promise');var moment=require(_0x497e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x497e('0x5'));var util=require(_0x497e('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x497e('0x7'));var ejs=require(_0x497e('0x8'));var fs=require('fs');var _=require(_0x497e('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x497e('0xa'));var Redis=require(_0x497e('0xb'));var authService=require(_0x497e('0xc'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x497e('0xd'))(_0x497e('0xe'));var utils=require(_0x497e('0xf'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb3ff41,_0x4d05f8){_0x4d05f8=_0x4d05f8||0xcc;return function(_0x4dce70){if(_0x4dce70){return _0xb3ff41[_0x497e('0x10')](_0x4d05f8);}return _0xb3ff41['status'](_0x4d05f8)[_0x497e('0x11')]();};}function respondWithResult(_0x41cd28,_0x4f16c4){_0x4f16c4=_0x4f16c4||0xc8;return function(_0x446063){if(_0x446063){return _0x41cd28[_0x497e('0x12')](_0x4f16c4)[_0x497e('0x13')](_0x446063);}};}function respondWithFilteredResult(_0x4cd13d,_0x228e96){return function(_0x2449c1){if(_0x2449c1){var _0x3a4412=_0x2449c1[_0x497e('0x14')],_0x49bf9c=_0x228e96[_0x497e('0x15')],_0x55d464=_0x228e96['offset']+_0x228e96[_0x497e('0x16')],_0x11dbaa;if(_0x55d464>=_0x3a4412){_0x55d464=_0x3a4412;_0x11dbaa=0xc8;}else{_0x11dbaa=0xce;}_0x4cd13d[_0x497e('0x12')](_0x11dbaa);return _0x4cd13d['set'](_0x497e('0x17'),_0x49bf9c+'-'+_0x55d464+'/'+_0x3a4412)[_0x497e('0x13')](_0x2449c1);}return null;};}function patchUpdates(_0x2c715f){return function(_0x183dc4){try{jsonpatch['apply'](_0x183dc4,_0x2c715f,!![]);}catch(_0x322d95){return BPromise[_0x497e('0x18')](_0x322d95);}return _0x183dc4[_0x497e('0x19')]();};}function saveUpdates(_0xb80269,_0x41fe51){return function(_0x530deb){if(_0x530deb){return _0x530deb['update'](_0xb80269)['then'](function(_0x4fe619){return _0x4fe619;});}return null;};}function removeEntity(_0x3d654d,_0x23a653){return function(_0x4b0916){if(_0x4b0916){return _0x4b0916[_0x497e('0x1a')]()[_0x497e('0x1b')](function(){var _0x14b590=_0x4b0916[_0x497e('0x1c')]({'plain':!![]});var _0x36a4e2=_0x497e('0x1d');return db[_0x497e('0x1e')]['destroy']({'where':{'type':_0x36a4e2,'resourceId':_0x14b590['id']}})[_0x497e('0x1b')](function(){return _0x4b0916;});})[_0x497e('0x1b')](function(){_0x3d654d[_0x497e('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x244ea9,_0x540d5e){return function(_0x522d0f){if(!_0x522d0f){_0x244ea9[_0x497e('0x10')](0x194);}return _0x522d0f;};}function handleError(_0x16a324,_0x47a0f2){_0x47a0f2=_0x47a0f2||0x1f4;return function(_0x59536e){logger[_0x497e('0x1f')](_0x59536e[_0x497e('0x20')]);if(_0x59536e[_0x497e('0x21')]){delete _0x59536e[_0x497e('0x21')];}_0x16a324['status'](_0x47a0f2)[_0x497e('0x22')](_0x59536e);};}exports[_0x497e('0x23')]=function(_0x2b77af,_0x24abf9){var _0x2fe6e4={},_0x264af7={},_0x2e701b={'count':0x0,'rows':[]};var _0x3fb01a=_[_0x497e('0x24')](db[_0x497e('0x25')][_0x497e('0x26')],function(_0x322ca2){return{'name':_0x322ca2[_0x497e('0x27')],'type':_0x322ca2[_0x497e('0x28')][_0x497e('0x29')]};});_0x264af7[_0x497e('0x2a')]=_[_0x497e('0x24')](_0x3fb01a,_0x497e('0x21'));_0x264af7[_0x497e('0x2b')]=_[_0x497e('0x2c')](_0x2b77af[_0x497e('0x2b')]);_0x264af7[_0x497e('0x2d')]=_[_0x497e('0x2e')](_0x264af7[_0x497e('0x2a')],_0x264af7['query']);_0x2fe6e4['attributes']=_['intersection'](_0x264af7['model'],qs[_0x497e('0x2f')](_0x2b77af['query'][_0x497e('0x2f')]));_0x2fe6e4[_0x497e('0x30')]=_0x2fe6e4['attributes'][_0x497e('0x31')]?_0x2fe6e4[_0x497e('0x30')]:_0x264af7[_0x497e('0x2a')];if(!_0x2b77af[_0x497e('0x2b')]['hasOwnProperty'](_0x497e('0x32'))){_0x2fe6e4['limit']=qs[_0x497e('0x16')](_0x2b77af[_0x497e('0x2b')]['limit']);_0x2fe6e4[_0x497e('0x15')]=qs[_0x497e('0x15')](_0x2b77af[_0x497e('0x2b')][_0x497e('0x15')]);}_0x2fe6e4['order']=qs[_0x497e('0x33')](_0x2b77af[_0x497e('0x2b')][_0x497e('0x33')]);_0x2fe6e4[_0x497e('0x34')]=qs[_0x497e('0x2d')](_[_0x497e('0x35')](_0x2b77af[_0x497e('0x2b')],_0x264af7[_0x497e('0x2d')]));if(_0x2b77af[_0x497e('0x2b')][_0x497e('0x36')]){_0x2fe6e4[_0x497e('0x34')]=_[_0x497e('0x37')](_0x2fe6e4[_0x497e('0x34')],{'$or':_[_0x497e('0x24')](_0x3fb01a,function(_0x5bec8f){if(_0x5bec8f[_0x497e('0x28')][_0x497e('0x29')]!==_0x497e('0x38')){var _0x3a85de={};_0x3a85de[_0x5bec8f['field']]={'$like':'%'+_0x2b77af[_0x497e('0x2b')][_0x497e('0x36')]+'%'};return _0x3a85de;}})});}_0x2fe6e4=_[_0x497e('0x37')]({},_0x2fe6e4,_0x2b77af[_0x497e('0x39')]);var _0x450628={'where':_0x2fe6e4[_0x497e('0x34')]};return db['Template']['count'](_0x450628)[_0x497e('0x1b')](function(_0x306b39){_0x2e701b[_0x497e('0x14')]=_0x306b39;if(_0x2b77af[_0x497e('0x2b')][_0x497e('0x3a')]){_0x2fe6e4['include']=[{'all':!![]}];}return db[_0x497e('0x25')][_0x497e('0x3b')](_0x2fe6e4);})[_0x497e('0x1b')](function(_0x1fbbe2){_0x2e701b[_0x497e('0x3c')]=_0x1fbbe2;return _0x2e701b;})[_0x497e('0x1b')](respondWithFilteredResult(_0x24abf9,_0x2fe6e4))[_0x497e('0x3d')](handleError(_0x24abf9,null));};exports['show']=function(_0x4ddb48,_0x4a4efa){var _0x438615={'raw':!![],'where':{'id':_0x4ddb48[_0x497e('0x3e')]['id']}},_0x708e6d={};_0x708e6d['model']=_[_0x497e('0x2c')](db[_0x497e('0x25')][_0x497e('0x26')]);_0x708e6d[_0x497e('0x2b')]=_[_0x497e('0x2c')](_0x4ddb48[_0x497e('0x2b')]);_0x708e6d[_0x497e('0x2d')]=_[_0x497e('0x2e')](_0x708e6d[_0x497e('0x2a')],_0x708e6d['query']);_0x438615[_0x497e('0x30')]=_[_0x497e('0x2e')](_0x708e6d[_0x497e('0x2a')],qs[_0x497e('0x2f')](_0x4ddb48[_0x497e('0x2b')][_0x497e('0x2f')]));_0x438615[_0x497e('0x30')]=_0x438615[_0x497e('0x30')]['length']?_0x438615['attributes']:_0x708e6d['model'];if(_0x4ddb48[_0x497e('0x2b')][_0x497e('0x3a')]){_0x438615['include']=[{'all':!![]}];}_0x438615=_[_0x497e('0x37')]({},_0x438615,_0x4ddb48['options']);return db[_0x497e('0x25')][_0x497e('0x3f')](_0x438615)['then'](handleEntityNotFound(_0x4a4efa,null))[_0x497e('0x1b')](respondWithResult(_0x4a4efa,null))[_0x497e('0x3d')](handleError(_0x4a4efa,null));};exports[_0x497e('0x40')]=function(_0x1dc8ba,_0x3c637d){return db[_0x497e('0x25')][_0x497e('0x40')](_0x1dc8ba[_0x497e('0x41')],{})[_0x497e('0x1b')](function(_0x3b152e){var _0x4a9c93=_0x1dc8ba['user']['get']({'plain':!![]});if(!_0x4a9c93)throw new Error(_0x497e('0x42'));if(_0x4a9c93[_0x497e('0x43')]==='user'){var _0x30c381=_0x3b152e[_0x497e('0x1c')]({'plain':!![]});var _0x45d8ab='Templates';return db[_0x497e('0x44')][_0x497e('0x3f')]({'where':{'name':_0x45d8ab,'userProfileId':_0x4a9c93['userProfileId']},'raw':!![]})[_0x497e('0x1b')](function(_0x5aedc){if(_0x5aedc&&_0x5aedc[_0x497e('0x45')]===0x0){return db[_0x497e('0x1e')][_0x497e('0x40')]({'name':_0x30c381[_0x497e('0x21')],'resourceId':_0x30c381['id'],'type':_0x5aedc['name'],'sectionId':_0x5aedc['id']},{})[_0x497e('0x1b')](function(){return _0x3b152e;});}else{return _0x3b152e;}})[_0x497e('0x3d')](function(_0x21cb36){logger[_0x497e('0x1f')](_0x497e('0x46'),_0x21cb36);throw _0x21cb36;});}return _0x3b152e;})[_0x497e('0x1b')](respondWithResult(_0x3c637d,0xc9))[_0x497e('0x3d')](handleError(_0x3c637d,null));};exports['update']=function(_0x5e0166,_0xc9ef34){if(_0x5e0166[_0x497e('0x41')]['id']){delete _0x5e0166[_0x497e('0x41')]['id'];}return db[_0x497e('0x25')][_0x497e('0x3f')]({'where':{'id':_0x5e0166[_0x497e('0x3e')]['id']}})[_0x497e('0x1b')](handleEntityNotFound(_0xc9ef34,null))[_0x497e('0x1b')](saveUpdates(_0x5e0166['body'],null))[_0x497e('0x1b')](respondWithResult(_0xc9ef34,null))[_0x497e('0x3d')](handleError(_0xc9ef34,null));};exports['destroy']=function(_0x55b5c1,_0x5a6cf8){return db[_0x497e('0x25')]['find']({'where':{'id':_0x55b5c1[_0x497e('0x3e')]['id']}})[_0x497e('0x1b')](handleEntityNotFound(_0x5a6cf8,null))[_0x497e('0x1b')](removeEntity(_0x5a6cf8,null))[_0x497e('0x3d')](handleError(_0x5a6cf8,null));}; \ No newline at end of file +var _0x5205=['squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','get','Templates','UserProfileResource','sendStatus','error','stack','index','map','Template','rawAttributes','fieldName','key','model','name','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','merge','type','field','filter','options','includeAll','include','rows','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','lodash'];(function(_0x1a3c74,_0x46f5ea){var _0xbe3cf=function(_0x58a6b0){while(--_0x58a6b0){_0x1a3c74['push'](_0x1a3c74['shift']());}};_0xbe3cf(++_0x46f5ea);}(_0x5205,0x1e1));var _0x5520=function(_0x1b0b09,_0xa62342){_0x1b0b09=_0x1b0b09-0x0;var _0x2a93fc=_0x5205[_0x1b0b09];return _0x2a93fc;};'use strict';var pdf=require(_0x5520('0x0'));var emlformat=require(_0x5520('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x5520('0x2'));var jsonpatch=require(_0x5520('0x3'));var rp=require('request-promise');var moment=require(_0x5520('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5520('0x5'));var util=require(_0x5520('0x6'));var path=require('path');var sox=require(_0x5520('0x7'));var csv=require(_0x5520('0x8'));var ejs=require(_0x5520('0x9'));var fs=require('fs');var _=require(_0x5520('0xa'));var squel=require(_0x5520('0xb'));var crypto=require('crypto');var jsforce=require(_0x5520('0xc'));var deskjs=require(_0x5520('0xd'));var toCsv=require(_0x5520('0x8'));var querystring=require(_0x5520('0xe'));var Papa=require('papaparse');var Redis=require(_0x5520('0xf'));var authService=require(_0x5520('0x10'));var qs=require(_0x5520('0x11'));var as=require(_0x5520('0x12'));var hardwareService=require(_0x5520('0x13'));var logger=require(_0x5520('0x14'))(_0x5520('0x15'));var utils=require(_0x5520('0x16'));var config=require('../../config/environment');var db=require(_0x5520('0x17'))['db'];function respondWithStatusCode(_0x39941f,_0x522ae0){_0x522ae0=_0x522ae0||0xcc;return function(_0x3e7a9a){if(_0x3e7a9a){return _0x39941f['sendStatus'](_0x522ae0);}return _0x39941f[_0x5520('0x18')](_0x522ae0)[_0x5520('0x19')]();};}function respondWithResult(_0x36ec57,_0x5f4083){_0x5f4083=_0x5f4083||0xc8;return function(_0x5058a6){if(_0x5058a6){return _0x36ec57[_0x5520('0x18')](_0x5f4083)[_0x5520('0x1a')](_0x5058a6);}};}function respondWithFilteredResult(_0x335bc3,_0x3e1ff6){return function(_0x42e121){if(_0x42e121){var _0xd40da8=_0x42e121[_0x5520('0x1b')],_0x5e08fa=_0x3e1ff6[_0x5520('0x1c')],_0x225532=_0x3e1ff6[_0x5520('0x1c')]+_0x3e1ff6[_0x5520('0x1d')],_0x5f24a9;if(_0x225532>=_0xd40da8){_0x225532=_0xd40da8;_0x5f24a9=0xc8;}else{_0x5f24a9=0xce;}_0x335bc3[_0x5520('0x18')](_0x5f24a9);return _0x335bc3[_0x5520('0x1e')](_0x5520('0x1f'),_0x5e08fa+'-'+_0x225532+'/'+_0xd40da8)[_0x5520('0x1a')](_0x42e121);}return null;};}function patchUpdates(_0x2a07ba){return function(_0x35063f){try{jsonpatch[_0x5520('0x20')](_0x35063f,_0x2a07ba,!![]);}catch(_0x1f7acd){return BPromise[_0x5520('0x21')](_0x1f7acd);}return _0x35063f[_0x5520('0x22')]();};}function saveUpdates(_0x4c59a1,_0x4f0671){return function(_0x1800db){if(_0x1800db){return _0x1800db[_0x5520('0x23')](_0x4c59a1)[_0x5520('0x24')](function(_0x2f6f52){return _0x2f6f52;});}return null;};}function removeEntity(_0x2805a7,_0x53b309){return function(_0xe2b78c){if(_0xe2b78c){return _0xe2b78c['destroy']()[_0x5520('0x24')](function(){var _0x2a8d23=_0xe2b78c[_0x5520('0x25')]({'plain':!![]});var _0x3ae1a2=_0x5520('0x26');return db[_0x5520('0x27')]['destroy']({'where':{'type':_0x3ae1a2,'resourceId':_0x2a8d23['id']}})[_0x5520('0x24')](function(){return _0xe2b78c;});})[_0x5520('0x24')](function(){_0x2805a7[_0x5520('0x18')](0xcc)[_0x5520('0x19')]();});}};}function handleEntityNotFound(_0x539034,_0x35b3f9){return function(_0x5cd08c){if(!_0x5cd08c){_0x539034[_0x5520('0x28')](0x194);}return _0x5cd08c;};}function handleError(_0x2b7642,_0x20955a){_0x20955a=_0x20955a||0x1f4;return function(_0xfd36ec){logger[_0x5520('0x29')](_0xfd36ec[_0x5520('0x2a')]);if(_0xfd36ec['name']){delete _0xfd36ec['name'];}_0x2b7642[_0x5520('0x18')](_0x20955a)['send'](_0xfd36ec);};}exports[_0x5520('0x2b')]=function(_0x40f3b2,_0x1ce032){var _0x394afd={},_0x11d29c={},_0x59341f={'count':0x0,'rows':[]};var _0x12142a=_[_0x5520('0x2c')](db[_0x5520('0x2d')][_0x5520('0x2e')],function(_0x449924){return{'name':_0x449924[_0x5520('0x2f')],'type':_0x449924['type'][_0x5520('0x30')]};});_0x11d29c[_0x5520('0x31')]=_[_0x5520('0x2c')](_0x12142a,_0x5520('0x32'));_0x11d29c[_0x5520('0x33')]=_[_0x5520('0x34')](_0x40f3b2['query']);_0x11d29c['filters']=_['intersection'](_0x11d29c[_0x5520('0x31')],_0x11d29c[_0x5520('0x33')]);_0x394afd[_0x5520('0x35')]=_[_0x5520('0x36')](_0x11d29c[_0x5520('0x31')],qs[_0x5520('0x37')](_0x40f3b2[_0x5520('0x33')][_0x5520('0x37')]));_0x394afd[_0x5520('0x35')]=_0x394afd['attributes'][_0x5520('0x38')]?_0x394afd[_0x5520('0x35')]:_0x11d29c[_0x5520('0x31')];if(!_0x40f3b2[_0x5520('0x33')][_0x5520('0x39')]('nolimit')){_0x394afd[_0x5520('0x1d')]=qs[_0x5520('0x1d')](_0x40f3b2[_0x5520('0x33')][_0x5520('0x1d')]);_0x394afd[_0x5520('0x1c')]=qs['offset'](_0x40f3b2[_0x5520('0x33')][_0x5520('0x1c')]);}_0x394afd[_0x5520('0x3a')]=qs[_0x5520('0x3b')](_0x40f3b2[_0x5520('0x33')][_0x5520('0x3b')]);_0x394afd[_0x5520('0x3c')]=qs[_0x5520('0x3d')](_[_0x5520('0x3e')](_0x40f3b2['query'],_0x11d29c[_0x5520('0x3d')]));if(_0x40f3b2[_0x5520('0x33')]['filter']){_0x394afd[_0x5520('0x3c')]=_[_0x5520('0x3f')](_0x394afd['where'],{'$or':_[_0x5520('0x2c')](_0x12142a,function(_0x1dc9a4){if(_0x1dc9a4[_0x5520('0x40')][_0x5520('0x30')]!=='VIRTUAL'){var _0xc63f43={};_0xc63f43[_0x1dc9a4[_0x5520('0x41')]]={'$like':'%'+_0x40f3b2[_0x5520('0x33')][_0x5520('0x42')]+'%'};return _0xc63f43;}})});}_0x394afd=_[_0x5520('0x3f')]({},_0x394afd,_0x40f3b2[_0x5520('0x43')]);var _0x252754={'where':_0x394afd[_0x5520('0x3c')]};return db[_0x5520('0x2d')][_0x5520('0x1b')](_0x252754)[_0x5520('0x24')](function(_0x10d494){_0x59341f['count']=_0x10d494;if(_0x40f3b2[_0x5520('0x33')][_0x5520('0x44')]){_0x394afd[_0x5520('0x45')]=[{'all':!![]}];}return db['Template']['findAll'](_0x394afd);})[_0x5520('0x24')](function(_0x311ea2){_0x59341f[_0x5520('0x46')]=_0x311ea2;return _0x59341f;})[_0x5520('0x24')](respondWithFilteredResult(_0x1ce032,_0x394afd))['catch'](handleError(_0x1ce032,null));};exports[_0x5520('0x47')]=function(_0xabb410,_0x5ab7b8){var _0x34ac37={'raw':!![],'where':{'id':_0xabb410[_0x5520('0x48')]['id']}},_0x1c3ea3={};_0x1c3ea3['model']=_[_0x5520('0x34')](db[_0x5520('0x2d')]['rawAttributes']);_0x1c3ea3['query']=_[_0x5520('0x34')](_0xabb410[_0x5520('0x33')]);_0x1c3ea3[_0x5520('0x3d')]=_[_0x5520('0x36')](_0x1c3ea3['model'],_0x1c3ea3[_0x5520('0x33')]);_0x34ac37['attributes']=_['intersection'](_0x1c3ea3['model'],qs[_0x5520('0x37')](_0xabb410[_0x5520('0x33')][_0x5520('0x37')]));_0x34ac37['attributes']=_0x34ac37[_0x5520('0x35')][_0x5520('0x38')]?_0x34ac37[_0x5520('0x35')]:_0x1c3ea3['model'];if(_0xabb410[_0x5520('0x33')][_0x5520('0x44')]){_0x34ac37[_0x5520('0x45')]=[{'all':!![]}];}_0x34ac37=_[_0x5520('0x3f')]({},_0x34ac37,_0xabb410[_0x5520('0x43')]);return db['Template'][_0x5520('0x49')](_0x34ac37)[_0x5520('0x24')](handleEntityNotFound(_0x5ab7b8,null))[_0x5520('0x24')](respondWithResult(_0x5ab7b8,null))['catch'](handleError(_0x5ab7b8,null));};exports[_0x5520('0x4a')]=function(_0x18a09f,_0x4a5d4c){return db[_0x5520('0x2d')]['create'](_0x18a09f[_0x5520('0x4b')],{})[_0x5520('0x24')](function(_0x52b962){var _0x3cf259=_0x18a09f[_0x5520('0x4c')]['get']({'plain':!![]});if(!_0x3cf259)throw new Error(_0x5520('0x4d'));if(_0x3cf259['role']===_0x5520('0x4c')){var _0x3e954c=_0x52b962[_0x5520('0x25')]({'plain':!![]});var _0x2f0452='Templates';return db[_0x5520('0x4e')][_0x5520('0x49')]({'where':{'name':_0x2f0452,'userProfileId':_0x3cf259['userProfileId']},'raw':!![]})[_0x5520('0x24')](function(_0x1b0297){if(_0x1b0297&&_0x1b0297[_0x5520('0x4f')]===0x0){return db[_0x5520('0x27')][_0x5520('0x4a')]({'name':_0x3e954c[_0x5520('0x32')],'resourceId':_0x3e954c['id'],'type':_0x1b0297['name'],'sectionId':_0x1b0297['id']},{})[_0x5520('0x24')](function(){return _0x52b962;});}else{return _0x52b962;}})[_0x5520('0x50')](function(_0x2bffbb){logger[_0x5520('0x29')](_0x5520('0x51'),_0x2bffbb);throw _0x2bffbb;});}return _0x52b962;})['then'](respondWithResult(_0x4a5d4c,0xc9))['catch'](handleError(_0x4a5d4c,null));};exports[_0x5520('0x23')]=function(_0x3e1606,_0x4251c4){if(_0x3e1606[_0x5520('0x4b')]['id']){delete _0x3e1606[_0x5520('0x4b')]['id'];}return db[_0x5520('0x2d')]['find']({'where':{'id':_0x3e1606[_0x5520('0x48')]['id']}})[_0x5520('0x24')](handleEntityNotFound(_0x4251c4,null))[_0x5520('0x24')](saveUpdates(_0x3e1606[_0x5520('0x4b')],null))[_0x5520('0x24')](respondWithResult(_0x4251c4,null))[_0x5520('0x50')](handleError(_0x4251c4,null));};exports['destroy']=function(_0x417e76,_0x49f76e){return db[_0x5520('0x2d')]['find']({'where':{'id':_0x417e76[_0x5520('0x48')]['id']}})[_0x5520('0x24')](handleEntityNotFound(_0x49f76e,null))[_0x5520('0x24')](removeEntity(_0x49f76e,null))[_0x5520('0x50')](handleError(_0x49f76e,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 77cf96b..f999528 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 _0x0236=['../../config/environment','./template.attributes','Template','tools_templates','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x1369c1,_0x469ffd){var _0x3462f7=function(_0x1aab20){while(--_0x1aab20){_0x1369c1['push'](_0x1369c1['shift']());}};_0x3462f7(++_0x469ffd);}(_0x0236,0xa0));var _0x6023=function(_0x50514b,_0x83db65){_0x50514b=_0x50514b-0x0;var _0x5d8587=_0x0236[_0x50514b];return _0x5d8587;};'use strict';var _=require(_0x6023('0x0'));var util=require(_0x6023('0x1'));var logger=require(_0x6023('0x2'))('api');var moment=require(_0x6023('0x3'));var BPromise=require(_0x6023('0x4'));var rp=require(_0x6023('0x5'));var fs=require('fs');var path=require(_0x6023('0x6'));var rimraf=require(_0x6023('0x7'));var config=require(_0x6023('0x8'));var attributes=require(_0x6023('0x9'));module['exports']=function(_0x237b71,_0x3524b8){return _0x237b71['define'](_0x6023('0xa'),attributes,{'tableName':_0x6023('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6b55=['exports','define','Template','lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./template.attributes'];(function(_0x51c440,_0x3b6802){var _0x67a2d6=function(_0x3d15ab){while(--_0x3d15ab){_0x51c440['push'](_0x51c440['shift']());}};_0x67a2d6(++_0x3b6802);}(_0x6b55,0x9d));var _0x56b5=function(_0x502cb5,_0x23769f){_0x502cb5=_0x502cb5-0x0;var _0x422633=_0x6b55[_0x502cb5];return _0x422633;};'use strict';var _=require(_0x56b5('0x0'));var util=require('util');var logger=require(_0x56b5('0x1'))('api');var moment=require(_0x56b5('0x2'));var BPromise=require(_0x56b5('0x3'));var rp=require(_0x56b5('0x4'));var fs=require('fs');var path=require(_0x56b5('0x5'));var rimraf=require('rimraf');var config=require(_0x56b5('0x6'));var attributes=require(_0x56b5('0x7'));module[_0x56b5('0x8')]=function(_0xe96253,_0xacb7cd){return _0xe96253[_0x56b5('0x9')](_0x56b5('0xa'),attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js index bf1e634..ff071f8 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 _0x1539=['request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetTemplate','Template','options','raw','where','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','request','then','info','Template,\x20%s,\x20%s'];(function(_0x2b655f,_0x1ec0e7){var _0x421497=function(_0xf759de){while(--_0xf759de){_0x2b655f['push'](_0x2b655f['shift']());}};_0x421497(++_0x1ec0e7);}(_0x1539,0x1a5));var _0x9153=function(_0x4db48f,_0x2257fb){_0x4db48f=_0x4db48f-0x0;var _0x2bd7ce=_0x1539[_0x4db48f];return _0x2bd7ce;};'use strict';var _=require(_0x9153('0x0'));var util=require(_0x9153('0x1'));var moment=require(_0x9153('0x2'));var BPromise=require(_0x9153('0x3'));var rs=require(_0x9153('0x4'));var fs=require('fs');var Redis=require(_0x9153('0x5'));var db=require(_0x9153('0x6'))['db'];var utils=require(_0x9153('0x7'));var logger=require('../../config/logger')(_0x9153('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1064c7,_0x16ef56,_0x1cde36){return new BPromise(function(_0xbffbc,_0x542af1){return client[_0x9153('0x9')](_0x1064c7,_0x1cde36)[_0x9153('0xa')](function(_0x25d87){logger[_0x9153('0xb')](_0x9153('0xc'),_0x16ef56,_0x9153('0xd'));logger[_0x9153('0xe')](_0x9153('0xf'),_0x16ef56,'request\x20sent',JSON[_0x9153('0x10')](_0x25d87));if(_0x25d87['error']){if(_0x25d87[_0x9153('0x11')][_0x9153('0x12')]===0x1f4){logger[_0x9153('0x11')](_0x9153('0xc'),_0x16ef56,_0x25d87['error'][_0x9153('0x13')]);return _0x542af1(_0x25d87[_0x9153('0x11')][_0x9153('0x13')]);}logger[_0x9153('0x11')]('Template,\x20%s,\x20%s',_0x16ef56,_0x25d87['error'][_0x9153('0x13')]);return _0xbffbc(_0x25d87['error'][_0x9153('0x13')]);}else{logger['info'](_0x9153('0xc'),_0x16ef56,'request\x20sent');_0xbffbc(_0x25d87[_0x9153('0x14')]['message']);}})[_0x9153('0x15')](function(_0x207845){logger[_0x9153('0x11')](_0x9153('0xc'),_0x16ef56,_0x207845);_0x542af1(_0x207845);});});}exports[_0x9153('0x16')]=function(_0x1ee511){var _0x4b2c40=this;return new Promise(function(_0x16ba79,_0x4fa8d3){return db[_0x9153('0x17')]['findAll']({'raw':_0x1ee511['options']?_0x1ee511[_0x9153('0x18')][_0x9153('0x19')]===undefined?!![]:![]:!![],'where':_0x1ee511[_0x9153('0x18')]?_0x1ee511[_0x9153('0x18')][_0x9153('0x1a')]||null:null,'attributes':_0x1ee511[_0x9153('0x18')]?_0x1ee511[_0x9153('0x18')][_0x9153('0x1b')]||null:null,'limit':_0x1ee511[_0x9153('0x18')]?_0x1ee511[_0x9153('0x18')]['limit']||null:null,'include':_0x1ee511['options']?_0x1ee511['options'][_0x9153('0x1c')]?_[_0x9153('0x1d')](_0x1ee511[_0x9153('0x18')]['include'],function(_0x79200f){return{'model':db[_0x79200f[_0x9153('0x1e')]],'as':_0x79200f['as'],'attributes':_0x79200f[_0x9153('0x1b')],'include':_0x79200f['include']?_[_0x9153('0x1d')](_0x79200f[_0x9153('0x1c')],function(_0x51f123){return{'model':db[_0x51f123[_0x9153('0x1e')]],'as':_0x51f123['as'],'attributes':_0x51f123['attributes'],'include':_0x51f123[_0x9153('0x1c')]?_[_0x9153('0x1d')](_0x51f123['include'],function(_0x5707be){return{'model':db[_0x5707be[_0x9153('0x1e')]],'as':_0x5707be['as'],'attributes':_0x5707be[_0x9153('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x9153('0xa')](function(_0x4fb73e){logger[_0x9153('0xb')](_0x9153('0x16'),_0x1ee511);logger[_0x9153('0xe')]('GetTemplate',_0x1ee511,JSON[_0x9153('0x10')](_0x4fb73e));_0x16ba79(_0x4fb73e);})[_0x9153('0x15')](function(_0x25b850){logger[_0x9153('0x11')](_0x9153('0x16'),_0x25b850[_0x9153('0x13')],_0x1ee511);_0x4fa8d3(_0x4b2c40[_0x9153('0x11')](0x1f4,_0x25b850['message']));});});}; \ No newline at end of file +var _0xca34=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','Template,\x20%s,\x20%s','message','result','Template','options','where','limit','include','model','attributes','map','GetTemplate','lodash'];(function(_0x504bb3,_0x5652c0){var _0x5f26cb=function(_0x2d8978){while(--_0x2d8978){_0x504bb3['push'](_0x504bb3['shift']());}};_0x5f26cb(++_0x5652c0);}(_0xca34,0x107));var _0x4ca3=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xca34[_0x4154a6];return _0x3b2786;};'use strict';var _=require(_0x4ca3('0x0'));var util=require(_0x4ca3('0x1'));var moment=require(_0x4ca3('0x2'));var BPromise=require(_0x4ca3('0x3'));var rs=require(_0x4ca3('0x4'));var fs=require('fs');var Redis=require(_0x4ca3('0x5'));var db=require(_0x4ca3('0x6'))['db'];var utils=require(_0x4ca3('0x7'));var logger=require(_0x4ca3('0x8'))(_0x4ca3('0x9'));var config=require(_0x4ca3('0xa'));var jayson=require(_0x4ca3('0xb'));var client=jayson['client'][_0x4ca3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x34ddf1,_0x3c22ed,_0x4c7b6a){return new BPromise(function(_0x40faef,_0x5cee14){return client[_0x4ca3('0xd')](_0x34ddf1,_0x4c7b6a)[_0x4ca3('0xe')](function(_0x4dbd5e){logger[_0x4ca3('0xf')]('Template,\x20%s,\x20%s',_0x3c22ed,_0x4ca3('0x10'));logger[_0x4ca3('0x11')](_0x4ca3('0x12'),_0x3c22ed,_0x4ca3('0x10'),JSON[_0x4ca3('0x13')](_0x4dbd5e));if(_0x4dbd5e[_0x4ca3('0x14')]){if(_0x4dbd5e[_0x4ca3('0x14')]['code']===0x1f4){logger[_0x4ca3('0x14')](_0x4ca3('0x15'),_0x3c22ed,_0x4dbd5e[_0x4ca3('0x14')][_0x4ca3('0x16')]);return _0x5cee14(_0x4dbd5e[_0x4ca3('0x14')][_0x4ca3('0x16')]);}logger['error']('Template,\x20%s,\x20%s',_0x3c22ed,_0x4dbd5e[_0x4ca3('0x14')][_0x4ca3('0x16')]);return _0x40faef(_0x4dbd5e[_0x4ca3('0x14')][_0x4ca3('0x16')]);}else{logger[_0x4ca3('0xf')](_0x4ca3('0x15'),_0x3c22ed,_0x4ca3('0x10'));_0x40faef(_0x4dbd5e[_0x4ca3('0x17')][_0x4ca3('0x16')]);}})['catch'](function(_0xd4fbd1){logger['error'](_0x4ca3('0x15'),_0x3c22ed,_0xd4fbd1);_0x5cee14(_0xd4fbd1);});});}exports['GetTemplate']=function(_0x469e64){var _0x203cea=this;return new Promise(function(_0x22b783,_0x1d5ad1){return db[_0x4ca3('0x18')]['findAll']({'raw':_0x469e64[_0x4ca3('0x19')]?_0x469e64[_0x4ca3('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x469e64[_0x4ca3('0x19')]?_0x469e64[_0x4ca3('0x19')][_0x4ca3('0x1a')]||null:null,'attributes':_0x469e64[_0x4ca3('0x19')]?_0x469e64['options']['attributes']||null:null,'limit':_0x469e64[_0x4ca3('0x19')]?_0x469e64['options'][_0x4ca3('0x1b')]||null:null,'include':_0x469e64[_0x4ca3('0x19')]?_0x469e64[_0x4ca3('0x19')][_0x4ca3('0x1c')]?_['map'](_0x469e64[_0x4ca3('0x19')][_0x4ca3('0x1c')],function(_0x957a9a){return{'model':db[_0x957a9a[_0x4ca3('0x1d')]],'as':_0x957a9a['as'],'attributes':_0x957a9a['attributes'],'include':_0x957a9a[_0x4ca3('0x1c')]?_['map'](_0x957a9a[_0x4ca3('0x1c')],function(_0x58b224){return{'model':db[_0x58b224[_0x4ca3('0x1d')]],'as':_0x58b224['as'],'attributes':_0x58b224[_0x4ca3('0x1e')],'include':_0x58b224[_0x4ca3('0x1c')]?_[_0x4ca3('0x1f')](_0x58b224[_0x4ca3('0x1c')],function(_0xf39bc){return{'model':db[_0xf39bc[_0x4ca3('0x1d')]],'as':_0xf39bc['as'],'attributes':_0xf39bc['attributes']};}):[]};}):[]};}):[]:[]})[_0x4ca3('0xe')](function(_0x33c4bb){logger[_0x4ca3('0xf')](_0x4ca3('0x20'),_0x469e64);logger[_0x4ca3('0x11')](_0x4ca3('0x20'),_0x469e64,JSON[_0x4ca3('0x13')](_0x33c4bb));_0x22b783(_0x33c4bb);})['catch'](function(_0x46f98a){logger[_0x4ca3('0x14')](_0x4ca3('0x20'),_0x46f98a[_0x4ca3('0x16')],_0x469e64);_0x1d5ad1(_0x203cea[_0x4ca3('0x14')](0x1f4,_0x46f98a[_0x4ca3('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 5659c66..a4470b1 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 _0x0f2e=['/:id/actions','getActions','post','addAllCondition','/:id/any_conditions','addAnyCondition','addAction','put','/:id','update','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','show','/:id/all_conditions','getAllConditions','getAnyConditions'];(function(_0x221a9f,_0x2a5e1c){var _0x5976c7=function(_0x1c2055){while(--_0x1c2055){_0x221a9f['push'](_0x221a9f['shift']());}};_0x5976c7(++_0x2a5e1c);}(_0x0f2e,0x16c));var _0xe0f2=function(_0x1d3fdc,_0x2b5c54){_0x1d3fdc=_0x1d3fdc-0x0;var _0x128bb0=_0x0f2e[_0x1d3fdc];return _0x128bb0;};'use strict';var multer=require(_0xe0f2('0x0'));var util=require(_0xe0f2('0x1'));var path=require(_0xe0f2('0x2'));var timeout=require('connect-timeout');var express=require(_0xe0f2('0x3'));var router=express[_0xe0f2('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xe0f2('0x5'));var config=require(_0xe0f2('0x6'));var controller=require(_0xe0f2('0x7'));router[_0xe0f2('0x8')]('/',auth[_0xe0f2('0x9')](),controller['index']);router[_0xe0f2('0x8')]('/:id',auth[_0xe0f2('0x9')](),controller[_0xe0f2('0xa')]);router['get'](_0xe0f2('0xb'),auth['isAuthenticated'](),controller[_0xe0f2('0xc')]);router[_0xe0f2('0x8')]('/:id/any_conditions',auth[_0xe0f2('0x9')](),controller[_0xe0f2('0xd')]);router[_0xe0f2('0x8')](_0xe0f2('0xe'),auth[_0xe0f2('0x9')](),controller[_0xe0f2('0xf')]);router[_0xe0f2('0x10')]('/',auth[_0xe0f2('0x9')](),controller['create']);router[_0xe0f2('0x10')](_0xe0f2('0xb'),auth[_0xe0f2('0x9')](),controller[_0xe0f2('0x11')]);router['post'](_0xe0f2('0x12'),auth[_0xe0f2('0x9')](),controller[_0xe0f2('0x13')]);router[_0xe0f2('0x10')]('/:id/actions',auth['isAuthenticated'](),controller[_0xe0f2('0x14')]);router[_0xe0f2('0x15')](_0xe0f2('0x16'),auth[_0xe0f2('0x9')](),controller[_0xe0f2('0x17')]);router[_0xe0f2('0x18')](_0xe0f2('0x16'),auth[_0xe0f2('0x9')](),controller[_0xe0f2('0x19')]);module[_0xe0f2('0x1a')]=router; \ No newline at end of file +var _0xda6e=['addAllCondition','addAction','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./trigger.controller','isAuthenticated','index','get','/:id','/:id/all_conditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','create','post'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xda6e,0x88));var _0xeda6=function(_0x328d48,_0xd73454){_0x328d48=_0x328d48-0x0;var _0x34bcbf=_0xda6e[_0x328d48];return _0x34bcbf;};'use strict';var multer=require(_0xeda6('0x0'));var util=require(_0xeda6('0x1'));var path=require(_0xeda6('0x2'));var timeout=require(_0xeda6('0x3'));var express=require(_0xeda6('0x4'));var router=express[_0xeda6('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xeda6('0x6'));var config=require(_0xeda6('0x7'));var controller=require(_0xeda6('0x8'));router['get']('/',auth[_0xeda6('0x9')](),controller[_0xeda6('0xa')]);router[_0xeda6('0xb')](_0xeda6('0xc'),auth[_0xeda6('0x9')](),controller['show']);router[_0xeda6('0xb')](_0xeda6('0xd'),auth['isAuthenticated'](),controller['getAllConditions']);router[_0xeda6('0xb')](_0xeda6('0xe'),auth[_0xeda6('0x9')](),controller[_0xeda6('0xf')]);router['get'](_0xeda6('0x10'),auth['isAuthenticated'](),controller[_0xeda6('0x11')]);router['post']('/',auth[_0xeda6('0x9')](),controller[_0xeda6('0x12')]);router[_0xeda6('0x13')](_0xeda6('0xd'),auth['isAuthenticated'](),controller[_0xeda6('0x14')]);router[_0xeda6('0x13')](_0xeda6('0xe'),auth['isAuthenticated'](),controller['addAnyCondition']);router[_0xeda6('0x13')](_0xeda6('0x10'),auth[_0xeda6('0x9')](),controller[_0xeda6('0x15')]);router[_0xeda6('0x16')](_0xeda6('0xc'),auth[_0xeda6('0x9')](),controller['update']);router[_0xeda6('0x17')](_0xeda6('0xc'),auth['isAuthenticated'](),controller[_0xeda6('0x18')]);module[_0xeda6('0x19')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 0156432..fa14a87 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 _0xc4a5=['sequelize','STRING','BOOLEAN'];(function(_0x5b0779,_0x40d92a){var _0x2d8671=function(_0x5cd62d){while(--_0x5cd62d){_0x5b0779['push'](_0x5b0779['shift']());}};_0x2d8671(++_0x40d92a);}(_0xc4a5,0x1b3));var _0x5c4a=function(_0x80d733,_0x266211){_0x80d733=_0x80d733-0x0;var _0x435868=_0xc4a5[_0x80d733];return _0x435868;};'use strict';var Sequelize=require(_0x5c4a('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x5c4a('0x1')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x5c4a('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x6665=['STRING','BOOLEAN','sequelize','exports'];(function(_0x532412,_0x1b8cce){var _0x55da2c=function(_0x16eb55){while(--_0x16eb55){_0x532412['push'](_0x532412['shift']());}};_0x55da2c(++_0x1b8cce);}(_0x6665,0x13e));var _0x5666=function(_0x261e29,_0x10fffd){_0x261e29=_0x261e29-0x0;var _0x25ef43=_0x6665[_0x261e29];return _0x25ef43;};'use strict';var Sequelize=require(_0x5666('0x0'));module[_0x5666('0x1')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x5666('0x2')]},'description':{'type':Sequelize[_0x5666('0x2')]},'status':{'type':Sequelize[_0x5666('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index 2191732..f4cef69 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 _0xb299=['order','sort','where','filter','VIRTUAL','merge','include','rows','show','params','rawAttributes','length','includeAll','options','find','catch','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','pick','getAnyConditions','TriggerId','Action','getActions','nolimit','eml-format','zip-dir','moment','bluebird','path','sox','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','save','then','destroy','get','Triggers','error','stack','name','send','index','map','Trigger','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty'];(function(_0x5a416e,_0x2234ee){var _0x2e3830=function(_0x7d85c2){while(--_0x7d85c2){_0x5a416e['push'](_0x5a416e['shift']());}};_0x2e3830(++_0x2234ee);}(_0xb299,0x13f));var _0x9b29=function(_0x4c36c2,_0x36bbd0){_0x4c36c2=_0x4c36c2-0x0;var _0x2839ca=_0xb299[_0x4c36c2];return _0x2839ca;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9b29('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9b29('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9b29('0x2'));var BPromise=require(_0x9b29('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x9b29('0x4'));var sox=require(_0x9b29('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x9b29('0x6'));var squel=require(_0x9b29('0x7'));var crypto=require('crypto');var jsforce=require(_0x9b29('0x8'));var deskjs=require(_0x9b29('0x9'));var toCsv=require(_0x9b29('0xa'));var querystring=require('querystring');var Papa=require(_0x9b29('0xb'));var Redis=require(_0x9b29('0xc'));var authService=require(_0x9b29('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x9b29('0xe'));var hardwareService=require(_0x9b29('0xf'));var logger=require(_0x9b29('0x10'))('api');var utils=require(_0x9b29('0x11'));var config=require(_0x9b29('0x12'));var db=require(_0x9b29('0x13'))['db'];function respondWithStatusCode(_0x43e94e,_0x5d51b1){_0x5d51b1=_0x5d51b1||0xcc;return function(_0xdcb0fa){if(_0xdcb0fa){return _0x43e94e[_0x9b29('0x14')](_0x5d51b1);}return _0x43e94e['status'](_0x5d51b1)[_0x9b29('0x15')]();};}function respondWithResult(_0x476c0b,_0x308b34){_0x308b34=_0x308b34||0xc8;return function(_0x263996){if(_0x263996){return _0x476c0b[_0x9b29('0x16')](_0x308b34)[_0x9b29('0x17')](_0x263996);}};}function respondWithFilteredResult(_0x2a2fef,_0x5d1d36){return function(_0x439269){if(_0x439269){var _0x28ab44=_0x439269[_0x9b29('0x18')],_0x3a0f10=_0x5d1d36[_0x9b29('0x19')],_0x538fe6=_0x5d1d36[_0x9b29('0x19')]+_0x5d1d36[_0x9b29('0x1a')],_0x2cc3b3;if(_0x538fe6>=_0x28ab44){_0x538fe6=_0x28ab44;_0x2cc3b3=0xc8;}else{_0x2cc3b3=0xce;}_0x2a2fef[_0x9b29('0x16')](_0x2cc3b3);return _0x2a2fef[_0x9b29('0x1b')](_0x9b29('0x1c'),_0x3a0f10+'-'+_0x538fe6+'/'+_0x28ab44)['json'](_0x439269);}return null;};}function patchUpdates(_0x3892ad){return function(_0x35eb85){try{jsonpatch[_0x9b29('0x1d')](_0x35eb85,_0x3892ad,!![]);}catch(_0x122e31){return BPromise['reject'](_0x122e31);}return _0x35eb85[_0x9b29('0x1e')]();};}function saveUpdates(_0x3957cb,_0x385a8a){return function(_0x4ad87d){if(_0x4ad87d){return _0x4ad87d['update'](_0x3957cb)[_0x9b29('0x1f')](function(_0x2653ac){return _0x2653ac;});}return null;};}function removeEntity(_0x26cca6,_0x591195){return function(_0x2a3c47){if(_0x2a3c47){return _0x2a3c47[_0x9b29('0x20')]()[_0x9b29('0x1f')](function(){var _0x5b3154=_0x2a3c47[_0x9b29('0x21')]({'plain':!![]});var _0x21655d=_0x9b29('0x22');return db['UserProfileResource'][_0x9b29('0x20')]({'where':{'type':_0x21655d,'resourceId':_0x5b3154['id']}})[_0x9b29('0x1f')](function(){return _0x2a3c47;});})[_0x9b29('0x1f')](function(){_0x26cca6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x56d9b6,_0x4dda4a){return function(_0xf220a4){if(!_0xf220a4){_0x56d9b6[_0x9b29('0x14')](0x194);}return _0xf220a4;};}function handleError(_0x3ffa66,_0x4d7d49){_0x4d7d49=_0x4d7d49||0x1f4;return function(_0xf9f0dd){logger[_0x9b29('0x23')](_0xf9f0dd[_0x9b29('0x24')]);if(_0xf9f0dd['name']){delete _0xf9f0dd[_0x9b29('0x25')];}_0x3ffa66[_0x9b29('0x16')](_0x4d7d49)[_0x9b29('0x26')](_0xf9f0dd);};}exports[_0x9b29('0x27')]=function(_0x41eba4,_0x67966c){var _0xc13d2a={},_0x1159c1={},_0xfaa8cc={'count':0x0,'rows':[]};var _0x24e602=_[_0x9b29('0x28')](db[_0x9b29('0x29')]['rawAttributes'],function(_0x119290){return{'name':_0x119290[_0x9b29('0x2a')],'type':_0x119290[_0x9b29('0x2b')][_0x9b29('0x2c')]};});_0x1159c1[_0x9b29('0x2d')]=_[_0x9b29('0x28')](_0x24e602,_0x9b29('0x25'));_0x1159c1[_0x9b29('0x2e')]=_[_0x9b29('0x2f')](_0x41eba4['query']);_0x1159c1[_0x9b29('0x30')]=_[_0x9b29('0x31')](_0x1159c1[_0x9b29('0x2d')],_0x1159c1[_0x9b29('0x2e')]);_0xc13d2a[_0x9b29('0x32')]=_[_0x9b29('0x31')](_0x1159c1[_0x9b29('0x2d')],qs[_0x9b29('0x33')](_0x41eba4[_0x9b29('0x2e')][_0x9b29('0x33')]));_0xc13d2a[_0x9b29('0x32')]=_0xc13d2a[_0x9b29('0x32')]['length']?_0xc13d2a[_0x9b29('0x32')]:_0x1159c1[_0x9b29('0x2d')];if(!_0x41eba4[_0x9b29('0x2e')][_0x9b29('0x34')]('nolimit')){_0xc13d2a[_0x9b29('0x1a')]=qs[_0x9b29('0x1a')](_0x41eba4[_0x9b29('0x2e')][_0x9b29('0x1a')]);_0xc13d2a[_0x9b29('0x19')]=qs['offset'](_0x41eba4[_0x9b29('0x2e')]['offset']);}_0xc13d2a[_0x9b29('0x35')]=qs[_0x9b29('0x36')](_0x41eba4[_0x9b29('0x2e')][_0x9b29('0x36')]);_0xc13d2a[_0x9b29('0x37')]=qs[_0x9b29('0x30')](_['pick'](_0x41eba4[_0x9b29('0x2e')],_0x1159c1[_0x9b29('0x30')]));if(_0x41eba4[_0x9b29('0x2e')][_0x9b29('0x38')]){_0xc13d2a[_0x9b29('0x37')]=_['merge'](_0xc13d2a[_0x9b29('0x37')],{'$or':_[_0x9b29('0x28')](_0x24e602,function(_0x5d7d31){if(_0x5d7d31['type'][_0x9b29('0x2c')]!==_0x9b29('0x39')){var _0x5c12eb={};_0x5c12eb[_0x5d7d31['field']]={'$like':'%'+_0x41eba4[_0x9b29('0x2e')][_0x9b29('0x38')]+'%'};return _0x5c12eb;}})});}_0xc13d2a=_[_0x9b29('0x3a')]({},_0xc13d2a,_0x41eba4['options']);var _0x3359c7={'where':_0xc13d2a[_0x9b29('0x37')]};return db[_0x9b29('0x29')][_0x9b29('0x18')](_0x3359c7)['then'](function(_0x5617fb){_0xfaa8cc[_0x9b29('0x18')]=_0x5617fb;if(_0x41eba4[_0x9b29('0x2e')]['includeAll']){_0xc13d2a[_0x9b29('0x3b')]=[{'all':!![]}];}return db[_0x9b29('0x29')]['findAll'](_0xc13d2a);})[_0x9b29('0x1f')](function(_0xcd9e2e){_0xfaa8cc[_0x9b29('0x3c')]=_0xcd9e2e;return _0xfaa8cc;})['then'](respondWithFilteredResult(_0x67966c,_0xc13d2a))['catch'](handleError(_0x67966c,null));};exports[_0x9b29('0x3d')]=function(_0x5d7f58,_0xe329c8){var _0x1fc65c={'raw':![],'where':{'id':_0x5d7f58[_0x9b29('0x3e')]['id']}},_0x3571a7={};_0x3571a7[_0x9b29('0x2d')]=_[_0x9b29('0x2f')](db[_0x9b29('0x29')][_0x9b29('0x3f')]);_0x3571a7[_0x9b29('0x2e')]=_['keys'](_0x5d7f58[_0x9b29('0x2e')]);_0x3571a7[_0x9b29('0x30')]=_[_0x9b29('0x31')](_0x3571a7['model'],_0x3571a7[_0x9b29('0x2e')]);_0x1fc65c[_0x9b29('0x32')]=_[_0x9b29('0x31')](_0x3571a7[_0x9b29('0x2d')],qs[_0x9b29('0x33')](_0x5d7f58[_0x9b29('0x2e')][_0x9b29('0x33')]));_0x1fc65c[_0x9b29('0x32')]=_0x1fc65c[_0x9b29('0x32')][_0x9b29('0x40')]?_0x1fc65c[_0x9b29('0x32')]:_0x3571a7[_0x9b29('0x2d')];if(_0x5d7f58['query'][_0x9b29('0x41')]){_0x1fc65c[_0x9b29('0x3b')]=[{'all':!![]}];}_0x1fc65c=_[_0x9b29('0x3a')]({},_0x1fc65c,_0x5d7f58[_0x9b29('0x42')]);return db['Trigger'][_0x9b29('0x43')](_0x1fc65c)[_0x9b29('0x1f')](handleEntityNotFound(_0xe329c8,null))[_0x9b29('0x1f')](respondWithResult(_0xe329c8,null))[_0x9b29('0x44')](handleError(_0xe329c8,null));};exports['create']=function(_0x1af617,_0x4de950){return db[_0x9b29('0x29')]['create'](_0x1af617[_0x9b29('0x45')],{})[_0x9b29('0x1f')](function(_0x325f15){var _0x1d1e4a=_0x1af617[_0x9b29('0x46')]['get']({'plain':!![]});if(!_0x1d1e4a)throw new Error(_0x9b29('0x47'));if(_0x1d1e4a[_0x9b29('0x48')]===_0x9b29('0x46')){var _0x19901b=_0x325f15['get']({'plain':!![]});var _0x3b89a9=_0x9b29('0x22');return db[_0x9b29('0x49')]['find']({'where':{'name':_0x3b89a9,'userProfileId':_0x1d1e4a[_0x9b29('0x4a')]},'raw':!![]})['then'](function(_0x471388){if(_0x471388&&_0x471388[_0x9b29('0x4b')]===0x0){return db[_0x9b29('0x4c')][_0x9b29('0x4d')]({'name':_0x19901b[_0x9b29('0x25')],'resourceId':_0x19901b['id'],'type':_0x471388[_0x9b29('0x25')],'sectionId':_0x471388['id']},{})[_0x9b29('0x1f')](function(){return _0x325f15;});}else{return _0x325f15;}})[_0x9b29('0x44')](function(_0x2f219f){logger[_0x9b29('0x23')](_0x9b29('0x4e'),_0x2f219f);throw _0x2f219f;});}return _0x325f15;})[_0x9b29('0x1f')](respondWithResult(_0x4de950,0xc9))[_0x9b29('0x44')](handleError(_0x4de950,null));};exports[_0x9b29('0x4f')]=function(_0x1a328b,_0x4c2a41){if(_0x1a328b[_0x9b29('0x45')]['id']){delete _0x1a328b[_0x9b29('0x45')]['id'];}return db[_0x9b29('0x29')][_0x9b29('0x43')]({'where':{'id':_0x1a328b['params']['id']}})[_0x9b29('0x1f')](handleEntityNotFound(_0x4c2a41,null))[_0x9b29('0x1f')](saveUpdates(_0x1a328b['body'],null))[_0x9b29('0x1f')](respondWithResult(_0x4c2a41,null))['catch'](handleError(_0x4c2a41,null));};exports['destroy']=function(_0x478cfd,_0x83fab2){return db[_0x9b29('0x29')][_0x9b29('0x43')]({'where':{'id':_0x478cfd[_0x9b29('0x3e')]['id']}})[_0x9b29('0x1f')](handleEntityNotFound(_0x83fab2,null))['then'](removeEntity(_0x83fab2,null))[_0x9b29('0x44')](handleError(_0x83fab2,null));};exports[_0x9b29('0x50')]=function(_0x4317a4,_0x340483,_0x439fa0){if(_0x4317a4[_0x9b29('0x45')]['id']){delete _0x4317a4[_0x9b29('0x45')]['id'];}return db[_0x9b29('0x29')][_0x9b29('0x43')]({'where':{'id':_0x4317a4['params']['id']}})['then'](handleEntityNotFound(_0x340483,null))[_0x9b29('0x1f')](function(_0x84e7e3){if(_0x84e7e3){_0x4317a4[_0x9b29('0x45')][_0x9b29('0x51')]=_0x84e7e3['id'];return db[_0x9b29('0x52')][_0x9b29('0x4d')](_0x4317a4[_0x9b29('0x45')]);}})[_0x9b29('0x1f')](respondWithResult(_0x340483,null))[_0x9b29('0x44')](handleError(_0x340483,null));};exports[_0x9b29('0x53')]=function(_0x5223e0,_0x28ce03,_0x41e9ce){if(_0x5223e0[_0x9b29('0x45')]['id']){delete _0x5223e0[_0x9b29('0x45')]['id'];}return db[_0x9b29('0x29')][_0x9b29('0x43')]({'where':{'id':_0x5223e0[_0x9b29('0x3e')]['id']}})['then'](handleEntityNotFound(_0x28ce03,null))[_0x9b29('0x1f')](function(_0x44e518){if(_0x44e518){_0x5223e0[_0x9b29('0x45')][_0x9b29('0x54')]=_0x44e518['id'];return db['Condition'][_0x9b29('0x4d')](_0x5223e0[_0x9b29('0x45')]);}})[_0x9b29('0x1f')](respondWithResult(_0x28ce03,null))[_0x9b29('0x44')](handleError(_0x28ce03,null));};exports[_0x9b29('0x55')]=function(_0x391776,_0x5307bd,_0x2f9cc0){var _0x4b10f5={};var _0x3682df={};var _0x27f65d;var _0x5a96ac;return db[_0x9b29('0x29')][_0x9b29('0x56')]({'where':{'id':_0x391776[_0x9b29('0x3e')]['id']}})[_0x9b29('0x1f')](handleEntityNotFound(_0x5307bd,null))[_0x9b29('0x1f')](function(_0x13e687){if(_0x13e687){_0x27f65d=_0x13e687;_0x3682df[_0x9b29('0x2d')]=_[_0x9b29('0x2f')](db[_0x9b29('0x52')][_0x9b29('0x3f')]);_0x3682df[_0x9b29('0x2e')]=_[_0x9b29('0x2f')](_0x391776[_0x9b29('0x2e')]);_0x3682df[_0x9b29('0x30')]=_[_0x9b29('0x31')](_0x3682df[_0x9b29('0x2d')],_0x3682df[_0x9b29('0x2e')]);_0x4b10f5['attributes']=_['intersection'](_0x3682df[_0x9b29('0x2d')],qs[_0x9b29('0x33')](_0x391776[_0x9b29('0x2e')][_0x9b29('0x33')]));_0x4b10f5[_0x9b29('0x32')]=_0x4b10f5[_0x9b29('0x32')]['length']?_0x4b10f5[_0x9b29('0x32')]:_0x3682df['model'];_0x4b10f5['order']=qs[_0x9b29('0x36')](_0x391776[_0x9b29('0x2e')][_0x9b29('0x36')]);_0x4b10f5[_0x9b29('0x37')]=qs[_0x9b29('0x30')](_[_0x9b29('0x57')](_0x391776['query'],_0x3682df['filters']));if(_0x391776[_0x9b29('0x2e')]['filter']){_0x4b10f5['where']=_['merge'](_0x4b10f5[_0x9b29('0x37')],{'$or':_[_0x9b29('0x28')](_0x4b10f5[_0x9b29('0x32')],function(_0x131254){var _0x4592c7={};_0x4592c7[_0x131254]={'$like':'%'+_0x391776['query']['filter']+'%'};return _0x4592c7;})});}_0x4b10f5=_['merge']({},_0x4b10f5,_0x391776[_0x9b29('0x42')]);return _0x27f65d['getAllConditions'](_0x4b10f5);}})[_0x9b29('0x1f')](function(_0x3ef082){if(_0x3ef082){_0x5a96ac=_0x3ef082[_0x9b29('0x40')];if(!_0x391776[_0x9b29('0x2e')][_0x9b29('0x34')]('nolimit')){_0x4b10f5[_0x9b29('0x1a')]=qs[_0x9b29('0x1a')](_0x391776[_0x9b29('0x2e')][_0x9b29('0x1a')]);_0x4b10f5['offset']=qs['offset'](_0x391776['query'][_0x9b29('0x19')]);}return _0x27f65d[_0x9b29('0x55')](_0x4b10f5);}})[_0x9b29('0x1f')](function(_0x36e888){if(_0x36e888){return _0x36e888?{'count':_0x5a96ac,'rows':_0x36e888}:null;}})[_0x9b29('0x1f')](respondWithResult(_0x5307bd,null))[_0x9b29('0x44')](handleError(_0x5307bd,null));};exports[_0x9b29('0x58')]=function(_0x19d0fb,_0x4fd042,_0x408299){var _0x1148b7={};var _0x3cf9e7={};var _0x32f947;var _0x307857;return db[_0x9b29('0x29')]['findOne']({'where':{'id':_0x19d0fb[_0x9b29('0x3e')]['id']}})[_0x9b29('0x1f')](handleEntityNotFound(_0x4fd042,null))[_0x9b29('0x1f')](function(_0x470060){if(_0x470060){_0x32f947=_0x470060;_0x3cf9e7[_0x9b29('0x2d')]=_[_0x9b29('0x2f')](db[_0x9b29('0x52')][_0x9b29('0x3f')]);_0x3cf9e7[_0x9b29('0x2e')]=_[_0x9b29('0x2f')](_0x19d0fb[_0x9b29('0x2e')]);_0x3cf9e7[_0x9b29('0x30')]=_[_0x9b29('0x31')](_0x3cf9e7[_0x9b29('0x2d')],_0x3cf9e7[_0x9b29('0x2e')]);_0x1148b7['attributes']=_[_0x9b29('0x31')](_0x3cf9e7['model'],qs[_0x9b29('0x33')](_0x19d0fb[_0x9b29('0x2e')][_0x9b29('0x33')]));_0x1148b7[_0x9b29('0x32')]=_0x1148b7[_0x9b29('0x32')][_0x9b29('0x40')]?_0x1148b7['attributes']:_0x3cf9e7[_0x9b29('0x2d')];_0x1148b7[_0x9b29('0x35')]=qs[_0x9b29('0x36')](_0x19d0fb[_0x9b29('0x2e')][_0x9b29('0x36')]);_0x1148b7[_0x9b29('0x37')]=qs[_0x9b29('0x30')](_[_0x9b29('0x57')](_0x19d0fb[_0x9b29('0x2e')],_0x3cf9e7[_0x9b29('0x30')]));if(_0x19d0fb[_0x9b29('0x2e')][_0x9b29('0x38')]){_0x1148b7['where']=_['merge'](_0x1148b7[_0x9b29('0x37')],{'$or':_['map'](_0x1148b7[_0x9b29('0x32')],function(_0x5d5972){var _0x4d3dfc={};_0x4d3dfc[_0x5d5972]={'$like':'%'+_0x19d0fb['query']['filter']+'%'};return _0x4d3dfc;})});}_0x1148b7=_[_0x9b29('0x3a')]({},_0x1148b7,_0x19d0fb[_0x9b29('0x42')]);return _0x32f947[_0x9b29('0x58')](_0x1148b7);}})[_0x9b29('0x1f')](function(_0x47c6ac){if(_0x47c6ac){_0x307857=_0x47c6ac[_0x9b29('0x40')];if(!_0x19d0fb[_0x9b29('0x2e')][_0x9b29('0x34')]('nolimit')){_0x1148b7[_0x9b29('0x1a')]=qs[_0x9b29('0x1a')](_0x19d0fb['query'][_0x9b29('0x1a')]);_0x1148b7[_0x9b29('0x19')]=qs['offset'](_0x19d0fb[_0x9b29('0x2e')][_0x9b29('0x19')]);}return _0x32f947[_0x9b29('0x58')](_0x1148b7);}})[_0x9b29('0x1f')](function(_0x33662e){if(_0x33662e){return _0x33662e?{'count':_0x307857,'rows':_0x33662e}:null;}})['then'](respondWithResult(_0x4fd042,null))['catch'](handleError(_0x4fd042,null));};exports['addAction']=function(_0x44cb55,_0x2ff7c1,_0x24f20e){if(_0x44cb55[_0x9b29('0x45')]['id']){delete _0x44cb55[_0x9b29('0x45')]['id'];}return db[_0x9b29('0x29')]['find']({'where':{'id':_0x44cb55['params']['id']}})[_0x9b29('0x1f')](handleEntityNotFound(_0x2ff7c1,null))[_0x9b29('0x1f')](function(_0x58e41c){if(_0x58e41c){_0x44cb55[_0x9b29('0x45')][_0x9b29('0x59')]=_0x58e41c['id'];return db[_0x9b29('0x5a')][_0x9b29('0x4d')](_0x44cb55['body']);}})[_0x9b29('0x1f')](respondWithResult(_0x2ff7c1,null))['catch'](handleError(_0x2ff7c1,null));};exports[_0x9b29('0x5b')]=function(_0x38a8c3,_0x3c8ecd,_0x1d0029){var _0x1a462d={};var _0x31a2a6={};var _0x29f9ff;var _0x3bf70a;return db[_0x9b29('0x29')]['findOne']({'where':{'id':_0x38a8c3[_0x9b29('0x3e')]['id']}})[_0x9b29('0x1f')](handleEntityNotFound(_0x3c8ecd,null))['then'](function(_0x2718ed){if(_0x2718ed){_0x29f9ff=_0x2718ed;_0x31a2a6[_0x9b29('0x2d')]=_[_0x9b29('0x2f')](db[_0x9b29('0x5a')][_0x9b29('0x3f')]);_0x31a2a6[_0x9b29('0x2e')]=_[_0x9b29('0x2f')](_0x38a8c3[_0x9b29('0x2e')]);_0x31a2a6[_0x9b29('0x30')]=_[_0x9b29('0x31')](_0x31a2a6[_0x9b29('0x2d')],_0x31a2a6[_0x9b29('0x2e')]);_0x1a462d[_0x9b29('0x32')]=_[_0x9b29('0x31')](_0x31a2a6[_0x9b29('0x2d')],qs[_0x9b29('0x33')](_0x38a8c3['query'][_0x9b29('0x33')]));_0x1a462d[_0x9b29('0x32')]=_0x1a462d['attributes'][_0x9b29('0x40')]?_0x1a462d[_0x9b29('0x32')]:_0x31a2a6[_0x9b29('0x2d')];_0x1a462d[_0x9b29('0x35')]=qs[_0x9b29('0x36')](_0x38a8c3[_0x9b29('0x2e')][_0x9b29('0x36')]);_0x1a462d[_0x9b29('0x37')]=qs['filters'](_['pick'](_0x38a8c3[_0x9b29('0x2e')],_0x31a2a6[_0x9b29('0x30')]));if(_0x38a8c3[_0x9b29('0x2e')][_0x9b29('0x38')]){_0x1a462d[_0x9b29('0x37')]=_[_0x9b29('0x3a')](_0x1a462d['where'],{'$or':_[_0x9b29('0x28')](_0x1a462d[_0x9b29('0x32')],function(_0x22c586){var _0x19084c={};_0x19084c[_0x22c586]={'$like':'%'+_0x38a8c3[_0x9b29('0x2e')]['filter']+'%'};return _0x19084c;})});}_0x1a462d=_[_0x9b29('0x3a')]({},_0x1a462d,_0x38a8c3[_0x9b29('0x42')]);return _0x29f9ff[_0x9b29('0x5b')](_0x1a462d);}})[_0x9b29('0x1f')](function(_0x585920){if(_0x585920){_0x3bf70a=_0x585920[_0x9b29('0x40')];if(!_0x38a8c3[_0x9b29('0x2e')][_0x9b29('0x34')](_0x9b29('0x5c'))){_0x1a462d[_0x9b29('0x1a')]=qs['limit'](_0x38a8c3[_0x9b29('0x2e')][_0x9b29('0x1a')]);_0x1a462d[_0x9b29('0x19')]=qs[_0x9b29('0x19')](_0x38a8c3[_0x9b29('0x2e')]['offset']);}return _0x29f9ff['getActions'](_0x1a462d);}})[_0x9b29('0x1f')](function(_0x311aa2){if(_0x311aa2){return _0x311aa2?{'count':_0x3bf70a,'rows':_0x311aa2}:null;}})[_0x9b29('0x1f')](respondWithResult(_0x3c8ecd,null))['catch'](handleError(_0x3c8ecd,null));}; \ No newline at end of file +var _0x41ff=['name','send','index','map','Trigger','rawAttributes','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addAllCondition','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','getAnyConditions','addAction','TriggerId','Action','getActions','order','pick','html-pdf','rimraf','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','apply','reject','then','destroy','get','Triggers','end','error','stack'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x41ff,0x99));var _0xf41f=function(_0x4be2ed,_0x1a8965){_0x4be2ed=_0x4be2ed-0x0;var _0x119e43=_0x41ff[_0x4be2ed];return _0x119e43;};'use strict';var pdf=require(_0xf41f('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xf41f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf41f('0x2'));var moment=require(_0xf41f('0x3'));var BPromise=require(_0xf41f('0x4'));var Mustache=require(_0xf41f('0x5'));var util=require(_0xf41f('0x6'));var path=require('path');var sox=require(_0xf41f('0x7'));var csv=require(_0xf41f('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf41f('0x9'));var squel=require(_0xf41f('0xa'));var crypto=require(_0xf41f('0xb'));var jsforce=require(_0xf41f('0xc'));var deskjs=require(_0xf41f('0xd'));var toCsv=require('to-csv');var querystring=require(_0xf41f('0xe'));var Papa=require(_0xf41f('0xf'));var Redis=require(_0xf41f('0x10'));var authService=require(_0xf41f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xf41f('0x12'));var hardwareService=require(_0xf41f('0x13'));var logger=require(_0xf41f('0x14'))(_0xf41f('0x15'));var utils=require(_0xf41f('0x16'));var config=require(_0xf41f('0x17'));var db=require(_0xf41f('0x18'))['db'];function respondWithStatusCode(_0x2c5181,_0x536250){_0x536250=_0x536250||0xcc;return function(_0x11b455){if(_0x11b455){return _0x2c5181[_0xf41f('0x19')](_0x536250);}return _0x2c5181['status'](_0x536250)['end']();};}function respondWithResult(_0x88da5c,_0x6fc058){_0x6fc058=_0x6fc058||0xc8;return function(_0x5bf16f){if(_0x5bf16f){return _0x88da5c[_0xf41f('0x1a')](_0x6fc058)[_0xf41f('0x1b')](_0x5bf16f);}};}function respondWithFilteredResult(_0x32b7ab,_0x149763){return function(_0x255a76){if(_0x255a76){var _0x42ce48=_0x255a76[_0xf41f('0x1c')],_0x5b1659=_0x149763[_0xf41f('0x1d')],_0x53ded6=_0x149763[_0xf41f('0x1d')]+_0x149763['limit'],_0x49a268;if(_0x53ded6>=_0x42ce48){_0x53ded6=_0x42ce48;_0x49a268=0xc8;}else{_0x49a268=0xce;}_0x32b7ab['status'](_0x49a268);return _0x32b7ab['set']('Content-Range',_0x5b1659+'-'+_0x53ded6+'/'+_0x42ce48)['json'](_0x255a76);}return null;};}function patchUpdates(_0x52e063){return function(_0x3844d6){try{jsonpatch[_0xf41f('0x1e')](_0x3844d6,_0x52e063,!![]);}catch(_0x37bf08){return BPromise[_0xf41f('0x1f')](_0x37bf08);}return _0x3844d6['save']();};}function saveUpdates(_0xcedfd8,_0x180ee4){return function(_0x16debf){if(_0x16debf){return _0x16debf['update'](_0xcedfd8)[_0xf41f('0x20')](function(_0x66d83e){return _0x66d83e;});}return null;};}function removeEntity(_0x1033cf,_0x2eb4a3){return function(_0x51b90e){if(_0x51b90e){return _0x51b90e[_0xf41f('0x21')]()['then'](function(){var _0x30d768=_0x51b90e[_0xf41f('0x22')]({'plain':!![]});var _0xfcfdd5=_0xf41f('0x23');return db['UserProfileResource'][_0xf41f('0x21')]({'where':{'type':_0xfcfdd5,'resourceId':_0x30d768['id']}})[_0xf41f('0x20')](function(){return _0x51b90e;});})[_0xf41f('0x20')](function(){_0x1033cf['status'](0xcc)[_0xf41f('0x24')]();});}};}function handleEntityNotFound(_0x4d57bc,_0x4d0ff5){return function(_0xbb53e5){if(!_0xbb53e5){_0x4d57bc[_0xf41f('0x19')](0x194);}return _0xbb53e5;};}function handleError(_0x2c262f,_0x1815a8){_0x1815a8=_0x1815a8||0x1f4;return function(_0x32eee1){logger[_0xf41f('0x25')](_0x32eee1[_0xf41f('0x26')]);if(_0x32eee1[_0xf41f('0x27')]){delete _0x32eee1[_0xf41f('0x27')];}_0x2c262f[_0xf41f('0x1a')](_0x1815a8)[_0xf41f('0x28')](_0x32eee1);};}exports[_0xf41f('0x29')]=function(_0x5af34d,_0x27d0ad){var _0x26fd93={},_0x4c15b0={},_0x1da9fe={'count':0x0,'rows':[]};var _0x216307=_[_0xf41f('0x2a')](db[_0xf41f('0x2b')][_0xf41f('0x2c')],function(_0x19660b){return{'name':_0x19660b['fieldName'],'type':_0x19660b['type'][_0xf41f('0x2d')]};});_0x4c15b0['model']=_[_0xf41f('0x2a')](_0x216307,_0xf41f('0x27'));_0x4c15b0[_0xf41f('0x2e')]=_[_0xf41f('0x2f')](_0x5af34d[_0xf41f('0x2e')]);_0x4c15b0[_0xf41f('0x30')]=_[_0xf41f('0x31')](_0x4c15b0[_0xf41f('0x32')],_0x4c15b0[_0xf41f('0x2e')]);_0x26fd93[_0xf41f('0x33')]=_[_0xf41f('0x31')](_0x4c15b0[_0xf41f('0x32')],qs[_0xf41f('0x34')](_0x5af34d[_0xf41f('0x2e')][_0xf41f('0x34')]));_0x26fd93[_0xf41f('0x33')]=_0x26fd93[_0xf41f('0x33')][_0xf41f('0x35')]?_0x26fd93[_0xf41f('0x33')]:_0x4c15b0['model'];if(!_0x5af34d[_0xf41f('0x2e')][_0xf41f('0x36')](_0xf41f('0x37'))){_0x26fd93[_0xf41f('0x38')]=qs[_0xf41f('0x38')](_0x5af34d['query'][_0xf41f('0x38')]);_0x26fd93['offset']=qs[_0xf41f('0x1d')](_0x5af34d[_0xf41f('0x2e')]['offset']);}_0x26fd93['order']=qs[_0xf41f('0x39')](_0x5af34d[_0xf41f('0x2e')]['sort']);_0x26fd93[_0xf41f('0x3a')]=qs[_0xf41f('0x30')](_['pick'](_0x5af34d[_0xf41f('0x2e')],_0x4c15b0[_0xf41f('0x30')]));if(_0x5af34d[_0xf41f('0x2e')][_0xf41f('0x3b')]){_0x26fd93[_0xf41f('0x3a')]=_[_0xf41f('0x3c')](_0x26fd93[_0xf41f('0x3a')],{'$or':_[_0xf41f('0x2a')](_0x216307,function(_0x3ef605){if(_0x3ef605[_0xf41f('0x3d')][_0xf41f('0x2d')]!==_0xf41f('0x3e')){var _0x2c4279={};_0x2c4279[_0x3ef605['field']]={'$like':'%'+_0x5af34d[_0xf41f('0x2e')][_0xf41f('0x3b')]+'%'};return _0x2c4279;}})});}_0x26fd93=_[_0xf41f('0x3c')]({},_0x26fd93,_0x5af34d[_0xf41f('0x3f')]);var _0x49b6f7={'where':_0x26fd93[_0xf41f('0x3a')]};return db[_0xf41f('0x2b')][_0xf41f('0x1c')](_0x49b6f7)[_0xf41f('0x20')](function(_0x52a584){_0x1da9fe[_0xf41f('0x1c')]=_0x52a584;if(_0x5af34d['query'][_0xf41f('0x40')]){_0x26fd93[_0xf41f('0x41')]=[{'all':!![]}];}return db[_0xf41f('0x2b')][_0xf41f('0x42')](_0x26fd93);})['then'](function(_0x581ce6){_0x1da9fe[_0xf41f('0x43')]=_0x581ce6;return _0x1da9fe;})[_0xf41f('0x20')](respondWithFilteredResult(_0x27d0ad,_0x26fd93))[_0xf41f('0x44')](handleError(_0x27d0ad,null));};exports[_0xf41f('0x45')]=function(_0x31a3b3,_0x5663e8){var _0x484ded={'raw':![],'where':{'id':_0x31a3b3[_0xf41f('0x46')]['id']}},_0x22fe63={};_0x22fe63['model']=_[_0xf41f('0x2f')](db['Trigger'][_0xf41f('0x2c')]);_0x22fe63[_0xf41f('0x2e')]=_[_0xf41f('0x2f')](_0x31a3b3[_0xf41f('0x2e')]);_0x22fe63[_0xf41f('0x30')]=_[_0xf41f('0x31')](_0x22fe63['model'],_0x22fe63[_0xf41f('0x2e')]);_0x484ded[_0xf41f('0x33')]=_[_0xf41f('0x31')](_0x22fe63[_0xf41f('0x32')],qs[_0xf41f('0x34')](_0x31a3b3[_0xf41f('0x2e')]['fields']));_0x484ded[_0xf41f('0x33')]=_0x484ded[_0xf41f('0x33')]['length']?_0x484ded[_0xf41f('0x33')]:_0x22fe63[_0xf41f('0x32')];if(_0x31a3b3[_0xf41f('0x2e')][_0xf41f('0x40')]){_0x484ded[_0xf41f('0x41')]=[{'all':!![]}];}_0x484ded=_[_0xf41f('0x3c')]({},_0x484ded,_0x31a3b3['options']);return db['Trigger'][_0xf41f('0x47')](_0x484ded)['then'](handleEntityNotFound(_0x5663e8,null))['then'](respondWithResult(_0x5663e8,null))[_0xf41f('0x44')](handleError(_0x5663e8,null));};exports[_0xf41f('0x48')]=function(_0x5d85b5,_0x4e00e7){return db['Trigger']['create'](_0x5d85b5[_0xf41f('0x49')],{})[_0xf41f('0x20')](function(_0x5d897f){var _0x33c916=_0x5d85b5[_0xf41f('0x4a')][_0xf41f('0x22')]({'plain':!![]});if(!_0x33c916)throw new Error(_0xf41f('0x4b'));if(_0x33c916[_0xf41f('0x4c')]===_0xf41f('0x4a')){var _0x12c806=_0x5d897f['get']({'plain':!![]});var _0x56f726=_0xf41f('0x23');return db[_0xf41f('0x4d')][_0xf41f('0x47')]({'where':{'name':_0x56f726,'userProfileId':_0x33c916[_0xf41f('0x4e')]},'raw':!![]})[_0xf41f('0x20')](function(_0x1a7156){if(_0x1a7156&&_0x1a7156[_0xf41f('0x4f')]===0x0){return db[_0xf41f('0x50')]['create']({'name':_0x12c806[_0xf41f('0x27')],'resourceId':_0x12c806['id'],'type':_0x1a7156[_0xf41f('0x27')],'sectionId':_0x1a7156['id']},{})[_0xf41f('0x20')](function(){return _0x5d897f;});}else{return _0x5d897f;}})[_0xf41f('0x44')](function(_0x16c62c){logger[_0xf41f('0x25')](_0xf41f('0x51'),_0x16c62c);throw _0x16c62c;});}return _0x5d897f;})[_0xf41f('0x20')](respondWithResult(_0x4e00e7,0xc9))[_0xf41f('0x44')](handleError(_0x4e00e7,null));};exports[_0xf41f('0x52')]=function(_0x531586,_0xc00152){if(_0x531586['body']['id']){delete _0x531586['body']['id'];}return db[_0xf41f('0x2b')][_0xf41f('0x47')]({'where':{'id':_0x531586[_0xf41f('0x46')]['id']}})['then'](handleEntityNotFound(_0xc00152,null))[_0xf41f('0x20')](saveUpdates(_0x531586[_0xf41f('0x49')],null))[_0xf41f('0x20')](respondWithResult(_0xc00152,null))['catch'](handleError(_0xc00152,null));};exports[_0xf41f('0x21')]=function(_0x305f7e,_0x51b424){return db[_0xf41f('0x2b')][_0xf41f('0x47')]({'where':{'id':_0x305f7e['params']['id']}})['then'](handleEntityNotFound(_0x51b424,null))[_0xf41f('0x20')](removeEntity(_0x51b424,null))['catch'](handleError(_0x51b424,null));};exports[_0xf41f('0x53')]=function(_0xe62a9b,_0x20837a,_0x252fb6){if(_0xe62a9b[_0xf41f('0x49')]['id']){delete _0xe62a9b[_0xf41f('0x49')]['id'];}return db[_0xf41f('0x2b')][_0xf41f('0x47')]({'where':{'id':_0xe62a9b[_0xf41f('0x46')]['id']}})[_0xf41f('0x20')](handleEntityNotFound(_0x20837a,null))[_0xf41f('0x20')](function(_0x1a82d3){if(_0x1a82d3){_0xe62a9b[_0xf41f('0x49')]['TriggerAllId']=_0x1a82d3['id'];return db[_0xf41f('0x54')][_0xf41f('0x48')](_0xe62a9b['body']);}})[_0xf41f('0x20')](respondWithResult(_0x20837a,null))[_0xf41f('0x44')](handleError(_0x20837a,null));};exports[_0xf41f('0x55')]=function(_0x4796e7,_0x2b1b9d,_0x5a23bb){if(_0x4796e7[_0xf41f('0x49')]['id']){delete _0x4796e7['body']['id'];}return db[_0xf41f('0x2b')][_0xf41f('0x47')]({'where':{'id':_0x4796e7[_0xf41f('0x46')]['id']}})[_0xf41f('0x20')](handleEntityNotFound(_0x2b1b9d,null))['then'](function(_0x67256d){if(_0x67256d){_0x4796e7[_0xf41f('0x49')][_0xf41f('0x56')]=_0x67256d['id'];return db[_0xf41f('0x54')]['create'](_0x4796e7['body']);}})[_0xf41f('0x20')](respondWithResult(_0x2b1b9d,null))[_0xf41f('0x44')](handleError(_0x2b1b9d,null));};exports[_0xf41f('0x57')]=function(_0x216772,_0x5d96f3,_0x73b7e7){var _0x49f4fb={};var _0x36b805={};var _0xbfafe2;var _0x10aa60;return db[_0xf41f('0x2b')][_0xf41f('0x58')]({'where':{'id':_0x216772[_0xf41f('0x46')]['id']}})[_0xf41f('0x20')](handleEntityNotFound(_0x5d96f3,null))[_0xf41f('0x20')](function(_0x288665){if(_0x288665){_0xbfafe2=_0x288665;_0x36b805['model']=_['keys'](db['Condition'][_0xf41f('0x2c')]);_0x36b805['query']=_[_0xf41f('0x2f')](_0x216772[_0xf41f('0x2e')]);_0x36b805[_0xf41f('0x30')]=_[_0xf41f('0x31')](_0x36b805[_0xf41f('0x32')],_0x36b805[_0xf41f('0x2e')]);_0x49f4fb[_0xf41f('0x33')]=_[_0xf41f('0x31')](_0x36b805[_0xf41f('0x32')],qs['fields'](_0x216772[_0xf41f('0x2e')][_0xf41f('0x34')]));_0x49f4fb[_0xf41f('0x33')]=_0x49f4fb['attributes'][_0xf41f('0x35')]?_0x49f4fb['attributes']:_0x36b805['model'];_0x49f4fb['order']=qs[_0xf41f('0x39')](_0x216772[_0xf41f('0x2e')][_0xf41f('0x39')]);_0x49f4fb[_0xf41f('0x3a')]=qs[_0xf41f('0x30')](_['pick'](_0x216772[_0xf41f('0x2e')],_0x36b805[_0xf41f('0x30')]));if(_0x216772[_0xf41f('0x2e')][_0xf41f('0x3b')]){_0x49f4fb['where']=_['merge'](_0x49f4fb[_0xf41f('0x3a')],{'$or':_['map'](_0x49f4fb[_0xf41f('0x33')],function(_0x4d6fb0){var _0x563829={};_0x563829[_0x4d6fb0]={'$like':'%'+_0x216772['query'][_0xf41f('0x3b')]+'%'};return _0x563829;})});}_0x49f4fb=_[_0xf41f('0x3c')]({},_0x49f4fb,_0x216772['options']);return _0xbfafe2['getAllConditions'](_0x49f4fb);}})[_0xf41f('0x20')](function(_0x3cd03a){if(_0x3cd03a){_0x10aa60=_0x3cd03a[_0xf41f('0x35')];if(!_0x216772[_0xf41f('0x2e')]['hasOwnProperty'](_0xf41f('0x37'))){_0x49f4fb[_0xf41f('0x38')]=qs[_0xf41f('0x38')](_0x216772[_0xf41f('0x2e')][_0xf41f('0x38')]);_0x49f4fb[_0xf41f('0x1d')]=qs[_0xf41f('0x1d')](_0x216772[_0xf41f('0x2e')]['offset']);}return _0xbfafe2['getAllConditions'](_0x49f4fb);}})[_0xf41f('0x20')](function(_0x1e1fc1){if(_0x1e1fc1){return _0x1e1fc1?{'count':_0x10aa60,'rows':_0x1e1fc1}:null;}})['then'](respondWithResult(_0x5d96f3,null))['catch'](handleError(_0x5d96f3,null));};exports['getAnyConditions']=function(_0x450812,_0x293ab9,_0x3816f4){var _0x52cac8={};var _0x72a4e={};var _0x57aaaa;var _0x1689b5;return db[_0xf41f('0x2b')][_0xf41f('0x58')]({'where':{'id':_0x450812['params']['id']}})[_0xf41f('0x20')](handleEntityNotFound(_0x293ab9,null))[_0xf41f('0x20')](function(_0x122fe3){if(_0x122fe3){_0x57aaaa=_0x122fe3;_0x72a4e[_0xf41f('0x32')]=_[_0xf41f('0x2f')](db[_0xf41f('0x54')]['rawAttributes']);_0x72a4e[_0xf41f('0x2e')]=_['keys'](_0x450812[_0xf41f('0x2e')]);_0x72a4e[_0xf41f('0x30')]=_['intersection'](_0x72a4e[_0xf41f('0x32')],_0x72a4e['query']);_0x52cac8[_0xf41f('0x33')]=_[_0xf41f('0x31')](_0x72a4e['model'],qs[_0xf41f('0x34')](_0x450812['query']['fields']));_0x52cac8[_0xf41f('0x33')]=_0x52cac8['attributes'][_0xf41f('0x35')]?_0x52cac8[_0xf41f('0x33')]:_0x72a4e[_0xf41f('0x32')];_0x52cac8['order']=qs['sort'](_0x450812[_0xf41f('0x2e')][_0xf41f('0x39')]);_0x52cac8[_0xf41f('0x3a')]=qs[_0xf41f('0x30')](_['pick'](_0x450812[_0xf41f('0x2e')],_0x72a4e[_0xf41f('0x30')]));if(_0x450812['query']['filter']){_0x52cac8[_0xf41f('0x3a')]=_[_0xf41f('0x3c')](_0x52cac8['where'],{'$or':_[_0xf41f('0x2a')](_0x52cac8['attributes'],function(_0x536c73){var _0x59a982={};_0x59a982[_0x536c73]={'$like':'%'+_0x450812[_0xf41f('0x2e')][_0xf41f('0x3b')]+'%'};return _0x59a982;})});}_0x52cac8=_[_0xf41f('0x3c')]({},_0x52cac8,_0x450812[_0xf41f('0x3f')]);return _0x57aaaa[_0xf41f('0x59')](_0x52cac8);}})[_0xf41f('0x20')](function(_0xf1b9e6){if(_0xf1b9e6){_0x1689b5=_0xf1b9e6[_0xf41f('0x35')];if(!_0x450812[_0xf41f('0x2e')][_0xf41f('0x36')](_0xf41f('0x37'))){_0x52cac8['limit']=qs[_0xf41f('0x38')](_0x450812['query'][_0xf41f('0x38')]);_0x52cac8[_0xf41f('0x1d')]=qs[_0xf41f('0x1d')](_0x450812['query'][_0xf41f('0x1d')]);}return _0x57aaaa[_0xf41f('0x59')](_0x52cac8);}})[_0xf41f('0x20')](function(_0x80d2ce){if(_0x80d2ce){return _0x80d2ce?{'count':_0x1689b5,'rows':_0x80d2ce}:null;}})[_0xf41f('0x20')](respondWithResult(_0x293ab9,null))[_0xf41f('0x44')](handleError(_0x293ab9,null));};exports[_0xf41f('0x5a')]=function(_0x18e3bb,_0x378fb0,_0x403567){if(_0x18e3bb[_0xf41f('0x49')]['id']){delete _0x18e3bb['body']['id'];}return db[_0xf41f('0x2b')]['find']({'where':{'id':_0x18e3bb[_0xf41f('0x46')]['id']}})[_0xf41f('0x20')](handleEntityNotFound(_0x378fb0,null))[_0xf41f('0x20')](function(_0x5654e6){if(_0x5654e6){_0x18e3bb['body'][_0xf41f('0x5b')]=_0x5654e6['id'];return db[_0xf41f('0x5c')][_0xf41f('0x48')](_0x18e3bb[_0xf41f('0x49')]);}})[_0xf41f('0x20')](respondWithResult(_0x378fb0,null))[_0xf41f('0x44')](handleError(_0x378fb0,null));};exports[_0xf41f('0x5d')]=function(_0x5b1d9b,_0x3cfd38,_0x33a765){var _0x2241eb={};var _0x21ac9c={};var _0x4da865;var _0x5068ea;return db['Trigger'][_0xf41f('0x58')]({'where':{'id':_0x5b1d9b[_0xf41f('0x46')]['id']}})['then'](handleEntityNotFound(_0x3cfd38,null))['then'](function(_0x2133bc){if(_0x2133bc){_0x4da865=_0x2133bc;_0x21ac9c[_0xf41f('0x32')]=_[_0xf41f('0x2f')](db['Action'][_0xf41f('0x2c')]);_0x21ac9c[_0xf41f('0x2e')]=_[_0xf41f('0x2f')](_0x5b1d9b[_0xf41f('0x2e')]);_0x21ac9c['filters']=_['intersection'](_0x21ac9c[_0xf41f('0x32')],_0x21ac9c[_0xf41f('0x2e')]);_0x2241eb[_0xf41f('0x33')]=_['intersection'](_0x21ac9c['model'],qs[_0xf41f('0x34')](_0x5b1d9b[_0xf41f('0x2e')][_0xf41f('0x34')]));_0x2241eb[_0xf41f('0x33')]=_0x2241eb[_0xf41f('0x33')]['length']?_0x2241eb[_0xf41f('0x33')]:_0x21ac9c[_0xf41f('0x32')];_0x2241eb[_0xf41f('0x5e')]=qs['sort'](_0x5b1d9b[_0xf41f('0x2e')][_0xf41f('0x39')]);_0x2241eb[_0xf41f('0x3a')]=qs['filters'](_[_0xf41f('0x5f')](_0x5b1d9b[_0xf41f('0x2e')],_0x21ac9c['filters']));if(_0x5b1d9b[_0xf41f('0x2e')][_0xf41f('0x3b')]){_0x2241eb[_0xf41f('0x3a')]=_[_0xf41f('0x3c')](_0x2241eb[_0xf41f('0x3a')],{'$or':_['map'](_0x2241eb[_0xf41f('0x33')],function(_0x7aa8c2){var _0x34eb85={};_0x34eb85[_0x7aa8c2]={'$like':'%'+_0x5b1d9b['query'][_0xf41f('0x3b')]+'%'};return _0x34eb85;})});}_0x2241eb=_[_0xf41f('0x3c')]({},_0x2241eb,_0x5b1d9b['options']);return _0x4da865[_0xf41f('0x5d')](_0x2241eb);}})[_0xf41f('0x20')](function(_0x1aa5bd){if(_0x1aa5bd){_0x5068ea=_0x1aa5bd[_0xf41f('0x35')];if(!_0x5b1d9b[_0xf41f('0x2e')]['hasOwnProperty'](_0xf41f('0x37'))){_0x2241eb[_0xf41f('0x38')]=qs['limit'](_0x5b1d9b[_0xf41f('0x2e')][_0xf41f('0x38')]);_0x2241eb[_0xf41f('0x1d')]=qs[_0xf41f('0x1d')](_0x5b1d9b['query'][_0xf41f('0x1d')]);}return _0x4da865[_0xf41f('0x5d')](_0x2241eb);}})[_0xf41f('0x20')](function(_0x45144a){if(_0x45144a){return _0x45144a?{'count':_0x5068ea,'rows':_0x45144a}:null;}})['then'](respondWithResult(_0x3cfd38,null))[_0xf41f('0x44')](handleError(_0x3cfd38,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index d8dbacc..d4dfeb1 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 _0x07e1=['exports','define','Trigger','api','bluebird','request-promise','path','rimraf','../../config/environment','./trigger.attributes'];(function(_0x24778a,_0x3bb3d9){var _0x1e1c1f=function(_0x37a555){while(--_0x37a555){_0x24778a['push'](_0x24778a['shift']());}};_0x1e1c1f(++_0x3bb3d9);}(_0x07e1,0x19d));var _0x107e=function(_0x44912a,_0x266423){_0x44912a=_0x44912a-0x0;var _0x15a566=_0x07e1[_0x44912a];return _0x15a566;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x107e('0x0'));var moment=require('moment');var BPromise=require(_0x107e('0x1'));var rp=require(_0x107e('0x2'));var fs=require('fs');var path=require(_0x107e('0x3'));var rimraf=require(_0x107e('0x4'));var config=require(_0x107e('0x5'));var attributes=require(_0x107e('0x6'));module[_0x107e('0x7')]=function(_0x114940,_0x3d3049){return _0x114940[_0x107e('0x8')](_0x107e('0x9'),attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x164a=['bluebird','request-promise','../../config/environment','./trigger.attributes','exports','define','Trigger','util','../../config/logger','api'];(function(_0x27719a,_0x4c6655){var _0x117e2b=function(_0x4038f2){while(--_0x4038f2){_0x27719a['push'](_0x27719a['shift']());}};_0x117e2b(++_0x4c6655);}(_0x164a,0x133));var _0xa164=function(_0x4f6d08,_0x1b3dd0){_0x4f6d08=_0x4f6d08-0x0;var _0x53a9c6=_0x164a[_0x4f6d08];return _0x53a9c6;};'use strict';var _=require('lodash');var util=require(_0xa164('0x0'));var logger=require(_0xa164('0x1'))(_0xa164('0x2'));var moment=require('moment');var BPromise=require(_0xa164('0x3'));var rp=require(_0xa164('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa164('0x5'));var attributes=require(_0xa164('0x6'));module[_0xa164('0x7')]=function(_0x5b53e3,_0x2d3b78){return _0x5b53e3[_0xa164('0x8')](_0xa164('0x9'),attributes,{'tableName':'tools_triggers','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 1c16920..2f8dbbd 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 _0x13f6=['debug','stringify','error','code','message','info','result','GetTrigger','Trigger','findAll','options','limit','include','map','model','attributes','ShowTrigger','find','raw','where','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','Trigger,\x20%s,\x20%s','request\x20sent'];(function(_0x4dd4a1,_0x5ca922){var _0x168d0f=function(_0x19c2b7){while(--_0x19c2b7){_0x4dd4a1['push'](_0x4dd4a1['shift']());}};_0x168d0f(++_0x5ca922);}(_0x13f6,0x124));var _0x613f=function(_0x25d844,_0x18097f){_0x25d844=_0x25d844-0x0;var _0x2aa87a=_0x13f6[_0x25d844];return _0x2aa87a;};'use strict';var _=require(_0x613f('0x0'));var util=require(_0x613f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x613f('0x2'));var fs=require('fs');var Redis=require(_0x613f('0x3'));var db=require(_0x613f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x613f('0x5'))(_0x613f('0x6'));var config=require(_0x613f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x613f('0x8')][_0x613f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5618fa,_0x4b546b,_0x5a84f2){return new BPromise(function(_0x5c93c0,_0x2d5973){return client[_0x613f('0xa')](_0x5618fa,_0x5a84f2)[_0x613f('0xb')](function(_0x35b672){logger['info'](_0x613f('0xc'),_0x4b546b,_0x613f('0xd'));logger[_0x613f('0xe')]('Trigger,\x20%s,\x20%s,\x20%s',_0x4b546b,_0x613f('0xd'),JSON[_0x613f('0xf')](_0x35b672));if(_0x35b672[_0x613f('0x10')]){if(_0x35b672['error'][_0x613f('0x11')]===0x1f4){logger[_0x613f('0x10')]('Trigger,\x20%s,\x20%s',_0x4b546b,_0x35b672['error']['message']);return _0x2d5973(_0x35b672[_0x613f('0x10')][_0x613f('0x12')]);}logger[_0x613f('0x10')](_0x613f('0xc'),_0x4b546b,_0x35b672[_0x613f('0x10')][_0x613f('0x12')]);return _0x5c93c0(_0x35b672[_0x613f('0x10')][_0x613f('0x12')]);}else{logger[_0x613f('0x13')](_0x613f('0xc'),_0x4b546b,'request\x20sent');_0x5c93c0(_0x35b672[_0x613f('0x14')]['message']);}})['catch'](function(_0x1bc605){logger[_0x613f('0x10')]('Trigger,\x20%s,\x20%s',_0x4b546b,_0x1bc605);_0x2d5973(_0x1bc605);});});}exports[_0x613f('0x15')]=function(_0x4f9dae){var _0x62ebfe=this;return new Promise(function(_0x1e5a11,_0x431266){return db[_0x613f('0x16')][_0x613f('0x17')]({'raw':_0x4f9dae[_0x613f('0x18')]?_0x4f9dae['options']['raw']===undefined?!![]:![]:!![],'where':_0x4f9dae[_0x613f('0x18')]?_0x4f9dae['options']['where']||null:null,'attributes':_0x4f9dae[_0x613f('0x18')]?_0x4f9dae[_0x613f('0x18')]['attributes']||null:null,'limit':_0x4f9dae[_0x613f('0x18')]?_0x4f9dae[_0x613f('0x18')][_0x613f('0x19')]||null:null,'include':_0x4f9dae['options']?_0x4f9dae['options'][_0x613f('0x1a')]?_[_0x613f('0x1b')](_0x4f9dae[_0x613f('0x18')]['include'],function(_0x41104e){return{'model':db[_0x41104e[_0x613f('0x1c')]],'as':_0x41104e['as'],'attributes':_0x41104e[_0x613f('0x1d')],'include':_0x41104e[_0x613f('0x1a')]?_[_0x613f('0x1b')](_0x41104e['include'],function(_0x30fb15){return{'model':db[_0x30fb15[_0x613f('0x1c')]],'as':_0x30fb15['as'],'attributes':_0x30fb15['attributes'],'include':_0x30fb15[_0x613f('0x1a')]?_[_0x613f('0x1b')](_0x30fb15[_0x613f('0x1a')],function(_0x4a878d){return{'model':db[_0x4a878d['model']],'as':_0x4a878d['as'],'attributes':_0x4a878d['attributes']};}):[]};}):[]};}):[]:[]})[_0x613f('0xb')](function(_0x594c28){logger[_0x613f('0x13')](_0x613f('0x15'),_0x4f9dae);logger['debug'](_0x613f('0x15'),_0x4f9dae,JSON[_0x613f('0xf')](_0x594c28));_0x1e5a11(_0x594c28);})['catch'](function(_0x4cff5d){logger['error'](_0x613f('0x15'),_0x4cff5d[_0x613f('0x12')],_0x4f9dae);_0x431266(_0x62ebfe[_0x613f('0x10')](0x1f4,_0x4cff5d['message']));});});};exports[_0x613f('0x1e')]=function(_0x439478){var _0xd335a6=this;return new Promise(function(_0x19bb8f,_0x4f8500){return db[_0x613f('0x16')][_0x613f('0x1f')]({'raw':_0x439478[_0x613f('0x18')]?_0x439478[_0x613f('0x18')][_0x613f('0x20')]===undefined?!![]:![]:!![],'where':_0x439478[_0x613f('0x18')]?_0x439478['options'][_0x613f('0x21')]||null:null,'attributes':_0x439478[_0x613f('0x18')]?_0x439478[_0x613f('0x18')]['attributes']||null:null,'include':_0x439478[_0x613f('0x18')]?_0x439478['options'][_0x613f('0x1a')]?_[_0x613f('0x1b')](_0x439478[_0x613f('0x18')][_0x613f('0x1a')],function(_0x2bceaa){return{'model':db[_0x2bceaa[_0x613f('0x1c')]],'as':_0x2bceaa['as'],'attributes':_0x2bceaa['attributes'],'include':_0x2bceaa[_0x613f('0x1a')]?_[_0x613f('0x1b')](_0x2bceaa[_0x613f('0x1a')],function(_0x25b2e4){return{'model':db[_0x25b2e4[_0x613f('0x1c')]],'as':_0x25b2e4['as'],'attributes':_0x25b2e4['attributes'],'include':_0x25b2e4['include']?_['map'](_0x25b2e4[_0x613f('0x1a')],function(_0x72c804){return{'model':db[_0x72c804[_0x613f('0x1c')]],'as':_0x72c804['as'],'attributes':_0x72c804[_0x613f('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fc02e){logger[_0x613f('0x13')]('ShowTrigger',_0x439478);logger[_0x613f('0xe')]('ShowTrigger',_0x439478,JSON[_0x613f('0xf')](_0x2fc02e));_0x19bb8f(_0x2fc02e);})['catch'](function(_0x36dfd4){logger['error'](_0x613f('0x1e'),_0x36dfd4[_0x613f('0x12')],_0x439478);_0x4f8500(_0xd335a6[_0x613f('0x10')](0x1f4,_0x36dfd4['message']));});});}; \ No newline at end of file +var _0xeffd=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','Trigger,\x20%s,\x20%s','message','result','catch','Trigger','findAll','options','raw','where','limit','include','map','model','attributes','GetTrigger','find','ShowTrigger','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xeffd,0x6b));var _0xdeff=function(_0x316b51,_0x2d9dfb){_0x316b51=_0x316b51-0x0;var _0xc57f3=_0xeffd[_0x316b51];return _0xc57f3;};'use strict';var _=require(_0xdeff('0x0'));var util=require('util');var moment=require(_0xdeff('0x1'));var BPromise=require(_0xdeff('0x2'));var rs=require(_0xdeff('0x3'));var fs=require('fs');var Redis=require(_0xdeff('0x4'));var db=require(_0xdeff('0x5'))['db'];var utils=require(_0xdeff('0x6'));var logger=require(_0xdeff('0x7'))(_0xdeff('0x8'));var config=require(_0xdeff('0x9'));var jayson=require(_0xdeff('0xa'));var client=jayson[_0xdeff('0xb')][_0xdeff('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x281ad7,_0x256323,_0x39878e){return new BPromise(function(_0x12e953,_0x24897a){return client['request'](_0x281ad7,_0x39878e)[_0xdeff('0xd')](function(_0x45a8a6){logger[_0xdeff('0xe')]('Trigger,\x20%s,\x20%s',_0x256323,_0xdeff('0xf'));logger[_0xdeff('0x10')](_0xdeff('0x11'),_0x256323,_0xdeff('0xf'),JSON[_0xdeff('0x12')](_0x45a8a6));if(_0x45a8a6[_0xdeff('0x13')]){if(_0x45a8a6[_0xdeff('0x13')][_0xdeff('0x14')]===0x1f4){logger['error'](_0xdeff('0x15'),_0x256323,_0x45a8a6[_0xdeff('0x13')]['message']);return _0x24897a(_0x45a8a6[_0xdeff('0x13')]['message']);}logger['error'](_0xdeff('0x15'),_0x256323,_0x45a8a6[_0xdeff('0x13')][_0xdeff('0x16')]);return _0x12e953(_0x45a8a6[_0xdeff('0x13')]['message']);}else{logger[_0xdeff('0xe')](_0xdeff('0x15'),_0x256323,_0xdeff('0xf'));_0x12e953(_0x45a8a6[_0xdeff('0x17')][_0xdeff('0x16')]);}})[_0xdeff('0x18')](function(_0x577244){logger['error'](_0xdeff('0x15'),_0x256323,_0x577244);_0x24897a(_0x577244);});});}exports['GetTrigger']=function(_0x5c9837){var _0x35635f=this;return new Promise(function(_0x369e13,_0x4b14b6){return db[_0xdeff('0x19')][_0xdeff('0x1a')]({'raw':_0x5c9837[_0xdeff('0x1b')]?_0x5c9837[_0xdeff('0x1b')][_0xdeff('0x1c')]===undefined?!![]:![]:!![],'where':_0x5c9837[_0xdeff('0x1b')]?_0x5c9837[_0xdeff('0x1b')][_0xdeff('0x1d')]||null:null,'attributes':_0x5c9837['options']?_0x5c9837['options']['attributes']||null:null,'limit':_0x5c9837[_0xdeff('0x1b')]?_0x5c9837['options'][_0xdeff('0x1e')]||null:null,'include':_0x5c9837[_0xdeff('0x1b')]?_0x5c9837['options'][_0xdeff('0x1f')]?_[_0xdeff('0x20')](_0x5c9837['options']['include'],function(_0x3b2554){return{'model':db[_0x3b2554[_0xdeff('0x21')]],'as':_0x3b2554['as'],'attributes':_0x3b2554[_0xdeff('0x22')],'include':_0x3b2554[_0xdeff('0x1f')]?_[_0xdeff('0x20')](_0x3b2554['include'],function(_0xb08f19){return{'model':db[_0xb08f19[_0xdeff('0x21')]],'as':_0xb08f19['as'],'attributes':_0xb08f19[_0xdeff('0x22')],'include':_0xb08f19[_0xdeff('0x1f')]?_[_0xdeff('0x20')](_0xb08f19[_0xdeff('0x1f')],function(_0x3d0111){return{'model':db[_0x3d0111['model']],'as':_0x3d0111['as'],'attributes':_0x3d0111[_0xdeff('0x22')]};}):[]};}):[]};}):[]:[]})[_0xdeff('0xd')](function(_0x53b168){logger['info'](_0xdeff('0x23'),_0x5c9837);logger[_0xdeff('0x10')](_0xdeff('0x23'),_0x5c9837,JSON[_0xdeff('0x12')](_0x53b168));_0x369e13(_0x53b168);})[_0xdeff('0x18')](function(_0xf9b278){logger[_0xdeff('0x13')]('GetTrigger',_0xf9b278[_0xdeff('0x16')],_0x5c9837);_0x4b14b6(_0x35635f[_0xdeff('0x13')](0x1f4,_0xf9b278[_0xdeff('0x16')]));});});};exports['ShowTrigger']=function(_0x59f7a0){var _0x346743=this;return new Promise(function(_0x505e3f,_0x69842a){return db[_0xdeff('0x19')][_0xdeff('0x24')]({'raw':_0x59f7a0['options']?_0x59f7a0[_0xdeff('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x59f7a0['options']?_0x59f7a0[_0xdeff('0x1b')][_0xdeff('0x1d')]||null:null,'attributes':_0x59f7a0[_0xdeff('0x1b')]?_0x59f7a0[_0xdeff('0x1b')]['attributes']||null:null,'include':_0x59f7a0[_0xdeff('0x1b')]?_0x59f7a0[_0xdeff('0x1b')][_0xdeff('0x1f')]?_[_0xdeff('0x20')](_0x59f7a0[_0xdeff('0x1b')][_0xdeff('0x1f')],function(_0x321ef0){return{'model':db[_0x321ef0['model']],'as':_0x321ef0['as'],'attributes':_0x321ef0[_0xdeff('0x22')],'include':_0x321ef0['include']?_[_0xdeff('0x20')](_0x321ef0[_0xdeff('0x1f')],function(_0x2e1736){return{'model':db[_0x2e1736[_0xdeff('0x21')]],'as':_0x2e1736['as'],'attributes':_0x2e1736[_0xdeff('0x22')],'include':_0x2e1736[_0xdeff('0x1f')]?_['map'](_0x2e1736[_0xdeff('0x1f')],function(_0x3bf462){return{'model':db[_0x3bf462['model']],'as':_0x3bf462['as'],'attributes':_0x3bf462[_0xdeff('0x22')]};}):[]};}):[]};}):[]:[]})[_0xdeff('0xd')](function(_0x1c6d4c){logger[_0xdeff('0xe')](_0xdeff('0x25'),_0x59f7a0);logger[_0xdeff('0x10')](_0xdeff('0x25'),_0x59f7a0,JSON[_0xdeff('0x12')](_0x1c6d4c));_0x505e3f(_0x1c6d4c);})['catch'](function(_0x118752){logger['error'](_0xdeff('0x25'),_0x118752[_0xdeff('0x16')],_0x59f7a0);_0x69842a(_0x346743[_0xdeff('0x13')](0x1f4,_0x118752['message']));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 012d9d7..27085ce 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 _0xf3cd=['../../components/interaction/service','../../config/environment','./trunk.controller','isAuthenticated','index','get','/:id','show','/:id/clone','post','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x4d9f0a,_0x1ff504){var _0x36ac94=function(_0x1e8d8e){while(--_0x1e8d8e){_0x4d9f0a['push'](_0x4d9f0a['shift']());}};_0x36ac94(++_0x1ff504);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x31218c,_0x28ae34){_0x31218c=_0x31218c-0x0;var _0x13e4ab=_0xf3cd[_0x31218c];return _0x13e4ab;};'use strict';var multer=require(_0xdf3c('0x0'));var util=require(_0xdf3c('0x1'));var path=require(_0xdf3c('0x2'));var timeout=require(_0xdf3c('0x3'));var express=require(_0xdf3c('0x4'));var router=express[_0xdf3c('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xdf3c('0x6'));var config=require(_0xdf3c('0x7'));var controller=require(_0xdf3c('0x8'));router['get']('/',auth[_0xdf3c('0x9')](),controller[_0xdf3c('0xa')]);router[_0xdf3c('0xb')](_0xdf3c('0xc'),auth[_0xdf3c('0x9')](),controller[_0xdf3c('0xd')]);router['post'](_0xdf3c('0xe'),auth['isAuthenticated'](),controller['clone']);router[_0xdf3c('0xf')]('/',auth[_0xdf3c('0x9')](),controller['create']);router[_0xdf3c('0x10')](_0xdf3c('0xc'),auth[_0xdf3c('0x9')](),controller[_0xdf3c('0x11')]);router[_0xdf3c('0x12')](_0xdf3c('0xc'),auth[_0xdf3c('0x9')](),controller[_0xdf3c('0x13')]);module['exports']=router; \ No newline at end of file +var _0x7da7=['post','/:id/clone','clone','create','put','update','delete','destroy','exports','multer','util','path','Router','../../components/auth/service','../../config/environment','./trunk.controller','isAuthenticated','index','/:id','show'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x7da7,0x10d));var _0x77da=function(_0x28d225,_0x43be18){_0x28d225=_0x28d225-0x0;var _0x1f79e1=_0x7da7[_0x28d225];return _0x1f79e1;};'use strict';var multer=require(_0x77da('0x0'));var util=require(_0x77da('0x1'));var path=require(_0x77da('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x77da('0x3')]();var auth=require(_0x77da('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x77da('0x5'));var controller=require(_0x77da('0x6'));router['get']('/',auth[_0x77da('0x7')](),controller[_0x77da('0x8')]);router['get'](_0x77da('0x9'),auth['isAuthenticated'](),controller[_0x77da('0xa')]);router[_0x77da('0xb')](_0x77da('0xc'),auth[_0x77da('0x7')](),controller[_0x77da('0xd')]);router['post']('/',auth[_0x77da('0x7')](),controller[_0x77da('0xe')]);router[_0x77da('0xf')]('/:id',auth[_0x77da('0x7')](),controller[_0x77da('0x10')]);router[_0x77da('0x11')](_0x77da('0x9'),auth['isAuthenticated'](),controller[_0x77da('0x12')]);module[_0x77da('0x13')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 3b42ca7..9c5a45e 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 _0x11b8=['exports','STRING','friend','user','ENUM','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','join','transport','getDataValue','split','rfc2833','info','shortinfo','inband','nonat','update','outgoing','yes','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','setDataValue','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','INTEGER','\x22\x22\x20<>','accept','refuse','originate','uac','uas','pai','fingerprint','certificate','active','passive','actpass','dynamic','BOOLEAN'];(function(_0x9d14e3,_0x5a6072){var _0x19bf32=function(_0x19da07){while(--_0x19da07){_0x9d14e3['push'](_0x9d14e3['shift']());}};_0x19bf32(++_0x5a6072);}(_0x11b8,0x90));var _0x811b=function(_0x5b0a0c,_0x587d12){_0x5b0a0c=_0x5b0a0c-0x0;var _0x3350f=_0x11b8[_0x5b0a0c];return _0x3350f;};'use strict';var Sequelize=require('sequelize');module[_0x811b('0x0')]={'name':{'type':Sequelize[_0x811b('0x1')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x811b('0x2'),_0x811b('0x3'),'peer'),'allowNull':![],'defaultValue':_0x811b('0x2')},'context':{'type':Sequelize[_0x811b('0x1')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize[_0x811b('0x4')](_0x811b('0x5'),_0x811b('0x6'),_0x811b('0x7'),_0x811b('0x8'),_0x811b('0x9'),'PROHIB_PASSED_SCREEN',_0x811b('0xa'),'PROHIB')},'deny':{'type':Sequelize[_0x811b('0x1')]},'permit':{'type':Sequelize[_0x811b('0x1')]},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize[_0x811b('0x1')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize['STRING'],'defaultValue':'udp','set':function(_0x300c8d){this['setDataValue']('transport',_0x300c8d?_0x300c8d[_0x811b('0xb')](','):null);},'get':function(){return this['getDataValue'](_0x811b('0xc'))?this[_0x811b('0xd')](_0x811b('0xc'))[_0x811b('0xe')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x811b('0x4')](_0x811b('0xf'),_0x811b('0x10'),_0x811b('0x11'),_0x811b('0x12'),'auto'),'defaultValue':_0x811b('0xf')},'directmedia':{'type':Sequelize[_0x811b('0x4')]('yes','no',_0x811b('0x13'),_0x811b('0x14'),_0x811b('0x15')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x811b('0x4')](_0x811b('0x16'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize[_0x811b('0x1')]},'nat':{'type':Sequelize[_0x811b('0x1')],'defaultValue':'force_rport,comedia','set':function(_0x48def5){this['setDataValue'](_0x811b('0x17'),_0x48def5?_0x48def5['join'](','):null);},'get':function(){return this[_0x811b('0xd')](_0x811b('0x17'))?this[_0x811b('0xd')](_0x811b('0x17'))[_0x811b('0xe')](','):null;},'comment':_0x811b('0x18')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x811b('0x1')]},'pickupgroup':{'type':Sequelize[_0x811b('0x1')]},'namedpickupgroup':{'type':Sequelize[_0x811b('0x1')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize[_0x811b('0x1')],'defaultValue':_0x811b('0x19')},'allow':{'type':Sequelize[_0x811b('0x1')],'allowNull':![],'defaultValue':_0x811b('0x1a'),'set':function(_0x509f8c){this[_0x811b('0x1b')](_0x811b('0x1c'),_0x509f8c?_0x509f8c['join'](';'):_0x811b('0x1a'));},'get':function(){return this[_0x811b('0xd')](_0x811b('0x1c'))?this[_0x811b('0xd')](_0x811b('0x1c'))['split'](';'):null;},'comment':_0x811b('0x1d')},'autoframing':{'type':Sequelize[_0x811b('0x4')](_0x811b('0x16'),'no')},'insecure':{'type':Sequelize[_0x811b('0x1')],'defaultValue':_0x811b('0x1e'),'set':function(_0x4d36b3){this[_0x811b('0x1b')](_0x811b('0x1f'),_0x4d36b3?_0x4d36b3['join'](','):null);},'get':function(){return this['getDataValue'](_0x811b('0x1f'))?this['getDataValue'](_0x811b('0x1f'))['split'](','):null;},'comment':_0x811b('0x20')},'trustrpid':{'type':Sequelize[_0x811b('0x4')](_0x811b('0x16'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x811b('0x4')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x811b('0x4')](_0x811b('0x16'),'no','never')},'promiscredir':{'type':Sequelize[_0x811b('0x4')](_0x811b('0x16'),'no')},'useclientcode':{'type':Sequelize[_0x811b('0x4')](_0x811b('0x16'),'no')},'accountcode':{'type':Sequelize[_0x811b('0x21')](0xb)},'setvar':{'type':Sequelize[_0x811b('0x1')]},'callerid':{'type':Sequelize[_0x811b('0x1')],'defaultValue':_0x811b('0x22')},'amaflags':{'type':Sequelize[_0x811b('0x1')]},'callcounter':{'type':Sequelize[_0x811b('0x4')](_0x811b('0x16'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x811b('0x21')](0xb)},'allowoverlap':{'type':Sequelize[_0x811b('0x4')](_0x811b('0x16'),'no')},'allowsubscribe':{'type':Sequelize['ENUM']('yes','no')},'allowtransfer':{'type':Sequelize[_0x811b('0x4')](_0x811b('0x16'),'no')},'ignoresdpversion':{'type':Sequelize[_0x811b('0x4')](_0x811b('0x16'),'no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize[_0x811b('0x1')]},'videosupport':{'type':Sequelize[_0x811b('0x4')](_0x811b('0x16'),'no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0x811b('0x4')](_0x811b('0x16'),'no')},'mailbox':{'type':Sequelize[_0x811b('0x1')]},'session_timers':{'type':Sequelize[_0x811b('0x4')](_0x811b('0x23'),_0x811b('0x24'),_0x811b('0x25'))},'session_expires':{'type':Sequelize[_0x811b('0x21')](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize[_0x811b('0x4')](_0x811b('0x26'),_0x811b('0x27')),'defaultValue':_0x811b('0x27')},'t38pt_usertpsource':{'type':Sequelize[_0x811b('0x1')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0x811b('0x1')]},'fromuser':{'type':Sequelize[_0x811b('0x1')]},'port':{'type':Sequelize[_0x811b('0x21')](0x5)},'qualify':{'type':Sequelize[_0x811b('0x4')](_0x811b('0x16'),'no'),'defaultValue':_0x811b('0x16')},'keepalive':{'type':Sequelize[_0x811b('0x21')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0x811b('0x1')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0x811b('0x21')](0xb)},'sendrpid':{'type':Sequelize['ENUM']('yes','no',_0x811b('0x28')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x811b('0x1')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0x811b('0x21')](0xb)},'timerb':{'type':Sequelize[_0x811b('0x21')](0xb)},'qualifyfreq':{'type':Sequelize[_0x811b('0x21')](0xb)},'contactpermit':{'type':Sequelize[_0x811b('0x1')]},'contactdeny':{'type':Sequelize[_0x811b('0x1')]},'contactacl':{'type':Sequelize[_0x811b('0x1')]},'unsolicited_mailbox':{'type':Sequelize[_0x811b('0x1')]},'use_q850_reason':{'type':Sequelize[_0x811b('0x1')]},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x811b('0x4')](_0x811b('0x16'),'no')},'force_avp':{'type':Sequelize[_0x811b('0x4')](_0x811b('0x16'),'no')},'icesupport':{'type':Sequelize['ENUM']('yes','no')},'dtlsenable':{'type':Sequelize['ENUM'](_0x811b('0x16'),'no')},'dtlsverify':{'type':Sequelize[_0x811b('0x4')](_0x811b('0x16'),'no',_0x811b('0x29'),_0x811b('0x2a'))},'dtlsrekey':{'type':Sequelize[_0x811b('0x21')](0xb)},'dtlscertfile':{'type':Sequelize[_0x811b('0x1')]},'dtlsprivatekey':{'type':Sequelize[_0x811b('0x1')]},'dtlscipher':{'type':Sequelize[_0x811b('0x1')]},'dtlscafile':{'type':Sequelize[_0x811b('0x1')]},'dtlscapath':{'type':Sequelize[_0x811b('0x1')]},'dtlssetup':{'type':Sequelize['ENUM'](_0x811b('0x2b'),_0x811b('0x2c'),_0x811b('0x2d')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x811b('0x1')]},'usereqphone':{'type':Sequelize[_0x811b('0x4')](_0x811b('0x16'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x811b('0x1')]},'recordofffeature':{'type':Sequelize[_0x811b('0x1')]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x811b('0x4')]('yes','no')},'subscribemwi':{'type':Sequelize[_0x811b('0x4')](_0x811b('0x16'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize[_0x811b('0x1')]},'parkinglot':{'type':Sequelize[_0x811b('0x1')]},'description':{'type':Sequelize[_0x811b('0x1')]},'host':{'type':Sequelize[_0x811b('0x1')],'defaultValue':_0x811b('0x2e')},'canreinvite':{'type':Sequelize['ENUM'](_0x811b('0x16'),'no',_0x811b('0x13'),'update','update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0x811b('0x1')]},'otherFields':{'type':Sequelize[_0x811b('0x1')]},'active':{'type':Sequelize[_0x811b('0x2f')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x811b('0x1')],'defaultValue':'no'}}; \ No newline at end of file +var _0xe980=['udp','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','auto','outgoing','force_rport,comedia','setDataValue','nat','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','yes','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','INTEGER','\x22\x22\x20<>','accept','refuse','originate','uac','uas','fingerprint','certificate','active','passive','actpass','nonat','update','update,nonat','BOOLEAN','exports','STRING','name','user','peer','from-voip-provider','ENUM','ALLOWED_FAILED_SCREEN','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB'];(function(_0x472663,_0x3c1a3e){var _0x2642c1=function(_0x1e2884){while(--_0x1e2884){_0x472663['push'](_0x472663['shift']());}};_0x2642c1(++_0x3c1a3e);}(_0xe980,0x145));var _0x0e98=function(_0xb20ff0,_0x21b0dc){_0xb20ff0=_0xb20ff0-0x0;var _0x3a84cb=_0xe980[_0xb20ff0];return _0x3a84cb;};'use strict';var Sequelize=require('sequelize');module[_0x0e98('0x0')]={'name':{'type':Sequelize[_0x0e98('0x1')],'allowNull':![],'unique':_0x0e98('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM']('friend',_0x0e98('0x3'),_0x0e98('0x4')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x0e98('0x1')],'allowNull':![],'defaultValue':_0x0e98('0x5')},'callingpres':{'type':Sequelize[_0x0e98('0x6')]('ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN',_0x0e98('0x7'),'ALLOWED','PROHIB_NOT_SCREENED',_0x0e98('0x8'),_0x0e98('0x9'),_0x0e98('0xa'))},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize[_0x0e98('0x1')]},'secret':{'type':Sequelize[_0x0e98('0x1')]},'md5secret':{'type':Sequelize[_0x0e98('0x1')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0x0e98('0x1')],'defaultValue':_0x0e98('0xb'),'set':function(_0x120010){this['setDataValue'](_0x0e98('0xc'),_0x120010?_0x120010[_0x0e98('0xd')](','):null);},'get':function(){return this[_0x0e98('0xe')]('transport')?this['getDataValue'](_0x0e98('0xc'))[_0x0e98('0xf')](','):null;},'comment':_0x0e98('0x10')},'dtmfmode':{'type':Sequelize[_0x0e98('0x6')]('rfc2833',_0x0e98('0x11'),_0x0e98('0x12'),'inband',_0x0e98('0x13')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x0e98('0x6')]('yes','no','nonat','update',_0x0e98('0x14')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x0e98('0x6')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x0e98('0x1')]},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0x0e98('0x1')],'defaultValue':_0x0e98('0x15'),'set':function(_0x38b0cb){this[_0x0e98('0x16')](_0x0e98('0x17'),_0x38b0cb?_0x38b0cb[_0x0e98('0xd')](','):null);},'get':function(){return this[_0x0e98('0xe')](_0x0e98('0x17'))?this[_0x0e98('0xe')](_0x0e98('0x17'))[_0x0e98('0xf')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x0e98('0x1')]},'namedcallgroup':{'type':Sequelize[_0x0e98('0x1')]},'pickupgroup':{'type':Sequelize[_0x0e98('0x1')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0e98('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0x0e98('0x18')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0e98('0x19'),'set':function(_0x3bbaa6){this[_0x0e98('0x16')]('allow',_0x3bbaa6?_0x3bbaa6[_0x0e98('0xd')](';'):_0x0e98('0x19'));},'get':function(){return this[_0x0e98('0xe')](_0x0e98('0x1a'))?this[_0x0e98('0xe')](_0x0e98('0x1a'))['split'](';'):null;},'comment':_0x0e98('0x1b')},'autoframing':{'type':Sequelize[_0x0e98('0x6')](_0x0e98('0x1c'),'no')},'insecure':{'type':Sequelize[_0x0e98('0x1')],'defaultValue':_0x0e98('0x1d'),'set':function(_0x56badc){this[_0x0e98('0x16')](_0x0e98('0x1e'),_0x56badc?_0x56badc['join'](','):null);},'get':function(){return this[_0x0e98('0xe')](_0x0e98('0x1e'))?this['getDataValue']('insecure')[_0x0e98('0xf')](','):null;},'comment':_0x0e98('0x1f')},'trustrpid':{'type':Sequelize['ENUM'](_0x0e98('0x1c'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x0e98('0x1c'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x0e98('0x6')](_0x0e98('0x1c'),'no','never')},'promiscredir':{'type':Sequelize['ENUM'](_0x0e98('0x1c'),'no')},'useclientcode':{'type':Sequelize[_0x0e98('0x6')](_0x0e98('0x1c'),'no')},'accountcode':{'type':Sequelize[_0x0e98('0x20')](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x0e98('0x1')],'defaultValue':_0x0e98('0x21')},'amaflags':{'type':Sequelize[_0x0e98('0x1')]},'callcounter':{'type':Sequelize[_0x0e98('0x6')](_0x0e98('0x1c'),'no'),'defaultValue':_0x0e98('0x1c')},'busylevel':{'type':Sequelize[_0x0e98('0x20')](0xb)},'allowoverlap':{'type':Sequelize['ENUM'](_0x0e98('0x1c'),'no')},'allowsubscribe':{'type':Sequelize['ENUM'](_0x0e98('0x1c'),'no')},'allowtransfer':{'type':Sequelize['ENUM']('yes','no')},'ignoresdpversion':{'type':Sequelize[_0x0e98('0x6')](_0x0e98('0x1c'),'no')},'subscribecontext':{'type':Sequelize[_0x0e98('0x1')]},'template':{'type':Sequelize[_0x0e98('0x1')]},'videosupport':{'type':Sequelize[_0x0e98('0x6')](_0x0e98('0x1c'),'no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x0e98('0x20')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x0e98('0x6')](_0x0e98('0x1c'),'no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize['ENUM'](_0x0e98('0x22'),_0x0e98('0x23'),_0x0e98('0x24'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize[_0x0e98('0x20')](0xb)},'session_refresher':{'type':Sequelize[_0x0e98('0x6')](_0x0e98('0x25'),'uas'),'defaultValue':_0x0e98('0x26')},'t38pt_usertpsource':{'type':Sequelize[_0x0e98('0x1')]},'regexten':{'type':Sequelize[_0x0e98('0x1')]},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize[_0x0e98('0x6')]('yes','no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0x0e98('0x1')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x0e98('0x20')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x0e98('0x20')](0xb)},'sendrpid':{'type':Sequelize['ENUM'](_0x0e98('0x1c'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x0e98('0x1')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0x0e98('0x1')]},'contactdeny':{'type':Sequelize[_0x0e98('0x1')]},'contactacl':{'type':Sequelize[_0x0e98('0x1')]},'unsolicited_mailbox':{'type':Sequelize[_0x0e98('0x1')]},'use_q850_reason':{'type':Sequelize[_0x0e98('0x1')]},'maxforwards':{'type':Sequelize[_0x0e98('0x20')](0xb)},'encryption':{'type':Sequelize[_0x0e98('0x6')](_0x0e98('0x1c'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x0e98('0x6')](_0x0e98('0x1c'),'no')},'force_avp':{'type':Sequelize[_0x0e98('0x6')]('yes','no')},'icesupport':{'type':Sequelize[_0x0e98('0x6')](_0x0e98('0x1c'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0x0e98('0x1c'),'no')},'dtlsverify':{'type':Sequelize[_0x0e98('0x6')](_0x0e98('0x1c'),'no',_0x0e98('0x27'),_0x0e98('0x28'))},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0x0e98('0x1')]},'dtlsprivatekey':{'type':Sequelize[_0x0e98('0x1')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0x0e98('0x1')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0x0e98('0x6')](_0x0e98('0x29'),_0x0e98('0x2a'),_0x0e98('0x2b')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize[_0x0e98('0x6')](_0x0e98('0x1c'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x0e98('0x1')]},'recordofffeature':{'type':Sequelize[_0x0e98('0x1')]},'call_limit':{'type':Sequelize[_0x0e98('0x20')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM'](_0x0e98('0x1c'),'no')},'subscribemwi':{'type':Sequelize[_0x0e98('0x6')](_0x0e98('0x1c'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0x0e98('0x1')]},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0e98('0x1')]},'host':{'type':Sequelize[_0x0e98('0x1')],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize[_0x0e98('0x6')](_0x0e98('0x1c'),'no',_0x0e98('0x2c'),_0x0e98('0x2d'),_0x0e98('0x2e')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x0e98('0x1')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x0e98('0x2f')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x0e98('0x1')],'defaultValue':'no'}}; \ No newline at end of file diff --git a/server/api/trunk/trunk.controller.js b/server/api/trunk/trunk.controller.js index 4ce7505..e42138f 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 _0xda38=['set','Content-Range','apply','reject','save','UserProfileResource','destroy','end','sendStatus','stack','name','send','index','map','Trunk','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','sort','pick','filter','merge','field','where','includeAll','include','findAll','rows','show','options','find','params','get','omit','createdAt','updatedAt','body','create','role','user','Trunks','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','root','utf8','readFileSync','server/files/templates/registry.ejs','/etc/asterisk/sip_xcally_trunks.conf','registry','writeFileSync','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','update','server/files/templates/trunk.ejs','render','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','querystring','papaparse','../../config/license/hardware','api','../../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','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','status','json','count','offset','limit'];(function(_0x225252,_0x160079){var _0x4d305e=function(_0x35008d){while(--_0x35008d){_0x225252['push'](_0x225252['shift']());}};_0x4d305e(++_0x160079);}(_0xda38,0x1ef));var _0x8da3=function(_0x5bb1e9,_0x15f025){_0x5bb1e9=_0x5bb1e9-0x0;var _0x262c24=_0xda38[_0x5bb1e9];return _0x262c24;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8da3('0x0'));var rimraf=require(_0x8da3('0x1'));var zipdir=require(_0x8da3('0x2'));var jsonpatch=require(_0x8da3('0x3'));var rp=require('request-promise');var moment=require(_0x8da3('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8da3('0x5'));var util=require(_0x8da3('0x6'));var path=require(_0x8da3('0x7'));var sox=require(_0x8da3('0x8'));var csv=require('to-csv');var ejs=require(_0x8da3('0x9'));var fs=require('fs');var _=require(_0x8da3('0xa'));var squel=require(_0x8da3('0xb'));var crypto=require(_0x8da3('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8da3('0xd'));var Papa=require(_0x8da3('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8da3('0xf'));var logger=require('../../config/logger')(_0x8da3('0x10'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x8da3('0x11'))['db'];var jayson=require(_0x8da3('0x12'));var client=jayson[_0x8da3('0x13')][_0x8da3('0x14')]({'port':0x232a});function checkPasswordPattern(_0x5a217f,_0x3750c3,_0x15ac56){if(_0x15ac56){var _0x3433be=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3433be[_0x8da3('0x15')](_0x3750c3)){return _0x5a217f;}else{throw new Error(_0x8da3('0x16'));}}else{return _0x5a217f;}}function respondWithRpcPromise(_0x3cfb52,_0x40c7c2,_0x1857c1,_0x4461b2){return new BPromise(function(_0x443b58,_0xb2b05a){var _0x43fd3d=_0x4461b2||client;return _0x43fd3d[_0x8da3('0x17')](_0x3cfb52,_0x1857c1)[_0x8da3('0x18')](function(_0x272593){logger[_0x8da3('0x19')](_0x8da3('0x1a'),_0x40c7c2,_0x8da3('0x1b'));logger[_0x8da3('0x1c')](_0x8da3('0x1d'),_0x40c7c2,_0x8da3('0x1b'),JSON['stringify'](_0x272593));if(_0x272593[_0x8da3('0x1e')]){if(_0x272593[_0x8da3('0x1e')][_0x8da3('0x1f')]===0x1f4){logger['error'](_0x8da3('0x1a'),_0x40c7c2,_0x272593['error'][_0x8da3('0x20')]);return _0xb2b05a(_0x272593[_0x8da3('0x1e')][_0x8da3('0x20')]);}logger['error']('Trunk,\x20%s,\x20%s',_0x40c7c2,_0x272593[_0x8da3('0x1e')][_0x8da3('0x20')]);return _0x443b58(_0x272593[_0x8da3('0x1e')]['message']);}else{logger[_0x8da3('0x19')]('Trunk,\x20%s,\x20%s',_0x40c7c2,'request\x20sent');_0x443b58(_0x272593[_0x8da3('0x21')][_0x8da3('0x20')]);}})[_0x8da3('0x22')](function(_0x40a860){logger['error'](_0x8da3('0x1a'),_0x40c7c2,_0x40a860);_0xb2b05a(_0x40a860);});});}function respondWithStatusCode(_0x4f8d3f,_0x58b4f3){_0x58b4f3=_0x58b4f3||0xcc;return function(_0x4da856){if(_0x4da856){return _0x4f8d3f['sendStatus'](_0x58b4f3);}return _0x4f8d3f[_0x8da3('0x23')](_0x58b4f3)['end']();};}function respondWithResult(_0x348290,_0x22d7c9){_0x22d7c9=_0x22d7c9||0xc8;return function(_0x165e01){if(_0x165e01){return _0x348290[_0x8da3('0x23')](_0x22d7c9)[_0x8da3('0x24')](_0x165e01);}};}function respondWithFilteredResult(_0x2b7cbc,_0x2b46a2){return function(_0x4ea510){if(_0x4ea510){var _0x474fec=_0x4ea510[_0x8da3('0x25')],_0x35ab33=_0x2b46a2[_0x8da3('0x26')],_0xa8481=_0x2b46a2[_0x8da3('0x26')]+_0x2b46a2[_0x8da3('0x27')],_0x2b44d3;if(_0xa8481>=_0x474fec){_0xa8481=_0x474fec;_0x2b44d3=0xc8;}else{_0x2b44d3=0xce;}_0x2b7cbc[_0x8da3('0x23')](_0x2b44d3);return _0x2b7cbc[_0x8da3('0x28')](_0x8da3('0x29'),_0x35ab33+'-'+_0xa8481+'/'+_0x474fec)['json'](_0x4ea510);}return null;};}function patchUpdates(_0x471690){return function(_0x8c048){try{jsonpatch[_0x8da3('0x2a')](_0x8c048,_0x471690,!![]);}catch(_0x39dcfa){return BPromise[_0x8da3('0x2b')](_0x39dcfa);}return _0x8c048[_0x8da3('0x2c')]();};}function saveUpdates(_0x13e4d0,_0x43b913){return function(_0x48d085){if(_0x48d085){return _0x48d085['update'](_0x13e4d0)[_0x8da3('0x18')](function(_0x3efe5e){return _0x3efe5e;});}return null;};}function removeEntity(_0x1fdaeb,_0x2e0532){return function(_0x2167dc){if(_0x2167dc){return _0x2167dc['destroy']()[_0x8da3('0x18')](function(){var _0x92c9f3=_0x2167dc['get']({'plain':!![]});var _0x3506e9='Trunks';return db[_0x8da3('0x2d')][_0x8da3('0x2e')]({'where':{'type':_0x3506e9,'resourceId':_0x92c9f3['id']}})['then'](function(){return _0x2167dc;});})['then'](function(){_0x1fdaeb[_0x8da3('0x23')](0xcc)[_0x8da3('0x2f')]();});}};}function handleEntityNotFound(_0x2929ca,_0x57ca42){return function(_0x3e8dfc){if(!_0x3e8dfc){_0x2929ca[_0x8da3('0x30')](0x194);}return _0x3e8dfc;};}function handleError(_0x516055,_0x288175){_0x288175=_0x288175||0x1f4;return function(_0x342eaa){logger[_0x8da3('0x1e')](_0x342eaa[_0x8da3('0x31')]);if(_0x342eaa[_0x8da3('0x32')]){delete _0x342eaa[_0x8da3('0x32')];}_0x516055[_0x8da3('0x23')](_0x288175)[_0x8da3('0x33')](_0x342eaa);};}exports[_0x8da3('0x34')]=function(_0x16e689,_0x235ef4){var _0x4d7c75={},_0x28a1e5={},_0x3937b0={'count':0x0,'rows':[]};var _0x504392=_[_0x8da3('0x35')](db[_0x8da3('0x36')][_0x8da3('0x37')],function(_0x5a8f5b){return{'name':_0x5a8f5b[_0x8da3('0x38')],'type':_0x5a8f5b[_0x8da3('0x39')]['key']};});_0x28a1e5[_0x8da3('0x3a')]=_[_0x8da3('0x35')](_0x504392,_0x8da3('0x32'));_0x28a1e5[_0x8da3('0x3b')]=_[_0x8da3('0x3c')](_0x16e689[_0x8da3('0x3b')]);_0x28a1e5[_0x8da3('0x3d')]=_['intersection'](_0x28a1e5[_0x8da3('0x3a')],_0x28a1e5[_0x8da3('0x3b')]);_0x4d7c75['attributes']=_[_0x8da3('0x3e')](_0x28a1e5[_0x8da3('0x3a')],qs[_0x8da3('0x3f')](_0x16e689[_0x8da3('0x3b')]['fields']));_0x4d7c75['attributes']=_0x4d7c75[_0x8da3('0x40')][_0x8da3('0x41')]?_0x4d7c75[_0x8da3('0x40')]:_0x28a1e5[_0x8da3('0x3a')];if(!_0x16e689['query']['hasOwnProperty']('nolimit')){_0x4d7c75[_0x8da3('0x27')]=qs[_0x8da3('0x27')](_0x16e689[_0x8da3('0x3b')][_0x8da3('0x27')]);_0x4d7c75[_0x8da3('0x26')]=qs[_0x8da3('0x26')](_0x16e689[_0x8da3('0x3b')]['offset']);}_0x4d7c75['order']=qs[_0x8da3('0x42')](_0x16e689[_0x8da3('0x3b')][_0x8da3('0x42')]);_0x4d7c75['where']=qs['filters'](_[_0x8da3('0x43')](_0x16e689[_0x8da3('0x3b')],_0x28a1e5['filters']));if(_0x16e689[_0x8da3('0x3b')][_0x8da3('0x44')]){_0x4d7c75['where']=_[_0x8da3('0x45')](_0x4d7c75['where'],{'$or':_['map'](_0x504392,function(_0xc9b4a6){if(_0xc9b4a6[_0x8da3('0x39')]['key']!=='VIRTUAL'){var _0x226848={};_0x226848[_0xc9b4a6[_0x8da3('0x46')]]={'$like':'%'+_0x16e689['query']['filter']+'%'};return _0x226848;}})});}_0x4d7c75=_[_0x8da3('0x45')]({},_0x4d7c75,_0x16e689['options']);var _0xbdce4d={'where':_0x4d7c75[_0x8da3('0x47')]};return db[_0x8da3('0x36')][_0x8da3('0x25')](_0xbdce4d)[_0x8da3('0x18')](function(_0x54bb18){_0x3937b0['count']=_0x54bb18;if(_0x16e689['query'][_0x8da3('0x48')]){_0x4d7c75[_0x8da3('0x49')]=[{'all':!![]}];}return db[_0x8da3('0x36')][_0x8da3('0x4a')](_0x4d7c75);})['then'](function(_0x8b174){_0x3937b0[_0x8da3('0x4b')]=_0x8b174;return _0x3937b0;})[_0x8da3('0x18')](respondWithFilteredResult(_0x235ef4,_0x4d7c75))[_0x8da3('0x22')](handleError(_0x235ef4,null));};exports[_0x8da3('0x4c')]=function(_0x13fc8b,_0x99381){var _0x4d6545={'raw':![],'where':{'id':_0x13fc8b['params']['id']}},_0x2c40b8={};_0x2c40b8[_0x8da3('0x3a')]=_[_0x8da3('0x3c')](db[_0x8da3('0x36')][_0x8da3('0x37')]);_0x2c40b8[_0x8da3('0x3b')]=_['keys'](_0x13fc8b[_0x8da3('0x3b')]);_0x2c40b8[_0x8da3('0x3d')]=_[_0x8da3('0x3e')](_0x2c40b8[_0x8da3('0x3a')],_0x2c40b8[_0x8da3('0x3b')]);_0x4d6545[_0x8da3('0x40')]=_['intersection'](_0x2c40b8[_0x8da3('0x3a')],qs[_0x8da3('0x3f')](_0x13fc8b['query'][_0x8da3('0x3f')]));_0x4d6545['attributes']=_0x4d6545[_0x8da3('0x40')]['length']?_0x4d6545[_0x8da3('0x40')]:_0x2c40b8[_0x8da3('0x3a')];if(_0x13fc8b[_0x8da3('0x3b')][_0x8da3('0x48')]){_0x4d6545[_0x8da3('0x49')]=[{'all':!![]}];}_0x4d6545=_['merge']({},_0x4d6545,_0x13fc8b[_0x8da3('0x4d')]);return db[_0x8da3('0x36')][_0x8da3('0x4e')](_0x4d6545)[_0x8da3('0x18')](handleEntityNotFound(_0x99381,null))['then'](respondWithResult(_0x99381,null))['catch'](handleError(_0x99381,null));};exports['clone']=function(_0x54a8fc,_0x48cbe6){var _0x510445={'raw':![],'where':{'id':_0x54a8fc[_0x8da3('0x4f')]['id']}},_0x4eae0c={};_0x4eae0c[_0x8da3('0x3a')]=_[_0x8da3('0x3c')](db[_0x8da3('0x36')][_0x8da3('0x37')]);_0x510445['attributes']=_[_0x8da3('0x3e')](_0x4eae0c['model'],qs[_0x8da3('0x3f')](_0x54a8fc[_0x8da3('0x3b')][_0x8da3('0x3f')]));_0x510445[_0x8da3('0x40')]=_0x510445[_0x8da3('0x40')][_0x8da3('0x41')]?_0x510445[_0x8da3('0x40')]:_0x4eae0c[_0x8da3('0x3a')];if(_0x54a8fc['query'][_0x8da3('0x48')]){_0x510445[_0x8da3('0x49')]=[{'all':!![]}];}_0x510445=_[_0x8da3('0x45')]({},_0x510445,_0x54a8fc[_0x8da3('0x4d')]);return db[_0x8da3('0x36')]['find'](_0x510445)[_0x8da3('0x18')](handleEntityNotFound(_0x48cbe6,null))[_0x8da3('0x18')](function(_0x2d808e){if(_0x2d808e){var _0x6bc9f3=_0x2d808e[_0x8da3('0x50')]({'plain':!![]});_0x6bc9f3=qs[_0x8da3('0x51')](_0x6bc9f3,['id',_0x8da3('0x52'),_0x8da3('0x53')]);_0x54a8fc[_0x8da3('0x54')]=_[_0x8da3('0x51')](_0x54a8fc[_0x8da3('0x54')],['id',_0x8da3('0x52'),_0x8da3('0x53')]);return db['Trunk'][_0x8da3('0x55')](_['merge'](_0x6bc9f3,_0x54a8fc['body']),{'include':_0x54a8fc[_0x8da3('0x3b')][_0x8da3('0x48')]?[{'all':!![]}]:undefined})['then'](function(_0x2c61c5){var _0x5df2f4=_0x54a8fc['user'][_0x8da3('0x50')]({'plain':!![]});if(!_0x5df2f4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5df2f4[_0x8da3('0x56')]===_0x8da3('0x57')){var _0x17aa76=_0x2c61c5[_0x8da3('0x50')]({'plain':!![]});var _0x1f6ebe=_0x8da3('0x58');return db[_0x8da3('0x59')][_0x8da3('0x4e')]({'where':{'name':_0x1f6ebe,'userProfileId':_0x5df2f4[_0x8da3('0x5a')]},'raw':!![]})[_0x8da3('0x18')](function(_0x423091){if(_0x423091&&_0x423091[_0x8da3('0x5b')]===0x0){return db[_0x8da3('0x2d')][_0x8da3('0x55')]({'name':_0x17aa76[_0x8da3('0x32')],'resourceId':_0x17aa76['id'],'type':_0x423091[_0x8da3('0x32')],'sectionId':_0x423091['id']},{})[_0x8da3('0x18')](function(){return _0x2c61c5;});}else{return _0x2c61c5;}})['catch'](function(_0x1b85fc){logger[_0x8da3('0x1e')](_0x8da3('0x5c'),_0x1b85fc);throw _0x1b85fc;});}return _0x2c61c5;});}})['then'](respondWithResult(_0x48cbe6,0xc9))[_0x8da3('0x22')](handleError(_0x48cbe6,null));};exports['create']=function(_0x38f47f,_0xb949ee,_0x1affaa){var _0x28f1f8;return db['Trunk'][_0x8da3('0x55')](_0x38f47f[_0x8da3('0x54')],{'raw':!![]})[_0x8da3('0x18')](function(_0x278840){_0x28f1f8=_0x278840;return db[_0x8da3('0x36')][_0x8da3('0x4a')]({'raw':!![]});})['then'](function(_0x33f832){var _0x28eabc=fs['readFileSync'](path[_0x8da3('0x5d')](config[_0x8da3('0x5e')],'server/files/templates/trunk.ejs'),_0x8da3('0x5f'));var _0x5e30cc=fs[_0x8da3('0x60')](path[_0x8da3('0x5d')](config[_0x8da3('0x5e')],_0x8da3('0x61')),'utf8');var _0x5ef555=ejs['render'](_0x28eabc,{'trunks':_0x33f832||[]});fs['writeFileSync'](_0x8da3('0x62'),_0x5ef555);if(_0x28f1f8[_0x8da3('0x63')]){var _0x1564ea=ejs['render'](_0x5e30cc,{'trunks':_0x33f832||[]});fs[_0x8da3('0x64')](_0x8da3('0x65'),_0x1564ea);}})[_0x8da3('0x18')](function(){return respondWithRpcPromise(_0x8da3('0x66'),'create',{'module':_0x8da3('0x67')});})['then'](function(){var _0x2c41c1=_0x38f47f['user'][_0x8da3('0x50')]({'plain':!![]});if(!_0x2c41c1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2c41c1[_0x8da3('0x56')]===_0x8da3('0x57')){var _0x297ac3=_0x28f1f8[_0x8da3('0x50')]({'plain':!![]});return db['UserProfileSection'][_0x8da3('0x4e')]({'where':{'name':_0x8da3('0x58'),'userProfileId':_0x2c41c1[_0x8da3('0x5a')]},'raw':!![]})[_0x8da3('0x18')](function(_0xb20b72){if(_0xb20b72&&_0xb20b72['autoAssociation']===0x0){return db[_0x8da3('0x2d')][_0x8da3('0x55')]({'name':_0x297ac3[_0x8da3('0x32')],'resourceId':_0x297ac3['id'],'type':_0xb20b72['name'],'sectionId':_0xb20b72['id']},{})[_0x8da3('0x18')](function(){return _0x28f1f8;});}else{return _0x28f1f8;}})[_0x8da3('0x22')](function(_0x18aadf){logger[_0x8da3('0x1e')](_0x8da3('0x5c'),_0x18aadf);throw _0x18aadf;});}return _0x28f1f8;})[_0x8da3('0x18')](respondWithResult(_0xb949ee,0xc9))['catch'](handleError(_0xb949ee,null));};exports[_0x8da3('0x68')]=function(_0x46fdd2,_0x5267a8,_0x4e0b74){var _0x7ea50d;return db[_0x8da3('0x36')][_0x8da3('0x4e')]({'where':{'id':_0x46fdd2[_0x8da3('0x4f')]['id']}})[_0x8da3('0x18')](handleEntityNotFound(_0x5267a8,null))[_0x8da3('0x18')](saveUpdates(_0x46fdd2[_0x8da3('0x54')],null))[_0x8da3('0x18')](function(_0x56c92a){if(_0x56c92a){_0x7ea50d=_0x56c92a;return db[_0x8da3('0x36')][_0x8da3('0x4a')]({'raw':!![]});}})['then'](function(_0x1eb5ea){if(_0x1eb5ea){var _0x1e3da9=fs[_0x8da3('0x60')](path['join'](config['root'],_0x8da3('0x69')),_0x8da3('0x5f'));var _0x2b7da1=fs[_0x8da3('0x60')](path[_0x8da3('0x5d')](config[_0x8da3('0x5e')],_0x8da3('0x61')),'utf8');var _0x4dc921=ejs[_0x8da3('0x6a')](_0x1e3da9,{'trunks':_0x1eb5ea||[]});fs[_0x8da3('0x64')](_0x8da3('0x62'),_0x4dc921);var _0x10ff5a=ejs[_0x8da3('0x6a')](_0x2b7da1,{'trunks':_0x1eb5ea||[]});fs[_0x8da3('0x64')](_0x8da3('0x65'),_0x10ff5a);return respondWithRpcPromise('Reload','update',{'module':'chan_sip.so'});}return null;})[_0x8da3('0x18')](function(_0x655045){if(_0x655045){return _0x7ea50d;}})[_0x8da3('0x18')](respondWithResult(_0x5267a8,null))[_0x8da3('0x22')](handleError(_0x5267a8,null));};exports[_0x8da3('0x2e')]=function(_0x10d4c6,_0x9b635b,_0x3839ad){var _0x100618;return db[_0x8da3('0x36')][_0x8da3('0x4e')]({'where':{'id':_0x10d4c6['params']['id']}})[_0x8da3('0x18')](handleEntityNotFound(_0x9b635b,null))[_0x8da3('0x18')](removeEntity(_0x9b635b,null))[_0x8da3('0x18')](function(){return db['Trunk'][_0x8da3('0x4a')]({'raw':!![]});})[_0x8da3('0x18')](function(_0x78d259){var _0x10739f=fs[_0x8da3('0x60')](path[_0x8da3('0x5d')](config['root'],_0x8da3('0x69')),_0x8da3('0x5f'));var _0x2825d0=fs['readFileSync'](path[_0x8da3('0x5d')](config[_0x8da3('0x5e')],_0x8da3('0x61')),_0x8da3('0x5f'));var _0x1fde99=ejs[_0x8da3('0x6a')](_0x10739f,{'trunks':_0x78d259});var _0x24b920=ejs['render'](_0x2825d0,{'trunks':_0x78d259});fs[_0x8da3('0x64')](_0x8da3('0x62'),_0x1fde99);fs['writeFileSync'](_0x8da3('0x65'),_0x24b920);return respondWithRpcPromise('Reload',_0x8da3('0x2e'),{'module':_0x8da3('0x67')});})['catch'](handleError(_0x9b635b,null));}; \ No newline at end of file +var _0x752c=['nolimit','order','sort','where','pick','filters','merge','field','filter','options','include','rows','includeAll','find','clone','params','get','omit','createdAt','updatedAt','body','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findAll','readFileSync','root','server/files/templates/trunk.ejs','server/files/templates/registry.ejs','utf8','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','render','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','join','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','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','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','Trunk,\x20%s,\x20%s','message','catch','sendStatus','end','status','count','offset','limit','Content-Range','json','save','update','destroy','stack','name','index','map','Trunk','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty'];(function(_0x443f79,_0x33e446){var _0x3847e4=function(_0x42fa01){while(--_0x42fa01){_0x443f79['push'](_0x443f79['shift']());}};_0x3847e4(++_0x33e446);}(_0x752c,0x10e));var _0xc752=function(_0x40e3d5,_0x4d1779){_0x40e3d5=_0x40e3d5-0x0;var _0x3f2e92=_0x752c[_0x40e3d5];return _0x3f2e92;};'use strict';var pdf=require(_0xc752('0x0'));var emlformat=require(_0xc752('0x1'));var rimraf=require(_0xc752('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc752('0x3'));var rp=require(_0xc752('0x4'));var moment=require(_0xc752('0x5'));var BPromise=require(_0xc752('0x6'));var Mustache=require(_0xc752('0x7'));var util=require(_0xc752('0x8'));var path=require(_0xc752('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc752('0xa'));var fs=require('fs');var _=require(_0xc752('0xb'));var squel=require(_0xc752('0xc'));var crypto=require(_0xc752('0xd'));var jsforce=require(_0xc752('0xe'));var deskjs=require(_0xc752('0xf'));var toCsv=require(_0xc752('0x10'));var querystring=require(_0xc752('0x11'));var Papa=require('papaparse');var Redis=require(_0xc752('0x12'));var authService=require(_0xc752('0x13'));var qs=require(_0xc752('0x14'));var as=require(_0xc752('0x15'));var hardwareService=require(_0xc752('0x16'));var logger=require(_0xc752('0x17'))(_0xc752('0x18'));var utils=require(_0xc752('0x19'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0xc752('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x287eb6,_0x2448a2,_0x1c21ba){if(_0x1c21ba){var _0x602f42=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x602f42[_0xc752('0x1b')](_0x2448a2)){return _0x287eb6;}else{throw new Error(_0xc752('0x1c'));}}else{return _0x287eb6;}}function respondWithRpcPromise(_0x22bddb,_0x5978e0,_0x26a9ba,_0x33a4b9){return new BPromise(function(_0x3550fe,_0x266379){var _0x300e41=_0x33a4b9||client;return _0x300e41[_0xc752('0x1d')](_0x22bddb,_0x26a9ba)[_0xc752('0x1e')](function(_0x49de8a){logger[_0xc752('0x1f')]('Trunk,\x20%s,\x20%s',_0x5978e0,_0xc752('0x20'));logger[_0xc752('0x21')](_0xc752('0x22'),_0x5978e0,_0xc752('0x20'),JSON[_0xc752('0x23')](_0x49de8a));if(_0x49de8a[_0xc752('0x24')]){if(_0x49de8a[_0xc752('0x24')][_0xc752('0x25')]===0x1f4){logger[_0xc752('0x24')](_0xc752('0x26'),_0x5978e0,_0x49de8a[_0xc752('0x24')][_0xc752('0x27')]);return _0x266379(_0x49de8a['error'][_0xc752('0x27')]);}logger['error'](_0xc752('0x26'),_0x5978e0,_0x49de8a['error'][_0xc752('0x27')]);return _0x3550fe(_0x49de8a['error'][_0xc752('0x27')]);}else{logger[_0xc752('0x1f')](_0xc752('0x26'),_0x5978e0,_0xc752('0x20'));_0x3550fe(_0x49de8a['result'][_0xc752('0x27')]);}})[_0xc752('0x28')](function(_0x56e2b9){logger[_0xc752('0x24')]('Trunk,\x20%s,\x20%s',_0x5978e0,_0x56e2b9);_0x266379(_0x56e2b9);});});}function respondWithStatusCode(_0x128507,_0x124d3e){_0x124d3e=_0x124d3e||0xcc;return function(_0x517282){if(_0x517282){return _0x128507[_0xc752('0x29')](_0x124d3e);}return _0x128507['status'](_0x124d3e)[_0xc752('0x2a')]();};}function respondWithResult(_0x3fe333,_0x5aae60){_0x5aae60=_0x5aae60||0xc8;return function(_0xe7647c){if(_0xe7647c){return _0x3fe333[_0xc752('0x2b')](_0x5aae60)['json'](_0xe7647c);}};}function respondWithFilteredResult(_0x63760d,_0xbc6337){return function(_0x40429d){if(_0x40429d){var _0x34a842=_0x40429d[_0xc752('0x2c')],_0x504d2e=_0xbc6337[_0xc752('0x2d')],_0x425844=_0xbc6337[_0xc752('0x2d')]+_0xbc6337[_0xc752('0x2e')],_0x16e78a;if(_0x425844>=_0x34a842){_0x425844=_0x34a842;_0x16e78a=0xc8;}else{_0x16e78a=0xce;}_0x63760d[_0xc752('0x2b')](_0x16e78a);return _0x63760d['set'](_0xc752('0x2f'),_0x504d2e+'-'+_0x425844+'/'+_0x34a842)[_0xc752('0x30')](_0x40429d);}return null;};}function patchUpdates(_0x735dc4){return function(_0x5683a1){try{jsonpatch['apply'](_0x5683a1,_0x735dc4,!![]);}catch(_0x24e755){return BPromise['reject'](_0x24e755);}return _0x5683a1[_0xc752('0x31')]();};}function saveUpdates(_0x17c97e,_0xc8ca3f){return function(_0x52d6a6){if(_0x52d6a6){return _0x52d6a6[_0xc752('0x32')](_0x17c97e)['then'](function(_0x42c9f8){return _0x42c9f8;});}return null;};}function removeEntity(_0x4a854c,_0x1513fe){return function(_0x3bc3c9){if(_0x3bc3c9){return _0x3bc3c9[_0xc752('0x33')]()['then'](function(){var _0x199ccd=_0x3bc3c9['get']({'plain':!![]});var _0x2a4927='Trunks';return db['UserProfileResource'][_0xc752('0x33')]({'where':{'type':_0x2a4927,'resourceId':_0x199ccd['id']}})[_0xc752('0x1e')](function(){return _0x3bc3c9;});})[_0xc752('0x1e')](function(){_0x4a854c[_0xc752('0x2b')](0xcc)[_0xc752('0x2a')]();});}};}function handleEntityNotFound(_0x433349,_0x18c78e){return function(_0xa86366){if(!_0xa86366){_0x433349[_0xc752('0x29')](0x194);}return _0xa86366;};}function handleError(_0x4dc76b,_0x4f916f){_0x4f916f=_0x4f916f||0x1f4;return function(_0xaeb94e){logger['error'](_0xaeb94e[_0xc752('0x34')]);if(_0xaeb94e[_0xc752('0x35')]){delete _0xaeb94e[_0xc752('0x35')];}_0x4dc76b[_0xc752('0x2b')](_0x4f916f)['send'](_0xaeb94e);};}exports[_0xc752('0x36')]=function(_0x18907a,_0x529efa){var _0x12edb4={},_0x40f6fd={},_0x24eedb={'count':0x0,'rows':[]};var _0x2fd2d1=_[_0xc752('0x37')](db[_0xc752('0x38')][_0xc752('0x39')],function(_0x3a7169){return{'name':_0x3a7169[_0xc752('0x3a')],'type':_0x3a7169[_0xc752('0x3b')][_0xc752('0x3c')]};});_0x40f6fd['model']=_['map'](_0x2fd2d1,_0xc752('0x35'));_0x40f6fd[_0xc752('0x3d')]=_[_0xc752('0x3e')](_0x18907a[_0xc752('0x3d')]);_0x40f6fd['filters']=_[_0xc752('0x3f')](_0x40f6fd[_0xc752('0x40')],_0x40f6fd[_0xc752('0x3d')]);_0x12edb4[_0xc752('0x41')]=_[_0xc752('0x3f')](_0x40f6fd[_0xc752('0x40')],qs['fields'](_0x18907a[_0xc752('0x3d')][_0xc752('0x42')]));_0x12edb4['attributes']=_0x12edb4['attributes'][_0xc752('0x43')]?_0x12edb4[_0xc752('0x41')]:_0x40f6fd[_0xc752('0x40')];if(!_0x18907a[_0xc752('0x3d')][_0xc752('0x44')](_0xc752('0x45'))){_0x12edb4[_0xc752('0x2e')]=qs[_0xc752('0x2e')](_0x18907a['query'][_0xc752('0x2e')]);_0x12edb4[_0xc752('0x2d')]=qs[_0xc752('0x2d')](_0x18907a[_0xc752('0x3d')][_0xc752('0x2d')]);}_0x12edb4[_0xc752('0x46')]=qs[_0xc752('0x47')](_0x18907a[_0xc752('0x3d')][_0xc752('0x47')]);_0x12edb4[_0xc752('0x48')]=qs['filters'](_[_0xc752('0x49')](_0x18907a[_0xc752('0x3d')],_0x40f6fd[_0xc752('0x4a')]));if(_0x18907a[_0xc752('0x3d')]['filter']){_0x12edb4['where']=_[_0xc752('0x4b')](_0x12edb4['where'],{'$or':_[_0xc752('0x37')](_0x2fd2d1,function(_0x3e9ce9){if(_0x3e9ce9[_0xc752('0x3b')][_0xc752('0x3c')]!=='VIRTUAL'){var _0x431724={};_0x431724[_0x3e9ce9[_0xc752('0x4c')]]={'$like':'%'+_0x18907a[_0xc752('0x3d')][_0xc752('0x4d')]+'%'};return _0x431724;}})});}_0x12edb4=_[_0xc752('0x4b')]({},_0x12edb4,_0x18907a[_0xc752('0x4e')]);var _0x386803={'where':_0x12edb4['where']};return db[_0xc752('0x38')][_0xc752('0x2c')](_0x386803)[_0xc752('0x1e')](function(_0x2c0897){_0x24eedb[_0xc752('0x2c')]=_0x2c0897;if(_0x18907a[_0xc752('0x3d')]['includeAll']){_0x12edb4[_0xc752('0x4f')]=[{'all':!![]}];}return db[_0xc752('0x38')]['findAll'](_0x12edb4);})[_0xc752('0x1e')](function(_0x4d501b){_0x24eedb[_0xc752('0x50')]=_0x4d501b;return _0x24eedb;})[_0xc752('0x1e')](respondWithFilteredResult(_0x529efa,_0x12edb4))[_0xc752('0x28')](handleError(_0x529efa,null));};exports['show']=function(_0x1552af,_0x656f9c){var _0x5ea2c6={'raw':![],'where':{'id':_0x1552af['params']['id']}},_0x486a71={};_0x486a71[_0xc752('0x40')]=_[_0xc752('0x3e')](db[_0xc752('0x38')]['rawAttributes']);_0x486a71[_0xc752('0x3d')]=_[_0xc752('0x3e')](_0x1552af['query']);_0x486a71[_0xc752('0x4a')]=_[_0xc752('0x3f')](_0x486a71[_0xc752('0x40')],_0x486a71[_0xc752('0x3d')]);_0x5ea2c6['attributes']=_[_0xc752('0x3f')](_0x486a71[_0xc752('0x40')],qs[_0xc752('0x42')](_0x1552af[_0xc752('0x3d')][_0xc752('0x42')]));_0x5ea2c6[_0xc752('0x41')]=_0x5ea2c6[_0xc752('0x41')][_0xc752('0x43')]?_0x5ea2c6[_0xc752('0x41')]:_0x486a71['model'];if(_0x1552af[_0xc752('0x3d')][_0xc752('0x51')]){_0x5ea2c6[_0xc752('0x4f')]=[{'all':!![]}];}_0x5ea2c6=_[_0xc752('0x4b')]({},_0x5ea2c6,_0x1552af[_0xc752('0x4e')]);return db[_0xc752('0x38')][_0xc752('0x52')](_0x5ea2c6)[_0xc752('0x1e')](handleEntityNotFound(_0x656f9c,null))[_0xc752('0x1e')](respondWithResult(_0x656f9c,null))['catch'](handleError(_0x656f9c,null));};exports[_0xc752('0x53')]=function(_0x378ead,_0x20ba35){var _0x3fc7fc={'raw':![],'where':{'id':_0x378ead[_0xc752('0x54')]['id']}},_0x85d156={};_0x85d156[_0xc752('0x40')]=_['keys'](db[_0xc752('0x38')][_0xc752('0x39')]);_0x3fc7fc['attributes']=_[_0xc752('0x3f')](_0x85d156[_0xc752('0x40')],qs[_0xc752('0x42')](_0x378ead['query'][_0xc752('0x42')]));_0x3fc7fc[_0xc752('0x41')]=_0x3fc7fc['attributes']['length']?_0x3fc7fc['attributes']:_0x85d156[_0xc752('0x40')];if(_0x378ead[_0xc752('0x3d')][_0xc752('0x51')]){_0x3fc7fc[_0xc752('0x4f')]=[{'all':!![]}];}_0x3fc7fc=_[_0xc752('0x4b')]({},_0x3fc7fc,_0x378ead[_0xc752('0x4e')]);return db['Trunk'][_0xc752('0x52')](_0x3fc7fc)['then'](handleEntityNotFound(_0x20ba35,null))[_0xc752('0x1e')](function(_0x210c6a){if(_0x210c6a){var _0x1818f5=_0x210c6a[_0xc752('0x55')]({'plain':!![]});_0x1818f5=qs[_0xc752('0x56')](_0x1818f5,['id',_0xc752('0x57'),_0xc752('0x58')]);_0x378ead[_0xc752('0x59')]=_[_0xc752('0x56')](_0x378ead[_0xc752('0x59')],['id',_0xc752('0x57'),'updatedAt']);return db[_0xc752('0x38')][_0xc752('0x5a')](_[_0xc752('0x4b')](_0x1818f5,_0x378ead[_0xc752('0x59')]),{'include':_0x378ead[_0xc752('0x3d')][_0xc752('0x51')]?[{'all':!![]}]:undefined})[_0xc752('0x1e')](function(_0x2e3888){var _0x4e8bc4=_0x378ead[_0xc752('0x5b')]['get']({'plain':!![]});if(!_0x4e8bc4)throw new Error(_0xc752('0x5c'));if(_0x4e8bc4[_0xc752('0x5d')]===_0xc752('0x5b')){var _0x412c6e=_0x2e3888[_0xc752('0x55')]({'plain':!![]});var _0x54a12d='Trunks';return db[_0xc752('0x5e')][_0xc752('0x52')]({'where':{'name':_0x54a12d,'userProfileId':_0x4e8bc4[_0xc752('0x5f')]},'raw':!![]})[_0xc752('0x1e')](function(_0xd07377){if(_0xd07377&&_0xd07377[_0xc752('0x60')]===0x0){return db[_0xc752('0x61')]['create']({'name':_0x412c6e[_0xc752('0x35')],'resourceId':_0x412c6e['id'],'type':_0xd07377[_0xc752('0x35')],'sectionId':_0xd07377['id']},{})[_0xc752('0x1e')](function(){return _0x2e3888;});}else{return _0x2e3888;}})['catch'](function(_0xfdc019){logger[_0xc752('0x24')](_0xc752('0x62'),_0xfdc019);throw _0xfdc019;});}return _0x2e3888;});}})[_0xc752('0x1e')](respondWithResult(_0x20ba35,0xc9))[_0xc752('0x28')](handleError(_0x20ba35,null));};exports[_0xc752('0x5a')]=function(_0x408fdb,_0xf8fd0,_0x347988){var _0x38f638;return db[_0xc752('0x38')][_0xc752('0x5a')](_0x408fdb[_0xc752('0x59')],{'raw':!![]})[_0xc752('0x1e')](function(_0x47d626){_0x38f638=_0x47d626;return db[_0xc752('0x38')][_0xc752('0x63')]({'raw':!![]});})[_0xc752('0x1e')](function(_0x561768){var _0x10d61b=fs[_0xc752('0x64')](path['join'](config[_0xc752('0x65')],_0xc752('0x66')),'utf8');var _0x363ea9=fs[_0xc752('0x64')](path['join'](config[_0xc752('0x65')],_0xc752('0x67')),_0xc752('0x68'));var _0x4f3862=ejs['render'](_0x10d61b,{'trunks':_0x561768||[]});fs[_0xc752('0x69')](_0xc752('0x6a'),_0x4f3862);if(_0x38f638[_0xc752('0x6b')]){var _0x2826ed=ejs[_0xc752('0x6c')](_0x363ea9,{'trunks':_0x561768||[]});fs[_0xc752('0x69')](_0xc752('0x6d'),_0x2826ed);}})[_0xc752('0x1e')](function(){return respondWithRpcPromise(_0xc752('0x6e'),_0xc752('0x5a'),{'module':_0xc752('0x6f')});})[_0xc752('0x1e')](function(){var _0x2a32e1=_0x408fdb[_0xc752('0x5b')]['get']({'plain':!![]});if(!_0x2a32e1)throw new Error(_0xc752('0x5c'));if(_0x2a32e1[_0xc752('0x5d')]===_0xc752('0x5b')){var _0x137cf8=_0x38f638[_0xc752('0x55')]({'plain':!![]});return db['UserProfileSection'][_0xc752('0x52')]({'where':{'name':'Trunks','userProfileId':_0x2a32e1['userProfileId']},'raw':!![]})['then'](function(_0x13445a){if(_0x13445a&&_0x13445a['autoAssociation']===0x0){return db[_0xc752('0x61')][_0xc752('0x5a')]({'name':_0x137cf8['name'],'resourceId':_0x137cf8['id'],'type':_0x13445a[_0xc752('0x35')],'sectionId':_0x13445a['id']},{})[_0xc752('0x1e')](function(){return _0x38f638;});}else{return _0x38f638;}})[_0xc752('0x28')](function(_0x1dfc87){logger[_0xc752('0x24')](_0xc752('0x62'),_0x1dfc87);throw _0x1dfc87;});}return _0x38f638;})[_0xc752('0x1e')](respondWithResult(_0xf8fd0,0xc9))[_0xc752('0x28')](handleError(_0xf8fd0,null));};exports[_0xc752('0x32')]=function(_0x36a631,_0x44eb04,_0x47d2bb){var _0x29c0c5;return db[_0xc752('0x38')][_0xc752('0x52')]({'where':{'id':_0x36a631['params']['id']}})[_0xc752('0x1e')](handleEntityNotFound(_0x44eb04,null))[_0xc752('0x1e')](saveUpdates(_0x36a631[_0xc752('0x59')],null))[_0xc752('0x1e')](function(_0x3aa2a7){if(_0x3aa2a7){_0x29c0c5=_0x3aa2a7;return db[_0xc752('0x38')][_0xc752('0x63')]({'raw':!![]});}})[_0xc752('0x1e')](function(_0x4ced9d){if(_0x4ced9d){var _0x200794=fs[_0xc752('0x64')](path[_0xc752('0x70')](config[_0xc752('0x65')],'server/files/templates/trunk.ejs'),_0xc752('0x68'));var _0xc3e700=fs[_0xc752('0x64')](path['join'](config['root'],'server/files/templates/registry.ejs'),_0xc752('0x68'));var _0x16bd15=ejs[_0xc752('0x6c')](_0x200794,{'trunks':_0x4ced9d||[]});fs['writeFileSync'](_0xc752('0x6a'),_0x16bd15);var _0x19b20c=ejs[_0xc752('0x6c')](_0xc3e700,{'trunks':_0x4ced9d||[]});fs[_0xc752('0x69')](_0xc752('0x6d'),_0x19b20c);return respondWithRpcPromise(_0xc752('0x6e'),_0xc752('0x32'),{'module':'chan_sip.so'});}return null;})[_0xc752('0x1e')](function(_0x1e8dae){if(_0x1e8dae){return _0x29c0c5;}})['then'](respondWithResult(_0x44eb04,null))['catch'](handleError(_0x44eb04,null));};exports['destroy']=function(_0x4cad20,_0xac82,_0x47edec){var _0x1bbd27;return db['Trunk'][_0xc752('0x52')]({'where':{'id':_0x4cad20['params']['id']}})[_0xc752('0x1e')](handleEntityNotFound(_0xac82,null))[_0xc752('0x1e')](removeEntity(_0xac82,null))[_0xc752('0x1e')](function(){return db[_0xc752('0x38')][_0xc752('0x63')]({'raw':!![]});})[_0xc752('0x1e')](function(_0x1be823){var _0x21ab35=fs['readFileSync'](path['join'](config[_0xc752('0x65')],'server/files/templates/trunk.ejs'),_0xc752('0x68'));var _0x1158ef=fs[_0xc752('0x64')](path[_0xc752('0x70')](config['root'],_0xc752('0x67')),'utf8');var _0x2d83ee=ejs[_0xc752('0x6c')](_0x21ab35,{'trunks':_0x1be823});var _0x5d7f0c=ejs[_0xc752('0x6c')](_0x1158ef,{'trunks':_0x1be823});fs[_0xc752('0x69')](_0xc752('0x6a'),_0x2d83ee);fs[_0xc752('0x69')](_0xc752('0x6d'),_0x5d7f0c);return respondWithRpcPromise(_0xc752('0x6e'),_0xc752('0x33'),{'module':_0xc752('0x6f')});})[_0xc752('0x28')](handleError(_0xac82,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 00cdde3..7eb15af 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 _0xf432=['../../config/environment','exports','define','Trunk','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x2f2814,_0x1f59e1){var _0x3ec25a=function(_0x580219){while(--_0x580219){_0x2f2814['push'](_0x2f2814['shift']());}};_0x3ec25a(++_0x1f59e1);}(_0xf432,0x126));var _0x2f43=function(_0x39d544,_0x35c14f){_0x39d544=_0x39d544-0x0;var _0x5a5ff2=_0xf432[_0x39d544];return _0x5a5ff2;};'use strict';var _=require(_0x2f43('0x0'));var util=require(_0x2f43('0x1'));var logger=require(_0x2f43('0x2'))('api');var moment=require(_0x2f43('0x3'));var BPromise=require(_0x2f43('0x4'));var rp=require(_0x2f43('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2f43('0x6'));var attributes=require('./trunk.attributes');module[_0x2f43('0x7')]=function(_0x430747,_0xce8114){return _0x430747[_0x2f43('0x8')](_0x2f43('0x9'),attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3bda=['Trunk','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0xba3f0a,_0x5a90e0){var _0x381bcf=function(_0x1cccac){while(--_0x1cccac){_0xba3f0a['push'](_0xba3f0a['shift']());}};_0x381bcf(++_0x5a90e0);}(_0x3bda,0x135));var _0xa3bd=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0x3bda[_0x1e4360];return _0x31e6b4;};'use strict';var _=require(_0xa3bd('0x0'));var util=require(_0xa3bd('0x1'));var logger=require('../../config/logger')(_0xa3bd('0x2'));var moment=require(_0xa3bd('0x3'));var BPromise=require(_0xa3bd('0x4'));var rp=require(_0xa3bd('0x5'));var fs=require('fs');var path=require(_0xa3bd('0x6'));var rimraf=require(_0xa3bd('0x7'));var config=require(_0xa3bd('0x8'));var attributes=require('./trunk.attributes');module[_0xa3bd('0x9')]=function(_0x1340fa,_0x3559ae){return _0x1340fa['define'](_0xa3bd('0xa'),attributes,{'tableName':'tools_trunks','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 42893ae..6ee8167 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 _0x1a85=['info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetTrunk','Trunk','options','raw','where','limit','include','model','map','attributes','then','ShowTrunk','find','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','http'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x1a85,0x178));var _0x51a8=function(_0x49b0bf,_0x2c50e9){_0x49b0bf=_0x49b0bf-0x0;var _0x4e6b5c=_0x1a85[_0x49b0bf];return _0x4e6b5c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x51a8('0x0'));var BPromise=require(_0x51a8('0x1'));var rs=require(_0x51a8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x51a8('0x3'));var logger=require(_0x51a8('0x4'))(_0x51a8('0x5'));var config=require('../../config/environment');var jayson=require(_0x51a8('0x6'));var client=jayson['client'][_0x51a8('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5cf430,_0x331117,_0x16a21e){return new BPromise(function(_0x4f3919,_0x228c64){return client['request'](_0x5cf430,_0x16a21e)['then'](function(_0x39e06a){logger[_0x51a8('0x8')](_0x51a8('0x9'),_0x331117,_0x51a8('0xa'));logger[_0x51a8('0xb')](_0x51a8('0xc'),_0x331117,_0x51a8('0xa'),JSON[_0x51a8('0xd')](_0x39e06a));if(_0x39e06a[_0x51a8('0xe')]){if(_0x39e06a[_0x51a8('0xe')][_0x51a8('0xf')]===0x1f4){logger[_0x51a8('0xe')](_0x51a8('0x9'),_0x331117,_0x39e06a[_0x51a8('0xe')][_0x51a8('0x10')]);return _0x228c64(_0x39e06a[_0x51a8('0xe')][_0x51a8('0x10')]);}logger['error'](_0x51a8('0x9'),_0x331117,_0x39e06a[_0x51a8('0xe')][_0x51a8('0x10')]);return _0x4f3919(_0x39e06a['error'][_0x51a8('0x10')]);}else{logger['info'](_0x51a8('0x9'),_0x331117,_0x51a8('0xa'));_0x4f3919(_0x39e06a[_0x51a8('0x11')][_0x51a8('0x10')]);}})[_0x51a8('0x12')](function(_0x3e0603){logger[_0x51a8('0xe')]('Trunk,\x20%s,\x20%s',_0x331117,_0x3e0603);_0x228c64(_0x3e0603);});});}exports[_0x51a8('0x13')]=function(_0x45a433){var _0xd52230=this;return new Promise(function(_0x23539e,_0x3bc1a2){return db[_0x51a8('0x14')]['findAll']({'raw':_0x45a433[_0x51a8('0x15')]?_0x45a433[_0x51a8('0x15')][_0x51a8('0x16')]===undefined?!![]:![]:!![],'where':_0x45a433[_0x51a8('0x15')]?_0x45a433[_0x51a8('0x15')][_0x51a8('0x17')]||null:null,'attributes':_0x45a433[_0x51a8('0x15')]?_0x45a433[_0x51a8('0x15')]['attributes']||null:null,'limit':_0x45a433[_0x51a8('0x15')]?_0x45a433['options'][_0x51a8('0x18')]||null:null,'include':_0x45a433[_0x51a8('0x15')]?_0x45a433[_0x51a8('0x15')][_0x51a8('0x19')]?_['map'](_0x45a433[_0x51a8('0x15')]['include'],function(_0x47f063){return{'model':db[_0x47f063[_0x51a8('0x1a')]],'as':_0x47f063['as'],'attributes':_0x47f063['attributes'],'include':_0x47f063[_0x51a8('0x19')]?_[_0x51a8('0x1b')](_0x47f063[_0x51a8('0x19')],function(_0x18e2f3){return{'model':db[_0x18e2f3[_0x51a8('0x1a')]],'as':_0x18e2f3['as'],'attributes':_0x18e2f3[_0x51a8('0x1c')],'include':_0x18e2f3[_0x51a8('0x19')]?_[_0x51a8('0x1b')](_0x18e2f3['include'],function(_0x273ce2){return{'model':db[_0x273ce2[_0x51a8('0x1a')]],'as':_0x273ce2['as'],'attributes':_0x273ce2[_0x51a8('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x51a8('0x1d')](function(_0x1c150d){logger[_0x51a8('0x8')](_0x51a8('0x13'),_0x45a433);logger[_0x51a8('0xb')](_0x51a8('0x13'),_0x45a433,JSON[_0x51a8('0xd')](_0x1c150d));_0x23539e(_0x1c150d);})[_0x51a8('0x12')](function(_0x347a02){logger['error'](_0x51a8('0x13'),_0x347a02['message'],_0x45a433);_0x3bc1a2(_0xd52230[_0x51a8('0xe')](0x1f4,_0x347a02[_0x51a8('0x10')]));});});};exports[_0x51a8('0x1e')]=function(_0x41df56){var _0x2136b4=this;return new Promise(function(_0x4ea271,_0x10c19b){return db['Trunk'][_0x51a8('0x1f')]({'raw':_0x41df56[_0x51a8('0x15')]?_0x41df56[_0x51a8('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x41df56[_0x51a8('0x15')]?_0x41df56['options'][_0x51a8('0x17')]||null:null,'attributes':_0x41df56[_0x51a8('0x15')]?_0x41df56[_0x51a8('0x15')][_0x51a8('0x1c')]||null:null,'include':_0x41df56[_0x51a8('0x15')]?_0x41df56['options'][_0x51a8('0x19')]?_['map'](_0x41df56[_0x51a8('0x15')][_0x51a8('0x19')],function(_0x41561a){return{'model':db[_0x41561a['model']],'as':_0x41561a['as'],'attributes':_0x41561a[_0x51a8('0x1c')],'include':_0x41561a[_0x51a8('0x19')]?_[_0x51a8('0x1b')](_0x41561a[_0x51a8('0x19')],function(_0x41c020){return{'model':db[_0x41c020['model']],'as':_0x41c020['as'],'attributes':_0x41c020['attributes'],'include':_0x41c020['include']?_[_0x51a8('0x1b')](_0x41c020[_0x51a8('0x19')],function(_0x4ec1db){return{'model':db[_0x4ec1db[_0x51a8('0x1a')]],'as':_0x4ec1db['as'],'attributes':_0x4ec1db['attributes']};}):[]};}):[]};}):[]:[]})[_0x51a8('0x1d')](function(_0x38aa25){logger[_0x51a8('0x8')](_0x51a8('0x1e'),_0x41df56);logger[_0x51a8('0xb')](_0x51a8('0x1e'),_0x41df56,JSON['stringify'](_0x38aa25));_0x4ea271(_0x38aa25);})['catch'](function(_0x377b4c){logger['error']('ShowTrunk',_0x377b4c['message'],_0x41df56);_0x10c19b(_0x2136b4[_0x51a8('0xe')](0x1f4,_0x377b4c[_0x51a8('0x10')]));});});}; \ No newline at end of file +var _0x14a0=['limit','include','model','map','find','ShowTrunk','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','then','debug','request\x20sent','stringify','error','code','Trunk,\x20%s,\x20%s','message','info','result','catch','GetTrunk','Trunk','findAll','options','raw','where','attributes'];(function(_0x3d2aed,_0x4a77d6){var _0x1f3e73=function(_0x2af505){while(--_0x2af505){_0x3d2aed['push'](_0x3d2aed['shift']());}};_0x1f3e73(++_0x4a77d6);}(_0x14a0,0x8e));var _0x014a=function(_0x48b4e4,_0x1eac55){_0x48b4e4=_0x48b4e4-0x0;var _0x3e8fd3=_0x14a0[_0x48b4e4];return _0x3e8fd3;};'use strict';var _=require('lodash');var util=require(_0x014a('0x0'));var moment=require(_0x014a('0x1'));var BPromise=require(_0x014a('0x2'));var rs=require(_0x014a('0x3'));var fs=require('fs');var Redis=require(_0x014a('0x4'));var db=require(_0x014a('0x5'))['db'];var utils=require(_0x014a('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x014a('0x7'));var jayson=require(_0x014a('0x8'));var client=jayson[_0x014a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a61ac,_0x11b8ce,_0x6d05f2){return new BPromise(function(_0x22f17c,_0x4d943b){return client['request'](_0x5a61ac,_0x6d05f2)[_0x014a('0xa')](function(_0x4f5506){logger['info']('Trunk,\x20%s,\x20%s',_0x11b8ce,'request\x20sent');logger[_0x014a('0xb')]('Trunk,\x20%s,\x20%s,\x20%s',_0x11b8ce,_0x014a('0xc'),JSON[_0x014a('0xd')](_0x4f5506));if(_0x4f5506['error']){if(_0x4f5506[_0x014a('0xe')][_0x014a('0xf')]===0x1f4){logger[_0x014a('0xe')](_0x014a('0x10'),_0x11b8ce,_0x4f5506[_0x014a('0xe')][_0x014a('0x11')]);return _0x4d943b(_0x4f5506[_0x014a('0xe')][_0x014a('0x11')]);}logger[_0x014a('0xe')](_0x014a('0x10'),_0x11b8ce,_0x4f5506[_0x014a('0xe')][_0x014a('0x11')]);return _0x22f17c(_0x4f5506['error'][_0x014a('0x11')]);}else{logger[_0x014a('0x12')]('Trunk,\x20%s,\x20%s',_0x11b8ce,_0x014a('0xc'));_0x22f17c(_0x4f5506[_0x014a('0x13')]['message']);}})[_0x014a('0x14')](function(_0x17e4be){logger[_0x014a('0xe')](_0x014a('0x10'),_0x11b8ce,_0x17e4be);_0x4d943b(_0x17e4be);});});}exports[_0x014a('0x15')]=function(_0x12d339){var _0x61ec9f=this;return new Promise(function(_0x263b07,_0x16490a){return db[_0x014a('0x16')][_0x014a('0x17')]({'raw':_0x12d339[_0x014a('0x18')]?_0x12d339[_0x014a('0x18')][_0x014a('0x19')]===undefined?!![]:![]:!![],'where':_0x12d339['options']?_0x12d339[_0x014a('0x18')][_0x014a('0x1a')]||null:null,'attributes':_0x12d339[_0x014a('0x18')]?_0x12d339[_0x014a('0x18')][_0x014a('0x1b')]||null:null,'limit':_0x12d339[_0x014a('0x18')]?_0x12d339[_0x014a('0x18')][_0x014a('0x1c')]||null:null,'include':_0x12d339[_0x014a('0x18')]?_0x12d339['options'][_0x014a('0x1d')]?_['map'](_0x12d339[_0x014a('0x18')][_0x014a('0x1d')],function(_0x44d921){return{'model':db[_0x44d921[_0x014a('0x1e')]],'as':_0x44d921['as'],'attributes':_0x44d921[_0x014a('0x1b')],'include':_0x44d921[_0x014a('0x1d')]?_[_0x014a('0x1f')](_0x44d921[_0x014a('0x1d')],function(_0x165a42){return{'model':db[_0x165a42['model']],'as':_0x165a42['as'],'attributes':_0x165a42[_0x014a('0x1b')],'include':_0x165a42['include']?_[_0x014a('0x1f')](_0x165a42[_0x014a('0x1d')],function(_0x4f1c44){return{'model':db[_0x4f1c44['model']],'as':_0x4f1c44['as'],'attributes':_0x4f1c44[_0x014a('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x014a('0xa')](function(_0x143346){logger['info'](_0x014a('0x15'),_0x12d339);logger[_0x014a('0xb')]('GetTrunk',_0x12d339,JSON[_0x014a('0xd')](_0x143346));_0x263b07(_0x143346);})[_0x014a('0x14')](function(_0x496040){logger['error'](_0x014a('0x15'),_0x496040[_0x014a('0x11')],_0x12d339);_0x16490a(_0x61ec9f[_0x014a('0xe')](0x1f4,_0x496040[_0x014a('0x11')]));});});};exports['ShowTrunk']=function(_0x434038){var _0x147e7e=this;return new Promise(function(_0x15af07,_0x402d3b){return db[_0x014a('0x16')][_0x014a('0x20')]({'raw':_0x434038[_0x014a('0x18')]?_0x434038[_0x014a('0x18')][_0x014a('0x19')]===undefined?!![]:![]:!![],'where':_0x434038[_0x014a('0x18')]?_0x434038[_0x014a('0x18')]['where']||null:null,'attributes':_0x434038[_0x014a('0x18')]?_0x434038[_0x014a('0x18')][_0x014a('0x1b')]||null:null,'include':_0x434038[_0x014a('0x18')]?_0x434038[_0x014a('0x18')][_0x014a('0x1d')]?_[_0x014a('0x1f')](_0x434038['options'][_0x014a('0x1d')],function(_0x325b3c){return{'model':db[_0x325b3c['model']],'as':_0x325b3c['as'],'attributes':_0x325b3c[_0x014a('0x1b')],'include':_0x325b3c[_0x014a('0x1d')]?_[_0x014a('0x1f')](_0x325b3c[_0x014a('0x1d')],function(_0x329136){return{'model':db[_0x329136[_0x014a('0x1e')]],'as':_0x329136['as'],'attributes':_0x329136[_0x014a('0x1b')],'include':_0x329136[_0x014a('0x1d')]?_['map'](_0x329136[_0x014a('0x1d')],function(_0x1dfe6e){return{'model':db[_0x1dfe6e[_0x014a('0x1e')]],'as':_0x1dfe6e['as'],'attributes':_0x1dfe6e[_0x014a('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x427c7a){logger[_0x014a('0x12')](_0x014a('0x21'),_0x434038);logger[_0x014a('0xb')](_0x014a('0x21'),_0x434038,JSON[_0x014a('0xd')](_0x427c7a));_0x15af07(_0x427c7a);})[_0x014a('0x14')](function(_0x36187b){logger[_0x014a('0xe')]('ShowTrunk',_0x36187b[_0x014a('0x11')],_0x434038);_0x402d3b(_0x147e7e['error'](0x1f4,_0x36187b[_0x014a('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 97b784c..12eba41 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 _0xdb28=['/:id/logout','logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addChatWebsites','addSquareProjects','/:id/api_key','createApiKey','/:id','update','put','changePassword','delete','removeTeams','destroy','removeChatInteractions','/:id/mail_interactions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','/:id/fax_accounts','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeSquareProjects','removeApiKey','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','isAuthenticated','index','describe','get','/whoami','whoami','show','getAvatar','getContacts','/:id/queues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','getOpenchannelInteractions','/:id/mail/interactions','/:id/sms/interactions','getSmsInteractions','getFaxInteractions','/:id/teams','getTeams','getAgents','/:id/prefixes','getVoicePrefixes','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','/:id/square_projects','getScheduledCalls','getApiKey','post','bulkCreate','/:id/contacts','addContacts','create','addQueues','diskStorage','server/files/images/','format','%s-%s','originalname','/:id/avatar','single','file','addAvatar','login'];(function(_0x436b2b,_0x3a4efd){var _0x37102f=function(_0x135ca6){while(--_0x135ca6){_0x436b2b['push'](_0x436b2b['shift']());}};_0x37102f(++_0x3a4efd);}(_0xdb28,0x106));var _0x8db2=function(_0x1b455b,_0x6a8466){_0x1b455b=_0x1b455b-0x0;var _0x1b83c9=_0xdb28[_0x1b455b];return _0x1b83c9;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var auth=require(_0x8db2('0x5'));var interaction=require(_0x8db2('0x6'));var config=require(_0x8db2('0x7'));var controller=require(_0x8db2('0x8'));router['get']('/',auth[_0x8db2('0x9')](),controller[_0x8db2('0xa')]);router['get']('/describe',auth[_0x8db2('0x9')](),controller[_0x8db2('0xb')]);router[_0x8db2('0xc')](_0x8db2('0xd'),auth[_0x8db2('0x9')](),controller[_0x8db2('0xe')]);router[_0x8db2('0xc')]('/:id',auth[_0x8db2('0x9')](),controller[_0x8db2('0xf')]);router[_0x8db2('0xc')]('/:id/avatar',controller[_0x8db2('0x10')]);router[_0x8db2('0xc')]('/:id/contacts',auth[_0x8db2('0x9')](),controller[_0x8db2('0x11')]);router[_0x8db2('0xc')](_0x8db2('0x12'),auth[_0x8db2('0x9')](),controller['getQueues']);router['get'](_0x8db2('0x13'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x14')]);router[_0x8db2('0xc')](_0x8db2('0x15'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x16')]);router[_0x8db2('0xc')](_0x8db2('0x17'),auth[_0x8db2('0x9')](),controller['getRecordings']);router[_0x8db2('0xc')](_0x8db2('0x18'),auth['isAuthenticated'](),controller[_0x8db2('0x19')]);router[_0x8db2('0xc')](_0x8db2('0x1a'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x1b')]);router[_0x8db2('0xc')]('/:id/openchannel/interactions',auth['isAuthenticated'](),controller[_0x8db2('0x1c')]);router[_0x8db2('0xc')](_0x8db2('0x1d'),auth[_0x8db2('0x9')](),controller['getMailInteractions']);router[_0x8db2('0xc')](_0x8db2('0x1e'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x1f')]);router[_0x8db2('0xc')]('/:id/fax/interactions',auth[_0x8db2('0x9')](),controller[_0x8db2('0x20')]);router[_0x8db2('0xc')](_0x8db2('0x21'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x22')]);router[_0x8db2('0xc')]('/:id/lists',auth[_0x8db2('0x9')](),controller['getLists']);router['get']('/:id/agents',auth['isAuthenticated'](),controller[_0x8db2('0x23')]);router[_0x8db2('0xc')](_0x8db2('0x24'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x25')]);router[_0x8db2('0xc')]('/:id/fax_accounts',auth[_0x8db2('0x9')](),controller[_0x8db2('0x26')]);router[_0x8db2('0xc')](_0x8db2('0x27'),auth['isAuthenticated'](),controller[_0x8db2('0x28')]);router[_0x8db2('0xc')](_0x8db2('0x29'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x2a')]);router[_0x8db2('0xc')](_0x8db2('0x2b'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x2c')]);router['get'](_0x8db2('0x2d'),auth['isAuthenticated'](),controller['getChatWebsites']);router[_0x8db2('0xc')](_0x8db2('0x2e'),auth[_0x8db2('0x9')](),controller['getSquareProjects']);router[_0x8db2('0xc')]('/:id/scheduled_calls',auth[_0x8db2('0x9')](),controller[_0x8db2('0x2f')]);router[_0x8db2('0xc')]('/:id/api_key',auth['isAuthenticated'](),controller[_0x8db2('0x30')]);router[_0x8db2('0x31')]('/create_many',auth['isAuthenticated'](),controller[_0x8db2('0x32')]);router[_0x8db2('0x31')](_0x8db2('0x33'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x34')]);router[_0x8db2('0x31')]('/',auth[_0x8db2('0x9')](),controller[_0x8db2('0x35')]);router[_0x8db2('0x31')](_0x8db2('0x12'),auth['isAuthenticated'](),controller[_0x8db2('0x36')]);var upload=multer({'storage':multer[_0x8db2('0x37')]({'destination':function(_0x5d2a5b,_0x41594c,_0x3ca80b){_0x3ca80b(null,path['join'](config['root'],_0x8db2('0x38')));},'filename':function(_0x4a45dd,_0x3dfbaa,_0x264696){_0x264696(null,util[_0x8db2('0x39')](_0x8db2('0x3a'),Date['now'](),_0x3dfbaa[_0x8db2('0x3b')]));}})});router['post'](_0x8db2('0x3c'),upload[_0x8db2('0x3d')](_0x8db2('0x3e')),controller[_0x8db2('0x3f')]);router['post']('/:id/login',auth[_0x8db2('0x9')](),controller[_0x8db2('0x40')]);router['post'](_0x8db2('0x41'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x42')]);router['post'](_0x8db2('0x43'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x44')]);router[_0x8db2('0x31')](_0x8db2('0x45'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x46')]);router[_0x8db2('0x31')](_0x8db2('0x21'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x47')]);router[_0x8db2('0x31')](_0x8db2('0x48'),auth['isAuthenticated'](),controller[_0x8db2('0x49')]);router[_0x8db2('0x31')]('/:id/mail_interactions',auth['isAuthenticated'](),controller[_0x8db2('0x4a')]);router['post'](_0x8db2('0x4b'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x4c')]);router[_0x8db2('0x31')](_0x8db2('0x4d'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x4e')]);router['post'](_0x8db2('0x4f'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x50')]);router[_0x8db2('0x31')]('/:id/fax_accounts',auth[_0x8db2('0x9')](),controller[_0x8db2('0x51')]);router[_0x8db2('0x31')](_0x8db2('0x27'),auth['isAuthenticated'](),controller[_0x8db2('0x52')]);router['post'](_0x8db2('0x29'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x53')]);router['post']('/:id/sms_accounts',auth[_0x8db2('0x9')](),controller['addSmsAccounts']);router[_0x8db2('0x31')](_0x8db2('0x2d'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x54')]);router[_0x8db2('0x31')](_0x8db2('0x2e'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x55')]);router[_0x8db2('0x31')](_0x8db2('0x56'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x57')]);router['put'](_0x8db2('0x58'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x59')]);router[_0x8db2('0x5a')]('/:id/password',auth['isAuthenticated'](),controller[_0x8db2('0x5b')]);router[_0x8db2('0x5c')](_0x8db2('0x12'),auth['isAuthenticated'](),controller['removeQueues']);router['delete'](_0x8db2('0x21'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x5d')]);router[_0x8db2('0x5c')](_0x8db2('0x58'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x5e')]);router['delete']('/:id/chat_interactions',auth[_0x8db2('0x9')](),controller[_0x8db2('0x5f')]);router[_0x8db2('0x5c')](_0x8db2('0x60'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x61')]);router[_0x8db2('0x5c')](_0x8db2('0x4b'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x62')]);router[_0x8db2('0x5c')](_0x8db2('0x4d'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x63')]);router[_0x8db2('0x5c')]('/:id/openchannel_interactions',auth[_0x8db2('0x9')](),controller[_0x8db2('0x64')]);router['delete'](_0x8db2('0x65'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x66')]);router['delete'](_0x8db2('0x27'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x67')]);router[_0x8db2('0x5c')](_0x8db2('0x29'),auth['isAuthenticated'](),controller[_0x8db2('0x68')]);router[_0x8db2('0x5c')](_0x8db2('0x2b'),auth['isAuthenticated'](),controller[_0x8db2('0x69')]);router[_0x8db2('0x5c')](_0x8db2('0x2d'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x6a')]);router[_0x8db2('0x5c')](_0x8db2('0x2e'),auth['isAuthenticated'](),controller[_0x8db2('0x6b')]);router[_0x8db2('0x5c')]('/:id/api_key',auth[_0x8db2('0x9')](),controller[_0x8db2('0x6c')]);module['exports']=router; \ No newline at end of file +var _0xc4aa=['put','update','changePassword','removeQueues','removeTeams','delete','destroy','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeSquareProjects','removeApiKey','exports','multer','util','path','connect-timeout','express','Router','./user.controller','get','isAuthenticated','index','/describe','describe','whoami','show','getAvatar','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','getOpenchannelInteractions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','getTeams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','/:id/openchannel_accounts','getOpenchannelAccounts','getSmsAccounts','/:id/chat_websites','/:id/square_projects','getSquareProjects','getApiKey','post','/create_many','bulkCreate','addContacts','create','addQueues','root','server/files/images/','format','%s-%s','originalname','/:id/avatar','file','addAvatar','login','pause','/:id/unpause','unpause','/:id/teams','addTeams','/:id/chat_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','addFaxAccounts','addOpenchannelAccounts','/:id/sms_accounts','addSmsAccounts','addChatWebsites','addSquareProjects','/:id/api_key'];(function(_0x1f7bb0,_0x2f731f){var _0x227595=function(_0x19d925){while(--_0x19d925){_0x1f7bb0['push'](_0x1f7bb0['shift']());}};_0x227595(++_0x2f731f);}(_0xc4aa,0x1b7));var _0xac4a=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0xc4aa[_0xa148b7];return _0x51efd3;};'use strict';var multer=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var path=require(_0xac4a('0x2'));var timeout=require(_0xac4a('0x3'));var express=require(_0xac4a('0x4'));var router=express[_0xac4a('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xac4a('0x6'));router[_0xac4a('0x7')]('/',auth[_0xac4a('0x8')](),controller[_0xac4a('0x9')]);router[_0xac4a('0x7')](_0xac4a('0xa'),auth[_0xac4a('0x8')](),controller[_0xac4a('0xb')]);router['get']('/whoami',auth[_0xac4a('0x8')](),controller[_0xac4a('0xc')]);router[_0xac4a('0x7')]('/:id',auth[_0xac4a('0x8')](),controller[_0xac4a('0xd')]);router[_0xac4a('0x7')]('/:id/avatar',controller[_0xac4a('0xe')]);router['get'](_0xac4a('0xf'),auth['isAuthenticated'](),controller[_0xac4a('0x10')]);router[_0xac4a('0x7')](_0xac4a('0x11'),auth['isAuthenticated'](),controller[_0xac4a('0x12')]);router[_0xac4a('0x7')](_0xac4a('0x13'),auth[_0xac4a('0x8')](),controller[_0xac4a('0x14')]);router[_0xac4a('0x7')](_0xac4a('0x15'),auth[_0xac4a('0x8')](),controller[_0xac4a('0x16')]);router[_0xac4a('0x7')](_0xac4a('0x17'),auth[_0xac4a('0x8')](),controller['getRecordings']);router[_0xac4a('0x7')](_0xac4a('0x18'),auth[_0xac4a('0x8')](),controller[_0xac4a('0x19')]);router[_0xac4a('0x7')](_0xac4a('0x1a'),auth[_0xac4a('0x8')](),controller[_0xac4a('0x1b')]);router['get']('/:id/openchannel/interactions',auth[_0xac4a('0x8')](),controller[_0xac4a('0x1c')]);router[_0xac4a('0x7')]('/:id/mail/interactions',auth[_0xac4a('0x8')](),controller[_0xac4a('0x1d')]);router[_0xac4a('0x7')](_0xac4a('0x1e'),auth[_0xac4a('0x8')](),controller[_0xac4a('0x1f')]);router[_0xac4a('0x7')](_0xac4a('0x20'),auth['isAuthenticated'](),controller[_0xac4a('0x21')]);router[_0xac4a('0x7')]('/:id/teams',auth[_0xac4a('0x8')](),controller[_0xac4a('0x22')]);router[_0xac4a('0x7')](_0xac4a('0x23'),auth['isAuthenticated'](),controller[_0xac4a('0x24')]);router[_0xac4a('0x7')](_0xac4a('0x25'),auth[_0xac4a('0x8')](),controller[_0xac4a('0x26')]);router[_0xac4a('0x7')](_0xac4a('0x27'),auth[_0xac4a('0x8')](),controller[_0xac4a('0x28')]);router[_0xac4a('0x7')](_0xac4a('0x29'),auth[_0xac4a('0x8')](),controller[_0xac4a('0x2a')]);router[_0xac4a('0x7')](_0xac4a('0x2b'),auth[_0xac4a('0x8')](),controller['getMailAccounts']);router[_0xac4a('0x7')](_0xac4a('0x2c'),auth[_0xac4a('0x8')](),controller[_0xac4a('0x2d')]);router[_0xac4a('0x7')]('/:id/sms_accounts',auth['isAuthenticated'](),controller[_0xac4a('0x2e')]);router[_0xac4a('0x7')](_0xac4a('0x2f'),auth['isAuthenticated'](),controller['getChatWebsites']);router[_0xac4a('0x7')](_0xac4a('0x30'),auth[_0xac4a('0x8')](),controller[_0xac4a('0x31')]);router[_0xac4a('0x7')]('/:id/scheduled_calls',auth[_0xac4a('0x8')](),controller['getScheduledCalls']);router[_0xac4a('0x7')]('/:id/api_key',auth[_0xac4a('0x8')](),controller[_0xac4a('0x32')]);router[_0xac4a('0x33')](_0xac4a('0x34'),auth[_0xac4a('0x8')](),controller[_0xac4a('0x35')]);router[_0xac4a('0x33')](_0xac4a('0xf'),auth[_0xac4a('0x8')](),controller[_0xac4a('0x36')]);router[_0xac4a('0x33')]('/',auth[_0xac4a('0x8')](),controller[_0xac4a('0x37')]);router[_0xac4a('0x33')]('/:id/queues',auth[_0xac4a('0x8')](),controller[_0xac4a('0x38')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2a5419,_0x1af1c1,_0x565164){_0x565164(null,path['join'](config[_0xac4a('0x39')],_0xac4a('0x3a')));},'filename':function(_0x1b42b6,_0x3de9e2,_0x4f5986){_0x4f5986(null,util[_0xac4a('0x3b')](_0xac4a('0x3c'),Date['now'](),_0x3de9e2[_0xac4a('0x3d')]));}})});router[_0xac4a('0x33')](_0xac4a('0x3e'),upload['single'](_0xac4a('0x3f')),controller[_0xac4a('0x40')]);router[_0xac4a('0x33')]('/:id/login',auth[_0xac4a('0x8')](),controller[_0xac4a('0x41')]);router['post']('/:id/logout',auth[_0xac4a('0x8')](),controller['logout']);router['post']('/:id/pause',auth['isAuthenticated'](),controller[_0xac4a('0x42')]);router[_0xac4a('0x33')](_0xac4a('0x43'),auth[_0xac4a('0x8')](),controller[_0xac4a('0x44')]);router[_0xac4a('0x33')](_0xac4a('0x45'),auth[_0xac4a('0x8')](),controller[_0xac4a('0x46')]);router[_0xac4a('0x33')](_0xac4a('0x47'),auth[_0xac4a('0x8')](),controller['addChatInteractions']);router['post']('/:id/mail_interactions',auth[_0xac4a('0x8')](),controller[_0xac4a('0x48')]);router[_0xac4a('0x33')](_0xac4a('0x49'),auth[_0xac4a('0x8')](),controller[_0xac4a('0x4a')]);router[_0xac4a('0x33')](_0xac4a('0x4b'),auth[_0xac4a('0x8')](),controller[_0xac4a('0x4c')]);router['post'](_0xac4a('0x4d'),auth[_0xac4a('0x8')](),controller[_0xac4a('0x4e')]);router[_0xac4a('0x33')](_0xac4a('0x29'),auth['isAuthenticated'](),controller[_0xac4a('0x4f')]);router[_0xac4a('0x33')]('/:id/mail_accounts',auth[_0xac4a('0x8')](),controller['addMailAccounts']);router[_0xac4a('0x33')](_0xac4a('0x2c'),auth[_0xac4a('0x8')](),controller[_0xac4a('0x50')]);router[_0xac4a('0x33')](_0xac4a('0x51'),auth[_0xac4a('0x8')](),controller[_0xac4a('0x52')]);router[_0xac4a('0x33')](_0xac4a('0x2f'),auth[_0xac4a('0x8')](),controller[_0xac4a('0x53')]);router['post'](_0xac4a('0x30'),auth[_0xac4a('0x8')](),controller[_0xac4a('0x54')]);router['post'](_0xac4a('0x55'),auth[_0xac4a('0x8')](),controller['createApiKey']);router[_0xac4a('0x56')]('/:id',auth[_0xac4a('0x8')](),controller[_0xac4a('0x57')]);router[_0xac4a('0x56')]('/:id/password',auth['isAuthenticated'](),controller[_0xac4a('0x58')]);router['delete'](_0xac4a('0x11'),auth['isAuthenticated'](),controller[_0xac4a('0x59')]);router['delete'](_0xac4a('0x45'),auth[_0xac4a('0x8')](),controller[_0xac4a('0x5a')]);router[_0xac4a('0x5b')]('/:id',auth[_0xac4a('0x8')](),controller[_0xac4a('0x5c')]);router[_0xac4a('0x5b')](_0xac4a('0x47'),auth[_0xac4a('0x8')](),controller[_0xac4a('0x5d')]);router[_0xac4a('0x5b')]('/:id/mail_interactions',auth[_0xac4a('0x8')](),controller[_0xac4a('0x5e')]);router['delete'](_0xac4a('0x49'),auth[_0xac4a('0x8')](),controller[_0xac4a('0x5f')]);router[_0xac4a('0x5b')]('/:id/sms_interactions',auth[_0xac4a('0x8')](),controller[_0xac4a('0x60')]);router[_0xac4a('0x5b')](_0xac4a('0x4d'),auth[_0xac4a('0x8')](),controller['removeOpenchannelInteractions']);router[_0xac4a('0x5b')]('/:id/fax_accounts',auth[_0xac4a('0x8')](),controller[_0xac4a('0x61')]);router['delete']('/:id/mail_accounts',auth[_0xac4a('0x8')](),controller[_0xac4a('0x62')]);router['delete'](_0xac4a('0x2c'),auth[_0xac4a('0x8')](),controller[_0xac4a('0x63')]);router[_0xac4a('0x5b')]('/:id/sms_accounts',auth[_0xac4a('0x8')](),controller[_0xac4a('0x64')]);router[_0xac4a('0x5b')](_0xac4a('0x2f'),auth[_0xac4a('0x8')](),controller[_0xac4a('0x65')]);router[_0xac4a('0x5b')]('/:id/square_projects',auth[_0xac4a('0x8')](),controller[_0xac4a('0x66')]);router[_0xac4a('0x5b')](_0xac4a('0x55'),auth[_0xac4a('0x8')](),controller[_0xac4a('0x67')]);module[_0xac4a('0x68')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 3a5ef9b..b579ff2 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 _0x9d52=['showWebBar','get','isArray','avpf','force_avp','icesupport','dtlsverify','dtlssetup','dtlscertfile','rtcp_mux','encryption','dtlsenable','actpass','dtlsprivatekey','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','false','screenrecording','blocked','blockedAt','loginAttempts','sequelize','moment','util','lodash','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','ENUM','user','agent','local','INTEGER','accountcode','BOOLEAN','DATE','DEFAULT\x20PAUSE','dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','accept','refuse','uas','active','passive'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9d52,0x1cc));var _0x29d5=function(_0x307086,_0x3bfe4e){_0x307086=_0x307086-0x0;var _0x699043=_0x9d52[_0x307086];return _0x699043;};'use strict';var Sequelize=require(_0x29d5('0x0'));var moment=require(_0x29d5('0x1'));var util=require(_0x29d5('0x2'));var _=require(_0x29d5('0x3'));module['exports']={'name':{'type':Sequelize[_0x29d5('0x4')],'allowNull':![],'unique':_0x29d5('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x4d3320){this[_0x29d5('0x6')](_0x29d5('0x5'),_0x4d3320);this[_0x29d5('0x6')](_0x29d5('0x7'),_0x4d3320);},'comment':_0x29d5('0x8')},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x5be43d){this['setDataValue'](_0x29d5('0x9'),_0x5be43d);this[_0x29d5('0x6')](_0x29d5('0xa'),util[_0x29d5('0xb')](_0x29d5('0xc'),_0x5be43d,this[_0x29d5('0xd')](_0x29d5('0xe'))));}},'alias':{'type':Sequelize[_0x29d5('0x4')]},'email':{'type':Sequelize[_0x29d5('0x4')],'allowNull':![],'unique':_0x29d5('0xf'),'validate':{'isEmail':!![]},'set':function(_0x27785f){if(_0x27785f){this[_0x29d5('0x6')](_0x29d5('0xf'),_0x27785f[_0x29d5('0x10')]());}}},'role':{'type':Sequelize[_0x29d5('0x11')]('admin',_0x29d5('0x12'),_0x29d5('0x13'),'telephone'),'allowNull':![]},'password':{'type':Sequelize[_0x29d5('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':_0x29d5('0x14')},'internal':{'type':Sequelize[_0x29d5('0x15')](0xb),'allowNull':![],'unique':_0x29d5('0xe'),'set':function(_0x5632e5){this[_0x29d5('0x6')](_0x29d5('0xe'),_0x5632e5);this[_0x29d5('0x6')](_0x29d5('0x16'),_0x5632e5);this[_0x29d5('0x6')](_0x29d5('0xa'),util[_0x29d5('0xb')](_0x29d5('0xc'),this['getDataValue'](_0x29d5('0x9')),_0x5632e5));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x29d5('0x4')]},'mobile':{'type':Sequelize[_0x29d5('0x4')]},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize[_0x29d5('0x4')]},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x29d5('0x4')]},'country':{'type':Sequelize[_0x29d5('0x4')]},'online':{'type':Sequelize[_0x29d5('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x29d5('0x18')]},'voicePause':{'type':Sequelize[_0x29d5('0x17')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x29d5('0x17')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x29d5('0x17')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x29d5('0x17')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x29d5('0x17')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize['STRING'],'defaultValue':_0x29d5('0x19')},'lastPauseAt':{'type':Sequelize[_0x29d5('0x18')]},'chatCapacity':{'type':Sequelize[_0x29d5('0x15')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x29d5('0x15')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x29d5('0x15')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x29d5('0x15')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x29d5('0x15')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x29d5('0x15')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x29d5('0x15')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x29d5('0x17')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x29d5('0x17')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x29d5('0x17')],'defaultValue':![]},'description':{'type':Sequelize[_0x29d5('0x4')],'allowNull':!![]},'host':{'type':Sequelize[_0x29d5('0x4')],'allowNull':!![],'defaultValue':_0x29d5('0x1a')},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0x29d5('0x15')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x29d5('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x29d5('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x29d5('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x29d5('0x15')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x29d5('0x11')](_0x29d5('0x1b'),_0x29d5('0x12'),_0x29d5('0x1c')),'allowNull':!![],'defaultValue':_0x29d5('0x1b')},'context':{'type':Sequelize[_0x29d5('0x4')],'allowNull':!![],'defaultValue':_0x29d5('0x1d')},'callingpres':{'type':Sequelize[_0x29d5('0x11')](_0x29d5('0x1e'),'ALLOWED_PASSED_SCREEN',_0x29d5('0x1f'),_0x29d5('0x20'),_0x29d5('0x21'),'PROHIB_PASSED_SCREEN',_0x29d5('0x22'),_0x29d5('0x23')),'allowNull':!![]},'deny':{'type':Sequelize[_0x29d5('0x4')],'allowNull':!![]},'permit':{'type':Sequelize[_0x29d5('0x4')],'allowNull':!![]},'secret':{'type':Sequelize[_0x29d5('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x29d5('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x29d5('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0x29d5('0x4')],'allowNull':!![],'defaultValue':_0x29d5('0x24'),'set':function(_0x1dfea0){this[_0x29d5('0x6')](_0x29d5('0x25'),_0x1dfea0?_0x1dfea0[_0x29d5('0x26')](','):null);},'get':function(){return this[_0x29d5('0xd')](_0x29d5('0x25'))?this['getDataValue'](_0x29d5('0x25'))[_0x29d5('0x27')](','):null;},'comment':_0x29d5('0x28')},'dtmfmode':{'type':Sequelize[_0x29d5('0x11')](_0x29d5('0x29'),_0x29d5('0x2a'),_0x29d5('0x2b'),_0x29d5('0x2c'),_0x29d5('0x2d')),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x29d5('0x11')](_0x29d5('0x2e'),'no',_0x29d5('0x2f'),_0x29d5('0x30'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x29d5('0x11')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x29d5('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x29d5('0x4')],'allowNull':!![]},'nat':{'type':Sequelize[_0x29d5('0x4')],'allowNull':!![],'defaultValue':_0x29d5('0x31'),'set':function(_0x1d6aa6){this[_0x29d5('0x6')](_0x29d5('0x32'),_0x1d6aa6?_0x1d6aa6['join'](','):null);},'get':function(){return this[_0x29d5('0xd')](_0x29d5('0x32'))?this['getDataValue'](_0x29d5('0x32'))[_0x29d5('0x27')](','):null;},'comment':_0x29d5('0x33')},'callgroup':{'type':Sequelize[_0x29d5('0x4')]},'namedcallgroup':{'type':Sequelize[_0x29d5('0x4')]},'pickupgroup':{'type':Sequelize[_0x29d5('0x4')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x29d5('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize[_0x29d5('0x4')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize[_0x29d5('0x4')],'allowNull':![],'defaultValue':_0x29d5('0x34'),'set':function(_0x437527){this[_0x29d5('0x6')]('allow',_0x437527?_0x437527[_0x29d5('0x26')](';'):_0x29d5('0x34'));},'get':function(){return this[_0x29d5('0xd')]('allow')?this[_0x29d5('0xd')](_0x29d5('0x35'))[_0x29d5('0x27')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize[_0x29d5('0x11')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x29d5('0x4')],'allowNull':!![],'set':function(_0x13518c){this[_0x29d5('0x6')](_0x29d5('0x36'),_0x13518c?_0x13518c['join'](','):null);},'get':function(){return this['getDataValue'](_0x29d5('0x36'))?this[_0x29d5('0xd')](_0x29d5('0x36'))[_0x29d5('0x27')](','):null;},'comment':_0x29d5('0x37')},'trustrpid':{'type':Sequelize[_0x29d5('0x11')](_0x29d5('0x2e'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x29d5('0x11')](_0x29d5('0x2e'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x29d5('0x2e'),'no',_0x29d5('0x38')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x29d5('0x11')](_0x29d5('0x2e'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x29d5('0x11')]('yes','no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x29d5('0x15')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x29d5('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x29d5('0x11')](_0x29d5('0x2e'),'no'),'allowNull':!![],'defaultValue':_0x29d5('0x2e')},'busylevel':{'type':Sequelize[_0x29d5('0x15')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x29d5('0x11')](_0x29d5('0x2e'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x29d5('0x2e'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x29d5('0x11')](_0x29d5('0x2e'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x29d5('0x11')]('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x29d5('0x4')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x29d5('0x11')](_0x29d5('0x2e'),'no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x29d5('0x15')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x29d5('0x11')](_0x29d5('0x2e'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x29d5('0x11')](_0x29d5('0x39'),_0x29d5('0x3a'),'originate'),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x29d5('0x15')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x29d5('0x15')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize['ENUM']('uac',_0x29d5('0x3b')),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize[_0x29d5('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x29d5('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize['STRING'],'allowNull':!![]},'qualify':{'type':Sequelize[_0x29d5('0x11')]('yes','no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x29d5('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x29d5('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x29d5('0x15')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x29d5('0x15')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x29d5('0x11')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x29d5('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x29d5('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x29d5('0x15')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x29d5('0x15')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x29d5('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x29d5('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x29d5('0x15')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x29d5('0x11')](_0x29d5('0x2e'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x29d5('0x11')](_0x29d5('0x2e'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x29d5('0x11')](_0x29d5('0x2e'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x29d5('0x11')](_0x29d5('0x2e'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x29d5('0x11')](_0x29d5('0x2e'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0x29d5('0x2e'),'no','fingerprint','certificate'),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x29d5('0x15')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x29d5('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x29d5('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x29d5('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x29d5('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x29d5('0x11')](_0x29d5('0x3c'),_0x29d5('0x3d'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x29d5('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x29d5('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x29d5('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x29d5('0x15')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0x29d5('0x2e'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x29d5('0x11')]('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x29d5('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x29d5('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x29d5('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x29d5('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM'](_0x29d5('0x2e'),'no',_0x29d5('0x2f'),_0x29d5('0x30'),'update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x29d5('0x17')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x29d5('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0x29d5('0x18')]},'showWebBar':{'type':Sequelize[_0x29d5('0x15')],'defaultValue':0x0,'set':function(_0x410130){this[_0x29d5('0x6')](_0x29d5('0x3e'),_0x410130);var _0x4aff0c=this[_0x29d5('0x3f')]({'plain':!![]});switch(_0x410130){case 0x0:case 0x1:var _0x2a7682=_0x4aff0c['transport']?_[_0x29d5('0x40')](_0x4aff0c[_0x29d5('0x25')])?_0x4aff0c['transport'][_0x29d5('0x26')]():_0x4aff0c['transport']:_0x29d5('0x24');if(_0x2a7682==='wss'){_0x2a7682='udp';}this['setDataValue'](_0x29d5('0x25'),_0x2a7682);this[_0x29d5('0x6')]('encryption','no');this[_0x29d5('0x6')](_0x29d5('0x41'),null);this[_0x29d5('0x6')](_0x29d5('0x42'),null);this[_0x29d5('0x6')](_0x29d5('0x43'),null);this[_0x29d5('0x6')]('dtlsenable',null);this[_0x29d5('0x6')](_0x29d5('0x44'),null);this[_0x29d5('0x6')](_0x29d5('0x45'),null);this[_0x29d5('0x6')](_0x29d5('0x46'),null);this[_0x29d5('0x6')]('dtlsprivatekey',null);this[_0x29d5('0x6')](_0x29d5('0x47'),'no');break;case 0x2:this[_0x29d5('0x6')](_0x29d5('0x25'),'wss');this[_0x29d5('0x6')](_0x29d5('0x48'),_0x29d5('0x2e'));this[_0x29d5('0x6')](_0x29d5('0x41'),'yes');this[_0x29d5('0x6')](_0x29d5('0x42'),_0x29d5('0x2e'));this['setDataValue'](_0x29d5('0x43'),_0x29d5('0x2e'));this[_0x29d5('0x6')](_0x29d5('0x49'),_0x29d5('0x2e'));this[_0x29d5('0x6')]('dtlsverify','no');this['setDataValue'](_0x29d5('0x45'),_0x29d5('0x4a'));this[_0x29d5('0x6')]('dtlscertfile',_0x4aff0c['dtlscertfile']||'/etc/pki/tls/certs/motion.crt');this[_0x29d5('0x6')](_0x29d5('0x4b'),_0x4aff0c[_0x29d5('0x4b')]||_0x29d5('0x4c'));this[_0x29d5('0x6')](_0x29d5('0x47'),_0x29d5('0x2e'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x31e2a1){this[_0x29d5('0x6')]('permissions',_0x31e2a1?_0x31e2a1[_0x29d5('0x26')](','):[]);},'get':function(){return this[_0x29d5('0xd')](_0x29d5('0x4d'))?_[_0x29d5('0x4e')](this[_0x29d5('0xd')](_0x29d5('0x4d'))[_0x29d5('0x27')](','),function(_0x4b4f6f){return parseInt(_0x4b4f6f,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x29d5('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize['STRING']},'phoneBarUnconditional':{'type':Sequelize[_0x29d5('0x17')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x29d5('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x29d5('0x17')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x29d5('0x17')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x29d5('0x15')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x29d5('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x29d5('0x15')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x29d5('0x11')](_0x29d5('0x2e'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x29d5('0x17')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'phoneBarEnableJaws':{'type':Sequelize[_0x29d5('0x17')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x29d5('0x4f')],'get':function(){return this[_0x29d5('0xd')](_0x29d5('0x50'))?this['getDataValue'](_0x29d5('0x50')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x29d5('0x17')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x29d5('0x17')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x29d5('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x29d5('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0xa274a9){if(typeof _0xa274a9===_0x29d5('0x51')){var _0x31fa3f=_0xa274a9==='1'?!![]:_0xa274a9==='0'?![]:_0xa274a9==='true'?!![]:_0xa274a9===_0x29d5('0x52')?![]:![];this[_0x29d5('0x6')](_0x29d5('0x53'),_0x31fa3f);}else{this[_0x29d5('0x6')](_0x29d5('0x53'),_0xa274a9);}}},'blocked':{'type':Sequelize[_0x29d5('0x17')],'defaultValue':![],'set':function(_0x386964){this['setDataValue'](_0x29d5('0x54'),_0x386964);if(_0x386964===!![]){this[_0x29d5('0x6')](_0x29d5('0x55'),moment());this['setDataValue'](_0x29d5('0x56'),0x0);}else{this[_0x29d5('0x6')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize[_0x29d5('0x18')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x29d5('0x15')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x29d5('0x17')],'defaultValue':![]}}; \ No newline at end of file +var _0x6b2a=['dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','wss','/etc/pki/tls/private/motion.key','permissions','map','string','false','screenrecording','blockedAt','loginAttempts','sequelize','moment','lodash','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','callerid','format','\x22%s\x22\x20<%s>','internal','email','toLowerCase','ENUM','admin','user','agent','telephone','accountcode','getDataValue','fullname','BOOLEAN','DEFAULT\x20PAUSE','DATE','INTEGER','dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','inband','auto','yes','nonat','outgoing','force_rport,comedia','nat','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','\x22\x22\x20<>','always','refuse','originate','uac','uas','certificate','passive','actpass','update','update,nonat','showWebBar','get','isArray','encryption','avpf','force_avp','icesupport','dtlsenable'];(function(_0x5727b9,_0x51c874){var _0x11154a=function(_0x4ffbe3){while(--_0x4ffbe3){_0x5727b9['push'](_0x5727b9['shift']());}};_0x11154a(++_0x51c874);}(_0x6b2a,0x172));var _0xa6b2=function(_0x39f957,_0x4f7972){_0x39f957=_0x39f957-0x0;var _0x251b11=_0x6b2a[_0x39f957];return _0x251b11;};'use strict';var Sequelize=require(_0xa6b2('0x0'));var moment=require(_0xa6b2('0x1'));var util=require('util');var _=require(_0xa6b2('0x2'));module[_0xa6b2('0x3')]={'name':{'type':Sequelize[_0xa6b2('0x4')],'allowNull':![],'unique':_0xa6b2('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x1f1052){this[_0xa6b2('0x6')](_0xa6b2('0x5'),_0x1f1052);this['setDataValue'](_0xa6b2('0x7'),_0x1f1052);},'comment':_0xa6b2('0x8')},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x1aaf4b){this[_0xa6b2('0x6')]('fullname',_0x1aaf4b);this['setDataValue'](_0xa6b2('0x9'),util[_0xa6b2('0xa')](_0xa6b2('0xb'),_0x1aaf4b,this['getDataValue'](_0xa6b2('0xc'))));}},'alias':{'type':Sequelize[_0xa6b2('0x4')]},'email':{'type':Sequelize[_0xa6b2('0x4')],'allowNull':![],'unique':_0xa6b2('0xd'),'validate':{'isEmail':!![]},'set':function(_0x1080ae){if(_0x1080ae){this['setDataValue'](_0xa6b2('0xd'),_0x1080ae[_0xa6b2('0xe')]());}}},'role':{'type':Sequelize[_0xa6b2('0xf')](_0xa6b2('0x10'),_0xa6b2('0x11'),_0xa6b2('0x12'),_0xa6b2('0x13')),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xa6b2('0x4')],'defaultValue':'local'},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0xa6b2('0xc'),'set':function(_0x59a0ea){this[_0xa6b2('0x6')](_0xa6b2('0xc'),_0x59a0ea);this[_0xa6b2('0x6')](_0xa6b2('0x14'),_0x59a0ea);this[_0xa6b2('0x6')](_0xa6b2('0x9'),util['format'](_0xa6b2('0xb'),this[_0xa6b2('0x15')](_0xa6b2('0x16')),_0x59a0ea));}},'salt':{'type':Sequelize[_0xa6b2('0x4')]},'phone':{'type':Sequelize[_0xa6b2('0x4')]},'mobile':{'type':Sequelize[_0xa6b2('0x4')]},'address':{'type':Sequelize[_0xa6b2('0x4')]},'zipcode':{'type':Sequelize[_0xa6b2('0x4')]},'userpic':{'type':Sequelize[_0xa6b2('0x4')]},'city':{'type':Sequelize[_0xa6b2('0x4')]},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize[_0xa6b2('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize[_0xa6b2('0x17')],'defaultValue':![]},'chatPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xa6b2('0x17')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xa6b2('0x17')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xa6b2('0x17')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xa6b2('0x17')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xa6b2('0x4')],'defaultValue':_0xa6b2('0x18')},'lastPauseAt':{'type':Sequelize[_0xa6b2('0x19')]},'chatCapacity':{'type':Sequelize[_0xa6b2('0x1a')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xa6b2('0x1a')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xa6b2('0x1a')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xa6b2('0x1a')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xa6b2('0x1a')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xa6b2('0x17')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xa6b2('0x1a')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xa6b2('0x17')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize[_0xa6b2('0x4')],'allowNull':!![],'defaultValue':_0xa6b2('0x1b')},'ipaddr':{'type':Sequelize[_0xa6b2('0x4')],'allowNull':!![]},'port':{'type':Sequelize[_0xa6b2('0x1a')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize[_0xa6b2('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize[_0xa6b2('0x1a')](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM'](_0xa6b2('0x1c'),_0xa6b2('0x11'),_0xa6b2('0x1d')),'allowNull':!![],'defaultValue':_0xa6b2('0x1c')},'context':{'type':Sequelize[_0xa6b2('0x4')],'allowNull':!![],'defaultValue':_0xa6b2('0x1e')},'callingpres':{'type':Sequelize[_0xa6b2('0xf')](_0xa6b2('0x1f'),_0xa6b2('0x20'),_0xa6b2('0x21'),_0xa6b2('0x22'),'PROHIB_NOT_SCREENED',_0xa6b2('0x23'),_0xa6b2('0x24'),_0xa6b2('0x25')),'allowNull':!![]},'deny':{'type':Sequelize[_0xa6b2('0x4')],'allowNull':!![]},'permit':{'type':Sequelize[_0xa6b2('0x4')],'allowNull':!![]},'secret':{'type':Sequelize['STRING'],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xa6b2('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xa6b2('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0xa6b2('0x4')],'allowNull':!![],'defaultValue':_0xa6b2('0x26'),'set':function(_0x50c36e){this['setDataValue'](_0xa6b2('0x27'),_0x50c36e?_0x50c36e[_0xa6b2('0x28')](','):null);},'get':function(){return this[_0xa6b2('0x15')](_0xa6b2('0x27'))?this['getDataValue'](_0xa6b2('0x27'))['split'](','):null;},'comment':_0xa6b2('0x29')},'dtmfmode':{'type':Sequelize[_0xa6b2('0xf')]('rfc2833',_0xa6b2('0x2a'),'shortinfo',_0xa6b2('0x2b'),_0xa6b2('0x2c')),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0xa6b2('0xf')](_0xa6b2('0x2d'),'no',_0xa6b2('0x2e'),'update',_0xa6b2('0x2f')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xa6b2('0xf')](_0xa6b2('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xa6b2('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize['STRING'],'allowNull':!![]},'nat':{'type':Sequelize[_0xa6b2('0x4')],'allowNull':!![],'defaultValue':_0xa6b2('0x30'),'set':function(_0x3f455e){this[_0xa6b2('0x6')](_0xa6b2('0x31'),_0x3f455e?_0x3f455e[_0xa6b2('0x28')](','):null);},'get':function(){return this[_0xa6b2('0x15')](_0xa6b2('0x31'))?this[_0xa6b2('0x15')](_0xa6b2('0x31'))[_0xa6b2('0x32')](','):null;},'comment':_0xa6b2('0x33')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0xa6b2('0x4')]},'pickupgroup':{'type':Sequelize[_0xa6b2('0x4')]},'namedpickupgroup':{'type':Sequelize[_0xa6b2('0x4')]},'language':{'type':Sequelize[_0xa6b2('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xa6b2('0x4')]},'disallow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize[_0xa6b2('0x4')],'allowNull':![],'defaultValue':_0xa6b2('0x34'),'set':function(_0x38b1d1){this[_0xa6b2('0x6')](_0xa6b2('0x35'),_0x38b1d1?_0x38b1d1[_0xa6b2('0x28')](';'):_0xa6b2('0x34'));},'get':function(){return this[_0xa6b2('0x15')](_0xa6b2('0x35'))?this[_0xa6b2('0x15')](_0xa6b2('0x35'))[_0xa6b2('0x32')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize[_0xa6b2('0xf')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xa6b2('0x4')],'allowNull':!![],'set':function(_0x404630){this['setDataValue'](_0xa6b2('0x36'),_0x404630?_0x404630['join'](','):null);},'get':function(){return this[_0xa6b2('0x15')](_0xa6b2('0x36'))?this[_0xa6b2('0x15')](_0xa6b2('0x36'))[_0xa6b2('0x32')](','):null;},'comment':_0xa6b2('0x37')},'trustrpid':{'type':Sequelize[_0xa6b2('0xf')](_0xa6b2('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xa6b2('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xa6b2('0xf')](_0xa6b2('0x2d'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xa6b2('0xf')](_0xa6b2('0x2d'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xa6b2('0xf')](_0xa6b2('0x2d'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xa6b2('0x1a')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xa6b2('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xa6b2('0x38')},'amaflags':{'type':Sequelize[_0xa6b2('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xa6b2('0xf')](_0xa6b2('0x2d'),'no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM'](_0xa6b2('0x2d'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xa6b2('0xf')](_0xa6b2('0x2d'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM'](_0xa6b2('0x2d'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xa6b2('0xf')](_0xa6b2('0x2d'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xa6b2('0x4')],'allowNull':!![]},'template':{'type':Sequelize[_0xa6b2('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xa6b2('0xf')]('yes','no',_0xa6b2('0x39')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0xa6b2('0x2d'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xa6b2('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xa6b2('0xf')]('accept',_0xa6b2('0x3a'),_0xa6b2('0x3b')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xa6b2('0x1a')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xa6b2('0xf')](_0xa6b2('0x3c'),_0xa6b2('0x3d')),'allowNull':!![],'defaultValue':_0xa6b2('0x3d')},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize[_0xa6b2('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize['STRING'],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xa6b2('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize[_0xa6b2('0xf')](_0xa6b2('0x2d'),'no'),'allowNull':!![],'defaultValue':_0xa6b2('0x2d')},'keepalive':{'type':Sequelize[_0xa6b2('0x1a')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xa6b2('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xa6b2('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xa6b2('0x1a')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0xa6b2('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xa6b2('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xa6b2('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize[_0xa6b2('0x1a')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xa6b2('0x1a')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xa6b2('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xa6b2('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xa6b2('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xa6b2('0x1a')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xa6b2('0xf')](_0xa6b2('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xa6b2('0xf')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xa6b2('0xf')](_0xa6b2('0x2d'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xa6b2('0xf')](_0xa6b2('0x2d'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xa6b2('0xf')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xa6b2('0xf')](_0xa6b2('0x2d'),'no','fingerprint',_0xa6b2('0x3e')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xa6b2('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xa6b2('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xa6b2('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xa6b2('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xa6b2('0xf')]('active',_0xa6b2('0x3f'),_0xa6b2('0x40')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xa6b2('0xf')](_0xa6b2('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xa6b2('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xa6b2('0x1a')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xa6b2('0xf')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xa6b2('0xf')]('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xa6b2('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize['STRING'],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xa6b2('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xa6b2('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xa6b2('0xf')]('yes','no','nonat',_0xa6b2('0x41'),_0xa6b2('0x42')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xa6b2('0x17')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xa6b2('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0xa6b2('0x19')]},'showWebBar':{'type':Sequelize[_0xa6b2('0x1a')],'defaultValue':0x0,'set':function(_0x5e7a76){this['setDataValue'](_0xa6b2('0x43'),_0x5e7a76);var _0x5a9b83=this[_0xa6b2('0x44')]({'plain':!![]});switch(_0x5e7a76){case 0x0:case 0x1:var _0x30fdaa=_0x5a9b83['transport']?_[_0xa6b2('0x45')](_0x5a9b83[_0xa6b2('0x27')])?_0x5a9b83['transport']['join']():_0x5a9b83['transport']:_0xa6b2('0x26');if(_0x30fdaa==='wss'){_0x30fdaa=_0xa6b2('0x26');}this[_0xa6b2('0x6')](_0xa6b2('0x27'),_0x30fdaa);this[_0xa6b2('0x6')](_0xa6b2('0x46'),'no');this[_0xa6b2('0x6')](_0xa6b2('0x47'),null);this[_0xa6b2('0x6')](_0xa6b2('0x48'),null);this[_0xa6b2('0x6')](_0xa6b2('0x49'),null);this[_0xa6b2('0x6')](_0xa6b2('0x4a'),null);this[_0xa6b2('0x6')](_0xa6b2('0x4b'),null);this[_0xa6b2('0x6')](_0xa6b2('0x4c'),null);this[_0xa6b2('0x6')](_0xa6b2('0x4d'),null);this[_0xa6b2('0x6')](_0xa6b2('0x4e'),null);this['setDataValue'](_0xa6b2('0x4f'),'no');break;case 0x2:this[_0xa6b2('0x6')]('transport',_0xa6b2('0x50'));this[_0xa6b2('0x6')]('encryption',_0xa6b2('0x2d'));this['setDataValue'](_0xa6b2('0x47'),_0xa6b2('0x2d'));this[_0xa6b2('0x6')]('force_avp','yes');this[_0xa6b2('0x6')]('icesupport','yes');this[_0xa6b2('0x6')](_0xa6b2('0x4a'),'yes');this[_0xa6b2('0x6')](_0xa6b2('0x4b'),'no');this[_0xa6b2('0x6')](_0xa6b2('0x4c'),_0xa6b2('0x40'));this[_0xa6b2('0x6')](_0xa6b2('0x4d'),_0x5a9b83[_0xa6b2('0x4d')]||'/etc/pki/tls/certs/motion.crt');this['setDataValue'](_0xa6b2('0x4e'),_0x5a9b83['dtlsprivatekey']||_0xa6b2('0x51'));this[_0xa6b2('0x6')]('rtcp_mux',_0xa6b2('0x2d'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x1de7d6){this['setDataValue'](_0xa6b2('0x52'),_0x1de7d6?_0x1de7d6[_0xa6b2('0x28')](','):[]);},'get':function(){return this['getDataValue'](_0xa6b2('0x52'))?_[_0xa6b2('0x53')](this[_0xa6b2('0x15')](_0xa6b2('0x52'))[_0xa6b2('0x32')](','),function(_0x11a298){return parseInt(_0x11a298,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize['STRING']},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xa6b2('0x17')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xa6b2('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xa6b2('0x17')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xa6b2('0x17')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xa6b2('0x17')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xa6b2('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xa6b2('0xf')](_0xa6b2('0x2d'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xa6b2('0x17')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xa6b2('0x4')]},'passwordResetAt':{'type':Sequelize[_0xa6b2('0x19')],'defaultValue':null},'phoneBarEnableJaws':{'type':Sequelize[_0xa6b2('0x17')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xa6b2('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue']('phoneBarEnableScreenRecordingByAgent')?this[_0xa6b2('0x15')]('phoneBarEnableScreenRecordingByAgent'):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xa6b2('0x17')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xa6b2('0x17')],'defaultValue':![]},'interface':{'type':Sequelize[_0xa6b2('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xa6b2('0x17')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xa6b2('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xa6b2('0x17')],'defaultValue':![],'set':function(_0x5de585){if(typeof _0x5de585===_0xa6b2('0x54')){var _0x41e1fd=_0x5de585==='1'?!![]:_0x5de585==='0'?![]:_0x5de585==='true'?!![]:_0x5de585===_0xa6b2('0x55')?![]:![];this['setDataValue']('screenrecording',_0x41e1fd);}else{this[_0xa6b2('0x6')](_0xa6b2('0x56'),_0x5de585);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0xa3ee3f){this[_0xa6b2('0x6')]('blocked',_0xa3ee3f);if(_0xa3ee3f===!![]){this[_0xa6b2('0x6')](_0xa6b2('0x57'),moment());this[_0xa6b2('0x6')](_0xa6b2('0x58'),0x0);}else{this[_0xa6b2('0x6')](_0xa6b2('0x57'),null);}}},'blockedAt':{'type':Sequelize[_0xa6b2('0x19')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xa6b2('0x1a')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index a5ec622..5a86a37 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 _0xd8b6=['$iLike','$contains','$any','lastName','Contact','dialActive','createApiKey','generateApiKey','iat','nonce','token','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./user.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~!@#$%^&-_=+[{]}.','then','info','User,\x20%s,\x20%s','User,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','sendStatus','status','json','count','offset','limit','set','apply','reject','save','destroy','get','Users','user','Agents','agent','telephone','ignore','value','includes','role','find','UserProfileResource','end','name','send','index','User','fieldName','key','model','differenceBy','map','password','salt','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','where','pick','filter','type','sequelize','lower','col','merge','include','findAll','rows','show','rawAttributes','fields','includeAll','options','bulkCreate','body','update','describe','ids','omit','admin','../../config/license/util','telephones','users','isNil','License\x20limit\x20reached','format','create','internal','Setting','findById','securePassword','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','QueryTypes','SELECT','from','voicemail','mailbox','VoiceMail','fullname','permissions','101','102','103','110','104','106','107','108','109','100','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','oldPassword','newPassword','New\x20password\x20must\x20be\x20different\x20from\x20old\x20one','params','Sequelize','Invalid\x20body\x20format.\x20Use\x20oldPassord\x20and\x20newPassword','authenticate','ValidationError','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','Unauthorized','findOne','addQueues','channel','online','voicePause','interface','isValidChannel','Unknown\x20channel','add','capitalize','toLowerCase','spread','QueueId','emit','Queue:save','VoiceQueue','voice','push','SIP/%s','penalty','each','upsert','removeQueues','remove','Queues','Queue:remove','UserVoiceQueueRt','addAvatar','userpic','file','filename','getAvatar','join','root','server/files/images/logos/default_profile.png','download','existsSync','server/files/images/','CmContact','sort','getContacts','CmList','List','Tag','Tags','tag','getQueues','Queue','getVoiceQueuesRt','getGroups','ChatGroup','VoiceRecording','getScreenRecordings','ScreenRecording','UserId','getChatInteractions','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','login','phone','loginInPause','LOCAL/%s@from-sip/n','user:%s','headers','x-forwarded-for','connection','socket','remoteAddress','getVoiceQueues','UserVoiceQueue.penalty','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','all','LOGIN','PAUSE','LOGININPAUSE','resolve','pause','QueuePause','getChannels','DEFAULT\x20PAUSE','unpause','mailPause','chatPause','faxPause','smsPause','pauseType','manual','mail','fax','openchannel','%s%s','Pause','getTeams','addTeams','Team','setDataValue','Chat','getMailQueues','Mail','Sms','getFaxQueues','Openchannel','flatten','transaction','addAgent','Voice','getDataValue','removeTeams','getChatQueues','getSmsQueues','Fax','getOpenchannelQueues','getLists','getAgents','values','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','isArray','addMailInteractions','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','getVoicePrefixes','getFaxAccounts','FaxAccount','addFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','addSmsAccounts','removeSmsAccounts','ChatWebsite','getChatWebsites','addChatWebsites','removeChatWebsites','getSquareProjects','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','$and','$or','$gt','$gte','$lt','$lte','$ne','$not','$between','$notBetween','$in','$like','$notLike'];(function(_0x15833e,_0x58a046){var _0x5c4745=function(_0x2d1a2c){while(--_0x2d1a2c){_0x15833e['push'](_0x15833e['shift']());}};_0x5c4745(++_0x58a046);}(_0xd8b6,0x16d));var _0x6d8b=function(_0x53c365,_0x14fa1f){_0x53c365=_0x53c365-0x0;var _0xe1307c=_0xd8b6[_0x53c365];return _0xe1307c;};'use strict';var pdf=require(_0x6d8b('0x0'));var emlformat=require(_0x6d8b('0x1'));var rimraf=require(_0x6d8b('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6d8b('0x3'));var moment=require(_0x6d8b('0x4'));var BPromise=require(_0x6d8b('0x5'));var Mustache=require(_0x6d8b('0x6'));var util=require(_0x6d8b('0x7'));var path=require('path');var sox=require(_0x6d8b('0x8'));var csv=require(_0x6d8b('0x9'));var ejs=require(_0x6d8b('0xa'));var fs=require('fs');var _=require(_0x6d8b('0xb'));var squel=require(_0x6d8b('0xc'));var crypto=require(_0x6d8b('0xd'));var jsforce=require(_0x6d8b('0xe'));var deskjs=require(_0x6d8b('0xf'));var toCsv=require(_0x6d8b('0x9'));var querystring=require(_0x6d8b('0x10'));var Papa=require(_0x6d8b('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6d8b('0x12'));var as=require(_0x6d8b('0x13'));var hardwareService=require(_0x6d8b('0x14'));var logger=require(_0x6d8b('0x15'))(_0x6d8b('0x16'));var utils=require('../../config/utils');var config=require(_0x6d8b('0x17'));var db=require(_0x6d8b('0x18'))['db'];config[_0x6d8b('0x19')]=_[_0x6d8b('0x1a')](config[_0x6d8b('0x19')],{'host':_0x6d8b('0x1b'),'port':0x18eb});var socket=require(_0x6d8b('0x1c'))(new Redis(config[_0x6d8b('0x19')]));require(_0x6d8b('0x1d'))[_0x6d8b('0x1e')](socket);var jayson=require(_0x6d8b('0x1f'));var client=jayson[_0x6d8b('0x20')][_0x6d8b('0x21')]({'port':0x232a});function checkPasswordPattern(_0x2cf805,_0x4ac4b7,_0x24638b){if(_0x24638b){var _0x390149=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x390149['test'](_0x4ac4b7)){return _0x2cf805;}else{throw new Error(_0x6d8b('0x22'));}}else{return _0x2cf805;}}function respondWithRpcPromise(_0x1b7f08,_0x55e356,_0x1c9d4e,_0x2afd3f){return new BPromise(function(_0x10f096,_0x4e3f67){var _0x5a444c=_0x2afd3f||client;return _0x5a444c['request'](_0x1b7f08,_0x1c9d4e)[_0x6d8b('0x23')](function(_0x43c785){logger[_0x6d8b('0x24')](_0x6d8b('0x25'),_0x55e356,'request\x20sent');logger['debug'](_0x6d8b('0x26'),_0x55e356,_0x6d8b('0x27'),JSON['stringify'](_0x43c785));if(_0x43c785['error']){if(_0x43c785[_0x6d8b('0x28')]['code']===0x1f4){logger['error'](_0x6d8b('0x25'),_0x55e356,_0x43c785[_0x6d8b('0x28')]['message']);return _0x4e3f67(_0x43c785[_0x6d8b('0x28')]['message']);}logger[_0x6d8b('0x28')](_0x6d8b('0x25'),_0x55e356,_0x43c785[_0x6d8b('0x28')][_0x6d8b('0x29')]);return _0x10f096(_0x43c785[_0x6d8b('0x28')][_0x6d8b('0x29')]);}else{logger['info'](_0x6d8b('0x25'),_0x55e356,'request\x20sent');_0x10f096(_0x43c785[_0x6d8b('0x2a')][_0x6d8b('0x29')]);}})[_0x6d8b('0x2b')](function(_0x2cf67a){logger[_0x6d8b('0x28')]('User,\x20%s,\x20%s',_0x55e356,_0x2cf67a);_0x4e3f67(_0x2cf67a);});});}function respondWithStatusCode(_0x1e6963,_0x2c7886){_0x2c7886=_0x2c7886||0xcc;return function(_0x18d0ae){if(_0x18d0ae){return _0x1e6963[_0x6d8b('0x2c')](_0x2c7886);}return _0x1e6963['status'](_0x2c7886)['end']();};}function respondWithResult(_0x37c76f,_0x180107){_0x180107=_0x180107||0xc8;return function(_0x29ec3d){if(_0x29ec3d){return _0x37c76f[_0x6d8b('0x2d')](_0x180107)[_0x6d8b('0x2e')](_0x29ec3d);}};}function respondWithFilteredResult(_0x20c670,_0x137783){return function(_0x387981){if(_0x387981){var _0x1f9750=_0x387981[_0x6d8b('0x2f')],_0x31956b=_0x137783['offset'],_0x2c2bd0=_0x137783[_0x6d8b('0x30')]+_0x137783[_0x6d8b('0x31')],_0x2e1c17;if(_0x2c2bd0>=_0x1f9750){_0x2c2bd0=_0x1f9750;_0x2e1c17=0xc8;}else{_0x2e1c17=0xce;}_0x20c670['status'](_0x2e1c17);return _0x20c670[_0x6d8b('0x32')]('Content-Range',_0x31956b+'-'+_0x2c2bd0+'/'+_0x1f9750)[_0x6d8b('0x2e')](_0x387981);}return null;};}function patchUpdates(_0x31fc7e){return function(_0x5772fa){try{jsonpatch[_0x6d8b('0x33')](_0x5772fa,_0x31fc7e,!![]);}catch(_0x2bed66){return BPromise[_0x6d8b('0x34')](_0x2bed66);}return _0x5772fa[_0x6d8b('0x35')]();};}function saveUpdates(_0x400172,_0x25f858){return function(_0x791c1d){if(_0x791c1d){return _0x791c1d['update'](_0x400172)[_0x6d8b('0x23')](function(_0x3c0075){return _0x3c0075;});}return null;};}function removeEntity(_0xd25c,_0x31f2aa){return function(_0x26ac76){if(_0x26ac76){return _0x26ac76[_0x6d8b('0x36')]()[_0x6d8b('0x23')](function(){var _0x3a2a7b=_0x26ac76[_0x6d8b('0x37')]({'plain':!![]});var _0x3eca93=[{'name':_0x6d8b('0x38'),'value':_0x6d8b('0x39'),'ignore':!![]},{'name':_0x6d8b('0x3a'),'value':_0x6d8b('0x3b'),'ignore':![]},{'name':'Telephones','value':_0x6d8b('0x3c'),'ignore':![]}];var _0x485a1e=_(_0x3eca93)['filter'](_0x6d8b('0x3d'))['map'](_0x6d8b('0x3e'))['value']();if(_[_0x6d8b('0x3f')](_0x485a1e,_0x3a2a7b[_0x6d8b('0x40')])){return;}var _0x5c2c13=_[_0x6d8b('0x41')](_0x3eca93,[_0x6d8b('0x3e'),_0x3a2a7b[_0x6d8b('0x40')]])['name'];return db[_0x6d8b('0x42')]['destroy']({'where':{'type':_0x5c2c13,'resourceId':_0x3a2a7b['id']}})[_0x6d8b('0x23')](function(){return _0x26ac76;});})[_0x6d8b('0x23')](function(){_0xd25c[_0x6d8b('0x2d')](0xcc)[_0x6d8b('0x43')]();});}};}function handleEntityNotFound(_0xa94ecd,_0x3f0b14){return function(_0x4d847e){if(!_0x4d847e){_0xa94ecd[_0x6d8b('0x2c')](0x194);}return _0x4d847e;};}function handleError(_0x4b1797,_0x24ef85){_0x24ef85=_0x24ef85||0x1f4;return function(_0x180f8b){logger[_0x6d8b('0x28')](_0x180f8b['stack']);if(_0x180f8b['name']){delete _0x180f8b[_0x6d8b('0x44')];}_0x4b1797[_0x6d8b('0x2d')](_0x24ef85)[_0x6d8b('0x45')](_0x180f8b);};}exports[_0x6d8b('0x46')]=function(_0x3fa56a,_0x4a1310){var _0xc56f3={},_0x372e9c={},_0x12565d={'count':0x0,'rows':[]};var _0x1fe0a1=_['map'](db[_0x6d8b('0x47')]['rawAttributes'],function(_0x146386){return{'name':_0x146386[_0x6d8b('0x48')],'type':_0x146386['type'][_0x6d8b('0x49')]};});_0x372e9c[_0x6d8b('0x4a')]=_[_0x6d8b('0x4b')](_[_0x6d8b('0x4c')](_0x1fe0a1,_0x6d8b('0x44')),[_0x6d8b('0x4d'),_0x6d8b('0x4e')]);_0x372e9c[_0x6d8b('0x4f')]=_[_0x6d8b('0x50')](_0x3fa56a[_0x6d8b('0x4f')]);_0x372e9c[_0x6d8b('0x51')]=_[_0x6d8b('0x52')](_0x372e9c[_0x6d8b('0x4a')],_0x372e9c['query']);_0xc56f3[_0x6d8b('0x53')]=_['intersection'](_0x372e9c[_0x6d8b('0x4a')],qs['fields'](_0x3fa56a[_0x6d8b('0x4f')]['fields']));_0xc56f3[_0x6d8b('0x53')]=_0xc56f3[_0x6d8b('0x53')][_0x6d8b('0x54')]?_0xc56f3[_0x6d8b('0x53')]:_0x372e9c[_0x6d8b('0x4a')];if(!_0x3fa56a[_0x6d8b('0x4f')][_0x6d8b('0x55')](_0x6d8b('0x56'))){_0xc56f3[_0x6d8b('0x31')]=qs[_0x6d8b('0x31')](_0x3fa56a['query'][_0x6d8b('0x31')]);_0xc56f3[_0x6d8b('0x30')]=qs[_0x6d8b('0x30')](_0x3fa56a[_0x6d8b('0x4f')][_0x6d8b('0x30')]);}_0xc56f3[_0x6d8b('0x57')]=qs['sort'](_0x3fa56a[_0x6d8b('0x4f')]['sort']);_0xc56f3[_0x6d8b('0x58')]=qs[_0x6d8b('0x51')](_[_0x6d8b('0x59')](_0x3fa56a[_0x6d8b('0x4f')],_0x372e9c['filters']));if(_0x3fa56a[_0x6d8b('0x4f')][_0x6d8b('0x5a')]){_0xc56f3['where']=_['merge'](_0xc56f3['where'],{'$or':_[_0x6d8b('0x4c')](_0x1fe0a1,function(_0x3514a2){if(_0x3514a2[_0x6d8b('0x5b')]['key']!=='VIRTUAL'){return db[_0x6d8b('0x5c')][_0x6d8b('0x58')](db[_0x6d8b('0x5c')]['fn'](_0x6d8b('0x5d'),db[_0x6d8b('0x5c')][_0x6d8b('0x5e')](_0x3514a2['field'])),{'$like':db[_0x6d8b('0x5c')]['fn']('lower','%'+_0x3fa56a['query'][_0x6d8b('0x5a')]+'%')});}})});}_0xc56f3=_[_0x6d8b('0x5f')]({},_0xc56f3,_0x3fa56a['options']);var _0x435c77={'where':_0xc56f3[_0x6d8b('0x58')]};return db[_0x6d8b('0x47')]['count'](_0x435c77)[_0x6d8b('0x23')](function(_0x681cfa){_0x12565d[_0x6d8b('0x2f')]=_0x681cfa;if(_0x3fa56a[_0x6d8b('0x4f')]['includeAll']){_0xc56f3[_0x6d8b('0x60')]=[{'all':!![]}];}return db[_0x6d8b('0x47')][_0x6d8b('0x61')](_0xc56f3);})['then'](function(_0x31c635){_0x12565d[_0x6d8b('0x62')]=_0x31c635;return _0x12565d;})[_0x6d8b('0x23')](respondWithFilteredResult(_0x4a1310,_0xc56f3))['catch'](handleError(_0x4a1310,null));};exports[_0x6d8b('0x63')]=function(_0x448c83,_0x3adc8a){var _0x4a4168={'raw':![],'where':{'id':_0x448c83['params']['id']}},_0x136a6b={};_0x136a6b[_0x6d8b('0x4a')]=_[_0x6d8b('0x4b')](_[_0x6d8b('0x50')](db['User'][_0x6d8b('0x64')]),[_0x6d8b('0x4d'),_0x6d8b('0x4e')]);_0x136a6b[_0x6d8b('0x4f')]=_[_0x6d8b('0x50')](_0x448c83[_0x6d8b('0x4f')]);_0x136a6b[_0x6d8b('0x51')]=_[_0x6d8b('0x52')](_0x136a6b[_0x6d8b('0x4a')],_0x136a6b['query']);_0x4a4168[_0x6d8b('0x53')]=_[_0x6d8b('0x52')](_0x136a6b[_0x6d8b('0x4a')],qs[_0x6d8b('0x65')](_0x448c83['query'][_0x6d8b('0x65')]));_0x4a4168[_0x6d8b('0x53')]=_0x4a4168['attributes']['length']?_0x4a4168['attributes']:_0x136a6b[_0x6d8b('0x4a')];if(_0x448c83['query'][_0x6d8b('0x66')]){_0x4a4168[_0x6d8b('0x60')]=[{'all':!![]}];}_0x4a4168=_[_0x6d8b('0x5f')]({},_0x4a4168,_0x448c83[_0x6d8b('0x67')]);return db[_0x6d8b('0x47')]['find'](_0x4a4168)[_0x6d8b('0x23')](handleEntityNotFound(_0x3adc8a,null))[_0x6d8b('0x23')](respondWithResult(_0x3adc8a,null))[_0x6d8b('0x2b')](handleError(_0x3adc8a,null));};exports[_0x6d8b('0x68')]=function(_0x3a0ba0,_0x4bc160){return db[_0x6d8b('0x47')][_0x6d8b('0x68')](_0x3a0ba0[_0x6d8b('0x69')],{'raw':![],'individualHooks':!![]})[_0x6d8b('0x23')](respondWithResult(_0x4bc160,0xc9))[_0x6d8b('0x2b')](handleError(_0x4bc160,null));};exports[_0x6d8b('0x6a')]=function(_0x54cb12,_0x5d9476){if(_0x54cb12[_0x6d8b('0x69')]['id']){delete _0x54cb12[_0x6d8b('0x69')]['id'];}delete _0x54cb12[_0x6d8b('0x69')][_0x6d8b('0x40')];return db[_0x6d8b('0x47')]['find']({'where':{'id':_0x54cb12['params']['id']}})['then'](handleEntityNotFound(_0x5d9476,null))['then'](saveUpdates(_0x54cb12['body'],null))[_0x6d8b('0x23')](respondWithResult(_0x5d9476,null))[_0x6d8b('0x2b')](handleError(_0x5d9476,null));};exports[_0x6d8b('0x6b')]=function(_0x101639,_0x182512){return db[_0x6d8b('0x47')][_0x6d8b('0x6b')]()[_0x6d8b('0x23')](respondWithResult(_0x182512,null))['catch'](handleError(_0x182512,null));};exports['addContacts']=function(_0x361d02,_0x3987ff,_0x41b265){return db['User'][_0x6d8b('0x41')]({'where':{'id':_0x361d02['params']['id']}})[_0x6d8b('0x23')](handleEntityNotFound(_0x3987ff,null))['then'](function(_0x35ed40){if(_0x35ed40){return _0x35ed40['addContacts'](_0x361d02[_0x6d8b('0x69')][_0x6d8b('0x6c')],_[_0x6d8b('0x6d')](_0x361d02['body'],[_0x6d8b('0x6c'),'id'])||{});}})['then'](respondWithResult(_0x3987ff,null))[_0x6d8b('0x2b')](handleError(_0x3987ff,null));};var getLicense=function(_0x12796c){return new BPromise(function(_0x46ceda,_0x165c0b){var _0xaeec5c=0x0;_0x12796c[_0x6d8b('0x69')]['role']==='agent'&&_0x46ceda('agent\x20role');return db[_0x6d8b('0x47')][_0x6d8b('0x2f')]({'where':{'$or':[{'role':_0x12796c[_0x6d8b('0x69')]['role']===_0x6d8b('0x3c')?'telephone':[_0x6d8b('0x6e'),_0x6d8b('0x39')]}]}})[_0x6d8b('0x23')](function(_0xf13436){_0xaeec5c=_0xf13436;return require(_0x6d8b('0x6f'))['getLicense']();})['then'](function(_0x5b1a15){var _0x164842=_0x12796c[_0x6d8b('0x69')][_0x6d8b('0x40')]===_0x6d8b('0x3c')?_0x6d8b('0x70'):_0x6d8b('0x71');if(!_[_0x6d8b('0x72')](_0x5b1a15[_0x164842])&&_0xaeec5c>=_0x5b1a15[_0x164842]){return _0x165c0b({'message':_0x6d8b('0x73')});}return _0x46ceda(util[_0x6d8b('0x74')]('count\x20%s:\x20%s',_0x164842,_0xaeec5c));})[_0x6d8b('0x2b')](function(_0x5a5d31){return _0x165c0b(_0x5a5d31);});});};exports[_0x6d8b('0x75')]=function(_0xfe35dd,_0xbfea42){return getLicense(_0xfe35dd)['then'](function(_0x141f3b){if(!_0xfe35dd['body'][_0x6d8b('0x76')]){var _0x133928;return db[_0x6d8b('0x77')][_0x6d8b('0x78')](0x1)[_0x6d8b('0x23')](function(_0xc2d406){return checkPasswordPattern(_0xc2d406,_0xfe35dd[_0x6d8b('0x69')]['password'],_0xc2d406[_0x6d8b('0x79')]);})[_0x6d8b('0x23')](function(_0x241de9){_0x133928=_0x241de9['min_internal'];return db[_0x6d8b('0x47')]['max']('internal');})['then'](function(_0x16c627){if(_[_0x6d8b('0x72')](_0x16c627)){if(_0x133928){_0xfe35dd[_0x6d8b('0x69')][_0x6d8b('0x76')]=_0x133928;}else{_0xfe35dd['body'][_0x6d8b('0x76')]=0x1;}}else{if(_[_0x6d8b('0x72')](_0x133928)||_0x133928==_0x16c627){_0xfe35dd[_0x6d8b('0x69')][_0x6d8b('0x76')]=_0x16c627+0x1;}else if(_0x133928>_0x16c627){_0xfe35dd[_0x6d8b('0x69')][_0x6d8b('0x76')]=_0x133928;}else{return db[_0x6d8b('0x5c')][_0x6d8b('0x4f')](_0x6d8b('0x7a'),{'type':db[_0x6d8b('0x5c')][_0x6d8b('0x7b')][_0x6d8b('0x7c')]})[_0x6d8b('0x23')](function(_0x1653e2){if(_0x1653e2&&_0x1653e2[_0x6d8b('0x54')]){for(var _0x1b2428=0x0,_0x3275dc=_0x1653e2['length'];_0x1b2428<_0x3275dc&&_[_0x6d8b('0x72')](_0xfe35dd[_0x6d8b('0x69')][_0x6d8b('0x76')]);_0x1b2428++){if(_0x133928<=_0x1653e2[_0x1b2428][_0x6d8b('0x7d')]){_0xfe35dd['body'][_0x6d8b('0x76')]=_0x1653e2[_0x1b2428]['from'];}else if(_0x133928>_0x1653e2[_0x1b2428][_0x6d8b('0x7d')]&&_0x133928<=_0x1653e2[_0x1b2428]['to']){_0xfe35dd[_0x6d8b('0x69')][_0x6d8b('0x76')]=_0x133928;}}}if(_[_0x6d8b('0x72')](_0xfe35dd['body'][_0x6d8b('0x76')])){_0xfe35dd['body'][_0x6d8b('0x76')]=_0x16c627+0x1;}});}}});}})[_0x6d8b('0x23')](function(){if(_0xfe35dd[_0x6d8b('0x69')][_0x6d8b('0x7e')]){_0xfe35dd[_0x6d8b('0x69')][_0x6d8b('0x7f')]=_0xfe35dd[_0x6d8b('0x69')][_0x6d8b('0x76')];_0xfe35dd[_0x6d8b('0x69')][_0x6d8b('0x80')]={'mailbox':_0xfe35dd[_0x6d8b('0x69')][_0x6d8b('0x76')],'password':_0xfe35dd[_0x6d8b('0x69')][_0x6d8b('0x4d')],'fullname':_0xfe35dd[_0x6d8b('0x69')][_0x6d8b('0x81')],'email':_0xfe35dd['body']['email']};}if(_0xfe35dd['body']&&_0xfe35dd[_0x6d8b('0x69')][_0x6d8b('0x40')]===_0x6d8b('0x3b')){_0xfe35dd['body'][_0x6d8b('0x82')]=[_0x6d8b('0x83'),_0x6d8b('0x84'),_0x6d8b('0x85'),_0x6d8b('0x86'),_0x6d8b('0x87'),'105',_0x6d8b('0x88'),_0x6d8b('0x89'),_0x6d8b('0x8a'),_0x6d8b('0x8b'),_0x6d8b('0x8c'),'111'];}return db[_0x6d8b('0x47')][_0x6d8b('0x75')](_0xfe35dd[_0x6d8b('0x69')],{'include':[{'model':db[_0x6d8b('0x80')],'as':_0x6d8b('0x80')}]});})[_0x6d8b('0x23')](function(_0x3043c9){if(_0xfe35dd[_0x6d8b('0x69')][_0x6d8b('0x40')]==='user')return _0x3043c9;var _0x39043e=_0xfe35dd['user'][_0x6d8b('0x37')]({'plain':!![]});if(!_0x39043e)throw new Error(_0x6d8b('0x8d'));if(_0x39043e[_0x6d8b('0x40')]===_0x6d8b('0x39')){var _0x3e30bf=_0x3043c9[_0x6d8b('0x37')]({'plain':!![]});var _0x2cf45e=[{'name':_0x6d8b('0x3a'),'value':_0x6d8b('0x3b')},{'name':'Telephones','value':_0x6d8b('0x3c')}];var _0x337c2c=_[_0x6d8b('0x41')](_0x2cf45e,[_0x6d8b('0x3e'),_0x3e30bf['role']])[_0x6d8b('0x44')];return db[_0x6d8b('0x8e')][_0x6d8b('0x41')]({'where':{'name':_0x337c2c,'userProfileId':_0x39043e[_0x6d8b('0x8f')]},'raw':!![]})[_0x6d8b('0x23')](function(_0x3a2e25){if(_0x3a2e25&&_0x3a2e25['autoAssociation']===0x0){return db[_0x6d8b('0x42')][_0x6d8b('0x75')]({'name':_0x3e30bf[_0x6d8b('0x44')],'resourceId':_0x3e30bf['id'],'type':_0x3a2e25[_0x6d8b('0x44')],'sectionId':_0x3a2e25['id']},{})[_0x6d8b('0x23')](function(){return _0x3043c9;});}else{return _0x3043c9;}})['catch'](function(_0x43000e){logger['error'](_0x6d8b('0x90'),_0x43000e);throw _0x43000e;});}return _0x3043c9;})['then'](respondWithResult(_0xbfea42,0xc9))[_0x6d8b('0x2b')](handleError(_0xbfea42,null));};exports['changePassword']=function(_0x16a974,_0x3aaf32,_0x3b6b31){var _0x4c339f=![];if(_0x16a974['body']['id']){delete _0x16a974[_0x6d8b('0x69')]['id'];}if(!_[_0x6d8b('0x72')](_0x16a974[_0x6d8b('0x69')][_0x6d8b('0x91')])){if(_0x16a974['body'][_0x6d8b('0x91')]===_0x16a974[_0x6d8b('0x69')][_0x6d8b('0x92')]){throw new Error(_0x6d8b('0x93'));}}return db[_0x6d8b('0x47')][_0x6d8b('0x41')]({'where':{'id':_0x16a974[_0x6d8b('0x94')]['id']}})[_0x6d8b('0x23')](function(_0x1b766b){if(_0x1b766b){if(_0x1b766b['id']==_0x16a974[_0x6d8b('0x39')]['id']){if(!_0x16a974[_0x6d8b('0x69')][_0x6d8b('0x91')]||!_0x16a974[_0x6d8b('0x69')][_0x6d8b('0x92')]){throw new db[(_0x6d8b('0x95'))]['ValidationError'](_0x6d8b('0x96'));}if(!_0x1b766b[_0x6d8b('0x97')](_0x16a974[_0x6d8b('0x69')][_0x6d8b('0x91')])){throw new db[(_0x6d8b('0x95'))][(_0x6d8b('0x98'))]('Wrong\x20credentials');}if(_0x16a974[_0x6d8b('0x69')][_0x6d8b('0x91')]==_0x16a974[_0x6d8b('0x69')][_0x6d8b('0x92')]){throw new db['Sequelize'][(_0x6d8b('0x98'))](_0x6d8b('0x99'));}return _0x1b766b;}else if(_0x16a974[_0x6d8b('0x39')][_0x6d8b('0x40')]==_0x6d8b('0x6e')){if(!_0x16a974['body'][_0x6d8b('0x92')]){throw new db['Sequelize'][(_0x6d8b('0x98'))](_0x6d8b('0x9a'));}return _0x1b766b;}else if(_0x16a974[_0x6d8b('0x39')]['role']==_0x6d8b('0x39')){if(!_0x16a974['body']['newPassword']){throw new db[(_0x6d8b('0x95'))]['ValidationError'](_0x6d8b('0x9a'));}if(_0x1b766b[_0x6d8b('0x40')]!=_0x6d8b('0x3b')){throw new db['Sequelize']['ValidationError'](_0x6d8b('0x9b'));}return _0x1b766b;}else{throw new db[(_0x6d8b('0x95'))][(_0x6d8b('0x98'))](_0x6d8b('0x9b'));}}return null;})[_0x6d8b('0x23')](handleEntityNotFound(_0x3aaf32,null))[_0x6d8b('0x23')](function(_0x4aba07){return db[_0x6d8b('0x77')][_0x6d8b('0x9c')]({'attributes':['id',_0x6d8b('0x79')]})[_0x6d8b('0x23')](function(_0x2235a1){_0x4c339f=_0x2235a1[_0x6d8b('0x79')];return checkPasswordPattern(_0x4aba07,_0x16a974[_0x6d8b('0x69')][_0x6d8b('0x92')],_0x4c339f);});})[_0x6d8b('0x23')](saveUpdates({'password':_0x16a974['body']['newPassword'],'passwordResetAt':_0x16a974[_0x6d8b('0x39')]['id']==_0x16a974[_0x6d8b('0x94')]['id']?moment():null},null))['then'](respondWithResult(_0x3aaf32,null))[_0x6d8b('0x2b')](handleError(_0x3aaf32,null));};exports[_0x6d8b('0x9d')]=function(_0x1b2909,_0x133a6e,_0x207608){var _0x1e2647=_0x1b2909[_0x6d8b('0x69')][_0x6d8b('0x9e')];return db['User'][_0x6d8b('0x41')]({'where':{'id':_0x1b2909[_0x6d8b('0x94')]['id']},'attributes':['id',_0x6d8b('0x44'),_0x6d8b('0x40'),_0x6d8b('0x9f'),'loginInPause',_0x6d8b('0xa0'),_0x6d8b('0xa1')]})[_0x6d8b('0x23')](handleEntityNotFound(_0x133a6e,null))[_0x6d8b('0x23')](function(_0x2b4761){if(_0x2b4761){if(!utils[_0x6d8b('0xa2')](_0x1e2647)){throw new db[(_0x6d8b('0x95'))][(_0x6d8b('0x98'))](_0x6d8b('0xa3'));}return _0x2b4761[_0x6d8b('0xa4')+_[_0x6d8b('0xa5')](_0x1e2647[_0x6d8b('0xa6')]())+'Queues'](_0x1b2909[_0x6d8b('0x69')][_0x6d8b('0x6c')],{'penalty':_0x1b2909[_0x6d8b('0x69')]['penalty']||0x0})[_0x6d8b('0xa7')](function(_0x183c1d){for(var _0x578ff2=0x0;_0x578ff2<_0x1b2909[_0x6d8b('0x69')][_0x6d8b('0x6c')][_0x6d8b('0x54')];_0x578ff2+=0x1){var _0x1d1440={'UserId':_0x1b2909[_0x6d8b('0x94')]['id']};_0x1d1440[_[_0x6d8b('0xa5')](_0x1e2647['toLowerCase']())+_0x6d8b('0xa8')]=_0x1b2909['body'][_0x6d8b('0x6c')][_0x578ff2];socket[_0x6d8b('0xa9')](_0x6d8b('0x39')+_['capitalize'](_0x1e2647[_0x6d8b('0xa6')]())+_0x6d8b('0xaa'),_0x1d1440);}return _0x183c1d;})['then'](function(){if(_0x1e2647==='voice'){return db[_0x6d8b('0xab')]['findAll']({'where':{'id':_0x1b2909['body'][_0x6d8b('0x6c')]||[]},'raw':!![],'attributes':['id',_0x6d8b('0x44')]});}})['then'](function(_0x6944b7){var _0x5df0e0=_0x2b4761[_0x6d8b('0x37')]({'plain':!![]});var _0x599ce0=[];if(_0x1e2647===_0x6d8b('0xac')&&_0x5df0e0['role']===_0x6d8b('0x3b')&&_0x5df0e0[_0x6d8b('0x9f')]){for(var _0x180132=0x0;_0x180132<_0x6944b7[_0x6d8b('0x54')];_0x180132+=0x1){_0x599ce0[_0x6d8b('0xad')]({'membername':_0x5df0e0[_0x6d8b('0x44')],'UserId':_0x5df0e0['id'],'queue_name':_0x6944b7[_0x180132][_0x6d8b('0x44')],'VoiceQueueId':_0x6944b7[_0x180132]['id'],'interface':_[_0x6d8b('0x72')](_0x5df0e0['interface'])?util[_0x6d8b('0x74')](_0x6d8b('0xae'),_0x5df0e0[_0x6d8b('0x44')]):_0x5df0e0[_0x6d8b('0xa1')],'paused':_0x5df0e0['voicePause']||![],'penalty':_0x1b2909[_0x6d8b('0x69')][_0x6d8b('0xaf')]||0x0});}return BPromise[_0x6d8b('0xb0')](_0x599ce0,function(_0x23ea1f){return db['UserVoiceQueueRt'][_0x6d8b('0xb1')](_0x23ea1f);});}return _0x2b4761;});}})[_0x6d8b('0x23')](respondWithStatusCode(_0x133a6e,null))['catch'](handleError(_0x133a6e,null));};exports[_0x6d8b('0xb2')]=function(_0x3ce8e8,_0xc63ce1,_0x41ea2f){var _0x5d8ea8;return db['User'][_0x6d8b('0x41')]({'where':{'id':_0x3ce8e8['params']['id']},'attributes':['id','name',_0x6d8b('0x40')]})[_0x6d8b('0x23')](handleEntityNotFound(_0xc63ce1,null))[_0x6d8b('0x23')](function(_0x37f0b3){if(_0x37f0b3){_0x5d8ea8=_0x37f0b3;if(!_0x3ce8e8[_0x6d8b('0x4f')]['channel']||!utils[_0x6d8b('0xa2')](_0x3ce8e8[_0x6d8b('0x4f')][_0x6d8b('0x9e')])){throw new db[(_0x6d8b('0x95'))][(_0x6d8b('0x98'))](_0x6d8b('0xa3'));}return _0x37f0b3[_0x6d8b('0xb3')+_[_0x6d8b('0xa5')](_0x3ce8e8[_0x6d8b('0x4f')][_0x6d8b('0x9e')][_0x6d8b('0xa6')]())+_0x6d8b('0xb4')](_0x3ce8e8['query'][_0x6d8b('0x6c')]);}})[_0x6d8b('0x23')](function(_0x2f8322){for(var _0x22c165=0x0;_0x22c165<_0x3ce8e8[_0x6d8b('0x4f')][_0x6d8b('0x6c')]['length'];_0x22c165+=0x1){var _0x3c70a4={'UserId':_0x3ce8e8[_0x6d8b('0x94')]['id']};_0x3c70a4[_[_0x6d8b('0xa5')](_0x3ce8e8[_0x6d8b('0x4f')][_0x6d8b('0x9e')][_0x6d8b('0xa6')]())+_0x6d8b('0xa8')]=_0x3ce8e8[_0x6d8b('0x4f')][_0x6d8b('0x6c')][_0x22c165];socket['emit'](_0x6d8b('0x39')+_[_0x6d8b('0xa5')](_0x3ce8e8[_0x6d8b('0x4f')][_0x6d8b('0x9e')]['toLowerCase']())+_0x6d8b('0xb5'),_0x3c70a4);}return _0x2f8322;})[_0x6d8b('0x23')](function(){if(_0x3ce8e8[_0x6d8b('0x4f')][_0x6d8b('0x9e')]===_0x6d8b('0xac')){return db[_0x6d8b('0xb6')]['destroy']({'where':{'UserId':_0x3ce8e8[_0x6d8b('0x94')]['id'],'VoiceQueueId':_0x3ce8e8['query'][_0x6d8b('0x6c')]},'individualHooks':!![]})['then'](function(){return _0x5d8ea8;});}return _0x5d8ea8;})['then'](respondWithStatusCode(_0xc63ce1,null))['catch'](handleError(_0xc63ce1,null));};exports[_0x6d8b('0xb7')]=function(_0x1bd9aa,_0x3ab57d,_0x1d6427){_0x1bd9aa[_0x6d8b('0x69')][_0x6d8b('0xb8')]=_0x1bd9aa[_0x6d8b('0xb9')][_0x6d8b('0xba')];return db[_0x6d8b('0x47')][_0x6d8b('0x41')]({'where':{'id':_0x1bd9aa[_0x6d8b('0x94')]['id']}})[_0x6d8b('0x23')](handleEntityNotFound(_0x3ab57d,null))[_0x6d8b('0x23')](saveUpdates(_0x1bd9aa[_0x6d8b('0x69')],null))['then'](respondWithResult(_0x3ab57d,null))[_0x6d8b('0x2b')](handleError(_0x3ab57d,null));};exports[_0x6d8b('0xbb')]=function(_0x448816,_0x40249a,_0x1f3894){var _0xe1c3b4=path[_0x6d8b('0xbc')](config[_0x6d8b('0xbd')],_0x6d8b('0xbe'));return db[_0x6d8b('0x47')][_0x6d8b('0x41')]({'where':{'id':_0x448816[_0x6d8b('0x94')]['id']},'attributes':['id',_0x6d8b('0xb8')],'raw':!![]})[_0x6d8b('0x23')](handleEntityNotFound(_0x40249a,null))[_0x6d8b('0x23')](function(_0x59dc77){if(_0x59dc77){if(_['isNil'](_0x59dc77[_0x6d8b('0xb8')])){return _0x40249a[_0x6d8b('0xbf')](_0xe1c3b4);}else{if(!fs[_0x6d8b('0xc0')](path[_0x6d8b('0xbc')](config[_0x6d8b('0xbd')],_0x6d8b('0xc1'),_0x59dc77[_0x6d8b('0xb8')]))){return _0x40249a[_0x6d8b('0xbf')](_0xe1c3b4);}return _0x40249a['download'](path['join'](config[_0x6d8b('0xbd')],_0x6d8b('0xc1'),_0x59dc77['userpic']));}}})['catch'](handleError(_0x40249a,null));};exports['getContacts']=function(_0x4496d2,_0x19d5e2,_0x4d41af){var _0x4a904d={};var _0x2be8dd={};var _0xc1aae3;var _0x48b619;return db[_0x6d8b('0x47')][_0x6d8b('0x9c')]({'where':{'id':_0x4496d2[_0x6d8b('0x94')]['id']}})[_0x6d8b('0x23')](handleEntityNotFound(_0x19d5e2,null))[_0x6d8b('0x23')](function(_0x474af8){if(_0x474af8){_0xc1aae3=_0x474af8;_0x2be8dd[_0x6d8b('0x4a')]=_['keys'](db[_0x6d8b('0xc2')]['rawAttributes']);_0x2be8dd[_0x6d8b('0x4f')]=_[_0x6d8b('0x50')](_0x4496d2[_0x6d8b('0x4f')]);_0x2be8dd['filters']=_[_0x6d8b('0x52')](_0x2be8dd[_0x6d8b('0x4a')],_0x2be8dd['query']);_0x4a904d[_0x6d8b('0x53')]=_[_0x6d8b('0x52')](_0x2be8dd[_0x6d8b('0x4a')],qs[_0x6d8b('0x65')](_0x4496d2[_0x6d8b('0x4f')][_0x6d8b('0x65')]));_0x4a904d[_0x6d8b('0x53')]=_0x4a904d[_0x6d8b('0x53')][_0x6d8b('0x54')]?_0x4a904d['attributes']:_0x2be8dd[_0x6d8b('0x4a')];_0x4a904d[_0x6d8b('0x57')]=qs[_0x6d8b('0xc3')](_0x4496d2[_0x6d8b('0x4f')][_0x6d8b('0xc3')]);_0x4a904d[_0x6d8b('0x58')]=qs[_0x6d8b('0x51')](_['pick'](_0x4496d2[_0x6d8b('0x4f')],_0x2be8dd[_0x6d8b('0x51')]));if(_0x4496d2['query']['filter']){_0x4a904d[_0x6d8b('0x58')]=_[_0x6d8b('0x5f')](_0x4a904d[_0x6d8b('0x58')],{'$or':_[_0x6d8b('0x4c')](_0x4a904d[_0x6d8b('0x53')],function(_0x220234){var _0x3024fd={};_0x3024fd[_0x220234]={'$like':'%'+_0x4496d2[_0x6d8b('0x4f')]['filter']+'%'};return _0x3024fd;})});}_0x4a904d=_[_0x6d8b('0x5f')]({},_0x4a904d,_0x4496d2[_0x6d8b('0x67')]);return _0xc1aae3[_0x6d8b('0xc4')](_0x4a904d);}})[_0x6d8b('0x23')](function(_0x3674cc){if(_0x3674cc){_0x48b619=_0x3674cc['length'];if(_0x4496d2[_0x6d8b('0x4f')]['hasOwnProperty']('includeAll')){_0x4a904d['include']=[{'model':db[_0x6d8b('0xc5')],'as':_0x6d8b('0xc6'),'required':![]},{'model':db[_0x6d8b('0xc7')],'as':_0x6d8b('0xc8'),'attributes':['id',_0x6d8b('0x44'),'color'],'where':_0x4496d2[_0x6d8b('0x4f')][_0x6d8b('0xc9')]?{'id':_0x4496d2['query'][_0x6d8b('0xc9')]}:undefined,'required':_0x4496d2['query'][_0x6d8b('0xc9')]?!![]:![]}];}if(!_0x4496d2['query'][_0x6d8b('0x55')](_0x6d8b('0x56'))){_0x4a904d[_0x6d8b('0x31')]=qs[_0x6d8b('0x31')](_0x4496d2[_0x6d8b('0x4f')]['limit']);_0x4a904d[_0x6d8b('0x30')]=qs[_0x6d8b('0x30')](_0x4496d2['query']['offset']);}return _0xc1aae3[_0x6d8b('0xc4')](_0x4a904d);}})['then'](function(_0xc2cc3c){if(_0xc2cc3c){return _0xc2cc3c?{'count':_0x48b619,'rows':_0xc2cc3c}:null;}})[_0x6d8b('0x23')](respondWithResult(_0x19d5e2,null))['catch'](handleError(_0x19d5e2,null));};exports[_0x6d8b('0xca')]=function(_0x31796b,_0xbf492f,_0x29ef2d){var _0x3cc900;var _0x5c50fa;var _0xe3372={};var _0x4a1ae9;return db[_0x6d8b('0x47')]['findOne']({'where':{'id':_0x31796b[_0x6d8b('0x94')]['id']},'attributes':['id',_0x6d8b('0x44'),_0x6d8b('0x40')]})['then'](handleEntityNotFound(_0xbf492f,null))[_0x6d8b('0x23')](function(_0x47b4c4){if(!utils[_0x6d8b('0xa2')](_0x31796b[_0x6d8b('0x4f')][_0x6d8b('0x9e')])){throw new db[(_0x6d8b('0x95'))][(_0x6d8b('0x98'))](_0x6d8b('0xa3'));}_0x3cc900=_0x47b4c4;var _0xfb94a7={};_0xfb94a7[_0x6d8b('0x4a')]=_[_0x6d8b('0x50')](db[_[_0x6d8b('0xa5')](_0x31796b['query'][_0x6d8b('0x9e')])+_0x6d8b('0xcb')][_0x6d8b('0x64')]);_0xfb94a7['query']=_[_0x6d8b('0x50')](_0x31796b[_0x6d8b('0x4f')]);_0xfb94a7[_0x6d8b('0x51')]=_[_0x6d8b('0x52')](_0xfb94a7[_0x6d8b('0x4a')],_0xfb94a7[_0x6d8b('0x4f')]);_0xe3372[_0x6d8b('0x53')]=_['intersection'](_0xfb94a7['model'],qs[_0x6d8b('0x65')](_0x31796b[_0x6d8b('0x4f')]['fields']));_0xe3372[_0x6d8b('0x53')]=_0xe3372[_0x6d8b('0x53')][_0x6d8b('0x54')]?_0xe3372[_0x6d8b('0x53')]:_0xfb94a7[_0x6d8b('0x4a')];_0xe3372['order']=qs[_0x6d8b('0xc3')](_0x31796b['query'][_0x6d8b('0xc3')]);_0xe3372['where']=qs[_0x6d8b('0x51')](_[_0x6d8b('0x59')](_0x31796b[_0x6d8b('0x4f')],_0xfb94a7['filters']));if(_0x31796b[_0x6d8b('0x4f')][_0x6d8b('0x5a')]){_0xe3372['where']=_[_0x6d8b('0x5f')](_0xe3372[_0x6d8b('0x58')],{'$or':_['map'](_0xe3372[_0x6d8b('0x53')],function(_0x5c53b9){var _0x3fc98f={};_0x3fc98f[_0x5c53b9]={'$like':'%'+_0x31796b[_0x6d8b('0x4f')][_0x6d8b('0x5a')]+'%'};return _0x3fc98f;})});}_0xe3372=_[_0x6d8b('0x5f')]({},_0xe3372,_0x31796b[_0x6d8b('0x67')]);switch(_0x3cc900[_0x6d8b('0x40')]){case _0x6d8b('0x6e'):return db[_[_0x6d8b('0xa5')](_0x31796b[_0x6d8b('0x4f')]['channel'])+_0x6d8b('0xcb')][_0x6d8b('0x61')](_0xe3372);case _0x6d8b('0x39'):case'agent':return _0x3cc900[_0x6d8b('0x37')+_[_0x6d8b('0xa5')](_0x31796b[_0x6d8b('0x4f')]['channel'])+'Queues'](_0xe3372);default:throw new db[(_0x6d8b('0x95'))][(_0x6d8b('0x98'))]('Unknown\x20role');}})[_0x6d8b('0x23')](function(_0x271601){_0x4a1ae9=_0x271601[_0x6d8b('0x54')];if(!_0x31796b[_0x6d8b('0x4f')][_0x6d8b('0x55')]('nolimit')){_0xe3372['limit']=qs[_0x6d8b('0x31')](_0x31796b[_0x6d8b('0x4f')][_0x6d8b('0x31')]);_0xe3372['offset']=qs[_0x6d8b('0x30')](_0x31796b[_0x6d8b('0x4f')][_0x6d8b('0x30')]);}switch(_0x3cc900['role']){case _0x6d8b('0x6e'):return db[_[_0x6d8b('0xa5')](_0x31796b['query'][_0x6d8b('0x9e')])+'Queue'][_0x6d8b('0x61')](_0xe3372);case _0x6d8b('0x39'):case _0x6d8b('0x3b'):return _0x3cc900[_0x6d8b('0x37')+_['capitalize'](_0x31796b[_0x6d8b('0x4f')][_0x6d8b('0x9e')])+_0x6d8b('0xb4')](_0xe3372);}})[_0x6d8b('0x23')](function(_0x3f6063){return{'count':_0x4a1ae9,'rows':_0x3f6063};})[_0x6d8b('0x23')](respondWithResult(_0xbf492f,null))[_0x6d8b('0x2b')](handleError(_0xbf492f,null));};exports[_0x6d8b('0xcc')]=function(_0x54a72b,_0xad8838,_0x4a8d47){var _0x4f5a58={};var _0x458978={};var _0x2b71df;var _0x5ea3bc;return db[_0x6d8b('0x47')][_0x6d8b('0x9c')]({'where':{'id':_0x54a72b[_0x6d8b('0x94')]['id']}})[_0x6d8b('0x23')](handleEntityNotFound(_0xad8838,null))[_0x6d8b('0x23')](function(_0x4dc533){if(_0x4dc533){_0x2b71df=_0x4dc533;_0x458978[_0x6d8b('0x4a')]=_[_0x6d8b('0x50')](db[_0x6d8b('0xb6')]['rawAttributes']);_0x458978[_0x6d8b('0x4f')]=_[_0x6d8b('0x50')](_0x54a72b[_0x6d8b('0x4f')]);_0x458978[_0x6d8b('0x51')]=_[_0x6d8b('0x52')](_0x458978[_0x6d8b('0x4a')],_0x458978[_0x6d8b('0x4f')]);_0x4f5a58[_0x6d8b('0x53')]=_['intersection'](_0x458978['model'],qs[_0x6d8b('0x65')](_0x54a72b[_0x6d8b('0x4f')][_0x6d8b('0x65')]));_0x4f5a58[_0x6d8b('0x53')]=_0x4f5a58['attributes'][_0x6d8b('0x54')]?_0x4f5a58[_0x6d8b('0x53')]:_0x458978['model'];_0x4f5a58[_0x6d8b('0x57')]=qs[_0x6d8b('0xc3')](_0x54a72b[_0x6d8b('0x4f')][_0x6d8b('0xc3')]);_0x4f5a58[_0x6d8b('0x58')]=qs[_0x6d8b('0x51')](_['pick'](_0x54a72b[_0x6d8b('0x4f')],_0x458978['filters']));if(_0x54a72b[_0x6d8b('0x4f')][_0x6d8b('0x5a')]){_0x4f5a58[_0x6d8b('0x58')]=_[_0x6d8b('0x5f')](_0x4f5a58[_0x6d8b('0x58')],{'$or':_[_0x6d8b('0x4c')](_0x4f5a58['attributes'],function(_0x3ea34a){var _0x1be7a1={};_0x1be7a1[_0x3ea34a]={'$like':'%'+_0x54a72b[_0x6d8b('0x4f')][_0x6d8b('0x5a')]+'%'};return _0x1be7a1;})});}_0x4f5a58=_['merge']({},_0x4f5a58,_0x54a72b[_0x6d8b('0x67')]);return _0x2b71df[_0x6d8b('0xcc')](_0x4f5a58);}})[_0x6d8b('0x23')](function(_0x54ed2d){if(_0x54ed2d){_0x5ea3bc=_0x54ed2d[_0x6d8b('0x54')];if(!_0x54a72b[_0x6d8b('0x4f')][_0x6d8b('0x55')](_0x6d8b('0x56'))){_0x4f5a58[_0x6d8b('0x31')]=qs['limit'](_0x54a72b[_0x6d8b('0x4f')]['limit']);_0x4f5a58[_0x6d8b('0x30')]=qs[_0x6d8b('0x30')](_0x54a72b[_0x6d8b('0x4f')][_0x6d8b('0x30')]);}return _0x2b71df['getVoiceQueuesRt'](_0x4f5a58);}})[_0x6d8b('0x23')](function(_0x4ce90a){if(_0x4ce90a){return _0x4ce90a?{'count':_0x5ea3bc,'rows':_0x4ce90a}:null;}})['then'](respondWithResult(_0xad8838,null))[_0x6d8b('0x2b')](handleError(_0xad8838,null));};exports[_0x6d8b('0xcd')]=function(_0x4e379f,_0x238c69,_0x4be5ad){var _0x11414d={};var _0x439e0f={};var _0x269ec3;var _0x14dab2;return db[_0x6d8b('0x47')][_0x6d8b('0x9c')]({'where':{'id':_0x4e379f['params']['id']}})[_0x6d8b('0x23')](handleEntityNotFound(_0x238c69,null))[_0x6d8b('0x23')](function(_0x11585b){if(_0x11585b){_0x269ec3=_0x11585b;_0x439e0f[_0x6d8b('0x4a')]=_[_0x6d8b('0x50')](db[_0x6d8b('0xce')][_0x6d8b('0x64')]);_0x439e0f[_0x6d8b('0x4f')]=_[_0x6d8b('0x50')](_0x4e379f[_0x6d8b('0x4f')]);_0x439e0f[_0x6d8b('0x51')]=_['intersection'](_0x439e0f[_0x6d8b('0x4a')],_0x439e0f['query']);_0x11414d[_0x6d8b('0x53')]=_[_0x6d8b('0x52')](_0x439e0f[_0x6d8b('0x4a')],qs[_0x6d8b('0x65')](_0x4e379f[_0x6d8b('0x4f')]['fields']));_0x11414d[_0x6d8b('0x53')]=_0x11414d[_0x6d8b('0x53')]['length']?_0x11414d[_0x6d8b('0x53')]:_0x439e0f[_0x6d8b('0x4a')];_0x11414d[_0x6d8b('0x57')]=qs['sort'](_0x4e379f[_0x6d8b('0x4f')][_0x6d8b('0xc3')]);_0x11414d['where']=qs[_0x6d8b('0x51')](_[_0x6d8b('0x59')](_0x4e379f[_0x6d8b('0x4f')],_0x439e0f['filters']));if(_0x4e379f['query'][_0x6d8b('0x5a')]){_0x11414d[_0x6d8b('0x58')]=_['merge'](_0x11414d[_0x6d8b('0x58')],{'$or':_[_0x6d8b('0x4c')](_0x11414d['attributes'],function(_0x5450bf){var _0x543667={};_0x543667[_0x5450bf]={'$like':'%'+_0x4e379f[_0x6d8b('0x4f')]['filter']+'%'};return _0x543667;})});}_0x11414d=_[_0x6d8b('0x5f')]({},_0x11414d,_0x4e379f[_0x6d8b('0x67')]);return _0x269ec3['getGroups'](_0x11414d);}})[_0x6d8b('0x23')](function(_0x16da20){if(_0x16da20){_0x14dab2=_0x16da20['length'];if(!_0x4e379f['query'][_0x6d8b('0x55')](_0x6d8b('0x56'))){_0x11414d[_0x6d8b('0x31')]=qs[_0x6d8b('0x31')](_0x4e379f['query'][_0x6d8b('0x31')]);_0x11414d[_0x6d8b('0x30')]=qs[_0x6d8b('0x30')](_0x4e379f[_0x6d8b('0x4f')][_0x6d8b('0x30')]);}return _0x269ec3[_0x6d8b('0xcd')](_0x11414d);}})['then'](function(_0x550e39){if(_0x550e39){return _0x550e39?{'count':_0x14dab2,'rows':_0x550e39}:null;}})[_0x6d8b('0x23')](respondWithResult(_0x238c69,null))['catch'](handleError(_0x238c69,null));};exports['getRecordings']=function(_0x3fd49b,_0x4e8f81,_0x2289fe){var _0x3be25d={'raw':!![],'where':{}};var _0x5c524d={};var _0x478916={'count':0x0,'rows':[]};return db['User']['findOne']({'where':{'id':_0x3fd49b[_0x6d8b('0x94')]['id']}})[_0x6d8b('0x23')](handleEntityNotFound(_0x4e8f81,null))[_0x6d8b('0x23')](function(_0x219255){if(_0x219255){_0x5c524d[_0x6d8b('0x4a')]=_[_0x6d8b('0x50')](db['VoiceRecording'][_0x6d8b('0x64')]);_0x5c524d[_0x6d8b('0x4f')]=_['keys'](_0x3fd49b['query']);_0x5c524d[_0x6d8b('0x51')]=_[_0x6d8b('0x52')](_0x5c524d['model'],_0x5c524d[_0x6d8b('0x4f')]);_0x3be25d[_0x6d8b('0x53')]=_[_0x6d8b('0x52')](_0x5c524d[_0x6d8b('0x4a')],qs[_0x6d8b('0x65')](_0x3fd49b[_0x6d8b('0x4f')]['fields']));_0x3be25d[_0x6d8b('0x53')]=_0x3be25d[_0x6d8b('0x53')][_0x6d8b('0x54')]?_0x3be25d[_0x6d8b('0x53')]:_0x5c524d[_0x6d8b('0x4a')];if(!_0x3fd49b[_0x6d8b('0x4f')][_0x6d8b('0x55')](_0x6d8b('0x56'))){_0x3be25d[_0x6d8b('0x31')]=qs['limit'](_0x3fd49b[_0x6d8b('0x4f')][_0x6d8b('0x31')]);_0x3be25d['offset']=qs[_0x6d8b('0x30')](_0x3fd49b['query'][_0x6d8b('0x30')]);}_0x3be25d[_0x6d8b('0x57')]=qs[_0x6d8b('0xc3')](_0x3fd49b['query'][_0x6d8b('0xc3')]);_0x3be25d[_0x6d8b('0x58')]=qs[_0x6d8b('0x51')](_[_0x6d8b('0x59')](_0x3fd49b[_0x6d8b('0x4f')],_0x5c524d[_0x6d8b('0x51')]));_0x3be25d[_0x6d8b('0x58')]['UserId']=_0x219255['id'];if(_0x3fd49b[_0x6d8b('0x4f')]['filter']){_0x3be25d[_0x6d8b('0x58')]=_[_0x6d8b('0x5f')](_0x3be25d['where'],{'$or':_[_0x6d8b('0x4c')](_0x3be25d[_0x6d8b('0x53')],function(_0x350dfb){var _0x4cfc57={};_0x4cfc57[_0x350dfb]={'$like':'%'+_0x3fd49b[_0x6d8b('0x4f')][_0x6d8b('0x5a')]+'%'};return _0x4cfc57;})});}_0x3be25d=_['merge']({},_0x3be25d,_0x3fd49b[_0x6d8b('0x67')]);return db[_0x6d8b('0xcf')][_0x6d8b('0x2f')]({'where':_0x3be25d['where']})[_0x6d8b('0x23')](function(_0xbce703){_0x478916[_0x6d8b('0x2f')]=_0xbce703;if(_0x3fd49b['query'][_0x6d8b('0x66')]){_0x3be25d['include']=[{'all':!![]}];}return db[_0x6d8b('0xcf')]['findAll'](_0x3be25d);})[_0x6d8b('0x23')](function(_0x4fc581){_0x478916['rows']=_0x4fc581;return _0x478916;});}})['then'](respondWithFilteredResult(_0x4e8f81,_0x3be25d))[_0x6d8b('0x2b')](handleError(_0x4e8f81,null));};exports[_0x6d8b('0xd0')]=function(_0x276006,_0x4dad5e,_0x3e8690){var _0x58ad79={'raw':!![],'where':{}};var _0x35013d={};var _0x112fa9={'count':0x0,'rows':[]};return db[_0x6d8b('0x47')]['findOne']({'where':{'id':_0x276006['params']['id']}})[_0x6d8b('0x23')](handleEntityNotFound(_0x4dad5e,null))[_0x6d8b('0x23')](function(_0x58b1e2){if(_0x58b1e2){_0x35013d[_0x6d8b('0x4a')]=_[_0x6d8b('0x50')](db[_0x6d8b('0xd1')][_0x6d8b('0x64')]);_0x35013d[_0x6d8b('0x4f')]=_['keys'](_0x276006[_0x6d8b('0x4f')]);_0x35013d[_0x6d8b('0x51')]=_[_0x6d8b('0x52')](_0x35013d[_0x6d8b('0x4a')],_0x35013d[_0x6d8b('0x4f')]);_0x58ad79[_0x6d8b('0x53')]=_[_0x6d8b('0x52')](_0x35013d['model'],qs['fields'](_0x276006[_0x6d8b('0x4f')][_0x6d8b('0x65')]));_0x58ad79[_0x6d8b('0x53')]=_0x58ad79[_0x6d8b('0x53')]['length']?_0x58ad79[_0x6d8b('0x53')]:_0x35013d[_0x6d8b('0x4a')];if(!_0x276006[_0x6d8b('0x4f')][_0x6d8b('0x55')]('nolimit')){_0x58ad79[_0x6d8b('0x31')]=qs['limit'](_0x276006['query'][_0x6d8b('0x31')]);_0x58ad79[_0x6d8b('0x30')]=qs['offset'](_0x276006[_0x6d8b('0x4f')][_0x6d8b('0x30')]);}_0x58ad79['order']=qs[_0x6d8b('0xc3')](_0x276006['query'][_0x6d8b('0xc3')]);_0x58ad79[_0x6d8b('0x58')]=qs[_0x6d8b('0x51')](_[_0x6d8b('0x59')](_0x276006[_0x6d8b('0x4f')],_0x35013d[_0x6d8b('0x51')]));_0x58ad79[_0x6d8b('0x58')][_0x6d8b('0xd2')]=_0x58b1e2['id'];if(_0x276006['query'][_0x6d8b('0x5a')]){_0x58ad79[_0x6d8b('0x58')]=_[_0x6d8b('0x5f')](_0x58ad79[_0x6d8b('0x58')],{'$or':_[_0x6d8b('0x4c')](_0x58ad79[_0x6d8b('0x53')],function(_0x1ceb9f){var _0xcf027c={};_0xcf027c[_0x1ceb9f]={'$like':'%'+_0x276006['query'][_0x6d8b('0x5a')]+'%'};return _0xcf027c;})});}_0x58ad79=_[_0x6d8b('0x5f')]({},_0x58ad79,_0x276006[_0x6d8b('0x67')]);return db[_0x6d8b('0xd1')]['count']({'where':_0x58ad79[_0x6d8b('0x58')]})[_0x6d8b('0x23')](function(_0x1dc38d){_0x112fa9[_0x6d8b('0x2f')]=_0x1dc38d;if(_0x276006[_0x6d8b('0x4f')][_0x6d8b('0x66')]){_0x58ad79[_0x6d8b('0x60')]=[{'all':!![]}];}return db[_0x6d8b('0xd1')]['findAll'](_0x58ad79);})[_0x6d8b('0x23')](function(_0x42c11a){_0x112fa9['rows']=_0x42c11a;return _0x112fa9;});}})[_0x6d8b('0x23')](respondWithFilteredResult(_0x4dad5e,_0x58ad79))[_0x6d8b('0x2b')](handleError(_0x4dad5e,null));};exports['getChatInteractions']=function(_0x5e86f8,_0x1a1f88,_0x3151f6){var _0x4dc242={};var _0x18cb0a={};var _0x202af5;var _0x36d0c9;return db[_0x6d8b('0x47')][_0x6d8b('0x9c')]({'where':{'id':_0x5e86f8[_0x6d8b('0x94')]['id']}})['then'](handleEntityNotFound(_0x1a1f88,null))[_0x6d8b('0x23')](function(_0x13421a){if(_0x13421a){_0x202af5=_0x13421a;_0x18cb0a[_0x6d8b('0x4a')]=_['keys'](db['ChatInteraction']['rawAttributes']);_0x18cb0a[_0x6d8b('0x4f')]=_[_0x6d8b('0x50')](_0x5e86f8[_0x6d8b('0x4f')]);_0x18cb0a[_0x6d8b('0x51')]=_['intersection'](_0x18cb0a[_0x6d8b('0x4a')],_0x18cb0a[_0x6d8b('0x4f')]);_0x4dc242[_0x6d8b('0x53')]=_[_0x6d8b('0x52')](_0x18cb0a[_0x6d8b('0x4a')],qs[_0x6d8b('0x65')](_0x5e86f8['query'][_0x6d8b('0x65')]));_0x4dc242[_0x6d8b('0x53')]=_0x4dc242[_0x6d8b('0x53')][_0x6d8b('0x54')]?_0x4dc242[_0x6d8b('0x53')]:_0x18cb0a[_0x6d8b('0x4a')];_0x4dc242['order']=qs[_0x6d8b('0xc3')](_0x5e86f8[_0x6d8b('0x4f')][_0x6d8b('0xc3')]);_0x4dc242[_0x6d8b('0x58')]=qs[_0x6d8b('0x51')](_[_0x6d8b('0x59')](_0x5e86f8[_0x6d8b('0x4f')],_0x18cb0a[_0x6d8b('0x51')]));if(_0x5e86f8[_0x6d8b('0x4f')][_0x6d8b('0x5a')]){_0x4dc242[_0x6d8b('0x58')]=_['merge'](_0x4dc242[_0x6d8b('0x58')],{'$or':_['map'](_0x4dc242[_0x6d8b('0x53')],function(_0xb7edbd){var _0x343fc4={};_0x343fc4[_0xb7edbd]={'$like':'%'+_0x5e86f8['query'][_0x6d8b('0x5a')]+'%'};return _0x343fc4;})});}_0x4dc242=_['merge']({},_0x4dc242,_0x5e86f8[_0x6d8b('0x67')]);return _0x202af5[_0x6d8b('0xd3')](_0x4dc242);}})[_0x6d8b('0x23')](function(_0x227029){if(_0x227029){_0x36d0c9=_0x227029['length'];if(!_0x5e86f8['query']['hasOwnProperty'](_0x6d8b('0x56'))){_0x4dc242['limit']=qs['limit'](_0x5e86f8[_0x6d8b('0x4f')][_0x6d8b('0x31')]);_0x4dc242[_0x6d8b('0x30')]=qs['offset'](_0x5e86f8['query'][_0x6d8b('0x30')]);}return _0x202af5[_0x6d8b('0xd3')](_0x4dc242);}})[_0x6d8b('0x23')](function(_0x2fa62f){if(_0x2fa62f){return _0x2fa62f?{'count':_0x36d0c9,'rows':_0x2fa62f}:null;}})['then'](respondWithResult(_0x1a1f88,null))[_0x6d8b('0x2b')](handleError(_0x1a1f88,null));};exports[_0x6d8b('0xd4')]=function(_0x467a04,_0x183823,_0x3270ec){var _0x55edd7={};var _0x83cb94={};var _0xed0111;var _0x3322e7;return db['User'][_0x6d8b('0x9c')]({'where':{'id':_0x467a04['params']['id']}})[_0x6d8b('0x23')](handleEntityNotFound(_0x183823,null))[_0x6d8b('0x23')](function(_0x4a72aa){if(_0x4a72aa){_0xed0111=_0x4a72aa;_0x83cb94[_0x6d8b('0x4a')]=_[_0x6d8b('0x50')](db[_0x6d8b('0xd5')][_0x6d8b('0x64')]);_0x83cb94[_0x6d8b('0x4f')]=_['keys'](_0x467a04[_0x6d8b('0x4f')]);_0x83cb94['filters']=_['intersection'](_0x83cb94[_0x6d8b('0x4a')],_0x83cb94[_0x6d8b('0x4f')]);_0x55edd7[_0x6d8b('0x53')]=_['intersection'](_0x83cb94[_0x6d8b('0x4a')],qs['fields'](_0x467a04[_0x6d8b('0x4f')]['fields']));_0x55edd7[_0x6d8b('0x53')]=_0x55edd7[_0x6d8b('0x53')][_0x6d8b('0x54')]?_0x55edd7[_0x6d8b('0x53')]:_0x83cb94[_0x6d8b('0x4a')];_0x55edd7[_0x6d8b('0x57')]=qs['sort'](_0x467a04['query'][_0x6d8b('0xc3')]);_0x55edd7[_0x6d8b('0x58')]=qs[_0x6d8b('0x51')](_[_0x6d8b('0x59')](_0x467a04[_0x6d8b('0x4f')],_0x83cb94['filters']));if(_0x467a04['query']['filter']){_0x55edd7[_0x6d8b('0x58')]=_[_0x6d8b('0x5f')](_0x55edd7[_0x6d8b('0x58')],{'$or':_[_0x6d8b('0x4c')](_0x55edd7[_0x6d8b('0x53')],function(_0x2b6031){var _0x441446={};_0x441446[_0x2b6031]={'$like':'%'+_0x467a04['query'][_0x6d8b('0x5a')]+'%'};return _0x441446;})});}_0x55edd7=_[_0x6d8b('0x5f')]({},_0x55edd7,_0x467a04['options']);return _0xed0111[_0x6d8b('0xd4')](_0x55edd7);}})['then'](function(_0x3c458e){if(_0x3c458e){_0x3322e7=_0x3c458e[_0x6d8b('0x54')];if(!_0x467a04[_0x6d8b('0x4f')][_0x6d8b('0x55')](_0x6d8b('0x56'))){_0x55edd7[_0x6d8b('0x31')]=qs['limit'](_0x467a04['query'][_0x6d8b('0x31')]);_0x55edd7['offset']=qs[_0x6d8b('0x30')](_0x467a04[_0x6d8b('0x4f')][_0x6d8b('0x30')]);}return _0xed0111[_0x6d8b('0xd4')](_0x55edd7);}})[_0x6d8b('0x23')](function(_0x1a5c1d){if(_0x1a5c1d){return _0x1a5c1d?{'count':_0x3322e7,'rows':_0x1a5c1d}:null;}})[_0x6d8b('0x23')](respondWithResult(_0x183823,null))[_0x6d8b('0x2b')](handleError(_0x183823,null));};exports[_0x6d8b('0xd6')]=function(_0x59cd7b,_0x41331e,_0x37caf8){var _0x31f6dc={'raw':!![],'where':{}};var _0x4b8d3b={};var _0xaa937d={'count':0x0,'rows':[]};return db[_0x6d8b('0x47')][_0x6d8b('0x9c')]({'where':{'id':_0x59cd7b[_0x6d8b('0x94')]['id']}})[_0x6d8b('0x23')](handleEntityNotFound(_0x41331e,null))[_0x6d8b('0x23')](function(_0x4b9cb3){if(_0x4b9cb3){_0x4b8d3b[_0x6d8b('0x4a')]=_[_0x6d8b('0x50')](db[_0x6d8b('0xd7')][_0x6d8b('0x64')]);_0x4b8d3b['query']=_['keys'](_0x59cd7b[_0x6d8b('0x4f')]);_0x4b8d3b['filters']=_[_0x6d8b('0x52')](_0x4b8d3b[_0x6d8b('0x4a')],_0x4b8d3b['query']);_0x31f6dc[_0x6d8b('0x53')]=_[_0x6d8b('0x52')](_0x4b8d3b[_0x6d8b('0x4a')],qs[_0x6d8b('0x65')](_0x59cd7b[_0x6d8b('0x4f')][_0x6d8b('0x65')]));_0x31f6dc[_0x6d8b('0x53')]=_0x31f6dc['attributes'][_0x6d8b('0x54')]?_0x31f6dc['attributes']:_0x4b8d3b['model'];if(!_0x59cd7b['query'][_0x6d8b('0x55')](_0x6d8b('0x56'))){_0x31f6dc['limit']=qs[_0x6d8b('0x31')](_0x59cd7b[_0x6d8b('0x4f')]['limit']);_0x31f6dc[_0x6d8b('0x30')]=qs['offset'](_0x59cd7b['query'][_0x6d8b('0x30')]);}_0x31f6dc[_0x6d8b('0x57')]=qs[_0x6d8b('0xc3')](_0x59cd7b[_0x6d8b('0x4f')][_0x6d8b('0xc3')]);_0x31f6dc[_0x6d8b('0x58')]=qs[_0x6d8b('0x51')](_[_0x6d8b('0x59')](_0x59cd7b[_0x6d8b('0x4f')],_0x4b8d3b[_0x6d8b('0x51')]));_0x31f6dc['where'][_0x6d8b('0xd2')]=_0x4b9cb3['id'];if(_0x59cd7b['query'][_0x6d8b('0x5a')]){_0x31f6dc[_0x6d8b('0x58')]=_['merge'](_0x31f6dc[_0x6d8b('0x58')],{'$or':_[_0x6d8b('0x4c')](_0x31f6dc[_0x6d8b('0x53')],function(_0x4fd19e){var _0x65a994={};_0x65a994[_0x4fd19e]={'$like':'%'+_0x59cd7b[_0x6d8b('0x4f')][_0x6d8b('0x5a')]+'%'};return _0x65a994;})});}_0x31f6dc=_[_0x6d8b('0x5f')]({},_0x31f6dc,_0x59cd7b[_0x6d8b('0x67')]);return db[_0x6d8b('0xd7')][_0x6d8b('0x2f')]({'where':_0x31f6dc[_0x6d8b('0x58')]})['then'](function(_0x14c6b6){_0xaa937d[_0x6d8b('0x2f')]=_0x14c6b6;if(_0x59cd7b[_0x6d8b('0x4f')][_0x6d8b('0x66')]){_0x31f6dc[_0x6d8b('0x60')]=[{'all':!![]}];}return db[_0x6d8b('0xd7')][_0x6d8b('0x61')](_0x31f6dc);})[_0x6d8b('0x23')](function(_0x592c43){_0xaa937d[_0x6d8b('0x62')]=_0x592c43;return _0xaa937d;});}})['then'](respondWithFilteredResult(_0x41331e,_0x31f6dc))[_0x6d8b('0x2b')](handleError(_0x41331e,null));};exports[_0x6d8b('0xd8')]=function(_0x196318,_0x143001,_0x226ab8){var _0x55c548={};var _0xe770d2={};var _0x4307a5;var _0x5967ad;return db[_0x6d8b('0x47')][_0x6d8b('0x9c')]({'where':{'id':_0x196318[_0x6d8b('0x94')]['id']}})['then'](handleEntityNotFound(_0x143001,null))['then'](function(_0x90ee08){if(_0x90ee08){_0x4307a5=_0x90ee08;_0xe770d2['model']=_[_0x6d8b('0x50')](db[_0x6d8b('0xd9')][_0x6d8b('0x64')]);_0xe770d2[_0x6d8b('0x4f')]=_[_0x6d8b('0x50')](_0x196318[_0x6d8b('0x4f')]);_0xe770d2[_0x6d8b('0x51')]=_[_0x6d8b('0x52')](_0xe770d2[_0x6d8b('0x4a')],_0xe770d2[_0x6d8b('0x4f')]);_0x55c548['attributes']=_[_0x6d8b('0x52')](_0xe770d2[_0x6d8b('0x4a')],qs[_0x6d8b('0x65')](_0x196318[_0x6d8b('0x4f')][_0x6d8b('0x65')]));_0x55c548[_0x6d8b('0x53')]=_0x55c548['attributes']['length']?_0x55c548[_0x6d8b('0x53')]:_0xe770d2[_0x6d8b('0x4a')];_0x55c548[_0x6d8b('0x57')]=qs[_0x6d8b('0xc3')](_0x196318[_0x6d8b('0x4f')][_0x6d8b('0xc3')]);_0x55c548['where']=qs[_0x6d8b('0x51')](_['pick'](_0x196318[_0x6d8b('0x4f')],_0xe770d2['filters']));if(_0x196318['query'][_0x6d8b('0x5a')]){_0x55c548[_0x6d8b('0x58')]=_['merge'](_0x55c548[_0x6d8b('0x58')],{'$or':_[_0x6d8b('0x4c')](_0x55c548[_0x6d8b('0x53')],function(_0x2653fa){var _0x54ca04={};_0x54ca04[_0x2653fa]={'$like':'%'+_0x196318[_0x6d8b('0x4f')]['filter']+'%'};return _0x54ca04;})});}_0x55c548=_['merge']({},_0x55c548,_0x196318[_0x6d8b('0x67')]);return _0x4307a5[_0x6d8b('0xd8')](_0x55c548);}})[_0x6d8b('0x23')](function(_0x38aa3c){if(_0x38aa3c){_0x5967ad=_0x38aa3c[_0x6d8b('0x54')];if(!_0x196318[_0x6d8b('0x4f')][_0x6d8b('0x55')](_0x6d8b('0x56'))){_0x55c548[_0x6d8b('0x31')]=qs[_0x6d8b('0x31')](_0x196318['query']['limit']);_0x55c548[_0x6d8b('0x30')]=qs[_0x6d8b('0x30')](_0x196318[_0x6d8b('0x4f')][_0x6d8b('0x30')]);}return _0x4307a5[_0x6d8b('0xd8')](_0x55c548);}})[_0x6d8b('0x23')](function(_0x364887){if(_0x364887){return _0x364887?{'count':_0x5967ad,'rows':_0x364887}:null;}})[_0x6d8b('0x23')](respondWithResult(_0x143001,null))['catch'](handleError(_0x143001,null));};exports[_0x6d8b('0xda')]=function(_0x3e0e68,_0x30a289,_0x75652b){var _0xda6c3d={};var _0x1e4543={};var _0xb1843f;var _0x1af400;return db[_0x6d8b('0x47')]['findOne']({'where':{'id':_0x3e0e68['params']['id']}})[_0x6d8b('0x23')](handleEntityNotFound(_0x30a289,null))[_0x6d8b('0x23')](function(_0x44eb1e){if(_0x44eb1e){_0xb1843f=_0x44eb1e;_0x1e4543[_0x6d8b('0x4a')]=_[_0x6d8b('0x50')](db['FaxInteraction'][_0x6d8b('0x64')]);_0x1e4543[_0x6d8b('0x4f')]=_[_0x6d8b('0x50')](_0x3e0e68['query']);_0x1e4543['filters']=_[_0x6d8b('0x52')](_0x1e4543['model'],_0x1e4543[_0x6d8b('0x4f')]);_0xda6c3d['attributes']=_[_0x6d8b('0x52')](_0x1e4543[_0x6d8b('0x4a')],qs[_0x6d8b('0x65')](_0x3e0e68['query'][_0x6d8b('0x65')]));_0xda6c3d[_0x6d8b('0x53')]=_0xda6c3d['attributes'][_0x6d8b('0x54')]?_0xda6c3d[_0x6d8b('0x53')]:_0x1e4543['model'];_0xda6c3d[_0x6d8b('0x57')]=qs[_0x6d8b('0xc3')](_0x3e0e68['query'][_0x6d8b('0xc3')]);_0xda6c3d[_0x6d8b('0x58')]=qs[_0x6d8b('0x51')](_['pick'](_0x3e0e68['query'],_0x1e4543[_0x6d8b('0x51')]));if(_0x3e0e68['query'][_0x6d8b('0x5a')]){_0xda6c3d[_0x6d8b('0x58')]=_[_0x6d8b('0x5f')](_0xda6c3d[_0x6d8b('0x58')],{'$or':_[_0x6d8b('0x4c')](_0xda6c3d[_0x6d8b('0x53')],function(_0x485ed1){var _0x5d73f8={};_0x5d73f8[_0x485ed1]={'$like':'%'+_0x3e0e68['query'][_0x6d8b('0x5a')]+'%'};return _0x5d73f8;})});}_0xda6c3d=_['merge']({},_0xda6c3d,_0x3e0e68['options']);return _0xb1843f[_0x6d8b('0xda')](_0xda6c3d);}})[_0x6d8b('0x23')](function(_0x281352){if(_0x281352){_0x1af400=_0x281352[_0x6d8b('0x54')];if(!_0x3e0e68['query']['hasOwnProperty']('nolimit')){_0xda6c3d[_0x6d8b('0x31')]=qs[_0x6d8b('0x31')](_0x3e0e68[_0x6d8b('0x4f')]['limit']);_0xda6c3d[_0x6d8b('0x30')]=qs[_0x6d8b('0x30')](_0x3e0e68['query'][_0x6d8b('0x30')]);}return _0xb1843f[_0x6d8b('0xda')](_0xda6c3d);}})[_0x6d8b('0x23')](function(_0x4bdf22){if(_0x4bdf22){return _0x4bdf22?{'count':_0x1af400,'rows':_0x4bdf22}:null;}})['then'](respondWithResult(_0x30a289,null))[_0x6d8b('0x2b')](handleError(_0x30a289,null));};exports[_0x6d8b('0xdb')]=function(_0x4e8104,_0x3bbc04,_0x4bb0ff){var _0x5aff3f;var _0x3e2077;var _0x2b2a6b;var _0x11bfa9=!_[_0x6d8b('0x72')](_0x4e8104[_0x6d8b('0x94')]['id'])?_0x4e8104[_0x6d8b('0x94')]['id']:!_[_0x6d8b('0x72')](_0x4e8104['user']['id'])?_0x4e8104[_0x6d8b('0x39')]['id']:null;return db[_0x6d8b('0x47')][_0x6d8b('0x41')]({'where':{'id':_0x11bfa9,'role':_0x6d8b('0x3b')},'attributes':['id',_0x6d8b('0x44'),_0x6d8b('0xdc'),'mobile',_0x6d8b('0x40'),_0x6d8b('0x76'),_0x6d8b('0xdd')]})['then'](handleEntityNotFound(_0x3bbc04,null))[_0x6d8b('0x23')](function(_0x711c9d){if(_0x711c9d){_0x5aff3f=_0x711c9d;if(_0x4e8104[_0x6d8b('0x69')]['interface']){_0x2b2a6b=util[_0x6d8b('0x74')](_0x6d8b('0xde'),_0x5aff3f[_0x4e8104['body'][_0x6d8b('0xa1')]]);}else if(_0x4e8104[_0x6d8b('0x69')]['intrf']){_0x2b2a6b=util[_0x6d8b('0x74')](_0x6d8b('0xae'),_0x4e8104[_0x6d8b('0x69')]['intrf']);}else{_0x2b2a6b=util[_0x6d8b('0x74')](_0x6d8b('0xae'),_0x5aff3f[_0x6d8b('0x44')]);}socket['to'](util['format'](_0x6d8b('0xdf'),_0x5aff3f[_0x6d8b('0x44')]))[_0x6d8b('0xa9')]('user:forcelogout',{'ip':_0x4e8104[_0x6d8b('0xe0')][_0x6d8b('0xe1')]||_0x4e8104[_0x6d8b('0xe2')]['remoteAddress']||_0x4e8104[_0x6d8b('0xe3')][_0x6d8b('0xe4')]||_0x4e8104[_0x6d8b('0xe2')]['socket']['remoteAddress']});return db[_0x6d8b('0xb6')][_0x6d8b('0x36')]({'where':{'membername':_0x5aff3f[_0x6d8b('0x44')]},'individualHooks':!![]});}})[_0x6d8b('0x23')](function(_0x5afb7d){if(_0x5aff3f){return _0x5aff3f[_0x6d8b('0xe5')]({'raw':!![]});}})[_0x6d8b('0x23')](function(_0x63c7a5){var _0x27ab8b=[];if(_0x63c7a5){_0x3e2077=_0x63c7a5;if(_0x3e2077['length']){for(var _0x219359=0x0;_0x219359<_0x3e2077[_0x6d8b('0x54')];_0x219359++){_0x27ab8b[_0x6d8b('0xad')]({'membername':_0x5aff3f[_0x6d8b('0x44')],'UserId':_0x5aff3f['id'],'queue_name':_0x3e2077[_0x219359]['name'],'VoiceQueueId':_0x3e2077[_0x219359]['id'],'interface':_0x2b2a6b,'paused':_0x5aff3f['loginInPause']||![],'penalty':_0x3e2077[_0x219359][_0x6d8b('0xe6')]||0x0});}return BPromise['each'](_0x27ab8b,function(_0x4485c0){return db[_0x6d8b('0xb6')][_0x6d8b('0xb1')](_0x4485c0);});}}})[_0x6d8b('0x23')](function(){return db[_0x6d8b('0xe7')][_0x6d8b('0x61')]({'where':{'membername':_0x5aff3f[_0x6d8b('0x44')],'exitAt':null}});})['then'](function(_0x34aa48){var _0x505cab=[];_0x34aa48[_0x6d8b('0xe8')](function(_0x1dd386){_0x505cab[_0x6d8b('0xad')](_0x1dd386['update']({'exitAt':moment()[_0x6d8b('0x74')](_0x6d8b('0xe9'))}));});return BPromise[_0x6d8b('0xea')](_0x505cab);})[_0x6d8b('0x23')](function(){var _0x255b3d=[];var _0x31dfc9=[];var _0x21c8db=utils['getChannels']();var _0x66b972={'membername':_0x5aff3f[_0x6d8b('0x44')],'interface':_0x2b2a6b,'enterAt':moment()[_0x6d8b('0x74')](_0x6d8b('0xe9')),'role':_0x5aff3f['role'],'internal':_0x5aff3f[_0x6d8b('0x76')]};_0x21c8db[_0x6d8b('0xe8')](function(_0x495427){_0x255b3d[_0x6d8b('0xad')](_[_0x6d8b('0x5f')]({'channel':_0x495427,'type':_0x6d8b('0xeb'),'data1':_0x4e8104['body']['device'],'data2':_0x2b2a6b},_0x66b972));if(_0x5aff3f[_0x6d8b('0xdd')]){_0x31dfc9[_0x6d8b('0xad')](_[_0x6d8b('0x5f')]({'channel':_0x495427,'type':_0x6d8b('0xec'),'data1':_0x6d8b('0xed')},_0x66b972));}});return db[_0x6d8b('0xe7')]['bulkCreate'](_0x255b3d['concat'](_0x31dfc9),{'individualHooks':!![]});})[_0x6d8b('0x23')](function(){return _0x5aff3f[_0x6d8b('0x6a')]({'online':!![],'lastLoginAt':moment()[_0x6d8b('0x74')](_0x6d8b('0xe9')),'voicePause':_0x5aff3f[_0x6d8b('0xdd')]||![],'mailPause':_0x5aff3f[_0x6d8b('0xdd')]||![],'chatPause':_0x5aff3f[_0x6d8b('0xdd')]||![],'faxPause':_0x5aff3f['loginInPause']||![],'smsPause':_0x5aff3f[_0x6d8b('0xdd')]||![],'openchannelPause':_0x5aff3f[_0x6d8b('0xdd')]||![],'pauseType':_0x5aff3f['loginInPause']?'LOGININPAUSE':null,'interface':_0x2b2a6b,'lastPauseAt':moment()[_0x6d8b('0x74')](_0x6d8b('0xe9'))});})['then'](function(_0x2baf39){if(_0x4e8104['isMiddleware']){return _0x4bb0ff();}else{return BPromise[_0x6d8b('0xee')](_0x2baf39)[_0x6d8b('0x23')](respondWithResult(_0x3bbc04,null));}})[_0x6d8b('0x2b')](handleError(_0x3bbc04,null));};exports['logout']=function(_0x29d0a4,_0x1afeb5,_0x57f9e7){var _0x3a864e;return db[_0x6d8b('0x47')][_0x6d8b('0x41')]({'where':{'id':_0x29d0a4[_0x6d8b('0x94')]['id'],'role':_0x6d8b('0x3b')},'attributes':['id',_0x6d8b('0x44'),_0x6d8b('0x40')]})['then'](handleEntityNotFound(_0x1afeb5,null))[_0x6d8b('0x23')](function(_0x192e47){if(_0x192e47){_0x3a864e=_0x192e47;return db[_0x6d8b('0xb6')][_0x6d8b('0x36')]({'where':{'membername':_0x3a864e[_0x6d8b('0x44')]},'individualHooks':!![]});}})[_0x6d8b('0x23')](function(){return db[_0x6d8b('0xe7')][_0x6d8b('0x61')]({'where':{'membername':_0x3a864e[_0x6d8b('0x44')],'exitAt':null}});})[_0x6d8b('0x23')](function(_0x43fbf4){var _0x5a88a8=[];_0x43fbf4['forEach'](function(_0x3711ec){_0x5a88a8[_0x6d8b('0xad')](_0x3711ec['update']({'exitAt':moment()[_0x6d8b('0x74')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x6d8b('0xea')](_0x5a88a8);})[_0x6d8b('0x23')](function(){return _0x3a864e[_0x6d8b('0x6a')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'interface':null});})[_0x6d8b('0x23')](respondWithResult(_0x1afeb5,null))[_0x6d8b('0x2b')](handleError(_0x1afeb5,null));};exports[_0x6d8b('0xef')]=function(_0x534412,_0x2e8737,_0x9fc8ac){var _0xf9ff0c;return db['UserVoiceQueueRt']['update']({'paused':0x1},{'where':{'UserId':_0x534412[_0x6d8b('0x94')]['id']},'individualHooks':!![]})[_0x6d8b('0x23')](function(){return db[_0x6d8b('0x47')][_0x6d8b('0x41')]({'where':{'id':_0x534412['params']['id'],'role':_0x6d8b('0x3b')},'attributes':['id',_0x6d8b('0x44'),'role','internal',_0x6d8b('0xa1')]});})[_0x6d8b('0x23')](handleEntityNotFound(_0x2e8737,null))['then'](function(_0x189894){if(_0x189894){_0xf9ff0c=_0x189894;return respondWithRpcPromise(_0x6d8b('0xf0'),'pause',{'id':_0xf9ff0c['id'],'name':_0xf9ff0c[_0x6d8b('0x44')],'pause':!![]});}})[_0x6d8b('0x23')](function(){if(_0xf9ff0c){return db[_0x6d8b('0xe7')][_0x6d8b('0x61')]({'where':{'membername':_0xf9ff0c[_0x6d8b('0x44')],'type':_0x6d8b('0xec'),'exitAt':null}});}})[_0x6d8b('0x23')](function(_0x47492a){if(_0x47492a[_0x6d8b('0x54')]){var _0x1fa610=moment()[_0x6d8b('0x74')](_0x6d8b('0xe9'));for(var _0x15282a=0x0,_0x2d15a7=_0x47492a['length'];_0x15282a<_0x2d15a7;_0x15282a++){_0x47492a[_0x15282a]['updateAttributes']({'exitAt':_0x1fa610});}}})[_0x6d8b('0x23')](function(){var _0x5e8a1d=[];var _0x2cbbea=utils[_0x6d8b('0xf1')]();_0x2cbbea['forEach'](function(_0x569dac){_0x5e8a1d['push']({'channel':_0x569dac,'membername':_0xf9ff0c[_0x6d8b('0x44')],'interface':_[_0x6d8b('0x72')](_0xf9ff0c[_0x6d8b('0xa1')])?util[_0x6d8b('0x74')](_0x6d8b('0xae'),_0xf9ff0c[_0x6d8b('0x44')]):_0xf9ff0c['interface'],'type':_0x6d8b('0xec'),'enterAt':moment()['format'](_0x6d8b('0xe9')),'data1':_0x534412[_0x6d8b('0x69')][_0x6d8b('0x5b')]||_0x6d8b('0xf2'),'role':_0xf9ff0c['role'],'internal':_0xf9ff0c[_0x6d8b('0x76')]});});return db[_0x6d8b('0xe7')][_0x6d8b('0x68')](_0x5e8a1d,{'individualHooks':!![]});})[_0x6d8b('0x23')](function(){return _0xf9ff0c['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x534412['body']['type']||_0x6d8b('0xf2'),'lastPauseAt':moment()[_0x6d8b('0x74')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0x6d8b('0x23')](respondWithResult(_0x2e8737,null))[_0x6d8b('0x2b')](handleError(_0x2e8737,null));};exports[_0x6d8b('0xf3')]=function(_0x52488f,_0x43d9fe,_0x8d61dc){var _0x2346d1;return db[_0x6d8b('0x47')]['find']({'where':{'id':_0x52488f[_0x6d8b('0x94')]['id']},'attributes':['id',_0x6d8b('0x44'),_0x6d8b('0x40'),_0x6d8b('0xa0'),_0x6d8b('0xf4'),_0x6d8b('0xf5'),_0x6d8b('0xf6'),'openchannelPause',_0x6d8b('0xf7'),_0x6d8b('0xf8'),'lastPauseAt']})[_0x6d8b('0x23')](handleEntityNotFound(_0x43d9fe,null))[_0x6d8b('0x23')](function(_0x41eec9){if(_0x41eec9){_0x2346d1=_0x41eec9;if(_0x52488f[_0x6d8b('0x69')][_0x6d8b('0x9e')]&&!utils[_0x6d8b('0xa2')](_0x52488f[_0x6d8b('0x69')][_0x6d8b('0x9e')])){throw new db[(_0x6d8b('0x95'))][(_0x6d8b('0x98'))]('Unknown\x20channel');}switch(_0x52488f['body'][_0x6d8b('0x9e')]){case'voice':return respondWithRpcPromise('QueuePause',_0x6d8b('0xf3'),{'id':_0x2346d1['id'],'name':_0x2346d1[_0x6d8b('0x44')],'pause':![]})[_0x6d8b('0x23')](function(){return db[_0x6d8b('0xb6')][_0x6d8b('0x6a')]({'paused':0x0},{'where':{'UserId':_0x2346d1['id']},'individualHooks':!![]});})[_0x6d8b('0x23')](function(){return db[_0x6d8b('0xe7')][_0x6d8b('0x41')]({'where':{'channel':_0x52488f[_0x6d8b('0x69')][_0x6d8b('0x9e')],'membername':_0x2346d1['name'],'type':'PAUSE','exitAt':null}});})[_0x6d8b('0x23')](function(_0x3d346b){if(_0x3d346b){return _0x3d346b[_0x6d8b('0x6a')]({'exitAt':moment()[_0x6d8b('0x74')](_0x6d8b('0xe9')),'data2':_0x6d8b('0xf9')},{'individualHooks':!![]});}return null;})['then'](function(){return _0x2346d1[_0x6d8b('0x6a')]({'voicePause':![]});});case _0x6d8b('0xfa'):case'chat':case _0x6d8b('0xfb'):case'sms':case _0x6d8b('0xfc'):return db['MemberReport'][_0x6d8b('0x41')]({'where':{'channel':_0x52488f[_0x6d8b('0x69')][_0x6d8b('0x9e')],'membername':_0x2346d1[_0x6d8b('0x44')],'type':_0x6d8b('0xec'),'exitAt':null}})['then'](function(_0x21bb79){if(_0x21bb79){return _0x21bb79[_0x6d8b('0x6a')]({'exitAt':moment()['format'](_0x6d8b('0xe9')),'data2':_0x6d8b('0xf9')},{'individualHooks':!![]});}return null;})[_0x6d8b('0x23')](function(){var _0x18f729={};_['set'](_0x18f729,util[_0x6d8b('0x74')](_0x6d8b('0xfd'),_0x52488f[_0x6d8b('0x69')][_0x6d8b('0x9e')],_0x6d8b('0xfe')),![]);return _0x2346d1[_0x6d8b('0x6a')](_0x18f729);});default:return respondWithRpcPromise(_0x6d8b('0xf0'),'unpause',{'id':_0x2346d1['id'],'name':_0x2346d1['name'],'pause':![]})['then'](function(){return db['UserVoiceQueueRt']['update']({'paused':0x0},{'where':{'UserId':_0x2346d1['id']}});})[_0x6d8b('0x23')](function(){return db[_0x6d8b('0xe7')][_0x6d8b('0x61')]({'where':{'membername':_0x2346d1[_0x6d8b('0x44')],'type':_0x6d8b('0xec'),'exitAt':null}});})[_0x6d8b('0x23')](function(_0x169212){var _0x5ed8e6=[];_0x169212[_0x6d8b('0xe8')](function(_0x434769){_0x5ed8e6[_0x6d8b('0xad')](_0x434769[_0x6d8b('0x6a')]({'exitAt':moment()[_0x6d8b('0x74')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x6d8b('0xf9')}));});return BPromise[_0x6d8b('0xea')](_0x5ed8e6);})['then'](function(){return _0x2346d1['update']({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})['then'](respondWithResult(_0x43d9fe,null))[_0x6d8b('0x2b')](handleError(_0x43d9fe,null));};exports['getTeams']=function(_0x54ff7d,_0x2843a1,_0x152b97){var _0x196468={};var _0x25a9ef={};var _0x1c9ab8;var _0x2d3f4e;return db[_0x6d8b('0x47')][_0x6d8b('0x9c')]({'where':{'id':_0x54ff7d[_0x6d8b('0x94')]['id']}})['then'](handleEntityNotFound(_0x2843a1,null))[_0x6d8b('0x23')](function(_0x3deb68){if(_0x3deb68){_0x1c9ab8=_0x3deb68;_0x25a9ef[_0x6d8b('0x4a')]=_[_0x6d8b('0x50')](db['Team'][_0x6d8b('0x64')]);_0x25a9ef[_0x6d8b('0x4f')]=_[_0x6d8b('0x50')](_0x54ff7d[_0x6d8b('0x4f')]);_0x25a9ef[_0x6d8b('0x51')]=_[_0x6d8b('0x52')](_0x25a9ef[_0x6d8b('0x4a')],_0x25a9ef['query']);_0x196468['attributes']=_[_0x6d8b('0x52')](_0x25a9ef[_0x6d8b('0x4a')],qs['fields'](_0x54ff7d[_0x6d8b('0x4f')]['fields']));_0x196468['attributes']=_0x196468[_0x6d8b('0x53')][_0x6d8b('0x54')]?_0x196468[_0x6d8b('0x53')]:_0x25a9ef[_0x6d8b('0x4a')];_0x196468[_0x6d8b('0x57')]=qs[_0x6d8b('0xc3')](_0x54ff7d[_0x6d8b('0x4f')][_0x6d8b('0xc3')]);_0x196468[_0x6d8b('0x58')]=qs[_0x6d8b('0x51')](_[_0x6d8b('0x59')](_0x54ff7d[_0x6d8b('0x4f')],_0x25a9ef['filters']));if(_0x54ff7d[_0x6d8b('0x4f')][_0x6d8b('0x5a')]){_0x196468['where']=_['merge'](_0x196468['where'],{'$or':_['map'](_0x196468[_0x6d8b('0x53')],function(_0xa53f78){var _0x1ff80d={};_0x1ff80d[_0xa53f78]={'$like':'%'+_0x54ff7d[_0x6d8b('0x4f')]['filter']+'%'};return _0x1ff80d;})});}_0x196468=_['merge']({},_0x196468,_0x54ff7d[_0x6d8b('0x67')]);return _0x1c9ab8[_0x6d8b('0xff')](_0x196468);}})[_0x6d8b('0x23')](function(_0x184ed3){if(_0x184ed3){_0x2d3f4e=_0x184ed3[_0x6d8b('0x54')];if(!_0x54ff7d['query'][_0x6d8b('0x55')](_0x6d8b('0x56'))){_0x196468[_0x6d8b('0x31')]=qs[_0x6d8b('0x31')](_0x54ff7d[_0x6d8b('0x4f')]['limit']);_0x196468['offset']=qs[_0x6d8b('0x30')](_0x54ff7d['query'][_0x6d8b('0x30')]);}return _0x1c9ab8[_0x6d8b('0xff')](_0x196468);}})[_0x6d8b('0x23')](function(_0x34aa75){if(_0x34aa75){return _0x34aa75?{'count':_0x2d3f4e,'rows':_0x34aa75}:null;}})['then'](respondWithResult(_0x2843a1,null))[_0x6d8b('0x2b')](handleError(_0x2843a1,null));};exports[_0x6d8b('0x100')]=function(_0x31e55b,_0x577d93){return db[_0x6d8b('0x47')][_0x6d8b('0x41')]({'where':{'id':_0x31e55b['params']['id']}})[_0x6d8b('0x23')](handleEntityNotFound(_0x577d93,null))[_0x6d8b('0x23')](function(_0x274161){if(_0x274161){var _0xdcf3a3=_0x274161['get']({'plain':!![]});return _0x274161[_0x6d8b('0x100')](_0x31e55b['body'][_0x6d8b('0x6c')],_[_0x6d8b('0x6d')](_0x31e55b[_0x6d8b('0x69')],[_0x6d8b('0x6c'),'id'])||{})[_0x6d8b('0x23')](function(){for(var _0x40cd66=0x0;_0x40cd66<_0x31e55b['body']['ids']['length'];_0x40cd66++){var _0x47785b=[];db[_0x6d8b('0x101')]['findOne']({'where':{'id':_0x31e55b['body'][_0x6d8b('0x6c')][_0x40cd66]}})[_0x6d8b('0x23')](function(_0xf829fd){_0x47785b[_0x6d8b('0xad')](_0xf829fd[_0x6d8b('0xe5')]()['then'](function(_0xdcb8dc){for(var _0x4ff8a6=0x0;_0x4ff8a6<_0xdcb8dc[_0x6d8b('0x54')];_0x4ff8a6++){_0xdcb8dc[_0x4ff8a6][_0x6d8b('0x102')](_0x6d8b('0x9e'),'Voice');}return _0xdcb8dc;}));_0x47785b[_0x6d8b('0xad')](_0xf829fd['getChatQueues']()[_0x6d8b('0x23')](function(_0x1d173a){for(var _0x7d44=0x0;_0x7d44<_0x1d173a[_0x6d8b('0x54')];_0x7d44++){_0x1d173a[_0x7d44][_0x6d8b('0x102')](_0x6d8b('0x9e'),_0x6d8b('0x103'));}return _0x1d173a;}));_0x47785b[_0x6d8b('0xad')](_0xf829fd[_0x6d8b('0x104')]()[_0x6d8b('0x23')](function(_0x11bc79){for(var _0x3eb8eb=0x0;_0x3eb8eb<_0x11bc79[_0x6d8b('0x54')];_0x3eb8eb++){_0x11bc79[_0x3eb8eb]['setDataValue'](_0x6d8b('0x9e'),_0x6d8b('0x105'));}return _0x11bc79;}));_0x47785b[_0x6d8b('0xad')](_0xf829fd['getSmsQueues']()['then'](function(_0x439d77){for(var _0x2324e1=0x0;_0x2324e1<_0x439d77[_0x6d8b('0x54')];_0x2324e1++){_0x439d77[_0x2324e1]['setDataValue']('channel',_0x6d8b('0x106'));}return _0x439d77;}));_0x47785b['push'](_0xf829fd[_0x6d8b('0x107')]()[_0x6d8b('0x23')](function(_0x2419ab){for(var _0x1c8612=0x0;_0x1c8612<_0x2419ab[_0x6d8b('0x54')];_0x1c8612++){_0x2419ab[_0x1c8612][_0x6d8b('0x102')]('channel','Fax');}return _0x2419ab;}));_0x47785b[_0x6d8b('0xad')](_0xf829fd['getOpenchannelQueues']()['then'](function(_0x4d0ca9){for(var _0x1be567=0x0;_0x1be567<_0x4d0ca9[_0x6d8b('0x54')];_0x1be567++){_0x4d0ca9[_0x1be567][_0x6d8b('0x102')](_0x6d8b('0x9e'),_0x6d8b('0x108'));}return _0x4d0ca9;}));return BPromise[_0x6d8b('0xea')](_0x47785b);})[_0x6d8b('0x23')](function(_0x528c90){var _0x558b76=_[_0x6d8b('0x109')](_0x528c90);_0x47785b=[];return db[_0x6d8b('0x5c')][_0x6d8b('0x10a')](function(_0x1a378e){for(var _0xac1a51=0x0;_0xac1a51<_0x558b76['length'];_0xac1a51++){_0x47785b['push'](_0x558b76[_0xac1a51][_0x6d8b('0x10b')](_0xdcf3a3['id']),{'transaction':_0x1a378e});}return BPromise[_0x6d8b('0xea')](_0x47785b)['then'](function(){if(_0xdcf3a3[_0x6d8b('0x9f')]){return BPromise[_0x6d8b('0xb0')](_[_0x6d8b('0x5a')](_0x558b76,function(_0x59f305){return _0x59f305['getDataValue'](_0x6d8b('0x9e'))===_0x6d8b('0x10c');}),function(_0x560ef5){return db['UserVoiceQueueRt'][_0x6d8b('0xb1')]({'membername':_0xdcf3a3[_0x6d8b('0x44')],'UserId':_0xdcf3a3['id'],'queue_name':_0x560ef5[_0x6d8b('0x44')],'VoiceQueueId':_0x560ef5['id'],'interface':_['isNil'](_0xdcf3a3[_0x6d8b('0xa1')])?util[_0x6d8b('0x74')]('SIP/%s',_0xdcf3a3[_0x6d8b('0x44')]):_0xdcf3a3[_0x6d8b('0xa1')],'paused':_0xdcf3a3[_0x6d8b('0xa0')]||![],'penalty':_0xdcf3a3['penalty']},{'transaction':_0x1a378e});});}else{return;}})['then'](function(){for(var _0x5853cd=0x0;_0x5853cd<_0x558b76['length'];_0x5853cd++){var _0x5f3191=_0x558b76[_0x5853cd][_0x6d8b('0x10d')](_0x6d8b('0x9e'));var _0x1b72cb=_0x5f3191+'QueueId';socket['emit']('user'+_0x5f3191+'Queue:save',{'UserId':_0xdcf3a3['id'],['queueField']:_0x558b76[_0x5853cd]['id']});}});});});}});}})[_0x6d8b('0x23')](respondWithStatusCode(_0x577d93,null))[_0x6d8b('0x2b')](handleError(_0x577d93,null));};exports[_0x6d8b('0x10e')]=function(_0x558437,_0x224a91){return db[_0x6d8b('0x47')][_0x6d8b('0x9c')]({'where':{'id':_0x558437[_0x6d8b('0x94')]['id']}})[_0x6d8b('0x23')](handleEntityNotFound(_0x224a91,null))[_0x6d8b('0x23')](function(_0x481cb4){if(_0x481cb4){var _0x333d98=_0x481cb4[_0x6d8b('0x37')]({'plain':!![]});var _0x25fb54=_0x558437[_0x6d8b('0x4f')][_0x6d8b('0x6c')];return _0x481cb4[_0x6d8b('0x10e')](_0x25fb54)[_0x6d8b('0x23')](function(){for(var _0x95f8a6=0x0;_0x95f8a6<_0x25fb54['length'];_0x95f8a6++){var _0x365924=[];db[_0x6d8b('0x101')][_0x6d8b('0x9c')]({'where':{'id':_0x25fb54[_0x95f8a6]}})[_0x6d8b('0x23')](function(_0x433c26){_0x365924[_0x6d8b('0xad')](_0x433c26[_0x6d8b('0xe5')]()[_0x6d8b('0x23')](function(_0x1b4dac){for(var _0x2b77b3=0x0;_0x2b77b3<_0x1b4dac[_0x6d8b('0x54')];_0x2b77b3++){_0x1b4dac[_0x2b77b3]['setDataValue'](_0x6d8b('0x9e'),_0x6d8b('0x10c'));}return _0x1b4dac;}));_0x365924[_0x6d8b('0xad')](_0x433c26[_0x6d8b('0x10f')]()['then'](function(_0x1e0c70){for(var _0x57f1f7=0x0;_0x57f1f7<_0x1e0c70['length'];_0x57f1f7++){_0x1e0c70[_0x57f1f7][_0x6d8b('0x102')](_0x6d8b('0x9e'),_0x6d8b('0x103'));}return _0x1e0c70;}));_0x365924[_0x6d8b('0xad')](_0x433c26[_0x6d8b('0x104')]()[_0x6d8b('0x23')](function(_0xaf7c91){for(var _0x80bd8f=0x0;_0x80bd8f<_0xaf7c91[_0x6d8b('0x54')];_0x80bd8f++){_0xaf7c91[_0x80bd8f]['setDataValue'](_0x6d8b('0x9e'),_0x6d8b('0x105'));}return _0xaf7c91;}));_0x365924[_0x6d8b('0xad')](_0x433c26[_0x6d8b('0x110')]()[_0x6d8b('0x23')](function(_0x202c59){for(var _0x461ea8=0x0;_0x461ea8<_0x202c59[_0x6d8b('0x54')];_0x461ea8++){_0x202c59[_0x461ea8][_0x6d8b('0x102')](_0x6d8b('0x9e'),_0x6d8b('0x106'));}return _0x202c59;}));_0x365924[_0x6d8b('0xad')](_0x433c26['getFaxQueues']()[_0x6d8b('0x23')](function(_0x40ff43){for(var _0x3d1aa3=0x0;_0x3d1aa3<_0x40ff43[_0x6d8b('0x54')];_0x3d1aa3++){_0x40ff43[_0x3d1aa3][_0x6d8b('0x102')](_0x6d8b('0x9e'),_0x6d8b('0x111'));}return _0x40ff43;}));_0x365924[_0x6d8b('0xad')](_0x433c26[_0x6d8b('0x112')]()[_0x6d8b('0x23')](function(_0x2d3453){for(var _0x3bff8d=0x0;_0x3bff8d<_0x2d3453['length'];_0x3bff8d++){_0x2d3453[_0x3bff8d]['setDataValue'](_0x6d8b('0x9e'),_0x6d8b('0x108'));}return _0x2d3453;}));return BPromise[_0x6d8b('0xea')](_0x365924);})[_0x6d8b('0x23')](function(_0x1af57d){var _0xa3fe29=_[_0x6d8b('0x109')](_0x1af57d);_0x365924=[];return db['sequelize']['transaction'](function(_0x1a19dc){for(var _0x57189b=0x0;_0x57189b<_0xa3fe29['length'];_0x57189b++){_0x365924[_0x6d8b('0xad')](_0xa3fe29[_0x57189b]['removeAgent'](_0x333d98['id']),{'transaction':_0x1a19dc});}return BPromise['all'](_0x365924)[_0x6d8b('0x23')](function(){if(_0x333d98['online']){return BPromise[_0x6d8b('0xb0')](_[_0x6d8b('0x5a')](_0xa3fe29,function(_0x599ae0){return _0x599ae0['getDataValue'](_0x6d8b('0x9e'))===_0x6d8b('0x10c');}),function(_0x17f558){return db[_0x6d8b('0xb6')][_0x6d8b('0x36')]({'where':{'VoiceQueueId':_0x17f558['id'],'UserId':_0x333d98['id']},'transaction':_0x1a19dc});});}else{return;}})[_0x6d8b('0x23')](function(){for(var _0x195b27=0x0;_0x195b27<_0xa3fe29[_0x6d8b('0x54')];_0x195b27++){var _0x353cc8=_0xa3fe29[_0x195b27]['getDataValue'](_0x6d8b('0x9e'));var _0x5cbcc5=_0x353cc8+_0x6d8b('0xa8');socket[_0x6d8b('0xa9')](_0x6d8b('0x39')+_0x353cc8+_0x6d8b('0xb5'),{'UserId':_0x333d98['id'],['queueField']:_0xa3fe29[_0x195b27]['id']});}});});});}});}})[_0x6d8b('0x23')](respondWithStatusCode(_0x224a91,null))[_0x6d8b('0x2b')](handleError(_0x224a91,null));};exports[_0x6d8b('0x113')]=function(_0x24d19a,_0x2ddf6a,_0x5e352f){var _0x422048={};var _0x38feda={};var _0x32bbdd;var _0x45aff6;return db[_0x6d8b('0x47')][_0x6d8b('0x9c')]({'where':{'id':_0x24d19a[_0x6d8b('0x94')]['id']}})[_0x6d8b('0x23')](handleEntityNotFound(_0x2ddf6a,null))[_0x6d8b('0x23')](function(_0x3eee4e){if(_0x3eee4e){_0x32bbdd=_0x3eee4e;_0x38feda['model']=_[_0x6d8b('0x50')](db[_0x6d8b('0xc5')][_0x6d8b('0x64')]);_0x38feda['query']=_[_0x6d8b('0x50')](_0x24d19a[_0x6d8b('0x4f')]);_0x38feda[_0x6d8b('0x51')]=_[_0x6d8b('0x52')](_0x38feda[_0x6d8b('0x4a')],_0x38feda[_0x6d8b('0x4f')]);_0x422048['attributes']=_['intersection'](_0x38feda[_0x6d8b('0x4a')],qs[_0x6d8b('0x65')](_0x24d19a[_0x6d8b('0x4f')][_0x6d8b('0x65')]));_0x422048['attributes']=_0x422048[_0x6d8b('0x53')]['length']?_0x422048[_0x6d8b('0x53')]:_0x38feda['model'];_0x422048[_0x6d8b('0x57')]=qs[_0x6d8b('0xc3')](_0x24d19a[_0x6d8b('0x4f')][_0x6d8b('0xc3')]);_0x422048[_0x6d8b('0x58')]=qs[_0x6d8b('0x51')](_[_0x6d8b('0x59')](_0x24d19a[_0x6d8b('0x4f')],_0x38feda['filters']));if(_0x24d19a[_0x6d8b('0x4f')]['filter']){_0x422048[_0x6d8b('0x58')]=_[_0x6d8b('0x5f')](_0x422048['where'],{'$or':_[_0x6d8b('0x4c')](_0x422048[_0x6d8b('0x53')],function(_0x13cf72){var _0xafa100={};_0xafa100[_0x13cf72]={'$like':'%'+_0x24d19a['query'][_0x6d8b('0x5a')]+'%'};return _0xafa100;})});}_0x422048=_[_0x6d8b('0x5f')]({},_0x422048,_0x24d19a[_0x6d8b('0x67')]);return _0x32bbdd['getLists'](_0x422048);}})[_0x6d8b('0x23')](function(_0x5a840e){if(_0x5a840e){_0x45aff6=_0x5a840e[_0x6d8b('0x54')];if(!_0x24d19a[_0x6d8b('0x4f')][_0x6d8b('0x55')]('nolimit')){_0x422048[_0x6d8b('0x31')]=qs[_0x6d8b('0x31')](_0x24d19a[_0x6d8b('0x4f')][_0x6d8b('0x31')]);_0x422048['offset']=qs[_0x6d8b('0x30')](_0x24d19a[_0x6d8b('0x4f')][_0x6d8b('0x30')]);}return _0x32bbdd[_0x6d8b('0x113')](_0x422048);}})[_0x6d8b('0x23')](function(_0x5e1805){if(_0x5e1805){return _0x5e1805?{'count':_0x45aff6,'rows':_0x5e1805}:null;}})[_0x6d8b('0x23')](respondWithResult(_0x2ddf6a,null))[_0x6d8b('0x2b')](handleError(_0x2ddf6a,null));};exports[_0x6d8b('0x114')]=function(_0x2e5621,_0x12fa08,_0x59625c){var _0x4e66dd={};var _0x3f60ba={};var _0x3d32c7;var _0x3ccfde;return db[_0x6d8b('0x47')][_0x6d8b('0x9c')]({'where':{'id':_0x2e5621['params']['id']}})[_0x6d8b('0x23')](handleEntityNotFound(_0x12fa08,null))[_0x6d8b('0x23')](function(_0x15218b){if(_0x15218b){_0x3d32c7=_0x15218b;_0x3f60ba[_0x6d8b('0x4a')]=_['keys'](db[_0x6d8b('0x47')][_0x6d8b('0x64')]);_0x3f60ba[_0x6d8b('0x4f')]=_['keys'](_0x2e5621['query']);_0x3f60ba[_0x6d8b('0x51')]=_[_0x6d8b('0x52')](_0x3f60ba[_0x6d8b('0x4a')],_0x3f60ba[_0x6d8b('0x4f')]);_0x4e66dd['attributes']=_['intersection'](_0x3f60ba[_0x6d8b('0x4a')],qs[_0x6d8b('0x65')](_0x2e5621[_0x6d8b('0x4f')][_0x6d8b('0x65')]));_0x4e66dd[_0x6d8b('0x53')]=_0x4e66dd[_0x6d8b('0x53')]['length']?_0x4e66dd[_0x6d8b('0x53')]:_0x3f60ba[_0x6d8b('0x4a')];_0x4e66dd[_0x6d8b('0x57')]=qs[_0x6d8b('0xc3')](_0x2e5621[_0x6d8b('0x4f')][_0x6d8b('0xc3')]);_0x4e66dd[_0x6d8b('0x58')]=qs['filters'](_[_0x6d8b('0x59')](_0x2e5621[_0x6d8b('0x4f')],_0x3f60ba[_0x6d8b('0x51')]));if(_0x2e5621[_0x6d8b('0x4f')][_0x6d8b('0x5a')]){_0x4e66dd[_0x6d8b('0x58')]=_[_0x6d8b('0x5f')](_0x4e66dd['where'],{'$or':_[_0x6d8b('0x4c')](_0x4e66dd[_0x6d8b('0x53')],function(_0x514c81){var _0x3a96f1={};_0x3a96f1[_0x514c81]={'$like':'%'+_0x2e5621[_0x6d8b('0x4f')][_0x6d8b('0x5a')]+'%'};return _0x3a96f1;})});}_0x4e66dd[_0x6d8b('0x4a')]=db[_0x6d8b('0x47')];_0x4e66dd['as']=_0x6d8b('0x3a');_0x4e66dd=_[_0x6d8b('0x5f')]({},_0x4e66dd,_0x2e5621['options']);return _0x3d32c7['getVoiceQueues']({'include':[_0x4e66dd]});}})[_0x6d8b('0x23')](function(_0x5f436a){if(_0x5f436a){var _0x232c9e={},_0x3ee717=[],_0x2146af=0x0;for(var _0x38f05c=0x0;_0x38f05c<_0x5f436a[_0x6d8b('0x54')];_0x38f05c+=0x1){for(var _0x29f3af=0x0,_0x577dc9;_0x29f3af<_0x5f436a[_0x38f05c][_0x6d8b('0x3a')][_0x6d8b('0x54')];_0x29f3af+=0x1){_0x577dc9=_0x5f436a[_0x38f05c][_0x6d8b('0x3a')][_0x29f3af][_0x6d8b('0x37')]({'plain':!![]});_0x232c9e[_0x577dc9['id']]=_0x577dc9;}}_0x232c9e=_[_0x6d8b('0x115')](_0x232c9e);for(var _0x5c989d=qs[_0x6d8b('0x30')](_0x2e5621['query']['offset']);_0x5c989d<_0x232c9e[_0x6d8b('0x54')]&&_0x3ee717['length']=_0x1f301d){_0x5a9e19=_0x1f301d;_0x1a0f7c=0xc8;}else{_0x1a0f7c=0xce;}_0x5a546f[_0x6342('0x30')](_0x1a0f7c);return _0x5a546f[_0x6342('0x34')](_0x6342('0x35'),_0x5951d0+'-'+_0x5a9e19+'/'+_0x1f301d)['json'](_0x1492d3);}return null;};}function patchUpdates(_0x27e51e){return function(_0x1fff73){try{jsonpatch[_0x6342('0x36')](_0x1fff73,_0x27e51e,!![]);}catch(_0x8dc78a){return BPromise[_0x6342('0x37')](_0x8dc78a);}return _0x1fff73[_0x6342('0x38')]();};}function saveUpdates(_0x5480ab,_0xf46c86){return function(_0x3d873e){if(_0x3d873e){return _0x3d873e[_0x6342('0x39')](_0x5480ab)[_0x6342('0x24')](function(_0x15ded5){return _0x15ded5;});}return null;};}function removeEntity(_0x11601c,_0x378acf){return function(_0x4f0c36){if(_0x4f0c36){return _0x4f0c36['destroy']()[_0x6342('0x24')](function(){var _0x269733=_0x4f0c36[_0x6342('0x3a')]({'plain':!![]});var _0x1ab8f3=[{'name':'Users','value':'user','ignore':!![]},{'name':_0x6342('0x3b'),'value':_0x6342('0x3c'),'ignore':![]},{'name':_0x6342('0x3d'),'value':_0x6342('0x3e'),'ignore':![]}];var _0x541611=_(_0x1ab8f3)[_0x6342('0x3f')](_0x6342('0x40'))[_0x6342('0x41')](_0x6342('0x42'))[_0x6342('0x42')]();if(_['includes'](_0x541611,_0x269733[_0x6342('0x43')])){return;}var _0x17978c=_[_0x6342('0x44')](_0x1ab8f3,['value',_0x269733['role']])['name'];return db[_0x6342('0x45')]['destroy']({'where':{'type':_0x17978c,'resourceId':_0x269733['id']}})[_0x6342('0x24')](function(){return _0x4f0c36;});})['then'](function(){_0x11601c[_0x6342('0x30')](0xcc)[_0x6342('0x2f')]();});}};}function handleEntityNotFound(_0x4d826e,_0x3cd723){return function(_0x3734e8){if(!_0x3734e8){_0x4d826e[_0x6342('0x2e')](0x194);}return _0x3734e8;};}function handleError(_0x440417,_0x11fb51){_0x11fb51=_0x11fb51||0x1f4;return function(_0x24b0e2){logger[_0x6342('0x2a')](_0x24b0e2[_0x6342('0x46')]);if(_0x24b0e2[_0x6342('0x47')]){delete _0x24b0e2[_0x6342('0x47')];}_0x440417[_0x6342('0x30')](_0x11fb51)[_0x6342('0x48')](_0x24b0e2);};}exports[_0x6342('0x49')]=function(_0x4cb3af,_0x3aee6d){var _0x36b6ef={},_0x3b7c2b={},_0x268a99={'count':0x0,'rows':[]};var _0x3d59db=_[_0x6342('0x41')](db[_0x6342('0x4a')][_0x6342('0x4b')],function(_0x56e38f){return{'name':_0x56e38f['fieldName'],'type':_0x56e38f['type'][_0x6342('0x4c')]};});_0x3b7c2b[_0x6342('0x4d')]=_[_0x6342('0x4e')](_[_0x6342('0x41')](_0x3d59db,_0x6342('0x47')),[_0x6342('0x4f'),_0x6342('0x50')]);_0x3b7c2b['query']=_[_0x6342('0x51')](_0x4cb3af[_0x6342('0x52')]);_0x3b7c2b['filters']=_[_0x6342('0x53')](_0x3b7c2b[_0x6342('0x4d')],_0x3b7c2b['query']);_0x36b6ef[_0x6342('0x54')]=_[_0x6342('0x53')](_0x3b7c2b[_0x6342('0x4d')],qs['fields'](_0x4cb3af[_0x6342('0x52')][_0x6342('0x55')]));_0x36b6ef['attributes']=_0x36b6ef['attributes']['length']?_0x36b6ef['attributes']:_0x3b7c2b[_0x6342('0x4d')];if(!_0x4cb3af['query'][_0x6342('0x56')](_0x6342('0x57'))){_0x36b6ef[_0x6342('0x33')]=qs['limit'](_0x4cb3af[_0x6342('0x52')][_0x6342('0x33')]);_0x36b6ef[_0x6342('0x58')]=qs['offset'](_0x4cb3af[_0x6342('0x52')][_0x6342('0x58')]);}_0x36b6ef[_0x6342('0x59')]=qs[_0x6342('0x5a')](_0x4cb3af[_0x6342('0x52')][_0x6342('0x5a')]);_0x36b6ef[_0x6342('0x5b')]=qs['filters'](_[_0x6342('0x5c')](_0x4cb3af[_0x6342('0x52')],_0x3b7c2b[_0x6342('0x5d')]));if(_0x4cb3af['query'][_0x6342('0x3f')]){_0x36b6ef['where']=_[_0x6342('0x5e')](_0x36b6ef[_0x6342('0x5b')],{'$or':_['map'](_0x3d59db,function(_0x4aa6b5){if(_0x4aa6b5[_0x6342('0x5f')]['key']!==_0x6342('0x60')){return db[_0x6342('0x61')][_0x6342('0x5b')](db['sequelize']['fn'](_0x6342('0x62'),db['sequelize'][_0x6342('0x63')](_0x4aa6b5[_0x6342('0x64')])),{'$like':db['sequelize']['fn'](_0x6342('0x62'),'%'+_0x4cb3af[_0x6342('0x52')]['filter']+'%')});}})});}_0x36b6ef=_[_0x6342('0x5e')]({},_0x36b6ef,_0x4cb3af[_0x6342('0x65')]);var _0x5cd803={'where':_0x36b6ef['where']};return db[_0x6342('0x4a')][_0x6342('0x32')](_0x5cd803)['then'](function(_0x26e06f){_0x268a99['count']=_0x26e06f;if(_0x4cb3af['query'][_0x6342('0x66')]){_0x36b6ef[_0x6342('0x67')]=[{'all':!![]}];}return db[_0x6342('0x4a')]['findAll'](_0x36b6ef);})['then'](function(_0x9e1264){_0x268a99[_0x6342('0x68')]=_0x9e1264;return _0x268a99;})[_0x6342('0x24')](respondWithFilteredResult(_0x3aee6d,_0x36b6ef))[_0x6342('0x69')](handleError(_0x3aee6d,null));};exports[_0x6342('0x6a')]=function(_0x1b641c,_0x13e4a0){var _0x5c45d8={'raw':![],'where':{'id':_0x1b641c[_0x6342('0x6b')]['id']}},_0xaeb29b={};_0xaeb29b[_0x6342('0x4d')]=_['differenceBy'](_[_0x6342('0x51')](db['User'][_0x6342('0x4b')]),[_0x6342('0x4f'),_0x6342('0x50')]);_0xaeb29b[_0x6342('0x52')]=_[_0x6342('0x51')](_0x1b641c[_0x6342('0x52')]);_0xaeb29b[_0x6342('0x5d')]=_[_0x6342('0x53')](_0xaeb29b[_0x6342('0x4d')],_0xaeb29b['query']);_0x5c45d8[_0x6342('0x54')]=_[_0x6342('0x53')](_0xaeb29b[_0x6342('0x4d')],qs[_0x6342('0x55')](_0x1b641c['query'][_0x6342('0x55')]));_0x5c45d8['attributes']=_0x5c45d8['attributes'][_0x6342('0x6c')]?_0x5c45d8[_0x6342('0x54')]:_0xaeb29b[_0x6342('0x4d')];if(_0x1b641c[_0x6342('0x52')]['includeAll']){_0x5c45d8['include']=[{'all':!![]}];}_0x5c45d8=_['merge']({},_0x5c45d8,_0x1b641c[_0x6342('0x65')]);return db[_0x6342('0x4a')]['find'](_0x5c45d8)[_0x6342('0x24')](handleEntityNotFound(_0x13e4a0,null))[_0x6342('0x24')](respondWithResult(_0x13e4a0,null))[_0x6342('0x69')](handleError(_0x13e4a0,null));};exports[_0x6342('0x6d')]=function(_0x5e4382,_0x2924ee){return db['User'][_0x6342('0x6d')](_0x5e4382[_0x6342('0x6e')],{'raw':![],'individualHooks':!![]})[_0x6342('0x24')](respondWithResult(_0x2924ee,0xc9))[_0x6342('0x69')](handleError(_0x2924ee,null));};exports[_0x6342('0x39')]=function(_0x4fa967,_0x11633d){if(_0x4fa967[_0x6342('0x6e')]['id']){delete _0x4fa967['body']['id'];}delete _0x4fa967['body'][_0x6342('0x43')];return db[_0x6342('0x4a')][_0x6342('0x44')]({'where':{'id':_0x4fa967[_0x6342('0x6b')]['id']}})[_0x6342('0x24')](handleEntityNotFound(_0x11633d,null))['then'](saveUpdates(_0x4fa967['body'],null))[_0x6342('0x24')](respondWithResult(_0x11633d,null))['catch'](handleError(_0x11633d,null));};exports[_0x6342('0x6f')]=function(_0xa154f9,_0x4f38e9){return db[_0x6342('0x4a')][_0x6342('0x6f')]()[_0x6342('0x24')](respondWithResult(_0x4f38e9,null))[_0x6342('0x69')](handleError(_0x4f38e9,null));};exports[_0x6342('0x70')]=function(_0x3a083a,_0x2b4535,_0x468cba){return db[_0x6342('0x4a')][_0x6342('0x44')]({'where':{'id':_0x3a083a[_0x6342('0x6b')]['id']}})['then'](handleEntityNotFound(_0x2b4535,null))[_0x6342('0x24')](function(_0x3332a0){if(_0x3332a0){return _0x3332a0['addContacts'](_0x3a083a[_0x6342('0x6e')][_0x6342('0x71')],_[_0x6342('0x72')](_0x3a083a[_0x6342('0x6e')],[_0x6342('0x71'),'id'])||{});}})[_0x6342('0x24')](respondWithResult(_0x2b4535,null))[_0x6342('0x69')](handleError(_0x2b4535,null));};var getLicense=function(_0x3008c9){return new BPromise(function(_0x4933ae,_0x1d0ace){var _0x4b978e=0x0;_0x3008c9[_0x6342('0x6e')][_0x6342('0x43')]===_0x6342('0x3c')&&_0x4933ae('agent\x20role');return db[_0x6342('0x4a')]['count']({'where':{'$or':[{'role':_0x3008c9['body']['role']===_0x6342('0x3e')?_0x6342('0x3e'):[_0x6342('0x73'),_0x6342('0x74')]}]}})[_0x6342('0x24')](function(_0x330e79){_0x4b978e=_0x330e79;return require(_0x6342('0x75'))[_0x6342('0x76')]();})['then'](function(_0x19891b){var _0xf5e27f=_0x3008c9[_0x6342('0x6e')][_0x6342('0x43')]===_0x6342('0x3e')?_0x6342('0x77'):_0x6342('0x78');if(!_[_0x6342('0x79')](_0x19891b[_0xf5e27f])&&_0x4b978e>=_0x19891b[_0xf5e27f]){return _0x1d0ace({'message':_0x6342('0x7a')});}return _0x4933ae(util[_0x6342('0x7b')](_0x6342('0x7c'),_0xf5e27f,_0x4b978e));})[_0x6342('0x69')](function(_0x4a0518){return _0x1d0ace(_0x4a0518);});});};exports[_0x6342('0x7d')]=function(_0x419abf,_0xf6f80a){return getLicense(_0x419abf)[_0x6342('0x24')](function(_0x42af5a){if(!_0x419abf['body']['internal']){var _0x1750ae;return db[_0x6342('0x7e')]['findById'](0x1)[_0x6342('0x24')](function(_0x48a7d5){return checkPasswordPattern(_0x48a7d5,_0x419abf['body'][_0x6342('0x4f')],_0x48a7d5[_0x6342('0x7f')]);})['then'](function(_0x5f2a84){_0x1750ae=_0x5f2a84[_0x6342('0x80')];return db['User'][_0x6342('0x81')](_0x6342('0x82'));})[_0x6342('0x24')](function(_0x2b76b8){if(_[_0x6342('0x79')](_0x2b76b8)){if(_0x1750ae){_0x419abf[_0x6342('0x6e')][_0x6342('0x82')]=_0x1750ae;}else{_0x419abf[_0x6342('0x6e')]['internal']=0x1;}}else{if(_[_0x6342('0x79')](_0x1750ae)||_0x1750ae==_0x2b76b8){_0x419abf[_0x6342('0x6e')]['internal']=_0x2b76b8+0x1;}else if(_0x1750ae>_0x2b76b8){_0x419abf[_0x6342('0x6e')][_0x6342('0x82')]=_0x1750ae;}else{return db['sequelize']['query'](_0x6342('0x83'),{'type':db['sequelize'][_0x6342('0x84')][_0x6342('0x85')]})[_0x6342('0x24')](function(_0x3b9726){if(_0x3b9726&&_0x3b9726[_0x6342('0x6c')]){for(var _0x57ce0c=0x0,_0x349f67=_0x3b9726['length'];_0x57ce0c<_0x349f67&&_[_0x6342('0x79')](_0x419abf[_0x6342('0x6e')][_0x6342('0x82')]);_0x57ce0c++){if(_0x1750ae<=_0x3b9726[_0x57ce0c]['from']){_0x419abf['body']['internal']=_0x3b9726[_0x57ce0c][_0x6342('0x86')];}else if(_0x1750ae>_0x3b9726[_0x57ce0c][_0x6342('0x86')]&&_0x1750ae<=_0x3b9726[_0x57ce0c]['to']){_0x419abf[_0x6342('0x6e')][_0x6342('0x82')]=_0x1750ae;}}}if(_[_0x6342('0x79')](_0x419abf[_0x6342('0x6e')][_0x6342('0x82')])){_0x419abf[_0x6342('0x6e')][_0x6342('0x82')]=_0x2b76b8+0x1;}});}}});}})[_0x6342('0x24')](function(){if(_0x419abf[_0x6342('0x6e')][_0x6342('0x87')]){_0x419abf[_0x6342('0x6e')]['mailbox']=_0x419abf[_0x6342('0x6e')][_0x6342('0x82')];_0x419abf['body'][_0x6342('0x88')]={'mailbox':_0x419abf['body']['internal'],'password':_0x419abf[_0x6342('0x6e')][_0x6342('0x4f')],'fullname':_0x419abf['body'][_0x6342('0x89')],'email':_0x419abf[_0x6342('0x6e')]['email']};}if(_0x419abf[_0x6342('0x6e')]&&_0x419abf['body'][_0x6342('0x43')]===_0x6342('0x3c')){_0x419abf[_0x6342('0x6e')]['permissions']=[_0x6342('0x8a'),_0x6342('0x8b'),_0x6342('0x8c'),_0x6342('0x8d'),_0x6342('0x8e'),_0x6342('0x8f'),_0x6342('0x90'),_0x6342('0x91'),_0x6342('0x92'),_0x6342('0x93'),_0x6342('0x94'),'111'];}return db[_0x6342('0x4a')]['create'](_0x419abf['body'],{'include':[{'model':db[_0x6342('0x88')],'as':_0x6342('0x88')}]});})['then'](function(_0x5c94f1){if(_0x419abf[_0x6342('0x6e')][_0x6342('0x43')]===_0x6342('0x74'))return _0x5c94f1;var _0x56296b=_0x419abf[_0x6342('0x74')][_0x6342('0x3a')]({'plain':!![]});if(!_0x56296b)throw new Error(_0x6342('0x95'));if(_0x56296b[_0x6342('0x43')]===_0x6342('0x74')){var _0xb52a37=_0x5c94f1[_0x6342('0x3a')]({'plain':!![]});var _0x27cd23=[{'name':_0x6342('0x3b'),'value':_0x6342('0x3c')},{'name':_0x6342('0x3d'),'value':'telephone'}];var _0x5a7fa8=_[_0x6342('0x44')](_0x27cd23,[_0x6342('0x42'),_0xb52a37[_0x6342('0x43')]])['name'];return db['UserProfileSection'][_0x6342('0x44')]({'where':{'name':_0x5a7fa8,'userProfileId':_0x56296b[_0x6342('0x96')]},'raw':!![]})['then'](function(_0x496ce8){if(_0x496ce8&&_0x496ce8[_0x6342('0x97')]===0x0){return db['UserProfileResource']['create']({'name':_0xb52a37[_0x6342('0x47')],'resourceId':_0xb52a37['id'],'type':_0x496ce8[_0x6342('0x47')],'sectionId':_0x496ce8['id']},{})[_0x6342('0x24')](function(){return _0x5c94f1;});}else{return _0x5c94f1;}})[_0x6342('0x69')](function(_0x1ca220){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1ca220);throw _0x1ca220;});}return _0x5c94f1;})[_0x6342('0x24')](respondWithResult(_0xf6f80a,0xc9))[_0x6342('0x69')](handleError(_0xf6f80a,null));};exports[_0x6342('0x98')]=function(_0xc99b4b,_0x2e914d,_0x47c0c8){var _0x11648b=![];if(_0xc99b4b[_0x6342('0x6e')]['id']){delete _0xc99b4b[_0x6342('0x6e')]['id'];}if(!_['isNil'](_0xc99b4b[_0x6342('0x6e')]['oldPassword'])){if(_0xc99b4b[_0x6342('0x6e')][_0x6342('0x99')]===_0xc99b4b[_0x6342('0x6e')][_0x6342('0x9a')]){throw new Error(_0x6342('0x9b'));}}return db[_0x6342('0x4a')][_0x6342('0x44')]({'where':{'id':_0xc99b4b['params']['id']}})[_0x6342('0x24')](function(_0xf982e9){if(_0xf982e9){if(_0xf982e9['id']==_0xc99b4b[_0x6342('0x74')]['id']){if(!_0xc99b4b[_0x6342('0x6e')]['oldPassword']||!_0xc99b4b[_0x6342('0x6e')][_0x6342('0x9a')]){throw new db[(_0x6342('0x9c'))]['ValidationError'](_0x6342('0x9d'));}if(!_0xf982e9[_0x6342('0x9e')](_0xc99b4b['body']['oldPassword'])){throw new db[(_0x6342('0x9c'))][(_0x6342('0x9f'))](_0x6342('0xa0'));}if(_0xc99b4b[_0x6342('0x6e')][_0x6342('0x99')]==_0xc99b4b[_0x6342('0x6e')][_0x6342('0x9a')]){throw new db[(_0x6342('0x9c'))][(_0x6342('0x9f'))](_0x6342('0xa1'));}return _0xf982e9;}else if(_0xc99b4b[_0x6342('0x74')]['role']=='admin'){if(!_0xc99b4b['body'][_0x6342('0x9a')]){throw new db[(_0x6342('0x9c'))][(_0x6342('0x9f'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}return _0xf982e9;}else if(_0xc99b4b[_0x6342('0x74')]['role']==_0x6342('0x74')){if(!_0xc99b4b[_0x6342('0x6e')][_0x6342('0x9a')]){throw new db[(_0x6342('0x9c'))][(_0x6342('0x9f'))](_0x6342('0xa2'));}if(_0xf982e9['role']!='agent'){throw new db[(_0x6342('0x9c'))]['ValidationError']('Unauthorized');}return _0xf982e9;}else{throw new db[(_0x6342('0x9c'))][(_0x6342('0x9f'))](_0x6342('0xa3'));}}return null;})['then'](handleEntityNotFound(_0x2e914d,null))[_0x6342('0x24')](function(_0x278785){return db[_0x6342('0x7e')][_0x6342('0xa4')]({'attributes':['id','securePassword']})[_0x6342('0x24')](function(_0x5a38e1){_0x11648b=_0x5a38e1[_0x6342('0x7f')];return checkPasswordPattern(_0x278785,_0xc99b4b[_0x6342('0x6e')]['newPassword'],_0x11648b);});})[_0x6342('0x24')](saveUpdates({'password':_0xc99b4b[_0x6342('0x6e')]['newPassword'],'passwordResetAt':_0xc99b4b['user']['id']==_0xc99b4b['params']['id']?moment():null},null))[_0x6342('0x24')](respondWithResult(_0x2e914d,null))['catch'](handleError(_0x2e914d,null));};exports[_0x6342('0xa5')]=function(_0x406c15,_0x380981,_0x3bb22c){var _0x5cc472=_0x406c15[_0x6342('0x6e')][_0x6342('0xa6')];return db[_0x6342('0x4a')][_0x6342('0x44')]({'where':{'id':_0x406c15[_0x6342('0x6b')]['id']},'attributes':['id',_0x6342('0x47'),_0x6342('0x43'),_0x6342('0xa7'),'loginInPause',_0x6342('0xa8'),_0x6342('0xa9')]})[_0x6342('0x24')](handleEntityNotFound(_0x380981,null))['then'](function(_0x2afd9e){if(_0x2afd9e){if(!utils['isValidChannel'](_0x5cc472)){throw new db[(_0x6342('0x9c'))]['ValidationError']('Unknown\x20channel');}return _0x2afd9e[_0x6342('0xaa')+_['capitalize'](_0x5cc472['toLowerCase']())+_0x6342('0xab')](_0x406c15[_0x6342('0x6e')][_0x6342('0x71')],{'penalty':_0x406c15['body']['penalty']||0x0})[_0x6342('0xac')](function(_0x167ac6){for(var _0xdf0ac3=0x0;_0xdf0ac3<_0x406c15['body']['ids']['length'];_0xdf0ac3+=0x1){var _0x1dcd0d={'UserId':_0x406c15[_0x6342('0x6b')]['id']};_0x1dcd0d[_[_0x6342('0xad')](_0x5cc472[_0x6342('0xae')]())+'QueueId']=_0x406c15[_0x6342('0x6e')][_0x6342('0x71')][_0xdf0ac3];socket[_0x6342('0xaf')](_0x6342('0x74')+_[_0x6342('0xad')](_0x5cc472[_0x6342('0xae')]())+_0x6342('0xb0'),_0x1dcd0d);}return _0x167ac6;})[_0x6342('0x24')](function(){if(_0x5cc472===_0x6342('0xb1')){return db[_0x6342('0xb2')][_0x6342('0xb3')]({'where':{'id':_0x406c15[_0x6342('0x6e')][_0x6342('0x71')]||[]},'raw':!![],'attributes':['id','name']});}})[_0x6342('0x24')](function(_0x2341f6){var _0x3e22ac=_0x2afd9e[_0x6342('0x3a')]({'plain':!![]});var _0xd0de57=[];if(_0x5cc472==='voice'&&_0x3e22ac['role']==='agent'&&_0x3e22ac['online']){for(var _0x3bfca8=0x0;_0x3bfca8<_0x2341f6[_0x6342('0x6c')];_0x3bfca8+=0x1){_0xd0de57['push']({'membername':_0x3e22ac[_0x6342('0x47')],'UserId':_0x3e22ac['id'],'queue_name':_0x2341f6[_0x3bfca8][_0x6342('0x47')],'VoiceQueueId':_0x2341f6[_0x3bfca8]['id'],'interface':_[_0x6342('0x79')](_0x3e22ac[_0x6342('0xa9')])?util[_0x6342('0x7b')](_0x6342('0xb4'),_0x3e22ac[_0x6342('0x47')]):_0x3e22ac[_0x6342('0xa9')],'paused':_0x3e22ac['voicePause']||![],'penalty':_0x406c15[_0x6342('0x6e')][_0x6342('0xb5')]||0x0});}return BPromise[_0x6342('0xb6')](_0xd0de57,function(_0x2d126e){return db[_0x6342('0xb7')][_0x6342('0xb8')](_0x2d126e);});}return _0x2afd9e;});}})[_0x6342('0x24')](respondWithStatusCode(_0x380981,null))['catch'](handleError(_0x380981,null));};exports['removeQueues']=function(_0x2cc36f,_0xa1d8b4,_0x480415){var _0x3ca5a6;return db[_0x6342('0x4a')][_0x6342('0x44')]({'where':{'id':_0x2cc36f[_0x6342('0x6b')]['id']},'attributes':['id',_0x6342('0x47'),_0x6342('0x43')]})[_0x6342('0x24')](handleEntityNotFound(_0xa1d8b4,null))[_0x6342('0x24')](function(_0x573b28){if(_0x573b28){_0x3ca5a6=_0x573b28;if(!_0x2cc36f['query'][_0x6342('0xa6')]||!utils[_0x6342('0xb9')](_0x2cc36f[_0x6342('0x52')]['channel'])){throw new db[(_0x6342('0x9c'))][(_0x6342('0x9f'))](_0x6342('0xba'));}return _0x573b28['remove'+_[_0x6342('0xad')](_0x2cc36f[_0x6342('0x52')][_0x6342('0xa6')][_0x6342('0xae')]())+_0x6342('0xab')](_0x2cc36f[_0x6342('0x52')][_0x6342('0x71')]);}})[_0x6342('0x24')](function(_0x21b584){for(var _0x471004=0x0;_0x471004<_0x2cc36f[_0x6342('0x52')][_0x6342('0x71')]['length'];_0x471004+=0x1){var _0x2fea30={'UserId':_0x2cc36f['params']['id']};_0x2fea30[_[_0x6342('0xad')](_0x2cc36f[_0x6342('0x52')][_0x6342('0xa6')][_0x6342('0xae')]())+'QueueId']=_0x2cc36f[_0x6342('0x52')][_0x6342('0x71')][_0x471004];socket[_0x6342('0xaf')](_0x6342('0x74')+_[_0x6342('0xad')](_0x2cc36f['query'][_0x6342('0xa6')][_0x6342('0xae')]())+_0x6342('0xbb'),_0x2fea30);}return _0x21b584;})[_0x6342('0x24')](function(){if(_0x2cc36f[_0x6342('0x52')][_0x6342('0xa6')]==='voice'){return db[_0x6342('0xb7')][_0x6342('0xbc')]({'where':{'UserId':_0x2cc36f[_0x6342('0x6b')]['id'],'VoiceQueueId':_0x2cc36f[_0x6342('0x52')][_0x6342('0x71')]},'individualHooks':!![]})[_0x6342('0x24')](function(){return _0x3ca5a6;});}return _0x3ca5a6;})['then'](respondWithStatusCode(_0xa1d8b4,null))[_0x6342('0x69')](handleError(_0xa1d8b4,null));};exports[_0x6342('0xbd')]=function(_0x24f0cb,_0x1f172f,_0x315306){_0x24f0cb[_0x6342('0x6e')][_0x6342('0xbe')]=_0x24f0cb[_0x6342('0xbf')][_0x6342('0xc0')];return db['User']['find']({'where':{'id':_0x24f0cb[_0x6342('0x6b')]['id']}})[_0x6342('0x24')](handleEntityNotFound(_0x1f172f,null))[_0x6342('0x24')](saveUpdates(_0x24f0cb[_0x6342('0x6e')],null))[_0x6342('0x24')](respondWithResult(_0x1f172f,null))['catch'](handleError(_0x1f172f,null));};exports[_0x6342('0xc1')]=function(_0x360da0,_0x6ec881,_0x5d9db5){var _0x7ae41f=path[_0x6342('0xc2')](config['root'],_0x6342('0xc3'));return db[_0x6342('0x4a')][_0x6342('0x44')]({'where':{'id':_0x360da0['params']['id']},'attributes':['id',_0x6342('0xbe')],'raw':!![]})['then'](handleEntityNotFound(_0x6ec881,null))[_0x6342('0x24')](function(_0x50b890){if(_0x50b890){if(_['isNil'](_0x50b890[_0x6342('0xbe')])){return _0x6ec881[_0x6342('0xc4')](_0x7ae41f);}else{if(!fs[_0x6342('0xc5')](path[_0x6342('0xc2')](config['root'],_0x6342('0xc6'),_0x50b890['userpic']))){return _0x6ec881[_0x6342('0xc4')](_0x7ae41f);}return _0x6ec881['download'](path[_0x6342('0xc2')](config[_0x6342('0xc7')],_0x6342('0xc6'),_0x50b890[_0x6342('0xbe')]));}}})[_0x6342('0x69')](handleError(_0x6ec881,null));};exports[_0x6342('0xc8')]=function(_0x4e799a,_0x5ad31e,_0x2c3e40){var _0x51a8af={};var _0x5a6d3f={};var _0x237fce;var _0xa66fad;return db[_0x6342('0x4a')][_0x6342('0xa4')]({'where':{'id':_0x4e799a[_0x6342('0x6b')]['id']}})[_0x6342('0x24')](handleEntityNotFound(_0x5ad31e,null))[_0x6342('0x24')](function(_0x270988){if(_0x270988){_0x237fce=_0x270988;_0x5a6d3f[_0x6342('0x4d')]=_[_0x6342('0x51')](db[_0x6342('0xc9')][_0x6342('0x4b')]);_0x5a6d3f[_0x6342('0x52')]=_[_0x6342('0x51')](_0x4e799a[_0x6342('0x52')]);_0x5a6d3f['filters']=_[_0x6342('0x53')](_0x5a6d3f['model'],_0x5a6d3f[_0x6342('0x52')]);_0x51a8af[_0x6342('0x54')]=_['intersection'](_0x5a6d3f['model'],qs[_0x6342('0x55')](_0x4e799a[_0x6342('0x52')][_0x6342('0x55')]));_0x51a8af['attributes']=_0x51a8af[_0x6342('0x54')][_0x6342('0x6c')]?_0x51a8af[_0x6342('0x54')]:_0x5a6d3f[_0x6342('0x4d')];_0x51a8af[_0x6342('0x59')]=qs[_0x6342('0x5a')](_0x4e799a[_0x6342('0x52')][_0x6342('0x5a')]);_0x51a8af[_0x6342('0x5b')]=qs['filters'](_[_0x6342('0x5c')](_0x4e799a[_0x6342('0x52')],_0x5a6d3f['filters']));if(_0x4e799a[_0x6342('0x52')]['filter']){_0x51a8af[_0x6342('0x5b')]=_[_0x6342('0x5e')](_0x51a8af[_0x6342('0x5b')],{'$or':_['map'](_0x51a8af[_0x6342('0x54')],function(_0x4b4f37){var _0x4993df={};_0x4993df[_0x4b4f37]={'$like':'%'+_0x4e799a[_0x6342('0x52')]['filter']+'%'};return _0x4993df;})});}_0x51a8af=_[_0x6342('0x5e')]({},_0x51a8af,_0x4e799a[_0x6342('0x65')]);return _0x237fce[_0x6342('0xc8')](_0x51a8af);}})[_0x6342('0x24')](function(_0x512de8){if(_0x512de8){_0xa66fad=_0x512de8['length'];if(_0x4e799a[_0x6342('0x52')][_0x6342('0x56')](_0x6342('0x66'))){_0x51a8af[_0x6342('0x67')]=[{'model':db[_0x6342('0xca')],'as':_0x6342('0xcb'),'required':![]},{'model':db[_0x6342('0xcc')],'as':_0x6342('0xcd'),'attributes':['id',_0x6342('0x47'),_0x6342('0xce')],'where':_0x4e799a[_0x6342('0x52')][_0x6342('0xcf')]?{'id':_0x4e799a[_0x6342('0x52')][_0x6342('0xcf')]}:undefined,'required':_0x4e799a[_0x6342('0x52')][_0x6342('0xcf')]?!![]:![]}];}if(!_0x4e799a['query'][_0x6342('0x56')]('nolimit')){_0x51a8af[_0x6342('0x33')]=qs[_0x6342('0x33')](_0x4e799a[_0x6342('0x52')]['limit']);_0x51a8af[_0x6342('0x58')]=qs[_0x6342('0x58')](_0x4e799a['query'][_0x6342('0x58')]);}return _0x237fce[_0x6342('0xc8')](_0x51a8af);}})['then'](function(_0x5781a7){if(_0x5781a7){return _0x5781a7?{'count':_0xa66fad,'rows':_0x5781a7}:null;}})['then'](respondWithResult(_0x5ad31e,null))[_0x6342('0x69')](handleError(_0x5ad31e,null));};exports[_0x6342('0xd0')]=function(_0x57efec,_0x1c5de2,_0x28aa4f){var _0xfcbc05;var _0x1d404b;var _0x34faab={};var _0x17b8e9;return db['User'][_0x6342('0xa4')]({'where':{'id':_0x57efec['params']['id']},'attributes':['id','name','role']})[_0x6342('0x24')](handleEntityNotFound(_0x1c5de2,null))[_0x6342('0x24')](function(_0x15b882){if(!utils[_0x6342('0xb9')](_0x57efec[_0x6342('0x52')]['channel'])){throw new db['Sequelize'][(_0x6342('0x9f'))](_0x6342('0xba'));}_0xfcbc05=_0x15b882;var _0x5c65b8={};_0x5c65b8[_0x6342('0x4d')]=_[_0x6342('0x51')](db[_[_0x6342('0xad')](_0x57efec[_0x6342('0x52')]['channel'])+_0x6342('0xd1')][_0x6342('0x4b')]);_0x5c65b8['query']=_[_0x6342('0x51')](_0x57efec[_0x6342('0x52')]);_0x5c65b8[_0x6342('0x5d')]=_['intersection'](_0x5c65b8['model'],_0x5c65b8[_0x6342('0x52')]);_0x34faab[_0x6342('0x54')]=_[_0x6342('0x53')](_0x5c65b8['model'],qs[_0x6342('0x55')](_0x57efec['query'][_0x6342('0x55')]));_0x34faab[_0x6342('0x54')]=_0x34faab[_0x6342('0x54')][_0x6342('0x6c')]?_0x34faab[_0x6342('0x54')]:_0x5c65b8['model'];_0x34faab[_0x6342('0x59')]=qs[_0x6342('0x5a')](_0x57efec['query'][_0x6342('0x5a')]);_0x34faab[_0x6342('0x5b')]=qs['filters'](_['pick'](_0x57efec[_0x6342('0x52')],_0x5c65b8[_0x6342('0x5d')]));if(_0x57efec[_0x6342('0x52')][_0x6342('0x3f')]){_0x34faab[_0x6342('0x5b')]=_[_0x6342('0x5e')](_0x34faab['where'],{'$or':_[_0x6342('0x41')](_0x34faab[_0x6342('0x54')],function(_0x5ab717){var _0xd63d15={};_0xd63d15[_0x5ab717]={'$like':'%'+_0x57efec[_0x6342('0x52')][_0x6342('0x3f')]+'%'};return _0xd63d15;})});}_0x34faab=_[_0x6342('0x5e')]({},_0x34faab,_0x57efec[_0x6342('0x65')]);switch(_0xfcbc05['role']){case _0x6342('0x73'):return db[_[_0x6342('0xad')](_0x57efec[_0x6342('0x52')][_0x6342('0xa6')])+_0x6342('0xd1')][_0x6342('0xb3')](_0x34faab);case _0x6342('0x74'):case _0x6342('0x3c'):return _0xfcbc05[_0x6342('0x3a')+_[_0x6342('0xad')](_0x57efec[_0x6342('0x52')]['channel'])+'Queues'](_0x34faab);default:throw new db[(_0x6342('0x9c'))][(_0x6342('0x9f'))](_0x6342('0xd2'));}})[_0x6342('0x24')](function(_0x2bacd9){_0x17b8e9=_0x2bacd9[_0x6342('0x6c')];if(!_0x57efec[_0x6342('0x52')][_0x6342('0x56')](_0x6342('0x57'))){_0x34faab[_0x6342('0x33')]=qs['limit'](_0x57efec[_0x6342('0x52')]['limit']);_0x34faab[_0x6342('0x58')]=qs[_0x6342('0x58')](_0x57efec['query'][_0x6342('0x58')]);}switch(_0xfcbc05[_0x6342('0x43')]){case _0x6342('0x73'):return db[_[_0x6342('0xad')](_0x57efec[_0x6342('0x52')][_0x6342('0xa6')])+_0x6342('0xd1')][_0x6342('0xb3')](_0x34faab);case'user':case'agent':return _0xfcbc05[_0x6342('0x3a')+_[_0x6342('0xad')](_0x57efec[_0x6342('0x52')][_0x6342('0xa6')])+'Queues'](_0x34faab);}})[_0x6342('0x24')](function(_0x1e5245){return{'count':_0x17b8e9,'rows':_0x1e5245};})['then'](respondWithResult(_0x1c5de2,null))['catch'](handleError(_0x1c5de2,null));};exports['getVoiceQueuesRt']=function(_0x16a3ab,_0x11c570,_0x135600){var _0x5c46f1={};var _0x39d4f8={};var _0x4a2f7d;var _0x27999e;return db[_0x6342('0x4a')][_0x6342('0xa4')]({'where':{'id':_0x16a3ab[_0x6342('0x6b')]['id']}})[_0x6342('0x24')](handleEntityNotFound(_0x11c570,null))[_0x6342('0x24')](function(_0x193d26){if(_0x193d26){_0x4a2f7d=_0x193d26;_0x39d4f8[_0x6342('0x4d')]=_[_0x6342('0x51')](db[_0x6342('0xb7')][_0x6342('0x4b')]);_0x39d4f8[_0x6342('0x52')]=_[_0x6342('0x51')](_0x16a3ab[_0x6342('0x52')]);_0x39d4f8[_0x6342('0x5d')]=_[_0x6342('0x53')](_0x39d4f8['model'],_0x39d4f8[_0x6342('0x52')]);_0x5c46f1[_0x6342('0x54')]=_[_0x6342('0x53')](_0x39d4f8['model'],qs[_0x6342('0x55')](_0x16a3ab[_0x6342('0x52')]['fields']));_0x5c46f1[_0x6342('0x54')]=_0x5c46f1[_0x6342('0x54')]['length']?_0x5c46f1[_0x6342('0x54')]:_0x39d4f8[_0x6342('0x4d')];_0x5c46f1[_0x6342('0x59')]=qs[_0x6342('0x5a')](_0x16a3ab[_0x6342('0x52')][_0x6342('0x5a')]);_0x5c46f1[_0x6342('0x5b')]=qs[_0x6342('0x5d')](_[_0x6342('0x5c')](_0x16a3ab[_0x6342('0x52')],_0x39d4f8['filters']));if(_0x16a3ab[_0x6342('0x52')]['filter']){_0x5c46f1[_0x6342('0x5b')]=_[_0x6342('0x5e')](_0x5c46f1[_0x6342('0x5b')],{'$or':_[_0x6342('0x41')](_0x5c46f1[_0x6342('0x54')],function(_0x2b11c3){var _0xfb15ec={};_0xfb15ec[_0x2b11c3]={'$like':'%'+_0x16a3ab[_0x6342('0x52')][_0x6342('0x3f')]+'%'};return _0xfb15ec;})});}_0x5c46f1=_[_0x6342('0x5e')]({},_0x5c46f1,_0x16a3ab['options']);return _0x4a2f7d[_0x6342('0xd3')](_0x5c46f1);}})[_0x6342('0x24')](function(_0x3a542c){if(_0x3a542c){_0x27999e=_0x3a542c[_0x6342('0x6c')];if(!_0x16a3ab[_0x6342('0x52')][_0x6342('0x56')](_0x6342('0x57'))){_0x5c46f1['limit']=qs[_0x6342('0x33')](_0x16a3ab['query'][_0x6342('0x33')]);_0x5c46f1['offset']=qs[_0x6342('0x58')](_0x16a3ab['query']['offset']);}return _0x4a2f7d['getVoiceQueuesRt'](_0x5c46f1);}})['then'](function(_0x6f124f){if(_0x6f124f){return _0x6f124f?{'count':_0x27999e,'rows':_0x6f124f}:null;}})[_0x6342('0x24')](respondWithResult(_0x11c570,null))[_0x6342('0x69')](handleError(_0x11c570,null));};exports[_0x6342('0xd4')]=function(_0x5449b1,_0x55e5a4,_0x286588){var _0x5452e9={};var _0x5bee19={};var _0x694de9;var _0x2f9fd4;return db[_0x6342('0x4a')][_0x6342('0xa4')]({'where':{'id':_0x5449b1['params']['id']}})[_0x6342('0x24')](handleEntityNotFound(_0x55e5a4,null))['then'](function(_0x4cabd7){if(_0x4cabd7){_0x694de9=_0x4cabd7;_0x5bee19['model']=_[_0x6342('0x51')](db[_0x6342('0xd5')][_0x6342('0x4b')]);_0x5bee19['query']=_['keys'](_0x5449b1['query']);_0x5bee19[_0x6342('0x5d')]=_[_0x6342('0x53')](_0x5bee19[_0x6342('0x4d')],_0x5bee19['query']);_0x5452e9[_0x6342('0x54')]=_[_0x6342('0x53')](_0x5bee19[_0x6342('0x4d')],qs[_0x6342('0x55')](_0x5449b1[_0x6342('0x52')]['fields']));_0x5452e9[_0x6342('0x54')]=_0x5452e9[_0x6342('0x54')][_0x6342('0x6c')]?_0x5452e9[_0x6342('0x54')]:_0x5bee19[_0x6342('0x4d')];_0x5452e9[_0x6342('0x59')]=qs[_0x6342('0x5a')](_0x5449b1[_0x6342('0x52')][_0x6342('0x5a')]);_0x5452e9[_0x6342('0x5b')]=qs[_0x6342('0x5d')](_[_0x6342('0x5c')](_0x5449b1[_0x6342('0x52')],_0x5bee19['filters']));if(_0x5449b1['query'][_0x6342('0x3f')]){_0x5452e9[_0x6342('0x5b')]=_[_0x6342('0x5e')](_0x5452e9[_0x6342('0x5b')],{'$or':_[_0x6342('0x41')](_0x5452e9[_0x6342('0x54')],function(_0x1f7c70){var _0x2ec1ce={};_0x2ec1ce[_0x1f7c70]={'$like':'%'+_0x5449b1['query'][_0x6342('0x3f')]+'%'};return _0x2ec1ce;})});}_0x5452e9=_[_0x6342('0x5e')]({},_0x5452e9,_0x5449b1[_0x6342('0x65')]);return _0x694de9[_0x6342('0xd4')](_0x5452e9);}})[_0x6342('0x24')](function(_0x3b5e3f){if(_0x3b5e3f){_0x2f9fd4=_0x3b5e3f[_0x6342('0x6c')];if(!_0x5449b1[_0x6342('0x52')][_0x6342('0x56')]('nolimit')){_0x5452e9['limit']=qs[_0x6342('0x33')](_0x5449b1[_0x6342('0x52')]['limit']);_0x5452e9[_0x6342('0x58')]=qs[_0x6342('0x58')](_0x5449b1[_0x6342('0x52')]['offset']);}return _0x694de9[_0x6342('0xd4')](_0x5452e9);}})[_0x6342('0x24')](function(_0x5828da){if(_0x5828da){return _0x5828da?{'count':_0x2f9fd4,'rows':_0x5828da}:null;}})[_0x6342('0x24')](respondWithResult(_0x55e5a4,null))[_0x6342('0x69')](handleError(_0x55e5a4,null));};exports[_0x6342('0xd6')]=function(_0xa6eeba,_0x556ef4,_0x98fdff){var _0xc0cb19={'raw':!![],'where':{}};var _0x17e937={};var _0x350062={'count':0x0,'rows':[]};return db[_0x6342('0x4a')][_0x6342('0xa4')]({'where':{'id':_0xa6eeba[_0x6342('0x6b')]['id']}})[_0x6342('0x24')](handleEntityNotFound(_0x556ef4,null))['then'](function(_0x2e0962){if(_0x2e0962){_0x17e937[_0x6342('0x4d')]=_[_0x6342('0x51')](db['VoiceRecording']['rawAttributes']);_0x17e937[_0x6342('0x52')]=_[_0x6342('0x51')](_0xa6eeba[_0x6342('0x52')]);_0x17e937['filters']=_[_0x6342('0x53')](_0x17e937[_0x6342('0x4d')],_0x17e937[_0x6342('0x52')]);_0xc0cb19[_0x6342('0x54')]=_[_0x6342('0x53')](_0x17e937[_0x6342('0x4d')],qs['fields'](_0xa6eeba['query'][_0x6342('0x55')]));_0xc0cb19['attributes']=_0xc0cb19[_0x6342('0x54')][_0x6342('0x6c')]?_0xc0cb19[_0x6342('0x54')]:_0x17e937[_0x6342('0x4d')];if(!_0xa6eeba[_0x6342('0x52')][_0x6342('0x56')]('nolimit')){_0xc0cb19[_0x6342('0x33')]=qs[_0x6342('0x33')](_0xa6eeba[_0x6342('0x52')][_0x6342('0x33')]);_0xc0cb19[_0x6342('0x58')]=qs[_0x6342('0x58')](_0xa6eeba[_0x6342('0x52')][_0x6342('0x58')]);}_0xc0cb19[_0x6342('0x59')]=qs[_0x6342('0x5a')](_0xa6eeba['query'][_0x6342('0x5a')]);_0xc0cb19['where']=qs['filters'](_['pick'](_0xa6eeba[_0x6342('0x52')],_0x17e937[_0x6342('0x5d')]));_0xc0cb19['where'][_0x6342('0xd7')]=_0x2e0962['id'];if(_0xa6eeba[_0x6342('0x52')]['filter']){_0xc0cb19['where']=_['merge'](_0xc0cb19[_0x6342('0x5b')],{'$or':_[_0x6342('0x41')](_0xc0cb19[_0x6342('0x54')],function(_0x31b23f){var _0x44f945={};_0x44f945[_0x31b23f]={'$like':'%'+_0xa6eeba[_0x6342('0x52')][_0x6342('0x3f')]+'%'};return _0x44f945;})});}_0xc0cb19=_[_0x6342('0x5e')]({},_0xc0cb19,_0xa6eeba['options']);return db[_0x6342('0xd8')][_0x6342('0x32')]({'where':_0xc0cb19[_0x6342('0x5b')]})[_0x6342('0x24')](function(_0x3e2d58){_0x350062['count']=_0x3e2d58;if(_0xa6eeba[_0x6342('0x52')]['includeAll']){_0xc0cb19[_0x6342('0x67')]=[{'all':!![]}];}return db['VoiceRecording'][_0x6342('0xb3')](_0xc0cb19);})[_0x6342('0x24')](function(_0x3bfa63){_0x350062[_0x6342('0x68')]=_0x3bfa63;return _0x350062;});}})[_0x6342('0x24')](respondWithFilteredResult(_0x556ef4,_0xc0cb19))[_0x6342('0x69')](handleError(_0x556ef4,null));};exports['getScreenRecordings']=function(_0xdff1c1,_0x1ff295,_0x563ba6){var _0xf9297f={'raw':!![],'where':{}};var _0x4452bd={};var _0xfb01ec={'count':0x0,'rows':[]};return db[_0x6342('0x4a')][_0x6342('0xa4')]({'where':{'id':_0xdff1c1[_0x6342('0x6b')]['id']}})['then'](handleEntityNotFound(_0x1ff295,null))[_0x6342('0x24')](function(_0x2e37b1){if(_0x2e37b1){_0x4452bd[_0x6342('0x4d')]=_[_0x6342('0x51')](db[_0x6342('0xd9')][_0x6342('0x4b')]);_0x4452bd['query']=_[_0x6342('0x51')](_0xdff1c1['query']);_0x4452bd[_0x6342('0x5d')]=_[_0x6342('0x53')](_0x4452bd[_0x6342('0x4d')],_0x4452bd[_0x6342('0x52')]);_0xf9297f[_0x6342('0x54')]=_[_0x6342('0x53')](_0x4452bd[_0x6342('0x4d')],qs['fields'](_0xdff1c1[_0x6342('0x52')][_0x6342('0x55')]));_0xf9297f['attributes']=_0xf9297f[_0x6342('0x54')][_0x6342('0x6c')]?_0xf9297f[_0x6342('0x54')]:_0x4452bd[_0x6342('0x4d')];if(!_0xdff1c1[_0x6342('0x52')][_0x6342('0x56')](_0x6342('0x57'))){_0xf9297f[_0x6342('0x33')]=qs['limit'](_0xdff1c1[_0x6342('0x52')][_0x6342('0x33')]);_0xf9297f[_0x6342('0x58')]=qs[_0x6342('0x58')](_0xdff1c1[_0x6342('0x52')][_0x6342('0x58')]);}_0xf9297f[_0x6342('0x59')]=qs[_0x6342('0x5a')](_0xdff1c1[_0x6342('0x52')]['sort']);_0xf9297f[_0x6342('0x5b')]=qs[_0x6342('0x5d')](_[_0x6342('0x5c')](_0xdff1c1['query'],_0x4452bd[_0x6342('0x5d')]));_0xf9297f[_0x6342('0x5b')]['UserId']=_0x2e37b1['id'];if(_0xdff1c1['query'][_0x6342('0x3f')]){_0xf9297f['where']=_[_0x6342('0x5e')](_0xf9297f[_0x6342('0x5b')],{'$or':_[_0x6342('0x41')](_0xf9297f[_0x6342('0x54')],function(_0x3dec9c){var _0x193375={};_0x193375[_0x3dec9c]={'$like':'%'+_0xdff1c1[_0x6342('0x52')][_0x6342('0x3f')]+'%'};return _0x193375;})});}_0xf9297f=_[_0x6342('0x5e')]({},_0xf9297f,_0xdff1c1[_0x6342('0x65')]);return db[_0x6342('0xd9')][_0x6342('0x32')]({'where':_0xf9297f['where']})[_0x6342('0x24')](function(_0x6aaa7e){_0xfb01ec[_0x6342('0x32')]=_0x6aaa7e;if(_0xdff1c1[_0x6342('0x52')]['includeAll']){_0xf9297f[_0x6342('0x67')]=[{'all':!![]}];}return db[_0x6342('0xd9')][_0x6342('0xb3')](_0xf9297f);})['then'](function(_0x1d2f0d){_0xfb01ec['rows']=_0x1d2f0d;return _0xfb01ec;});}})[_0x6342('0x24')](respondWithFilteredResult(_0x1ff295,_0xf9297f))[_0x6342('0x69')](handleError(_0x1ff295,null));};exports[_0x6342('0xda')]=function(_0x28f633,_0x4dc04a,_0x1ba776){var _0x49434b={};var _0x5bf471={};var _0x585272;var _0x37853b;return db[_0x6342('0x4a')]['findOne']({'where':{'id':_0x28f633['params']['id']}})['then'](handleEntityNotFound(_0x4dc04a,null))[_0x6342('0x24')](function(_0x5644cf){if(_0x5644cf){_0x585272=_0x5644cf;_0x5bf471[_0x6342('0x4d')]=_['keys'](db['ChatInteraction'][_0x6342('0x4b')]);_0x5bf471[_0x6342('0x52')]=_[_0x6342('0x51')](_0x28f633[_0x6342('0x52')]);_0x5bf471['filters']=_[_0x6342('0x53')](_0x5bf471[_0x6342('0x4d')],_0x5bf471[_0x6342('0x52')]);_0x49434b[_0x6342('0x54')]=_['intersection'](_0x5bf471[_0x6342('0x4d')],qs[_0x6342('0x55')](_0x28f633['query'][_0x6342('0x55')]));_0x49434b[_0x6342('0x54')]=_0x49434b[_0x6342('0x54')][_0x6342('0x6c')]?_0x49434b[_0x6342('0x54')]:_0x5bf471['model'];_0x49434b[_0x6342('0x59')]=qs[_0x6342('0x5a')](_0x28f633[_0x6342('0x52')][_0x6342('0x5a')]);_0x49434b[_0x6342('0x5b')]=qs['filters'](_[_0x6342('0x5c')](_0x28f633[_0x6342('0x52')],_0x5bf471['filters']));if(_0x28f633[_0x6342('0x52')][_0x6342('0x3f')]){_0x49434b[_0x6342('0x5b')]=_[_0x6342('0x5e')](_0x49434b[_0x6342('0x5b')],{'$or':_[_0x6342('0x41')](_0x49434b[_0x6342('0x54')],function(_0x5b8eb7){var _0xe834ac={};_0xe834ac[_0x5b8eb7]={'$like':'%'+_0x28f633[_0x6342('0x52')]['filter']+'%'};return _0xe834ac;})});}_0x49434b=_['merge']({},_0x49434b,_0x28f633[_0x6342('0x65')]);return _0x585272['getChatInteractions'](_0x49434b);}})[_0x6342('0x24')](function(_0x2ba02b){if(_0x2ba02b){_0x37853b=_0x2ba02b[_0x6342('0x6c')];if(!_0x28f633[_0x6342('0x52')][_0x6342('0x56')](_0x6342('0x57'))){_0x49434b['limit']=qs[_0x6342('0x33')](_0x28f633[_0x6342('0x52')][_0x6342('0x33')]);_0x49434b[_0x6342('0x58')]=qs[_0x6342('0x58')](_0x28f633[_0x6342('0x52')]['offset']);}return _0x585272['getChatInteractions'](_0x49434b);}})['then'](function(_0x3311a5){if(_0x3311a5){return _0x3311a5?{'count':_0x37853b,'rows':_0x3311a5}:null;}})[_0x6342('0x24')](respondWithResult(_0x4dc04a,null))[_0x6342('0x69')](handleError(_0x4dc04a,null));};exports[_0x6342('0xdb')]=function(_0xb3fc57,_0x87da95,_0x5202d4){var _0xc21ba4={};var _0x9b3eba={};var _0x4c349c;var _0x11e754;return db[_0x6342('0x4a')][_0x6342('0xa4')]({'where':{'id':_0xb3fc57[_0x6342('0x6b')]['id']}})[_0x6342('0x24')](handleEntityNotFound(_0x87da95,null))[_0x6342('0x24')](function(_0x213a15){if(_0x213a15){_0x4c349c=_0x213a15;_0x9b3eba[_0x6342('0x4d')]=_[_0x6342('0x51')](db[_0x6342('0xdc')]['rawAttributes']);_0x9b3eba['query']=_[_0x6342('0x51')](_0xb3fc57['query']);_0x9b3eba[_0x6342('0x5d')]=_[_0x6342('0x53')](_0x9b3eba[_0x6342('0x4d')],_0x9b3eba[_0x6342('0x52')]);_0xc21ba4[_0x6342('0x54')]=_[_0x6342('0x53')](_0x9b3eba[_0x6342('0x4d')],qs[_0x6342('0x55')](_0xb3fc57[_0x6342('0x52')][_0x6342('0x55')]));_0xc21ba4[_0x6342('0x54')]=_0xc21ba4['attributes'][_0x6342('0x6c')]?_0xc21ba4[_0x6342('0x54')]:_0x9b3eba[_0x6342('0x4d')];_0xc21ba4['order']=qs[_0x6342('0x5a')](_0xb3fc57['query'][_0x6342('0x5a')]);_0xc21ba4[_0x6342('0x5b')]=qs['filters'](_[_0x6342('0x5c')](_0xb3fc57[_0x6342('0x52')],_0x9b3eba[_0x6342('0x5d')]));if(_0xb3fc57[_0x6342('0x52')]['filter']){_0xc21ba4[_0x6342('0x5b')]=_['merge'](_0xc21ba4[_0x6342('0x5b')],{'$or':_[_0x6342('0x41')](_0xc21ba4[_0x6342('0x54')],function(_0x527aa5){var _0x6eaf41={};_0x6eaf41[_0x527aa5]={'$like':'%'+_0xb3fc57[_0x6342('0x52')][_0x6342('0x3f')]+'%'};return _0x6eaf41;})});}_0xc21ba4=_[_0x6342('0x5e')]({},_0xc21ba4,_0xb3fc57['options']);return _0x4c349c[_0x6342('0xdb')](_0xc21ba4);}})[_0x6342('0x24')](function(_0x3ca310){if(_0x3ca310){_0x11e754=_0x3ca310['length'];if(!_0xb3fc57[_0x6342('0x52')][_0x6342('0x56')]('nolimit')){_0xc21ba4['limit']=qs['limit'](_0xb3fc57[_0x6342('0x52')][_0x6342('0x33')]);_0xc21ba4[_0x6342('0x58')]=qs[_0x6342('0x58')](_0xb3fc57['query']['offset']);}return _0x4c349c['getOpenchannelInteractions'](_0xc21ba4);}})['then'](function(_0x2f7848){if(_0x2f7848){return _0x2f7848?{'count':_0x11e754,'rows':_0x2f7848}:null;}})['then'](respondWithResult(_0x87da95,null))['catch'](handleError(_0x87da95,null));};exports[_0x6342('0xdd')]=function(_0x13c5ea,_0x1c9693,_0x5729f6){var _0x26d650={'raw':!![],'where':{}};var _0x4ea41b={};var _0x2303e0={'count':0x0,'rows':[]};return db[_0x6342('0x4a')][_0x6342('0xa4')]({'where':{'id':_0x13c5ea[_0x6342('0x6b')]['id']}})[_0x6342('0x24')](handleEntityNotFound(_0x1c9693,null))[_0x6342('0x24')](function(_0x521646){if(_0x521646){_0x4ea41b[_0x6342('0x4d')]=_[_0x6342('0x51')](db[_0x6342('0xde')][_0x6342('0x4b')]);_0x4ea41b[_0x6342('0x52')]=_[_0x6342('0x51')](_0x13c5ea[_0x6342('0x52')]);_0x4ea41b['filters']=_[_0x6342('0x53')](_0x4ea41b[_0x6342('0x4d')],_0x4ea41b['query']);_0x26d650['attributes']=_[_0x6342('0x53')](_0x4ea41b[_0x6342('0x4d')],qs[_0x6342('0x55')](_0x13c5ea[_0x6342('0x52')][_0x6342('0x55')]));_0x26d650[_0x6342('0x54')]=_0x26d650[_0x6342('0x54')][_0x6342('0x6c')]?_0x26d650[_0x6342('0x54')]:_0x4ea41b['model'];if(!_0x13c5ea[_0x6342('0x52')]['hasOwnProperty'](_0x6342('0x57'))){_0x26d650[_0x6342('0x33')]=qs[_0x6342('0x33')](_0x13c5ea['query']['limit']);_0x26d650[_0x6342('0x58')]=qs['offset'](_0x13c5ea[_0x6342('0x52')][_0x6342('0x58')]);}_0x26d650[_0x6342('0x59')]=qs[_0x6342('0x5a')](_0x13c5ea[_0x6342('0x52')]['sort']);_0x26d650[_0x6342('0x5b')]=qs[_0x6342('0x5d')](_['pick'](_0x13c5ea[_0x6342('0x52')],_0x4ea41b[_0x6342('0x5d')]));_0x26d650[_0x6342('0x5b')][_0x6342('0xd7')]=_0x521646['id'];if(_0x13c5ea['query']['filter']){_0x26d650['where']=_['merge'](_0x26d650[_0x6342('0x5b')],{'$or':_[_0x6342('0x41')](_0x26d650[_0x6342('0x54')],function(_0x372819){var _0xe6a6bf={};_0xe6a6bf[_0x372819]={'$like':'%'+_0x13c5ea[_0x6342('0x52')][_0x6342('0x3f')]+'%'};return _0xe6a6bf;})});}_0x26d650=_[_0x6342('0x5e')]({},_0x26d650,_0x13c5ea['options']);return db[_0x6342('0xde')][_0x6342('0x32')]({'where':_0x26d650[_0x6342('0x5b')]})[_0x6342('0x24')](function(_0x733eac){_0x2303e0[_0x6342('0x32')]=_0x733eac;if(_0x13c5ea[_0x6342('0x52')]['includeAll']){_0x26d650[_0x6342('0x67')]=[{'all':!![]}];}return db[_0x6342('0xde')][_0x6342('0xb3')](_0x26d650);})[_0x6342('0x24')](function(_0x4dea77){_0x2303e0[_0x6342('0x68')]=_0x4dea77;return _0x2303e0;});}})[_0x6342('0x24')](respondWithFilteredResult(_0x1c9693,_0x26d650))['catch'](handleError(_0x1c9693,null));};exports[_0x6342('0xdf')]=function(_0x559933,_0x2d9f7d,_0x574660){var _0x28e976={};var _0x3cd581={};var _0x45a651;var _0x48b488;return db[_0x6342('0x4a')][_0x6342('0xa4')]({'where':{'id':_0x559933[_0x6342('0x6b')]['id']}})['then'](handleEntityNotFound(_0x2d9f7d,null))[_0x6342('0x24')](function(_0x163bee){if(_0x163bee){_0x45a651=_0x163bee;_0x3cd581[_0x6342('0x4d')]=_[_0x6342('0x51')](db['SmsInteraction'][_0x6342('0x4b')]);_0x3cd581[_0x6342('0x52')]=_[_0x6342('0x51')](_0x559933[_0x6342('0x52')]);_0x3cd581['filters']=_[_0x6342('0x53')](_0x3cd581['model'],_0x3cd581[_0x6342('0x52')]);_0x28e976[_0x6342('0x54')]=_['intersection'](_0x3cd581['model'],qs[_0x6342('0x55')](_0x559933['query'][_0x6342('0x55')]));_0x28e976['attributes']=_0x28e976[_0x6342('0x54')][_0x6342('0x6c')]?_0x28e976[_0x6342('0x54')]:_0x3cd581[_0x6342('0x4d')];_0x28e976[_0x6342('0x59')]=qs[_0x6342('0x5a')](_0x559933[_0x6342('0x52')]['sort']);_0x28e976['where']=qs[_0x6342('0x5d')](_[_0x6342('0x5c')](_0x559933[_0x6342('0x52')],_0x3cd581[_0x6342('0x5d')]));if(_0x559933['query'][_0x6342('0x3f')]){_0x28e976[_0x6342('0x5b')]=_['merge'](_0x28e976['where'],{'$or':_['map'](_0x28e976[_0x6342('0x54')],function(_0x189438){var _0x1469b3={};_0x1469b3[_0x189438]={'$like':'%'+_0x559933['query'][_0x6342('0x3f')]+'%'};return _0x1469b3;})});}_0x28e976=_[_0x6342('0x5e')]({},_0x28e976,_0x559933[_0x6342('0x65')]);return _0x45a651['getSmsInteractions'](_0x28e976);}})[_0x6342('0x24')](function(_0x38627e){if(_0x38627e){_0x48b488=_0x38627e['length'];if(!_0x559933[_0x6342('0x52')]['hasOwnProperty'](_0x6342('0x57'))){_0x28e976['limit']=qs[_0x6342('0x33')](_0x559933['query']['limit']);_0x28e976['offset']=qs[_0x6342('0x58')](_0x559933['query'][_0x6342('0x58')]);}return _0x45a651[_0x6342('0xdf')](_0x28e976);}})['then'](function(_0x1f213d){if(_0x1f213d){return _0x1f213d?{'count':_0x48b488,'rows':_0x1f213d}:null;}})[_0x6342('0x24')](respondWithResult(_0x2d9f7d,null))[_0x6342('0x69')](handleError(_0x2d9f7d,null));};exports['getFaxInteractions']=function(_0x544cc3,_0x1f990a,_0x4a0955){var _0x5973de={};var _0x20ca70={};var _0x24f61b;var _0x144771;return db[_0x6342('0x4a')][_0x6342('0xa4')]({'where':{'id':_0x544cc3[_0x6342('0x6b')]['id']}})[_0x6342('0x24')](handleEntityNotFound(_0x1f990a,null))[_0x6342('0x24')](function(_0x2d90f6){if(_0x2d90f6){_0x24f61b=_0x2d90f6;_0x20ca70[_0x6342('0x4d')]=_[_0x6342('0x51')](db[_0x6342('0xe0')]['rawAttributes']);_0x20ca70[_0x6342('0x52')]=_['keys'](_0x544cc3[_0x6342('0x52')]);_0x20ca70['filters']=_[_0x6342('0x53')](_0x20ca70[_0x6342('0x4d')],_0x20ca70[_0x6342('0x52')]);_0x5973de['attributes']=_['intersection'](_0x20ca70['model'],qs[_0x6342('0x55')](_0x544cc3['query'][_0x6342('0x55')]));_0x5973de[_0x6342('0x54')]=_0x5973de[_0x6342('0x54')][_0x6342('0x6c')]?_0x5973de[_0x6342('0x54')]:_0x20ca70[_0x6342('0x4d')];_0x5973de[_0x6342('0x59')]=qs[_0x6342('0x5a')](_0x544cc3[_0x6342('0x52')]['sort']);_0x5973de[_0x6342('0x5b')]=qs[_0x6342('0x5d')](_[_0x6342('0x5c')](_0x544cc3[_0x6342('0x52')],_0x20ca70[_0x6342('0x5d')]));if(_0x544cc3[_0x6342('0x52')][_0x6342('0x3f')]){_0x5973de[_0x6342('0x5b')]=_[_0x6342('0x5e')](_0x5973de['where'],{'$or':_[_0x6342('0x41')](_0x5973de[_0x6342('0x54')],function(_0x2c5d99){var _0x155997={};_0x155997[_0x2c5d99]={'$like':'%'+_0x544cc3[_0x6342('0x52')][_0x6342('0x3f')]+'%'};return _0x155997;})});}_0x5973de=_[_0x6342('0x5e')]({},_0x5973de,_0x544cc3[_0x6342('0x65')]);return _0x24f61b['getFaxInteractions'](_0x5973de);}})[_0x6342('0x24')](function(_0xf34986){if(_0xf34986){_0x144771=_0xf34986['length'];if(!_0x544cc3[_0x6342('0x52')][_0x6342('0x56')](_0x6342('0x57'))){_0x5973de[_0x6342('0x33')]=qs['limit'](_0x544cc3[_0x6342('0x52')][_0x6342('0x33')]);_0x5973de[_0x6342('0x58')]=qs[_0x6342('0x58')](_0x544cc3[_0x6342('0x52')][_0x6342('0x58')]);}return _0x24f61b[_0x6342('0xe1')](_0x5973de);}})[_0x6342('0x24')](function(_0x145582){if(_0x145582){return _0x145582?{'count':_0x144771,'rows':_0x145582}:null;}})[_0x6342('0x24')](respondWithResult(_0x1f990a,null))[_0x6342('0x69')](handleError(_0x1f990a,null));};exports[_0x6342('0xe2')]=function(_0x551488,_0x4a3a40,_0x2621c7){var _0xbd7cf1;var _0x3aca6b;var _0x1a998c;var _0x4a95c1=!_[_0x6342('0x79')](_0x551488['params']['id'])?_0x551488['params']['id']:!_['isNil'](_0x551488[_0x6342('0x74')]['id'])?_0x551488[_0x6342('0x74')]['id']:null;return db[_0x6342('0x4a')][_0x6342('0x44')]({'where':{'id':_0x4a95c1,'role':'agent'},'attributes':['id',_0x6342('0x47'),_0x6342('0xe3'),_0x6342('0xe4'),_0x6342('0x43'),_0x6342('0x82'),_0x6342('0xe5')]})[_0x6342('0x24')](handleEntityNotFound(_0x4a3a40,null))[_0x6342('0x24')](function(_0x4071a0){if(_0x4071a0){_0xbd7cf1=_0x4071a0;if(_0x551488[_0x6342('0x6e')][_0x6342('0xa9')]){_0x1a998c=util[_0x6342('0x7b')](_0x6342('0xe6'),_0xbd7cf1[_0x551488[_0x6342('0x6e')][_0x6342('0xa9')]]);}else if(_0x551488[_0x6342('0x6e')]['intrf']){_0x1a998c=util[_0x6342('0x7b')](_0x6342('0xb4'),_0x551488[_0x6342('0x6e')][_0x6342('0xe7')]);}else{_0x1a998c=util['format'](_0x6342('0xb4'),_0xbd7cf1[_0x6342('0x47')]);}socket['to'](util[_0x6342('0x7b')](_0x6342('0xe8'),_0xbd7cf1['name']))[_0x6342('0xaf')](_0x6342('0xe9'),{'ip':_0x551488[_0x6342('0xea')][_0x6342('0xeb')]||_0x551488[_0x6342('0xec')][_0x6342('0xed')]||_0x551488[_0x6342('0xee')][_0x6342('0xed')]||_0x551488[_0x6342('0xec')][_0x6342('0xee')][_0x6342('0xed')]});return db[_0x6342('0xb7')][_0x6342('0xbc')]({'where':{'membername':_0xbd7cf1['name']},'individualHooks':!![]});}})[_0x6342('0x24')](function(_0x415988){if(_0xbd7cf1){return _0xbd7cf1['getVoiceQueues']({'raw':!![]});}})[_0x6342('0x24')](function(_0x5e4a69){var _0xfa8897=[];if(_0x5e4a69){_0x3aca6b=_0x5e4a69;if(_0x3aca6b[_0x6342('0x6c')]){for(var _0x5edb32=0x0;_0x5edb32<_0x3aca6b[_0x6342('0x6c')];_0x5edb32++){_0xfa8897[_0x6342('0xef')]({'membername':_0xbd7cf1[_0x6342('0x47')],'UserId':_0xbd7cf1['id'],'queue_name':_0x3aca6b[_0x5edb32][_0x6342('0x47')],'VoiceQueueId':_0x3aca6b[_0x5edb32]['id'],'interface':_0x1a998c,'paused':_0xbd7cf1[_0x6342('0xe5')]||![],'penalty':_0x3aca6b[_0x5edb32]['UserVoiceQueue.penalty']||0x0});}return BPromise['each'](_0xfa8897,function(_0x2514c5){return db[_0x6342('0xb7')]['upsert'](_0x2514c5);});}}})['then'](function(){return db[_0x6342('0xf0')]['findAll']({'where':{'membername':_0xbd7cf1[_0x6342('0x47')],'exitAt':null}});})[_0x6342('0x24')](function(_0x478f51){var _0x24ae85=[];_0x478f51[_0x6342('0xf1')](function(_0x4fc96c){_0x24ae85[_0x6342('0xef')](_0x4fc96c[_0x6342('0x39')]({'exitAt':moment()[_0x6342('0x7b')](_0x6342('0xf2'))}));});return BPromise['all'](_0x24ae85);})[_0x6342('0x24')](function(){var _0x27c457=[];var _0x515f25=[];var _0x2c4d55=utils[_0x6342('0xf3')]();var _0x383c29={'membername':_0xbd7cf1['name'],'interface':_0x1a998c,'enterAt':moment()[_0x6342('0x7b')](_0x6342('0xf2')),'role':_0xbd7cf1[_0x6342('0x43')],'internal':_0xbd7cf1[_0x6342('0x82')]};_0x2c4d55[_0x6342('0xf1')](function(_0x5ab697){_0x27c457['push'](_[_0x6342('0x5e')]({'channel':_0x5ab697,'type':'LOGIN','data1':_0x551488[_0x6342('0x6e')][_0x6342('0xf4')],'data2':_0x1a998c},_0x383c29));if(_0xbd7cf1[_0x6342('0xe5')]){_0x515f25[_0x6342('0xef')](_[_0x6342('0x5e')]({'channel':_0x5ab697,'type':_0x6342('0xf5'),'data1':_0x6342('0xf6')},_0x383c29));}});return db[_0x6342('0xf0')][_0x6342('0x6d')](_0x27c457[_0x6342('0xf7')](_0x515f25),{'individualHooks':!![]});})['then'](function(){return _0xbd7cf1['update']({'online':!![],'lastLoginAt':moment()['format'](_0x6342('0xf2')),'voicePause':_0xbd7cf1[_0x6342('0xe5')]||![],'mailPause':_0xbd7cf1[_0x6342('0xe5')]||![],'chatPause':_0xbd7cf1[_0x6342('0xe5')]||![],'faxPause':_0xbd7cf1['loginInPause']||![],'smsPause':_0xbd7cf1[_0x6342('0xe5')]||![],'openchannelPause':_0xbd7cf1[_0x6342('0xe5')]||![],'pauseType':_0xbd7cf1[_0x6342('0xe5')]?_0x6342('0xf6'):null,'interface':_0x1a998c,'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});})['then'](function(_0xc4b150){if(_0x551488[_0x6342('0xf8')]){return _0x2621c7();}else{return BPromise[_0x6342('0xf9')](_0xc4b150)['then'](respondWithResult(_0x4a3a40,null));}})[_0x6342('0x69')](handleError(_0x4a3a40,null));};exports[_0x6342('0xfa')]=function(_0x427cfd,_0x1e4746,_0x42058c){var _0x57cb86;return db[_0x6342('0x4a')][_0x6342('0x44')]({'where':{'id':_0x427cfd['params']['id'],'role':_0x6342('0x3c')},'attributes':['id','name',_0x6342('0x43')]})[_0x6342('0x24')](handleEntityNotFound(_0x1e4746,null))[_0x6342('0x24')](function(_0x46819b){if(_0x46819b){_0x57cb86=_0x46819b;return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x57cb86[_0x6342('0x47')]},'individualHooks':!![]});}})[_0x6342('0x24')](function(){return db[_0x6342('0xf0')][_0x6342('0xb3')]({'where':{'membername':_0x57cb86[_0x6342('0x47')],'exitAt':null}});})[_0x6342('0x24')](function(_0x8db691){var _0x48fbc0=[];_0x8db691[_0x6342('0xf1')](function(_0x20b6ed){_0x48fbc0[_0x6342('0xef')](_0x20b6ed[_0x6342('0x39')]({'exitAt':moment()['format'](_0x6342('0xf2'))}));});return BPromise[_0x6342('0xfb')](_0x48fbc0);})[_0x6342('0x24')](function(){return _0x57cb86[_0x6342('0x39')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'interface':null});})[_0x6342('0x24')](respondWithResult(_0x1e4746,null))[_0x6342('0x69')](handleError(_0x1e4746,null));};exports[_0x6342('0xfc')]=function(_0x3ecba5,_0x31dbc4,_0x4f59e4){var _0x4e2890;return db['UserVoiceQueueRt'][_0x6342('0x39')]({'paused':0x1},{'where':{'UserId':_0x3ecba5['params']['id']},'individualHooks':!![]})[_0x6342('0x24')](function(){return db['User'][_0x6342('0x44')]({'where':{'id':_0x3ecba5[_0x6342('0x6b')]['id'],'role':_0x6342('0x3c')},'attributes':['id','name','role',_0x6342('0x82'),_0x6342('0xa9')]});})['then'](handleEntityNotFound(_0x31dbc4,null))[_0x6342('0x24')](function(_0x4ddb40){if(_0x4ddb40){_0x4e2890=_0x4ddb40;return respondWithRpcPromise(_0x6342('0xfd'),_0x6342('0xfc'),{'id':_0x4e2890['id'],'name':_0x4e2890[_0x6342('0x47')],'pause':!![]});}})[_0x6342('0x24')](function(){if(_0x4e2890){return db['MemberReport']['findAll']({'where':{'membername':_0x4e2890[_0x6342('0x47')],'type':_0x6342('0xf5'),'exitAt':null}});}})[_0x6342('0x24')](function(_0x3d8672){if(_0x3d8672['length']){var _0x421c9e=moment()[_0x6342('0x7b')](_0x6342('0xf2'));for(var _0x151d42=0x0,_0x545e26=_0x3d8672[_0x6342('0x6c')];_0x151d42<_0x545e26;_0x151d42++){_0x3d8672[_0x151d42][_0x6342('0xfe')]({'exitAt':_0x421c9e});}}})['then'](function(){var _0x4f6061=[];var _0x3cfad3=utils[_0x6342('0xf3')]();_0x3cfad3[_0x6342('0xf1')](function(_0x2ffe76){_0x4f6061[_0x6342('0xef')]({'channel':_0x2ffe76,'membername':_0x4e2890['name'],'interface':_['isNil'](_0x4e2890['interface'])?util['format'](_0x6342('0xb4'),_0x4e2890[_0x6342('0x47')]):_0x4e2890[_0x6342('0xa9')],'type':_0x6342('0xf5'),'enterAt':moment()['format'](_0x6342('0xf2')),'data1':_0x3ecba5['body']['type']||_0x6342('0xff'),'role':_0x4e2890['role'],'internal':_0x4e2890[_0x6342('0x82')]});});return db[_0x6342('0xf0')][_0x6342('0x6d')](_0x4f6061,{'individualHooks':!![]});})[_0x6342('0x24')](function(){return _0x4e2890['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x3ecba5['body']['type']||_0x6342('0xff'),'lastPauseAt':moment()[_0x6342('0x7b')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0x6342('0x24')](respondWithResult(_0x31dbc4,null))[_0x6342('0x69')](handleError(_0x31dbc4,null));};exports[_0x6342('0x100')]=function(_0x15b0eb,_0x1f16ce,_0x3e082b){var _0x2df8f5;return db['User'][_0x6342('0x44')]({'where':{'id':_0x15b0eb['params']['id']},'attributes':['id',_0x6342('0x47'),'role',_0x6342('0xa8'),_0x6342('0x101'),_0x6342('0x102'),_0x6342('0x103'),_0x6342('0x104'),_0x6342('0x105'),_0x6342('0x106'),'lastPauseAt']})['then'](handleEntityNotFound(_0x1f16ce,null))[_0x6342('0x24')](function(_0x159f76){if(_0x159f76){_0x2df8f5=_0x159f76;if(_0x15b0eb['body'][_0x6342('0xa6')]&&!utils[_0x6342('0xb9')](_0x15b0eb[_0x6342('0x6e')][_0x6342('0xa6')])){throw new db['Sequelize'][(_0x6342('0x9f'))](_0x6342('0xba'));}switch(_0x15b0eb['body']['channel']){case _0x6342('0xb1'):return respondWithRpcPromise(_0x6342('0xfd'),_0x6342('0x100'),{'id':_0x2df8f5['id'],'name':_0x2df8f5[_0x6342('0x47')],'pause':![]})['then'](function(){return db['UserVoiceQueueRt']['update']({'paused':0x0},{'where':{'UserId':_0x2df8f5['id']},'individualHooks':!![]});})[_0x6342('0x24')](function(){return db[_0x6342('0xf0')][_0x6342('0x44')]({'where':{'channel':_0x15b0eb[_0x6342('0x6e')][_0x6342('0xa6')],'membername':_0x2df8f5['name'],'type':_0x6342('0xf5'),'exitAt':null}});})[_0x6342('0x24')](function(_0x4fcb03){if(_0x4fcb03){return _0x4fcb03['update']({'exitAt':moment()[_0x6342('0x7b')](_0x6342('0xf2')),'data2':'manual'},{'individualHooks':!![]});}return null;})[_0x6342('0x24')](function(){return _0x2df8f5[_0x6342('0x39')]({'voicePause':![]});});case _0x6342('0x107'):case _0x6342('0x108'):case'fax':case _0x6342('0x109'):case _0x6342('0x10a'):return db[_0x6342('0xf0')][_0x6342('0x44')]({'where':{'channel':_0x15b0eb[_0x6342('0x6e')][_0x6342('0xa6')],'membername':_0x2df8f5[_0x6342('0x47')],'type':_0x6342('0xf5'),'exitAt':null}})['then'](function(_0x430ef4){if(_0x430ef4){return _0x430ef4[_0x6342('0x39')]({'exitAt':moment()[_0x6342('0x7b')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x6342('0x10b')},{'individualHooks':!![]});}return null;})[_0x6342('0x24')](function(){var _0x4b6154={};_[_0x6342('0x34')](_0x4b6154,util[_0x6342('0x7b')](_0x6342('0x10c'),_0x15b0eb[_0x6342('0x6e')][_0x6342('0xa6')],_0x6342('0x10d')),![]);return _0x2df8f5[_0x6342('0x39')](_0x4b6154);});default:return respondWithRpcPromise(_0x6342('0xfd'),'unpause',{'id':_0x2df8f5['id'],'name':_0x2df8f5[_0x6342('0x47')],'pause':![]})['then'](function(){return db[_0x6342('0xb7')]['update']({'paused':0x0},{'where':{'UserId':_0x2df8f5['id']}});})[_0x6342('0x24')](function(){return db[_0x6342('0xf0')][_0x6342('0xb3')]({'where':{'membername':_0x2df8f5[_0x6342('0x47')],'type':_0x6342('0xf5'),'exitAt':null}});})[_0x6342('0x24')](function(_0x4baf9a){var _0x5ae435=[];_0x4baf9a[_0x6342('0xf1')](function(_0x5b50aa){_0x5ae435['push'](_0x5b50aa[_0x6342('0x39')]({'exitAt':moment()[_0x6342('0x7b')](_0x6342('0xf2')),'data2':'manual'}));});return BPromise[_0x6342('0xfb')](_0x5ae435);})[_0x6342('0x24')](function(){return _0x2df8f5[_0x6342('0x39')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})['then'](respondWithResult(_0x1f16ce,null))['catch'](handleError(_0x1f16ce,null));};exports['getTeams']=function(_0x3047a7,_0x1e640c,_0x4c6f8a){var _0x44cdad={};var _0x57ae5c={};var _0x51f428;var _0x145a48;return db[_0x6342('0x4a')][_0x6342('0xa4')]({'where':{'id':_0x3047a7[_0x6342('0x6b')]['id']}})[_0x6342('0x24')](handleEntityNotFound(_0x1e640c,null))['then'](function(_0xc00e7e){if(_0xc00e7e){_0x51f428=_0xc00e7e;_0x57ae5c[_0x6342('0x4d')]=_['keys'](db[_0x6342('0x10e')][_0x6342('0x4b')]);_0x57ae5c[_0x6342('0x52')]=_['keys'](_0x3047a7['query']);_0x57ae5c[_0x6342('0x5d')]=_[_0x6342('0x53')](_0x57ae5c[_0x6342('0x4d')],_0x57ae5c['query']);_0x44cdad[_0x6342('0x54')]=_['intersection'](_0x57ae5c[_0x6342('0x4d')],qs['fields'](_0x3047a7[_0x6342('0x52')][_0x6342('0x55')]));_0x44cdad[_0x6342('0x54')]=_0x44cdad['attributes'][_0x6342('0x6c')]?_0x44cdad[_0x6342('0x54')]:_0x57ae5c[_0x6342('0x4d')];_0x44cdad['order']=qs[_0x6342('0x5a')](_0x3047a7[_0x6342('0x52')][_0x6342('0x5a')]);_0x44cdad[_0x6342('0x5b')]=qs[_0x6342('0x5d')](_[_0x6342('0x5c')](_0x3047a7[_0x6342('0x52')],_0x57ae5c[_0x6342('0x5d')]));if(_0x3047a7[_0x6342('0x52')][_0x6342('0x3f')]){_0x44cdad[_0x6342('0x5b')]=_['merge'](_0x44cdad['where'],{'$or':_[_0x6342('0x41')](_0x44cdad[_0x6342('0x54')],function(_0x5c53fc){var _0x4ff543={};_0x4ff543[_0x5c53fc]={'$like':'%'+_0x3047a7[_0x6342('0x52')][_0x6342('0x3f')]+'%'};return _0x4ff543;})});}_0x44cdad=_[_0x6342('0x5e')]({},_0x44cdad,_0x3047a7[_0x6342('0x65')]);return _0x51f428[_0x6342('0x10f')](_0x44cdad);}})['then'](function(_0xc753cb){if(_0xc753cb){_0x145a48=_0xc753cb[_0x6342('0x6c')];if(!_0x3047a7[_0x6342('0x52')]['hasOwnProperty'](_0x6342('0x57'))){_0x44cdad[_0x6342('0x33')]=qs['limit'](_0x3047a7[_0x6342('0x52')][_0x6342('0x33')]);_0x44cdad['offset']=qs[_0x6342('0x58')](_0x3047a7[_0x6342('0x52')][_0x6342('0x58')]);}return _0x51f428[_0x6342('0x10f')](_0x44cdad);}})[_0x6342('0x24')](function(_0x59ccc9){if(_0x59ccc9){return _0x59ccc9?{'count':_0x145a48,'rows':_0x59ccc9}:null;}})[_0x6342('0x24')](respondWithResult(_0x1e640c,null))[_0x6342('0x69')](handleError(_0x1e640c,null));};exports[_0x6342('0x110')]=function(_0x202bb2,_0x1ec66c){return db[_0x6342('0x4a')][_0x6342('0x44')]({'where':{'id':_0x202bb2[_0x6342('0x6b')]['id']}})[_0x6342('0x24')](handleEntityNotFound(_0x1ec66c,null))['then'](function(_0x5b4edd){if(_0x5b4edd){var _0x1110bf=_0x5b4edd['get']({'plain':!![]});return _0x5b4edd['addTeams'](_0x202bb2[_0x6342('0x6e')][_0x6342('0x71')],_[_0x6342('0x72')](_0x202bb2['body'],[_0x6342('0x71'),'id'])||{})[_0x6342('0x24')](function(){for(var _0x5b7c72=0x0;_0x5b7c72<_0x202bb2[_0x6342('0x6e')]['ids'][_0x6342('0x6c')];_0x5b7c72++){var _0x127756=[];db['Team'][_0x6342('0xa4')]({'where':{'id':_0x202bb2[_0x6342('0x6e')][_0x6342('0x71')][_0x5b7c72]}})[_0x6342('0x24')](function(_0x5271ca){_0x127756[_0x6342('0xef')](_0x5271ca['getVoiceQueues']()['then'](function(_0x525e5c){for(var _0xe7367c=0x0;_0xe7367c<_0x525e5c[_0x6342('0x6c')];_0xe7367c++){_0x525e5c[_0xe7367c][_0x6342('0x111')](_0x6342('0xa6'),_0x6342('0x112'));}return _0x525e5c;}));_0x127756[_0x6342('0xef')](_0x5271ca[_0x6342('0x113')]()[_0x6342('0x24')](function(_0x40268c){for(var _0x4b6cbd=0x0;_0x4b6cbd<_0x40268c['length'];_0x4b6cbd++){_0x40268c[_0x4b6cbd][_0x6342('0x111')](_0x6342('0xa6'),_0x6342('0x114'));}return _0x40268c;}));_0x127756['push'](_0x5271ca['getMailQueues']()['then'](function(_0x765103){for(var _0x4e3582=0x0;_0x4e3582<_0x765103[_0x6342('0x6c')];_0x4e3582++){_0x765103[_0x4e3582]['setDataValue'](_0x6342('0xa6'),'Mail');}return _0x765103;}));_0x127756[_0x6342('0xef')](_0x5271ca[_0x6342('0x115')]()[_0x6342('0x24')](function(_0x4575c5){for(var _0x20742f=0x0;_0x20742f<_0x4575c5[_0x6342('0x6c')];_0x20742f++){_0x4575c5[_0x20742f][_0x6342('0x111')]('channel',_0x6342('0x116'));}return _0x4575c5;}));_0x127756[_0x6342('0xef')](_0x5271ca[_0x6342('0x117')]()[_0x6342('0x24')](function(_0x281fb5){for(var _0x3124d5=0x0;_0x3124d5<_0x281fb5[_0x6342('0x6c')];_0x3124d5++){_0x281fb5[_0x3124d5][_0x6342('0x111')](_0x6342('0xa6'),'Fax');}return _0x281fb5;}));_0x127756['push'](_0x5271ca['getOpenchannelQueues']()[_0x6342('0x24')](function(_0x1c1b9a){for(var _0x1833fa=0x0;_0x1833fa<_0x1c1b9a[_0x6342('0x6c')];_0x1833fa++){_0x1c1b9a[_0x1833fa]['setDataValue'](_0x6342('0xa6'),_0x6342('0x118'));}return _0x1c1b9a;}));return BPromise[_0x6342('0xfb')](_0x127756);})['then'](function(_0x2604d4){var _0x1be179=_[_0x6342('0x119')](_0x2604d4);_0x127756=[];return db[_0x6342('0x61')][_0x6342('0x11a')](function(_0xfc3bf2){for(var _0xcdcf44=0x0;_0xcdcf44<_0x1be179[_0x6342('0x6c')];_0xcdcf44++){_0x127756['push'](_0x1be179[_0xcdcf44][_0x6342('0x11b')](_0x1110bf['id']),{'transaction':_0xfc3bf2});}return BPromise['all'](_0x127756)[_0x6342('0x24')](function(){if(_0x1110bf['online']){return BPromise[_0x6342('0xb6')](_[_0x6342('0x3f')](_0x1be179,function(_0x250c86){return _0x250c86[_0x6342('0x11c')](_0x6342('0xa6'))===_0x6342('0x112');}),function(_0x4d689b){return db[_0x6342('0xb7')][_0x6342('0xb8')]({'membername':_0x1110bf['name'],'UserId':_0x1110bf['id'],'queue_name':_0x4d689b[_0x6342('0x47')],'VoiceQueueId':_0x4d689b['id'],'interface':_[_0x6342('0x79')](_0x1110bf[_0x6342('0xa9')])?util['format'](_0x6342('0xb4'),_0x1110bf[_0x6342('0x47')]):_0x1110bf[_0x6342('0xa9')],'paused':_0x1110bf[_0x6342('0xa8')]||![],'penalty':_0x1110bf[_0x6342('0xb5')]},{'transaction':_0xfc3bf2});});}else{return;}})[_0x6342('0x24')](function(){for(var _0x877723=0x0;_0x877723<_0x1be179[_0x6342('0x6c')];_0x877723++){var _0x444678=_0x1be179[_0x877723][_0x6342('0x11c')](_0x6342('0xa6'));var _0x501284=_0x444678+_0x6342('0x11d');socket[_0x6342('0xaf')](_0x6342('0x74')+_0x444678+_0x6342('0xb0'),{'UserId':_0x1110bf['id'],['queueField']:_0x1be179[_0x877723]['id']});}});});});}});}})[_0x6342('0x24')](respondWithStatusCode(_0x1ec66c,null))[_0x6342('0x69')](handleError(_0x1ec66c,null));};exports['removeTeams']=function(_0x45c6ab,_0x29a8f7){return db[_0x6342('0x4a')][_0x6342('0xa4')]({'where':{'id':_0x45c6ab['params']['id']}})[_0x6342('0x24')](handleEntityNotFound(_0x29a8f7,null))[_0x6342('0x24')](function(_0xd78331){if(_0xd78331){var _0x64a249=_0xd78331[_0x6342('0x3a')]({'plain':!![]});var _0x5a307c=_0x45c6ab[_0x6342('0x52')][_0x6342('0x71')];return _0xd78331[_0x6342('0x11e')](_0x5a307c)[_0x6342('0x24')](function(){for(var _0x4515df=0x0;_0x4515df<_0x5a307c[_0x6342('0x6c')];_0x4515df++){var _0x5ed19b=[];db[_0x6342('0x10e')]['findOne']({'where':{'id':_0x5a307c[_0x4515df]}})[_0x6342('0x24')](function(_0x4efd04){_0x5ed19b[_0x6342('0xef')](_0x4efd04[_0x6342('0x11f')]()['then'](function(_0x517d7b){for(var _0x10d8a9=0x0;_0x10d8a9<_0x517d7b[_0x6342('0x6c')];_0x10d8a9++){_0x517d7b[_0x10d8a9][_0x6342('0x111')](_0x6342('0xa6'),_0x6342('0x112'));}return _0x517d7b;}));_0x5ed19b[_0x6342('0xef')](_0x4efd04[_0x6342('0x113')]()[_0x6342('0x24')](function(_0x18631a){for(var _0x5c80fd=0x0;_0x5c80fd<_0x18631a[_0x6342('0x6c')];_0x5c80fd++){_0x18631a[_0x5c80fd]['setDataValue'](_0x6342('0xa6'),_0x6342('0x114'));}return _0x18631a;}));_0x5ed19b[_0x6342('0xef')](_0x4efd04['getMailQueues']()['then'](function(_0x144ce2){for(var _0x24e9e1=0x0;_0x24e9e1<_0x144ce2[_0x6342('0x6c')];_0x24e9e1++){_0x144ce2[_0x24e9e1][_0x6342('0x111')](_0x6342('0xa6'),_0x6342('0x120'));}return _0x144ce2;}));_0x5ed19b[_0x6342('0xef')](_0x4efd04[_0x6342('0x115')]()[_0x6342('0x24')](function(_0x4d638b){for(var _0x5ae7e3=0x0;_0x5ae7e3<_0x4d638b[_0x6342('0x6c')];_0x5ae7e3++){_0x4d638b[_0x5ae7e3][_0x6342('0x111')](_0x6342('0xa6'),'Sms');}return _0x4d638b;}));_0x5ed19b['push'](_0x4efd04[_0x6342('0x117')]()[_0x6342('0x24')](function(_0x3654fd){for(var _0x540bce=0x0;_0x540bce<_0x3654fd[_0x6342('0x6c')];_0x540bce++){_0x3654fd[_0x540bce]['setDataValue']('channel',_0x6342('0x121'));}return _0x3654fd;}));_0x5ed19b[_0x6342('0xef')](_0x4efd04[_0x6342('0x122')]()[_0x6342('0x24')](function(_0xbd1994){for(var _0x2d59b3=0x0;_0x2d59b3<_0xbd1994[_0x6342('0x6c')];_0x2d59b3++){_0xbd1994[_0x2d59b3]['setDataValue'](_0x6342('0xa6'),_0x6342('0x118'));}return _0xbd1994;}));return BPromise['all'](_0x5ed19b);})[_0x6342('0x24')](function(_0x5ee895){var _0x1acf5e=_[_0x6342('0x119')](_0x5ee895);_0x5ed19b=[];return db[_0x6342('0x61')][_0x6342('0x11a')](function(_0x44431f){for(var _0x46761e=0x0;_0x46761e<_0x1acf5e[_0x6342('0x6c')];_0x46761e++){_0x5ed19b[_0x6342('0xef')](_0x1acf5e[_0x46761e][_0x6342('0x123')](_0x64a249['id']),{'transaction':_0x44431f});}return BPromise[_0x6342('0xfb')](_0x5ed19b)[_0x6342('0x24')](function(){if(_0x64a249[_0x6342('0xa7')]){return BPromise[_0x6342('0xb6')](_[_0x6342('0x3f')](_0x1acf5e,function(_0x772966){return _0x772966['getDataValue']('channel')==='Voice';}),function(_0x1550a8){return db[_0x6342('0xb7')]['destroy']({'where':{'VoiceQueueId':_0x1550a8['id'],'UserId':_0x64a249['id']},'transaction':_0x44431f});});}else{return;}})['then'](function(){for(var _0x26b205=0x0;_0x26b205<_0x1acf5e[_0x6342('0x6c')];_0x26b205++){var _0x18450b=_0x1acf5e[_0x26b205]['getDataValue'](_0x6342('0xa6'));var _0x24d8fe=_0x18450b+_0x6342('0x11d');socket[_0x6342('0xaf')]('user'+_0x18450b+_0x6342('0xbb'),{'UserId':_0x64a249['id'],['queueField']:_0x1acf5e[_0x26b205]['id']});}});});});}});}})[_0x6342('0x24')](respondWithStatusCode(_0x29a8f7,null))[_0x6342('0x69')](handleError(_0x29a8f7,null));};exports[_0x6342('0x124')]=function(_0x4046cb,_0x1bc1d4,_0x37a081){var _0x3cd70b={};var _0xa2b9bd={};var _0xc464b4;var _0x5c9064;return db[_0x6342('0x4a')][_0x6342('0xa4')]({'where':{'id':_0x4046cb['params']['id']}})[_0x6342('0x24')](handleEntityNotFound(_0x1bc1d4,null))[_0x6342('0x24')](function(_0x1fb66f){if(_0x1fb66f){_0xc464b4=_0x1fb66f;_0xa2b9bd[_0x6342('0x4d')]=_[_0x6342('0x51')](db[_0x6342('0xca')][_0x6342('0x4b')]);_0xa2b9bd[_0x6342('0x52')]=_['keys'](_0x4046cb[_0x6342('0x52')]);_0xa2b9bd[_0x6342('0x5d')]=_['intersection'](_0xa2b9bd[_0x6342('0x4d')],_0xa2b9bd[_0x6342('0x52')]);_0x3cd70b[_0x6342('0x54')]=_[_0x6342('0x53')](_0xa2b9bd['model'],qs[_0x6342('0x55')](_0x4046cb[_0x6342('0x52')]['fields']));_0x3cd70b[_0x6342('0x54')]=_0x3cd70b[_0x6342('0x54')][_0x6342('0x6c')]?_0x3cd70b[_0x6342('0x54')]:_0xa2b9bd[_0x6342('0x4d')];_0x3cd70b[_0x6342('0x59')]=qs[_0x6342('0x5a')](_0x4046cb[_0x6342('0x52')][_0x6342('0x5a')]);_0x3cd70b[_0x6342('0x5b')]=qs[_0x6342('0x5d')](_[_0x6342('0x5c')](_0x4046cb[_0x6342('0x52')],_0xa2b9bd[_0x6342('0x5d')]));if(_0x4046cb['query']['filter']){_0x3cd70b[_0x6342('0x5b')]=_[_0x6342('0x5e')](_0x3cd70b[_0x6342('0x5b')],{'$or':_[_0x6342('0x41')](_0x3cd70b[_0x6342('0x54')],function(_0x595b56){var _0x5bb366={};_0x5bb366[_0x595b56]={'$like':'%'+_0x4046cb[_0x6342('0x52')][_0x6342('0x3f')]+'%'};return _0x5bb366;})});}_0x3cd70b=_['merge']({},_0x3cd70b,_0x4046cb[_0x6342('0x65')]);return _0xc464b4[_0x6342('0x124')](_0x3cd70b);}})[_0x6342('0x24')](function(_0x5a7dcc){if(_0x5a7dcc){_0x5c9064=_0x5a7dcc[_0x6342('0x6c')];if(!_0x4046cb[_0x6342('0x52')][_0x6342('0x56')](_0x6342('0x57'))){_0x3cd70b[_0x6342('0x33')]=qs[_0x6342('0x33')](_0x4046cb[_0x6342('0x52')][_0x6342('0x33')]);_0x3cd70b[_0x6342('0x58')]=qs[_0x6342('0x58')](_0x4046cb[_0x6342('0x52')][_0x6342('0x58')]);}return _0xc464b4[_0x6342('0x124')](_0x3cd70b);}})[_0x6342('0x24')](function(_0x206b59){if(_0x206b59){return _0x206b59?{'count':_0x5c9064,'rows':_0x206b59}:null;}})[_0x6342('0x24')](respondWithResult(_0x1bc1d4,null))['catch'](handleError(_0x1bc1d4,null));};exports[_0x6342('0x125')]=function(_0x14bd09,_0x4534cc,_0xacaaf4){var _0x391e55={};var _0x19df99={};var _0x26cd9b;var _0x133d02;return db[_0x6342('0x4a')][_0x6342('0xa4')]({'where':{'id':_0x14bd09[_0x6342('0x6b')]['id']}})[_0x6342('0x24')](handleEntityNotFound(_0x4534cc,null))['then'](function(_0x4193be){if(_0x4193be){_0x26cd9b=_0x4193be;_0x19df99[_0x6342('0x4d')]=_[_0x6342('0x51')](db['User']['rawAttributes']);_0x19df99[_0x6342('0x52')]=_[_0x6342('0x51')](_0x14bd09[_0x6342('0x52')]);_0x19df99['filters']=_['intersection'](_0x19df99[_0x6342('0x4d')],_0x19df99['query']);_0x391e55[_0x6342('0x54')]=_[_0x6342('0x53')](_0x19df99[_0x6342('0x4d')],qs[_0x6342('0x55')](_0x14bd09[_0x6342('0x52')][_0x6342('0x55')]));_0x391e55[_0x6342('0x54')]=_0x391e55['attributes'][_0x6342('0x6c')]?_0x391e55['attributes']:_0x19df99[_0x6342('0x4d')];_0x391e55[_0x6342('0x59')]=qs[_0x6342('0x5a')](_0x14bd09['query'][_0x6342('0x5a')]);_0x391e55[_0x6342('0x5b')]=qs[_0x6342('0x5d')](_['pick'](_0x14bd09['query'],_0x19df99[_0x6342('0x5d')]));if(_0x14bd09[_0x6342('0x52')]['filter']){_0x391e55[_0x6342('0x5b')]=_[_0x6342('0x5e')](_0x391e55[_0x6342('0x5b')],{'$or':_[_0x6342('0x41')](_0x391e55[_0x6342('0x54')],function(_0x39027a){var _0x29d697={};_0x29d697[_0x39027a]={'$like':'%'+_0x14bd09['query'][_0x6342('0x3f')]+'%'};return _0x29d697;})});}_0x391e55['model']=db[_0x6342('0x4a')];_0x391e55['as']=_0x6342('0x3b');_0x391e55=_[_0x6342('0x5e')]({},_0x391e55,_0x14bd09[_0x6342('0x65')]);return _0x26cd9b['getVoiceQueues']({'include':[_0x391e55]});}})['then'](function(_0x44d500){if(_0x44d500){var _0x2cae3a={},_0x3bc57b=[],_0x550238=0x0;for(var _0x43b721=0x0;_0x43b721<_0x44d500['length'];_0x43b721+=0x1){for(var _0x56dbe7=0x0,_0x8fc30b;_0x56dbe7<_0x44d500[_0x43b721][_0x6342('0x3b')][_0x6342('0x6c')];_0x56dbe7+=0x1){_0x8fc30b=_0x44d500[_0x43b721][_0x6342('0x3b')][_0x56dbe7][_0x6342('0x3a')]({'plain':!![]});_0x2cae3a[_0x8fc30b['id']]=_0x8fc30b;}}_0x2cae3a=_['values'](_0x2cae3a);for(var _0x251d44=qs[_0x6342('0x58')](_0x14bd09['query'][_0x6342('0x58')]);_0x251d44<_0x2cae3a['length']&&_0x3bc57b[_0x6342('0x6c')]=_0x11df3d['agents']){throw new Error(_0xfc94('0x4f'));}})[_0xfc94('0x22')](function(){if(_0xef0817){return db[_0xfc94('0x2c')][_0xfc94('0x48')]({'where':{'membername':_0xef0817[_0xfc94('0x28')]},'individualHooks':!![]});}})['then'](function(){if(_0xef0817){return _0xef0817[_0xfc94('0x50')]({'raw':!![]});}})[_0xfc94('0x22')](function(_0x57e74e){if(_0xef0817){if(_0x57e74e){var _0x2dd49e=[];_0x476b64=_0x57e74e;if(_0x476b64[_0xfc94('0x2f')]){for(var _0x53fcc1=0x0;_0x53fcc1<_0x476b64[_0xfc94('0x2f')];_0x53fcc1++){_0x2dd49e[_0xfc94('0x34')](db[_0xfc94('0x2c')][_0xfc94('0x51')]({'membername':_0xef0817['name'],'UserId':_0xef0817['id'],'queue_name':_0x476b64[_0x53fcc1][_0xfc94('0x28')],'VoiceQueueId':_0x476b64[_0x53fcc1]['id'],'interface':_0x1bb077,'paused':_0xef0817['loginInPause']||![],'penalty':_0x476b64[_0x53fcc1][_0xfc94('0x52')]||0x0}));}return BPromise['all'](_0x2dd49e);}}}})[_0xfc94('0x22')](function(){if(_0xef0817){return db['MemberReport'][_0xfc94('0x19')]({'where':{'membername':_0xef0817['name'],'exitAt':null}});}})['then'](function(_0x1bd185){if(_0xef0817){if(_0x1bd185&&_0x1bd185['length']){var _0x49ad58=[];_0x1bd185['forEach'](function(_0x4cd207){_0x49ad58[_0xfc94('0x34')](_0x4cd207[_0xfc94('0x2d')]({'exitAt':moment()[_0xfc94('0x35')](_0xfc94('0x30'))}));});return BPromise['all'](_0x49ad58);}}})[_0xfc94('0x22')](function(_0x3cf50f){if(_0xef0817){var _0x552f17=[];var _0x4b3ed2=[];var _0x150bdb=utils['getChannels']();var _0x3956f7={'membername':_0xef0817['name'],'interface':_0x1bb077,'enterAt':moment()[_0xfc94('0x35')](_0xfc94('0x30')),'role':_0xef0817[_0xfc94('0x29')],'internal':_0xef0817[_0xfc94('0x2a')]};_0x150bdb[_0xfc94('0x33')](function(_0x1b5ae0){_0x552f17[_0xfc94('0x34')](_[_0xfc94('0x53')]({'channel':_0x1b5ae0,'type':'LOGIN','data1':_0xfc94('0x54'),'data2':_0x1bb077},_0x3956f7));if(_0xef0817[_0xfc94('0x55')]){_0x4b3ed2['push'](_[_0xfc94('0x53')]({'channel':_0x1b5ae0,'type':'PAUSE','data1':_0xfc94('0x56')},_0x3956f7));}});return db[_0xfc94('0x2e')][_0xfc94('0x57')](_0x552f17[_0xfc94('0x58')](_0x4b3ed2),{'individualHooks':!![]});}})[_0xfc94('0x22')](function(){if(_0xef0817){return _0xef0817[_0xfc94('0x2d')]({'online':!![],'lastLoginAt':moment()[_0xfc94('0x35')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0xef0817[_0xfc94('0x55')]||![],'mailPause':_0xef0817['loginInPause']||![],'chatPause':_0xef0817[_0xfc94('0x55')]||![],'faxPause':_0xef0817['loginInPause']||![],'smsPause':_0xef0817[_0xfc94('0x55')]||![],'openchannelPause':_0xef0817[_0xfc94('0x55')]||![],'pauseType':_0xef0817[_0xfc94('0x55')]?_0xfc94('0x56'):null,'lastPauseAt':moment()['format'](_0xfc94('0x30')),'interface':_0x1bb077});}})['then'](function(_0x539ade){_0x467fc2(_0x539ade);})[_0xfc94('0x17')](function(_0x5f3ff9){_0x40344d(_0x3cb88b[_0xfc94('0x15')](0x1f4,_0x5f3ff9[_0xfc94('0x16')]));});});}; \ No newline at end of file +var _0x8887=['defaults','localhost','socket.io-emitter','request','then','info','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetUser','User','findAll','options','raw','limit','include','map','model','attributes','catch','ShowUser','find','where','PauseUser','name','internal','interface','UserVoiceQueueRt','update','MemberReport','PAUSE','length','format','YYYY-MM-DD\x20HH:mm:ss','getChannels','push','isNil','SIP/%s','DEFAULT\x20PAUSE','role','body','uniqueid','bulkCreate','type','UnpauseUser','channel','isValidChannel','voice','system','mail','chat','fax','openchannel','set','%s%s','Pause','forEach','all','findOne','mobile','loginInPause','count','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','destroy','getVoiceQueues','upsert','UserVoiceQueue.penalty','merge','LOGIN','callysquare','LOGININPAUSE','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis'];(function(_0x53ed0b,_0x25e205){var _0x453628=function(_0x2b0c51){while(--_0x2b0c51){_0x53ed0b['push'](_0x53ed0b['shift']());}};_0x453628(++_0x25e205);}(_0x8887,0xac));var _0x7888=function(_0x8af28f,_0x4bd7e8){_0x8af28f=_0x8af28f-0x0;var _0x1b64b9=_0x8887[_0x8af28f];return _0x1b64b9;};'use strict';var _=require(_0x7888('0x0'));var util=require(_0x7888('0x1'));var moment=require(_0x7888('0x2'));var BPromise=require(_0x7888('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7888('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7888('0x5'));var logger=require(_0x7888('0x6'))(_0x7888('0x7'));var config=require(_0x7888('0x8'));var jayson=require(_0x7888('0x9'));var client=jayson['client'][_0x7888('0xa')]({'port':0x232a});config[_0x7888('0xb')]=_[_0x7888('0xc')](config[_0x7888('0xb')],{'host':_0x7888('0xd'),'port':0x18eb});var socket=require(_0x7888('0xe'))(new Redis(config[_0x7888('0xb')]));require('./user.socket')['register'](socket);function respondWithRpcPromise(_0x461216,_0x3a92db,_0x1f63be){return new BPromise(function(_0x4a3ec1,_0xdc8411){return client[_0x7888('0xf')](_0x461216,_0x1f63be)[_0x7888('0x10')](function(_0xac83e){logger[_0x7888('0x11')](_0x7888('0x12'),_0x3a92db,_0x7888('0x13'));logger[_0x7888('0x14')](_0x7888('0x15'),_0x3a92db,_0x7888('0x13'),JSON[_0x7888('0x16')](_0xac83e));if(_0xac83e[_0x7888('0x17')]){if(_0xac83e[_0x7888('0x17')][_0x7888('0x18')]===0x1f4){logger[_0x7888('0x17')](_0x7888('0x12'),_0x3a92db,_0xac83e['error'][_0x7888('0x19')]);return _0xdc8411(_0xac83e[_0x7888('0x17')][_0x7888('0x19')]);}logger[_0x7888('0x17')](_0x7888('0x12'),_0x3a92db,_0xac83e[_0x7888('0x17')]['message']);return _0x4a3ec1(_0xac83e[_0x7888('0x17')][_0x7888('0x19')]);}else{logger[_0x7888('0x11')](_0x7888('0x12'),_0x3a92db,'request\x20sent');_0x4a3ec1(_0xac83e[_0x7888('0x1a')][_0x7888('0x19')]);}})['catch'](function(_0x3e26a0){logger['error'](_0x7888('0x12'),_0x3a92db,_0x3e26a0);_0xdc8411(_0x3e26a0);});});}exports[_0x7888('0x1b')]=function(_0x2c7275){var _0x55c4bc=this;return new Promise(function(_0x53df6f,_0x50274a){return db[_0x7888('0x1c')][_0x7888('0x1d')]({'raw':_0x2c7275['options']?_0x2c7275[_0x7888('0x1e')][_0x7888('0x1f')]===undefined?!![]:![]:!![],'where':_0x2c7275[_0x7888('0x1e')]?_0x2c7275['options']['where']||null:null,'attributes':_0x2c7275['options']?_0x2c7275['options']['attributes']||null:null,'limit':_0x2c7275['options']?_0x2c7275[_0x7888('0x1e')][_0x7888('0x20')]||null:null,'include':_0x2c7275[_0x7888('0x1e')]?_0x2c7275['options'][_0x7888('0x21')]?_[_0x7888('0x22')](_0x2c7275[_0x7888('0x1e')][_0x7888('0x21')],function(_0x5564b8){return{'model':db[_0x5564b8[_0x7888('0x23')]],'as':_0x5564b8['as'],'attributes':_0x5564b8[_0x7888('0x24')],'include':_0x5564b8['include']?_['map'](_0x5564b8['include'],function(_0x1087c3){return{'model':db[_0x1087c3[_0x7888('0x23')]],'as':_0x1087c3['as'],'attributes':_0x1087c3[_0x7888('0x24')],'include':_0x1087c3['include']?_[_0x7888('0x22')](_0x1087c3[_0x7888('0x21')],function(_0x1bd66e){return{'model':db[_0x1bd66e[_0x7888('0x23')]],'as':_0x1bd66e['as'],'attributes':_0x1bd66e[_0x7888('0x24')]};}):[]};}):[]};}):[]:[]})[_0x7888('0x10')](function(_0x3b679e){logger['info'](_0x7888('0x1b'),_0x2c7275);logger[_0x7888('0x14')](_0x7888('0x1b'),_0x2c7275,JSON['stringify'](_0x3b679e));_0x53df6f(_0x3b679e);})[_0x7888('0x25')](function(_0x40cef8){logger[_0x7888('0x17')]('GetUser',_0x40cef8[_0x7888('0x19')],_0x2c7275);_0x50274a(_0x55c4bc[_0x7888('0x17')](0x1f4,_0x40cef8[_0x7888('0x19')]));});});};exports[_0x7888('0x26')]=function(_0x1295a4){var _0x33b2ef=this;return new Promise(function(_0x133353,_0x361df3){return db[_0x7888('0x1c')][_0x7888('0x27')]({'raw':_0x1295a4[_0x7888('0x1e')]?_0x1295a4[_0x7888('0x1e')][_0x7888('0x1f')]===undefined?!![]:![]:!![],'where':_0x1295a4[_0x7888('0x1e')]?_0x1295a4[_0x7888('0x1e')][_0x7888('0x28')]||null:null,'attributes':_0x1295a4[_0x7888('0x1e')]?_0x1295a4[_0x7888('0x1e')][_0x7888('0x24')]||null:null,'include':_0x1295a4[_0x7888('0x1e')]?_0x1295a4['options']['include']?_['map'](_0x1295a4[_0x7888('0x1e')][_0x7888('0x21')],function(_0x2a88fb){return{'model':db[_0x2a88fb[_0x7888('0x23')]],'as':_0x2a88fb['as'],'attributes':_0x2a88fb[_0x7888('0x24')],'include':_0x2a88fb['include']?_[_0x7888('0x22')](_0x2a88fb['include'],function(_0x4576a8){return{'model':db[_0x4576a8[_0x7888('0x23')]],'as':_0x4576a8['as'],'attributes':_0x4576a8[_0x7888('0x24')],'include':_0x4576a8[_0x7888('0x21')]?_[_0x7888('0x22')](_0x4576a8[_0x7888('0x21')],function(_0x3c23c4){return{'model':db[_0x3c23c4['model']],'as':_0x3c23c4['as'],'attributes':_0x3c23c4['attributes']};}):[]};}):[]};}):[]:[]})[_0x7888('0x10')](function(_0x5892d9){logger['info']('ShowUser',_0x1295a4);logger[_0x7888('0x14')]('ShowUser',_0x1295a4,JSON['stringify'](_0x5892d9));_0x133353(_0x5892d9);})['catch'](function(_0x5cd794){logger[_0x7888('0x17')]('ShowUser',_0x5cd794[_0x7888('0x19')],_0x1295a4);_0x361df3(_0x33b2ef[_0x7888('0x17')](0x1f4,_0x5cd794[_0x7888('0x19')]));});});};exports[_0x7888('0x29')]=function(_0x2ac60f){var _0x43eda7=this;return new Promise(function(_0x28dcd5,_0x473c87){var _0x57f6a8;return db[_0x7888('0x1c')][_0x7888('0x27')]({'where':_0x2ac60f[_0x7888('0x1e')][_0x7888('0x28')]||{},'attributes':['id',_0x7888('0x2a'),'role',_0x7888('0x2b'),_0x7888('0x2c')]})[_0x7888('0x10')](function(_0x27394b){if(_0x27394b){_0x57f6a8=_0x27394b;return db[_0x7888('0x2d')][_0x7888('0x2e')]({'paused':0x1},{'where':{'UserId':_0x57f6a8['id']},'individualHooks':!![]});}})['then'](function(){if(_0x57f6a8){return db[_0x7888('0x2f')][_0x7888('0x1d')]({'where':{'membername':_0x57f6a8[_0x7888('0x2a')],'type':_0x7888('0x30'),'exitAt':null}});}})['then'](function(_0x5cd937){if(_0x57f6a8){if(_0x5cd937&&_0x5cd937[_0x7888('0x31')]){var _0x1075af=moment()[_0x7888('0x32')](_0x7888('0x33'));for(var _0x5c363c=0x0,_0x3edb9f=_0x5cd937['length'];_0x5c363c<_0x3edb9f;_0x5c363c++){_0x5cd937[_0x5c363c]['updateAttributes']({'exitAt':_0x1075af});}}}})[_0x7888('0x10')](function(){if(_0x57f6a8){var _0x3625c7=[];var _0x19521b=utils[_0x7888('0x34')]();_0x19521b['forEach'](function(_0x29d1ee){_0x3625c7[_0x7888('0x35')]({'channel':_0x29d1ee,'membername':_0x57f6a8['name'],'interface':_[_0x7888('0x36')](_0x57f6a8['interface'])?util['format'](_0x7888('0x37'),_0x57f6a8[_0x7888('0x2a')]):_0x57f6a8[_0x7888('0x2c')],'type':_0x7888('0x30'),'enterAt':moment()[_0x7888('0x32')](_0x7888('0x33')),'data1':_0x2ac60f['body']['type']||_0x7888('0x38'),'role':_0x57f6a8[_0x7888('0x39')],'internal':_0x57f6a8[_0x7888('0x2b')],'uniqueid':_0x2ac60f[_0x7888('0x3a')][_0x7888('0x3b')]||null});});return db[_0x7888('0x2f')][_0x7888('0x3c')](_0x3625c7,{'individualHooks':!![]});}})[_0x7888('0x10')](function(){if(_0x57f6a8){return _0x57f6a8[_0x7888('0x2e')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x2ac60f[_0x7888('0x3a')][_0x7888('0x3d')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0x7888('0x32')](_0x7888('0x33'))});}})[_0x7888('0x10')](function(_0x547e5e){_0x28dcd5(_0x547e5e);})[_0x7888('0x25')](function(_0x361392){_0x473c87(_0x43eda7[_0x7888('0x17')](0x1f4,_0x361392['message']));});});};exports[_0x7888('0x3e')]=function(_0x1348a0){var _0x28f68b=this;return new Promise(function(_0x3ed115,_0x6b47db){var _0x125904;return db[_0x7888('0x1c')]['findOne']({'where':_0x1348a0[_0x7888('0x1e')][_0x7888('0x28')]||{},'attributes':['id','name']})[_0x7888('0x10')](function(_0x8aa89e){if(_0x8aa89e){_0x125904=_0x8aa89e;if(_0x1348a0[_0x7888('0x3a')][_0x7888('0x3f')]&&!utils[_0x7888('0x40')](_0x1348a0['body'][_0x7888('0x3f')])){throw new Error('Unknown\x20channel');}switch(_0x1348a0['body'][_0x7888('0x3f')]){case _0x7888('0x41'):return db[_0x7888('0x2d')][_0x7888('0x2e')]({'paused':0x0},{'where':{'UserId':_0x125904['id']}})[_0x7888('0x10')](function(){return db['MemberReport']['find']({'where':{'channel':_0x1348a0['body'][_0x7888('0x3f')],'membername':_0x125904['name'],'type':'PAUSE','exitAt':null}});})['then'](function(_0x393cdb){if(_0x393cdb){return _0x393cdb['update']({'exitAt':moment()[_0x7888('0x32')](_0x7888('0x33')),'data2':_0x7888('0x42')},{'individualHooks':!![]});}return null;})[_0x7888('0x10')](function(){return _0x125904[_0x7888('0x2e')]({'voicePause':![]});});case _0x7888('0x43'):case _0x7888('0x44'):case _0x7888('0x45'):case'sms':case _0x7888('0x46'):return db[_0x7888('0x2f')][_0x7888('0x27')]({'where':{'channel':_0x1348a0[_0x7888('0x3a')]['channel'],'membername':_0x125904[_0x7888('0x2a')],'type':_0x7888('0x30'),'exitAt':null}})['then'](function(_0x22e2de){return _0x22e2de[_0x7888('0x2e')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x7888('0x42')},{'individualHooks':!![]});})['then'](function(){var _0x180e16={};_[_0x7888('0x47')](_0x180e16,util[_0x7888('0x32')](_0x7888('0x48'),_0x1348a0[_0x7888('0x3a')][_0x7888('0x3f')],_0x7888('0x49')),![]);return _0x125904[_0x7888('0x2e')](_0x180e16);});default:return db[_0x7888('0x2d')][_0x7888('0x2e')]({'paused':0x0},{'where':{'UserId':_0x125904['id']}})[_0x7888('0x10')](function(){return db[_0x7888('0x2f')]['findAll']({'where':{'membername':_0x125904[_0x7888('0x2a')],'type':_0x7888('0x30'),'exitAt':null}});})[_0x7888('0x10')](function(_0x52ce98){var _0x5f4ae1=[];_0x52ce98[_0x7888('0x4a')](function(_0x2c7543){_0x5f4ae1[_0x7888('0x35')](_0x2c7543[_0x7888('0x2e')]({'exitAt':moment()[_0x7888('0x32')](_0x7888('0x33')),'data2':_0x7888('0x42')}));});return BPromise[_0x7888('0x4b')](_0x5f4ae1);})[_0x7888('0x10')](function(){return _0x125904[_0x7888('0x2e')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0x7888('0x10')](function(_0xf011ca){_0x3ed115(_0xf011ca);})[_0x7888('0x25')](function(_0x4da846){_0x6b47db(_0x28f68b[_0x7888('0x17')](0x1f4,_0x4da846[_0x7888('0x19')]));});});};exports['LogoutUser']=function(_0x5dd01d){var _0xc503f6=this;return new Promise(function(_0x49f00b,_0x289a37){var _0x29e550;return db['User'][_0x7888('0x4c')]({'where':_0x5dd01d['options'][_0x7888('0x28')]||{},'attributes':['id',_0x7888('0x2a')]})[_0x7888('0x10')](function(_0x37fbaf){if(_0x37fbaf){_0x29e550=_0x37fbaf;return db[_0x7888('0x2d')]['destroy']({'where':{'membername':_0x29e550[_0x7888('0x2a')]},'individualHooks':!![]});}})[_0x7888('0x10')](function(){if(_0x29e550){return db[_0x7888('0x2f')][_0x7888('0x1d')]({'where':{'membername':_0x29e550[_0x7888('0x2a')],'exitAt':null}});}})[_0x7888('0x10')](function(_0x43e464){if(_0x29e550){if(_0x43e464&&_0x43e464[_0x7888('0x31')]){var _0x338f32=[];_0x43e464['forEach'](function(_0x50bc78){_0x338f32['push'](_0x50bc78[_0x7888('0x2e')]({'exitAt':moment()['format'](_0x7888('0x33'))}));});return BPromise[_0x7888('0x4b')](_0x338f32);}}})[_0x7888('0x10')](function(){if(_0x29e550){return _0x29e550[_0x7888('0x2e')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x7888('0x10')](function(_0xc80800){_0x49f00b(_0xc80800);})[_0x7888('0x25')](function(_0x25c407){_0x289a37(_0xc503f6[_0x7888('0x17')](0x1f4,_0x25c407[_0x7888('0x19')]));});});};exports['LoginUser']=function(_0x146539){var _0x1091b1=this;return new Promise(function(_0x26f988,_0x16b18c){var _0x9d3b5;var _0x516d4e;var _0x1591c3;var _0x4fb74f;return db['User'][_0x7888('0x4c')]({'where':_0x146539['options'][_0x7888('0x28')]||{},'attributes':['id',_0x7888('0x2a'),_0x7888('0x39'),_0x7888('0x4d'),'phone','internal',_0x7888('0x4e'),_0x7888('0x2c')]})['then'](function(_0x27f430){if(_0x27f430){_0x9d3b5=_0x27f430;_0x4fb74f=_0x146539['body'][_0x7888('0x2c')]?_0x146539[_0x7888('0x3a')]['interface']:util['format'](_0x7888('0x37'),_0x9d3b5['name']);return db[_0x7888('0x1c')][_0x7888('0x4f')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x9d3b5['id']}}});}})[_0x7888('0x10')](function(_0xe56cbc){if(_0xe56cbc){_0x1591c3=_0xe56cbc;return require(_0x7888('0x50'))[_0x7888('0x51')]();}})[_0x7888('0x10')](function(_0x4883f8){if(_0x4883f8&&_0x4883f8[_0x7888('0x52')]&&_0x1591c3>=_0x4883f8[_0x7888('0x52')]){throw new Error(_0x7888('0x53'));}})['then'](function(){if(_0x9d3b5){return db[_0x7888('0x2d')][_0x7888('0x54')]({'where':{'membername':_0x9d3b5['name']},'individualHooks':!![]});}})[_0x7888('0x10')](function(){if(_0x9d3b5){return _0x9d3b5[_0x7888('0x55')]({'raw':!![]});}})[_0x7888('0x10')](function(_0x38d541){if(_0x9d3b5){if(_0x38d541){var _0x1bf1f4=[];_0x516d4e=_0x38d541;if(_0x516d4e[_0x7888('0x31')]){for(var _0x3c743b=0x0;_0x3c743b<_0x516d4e[_0x7888('0x31')];_0x3c743b++){_0x1bf1f4[_0x7888('0x35')](db[_0x7888('0x2d')][_0x7888('0x56')]({'membername':_0x9d3b5[_0x7888('0x2a')],'UserId':_0x9d3b5['id'],'queue_name':_0x516d4e[_0x3c743b][_0x7888('0x2a')],'VoiceQueueId':_0x516d4e[_0x3c743b]['id'],'interface':_0x4fb74f,'paused':_0x9d3b5[_0x7888('0x4e')]||![],'penalty':_0x516d4e[_0x3c743b][_0x7888('0x57')]||0x0}));}return BPromise[_0x7888('0x4b')](_0x1bf1f4);}}}})['then'](function(){if(_0x9d3b5){return db[_0x7888('0x2f')]['findAll']({'where':{'membername':_0x9d3b5[_0x7888('0x2a')],'exitAt':null}});}})['then'](function(_0x3c6b25){if(_0x9d3b5){if(_0x3c6b25&&_0x3c6b25['length']){var _0x52167e=[];_0x3c6b25['forEach'](function(_0x4be83c){_0x52167e[_0x7888('0x35')](_0x4be83c[_0x7888('0x2e')]({'exitAt':moment()[_0x7888('0x32')](_0x7888('0x33'))}));});return BPromise[_0x7888('0x4b')](_0x52167e);}}})[_0x7888('0x10')](function(_0x35d893){if(_0x9d3b5){var _0x588702=[];var _0x1a72bc=[];var _0x45fe5c=utils[_0x7888('0x34')]();var _0x980cbc={'membername':_0x9d3b5['name'],'interface':_0x4fb74f,'enterAt':moment()[_0x7888('0x32')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x9d3b5['role'],'internal':_0x9d3b5[_0x7888('0x2b')]};_0x45fe5c[_0x7888('0x4a')](function(_0x24f97b){_0x588702['push'](_[_0x7888('0x58')]({'channel':_0x24f97b,'type':_0x7888('0x59'),'data1':_0x7888('0x5a'),'data2':_0x4fb74f},_0x980cbc));if(_0x9d3b5['loginInPause']){_0x1a72bc[_0x7888('0x35')](_[_0x7888('0x58')]({'channel':_0x24f97b,'type':'PAUSE','data1':_0x7888('0x5b')},_0x980cbc));}});return db[_0x7888('0x2f')][_0x7888('0x3c')](_0x588702['concat'](_0x1a72bc),{'individualHooks':!![]});}})[_0x7888('0x10')](function(){if(_0x9d3b5){return _0x9d3b5[_0x7888('0x2e')]({'online':!![],'lastLoginAt':moment()[_0x7888('0x32')](_0x7888('0x33')),'voicePause':_0x9d3b5[_0x7888('0x4e')]||![],'mailPause':_0x9d3b5[_0x7888('0x4e')]||![],'chatPause':_0x9d3b5['loginInPause']||![],'faxPause':_0x9d3b5[_0x7888('0x4e')]||![],'smsPause':_0x9d3b5['loginInPause']||![],'openchannelPause':_0x9d3b5[_0x7888('0x4e')]||![],'pauseType':_0x9d3b5['loginInPause']?_0x7888('0x5b'):null,'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x4fb74f});}})[_0x7888('0x10')](function(_0x585ec2){_0x26f988(_0x585ec2);})['catch'](function(_0x3489ed){_0x16b18c(_0x1091b1['error'](0x1f4,_0x3489ed[_0x7888('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 395682f..e1b1990 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 _0x42d0=['removeListener','length','user:','save','remove','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x42d0,0x123));var _0x042d=function(_0x328bd3,_0x9cf5a5){_0x328bd3=_0x328bd3-0x0;var _0x458149=_0x42d0[_0x328bd3];return _0x458149;};'use strict';var UserEvents=require('./user.events');var events=[_0x042d('0x0'),_0x042d('0x1'),_0x042d('0x2')];function createListener(_0x5ee3c3,_0x2d41eb){return function(_0x2d0298){_0x2d41eb['emit'](_0x5ee3c3,_0x2d0298);};}function removeListener(_0x2a3dd0,_0x244efb){return function(){UserEvents[_0x042d('0x3')](_0x2a3dd0,_0x244efb);};}exports['register']=function(_0x251eee){for(var _0x44daee=0x0,_0x370554=events[_0x042d('0x4')];_0x44daee<_0x370554;_0x44daee++){var _0x41b78d=events[_0x44daee];var _0x1f1211=createListener(_0x042d('0x5')+_0x41b78d,_0x251eee);UserEvents['on'](_0x41b78d,_0x1f1211);}}; \ No newline at end of file +var _0x8ba0=['remove','update','emit','removeListener','length','user:','./user.events','save'];(function(_0x90b357,_0x7779ba){var _0x2b86d9=function(_0x9abe3){while(--_0x9abe3){_0x90b357['push'](_0x90b357['shift']());}};_0x2b86d9(++_0x7779ba);}(_0x8ba0,0x12e));var _0x08ba=function(_0x104696,_0x27f784){_0x104696=_0x104696-0x0;var _0x45b76e=_0x8ba0[_0x104696];return _0x45b76e;};'use strict';var UserEvents=require(_0x08ba('0x0'));var events=[_0x08ba('0x1'),_0x08ba('0x2'),_0x08ba('0x3')];function createListener(_0x245b2b,_0x1c14b3){return function(_0x71a6ee){_0x1c14b3[_0x08ba('0x4')](_0x245b2b,_0x71a6ee);};}function removeListener(_0x4b9a2c,_0x5331ab){return function(){UserEvents[_0x08ba('0x5')](_0x4b9a2c,_0x5331ab);};}exports['register']=function(_0xe27e0e){for(var _0x53c76f=0x0,_0x1a5be6=events[_0x08ba('0x6')];_0x53c76f<_0x1a5be6;_0x53c76f++){var _0x3cf435=events[_0x53c76f];var _0x59c801=createListener(_0x08ba('0x7')+_0x3cf435,_0xe27e0e);UserEvents['on'](_0x3cf435,_0x59c801);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index f7894cc..92f48cf 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 _0x33cb=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','path','connect-timeout'];(function(_0x3df739,_0x54dad8){var _0x16b8a2=function(_0x451234){while(--_0x451234){_0x3df739['push'](_0x3df739['shift']());}};_0x16b8a2(++_0x54dad8);}(_0x33cb,0x72));var _0xb33c=function(_0x390342,_0x543509){_0x390342=_0x390342-0x0;var _0x55e2c7=_0x33cb[_0x390342];return _0x55e2c7;};'use strict';var multer=require(_0xb33c('0x0'));var util=require('util');var path=require(_0xb33c('0x1'));var timeout=require(_0xb33c('0x2'));var express=require(_0xb33c('0x3'));var router=express[_0xb33c('0x4')]();var auth=require(_0xb33c('0x5'));var interaction=require(_0xb33c('0x6'));var config=require(_0xb33c('0x7'));module[_0xb33c('0x8')]=router; \ No newline at end of file +var _0x9d5a=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer'];(function(_0x7f6fe5,_0x54077d){var _0x1ed688=function(_0x1861fb){while(--_0x1861fb){_0x7f6fe5['push'](_0x7f6fe5['shift']());}};_0x1ed688(++_0x54077d);}(_0x9d5a,0x187));var _0xa9d5=function(_0x728a0d,_0x44ca89){_0x728a0d=_0x728a0d-0x0;var _0xc575ed=_0x9d5a[_0x728a0d];return _0xc575ed;};'use strict';var multer=require(_0xa9d5('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa9d5('0x1'));var express=require(_0xa9d5('0x2'));var router=express[_0xa9d5('0x3')]();var auth=require(_0xa9d5('0x4'));var interaction=require(_0xa9d5('0x5'));var config=require(_0xa9d5('0x6'));module[_0xa9d5('0x7')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 50afb13..a9771d9 100644 --- a/server/api/userChatQueue/userChatQueue.attributes.js +++ b/server/api/userChatQueue/userChatQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['INTEGER','sequelize','exports'];(function(_0x2a40ef,_0x48889e){var _0x1f9bc7=function(_0x33a718){while(--_0x33a718){_0x2a40ef['push'](_0x2a40ef['shift']());}};_0x1f9bc7(++_0x48889e);}(_0xe706,0xa3));var _0x6e70=function(_0x3d0198,_0x94b95c){_0x3d0198=_0x3d0198-0x0;var _0x3488b2=_0xe706[_0x3d0198];return _0x3488b2;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'penalty':{'type':Sequelize[_0x6e70('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd8b0=['exports','sequelize'];(function(_0x92c450,_0x41f1e3){var _0x2a9599=function(_0x4f27df){while(--_0x4f27df){_0x92c450['push'](_0x92c450['shift']());}};_0x2a9599(++_0x41f1e3);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index c0073ec..0e0a7bd 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 _0x15ef=['request-promise','path','rimraf','./userChatQueue.attributes','exports','define','UserChatQueue','util','../../config/logger','moment','bluebird'];(function(_0x55fa5c,_0x30bd41){var _0xea802f=function(_0x4bc014){while(--_0x4bc014){_0x55fa5c['push'](_0x55fa5c['shift']());}};_0xea802f(++_0x30bd41);}(_0x15ef,0x80));var _0xf15e=function(_0x4edde5,_0x293eb7){_0x4edde5=_0x4edde5-0x0;var _0x91564a=_0x15ef[_0x4edde5];return _0x91564a;};'use strict';var _=require('lodash');var util=require(_0xf15e('0x0'));var logger=require(_0xf15e('0x1'))('api');var moment=require(_0xf15e('0x2'));var BPromise=require(_0xf15e('0x3'));var rp=require(_0xf15e('0x4'));var fs=require('fs');var path=require(_0xf15e('0x5'));var rimraf=require(_0xf15e('0x6'));var config=require('../../config/environment');var attributes=require(_0xf15e('0x7'));module[_0xf15e('0x8')]=function(_0x5e96b4,_0x5ba863){return _0x5e96b4[_0xf15e('0x9')](_0xf15e('0xa'),attributes,{'tableName':'user_has_chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9ccc=['moment','request-promise','path','../../config/environment','./userChatQueue.attributes','exports','define','UserChatQueue','lodash','util','api'];(function(_0x526f0c,_0x473158){var _0x5f4fe6=function(_0x1b2d59){while(--_0x1b2d59){_0x526f0c['push'](_0x526f0c['shift']());}};_0x5f4fe6(++_0x473158);}(_0x9ccc,0x11b));var _0xc9cc=function(_0x2fd1d6,_0x3b57e0){_0x2fd1d6=_0x2fd1d6-0x0;var _0x1078b3=_0x9ccc[_0x2fd1d6];return _0x1078b3;};'use strict';var _=require(_0xc9cc('0x0'));var util=require(_0xc9cc('0x1'));var logger=require('../../config/logger')(_0xc9cc('0x2'));var moment=require(_0xc9cc('0x3'));var BPromise=require('bluebird');var rp=require(_0xc9cc('0x4'));var fs=require('fs');var path=require(_0xc9cc('0x5'));var rimraf=require('rimraf');var config=require(_0xc9cc('0x6'));var attributes=require(_0xc9cc('0x7'));module[_0xc9cc('0x8')]=function(_0x224d6f,_0x3054f4){return _0x224d6f[_0xc9cc('0x9')](_0xc9cc('0xa'),attributes,{'tableName':'user_has_chat_queues','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 968e71a..3891857 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 _0xf6c7=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x1bc747,_0x15bed2){var _0x2dc7fd=function(_0x440d36){while(--_0x440d36){_0x1bc747['push'](_0x1bc747['shift']());}};_0x2dc7fd(++_0x15bed2);}(_0xf6c7,0xa3));var _0x7f6c=function(_0x51f2c7,_0x595e35){_0x51f2c7=_0x51f2c7-0x0;var _0x4c12fd=_0xf6c7[_0x51f2c7];return _0x4c12fd;};'use strict';var _=require(_0x7f6c('0x0'));var util=require(_0x7f6c('0x1'));var moment=require(_0x7f6c('0x2'));var BPromise=require(_0x7f6c('0x3'));var rs=require(_0x7f6c('0x4'));var fs=require('fs');var Redis=require(_0x7f6c('0x5'));var db=require(_0x7f6c('0x6'))['db'];var utils=require(_0x7f6c('0x7'));var logger=require('../../config/logger')(_0x7f6c('0x8'));var config=require(_0x7f6c('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7f6c('0xa')][_0x7f6c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3c80e9,_0x3c1095,_0x3bd3b6){return new BPromise(function(_0x3f5eb6,_0x227cbb){return client[_0x7f6c('0xc')](_0x3c80e9,_0x3bd3b6)[_0x7f6c('0xd')](function(_0x127345){logger[_0x7f6c('0xe')](_0x7f6c('0xf'),_0x3c1095,_0x7f6c('0x10'));logger['debug'](_0x7f6c('0x11'),_0x3c1095,_0x7f6c('0x10'),JSON[_0x7f6c('0x12')](_0x127345));if(_0x127345[_0x7f6c('0x13')]){if(_0x127345['error'][_0x7f6c('0x14')]===0x1f4){logger['error'](_0x7f6c('0xf'),_0x3c1095,_0x127345[_0x7f6c('0x13')][_0x7f6c('0x15')]);return _0x227cbb(_0x127345['error'][_0x7f6c('0x15')]);}logger['error'](_0x7f6c('0xf'),_0x3c1095,_0x127345[_0x7f6c('0x13')][_0x7f6c('0x15')]);return _0x3f5eb6(_0x127345[_0x7f6c('0x13')][_0x7f6c('0x15')]);}else{logger[_0x7f6c('0xe')](_0x7f6c('0xf'),_0x3c1095,_0x7f6c('0x10'));_0x3f5eb6(_0x127345[_0x7f6c('0x16')][_0x7f6c('0x15')]);}})[_0x7f6c('0x17')](function(_0x5618aa){logger[_0x7f6c('0x13')](_0x7f6c('0xf'),_0x3c1095,_0x5618aa);_0x227cbb(_0x5618aa);});});} \ No newline at end of file +var _0x0032=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','error','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x19eace,_0x3e187){var _0x32f929=function(_0x5908fd){while(--_0x5908fd){_0x19eace['push'](_0x19eace['shift']());}};_0x32f929(++_0x3e187);}(_0x0032,0x174));var _0x2003=function(_0x3d8775,_0x102056){_0x3d8775=_0x3d8775-0x0;var _0x47d3c2=_0x0032[_0x3d8775];return _0x47d3c2;};'use strict';var _=require(_0x2003('0x0'));var util=require(_0x2003('0x1'));var moment=require('moment');var BPromise=require(_0x2003('0x2'));var rs=require(_0x2003('0x3'));var fs=require('fs');var Redis=require(_0x2003('0x4'));var db=require(_0x2003('0x5'))['db'];var utils=require(_0x2003('0x6'));var logger=require(_0x2003('0x7'))('rpc');var config=require(_0x2003('0x8'));var jayson=require(_0x2003('0x9'));var client=jayson[_0x2003('0xa')][_0x2003('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5e2fa0,_0x340f7f,_0x1e8ea8){return new BPromise(function(_0x31bffb,_0x472113){return client[_0x2003('0xc')](_0x5e2fa0,_0x1e8ea8)[_0x2003('0xd')](function(_0x3df30d){logger[_0x2003('0xe')](_0x2003('0xf'),_0x340f7f,_0x2003('0x10'));logger[_0x2003('0x11')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x340f7f,_0x2003('0x10'),JSON['stringify'](_0x3df30d));if(_0x3df30d[_0x2003('0x12')]){if(_0x3df30d[_0x2003('0x12')]['code']===0x1f4){logger[_0x2003('0x12')]('UserChatQueue,\x20%s,\x20%s',_0x340f7f,_0x3df30d[_0x2003('0x12')][_0x2003('0x13')]);return _0x472113(_0x3df30d['error'][_0x2003('0x13')]);}logger[_0x2003('0x12')](_0x2003('0xf'),_0x340f7f,_0x3df30d[_0x2003('0x12')]['message']);return _0x31bffb(_0x3df30d[_0x2003('0x12')][_0x2003('0x13')]);}else{logger[_0x2003('0xe')](_0x2003('0xf'),_0x340f7f,_0x2003('0x10'));_0x31bffb(_0x3df30d['result'][_0x2003('0x13')]);}})[_0x2003('0x14')](function(_0x4e35b3){logger[_0x2003('0x12')](_0x2003('0xf'),_0x340f7f,_0x4e35b3);_0x472113(_0x4e35b3);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 44defab..8e625f0 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 _0xec10=['../../config/environment','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xec10,0x7a));var _0x0ec1=function(_0x46e4d0,_0x2286d){_0x46e4d0=_0x46e4d0-0x0;var _0x471da5=_0xec10[_0x46e4d0];return _0x471da5;};'use strict';var multer=require(_0x0ec1('0x0'));var util=require('util');var path=require(_0x0ec1('0x1'));var timeout=require(_0x0ec1('0x2'));var express=require(_0x0ec1('0x3'));var router=express['Router']();var auth=require(_0x0ec1('0x4'));var interaction=require(_0x0ec1('0x5'));var config=require(_0x0ec1('0x6'));module[_0x0ec1('0x7')]=router; \ No newline at end of file +var _0x2ffc=['util','path','connect-timeout','Router','../../components/interaction/service','exports','multer'];(function(_0x510ed7,_0x11400c){var _0x17dfcb=function(_0x4d989d){while(--_0x4d989d){_0x510ed7['push'](_0x510ed7['shift']());}};_0x17dfcb(++_0x11400c);}(_0x2ffc,0xca));var _0xc2ff=function(_0x5e9d3a,_0x89a62f){_0x5e9d3a=_0x5e9d3a-0x0;var _0x525832=_0x2ffc[_0x5e9d3a];return _0x525832;};'use strict';var multer=require(_0xc2ff('0x0'));var util=require(_0xc2ff('0x1'));var path=require(_0xc2ff('0x2'));var timeout=require(_0xc2ff('0x3'));var express=require('express');var router=express[_0xc2ff('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xc2ff('0x5'));var config=require('../../config/environment');module[_0xc2ff('0x6')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index d0fa74d..5643567 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 _0xda2d=['exports','INTEGER','STRING'];(function(_0x167239,_0x48f792){var _0x56ca09=function(_0x21c45f){while(--_0x21c45f){_0x167239['push'](_0x167239['shift']());}};_0x56ca09(++_0x48f792);}(_0xda2d,0x102));var _0xdda2=function(_0x46c267,_0x3b9486){_0x46c267=_0x46c267-0x0;var _0x41ce66=_0xda2d[_0x46c267];return _0x41ce66;};'use strict';var Sequelize=require('sequelize');module[_0xdda2('0x0')]={'penalty':{'type':Sequelize[_0xdda2('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xdda2('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xdda2('0x2')]}}; \ No newline at end of file +var _0x9354=['exports','INTEGER','STRING'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x9354,0x96));var _0x4935=function(_0x269e23,_0x14d11c){_0x269e23=_0x269e23-0x0;var _0x69ad53=_0x9354[_0x269e23];return _0x69ad53;};'use strict';var Sequelize=require('sequelize');module[_0x4935('0x0')]={'penalty':{'type':Sequelize[_0x4935('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize[_0x4935('0x2')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 1012ef8..ecc0319 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 _0x29a1=['bluebird','request-promise','path','rimraf','./userFaxQueue.attributes','exports','define','UserFaxQueue','user_has_fax_queues','util','../../config/logger','api','moment'];(function(_0x4512d0,_0x2760e7){var _0x3dcfc1=function(_0x32142d){while(--_0x32142d){_0x4512d0['push'](_0x4512d0['shift']());}};_0x3dcfc1(++_0x2760e7);}(_0x29a1,0x98));var _0x129a=function(_0x588835,_0x217ed5){_0x588835=_0x588835-0x0;var _0xb89a50=_0x29a1[_0x588835];return _0xb89a50;};'use strict';var _=require('lodash');var util=require(_0x129a('0x0'));var logger=require(_0x129a('0x1'))(_0x129a('0x2'));var moment=require(_0x129a('0x3'));var BPromise=require(_0x129a('0x4'));var rp=require(_0x129a('0x5'));var fs=require('fs');var path=require(_0x129a('0x6'));var rimraf=require(_0x129a('0x7'));var config=require('../../config/environment');var attributes=require(_0x129a('0x8'));module[_0x129a('0x9')]=function(_0x374cb2,_0x4853a2){return _0x374cb2[_0x129a('0xa')](_0x129a('0xb'),attributes,{'tableName':_0x129a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9d26=['moment','bluebird','request-promise','rimraf','./userFaxQueue.attributes','exports','define','UserFaxQueue','user_has_fax_queues','lodash','../../config/logger','api'];(function(_0x279994,_0x582317){var _0x353d7a=function(_0x2c101f){while(--_0x2c101f){_0x279994['push'](_0x279994['shift']());}};_0x353d7a(++_0x582317);}(_0x9d26,0x17d));var _0x69d2=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x9d26[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x69d2('0x0'));var util=require('util');var logger=require(_0x69d2('0x1'))(_0x69d2('0x2'));var moment=require(_0x69d2('0x3'));var BPromise=require(_0x69d2('0x4'));var rp=require(_0x69d2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x69d2('0x6'));var config=require('../../config/environment');var attributes=require(_0x69d2('0x7'));module[_0x69d2('0x8')]=function(_0x433136,_0x4f55b0){return _0x433136[_0x69d2('0x9')](_0x69d2('0xa'),attributes,{'tableName':_0x69d2('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 adec8fb..2109295 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 _0xe2dc=['then','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','request'];(function(_0x1044e5,_0x498e01){var _0x5ad0dd=function(_0x458548){while(--_0x458548){_0x1044e5['push'](_0x1044e5['shift']());}};_0x5ad0dd(++_0x498e01);}(_0xe2dc,0xde));var _0xce2d=function(_0x167238,_0x344324){_0x167238=_0x167238-0x0;var _0x4aff64=_0xe2dc[_0x167238];return _0x4aff64;};'use strict';var _=require(_0xce2d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xce2d('0x1'));var rs=require(_0xce2d('0x2'));var fs=require('fs');var Redis=require(_0xce2d('0x3'));var db=require(_0xce2d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xce2d('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xce2d('0x6'));var client=jayson[_0xce2d('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5ed552,_0x4fceee,_0xf4225e){return new BPromise(function(_0x572837,_0xb45424){return client[_0xce2d('0x8')](_0x5ed552,_0xf4225e)[_0xce2d('0x9')](function(_0xa55518){logger['info'](_0xce2d('0xa'),_0x4fceee,_0xce2d('0xb'));logger[_0xce2d('0xc')](_0xce2d('0xd'),_0x4fceee,_0xce2d('0xb'),JSON[_0xce2d('0xe')](_0xa55518));if(_0xa55518['error']){if(_0xa55518['error'][_0xce2d('0xf')]===0x1f4){logger[_0xce2d('0x10')](_0xce2d('0xa'),_0x4fceee,_0xa55518[_0xce2d('0x10')][_0xce2d('0x11')]);return _0xb45424(_0xa55518[_0xce2d('0x10')][_0xce2d('0x11')]);}logger['error'](_0xce2d('0xa'),_0x4fceee,_0xa55518[_0xce2d('0x10')][_0xce2d('0x11')]);return _0x572837(_0xa55518[_0xce2d('0x10')]['message']);}else{logger[_0xce2d('0x12')](_0xce2d('0xa'),_0x4fceee,_0xce2d('0xb'));_0x572837(_0xa55518[_0xce2d('0x13')]['message']);}})[_0xce2d('0x14')](function(_0x5841cc){logger[_0xce2d('0x10')]('UserFaxQueue,\x20%s,\x20%s',_0x4fceee,_0x5841cc);_0xb45424(_0x5841cc);});});} \ No newline at end of file +var _0x6659=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x5f156c,_0x2ae475){var _0x550280=function(_0x1f0f72){while(--_0x1f0f72){_0x5f156c['push'](_0x5f156c['shift']());}};_0x550280(++_0x2ae475);}(_0x6659,0x169));var _0x9665=function(_0x1e17e0,_0x524c74){_0x1e17e0=_0x1e17e0-0x0;var _0x33e2c9=_0x6659[_0x1e17e0];return _0x33e2c9;};'use strict';var _=require(_0x9665('0x0'));var util=require(_0x9665('0x1'));var moment=require(_0x9665('0x2'));var BPromise=require(_0x9665('0x3'));var rs=require(_0x9665('0x4'));var fs=require('fs');var Redis=require(_0x9665('0x5'));var db=require(_0x9665('0x6'))['db'];var utils=require(_0x9665('0x7'));var logger=require('../../config/logger')(_0x9665('0x8'));var config=require(_0x9665('0x9'));var jayson=require(_0x9665('0xa'));var client=jayson[_0x9665('0xb')][_0x9665('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3b36f8,_0x585ec6,_0x2404b1){return new BPromise(function(_0xe9d4ff,_0x1738a5){return client[_0x9665('0xd')](_0x3b36f8,_0x2404b1)[_0x9665('0xe')](function(_0x439736){logger[_0x9665('0xf')](_0x9665('0x10'),_0x585ec6,_0x9665('0x11'));logger[_0x9665('0x12')](_0x9665('0x13'),_0x585ec6,_0x9665('0x11'),JSON['stringify'](_0x439736));if(_0x439736[_0x9665('0x14')]){if(_0x439736['error'][_0x9665('0x15')]===0x1f4){logger[_0x9665('0x14')](_0x9665('0x10'),_0x585ec6,_0x439736[_0x9665('0x14')]['message']);return _0x1738a5(_0x439736[_0x9665('0x14')][_0x9665('0x16')]);}logger[_0x9665('0x14')](_0x9665('0x10'),_0x585ec6,_0x439736[_0x9665('0x14')][_0x9665('0x16')]);return _0xe9d4ff(_0x439736[_0x9665('0x14')]['message']);}else{logger[_0x9665('0xf')]('UserFaxQueue,\x20%s,\x20%s',_0x585ec6,_0x9665('0x11'));_0xe9d4ff(_0x439736['result']['message']);}})[_0x9665('0x17')](function(_0x51c83f){logger['error'](_0x9665('0x10'),_0x585ec6,_0x51c83f);_0x1738a5(_0x51c83f);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index e9ce1a2..69c162d 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 _0x3d61=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util','connect-timeout','express'];(function(_0x40f4d3,_0x2c163c){var _0x342be1=function(_0x26c186){while(--_0x26c186){_0x40f4d3['push'](_0x40f4d3['shift']());}};_0x342be1(++_0x2c163c);}(_0x3d61,0x11c));var _0x13d6=function(_0x3a750f,_0xf6cbd8){_0x3a750f=_0x3a750f-0x0;var _0x2c8daf=_0x3d61[_0x3a750f];return _0x2c8daf;};'use strict';var multer=require(_0x13d6('0x0'));var util=require(_0x13d6('0x1'));var path=require('path');var timeout=require(_0x13d6('0x2'));var express=require(_0x13d6('0x3'));var router=express[_0x13d6('0x4')]();var auth=require(_0x13d6('0x5'));var interaction=require(_0x13d6('0x6'));var config=require(_0x13d6('0x7'));module['exports']=router; \ No newline at end of file +var _0x5f43=['Router','../../components/auth/service','../../config/environment','exports','multer','util','path','express'];(function(_0xcbbd62,_0x30c1f1){var _0x2ea23f=function(_0x181e76){while(--_0x181e76){_0xcbbd62['push'](_0xcbbd62['shift']());}};_0x2ea23f(++_0x30c1f1);}(_0x5f43,0x1f4));var _0x35f4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5f43[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x35f4('0x0'));var util=require(_0x35f4('0x1'));var path=require(_0x35f4('0x2'));var timeout=require('connect-timeout');var express=require(_0x35f4('0x3'));var router=express[_0x35f4('0x4')]();var auth=require(_0x35f4('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x35f4('0x6'));module[_0x35f4('0x7')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index efcadac..a1cbcea 100644 --- a/server/api/userMailQueue/userMailQueue.attributes.js +++ b/server/api/userMailQueue/userMailQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['sequelize','exports','INTEGER'];(function(_0x227a4c,_0x555501){var _0x1891d1=function(_0x1edf2e){while(--_0x1edf2e){_0x227a4c['push'](_0x227a4c['shift']());}};_0x1891d1(++_0x555501);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'penalty':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xbaf0=['exports','INTEGER'];(function(_0x5a1d97,_0x265b5a){var _0x401646=function(_0x4dd898){while(--_0x4dd898){_0x5a1d97['push'](_0x5a1d97['shift']());}};_0x401646(++_0x265b5a);}(_0xbaf0,0x12a));var _0x0baf=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xbaf0[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'penalty':{'type':Sequelize[_0x0baf('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index 7d3997f..67b3833 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 _0x2032=['user_has_mail_queues','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue'];(function(_0x3b20b7,_0x33b972){var _0x2e48b9=function(_0x9dce24){while(--_0x9dce24){_0x3b20b7['push'](_0x3b20b7['shift']());}};_0x2e48b9(++_0x33b972);}(_0x2032,0xd9));var _0x2203=function(_0x23b589,_0x5e9af0){_0x23b589=_0x23b589-0x0;var _0x7701c5=_0x2032[_0x23b589];return _0x7701c5;};'use strict';var _=require('lodash');var util=require(_0x2203('0x0'));var logger=require(_0x2203('0x1'))(_0x2203('0x2'));var moment=require('moment');var BPromise=require(_0x2203('0x3'));var rp=require(_0x2203('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var attributes=require(_0x2203('0x7'));module[_0x2203('0x8')]=function(_0x3f7ba1,_0x13367a){return _0x3f7ba1[_0x2203('0x9')](_0x2203('0xa'),attributes,{'tableName':_0x2203('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0713=['moment','bluebird','request-promise','rimraf','../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue','user_has_mail_queues','../../config/logger','api'];(function(_0x5cd1be,_0x25d35e){var _0x5df237=function(_0x529088){while(--_0x529088){_0x5cd1be['push'](_0x5cd1be['shift']());}};_0x5df237(++_0x25d35e);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.rpc.js b/server/api/userMailQueue/userMailQueue.rpc.js index eab583e..e98ac5b 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 _0xa4dc=['code','UserMailQueue,\x20%s,\x20%s','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','info','request\x20sent','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x36b4de,_0x3c556f){var _0x4fc244=function(_0x2708fd){while(--_0x2708fd){_0x36b4de['push'](_0x36b4de['shift']());}};_0x4fc244(++_0x3c556f);}(_0xa4dc,0x16a));var _0xca4d=function(_0x580647,_0x43d2c3){_0x580647=_0x580647-0x0;var _0x5f0792=_0xa4dc[_0x580647];return _0x5f0792;};'use strict';var _=require(_0xca4d('0x0'));var util=require(_0xca4d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xca4d('0x2'));var fs=require('fs');var Redis=require(_0xca4d('0x3'));var db=require(_0xca4d('0x4'))['db'];var utils=require(_0xca4d('0x5'));var logger=require(_0xca4d('0x6'))('rpc');var config=require(_0xca4d('0x7'));var jayson=require(_0xca4d('0x8'));var client=jayson[_0xca4d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x299f58,_0x5e3284,_0x35b21a){return new BPromise(function(_0x2fa52a,_0x21c434){return client[_0xca4d('0xa')](_0x299f58,_0x35b21a)['then'](function(_0x182f8a){logger[_0xca4d('0xb')]('UserMailQueue,\x20%s,\x20%s',_0x5e3284,_0xca4d('0xc'));logger['debug'](_0xca4d('0xd'),_0x5e3284,_0xca4d('0xc'),JSON[_0xca4d('0xe')](_0x182f8a));if(_0x182f8a[_0xca4d('0xf')]){if(_0x182f8a[_0xca4d('0xf')][_0xca4d('0x10')]===0x1f4){logger[_0xca4d('0xf')](_0xca4d('0x11'),_0x5e3284,_0x182f8a['error'][_0xca4d('0x12')]);return _0x21c434(_0x182f8a['error'][_0xca4d('0x12')]);}logger[_0xca4d('0xf')](_0xca4d('0x11'),_0x5e3284,_0x182f8a['error'][_0xca4d('0x12')]);return _0x2fa52a(_0x182f8a['error'][_0xca4d('0x12')]);}else{logger[_0xca4d('0xb')](_0xca4d('0x11'),_0x5e3284,_0xca4d('0xc'));_0x2fa52a(_0x182f8a[_0xca4d('0x13')][_0xca4d('0x12')]);}})[_0xca4d('0x14')](function(_0x5b7620){logger[_0xca4d('0xf')](_0xca4d('0x11'),_0x5e3284,_0x5b7620);_0x21c434(_0x5b7620);});});} \ No newline at end of file +var _0x3d1f=['then','info','UserMailQueue,\x20%s,\x20%s','UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3d1f,0xfb));var _0xf3d1=function(_0x4429ee,_0x27d687){_0x4429ee=_0x4429ee-0x0;var _0x4a3b8e=_0x3d1f[_0x4429ee];return _0x4a3b8e;};'use strict';var _=require(_0xf3d1('0x0'));var util=require(_0xf3d1('0x1'));var moment=require(_0xf3d1('0x2'));var BPromise=require(_0xf3d1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf3d1('0x4'));var db=require(_0xf3d1('0x5'))['db'];var utils=require(_0xf3d1('0x6'));var logger=require(_0xf3d1('0x7'))(_0xf3d1('0x8'));var config=require(_0xf3d1('0x9'));var jayson=require(_0xf3d1('0xa'));var client=jayson['client'][_0xf3d1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xb126f1,_0x54cc8a,_0x251bb6){return new BPromise(function(_0xa1d749,_0x54309b){return client[_0xf3d1('0xc')](_0xb126f1,_0x251bb6)[_0xf3d1('0xd')](function(_0x499bf1){logger[_0xf3d1('0xe')](_0xf3d1('0xf'),_0x54cc8a,'request\x20sent');logger['debug'](_0xf3d1('0x10'),_0x54cc8a,_0xf3d1('0x11'),JSON[_0xf3d1('0x12')](_0x499bf1));if(_0x499bf1[_0xf3d1('0x13')]){if(_0x499bf1[_0xf3d1('0x13')][_0xf3d1('0x14')]===0x1f4){logger[_0xf3d1('0x13')](_0xf3d1('0xf'),_0x54cc8a,_0x499bf1[_0xf3d1('0x13')]['message']);return _0x54309b(_0x499bf1['error']['message']);}logger['error']('UserMailQueue,\x20%s,\x20%s',_0x54cc8a,_0x499bf1[_0xf3d1('0x13')]['message']);return _0xa1d749(_0x499bf1[_0xf3d1('0x13')][_0xf3d1('0x15')]);}else{logger[_0xf3d1('0xe')](_0xf3d1('0xf'),_0x54cc8a,_0xf3d1('0x11'));_0xa1d749(_0x499bf1[_0xf3d1('0x16')][_0xf3d1('0x15')]);}})[_0xf3d1('0x17')](function(_0x5ac2d3){logger[_0xf3d1('0x13')]('UserMailQueue,\x20%s,\x20%s',_0x54cc8a,_0x5ac2d3);_0x54309b(_0x5ac2d3);});});} \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index deb7cca..0bad203 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 _0x785f=['multer','path','connect-timeout','express','Router','../../config/environment','exports'];(function(_0x15f01a,_0x526463){var _0x4d1065=function(_0x3959d1){while(--_0x3959d1){_0x15f01a['push'](_0x15f01a['shift']());}};_0x4d1065(++_0x526463);}(_0x785f,0x69));var _0xf785=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x785f[_0x24061a];return _0x82054e;};'use strict';var multer=require(_0xf785('0x0'));var util=require('util');var path=require(_0xf785('0x1'));var timeout=require(_0xf785('0x2'));var express=require(_0xf785('0x3'));var router=express[_0xf785('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf785('0x5'));module[_0xf785('0x6')]=router; \ No newline at end of file +var _0x5b9c=['../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util','path','connect-timeout'];(function(_0x2d304d,_0x462fb5){var _0x16be9a=function(_0x2f8575){while(--_0x2f8575){_0x2d304d['push'](_0x2d304d['shift']());}};_0x16be9a(++_0x462fb5);}(_0x5b9c,0x74));var _0xc5b9=function(_0x197bdb,_0x5b2a6d){_0x197bdb=_0x197bdb-0x0;var _0x4c3b42=_0x5b9c[_0x197bdb];return _0x4c3b42;};'use strict';var multer=require(_0xc5b9('0x0'));var util=require(_0xc5b9('0x1'));var path=require(_0xc5b9('0x2'));var timeout=require(_0xc5b9('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0xc5b9('0x4'));var interaction=require(_0xc5b9('0x5'));var config=require(_0xc5b9('0x6'));module[_0xc5b9('0x7')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 2fcec79..ff672e3 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 _0xbaf0=['exports','INTEGER'];(function(_0x53ddab,_0x4ada9d){var _0x5819ac=function(_0x4d5fc8){while(--_0x4d5fc8){_0x53ddab['push'](_0x53ddab['shift']());}};_0x5819ac(++_0x4ada9d);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xbaf0[_0x6131cd];return _0x47e916;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'penalty':{'type':Sequelize[_0x0baf('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd8b0=['exports','sequelize'];(function(_0x41767b,_0x38eb62){var _0x4afb48=function(_0x576e4a){while(--_0x576e4a){_0x41767b['push'](_0x41767b['shift']());}};_0x4afb48(++_0x38eb62);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index aa24f4b..2f89c42 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 _0x3f6d=['exports','define','UserOpenchannelQueue','lodash','util','api','request-promise','path','./userOpenchannelQueue.attributes'];(function(_0x15ec35,_0x5b9972){var _0x937cce=function(_0x59326b){while(--_0x59326b){_0x15ec35['push'](_0x15ec35['shift']());}};_0x937cce(++_0x5b9972);}(_0x3f6d,0x18f));var _0xd3f6=function(_0x496854,_0x20f63f){_0x496854=_0x496854-0x0;var _0x340c32=_0x3f6d[_0x496854];return _0x340c32;};'use strict';var _=require(_0xd3f6('0x0'));var util=require(_0xd3f6('0x1'));var logger=require('../../config/logger')(_0xd3f6('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd3f6('0x3'));var fs=require('fs');var path=require(_0xd3f6('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd3f6('0x5'));module[_0xd3f6('0x6')]=function(_0x5b1cc5,_0x3c1d9f){return _0x5b1cc5[_0xd3f6('0x7')](_0xd3f6('0x8'),attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf4b6=['define','UserOpenchannelQueue','user_has_openchannel_queues','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports'];(function(_0x3960b2,_0x32bbf5){var _0xe2ce69=function(_0x414679){while(--_0x414679){_0x3960b2['push'](_0x3960b2['shift']());}};_0xe2ce69(++_0x32bbf5);}(_0xf4b6,0x114));var _0x6f4b=function(_0x276be0,_0x284fc9){_0x276be0=_0x276be0-0x0;var _0x410995=_0xf4b6[_0x276be0];return _0x410995;};'use strict';var _=require('lodash');var util=require(_0x6f4b('0x0'));var logger=require(_0x6f4b('0x1'))(_0x6f4b('0x2'));var moment=require(_0x6f4b('0x3'));var BPromise=require(_0x6f4b('0x4'));var rp=require(_0x6f4b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6f4b('0x6'));var config=require(_0x6f4b('0x7'));var attributes=require(_0x6f4b('0x8'));module[_0x6f4b('0x9')]=function(_0x1a953a,_0x3dedd4){return _0x1a953a[_0x6f4b('0xa')](_0x6f4b('0xb'),attributes,{'tableName':_0x6f4b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js index 69fc025..01c6f7b 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 _0x4719=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util'];(function(_0x46491d,_0x29ad6c){var _0x217575=function(_0x2b5325){while(--_0x2b5325){_0x46491d['push'](_0x46491d['shift']());}};_0x217575(++_0x29ad6c);}(_0x4719,0xaf));var _0x9471=function(_0x52f1e1,_0x375d41){_0x52f1e1=_0x52f1e1-0x0;var _0x446dbe=_0x4719[_0x52f1e1];return _0x446dbe;};'use strict';var _=require('lodash');var util=require(_0x9471('0x0'));var moment=require(_0x9471('0x1'));var BPromise=require(_0x9471('0x2'));var rs=require(_0x9471('0x3'));var fs=require('fs');var Redis=require(_0x9471('0x4'));var db=require(_0x9471('0x5'))['db'];var utils=require(_0x9471('0x6'));var logger=require(_0x9471('0x7'))(_0x9471('0x8'));var config=require('../../config/environment');var jayson=require(_0x9471('0x9'));var client=jayson[_0x9471('0xa')][_0x9471('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2be9be,_0x336089,_0x351b5b){return new BPromise(function(_0x5c66a0,_0x1bdd27){return client['request'](_0x2be9be,_0x351b5b)['then'](function(_0x4f39b5){logger[_0x9471('0xc')](_0x9471('0xd'),_0x336089,_0x9471('0xe'));logger[_0x9471('0xf')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x336089,_0x9471('0xe'),JSON[_0x9471('0x10')](_0x4f39b5));if(_0x4f39b5[_0x9471('0x11')]){if(_0x4f39b5[_0x9471('0x11')][_0x9471('0x12')]===0x1f4){logger['error'](_0x9471('0xd'),_0x336089,_0x4f39b5[_0x9471('0x11')][_0x9471('0x13')]);return _0x1bdd27(_0x4f39b5['error'][_0x9471('0x13')]);}logger[_0x9471('0x11')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x336089,_0x4f39b5[_0x9471('0x11')][_0x9471('0x13')]);return _0x5c66a0(_0x4f39b5[_0x9471('0x11')][_0x9471('0x13')]);}else{logger['info']('UserOpenchannelQueue,\x20%s,\x20%s',_0x336089,_0x9471('0xe'));_0x5c66a0(_0x4f39b5[_0x9471('0x14')][_0x9471('0x13')]);}})[_0x9471('0x15')](function(_0x2b8ebc){logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x336089,_0x2b8ebc);_0x1bdd27(_0x2b8ebc);});});} \ No newline at end of file +var _0xcbc5=['request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x1431db,_0x2160f7){var _0x5dcb4a=function(_0x1c22fd){while(--_0x1c22fd){_0x1431db['push'](_0x1431db['shift']());}};_0x5dcb4a(++_0x2160f7);}(_0xcbc5,0xb5));var _0x5cbc=function(_0x145a69,_0x243b63){_0x145a69=_0x145a69-0x0;var _0x34ebfb=_0xcbc5[_0x145a69];return _0x34ebfb;};'use strict';var _=require(_0x5cbc('0x0'));var util=require(_0x5cbc('0x1'));var moment=require(_0x5cbc('0x2'));var BPromise=require(_0x5cbc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5cbc('0x4'));var logger=require(_0x5cbc('0x5'))(_0x5cbc('0x6'));var config=require(_0x5cbc('0x7'));var jayson=require(_0x5cbc('0x8'));var client=jayson[_0x5cbc('0x9')][_0x5cbc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x7c72b5,_0x4a59e6,_0x44c678){return new BPromise(function(_0x37a7f6,_0x571a1e){return client[_0x5cbc('0xb')](_0x7c72b5,_0x44c678)[_0x5cbc('0xc')](function(_0x492449){logger[_0x5cbc('0xd')](_0x5cbc('0xe'),_0x4a59e6,'request\x20sent');logger[_0x5cbc('0xf')](_0x5cbc('0x10'),_0x4a59e6,_0x5cbc('0x11'),JSON[_0x5cbc('0x12')](_0x492449));if(_0x492449[_0x5cbc('0x13')]){if(_0x492449[_0x5cbc('0x13')][_0x5cbc('0x14')]===0x1f4){logger[_0x5cbc('0x13')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x4a59e6,_0x492449[_0x5cbc('0x13')]['message']);return _0x571a1e(_0x492449[_0x5cbc('0x13')][_0x5cbc('0x15')]);}logger[_0x5cbc('0x13')](_0x5cbc('0xe'),_0x4a59e6,_0x492449['error'][_0x5cbc('0x15')]);return _0x37a7f6(_0x492449[_0x5cbc('0x13')]['message']);}else{logger[_0x5cbc('0xd')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x4a59e6,_0x5cbc('0x11'));_0x37a7f6(_0x492449[_0x5cbc('0x16')][_0x5cbc('0x15')]);}})[_0x5cbc('0x17')](function(_0x30066e){logger[_0x5cbc('0x13')](_0x5cbc('0xe'),_0x4a59e6,_0x30066e);_0x571a1e(_0x30066e);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 7ac69fc..5f821aa 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 _0xbd26=['index','/describe','describe','/:id','show','/:id/sections','getSections','getResources','post','create','/:id/clone','clone','addSections','/:id/resources','addResources','delete','removeSections','removeResources','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated'];(function(_0x4b8fc7,_0x5022fc){var _0x249f4a=function(_0x1b25d4){while(--_0x1b25d4){_0x4b8fc7['push'](_0x4b8fc7['shift']());}};_0x249f4a(++_0x5022fc);}(_0xbd26,0xfa));var _0x6bd2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbd26[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x6bd2('0x0'));var util=require(_0x6bd2('0x1'));var path=require('path');var timeout=require(_0x6bd2('0x2'));var express=require(_0x6bd2('0x3'));var router=express[_0x6bd2('0x4')]();var auth=require(_0x6bd2('0x5'));var interaction=require(_0x6bd2('0x6'));var config=require(_0x6bd2('0x7'));var controller=require(_0x6bd2('0x8'));router[_0x6bd2('0x9')]('/',auth[_0x6bd2('0xa')](),controller[_0x6bd2('0xb')]);router[_0x6bd2('0x9')](_0x6bd2('0xc'),auth[_0x6bd2('0xa')](),controller[_0x6bd2('0xd')]);router['get'](_0x6bd2('0xe'),auth[_0x6bd2('0xa')](),controller[_0x6bd2('0xf')]);router[_0x6bd2('0x9')](_0x6bd2('0x10'),auth[_0x6bd2('0xa')](),controller[_0x6bd2('0x11')]);router[_0x6bd2('0x9')]('/:id/resources',auth[_0x6bd2('0xa')](),controller[_0x6bd2('0x12')]);router[_0x6bd2('0x13')]('/',auth[_0x6bd2('0xa')](),controller[_0x6bd2('0x14')]);router[_0x6bd2('0x13')](_0x6bd2('0x15'),auth[_0x6bd2('0xa')](),controller[_0x6bd2('0x16')]);router[_0x6bd2('0x13')](_0x6bd2('0x10'),auth[_0x6bd2('0xa')](),controller[_0x6bd2('0x17')]);router[_0x6bd2('0x13')](_0x6bd2('0x18'),auth[_0x6bd2('0xa')](),controller[_0x6bd2('0x19')]);router['put'](_0x6bd2('0xe'),auth[_0x6bd2('0xa')](),controller['update']);router[_0x6bd2('0x1a')](_0x6bd2('0xe'),auth['isAuthenticated'](),controller['destroy']);router[_0x6bd2('0x1a')](_0x6bd2('0x10'),auth[_0x6bd2('0xa')](),controller[_0x6bd2('0x1b')]);router[_0x6bd2('0x1a')](_0x6bd2('0x18'),auth[_0x6bd2('0xa')](),controller[_0x6bd2('0x1c')]);module['exports']=router; \ No newline at end of file +var _0x5a0e=['addResources','put','update','destroy','delete','multer','util','connect-timeout','express','../../components/auth/service','../../config/environment','isAuthenticated','index','/describe','describe','get','/:id','show','getSections','getResources','post','/:id/clone','clone','/:id/sections','addSections','/:id/resources'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x5a0e,0x157));var _0xe5a0=function(_0x22b2df,_0x59214b){_0x22b2df=_0x22b2df-0x0;var _0x3ddde7=_0x5a0e[_0x22b2df];return _0x3ddde7;};'use strict';var multer=require(_0xe5a0('0x0'));var util=require(_0xe5a0('0x1'));var path=require('path');var timeout=require(_0xe5a0('0x2'));var express=require(_0xe5a0('0x3'));var router=express['Router']();var auth=require(_0xe5a0('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xe5a0('0x5'));var controller=require('./userProfile.controller');router['get']('/',auth[_0xe5a0('0x6')](),controller[_0xe5a0('0x7')]);router['get'](_0xe5a0('0x8'),auth[_0xe5a0('0x6')](),controller[_0xe5a0('0x9')]);router[_0xe5a0('0xa')](_0xe5a0('0xb'),auth['isAuthenticated'](),controller[_0xe5a0('0xc')]);router[_0xe5a0('0xa')]('/:id/sections',auth[_0xe5a0('0x6')](),controller[_0xe5a0('0xd')]);router['get']('/:id/resources',auth['isAuthenticated'](),controller[_0xe5a0('0xe')]);router['post']('/',auth[_0xe5a0('0x6')](),controller['create']);router[_0xe5a0('0xf')](_0xe5a0('0x10'),auth[_0xe5a0('0x6')](),controller[_0xe5a0('0x11')]);router[_0xe5a0('0xf')](_0xe5a0('0x12'),auth[_0xe5a0('0x6')](),controller[_0xe5a0('0x13')]);router[_0xe5a0('0xf')](_0xe5a0('0x14'),auth['isAuthenticated'](),controller[_0xe5a0('0x15')]);router[_0xe5a0('0x16')]('/:id',auth['isAuthenticated'](),controller[_0xe5a0('0x17')]);router['delete'](_0xe5a0('0xb'),auth[_0xe5a0('0x6')](),controller[_0xe5a0('0x18')]);router[_0xe5a0('0x19')](_0xe5a0('0x12'),auth[_0xe5a0('0x6')](),controller['removeSections']);router['delete'](_0xe5a0('0x14'),auth[_0xe5a0('0x6')](),controller['removeResources']);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 2869eb9..bbaef73 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 _0xa94f=['sequelize','STRING','name','setDataValue','getDataValue','split'];(function(_0x149bc3,_0x4b09d8){var _0x5d33eb=function(_0x46af03){while(--_0x46af03){_0x149bc3['push'](_0x149bc3['shift']());}};_0x5d33eb(++_0x4b09d8);}(_0xa94f,0x1bc));var _0xfa94=function(_0x33f6bb,_0x3fef47){_0x33f6bb=_0x33f6bb-0x0;var _0x8d95b0=_0xa94f[_0x33f6bb];return _0x8d95b0;};'use strict';var Sequelize=require(_0xfa94('0x0'));module['exports']={'name':{'type':Sequelize[_0xfa94('0x1')],'allowNull':![],'unique':_0xfa94('0x2')},'crudPermissions':{'type':Sequelize[_0xfa94('0x1')],'set':function(_0x24e570){this[_0xfa94('0x3')]('crudPermissions',_0x24e570?_0x24e570['join'](''):[]);},'get':function(){return this[_0xfa94('0x4')]('crudPermissions')?this[_0xfa94('0x4')]('crudPermissions')[_0xfa94('0x5')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xfa94('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0x6cfc=['getDataValue','split','exports','STRING','name','setDataValue','join','crudPermissions'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x6cfc,0x14a));var _0xc6cf=function(_0x588011,_0x5e9d11){_0x588011=_0x588011-0x0;var _0x3b3773=_0x6cfc[_0x588011];return _0x3b3773;};'use strict';var Sequelize=require('sequelize');module[_0xc6cf('0x0')]={'name':{'type':Sequelize[_0xc6cf('0x1')],'allowNull':![],'unique':_0xc6cf('0x2')},'crudPermissions':{'type':Sequelize[_0xc6cf('0x1')],'set':function(_0xbe1455){this[_0xc6cf('0x3')]('crudPermissions',_0xbe1455?_0xbe1455[_0xc6cf('0x4')](''):[]);},'get':function(){return this['getDataValue'](_0xc6cf('0x5'))?this[_0xc6cf('0x6')](_0xc6cf('0x5'))[_0xc6cf('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 6d4d5a3..fd4759e 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 _0x5ce3=['addResources','sequelize','bulkCreate','removeResources','getResources','section','undefined','Sequelize','ValidationError','Unknown\x20section','mergeResources','childModel','Invalid\x20section\x20\x27','parentSections','findOne','all','ignore','VIRTUAL','AnalyticExtractedReport','foreignKey','associatedResources','reportType','default','reportId','custom','CustomReports','rows','CmContact','Tag','Tags','color','tag','ThroughTags','value','toLowerCase','squareprojects','odbc','SquareOdbc','squarerecordings','SquareRecording','projectName','projects','JscriptyProject','Lists','ListId','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','User','role','Telephones','membername','telephone','VoiceQueues','queue','inbound','QueueCampaigns','VoiceQueue','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','VoicePrefix','ivrcampaigns','Campaign','mailqueues','mailaccounts','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','smsaccounts','Team','voicequeues','agents','telephones','Users','user','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','CannedAnswer','customdashboards','intervals','pauses','Pause','tags','templates','Trigger','trunks','Trunk','Variable','plugins','extractedreports','Reports','metrics','AnalyticMetric','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','./userProfile.socket','register','sendStatus','end','status','json','count','offset','limit','set','Content-Range','reject','update','then','destroy','stack','name','send','index','map','UserProfile','fieldName','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','field','options','includeAll','include','findAll','show','params','rawAttributes','catch','create','body','clone','find','get','omit','createdAt','updatedAt','crudPermissions','transaction','UserProfileSection','each','autoAssociation','UserProfileResource','userProfileId','Resources','describe','addSections','sectionId','push','ids','getSections','enabled','isEmpty','includes','subsections','some','Dashboard','Plugin','forEach','resourceId'];(function(_0x492445,_0x1454f9){var _0x34ca20=function(_0x33e606){while(--_0x33e606){_0x492445['push'](_0x492445['shift']());}};_0x34ca20(++_0x1454f9);}(_0x5ce3,0x80));var _0x35ce=function(_0x4b0830,_0x2e3b0a){_0x4b0830=_0x4b0830-0x0;var _0x1f53a7=_0x5ce3[_0x4b0830];return _0x1f53a7;};'use strict';var pdf=require(_0x35ce('0x0'));var emlformat=require(_0x35ce('0x1'));var rimraf=require(_0x35ce('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x35ce('0x3'));var rp=require('request-promise');var moment=require(_0x35ce('0x4'));var BPromise=require(_0x35ce('0x5'));var Mustache=require(_0x35ce('0x6'));var util=require(_0x35ce('0x7'));var path=require(_0x35ce('0x8'));var sox=require(_0x35ce('0x9'));var csv=require(_0x35ce('0xa'));var ejs=require(_0x35ce('0xb'));var fs=require('fs');var _=require(_0x35ce('0xc'));var squel=require(_0x35ce('0xd'));var crypto=require('crypto');var jsforce=require(_0x35ce('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x35ce('0xa'));var querystring=require(_0x35ce('0xf'));var Papa=require('papaparse');var Redis=require(_0x35ce('0x10'));var authService=require(_0x35ce('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x35ce('0x12'));var hardwareService=require(_0x35ce('0x13'));var logger=require(_0x35ce('0x14'))('api');var utils=require(_0x35ce('0x15'));var config=require(_0x35ce('0x16'));var db=require('../../mysqldb')['db'];config[_0x35ce('0x17')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x35ce('0x17')]));require(_0x35ce('0x18'))[_0x35ce('0x19')](socket);function respondWithStatusCode(_0x421991,_0x27af92){_0x27af92=_0x27af92||0xcc;return function(_0x4aabb4){if(_0x4aabb4){return _0x421991[_0x35ce('0x1a')](_0x27af92);}return _0x421991['status'](_0x27af92)[_0x35ce('0x1b')]();};}function respondWithResult(_0x3f9445,_0x48afa1){_0x48afa1=_0x48afa1||0xc8;return function(_0x3c7150){if(_0x3c7150){return _0x3f9445[_0x35ce('0x1c')](_0x48afa1)[_0x35ce('0x1d')](_0x3c7150);}};}function respondWithFilteredResult(_0x342c83,_0xc5adc7){return function(_0x17bc8f){if(_0x17bc8f){var _0xcece86=_0x17bc8f[_0x35ce('0x1e')],_0x4e278f=_0xc5adc7[_0x35ce('0x1f')],_0x501421=_0xc5adc7[_0x35ce('0x1f')]+_0xc5adc7[_0x35ce('0x20')],_0x5ee1ce;if(_0x501421>=_0xcece86){_0x501421=_0xcece86;_0x5ee1ce=0xc8;}else{_0x5ee1ce=0xce;}_0x342c83[_0x35ce('0x1c')](_0x5ee1ce);return _0x342c83[_0x35ce('0x21')](_0x35ce('0x22'),_0x4e278f+'-'+_0x501421+'/'+_0xcece86)['json'](_0x17bc8f);}return null;};}function patchUpdates(_0x197175){return function(_0x19dd69){try{jsonpatch['apply'](_0x19dd69,_0x197175,!![]);}catch(_0x56b4c3){return BPromise[_0x35ce('0x23')](_0x56b4c3);}return _0x19dd69['save']();};}function saveUpdates(_0x27bee0,_0x363ae3){return function(_0x5d7627){if(_0x5d7627){return _0x5d7627[_0x35ce('0x24')](_0x27bee0)[_0x35ce('0x25')](function(_0x4c5861){return _0x4c5861;});}return null;};}function removeEntity(_0x4c0890,_0x1c8bab){return function(_0x5474c5){if(_0x5474c5){return _0x5474c5[_0x35ce('0x26')]()[_0x35ce('0x25')](function(){_0x4c0890[_0x35ce('0x1c')](0xcc)[_0x35ce('0x1b')]();});}};}function handleEntityNotFound(_0x2f6f97,_0x3803a2){return function(_0x3e0827){if(!_0x3e0827){_0x2f6f97[_0x35ce('0x1a')](0x194);}return _0x3e0827;};}function handleError(_0x40a5e7,_0x3bbd6a){_0x3bbd6a=_0x3bbd6a||0x1f4;return function(_0x2761fd){logger['error'](_0x2761fd[_0x35ce('0x27')]);if(_0x2761fd[_0x35ce('0x28')]){delete _0x2761fd[_0x35ce('0x28')];}_0x40a5e7['status'](_0x3bbd6a)[_0x35ce('0x29')](_0x2761fd);};}exports[_0x35ce('0x2a')]=function(_0x2a6d77,_0x343073){var _0x255c29={},_0x859c34={},_0xb4247={'count':0x0,'rows':[]};var _0x137ddb=_[_0x35ce('0x2b')](db[_0x35ce('0x2c')]['rawAttributes'],function(_0x1a9725){return{'name':_0x1a9725[_0x35ce('0x2d')],'type':_0x1a9725['type'][_0x35ce('0x2e')]};});_0x859c34[_0x35ce('0x2f')]=_[_0x35ce('0x2b')](_0x137ddb,'name');_0x859c34['query']=_[_0x35ce('0x30')](_0x2a6d77['query']);_0x859c34[_0x35ce('0x31')]=_[_0x35ce('0x32')](_0x859c34[_0x35ce('0x2f')],_0x859c34[_0x35ce('0x33')]);_0x255c29['attributes']=_['intersection'](_0x859c34['model'],qs[_0x35ce('0x34')](_0x2a6d77[_0x35ce('0x33')][_0x35ce('0x34')]));_0x255c29[_0x35ce('0x35')]=_0x255c29['attributes'][_0x35ce('0x36')]?_0x255c29[_0x35ce('0x35')]:_0x859c34[_0x35ce('0x2f')];if(!_0x2a6d77[_0x35ce('0x33')][_0x35ce('0x37')](_0x35ce('0x38'))){_0x255c29[_0x35ce('0x20')]=qs['limit'](_0x2a6d77[_0x35ce('0x33')][_0x35ce('0x20')]);_0x255c29[_0x35ce('0x1f')]=qs[_0x35ce('0x1f')](_0x2a6d77[_0x35ce('0x33')][_0x35ce('0x1f')]);}_0x255c29[_0x35ce('0x39')]=qs[_0x35ce('0x3a')](_0x2a6d77[_0x35ce('0x33')]['sort']);_0x255c29['where']=qs[_0x35ce('0x31')](_[_0x35ce('0x3b')](_0x2a6d77[_0x35ce('0x33')],_0x859c34[_0x35ce('0x31')]));if(_0x2a6d77[_0x35ce('0x33')][_0x35ce('0x3c')]){_0x255c29[_0x35ce('0x3d')]=_[_0x35ce('0x3e')](_0x255c29[_0x35ce('0x3d')],{'$or':_[_0x35ce('0x2b')](_0x137ddb,function(_0x4dec48){if(_0x4dec48[_0x35ce('0x3f')]['key']!=='VIRTUAL'){var _0x8fbbd4={};_0x8fbbd4[_0x4dec48[_0x35ce('0x40')]]={'$like':'%'+_0x2a6d77[_0x35ce('0x33')][_0x35ce('0x3c')]+'%'};return _0x8fbbd4;}})});}_0x255c29=_[_0x35ce('0x3e')]({},_0x255c29,_0x2a6d77[_0x35ce('0x41')]);var _0x1d394c={'where':_0x255c29[_0x35ce('0x3d')]};return db[_0x35ce('0x2c')][_0x35ce('0x1e')](_0x1d394c)[_0x35ce('0x25')](function(_0x24a518){_0xb4247[_0x35ce('0x1e')]=_0x24a518;if(_0x2a6d77[_0x35ce('0x33')][_0x35ce('0x42')]){_0x255c29[_0x35ce('0x43')]=[{'all':!![]}];}return db[_0x35ce('0x2c')][_0x35ce('0x44')](_0x255c29);})[_0x35ce('0x25')](function(_0x5f124f){_0xb4247['rows']=_0x5f124f;return _0xb4247;})[_0x35ce('0x25')](respondWithFilteredResult(_0x343073,_0x255c29))['catch'](handleError(_0x343073,null));};exports[_0x35ce('0x45')]=function(_0x455d2a,_0x1797a5){var _0x1f43c5={'raw':![],'where':{'id':_0x455d2a[_0x35ce('0x46')]['id']}},_0x158e22={};_0x158e22['model']=_[_0x35ce('0x30')](db[_0x35ce('0x2c')][_0x35ce('0x47')]);_0x158e22[_0x35ce('0x33')]=_[_0x35ce('0x30')](_0x455d2a[_0x35ce('0x33')]);_0x158e22[_0x35ce('0x31')]=_[_0x35ce('0x32')](_0x158e22['model'],_0x158e22['query']);_0x1f43c5[_0x35ce('0x35')]=_[_0x35ce('0x32')](_0x158e22[_0x35ce('0x2f')],qs['fields'](_0x455d2a[_0x35ce('0x33')][_0x35ce('0x34')]));_0x1f43c5[_0x35ce('0x35')]=_0x1f43c5[_0x35ce('0x35')][_0x35ce('0x36')]?_0x1f43c5[_0x35ce('0x35')]:_0x158e22[_0x35ce('0x2f')];if(_0x455d2a['query'][_0x35ce('0x42')]){_0x1f43c5[_0x35ce('0x43')]=[{'all':!![]}];}_0x1f43c5=_['merge']({},_0x1f43c5,_0x455d2a[_0x35ce('0x41')]);return db[_0x35ce('0x2c')]['find'](_0x1f43c5)['then'](handleEntityNotFound(_0x1797a5,null))[_0x35ce('0x25')](respondWithResult(_0x1797a5,null))[_0x35ce('0x48')](handleError(_0x1797a5,null));};exports[_0x35ce('0x49')]=function(_0x3d79e9,_0x2eee08){return db[_0x35ce('0x2c')][_0x35ce('0x49')](_0x3d79e9[_0x35ce('0x4a')],{})[_0x35ce('0x25')](respondWithResult(_0x2eee08,0xc9))[_0x35ce('0x48')](handleError(_0x2eee08,null));};exports[_0x35ce('0x4b')]=function(_0x31e4fc,_0x5034ff){var _0x3080a1={'raw':![],'where':{'id':_0x31e4fc[_0x35ce('0x46')]['id']}},_0x5df74e={};_0x5df74e[_0x35ce('0x2f')]=_[_0x35ce('0x30')](db[_0x35ce('0x2c')]['rawAttributes']);_0x3080a1[_0x35ce('0x35')]=_[_0x35ce('0x32')](_0x5df74e[_0x35ce('0x2f')],qs[_0x35ce('0x34')](_0x31e4fc[_0x35ce('0x33')][_0x35ce('0x34')]));_0x3080a1[_0x35ce('0x35')]=_0x3080a1[_0x35ce('0x35')]['length']?_0x3080a1['attributes']:_0x5df74e[_0x35ce('0x2f')];if(_0x31e4fc['query'][_0x35ce('0x42')]){_0x3080a1[_0x35ce('0x43')]=[{'all':!![]}];}_0x3080a1=_[_0x35ce('0x3e')]({},_0x3080a1,_0x31e4fc[_0x35ce('0x41')]);return db[_0x35ce('0x2c')][_0x35ce('0x4c')](_0x3080a1)['then'](handleEntityNotFound(_0x5034ff,null))[_0x35ce('0x25')](function(_0x2b6892){if(_0x2b6892){var _0x440496=_0x2b6892[_0x35ce('0x4d')]({'plain':!![]});_0x440496=qs[_0x35ce('0x4e')](_0x440496,['id',_0x35ce('0x4f'),_0x35ce('0x50'),_0x35ce('0x51')]);_0x31e4fc[_0x35ce('0x4a')]=_[_0x35ce('0x4e')](_0x31e4fc[_0x35ce('0x4a')],['id',_0x35ce('0x4f'),'updatedAt']);return db['sequelize'][_0x35ce('0x52')](function(_0x5ebf1e){return db[_0x35ce('0x2c')]['create'](_['merge'](_0x440496,_0x31e4fc[_0x35ce('0x4a')]),{'include':_0x31e4fc[_0x35ce('0x33')][_0x35ce('0x42')]?[{'all':!![]}]:undefined,'transaction':_0x5ebf1e})['then'](function(_0x5b3909){var _0x359fad=_0x5b3909['get']({'plain':!![]});return db[_0x35ce('0x53')]['findAll']({'where':{'userProfileId':_0x31e4fc[_0x35ce('0x46')]['id']},'raw':!![]})[_0x35ce('0x25')](function(_0x135ed6){if(_0x135ed6){return BPromise[_0x35ce('0x54')](_0x135ed6,function(_0x27ed4d){return new BPromise(function(_0x51e04e,_0x30b98b){if(_0x27ed4d[_0x35ce('0x55')]===null||_0x27ed4d[_0x35ce('0x55')]===0x1)_0x51e04e(null);return db[_0x35ce('0x56')][_0x35ce('0x44')]({'where':{'sectionId':_0x27ed4d['id']},'raw':!![]})[_0x35ce('0x25')](function(_0x3a68d5){var _0x1189a1=_[_0x35ce('0x2b')](_0x3a68d5,function(_0x3fdc8f){return qs[_0x35ce('0x4e')](_0x3fdc8f,['id',_0x35ce('0x4f'),_0x35ce('0x50'),'sectionId']);});_0x51e04e(_0x1189a1);})[_0x35ce('0x48')](function(_0x21f33d){_0x30b98b(_0x21f33d);});})['then'](function(_0x1546a6){var _0x4ef8e8=qs[_0x35ce('0x4e')](_0x27ed4d,['id',_0x35ce('0x4f'),_0x35ce('0x50')]);_0x4ef8e8[_0x35ce('0x57')]=_0x359fad['id'];if(_0x1546a6)_0x4ef8e8[_0x35ce('0x58')]=_0x1546a6;return _0x4ef8e8;})[_0x35ce('0x25')](function(_0x5c581b){return db['UserProfileSection'][_0x35ce('0x49')](_0x5c581b,{'include':[{'model':db[_0x35ce('0x56')],'as':_0x35ce('0x58')}],'raw':!![],'transaction':_0x5ebf1e});});})[_0x35ce('0x25')](function(){return _0x359fad;});}});});});}})[_0x35ce('0x25')](respondWithResult(_0x5034ff,0xc9))['catch'](handleError(_0x5034ff,null));};exports[_0x35ce('0x24')]=function(_0x342a2a,_0x3d17dd){if(_0x342a2a[_0x35ce('0x4a')]['id']){delete _0x342a2a[_0x35ce('0x4a')]['id'];}return db[_0x35ce('0x2c')][_0x35ce('0x4c')]({'where':{'id':_0x342a2a[_0x35ce('0x46')]['id']}})[_0x35ce('0x25')](handleEntityNotFound(_0x3d17dd,null))[_0x35ce('0x25')](saveUpdates(_0x342a2a[_0x35ce('0x4a')],null))[_0x35ce('0x25')](respondWithResult(_0x3d17dd,null))[_0x35ce('0x48')](handleError(_0x3d17dd,null));};exports[_0x35ce('0x26')]=function(_0x5e91a8,_0x886b4f){return db[_0x35ce('0x2c')][_0x35ce('0x4c')]({'where':{'id':_0x5e91a8[_0x35ce('0x46')]['id']}})[_0x35ce('0x25')](handleEntityNotFound(_0x886b4f,null))[_0x35ce('0x25')](removeEntity(_0x886b4f,null))[_0x35ce('0x48')](handleError(_0x886b4f,null));};exports[_0x35ce('0x59')]=function(_0x25f7d0,_0x1ef358){return db[_0x35ce('0x2c')][_0x35ce('0x59')]()['then'](respondWithResult(_0x1ef358,null))['catch'](handleError(_0x1ef358,null));};exports[_0x35ce('0x5a')]=function(_0x2f62b7,_0x57e8cc){var _0x2edcf7=_0x2f62b7[_0x35ce('0x4a')];return db[_0x35ce('0x2c')]['find']({'where':{'id':_0x2f62b7[_0x35ce('0x46')]['id']}})[_0x35ce('0x25')](handleEntityNotFound(_0x57e8cc,null))[_0x35ce('0x25')](function(_0x15bf7f){if(_0x15bf7f){return db['sequelize']['transaction'](function(_0x18d99f){return db[_0x35ce('0x53')]['destroy']({'where':{'userProfileId':_0x2f62b7[_0x35ce('0x46')]['id'],'sectionId':_[_0x35ce('0x2b')](_0x2edcf7,function(_0x1649f6){return _0x1649f6[_0x35ce('0x5b')];})},'transaction':_0x18d99f})['then'](function(){var _0x7ea756=_[_0x35ce('0x2b')](_0x2edcf7,function(_0x15c85f){_0x15c85f[_0x35ce('0x57')]=_0x2f62b7[_0x35ce('0x46')]['id'];return _0x15c85f;});var _0x383134=[];return BPromise[_0x35ce('0x54')](_0x7ea756,function(_0x2ca31a){return db[_0x35ce('0x53')][_0x35ce('0x49')](_0x2ca31a,{'include':[{'model':db['UserProfileResource'],'as':_0x35ce('0x58')}],'raw':!![],'transaction':_0x18d99f})[_0x35ce('0x25')](function(_0x527a27){_0x383134[_0x35ce('0x5c')](_0x527a27[_0x35ce('0x4d')]({'plain':!![]}));});})[_0x35ce('0x25')](function(){return _0x383134;});});});}})[_0x35ce('0x25')](function(_0x473a01){return _0x473a01;})[_0x35ce('0x25')](respondWithResult(_0x57e8cc,null))['catch'](handleError(_0x57e8cc,null));};exports['removeSections']=function(_0x3943f7,_0x29bdb8){var _0x744e02;return db[_0x35ce('0x2c')][_0x35ce('0x4c')]({'where':{'id':_0x3943f7['params']['id']},'attributes':['id',_0x35ce('0x28')]})['then'](handleEntityNotFound(_0x29bdb8,null))[_0x35ce('0x25')](function(_0x4578e8){if(_0x4578e8){_0x744e02=_0x4578e8;return db['UserProfileSection'][_0x35ce('0x26')]({'where':{'userProfileId':_0x3943f7[_0x35ce('0x46')]['id'],'sectionId':_0x3943f7[_0x35ce('0x33')][_0x35ce('0x5d')]}});}})[_0x35ce('0x25')](function(){return _0x744e02;})[_0x35ce('0x25')](respondWithStatusCode(_0x29bdb8,null))['catch'](handleError(_0x29bdb8,null));};exports[_0x35ce('0x5e')]=function(_0x455967,_0x1313ba){var _0x5b7e93=[];var _0x1a575b=[];return db[_0x35ce('0x53')][_0x35ce('0x44')]({'where':{'userProfileId':_0x455967[_0x35ce('0x46')]['id']},'raw':!![]})['then'](function(_0x2ea3ca){_0x5b7e93=_['filter'](_0x2ea3ca,function(_0xed123c){return _0xed123c[_0x35ce('0x5f')]===0x1;});if(!_[_0x35ce('0x60')](_0x5b7e93)){return _[_0x35ce('0x2b')](_0x5b7e93,function(_0x9310d0){return _0x9310d0[_0x35ce('0x5b')];});}else{return;}})[_0x35ce('0x25')](function(_0x283264){if(_0x283264)_0x1a575b=_0x283264;if(_[_0x35ce('0x61')](_0x1a575b,0x64)){var _0xb0b3b6=_[_0x35ce('0x4c')](_0x5b7e93,{'sectionId':0x64});return hasDefaultDashboard(_0xb0b3b6)['then'](function(_0xb6aa0e){return _[_0x35ce('0x2b')](_0x5b7e93,function(_0x4443cb){if(_0x4443cb[_0x35ce('0x5b')]===0x64){_0x4443cb[_0x35ce('0x62')]=_0xb6aa0e;}return _0x4443cb;});});}else{return;}})[_0x35ce('0x25')](function(_0x1360a3){if(_0x1360a3)_0x5b7e93=_0x1360a3;if(_['includes'](_0x1a575b,0x3eb)||_['some'](_0x5b7e93,{'enabled':![],'sectionId':0x3eb})){var _0x2af678=_[_0x35ce('0x4c')](_0x5b7e93,{'sectionId':0x3eb});return getCustomDashboards(_0x2af678)[_0x35ce('0x25')](function(_0x29383a){return _[_0x35ce('0x2b')](_0x5b7e93,function(_0x44a6a9){if(_0x44a6a9[_0x35ce('0x5b')]===0x3eb){_0x44a6a9[_0x35ce('0x62')]=_0x29383a;}return _0x44a6a9;});});}else{return;}})[_0x35ce('0x25')](function(_0x317fd8){if(_0x317fd8)_0x5b7e93=_0x317fd8;if(_[_0x35ce('0x61')](_0x1a575b,0x709)||_[_0x35ce('0x63')](_0x5b7e93,{'enabled':![],'sectionId':0x709})){var _0x281a7a=_[_0x35ce('0x4c')](_0x5b7e93,{'sectionId':0x709});return getPlugins(_0x281a7a)[_0x35ce('0x25')](function(_0x339d01){return _['map'](_0x5b7e93,function(_0x3f73ab){if(_0x3f73ab[_0x35ce('0x5b')]===0x709){_0x3f73ab[_0x35ce('0x62')]=_0x339d01;}return _0x3f73ab;});});}else{return;}})[_0x35ce('0x25')](function(_0x1d1fcb){if(_0x1d1fcb)_0x5b7e93=_0x1d1fcb;return _0x5b7e93;})[_0x35ce('0x25')](respondWithResult(_0x1313ba,null))['catch'](handleError(_0x1313ba,null));};function hasDefaultDashboard(_0x2aa92b){var _0x67dcd7=[0x65];return new BPromise(function(_0x23818e,_0x5689bd){try{if(_0x2aa92b[_0x35ce('0x55')]){_0x23818e(_0x67dcd7);}else{return db['UserProfileResource']['findOne']({'where':{'sectionId':_0x2aa92b['id']},'raw':!![]})[_0x35ce('0x25')](function(_0x4d2801){if(_0x4d2801){_0x23818e(_0x67dcd7);}});}}catch(_0x591fd6){_0x5689bd(_0x591fd6);}});}function getCustomDashboards(_0x546ccf){var _0x5a0622=[];return new BPromise(function(_0x3ae5a9,_0x40869){try{if(_0x546ccf[_0x35ce('0x55')]){return db[_0x35ce('0x64')]['findAll']({'raw':!![]})['then'](function(_0x35f412){_0x35f412['forEach'](function(_0x19ec21){_0x5a0622['push'](_0x19ec21['id']+0x1869f);});_0x3ae5a9(_0x5a0622);});}else{return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x546ccf['id']},'raw':!![]})['then'](function(_0x4dac1f){_0x4dac1f['forEach'](function(_0x3521e1){_0x5a0622['push'](_0x3521e1['resourceId']+0x1869f);});_0x3ae5a9(_0x5a0622);});}}catch(_0x3f3d86){_0x40869(_0x3f3d86);}});}function getPlugins(_0x4e2085){var _0x19a512=[];return new BPromise(function(_0x20e879,_0x5968a5){try{if(_0x4e2085[_0x35ce('0x55')]){return db[_0x35ce('0x65')]['findAll']({'raw':!![]})[_0x35ce('0x25')](function(_0x1feeaa){_0x1feeaa[_0x35ce('0x66')](function(_0x1a3063){_0x19a512[_0x35ce('0x5c')](_0x1a3063['id']+0x15b38);});_0x20e879(_0x19a512);});}else{return db['UserProfileResource'][_0x35ce('0x44')]({'where':{'sectionId':_0x4e2085['id']},'raw':!![]})[_0x35ce('0x25')](function(_0x57ff5d){_0x57ff5d[_0x35ce('0x66')](function(_0x69c875){_0x19a512['push'](_0x69c875[_0x35ce('0x67')]+0x15b38);});_0x20e879(_0x19a512);});}}catch(_0xeea2c9){_0x5968a5(_0xeea2c9);}});}exports[_0x35ce('0x68')]=function(_0xd486aa,_0x372dfb){return db[_0x35ce('0x2c')][_0x35ce('0x4c')]({'where':{'id':_0xd486aa['params']['id']}})[_0x35ce('0x25')](handleEntityNotFound(_0x372dfb,null))[_0x35ce('0x25')](function(_0x39f8dc){if(_0x39f8dc){return db[_0x35ce('0x69')][_0x35ce('0x52')](function(_0xdd871b){return db[_0x35ce('0x53')][_0x35ce('0x44')]({'where':{'userProfileId':_0xd486aa[_0x35ce('0x46')]['id']},'attributes':['id'],'raw':!![]})[_0x35ce('0x25')](function(_0x400b80){if(_0x400b80){return db[_0x35ce('0x53')][_0x35ce('0x26')]({'where':{'userProfileId':_0xd486aa[_0x35ce('0x46')]['id'],'id':_[_0x35ce('0x2b')](_0x400b80,function(_0x5398b5){return _0x5398b5['id'];})},'transaction':_0xdd871b});}})['then'](function(_0x232ed4){var _0x24e034=_['map'](_0xd486aa[_0x35ce('0x4a')],function(_0x444c67){_0x444c67[_0x35ce('0x57')]=_0xd486aa[_0x35ce('0x46')]['id'];return _0x444c67;});return db['UserProfileSection']['bulkCreate'](_0x24e034,{'raw':!![],'transaction':_0xdd871b});})['then'](function(_0x2bbfde){var _0x254b4f=_[_0x35ce('0x3c')](_[_0x35ce('0x2b')](_0x2bbfde,function(_0x1bf79c){return _0x1bf79c['get']({'plain':!![]});}),{'includeAll':![]});if(_0x254b4f){return db['UserProfileSection'][_0x35ce('0x44')]({'where':{'userProfileId':_0xd486aa['params']['id'],'sectionId':_[_0x35ce('0x2b')](_0x254b4f,function(_0x19f5e3){return _0x19f5e3[_0x35ce('0x5b')];})},'attributes':['id',_0x35ce('0x5b')],'raw':!![]})[_0x35ce('0x25')](function(_0x3c621f){var _0x4c6e78=_[_0x35ce('0x2b')](_0xd486aa['body'],function(_0x2e7024){_0x2e7024[_0x35ce('0x57')]=_0xd486aa[_0x35ce('0x46')]['id'];return _0x2e7024;});return db[_0x35ce('0x56')][_0x35ce('0x6a')](_0x4c6e78,{'raw':!![],'transaction':_0xdd871b});});}})['catch'](handleError(_0x372dfb,null));});}})[_0x35ce('0x25')](function(_0x539aae){var _0x16a5f0=_[_0x35ce('0x2b')](_0x539aae,function(_0x536cb5){return _0x536cb5[_0x35ce('0x4d')]({'plain':!![]});});})[_0x35ce('0x25')](respondWithResult(_0x372dfb,null))[_0x35ce('0x48')](handleError(_0x372dfb,null));};exports['removeResources']=function(_0x550b59,_0x5abea7,_0x43d32b){return db[_0x35ce('0x2c')][_0x35ce('0x4c')]({'where':{'id':_0x550b59[_0x35ce('0x46')]['id']}})[_0x35ce('0x25')](handleEntityNotFound(_0x5abea7,null))['then'](function(_0x2728b5){if(_0x2728b5){return _0x2728b5[_0x35ce('0x6b')](_0x550b59[_0x35ce('0x33')][_0x35ce('0x5d')]);}})[_0x35ce('0x25')](respondWithStatusCode(_0x5abea7,null))['catch'](handleError(_0x5abea7,null));};exports[_0x35ce('0x6c')]=function(_0x59d9a5,_0x413ebd){var _0x40e99d={'raw':![],'where':{}};var _0x5b9d8f={};var _0xa45a46={'count':0x0,'rows':[]};var _0x2f50a6=_0x59d9a5[_0x35ce('0x33')][_0x35ce('0x6d')];if(typeof _0x2f50a6===_0x35ce('0x6e')){throw new db[(_0x35ce('0x6f'))][(_0x35ce('0x70'))](_0x35ce('0x71'));}var _0x394ee3=_0x59d9a5[_0x35ce('0x33')][_0x35ce('0x72')]||![];var _0x2122a3=getQueryModels(_0x2f50a6,_0x394ee3);if(typeof _0x2122a3[_0x35ce('0x73')]===_0x35ce('0x6e')){throw new db['Sequelize']['ValidationError'](_0x35ce('0x74')+_0x2f50a6+'\x27');}var _0x5c02b6=[];if(!_[_0x35ce('0x60')](_0x2122a3['parentSections'])){_0x5c02b6=_0x2122a3[_0x35ce('0x75')];}else{_0x5c02b6=[{'name':_0x2f50a6}];}return db['UserProfile'][_0x35ce('0x76')]({'where':{'id':_0x59d9a5[_0x35ce('0x46')]['id']}})[_0x35ce('0x25')](handleEntityNotFound(_0x413ebd,null))[_0x35ce('0x25')](function(_0x537610){if(_0x537610){var _0x37a3f1=[];for(var _0x520eaf=0x0;_0x520eaf<_0x5c02b6['length'];_0x520eaf++){_0x37a3f1['push'](db[_0x35ce('0x53')][_0x35ce('0x76')]({'where':{'userProfileId':_0x537610['id'],'name':_0x5c02b6[_0x520eaf][_0x35ce('0x28')]},'raw':!![]}));}return BPromise[_0x35ce('0x77')](_0x37a3f1);}})[_0x35ce('0x25')](function(_0x1bb01b){var _0x393007=_[_0x35ce('0x3c')](_0x1bb01b,function(_0x360c0d){return _0x360c0d?_0x360c0d:undefined;});var _0x52baa8=_['filter'](_0x5c02b6,[_0x35ce('0x78'),!![]]);var _0x89440=_[_0x35ce('0x60')](_0x393007)&&_['isEmpty'](_0x52baa8)?null:_['union'](_0x52baa8,_0x393007);if(_0x89440){var _0x3833cd=[];for(var _0x5a4d0d=0x0;_0x5a4d0d<_0x89440[_0x35ce('0x36')];_0x5a4d0d++){var _0x19dd46=_[_0x35ce('0x4c')](_0x5c02b6,function(_0x2dbb0e){return _0x89440[_0x5a4d0d]?_0x2dbb0e['name']===_0x89440[_0x5a4d0d][_0x35ce('0x28')]:null;});if(_0x19dd46){if(_0x89440[_0x5a4d0d]['ignore']){_0x3833cd['push'](getAllResources(_0x2122a3[_0x35ce('0x73')],_0x89440[_0x5a4d0d]));}else{if(!_0x89440[_0x5a4d0d][_0x35ce('0x55')]){_0x3833cd[_0x35ce('0x5c')](getAllowedResources(_0x19dd46,_0x89440[_0x5a4d0d],_0x2122a3['childModel']));}else{if(_0x19dd46[_0x35ce('0x2f')]){_0x3833cd[_0x35ce('0x5c')](getAllFilteredResources(_0x19dd46,_0x89440[_0x5a4d0d]));}}}}}return BPromise['all'](_0x3833cd);}else{return null;}})[_0x35ce('0x25')](function(_0x22e993){var _0x307d81=_0x22e993;var _0x4a1929=null;if(_0x307d81){_0x4a1929=_0x307d81[_0x35ce('0x36')]===0x1?_0x307d81[0x0]:null;}if(_0x4a1929||_0x307d81){var _0x48a6a9=db[_0x2122a3[_0x35ce('0x73')]][_0x35ce('0x47')];_0x5b9d8f[_0x35ce('0x2f')]=_['keys'](_0x48a6a9);_0x5b9d8f[_0x35ce('0x33')]=_[_0x35ce('0x30')](_0x59d9a5['query']);_0x5b9d8f[_0x35ce('0x31')]=_[_0x35ce('0x32')](_0x5b9d8f['model'],_0x5b9d8f[_0x35ce('0x33')]);_0x40e99d[_0x35ce('0x35')]=_[_0x35ce('0x32')](_0x5b9d8f[_0x35ce('0x2f')],qs['fields'](_0x59d9a5[_0x35ce('0x33')][_0x35ce('0x34')]));_0x40e99d[_0x35ce('0x35')]=_0x40e99d[_0x35ce('0x35')]['length']?_0x40e99d[_0x35ce('0x35')]:_0x5b9d8f[_0x35ce('0x2f')];if(!_0x59d9a5['query'][_0x35ce('0x37')]('nolimit')){_0x40e99d[_0x35ce('0x20')]=qs[_0x35ce('0x20')](_0x59d9a5[_0x35ce('0x33')][_0x35ce('0x20')]);_0x40e99d[_0x35ce('0x1f')]=qs[_0x35ce('0x1f')](_0x59d9a5[_0x35ce('0x33')][_0x35ce('0x1f')]);}_0x40e99d['order']=qs[_0x35ce('0x3a')](_0x59d9a5[_0x35ce('0x33')][_0x35ce('0x3a')]);_0x40e99d[_0x35ce('0x3d')]=qs[_0x35ce('0x31')](_[_0x35ce('0x3b')](_0x59d9a5['query'],_0x5b9d8f[_0x35ce('0x31')]));if(_0x59d9a5[_0x35ce('0x33')]['filter']){_0x40e99d['where']=_[_0x35ce('0x3e')](_0x40e99d[_0x35ce('0x3d')],{'$or':_[_0x35ce('0x2b')](_0x48a6a9,function(_0x468101){if(_0x468101[_0x35ce('0x3f')]['key']!==_0x35ce('0x79')){var _0xfd15e9={};_0xfd15e9[_0x468101[_0x35ce('0x40')]]={'$like':'%'+_0x59d9a5['query']['filter']+'%'};return _0xfd15e9;}})});}var _0x216502=[];if(_0x4a1929){var _0x2dcb73=_[_0x35ce('0x4c')](_0x5c02b6,[_0x35ce('0x28'),_0x4a1929[_0x35ce('0x28')]]);if(_0x2dcb73['field']){var _0x1b1b84={};if(_0x2122a3['childModel']===_0x35ce('0x7a')){_0x1b1b84[_0x2dcb73[_0x35ce('0x7b')]]=_[_0x35ce('0x2b')](_0x4a1929[_0x35ce('0x7c')],'id');}else{_0x1b1b84[_0x2dcb73[_0x35ce('0x7b')]]=_0x4a1929[_0x35ce('0x7c')];}_0x216502[_0x35ce('0x5c')](_0x1b1b84);}else{_0x40e99d[_0x35ce('0x3d')]['id']=_0x4a1929[_0x35ce('0x7c')];}}else{for(var _0x45a85c=0x0;_0x45a85c<_0x307d81[_0x35ce('0x36')];_0x45a85c++){var _0x2dcb73=_[_0x35ce('0x4c')](_0x5c02b6,[_0x35ce('0x28'),_0x307d81[_0x45a85c]['name']]);if(_0x2dcb73['field']){var _0x1b1b84={};_0x1b1b84[_0x2dcb73[_0x35ce('0x7b')]]=_0x307d81[_0x45a85c][_0x35ce('0x7c')];_0x216502['push'](_0x1b1b84);}else{if(!_0x40e99d[_0x35ce('0x3d')]['id'])_0x40e99d['where']['id']=[];_0x307d81[_0x45a85c]['associatedResources'][_0x35ce('0x66')](function(_0x5c820b){_0x40e99d[_0x35ce('0x3d')]['id']['push'](_0x5c820b);});}}}if(!_['isEmpty'](_0x216502)){_0x40e99d[_0x35ce('0x3d')]=_['merge'](_0x40e99d[_0x35ce('0x3d')],{'$and':{'$or':_0x216502}});}_0x40e99d=_[_0x35ce('0x3e')]({},_0x40e99d,_0x59d9a5['options']);if(_0x4a1929&&!_0x4a1929[_0x35ce('0x55')]&&_0x2122a3[_0x35ce('0x73')]===_0x35ce('0x7a')){if(_0x59d9a5['query']['includeAll']){_0x40e99d[_0x35ce('0x43')]=[{'all':!![]}];}return db[_0x2122a3[_0x35ce('0x73')]]['findAll'](_0x40e99d)[_0x35ce('0x25')](function(_0x36e90f){var _0x5d8de4=[];_0x36e90f[_0x35ce('0x66')](function(_0x5f5e0d){var _0xbc9222;switch(_0x5f5e0d[_0x35ce('0x7d')]){case _0x35ce('0x7e'):_0xbc9222=_['find'](_0x4a1929[_0x35ce('0x7c')],function(_0x4e8afb){return _0x4e8afb['id']===_0x5f5e0d[_0x35ce('0x7f')]&&_0x4e8afb[_0x35ce('0x3f')]==='DefaultReports';});break;case _0x35ce('0x80'):_0xbc9222=_[_0x35ce('0x4c')](_0x4a1929[_0x35ce('0x7c')],function(_0x3c15e3){return _0x3c15e3['id']===_0x5f5e0d[_0x35ce('0x7f')]&&_0x3c15e3['type']===_0x35ce('0x81');});break;}if(_0xbc9222)_0x5d8de4[_0x35ce('0x5c')](_0x5f5e0d);});_0xa45a46[_0x35ce('0x1e')]=_0x5d8de4[_0x35ce('0x36')];_0xa45a46[_0x35ce('0x82')]=_0x5d8de4;return _0xa45a46;});}else{return db[_0x2122a3['childModel']]['count']({'where':_0x40e99d[_0x35ce('0x3d')]})['then'](function(_0x3d3b29){_0xa45a46[_0x35ce('0x1e')]=_0x3d3b29;if(_0x59d9a5[_0x35ce('0x33')][_0x35ce('0x42')]){if(_0x2122a3[_0x35ce('0x73')]===_0x35ce('0x83')){_0x40e99d['include']=[{'model':db[_0x35ce('0x84')],'as':_0x35ce('0x85'),'attributes':['id',_0x35ce('0x28'),_0x35ce('0x86')],'required':_0x59d9a5[_0x35ce('0x33')][_0x35ce('0x87')]?!![]:![]},{'model':db[_0x35ce('0x84')],'as':_0x35ce('0x88'),'attributes':['id',_0x35ce('0x28'),_0x35ce('0x86')],'through':_0x59d9a5[_0x35ce('0x33')]['tag']?{'attributes':[],'where':{'TagId':_0x59d9a5[_0x35ce('0x33')]['tag']||undefined}}:{},'required':_0x59d9a5[_0x35ce('0x33')][_0x35ce('0x87')]?!![]:![]}];}else{_0x40e99d[_0x35ce('0x43')]=[{'all':!![]}];}}return db[_0x2122a3[_0x35ce('0x73')]][_0x35ce('0x44')](_0x40e99d);})[_0x35ce('0x25')](function(_0x122915){_0xa45a46[_0x35ce('0x82')]=_0x122915;return _0xa45a46;});}}else{return _0xa45a46;}})[_0x35ce('0x25')](respondWithFilteredResult(_0x413ebd,_0x40e99d))[_0x35ce('0x48')](handleError(_0x413ebd,null));};function getAllResources(_0x4b963d,_0x4c42a1){return new BPromise(function(_0x3336c2,_0x501956){if(_0x4c42a1){var _0x2deea8=_0x4c42a1[_0x35ce('0x3c')]?{[_0x4c42a1[_0x35ce('0x3c')][_0x35ce('0x40')]]:_0x4c42a1[_0x35ce('0x3c')][_0x35ce('0x89')]}:undefined;return db[_0x4b963d][_0x35ce('0x44')]({'where':_0x2deea8,'raw':!![]})[_0x35ce('0x25')](function(_0x5f2182){_0x4c42a1[_0x35ce('0x7c')]=_[_0x35ce('0x2b')](_0x5f2182,'id');_0x3336c2(_0x4c42a1);})[_0x35ce('0x48')](function(_0x97020f){_0x501956(_0x97020f);});}else{_0x3336c2(null);}});}function getAllFilteredResources(_0x141ac9,_0x4a22c0){return new BPromise(function(_0x46dc7b,_0x2cba33){var _0x59ae5c=_0x141ac9[_0x35ce('0x3c')]?{[_0x141ac9[_0x35ce('0x3c')][_0x35ce('0x40')]]:_0x141ac9[_0x35ce('0x3c')][_0x35ce('0x89')]}:undefined;return db[_0x141ac9[_0x35ce('0x2f')]][_0x35ce('0x44')]({'where':_0x59ae5c,'raw':!![]})[_0x35ce('0x25')](function(_0x1ca493){_0x4a22c0[_0x35ce('0x7c')]=_[_0x35ce('0x2b')](_0x1ca493,function(_0xf7d903){return _0xf7d903[_0x35ce('0x28')];});_0x46dc7b(_0x4a22c0);})[_0x35ce('0x48')](function(_0x4c703c){_0x2cba33(_0x4c703c);});});}function getAllowedResources(_0x446cee,_0x480dfb,_0x2a3517){return new BPromise(function(_0x42bcc1,_0x811f78){if(_0x480dfb){return db[_0x35ce('0x56')][_0x35ce('0x44')]({'where':{'sectionId':_0x480dfb['id']},'raw':!![]})['then'](function(_0x29ccac){if(_0x446cee[_0x35ce('0x40')]&&_0x446cee[_0x35ce('0x40')]!=='id'){_0x480dfb[_0x35ce('0x7c')]=_['map'](_0x29ccac,function(_0xfcee28){return _0xfcee28[_0x446cee['field']];});}else{if(_0x2a3517===_0x35ce('0x7a')){_0x480dfb['associatedResources']=_[_0x35ce('0x2b')](_0x29ccac,function(_0x313857){return{'id':_0x313857['resourceId'],'type':_0x313857[_0x35ce('0x3f')]};});}else{_0x480dfb[_0x35ce('0x7c')]=_[_0x35ce('0x2b')](_0x29ccac,function(_0x5b58aa){return _0x5b58aa[_0x35ce('0x67')];});}}_0x42bcc1(_0x480dfb);})['catch'](function(_0x134e87){_0x811f78(_0x134e87);});}else{_0x42bcc1(null);}});}function getQueryModels(_0x10cbd9,_0x1f5769){var _0x383e0a=_0x10cbd9[_0x35ce('0x8a')]();var _0x24f9ee={'childModel':undefined,'parentSections':[]};switch(_0x383e0a){case _0x35ce('0x8b'):_0x24f9ee[_0x35ce('0x73')]='SquareProject';break;case _0x35ce('0x8c'):_0x24f9ee['childModel']=_0x35ce('0x8d');break;case _0x35ce('0x8e'):_0x24f9ee['childModel']=_0x35ce('0x8f');_0x24f9ee[_0x35ce('0x75')]=[{'name':'SquareProjects','field':_0x35ce('0x28'),'foreignKey':_0x35ce('0x90')}];break;case _0x35ce('0x91'):_0x24f9ee[_0x35ce('0x73')]=_0x35ce('0x92');break;case'contacts':_0x24f9ee[_0x35ce('0x73')]=_0x35ce('0x83');_0x24f9ee[_0x35ce('0x75')]=[{'name':_0x35ce('0x93'),'field':'id','foreignKey':_0x35ce('0x94')}];break;case _0x35ce('0x95'):_0x24f9ee[_0x35ce('0x73')]=_0x35ce('0x96');break;case _0x35ce('0x97'):_0x24f9ee[_0x35ce('0x73')]=_0x35ce('0x98');break;case _0x35ce('0x99'):_0x24f9ee[_0x35ce('0x73')]=_0x35ce('0x9a');break;case _0x35ce('0x9b'):_0x24f9ee[_0x35ce('0x73')]=_0x35ce('0x9c');break;case _0x35ce('0x9d'):_0x24f9ee[_0x35ce('0x73')]=_0x35ce('0x9e');break;case _0x35ce('0x9f'):_0x24f9ee[_0x35ce('0x73')]=_0x35ce('0xa0');break;case _0x35ce('0xa1'):_0x24f9ee[_0x35ce('0x73')]=_0x35ce('0xa2');break;case _0x35ce('0xa3'):case _0x35ce('0xa4'):case _0x35ce('0xa5'):_0x24f9ee[_0x35ce('0x73')]='VoiceExtension';break;case _0x35ce('0xa6'):_0x24f9ee[_0x35ce('0x73')]=_0x35ce('0xa7');break;case _0x35ce('0xa8'):_0x24f9ee[_0x35ce('0x73')]=_0x35ce('0xa9');break;case _0x35ce('0xaa'):_0x24f9ee[_0x35ce('0x73')]=_0x35ce('0xab');_0x24f9ee['parentSections']=[{'name':_0x35ce('0xac'),'field':_0x35ce('0x28'),'foreignKey':'membername','model':_0x35ce('0xad'),'filter':{'field':_0x35ce('0xae'),'value':['agent']}},{'name':_0x35ce('0xaf'),'field':_0x35ce('0x28'),'foreignKey':_0x35ce('0xb0'),'model':_0x35ce('0xad'),'filter':{'field':_0x35ce('0xae'),'value':[_0x35ce('0xb1')]}},{'name':_0x35ce('0xb2'),'field':_0x35ce('0x28'),'foreignKey':_0x35ce('0xb3'),'model':'VoiceQueue','filter':{'field':_0x35ce('0x3f'),'value':[_0x35ce('0xb4')]}},{'name':_0x35ce('0xb5'),'field':_0x35ce('0x28'),'foreignKey':_0x35ce('0xb3'),'model':_0x35ce('0xb6'),'filter':{'field':'type','value':[_0x35ce('0xb7')]}}];break;case _0x35ce('0xb8'):_0x24f9ee[_0x35ce('0x73')]=_0x35ce('0xb9');break;case _0x35ce('0xba'):_0x24f9ee[_0x35ce('0x73')]=_0x35ce('0xbb');break;case'voiceprefixes':_0x24f9ee[_0x35ce('0x73')]=_0x35ce('0xbc');break;case _0x35ce('0xbd'):_0x24f9ee['childModel']=_0x35ce('0xbe');break;case _0x35ce('0xbf'):_0x24f9ee[_0x35ce('0x73')]='MailQueue';break;case _0x35ce('0xc0'):_0x24f9ee[_0x35ce('0x73')]='MailAccount';break;case _0x35ce('0xc1'):_0x24f9ee[_0x35ce('0x73')]=_0x35ce('0xc2');break;case _0x35ce('0xc3'):_0x24f9ee[_0x35ce('0x73')]=_0x35ce('0xc4');break;case _0x35ce('0xc5'):_0x24f9ee[_0x35ce('0x73')]=_0x35ce('0xc6');break;case _0x35ce('0xc7'):_0x24f9ee[_0x35ce('0x73')]='SmsQueue';break;case _0x35ce('0xc8'):_0x24f9ee[_0x35ce('0x73')]='SmsAccount';break;case'teams':_0x24f9ee[_0x35ce('0x73')]=_0x35ce('0xc9');break;case _0x35ce('0xca'):case'queuecampaigns':_0x24f9ee[_0x35ce('0x73')]=_0x35ce('0xb6');if(_0x1f5769){_0x24f9ee[_0x35ce('0x75')]=[{'name':'VoiceQueues'},{'name':_0x35ce('0xb5')}];}break;case'users':case _0x35ce('0xcb'):case _0x35ce('0xcc'):_0x24f9ee[_0x35ce('0x73')]='User';if(_0x1f5769){_0x24f9ee[_0x35ce('0x75')]=[{'name':_0x35ce('0xcd'),'filter':{'field':_0x35ce('0xae'),'value':['admin',_0x35ce('0xce')]},'ignore':!![]},{'name':_0x35ce('0xac')},{'name':_0x35ce('0xaf')}];}break;case'zendeskaccounts':_0x24f9ee[_0x35ce('0x73')]=_0x35ce('0xcf');break;case _0x35ce('0xd0'):_0x24f9ee[_0x35ce('0x73')]=_0x35ce('0xd1');break;case _0x35ce('0xd2'):_0x24f9ee[_0x35ce('0x73')]='FreshdeskAccount';break;case'sugarcrmaccounts':_0x24f9ee[_0x35ce('0x73')]='SugarcrmAccount';break;case _0x35ce('0xd3'):_0x24f9ee[_0x35ce('0x73')]=_0x35ce('0xd4');break;case _0x35ce('0xd5'):_0x24f9ee[_0x35ce('0x73')]=_0x35ce('0xd6');break;case _0x35ce('0xd7'):_0x24f9ee[_0x35ce('0x73')]=_0x35ce('0xad');break;case'cannedanswers':_0x24f9ee[_0x35ce('0x73')]=_0x35ce('0xd8');break;case'dispositions':_0x24f9ee['childModel']='Disposition';break;case _0x35ce('0xd9'):_0x24f9ee[_0x35ce('0x73')]='Dashboard';break;case _0x35ce('0xda'):_0x24f9ee['childModel']='Interval';break;case _0x35ce('0xdb'):_0x24f9ee['childModel']=_0x35ce('0xdc');break;case'scheduler':_0x24f9ee[_0x35ce('0x73')]='Schedule';break;case'sounds':_0x24f9ee[_0x35ce('0x73')]='Sound';break;case _0x35ce('0xdd'):_0x24f9ee[_0x35ce('0x73')]='Tag';break;case _0x35ce('0xde'):_0x24f9ee[_0x35ce('0x73')]='Template';break;case'triggers':_0x24f9ee[_0x35ce('0x73')]=_0x35ce('0xdf');break;case _0x35ce('0xe0'):_0x24f9ee[_0x35ce('0x73')]=_0x35ce('0xe1');break;case'variables':_0x24f9ee[_0x35ce('0x73')]=_0x35ce('0xe2');break;case _0x35ce('0xe3'):_0x24f9ee[_0x35ce('0x73')]=_0x35ce('0x65');break;case _0x35ce('0xe4'):_0x24f9ee[_0x35ce('0x73')]=_0x35ce('0x7a');_0x24f9ee[_0x35ce('0x75')]=[{'name':_0x35ce('0xe5'),'field':'id','foreignKey':'reportId'}];break;case _0x35ce('0xe6'):_0x24f9ee[_0x35ce('0x73')]=_0x35ce('0xe7');break;default:return _0x24f9ee;}return _0x24f9ee;} \ No newline at end of file +var _0xcf35=['sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','index','map','UserProfile','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','field','options','then','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','clone','merge','get','createdAt','crudPermissions','omit','updatedAt','sequelize','transaction','each','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','UserProfileSection','describe','addSections','ids','getSections','enabled','isEmpty','includes','subsections','some','Dashboard','forEach','push','resourceId','bulkCreate','removeResources','getResources','undefined','ValidationError','Unknown\x20section','mergeResources','childModel','Invalid\x20section\x20\x27','parentSections','findOne','all','ignore','union','AnalyticExtractedReport','foreignKey','associatedResources','reportType','default','reportId','DefaultReports','custom','CustomReports','CmContact','Tag','Tags','color','tag','ThroughTags','value','toLowerCase','squareprojects','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','SquareProjects','projects','JscriptyProject','contacts','ListId','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','ChatWebsite','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','VoiceMail','voicerecordings','Agents','membername','User','agent','Telephones','role','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','outbound','musiconholds','VoiceMusicOnHold','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','teams','Team','queuecampaigns','users','agents','telephones','Users','admin','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','FreshdeskAccount','SugarcrmAccount','deskaccounts','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','customdashboards','Interval','pauses','scheduler','Schedule','sounds','tags','templates','Template','Trigger','trunks','Trunk','plugins','Plugin','extractedreports','Reports','metrics','AnalyticMetric','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register'];(function(_0x1850e2,_0x7dab61){var _0x1f5de4=function(_0x2cfb85){while(--_0x2cfb85){_0x1850e2['push'](_0x1850e2['shift']());}};_0x1f5de4(++_0x7dab61);}(_0xcf35,0x1c7));var _0x5cf3=function(_0x3780c6,_0x126a4d){_0x3780c6=_0x3780c6-0x0;var _0xa2eae5=_0xcf35[_0x3780c6];return _0xa2eae5;};'use strict';var pdf=require(_0x5cf3('0x0'));var emlformat=require(_0x5cf3('0x1'));var rimraf=require(_0x5cf3('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5cf3('0x3'));var rp=require(_0x5cf3('0x4'));var moment=require(_0x5cf3('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5cf3('0x6'));var path=require('path');var sox=require(_0x5cf3('0x7'));var csv=require(_0x5cf3('0x8'));var ejs=require(_0x5cf3('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x5cf3('0xa'));var crypto=require(_0x5cf3('0xb'));var jsforce=require(_0x5cf3('0xc'));var deskjs=require(_0x5cf3('0xd'));var toCsv=require(_0x5cf3('0x8'));var querystring=require(_0x5cf3('0xe'));var Papa=require(_0x5cf3('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5cf3('0x10'));var as=require(_0x5cf3('0x11'));var hardwareService=require(_0x5cf3('0x12'));var logger=require('../../config/logger')(_0x5cf3('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x5cf3('0x14'))['db'];config[_0x5cf3('0x15')]=_[_0x5cf3('0x16')](config[_0x5cf3('0x15')],{'host':_0x5cf3('0x17'),'port':0x18eb});var socket=require(_0x5cf3('0x18'))(new Redis(config[_0x5cf3('0x15')]));require(_0x5cf3('0x19'))[_0x5cf3('0x1a')](socket);function respondWithStatusCode(_0x398dfa,_0x5e52d3){_0x5e52d3=_0x5e52d3||0xcc;return function(_0x18981d){if(_0x18981d){return _0x398dfa[_0x5cf3('0x1b')](_0x5e52d3);}return _0x398dfa[_0x5cf3('0x1c')](_0x5e52d3)[_0x5cf3('0x1d')]();};}function respondWithResult(_0x1aafa1,_0x118318){_0x118318=_0x118318||0xc8;return function(_0x1f5eb0){if(_0x1f5eb0){return _0x1aafa1['status'](_0x118318)[_0x5cf3('0x1e')](_0x1f5eb0);}};}function respondWithFilteredResult(_0x3379e7,_0x2e3dca){return function(_0x4af2ca){if(_0x4af2ca){var _0x51945e=_0x4af2ca[_0x5cf3('0x1f')],_0x5c133d=_0x2e3dca[_0x5cf3('0x20')],_0x2c688e=_0x2e3dca[_0x5cf3('0x20')]+_0x2e3dca[_0x5cf3('0x21')],_0xd83bce;if(_0x2c688e>=_0x51945e){_0x2c688e=_0x51945e;_0xd83bce=0xc8;}else{_0xd83bce=0xce;}_0x3379e7[_0x5cf3('0x1c')](_0xd83bce);return _0x3379e7['set'](_0x5cf3('0x22'),_0x5c133d+'-'+_0x2c688e+'/'+_0x51945e)[_0x5cf3('0x1e')](_0x4af2ca);}return null;};}function patchUpdates(_0x566787){return function(_0x44b842){try{jsonpatch[_0x5cf3('0x23')](_0x44b842,_0x566787,!![]);}catch(_0x2eee0e){return BPromise[_0x5cf3('0x24')](_0x2eee0e);}return _0x44b842[_0x5cf3('0x25')]();};}function saveUpdates(_0x351306,_0x5d3e4f){return function(_0x5600e4){if(_0x5600e4){return _0x5600e4[_0x5cf3('0x26')](_0x351306)['then'](function(_0x160967){return _0x160967;});}return null;};}function removeEntity(_0x431595,_0x35b209){return function(_0x43231f){if(_0x43231f){return _0x43231f[_0x5cf3('0x27')]()['then'](function(){_0x431595['status'](0xcc)[_0x5cf3('0x1d')]();});}};}function handleEntityNotFound(_0x477dfa,_0x4f4433){return function(_0x29e2b1){if(!_0x29e2b1){_0x477dfa[_0x5cf3('0x1b')](0x194);}return _0x29e2b1;};}function handleError(_0x38de9e,_0xdffe9b){_0xdffe9b=_0xdffe9b||0x1f4;return function(_0x5498eb){logger[_0x5cf3('0x28')](_0x5498eb[_0x5cf3('0x29')]);if(_0x5498eb[_0x5cf3('0x2a')]){delete _0x5498eb['name'];}_0x38de9e[_0x5cf3('0x1c')](_0xdffe9b)[_0x5cf3('0x2b')](_0x5498eb);};}exports[_0x5cf3('0x2c')]=function(_0x41efc5,_0x44fa3b){var _0x2ea860={},_0x113c9={},_0x7abfbc={'count':0x0,'rows':[]};var _0x4f68a9=_[_0x5cf3('0x2d')](db[_0x5cf3('0x2e')]['rawAttributes'],function(_0x3d674a){return{'name':_0x3d674a[_0x5cf3('0x2f')],'type':_0x3d674a[_0x5cf3('0x30')][_0x5cf3('0x31')]};});_0x113c9[_0x5cf3('0x32')]=_[_0x5cf3('0x2d')](_0x4f68a9,_0x5cf3('0x2a'));_0x113c9[_0x5cf3('0x33')]=_[_0x5cf3('0x34')](_0x41efc5['query']);_0x113c9['filters']=_[_0x5cf3('0x35')](_0x113c9[_0x5cf3('0x32')],_0x113c9[_0x5cf3('0x33')]);_0x2ea860['attributes']=_[_0x5cf3('0x35')](_0x113c9[_0x5cf3('0x32')],qs[_0x5cf3('0x36')](_0x41efc5[_0x5cf3('0x33')][_0x5cf3('0x36')]));_0x2ea860[_0x5cf3('0x37')]=_0x2ea860[_0x5cf3('0x37')][_0x5cf3('0x38')]?_0x2ea860[_0x5cf3('0x37')]:_0x113c9[_0x5cf3('0x32')];if(!_0x41efc5['query'][_0x5cf3('0x39')](_0x5cf3('0x3a'))){_0x2ea860[_0x5cf3('0x21')]=qs[_0x5cf3('0x21')](_0x41efc5['query'][_0x5cf3('0x21')]);_0x2ea860['offset']=qs[_0x5cf3('0x20')](_0x41efc5[_0x5cf3('0x33')][_0x5cf3('0x20')]);}_0x2ea860[_0x5cf3('0x3b')]=qs['sort'](_0x41efc5[_0x5cf3('0x33')][_0x5cf3('0x3c')]);_0x2ea860[_0x5cf3('0x3d')]=qs[_0x5cf3('0x3e')](_[_0x5cf3('0x3f')](_0x41efc5[_0x5cf3('0x33')],_0x113c9['filters']));if(_0x41efc5[_0x5cf3('0x33')][_0x5cf3('0x40')]){_0x2ea860['where']=_['merge'](_0x2ea860[_0x5cf3('0x3d')],{'$or':_[_0x5cf3('0x2d')](_0x4f68a9,function(_0x59ad48){if(_0x59ad48[_0x5cf3('0x30')][_0x5cf3('0x31')]!==_0x5cf3('0x41')){var _0x447a6b={};_0x447a6b[_0x59ad48[_0x5cf3('0x42')]]={'$like':'%'+_0x41efc5[_0x5cf3('0x33')][_0x5cf3('0x40')]+'%'};return _0x447a6b;}})});}_0x2ea860=_['merge']({},_0x2ea860,_0x41efc5[_0x5cf3('0x43')]);var _0x4380e4={'where':_0x2ea860[_0x5cf3('0x3d')]};return db['UserProfile'][_0x5cf3('0x1f')](_0x4380e4)[_0x5cf3('0x44')](function(_0x3af846){_0x7abfbc['count']=_0x3af846;if(_0x41efc5[_0x5cf3('0x33')][_0x5cf3('0x45')]){_0x2ea860[_0x5cf3('0x46')]=[{'all':!![]}];}return db[_0x5cf3('0x2e')][_0x5cf3('0x47')](_0x2ea860);})['then'](function(_0x520d0d){_0x7abfbc[_0x5cf3('0x48')]=_0x520d0d;return _0x7abfbc;})[_0x5cf3('0x44')](respondWithFilteredResult(_0x44fa3b,_0x2ea860))[_0x5cf3('0x49')](handleError(_0x44fa3b,null));};exports[_0x5cf3('0x4a')]=function(_0x2aaa79,_0x5536dd){var _0x22d610={'raw':![],'where':{'id':_0x2aaa79[_0x5cf3('0x4b')]['id']}},_0x48b356={};_0x48b356[_0x5cf3('0x32')]=_[_0x5cf3('0x34')](db['UserProfile'][_0x5cf3('0x4c')]);_0x48b356[_0x5cf3('0x33')]=_['keys'](_0x2aaa79[_0x5cf3('0x33')]);_0x48b356[_0x5cf3('0x3e')]=_[_0x5cf3('0x35')](_0x48b356[_0x5cf3('0x32')],_0x48b356[_0x5cf3('0x33')]);_0x22d610[_0x5cf3('0x37')]=_[_0x5cf3('0x35')](_0x48b356[_0x5cf3('0x32')],qs[_0x5cf3('0x36')](_0x2aaa79[_0x5cf3('0x33')][_0x5cf3('0x36')]));_0x22d610[_0x5cf3('0x37')]=_0x22d610['attributes'][_0x5cf3('0x38')]?_0x22d610[_0x5cf3('0x37')]:_0x48b356[_0x5cf3('0x32')];if(_0x2aaa79[_0x5cf3('0x33')][_0x5cf3('0x45')]){_0x22d610[_0x5cf3('0x46')]=[{'all':!![]}];}_0x22d610=_['merge']({},_0x22d610,_0x2aaa79[_0x5cf3('0x43')]);return db[_0x5cf3('0x2e')][_0x5cf3('0x4d')](_0x22d610)[_0x5cf3('0x44')](handleEntityNotFound(_0x5536dd,null))[_0x5cf3('0x44')](respondWithResult(_0x5536dd,null))[_0x5cf3('0x49')](handleError(_0x5536dd,null));};exports[_0x5cf3('0x4e')]=function(_0x91b945,_0x3d792a){return db[_0x5cf3('0x2e')][_0x5cf3('0x4e')](_0x91b945[_0x5cf3('0x4f')],{})['then'](respondWithResult(_0x3d792a,0xc9))[_0x5cf3('0x49')](handleError(_0x3d792a,null));};exports[_0x5cf3('0x50')]=function(_0xc55f38,_0x419f2e){var _0x50425a={'raw':![],'where':{'id':_0xc55f38[_0x5cf3('0x4b')]['id']}},_0x29c328={};_0x29c328['model']=_[_0x5cf3('0x34')](db[_0x5cf3('0x2e')]['rawAttributes']);_0x50425a[_0x5cf3('0x37')]=_['intersection'](_0x29c328[_0x5cf3('0x32')],qs[_0x5cf3('0x36')](_0xc55f38['query']['fields']));_0x50425a['attributes']=_0x50425a[_0x5cf3('0x37')][_0x5cf3('0x38')]?_0x50425a['attributes']:_0x29c328['model'];if(_0xc55f38[_0x5cf3('0x33')][_0x5cf3('0x45')]){_0x50425a[_0x5cf3('0x46')]=[{'all':!![]}];}_0x50425a=_[_0x5cf3('0x51')]({},_0x50425a,_0xc55f38[_0x5cf3('0x43')]);return db[_0x5cf3('0x2e')][_0x5cf3('0x4d')](_0x50425a)[_0x5cf3('0x44')](handleEntityNotFound(_0x419f2e,null))[_0x5cf3('0x44')](function(_0x281e8b){if(_0x281e8b){var _0xb5e110=_0x281e8b[_0x5cf3('0x52')]({'plain':!![]});_0xb5e110=qs['omit'](_0xb5e110,['id',_0x5cf3('0x53'),'updatedAt',_0x5cf3('0x54')]);_0xc55f38[_0x5cf3('0x4f')]=_[_0x5cf3('0x55')](_0xc55f38[_0x5cf3('0x4f')],['id',_0x5cf3('0x53'),_0x5cf3('0x56')]);return db[_0x5cf3('0x57')][_0x5cf3('0x58')](function(_0x141dd7){return db[_0x5cf3('0x2e')][_0x5cf3('0x4e')](_[_0x5cf3('0x51')](_0xb5e110,_0xc55f38[_0x5cf3('0x4f')]),{'include':_0xc55f38[_0x5cf3('0x33')][_0x5cf3('0x45')]?[{'all':!![]}]:undefined,'transaction':_0x141dd7})[_0x5cf3('0x44')](function(_0x1d4b2c){var _0x33a2a4=_0x1d4b2c[_0x5cf3('0x52')]({'plain':!![]});return db['UserProfileSection'][_0x5cf3('0x47')]({'where':{'userProfileId':_0xc55f38[_0x5cf3('0x4b')]['id']},'raw':!![]})[_0x5cf3('0x44')](function(_0x1604ca){if(_0x1604ca){return BPromise[_0x5cf3('0x59')](_0x1604ca,function(_0x21f81d){return new BPromise(function(_0x574901,_0x3c7c18){if(_0x21f81d[_0x5cf3('0x5a')]===null||_0x21f81d[_0x5cf3('0x5a')]===0x1)_0x574901(null);return db[_0x5cf3('0x5b')][_0x5cf3('0x47')]({'where':{'sectionId':_0x21f81d['id']},'raw':!![]})[_0x5cf3('0x44')](function(_0x423989){var _0x2f731d=_['map'](_0x423989,function(_0x5bfb21){return qs[_0x5cf3('0x55')](_0x5bfb21,['id',_0x5cf3('0x53'),_0x5cf3('0x56'),_0x5cf3('0x5c')]);});_0x574901(_0x2f731d);})[_0x5cf3('0x49')](function(_0x42ba6e){_0x3c7c18(_0x42ba6e);});})[_0x5cf3('0x44')](function(_0x511f45){var _0x5da1cf=qs[_0x5cf3('0x55')](_0x21f81d,['id',_0x5cf3('0x53'),_0x5cf3('0x56')]);_0x5da1cf[_0x5cf3('0x5d')]=_0x33a2a4['id'];if(_0x511f45)_0x5da1cf[_0x5cf3('0x5e')]=_0x511f45;return _0x5da1cf;})[_0x5cf3('0x44')](function(_0x7ed2e8){return db[_0x5cf3('0x5f')][_0x5cf3('0x4e')](_0x7ed2e8,{'include':[{'model':db[_0x5cf3('0x5b')],'as':_0x5cf3('0x5e')}],'raw':!![],'transaction':_0x141dd7});});})[_0x5cf3('0x44')](function(){return _0x33a2a4;});}});});});}})['then'](respondWithResult(_0x419f2e,0xc9))[_0x5cf3('0x49')](handleError(_0x419f2e,null));};exports[_0x5cf3('0x26')]=function(_0x59f87d,_0x61ac66){if(_0x59f87d[_0x5cf3('0x4f')]['id']){delete _0x59f87d['body']['id'];}return db[_0x5cf3('0x2e')]['find']({'where':{'id':_0x59f87d[_0x5cf3('0x4b')]['id']}})[_0x5cf3('0x44')](handleEntityNotFound(_0x61ac66,null))['then'](saveUpdates(_0x59f87d[_0x5cf3('0x4f')],null))[_0x5cf3('0x44')](respondWithResult(_0x61ac66,null))[_0x5cf3('0x49')](handleError(_0x61ac66,null));};exports[_0x5cf3('0x27')]=function(_0x4d5598,_0x5224ae){return db[_0x5cf3('0x2e')][_0x5cf3('0x4d')]({'where':{'id':_0x4d5598[_0x5cf3('0x4b')]['id']}})[_0x5cf3('0x44')](handleEntityNotFound(_0x5224ae,null))[_0x5cf3('0x44')](removeEntity(_0x5224ae,null))['catch'](handleError(_0x5224ae,null));};exports[_0x5cf3('0x60')]=function(_0x56a1db,_0x115a4c){return db[_0x5cf3('0x2e')][_0x5cf3('0x60')]()[_0x5cf3('0x44')](respondWithResult(_0x115a4c,null))[_0x5cf3('0x49')](handleError(_0x115a4c,null));};exports[_0x5cf3('0x61')]=function(_0x4d0b7b,_0x3abd07){var _0x34e629=_0x4d0b7b['body'];return db[_0x5cf3('0x2e')][_0x5cf3('0x4d')]({'where':{'id':_0x4d0b7b[_0x5cf3('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3abd07,null))[_0x5cf3('0x44')](function(_0x2e3600){if(_0x2e3600){return db[_0x5cf3('0x57')]['transaction'](function(_0x12d4df){return db[_0x5cf3('0x5f')]['destroy']({'where':{'userProfileId':_0x4d0b7b['params']['id'],'sectionId':_[_0x5cf3('0x2d')](_0x34e629,function(_0x5f1dd1){return _0x5f1dd1[_0x5cf3('0x5c')];})},'transaction':_0x12d4df})['then'](function(){var _0x32bba2=_[_0x5cf3('0x2d')](_0x34e629,function(_0x5f0a60){_0x5f0a60[_0x5cf3('0x5d')]=_0x4d0b7b[_0x5cf3('0x4b')]['id'];return _0x5f0a60;});var _0xd06042=[];return BPromise['each'](_0x32bba2,function(_0x5dc35d){return db[_0x5cf3('0x5f')][_0x5cf3('0x4e')](_0x5dc35d,{'include':[{'model':db[_0x5cf3('0x5b')],'as':_0x5cf3('0x5e')}],'raw':!![],'transaction':_0x12d4df})[_0x5cf3('0x44')](function(_0x496c5e){_0xd06042['push'](_0x496c5e['get']({'plain':!![]}));});})[_0x5cf3('0x44')](function(){return _0xd06042;});});});}})['then'](function(_0x5ee15d){return _0x5ee15d;})['then'](respondWithResult(_0x3abd07,null))[_0x5cf3('0x49')](handleError(_0x3abd07,null));};exports['removeSections']=function(_0x8c2f0a,_0x183246){var _0x3ca796;return db[_0x5cf3('0x2e')][_0x5cf3('0x4d')]({'where':{'id':_0x8c2f0a['params']['id']},'attributes':['id',_0x5cf3('0x2a')]})['then'](handleEntityNotFound(_0x183246,null))[_0x5cf3('0x44')](function(_0x1a3d6a){if(_0x1a3d6a){_0x3ca796=_0x1a3d6a;return db[_0x5cf3('0x5f')][_0x5cf3('0x27')]({'where':{'userProfileId':_0x8c2f0a[_0x5cf3('0x4b')]['id'],'sectionId':_0x8c2f0a[_0x5cf3('0x33')][_0x5cf3('0x62')]}});}})['then'](function(){return _0x3ca796;})[_0x5cf3('0x44')](respondWithStatusCode(_0x183246,null))['catch'](handleError(_0x183246,null));};exports[_0x5cf3('0x63')]=function(_0x4e38c9,_0x4ac2a4){var _0x158354=[];var _0x14bacd=[];return db[_0x5cf3('0x5f')][_0x5cf3('0x47')]({'where':{'userProfileId':_0x4e38c9[_0x5cf3('0x4b')]['id']},'raw':!![]})[_0x5cf3('0x44')](function(_0x5d0e3){_0x158354=_[_0x5cf3('0x40')](_0x5d0e3,function(_0x57955c){return _0x57955c[_0x5cf3('0x64')]===0x1;});if(!_[_0x5cf3('0x65')](_0x158354)){return _['map'](_0x158354,function(_0x4c7979){return _0x4c7979[_0x5cf3('0x5c')];});}else{return;}})[_0x5cf3('0x44')](function(_0x5c580d){if(_0x5c580d)_0x14bacd=_0x5c580d;if(_[_0x5cf3('0x66')](_0x14bacd,0x64)){var _0x34d633=_[_0x5cf3('0x4d')](_0x158354,{'sectionId':0x64});return hasDefaultDashboard(_0x34d633)[_0x5cf3('0x44')](function(_0x2f0e00){return _[_0x5cf3('0x2d')](_0x158354,function(_0x86b150){if(_0x86b150['sectionId']===0x64){_0x86b150[_0x5cf3('0x67')]=_0x2f0e00;}return _0x86b150;});});}else{return;}})[_0x5cf3('0x44')](function(_0x5436e1){if(_0x5436e1)_0x158354=_0x5436e1;if(_[_0x5cf3('0x66')](_0x14bacd,0x3eb)||_[_0x5cf3('0x68')](_0x158354,{'enabled':![],'sectionId':0x3eb})){var _0x22b23e=_['find'](_0x158354,{'sectionId':0x3eb});return getCustomDashboards(_0x22b23e)[_0x5cf3('0x44')](function(_0xbbc740){return _[_0x5cf3('0x2d')](_0x158354,function(_0x50fd70){if(_0x50fd70['sectionId']===0x3eb){_0x50fd70[_0x5cf3('0x67')]=_0xbbc740;}return _0x50fd70;});});}else{return;}})['then'](function(_0xcc962c){if(_0xcc962c)_0x158354=_0xcc962c;if(_[_0x5cf3('0x66')](_0x14bacd,0x709)||_['some'](_0x158354,{'enabled':![],'sectionId':0x709})){var _0x55df02=_[_0x5cf3('0x4d')](_0x158354,{'sectionId':0x709});return getPlugins(_0x55df02)[_0x5cf3('0x44')](function(_0x90f922){return _[_0x5cf3('0x2d')](_0x158354,function(_0x1bd1a3){if(_0x1bd1a3['sectionId']===0x709){_0x1bd1a3['subsections']=_0x90f922;}return _0x1bd1a3;});});}else{return;}})[_0x5cf3('0x44')](function(_0x2563c6){if(_0x2563c6)_0x158354=_0x2563c6;return _0x158354;})[_0x5cf3('0x44')](respondWithResult(_0x4ac2a4,null))[_0x5cf3('0x49')](handleError(_0x4ac2a4,null));};function hasDefaultDashboard(_0x10362e){var _0x42e466=[0x65];return new BPromise(function(_0x3055f3,_0x4a573a){try{if(_0x10362e['autoAssociation']){_0x3055f3(_0x42e466);}else{return db['UserProfileResource']['findOne']({'where':{'sectionId':_0x10362e['id']},'raw':!![]})[_0x5cf3('0x44')](function(_0x3690eb){if(_0x3690eb){_0x3055f3(_0x42e466);}});}}catch(_0x547a6b){_0x4a573a(_0x547a6b);}});}function getCustomDashboards(_0x557ad4){var _0xa72c87=[];return new BPromise(function(_0x4080ff,_0x2d7d0c){try{if(_0x557ad4['autoAssociation']){return db[_0x5cf3('0x69')][_0x5cf3('0x47')]({'raw':!![]})['then'](function(_0x453db1){_0x453db1[_0x5cf3('0x6a')](function(_0x15c4e3){_0xa72c87[_0x5cf3('0x6b')](_0x15c4e3['id']+0x1869f);});_0x4080ff(_0xa72c87);});}else{return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x557ad4['id']},'raw':!![]})[_0x5cf3('0x44')](function(_0x40bacf){_0x40bacf[_0x5cf3('0x6a')](function(_0x8acac0){_0xa72c87[_0x5cf3('0x6b')](_0x8acac0[_0x5cf3('0x6c')]+0x1869f);});_0x4080ff(_0xa72c87);});}}catch(_0x2d4e51){_0x2d7d0c(_0x2d4e51);}});}function getPlugins(_0x1b61fa){var _0x2734b9=[];return new BPromise(function(_0xb98d21,_0x14668f){try{if(_0x1b61fa[_0x5cf3('0x5a')]){return db['Plugin'][_0x5cf3('0x47')]({'raw':!![]})[_0x5cf3('0x44')](function(_0x2cc33b){_0x2cc33b['forEach'](function(_0x55282c){_0x2734b9[_0x5cf3('0x6b')](_0x55282c['id']+0x15b38);});_0xb98d21(_0x2734b9);});}else{return db[_0x5cf3('0x5b')][_0x5cf3('0x47')]({'where':{'sectionId':_0x1b61fa['id']},'raw':!![]})[_0x5cf3('0x44')](function(_0x2783a1){_0x2783a1[_0x5cf3('0x6a')](function(_0x3ea4fc){_0x2734b9[_0x5cf3('0x6b')](_0x3ea4fc['resourceId']+0x15b38);});_0xb98d21(_0x2734b9);});}}catch(_0x16be46){_0x14668f(_0x16be46);}});}exports['addResources']=function(_0x2e8da2,_0x10625b){return db[_0x5cf3('0x2e')]['find']({'where':{'id':_0x2e8da2['params']['id']}})[_0x5cf3('0x44')](handleEntityNotFound(_0x10625b,null))[_0x5cf3('0x44')](function(_0x55cfad){if(_0x55cfad){return db[_0x5cf3('0x57')][_0x5cf3('0x58')](function(_0x24b228){return db[_0x5cf3('0x5f')]['findAll']({'where':{'userProfileId':_0x2e8da2[_0x5cf3('0x4b')]['id']},'attributes':['id'],'raw':!![]})[_0x5cf3('0x44')](function(_0x10023d){if(_0x10023d){return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x2e8da2[_0x5cf3('0x4b')]['id'],'id':_['map'](_0x10023d,function(_0x1a5c66){return _0x1a5c66['id'];})},'transaction':_0x24b228});}})[_0x5cf3('0x44')](function(_0x1d829d){var _0x32db0f=_[_0x5cf3('0x2d')](_0x2e8da2[_0x5cf3('0x4f')],function(_0x530a73){_0x530a73[_0x5cf3('0x5d')]=_0x2e8da2[_0x5cf3('0x4b')]['id'];return _0x530a73;});return db[_0x5cf3('0x5f')][_0x5cf3('0x6d')](_0x32db0f,{'raw':!![],'transaction':_0x24b228});})[_0x5cf3('0x44')](function(_0x2a54fd){var _0x280ecd=_[_0x5cf3('0x40')](_[_0x5cf3('0x2d')](_0x2a54fd,function(_0x24a9cf){return _0x24a9cf[_0x5cf3('0x52')]({'plain':!![]});}),{'includeAll':![]});if(_0x280ecd){return db[_0x5cf3('0x5f')][_0x5cf3('0x47')]({'where':{'userProfileId':_0x2e8da2[_0x5cf3('0x4b')]['id'],'sectionId':_[_0x5cf3('0x2d')](_0x280ecd,function(_0x2e4c23){return _0x2e4c23[_0x5cf3('0x5c')];})},'attributes':['id',_0x5cf3('0x5c')],'raw':!![]})[_0x5cf3('0x44')](function(_0x336a9a){var _0x5f50bb=_['map'](_0x2e8da2[_0x5cf3('0x4f')],function(_0x4aad2b){_0x4aad2b[_0x5cf3('0x5d')]=_0x2e8da2[_0x5cf3('0x4b')]['id'];return _0x4aad2b;});return db[_0x5cf3('0x5b')][_0x5cf3('0x6d')](_0x5f50bb,{'raw':!![],'transaction':_0x24b228});});}})['catch'](handleError(_0x10625b,null));});}})['then'](function(_0x522be9){var _0x26265e=_[_0x5cf3('0x2d')](_0x522be9,function(_0x3bef23){return _0x3bef23[_0x5cf3('0x52')]({'plain':!![]});});})[_0x5cf3('0x44')](respondWithResult(_0x10625b,null))[_0x5cf3('0x49')](handleError(_0x10625b,null));};exports[_0x5cf3('0x6e')]=function(_0x58cf15,_0x30b08e,_0x408c36){return db[_0x5cf3('0x2e')][_0x5cf3('0x4d')]({'where':{'id':_0x58cf15[_0x5cf3('0x4b')]['id']}})[_0x5cf3('0x44')](handleEntityNotFound(_0x30b08e,null))[_0x5cf3('0x44')](function(_0x41b29b){if(_0x41b29b){return _0x41b29b[_0x5cf3('0x6e')](_0x58cf15[_0x5cf3('0x33')][_0x5cf3('0x62')]);}})[_0x5cf3('0x44')](respondWithStatusCode(_0x30b08e,null))['catch'](handleError(_0x30b08e,null));};exports[_0x5cf3('0x6f')]=function(_0x2f4bf2,_0x965a66){var _0x377711={'raw':![],'where':{}};var _0x29f3e9={};var _0x1a85d5={'count':0x0,'rows':[]};var _0x52b102=_0x2f4bf2['query']['section'];if(typeof _0x52b102===_0x5cf3('0x70')){throw new db['Sequelize'][(_0x5cf3('0x71'))](_0x5cf3('0x72'));}var _0x2c19c4=_0x2f4bf2['query'][_0x5cf3('0x73')]||![];var _0x34e432=getQueryModels(_0x52b102,_0x2c19c4);if(typeof _0x34e432[_0x5cf3('0x74')]===_0x5cf3('0x70')){throw new db['Sequelize'][(_0x5cf3('0x71'))](_0x5cf3('0x75')+_0x52b102+'\x27');}var _0x17b432=[];if(!_[_0x5cf3('0x65')](_0x34e432[_0x5cf3('0x76')])){_0x17b432=_0x34e432[_0x5cf3('0x76')];}else{_0x17b432=[{'name':_0x52b102}];}return db['UserProfile'][_0x5cf3('0x77')]({'where':{'id':_0x2f4bf2[_0x5cf3('0x4b')]['id']}})['then'](handleEntityNotFound(_0x965a66,null))['then'](function(_0x507e90){if(_0x507e90){var _0x35fb3b=[];for(var _0x13a8c9=0x0;_0x13a8c9<_0x17b432[_0x5cf3('0x38')];_0x13a8c9++){_0x35fb3b['push'](db['UserProfileSection'][_0x5cf3('0x77')]({'where':{'userProfileId':_0x507e90['id'],'name':_0x17b432[_0x13a8c9]['name']},'raw':!![]}));}return BPromise[_0x5cf3('0x78')](_0x35fb3b);}})[_0x5cf3('0x44')](function(_0x100efd){var _0x1b174e=_[_0x5cf3('0x40')](_0x100efd,function(_0xcd811b){return _0xcd811b?_0xcd811b:undefined;});var _0x26ad99=_['filter'](_0x17b432,[_0x5cf3('0x79'),!![]]);var _0x30e372=_[_0x5cf3('0x65')](_0x1b174e)&&_[_0x5cf3('0x65')](_0x26ad99)?null:_[_0x5cf3('0x7a')](_0x26ad99,_0x1b174e);if(_0x30e372){var _0x576301=[];for(var _0xeed3f3=0x0;_0xeed3f3<_0x30e372[_0x5cf3('0x38')];_0xeed3f3++){var _0x505255=_[_0x5cf3('0x4d')](_0x17b432,function(_0xfeb6b0){return _0x30e372[_0xeed3f3]?_0xfeb6b0[_0x5cf3('0x2a')]===_0x30e372[_0xeed3f3][_0x5cf3('0x2a')]:null;});if(_0x505255){if(_0x30e372[_0xeed3f3][_0x5cf3('0x79')]){_0x576301[_0x5cf3('0x6b')](getAllResources(_0x34e432[_0x5cf3('0x74')],_0x30e372[_0xeed3f3]));}else{if(!_0x30e372[_0xeed3f3][_0x5cf3('0x5a')]){_0x576301[_0x5cf3('0x6b')](getAllowedResources(_0x505255,_0x30e372[_0xeed3f3],_0x34e432['childModel']));}else{if(_0x505255[_0x5cf3('0x32')]){_0x576301[_0x5cf3('0x6b')](getAllFilteredResources(_0x505255,_0x30e372[_0xeed3f3]));}}}}}return BPromise['all'](_0x576301);}else{return null;}})[_0x5cf3('0x44')](function(_0x104cbf){var _0x511621=_0x104cbf;var _0x4baf07=null;if(_0x511621){_0x4baf07=_0x511621['length']===0x1?_0x511621[0x0]:null;}if(_0x4baf07||_0x511621){var _0x2a3cd2=db[_0x34e432[_0x5cf3('0x74')]][_0x5cf3('0x4c')];_0x29f3e9[_0x5cf3('0x32')]=_[_0x5cf3('0x34')](_0x2a3cd2);_0x29f3e9[_0x5cf3('0x33')]=_[_0x5cf3('0x34')](_0x2f4bf2['query']);_0x29f3e9['filters']=_['intersection'](_0x29f3e9[_0x5cf3('0x32')],_0x29f3e9[_0x5cf3('0x33')]);_0x377711[_0x5cf3('0x37')]=_[_0x5cf3('0x35')](_0x29f3e9[_0x5cf3('0x32')],qs[_0x5cf3('0x36')](_0x2f4bf2['query'][_0x5cf3('0x36')]));_0x377711[_0x5cf3('0x37')]=_0x377711['attributes'][_0x5cf3('0x38')]?_0x377711[_0x5cf3('0x37')]:_0x29f3e9['model'];if(!_0x2f4bf2[_0x5cf3('0x33')][_0x5cf3('0x39')](_0x5cf3('0x3a'))){_0x377711[_0x5cf3('0x21')]=qs[_0x5cf3('0x21')](_0x2f4bf2['query'][_0x5cf3('0x21')]);_0x377711[_0x5cf3('0x20')]=qs['offset'](_0x2f4bf2[_0x5cf3('0x33')]['offset']);}_0x377711[_0x5cf3('0x3b')]=qs[_0x5cf3('0x3c')](_0x2f4bf2['query'][_0x5cf3('0x3c')]);_0x377711[_0x5cf3('0x3d')]=qs[_0x5cf3('0x3e')](_[_0x5cf3('0x3f')](_0x2f4bf2[_0x5cf3('0x33')],_0x29f3e9[_0x5cf3('0x3e')]));if(_0x2f4bf2[_0x5cf3('0x33')][_0x5cf3('0x40')]){_0x377711[_0x5cf3('0x3d')]=_[_0x5cf3('0x51')](_0x377711['where'],{'$or':_['map'](_0x2a3cd2,function(_0x1ac26b){if(_0x1ac26b[_0x5cf3('0x30')][_0x5cf3('0x31')]!=='VIRTUAL'){var _0x5875f1={};_0x5875f1[_0x1ac26b[_0x5cf3('0x42')]]={'$like':'%'+_0x2f4bf2['query'][_0x5cf3('0x40')]+'%'};return _0x5875f1;}})});}var _0xcd2b0e=[];if(_0x4baf07){var _0x2ac54b=_[_0x5cf3('0x4d')](_0x17b432,[_0x5cf3('0x2a'),_0x4baf07[_0x5cf3('0x2a')]]);if(_0x2ac54b[_0x5cf3('0x42')]){var _0x63c1f4={};if(_0x34e432[_0x5cf3('0x74')]===_0x5cf3('0x7b')){_0x63c1f4[_0x2ac54b[_0x5cf3('0x7c')]]=_[_0x5cf3('0x2d')](_0x4baf07['associatedResources'],'id');}else{_0x63c1f4[_0x2ac54b[_0x5cf3('0x7c')]]=_0x4baf07[_0x5cf3('0x7d')];}_0xcd2b0e['push'](_0x63c1f4);}else{_0x377711[_0x5cf3('0x3d')]['id']=_0x4baf07[_0x5cf3('0x7d')];}}else{for(var _0x384518=0x0;_0x384518<_0x511621[_0x5cf3('0x38')];_0x384518++){var _0x2ac54b=_[_0x5cf3('0x4d')](_0x17b432,[_0x5cf3('0x2a'),_0x511621[_0x384518][_0x5cf3('0x2a')]]);if(_0x2ac54b[_0x5cf3('0x42')]){var _0x63c1f4={};_0x63c1f4[_0x2ac54b[_0x5cf3('0x7c')]]=_0x511621[_0x384518][_0x5cf3('0x7d')];_0xcd2b0e['push'](_0x63c1f4);}else{if(!_0x377711[_0x5cf3('0x3d')]['id'])_0x377711[_0x5cf3('0x3d')]['id']=[];_0x511621[_0x384518][_0x5cf3('0x7d')][_0x5cf3('0x6a')](function(_0x15a086){_0x377711['where']['id'][_0x5cf3('0x6b')](_0x15a086);});}}}if(!_['isEmpty'](_0xcd2b0e)){_0x377711[_0x5cf3('0x3d')]=_[_0x5cf3('0x51')](_0x377711[_0x5cf3('0x3d')],{'$and':{'$or':_0xcd2b0e}});}_0x377711=_[_0x5cf3('0x51')]({},_0x377711,_0x2f4bf2[_0x5cf3('0x43')]);if(_0x4baf07&&!_0x4baf07['autoAssociation']&&_0x34e432[_0x5cf3('0x74')]===_0x5cf3('0x7b')){if(_0x2f4bf2[_0x5cf3('0x33')]['includeAll']){_0x377711['include']=[{'all':!![]}];}return db[_0x34e432[_0x5cf3('0x74')]][_0x5cf3('0x47')](_0x377711)[_0x5cf3('0x44')](function(_0x1c8cde){var _0x1b101c=[];_0x1c8cde[_0x5cf3('0x6a')](function(_0x2ed2ec){var _0x35ed54;switch(_0x2ed2ec[_0x5cf3('0x7e')]){case _0x5cf3('0x7f'):_0x35ed54=_['find'](_0x4baf07['associatedResources'],function(_0x495b3b){return _0x495b3b['id']===_0x2ed2ec[_0x5cf3('0x80')]&&_0x495b3b[_0x5cf3('0x30')]===_0x5cf3('0x81');});break;case _0x5cf3('0x82'):_0x35ed54=_[_0x5cf3('0x4d')](_0x4baf07[_0x5cf3('0x7d')],function(_0x5d5f70){return _0x5d5f70['id']===_0x2ed2ec[_0x5cf3('0x80')]&&_0x5d5f70[_0x5cf3('0x30')]===_0x5cf3('0x83');});break;}if(_0x35ed54)_0x1b101c['push'](_0x2ed2ec);});_0x1a85d5[_0x5cf3('0x1f')]=_0x1b101c[_0x5cf3('0x38')];_0x1a85d5[_0x5cf3('0x48')]=_0x1b101c;return _0x1a85d5;});}else{return db[_0x34e432['childModel']][_0x5cf3('0x1f')]({'where':_0x377711['where']})[_0x5cf3('0x44')](function(_0x4ebe4d){_0x1a85d5[_0x5cf3('0x1f')]=_0x4ebe4d;if(_0x2f4bf2[_0x5cf3('0x33')][_0x5cf3('0x45')]){if(_0x34e432[_0x5cf3('0x74')]===_0x5cf3('0x84')){_0x377711['include']=[{'model':db[_0x5cf3('0x85')],'as':_0x5cf3('0x86'),'attributes':['id','name',_0x5cf3('0x87')],'required':_0x2f4bf2['query'][_0x5cf3('0x88')]?!![]:![]},{'model':db['Tag'],'as':_0x5cf3('0x89'),'attributes':['id','name',_0x5cf3('0x87')],'through':_0x2f4bf2[_0x5cf3('0x33')][_0x5cf3('0x88')]?{'attributes':[],'where':{'TagId':_0x2f4bf2[_0x5cf3('0x33')]['tag']||undefined}}:{},'required':_0x2f4bf2[_0x5cf3('0x33')][_0x5cf3('0x88')]?!![]:![]}];}else{_0x377711[_0x5cf3('0x46')]=[{'all':!![]}];}}return db[_0x34e432['childModel']][_0x5cf3('0x47')](_0x377711);})[_0x5cf3('0x44')](function(_0x442052){_0x1a85d5[_0x5cf3('0x48')]=_0x442052;return _0x1a85d5;});}}else{return _0x1a85d5;}})['then'](respondWithFilteredResult(_0x965a66,_0x377711))[_0x5cf3('0x49')](handleError(_0x965a66,null));};function getAllResources(_0x2273a3,_0x12bd3e){return new BPromise(function(_0x134084,_0x1911df){if(_0x12bd3e){var _0x4d9543=_0x12bd3e[_0x5cf3('0x40')]?{[_0x12bd3e[_0x5cf3('0x40')][_0x5cf3('0x42')]]:_0x12bd3e[_0x5cf3('0x40')][_0x5cf3('0x8a')]}:undefined;return db[_0x2273a3][_0x5cf3('0x47')]({'where':_0x4d9543,'raw':!![]})['then'](function(_0x2df1a0){_0x12bd3e[_0x5cf3('0x7d')]=_[_0x5cf3('0x2d')](_0x2df1a0,'id');_0x134084(_0x12bd3e);})[_0x5cf3('0x49')](function(_0x263b49){_0x1911df(_0x263b49);});}else{_0x134084(null);}});}function getAllFilteredResources(_0x258867,_0x15bc65){return new BPromise(function(_0x38c182,_0x3842ba){var _0x486b48=_0x258867[_0x5cf3('0x40')]?{[_0x258867[_0x5cf3('0x40')][_0x5cf3('0x42')]]:_0x258867[_0x5cf3('0x40')][_0x5cf3('0x8a')]}:undefined;return db[_0x258867['model']][_0x5cf3('0x47')]({'where':_0x486b48,'raw':!![]})[_0x5cf3('0x44')](function(_0x3b8f34){_0x15bc65['associatedResources']=_['map'](_0x3b8f34,function(_0x1c51d1){return _0x1c51d1[_0x5cf3('0x2a')];});_0x38c182(_0x15bc65);})[_0x5cf3('0x49')](function(_0x5331e3){_0x3842ba(_0x5331e3);});});}function getAllowedResources(_0x9ae62d,_0x10c592,_0x51941a){return new BPromise(function(_0x42a294,_0x58017f){if(_0x10c592){return db['UserProfileResource'][_0x5cf3('0x47')]({'where':{'sectionId':_0x10c592['id']},'raw':!![]})[_0x5cf3('0x44')](function(_0x14e336){if(_0x9ae62d['field']&&_0x9ae62d[_0x5cf3('0x42')]!=='id'){_0x10c592[_0x5cf3('0x7d')]=_['map'](_0x14e336,function(_0x3ef1a5){return _0x3ef1a5[_0x9ae62d[_0x5cf3('0x42')]];});}else{if(_0x51941a===_0x5cf3('0x7b')){_0x10c592['associatedResources']=_[_0x5cf3('0x2d')](_0x14e336,function(_0x57b4bf){return{'id':_0x57b4bf[_0x5cf3('0x6c')],'type':_0x57b4bf[_0x5cf3('0x30')]};});}else{_0x10c592['associatedResources']=_[_0x5cf3('0x2d')](_0x14e336,function(_0x19d187){return _0x19d187['resourceId'];});}}_0x42a294(_0x10c592);})['catch'](function(_0x5a48fa){_0x58017f(_0x5a48fa);});}else{_0x42a294(null);}});}function getQueryModels(_0x2430e7,_0x2d345b){var _0x31530c=_0x2430e7[_0x5cf3('0x8b')]();var _0x207081={'childModel':undefined,'parentSections':[]};switch(_0x31530c){case _0x5cf3('0x8c'):_0x207081[_0x5cf3('0x74')]=_0x5cf3('0x8d');break;case _0x5cf3('0x8e'):_0x207081[_0x5cf3('0x74')]=_0x5cf3('0x8f');break;case _0x5cf3('0x90'):_0x207081['childModel']=_0x5cf3('0x91');_0x207081[_0x5cf3('0x76')]=[{'name':_0x5cf3('0x92'),'field':_0x5cf3('0x2a'),'foreignKey':'projectName'}];break;case _0x5cf3('0x93'):_0x207081[_0x5cf3('0x74')]=_0x5cf3('0x94');break;case _0x5cf3('0x95'):_0x207081[_0x5cf3('0x74')]=_0x5cf3('0x84');_0x207081[_0x5cf3('0x76')]=[{'name':'Lists','field':'id','foreignKey':_0x5cf3('0x96')}];break;case _0x5cf3('0x97'):_0x207081[_0x5cf3('0x74')]=_0x5cf3('0x98');break;case _0x5cf3('0x99'):_0x207081[_0x5cf3('0x74')]=_0x5cf3('0x9a');break;case _0x5cf3('0x9b'):_0x207081[_0x5cf3('0x74')]=_0x5cf3('0x9c');break;case _0x5cf3('0x9d'):_0x207081['childModel']=_0x5cf3('0x9e');break;case'chatwebsites':_0x207081[_0x5cf3('0x74')]=_0x5cf3('0x9f');break;case'faxqueues':_0x207081[_0x5cf3('0x74')]=_0x5cf3('0xa0');break;case _0x5cf3('0xa1'):_0x207081[_0x5cf3('0x74')]=_0x5cf3('0xa2');break;case _0x5cf3('0xa3'):case _0x5cf3('0xa4'):case _0x5cf3('0xa5'):_0x207081[_0x5cf3('0x74')]=_0x5cf3('0xa6');break;case _0x5cf3('0xa7'):_0x207081[_0x5cf3('0x74')]=_0x5cf3('0xa8');break;case'voicemails':_0x207081[_0x5cf3('0x74')]=_0x5cf3('0xa9');break;case _0x5cf3('0xaa'):_0x207081[_0x5cf3('0x74')]='VoiceRecording';_0x207081['parentSections']=[{'name':_0x5cf3('0xab'),'field':_0x5cf3('0x2a'),'foreignKey':_0x5cf3('0xac'),'model':_0x5cf3('0xad'),'filter':{'field':'role','value':[_0x5cf3('0xae')]}},{'name':_0x5cf3('0xaf'),'field':_0x5cf3('0x2a'),'foreignKey':_0x5cf3('0xac'),'model':_0x5cf3('0xad'),'filter':{'field':_0x5cf3('0xb0'),'value':['telephone']}},{'name':_0x5cf3('0xb1'),'field':_0x5cf3('0x2a'),'foreignKey':_0x5cf3('0xb2'),'model':_0x5cf3('0xb3'),'filter':{'field':'type','value':[_0x5cf3('0xb4')]}},{'name':_0x5cf3('0xb5'),'field':_0x5cf3('0x2a'),'foreignKey':'queue','model':_0x5cf3('0xb3'),'filter':{'field':_0x5cf3('0x30'),'value':[_0x5cf3('0xb6')]}}];break;case _0x5cf3('0xb7'):_0x207081[_0x5cf3('0x74')]=_0x5cf3('0xb8');break;case'chanspies':_0x207081[_0x5cf3('0x74')]=_0x5cf3('0xb9');break;case _0x5cf3('0xba'):_0x207081[_0x5cf3('0x74')]=_0x5cf3('0xbb');break;case _0x5cf3('0xbc'):_0x207081['childModel']=_0x5cf3('0xbd');break;case _0x5cf3('0xbe'):_0x207081[_0x5cf3('0x74')]=_0x5cf3('0xbf');break;case _0x5cf3('0xc0'):_0x207081['childModel']='MailAccount';break;case _0x5cf3('0xc1'):_0x207081['childModel']=_0x5cf3('0xc2');break;case _0x5cf3('0xc3'):_0x207081[_0x5cf3('0x74')]=_0x5cf3('0xc4');break;case _0x5cf3('0xc5'):_0x207081['childModel']=_0x5cf3('0xc6');break;case _0x5cf3('0xc7'):_0x207081['childModel']=_0x5cf3('0xc8');break;case _0x5cf3('0xc9'):_0x207081[_0x5cf3('0x74')]='SmsAccount';break;case _0x5cf3('0xca'):_0x207081[_0x5cf3('0x74')]=_0x5cf3('0xcb');break;case'voicequeues':case _0x5cf3('0xcc'):_0x207081[_0x5cf3('0x74')]=_0x5cf3('0xb3');if(_0x2d345b){_0x207081[_0x5cf3('0x76')]=[{'name':_0x5cf3('0xb1')},{'name':'QueueCampaigns'}];}break;case _0x5cf3('0xcd'):case _0x5cf3('0xce'):case _0x5cf3('0xcf'):_0x207081['childModel']=_0x5cf3('0xad');if(_0x2d345b){_0x207081[_0x5cf3('0x76')]=[{'name':_0x5cf3('0xd0'),'filter':{'field':'role','value':[_0x5cf3('0xd1'),'user']},'ignore':!![]},{'name':_0x5cf3('0xab')},{'name':_0x5cf3('0xaf')}];}break;case _0x5cf3('0xd2'):_0x207081[_0x5cf3('0x74')]=_0x5cf3('0xd3');break;case _0x5cf3('0xd4'):_0x207081[_0x5cf3('0x74')]=_0x5cf3('0xd5');break;case'freshdeskaccounts':_0x207081[_0x5cf3('0x74')]=_0x5cf3('0xd6');break;case'sugarcrmaccounts':_0x207081[_0x5cf3('0x74')]=_0x5cf3('0xd7');break;case _0x5cf3('0xd8'):_0x207081[_0x5cf3('0x74')]='DeskAccount';break;case _0x5cf3('0xd9'):_0x207081[_0x5cf3('0x74')]=_0x5cf3('0xda');break;case _0x5cf3('0xdb'):_0x207081['childModel']='User';break;case _0x5cf3('0xdc'):_0x207081[_0x5cf3('0x74')]=_0x5cf3('0xdd');break;case _0x5cf3('0xde'):_0x207081[_0x5cf3('0x74')]='Disposition';break;case _0x5cf3('0xdf'):_0x207081[_0x5cf3('0x74')]='Dashboard';break;case'intervals':_0x207081[_0x5cf3('0x74')]=_0x5cf3('0xe0');break;case _0x5cf3('0xe1'):_0x207081['childModel']='Pause';break;case _0x5cf3('0xe2'):_0x207081[_0x5cf3('0x74')]=_0x5cf3('0xe3');break;case _0x5cf3('0xe4'):_0x207081[_0x5cf3('0x74')]='Sound';break;case _0x5cf3('0xe5'):_0x207081[_0x5cf3('0x74')]=_0x5cf3('0x85');break;case _0x5cf3('0xe6'):_0x207081[_0x5cf3('0x74')]=_0x5cf3('0xe7');break;case'triggers':_0x207081[_0x5cf3('0x74')]=_0x5cf3('0xe8');break;case _0x5cf3('0xe9'):_0x207081[_0x5cf3('0x74')]=_0x5cf3('0xea');break;case'variables':_0x207081[_0x5cf3('0x74')]='Variable';break;case _0x5cf3('0xeb'):_0x207081[_0x5cf3('0x74')]=_0x5cf3('0xec');break;case _0x5cf3('0xed'):_0x207081[_0x5cf3('0x74')]=_0x5cf3('0x7b');_0x207081[_0x5cf3('0x76')]=[{'name':_0x5cf3('0xee'),'field':'id','foreignKey':_0x5cf3('0x80')}];break;case _0x5cf3('0xef'):_0x207081['childModel']=_0x5cf3('0xf0');break;default:return _0x207081;}return _0x207081;} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 38d0140..c670878 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 _0x80bb=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','UserProfile'];(function(_0x32ca62,_0x18fe6a){var _0x175d88=function(_0x3bc7ec){while(--_0x3bc7ec){_0x32ca62['push'](_0x32ca62['shift']());}};_0x175d88(++_0x18fe6a);}(_0x80bb,0x147));var _0xb80b=function(_0x67caf,_0x56a915){_0x67caf=_0x67caf-0x0;var _0x57118e=_0x80bb[_0x67caf];return _0x57118e;};'use strict';var EventEmitter=require(_0xb80b('0x0'));var UserProfile=require(_0xb80b('0x1'))['db'][_0xb80b('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xb80b('0x3')](0x0);var events={'afterCreate':_0xb80b('0x4'),'afterUpdate':_0xb80b('0x5'),'afterDestroy':_0xb80b('0x6')};function emitEvent(_0x1551e2){return function(_0x308a32,_0x266954,_0x368b55){UserProfileEvents[_0xb80b('0x7')](_0x1551e2+':'+_0x308a32['id'],_0x308a32);UserProfileEvents[_0xb80b('0x7')](_0x1551e2,_0x308a32);_0x368b55(null);};}for(var e in events){if(events[_0xb80b('0x8')](e)){var event=events[e];UserProfile[_0xb80b('0x9')](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file +var _0x60c7=['events','UserProfile','setMaxListeners','update','remove','emit'];(function(_0xe14b25,_0x2ec48b){var _0x2dd111=function(_0x116a10){while(--_0x116a10){_0xe14b25['push'](_0xe14b25['shift']());}};_0x2dd111(++_0x2ec48b);}(_0x60c7,0x19e));var _0x760c=function(_0x52fdcd,_0x2af9f6){_0x52fdcd=_0x52fdcd-0x0;var _0x541b9f=_0x60c7[_0x52fdcd];return _0x541b9f;};'use strict';var EventEmitter=require(_0x760c('0x0'));var UserProfile=require('../../mysqldb')['db'][_0x760c('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x760c('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x760c('0x3'),'afterDestroy':_0x760c('0x4')};function emitEvent(_0x587930){return function(_0x21527b,_0x3ccad0,_0xa8c201){UserProfileEvents[_0x760c('0x5')](_0x587930+':'+_0x21527b['id'],_0x21527b);UserProfileEvents['emit'](_0x587930,_0x21527b);_0xa8c201(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 7511bcc..895561a 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 _0x307e=['request-promise','rimraf','../../config/environment','./userProfile.attributes','UserProfile','user_profiles','lodash','util','api','moment','bluebird'];(function(_0xa03640,_0x5cd130){var _0x188eba=function(_0x5ed07b){while(--_0x5ed07b){_0xa03640['push'](_0xa03640['shift']());}};_0x188eba(++_0x5cd130);}(_0x307e,0xab));var _0xe307=function(_0xf19f52,_0x2faecf){_0xf19f52=_0xf19f52-0x0;var _0xceb678=_0x307e[_0xf19f52];return _0xceb678;};'use strict';var _=require(_0xe307('0x0'));var util=require(_0xe307('0x1'));var logger=require('../../config/logger')(_0xe307('0x2'));var moment=require(_0xe307('0x3'));var BPromise=require(_0xe307('0x4'));var rp=require(_0xe307('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe307('0x6'));var config=require(_0xe307('0x7'));var attributes=require(_0xe307('0x8'));module['exports']=function(_0xe10703,_0x4fa046){return _0xe10703['define'](_0xe307('0x9'),attributes,{'tableName':_0xe307('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5b37=['./userProfile.attributes','exports','define','UserProfile','user_profiles','lodash','util','../../config/logger','api','moment','request-promise','rimraf'];(function(_0x2e0fe3,_0x4bdb19){var _0x4c30a6=function(_0x2be1ee){while(--_0x2be1ee){_0x2e0fe3['push'](_0x2e0fe3['shift']());}};_0x4c30a6(++_0x4bdb19);}(_0x5b37,0x1a9));var _0x75b3=function(_0x1d14a4,_0x3d0375){_0x1d14a4=_0x1d14a4-0x0;var _0x5cae92=_0x5b37[_0x1d14a4];return _0x5cae92;};'use strict';var _=require(_0x75b3('0x0'));var util=require(_0x75b3('0x1'));var logger=require(_0x75b3('0x2'))(_0x75b3('0x3'));var moment=require(_0x75b3('0x4'));var BPromise=require('bluebird');var rp=require(_0x75b3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x75b3('0x6'));var config=require('../../config/environment');var attributes=require(_0x75b3('0x7'));module[_0x75b3('0x8')]=function(_0x1ce0e5,_0x396034){return _0x1ce0e5[_0x75b3('0x9')](_0x75b3('0xa'),attributes,{'tableName':_0x75b3('0xb'),'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 47bbd54..438f8dc 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 _0x24ca=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./userProfile.socket','request','then','info','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','error','code','UserProfile,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x506620,_0x5da690){var _0x4c3e71=function(_0x3d849e){while(--_0x3d849e){_0x506620['push'](_0x506620['shift']());}};_0x4c3e71(++_0x5da690);}(_0x24ca,0x1bc));var _0xa24c=function(_0xe39824,_0xbdf61f){_0xe39824=_0xe39824-0x0;var _0x4bc31e=_0x24ca[_0xe39824];return _0x4bc31e;};'use strict';var _=require(_0xa24c('0x0'));var util=require('util');var moment=require(_0xa24c('0x1'));var BPromise=require(_0xa24c('0x2'));var rs=require(_0xa24c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa24c('0x4'))['db'];var utils=require(_0xa24c('0x5'));var logger=require(_0xa24c('0x6'))(_0xa24c('0x7'));var config=require(_0xa24c('0x8'));var jayson=require(_0xa24c('0x9'));var client=jayson[_0xa24c('0xa')][_0xa24c('0xb')]({'port':0x232a});config[_0xa24c('0xc')]=_[_0xa24c('0xd')](config[_0xa24c('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xa24c('0xe'))(new Redis(config[_0xa24c('0xc')]));require(_0xa24c('0xf'))['register'](socket);function respondWithRpcPromise(_0x399f32,_0x325c6d,_0x288f76){return new BPromise(function(_0x211003,_0x169632){return client[_0xa24c('0x10')](_0x399f32,_0x288f76)[_0xa24c('0x11')](function(_0xc82af0){logger[_0xa24c('0x12')]('UserProfile,\x20%s,\x20%s',_0x325c6d,_0xa24c('0x13'));logger[_0xa24c('0x14')](_0xa24c('0x15'),_0x325c6d,_0xa24c('0x13'),JSON['stringify'](_0xc82af0));if(_0xc82af0[_0xa24c('0x16')]){if(_0xc82af0[_0xa24c('0x16')][_0xa24c('0x17')]===0x1f4){logger[_0xa24c('0x16')](_0xa24c('0x18'),_0x325c6d,_0xc82af0[_0xa24c('0x16')][_0xa24c('0x19')]);return _0x169632(_0xc82af0['error']['message']);}logger[_0xa24c('0x16')](_0xa24c('0x18'),_0x325c6d,_0xc82af0['error']['message']);return _0x211003(_0xc82af0[_0xa24c('0x16')][_0xa24c('0x19')]);}else{logger['info'](_0xa24c('0x18'),_0x325c6d,'request\x20sent');_0x211003(_0xc82af0[_0xa24c('0x1a')][_0xa24c('0x19')]);}})[_0xa24c('0x1b')](function(_0xefdbd9){logger['error'](_0xa24c('0x18'),_0x325c6d,_0xefdbd9);_0x169632(_0xefdbd9);});});} \ No newline at end of file +var _0xf2ca=['message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','register','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x5c6272,_0xd82df5){_0x5c6272=_0x5c6272-0x0;var _0x19c236=_0xf2ca[_0x5c6272];return _0x19c236;};'use strict';var _=require(_0xaf2c('0x0'));var util=require(_0xaf2c('0x1'));var moment=require(_0xaf2c('0x2'));var BPromise=require('bluebird');var rs=require(_0xaf2c('0x3'));var fs=require('fs');var Redis=require(_0xaf2c('0x4'));var db=require(_0xaf2c('0x5'))['db'];var utils=require(_0xaf2c('0x6'));var logger=require(_0xaf2c('0x7'))(_0xaf2c('0x8'));var config=require('../../config/environment');var jayson=require(_0xaf2c('0x9'));var client=jayson[_0xaf2c('0xa')][_0xaf2c('0xb')]({'port':0x232a});config[_0xaf2c('0xc')]=_['defaults'](config[_0xaf2c('0xc')],{'host':_0xaf2c('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaf2c('0xc')]));require('./userProfile.socket')[_0xaf2c('0xe')](socket);function respondWithRpcPromise(_0x4a0064,_0x2f5099,_0x144a7a){return new BPromise(function(_0x2e04e5,_0xd891e9){return client['request'](_0x4a0064,_0x144a7a)['then'](function(_0x2c0d88){logger[_0xaf2c('0xf')](_0xaf2c('0x10'),_0x2f5099,_0xaf2c('0x11'));logger[_0xaf2c('0x12')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x2f5099,'request\x20sent',JSON[_0xaf2c('0x13')](_0x2c0d88));if(_0x2c0d88[_0xaf2c('0x14')]){if(_0x2c0d88[_0xaf2c('0x14')][_0xaf2c('0x15')]===0x1f4){logger[_0xaf2c('0x14')](_0xaf2c('0x10'),_0x2f5099,_0x2c0d88[_0xaf2c('0x14')][_0xaf2c('0x16')]);return _0xd891e9(_0x2c0d88[_0xaf2c('0x14')][_0xaf2c('0x16')]);}logger[_0xaf2c('0x14')](_0xaf2c('0x10'),_0x2f5099,_0x2c0d88[_0xaf2c('0x14')][_0xaf2c('0x16')]);return _0x2e04e5(_0x2c0d88[_0xaf2c('0x14')]['message']);}else{logger[_0xaf2c('0xf')]('UserProfile,\x20%s,\x20%s',_0x2f5099,_0xaf2c('0x11'));_0x2e04e5(_0x2c0d88[_0xaf2c('0x17')][_0xaf2c('0x16')]);}})['catch'](function(_0x28ae7b){logger[_0xaf2c('0x14')](_0xaf2c('0x10'),_0x2f5099,_0x28ae7b);_0xd891e9(_0x28ae7b);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index d942af0..0fbf504 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 _0x7b7f=['length','remove','emit','register'];(function(_0xe206ed,_0x179821){var _0x4423ab=function(_0x2668d2){while(--_0x2668d2){_0xe206ed['push'](_0xe206ed['shift']());}};_0x4423ab(++_0x179821);}(_0x7b7f,0x111));var _0xf7b7=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0x7b7f[_0x1b349a];return _0x5d1f7c;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=['save',_0xf7b7('0x0'),'update'];function createListener(_0x2a5b42,_0x1c1ffe){return function(_0x79756d){_0x1c1ffe[_0xf7b7('0x1')](_0x2a5b42,_0x79756d);};}function removeListener(_0x1dd4ef,_0x1144ad){return function(){UserProfileEvents['removeListener'](_0x1dd4ef,_0x1144ad);};}exports[_0xf7b7('0x2')]=function(_0x2d1f8f){for(var _0x5abf86=0x0,_0x2a96a5=events[_0xf7b7('0x3')];_0x5abf86<_0x2a96a5;_0x5abf86++){var _0x3590b2=events[_0x5abf86];var _0x32d37b=createListener('userProfile:'+_0x3590b2,_0x2d1f8f);UserProfileEvents['on'](_0x3590b2,_0x32d37b);}}; \ No newline at end of file +var _0xe399=['length','./userProfile.events','save','remove','emit','removeListener'];(function(_0x145e9e,_0x2e6dd4){var _0x2264c2=function(_0x57d209){while(--_0x57d209){_0x145e9e['push'](_0x145e9e['shift']());}};_0x2264c2(++_0x2e6dd4);}(_0xe399,0x1b1));var _0x9e39=function(_0x466e25,_0x37cc50){_0x466e25=_0x466e25-0x0;var _0x56bede=_0xe399[_0x466e25];return _0x56bede;};'use strict';var UserProfileEvents=require(_0x9e39('0x0'));var events=[_0x9e39('0x1'),_0x9e39('0x2'),'update'];function createListener(_0x3958be,_0x5d9063){return function(_0x30cca9){_0x5d9063[_0x9e39('0x3')](_0x3958be,_0x30cca9);};}function removeListener(_0x56ce52,_0x997621){return function(){UserProfileEvents[_0x9e39('0x4')](_0x56ce52,_0x997621);};}exports['register']=function(_0x42ca29){for(var _0x56352=0x0,_0x1024ed=events[_0x9e39('0x5')];_0x56352<_0x1024ed;_0x56352++){var _0x1aa8da=events[_0x56352];var _0x5739ca=createListener('userProfile:'+_0x1aa8da,_0x42ca29);UserProfileEvents['on'](_0x1aa8da,_0x5739ca);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 51560f0..8ae55d6 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 _0xe2a4=['put','delete','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated','index','/describe','/:id','show','post'];(function(_0x25fcaf,_0x27ef74){var _0x23ef07=function(_0x54e4c1){while(--_0x54e4c1){_0x25fcaf['push'](_0x25fcaf['shift']());}};_0x23ef07(++_0x27ef74);}(_0xe2a4,0xaf));var _0x4e2a=function(_0xdeac17,_0x19ad66){_0xdeac17=_0xdeac17-0x0;var _0x33aabd=_0xe2a4[_0xdeac17];return _0x33aabd;};'use strict';var multer=require(_0x4e2a('0x0'));var util=require(_0x4e2a('0x1'));var path=require('path');var timeout=require(_0x4e2a('0x2'));var express=require('express');var router=express[_0x4e2a('0x3')]();var auth=require(_0x4e2a('0x4'));var interaction=require(_0x4e2a('0x5'));var config=require(_0x4e2a('0x6'));var controller=require(_0x4e2a('0x7'));router[_0x4e2a('0x8')]('/',auth[_0x4e2a('0x9')](),controller[_0x4e2a('0xa')]);router[_0x4e2a('0x8')](_0x4e2a('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x4e2a('0x8')](_0x4e2a('0xc'),auth[_0x4e2a('0x9')](),controller[_0x4e2a('0xd')]);router[_0x4e2a('0xe')]('/',auth[_0x4e2a('0x9')](),controller['create']);router[_0x4e2a('0xf')](_0x4e2a('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x4e2a('0x10')](_0x4e2a('0xc'),auth[_0x4e2a('0x9')](),controller[_0x4e2a('0x11')]);module[_0x4e2a('0x12')]=router; \ No newline at end of file +var _0xd60e=['show','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','isAuthenticated','get','/describe','describe','/:id'];(function(_0x131dec,_0x469d5f){var _0x2592ab=function(_0x598f42){while(--_0x598f42){_0x131dec['push'](_0x131dec['shift']());}};_0x2592ab(++_0x469d5f);}(_0xd60e,0x1d6));var _0xed60=function(_0x15639d,_0x37592c){_0x15639d=_0x15639d-0x0;var _0x3151c7=_0xd60e[_0x15639d];return _0x3151c7;};'use strict';var multer=require(_0xed60('0x0'));var util=require(_0xed60('0x1'));var path=require(_0xed60('0x2'));var timeout=require('connect-timeout');var express=require(_0xed60('0x3'));var router=express[_0xed60('0x4')]();var auth=require(_0xed60('0x5'));var interaction=require(_0xed60('0x6'));var config=require(_0xed60('0x7'));var controller=require(_0xed60('0x8'));router['get']('/',auth[_0xed60('0x9')](),controller['index']);router[_0xed60('0xa')](_0xed60('0xb'),auth[_0xed60('0x9')](),controller[_0xed60('0xc')]);router[_0xed60('0xa')](_0xed60('0xd'),auth[_0xed60('0x9')](),controller[_0xed60('0xe')]);router[_0xed60('0xf')]('/',auth[_0xed60('0x9')](),controller[_0xed60('0x10')]);router[_0xed60('0x11')]('/:id',auth[_0xed60('0x9')](),controller[_0xed60('0x12')]);router[_0xed60('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xed60('0x14')]);module[_0xed60('0x15')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index c174aa9..b802009 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 _0x45c9=['sequelize','exports','STRING','INTEGER'];(function(_0xafaca6,_0x39c4a3){var _0x206220=function(_0x518ee2){while(--_0x518ee2){_0xafaca6['push'](_0xafaca6['shift']());}};_0x206220(++_0x39c4a3);}(_0x45c9,0x68));var _0x945c=function(_0x397897,_0x19fa45){_0x397897=_0x397897-0x0;var _0x3a4bc9=_0x45c9[_0x397897];return _0x3a4bc9;};'use strict';var Sequelize=require(_0x945c('0x0'));module[_0x945c('0x1')]={'name':{'type':Sequelize[_0x945c('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x945c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x945c('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x426f=['INTEGER','STRING','sequelize','exports'];(function(_0x247559,_0x1a3189){var _0x580b49=function(_0x2ad152){while(--_0x2ad152){_0x247559['push'](_0x247559['shift']());}};_0x580b49(++_0x1a3189);}(_0x426f,0x172));var _0xf426=function(_0x4d674b,_0x176474){_0x4d674b=_0x4d674b-0x0;var _0x535a1f=_0x426f[_0x4d674b];return _0x535a1f;};'use strict';var Sequelize=require(_0xf426('0x0'));module[_0xf426('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0xf426('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xf426('0x3')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index efad159..fa77b87 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 _0x1db9=['VIRTUAL','field','merge','options','include','findAll','catch','show','includeAll','find','create','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','send','index','map','UserProfileResource','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','filter'];(function(_0x4e6ae6,_0x49dba6){var _0x23c108=function(_0x1bc103){while(--_0x1bc103){_0x4e6ae6['push'](_0x4e6ae6['shift']());}};_0x23c108(++_0x49dba6);}(_0x1db9,0x176));var _0x91db=function(_0x31e23e,_0x360889){_0x31e23e=_0x31e23e-0x0;var _0x59987a=_0x1db9[_0x31e23e];return _0x59987a;};'use strict';var pdf=require(_0x91db('0x0'));var emlformat=require(_0x91db('0x1'));var rimraf=require(_0x91db('0x2'));var zipdir=require(_0x91db('0x3'));var jsonpatch=require(_0x91db('0x4'));var rp=require(_0x91db('0x5'));var moment=require('moment');var BPromise=require(_0x91db('0x6'));var Mustache=require(_0x91db('0x7'));var util=require('util');var path=require('path');var sox=require(_0x91db('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x91db('0x9'));var squel=require(_0x91db('0xa'));var crypto=require(_0x91db('0xb'));var jsforce=require(_0x91db('0xc'));var deskjs=require(_0x91db('0xd'));var toCsv=require('to-csv');var querystring=require(_0x91db('0xe'));var Papa=require('papaparse');var Redis=require(_0x91db('0xf'));var authService=require(_0x91db('0x10'));var qs=require(_0x91db('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x91db('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x91db('0x13'));var db=require(_0x91db('0x14'))['db'];function respondWithStatusCode(_0x4a7d9a,_0x540c48){_0x540c48=_0x540c48||0xcc;return function(_0x2b9b98){if(_0x2b9b98){return _0x4a7d9a[_0x91db('0x15')](_0x540c48);}return _0x4a7d9a[_0x91db('0x16')](_0x540c48)[_0x91db('0x17')]();};}function respondWithResult(_0x3564ab,_0x4c3124){_0x4c3124=_0x4c3124||0xc8;return function(_0x371158){if(_0x371158){return _0x3564ab[_0x91db('0x16')](_0x4c3124)[_0x91db('0x18')](_0x371158);}};}function respondWithFilteredResult(_0x4035b2,_0x2df307){return function(_0x33b39d){if(_0x33b39d){var _0x260b56=_0x33b39d[_0x91db('0x19')],_0x143bc4=_0x2df307[_0x91db('0x1a')],_0x675bd=_0x2df307['offset']+_0x2df307[_0x91db('0x1b')],_0x26d10c;if(_0x675bd>=_0x260b56){_0x675bd=_0x260b56;_0x26d10c=0xc8;}else{_0x26d10c=0xce;}_0x4035b2[_0x91db('0x16')](_0x26d10c);return _0x4035b2[_0x91db('0x1c')](_0x91db('0x1d'),_0x143bc4+'-'+_0x675bd+'/'+_0x260b56)[_0x91db('0x18')](_0x33b39d);}return null;};}function patchUpdates(_0x306e92){return function(_0x5c15ef){try{jsonpatch['apply'](_0x5c15ef,_0x306e92,!![]);}catch(_0x4158f5){return BPromise[_0x91db('0x1e')](_0x4158f5);}return _0x5c15ef[_0x91db('0x1f')]();};}function saveUpdates(_0xa6413b,_0x50cf9c){return function(_0x168dea){if(_0x168dea){return _0x168dea[_0x91db('0x20')](_0xa6413b)[_0x91db('0x21')](function(_0x23c287){return _0x23c287;});}return null;};}function removeEntity(_0x25593c,_0x31b96c){return function(_0xaad1f6){if(_0xaad1f6){return _0xaad1f6[_0x91db('0x22')]()[_0x91db('0x21')](function(){_0x25593c[_0x91db('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x58774f,_0x134caa){return function(_0x2ac8d5){if(!_0x2ac8d5){_0x58774f['sendStatus'](0x194);}return _0x2ac8d5;};}function handleError(_0xc82085,_0x16efa4){_0x16efa4=_0x16efa4||0x1f4;return function(_0x39ae31){logger[_0x91db('0x23')](_0x39ae31[_0x91db('0x24')]);if(_0x39ae31['name']){delete _0x39ae31['name'];}_0xc82085[_0x91db('0x16')](_0x16efa4)[_0x91db('0x25')](_0x39ae31);};}exports[_0x91db('0x26')]=function(_0x55e61e,_0x3b38f2){var _0x3c31ea={},_0x46c0e8={},_0x1bb4f8={'count':0x0,'rows':[]};var _0x512c79=_[_0x91db('0x27')](db[_0x91db('0x28')][_0x91db('0x29')],function(_0x49c504){return{'name':_0x49c504[_0x91db('0x2a')],'type':_0x49c504[_0x91db('0x2b')][_0x91db('0x2c')]};});_0x46c0e8[_0x91db('0x2d')]=_[_0x91db('0x27')](_0x512c79,_0x91db('0x2e'));_0x46c0e8[_0x91db('0x2f')]=_[_0x91db('0x30')](_0x55e61e[_0x91db('0x2f')]);_0x46c0e8[_0x91db('0x31')]=_[_0x91db('0x32')](_0x46c0e8[_0x91db('0x2d')],_0x46c0e8[_0x91db('0x2f')]);_0x3c31ea[_0x91db('0x33')]=_['intersection'](_0x46c0e8[_0x91db('0x2d')],qs[_0x91db('0x34')](_0x55e61e[_0x91db('0x2f')][_0x91db('0x34')]));_0x3c31ea[_0x91db('0x33')]=_0x3c31ea['attributes'][_0x91db('0x35')]?_0x3c31ea[_0x91db('0x33')]:_0x46c0e8[_0x91db('0x2d')];if(!_0x55e61e['query'][_0x91db('0x36')]('nolimit')){_0x3c31ea[_0x91db('0x1b')]=qs[_0x91db('0x1b')](_0x55e61e[_0x91db('0x2f')][_0x91db('0x1b')]);_0x3c31ea['offset']=qs[_0x91db('0x1a')](_0x55e61e[_0x91db('0x2f')][_0x91db('0x1a')]);}_0x3c31ea['order']=qs[_0x91db('0x37')](_0x55e61e[_0x91db('0x2f')]['sort']);_0x3c31ea[_0x91db('0x38')]=qs[_0x91db('0x31')](_['pick'](_0x55e61e[_0x91db('0x2f')],_0x46c0e8['filters']));if(_0x55e61e[_0x91db('0x2f')][_0x91db('0x39')]){_0x3c31ea['where']=_['merge'](_0x3c31ea['where'],{'$or':_[_0x91db('0x27')](_0x512c79,function(_0x1cc013){if(_0x1cc013['type'][_0x91db('0x2c')]!==_0x91db('0x3a')){var _0x1a0703={};_0x1a0703[_0x1cc013[_0x91db('0x3b')]]={'$like':'%'+_0x55e61e[_0x91db('0x2f')][_0x91db('0x39')]+'%'};return _0x1a0703;}})});}_0x3c31ea=_[_0x91db('0x3c')]({},_0x3c31ea,_0x55e61e[_0x91db('0x3d')]);var _0xcdc472={'where':_0x3c31ea[_0x91db('0x38')]};return db[_0x91db('0x28')]['count'](_0xcdc472)[_0x91db('0x21')](function(_0x50c414){_0x1bb4f8[_0x91db('0x19')]=_0x50c414;if(_0x55e61e[_0x91db('0x2f')]['includeAll']){_0x3c31ea[_0x91db('0x3e')]=[{'all':!![]}];}return db[_0x91db('0x28')][_0x91db('0x3f')](_0x3c31ea);})[_0x91db('0x21')](function(_0x18cab8){_0x1bb4f8['rows']=_0x18cab8;return _0x1bb4f8;})[_0x91db('0x21')](respondWithFilteredResult(_0x3b38f2,_0x3c31ea))[_0x91db('0x40')](handleError(_0x3b38f2,null));};exports[_0x91db('0x41')]=function(_0x55188b,_0x4733a4){var _0xed543c={'raw':![],'where':{'id':_0x55188b['params']['id']}},_0x3aaf2e={};_0x3aaf2e[_0x91db('0x2d')]=_[_0x91db('0x30')](db[_0x91db('0x28')][_0x91db('0x29')]);_0x3aaf2e[_0x91db('0x2f')]=_['keys'](_0x55188b[_0x91db('0x2f')]);_0x3aaf2e['filters']=_[_0x91db('0x32')](_0x3aaf2e[_0x91db('0x2d')],_0x3aaf2e[_0x91db('0x2f')]);_0xed543c[_0x91db('0x33')]=_[_0x91db('0x32')](_0x3aaf2e[_0x91db('0x2d')],qs[_0x91db('0x34')](_0x55188b[_0x91db('0x2f')][_0x91db('0x34')]));_0xed543c[_0x91db('0x33')]=_0xed543c[_0x91db('0x33')]['length']?_0xed543c['attributes']:_0x3aaf2e[_0x91db('0x2d')];if(_0x55188b[_0x91db('0x2f')][_0x91db('0x42')]){_0xed543c['include']=[{'all':!![]}];}_0xed543c=_[_0x91db('0x3c')]({},_0xed543c,_0x55188b[_0x91db('0x3d')]);return db[_0x91db('0x28')][_0x91db('0x43')](_0xed543c)[_0x91db('0x21')](handleEntityNotFound(_0x4733a4,null))['then'](respondWithResult(_0x4733a4,null))[_0x91db('0x40')](handleError(_0x4733a4,null));};exports['create']=function(_0x7c4981,_0x28211b){return db[_0x91db('0x28')][_0x91db('0x44')](_0x7c4981[_0x91db('0x45')],{})[_0x91db('0x21')](respondWithResult(_0x28211b,0xc9))[_0x91db('0x40')](handleError(_0x28211b,null));};exports[_0x91db('0x20')]=function(_0x1a0009,_0x4fb60e){if(_0x1a0009['body']['id']){delete _0x1a0009[_0x91db('0x45')]['id'];}return db[_0x91db('0x28')][_0x91db('0x43')]({'where':{'id':_0x1a0009[_0x91db('0x46')]['id']}})[_0x91db('0x21')](handleEntityNotFound(_0x4fb60e,null))['then'](saveUpdates(_0x1a0009[_0x91db('0x45')],null))[_0x91db('0x21')](respondWithResult(_0x4fb60e,null))[_0x91db('0x40')](handleError(_0x4fb60e,null));};exports[_0x91db('0x22')]=function(_0x404900,_0x51a75b){return db[_0x91db('0x28')][_0x91db('0x43')]({'where':{'id':_0x404900[_0x91db('0x46')]['id']}})[_0x91db('0x21')](handleEntityNotFound(_0x51a75b,null))[_0x91db('0x21')](removeEntity(_0x51a75b,null))[_0x91db('0x40')](handleError(_0x51a75b,null));};exports['describe']=function(_0x561e4a,_0x132fb5){return db['UserProfileResource'][_0x91db('0x47')]()['then'](respondWithResult(_0x132fb5,null))['catch'](handleError(_0x132fb5,null));}; \ No newline at end of file +var _0x0f4d=['filter','VIRTUAL','field','merge','includeAll','findAll','show','params','keys','include','options','find','catch','create','body','describe','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','status','end','count','offset','limit','set','json','apply','reject','save','update','then','destroy','sendStatus','error','name','send','index','map','UserProfileResource','rawAttributes','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','order','where','filters'];(function(_0x3a3065,_0xd57b00){var _0x241350=function(_0x289cd0){while(--_0x289cd0){_0x3a3065['push'](_0x3a3065['shift']());}};_0x241350(++_0xd57b00);}(_0x0f4d,0x12c));var _0xd0f4=function(_0x445e82,_0x237b6e){_0x445e82=_0x445e82-0x0;var _0x2e7966=_0x0f4d[_0x445e82];return _0x2e7966;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd0f4('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd0f4('0x1'));var moment=require(_0xd0f4('0x2'));var BPromise=require(_0xd0f4('0x3'));var Mustache=require(_0xd0f4('0x4'));var util=require(_0xd0f4('0x5'));var path=require(_0xd0f4('0x6'));var sox=require(_0xd0f4('0x7'));var csv=require(_0xd0f4('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xd0f4('0x9'));var squel=require(_0xd0f4('0xa'));var crypto=require('crypto');var jsforce=require(_0xd0f4('0xb'));var deskjs=require(_0xd0f4('0xc'));var toCsv=require('to-csv');var querystring=require(_0xd0f4('0xd'));var Papa=require(_0xd0f4('0xe'));var Redis=require('ioredis');var authService=require(_0xd0f4('0xf'));var qs=require(_0xd0f4('0x10'));var as=require(_0xd0f4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd0f4('0x12'));var utils=require(_0xd0f4('0x13'));var config=require(_0xd0f4('0x14'));var db=require(_0xd0f4('0x15'))['db'];function respondWithStatusCode(_0x1a1c7e,_0x64232c){_0x64232c=_0x64232c||0xcc;return function(_0x134492){if(_0x134492){return _0x1a1c7e['sendStatus'](_0x64232c);}return _0x1a1c7e[_0xd0f4('0x16')](_0x64232c)[_0xd0f4('0x17')]();};}function respondWithResult(_0x51656c,_0x104d48){_0x104d48=_0x104d48||0xc8;return function(_0x536d71){if(_0x536d71){return _0x51656c[_0xd0f4('0x16')](_0x104d48)['json'](_0x536d71);}};}function respondWithFilteredResult(_0x401779,_0x4d5aef){return function(_0x4afe4d){if(_0x4afe4d){var _0x54b806=_0x4afe4d[_0xd0f4('0x18')],_0x45b32e=_0x4d5aef[_0xd0f4('0x19')],_0x320d37=_0x4d5aef[_0xd0f4('0x19')]+_0x4d5aef[_0xd0f4('0x1a')],_0xe37a0d;if(_0x320d37>=_0x54b806){_0x320d37=_0x54b806;_0xe37a0d=0xc8;}else{_0xe37a0d=0xce;}_0x401779[_0xd0f4('0x16')](_0xe37a0d);return _0x401779[_0xd0f4('0x1b')]('Content-Range',_0x45b32e+'-'+_0x320d37+'/'+_0x54b806)[_0xd0f4('0x1c')](_0x4afe4d);}return null;};}function patchUpdates(_0x1e4fb3){return function(_0x32605d){try{jsonpatch[_0xd0f4('0x1d')](_0x32605d,_0x1e4fb3,!![]);}catch(_0x5cb3cb){return BPromise[_0xd0f4('0x1e')](_0x5cb3cb);}return _0x32605d[_0xd0f4('0x1f')]();};}function saveUpdates(_0x171ccc,_0x208a6f){return function(_0x4e1689){if(_0x4e1689){return _0x4e1689[_0xd0f4('0x20')](_0x171ccc)[_0xd0f4('0x21')](function(_0x3dfca3){return _0x3dfca3;});}return null;};}function removeEntity(_0x1e799f,_0x14ba70){return function(_0x2a1df0){if(_0x2a1df0){return _0x2a1df0[_0xd0f4('0x22')]()['then'](function(){_0x1e799f[_0xd0f4('0x16')](0xcc)[_0xd0f4('0x17')]();});}};}function handleEntityNotFound(_0x20e0c8,_0x299904){return function(_0x4d49c0){if(!_0x4d49c0){_0x20e0c8[_0xd0f4('0x23')](0x194);}return _0x4d49c0;};}function handleError(_0x524d73,_0x32585c){_0x32585c=_0x32585c||0x1f4;return function(_0xbdfcf1){logger[_0xd0f4('0x24')](_0xbdfcf1['stack']);if(_0xbdfcf1[_0xd0f4('0x25')]){delete _0xbdfcf1[_0xd0f4('0x25')];}_0x524d73[_0xd0f4('0x16')](_0x32585c)[_0xd0f4('0x26')](_0xbdfcf1);};}exports[_0xd0f4('0x27')]=function(_0x5da31e,_0x3860e8){var _0x269fdd={},_0x1b36c2={},_0x128628={'count':0x0,'rows':[]};var _0x31c48c=_[_0xd0f4('0x28')](db[_0xd0f4('0x29')][_0xd0f4('0x2a')],function(_0x3cb97c){return{'name':_0x3cb97c['fieldName'],'type':_0x3cb97c[_0xd0f4('0x2b')][_0xd0f4('0x2c')]};});_0x1b36c2[_0xd0f4('0x2d')]=_[_0xd0f4('0x28')](_0x31c48c,'name');_0x1b36c2[_0xd0f4('0x2e')]=_['keys'](_0x5da31e['query']);_0x1b36c2['filters']=_[_0xd0f4('0x2f')](_0x1b36c2[_0xd0f4('0x2d')],_0x1b36c2[_0xd0f4('0x2e')]);_0x269fdd[_0xd0f4('0x30')]=_[_0xd0f4('0x2f')](_0x1b36c2[_0xd0f4('0x2d')],qs[_0xd0f4('0x31')](_0x5da31e[_0xd0f4('0x2e')]['fields']));_0x269fdd[_0xd0f4('0x30')]=_0x269fdd['attributes'][_0xd0f4('0x32')]?_0x269fdd[_0xd0f4('0x30')]:_0x1b36c2['model'];if(!_0x5da31e['query'][_0xd0f4('0x33')]('nolimit')){_0x269fdd[_0xd0f4('0x1a')]=qs[_0xd0f4('0x1a')](_0x5da31e['query'][_0xd0f4('0x1a')]);_0x269fdd[_0xd0f4('0x19')]=qs['offset'](_0x5da31e['query'][_0xd0f4('0x19')]);}_0x269fdd[_0xd0f4('0x34')]=qs['sort'](_0x5da31e[_0xd0f4('0x2e')]['sort']);_0x269fdd[_0xd0f4('0x35')]=qs[_0xd0f4('0x36')](_['pick'](_0x5da31e[_0xd0f4('0x2e')],_0x1b36c2[_0xd0f4('0x36')]));if(_0x5da31e[_0xd0f4('0x2e')][_0xd0f4('0x37')]){_0x269fdd[_0xd0f4('0x35')]=_['merge'](_0x269fdd[_0xd0f4('0x35')],{'$or':_[_0xd0f4('0x28')](_0x31c48c,function(_0x249487){if(_0x249487[_0xd0f4('0x2b')]['key']!==_0xd0f4('0x38')){var _0x15f76b={};_0x15f76b[_0x249487[_0xd0f4('0x39')]]={'$like':'%'+_0x5da31e[_0xd0f4('0x2e')][_0xd0f4('0x37')]+'%'};return _0x15f76b;}})});}_0x269fdd=_[_0xd0f4('0x3a')]({},_0x269fdd,_0x5da31e['options']);var _0x269629={'where':_0x269fdd[_0xd0f4('0x35')]};return db[_0xd0f4('0x29')]['count'](_0x269629)[_0xd0f4('0x21')](function(_0x10f4e5){_0x128628['count']=_0x10f4e5;if(_0x5da31e[_0xd0f4('0x2e')][_0xd0f4('0x3b')]){_0x269fdd['include']=[{'all':!![]}];}return db['UserProfileResource'][_0xd0f4('0x3c')](_0x269fdd);})[_0xd0f4('0x21')](function(_0x1c68f7){_0x128628['rows']=_0x1c68f7;return _0x128628;})[_0xd0f4('0x21')](respondWithFilteredResult(_0x3860e8,_0x269fdd))['catch'](handleError(_0x3860e8,null));};exports[_0xd0f4('0x3d')]=function(_0x493c5f,_0x29439d){var _0x3f411e={'raw':![],'where':{'id':_0x493c5f[_0xd0f4('0x3e')]['id']}},_0x4492d1={};_0x4492d1['model']=_[_0xd0f4('0x3f')](db[_0xd0f4('0x29')][_0xd0f4('0x2a')]);_0x4492d1['query']=_['keys'](_0x493c5f[_0xd0f4('0x2e')]);_0x4492d1[_0xd0f4('0x36')]=_[_0xd0f4('0x2f')](_0x4492d1[_0xd0f4('0x2d')],_0x4492d1[_0xd0f4('0x2e')]);_0x3f411e[_0xd0f4('0x30')]=_[_0xd0f4('0x2f')](_0x4492d1[_0xd0f4('0x2d')],qs[_0xd0f4('0x31')](_0x493c5f[_0xd0f4('0x2e')][_0xd0f4('0x31')]));_0x3f411e[_0xd0f4('0x30')]=_0x3f411e['attributes'][_0xd0f4('0x32')]?_0x3f411e[_0xd0f4('0x30')]:_0x4492d1['model'];if(_0x493c5f[_0xd0f4('0x2e')][_0xd0f4('0x3b')]){_0x3f411e[_0xd0f4('0x40')]=[{'all':!![]}];}_0x3f411e=_[_0xd0f4('0x3a')]({},_0x3f411e,_0x493c5f[_0xd0f4('0x41')]);return db[_0xd0f4('0x29')][_0xd0f4('0x42')](_0x3f411e)['then'](handleEntityNotFound(_0x29439d,null))[_0xd0f4('0x21')](respondWithResult(_0x29439d,null))[_0xd0f4('0x43')](handleError(_0x29439d,null));};exports[_0xd0f4('0x44')]=function(_0x4835de,_0x2de162){return db[_0xd0f4('0x29')][_0xd0f4('0x44')](_0x4835de[_0xd0f4('0x45')],{})[_0xd0f4('0x21')](respondWithResult(_0x2de162,0xc9))[_0xd0f4('0x43')](handleError(_0x2de162,null));};exports['update']=function(_0x5c21f1,_0xce99b1){if(_0x5c21f1[_0xd0f4('0x45')]['id']){delete _0x5c21f1[_0xd0f4('0x45')]['id'];}return db[_0xd0f4('0x29')]['find']({'where':{'id':_0x5c21f1[_0xd0f4('0x3e')]['id']}})[_0xd0f4('0x21')](handleEntityNotFound(_0xce99b1,null))['then'](saveUpdates(_0x5c21f1[_0xd0f4('0x45')],null))[_0xd0f4('0x21')](respondWithResult(_0xce99b1,null))[_0xd0f4('0x43')](handleError(_0xce99b1,null));};exports[_0xd0f4('0x22')]=function(_0x431977,_0x41783e){return db[_0xd0f4('0x29')][_0xd0f4('0x42')]({'where':{'id':_0x431977[_0xd0f4('0x3e')]['id']}})[_0xd0f4('0x21')](handleEntityNotFound(_0x41783e,null))[_0xd0f4('0x21')](removeEntity(_0x41783e,null))[_0xd0f4('0x43')](handleError(_0x41783e,null));};exports[_0xd0f4('0x46')]=function(_0x4d8ede,_0x15e648){return db[_0xd0f4('0x29')][_0xd0f4('0x46')]()['then'](respondWithResult(_0x15e648,null))[_0xd0f4('0x43')](handleError(_0x15e648,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 5a0d1c7..8747fe0 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 _0x1464=['compositeIndex','sectionId','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./userProfileResource.attributes','UserProfileResource'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1464,0x116));var _0x4146=function(_0x3a9661,_0x530b12){_0x3a9661=_0x3a9661-0x0;var _0x5bb119=_0x1464[_0x3a9661];return _0x5bb119;};'use strict';var _=require('lodash');var util=require(_0x4146('0x0'));var logger=require(_0x4146('0x1'))(_0x4146('0x2'));var moment=require(_0x4146('0x3'));var BPromise=require(_0x4146('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4146('0x5'));var rimraf=require(_0x4146('0x6'));var config=require(_0x4146('0x7'));var attributes=require(_0x4146('0x8'));module['exports']=function(_0x1d30a9,_0x3d6066){return _0x1d30a9['define'](_0x4146('0x9'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0x4146('0xa'),'fields':['resourceId',_0x4146('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4469=['./userProfileResource.attributes','exports','UserProfileResource','user_profile_has_resources','compositeIndex','resourceId','sectionId','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x437881,_0x2801ca){var _0x2cb2b1=function(_0x4640ea){while(--_0x4640ea){_0x437881['push'](_0x437881['shift']());}};_0x2cb2b1(++_0x2801ca);}(_0x4469,0xa1));var _0x9446=function(_0x15705a,_0x22be8e){_0x15705a=_0x15705a-0x0;var _0x6a71ad=_0x4469[_0x15705a];return _0x6a71ad;};'use strict';var _=require('lodash');var util=require(_0x9446('0x0'));var logger=require('../../config/logger')(_0x9446('0x1'));var moment=require(_0x9446('0x2'));var BPromise=require(_0x9446('0x3'));var rp=require(_0x9446('0x4'));var fs=require('fs');var path=require(_0x9446('0x5'));var rimraf=require(_0x9446('0x6'));var config=require('../../config/environment');var attributes=require(_0x9446('0x7'));module[_0x9446('0x8')]=function(_0x5dc340,_0x268363){return _0x5dc340['define'](_0x9446('0x9'),attributes,{'tableName':_0x9446('0xa'),'paranoid':![],'indexes':[{'name':_0x9446('0xb'),'fields':[_0x9446('0xc'),_0x9446('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index f2eba46..2613cfb 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 _0x1eaa=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','lodash','util','bluebird','ioredis'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x1eaa,0x80));var _0xa1ea=function(_0x171fa3,_0x2e03c7){_0x171fa3=_0x171fa3-0x0;var _0x2a5366=_0x1eaa[_0x171fa3];return _0x2a5366;};'use strict';var _=require(_0xa1ea('0x0'));var util=require(_0xa1ea('0x1'));var moment=require('moment');var BPromise=require(_0xa1ea('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa1ea('0x3'));var db=require(_0xa1ea('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa1ea('0x5'))(_0xa1ea('0x6'));var config=require(_0xa1ea('0x7'));var jayson=require(_0xa1ea('0x8'));var client=jayson[_0xa1ea('0x9')][_0xa1ea('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x447710,_0x375d0a,_0x2c7b62){return new BPromise(function(_0x40f38c,_0x1bb4a8){return client['request'](_0x447710,_0x2c7b62)[_0xa1ea('0xb')](function(_0x5dfde9){logger[_0xa1ea('0xc')](_0xa1ea('0xd'),_0x375d0a,_0xa1ea('0xe'));logger[_0xa1ea('0xf')](_0xa1ea('0x10'),_0x375d0a,_0xa1ea('0xe'),JSON[_0xa1ea('0x11')](_0x5dfde9));if(_0x5dfde9['error']){if(_0x5dfde9['error'][_0xa1ea('0x12')]===0x1f4){logger[_0xa1ea('0x13')](_0xa1ea('0xd'),_0x375d0a,_0x5dfde9[_0xa1ea('0x13')][_0xa1ea('0x14')]);return _0x1bb4a8(_0x5dfde9[_0xa1ea('0x13')][_0xa1ea('0x14')]);}logger['error']('UserProfileResource,\x20%s,\x20%s',_0x375d0a,_0x5dfde9['error']['message']);return _0x40f38c(_0x5dfde9['error']['message']);}else{logger[_0xa1ea('0xc')](_0xa1ea('0xd'),_0x375d0a,_0xa1ea('0xe'));_0x40f38c(_0x5dfde9[_0xa1ea('0x15')][_0xa1ea('0x14')]);}})['catch'](function(_0x576e14){logger['error']('UserProfileResource,\x20%s,\x20%s',_0x375d0a,_0x576e14);_0x1bb4a8(_0x576e14);});});} \ No newline at end of file +var _0xe375=['then','info','request\x20sent','debug','stringify','error','code','UserProfileResource,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request'];(function(_0x467349,_0x523842){var _0x4588a9=function(_0x323bee){while(--_0x323bee){_0x467349['push'](_0x467349['shift']());}};_0x4588a9(++_0x523842);}(_0xe375,0x143));var _0x5e37=function(_0xc8cede,_0x236357){_0xc8cede=_0xc8cede-0x0;var _0xb64826=_0xe375[_0xc8cede];return _0xb64826;};'use strict';var _=require(_0x5e37('0x0'));var util=require(_0x5e37('0x1'));var moment=require(_0x5e37('0x2'));var BPromise=require(_0x5e37('0x3'));var rs=require(_0x5e37('0x4'));var fs=require('fs');var Redis=require(_0x5e37('0x5'));var db=require(_0x5e37('0x6'))['db'];var utils=require(_0x5e37('0x7'));var logger=require(_0x5e37('0x8'))(_0x5e37('0x9'));var config=require('../../config/environment');var jayson=require(_0x5e37('0xa'));var client=jayson[_0x5e37('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3e6571,_0x9f6dc1,_0x573479){return new BPromise(function(_0x5497ac,_0x10b102){return client[_0x5e37('0xc')](_0x3e6571,_0x573479)[_0x5e37('0xd')](function(_0x4a588f){logger[_0x5e37('0xe')]('UserProfileResource,\x20%s,\x20%s',_0x9f6dc1,_0x5e37('0xf'));logger[_0x5e37('0x10')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x9f6dc1,'request\x20sent',JSON[_0x5e37('0x11')](_0x4a588f));if(_0x4a588f[_0x5e37('0x12')]){if(_0x4a588f[_0x5e37('0x12')][_0x5e37('0x13')]===0x1f4){logger[_0x5e37('0x12')](_0x5e37('0x14'),_0x9f6dc1,_0x4a588f['error'][_0x5e37('0x15')]);return _0x10b102(_0x4a588f['error']['message']);}logger['error'](_0x5e37('0x14'),_0x9f6dc1,_0x4a588f[_0x5e37('0x12')][_0x5e37('0x15')]);return _0x5497ac(_0x4a588f[_0x5e37('0x12')][_0x5e37('0x15')]);}else{logger[_0x5e37('0xe')]('UserProfileResource,\x20%s,\x20%s',_0x9f6dc1,_0x5e37('0xf'));_0x5497ac(_0x4a588f[_0x5e37('0x16')][_0x5e37('0x15')]);}})[_0x5e37('0x17')](function(_0x25bb48){logger[_0x5e37('0x12')](_0x5e37('0x14'),_0x9f6dc1,_0x25bb48);_0x10b102(_0x25bb48);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 9642c72..e430427 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 _0xcf33=['util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./userProfileSection.controller','isAuthenticated','index','/describe','get','show','post','put','delete','/:id','destroy','multer'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xcf33,0x10d));var _0x3cf3=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0xcf33[_0x4b2863];return _0x567d67;};'use strict';var multer=require(_0x3cf3('0x0'));var util=require(_0x3cf3('0x1'));var path=require(_0x3cf3('0x2'));var timeout=require(_0x3cf3('0x3'));var express=require('express');var router=express[_0x3cf3('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x3cf3('0x5'));var config=require(_0x3cf3('0x6'));var controller=require(_0x3cf3('0x7'));router['get']('/',auth[_0x3cf3('0x8')](),controller[_0x3cf3('0x9')]);router['get'](_0x3cf3('0xa'),auth[_0x3cf3('0x8')](),controller['describe']);router[_0x3cf3('0xb')]('/:id',auth[_0x3cf3('0x8')](),controller[_0x3cf3('0xc')]);router[_0x3cf3('0xd')]('/',auth[_0x3cf3('0x8')](),controller['create']);router[_0x3cf3('0xe')]('/:id',auth[_0x3cf3('0x8')](),controller['update']);router[_0x3cf3('0xf')](_0x3cf3('0x10'),auth[_0x3cf3('0x8')](),controller[_0x3cf3('0x11')]);module['exports']=router; \ No newline at end of file +var _0x676e=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./userProfileSection.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','destroy','exports','multer','util','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x676e,0x9d));var _0xe676=function(_0x28c7a7,_0x55a356){_0x28c7a7=_0x28c7a7-0x0;var _0x50610f=_0x676e[_0x28c7a7];return _0x50610f;};'use strict';var multer=require(_0xe676('0x0'));var util=require(_0xe676('0x1'));var path=require(_0xe676('0x2'));var timeout=require(_0xe676('0x3'));var express=require(_0xe676('0x4'));var router=express[_0xe676('0x5')]();var auth=require(_0xe676('0x6'));var interaction=require(_0xe676('0x7'));var config=require('../../config/environment');var controller=require(_0xe676('0x8'));router[_0xe676('0x9')]('/',auth['isAuthenticated'](),controller[_0xe676('0xa')]);router[_0xe676('0x9')](_0xe676('0xb'),auth[_0xe676('0xc')](),controller[_0xe676('0xd')]);router[_0xe676('0x9')](_0xe676('0xe'),auth[_0xe676('0xc')](),controller[_0xe676('0xf')]);router[_0xe676('0x10')]('/',auth[_0xe676('0xc')](),controller[_0xe676('0x11')]);router['put']('/:id',auth[_0xe676('0xc')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xe676('0x12')]);module[_0xe676('0x13')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 05cfca9..1074c1c 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 _0x2e3b=['split','exports','STRING','INTEGER','BOOLEAN','crudPermissions','join','getDataValue'];(function(_0x2875f5,_0x197423){var _0xe3c66=function(_0xebedb){while(--_0xebedb){_0x2875f5['push'](_0x2875f5['shift']());}};_0xe3c66(++_0x197423);}(_0x2e3b,0x81));var _0xb2e3=function(_0x2fa1a8,_0x4e2ff8){_0x2fa1a8=_0x2fa1a8-0x0;var _0x397c21=_0x2e3b[_0x2fa1a8];return _0x397c21;};'use strict';var Sequelize=require('sequelize');module[_0xb2e3('0x0')]={'name':{'type':Sequelize[_0xb2e3('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0xb2e3('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0xb2e3('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0xb2e3('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xb2e3('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xb2e3('0x1')],'set':function(_0xcb4d04){this['setDataValue'](_0xb2e3('0x4'),_0xcb4d04?_0xcb4d04[_0xb2e3('0x5')](''):[]);},'get':function(){return this['getDataValue'](_0xb2e3('0x4'))?this[_0xb2e3('0x6')]('crudPermissions')[_0xb2e3('0x7')](''):[];}}}; \ No newline at end of file +var _0xe908=['setDataValue','crudPermissions','join','getDataValue','split','exports','STRING','INTEGER','BOOLEAN'];(function(_0xc5c0b1,_0x148d49){var _0x5e5082=function(_0x420a44){while(--_0x420a44){_0xc5c0b1['push'](_0xc5c0b1['shift']());}};_0x5e5082(++_0x148d49);}(_0xe908,0x1be));var _0x8e90=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0xe908[_0x5d2803];return _0xdcad2c;};'use strict';var Sequelize=require('sequelize');module[_0x8e90('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0x8e90('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x8e90('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0x8e90('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x8e90('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x8e90('0x1')],'set':function(_0x387bac){this[_0x8e90('0x4')](_0x8e90('0x5'),_0x387bac?_0x387bac[_0x8e90('0x6')](''):[]);},'get':function(){return this['getDataValue']('crudPermissions')?this[_0x8e90('0x7')]('crudPermissions')[_0x8e90('0x8')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 5122a08..c75b331 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 _0xd9cd=['../../config/utils','../../mysqldb','status','json','offset','set','Content-Range','apply','reject','update','then','end','sendStatus','error','stack','name','send','index','map','UserProfileSection','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filters','filter','VIRTUAL','field','options','count','includeAll','findAll','rows','catch','params','keys','include','merge','find','create','body','destroy','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api'];(function(_0x3a20b7,_0x4be49f){var _0x3ae720=function(_0x565d9c){while(--_0x565d9c){_0x3a20b7['push'](_0x3a20b7['shift']());}};_0x3ae720(++_0x4be49f);}(_0xd9cd,0x11b));var _0xdd9c=function(_0x6a10fa,_0x1712fe){_0x6a10fa=_0x6a10fa-0x0;var _0x3b703a=_0xd9cd[_0x6a10fa];return _0x3b703a;};'use strict';var pdf=require(_0xdd9c('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xdd9c('0x1'));var zipdir=require(_0xdd9c('0x2'));var jsonpatch=require(_0xdd9c('0x3'));var rp=require(_0xdd9c('0x4'));var moment=require(_0xdd9c('0x5'));var BPromise=require(_0xdd9c('0x6'));var Mustache=require(_0xdd9c('0x7'));var util=require(_0xdd9c('0x8'));var path=require(_0xdd9c('0x9'));var sox=require(_0xdd9c('0xa'));var csv=require(_0xdd9c('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xdd9c('0xc'));var squel=require(_0xdd9c('0xd'));var crypto=require(_0xdd9c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xdd9c('0xf'));var toCsv=require(_0xdd9c('0xb'));var querystring=require('querystring');var Papa=require(_0xdd9c('0x10'));var Redis=require(_0xdd9c('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xdd9c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdd9c('0x13'))(_0xdd9c('0x14'));var utils=require(_0xdd9c('0x15'));var config=require('../../config/environment');var db=require(_0xdd9c('0x16'))['db'];function respondWithStatusCode(_0x40ae19,_0x564299){_0x564299=_0x564299||0xcc;return function(_0x184441){if(_0x184441){return _0x40ae19['sendStatus'](_0x564299);}return _0x40ae19[_0xdd9c('0x17')](_0x564299)['end']();};}function respondWithResult(_0xcc68ec,_0x42fc5a){_0x42fc5a=_0x42fc5a||0xc8;return function(_0x1d1027){if(_0x1d1027){return _0xcc68ec[_0xdd9c('0x17')](_0x42fc5a)[_0xdd9c('0x18')](_0x1d1027);}};}function respondWithFilteredResult(_0x5349e4,_0x520e6b){return function(_0x5d13c2){if(_0x5d13c2){var _0x1e5c22=_0x5d13c2['count'],_0xdc9103=_0x520e6b[_0xdd9c('0x19')],_0x5923c5=_0x520e6b[_0xdd9c('0x19')]+_0x520e6b['limit'],_0x25c4be;if(_0x5923c5>=_0x1e5c22){_0x5923c5=_0x1e5c22;_0x25c4be=0xc8;}else{_0x25c4be=0xce;}_0x5349e4[_0xdd9c('0x17')](_0x25c4be);return _0x5349e4[_0xdd9c('0x1a')](_0xdd9c('0x1b'),_0xdc9103+'-'+_0x5923c5+'/'+_0x1e5c22)[_0xdd9c('0x18')](_0x5d13c2);}return null;};}function patchUpdates(_0x4fdc74){return function(_0x4e6458){try{jsonpatch[_0xdd9c('0x1c')](_0x4e6458,_0x4fdc74,!![]);}catch(_0x422b54){return BPromise[_0xdd9c('0x1d')](_0x422b54);}return _0x4e6458['save']();};}function saveUpdates(_0x3df0f7,_0x2cb93d){return function(_0x240dbe){if(_0x240dbe){return _0x240dbe[_0xdd9c('0x1e')](_0x3df0f7)['then'](function(_0xac0e31){return _0xac0e31;});}return null;};}function removeEntity(_0x5a3d73,_0x16e7e2){return function(_0x3479b4){if(_0x3479b4){return _0x3479b4['destroy']()[_0xdd9c('0x1f')](function(){_0x5a3d73[_0xdd9c('0x17')](0xcc)[_0xdd9c('0x20')]();});}};}function handleEntityNotFound(_0x335813,_0x5d7a73){return function(_0x4b45f8){if(!_0x4b45f8){_0x335813[_0xdd9c('0x21')](0x194);}return _0x4b45f8;};}function handleError(_0x2c1a5a,_0x97dace){_0x97dace=_0x97dace||0x1f4;return function(_0x5085de){logger[_0xdd9c('0x22')](_0x5085de[_0xdd9c('0x23')]);if(_0x5085de['name']){delete _0x5085de[_0xdd9c('0x24')];}_0x2c1a5a[_0xdd9c('0x17')](_0x97dace)[_0xdd9c('0x25')](_0x5085de);};}exports[_0xdd9c('0x26')]=function(_0x5a4c84,_0xde2529){var _0x509344={},_0x3a6ada={},_0x103eda={'count':0x0,'rows':[]};var _0x5799e9=_[_0xdd9c('0x27')](db[_0xdd9c('0x28')][_0xdd9c('0x29')],function(_0x1ed112){return{'name':_0x1ed112[_0xdd9c('0x2a')],'type':_0x1ed112[_0xdd9c('0x2b')][_0xdd9c('0x2c')]};});_0x3a6ada[_0xdd9c('0x2d')]=_[_0xdd9c('0x27')](_0x5799e9,_0xdd9c('0x24'));_0x3a6ada['query']=_['keys'](_0x5a4c84[_0xdd9c('0x2e')]);_0x3a6ada['filters']=_[_0xdd9c('0x2f')](_0x3a6ada[_0xdd9c('0x2d')],_0x3a6ada[_0xdd9c('0x2e')]);_0x509344[_0xdd9c('0x30')]=_[_0xdd9c('0x2f')](_0x3a6ada[_0xdd9c('0x2d')],qs[_0xdd9c('0x31')](_0x5a4c84[_0xdd9c('0x2e')][_0xdd9c('0x31')]));_0x509344[_0xdd9c('0x30')]=_0x509344[_0xdd9c('0x30')][_0xdd9c('0x32')]?_0x509344[_0xdd9c('0x30')]:_0x3a6ada[_0xdd9c('0x2d')];if(!_0x5a4c84[_0xdd9c('0x2e')]['hasOwnProperty'](_0xdd9c('0x33'))){_0x509344['limit']=qs[_0xdd9c('0x34')](_0x5a4c84[_0xdd9c('0x2e')][_0xdd9c('0x34')]);_0x509344[_0xdd9c('0x19')]=qs[_0xdd9c('0x19')](_0x5a4c84[_0xdd9c('0x2e')][_0xdd9c('0x19')]);}_0x509344[_0xdd9c('0x35')]=qs[_0xdd9c('0x36')](_0x5a4c84[_0xdd9c('0x2e')][_0xdd9c('0x36')]);_0x509344[_0xdd9c('0x37')]=qs['filters'](_[_0xdd9c('0x38')](_0x5a4c84[_0xdd9c('0x2e')],_0x3a6ada[_0xdd9c('0x39')]));if(_0x5a4c84[_0xdd9c('0x2e')][_0xdd9c('0x3a')]){_0x509344['where']=_['merge'](_0x509344['where'],{'$or':_[_0xdd9c('0x27')](_0x5799e9,function(_0x49a5a2){if(_0x49a5a2['type']['key']!==_0xdd9c('0x3b')){var _0x2f686c={};_0x2f686c[_0x49a5a2[_0xdd9c('0x3c')]]={'$like':'%'+_0x5a4c84[_0xdd9c('0x2e')]['filter']+'%'};return _0x2f686c;}})});}_0x509344=_['merge']({},_0x509344,_0x5a4c84[_0xdd9c('0x3d')]);var _0x5d9b59={'where':_0x509344['where']};return db[_0xdd9c('0x28')][_0xdd9c('0x3e')](_0x5d9b59)[_0xdd9c('0x1f')](function(_0x341ee1){_0x103eda[_0xdd9c('0x3e')]=_0x341ee1;if(_0x5a4c84[_0xdd9c('0x2e')][_0xdd9c('0x3f')]){_0x509344['include']=[{'all':!![]}];}return db[_0xdd9c('0x28')][_0xdd9c('0x40')](_0x509344);})[_0xdd9c('0x1f')](function(_0x211353){_0x103eda[_0xdd9c('0x41')]=_0x211353;return _0x103eda;})[_0xdd9c('0x1f')](respondWithFilteredResult(_0xde2529,_0x509344))[_0xdd9c('0x42')](handleError(_0xde2529,null));};exports['show']=function(_0x3a4e85,_0x5a9f66){var _0x532394={'raw':![],'where':{'id':_0x3a4e85[_0xdd9c('0x43')]['id']}},_0xb88071={};_0xb88071[_0xdd9c('0x2d')]=_[_0xdd9c('0x44')](db[_0xdd9c('0x28')][_0xdd9c('0x29')]);_0xb88071[_0xdd9c('0x2e')]=_[_0xdd9c('0x44')](_0x3a4e85[_0xdd9c('0x2e')]);_0xb88071['filters']=_[_0xdd9c('0x2f')](_0xb88071[_0xdd9c('0x2d')],_0xb88071[_0xdd9c('0x2e')]);_0x532394['attributes']=_['intersection'](_0xb88071[_0xdd9c('0x2d')],qs[_0xdd9c('0x31')](_0x3a4e85[_0xdd9c('0x2e')]['fields']));_0x532394[_0xdd9c('0x30')]=_0x532394[_0xdd9c('0x30')][_0xdd9c('0x32')]?_0x532394[_0xdd9c('0x30')]:_0xb88071[_0xdd9c('0x2d')];if(_0x3a4e85[_0xdd9c('0x2e')][_0xdd9c('0x3f')]){_0x532394[_0xdd9c('0x45')]=[{'all':!![]}];}_0x532394=_[_0xdd9c('0x46')]({},_0x532394,_0x3a4e85[_0xdd9c('0x3d')]);return db[_0xdd9c('0x28')][_0xdd9c('0x47')](_0x532394)[_0xdd9c('0x1f')](handleEntityNotFound(_0x5a9f66,null))[_0xdd9c('0x1f')](respondWithResult(_0x5a9f66,null))['catch'](handleError(_0x5a9f66,null));};exports[_0xdd9c('0x48')]=function(_0x22e340,_0x251e5b){return db[_0xdd9c('0x28')]['create'](_0x22e340[_0xdd9c('0x49')],{})[_0xdd9c('0x1f')](respondWithResult(_0x251e5b,0xc9))[_0xdd9c('0x42')](handleError(_0x251e5b,null));};exports[_0xdd9c('0x1e')]=function(_0x1099d8,_0x27e034){if(_0x1099d8[_0xdd9c('0x49')]['id']){delete _0x1099d8['body']['id'];}return db[_0xdd9c('0x28')][_0xdd9c('0x47')]({'where':{'id':_0x1099d8[_0xdd9c('0x43')]['id']}})['then'](handleEntityNotFound(_0x27e034,null))['then'](saveUpdates(_0x1099d8[_0xdd9c('0x49')],null))['then'](respondWithResult(_0x27e034,null))[_0xdd9c('0x42')](handleError(_0x27e034,null));};exports[_0xdd9c('0x4a')]=function(_0x5be3a2,_0x512355){return db['UserProfileSection']['find']({'where':{'id':_0x5be3a2[_0xdd9c('0x43')]['id']}})['then'](handleEntityNotFound(_0x512355,null))[_0xdd9c('0x1f')](removeEntity(_0x512355,null))[_0xdd9c('0x42')](handleError(_0x512355,null));};exports[_0xdd9c('0x4b')]=function(_0x567aa8,_0x3a186f){return db[_0xdd9c('0x28')]['describe']()[_0xdd9c('0x1f')](respondWithResult(_0x3a186f,null))[_0xdd9c('0x42')](handleError(_0x3a186f,null));}; \ No newline at end of file +var _0x7384=['status','end','json','offset','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','fieldName','key','query','keys','filters','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','type','field','merge','options','count','includeAll','UserProfileSection','findAll','rows','catch','show','rawAttributes','intersection','include','find','create','body','params','html-pdf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus'];(function(_0x39cf70,_0x3ec55b){var _0x580424=function(_0x580a4e){while(--_0x580a4e){_0x39cf70['push'](_0x39cf70['shift']());}};_0x580424(++_0x3ec55b);}(_0x7384,0xca));var _0x4738=function(_0x483921,_0x1f0cdf){_0x483921=_0x483921-0x0;var _0x340611=_0x7384[_0x483921];return _0x340611;};'use strict';var pdf=require(_0x4738('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4738('0x1'));var jsonpatch=require(_0x4738('0x2'));var rp=require(_0x4738('0x3'));var moment=require('moment');var BPromise=require(_0x4738('0x4'));var Mustache=require(_0x4738('0x5'));var util=require('util');var path=require(_0x4738('0x6'));var sox=require('sox');var csv=require(_0x4738('0x7'));var ejs=require(_0x4738('0x8'));var fs=require('fs');var _=require(_0x4738('0x9'));var squel=require(_0x4738('0xa'));var crypto=require(_0x4738('0xb'));var jsforce=require(_0x4738('0xc'));var deskjs=require(_0x4738('0xd'));var toCsv=require('to-csv');var querystring=require(_0x4738('0xe'));var Papa=require(_0x4738('0xf'));var Redis=require(_0x4738('0x10'));var authService=require(_0x4738('0x11'));var qs=require(_0x4738('0x12'));var as=require(_0x4738('0x13'));var hardwareService=require(_0x4738('0x14'));var logger=require('../../config/logger')(_0x4738('0x15'));var utils=require(_0x4738('0x16'));var config=require(_0x4738('0x17'));var db=require(_0x4738('0x18'))['db'];function respondWithStatusCode(_0x1b3e01,_0x5de802){_0x5de802=_0x5de802||0xcc;return function(_0x2f9b41){if(_0x2f9b41){return _0x1b3e01[_0x4738('0x19')](_0x5de802);}return _0x1b3e01[_0x4738('0x1a')](_0x5de802)[_0x4738('0x1b')]();};}function respondWithResult(_0x10480a,_0x56fcc6){_0x56fcc6=_0x56fcc6||0xc8;return function(_0x4eb349){if(_0x4eb349){return _0x10480a[_0x4738('0x1a')](_0x56fcc6)[_0x4738('0x1c')](_0x4eb349);}};}function respondWithFilteredResult(_0x42bdc1,_0x563168){return function(_0x285b4a){if(_0x285b4a){var _0x6b25bd=_0x285b4a['count'],_0x10e69c=_0x563168[_0x4738('0x1d')],_0x4bced9=_0x563168['offset']+_0x563168[_0x4738('0x1e')],_0x412d52;if(_0x4bced9>=_0x6b25bd){_0x4bced9=_0x6b25bd;_0x412d52=0xc8;}else{_0x412d52=0xce;}_0x42bdc1[_0x4738('0x1a')](_0x412d52);return _0x42bdc1['set'](_0x4738('0x1f'),_0x10e69c+'-'+_0x4bced9+'/'+_0x6b25bd)[_0x4738('0x1c')](_0x285b4a);}return null;};}function patchUpdates(_0x57e3f7){return function(_0x2f554b){try{jsonpatch[_0x4738('0x20')](_0x2f554b,_0x57e3f7,!![]);}catch(_0x26a6e0){return BPromise[_0x4738('0x21')](_0x26a6e0);}return _0x2f554b[_0x4738('0x22')]();};}function saveUpdates(_0x2ab877,_0x11a4a0){return function(_0x25f3ce){if(_0x25f3ce){return _0x25f3ce[_0x4738('0x23')](_0x2ab877)[_0x4738('0x24')](function(_0x4fe440){return _0x4fe440;});}return null;};}function removeEntity(_0x3efcff,_0x2e6572){return function(_0x8eb48f){if(_0x8eb48f){return _0x8eb48f[_0x4738('0x25')]()[_0x4738('0x24')](function(){_0x3efcff[_0x4738('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x740031,_0x2d738e){return function(_0x51be90){if(!_0x51be90){_0x740031['sendStatus'](0x194);}return _0x51be90;};}function handleError(_0x28af6a,_0xb3f993){_0xb3f993=_0xb3f993||0x1f4;return function(_0x150790){logger[_0x4738('0x26')](_0x150790[_0x4738('0x27')]);if(_0x150790['name']){delete _0x150790[_0x4738('0x28')];}_0x28af6a[_0x4738('0x1a')](_0xb3f993)[_0x4738('0x29')](_0x150790);};}exports[_0x4738('0x2a')]=function(_0x4754fd,_0x5bbd6d){var _0x597a70={},_0x158043={},_0x4a9594={'count':0x0,'rows':[]};var _0x1ba73c=_[_0x4738('0x2b')](db['UserProfileSection']['rawAttributes'],function(_0x8ac02d){return{'name':_0x8ac02d[_0x4738('0x2c')],'type':_0x8ac02d['type'][_0x4738('0x2d')]};});_0x158043['model']=_['map'](_0x1ba73c,_0x4738('0x28'));_0x158043[_0x4738('0x2e')]=_[_0x4738('0x2f')](_0x4754fd[_0x4738('0x2e')]);_0x158043[_0x4738('0x30')]=_['intersection'](_0x158043[_0x4738('0x31')],_0x158043[_0x4738('0x2e')]);_0x597a70['attributes']=_['intersection'](_0x158043['model'],qs[_0x4738('0x32')](_0x4754fd[_0x4738('0x2e')][_0x4738('0x32')]));_0x597a70[_0x4738('0x33')]=_0x597a70['attributes']['length']?_0x597a70['attributes']:_0x158043['model'];if(!_0x4754fd[_0x4738('0x2e')][_0x4738('0x34')](_0x4738('0x35'))){_0x597a70[_0x4738('0x1e')]=qs['limit'](_0x4754fd['query'][_0x4738('0x1e')]);_0x597a70[_0x4738('0x1d')]=qs[_0x4738('0x1d')](_0x4754fd['query'][_0x4738('0x1d')]);}_0x597a70[_0x4738('0x36')]=qs[_0x4738('0x37')](_0x4754fd[_0x4738('0x2e')]['sort']);_0x597a70[_0x4738('0x38')]=qs[_0x4738('0x30')](_['pick'](_0x4754fd[_0x4738('0x2e')],_0x158043['filters']));if(_0x4754fd[_0x4738('0x2e')][_0x4738('0x39')]){_0x597a70[_0x4738('0x38')]=_['merge'](_0x597a70[_0x4738('0x38')],{'$or':_[_0x4738('0x2b')](_0x1ba73c,function(_0x249d69){if(_0x249d69[_0x4738('0x3a')]['key']!=='VIRTUAL'){var _0x289ef0={};_0x289ef0[_0x249d69[_0x4738('0x3b')]]={'$like':'%'+_0x4754fd[_0x4738('0x2e')]['filter']+'%'};return _0x289ef0;}})});}_0x597a70=_[_0x4738('0x3c')]({},_0x597a70,_0x4754fd[_0x4738('0x3d')]);var _0x14d388={'where':_0x597a70[_0x4738('0x38')]};return db['UserProfileSection'][_0x4738('0x3e')](_0x14d388)['then'](function(_0x54eddb){_0x4a9594[_0x4738('0x3e')]=_0x54eddb;if(_0x4754fd[_0x4738('0x2e')][_0x4738('0x3f')]){_0x597a70['include']=[{'all':!![]}];}return db[_0x4738('0x40')][_0x4738('0x41')](_0x597a70);})[_0x4738('0x24')](function(_0x3504ad){_0x4a9594[_0x4738('0x42')]=_0x3504ad;return _0x4a9594;})['then'](respondWithFilteredResult(_0x5bbd6d,_0x597a70))[_0x4738('0x43')](handleError(_0x5bbd6d,null));};exports[_0x4738('0x44')]=function(_0x54d2b7,_0x5d0aef){var _0x575f15={'raw':![],'where':{'id':_0x54d2b7['params']['id']}},_0xcbcd5a={};_0xcbcd5a['model']=_[_0x4738('0x2f')](db[_0x4738('0x40')][_0x4738('0x45')]);_0xcbcd5a['query']=_[_0x4738('0x2f')](_0x54d2b7[_0x4738('0x2e')]);_0xcbcd5a['filters']=_[_0x4738('0x46')](_0xcbcd5a['model'],_0xcbcd5a[_0x4738('0x2e')]);_0x575f15[_0x4738('0x33')]=_[_0x4738('0x46')](_0xcbcd5a[_0x4738('0x31')],qs['fields'](_0x54d2b7[_0x4738('0x2e')][_0x4738('0x32')]));_0x575f15[_0x4738('0x33')]=_0x575f15[_0x4738('0x33')]['length']?_0x575f15[_0x4738('0x33')]:_0xcbcd5a[_0x4738('0x31')];if(_0x54d2b7[_0x4738('0x2e')][_0x4738('0x3f')]){_0x575f15[_0x4738('0x47')]=[{'all':!![]}];}_0x575f15=_[_0x4738('0x3c')]({},_0x575f15,_0x54d2b7['options']);return db['UserProfileSection'][_0x4738('0x48')](_0x575f15)[_0x4738('0x24')](handleEntityNotFound(_0x5d0aef,null))[_0x4738('0x24')](respondWithResult(_0x5d0aef,null))[_0x4738('0x43')](handleError(_0x5d0aef,null));};exports[_0x4738('0x49')]=function(_0x274243,_0xc75d5e){return db[_0x4738('0x40')][_0x4738('0x49')](_0x274243[_0x4738('0x4a')],{})['then'](respondWithResult(_0xc75d5e,0xc9))[_0x4738('0x43')](handleError(_0xc75d5e,null));};exports[_0x4738('0x23')]=function(_0x179055,_0x2964bd){if(_0x179055['body']['id']){delete _0x179055[_0x4738('0x4a')]['id'];}return db[_0x4738('0x40')][_0x4738('0x48')]({'where':{'id':_0x179055[_0x4738('0x4b')]['id']}})[_0x4738('0x24')](handleEntityNotFound(_0x2964bd,null))['then'](saveUpdates(_0x179055[_0x4738('0x4a')],null))[_0x4738('0x24')](respondWithResult(_0x2964bd,null))[_0x4738('0x43')](handleError(_0x2964bd,null));};exports[_0x4738('0x25')]=function(_0x564782,_0x45b993){return db['UserProfileSection'][_0x4738('0x48')]({'where':{'id':_0x564782[_0x4738('0x4b')]['id']}})[_0x4738('0x24')](handleEntityNotFound(_0x45b993,null))[_0x4738('0x24')](removeEntity(_0x45b993,null))[_0x4738('0x43')](handleError(_0x45b993,null));};exports['describe']=function(_0x1e3b46,_0x4a8270){return db[_0x4738('0x40')]['describe']()[_0x4738('0x24')](respondWithResult(_0x4a8270,null))['catch'](handleError(_0x4a8270,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index d44603e..e35f0b3 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 _0x4ee5=['request-promise','rimraf','../../config/environment','./userProfileSection.attributes','UserProfileSection','user_profile_has_sections','compositeIndex','userProfileId','lodash','../../config/logger','api','moment','bluebird'];(function(_0x86b162,_0x39a293){var _0x12c31b=function(_0xdc16b9){while(--_0xdc16b9){_0x86b162['push'](_0x86b162['shift']());}};_0x12c31b(++_0x39a293);}(_0x4ee5,0x1dc));var _0x54ee=function(_0x161430,_0x1070e4){_0x161430=_0x161430-0x0;var _0x3dc170=_0x4ee5[_0x161430];return _0x3dc170;};'use strict';var _=require(_0x54ee('0x0'));var util=require('util');var logger=require(_0x54ee('0x1'))(_0x54ee('0x2'));var moment=require(_0x54ee('0x3'));var BPromise=require(_0x54ee('0x4'));var rp=require(_0x54ee('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x54ee('0x6'));var config=require(_0x54ee('0x7'));var attributes=require(_0x54ee('0x8'));module['exports']=function(_0x59a282,_0x200892){return _0x59a282['define'](_0x54ee('0x9'),attributes,{'tableName':_0x54ee('0xa'),'paranoid':![],'indexes':[{'name':_0x54ee('0xb'),'fields':['sectionId',_0x54ee('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x65aa=['UserProfileSection','sectionId','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./userProfileSection.attributes','exports'];(function(_0x21dd50,_0x921f70){var _0x1b7d5e=function(_0x317101){while(--_0x317101){_0x21dd50['push'](_0x21dd50['shift']());}};_0x1b7d5e(++_0x921f70);}(_0x65aa,0x142));var _0xa65a=function(_0x37827c,_0x107f83){_0x37827c=_0x37827c-0x0;var _0xaee348=_0x65aa[_0x37827c];return _0xaee348;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa65a('0x0'))('api');var moment=require(_0xa65a('0x1'));var BPromise=require(_0xa65a('0x2'));var rp=require(_0xa65a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa65a('0x4'));var config=require(_0xa65a('0x5'));var attributes=require(_0xa65a('0x6'));module[_0xa65a('0x7')]=function(_0xae21e9,_0x2b387d){return _0xae21e9['define'](_0xa65a('0x8'),attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0xa65a('0x9'),'userProfileId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 2751ee2..e986fd8 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 _0xe137=['../../mysqldb','rpc','jayson/promise','http','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis'];(function(_0x5819f6,_0x52b4e0){var _0x16e39b=function(_0x32aa9b){while(--_0x32aa9b){_0x5819f6['push'](_0x5819f6['shift']());}};_0x16e39b(++_0x52b4e0);}(_0xe137,0x176));var _0x7e13=function(_0x5b740b,_0x381833){_0x5b740b=_0x5b740b-0x0;var _0x6f8f4e=_0xe137[_0x5b740b];return _0x6f8f4e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7e13('0x0'));var BPromise=require(_0x7e13('0x1'));var rs=require(_0x7e13('0x2'));var fs=require('fs');var Redis=require(_0x7e13('0x3'));var db=require(_0x7e13('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7e13('0x5'));var config=require('../../config/environment');var jayson=require(_0x7e13('0x6'));var client=jayson['client'][_0x7e13('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x50902f,_0x2bb94a,_0x1d6c8f){return new BPromise(function(_0x47acd7,_0x5e2d19){return client['request'](_0x50902f,_0x1d6c8f)['then'](function(_0x4f01a2){logger['info'](_0x7e13('0x8'),_0x2bb94a,_0x7e13('0x9'));logger[_0x7e13('0xa')](_0x7e13('0xb'),_0x2bb94a,_0x7e13('0x9'),JSON[_0x7e13('0xc')](_0x4f01a2));if(_0x4f01a2[_0x7e13('0xd')]){if(_0x4f01a2['error'][_0x7e13('0xe')]===0x1f4){logger[_0x7e13('0xd')]('UserProfileSection,\x20%s,\x20%s',_0x2bb94a,_0x4f01a2['error'][_0x7e13('0xf')]);return _0x5e2d19(_0x4f01a2[_0x7e13('0xd')][_0x7e13('0xf')]);}logger[_0x7e13('0xd')](_0x7e13('0x8'),_0x2bb94a,_0x4f01a2['error'][_0x7e13('0xf')]);return _0x47acd7(_0x4f01a2[_0x7e13('0xd')]['message']);}else{logger['info'](_0x7e13('0x8'),_0x2bb94a,_0x7e13('0x9'));_0x47acd7(_0x4f01a2[_0x7e13('0x10')][_0x7e13('0xf')]);}})[_0x7e13('0x11')](function(_0x1a2c44){logger[_0x7e13('0xd')](_0x7e13('0x8'),_0x2bb94a,_0x1a2c44);_0x5e2d19(_0x1a2c44);});});} \ No newline at end of file +var _0xaa36=['code','UserProfileSection,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','debug','stringify','error'];(function(_0x550b09,_0x232453){var _0xc12eee=function(_0x543a43){while(--_0x543a43){_0x550b09['push'](_0x550b09['shift']());}};_0xc12eee(++_0x232453);}(_0xaa36,0x1b9));var _0x6aa3=function(_0x3f5262,_0x1ad642){_0x3f5262=_0x3f5262-0x0;var _0x113366=_0xaa36[_0x3f5262];return _0x113366;};'use strict';var _=require(_0x6aa3('0x0'));var util=require(_0x6aa3('0x1'));var moment=require(_0x6aa3('0x2'));var BPromise=require(_0x6aa3('0x3'));var rs=require(_0x6aa3('0x4'));var fs=require('fs');var Redis=require(_0x6aa3('0x5'));var db=require(_0x6aa3('0x6'))['db'];var utils=require(_0x6aa3('0x7'));var logger=require(_0x6aa3('0x8'))(_0x6aa3('0x9'));var config=require(_0x6aa3('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x6aa3('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3343ef,_0x35a162,_0x5ae614){return new BPromise(function(_0x4b8422,_0x5273dd){return client[_0x6aa3('0xc')](_0x3343ef,_0x5ae614)[_0x6aa3('0xd')](function(_0x263cc0){logger[_0x6aa3('0xe')]('UserProfileSection,\x20%s,\x20%s',_0x35a162,_0x6aa3('0xf'));logger[_0x6aa3('0x10')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x35a162,_0x6aa3('0xf'),JSON[_0x6aa3('0x11')](_0x263cc0));if(_0x263cc0[_0x6aa3('0x12')]){if(_0x263cc0[_0x6aa3('0x12')][_0x6aa3('0x13')]===0x1f4){logger['error'](_0x6aa3('0x14'),_0x35a162,_0x263cc0['error'][_0x6aa3('0x15')]);return _0x5273dd(_0x263cc0['error'][_0x6aa3('0x15')]);}logger['error'](_0x6aa3('0x14'),_0x35a162,_0x263cc0[_0x6aa3('0x12')]['message']);return _0x4b8422(_0x263cc0[_0x6aa3('0x12')][_0x6aa3('0x15')]);}else{logger['info'](_0x6aa3('0x14'),_0x35a162,_0x6aa3('0xf'));_0x4b8422(_0x263cc0['result']['message']);}})[_0x6aa3('0x16')](function(_0x373d81){logger['error'](_0x6aa3('0x14'),_0x35a162,_0x373d81);_0x5273dd(_0x373d81);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 524fb26..3fbc19a 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 _0xc032=['exports','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc032,0x1b3));var _0x2c03=function(_0x3c1a22,_0xabad28){_0x3c1a22=_0x3c1a22-0x0;var _0x4d4a9a=_0xc032[_0x3c1a22];return _0x4d4a9a;};'use strict';var multer=require('multer');var util=require(_0x2c03('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2c03('0x1'));var router=express[_0x2c03('0x2')]();var auth=require(_0x2c03('0x3'));var interaction=require(_0x2c03('0x4'));var config=require(_0x2c03('0x5'));module[_0x2c03('0x6')]=router; \ No newline at end of file +var _0x75d5=['multer','util','path','express','Router','../../config/environment'];(function(_0x3fd753,_0x32a64d){var _0x3665b5=function(_0x3ab309){while(--_0x3ab309){_0x3fd753['push'](_0x3fd753['shift']());}};_0x3665b5(++_0x32a64d);}(_0x75d5,0xb4));var _0x575d=function(_0x43f697,_0x4a492a){_0x43f697=_0x43f697-0x0;var _0x146726=_0x75d5[_0x43f697];return _0x146726;};'use strict';var multer=require(_0x575d('0x0'));var util=require(_0x575d('0x1'));var path=require(_0x575d('0x2'));var timeout=require('connect-timeout');var express=require(_0x575d('0x3'));var router=express[_0x575d('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x575d('0x5'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index a3a1c63..3806ba8 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 _0xd8b0=['exports','sequelize'];(function(_0x4e728b,_0x5c4c41){var _0x58ac99=function(_0x375fb0){while(--_0x375fb0){_0x4e728b['push'](_0x4e728b['shift']());}};_0x58ac99(++_0x5c4c41);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xbaf0=['exports','INTEGER'];(function(_0x221637,_0x42a5e0){var _0x11bf9e=function(_0xbc416e){while(--_0xbc416e){_0x221637['push'](_0x221637['shift']());}};_0x11bf9e(++_0x42a5e0);}(_0xbaf0,0x12a));var _0x0baf=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xbaf0[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'penalty':{'type':Sequelize[_0x0baf('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index c070ddc..e22fa36 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 _0x9fbc=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./userSmsQueue.attributes','exports','define','UserSmsQueue','user_has_sms_queues','lodash'];(function(_0x2e2257,_0x19bd00){var _0x12777c=function(_0x2f00fb){while(--_0x2f00fb){_0x2e2257['push'](_0x2e2257['shift']());}};_0x12777c(++_0x19bd00);}(_0x9fbc,0x15d));var _0xc9fb=function(_0x4fde9a,_0x5d1eda){_0x4fde9a=_0x4fde9a-0x0;var _0x58f321=_0x9fbc[_0x4fde9a];return _0x58f321;};'use strict';var _=require(_0xc9fb('0x0'));var util=require(_0xc9fb('0x1'));var logger=require(_0xc9fb('0x2'))(_0xc9fb('0x3'));var moment=require(_0xc9fb('0x4'));var BPromise=require(_0xc9fb('0x5'));var rp=require(_0xc9fb('0x6'));var fs=require('fs');var path=require(_0xc9fb('0x7'));var rimraf=require('rimraf');var config=require(_0xc9fb('0x8'));var attributes=require(_0xc9fb('0x9'));module[_0xc9fb('0xa')]=function(_0x3ee271,_0xb96341){return _0x3ee271[_0xc9fb('0xb')](_0xc9fb('0xc'),attributes,{'tableName':_0xc9fb('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0aa2=['../../config/environment','./userSmsQueue.attributes','exports','define','user_has_sms_queues','lodash','util','../../config/logger','api','bluebird','path','rimraf'];(function(_0x625d27,_0x186bf4){var _0x464cf8=function(_0x239bfd){while(--_0x239bfd){_0x625d27['push'](_0x625d27['shift']());}};_0x464cf8(++_0x186bf4);}(_0x0aa2,0x65));var _0x20aa=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x0aa2[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x20aa('0x0'));var util=require(_0x20aa('0x1'));var logger=require(_0x20aa('0x2'))(_0x20aa('0x3'));var moment=require('moment');var BPromise=require(_0x20aa('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x20aa('0x5'));var rimraf=require(_0x20aa('0x6'));var config=require(_0x20aa('0x7'));var attributes=require(_0x20aa('0x8'));module[_0x20aa('0x9')]=function(_0x46b3a3,_0xb17ff2){return _0x46b3a3[_0x20aa('0xa')]('UserSmsQueue',attributes,{'tableName':_0x20aa('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.rpc.js b/server/api/userSmsQueue/userSmsQueue.rpc.js index 3a74f97..608087b 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 _0xa5bc=['../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x5e36d1,_0x471178){var _0x950b9e=function(_0x1872f3){while(--_0x1872f3){_0x5e36d1['push'](_0x5e36d1['shift']());}};_0x950b9e(++_0x471178);}(_0xa5bc,0x19d));var _0xca5b=function(_0x99f57a,_0x572d29){_0x99f57a=_0x99f57a-0x0;var _0x1f5b55=_0xa5bc[_0x99f57a];return _0x1f5b55;};'use strict';var _=require(_0xca5b('0x0'));var util=require(_0xca5b('0x1'));var moment=require('moment');var BPromise=require(_0xca5b('0x2'));var rs=require(_0xca5b('0x3'));var fs=require('fs');var Redis=require(_0xca5b('0x4'));var db=require(_0xca5b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xca5b('0x6'))(_0xca5b('0x7'));var config=require(_0xca5b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xca5b('0x9')][_0xca5b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x35f7b8,_0x52341f,_0x4341e5){return new BPromise(function(_0x2373e4,_0x3d44b3){return client[_0xca5b('0xb')](_0x35f7b8,_0x4341e5)['then'](function(_0x5a9fcb){logger[_0xca5b('0xc')](_0xca5b('0xd'),_0x52341f,_0xca5b('0xe'));logger['debug'](_0xca5b('0xf'),_0x52341f,_0xca5b('0xe'),JSON[_0xca5b('0x10')](_0x5a9fcb));if(_0x5a9fcb['error']){if(_0x5a9fcb[_0xca5b('0x11')][_0xca5b('0x12')]===0x1f4){logger[_0xca5b('0x11')]('UserSmsQueue,\x20%s,\x20%s',_0x52341f,_0x5a9fcb['error'][_0xca5b('0x13')]);return _0x3d44b3(_0x5a9fcb[_0xca5b('0x11')][_0xca5b('0x13')]);}logger[_0xca5b('0x11')](_0xca5b('0xd'),_0x52341f,_0x5a9fcb[_0xca5b('0x11')][_0xca5b('0x13')]);return _0x2373e4(_0x5a9fcb[_0xca5b('0x11')]['message']);}else{logger[_0xca5b('0xc')](_0xca5b('0xd'),_0x52341f,_0xca5b('0xe'));_0x2373e4(_0x5a9fcb[_0xca5b('0x14')][_0xca5b('0x13')]);}})[_0xca5b('0x15')](function(_0x330165){logger[_0xca5b('0x11')]('UserSmsQueue,\x20%s,\x20%s',_0x52341f,_0x330165);_0x3d44b3(_0x330165);});});} \ No newline at end of file +var _0x8610=['client','http','then','info','UserSmsQueue,\x20%s,\x20%s','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise'];(function(_0x356cdf,_0x5229c0){var _0x432bd1=function(_0x4c4d6d){while(--_0x4c4d6d){_0x356cdf['push'](_0x356cdf['shift']());}};_0x432bd1(++_0x5229c0);}(_0x8610,0x1ec));var _0x0861=function(_0x460bc1,_0x503658){_0x460bc1=_0x460bc1-0x0;var _0x48acb3=_0x8610[_0x460bc1];return _0x48acb3;};'use strict';var _=require(_0x0861('0x0'));var util=require(_0x0861('0x1'));var moment=require('moment');var BPromise=require(_0x0861('0x2'));var rs=require(_0x0861('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0861('0x4'))['db'];var utils=require(_0x0861('0x5'));var logger=require(_0x0861('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0861('0x7'));var client=jayson[_0x0861('0x8')][_0x0861('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3531fd,_0x4f80ba,_0xb2cded){return new BPromise(function(_0x1c31cd,_0x272a31){return client['request'](_0x3531fd,_0xb2cded)[_0x0861('0xa')](function(_0x43b736){logger[_0x0861('0xb')](_0x0861('0xc'),_0x4f80ba,'request\x20sent');logger[_0x0861('0xd')](_0x0861('0xe'),_0x4f80ba,'request\x20sent',JSON[_0x0861('0xf')](_0x43b736));if(_0x43b736['error']){if(_0x43b736['error']['code']===0x1f4){logger[_0x0861('0x10')](_0x0861('0xc'),_0x4f80ba,_0x43b736[_0x0861('0x10')]['message']);return _0x272a31(_0x43b736[_0x0861('0x10')]['message']);}logger[_0x0861('0x10')](_0x0861('0xc'),_0x4f80ba,_0x43b736[_0x0861('0x10')]['message']);return _0x1c31cd(_0x43b736[_0x0861('0x10')][_0x0861('0x11')]);}else{logger['info'](_0x0861('0xc'),_0x4f80ba,'request\x20sent');_0x1c31cd(_0x43b736[_0x0861('0x12')][_0x0861('0x11')]);}})[_0x0861('0x13')](function(_0x50ca16){logger[_0x0861('0x10')](_0x0861('0xc'),_0x4f80ba,_0x50ca16);_0x272a31(_0x50ca16);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js index 5692507..d8bd0e9 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 _0x5700=['../../components/auth/service','../../config/environment','exports','multer','util','path','connect-timeout'];(function(_0x7062d3,_0x5538b3){var _0x388132=function(_0x59c8c5){while(--_0x59c8c5){_0x7062d3['push'](_0x7062d3['shift']());}};_0x388132(++_0x5538b3);}(_0x5700,0x129));var _0x0570=function(_0x5bb6d3,_0x15f5c0){_0x5bb6d3=_0x5bb6d3-0x0;var _0x175b90=_0x5700[_0x5bb6d3];return _0x175b90;};'use strict';var multer=require(_0x0570('0x0'));var util=require(_0x0570('0x1'));var path=require(_0x0570('0x2'));var timeout=require(_0x0570('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x0570('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x0570('0x5'));module[_0x0570('0x6')]=router; \ No newline at end of file +var _0xbd4a=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','exports','multer','util','path'];(function(_0x1c546c,_0x5c57cb){var _0x2cc384=function(_0x4dee11){while(--_0x4dee11){_0x1c546c['push'](_0x1c546c['shift']());}};_0x2cc384(++_0x5c57cb);}(_0xbd4a,0xb5));var _0xabd4=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xbd4a[_0x21a9d9];return _0x46adce;};'use strict';var multer=require(_0xabd4('0x0'));var util=require(_0xabd4('0x1'));var path=require(_0xabd4('0x2'));var timeout=require(_0xabd4('0x3'));var express=require('express');var router=express[_0xabd4('0x4')]();var auth=require(_0xabd4('0x5'));var interaction=require(_0xabd4('0x6'));var config=require('../../config/environment');module[_0xabd4('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 9381cbf..97a8385 100644 --- a/server/api/userVoiceQueue/userVoiceQueue.attributes.js +++ b/server/api/userVoiceQueue/userVoiceQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['exports','sequelize'];(function(_0x31c479,_0x303887){var _0x3562b2=function(_0x4ca554){while(--_0x4ca554){_0x31c479['push'](_0x31c479['shift']());}};_0x3562b2(++_0x303887);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xe706=['INTEGER','sequelize','exports'];(function(_0x4b92f4,_0x32a49a){var _0x4b2ca2=function(_0x5df795){while(--_0x5df795){_0x4b92f4['push'](_0x4b92f4['shift']());}};_0x4b2ca2(++_0x32a49a);}(_0xe706,0xa3));var _0x6e70=function(_0x3c5e54,_0x2b991b){_0x3c5e54=_0x3c5e54-0x0;var _0x3ae1f3=_0xe706[_0x3c5e54];return _0x3ae1f3;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'penalty':{'type':Sequelize[_0x6e70('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index 08ce363..42d69ea 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 _0xf72b=['./userVoiceQueue.attributes','exports','define','UserVoiceQueue','user_has_voice_queues','lodash','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x193fde,_0x58c462){var _0x5a87eb=function(_0x27b772){while(--_0x27b772){_0x193fde['push'](_0x193fde['shift']());}};_0x5a87eb(++_0x58c462);}(_0xf72b,0x1d9));var _0xbf72=function(_0x44a707,_0x387935){_0x44a707=_0x44a707-0x0;var _0x307222=_0xf72b[_0x44a707];return _0x307222;};'use strict';var _=require(_0xbf72('0x0'));var util=require('util');var logger=require(_0xbf72('0x1'))('api');var moment=require(_0xbf72('0x2'));var BPromise=require(_0xbf72('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbf72('0x4'));var rimraf=require(_0xbf72('0x5'));var config=require(_0xbf72('0x6'));var attributes=require(_0xbf72('0x7'));module[_0xbf72('0x8')]=function(_0x2b8440,_0x5ee060){return _0x2b8440[_0xbf72('0x9')](_0xbf72('0xa'),attributes,{'tableName':_0xbf72('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0c02=['./userVoiceQueue.attributes','exports','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x17cefa,_0x36f96c){var _0x2b5635=function(_0xcceebb){while(--_0xcceebb){_0x17cefa['push'](_0x17cefa['shift']());}};_0x2b5635(++_0x36f96c);}(_0x0c02,0x84));var _0x20c0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c02[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x20c0('0x0'));var logger=require(_0x20c0('0x1'))('api');var moment=require(_0x20c0('0x2'));var BPromise=require(_0x20c0('0x3'));var rp=require(_0x20c0('0x4'));var fs=require('fs');var path=require(_0x20c0('0x5'));var rimraf=require(_0x20c0('0x6'));var config=require(_0x20c0('0x7'));var attributes=require(_0x20c0('0x8'));module[_0x20c0('0x9')]=function(_0x13312d,_0xd25ee8){return _0x13312d['define']('UserVoiceQueue',attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js index 096c169..be64d4d 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 _0x1ed3=['../../config/utils','../../config/environment','client','http','request','then','info','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','UserVoiceQueue,\x20%s,\x20%s','catch','util','moment','randomstring','../../mysqldb'];(function(_0x4e5a35,_0x1f05cb){var _0x406e2c=function(_0x21c242){while(--_0x21c242){_0x4e5a35['push'](_0x4e5a35['shift']());}};_0x406e2c(++_0x1f05cb);}(_0x1ed3,0x12c));var _0x31ed=function(_0x59c294,_0x546ef3){_0x59c294=_0x59c294-0x0;var _0x330ccf=_0x1ed3[_0x59c294];return _0x330ccf;};'use strict';var _=require('lodash');var util=require(_0x31ed('0x0'));var moment=require(_0x31ed('0x1'));var BPromise=require('bluebird');var rs=require(_0x31ed('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x31ed('0x3'))['db'];var utils=require(_0x31ed('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x31ed('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x31ed('0x6')][_0x31ed('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5c15b5,_0x27de0d,_0x4e3bcc){return new BPromise(function(_0xe0f1dc,_0x366980){return client[_0x31ed('0x8')](_0x5c15b5,_0x4e3bcc)[_0x31ed('0x9')](function(_0x335dbc){logger[_0x31ed('0xa')]('UserVoiceQueue,\x20%s,\x20%s',_0x27de0d,_0x31ed('0xb'));logger[_0x31ed('0xc')](_0x31ed('0xd'),_0x27de0d,_0x31ed('0xb'),JSON['stringify'](_0x335dbc));if(_0x335dbc['error']){if(_0x335dbc[_0x31ed('0xe')][_0x31ed('0xf')]===0x1f4){logger[_0x31ed('0xe')]('UserVoiceQueue,\x20%s,\x20%s',_0x27de0d,_0x335dbc[_0x31ed('0xe')][_0x31ed('0x10')]);return _0x366980(_0x335dbc['error'][_0x31ed('0x10')]);}logger[_0x31ed('0xe')](_0x31ed('0x11'),_0x27de0d,_0x335dbc['error'][_0x31ed('0x10')]);return _0xe0f1dc(_0x335dbc[_0x31ed('0xe')]['message']);}else{logger[_0x31ed('0xa')](_0x31ed('0x11'),_0x27de0d,_0x31ed('0xb'));_0xe0f1dc(_0x335dbc['result'][_0x31ed('0x10')]);}})[_0x31ed('0x12')](function(_0x288ee1){logger[_0x31ed('0xe')](_0x31ed('0x11'),_0x27de0d,_0x288ee1);_0x366980(_0x288ee1);});});} \ No newline at end of file +var _0x8bbb=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','request','then','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','util'];(function(_0x2a3f27,_0xf74130){var _0x59e990=function(_0x12a2ba){while(--_0x12a2ba){_0x2a3f27['push'](_0x2a3f27['shift']());}};_0x59e990(++_0xf74130);}(_0x8bbb,0x18e));var _0xb8bb=function(_0x33c603,_0x6d0ce4){_0x33c603=_0x33c603-0x0;var _0xae96f4=_0x8bbb[_0x33c603];return _0xae96f4;};'use strict';var _=require('lodash');var util=require(_0xb8bb('0x0'));var moment=require(_0xb8bb('0x1'));var BPromise=require(_0xb8bb('0x2'));var rs=require(_0xb8bb('0x3'));var fs=require('fs');var Redis=require(_0xb8bb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb8bb('0x5'));var logger=require(_0xb8bb('0x6'))('rpc');var config=require(_0xb8bb('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb8bb('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c9856,_0x51e079,_0x55733a){return new BPromise(function(_0xfaa4c,_0x536afe){return client[_0xb8bb('0x9')](_0x4c9856,_0x55733a)[_0xb8bb('0xa')](function(_0x2cdefb){logger['info'](_0xb8bb('0xb'),_0x51e079,_0xb8bb('0xc'));logger[_0xb8bb('0xd')](_0xb8bb('0xe'),_0x51e079,_0xb8bb('0xc'),JSON[_0xb8bb('0xf')](_0x2cdefb));if(_0x2cdefb[_0xb8bb('0x10')]){if(_0x2cdefb[_0xb8bb('0x10')][_0xb8bb('0x11')]===0x1f4){logger[_0xb8bb('0x10')]('UserVoiceQueue,\x20%s,\x20%s',_0x51e079,_0x2cdefb[_0xb8bb('0x10')][_0xb8bb('0x12')]);return _0x536afe(_0x2cdefb[_0xb8bb('0x10')][_0xb8bb('0x12')]);}logger[_0xb8bb('0x10')](_0xb8bb('0xb'),_0x51e079,_0x2cdefb['error'][_0xb8bb('0x12')]);return _0xfaa4c(_0x2cdefb['error'][_0xb8bb('0x12')]);}else{logger[_0xb8bb('0x13')](_0xb8bb('0xb'),_0x51e079,_0xb8bb('0xc'));_0xfaa4c(_0x2cdefb['result']['message']);}})[_0xb8bb('0x14')](function(_0x51e956){logger[_0xb8bb('0x10')](_0xb8bb('0xb'),_0x51e079,_0x51e956);_0x536afe(_0x51e956);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index a7d2dac..41c3ab8 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 _0xc96d=['path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','exports','util'];(function(_0x174ef5,_0x256e8e){var _0x1cc379=function(_0x3eafcf){while(--_0x3eafcf){_0x174ef5['push'](_0x174ef5['shift']());}};_0x1cc379(++_0x256e8e);}(_0xc96d,0x11f));var _0xdc96=function(_0x2a05e6,_0x2c48b3){_0x2a05e6=_0x2a05e6-0x0;var _0x47b7f2=_0xc96d[_0x2a05e6];return _0x47b7f2;};'use strict';var multer=require('multer');var util=require(_0xdc96('0x0'));var path=require(_0xdc96('0x1'));var timeout=require(_0xdc96('0x2'));var express=require(_0xdc96('0x3'));var router=express[_0xdc96('0x4')]();var auth=require(_0xdc96('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xdc96('0x6'));module[_0xdc96('0x7')]=router; \ No newline at end of file +var _0x1d89=['../../config/environment','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service'];(function(_0xc3e87,_0x8670d3){var _0x490799=function(_0x5cbbbc){while(--_0x5cbbbc){_0xc3e87['push'](_0xc3e87['shift']());}};_0x490799(++_0x8670d3);}(_0x1d89,0x6a));var _0x91d8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1d89[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x91d8('0x0'));var util=require(_0x91d8('0x1'));var path=require(_0x91d8('0x2'));var timeout=require(_0x91d8('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x91d8('0x4'));var interaction=require(_0x91d8('0x5'));var config=require(_0x91d8('0x6'));module[_0x91d8('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 4d20e4d..6f63b5c 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 _0x2d38=['INTEGER','sequelize','Required\x20by\x20Asterisk','STRING','queue_interface'];(function(_0x3b7cc9,_0x18cd9b){var _0x5751ea=function(_0x141c47){while(--_0x141c47){_0x3b7cc9['push'](_0x3b7cc9['shift']());}};_0x5751ea(++_0x18cd9b);}(_0x2d38,0x92));var _0x82d3=function(_0x26d333,_0xfb87e0){_0x26d333=_0x26d333-0x0;var _0x2ba6cc=_0x2d38[_0x26d333];return _0x2ba6cc;};'use strict';var Sequelize=require(_0x82d3('0x0'));module['exports']={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0x82d3('0x1')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0x82d3('0x1')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0x82d3('0x2')],'allowNull':![],'unique':_0x82d3('0x3'),'comment':_0x82d3('0x1')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0x82d3('0x2')],'allowNull':![],'unique':_0x82d3('0x3'),'comment':_0x82d3('0x1')},'penalty':{'type':Sequelize[_0x82d3('0x4')](0xb),'defaultValue':0x0,'comment':_0x82d3('0x1')},'paused':{'type':Sequelize[_0x82d3('0x4')](0xb),'defaultValue':0x0,'comment':_0x82d3('0x1')}}; \ No newline at end of file +var _0x9c60=['STRING','queue_interface','INTEGER','Required\x20by\x20Asterisk'];(function(_0x598ac1,_0x4dbe63){var _0x27b116=function(_0x528854){while(--_0x528854){_0x598ac1['push'](_0x598ac1['shift']());}};_0x27b116(++_0x4dbe63);}(_0x9c60,0x176));var _0x09c6=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x9c60[_0x13e741];return _0x3f8bb3;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x09c6('0x0')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x09c6('0x1')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0x09c6('0x1')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0x09c6('0x2')],'allowNull':![],'unique':_0x09c6('0x3'),'comment':_0x09c6('0x1')},'VoiceQueueId':{'type':Sequelize[_0x09c6('0x0')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x09c6('0x3'),'comment':_0x09c6('0x1')},'penalty':{'type':Sequelize[_0x09c6('0x0')](0xb),'defaultValue':0x0,'comment':_0x09c6('0x1')},'paused':{'type':Sequelize[_0x09c6('0x0')](0xb),'defaultValue':0x0,'comment':_0x09c6('0x1')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index bce87f4..3f27732 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 _0x7411=['update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','UserVoiceQueueRt','setMaxListeners','save'];(function(_0x48326a,_0x8cfa0c){var _0x466709=function(_0x5ab1b7){while(--_0x5ab1b7){_0x48326a['push'](_0x48326a['shift']());}};_0x466709(++_0x8cfa0c);}(_0x7411,0x1d2));var _0x1741=function(_0x187f50,_0x591802){_0x187f50=_0x187f50-0x0;var _0x560311=_0x7411[_0x187f50];return _0x560311;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0x1741('0x0'))['db'][_0x1741('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x1741('0x2')](0x0);var events={'afterCreate':_0x1741('0x3'),'afterUpdate':_0x1741('0x4'),'afterDestroy':_0x1741('0x5')};function emitEvent(_0x4c7701){return function(_0x4b5f6b,_0x3aaf2c,_0x3f4689){UserVoiceQueueRtEvents[_0x1741('0x6')](_0x4c7701+':'+_0x4b5f6b['id'],_0x4b5f6b);UserVoiceQueueRtEvents['emit'](_0x4c7701,_0x4b5f6b);_0x3f4689(null);};}for(var e in events){if(events[_0x1741('0x7')](e)){var event=events[e];UserVoiceQueueRt[_0x1741('0x8')](e,emitEvent(event));}}module[_0x1741('0x9')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0xff65=['hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','save','emit'];(function(_0x11fc92,_0x565dd9){var _0xf4ba3c=function(_0x3adf66){while(--_0x3adf66){_0x11fc92['push'](_0x11fc92['shift']());}};_0xf4ba3c(++_0x565dd9);}(_0xff65,0x14b));var _0x5ff6=function(_0x616290,_0x280b7f){_0x616290=_0x616290-0x0;var _0x453879=_0xff65[_0x616290];return _0x453879;};'use strict';var EventEmitter=require(_0x5ff6('0x0'));var UserVoiceQueueRt=require(_0x5ff6('0x1'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x5ff6('0x2')](0x0);var events={'afterCreate':_0x5ff6('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1042e9){return function(_0x5a1d25,_0x19c082,_0x3b4524){UserVoiceQueueRtEvents[_0x5ff6('0x4')](_0x1042e9+':'+_0x5a1d25['id'],_0x5a1d25);UserVoiceQueueRtEvents['emit'](_0x1042e9,_0x5a1d25);_0x3b4524(null);};}for(var e in events){if(events[_0x5ff6('0x5')](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0x5ff6('0x6')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index a58881d..0b67140 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 _0x5f25=['moment','request-promise','path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','user_has_voice_queues_rt','lodash','../../config/logger','api'];(function(_0x4b161f,_0x27222b){var _0x362f87=function(_0x100e0e){while(--_0x100e0e){_0x4b161f['push'](_0x4b161f['shift']());}};_0x362f87(++_0x27222b);}(_0x5f25,0xa2));var _0x55f2=function(_0x3f1076,_0x23b6c1){_0x3f1076=_0x3f1076-0x0;var _0x21d34f=_0x5f25[_0x3f1076];return _0x21d34f;};'use strict';var _=require(_0x55f2('0x0'));var util=require('util');var logger=require(_0x55f2('0x1'))(_0x55f2('0x2'));var moment=require(_0x55f2('0x3'));var BPromise=require('bluebird');var rp=require(_0x55f2('0x4'));var fs=require('fs');var path=require(_0x55f2('0x5'));var rimraf=require(_0x55f2('0x6'));var config=require(_0x55f2('0x7'));var attributes=require(_0x55f2('0x8'));module[_0x55f2('0x9')]=function(_0x3dfdb9,_0x21a96a){return _0x3dfdb9['define']('UserVoiceQueueRt',attributes,{'tableName':_0x55f2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1d96=['../../config/environment','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','util','api','moment','request-promise'];(function(_0x419305,_0x41c14e){var _0x4b66dc=function(_0x57d132){while(--_0x57d132){_0x419305['push'](_0x419305['shift']());}};_0x4b66dc(++_0x41c14e);}(_0x1d96,0x100));var _0x61d9=function(_0x1d06d1,_0x5b6596){_0x1d06d1=_0x1d06d1-0x0;var _0x4c1069=_0x1d96[_0x1d06d1];return _0x4c1069;};'use strict';var _=require('lodash');var util=require(_0x61d9('0x0'));var logger=require('../../config/logger')(_0x61d9('0x1'));var moment=require(_0x61d9('0x2'));var BPromise=require('bluebird');var rp=require(_0x61d9('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x61d9('0x4'));var attributes=require(_0x61d9('0x5'));module[_0x61d9('0x6')]=function(_0x1c6bee,_0x277fb9){return _0x1c6bee[_0x61d9('0x7')](_0x61d9('0x8'),attributes,{'tableName':_0x61d9('0x9'),'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 d7f5b5d..08f6650 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 _0x8396=['error','code','message','result','catch','findAll','options','where','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','GetVoiceQueueRtPauses','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3d5a75,_0x90ba63){var _0x26349c=function(_0x412a80){while(--_0x412a80){_0x3d5a75['push'](_0x3d5a75['shift']());}};_0x26349c(++_0x90ba63);}(_0x8396,0x1b1));var _0x6839=function(_0x299412,_0x3498fe){_0x299412=_0x299412-0x0;var _0x210456=_0x8396[_0x299412];return _0x210456;};'use strict';var _=require(_0x6839('0x0'));var util=require(_0x6839('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6839('0x2'));var fs=require('fs');var Redis=require(_0x6839('0x3'));var db=require(_0x6839('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6839('0x5'))(_0x6839('0x6'));var config=require('../../config/environment');var jayson=require(_0x6839('0x7'));var client=jayson['client'][_0x6839('0x8')]({'port':0x232a});config[_0x6839('0x9')]=_[_0x6839('0xa')](config[_0x6839('0x9')],{'host':_0x6839('0xb'),'port':0x18eb});var socket=require(_0x6839('0xc'))(new Redis(config[_0x6839('0x9')]));require('./userVoiceQueueRt.socket')[_0x6839('0xd')](socket);function respondWithRpcPromise(_0x3d9c2f,_0x4ebea9,_0x5427bf){return new BPromise(function(_0x3554a0,_0x50eeef){return client[_0x6839('0xe')](_0x3d9c2f,_0x5427bf)[_0x6839('0xf')](function(_0x2a54da){logger[_0x6839('0x10')](_0x6839('0x11'),_0x4ebea9,_0x6839('0x12'));logger[_0x6839('0x13')](_0x6839('0x14'),_0x4ebea9,_0x6839('0x12'),JSON[_0x6839('0x15')](_0x2a54da));if(_0x2a54da[_0x6839('0x16')]){if(_0x2a54da[_0x6839('0x16')][_0x6839('0x17')]===0x1f4){logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x4ebea9,_0x2a54da[_0x6839('0x16')][_0x6839('0x18')]);return _0x50eeef(_0x2a54da[_0x6839('0x16')][_0x6839('0x18')]);}logger[_0x6839('0x16')](_0x6839('0x11'),_0x4ebea9,_0x2a54da[_0x6839('0x16')]['message']);return _0x3554a0(_0x2a54da[_0x6839('0x16')]['message']);}else{logger[_0x6839('0x10')](_0x6839('0x11'),_0x4ebea9,_0x6839('0x12'));_0x3554a0(_0x2a54da[_0x6839('0x19')][_0x6839('0x18')]);}})[_0x6839('0x1a')](function(_0x229697){logger[_0x6839('0x16')](_0x6839('0x11'),_0x4ebea9,_0x229697);_0x50eeef(_0x229697);});});}exports['GetVoiceQueueRtPauses']=function(_0x38f4e6){var _0x25054f=this;return new Promise(function(_0x3280f7,_0x747ac6){return db['UserVoiceQueueRt'][_0x6839('0x1b')]({'raw':_0x38f4e6[_0x6839('0x1c')]?_0x38f4e6[_0x6839('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x38f4e6[_0x6839('0x1c')]?_0x38f4e6['options'][_0x6839('0x1d')]||null:null,'attributes':[[db[_0x6839('0x1e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x6839('0x1e')][_0x6839('0x1f')](_0x6839('0x20')))),_0x6839('0x21')]]})['then'](function(_0x2cc4c5){logger[_0x6839('0x10')](_0x6839('0x22'),_0x38f4e6);logger[_0x6839('0x13')]('GetVoiceQueueRtPauses',_0x38f4e6,JSON['stringify'](_0x2cc4c5));_0x3280f7(_0x2cc4c5);})[_0x6839('0x1a')](function(_0x551677){logger[_0x6839('0x16')](_0x6839('0x22'),_0x551677['message'],_0x38f4e6);_0x747ac6(_0x25054f[_0x6839('0x16')](0x1f4,_0x551677[_0x6839('0x18')]));});});}; \ No newline at end of file +var _0x1306=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','then','UserVoiceQueueRt,\x20%s,\x20%s','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','COUNT','sequelize','outboundQueuePauses','debug','util','randomstring'];(function(_0x262a2a,_0x33aaca){var _0x4cc510=function(_0x49a596){while(--_0x49a596){_0x262a2a['push'](_0x262a2a['shift']());}};_0x4cc510(++_0x33aaca);}(_0x1306,0xca));var _0x6130=function(_0x3b986d,_0x29d2c0){_0x3b986d=_0x3b986d-0x0;var _0x1fdc8e=_0x1306[_0x3b986d];return _0x1fdc8e;};'use strict';var _=require('lodash');var util=require(_0x6130('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6130('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6130('0x2'))['db'];var utils=require(_0x6130('0x3'));var logger=require(_0x6130('0x4'))(_0x6130('0x5'));var config=require(_0x6130('0x6'));var jayson=require(_0x6130('0x7'));var client=jayson[_0x6130('0x8')][_0x6130('0x9')]({'port':0x232a});config[_0x6130('0xa')]=_[_0x6130('0xb')](config[_0x6130('0xa')],{'host':_0x6130('0xc'),'port':0x18eb});var socket=require(_0x6130('0xd'))(new Redis(config[_0x6130('0xa')]));require(_0x6130('0xe'))[_0x6130('0xf')](socket);function respondWithRpcPromise(_0x588f0f,_0x5d7a30,_0x5148df){return new BPromise(function(_0x2e1f73,_0xfcfbb5){return client['request'](_0x588f0f,_0x5148df)[_0x6130('0x10')](function(_0x3c5daf){logger['info'](_0x6130('0x11'),_0x5d7a30,'request\x20sent');logger['debug'](_0x6130('0x12'),_0x5d7a30,'request\x20sent',JSON[_0x6130('0x13')](_0x3c5daf));if(_0x3c5daf['error']){if(_0x3c5daf[_0x6130('0x14')]['code']===0x1f4){logger[_0x6130('0x14')](_0x6130('0x11'),_0x5d7a30,_0x3c5daf[_0x6130('0x14')]['message']);return _0xfcfbb5(_0x3c5daf[_0x6130('0x14')][_0x6130('0x15')]);}logger[_0x6130('0x14')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x5d7a30,_0x3c5daf[_0x6130('0x14')][_0x6130('0x15')]);return _0x2e1f73(_0x3c5daf[_0x6130('0x14')][_0x6130('0x15')]);}else{logger['info'](_0x6130('0x11'),_0x5d7a30,_0x6130('0x16'));_0x2e1f73(_0x3c5daf['result']['message']);}})[_0x6130('0x17')](function(_0x17345f){logger[_0x6130('0x14')](_0x6130('0x11'),_0x5d7a30,_0x17345f);_0xfcfbb5(_0x17345f);});});}exports[_0x6130('0x18')]=function(_0xdac80c){var _0xe98470=this;return new Promise(function(_0x2979c0,_0x11455d){return db[_0x6130('0x19')][_0x6130('0x1a')]({'raw':_0xdac80c[_0x6130('0x1b')]?_0xdac80c[_0x6130('0x1b')][_0x6130('0x1c')]===undefined?!![]:![]:!![],'where':_0xdac80c['options']?_0xdac80c['options'][_0x6130('0x1d')]||null:null,'attributes':[[db['sequelize']['fn'](_0x6130('0x1e'),db[_0x6130('0x1f')]['fn']('IF',db[_0x6130('0x1f')]['literal']('`paused`\x20=\x201,\x201,\x20null'))),_0x6130('0x20')]]})[_0x6130('0x10')](function(_0x17ef5c){logger['info'](_0x6130('0x18'),_0xdac80c);logger[_0x6130('0x21')](_0x6130('0x18'),_0xdac80c,JSON['stringify'](_0x17ef5c));_0x2979c0(_0x17ef5c);})[_0x6130('0x17')](function(_0x33582a){logger[_0x6130('0x14')]('GetVoiceQueueRtPauses',_0x33582a[_0x6130('0x15')],_0xdac80c);_0x11455d(_0xe98470[_0x6130('0x14')](0x1f4,_0x33582a['message']));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index cbb8e8b..8971e08 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 _0x22dd=['emit','removeListener','register','./userVoiceQueueRt.events','save','remove','update'];(function(_0xb6ec75,_0xa415c3){var _0x5bbc02=function(_0x1489bb){while(--_0x1489bb){_0xb6ec75['push'](_0xb6ec75['shift']());}};_0x5bbc02(++_0xa415c3);}(_0x22dd,0xb2));var _0xd22d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x22dd[_0x3dd15e];return _0x231fd0;};'use strict';var UserVoiceQueueRtEvents=require(_0xd22d('0x0'));var events=[_0xd22d('0x1'),_0xd22d('0x2'),_0xd22d('0x3')];function createListener(_0x251f51,_0x35920b){return function(_0x15eca9){_0x35920b[_0xd22d('0x4')](_0x251f51,_0x15eca9);};}function removeListener(_0x31c79f,_0x5aae2b){return function(){UserVoiceQueueRtEvents[_0xd22d('0x5')](_0x31c79f,_0x5aae2b);};}exports[_0xd22d('0x6')]=function(_0x16501){for(var _0x4b7bc6=0x0,_0x2250b8=events['length'];_0x4b7bc6<_0x2250b8;_0x4b7bc6++){var _0x52e5ba=events[_0x4b7bc6];var _0x2243cf=createListener('userVoiceQueueRt:'+_0x52e5ba,_0x16501);UserVoiceQueueRtEvents['on'](_0x52e5ba,_0x2243cf);}}; \ No newline at end of file +var _0xbbda=['./userVoiceQueueRt.events','save','remove','update','register','length'];(function(_0x1915e5,_0xe53420){var _0x148dd0=function(_0x5b51cc){while(--_0x5b51cc){_0x1915e5['push'](_0x1915e5['shift']());}};_0x148dd0(++_0xe53420);}(_0xbbda,0x1c2));var _0xabbd=function(_0x5e9c74,_0x27ed40){_0x5e9c74=_0x5e9c74-0x0;var _0x27d390=_0xbbda[_0x5e9c74];return _0x27d390;};'use strict';var UserVoiceQueueRtEvents=require(_0xabbd('0x0'));var events=[_0xabbd('0x1'),_0xabbd('0x2'),_0xabbd('0x3')];function createListener(_0x5b68b8,_0x334bd0){return function(_0xdf8538){_0x334bd0['emit'](_0x5b68b8,_0xdf8538);};}function removeListener(_0x2f8a03,_0x3e2b34){return function(){UserVoiceQueueRtEvents['removeListener'](_0x2f8a03,_0x3e2b34);};}exports[_0xabbd('0x4')]=function(_0x2c67a2){for(var _0x4d47b9=0x0,_0x39da04=events[_0xabbd('0x5')];_0x4d47b9<_0x39da04;_0x4d47b9++){var _0x22bf12=events[_0x4d47b9];var _0x276e96=createListener('userVoiceQueueRt:'+_0x22bf12,_0x2c67a2);UserVoiceQueueRtEvents['on'](_0x22bf12,_0x276e96);}}; \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index e21f079..59c9716 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 _0x5270=['/:id','isAuthenticated','show','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./variable.controller','get','index'];(function(_0x409fb8,_0x5ab3d3){var _0x278270=function(_0x58849c){while(--_0x58849c){_0x409fb8['push'](_0x409fb8['shift']());}};_0x278270(++_0x5ab3d3);}(_0x5270,0x1dc));var _0x0527=function(_0x286813,_0x5a8540){_0x286813=_0x286813-0x0;var _0x24cead=_0x5270[_0x286813];return _0x24cead;};'use strict';var multer=require(_0x0527('0x0'));var util=require(_0x0527('0x1'));var path=require(_0x0527('0x2'));var timeout=require(_0x0527('0x3'));var express=require(_0x0527('0x4'));var router=express['Router']();var auth=require(_0x0527('0x5'));var interaction=require(_0x0527('0x6'));var config=require('../../config/environment');var controller=require(_0x0527('0x7'));router[_0x0527('0x8')]('/',auth['isAuthenticated'](),controller[_0x0527('0x9')]);router['get'](_0x0527('0xa'),auth[_0x0527('0xb')](),controller[_0x0527('0xc')]);router['post']('/',auth[_0x0527('0xb')](),controller[_0x0527('0xd')]);router['put'](_0x0527('0xa'),auth['isAuthenticated'](),controller[_0x0527('0xe')]);router[_0x0527('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x0527('0x10')]);module[_0x0527('0x11')]=router; \ No newline at end of file +var _0x3c22=['connect-timeout','Router','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','show','post','put','delete','/:id','destroy','exports','multer','util','path'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3c22,0x12f));var _0x23c2=function(_0xd2af66,_0x420113){_0xd2af66=_0xd2af66-0x0;var _0x28afda=_0x3c22[_0xd2af66];return _0x28afda;};'use strict';var multer=require(_0x23c2('0x0'));var util=require(_0x23c2('0x1'));var path=require(_0x23c2('0x2'));var timeout=require(_0x23c2('0x3'));var express=require('express');var router=express[_0x23c2('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x23c2('0x5'));var config=require(_0x23c2('0x6'));var controller=require(_0x23c2('0x7'));router[_0x23c2('0x8')]('/',auth[_0x23c2('0x9')](),controller['index']);router[_0x23c2('0x8')]('/:id',auth[_0x23c2('0x9')](),controller[_0x23c2('0xa')]);router[_0x23c2('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x23c2('0xc')]('/:id',auth[_0x23c2('0x9')](),controller['update']);router[_0x23c2('0xd')](_0x23c2('0xe'),auth[_0x23c2('0x9')](),controller[_0x23c2('0xf')]);module[_0x23c2('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 fa8fa8e..6daae42 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. * // * * // ************************************************************************* -'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xacf1=['sequelize','STRING'];(function(_0x269ee8,_0x477226){var _0x4d98bd=function(_0x20d4c4){while(--_0x20d4c4){_0x269ee8['push'](_0x269ee8['shift']());}};_0x4d98bd(++_0x477226);}(_0xacf1,0x158));var _0x1acf=function(_0x51281e,_0x42cc6d){_0x51281e=_0x51281e-0x0;var _0xb6bf08=_0xacf1[_0x51281e];return _0xb6bf08;};'use strict';var Sequelize=require(_0x1acf('0x0'));module['exports']={'name':{'type':Sequelize[_0x1acf('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 9976827..453618b 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 _0x7096=['merge','type','VIRTUAL','field','options','where','count','findAll','show','rawAttributes','includeAll','include','find','create','body','user','role','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','limit','status','Content-Range','apply','reject','save','update','then','destroy','get','Variables','UserProfileResource','stack','name','index','Variable','fieldName','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','offset','order','sort','pick','filter'];(function(_0x1c0223,_0x35a425){var _0x167903=function(_0x54fb3d){while(--_0x54fb3d){_0x1c0223['push'](_0x1c0223['shift']());}};_0x167903(++_0x35a425);}(_0x7096,0x10c));var _0x6709=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0x7096[_0xbb091];return _0x467a04;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6709('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6709('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6709('0x2'));var moment=require(_0x6709('0x3'));var BPromise=require(_0x6709('0x4'));var Mustache=require(_0x6709('0x5'));var util=require(_0x6709('0x6'));var path=require(_0x6709('0x7'));var sox=require(_0x6709('0x8'));var csv=require(_0x6709('0x9'));var ejs=require(_0x6709('0xa'));var fs=require('fs');var _=require(_0x6709('0xb'));var squel=require(_0x6709('0xc'));var crypto=require(_0x6709('0xd'));var jsforce=require(_0x6709('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6709('0xf'));var Papa=require(_0x6709('0x10'));var Redis=require(_0x6709('0x11'));var authService=require(_0x6709('0x12'));var qs=require(_0x6709('0x13'));var as=require(_0x6709('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6709('0x15'));var utils=require(_0x6709('0x16'));var config=require(_0x6709('0x17'));var db=require(_0x6709('0x18'))['db'];function respondWithStatusCode(_0x31ac88,_0x288f51){_0x288f51=_0x288f51||0xcc;return function(_0x1d56a5){if(_0x1d56a5){return _0x31ac88[_0x6709('0x19')](_0x288f51);}return _0x31ac88['status'](_0x288f51)[_0x6709('0x1a')]();};}function respondWithResult(_0xf59b6e,_0x4d5255){_0x4d5255=_0x4d5255||0xc8;return function(_0x3706e1){if(_0x3706e1){return _0xf59b6e['status'](_0x4d5255)[_0x6709('0x1b')](_0x3706e1);}};}function respondWithFilteredResult(_0x5c667c,_0x41af1f){return function(_0x4bc059){if(_0x4bc059){var _0x149233=_0x4bc059['count'],_0x28866a=_0x41af1f['offset'],_0x95c0c2=_0x41af1f['offset']+_0x41af1f[_0x6709('0x1c')],_0x3d5c28;if(_0x95c0c2>=_0x149233){_0x95c0c2=_0x149233;_0x3d5c28=0xc8;}else{_0x3d5c28=0xce;}_0x5c667c[_0x6709('0x1d')](_0x3d5c28);return _0x5c667c['set'](_0x6709('0x1e'),_0x28866a+'-'+_0x95c0c2+'/'+_0x149233)[_0x6709('0x1b')](_0x4bc059);}return null;};}function patchUpdates(_0xf1a70d){return function(_0x5a3263){try{jsonpatch[_0x6709('0x1f')](_0x5a3263,_0xf1a70d,!![]);}catch(_0x19b193){return BPromise[_0x6709('0x20')](_0x19b193);}return _0x5a3263[_0x6709('0x21')]();};}function saveUpdates(_0x5485d7,_0x3c4971){return function(_0x1edac3){if(_0x1edac3){return _0x1edac3[_0x6709('0x22')](_0x5485d7)[_0x6709('0x23')](function(_0x78f61a){return _0x78f61a;});}return null;};}function removeEntity(_0x224e8a,_0x45921e){return function(_0x17763d){if(_0x17763d){return _0x17763d[_0x6709('0x24')]()[_0x6709('0x23')](function(){var _0x2f3415=_0x17763d[_0x6709('0x25')]({'plain':!![]});var _0x5cf48b=_0x6709('0x26');return db[_0x6709('0x27')][_0x6709('0x24')]({'where':{'type':_0x5cf48b,'resourceId':_0x2f3415['id']}})['then'](function(){return _0x17763d;});})[_0x6709('0x23')](function(){_0x224e8a[_0x6709('0x1d')](0xcc)[_0x6709('0x1a')]();});}};}function handleEntityNotFound(_0x44b465,_0x588e00){return function(_0x241428){if(!_0x241428){_0x44b465[_0x6709('0x19')](0x194);}return _0x241428;};}function handleError(_0x50f7d6,_0x585073){_0x585073=_0x585073||0x1f4;return function(_0x39f6a9){logger['error'](_0x39f6a9[_0x6709('0x28')]);if(_0x39f6a9[_0x6709('0x29')]){delete _0x39f6a9['name'];}_0x50f7d6[_0x6709('0x1d')](_0x585073)['send'](_0x39f6a9);};}exports[_0x6709('0x2a')]=function(_0x3cd555,_0x5b6906){var _0x137137={},_0x4e6989={},_0xe066d8={'count':0x0,'rows':[]};var _0x388aee=_['map'](db[_0x6709('0x2b')]['rawAttributes'],function(_0x138318){return{'name':_0x138318[_0x6709('0x2c')],'type':_0x138318['type']['key']};});_0x4e6989[_0x6709('0x2d')]=_[_0x6709('0x2e')](_0x388aee,_0x6709('0x29'));_0x4e6989[_0x6709('0x2f')]=_[_0x6709('0x30')](_0x3cd555[_0x6709('0x2f')]);_0x4e6989[_0x6709('0x31')]=_[_0x6709('0x32')](_0x4e6989[_0x6709('0x2d')],_0x4e6989['query']);_0x137137[_0x6709('0x33')]=_[_0x6709('0x32')](_0x4e6989[_0x6709('0x2d')],qs[_0x6709('0x34')](_0x3cd555['query'][_0x6709('0x34')]));_0x137137[_0x6709('0x33')]=_0x137137[_0x6709('0x33')][_0x6709('0x35')]?_0x137137['attributes']:_0x4e6989[_0x6709('0x2d')];if(!_0x3cd555[_0x6709('0x2f')]['hasOwnProperty'](_0x6709('0x36'))){_0x137137[_0x6709('0x1c')]=qs['limit'](_0x3cd555[_0x6709('0x2f')][_0x6709('0x1c')]);_0x137137[_0x6709('0x37')]=qs[_0x6709('0x37')](_0x3cd555[_0x6709('0x2f')][_0x6709('0x37')]);}_0x137137[_0x6709('0x38')]=qs['sort'](_0x3cd555[_0x6709('0x2f')][_0x6709('0x39')]);_0x137137['where']=qs[_0x6709('0x31')](_[_0x6709('0x3a')](_0x3cd555[_0x6709('0x2f')],_0x4e6989[_0x6709('0x31')]));if(_0x3cd555[_0x6709('0x2f')][_0x6709('0x3b')]){_0x137137['where']=_[_0x6709('0x3c')](_0x137137['where'],{'$or':_[_0x6709('0x2e')](_0x388aee,function(_0xbb7a64){if(_0xbb7a64[_0x6709('0x3d')]['key']!==_0x6709('0x3e')){var _0x300c5b={};_0x300c5b[_0xbb7a64[_0x6709('0x3f')]]={'$like':'%'+_0x3cd555[_0x6709('0x2f')][_0x6709('0x3b')]+'%'};return _0x300c5b;}})});}_0x137137=_[_0x6709('0x3c')]({},_0x137137,_0x3cd555[_0x6709('0x40')]);var _0x4fd4af={'where':_0x137137[_0x6709('0x41')]};return db[_0x6709('0x2b')][_0x6709('0x42')](_0x4fd4af)[_0x6709('0x23')](function(_0xe80008){_0xe066d8[_0x6709('0x42')]=_0xe80008;if(_0x3cd555[_0x6709('0x2f')]['includeAll']){_0x137137['include']=[{'all':!![]}];}return db[_0x6709('0x2b')][_0x6709('0x43')](_0x137137);})[_0x6709('0x23')](function(_0x42790d){_0xe066d8['rows']=_0x42790d;return _0xe066d8;})['then'](respondWithFilteredResult(_0x5b6906,_0x137137))['catch'](handleError(_0x5b6906,null));};exports[_0x6709('0x44')]=function(_0x293577,_0x54f74e){var _0x139f08={'raw':!![],'where':{'id':_0x293577['params']['id']}},_0x2ab80f={};_0x2ab80f['model']=_[_0x6709('0x30')](db[_0x6709('0x2b')][_0x6709('0x45')]);_0x2ab80f[_0x6709('0x2f')]=_[_0x6709('0x30')](_0x293577['query']);_0x2ab80f[_0x6709('0x31')]=_['intersection'](_0x2ab80f[_0x6709('0x2d')],_0x2ab80f[_0x6709('0x2f')]);_0x139f08[_0x6709('0x33')]=_['intersection'](_0x2ab80f[_0x6709('0x2d')],qs['fields'](_0x293577['query'][_0x6709('0x34')]));_0x139f08[_0x6709('0x33')]=_0x139f08[_0x6709('0x33')][_0x6709('0x35')]?_0x139f08[_0x6709('0x33')]:_0x2ab80f[_0x6709('0x2d')];if(_0x293577[_0x6709('0x2f')][_0x6709('0x46')]){_0x139f08[_0x6709('0x47')]=[{'all':!![]}];}_0x139f08=_[_0x6709('0x3c')]({},_0x139f08,_0x293577[_0x6709('0x40')]);return db[_0x6709('0x2b')][_0x6709('0x48')](_0x139f08)[_0x6709('0x23')](handleEntityNotFound(_0x54f74e,null))[_0x6709('0x23')](respondWithResult(_0x54f74e,null))['catch'](handleError(_0x54f74e,null));};exports[_0x6709('0x49')]=function(_0x4d841a,_0x5d286f){return db[_0x6709('0x2b')][_0x6709('0x49')](_0x4d841a[_0x6709('0x4a')],{})[_0x6709('0x23')](function(_0x22363b){var _0x2b05dc=_0x4d841a[_0x6709('0x4b')][_0x6709('0x25')]({'plain':!![]});if(!_0x2b05dc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2b05dc[_0x6709('0x4c')]===_0x6709('0x4b')){var _0x26d5fe=_0x22363b[_0x6709('0x25')]({'plain':!![]});var _0x4c01e3=_0x6709('0x26');return db['UserProfileSection'][_0x6709('0x48')]({'where':{'name':_0x4c01e3,'userProfileId':_0x2b05dc[_0x6709('0x4d')]},'raw':!![]})[_0x6709('0x23')](function(_0xb257b5){if(_0xb257b5&&_0xb257b5[_0x6709('0x4e')]===0x0){return db['UserProfileResource'][_0x6709('0x49')]({'name':_0x26d5fe[_0x6709('0x29')],'resourceId':_0x26d5fe['id'],'type':_0xb257b5[_0x6709('0x29')],'sectionId':_0xb257b5['id']},{})[_0x6709('0x23')](function(){return _0x22363b;});}else{return _0x22363b;}})[_0x6709('0x4f')](function(_0x55188c){logger['error'](_0x6709('0x50'),_0x55188c);throw _0x55188c;});}return _0x22363b;})['then'](respondWithResult(_0x5d286f,0xc9))['catch'](handleError(_0x5d286f,null));};exports[_0x6709('0x22')]=function(_0x437910,_0x1bf824){if(_0x437910[_0x6709('0x4a')]['id']){delete _0x437910[_0x6709('0x4a')]['id'];}return db[_0x6709('0x2b')][_0x6709('0x48')]({'where':{'id':_0x437910[_0x6709('0x51')]['id']}})[_0x6709('0x23')](handleEntityNotFound(_0x1bf824,null))[_0x6709('0x23')](saveUpdates(_0x437910[_0x6709('0x4a')],null))['then'](respondWithResult(_0x1bf824,null))[_0x6709('0x4f')](handleError(_0x1bf824,null));};exports[_0x6709('0x24')]=function(_0x5ea29f,_0x4bec85){return db[_0x6709('0x2b')][_0x6709('0x48')]({'where':{'id':_0x5ea29f[_0x6709('0x51')]['id']}})[_0x6709('0x23')](handleEntityNotFound(_0x4bec85,null))['then'](removeEntity(_0x4bec85,null))[_0x6709('0x4f')](handleError(_0x4bec85,null));}; \ No newline at end of file +var _0x553a=['filter','merge','key','VIRTUAL','options','includeAll','include','findAll','rows','keys','length','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Variables','UserProfileSection','userProfileId','error','params','eml-format','zip-dir','fast-json-patch','request-promise','mustache','sox','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','update','destroy','get','UserProfileResource','then','stack','name','send','index','map','Variable','rawAttributes','fieldName','type','model','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick'];(function(_0x48102e,_0x39923f){var _0x45e75d=function(_0x25b289){while(--_0x25b289){_0x48102e['push'](_0x48102e['shift']());}};_0x45e75d(++_0x39923f);}(_0x553a,0x192));var _0xa553=function(_0x4acfd2,_0x5b9374){_0x4acfd2=_0x4acfd2-0x0;var _0x12afbe=_0x553a[_0x4acfd2];return _0x12afbe;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa553('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa553('0x1'));var jsonpatch=require(_0xa553('0x2'));var rp=require(_0xa553('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa553('0x4'));var util=require('util');var path=require('path');var sox=require(_0xa553('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xa553('0x6'));var squel=require(_0xa553('0x7'));var crypto=require(_0xa553('0x8'));var jsforce=require('jsforce');var deskjs=require(_0xa553('0x9'));var toCsv=require('to-csv');var querystring=require(_0xa553('0xa'));var Papa=require(_0xa553('0xb'));var Redis=require(_0xa553('0xc'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa553('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa553('0xe'))(_0xa553('0xf'));var utils=require(_0xa553('0x10'));var config=require('../../config/environment');var db=require(_0xa553('0x11'))['db'];function respondWithStatusCode(_0x14b606,_0x1c911f){_0x1c911f=_0x1c911f||0xcc;return function(_0x4de7da){if(_0x4de7da){return _0x14b606[_0xa553('0x12')](_0x1c911f);}return _0x14b606[_0xa553('0x13')](_0x1c911f)[_0xa553('0x14')]();};}function respondWithResult(_0x51df32,_0x5906ab){_0x5906ab=_0x5906ab||0xc8;return function(_0x15b224){if(_0x15b224){return _0x51df32[_0xa553('0x13')](_0x5906ab)[_0xa553('0x15')](_0x15b224);}};}function respondWithFilteredResult(_0x37dd93,_0x56b80c){return function(_0x35cf13){if(_0x35cf13){var _0x5207c7=_0x35cf13[_0xa553('0x16')],_0xaedbbc=_0x56b80c['offset'],_0x5a1270=_0x56b80c[_0xa553('0x17')]+_0x56b80c[_0xa553('0x18')],_0x509342;if(_0x5a1270>=_0x5207c7){_0x5a1270=_0x5207c7;_0x509342=0xc8;}else{_0x509342=0xce;}_0x37dd93[_0xa553('0x13')](_0x509342);return _0x37dd93['set'](_0xa553('0x19'),_0xaedbbc+'-'+_0x5a1270+'/'+_0x5207c7)[_0xa553('0x15')](_0x35cf13);}return null;};}function patchUpdates(_0x4fd13a){return function(_0x3e95d3){try{jsonpatch[_0xa553('0x1a')](_0x3e95d3,_0x4fd13a,!![]);}catch(_0x48f071){return BPromise[_0xa553('0x1b')](_0x48f071);}return _0x3e95d3['save']();};}function saveUpdates(_0x309eb7,_0x18af22){return function(_0x9be74f){if(_0x9be74f){return _0x9be74f[_0xa553('0x1c')](_0x309eb7)['then'](function(_0x3cbbe8){return _0x3cbbe8;});}return null;};}function removeEntity(_0x250ead,_0x137778){return function(_0x4dc781){if(_0x4dc781){return _0x4dc781[_0xa553('0x1d')]()['then'](function(){var _0x4d57e4=_0x4dc781[_0xa553('0x1e')]({'plain':!![]});var _0x3c1011='Variables';return db[_0xa553('0x1f')][_0xa553('0x1d')]({'where':{'type':_0x3c1011,'resourceId':_0x4d57e4['id']}})[_0xa553('0x20')](function(){return _0x4dc781;});})['then'](function(){_0x250ead[_0xa553('0x13')](0xcc)[_0xa553('0x14')]();});}};}function handleEntityNotFound(_0x22744c,_0x7b0d73){return function(_0x247ce3){if(!_0x247ce3){_0x22744c[_0xa553('0x12')](0x194);}return _0x247ce3;};}function handleError(_0x1a4bab,_0x10c08b){_0x10c08b=_0x10c08b||0x1f4;return function(_0x5a42f7){logger['error'](_0x5a42f7[_0xa553('0x21')]);if(_0x5a42f7[_0xa553('0x22')]){delete _0x5a42f7[_0xa553('0x22')];}_0x1a4bab[_0xa553('0x13')](_0x10c08b)[_0xa553('0x23')](_0x5a42f7);};}exports[_0xa553('0x24')]=function(_0x3fe657,_0x4ca838){var _0x3c029d={},_0x1a11b0={},_0x345fef={'count':0x0,'rows':[]};var _0x3b515c=_[_0xa553('0x25')](db[_0xa553('0x26')][_0xa553('0x27')],function(_0x2325a5){return{'name':_0x2325a5[_0xa553('0x28')],'type':_0x2325a5[_0xa553('0x29')]['key']};});_0x1a11b0[_0xa553('0x2a')]=_['map'](_0x3b515c,_0xa553('0x22'));_0x1a11b0['query']=_['keys'](_0x3fe657['query']);_0x1a11b0['filters']=_[_0xa553('0x2b')](_0x1a11b0[_0xa553('0x2a')],_0x1a11b0[_0xa553('0x2c')]);_0x3c029d[_0xa553('0x2d')]=_[_0xa553('0x2b')](_0x1a11b0['model'],qs[_0xa553('0x2e')](_0x3fe657['query'][_0xa553('0x2e')]));_0x3c029d[_0xa553('0x2d')]=_0x3c029d['attributes']['length']?_0x3c029d[_0xa553('0x2d')]:_0x1a11b0[_0xa553('0x2a')];if(!_0x3fe657[_0xa553('0x2c')][_0xa553('0x2f')](_0xa553('0x30'))){_0x3c029d[_0xa553('0x18')]=qs['limit'](_0x3fe657['query'][_0xa553('0x18')]);_0x3c029d['offset']=qs['offset'](_0x3fe657[_0xa553('0x2c')][_0xa553('0x17')]);}_0x3c029d[_0xa553('0x31')]=qs[_0xa553('0x32')](_0x3fe657[_0xa553('0x2c')][_0xa553('0x32')]);_0x3c029d[_0xa553('0x33')]=qs[_0xa553('0x34')](_[_0xa553('0x35')](_0x3fe657[_0xa553('0x2c')],_0x1a11b0[_0xa553('0x34')]));if(_0x3fe657[_0xa553('0x2c')][_0xa553('0x36')]){_0x3c029d[_0xa553('0x33')]=_[_0xa553('0x37')](_0x3c029d[_0xa553('0x33')],{'$or':_[_0xa553('0x25')](_0x3b515c,function(_0x467eae){if(_0x467eae[_0xa553('0x29')][_0xa553('0x38')]!==_0xa553('0x39')){var _0x442c79={};_0x442c79[_0x467eae['field']]={'$like':'%'+_0x3fe657[_0xa553('0x2c')][_0xa553('0x36')]+'%'};return _0x442c79;}})});}_0x3c029d=_[_0xa553('0x37')]({},_0x3c029d,_0x3fe657[_0xa553('0x3a')]);var _0x2acf87={'where':_0x3c029d[_0xa553('0x33')]};return db['Variable'][_0xa553('0x16')](_0x2acf87)['then'](function(_0x427eb0){_0x345fef[_0xa553('0x16')]=_0x427eb0;if(_0x3fe657[_0xa553('0x2c')][_0xa553('0x3b')]){_0x3c029d[_0xa553('0x3c')]=[{'all':!![]}];}return db[_0xa553('0x26')][_0xa553('0x3d')](_0x3c029d);})[_0xa553('0x20')](function(_0x41646f){_0x345fef[_0xa553('0x3e')]=_0x41646f;return _0x345fef;})[_0xa553('0x20')](respondWithFilteredResult(_0x4ca838,_0x3c029d))['catch'](handleError(_0x4ca838,null));};exports['show']=function(_0x30c332,_0x503a9d){var _0x1a9d97={'raw':!![],'where':{'id':_0x30c332['params']['id']}},_0x4786f0={};_0x4786f0[_0xa553('0x2a')]=_[_0xa553('0x3f')](db['Variable'][_0xa553('0x27')]);_0x4786f0[_0xa553('0x2c')]=_['keys'](_0x30c332[_0xa553('0x2c')]);_0x4786f0[_0xa553('0x34')]=_['intersection'](_0x4786f0[_0xa553('0x2a')],_0x4786f0[_0xa553('0x2c')]);_0x1a9d97[_0xa553('0x2d')]=_[_0xa553('0x2b')](_0x4786f0['model'],qs[_0xa553('0x2e')](_0x30c332[_0xa553('0x2c')][_0xa553('0x2e')]));_0x1a9d97['attributes']=_0x1a9d97[_0xa553('0x2d')][_0xa553('0x40')]?_0x1a9d97[_0xa553('0x2d')]:_0x4786f0[_0xa553('0x2a')];if(_0x30c332[_0xa553('0x2c')][_0xa553('0x3b')]){_0x1a9d97['include']=[{'all':!![]}];}_0x1a9d97=_['merge']({},_0x1a9d97,_0x30c332[_0xa553('0x3a')]);return db[_0xa553('0x26')][_0xa553('0x41')](_0x1a9d97)[_0xa553('0x20')](handleEntityNotFound(_0x503a9d,null))[_0xa553('0x20')](respondWithResult(_0x503a9d,null))[_0xa553('0x42')](handleError(_0x503a9d,null));};exports[_0xa553('0x43')]=function(_0x41cad1,_0x567577){return db[_0xa553('0x26')][_0xa553('0x43')](_0x41cad1[_0xa553('0x44')],{})[_0xa553('0x20')](function(_0x1a31b1){var _0xb8aa57=_0x41cad1[_0xa553('0x45')][_0xa553('0x1e')]({'plain':!![]});if(!_0xb8aa57)throw new Error(_0xa553('0x46'));if(_0xb8aa57['role']===_0xa553('0x45')){var _0x1d4678=_0x1a31b1['get']({'plain':!![]});var _0x3eceec=_0xa553('0x47');return db[_0xa553('0x48')]['find']({'where':{'name':_0x3eceec,'userProfileId':_0xb8aa57[_0xa553('0x49')]},'raw':!![]})[_0xa553('0x20')](function(_0x359a4a){if(_0x359a4a&&_0x359a4a['autoAssociation']===0x0){return db[_0xa553('0x1f')][_0xa553('0x43')]({'name':_0x1d4678[_0xa553('0x22')],'resourceId':_0x1d4678['id'],'type':_0x359a4a[_0xa553('0x22')],'sectionId':_0x359a4a['id']},{})[_0xa553('0x20')](function(){return _0x1a31b1;});}else{return _0x1a31b1;}})[_0xa553('0x42')](function(_0x4a463f){logger[_0xa553('0x4a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4a463f);throw _0x4a463f;});}return _0x1a31b1;})['then'](respondWithResult(_0x567577,0xc9))[_0xa553('0x42')](handleError(_0x567577,null));};exports['update']=function(_0xabb183,_0x39bb40){if(_0xabb183[_0xa553('0x44')]['id']){delete _0xabb183[_0xa553('0x44')]['id'];}return db[_0xa553('0x26')][_0xa553('0x41')]({'where':{'id':_0xabb183[_0xa553('0x4b')]['id']}})[_0xa553('0x20')](handleEntityNotFound(_0x39bb40,null))['then'](saveUpdates(_0xabb183[_0xa553('0x44')],null))[_0xa553('0x20')](respondWithResult(_0x39bb40,null))[_0xa553('0x42')](handleError(_0x39bb40,null));};exports[_0xa553('0x1d')]=function(_0x1a703f,_0x407930){return db[_0xa553('0x26')][_0xa553('0x41')]({'where':{'id':_0x1a703f[_0xa553('0x4b')]['id']}})['then'](handleEntityNotFound(_0x407930,null))['then'](removeEntity(_0x407930,null))[_0xa553('0x42')](handleError(_0x407930,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index a427fd6..a64012f 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 _0xec56=['define','Variable','tools_variables','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./variable.attributes','exports'];(function(_0x15cb37,_0x88ac71){var _0x216f1d=function(_0x54e99c){while(--_0x54e99c){_0x15cb37['push'](_0x15cb37['shift']());}};_0x216f1d(++_0x88ac71);}(_0xec56,0x1bd));var _0x6ec5=function(_0xcd853d,_0x3d9535){_0xcd853d=_0xcd853d-0x0;var _0x1030b8=_0xec56[_0xcd853d];return _0x1030b8;};'use strict';var _=require(_0x6ec5('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6ec5('0x1'));var moment=require(_0x6ec5('0x2'));var BPromise=require(_0x6ec5('0x3'));var rp=require(_0x6ec5('0x4'));var fs=require('fs');var path=require(_0x6ec5('0x5'));var rimraf=require(_0x6ec5('0x6'));var config=require(_0x6ec5('0x7'));var attributes=require(_0x6ec5('0x8'));module[_0x6ec5('0x9')]=function(_0x28b12b,_0x2d0a93){return _0x28b12b[_0x6ec5('0xa')](_0x6ec5('0xb'),attributes,{'tableName':_0x6ec5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x16d2=['api','moment','bluebird','request-promise','path','rimraf','./variable.attributes','exports','define','Variable','tools_variables','lodash','util','../../config/logger'];(function(_0x11b3bf,_0xca12c){var _0x2eeb8b=function(_0x47a388){while(--_0x47a388){_0x11b3bf['push'](_0x11b3bf['shift']());}};_0x2eeb8b(++_0xca12c);}(_0x16d2,0x123));var _0x216d=function(_0x23f075,_0x16d3bd){_0x23f075=_0x23f075-0x0;var _0xcdaf76=_0x16d2[_0x23f075];return _0xcdaf76;};'use strict';var _=require(_0x216d('0x0'));var util=require(_0x216d('0x1'));var logger=require(_0x216d('0x2'))(_0x216d('0x3'));var moment=require(_0x216d('0x4'));var BPromise=require(_0x216d('0x5'));var rp=require(_0x216d('0x6'));var fs=require('fs');var path=require(_0x216d('0x7'));var rimraf=require(_0x216d('0x8'));var config=require('../../config/environment');var attributes=require(_0x216d('0x9'));module[_0x216d('0xa')]=function(_0xef687c,_0x205101){return _0xef687c[_0x216d('0xb')](_0x216d('0xc'),attributes,{'tableName':_0x216d('0xd'),'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 5ae6c97..de0cd09 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 _0x4484=['http','info','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Variable,\x20%s,\x20%s','catch','ShowVariable','find','options','raw','include','map','model','attributes','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x4484,0x13f));var _0x4448=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4484[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4448('0x0'));var util=require(_0x4448('0x1'));var moment=require('moment');var BPromise=require(_0x4448('0x2'));var rs=require(_0x4448('0x3'));var fs=require('fs');var Redis=require(_0x4448('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4448('0x5'));var logger=require(_0x4448('0x6'))(_0x4448('0x7'));var config=require(_0x4448('0x8'));var jayson=require(_0x4448('0x9'));var client=jayson[_0x4448('0xa')][_0x4448('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x276a1d,_0x5e1500,_0x3980a9){return new BPromise(function(_0x38c61e,_0x1eabbc){return client['request'](_0x276a1d,_0x3980a9)['then'](function(_0xe9f68d){logger[_0x4448('0xc')]('Variable,\x20%s,\x20%s',_0x5e1500,_0x4448('0xd'));logger[_0x4448('0xe')](_0x4448('0xf'),_0x5e1500,_0x4448('0xd'),JSON[_0x4448('0x10')](_0xe9f68d));if(_0xe9f68d[_0x4448('0x11')]){if(_0xe9f68d[_0x4448('0x11')][_0x4448('0x12')]===0x1f4){logger[_0x4448('0x11')]('Variable,\x20%s,\x20%s',_0x5e1500,_0xe9f68d[_0x4448('0x11')][_0x4448('0x13')]);return _0x1eabbc(_0xe9f68d[_0x4448('0x11')][_0x4448('0x13')]);}logger['error']('Variable,\x20%s,\x20%s',_0x5e1500,_0xe9f68d[_0x4448('0x11')][_0x4448('0x13')]);return _0x38c61e(_0xe9f68d['error'][_0x4448('0x13')]);}else{logger[_0x4448('0xc')](_0x4448('0x14'),_0x5e1500,_0x4448('0xd'));_0x38c61e(_0xe9f68d['result'][_0x4448('0x13')]);}})[_0x4448('0x15')](function(_0x170fae){logger[_0x4448('0x11')](_0x4448('0x14'),_0x5e1500,_0x170fae);_0x1eabbc(_0x170fae);});});}exports[_0x4448('0x16')]=function(_0x45554d){var _0x483ac9=this;return new Promise(function(_0x2dcdd7,_0x24a561){return db['Variable'][_0x4448('0x17')]({'raw':_0x45554d[_0x4448('0x18')]?_0x45554d[_0x4448('0x18')][_0x4448('0x19')]===undefined?!![]:![]:!![],'where':_0x45554d[_0x4448('0x18')]?_0x45554d[_0x4448('0x18')]['where']||null:null,'attributes':_0x45554d[_0x4448('0x18')]?_0x45554d['options']['attributes']||null:null,'include':_0x45554d[_0x4448('0x18')]?_0x45554d[_0x4448('0x18')][_0x4448('0x1a')]?_[_0x4448('0x1b')](_0x45554d['options'][_0x4448('0x1a')],function(_0x430356){return{'model':db[_0x430356[_0x4448('0x1c')]],'as':_0x430356['as'],'attributes':_0x430356['attributes'],'include':_0x430356[_0x4448('0x1a')]?_[_0x4448('0x1b')](_0x430356[_0x4448('0x1a')],function(_0x2fb903){return{'model':db[_0x2fb903[_0x4448('0x1c')]],'as':_0x2fb903['as'],'attributes':_0x2fb903[_0x4448('0x1d')],'include':_0x2fb903['include']?_[_0x4448('0x1b')](_0x2fb903['include'],function(_0x28a595){return{'model':db[_0x28a595[_0x4448('0x1c')]],'as':_0x28a595['as'],'attributes':_0x28a595['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x21e998){logger['info'](_0x4448('0x16'),_0x45554d);logger[_0x4448('0xe')](_0x4448('0x16'),_0x45554d,JSON['stringify'](_0x21e998));_0x2dcdd7(_0x21e998);})[_0x4448('0x15')](function(_0x3a8a4e){logger[_0x4448('0x11')](_0x4448('0x16'),_0x3a8a4e[_0x4448('0x13')],_0x45554d);_0x24a561(_0x483ac9[_0x4448('0x11')](0x1f4,_0x3a8a4e[_0x4448('0x13')]));});});}; \ No newline at end of file +var _0xd0b6=['options','where','attributes','include','map','model','debug','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','Variable,\x20%s,\x20%s','Variable,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','ShowVariable','Variable','find'];(function(_0x6a3d28,_0x39c7a7){var _0x381ff2=function(_0x554285){while(--_0x554285){_0x6a3d28['push'](_0x6a3d28['shift']());}};_0x381ff2(++_0x39c7a7);}(_0xd0b6,0x93));var _0x6d0b=function(_0x37c702,_0xc57b5f){_0x37c702=_0x37c702-0x0;var _0x2e617f=_0xd0b6[_0x37c702];return _0x2e617f;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6d0b('0x0'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6d0b('0x1'))['db'];var utils=require(_0x6d0b('0x2'));var logger=require(_0x6d0b('0x3'))(_0x6d0b('0x4'));var config=require('../../config/environment');var jayson=require(_0x6d0b('0x5'));var client=jayson[_0x6d0b('0x6')][_0x6d0b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x65c5d5,_0x461df7,_0x4d0ec5){return new BPromise(function(_0x572d33,_0xa3f62c){return client[_0x6d0b('0x8')](_0x65c5d5,_0x4d0ec5)[_0x6d0b('0x9')](function(_0x372432){logger['info'](_0x6d0b('0xa'),_0x461df7,'request\x20sent');logger['debug'](_0x6d0b('0xb'),_0x461df7,_0x6d0b('0xc'),JSON[_0x6d0b('0xd')](_0x372432));if(_0x372432[_0x6d0b('0xe')]){if(_0x372432[_0x6d0b('0xe')][_0x6d0b('0xf')]===0x1f4){logger[_0x6d0b('0xe')](_0x6d0b('0xa'),_0x461df7,_0x372432[_0x6d0b('0xe')][_0x6d0b('0x10')]);return _0xa3f62c(_0x372432[_0x6d0b('0xe')][_0x6d0b('0x10')]);}logger[_0x6d0b('0xe')](_0x6d0b('0xa'),_0x461df7,_0x372432[_0x6d0b('0xe')][_0x6d0b('0x10')]);return _0x572d33(_0x372432['error'][_0x6d0b('0x10')]);}else{logger['info']('Variable,\x20%s,\x20%s',_0x461df7,'request\x20sent');_0x572d33(_0x372432[_0x6d0b('0x11')][_0x6d0b('0x10')]);}})['catch'](function(_0x58a2a2){logger[_0x6d0b('0xe')]('Variable,\x20%s,\x20%s',_0x461df7,_0x58a2a2);_0xa3f62c(_0x58a2a2);});});}exports[_0x6d0b('0x12')]=function(_0x5223b5){var _0x3cb905=this;return new Promise(function(_0xa62204,_0x2a5be9){return db[_0x6d0b('0x13')][_0x6d0b('0x14')]({'raw':_0x5223b5[_0x6d0b('0x15')]?_0x5223b5[_0x6d0b('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x5223b5[_0x6d0b('0x15')]?_0x5223b5[_0x6d0b('0x15')][_0x6d0b('0x16')]||null:null,'attributes':_0x5223b5[_0x6d0b('0x15')]?_0x5223b5['options'][_0x6d0b('0x17')]||null:null,'include':_0x5223b5[_0x6d0b('0x15')]?_0x5223b5[_0x6d0b('0x15')][_0x6d0b('0x18')]?_[_0x6d0b('0x19')](_0x5223b5[_0x6d0b('0x15')][_0x6d0b('0x18')],function(_0x1edec3){return{'model':db[_0x1edec3[_0x6d0b('0x1a')]],'as':_0x1edec3['as'],'attributes':_0x1edec3[_0x6d0b('0x17')],'include':_0x1edec3[_0x6d0b('0x18')]?_['map'](_0x1edec3[_0x6d0b('0x18')],function(_0x3def2c){return{'model':db[_0x3def2c['model']],'as':_0x3def2c['as'],'attributes':_0x3def2c[_0x6d0b('0x17')],'include':_0x3def2c['include']?_[_0x6d0b('0x19')](_0x3def2c['include'],function(_0x4e07ce){return{'model':db[_0x4e07ce[_0x6d0b('0x1a')]],'as':_0x4e07ce['as'],'attributes':_0x4e07ce[_0x6d0b('0x17')]};}):[]};}):[]};}):[]:[]})[_0x6d0b('0x9')](function(_0x2e1280){logger['info'](_0x6d0b('0x12'),_0x5223b5);logger[_0x6d0b('0x1b')](_0x6d0b('0x12'),_0x5223b5,JSON[_0x6d0b('0xd')](_0x2e1280));_0xa62204(_0x2e1280);})['catch'](function(_0xf234e1){logger[_0x6d0b('0xe')]('ShowVariable',_0xf234e1[_0x6d0b('0x10')],_0x5223b5);_0x2a5be9(_0x3cb905[_0x6d0b('0xe')](0x1f4,_0xf234e1['message']));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index adbd37d..184b107 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 _0xccee=['index','/fetch','isAuthenticated','fetch','/reset','canUpdate','reset','/pull','/restart','migrations','exports','express','Router','../../components/auth/service','./version.controller','get'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0xccee,0x13b));var _0xecce=function(_0x1e46f9,_0x3572c5){_0x1e46f9=_0x1e46f9-0x0;var _0x4923c4=_0xccee[_0x1e46f9];return _0x4923c4;};'use strict';var express=require(_0xecce('0x0'));var router=express[_0xecce('0x1')]();var auth=require(_0xecce('0x2'));var controller=require(_0xecce('0x3'));router[_0xecce('0x4')]('/',controller[_0xecce('0x5')]);router[_0xecce('0x4')](_0xecce('0x6'),auth[_0xecce('0x7')](),auth['canUpdate'](),controller[_0xecce('0x8')]);router[_0xecce('0x4')](_0xecce('0x9'),auth[_0xecce('0x7')](),auth[_0xecce('0xa')](),controller[_0xecce('0xb')]);router[_0xecce('0x4')](_0xecce('0xc'),auth['isAuthenticated'](),auth['canUpdate'](),controller['pull']);router[_0xecce('0x4')](_0xecce('0xd'),auth[_0xecce('0x7')](),controller['restart']);router['get']('/migrations',controller[_0xecce('0xe')]);module[_0xecce('0xf')]=router; \ No newline at end of file +var _0xcefb=['canUpdate','fetch','/reset','/pull','pull','/restart','restart','/migrations','migrations','exports','express','Router','../../components/auth/service','get','/fetch','isAuthenticated'];(function(_0x2e3525,_0x113822){var _0x373a21=function(_0x22085e){while(--_0x22085e){_0x2e3525['push'](_0x2e3525['shift']());}};_0x373a21(++_0x113822);}(_0xcefb,0xfa));var _0xbcef=function(_0x57c266,_0x352b24){_0x57c266=_0x57c266-0x0;var _0x5953b4=_0xcefb[_0x57c266];return _0x5953b4;};'use strict';var express=require(_0xbcef('0x0'));var router=express[_0xbcef('0x1')]();var auth=require(_0xbcef('0x2'));var controller=require('./version.controller');router[_0xbcef('0x3')]('/',controller['index']);router[_0xbcef('0x3')](_0xbcef('0x4'),auth[_0xbcef('0x5')](),auth[_0xbcef('0x6')](),controller[_0xbcef('0x7')]);router[_0xbcef('0x3')](_0xbcef('0x8'),auth['isAuthenticated'](),auth[_0xbcef('0x6')](),controller['reset']);router[_0xbcef('0x3')](_0xbcef('0x9'),auth[_0xbcef('0x5')](),auth[_0xbcef('0x6')](),controller[_0xbcef('0xa')]);router[_0xbcef('0x3')](_0xbcef('0xb'),auth[_0xbcef('0x5')](),controller[_0xbcef('0xc')]);router['get'](_0xbcef('0xd'),controller[_0xbcef('0xe')]);module[_0xbcef('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 31dadcd..6bcf977 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 _0xf3a8=['UniqueConstraintError','Database\x20already\x20up-to-date','path','lodash','version','exec','../../config/environment','../../config/logger','update','simple-git','root','index','exports','query','latest','fetch','tags','2.0.0','status','json','master','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','error','info','git\x20reset\x20--hard\x20FETCH_HEAD','pull','npm\x20install\x20--production','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','server','replace','.js','length','sort','sequelize','Migration','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','join','map','then','\x20to\x20'];(function(_0x8dd99d,_0x3c9434){var _0x53d46d=function(_0x12607a){while(--_0x12607a){_0x8dd99d['push'](_0x8dd99d['shift']());}};_0x53d46d(++_0x3c9434);}(_0xf3a8,0xf2));var _0x8f3a=function(_0x2ed38e,_0x4aa9b4){_0x2ed38e=_0x2ed38e-0x0;var _0x250343=_0xf3a8[_0x2ed38e];return _0x250343;};'use strict';var Umzug=require('umzug');var path=require(_0x8f3a('0x0'));var fs=require('fs');var _=require(_0x8f3a('0x1'));var pkginfo=require('pkginfo')(module,_0x8f3a('0x2'));var compareVersions=require('compare-versions');var exec=require('child_process')[_0x8f3a('0x3')];var db=require('../../mysqldb')['db'];var config=require(_0x8f3a('0x4'));var pm2=require('../../config/pm2');var logger=require(_0x8f3a('0x5'))(_0x8f3a('0x6'));var git=require(_0x8f3a('0x7'))(config[_0x8f3a('0x8')]);exports[_0x8f3a('0x9')]=function(_0x2e290d,_0x3dc1ea){var _0xcfad11={'current':module[_0x8f3a('0xa')]['version'],'phonebar':0x2};if(_0x2e290d[_0x8f3a('0xb')]&&_0x2e290d['query'][_0x8f3a('0xc')]){return git[_0x8f3a('0xd')]()[_0x8f3a('0xe')](function(_0x27e224,_0x1d3385){_0xcfad11['latest']=(_0x27e224?module[_0x8f3a('0xa')][_0x8f3a('0x2')]:_0x1d3385['latest'])||_0x8f3a('0xf');return _0x3dc1ea['status'](0xc8)['json'](_0xcfad11);});}else{return _0x3dc1ea[_0x8f3a('0x10')](0xc8)[_0x8f3a('0x11')](_0xcfad11);}};exports['fetch']=function(_0x3e8c20,_0x13dd93){return git[_0x8f3a('0xd')](['origin',_0x8f3a('0x12')],function(_0x475f2a){if(_0x475f2a){logger['error'](_0x475f2a);return _0x13dd93[_0x8f3a('0x10')](0x1f4)[_0x8f3a('0x11')](_0x475f2a);}logger['info'](_0x8f3a('0x13'));return _0x13dd93[_0x8f3a('0x10')](0xc8)[_0x8f3a('0x11')]({'output':_0x8f3a('0x14')});});};exports[_0x8f3a('0x15')]=function(_0x512d94,_0x451aee){return git[_0x8f3a('0x15')]([_0x8f3a('0x16'),_0x8f3a('0x17')],function(_0x31e4cc){if(_0x31e4cc){logger[_0x8f3a('0x18')](_0x31e4cc);return _0x451aee['status'](0x1f4)[_0x8f3a('0x11')](_0x31e4cc);}logger[_0x8f3a('0x19')](_0x8f3a('0x1a'));return _0x451aee['status'](0xc8)[_0x8f3a('0x11')]({'output':'git\x20reset\x20--hard'});});};exports[_0x8f3a('0x1b')]=function(_0x356f72,_0x3bfa9f){exec(_0x8f3a('0x1c'),function(_0x17e7f4,_0x4bc018,_0x5a6177){logger[_0x8f3a('0x19')](_0x4bc018);logger[_0x8f3a('0x19')](_0x5a6177);if(_0x17e7f4){logger[_0x8f3a('0x18')](_0x17e7f4);return _0x3bfa9f[_0x8f3a('0x10')](0x1f4)['json'](_0x17e7f4);}return _0x3bfa9f['status'](0xc8)[_0x8f3a('0x11')]({'output':_0x4bc018});});};exports['restart']=function(_0xa8b81c,_0xf04b12){return pm2['restart']('motion2')['then'](function(_0x4ab7af){logger[_0x8f3a('0x19')]('pm2\x20restart\x20motion\x20%s',_0x4ab7af);return _0xf04b12['status'](0xc8)[_0x8f3a('0x11')]({'output':_0x8f3a('0x1d')});})[_0x8f3a('0x1e')](function(_0x87656f){logger[_0x8f3a('0x18')](_0x87656f);return _0xf04b12[_0x8f3a('0x10')](0x1f4)[_0x8f3a('0x11')](_0x87656f);});};exports[_0x8f3a('0x1f')]=function(_0x3f827f,_0x12f0ba){var _0x49b8a5=fs[_0x8f3a('0x20')](path['join'](config[_0x8f3a('0x8')],_0x8f3a('0x21'),_0x8f3a('0x1f')));var _0x763adb=[];for(var _0x1ba5ef=0x0;_0x1ba5ef<_0x49b8a5['length'];_0x1ba5ef++){var _0x3d7414=_0x49b8a5[_0x1ba5ef][_0x8f3a('0x22')](_0x8f3a('0x23'),'');if(compareVersions(module[_0x8f3a('0xa')][_0x8f3a('0x2')],_0x3d7414)===-0x1){_0x763adb['push'](_0x3d7414);}}if(_0x763adb[_0x8f3a('0x24')]){var _0xe7c54b=_0x763adb[_0x8f3a('0x25')](compareVersions);var _0x3e0dbc=new Umzug({'storage':_0x8f3a('0x26'),'storageOptions':{'model':db[_0x8f3a('0x27')],'modelName':_0x8f3a('0x27'),'columnName':_0x8f3a('0x2')},'migrations':{'params':[db['sequelize']['getQueryInterface'](),db['sequelize'][_0x8f3a('0x28')],function(){throw new Error(_0x8f3a('0x29'));}],'path':path[_0x8f3a('0x2a')](config[_0x8f3a('0x8')],'server',_0x8f3a('0x1f')),'pattern':/\.js$/}});_0x3e0dbc['up']({'migrations':_[_0x8f3a('0x2b')](_0xe7c54b,function(_0x34e0a6){return _0x34e0a6+_0x8f3a('0x23');})})[_0x8f3a('0x2c')](function(){return _0x12f0ba[_0x8f3a('0x10')](0xc8)[_0x8f3a('0x11')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0x8f3a('0xa')][_0x8f3a('0x2')]+_0x8f3a('0x2d')+_['last'](_0xe7c54b),'migrations':_[_0x8f3a('0x2a')](_0xe7c54b)});})[_0x8f3a('0x1e')](function(_0x29c87a){if(_0x29c87a instanceof db[_0x8f3a('0x26')][_0x8f3a('0x2e')]){return _0x12f0ba['status'](0xc8)['json']({'output':_0x8f3a('0x2f')});}else{return _0x12f0ba[_0x8f3a('0x10')](0x1f4)[_0x8f3a('0x11')](_0x29c87a);}});}else{return _0x12f0ba[_0x8f3a('0x10')](0xc8)[_0x8f3a('0x11')]({'output':_0x8f3a('0x2f')});}}; \ No newline at end of file +var _0xcac3=['../../config/logger','update','simple-git','root','index','exports','query','latest','tags','2.0.0','status','json','fetch','origin','master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','then','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join','server','length','replace','.js','push','sort','Migration','sequelize','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','path','lodash','pkginfo','version','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2'];(function(_0x4d2384,_0x273c88){var _0x44160a=function(_0x3c6f12){while(--_0x3c6f12){_0x4d2384['push'](_0x4d2384['shift']());}};_0x44160a(++_0x273c88);}(_0xcac3,0x193));var _0x3cac=function(_0x8e7772,_0x9d77b0){_0x8e7772=_0x8e7772-0x0;var _0x408200=_0xcac3[_0x8e7772];return _0x408200;};'use strict';var Umzug=require('umzug');var path=require(_0x3cac('0x0'));var fs=require('fs');var _=require(_0x3cac('0x1'));var pkginfo=require(_0x3cac('0x2'))(module,_0x3cac('0x3'));var compareVersions=require(_0x3cac('0x4'));var exec=require(_0x3cac('0x5'))[_0x3cac('0x6')];var db=require(_0x3cac('0x7'))['db'];var config=require(_0x3cac('0x8'));var pm2=require(_0x3cac('0x9'));var logger=require(_0x3cac('0xa'))(_0x3cac('0xb'));var git=require(_0x3cac('0xc'))(config[_0x3cac('0xd')]);exports[_0x3cac('0xe')]=function(_0x21365c,_0x13c1b9){var _0x55670d={'current':module[_0x3cac('0xf')][_0x3cac('0x3')],'phonebar':0x2};if(_0x21365c[_0x3cac('0x10')]&&_0x21365c[_0x3cac('0x10')][_0x3cac('0x11')]){return git['fetch']()[_0x3cac('0x12')](function(_0x169e39,_0x3b6421){_0x55670d[_0x3cac('0x11')]=(_0x169e39?module[_0x3cac('0xf')]['version']:_0x3b6421['latest'])||_0x3cac('0x13');return _0x13c1b9[_0x3cac('0x14')](0xc8)[_0x3cac('0x15')](_0x55670d);});}else{return _0x13c1b9[_0x3cac('0x14')](0xc8)[_0x3cac('0x15')](_0x55670d);}};exports[_0x3cac('0x16')]=function(_0x39c119,_0x4bee52){return git[_0x3cac('0x16')]([_0x3cac('0x17'),_0x3cac('0x18')],function(_0x281dfd){if(_0x281dfd){logger[_0x3cac('0x19')](_0x281dfd);return _0x4bee52[_0x3cac('0x14')](0x1f4)[_0x3cac('0x15')](_0x281dfd);}logger[_0x3cac('0x1a')](_0x3cac('0x1b'));return _0x4bee52[_0x3cac('0x14')](0xc8)[_0x3cac('0x15')]({'output':_0x3cac('0x1c')});});};exports[_0x3cac('0x1d')]=function(_0x7da01d,_0x1b1007){return git[_0x3cac('0x1d')]([_0x3cac('0x1e'),_0x3cac('0x1f')],function(_0x3cb08f){if(_0x3cb08f){logger[_0x3cac('0x19')](_0x3cb08f);return _0x1b1007[_0x3cac('0x14')](0x1f4)[_0x3cac('0x15')](_0x3cb08f);}logger['info'](_0x3cac('0x20'));return _0x1b1007[_0x3cac('0x14')](0xc8)['json']({'output':_0x3cac('0x21')});});};exports[_0x3cac('0x22')]=function(_0x40a088,_0x2f8165){exec(_0x3cac('0x23'),function(_0x147d3b,_0x530057,_0x19010f){logger['info'](_0x530057);logger['info'](_0x19010f);if(_0x147d3b){logger['error'](_0x147d3b);return _0x2f8165[_0x3cac('0x14')](0x1f4)[_0x3cac('0x15')](_0x147d3b);}return _0x2f8165[_0x3cac('0x14')](0xc8)[_0x3cac('0x15')]({'output':_0x530057});});};exports[_0x3cac('0x24')]=function(_0x27c35a,_0x154e16){return pm2[_0x3cac('0x24')](_0x3cac('0x25'))[_0x3cac('0x26')](function(_0xbdd4b3){logger[_0x3cac('0x1a')]('pm2\x20restart\x20motion\x20%s',_0xbdd4b3);return _0x154e16[_0x3cac('0x14')](0xc8)[_0x3cac('0x15')]({'output':_0x3cac('0x27')});})[_0x3cac('0x28')](function(_0xf8ef01){logger[_0x3cac('0x19')](_0xf8ef01);return _0x154e16[_0x3cac('0x14')](0x1f4)[_0x3cac('0x15')](_0xf8ef01);});};exports[_0x3cac('0x29')]=function(_0x2d7847,_0x2b7caf){var _0x391412=fs[_0x3cac('0x2a')](path[_0x3cac('0x2b')](config[_0x3cac('0xd')],_0x3cac('0x2c'),_0x3cac('0x29')));var _0xa08a6=[];for(var _0x447e9e=0x0;_0x447e9e<_0x391412[_0x3cac('0x2d')];_0x447e9e++){var _0x2d44ff=_0x391412[_0x447e9e][_0x3cac('0x2e')](_0x3cac('0x2f'),'');if(compareVersions(module['exports'][_0x3cac('0x3')],_0x2d44ff)===-0x1){_0xa08a6[_0x3cac('0x30')](_0x2d44ff);}}if(_0xa08a6[_0x3cac('0x2d')]){var _0x1710db=_0xa08a6[_0x3cac('0x31')](compareVersions);var _0x4b42af=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0x3cac('0x32')],'modelName':_0x3cac('0x32'),'columnName':'version'},'migrations':{'params':[db[_0x3cac('0x33')]['getQueryInterface'](),db['sequelize'][_0x3cac('0x34')],function(){throw new Error(_0x3cac('0x35'));}],'path':path['join'](config[_0x3cac('0xd')],_0x3cac('0x2c'),_0x3cac('0x29')),'pattern':/\.js$/}});_0x4b42af['up']({'migrations':_[_0x3cac('0x36')](_0x1710db,function(_0x29c6bf){return _0x29c6bf+_0x3cac('0x2f');})})[_0x3cac('0x26')](function(){return _0x2b7caf[_0x3cac('0x14')](0xc8)[_0x3cac('0x15')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module['exports'][_0x3cac('0x3')]+_0x3cac('0x37')+_[_0x3cac('0x38')](_0x1710db),'migrations':_[_0x3cac('0x2b')](_0x1710db)});})[_0x3cac('0x28')](function(_0x1660b5){if(_0x1660b5 instanceof db[_0x3cac('0x33')][_0x3cac('0x39')]){return _0x2b7caf['status'](0xc8)[_0x3cac('0x15')]({'output':_0x3cac('0x3a')});}else{return _0x2b7caf['status'](0x1f4)[_0x3cac('0x15')](_0x1660b5);}});}else{return _0x2b7caf[_0x3cac('0x14')](0xc8)[_0x3cac('0x15')]({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index fc297f0..709ebb4 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 _0xa79a=['path','connect-timeout','express','Router','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','post','create','update','destroy','exports','multer','util'];(function(_0x577edb,_0x3669f0){var _0x127d0a=function(_0x11284a){while(--_0x11284a){_0x577edb['push'](_0x577edb['shift']());}};_0x127d0a(++_0x3669f0);}(_0xa79a,0xe8));var _0xaa79=function(_0xb32365,_0x2d5dc6){_0xb32365=_0xb32365-0x0;var _0xdce05a=_0xa79a[_0xb32365];return _0xdce05a;};'use strict';var multer=require(_0xaa79('0x0'));var util=require(_0xaa79('0x1'));var path=require(_0xaa79('0x2'));var timeout=require(_0xaa79('0x3'));var express=require(_0xaa79('0x4'));var router=express[_0xaa79('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xaa79('0x6'));var config=require('../../config/environment');var controller=require('./voiceAgentReport.controller');router[_0xaa79('0x7')]('/',auth[_0xaa79('0x8')](),controller[_0xaa79('0x9')]);router[_0xaa79('0x7')](_0xaa79('0xa'),auth[_0xaa79('0x8')](),controller[_0xaa79('0xb')]);router[_0xaa79('0x7')](_0xaa79('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xaa79('0xd')]('/',auth[_0xaa79('0x8')](),controller[_0xaa79('0xe')]);router['put'](_0xaa79('0xc'),auth[_0xaa79('0x8')](),controller[_0xaa79('0xf')]);router['delete'](_0xaa79('0xc'),auth[_0xaa79('0x8')](),controller[_0xaa79('0x10')]);module[_0xaa79('0x11')]=router; \ No newline at end of file +var _0x7996=['describe','/:id','show','post','create','delete','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','index','/describe'];(function(_0x179e11,_0xf65436){var _0x549f04=function(_0x610545){while(--_0x610545){_0x179e11['push'](_0x179e11['shift']());}};_0x549f04(++_0xf65436);}(_0x7996,0xc4));var _0x6799=function(_0x2b737c,_0x274adf){_0x2b737c=_0x2b737c-0x0;var _0x466ed5=_0x7996[_0x2b737c];return _0x466ed5;};'use strict';var multer=require(_0x6799('0x0'));var util=require('util');var path=require(_0x6799('0x1'));var timeout=require(_0x6799('0x2'));var express=require(_0x6799('0x3'));var router=express[_0x6799('0x4')]();var auth=require(_0x6799('0x5'));var interaction=require(_0x6799('0x6'));var config=require(_0x6799('0x7'));var controller=require(_0x6799('0x8'));router[_0x6799('0x9')]('/',auth[_0x6799('0xa')](),controller[_0x6799('0xb')]);router[_0x6799('0x9')](_0x6799('0xc'),auth[_0x6799('0xa')](),controller[_0x6799('0xd')]);router[_0x6799('0x9')](_0x6799('0xe'),auth[_0x6799('0xa')](),controller[_0x6799('0xf')]);router[_0x6799('0x10')]('/',auth[_0x6799('0xa')](),controller[_0x6799('0x11')]);router['put'](_0x6799('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x6799('0x12')](_0x6799('0xe'),auth[_0x6799('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index d1e313c..ba47c2e 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 _0x5fd1=['STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize'];(function(_0x4743d9,_0x4614ae){var _0x50362f=function(_0x3c5337){while(--_0x3c5337){_0x4743d9['push'](_0x4743d9['shift']());}};_0x50362f(++_0x4614ae);}(_0x5fd1,0x155));var _0x15fd=function(_0x1dc5d9,_0x4b104b){_0x1dc5d9=_0x1dc5d9-0x0;var _0x345798=_0x5fd1[_0x1dc5d9];return _0x345798;};'use strict';var Sequelize=require(_0x15fd('0x0'));module['exports']={'type':{'type':Sequelize[_0x15fd('0x1')]},'uniqueid':{'type':Sequelize[_0x15fd('0x1')]},'calleridnum':{'type':Sequelize[_0x15fd('0x1')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x15fd('0x1')]},'membername':{'type':Sequelize[_0x15fd('0x1')]},'agentcalledAt':{'type':Sequelize[_0x15fd('0x2')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0x15fd('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0x15fd('0x2')]},'agentdumpAt':{'type':Sequelize[_0x15fd('0x2')]},'holdtime':{'type':Sequelize[_0x15fd('0x3')]},'agentcomplete':{'type':Sequelize[_0x15fd('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x15fd('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x15fd('0x3')]},'agentacw':{'type':Sequelize[_0x15fd('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x15fd('0x1')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x15fd('0x1')]},'channelstate':{'type':Sequelize[_0x15fd('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x15fd('0x1')]},'accountcode':{'type':Sequelize[_0x15fd('0x1')]},'context':{'type':Sequelize[_0x15fd('0x1')]},'exten':{'type':Sequelize[_0x15fd('0x1')]},'priority':{'type':Sequelize[_0x15fd('0x1')]},'destchannel':{'type':Sequelize[_0x15fd('0x1')]},'destchannelstate':{'type':Sequelize[_0x15fd('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x15fd('0x1')]},'destcalleridnum':{'type':Sequelize[_0x15fd('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x15fd('0x1')]},'destaccountcode':{'type':Sequelize[_0x15fd('0x1')]},'destcontext':{'type':Sequelize[_0x15fd('0x1')]},'destexten':{'type':Sequelize[_0x15fd('0x1')]},'destpriority':{'type':Sequelize[_0x15fd('0x1')]},'destuniqueid':{'type':Sequelize[_0x15fd('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x15fd('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0x15fd('0x1')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x15fd('0x5')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x15fd('0x1')]},'agententerreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x7dfd=['sequelize','exports','STRING','DATE','INTEGER','BOOLEAN'];(function(_0x4d76a3,_0x204219){var _0x2a0bc0=function(_0x382e86){while(--_0x382e86){_0x4d76a3['push'](_0x4d76a3['shift']());}};_0x2a0bc0(++_0x204219);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd7df('0x0'));module[_0xd7df('0x1')]={'type':{'type':Sequelize[_0xd7df('0x2')]},'uniqueid':{'type':Sequelize[_0xd7df('0x2')]},'calleridnum':{'type':Sequelize[_0xd7df('0x2')]},'calleridname':{'type':Sequelize[_0xd7df('0x2')]},'queue':{'type':Sequelize[_0xd7df('0x2')]},'interface':{'type':Sequelize[_0xd7df('0x2')]},'membername':{'type':Sequelize[_0xd7df('0x2')]},'agentcalledAt':{'type':Sequelize[_0xd7df('0x3')]},'agentconnectAt':{'type':Sequelize[_0xd7df('0x3')]},'agentcompleteAt':{'type':Sequelize[_0xd7df('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0xd7df('0x3')]},'agentdumpAt':{'type':Sequelize[_0xd7df('0x3')]},'holdtime':{'type':Sequelize[_0xd7df('0x4')]},'agentcomplete':{'type':Sequelize[_0xd7df('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xd7df('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0xd7df('0x4')]},'agentacw':{'type':Sequelize[_0xd7df('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xd7df('0x4')]},'reason':{'type':Sequelize[_0xd7df('0x2')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xd7df('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xd7df('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xd7df('0x2')]},'language':{'type':Sequelize[_0xd7df('0x2')]},'accountcode':{'type':Sequelize[_0xd7df('0x2')]},'context':{'type':Sequelize[_0xd7df('0x2')]},'exten':{'type':Sequelize[_0xd7df('0x2')]},'priority':{'type':Sequelize[_0xd7df('0x2')]},'destchannel':{'type':Sequelize[_0xd7df('0x2')]},'destchannelstate':{'type':Sequelize[_0xd7df('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0xd7df('0x2')]},'destcalleridnum':{'type':Sequelize[_0xd7df('0x2')]},'destcalleridname':{'type':Sequelize[_0xd7df('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xd7df('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xd7df('0x2')]},'destlanguage':{'type':Sequelize[_0xd7df('0x2')]},'destaccountcode':{'type':Sequelize[_0xd7df('0x2')]},'destcontext':{'type':Sequelize[_0xd7df('0x2')]},'destexten':{'type':Sequelize[_0xd7df('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0xd7df('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xd7df('0x2')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0xd7df('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xd7df('0x2')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0xd7df('0x2')]},'transferuniqueid':{'type':Sequelize[_0xd7df('0x2')]},'agententerreason':{'type':Sequelize[_0xd7df('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 32e4465..4fc3b4e 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 _0x868e=['request-promise','moment','bluebird','mustache','util','sox','ejs','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','VoiceAgentReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','key','field','includeAll','include','findAll','catch','show','length','options','find','create','body','params','describe','html-pdf','rimraf','zip-dir','fast-json-patch'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x868e,0x1f4));var _0xe868=function(_0x526786,_0x105cbf){_0x526786=_0x526786-0x0;var _0x3a512d=_0x868e[_0x526786];return _0x3a512d;};'use strict';var pdf=require(_0xe868('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xe868('0x1'));var zipdir=require(_0xe868('0x2'));var jsonpatch=require(_0xe868('0x3'));var rp=require(_0xe868('0x4'));var moment=require(_0xe868('0x5'));var BPromise=require(_0xe868('0x6'));var Mustache=require(_0xe868('0x7'));var util=require(_0xe868('0x8'));var path=require('path');var sox=require(_0xe868('0x9'));var csv=require('to-csv');var ejs=require(_0xe868('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xe868('0xb'));var crypto=require(_0xe868('0xc'));var jsforce=require(_0xe868('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe868('0xe'));var Papa=require('papaparse');var Redis=require(_0xe868('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xe868('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe868('0x11'));var utils=require('../../config/utils');var config=require(_0xe868('0x12'));var db=require(_0xe868('0x13'))['db'];function respondWithStatusCode(_0x2ec038,_0xf3a0e){_0xf3a0e=_0xf3a0e||0xcc;return function(_0x2073a2){if(_0x2073a2){return _0x2ec038[_0xe868('0x14')](_0xf3a0e);}return _0x2ec038[_0xe868('0x15')](_0xf3a0e)[_0xe868('0x16')]();};}function respondWithResult(_0x4c6f6f,_0x10be25){_0x10be25=_0x10be25||0xc8;return function(_0x59f4fa){if(_0x59f4fa){return _0x4c6f6f['status'](_0x10be25)[_0xe868('0x17')](_0x59f4fa);}};}function respondWithFilteredResult(_0x10fbfc,_0x2492f4){return function(_0x3f51cf){if(_0x3f51cf){var _0x1de6a6=_0x3f51cf[_0xe868('0x18')],_0x324ded=_0x2492f4[_0xe868('0x19')],_0x4a7eea=_0x2492f4[_0xe868('0x19')]+_0x2492f4[_0xe868('0x1a')],_0xc779a1;if(_0x4a7eea>=_0x1de6a6){_0x4a7eea=_0x1de6a6;_0xc779a1=0xc8;}else{_0xc779a1=0xce;}_0x10fbfc[_0xe868('0x15')](_0xc779a1);return _0x10fbfc['set'](_0xe868('0x1b'),_0x324ded+'-'+_0x4a7eea+'/'+_0x1de6a6)['json'](_0x3f51cf);}return null;};}function patchUpdates(_0x33fe41){return function(_0x290908){try{jsonpatch[_0xe868('0x1c')](_0x290908,_0x33fe41,!![]);}catch(_0x397b66){return BPromise[_0xe868('0x1d')](_0x397b66);}return _0x290908[_0xe868('0x1e')]();};}function saveUpdates(_0x1679e7,_0x16a23f){return function(_0x44b19e){if(_0x44b19e){return _0x44b19e[_0xe868('0x1f')](_0x1679e7)[_0xe868('0x20')](function(_0x5a97a1){return _0x5a97a1;});}return null;};}function removeEntity(_0x22b3fd,_0x38f48f){return function(_0xb28c4c){if(_0xb28c4c){return _0xb28c4c['destroy']()['then'](function(){_0x22b3fd[_0xe868('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x361526,_0x48e484){return function(_0x13df13){if(!_0x13df13){_0x361526[_0xe868('0x14')](0x194);}return _0x13df13;};}function handleError(_0x5b7005,_0x108e3d){_0x108e3d=_0x108e3d||0x1f4;return function(_0x25a912){logger[_0xe868('0x21')](_0x25a912[_0xe868('0x22')]);if(_0x25a912[_0xe868('0x23')]){delete _0x25a912[_0xe868('0x23')];}_0x5b7005[_0xe868('0x15')](_0x108e3d)[_0xe868('0x24')](_0x25a912);};}exports[_0xe868('0x25')]=function(_0x34ed12,_0x53409d){var _0x2bd583={},_0x54e9d4={},_0x5bd98e={'count':0x0,'rows':[]};var _0x42f2ae=_[_0xe868('0x26')](db[_0xe868('0x27')][_0xe868('0x28')],function(_0x2ddd16){return{'name':_0x2ddd16[_0xe868('0x29')],'type':_0x2ddd16[_0xe868('0x2a')]['key']};});_0x54e9d4[_0xe868('0x2b')]=_[_0xe868('0x26')](_0x42f2ae,_0xe868('0x23'));_0x54e9d4[_0xe868('0x2c')]=_[_0xe868('0x2d')](_0x34ed12['query']);_0x54e9d4[_0xe868('0x2e')]=_[_0xe868('0x2f')](_0x54e9d4['model'],_0x54e9d4[_0xe868('0x2c')]);_0x2bd583[_0xe868('0x30')]=_[_0xe868('0x2f')](_0x54e9d4[_0xe868('0x2b')],qs[_0xe868('0x31')](_0x34ed12[_0xe868('0x2c')][_0xe868('0x31')]));_0x2bd583[_0xe868('0x30')]=_0x2bd583[_0xe868('0x30')]['length']?_0x2bd583[_0xe868('0x30')]:_0x54e9d4[_0xe868('0x2b')];if(!_0x34ed12[_0xe868('0x2c')][_0xe868('0x32')](_0xe868('0x33'))){_0x2bd583['limit']=qs[_0xe868('0x1a')](_0x34ed12[_0xe868('0x2c')][_0xe868('0x1a')]);_0x2bd583[_0xe868('0x19')]=qs[_0xe868('0x19')](_0x34ed12[_0xe868('0x2c')][_0xe868('0x19')]);}_0x2bd583[_0xe868('0x34')]=qs[_0xe868('0x35')](_0x34ed12['query']['sort']);_0x2bd583[_0xe868('0x36')]=qs[_0xe868('0x2e')](_[_0xe868('0x37')](_0x34ed12[_0xe868('0x2c')],_0x54e9d4['filters']));if(_0x34ed12[_0xe868('0x2c')][_0xe868('0x38')]){_0x2bd583[_0xe868('0x36')]=_[_0xe868('0x39')](_0x2bd583['where'],{'$or':_['map'](_0x42f2ae,function(_0x22b173){if(_0x22b173[_0xe868('0x2a')][_0xe868('0x3a')]!=='VIRTUAL'){var _0x2a30dc={};_0x2a30dc[_0x22b173[_0xe868('0x3b')]]={'$like':'%'+_0x34ed12[_0xe868('0x2c')]['filter']+'%'};return _0x2a30dc;}})});}_0x2bd583=_['merge']({},_0x2bd583,_0x34ed12['options']);var _0x33aa51={'where':_0x2bd583[_0xe868('0x36')]};return db[_0xe868('0x27')]['count'](_0x33aa51)[_0xe868('0x20')](function(_0x2358bf){_0x5bd98e[_0xe868('0x18')]=_0x2358bf;if(_0x34ed12[_0xe868('0x2c')][_0xe868('0x3c')]){_0x2bd583[_0xe868('0x3d')]=[{'all':!![]}];}return db[_0xe868('0x27')][_0xe868('0x3e')](_0x2bd583);})[_0xe868('0x20')](function(_0x11e91b){_0x5bd98e['rows']=_0x11e91b;return _0x5bd98e;})['then'](respondWithFilteredResult(_0x53409d,_0x2bd583))[_0xe868('0x3f')](handleError(_0x53409d,null));};exports[_0xe868('0x40')]=function(_0x2c80ad,_0x22c611){var _0xcce781={'raw':![],'where':{'id':_0x2c80ad['params']['id']}},_0x2879f8={};_0x2879f8[_0xe868('0x2b')]=_[_0xe868('0x2d')](db['VoiceAgentReport'][_0xe868('0x28')]);_0x2879f8['query']=_['keys'](_0x2c80ad['query']);_0x2879f8[_0xe868('0x2e')]=_[_0xe868('0x2f')](_0x2879f8[_0xe868('0x2b')],_0x2879f8['query']);_0xcce781['attributes']=_['intersection'](_0x2879f8[_0xe868('0x2b')],qs[_0xe868('0x31')](_0x2c80ad[_0xe868('0x2c')]['fields']));_0xcce781[_0xe868('0x30')]=_0xcce781[_0xe868('0x30')][_0xe868('0x41')]?_0xcce781[_0xe868('0x30')]:_0x2879f8[_0xe868('0x2b')];if(_0x2c80ad[_0xe868('0x2c')]['includeAll']){_0xcce781[_0xe868('0x3d')]=[{'all':!![]}];}_0xcce781=_[_0xe868('0x39')]({},_0xcce781,_0x2c80ad[_0xe868('0x42')]);return db['VoiceAgentReport'][_0xe868('0x43')](_0xcce781)[_0xe868('0x20')](handleEntityNotFound(_0x22c611,null))[_0xe868('0x20')](respondWithResult(_0x22c611,null))[_0xe868('0x3f')](handleError(_0x22c611,null));};exports[_0xe868('0x44')]=function(_0xe53965,_0x182c00){return db[_0xe868('0x27')][_0xe868('0x44')](_0xe53965[_0xe868('0x45')],{})[_0xe868('0x20')](respondWithResult(_0x182c00,0xc9))[_0xe868('0x3f')](handleError(_0x182c00,null));};exports['update']=function(_0x4f437c,_0x24a6b2){if(_0x4f437c['body']['id']){delete _0x4f437c[_0xe868('0x45')]['id'];}return db[_0xe868('0x27')]['find']({'where':{'id':_0x4f437c['params']['id']}})[_0xe868('0x20')](handleEntityNotFound(_0x24a6b2,null))['then'](saveUpdates(_0x4f437c[_0xe868('0x45')],null))['then'](respondWithResult(_0x24a6b2,null))[_0xe868('0x3f')](handleError(_0x24a6b2,null));};exports['destroy']=function(_0x2a295b,_0x5aae80){return db[_0xe868('0x27')]['find']({'where':{'id':_0x2a295b[_0xe868('0x46')]['id']}})[_0xe868('0x20')](handleEntityNotFound(_0x5aae80,null))[_0xe868('0x20')](removeEntity(_0x5aae80,null))['catch'](handleError(_0x5aae80,null));};exports[_0xe868('0x47')]=function(_0xa388e3,_0xe37cc1){return db[_0xe868('0x27')][_0xe868('0x47')]()['then'](respondWithResult(_0xe37cc1,null))[_0xe868('0x3f')](handleError(_0xe37cc1,null));}; \ No newline at end of file +var _0xbd24=['stack','name','send','index','map','VoiceAgentReport','fieldName','key','model','keys','query','intersection','attributes','fields','nolimit','sort','where','type','VIRTUAL','field','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','filters','length','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','count','offset','limit','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus'];(function(_0x550839,_0xf664c){var _0x145c26=function(_0x254fc8){while(--_0x254fc8){_0x550839['push'](_0x550839['shift']());}};_0x145c26(++_0xf664c);}(_0xbd24,0x100));var _0x4bd2=function(_0x50d56f,_0x5cba9d){_0x50d56f=_0x50d56f-0x0;var _0x1dd8ca=_0xbd24[_0x50d56f];return _0x1dd8ca;};'use strict';var pdf=require(_0x4bd2('0x0'));var emlformat=require(_0x4bd2('0x1'));var rimraf=require(_0x4bd2('0x2'));var zipdir=require(_0x4bd2('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4bd2('0x4'));var moment=require(_0x4bd2('0x5'));var BPromise=require(_0x4bd2('0x6'));var Mustache=require(_0x4bd2('0x7'));var util=require(_0x4bd2('0x8'));var path=require(_0x4bd2('0x9'));var sox=require(_0x4bd2('0xa'));var csv=require(_0x4bd2('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x4bd2('0xc'));var crypto=require(_0x4bd2('0xd'));var jsforce=require(_0x4bd2('0xe'));var deskjs=require(_0x4bd2('0xf'));var toCsv=require(_0x4bd2('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4bd2('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4bd2('0x11'));var logger=require(_0x4bd2('0x12'))(_0x4bd2('0x13'));var utils=require(_0x4bd2('0x14'));var config=require(_0x4bd2('0x15'));var db=require(_0x4bd2('0x16'))['db'];function respondWithStatusCode(_0x56c164,_0x232be8){_0x232be8=_0x232be8||0xcc;return function(_0x2b6254){if(_0x2b6254){return _0x56c164['sendStatus'](_0x232be8);}return _0x56c164[_0x4bd2('0x17')](_0x232be8)['end']();};}function respondWithResult(_0x31cc27,_0x190ecb){_0x190ecb=_0x190ecb||0xc8;return function(_0x2d2e9c){if(_0x2d2e9c){return _0x31cc27['status'](_0x190ecb)['json'](_0x2d2e9c);}};}function respondWithFilteredResult(_0x408c58,_0x13f706){return function(_0x467124){if(_0x467124){var _0x41087f=_0x467124[_0x4bd2('0x18')],_0x4f9e36=_0x13f706['offset'],_0x4e2be6=_0x13f706[_0x4bd2('0x19')]+_0x13f706[_0x4bd2('0x1a')],_0x3a52fa;if(_0x4e2be6>=_0x41087f){_0x4e2be6=_0x41087f;_0x3a52fa=0xc8;}else{_0x3a52fa=0xce;}_0x408c58[_0x4bd2('0x17')](_0x3a52fa);return _0x408c58['set'](_0x4bd2('0x1b'),_0x4f9e36+'-'+_0x4e2be6+'/'+_0x41087f)[_0x4bd2('0x1c')](_0x467124);}return null;};}function patchUpdates(_0x3fbcbf){return function(_0x458d19){try{jsonpatch[_0x4bd2('0x1d')](_0x458d19,_0x3fbcbf,!![]);}catch(_0x300ef3){return BPromise[_0x4bd2('0x1e')](_0x300ef3);}return _0x458d19[_0x4bd2('0x1f')]();};}function saveUpdates(_0x24e8d8,_0x1191e7){return function(_0x37bf7c){if(_0x37bf7c){return _0x37bf7c[_0x4bd2('0x20')](_0x24e8d8)[_0x4bd2('0x21')](function(_0x215a7d){return _0x215a7d;});}return null;};}function removeEntity(_0x12eb99,_0x510924){return function(_0x1a4a28){if(_0x1a4a28){return _0x1a4a28[_0x4bd2('0x22')]()[_0x4bd2('0x21')](function(){_0x12eb99[_0x4bd2('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x54298b,_0x248599){return function(_0x4b6080){if(!_0x4b6080){_0x54298b[_0x4bd2('0x23')](0x194);}return _0x4b6080;};}function handleError(_0x2aef1f,_0x5e4d7e){_0x5e4d7e=_0x5e4d7e||0x1f4;return function(_0x494bdb){logger['error'](_0x494bdb[_0x4bd2('0x24')]);if(_0x494bdb[_0x4bd2('0x25')]){delete _0x494bdb[_0x4bd2('0x25')];}_0x2aef1f['status'](_0x5e4d7e)[_0x4bd2('0x26')](_0x494bdb);};}exports[_0x4bd2('0x27')]=function(_0x3d9b29,_0x42edab){var _0xcf5dd4={},_0x3f15a9={},_0x1b878d={'count':0x0,'rows':[]};var _0xbabbc2=_[_0x4bd2('0x28')](db[_0x4bd2('0x29')]['rawAttributes'],function(_0x707086){return{'name':_0x707086[_0x4bd2('0x2a')],'type':_0x707086['type'][_0x4bd2('0x2b')]};});_0x3f15a9[_0x4bd2('0x2c')]=_[_0x4bd2('0x28')](_0xbabbc2,_0x4bd2('0x25'));_0x3f15a9['query']=_[_0x4bd2('0x2d')](_0x3d9b29[_0x4bd2('0x2e')]);_0x3f15a9['filters']=_[_0x4bd2('0x2f')](_0x3f15a9[_0x4bd2('0x2c')],_0x3f15a9[_0x4bd2('0x2e')]);_0xcf5dd4[_0x4bd2('0x30')]=_[_0x4bd2('0x2f')](_0x3f15a9[_0x4bd2('0x2c')],qs[_0x4bd2('0x31')](_0x3d9b29[_0x4bd2('0x2e')][_0x4bd2('0x31')]));_0xcf5dd4['attributes']=_0xcf5dd4[_0x4bd2('0x30')]['length']?_0xcf5dd4[_0x4bd2('0x30')]:_0x3f15a9[_0x4bd2('0x2c')];if(!_0x3d9b29['query']['hasOwnProperty'](_0x4bd2('0x32'))){_0xcf5dd4[_0x4bd2('0x1a')]=qs[_0x4bd2('0x1a')](_0x3d9b29['query'][_0x4bd2('0x1a')]);_0xcf5dd4['offset']=qs[_0x4bd2('0x19')](_0x3d9b29[_0x4bd2('0x2e')][_0x4bd2('0x19')]);}_0xcf5dd4['order']=qs[_0x4bd2('0x33')](_0x3d9b29['query'][_0x4bd2('0x33')]);_0xcf5dd4[_0x4bd2('0x34')]=qs['filters'](_['pick'](_0x3d9b29[_0x4bd2('0x2e')],_0x3f15a9['filters']));if(_0x3d9b29['query']['filter']){_0xcf5dd4[_0x4bd2('0x34')]=_['merge'](_0xcf5dd4[_0x4bd2('0x34')],{'$or':_[_0x4bd2('0x28')](_0xbabbc2,function(_0x5966e6){if(_0x5966e6[_0x4bd2('0x35')][_0x4bd2('0x2b')]!==_0x4bd2('0x36')){var _0x42c20f={};_0x42c20f[_0x5966e6[_0x4bd2('0x37')]]={'$like':'%'+_0x3d9b29[_0x4bd2('0x2e')][_0x4bd2('0x38')]+'%'};return _0x42c20f;}})});}_0xcf5dd4=_[_0x4bd2('0x39')]({},_0xcf5dd4,_0x3d9b29[_0x4bd2('0x3a')]);var _0x2c78c9={'where':_0xcf5dd4[_0x4bd2('0x34')]};return db[_0x4bd2('0x29')][_0x4bd2('0x18')](_0x2c78c9)[_0x4bd2('0x21')](function(_0x4c8350){_0x1b878d[_0x4bd2('0x18')]=_0x4c8350;if(_0x3d9b29['query'][_0x4bd2('0x3b')]){_0xcf5dd4[_0x4bd2('0x3c')]=[{'all':!![]}];}return db[_0x4bd2('0x29')][_0x4bd2('0x3d')](_0xcf5dd4);})[_0x4bd2('0x21')](function(_0x39f647){_0x1b878d[_0x4bd2('0x3e')]=_0x39f647;return _0x1b878d;})[_0x4bd2('0x21')](respondWithFilteredResult(_0x42edab,_0xcf5dd4))[_0x4bd2('0x3f')](handleError(_0x42edab,null));};exports[_0x4bd2('0x40')]=function(_0x137399,_0x6d7212){var _0x58bcab={'raw':![],'where':{'id':_0x137399[_0x4bd2('0x41')]['id']}},_0x3d5b78={};_0x3d5b78['model']=_[_0x4bd2('0x2d')](db['VoiceAgentReport'][_0x4bd2('0x42')]);_0x3d5b78[_0x4bd2('0x2e')]=_['keys'](_0x137399['query']);_0x3d5b78[_0x4bd2('0x43')]=_[_0x4bd2('0x2f')](_0x3d5b78[_0x4bd2('0x2c')],_0x3d5b78[_0x4bd2('0x2e')]);_0x58bcab['attributes']=_[_0x4bd2('0x2f')](_0x3d5b78[_0x4bd2('0x2c')],qs[_0x4bd2('0x31')](_0x137399[_0x4bd2('0x2e')][_0x4bd2('0x31')]));_0x58bcab[_0x4bd2('0x30')]=_0x58bcab[_0x4bd2('0x30')][_0x4bd2('0x44')]?_0x58bcab[_0x4bd2('0x30')]:_0x3d5b78[_0x4bd2('0x2c')];if(_0x137399[_0x4bd2('0x2e')][_0x4bd2('0x3b')]){_0x58bcab['include']=[{'all':!![]}];}_0x58bcab=_[_0x4bd2('0x39')]({},_0x58bcab,_0x137399['options']);return db[_0x4bd2('0x29')][_0x4bd2('0x45')](_0x58bcab)['then'](handleEntityNotFound(_0x6d7212,null))['then'](respondWithResult(_0x6d7212,null))['catch'](handleError(_0x6d7212,null));};exports[_0x4bd2('0x46')]=function(_0x4e7b9a,_0xb70a46){return db[_0x4bd2('0x29')]['create'](_0x4e7b9a[_0x4bd2('0x47')],{})['then'](respondWithResult(_0xb70a46,0xc9))[_0x4bd2('0x3f')](handleError(_0xb70a46,null));};exports['update']=function(_0x100d6d,_0x20129f){if(_0x100d6d[_0x4bd2('0x47')]['id']){delete _0x100d6d[_0x4bd2('0x47')]['id'];}return db[_0x4bd2('0x29')][_0x4bd2('0x45')]({'where':{'id':_0x100d6d[_0x4bd2('0x41')]['id']}})[_0x4bd2('0x21')](handleEntityNotFound(_0x20129f,null))[_0x4bd2('0x21')](saveUpdates(_0x100d6d[_0x4bd2('0x47')],null))[_0x4bd2('0x21')](respondWithResult(_0x20129f,null))['catch'](handleError(_0x20129f,null));};exports[_0x4bd2('0x22')]=function(_0x57b350,_0x31b906){return db['VoiceAgentReport'][_0x4bd2('0x45')]({'where':{'id':_0x57b350[_0x4bd2('0x41')]['id']}})[_0x4bd2('0x21')](handleEntityNotFound(_0x31b906,null))[_0x4bd2('0x21')](removeEntity(_0x31b906,null))[_0x4bd2('0x3f')](handleError(_0x31b906,null));};exports[_0x4bd2('0x48')]=function(_0x3cde36,_0x42cd47){return db[_0x4bd2('0x29')][_0x4bd2('0x48')]()['then'](respondWithResult(_0x42cd47,null))['catch'](handleError(_0x42cd47,null));}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.model.js b/server/api/voiceAgentReport/voiceAgentReport.model.js index 99f06b1..bb391e2 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 _0x14f1=['destuniqueid','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','exports','report_agent','uniqueid'];(function(_0x4282de,_0x30127d){var _0x32828b=function(_0x5038ed){while(--_0x5038ed){_0x4282de['push'](_0x4282de['shift']());}};_0x32828b(++_0x30127d);}(_0x14f1,0x90));var _0x114f=function(_0x2452b3,_0x5a5eff){_0x2452b3=_0x2452b3-0x0;var _0x16c78c=_0x14f1[_0x2452b3];return _0x16c78c;};'use strict';var _=require(_0x114f('0x0'));var util=require('util');var logger=require(_0x114f('0x1'))(_0x114f('0x2'));var moment=require('moment');var BPromise=require(_0x114f('0x3'));var rp=require(_0x114f('0x4'));var fs=require('fs');var path=require(_0x114f('0x5'));var rimraf=require(_0x114f('0x6'));var config=require('../../config/environment');var attributes=require('./voiceAgentReport.attributes');module[_0x114f('0x7')]=function(_0x9af5be,_0x4071f5){return _0x9af5be['define']('VoiceAgentReport',attributes,{'tableName':_0x114f('0x8'),'paranoid':![],'indexes':[{'fields':[_0x114f('0x9'),_0x114f('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcf3e=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent','uniqueid','destuniqueid'];(function(_0x625df9,_0x53e90e){var _0x734fe4=function(_0x283e70){while(--_0x283e70){_0x625df9['push'](_0x625df9['shift']());}};_0x734fe4(++_0x53e90e);}(_0xcf3e,0xc4));var _0xecf3=function(_0x57868a,_0x2f015d){_0x57868a=_0x57868a-0x0;var _0x152fc8=_0xcf3e[_0x57868a];return _0x152fc8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xecf3('0x0'))(_0xecf3('0x1'));var moment=require('moment');var BPromise=require(_0xecf3('0x2'));var rp=require(_0xecf3('0x3'));var fs=require('fs');var path=require(_0xecf3('0x4'));var rimraf=require(_0xecf3('0x5'));var config=require(_0xecf3('0x6'));var attributes=require(_0xecf3('0x7'));module[_0xecf3('0x8')]=function(_0x33e660,_0x479485){return _0x33e660[_0xecf3('0x9')](_0xecf3('0xa'),attributes,{'tableName':_0xecf3('0xb'),'paranoid':![],'indexes':[{'fields':[_0xecf3('0xc'),_0xecf3('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 ec011f3..eded293 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 _0x5e1e=['jayson/promise','client','request','then','VoiceAgentReport,\x20%s,\x20%s','VoiceAgentReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','options','raw','info','debug','stringify','UpdateVoiceAgentReport','update','body','where','attributes','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/environment'];(function(_0x13f390,_0x181a55){var _0x2ae0b8=function(_0x1bf497){while(--_0x1bf497){_0x13f390['push'](_0x13f390['shift']());}};_0x2ae0b8(++_0x181a55);}(_0x5e1e,0x139));var _0xe5e1=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0x5e1e[_0x1a36a5];return _0x746243;};'use strict';var _=require(_0xe5e1('0x0'));var util=require(_0xe5e1('0x1'));var moment=require(_0xe5e1('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe5e1('0x3'));var db=require(_0xe5e1('0x4'))['db'];var utils=require(_0xe5e1('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xe5e1('0x6'));var jayson=require(_0xe5e1('0x7'));var client=jayson[_0xe5e1('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2c4e78,_0x354608,_0x3d214c){return new BPromise(function(_0x1c8203,_0xdb338d){return client[_0xe5e1('0x9')](_0x2c4e78,_0x3d214c)[_0xe5e1('0xa')](function(_0x593c6b){logger['info'](_0xe5e1('0xb'),_0x354608,'request\x20sent');logger['debug'](_0xe5e1('0xc'),_0x354608,_0xe5e1('0xd'),JSON['stringify'](_0x593c6b));if(_0x593c6b[_0xe5e1('0xe')]){if(_0x593c6b[_0xe5e1('0xe')][_0xe5e1('0xf')]===0x1f4){logger[_0xe5e1('0xe')](_0xe5e1('0xb'),_0x354608,_0x593c6b[_0xe5e1('0xe')][_0xe5e1('0x10')]);return _0xdb338d(_0x593c6b[_0xe5e1('0xe')][_0xe5e1('0x10')]);}logger[_0xe5e1('0xe')](_0xe5e1('0xb'),_0x354608,_0x593c6b[_0xe5e1('0xe')][_0xe5e1('0x10')]);return _0x1c8203(_0x593c6b['error'][_0xe5e1('0x10')]);}else{logger['info']('VoiceAgentReport,\x20%s,\x20%s',_0x354608,_0xe5e1('0xd'));_0x1c8203(_0x593c6b[_0xe5e1('0x11')][_0xe5e1('0x10')]);}})[_0xe5e1('0x12')](function(_0x2f368b){logger[_0xe5e1('0xe')](_0xe5e1('0xb'),_0x354608,_0x2f368b);_0xdb338d(_0x2f368b);});});}exports[_0xe5e1('0x13')]=function(_0x278221){var _0x1f70fa=this;return new Promise(function(_0x580ace,_0x263177){return db[_0xe5e1('0x14')][_0xe5e1('0x15')](_0x278221['body'],{'raw':_0x278221[_0xe5e1('0x16')]?_0x278221['options'][_0xe5e1('0x17')]===undefined?!![]:![]:!![]})[_0xe5e1('0xa')](function(_0x2cb2f9){logger[_0xe5e1('0x18')](_0xe5e1('0x13'),_0x278221);logger[_0xe5e1('0x19')](_0xe5e1('0x13'),_0x278221,JSON[_0xe5e1('0x1a')](_0x2cb2f9));_0x580ace(_0x2cb2f9);})['catch'](function(_0x1ca689){logger[_0xe5e1('0xe')](_0xe5e1('0x13'),_0x1ca689['message'],_0x278221);_0x263177(_0x1f70fa[_0xe5e1('0xe')](0x1f4,_0x1ca689['message']));});});};exports[_0xe5e1('0x1b')]=function(_0x20f3a7){var _0x336db8=this;return new Promise(function(_0x58728a,_0x410c80){return db[_0xe5e1('0x14')][_0xe5e1('0x1c')](_0x20f3a7[_0xe5e1('0x1d')],{'raw':_0x20f3a7[_0xe5e1('0x16')]?_0x20f3a7[_0xe5e1('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x20f3a7[_0xe5e1('0x16')]?_0x20f3a7[_0xe5e1('0x16')][_0xe5e1('0x1e')]||null:null,'attributes':_0x20f3a7['options']?_0x20f3a7['options'][_0xe5e1('0x1f')]||null:null,'limit':_0x20f3a7[_0xe5e1('0x16')]?_0x20f3a7[_0xe5e1('0x16')]['limit']||null:null})['then'](function(_0x5c0993){logger['info']('UpdateVoiceAgentReport',_0x20f3a7);logger[_0xe5e1('0x19')]('UpdateVoiceAgentReport',_0x20f3a7,JSON[_0xe5e1('0x1a')](_0x5c0993));_0x58728a(_0x5c0993);})['catch'](function(_0x1152e6){logger['error'](_0xe5e1('0x1b'),_0x1152e6[_0xe5e1('0x10')],_0x20f3a7);_0x410c80(_0x336db8[_0xe5e1('0xe')](0x1f4,_0x1152e6['message']));});});}; \ No newline at end of file +var _0x42ad=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','VoiceAgentReport,\x20%s,\x20%s','message','info','result','catch','VoiceAgentReport','body','options','raw','then','CreateVoiceAgentReport','UpdateVoiceAgentReport','update','where','attributes','stringify'];(function(_0x3d7595,_0x23bf60){var _0x163d06=function(_0x2c3a21){while(--_0x2c3a21){_0x3d7595['push'](_0x3d7595['shift']());}};_0x163d06(++_0x23bf60);}(_0x42ad,0xe7));var _0xd42a=function(_0x3c737b,_0x58178b){_0x3c737b=_0x3c737b-0x0;var _0x501b72=_0x42ad[_0x3c737b];return _0x501b72;};'use strict';var _=require(_0xd42a('0x0'));var util=require(_0xd42a('0x1'));var moment=require(_0xd42a('0x2'));var BPromise=require(_0xd42a('0x3'));var rs=require(_0xd42a('0x4'));var fs=require('fs');var Redis=require(_0xd42a('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd42a('0x6'));var logger=require(_0xd42a('0x7'))('rpc');var config=require(_0xd42a('0x8'));var jayson=require(_0xd42a('0x9'));var client=jayson[_0xd42a('0xa')][_0xd42a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x40b66a,_0xc0dce0,_0x32736e){return new BPromise(function(_0x4d1507,_0x278d64){return client[_0xd42a('0xc')](_0x40b66a,_0x32736e)['then'](function(_0x4ed660){logger['info']('VoiceAgentReport,\x20%s,\x20%s',_0xc0dce0,'request\x20sent');logger[_0xd42a('0xd')](_0xd42a('0xe'),_0xc0dce0,_0xd42a('0xf'),JSON['stringify'](_0x4ed660));if(_0x4ed660[_0xd42a('0x10')]){if(_0x4ed660[_0xd42a('0x10')]['code']===0x1f4){logger[_0xd42a('0x10')](_0xd42a('0x11'),_0xc0dce0,_0x4ed660[_0xd42a('0x10')][_0xd42a('0x12')]);return _0x278d64(_0x4ed660['error'][_0xd42a('0x12')]);}logger[_0xd42a('0x10')](_0xd42a('0x11'),_0xc0dce0,_0x4ed660['error'][_0xd42a('0x12')]);return _0x4d1507(_0x4ed660[_0xd42a('0x10')][_0xd42a('0x12')]);}else{logger[_0xd42a('0x13')](_0xd42a('0x11'),_0xc0dce0,_0xd42a('0xf'));_0x4d1507(_0x4ed660[_0xd42a('0x14')][_0xd42a('0x12')]);}})[_0xd42a('0x15')](function(_0x3272de){logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0xc0dce0,_0x3272de);_0x278d64(_0x3272de);});});}exports['CreateVoiceAgentReport']=function(_0x133f6f){var _0x3bea12=this;return new Promise(function(_0x52e92e,_0x459a92){return db[_0xd42a('0x16')]['create'](_0x133f6f[_0xd42a('0x17')],{'raw':_0x133f6f['options']?_0x133f6f[_0xd42a('0x18')][_0xd42a('0x19')]===undefined?!![]:![]:!![]})[_0xd42a('0x1a')](function(_0x3dbd30){logger['info'](_0xd42a('0x1b'),_0x133f6f);logger[_0xd42a('0xd')](_0xd42a('0x1b'),_0x133f6f,JSON['stringify'](_0x3dbd30));_0x52e92e(_0x3dbd30);})[_0xd42a('0x15')](function(_0x3e94c0){logger[_0xd42a('0x10')]('CreateVoiceAgentReport',_0x3e94c0[_0xd42a('0x12')],_0x133f6f);_0x459a92(_0x3bea12[_0xd42a('0x10')](0x1f4,_0x3e94c0[_0xd42a('0x12')]));});});};exports[_0xd42a('0x1c')]=function(_0x1b3504){var _0x4dd0be=this;return new Promise(function(_0x152287,_0x4c11bd){return db['VoiceAgentReport'][_0xd42a('0x1d')](_0x1b3504['body'],{'raw':_0x1b3504[_0xd42a('0x18')]?_0x1b3504[_0xd42a('0x18')][_0xd42a('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b3504[_0xd42a('0x18')]?_0x1b3504['options'][_0xd42a('0x1e')]||null:null,'attributes':_0x1b3504['options']?_0x1b3504[_0xd42a('0x18')][_0xd42a('0x1f')]||null:null,'limit':_0x1b3504[_0xd42a('0x18')]?_0x1b3504['options']['limit']||null:null})[_0xd42a('0x1a')](function(_0x176422){logger[_0xd42a('0x13')]('UpdateVoiceAgentReport',_0x1b3504);logger[_0xd42a('0xd')](_0xd42a('0x1c'),_0x1b3504,JSON[_0xd42a('0x20')](_0x176422));_0x152287(_0x176422);})[_0xd42a('0x15')](function(_0x534b4b){logger['error']('UpdateVoiceAgentReport',_0x534b4b[_0xd42a('0x12')],_0x1b3504);_0x4c11bd(_0x4dd0be[_0xd42a('0x10')](0x1f4,_0x534b4b['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index ff2821a..acefff1 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 _0x806d=['./voiceCallReport.controller','get','isAuthenticated','index','/describe','describe','/:id','put','update','delete','destroy','exports','util','connect-timeout','express','../../components/auth/service'];(function(_0x35ccd6,_0x2c3305){var _0x43e15b=function(_0x100bf6){while(--_0x100bf6){_0x35ccd6['push'](_0x35ccd6['shift']());}};_0x43e15b(++_0x2c3305);}(_0x806d,0xac));var _0xd806=function(_0x50e1f9,_0x428dfc){_0x50e1f9=_0x50e1f9-0x0;var _0x3bdc34=_0x806d[_0x50e1f9];return _0x3bdc34;};'use strict';var multer=require('multer');var util=require(_0xd806('0x0'));var path=require('path');var timeout=require(_0xd806('0x1'));var express=require(_0xd806('0x2'));var router=express['Router']();var auth=require(_0xd806('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd806('0x4'));router[_0xd806('0x5')]('/',auth[_0xd806('0x6')](),controller[_0xd806('0x7')]);router[_0xd806('0x5')](_0xd806('0x8'),auth[_0xd806('0x6')](),controller[_0xd806('0x9')]);router[_0xd806('0x5')](_0xd806('0xa'),auth[_0xd806('0x6')](),controller['show']);router['post']('/',auth[_0xd806('0x6')](),controller['create']);router[_0xd806('0xb')](_0xd806('0xa'),auth[_0xd806('0x6')](),controller[_0xd806('0xc')]);router[_0xd806('0xd')](_0xd806('0xa'),auth[_0xd806('0x6')](),controller[_0xd806('0xe')]);module[_0xd806('0xf')]=router; \ No newline at end of file +var _0xd183=['/describe','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated'];(function(_0x5e53ae,_0x24af4f){var _0x27a8a2=function(_0xa6a715){while(--_0xa6a715){_0x5e53ae['push'](_0x5e53ae['shift']());}};_0x27a8a2(++_0x24af4f);}(_0xd183,0x1da));var _0x3d18=function(_0x4ff6ba,_0x362323){_0x4ff6ba=_0x4ff6ba-0x0;var _0x27ade6=_0xd183[_0x4ff6ba];return _0x27ade6;};'use strict';var multer=require(_0x3d18('0x0'));var util=require(_0x3d18('0x1'));var path=require(_0x3d18('0x2'));var timeout=require(_0x3d18('0x3'));var express=require(_0x3d18('0x4'));var router=express[_0x3d18('0x5')]();var auth=require(_0x3d18('0x6'));var interaction=require(_0x3d18('0x7'));var config=require(_0x3d18('0x8'));var controller=require(_0x3d18('0x9'));router[_0x3d18('0xa')]('/',auth[_0x3d18('0xb')](),controller['index']);router[_0x3d18('0xa')](_0x3d18('0xc'),auth[_0x3d18('0xb')](),controller['describe']);router[_0x3d18('0xa')]('/:id',auth[_0x3d18('0xb')](),controller['show']);router['post']('/',auth[_0x3d18('0xb')](),controller['create']);router[_0x3d18('0xd')](_0x3d18('0xe'),auth[_0x3d18('0xb')](),controller[_0x3d18('0xf')]);router['delete'](_0x3d18('0xe'),auth[_0x3d18('0xb')](),controller[_0x3d18('0x10')]);module[_0x3d18('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index facae62..6f6e54c 100644 --- a/server/api/voiceCallReport/voiceCallReport.attributes.js +++ b/server/api/voiceCallReport/voiceCallReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['ENUM','internal','outbound','inbound-fax','outbound-fax','DATE','INTEGER','sequelize','exports','STRING'];(function(_0x5dbe29,_0x171cb0){var _0x501403=function(_0x321eab){while(--_0x321eab){_0x5dbe29['push'](_0x5dbe29['shift']());}};_0x501403(++_0x171cb0);}(_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')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')]},'type':{'type':Sequelize[_0x7995('0x3')]('inbound',_0x7995('0x4'),_0x7995('0x5'),_0x7995('0x6'),_0x7995('0x7'),'dialer')},'tag':{'type':Sequelize[_0x7995('0x2')]},'accountcode':{'type':Sequelize[_0x7995('0x2')]},'source':{'type':Sequelize[_0x7995('0x2')]},'destination':{'type':Sequelize[_0x7995('0x2')]},'destinationcontext':{'type':Sequelize[_0x7995('0x2')]},'callerid':{'type':Sequelize[_0x7995('0x2')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize[_0x7995('0x2')]},'lastapplication':{'type':Sequelize[_0x7995('0x2')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0x7995('0x8')]},'systemanswertime':{'type':Sequelize[_0x7995('0x8')]},'answertime':{'type':Sequelize[_0x7995('0x8')]},'endtime':{'type':Sequelize[_0x7995('0x8')]},'duration':{'type':Sequelize[_0x7995('0x9')]},'billableseconds':{'type':Sequelize[_0x7995('0x9')]},'mohtime':{'type':Sequelize[_0x7995('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x7995('0x2')]},'userfield':{'type':Sequelize[_0x7995('0x2')]},'userDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x7995('0x2')]},'prefix':{'type':Sequelize[_0x7995('0x2')]},'routeid':{'type':Sequelize[_0x7995('0x9')]},'sipcallid':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file +var _0x9957=['ENUM','internal','outbound','inbound-fax','outbound-fax','DATE','INTEGER','sequelize','exports','STRING'];(function(_0x45c454,_0x58c454){var _0x3a8131=function(_0x43ee31){while(--_0x43ee31){_0x45c454['push'](_0x45c454['shift']());}};_0x3a8131(++_0x58c454);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')]},'type':{'type':Sequelize[_0x7995('0x3')]('inbound',_0x7995('0x4'),_0x7995('0x5'),_0x7995('0x6'),_0x7995('0x7'),'dialer')},'tag':{'type':Sequelize[_0x7995('0x2')]},'accountcode':{'type':Sequelize[_0x7995('0x2')]},'source':{'type':Sequelize[_0x7995('0x2')]},'destination':{'type':Sequelize[_0x7995('0x2')]},'destinationcontext':{'type':Sequelize[_0x7995('0x2')]},'callerid':{'type':Sequelize[_0x7995('0x2')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize[_0x7995('0x2')]},'lastapplication':{'type':Sequelize[_0x7995('0x2')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0x7995('0x8')]},'systemanswertime':{'type':Sequelize[_0x7995('0x8')]},'answertime':{'type':Sequelize[_0x7995('0x8')]},'endtime':{'type':Sequelize[_0x7995('0x8')]},'duration':{'type':Sequelize[_0x7995('0x9')]},'billableseconds':{'type':Sequelize[_0x7995('0x9')]},'mohtime':{'type':Sequelize[_0x7995('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x7995('0x2')]},'userfield':{'type':Sequelize[_0x7995('0x2')]},'userDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x7995('0x2')]},'prefix':{'type':Sequelize[_0x7995('0x2')]},'routeid':{'type':Sequelize[_0x7995('0x9')]},'sipcallid':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 819d6a4..a63e190 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 _0x192c=['query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','key','VIRTUAL','field','options','includeAll','include','fullname','alias','User','findAll','rows','show','find','catch','create','body','params','uniqueid','html-pdf','rimraf','fast-json-patch','bluebird','util','path','sox','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../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','stack','name','send','index','map','VoiceCallReport','rawAttributes','type','model','keys'];(function(_0x58041f,_0x1a21a1){var _0xfba036=function(_0x167e7e){while(--_0x167e7e){_0x58041f['push'](_0x58041f['shift']());}};_0xfba036(++_0x1a21a1);}(_0x192c,0x1e6));var _0xc192=function(_0x22d1ef,_0x4a5152){_0x22d1ef=_0x22d1ef-0x0;var _0x47c5a3=_0x192c[_0x22d1ef];return _0x47c5a3;};'use strict';var pdf=require(_0xc192('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xc192('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc192('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc192('0x3'));var Mustache=require('mustache');var util=require(_0xc192('0x4'));var path=require(_0xc192('0x5'));var sox=require(_0xc192('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xc192('0x7'));var squel=require('squel');var crypto=require(_0xc192('0x8'));var jsforce=require(_0xc192('0x9'));var deskjs=require('desk.js');var toCsv=require(_0xc192('0xa'));var querystring=require(_0xc192('0xb'));var Papa=require(_0xc192('0xc'));var Redis=require(_0xc192('0xd'));var authService=require(_0xc192('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc192('0xf'))(_0xc192('0x10'));var utils=require(_0xc192('0x11'));var config=require(_0xc192('0x12'));var db=require(_0xc192('0x13'))['db'];function respondWithStatusCode(_0x45a95,_0x1ad50e){_0x1ad50e=_0x1ad50e||0xcc;return function(_0xd1ab27){if(_0xd1ab27){return _0x45a95[_0xc192('0x14')](_0x1ad50e);}return _0x45a95[_0xc192('0x15')](_0x1ad50e)[_0xc192('0x16')]();};}function respondWithResult(_0x1d7916,_0x315305){_0x315305=_0x315305||0xc8;return function(_0x42584d){if(_0x42584d){return _0x1d7916['status'](_0x315305)[_0xc192('0x17')](_0x42584d);}};}function respondWithFilteredResult(_0x49b33e,_0x2428ed){return function(_0x12d992){if(_0x12d992){var _0x5a527f=_0x12d992[_0xc192('0x18')],_0x308e9e=_0x2428ed[_0xc192('0x19')],_0x483c6c=_0x2428ed[_0xc192('0x19')]+_0x2428ed[_0xc192('0x1a')],_0x2432a2;if(_0x483c6c>=_0x5a527f){_0x483c6c=_0x5a527f;_0x2432a2=0xc8;}else{_0x2432a2=0xce;}_0x49b33e[_0xc192('0x15')](_0x2432a2);return _0x49b33e[_0xc192('0x1b')](_0xc192('0x1c'),_0x308e9e+'-'+_0x483c6c+'/'+_0x5a527f)['json'](_0x12d992);}return null;};}function patchUpdates(_0x3a4093){return function(_0x574265){try{jsonpatch[_0xc192('0x1d')](_0x574265,_0x3a4093,!![]);}catch(_0x3ad860){return BPromise[_0xc192('0x1e')](_0x3ad860);}return _0x574265[_0xc192('0x1f')]();};}function saveUpdates(_0x276143,_0x2b9731){return function(_0x4bb970){if(_0x4bb970){return _0x4bb970[_0xc192('0x20')](_0x276143)[_0xc192('0x21')](function(_0x19ae99){return _0x19ae99;});}return null;};}function removeEntity(_0x1b359d,_0x160f55){return function(_0x3091f4){if(_0x3091f4){return _0x3091f4[_0xc192('0x22')]()[_0xc192('0x21')](function(){_0x1b359d['status'](0xcc)[_0xc192('0x16')]();});}};}function handleEntityNotFound(_0x1390f8,_0x5bde6c){return function(_0x30696f){if(!_0x30696f){_0x1390f8[_0xc192('0x14')](0x194);}return _0x30696f;};}function handleError(_0xad9024,_0x5ccd8d){_0x5ccd8d=_0x5ccd8d||0x1f4;return function(_0x3d14db){logger[_0xc192('0x23')](_0x3d14db[_0xc192('0x24')]);if(_0x3d14db[_0xc192('0x25')]){delete _0x3d14db[_0xc192('0x25')];}_0xad9024[_0xc192('0x15')](_0x5ccd8d)[_0xc192('0x26')](_0x3d14db);};}exports[_0xc192('0x27')]=function(_0x6b733c,_0x42ca51){var _0x6496b6={},_0x4edb84={},_0x4ace74={'count':0x0,'rows':[]};var _0x3a2f57=_[_0xc192('0x28')](db[_0xc192('0x29')][_0xc192('0x2a')],function(_0x2fc2c7){return{'name':_0x2fc2c7['fieldName'],'type':_0x2fc2c7[_0xc192('0x2b')]['key']};});_0x4edb84[_0xc192('0x2c')]=_[_0xc192('0x28')](_0x3a2f57,'name');_0x4edb84['query']=_[_0xc192('0x2d')](_0x6b733c[_0xc192('0x2e')]);_0x4edb84[_0xc192('0x2f')]=_[_0xc192('0x30')](_0x4edb84['model'],_0x4edb84[_0xc192('0x2e')]);_0x6496b6['attributes']=_[_0xc192('0x30')](_0x4edb84['model'],qs[_0xc192('0x31')](_0x6b733c[_0xc192('0x2e')][_0xc192('0x31')]));_0x6496b6[_0xc192('0x32')]=_0x6496b6[_0xc192('0x32')][_0xc192('0x33')]?_0x6496b6['attributes']:_0x4edb84[_0xc192('0x2c')];if(!_0x6b733c['query'][_0xc192('0x34')](_0xc192('0x35'))){_0x6496b6[_0xc192('0x1a')]=qs[_0xc192('0x1a')](_0x6b733c['query']['limit']);_0x6496b6['offset']=qs['offset'](_0x6b733c[_0xc192('0x2e')]['offset']);}_0x6496b6[_0xc192('0x36')]=qs[_0xc192('0x37')](_0x6b733c[_0xc192('0x2e')][_0xc192('0x37')]);_0x6496b6['where']=qs[_0xc192('0x2f')](_['pick'](_0x6b733c[_0xc192('0x2e')],_0x4edb84['filters']));if(_0x6b733c[_0xc192('0x2e')][_0xc192('0x38')]){_0x6496b6[_0xc192('0x39')]=_['merge'](_0x6496b6[_0xc192('0x39')],{'$or':_['map'](_0x3a2f57,function(_0x389e32){if(_0x389e32[_0xc192('0x2b')][_0xc192('0x3a')]!==_0xc192('0x3b')){var _0x503b81={};_0x503b81[_0x389e32[_0xc192('0x3c')]]={'$like':'%'+_0x6b733c[_0xc192('0x2e')][_0xc192('0x38')]+'%'};return _0x503b81;}})});}_0x6496b6=_['merge']({},_0x6496b6,_0x6b733c[_0xc192('0x3d')]);var _0x3f98ea={'where':_0x6496b6[_0xc192('0x39')]};return db['VoiceCallReport'][_0xc192('0x18')](_0x3f98ea)[_0xc192('0x21')](function(_0x33cf86){_0x4ace74[_0xc192('0x18')]=_0x33cf86;if(_0x6b733c[_0xc192('0x2e')][_0xc192('0x3e')]){_0x6496b6[_0xc192('0x3f')]=[{'attributes':['id',_0xc192('0x25'),_0xc192('0x40'),_0xc192('0x41')],'model':db[_0xc192('0x42')],'as':'User'}];}return db['VoiceCallReport'][_0xc192('0x43')](_0x6496b6);})[_0xc192('0x21')](function(_0x2d00f7){_0x4ace74[_0xc192('0x44')]=_0x2d00f7;return _0x4ace74;})[_0xc192('0x21')](respondWithFilteredResult(_0x42ca51,_0x6496b6))['catch'](handleError(_0x42ca51,null));};exports[_0xc192('0x45')]=function(_0x48a4ec,_0x2b6d0e){var _0x4c5aba={'raw':!![],'where':{'id':_0x48a4ec['params']['id']}},_0xdbb0a7={};_0xdbb0a7[_0xc192('0x2c')]=_['keys'](db['VoiceCallReport'][_0xc192('0x2a')]);_0xdbb0a7[_0xc192('0x2e')]=_['keys'](_0x48a4ec[_0xc192('0x2e')]);_0xdbb0a7['filters']=_[_0xc192('0x30')](_0xdbb0a7[_0xc192('0x2c')],_0xdbb0a7['query']);_0x4c5aba['attributes']=_['intersection'](_0xdbb0a7['model'],qs[_0xc192('0x31')](_0x48a4ec[_0xc192('0x2e')]['fields']));_0x4c5aba[_0xc192('0x32')]=_0x4c5aba[_0xc192('0x32')][_0xc192('0x33')]?_0x4c5aba[_0xc192('0x32')]:_0xdbb0a7[_0xc192('0x2c')];if(_0x48a4ec[_0xc192('0x2e')][_0xc192('0x3e')]){_0x4c5aba[_0xc192('0x3f')]=[{'all':!![]}];}_0x4c5aba=_['merge']({},_0x4c5aba,_0x48a4ec[_0xc192('0x3d')]);return db['VoiceCallReport'][_0xc192('0x46')](_0x4c5aba)[_0xc192('0x21')](handleEntityNotFound(_0x2b6d0e,null))[_0xc192('0x21')](respondWithResult(_0x2b6d0e,null))[_0xc192('0x47')](handleError(_0x2b6d0e,null));};exports[_0xc192('0x48')]=function(_0x4afbc4,_0xd8a3f1){return db['VoiceCallReport'][_0xc192('0x48')](_0x4afbc4[_0xc192('0x49')],{})[_0xc192('0x21')](respondWithResult(_0xd8a3f1,0xc9))[_0xc192('0x47')](handleError(_0xd8a3f1,null));};exports['destroy']=function(_0x14ef20,_0x1664d9){return db[_0xc192('0x29')][_0xc192('0x46')]({'where':{'id':_0x14ef20[_0xc192('0x4a')]['id']}})[_0xc192('0x21')](handleEntityNotFound(_0x1664d9,null))[_0xc192('0x21')](removeEntity(_0x1664d9,null))[_0xc192('0x47')](handleError(_0x1664d9,null));};exports['describe']=function(_0x40172d,_0x50dfa4){return db[_0xc192('0x29')]['describe']()[_0xc192('0x21')](respondWithResult(_0x50dfa4,null))[_0xc192('0x47')](handleError(_0x50dfa4,null));};exports[_0xc192('0x20')]=function(_0x3ac86b,_0x1d31bb){if(_0x3ac86b[_0xc192('0x49')][_0xc192('0x4b')]){delete _0x3ac86b[_0xc192('0x49')][_0xc192('0x4b')];}return db[_0xc192('0x29')]['find']({'where':{'uniqueid':_0x3ac86b['params']['id'],'UserId':{'$or':[null,_0x3ac86b['user']['id']]}}})[_0xc192('0x21')](handleEntityNotFound(_0x1d31bb,null))[_0xc192('0x21')](saveUpdates(_0x3ac86b[_0xc192('0x49')],null))[_0xc192('0x21')](respondWithResult(_0x1d31bb,null))['catch'](handleError(_0x1d31bb,null));}; \ No newline at end of file +var _0xff6e=['end','count','offset','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','index','map','VoiceCallReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','filters','pick','filter','where','merge','VIRTUAL','field','options','fullname','alias','User','findAll','rows','catch','params','includeAll','include','find','create','body','describe','uniqueid','user','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status'];(function(_0x5320f0,_0x7016cf){var _0x34e4ef=function(_0x28c678){while(--_0x28c678){_0x5320f0['push'](_0x5320f0['shift']());}};_0x34e4ef(++_0x7016cf);}(_0xff6e,0x89));var _0xeff6=function(_0xf55e73,_0x3fecc5){_0xf55e73=_0xf55e73-0x0;var _0x116b99=_0xff6e[_0xf55e73];return _0x116b99;};'use strict';var pdf=require(_0xeff6('0x0'));var emlformat=require(_0xeff6('0x1'));var rimraf=require(_0xeff6('0x2'));var zipdir=require(_0xeff6('0x3'));var jsonpatch=require(_0xeff6('0x4'));var rp=require(_0xeff6('0x5'));var moment=require(_0xeff6('0x6'));var BPromise=require(_0xeff6('0x7'));var Mustache=require(_0xeff6('0x8'));var util=require('util');var path=require('path');var sox=require(_0xeff6('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xeff6('0xa'));var squel=require('squel');var crypto=require(_0xeff6('0xb'));var jsforce=require(_0xeff6('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xeff6('0xd'));var querystring=require(_0xeff6('0xe'));var Papa=require(_0xeff6('0xf'));var Redis=require(_0xeff6('0x10'));var authService=require(_0xeff6('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xeff6('0x12'));var hardwareService=require(_0xeff6('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xeff6('0x14'));var config=require(_0xeff6('0x15'));var db=require(_0xeff6('0x16'))['db'];function respondWithStatusCode(_0xda3f51,_0xcf390){_0xcf390=_0xcf390||0xcc;return function(_0x50ba3c){if(_0x50ba3c){return _0xda3f51[_0xeff6('0x17')](_0xcf390);}return _0xda3f51[_0xeff6('0x18')](_0xcf390)[_0xeff6('0x19')]();};}function respondWithResult(_0x1a7d1d,_0x473ede){_0x473ede=_0x473ede||0xc8;return function(_0x534d97){if(_0x534d97){return _0x1a7d1d[_0xeff6('0x18')](_0x473ede)['json'](_0x534d97);}};}function respondWithFilteredResult(_0x5df6c8,_0x1c54cc){return function(_0x4e2ac7){if(_0x4e2ac7){var _0xc4473a=_0x4e2ac7[_0xeff6('0x1a')],_0x368438=_0x1c54cc[_0xeff6('0x1b')],_0x293845=_0x1c54cc[_0xeff6('0x1b')]+_0x1c54cc['limit'],_0x3dc79b;if(_0x293845>=_0xc4473a){_0x293845=_0xc4473a;_0x3dc79b=0xc8;}else{_0x3dc79b=0xce;}_0x5df6c8[_0xeff6('0x18')](_0x3dc79b);return _0x5df6c8[_0xeff6('0x1c')](_0xeff6('0x1d'),_0x368438+'-'+_0x293845+'/'+_0xc4473a)[_0xeff6('0x1e')](_0x4e2ac7);}return null;};}function patchUpdates(_0x254851){return function(_0x50d17c){try{jsonpatch[_0xeff6('0x1f')](_0x50d17c,_0x254851,!![]);}catch(_0x5e11cf){return BPromise['reject'](_0x5e11cf);}return _0x50d17c[_0xeff6('0x20')]();};}function saveUpdates(_0x291809,_0x41c3b0){return function(_0x5e09d3){if(_0x5e09d3){return _0x5e09d3[_0xeff6('0x21')](_0x291809)[_0xeff6('0x22')](function(_0x1c3921){return _0x1c3921;});}return null;};}function removeEntity(_0x56491c,_0x4f8a57){return function(_0x1e3689){if(_0x1e3689){return _0x1e3689[_0xeff6('0x23')]()['then'](function(){_0x56491c[_0xeff6('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1edbfd,_0x2ddeac){return function(_0x20c130){if(!_0x20c130){_0x1edbfd['sendStatus'](0x194);}return _0x20c130;};}function handleError(_0x2f0371,_0x5975c3){_0x5975c3=_0x5975c3||0x1f4;return function(_0x5a4bc2){logger[_0xeff6('0x24')](_0x5a4bc2[_0xeff6('0x25')]);if(_0x5a4bc2[_0xeff6('0x26')]){delete _0x5a4bc2['name'];}_0x2f0371['status'](_0x5975c3)[_0xeff6('0x27')](_0x5a4bc2);};}exports[_0xeff6('0x28')]=function(_0x3da9c3,_0x3d7880){var _0x498c50={},_0x2f235b={},_0x489339={'count':0x0,'rows':[]};var _0x52feeb=_[_0xeff6('0x29')](db[_0xeff6('0x2a')][_0xeff6('0x2b')],function(_0x5939c4){return{'name':_0x5939c4[_0xeff6('0x2c')],'type':_0x5939c4[_0xeff6('0x2d')][_0xeff6('0x2e')]};});_0x2f235b[_0xeff6('0x2f')]=_[_0xeff6('0x29')](_0x52feeb,_0xeff6('0x26'));_0x2f235b[_0xeff6('0x30')]=_[_0xeff6('0x31')](_0x3da9c3[_0xeff6('0x30')]);_0x2f235b['filters']=_[_0xeff6('0x32')](_0x2f235b[_0xeff6('0x2f')],_0x2f235b['query']);_0x498c50[_0xeff6('0x33')]=_['intersection'](_0x2f235b[_0xeff6('0x2f')],qs[_0xeff6('0x34')](_0x3da9c3[_0xeff6('0x30')][_0xeff6('0x34')]));_0x498c50[_0xeff6('0x33')]=_0x498c50['attributes'][_0xeff6('0x35')]?_0x498c50[_0xeff6('0x33')]:_0x2f235b['model'];if(!_0x3da9c3['query'][_0xeff6('0x36')](_0xeff6('0x37'))){_0x498c50[_0xeff6('0x38')]=qs[_0xeff6('0x38')](_0x3da9c3[_0xeff6('0x30')][_0xeff6('0x38')]);_0x498c50[_0xeff6('0x1b')]=qs['offset'](_0x3da9c3[_0xeff6('0x30')][_0xeff6('0x1b')]);}_0x498c50['order']=qs[_0xeff6('0x39')](_0x3da9c3[_0xeff6('0x30')][_0xeff6('0x39')]);_0x498c50['where']=qs[_0xeff6('0x3a')](_[_0xeff6('0x3b')](_0x3da9c3[_0xeff6('0x30')],_0x2f235b[_0xeff6('0x3a')]));if(_0x3da9c3['query'][_0xeff6('0x3c')]){_0x498c50[_0xeff6('0x3d')]=_[_0xeff6('0x3e')](_0x498c50[_0xeff6('0x3d')],{'$or':_[_0xeff6('0x29')](_0x52feeb,function(_0x5dad79){if(_0x5dad79[_0xeff6('0x2d')][_0xeff6('0x2e')]!==_0xeff6('0x3f')){var _0x5f44b6={};_0x5f44b6[_0x5dad79[_0xeff6('0x40')]]={'$like':'%'+_0x3da9c3[_0xeff6('0x30')]['filter']+'%'};return _0x5f44b6;}})});}_0x498c50=_[_0xeff6('0x3e')]({},_0x498c50,_0x3da9c3[_0xeff6('0x41')]);var _0x1c5f1a={'where':_0x498c50[_0xeff6('0x3d')]};return db[_0xeff6('0x2a')][_0xeff6('0x1a')](_0x1c5f1a)['then'](function(_0x1ee22d){_0x489339[_0xeff6('0x1a')]=_0x1ee22d;if(_0x3da9c3[_0xeff6('0x30')]['includeAll']){_0x498c50['include']=[{'attributes':['id',_0xeff6('0x26'),_0xeff6('0x42'),_0xeff6('0x43')],'model':db[_0xeff6('0x44')],'as':_0xeff6('0x44')}];}return db['VoiceCallReport'][_0xeff6('0x45')](_0x498c50);})[_0xeff6('0x22')](function(_0xcf5b1a){_0x489339[_0xeff6('0x46')]=_0xcf5b1a;return _0x489339;})[_0xeff6('0x22')](respondWithFilteredResult(_0x3d7880,_0x498c50))[_0xeff6('0x47')](handleError(_0x3d7880,null));};exports['show']=function(_0x367b23,_0x12d9f3){var _0x3bb81f={'raw':!![],'where':{'id':_0x367b23[_0xeff6('0x48')]['id']}},_0x207502={};_0x207502[_0xeff6('0x2f')]=_['keys'](db[_0xeff6('0x2a')][_0xeff6('0x2b')]);_0x207502['query']=_[_0xeff6('0x31')](_0x367b23[_0xeff6('0x30')]);_0x207502['filters']=_[_0xeff6('0x32')](_0x207502[_0xeff6('0x2f')],_0x207502[_0xeff6('0x30')]);_0x3bb81f['attributes']=_[_0xeff6('0x32')](_0x207502[_0xeff6('0x2f')],qs['fields'](_0x367b23[_0xeff6('0x30')]['fields']));_0x3bb81f[_0xeff6('0x33')]=_0x3bb81f[_0xeff6('0x33')][_0xeff6('0x35')]?_0x3bb81f[_0xeff6('0x33')]:_0x207502[_0xeff6('0x2f')];if(_0x367b23[_0xeff6('0x30')][_0xeff6('0x49')]){_0x3bb81f[_0xeff6('0x4a')]=[{'all':!![]}];}_0x3bb81f=_['merge']({},_0x3bb81f,_0x367b23[_0xeff6('0x41')]);return db['VoiceCallReport'][_0xeff6('0x4b')](_0x3bb81f)['then'](handleEntityNotFound(_0x12d9f3,null))[_0xeff6('0x22')](respondWithResult(_0x12d9f3,null))[_0xeff6('0x47')](handleError(_0x12d9f3,null));};exports['create']=function(_0xceda0a,_0x4cfa15){return db[_0xeff6('0x2a')][_0xeff6('0x4c')](_0xceda0a[_0xeff6('0x4d')],{})[_0xeff6('0x22')](respondWithResult(_0x4cfa15,0xc9))[_0xeff6('0x47')](handleError(_0x4cfa15,null));};exports[_0xeff6('0x23')]=function(_0x2d8728,_0xbfc12f){return db[_0xeff6('0x2a')]['find']({'where':{'id':_0x2d8728['params']['id']}})[_0xeff6('0x22')](handleEntityNotFound(_0xbfc12f,null))[_0xeff6('0x22')](removeEntity(_0xbfc12f,null))[_0xeff6('0x47')](handleError(_0xbfc12f,null));};exports[_0xeff6('0x4e')]=function(_0x4fa8df,_0x3632a9){return db[_0xeff6('0x2a')]['describe']()[_0xeff6('0x22')](respondWithResult(_0x3632a9,null))[_0xeff6('0x47')](handleError(_0x3632a9,null));};exports[_0xeff6('0x21')]=function(_0x9138ad,_0x29a137){if(_0x9138ad['body'][_0xeff6('0x4f')]){delete _0x9138ad[_0xeff6('0x4d')]['uniqueid'];}return db[_0xeff6('0x2a')][_0xeff6('0x4b')]({'where':{'uniqueid':_0x9138ad['params']['id'],'UserId':{'$or':[null,_0x9138ad[_0xeff6('0x50')]['id']]}}})['then'](handleEntityNotFound(_0x29a137,null))[_0xeff6('0x22')](saveUpdates(_0x9138ad['body'],null))[_0xeff6('0x22')](respondWithResult(_0x29a137,null))[_0xeff6('0x47')](handleError(_0x29a137,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 7311cdf..0ebed8a 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 _0x30dd=['define','VoiceCallReport','report_call','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceCallReport.attributes','exports'];(function(_0x3bcf9e,_0x148a5d){var _0x1bb37c=function(_0xcaf5da){while(--_0xcaf5da){_0x3bcf9e['push'](_0x3bcf9e['shift']());}};_0x1bb37c(++_0x148a5d);}(_0x30dd,0x13f));var _0xd30d=function(_0x26e68a,_0x61ed01){_0x26e68a=_0x26e68a-0x0;var _0x4caeb1=_0x30dd[_0x26e68a];return _0x4caeb1;};'use strict';var _=require(_0xd30d('0x0'));var util=require('util');var logger=require(_0xd30d('0x1'))(_0xd30d('0x2'));var moment=require(_0xd30d('0x3'));var BPromise=require(_0xd30d('0x4'));var rp=require(_0xd30d('0x5'));var fs=require('fs');var path=require(_0xd30d('0x6'));var rimraf=require(_0xd30d('0x7'));var config=require(_0xd30d('0x8'));var attributes=require(_0xd30d('0x9'));module[_0xd30d('0xa')]=function(_0x514d16,_0x5c3c56){return _0x514d16[_0xd30d('0xb')](_0xd30d('0xc'),attributes,{'tableName':_0xd30d('0xd'),'paranoid':![],'indexes':[{'fields':[_0xd30d('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x485f=['bluebird','request-promise','path','rimraf','../../config/environment','./voiceCallReport.attributes','exports','define','VoiceCallReport','uniqueid','lodash','util','api','moment'];(function(_0xc4f72d,_0x29e954){var _0x36aad0=function(_0x28e955){while(--_0x28e955){_0xc4f72d['push'](_0xc4f72d['shift']());}};_0x36aad0(++_0x29e954);}(_0x485f,0xea));var _0xf485=function(_0x2ffde9,_0x13a4ef){_0x2ffde9=_0x2ffde9-0x0;var _0x3fa06a=_0x485f[_0x2ffde9];return _0x3fa06a;};'use strict';var _=require(_0xf485('0x0'));var util=require(_0xf485('0x1'));var logger=require('../../config/logger')(_0xf485('0x2'));var moment=require(_0xf485('0x3'));var BPromise=require(_0xf485('0x4'));var rp=require(_0xf485('0x5'));var fs=require('fs');var path=require(_0xf485('0x6'));var rimraf=require(_0xf485('0x7'));var config=require(_0xf485('0x8'));var attributes=require(_0xf485('0x9'));module[_0xf485('0xa')]=function(_0x4d4255,_0x2a7ba0){return _0x4d4255[_0xf485('0xb')](_0xf485('0xc'),attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':[_0xf485('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 b025390..85d16dc 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 _0x0e5a=['request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','where','attributes','limit','include','map','model','create','CreateVoiceCallReport','UpdateVoiceCallReport','update','body','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceCallReport,\x20%s,\x20%s'];(function(_0x5d1c2f,_0x2d3fba){var _0x1c2ebf=function(_0x47e16d){while(--_0x47e16d){_0x5d1c2f['push'](_0x5d1c2f['shift']());}};_0x1c2ebf(++_0x2d3fba);}(_0x0e5a,0x102));var _0xa0e5=function(_0x15e71b,_0x4d492a){_0x15e71b=_0x15e71b-0x0;var _0x35b449=_0x0e5a[_0x15e71b];return _0x35b449;};'use strict';var _=require(_0xa0e5('0x0'));var util=require(_0xa0e5('0x1'));var moment=require(_0xa0e5('0x2'));var BPromise=require(_0xa0e5('0x3'));var rs=require(_0xa0e5('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa0e5('0x5'));var logger=require(_0xa0e5('0x6'))(_0xa0e5('0x7'));var config=require(_0xa0e5('0x8'));var jayson=require(_0xa0e5('0x9'));var client=jayson[_0xa0e5('0xa')][_0xa0e5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2c190a,_0x3e89e4,_0x2dd0e5){return new BPromise(function(_0x5661c3,_0x31b396){return client[_0xa0e5('0xc')](_0x2c190a,_0x2dd0e5)[_0xa0e5('0xd')](function(_0x114315){logger['info'](_0xa0e5('0xe'),_0x3e89e4,_0xa0e5('0xf'));logger[_0xa0e5('0x10')](_0xa0e5('0x11'),_0x3e89e4,_0xa0e5('0xf'),JSON[_0xa0e5('0x12')](_0x114315));if(_0x114315[_0xa0e5('0x13')]){if(_0x114315[_0xa0e5('0x13')]['code']===0x1f4){logger[_0xa0e5('0x13')](_0xa0e5('0xe'),_0x3e89e4,_0x114315[_0xa0e5('0x13')][_0xa0e5('0x14')]);return _0x31b396(_0x114315[_0xa0e5('0x13')]['message']);}logger[_0xa0e5('0x13')](_0xa0e5('0xe'),_0x3e89e4,_0x114315[_0xa0e5('0x13')]['message']);return _0x5661c3(_0x114315[_0xa0e5('0x13')][_0xa0e5('0x14')]);}else{logger[_0xa0e5('0x15')]('VoiceCallReport,\x20%s,\x20%s',_0x3e89e4,_0xa0e5('0xf'));_0x5661c3(_0x114315['result'][_0xa0e5('0x14')]);}})[_0xa0e5('0x16')](function(_0x2f6222){logger[_0xa0e5('0x13')](_0xa0e5('0xe'),_0x3e89e4,_0x2f6222);_0x31b396(_0x2f6222);});});}exports[_0xa0e5('0x17')]=function(_0x2d833b){var _0x5715fe=this;return new Promise(function(_0x5ecf3f,_0x50221c){return db[_0xa0e5('0x18')][_0xa0e5('0x19')]({'raw':_0x2d833b[_0xa0e5('0x1a')]?_0x2d833b[_0xa0e5('0x1a')][_0xa0e5('0x1b')]===undefined?!![]:![]:!![],'where':_0x2d833b[_0xa0e5('0x1a')]?_0x2d833b[_0xa0e5('0x1a')][_0xa0e5('0x1c')]||null:null,'attributes':_0x2d833b[_0xa0e5('0x1a')]?_0x2d833b['options'][_0xa0e5('0x1d')]||null:null,'limit':_0x2d833b[_0xa0e5('0x1a')]?_0x2d833b[_0xa0e5('0x1a')][_0xa0e5('0x1e')]||null:null,'include':_0x2d833b['options']?_0x2d833b[_0xa0e5('0x1a')][_0xa0e5('0x1f')]?_[_0xa0e5('0x20')](_0x2d833b['options'][_0xa0e5('0x1f')],function(_0x25b567){return{'model':db[_0x25b567[_0xa0e5('0x21')]],'as':_0x25b567['as'],'attributes':_0x25b567[_0xa0e5('0x1d')],'include':_0x25b567[_0xa0e5('0x1f')]?_[_0xa0e5('0x20')](_0x25b567['include'],function(_0x16f44a){return{'model':db[_0x16f44a[_0xa0e5('0x21')]],'as':_0x16f44a['as'],'attributes':_0x16f44a['attributes'],'include':_0x16f44a[_0xa0e5('0x1f')]?_[_0xa0e5('0x20')](_0x16f44a[_0xa0e5('0x1f')],function(_0x3a95d5){return{'model':db[_0x3a95d5['model']],'as':_0x3a95d5['as'],'attributes':_0x3a95d5[_0xa0e5('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xa0e5('0xd')](function(_0x42789b){logger[_0xa0e5('0x15')](_0xa0e5('0x17'),_0x2d833b);logger[_0xa0e5('0x10')](_0xa0e5('0x17'),_0x2d833b,JSON[_0xa0e5('0x12')](_0x42789b));_0x5ecf3f(_0x42789b);})[_0xa0e5('0x16')](function(_0x1e027b){logger['error']('GetVoiceCallReport',_0x1e027b['message'],_0x2d833b);_0x50221c(_0x5715fe[_0xa0e5('0x13')](0x1f4,_0x1e027b['message']));});});};exports['CreateVoiceCallReport']=function(_0x565755){var _0xb47527=this;return new Promise(function(_0x1a04df,_0x3d3b56){return db[_0xa0e5('0x18')][_0xa0e5('0x22')](_0x565755['body'],{'raw':_0x565755[_0xa0e5('0x1a')]?_0x565755[_0xa0e5('0x1a')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4e70fb){logger[_0xa0e5('0x15')](_0xa0e5('0x23'),_0x565755);logger[_0xa0e5('0x10')](_0xa0e5('0x23'),_0x565755,JSON[_0xa0e5('0x12')](_0x4e70fb));_0x1a04df(_0x4e70fb);})[_0xa0e5('0x16')](function(_0xf4ccc4){logger[_0xa0e5('0x13')](_0xa0e5('0x23'),_0xf4ccc4['message'],_0x565755);_0x3d3b56(_0xb47527[_0xa0e5('0x13')](0x1f4,_0xf4ccc4[_0xa0e5('0x14')]));});});};exports[_0xa0e5('0x24')]=function(_0x1ec894){var _0x4fdafa=this;return new Promise(function(_0x281909,_0x4c976e){return db[_0xa0e5('0x18')][_0xa0e5('0x25')](_0x1ec894[_0xa0e5('0x26')],{'raw':_0x1ec894[_0xa0e5('0x1a')]?_0x1ec894['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ec894[_0xa0e5('0x1a')]?_0x1ec894['options'][_0xa0e5('0x1c')]||null:null,'attributes':_0x1ec894['options']?_0x1ec894[_0xa0e5('0x1a')][_0xa0e5('0x1d')]||null:null,'limit':_0x1ec894[_0xa0e5('0x1a')]?_0x1ec894[_0xa0e5('0x1a')][_0xa0e5('0x1e')]||null:null})[_0xa0e5('0xd')](function(_0x494753){logger[_0xa0e5('0x15')]('UpdateVoiceCallReport',_0x1ec894);logger[_0xa0e5('0x10')](_0xa0e5('0x24'),_0x1ec894,JSON[_0xa0e5('0x12')](_0x494753));_0x281909(_0x494753);})[_0xa0e5('0x16')](function(_0x21f575){logger['error'](_0xa0e5('0x24'),_0x21f575[_0xa0e5('0x14')],_0x1ec894);_0x4c976e(_0x4fdafa[_0xa0e5('0x13')](0x1f4,_0x21f575[_0xa0e5('0x14')]));});});}; \ No newline at end of file +var _0x8f54=['../../config/utils','../../config/logger','../../config/environment','client','request','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','where','attributes','limit','include','model','map','then','CreateVoiceCallReport','create','body','UpdateVoiceCallReport','update','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x1f448a,_0x477d9d){var _0x24c6ac=function(_0x114123){while(--_0x114123){_0x1f448a['push'](_0x1f448a['shift']());}};_0x24c6ac(++_0x477d9d);}(_0x8f54,0xe3));var _0x48f5=function(_0x325742,_0x46ae31){_0x325742=_0x325742-0x0;var _0x4c648b=_0x8f54[_0x325742];return _0x4c648b;};'use strict';var _=require(_0x48f5('0x0'));var util=require(_0x48f5('0x1'));var moment=require(_0x48f5('0x2'));var BPromise=require(_0x48f5('0x3'));var rs=require(_0x48f5('0x4'));var fs=require('fs');var Redis=require(_0x48f5('0x5'));var db=require(_0x48f5('0x6'))['db'];var utils=require(_0x48f5('0x7'));var logger=require(_0x48f5('0x8'))('rpc');var config=require(_0x48f5('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x48f5('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x152b0a,_0x2a3ff4,_0x50f865){return new BPromise(function(_0x1052f6,_0x5f5898){return client[_0x48f5('0xb')](_0x152b0a,_0x50f865)['then'](function(_0x56cb69){logger[_0x48f5('0xc')](_0x48f5('0xd'),_0x2a3ff4,_0x48f5('0xe'));logger[_0x48f5('0xf')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x2a3ff4,_0x48f5('0xe'),JSON[_0x48f5('0x10')](_0x56cb69));if(_0x56cb69['error']){if(_0x56cb69[_0x48f5('0x11')][_0x48f5('0x12')]===0x1f4){logger[_0x48f5('0x11')]('VoiceCallReport,\x20%s,\x20%s',_0x2a3ff4,_0x56cb69[_0x48f5('0x11')][_0x48f5('0x13')]);return _0x5f5898(_0x56cb69['error'][_0x48f5('0x13')]);}logger[_0x48f5('0x11')](_0x48f5('0xd'),_0x2a3ff4,_0x56cb69[_0x48f5('0x11')][_0x48f5('0x13')]);return _0x1052f6(_0x56cb69['error'][_0x48f5('0x13')]);}else{logger[_0x48f5('0xc')](_0x48f5('0xd'),_0x2a3ff4,_0x48f5('0xe'));_0x1052f6(_0x56cb69[_0x48f5('0x14')][_0x48f5('0x13')]);}})[_0x48f5('0x15')](function(_0x399918){logger[_0x48f5('0x11')](_0x48f5('0xd'),_0x2a3ff4,_0x399918);_0x5f5898(_0x399918);});});}exports[_0x48f5('0x16')]=function(_0x336139){var _0x464a84=this;return new Promise(function(_0x1573c7,_0x42891e){return db[_0x48f5('0x17')][_0x48f5('0x18')]({'raw':_0x336139[_0x48f5('0x19')]?_0x336139[_0x48f5('0x19')][_0x48f5('0x1a')]===undefined?!![]:![]:!![],'where':_0x336139[_0x48f5('0x19')]?_0x336139[_0x48f5('0x19')][_0x48f5('0x1b')]||null:null,'attributes':_0x336139['options']?_0x336139[_0x48f5('0x19')][_0x48f5('0x1c')]||null:null,'limit':_0x336139[_0x48f5('0x19')]?_0x336139[_0x48f5('0x19')][_0x48f5('0x1d')]||null:null,'include':_0x336139[_0x48f5('0x19')]?_0x336139[_0x48f5('0x19')]['include']?_['map'](_0x336139[_0x48f5('0x19')][_0x48f5('0x1e')],function(_0x311337){return{'model':db[_0x311337[_0x48f5('0x1f')]],'as':_0x311337['as'],'attributes':_0x311337[_0x48f5('0x1c')],'include':_0x311337['include']?_[_0x48f5('0x20')](_0x311337[_0x48f5('0x1e')],function(_0x81db28){return{'model':db[_0x81db28[_0x48f5('0x1f')]],'as':_0x81db28['as'],'attributes':_0x81db28['attributes'],'include':_0x81db28[_0x48f5('0x1e')]?_[_0x48f5('0x20')](_0x81db28[_0x48f5('0x1e')],function(_0x1919ca){return{'model':db[_0x1919ca[_0x48f5('0x1f')]],'as':_0x1919ca['as'],'attributes':_0x1919ca[_0x48f5('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x48f5('0x21')](function(_0x26d819){logger[_0x48f5('0xc')](_0x48f5('0x16'),_0x336139);logger[_0x48f5('0xf')](_0x48f5('0x16'),_0x336139,JSON[_0x48f5('0x10')](_0x26d819));_0x1573c7(_0x26d819);})[_0x48f5('0x15')](function(_0x21987e){logger[_0x48f5('0x11')](_0x48f5('0x16'),_0x21987e[_0x48f5('0x13')],_0x336139);_0x42891e(_0x464a84['error'](0x1f4,_0x21987e['message']));});});};exports[_0x48f5('0x22')]=function(_0x5b5d82){var _0x3d72fa=this;return new Promise(function(_0xa9d5d9,_0x5f0201){return db['VoiceCallReport'][_0x48f5('0x23')](_0x5b5d82[_0x48f5('0x24')],{'raw':_0x5b5d82[_0x48f5('0x19')]?_0x5b5d82[_0x48f5('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x48f5('0x21')](function(_0x2a890d){logger['info'](_0x48f5('0x22'),_0x5b5d82);logger[_0x48f5('0xf')](_0x48f5('0x22'),_0x5b5d82,JSON[_0x48f5('0x10')](_0x2a890d));_0xa9d5d9(_0x2a890d);})['catch'](function(_0x2a21d2){logger[_0x48f5('0x11')](_0x48f5('0x22'),_0x2a21d2[_0x48f5('0x13')],_0x5b5d82);_0x5f0201(_0x3d72fa[_0x48f5('0x11')](0x1f4,_0x2a21d2['message']));});});};exports[_0x48f5('0x25')]=function(_0x726f75){var _0x5d98fc=this;return new Promise(function(_0x2550a8,_0x136dbe){return db['VoiceCallReport'][_0x48f5('0x26')](_0x726f75[_0x48f5('0x24')],{'raw':_0x726f75[_0x48f5('0x19')]?_0x726f75[_0x48f5('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x726f75['options']?_0x726f75[_0x48f5('0x19')]['where']||null:null,'attributes':_0x726f75[_0x48f5('0x19')]?_0x726f75['options'][_0x48f5('0x1c')]||null:null,'limit':_0x726f75[_0x48f5('0x19')]?_0x726f75[_0x48f5('0x19')][_0x48f5('0x1d')]||null:null})['then'](function(_0x216cc9){logger[_0x48f5('0xc')]('UpdateVoiceCallReport',_0x726f75);logger[_0x48f5('0xf')](_0x48f5('0x25'),_0x726f75,JSON[_0x48f5('0x10')](_0x216cc9));_0x2550a8(_0x216cc9);})[_0x48f5('0x15')](function(_0x3972bc){logger[_0x48f5('0x11')](_0x48f5('0x25'),_0x3972bc[_0x48f5('0x13')],_0x726f75);_0x136dbe(_0x5d98fc[_0x48f5('0x11')](0x1f4,_0x3972bc[_0x48f5('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 6276713..200415d 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 _0xac0d=['show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','index','/:id'];(function(_0x5cba0e,_0x4fb1a6){var _0x5e1e19=function(_0x76779c){while(--_0x76779c){_0x5cba0e['push'](_0x5cba0e['shift']());}};_0x5e1e19(++_0x4fb1a6);}(_0xac0d,0x181));var _0xdac0=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xac0d[_0x432682];return _0x463d05;};'use strict';var multer=require(_0xdac0('0x0'));var util=require(_0xdac0('0x1'));var path=require(_0xdac0('0x2'));var timeout=require(_0xdac0('0x3'));var express=require(_0xdac0('0x4'));var router=express[_0xdac0('0x5')]();var auth=require(_0xdac0('0x6'));var interaction=require(_0xdac0('0x7'));var config=require(_0xdac0('0x8'));var controller=require(_0xdac0('0x9'));router[_0xdac0('0xa')]('/',auth[_0xdac0('0xb')](),controller[_0xdac0('0xc')]);router['get'](_0xdac0('0xd'),auth['isAuthenticated'](),controller[_0xdac0('0xe')]);router['post']('/',auth[_0xdac0('0xb')](),controller[_0xdac0('0xf')]);router[_0xdac0('0x10')](_0xdac0('0xd'),auth[_0xdac0('0xb')](),controller[_0xdac0('0x11')]);router[_0xdac0('0x12')](_0xdac0('0xd'),auth[_0xdac0('0xb')](),controller[_0xdac0('0x13')]);module[_0xdac0('0x14')]=router; \ No newline at end of file +var _0x8f6b=['destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','get','index','/:id','show','post','put','isAuthenticated','update','delete'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x8f6b,0x146));var _0xb8f6=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x8f6b[_0x5783f4];return _0x28e380;};'use strict';var multer=require(_0xb8f6('0x0'));var util=require(_0xb8f6('0x1'));var path=require(_0xb8f6('0x2'));var timeout=require('connect-timeout');var express=require(_0xb8f6('0x3'));var router=express[_0xb8f6('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xb8f6('0x5'));var config=require(_0xb8f6('0x6'));var controller=require('./voiceChanSpy.controller');router[_0xb8f6('0x7')]('/',auth['isAuthenticated'](),controller[_0xb8f6('0x8')]);router['get'](_0xb8f6('0x9'),auth['isAuthenticated'](),controller[_0xb8f6('0xa')]);router[_0xb8f6('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0xb8f6('0xc')](_0xb8f6('0x9'),auth[_0xb8f6('0xd')](),controller[_0xb8f6('0xe')]);router[_0xb8f6('0xf')](_0xb8f6('0x9'),auth[_0xb8f6('0xd')](),controller[_0xb8f6('0x10')]);module[_0xb8f6('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 87204e5..4d389ba 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 _0x1a61=['name','setDataValue','getDataValue','options','split','BOOLEAN','sequelize','STRING'];(function(_0x547add,_0x387042){var _0x2ed1f3=function(_0x3bbb4d){while(--_0x3bbb4d){_0x547add['push'](_0x547add['shift']());}};_0x2ed1f3(++_0x387042);}(_0x1a61,0x1e6));var _0x11a6=function(_0x4ae817,_0x57ce95){_0x4ae817=_0x4ae817-0x0;var _0x11c4f9=_0x1a61[_0x4ae817];return _0x11c4f9;};'use strict';var Sequelize=require(_0x11a6('0x0'));module['exports']={'name':{'type':Sequelize[_0x11a6('0x1')]},'prefix':{'type':Sequelize['STRING'],'unique':_0x11a6('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0x11a6('0x1')],'set':function(_0x2e2dbd){this[_0x11a6('0x3')]('options',_0x2e2dbd?_0x2e2dbd['join'](''):[]);},'get':function(){return this[_0x11a6('0x4')](_0x11a6('0x5'))?this['getDataValue'](_0x11a6('0x5'))[_0x11a6('0x6')](''):[];}},'auth':{'type':Sequelize[_0x11a6('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0x11a6('0x1')]},'record':{'type':Sequelize[_0x11a6('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x11a6('0x1')]},'description':{'type':Sequelize[_0x11a6('0x1')]}}; \ No newline at end of file +var _0xfb31=['setDataValue','options','join','getDataValue','BOOLEAN','exports','STRING'];(function(_0x4660b9,_0x172664){var _0x3d0b6b=function(_0x3632e1){while(--_0x3632e1){_0x4660b9['push'](_0x4660b9['shift']());}};_0x3d0b6b(++_0x172664);}(_0xfb31,0x186));var _0x1fb3=function(_0x73ec83,_0x458243){_0x73ec83=_0x73ec83-0x0;var _0x5effaa=_0xfb31[_0x73ec83];return _0x5effaa;};'use strict';var Sequelize=require('sequelize');module[_0x1fb3('0x0')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x1fb3('0x1')],'unique':'name','allowNull':![]},'options':{'type':Sequelize[_0x1fb3('0x1')],'set':function(_0x44917d){this[_0x1fb3('0x2')](_0x1fb3('0x3'),_0x44917d?_0x44917d[_0x1fb3('0x4')](''):[]);},'get':function(){return this[_0x1fb3('0x5')](_0x1fb3('0x3'))?this[_0x1fb3('0x5')](_0x1fb3('0x3'))['split'](''):[];}},'auth':{'type':Sequelize[_0x1fb3('0x6')],'defaultValue':![]},'password':{'type':Sequelize[_0x1fb3('0x1')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1fb3('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 4a4dbed..1de7de9 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 _0xa9e0=['save','update','then','destroy','get','ChanSpies','UserProfileResource','end','error','name','send','index','map','VoiceChanSpy','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','VIRTUAL','merge','include','findAll','rows','catch','show','params','includeAll','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject'];(function(_0x1967c5,_0x8af498){var _0x2d31ed=function(_0x1cc80d){while(--_0x1cc80d){_0x1967c5['push'](_0x1967c5['shift']());}};_0x2d31ed(++_0x8af498);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa9e0[_0x4709c0];return _0x13348b;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];function respondWithStatusCode(_0x36471c,_0xd5b662){_0xd5b662=_0xd5b662||0xcc;return function(_0x26d672){if(_0x26d672){return _0x36471c[_0x0a9e('0x14')](_0xd5b662);}return _0x36471c[_0x0a9e('0x15')](_0xd5b662)['end']();};}function respondWithResult(_0x4283ce,_0x239b12){_0x239b12=_0x239b12||0xc8;return function(_0x2b4227){if(_0x2b4227){return _0x4283ce[_0x0a9e('0x15')](_0x239b12)[_0x0a9e('0x16')](_0x2b4227);}};}function respondWithFilteredResult(_0x4d5611,_0x52a03d){return function(_0x22dccb){if(_0x22dccb){var _0x5d0880=_0x22dccb[_0x0a9e('0x17')],_0x1985b6=_0x52a03d['offset'],_0x519dfd=_0x52a03d[_0x0a9e('0x18')]+_0x52a03d['limit'],_0x16033c;if(_0x519dfd>=_0x5d0880){_0x519dfd=_0x5d0880;_0x16033c=0xc8;}else{_0x16033c=0xce;}_0x4d5611[_0x0a9e('0x15')](_0x16033c);return _0x4d5611[_0x0a9e('0x19')](_0x0a9e('0x1a'),_0x1985b6+'-'+_0x519dfd+'/'+_0x5d0880)[_0x0a9e('0x16')](_0x22dccb);}return null;};}function patchUpdates(_0x31b1ca){return function(_0x2eb11f){try{jsonpatch[_0x0a9e('0x1b')](_0x2eb11f,_0x31b1ca,!![]);}catch(_0x20559e){return BPromise[_0x0a9e('0x1c')](_0x20559e);}return _0x2eb11f[_0x0a9e('0x1d')]();};}function saveUpdates(_0x1c696a,_0x105080){return function(_0x4bb1e3){if(_0x4bb1e3){return _0x4bb1e3[_0x0a9e('0x1e')](_0x1c696a)[_0x0a9e('0x1f')](function(_0x53682f){return _0x53682f;});}return null;};}function removeEntity(_0x20f109,_0x5a09ef){return function(_0x588269){if(_0x588269){return _0x588269[_0x0a9e('0x20')]()[_0x0a9e('0x1f')](function(){var _0x38e7c4=_0x588269[_0x0a9e('0x21')]({'plain':!![]});var _0x4abc77=_0x0a9e('0x22');return db[_0x0a9e('0x23')][_0x0a9e('0x20')]({'where':{'type':_0x4abc77,'resourceId':_0x38e7c4['id']}})[_0x0a9e('0x1f')](function(){return _0x588269;});})[_0x0a9e('0x1f')](function(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x24')]();});}};}function handleEntityNotFound(_0x5ea472,_0x59181e){return function(_0x197ec0){if(!_0x197ec0){_0x5ea472[_0x0a9e('0x14')](0x194);}return _0x197ec0;};}function handleError(_0x40c424,_0x33161b){_0x33161b=_0x33161b||0x1f4;return function(_0x526cf3){logger[_0x0a9e('0x25')](_0x526cf3['stack']);if(_0x526cf3[_0x0a9e('0x26')]){delete _0x526cf3['name'];}_0x40c424[_0x0a9e('0x15')](_0x33161b)[_0x0a9e('0x27')](_0x526cf3);};}exports[_0x0a9e('0x28')]=function(_0x14433c,_0x140511){var _0x1538a4={},_0x11c3b6={},_0x14de77={'count':0x0,'rows':[]};var _0x5a101a=_[_0x0a9e('0x29')](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')],function(_0x2ec755){return{'name':_0x2ec755['fieldName'],'type':_0x2ec755[_0x0a9e('0x2c')][_0x0a9e('0x2d')]};});_0x11c3b6[_0x0a9e('0x2e')]=_[_0x0a9e('0x29')](_0x5a101a,_0x0a9e('0x26'));_0x11c3b6[_0x0a9e('0x2f')]=_[_0x0a9e('0x30')](_0x14433c[_0x0a9e('0x2f')]);_0x11c3b6[_0x0a9e('0x31')]=_['intersection'](_0x11c3b6[_0x0a9e('0x2e')],_0x11c3b6['query']);_0x1538a4[_0x0a9e('0x32')]=_[_0x0a9e('0x33')](_0x11c3b6[_0x0a9e('0x2e')],qs[_0x0a9e('0x34')](_0x14433c[_0x0a9e('0x2f')]['fields']));_0x1538a4[_0x0a9e('0x32')]=_0x1538a4[_0x0a9e('0x32')][_0x0a9e('0x35')]?_0x1538a4[_0x0a9e('0x32')]:_0x11c3b6[_0x0a9e('0x2e')];if(!_0x14433c[_0x0a9e('0x2f')][_0x0a9e('0x36')](_0x0a9e('0x37'))){_0x1538a4['limit']=qs[_0x0a9e('0x38')](_0x14433c['query'][_0x0a9e('0x38')]);_0x1538a4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x14433c[_0x0a9e('0x2f')]['offset']);}_0x1538a4[_0x0a9e('0x39')]=qs[_0x0a9e('0x3a')](_0x14433c[_0x0a9e('0x2f')][_0x0a9e('0x3a')]);_0x1538a4['where']=qs['filters'](_[_0x0a9e('0x3b')](_0x14433c['query'],_0x11c3b6[_0x0a9e('0x31')]));if(_0x14433c[_0x0a9e('0x2f')][_0x0a9e('0x3c')]){_0x1538a4[_0x0a9e('0x3d')]=_['merge'](_0x1538a4[_0x0a9e('0x3d')],{'$or':_[_0x0a9e('0x29')](_0x5a101a,function(_0x3cae){if(_0x3cae['type'][_0x0a9e('0x2d')]!==_0x0a9e('0x3e')){var _0x289467={};_0x289467[_0x3cae['field']]={'$like':'%'+_0x14433c['query'][_0x0a9e('0x3c')]+'%'};return _0x289467;}})});}_0x1538a4=_[_0x0a9e('0x3f')]({},_0x1538a4,_0x14433c['options']);var _0x2b814e={'where':_0x1538a4[_0x0a9e('0x3d')]};return db[_0x0a9e('0x2a')][_0x0a9e('0x17')](_0x2b814e)['then'](function(_0x5a594b){_0x14de77[_0x0a9e('0x17')]=_0x5a594b;if(_0x14433c[_0x0a9e('0x2f')]['includeAll']){_0x1538a4[_0x0a9e('0x40')]=[{'all':!![]}];}return db[_0x0a9e('0x2a')][_0x0a9e('0x41')](_0x1538a4);})['then'](function(_0x316c8f){_0x14de77[_0x0a9e('0x42')]=_0x316c8f;return _0x14de77;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x140511,_0x1538a4))[_0x0a9e('0x43')](handleError(_0x140511,null));};exports[_0x0a9e('0x44')]=function(_0xeaa5e5,_0x2881b3){var _0x45a9b8={'raw':![],'where':{'id':_0xeaa5e5[_0x0a9e('0x45')]['id']}},_0x23b089={};_0x23b089[_0x0a9e('0x2e')]=_[_0x0a9e('0x30')](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')]);_0x23b089[_0x0a9e('0x2f')]=_['keys'](_0xeaa5e5['query']);_0x23b089[_0x0a9e('0x31')]=_[_0x0a9e('0x33')](_0x23b089[_0x0a9e('0x2e')],_0x23b089[_0x0a9e('0x2f')]);_0x45a9b8[_0x0a9e('0x32')]=_[_0x0a9e('0x33')](_0x23b089[_0x0a9e('0x2e')],qs[_0x0a9e('0x34')](_0xeaa5e5[_0x0a9e('0x2f')][_0x0a9e('0x34')]));_0x45a9b8[_0x0a9e('0x32')]=_0x45a9b8[_0x0a9e('0x32')]['length']?_0x45a9b8[_0x0a9e('0x32')]:_0x23b089[_0x0a9e('0x2e')];if(_0xeaa5e5[_0x0a9e('0x2f')][_0x0a9e('0x46')]){_0x45a9b8[_0x0a9e('0x40')]=[{'all':!![]}];}_0x45a9b8=_[_0x0a9e('0x3f')]({},_0x45a9b8,_0xeaa5e5[_0x0a9e('0x47')]);return db[_0x0a9e('0x2a')]['find'](_0x45a9b8)[_0x0a9e('0x1f')](handleEntityNotFound(_0x2881b3,null))['then'](respondWithResult(_0x2881b3,null))[_0x0a9e('0x43')](handleError(_0x2881b3,null));};exports[_0x0a9e('0x48')]=function(_0x8d6dd1,_0x562fb4){return db[_0x0a9e('0x2a')][_0x0a9e('0x48')](_0x8d6dd1[_0x0a9e('0x49')],{})[_0x0a9e('0x1f')](function(_0x45c845){var _0x37be73=_0x8d6dd1[_0x0a9e('0x4a')]['get']({'plain':!![]});if(!_0x37be73)throw new Error(_0x0a9e('0x4b'));if(_0x37be73[_0x0a9e('0x4c')]===_0x0a9e('0x4a')){var _0x16f976=_0x45c845[_0x0a9e('0x21')]({'plain':!![]});var _0x992c77=_0x0a9e('0x22');return db[_0x0a9e('0x4d')][_0x0a9e('0x4e')]({'where':{'name':_0x992c77,'userProfileId':_0x37be73['userProfileId']},'raw':!![]})[_0x0a9e('0x1f')](function(_0x3fe430){if(_0x3fe430&&_0x3fe430['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x16f976[_0x0a9e('0x26')],'resourceId':_0x16f976['id'],'type':_0x3fe430[_0x0a9e('0x26')],'sectionId':_0x3fe430['id']},{})[_0x0a9e('0x1f')](function(){return _0x45c845;});}else{return _0x45c845;}})[_0x0a9e('0x43')](function(_0x61bb17){logger[_0x0a9e('0x25')](_0x0a9e('0x4f'),_0x61bb17);throw _0x61bb17;});}return _0x45c845;})[_0x0a9e('0x1f')](respondWithResult(_0x562fb4,0xc9))['catch'](handleError(_0x562fb4,null));};exports['update']=function(_0x53975a,_0x39d77d){if(_0x53975a[_0x0a9e('0x49')]['id']){delete _0x53975a[_0x0a9e('0x49')]['id'];}return db['VoiceChanSpy'][_0x0a9e('0x4e')]({'where':{'id':_0x53975a[_0x0a9e('0x45')]['id']}})['then'](handleEntityNotFound(_0x39d77d,null))['then'](saveUpdates(_0x53975a[_0x0a9e('0x49')],null))['then'](respondWithResult(_0x39d77d,null))[_0x0a9e('0x43')](handleError(_0x39d77d,null));};exports['destroy']=function(_0x2e5e62,_0x3c20b2){return db[_0x0a9e('0x2a')]['find']({'where':{'id':_0x2e5e62[_0x0a9e('0x45')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x3c20b2,null))['then'](removeEntity(_0x3c20b2,null))['catch'](handleError(_0x3c20b2,null));}; \ No newline at end of file +var _0xa9e0=['save','update','then','destroy','get','ChanSpies','UserProfileResource','end','error','name','send','index','map','VoiceChanSpy','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','VIRTUAL','merge','include','findAll','rows','catch','show','params','includeAll','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject'];(function(_0x3d0c69,_0x30b700){var _0x41b70b=function(_0x3b45d8){while(--_0x3b45d8){_0x3d0c69['push'](_0x3d0c69['shift']());}};_0x41b70b(++_0x30b700);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];function respondWithStatusCode(_0x36471c,_0xd5b662){_0xd5b662=_0xd5b662||0xcc;return function(_0x26d672){if(_0x26d672){return _0x36471c[_0x0a9e('0x14')](_0xd5b662);}return _0x36471c[_0x0a9e('0x15')](_0xd5b662)['end']();};}function respondWithResult(_0x4283ce,_0x239b12){_0x239b12=_0x239b12||0xc8;return function(_0x2b4227){if(_0x2b4227){return _0x4283ce[_0x0a9e('0x15')](_0x239b12)[_0x0a9e('0x16')](_0x2b4227);}};}function respondWithFilteredResult(_0x4d5611,_0x52a03d){return function(_0x22dccb){if(_0x22dccb){var _0x5d0880=_0x22dccb[_0x0a9e('0x17')],_0x1985b6=_0x52a03d['offset'],_0x519dfd=_0x52a03d[_0x0a9e('0x18')]+_0x52a03d['limit'],_0x16033c;if(_0x519dfd>=_0x5d0880){_0x519dfd=_0x5d0880;_0x16033c=0xc8;}else{_0x16033c=0xce;}_0x4d5611[_0x0a9e('0x15')](_0x16033c);return _0x4d5611[_0x0a9e('0x19')](_0x0a9e('0x1a'),_0x1985b6+'-'+_0x519dfd+'/'+_0x5d0880)[_0x0a9e('0x16')](_0x22dccb);}return null;};}function patchUpdates(_0x31b1ca){return function(_0x2eb11f){try{jsonpatch[_0x0a9e('0x1b')](_0x2eb11f,_0x31b1ca,!![]);}catch(_0x20559e){return BPromise[_0x0a9e('0x1c')](_0x20559e);}return _0x2eb11f[_0x0a9e('0x1d')]();};}function saveUpdates(_0x1c696a,_0x105080){return function(_0x4bb1e3){if(_0x4bb1e3){return _0x4bb1e3[_0x0a9e('0x1e')](_0x1c696a)[_0x0a9e('0x1f')](function(_0x53682f){return _0x53682f;});}return null;};}function removeEntity(_0x20f109,_0x5a09ef){return function(_0x588269){if(_0x588269){return _0x588269[_0x0a9e('0x20')]()[_0x0a9e('0x1f')](function(){var _0x38e7c4=_0x588269[_0x0a9e('0x21')]({'plain':!![]});var _0x4abc77=_0x0a9e('0x22');return db[_0x0a9e('0x23')][_0x0a9e('0x20')]({'where':{'type':_0x4abc77,'resourceId':_0x38e7c4['id']}})[_0x0a9e('0x1f')](function(){return _0x588269;});})[_0x0a9e('0x1f')](function(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x24')]();});}};}function handleEntityNotFound(_0x5ea472,_0x59181e){return function(_0x197ec0){if(!_0x197ec0){_0x5ea472[_0x0a9e('0x14')](0x194);}return _0x197ec0;};}function handleError(_0x40c424,_0x33161b){_0x33161b=_0x33161b||0x1f4;return function(_0x526cf3){logger[_0x0a9e('0x25')](_0x526cf3['stack']);if(_0x526cf3[_0x0a9e('0x26')]){delete _0x526cf3['name'];}_0x40c424[_0x0a9e('0x15')](_0x33161b)[_0x0a9e('0x27')](_0x526cf3);};}exports[_0x0a9e('0x28')]=function(_0x14433c,_0x140511){var _0x1538a4={},_0x11c3b6={},_0x14de77={'count':0x0,'rows':[]};var _0x5a101a=_[_0x0a9e('0x29')](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')],function(_0x2ec755){return{'name':_0x2ec755['fieldName'],'type':_0x2ec755[_0x0a9e('0x2c')][_0x0a9e('0x2d')]};});_0x11c3b6[_0x0a9e('0x2e')]=_[_0x0a9e('0x29')](_0x5a101a,_0x0a9e('0x26'));_0x11c3b6[_0x0a9e('0x2f')]=_[_0x0a9e('0x30')](_0x14433c[_0x0a9e('0x2f')]);_0x11c3b6[_0x0a9e('0x31')]=_['intersection'](_0x11c3b6[_0x0a9e('0x2e')],_0x11c3b6['query']);_0x1538a4[_0x0a9e('0x32')]=_[_0x0a9e('0x33')](_0x11c3b6[_0x0a9e('0x2e')],qs[_0x0a9e('0x34')](_0x14433c[_0x0a9e('0x2f')]['fields']));_0x1538a4[_0x0a9e('0x32')]=_0x1538a4[_0x0a9e('0x32')][_0x0a9e('0x35')]?_0x1538a4[_0x0a9e('0x32')]:_0x11c3b6[_0x0a9e('0x2e')];if(!_0x14433c[_0x0a9e('0x2f')][_0x0a9e('0x36')](_0x0a9e('0x37'))){_0x1538a4['limit']=qs[_0x0a9e('0x38')](_0x14433c['query'][_0x0a9e('0x38')]);_0x1538a4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x14433c[_0x0a9e('0x2f')]['offset']);}_0x1538a4[_0x0a9e('0x39')]=qs[_0x0a9e('0x3a')](_0x14433c[_0x0a9e('0x2f')][_0x0a9e('0x3a')]);_0x1538a4['where']=qs['filters'](_[_0x0a9e('0x3b')](_0x14433c['query'],_0x11c3b6[_0x0a9e('0x31')]));if(_0x14433c[_0x0a9e('0x2f')][_0x0a9e('0x3c')]){_0x1538a4[_0x0a9e('0x3d')]=_['merge'](_0x1538a4[_0x0a9e('0x3d')],{'$or':_[_0x0a9e('0x29')](_0x5a101a,function(_0x3cae){if(_0x3cae['type'][_0x0a9e('0x2d')]!==_0x0a9e('0x3e')){var _0x289467={};_0x289467[_0x3cae['field']]={'$like':'%'+_0x14433c['query'][_0x0a9e('0x3c')]+'%'};return _0x289467;}})});}_0x1538a4=_[_0x0a9e('0x3f')]({},_0x1538a4,_0x14433c['options']);var _0x2b814e={'where':_0x1538a4[_0x0a9e('0x3d')]};return db[_0x0a9e('0x2a')][_0x0a9e('0x17')](_0x2b814e)['then'](function(_0x5a594b){_0x14de77[_0x0a9e('0x17')]=_0x5a594b;if(_0x14433c[_0x0a9e('0x2f')]['includeAll']){_0x1538a4[_0x0a9e('0x40')]=[{'all':!![]}];}return db[_0x0a9e('0x2a')][_0x0a9e('0x41')](_0x1538a4);})['then'](function(_0x316c8f){_0x14de77[_0x0a9e('0x42')]=_0x316c8f;return _0x14de77;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x140511,_0x1538a4))[_0x0a9e('0x43')](handleError(_0x140511,null));};exports[_0x0a9e('0x44')]=function(_0xeaa5e5,_0x2881b3){var _0x45a9b8={'raw':![],'where':{'id':_0xeaa5e5[_0x0a9e('0x45')]['id']}},_0x23b089={};_0x23b089[_0x0a9e('0x2e')]=_[_0x0a9e('0x30')](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')]);_0x23b089[_0x0a9e('0x2f')]=_['keys'](_0xeaa5e5['query']);_0x23b089[_0x0a9e('0x31')]=_[_0x0a9e('0x33')](_0x23b089[_0x0a9e('0x2e')],_0x23b089[_0x0a9e('0x2f')]);_0x45a9b8[_0x0a9e('0x32')]=_[_0x0a9e('0x33')](_0x23b089[_0x0a9e('0x2e')],qs[_0x0a9e('0x34')](_0xeaa5e5[_0x0a9e('0x2f')][_0x0a9e('0x34')]));_0x45a9b8[_0x0a9e('0x32')]=_0x45a9b8[_0x0a9e('0x32')]['length']?_0x45a9b8[_0x0a9e('0x32')]:_0x23b089[_0x0a9e('0x2e')];if(_0xeaa5e5[_0x0a9e('0x2f')][_0x0a9e('0x46')]){_0x45a9b8[_0x0a9e('0x40')]=[{'all':!![]}];}_0x45a9b8=_[_0x0a9e('0x3f')]({},_0x45a9b8,_0xeaa5e5[_0x0a9e('0x47')]);return db[_0x0a9e('0x2a')]['find'](_0x45a9b8)[_0x0a9e('0x1f')](handleEntityNotFound(_0x2881b3,null))['then'](respondWithResult(_0x2881b3,null))[_0x0a9e('0x43')](handleError(_0x2881b3,null));};exports[_0x0a9e('0x48')]=function(_0x8d6dd1,_0x562fb4){return db[_0x0a9e('0x2a')][_0x0a9e('0x48')](_0x8d6dd1[_0x0a9e('0x49')],{})[_0x0a9e('0x1f')](function(_0x45c845){var _0x37be73=_0x8d6dd1[_0x0a9e('0x4a')]['get']({'plain':!![]});if(!_0x37be73)throw new Error(_0x0a9e('0x4b'));if(_0x37be73[_0x0a9e('0x4c')]===_0x0a9e('0x4a')){var _0x16f976=_0x45c845[_0x0a9e('0x21')]({'plain':!![]});var _0x992c77=_0x0a9e('0x22');return db[_0x0a9e('0x4d')][_0x0a9e('0x4e')]({'where':{'name':_0x992c77,'userProfileId':_0x37be73['userProfileId']},'raw':!![]})[_0x0a9e('0x1f')](function(_0x3fe430){if(_0x3fe430&&_0x3fe430['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x16f976[_0x0a9e('0x26')],'resourceId':_0x16f976['id'],'type':_0x3fe430[_0x0a9e('0x26')],'sectionId':_0x3fe430['id']},{})[_0x0a9e('0x1f')](function(){return _0x45c845;});}else{return _0x45c845;}})[_0x0a9e('0x43')](function(_0x61bb17){logger[_0x0a9e('0x25')](_0x0a9e('0x4f'),_0x61bb17);throw _0x61bb17;});}return _0x45c845;})[_0x0a9e('0x1f')](respondWithResult(_0x562fb4,0xc9))['catch'](handleError(_0x562fb4,null));};exports['update']=function(_0x53975a,_0x39d77d){if(_0x53975a[_0x0a9e('0x49')]['id']){delete _0x53975a[_0x0a9e('0x49')]['id'];}return db['VoiceChanSpy'][_0x0a9e('0x4e')]({'where':{'id':_0x53975a[_0x0a9e('0x45')]['id']}})['then'](handleEntityNotFound(_0x39d77d,null))['then'](saveUpdates(_0x53975a[_0x0a9e('0x49')],null))['then'](respondWithResult(_0x39d77d,null))[_0x0a9e('0x43')](handleError(_0x39d77d,null));};exports['destroy']=function(_0x2e5e62,_0x3c20b2){return db[_0x0a9e('0x2a')]['find']({'where':{'id':_0x2e5e62[_0x0a9e('0x45')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x3c20b2,null))['then'](removeEntity(_0x3c20b2,null))['catch'](handleError(_0x3c20b2,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index b583e2b..9695f08 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 _0x3d9a=['findAll','agent','then','catch','exports','models','define','VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate','destroy','lodash','util','bluebird','./voiceChanSpy.attributes','context','from-sip','format','prefix','system','merge','Set','chanspy','record','MixMonitor','${UNIQUEID}.%s,ab','recordingFormat','auth','push','Authenticate','password','SIP/%s,%s','name','options','join','StopMixMonitor','length','concat','internal','User'];(function(_0x3bfdf5,_0x9a2cef){var _0x5594a0=function(_0x5be7f9){while(--_0x5be7f9){_0x3bfdf5['push'](_0x3bfdf5['shift']());}};_0x5594a0(++_0x9a2cef);}(_0x3d9a,0xb0));var _0xa3d9=function(_0x3a4079,_0x1ade06){_0x3a4079=_0x3a4079-0x0;var _0xe90656=_0x3d9a[_0x3a4079];return _0xe90656;};'use strict';var _=require(_0xa3d9('0x0'));var util=require(_0xa3d9('0x1'));var BPromise=require(_0xa3d9('0x2'));var attributes=require(_0xa3d9('0x3'));var getUserApplications=function(_0x449173,_0x589d62,_0x5dad75){var _0x1ca4fc=0x1;var _0x167b9f=[];var _0x38c07a={'context':_0x589d62[_0xa3d9('0x4')]||_0xa3d9('0x5'),'exten':util[_0xa3d9('0x6')]('%s%s',_0x449173[_0xa3d9('0x7')],_0x5dad75),'type':_0xa3d9('0x8'),'isApp':![],'ChanSpyId':_0x449173['id'],'UserId':_0x589d62['id']};_0x167b9f['push'](_[_0xa3d9('0x9')]({'app':_0xa3d9('0xa'),'appdata':util[_0xa3d9('0x6')]('CDR(type)=%s',_0xa3d9('0xb')),'priority':_0x1ca4fc++},_0x38c07a));if(_0x449173[_0xa3d9('0xc')]){_0x167b9f['push'](_['merge']({'app':_0xa3d9('0xd'),'appdata':util[_0xa3d9('0x6')](_0xa3d9('0xe'),_0x449173[_0xa3d9('0xf')]),'priority':_0x1ca4fc++},_0x38c07a));}if(_0x449173[_0xa3d9('0x10')]){_0x167b9f[_0xa3d9('0x11')](_[_0xa3d9('0x9')]({'app':_0xa3d9('0x12'),'appdata':_0x449173[_0xa3d9('0x13')],'priority':_0x1ca4fc++},_0x38c07a));}_0x167b9f[_0xa3d9('0x11')](_['merge']({'app':'ChanSpy','appdata':util['format'](_0xa3d9('0x14'),_0x589d62[_0xa3d9('0x15')],_0x449173[_0xa3d9('0x16')]?_0x449173['options'][_0xa3d9('0x17')](''):''),'priority':_0x1ca4fc++},_0x38c07a));if(_0x449173[_0xa3d9('0xc')]){_0x167b9f[_0xa3d9('0x11')](_[_0xa3d9('0x9')]({'app':_0xa3d9('0x18'),'priority':_0x1ca4fc++},_0x38c07a));}return _0x167b9f;};var getChanSpyApplications=function(_0xad48cc,_0x397ad7){var _0x3cb828=[];for(var _0x59f194=0x0,_0x1747fe=0x1;_0x59f194<_0x397ad7[_0xa3d9('0x19')];_0x59f194++,_0x1747fe=0x1){_0x3cb828=_0x3cb828[_0xa3d9('0x1a')](getUserApplications(_0xad48cc,_0x397ad7[_0x59f194],_0x397ad7[_0x59f194][_0xa3d9('0x1b')]));if(_0x397ad7[_0x59f194][_0xa3d9('0x1b')]!=_0x397ad7[_0x59f194][_0xa3d9('0x15')]){_0x3cb828=_0x3cb828[_0xa3d9('0x1a')](getUserApplications(_0xad48cc,_0x397ad7[_0x59f194],_0x397ad7[_0x59f194][_0xa3d9('0x15')]));}}return _0x3cb828;};var getChanSpyPromise=function(_0x532f13,_0xfee299){return new BPromise(function(_0x197209,_0x177842){return _0x532f13[_0xa3d9('0x1c')][_0xa3d9('0x1d')]({'attributes':['id',_0xa3d9('0x15'),_0xa3d9('0x1b')],'where':{'role':_0xa3d9('0x1e'),'chanspy':!![]},'raw':!![]})[_0xa3d9('0x1f')](function(_0x99ec2a){if(_0x99ec2a){return _0x197209(getChanSpyApplications(_0xfee299,_0x99ec2a));}return _0x197209([]);})[_0xa3d9('0x20')](function(_0x3f1d02){_0x177842(_0x3f1d02);});});};module[_0xa3d9('0x21')]=function(_0x144ca0,_0x41a6d3){var _0x565b38=_0x144ca0[_0xa3d9('0x22')];return _0x144ca0[_0xa3d9('0x23')](_0xa3d9('0x24'),attributes,{'tableName':_0xa3d9('0x25'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x35d570,_0xbad80c,_0x13865d){return getChanSpyPromise(_0x565b38,_0x35d570)[_0xa3d9('0x1f')](function(_0x39163f){if(_0x39163f&&_0x39163f[_0xa3d9('0x19')]){return _0x565b38[_0xa3d9('0x26')][_0xa3d9('0x27')](_0x39163f);}})[_0xa3d9('0x1f')](function(){_0x13865d();})[_0xa3d9('0x20')](function(_0x3f86da){_0x13865d(_0x3f86da);});},'afterUpdate':function(_0x104a51,_0x3ab132,_0x34cea7){return _0x565b38[_0xa3d9('0x26')][_0xa3d9('0x28')]({'where':{'ChanSpyId':_0x104a51['id']}})[_0xa3d9('0x1f')](function(){return getChanSpyPromise(_0x565b38,_0x104a51);})[_0xa3d9('0x1f')](function(_0x484f16){if(_0x484f16&&_0x484f16[_0xa3d9('0x19')]){return _0x565b38[_0xa3d9('0x26')]['bulkCreate'](_0x484f16);}})[_0xa3d9('0x1f')](function(){_0x34cea7();})[_0xa3d9('0x20')](function(_0x1cc8e1){_0x34cea7(_0x1cc8e1);});},'afterDestroy':function(_0x102b8f,_0x1ceb4b,_0x236f6f){return _0x565b38['VoiceExtension'][_0xa3d9('0x28')]({'where':{'ChanSpyId':_0x102b8f['id']}})[_0xa3d9('0x1f')](function(){_0x236f6f();})[_0xa3d9('0x20')](function(_0x3b04f4){_0x236f6f(_0x3b04f4);});}}});}; \ No newline at end of file +var _0x22fc=['./voiceChanSpy.attributes','context','from-sip','prefix','system','push','merge','Set','CDR(type)=%s','chanspy','record','MixMonitor','format','${UNIQUEID}.%s,ab','Authenticate','password','ChanSpy','SIP/%s,%s','options','join','StopMixMonitor','length','concat','internal','name','User','findAll','agent','then','catch','exports','models','VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate','destroy','lodash','util','bluebird'];(function(_0x205123,_0x240ebe){var _0x5b69fb=function(_0x488aaf){while(--_0x488aaf){_0x205123['push'](_0x205123['shift']());}};_0x5b69fb(++_0x240ebe);}(_0x22fc,0x165));var _0xc22f=function(_0x7faf8f,_0x1a5104){_0x7faf8f=_0x7faf8f-0x0;var _0x143834=_0x22fc[_0x7faf8f];return _0x143834;};'use strict';var _=require(_0xc22f('0x0'));var util=require(_0xc22f('0x1'));var BPromise=require(_0xc22f('0x2'));var attributes=require(_0xc22f('0x3'));var getUserApplications=function(_0xce19b3,_0x194c98,_0x2c1f5d){var _0x342da8=0x1;var _0x55f55d=[];var _0x5b52fa={'context':_0x194c98[_0xc22f('0x4')]||_0xc22f('0x5'),'exten':util['format']('%s%s',_0xce19b3[_0xc22f('0x6')],_0x2c1f5d),'type':_0xc22f('0x7'),'isApp':![],'ChanSpyId':_0xce19b3['id'],'UserId':_0x194c98['id']};_0x55f55d[_0xc22f('0x8')](_[_0xc22f('0x9')]({'app':_0xc22f('0xa'),'appdata':util['format'](_0xc22f('0xb'),_0xc22f('0xc')),'priority':_0x342da8++},_0x5b52fa));if(_0xce19b3[_0xc22f('0xd')]){_0x55f55d[_0xc22f('0x8')](_[_0xc22f('0x9')]({'app':_0xc22f('0xe'),'appdata':util[_0xc22f('0xf')](_0xc22f('0x10'),_0xce19b3['recordingFormat']),'priority':_0x342da8++},_0x5b52fa));}if(_0xce19b3['auth']){_0x55f55d[_0xc22f('0x8')](_[_0xc22f('0x9')]({'app':_0xc22f('0x11'),'appdata':_0xce19b3[_0xc22f('0x12')],'priority':_0x342da8++},_0x5b52fa));}_0x55f55d['push'](_[_0xc22f('0x9')]({'app':_0xc22f('0x13'),'appdata':util[_0xc22f('0xf')](_0xc22f('0x14'),_0x194c98['name'],_0xce19b3['options']?_0xce19b3[_0xc22f('0x15')][_0xc22f('0x16')](''):''),'priority':_0x342da8++},_0x5b52fa));if(_0xce19b3[_0xc22f('0xd')]){_0x55f55d[_0xc22f('0x8')](_[_0xc22f('0x9')]({'app':_0xc22f('0x17'),'priority':_0x342da8++},_0x5b52fa));}return _0x55f55d;};var getChanSpyApplications=function(_0x3f9e17,_0x5b38c2){var _0x5e7627=[];for(var _0x52f3dc=0x0,_0x36f7c2=0x1;_0x52f3dc<_0x5b38c2[_0xc22f('0x18')];_0x52f3dc++,_0x36f7c2=0x1){_0x5e7627=_0x5e7627[_0xc22f('0x19')](getUserApplications(_0x3f9e17,_0x5b38c2[_0x52f3dc],_0x5b38c2[_0x52f3dc]['internal']));if(_0x5b38c2[_0x52f3dc][_0xc22f('0x1a')]!=_0x5b38c2[_0x52f3dc][_0xc22f('0x1b')]){_0x5e7627=_0x5e7627[_0xc22f('0x19')](getUserApplications(_0x3f9e17,_0x5b38c2[_0x52f3dc],_0x5b38c2[_0x52f3dc]['name']));}}return _0x5e7627;};var getChanSpyPromise=function(_0x30e9d6,_0x34efa7){return new BPromise(function(_0x3f68dd,_0x5edd66){return _0x30e9d6[_0xc22f('0x1c')][_0xc22f('0x1d')]({'attributes':['id',_0xc22f('0x1b'),'internal'],'where':{'role':_0xc22f('0x1e'),'chanspy':!![]},'raw':!![]})[_0xc22f('0x1f')](function(_0x84480d){if(_0x84480d){return _0x3f68dd(getChanSpyApplications(_0x34efa7,_0x84480d));}return _0x3f68dd([]);})[_0xc22f('0x20')](function(_0x1c1ca8){_0x5edd66(_0x1c1ca8);});});};module[_0xc22f('0x21')]=function(_0x362840,_0x32e46a){var _0x3720f3=_0x362840[_0xc22f('0x22')];return _0x362840['define'](_0xc22f('0x23'),attributes,{'tableName':_0xc22f('0x24'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x445b19,_0xeb9167,_0x1fdeae){return getChanSpyPromise(_0x3720f3,_0x445b19)['then'](function(_0x24a6c4){if(_0x24a6c4&&_0x24a6c4['length']){return _0x3720f3[_0xc22f('0x25')][_0xc22f('0x26')](_0x24a6c4);}})[_0xc22f('0x1f')](function(){_0x1fdeae();})['catch'](function(_0x3f0be5){_0x1fdeae(_0x3f0be5);});},'afterUpdate':function(_0x182570,_0x31ae81,_0x3b85cc){return _0x3720f3['VoiceExtension'][_0xc22f('0x27')]({'where':{'ChanSpyId':_0x182570['id']}})[_0xc22f('0x1f')](function(){return getChanSpyPromise(_0x3720f3,_0x182570);})['then'](function(_0x51cfaa){if(_0x51cfaa&&_0x51cfaa[_0xc22f('0x18')]){return _0x3720f3[_0xc22f('0x25')][_0xc22f('0x26')](_0x51cfaa);}})['then'](function(){_0x3b85cc();})['catch'](function(_0x36ecdf){_0x3b85cc(_0x36ecdf);});},'afterDestroy':function(_0x198d8c,_0x33d425,_0x423f3f){return _0x3720f3[_0xc22f('0x25')]['destroy']({'where':{'ChanSpyId':_0x198d8c['id']}})[_0xc22f('0x1f')](function(){_0x423f3f();})[_0xc22f('0x20')](function(_0x172488){_0x423f3f(_0x172488);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 0352b50..50e8d4d 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 _0x2f4b=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','moment','bluebird'];(function(_0x515afd,_0x1a1e91){var _0x536d53=function(_0x1d3a89){while(--_0x1d3a89){_0x515afd['push'](_0x515afd['shift']());}};_0x536d53(++_0x1a1e91);}(_0x2f4b,0x134));var _0xb2f4=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x2f4b[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0xb2f4('0x0'));var util=require(_0xb2f4('0x1'));var moment=require(_0xb2f4('0x2'));var BPromise=require(_0xb2f4('0x3'));var rs=require(_0xb2f4('0x4'));var fs=require('fs');var Redis=require(_0xb2f4('0x5'));var db=require(_0xb2f4('0x6'))['db'];var utils=require(_0xb2f4('0x7'));var logger=require(_0xb2f4('0x8'))(_0xb2f4('0x9'));var config=require(_0xb2f4('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xb2f4('0xb')][_0xb2f4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1d431c,_0x528db5,_0xe09474){return new BPromise(function(_0x13b9c0,_0x570abe){return client[_0xb2f4('0xd')](_0x1d431c,_0xe09474)[_0xb2f4('0xe')](function(_0x458909){logger[_0xb2f4('0xf')](_0xb2f4('0x10'),_0x528db5,_0xb2f4('0x11'));logger[_0xb2f4('0x12')]('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x528db5,_0xb2f4('0x11'),JSON[_0xb2f4('0x13')](_0x458909));if(_0x458909['error']){if(_0x458909[_0xb2f4('0x14')]['code']===0x1f4){logger[_0xb2f4('0x14')](_0xb2f4('0x10'),_0x528db5,_0x458909[_0xb2f4('0x14')][_0xb2f4('0x15')]);return _0x570abe(_0x458909[_0xb2f4('0x14')][_0xb2f4('0x15')]);}logger[_0xb2f4('0x14')](_0xb2f4('0x10'),_0x528db5,_0x458909[_0xb2f4('0x14')]['message']);return _0x13b9c0(_0x458909[_0xb2f4('0x14')][_0xb2f4('0x15')]);}else{logger['info'](_0xb2f4('0x10'),_0x528db5,_0xb2f4('0x11'));_0x13b9c0(_0x458909[_0xb2f4('0x16')][_0xb2f4('0x15')]);}})[_0xb2f4('0x17')](function(_0x275cec){logger[_0xb2f4('0x14')](_0xb2f4('0x10'),_0x528db5,_0x275cec);_0x570abe(_0x275cec);});});} \ No newline at end of file +var _0xc32f=['VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent'];(function(_0x1ef5b4,_0x282598){var _0x23e136=function(_0x196818){while(--_0x196818){_0x1ef5b4['push'](_0x1ef5b4['shift']());}};_0x23e136(++_0x282598);}(_0xc32f,0x1ea));var _0xfc32=function(_0x126209,_0x3b4328){_0x126209=_0x126209-0x0;var _0x5e2893=_0xc32f[_0x126209];return _0x5e2893;};'use strict';var _=require(_0xfc32('0x0'));var util=require('util');var moment=require(_0xfc32('0x1'));var BPromise=require(_0xfc32('0x2'));var rs=require(_0xfc32('0x3'));var fs=require('fs');var Redis=require(_0xfc32('0x4'));var db=require(_0xfc32('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xfc32('0x6'))(_0xfc32('0x7'));var config=require(_0xfc32('0x8'));var jayson=require(_0xfc32('0x9'));var client=jayson[_0xfc32('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xded708,_0x53a0db,_0xf66be9){return new BPromise(function(_0x48c793,_0x5cb976){return client[_0xfc32('0xb')](_0xded708,_0xf66be9)[_0xfc32('0xc')](function(_0x46feea){logger[_0xfc32('0xd')](_0xfc32('0xe'),_0x53a0db,_0xfc32('0xf'));logger['debug'](_0xfc32('0x10'),_0x53a0db,_0xfc32('0xf'),JSON[_0xfc32('0x11')](_0x46feea));if(_0x46feea['error']){if(_0x46feea['error'][_0xfc32('0x12')]===0x1f4){logger[_0xfc32('0x13')]('VoiceChanSpy,\x20%s,\x20%s',_0x53a0db,_0x46feea[_0xfc32('0x13')][_0xfc32('0x14')]);return _0x5cb976(_0x46feea[_0xfc32('0x13')]['message']);}logger[_0xfc32('0x13')](_0xfc32('0xe'),_0x53a0db,_0x46feea['error'][_0xfc32('0x14')]);return _0x48c793(_0x46feea[_0xfc32('0x13')]['message']);}else{logger['info'](_0xfc32('0xe'),_0x53a0db,_0xfc32('0xf'));_0x48c793(_0x46feea[_0xfc32('0x15')][_0xfc32('0x14')]);}})[_0xfc32('0x16')](function(_0x443e6e){logger['error'](_0xfc32('0xe'),_0x53a0db,_0x443e6e);_0x5cb976(_0x443e6e);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index d813d21..6105657 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 _0x4883=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','put','/:id','update','delete','destroy','multer','util'];(function(_0x3be1a7,_0x4bb8fe){var _0x4a6085=function(_0x3d97c6){while(--_0x3d97c6){_0x3be1a7['push'](_0x3be1a7['shift']());}};_0x4a6085(++_0x4bb8fe);}(_0x4883,0x142));var _0x3488=function(_0x135951,_0x5aed2d){_0x135951=_0x135951-0x0;var _0x27e840=_0x4883[_0x135951];return _0x27e840;};'use strict';var multer=require(_0x3488('0x0'));var util=require(_0x3488('0x1'));var path=require(_0x3488('0x2'));var timeout=require(_0x3488('0x3'));var express=require(_0x3488('0x4'));var router=express['Router']();var auth=require(_0x3488('0x5'));var interaction=require(_0x3488('0x6'));var config=require(_0x3488('0x7'));var controller=require('./voiceContext.controller');router[_0x3488('0x8')]('/',auth[_0x3488('0x9')](),controller[_0x3488('0xa')]);router[_0x3488('0x8')]('/:id',auth[_0x3488('0x9')](),controller[_0x3488('0xb')]);router[_0x3488('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3488('0xd')](_0x3488('0xe'),auth[_0x3488('0x9')](),controller[_0x3488('0xf')]);router[_0x3488('0x10')](_0x3488('0xe'),auth['isAuthenticated'](),controller[_0x3488('0x11')]);module['exports']=router; \ No newline at end of file +var _0x1802=['post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceContext.controller','get','isAuthenticated','index','/:id','show'];(function(_0x3441a4,_0x48599e){var _0xdfe8d6=function(_0x337203){while(--_0x337203){_0x3441a4['push'](_0x3441a4['shift']());}};_0xdfe8d6(++_0x48599e);}(_0x1802,0xbb));var _0x2180=function(_0x150827,_0x19a11a){_0x150827=_0x150827-0x0;var _0x55b754=_0x1802[_0x150827];return _0x55b754;};'use strict';var multer=require(_0x2180('0x0'));var util=require(_0x2180('0x1'));var path=require('path');var timeout=require(_0x2180('0x2'));var express=require(_0x2180('0x3'));var router=express[_0x2180('0x4')]();var auth=require(_0x2180('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2180('0x6'));var controller=require(_0x2180('0x7'));router[_0x2180('0x8')]('/',auth[_0x2180('0x9')](),controller[_0x2180('0xa')]);router[_0x2180('0x8')](_0x2180('0xb'),auth[_0x2180('0x9')](),controller[_0x2180('0xc')]);router[_0x2180('0xd')]('/',auth[_0x2180('0x9')](),controller[_0x2180('0xe')]);router[_0x2180('0xf')](_0x2180('0xb'),auth[_0x2180('0x9')](),controller[_0x2180('0x10')]);router[_0x2180('0x11')](_0x2180('0xb'),auth[_0x2180('0x9')](),controller[_0x2180('0x12')]);module[_0x2180('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 01ea47c..9a37367 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 _0x3e74=['name','sequelize','STRING'];(function(_0x497df6,_0x4d0d21){var _0x59a708=function(_0x593ec9){while(--_0x593ec9){_0x497df6['push'](_0x497df6['shift']());}};_0x59a708(++_0x4d0d21);}(_0x3e74,0x175));var _0x43e7=function(_0x56e857,_0x46614f){_0x56e857=_0x56e857-0x0;var _0x5ef17a=_0x3e74[_0x56e857];return _0x5ef17a;};'use strict';var Sequelize=require(_0x43e7('0x0'));module['exports']={'name':{'type':Sequelize[_0x43e7('0x1')],'unique':_0x43e7('0x2')},'description':{'type':Sequelize[_0x43e7('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0x9c44=['BOOLEAN','STRING','name'];(function(_0x303e6a,_0x4bef09){var _0x1ed71a=function(_0x2d57da){while(--_0x2d57da){_0x303e6a['push'](_0x303e6a['shift']());}};_0x1ed71a(++_0x4bef09);}(_0x9c44,0x178));var _0x49c4=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x9c44[_0x1035c1];return _0x308d67;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x49c4('0x0')],'unique':_0x49c4('0x1')},'description':{'type':Sequelize[_0x49c4('0x0')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x49c4('0x2')],'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 d616baa..a796f49 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 _0x8a05=['filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','field','options','includeAll','include','rows','show','params','length','find','create','body','findAll','readFileSync','join','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','root','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','client','http','test','request','then','info','request\x20sent','stringify','error','VoiceContext,\x20%s,\x20%s','message','catch','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','get','Contexts','UserProfileResource','stack','name','send','index','map','VoiceContext','rawAttributes','fieldName','key','model','query','keys'];(function(_0x2bec89,_0x23fd8c){var _0x314f8d=function(_0x57ccd6){while(--_0x57ccd6){_0x2bec89['push'](_0x2bec89['shift']());}};_0x314f8d(++_0x23fd8c);}(_0x8a05,0x1bd));var _0x58a0=function(_0x49e0d9,_0x594337){_0x49e0d9=_0x49e0d9-0x0;var _0x361523=_0x8a05[_0x49e0d9];return _0x361523;};'use strict';var pdf=require(_0x58a0('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x58a0('0x1'));var zipdir=require(_0x58a0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x58a0('0x3'));var moment=require(_0x58a0('0x4'));var BPromise=require(_0x58a0('0x5'));var Mustache=require(_0x58a0('0x6'));var util=require(_0x58a0('0x7'));var path=require(_0x58a0('0x8'));var sox=require('sox');var csv=require(_0x58a0('0x9'));var ejs=require(_0x58a0('0xa'));var fs=require('fs');var _=require(_0x58a0('0xb'));var squel=require(_0x58a0('0xc'));var crypto=require(_0x58a0('0xd'));var jsforce=require(_0x58a0('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x58a0('0xf'));var Papa=require(_0x58a0('0x10'));var Redis=require(_0x58a0('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x58a0('0x12'));var as=require(_0x58a0('0x13'));var hardwareService=require(_0x58a0('0x14'));var logger=require(_0x58a0('0x15'))(_0x58a0('0x16'));var utils=require(_0x58a0('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0x58a0('0x18')][_0x58a0('0x19')]({'port':0x232a});function checkPasswordPattern(_0x119bfe,_0x498418,_0x14d752){if(_0x14d752){var _0x500626=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x500626[_0x58a0('0x1a')](_0x498418)){return _0x119bfe;}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 _0x119bfe;}}function respondWithRpcPromise(_0xd5cf0,_0x39d6b7,_0x3c5861,_0x7cf50e){return new BPromise(function(_0x2b7663,_0x17f819){var _0x38d6f5=_0x7cf50e||client;return _0x38d6f5[_0x58a0('0x1b')](_0xd5cf0,_0x3c5861)[_0x58a0('0x1c')](function(_0x881bda){logger[_0x58a0('0x1d')]('VoiceContext,\x20%s,\x20%s',_0x39d6b7,_0x58a0('0x1e'));logger['debug']('VoiceContext,\x20%s,\x20%s,\x20%s',_0x39d6b7,'request\x20sent',JSON[_0x58a0('0x1f')](_0x881bda));if(_0x881bda[_0x58a0('0x20')]){if(_0x881bda[_0x58a0('0x20')]['code']===0x1f4){logger['error'](_0x58a0('0x21'),_0x39d6b7,_0x881bda[_0x58a0('0x20')][_0x58a0('0x22')]);return _0x17f819(_0x881bda['error'][_0x58a0('0x22')]);}logger[_0x58a0('0x20')]('VoiceContext,\x20%s,\x20%s',_0x39d6b7,_0x881bda[_0x58a0('0x20')][_0x58a0('0x22')]);return _0x2b7663(_0x881bda[_0x58a0('0x20')]['message']);}else{logger[_0x58a0('0x1d')]('VoiceContext,\x20%s,\x20%s',_0x39d6b7,_0x58a0('0x1e'));_0x2b7663(_0x881bda['result']['message']);}})[_0x58a0('0x23')](function(_0xe6ef5b){logger[_0x58a0('0x20')](_0x58a0('0x21'),_0x39d6b7,_0xe6ef5b);_0x17f819(_0xe6ef5b);});});}function respondWithStatusCode(_0x3762c0,_0x466a68){_0x466a68=_0x466a68||0xcc;return function(_0x4d22c3){if(_0x4d22c3){return _0x3762c0[_0x58a0('0x24')](_0x466a68);}return _0x3762c0['status'](_0x466a68)[_0x58a0('0x25')]();};}function respondWithResult(_0x464199,_0x316129){_0x316129=_0x316129||0xc8;return function(_0x354802){if(_0x354802){return _0x464199[_0x58a0('0x26')](_0x316129)[_0x58a0('0x27')](_0x354802);}};}function respondWithFilteredResult(_0x17d3b5,_0x55d3ab){return function(_0x14fd37){if(_0x14fd37){var _0x2e9784=_0x14fd37[_0x58a0('0x28')],_0x2dc3c3=_0x55d3ab[_0x58a0('0x29')],_0x488492=_0x55d3ab[_0x58a0('0x29')]+_0x55d3ab[_0x58a0('0x2a')],_0x13a8e8;if(_0x488492>=_0x2e9784){_0x488492=_0x2e9784;_0x13a8e8=0xc8;}else{_0x13a8e8=0xce;}_0x17d3b5[_0x58a0('0x26')](_0x13a8e8);return _0x17d3b5[_0x58a0('0x2b')](_0x58a0('0x2c'),_0x2dc3c3+'-'+_0x488492+'/'+_0x2e9784)[_0x58a0('0x27')](_0x14fd37);}return null;};}function patchUpdates(_0x3c96fb){return function(_0xbca9e8){try{jsonpatch[_0x58a0('0x2d')](_0xbca9e8,_0x3c96fb,!![]);}catch(_0x2f9af4){return BPromise[_0x58a0('0x2e')](_0x2f9af4);}return _0xbca9e8[_0x58a0('0x2f')]();};}function saveUpdates(_0xd2f0b8,_0x580430){return function(_0x5489cd){if(_0x5489cd){return _0x5489cd[_0x58a0('0x30')](_0xd2f0b8)['then'](function(_0x5c7ba8){return _0x5c7ba8;});}return null;};}function removeEntity(_0x40caab,_0x355a8f){return function(_0x8d5540){if(_0x8d5540){return _0x8d5540[_0x58a0('0x31')]()[_0x58a0('0x1c')](function(){var _0x260cbf=_0x8d5540[_0x58a0('0x32')]({'plain':!![]});var _0x4bf9f4=_0x58a0('0x33');return db[_0x58a0('0x34')]['destroy']({'where':{'type':_0x4bf9f4,'resourceId':_0x260cbf['id']}})[_0x58a0('0x1c')](function(){return _0x8d5540;});})[_0x58a0('0x1c')](function(){_0x40caab[_0x58a0('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x274ba5,_0x4d53ab){return function(_0x18582d){if(!_0x18582d){_0x274ba5[_0x58a0('0x24')](0x194);}return _0x18582d;};}function handleError(_0x8504c2,_0x5ceacf){_0x5ceacf=_0x5ceacf||0x1f4;return function(_0x244242){logger[_0x58a0('0x20')](_0x244242[_0x58a0('0x35')]);if(_0x244242[_0x58a0('0x36')]){delete _0x244242['name'];}_0x8504c2[_0x58a0('0x26')](_0x5ceacf)[_0x58a0('0x37')](_0x244242);};}exports[_0x58a0('0x38')]=function(_0x1b7076,_0x55e278){var _0x315cf3={},_0x1fa343={},_0x14c417={'count':0x0,'rows':[]};var _0x46270a=_[_0x58a0('0x39')](db[_0x58a0('0x3a')][_0x58a0('0x3b')],function(_0x594d4d){return{'name':_0x594d4d[_0x58a0('0x3c')],'type':_0x594d4d['type'][_0x58a0('0x3d')]};});_0x1fa343[_0x58a0('0x3e')]=_[_0x58a0('0x39')](_0x46270a,_0x58a0('0x36'));_0x1fa343[_0x58a0('0x3f')]=_[_0x58a0('0x40')](_0x1b7076['query']);_0x1fa343[_0x58a0('0x41')]=_[_0x58a0('0x42')](_0x1fa343[_0x58a0('0x3e')],_0x1fa343['query']);_0x315cf3['attributes']=_[_0x58a0('0x42')](_0x1fa343[_0x58a0('0x3e')],qs['fields'](_0x1b7076[_0x58a0('0x3f')][_0x58a0('0x43')]));_0x315cf3[_0x58a0('0x44')]=_0x315cf3[_0x58a0('0x44')]['length']?_0x315cf3[_0x58a0('0x44')]:_0x1fa343['model'];if(!_0x1b7076[_0x58a0('0x3f')][_0x58a0('0x45')](_0x58a0('0x46'))){_0x315cf3[_0x58a0('0x2a')]=qs[_0x58a0('0x2a')](_0x1b7076[_0x58a0('0x3f')][_0x58a0('0x2a')]);_0x315cf3[_0x58a0('0x29')]=qs[_0x58a0('0x29')](_0x1b7076['query'][_0x58a0('0x29')]);}_0x315cf3[_0x58a0('0x47')]=qs[_0x58a0('0x48')](_0x1b7076[_0x58a0('0x3f')][_0x58a0('0x48')]);_0x315cf3[_0x58a0('0x49')]=qs['filters'](_['pick'](_0x1b7076['query'],_0x1fa343[_0x58a0('0x41')]));if(_0x1b7076['query']['filter']){_0x315cf3[_0x58a0('0x49')]=_[_0x58a0('0x4a')](_0x315cf3[_0x58a0('0x49')],{'$or':_[_0x58a0('0x39')](_0x46270a,function(_0x43dc75){if(_0x43dc75[_0x58a0('0x4b')][_0x58a0('0x3d')]!==_0x58a0('0x4c')){var _0x5cc66b={};_0x5cc66b[_0x43dc75[_0x58a0('0x4d')]]={'$like':'%'+_0x1b7076[_0x58a0('0x3f')]['filter']+'%'};return _0x5cc66b;}})});}_0x315cf3=_[_0x58a0('0x4a')]({},_0x315cf3,_0x1b7076[_0x58a0('0x4e')]);var _0x191938={'where':_0x315cf3[_0x58a0('0x49')]};return db[_0x58a0('0x3a')][_0x58a0('0x28')](_0x191938)[_0x58a0('0x1c')](function(_0x581786){_0x14c417[_0x58a0('0x28')]=_0x581786;if(_0x1b7076['query'][_0x58a0('0x4f')]){_0x315cf3[_0x58a0('0x50')]=[{'all':!![]}];}return db['VoiceContext']['findAll'](_0x315cf3);})[_0x58a0('0x1c')](function(_0x395764){_0x14c417[_0x58a0('0x51')]=_0x395764;return _0x14c417;})[_0x58a0('0x1c')](respondWithFilteredResult(_0x55e278,_0x315cf3))[_0x58a0('0x23')](handleError(_0x55e278,null));};exports[_0x58a0('0x52')]=function(_0x4e8721,_0x23d142){var _0x16a538={'raw':![],'where':{'id':_0x4e8721[_0x58a0('0x53')]['id']}},_0x58d748={};_0x58d748[_0x58a0('0x3e')]=_[_0x58a0('0x40')](db[_0x58a0('0x3a')][_0x58a0('0x3b')]);_0x58d748[_0x58a0('0x3f')]=_[_0x58a0('0x40')](_0x4e8721[_0x58a0('0x3f')]);_0x58d748['filters']=_[_0x58a0('0x42')](_0x58d748[_0x58a0('0x3e')],_0x58d748[_0x58a0('0x3f')]);_0x16a538['attributes']=_['intersection'](_0x58d748[_0x58a0('0x3e')],qs['fields'](_0x4e8721[_0x58a0('0x3f')][_0x58a0('0x43')]));_0x16a538[_0x58a0('0x44')]=_0x16a538[_0x58a0('0x44')][_0x58a0('0x54')]?_0x16a538[_0x58a0('0x44')]:_0x58d748[_0x58a0('0x3e')];if(_0x4e8721[_0x58a0('0x3f')]['includeAll']){_0x16a538[_0x58a0('0x50')]=[{'all':!![]}];}_0x16a538=_['merge']({},_0x16a538,_0x4e8721[_0x58a0('0x4e')]);return db['VoiceContext'][_0x58a0('0x55')](_0x16a538)['then'](handleEntityNotFound(_0x23d142,null))[_0x58a0('0x1c')](respondWithResult(_0x23d142,null))['catch'](handleError(_0x23d142,null));};exports[_0x58a0('0x56')]=function(_0x51653c,_0x151294,_0x3f6c6d){var _0x271b37;return db[_0x58a0('0x3a')][_0x58a0('0x56')](_0x51653c[_0x58a0('0x57')],{'raw':!![]})[_0x58a0('0x1c')](function(_0x42ee73){_0x271b37=_0x42ee73;return db['VoiceContext'][_0x58a0('0x58')]({'raw':!![]});})[_0x58a0('0x1c')](function(_0x30dbff){var _0x2174cb=fs[_0x58a0('0x59')](path[_0x58a0('0x5a')](config['root'],'server/files/templates/context.ejs'),_0x58a0('0x5b'));var _0x5a283c=ejs[_0x58a0('0x5c')](_0x2174cb,{'contexts':_0x30dbff||[]});fs[_0x58a0('0x5d')](_0x58a0('0x5e'),_0x5a283c);})['then'](function(){return respondWithRpcPromise(_0x58a0('0x5f'),'create',{'module':_0x58a0('0x60')});})[_0x58a0('0x1c')](function(){var _0x1f1b30=_0x51653c[_0x58a0('0x61')][_0x58a0('0x32')]({'plain':!![]});if(!_0x1f1b30)throw new Error(_0x58a0('0x62'));if(_0x1f1b30['role']===_0x58a0('0x61')){var _0x43bcac=_0x271b37[_0x58a0('0x32')]({'plain':!![]});return db[_0x58a0('0x63')][_0x58a0('0x55')]({'where':{'name':_0x58a0('0x33'),'userProfileId':_0x1f1b30['userProfileId']},'raw':!![]})[_0x58a0('0x1c')](function(_0x748fdb){if(_0x748fdb&&_0x748fdb['autoAssociation']===0x0){return db[_0x58a0('0x34')]['create']({'name':_0x43bcac['name'],'resourceId':_0x43bcac['id'],'type':_0x748fdb[_0x58a0('0x36')],'sectionId':_0x748fdb['id']},{})[_0x58a0('0x1c')](function(){return _0x271b37;});}else{return _0x271b37;}})['catch'](function(_0x105f04){logger[_0x58a0('0x20')](_0x58a0('0x64'),_0x105f04);throw _0x105f04;});}return _0x271b37;})[_0x58a0('0x1c')](respondWithResult(_0x151294,0xc9))[_0x58a0('0x23')](handleError(_0x151294,null));};exports['update']=function(_0x519ae8,_0x4842e3,_0x16987e){var _0x4c9938;return db['VoiceContext'][_0x58a0('0x55')]({'where':{'id':_0x519ae8['params']['id']}})['then'](handleEntityNotFound(_0x4842e3,null))[_0x58a0('0x1c')](saveUpdates(_0x519ae8[_0x58a0('0x57')],null))[_0x58a0('0x1c')](function(_0x1c2f50){if(_0x1c2f50){_0x4c9938=_0x1c2f50;return db[_0x58a0('0x3a')][_0x58a0('0x58')]({'raw':!![]});}})[_0x58a0('0x1c')](function(_0xdc590a){var _0x5e71e5=fs[_0x58a0('0x59')](path[_0x58a0('0x5a')](config[_0x58a0('0x65')],'server/files/templates/context.ejs'),_0x58a0('0x5b'));var _0x43e900=ejs[_0x58a0('0x5c')](_0x5e71e5,{'contexts':_0xdc590a||[]});fs[_0x58a0('0x5d')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x43e900);})[_0x58a0('0x1c')](function(){return respondWithRpcPromise(_0x58a0('0x5f'),_0x58a0('0x30'),{'module':_0x58a0('0x60')});})[_0x58a0('0x1c')](function(){return _0x4c9938;})['then'](respondWithResult(_0x4842e3,null))[_0x58a0('0x23')](handleError(_0x4842e3,null));};exports['destroy']=function(_0x48685a,_0x1d0684,_0x4021bf){var _0x20ba28;return db[_0x58a0('0x3a')]['find']({'where':{'id':_0x48685a[_0x58a0('0x53')]['id']}})[_0x58a0('0x1c')](handleEntityNotFound(_0x1d0684,null))[_0x58a0('0x1c')](removeEntity(_0x1d0684,null))[_0x58a0('0x1c')](function(){return db[_0x58a0('0x3a')]['findAll']({'raw':!![]});})['then'](function(_0x47ee83){var _0x5a219e=fs['readFileSync'](path[_0x58a0('0x5a')](config[_0x58a0('0x65')],'server/files/templates/context.ejs'),_0x58a0('0x5b'));var _0x1e78e9=ejs['render'](_0x5a219e,{'contexts':_0x47ee83});fs[_0x58a0('0x5d')](_0x58a0('0x5e'),_0x1e78e9);return respondWithRpcPromise('Reload',_0x58a0('0x31'),{'module':_0x58a0('0x60')});})[_0x58a0('0x23')](handleError(_0x1d0684,null));}; \ No newline at end of file +var _0x221a=['map','fieldName','type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','merge','filter','VoiceContext','includeAll','findAll','show','params','keys','rawAttributes','length','options','find','create','body','readFileSync','join','root','server/files/templates/context.ejs','utf8','render','Reload','chan_sip.so','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../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','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','end','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','get','Contexts','UserProfileResource','sendStatus','name','status','send','index'];(function(_0x1e5fce,_0x20f11b){var _0x51443b=function(_0x54207d){while(--_0x54207d){_0x1e5fce['push'](_0x1e5fce['shift']());}};_0x51443b(++_0x20f11b);}(_0x221a,0x1ba));var _0xa221=function(_0x1220ed,_0x33c647){_0x1220ed=_0x1220ed-0x0;var _0x4f60f9=_0x221a[_0x1220ed];return _0x4f60f9;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa221('0x0'));var rimraf=require(_0xa221('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa221('0x2'));var rp=require('request-promise');var moment=require(_0xa221('0x3'));var BPromise=require(_0xa221('0x4'));var Mustache=require(_0xa221('0x5'));var util=require(_0xa221('0x6'));var path=require(_0xa221('0x7'));var sox=require(_0xa221('0x8'));var csv=require(_0xa221('0x9'));var ejs=require(_0xa221('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa221('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xa221('0x9'));var querystring=require(_0xa221('0xc'));var Papa=require(_0xa221('0xd'));var Redis=require(_0xa221('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa221('0xf'));var hardwareService=require(_0xa221('0x10'));var logger=require(_0xa221('0x11'))(_0xa221('0x12'));var utils=require(_0xa221('0x13'));var config=require(_0xa221('0x14'));var db=require(_0xa221('0x15'))['db'];var jayson=require(_0xa221('0x16'));var client=jayson[_0xa221('0x17')][_0xa221('0x18')]({'port':0x232a});function checkPasswordPattern(_0x2275a2,_0x80f1c3,_0x54cacd){if(_0x54cacd){var _0xf44cb8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xf44cb8['test'](_0x80f1c3)){return _0x2275a2;}else{throw new Error(_0xa221('0x19'));}}else{return _0x2275a2;}}function respondWithRpcPromise(_0x54ef01,_0x129519,_0x280a48,_0x13d4d5){return new BPromise(function(_0x351de7,_0x1b8310){var _0x1e974b=_0x13d4d5||client;return _0x1e974b[_0xa221('0x1a')](_0x54ef01,_0x280a48)[_0xa221('0x1b')](function(_0x1309d3){logger[_0xa221('0x1c')](_0xa221('0x1d'),_0x129519,_0xa221('0x1e'));logger[_0xa221('0x1f')](_0xa221('0x20'),_0x129519,_0xa221('0x1e'),JSON[_0xa221('0x21')](_0x1309d3));if(_0x1309d3[_0xa221('0x22')]){if(_0x1309d3[_0xa221('0x22')][_0xa221('0x23')]===0x1f4){logger['error'](_0xa221('0x1d'),_0x129519,_0x1309d3[_0xa221('0x22')][_0xa221('0x24')]);return _0x1b8310(_0x1309d3[_0xa221('0x22')]['message']);}logger[_0xa221('0x22')](_0xa221('0x1d'),_0x129519,_0x1309d3[_0xa221('0x22')]['message']);return _0x351de7(_0x1309d3['error'][_0xa221('0x24')]);}else{logger[_0xa221('0x1c')]('VoiceContext,\x20%s,\x20%s',_0x129519,_0xa221('0x1e'));_0x351de7(_0x1309d3[_0xa221('0x25')]['message']);}})[_0xa221('0x26')](function(_0x3d3bd3){logger['error']('VoiceContext,\x20%s,\x20%s',_0x129519,_0x3d3bd3);_0x1b8310(_0x3d3bd3);});});}function respondWithStatusCode(_0x30363f,_0x25df6e){_0x25df6e=_0x25df6e||0xcc;return function(_0x3347a8){if(_0x3347a8){return _0x30363f['sendStatus'](_0x25df6e);}return _0x30363f['status'](_0x25df6e)[_0xa221('0x27')]();};}function respondWithResult(_0x1cb094,_0x2a1e8e){_0x2a1e8e=_0x2a1e8e||0xc8;return function(_0x2f4859){if(_0x2f4859){return _0x1cb094['status'](_0x2a1e8e)[_0xa221('0x28')](_0x2f4859);}};}function respondWithFilteredResult(_0x53b217,_0x4086eb){return function(_0x23ce78){if(_0x23ce78){var _0x3c1641=_0x23ce78[_0xa221('0x29')],_0x478c01=_0x4086eb[_0xa221('0x2a')],_0x557bdb=_0x4086eb['offset']+_0x4086eb[_0xa221('0x2b')],_0x3efb32;if(_0x557bdb>=_0x3c1641){_0x557bdb=_0x3c1641;_0x3efb32=0xc8;}else{_0x3efb32=0xce;}_0x53b217['status'](_0x3efb32);return _0x53b217[_0xa221('0x2c')](_0xa221('0x2d'),_0x478c01+'-'+_0x557bdb+'/'+_0x3c1641)[_0xa221('0x28')](_0x23ce78);}return null;};}function patchUpdates(_0x2ff839){return function(_0xe2579c){try{jsonpatch['apply'](_0xe2579c,_0x2ff839,!![]);}catch(_0x648fa2){return BPromise[_0xa221('0x2e')](_0x648fa2);}return _0xe2579c[_0xa221('0x2f')]();};}function saveUpdates(_0x239ec0,_0xfdad93){return function(_0x36a566){if(_0x36a566){return _0x36a566[_0xa221('0x30')](_0x239ec0)[_0xa221('0x1b')](function(_0x23592e){return _0x23592e;});}return null;};}function removeEntity(_0x2bd61b,_0x706ec){return function(_0x580a95){if(_0x580a95){return _0x580a95[_0xa221('0x31')]()[_0xa221('0x1b')](function(){var _0x2036e2=_0x580a95[_0xa221('0x32')]({'plain':!![]});var _0x38279f=_0xa221('0x33');return db[_0xa221('0x34')][_0xa221('0x31')]({'where':{'type':_0x38279f,'resourceId':_0x2036e2['id']}})['then'](function(){return _0x580a95;});})[_0xa221('0x1b')](function(){_0x2bd61b['status'](0xcc)[_0xa221('0x27')]();});}};}function handleEntityNotFound(_0x582869,_0x5beff1){return function(_0xd3b46d){if(!_0xd3b46d){_0x582869[_0xa221('0x35')](0x194);}return _0xd3b46d;};}function handleError(_0x3f84c5,_0x60597c){_0x60597c=_0x60597c||0x1f4;return function(_0x302e3b){logger[_0xa221('0x22')](_0x302e3b['stack']);if(_0x302e3b[_0xa221('0x36')]){delete _0x302e3b['name'];}_0x3f84c5[_0xa221('0x37')](_0x60597c)[_0xa221('0x38')](_0x302e3b);};}exports[_0xa221('0x39')]=function(_0x23aceb,_0x4b6c25){var _0x4b311c={},_0x1a9e24={},_0x1cca66={'count':0x0,'rows':[]};var _0x5749dc=_[_0xa221('0x3a')](db['VoiceContext']['rawAttributes'],function(_0xccd448){return{'name':_0xccd448[_0xa221('0x3b')],'type':_0xccd448[_0xa221('0x3c')][_0xa221('0x3d')]};});_0x1a9e24[_0xa221('0x3e')]=_[_0xa221('0x3a')](_0x5749dc,_0xa221('0x36'));_0x1a9e24[_0xa221('0x3f')]=_['keys'](_0x23aceb['query']);_0x1a9e24[_0xa221('0x40')]=_['intersection'](_0x1a9e24[_0xa221('0x3e')],_0x1a9e24['query']);_0x4b311c[_0xa221('0x41')]=_[_0xa221('0x42')](_0x1a9e24[_0xa221('0x3e')],qs[_0xa221('0x43')](_0x23aceb[_0xa221('0x3f')][_0xa221('0x43')]));_0x4b311c[_0xa221('0x41')]=_0x4b311c['attributes']['length']?_0x4b311c[_0xa221('0x41')]:_0x1a9e24[_0xa221('0x3e')];if(!_0x23aceb[_0xa221('0x3f')][_0xa221('0x44')]('nolimit')){_0x4b311c[_0xa221('0x2b')]=qs[_0xa221('0x2b')](_0x23aceb[_0xa221('0x3f')][_0xa221('0x2b')]);_0x4b311c[_0xa221('0x2a')]=qs[_0xa221('0x2a')](_0x23aceb['query'][_0xa221('0x2a')]);}_0x4b311c[_0xa221('0x45')]=qs[_0xa221('0x46')](_0x23aceb[_0xa221('0x3f')][_0xa221('0x46')]);_0x4b311c[_0xa221('0x47')]=qs[_0xa221('0x40')](_[_0xa221('0x48')](_0x23aceb[_0xa221('0x3f')],_0x1a9e24[_0xa221('0x40')]));if(_0x23aceb[_0xa221('0x3f')]['filter']){_0x4b311c[_0xa221('0x47')]=_[_0xa221('0x49')](_0x4b311c[_0xa221('0x47')],{'$or':_[_0xa221('0x3a')](_0x5749dc,function(_0x437afe){if(_0x437afe[_0xa221('0x3c')][_0xa221('0x3d')]!=='VIRTUAL'){var _0x475d49={};_0x475d49[_0x437afe['field']]={'$like':'%'+_0x23aceb[_0xa221('0x3f')][_0xa221('0x4a')]+'%'};return _0x475d49;}})});}_0x4b311c=_[_0xa221('0x49')]({},_0x4b311c,_0x23aceb['options']);var _0x36f1ce={'where':_0x4b311c[_0xa221('0x47')]};return db[_0xa221('0x4b')]['count'](_0x36f1ce)[_0xa221('0x1b')](function(_0x46b354){_0x1cca66[_0xa221('0x29')]=_0x46b354;if(_0x23aceb[_0xa221('0x3f')][_0xa221('0x4c')]){_0x4b311c['include']=[{'all':!![]}];}return db[_0xa221('0x4b')][_0xa221('0x4d')](_0x4b311c);})['then'](function(_0x554ee3){_0x1cca66['rows']=_0x554ee3;return _0x1cca66;})[_0xa221('0x1b')](respondWithFilteredResult(_0x4b6c25,_0x4b311c))['catch'](handleError(_0x4b6c25,null));};exports[_0xa221('0x4e')]=function(_0x1f0bc8,_0x58f739){var _0x44e5ad={'raw':![],'where':{'id':_0x1f0bc8[_0xa221('0x4f')]['id']}},_0x4fdcb9={};_0x4fdcb9[_0xa221('0x3e')]=_[_0xa221('0x50')](db[_0xa221('0x4b')][_0xa221('0x51')]);_0x4fdcb9[_0xa221('0x3f')]=_['keys'](_0x1f0bc8[_0xa221('0x3f')]);_0x4fdcb9['filters']=_[_0xa221('0x42')](_0x4fdcb9[_0xa221('0x3e')],_0x4fdcb9['query']);_0x44e5ad[_0xa221('0x41')]=_[_0xa221('0x42')](_0x4fdcb9[_0xa221('0x3e')],qs[_0xa221('0x43')](_0x1f0bc8[_0xa221('0x3f')]['fields']));_0x44e5ad[_0xa221('0x41')]=_0x44e5ad[_0xa221('0x41')][_0xa221('0x52')]?_0x44e5ad[_0xa221('0x41')]:_0x4fdcb9['model'];if(_0x1f0bc8[_0xa221('0x3f')]['includeAll']){_0x44e5ad['include']=[{'all':!![]}];}_0x44e5ad=_['merge']({},_0x44e5ad,_0x1f0bc8[_0xa221('0x53')]);return db[_0xa221('0x4b')][_0xa221('0x54')](_0x44e5ad)[_0xa221('0x1b')](handleEntityNotFound(_0x58f739,null))[_0xa221('0x1b')](respondWithResult(_0x58f739,null))[_0xa221('0x26')](handleError(_0x58f739,null));};exports[_0xa221('0x55')]=function(_0x52cbdd,_0xa7d00c,_0x59fb93){var _0x2dbfab;return db[_0xa221('0x4b')][_0xa221('0x55')](_0x52cbdd[_0xa221('0x56')],{'raw':!![]})[_0xa221('0x1b')](function(_0x1132b9){_0x2dbfab=_0x1132b9;return db['VoiceContext']['findAll']({'raw':!![]});})[_0xa221('0x1b')](function(_0x551e86){var _0x551b55=fs[_0xa221('0x57')](path[_0xa221('0x58')](config[_0xa221('0x59')],_0xa221('0x5a')),_0xa221('0x5b'));var _0x3701f7=ejs[_0xa221('0x5c')](_0x551b55,{'contexts':_0x551e86||[]});fs['writeFileSync']('/etc/asterisk/extensions_xcally_contexts.conf',_0x3701f7);})[_0xa221('0x1b')](function(){return respondWithRpcPromise(_0xa221('0x5d'),_0xa221('0x55'),{'module':_0xa221('0x5e')});})[_0xa221('0x1b')](function(){var _0x47907c=_0x52cbdd[_0xa221('0x5f')]['get']({'plain':!![]});if(!_0x47907c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x47907c['role']==='user'){var _0x2ce3ab=_0x2dbfab['get']({'plain':!![]});return db[_0xa221('0x60')][_0xa221('0x54')]({'where':{'name':_0xa221('0x33'),'userProfileId':_0x47907c['userProfileId']},'raw':!![]})['then'](function(_0x2047f7){if(_0x2047f7&&_0x2047f7['autoAssociation']===0x0){return db['UserProfileResource'][_0xa221('0x55')]({'name':_0x2ce3ab[_0xa221('0x36')],'resourceId':_0x2ce3ab['id'],'type':_0x2047f7[_0xa221('0x36')],'sectionId':_0x2047f7['id']},{})['then'](function(){return _0x2dbfab;});}else{return _0x2dbfab;}})[_0xa221('0x26')](function(_0x4d8fde){logger[_0xa221('0x22')](_0xa221('0x61'),_0x4d8fde);throw _0x4d8fde;});}return _0x2dbfab;})[_0xa221('0x1b')](respondWithResult(_0xa7d00c,0xc9))['catch'](handleError(_0xa7d00c,null));};exports[_0xa221('0x30')]=function(_0x397074,_0x4d4924,_0xc270d4){var _0x5bfb8a;return db[_0xa221('0x4b')][_0xa221('0x54')]({'where':{'id':_0x397074['params']['id']}})[_0xa221('0x1b')](handleEntityNotFound(_0x4d4924,null))['then'](saveUpdates(_0x397074['body'],null))[_0xa221('0x1b')](function(_0x1a8a0e){if(_0x1a8a0e){_0x5bfb8a=_0x1a8a0e;return db[_0xa221('0x4b')][_0xa221('0x4d')]({'raw':!![]});}})[_0xa221('0x1b')](function(_0x41d289){var _0x5e2cb4=fs[_0xa221('0x57')](path[_0xa221('0x58')](config['root'],'server/files/templates/context.ejs'),'utf8');var _0x279356=ejs['render'](_0x5e2cb4,{'contexts':_0x41d289||[]});fs[_0xa221('0x62')](_0xa221('0x63'),_0x279356);})[_0xa221('0x1b')](function(){return respondWithRpcPromise(_0xa221('0x5d'),_0xa221('0x30'),{'module':_0xa221('0x5e')});})[_0xa221('0x1b')](function(){return _0x5bfb8a;})[_0xa221('0x1b')](respondWithResult(_0x4d4924,null))[_0xa221('0x26')](handleError(_0x4d4924,null));};exports[_0xa221('0x31')]=function(_0x378c62,_0x14af89,_0x31d92d){var _0x5859ce;return db['VoiceContext'][_0xa221('0x54')]({'where':{'id':_0x378c62[_0xa221('0x4f')]['id']}})[_0xa221('0x1b')](handleEntityNotFound(_0x14af89,null))[_0xa221('0x1b')](removeEntity(_0x14af89,null))[_0xa221('0x1b')](function(){return db[_0xa221('0x4b')][_0xa221('0x4d')]({'raw':!![]});})[_0xa221('0x1b')](function(_0x512c99){var _0x1bcef0=fs[_0xa221('0x57')](path[_0xa221('0x58')](config[_0xa221('0x59')],'server/files/templates/context.ejs'),_0xa221('0x5b'));var _0x26ecfe=ejs['render'](_0x1bcef0,{'contexts':_0x512c99});fs[_0xa221('0x62')](_0xa221('0x63'),_0x26ecfe);return respondWithRpcPromise(_0xa221('0x5d'),_0xa221('0x31'),{'module':'chan_sip.so'});})['catch'](handleError(_0x14af89,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index d7d526e..c8134cf 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 _0xf930=['bluebird','rimraf','exports','VoiceContext','voice_contexts','lodash','util','api'];(function(_0x2c4f2f,_0x380d51){var _0x52699a=function(_0x2d0140){while(--_0x2d0140){_0x2c4f2f['push'](_0x2c4f2f['shift']());}};_0x52699a(++_0x380d51);}(_0xf930,0x65));var _0x0f93=function(_0x528651,_0x85fecd){_0x528651=_0x528651-0x0;var _0x425450=_0xf930[_0x528651];return _0x425450;};'use strict';var _=require(_0x0f93('0x0'));var util=require(_0x0f93('0x1'));var logger=require('../../config/logger')(_0x0f93('0x2'));var moment=require('moment');var BPromise=require(_0x0f93('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0f93('0x4'));var config=require('../../config/environment');var attributes=require('./voiceContext.attributes');module[_0x0f93('0x5')]=function(_0x1b1d83,_0x47ec1d){return _0x1b1d83['define'](_0x0f93('0x6'),attributes,{'tableName':_0x0f93('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x317e=['util','../../config/logger','api','path','rimraf','../../config/environment','./voiceContext.attributes','exports','define','VoiceContext','lodash'];(function(_0x1b2630,_0x2532ac){var _0x13dc18=function(_0x1ebbc1){while(--_0x1ebbc1){_0x1b2630['push'](_0x1b2630['shift']());}};_0x13dc18(++_0x2532ac);}(_0x317e,0xd0));var _0xe317=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x317e[_0x49ca18];return _0x145d54;};'use strict';var _=require(_0xe317('0x0'));var util=require(_0xe317('0x1'));var logger=require(_0xe317('0x2'))(_0xe317('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe317('0x4'));var rimraf=require(_0xe317('0x5'));var config=require(_0xe317('0x6'));var attributes=require(_0xe317('0x7'));module[_0xe317('0x8')]=function(_0x4c0e31,_0x19b4a7){return _0x4c0e31[_0xe317('0x9')](_0xe317('0xa'),attributes,{'tableName':'voice_contexts','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 9ac3fa8..34f072b 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 _0xb549=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x19ea78,_0xd94060){var _0x45cd37=function(_0x2a73a3){while(--_0x2a73a3){_0x19ea78['push'](_0x19ea78['shift']());}};_0x45cd37(++_0xd94060);}(_0xb549,0x7c));var _0x9b54=function(_0xebb349,_0x55ee4d){_0xebb349=_0xebb349-0x0;var _0x4b590=_0xb549[_0xebb349];return _0x4b590;};'use strict';var _=require(_0x9b54('0x0'));var util=require(_0x9b54('0x1'));var moment=require(_0x9b54('0x2'));var BPromise=require(_0x9b54('0x3'));var rs=require(_0x9b54('0x4'));var fs=require('fs');var Redis=require(_0x9b54('0x5'));var db=require(_0x9b54('0x6'))['db'];var utils=require(_0x9b54('0x7'));var logger=require(_0x9b54('0x8'))(_0x9b54('0x9'));var config=require(_0x9b54('0xa'));var jayson=require(_0x9b54('0xb'));var client=jayson[_0x9b54('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x295584,_0x2e48a3,_0x488cb3){return new BPromise(function(_0x573e31,_0x555bff){return client['request'](_0x295584,_0x488cb3)[_0x9b54('0xd')](function(_0x294535){logger[_0x9b54('0xe')](_0x9b54('0xf'),_0x2e48a3,'request\x20sent');logger[_0x9b54('0x10')](_0x9b54('0x11'),_0x2e48a3,_0x9b54('0x12'),JSON['stringify'](_0x294535));if(_0x294535[_0x9b54('0x13')]){if(_0x294535[_0x9b54('0x13')][_0x9b54('0x14')]===0x1f4){logger['error']('VoiceContext,\x20%s,\x20%s',_0x2e48a3,_0x294535[_0x9b54('0x13')][_0x9b54('0x15')]);return _0x555bff(_0x294535[_0x9b54('0x13')][_0x9b54('0x15')]);}logger['error'](_0x9b54('0xf'),_0x2e48a3,_0x294535[_0x9b54('0x13')][_0x9b54('0x15')]);return _0x573e31(_0x294535[_0x9b54('0x13')]['message']);}else{logger['info'](_0x9b54('0xf'),_0x2e48a3,'request\x20sent');_0x573e31(_0x294535[_0x9b54('0x16')][_0x9b54('0x15')]);}})[_0x9b54('0x17')](function(_0x5b5bb5){logger[_0x9b54('0x13')](_0x9b54('0xf'),_0x2e48a3,_0x5b5bb5);_0x555bff(_0x5b5bb5);});});} \ No newline at end of file +var _0x1aa8=['client','http','request','then','info','VoiceContext,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0xdfdeb7,_0x29649c){var _0x1db931=function(_0x65c2bd){while(--_0x65c2bd){_0xdfdeb7['push'](_0xdfdeb7['shift']());}};_0x1db931(++_0x29649c);}(_0x1aa8,0x16d));var _0x81aa=function(_0x35c8ca,_0xf2a176){_0x35c8ca=_0x35c8ca-0x0;var _0x2a3cbd=_0x1aa8[_0x35c8ca];return _0x2a3cbd;};'use strict';var _=require(_0x81aa('0x0'));var util=require(_0x81aa('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x81aa('0x2'));var fs=require('fs');var Redis=require(_0x81aa('0x3'));var db=require(_0x81aa('0x4'))['db'];var utils=require(_0x81aa('0x5'));var logger=require('../../config/logger')(_0x81aa('0x6'));var config=require(_0x81aa('0x7'));var jayson=require(_0x81aa('0x8'));var client=jayson[_0x81aa('0x9')][_0x81aa('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59d782,_0x344075,_0x56fbdc){return new BPromise(function(_0x2da725,_0x266588){return client[_0x81aa('0xb')](_0x59d782,_0x56fbdc)[_0x81aa('0xc')](function(_0xb779b5){logger[_0x81aa('0xd')](_0x81aa('0xe'),_0x344075,'request\x20sent');logger[_0x81aa('0xf')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x344075,_0x81aa('0x10'),JSON[_0x81aa('0x11')](_0xb779b5));if(_0xb779b5['error']){if(_0xb779b5[_0x81aa('0x12')][_0x81aa('0x13')]===0x1f4){logger[_0x81aa('0x12')](_0x81aa('0xe'),_0x344075,_0xb779b5[_0x81aa('0x12')][_0x81aa('0x14')]);return _0x266588(_0xb779b5[_0x81aa('0x12')][_0x81aa('0x14')]);}logger[_0x81aa('0x12')]('VoiceContext,\x20%s,\x20%s',_0x344075,_0xb779b5['error'][_0x81aa('0x14')]);return _0x2da725(_0xb779b5[_0x81aa('0x12')][_0x81aa('0x14')]);}else{logger[_0x81aa('0xd')](_0x81aa('0xe'),_0x344075,_0x81aa('0x10'));_0x2da725(_0xb779b5[_0x81aa('0x15')]['message']);}})['catch'](function(_0x40d5c6){logger[_0x81aa('0x12')]('VoiceContext,\x20%s,\x20%s',_0x344075,_0x40d5c6);_0x266588(_0x40d5c6);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index a707565..26ae119 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 _0xf0d8=['show','post','update','delete','destroy','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x2bd40b,_0x3f95d8){var _0x598af2=function(_0x17af13){while(--_0x17af13){_0x2bd40b['push'](_0x2bd40b['shift']());}};_0x598af2(++_0x3f95d8);}(_0xf0d8,0x16e));var _0x8f0d=function(_0x3febaa,_0x1ea043){_0x3febaa=_0x3febaa-0x0;var _0x32f098=_0xf0d8[_0x3febaa];return _0x32f098;};'use strict';var multer=require(_0x8f0d('0x0'));var util=require(_0x8f0d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8f0d('0x2'));var router=express[_0x8f0d('0x3')]();var auth=require(_0x8f0d('0x4'));var interaction=require(_0x8f0d('0x5'));var config=require(_0x8f0d('0x6'));var controller=require(_0x8f0d('0x7'));router[_0x8f0d('0x8')]('/',auth[_0x8f0d('0x9')](),controller[_0x8f0d('0xa')]);router[_0x8f0d('0x8')](_0x8f0d('0xb'),auth[_0x8f0d('0x9')](),controller[_0x8f0d('0xc')]);router[_0x8f0d('0x8')](_0x8f0d('0xd'),auth['isAuthenticated'](),controller[_0x8f0d('0xe')]);router[_0x8f0d('0xf')]('/',auth[_0x8f0d('0x9')](),controller['create']);router['put']('/:id',auth[_0x8f0d('0x9')](),controller[_0x8f0d('0x10')]);router[_0x8f0d('0x11')](_0x8f0d('0xd'),auth['isAuthenticated'](),controller[_0x8f0d('0x12')]);module[_0x8f0d('0x13')]=router; \ No newline at end of file +var _0xe483=['/:id','show','post','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./voiceDialReport.controller','get','isAuthenticated','index','describe'];(function(_0x321d17,_0x476ad0){var _0x2eeef7=function(_0x510fb0){while(--_0x510fb0){_0x321d17['push'](_0x321d17['shift']());}};_0x2eeef7(++_0x476ad0);}(_0xe483,0x79));var _0x3e48=function(_0x4957d3,_0x26266d){_0x4957d3=_0x4957d3-0x0;var _0x3bc4f2=_0xe483[_0x4957d3];return _0x3bc4f2;};'use strict';var multer=require(_0x3e48('0x0'));var util=require(_0x3e48('0x1'));var path=require(_0x3e48('0x2'));var timeout=require(_0x3e48('0x3'));var express=require(_0x3e48('0x4'));var router=express[_0x3e48('0x5')]();var auth=require(_0x3e48('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3e48('0x7'));router[_0x3e48('0x8')]('/',auth[_0x3e48('0x9')](),controller[_0x3e48('0xa')]);router['get']('/describe',auth[_0x3e48('0x9')](),controller[_0x3e48('0xb')]);router[_0x3e48('0x8')](_0x3e48('0xc'),auth[_0x3e48('0x9')](),controller[_0x3e48('0xd')]);router[_0x3e48('0xe')]('/',auth[_0x3e48('0x9')](),controller['create']);router[_0x3e48('0xf')](_0x3e48('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x3e48('0x10')]('/:id',auth[_0x3e48('0x9')](),controller[_0x3e48('0x11')]);module[_0x3e48('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 5e697e9..d745887 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 _0xf62f=['sequelize','exports','STRING','INTEGER','DATE','called,connect,complete'];(function(_0x26d745,_0x4a5cd8){var _0x4acc43=function(_0xfecc00){while(--_0xfecc00){_0x26d745['push'](_0x26d745['shift']());}};_0x4acc43(++_0x4a5cd8);}(_0xf62f,0x84));var _0xff62=function(_0x1f5293,_0x380e75){_0x1f5293=_0x1f5293-0x0;var _0x18395b=_0xf62f[_0x1f5293];return _0x18395b;};'use strict';var Sequelize=require(_0xff62('0x0'));module[_0xff62('0x1')]={'privilege':{'type':Sequelize[_0xff62('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0xff62('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xff62('0x2')]},'calleridname':{'type':Sequelize[_0xff62('0x2')]},'connectedlinenum':{'type':Sequelize[_0xff62('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xff62('0x2')]},'accountcode':{'type':Sequelize[_0xff62('0x2')]},'context':{'type':Sequelize[_0xff62('0x2')]},'exten':{'type':Sequelize[_0xff62('0x2')]},'priority':{'type':Sequelize[_0xff62('0x3')]},'uniqueid':{'type':Sequelize[_0xff62('0x2')]},'linkedid':{'type':Sequelize[_0xff62('0x2')]},'destchannel':{'type':Sequelize[_0xff62('0x2')]},'destchannelstate':{'type':Sequelize[_0xff62('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xff62('0x2')]},'destcalleridnum':{'type':Sequelize[_0xff62('0x2')]},'destcalleridname':{'type':Sequelize[_0xff62('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xff62('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xff62('0x2')]},'destlanguage':{'type':Sequelize[_0xff62('0x2')]},'destaccountcode':{'type':Sequelize[_0xff62('0x2')]},'destcontext':{'type':Sequelize[_0xff62('0x2')]},'destexten':{'type':Sequelize[_0xff62('0x2')]},'destpriority':{'type':Sequelize[_0xff62('0x3')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize[_0xff62('0x2')]},'dialstring':{'type':Sequelize[_0xff62('0x2')]},'dialstatus':{'type':Sequelize[_0xff62('0x2')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xff62('0x4')]},'endtime':{'type':Sequelize[_0xff62('0x4')]},'lastevent':{'type':Sequelize[_0xff62('0x2')],'comment':_0xff62('0x5')},'routeId':{'type':Sequelize[_0xff62('0x3')]},'duration':{'type':Sequelize[_0xff62('0x3')]},'holdtime':{'type':Sequelize[_0xff62('0x3')]},'billableseconds':{'type':Sequelize[_0xff62('0x3')]}}; \ No newline at end of file +var _0xc677=['DATE','called,connect,complete','STRING','INTEGER'];(function(_0x21ecc8,_0x2bdead){var _0x510c1d=function(_0x3b6862){while(--_0x3b6862){_0x21ecc8['push'](_0x21ecc8['shift']());}};_0x510c1d(++_0x2bdead);}(_0xc677,0x11e));var _0x7c67=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xc677[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require('sequelize');module['exports']={'privilege':{'type':Sequelize[_0x7c67('0x0')]},'channel':{'type':Sequelize[_0x7c67('0x0')]},'channelstate':{'type':Sequelize[_0x7c67('0x1')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x7c67('0x0')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x7c67('0x0')]},'accountcode':{'type':Sequelize[_0x7c67('0x0')]},'context':{'type':Sequelize[_0x7c67('0x0')]},'exten':{'type':Sequelize[_0x7c67('0x0')]},'priority':{'type':Sequelize[_0x7c67('0x1')]},'uniqueid':{'type':Sequelize[_0x7c67('0x0')]},'linkedid':{'type':Sequelize[_0x7c67('0x0')]},'destchannel':{'type':Sequelize[_0x7c67('0x0')]},'destchannelstate':{'type':Sequelize[_0x7c67('0x1')]},'destchannelstatedesc':{'type':Sequelize[_0x7c67('0x0')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x7c67('0x0')]},'destconnectedlinenum':{'type':Sequelize[_0x7c67('0x0')]},'destconnectedlinename':{'type':Sequelize[_0x7c67('0x0')]},'destlanguage':{'type':Sequelize[_0x7c67('0x0')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x7c67('0x0')]},'destpriority':{'type':Sequelize[_0x7c67('0x1')]},'destuniqueid':{'type':Sequelize[_0x7c67('0x0')]},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize[_0x7c67('0x0')]},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x7c67('0x2')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x7c67('0x2')]},'lastevent':{'type':Sequelize[_0x7c67('0x0')],'comment':_0x7c67('0x3')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize[_0x7c67('0x1')]},'holdtime':{'type':Sequelize[_0x7c67('0x1')]},'billableseconds':{'type':Sequelize[_0x7c67('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 209fc67..4a578ed 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 _0xa9e0=['create','body','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','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','map','VoiceDialReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','show','params','options','find','catch'];(function(_0x51bda1,_0x44f80d){var _0x1ce08c=function(_0x5b788e){while(--_0x5b788e){_0x51bda1['push'](_0x51bda1['shift']());}};_0x1ce08c(++_0x44f80d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];function respondWithStatusCode(_0x36471c,_0xd5b662){_0xd5b662=_0xd5b662||0xcc;return function(_0x26d672){if(_0x26d672){return _0x36471c[_0x0a9e('0x14')](_0xd5b662);}return _0x36471c[_0x0a9e('0x15')](_0xd5b662)['end']();};}function respondWithResult(_0x4283ce,_0x239b12){_0x239b12=_0x239b12||0xc8;return function(_0x2b4227){if(_0x2b4227){return _0x4283ce[_0x0a9e('0x15')](_0x239b12)[_0x0a9e('0x16')](_0x2b4227);}};}function respondWithFilteredResult(_0x4d5611,_0x52a03d){return function(_0x22dccb){if(_0x22dccb){var _0x5d0880=_0x22dccb[_0x0a9e('0x17')],_0x1985b6=_0x52a03d['offset'],_0x519dfd=_0x52a03d[_0x0a9e('0x18')]+_0x52a03d['limit'],_0x16033c;if(_0x519dfd>=_0x5d0880){_0x519dfd=_0x5d0880;_0x16033c=0xc8;}else{_0x16033c=0xce;}_0x4d5611[_0x0a9e('0x15')](_0x16033c);return _0x4d5611[_0x0a9e('0x19')](_0x0a9e('0x1a'),_0x1985b6+'-'+_0x519dfd+'/'+_0x5d0880)[_0x0a9e('0x16')](_0x22dccb);}return null;};}function patchUpdates(_0x31b1ca){return function(_0x2eb11f){try{jsonpatch[_0x0a9e('0x1b')](_0x2eb11f,_0x31b1ca,!![]);}catch(_0x20559e){return BPromise[_0x0a9e('0x1c')](_0x20559e);}return _0x2eb11f[_0x0a9e('0x1d')]();};}function saveUpdates(_0x1c696a,_0x105080){return function(_0x4bb1e3){if(_0x4bb1e3){return _0x4bb1e3[_0x0a9e('0x1e')](_0x1c696a)[_0x0a9e('0x1f')](function(_0x53682f){return _0x53682f;});}return null;};}function removeEntity(_0x20f109,_0x5a09ef){return function(_0x588269){if(_0x588269){return _0x588269[_0x0a9e('0x20')]()[_0x0a9e('0x1f')](function(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x21')]();});}};}function handleEntityNotFound(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(!_0x2fb0e4){_0x4abc77[_0x0a9e('0x14')](0x194);}return _0x2fb0e4;};}function handleError(_0x4d00e6,_0x370d86){_0x370d86=_0x370d86||0x1f4;return function(_0x42ac8f){logger[_0x0a9e('0x22')](_0x42ac8f['stack']);if(_0x42ac8f['name']){delete _0x42ac8f[_0x0a9e('0x23')];}_0x4d00e6[_0x0a9e('0x15')](_0x370d86)[_0x0a9e('0x24')](_0x42ac8f);};}exports[_0x0a9e('0x25')]=function(_0x526cf3,_0x384319){var _0x479bc4={},_0x45a1e7={},_0x5bfb33={'count':0x0,'rows':[]};var _0x1dc186=_[_0x0a9e('0x26')](db[_0x0a9e('0x27')][_0x0a9e('0x28')],function(_0x140511){return{'name':_0x140511[_0x0a9e('0x29')],'type':_0x140511[_0x0a9e('0x2a')][_0x0a9e('0x2b')]};});_0x45a1e7['model']=_[_0x0a9e('0x26')](_0x1dc186,_0x0a9e('0x23'));_0x45a1e7[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x526cf3['query']);_0x45a1e7[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],_0x45a1e7[_0x0a9e('0x2c')]);_0x479bc4[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],qs[_0x0a9e('0x32')](_0x526cf3[_0x0a9e('0x2c')]['fields']));_0x479bc4[_0x0a9e('0x31')]=_0x479bc4['attributes'][_0x0a9e('0x33')]?_0x479bc4[_0x0a9e('0x31')]:_0x45a1e7[_0x0a9e('0x30')];if(!_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x34')]('nolimit')){_0x479bc4[_0x0a9e('0x35')]=qs[_0x0a9e('0x35')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x35')]);_0x479bc4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x18')]);}_0x479bc4['order']=qs[_0x0a9e('0x36')](_0x526cf3['query'][_0x0a9e('0x36')]);_0x479bc4[_0x0a9e('0x37')]=qs[_0x0a9e('0x2e')](_[_0x0a9e('0x38')](_0x526cf3['query'],_0x45a1e7[_0x0a9e('0x2e')]));if(_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x39')]){_0x479bc4[_0x0a9e('0x37')]=_['merge'](_0x479bc4['where'],{'$or':_[_0x0a9e('0x26')](_0x1dc186,function(_0x5640eb){if(_0x5640eb[_0x0a9e('0x2a')][_0x0a9e('0x2b')]!==_0x0a9e('0x3a')){var _0x1ef87a={};_0x1ef87a[_0x5640eb['field']]={'$like':'%'+_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x39')]+'%'};return _0x1ef87a;}})});}_0x479bc4=_[_0x0a9e('0x3b')]({},_0x479bc4,_0x526cf3['options']);var _0x1dbf74={'where':_0x479bc4[_0x0a9e('0x37')]};return db[_0x0a9e('0x27')]['count'](_0x1dbf74)['then'](function(_0x11b61d){_0x5bfb33[_0x0a9e('0x17')]=_0x11b61d;if(_0x526cf3['query'][_0x0a9e('0x3c')]){_0x479bc4[_0x0a9e('0x3d')]=[{'all':!![]}];}return db[_0x0a9e('0x27')][_0x0a9e('0x3e')](_0x479bc4);})['then'](function(_0x5a594b){_0x5bfb33[_0x0a9e('0x3f')]=_0x5a594b;return _0x5bfb33;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x384319,_0x479bc4))['catch'](handleError(_0x384319,null));};exports[_0x0a9e('0x40')]=function(_0x1dec2e,_0x1459bb){var _0x5b4f5e={'raw':!![],'where':{'id':_0x1dec2e[_0x0a9e('0x41')]['id']}},_0x316c8f={};_0x316c8f[_0x0a9e('0x30')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x27')][_0x0a9e('0x28')]);_0x316c8f[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x1dec2e[_0x0a9e('0x2c')]);_0x316c8f[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x316c8f[_0x0a9e('0x30')],_0x316c8f[_0x0a9e('0x2c')]);_0x5b4f5e[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x316c8f['model'],qs['fields'](_0x1dec2e[_0x0a9e('0x2c')][_0x0a9e('0x32')]));_0x5b4f5e[_0x0a9e('0x31')]=_0x5b4f5e[_0x0a9e('0x31')][_0x0a9e('0x33')]?_0x5b4f5e[_0x0a9e('0x31')]:_0x316c8f[_0x0a9e('0x30')];if(_0x1dec2e[_0x0a9e('0x2c')][_0x0a9e('0x3c')]){_0x5b4f5e[_0x0a9e('0x3d')]=[{'all':!![]}];}_0x5b4f5e=_[_0x0a9e('0x3b')]({},_0x5b4f5e,_0x1dec2e[_0x0a9e('0x42')]);return db['VoiceDialReport'][_0x0a9e('0x43')](_0x5b4f5e)[_0x0a9e('0x1f')](handleEntityNotFound(_0x1459bb,null))[_0x0a9e('0x1f')](respondWithResult(_0x1459bb,null))[_0x0a9e('0x44')](handleError(_0x1459bb,null));};exports[_0x0a9e('0x45')]=function(_0xbe9d19,_0x21eb86){return db[_0x0a9e('0x27')]['create'](_0xbe9d19[_0x0a9e('0x46')],{})['then'](respondWithResult(_0x21eb86,0xc9))[_0x0a9e('0x44')](handleError(_0x21eb86,null));};exports[_0x0a9e('0x1e')]=function(_0x8d6dd1,_0x562fb4){if(_0x8d6dd1[_0x0a9e('0x46')]['id']){delete _0x8d6dd1[_0x0a9e('0x46')]['id'];}return db[_0x0a9e('0x27')][_0x0a9e('0x43')]({'where':{'id':_0x8d6dd1[_0x0a9e('0x41')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x562fb4,null))[_0x0a9e('0x1f')](saveUpdates(_0x8d6dd1['body'],null))[_0x0a9e('0x1f')](respondWithResult(_0x562fb4,null))[_0x0a9e('0x44')](handleError(_0x562fb4,null));};exports[_0x0a9e('0x20')]=function(_0x16f976,_0x409789){return db[_0x0a9e('0x27')][_0x0a9e('0x43')]({'where':{'id':_0x16f976[_0x0a9e('0x41')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x409789,null))['then'](removeEntity(_0x409789,null))[_0x0a9e('0x44')](handleError(_0x409789,null));};exports[_0x0a9e('0x47')]=function(_0x4f7240,_0x4ae14b){return db['VoiceDialReport'][_0x0a9e('0x47')]()[_0x0a9e('0x1f')](respondWithResult(_0x4ae14b,null))[_0x0a9e('0x44')](handleError(_0x4ae14b,null));}; \ No newline at end of file +var _0xa9e0=['create','body','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','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','map','VoiceDialReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','show','params','options','find','catch'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0xa9e0,0x123));var _0x0a9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];function respondWithStatusCode(_0x36471c,_0xd5b662){_0xd5b662=_0xd5b662||0xcc;return function(_0x26d672){if(_0x26d672){return _0x36471c[_0x0a9e('0x14')](_0xd5b662);}return _0x36471c[_0x0a9e('0x15')](_0xd5b662)['end']();};}function respondWithResult(_0x4283ce,_0x239b12){_0x239b12=_0x239b12||0xc8;return function(_0x2b4227){if(_0x2b4227){return _0x4283ce[_0x0a9e('0x15')](_0x239b12)[_0x0a9e('0x16')](_0x2b4227);}};}function respondWithFilteredResult(_0x4d5611,_0x52a03d){return function(_0x22dccb){if(_0x22dccb){var _0x5d0880=_0x22dccb[_0x0a9e('0x17')],_0x1985b6=_0x52a03d['offset'],_0x519dfd=_0x52a03d[_0x0a9e('0x18')]+_0x52a03d['limit'],_0x16033c;if(_0x519dfd>=_0x5d0880){_0x519dfd=_0x5d0880;_0x16033c=0xc8;}else{_0x16033c=0xce;}_0x4d5611[_0x0a9e('0x15')](_0x16033c);return _0x4d5611[_0x0a9e('0x19')](_0x0a9e('0x1a'),_0x1985b6+'-'+_0x519dfd+'/'+_0x5d0880)[_0x0a9e('0x16')](_0x22dccb);}return null;};}function patchUpdates(_0x31b1ca){return function(_0x2eb11f){try{jsonpatch[_0x0a9e('0x1b')](_0x2eb11f,_0x31b1ca,!![]);}catch(_0x20559e){return BPromise[_0x0a9e('0x1c')](_0x20559e);}return _0x2eb11f[_0x0a9e('0x1d')]();};}function saveUpdates(_0x1c696a,_0x105080){return function(_0x4bb1e3){if(_0x4bb1e3){return _0x4bb1e3[_0x0a9e('0x1e')](_0x1c696a)[_0x0a9e('0x1f')](function(_0x53682f){return _0x53682f;});}return null;};}function removeEntity(_0x20f109,_0x5a09ef){return function(_0x588269){if(_0x588269){return _0x588269[_0x0a9e('0x20')]()[_0x0a9e('0x1f')](function(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x21')]();});}};}function handleEntityNotFound(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(!_0x2fb0e4){_0x4abc77[_0x0a9e('0x14')](0x194);}return _0x2fb0e4;};}function handleError(_0x4d00e6,_0x370d86){_0x370d86=_0x370d86||0x1f4;return function(_0x42ac8f){logger[_0x0a9e('0x22')](_0x42ac8f['stack']);if(_0x42ac8f['name']){delete _0x42ac8f[_0x0a9e('0x23')];}_0x4d00e6[_0x0a9e('0x15')](_0x370d86)[_0x0a9e('0x24')](_0x42ac8f);};}exports[_0x0a9e('0x25')]=function(_0x526cf3,_0x384319){var _0x479bc4={},_0x45a1e7={},_0x5bfb33={'count':0x0,'rows':[]};var _0x1dc186=_[_0x0a9e('0x26')](db[_0x0a9e('0x27')][_0x0a9e('0x28')],function(_0x140511){return{'name':_0x140511[_0x0a9e('0x29')],'type':_0x140511[_0x0a9e('0x2a')][_0x0a9e('0x2b')]};});_0x45a1e7['model']=_[_0x0a9e('0x26')](_0x1dc186,_0x0a9e('0x23'));_0x45a1e7[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x526cf3['query']);_0x45a1e7[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],_0x45a1e7[_0x0a9e('0x2c')]);_0x479bc4[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],qs[_0x0a9e('0x32')](_0x526cf3[_0x0a9e('0x2c')]['fields']));_0x479bc4[_0x0a9e('0x31')]=_0x479bc4['attributes'][_0x0a9e('0x33')]?_0x479bc4[_0x0a9e('0x31')]:_0x45a1e7[_0x0a9e('0x30')];if(!_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x34')]('nolimit')){_0x479bc4[_0x0a9e('0x35')]=qs[_0x0a9e('0x35')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x35')]);_0x479bc4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x18')]);}_0x479bc4['order']=qs[_0x0a9e('0x36')](_0x526cf3['query'][_0x0a9e('0x36')]);_0x479bc4[_0x0a9e('0x37')]=qs[_0x0a9e('0x2e')](_[_0x0a9e('0x38')](_0x526cf3['query'],_0x45a1e7[_0x0a9e('0x2e')]));if(_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x39')]){_0x479bc4[_0x0a9e('0x37')]=_['merge'](_0x479bc4['where'],{'$or':_[_0x0a9e('0x26')](_0x1dc186,function(_0x5640eb){if(_0x5640eb[_0x0a9e('0x2a')][_0x0a9e('0x2b')]!==_0x0a9e('0x3a')){var _0x1ef87a={};_0x1ef87a[_0x5640eb['field']]={'$like':'%'+_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x39')]+'%'};return _0x1ef87a;}})});}_0x479bc4=_[_0x0a9e('0x3b')]({},_0x479bc4,_0x526cf3['options']);var _0x1dbf74={'where':_0x479bc4[_0x0a9e('0x37')]};return db[_0x0a9e('0x27')]['count'](_0x1dbf74)['then'](function(_0x11b61d){_0x5bfb33[_0x0a9e('0x17')]=_0x11b61d;if(_0x526cf3['query'][_0x0a9e('0x3c')]){_0x479bc4[_0x0a9e('0x3d')]=[{'all':!![]}];}return db[_0x0a9e('0x27')][_0x0a9e('0x3e')](_0x479bc4);})['then'](function(_0x5a594b){_0x5bfb33[_0x0a9e('0x3f')]=_0x5a594b;return _0x5bfb33;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x384319,_0x479bc4))['catch'](handleError(_0x384319,null));};exports[_0x0a9e('0x40')]=function(_0x1dec2e,_0x1459bb){var _0x5b4f5e={'raw':!![],'where':{'id':_0x1dec2e[_0x0a9e('0x41')]['id']}},_0x316c8f={};_0x316c8f[_0x0a9e('0x30')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x27')][_0x0a9e('0x28')]);_0x316c8f[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x1dec2e[_0x0a9e('0x2c')]);_0x316c8f[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x316c8f[_0x0a9e('0x30')],_0x316c8f[_0x0a9e('0x2c')]);_0x5b4f5e[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x316c8f['model'],qs['fields'](_0x1dec2e[_0x0a9e('0x2c')][_0x0a9e('0x32')]));_0x5b4f5e[_0x0a9e('0x31')]=_0x5b4f5e[_0x0a9e('0x31')][_0x0a9e('0x33')]?_0x5b4f5e[_0x0a9e('0x31')]:_0x316c8f[_0x0a9e('0x30')];if(_0x1dec2e[_0x0a9e('0x2c')][_0x0a9e('0x3c')]){_0x5b4f5e[_0x0a9e('0x3d')]=[{'all':!![]}];}_0x5b4f5e=_[_0x0a9e('0x3b')]({},_0x5b4f5e,_0x1dec2e[_0x0a9e('0x42')]);return db['VoiceDialReport'][_0x0a9e('0x43')](_0x5b4f5e)[_0x0a9e('0x1f')](handleEntityNotFound(_0x1459bb,null))[_0x0a9e('0x1f')](respondWithResult(_0x1459bb,null))[_0x0a9e('0x44')](handleError(_0x1459bb,null));};exports[_0x0a9e('0x45')]=function(_0xbe9d19,_0x21eb86){return db[_0x0a9e('0x27')]['create'](_0xbe9d19[_0x0a9e('0x46')],{})['then'](respondWithResult(_0x21eb86,0xc9))[_0x0a9e('0x44')](handleError(_0x21eb86,null));};exports[_0x0a9e('0x1e')]=function(_0x8d6dd1,_0x562fb4){if(_0x8d6dd1[_0x0a9e('0x46')]['id']){delete _0x8d6dd1[_0x0a9e('0x46')]['id'];}return db[_0x0a9e('0x27')][_0x0a9e('0x43')]({'where':{'id':_0x8d6dd1[_0x0a9e('0x41')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x562fb4,null))[_0x0a9e('0x1f')](saveUpdates(_0x8d6dd1['body'],null))[_0x0a9e('0x1f')](respondWithResult(_0x562fb4,null))[_0x0a9e('0x44')](handleError(_0x562fb4,null));};exports[_0x0a9e('0x20')]=function(_0x16f976,_0x409789){return db[_0x0a9e('0x27')][_0x0a9e('0x43')]({'where':{'id':_0x16f976[_0x0a9e('0x41')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x409789,null))['then'](removeEntity(_0x409789,null))[_0x0a9e('0x44')](handleError(_0x409789,null));};exports[_0x0a9e('0x47')]=function(_0x4f7240,_0x4ae14b){return db['VoiceDialReport'][_0x0a9e('0x47')]()[_0x0a9e('0x1f')](respondWithResult(_0x4ae14b,null))[_0x0a9e('0x44')](handleError(_0x4ae14b,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 50ab510..64e770d 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 _0x1353=['VoiceDialReport','report_dial','lodash','../../config/logger','api','moment','path','rimraf','../../config/environment','./voiceDialReport.attributes','define'];(function(_0x27da05,_0x4b77a8){var _0x35d9f9=function(_0xdb2bcf){while(--_0xdb2bcf){_0x27da05['push'](_0x27da05['shift']());}};_0x35d9f9(++_0x4b77a8);}(_0x1353,0xb2));var _0x3135=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x1353[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x3135('0x0'));var util=require('util');var logger=require(_0x3135('0x1'))(_0x3135('0x2'));var moment=require(_0x3135('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3135('0x4'));var rimraf=require(_0x3135('0x5'));var config=require(_0x3135('0x6'));var attributes=require(_0x3135('0x7'));module['exports']=function(_0x20cc4a,_0x1349d7){return _0x20cc4a[_0x3135('0x8')](_0x3135('0x9'),attributes,{'tableName':_0x3135('0xa'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x9ec8=['define','VoiceDialReport','report_dial','uniqueid','lodash','util','../../config/logger','api','moment','path','rimraf','./voiceDialReport.attributes','exports'];(function(_0x485d7b,_0x3f3b52){var _0x899877=function(_0x34639c){while(--_0x34639c){_0x485d7b['push'](_0x485d7b['shift']());}};_0x899877(++_0x3f3b52);}(_0x9ec8,0x1d8));var _0x89ec=function(_0x3ebf3d,_0x4785ec){_0x3ebf3d=_0x3ebf3d-0x0;var _0x4816f4=_0x9ec8[_0x3ebf3d];return _0x4816f4;};'use strict';var _=require(_0x89ec('0x0'));var util=require(_0x89ec('0x1'));var logger=require(_0x89ec('0x2'))(_0x89ec('0x3'));var moment=require(_0x89ec('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x89ec('0x5'));var rimraf=require(_0x89ec('0x6'));var config=require('../../config/environment');var attributes=require(_0x89ec('0x7'));module[_0x89ec('0x8')]=function(_0x2f9113,_0x1e91d5){return _0x2f9113[_0x89ec('0x9')](_0x89ec('0xa'),attributes,{'tableName':_0x89ec('0xb'),'paranoid':![],'indexes':[{'fields':[_0x89ec('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index fccc0e6..40eafd9 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 _0x303a=['then','info','request\x20sent','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceDialReport,\x20%s,\x20%s','message','result','catch','CreateVoiceDialReport','create','body','options','raw','debug','UpdateVoiceDialReport','VoiceDialReport','where','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x180de5,_0x574ece){var _0x20fbd0=function(_0x44407a){while(--_0x44407a){_0x180de5['push'](_0x180de5['shift']());}};_0x20fbd0(++_0x574ece);}(_0x303a,0x1a0));var _0xa303=function(_0x7ff50b,_0x399dc0){_0x7ff50b=_0x7ff50b-0x0;var _0x43e570=_0x303a[_0x7ff50b];return _0x43e570;};'use strict';var _=require(_0xa303('0x0'));var util=require('util');var moment=require(_0xa303('0x1'));var BPromise=require(_0xa303('0x2'));var rs=require(_0xa303('0x3'));var fs=require('fs');var Redis=require(_0xa303('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa303('0x5'));var logger=require(_0xa303('0x6'))(_0xa303('0x7'));var config=require(_0xa303('0x8'));var jayson=require(_0xa303('0x9'));var client=jayson[_0xa303('0xa')][_0xa303('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3f61f1,_0x69b173,_0x5d95fd){return new BPromise(function(_0x51e1ee,_0x488c85){return client[_0xa303('0xc')](_0x3f61f1,_0x5d95fd)[_0xa303('0xd')](function(_0x5e2e48){logger[_0xa303('0xe')]('VoiceDialReport,\x20%s,\x20%s',_0x69b173,_0xa303('0xf'));logger['debug'](_0xa303('0x10'),_0x69b173,_0xa303('0xf'),JSON[_0xa303('0x11')](_0x5e2e48));if(_0x5e2e48[_0xa303('0x12')]){if(_0x5e2e48['error'][_0xa303('0x13')]===0x1f4){logger['error'](_0xa303('0x14'),_0x69b173,_0x5e2e48[_0xa303('0x12')][_0xa303('0x15')]);return _0x488c85(_0x5e2e48['error'][_0xa303('0x15')]);}logger[_0xa303('0x12')](_0xa303('0x14'),_0x69b173,_0x5e2e48[_0xa303('0x12')][_0xa303('0x15')]);return _0x51e1ee(_0x5e2e48[_0xa303('0x12')][_0xa303('0x15')]);}else{logger[_0xa303('0xe')]('VoiceDialReport,\x20%s,\x20%s',_0x69b173,_0xa303('0xf'));_0x51e1ee(_0x5e2e48[_0xa303('0x16')][_0xa303('0x15')]);}})[_0xa303('0x17')](function(_0x3e2813){logger[_0xa303('0x12')]('VoiceDialReport,\x20%s,\x20%s',_0x69b173,_0x3e2813);_0x488c85(_0x3e2813);});});}exports[_0xa303('0x18')]=function(_0x54ca49){var _0x1d2003=this;return new Promise(function(_0x4cf535,_0x4462be){return db['VoiceDialReport'][_0xa303('0x19')](_0x54ca49[_0xa303('0x1a')],{'raw':_0x54ca49[_0xa303('0x1b')]?_0x54ca49['options'][_0xa303('0x1c')]===undefined?!![]:![]:!![]})[_0xa303('0xd')](function(_0x1b0566){logger['info'](_0xa303('0x18'),_0x54ca49);logger[_0xa303('0x1d')](_0xa303('0x18'),_0x54ca49,JSON[_0xa303('0x11')](_0x1b0566));_0x4cf535(_0x1b0566);})['catch'](function(_0x14f9ab){logger[_0xa303('0x12')]('CreateVoiceDialReport',_0x14f9ab[_0xa303('0x15')],_0x54ca49);_0x4462be(_0x1d2003[_0xa303('0x12')](0x1f4,_0x14f9ab[_0xa303('0x15')]));});});};exports[_0xa303('0x1e')]=function(_0x65ab0e){var _0x577ea7=this;return new Promise(function(_0x3d3d8a,_0x5d9dee){return db[_0xa303('0x1f')]['update'](_0x65ab0e['body'],{'raw':_0x65ab0e['options']?_0x65ab0e['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x65ab0e[_0xa303('0x1b')]?_0x65ab0e[_0xa303('0x1b')][_0xa303('0x20')]||null:null,'attributes':_0x65ab0e[_0xa303('0x1b')]?_0x65ab0e[_0xa303('0x1b')]['attributes']||null:null,'limit':_0x65ab0e[_0xa303('0x1b')]?_0x65ab0e[_0xa303('0x1b')]['limit']||null:null})[_0xa303('0xd')](function(_0xef04b){logger[_0xa303('0xe')](_0xa303('0x1e'),_0x65ab0e);logger[_0xa303('0x1d')](_0xa303('0x1e'),_0x65ab0e,JSON[_0xa303('0x11')](_0xef04b));_0x3d3d8a(_0xef04b);})[_0xa303('0x17')](function(_0x411b42){logger[_0xa303('0x12')](_0xa303('0x1e'),_0x411b42[_0xa303('0x15')],_0x65ab0e);_0x5d9dee(_0x577ea7[_0xa303('0x12')](0x1f4,_0x411b42[_0xa303('0x15')]));});});}; \ No newline at end of file +var _0x6ae0=['VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateVoiceDialReport','VoiceDialReport','raw','debug','catch','UpdateVoiceDialReport','update','body','options','where','attributes','limit','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent'];(function(_0x2f2360,_0x151089){var _0x1cc8d3=function(_0x5e356f){while(--_0x5e356f){_0x2f2360['push'](_0x2f2360['shift']());}};_0x1cc8d3(++_0x151089);}(_0x6ae0,0x192));var _0x06ae=function(_0x1ffb10,_0x28ce2c){_0x1ffb10=_0x1ffb10-0x0;var _0x390ad0=_0x6ae0[_0x1ffb10];return _0x390ad0;};'use strict';var _=require(_0x06ae('0x0'));var util=require(_0x06ae('0x1'));var moment=require(_0x06ae('0x2'));var BPromise=require(_0x06ae('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x06ae('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x06ae('0x5'))('rpc');var config=require(_0x06ae('0x6'));var jayson=require(_0x06ae('0x7'));var client=jayson['client'][_0x06ae('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x51bac4,_0x26167c,_0x2bc2ad){return new BPromise(function(_0x591c0f,_0x269be5){return client[_0x06ae('0x9')](_0x51bac4,_0x2bc2ad)[_0x06ae('0xa')](function(_0x39f10e){logger[_0x06ae('0xb')](_0x06ae('0xc'),_0x26167c,_0x06ae('0xd'));logger['debug'](_0x06ae('0xe'),_0x26167c,_0x06ae('0xd'),JSON[_0x06ae('0xf')](_0x39f10e));if(_0x39f10e[_0x06ae('0x10')]){if(_0x39f10e[_0x06ae('0x10')][_0x06ae('0x11')]===0x1f4){logger[_0x06ae('0x10')]('VoiceDialReport,\x20%s,\x20%s',_0x26167c,_0x39f10e['error']['message']);return _0x269be5(_0x39f10e[_0x06ae('0x10')]['message']);}logger[_0x06ae('0x10')](_0x06ae('0xc'),_0x26167c,_0x39f10e[_0x06ae('0x10')][_0x06ae('0x12')]);return _0x591c0f(_0x39f10e['error']['message']);}else{logger[_0x06ae('0xb')]('VoiceDialReport,\x20%s,\x20%s',_0x26167c,_0x06ae('0xd'));_0x591c0f(_0x39f10e[_0x06ae('0x13')][_0x06ae('0x12')]);}})['catch'](function(_0x4ec020){logger['error'](_0x06ae('0xc'),_0x26167c,_0x4ec020);_0x269be5(_0x4ec020);});});}exports[_0x06ae('0x14')]=function(_0x35eab4){var _0x11adef=this;return new Promise(function(_0x1a8e35,_0x421962){return db[_0x06ae('0x15')]['create'](_0x35eab4['body'],{'raw':_0x35eab4['options']?_0x35eab4['options'][_0x06ae('0x16')]===undefined?!![]:![]:!![]})[_0x06ae('0xa')](function(_0x5c65b6){logger[_0x06ae('0xb')](_0x06ae('0x14'),_0x35eab4);logger[_0x06ae('0x17')](_0x06ae('0x14'),_0x35eab4,JSON['stringify'](_0x5c65b6));_0x1a8e35(_0x5c65b6);})[_0x06ae('0x18')](function(_0x54b8c7){logger[_0x06ae('0x10')](_0x06ae('0x14'),_0x54b8c7['message'],_0x35eab4);_0x421962(_0x11adef[_0x06ae('0x10')](0x1f4,_0x54b8c7[_0x06ae('0x12')]));});});};exports[_0x06ae('0x19')]=function(_0x512753){var _0x3acdaf=this;return new Promise(function(_0x393bc0,_0x573c75){return db[_0x06ae('0x15')][_0x06ae('0x1a')](_0x512753[_0x06ae('0x1b')],{'raw':_0x512753[_0x06ae('0x1c')]?_0x512753[_0x06ae('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x512753[_0x06ae('0x1c')]?_0x512753[_0x06ae('0x1c')][_0x06ae('0x1d')]||null:null,'attributes':_0x512753[_0x06ae('0x1c')]?_0x512753['options'][_0x06ae('0x1e')]||null:null,'limit':_0x512753[_0x06ae('0x1c')]?_0x512753[_0x06ae('0x1c')][_0x06ae('0x1f')]||null:null})['then'](function(_0xfd320a){logger['info'](_0x06ae('0x19'),_0x512753);logger[_0x06ae('0x17')](_0x06ae('0x19'),_0x512753,JSON[_0x06ae('0xf')](_0xfd320a));_0x393bc0(_0xfd320a);})[_0x06ae('0x18')](function(_0x4a6336){logger[_0x06ae('0x10')](_0x06ae('0x19'),_0x4a6336['message'],_0x512753);_0x573c75(_0x3acdaf[_0x06ae('0x10')](0x1f4,_0x4a6336['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index fbb478d..938c366 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 _0xff5c=['express','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id','show','create','/:id/applications','put','delete','destroy','exports','util','path','connect-timeout'];(function(_0x38168e,_0x1b7cb0){var _0x47cc70=function(_0x1a590c){while(--_0x1a590c){_0x38168e['push'](_0x38168e['shift']());}};_0x47cc70(++_0x1b7cb0);}(_0xff5c,0x1d9));var _0xcff5=function(_0x4eab7e,_0x4d5156){_0x4eab7e=_0x4eab7e-0x0;var _0x28dba0=_0xff5c[_0x4eab7e];return _0x28dba0;};'use strict';var multer=require('multer');var util=require(_0xcff5('0x0'));var path=require(_0xcff5('0x1'));var timeout=require(_0xcff5('0x2'));var express=require(_0xcff5('0x3'));var router=express['Router']();var auth=require(_0xcff5('0x4'));var interaction=require(_0xcff5('0x5'));var config=require('../../config/environment');var controller=require('./voiceExtension.controller');router['get']('/',auth[_0xcff5('0x6')](),controller[_0xcff5('0x7')]);router[_0xcff5('0x8')](_0xcff5('0x9'),auth[_0xcff5('0x6')](),controller[_0xcff5('0xa')]);router['post']('/',auth[_0xcff5('0x6')](),controller[_0xcff5('0xb')]);router['post'](_0xcff5('0xc'),auth[_0xcff5('0x6')](),controller['addApplications']);router[_0xcff5('0xd')]('/:id',auth[_0xcff5('0x6')](),controller['update']);router[_0xcff5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xcff5('0xf')]);module[_0xcff5('0x10')]=router; \ No newline at end of file +var _0x48dd=['isAuthenticated','index','/:id','post','create','/:id/applications','put','update','delete','destroy','exports','multer','util','path','connect-timeout','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get'];(function(_0xe5366,_0x32ea05){var _0x3dfd7d=function(_0x3aeb41){while(--_0x3aeb41){_0xe5366['push'](_0xe5366['shift']());}};_0x3dfd7d(++_0x32ea05);}(_0x48dd,0xc9));var _0xd48d=function(_0x4de0bc,_0x290c23){_0x4de0bc=_0x4de0bc-0x0;var _0x36cf8e=_0x48dd[_0x4de0bc];return _0x36cf8e;};'use strict';var multer=require(_0xd48d('0x0'));var util=require(_0xd48d('0x1'));var path=require(_0xd48d('0x2'));var timeout=require(_0xd48d('0x3'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xd48d('0x4'));var config=require(_0xd48d('0x5'));var controller=require(_0xd48d('0x6'));router[_0xd48d('0x7')]('/',auth[_0xd48d('0x8')](),controller[_0xd48d('0x9')]);router[_0xd48d('0x7')](_0xd48d('0xa'),auth[_0xd48d('0x8')](),controller['show']);router[_0xd48d('0xb')]('/',auth[_0xd48d('0x8')](),controller[_0xd48d('0xc')]);router[_0xd48d('0xb')](_0xd48d('0xd'),auth['isAuthenticated'](),controller['addApplications']);router[_0xd48d('0xe')](_0xd48d('0xa'),auth['isAuthenticated'](),controller[_0xd48d('0xf')]);router[_0xd48d('0x10')](_0xd48d('0xa'),auth[_0xd48d('0x8')](),controller[_0xd48d('0x11')]);module[_0xd48d('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 41300b6..9e81e22 100644 --- a/server/api/voiceExtension/voiceExtension.attributes.js +++ b/server/api/voiceExtension/voiceExtension.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['*,*,*,*','INTEGER','BOOLEAN','VIRTUAL','getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','inbound','outbound','internal','system'];(function(_0x4cd5f1,_0x170a5a){var _0x3937c3=function(_0x2117e5){while(--_0x2117e5){_0x4cd5f1['push'](_0x4cd5f1['shift']());}};_0x3937c3(++_0x170a5a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'context':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0a9e('0x3')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0x0a9e('0x3')},'tag':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':_0x0a9e('0x4')},'appdata':{'type':Sequelize[_0x0a9e('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),'inbound-fax','outbound-fax',_0x0a9e('0x8'),'any'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':_0x0a9e('0x9')},'IntervalId':{'type':Sequelize[_0x0a9e('0xa')]},'isApp':{'type':Sequelize[_0x0a9e('0xb')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':'wav'},'answer':{'type':Sequelize[_0x0a9e('0xb')],'defaultValue':!![]},'name':{'type':Sequelize[_0x0a9e('0xc')],'get':function(_0xd5b662){return this[_0x0a9e('0xd')](_0x0a9e('0xe'));}}}; \ No newline at end of file +var _0xa9e0=['*,*,*,*','INTEGER','BOOLEAN','VIRTUAL','getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','inbound','outbound','internal','system'];(function(_0x4d0cac,_0x5c93be){var _0x19dcf1=function(_0x37b3cd){while(--_0x37b3cd){_0x4d0cac['push'](_0x4d0cac['shift']());}};_0x19dcf1(++_0x5c93be);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'context':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0a9e('0x3')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0x0a9e('0x3')},'tag':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':_0x0a9e('0x4')},'appdata':{'type':Sequelize[_0x0a9e('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),'inbound-fax','outbound-fax',_0x0a9e('0x8'),'any'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':_0x0a9e('0x9')},'IntervalId':{'type':Sequelize[_0x0a9e('0xa')]},'isApp':{'type':Sequelize[_0x0a9e('0xb')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':'wav'},'answer':{'type':Sequelize[_0x0a9e('0xb')],'defaultValue':!![]},'name':{'type':Sequelize[_0x0a9e('0xc')],'get':function(_0xd5b662){return this[_0x0a9e('0xd')](_0x0a9e('0xe'));}}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index b5484dc..b4b030a 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 _0x12e4=['html-pdf','eml-format','zip-dir','request-promise','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','update','then','get','inbound','OutboundRoutes','outbound','internal','filter','ignore','map','value','includes','type','find','name','UserProfileResource','destroy','error','index','rawAttributes','fieldName','key','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','field','options','VoiceExtension','includeAll','include','findAll','catch','show','params','keys','intersection','create','body','startsWith','exten','concat','role','user','InboundRoutes','InternalRoutes','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','description','recordingFormat','cutdigits','mandatoryDisposition','addApplications','findOne','sequelize','transaction','VoiceExtensionId','findAndCountAll'];(function(_0xa2d007,_0x46d855){var _0x12ecbe=function(_0x564bbe){while(--_0x564bbe){_0xa2d007['push'](_0xa2d007['shift']());}};_0x12ecbe(++_0x46d855);}(_0x12e4,0x1b0));var _0x412e=function(_0xe0704b,_0xf58dd5){_0xe0704b=_0xe0704b-0x0;var _0x3cbf65=_0x12e4[_0xe0704b];return _0x3cbf65;};'use strict';var pdf=require(_0x412e('0x0'));var emlformat=require(_0x412e('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x412e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x412e('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x412e('0x4'));var path=require(_0x412e('0x5'));var sox=require(_0x412e('0x6'));var csv=require(_0x412e('0x7'));var ejs=require(_0x412e('0x8'));var fs=require('fs');var _=require(_0x412e('0x9'));var squel=require(_0x412e('0xa'));var crypto=require(_0x412e('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x412e('0xc'));var toCsv=require(_0x412e('0x7'));var querystring=require(_0x412e('0xd'));var Papa=require('papaparse');var Redis=require(_0x412e('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x412e('0xf'));var as=require(_0x412e('0x10'));var hardwareService=require(_0x412e('0x11'));var logger=require(_0x412e('0x12'))(_0x412e('0x13'));var utils=require(_0x412e('0x14'));var config=require('../../config/environment');var db=require(_0x412e('0x15'))['db'];config[_0x412e('0x16')]=_[_0x412e('0x17')](config[_0x412e('0x16')],{'host':_0x412e('0x18'),'port':0x18eb});var socket=require(_0x412e('0x19'))(new Redis(config[_0x412e('0x16')]));require('./voiceExtension.socket')[_0x412e('0x1a')](socket);function respondWithStatusCode(_0x43a093,_0x3a3e84){_0x3a3e84=_0x3a3e84||0xcc;return function(_0x37bc52){if(_0x37bc52){return _0x43a093[_0x412e('0x1b')](_0x3a3e84);}return _0x43a093[_0x412e('0x1c')](_0x3a3e84)[_0x412e('0x1d')]();};}function respondWithResult(_0x321392,_0xa58b1){_0xa58b1=_0xa58b1||0xc8;return function(_0x530e3e){if(_0x530e3e){return _0x321392[_0x412e('0x1c')](_0xa58b1)[_0x412e('0x1e')](_0x530e3e);}};}function respondWithFilteredResult(_0x42e81a,_0x2d4d65){return function(_0x3916b5){if(_0x3916b5){var _0x293c1e=_0x3916b5[_0x412e('0x1f')],_0x424e9f=_0x2d4d65[_0x412e('0x20')],_0x4df2ce=_0x2d4d65['offset']+_0x2d4d65[_0x412e('0x21')],_0x56c2ca;if(_0x4df2ce>=_0x293c1e){_0x4df2ce=_0x293c1e;_0x56c2ca=0xc8;}else{_0x56c2ca=0xce;}_0x42e81a[_0x412e('0x1c')](_0x56c2ca);return _0x42e81a[_0x412e('0x22')](_0x412e('0x23'),_0x424e9f+'-'+_0x4df2ce+'/'+_0x293c1e)['json'](_0x3916b5);}return null;};}function patchUpdates(_0x52c860){return function(_0x5f2921){try{jsonpatch[_0x412e('0x24')](_0x5f2921,_0x52c860,!![]);}catch(_0x3806b0){return BPromise['reject'](_0x3806b0);}return _0x5f2921['save']();};}function saveUpdates(_0x59aa1d,_0x509d2c){return function(_0x42a9d0){if(_0x42a9d0){return _0x42a9d0[_0x412e('0x25')](_0x59aa1d)[_0x412e('0x26')](function(_0x2d3b52){return _0x2d3b52;});}return null;};}function removeEntity(_0x2c336d,_0x2a46d7){return function(_0x4a38fd){if(_0x4a38fd){return _0x4a38fd['destroy']()[_0x412e('0x26')](function(){var _0x2528e0=_0x4a38fd[_0x412e('0x27')]({'plain':!![]});var _0x56ef67=[{'name':'InboundRoutes','value':_0x412e('0x28'),'ignore':![]},{'name':_0x412e('0x29'),'value':_0x412e('0x2a'),'ignore':![]},{'name':'InternalRoutes','value':_0x412e('0x2b'),'ignore':![]}];var _0x1c24f4=_(_0x56ef67)[_0x412e('0x2c')](_0x412e('0x2d'))[_0x412e('0x2e')](_0x412e('0x2f'))['value']();if(_[_0x412e('0x30')](_0x1c24f4,_0x2528e0[_0x412e('0x31')])){return;}var _0x61ad57=_[_0x412e('0x32')](_0x56ef67,[_0x412e('0x2f'),_0x2528e0[_0x412e('0x31')]])[_0x412e('0x33')];return db[_0x412e('0x34')][_0x412e('0x35')]({'where':{'type':_0x61ad57,'resourceId':_0x2528e0['id']}})[_0x412e('0x26')](function(){return _0x4a38fd;});})['then'](function(){_0x2c336d[_0x412e('0x1c')](0xcc)[_0x412e('0x1d')]();});}};}function handleEntityNotFound(_0x5db6a7,_0x479178){return function(_0x35c76e){if(!_0x35c76e){_0x5db6a7[_0x412e('0x1b')](0x194);}return _0x35c76e;};}function handleError(_0x1e2d0b,_0x45f288){_0x45f288=_0x45f288||0x1f4;return function(_0x3398df){logger[_0x412e('0x36')](_0x3398df['stack']);if(_0x3398df[_0x412e('0x33')]){delete _0x3398df[_0x412e('0x33')];}_0x1e2d0b[_0x412e('0x1c')](_0x45f288)['send'](_0x3398df);};}exports[_0x412e('0x37')]=function(_0x38f1e5,_0x23a16a){var _0xb5faa8={},_0x1f602e={},_0x4781ec={'count':0x0,'rows':[]};var _0x4ee581=_[_0x412e('0x2e')](db['VoiceExtension'][_0x412e('0x38')],function(_0x37dd1c){return{'name':_0x37dd1c[_0x412e('0x39')],'type':_0x37dd1c[_0x412e('0x31')][_0x412e('0x3a')]};});_0x1f602e[_0x412e('0x3b')]=_[_0x412e('0x2e')](_0x4ee581,_0x412e('0x33'));_0x1f602e[_0x412e('0x3c')]=_['keys'](_0x38f1e5['query']);_0x1f602e[_0x412e('0x3d')]=_['intersection'](_0x1f602e[_0x412e('0x3b')],_0x1f602e['query']);_0xb5faa8[_0x412e('0x3e')]=_['intersection'](_0x1f602e[_0x412e('0x3b')],qs[_0x412e('0x3f')](_0x38f1e5[_0x412e('0x3c')][_0x412e('0x3f')]));_0xb5faa8['attributes']=_0xb5faa8['attributes'][_0x412e('0x40')]?_0xb5faa8['attributes']:_0x1f602e[_0x412e('0x3b')];if(!_0x38f1e5[_0x412e('0x3c')][_0x412e('0x41')](_0x412e('0x42'))){_0xb5faa8[_0x412e('0x21')]=qs[_0x412e('0x21')](_0x38f1e5['query'][_0x412e('0x21')]);_0xb5faa8[_0x412e('0x20')]=qs[_0x412e('0x20')](_0x38f1e5['query'][_0x412e('0x20')]);}_0xb5faa8[_0x412e('0x43')]=qs[_0x412e('0x44')](_0x38f1e5[_0x412e('0x3c')][_0x412e('0x44')]);_0xb5faa8[_0x412e('0x45')]=qs[_0x412e('0x3d')](_[_0x412e('0x46')](_0x38f1e5['query'],_0x1f602e[_0x412e('0x3d')]));if(_0x38f1e5['query'][_0x412e('0x2c')]){_0xb5faa8[_0x412e('0x45')]=_[_0x412e('0x47')](_0xb5faa8[_0x412e('0x45')],{'$or':_[_0x412e('0x2e')](_0x4ee581,function(_0xe79b16){if(_0xe79b16[_0x412e('0x31')][_0x412e('0x3a')]!==_0x412e('0x48')){var _0x275a4b={};_0x275a4b[_0xe79b16[_0x412e('0x49')]]={'$like':'%'+_0x38f1e5[_0x412e('0x3c')][_0x412e('0x2c')]+'%'};return _0x275a4b;}})});}_0xb5faa8=_[_0x412e('0x47')]({},_0xb5faa8,_0x38f1e5[_0x412e('0x4a')]);var _0x3da627={'where':_0xb5faa8['where']};return db[_0x412e('0x4b')][_0x412e('0x1f')](_0x3da627)['then'](function(_0x1d3bbf){_0x4781ec['count']=_0x1d3bbf;if(_0x38f1e5['query'][_0x412e('0x4c')]){_0xb5faa8[_0x412e('0x4d')]=[{'all':!![]}];}return db[_0x412e('0x4b')][_0x412e('0x4e')](_0xb5faa8);})[_0x412e('0x26')](function(_0x145ea7){_0x4781ec['rows']=_0x145ea7;return _0x4781ec;})[_0x412e('0x26')](respondWithFilteredResult(_0x23a16a,_0xb5faa8))[_0x412e('0x4f')](handleError(_0x23a16a,null));};exports[_0x412e('0x50')]=function(_0x19c81d,_0x251ef9){var _0x2db507={'raw':![],'where':{'id':_0x19c81d[_0x412e('0x51')]['id']}},_0x4ce1cd={};_0x4ce1cd[_0x412e('0x3b')]=_[_0x412e('0x52')](db[_0x412e('0x4b')][_0x412e('0x38')]);_0x4ce1cd[_0x412e('0x3c')]=_[_0x412e('0x52')](_0x19c81d['query']);_0x4ce1cd[_0x412e('0x3d')]=_[_0x412e('0x53')](_0x4ce1cd[_0x412e('0x3b')],_0x4ce1cd[_0x412e('0x3c')]);_0x2db507['attributes']=_[_0x412e('0x53')](_0x4ce1cd[_0x412e('0x3b')],qs['fields'](_0x19c81d[_0x412e('0x3c')][_0x412e('0x3f')]));_0x2db507[_0x412e('0x3e')]=_0x2db507[_0x412e('0x3e')][_0x412e('0x40')]?_0x2db507[_0x412e('0x3e')]:_0x4ce1cd[_0x412e('0x3b')];if(_0x19c81d[_0x412e('0x3c')][_0x412e('0x4c')]){_0x2db507[_0x412e('0x4d')]=[{'all':!![]}];}_0x2db507=_['merge']({},_0x2db507,_0x19c81d[_0x412e('0x4a')]);return db['VoiceExtension'][_0x412e('0x32')](_0x2db507)[_0x412e('0x26')](handleEntityNotFound(_0x251ef9,null))[_0x412e('0x26')](respondWithResult(_0x251ef9,null))[_0x412e('0x4f')](handleError(_0x251ef9,null));};exports['destroy']=function(_0x4d0cd7,_0x37d30f){return db[_0x412e('0x4b')]['find']({'where':{'id':_0x4d0cd7['params']['id']}})[_0x412e('0x26')](handleEntityNotFound(_0x37d30f,null))[_0x412e('0x26')](removeEntity(_0x37d30f,null))[_0x412e('0x4f')](handleError(_0x37d30f,null));};exports[_0x412e('0x54')]=function(_0x10e1c6,_0x382625){if(_0x10e1c6[_0x412e('0x55')][_0x412e('0x31')]===_0x412e('0x2a')&&!_[_0x412e('0x56')](_0x10e1c6[_0x412e('0x55')][_0x412e('0x57')],'_')){_0x10e1c6[_0x412e('0x55')]['exten']='_'[_0x412e('0x58')](_0x10e1c6[_0x412e('0x55')][_0x412e('0x57')]);}return db[_0x412e('0x4b')][_0x412e('0x54')](_0x10e1c6[_0x412e('0x55')],{'raw':![]})[_0x412e('0x26')](function(_0x38d83d){var _0x494e67=_0x10e1c6['user'][_0x412e('0x27')]({'plain':!![]});if(!_0x494e67)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x494e67[_0x412e('0x59')]===_0x412e('0x5a')){var _0x2ad053=_0x38d83d['get']({'plain':!![]});var _0x2e5f0c=[{'name':_0x412e('0x5b'),'value':_0x412e('0x28')},{'name':_0x412e('0x29'),'value':_0x412e('0x2a')},{'name':_0x412e('0x5c'),'value':'internal'}];var _0x1d8971=_[_0x412e('0x32')](_0x2e5f0c,[_0x412e('0x2f'),_0x2ad053[_0x412e('0x31')]])[_0x412e('0x33')];return db[_0x412e('0x5d')]['find']({'where':{'name':_0x1d8971,'userProfileId':_0x494e67[_0x412e('0x5e')]},'raw':!![]})[_0x412e('0x26')](function(_0x2200f4){if(_0x2200f4&&_0x2200f4[_0x412e('0x5f')]===0x0){return db[_0x412e('0x34')][_0x412e('0x54')]({'name':_0x2ad053['name'],'resourceId':_0x2ad053['id'],'type':_0x2200f4[_0x412e('0x33')],'sectionId':_0x2200f4['id']},{})['then'](function(){return _0x38d83d;});}else{return _0x38d83d;}})[_0x412e('0x4f')](function(_0x4395f0){logger['error'](_0x412e('0x60'),_0x4395f0);throw _0x4395f0;});}return _0x38d83d;})[_0x412e('0x26')](respondWithResult(_0x382625,0xc9))[_0x412e('0x4f')](handleError(_0x382625,null));};exports[_0x412e('0x25')]=function(_0x3c55c5,_0x5046cd){if(_0x3c55c5[_0x412e('0x55')]['id']){delete _0x3c55c5['body']['id'];}return db[_0x412e('0x4b')][_0x412e('0x32')]({'where':{'id':_0x3c55c5[_0x412e('0x51')]['id']}})['then'](handleEntityNotFound(_0x5046cd,null))[_0x412e('0x26')](function(_0x4653d5){if(_0x4653d5){return db[_0x412e('0x4b')]['update'](_[_0x412e('0x46')](_0x3c55c5[_0x412e('0x55')],[_0x412e('0x57'),_0x412e('0x61'),_0x412e('0x62'),_0x412e('0x63'),_0x412e('0x64'),_0x412e('0x65')]),{'where':{'context':_0x4653d5[_0x412e('0x61')],'exten':_0x4653d5[_0x412e('0x57')]},'individualHooks':!![]})[_0x412e('0x26')](function(_0x3207d2){return _0x3207d2;});}return null;})[_0x412e('0x26')](respondWithStatusCode(_0x5046cd,null))[_0x412e('0x4f')](handleError(_0x5046cd,null));};exports[_0x412e('0x66')]=function(_0x143b43,_0x442191,_0x23d8bb){return db[_0x412e('0x4b')][_0x412e('0x67')]({'where':{'id':_0x143b43[_0x412e('0x51')]['id']}})[_0x412e('0x26')](handleEntityNotFound(_0x442191,null))['then'](function(_0x4f2168){if(_0x4f2168){return db[_0x412e('0x68')][_0x412e('0x69')](function(_0x594b74){return db[_0x412e('0x4b')]['destroy']({'where':{'VoiceExtensionId':_0x143b43[_0x412e('0x51')]['id']},'transaction':_0x594b74})[_0x412e('0x26')](function(_0x9c577){var _0x4f2d4d=_['map'](_0x143b43[_0x412e('0x55')],function(_0x34ccd0){_0x34ccd0[_0x412e('0x6a')]=_0x143b43['params']['id'];return _0x34ccd0;});return db[_0x412e('0x4b')]['bulkCreate'](_0x4f2d4d,{'transaction':_0x594b74});});})['then'](function(){return db['VoiceExtension'][_0x412e('0x6b')]({'where':{'isApp':!![],'VoiceExtensionId':_0x143b43['params']['id']},'order':'cast(priority\x20as\x20unsigned)'});});}})['then'](respondWithResult(_0x442191,null))[_0x412e('0x4f')](handleError(_0x442191,null));}; \ No newline at end of file +var _0xef2d=['options','VoiceExtension','rows','catch','show','params','includeAll','include','create','exten','body','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','description','recordingFormat','mandatoryDisposition','addApplications','sequelize','transaction','bulkCreate','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','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','register','sendStatus','status','end','json','count','limit','set','Content-Range','save','update','then','destroy','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','internal','ignore','map','type','find','value','name','UserProfileResource','error','stack','send','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','offset','order','sort','where','pick','filter','merge','VIRTUAL','field'];(function(_0x27ebe8,_0x21dd01){var _0x431778=function(_0xcf97c6){while(--_0xcf97c6){_0x27ebe8['push'](_0x27ebe8['shift']());}};_0x431778(++_0x21dd01);}(_0xef2d,0xf0));var _0xdef2=function(_0x1f4e34,_0x3d7bdd){_0x1f4e34=_0x1f4e34-0x0;var _0x32ee47=_0xef2d[_0x1f4e34];return _0x32ee47;};'use strict';var pdf=require(_0xdef2('0x0'));var emlformat=require(_0xdef2('0x1'));var rimraf=require(_0xdef2('0x2'));var zipdir=require(_0xdef2('0x3'));var jsonpatch=require(_0xdef2('0x4'));var rp=require(_0xdef2('0x5'));var moment=require(_0xdef2('0x6'));var BPromise=require(_0xdef2('0x7'));var Mustache=require(_0xdef2('0x8'));var util=require(_0xdef2('0x9'));var path=require(_0xdef2('0xa'));var sox=require(_0xdef2('0xb'));var csv=require(_0xdef2('0xc'));var ejs=require(_0xdef2('0xd'));var fs=require('fs');var _=require(_0xdef2('0xe'));var squel=require(_0xdef2('0xf'));var crypto=require(_0xdef2('0x10'));var jsforce=require(_0xdef2('0x11'));var deskjs=require(_0xdef2('0x12'));var toCsv=require(_0xdef2('0xc'));var querystring=require(_0xdef2('0x13'));var Papa=require(_0xdef2('0x14'));var Redis=require('ioredis');var authService=require(_0xdef2('0x15'));var qs=require(_0xdef2('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdef2('0x17'));var logger=require('../../config/logger')(_0xdef2('0x18'));var utils=require(_0xdef2('0x19'));var config=require(_0xdef2('0x1a'));var db=require(_0xdef2('0x1b'))['db'];config[_0xdef2('0x1c')]=_['defaults'](config[_0xdef2('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0xdef2('0x1d'))(new Redis(config[_0xdef2('0x1c')]));require('./voiceExtension.socket')[_0xdef2('0x1e')](socket);function respondWithStatusCode(_0x33c159,_0x5d0676){_0x5d0676=_0x5d0676||0xcc;return function(_0x51f56f){if(_0x51f56f){return _0x33c159[_0xdef2('0x1f')](_0x5d0676);}return _0x33c159[_0xdef2('0x20')](_0x5d0676)[_0xdef2('0x21')]();};}function respondWithResult(_0x257704,_0x29625c){_0x29625c=_0x29625c||0xc8;return function(_0x8bb0){if(_0x8bb0){return _0x257704[_0xdef2('0x20')](_0x29625c)[_0xdef2('0x22')](_0x8bb0);}};}function respondWithFilteredResult(_0x55f82d,_0x445f41){return function(_0x10ede0){if(_0x10ede0){var _0x5b987a=_0x10ede0[_0xdef2('0x23')],_0x36643c=_0x445f41['offset'],_0x3fd437=_0x445f41['offset']+_0x445f41[_0xdef2('0x24')],_0x2c097f;if(_0x3fd437>=_0x5b987a){_0x3fd437=_0x5b987a;_0x2c097f=0xc8;}else{_0x2c097f=0xce;}_0x55f82d[_0xdef2('0x20')](_0x2c097f);return _0x55f82d[_0xdef2('0x25')](_0xdef2('0x26'),_0x36643c+'-'+_0x3fd437+'/'+_0x5b987a)[_0xdef2('0x22')](_0x10ede0);}return null;};}function patchUpdates(_0x2027b9){return function(_0x3d939d){try{jsonpatch['apply'](_0x3d939d,_0x2027b9,!![]);}catch(_0x2718c3){return BPromise['reject'](_0x2718c3);}return _0x3d939d[_0xdef2('0x27')]();};}function saveUpdates(_0x11c150,_0x34c649){return function(_0xbd1993){if(_0xbd1993){return _0xbd1993[_0xdef2('0x28')](_0x11c150)[_0xdef2('0x29')](function(_0x25986c){return _0x25986c;});}return null;};}function removeEntity(_0x2694bb,_0x8d1cb2){return function(_0x566a27){if(_0x566a27){return _0x566a27[_0xdef2('0x2a')]()[_0xdef2('0x29')](function(){var _0x3a52d3=_0x566a27[_0xdef2('0x2b')]({'plain':!![]});var _0x574759=[{'name':_0xdef2('0x2c'),'value':_0xdef2('0x2d'),'ignore':![]},{'name':_0xdef2('0x2e'),'value':_0xdef2('0x2f'),'ignore':![]},{'name':_0xdef2('0x30'),'value':_0xdef2('0x31'),'ignore':![]}];var _0x212523=_(_0x574759)['filter'](_0xdef2('0x32'))[_0xdef2('0x33')]('value')['value']();if(_['includes'](_0x212523,_0x3a52d3[_0xdef2('0x34')])){return;}var _0x29e380=_[_0xdef2('0x35')](_0x574759,[_0xdef2('0x36'),_0x3a52d3[_0xdef2('0x34')]])[_0xdef2('0x37')];return db[_0xdef2('0x38')][_0xdef2('0x2a')]({'where':{'type':_0x29e380,'resourceId':_0x3a52d3['id']}})[_0xdef2('0x29')](function(){return _0x566a27;});})[_0xdef2('0x29')](function(){_0x2694bb[_0xdef2('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d992f,_0x472f4f){return function(_0x14d7e6){if(!_0x14d7e6){_0x1d992f[_0xdef2('0x1f')](0x194);}return _0x14d7e6;};}function handleError(_0x522730,_0x48bca6){_0x48bca6=_0x48bca6||0x1f4;return function(_0x4655a8){logger[_0xdef2('0x39')](_0x4655a8[_0xdef2('0x3a')]);if(_0x4655a8[_0xdef2('0x37')]){delete _0x4655a8['name'];}_0x522730['status'](_0x48bca6)[_0xdef2('0x3b')](_0x4655a8);};}exports['index']=function(_0x319b83,_0x44f6b7){var _0x5e04c9={},_0x26b323={},_0x51f219={'count':0x0,'rows':[]};var _0x5d3b38=_[_0xdef2('0x33')](db['VoiceExtension'][_0xdef2('0x3c')],function(_0x30e104){return{'name':_0x30e104[_0xdef2('0x3d')],'type':_0x30e104[_0xdef2('0x34')][_0xdef2('0x3e')]};});_0x26b323[_0xdef2('0x3f')]=_[_0xdef2('0x33')](_0x5d3b38,_0xdef2('0x37'));_0x26b323[_0xdef2('0x40')]=_[_0xdef2('0x41')](_0x319b83[_0xdef2('0x40')]);_0x26b323[_0xdef2('0x42')]=_[_0xdef2('0x43')](_0x26b323[_0xdef2('0x3f')],_0x26b323[_0xdef2('0x40')]);_0x5e04c9[_0xdef2('0x44')]=_[_0xdef2('0x43')](_0x26b323[_0xdef2('0x3f')],qs[_0xdef2('0x45')](_0x319b83[_0xdef2('0x40')][_0xdef2('0x45')]));_0x5e04c9[_0xdef2('0x44')]=_0x5e04c9['attributes'][_0xdef2('0x46')]?_0x5e04c9[_0xdef2('0x44')]:_0x26b323['model'];if(!_0x319b83['query'][_0xdef2('0x47')]('nolimit')){_0x5e04c9[_0xdef2('0x24')]=qs[_0xdef2('0x24')](_0x319b83[_0xdef2('0x40')][_0xdef2('0x24')]);_0x5e04c9['offset']=qs[_0xdef2('0x48')](_0x319b83[_0xdef2('0x40')]['offset']);}_0x5e04c9[_0xdef2('0x49')]=qs[_0xdef2('0x4a')](_0x319b83['query']['sort']);_0x5e04c9[_0xdef2('0x4b')]=qs[_0xdef2('0x42')](_[_0xdef2('0x4c')](_0x319b83[_0xdef2('0x40')],_0x26b323[_0xdef2('0x42')]));if(_0x319b83[_0xdef2('0x40')][_0xdef2('0x4d')]){_0x5e04c9[_0xdef2('0x4b')]=_[_0xdef2('0x4e')](_0x5e04c9['where'],{'$or':_[_0xdef2('0x33')](_0x5d3b38,function(_0x47f011){if(_0x47f011[_0xdef2('0x34')][_0xdef2('0x3e')]!==_0xdef2('0x4f')){var _0x46a383={};_0x46a383[_0x47f011[_0xdef2('0x50')]]={'$like':'%'+_0x319b83[_0xdef2('0x40')][_0xdef2('0x4d')]+'%'};return _0x46a383;}})});}_0x5e04c9=_['merge']({},_0x5e04c9,_0x319b83[_0xdef2('0x51')]);var _0x5efc15={'where':_0x5e04c9[_0xdef2('0x4b')]};return db['VoiceExtension']['count'](_0x5efc15)[_0xdef2('0x29')](function(_0x5dae60){_0x51f219[_0xdef2('0x23')]=_0x5dae60;if(_0x319b83[_0xdef2('0x40')]['includeAll']){_0x5e04c9['include']=[{'all':!![]}];}return db[_0xdef2('0x52')]['findAll'](_0x5e04c9);})[_0xdef2('0x29')](function(_0x4ddb85){_0x51f219[_0xdef2('0x53')]=_0x4ddb85;return _0x51f219;})['then'](respondWithFilteredResult(_0x44f6b7,_0x5e04c9))[_0xdef2('0x54')](handleError(_0x44f6b7,null));};exports[_0xdef2('0x55')]=function(_0x275e54,_0x1ec3de){var _0x9c8a51={'raw':![],'where':{'id':_0x275e54[_0xdef2('0x56')]['id']}},_0x4ee64d={};_0x4ee64d[_0xdef2('0x3f')]=_[_0xdef2('0x41')](db['VoiceExtension'][_0xdef2('0x3c')]);_0x4ee64d[_0xdef2('0x40')]=_[_0xdef2('0x41')](_0x275e54[_0xdef2('0x40')]);_0x4ee64d[_0xdef2('0x42')]=_[_0xdef2('0x43')](_0x4ee64d[_0xdef2('0x3f')],_0x4ee64d[_0xdef2('0x40')]);_0x9c8a51[_0xdef2('0x44')]=_['intersection'](_0x4ee64d[_0xdef2('0x3f')],qs['fields'](_0x275e54[_0xdef2('0x40')][_0xdef2('0x45')]));_0x9c8a51[_0xdef2('0x44')]=_0x9c8a51[_0xdef2('0x44')]['length']?_0x9c8a51[_0xdef2('0x44')]:_0x4ee64d[_0xdef2('0x3f')];if(_0x275e54[_0xdef2('0x40')][_0xdef2('0x57')]){_0x9c8a51[_0xdef2('0x58')]=[{'all':!![]}];}_0x9c8a51=_['merge']({},_0x9c8a51,_0x275e54[_0xdef2('0x51')]);return db['VoiceExtension'][_0xdef2('0x35')](_0x9c8a51)[_0xdef2('0x29')](handleEntityNotFound(_0x1ec3de,null))['then'](respondWithResult(_0x1ec3de,null))[_0xdef2('0x54')](handleError(_0x1ec3de,null));};exports[_0xdef2('0x2a')]=function(_0x5b4e51,_0xa280f7){return db['VoiceExtension']['find']({'where':{'id':_0x5b4e51[_0xdef2('0x56')]['id']}})[_0xdef2('0x29')](handleEntityNotFound(_0xa280f7,null))[_0xdef2('0x29')](removeEntity(_0xa280f7,null))['catch'](handleError(_0xa280f7,null));};exports[_0xdef2('0x59')]=function(_0x48d377,_0x14eb19){if(_0x48d377['body'][_0xdef2('0x34')]==='outbound'&&!_['startsWith'](_0x48d377['body'][_0xdef2('0x5a')],'_')){_0x48d377[_0xdef2('0x5b')][_0xdef2('0x5a')]='_'[_0xdef2('0x5c')](_0x48d377[_0xdef2('0x5b')][_0xdef2('0x5a')]);}return db['VoiceExtension']['create'](_0x48d377['body'],{'raw':![]})['then'](function(_0x521167){var _0x4039dc=_0x48d377[_0xdef2('0x5d')][_0xdef2('0x2b')]({'plain':!![]});if(!_0x4039dc)throw new Error(_0xdef2('0x5e'));if(_0x4039dc[_0xdef2('0x5f')]===_0xdef2('0x5d')){var _0xef2e42=_0x521167[_0xdef2('0x2b')]({'plain':!![]});var _0x55521b=[{'name':_0xdef2('0x2c'),'value':'inbound'},{'name':_0xdef2('0x2e'),'value':_0xdef2('0x2f')},{'name':_0xdef2('0x30'),'value':_0xdef2('0x31')}];var _0x3bee50=_[_0xdef2('0x35')](_0x55521b,[_0xdef2('0x36'),_0xef2e42[_0xdef2('0x34')]])[_0xdef2('0x37')];return db[_0xdef2('0x60')][_0xdef2('0x35')]({'where':{'name':_0x3bee50,'userProfileId':_0x4039dc['userProfileId']},'raw':!![]})[_0xdef2('0x29')](function(_0x408abb){if(_0x408abb&&_0x408abb['autoAssociation']===0x0){return db[_0xdef2('0x38')][_0xdef2('0x59')]({'name':_0xef2e42[_0xdef2('0x37')],'resourceId':_0xef2e42['id'],'type':_0x408abb[_0xdef2('0x37')],'sectionId':_0x408abb['id']},{})['then'](function(){return _0x521167;});}else{return _0x521167;}})[_0xdef2('0x54')](function(_0x5e13a6){logger[_0xdef2('0x39')](_0xdef2('0x61'),_0x5e13a6);throw _0x5e13a6;});}return _0x521167;})['then'](respondWithResult(_0x14eb19,0xc9))[_0xdef2('0x54')](handleError(_0x14eb19,null));};exports['update']=function(_0x219544,_0x3b28f8){if(_0x219544[_0xdef2('0x5b')]['id']){delete _0x219544[_0xdef2('0x5b')]['id'];}return db[_0xdef2('0x52')]['find']({'where':{'id':_0x219544[_0xdef2('0x56')]['id']}})[_0xdef2('0x29')](handleEntityNotFound(_0x3b28f8,null))[_0xdef2('0x29')](function(_0xf7bc42){if(_0xf7bc42){return db['VoiceExtension'][_0xdef2('0x28')](_[_0xdef2('0x4c')](_0x219544[_0xdef2('0x5b')],[_0xdef2('0x5a'),_0xdef2('0x62'),_0xdef2('0x63'),_0xdef2('0x64'),'cutdigits',_0xdef2('0x65')]),{'where':{'context':_0xf7bc42['context'],'exten':_0xf7bc42[_0xdef2('0x5a')]},'individualHooks':!![]})[_0xdef2('0x29')](function(_0x4a15c4){return _0x4a15c4;});}return null;})[_0xdef2('0x29')](respondWithStatusCode(_0x3b28f8,null))[_0xdef2('0x54')](handleError(_0x3b28f8,null));};exports[_0xdef2('0x66')]=function(_0x29f3e6,_0x132707,_0x267b1f){return db['VoiceExtension']['findOne']({'where':{'id':_0x29f3e6['params']['id']}})[_0xdef2('0x29')](handleEntityNotFound(_0x132707,null))[_0xdef2('0x29')](function(_0x53a4e5){if(_0x53a4e5){return db[_0xdef2('0x67')][_0xdef2('0x68')](function(_0x322c39){return db[_0xdef2('0x52')]['destroy']({'where':{'VoiceExtensionId':_0x29f3e6['params']['id']},'transaction':_0x322c39})[_0xdef2('0x29')](function(_0x2b6c59){var _0x463bd8=_[_0xdef2('0x33')](_0x29f3e6[_0xdef2('0x5b')],function(_0x32c91c){_0x32c91c['VoiceExtensionId']=_0x29f3e6['params']['id'];return _0x32c91c;});return db[_0xdef2('0x52')][_0xdef2('0x69')](_0x463bd8,{'transaction':_0x322c39});});})['then'](function(){return db['VoiceExtension'][_0xdef2('0x6a')]({'where':{'isApp':!![],'VoiceExtensionId':_0x29f3e6[_0xdef2('0x56')]['id']},'order':'cast(priority\x20as\x20unsigned)'});});}})[_0xdef2('0x29')](respondWithResult(_0x132707,null))[_0xdef2('0x54')](handleError(_0x132707,null));}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index cfbd3ea..bbe4bb9 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 _0x4f92=['emit','hook','exports','events','../../mysqldb','VoiceExtension','setMaxListeners','update','remove'];(function(_0x158685,_0x58ab1a){var _0x273d9c=function(_0x183f18){while(--_0x183f18){_0x158685['push'](_0x158685['shift']());}};_0x273d9c(++_0x58ab1a);}(_0x4f92,0x1b3));var _0x24f9=function(_0x62c4d9,_0xb326b){_0x62c4d9=_0x62c4d9-0x0;var _0xc69de8=_0x4f92[_0x62c4d9];return _0xc69de8;};'use strict';var EventEmitter=require(_0x24f9('0x0'));var VoiceExtension=require(_0x24f9('0x1'))['db'][_0x24f9('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x24f9('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x24f9('0x4'),'afterDestroy':_0x24f9('0x5')};function emitEvent(_0x28ac8a){return function(_0x2a1e1f,_0x4e9dae,_0x40b448){VoiceExtensionEvents[_0x24f9('0x6')](_0x28ac8a+':'+_0x2a1e1f['id'],_0x2a1e1f);VoiceExtensionEvents['emit'](_0x28ac8a,_0x2a1e1f);_0x40b448(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0x24f9('0x7')](e,emitEvent(event));}}module[_0x24f9('0x8')]=VoiceExtensionEvents; \ No newline at end of file +var _0x3df4=['setMaxListeners','save','update','remove','emit','events','../../mysqldb','VoiceExtension'];(function(_0x5eef69,_0x5f5ba5){var _0x49d59b=function(_0x1caaae){while(--_0x1caaae){_0x5eef69['push'](_0x5eef69['shift']());}};_0x49d59b(++_0x5f5ba5);}(_0x3df4,0xcd));var _0x43df=function(_0x2a52ea,_0x422a0e){_0x2a52ea=_0x2a52ea-0x0;var _0x310786=_0x3df4[_0x2a52ea];return _0x310786;};'use strict';var EventEmitter=require(_0x43df('0x0'));var VoiceExtension=require(_0x43df('0x1'))['db'][_0x43df('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x43df('0x3')](0x0);var events={'afterCreate':_0x43df('0x4'),'afterUpdate':_0x43df('0x5'),'afterDestroy':_0x43df('0x6')};function emitEvent(_0x531dc6){return function(_0x4dac91,_0x4f60fd,_0x776893){VoiceExtensionEvents['emit'](_0x531dc6+':'+_0x4dac91['id'],_0x4dac91);VoiceExtensionEvents[_0x43df('0x7')](_0x531dc6,_0x4dac91);_0x776893(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index a4dd93d..c4690ff 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 _0x5358=['rimraf','../../config/environment','voice_extensions','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x244862,_0x3da79e){var _0x2bce23=function(_0x235ae5){while(--_0x235ae5){_0x244862['push'](_0x244862['shift']());}};_0x2bce23(++_0x3da79e);}(_0x5358,0xfd));var _0x8535=function(_0x59f86a,_0x5a4384){_0x59f86a=_0x59f86a-0x0;var _0x899f7e=_0x5358[_0x59f86a];return _0x899f7e;};'use strict';var _=require(_0x8535('0x0'));var util=require(_0x8535('0x1'));var logger=require(_0x8535('0x2'))(_0x8535('0x3'));var moment=require(_0x8535('0x4'));var BPromise=require('bluebird');var rp=require(_0x8535('0x5'));var fs=require('fs');var path=require(_0x8535('0x6'));var rimraf=require(_0x8535('0x7'));var config=require(_0x8535('0x8'));var attributes=require('./voiceExtension.attributes');module['exports']=function(_0x134c36,_0x3ebe76){return _0x134c36['define']('VoiceExtension',attributes,{'tableName':_0x8535('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1601=['path','rimraf','../../config/environment','exports','define','voice_extensions','lodash','../../config/logger','api','moment','bluebird'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0x1601,0xa0));var _0x1160=function(_0xdb576,_0x13705e){_0xdb576=_0xdb576-0x0;var _0x98a94b=_0x1601[_0xdb576];return _0x98a94b;};'use strict';var _=require(_0x1160('0x0'));var util=require('util');var logger=require(_0x1160('0x1'))(_0x1160('0x2'));var moment=require(_0x1160('0x3'));var BPromise=require(_0x1160('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1160('0x5'));var rimraf=require(_0x1160('0x6'));var config=require(_0x1160('0x7'));var attributes=require('./voiceExtension.attributes');module[_0x1160('0x8')]=function(_0x1c3f16,_0x3b1613){return _0x1c3f16[_0x1160('0x9')]('VoiceExtension',attributes,{'tableName':_0x1160('0xa'),'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 61a97ab..218f331 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 _0xec41=['request\x20sent','stringify','error','code','VoiceExtension,\x20%s,\x20%s','message','result','catch','GetVoiceExtension','VoiceExtension','options','attributes','map','model','include','lodash','util','moment','bluebird','randomstring','ioredis','client','http','defaults','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','request','then','info','debug'];(function(_0x270567,_0x5b684){var _0x443baf=function(_0x2454de){while(--_0x2454de){_0x270567['push'](_0x270567['shift']());}};_0x443baf(++_0x5b684);}(_0xec41,0x19b));var _0x1ec4=function(_0x14d569,_0x2ddad6){_0x14d569=_0x14d569-0x0;var _0x2d04b6=_0xec41[_0x14d569];return _0x2d04b6;};'use strict';var _=require(_0x1ec4('0x0'));var util=require(_0x1ec4('0x1'));var moment=require(_0x1ec4('0x2'));var BPromise=require(_0x1ec4('0x3'));var rs=require(_0x1ec4('0x4'));var fs=require('fs');var Redis=require(_0x1ec4('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1ec4('0x6')][_0x1ec4('0x7')]({'port':0x232a});config['redis']=_[_0x1ec4('0x8')](config[_0x1ec4('0x9')],{'host':_0x1ec4('0xa'),'port':0x18eb});var socket=require(_0x1ec4('0xb'))(new Redis(config['redis']));require(_0x1ec4('0xc'))[_0x1ec4('0xd')](socket);function respondWithRpcPromise(_0x499233,_0xbb628a,_0x1e4211){return new BPromise(function(_0x157035,_0x4ed291){return client[_0x1ec4('0xe')](_0x499233,_0x1e4211)[_0x1ec4('0xf')](function(_0x23de5d){logger[_0x1ec4('0x10')]('VoiceExtension,\x20%s,\x20%s',_0xbb628a,'request\x20sent');logger[_0x1ec4('0x11')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0xbb628a,_0x1ec4('0x12'),JSON[_0x1ec4('0x13')](_0x23de5d));if(_0x23de5d[_0x1ec4('0x14')]){if(_0x23de5d[_0x1ec4('0x14')][_0x1ec4('0x15')]===0x1f4){logger[_0x1ec4('0x14')](_0x1ec4('0x16'),_0xbb628a,_0x23de5d[_0x1ec4('0x14')]['message']);return _0x4ed291(_0x23de5d[_0x1ec4('0x14')][_0x1ec4('0x17')]);}logger[_0x1ec4('0x14')](_0x1ec4('0x16'),_0xbb628a,_0x23de5d['error']['message']);return _0x157035(_0x23de5d[_0x1ec4('0x14')][_0x1ec4('0x17')]);}else{logger[_0x1ec4('0x10')](_0x1ec4('0x16'),_0xbb628a,_0x1ec4('0x12'));_0x157035(_0x23de5d[_0x1ec4('0x18')][_0x1ec4('0x17')]);}})[_0x1ec4('0x19')](function(_0x1e2eaa){logger[_0x1ec4('0x14')](_0x1ec4('0x16'),_0xbb628a,_0x1e2eaa);_0x4ed291(_0x1e2eaa);});});}exports[_0x1ec4('0x1a')]=function(_0x2bc60d){var _0x155f9f=this;return new Promise(function(_0x306da5,_0x1a8af0){return db[_0x1ec4('0x1b')]['findAll']({'raw':_0x2bc60d[_0x1ec4('0x1c')]?_0x2bc60d[_0x1ec4('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x2bc60d[_0x1ec4('0x1c')]?_0x2bc60d[_0x1ec4('0x1c')]['where']||null:null,'attributes':_0x2bc60d[_0x1ec4('0x1c')]?_0x2bc60d[_0x1ec4('0x1c')][_0x1ec4('0x1d')]||null:null,'limit':_0x2bc60d[_0x1ec4('0x1c')]?_0x2bc60d[_0x1ec4('0x1c')]['limit']||null:null,'include':_0x2bc60d[_0x1ec4('0x1c')]?_0x2bc60d[_0x1ec4('0x1c')]['include']?_[_0x1ec4('0x1e')](_0x2bc60d[_0x1ec4('0x1c')]['include'],function(_0x24e946){return{'model':db[_0x24e946[_0x1ec4('0x1f')]],'as':_0x24e946['as'],'attributes':_0x24e946[_0x1ec4('0x1d')],'include':_0x24e946[_0x1ec4('0x20')]?_[_0x1ec4('0x1e')](_0x24e946['include'],function(_0x2b8f5f){return{'model':db[_0x2b8f5f[_0x1ec4('0x1f')]],'as':_0x2b8f5f['as'],'attributes':_0x2b8f5f[_0x1ec4('0x1d')],'include':_0x2b8f5f[_0x1ec4('0x20')]?_[_0x1ec4('0x1e')](_0x2b8f5f['include'],function(_0xb9e7d4){return{'model':db[_0xb9e7d4[_0x1ec4('0x1f')]],'as':_0xb9e7d4['as'],'attributes':_0xb9e7d4[_0x1ec4('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1ec4('0xf')](function(_0xf27b67){logger['info'](_0x1ec4('0x1a'),_0x2bc60d);logger[_0x1ec4('0x11')](_0x1ec4('0x1a'),_0x2bc60d,JSON[_0x1ec4('0x13')](_0xf27b67));_0x306da5(_0xf27b67);})[_0x1ec4('0x19')](function(_0x6a5d5){logger['error']('GetVoiceExtension',_0x6a5d5[_0x1ec4('0x17')],_0x2bc60d);_0x1a8af0(_0x155f9f['error'](0x1f4,_0x6a5d5[_0x1ec4('0x17')]));});});}; \ No newline at end of file +var _0x6e72=['error','code','VoiceExtension,\x20%s,\x20%s','message','result','catch','VoiceExtension','findAll','options','raw','attributes','limit','include','map','model','GetVoiceExtension','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','./voiceExtension.socket','register','request','then','info','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s'];(function(_0x1ae31c,_0x8dcd2d){var _0x19519d=function(_0x22b8cd){while(--_0x22b8cd){_0x1ae31c['push'](_0x1ae31c['shift']());}};_0x19519d(++_0x8dcd2d);}(_0x6e72,0x196));var _0x26e7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6e72[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x26e7('0x0'));var util=require(_0x26e7('0x1'));var moment=require(_0x26e7('0x2'));var BPromise=require(_0x26e7('0x3'));var rs=require(_0x26e7('0x4'));var fs=require('fs');var Redis=require(_0x26e7('0x5'));var db=require(_0x26e7('0x6'))['db'];var utils=require(_0x26e7('0x7'));var logger=require(_0x26e7('0x8'))('rpc');var config=require(_0x26e7('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x26e7('0xa')][_0x26e7('0xb')]({'port':0x232a});config[_0x26e7('0xc')]=_[_0x26e7('0xd')](config['redis'],{'host':_0x26e7('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x26e7('0xc')]));require(_0x26e7('0xf'))[_0x26e7('0x10')](socket);function respondWithRpcPromise(_0x58f593,_0x47a042,_0x5f128a){return new BPromise(function(_0x58fc43,_0x30a1df){return client[_0x26e7('0x11')](_0x58f593,_0x5f128a)[_0x26e7('0x12')](function(_0x4392a6){logger[_0x26e7('0x13')]('VoiceExtension,\x20%s,\x20%s',_0x47a042,_0x26e7('0x14'));logger[_0x26e7('0x15')](_0x26e7('0x16'),_0x47a042,'request\x20sent',JSON['stringify'](_0x4392a6));if(_0x4392a6[_0x26e7('0x17')]){if(_0x4392a6[_0x26e7('0x17')][_0x26e7('0x18')]===0x1f4){logger['error'](_0x26e7('0x19'),_0x47a042,_0x4392a6[_0x26e7('0x17')][_0x26e7('0x1a')]);return _0x30a1df(_0x4392a6[_0x26e7('0x17')][_0x26e7('0x1a')]);}logger['error']('VoiceExtension,\x20%s,\x20%s',_0x47a042,_0x4392a6[_0x26e7('0x17')][_0x26e7('0x1a')]);return _0x58fc43(_0x4392a6['error'][_0x26e7('0x1a')]);}else{logger[_0x26e7('0x13')](_0x26e7('0x19'),_0x47a042,_0x26e7('0x14'));_0x58fc43(_0x4392a6[_0x26e7('0x1b')][_0x26e7('0x1a')]);}})[_0x26e7('0x1c')](function(_0x170b27){logger['error']('VoiceExtension,\x20%s,\x20%s',_0x47a042,_0x170b27);_0x30a1df(_0x170b27);});});}exports['GetVoiceExtension']=function(_0x41dfbc){var _0x4dc7f3=this;return new Promise(function(_0x563f43,_0x26f0ec){return db[_0x26e7('0x1d')][_0x26e7('0x1e')]({'raw':_0x41dfbc['options']?_0x41dfbc[_0x26e7('0x1f')][_0x26e7('0x20')]===undefined?!![]:![]:!![],'where':_0x41dfbc[_0x26e7('0x1f')]?_0x41dfbc[_0x26e7('0x1f')]['where']||null:null,'attributes':_0x41dfbc[_0x26e7('0x1f')]?_0x41dfbc[_0x26e7('0x1f')][_0x26e7('0x21')]||null:null,'limit':_0x41dfbc[_0x26e7('0x1f')]?_0x41dfbc['options'][_0x26e7('0x22')]||null:null,'include':_0x41dfbc[_0x26e7('0x1f')]?_0x41dfbc[_0x26e7('0x1f')][_0x26e7('0x23')]?_[_0x26e7('0x24')](_0x41dfbc[_0x26e7('0x1f')][_0x26e7('0x23')],function(_0x55771b){return{'model':db[_0x55771b[_0x26e7('0x25')]],'as':_0x55771b['as'],'attributes':_0x55771b[_0x26e7('0x21')],'include':_0x55771b[_0x26e7('0x23')]?_[_0x26e7('0x24')](_0x55771b['include'],function(_0x599242){return{'model':db[_0x599242['model']],'as':_0x599242['as'],'attributes':_0x599242[_0x26e7('0x21')],'include':_0x599242[_0x26e7('0x23')]?_[_0x26e7('0x24')](_0x599242[_0x26e7('0x23')],function(_0x4ce96f){return{'model':db[_0x4ce96f[_0x26e7('0x25')]],'as':_0x4ce96f['as'],'attributes':_0x4ce96f['attributes']};}):[]};}):[]};}):[]:[]})[_0x26e7('0x12')](function(_0x459625){logger[_0x26e7('0x13')]('GetVoiceExtension',_0x41dfbc);logger['debug'](_0x26e7('0x26'),_0x41dfbc,JSON['stringify'](_0x459625));_0x563f43(_0x459625);})[_0x26e7('0x1c')](function(_0x256d09){logger['error'](_0x26e7('0x26'),_0x256d09[_0x26e7('0x1a')],_0x41dfbc);_0x26f0ec(_0x4dc7f3[_0x26e7('0x17')](0x1f4,_0x256d09[_0x26e7('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index cf7daa4..499711d 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 _0xb537=['removeListener','length','voiceExtension:','./voiceExtension.events','remove'];(function(_0x76b83e,_0x52aaab){var _0x18634b=function(_0x2682e5){while(--_0x2682e5){_0x76b83e['push'](_0x76b83e['shift']());}};_0x18634b(++_0x52aaab);}(_0xb537,0x15c));var _0x7b53=function(_0x47b0c1,_0x48142e){_0x47b0c1=_0x47b0c1-0x0;var _0x514603=_0xb537[_0x47b0c1];return _0x514603;};'use strict';var VoiceExtensionEvents=require(_0x7b53('0x0'));var events=['save',_0x7b53('0x1'),'update'];function createListener(_0x295f01,_0xc7b91b){return function(_0x20e444){_0xc7b91b['emit'](_0x295f01,_0x20e444);};}function removeListener(_0x435a10,_0x1fb013){return function(){VoiceExtensionEvents[_0x7b53('0x2')](_0x435a10,_0x1fb013);};}exports['register']=function(_0x23c98b){for(var _0x27a183=0x0,_0x1226d6=events[_0x7b53('0x3')];_0x27a183<_0x1226d6;_0x27a183++){var _0x5b7c79=events[_0x27a183];var _0x5b5897=createListener(_0x7b53('0x4')+_0x5b7c79,_0x23c98b);VoiceExtensionEvents['on'](_0x5b7c79,_0x5b5897);}}; \ No newline at end of file +var _0x5f26=['emit','removeListener','register','length','voiceExtension:','./voiceExtension.events','save','remove'];(function(_0x43a1a6,_0xee560d){var _0x13b453=function(_0x4f6f10){while(--_0x4f6f10){_0x43a1a6['push'](_0x43a1a6['shift']());}};_0x13b453(++_0xee560d);}(_0x5f26,0xad));var _0x65f2=function(_0x235f49,_0x2992b4){_0x235f49=_0x235f49-0x0;var _0x551139=_0x5f26[_0x235f49];return _0x551139;};'use strict';var VoiceExtensionEvents=require(_0x65f2('0x0'));var events=[_0x65f2('0x1'),_0x65f2('0x2'),'update'];function createListener(_0x27f57b,_0x39102e){return function(_0x4c45ac){_0x39102e[_0x65f2('0x3')](_0x27f57b,_0x4c45ac);};}function removeListener(_0x8aa0ab,_0x416390){return function(){VoiceExtensionEvents[_0x65f2('0x4')](_0x8aa0ab,_0x416390);};}exports[_0x65f2('0x5')]=function(_0x5a2e5b){for(var _0x3f8e39=0x0,_0x5b2379=events[_0x65f2('0x6')];_0x3f8e39<_0x5b2379;_0x3f8e39++){var _0x488d53=events[_0x3f8e39];var _0x3ddace=createListener(_0x65f2('0x7')+_0x488d53,_0x5a2e5b);VoiceExtensionEvents['on'](_0x488d53,_0x3ddace);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 37fedd2..88a6dae 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 _0x1074=['path','express','./voiceMail.controller','isAuthenticated','index','get','/:id','show','/:id/messages','getMessages','post','create','put','update','delete','destroy','exports','util'];(function(_0x16bd44,_0x3c91ba){var _0x368a61=function(_0x1c68ab){while(--_0x1c68ab){_0x16bd44['push'](_0x16bd44['shift']());}};_0x368a61(++_0x3c91ba);}(_0x1074,0xe9));var _0x4107=function(_0x49bdc4,_0x1e2507){_0x49bdc4=_0x49bdc4-0x0;var _0x1f7437=_0x1074[_0x49bdc4];return _0x1f7437;};'use strict';var multer=require('multer');var util=require(_0x4107('0x0'));var path=require(_0x4107('0x1'));var timeout=require('connect-timeout');var express=require(_0x4107('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4107('0x3'));router['get']('/',auth[_0x4107('0x4')](),controller[_0x4107('0x5')]);router[_0x4107('0x6')](_0x4107('0x7'),auth[_0x4107('0x4')](),controller[_0x4107('0x8')]);router[_0x4107('0x6')](_0x4107('0x9'),auth[_0x4107('0x4')](),controller[_0x4107('0xa')]);router[_0x4107('0xb')]('/',auth[_0x4107('0x4')](),controller[_0x4107('0xc')]);router[_0x4107('0xd')](_0x4107('0x7'),auth[_0x4107('0x4')](),controller[_0x4107('0xe')]);router[_0x4107('0xf')](_0x4107('0x7'),auth[_0x4107('0x4')](),controller[_0x4107('0x10')]);module[_0x4107('0x11')]=router; \ No newline at end of file +var _0x2fcb=['../../components/interaction/service','../../config/environment','isAuthenticated','show','get','getMessages','post','create','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x59342a,_0x16827b){var _0x17abc9=function(_0x2f7bfc){while(--_0x2f7bfc){_0x59342a['push'](_0x59342a['shift']());}};_0x17abc9(++_0x16827b);}(_0x2fcb,0x176));var _0xb2fc=function(_0x52f259,_0x75a072){_0x52f259=_0x52f259-0x0;var _0x6f515f=_0x2fcb[_0x52f259];return _0x6f515f;};'use strict';var multer=require(_0xb2fc('0x0'));var util=require(_0xb2fc('0x1'));var path=require(_0xb2fc('0x2'));var timeout=require(_0xb2fc('0x3'));var express=require(_0xb2fc('0x4'));var router=express[_0xb2fc('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xb2fc('0x6'));var config=require(_0xb2fc('0x7'));var controller=require('./voiceMail.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth[_0xb2fc('0x8')](),controller[_0xb2fc('0x9')]);router[_0xb2fc('0xa')]('/:id/messages',auth[_0xb2fc('0x8')](),controller[_0xb2fc('0xb')]);router[_0xb2fc('0xc')]('/',auth['isAuthenticated'](),controller[_0xb2fc('0xd')]);router['put'](_0xb2fc('0xe'),auth['isAuthenticated'](),controller[_0xb2fc('0xf')]);router[_0xb2fc('0x10')](_0xb2fc('0xe'),auth['isAuthenticated'](),controller[_0xb2fc('0x11')]);module[_0xb2fc('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 caf92c2..c79714d 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 _0x5c00=['VIRTUAL','getDataValue','\x20-\x20','mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER'];(function(_0x53a970,_0x385fa3){var _0x1521ac=function(_0x2960e1){while(--_0x2960e1){_0x53a970['push'](_0x53a970['shift']());}};_0x1521ac(++_0x385fa3);}(_0x5c00,0x17e));var _0x05c0=function(_0x2aa1a4,_0x3fe4e4){_0x2aa1a4=_0x2aa1a4-0x0;var _0x3e588e=_0x5c00[_0x2aa1a4];return _0x3e588e;};'use strict';var Sequelize=require(_0x05c0('0x0'));module[_0x05c0('0x1')]={'customer_id':{'type':Sequelize[_0x05c0('0x2')]},'context':{'type':Sequelize['STRING'],'defaultValue':_0x05c0('0x3'),'unique':'contest_mailbox'},'mailbox':{'type':Sequelize[_0x05c0('0x2')],'defaultValue':'','allowNull':![],'unique':_0x05c0('0x4')},'password':{'type':Sequelize[_0x05c0('0x2')]},'fullname':{'type':Sequelize[_0x05c0('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x145973){this[_0x05c0('0x5')](_0x05c0('0x6'),typeof _0x145973===_0x05c0('0x7')&&_0x145973['trim']()?_0x145973[_0x05c0('0x8')]():null);}},'pager':{'type':Sequelize[_0x05c0('0x2')]},'tz':{'type':Sequelize[_0x05c0('0x2')],'defaultValue':'central'},'attach':{'type':Sequelize[_0x05c0('0x9')](_0x05c0('0xa'),'no'),'defaultValue':_0x05c0('0xa'),'allowNull':![]},'saycid':{'type':Sequelize[_0x05c0('0x9')](_0x05c0('0xa'),'no'),'defaultValue':_0x05c0('0xa'),'allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0x05c0('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x05c0('0x9')](_0x05c0('0xa'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x05c0('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x05c0('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x05c0('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x05c0('0x9')](_0x05c0('0xa'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x05c0('0x9')](_0x05c0('0xa'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x05c0('0x9')](_0x05c0('0xa'),'no'),'defaultValue':_0x05c0('0xa'),'allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0x05c0('0xa'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x05c0('0x9')](_0x05c0('0xa'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x05c0('0x9')](_0x05c0('0xa'),'no'),'defaultValue':_0x05c0('0xa'),'allowNull':![]},'stamp':{'type':_0x05c0('0xc')},'emailsubject':{'type':Sequelize[_0x05c0('0x2')]},'emailbody':{'type':Sequelize[_0x05c0('0x2')]},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x05c0('0xd')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x05c0('0xe')],'get':function(){return this[_0x05c0('0xf')]('fullname')+_0x05c0('0x10')+this[_0x05c0('0xf')](_0x05c0('0x11'));}}}; \ No newline at end of file +var _0x3c81=['TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','sequelize','exports','STRING','from-voicemail','setDataValue','email','string','trim','central','ENUM','yes','TINYINT(4)'];(function(_0x2b49eb,_0x176904){var _0x3227d8=function(_0xae5dce){while(--_0xae5dce){_0x2b49eb['push'](_0x2b49eb['shift']());}};_0x3227d8(++_0x176904);}(_0x3c81,0x102));var _0x13c8=function(_0x17aaa3,_0x100157){_0x17aaa3=_0x17aaa3-0x0;var _0x5eff01=_0x3c81[_0x17aaa3];return _0x5eff01;};'use strict';var Sequelize=require(_0x13c8('0x0'));module[_0x13c8('0x1')]={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x13c8('0x2')],'defaultValue':_0x13c8('0x3'),'unique':'contest_mailbox'},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0x13c8('0x2')]},'email':{'type':Sequelize[_0x13c8('0x2')],'validate':{'isEmail':!![]},'set':function(_0x18bd0f){this[_0x13c8('0x4')](_0x13c8('0x5'),typeof _0x18bd0f===_0x13c8('0x6')&&_0x18bd0f[_0x13c8('0x7')]()?_0x18bd0f['trim']():null);}},'pager':{'type':Sequelize[_0x13c8('0x2')]},'tz':{'type':Sequelize['STRING'],'defaultValue':_0x13c8('0x8')},'attach':{'type':Sequelize[_0x13c8('0x9')](_0x13c8('0xa'),'no'),'defaultValue':_0x13c8('0xa'),'allowNull':![]},'saycid':{'type':Sequelize[_0x13c8('0x9')](_0x13c8('0xa'),'no'),'defaultValue':_0x13c8('0xa'),'allowNull':![]},'dialout':{'type':Sequelize[_0x13c8('0x2')]},'callback':{'type':Sequelize[_0x13c8('0x2')]},'review':{'type':Sequelize[_0x13c8('0x9')](_0x13c8('0xa'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x13c8('0x9')](_0x13c8('0xa'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x13c8('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x13c8('0x9')](_0x13c8('0xa'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x13c8('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x13c8('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x13c8('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x13c8('0xa'),'allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0x13c8('0xa'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x13c8('0x9')](_0x13c8('0xa'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x13c8('0x9')]('yes','no'),'defaultValue':_0x13c8('0xa'),'allowNull':![]},'stamp':{'type':_0x13c8('0xc')},'emailsubject':{'type':Sequelize[_0x13c8('0x2')]},'emailbody':{'type':Sequelize[_0x13c8('0x2')]},'maxsecs':{'type':Sequelize[_0x13c8('0xd')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x13c8('0xd')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x13c8('0xe')],'get':function(){return this[_0x13c8('0xf')](_0x13c8('0x10'))+_0x13c8('0x11')+this[_0x13c8('0xf')]('mailbox');}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 2d92694..88a8202 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 _0x9c65=['zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','Content-Range','apply','reject','save','update','then','destroy','get','Voicemails','error','stack','name','VoiceMail','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','catch','show','params','keys','rawAttributes','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','getMessages','VoiceMailMessage','sort','html-pdf','eml-format','rimraf'];(function(_0x408c40,_0x24c6fd){var _0x5a214e=function(_0x3bf55a){while(--_0x3bf55a){_0x408c40['push'](_0x408c40['shift']());}};_0x5a214e(++_0x24c6fd);}(_0x9c65,0x159));var _0x59c6=function(_0x19a1c1,_0x4b5e11){_0x19a1c1=_0x19a1c1-0x0;var _0x101daf=_0x9c65[_0x19a1c1];return _0x101daf;};'use strict';var pdf=require(_0x59c6('0x0'));var emlformat=require(_0x59c6('0x1'));var rimraf=require(_0x59c6('0x2'));var zipdir=require(_0x59c6('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x59c6('0x4'));var BPromise=require(_0x59c6('0x5'));var Mustache=require(_0x59c6('0x6'));var util=require(_0x59c6('0x7'));var path=require(_0x59c6('0x8'));var sox=require(_0x59c6('0x9'));var csv=require(_0x59c6('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x59c6('0xb'));var squel=require(_0x59c6('0xc'));var crypto=require(_0x59c6('0xd'));var jsforce=require(_0x59c6('0xe'));var deskjs=require(_0x59c6('0xf'));var toCsv=require(_0x59c6('0xa'));var querystring=require(_0x59c6('0x10'));var Papa=require(_0x59c6('0x11'));var Redis=require(_0x59c6('0x12'));var authService=require(_0x59c6('0x13'));var qs=require(_0x59c6('0x14'));var as=require(_0x59c6('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x59c6('0x16'));var utils=require(_0x59c6('0x17'));var config=require(_0x59c6('0x18'));var db=require(_0x59c6('0x19'))['db'];function respondWithStatusCode(_0xb8f0e4,_0x51c664){_0x51c664=_0x51c664||0xcc;return function(_0x4fb01c){if(_0x4fb01c){return _0xb8f0e4[_0x59c6('0x1a')](_0x51c664);}return _0xb8f0e4[_0x59c6('0x1b')](_0x51c664)['end']();};}function respondWithResult(_0x49302b,_0x3ed7f4){_0x3ed7f4=_0x3ed7f4||0xc8;return function(_0x3ca0ec){if(_0x3ca0ec){return _0x49302b[_0x59c6('0x1b')](_0x3ed7f4)[_0x59c6('0x1c')](_0x3ca0ec);}};}function respondWithFilteredResult(_0x389e7c,_0x35f85f){return function(_0x1b4502){if(_0x1b4502){var _0x52d62e=_0x1b4502['count'],_0x16af3e=_0x35f85f[_0x59c6('0x1d')],_0x3b4420=_0x35f85f['offset']+_0x35f85f[_0x59c6('0x1e')],_0x32e312;if(_0x3b4420>=_0x52d62e){_0x3b4420=_0x52d62e;_0x32e312=0xc8;}else{_0x32e312=0xce;}_0x389e7c[_0x59c6('0x1b')](_0x32e312);return _0x389e7c['set'](_0x59c6('0x1f'),_0x16af3e+'-'+_0x3b4420+'/'+_0x52d62e)[_0x59c6('0x1c')](_0x1b4502);}return null;};}function patchUpdates(_0x281b07){return function(_0x449f8f){try{jsonpatch[_0x59c6('0x20')](_0x449f8f,_0x281b07,!![]);}catch(_0x42ee08){return BPromise[_0x59c6('0x21')](_0x42ee08);}return _0x449f8f[_0x59c6('0x22')]();};}function saveUpdates(_0x1571ff,_0x3220db){return function(_0x3d79ce){if(_0x3d79ce){return _0x3d79ce[_0x59c6('0x23')](_0x1571ff)[_0x59c6('0x24')](function(_0x3fc39e){return _0x3fc39e;});}return null;};}function removeEntity(_0x58bcb3,_0x4c54df){return function(_0x461dc9){if(_0x461dc9){return _0x461dc9[_0x59c6('0x25')]()['then'](function(){var _0x136f91=_0x461dc9[_0x59c6('0x26')]({'plain':!![]});var _0x58fdc1=_0x59c6('0x27');return db['UserProfileResource'][_0x59c6('0x25')]({'where':{'type':_0x58fdc1,'resourceId':_0x136f91['id']}})[_0x59c6('0x24')](function(){return _0x461dc9;});})['then'](function(){_0x58bcb3[_0x59c6('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f40fa,_0x5f50af){return function(_0x153cf3){if(!_0x153cf3){_0x1f40fa[_0x59c6('0x1a')](0x194);}return _0x153cf3;};}function handleError(_0x5a0fb3,_0x100757){_0x100757=_0x100757||0x1f4;return function(_0x26b124){logger[_0x59c6('0x28')](_0x26b124[_0x59c6('0x29')]);if(_0x26b124[_0x59c6('0x2a')]){delete _0x26b124[_0x59c6('0x2a')];}_0x5a0fb3['status'](_0x100757)['send'](_0x26b124);};}exports['index']=function(_0x1d860a,_0x34e0e3){var _0x27c62e={},_0x40f878={},_0xa4e67b={'count':0x0,'rows':[]};var _0x7dfcf2=_['map'](db[_0x59c6('0x2b')]['rawAttributes'],function(_0x3a0f70){return{'name':_0x3a0f70[_0x59c6('0x2c')],'type':_0x3a0f70[_0x59c6('0x2d')][_0x59c6('0x2e')]};});_0x40f878[_0x59c6('0x2f')]=_[_0x59c6('0x30')](_0x7dfcf2,_0x59c6('0x2a'));_0x40f878['query']=_['keys'](_0x1d860a[_0x59c6('0x31')]);_0x40f878[_0x59c6('0x32')]=_[_0x59c6('0x33')](_0x40f878[_0x59c6('0x2f')],_0x40f878[_0x59c6('0x31')]);_0x27c62e[_0x59c6('0x34')]=_[_0x59c6('0x33')](_0x40f878[_0x59c6('0x2f')],qs[_0x59c6('0x35')](_0x1d860a[_0x59c6('0x31')][_0x59c6('0x35')]));_0x27c62e[_0x59c6('0x34')]=_0x27c62e[_0x59c6('0x34')][_0x59c6('0x36')]?_0x27c62e['attributes']:_0x40f878[_0x59c6('0x2f')];if(!_0x1d860a[_0x59c6('0x31')][_0x59c6('0x37')](_0x59c6('0x38'))){_0x27c62e[_0x59c6('0x1e')]=qs['limit'](_0x1d860a['query'][_0x59c6('0x1e')]);_0x27c62e[_0x59c6('0x1d')]=qs[_0x59c6('0x1d')](_0x1d860a['query'][_0x59c6('0x1d')]);}_0x27c62e[_0x59c6('0x39')]=qs['sort'](_0x1d860a['query']['sort']);_0x27c62e[_0x59c6('0x3a')]=qs[_0x59c6('0x32')](_[_0x59c6('0x3b')](_0x1d860a[_0x59c6('0x31')],_0x40f878[_0x59c6('0x32')]));if(_0x1d860a['query'][_0x59c6('0x3c')]){_0x27c62e[_0x59c6('0x3a')]=_[_0x59c6('0x3d')](_0x27c62e[_0x59c6('0x3a')],{'$or':_[_0x59c6('0x30')](_0x7dfcf2,function(_0x31b4d9){if(_0x31b4d9[_0x59c6('0x2d')][_0x59c6('0x2e')]!==_0x59c6('0x3e')){var _0x376e05={};_0x376e05[_0x31b4d9['field']]={'$like':'%'+_0x1d860a['query']['filter']+'%'};return _0x376e05;}})});}_0x27c62e=_[_0x59c6('0x3d')]({},_0x27c62e,_0x1d860a[_0x59c6('0x3f')]);var _0x558d34={'where':_0x27c62e[_0x59c6('0x3a')]};return db[_0x59c6('0x2b')]['count'](_0x558d34)[_0x59c6('0x24')](function(_0x1aa3d1){_0xa4e67b[_0x59c6('0x40')]=_0x1aa3d1;if(_0x1d860a['query'][_0x59c6('0x41')]){_0x27c62e[_0x59c6('0x42')]=[{'all':!![]}];}return db[_0x59c6('0x2b')][_0x59c6('0x43')](_0x27c62e);})['then'](function(_0x5d56a6){_0xa4e67b['rows']=_0x5d56a6;return _0xa4e67b;})[_0x59c6('0x24')](respondWithFilteredResult(_0x34e0e3,_0x27c62e))[_0x59c6('0x44')](handleError(_0x34e0e3,null));};exports[_0x59c6('0x45')]=function(_0x2c42df,_0x56d22a){var _0x1d5eb5={'raw':!![],'where':{'id':_0x2c42df[_0x59c6('0x46')]['id']}},_0x7abb2a={};_0x7abb2a[_0x59c6('0x2f')]=_[_0x59c6('0x47')](db[_0x59c6('0x2b')][_0x59c6('0x48')]);_0x7abb2a[_0x59c6('0x31')]=_[_0x59c6('0x47')](_0x2c42df[_0x59c6('0x31')]);_0x7abb2a[_0x59c6('0x32')]=_[_0x59c6('0x33')](_0x7abb2a[_0x59c6('0x2f')],_0x7abb2a[_0x59c6('0x31')]);_0x1d5eb5[_0x59c6('0x34')]=_[_0x59c6('0x33')](_0x7abb2a[_0x59c6('0x2f')],qs[_0x59c6('0x35')](_0x2c42df[_0x59c6('0x31')]['fields']));_0x1d5eb5[_0x59c6('0x34')]=_0x1d5eb5[_0x59c6('0x34')][_0x59c6('0x36')]?_0x1d5eb5[_0x59c6('0x34')]:_0x7abb2a['model'];if(_0x2c42df[_0x59c6('0x31')][_0x59c6('0x41')]){_0x1d5eb5[_0x59c6('0x42')]=[{'all':!![]}];}_0x1d5eb5=_['merge']({},_0x1d5eb5,_0x2c42df[_0x59c6('0x3f')]);return db[_0x59c6('0x2b')]['find'](_0x1d5eb5)[_0x59c6('0x24')](handleEntityNotFound(_0x56d22a,null))[_0x59c6('0x24')](respondWithResult(_0x56d22a,null))[_0x59c6('0x44')](handleError(_0x56d22a,null));};exports[_0x59c6('0x49')]=function(_0x274454,_0x176241){return db['VoiceMail'][_0x59c6('0x49')](_0x274454[_0x59c6('0x4a')],{})['then'](function(_0x313f70){var _0x40be35=_0x274454[_0x59c6('0x4b')]['get']({'plain':!![]});if(!_0x40be35)throw new Error(_0x59c6('0x4c'));if(_0x40be35[_0x59c6('0x4d')]===_0x59c6('0x4b')){var _0x223ea0=_0x313f70[_0x59c6('0x26')]({'plain':!![]});var _0x3882e4=_0x59c6('0x27');return db[_0x59c6('0x4e')]['find']({'where':{'name':_0x3882e4,'userProfileId':_0x40be35[_0x59c6('0x4f')]},'raw':!![]})[_0x59c6('0x24')](function(_0xba1d3f){if(_0xba1d3f&&_0xba1d3f[_0x59c6('0x50')]===0x0){return db[_0x59c6('0x51')][_0x59c6('0x49')]({'name':_0x223ea0[_0x59c6('0x2a')],'resourceId':_0x223ea0['id'],'type':_0xba1d3f['name'],'sectionId':_0xba1d3f['id']},{})[_0x59c6('0x24')](function(){return _0x313f70;});}else{return _0x313f70;}})[_0x59c6('0x44')](function(_0x2be7f2){logger[_0x59c6('0x28')](_0x59c6('0x52'),_0x2be7f2);throw _0x2be7f2;});}return _0x313f70;})['then'](respondWithResult(_0x176241,0xc9))['catch'](handleError(_0x176241,null));};exports[_0x59c6('0x23')]=function(_0x393243,_0x5ea371){if(_0x393243[_0x59c6('0x4a')]['id']){delete _0x393243['body']['id'];}return db[_0x59c6('0x2b')][_0x59c6('0x53')]({'where':{'id':_0x393243[_0x59c6('0x46')]['id']}})[_0x59c6('0x24')](handleEntityNotFound(_0x5ea371,null))[_0x59c6('0x24')](saveUpdates(_0x393243[_0x59c6('0x4a')],null))[_0x59c6('0x24')](respondWithResult(_0x5ea371,null))[_0x59c6('0x44')](handleError(_0x5ea371,null));};exports[_0x59c6('0x25')]=function(_0x30386e,_0x5a1eff){return db['VoiceMail'][_0x59c6('0x53')]({'where':{'id':_0x30386e[_0x59c6('0x46')]['id']}})[_0x59c6('0x24')](handleEntityNotFound(_0x5a1eff,null))[_0x59c6('0x24')](removeEntity(_0x5a1eff,null))['catch'](handleError(_0x5a1eff,null));};exports[_0x59c6('0x54')]=function(_0xe490f7,_0x2151a4,_0x3faa10){return db[_0x59c6('0x2b')]['findOne']({'where':{'id':_0xe490f7[_0x59c6('0x46')]['id']}})[_0x59c6('0x24')](handleEntityNotFound(_0x2151a4,null))[_0x59c6('0x24')](function(_0x115fe3){var _0x212937;var _0x201064={},_0x1c0c51={};_0x1c0c51[_0x59c6('0x2f')]=_[_0x59c6('0x47')](db[_0x59c6('0x55')][_0x59c6('0x48')]);_0x1c0c51['query']=_[_0x59c6('0x47')](_0xe490f7['query']);_0x1c0c51[_0x59c6('0x32')]=_['intersection'](_0x1c0c51[_0x59c6('0x2f')],_0x1c0c51[_0x59c6('0x31')]);_0x201064[_0x59c6('0x34')]=_['intersection'](_0x1c0c51[_0x59c6('0x2f')],qs[_0x59c6('0x35')](_0xe490f7[_0x59c6('0x31')][_0x59c6('0x35')]));_0x201064[_0x59c6('0x34')]=_0x201064['attributes'][_0x59c6('0x36')]?_0x201064['attributes']:_0x1c0c51[_0x59c6('0x2f')];if(!_0xe490f7['query'][_0x59c6('0x37')]('nolimit')){_0x201064[_0x59c6('0x1e')]=qs[_0x59c6('0x1e')](_0xe490f7[_0x59c6('0x31')][_0x59c6('0x1e')]);_0x201064[_0x59c6('0x1d')]=qs[_0x59c6('0x1d')](_0xe490f7[_0x59c6('0x31')][_0x59c6('0x1d')]);}_0x201064[_0x59c6('0x39')]=qs['sort'](_0xe490f7[_0x59c6('0x31')][_0x59c6('0x56')]);_0x201064[_0x59c6('0x3a')]=qs[_0x59c6('0x32')](_['pick'](_0xe490f7[_0x59c6('0x31')],_0x1c0c51[_0x59c6('0x32')]));if(_0xe490f7[_0x59c6('0x31')][_0x59c6('0x3c')]){_0x201064[_0x59c6('0x3a')]=_['merge'](_0x201064[_0x59c6('0x3a')],{'$or':_[_0x59c6('0x30')](_0x201064[_0x59c6('0x34')],function(_0x202cf7){var _0x571de4={};_0x571de4[_0x202cf7]={'$like':'%'+_0xe490f7[_0x59c6('0x31')][_0x59c6('0x3c')]+'%'};return _0x571de4;})});}_0x201064['where']=_[_0x59c6('0x3d')](_0x201064[_0x59c6('0x3a')],{'mailboxuser':_0x115fe3['mailbox']});_0x201064=_[_0x59c6('0x3d')]({},_0x201064,_0xe490f7[_0x59c6('0x3f')]);return db[_0x59c6('0x55')]['findAndCountAll'](_0x201064)[_0x59c6('0x24')](respondWithFilteredResult(_0x2151a4,_0x201064));})['catch'](handleError(_0x2151a4,null));}; \ No newline at end of file +var _0xdbb4=['sendStatus','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','pick','where','merge','field','filter','options','VoiceMail','includeAll','include','findAll','rows','catch','params','keys','length','find','create','user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','getMessages','findOne','VoiceMailMessage','findAndCountAll','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','count','offset','set','save','then','destroy','get','Voicemails'];(function(_0x369c59,_0x3e1d5c){var _0x534b0c=function(_0x5a0cd5){while(--_0x5a0cd5){_0x369c59['push'](_0x369c59['shift']());}};_0x534b0c(++_0x3e1d5c);}(_0xdbb4,0xe0));var _0x4dbb=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0xdbb4[_0x36ed48];return _0x51c63a;};'use strict';var pdf=require(_0x4dbb('0x0'));var emlformat=require(_0x4dbb('0x1'));var rimraf=require(_0x4dbb('0x2'));var zipdir=require(_0x4dbb('0x3'));var jsonpatch=require(_0x4dbb('0x4'));var rp=require(_0x4dbb('0x5'));var moment=require('moment');var BPromise=require(_0x4dbb('0x6'));var Mustache=require(_0x4dbb('0x7'));var util=require(_0x4dbb('0x8'));var path=require(_0x4dbb('0x9'));var sox=require(_0x4dbb('0xa'));var csv=require(_0x4dbb('0xb'));var ejs=require(_0x4dbb('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x4dbb('0xd'));var crypto=require('crypto');var jsforce=require(_0x4dbb('0xe'));var deskjs=require(_0x4dbb('0xf'));var toCsv=require(_0x4dbb('0xb'));var querystring=require(_0x4dbb('0x10'));var Papa=require(_0x4dbb('0x11'));var Redis=require('ioredis');var authService=require(_0x4dbb('0x12'));var qs=require(_0x4dbb('0x13'));var as=require(_0x4dbb('0x14'));var hardwareService=require(_0x4dbb('0x15'));var logger=require(_0x4dbb('0x16'))(_0x4dbb('0x17'));var utils=require(_0x4dbb('0x18'));var config=require('../../config/environment');var db=require(_0x4dbb('0x19'))['db'];function respondWithStatusCode(_0x510fac,_0x44929e){_0x44929e=_0x44929e||0xcc;return function(_0x126398){if(_0x126398){return _0x510fac['sendStatus'](_0x44929e);}return _0x510fac[_0x4dbb('0x1a')](_0x44929e)[_0x4dbb('0x1b')]();};}function respondWithResult(_0xfa4840,_0x23a287){_0x23a287=_0x23a287||0xc8;return function(_0x2557e2){if(_0x2557e2){return _0xfa4840['status'](_0x23a287)[_0x4dbb('0x1c')](_0x2557e2);}};}function respondWithFilteredResult(_0x306601,_0x784eb1){return function(_0x164edd){if(_0x164edd){var _0x248f52=_0x164edd[_0x4dbb('0x1d')],_0x2a55ea=_0x784eb1[_0x4dbb('0x1e')],_0x41ee97=_0x784eb1[_0x4dbb('0x1e')]+_0x784eb1['limit'],_0x4e155e;if(_0x41ee97>=_0x248f52){_0x41ee97=_0x248f52;_0x4e155e=0xc8;}else{_0x4e155e=0xce;}_0x306601['status'](_0x4e155e);return _0x306601[_0x4dbb('0x1f')]('Content-Range',_0x2a55ea+'-'+_0x41ee97+'/'+_0x248f52)[_0x4dbb('0x1c')](_0x164edd);}return null;};}function patchUpdates(_0x5e30fc){return function(_0x1e104c){try{jsonpatch['apply'](_0x1e104c,_0x5e30fc,!![]);}catch(_0x2363cb){return BPromise['reject'](_0x2363cb);}return _0x1e104c[_0x4dbb('0x20')]();};}function saveUpdates(_0x15d8cc,_0xcf263c){return function(_0x3c9bc9){if(_0x3c9bc9){return _0x3c9bc9['update'](_0x15d8cc)[_0x4dbb('0x21')](function(_0x42deb5){return _0x42deb5;});}return null;};}function removeEntity(_0x1a909d,_0x5cd4c6){return function(_0x371bb4){if(_0x371bb4){return _0x371bb4[_0x4dbb('0x22')]()['then'](function(){var _0x3c8ec3=_0x371bb4[_0x4dbb('0x23')]({'plain':!![]});var _0x3405e4=_0x4dbb('0x24');return db['UserProfileResource']['destroy']({'where':{'type':_0x3405e4,'resourceId':_0x3c8ec3['id']}})[_0x4dbb('0x21')](function(){return _0x371bb4;});})[_0x4dbb('0x21')](function(){_0x1a909d[_0x4dbb('0x1a')](0xcc)[_0x4dbb('0x1b')]();});}};}function handleEntityNotFound(_0x1e3c39,_0x29bbf3){return function(_0x4c0963){if(!_0x4c0963){_0x1e3c39[_0x4dbb('0x25')](0x194);}return _0x4c0963;};}function handleError(_0x5ee663,_0x15cb74){_0x15cb74=_0x15cb74||0x1f4;return function(_0x405641){logger[_0x4dbb('0x26')](_0x405641[_0x4dbb('0x27')]);if(_0x405641[_0x4dbb('0x28')]){delete _0x405641[_0x4dbb('0x28')];}_0x5ee663[_0x4dbb('0x1a')](_0x15cb74)['send'](_0x405641);};}exports[_0x4dbb('0x29')]=function(_0x2406c5,_0x3a66ce){var _0x179337={},_0x3458e0={},_0x3d7423={'count':0x0,'rows':[]};var _0x819942=_[_0x4dbb('0x2a')](db['VoiceMail'][_0x4dbb('0x2b')],function(_0x2d2b62){return{'name':_0x2d2b62[_0x4dbb('0x2c')],'type':_0x2d2b62[_0x4dbb('0x2d')][_0x4dbb('0x2e')]};});_0x3458e0[_0x4dbb('0x2f')]=_['map'](_0x819942,_0x4dbb('0x28'));_0x3458e0['query']=_['keys'](_0x2406c5[_0x4dbb('0x30')]);_0x3458e0[_0x4dbb('0x31')]=_[_0x4dbb('0x32')](_0x3458e0[_0x4dbb('0x2f')],_0x3458e0[_0x4dbb('0x30')]);_0x179337[_0x4dbb('0x33')]=_[_0x4dbb('0x32')](_0x3458e0['model'],qs[_0x4dbb('0x34')](_0x2406c5[_0x4dbb('0x30')][_0x4dbb('0x34')]));_0x179337[_0x4dbb('0x33')]=_0x179337[_0x4dbb('0x33')]['length']?_0x179337['attributes']:_0x3458e0['model'];if(!_0x2406c5[_0x4dbb('0x30')][_0x4dbb('0x35')](_0x4dbb('0x36'))){_0x179337[_0x4dbb('0x37')]=qs['limit'](_0x2406c5[_0x4dbb('0x30')][_0x4dbb('0x37')]);_0x179337[_0x4dbb('0x1e')]=qs[_0x4dbb('0x1e')](_0x2406c5[_0x4dbb('0x30')][_0x4dbb('0x1e')]);}_0x179337[_0x4dbb('0x38')]=qs['sort'](_0x2406c5['query'][_0x4dbb('0x39')]);_0x179337['where']=qs[_0x4dbb('0x31')](_[_0x4dbb('0x3a')](_0x2406c5['query'],_0x3458e0[_0x4dbb('0x31')]));if(_0x2406c5[_0x4dbb('0x30')]['filter']){_0x179337[_0x4dbb('0x3b')]=_[_0x4dbb('0x3c')](_0x179337[_0x4dbb('0x3b')],{'$or':_[_0x4dbb('0x2a')](_0x819942,function(_0x427fd8){if(_0x427fd8[_0x4dbb('0x2d')][_0x4dbb('0x2e')]!=='VIRTUAL'){var _0x55d67f={};_0x55d67f[_0x427fd8[_0x4dbb('0x3d')]]={'$like':'%'+_0x2406c5[_0x4dbb('0x30')][_0x4dbb('0x3e')]+'%'};return _0x55d67f;}})});}_0x179337=_[_0x4dbb('0x3c')]({},_0x179337,_0x2406c5[_0x4dbb('0x3f')]);var _0x51789b={'where':_0x179337[_0x4dbb('0x3b')]};return db[_0x4dbb('0x40')][_0x4dbb('0x1d')](_0x51789b)[_0x4dbb('0x21')](function(_0x4fb1f3){_0x3d7423[_0x4dbb('0x1d')]=_0x4fb1f3;if(_0x2406c5[_0x4dbb('0x30')][_0x4dbb('0x41')]){_0x179337[_0x4dbb('0x42')]=[{'all':!![]}];}return db['VoiceMail'][_0x4dbb('0x43')](_0x179337);})['then'](function(_0x2b7932){_0x3d7423[_0x4dbb('0x44')]=_0x2b7932;return _0x3d7423;})[_0x4dbb('0x21')](respondWithFilteredResult(_0x3a66ce,_0x179337))[_0x4dbb('0x45')](handleError(_0x3a66ce,null));};exports['show']=function(_0xdb77c7,_0x36f231){var _0x4a533a={'raw':!![],'where':{'id':_0xdb77c7[_0x4dbb('0x46')]['id']}},_0x578be8={};_0x578be8['model']=_[_0x4dbb('0x47')](db[_0x4dbb('0x40')]['rawAttributes']);_0x578be8[_0x4dbb('0x30')]=_[_0x4dbb('0x47')](_0xdb77c7[_0x4dbb('0x30')]);_0x578be8[_0x4dbb('0x31')]=_[_0x4dbb('0x32')](_0x578be8[_0x4dbb('0x2f')],_0x578be8[_0x4dbb('0x30')]);_0x4a533a[_0x4dbb('0x33')]=_[_0x4dbb('0x32')](_0x578be8[_0x4dbb('0x2f')],qs[_0x4dbb('0x34')](_0xdb77c7[_0x4dbb('0x30')][_0x4dbb('0x34')]));_0x4a533a[_0x4dbb('0x33')]=_0x4a533a['attributes'][_0x4dbb('0x48')]?_0x4a533a[_0x4dbb('0x33')]:_0x578be8[_0x4dbb('0x2f')];if(_0xdb77c7[_0x4dbb('0x30')]['includeAll']){_0x4a533a[_0x4dbb('0x42')]=[{'all':!![]}];}_0x4a533a=_[_0x4dbb('0x3c')]({},_0x4a533a,_0xdb77c7['options']);return db['VoiceMail'][_0x4dbb('0x49')](_0x4a533a)['then'](handleEntityNotFound(_0x36f231,null))['then'](respondWithResult(_0x36f231,null))[_0x4dbb('0x45')](handleError(_0x36f231,null));};exports[_0x4dbb('0x4a')]=function(_0x35058b,_0x4bd6ea){return db[_0x4dbb('0x40')][_0x4dbb('0x4a')](_0x35058b['body'],{})[_0x4dbb('0x21')](function(_0x17649e){var _0x5c28ac=_0x35058b[_0x4dbb('0x4b')][_0x4dbb('0x23')]({'plain':!![]});if(!_0x5c28ac)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5c28ac[_0x4dbb('0x4c')]==='user'){var _0x183517=_0x17649e[_0x4dbb('0x23')]({'plain':!![]});var _0x4219d1=_0x4dbb('0x24');return db['UserProfileSection'][_0x4dbb('0x49')]({'where':{'name':_0x4219d1,'userProfileId':_0x5c28ac[_0x4dbb('0x4d')]},'raw':!![]})[_0x4dbb('0x21')](function(_0x559174){if(_0x559174&&_0x559174[_0x4dbb('0x4e')]===0x0){return db[_0x4dbb('0x4f')][_0x4dbb('0x4a')]({'name':_0x183517[_0x4dbb('0x28')],'resourceId':_0x183517['id'],'type':_0x559174[_0x4dbb('0x28')],'sectionId':_0x559174['id']},{})[_0x4dbb('0x21')](function(){return _0x17649e;});}else{return _0x17649e;}})[_0x4dbb('0x45')](function(_0x34cb5c){logger['error'](_0x4dbb('0x50'),_0x34cb5c);throw _0x34cb5c;});}return _0x17649e;})[_0x4dbb('0x21')](respondWithResult(_0x4bd6ea,0xc9))[_0x4dbb('0x45')](handleError(_0x4bd6ea,null));};exports[_0x4dbb('0x51')]=function(_0x1e7dc5,_0xa758c8){if(_0x1e7dc5[_0x4dbb('0x52')]['id']){delete _0x1e7dc5[_0x4dbb('0x52')]['id'];}return db[_0x4dbb('0x40')]['find']({'where':{'id':_0x1e7dc5[_0x4dbb('0x46')]['id']}})[_0x4dbb('0x21')](handleEntityNotFound(_0xa758c8,null))[_0x4dbb('0x21')](saveUpdates(_0x1e7dc5[_0x4dbb('0x52')],null))[_0x4dbb('0x21')](respondWithResult(_0xa758c8,null))[_0x4dbb('0x45')](handleError(_0xa758c8,null));};exports[_0x4dbb('0x22')]=function(_0x3f283e,_0x45c800){return db[_0x4dbb('0x40')][_0x4dbb('0x49')]({'where':{'id':_0x3f283e['params']['id']}})['then'](handleEntityNotFound(_0x45c800,null))[_0x4dbb('0x21')](removeEntity(_0x45c800,null))[_0x4dbb('0x45')](handleError(_0x45c800,null));};exports[_0x4dbb('0x53')]=function(_0x265740,_0x5d7ce5,_0x318f31){return db['VoiceMail'][_0x4dbb('0x54')]({'where':{'id':_0x265740['params']['id']}})[_0x4dbb('0x21')](handleEntityNotFound(_0x5d7ce5,null))[_0x4dbb('0x21')](function(_0x1a24c4){var _0x239643;var _0x48c663={},_0x2155d0={};_0x2155d0[_0x4dbb('0x2f')]=_[_0x4dbb('0x47')](db[_0x4dbb('0x55')][_0x4dbb('0x2b')]);_0x2155d0[_0x4dbb('0x30')]=_[_0x4dbb('0x47')](_0x265740[_0x4dbb('0x30')]);_0x2155d0[_0x4dbb('0x31')]=_['intersection'](_0x2155d0['model'],_0x2155d0[_0x4dbb('0x30')]);_0x48c663[_0x4dbb('0x33')]=_['intersection'](_0x2155d0[_0x4dbb('0x2f')],qs[_0x4dbb('0x34')](_0x265740[_0x4dbb('0x30')][_0x4dbb('0x34')]));_0x48c663[_0x4dbb('0x33')]=_0x48c663[_0x4dbb('0x33')][_0x4dbb('0x48')]?_0x48c663[_0x4dbb('0x33')]:_0x2155d0['model'];if(!_0x265740[_0x4dbb('0x30')][_0x4dbb('0x35')](_0x4dbb('0x36'))){_0x48c663[_0x4dbb('0x37')]=qs['limit'](_0x265740['query'][_0x4dbb('0x37')]);_0x48c663[_0x4dbb('0x1e')]=qs[_0x4dbb('0x1e')](_0x265740[_0x4dbb('0x30')]['offset']);}_0x48c663['order']=qs[_0x4dbb('0x39')](_0x265740[_0x4dbb('0x30')][_0x4dbb('0x39')]);_0x48c663[_0x4dbb('0x3b')]=qs[_0x4dbb('0x31')](_[_0x4dbb('0x3a')](_0x265740[_0x4dbb('0x30')],_0x2155d0[_0x4dbb('0x31')]));if(_0x265740[_0x4dbb('0x30')][_0x4dbb('0x3e')]){_0x48c663[_0x4dbb('0x3b')]=_[_0x4dbb('0x3c')](_0x48c663[_0x4dbb('0x3b')],{'$or':_[_0x4dbb('0x2a')](_0x48c663[_0x4dbb('0x33')],function(_0x320ca1){var _0x2bc64c={};_0x2bc64c[_0x320ca1]={'$like':'%'+_0x265740[_0x4dbb('0x30')]['filter']+'%'};return _0x2bc64c;})});}_0x48c663[_0x4dbb('0x3b')]=_[_0x4dbb('0x3c')](_0x48c663['where'],{'mailboxuser':_0x1a24c4['mailbox']});_0x48c663=_[_0x4dbb('0x3c')]({},_0x48c663,_0x265740['options']);return db[_0x4dbb('0x55')][_0x4dbb('0x56')](_0x48c663)[_0x4dbb('0x21')](respondWithFilteredResult(_0x5d7ce5,_0x48c663));})['catch'](handleError(_0x5d7ce5,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index e3b51c5..6c3e073 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 _0x6960=['./voiceMail.attributes','define','VoiceMail','voice_voicemail','mailbox_context','mailbox','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x5b0eb5,_0x13d30b){var _0x403a50=function(_0x59e907){while(--_0x59e907){_0x5b0eb5['push'](_0x5b0eb5['shift']());}};_0x403a50(++_0x13d30b);}(_0x6960,0xae));var _0x0696=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x6960[_0x2be8c2];return _0x97f531;};'use strict';var _=require(_0x0696('0x0'));var util=require(_0x0696('0x1'));var logger=require(_0x0696('0x2'))('api');var moment=require(_0x0696('0x3'));var BPromise=require(_0x0696('0x4'));var rp=require(_0x0696('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0696('0x6'));module['exports']=function(_0x4bb49e,_0x5c4e62){return _0x4bb49e[_0x0696('0x7')](_0x0696('0x8'),attributes,{'tableName':_0x0696('0x9'),'paranoid':![],'indexes':[{'name':_0x0696('0xa'),'fields':[_0x0696('0xb'),'context']}],'timestamps':!![]});}; \ No newline at end of file +var _0x1d66=['lodash','util','api','moment','request-promise','path','rimraf','./voiceMail.attributes','exports','define','voice_voicemail','mailbox_context'];(function(_0x49f6ae,_0x2f75b6){var _0x3e4d37=function(_0x372c54){while(--_0x372c54){_0x49f6ae['push'](_0x49f6ae['shift']());}};_0x3e4d37(++_0x2f75b6);}(_0x1d66,0xfc));var _0x61d6=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x1d66[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x61d6('0x0'));var util=require(_0x61d6('0x1'));var logger=require('../../config/logger')(_0x61d6('0x2'));var moment=require(_0x61d6('0x3'));var BPromise=require('bluebird');var rp=require(_0x61d6('0x4'));var fs=require('fs');var path=require(_0x61d6('0x5'));var rimraf=require(_0x61d6('0x6'));var config=require('../../config/environment');var attributes=require(_0x61d6('0x7'));module[_0x61d6('0x8')]=function(_0x5bfdbe,_0x243421){return _0x5bfdbe[_0x61d6('0x9')]('VoiceMail',attributes,{'tableName':_0x61d6('0xa'),'paranoid':![],'indexes':[{'name':_0x61d6('0xb'),'fields':['mailbox','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 2041734..3f9c706 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 _0x8834=['debug','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','info','VoiceMail,\x20%s,\x20%s','request\x20sent'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x8834,0x17c));var _0x4883=function(_0x1ee171,_0x4bf975){_0x1ee171=_0x1ee171-0x0;var _0x386320=_0x8834[_0x1ee171];return _0x386320;};'use strict';var _=require(_0x4883('0x0'));var util=require(_0x4883('0x1'));var moment=require(_0x4883('0x2'));var BPromise=require(_0x4883('0x3'));var rs=require(_0x4883('0x4'));var fs=require('fs');var Redis=require(_0x4883('0x5'));var db=require(_0x4883('0x6'))['db'];var utils=require(_0x4883('0x7'));var logger=require('../../config/logger')(_0x4883('0x8'));var config=require(_0x4883('0x9'));var jayson=require(_0x4883('0xa'));var client=jayson['client'][_0x4883('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x529216,_0x164dcd,_0x1fa3f5){return new BPromise(function(_0x32f00f,_0x5dc9b6){return client[_0x4883('0xc')](_0x529216,_0x1fa3f5)['then'](function(_0x2564ea){logger[_0x4883('0xd')](_0x4883('0xe'),_0x164dcd,_0x4883('0xf'));logger[_0x4883('0x10')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x164dcd,'request\x20sent',JSON[_0x4883('0x11')](_0x2564ea));if(_0x2564ea[_0x4883('0x12')]){if(_0x2564ea[_0x4883('0x12')][_0x4883('0x13')]===0x1f4){logger[_0x4883('0x12')](_0x4883('0xe'),_0x164dcd,_0x2564ea[_0x4883('0x12')][_0x4883('0x14')]);return _0x5dc9b6(_0x2564ea[_0x4883('0x12')][_0x4883('0x14')]);}logger[_0x4883('0x12')](_0x4883('0xe'),_0x164dcd,_0x2564ea[_0x4883('0x12')][_0x4883('0x14')]);return _0x32f00f(_0x2564ea['error']['message']);}else{logger['info']('VoiceMail,\x20%s,\x20%s',_0x164dcd,'request\x20sent');_0x32f00f(_0x2564ea['result']['message']);}})[_0x4883('0x15')](function(_0x16fd35){logger[_0x4883('0x12')](_0x4883('0xe'),_0x164dcd,_0x16fd35);_0x5dc9b6(_0x16fd35);});});} \ No newline at end of file +var _0xa566=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','then','VoiceMail,\x20%s,\x20%s','request\x20sent','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','lodash'];(function(_0x2e70e9,_0xa62fbc){var _0x2686ad=function(_0x3e7e06){while(--_0x3e7e06){_0x2e70e9['push'](_0x2e70e9['shift']());}};_0x2686ad(++_0xa62fbc);}(_0xa566,0x1cb));var _0x6a56=function(_0x578b3b,_0x4e5bf9){_0x578b3b=_0x578b3b-0x0;var _0x593874=_0xa566[_0x578b3b];return _0x593874;};'use strict';var _=require(_0x6a56('0x0'));var util=require(_0x6a56('0x1'));var moment=require(_0x6a56('0x2'));var BPromise=require(_0x6a56('0x3'));var rs=require(_0x6a56('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6a56('0x5'))['db'];var utils=require(_0x6a56('0x6'));var logger=require(_0x6a56('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6a56('0x8'));var client=jayson['client'][_0x6a56('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x42d104,_0x1c969a,_0x4ee4b4){return new BPromise(function(_0x120696,_0x385f45){return client[_0x6a56('0xa')](_0x42d104,_0x4ee4b4)[_0x6a56('0xb')](function(_0x18efc2){logger['info'](_0x6a56('0xc'),_0x1c969a,_0x6a56('0xd'));logger['debug'](_0x6a56('0xe'),_0x1c969a,'request\x20sent',JSON[_0x6a56('0xf')](_0x18efc2));if(_0x18efc2[_0x6a56('0x10')]){if(_0x18efc2['error']['code']===0x1f4){logger[_0x6a56('0x10')](_0x6a56('0xc'),_0x1c969a,_0x18efc2[_0x6a56('0x10')][_0x6a56('0x11')]);return _0x385f45(_0x18efc2[_0x6a56('0x10')][_0x6a56('0x11')]);}logger['error']('VoiceMail,\x20%s,\x20%s',_0x1c969a,_0x18efc2[_0x6a56('0x10')]['message']);return _0x120696(_0x18efc2[_0x6a56('0x10')][_0x6a56('0x11')]);}else{logger[_0x6a56('0x12')](_0x6a56('0xc'),_0x1c969a,_0x6a56('0xd'));_0x120696(_0x18efc2['result']['message']);}})[_0x6a56('0x13')](function(_0x509a6c){logger[_0x6a56('0x10')](_0x6a56('0xc'),_0x1c969a,_0x509a6c);_0x385f45(_0x509a6c);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index ac68c33..0684dbd 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 _0xabce=['../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','index','/:id','show','get','/:id/download','download','post','isAuthenticated','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x2e7daa,_0x44e1a6){var _0x309339=function(_0x1d3186){while(--_0x1d3186){_0x2e7daa['push'](_0x2e7daa['shift']());}};_0x309339(++_0x44e1a6);}(_0xabce,0x103));var _0xeabc=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xabce[_0xea8947];return _0x2455e9;};'use strict';var multer=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var path=require(_0xeabc('0x2'));var timeout=require(_0xeabc('0x3'));var express=require(_0xeabc('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xeabc('0x5'));var config=require(_0xeabc('0x6'));var controller=require(_0xeabc('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xeabc('0x8')]);router['get'](_0xeabc('0x9'),auth['isAuthenticated'](),controller[_0xeabc('0xa')]);router[_0xeabc('0xb')](_0xeabc('0xc'),auth['isAuthenticated'](),controller[_0xeabc('0xd')]);router[_0xeabc('0xe')]('/',auth[_0xeabc('0xf')](),controller[_0xeabc('0x10')]);router[_0xeabc('0x11')](_0xeabc('0x9'),auth[_0xeabc('0xf')](),controller[_0xeabc('0x12')]);router[_0xeabc('0x13')](_0xeabc('0x9'),auth[_0xeabc('0xf')](),controller[_0xeabc('0x14')]);module[_0xeabc('0x15')]=router; \ No newline at end of file +var _0x3f8a=['download','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','/:id','show','/:id/download'];(function(_0x2f5cd4,_0x4b3a32){var _0x587896=function(_0xf0be9c){while(--_0xf0be9c){_0x2f5cd4['push'](_0x2f5cd4['shift']());}};_0x587896(++_0x4b3a32);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x34f75c,_0x29cfa3){_0x34f75c=_0x34f75c-0x0;var _0x4b96cc=_0x3f8a[_0x34f75c];return _0x4b96cc;};'use strict';var multer=require(_0xa3f8('0x0'));var util=require(_0xa3f8('0x1'));var path=require(_0xa3f8('0x2'));var timeout=require(_0xa3f8('0x3'));var express=require('express');var router=express[_0xa3f8('0x4')]();var auth=require(_0xa3f8('0x5'));var interaction=require(_0xa3f8('0x6'));var config=require(_0xa3f8('0x7'));var controller=require(_0xa3f8('0x8'));router[_0xa3f8('0x9')]('/',auth[_0xa3f8('0xa')](),controller[_0xa3f8('0xb')]);router[_0xa3f8('0x9')](_0xa3f8('0xc'),auth[_0xa3f8('0xa')](),controller[_0xa3f8('0xd')]);router[_0xa3f8('0x9')](_0xa3f8('0xe'),auth[_0xa3f8('0xa')](),controller[_0xa3f8('0xf')]);router[_0xa3f8('0x10')]('/',auth['isAuthenticated'](),controller[_0xa3f8('0x11')]);router[_0xa3f8('0x12')](_0xa3f8('0xc'),auth[_0xa3f8('0xa')](),controller['update']);router[_0xa3f8('0x13')](_0xa3f8('0xc'),auth[_0xa3f8('0xa')](),controller[_0xa3f8('0x14')]);module[_0xa3f8('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 9e39e02..9f112e7 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 _0xc563=['sequelize','VIRTUAL','getDataValue','INTEGER','STRING','BLOB','TIMESTAMP'];(function(_0x25e323,_0x20e141){var _0xb39acf=function(_0x5e8bd2){while(--_0x5e8bd2){_0x25e323['push'](_0x25e323['shift']());}};_0xb39acf(++_0x20e141);}(_0xc563,0x12d));var _0x3c56=function(_0x5defc1,_0x3b17e1){_0x5defc1=_0x5defc1-0x0;var _0x568dde=_0xc563[_0x5defc1];return _0x568dde;};'use strict';var Sequelize=require(_0x3c56('0x0'));module['exports']={'name':{'type':Sequelize[_0x3c56('0x1')],'get':function(_0x21c900){return this[_0x3c56('0x2')]('id');}},'msgnum':{'type':Sequelize[_0x3c56('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x3c56('0x4')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x3c56('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0x3c56('0x4')],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize[_0x3c56('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x3c56('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x3c56('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0x3c56('0x5')]('long'),'defaultValue':null},'flag':{'type':Sequelize[_0x3c56('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x3c56('0x4')],'defaultValue':''},'stamp':{'type':_0x3c56('0x6'),'allowNull':![]}}; \ No newline at end of file +var _0xf8b5=['STRING','BLOB','long','TIMESTAMP','sequelize','exports','VIRTUAL','getDataValue','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf8b5,0xb8));var _0x5f8b=function(_0x59d128,_0x14baa7){_0x59d128=_0x59d128-0x0;var _0x2e00cb=_0xf8b5[_0x59d128];return _0x2e00cb;};'use strict';var Sequelize=require(_0x5f8b('0x0'));module[_0x5f8b('0x1')]={'name':{'type':Sequelize[_0x5f8b('0x2')],'get':function(_0x4e6d9c){return this[_0x5f8b('0x3')]('id');}},'msgnum':{'type':Sequelize[_0x5f8b('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x5f8b('0x5')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x5f8b('0x5')],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize[_0x5f8b('0x5')],'defaultValue':''},'duration':{'type':Sequelize[_0x5f8b('0x5')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x5f8b('0x5')],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize[_0x5f8b('0x6')](_0x5f8b('0x7')),'defaultValue':null},'flag':{'type':Sequelize[_0x5f8b('0x5')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x5f8b('0x5')],'defaultValue':''},'stamp':{'type':_0x5f8b('0x8'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 046cb0f..b4740a3 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 _0xed1e=['count','offset','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','VoiceMailMessage','rawAttributes','fieldName','type','key','model','differenceBy','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','field','includeAll','include','findAll','rows','show','options','find','catch','create','body','params','download','recording','msg_id','Sequelize','ValidationError','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json'];(function(_0x24b0ab,_0x19de60){var _0x12112c=function(_0x3977d9){while(--_0x3977d9){_0x24b0ab['push'](_0x24b0ab['shift']());}};_0x12112c(++_0x19de60);}(_0xed1e,0x140));var _0xeed1=function(_0x10d670,_0x178996){_0x10d670=_0x10d670-0x0;var _0x20d6f8=_0xed1e[_0x10d670];return _0x20d6f8;};'use strict';var pdf=require(_0xeed1('0x0'));var emlformat=require(_0xeed1('0x1'));var rimraf=require(_0xeed1('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xeed1('0x3'));var rp=require(_0xeed1('0x4'));var moment=require('moment');var BPromise=require(_0xeed1('0x5'));var Mustache=require('mustache');var util=require(_0xeed1('0x6'));var path=require(_0xeed1('0x7'));var sox=require(_0xeed1('0x8'));var csv=require('to-csv');var ejs=require(_0xeed1('0x9'));var fs=require('fs');var _=require(_0xeed1('0xa'));var squel=require(_0xeed1('0xb'));var crypto=require('crypto');var jsforce=require(_0xeed1('0xc'));var deskjs=require(_0xeed1('0xd'));var toCsv=require(_0xeed1('0xe'));var querystring=require(_0xeed1('0xf'));var Papa=require('papaparse');var Redis=require(_0xeed1('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xeed1('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xeed1('0x12'));var logger=require(_0xeed1('0x13'))(_0xeed1('0x14'));var utils=require(_0xeed1('0x15'));var config=require(_0xeed1('0x16'));var db=require(_0xeed1('0x17'))['db'];function respondWithStatusCode(_0x19ff3e,_0x49ed9d){_0x49ed9d=_0x49ed9d||0xcc;return function(_0x58acde){if(_0x58acde){return _0x19ff3e[_0xeed1('0x18')](_0x49ed9d);}return _0x19ff3e[_0xeed1('0x19')](_0x49ed9d)[_0xeed1('0x1a')]();};}function respondWithResult(_0x29b16c,_0x146d01){_0x146d01=_0x146d01||0xc8;return function(_0x2a13e7){if(_0x2a13e7){return _0x29b16c[_0xeed1('0x19')](_0x146d01)[_0xeed1('0x1b')](_0x2a13e7);}};}function respondWithFilteredResult(_0x176bce,_0x22f1f1){return function(_0x12c7ee){if(_0x12c7ee){var _0xa34d34=_0x12c7ee[_0xeed1('0x1c')],_0x3a4b64=_0x22f1f1[_0xeed1('0x1d')],_0x1df952=_0x22f1f1['offset']+_0x22f1f1[_0xeed1('0x1e')],_0x5e3314;if(_0x1df952>=_0xa34d34){_0x1df952=_0xa34d34;_0x5e3314=0xc8;}else{_0x5e3314=0xce;}_0x176bce[_0xeed1('0x19')](_0x5e3314);return _0x176bce[_0xeed1('0x1f')](_0xeed1('0x20'),_0x3a4b64+'-'+_0x1df952+'/'+_0xa34d34)['json'](_0x12c7ee);}return null;};}function patchUpdates(_0x2a0b85){return function(_0x4be2c6){try{jsonpatch[_0xeed1('0x21')](_0x4be2c6,_0x2a0b85,!![]);}catch(_0x26973c){return BPromise['reject'](_0x26973c);}return _0x4be2c6[_0xeed1('0x22')]();};}function saveUpdates(_0xfafd2d,_0x5deb50){return function(_0x3ed16d){if(_0x3ed16d){return _0x3ed16d[_0xeed1('0x23')](_0xfafd2d)[_0xeed1('0x24')](function(_0x32c030){return _0x32c030;});}return null;};}function removeEntity(_0x2f2165,_0x385b37){return function(_0x29143f){if(_0x29143f){return _0x29143f[_0xeed1('0x25')]()[_0xeed1('0x24')](function(){_0x2f2165[_0xeed1('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e44b7,_0x130524){return function(_0x739ad2){if(!_0x739ad2){_0x2e44b7[_0xeed1('0x18')](0x194);}return _0x739ad2;};}function handleError(_0x565057,_0xf92e5f){_0xf92e5f=_0xf92e5f||0x1f4;return function(_0x15e3b7){logger[_0xeed1('0x26')](_0x15e3b7[_0xeed1('0x27')]);if(_0x15e3b7['name']){delete _0x15e3b7[_0xeed1('0x28')];}_0x565057[_0xeed1('0x19')](_0xf92e5f)[_0xeed1('0x29')](_0x15e3b7);};}exports[_0xeed1('0x2a')]=function(_0x497082,_0x183fef){var _0x1fd11a={},_0x74e57={},_0x5ab9a2={'count':0x0,'rows':[]};var _0x1e234f=_[_0xeed1('0x2b')](db[_0xeed1('0x2c')][_0xeed1('0x2d')],function(_0x5ba79c){return{'name':_0x5ba79c[_0xeed1('0x2e')],'type':_0x5ba79c[_0xeed1('0x2f')][_0xeed1('0x30')]};});_0x74e57[_0xeed1('0x31')]=_[_0xeed1('0x32')](_[_0xeed1('0x2b')](_0x1e234f,_0xeed1('0x28')),[_0xeed1('0x28')]);_0x74e57['query']=_[_0xeed1('0x33')](_0x497082[_0xeed1('0x34')]);_0x74e57[_0xeed1('0x35')]=_[_0xeed1('0x36')](_0x74e57['model'],_0x74e57['query']);_0x1fd11a[_0xeed1('0x37')]=_[_0xeed1('0x36')](_0x74e57[_0xeed1('0x31')],qs[_0xeed1('0x38')](_0x497082[_0xeed1('0x34')]['fields']));_0x1fd11a[_0xeed1('0x37')]=_0x1fd11a[_0xeed1('0x37')][_0xeed1('0x39')]?_0x1fd11a['attributes']:_0x74e57[_0xeed1('0x31')];if(!_0x497082[_0xeed1('0x34')][_0xeed1('0x3a')]('nolimit')){_0x1fd11a[_0xeed1('0x1e')]=qs['limit'](_0x497082[_0xeed1('0x34')][_0xeed1('0x1e')]);_0x1fd11a[_0xeed1('0x1d')]=qs['offset'](_0x497082[_0xeed1('0x34')][_0xeed1('0x1d')]);}_0x1fd11a[_0xeed1('0x3b')]=qs[_0xeed1('0x3c')](_0x497082[_0xeed1('0x34')]['sort']);_0x1fd11a[_0xeed1('0x3d')]=qs[_0xeed1('0x35')](_['pick'](_0x497082[_0xeed1('0x34')],_0x74e57[_0xeed1('0x35')]));if(_0x497082[_0xeed1('0x34')][_0xeed1('0x3e')]){_0x1fd11a[_0xeed1('0x3d')]=_[_0xeed1('0x3f')](_0x1fd11a['where'],{'$or':_[_0xeed1('0x2b')](_0x1e234f,function(_0x3464d0){if(_0x3464d0['type'][_0xeed1('0x30')]!==_0xeed1('0x40')){var _0x3404ae={};_0x3404ae[_0x3464d0[_0xeed1('0x41')]]={'$like':'%'+_0x497082['query'][_0xeed1('0x3e')]+'%'};return _0x3404ae;}})});}_0x1fd11a=_[_0xeed1('0x3f')]({},_0x1fd11a,_0x497082['options']);var _0x5503d9={'where':_0x1fd11a[_0xeed1('0x3d')]};return db[_0xeed1('0x2c')][_0xeed1('0x1c')](_0x5503d9)[_0xeed1('0x24')](function(_0x302972){_0x5ab9a2[_0xeed1('0x1c')]=_0x302972;if(_0x497082[_0xeed1('0x34')][_0xeed1('0x42')]){_0x1fd11a[_0xeed1('0x43')]=[{'all':!![]}];}return db[_0xeed1('0x2c')][_0xeed1('0x44')](_0x1fd11a);})[_0xeed1('0x24')](function(_0x58b567){_0x5ab9a2[_0xeed1('0x45')]=_0x58b567;return _0x5ab9a2;})[_0xeed1('0x24')](respondWithFilteredResult(_0x183fef,_0x1fd11a))['catch'](handleError(_0x183fef,null));};exports[_0xeed1('0x46')]=function(_0x13e63d,_0x5b9506){var _0x18dbf8={'raw':!![],'where':{'id':_0x13e63d['params']['id']}},_0x15ca3e={};_0x15ca3e[_0xeed1('0x31')]=_[_0xeed1('0x33')](db[_0xeed1('0x2c')][_0xeed1('0x2d')]);_0x15ca3e[_0xeed1('0x34')]=_[_0xeed1('0x33')](_0x13e63d['query']);_0x15ca3e['filters']=_[_0xeed1('0x36')](_0x15ca3e[_0xeed1('0x31')],_0x15ca3e[_0xeed1('0x34')]);_0x18dbf8[_0xeed1('0x37')]=_[_0xeed1('0x36')](_0x15ca3e[_0xeed1('0x31')],qs[_0xeed1('0x38')](_0x13e63d[_0xeed1('0x34')][_0xeed1('0x38')]));_0x18dbf8[_0xeed1('0x37')]=_0x18dbf8[_0xeed1('0x37')][_0xeed1('0x39')]?_0x18dbf8[_0xeed1('0x37')]:_0x15ca3e['model'];if(_0x13e63d[_0xeed1('0x34')][_0xeed1('0x42')]){_0x18dbf8['include']=[{'all':!![]}];}_0x18dbf8=_['merge']({},_0x18dbf8,_0x13e63d[_0xeed1('0x47')]);return db[_0xeed1('0x2c')][_0xeed1('0x48')](_0x18dbf8)[_0xeed1('0x24')](handleEntityNotFound(_0x5b9506,null))[_0xeed1('0x24')](respondWithResult(_0x5b9506,null))[_0xeed1('0x49')](handleError(_0x5b9506,null));};exports['create']=function(_0x4925f2,_0x490b81){return db[_0xeed1('0x2c')][_0xeed1('0x4a')](_0x4925f2[_0xeed1('0x4b')],{})['then'](respondWithResult(_0x490b81,0xc9))[_0xeed1('0x49')](handleError(_0x490b81,null));};exports[_0xeed1('0x23')]=function(_0x2b1c18,_0x5533f7){if(_0x2b1c18[_0xeed1('0x4b')]['id']){delete _0x2b1c18[_0xeed1('0x4b')]['id'];}return db[_0xeed1('0x2c')][_0xeed1('0x48')]({'where':{'id':_0x2b1c18[_0xeed1('0x4c')]['id']}})[_0xeed1('0x24')](handleEntityNotFound(_0x5533f7,null))['then'](saveUpdates(_0x2b1c18[_0xeed1('0x4b')],null))[_0xeed1('0x24')](respondWithResult(_0x5533f7,null))['catch'](handleError(_0x5533f7,null));};exports[_0xeed1('0x25')]=function(_0x1a99d4,_0x566b77){return db[_0xeed1('0x2c')][_0xeed1('0x48')]({'where':{'id':_0x1a99d4[_0xeed1('0x4c')]['id']}})[_0xeed1('0x24')](handleEntityNotFound(_0x566b77,null))[_0xeed1('0x24')](removeEntity(_0x566b77,null))[_0xeed1('0x49')](handleError(_0x566b77,null));};exports[_0xeed1('0x4d')]=function(_0x389cb2,_0x23c2d8,_0x44deb5){return db['VoiceMailMessage'][_0xeed1('0x48')]({'where':{'id':_0x389cb2[_0xeed1('0x4c')]['id']},'attributes':['id',_0xeed1('0x4e'),_0xeed1('0x4f')]})[_0xeed1('0x24')](handleEntityNotFound(_0x23c2d8,null))[_0xeed1('0x24')](function(_0x510e84){if(_0x510e84){if(!_0x510e84[_0xeed1('0x4e')]){throw new db[(_0xeed1('0x50'))][(_0xeed1('0x51'))]('VoiceMailMessage\x20not\x20found');}var _0x3fe1a2={'Content-Type':_0xeed1('0x52'),'Content-Disposition':_0xeed1('0x53')};if(_0x510e84[_0xeed1('0x4f')]){_0x3fe1a2[_0xeed1('0x54')]=_0xeed1('0x55')+_0x510e84[_0xeed1('0x4f')]+_0xeed1('0x56');}_0x23c2d8['set'](_0x3fe1a2);return _0x23c2d8[_0xeed1('0x29')](new Buffer(_0x510e84['recording']));}})[_0xeed1('0x49')](handleError(_0x23c2d8,null));}; \ No newline at end of file +var _0x5638=['attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','map','field','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','download','recording','msg_id','Sequelize','ValidationError','audio/wav','attachment','.wav\x22','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','index','VoiceMailMessage','rawAttributes','type','model','differenceBy','query','filters','intersection'];(function(_0x31e3d5,_0x3fa1cd){var _0x4da910=function(_0x5dc244){while(--_0x5dc244){_0x31e3d5['push'](_0x31e3d5['shift']());}};_0x4da910(++_0x3fa1cd);}(_0x5638,0x10e));var _0x8563=function(_0x34c29e,_0x59d619){_0x34c29e=_0x34c29e-0x0;var _0x5231fd=_0x5638[_0x34c29e];return _0x5231fd;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x8563('0x0'));var zipdir=require(_0x8563('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8563('0x2'));var moment=require(_0x8563('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x8563('0x4'));var util=require(_0x8563('0x5'));var path=require(_0x8563('0x6'));var sox=require(_0x8563('0x7'));var csv=require(_0x8563('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x8563('0x9'));var crypto=require('crypto');var jsforce=require(_0x8563('0xa'));var deskjs=require(_0x8563('0xb'));var toCsv=require(_0x8563('0x8'));var querystring=require(_0x8563('0xc'));var Papa=require('papaparse');var Redis=require(_0x8563('0xd'));var authService=require(_0x8563('0xe'));var qs=require(_0x8563('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8563('0x10'));var logger=require('../../config/logger')(_0x8563('0x11'));var utils=require('../../config/utils');var config=require(_0x8563('0x12'));var db=require(_0x8563('0x13'))['db'];function respondWithStatusCode(_0x329191,_0x1eeff0){_0x1eeff0=_0x1eeff0||0xcc;return function(_0x3d9410){if(_0x3d9410){return _0x329191[_0x8563('0x14')](_0x1eeff0);}return _0x329191[_0x8563('0x15')](_0x1eeff0)[_0x8563('0x16')]();};}function respondWithResult(_0x3d751f,_0x50c345){_0x50c345=_0x50c345||0xc8;return function(_0x2fc30d){if(_0x2fc30d){return _0x3d751f[_0x8563('0x15')](_0x50c345)['json'](_0x2fc30d);}};}function respondWithFilteredResult(_0x331b07,_0x4376d5){return function(_0x297d64){if(_0x297d64){var _0x18e0eb=_0x297d64[_0x8563('0x17')],_0x4bd541=_0x4376d5[_0x8563('0x18')],_0x559900=_0x4376d5[_0x8563('0x18')]+_0x4376d5['limit'],_0x3b670a;if(_0x559900>=_0x18e0eb){_0x559900=_0x18e0eb;_0x3b670a=0xc8;}else{_0x3b670a=0xce;}_0x331b07[_0x8563('0x15')](_0x3b670a);return _0x331b07[_0x8563('0x19')](_0x8563('0x1a'),_0x4bd541+'-'+_0x559900+'/'+_0x18e0eb)[_0x8563('0x1b')](_0x297d64);}return null;};}function patchUpdates(_0x40706c){return function(_0x2f1012){try{jsonpatch[_0x8563('0x1c')](_0x2f1012,_0x40706c,!![]);}catch(_0x3fe43b){return BPromise[_0x8563('0x1d')](_0x3fe43b);}return _0x2f1012[_0x8563('0x1e')]();};}function saveUpdates(_0x45e6e1,_0x5baaef){return function(_0x55bbcf){if(_0x55bbcf){return _0x55bbcf[_0x8563('0x1f')](_0x45e6e1)[_0x8563('0x20')](function(_0x2c797b){return _0x2c797b;});}return null;};}function removeEntity(_0x1fc732,_0x13f444){return function(_0x28c604){if(_0x28c604){return _0x28c604[_0x8563('0x21')]()[_0x8563('0x20')](function(){_0x1fc732[_0x8563('0x15')](0xcc)[_0x8563('0x16')]();});}};}function handleEntityNotFound(_0x43f04d,_0x2ad926){return function(_0x1ead5d){if(!_0x1ead5d){_0x43f04d[_0x8563('0x14')](0x194);}return _0x1ead5d;};}function handleError(_0xb0054f,_0x2b865e){_0x2b865e=_0x2b865e||0x1f4;return function(_0x27b892){logger['error'](_0x27b892[_0x8563('0x22')]);if(_0x27b892[_0x8563('0x23')]){delete _0x27b892[_0x8563('0x23')];}_0xb0054f[_0x8563('0x15')](_0x2b865e)[_0x8563('0x24')](_0x27b892);};}exports[_0x8563('0x25')]=function(_0xeb3d3d,_0x79307c){var _0x35d165={},_0x2df7ed={},_0x1a815c={'count':0x0,'rows':[]};var _0x5d244b=_['map'](db[_0x8563('0x26')][_0x8563('0x27')],function(_0x36cd6d){return{'name':_0x36cd6d['fieldName'],'type':_0x36cd6d[_0x8563('0x28')]['key']};});_0x2df7ed[_0x8563('0x29')]=_[_0x8563('0x2a')](_['map'](_0x5d244b,_0x8563('0x23')),[_0x8563('0x23')]);_0x2df7ed[_0x8563('0x2b')]=_['keys'](_0xeb3d3d['query']);_0x2df7ed[_0x8563('0x2c')]=_[_0x8563('0x2d')](_0x2df7ed['model'],_0x2df7ed[_0x8563('0x2b')]);_0x35d165[_0x8563('0x2e')]=_['intersection'](_0x2df7ed[_0x8563('0x29')],qs[_0x8563('0x2f')](_0xeb3d3d[_0x8563('0x2b')][_0x8563('0x2f')]));_0x35d165[_0x8563('0x2e')]=_0x35d165['attributes'][_0x8563('0x30')]?_0x35d165[_0x8563('0x2e')]:_0x2df7ed['model'];if(!_0xeb3d3d['query'][_0x8563('0x31')]('nolimit')){_0x35d165[_0x8563('0x32')]=qs[_0x8563('0x32')](_0xeb3d3d['query'][_0x8563('0x32')]);_0x35d165[_0x8563('0x18')]=qs[_0x8563('0x18')](_0xeb3d3d['query'][_0x8563('0x18')]);}_0x35d165[_0x8563('0x33')]=qs['sort'](_0xeb3d3d['query'][_0x8563('0x34')]);_0x35d165[_0x8563('0x35')]=qs[_0x8563('0x2c')](_[_0x8563('0x36')](_0xeb3d3d['query'],_0x2df7ed[_0x8563('0x2c')]));if(_0xeb3d3d[_0x8563('0x2b')][_0x8563('0x37')]){_0x35d165[_0x8563('0x35')]=_[_0x8563('0x38')](_0x35d165[_0x8563('0x35')],{'$or':_[_0x8563('0x39')](_0x5d244b,function(_0x140654){if(_0x140654[_0x8563('0x28')]['key']!=='VIRTUAL'){var _0x276f2c={};_0x276f2c[_0x140654[_0x8563('0x3a')]]={'$like':'%'+_0xeb3d3d['query']['filter']+'%'};return _0x276f2c;}})});}_0x35d165=_[_0x8563('0x38')]({},_0x35d165,_0xeb3d3d[_0x8563('0x3b')]);var _0x3b5cb6={'where':_0x35d165[_0x8563('0x35')]};return db[_0x8563('0x26')][_0x8563('0x17')](_0x3b5cb6)[_0x8563('0x20')](function(_0x5caa43){_0x1a815c['count']=_0x5caa43;if(_0xeb3d3d[_0x8563('0x2b')][_0x8563('0x3c')]){_0x35d165[_0x8563('0x3d')]=[{'all':!![]}];}return db[_0x8563('0x26')][_0x8563('0x3e')](_0x35d165);})['then'](function(_0x2f9a49){_0x1a815c[_0x8563('0x3f')]=_0x2f9a49;return _0x1a815c;})[_0x8563('0x20')](respondWithFilteredResult(_0x79307c,_0x35d165))[_0x8563('0x40')](handleError(_0x79307c,null));};exports[_0x8563('0x41')]=function(_0x39da52,_0x4964de){var _0x428973={'raw':!![],'where':{'id':_0x39da52[_0x8563('0x42')]['id']}},_0x4fcb5a={};_0x4fcb5a[_0x8563('0x29')]=_['keys'](db['VoiceMailMessage'][_0x8563('0x27')]);_0x4fcb5a['query']=_[_0x8563('0x43')](_0x39da52[_0x8563('0x2b')]);_0x4fcb5a['filters']=_[_0x8563('0x2d')](_0x4fcb5a[_0x8563('0x29')],_0x4fcb5a['query']);_0x428973['attributes']=_[_0x8563('0x2d')](_0x4fcb5a[_0x8563('0x29')],qs['fields'](_0x39da52[_0x8563('0x2b')][_0x8563('0x2f')]));_0x428973['attributes']=_0x428973[_0x8563('0x2e')][_0x8563('0x30')]?_0x428973['attributes']:_0x4fcb5a[_0x8563('0x29')];if(_0x39da52[_0x8563('0x2b')][_0x8563('0x3c')]){_0x428973[_0x8563('0x3d')]=[{'all':!![]}];}_0x428973=_[_0x8563('0x38')]({},_0x428973,_0x39da52[_0x8563('0x3b')]);return db[_0x8563('0x26')][_0x8563('0x44')](_0x428973)[_0x8563('0x20')](handleEntityNotFound(_0x4964de,null))[_0x8563('0x20')](respondWithResult(_0x4964de,null))[_0x8563('0x40')](handleError(_0x4964de,null));};exports[_0x8563('0x45')]=function(_0x509cf6,_0x1a066c){return db['VoiceMailMessage'][_0x8563('0x45')](_0x509cf6['body'],{})[_0x8563('0x20')](respondWithResult(_0x1a066c,0xc9))[_0x8563('0x40')](handleError(_0x1a066c,null));};exports['update']=function(_0x9f5e7a,_0x1d479c){if(_0x9f5e7a['body']['id']){delete _0x9f5e7a[_0x8563('0x46')]['id'];}return db['VoiceMailMessage']['find']({'where':{'id':_0x9f5e7a[_0x8563('0x42')]['id']}})[_0x8563('0x20')](handleEntityNotFound(_0x1d479c,null))[_0x8563('0x20')](saveUpdates(_0x9f5e7a[_0x8563('0x46')],null))['then'](respondWithResult(_0x1d479c,null))[_0x8563('0x40')](handleError(_0x1d479c,null));};exports[_0x8563('0x21')]=function(_0x222eb9,_0x2ecf3b){return db['VoiceMailMessage'][_0x8563('0x44')]({'where':{'id':_0x222eb9[_0x8563('0x42')]['id']}})[_0x8563('0x20')](handleEntityNotFound(_0x2ecf3b,null))[_0x8563('0x20')](removeEntity(_0x2ecf3b,null))['catch'](handleError(_0x2ecf3b,null));};exports[_0x8563('0x47')]=function(_0x27897c,_0x55063e,_0x55cc95){return db['VoiceMailMessage']['find']({'where':{'id':_0x27897c[_0x8563('0x42')]['id']},'attributes':['id',_0x8563('0x48'),_0x8563('0x49')]})[_0x8563('0x20')](handleEntityNotFound(_0x55063e,null))[_0x8563('0x20')](function(_0x100a7b){if(_0x100a7b){if(!_0x100a7b[_0x8563('0x48')]){throw new db[(_0x8563('0x4a'))][(_0x8563('0x4b'))]('VoiceMailMessage\x20not\x20found');}var _0x1eb417={'Content-Type':_0x8563('0x4c'),'Content-Disposition':_0x8563('0x4d')};if(_0x100a7b[_0x8563('0x49')]){_0x1eb417['Content-Disposition']='attachment;\x20filename=\x22'+_0x100a7b[_0x8563('0x49')]+_0x8563('0x4e');}_0x55063e[_0x8563('0x19')](_0x1eb417);return _0x55063e[_0x8563('0x24')](new Buffer(_0x100a7b[_0x8563('0x48')]));}})[_0x8563('0x40')](handleError(_0x55063e,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 31f771d..fb3514a 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 _0xf57a=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMailMessage.attributes','define','VoiceMailMessage','voice_voicemail_messages','dir','lodash'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0xf57a,0x1a3));var _0xaf57=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xf57a[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0xaf57('0x0'));var util=require(_0xaf57('0x1'));var logger=require(_0xaf57('0x2'))('api');var moment=require(_0xaf57('0x3'));var BPromise=require(_0xaf57('0x4'));var rp=require(_0xaf57('0x5'));var fs=require('fs');var path=require(_0xaf57('0x6'));var rimraf=require(_0xaf57('0x7'));var config=require(_0xaf57('0x8'));var attributes=require(_0xaf57('0x9'));module['exports']=function(_0x3b70ef,_0x37bca4){return _0x3b70ef[_0xaf57('0xa')](_0xaf57('0xb'),attributes,{'tableName':_0xaf57('0xc'),'paranoid':![],'indexes':[{'name':_0xaf57('0xd'),'fields':[_0xaf57('0xd')]}],'timestamps':![]});}; \ No newline at end of file +var _0x6cca=['voice_voicemail_messages','dir','util','../../config/logger','api','moment','request-promise','../../config/environment','./voiceMailMessage.attributes','exports'];(function(_0x422f1d,_0x28314c){var _0x4e5bc7=function(_0x11b48b){while(--_0x11b48b){_0x422f1d['push'](_0x422f1d['shift']());}};_0x4e5bc7(++_0x28314c);}(_0x6cca,0x1b0));var _0xa6cc=function(_0x65fb83,_0x144ec0){_0x65fb83=_0x65fb83-0x0;var _0x92fc83=_0x6cca[_0x65fb83];return _0x92fc83;};'use strict';var _=require('lodash');var util=require(_0xa6cc('0x0'));var logger=require(_0xa6cc('0x1'))(_0xa6cc('0x2'));var moment=require(_0xa6cc('0x3'));var BPromise=require('bluebird');var rp=require(_0xa6cc('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa6cc('0x5'));var attributes=require(_0xa6cc('0x6'));module[_0xa6cc('0x7')]=function(_0x4ff68d,_0x56163e){return _0x4ff68d['define']('VoiceMailMessage',attributes,{'tableName':_0xa6cc('0x8'),'paranoid':![],'indexes':[{'name':_0xa6cc('0x9'),'fields':['dir']}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index d0a16a9..57ee242 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 _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','VoiceMailMessage,\x20%s,\x20%s','VoiceMailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x360a02,_0x5c1a9c){var _0x563dd3=function(_0x366338){while(--_0x366338){_0x360a02['push'](_0x360a02['shift']());}};_0x563dd3(++_0x5c1a9c);}(_0x2ef3,0xba));var _0x32ef=function(_0x4632f4,_0x2e129f){_0x4632f4=_0x4632f4-0x0;var _0x1f3c5e=_0x2ef3[_0x4632f4];return _0x1f3c5e;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('VoiceMailMessage,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file +var _0x66fa=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','VoiceMailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','VoiceMailMessage,\x20%s,\x20%s','message','catch','lodash'];(function(_0x2ac2fe,_0x35f58a){var _0x3da406=function(_0xa5da16){while(--_0xa5da16){_0x2ac2fe['push'](_0x2ac2fe['shift']());}};_0x3da406(++_0x35f58a);}(_0x66fa,0x117));var _0xa66f=function(_0x515739,_0x51a23d){_0x515739=_0x515739-0x0;var _0x1957b5=_0x66fa[_0x515739];return _0x1957b5;};'use strict';var _=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var moment=require('moment');var BPromise=require(_0xa66f('0x2'));var rs=require(_0xa66f('0x3'));var fs=require('fs');var Redis=require(_0xa66f('0x4'));var db=require(_0xa66f('0x5'))['db'];var utils=require(_0xa66f('0x6'));var logger=require(_0xa66f('0x7'))(_0xa66f('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa66f('0x9')][_0xa66f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2f0b78,_0x1d02fc,_0x38b58b){return new BPromise(function(_0x5096bf,_0x39c1ef){return client['request'](_0x2f0b78,_0x38b58b)[_0xa66f('0xb')](function(_0x597c7c){logger[_0xa66f('0xc')]('VoiceMailMessage,\x20%s,\x20%s',_0x1d02fc,'request\x20sent');logger['debug'](_0xa66f('0xd'),_0x1d02fc,_0xa66f('0xe'),JSON['stringify'](_0x597c7c));if(_0x597c7c[_0xa66f('0xf')]){if(_0x597c7c['error'][_0xa66f('0x10')]===0x1f4){logger['error'](_0xa66f('0x11'),_0x1d02fc,_0x597c7c[_0xa66f('0xf')][_0xa66f('0x12')]);return _0x39c1ef(_0x597c7c['error']['message']);}logger[_0xa66f('0xf')]('VoiceMailMessage,\x20%s,\x20%s',_0x1d02fc,_0x597c7c['error']['message']);return _0x5096bf(_0x597c7c[_0xa66f('0xf')][_0xa66f('0x12')]);}else{logger[_0xa66f('0xc')](_0xa66f('0x11'),_0x1d02fc,_0xa66f('0xe'));_0x5096bf(_0x597c7c['result']['message']);}})[_0xa66f('0x13')](function(_0x32d338){logger[_0xa66f('0xf')](_0xa66f('0x11'),_0x1d02fc,_0x32d338);_0x39c1ef(_0x32d338);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index f4ff7d3..87f40ea 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 _0x63c8=['../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','index','/:id','show','/:id/sounds','getSounds','post','put','update','delete','destroy','/:id/sounds/:id2','exports','path','express','Router','../../components/interaction/service'];(function(_0x12ee51,_0x43b49d){var _0x1ab960=function(_0x2f6aa4){while(--_0x2f6aa4){_0x12ee51['push'](_0x12ee51['shift']());}};_0x1ab960(++_0x43b49d);}(_0x63c8,0xd8));var _0x863c=function(_0x437fcf,_0x44e376){_0x437fcf=_0x437fcf-0x0;var _0x440f64=_0x63c8[_0x437fcf];return _0x440f64;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x863c('0x0'));var timeout=require('connect-timeout');var express=require(_0x863c('0x1'));var router=express[_0x863c('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x863c('0x3'));var config=require(_0x863c('0x4'));var controller=require(_0x863c('0x5'));router[_0x863c('0x6')]('/',auth[_0x863c('0x7')](),controller[_0x863c('0x8')]);router[_0x863c('0x6')](_0x863c('0x9'),auth[_0x863c('0x7')](),controller[_0x863c('0xa')]);router[_0x863c('0x6')](_0x863c('0xb'),auth['isAuthenticated'](),controller[_0x863c('0xc')]);router[_0x863c('0xd')]('/',auth[_0x863c('0x7')](),controller['create']);router[_0x863c('0xd')](_0x863c('0xb'),auth['isAuthenticated'](),controller['addSound']);router[_0x863c('0xe')](_0x863c('0x9'),auth[_0x863c('0x7')](),controller[_0x863c('0xf')]);router[_0x863c('0x10')]('/:id',auth[_0x863c('0x7')](),controller[_0x863c('0x11')]);router['delete'](_0x863c('0x12'),auth[_0x863c('0x7')](),controller['removeSound']);module[_0x863c('0x13')]=router; \ No newline at end of file +var _0xd1ef=['/:id','show','/:id/sounds','getSounds','post','removeSound','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','isAuthenticated','index','get'];(function(_0x51c233,_0x5adce7){var _0x4f9deb=function(_0x454f53){while(--_0x454f53){_0x51c233['push'](_0x51c233['shift']());}};_0x4f9deb(++_0x5adce7);}(_0xd1ef,0x1c8));var _0xfd1e=function(_0xf36fd7,_0x18e791){_0xf36fd7=_0xf36fd7-0x0;var _0x44483a=_0xd1ef[_0xf36fd7];return _0x44483a;};'use strict';var multer=require('multer');var util=require(_0xfd1e('0x0'));var path=require(_0xfd1e('0x1'));var timeout=require(_0xfd1e('0x2'));var express=require(_0xfd1e('0x3'));var router=express[_0xfd1e('0x4')]();var auth=require(_0xfd1e('0x5'));var interaction=require(_0xfd1e('0x6'));var config=require(_0xfd1e('0x7'));var controller=require(_0xfd1e('0x8'));router['get']('/',auth[_0xfd1e('0x9')](),controller[_0xfd1e('0xa')]);router[_0xfd1e('0xb')](_0xfd1e('0xc'),auth[_0xfd1e('0x9')](),controller[_0xfd1e('0xd')]);router[_0xfd1e('0xb')](_0xfd1e('0xe'),auth[_0xfd1e('0x9')](),controller[_0xfd1e('0xf')]);router['post']('/',auth[_0xfd1e('0x9')](),controller['create']);router[_0xfd1e('0x10')](_0xfd1e('0xe'),auth[_0xfd1e('0x9')](),controller['addSound']);router['put']('/:id',auth[_0xfd1e('0x9')](),controller['update']);router['delete'](_0xfd1e('0xc'),auth['isAuthenticated'](),controller['destroy']);router['delete']('/:id/sounds/:id2',auth['isAuthenticated'](),controller[_0xfd1e('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 24287e8..7a0eb4b 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 _0xb6c9=['BOOLEAN','sequelize','exports','STRING','name','ENUM','custom','quietmp3nb','quietmp3','mp3','TIMESTAMP'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0xb6c9,0x114));var _0x9b6c=function(_0x151ed4,_0x23cfb8){_0x151ed4=_0x151ed4-0x0;var _0x1c6f7e=_0xb6c9[_0x151ed4];return _0x1c6f7e;};'use strict';var Sequelize=require(_0x9b6c('0x0'));module[_0x9b6c('0x1')]={'name':{'type':Sequelize[_0x9b6c('0x2')],'allowNull':![],'unique':_0x9b6c('0x3')},'mode':{'type':Sequelize[_0x9b6c('0x4')](_0x9b6c('0x5'),'files','mp3nb',_0x9b6c('0x6'),_0x9b6c('0x7'),_0x9b6c('0x8')),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize[_0x9b6c('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0x9b6c('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0x9b6c('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0x9b6c('0x2')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0x9b6c('0x2')],'allowNull':!![]},'stamp':{'type':_0x9b6c('0x9')},'defaultEntry':{'type':Sequelize[_0x9b6c('0xa')],'defaultValue':0x0}}; \ No newline at end of file +var _0x9196=['name','ENUM','custom','files','alpha','TIMESTAMP','sequelize','STRING'];(function(_0x1b54f5,_0x83ee6a){var _0x3b9975=function(_0x20762a){while(--_0x20762a){_0x1b54f5['push'](_0x1b54f5['shift']());}};_0x3b9975(++_0x83ee6a);}(_0x9196,0xce));var _0x6919=function(_0x69a451,_0x49fd37){_0x69a451=_0x69a451-0x0;var _0x3d6ef5=_0x9196[_0x69a451];return _0x3d6ef5;};'use strict';var Sequelize=require(_0x6919('0x0'));module['exports']={'name':{'type':Sequelize[_0x6919('0x1')],'allowNull':![],'unique':_0x6919('0x2')},'mode':{'type':Sequelize[_0x6919('0x3')](_0x6919('0x4'),_0x6919('0x5'),'mp3nb','quietmp3nb','quietmp3','mp3'),'allowNull':!![],'defaultValue':_0x6919('0x5')},'directory':{'type':Sequelize[_0x6919('0x1')],'allowNull':!![]},'application':{'type':Sequelize[_0x6919('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0x6919('0x1')],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x6919('0x6')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0x6919('0x7')},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js index 8f56a5c..45bba55 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 _0x6f94=['includeAll','find','body','create','sequelize','transaction','mode','files','join','root','server/files/moh','directory','0777','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','unlinkSync','rmdirSync','Sequelize','ValidationError','message','addSound','Sound','findOne','save_name','createdAt','server/files/sounds/converted','%s.%s','extname','symlinkSync','removeSound','id2','format','getSounds','order','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','reject','then','destroy','get','MusicOnHolds','error','stack','name','index','VoiceMusicOnHold','rawAttributes','type','key','map','query','keys','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','field','options','include','findAll','rows','catch','show','params','intersection'];(function(_0x1ae697,_0x599acb){var _0x42bb0b=function(_0x2000f4){while(--_0x2000f4){_0x1ae697['push'](_0x1ae697['shift']());}};_0x42bb0b(++_0x599acb);}(_0x6f94,0x109));var _0x46f9=function(_0x369151,_0x179f72){_0x369151=_0x369151-0x0;var _0x4292d5=_0x6f94[_0x369151];return _0x4292d5;};'use strict';var pdf=require(_0x46f9('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x46f9('0x1'));var zipdir=require(_0x46f9('0x2'));var jsonpatch=require(_0x46f9('0x3'));var rp=require(_0x46f9('0x4'));var moment=require(_0x46f9('0x5'));var BPromise=require(_0x46f9('0x6'));var Mustache=require(_0x46f9('0x7'));var util=require(_0x46f9('0x8'));var path=require(_0x46f9('0x9'));var sox=require(_0x46f9('0xa'));var csv=require(_0x46f9('0xb'));var ejs=require(_0x46f9('0xc'));var fs=require('fs');var _=require(_0x46f9('0xd'));var squel=require(_0x46f9('0xe'));var crypto=require(_0x46f9('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x46f9('0x10'));var toCsv=require(_0x46f9('0xb'));var querystring=require('querystring');var Papa=require(_0x46f9('0x11'));var Redis=require('ioredis');var authService=require(_0x46f9('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x46f9('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x46f9('0x14'))('api');var utils=require(_0x46f9('0x15'));var config=require(_0x46f9('0x16'));var db=require(_0x46f9('0x17'))['db'];function respondWithStatusCode(_0x27d210,_0x1150f5){_0x1150f5=_0x1150f5||0xcc;return function(_0xaec264){if(_0xaec264){return _0x27d210[_0x46f9('0x18')](_0x1150f5);}return _0x27d210[_0x46f9('0x19')](_0x1150f5)[_0x46f9('0x1a')]();};}function respondWithResult(_0x17c6d1,_0x4578fd){_0x4578fd=_0x4578fd||0xc8;return function(_0x5dfc33){if(_0x5dfc33){return _0x17c6d1[_0x46f9('0x19')](_0x4578fd)['json'](_0x5dfc33);}};}function respondWithFilteredResult(_0xae4094,_0x1f4ba3){return function(_0x173046){if(_0x173046){var _0x46759c=_0x173046[_0x46f9('0x1b')],_0xd57697=_0x1f4ba3[_0x46f9('0x1c')],_0x2e5641=_0x1f4ba3[_0x46f9('0x1c')]+_0x1f4ba3[_0x46f9('0x1d')],_0x50b89d;if(_0x2e5641>=_0x46759c){_0x2e5641=_0x46759c;_0x50b89d=0xc8;}else{_0x50b89d=0xce;}_0xae4094[_0x46f9('0x19')](_0x50b89d);return _0xae4094[_0x46f9('0x1e')](_0x46f9('0x1f'),_0xd57697+'-'+_0x2e5641+'/'+_0x46759c)['json'](_0x173046);}return null;};}function patchUpdates(_0x21fb99){return function(_0x34b74){try{jsonpatch[_0x46f9('0x20')](_0x34b74,_0x21fb99,!![]);}catch(_0x4d692a){return BPromise[_0x46f9('0x21')](_0x4d692a);}return _0x34b74['save']();};}function saveUpdates(_0x5ae171,_0x96b750){return function(_0x2db27f){if(_0x2db27f){return _0x2db27f['update'](_0x5ae171)[_0x46f9('0x22')](function(_0x3d5557){return _0x3d5557;});}return null;};}function removeEntity(_0x84db74,_0x293a54){return function(_0xaecc5a){if(_0xaecc5a){return _0xaecc5a[_0x46f9('0x23')]()[_0x46f9('0x22')](function(){var _0x18dfe9=_0xaecc5a[_0x46f9('0x24')]({'plain':!![]});var _0x541856=_0x46f9('0x25');return db['UserProfileResource'][_0x46f9('0x23')]({'where':{'type':_0x541856,'resourceId':_0x18dfe9['id']}})[_0x46f9('0x22')](function(){return _0xaecc5a;});})[_0x46f9('0x22')](function(){_0x84db74[_0x46f9('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16dd45,_0x53af1a){return function(_0x444dd3){if(!_0x444dd3){_0x16dd45[_0x46f9('0x18')](0x194);}return _0x444dd3;};}function handleError(_0x46c3b2,_0x183d7c){_0x183d7c=_0x183d7c||0x1f4;return function(_0x43bbb6){logger[_0x46f9('0x26')](_0x43bbb6[_0x46f9('0x27')]);if(_0x43bbb6[_0x46f9('0x28')]){delete _0x43bbb6[_0x46f9('0x28')];}_0x46c3b2['status'](_0x183d7c)['send'](_0x43bbb6);};}exports[_0x46f9('0x29')]=function(_0x5c35c8,_0x12ac29){var _0xdebb0={},_0x257e9d={},_0x6dde00={'count':0x0,'rows':[]};var _0x12ee5e=_['map'](db[_0x46f9('0x2a')][_0x46f9('0x2b')],function(_0x5b35d0){return{'name':_0x5b35d0['fieldName'],'type':_0x5b35d0[_0x46f9('0x2c')][_0x46f9('0x2d')]};});_0x257e9d['model']=_[_0x46f9('0x2e')](_0x12ee5e,_0x46f9('0x28'));_0x257e9d[_0x46f9('0x2f')]=_[_0x46f9('0x30')](_0x5c35c8[_0x46f9('0x2f')]);_0x257e9d['filters']=_['intersection'](_0x257e9d[_0x46f9('0x31')],_0x257e9d[_0x46f9('0x2f')]);_0xdebb0[_0x46f9('0x32')]=_['intersection'](_0x257e9d[_0x46f9('0x31')],qs[_0x46f9('0x33')](_0x5c35c8[_0x46f9('0x2f')][_0x46f9('0x33')]));_0xdebb0[_0x46f9('0x32')]=_0xdebb0[_0x46f9('0x32')][_0x46f9('0x34')]?_0xdebb0[_0x46f9('0x32')]:_0x257e9d[_0x46f9('0x31')];if(!_0x5c35c8[_0x46f9('0x2f')][_0x46f9('0x35')](_0x46f9('0x36'))){_0xdebb0[_0x46f9('0x1d')]=qs[_0x46f9('0x1d')](_0x5c35c8[_0x46f9('0x2f')][_0x46f9('0x1d')]);_0xdebb0['offset']=qs[_0x46f9('0x1c')](_0x5c35c8[_0x46f9('0x2f')]['offset']);}_0xdebb0['order']=qs[_0x46f9('0x37')](_0x5c35c8[_0x46f9('0x2f')]['sort']);_0xdebb0[_0x46f9('0x38')]=qs[_0x46f9('0x39')](_[_0x46f9('0x3a')](_0x5c35c8['query'],_0x257e9d[_0x46f9('0x39')]));if(_0x5c35c8[_0x46f9('0x2f')][_0x46f9('0x3b')]){_0xdebb0[_0x46f9('0x38')]=_[_0x46f9('0x3c')](_0xdebb0[_0x46f9('0x38')],{'$or':_[_0x46f9('0x2e')](_0x12ee5e,function(_0x383b79){if(_0x383b79[_0x46f9('0x2c')][_0x46f9('0x2d')]!==_0x46f9('0x3d')){var _0x20767f={};_0x20767f[_0x383b79[_0x46f9('0x3e')]]={'$like':'%'+_0x5c35c8[_0x46f9('0x2f')]['filter']+'%'};return _0x20767f;}})});}_0xdebb0=_[_0x46f9('0x3c')]({},_0xdebb0,_0x5c35c8[_0x46f9('0x3f')]);var _0x3696e5={'where':_0xdebb0[_0x46f9('0x38')]};return db['VoiceMusicOnHold']['count'](_0x3696e5)[_0x46f9('0x22')](function(_0x22c819){_0x6dde00[_0x46f9('0x1b')]=_0x22c819;if(_0x5c35c8[_0x46f9('0x2f')]['includeAll']){_0xdebb0[_0x46f9('0x40')]=[{'all':!![]}];}return db[_0x46f9('0x2a')][_0x46f9('0x41')](_0xdebb0);})[_0x46f9('0x22')](function(_0x54f869){_0x6dde00[_0x46f9('0x42')]=_0x54f869;return _0x6dde00;})[_0x46f9('0x22')](respondWithFilteredResult(_0x12ac29,_0xdebb0))[_0x46f9('0x43')](handleError(_0x12ac29,null));};exports[_0x46f9('0x44')]=function(_0x4959d2,_0x10ef7c){var _0x5e85f6={'raw':![],'where':{'id':_0x4959d2[_0x46f9('0x45')]['id']}},_0xee13db={};_0xee13db['model']=_[_0x46f9('0x30')](db[_0x46f9('0x2a')][_0x46f9('0x2b')]);_0xee13db[_0x46f9('0x2f')]=_['keys'](_0x4959d2['query']);_0xee13db[_0x46f9('0x39')]=_[_0x46f9('0x46')](_0xee13db[_0x46f9('0x31')],_0xee13db[_0x46f9('0x2f')]);_0x5e85f6['attributes']=_['intersection'](_0xee13db[_0x46f9('0x31')],qs[_0x46f9('0x33')](_0x4959d2['query'][_0x46f9('0x33')]));_0x5e85f6[_0x46f9('0x32')]=_0x5e85f6[_0x46f9('0x32')][_0x46f9('0x34')]?_0x5e85f6[_0x46f9('0x32')]:_0xee13db[_0x46f9('0x31')];if(_0x4959d2['query'][_0x46f9('0x47')]){_0x5e85f6[_0x46f9('0x40')]=[{'all':!![]}];}_0x5e85f6=_['merge']({},_0x5e85f6,_0x4959d2[_0x46f9('0x3f')]);return db['VoiceMusicOnHold'][_0x46f9('0x48')](_0x5e85f6)['then'](handleEntityNotFound(_0x10ef7c,null))[_0x46f9('0x22')](respondWithResult(_0x10ef7c,null))[_0x46f9('0x43')](handleError(_0x10ef7c,null));};exports['update']=function(_0x588d8e,_0x58e0a4){if(_0x588d8e[_0x46f9('0x49')]['id']){delete _0x588d8e['body']['id'];}return db[_0x46f9('0x2a')][_0x46f9('0x48')]({'where':{'id':_0x588d8e['params']['id']}})[_0x46f9('0x22')](handleEntityNotFound(_0x58e0a4,null))[_0x46f9('0x22')](saveUpdates(_0x588d8e[_0x46f9('0x49')],null))[_0x46f9('0x22')](respondWithResult(_0x58e0a4,null))[_0x46f9('0x43')](handleError(_0x58e0a4,null));};exports[_0x46f9('0x4a')]=function(_0x2c6e72,_0x9ad3d6,_0x27b754){return db[_0x46f9('0x4b')][_0x46f9('0x4c')](function(_0xe2d23f){if(_0x2c6e72[_0x46f9('0x49')][_0x46f9('0x4d')]===_0x46f9('0x4e')){_0x2c6e72['body']['directory']=path[_0x46f9('0x4f')](config[_0x46f9('0x50')],_0x46f9('0x51'),_0x2c6e72['body']['name']);}return db[_0x46f9('0x2a')][_0x46f9('0x4a')](_0x2c6e72[_0x46f9('0x49')],{'transaction':_0xe2d23f})[_0x46f9('0x22')](function(_0x5f0f47){if(_0x2c6e72['body'][_0x46f9('0x4d')]===_0x46f9('0x4e')){fs['mkdirSync'](_0x5f0f47[_0x46f9('0x52')],parseInt(_0x46f9('0x53'),0x8));}var _0x35aa57=_0x2c6e72[_0x46f9('0x54')]['get']({'plain':!![]});if(!_0x35aa57)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x35aa57[_0x46f9('0x55')]==='user'){var _0x3a4fd3=_0x5f0f47[_0x46f9('0x24')]({'plain':!![]});return db[_0x46f9('0x56')][_0x46f9('0x48')]({'where':{'name':_0x46f9('0x25'),'userProfileId':_0x35aa57[_0x46f9('0x57')]},'raw':!![]})[_0x46f9('0x22')](function(_0x2d8856){if(_0x2d8856&&_0x2d8856[_0x46f9('0x58')]===0x0){return db[_0x46f9('0x59')][_0x46f9('0x4a')]({'name':_0x3a4fd3['name'],'resourceId':_0x3a4fd3['id'],'type':_0x2d8856[_0x46f9('0x28')],'sectionId':_0x2d8856['id']},{})[_0x46f9('0x22')](function(){return _0x5f0f47;});}else{return _0x5f0f47;}})[_0x46f9('0x43')](function(_0x29a527){logger[_0x46f9('0x26')](_0x46f9('0x5a'),_0x29a527);});}return _0x5f0f47;});})[_0x46f9('0x22')](respondWithResult(_0x9ad3d6,0xc9))[_0x46f9('0x43')](handleError(_0x9ad3d6,null));};exports[_0x46f9('0x23')]=function(_0x7b8f18,_0x7f451,_0x2e7d5f){var _0x232f00;return db[_0x46f9('0x2a')]['find']({'where':{'id':_0x7b8f18[_0x46f9('0x45')]['id']}})[_0x46f9('0x22')](function(_0x395b19){if(_0x395b19){return db['sequelize'][_0x46f9('0x4c')](function(_0x2da313){return _0x395b19['destroy']({'transaction':_0x2da313,'raw':!![]})['then'](function(_0x1c5968){if(_0x1c5968['directory']){fs[_0x46f9('0x5b')](_0x1c5968[_0x46f9('0x52')])[_0x46f9('0x5c')](function(_0x64b3fa){fs[_0x46f9('0x5d')](path[_0x46f9('0x4f')](_0x1c5968['directory'],_0x64b3fa));});fs[_0x46f9('0x5e')](_0x1c5968[_0x46f9('0x52')]);}return _0x1c5968;});})['catch'](function(_0x403b25){throw new db[(_0x46f9('0x5f'))][(_0x46f9('0x60'))](_0x403b25[_0x46f9('0x61')]);});}})[_0x46f9('0x22')](handleEntityNotFound(_0x7f451,null))[_0x46f9('0x22')](removeEntity(_0x7f451,null))['catch'](handleError(_0x7f451,null));};exports[_0x46f9('0x62')]=function(_0x5a544e,_0x5610f9,_0x547fc0){return db[_0x46f9('0x4b')][_0x46f9('0x4c')](function(_0x7f96b){var _0x581549;return db[_0x46f9('0x2a')][_0x46f9('0x48')]({'where':{'id':_0x5a544e[_0x46f9('0x45')]['id']}})['then'](function(_0x4516e4){if(_0x4516e4){_0x581549=_0x4516e4;return _0x4516e4[_0x46f9('0x62')](_0x5a544e[_0x46f9('0x49')]['id'],{'transaction':_0x7f96b});}})['then'](function(_0x158dd7){if(_0x158dd7){return db[_0x46f9('0x63')][_0x46f9('0x64')]({'where':{'id':_0x5a544e['body']['id']},'attributes':['id',_0x46f9('0x28'),_0x46f9('0x65'),'converted_format',_0x46f9('0x66')],'raw':!![]});}})['then'](function(_0x38df75){if(_0x38df75){var _0x31e062=path[_0x46f9('0x4f')](config[_0x46f9('0x50')],_0x46f9('0x67'),util['format'](_0x46f9('0x68'),path['basename'](_0x38df75['save_name'],path[_0x46f9('0x69')](_0x38df75['save_name'])),_0x38df75['converted_format']));var _0x375a2a=path[_0x46f9('0x4f')](config[_0x46f9('0x50')],_0x46f9('0x51'),_0x581549[_0x46f9('0x28')],util['format'](_0x46f9('0x68'),_0x38df75['name'],_0x38df75['converted_format']));fs[_0x46f9('0x6a')](_0x31e062,_0x375a2a);return _0x38df75;}})['catch'](function(_0x5ba61c){throw new db['Sequelize'][(_0x46f9('0x60'))](_0x5ba61c[_0x46f9('0x61')]);});})[_0x46f9('0x22')](handleEntityNotFound(_0x5610f9,null))[_0x46f9('0x22')](respondWithResult(_0x5610f9,0xc9))[_0x46f9('0x43')](handleError(_0x5610f9,null));};exports[_0x46f9('0x6b')]=function(_0x10e856,_0xfcd1c6,_0x374c58){return db[_0x46f9('0x4b')][_0x46f9('0x4c')](function(_0x3fb6a9){var _0x191a28;return db[_0x46f9('0x2a')][_0x46f9('0x64')]({'where':{'id':_0x10e856[_0x46f9('0x45')]['id']}})[_0x46f9('0x22')](handleEntityNotFound(_0xfcd1c6,null))[_0x46f9('0x22')](function(_0x8eaa8b){if(_0x8eaa8b){_0x191a28=_0x8eaa8b;return _0x8eaa8b[_0x46f9('0x6b')](_0x10e856[_0x46f9('0x45')][_0x46f9('0x6c')]);}})[_0x46f9('0x22')](function(_0x3db6f5){if(_0x3db6f5){return db[_0x46f9('0x63')][_0x46f9('0x64')]({'where':{'id':_0x10e856[_0x46f9('0x45')][_0x46f9('0x6c')]},'attributes':['id',_0x46f9('0x28'),_0x46f9('0x65'),'converted_format',_0x46f9('0x66')],'raw':!![]});}})[_0x46f9('0x22')](function(_0x3bb1e7){if(_0x3bb1e7){fs['unlinkSync'](path[_0x46f9('0x4f')](_0x191a28[_0x46f9('0x52')],util[_0x46f9('0x6d')]('%s.%s',_0x3bb1e7['name'],_0x3bb1e7['converted_format'])));return _0x3bb1e7;}})['catch'](function(_0x3eaee7){throw new db[(_0x46f9('0x5f'))][(_0x46f9('0x60'))](_0x3eaee7[_0x46f9('0x61')]);});})[_0x46f9('0x22')](handleEntityNotFound(_0xfcd1c6,null))['then'](respondWithStatusCode(_0xfcd1c6,0xcc))['catch'](handleError(_0xfcd1c6,null));};exports[_0x46f9('0x6e')]=function(_0xc52a9e,_0x518a21,_0xec8a63){var _0x2d2f21={};var _0x586e4d={};var _0x3ad0b2;var _0x5ea050;return db[_0x46f9('0x2a')][_0x46f9('0x64')]({'where':{'id':_0xc52a9e['params']['id']}})[_0x46f9('0x22')](handleEntityNotFound(_0x518a21,null))[_0x46f9('0x22')](function(_0x497503){if(_0x497503){_0x3ad0b2=_0x497503;_0x586e4d[_0x46f9('0x31')]=_[_0x46f9('0x30')](db[_0x46f9('0x63')][_0x46f9('0x2b')]);_0x586e4d[_0x46f9('0x2f')]=_[_0x46f9('0x30')](_0xc52a9e[_0x46f9('0x2f')]);_0x586e4d[_0x46f9('0x39')]=_[_0x46f9('0x46')](_0x586e4d['model'],_0x586e4d['query']);_0x2d2f21[_0x46f9('0x32')]=_[_0x46f9('0x46')](_0x586e4d['model'],qs[_0x46f9('0x33')](_0xc52a9e[_0x46f9('0x2f')][_0x46f9('0x33')]));_0x2d2f21[_0x46f9('0x32')]=_0x2d2f21[_0x46f9('0x32')][_0x46f9('0x34')]?_0x2d2f21[_0x46f9('0x32')]:_0x586e4d[_0x46f9('0x31')];_0x2d2f21[_0x46f9('0x6f')]=qs[_0x46f9('0x37')](_0xc52a9e[_0x46f9('0x2f')][_0x46f9('0x37')]);_0x2d2f21[_0x46f9('0x38')]=qs[_0x46f9('0x39')](_[_0x46f9('0x3a')](_0xc52a9e[_0x46f9('0x2f')],_0x586e4d['filters']));if(_0xc52a9e['query']['filter']){_0x2d2f21[_0x46f9('0x38')]=_['merge'](_0x2d2f21['where'],{'$or':_['map'](_0x2d2f21[_0x46f9('0x32')],function(_0x12ca7c){var _0x515172={};_0x515172[_0x12ca7c]={'$like':'%'+_0xc52a9e[_0x46f9('0x2f')]['filter']+'%'};return _0x515172;})});}_0x2d2f21=_[_0x46f9('0x3c')]({},_0x2d2f21,_0xc52a9e[_0x46f9('0x3f')]);return _0x3ad0b2[_0x46f9('0x6e')](_0x2d2f21);}})['then'](function(_0x6495da){if(_0x6495da){_0x5ea050=_0x6495da[_0x46f9('0x34')];if(!_0xc52a9e[_0x46f9('0x2f')][_0x46f9('0x35')]('nolimit')){_0x2d2f21[_0x46f9('0x1d')]=qs[_0x46f9('0x1d')](_0xc52a9e[_0x46f9('0x2f')]['limit']);_0x2d2f21[_0x46f9('0x1c')]=qs['offset'](_0xc52a9e['query'][_0x46f9('0x1c')]);}return _0x3ad0b2[_0x46f9('0x6e')](_0x2d2f21);}})[_0x46f9('0x22')](function(_0xa8c9cf){if(_0xa8c9cf){return _0xa8c9cf?{'count':_0x5ea050,'rows':_0xa8c9cf}:null;}})['then'](respondWithResult(_0x518a21,null))[_0x46f9('0x43')](handleError(_0x518a21,null));}; \ No newline at end of file +var _0xe8cf=['fields','hasOwnProperty','order','sort','where','pick','VIRTUAL','field','options','findAll','rows','catch','show','params','length','includeAll','include','find','body','create','sequelize','transaction','mode','files','directory','root','server/files/moh','mkdirSync','user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','unlinkSync','rmdirSync','Sequelize','message','addSound','Sound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','format','extname','join','ValidationError','removeSound','id2','%s.%s','filter','merge','nolimit','getSounds','html-pdf','rimraf','zip-dir','fast-json-patch','moment','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','then','destroy','get','MusicOnHolds','UserProfileResource','stack','name','send','index','map','VoiceMusicOnHold','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes'];(function(_0x51639a,_0x35f006){var _0x3abae4=function(_0x89b35e){while(--_0x89b35e){_0x51639a['push'](_0x51639a['shift']());}};_0x3abae4(++_0x35f006);}(_0xe8cf,0x124));var _0xfe8c=function(_0x1752b9,_0x49f163){_0x1752b9=_0x1752b9-0x0;var _0xacea72=_0xe8cf[_0x1752b9];return _0xacea72;};'use strict';var pdf=require(_0xfe8c('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xfe8c('0x1'));var zipdir=require(_0xfe8c('0x2'));var jsonpatch=require(_0xfe8c('0x3'));var rp=require('request-promise');var moment=require(_0xfe8c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xfe8c('0x5'));var util=require('util');var path=require(_0xfe8c('0x6'));var sox=require('sox');var csv=require(_0xfe8c('0x7'));var ejs=require(_0xfe8c('0x8'));var fs=require('fs');var _=require(_0xfe8c('0x9'));var squel=require(_0xfe8c('0xa'));var crypto=require(_0xfe8c('0xb'));var jsforce=require(_0xfe8c('0xc'));var deskjs=require(_0xfe8c('0xd'));var toCsv=require('to-csv');var querystring=require(_0xfe8c('0xe'));var Papa=require(_0xfe8c('0xf'));var Redis=require(_0xfe8c('0x10'));var authService=require(_0xfe8c('0x11'));var qs=require(_0xfe8c('0x12'));var as=require(_0xfe8c('0x13'));var hardwareService=require(_0xfe8c('0x14'));var logger=require(_0xfe8c('0x15'))(_0xfe8c('0x16'));var utils=require(_0xfe8c('0x17'));var config=require(_0xfe8c('0x18'));var db=require(_0xfe8c('0x19'))['db'];function respondWithStatusCode(_0x2907d3,_0x197a93){_0x197a93=_0x197a93||0xcc;return function(_0x3e0a3){if(_0x3e0a3){return _0x2907d3[_0xfe8c('0x1a')](_0x197a93);}return _0x2907d3[_0xfe8c('0x1b')](_0x197a93)[_0xfe8c('0x1c')]();};}function respondWithResult(_0x32bf81,_0x106c26){_0x106c26=_0x106c26||0xc8;return function(_0x5019f0){if(_0x5019f0){return _0x32bf81[_0xfe8c('0x1b')](_0x106c26)[_0xfe8c('0x1d')](_0x5019f0);}};}function respondWithFilteredResult(_0x45f382,_0x354180){return function(_0x3fb352){if(_0x3fb352){var _0x32e808=_0x3fb352[_0xfe8c('0x1e')],_0x3fd5b4=_0x354180[_0xfe8c('0x1f')],_0x1ee707=_0x354180['offset']+_0x354180[_0xfe8c('0x20')],_0x4dd95d;if(_0x1ee707>=_0x32e808){_0x1ee707=_0x32e808;_0x4dd95d=0xc8;}else{_0x4dd95d=0xce;}_0x45f382['status'](_0x4dd95d);return _0x45f382[_0xfe8c('0x21')]('Content-Range',_0x3fd5b4+'-'+_0x1ee707+'/'+_0x32e808)[_0xfe8c('0x1d')](_0x3fb352);}return null;};}function patchUpdates(_0xb20815){return function(_0x16b41a){try{jsonpatch[_0xfe8c('0x22')](_0x16b41a,_0xb20815,!![]);}catch(_0x116b7b){return BPromise[_0xfe8c('0x23')](_0x116b7b);}return _0x16b41a[_0xfe8c('0x24')]();};}function saveUpdates(_0x58e927,_0x4445f9){return function(_0x3f081c){if(_0x3f081c){return _0x3f081c[_0xfe8c('0x25')](_0x58e927)[_0xfe8c('0x26')](function(_0x3446bf){return _0x3446bf;});}return null;};}function removeEntity(_0x5c588c,_0x5e69ce){return function(_0x2866fd){if(_0x2866fd){return _0x2866fd[_0xfe8c('0x27')]()['then'](function(){var _0x53b967=_0x2866fd[_0xfe8c('0x28')]({'plain':!![]});var _0x3d9bc4=_0xfe8c('0x29');return db[_0xfe8c('0x2a')][_0xfe8c('0x27')]({'where':{'type':_0x3d9bc4,'resourceId':_0x53b967['id']}})[_0xfe8c('0x26')](function(){return _0x2866fd;});})[_0xfe8c('0x26')](function(){_0x5c588c[_0xfe8c('0x1b')](0xcc)[_0xfe8c('0x1c')]();});}};}function handleEntityNotFound(_0x5812c6,_0x4c4152){return function(_0x28e0cb){if(!_0x28e0cb){_0x5812c6[_0xfe8c('0x1a')](0x194);}return _0x28e0cb;};}function handleError(_0x4c6d31,_0x4a2eb0){_0x4a2eb0=_0x4a2eb0||0x1f4;return function(_0x47cfd9){logger['error'](_0x47cfd9[_0xfe8c('0x2b')]);if(_0x47cfd9[_0xfe8c('0x2c')]){delete _0x47cfd9[_0xfe8c('0x2c')];}_0x4c6d31[_0xfe8c('0x1b')](_0x4a2eb0)[_0xfe8c('0x2d')](_0x47cfd9);};}exports[_0xfe8c('0x2e')]=function(_0x31e76f,_0x2266bc){var _0x18fb36={},_0x3717f0={},_0x4741c6={'count':0x0,'rows':[]};var _0x2d8c18=_[_0xfe8c('0x2f')](db[_0xfe8c('0x30')][_0xfe8c('0x31')],function(_0x1ee910){return{'name':_0x1ee910[_0xfe8c('0x32')],'type':_0x1ee910[_0xfe8c('0x33')][_0xfe8c('0x34')]};});_0x3717f0[_0xfe8c('0x35')]=_[_0xfe8c('0x2f')](_0x2d8c18,_0xfe8c('0x2c'));_0x3717f0[_0xfe8c('0x36')]=_[_0xfe8c('0x37')](_0x31e76f['query']);_0x3717f0[_0xfe8c('0x38')]=_[_0xfe8c('0x39')](_0x3717f0[_0xfe8c('0x35')],_0x3717f0['query']);_0x18fb36[_0xfe8c('0x3a')]=_[_0xfe8c('0x39')](_0x3717f0[_0xfe8c('0x35')],qs[_0xfe8c('0x3b')](_0x31e76f[_0xfe8c('0x36')][_0xfe8c('0x3b')]));_0x18fb36[_0xfe8c('0x3a')]=_0x18fb36[_0xfe8c('0x3a')]['length']?_0x18fb36[_0xfe8c('0x3a')]:_0x3717f0[_0xfe8c('0x35')];if(!_0x31e76f[_0xfe8c('0x36')][_0xfe8c('0x3c')]('nolimit')){_0x18fb36['limit']=qs[_0xfe8c('0x20')](_0x31e76f[_0xfe8c('0x36')][_0xfe8c('0x20')]);_0x18fb36[_0xfe8c('0x1f')]=qs['offset'](_0x31e76f[_0xfe8c('0x36')][_0xfe8c('0x1f')]);}_0x18fb36[_0xfe8c('0x3d')]=qs[_0xfe8c('0x3e')](_0x31e76f[_0xfe8c('0x36')][_0xfe8c('0x3e')]);_0x18fb36[_0xfe8c('0x3f')]=qs[_0xfe8c('0x38')](_[_0xfe8c('0x40')](_0x31e76f['query'],_0x3717f0[_0xfe8c('0x38')]));if(_0x31e76f[_0xfe8c('0x36')]['filter']){_0x18fb36[_0xfe8c('0x3f')]=_['merge'](_0x18fb36['where'],{'$or':_[_0xfe8c('0x2f')](_0x2d8c18,function(_0x9dea0d){if(_0x9dea0d['type']['key']!==_0xfe8c('0x41')){var _0x5750fd={};_0x5750fd[_0x9dea0d[_0xfe8c('0x42')]]={'$like':'%'+_0x31e76f[_0xfe8c('0x36')]['filter']+'%'};return _0x5750fd;}})});}_0x18fb36=_['merge']({},_0x18fb36,_0x31e76f[_0xfe8c('0x43')]);var _0xf6e5bb={'where':_0x18fb36[_0xfe8c('0x3f')]};return db[_0xfe8c('0x30')]['count'](_0xf6e5bb)[_0xfe8c('0x26')](function(_0x31ea3b){_0x4741c6[_0xfe8c('0x1e')]=_0x31ea3b;if(_0x31e76f['query']['includeAll']){_0x18fb36['include']=[{'all':!![]}];}return db[_0xfe8c('0x30')][_0xfe8c('0x44')](_0x18fb36);})[_0xfe8c('0x26')](function(_0x37f861){_0x4741c6[_0xfe8c('0x45')]=_0x37f861;return _0x4741c6;})[_0xfe8c('0x26')](respondWithFilteredResult(_0x2266bc,_0x18fb36))[_0xfe8c('0x46')](handleError(_0x2266bc,null));};exports[_0xfe8c('0x47')]=function(_0x484c48,_0xf22094){var _0x38210e={'raw':![],'where':{'id':_0x484c48[_0xfe8c('0x48')]['id']}},_0x86aeb={};_0x86aeb[_0xfe8c('0x35')]=_[_0xfe8c('0x37')](db['VoiceMusicOnHold'][_0xfe8c('0x31')]);_0x86aeb[_0xfe8c('0x36')]=_['keys'](_0x484c48[_0xfe8c('0x36')]);_0x86aeb['filters']=_['intersection'](_0x86aeb[_0xfe8c('0x35')],_0x86aeb[_0xfe8c('0x36')]);_0x38210e[_0xfe8c('0x3a')]=_[_0xfe8c('0x39')](_0x86aeb[_0xfe8c('0x35')],qs[_0xfe8c('0x3b')](_0x484c48[_0xfe8c('0x36')]['fields']));_0x38210e['attributes']=_0x38210e['attributes'][_0xfe8c('0x49')]?_0x38210e['attributes']:_0x86aeb[_0xfe8c('0x35')];if(_0x484c48[_0xfe8c('0x36')][_0xfe8c('0x4a')]){_0x38210e[_0xfe8c('0x4b')]=[{'all':!![]}];}_0x38210e=_['merge']({},_0x38210e,_0x484c48[_0xfe8c('0x43')]);return db[_0xfe8c('0x30')][_0xfe8c('0x4c')](_0x38210e)[_0xfe8c('0x26')](handleEntityNotFound(_0xf22094,null))[_0xfe8c('0x26')](respondWithResult(_0xf22094,null))[_0xfe8c('0x46')](handleError(_0xf22094,null));};exports[_0xfe8c('0x25')]=function(_0x1b793c,_0x52b93a){if(_0x1b793c['body']['id']){delete _0x1b793c[_0xfe8c('0x4d')]['id'];}return db['VoiceMusicOnHold'][_0xfe8c('0x4c')]({'where':{'id':_0x1b793c[_0xfe8c('0x48')]['id']}})['then'](handleEntityNotFound(_0x52b93a,null))[_0xfe8c('0x26')](saveUpdates(_0x1b793c[_0xfe8c('0x4d')],null))[_0xfe8c('0x26')](respondWithResult(_0x52b93a,null))['catch'](handleError(_0x52b93a,null));};exports[_0xfe8c('0x4e')]=function(_0x697d2e,_0x43c83d,_0x9a704c){return db[_0xfe8c('0x4f')][_0xfe8c('0x50')](function(_0x56e4b){if(_0x697d2e[_0xfe8c('0x4d')][_0xfe8c('0x51')]===_0xfe8c('0x52')){_0x697d2e['body'][_0xfe8c('0x53')]=path['join'](config[_0xfe8c('0x54')],_0xfe8c('0x55'),_0x697d2e[_0xfe8c('0x4d')][_0xfe8c('0x2c')]);}return db['VoiceMusicOnHold']['create'](_0x697d2e[_0xfe8c('0x4d')],{'transaction':_0x56e4b})[_0xfe8c('0x26')](function(_0x20493d){if(_0x697d2e[_0xfe8c('0x4d')]['mode']==='files'){fs[_0xfe8c('0x56')](_0x20493d[_0xfe8c('0x53')],parseInt('0777',0x8));}var _0xca0558=_0x697d2e[_0xfe8c('0x57')]['get']({'plain':!![]});if(!_0xca0558)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xca0558['role']===_0xfe8c('0x57')){var _0x4e0910=_0x20493d['get']({'plain':!![]});return db[_0xfe8c('0x58')][_0xfe8c('0x4c')]({'where':{'name':'MusicOnHolds','userProfileId':_0xca0558[_0xfe8c('0x59')]},'raw':!![]})[_0xfe8c('0x26')](function(_0x3ea95d){if(_0x3ea95d&&_0x3ea95d[_0xfe8c('0x5a')]===0x0){return db[_0xfe8c('0x2a')][_0xfe8c('0x4e')]({'name':_0x4e0910[_0xfe8c('0x2c')],'resourceId':_0x4e0910['id'],'type':_0x3ea95d[_0xfe8c('0x2c')],'sectionId':_0x3ea95d['id']},{})[_0xfe8c('0x26')](function(){return _0x20493d;});}else{return _0x20493d;}})[_0xfe8c('0x46')](function(_0x429450){logger[_0xfe8c('0x5b')](_0xfe8c('0x5c'),_0x429450);});}return _0x20493d;});})[_0xfe8c('0x26')](respondWithResult(_0x43c83d,0xc9))[_0xfe8c('0x46')](handleError(_0x43c83d,null));};exports['destroy']=function(_0x26ee1a,_0xeed990,_0x5539be){var _0xc12941;return db[_0xfe8c('0x30')][_0xfe8c('0x4c')]({'where':{'id':_0x26ee1a[_0xfe8c('0x48')]['id']}})[_0xfe8c('0x26')](function(_0x50ddda){if(_0x50ddda){return db[_0xfe8c('0x4f')][_0xfe8c('0x50')](function(_0x241b92){return _0x50ddda[_0xfe8c('0x27')]({'transaction':_0x241b92,'raw':!![]})[_0xfe8c('0x26')](function(_0x420b1c){if(_0x420b1c[_0xfe8c('0x53')]){fs[_0xfe8c('0x5d')](_0x420b1c['directory'])[_0xfe8c('0x5e')](function(_0x496e18){fs[_0xfe8c('0x5f')](path['join'](_0x420b1c[_0xfe8c('0x53')],_0x496e18));});fs[_0xfe8c('0x60')](_0x420b1c[_0xfe8c('0x53')]);}return _0x420b1c;});})[_0xfe8c('0x46')](function(_0x4c52d4){throw new db[(_0xfe8c('0x61'))]['ValidationError'](_0x4c52d4[_0xfe8c('0x62')]);});}})['then'](handleEntityNotFound(_0xeed990,null))[_0xfe8c('0x26')](removeEntity(_0xeed990,null))['catch'](handleError(_0xeed990,null));};exports[_0xfe8c('0x63')]=function(_0x140c63,_0x2e8bcf,_0x197447){return db['sequelize']['transaction'](function(_0x1f1894){var _0x19a9c8;return db[_0xfe8c('0x30')][_0xfe8c('0x4c')]({'where':{'id':_0x140c63['params']['id']}})[_0xfe8c('0x26')](function(_0xd5d464){if(_0xd5d464){_0x19a9c8=_0xd5d464;return _0xd5d464[_0xfe8c('0x63')](_0x140c63[_0xfe8c('0x4d')]['id'],{'transaction':_0x1f1894});}})['then'](function(_0xb9ceb9){if(_0xb9ceb9){return db[_0xfe8c('0x64')][_0xfe8c('0x65')]({'where':{'id':_0x140c63[_0xfe8c('0x4d')]['id']},'attributes':['id',_0xfe8c('0x2c'),_0xfe8c('0x66'),_0xfe8c('0x67'),_0xfe8c('0x68')],'raw':!![]});}})[_0xfe8c('0x26')](function(_0x3bc8e3){if(_0x3bc8e3){var _0x41740d=path['join'](config[_0xfe8c('0x54')],_0xfe8c('0x69'),util[_0xfe8c('0x6a')]('%s.%s',path['basename'](_0x3bc8e3[_0xfe8c('0x66')],path[_0xfe8c('0x6b')](_0x3bc8e3[_0xfe8c('0x66')])),_0x3bc8e3[_0xfe8c('0x67')]));var _0x1df1d6=path[_0xfe8c('0x6c')](config[_0xfe8c('0x54')],_0xfe8c('0x55'),_0x19a9c8['name'],util['format']('%s.%s',_0x3bc8e3[_0xfe8c('0x2c')],_0x3bc8e3[_0xfe8c('0x67')]));fs['symlinkSync'](_0x41740d,_0x1df1d6);return _0x3bc8e3;}})[_0xfe8c('0x46')](function(_0x2fecf7){throw new db[(_0xfe8c('0x61'))][(_0xfe8c('0x6d'))](_0x2fecf7[_0xfe8c('0x62')]);});})['then'](handleEntityNotFound(_0x2e8bcf,null))['then'](respondWithResult(_0x2e8bcf,0xc9))[_0xfe8c('0x46')](handleError(_0x2e8bcf,null));};exports[_0xfe8c('0x6e')]=function(_0x8b8454,_0x26a53c,_0x36fca7){return db[_0xfe8c('0x4f')][_0xfe8c('0x50')](function(_0x3729a1){var _0x48b158;return db['VoiceMusicOnHold']['findOne']({'where':{'id':_0x8b8454[_0xfe8c('0x48')]['id']}})[_0xfe8c('0x26')](handleEntityNotFound(_0x26a53c,null))[_0xfe8c('0x26')](function(_0x2c7887){if(_0x2c7887){_0x48b158=_0x2c7887;return _0x2c7887[_0xfe8c('0x6e')](_0x8b8454['params'][_0xfe8c('0x6f')]);}})[_0xfe8c('0x26')](function(_0x373b56){if(_0x373b56){return db[_0xfe8c('0x64')][_0xfe8c('0x65')]({'where':{'id':_0x8b8454['params']['id2']},'attributes':['id',_0xfe8c('0x2c'),_0xfe8c('0x66'),_0xfe8c('0x67'),_0xfe8c('0x68')],'raw':!![]});}})['then'](function(_0x35aaa6){if(_0x35aaa6){fs[_0xfe8c('0x5f')](path[_0xfe8c('0x6c')](_0x48b158[_0xfe8c('0x53')],util[_0xfe8c('0x6a')](_0xfe8c('0x70'),_0x35aaa6[_0xfe8c('0x2c')],_0x35aaa6[_0xfe8c('0x67')])));return _0x35aaa6;}})[_0xfe8c('0x46')](function(_0x530102){throw new db['Sequelize']['ValidationError'](_0x530102['message']);});})[_0xfe8c('0x26')](handleEntityNotFound(_0x26a53c,null))[_0xfe8c('0x26')](respondWithStatusCode(_0x26a53c,0xcc))['catch'](handleError(_0x26a53c,null));};exports['getSounds']=function(_0x17a073,_0x346d91,_0x5ddb6f){var _0x368915={};var _0x4d1ea4={};var _0xdd0bc8;var _0x156d7e;return db['VoiceMusicOnHold'][_0xfe8c('0x65')]({'where':{'id':_0x17a073['params']['id']}})[_0xfe8c('0x26')](handleEntityNotFound(_0x346d91,null))[_0xfe8c('0x26')](function(_0x5419b7){if(_0x5419b7){_0xdd0bc8=_0x5419b7;_0x4d1ea4[_0xfe8c('0x35')]=_[_0xfe8c('0x37')](db[_0xfe8c('0x64')][_0xfe8c('0x31')]);_0x4d1ea4[_0xfe8c('0x36')]=_['keys'](_0x17a073[_0xfe8c('0x36')]);_0x4d1ea4['filters']=_[_0xfe8c('0x39')](_0x4d1ea4[_0xfe8c('0x35')],_0x4d1ea4['query']);_0x368915['attributes']=_[_0xfe8c('0x39')](_0x4d1ea4[_0xfe8c('0x35')],qs[_0xfe8c('0x3b')](_0x17a073[_0xfe8c('0x36')][_0xfe8c('0x3b')]));_0x368915[_0xfe8c('0x3a')]=_0x368915[_0xfe8c('0x3a')]['length']?_0x368915[_0xfe8c('0x3a')]:_0x4d1ea4['model'];_0x368915[_0xfe8c('0x3d')]=qs[_0xfe8c('0x3e')](_0x17a073[_0xfe8c('0x36')][_0xfe8c('0x3e')]);_0x368915['where']=qs['filters'](_[_0xfe8c('0x40')](_0x17a073[_0xfe8c('0x36')],_0x4d1ea4[_0xfe8c('0x38')]));if(_0x17a073[_0xfe8c('0x36')][_0xfe8c('0x71')]){_0x368915[_0xfe8c('0x3f')]=_[_0xfe8c('0x72')](_0x368915[_0xfe8c('0x3f')],{'$or':_[_0xfe8c('0x2f')](_0x368915[_0xfe8c('0x3a')],function(_0x2519f2){var _0x451509={};_0x451509[_0x2519f2]={'$like':'%'+_0x17a073[_0xfe8c('0x36')][_0xfe8c('0x71')]+'%'};return _0x451509;})});}_0x368915=_[_0xfe8c('0x72')]({},_0x368915,_0x17a073[_0xfe8c('0x43')]);return _0xdd0bc8['getSounds'](_0x368915);}})[_0xfe8c('0x26')](function(_0x94227c){if(_0x94227c){_0x156d7e=_0x94227c['length'];if(!_0x17a073[_0xfe8c('0x36')][_0xfe8c('0x3c')](_0xfe8c('0x73'))){_0x368915[_0xfe8c('0x20')]=qs[_0xfe8c('0x20')](_0x17a073[_0xfe8c('0x36')]['limit']);_0x368915[_0xfe8c('0x1f')]=qs[_0xfe8c('0x1f')](_0x17a073['query'][_0xfe8c('0x1f')]);}return _0xdd0bc8[_0xfe8c('0x74')](_0x368915);}})[_0xfe8c('0x26')](function(_0x28ccf1){if(_0x28ccf1){return _0x28ccf1?{'count':_0x156d7e,'rows':_0x28ccf1}:null;}})[_0xfe8c('0x26')](respondWithResult(_0x346d91,null))[_0xfe8c('0x46')](handleError(_0x346d91,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index a3534eb..1cbe8cd 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 _0x1315=['define','VoiceMusicOnHold','voice_musiconhold','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports'];(function(_0x4edb77,_0x55837e){var _0x2496c3=function(_0x233fd8){while(--_0x233fd8){_0x4edb77['push'](_0x4edb77['shift']());}};_0x2496c3(++_0x55837e);}(_0x1315,0xe0));var _0x5131=function(_0x425b19,_0x2dcf14){_0x425b19=_0x425b19-0x0;var _0x15ecab=_0x1315[_0x425b19];return _0x15ecab;};'use strict';var _=require(_0x5131('0x0'));var util=require(_0x5131('0x1'));var logger=require(_0x5131('0x2'))('api');var moment=require(_0x5131('0x3'));var BPromise=require(_0x5131('0x4'));var rp=require(_0x5131('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5131('0x6'));var config=require(_0x5131('0x7'));var attributes=require(_0x5131('0x8'));module[_0x5131('0x9')]=function(_0x3fcfe8,_0x1545e5){return _0x3fcfe8[_0x5131('0xa')](_0x5131('0xb'),attributes,{'tableName':_0x5131('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x586c=['bluebird','request-promise','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define','lodash','util','../../config/logger','api','moment'];(function(_0x3e9324,_0xc6053e){var _0x488004=function(_0x36d31c){while(--_0x36d31c){_0x3e9324['push'](_0x3e9324['shift']());}};_0x488004(++_0xc6053e);}(_0x586c,0x1cf));var _0xc586=function(_0x3f5210,_0x32f195){_0x3f5210=_0x3f5210-0x0;var _0x53c3ab=_0x586c[_0x3f5210];return _0x53c3ab;};'use strict';var _=require(_0xc586('0x0'));var util=require(_0xc586('0x1'));var logger=require(_0xc586('0x2'))(_0xc586('0x3'));var moment=require(_0xc586('0x4'));var BPromise=require(_0xc586('0x5'));var rp=require(_0xc586('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc586('0x7'));var config=require(_0xc586('0x8'));var attributes=require(_0xc586('0x9'));module[_0xc586('0xa')]=function(_0x51d030,_0x1ba8c8){return _0x51d030[_0xc586('0xb')]('VoiceMusicOnHold',attributes,{'tableName':'voice_musiconhold','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 2a3b18d..c667391 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 _0x6449=['randomstring','../../mysqldb','../../config/logger','../../config/environment','http','info','request\x20sent','stringify','error','code','VoiceMusicOnHold,\x20%s,\x20%s','message','result','lodash','moment','bluebird'];(function(_0x24822a,_0x1a763e){var _0x22bcae=function(_0x12c72e){while(--_0x12c72e){_0x24822a['push'](_0x24822a['shift']());}};_0x22bcae(++_0x1a763e);}(_0x6449,0x16d));var _0x9644=function(_0xef8146,_0x459c34){_0xef8146=_0xef8146-0x0;var _0x5a6cb0=_0x6449[_0xef8146];return _0x5a6cb0;};'use strict';var _=require(_0x9644('0x0'));var util=require('util');var moment=require(_0x9644('0x1'));var BPromise=require(_0x9644('0x2'));var rs=require(_0x9644('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9644('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9644('0x5'))('rpc');var config=require(_0x9644('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9644('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x37bb14,_0x15367a,_0x4c330a){return new BPromise(function(_0x35ff42,_0x2742e9){return client['request'](_0x37bb14,_0x4c330a)['then'](function(_0x29072e){logger[_0x9644('0x8')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x15367a,_0x9644('0x9'));logger['debug']('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0x15367a,_0x9644('0x9'),JSON[_0x9644('0xa')](_0x29072e));if(_0x29072e[_0x9644('0xb')]){if(_0x29072e[_0x9644('0xb')][_0x9644('0xc')]===0x1f4){logger[_0x9644('0xb')](_0x9644('0xd'),_0x15367a,_0x29072e[_0x9644('0xb')][_0x9644('0xe')]);return _0x2742e9(_0x29072e[_0x9644('0xb')]['message']);}logger[_0x9644('0xb')](_0x9644('0xd'),_0x15367a,_0x29072e[_0x9644('0xb')]['message']);return _0x35ff42(_0x29072e['error'][_0x9644('0xe')]);}else{logger[_0x9644('0x8')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x15367a,_0x9644('0x9'));_0x35ff42(_0x29072e[_0x9644('0xf')]['message']);}})['catch'](function(_0xced3e2){logger['error'](_0x9644('0xd'),_0x15367a,_0xced3e2);_0x2742e9(_0xced3e2);});});} \ No newline at end of file +var _0x5344=['stringify','code','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x810a78,_0x1e3706){var _0x24a295=function(_0x3c6272){while(--_0x3c6272){_0x810a78['push'](_0x810a78['shift']());}};_0x24a295(++_0x1e3706);}(_0x5344,0x74));var _0x4534=function(_0x55d367,_0x5456c1){_0x55d367=_0x55d367-0x0;var _0xe1bdba=_0x5344[_0x55d367];return _0xe1bdba;};'use strict';var _=require('lodash');var util=require(_0x4534('0x0'));var moment=require(_0x4534('0x1'));var BPromise=require(_0x4534('0x2'));var rs=require(_0x4534('0x3'));var fs=require('fs');var Redis=require(_0x4534('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4534('0x5'));var logger=require(_0x4534('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4534('0x7'));var client=jayson[_0x4534('0x8')][_0x4534('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5121e5,_0x382fc1,_0x16f7e4){return new BPromise(function(_0x13529d,_0x3b6405){return client[_0x4534('0xa')](_0x5121e5,_0x16f7e4)[_0x4534('0xb')](function(_0x1efb6c){logger[_0x4534('0xc')](_0x4534('0xd'),_0x382fc1,_0x4534('0xe'));logger[_0x4534('0xf')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0x382fc1,_0x4534('0xe'),JSON[_0x4534('0x10')](_0x1efb6c));if(_0x1efb6c['error']){if(_0x1efb6c['error'][_0x4534('0x11')]===0x1f4){logger[_0x4534('0x12')](_0x4534('0xd'),_0x382fc1,_0x1efb6c[_0x4534('0x12')]['message']);return _0x3b6405(_0x1efb6c['error']['message']);}logger[_0x4534('0x12')](_0x4534('0xd'),_0x382fc1,_0x1efb6c['error'][_0x4534('0x13')]);return _0x13529d(_0x1efb6c[_0x4534('0x12')][_0x4534('0x13')]);}else{logger[_0x4534('0xc')](_0x4534('0xd'),_0x382fc1,'request\x20sent');_0x13529d(_0x1efb6c[_0x4534('0x14')][_0x4534('0x13')]);}})[_0x4534('0x15')](function(_0x1cfe16){logger[_0x4534('0x12')](_0x4534('0xd'),_0x382fc1,_0x1cfe16);_0x3b6405(_0x1cfe16);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index c8b6ab2..e8fc4f1 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 _0xddcc=['delete','removeAgents','exports','multer','util','express','../../components/auth/service','../../components/interaction/service','./voicePrefix.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/users','getAgents','post','create','addAgents','put','update'];(function(_0xdc6b85,_0x45fcf5){var _0x3839a0=function(_0x1f59e4){while(--_0x1f59e4){_0xdc6b85['push'](_0xdc6b85['shift']());}};_0x3839a0(++_0x45fcf5);}(_0xddcc,0xdf));var _0xcddc=function(_0x3cc8e6,_0x538e4d){_0x3cc8e6=_0x3cc8e6-0x0;var _0x4b6350=_0xddcc[_0x3cc8e6];return _0x4b6350;};'use strict';var multer=require(_0xcddc('0x0'));var util=require(_0xcddc('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xcddc('0x2'));var router=express['Router']();var auth=require(_0xcddc('0x3'));var interaction=require(_0xcddc('0x4'));var config=require('../../config/environment');var controller=require(_0xcddc('0x5'));router[_0xcddc('0x6')]('/',auth[_0xcddc('0x7')](),controller['index']);router[_0xcddc('0x6')](_0xcddc('0x8'),auth['isAuthenticated'](),controller[_0xcddc('0x9')]);router[_0xcddc('0x6')](_0xcddc('0xa'),auth[_0xcddc('0x7')](),controller[_0xcddc('0xb')]);router[_0xcddc('0x6')](_0xcddc('0xc'),auth[_0xcddc('0x7')](),controller[_0xcddc('0xd')]);router[_0xcddc('0xe')]('/',auth[_0xcddc('0x7')](),controller[_0xcddc('0xf')]);router[_0xcddc('0xe')](_0xcddc('0xc'),auth[_0xcddc('0x7')](),controller[_0xcddc('0x10')]);router[_0xcddc('0x11')](_0xcddc('0xa'),auth[_0xcddc('0x7')](),controller[_0xcddc('0x12')]);router['delete'](_0xcddc('0xa'),auth['isAuthenticated'](),controller['destroy']);router[_0xcddc('0x13')](_0xcddc('0xc'),auth[_0xcddc('0x7')](),controller[_0xcddc('0x14')]);module[_0xcddc('0x15')]=router; \ No newline at end of file +var _0xe386=['../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','/describe','describe','show','/:id/users','getAgents','post','addAgents','put','/:id','update','destroy','delete','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x4579f6,_0x59abf6){var _0x3fc71c=function(_0x235956){while(--_0x235956){_0x4579f6['push'](_0x4579f6['shift']());}};_0x3fc71c(++_0x59abf6);}(_0xe386,0xc9));var _0x6e38=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xe386[_0x4a9fb1];return _0x348672;};'use strict';var multer=require('multer');var util=require(_0x6e38('0x0'));var path=require(_0x6e38('0x1'));var timeout=require(_0x6e38('0x2'));var express=require(_0x6e38('0x3'));var router=express[_0x6e38('0x4')]();var auth=require(_0x6e38('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6e38('0x6'));var controller=require(_0x6e38('0x7'));router[_0x6e38('0x8')]('/',auth[_0x6e38('0x9')](),controller[_0x6e38('0xa')]);router['get'](_0x6e38('0xb'),auth[_0x6e38('0x9')](),controller[_0x6e38('0xc')]);router[_0x6e38('0x8')]('/:id',auth[_0x6e38('0x9')](),controller[_0x6e38('0xd')]);router['get'](_0x6e38('0xe'),auth['isAuthenticated'](),controller[_0x6e38('0xf')]);router[_0x6e38('0x10')]('/',auth[_0x6e38('0x9')](),controller['create']);router[_0x6e38('0x10')](_0x6e38('0xe'),auth[_0x6e38('0x9')](),controller[_0x6e38('0x11')]);router[_0x6e38('0x12')](_0x6e38('0x13'),auth['isAuthenticated'](),controller[_0x6e38('0x14')]);router['delete'](_0x6e38('0x13'),auth[_0x6e38('0x9')](),controller[_0x6e38('0x15')]);router[_0x6e38('0x16')](_0x6e38('0xe'),auth[_0x6e38('0x9')](),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 ec6b4f5..2703c69 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 _0x3b1b=['VIRTUAL','INTEGER','exports','STRING','name'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x3b1b,0x75));var _0xb3b1=function(_0x3c6809,_0x5970fd){_0x3c6809=_0x3c6809-0x0;var _0x51d140=_0x3b1b[_0x3c6809];return _0x51d140;};'use strict';var Sequelize=require('sequelize');module[_0xb3b1('0x0')]={'name':{'type':Sequelize[_0xb3b1('0x1')],'allowNull':![],'unique':_0xb3b1('0x2')},'prefix':{'type':Sequelize[_0xb3b1('0x3')],'get':function(_0x284923){return'system-'+this['getDataValue']('name')+'-';}},'description':{'type':Sequelize[_0xb3b1('0x1')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize[_0xb3b1('0x4')]}}; \ No newline at end of file +var _0x7bc9=['STRING','name','VIRTUAL','system-','getDataValue','sequelize','exports'];(function(_0x4080dd,_0x5b595d){var _0x4ecf85=function(_0x5d281a){while(--_0x5d281a){_0x4080dd['push'](_0x4080dd['shift']());}};_0x4ecf85(++_0x5b595d);}(_0x7bc9,0xde));var _0x97bc=function(_0x5f4cdc,_0x25c54e){_0x5f4cdc=_0x5f4cdc-0x0;var _0x4bfb36=_0x7bc9[_0x5f4cdc];return _0x4bfb36;};'use strict';var Sequelize=require(_0x97bc('0x0'));module[_0x97bc('0x1')]={'name':{'type':Sequelize[_0x97bc('0x2')],'allowNull':![],'unique':_0x97bc('0x3')},'prefix':{'type':Sequelize[_0x97bc('0x4')],'get':function(_0x3cea2a){return _0x97bc('0x5')+this[_0x97bc('0x6')](_0x97bc('0x3'))+'-';}},'description':{'type':Sequelize[_0x97bc('0x2')]},'callerIdAll':{'type':Sequelize[_0x97bc('0x2')]},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index e6a376f..d3d2e86 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 _0xa456=['query','keys','filters','intersection','attributes','length','nolimit','offset','sort','where','filter','merge','key','VIRTUAL','field','options','VoicePrefix','count','include','findAll','rows','catch','params','rawAttributes','fields','find','describe','create','body','VoiceExtension','VoiceExtensionId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','VoicePrefixes','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','app','system','description','Voice\x20Prefix\x20Extension','priority','prefix','NoOp','VoicePrefixId','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','${EXTEN:','charAt','sequelize','transaction','findById','addAgents','ids','omit','spread','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','order','pick','hasOwnProperty','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./voicePrefix.socket','status','end','limit','Content-Range','json','apply','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','send','index','map','type','model'];(function(_0x1c68c2,_0x4b47b8){var _0x53deb8=function(_0x57867b){while(--_0x57867b){_0x1c68c2['push'](_0x1c68c2['shift']());}};_0x53deb8(++_0x4b47b8);}(_0xa456,0x142));var _0x6a45=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0xa456[_0x5f309e];return _0x487b5e;};'use strict';var pdf=require(_0x6a45('0x0'));var emlformat=require(_0x6a45('0x1'));var rimraf=require(_0x6a45('0x2'));var zipdir=require(_0x6a45('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6a45('0x4'));var moment=require(_0x6a45('0x5'));var BPromise=require(_0x6a45('0x6'));var Mustache=require('mustache');var util=require(_0x6a45('0x7'));var path=require(_0x6a45('0x8'));var sox=require(_0x6a45('0x9'));var csv=require(_0x6a45('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x6a45('0xb'));var squel=require(_0x6a45('0xc'));var crypto=require(_0x6a45('0xd'));var jsforce=require(_0x6a45('0xe'));var deskjs=require(_0x6a45('0xf'));var toCsv=require('to-csv');var querystring=require(_0x6a45('0x10'));var Papa=require('papaparse');var Redis=require(_0x6a45('0x11'));var authService=require(_0x6a45('0x12'));var qs=require(_0x6a45('0x13'));var as=require(_0x6a45('0x14'));var hardwareService=require(_0x6a45('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x6a45('0x16'));var config=require(_0x6a45('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x6a45('0x18')],{'host':_0x6a45('0x19'),'port':0x18eb});var socket=require(_0x6a45('0x1a'))(new Redis(config[_0x6a45('0x18')]));require(_0x6a45('0x1b'))['register'](socket);function respondWithStatusCode(_0x563c3b,_0x3a5d94){_0x3a5d94=_0x3a5d94||0xcc;return function(_0xd09baf){if(_0xd09baf){return _0x563c3b['sendStatus'](_0x3a5d94);}return _0x563c3b[_0x6a45('0x1c')](_0x3a5d94)[_0x6a45('0x1d')]();};}function respondWithResult(_0x3fab82,_0x13adc0){_0x13adc0=_0x13adc0||0xc8;return function(_0x548634){if(_0x548634){return _0x3fab82['status'](_0x13adc0)['json'](_0x548634);}};}function respondWithFilteredResult(_0x396d7d,_0x391f81){return function(_0x360b7f){if(_0x360b7f){var _0x52a055=_0x360b7f['count'],_0x379c22=_0x391f81['offset'],_0x102981=_0x391f81['offset']+_0x391f81[_0x6a45('0x1e')],_0x3439c8;if(_0x102981>=_0x52a055){_0x102981=_0x52a055;_0x3439c8=0xc8;}else{_0x3439c8=0xce;}_0x396d7d[_0x6a45('0x1c')](_0x3439c8);return _0x396d7d['set'](_0x6a45('0x1f'),_0x379c22+'-'+_0x102981+'/'+_0x52a055)[_0x6a45('0x20')](_0x360b7f);}return null;};}function patchUpdates(_0x4f7000){return function(_0x4f7110){try{jsonpatch[_0x6a45('0x21')](_0x4f7110,_0x4f7000,!![]);}catch(_0x46a13a){return BPromise[_0x6a45('0x22')](_0x46a13a);}return _0x4f7110[_0x6a45('0x23')]();};}function saveUpdates(_0x487666,_0x5d990e){return function(_0x3faae5){if(_0x3faae5){return _0x3faae5[_0x6a45('0x24')](_0x487666)[_0x6a45('0x25')](function(_0x22373c){return _0x22373c;});}return null;};}function removeEntity(_0x25a380,_0x3ad898){return function(_0x170623){if(_0x170623){return _0x170623[_0x6a45('0x26')]()[_0x6a45('0x25')](function(){var _0x18a5b8=_0x170623[_0x6a45('0x27')]({'plain':!![]});var _0x46587a='VoicePrefixes';return db[_0x6a45('0x28')]['destroy']({'where':{'type':_0x46587a,'resourceId':_0x18a5b8['id']}})[_0x6a45('0x25')](function(){return _0x170623;});})[_0x6a45('0x25')](function(){_0x25a380[_0x6a45('0x1c')](0xcc)[_0x6a45('0x1d')]();});}};}function handleEntityNotFound(_0x3ede76,_0x526062){return function(_0x2b8cc8){if(!_0x2b8cc8){_0x3ede76[_0x6a45('0x29')](0x194);}return _0x2b8cc8;};}function handleError(_0x4770cc,_0x1ccff0){_0x1ccff0=_0x1ccff0||0x1f4;return function(_0x8265d9){logger[_0x6a45('0x2a')](_0x8265d9[_0x6a45('0x2b')]);if(_0x8265d9[_0x6a45('0x2c')]){delete _0x8265d9['name'];}_0x4770cc[_0x6a45('0x1c')](_0x1ccff0)[_0x6a45('0x2d')](_0x8265d9);};}exports[_0x6a45('0x2e')]=function(_0x201369,_0x3b07a1){var _0x5dc288={},_0x1f95d4={},_0x1f96bf={'count':0x0,'rows':[]};var _0x367e5b=_[_0x6a45('0x2f')](db['VoicePrefix']['rawAttributes'],function(_0x2a50dc){return{'name':_0x2a50dc['fieldName'],'type':_0x2a50dc[_0x6a45('0x30')]['key']};});_0x1f95d4[_0x6a45('0x31')]=_[_0x6a45('0x2f')](_0x367e5b,_0x6a45('0x2c'));_0x1f95d4[_0x6a45('0x32')]=_[_0x6a45('0x33')](_0x201369[_0x6a45('0x32')]);_0x1f95d4[_0x6a45('0x34')]=_[_0x6a45('0x35')](_0x1f95d4[_0x6a45('0x31')],_0x1f95d4[_0x6a45('0x32')]);_0x5dc288[_0x6a45('0x36')]=_[_0x6a45('0x35')](_0x1f95d4[_0x6a45('0x31')],qs['fields'](_0x201369[_0x6a45('0x32')]['fields']));_0x5dc288[_0x6a45('0x36')]=_0x5dc288[_0x6a45('0x36')][_0x6a45('0x37')]?_0x5dc288[_0x6a45('0x36')]:_0x1f95d4[_0x6a45('0x31')];if(!_0x201369[_0x6a45('0x32')]['hasOwnProperty'](_0x6a45('0x38'))){_0x5dc288[_0x6a45('0x1e')]=qs[_0x6a45('0x1e')](_0x201369[_0x6a45('0x32')][_0x6a45('0x1e')]);_0x5dc288[_0x6a45('0x39')]=qs['offset'](_0x201369[_0x6a45('0x32')][_0x6a45('0x39')]);}_0x5dc288['order']=qs[_0x6a45('0x3a')](_0x201369[_0x6a45('0x32')][_0x6a45('0x3a')]);_0x5dc288[_0x6a45('0x3b')]=qs[_0x6a45('0x34')](_['pick'](_0x201369[_0x6a45('0x32')],_0x1f95d4[_0x6a45('0x34')]));if(_0x201369[_0x6a45('0x32')][_0x6a45('0x3c')]){_0x5dc288[_0x6a45('0x3b')]=_[_0x6a45('0x3d')](_0x5dc288[_0x6a45('0x3b')],{'$or':_['map'](_0x367e5b,function(_0x1c941a){if(_0x1c941a['type'][_0x6a45('0x3e')]!==_0x6a45('0x3f')){var _0xe79c93={};_0xe79c93[_0x1c941a[_0x6a45('0x40')]]={'$like':'%'+_0x201369['query']['filter']+'%'};return _0xe79c93;}})});}_0x5dc288=_[_0x6a45('0x3d')]({},_0x5dc288,_0x201369[_0x6a45('0x41')]);var _0x51bc51={'where':_0x5dc288[_0x6a45('0x3b')]};return db[_0x6a45('0x42')][_0x6a45('0x43')](_0x51bc51)[_0x6a45('0x25')](function(_0x4baffb){_0x1f96bf['count']=_0x4baffb;if(_0x201369['query']['includeAll']){_0x5dc288[_0x6a45('0x44')]=[{'all':!![]}];}return db[_0x6a45('0x42')][_0x6a45('0x45')](_0x5dc288);})[_0x6a45('0x25')](function(_0x2a0eac){_0x1f96bf[_0x6a45('0x46')]=_0x2a0eac;return _0x1f96bf;})[_0x6a45('0x25')](respondWithFilteredResult(_0x3b07a1,_0x5dc288))[_0x6a45('0x47')](handleError(_0x3b07a1,null));};exports['show']=function(_0x37c348,_0x575ab9){var _0x516d22={'raw':![],'where':{'id':_0x37c348[_0x6a45('0x48')]['id']}},_0x4aeb81={};_0x4aeb81['model']=_[_0x6a45('0x33')](db['VoicePrefix'][_0x6a45('0x49')]);_0x4aeb81[_0x6a45('0x32')]=_[_0x6a45('0x33')](_0x37c348[_0x6a45('0x32')]);_0x4aeb81['filters']=_[_0x6a45('0x35')](_0x4aeb81[_0x6a45('0x31')],_0x4aeb81[_0x6a45('0x32')]);_0x516d22[_0x6a45('0x36')]=_[_0x6a45('0x35')](_0x4aeb81['model'],qs[_0x6a45('0x4a')](_0x37c348['query'][_0x6a45('0x4a')]));_0x516d22[_0x6a45('0x36')]=_0x516d22['attributes'][_0x6a45('0x37')]?_0x516d22[_0x6a45('0x36')]:_0x4aeb81[_0x6a45('0x31')];if(_0x37c348[_0x6a45('0x32')]['includeAll']){_0x516d22[_0x6a45('0x44')]=[{'all':!![]}];}_0x516d22=_['merge']({},_0x516d22,_0x37c348[_0x6a45('0x41')]);return db['VoicePrefix'][_0x6a45('0x4b')](_0x516d22)[_0x6a45('0x25')](handleEntityNotFound(_0x575ab9,null))[_0x6a45('0x25')](respondWithResult(_0x575ab9,null))[_0x6a45('0x47')](handleError(_0x575ab9,null));};exports['destroy']=function(_0x23d733,_0x2c9465){return db[_0x6a45('0x42')][_0x6a45('0x4b')]({'where':{'id':_0x23d733[_0x6a45('0x48')]['id']}})[_0x6a45('0x25')](handleEntityNotFound(_0x2c9465,null))[_0x6a45('0x25')](removeEntity(_0x2c9465,null))[_0x6a45('0x47')](handleError(_0x2c9465,null));};exports[_0x6a45('0x4c')]=function(_0x265fa1,_0x4e8a77){return db[_0x6a45('0x42')][_0x6a45('0x4c')]()[_0x6a45('0x25')](respondWithResult(_0x4e8a77,null))[_0x6a45('0x47')](handleError(_0x4e8a77,null));};exports['create']=function(_0x6c40b6,_0x3bbb05){var _0x3f3639;return db['sequelize']['transaction'](function(_0x5a17b8){return db[_0x6a45('0x42')][_0x6a45('0x4d')](_0x6c40b6[_0x6a45('0x4e')],{'transaction':_0x5a17b8})[_0x6a45('0x25')](function(_0x5cc3cd){_0x3f3639=_0x5cc3cd[_0x6a45('0x27')]({'plain':!![]});return db[_0x6a45('0x4f')][_0x6a45('0x4b')]({'where':{'id':_0x3f3639[_0x6a45('0x50')]},'raw':!![]})['then'](function(_0x468222){return createVoicePrefixExtensions(_0x3f3639,_0x468222,_0x5a17b8);});});})[_0x6a45('0x25')](function(){var _0x7124d7=_0x6c40b6['user']['get']({'plain':!![]});if(!_0x7124d7)throw new Error(_0x6a45('0x51'));if(_0x7124d7[_0x6a45('0x52')]==='user'){var _0xe51767=_0x3f3639;return db[_0x6a45('0x53')][_0x6a45('0x4b')]({'where':{'name':_0x6a45('0x54'),'userProfileId':_0x7124d7[_0x6a45('0x55')]},'raw':!![]})['then'](function(_0x58ec02){if(_0x58ec02&&_0x58ec02[_0x6a45('0x56')]===0x0){return db['UserProfileResource']['create']({'name':_0xe51767['name'],'resourceId':_0xe51767['id'],'type':_0x58ec02[_0x6a45('0x2c')],'sectionId':_0x58ec02['id']},{})[_0x6a45('0x25')](function(){return _0x3f3639;});}else{return _0x3f3639;}})[_0x6a45('0x47')](function(_0xa5d68f){logger['error'](_0x6a45('0x57'),_0xa5d68f);throw _0xa5d68f;});}return _0x3f3639;})[_0x6a45('0x25')](respondWithResult(_0x3bbb05,null))[_0x6a45('0x47')](handleError(_0x3bbb05,null));};function Extension(_0x35d8d9,_0x4c9a93,_0x239c37,_0x504ccf){this[_0x6a45('0x58')]=_0x6a45('0x59');this[_0x6a45('0x5a')]=_0x35d8d9;this[_0x6a45('0x5b')]=_0x239c37;this[_0x6a45('0x30')]=_0x6a45('0x5c');this[_0x6a45('0x5d')]=_0x6a45('0x5e');this[_0x6a45('0x5f')]=_0x4c9a93;this['appdata']=_0x504ccf;}function createVoicePrefixExtensions(_0x13c9d9,_0x302923,_0x3bd27){return new BPromise(function(_0x5f507d,_0x641e4){var _0x58a44e=new Extension(formatPrefixName(_0x13c9d9[_0x6a45('0x60')]),0x1,_0x6a45('0x61'),'Voice\x20Prefix');_0x58a44e[_0x6a45('0x62')]=_0x13c9d9['id'];return db[_0x6a45('0x4f')]['create'](_0x58a44e,{'transaction':_0x3bd27})[_0x6a45('0x25')](function(_0x124cdd){var _0x5175ff=_0x124cdd['get']({'plain':!![]});var _0x26c53c=_[_0x6a45('0x2f')](addVoicePrefixExtensions(_0x13c9d9,_0x302923),function(_0x3e9d3a){_0x3e9d3a[_0x6a45('0x50')]=_0x5175ff['id'];_0x3e9d3a[_0x6a45('0x62')]=_0x13c9d9['id'];return _0x3e9d3a;});return db['VoiceExtension']['bulkCreate'](_0x26c53c,{'transaction':_0x3bd27})[_0x6a45('0x25')](function(_0x5faae8){if(!_0x5faae8){return _0x641e4('Extensions\x20creation\x20failed');}else{return _0x5f507d(_0x5faae8);}})[_0x6a45('0x47')](function(_0x29cd12){return _0x641e4(_0x29cd12);});});;});};function addVoicePrefixExtensions(_0x5dab28,_0x2463e5){var _0x4f20e2=[];var _0x3572cb=formatPrefixName(_0x5dab28[_0x6a45('0x60')]);_0x4f20e2[_0x6a45('0x63')](new Extension(_0x3572cb,0x2,_0x6a45('0x64'),_0x6a45('0x65')+_0x5dab28[_0x6a45('0x2c')]));if(_0x5dab28[_0x6a45('0x66')]){_0x4f20e2[_0x6a45('0x63')](new Extension(_0x3572cb,0x3,_0x6a45('0x64'),_0x6a45('0x67')+_0x5dab28[_0x6a45('0x66')]));}else{_0x4f20e2[_0x6a45('0x63')](new Extension(_0x3572cb,0x3,_0x6a45('0x61'),_0x6a45('0x68')));}_0x4f20e2[_0x6a45('0x63')](new Extension(_0x3572cb,0x4,_0x6a45('0x69'),_0x2463e5[_0x6a45('0x58')]+','+_0x6a45('0x6a')+(0x8+_0x5dab28['name'][_0x6a45('0x37')])+'}'+','+0x1));return _0x4f20e2;}function formatPrefixName(_0x4e24b0){var _0x213d97='_';for(var _0x57316d=0x0;_0x57316d<_0x4e24b0[_0x6a45('0x37')];_0x57316d++){if(_0x4e24b0[_0x6a45('0x6b')](_0x57316d)=='-'){_0x213d97+=_0x4e24b0[_0x6a45('0x6b')](_0x57316d);}else{_0x213d97+='['+_0x4e24b0[_0x6a45('0x6b')](_0x57316d)+']';}}_0x213d97+='.';return _0x213d97;}exports[_0x6a45('0x24')]=function(_0x346f14,_0x9cd01c,_0x42c67a){var _0x113784=_0x346f14['body'];_0x113784[_0x6a45('0x60')]='system-'+_0x113784[_0x6a45('0x2c')]+'-';return db[_0x6a45('0x6c')][_0x6a45('0x6d')](function(_0x59b2ec){return db[_0x6a45('0x42')][_0x6a45('0x24')](_0x113784,{'where':{'id':_0x113784['id']},'transaction':_0x59b2ec})[_0x6a45('0x25')](function(){return db[_0x6a45('0x4f')][_0x6a45('0x26')]({'where':{'VoicePrefixId':_0x113784['id']},'transaction':_0x59b2ec})[_0x6a45('0x25')](function(){return db[_0x6a45('0x4f')]['find']({'where':{'id':_0x113784['VoiceExtensionId']},'raw':!![]})[_0x6a45('0x25')](function(_0x30a802){return createVoicePrefixExtensions(_0x113784,_0x30a802,_0x59b2ec);});});});})[_0x6a45('0x25')](function(){return db[_0x6a45('0x42')][_0x6a45('0x6e')](_0x113784['id']);})[_0x6a45('0x25')](respondWithResult(_0x9cd01c,null))['catch'](handleError(_0x9cd01c,null));};exports[_0x6a45('0x6f')]=function(_0x203378,_0x4b7b44,_0x3173ce){return db['VoicePrefix']['find']({'where':{'id':_0x203378['params']['id']}})[_0x6a45('0x25')](handleEntityNotFound(_0x4b7b44,null))[_0x6a45('0x25')](function(_0x9ca213){if(_0x9ca213){return _0x9ca213['addAgents'](_0x203378[_0x6a45('0x4e')][_0x6a45('0x70')],_[_0x6a45('0x71')](_0x203378[_0x6a45('0x4e')],[_0x6a45('0x70'),'id'])||{})[_0x6a45('0x72')](function(_0x3332f2){for(var _0x54381f=0x0;_0x54381f<_0x203378['body'][_0x6a45('0x70')][_0x6a45('0x37')];_0x54381f+=0x1){socket[_0x6a45('0x73')](_0x6a45('0x74'),{'UserId':_0x203378[_0x6a45('0x4e')]['ids'][_0x54381f],'VoicePrefixId':_0x203378[_0x6a45('0x48')]['id']});}return _0x3332f2;});}})[_0x6a45('0x25')](respondWithResult(_0x4b7b44,null))[_0x6a45('0x47')](handleError(_0x4b7b44,null));};exports[_0x6a45('0x75')]=function(_0x2d400a,_0x2cb102,_0x2d0c64){return db['VoicePrefix'][_0x6a45('0x4b')]({'where':{'id':_0x2d400a[_0x6a45('0x48')]['id']}})['then'](handleEntityNotFound(_0x2cb102,null))[_0x6a45('0x25')](function(_0x8e68ac){if(_0x8e68ac){return _0x8e68ac[_0x6a45('0x75')](_0x2d400a[_0x6a45('0x32')]['ids'])[_0x6a45('0x25')](function(){if(_[_0x6a45('0x76')](_0x2d400a['query'][_0x6a45('0x70')])){for(var _0x5b99ec=0x0;_0x5b99ec<_0x2d400a[_0x6a45('0x32')]['ids'][_0x6a45('0x37')];_0x5b99ec+=0x1){socket[_0x6a45('0x73')](_0x6a45('0x77'),{'UserId':Number(_0x2d400a[_0x6a45('0x32')][_0x6a45('0x70')][_0x5b99ec]),'VoicePrefixId':Number(_0x2d400a['params']['id'])});}}else{socket[_0x6a45('0x73')](_0x6a45('0x77'),{'UserId':Number(_0x2d400a[_0x6a45('0x32')][_0x6a45('0x70')]),'VoicePrefixId':Number(_0x2d400a['params']['id'])});}});}})[_0x6a45('0x25')](respondWithStatusCode(_0x2cb102,null))[_0x6a45('0x47')](handleError(_0x2cb102,null));};exports[_0x6a45('0x78')]=function(_0x50c92b,_0x5c53cf,_0x2f3146){var _0x56b52b={};var _0x203108={};var _0x3e0ba1;var _0x1b45d2;return db['VoicePrefix']['findOne']({'where':{'id':_0x50c92b['params']['id']}})[_0x6a45('0x25')](handleEntityNotFound(_0x5c53cf,null))[_0x6a45('0x25')](function(_0x12f831){if(_0x12f831){_0x3e0ba1=_0x12f831;_0x203108[_0x6a45('0x31')]=_[_0x6a45('0x33')](db['User'][_0x6a45('0x49')]);_0x203108['query']=_['keys'](_0x50c92b[_0x6a45('0x32')]);_0x203108[_0x6a45('0x34')]=_[_0x6a45('0x35')](_0x203108[_0x6a45('0x31')],_0x203108['query']);_0x56b52b[_0x6a45('0x36')]=_['intersection'](_0x203108[_0x6a45('0x31')],qs[_0x6a45('0x4a')](_0x50c92b[_0x6a45('0x32')][_0x6a45('0x4a')]));_0x56b52b[_0x6a45('0x36')]=_0x56b52b[_0x6a45('0x36')][_0x6a45('0x37')]?_0x56b52b[_0x6a45('0x36')]:_0x203108[_0x6a45('0x31')];_0x56b52b[_0x6a45('0x79')]=qs[_0x6a45('0x3a')](_0x50c92b[_0x6a45('0x32')][_0x6a45('0x3a')]);_0x56b52b['where']=qs['filters'](_[_0x6a45('0x7a')](_0x50c92b['query'],_0x203108[_0x6a45('0x34')]));if(_0x50c92b[_0x6a45('0x32')][_0x6a45('0x3c')]){_0x56b52b[_0x6a45('0x3b')]=_[_0x6a45('0x3d')](_0x56b52b[_0x6a45('0x3b')],{'$or':_[_0x6a45('0x2f')](_0x56b52b[_0x6a45('0x36')],function(_0x57a61e){var _0x78e028={};_0x78e028[_0x57a61e]={'$like':'%'+_0x50c92b['query']['filter']+'%'};return _0x78e028;})});}_0x56b52b=_['merge']({},_0x56b52b,_0x50c92b[_0x6a45('0x41')]);return _0x3e0ba1[_0x6a45('0x78')](_0x56b52b);}})[_0x6a45('0x25')](function(_0x1e6a12){if(_0x1e6a12){_0x1b45d2=_0x1e6a12[_0x6a45('0x37')];if(!_0x50c92b['query'][_0x6a45('0x7b')](_0x6a45('0x38'))){_0x56b52b[_0x6a45('0x1e')]=qs[_0x6a45('0x1e')](_0x50c92b[_0x6a45('0x32')][_0x6a45('0x1e')]);_0x56b52b[_0x6a45('0x39')]=qs[_0x6a45('0x39')](_0x50c92b[_0x6a45('0x32')]['offset']);}return _0x3e0ba1['getAgents'](_0x56b52b);}})['then'](function(_0x41ea59){if(_0x41ea59){return _0x41ea59?{'count':_0x1b45d2,'rows':_0x41ea59}:null;}})[_0x6a45('0x25')](respondWithResult(_0x5c53cf,null))[_0x6a45('0x47')](handleError(_0x5c53cf,null));}; \ No newline at end of file +var _0x741c=['show','options','params','describe','create','sequelize','body','get','VoiceExtension','find','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','exten','app','Voice\x20Prefix\x20Extension','appdata','prefix','NoOp','VoicePrefixId','VoiceExtensionId','bulkCreate','Extensions\x20creation\x20failed','push','Set','callerIdAll','PREFIX-CALLERIDALL=','context','${EXTEN:','charAt','system-','transaction','findById','addAgents','omit','ids','spread','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','User','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./voicePrefix.socket','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','VoicePrefixes','UserProfileResource','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VoicePrefix','includeAll','include','findAll','rows','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x741c,0x196));var _0xc741=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x741c[_0xfae23b];return _0x200640;};'use strict';var pdf=require(_0xc741('0x0'));var emlformat=require(_0xc741('0x1'));var rimraf=require(_0xc741('0x2'));var zipdir=require(_0xc741('0x3'));var jsonpatch=require(_0xc741('0x4'));var rp=require(_0xc741('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc741('0x6'));var util=require('util');var path=require(_0xc741('0x7'));var sox=require(_0xc741('0x8'));var csv=require(_0xc741('0x9'));var ejs=require(_0xc741('0xa'));var fs=require('fs');var _=require(_0xc741('0xb'));var squel=require(_0xc741('0xc'));var crypto=require(_0xc741('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xc741('0xe'));var toCsv=require(_0xc741('0x9'));var querystring=require('querystring');var Papa=require(_0xc741('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc741('0x10'));var as=require(_0xc741('0x11'));var hardwareService=require(_0xc741('0x12'));var logger=require(_0xc741('0x13'))(_0xc741('0x14'));var utils=require(_0xc741('0x15'));var config=require(_0xc741('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0xc741('0x17')],{'host':_0xc741('0x18'),'port':0x18eb});var socket=require(_0xc741('0x19'))(new Redis(config[_0xc741('0x17')]));require(_0xc741('0x1a'))['register'](socket);function respondWithStatusCode(_0xde1da,_0x3d2f62){_0x3d2f62=_0x3d2f62||0xcc;return function(_0x4c190d){if(_0x4c190d){return _0xde1da[_0xc741('0x1b')](_0x3d2f62);}return _0xde1da[_0xc741('0x1c')](_0x3d2f62)[_0xc741('0x1d')]();};}function respondWithResult(_0x450179,_0x21514e){_0x21514e=_0x21514e||0xc8;return function(_0x5bbe86){if(_0x5bbe86){return _0x450179['status'](_0x21514e)[_0xc741('0x1e')](_0x5bbe86);}};}function respondWithFilteredResult(_0x4fed6b,_0x1c4f3a){return function(_0x3903c6){if(_0x3903c6){var _0x575184=_0x3903c6[_0xc741('0x1f')],_0x552ecf=_0x1c4f3a['offset'],_0xebabc8=_0x1c4f3a[_0xc741('0x20')]+_0x1c4f3a[_0xc741('0x21')],_0x477cc2;if(_0xebabc8>=_0x575184){_0xebabc8=_0x575184;_0x477cc2=0xc8;}else{_0x477cc2=0xce;}_0x4fed6b[_0xc741('0x1c')](_0x477cc2);return _0x4fed6b[_0xc741('0x22')](_0xc741('0x23'),_0x552ecf+'-'+_0xebabc8+'/'+_0x575184)[_0xc741('0x1e')](_0x3903c6);}return null;};}function patchUpdates(_0x5ce5fa){return function(_0x30b7ea){try{jsonpatch[_0xc741('0x24')](_0x30b7ea,_0x5ce5fa,!![]);}catch(_0x5668d5){return BPromise[_0xc741('0x25')](_0x5668d5);}return _0x30b7ea['save']();};}function saveUpdates(_0x212c67,_0x4b5b31){return function(_0xd498b){if(_0xd498b){return _0xd498b[_0xc741('0x26')](_0x212c67)[_0xc741('0x27')](function(_0x5ca96f){return _0x5ca96f;});}return null;};}function removeEntity(_0x71c786,_0x5a89bd){return function(_0x1b19c5){if(_0x1b19c5){return _0x1b19c5[_0xc741('0x28')]()[_0xc741('0x27')](function(){var _0x58af82=_0x1b19c5['get']({'plain':!![]});var _0x4ac9e3=_0xc741('0x29');return db[_0xc741('0x2a')][_0xc741('0x28')]({'where':{'type':_0x4ac9e3,'resourceId':_0x58af82['id']}})[_0xc741('0x27')](function(){return _0x1b19c5;});})[_0xc741('0x27')](function(){_0x71c786['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x183764,_0x11c65e){return function(_0x102408){if(!_0x102408){_0x183764[_0xc741('0x1b')](0x194);}return _0x102408;};}function handleError(_0x57f6fc,_0x378ab5){_0x378ab5=_0x378ab5||0x1f4;return function(_0x4a4ad2){logger[_0xc741('0x2b')](_0x4a4ad2[_0xc741('0x2c')]);if(_0x4a4ad2['name']){delete _0x4a4ad2[_0xc741('0x2d')];}_0x57f6fc[_0xc741('0x1c')](_0x378ab5)[_0xc741('0x2e')](_0x4a4ad2);};}exports[_0xc741('0x2f')]=function(_0x3b66ae,_0x3bb9b1){var _0x3b3703={},_0xdcffe={},_0x2f43a2={'count':0x0,'rows':[]};var _0x51b10c=_[_0xc741('0x30')](db['VoicePrefix'][_0xc741('0x31')],function(_0x520f80){return{'name':_0x520f80['fieldName'],'type':_0x520f80[_0xc741('0x32')][_0xc741('0x33')]};});_0xdcffe[_0xc741('0x34')]=_['map'](_0x51b10c,_0xc741('0x2d'));_0xdcffe[_0xc741('0x35')]=_[_0xc741('0x36')](_0x3b66ae['query']);_0xdcffe[_0xc741('0x37')]=_[_0xc741('0x38')](_0xdcffe[_0xc741('0x34')],_0xdcffe[_0xc741('0x35')]);_0x3b3703[_0xc741('0x39')]=_[_0xc741('0x38')](_0xdcffe[_0xc741('0x34')],qs['fields'](_0x3b66ae['query'][_0xc741('0x3a')]));_0x3b3703[_0xc741('0x39')]=_0x3b3703[_0xc741('0x39')][_0xc741('0x3b')]?_0x3b3703[_0xc741('0x39')]:_0xdcffe[_0xc741('0x34')];if(!_0x3b66ae['query'][_0xc741('0x3c')](_0xc741('0x3d'))){_0x3b3703['limit']=qs[_0xc741('0x21')](_0x3b66ae[_0xc741('0x35')][_0xc741('0x21')]);_0x3b3703['offset']=qs[_0xc741('0x20')](_0x3b66ae[_0xc741('0x35')][_0xc741('0x20')]);}_0x3b3703[_0xc741('0x3e')]=qs[_0xc741('0x3f')](_0x3b66ae[_0xc741('0x35')][_0xc741('0x3f')]);_0x3b3703['where']=qs[_0xc741('0x37')](_[_0xc741('0x40')](_0x3b66ae[_0xc741('0x35')],_0xdcffe[_0xc741('0x37')]));if(_0x3b66ae[_0xc741('0x35')][_0xc741('0x41')]){_0x3b3703[_0xc741('0x42')]=_[_0xc741('0x43')](_0x3b3703['where'],{'$or':_[_0xc741('0x30')](_0x51b10c,function(_0x17ba5a){if(_0x17ba5a[_0xc741('0x32')][_0xc741('0x33')]!=='VIRTUAL'){var _0x527db0={};_0x527db0[_0x17ba5a['field']]={'$like':'%'+_0x3b66ae[_0xc741('0x35')][_0xc741('0x41')]+'%'};return _0x527db0;}})});}_0x3b3703=_[_0xc741('0x43')]({},_0x3b3703,_0x3b66ae['options']);var _0x58ade7={'where':_0x3b3703[_0xc741('0x42')]};return db[_0xc741('0x44')][_0xc741('0x1f')](_0x58ade7)[_0xc741('0x27')](function(_0x1336f7){_0x2f43a2[_0xc741('0x1f')]=_0x1336f7;if(_0x3b66ae[_0xc741('0x35')][_0xc741('0x45')]){_0x3b3703[_0xc741('0x46')]=[{'all':!![]}];}return db[_0xc741('0x44')][_0xc741('0x47')](_0x3b3703);})[_0xc741('0x27')](function(_0x3a6edf){_0x2f43a2[_0xc741('0x48')]=_0x3a6edf;return _0x2f43a2;})[_0xc741('0x27')](respondWithFilteredResult(_0x3bb9b1,_0x3b3703))[_0xc741('0x49')](handleError(_0x3bb9b1,null));};exports[_0xc741('0x4a')]=function(_0x4aa3dc,_0x1cc48c){var _0x497598={'raw':![],'where':{'id':_0x4aa3dc['params']['id']}},_0xb425c={};_0xb425c[_0xc741('0x34')]=_[_0xc741('0x36')](db['VoicePrefix'][_0xc741('0x31')]);_0xb425c[_0xc741('0x35')]=_['keys'](_0x4aa3dc[_0xc741('0x35')]);_0xb425c[_0xc741('0x37')]=_[_0xc741('0x38')](_0xb425c[_0xc741('0x34')],_0xb425c[_0xc741('0x35')]);_0x497598[_0xc741('0x39')]=_[_0xc741('0x38')](_0xb425c['model'],qs[_0xc741('0x3a')](_0x4aa3dc['query']['fields']));_0x497598[_0xc741('0x39')]=_0x497598['attributes'][_0xc741('0x3b')]?_0x497598[_0xc741('0x39')]:_0xb425c[_0xc741('0x34')];if(_0x4aa3dc[_0xc741('0x35')][_0xc741('0x45')]){_0x497598[_0xc741('0x46')]=[{'all':!![]}];}_0x497598=_[_0xc741('0x43')]({},_0x497598,_0x4aa3dc[_0xc741('0x4b')]);return db[_0xc741('0x44')]['find'](_0x497598)['then'](handleEntityNotFound(_0x1cc48c,null))[_0xc741('0x27')](respondWithResult(_0x1cc48c,null))[_0xc741('0x49')](handleError(_0x1cc48c,null));};exports[_0xc741('0x28')]=function(_0x4414db,_0x4cec0b){return db[_0xc741('0x44')]['find']({'where':{'id':_0x4414db[_0xc741('0x4c')]['id']}})[_0xc741('0x27')](handleEntityNotFound(_0x4cec0b,null))[_0xc741('0x27')](removeEntity(_0x4cec0b,null))[_0xc741('0x49')](handleError(_0x4cec0b,null));};exports[_0xc741('0x4d')]=function(_0x469b3c,_0x23e461){return db[_0xc741('0x44')][_0xc741('0x4d')]()[_0xc741('0x27')](respondWithResult(_0x23e461,null))[_0xc741('0x49')](handleError(_0x23e461,null));};exports[_0xc741('0x4e')]=function(_0x510db2,_0x430996){var _0xd4a708;return db[_0xc741('0x4f')]['transaction'](function(_0x29ec0b){return db[_0xc741('0x44')][_0xc741('0x4e')](_0x510db2[_0xc741('0x50')],{'transaction':_0x29ec0b})['then'](function(_0x1a8042){_0xd4a708=_0x1a8042[_0xc741('0x51')]({'plain':!![]});return db[_0xc741('0x52')][_0xc741('0x53')]({'where':{'id':_0xd4a708['VoiceExtensionId']},'raw':!![]})[_0xc741('0x27')](function(_0x5bd169){return createVoicePrefixExtensions(_0xd4a708,_0x5bd169,_0x29ec0b);});});})[_0xc741('0x27')](function(){var _0x33d7ee=_0x510db2[_0xc741('0x54')][_0xc741('0x51')]({'plain':!![]});if(!_0x33d7ee)throw new Error(_0xc741('0x55'));if(_0x33d7ee[_0xc741('0x56')]==='user'){var _0x30a4f6=_0xd4a708;return db['UserProfileSection'][_0xc741('0x53')]({'where':{'name':_0xc741('0x29'),'userProfileId':_0x33d7ee[_0xc741('0x57')]},'raw':!![]})[_0xc741('0x27')](function(_0x168076){if(_0x168076&&_0x168076['autoAssociation']===0x0){return db['UserProfileResource'][_0xc741('0x4e')]({'name':_0x30a4f6['name'],'resourceId':_0x30a4f6['id'],'type':_0x168076[_0xc741('0x2d')],'sectionId':_0x168076['id']},{})[_0xc741('0x27')](function(){return _0xd4a708;});}else{return _0xd4a708;}})[_0xc741('0x49')](function(_0x168232){logger[_0xc741('0x2b')](_0xc741('0x58'),_0x168232);throw _0x168232;});}return _0xd4a708;})[_0xc741('0x27')](respondWithResult(_0x430996,null))[_0xc741('0x49')](handleError(_0x430996,null));};function Extension(_0x409ac1,_0x335eb6,_0xc1c742,_0x1e31bb){this['context']='from-sip';this[_0xc741('0x59')]=_0x409ac1;this[_0xc741('0x5a')]=_0xc1c742;this[_0xc741('0x32')]='system';this['description']=_0xc741('0x5b');this['priority']=_0x335eb6;this[_0xc741('0x5c')]=_0x1e31bb;}function createVoicePrefixExtensions(_0x3523a2,_0x407a73,_0x41744a){return new BPromise(function(_0x45016e,_0x5bfffe){var _0x487ccd=new Extension(formatPrefixName(_0x3523a2[_0xc741('0x5d')]),0x1,_0xc741('0x5e'),'Voice\x20Prefix');_0x487ccd[_0xc741('0x5f')]=_0x3523a2['id'];return db[_0xc741('0x52')][_0xc741('0x4e')](_0x487ccd,{'transaction':_0x41744a})[_0xc741('0x27')](function(_0x4504c8){var _0x523324=_0x4504c8['get']({'plain':!![]});var _0x2802a7=_['map'](addVoicePrefixExtensions(_0x3523a2,_0x407a73),function(_0x360e03){_0x360e03[_0xc741('0x60')]=_0x523324['id'];_0x360e03['VoicePrefixId']=_0x3523a2['id'];return _0x360e03;});return db[_0xc741('0x52')][_0xc741('0x61')](_0x2802a7,{'transaction':_0x41744a})[_0xc741('0x27')](function(_0x1aecb3){if(!_0x1aecb3){return _0x5bfffe(_0xc741('0x62'));}else{return _0x45016e(_0x1aecb3);}})[_0xc741('0x49')](function(_0xd0575b){return _0x5bfffe(_0xd0575b);});});;});};function addVoicePrefixExtensions(_0x50e1d5,_0x64e818){var _0x28390d=[];var _0x4dfd15=formatPrefixName(_0x50e1d5[_0xc741('0x5d')]);_0x28390d[_0xc741('0x63')](new Extension(_0x4dfd15,0x2,_0xc741('0x64'),'CDR(prefix)='+_0x50e1d5[_0xc741('0x2d')]));if(_0x50e1d5[_0xc741('0x65')]){_0x28390d['push'](new Extension(_0x4dfd15,0x3,_0xc741('0x64'),_0xc741('0x66')+_0x50e1d5[_0xc741('0x65')]));}else{_0x28390d[_0xc741('0x63')](new Extension(_0x4dfd15,0x3,'NoOp','No\x20callerid\x20available'));}_0x28390d[_0xc741('0x63')](new Extension(_0x4dfd15,0x4,'goto',_0x64e818[_0xc741('0x67')]+','+_0xc741('0x68')+(0x8+_0x50e1d5[_0xc741('0x2d')][_0xc741('0x3b')])+'}'+','+0x1));return _0x28390d;}function formatPrefixName(_0x438997){var _0x1845b5='_';for(var _0x5eab1a=0x0;_0x5eab1a<_0x438997[_0xc741('0x3b')];_0x5eab1a++){if(_0x438997['charAt'](_0x5eab1a)=='-'){_0x1845b5+=_0x438997[_0xc741('0x69')](_0x5eab1a);}else{_0x1845b5+='['+_0x438997[_0xc741('0x69')](_0x5eab1a)+']';}}_0x1845b5+='.';return _0x1845b5;}exports[_0xc741('0x26')]=function(_0x73a732,_0x57ed58,_0x31c533){var _0x19b48a=_0x73a732[_0xc741('0x50')];_0x19b48a[_0xc741('0x5d')]=_0xc741('0x6a')+_0x19b48a[_0xc741('0x2d')]+'-';return db[_0xc741('0x4f')][_0xc741('0x6b')](function(_0x3ebe63){return db['VoicePrefix']['update'](_0x19b48a,{'where':{'id':_0x19b48a['id']},'transaction':_0x3ebe63})[_0xc741('0x27')](function(){return db[_0xc741('0x52')][_0xc741('0x28')]({'where':{'VoicePrefixId':_0x19b48a['id']},'transaction':_0x3ebe63})[_0xc741('0x27')](function(){return db['VoiceExtension'][_0xc741('0x53')]({'where':{'id':_0x19b48a[_0xc741('0x60')]},'raw':!![]})[_0xc741('0x27')](function(_0x3f3b84){return createVoicePrefixExtensions(_0x19b48a,_0x3f3b84,_0x3ebe63);});});});})[_0xc741('0x27')](function(){return db[_0xc741('0x44')][_0xc741('0x6c')](_0x19b48a['id']);})[_0xc741('0x27')](respondWithResult(_0x57ed58,null))['catch'](handleError(_0x57ed58,null));};exports[_0xc741('0x6d')]=function(_0x5db0e8,_0x549976,_0x2daa59){return db[_0xc741('0x44')]['find']({'where':{'id':_0x5db0e8[_0xc741('0x4c')]['id']}})[_0xc741('0x27')](handleEntityNotFound(_0x549976,null))['then'](function(_0x578387){if(_0x578387){return _0x578387[_0xc741('0x6d')](_0x5db0e8[_0xc741('0x50')]['ids'],_[_0xc741('0x6e')](_0x5db0e8[_0xc741('0x50')],[_0xc741('0x6f'),'id'])||{})[_0xc741('0x70')](function(_0x3945f1){for(var _0x3fa7e3=0x0;_0x3fa7e3<_0x5db0e8[_0xc741('0x50')][_0xc741('0x6f')]['length'];_0x3fa7e3+=0x1){socket[_0xc741('0x71')](_0xc741('0x72'),{'UserId':_0x5db0e8[_0xc741('0x50')][_0xc741('0x6f')][_0x3fa7e3],'VoicePrefixId':_0x5db0e8['params']['id']});}return _0x3945f1;});}})[_0xc741('0x27')](respondWithResult(_0x549976,null))[_0xc741('0x49')](handleError(_0x549976,null));};exports['removeAgents']=function(_0x325e82,_0x1f3823,_0xac6b3a){return db[_0xc741('0x44')]['find']({'where':{'id':_0x325e82['params']['id']}})['then'](handleEntityNotFound(_0x1f3823,null))[_0xc741('0x27')](function(_0x1413e3){if(_0x1413e3){return _0x1413e3[_0xc741('0x73')](_0x325e82[_0xc741('0x35')]['ids'])[_0xc741('0x27')](function(){if(_[_0xc741('0x74')](_0x325e82['query']['ids'])){for(var _0x110cac=0x0;_0x110cac<_0x325e82[_0xc741('0x35')][_0xc741('0x6f')]['length'];_0x110cac+=0x1){socket[_0xc741('0x71')](_0xc741('0x75'),{'UserId':Number(_0x325e82[_0xc741('0x35')]['ids'][_0x110cac]),'VoicePrefixId':Number(_0x325e82['params']['id'])});}}else{socket['emit'](_0xc741('0x75'),{'UserId':Number(_0x325e82[_0xc741('0x35')]['ids']),'VoicePrefixId':Number(_0x325e82['params']['id'])});}});}})[_0xc741('0x27')](respondWithStatusCode(_0x1f3823,null))[_0xc741('0x49')](handleError(_0x1f3823,null));};exports['getAgents']=function(_0x230c93,_0x59cca2,_0x5d6521){var _0x4b4095={};var _0x416df0={};var _0x64406d;var _0x9db83;return db[_0xc741('0x44')]['findOne']({'where':{'id':_0x230c93[_0xc741('0x4c')]['id']}})['then'](handleEntityNotFound(_0x59cca2,null))[_0xc741('0x27')](function(_0x4ee813){if(_0x4ee813){_0x64406d=_0x4ee813;_0x416df0['model']=_[_0xc741('0x36')](db[_0xc741('0x76')]['rawAttributes']);_0x416df0[_0xc741('0x35')]=_[_0xc741('0x36')](_0x230c93[_0xc741('0x35')]);_0x416df0[_0xc741('0x37')]=_[_0xc741('0x38')](_0x416df0[_0xc741('0x34')],_0x416df0['query']);_0x4b4095[_0xc741('0x39')]=_[_0xc741('0x38')](_0x416df0[_0xc741('0x34')],qs[_0xc741('0x3a')](_0x230c93[_0xc741('0x35')][_0xc741('0x3a')]));_0x4b4095[_0xc741('0x39')]=_0x4b4095[_0xc741('0x39')][_0xc741('0x3b')]?_0x4b4095[_0xc741('0x39')]:_0x416df0[_0xc741('0x34')];_0x4b4095[_0xc741('0x3e')]=qs['sort'](_0x230c93['query']['sort']);_0x4b4095['where']=qs[_0xc741('0x37')](_[_0xc741('0x40')](_0x230c93[_0xc741('0x35')],_0x416df0[_0xc741('0x37')]));if(_0x230c93[_0xc741('0x35')][_0xc741('0x41')]){_0x4b4095[_0xc741('0x42')]=_[_0xc741('0x43')](_0x4b4095[_0xc741('0x42')],{'$or':_[_0xc741('0x30')](_0x4b4095[_0xc741('0x39')],function(_0x367576){var _0x3a7f67={};_0x3a7f67[_0x367576]={'$like':'%'+_0x230c93['query'][_0xc741('0x41')]+'%'};return _0x3a7f67;})});}_0x4b4095=_[_0xc741('0x43')]({},_0x4b4095,_0x230c93[_0xc741('0x4b')]);return _0x64406d[_0xc741('0x77')](_0x4b4095);}})[_0xc741('0x27')](function(_0x2458af){if(_0x2458af){_0x9db83=_0x2458af[_0xc741('0x3b')];if(!_0x230c93[_0xc741('0x35')][_0xc741('0x3c')](_0xc741('0x3d'))){_0x4b4095[_0xc741('0x21')]=qs[_0xc741('0x21')](_0x230c93['query'][_0xc741('0x21')]);_0x4b4095[_0xc741('0x20')]=qs[_0xc741('0x20')](_0x230c93['query'][_0xc741('0x20')]);}return _0x64406d[_0xc741('0x77')](_0x4b4095);}})['then'](function(_0x3cd978){if(_0x3cd978){return _0x3cd978?{'count':_0x9db83,'rows':_0x3cd978}:null;}})['then'](respondWithResult(_0x59cca2,null))[_0xc741('0x49')](handleError(_0x59cca2,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index a8b6f24..a6026f0 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 _0x6f4f=['../../mysqldb','save','remove','emit','hook','exports','events'];(function(_0x553eb6,_0x36d8d2){var _0x2860e8=function(_0x361ee4){while(--_0x361ee4){_0x553eb6['push'](_0x553eb6['shift']());}};_0x2860e8(++_0x36d8d2);}(_0x6f4f,0x187));var _0xf6f4=function(_0x3d04c9,_0x3d697a){_0x3d04c9=_0x3d04c9-0x0;var _0x5d38b0=_0x6f4f[_0x3d04c9];return _0x5d38b0;};'use strict';var EventEmitter=require(_0xf6f4('0x0'));var VoicePrefix=require(_0xf6f4('0x1'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf6f4('0x2'),'afterUpdate':'update','afterDestroy':_0xf6f4('0x3')};function emitEvent(_0x268dac){return function(_0x5d939a,_0x55412a,_0x544bf8){VoicePrefixEvents[_0xf6f4('0x4')](_0x268dac+':'+_0x5d939a['id'],_0x5d939a);VoicePrefixEvents[_0xf6f4('0x4')](_0x268dac,_0x5d939a);_0x544bf8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0xf6f4('0x5')](e,emitEvent(event));}}module[_0xf6f4('0x6')]=VoicePrefixEvents; \ No newline at end of file +var _0xee42=['exports','../../mysqldb','save','emit','hook'];(function(_0x25e51f,_0x5a1a44){var _0x46aea2=function(_0x52aa76){while(--_0x52aa76){_0x25e51f['push'](_0x25e51f['shift']());}};_0x46aea2(++_0x5a1a44);}(_0xee42,0xe2));var _0x2ee4=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0xee42[_0xefd519];return _0x4bb882;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0x2ee4('0x0'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2ee4('0x1'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1bffae){return function(_0x5d7b57,_0x572054,_0x326245){VoicePrefixEvents[_0x2ee4('0x2')](_0x1bffae+':'+_0x5d7b57['id'],_0x5d7b57);VoicePrefixEvents[_0x2ee4('0x2')](_0x1bffae,_0x5d7b57);_0x326245(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0x2ee4('0x3')](e,emitEvent(event));}}module[_0x2ee4('0x4')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 4cca438..e806ed2 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 _0x89e1=['./voicePrefix.attributes','exports','define','VoicePrefix','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment'];(function(_0x2b0601,_0x41c0e2){var _0x304320=function(_0x544bed){while(--_0x544bed){_0x2b0601['push'](_0x2b0601['shift']());}};_0x304320(++_0x41c0e2);}(_0x89e1,0x178));var _0x189e=function(_0x1eb4b5,_0x4ec417){_0x1eb4b5=_0x1eb4b5-0x0;var _0x4dd90e=_0x89e1[_0x1eb4b5];return _0x4dd90e;};'use strict';var _=require(_0x189e('0x0'));var util=require(_0x189e('0x1'));var logger=require(_0x189e('0x2'))(_0x189e('0x3'));var moment=require(_0x189e('0x4'));var BPromise=require(_0x189e('0x5'));var rp=require(_0x189e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x189e('0x7'));var attributes=require(_0x189e('0x8'));module[_0x189e('0x9')]=function(_0x23b21f,_0x13ca4c){return _0x23b21f[_0x189e('0xa')](_0x189e('0xb'),attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7b72=['path','rimraf','../../config/environment','./voicePrefix.attributes','exports','VoicePrefix','voice_prefixes','lodash','util','../../config/logger','api','request-promise'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x7b72,0xf7));var _0x27b7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7b72[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x27b7('0x0'));var util=require(_0x27b7('0x1'));var logger=require(_0x27b7('0x2'))(_0x27b7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x27b7('0x4'));var fs=require('fs');var path=require(_0x27b7('0x5'));var rimraf=require(_0x27b7('0x6'));var config=require(_0x27b7('0x7'));var attributes=require(_0x27b7('0x8'));module[_0x27b7('0x9')]=function(_0x442570,_0x335408){return _0x442570['define'](_0x27b7('0xa'),attributes,{'tableName':_0x27b7('0xb'),'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 45f10e6..538862a 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 _0xfefa=['VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','VoicePrefix,\x20%s,\x20%s','message','info','request\x20sent','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','request','then'];(function(_0x2463f3,_0x40f8e3){var _0x8da1a5=function(_0x28c221){while(--_0x28c221){_0x2463f3['push'](_0x2463f3['shift']());}};_0x8da1a5(++_0x40f8e3);}(_0xfefa,0x14c));var _0xafef=function(_0x37d525,_0x5b10ed){_0x37d525=_0x37d525-0x0;var _0x42e8c6=_0xfefa[_0x37d525];return _0x42e8c6;};'use strict';var _=require(_0xafef('0x0'));var util=require(_0xafef('0x1'));var moment=require(_0xafef('0x2'));var BPromise=require(_0xafef('0x3'));var rs=require(_0xafef('0x4'));var fs=require('fs');var Redis=require(_0xafef('0x5'));var db=require(_0xafef('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xafef('0x7'));var config=require(_0xafef('0x8'));var jayson=require(_0xafef('0x9'));var client=jayson[_0xafef('0xa')][_0xafef('0xb')]({'port':0x232a});config[_0xafef('0xc')]=_[_0xafef('0xd')](config['redis'],{'host':_0xafef('0xe'),'port':0x18eb});var socket=require(_0xafef('0xf'))(new Redis(config[_0xafef('0xc')]));require(_0xafef('0x10'))['register'](socket);function respondWithRpcPromise(_0x38f58a,_0x1c2661,_0x54c48a){return new BPromise(function(_0x1dc4cb,_0x3f632d){return client[_0xafef('0x11')](_0x38f58a,_0x54c48a)[_0xafef('0x12')](function(_0x20893e){logger['info']('VoicePrefix,\x20%s,\x20%s',_0x1c2661,'request\x20sent');logger['debug'](_0xafef('0x13'),_0x1c2661,'request\x20sent',JSON[_0xafef('0x14')](_0x20893e));if(_0x20893e['error']){if(_0x20893e[_0xafef('0x15')]['code']===0x1f4){logger[_0xafef('0x15')](_0xafef('0x16'),_0x1c2661,_0x20893e[_0xafef('0x15')][_0xafef('0x17')]);return _0x3f632d(_0x20893e[_0xafef('0x15')]['message']);}logger[_0xafef('0x15')](_0xafef('0x16'),_0x1c2661,_0x20893e[_0xafef('0x15')][_0xafef('0x17')]);return _0x1dc4cb(_0x20893e[_0xafef('0x15')][_0xafef('0x17')]);}else{logger[_0xafef('0x18')](_0xafef('0x16'),_0x1c2661,_0xafef('0x19'));_0x1dc4cb(_0x20893e['result']['message']);}})[_0xafef('0x1a')](function(_0x3f4145){logger['error'](_0xafef('0x16'),_0x1c2661,_0x3f4145);_0x3f632d(_0x3f4145);});});} \ No newline at end of file +var _0x6662=['message','result','catch','VoicePrefix,\x20%s,\x20%s','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x285ec2,_0xa85894){var _0x2717e9=function(_0x123fda){while(--_0x123fda){_0x285ec2['push'](_0x285ec2['shift']());}};_0x2717e9(++_0xa85894);}(_0x6662,0xec));var _0x2666=function(_0x53b0f8,_0x459130){_0x53b0f8=_0x53b0f8-0x0;var _0x133415=_0x6662[_0x53b0f8];return _0x133415;};'use strict';var _=require(_0x2666('0x0'));var util=require(_0x2666('0x1'));var moment=require(_0x2666('0x2'));var BPromise=require(_0x2666('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2666('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2666('0x5'));var logger=require(_0x2666('0x6'))(_0x2666('0x7'));var config=require(_0x2666('0x8'));var jayson=require(_0x2666('0x9'));var client=jayson[_0x2666('0xa')]['http']({'port':0x232a});config[_0x2666('0xb')]=_[_0x2666('0xc')](config['redis'],{'host':_0x2666('0xd'),'port':0x18eb});var socket=require(_0x2666('0xe'))(new Redis(config['redis']));require('./voicePrefix.socket')[_0x2666('0xf')](socket);function respondWithRpcPromise(_0x271489,_0x55ad65,_0x446542){return new BPromise(function(_0x12180b,_0x366123){return client[_0x2666('0x10')](_0x271489,_0x446542)[_0x2666('0x11')](function(_0x1eab37){logger[_0x2666('0x12')]('VoicePrefix,\x20%s,\x20%s',_0x55ad65,_0x2666('0x13'));logger[_0x2666('0x14')](_0x2666('0x15'),_0x55ad65,_0x2666('0x13'),JSON[_0x2666('0x16')](_0x1eab37));if(_0x1eab37['error']){if(_0x1eab37[_0x2666('0x17')][_0x2666('0x18')]===0x1f4){logger[_0x2666('0x17')]('VoicePrefix,\x20%s,\x20%s',_0x55ad65,_0x1eab37['error']['message']);return _0x366123(_0x1eab37[_0x2666('0x17')][_0x2666('0x19')]);}logger['error']('VoicePrefix,\x20%s,\x20%s',_0x55ad65,_0x1eab37[_0x2666('0x17')][_0x2666('0x19')]);return _0x12180b(_0x1eab37[_0x2666('0x17')][_0x2666('0x19')]);}else{logger[_0x2666('0x12')]('VoicePrefix,\x20%s,\x20%s',_0x55ad65,_0x2666('0x13'));_0x12180b(_0x1eab37[_0x2666('0x1a')][_0x2666('0x19')]);}})[_0x2666('0x1b')](function(_0x572edd){logger[_0x2666('0x17')](_0x2666('0x1c'),_0x55ad65,_0x572edd);_0x366123(_0x572edd);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 15967bd..810ce2e 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 _0xc7a6=['removeListener','register','length','./voicePrefix.events','save','remove','update','emit'];(function(_0x450dac,_0x176628){var _0x2a9969=function(_0x5c36b9){while(--_0x5c36b9){_0x450dac['push'](_0x450dac['shift']());}};_0x2a9969(++_0x176628);}(_0xc7a6,0x7b));var _0x6c7a=function(_0x451735,_0x391a76){_0x451735=_0x451735-0x0;var _0x41d1e2=_0xc7a6[_0x451735];return _0x41d1e2;};'use strict';var VoicePrefixEvents=require(_0x6c7a('0x0'));var events=[_0x6c7a('0x1'),_0x6c7a('0x2'),_0x6c7a('0x3')];function createListener(_0x205964,_0x5b2131){return function(_0xe59386){_0x5b2131[_0x6c7a('0x4')](_0x205964,_0xe59386);};}function removeListener(_0x27bb6d,_0xdc8090){return function(){VoicePrefixEvents[_0x6c7a('0x5')](_0x27bb6d,_0xdc8090);};}exports[_0x6c7a('0x6')]=function(_0xfd1d5c){for(var _0x1b7308=0x0,_0x569d59=events[_0x6c7a('0x7')];_0x1b7308<_0x569d59;_0x1b7308++){var _0x277099=events[_0x1b7308];var _0x3d5cbc=createListener('voicePrefix:'+_0x277099,_0xfd1d5c);VoicePrefixEvents['on'](_0x277099,_0x3d5cbc);}}; \ No newline at end of file +var _0x8cca=['./voicePrefix.events','emit','removeListener','register','length','voicePrefix:'];(function(_0x30bc20,_0x24c566){var _0x4be07f=function(_0xa56459){while(--_0xa56459){_0x30bc20['push'](_0x30bc20['shift']());}};_0x4be07f(++_0x24c566);}(_0x8cca,0x10e));var _0xa8cc=function(_0x473da7,_0x1a0ba7){_0x473da7=_0x473da7-0x0;var _0x45a5cf=_0x8cca[_0x473da7];return _0x45a5cf;};'use strict';var VoicePrefixEvents=require(_0xa8cc('0x0'));var events=['save','remove','update'];function createListener(_0x1b86c1,_0x4103cb){return function(_0x17ad01){_0x4103cb[_0xa8cc('0x1')](_0x1b86c1,_0x17ad01);};}function removeListener(_0x2c7d5f,_0x18947b){return function(){VoicePrefixEvents[_0xa8cc('0x2')](_0x2c7d5f,_0x18947b);};}exports[_0xa8cc('0x3')]=function(_0x88734a){for(var _0x18964d=0x0,_0x11598f=events[_0xa8cc('0x4')];_0x18964d<_0x11598f;_0x18964d++){var _0x158f1e=events[_0x18964d];var _0x4ac9ec=createListener(_0xa8cc('0x5')+_0x158f1e,_0x88734a);VoicePrefixEvents['on'](_0x158f1e,_0x4ac9ec);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 4fbf7d8..25eef7e 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 _0x09cf=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','getMembers','/:id/lists','getLists','/:id/blacklists','getBlackLists','create','/:id/clone','clone','post','addTeams','addAgents','addLists','addBlackLists','put','delete','destroy','removeTeams','removeLists','removeBlackLists','exports','util','path'];(function(_0x5eb4d8,_0x3ced5a){var _0x109797=function(_0x3c0f47){while(--_0x3c0f47){_0x5eb4d8['push'](_0x5eb4d8['shift']());}};_0x109797(++_0x3ced5a);}(_0x09cf,0x1e2));var _0xf09c=function(_0x4c034d,_0x24dc43){_0x4c034d=_0x4c034d-0x0;var _0x239888=_0x09cf[_0x4c034d];return _0x239888;};'use strict';var multer=require('multer');var util=require(_0xf09c('0x0'));var path=require(_0xf09c('0x1'));var timeout=require('connect-timeout');var express=require(_0xf09c('0x2'));var router=express[_0xf09c('0x3')]();var auth=require(_0xf09c('0x4'));var interaction=require(_0xf09c('0x5'));var config=require(_0xf09c('0x6'));var controller=require(_0xf09c('0x7'));router[_0xf09c('0x8')]('/',auth[_0xf09c('0x9')](),controller[_0xf09c('0xa')]);router[_0xf09c('0x8')](_0xf09c('0xb'),auth[_0xf09c('0x9')](),controller[_0xf09c('0xc')]);router[_0xf09c('0x8')](_0xf09c('0xd'),auth[_0xf09c('0x9')](),controller[_0xf09c('0xe')]);router['get'](_0xf09c('0xf'),auth[_0xf09c('0x9')](),controller[_0xf09c('0x10')]);router[_0xf09c('0x8')]('/:id/hopper_finals',auth[_0xf09c('0x9')](),controller[_0xf09c('0x11')]);router[_0xf09c('0x8')](_0xf09c('0x12'),auth[_0xf09c('0x9')](),controller[_0xf09c('0x13')]);router[_0xf09c('0x8')](_0xf09c('0x14'),auth['isAuthenticated'](),controller[_0xf09c('0x15')]);router[_0xf09c('0x8')](_0xf09c('0x16'),auth[_0xf09c('0x9')](),controller[_0xf09c('0x17')]);router[_0xf09c('0x8')]('/:id/members',auth['isAuthenticated'](),controller[_0xf09c('0x18')]);router[_0xf09c('0x8')](_0xf09c('0x19'),auth[_0xf09c('0x9')](),controller[_0xf09c('0x1a')]);router[_0xf09c('0x8')](_0xf09c('0x1b'),auth[_0xf09c('0x9')](),controller[_0xf09c('0x1c')]);router['post']('/',auth[_0xf09c('0x9')](),controller[_0xf09c('0x1d')]);router['post'](_0xf09c('0x1e'),auth[_0xf09c('0x9')](),controller[_0xf09c('0x1f')]);router[_0xf09c('0x20')](_0xf09c('0x14'),auth[_0xf09c('0x9')](),controller[_0xf09c('0x21')]);router[_0xf09c('0x20')](_0xf09c('0x16'),auth[_0xf09c('0x9')](),controller[_0xf09c('0x22')]);router[_0xf09c('0x20')]('/:id/lists',auth['isAuthenticated'](),controller[_0xf09c('0x23')]);router[_0xf09c('0x20')](_0xf09c('0x1b'),auth['isAuthenticated'](),controller[_0xf09c('0x24')]);router[_0xf09c('0x25')](_0xf09c('0xb'),auth[_0xf09c('0x9')](),controller['update']);router[_0xf09c('0x26')]('/:id',auth['isAuthenticated'](),controller[_0xf09c('0x27')]);router[_0xf09c('0x26')](_0xf09c('0x14'),auth[_0xf09c('0x9')](),controller[_0xf09c('0x28')]);router['delete'](_0xf09c('0x16'),auth['isAuthenticated'](),controller['removeAgents']);router[_0xf09c('0x26')]('/:id/lists',auth[_0xf09c('0x9')](),controller[_0xf09c('0x29')]);router[_0xf09c('0x26')](_0xf09c('0x1b'),auth[_0xf09c('0x9')](),controller[_0xf09c('0x2a')]);module[_0xf09c('0x2b')]=router; \ No newline at end of file +var _0xf5a8=['../../config/environment','./voiceQueue.controller','get','index','/:id','show','/:id/hoppers','isAuthenticated','/:id/hopper_histories','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','/:id/lists','getLists','getBlackLists','post','clone','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','removeLists','/:id/blacklists','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x5316d4,_0x3e273a){var _0x590f57=function(_0x37718c){while(--_0x37718c){_0x5316d4['push'](_0x5316d4['shift']());}};_0x590f57(++_0x3e273a);}(_0xf5a8,0x6e));var _0x8f5a=function(_0x1e4177,_0x26a73a){_0x1e4177=_0x1e4177-0x0;var _0xa6e76c=_0xf5a8[_0x1e4177];return _0xa6e76c;};'use strict';var multer=require('multer');var util=require(_0x8f5a('0x0'));var path=require(_0x8f5a('0x1'));var timeout=require(_0x8f5a('0x2'));var express=require(_0x8f5a('0x3'));var router=express[_0x8f5a('0x4')]();var auth=require(_0x8f5a('0x5'));var interaction=require(_0x8f5a('0x6'));var config=require(_0x8f5a('0x7'));var controller=require(_0x8f5a('0x8'));router[_0x8f5a('0x9')]('/',auth['isAuthenticated'](),controller[_0x8f5a('0xa')]);router[_0x8f5a('0x9')](_0x8f5a('0xb'),auth['isAuthenticated'](),controller[_0x8f5a('0xc')]);router['get'](_0x8f5a('0xd'),auth[_0x8f5a('0xe')](),controller['getHoppers']);router[_0x8f5a('0x9')](_0x8f5a('0xf'),auth[_0x8f5a('0xe')](),controller[_0x8f5a('0x10')]);router[_0x8f5a('0x9')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router[_0x8f5a('0x9')](_0x8f5a('0x11'),auth[_0x8f5a('0xe')](),controller[_0x8f5a('0x12')]);router[_0x8f5a('0x9')](_0x8f5a('0x13'),auth['isAuthenticated'](),controller[_0x8f5a('0x14')]);router[_0x8f5a('0x9')](_0x8f5a('0x15'),auth[_0x8f5a('0xe')](),controller[_0x8f5a('0x16')]);router[_0x8f5a('0x9')](_0x8f5a('0x17'),auth[_0x8f5a('0xe')](),controller['getMembers']);router[_0x8f5a('0x9')](_0x8f5a('0x18'),auth[_0x8f5a('0xe')](),controller[_0x8f5a('0x19')]);router[_0x8f5a('0x9')]('/:id/blacklists',auth[_0x8f5a('0xe')](),controller[_0x8f5a('0x1a')]);router[_0x8f5a('0x1b')]('/',auth[_0x8f5a('0xe')](),controller['create']);router[_0x8f5a('0x1b')]('/:id/clone',auth[_0x8f5a('0xe')](),controller[_0x8f5a('0x1c')]);router[_0x8f5a('0x1b')](_0x8f5a('0x13'),auth['isAuthenticated'](),controller[_0x8f5a('0x1d')]);router[_0x8f5a('0x1b')](_0x8f5a('0x15'),auth[_0x8f5a('0xe')](),controller[_0x8f5a('0x1e')]);router[_0x8f5a('0x1b')](_0x8f5a('0x18'),auth[_0x8f5a('0xe')](),controller['addLists']);router[_0x8f5a('0x1b')]('/:id/blacklists',auth[_0x8f5a('0xe')](),controller['addBlackLists']);router[_0x8f5a('0x1f')](_0x8f5a('0xb'),auth['isAuthenticated'](),controller[_0x8f5a('0x20')]);router[_0x8f5a('0x21')](_0x8f5a('0xb'),auth['isAuthenticated'](),controller['destroy']);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0x8f5a('0x22')]);router[_0x8f5a('0x21')]('/:id/users',auth[_0x8f5a('0xe')](),controller[_0x8f5a('0x23')]);router[_0x8f5a('0x21')](_0x8f5a('0x18'),auth[_0x8f5a('0xe')](),controller[_0x8f5a('0x24')]);router['delete'](_0x8f5a('0x25'),auth[_0x8f5a('0xe')](),controller['removeBlackLists']);module[_0x8f5a('0x26')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index a14db54..d7423c4 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 _0x2eb2=['https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','sequelize','exports','STRING','name','ENUM','inbound','outbound','default','ringall','leastrecent','fewestcalls','linear','wrandom','setDataValue','strategy','getDataValue','dialMethod','booked','rrmemory','roundrobin','progressive','predictive','INTEGER','yes','all','once','TEXT','periodic_announce','split','joinempty','join','leavewhenempty','acw','wrapuptime','BOOLEAN','preview','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','tTxX'];(function(_0x4f9d8a,_0x1194cc){var _0x476294=function(_0x5d5220){while(--_0x5d5220){_0x4f9d8a['push'](_0x4f9d8a['shift']());}};_0x476294(++_0x1194cc);}(_0x2eb2,0x1d1));var _0x22eb=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0x2eb2[_0x4c7fb5];return _0x2e10ac;};'use strict';var Sequelize=require(_0x22eb('0x0'));module[_0x22eb('0x1')]={'name':{'type':Sequelize[_0x22eb('0x2')],'allowNull':![],'unique':_0x22eb('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x22eb('0x4')](_0x22eb('0x5'),_0x22eb('0x6')),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize[_0x22eb('0x2')],'defaultValue':_0x22eb('0x7')},'announce':{'type':Sequelize[_0x22eb('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x22eb('0x4')]('rr',_0x22eb('0x8'),_0x22eb('0x9'),_0x22eb('0xa'),'random','rrmemory',_0x22eb('0xb'),_0x22eb('0xc'),'rrordered'),'allowNull':![],'defaultValue':_0x22eb('0x8'),'set':function(_0xb025fa){this[_0x22eb('0xd')](_0x22eb('0xe'),_0xb025fa?_0xb025fa:'rrmemory');},'get':function(){var _0x2cd956=this[_0x22eb('0xf')]('type');var _0x19cd01=this[_0x22eb('0xf')](_0x22eb('0x10'));var _0x38ff10=this[_0x22eb('0xf')](_0x22eb('0xe'));if(_0x2cd956===_0x22eb('0x5')){return _0x38ff10;}if(_0x19cd01===_0x22eb('0x11')&&_0x38ff10===_0x22eb('0x12')||_0x19cd01===_0x22eb('0x11')&&_0x38ff10===_0x22eb('0x13')){return _0x38ff10;}if(_0x19cd01===_0x22eb('0x14')||_0x19cd01===_0x22eb('0x15')||_0x19cd01==='power'){return _0x38ff10;}return null;}},'servicelevel':{'type':Sequelize[_0x22eb('0x16')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x22eb('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x22eb('0x16')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x22eb('0x2')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x22eb('0x16')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x22eb('0x4')](_0x22eb('0x17'),'no'),'defaultValue':_0x22eb('0x17')},'autopause':{'type':Sequelize['ENUM'](_0x22eb('0x17'),'no',_0x22eb('0x18')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x22eb('0x16')](0xb)},'autopausebusy':{'type':Sequelize[_0x22eb('0x4')](_0x22eb('0x17'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x22eb('0x4')]('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x22eb('0x4')](_0x22eb('0x17'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x22eb('0x4')]('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x22eb('0x4')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x22eb('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x22eb('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x22eb('0x16')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x22eb('0x16')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x22eb('0x16')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x22eb('0x4')](_0x22eb('0x17'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x22eb('0x4')](_0x22eb('0x17'),'no'),'defaultValue':_0x22eb('0x17')},'announce_holdtime':{'type':Sequelize[_0x22eb('0x4')](_0x22eb('0x17'),'no',_0x22eb('0x19')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x22eb('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x22eb('0x4')](_0x22eb('0x17'),'no')},'announce_position_limit':{'type':Sequelize[_0x22eb('0x16')](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x22eb('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x22eb('0x2')]},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x22eb('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x22eb('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x22eb('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x22eb('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x22eb('0x2')]},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0x22eb('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x22eb('0x2')]},'queue_less_than':{'type':Sequelize[_0x22eb('0x2')]},'periodic_announce':{'type':Sequelize[_0x22eb('0x1a')],'set':function(_0x1093df){this['setDataValue'](_0x22eb('0x1b'),_0x1093df?_0x1093df['join'](','):[]);},'get':function(){return this[_0x22eb('0xf')](_0x22eb('0x1b'))?this['getDataValue'](_0x22eb('0x1b'))[_0x22eb('0x1c')](','):[];}},'joinempty':{'type':Sequelize[_0x22eb('0x2')],'defaultValue':_0x22eb('0x17'),'set':function(_0x91dc1d){this[_0x22eb('0xd')](_0x22eb('0x1d'),_0x91dc1d?_0x91dc1d[_0x22eb('0x1e')](','):[]);},'get':function(){return this[_0x22eb('0xf')](_0x22eb('0x1d'))?this[_0x22eb('0xf')](_0x22eb('0x1d'))[_0x22eb('0x1c')](','):[];}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x597500){this[_0x22eb('0xd')](_0x22eb('0x1f'),_0x597500?_0x597500[_0x22eb('0x1e')](','):[]);},'get':function(){return this[_0x22eb('0xf')](_0x22eb('0x1f'))?this[_0x22eb('0xf')](_0x22eb('0x1f'))[_0x22eb('0x1c')](','):[];}},'reportholdtime':{'type':Sequelize[_0x22eb('0x4')](_0x22eb('0x17'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x22eb('0x4')](_0x22eb('0x17'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x22eb('0x4')](_0x22eb('0x17'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x22eb('0x2')]},'description':{'type':Sequelize[_0x22eb('0x2')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x3032ef){this['setDataValue'](_0x22eb('0x20'),_0x3032ef);if(_0x3032ef){if(this[_0x22eb('0xf')](_0x22eb('0x21'))<0x2){this[_0x22eb('0xd')]('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize[_0x22eb('0x16')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x22eb('0x22')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize['ENUM'](_0x22eb('0x23'),_0x22eb('0x14'),'power',_0x22eb('0x15'),'booked'),'defaultValue':'progressive','comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize[_0x22eb('0x16')](0x4)[_0x22eb('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize[_0x22eb('0x16')](0x4)[_0x22eb('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x22eb('0x25')},'dialPowerLevel':{'type':Sequelize[_0x22eb('0x26')](0x2)[_0x22eb('0x24')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x22eb('0x27')},'dialPredictiveOptimization':{'type':Sequelize[_0x22eb('0x4')](_0x22eb('0x28'),_0x22eb('0x29')),'defaultValue':'dropRate','comment':_0x22eb('0x2a')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0x22eb('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x22eb('0x2b')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)[_0x22eb('0x24')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x22eb('0x2c')},'dialOriginateCallerIdName':{'type':Sequelize[_0x22eb('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x22eb('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x22eb('0x16')](0x3)[_0x22eb('0x24')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize[_0x22eb('0x2')],'defaultValue':_0x22eb('0x2d'),'comment':_0x22eb('0x2e')},'dialQueueTimeout':{'type':Sequelize[_0x22eb('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize[_0x22eb('0x2')],'comment':_0x22eb('0x2f')},'dialCongestionMaxRetry':{'type':Sequelize[_0x22eb('0x16')](0x3)[_0x22eb('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x22eb('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x22eb('0x16')](0x3)[_0x22eb('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x22eb('0x30')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x22eb('0x16')](0x3)[_0x22eb('0x24')],'defaultValue':0x3,'comment':_0x22eb('0x31')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x22eb('0x16')](0x5)[_0x22eb('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x22eb('0x32')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x22eb('0x24')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x22eb('0x33')},'dialTimezone':{'type':Sequelize[_0x22eb('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x22eb('0x2')],'defaultValue':_0x22eb('0x34')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x22eb('0x4')](_0x22eb('0x35'),_0x22eb('0x36'),'onlyIfOpen'),'defaultValue':_0x22eb('0x35')},'dialAMDActive':{'type':Sequelize[_0x22eb('0x22')],'defaultValue':0x0,'comment':_0x22eb('0x37')},'dialAMDInitialSilence':{'type':Sequelize[_0x22eb('0x16')](0x9)[_0x22eb('0x24')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x22eb('0x16')](0x9)[_0x22eb('0x24')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x22eb('0x38')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x22eb('0x16')](0x9)[_0x22eb('0x24')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x22eb('0x39')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x22eb('0x16')](0x9)[_0x22eb('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x22eb('0x3a')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x22eb('0x24')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x22eb('0x3b')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x22eb('0x16')](0x9)[_0x22eb('0x24')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x22eb('0x3c')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x22eb('0x16')](0x9)[_0x22eb('0x24')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x22eb('0x3d')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x22eb('0x16')](0x5)[_0x22eb('0x24')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x22eb('0x3e')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x22eb('0x16')](0x9)[_0x22eb('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x22eb('0x3f')},'dialRecallMeTimeout':{'type':Sequelize[_0x22eb('0x16')](0x5)[_0x22eb('0x24')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x22eb('0x40')},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x22eb('0x41')},'dialOrderByScheduledAt':{'type':Sequelize[_0x22eb('0x4')](_0x22eb('0x42'),_0x22eb('0x43')),'defaultValue':_0x22eb('0x42')},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0x22eb('0x22')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x22eb('0x22')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x22eb('0x16')](0x3)[_0x22eb('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x22eb('0x44')},'dialCutDigit':{'type':Sequelize[_0x22eb('0x16')](0x3)[_0x22eb('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x22eb('0x45')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x22eb('0x16')],'allowNull':!![],'comment':_0x22eb('0x46')},'mandatoryDisposition':{'type':Sequelize[_0x22eb('0x22')],'defaultValue':![],'comment':_0x22eb('0x47'),'set':function(_0x343b56){if(!_0x343b56)this[_0x22eb('0xd')](_0x22eb('0x48'),null);this[_0x22eb('0xd')]('mandatoryDisposition',_0x343b56);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x22eb('0x24')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x22eb('0x24')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file +var _0xd420=['never','onlyIfOpen','always','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','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','mandatoryDisposition','sequelize','exports','ENUM','outbound','STRING','default','ringall','leastrecent','fewestcalls','wrandom','setDataValue','strategy','rrmemory','getDataValue','type','dialMethod','inbound','booked','roundrobin','progressive','predictive','power','INTEGER','yes','all','once','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','preview','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*'];(function(_0xdd7ed3,_0x32590e){var _0x15d563=function(_0x42b9ca){while(--_0x42b9ca){_0xdd7ed3['push'](_0xdd7ed3['shift']());}};_0x15d563(++_0x32590e);}(_0xd420,0xf6));var _0x0d42=function(_0x26d798,_0x1ce26b){_0x26d798=_0x26d798-0x0;var _0x154c45=_0xd420[_0x26d798];return _0x154c45;};'use strict';var Sequelize=require(_0x0d42('0x0'));module[_0x0d42('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x0d42('0x2')]('inbound',_0x0d42('0x3')),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize[_0x0d42('0x4')],'defaultValue':_0x0d42('0x5')},'announce':{'type':Sequelize[_0x0d42('0x4')],'defaultValue':''},'strategy':{'type':Sequelize[_0x0d42('0x2')]('rr',_0x0d42('0x6'),_0x0d42('0x7'),_0x0d42('0x8'),'random','rrmemory','linear',_0x0d42('0x9'),'rrordered'),'allowNull':![],'defaultValue':_0x0d42('0x6'),'set':function(_0xb320f8){this[_0x0d42('0xa')](_0x0d42('0xb'),_0xb320f8?_0xb320f8:_0x0d42('0xc'));},'get':function(){var _0x431fd9=this[_0x0d42('0xd')](_0x0d42('0xe'));var _0x398d41=this[_0x0d42('0xd')](_0x0d42('0xf'));var _0x3b87d8=this[_0x0d42('0xd')](_0x0d42('0xb'));if(_0x431fd9===_0x0d42('0x10')){return _0x3b87d8;}if(_0x398d41===_0x0d42('0x11')&&_0x3b87d8===_0x0d42('0xc')||_0x398d41===_0x0d42('0x11')&&_0x3b87d8===_0x0d42('0x12')){return _0x3b87d8;}if(_0x398d41===_0x0d42('0x13')||_0x398d41===_0x0d42('0x14')||_0x398d41===_0x0d42('0x15')){return _0x3b87d8;}return null;}},'servicelevel':{'type':Sequelize[_0x0d42('0x16')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x0d42('0x4')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x0d42('0x16')](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x0d42('0x16')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x0d42('0x4')]},'weight':{'type':Sequelize[_0x0d42('0x16')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x0d42('0x16')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x0d42('0x2')](_0x0d42('0x17'),'no'),'defaultValue':_0x0d42('0x17')},'autopause':{'type':Sequelize[_0x0d42('0x2')](_0x0d42('0x17'),'no',_0x0d42('0x18')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x0d42('0x16')](0xb)},'autopausebusy':{'type':Sequelize[_0x0d42('0x2')](_0x0d42('0x17'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x0d42('0x2')]('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x0d42('0x16')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x0d42('0x2')]('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM'](_0x0d42('0x17'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x0d42('0x2')](_0x0d42('0x17'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM'](_0x0d42('0x17'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x0d42('0x4')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x0d42('0x16')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x0d42('0x16')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x0d42('0x16')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM'](_0x0d42('0x17'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0x0d42('0x17'),'no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize[_0x0d42('0x2')](_0x0d42('0x17'),'no',_0x0d42('0x19')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x0d42('0x4')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x0d42('0x2')](_0x0d42('0x17'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0x0d42('0x2')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x0d42('0x4')]},'queue_youarenext':{'type':Sequelize[_0x0d42('0x4')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x0d42('0x4')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x0d42('0x4')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x0d42('0x4')],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x0d42('0x4')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x0d42('0x4')]},'queue_quantity1':{'type':Sequelize[_0x0d42('0x4')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize[_0x0d42('0x4')]},'queue_less_than':{'type':Sequelize[_0x0d42('0x4')]},'periodic_announce':{'type':Sequelize[_0x0d42('0x1a')],'set':function(_0x2be42d){this[_0x0d42('0xa')](_0x0d42('0x1b'),_0x2be42d?_0x2be42d[_0x0d42('0x1c')](','):[]);},'get':function(){return this[_0x0d42('0xd')](_0x0d42('0x1b'))?this[_0x0d42('0xd')](_0x0d42('0x1b'))[_0x0d42('0x1d')](','):[];}},'joinempty':{'type':Sequelize[_0x0d42('0x4')],'defaultValue':_0x0d42('0x17'),'set':function(_0x4c7e5b){this[_0x0d42('0xa')](_0x0d42('0x1e'),_0x4c7e5b?_0x4c7e5b[_0x0d42('0x1c')](','):[]);},'get':function(){return this[_0x0d42('0xd')](_0x0d42('0x1e'))?this['getDataValue'](_0x0d42('0x1e'))['split'](','):[];}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x75174){this['setDataValue'](_0x0d42('0x1f'),_0x75174?_0x75174[_0x0d42('0x1c')](','):[]);},'get':function(){return this[_0x0d42('0xd')](_0x0d42('0x1f'))?this[_0x0d42('0xd')](_0x0d42('0x1f'))['split'](','):[];}},'reportholdtime':{'type':Sequelize[_0x0d42('0x2')](_0x0d42('0x17'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x0d42('0x2')](_0x0d42('0x17'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x0d42('0x16')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x0d42('0x2')](_0x0d42('0x17'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x0d42('0x4')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0x0d42('0x20')],'defaultValue':0x0,'set':function(_0x48fc20){this[_0x0d42('0xa')](_0x0d42('0x21'),_0x48fc20);if(_0x48fc20){if(this[_0x0d42('0xd')]('wrapuptime')<0x2){this[_0x0d42('0xa')](_0x0d42('0x22'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x0d42('0x16')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x0d42('0x20')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0x0d42('0x2')](_0x0d42('0x23'),_0x0d42('0x13'),_0x0d42('0x15'),_0x0d42('0x14'),'booked'),'defaultValue':_0x0d42('0x13'),'comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize[_0x0d42('0x16')](0x4)[_0x0d42('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x0d42('0x25')},'dialLimitQueue':{'type':Sequelize[_0x0d42('0x16')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize[_0x0d42('0x26')](0x2)[_0x0d42('0x24')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x0d42('0x27')},'dialPredictiveOptimization':{'type':Sequelize['ENUM']('agentBusyFactor','dropRate'),'defaultValue':_0x0d42('0x28'),'comment':_0x0d42('0x29')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x0d42('0x26')](0x2)[_0x0d42('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x0d42('0x2a')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x0d42('0x2b')},'dialOriginateCallerIdName':{'type':Sequelize[_0x0d42('0x4')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x0d42('0x4')]},'dialOriginateTimeout':{'type':Sequelize[_0x0d42('0x16')](0x3)[_0x0d42('0x24')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize[_0x0d42('0x4')],'defaultValue':_0x0d42('0x2c'),'comment':_0x0d42('0x2d')},'dialQueueTimeout':{'type':Sequelize[_0x0d42('0x16')](0x3)[_0x0d42('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0d42('0x2e')},'dialQueueProject':{'type':Sequelize['STRING'],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x0d42('0x16')](0x3)[_0x0d42('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0d42('0x2f')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x0d42('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0d42('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0d42('0x30')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0d42('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0d42('0x31')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x0d42('0x16')](0x3)[_0x0d42('0x24')],'defaultValue':0x3,'comment':_0x0d42('0x32')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0d42('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0d42('0x33')},'dialGlobalMaxRetry':{'type':Sequelize[_0x0d42('0x16')](0x3)[_0x0d42('0x24')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x0d42('0x34')},'dialTimezone':{'type':Sequelize[_0x0d42('0x4')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x0d42('0x4')],'defaultValue':_0x0d42('0x35')},'dialPrefix':{'type':Sequelize[_0x0d42('0x4')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM']('always',_0x0d42('0x36'),_0x0d42('0x37')),'defaultValue':_0x0d42('0x38')},'dialAMDActive':{'type':Sequelize[_0x0d42('0x20')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x0d42('0x16')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x0d42('0x39')},'dialAMDGreeting':{'type':Sequelize[_0x0d42('0x16')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x0d42('0x3a')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x0d42('0x16')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x0d42('0x3b')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x0d42('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0d42('0x3c')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x0d42('0x24')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x0d42('0x3d')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x0d42('0x16')](0x9)[_0x0d42('0x24')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x0d42('0x3e')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x0d42('0x16')](0x9)[_0x0d42('0x24')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x0d42('0x3f')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x0d42('0x16')](0x5)[_0x0d42('0x24')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x0d42('0x40')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x0d42('0x16')](0x9)[_0x0d42('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize[_0x0d42('0x16')](0x5)[_0x0d42('0x24')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x0d42('0x41')},'dialRecallInQueue':{'type':Sequelize[_0x0d42('0x20')],'defaultValue':0x0,'comment':_0x0d42('0x42')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x0d42('0x43'),'ASC'),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':_0x0d42('0x44')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x0d42('0x20')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x0d42('0x20')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0d42('0x45')},'dialCutDigit':{'type':Sequelize[_0x0d42('0x16')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0d42('0x46')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0d42('0x16')],'allowNull':!![],'comment':_0x0d42('0x47')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x0d42('0x48'),'set':function(_0x14fcc1){if(!_0x14fcc1)this['setDataValue'](_0x0d42('0x49'),null);this[_0x0d42('0xa')](_0x0d42('0x4a'),_0x14fcc1);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x0d42('0x16')](0x3)[_0x0d42('0x24')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x0d42('0x16')](0x3)[_0x0d42('0x24')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index b87124d..a36ea08 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 _0xa664=['model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','merge','field','options','include','findAll','catch','show','keys','includeAll','create','body','user','get','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','createdAt','updatedAt','omit','Unable\x20to\x20retrieve\x20the\x20current\x20user','inbound','UserProfileSection','getHoppers','findOne','CmHopper','rows','getHopperHistories','VoiceQueueId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','User','Agents','online','voicePause','interface','flatMap','forEach','penalty','each','UserVoiceQueue','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','emit','userVoiceQueue:save','removeTeams','ids','select','tq.TeamId','from','team_has_voice_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','sequelize','every','all','compact','transaction','isEmpty','userVoiceQueue:remove','addAgents','spread','removeAgents','isArray','getAgents','getMembers','getLists','addLists','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','NOW()','CmListId','toString','ListId','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','VoiceQueueId\x20=\x20?','onlyIfOpen','cm_contacts','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','VoiceQueues','QueueCampaigns','outbound','filter','ignore','value','includes','type','find','name','UserProfileResource','error','stack','index','map','VoiceQueue','rawAttributes','key'];(function(_0x5e9116,_0x479cd6){var _0x4043f3=function(_0x4c410e){while(--_0x4c410e){_0x5e9116['push'](_0x5e9116['shift']());}};_0x4043f3(++_0x479cd6);}(_0xa664,0x132));var _0x4a66=function(_0x59d8be,_0x573459){_0x59d8be=_0x59d8be-0x0;var _0x50b3b6=_0xa664[_0x59d8be];return _0x50b3b6;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x4a66('0x0'));var rimraf=require(_0x4a66('0x1'));var zipdir=require(_0x4a66('0x2'));var jsonpatch=require(_0x4a66('0x3'));var rp=require('request-promise');var moment=require(_0x4a66('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4a66('0x5'));var path=require(_0x4a66('0x6'));var sox=require(_0x4a66('0x7'));var csv=require(_0x4a66('0x8'));var ejs=require(_0x4a66('0x9'));var fs=require('fs');var _=require(_0x4a66('0xa'));var squel=require(_0x4a66('0xb'));var crypto=require('crypto');var jsforce=require(_0x4a66('0xc'));var deskjs=require(_0x4a66('0xd'));var toCsv=require(_0x4a66('0x8'));var querystring=require(_0x4a66('0xe'));var Papa=require('papaparse');var Redis=require(_0x4a66('0xf'));var authService=require(_0x4a66('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x4a66('0x11'));var hardwareService=require(_0x4a66('0x12'));var logger=require(_0x4a66('0x13'))(_0x4a66('0x14'));var utils=require(_0x4a66('0x15'));var config=require(_0x4a66('0x16'));var db=require(_0x4a66('0x17'))['db'];config[_0x4a66('0x18')]=_[_0x4a66('0x19')](config[_0x4a66('0x18')],{'host':_0x4a66('0x1a'),'port':0x18eb});var socket=require(_0x4a66('0x1b'))(new Redis(config[_0x4a66('0x18')]));require(_0x4a66('0x1c'))[_0x4a66('0x1d')](socket);function respondWithStatusCode(_0x11fa94,_0x11f34f){_0x11f34f=_0x11f34f||0xcc;return function(_0x4e9868){if(_0x4e9868){return _0x11fa94[_0x4a66('0x1e')](_0x11f34f);}return _0x11fa94[_0x4a66('0x1f')](_0x11f34f)[_0x4a66('0x20')]();};}function respondWithResult(_0x4208f9,_0x199ddf){_0x199ddf=_0x199ddf||0xc8;return function(_0x4625ae){if(_0x4625ae){return _0x4208f9[_0x4a66('0x1f')](_0x199ddf)[_0x4a66('0x21')](_0x4625ae);}};}function respondWithFilteredResult(_0x59fdb0,_0x2d04da){return function(_0x4268fa){if(_0x4268fa){var _0x3e8805=_0x4268fa[_0x4a66('0x22')],_0x33703f=_0x2d04da[_0x4a66('0x23')],_0x509aaf=_0x2d04da['offset']+_0x2d04da['limit'],_0x18a4f8;if(_0x509aaf>=_0x3e8805){_0x509aaf=_0x3e8805;_0x18a4f8=0xc8;}else{_0x18a4f8=0xce;}_0x59fdb0[_0x4a66('0x1f')](_0x18a4f8);return _0x59fdb0[_0x4a66('0x24')](_0x4a66('0x25'),_0x33703f+'-'+_0x509aaf+'/'+_0x3e8805)['json'](_0x4268fa);}return null;};}function patchUpdates(_0x5de482){return function(_0x22ad33){try{jsonpatch[_0x4a66('0x26')](_0x22ad33,_0x5de482,!![]);}catch(_0x426a0e){return BPromise[_0x4a66('0x27')](_0x426a0e);}return _0x22ad33[_0x4a66('0x28')]();};}function saveUpdates(_0x3d649d,_0x451f4e){return function(_0x4384fa){if(_0x4384fa){return _0x4384fa[_0x4a66('0x29')](_0x3d649d)[_0x4a66('0x2a')](function(_0x10274a){return _0x10274a;});}return null;};}function removeEntity(_0x3052cc,_0xad793e){return function(_0x41457b){if(_0x41457b){return _0x41457b[_0x4a66('0x2b')]()[_0x4a66('0x2a')](function(){var _0x2cd979=_0x41457b['get']({'plain':!![]});var _0x2a9ba1=[{'name':_0x4a66('0x2c'),'value':'inbound','ignore':![]},{'name':_0x4a66('0x2d'),'value':_0x4a66('0x2e'),'ignore':![]}];var _0x47184e=_(_0x2a9ba1)[_0x4a66('0x2f')](_0x4a66('0x30'))['map']('value')[_0x4a66('0x31')]();if(_[_0x4a66('0x32')](_0x47184e,_0x2cd979[_0x4a66('0x33')])){return;}var _0x257485=_[_0x4a66('0x34')](_0x2a9ba1,[_0x4a66('0x31'),_0x2cd979[_0x4a66('0x33')]])[_0x4a66('0x35')];return db[_0x4a66('0x36')][_0x4a66('0x2b')]({'where':{'type':_0x257485,'resourceId':_0x2cd979['id']}})[_0x4a66('0x2a')](function(){return _0x41457b;});})[_0x4a66('0x2a')](function(){_0x3052cc['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xc6938d,_0x563501){return function(_0x234d47){if(!_0x234d47){_0xc6938d[_0x4a66('0x1e')](0x194);}return _0x234d47;};}function handleError(_0x4544da,_0x387bac){_0x387bac=_0x387bac||0x1f4;return function(_0x5ec76b){logger[_0x4a66('0x37')](_0x5ec76b[_0x4a66('0x38')]);if(_0x5ec76b[_0x4a66('0x35')]){delete _0x5ec76b[_0x4a66('0x35')];}_0x4544da['status'](_0x387bac)['send'](_0x5ec76b);};}exports[_0x4a66('0x39')]=function(_0x24b7a7,_0x417d97){var _0x278483={},_0x35216b={},_0x458d24={'count':0x0,'rows':[]};var _0x3e0b86=_[_0x4a66('0x3a')](db[_0x4a66('0x3b')][_0x4a66('0x3c')],function(_0x5c309f){return{'name':_0x5c309f['fieldName'],'type':_0x5c309f['type'][_0x4a66('0x3d')]};});_0x35216b[_0x4a66('0x3e')]=_[_0x4a66('0x3a')](_0x3e0b86,_0x4a66('0x35'));_0x35216b[_0x4a66('0x3f')]=_['keys'](_0x24b7a7[_0x4a66('0x3f')]);_0x35216b['filters']=_['intersection'](_0x35216b[_0x4a66('0x3e')],_0x35216b[_0x4a66('0x3f')]);_0x278483[_0x4a66('0x40')]=_[_0x4a66('0x41')](_0x35216b['model'],qs[_0x4a66('0x42')](_0x24b7a7['query'][_0x4a66('0x42')]));_0x278483[_0x4a66('0x40')]=_0x278483[_0x4a66('0x40')][_0x4a66('0x43')]?_0x278483[_0x4a66('0x40')]:_0x35216b[_0x4a66('0x3e')];if(!_0x24b7a7[_0x4a66('0x3f')][_0x4a66('0x44')](_0x4a66('0x45'))){_0x278483[_0x4a66('0x46')]=qs[_0x4a66('0x46')](_0x24b7a7[_0x4a66('0x3f')][_0x4a66('0x46')]);_0x278483[_0x4a66('0x23')]=qs[_0x4a66('0x23')](_0x24b7a7['query']['offset']);}_0x278483[_0x4a66('0x47')]=qs[_0x4a66('0x48')](_0x24b7a7[_0x4a66('0x3f')][_0x4a66('0x48')]);_0x278483[_0x4a66('0x49')]=qs[_0x4a66('0x4a')](_[_0x4a66('0x4b')](_0x24b7a7[_0x4a66('0x3f')],_0x35216b[_0x4a66('0x4a')]));if(_0x24b7a7[_0x4a66('0x3f')][_0x4a66('0x2f')]){_0x278483[_0x4a66('0x49')]=_[_0x4a66('0x4c')](_0x278483[_0x4a66('0x49')],{'$or':_[_0x4a66('0x3a')](_0x3e0b86,function(_0x524d19){if(_0x524d19[_0x4a66('0x33')][_0x4a66('0x3d')]!=='VIRTUAL'){var _0xc071c7={};_0xc071c7[_0x524d19[_0x4a66('0x4d')]]={'$like':'%'+_0x24b7a7[_0x4a66('0x3f')]['filter']+'%'};return _0xc071c7;}})});}_0x278483=_[_0x4a66('0x4c')]({},_0x278483,_0x24b7a7[_0x4a66('0x4e')]);var _0x1353ba={'where':_0x278483['where']};return db[_0x4a66('0x3b')][_0x4a66('0x22')](_0x1353ba)['then'](function(_0x452bf0){_0x458d24['count']=_0x452bf0;if(_0x24b7a7[_0x4a66('0x3f')]['includeAll']){_0x278483[_0x4a66('0x4f')]=[{'all':!![]}];}return db[_0x4a66('0x3b')][_0x4a66('0x50')](_0x278483);})[_0x4a66('0x2a')](function(_0x3c661){_0x458d24['rows']=_0x3c661;return _0x458d24;})['then'](respondWithFilteredResult(_0x417d97,_0x278483))[_0x4a66('0x51')](handleError(_0x417d97,null));};exports[_0x4a66('0x52')]=function(_0x372b7c,_0x1a6374){var _0x27e58f={'raw':![],'where':{'id':_0x372b7c['params']['id']}},_0x515a2b={};_0x515a2b[_0x4a66('0x3e')]=_[_0x4a66('0x53')](db[_0x4a66('0x3b')]['rawAttributes']);_0x515a2b[_0x4a66('0x3f')]=_['keys'](_0x372b7c['query']);_0x515a2b[_0x4a66('0x4a')]=_[_0x4a66('0x41')](_0x515a2b['model'],_0x515a2b[_0x4a66('0x3f')]);_0x27e58f[_0x4a66('0x40')]=_['intersection'](_0x515a2b[_0x4a66('0x3e')],qs[_0x4a66('0x42')](_0x372b7c[_0x4a66('0x3f')][_0x4a66('0x42')]));_0x27e58f[_0x4a66('0x40')]=_0x27e58f['attributes'][_0x4a66('0x43')]?_0x27e58f[_0x4a66('0x40')]:_0x515a2b[_0x4a66('0x3e')];if(_0x372b7c[_0x4a66('0x3f')][_0x4a66('0x54')]){_0x27e58f[_0x4a66('0x4f')]=[{'all':!![]}];}_0x27e58f=_[_0x4a66('0x4c')]({},_0x27e58f,_0x372b7c[_0x4a66('0x4e')]);return db[_0x4a66('0x3b')][_0x4a66('0x34')](_0x27e58f)[_0x4a66('0x2a')](handleEntityNotFound(_0x1a6374,null))[_0x4a66('0x2a')](respondWithResult(_0x1a6374,null))[_0x4a66('0x51')](handleError(_0x1a6374,null));};exports['create']=function(_0x49c725,_0x1a7abe){return db[_0x4a66('0x3b')][_0x4a66('0x55')](_0x49c725[_0x4a66('0x56')],{})[_0x4a66('0x2a')](function(_0x16aa48){var _0x5c4817=_0x49c725[_0x4a66('0x57')][_0x4a66('0x58')]({'plain':!![]});if(!_0x5c4817)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5c4817[_0x4a66('0x59')]===_0x4a66('0x57')){var _0x5ecb9d=_0x16aa48[_0x4a66('0x58')]({'plain':!![]});var _0x59eac3=[{'name':_0x4a66('0x2c'),'value':'inbound'},{'name':'QueueCampaigns','value':_0x4a66('0x2e')}];var _0x7f9ab1=_['find'](_0x59eac3,['value',_0x5ecb9d[_0x4a66('0x33')]])[_0x4a66('0x35')];return db['UserProfileSection'][_0x4a66('0x34')]({'where':{'name':_0x7f9ab1,'userProfileId':_0x5c4817[_0x4a66('0x5a')]},'raw':!![]})[_0x4a66('0x2a')](function(_0x29b1ab){if(_0x29b1ab&&_0x29b1ab[_0x4a66('0x5b')]===0x0){return db[_0x4a66('0x36')]['create']({'name':_0x5ecb9d[_0x4a66('0x35')],'resourceId':_0x5ecb9d['id'],'type':_0x29b1ab[_0x4a66('0x35')],'sectionId':_0x29b1ab['id']},{})[_0x4a66('0x2a')](function(){return _0x16aa48;});}else{return _0x16aa48;}})[_0x4a66('0x51')](function(_0x82ebe0){logger['error'](_0x4a66('0x5c'),_0x82ebe0);throw _0x82ebe0;});}return _0x16aa48;})[_0x4a66('0x2a')](respondWithResult(_0x1a7abe,0xc9))[_0x4a66('0x51')](handleError(_0x1a7abe,null));};exports[_0x4a66('0x5d')]=function(_0x4a9992,_0x25f273){var _0x343521={'raw':![],'where':{'id':_0x4a9992[_0x4a66('0x5e')]['id']}},_0x4270cf={};_0x4270cf['model']=_[_0x4a66('0x53')](db[_0x4a66('0x3b')][_0x4a66('0x3c')]);_0x343521[_0x4a66('0x40')]=_[_0x4a66('0x41')](_0x4270cf[_0x4a66('0x3e')],qs[_0x4a66('0x42')](_0x4a9992[_0x4a66('0x3f')]['fields']));_0x343521[_0x4a66('0x40')]=_0x343521[_0x4a66('0x40')][_0x4a66('0x43')]?_0x343521[_0x4a66('0x40')]:_0x4270cf[_0x4a66('0x3e')];if(_0x4a9992[_0x4a66('0x3f')]['includeAll']){_0x343521[_0x4a66('0x4f')]=[{'all':!![]}];}_0x343521=_[_0x4a66('0x4c')]({},_0x343521,_0x4a9992['options']);return db['VoiceQueue']['find'](_0x343521)[_0x4a66('0x2a')](handleEntityNotFound(_0x25f273,null))[_0x4a66('0x2a')](function(_0x15d4b6){if(_0x15d4b6){var _0x1b7059=_0x15d4b6[_0x4a66('0x58')]({'plain':!![]});_0x1b7059=qs['omit'](_0x1b7059,['id',_0x4a66('0x5f'),_0x4a66('0x60')]);_0x4a9992['body']=_[_0x4a66('0x61')](_0x4a9992[_0x4a66('0x56')],['id',_0x4a66('0x5f'),_0x4a66('0x60')]);return db[_0x4a66('0x3b')]['create'](_[_0x4a66('0x4c')](_0x1b7059,_0x4a9992[_0x4a66('0x56')]),{'include':_0x4a9992[_0x4a66('0x3f')][_0x4a66('0x54')]?[{'all':!![]}]:undefined})['then'](function(_0x5e0550){var _0x1068ed=_0x4a9992[_0x4a66('0x57')][_0x4a66('0x58')]({'plain':!![]});if(!_0x1068ed)throw new Error(_0x4a66('0x62'));if(_0x1068ed[_0x4a66('0x59')]==='user'){var _0x492593=_0x5e0550[_0x4a66('0x58')]({'plain':!![]});var _0x39eadb=[{'name':_0x4a66('0x2c'),'value':_0x4a66('0x63')},{'name':'QueueCampaigns','value':_0x4a66('0x2e')}];var _0x35de1c=_[_0x4a66('0x34')](_0x39eadb,[_0x4a66('0x31'),_0x492593[_0x4a66('0x33')]])[_0x4a66('0x35')];return db[_0x4a66('0x64')][_0x4a66('0x34')]({'where':{'name':_0x35de1c,'userProfileId':_0x1068ed[_0x4a66('0x5a')]},'raw':!![]})[_0x4a66('0x2a')](function(_0x7fec46){if(_0x7fec46&&_0x7fec46[_0x4a66('0x5b')]===0x0){return db[_0x4a66('0x36')][_0x4a66('0x55')]({'name':_0x492593[_0x4a66('0x35')],'resourceId':_0x492593['id'],'type':_0x7fec46[_0x4a66('0x35')],'sectionId':_0x7fec46['id']},{})[_0x4a66('0x2a')](function(){return _0x5e0550;});}else{return _0x5e0550;}})[_0x4a66('0x51')](function(_0x28947b){logger['error'](_0x4a66('0x5c'),_0x28947b);throw _0x28947b;});}return _0x5e0550;});}})[_0x4a66('0x2a')](respondWithResult(_0x25f273,0xc9))['catch'](handleError(_0x25f273,null));};exports[_0x4a66('0x29')]=function(_0x2462f0,_0x3159c3){if(_0x2462f0[_0x4a66('0x56')]['id']){delete _0x2462f0[_0x4a66('0x56')]['id'];}return db[_0x4a66('0x3b')]['find']({'where':{'id':_0x2462f0[_0x4a66('0x5e')]['id']}})[_0x4a66('0x2a')](handleEntityNotFound(_0x3159c3,null))[_0x4a66('0x2a')](saveUpdates(_0x2462f0[_0x4a66('0x56')],null))['then'](respondWithResult(_0x3159c3,null))[_0x4a66('0x51')](handleError(_0x3159c3,null));};exports['destroy']=function(_0x54d6e5,_0x26f436){return db[_0x4a66('0x3b')]['find']({'where':{'id':_0x54d6e5[_0x4a66('0x5e')]['id']}})[_0x4a66('0x2a')](handleEntityNotFound(_0x26f436,null))['then'](removeEntity(_0x26f436,null))[_0x4a66('0x51')](handleError(_0x26f436,null));};exports[_0x4a66('0x65')]=function(_0x923dd7,_0x4796f9,_0x517aa0){var _0xb28e5f={'raw':![],'where':{}};var _0xb9519c={};var _0x496abe={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x4a66('0x66')]({'where':{'id':_0x923dd7[_0x4a66('0x5e')]['id']}})[_0x4a66('0x2a')](handleEntityNotFound(_0x4796f9,null))[_0x4a66('0x2a')](function(_0xde198d){if(_0xde198d){_0xb9519c[_0x4a66('0x3e')]=_[_0x4a66('0x53')](db[_0x4a66('0x67')]['rawAttributes']);_0xb9519c[_0x4a66('0x3f')]=_[_0x4a66('0x53')](_0x923dd7['query']);_0xb9519c['filters']=_['intersection'](_0xb9519c[_0x4a66('0x3e')],_0xb9519c[_0x4a66('0x3f')]);_0xb28e5f[_0x4a66('0x40')]=_[_0x4a66('0x41')](_0xb9519c[_0x4a66('0x3e')],qs[_0x4a66('0x42')](_0x923dd7[_0x4a66('0x3f')][_0x4a66('0x42')]));_0xb28e5f[_0x4a66('0x40')]=_0xb28e5f[_0x4a66('0x40')]['length']?_0xb28e5f[_0x4a66('0x40')]:_0xb9519c[_0x4a66('0x3e')];if(!_0x923dd7['query']['hasOwnProperty']('nolimit')){_0xb28e5f['limit']=qs[_0x4a66('0x46')](_0x923dd7[_0x4a66('0x3f')]['limit']);_0xb28e5f[_0x4a66('0x23')]=qs['offset'](_0x923dd7[_0x4a66('0x3f')]['offset']);}_0xb28e5f['order']=qs[_0x4a66('0x48')](_0x923dd7['query'][_0x4a66('0x48')]);_0xb28e5f['where']=qs[_0x4a66('0x4a')](_[_0x4a66('0x4b')](_0x923dd7['query'],_0xb9519c[_0x4a66('0x4a')]));_0xb28e5f['where']['VoiceQueueId']=_0xde198d['id'];if(_0x923dd7[_0x4a66('0x3f')][_0x4a66('0x2f')]){_0xb28e5f[_0x4a66('0x49')]=_['merge'](_0xb28e5f[_0x4a66('0x49')],{'$or':_[_0x4a66('0x3a')](_0xb28e5f[_0x4a66('0x40')],function(_0x31ad73){var _0x4837db={};_0x4837db[_0x31ad73]={'$like':'%'+_0x923dd7['query'][_0x4a66('0x2f')]+'%'};return _0x4837db;})});}_0xb28e5f=_[_0x4a66('0x4c')]({},_0xb28e5f,_0x923dd7['options']);return db[_0x4a66('0x67')][_0x4a66('0x22')]({'where':_0xb28e5f[_0x4a66('0x49')]})[_0x4a66('0x2a')](function(_0x398ff2){_0x496abe[_0x4a66('0x22')]=_0x398ff2;if(_0x923dd7[_0x4a66('0x3f')][_0x4a66('0x54')]){_0xb28e5f[_0x4a66('0x4f')]=[{'all':!![]}];}return db[_0x4a66('0x67')][_0x4a66('0x50')](_0xb28e5f);})[_0x4a66('0x2a')](function(_0x59abfe){_0x496abe[_0x4a66('0x68')]=_0x59abfe;return _0x496abe;});}})[_0x4a66('0x2a')](respondWithFilteredResult(_0x4796f9,_0xb28e5f))['catch'](handleError(_0x4796f9,null));};exports[_0x4a66('0x69')]=function(_0x4293ec,_0x39d0fb,_0x74a5de){var _0x301563={'raw':!![],'where':{}};var _0x51f232={};var _0x11d492={'count':0x0,'rows':[]};return db[_0x4a66('0x3b')][_0x4a66('0x66')]({'where':{'id':_0x4293ec[_0x4a66('0x5e')]['id']}})[_0x4a66('0x2a')](handleEntityNotFound(_0x39d0fb,null))[_0x4a66('0x2a')](function(_0x25f0e1){if(_0x25f0e1){_0x51f232['model']=_[_0x4a66('0x53')](db['CmHopperHistory'][_0x4a66('0x3c')]);_0x51f232[_0x4a66('0x3f')]=_[_0x4a66('0x53')](_0x4293ec['query']);_0x51f232[_0x4a66('0x4a')]=_[_0x4a66('0x41')](_0x51f232['model'],_0x51f232[_0x4a66('0x3f')]);_0x301563[_0x4a66('0x40')]=_['intersection'](_0x51f232[_0x4a66('0x3e')],qs[_0x4a66('0x42')](_0x4293ec[_0x4a66('0x3f')][_0x4a66('0x42')]));_0x301563['attributes']=_0x301563['attributes'][_0x4a66('0x43')]?_0x301563['attributes']:_0x51f232[_0x4a66('0x3e')];if(!_0x4293ec[_0x4a66('0x3f')][_0x4a66('0x44')](_0x4a66('0x45'))){_0x301563[_0x4a66('0x46')]=qs[_0x4a66('0x46')](_0x4293ec[_0x4a66('0x3f')][_0x4a66('0x46')]);_0x301563[_0x4a66('0x23')]=qs[_0x4a66('0x23')](_0x4293ec['query'][_0x4a66('0x23')]);}_0x301563['order']=qs['sort'](_0x4293ec[_0x4a66('0x3f')][_0x4a66('0x48')]);_0x301563[_0x4a66('0x49')]=qs[_0x4a66('0x4a')](_[_0x4a66('0x4b')](_0x4293ec[_0x4a66('0x3f')],_0x51f232[_0x4a66('0x4a')]));_0x301563[_0x4a66('0x49')][_0x4a66('0x6a')]=_0x25f0e1['id'];if(_0x4293ec[_0x4a66('0x3f')]['filter']){_0x301563[_0x4a66('0x49')]=_['merge'](_0x301563[_0x4a66('0x49')],{'$or':_[_0x4a66('0x3a')](_0x301563[_0x4a66('0x40')],function(_0xcd27b5){var _0x4f1ac4={};_0x4f1ac4[_0xcd27b5]={'$like':'%'+_0x4293ec[_0x4a66('0x3f')][_0x4a66('0x2f')]+'%'};return _0x4f1ac4;})});}_0x301563=_[_0x4a66('0x4c')]({},_0x301563,_0x4293ec[_0x4a66('0x4e')]);return db['CmHopperHistory'][_0x4a66('0x22')]({'where':_0x301563['where']})[_0x4a66('0x2a')](function(_0x4948d0){_0x11d492[_0x4a66('0x22')]=_0x4948d0;if(_0x4293ec[_0x4a66('0x3f')][_0x4a66('0x54')]){_0x301563[_0x4a66('0x4f')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x4a66('0x50')](_0x301563);})[_0x4a66('0x2a')](function(_0x2bfed8){_0x11d492[_0x4a66('0x68')]=_0x2bfed8;return _0x11d492;});}})[_0x4a66('0x2a')](respondWithFilteredResult(_0x39d0fb,_0x301563))[_0x4a66('0x51')](handleError(_0x39d0fb,null));};exports[_0x4a66('0x6b')]=function(_0x382845,_0x15eb23,_0x322c80){var _0x2bcd81={'raw':!![],'where':{}};var _0x1dd9c9={};var _0x12447b={'count':0x0,'rows':[]};return db[_0x4a66('0x3b')][_0x4a66('0x66')]({'where':{'id':_0x382845[_0x4a66('0x5e')]['id']}})[_0x4a66('0x2a')](handleEntityNotFound(_0x15eb23,null))[_0x4a66('0x2a')](function(_0x92873c){if(_0x92873c){_0x1dd9c9[_0x4a66('0x3e')]=_[_0x4a66('0x53')](db[_0x4a66('0x6c')][_0x4a66('0x3c')]);_0x1dd9c9[_0x4a66('0x3f')]=_['keys'](_0x382845[_0x4a66('0x3f')]);_0x1dd9c9[_0x4a66('0x4a')]=_['intersection'](_0x1dd9c9['model'],_0x1dd9c9[_0x4a66('0x3f')]);_0x2bcd81[_0x4a66('0x40')]=_[_0x4a66('0x41')](_0x1dd9c9[_0x4a66('0x3e')],qs[_0x4a66('0x42')](_0x382845[_0x4a66('0x3f')][_0x4a66('0x42')]));_0x2bcd81['attributes']=_0x2bcd81['attributes'][_0x4a66('0x43')]?_0x2bcd81[_0x4a66('0x40')]:_0x1dd9c9['model'];if(!_0x382845[_0x4a66('0x3f')][_0x4a66('0x44')](_0x4a66('0x45'))){_0x2bcd81[_0x4a66('0x46')]=qs[_0x4a66('0x46')](_0x382845[_0x4a66('0x3f')]['limit']);_0x2bcd81['offset']=qs[_0x4a66('0x23')](_0x382845['query'][_0x4a66('0x23')]);}_0x2bcd81[_0x4a66('0x47')]=qs[_0x4a66('0x48')](_0x382845[_0x4a66('0x3f')][_0x4a66('0x48')]);_0x2bcd81[_0x4a66('0x49')]=qs['filters'](_[_0x4a66('0x4b')](_0x382845[_0x4a66('0x3f')],_0x1dd9c9['filters']));_0x2bcd81[_0x4a66('0x49')]['VoiceQueueId']=_0x92873c['id'];if(_0x382845[_0x4a66('0x3f')][_0x4a66('0x2f')]){_0x2bcd81[_0x4a66('0x49')]=_['merge'](_0x2bcd81[_0x4a66('0x49')],{'$or':_[_0x4a66('0x3a')](_0x2bcd81[_0x4a66('0x40')],function(_0x3c17d6){var _0x1864df={};_0x1864df[_0x3c17d6]={'$like':'%'+_0x382845['query'][_0x4a66('0x2f')]+'%'};return _0x1864df;})});}_0x2bcd81=_[_0x4a66('0x4c')]({},_0x2bcd81,_0x382845[_0x4a66('0x4e')]);return db[_0x4a66('0x6c')]['count']({'where':_0x2bcd81[_0x4a66('0x49')]})[_0x4a66('0x2a')](function(_0x1ac1e4){_0x12447b[_0x4a66('0x22')]=_0x1ac1e4;if(_0x382845['query'][_0x4a66('0x54')]){_0x2bcd81[_0x4a66('0x4f')]=[{'all':!![]}];}return db[_0x4a66('0x6c')][_0x4a66('0x50')](_0x2bcd81);})[_0x4a66('0x2a')](function(_0x39a3dd){_0x12447b[_0x4a66('0x68')]=_0x39a3dd;return _0x12447b;});}})[_0x4a66('0x2a')](respondWithFilteredResult(_0x15eb23,_0x2bcd81))['catch'](handleError(_0x15eb23,null));};exports[_0x4a66('0x6d')]=function(_0x4ed3f5,_0x4ad984,_0x567182){var _0x3a920e={'raw':!![],'where':{}};var _0x56769e={};var _0x3f8d6c={'count':0x0,'rows':[]};return db[_0x4a66('0x3b')][_0x4a66('0x66')]({'where':{'id':_0x4ed3f5[_0x4a66('0x5e')]['id']}})[_0x4a66('0x2a')](handleEntityNotFound(_0x4ad984,null))[_0x4a66('0x2a')](function(_0x2b9720){if(_0x2b9720){_0x56769e[_0x4a66('0x3e')]=_[_0x4a66('0x53')](db[_0x4a66('0x6e')][_0x4a66('0x3c')]);_0x56769e[_0x4a66('0x3f')]=_[_0x4a66('0x53')](_0x4ed3f5[_0x4a66('0x3f')]);_0x56769e[_0x4a66('0x4a')]=_['intersection'](_0x56769e[_0x4a66('0x3e')],_0x56769e[_0x4a66('0x3f')]);_0x3a920e[_0x4a66('0x40')]=_['intersection'](_0x56769e[_0x4a66('0x3e')],qs[_0x4a66('0x42')](_0x4ed3f5[_0x4a66('0x3f')]['fields']));_0x3a920e[_0x4a66('0x40')]=_0x3a920e[_0x4a66('0x40')][_0x4a66('0x43')]?_0x3a920e[_0x4a66('0x40')]:_0x56769e['model'];if(!_0x4ed3f5['query'][_0x4a66('0x44')](_0x4a66('0x45'))){_0x3a920e[_0x4a66('0x46')]=qs[_0x4a66('0x46')](_0x4ed3f5[_0x4a66('0x3f')][_0x4a66('0x46')]);_0x3a920e[_0x4a66('0x23')]=qs['offset'](_0x4ed3f5[_0x4a66('0x3f')][_0x4a66('0x23')]);}_0x3a920e['order']=qs['sort'](_0x4ed3f5[_0x4a66('0x3f')][_0x4a66('0x48')]);_0x3a920e[_0x4a66('0x49')]=qs[_0x4a66('0x4a')](_[_0x4a66('0x4b')](_0x4ed3f5['query'],_0x56769e[_0x4a66('0x4a')]));_0x3a920e['where'][_0x4a66('0x6a')]=_0x2b9720['id'];if(_0x4ed3f5[_0x4a66('0x3f')][_0x4a66('0x2f')]){_0x3a920e[_0x4a66('0x49')]=_['merge'](_0x3a920e[_0x4a66('0x49')],{'$or':_[_0x4a66('0x3a')](_0x3a920e[_0x4a66('0x40')],function(_0x17afc2){var _0x15a0bb={};_0x15a0bb[_0x17afc2]={'$like':'%'+_0x4ed3f5['query'][_0x4a66('0x2f')]+'%'};return _0x15a0bb;})});}_0x3a920e=_[_0x4a66('0x4c')]({},_0x3a920e,_0x4ed3f5[_0x4a66('0x4e')]);return db[_0x4a66('0x6e')]['count']({'where':_0x3a920e[_0x4a66('0x49')]})['then'](function(_0x19193f){_0x3f8d6c[_0x4a66('0x22')]=_0x19193f;if(_0x4ed3f5[_0x4a66('0x3f')]['includeAll']){_0x3a920e[_0x4a66('0x4f')]=[{'all':!![]}];}return db[_0x4a66('0x6e')][_0x4a66('0x50')](_0x3a920e);})[_0x4a66('0x2a')](function(_0x20719f){_0x3f8d6c['rows']=_0x20719f;return _0x3f8d6c;});}})['then'](respondWithFilteredResult(_0x4ad984,_0x3a920e))['catch'](handleError(_0x4ad984,null));};exports[_0x4a66('0x6f')]=function(_0x16c00c,_0x310bcf,_0x36a71e){var _0x997fe5={};var _0x22c455={};var _0x5a5737;var _0xfcd4e1;return db['VoiceQueue'][_0x4a66('0x66')]({'where':{'id':_0x16c00c[_0x4a66('0x5e')]['id']}})[_0x4a66('0x2a')](handleEntityNotFound(_0x310bcf,null))['then'](function(_0x3c5aba){if(_0x3c5aba){_0x5a5737=_0x3c5aba;_0x22c455[_0x4a66('0x3e')]=_['keys'](db[_0x4a66('0x70')][_0x4a66('0x3c')]);_0x22c455[_0x4a66('0x3f')]=_[_0x4a66('0x53')](_0x16c00c[_0x4a66('0x3f')]);_0x22c455['filters']=_[_0x4a66('0x41')](_0x22c455[_0x4a66('0x3e')],_0x22c455[_0x4a66('0x3f')]);_0x997fe5['attributes']=_[_0x4a66('0x41')](_0x22c455[_0x4a66('0x3e')],qs[_0x4a66('0x42')](_0x16c00c[_0x4a66('0x3f')][_0x4a66('0x42')]));_0x997fe5[_0x4a66('0x40')]=_0x997fe5['attributes'][_0x4a66('0x43')]?_0x997fe5['attributes']:_0x22c455['model'];_0x997fe5['order']=qs[_0x4a66('0x48')](_0x16c00c[_0x4a66('0x3f')][_0x4a66('0x48')]);_0x997fe5[_0x4a66('0x49')]=qs[_0x4a66('0x4a')](_[_0x4a66('0x4b')](_0x16c00c[_0x4a66('0x3f')],_0x22c455[_0x4a66('0x4a')]));if(_0x16c00c[_0x4a66('0x3f')][_0x4a66('0x2f')]){_0x997fe5['where']=_[_0x4a66('0x4c')](_0x997fe5[_0x4a66('0x49')],{'$or':_[_0x4a66('0x3a')](_0x997fe5[_0x4a66('0x40')],function(_0x5672f9){var _0xc8f86a={};_0xc8f86a[_0x5672f9]={'$like':'%'+_0x16c00c[_0x4a66('0x3f')][_0x4a66('0x2f')]+'%'};return _0xc8f86a;})});}_0x997fe5=_[_0x4a66('0x4c')]({},_0x997fe5,_0x16c00c[_0x4a66('0x4e')]);return _0x5a5737[_0x4a66('0x6f')](_0x997fe5);}})['then'](function(_0x590338){if(_0x590338){_0xfcd4e1=_0x590338[_0x4a66('0x43')];if(!_0x16c00c[_0x4a66('0x3f')][_0x4a66('0x44')](_0x4a66('0x45'))){_0x997fe5[_0x4a66('0x46')]=qs[_0x4a66('0x46')](_0x16c00c[_0x4a66('0x3f')][_0x4a66('0x46')]);_0x997fe5[_0x4a66('0x23')]=qs['offset'](_0x16c00c['query'][_0x4a66('0x23')]);}return _0x5a5737[_0x4a66('0x6f')](_0x997fe5);}})[_0x4a66('0x2a')](function(_0x1f2774){if(_0x1f2774){return _0x1f2774?{'count':_0xfcd4e1,'rows':_0x1f2774}:null;}})[_0x4a66('0x2a')](respondWithResult(_0x310bcf,null))[_0x4a66('0x51')](handleError(_0x310bcf,null));};exports[_0x4a66('0x71')]=function(_0x56a605,_0x18098f,_0x1ef251){var _0x35fae6=_0x56a605['body']['teams'];var _0x2d28c3=_[_0x4a66('0x3a')](_0x35fae6,'id');return db[_0x4a66('0x70')][_0x4a66('0x50')]({'where':{'id':_0x2d28c3},'attributes':['id'],'include':[{'model':db[_0x4a66('0x72')],'as':_0x4a66('0x73'),'attributes':['id',_0x4a66('0x35'),_0x4a66('0x74'),_0x4a66('0x75'),_0x4a66('0x76')],'raw':!![]}]})['then'](function(_0x458c94){if(_0x458c94){var _0x55a2f8=_[_0x4a66('0x77')](_0x458c94,function(_0x131aad){var _0x5af92d=_0x131aad['get']({'plain':!![]});_0x5af92d[_0x4a66('0x73')][_0x4a66('0x78')](function(_0x3b9780){_0x3b9780[_0x4a66('0x79')]=_[_0x4a66('0x34')](_0x35fae6,{'id':_0x5af92d['id']})[_0x4a66('0x79')];});return _0x5af92d['Agents'];});return db[_0x4a66('0x3b')][_0x4a66('0x34')]({'where':{'id':_0x56a605[_0x4a66('0x5e')]['id']}})[_0x4a66('0x2a')](function(_0x42959e){return db['sequelize']['transaction'](function(_0x4e8e05){return _0x42959e['addTeams'](_0x2d28c3,{'transaction':_0x4e8e05})['then'](function(){return BPromise[_0x4a66('0x7a')](_0x55a2f8,function(_0x29f103){return db[_0x4a66('0x7b')]['findOrCreate']({'where':{'UserId':_0x29f103['id'],'VoiceQueueId':_0x56a605[_0x4a66('0x5e')]['id']},'defaults':{'penalty':_0x29f103[_0x4a66('0x79')]},'transaction':_0x4e8e05});});})[_0x4a66('0x2a')](function(){return BPromise['each'](_['filter'](_0x55a2f8,{'online':!![]}),function(_0xf7a8ec){return db[_0x4a66('0x7c')][_0x4a66('0x7d')]({'membername':_0xf7a8ec['name'],'UserId':_0xf7a8ec['id'],'queue_name':_0x42959e[_0x4a66('0x35')],'VoiceQueueId':_0x42959e['id'],'interface':_[_0x4a66('0x7e')](_0xf7a8ec[_0x4a66('0x76')])?util[_0x4a66('0x7f')](_0x4a66('0x80'),_0xf7a8ec[_0x4a66('0x35')]):_0xf7a8ec[_0x4a66('0x76')],'paused':_0xf7a8ec[_0x4a66('0x75')]||![],'penalty':_0xf7a8ec[_0x4a66('0x79')]},{'transaction':_0x4e8e05});});})['then'](function(){_0x55a2f8[_0x4a66('0x78')](function(_0x142531){socket[_0x4a66('0x81')](_0x4a66('0x82'),{'UserId':_0x142531['id'],'VoiceQueueId':_0x42959e['id']});});});});});}})[_0x4a66('0x2a')](respondWithStatusCode(_0x18098f,null))[_0x4a66('0x51')](handleError(_0x18098f,null));};exports[_0x4a66('0x83')]=function(_0x91188b,_0x10cea2,_0x5046fb){return db['Team'][_0x4a66('0x50')]({'where':{'id':_0x91188b[_0x4a66('0x3f')][_0x4a66('0x84')]},'attributes':['id'],'include':[{'model':db[_0x4a66('0x72')],'as':_0x4a66('0x73'),'attributes':['id'],'raw':!![]}]})[_0x4a66('0x2a')](handleEntityNotFound(_0x10cea2,null))[_0x4a66('0x2a')](function(_0x3f72b9){var _0x61d331=_[_0x4a66('0x3a')](_0x3f72b9,'id');var _0x1e2ebf=[];var _0x585b9f=[];var _0x575d76=squel[_0x4a66('0x85')]();_0x575d76[_0x4a66('0x4d')](_0x4a66('0x86'))[_0x4a66('0x87')](_0x4a66('0x88'),'tq')['join'](_0x4a66('0x89'),'ut',_0x4a66('0x8a'))[_0x4a66('0x49')]('VoiceQueueId\x20=\x20?',_0x91188b[_0x4a66('0x5e')]['id']);for(var _0x232cc9=0x0;_0x232cc9<_0x3f72b9[_0x4a66('0x43')];_0x232cc9+=0x1){let _0x438cc0=_0x3f72b9[_0x232cc9];for(var _0x3b2302=0x0;_0x3b2302<_0x438cc0['Agents'][_0x4a66('0x43')];_0x3b2302+=0x1){let _0x248d30=_0x438cc0[_0x4a66('0x73')][_0x3b2302];var _0x34630c=_0x575d76[_0x4a66('0x5d')]();_0x34630c[_0x4a66('0x49')](_0x4a66('0x8b'),_0x248d30['id']);_0x585b9f[_0x4a66('0x8c')](db[_0x4a66('0x8d')][_0x4a66('0x3f')](_0x34630c['toString'](),{'type':db[_0x4a66('0x8d')]['QueryTypes']['SELECT']})[_0x4a66('0x2a')](function(_0x58fa4a){if(_0x58fa4a['length']===0x1){return _0x248d30['id'];}else{var _0x4bb27e=_[_0x4a66('0x8e')](_['map'](_0x58fa4a,'TeamId'),function(_0x1285c4){return _[_0x4a66('0x32')](_0x61d331,_0x1285c4);});if(_0x4bb27e){return _0x248d30['id'];}}}));}}return BPromise[_0x4a66('0x8f')](_0x585b9f)[_0x4a66('0x2a')](function(_0x525d4a){_0x1e2ebf=_(_0x1e2ebf)['union'](_0x525d4a)[_0x4a66('0x90')]()[_0x4a66('0x31')]();return db[_0x4a66('0x3b')][_0x4a66('0x34')]({'where':{'id':_0x91188b[_0x4a66('0x5e')]['id']}})[_0x4a66('0x2a')](function(_0x3c58bf){return db[_0x4a66('0x8d')][_0x4a66('0x91')](function(_0x1a7e74){return _0x3c58bf['removeTeams'](_0x91188b[_0x4a66('0x3f')][_0x4a66('0x84')],{'transaction':_0x1a7e74})['then'](function(){if(!_[_0x4a66('0x92')](_0x1e2ebf)){return _0x3c58bf['removeAgents'](_0x1e2ebf,{'transaction':_0x1a7e74})['then'](function(){return db[_0x4a66('0x7c')][_0x4a66('0x2b')]({'where':{'VoiceQueueId':_0x91188b[_0x4a66('0x5e')]['id'],'UserId':_0x1e2ebf},'transaction':_0x1a7e74});});}})[_0x4a66('0x2a')](function(){_0x1e2ebf[_0x4a66('0x78')](function(_0x49e15c){socket[_0x4a66('0x81')](_0x4a66('0x93'),{'UserId':_0x49e15c,'VoiceQueueId':_0x3c58bf['id']});});});});});});})[_0x4a66('0x2a')](respondWithStatusCode(_0x10cea2,null))[_0x4a66('0x51')](handleError(_0x10cea2,null));};exports[_0x4a66('0x94')]=function(_0x1c7df9,_0x428dad,_0x4efeac){var _0x5cc937,_0xd5aee;return db['VoiceQueue'][_0x4a66('0x34')]({'where':{'id':_0x1c7df9[_0x4a66('0x5e')]['id']}})[_0x4a66('0x2a')](handleEntityNotFound(_0x428dad,null))[_0x4a66('0x2a')](function(_0x1cca17){if(_0x1cca17){_0xd5aee=_0x1cca17;return _0x1cca17[_0x4a66('0x94')](_0x1c7df9[_0x4a66('0x56')]['ids'],_[_0x4a66('0x61')](_0x1c7df9[_0x4a66('0x56')],[_0x4a66('0x84'),'id'])||{})[_0x4a66('0x95')](function(_0x4bf331){for(var _0x267b42=0x0;_0x267b42<_0x1c7df9['body'][_0x4a66('0x84')][_0x4a66('0x43')];_0x267b42+=0x1){socket[_0x4a66('0x81')](_0x4a66('0x82'),{'UserId':_0x1c7df9[_0x4a66('0x56')][_0x4a66('0x84')][_0x267b42],'VoiceQueueId':_0x1c7df9['params']['id']});}return _0x4bf331;});}})[_0x4a66('0x2a')](function(_0x49fc29){_0x5cc937=_0x49fc29||[];if(_0xd5aee){return db[_0x4a66('0x72')][_0x4a66('0x50')]({'where':{'id':_0x1c7df9['body'][_0x4a66('0x84')]},'attributes':['id',_0x4a66('0x35'),_0x4a66('0x74'),'voicePause','interface'],'raw':!![]});}})['then'](function(_0x58ef44){if(!_[_0x4a66('0x92')](_0x58ef44)){var _0x4017ff=[];for(var _0x4d39a8=0x0;_0x4d39a8<_0x58ef44[_0x4a66('0x43')];_0x4d39a8++){if(_0x58ef44[_0x4d39a8][_0x4a66('0x74')]){_0x4017ff[_0x4a66('0x8c')](db['UserVoiceQueueRt'][_0x4a66('0x7d')]({'membername':_0x58ef44[_0x4d39a8][_0x4a66('0x35')],'UserId':_0x58ef44[_0x4d39a8]['id'],'queue_name':_0xd5aee[_0x4a66('0x35')],'VoiceQueueId':_0xd5aee['id'],'interface':_[_0x4a66('0x7e')](_0x58ef44[_0x4d39a8][_0x4a66('0x76')])?util[_0x4a66('0x7f')]('SIP/%s',_0x58ef44[_0x4d39a8][_0x4a66('0x35')]):_0x58ef44[_0x4d39a8][_0x4a66('0x76')],'paused':_0x58ef44[_0x4d39a8][_0x4a66('0x75')]||![],'penalty':_0x1c7df9['body'][_0x4a66('0x79')]||0x0}));}}return BPromise[_0x4a66('0x8f')](_0x4017ff);}})['then'](function(){return _0x5cc937;})[_0x4a66('0x2a')](respondWithResult(_0x428dad,null))[_0x4a66('0x51')](handleError(_0x428dad,null));};exports[_0x4a66('0x96')]=function(_0x217497,_0x762552,_0x186c9c){return db[_0x4a66('0x3b')]['find']({'where':{'id':_0x217497[_0x4a66('0x5e')]['id']}})[_0x4a66('0x2a')](handleEntityNotFound(_0x762552,null))[_0x4a66('0x2a')](function(_0x420b88){if(_0x420b88){return _0x420b88[_0x4a66('0x96')](_0x217497[_0x4a66('0x3f')][_0x4a66('0x84')])['then'](function(){if(_[_0x4a66('0x97')](_0x217497['query'][_0x4a66('0x84')])){for(var _0x14e5b5=0x0;_0x14e5b5<_0x217497[_0x4a66('0x3f')][_0x4a66('0x84')][_0x4a66('0x43')];_0x14e5b5+=0x1){socket[_0x4a66('0x81')](_0x4a66('0x93'),{'UserId':Number(_0x217497[_0x4a66('0x3f')][_0x4a66('0x84')][_0x14e5b5]),'VoiceQueueId':Number(_0x217497[_0x4a66('0x5e')]['id'])});}}else{socket[_0x4a66('0x81')](_0x4a66('0x93'),{'UserId':Number(_0x217497[_0x4a66('0x3f')][_0x4a66('0x84')]),'VoiceQueueId':Number(_0x217497[_0x4a66('0x5e')]['id'])});}});}})[_0x4a66('0x2a')](function(_0x4e3cee){return db['UserVoiceQueueRt'][_0x4a66('0x2b')]({'where':{'VoiceQueueId':_0x217497[_0x4a66('0x5e')]['id'],'UserId':_0x217497[_0x4a66('0x3f')][_0x4a66('0x84')]}})[_0x4a66('0x2a')](function(){return _0x4e3cee;});})[_0x4a66('0x2a')](respondWithStatusCode(_0x762552,null))[_0x4a66('0x51')](handleError(_0x762552,null));};exports[_0x4a66('0x98')]=function(_0x44925e,_0xbdb920,_0x39b1d6){var _0x9dcc35={};var _0x176411={};var _0x2b9d0e;var _0x208330;return db[_0x4a66('0x3b')]['findOne']({'where':{'id':_0x44925e[_0x4a66('0x5e')]['id']}})[_0x4a66('0x2a')](handleEntityNotFound(_0xbdb920,null))[_0x4a66('0x2a')](function(_0x160e5a){if(_0x160e5a){_0x2b9d0e=_0x160e5a;_0x176411[_0x4a66('0x3e')]=_[_0x4a66('0x53')](db['User'][_0x4a66('0x3c')]);_0x176411[_0x4a66('0x3f')]=_[_0x4a66('0x53')](_0x44925e[_0x4a66('0x3f')]);_0x176411['filters']=_[_0x4a66('0x41')](_0x176411['model'],_0x176411[_0x4a66('0x3f')]);_0x9dcc35[_0x4a66('0x40')]=_[_0x4a66('0x41')](_0x176411[_0x4a66('0x3e')],qs[_0x4a66('0x42')](_0x44925e[_0x4a66('0x3f')][_0x4a66('0x42')]));_0x9dcc35['attributes']=_0x9dcc35[_0x4a66('0x40')]['length']?_0x9dcc35[_0x4a66('0x40')]:_0x176411[_0x4a66('0x3e')];_0x9dcc35[_0x4a66('0x47')]=qs[_0x4a66('0x48')](_0x44925e[_0x4a66('0x3f')][_0x4a66('0x48')]);_0x9dcc35['where']=qs[_0x4a66('0x4a')](_[_0x4a66('0x4b')](_0x44925e[_0x4a66('0x3f')],_0x176411[_0x4a66('0x4a')]));if(_0x44925e[_0x4a66('0x3f')][_0x4a66('0x2f')]){_0x9dcc35[_0x4a66('0x49')]=_[_0x4a66('0x4c')](_0x9dcc35[_0x4a66('0x49')],{'$or':_[_0x4a66('0x3a')](_0x9dcc35[_0x4a66('0x40')],function(_0x5073b7){var _0x2497f1={};_0x2497f1[_0x5073b7]={'$like':'%'+_0x44925e['query'][_0x4a66('0x2f')]+'%'};return _0x2497f1;})});}_0x9dcc35=_[_0x4a66('0x4c')]({},_0x9dcc35,_0x44925e[_0x4a66('0x4e')]);return _0x2b9d0e[_0x4a66('0x98')](_0x9dcc35);}})[_0x4a66('0x2a')](function(_0x433405){if(_0x433405){_0x208330=_0x433405[_0x4a66('0x43')];if(!_0x44925e[_0x4a66('0x3f')][_0x4a66('0x44')](_0x4a66('0x45'))){_0x9dcc35['limit']=qs['limit'](_0x44925e[_0x4a66('0x3f')][_0x4a66('0x46')]);_0x9dcc35[_0x4a66('0x23')]=qs[_0x4a66('0x23')](_0x44925e[_0x4a66('0x3f')][_0x4a66('0x23')]);}return _0x2b9d0e[_0x4a66('0x98')](_0x9dcc35);}})[_0x4a66('0x2a')](function(_0x5a133d){if(_0x5a133d){return _0x5a133d?{'count':_0x208330,'rows':_0x5a133d}:null;}})[_0x4a66('0x2a')](respondWithResult(_0xbdb920,null))['catch'](handleError(_0xbdb920,null));};exports[_0x4a66('0x99')]=function(_0x87ef6a,_0x861321,_0x2ef0ba){var _0x5e8981={};var _0x16067e={};var _0x1c61af;var _0x3c718e;return db[_0x4a66('0x3b')][_0x4a66('0x66')]({'where':{'id':_0x87ef6a[_0x4a66('0x5e')]['id']}})[_0x4a66('0x2a')](handleEntityNotFound(_0x861321,null))[_0x4a66('0x2a')](function(_0x52d684){if(_0x52d684){_0x1c61af=_0x52d684;_0x16067e[_0x4a66('0x3e')]=_['keys'](db[_0x4a66('0x7c')][_0x4a66('0x3c')]);_0x16067e[_0x4a66('0x3f')]=_['keys'](_0x87ef6a[_0x4a66('0x3f')]);_0x16067e[_0x4a66('0x4a')]=_['intersection'](_0x16067e[_0x4a66('0x3e')],_0x16067e[_0x4a66('0x3f')]);_0x5e8981[_0x4a66('0x40')]=_[_0x4a66('0x41')](_0x16067e[_0x4a66('0x3e')],qs[_0x4a66('0x42')](_0x87ef6a[_0x4a66('0x3f')][_0x4a66('0x42')]));_0x5e8981[_0x4a66('0x40')]=_0x5e8981[_0x4a66('0x40')][_0x4a66('0x43')]?_0x5e8981['attributes']:_0x16067e[_0x4a66('0x3e')];_0x5e8981[_0x4a66('0x47')]=qs[_0x4a66('0x48')](_0x87ef6a[_0x4a66('0x3f')][_0x4a66('0x48')]);_0x5e8981[_0x4a66('0x49')]=qs['filters'](_[_0x4a66('0x4b')](_0x87ef6a[_0x4a66('0x3f')],_0x16067e[_0x4a66('0x4a')]));if(_0x87ef6a[_0x4a66('0x3f')][_0x4a66('0x2f')]){_0x5e8981[_0x4a66('0x49')]=_[_0x4a66('0x4c')](_0x5e8981['where'],{'$or':_['map'](_0x5e8981[_0x4a66('0x40')],function(_0x148ffd){var _0x40ec6b={};_0x40ec6b[_0x148ffd]={'$like':'%'+_0x87ef6a[_0x4a66('0x3f')][_0x4a66('0x2f')]+'%'};return _0x40ec6b;})});}_0x5e8981=_[_0x4a66('0x4c')]({},_0x5e8981,_0x87ef6a['options']);return _0x1c61af[_0x4a66('0x99')](_0x5e8981);}})[_0x4a66('0x2a')](function(_0x27fba8){if(_0x27fba8){_0x3c718e=_0x27fba8[_0x4a66('0x43')];if(!_0x87ef6a['query']['hasOwnProperty'](_0x4a66('0x45'))){_0x5e8981[_0x4a66('0x46')]=qs[_0x4a66('0x46')](_0x87ef6a[_0x4a66('0x3f')][_0x4a66('0x46')]);_0x5e8981[_0x4a66('0x23')]=qs['offset'](_0x87ef6a[_0x4a66('0x3f')][_0x4a66('0x23')]);}return _0x1c61af[_0x4a66('0x99')](_0x5e8981);}})[_0x4a66('0x2a')](function(_0x4d7aca){return _0x4d7aca?{'count':_0x3c718e,'rows':_0x4d7aca}:null;})[_0x4a66('0x2a')](respondWithResult(_0x861321,null))[_0x4a66('0x51')](handleError(_0x861321,null));};exports[_0x4a66('0x9a')]=function(_0x42bd33,_0x3b8a3e,_0x3ded17){var _0x2a6291={};var _0x597d5e={};var _0x21896c;var _0x17eb8b;return db[_0x4a66('0x3b')][_0x4a66('0x66')]({'where':{'id':_0x42bd33[_0x4a66('0x5e')]['id']}})[_0x4a66('0x2a')](handleEntityNotFound(_0x3b8a3e,null))[_0x4a66('0x2a')](function(_0x207b26){if(_0x207b26){_0x21896c=_0x207b26;_0x597d5e[_0x4a66('0x3e')]=_[_0x4a66('0x53')](db['CmList'][_0x4a66('0x3c')]);_0x597d5e[_0x4a66('0x3f')]=_[_0x4a66('0x53')](_0x42bd33[_0x4a66('0x3f')]);_0x597d5e[_0x4a66('0x4a')]=_[_0x4a66('0x41')](_0x597d5e[_0x4a66('0x3e')],_0x597d5e[_0x4a66('0x3f')]);_0x2a6291['attributes']=_[_0x4a66('0x41')](_0x597d5e[_0x4a66('0x3e')],qs[_0x4a66('0x42')](_0x42bd33['query'][_0x4a66('0x42')]));_0x2a6291[_0x4a66('0x40')]=_0x2a6291[_0x4a66('0x40')][_0x4a66('0x43')]?_0x2a6291[_0x4a66('0x40')]:_0x597d5e[_0x4a66('0x3e')];_0x2a6291[_0x4a66('0x47')]=qs[_0x4a66('0x48')](_0x42bd33[_0x4a66('0x3f')][_0x4a66('0x48')]);_0x2a6291[_0x4a66('0x49')]=qs[_0x4a66('0x4a')](_['pick'](_0x42bd33[_0x4a66('0x3f')],_0x597d5e[_0x4a66('0x4a')]));if(_0x42bd33['query'][_0x4a66('0x2f')]){_0x2a6291[_0x4a66('0x49')]=_[_0x4a66('0x4c')](_0x2a6291['where'],{'$or':_[_0x4a66('0x3a')](_0x2a6291['attributes'],function(_0x197f06){var _0x383dce={};_0x383dce[_0x197f06]={'$like':'%'+_0x42bd33['query'][_0x4a66('0x2f')]+'%'};return _0x383dce;})});}_0x2a6291=_[_0x4a66('0x4c')]({},_0x2a6291,_0x42bd33[_0x4a66('0x4e')]);return _0x21896c['getLists'](_0x2a6291);}})[_0x4a66('0x2a')](function(_0x2af4bd){if(_0x2af4bd){_0x17eb8b=_0x2af4bd[_0x4a66('0x43')];if(!_0x42bd33[_0x4a66('0x3f')][_0x4a66('0x44')](_0x4a66('0x45'))){_0x2a6291[_0x4a66('0x46')]=qs[_0x4a66('0x46')](_0x42bd33[_0x4a66('0x3f')][_0x4a66('0x46')]);_0x2a6291[_0x4a66('0x23')]=qs[_0x4a66('0x23')](_0x42bd33[_0x4a66('0x3f')]['offset']);}return _0x21896c['getLists'](_0x2a6291);}})[_0x4a66('0x2a')](function(_0x1670cb){if(_0x1670cb){return _0x1670cb?{'count':_0x17eb8b,'rows':_0x1670cb}:null;}})[_0x4a66('0x2a')](respondWithResult(_0x3b8a3e,null))[_0x4a66('0x51')](handleError(_0x3b8a3e,null));};exports[_0x4a66('0x9b')]=function(_0x8152e,_0xa31e6c,_0x599482){var _0x5cc957,_0x72d87a;return db[_0x4a66('0x3b')]['find']({'where':{'id':_0x8152e[_0x4a66('0x5e')]['id']}})[_0x4a66('0x2a')](handleEntityNotFound(_0xa31e6c,null))[_0x4a66('0x2a')](function(_0x2cd75c){if(_0x2cd75c){_0x72d87a=_0x2cd75c;return _0x2cd75c['addLists'](_0x8152e['body'][_0x4a66('0x84')],_['omit'](_0x8152e[_0x4a66('0x56')],[_0x4a66('0x84'),'id'])||{});}return null;})['spread'](function(_0x3a99cc){var _0x21e424;_0x5cc957=_0x3a99cc||[];var _0x4944cc=[];if(_0x3a99cc){for(var _0x467e5c=0x0;_0x467e5c<_0x3a99cc['length'];_0x467e5c+=0x1){var _0xbb1bb7=_0x3a99cc[_0x467e5c][_0x4a66('0x58')]({'plain':!![]});_0x72d87a['dialCheckDuplicateType']=_0x8152e['body'][_0x4a66('0x9c')]?_0x8152e[_0x4a66('0x56')]['dialCheckDuplicateType']:_0x72d87a['dialCheckDuplicateType'];switch(_0x72d87a[_0x4a66('0x9c')]){case'always':_0x21e424=squel[_0x4a66('0x9d')]()[_0x4a66('0x9e')](_0x4a66('0x9f'))[_0x4a66('0xa0')]([_0x4a66('0xa1'),_0x4a66('0xa2'),_0x4a66('0xa3'),'ListId',_0x4a66('0x6a'),'createdAt',_0x4a66('0x60')],squel[_0x4a66('0x85')]()['field'](_0x4a66('0xa1'),'phone')[_0x4a66('0x4d')](_0x4a66('0xa4'),_0x4a66('0xa2'))[_0x4a66('0x4d')]('id','ContactId')[_0x4a66('0x4d')](_0xbb1bb7[_0x4a66('0xa5')][_0x4a66('0xa6')](),_0x4a66('0xa7'))[_0x4a66('0x4d')](_0x8152e[_0x4a66('0x5e')]['id'][_0x4a66('0xa6')](),_0x4a66('0x6a'))[_0x4a66('0x4d')]('NOW()',_0x4a66('0x5f'))[_0x4a66('0x4d')](_0x4a66('0xa4'),_0x4a66('0x60'))[_0x4a66('0x87')]('cm_contacts')['where'](_0x4a66('0xa8'))[_0x4a66('0x49')](_0x4a66('0xa9'),_0xbb1bb7[_0x4a66('0xa5')][_0x4a66('0xa6')]())[_0x4a66('0x49')](_0x4a66('0xaa'))[_0x4a66('0x49')](_0x4a66('0xab'),squel['select']()['field'](_0x4a66('0xac'))['from'](_0x4a66('0xad'))['where']('VoiceQueueId\x20=\x20?',_0x8152e[_0x4a66('0x5e')]['id']['toString']()))['where'](_0x4a66('0xab'),squel[_0x4a66('0x85')]()[_0x4a66('0x4d')](_0x4a66('0xae'))['from'](_0x4a66('0x9f'))[_0x4a66('0x49')](_0x4a66('0xaf'),_0x8152e[_0x4a66('0x5e')]['id'][_0x4a66('0xa6')]())))[_0x4a66('0xa6')]();break;case _0x4a66('0xb0'):_0x21e424=squel[_0x4a66('0x9d')]()['into']('cm_hopper')[_0x4a66('0xa0')]([_0x4a66('0xa1'),_0x4a66('0xa2'),_0x4a66('0xa3'),'ListId','VoiceQueueId',_0x4a66('0x5f'),'updatedAt'],squel[_0x4a66('0x85')]()[_0x4a66('0x4d')](_0x4a66('0xa1'),_0x4a66('0xa1'))['field'](_0x4a66('0xa4'),'scheduledAt')['field']('id',_0x4a66('0xa3'))[_0x4a66('0x4d')](_0xbb1bb7['CmListId'][_0x4a66('0xa6')](),_0x4a66('0xa7'))[_0x4a66('0x4d')](_0x8152e[_0x4a66('0x5e')]['id']['toString'](),_0x4a66('0x6a'))[_0x4a66('0x4d')](_0x4a66('0xa4'),_0x4a66('0x5f'))[_0x4a66('0x4d')](_0x4a66('0xa4'),_0x4a66('0x60'))[_0x4a66('0x87')](_0x4a66('0xb1'))['where'](_0x4a66('0xa8'))[_0x4a66('0x49')](_0x4a66('0xa9'),_0xbb1bb7['CmListId'][_0x4a66('0xa6')]())[_0x4a66('0x49')](_0x4a66('0xaa'))[_0x4a66('0x49')](_0x4a66('0xab'),squel[_0x4a66('0x85')]()[_0x4a66('0x4d')]('COALESCE(phone,\x27\x27)')[_0x4a66('0x87')](_0x4a66('0x9f'))[_0x4a66('0x49')](_0x4a66('0xaf'),_0x8152e['params']['id'][_0x4a66('0xa6')]())))['toString']();break;default:_0x21e424=squel[_0x4a66('0x9d')]()['into'](_0x4a66('0x9f'))[_0x4a66('0xa0')](['phone','scheduledAt',_0x4a66('0xa3'),'ListId',_0x4a66('0x6a'),_0x4a66('0x5f'),_0x4a66('0x60')],squel[_0x4a66('0x85')]()['field'](_0x4a66('0xa1'),'phone')[_0x4a66('0x4d')]('NOW()',_0x4a66('0xa2'))['field']('id',_0x4a66('0xa3'))[_0x4a66('0x4d')](_0xbb1bb7['CmListId'][_0x4a66('0xa6')](),_0x4a66('0xa7'))['field'](_0x8152e[_0x4a66('0x5e')]['id'][_0x4a66('0xa6')](),_0x4a66('0x6a'))['field'](_0x4a66('0xa4'),_0x4a66('0x5f'))['field'](_0x4a66('0xa4'),_0x4a66('0x60'))[_0x4a66('0x87')](_0x4a66('0xb1'))['where']('deletedAt\x20IS\x20NULL')[_0x4a66('0x49')](_0x4a66('0xa9'),_0xbb1bb7[_0x4a66('0xa5')][_0x4a66('0xa6')]())[_0x4a66('0x49')](_0x4a66('0xaa')))[_0x4a66('0xa6')]();}_0x4944cc[_0x4a66('0x8c')](db[_0x4a66('0x8d')][_0x4a66('0x3f')](_0x21e424));}return BPromise['all'](_0x4944cc);}})[_0x4a66('0x2a')](function(){return _0x5cc957;})[_0x4a66('0x2a')](respondWithResult(_0xa31e6c,null))[_0x4a66('0x51')](handleError(_0xa31e6c,null));};exports[_0x4a66('0xb2')]=function(_0x20c7c8,_0x423df5,_0x14271d){return db['VoiceQueue']['find']({'where':{'id':_0x20c7c8[_0x4a66('0x5e')]['id']}})['then'](handleEntityNotFound(_0x423df5,null))[_0x4a66('0x2a')](function(_0xc83312){if(_0xc83312){return _0xc83312[_0x4a66('0xb2')](_0x20c7c8[_0x4a66('0x3f')][_0x4a66('0x84')]);}})[_0x4a66('0x2a')](function(_0x22e0c0){if(_0x22e0c0){return db['CmHopper'][_0x4a66('0x2b')]({'where':{'ListId':_0x20c7c8[_0x4a66('0x3f')][_0x4a66('0x84')],'VoiceQueueId':_0x20c7c8[_0x4a66('0x5e')]['id']}})[_0x4a66('0x2a')](function(){return _0x22e0c0;});}})[_0x4a66('0x2a')](respondWithStatusCode(_0x423df5,null))[_0x4a66('0x51')](handleError(_0x423df5,null));};exports[_0x4a66('0xb3')]=function(_0x1029f5,_0x28c06d,_0x3e5cc1){var _0x19c505={};var _0x4240c8={};var _0x322f40;var _0x2affbc;return db[_0x4a66('0x3b')]['findOne']({'where':{'id':_0x1029f5[_0x4a66('0x5e')]['id']}})['then'](handleEntityNotFound(_0x28c06d,null))['then'](function(_0xda6316){if(_0xda6316){_0x322f40=_0xda6316;_0x4240c8['model']=_[_0x4a66('0x53')](db[_0x4a66('0xb4')][_0x4a66('0x3c')]);_0x4240c8[_0x4a66('0x3f')]=_[_0x4a66('0x53')](_0x1029f5[_0x4a66('0x3f')]);_0x4240c8['filters']=_[_0x4a66('0x41')](_0x4240c8['model'],_0x4240c8[_0x4a66('0x3f')]);_0x19c505[_0x4a66('0x40')]=_[_0x4a66('0x41')](_0x4240c8['model'],qs[_0x4a66('0x42')](_0x1029f5[_0x4a66('0x3f')][_0x4a66('0x42')]));_0x19c505['attributes']=_0x19c505[_0x4a66('0x40')][_0x4a66('0x43')]?_0x19c505['attributes']:_0x4240c8['model'];_0x19c505[_0x4a66('0x47')]=qs[_0x4a66('0x48')](_0x1029f5[_0x4a66('0x3f')][_0x4a66('0x48')]);_0x19c505[_0x4a66('0x49')]=qs['filters'](_[_0x4a66('0x4b')](_0x1029f5['query'],_0x4240c8[_0x4a66('0x4a')]));if(_0x1029f5['query']['filter']){_0x19c505[_0x4a66('0x49')]=_[_0x4a66('0x4c')](_0x19c505[_0x4a66('0x49')],{'$or':_[_0x4a66('0x3a')](_0x19c505[_0x4a66('0x40')],function(_0x1cc4ff){var _0x2253eb={};_0x2253eb[_0x1cc4ff]={'$like':'%'+_0x1029f5[_0x4a66('0x3f')][_0x4a66('0x2f')]+'%'};return _0x2253eb;})});}_0x19c505=_['merge']({},_0x19c505,_0x1029f5['options']);return _0x322f40[_0x4a66('0xb3')](_0x19c505);}})[_0x4a66('0x2a')](function(_0x5675f0){if(_0x5675f0){_0x2affbc=_0x5675f0[_0x4a66('0x43')];if(!_0x1029f5['query'][_0x4a66('0x44')](_0x4a66('0x45'))){_0x19c505[_0x4a66('0x46')]=qs[_0x4a66('0x46')](_0x1029f5['query'][_0x4a66('0x46')]);_0x19c505['offset']=qs[_0x4a66('0x23')](_0x1029f5['query'][_0x4a66('0x23')]);}return _0x322f40[_0x4a66('0xb3')](_0x19c505);}})[_0x4a66('0x2a')](function(_0x33d817){if(_0x33d817){return _0x33d817?{'count':_0x2affbc,'rows':_0x33d817}:null;}})[_0x4a66('0x2a')](respondWithResult(_0x28c06d,null))[_0x4a66('0x51')](handleError(_0x28c06d,null));};exports[_0x4a66('0xb5')]=function(_0xaee53,_0x215588,_0x35cd84){var _0x471d1b,_0x5c350d;return db['VoiceQueue'][_0x4a66('0x34')]({'where':{'id':_0xaee53[_0x4a66('0x5e')]['id']}})[_0x4a66('0x2a')](handleEntityNotFound(_0x215588,null))[_0x4a66('0x2a')](function(_0x3a11d3){if(_0x3a11d3){_0x5c350d=_0x3a11d3;return _0x3a11d3['addBlackLists'](_0xaee53['body'][_0x4a66('0x84')],_[_0x4a66('0x61')](_0xaee53[_0x4a66('0x56')],['ids','id'])||{});}return null;})['spread'](function(_0xd11748){var _0x27b359;_0x471d1b=_0xd11748||[];var _0x12e248=[];if(_0xd11748){for(var _0x4bbaea=0x0;_0x4bbaea<_0xd11748[_0x4a66('0x43')];_0x4bbaea+=0x1){var _0x587c2f=_0xd11748[_0x4bbaea][_0x4a66('0x58')]({'plain':!![]});_0x27b359=squel[_0x4a66('0x9d')]()[_0x4a66('0x9e')](_0x4a66('0xb6'))[_0x4a66('0xa0')]([_0x4a66('0xa1'),_0x4a66('0xa3'),_0x4a66('0xa7'),_0x4a66('0x6a'),_0x4a66('0x5f'),'updatedAt'],squel[_0x4a66('0x85')]()[_0x4a66('0x4d')](_0x4a66('0xa1'),_0x4a66('0xa1'))['field']('id','ContactId')[_0x4a66('0x4d')](_0x587c2f[_0x4a66('0xa5')]['toString'](),'ListId')[_0x4a66('0x4d')](_0xaee53['params']['id'][_0x4a66('0xa6')](),_0x4a66('0x6a'))[_0x4a66('0x4d')](_0x4a66('0xa4'),_0x4a66('0x5f'))['field'](_0x4a66('0xa4'),_0x4a66('0x60'))[_0x4a66('0x87')]('cm_contacts')[_0x4a66('0x49')](_0x4a66('0xa8'))[_0x4a66('0x49')]('ListId\x20=\x20?',_0x587c2f[_0x4a66('0xa5')][_0x4a66('0xa6')]())[_0x4a66('0x49')]('phone\x20IS\x20NOT\x20NULL'))['toString']();_0x12e248[_0x4a66('0x8c')](db[_0x4a66('0x8d')][_0x4a66('0x3f')](_0x27b359));}return BPromise['all'](_0x12e248);}})[_0x4a66('0x2a')](function(){return _0x471d1b;})[_0x4a66('0x2a')](respondWithResult(_0x215588,null))[_0x4a66('0x51')](handleError(_0x215588,null));};exports[_0x4a66('0xb7')]=function(_0xa34234,_0x10bfef,_0x559dfe){return db[_0x4a66('0x3b')][_0x4a66('0x34')]({'where':{'id':_0xa34234[_0x4a66('0x5e')]['id']}})[_0x4a66('0x2a')](handleEntityNotFound(_0x10bfef,null))[_0x4a66('0x2a')](function(_0x2957d6){if(_0x2957d6){return _0x2957d6[_0x4a66('0xb7')](_0xa34234['query'][_0x4a66('0x84')]);}})[_0x4a66('0x2a')](function(_0x45ab03){if(_0x45ab03){return db[_0x4a66('0x6e')]['destroy']({'where':{'ListId':_0xa34234[_0x4a66('0x3f')]['ids'],'VoiceQueueId':_0xa34234['params']['id']}})[_0x4a66('0x2a')](function(){return _0x45ab03;});}})['then'](respondWithStatusCode(_0x10bfef,null))['catch'](handleError(_0x10bfef,null));}; \ No newline at end of file +var _0xcf66=['filter','options','include','findAll','catch','show','includeAll','create','body','user','role','inbound','UserProfileSection','autoAssociation','params','omit','updatedAt','createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','VoiceQueueId','CmHopper','rows','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','addTeams','teams','Team','User','voicePause','flatMap','Agents','forEach','penalty','sequelize','transaction','each','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','upsert','interface','format','removeTeams','select','tq.TeamId','from','team_has_voice_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','all','union','compact','isEmpty','emit','userVoiceQueue:remove','addAgents','ids','spread','userVoiceQueue:save','online','push','isNil','SIP/%s','removeAgents','isArray','getAgents','getMembers','CmList','getLists','addLists','dialCheckDuplicateType','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','field','NOW()','CmListId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','removeLists','getBlackLists','addBlackLists','insert','cm_hopper_black','removeBlackLists','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','defaults','redis','localhost','socket.io-emitter','./voiceQueue.socket','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','get','VoiceQueues','QueueCampaigns','outbound','ignore','map','value','find','type','UserProfileResource','stack','name','send','index','VoiceQueue','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL'];(function(_0x2cc86e,_0x5e9be8){var _0x3c43e1=function(_0x522ecc){while(--_0x522ecc){_0x2cc86e['push'](_0x2cc86e['shift']());}};_0x3c43e1(++_0x5e9be8);}(_0xcf66,0x71));var _0x6cf6=function(_0x501f4f,_0x121779){_0x501f4f=_0x501f4f-0x0;var _0xc863de=_0xcf66[_0x501f4f];return _0xc863de;};'use strict';var pdf=require(_0x6cf6('0x0'));var emlformat=require(_0x6cf6('0x1'));var rimraf=require(_0x6cf6('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6cf6('0x3'));var rp=require(_0x6cf6('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6cf6('0x5'));var util=require(_0x6cf6('0x6'));var path=require('path');var sox=require(_0x6cf6('0x7'));var csv=require(_0x6cf6('0x8'));var ejs=require(_0x6cf6('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6cf6('0xa'));var crypto=require(_0x6cf6('0xb'));var jsforce=require(_0x6cf6('0xc'));var deskjs=require(_0x6cf6('0xd'));var toCsv=require(_0x6cf6('0x8'));var querystring=require(_0x6cf6('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6cf6('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6cf6('0x10'));var logger=require(_0x6cf6('0x11'))(_0x6cf6('0x12'));var utils=require(_0x6cf6('0x13'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config['redis']=_[_0x6cf6('0x14')](config[_0x6cf6('0x15')],{'host':_0x6cf6('0x16'),'port':0x18eb});var socket=require(_0x6cf6('0x17'))(new Redis(config[_0x6cf6('0x15')]));require(_0x6cf6('0x18'))['register'](socket);function respondWithStatusCode(_0x32fe64,_0x494ece){_0x494ece=_0x494ece||0xcc;return function(_0x4dbae8){if(_0x4dbae8){return _0x32fe64[_0x6cf6('0x19')](_0x494ece);}return _0x32fe64['status'](_0x494ece)[_0x6cf6('0x1a')]();};}function respondWithResult(_0x1b40f8,_0x2d23ab){_0x2d23ab=_0x2d23ab||0xc8;return function(_0x74486a){if(_0x74486a){return _0x1b40f8[_0x6cf6('0x1b')](_0x2d23ab)[_0x6cf6('0x1c')](_0x74486a);}};}function respondWithFilteredResult(_0x10b430,_0x39ec25){return function(_0x18c2f9){if(_0x18c2f9){var _0x2ca2b1=_0x18c2f9[_0x6cf6('0x1d')],_0x5e8b11=_0x39ec25['offset'],_0x11d994=_0x39ec25[_0x6cf6('0x1e')]+_0x39ec25[_0x6cf6('0x1f')],_0x22915c;if(_0x11d994>=_0x2ca2b1){_0x11d994=_0x2ca2b1;_0x22915c=0xc8;}else{_0x22915c=0xce;}_0x10b430[_0x6cf6('0x1b')](_0x22915c);return _0x10b430[_0x6cf6('0x20')](_0x6cf6('0x21'),_0x5e8b11+'-'+_0x11d994+'/'+_0x2ca2b1)[_0x6cf6('0x1c')](_0x18c2f9);}return null;};}function patchUpdates(_0x123993){return function(_0x4eb6bd){try{jsonpatch[_0x6cf6('0x22')](_0x4eb6bd,_0x123993,!![]);}catch(_0x306a64){return BPromise[_0x6cf6('0x23')](_0x306a64);}return _0x4eb6bd[_0x6cf6('0x24')]();};}function saveUpdates(_0x5cba3a,_0x470ea4){return function(_0x41344f){if(_0x41344f){return _0x41344f[_0x6cf6('0x25')](_0x5cba3a)['then'](function(_0x5b30e0){return _0x5b30e0;});}return null;};}function removeEntity(_0x276225,_0x59f838){return function(_0x45ce6e){if(_0x45ce6e){return _0x45ce6e[_0x6cf6('0x26')]()[_0x6cf6('0x27')](function(){var _0x448f26=_0x45ce6e[_0x6cf6('0x28')]({'plain':!![]});var _0x565fad=[{'name':_0x6cf6('0x29'),'value':'inbound','ignore':![]},{'name':_0x6cf6('0x2a'),'value':_0x6cf6('0x2b'),'ignore':![]}];var _0x3eaa31=_(_0x565fad)['filter'](_0x6cf6('0x2c'))[_0x6cf6('0x2d')](_0x6cf6('0x2e'))[_0x6cf6('0x2e')]();if(_['includes'](_0x3eaa31,_0x448f26['type'])){return;}var _0x2afe84=_[_0x6cf6('0x2f')](_0x565fad,[_0x6cf6('0x2e'),_0x448f26[_0x6cf6('0x30')]])['name'];return db[_0x6cf6('0x31')]['destroy']({'where':{'type':_0x2afe84,'resourceId':_0x448f26['id']}})['then'](function(){return _0x45ce6e;});})['then'](function(){_0x276225[_0x6cf6('0x1b')](0xcc)[_0x6cf6('0x1a')]();});}};}function handleEntityNotFound(_0x33d308,_0x42f488){return function(_0x11c848){if(!_0x11c848){_0x33d308['sendStatus'](0x194);}return _0x11c848;};}function handleError(_0x348d9e,_0x2ae422){_0x2ae422=_0x2ae422||0x1f4;return function(_0x356340){logger['error'](_0x356340[_0x6cf6('0x32')]);if(_0x356340[_0x6cf6('0x33')]){delete _0x356340[_0x6cf6('0x33')];}_0x348d9e[_0x6cf6('0x1b')](_0x2ae422)[_0x6cf6('0x34')](_0x356340);};}exports[_0x6cf6('0x35')]=function(_0x11f66d,_0xb77709){var _0x22f23b={},_0x3d0b22={},_0x16d34f={'count':0x0,'rows':[]};var _0x1151ac=_[_0x6cf6('0x2d')](db[_0x6cf6('0x36')][_0x6cf6('0x37')],function(_0x4351d9){return{'name':_0x4351d9[_0x6cf6('0x38')],'type':_0x4351d9[_0x6cf6('0x30')]['key']};});_0x3d0b22[_0x6cf6('0x39')]=_[_0x6cf6('0x2d')](_0x1151ac,_0x6cf6('0x33'));_0x3d0b22[_0x6cf6('0x3a')]=_[_0x6cf6('0x3b')](_0x11f66d[_0x6cf6('0x3a')]);_0x3d0b22[_0x6cf6('0x3c')]=_[_0x6cf6('0x3d')](_0x3d0b22[_0x6cf6('0x39')],_0x3d0b22[_0x6cf6('0x3a')]);_0x22f23b[_0x6cf6('0x3e')]=_['intersection'](_0x3d0b22[_0x6cf6('0x39')],qs[_0x6cf6('0x3f')](_0x11f66d[_0x6cf6('0x3a')][_0x6cf6('0x3f')]));_0x22f23b[_0x6cf6('0x3e')]=_0x22f23b[_0x6cf6('0x3e')][_0x6cf6('0x40')]?_0x22f23b[_0x6cf6('0x3e')]:_0x3d0b22[_0x6cf6('0x39')];if(!_0x11f66d['query'][_0x6cf6('0x41')](_0x6cf6('0x42'))){_0x22f23b[_0x6cf6('0x1f')]=qs[_0x6cf6('0x1f')](_0x11f66d[_0x6cf6('0x3a')][_0x6cf6('0x1f')]);_0x22f23b[_0x6cf6('0x1e')]=qs[_0x6cf6('0x1e')](_0x11f66d[_0x6cf6('0x3a')]['offset']);}_0x22f23b[_0x6cf6('0x43')]=qs['sort'](_0x11f66d[_0x6cf6('0x3a')][_0x6cf6('0x44')]);_0x22f23b[_0x6cf6('0x45')]=qs[_0x6cf6('0x3c')](_[_0x6cf6('0x46')](_0x11f66d[_0x6cf6('0x3a')],_0x3d0b22[_0x6cf6('0x3c')]));if(_0x11f66d[_0x6cf6('0x3a')]['filter']){_0x22f23b[_0x6cf6('0x45')]=_[_0x6cf6('0x47')](_0x22f23b['where'],{'$or':_[_0x6cf6('0x2d')](_0x1151ac,function(_0x41c16a){if(_0x41c16a[_0x6cf6('0x30')]['key']!==_0x6cf6('0x48')){var _0x128f7a={};_0x128f7a[_0x41c16a['field']]={'$like':'%'+_0x11f66d[_0x6cf6('0x3a')][_0x6cf6('0x49')]+'%'};return _0x128f7a;}})});}_0x22f23b=_[_0x6cf6('0x47')]({},_0x22f23b,_0x11f66d[_0x6cf6('0x4a')]);var _0x41195e={'where':_0x22f23b[_0x6cf6('0x45')]};return db[_0x6cf6('0x36')]['count'](_0x41195e)[_0x6cf6('0x27')](function(_0x55521f){_0x16d34f[_0x6cf6('0x1d')]=_0x55521f;if(_0x11f66d[_0x6cf6('0x3a')]['includeAll']){_0x22f23b[_0x6cf6('0x4b')]=[{'all':!![]}];}return db[_0x6cf6('0x36')][_0x6cf6('0x4c')](_0x22f23b);})[_0x6cf6('0x27')](function(_0x6c0355){_0x16d34f['rows']=_0x6c0355;return _0x16d34f;})[_0x6cf6('0x27')](respondWithFilteredResult(_0xb77709,_0x22f23b))[_0x6cf6('0x4d')](handleError(_0xb77709,null));};exports[_0x6cf6('0x4e')]=function(_0x4833d5,_0x10168f){var _0x3a64f7={'raw':![],'where':{'id':_0x4833d5['params']['id']}},_0xa322b4={};_0xa322b4[_0x6cf6('0x39')]=_['keys'](db['VoiceQueue'][_0x6cf6('0x37')]);_0xa322b4[_0x6cf6('0x3a')]=_[_0x6cf6('0x3b')](_0x4833d5[_0x6cf6('0x3a')]);_0xa322b4[_0x6cf6('0x3c')]=_[_0x6cf6('0x3d')](_0xa322b4[_0x6cf6('0x39')],_0xa322b4[_0x6cf6('0x3a')]);_0x3a64f7[_0x6cf6('0x3e')]=_[_0x6cf6('0x3d')](_0xa322b4[_0x6cf6('0x39')],qs[_0x6cf6('0x3f')](_0x4833d5[_0x6cf6('0x3a')]['fields']));_0x3a64f7[_0x6cf6('0x3e')]=_0x3a64f7[_0x6cf6('0x3e')]['length']?_0x3a64f7['attributes']:_0xa322b4[_0x6cf6('0x39')];if(_0x4833d5[_0x6cf6('0x3a')][_0x6cf6('0x4f')]){_0x3a64f7[_0x6cf6('0x4b')]=[{'all':!![]}];}_0x3a64f7=_[_0x6cf6('0x47')]({},_0x3a64f7,_0x4833d5[_0x6cf6('0x4a')]);return db['VoiceQueue'][_0x6cf6('0x2f')](_0x3a64f7)[_0x6cf6('0x27')](handleEntityNotFound(_0x10168f,null))[_0x6cf6('0x27')](respondWithResult(_0x10168f,null))['catch'](handleError(_0x10168f,null));};exports['create']=function(_0x211b89,_0x2b51e7){return db[_0x6cf6('0x36')][_0x6cf6('0x50')](_0x211b89[_0x6cf6('0x51')],{})[_0x6cf6('0x27')](function(_0x2cb470){var _0x3e8aee=_0x211b89[_0x6cf6('0x52')][_0x6cf6('0x28')]({'plain':!![]});if(!_0x3e8aee)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3e8aee[_0x6cf6('0x53')]===_0x6cf6('0x52')){var _0x34165c=_0x2cb470[_0x6cf6('0x28')]({'plain':!![]});var _0x2fdf83=[{'name':_0x6cf6('0x29'),'value':_0x6cf6('0x54')},{'name':_0x6cf6('0x2a'),'value':_0x6cf6('0x2b')}];var _0x330919=_[_0x6cf6('0x2f')](_0x2fdf83,['value',_0x34165c[_0x6cf6('0x30')]])['name'];return db[_0x6cf6('0x55')][_0x6cf6('0x2f')]({'where':{'name':_0x330919,'userProfileId':_0x3e8aee['userProfileId']},'raw':!![]})[_0x6cf6('0x27')](function(_0x399dc0){if(_0x399dc0&&_0x399dc0[_0x6cf6('0x56')]===0x0){return db[_0x6cf6('0x31')][_0x6cf6('0x50')]({'name':_0x34165c[_0x6cf6('0x33')],'resourceId':_0x34165c['id'],'type':_0x399dc0['name'],'sectionId':_0x399dc0['id']},{})[_0x6cf6('0x27')](function(){return _0x2cb470;});}else{return _0x2cb470;}})[_0x6cf6('0x4d')](function(_0x160c7f){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x160c7f);throw _0x160c7f;});}return _0x2cb470;})[_0x6cf6('0x27')](respondWithResult(_0x2b51e7,0xc9))[_0x6cf6('0x4d')](handleError(_0x2b51e7,null));};exports['clone']=function(_0x2748e9,_0x3559ab){var _0x2f10b2={'raw':![],'where':{'id':_0x2748e9[_0x6cf6('0x57')]['id']}},_0x29dc1a={};_0x29dc1a['model']=_[_0x6cf6('0x3b')](db[_0x6cf6('0x36')]['rawAttributes']);_0x2f10b2['attributes']=_[_0x6cf6('0x3d')](_0x29dc1a[_0x6cf6('0x39')],qs[_0x6cf6('0x3f')](_0x2748e9[_0x6cf6('0x3a')][_0x6cf6('0x3f')]));_0x2f10b2['attributes']=_0x2f10b2['attributes'][_0x6cf6('0x40')]?_0x2f10b2[_0x6cf6('0x3e')]:_0x29dc1a[_0x6cf6('0x39')];if(_0x2748e9[_0x6cf6('0x3a')][_0x6cf6('0x4f')]){_0x2f10b2['include']=[{'all':!![]}];}_0x2f10b2=_['merge']({},_0x2f10b2,_0x2748e9['options']);return db[_0x6cf6('0x36')][_0x6cf6('0x2f')](_0x2f10b2)[_0x6cf6('0x27')](handleEntityNotFound(_0x3559ab,null))[_0x6cf6('0x27')](function(_0x47be82){if(_0x47be82){var _0x1d1b66=_0x47be82['get']({'plain':!![]});_0x1d1b66=qs[_0x6cf6('0x58')](_0x1d1b66,['id','createdAt',_0x6cf6('0x59')]);_0x2748e9[_0x6cf6('0x51')]=_[_0x6cf6('0x58')](_0x2748e9[_0x6cf6('0x51')],['id',_0x6cf6('0x5a'),'updatedAt']);return db[_0x6cf6('0x36')]['create'](_[_0x6cf6('0x47')](_0x1d1b66,_0x2748e9['body']),{'include':_0x2748e9[_0x6cf6('0x3a')]['includeAll']?[{'all':!![]}]:undefined})[_0x6cf6('0x27')](function(_0x42daab){var _0x5df21f=_0x2748e9[_0x6cf6('0x52')][_0x6cf6('0x28')]({'plain':!![]});if(!_0x5df21f)throw new Error(_0x6cf6('0x5b'));if(_0x5df21f[_0x6cf6('0x53')]===_0x6cf6('0x52')){var _0x124d23=_0x42daab[_0x6cf6('0x28')]({'plain':!![]});var _0x55cb47=[{'name':'VoiceQueues','value':_0x6cf6('0x54')},{'name':_0x6cf6('0x2a'),'value':'outbound'}];var _0xd96f46=_['find'](_0x55cb47,['value',_0x124d23[_0x6cf6('0x30')]])['name'];return db['UserProfileSection'][_0x6cf6('0x2f')]({'where':{'name':_0xd96f46,'userProfileId':_0x5df21f[_0x6cf6('0x5c')]},'raw':!![]})[_0x6cf6('0x27')](function(_0x52b337){if(_0x52b337&&_0x52b337[_0x6cf6('0x56')]===0x0){return db['UserProfileResource'][_0x6cf6('0x50')]({'name':_0x124d23[_0x6cf6('0x33')],'resourceId':_0x124d23['id'],'type':_0x52b337['name'],'sectionId':_0x52b337['id']},{})[_0x6cf6('0x27')](function(){return _0x42daab;});}else{return _0x42daab;}})[_0x6cf6('0x4d')](function(_0x1f5e5a){logger[_0x6cf6('0x5d')](_0x6cf6('0x5e'),_0x1f5e5a);throw _0x1f5e5a;});}return _0x42daab;});}})[_0x6cf6('0x27')](respondWithResult(_0x3559ab,0xc9))['catch'](handleError(_0x3559ab,null));};exports[_0x6cf6('0x25')]=function(_0x321f68,_0x177a1c){if(_0x321f68[_0x6cf6('0x51')]['id']){delete _0x321f68[_0x6cf6('0x51')]['id'];}return db[_0x6cf6('0x36')]['find']({'where':{'id':_0x321f68['params']['id']}})['then'](handleEntityNotFound(_0x177a1c,null))[_0x6cf6('0x27')](saveUpdates(_0x321f68['body'],null))[_0x6cf6('0x27')](respondWithResult(_0x177a1c,null))['catch'](handleError(_0x177a1c,null));};exports[_0x6cf6('0x26')]=function(_0x461f80,_0x4e0c85){return db[_0x6cf6('0x36')][_0x6cf6('0x2f')]({'where':{'id':_0x461f80[_0x6cf6('0x57')]['id']}})['then'](handleEntityNotFound(_0x4e0c85,null))[_0x6cf6('0x27')](removeEntity(_0x4e0c85,null))['catch'](handleError(_0x4e0c85,null));};exports[_0x6cf6('0x5f')]=function(_0x4077f1,_0x1635dc,_0x308076){var _0x33b436={'raw':![],'where':{}};var _0x3336f9={};var _0x187ef2={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x6cf6('0x60')]({'where':{'id':_0x4077f1['params']['id']}})[_0x6cf6('0x27')](handleEntityNotFound(_0x1635dc,null))[_0x6cf6('0x27')](function(_0x42ccb6){if(_0x42ccb6){_0x3336f9[_0x6cf6('0x39')]=_['keys'](db['CmHopper'][_0x6cf6('0x37')]);_0x3336f9[_0x6cf6('0x3a')]=_[_0x6cf6('0x3b')](_0x4077f1[_0x6cf6('0x3a')]);_0x3336f9[_0x6cf6('0x3c')]=_[_0x6cf6('0x3d')](_0x3336f9['model'],_0x3336f9['query']);_0x33b436[_0x6cf6('0x3e')]=_['intersection'](_0x3336f9[_0x6cf6('0x39')],qs[_0x6cf6('0x3f')](_0x4077f1[_0x6cf6('0x3a')][_0x6cf6('0x3f')]));_0x33b436['attributes']=_0x33b436[_0x6cf6('0x3e')]['length']?_0x33b436[_0x6cf6('0x3e')]:_0x3336f9[_0x6cf6('0x39')];if(!_0x4077f1[_0x6cf6('0x3a')]['hasOwnProperty'](_0x6cf6('0x42'))){_0x33b436[_0x6cf6('0x1f')]=qs[_0x6cf6('0x1f')](_0x4077f1['query'][_0x6cf6('0x1f')]);_0x33b436[_0x6cf6('0x1e')]=qs[_0x6cf6('0x1e')](_0x4077f1['query']['offset']);}_0x33b436[_0x6cf6('0x43')]=qs['sort'](_0x4077f1['query'][_0x6cf6('0x44')]);_0x33b436[_0x6cf6('0x45')]=qs[_0x6cf6('0x3c')](_[_0x6cf6('0x46')](_0x4077f1[_0x6cf6('0x3a')],_0x3336f9[_0x6cf6('0x3c')]));_0x33b436[_0x6cf6('0x45')][_0x6cf6('0x61')]=_0x42ccb6['id'];if(_0x4077f1[_0x6cf6('0x3a')]['filter']){_0x33b436[_0x6cf6('0x45')]=_[_0x6cf6('0x47')](_0x33b436[_0x6cf6('0x45')],{'$or':_['map'](_0x33b436['attributes'],function(_0x38b830){var _0x169a33={};_0x169a33[_0x38b830]={'$like':'%'+_0x4077f1[_0x6cf6('0x3a')][_0x6cf6('0x49')]+'%'};return _0x169a33;})});}_0x33b436=_[_0x6cf6('0x47')]({},_0x33b436,_0x4077f1[_0x6cf6('0x4a')]);return db['CmHopper'][_0x6cf6('0x1d')]({'where':_0x33b436[_0x6cf6('0x45')]})[_0x6cf6('0x27')](function(_0x229225){_0x187ef2[_0x6cf6('0x1d')]=_0x229225;if(_0x4077f1[_0x6cf6('0x3a')][_0x6cf6('0x4f')]){_0x33b436['include']=[{'all':!![]}];}return db[_0x6cf6('0x62')][_0x6cf6('0x4c')](_0x33b436);})['then'](function(_0x346187){_0x187ef2[_0x6cf6('0x63')]=_0x346187;return _0x187ef2;});}})[_0x6cf6('0x27')](respondWithFilteredResult(_0x1635dc,_0x33b436))['catch'](handleError(_0x1635dc,null));};exports[_0x6cf6('0x64')]=function(_0x1e80d2,_0x4198fb,_0x151a9a){var _0xbd364a={'raw':!![],'where':{}};var _0x1f2b47={};var _0x538547={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0x1e80d2[_0x6cf6('0x57')]['id']}})['then'](handleEntityNotFound(_0x4198fb,null))[_0x6cf6('0x27')](function(_0x38bdb3){if(_0x38bdb3){_0x1f2b47['model']=_[_0x6cf6('0x3b')](db[_0x6cf6('0x65')][_0x6cf6('0x37')]);_0x1f2b47[_0x6cf6('0x3a')]=_[_0x6cf6('0x3b')](_0x1e80d2['query']);_0x1f2b47[_0x6cf6('0x3c')]=_[_0x6cf6('0x3d')](_0x1f2b47[_0x6cf6('0x39')],_0x1f2b47['query']);_0xbd364a['attributes']=_[_0x6cf6('0x3d')](_0x1f2b47[_0x6cf6('0x39')],qs[_0x6cf6('0x3f')](_0x1e80d2[_0x6cf6('0x3a')][_0x6cf6('0x3f')]));_0xbd364a[_0x6cf6('0x3e')]=_0xbd364a[_0x6cf6('0x3e')]['length']?_0xbd364a[_0x6cf6('0x3e')]:_0x1f2b47[_0x6cf6('0x39')];if(!_0x1e80d2[_0x6cf6('0x3a')]['hasOwnProperty'](_0x6cf6('0x42'))){_0xbd364a[_0x6cf6('0x1f')]=qs[_0x6cf6('0x1f')](_0x1e80d2[_0x6cf6('0x3a')]['limit']);_0xbd364a[_0x6cf6('0x1e')]=qs[_0x6cf6('0x1e')](_0x1e80d2[_0x6cf6('0x3a')][_0x6cf6('0x1e')]);}_0xbd364a[_0x6cf6('0x43')]=qs[_0x6cf6('0x44')](_0x1e80d2[_0x6cf6('0x3a')]['sort']);_0xbd364a['where']=qs['filters'](_['pick'](_0x1e80d2[_0x6cf6('0x3a')],_0x1f2b47[_0x6cf6('0x3c')]));_0xbd364a['where'][_0x6cf6('0x61')]=_0x38bdb3['id'];if(_0x1e80d2[_0x6cf6('0x3a')]['filter']){_0xbd364a[_0x6cf6('0x45')]=_['merge'](_0xbd364a[_0x6cf6('0x45')],{'$or':_[_0x6cf6('0x2d')](_0xbd364a[_0x6cf6('0x3e')],function(_0x440b3b){var _0x2dfd88={};_0x2dfd88[_0x440b3b]={'$like':'%'+_0x1e80d2['query'][_0x6cf6('0x49')]+'%'};return _0x2dfd88;})});}_0xbd364a=_[_0x6cf6('0x47')]({},_0xbd364a,_0x1e80d2['options']);return db[_0x6cf6('0x65')][_0x6cf6('0x1d')]({'where':_0xbd364a['where']})[_0x6cf6('0x27')](function(_0x56d0b7){_0x538547[_0x6cf6('0x1d')]=_0x56d0b7;if(_0x1e80d2['query'][_0x6cf6('0x4f')]){_0xbd364a[_0x6cf6('0x4b')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x6cf6('0x4c')](_0xbd364a);})['then'](function(_0x52a65c){_0x538547[_0x6cf6('0x63')]=_0x52a65c;return _0x538547;});}})[_0x6cf6('0x27')](respondWithFilteredResult(_0x4198fb,_0xbd364a))[_0x6cf6('0x4d')](handleError(_0x4198fb,null));};exports[_0x6cf6('0x66')]=function(_0x4e984f,_0x4b849b,_0x1d6b9b){var _0x2bdae9={'raw':!![],'where':{}};var _0x1ed6f0={};var _0x41d2c7={'count':0x0,'rows':[]};return db[_0x6cf6('0x36')][_0x6cf6('0x60')]({'where':{'id':_0x4e984f[_0x6cf6('0x57')]['id']}})[_0x6cf6('0x27')](handleEntityNotFound(_0x4b849b,null))[_0x6cf6('0x27')](function(_0x197d83){if(_0x197d83){_0x1ed6f0[_0x6cf6('0x39')]=_[_0x6cf6('0x3b')](db[_0x6cf6('0x67')][_0x6cf6('0x37')]);_0x1ed6f0[_0x6cf6('0x3a')]=_[_0x6cf6('0x3b')](_0x4e984f[_0x6cf6('0x3a')]);_0x1ed6f0[_0x6cf6('0x3c')]=_[_0x6cf6('0x3d')](_0x1ed6f0[_0x6cf6('0x39')],_0x1ed6f0[_0x6cf6('0x3a')]);_0x2bdae9[_0x6cf6('0x3e')]=_[_0x6cf6('0x3d')](_0x1ed6f0[_0x6cf6('0x39')],qs[_0x6cf6('0x3f')](_0x4e984f[_0x6cf6('0x3a')][_0x6cf6('0x3f')]));_0x2bdae9['attributes']=_0x2bdae9['attributes']['length']?_0x2bdae9[_0x6cf6('0x3e')]:_0x1ed6f0['model'];if(!_0x4e984f[_0x6cf6('0x3a')][_0x6cf6('0x41')]('nolimit')){_0x2bdae9['limit']=qs[_0x6cf6('0x1f')](_0x4e984f['query'][_0x6cf6('0x1f')]);_0x2bdae9[_0x6cf6('0x1e')]=qs[_0x6cf6('0x1e')](_0x4e984f[_0x6cf6('0x3a')][_0x6cf6('0x1e')]);}_0x2bdae9[_0x6cf6('0x43')]=qs['sort'](_0x4e984f[_0x6cf6('0x3a')][_0x6cf6('0x44')]);_0x2bdae9['where']=qs[_0x6cf6('0x3c')](_[_0x6cf6('0x46')](_0x4e984f['query'],_0x1ed6f0[_0x6cf6('0x3c')]));_0x2bdae9[_0x6cf6('0x45')][_0x6cf6('0x61')]=_0x197d83['id'];if(_0x4e984f[_0x6cf6('0x3a')]['filter']){_0x2bdae9[_0x6cf6('0x45')]=_[_0x6cf6('0x47')](_0x2bdae9[_0x6cf6('0x45')],{'$or':_[_0x6cf6('0x2d')](_0x2bdae9['attributes'],function(_0xc0ecf4){var _0x17b193={};_0x17b193[_0xc0ecf4]={'$like':'%'+_0x4e984f[_0x6cf6('0x3a')][_0x6cf6('0x49')]+'%'};return _0x17b193;})});}_0x2bdae9=_['merge']({},_0x2bdae9,_0x4e984f['options']);return db[_0x6cf6('0x67')][_0x6cf6('0x1d')]({'where':_0x2bdae9[_0x6cf6('0x45')]})[_0x6cf6('0x27')](function(_0x581cb2){_0x41d2c7['count']=_0x581cb2;if(_0x4e984f[_0x6cf6('0x3a')][_0x6cf6('0x4f')]){_0x2bdae9[_0x6cf6('0x4b')]=[{'all':!![]}];}return db[_0x6cf6('0x67')][_0x6cf6('0x4c')](_0x2bdae9);})[_0x6cf6('0x27')](function(_0x53f0a3){_0x41d2c7[_0x6cf6('0x63')]=_0x53f0a3;return _0x41d2c7;});}})[_0x6cf6('0x27')](respondWithFilteredResult(_0x4b849b,_0x2bdae9))[_0x6cf6('0x4d')](handleError(_0x4b849b,null));};exports[_0x6cf6('0x68')]=function(_0x367406,_0x450ffb,_0x400a67){var _0x3072ba={'raw':!![],'where':{}};var _0x34c597={};var _0x2dc2c1={'count':0x0,'rows':[]};return db[_0x6cf6('0x36')][_0x6cf6('0x60')]({'where':{'id':_0x367406[_0x6cf6('0x57')]['id']}})[_0x6cf6('0x27')](handleEntityNotFound(_0x450ffb,null))[_0x6cf6('0x27')](function(_0x3d7135){if(_0x3d7135){_0x34c597['model']=_[_0x6cf6('0x3b')](db[_0x6cf6('0x69')][_0x6cf6('0x37')]);_0x34c597['query']=_['keys'](_0x367406['query']);_0x34c597[_0x6cf6('0x3c')]=_['intersection'](_0x34c597['model'],_0x34c597[_0x6cf6('0x3a')]);_0x3072ba[_0x6cf6('0x3e')]=_[_0x6cf6('0x3d')](_0x34c597[_0x6cf6('0x39')],qs['fields'](_0x367406[_0x6cf6('0x3a')][_0x6cf6('0x3f')]));_0x3072ba[_0x6cf6('0x3e')]=_0x3072ba[_0x6cf6('0x3e')][_0x6cf6('0x40')]?_0x3072ba[_0x6cf6('0x3e')]:_0x34c597[_0x6cf6('0x39')];if(!_0x367406[_0x6cf6('0x3a')][_0x6cf6('0x41')](_0x6cf6('0x42'))){_0x3072ba[_0x6cf6('0x1f')]=qs[_0x6cf6('0x1f')](_0x367406[_0x6cf6('0x3a')]['limit']);_0x3072ba[_0x6cf6('0x1e')]=qs['offset'](_0x367406[_0x6cf6('0x3a')]['offset']);}_0x3072ba[_0x6cf6('0x43')]=qs[_0x6cf6('0x44')](_0x367406[_0x6cf6('0x3a')]['sort']);_0x3072ba['where']=qs[_0x6cf6('0x3c')](_[_0x6cf6('0x46')](_0x367406[_0x6cf6('0x3a')],_0x34c597[_0x6cf6('0x3c')]));_0x3072ba['where']['VoiceQueueId']=_0x3d7135['id'];if(_0x367406[_0x6cf6('0x3a')]['filter']){_0x3072ba[_0x6cf6('0x45')]=_[_0x6cf6('0x47')](_0x3072ba[_0x6cf6('0x45')],{'$or':_[_0x6cf6('0x2d')](_0x3072ba[_0x6cf6('0x3e')],function(_0x3e0d2d){var _0x23430e={};_0x23430e[_0x3e0d2d]={'$like':'%'+_0x367406[_0x6cf6('0x3a')]['filter']+'%'};return _0x23430e;})});}_0x3072ba=_[_0x6cf6('0x47')]({},_0x3072ba,_0x367406[_0x6cf6('0x4a')]);return db[_0x6cf6('0x69')][_0x6cf6('0x1d')]({'where':_0x3072ba[_0x6cf6('0x45')]})['then'](function(_0x6bce58){_0x2dc2c1['count']=_0x6bce58;if(_0x367406['query'][_0x6cf6('0x4f')]){_0x3072ba['include']=[{'all':!![]}];}return db['CmHopperBlack'][_0x6cf6('0x4c')](_0x3072ba);})[_0x6cf6('0x27')](function(_0x4700ac){_0x2dc2c1[_0x6cf6('0x63')]=_0x4700ac;return _0x2dc2c1;});}})['then'](respondWithFilteredResult(_0x450ffb,_0x3072ba))[_0x6cf6('0x4d')](handleError(_0x450ffb,null));};exports['getTeams']=function(_0x3de403,_0x2c6411,_0x18fa18){var _0x2377cd={};var _0x15d11={};var _0x48e595;var _0x3bb382;return db[_0x6cf6('0x36')][_0x6cf6('0x60')]({'where':{'id':_0x3de403[_0x6cf6('0x57')]['id']}})[_0x6cf6('0x27')](handleEntityNotFound(_0x2c6411,null))['then'](function(_0x2f63b0){if(_0x2f63b0){_0x48e595=_0x2f63b0;_0x15d11[_0x6cf6('0x39')]=_[_0x6cf6('0x3b')](db['Team'][_0x6cf6('0x37')]);_0x15d11[_0x6cf6('0x3a')]=_[_0x6cf6('0x3b')](_0x3de403[_0x6cf6('0x3a')]);_0x15d11[_0x6cf6('0x3c')]=_[_0x6cf6('0x3d')](_0x15d11[_0x6cf6('0x39')],_0x15d11[_0x6cf6('0x3a')]);_0x2377cd[_0x6cf6('0x3e')]=_[_0x6cf6('0x3d')](_0x15d11[_0x6cf6('0x39')],qs[_0x6cf6('0x3f')](_0x3de403[_0x6cf6('0x3a')]['fields']));_0x2377cd[_0x6cf6('0x3e')]=_0x2377cd[_0x6cf6('0x3e')][_0x6cf6('0x40')]?_0x2377cd[_0x6cf6('0x3e')]:_0x15d11['model'];_0x2377cd[_0x6cf6('0x43')]=qs[_0x6cf6('0x44')](_0x3de403['query'][_0x6cf6('0x44')]);_0x2377cd[_0x6cf6('0x45')]=qs[_0x6cf6('0x3c')](_[_0x6cf6('0x46')](_0x3de403[_0x6cf6('0x3a')],_0x15d11[_0x6cf6('0x3c')]));if(_0x3de403['query'][_0x6cf6('0x49')]){_0x2377cd[_0x6cf6('0x45')]=_[_0x6cf6('0x47')](_0x2377cd[_0x6cf6('0x45')],{'$or':_[_0x6cf6('0x2d')](_0x2377cd[_0x6cf6('0x3e')],function(_0x54140a){var _0xcfc876={};_0xcfc876[_0x54140a]={'$like':'%'+_0x3de403[_0x6cf6('0x3a')]['filter']+'%'};return _0xcfc876;})});}_0x2377cd=_[_0x6cf6('0x47')]({},_0x2377cd,_0x3de403[_0x6cf6('0x4a')]);return _0x48e595[_0x6cf6('0x6a')](_0x2377cd);}})[_0x6cf6('0x27')](function(_0x5bc78d){if(_0x5bc78d){_0x3bb382=_0x5bc78d[_0x6cf6('0x40')];if(!_0x3de403['query'][_0x6cf6('0x41')]('nolimit')){_0x2377cd[_0x6cf6('0x1f')]=qs[_0x6cf6('0x1f')](_0x3de403[_0x6cf6('0x3a')]['limit']);_0x2377cd[_0x6cf6('0x1e')]=qs[_0x6cf6('0x1e')](_0x3de403[_0x6cf6('0x3a')]['offset']);}return _0x48e595['getTeams'](_0x2377cd);}})['then'](function(_0x3b6563){if(_0x3b6563){return _0x3b6563?{'count':_0x3bb382,'rows':_0x3b6563}:null;}})[_0x6cf6('0x27')](respondWithResult(_0x2c6411,null))[_0x6cf6('0x4d')](handleError(_0x2c6411,null));};exports[_0x6cf6('0x6b')]=function(_0x202ad2,_0x2efe3f,_0xdb015){var _0x396600=_0x202ad2[_0x6cf6('0x51')][_0x6cf6('0x6c')];var _0x60cbf1=_[_0x6cf6('0x2d')](_0x396600,'id');return db[_0x6cf6('0x6d')]['findAll']({'where':{'id':_0x60cbf1},'attributes':['id'],'include':[{'model':db[_0x6cf6('0x6e')],'as':'Agents','attributes':['id',_0x6cf6('0x33'),'online',_0x6cf6('0x6f'),'interface'],'raw':!![]}]})[_0x6cf6('0x27')](function(_0x24ffe3){if(_0x24ffe3){var _0x16c35b=_[_0x6cf6('0x70')](_0x24ffe3,function(_0x49d760){var _0x2b7650=_0x49d760['get']({'plain':!![]});_0x2b7650[_0x6cf6('0x71')][_0x6cf6('0x72')](function(_0x51daac){_0x51daac[_0x6cf6('0x73')]=_[_0x6cf6('0x2f')](_0x396600,{'id':_0x2b7650['id']})[_0x6cf6('0x73')];});return _0x2b7650[_0x6cf6('0x71')];});return db[_0x6cf6('0x36')][_0x6cf6('0x2f')]({'where':{'id':_0x202ad2[_0x6cf6('0x57')]['id']}})[_0x6cf6('0x27')](function(_0x5661bb){return db[_0x6cf6('0x74')][_0x6cf6('0x75')](function(_0x1d6523){return _0x5661bb[_0x6cf6('0x6b')](_0x60cbf1,{'transaction':_0x1d6523})[_0x6cf6('0x27')](function(){return BPromise[_0x6cf6('0x76')](_0x16c35b,function(_0x11e819){return db[_0x6cf6('0x77')][_0x6cf6('0x78')]({'where':{'UserId':_0x11e819['id'],'VoiceQueueId':_0x202ad2[_0x6cf6('0x57')]['id']},'defaults':{'penalty':_0x11e819[_0x6cf6('0x73')]},'transaction':_0x1d6523});});})['then'](function(){return BPromise[_0x6cf6('0x76')](_[_0x6cf6('0x49')](_0x16c35b,{'online':!![]}),function(_0x3c20be){return db[_0x6cf6('0x79')][_0x6cf6('0x7a')]({'membername':_0x3c20be[_0x6cf6('0x33')],'UserId':_0x3c20be['id'],'queue_name':_0x5661bb[_0x6cf6('0x33')],'VoiceQueueId':_0x5661bb['id'],'interface':_['isNil'](_0x3c20be[_0x6cf6('0x7b')])?util[_0x6cf6('0x7c')]('SIP/%s',_0x3c20be[_0x6cf6('0x33')]):_0x3c20be[_0x6cf6('0x7b')],'paused':_0x3c20be['voicePause']||![],'penalty':_0x3c20be[_0x6cf6('0x73')]},{'transaction':_0x1d6523});});})[_0x6cf6('0x27')](function(){_0x16c35b[_0x6cf6('0x72')](function(_0x4da94f){socket['emit']('userVoiceQueue:save',{'UserId':_0x4da94f['id'],'VoiceQueueId':_0x5661bb['id']});});});});});}})[_0x6cf6('0x27')](respondWithStatusCode(_0x2efe3f,null))[_0x6cf6('0x4d')](handleError(_0x2efe3f,null));};exports[_0x6cf6('0x7d')]=function(_0x20dc55,_0x3d669c,_0x3e9806){return db['Team'][_0x6cf6('0x4c')]({'where':{'id':_0x20dc55[_0x6cf6('0x3a')]['ids']},'attributes':['id'],'include':[{'model':db[_0x6cf6('0x6e')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x6cf6('0x27')](handleEntityNotFound(_0x3d669c,null))[_0x6cf6('0x27')](function(_0x27d8a1){var _0x34465d=_[_0x6cf6('0x2d')](_0x27d8a1,'id');var _0xd3330=[];var _0x43e352=[];var _0x4a536e=squel[_0x6cf6('0x7e')]();_0x4a536e['field'](_0x6cf6('0x7f'))[_0x6cf6('0x80')](_0x6cf6('0x81'),'tq')['join'](_0x6cf6('0x82'),'ut',_0x6cf6('0x83'))['where'](_0x6cf6('0x84'),_0x20dc55[_0x6cf6('0x57')]['id']);for(var _0x199fd4=0x0;_0x199fd4<_0x27d8a1['length'];_0x199fd4+=0x1){let _0xb7fae6=_0x27d8a1[_0x199fd4];for(var _0x422b57=0x0;_0x422b57<_0xb7fae6[_0x6cf6('0x71')][_0x6cf6('0x40')];_0x422b57+=0x1){let _0x4bf530=_0xb7fae6[_0x6cf6('0x71')][_0x422b57];var _0x142142=_0x4a536e[_0x6cf6('0x85')]();_0x142142[_0x6cf6('0x45')](_0x6cf6('0x86'),_0x4bf530['id']);_0x43e352['push'](db[_0x6cf6('0x74')][_0x6cf6('0x3a')](_0x142142[_0x6cf6('0x87')](),{'type':db['sequelize'][_0x6cf6('0x88')][_0x6cf6('0x89')]})[_0x6cf6('0x27')](function(_0xb8cf5a){if(_0xb8cf5a[_0x6cf6('0x40')]===0x1){return _0x4bf530['id'];}else{var _0x9a9d2a=_[_0x6cf6('0x8a')](_[_0x6cf6('0x2d')](_0xb8cf5a,'TeamId'),function(_0x971ff0){return _['includes'](_0x34465d,_0x971ff0);});if(_0x9a9d2a){return _0x4bf530['id'];}}}));}}return BPromise[_0x6cf6('0x8b')](_0x43e352)[_0x6cf6('0x27')](function(_0x44c2dc){_0xd3330=_(_0xd3330)[_0x6cf6('0x8c')](_0x44c2dc)[_0x6cf6('0x8d')]()[_0x6cf6('0x2e')]();return db[_0x6cf6('0x36')][_0x6cf6('0x2f')]({'where':{'id':_0x20dc55[_0x6cf6('0x57')]['id']}})[_0x6cf6('0x27')](function(_0x44be5b){return db['sequelize'][_0x6cf6('0x75')](function(_0x2dfa0e){return _0x44be5b['removeTeams'](_0x20dc55[_0x6cf6('0x3a')]['ids'],{'transaction':_0x2dfa0e})[_0x6cf6('0x27')](function(){if(!_[_0x6cf6('0x8e')](_0xd3330)){return _0x44be5b['removeAgents'](_0xd3330,{'transaction':_0x2dfa0e})[_0x6cf6('0x27')](function(){return db[_0x6cf6('0x79')]['destroy']({'where':{'VoiceQueueId':_0x20dc55[_0x6cf6('0x57')]['id'],'UserId':_0xd3330},'transaction':_0x2dfa0e});});}})[_0x6cf6('0x27')](function(){_0xd3330['forEach'](function(_0x27bab7){socket[_0x6cf6('0x8f')](_0x6cf6('0x90'),{'UserId':_0x27bab7,'VoiceQueueId':_0x44be5b['id']});});});});});});})['then'](respondWithStatusCode(_0x3d669c,null))['catch'](handleError(_0x3d669c,null));};exports[_0x6cf6('0x91')]=function(_0x2dde9f,_0x301222,_0x5ae214){var _0x7703dd,_0x17e773;return db[_0x6cf6('0x36')]['find']({'where':{'id':_0x2dde9f[_0x6cf6('0x57')]['id']}})[_0x6cf6('0x27')](handleEntityNotFound(_0x301222,null))[_0x6cf6('0x27')](function(_0x29316f){if(_0x29316f){_0x17e773=_0x29316f;return _0x29316f[_0x6cf6('0x91')](_0x2dde9f[_0x6cf6('0x51')]['ids'],_[_0x6cf6('0x58')](_0x2dde9f[_0x6cf6('0x51')],[_0x6cf6('0x92'),'id'])||{})[_0x6cf6('0x93')](function(_0x318a78){for(var _0xd07e77=0x0;_0xd07e77<_0x2dde9f[_0x6cf6('0x51')][_0x6cf6('0x92')]['length'];_0xd07e77+=0x1){socket[_0x6cf6('0x8f')](_0x6cf6('0x94'),{'UserId':_0x2dde9f[_0x6cf6('0x51')][_0x6cf6('0x92')][_0xd07e77],'VoiceQueueId':_0x2dde9f['params']['id']});}return _0x318a78;});}})[_0x6cf6('0x27')](function(_0xa57ff){_0x7703dd=_0xa57ff||[];if(_0x17e773){return db[_0x6cf6('0x6e')][_0x6cf6('0x4c')]({'where':{'id':_0x2dde9f[_0x6cf6('0x51')]['ids']},'attributes':['id',_0x6cf6('0x33'),_0x6cf6('0x95'),'voicePause',_0x6cf6('0x7b')],'raw':!![]});}})[_0x6cf6('0x27')](function(_0x39718e){if(!_['isEmpty'](_0x39718e)){var _0x46dab0=[];for(var _0x4240e2=0x0;_0x4240e2<_0x39718e['length'];_0x4240e2++){if(_0x39718e[_0x4240e2][_0x6cf6('0x95')]){_0x46dab0[_0x6cf6('0x96')](db[_0x6cf6('0x79')][_0x6cf6('0x7a')]({'membername':_0x39718e[_0x4240e2]['name'],'UserId':_0x39718e[_0x4240e2]['id'],'queue_name':_0x17e773['name'],'VoiceQueueId':_0x17e773['id'],'interface':_[_0x6cf6('0x97')](_0x39718e[_0x4240e2]['interface'])?util['format'](_0x6cf6('0x98'),_0x39718e[_0x4240e2][_0x6cf6('0x33')]):_0x39718e[_0x4240e2]['interface'],'paused':_0x39718e[_0x4240e2][_0x6cf6('0x6f')]||![],'penalty':_0x2dde9f[_0x6cf6('0x51')][_0x6cf6('0x73')]||0x0}));}}return BPromise[_0x6cf6('0x8b')](_0x46dab0);}})[_0x6cf6('0x27')](function(){return _0x7703dd;})[_0x6cf6('0x27')](respondWithResult(_0x301222,null))['catch'](handleError(_0x301222,null));};exports[_0x6cf6('0x99')]=function(_0x3e09a5,_0x4c07c4,_0x5bdd40){return db[_0x6cf6('0x36')][_0x6cf6('0x2f')]({'where':{'id':_0x3e09a5['params']['id']}})[_0x6cf6('0x27')](handleEntityNotFound(_0x4c07c4,null))['then'](function(_0x3d6371){if(_0x3d6371){return _0x3d6371['removeAgents'](_0x3e09a5[_0x6cf6('0x3a')][_0x6cf6('0x92')])[_0x6cf6('0x27')](function(){if(_[_0x6cf6('0x9a')](_0x3e09a5['query']['ids'])){for(var _0x134391=0x0;_0x134391<_0x3e09a5[_0x6cf6('0x3a')]['ids'][_0x6cf6('0x40')];_0x134391+=0x1){socket[_0x6cf6('0x8f')](_0x6cf6('0x90'),{'UserId':Number(_0x3e09a5[_0x6cf6('0x3a')]['ids'][_0x134391]),'VoiceQueueId':Number(_0x3e09a5[_0x6cf6('0x57')]['id'])});}}else{socket[_0x6cf6('0x8f')](_0x6cf6('0x90'),{'UserId':Number(_0x3e09a5[_0x6cf6('0x3a')][_0x6cf6('0x92')]),'VoiceQueueId':Number(_0x3e09a5[_0x6cf6('0x57')]['id'])});}});}})['then'](function(_0xb013bf){return db['UserVoiceQueueRt'][_0x6cf6('0x26')]({'where':{'VoiceQueueId':_0x3e09a5['params']['id'],'UserId':_0x3e09a5[_0x6cf6('0x3a')][_0x6cf6('0x92')]}})[_0x6cf6('0x27')](function(){return _0xb013bf;});})[_0x6cf6('0x27')](respondWithStatusCode(_0x4c07c4,null))[_0x6cf6('0x4d')](handleError(_0x4c07c4,null));};exports[_0x6cf6('0x9b')]=function(_0x258a9e,_0x24258d,_0x2491ca){var _0x417cc1={};var _0x34b9c9={};var _0x337dc6;var _0x260b40;return db['VoiceQueue'][_0x6cf6('0x60')]({'where':{'id':_0x258a9e[_0x6cf6('0x57')]['id']}})[_0x6cf6('0x27')](handleEntityNotFound(_0x24258d,null))[_0x6cf6('0x27')](function(_0x2e0c38){if(_0x2e0c38){_0x337dc6=_0x2e0c38;_0x34b9c9['model']=_[_0x6cf6('0x3b')](db['User'][_0x6cf6('0x37')]);_0x34b9c9[_0x6cf6('0x3a')]=_[_0x6cf6('0x3b')](_0x258a9e[_0x6cf6('0x3a')]);_0x34b9c9[_0x6cf6('0x3c')]=_['intersection'](_0x34b9c9[_0x6cf6('0x39')],_0x34b9c9[_0x6cf6('0x3a')]);_0x417cc1[_0x6cf6('0x3e')]=_[_0x6cf6('0x3d')](_0x34b9c9[_0x6cf6('0x39')],qs[_0x6cf6('0x3f')](_0x258a9e['query'][_0x6cf6('0x3f')]));_0x417cc1['attributes']=_0x417cc1[_0x6cf6('0x3e')][_0x6cf6('0x40')]?_0x417cc1['attributes']:_0x34b9c9[_0x6cf6('0x39')];_0x417cc1[_0x6cf6('0x43')]=qs[_0x6cf6('0x44')](_0x258a9e[_0x6cf6('0x3a')][_0x6cf6('0x44')]);_0x417cc1[_0x6cf6('0x45')]=qs[_0x6cf6('0x3c')](_['pick'](_0x258a9e['query'],_0x34b9c9['filters']));if(_0x258a9e[_0x6cf6('0x3a')][_0x6cf6('0x49')]){_0x417cc1[_0x6cf6('0x45')]=_[_0x6cf6('0x47')](_0x417cc1[_0x6cf6('0x45')],{'$or':_[_0x6cf6('0x2d')](_0x417cc1[_0x6cf6('0x3e')],function(_0x1eea20){var _0x8dcf0b={};_0x8dcf0b[_0x1eea20]={'$like':'%'+_0x258a9e[_0x6cf6('0x3a')][_0x6cf6('0x49')]+'%'};return _0x8dcf0b;})});}_0x417cc1=_['merge']({},_0x417cc1,_0x258a9e[_0x6cf6('0x4a')]);return _0x337dc6['getAgents'](_0x417cc1);}})['then'](function(_0xd2175f){if(_0xd2175f){_0x260b40=_0xd2175f['length'];if(!_0x258a9e['query'][_0x6cf6('0x41')](_0x6cf6('0x42'))){_0x417cc1[_0x6cf6('0x1f')]=qs[_0x6cf6('0x1f')](_0x258a9e[_0x6cf6('0x3a')][_0x6cf6('0x1f')]);_0x417cc1[_0x6cf6('0x1e')]=qs['offset'](_0x258a9e[_0x6cf6('0x3a')][_0x6cf6('0x1e')]);}return _0x337dc6[_0x6cf6('0x9b')](_0x417cc1);}})['then'](function(_0x1b79f9){if(_0x1b79f9){return _0x1b79f9?{'count':_0x260b40,'rows':_0x1b79f9}:null;}})[_0x6cf6('0x27')](respondWithResult(_0x24258d,null))[_0x6cf6('0x4d')](handleError(_0x24258d,null));};exports['getMembers']=function(_0x5119b3,_0x125194,_0x1103f7){var _0x1753ba={};var _0x1be4d4={};var _0x16b1f1;var _0x83ca94;return db[_0x6cf6('0x36')]['findOne']({'where':{'id':_0x5119b3[_0x6cf6('0x57')]['id']}})[_0x6cf6('0x27')](handleEntityNotFound(_0x125194,null))[_0x6cf6('0x27')](function(_0x58bacc){if(_0x58bacc){_0x16b1f1=_0x58bacc;_0x1be4d4[_0x6cf6('0x39')]=_['keys'](db[_0x6cf6('0x79')][_0x6cf6('0x37')]);_0x1be4d4[_0x6cf6('0x3a')]=_[_0x6cf6('0x3b')](_0x5119b3[_0x6cf6('0x3a')]);_0x1be4d4['filters']=_[_0x6cf6('0x3d')](_0x1be4d4[_0x6cf6('0x39')],_0x1be4d4[_0x6cf6('0x3a')]);_0x1753ba['attributes']=_[_0x6cf6('0x3d')](_0x1be4d4[_0x6cf6('0x39')],qs[_0x6cf6('0x3f')](_0x5119b3[_0x6cf6('0x3a')][_0x6cf6('0x3f')]));_0x1753ba[_0x6cf6('0x3e')]=_0x1753ba['attributes'][_0x6cf6('0x40')]?_0x1753ba[_0x6cf6('0x3e')]:_0x1be4d4[_0x6cf6('0x39')];_0x1753ba[_0x6cf6('0x43')]=qs[_0x6cf6('0x44')](_0x5119b3['query']['sort']);_0x1753ba[_0x6cf6('0x45')]=qs['filters'](_[_0x6cf6('0x46')](_0x5119b3[_0x6cf6('0x3a')],_0x1be4d4['filters']));if(_0x5119b3[_0x6cf6('0x3a')][_0x6cf6('0x49')]){_0x1753ba[_0x6cf6('0x45')]=_[_0x6cf6('0x47')](_0x1753ba[_0x6cf6('0x45')],{'$or':_[_0x6cf6('0x2d')](_0x1753ba[_0x6cf6('0x3e')],function(_0xd4120f){var _0x3753b7={};_0x3753b7[_0xd4120f]={'$like':'%'+_0x5119b3['query'][_0x6cf6('0x49')]+'%'};return _0x3753b7;})});}_0x1753ba=_[_0x6cf6('0x47')]({},_0x1753ba,_0x5119b3[_0x6cf6('0x4a')]);return _0x16b1f1[_0x6cf6('0x9c')](_0x1753ba);}})['then'](function(_0x23f258){if(_0x23f258){_0x83ca94=_0x23f258[_0x6cf6('0x40')];if(!_0x5119b3[_0x6cf6('0x3a')][_0x6cf6('0x41')]('nolimit')){_0x1753ba[_0x6cf6('0x1f')]=qs[_0x6cf6('0x1f')](_0x5119b3[_0x6cf6('0x3a')][_0x6cf6('0x1f')]);_0x1753ba[_0x6cf6('0x1e')]=qs[_0x6cf6('0x1e')](_0x5119b3[_0x6cf6('0x3a')]['offset']);}return _0x16b1f1[_0x6cf6('0x9c')](_0x1753ba);}})['then'](function(_0x324900){return _0x324900?{'count':_0x83ca94,'rows':_0x324900}:null;})['then'](respondWithResult(_0x125194,null))[_0x6cf6('0x4d')](handleError(_0x125194,null));};exports['getLists']=function(_0x42e6de,_0x125dcf,_0x3cc5e3){var _0x170bfb={};var _0x2c1cb6={};var _0x2220fd;var _0x2c85ae;return db[_0x6cf6('0x36')]['findOne']({'where':{'id':_0x42e6de['params']['id']}})[_0x6cf6('0x27')](handleEntityNotFound(_0x125dcf,null))[_0x6cf6('0x27')](function(_0x200c78){if(_0x200c78){_0x2220fd=_0x200c78;_0x2c1cb6['model']=_['keys'](db[_0x6cf6('0x9d')][_0x6cf6('0x37')]);_0x2c1cb6['query']=_[_0x6cf6('0x3b')](_0x42e6de[_0x6cf6('0x3a')]);_0x2c1cb6[_0x6cf6('0x3c')]=_[_0x6cf6('0x3d')](_0x2c1cb6['model'],_0x2c1cb6['query']);_0x170bfb[_0x6cf6('0x3e')]=_['intersection'](_0x2c1cb6[_0x6cf6('0x39')],qs[_0x6cf6('0x3f')](_0x42e6de[_0x6cf6('0x3a')][_0x6cf6('0x3f')]));_0x170bfb['attributes']=_0x170bfb['attributes'][_0x6cf6('0x40')]?_0x170bfb[_0x6cf6('0x3e')]:_0x2c1cb6[_0x6cf6('0x39')];_0x170bfb[_0x6cf6('0x43')]=qs['sort'](_0x42e6de[_0x6cf6('0x3a')]['sort']);_0x170bfb[_0x6cf6('0x45')]=qs[_0x6cf6('0x3c')](_['pick'](_0x42e6de[_0x6cf6('0x3a')],_0x2c1cb6[_0x6cf6('0x3c')]));if(_0x42e6de['query'][_0x6cf6('0x49')]){_0x170bfb['where']=_[_0x6cf6('0x47')](_0x170bfb[_0x6cf6('0x45')],{'$or':_[_0x6cf6('0x2d')](_0x170bfb[_0x6cf6('0x3e')],function(_0x17a314){var _0x13d429={};_0x13d429[_0x17a314]={'$like':'%'+_0x42e6de[_0x6cf6('0x3a')]['filter']+'%'};return _0x13d429;})});}_0x170bfb=_[_0x6cf6('0x47')]({},_0x170bfb,_0x42e6de['options']);return _0x2220fd[_0x6cf6('0x9e')](_0x170bfb);}})['then'](function(_0x4bcb4a){if(_0x4bcb4a){_0x2c85ae=_0x4bcb4a[_0x6cf6('0x40')];if(!_0x42e6de[_0x6cf6('0x3a')]['hasOwnProperty'](_0x6cf6('0x42'))){_0x170bfb[_0x6cf6('0x1f')]=qs[_0x6cf6('0x1f')](_0x42e6de[_0x6cf6('0x3a')][_0x6cf6('0x1f')]);_0x170bfb[_0x6cf6('0x1e')]=qs['offset'](_0x42e6de['query'][_0x6cf6('0x1e')]);}return _0x2220fd[_0x6cf6('0x9e')](_0x170bfb);}})[_0x6cf6('0x27')](function(_0x709c6b){if(_0x709c6b){return _0x709c6b?{'count':_0x2c85ae,'rows':_0x709c6b}:null;}})[_0x6cf6('0x27')](respondWithResult(_0x125dcf,null))[_0x6cf6('0x4d')](handleError(_0x125dcf,null));};exports[_0x6cf6('0x9f')]=function(_0x45c57a,_0x51973b,_0x202697){var _0x2b7bee,_0x462573;return db[_0x6cf6('0x36')][_0x6cf6('0x2f')]({'where':{'id':_0x45c57a[_0x6cf6('0x57')]['id']}})[_0x6cf6('0x27')](handleEntityNotFound(_0x51973b,null))[_0x6cf6('0x27')](function(_0x151a05){if(_0x151a05){_0x462573=_0x151a05;return _0x151a05[_0x6cf6('0x9f')](_0x45c57a[_0x6cf6('0x51')]['ids'],_[_0x6cf6('0x58')](_0x45c57a[_0x6cf6('0x51')],[_0x6cf6('0x92'),'id'])||{});}return null;})[_0x6cf6('0x93')](function(_0x4cc5a9){var _0x5c2af5;_0x2b7bee=_0x4cc5a9||[];var _0x181d12=[];if(_0x4cc5a9){for(var _0x3f2159=0x0;_0x3f2159<_0x4cc5a9['length'];_0x3f2159+=0x1){var _0x3a27b3=_0x4cc5a9[_0x3f2159][_0x6cf6('0x28')]({'plain':!![]});_0x462573['dialCheckDuplicateType']=_0x45c57a[_0x6cf6('0x51')][_0x6cf6('0xa0')]?_0x45c57a[_0x6cf6('0x51')]['dialCheckDuplicateType']:_0x462573['dialCheckDuplicateType'];switch(_0x462573[_0x6cf6('0xa0')]){case'always':_0x5c2af5=squel['insert']()[_0x6cf6('0xa1')](_0x6cf6('0xa2'))[_0x6cf6('0xa3')]([_0x6cf6('0xa4'),_0x6cf6('0xa5'),_0x6cf6('0xa6'),_0x6cf6('0xa7'),'VoiceQueueId',_0x6cf6('0x5a'),_0x6cf6('0x59')],squel[_0x6cf6('0x7e')]()[_0x6cf6('0xa8')](_0x6cf6('0xa4'),_0x6cf6('0xa4'))['field'](_0x6cf6('0xa9'),'scheduledAt')['field']('id',_0x6cf6('0xa6'))['field'](_0x3a27b3[_0x6cf6('0xaa')][_0x6cf6('0x87')](),_0x6cf6('0xa7'))[_0x6cf6('0xa8')](_0x45c57a[_0x6cf6('0x57')]['id'][_0x6cf6('0x87')](),'VoiceQueueId')['field'](_0x6cf6('0xa9'),_0x6cf6('0x5a'))[_0x6cf6('0xa8')](_0x6cf6('0xa9'),'updatedAt')['from'](_0x6cf6('0xab'))['where'](_0x6cf6('0xac'))['where'](_0x6cf6('0xad'),_0x3a27b3['CmListId'][_0x6cf6('0x87')]())[_0x6cf6('0x45')](_0x6cf6('0xae'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x6cf6('0x7e')]()['field'](_0x6cf6('0xaf'))[_0x6cf6('0x80')](_0x6cf6('0xb0'))[_0x6cf6('0x45')](_0x6cf6('0x84'),_0x45c57a[_0x6cf6('0x57')]['id'][_0x6cf6('0x87')]()))[_0x6cf6('0x45')](_0x6cf6('0xb1'),squel[_0x6cf6('0x7e')]()[_0x6cf6('0xa8')](_0x6cf6('0xb2'))[_0x6cf6('0x80')](_0x6cf6('0xa2'))[_0x6cf6('0x45')](_0x6cf6('0x84'),_0x45c57a[_0x6cf6('0x57')]['id'][_0x6cf6('0x87')]())))[_0x6cf6('0x87')]();break;case _0x6cf6('0xb3'):_0x5c2af5=squel['insert']()[_0x6cf6('0xa1')](_0x6cf6('0xa2'))[_0x6cf6('0xa3')]([_0x6cf6('0xa4'),_0x6cf6('0xa5'),_0x6cf6('0xa6'),_0x6cf6('0xa7'),_0x6cf6('0x61'),'createdAt',_0x6cf6('0x59')],squel[_0x6cf6('0x7e')]()[_0x6cf6('0xa8')]('phone',_0x6cf6('0xa4'))[_0x6cf6('0xa8')](_0x6cf6('0xa9'),_0x6cf6('0xa5'))['field']('id',_0x6cf6('0xa6'))[_0x6cf6('0xa8')](_0x3a27b3[_0x6cf6('0xaa')]['toString'](),'ListId')[_0x6cf6('0xa8')](_0x45c57a[_0x6cf6('0x57')]['id'][_0x6cf6('0x87')](),_0x6cf6('0x61'))[_0x6cf6('0xa8')](_0x6cf6('0xa9'),_0x6cf6('0x5a'))[_0x6cf6('0xa8')](_0x6cf6('0xa9'),_0x6cf6('0x59'))[_0x6cf6('0x80')](_0x6cf6('0xab'))[_0x6cf6('0x45')]('deletedAt\x20IS\x20NULL')[_0x6cf6('0x45')](_0x6cf6('0xad'),_0x3a27b3[_0x6cf6('0xaa')][_0x6cf6('0x87')]())[_0x6cf6('0x45')]('phone\x20IS\x20NOT\x20NULL')[_0x6cf6('0x45')](_0x6cf6('0xb1'),squel[_0x6cf6('0x7e')]()['field'](_0x6cf6('0xb2'))[_0x6cf6('0x80')](_0x6cf6('0xa2'))[_0x6cf6('0x45')]('VoiceQueueId\x20=\x20?',_0x45c57a[_0x6cf6('0x57')]['id'][_0x6cf6('0x87')]())))[_0x6cf6('0x87')]();break;default:_0x5c2af5=squel['insert']()[_0x6cf6('0xa1')](_0x6cf6('0xa2'))[_0x6cf6('0xa3')]([_0x6cf6('0xa4'),_0x6cf6('0xa5'),_0x6cf6('0xa6'),_0x6cf6('0xa7'),'VoiceQueueId',_0x6cf6('0x5a'),_0x6cf6('0x59')],squel[_0x6cf6('0x7e')]()[_0x6cf6('0xa8')](_0x6cf6('0xa4'),_0x6cf6('0xa4'))[_0x6cf6('0xa8')](_0x6cf6('0xa9'),_0x6cf6('0xa5'))['field']('id',_0x6cf6('0xa6'))['field'](_0x3a27b3['CmListId'][_0x6cf6('0x87')](),_0x6cf6('0xa7'))['field'](_0x45c57a[_0x6cf6('0x57')]['id'][_0x6cf6('0x87')](),_0x6cf6('0x61'))[_0x6cf6('0xa8')](_0x6cf6('0xa9'),_0x6cf6('0x5a'))[_0x6cf6('0xa8')](_0x6cf6('0xa9'),'updatedAt')[_0x6cf6('0x80')](_0x6cf6('0xab'))[_0x6cf6('0x45')](_0x6cf6('0xac'))[_0x6cf6('0x45')](_0x6cf6('0xad'),_0x3a27b3['CmListId'][_0x6cf6('0x87')]())[_0x6cf6('0x45')]('phone\x20IS\x20NOT\x20NULL'))['toString']();}_0x181d12[_0x6cf6('0x96')](db[_0x6cf6('0x74')][_0x6cf6('0x3a')](_0x5c2af5));}return BPromise['all'](_0x181d12);}})[_0x6cf6('0x27')](function(){return _0x2b7bee;})[_0x6cf6('0x27')](respondWithResult(_0x51973b,null))[_0x6cf6('0x4d')](handleError(_0x51973b,null));};exports[_0x6cf6('0xb4')]=function(_0x2d0d35,_0x254229,_0x39d797){return db[_0x6cf6('0x36')]['find']({'where':{'id':_0x2d0d35['params']['id']}})[_0x6cf6('0x27')](handleEntityNotFound(_0x254229,null))[_0x6cf6('0x27')](function(_0x267214){if(_0x267214){return _0x267214['removeLists'](_0x2d0d35[_0x6cf6('0x3a')][_0x6cf6('0x92')]);}})[_0x6cf6('0x27')](function(_0x576b19){if(_0x576b19){return db[_0x6cf6('0x62')][_0x6cf6('0x26')]({'where':{'ListId':_0x2d0d35[_0x6cf6('0x3a')][_0x6cf6('0x92')],'VoiceQueueId':_0x2d0d35[_0x6cf6('0x57')]['id']}})['then'](function(){return _0x576b19;});}})[_0x6cf6('0x27')](respondWithStatusCode(_0x254229,null))[_0x6cf6('0x4d')](handleError(_0x254229,null));};exports[_0x6cf6('0xb5')]=function(_0x241839,_0x1c4006,_0x28cc28){var _0x3961a4={};var _0x4596db={};var _0x502921;var _0x3be2e0;return db[_0x6cf6('0x36')][_0x6cf6('0x60')]({'where':{'id':_0x241839['params']['id']}})[_0x6cf6('0x27')](handleEntityNotFound(_0x1c4006,null))[_0x6cf6('0x27')](function(_0x4be3cb){if(_0x4be3cb){_0x502921=_0x4be3cb;_0x4596db[_0x6cf6('0x39')]=_[_0x6cf6('0x3b')](db[_0x6cf6('0x9d')]['rawAttributes']);_0x4596db[_0x6cf6('0x3a')]=_[_0x6cf6('0x3b')](_0x241839[_0x6cf6('0x3a')]);_0x4596db[_0x6cf6('0x3c')]=_[_0x6cf6('0x3d')](_0x4596db[_0x6cf6('0x39')],_0x4596db[_0x6cf6('0x3a')]);_0x3961a4[_0x6cf6('0x3e')]=_[_0x6cf6('0x3d')](_0x4596db['model'],qs[_0x6cf6('0x3f')](_0x241839['query'][_0x6cf6('0x3f')]));_0x3961a4[_0x6cf6('0x3e')]=_0x3961a4[_0x6cf6('0x3e')]['length']?_0x3961a4['attributes']:_0x4596db[_0x6cf6('0x39')];_0x3961a4['order']=qs[_0x6cf6('0x44')](_0x241839[_0x6cf6('0x3a')][_0x6cf6('0x44')]);_0x3961a4['where']=qs['filters'](_['pick'](_0x241839[_0x6cf6('0x3a')],_0x4596db['filters']));if(_0x241839['query']['filter']){_0x3961a4[_0x6cf6('0x45')]=_[_0x6cf6('0x47')](_0x3961a4['where'],{'$or':_[_0x6cf6('0x2d')](_0x3961a4['attributes'],function(_0x2c46c5){var _0x38b010={};_0x38b010[_0x2c46c5]={'$like':'%'+_0x241839[_0x6cf6('0x3a')]['filter']+'%'};return _0x38b010;})});}_0x3961a4=_['merge']({},_0x3961a4,_0x241839['options']);return _0x502921[_0x6cf6('0xb5')](_0x3961a4);}})['then'](function(_0x3fbcf8){if(_0x3fbcf8){_0x3be2e0=_0x3fbcf8[_0x6cf6('0x40')];if(!_0x241839[_0x6cf6('0x3a')][_0x6cf6('0x41')](_0x6cf6('0x42'))){_0x3961a4[_0x6cf6('0x1f')]=qs['limit'](_0x241839[_0x6cf6('0x3a')][_0x6cf6('0x1f')]);_0x3961a4[_0x6cf6('0x1e')]=qs[_0x6cf6('0x1e')](_0x241839[_0x6cf6('0x3a')][_0x6cf6('0x1e')]);}return _0x502921['getBlackLists'](_0x3961a4);}})[_0x6cf6('0x27')](function(_0x12f929){if(_0x12f929){return _0x12f929?{'count':_0x3be2e0,'rows':_0x12f929}:null;}})[_0x6cf6('0x27')](respondWithResult(_0x1c4006,null))[_0x6cf6('0x4d')](handleError(_0x1c4006,null));};exports[_0x6cf6('0xb6')]=function(_0x2de1cf,_0x325350,_0x2fcf00){var _0x56be88,_0x17694e;return db[_0x6cf6('0x36')][_0x6cf6('0x2f')]({'where':{'id':_0x2de1cf[_0x6cf6('0x57')]['id']}})[_0x6cf6('0x27')](handleEntityNotFound(_0x325350,null))[_0x6cf6('0x27')](function(_0x45cb48){if(_0x45cb48){_0x17694e=_0x45cb48;return _0x45cb48['addBlackLists'](_0x2de1cf[_0x6cf6('0x51')]['ids'],_['omit'](_0x2de1cf[_0x6cf6('0x51')],[_0x6cf6('0x92'),'id'])||{});}return null;})[_0x6cf6('0x93')](function(_0x8e9a77){var _0x465558;_0x56be88=_0x8e9a77||[];var _0xbcf457=[];if(_0x8e9a77){for(var _0x775638=0x0;_0x775638<_0x8e9a77[_0x6cf6('0x40')];_0x775638+=0x1){var _0x19a6a=_0x8e9a77[_0x775638][_0x6cf6('0x28')]({'plain':!![]});_0x465558=squel[_0x6cf6('0xb7')]()[_0x6cf6('0xa1')](_0x6cf6('0xb8'))[_0x6cf6('0xa3')]([_0x6cf6('0xa4'),_0x6cf6('0xa6'),_0x6cf6('0xa7'),_0x6cf6('0x61'),_0x6cf6('0x5a'),_0x6cf6('0x59')],squel[_0x6cf6('0x7e')]()[_0x6cf6('0xa8')](_0x6cf6('0xa4'),_0x6cf6('0xa4'))['field']('id',_0x6cf6('0xa6'))[_0x6cf6('0xa8')](_0x19a6a['CmListId']['toString'](),_0x6cf6('0xa7'))[_0x6cf6('0xa8')](_0x2de1cf[_0x6cf6('0x57')]['id'][_0x6cf6('0x87')](),'VoiceQueueId')[_0x6cf6('0xa8')](_0x6cf6('0xa9'),_0x6cf6('0x5a'))[_0x6cf6('0xa8')](_0x6cf6('0xa9'),'updatedAt')[_0x6cf6('0x80')](_0x6cf6('0xab'))[_0x6cf6('0x45')](_0x6cf6('0xac'))['where']('ListId\x20=\x20?',_0x19a6a[_0x6cf6('0xaa')][_0x6cf6('0x87')]())['where'](_0x6cf6('0xae')))[_0x6cf6('0x87')]();_0xbcf457[_0x6cf6('0x96')](db[_0x6cf6('0x74')][_0x6cf6('0x3a')](_0x465558));}return BPromise[_0x6cf6('0x8b')](_0xbcf457);}})[_0x6cf6('0x27')](function(){return _0x56be88;})['then'](respondWithResult(_0x325350,null))['catch'](handleError(_0x325350,null));};exports[_0x6cf6('0xb9')]=function(_0x4ace3c,_0xd1c23,_0x6b5665){return db[_0x6cf6('0x36')][_0x6cf6('0x2f')]({'where':{'id':_0x4ace3c[_0x6cf6('0x57')]['id']}})[_0x6cf6('0x27')](handleEntityNotFound(_0xd1c23,null))[_0x6cf6('0x27')](function(_0x55ad55){if(_0x55ad55){return _0x55ad55[_0x6cf6('0xb9')](_0x4ace3c[_0x6cf6('0x3a')]['ids']);}})[_0x6cf6('0x27')](function(_0x1d0af8){if(_0x1d0af8){return db[_0x6cf6('0x69')]['destroy']({'where':{'ListId':_0x4ace3c[_0x6cf6('0x3a')][_0x6cf6('0x92')],'VoiceQueueId':_0x4ace3c[_0x6cf6('0x57')]['id']}})[_0x6cf6('0x27')](function(){return _0x1d0af8;});}})['then'](respondWithStatusCode(_0xd1c23,null))[_0x6cf6('0x4d')](handleError(_0xd1c23,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 6f9b131..29ca60c 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 _0x9957=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueue'];(function(_0x494118,_0x29077a){var _0x2ad03c=function(_0x3428b6){while(--_0x3428b6){_0x494118['push'](_0x494118['shift']());}};_0x2ad03c(++_0x29077a);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var EventEmitter=require(_0x7995('0x0'));var VoiceQueue=require(_0x7995('0x1'))['db'][_0x7995('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x7995('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7995('0x4'),'afterDestroy':_0x7995('0x5')};function emitEvent(_0x1902b4){return function(_0x462a03,_0x576d89,_0x744bea){VoiceQueueEvents[_0x7995('0x6')](_0x1902b4+':'+_0x462a03['id'],_0x462a03);VoiceQueueEvents[_0x7995('0x6')](_0x1902b4,_0x462a03);_0x744bea(null);};}for(var e in events){if(events[_0x7995('0x7')](e)){var event=events[e];VoiceQueue[_0x7995('0x8')](e,emitEvent(event));}}module[_0x7995('0x9')]=VoiceQueueEvents; \ No newline at end of file +var _0xe14b=['hasOwnProperty','hook','exports','events','../../mysqldb','save','update','emit'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xe14b,0x93));var _0xbe14=function(_0x211831,_0x5e6e93){_0x211831=_0x211831-0x0;var _0x7b06b5=_0xe14b[_0x211831];return _0x7b06b5;};'use strict';var EventEmitter=require(_0xbe14('0x0'));var VoiceQueue=require(_0xbe14('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbe14('0x2'),'afterUpdate':_0xbe14('0x3'),'afterDestroy':'remove'};function emitEvent(_0x7d3665){return function(_0x5ce8fb,_0x496c04,_0x1833e3){VoiceQueueEvents[_0xbe14('0x4')](_0x7d3665+':'+_0x5ce8fb['id'],_0x5ce8fb);VoiceQueueEvents[_0xbe14('0x4')](_0x7d3665,_0x5ce8fb);_0x1833e3(null);};}for(var e in events){if(events[_0xbe14('0x5')](e)){var event=events[e];VoiceQueue[_0xbe14('0x6')](e,emitEvent(event));}}module[_0xbe14('0x7')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index e45d3e8..7ac4315 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 _0xcdc9=['api','moment','bluebird','request-promise','path','../../config/environment','./voiceQueue.attributes','exports','VoiceQueue','../../config/logger'];(function(_0x58dd4a,_0x263e8a){var _0x5bbbcd=function(_0xf068fd){while(--_0xf068fd){_0x58dd4a['push'](_0x58dd4a['shift']());}};_0x5bbbcd(++_0x263e8a);}(_0xcdc9,0xdb));var _0x9cdc=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xcdc9[_0x3ab51d];return _0x29a04e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9cdc('0x0'))(_0x9cdc('0x1'));var moment=require(_0x9cdc('0x2'));var BPromise=require(_0x9cdc('0x3'));var rp=require(_0x9cdc('0x4'));var fs=require('fs');var path=require(_0x9cdc('0x5'));var rimraf=require('rimraf');var config=require(_0x9cdc('0x6'));var attributes=require(_0x9cdc('0x7'));module[_0x9cdc('0x8')]=function(_0x4e3aa5,_0x3e5076){return _0x4e3aa5['define'](_0x9cdc('0x9'),attributes,{'tableName':'voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfc3b=['../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','define','VoiceQueue','voice_queues','lodash','util'];(function(_0x2771d2,_0x4ab39d){var _0x12f732=function(_0x239c14){while(--_0x239c14){_0x2771d2['push'](_0x2771d2['shift']());}};_0x12f732(++_0x4ab39d);}(_0xfc3b,0xae));var _0xbfc3=function(_0x401ed4,_0x77cf76){_0x401ed4=_0x401ed4-0x0;var _0x302d70=_0xfc3b[_0x401ed4];return _0x302d70;};'use strict';var _=require(_0xbfc3('0x0'));var util=require(_0xbfc3('0x1'));var logger=require(_0xbfc3('0x2'))('api');var moment=require(_0xbfc3('0x3'));var BPromise=require(_0xbfc3('0x4'));var rp=require(_0xbfc3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbfc3('0x6'));var config=require(_0xbfc3('0x7'));var attributes=require('./voiceQueue.attributes');module['exports']=function(_0x2f131b,_0x2dc2ed){return _0x2f131b[_0xbfc3('0x8')](_0xbfc3('0x9'),attributes,{'tableName':_0xbfc3('0xa'),'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 85c77eb..59e0dd1 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 _0x3eea=['debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetVoiceQueue','VoiceQueue','findAll','raw','options','limit','include','map','model','attributes','catch','ShowVoiceQueue','find','where','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','./voiceQueue.socket','register','info','VoiceQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x3eea,0x17e));var _0xa3ee=function(_0x6c4429,_0x9ec17c){_0x6c4429=_0x6c4429-0x0;var _0x49393f=_0x3eea[_0x6c4429];return _0x49393f;};'use strict';var _=require(_0xa3ee('0x0'));var util=require(_0xa3ee('0x1'));var moment=require(_0xa3ee('0x2'));var BPromise=require(_0xa3ee('0x3'));var rs=require(_0xa3ee('0x4'));var fs=require('fs');var Redis=require(_0xa3ee('0x5'));var db=require(_0xa3ee('0x6'))['db'];var utils=require(_0xa3ee('0x7'));var logger=require(_0xa3ee('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa3ee('0x9'));var client=jayson[_0xa3ee('0xa')][_0xa3ee('0xb')]({'port':0x232a});config[_0xa3ee('0xc')]=_['defaults'](config[_0xa3ee('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa3ee('0xc')]));require(_0xa3ee('0xd'))[_0xa3ee('0xe')](socket);function respondWithRpcPromise(_0x3f2bd9,_0x493baa,_0x2ab212){return new BPromise(function(_0x129a6e,_0x4c44bc){return client['request'](_0x3f2bd9,_0x2ab212)['then'](function(_0x24e33f){logger[_0xa3ee('0xf')](_0xa3ee('0x10'),_0x493baa,_0xa3ee('0x11'));logger[_0xa3ee('0x12')](_0xa3ee('0x13'),_0x493baa,'request\x20sent',JSON[_0xa3ee('0x14')](_0x24e33f));if(_0x24e33f[_0xa3ee('0x15')]){if(_0x24e33f[_0xa3ee('0x15')][_0xa3ee('0x16')]===0x1f4){logger[_0xa3ee('0x15')](_0xa3ee('0x10'),_0x493baa,_0x24e33f[_0xa3ee('0x15')]['message']);return _0x4c44bc(_0x24e33f[_0xa3ee('0x15')][_0xa3ee('0x17')]);}logger['error'](_0xa3ee('0x10'),_0x493baa,_0x24e33f[_0xa3ee('0x15')][_0xa3ee('0x17')]);return _0x129a6e(_0x24e33f[_0xa3ee('0x15')][_0xa3ee('0x17')]);}else{logger['info'](_0xa3ee('0x10'),_0x493baa,'request\x20sent');_0x129a6e(_0x24e33f[_0xa3ee('0x18')]['message']);}})['catch'](function(_0x195e59){logger['error'](_0xa3ee('0x10'),_0x493baa,_0x195e59);_0x4c44bc(_0x195e59);});});}exports[_0xa3ee('0x19')]=function(_0x4e0ea6){var _0x5d4b31=this;return new Promise(function(_0x14b456,_0x3f0efe){return db[_0xa3ee('0x1a')][_0xa3ee('0x1b')]({'raw':_0x4e0ea6['options']?_0x4e0ea6['options'][_0xa3ee('0x1c')]===undefined?!![]:![]:!![],'where':_0x4e0ea6[_0xa3ee('0x1d')]?_0x4e0ea6[_0xa3ee('0x1d')]['where']||null:null,'attributes':_0x4e0ea6[_0xa3ee('0x1d')]?_0x4e0ea6['options']['attributes']||null:null,'limit':_0x4e0ea6[_0xa3ee('0x1d')]?_0x4e0ea6['options'][_0xa3ee('0x1e')]||null:null,'include':_0x4e0ea6[_0xa3ee('0x1d')]?_0x4e0ea6[_0xa3ee('0x1d')][_0xa3ee('0x1f')]?_[_0xa3ee('0x20')](_0x4e0ea6[_0xa3ee('0x1d')][_0xa3ee('0x1f')],function(_0x4815b9){return{'model':db[_0x4815b9[_0xa3ee('0x21')]],'as':_0x4815b9['as'],'attributes':_0x4815b9[_0xa3ee('0x22')],'include':_0x4815b9['include']?_[_0xa3ee('0x20')](_0x4815b9[_0xa3ee('0x1f')],function(_0x5486ce){return{'model':db[_0x5486ce[_0xa3ee('0x21')]],'as':_0x5486ce['as'],'attributes':_0x5486ce[_0xa3ee('0x22')],'include':_0x5486ce['include']?_[_0xa3ee('0x20')](_0x5486ce['include'],function(_0x2c0ad5){return{'model':db[_0x2c0ad5[_0xa3ee('0x21')]],'as':_0x2c0ad5['as'],'attributes':_0x2c0ad5['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x56cae0){logger[_0xa3ee('0xf')]('GetVoiceQueue',_0x4e0ea6);logger[_0xa3ee('0x12')]('GetVoiceQueue',_0x4e0ea6,JSON[_0xa3ee('0x14')](_0x56cae0));_0x14b456(_0x56cae0);})[_0xa3ee('0x23')](function(_0x5887ee){logger[_0xa3ee('0x15')](_0xa3ee('0x19'),_0x5887ee['message'],_0x4e0ea6);_0x3f0efe(_0x5d4b31[_0xa3ee('0x15')](0x1f4,_0x5887ee[_0xa3ee('0x17')]));});});};exports[_0xa3ee('0x24')]=function(_0x25ff31){var _0x3f3e35=this;return new Promise(function(_0x3b4797,_0x232758){return db[_0xa3ee('0x1a')][_0xa3ee('0x25')]({'raw':_0x25ff31['options']?_0x25ff31[_0xa3ee('0x1d')][_0xa3ee('0x1c')]===undefined?!![]:![]:!![],'where':_0x25ff31[_0xa3ee('0x1d')]?_0x25ff31[_0xa3ee('0x1d')][_0xa3ee('0x26')]||null:null,'attributes':_0x25ff31[_0xa3ee('0x1d')]?_0x25ff31['options']['attributes']||null:null,'include':_0x25ff31[_0xa3ee('0x1d')]?_0x25ff31[_0xa3ee('0x1d')][_0xa3ee('0x1f')]?_['map'](_0x25ff31['options']['include'],function(_0xfd250e){return{'model':db[_0xfd250e[_0xa3ee('0x21')]],'as':_0xfd250e['as'],'attributes':_0xfd250e[_0xa3ee('0x22')],'include':_0xfd250e['include']?_[_0xa3ee('0x20')](_0xfd250e[_0xa3ee('0x1f')],function(_0x18988b){return{'model':db[_0x18988b[_0xa3ee('0x21')]],'as':_0x18988b['as'],'attributes':_0x18988b[_0xa3ee('0x22')],'include':_0x18988b['include']?_[_0xa3ee('0x20')](_0x18988b[_0xa3ee('0x1f')],function(_0x7a6201){return{'model':db[_0x7a6201[_0xa3ee('0x21')]],'as':_0x7a6201['as'],'attributes':_0x7a6201[_0xa3ee('0x22')]};}):[]};}):[]};}):[]:[]})[_0xa3ee('0x27')](function(_0x4d3318){logger[_0xa3ee('0xf')](_0xa3ee('0x24'),_0x25ff31);logger['debug'](_0xa3ee('0x24'),_0x25ff31,JSON['stringify'](_0x4d3318));_0x3b4797(_0x4d3318);})[_0xa3ee('0x23')](function(_0x35e30d){logger['error'](_0xa3ee('0x24'),_0x35e30d[_0xa3ee('0x17')],_0x25ff31);_0x232758(_0x3f3e35[_0xa3ee('0x15')](0x1f4,_0x35e30d['message']));});});}; \ No newline at end of file +var _0x2586=['error','code','message','catch','findAll','options','raw','where','attributes','limit','include','map','model','GetVoiceQueue','ShowVoiceQueue','find','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x54e217,_0x243297){var _0x590ead=function(_0x2f1d78){while(--_0x2f1d78){_0x54e217['push'](_0x54e217['shift']());}};_0x590ead(++_0x243297);}(_0x2586,0x128));var _0x6258=function(_0x3a05a9,_0x485359){_0x3a05a9=_0x3a05a9-0x0;var _0x58ff6f=_0x2586[_0x3a05a9];return _0x58ff6f;};'use strict';var _=require('lodash');var util=require(_0x6258('0x0'));var moment=require(_0x6258('0x1'));var BPromise=require(_0x6258('0x2'));var rs=require(_0x6258('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6258('0x4'))['db'];var utils=require(_0x6258('0x5'));var logger=require(_0x6258('0x6'))(_0x6258('0x7'));var config=require(_0x6258('0x8'));var jayson=require(_0x6258('0x9'));var client=jayson[_0x6258('0xa')][_0x6258('0xb')]({'port':0x232a});config['redis']=_[_0x6258('0xc')](config[_0x6258('0xd')],{'host':_0x6258('0xe'),'port':0x18eb});var socket=require(_0x6258('0xf'))(new Redis(config['redis']));require('./voiceQueue.socket')['register'](socket);function respondWithRpcPromise(_0x78ca89,_0x4cadd6,_0x182edd){return new BPromise(function(_0x3396b0,_0x57d599){return client[_0x6258('0x10')](_0x78ca89,_0x182edd)[_0x6258('0x11')](function(_0x162eee){logger[_0x6258('0x12')](_0x6258('0x13'),_0x4cadd6,_0x6258('0x14'));logger[_0x6258('0x15')](_0x6258('0x16'),_0x4cadd6,_0x6258('0x14'),JSON[_0x6258('0x17')](_0x162eee));if(_0x162eee[_0x6258('0x18')]){if(_0x162eee[_0x6258('0x18')][_0x6258('0x19')]===0x1f4){logger[_0x6258('0x18')](_0x6258('0x13'),_0x4cadd6,_0x162eee['error'][_0x6258('0x1a')]);return _0x57d599(_0x162eee['error'][_0x6258('0x1a')]);}logger[_0x6258('0x18')](_0x6258('0x13'),_0x4cadd6,_0x162eee[_0x6258('0x18')][_0x6258('0x1a')]);return _0x3396b0(_0x162eee[_0x6258('0x18')][_0x6258('0x1a')]);}else{logger[_0x6258('0x12')](_0x6258('0x13'),_0x4cadd6,'request\x20sent');_0x3396b0(_0x162eee['result'][_0x6258('0x1a')]);}})[_0x6258('0x1b')](function(_0x46845d){logger[_0x6258('0x18')](_0x6258('0x13'),_0x4cadd6,_0x46845d);_0x57d599(_0x46845d);});});}exports['GetVoiceQueue']=function(_0x633c8f){var _0x351c9f=this;return new Promise(function(_0x12a57e,_0x16e36a){return db['VoiceQueue'][_0x6258('0x1c')]({'raw':_0x633c8f[_0x6258('0x1d')]?_0x633c8f[_0x6258('0x1d')][_0x6258('0x1e')]===undefined?!![]:![]:!![],'where':_0x633c8f[_0x6258('0x1d')]?_0x633c8f[_0x6258('0x1d')][_0x6258('0x1f')]||null:null,'attributes':_0x633c8f[_0x6258('0x1d')]?_0x633c8f['options'][_0x6258('0x20')]||null:null,'limit':_0x633c8f['options']?_0x633c8f[_0x6258('0x1d')][_0x6258('0x21')]||null:null,'include':_0x633c8f[_0x6258('0x1d')]?_0x633c8f['options'][_0x6258('0x22')]?_[_0x6258('0x23')](_0x633c8f['options'][_0x6258('0x22')],function(_0x358ba){return{'model':db[_0x358ba[_0x6258('0x24')]],'as':_0x358ba['as'],'attributes':_0x358ba[_0x6258('0x20')],'include':_0x358ba[_0x6258('0x22')]?_[_0x6258('0x23')](_0x358ba[_0x6258('0x22')],function(_0x5c3219){return{'model':db[_0x5c3219[_0x6258('0x24')]],'as':_0x5c3219['as'],'attributes':_0x5c3219['attributes'],'include':_0x5c3219[_0x6258('0x22')]?_[_0x6258('0x23')](_0x5c3219[_0x6258('0x22')],function(_0x3cb247){return{'model':db[_0x3cb247[_0x6258('0x24')]],'as':_0x3cb247['as'],'attributes':_0x3cb247[_0x6258('0x20')]};}):[]};}):[]};}):[]:[]})[_0x6258('0x11')](function(_0x119498){logger[_0x6258('0x12')]('GetVoiceQueue',_0x633c8f);logger[_0x6258('0x15')](_0x6258('0x25'),_0x633c8f,JSON['stringify'](_0x119498));_0x12a57e(_0x119498);})[_0x6258('0x1b')](function(_0x545c66){logger[_0x6258('0x18')](_0x6258('0x25'),_0x545c66[_0x6258('0x1a')],_0x633c8f);_0x16e36a(_0x351c9f[_0x6258('0x18')](0x1f4,_0x545c66[_0x6258('0x1a')]));});});};exports[_0x6258('0x26')]=function(_0x3e4a68){var _0x277c54=this;return new Promise(function(_0x343bdc,_0x32e0be){return db['VoiceQueue'][_0x6258('0x27')]({'raw':_0x3e4a68[_0x6258('0x1d')]?_0x3e4a68[_0x6258('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x3e4a68[_0x6258('0x1d')]?_0x3e4a68[_0x6258('0x1d')][_0x6258('0x1f')]||null:null,'attributes':_0x3e4a68['options']?_0x3e4a68['options'][_0x6258('0x20')]||null:null,'include':_0x3e4a68[_0x6258('0x1d')]?_0x3e4a68[_0x6258('0x1d')][_0x6258('0x22')]?_['map'](_0x3e4a68[_0x6258('0x1d')]['include'],function(_0x49cb54){return{'model':db[_0x49cb54[_0x6258('0x24')]],'as':_0x49cb54['as'],'attributes':_0x49cb54['attributes'],'include':_0x49cb54[_0x6258('0x22')]?_[_0x6258('0x23')](_0x49cb54[_0x6258('0x22')],function(_0x53c185){return{'model':db[_0x53c185[_0x6258('0x24')]],'as':_0x53c185['as'],'attributes':_0x53c185[_0x6258('0x20')],'include':_0x53c185['include']?_[_0x6258('0x23')](_0x53c185[_0x6258('0x22')],function(_0x2fabae){return{'model':db[_0x2fabae['model']],'as':_0x2fabae['as'],'attributes':_0x2fabae[_0x6258('0x20')]};}):[]};}):[]};}):[]:[]})[_0x6258('0x11')](function(_0xbee6d3){logger[_0x6258('0x12')]('ShowVoiceQueue',_0x3e4a68);logger[_0x6258('0x15')](_0x6258('0x26'),_0x3e4a68,JSON[_0x6258('0x17')](_0xbee6d3));_0x343bdc(_0xbee6d3);})[_0x6258('0x1b')](function(_0x3f373c){logger['error'](_0x6258('0x26'),_0x3f373c[_0x6258('0x1a')],_0x3e4a68);_0x32e0be(_0x277c54[_0x6258('0x18')](0x1f4,_0x3f373c[_0x6258('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 3bebab2..d564286 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 _0xea4c=['register','length','voiceQueue:','./voiceQueue.events','remove','update','emit','removeListener'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0xea4c,0x13b));var _0xcea4=function(_0x47719f,_0x47620b){_0x47719f=_0x47719f-0x0;var _0x146e7a=_0xea4c[_0x47719f];return _0x146e7a;};'use strict';var VoiceQueueEvents=require(_0xcea4('0x0'));var events=['save',_0xcea4('0x1'),_0xcea4('0x2')];function createListener(_0x7362de,_0x53d64c){return function(_0x459255){_0x53d64c[_0xcea4('0x3')](_0x7362de,_0x459255);};}function removeListener(_0x4307fb,_0x213929){return function(){VoiceQueueEvents[_0xcea4('0x4')](_0x4307fb,_0x213929);};}exports[_0xcea4('0x5')]=function(_0x3bc571){for(var _0x2b9ed1=0x0,_0x2abaff=events[_0xcea4('0x6')];_0x2b9ed1<_0x2abaff;_0x2b9ed1++){var _0x4f91e2=events[_0x2b9ed1];var _0x227670=createListener(_0xcea4('0x7')+_0x4f91e2,_0x3bc571);VoiceQueueEvents['on'](_0x4f91e2,_0x227670);}}; \ No newline at end of file +var _0xf996=['removeListener','register','length','voiceQueue:','./voiceQueue.events','save','remove','emit'];(function(_0x2935b2,_0x23ac93){var _0x3cc82c=function(_0x24423c){while(--_0x24423c){_0x2935b2['push'](_0x2935b2['shift']());}};_0x3cc82c(++_0x23ac93);}(_0xf996,0x74));var _0x6f99=function(_0x3aa057,_0x54a003){_0x3aa057=_0x3aa057-0x0;var _0x8cd486=_0xf996[_0x3aa057];return _0x8cd486;};'use strict';var VoiceQueueEvents=require(_0x6f99('0x0'));var events=[_0x6f99('0x1'),_0x6f99('0x2'),'update'];function createListener(_0x12ac12,_0x56fd3f){return function(_0x5ceb57){_0x56fd3f[_0x6f99('0x3')](_0x12ac12,_0x5ceb57);};}function removeListener(_0xa0b3d7,_0x274f12){return function(){VoiceQueueEvents[_0x6f99('0x4')](_0xa0b3d7,_0x274f12);};}exports[_0x6f99('0x5')]=function(_0xf2b5ee){for(var _0xa07ac1=0x0,_0x2883cb=events[_0x6f99('0x6')];_0xa07ac1<_0x2883cb;_0xa07ac1++){var _0x1e4805=events[_0xa07ac1];var _0x5d8b7f=createListener(_0x6f99('0x7')+_0x1e4805,_0xf2b5ee);VoiceQueueEvents['on'](_0x1e4805,_0x5d8b7f);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index d5c2270..31ed6e4 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 _0xc9c3=['getVoiceQueuesReport','/:id','post','put','update','delete','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','/describe','isAuthenticated','describe','/index'];(function(_0x494d1f,_0x3f72ff){var _0x457b6e=function(_0x38cb16){while(--_0x38cb16){_0x494d1f['push'](_0x494d1f['shift']());}};_0x457b6e(++_0x3f72ff);}(_0xc9c3,0x96));var _0x3c9c=function(_0x24304e,_0x232125){_0x24304e=_0x24304e-0x0;var _0x599155=_0xc9c3[_0x24304e];return _0x599155;};'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'));var controller=require(_0x3c9c('0x6'));router[_0x3c9c('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x3c9c('0x8'),auth[_0x3c9c('0x9')](),controller[_0x3c9c('0xa')]);router[_0x3c9c('0x7')](_0x3c9c('0xb'),auth[_0x3c9c('0x9')](),controller[_0x3c9c('0xc')]);router[_0x3c9c('0x7')](_0x3c9c('0xd'),auth[_0x3c9c('0x9')](),controller['show']);router[_0x3c9c('0xe')]('/',auth[_0x3c9c('0x9')](),controller['create']);router[_0x3c9c('0xf')]('/:id',auth[_0x3c9c('0x9')](),controller[_0x3c9c('0x10')]);router[_0x3c9c('0x11')](_0x3c9c('0xd'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x11e5=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./voiceQueueReport.controller','index','get','/describe','/index','isAuthenticated','getVoiceQueuesReport','/:id','show','post','create','delete','destroy','exports','multer'];(function(_0x2317e7,_0x41fd89){var _0x542abc=function(_0x2e2992){while(--_0x2e2992){_0x2317e7['push'](_0x2317e7['shift']());}};_0x542abc(++_0x41fd89);}(_0x11e5,0x8b));var _0x511e=function(_0x58de54,_0x3fd41e){_0x58de54=_0x58de54-0x0;var _0x18d2e5=_0x11e5[_0x58de54];return _0x18d2e5;};'use strict';var multer=require(_0x511e('0x0'));var util=require('util');var path=require(_0x511e('0x1'));var timeout=require(_0x511e('0x2'));var express=require('express');var router=express[_0x511e('0x3')]();var auth=require(_0x511e('0x4'));var interaction=require(_0x511e('0x5'));var config=require('../../config/environment');var controller=require(_0x511e('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x511e('0x7')]);router[_0x511e('0x8')](_0x511e('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x511e('0x8')](_0x511e('0xa'),auth[_0x511e('0xb')](),controller[_0x511e('0xc')]);router[_0x511e('0x8')](_0x511e('0xd'),auth[_0x511e('0xb')](),controller[_0x511e('0xe')]);router[_0x511e('0xf')]('/',auth[_0x511e('0xb')](),controller[_0x511e('0x10')]);router['put'](_0x511e('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x511e('0x11')](_0x511e('0xd'),auth[_0x511e('0xb')](),controller[_0x511e('0x12')]);module[_0x511e('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 838a4ca..75db76d 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 _0xd946=['STRING','DATE','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','queuecallerleaveAt','setDataValue','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd946,0x98));var _0x6d94=function(_0x15a971,_0x3386c6){_0x15a971=_0x15a971-0x0;var _0x562ed9=_0xd946[_0x15a971];return _0x562ed9;};'use strict';var Sequelize=require(_0x6d94('0x0'));var moment=require('moment');module[_0x6d94('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x6d94('0x2')]},'calleridname':{'type':Sequelize[_0x6d94('0x2')]},'queue':{'type':Sequelize[_0x6d94('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0x6d94('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0x6d94('0x3')],'set':function(_0x5b98bd){var _0xa92995=moment(_0x5b98bd);var _0x16ee89=moment(this['getDataValue']('queuecallerjoinAt'))['format'](_0x6d94('0x4'));var _0xaa68d=_0xa92995[_0x6d94('0x5')](_0x16ee89,_0x6d94('0x6'));this['setDataValue'](_0x6d94('0x7'),_0x5b98bd);this[_0x6d94('0x8')](_0x6d94('0x9'),_0xaa68d||null);}},'position':{'type':Sequelize[_0x6d94('0xa')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0x6d94('0xb')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x6d94('0x3')]},'queuecallercomplete':{'type':Sequelize[_0x6d94('0xb')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x6d94('0x3')]},'queuecallerexit':{'type':Sequelize[_0x6d94('0xb')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x6d94('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0x6d94('0x2')],'comment':_0x6d94('0xc')},'originalposition':{'type':Sequelize[_0x6d94('0xa')]},'channel':{'type':Sequelize[_0x6d94('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x6d94('0x2')]},'accountcode':{'type':Sequelize[_0x6d94('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x6d94('0x2')]},'priority':{'type':Sequelize[_0x6d94('0x2')]},'holdtime':{'type':Sequelize[_0x6d94('0xa')]},'mohtime':{'type':Sequelize[_0x6d94('0xa')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x6d94('0xb')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x6d94('0x2')]},'transfer':{'type':Sequelize[_0x6d94('0xb')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x6d94('0x2')],'comment':_0x6d94('0xd')},'transferexten':{'type':Sequelize[_0x6d94('0x2')]},'transferuniqueid':{'type':Sequelize[_0x6d94('0x2')]},'disposition':{'type':Sequelize[_0x6d94('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0x6d94('0xa')],'defaultValue':0x0}}; \ No newline at end of file +var _0x8e49=['STRING','DATE','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt','holdtime','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','INTEGER','exports'];(function(_0x6ead29,_0x1f09e4){var _0x9c28db=function(_0x545af5){while(--_0x545af5){_0x6ead29['push'](_0x6ead29['shift']());}};_0x9c28db(++_0x1f09e4);}(_0x8e49,0x7d));var _0x98e4=function(_0x469393,_0x247969){_0x469393=_0x469393-0x0;var _0x5f720d=_0x8e49[_0x469393];return _0x5f720d;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x98e4('0x0')]={'type':{'type':Sequelize[_0x98e4('0x1')]},'uniqueid':{'type':Sequelize[_0x98e4('0x1')]},'calleridnum':{'type':Sequelize[_0x98e4('0x1')]},'calleridname':{'type':Sequelize[_0x98e4('0x1')]},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0x98e4('0x2')],'set':function(_0x5cd950){var _0x592863=moment(_0x5cd950);var _0xcd04f2=moment(this['getDataValue'](_0x98e4('0x3')))[_0x98e4('0x4')](_0x98e4('0x5'));var _0x2b6915=_0x592863[_0x98e4('0x6')](_0xcd04f2,_0x98e4('0x7'));this[_0x98e4('0x8')](_0x98e4('0x9'),_0x5cd950);this[_0x98e4('0x8')](_0x98e4('0xa'),_0x2b6915||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0x98e4('0xb')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x98e4('0x2')]},'queuecallercomplete':{'type':Sequelize[_0x98e4('0xb')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x98e4('0x2')]},'queuecallerexit':{'type':Sequelize[_0x98e4('0xb')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x98e4('0x2')]},'queuecallerexitreason':{'type':Sequelize[_0x98e4('0x1')],'comment':_0x98e4('0xc')},'originalposition':{'type':Sequelize[_0x98e4('0xd')]},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x98e4('0x1')]},'connectedlinename':{'type':Sequelize[_0x98e4('0x1')]},'accountcode':{'type':Sequelize[_0x98e4('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x98e4('0x1')]},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0x98e4('0xd')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x98e4('0xb')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x98e4('0x1')]},'transfer':{'type':Sequelize[_0x98e4('0xb')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x98e4('0x1')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x98e4('0x1')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x98e4('0x1')]},'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 42316e3..c2fb823 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 _0xece4=['describe','getVoiceQueuesReport','hasOwnProperty','order','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','ejs','lodash','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','offset','reject','save','destroy','error','stack','send','index','map','VoiceQueueReport','rawAttributes','fieldName','type','model','name','query','keys','intersection','fields','attributes','length','nolimit','limit','sort','where','pick','filters','filter','merge','key','VIRTUAL','field','count','then','includeAll','include','findAll','rows','catch','show','params','options','create','body','find'];(function(_0x5774af,_0x411c94){var _0x480589=function(_0x414114){while(--_0x414114){_0x5774af['push'](_0x5774af['shift']());}};_0x480589(++_0x411c94);}(_0xece4,0x1e4));var _0x4ece=function(_0xdb58bb,_0x557942){_0xdb58bb=_0xdb58bb-0x0;var _0x466aab=_0xece4[_0xdb58bb];return _0x466aab;};'use strict';var pdf=require(_0x4ece('0x0'));var emlformat=require(_0x4ece('0x1'));var rimraf=require(_0x4ece('0x2'));var zipdir=require(_0x4ece('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4ece('0x4'));var moment=require(_0x4ece('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4ece('0x6'));var util=require(_0x4ece('0x7'));var path=require(_0x4ece('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4ece('0x9'));var fs=require('fs');var _=require(_0x4ece('0xa'));var squel=require('squel');var crypto=require(_0x4ece('0xb'));var jsforce=require(_0x4ece('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4ece('0xd'));var Redis=require('ioredis');var authService=require(_0x4ece('0xe'));var qs=require(_0x4ece('0xf'));var as=require(_0x4ece('0x10'));var hardwareService=require(_0x4ece('0x11'));var logger=require(_0x4ece('0x12'))(_0x4ece('0x13'));var utils=require(_0x4ece('0x14'));var config=require(_0x4ece('0x15'));var db=require(_0x4ece('0x16'))['db'];config[_0x4ece('0x17')]=_[_0x4ece('0x18')](config['redis'],{'host':_0x4ece('0x19'),'port':0x18eb});var socket=require(_0x4ece('0x1a'))(new Redis(config[_0x4ece('0x17')]));require(_0x4ece('0x1b'))[_0x4ece('0x1c')](socket);function respondWithStatusCode(_0x448c67,_0x2b4cc5){_0x2b4cc5=_0x2b4cc5||0xcc;return function(_0x507b9e){if(_0x507b9e){return _0x448c67[_0x4ece('0x1d')](_0x2b4cc5);}return _0x448c67[_0x4ece('0x1e')](_0x2b4cc5)['end']();};}function respondWithResult(_0x538357,_0xeeebc4){_0xeeebc4=_0xeeebc4||0xc8;return function(_0x1c36a2){if(_0x1c36a2){return _0x538357[_0x4ece('0x1e')](_0xeeebc4)['json'](_0x1c36a2);}};}function respondWithFilteredResult(_0x53d19c,_0x13122b){return function(_0xfb485c){if(_0xfb485c){var _0x1080cc=_0xfb485c['count'],_0x33c41a=_0x13122b[_0x4ece('0x1f')],_0x3082dc=_0x13122b[_0x4ece('0x1f')]+_0x13122b['limit'],_0x564346;if(_0x3082dc>=_0x1080cc){_0x3082dc=_0x1080cc;_0x564346=0xc8;}else{_0x564346=0xce;}_0x53d19c[_0x4ece('0x1e')](_0x564346);return _0x53d19c['set']('Content-Range',_0x33c41a+'-'+_0x3082dc+'/'+_0x1080cc)['json'](_0xfb485c);}return null;};}function patchUpdates(_0x2bb3fe){return function(_0x25daab){try{jsonpatch['apply'](_0x25daab,_0x2bb3fe,!![]);}catch(_0x415557){return BPromise[_0x4ece('0x20')](_0x415557);}return _0x25daab[_0x4ece('0x21')]();};}function saveUpdates(_0x233d87,_0x569b62){return function(_0x203402){if(_0x203402){return _0x203402['update'](_0x233d87)['then'](function(_0x393ff8){return _0x393ff8;});}return null;};}function removeEntity(_0x18bff7,_0x286cd3){return function(_0x49d04f){if(_0x49d04f){return _0x49d04f[_0x4ece('0x22')]()['then'](function(){_0x18bff7[_0x4ece('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5db9a1,_0xa548af){return function(_0x257cd5){if(!_0x257cd5){_0x5db9a1[_0x4ece('0x1d')](0x194);}return _0x257cd5;};}function handleError(_0x4269a8,_0x1c58ae){_0x1c58ae=_0x1c58ae||0x1f4;return function(_0x19eac0){logger[_0x4ece('0x23')](_0x19eac0[_0x4ece('0x24')]);if(_0x19eac0['name']){delete _0x19eac0['name'];}_0x4269a8['status'](_0x1c58ae)[_0x4ece('0x25')](_0x19eac0);};}exports[_0x4ece('0x26')]=function(_0x593ebd,_0x2dd4ba){var _0xcfc152={},_0x28714a={},_0x2cc2b0={'count':0x0,'rows':[]};var _0x199cb3=_[_0x4ece('0x27')](db[_0x4ece('0x28')][_0x4ece('0x29')],function(_0x4c1319){return{'name':_0x4c1319[_0x4ece('0x2a')],'type':_0x4c1319[_0x4ece('0x2b')]['key']};});_0x28714a[_0x4ece('0x2c')]=_['map'](_0x199cb3,_0x4ece('0x2d'));_0x28714a[_0x4ece('0x2e')]=_[_0x4ece('0x2f')](_0x593ebd[_0x4ece('0x2e')]);_0x28714a['filters']=_[_0x4ece('0x30')](_0x28714a[_0x4ece('0x2c')],_0x28714a[_0x4ece('0x2e')]);_0xcfc152['attributes']=_[_0x4ece('0x30')](_0x28714a['model'],qs['fields'](_0x593ebd[_0x4ece('0x2e')][_0x4ece('0x31')]));_0xcfc152[_0x4ece('0x32')]=_0xcfc152['attributes'][_0x4ece('0x33')]?_0xcfc152[_0x4ece('0x32')]:_0x28714a[_0x4ece('0x2c')];if(!_0x593ebd['query']['hasOwnProperty'](_0x4ece('0x34'))){_0xcfc152['limit']=qs[_0x4ece('0x35')](_0x593ebd[_0x4ece('0x2e')][_0x4ece('0x35')]);_0xcfc152[_0x4ece('0x1f')]=qs[_0x4ece('0x1f')](_0x593ebd[_0x4ece('0x2e')][_0x4ece('0x1f')]);}_0xcfc152['order']=qs[_0x4ece('0x36')](_0x593ebd[_0x4ece('0x2e')][_0x4ece('0x36')]);_0xcfc152[_0x4ece('0x37')]=qs['filters'](_[_0x4ece('0x38')](_0x593ebd[_0x4ece('0x2e')],_0x28714a[_0x4ece('0x39')]));if(_0x593ebd[_0x4ece('0x2e')][_0x4ece('0x3a')]){_0xcfc152['where']=_[_0x4ece('0x3b')](_0xcfc152[_0x4ece('0x37')],{'$or':_[_0x4ece('0x27')](_0x199cb3,function(_0x296097){if(_0x296097[_0x4ece('0x2b')][_0x4ece('0x3c')]!==_0x4ece('0x3d')){var _0x14a6c0={};_0x14a6c0[_0x296097[_0x4ece('0x3e')]]={'$like':'%'+_0x593ebd[_0x4ece('0x2e')][_0x4ece('0x3a')]+'%'};return _0x14a6c0;}})});}_0xcfc152=_[_0x4ece('0x3b')]({},_0xcfc152,_0x593ebd['options']);var _0x2bb878={'where':_0xcfc152['where']};return db[_0x4ece('0x28')][_0x4ece('0x3f')](_0x2bb878)[_0x4ece('0x40')](function(_0x3fec12){_0x2cc2b0[_0x4ece('0x3f')]=_0x3fec12;if(_0x593ebd['query'][_0x4ece('0x41')]){_0xcfc152[_0x4ece('0x42')]=[{'all':!![]}];}return db[_0x4ece('0x28')][_0x4ece('0x43')](_0xcfc152);})[_0x4ece('0x40')](function(_0x1270ee){_0x2cc2b0[_0x4ece('0x44')]=_0x1270ee;return _0x2cc2b0;})[_0x4ece('0x40')](respondWithFilteredResult(_0x2dd4ba,_0xcfc152))[_0x4ece('0x45')](handleError(_0x2dd4ba,null));};exports[_0x4ece('0x46')]=function(_0x3917ff,_0xd358e0){var _0x14823b={'raw':![],'where':{'id':_0x3917ff[_0x4ece('0x47')]['id']}},_0x208ec4={};_0x208ec4[_0x4ece('0x2c')]=_['keys'](db[_0x4ece('0x28')][_0x4ece('0x29')]);_0x208ec4[_0x4ece('0x2e')]=_[_0x4ece('0x2f')](_0x3917ff[_0x4ece('0x2e')]);_0x208ec4['filters']=_['intersection'](_0x208ec4[_0x4ece('0x2c')],_0x208ec4['query']);_0x14823b[_0x4ece('0x32')]=_['intersection'](_0x208ec4[_0x4ece('0x2c')],qs[_0x4ece('0x31')](_0x3917ff['query'][_0x4ece('0x31')]));_0x14823b[_0x4ece('0x32')]=_0x14823b['attributes'][_0x4ece('0x33')]?_0x14823b[_0x4ece('0x32')]:_0x208ec4[_0x4ece('0x2c')];if(_0x3917ff['query'][_0x4ece('0x41')]){_0x14823b[_0x4ece('0x42')]=[{'all':!![]}];}_0x14823b=_[_0x4ece('0x3b')]({},_0x14823b,_0x3917ff[_0x4ece('0x48')]);return db[_0x4ece('0x28')]['find'](_0x14823b)['then'](handleEntityNotFound(_0xd358e0,null))[_0x4ece('0x40')](respondWithResult(_0xd358e0,null))[_0x4ece('0x45')](handleError(_0xd358e0,null));};exports[_0x4ece('0x49')]=function(_0x3ee021,_0x3ea0a0){return db[_0x4ece('0x28')][_0x4ece('0x49')](_0x3ee021[_0x4ece('0x4a')],{})[_0x4ece('0x40')](respondWithResult(_0x3ea0a0,0xc9))[_0x4ece('0x45')](handleError(_0x3ea0a0,null));};exports['update']=function(_0xbe681f,_0x431792){if(_0xbe681f[_0x4ece('0x4a')]['id']){delete _0xbe681f[_0x4ece('0x4a')]['id'];}return db[_0x4ece('0x28')][_0x4ece('0x4b')]({'where':{'id':_0xbe681f[_0x4ece('0x47')]['id']}})[_0x4ece('0x40')](handleEntityNotFound(_0x431792,null))[_0x4ece('0x40')](saveUpdates(_0xbe681f[_0x4ece('0x4a')],null))[_0x4ece('0x40')](respondWithResult(_0x431792,null))[_0x4ece('0x45')](handleError(_0x431792,null));};exports[_0x4ece('0x22')]=function(_0x22d07a,_0x3166cf){return db[_0x4ece('0x28')][_0x4ece('0x4b')]({'where':{'id':_0x22d07a[_0x4ece('0x47')]['id']}})[_0x4ece('0x40')](handleEntityNotFound(_0x3166cf,null))[_0x4ece('0x40')](removeEntity(_0x3166cf,null))['catch'](handleError(_0x3166cf,null));};exports[_0x4ece('0x4c')]=function(_0x15852a,_0x4998cb){return db[_0x4ece('0x28')][_0x4ece('0x4c')]()[_0x4ece('0x40')](respondWithResult(_0x4998cb,null))['catch'](handleError(_0x4998cb,null));};exports[_0x4ece('0x4d')]=function(_0x3aa84b,_0x4543f9){var _0xd223bb={},_0x156b5e={},_0x27180a={'count':0x0,'rows':[]};_0x156b5e[_0x4ece('0x2c')]=_[_0x4ece('0x2f')](db[_0x4ece('0x28')][_0x4ece('0x29')]);_0x156b5e[_0x4ece('0x2e')]=_[_0x4ece('0x2f')](_0x3aa84b['query']);_0x156b5e[_0x4ece('0x39')]=_[_0x4ece('0x30')](_0x156b5e[_0x4ece('0x2c')],_0x156b5e[_0x4ece('0x2e')]);_0xd223bb[_0x4ece('0x32')]=_[_0x4ece('0x30')](_0x156b5e[_0x4ece('0x2c')],qs[_0x4ece('0x31')](_0x3aa84b[_0x4ece('0x2e')][_0x4ece('0x31')]));_0xd223bb[_0x4ece('0x32')]=_0xd223bb[_0x4ece('0x32')][_0x4ece('0x33')]?_0xd223bb[_0x4ece('0x32')]:_0x156b5e[_0x4ece('0x2c')];if(!_0x3aa84b['query'][_0x4ece('0x4e')](_0x4ece('0x34'))){_0xd223bb[_0x4ece('0x35')]=qs[_0x4ece('0x35')](_0x3aa84b['query'][_0x4ece('0x35')]);_0xd223bb[_0x4ece('0x1f')]=qs[_0x4ece('0x1f')](_0x3aa84b[_0x4ece('0x2e')][_0x4ece('0x1f')]);}_0xd223bb[_0x4ece('0x4f')]=qs[_0x4ece('0x36')](_0x3aa84b[_0x4ece('0x2e')][_0x4ece('0x36')]);_0xd223bb[_0x4ece('0x37')]=qs[_0x4ece('0x39')](_[_0x4ece('0x38')](_0x3aa84b[_0x4ece('0x2e')],_0x156b5e[_0x4ece('0x39')]));if(_0x3aa84b[_0x4ece('0x2e')][_0x4ece('0x3a')]){_0xd223bb['where']=_[_0x4ece('0x3b')](_0xd223bb[_0x4ece('0x37')],{'$or':_[_0x4ece('0x27')](_0xd223bb[_0x4ece('0x32')],function(_0x1e2de7){var _0x3f213b={};_0x3f213b[_0x1e2de7]={'$like':'%'+_0x3aa84b[_0x4ece('0x2e')][_0x4ece('0x3a')]+'%'};return _0x3f213b;})});}_0xd223bb=_[_0x4ece('0x3b')]({},_0xd223bb,_0x3aa84b['options']);var _0x4eaa6e={'where':_0xd223bb[_0x4ece('0x37')]};return db[_0x4ece('0x28')][_0x4ece('0x3f')](_0x4eaa6e)[_0x4ece('0x40')](function(_0xcf4e8d){_0x27180a['count']=_0xcf4e8d;if(_0x3aa84b[_0x4ece('0x2e')][_0x4ece('0x41')]){_0xd223bb['include']=[{'all':!![]}];}return db[_0x4ece('0x28')][_0x4ece('0x43')](_0xd223bb);})[_0x4ece('0x40')](function(_0x49f12b){_0x27180a[_0x4ece('0x44')]=_0x49f12b;return _0x27180a;})[_0x4ece('0x40')](respondWithFilteredResult(_0x4543f9,_0xd223bb,_0x4ece('0x4d')))['catch'](handleError(_0x4543f9,null,_0x4ece('0x4d')));}; \ No newline at end of file +var _0xa67e=['hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','field','options','includeAll','findAll','show','params','rawAttributes','include','find','create','body','catch','destroy','describe','getVoiceQueuesReport','eml-format','zip-dir','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','end','count','offset','set','Content-Range','json','save','update','then','stack','name','send','index','VoiceQueueReport','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length'];(function(_0x2453f2,_0x186484){var _0x3a7348=function(_0x382ffd){while(--_0x382ffd){_0x2453f2['push'](_0x2453f2['shift']());}};_0x3a7348(++_0x186484);}(_0xa67e,0x6c));var _0xea67=function(_0x35b690,_0x18dd33){_0x35b690=_0x35b690-0x0;var _0x12dab4=_0xa67e[_0x35b690];return _0x12dab4;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xea67('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xea67('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xea67('0x2'));var BPromise=require(_0xea67('0x3'));var Mustache=require(_0xea67('0x4'));var util=require(_0xea67('0x5'));var path=require(_0xea67('0x6'));var sox=require(_0xea67('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xea67('0x8'));var squel=require(_0xea67('0x9'));var crypto=require(_0xea67('0xa'));var jsforce=require(_0xea67('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xea67('0xc'));var querystring=require(_0xea67('0xd'));var Papa=require(_0xea67('0xe'));var Redis=require(_0xea67('0xf'));var authService=require(_0xea67('0x10'));var qs=require(_0xea67('0x11'));var as=require(_0xea67('0x12'));var hardwareService=require(_0xea67('0x13'));var logger=require('../../config/logger')(_0xea67('0x14'));var utils=require(_0xea67('0x15'));var config=require('../../config/environment');var db=require(_0xea67('0x16'))['db'];config[_0xea67('0x17')]=_[_0xea67('0x18')](config[_0xea67('0x17')],{'host':_0xea67('0x19'),'port':0x18eb});var socket=require(_0xea67('0x1a'))(new Redis(config[_0xea67('0x17')]));require(_0xea67('0x1b'))[_0xea67('0x1c')](socket);function respondWithStatusCode(_0x58ab48,_0x302d37){_0x302d37=_0x302d37||0xcc;return function(_0x1a1833){if(_0x1a1833){return _0x58ab48[_0xea67('0x1d')](_0x302d37);}return _0x58ab48[_0xea67('0x1e')](_0x302d37)[_0xea67('0x1f')]();};}function respondWithResult(_0x1f97ad,_0x5cb852){_0x5cb852=_0x5cb852||0xc8;return function(_0x419ed0){if(_0x419ed0){return _0x1f97ad[_0xea67('0x1e')](_0x5cb852)['json'](_0x419ed0);}};}function respondWithFilteredResult(_0x45dcea,_0x226cf8){return function(_0x47729f){if(_0x47729f){var _0xc013c4=_0x47729f[_0xea67('0x20')],_0x4f7a97=_0x226cf8['offset'],_0x47e8bb=_0x226cf8[_0xea67('0x21')]+_0x226cf8['limit'],_0x1efd36;if(_0x47e8bb>=_0xc013c4){_0x47e8bb=_0xc013c4;_0x1efd36=0xc8;}else{_0x1efd36=0xce;}_0x45dcea[_0xea67('0x1e')](_0x1efd36);return _0x45dcea[_0xea67('0x22')](_0xea67('0x23'),_0x4f7a97+'-'+_0x47e8bb+'/'+_0xc013c4)[_0xea67('0x24')](_0x47729f);}return null;};}function patchUpdates(_0x4348d1){return function(_0x5c1c86){try{jsonpatch['apply'](_0x5c1c86,_0x4348d1,!![]);}catch(_0x2a74e5){return BPromise['reject'](_0x2a74e5);}return _0x5c1c86[_0xea67('0x25')]();};}function saveUpdates(_0x4061cf,_0x228c7d){return function(_0xde3a28){if(_0xde3a28){return _0xde3a28[_0xea67('0x26')](_0x4061cf)[_0xea67('0x27')](function(_0x40f562){return _0x40f562;});}return null;};}function removeEntity(_0x191c40,_0x51675f){return function(_0xca6e21){if(_0xca6e21){return _0xca6e21['destroy']()[_0xea67('0x27')](function(){_0x191c40[_0xea67('0x1e')](0xcc)[_0xea67('0x1f')]();});}};}function handleEntityNotFound(_0x1f4989,_0x50baed){return function(_0x5e6318){if(!_0x5e6318){_0x1f4989['sendStatus'](0x194);}return _0x5e6318;};}function handleError(_0x533773,_0x55c94c){_0x55c94c=_0x55c94c||0x1f4;return function(_0x27321d){logger['error'](_0x27321d[_0xea67('0x28')]);if(_0x27321d[_0xea67('0x29')]){delete _0x27321d[_0xea67('0x29')];}_0x533773[_0xea67('0x1e')](_0x55c94c)[_0xea67('0x2a')](_0x27321d);};}exports[_0xea67('0x2b')]=function(_0x4b4fe9,_0xc46bc6){var _0xa70cb3={},_0x448c44={},_0x469a21={'count':0x0,'rows':[]};var _0x957335=_['map'](db[_0xea67('0x2c')]['rawAttributes'],function(_0x1cfa8c){return{'name':_0x1cfa8c[_0xea67('0x2d')],'type':_0x1cfa8c['type'][_0xea67('0x2e')]};});_0x448c44[_0xea67('0x2f')]=_[_0xea67('0x30')](_0x957335,'name');_0x448c44[_0xea67('0x31')]=_[_0xea67('0x32')](_0x4b4fe9[_0xea67('0x31')]);_0x448c44[_0xea67('0x33')]=_[_0xea67('0x34')](_0x448c44[_0xea67('0x2f')],_0x448c44['query']);_0xa70cb3[_0xea67('0x35')]=_[_0xea67('0x34')](_0x448c44[_0xea67('0x2f')],qs[_0xea67('0x36')](_0x4b4fe9['query']['fields']));_0xa70cb3[_0xea67('0x35')]=_0xa70cb3[_0xea67('0x35')][_0xea67('0x37')]?_0xa70cb3[_0xea67('0x35')]:_0x448c44[_0xea67('0x2f')];if(!_0x4b4fe9[_0xea67('0x31')][_0xea67('0x38')](_0xea67('0x39'))){_0xa70cb3[_0xea67('0x3a')]=qs[_0xea67('0x3a')](_0x4b4fe9[_0xea67('0x31')][_0xea67('0x3a')]);_0xa70cb3[_0xea67('0x21')]=qs['offset'](_0x4b4fe9['query'][_0xea67('0x21')]);}_0xa70cb3[_0xea67('0x3b')]=qs['sort'](_0x4b4fe9[_0xea67('0x31')][_0xea67('0x3c')]);_0xa70cb3[_0xea67('0x3d')]=qs[_0xea67('0x33')](_[_0xea67('0x3e')](_0x4b4fe9[_0xea67('0x31')],_0x448c44[_0xea67('0x33')]));if(_0x4b4fe9[_0xea67('0x31')][_0xea67('0x3f')]){_0xa70cb3[_0xea67('0x3d')]=_[_0xea67('0x40')](_0xa70cb3[_0xea67('0x3d')],{'$or':_[_0xea67('0x30')](_0x957335,function(_0x6122f9){if(_0x6122f9[_0xea67('0x41')][_0xea67('0x2e')]!==_0xea67('0x42')){var _0xeaeb55={};_0xeaeb55[_0x6122f9[_0xea67('0x43')]]={'$like':'%'+_0x4b4fe9[_0xea67('0x31')][_0xea67('0x3f')]+'%'};return _0xeaeb55;}})});}_0xa70cb3=_['merge']({},_0xa70cb3,_0x4b4fe9[_0xea67('0x44')]);var _0x2a3288={'where':_0xa70cb3[_0xea67('0x3d')]};return db['VoiceQueueReport']['count'](_0x2a3288)[_0xea67('0x27')](function(_0xe550ff){_0x469a21[_0xea67('0x20')]=_0xe550ff;if(_0x4b4fe9['query'][_0xea67('0x45')]){_0xa70cb3['include']=[{'all':!![]}];}return db[_0xea67('0x2c')][_0xea67('0x46')](_0xa70cb3);})[_0xea67('0x27')](function(_0xaf9bce){_0x469a21['rows']=_0xaf9bce;return _0x469a21;})[_0xea67('0x27')](respondWithFilteredResult(_0xc46bc6,_0xa70cb3))['catch'](handleError(_0xc46bc6,null));};exports[_0xea67('0x47')]=function(_0x4e1bfd,_0x5d65ef){var _0x2cbd04={'raw':![],'where':{'id':_0x4e1bfd[_0xea67('0x48')]['id']}},_0x330cfe={};_0x330cfe['model']=_[_0xea67('0x32')](db['VoiceQueueReport'][_0xea67('0x49')]);_0x330cfe[_0xea67('0x31')]=_[_0xea67('0x32')](_0x4e1bfd[_0xea67('0x31')]);_0x330cfe['filters']=_['intersection'](_0x330cfe[_0xea67('0x2f')],_0x330cfe['query']);_0x2cbd04[_0xea67('0x35')]=_[_0xea67('0x34')](_0x330cfe['model'],qs[_0xea67('0x36')](_0x4e1bfd[_0xea67('0x31')][_0xea67('0x36')]));_0x2cbd04['attributes']=_0x2cbd04[_0xea67('0x35')][_0xea67('0x37')]?_0x2cbd04['attributes']:_0x330cfe[_0xea67('0x2f')];if(_0x4e1bfd[_0xea67('0x31')]['includeAll']){_0x2cbd04[_0xea67('0x4a')]=[{'all':!![]}];}_0x2cbd04=_[_0xea67('0x40')]({},_0x2cbd04,_0x4e1bfd[_0xea67('0x44')]);return db['VoiceQueueReport'][_0xea67('0x4b')](_0x2cbd04)[_0xea67('0x27')](handleEntityNotFound(_0x5d65ef,null))[_0xea67('0x27')](respondWithResult(_0x5d65ef,null))['catch'](handleError(_0x5d65ef,null));};exports[_0xea67('0x4c')]=function(_0x5b9c39,_0x36669b){return db[_0xea67('0x2c')]['create'](_0x5b9c39[_0xea67('0x4d')],{})[_0xea67('0x27')](respondWithResult(_0x36669b,0xc9))[_0xea67('0x4e')](handleError(_0x36669b,null));};exports[_0xea67('0x26')]=function(_0xb520f,_0x1e0097){if(_0xb520f[_0xea67('0x4d')]['id']){delete _0xb520f[_0xea67('0x4d')]['id'];}return db['VoiceQueueReport']['find']({'where':{'id':_0xb520f[_0xea67('0x48')]['id']}})[_0xea67('0x27')](handleEntityNotFound(_0x1e0097,null))[_0xea67('0x27')](saveUpdates(_0xb520f[_0xea67('0x4d')],null))[_0xea67('0x27')](respondWithResult(_0x1e0097,null))[_0xea67('0x4e')](handleError(_0x1e0097,null));};exports[_0xea67('0x4f')]=function(_0xe2128,_0x468a37){return db[_0xea67('0x2c')][_0xea67('0x4b')]({'where':{'id':_0xe2128[_0xea67('0x48')]['id']}})[_0xea67('0x27')](handleEntityNotFound(_0x468a37,null))[_0xea67('0x27')](removeEntity(_0x468a37,null))['catch'](handleError(_0x468a37,null));};exports[_0xea67('0x50')]=function(_0x97e759,_0x25cdb0){return db[_0xea67('0x2c')][_0xea67('0x50')]()['then'](respondWithResult(_0x25cdb0,null))['catch'](handleError(_0x25cdb0,null));};exports[_0xea67('0x51')]=function(_0x4d37b8,_0x356890){var _0x54ba5e={},_0x7d3f49={},_0x41d6f3={'count':0x0,'rows':[]};_0x7d3f49[_0xea67('0x2f')]=_[_0xea67('0x32')](db[_0xea67('0x2c')][_0xea67('0x49')]);_0x7d3f49[_0xea67('0x31')]=_[_0xea67('0x32')](_0x4d37b8['query']);_0x7d3f49[_0xea67('0x33')]=_[_0xea67('0x34')](_0x7d3f49[_0xea67('0x2f')],_0x7d3f49[_0xea67('0x31')]);_0x54ba5e[_0xea67('0x35')]=_['intersection'](_0x7d3f49[_0xea67('0x2f')],qs[_0xea67('0x36')](_0x4d37b8[_0xea67('0x31')][_0xea67('0x36')]));_0x54ba5e['attributes']=_0x54ba5e[_0xea67('0x35')][_0xea67('0x37')]?_0x54ba5e['attributes']:_0x7d3f49[_0xea67('0x2f')];if(!_0x4d37b8[_0xea67('0x31')]['hasOwnProperty'](_0xea67('0x39'))){_0x54ba5e[_0xea67('0x3a')]=qs['limit'](_0x4d37b8[_0xea67('0x31')][_0xea67('0x3a')]);_0x54ba5e[_0xea67('0x21')]=qs[_0xea67('0x21')](_0x4d37b8[_0xea67('0x31')]['offset']);}_0x54ba5e['order']=qs[_0xea67('0x3c')](_0x4d37b8[_0xea67('0x31')][_0xea67('0x3c')]);_0x54ba5e[_0xea67('0x3d')]=qs[_0xea67('0x33')](_[_0xea67('0x3e')](_0x4d37b8['query'],_0x7d3f49[_0xea67('0x33')]));if(_0x4d37b8[_0xea67('0x31')][_0xea67('0x3f')]){_0x54ba5e[_0xea67('0x3d')]=_[_0xea67('0x40')](_0x54ba5e[_0xea67('0x3d')],{'$or':_[_0xea67('0x30')](_0x54ba5e[_0xea67('0x35')],function(_0x3282dd){var _0x39ffd5={};_0x39ffd5[_0x3282dd]={'$like':'%'+_0x4d37b8[_0xea67('0x31')][_0xea67('0x3f')]+'%'};return _0x39ffd5;})});}_0x54ba5e=_[_0xea67('0x40')]({},_0x54ba5e,_0x4d37b8[_0xea67('0x44')]);var _0x10c2ed={'where':_0x54ba5e[_0xea67('0x3d')]};return db[_0xea67('0x2c')]['count'](_0x10c2ed)[_0xea67('0x27')](function(_0x39d1bf){_0x41d6f3[_0xea67('0x20')]=_0x39d1bf;if(_0x4d37b8[_0xea67('0x31')][_0xea67('0x45')]){_0x54ba5e['include']=[{'all':!![]}];}return db[_0xea67('0x2c')]['findAll'](_0x54ba5e);})[_0xea67('0x27')](function(_0x53f914){_0x41d6f3['rows']=_0x53f914;return _0x41d6f3;})[_0xea67('0x27')](respondWithFilteredResult(_0x356890,_0x54ba5e,'getVoiceQueuesReport'))[_0xea67('0x4e')](handleError(_0x356890,null,_0xea67('0x51')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index f2b95ce..dafb847 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 _0x22da=['hasOwnProperty','exports','VoiceQueueReport','setMaxListeners','save','update','emit'];(function(_0x1780cb,_0x4eb393){var _0x5aa0fd=function(_0x47de91){while(--_0x47de91){_0x1780cb['push'](_0x1780cb['shift']());}};_0x5aa0fd(++_0x4eb393);}(_0x22da,0x80));var _0xa22d=function(_0xeb918,_0x311095){_0xeb918=_0xeb918-0x0;var _0x98a65e=_0x22da[_0xeb918];return _0x98a65e;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require('../../mysqldb')['db'][_0xa22d('0x0')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xa22d('0x1')](0x0);var events={'afterCreate':_0xa22d('0x2'),'afterUpdate':_0xa22d('0x3'),'afterDestroy':'remove'};function emitEvent(_0x178cc8){return function(_0x34da8c,_0x3e2232,_0x32e8f1){VoiceQueueReportEvents['emit'](_0x178cc8+':'+_0x34da8c['id'],_0x34da8c);VoiceQueueReportEvents[_0xa22d('0x4')](_0x178cc8,_0x34da8c);_0x32e8f1(null);};}for(var e in events){if(events[_0xa22d('0x5')](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module[_0xa22d('0x6')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x9fd4=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','VoiceQueueReport','setMaxListeners','save','update'];(function(_0x3e445f,_0x2d9157){var _0x284686=function(_0x203f8e){while(--_0x203f8e){_0x3e445f['push'](_0x3e445f['shift']());}};_0x284686(++_0x2d9157);}(_0x9fd4,0x16c));var _0x49fd=function(_0x5ee893,_0x260e68){_0x5ee893=_0x5ee893-0x0;var _0x79ab0e=_0x9fd4[_0x5ee893];return _0x79ab0e;};'use strict';var EventEmitter=require(_0x49fd('0x0'));var VoiceQueueReport=require(_0x49fd('0x1'))['db'][_0x49fd('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x49fd('0x3')](0x0);var events={'afterCreate':_0x49fd('0x4'),'afterUpdate':_0x49fd('0x5'),'afterDestroy':_0x49fd('0x6')};function emitEvent(_0x13ec80){return function(_0x3f149e,_0x55dda5,_0x481f6a){VoiceQueueReportEvents[_0x49fd('0x7')](_0x13ec80+':'+_0x3f149e['id'],_0x3f149e);VoiceQueueReportEvents[_0x49fd('0x7')](_0x13ec80,_0x3f149e);_0x481f6a(null);};}for(var e in events){if(events[_0x49fd('0x8')](e)){var event=events[e];VoiceQueueReport[_0x49fd('0x9')](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 29698c8..76c4095 100644 --- a/server/api/voiceQueueReport/voiceQueueReport.model.js +++ b/server/api/voiceQueueReport/voiceQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['define','report_queue','uniqueid','calleridnum','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceQueueReport.attributes','exports'];(function(_0x3db58d,_0x3f0c01){var _0x17158d=function(_0x1b03f5){while(--_0x1b03f5){_0x3db58d['push'](_0x3db58d['shift']());}};_0x17158d(++_0x3f0c01);}(_0xb10b,0x12a));var _0xbb10=function(_0x332251,_0x3c134f){_0x332251=_0x332251-0x0;var _0x592e7d=_0xb10b[_0x332251];return _0x592e7d;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('VoiceQueueReport',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[{'fields':[_0xbb10('0xc')]},{'fields':[_0xbb10('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0b0e=['calleridnum','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueueReport.attributes','exports','define','uniqueid'];(function(_0x581f8b,_0x132bce){var _0x1fdf81=function(_0x214406){while(--_0x214406){_0x581f8b['push'](_0x581f8b['shift']());}};_0x1fdf81(++_0x132bce);}(_0x0b0e,0x187));var _0xe0b0=function(_0x156a0d,_0x3946ce){_0x156a0d=_0x156a0d-0x0;var _0x98a9ba=_0x0b0e[_0x156a0d];return _0x98a9ba;};'use strict';var _=require(_0xe0b0('0x0'));var util=require('util');var logger=require(_0xe0b0('0x1'))('api');var moment=require(_0xe0b0('0x2'));var BPromise=require(_0xe0b0('0x3'));var rp=require(_0xe0b0('0x4'));var fs=require('fs');var path=require(_0xe0b0('0x5'));var rimraf=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var attributes=require(_0xe0b0('0x8'));module[_0xe0b0('0x9')]=function(_0x30e20d,_0x28e40f){return _0x30e20d[_0xe0b0('0xa')]('VoiceQueueReport',attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':[_0xe0b0('0xb')]},{'fields':[_0xe0b0('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index e5e9ad7..31a3c26 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 _0xdebc=['client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','request','then','info','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','VoiceQueueReport,\x20%s,\x20%s','message','catch','GetVoiceQueueReport','options','raw','where','attributes','limit','map','include','model','CreateVoiceQueueReport','VoiceQueueReport','create','UpdateVoiceQueueReport','update','body','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','jayson/promise'];(function(_0x1fb8db,_0x339e90){var _0x2acbdd=function(_0x34b34a){while(--_0x34b34a){_0x1fb8db['push'](_0x1fb8db['shift']());}};_0x2acbdd(++_0x339e90);}(_0xdebc,0x192));var _0xcdeb=function(_0x1a31bf,_0x3683e9){_0x1a31bf=_0x1a31bf-0x0;var _0xdd3d6e=_0xdebc[_0x1a31bf];return _0xdd3d6e;};'use strict';var _=require(_0xcdeb('0x0'));var util=require(_0xcdeb('0x1'));var moment=require(_0xcdeb('0x2'));var BPromise=require(_0xcdeb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcdeb('0x4'))['db'];var utils=require(_0xcdeb('0x5'));var logger=require('../../config/logger')(_0xcdeb('0x6'));var config=require('../../config/environment');var jayson=require(_0xcdeb('0x7'));var client=jayson[_0xcdeb('0x8')][_0xcdeb('0x9')]({'port':0x232a});config[_0xcdeb('0xa')]=_[_0xcdeb('0xb')](config[_0xcdeb('0xa')],{'host':_0xcdeb('0xc'),'port':0x18eb});var socket=require(_0xcdeb('0xd'))(new Redis(config['redis']));require(_0xcdeb('0xe'))['register'](socket);function respondWithRpcPromise(_0x1ae4bf,_0x1e4bd,_0x3aca7c){return new BPromise(function(_0x74933b,_0x202260){return client[_0xcdeb('0xf')](_0x1ae4bf,_0x3aca7c)[_0xcdeb('0x10')](function(_0x1ae0e9){logger[_0xcdeb('0x11')]('VoiceQueueReport,\x20%s,\x20%s',_0x1e4bd,'request\x20sent');logger[_0xcdeb('0x12')](_0xcdeb('0x13'),_0x1e4bd,_0xcdeb('0x14'),JSON[_0xcdeb('0x15')](_0x1ae0e9));if(_0x1ae0e9['error']){if(_0x1ae0e9['error']['code']===0x1f4){logger[_0xcdeb('0x16')](_0xcdeb('0x17'),_0x1e4bd,_0x1ae0e9[_0xcdeb('0x16')][_0xcdeb('0x18')]);return _0x202260(_0x1ae0e9[_0xcdeb('0x16')][_0xcdeb('0x18')]);}logger['error'](_0xcdeb('0x17'),_0x1e4bd,_0x1ae0e9['error'][_0xcdeb('0x18')]);return _0x74933b(_0x1ae0e9[_0xcdeb('0x16')][_0xcdeb('0x18')]);}else{logger[_0xcdeb('0x11')](_0xcdeb('0x17'),_0x1e4bd,'request\x20sent');_0x74933b(_0x1ae0e9['result']['message']);}})[_0xcdeb('0x19')](function(_0x559b25){logger[_0xcdeb('0x16')]('VoiceQueueReport,\x20%s,\x20%s',_0x1e4bd,_0x559b25);_0x202260(_0x559b25);});});}exports[_0xcdeb('0x1a')]=function(_0x22b4be){var _0x56a6d8=this;return new Promise(function(_0x324ccc,_0x428141){return db['VoiceQueueReport']['findAll']({'raw':_0x22b4be['options']?_0x22b4be[_0xcdeb('0x1b')][_0xcdeb('0x1c')]===undefined?!![]:![]:!![],'where':_0x22b4be[_0xcdeb('0x1b')]?_0x22b4be[_0xcdeb('0x1b')][_0xcdeb('0x1d')]||null:null,'attributes':_0x22b4be[_0xcdeb('0x1b')]?_0x22b4be[_0xcdeb('0x1b')][_0xcdeb('0x1e')]||null:null,'limit':_0x22b4be['options']?_0x22b4be[_0xcdeb('0x1b')][_0xcdeb('0x1f')]||null:null,'include':_0x22b4be[_0xcdeb('0x1b')]?_0x22b4be[_0xcdeb('0x1b')]['include']?_[_0xcdeb('0x20')](_0x22b4be[_0xcdeb('0x1b')]['include'],function(_0x35077b){return{'model':db[_0x35077b['model']],'as':_0x35077b['as'],'attributes':_0x35077b['attributes'],'include':_0x35077b[_0xcdeb('0x21')]?_['map'](_0x35077b[_0xcdeb('0x21')],function(_0x4713a3){return{'model':db[_0x4713a3[_0xcdeb('0x22')]],'as':_0x4713a3['as'],'attributes':_0x4713a3[_0xcdeb('0x1e')],'include':_0x4713a3['include']?_[_0xcdeb('0x20')](_0x4713a3[_0xcdeb('0x21')],function(_0x3e63ac){return{'model':db[_0x3e63ac[_0xcdeb('0x22')]],'as':_0x3e63ac['as'],'attributes':_0x3e63ac[_0xcdeb('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x558cb8){logger[_0xcdeb('0x11')](_0xcdeb('0x1a'),_0x22b4be);logger[_0xcdeb('0x12')]('GetVoiceQueueReport',_0x22b4be,JSON[_0xcdeb('0x15')](_0x558cb8));_0x324ccc(_0x558cb8);})[_0xcdeb('0x19')](function(_0x51f6fd){logger[_0xcdeb('0x16')](_0xcdeb('0x1a'),_0x51f6fd['message'],_0x22b4be);_0x428141(_0x56a6d8[_0xcdeb('0x16')](0x1f4,_0x51f6fd['message']));});});};exports[_0xcdeb('0x23')]=function(_0x3566e0){var _0x3294e3=this;return new Promise(function(_0x2196c7,_0x479ab5){return db[_0xcdeb('0x24')][_0xcdeb('0x25')](_0x3566e0['body'],{'raw':_0x3566e0[_0xcdeb('0x1b')]?_0x3566e0[_0xcdeb('0x1b')][_0xcdeb('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x5ca1cf){logger[_0xcdeb('0x11')]('CreateVoiceQueueReport',_0x3566e0);logger['debug'](_0xcdeb('0x23'),_0x3566e0,JSON[_0xcdeb('0x15')](_0x5ca1cf));_0x2196c7(_0x5ca1cf);})[_0xcdeb('0x19')](function(_0x7c317a){logger[_0xcdeb('0x16')](_0xcdeb('0x23'),_0x7c317a[_0xcdeb('0x18')],_0x3566e0);_0x479ab5(_0x3294e3[_0xcdeb('0x16')](0x1f4,_0x7c317a['message']));});});};exports[_0xcdeb('0x26')]=function(_0x2760e5){var _0x314654=this;return new Promise(function(_0x1fbd55,_0x38291b){return db[_0xcdeb('0x24')][_0xcdeb('0x27')](_0x2760e5[_0xcdeb('0x28')],{'raw':_0x2760e5[_0xcdeb('0x1b')]?_0x2760e5[_0xcdeb('0x1b')][_0xcdeb('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2760e5['options']?_0x2760e5['options'][_0xcdeb('0x1d')]||null:null,'attributes':_0x2760e5[_0xcdeb('0x1b')]?_0x2760e5[_0xcdeb('0x1b')][_0xcdeb('0x1e')]||null:null,'limit':_0x2760e5[_0xcdeb('0x1b')]?_0x2760e5[_0xcdeb('0x1b')]['limit']||null:null})[_0xcdeb('0x10')](function(_0x2cd911){logger[_0xcdeb('0x11')](_0xcdeb('0x26'),_0x2760e5);logger['debug']('UpdateVoiceQueueReport',_0x2760e5,JSON['stringify'](_0x2cd911));_0x1fbd55(_0x2cd911);})[_0xcdeb('0x19')](function(_0x48b89f){logger[_0xcdeb('0x16')](_0xcdeb('0x26'),_0x48b89f[_0xcdeb('0x18')],_0x2760e5);_0x38291b(_0x314654[_0xcdeb('0x16')](0x1f4,_0x48b89f[_0xcdeb('0x18')]));});});}; \ No newline at end of file +var _0x0f25=['VoiceQueueReport','create','body','UpdateVoiceQueueReport','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceQueueReport,\x20%s,\x20%s','result','catch','GetVoiceQueueReport','options','raw','where','attributes','limit','include','model','map','CreateVoiceQueueReport'];(function(_0x590043,_0x2b6065){var _0x1c6318=function(_0x3d9354){while(--_0x3d9354){_0x590043['push'](_0x590043['shift']());}};_0x1c6318(++_0x2b6065);}(_0x0f25,0x88));var _0x50f2=function(_0x31892d,_0x2cf684){_0x31892d=_0x31892d-0x0;var _0x42c461=_0x0f25[_0x31892d];return _0x42c461;};'use strict';var _=require(_0x50f2('0x0'));var util=require('util');var moment=require(_0x50f2('0x1'));var BPromise=require(_0x50f2('0x2'));var rs=require(_0x50f2('0x3'));var fs=require('fs');var Redis=require(_0x50f2('0x4'));var db=require(_0x50f2('0x5'))['db'];var utils=require(_0x50f2('0x6'));var logger=require(_0x50f2('0x7'))(_0x50f2('0x8'));var config=require(_0x50f2('0x9'));var jayson=require(_0x50f2('0xa'));var client=jayson[_0x50f2('0xb')]['http']({'port':0x232a});config[_0x50f2('0xc')]=_[_0x50f2('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x50f2('0xe'))(new Redis(config['redis']));require(_0x50f2('0xf'))[_0x50f2('0x10')](socket);function respondWithRpcPromise(_0x1f8644,_0x2e3db6,_0x113260){return new BPromise(function(_0x2e05b3,_0x3a7a96){return client[_0x50f2('0x11')](_0x1f8644,_0x113260)[_0x50f2('0x12')](function(_0x3d7af4){logger[_0x50f2('0x13')]('VoiceQueueReport,\x20%s,\x20%s',_0x2e3db6,_0x50f2('0x14'));logger[_0x50f2('0x15')](_0x50f2('0x16'),_0x2e3db6,_0x50f2('0x14'),JSON[_0x50f2('0x17')](_0x3d7af4));if(_0x3d7af4[_0x50f2('0x18')]){if(_0x3d7af4['error'][_0x50f2('0x19')]===0x1f4){logger[_0x50f2('0x18')]('VoiceQueueReport,\x20%s,\x20%s',_0x2e3db6,_0x3d7af4[_0x50f2('0x18')][_0x50f2('0x1a')]);return _0x3a7a96(_0x3d7af4[_0x50f2('0x18')][_0x50f2('0x1a')]);}logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x2e3db6,_0x3d7af4[_0x50f2('0x18')]['message']);return _0x2e05b3(_0x3d7af4['error'][_0x50f2('0x1a')]);}else{logger['info'](_0x50f2('0x1b'),_0x2e3db6,_0x50f2('0x14'));_0x2e05b3(_0x3d7af4[_0x50f2('0x1c')][_0x50f2('0x1a')]);}})[_0x50f2('0x1d')](function(_0x21e02c){logger[_0x50f2('0x18')](_0x50f2('0x1b'),_0x2e3db6,_0x21e02c);_0x3a7a96(_0x21e02c);});});}exports[_0x50f2('0x1e')]=function(_0x13ad11){var _0x3c9848=this;return new Promise(function(_0x4e5c8e,_0x5d8606){return db['VoiceQueueReport']['findAll']({'raw':_0x13ad11[_0x50f2('0x1f')]?_0x13ad11[_0x50f2('0x1f')][_0x50f2('0x20')]===undefined?!![]:![]:!![],'where':_0x13ad11['options']?_0x13ad11['options'][_0x50f2('0x21')]||null:null,'attributes':_0x13ad11[_0x50f2('0x1f')]?_0x13ad11[_0x50f2('0x1f')][_0x50f2('0x22')]||null:null,'limit':_0x13ad11[_0x50f2('0x1f')]?_0x13ad11[_0x50f2('0x1f')][_0x50f2('0x23')]||null:null,'include':_0x13ad11[_0x50f2('0x1f')]?_0x13ad11[_0x50f2('0x1f')][_0x50f2('0x24')]?_['map'](_0x13ad11[_0x50f2('0x1f')][_0x50f2('0x24')],function(_0x283fca){return{'model':db[_0x283fca[_0x50f2('0x25')]],'as':_0x283fca['as'],'attributes':_0x283fca[_0x50f2('0x22')],'include':_0x283fca[_0x50f2('0x24')]?_['map'](_0x283fca[_0x50f2('0x24')],function(_0x2a224a){return{'model':db[_0x2a224a[_0x50f2('0x25')]],'as':_0x2a224a['as'],'attributes':_0x2a224a[_0x50f2('0x22')],'include':_0x2a224a['include']?_[_0x50f2('0x26')](_0x2a224a[_0x50f2('0x24')],function(_0x2ed184){return{'model':db[_0x2ed184[_0x50f2('0x25')]],'as':_0x2ed184['as'],'attributes':_0x2ed184[_0x50f2('0x22')]};}):[]};}):[]};}):[]:[]})[_0x50f2('0x12')](function(_0x7ba53c){logger[_0x50f2('0x13')](_0x50f2('0x1e'),_0x13ad11);logger['debug']('GetVoiceQueueReport',_0x13ad11,JSON[_0x50f2('0x17')](_0x7ba53c));_0x4e5c8e(_0x7ba53c);})[_0x50f2('0x1d')](function(_0x4f6bce){logger[_0x50f2('0x18')](_0x50f2('0x1e'),_0x4f6bce[_0x50f2('0x1a')],_0x13ad11);_0x5d8606(_0x3c9848[_0x50f2('0x18')](0x1f4,_0x4f6bce[_0x50f2('0x1a')]));});});};exports[_0x50f2('0x27')]=function(_0x305011){var _0x195843=this;return new Promise(function(_0x53187c,_0xba016f){return db[_0x50f2('0x28')][_0x50f2('0x29')](_0x305011[_0x50f2('0x2a')],{'raw':_0x305011['options']?_0x305011[_0x50f2('0x1f')][_0x50f2('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x20ed12){logger[_0x50f2('0x13')](_0x50f2('0x27'),_0x305011);logger[_0x50f2('0x15')]('CreateVoiceQueueReport',_0x305011,JSON[_0x50f2('0x17')](_0x20ed12));_0x53187c(_0x20ed12);})[_0x50f2('0x1d')](function(_0x42a808){logger[_0x50f2('0x18')]('CreateVoiceQueueReport',_0x42a808[_0x50f2('0x1a')],_0x305011);_0xba016f(_0x195843[_0x50f2('0x18')](0x1f4,_0x42a808[_0x50f2('0x1a')]));});});};exports[_0x50f2('0x2b')]=function(_0x2e0274){var _0xacfed3=this;return new Promise(function(_0xe3f036,_0x4f248a){return db[_0x50f2('0x28')]['update'](_0x2e0274['body'],{'raw':_0x2e0274[_0x50f2('0x1f')]?_0x2e0274[_0x50f2('0x1f')][_0x50f2('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2e0274[_0x50f2('0x1f')]?_0x2e0274['options']['where']||null:null,'attributes':_0x2e0274[_0x50f2('0x1f')]?_0x2e0274[_0x50f2('0x1f')][_0x50f2('0x22')]||null:null,'limit':_0x2e0274['options']?_0x2e0274['options'][_0x50f2('0x23')]||null:null})['then'](function(_0x1695c6){logger[_0x50f2('0x13')](_0x50f2('0x2b'),_0x2e0274);logger[_0x50f2('0x15')]('UpdateVoiceQueueReport',_0x2e0274,JSON[_0x50f2('0x17')](_0x1695c6));_0xe3f036(_0x1695c6);})['catch'](function(_0x31485f){logger[_0x50f2('0x18')](_0x50f2('0x2b'),_0x31485f[_0x50f2('0x1a')],_0x2e0274);_0x4f248a(_0xacfed3[_0x50f2('0x18')](0x1f4,_0x31485f[_0x50f2('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 61a738c..244c540 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 _0xdc82=['remove','update','emit','removeListener','length','voiceQueueReport:','./voiceQueueReport.events','save'];(function(_0x353d08,_0x5ce61f){var _0x218a45=function(_0x3d8f77){while(--_0x3d8f77){_0x353d08['push'](_0x353d08['shift']());}};_0x218a45(++_0x5ce61f);}(_0xdc82,0xa6));var _0x2dc8=function(_0x234fa2,_0x487e1b){_0x234fa2=_0x234fa2-0x0;var _0x140647=_0xdc82[_0x234fa2];return _0x140647;};'use strict';var VoiceQueueReportEvents=require(_0x2dc8('0x0'));var events=[_0x2dc8('0x1'),_0x2dc8('0x2'),_0x2dc8('0x3')];function createListener(_0x55b24c,_0x375918){return function(_0x495313){_0x375918[_0x2dc8('0x4')](_0x55b24c,_0x495313);};}function removeListener(_0x3c8f9e,_0xb708d4){return function(){VoiceQueueReportEvents[_0x2dc8('0x5')](_0x3c8f9e,_0xb708d4);};}exports['register']=function(_0x4c87f8){for(var _0x65fec=0x0,_0x570c02=events[_0x2dc8('0x6')];_0x65fec<_0x570c02;_0x65fec++){var _0x477097=events[_0x65fec];var _0xa0f2a3=createListener(_0x2dc8('0x7')+_0x477097,_0x4c87f8);VoiceQueueReportEvents['on'](_0x477097,_0xa0f2a3);}}; \ No newline at end of file +var _0x6717=['voiceQueueReport:','./voiceQueueReport.events','save','remove','emit','removeListener','register','length'];(function(_0x2c6aa8,_0x209468){var _0x3e71ff=function(_0x3ef7a0){while(--_0x3ef7a0){_0x2c6aa8['push'](_0x2c6aa8['shift']());}};_0x3e71ff(++_0x209468);}(_0x6717,0xa1));var _0x7671=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6717[_0x3dd15e];return _0x231fd0;};'use strict';var VoiceQueueReportEvents=require(_0x7671('0x0'));var events=[_0x7671('0x1'),_0x7671('0x2'),'update'];function createListener(_0x20a794,_0x3c122f){return function(_0x108eff){_0x3c122f[_0x7671('0x3')](_0x20a794,_0x108eff);};}function removeListener(_0x620c07,_0x20fd52){return function(){VoiceQueueReportEvents[_0x7671('0x4')](_0x620c07,_0x20fd52);};}exports[_0x7671('0x5')]=function(_0x12e1f1){for(var _0x19a4fc=0x0,_0x4d0975=events[_0x7671('0x6')];_0x19a4fc<_0x4d0975;_0x19a4fc++){var _0xc560fc=events[_0x19a4fc];var _0x284548=createListener(_0x7671('0x7')+_0xc560fc,_0x12e1f1);VoiceQueueReportEvents['on'](_0xc560fc,_0x284548);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index bee2b7f..2716667 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 _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(_0x1674a0,_0x59ff84){var _0x529b04=function(_0x407fda){while(--_0x407fda){_0x1674a0['push'](_0x1674a0['shift']());}};_0x529b04(++_0x59ff84);}(_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('./voiceQueuesLog.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 _0x1ff6=['put','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','isAuthenticated','index','get','/:id','show','post','create'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x1ff6,0x68));var _0x61ff=function(_0x10274a,_0x214641){_0x10274a=_0x10274a-0x0;var _0x424673=_0x1ff6[_0x10274a];return _0x424673;};'use strict';var multer=require(_0x61ff('0x0'));var util=require(_0x61ff('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x61ff('0x2'));var router=express[_0x61ff('0x3')]();var auth=require(_0x61ff('0x4'));var interaction=require(_0x61ff('0x5'));var config=require(_0x61ff('0x6'));var controller=require(_0x61ff('0x7'));router['get']('/',auth[_0x61ff('0x8')](),controller[_0x61ff('0x9')]);router[_0x61ff('0xa')](_0x61ff('0xb'),auth[_0x61ff('0x8')](),controller[_0x61ff('0xc')]);router[_0x61ff('0xd')]('/',auth[_0x61ff('0x8')](),controller[_0x61ff('0xe')]);router[_0x61ff('0xf')](_0x61ff('0xb'),auth[_0x61ff('0x8')](),controller['update']);router['delete'](_0x61ff('0xb'),auth[_0x61ff('0x8')](),controller['destroy']);module[_0x61ff('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 11bb0b0..773f3b7 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 _0x7c16=['DATE','YYYY-MM-DD\x20HH:mm:ss','sequelize','moment','exports','STRING'];(function(_0x176508,_0x325d30){var _0x910bcb=function(_0x1db277){while(--_0x1db277){_0x176508['push'](_0x176508['shift']());}};_0x910bcb(++_0x325d30);}(_0x7c16,0x16a));var _0x67c1=function(_0x566667,_0x3f99c2){_0x566667=_0x566667-0x0;var _0x277136=_0x7c16[_0x566667];return _0x277136;};'use strict';var Sequelize=require(_0x67c1('0x0'));var moment=require(_0x67c1('0x1'));module[_0x67c1('0x2')]={'time':{'type':Sequelize[_0x67c1('0x3')]},'callid':{'type':Sequelize[_0x67c1('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x67c1('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x67c1('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x67c1('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x67c1('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x67c1('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x67c1('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x67c1('0x4')],'allowNull':![],'defaultValue':moment()['format'](_0x67c1('0x5'))}}; \ No newline at end of file +var _0xe279=['moment','exports','STRING','DATE'];(function(_0x378a07,_0x26dbbe){var _0x1013e7=function(_0x28855f){while(--_0x28855f){_0x378a07['push'](_0x378a07['shift']());}};_0x1013e7(++_0x26dbbe);}(_0xe279,0x16c));var _0x9e27=function(_0x210b46,_0x52a05f){_0x210b46=_0x210b46-0x0;var _0x203df2=_0xe279[_0x210b46];return _0x203df2;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x9e27('0x0'));module[_0x9e27('0x1')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0x9e27('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x9e27('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x9e27('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x9e27('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x9e27('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x9e27('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x9e27('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x9e27('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x9e27('0x3')],'allowNull':![],'defaultValue':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 7883ace..3d49ce9 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 _0x0f03=['count','includeAll','findAll','rows','catch','show','params','length','include','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','field','VoiceQueuesLog'];(function(_0x26aabe,_0x2da2a4){var _0x2996b9=function(_0x531a69){while(--_0x531a69){_0x26aabe['push'](_0x26aabe['shift']());}};_0x2996b9(++_0x2da2a4);}(_0x0f03,0x1e7));var _0x30f0=function(_0x1d5428,_0x30ba2f){_0x1d5428=_0x1d5428-0x0;var _0x3505a6=_0x0f03[_0x1d5428];return _0x3505a6;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x30f0('0x0'));var rimraf=require(_0x30f0('0x1'));var zipdir=require(_0x30f0('0x2'));var jsonpatch=require(_0x30f0('0x3'));var rp=require(_0x30f0('0x4'));var moment=require(_0x30f0('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x30f0('0x6'));var util=require(_0x30f0('0x7'));var path=require(_0x30f0('0x8'));var sox=require(_0x30f0('0x9'));var csv=require(_0x30f0('0xa'));var ejs=require(_0x30f0('0xb'));var fs=require('fs');var _=require(_0x30f0('0xc'));var squel=require(_0x30f0('0xd'));var crypto=require(_0x30f0('0xe'));var jsforce=require(_0x30f0('0xf'));var deskjs=require(_0x30f0('0x10'));var toCsv=require(_0x30f0('0xa'));var querystring=require(_0x30f0('0x11'));var Papa=require(_0x30f0('0x12'));var Redis=require(_0x30f0('0x13'));var authService=require(_0x30f0('0x14'));var qs=require(_0x30f0('0x15'));var as=require(_0x30f0('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x30f0('0x17'))(_0x30f0('0x18'));var utils=require(_0x30f0('0x19'));var config=require(_0x30f0('0x1a'));var db=require(_0x30f0('0x1b'))['db'];function respondWithStatusCode(_0x3cc2ad,_0xab2a3){_0xab2a3=_0xab2a3||0xcc;return function(_0x454ff1){if(_0x454ff1){return _0x3cc2ad[_0x30f0('0x1c')](_0xab2a3);}return _0x3cc2ad[_0x30f0('0x1d')](_0xab2a3)[_0x30f0('0x1e')]();};}function respondWithResult(_0x2ec374,_0x345c09){_0x345c09=_0x345c09||0xc8;return function(_0x3e3115){if(_0x3e3115){return _0x2ec374[_0x30f0('0x1d')](_0x345c09)[_0x30f0('0x1f')](_0x3e3115);}};}function respondWithFilteredResult(_0x1f99ce,_0x2cd81f){return function(_0x2b31a7){if(_0x2b31a7){var _0x30faa2=_0x2b31a7['count'],_0x280760=_0x2cd81f[_0x30f0('0x20')],_0x156efc=_0x2cd81f['offset']+_0x2cd81f[_0x30f0('0x21')],_0x589c92;if(_0x156efc>=_0x30faa2){_0x156efc=_0x30faa2;_0x589c92=0xc8;}else{_0x589c92=0xce;}_0x1f99ce[_0x30f0('0x1d')](_0x589c92);return _0x1f99ce['set'](_0x30f0('0x22'),_0x280760+'-'+_0x156efc+'/'+_0x30faa2)['json'](_0x2b31a7);}return null;};}function patchUpdates(_0x80f930){return function(_0x2415cb){try{jsonpatch[_0x30f0('0x23')](_0x2415cb,_0x80f930,!![]);}catch(_0x18ac99){return BPromise[_0x30f0('0x24')](_0x18ac99);}return _0x2415cb['save']();};}function saveUpdates(_0x5c2a4d,_0x3c193b){return function(_0x401338){if(_0x401338){return _0x401338[_0x30f0('0x25')](_0x5c2a4d)['then'](function(_0x13c39c){return _0x13c39c;});}return null;};}function removeEntity(_0x5010c2,_0x1f3590){return function(_0x415a6e){if(_0x415a6e){return _0x415a6e['destroy']()[_0x30f0('0x26')](function(){_0x5010c2[_0x30f0('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x182347,_0x396df5){return function(_0x3d0acf){if(!_0x3d0acf){_0x182347[_0x30f0('0x1c')](0x194);}return _0x3d0acf;};}function handleError(_0x355b30,_0xcbd9d6){_0xcbd9d6=_0xcbd9d6||0x1f4;return function(_0x5734a2){logger[_0x30f0('0x27')](_0x5734a2[_0x30f0('0x28')]);if(_0x5734a2[_0x30f0('0x29')]){delete _0x5734a2[_0x30f0('0x29')];}_0x355b30[_0x30f0('0x1d')](_0xcbd9d6)[_0x30f0('0x2a')](_0x5734a2);};}exports[_0x30f0('0x2b')]=function(_0x3d6bd5,_0x1afb75){var _0x4dd611={},_0x2e7589={},_0x521033={'count':0x0,'rows':[]};var _0x5ad357=_[_0x30f0('0x2c')](db['VoiceQueuesLog'][_0x30f0('0x2d')],function(_0x1d452e){return{'name':_0x1d452e[_0x30f0('0x2e')],'type':_0x1d452e[_0x30f0('0x2f')][_0x30f0('0x30')]};});_0x2e7589[_0x30f0('0x31')]=_[_0x30f0('0x2c')](_0x5ad357,_0x30f0('0x29'));_0x2e7589['query']=_[_0x30f0('0x32')](_0x3d6bd5['query']);_0x2e7589[_0x30f0('0x33')]=_[_0x30f0('0x34')](_0x2e7589['model'],_0x2e7589[_0x30f0('0x35')]);_0x4dd611['attributes']=_[_0x30f0('0x34')](_0x2e7589[_0x30f0('0x31')],qs[_0x30f0('0x36')](_0x3d6bd5[_0x30f0('0x35')][_0x30f0('0x36')]));_0x4dd611['attributes']=_0x4dd611[_0x30f0('0x37')]['length']?_0x4dd611[_0x30f0('0x37')]:_0x2e7589[_0x30f0('0x31')];if(!_0x3d6bd5[_0x30f0('0x35')][_0x30f0('0x38')](_0x30f0('0x39'))){_0x4dd611[_0x30f0('0x21')]=qs[_0x30f0('0x21')](_0x3d6bd5[_0x30f0('0x35')][_0x30f0('0x21')]);_0x4dd611[_0x30f0('0x20')]=qs[_0x30f0('0x20')](_0x3d6bd5[_0x30f0('0x35')]['offset']);}_0x4dd611[_0x30f0('0x3a')]=qs[_0x30f0('0x3b')](_0x3d6bd5[_0x30f0('0x35')][_0x30f0('0x3b')]);_0x4dd611['where']=qs['filters'](_[_0x30f0('0x3c')](_0x3d6bd5[_0x30f0('0x35')],_0x2e7589['filters']));if(_0x3d6bd5[_0x30f0('0x35')]['filter']){_0x4dd611[_0x30f0('0x3d')]=_[_0x30f0('0x3e')](_0x4dd611[_0x30f0('0x3d')],{'$or':_[_0x30f0('0x2c')](_0x5ad357,function(_0x552662){if(_0x552662['type']['key']!==_0x30f0('0x3f')){var _0x5b0c57={};_0x5b0c57[_0x552662[_0x30f0('0x40')]]={'$like':'%'+_0x3d6bd5['query']['filter']+'%'};return _0x5b0c57;}})});}_0x4dd611=_[_0x30f0('0x3e')]({},_0x4dd611,_0x3d6bd5['options']);var _0xa777b5={'where':_0x4dd611[_0x30f0('0x3d')]};return db[_0x30f0('0x41')][_0x30f0('0x42')](_0xa777b5)[_0x30f0('0x26')](function(_0xfe1d64){_0x521033[_0x30f0('0x42')]=_0xfe1d64;if(_0x3d6bd5[_0x30f0('0x35')][_0x30f0('0x43')]){_0x4dd611['include']=[{'all':!![]}];}return db[_0x30f0('0x41')][_0x30f0('0x44')](_0x4dd611);})['then'](function(_0x14de96){_0x521033[_0x30f0('0x45')]=_0x14de96;return _0x521033;})[_0x30f0('0x26')](respondWithFilteredResult(_0x1afb75,_0x4dd611))[_0x30f0('0x46')](handleError(_0x1afb75,null));};exports[_0x30f0('0x47')]=function(_0x302102,_0x71dc2e){var _0x266dfa={'raw':!![],'where':{'id':_0x302102[_0x30f0('0x48')]['id']}},_0x133ae4={};_0x133ae4[_0x30f0('0x31')]=_[_0x30f0('0x32')](db['VoiceQueuesLog'][_0x30f0('0x2d')]);_0x133ae4[_0x30f0('0x35')]=_['keys'](_0x302102['query']);_0x133ae4[_0x30f0('0x33')]=_[_0x30f0('0x34')](_0x133ae4['model'],_0x133ae4[_0x30f0('0x35')]);_0x266dfa[_0x30f0('0x37')]=_['intersection'](_0x133ae4[_0x30f0('0x31')],qs[_0x30f0('0x36')](_0x302102[_0x30f0('0x35')][_0x30f0('0x36')]));_0x266dfa[_0x30f0('0x37')]=_0x266dfa[_0x30f0('0x37')][_0x30f0('0x49')]?_0x266dfa['attributes']:_0x133ae4[_0x30f0('0x31')];if(_0x302102[_0x30f0('0x35')][_0x30f0('0x43')]){_0x266dfa[_0x30f0('0x4a')]=[{'all':!![]}];}_0x266dfa=_['merge']({},_0x266dfa,_0x302102['options']);return db[_0x30f0('0x41')][_0x30f0('0x4b')](_0x266dfa)['then'](handleEntityNotFound(_0x71dc2e,null))['then'](respondWithResult(_0x71dc2e,null))[_0x30f0('0x46')](handleError(_0x71dc2e,null));};exports[_0x30f0('0x4c')]=function(_0x2f88a1,_0x3a7894){return db[_0x30f0('0x41')][_0x30f0('0x4c')](_0x2f88a1[_0x30f0('0x4d')],{})['then'](respondWithResult(_0x3a7894,0xc9))[_0x30f0('0x46')](handleError(_0x3a7894,null));};exports[_0x30f0('0x25')]=function(_0x7e40e7,_0x5b3b5e){if(_0x7e40e7['body']['id']){delete _0x7e40e7[_0x30f0('0x4d')]['id'];}return db[_0x30f0('0x41')][_0x30f0('0x4b')]({'where':{'id':_0x7e40e7[_0x30f0('0x48')]['id']}})[_0x30f0('0x26')](handleEntityNotFound(_0x5b3b5e,null))[_0x30f0('0x26')](saveUpdates(_0x7e40e7['body'],null))[_0x30f0('0x26')](respondWithResult(_0x5b3b5e,null))[_0x30f0('0x46')](handleError(_0x5b3b5e,null));};exports[_0x30f0('0x4e')]=function(_0x331e36,_0x32c8e5){return db[_0x30f0('0x41')][_0x30f0('0x4b')]({'where':{'id':_0x331e36['params']['id']}})[_0x30f0('0x26')](handleEntityNotFound(_0x32c8e5,null))[_0x30f0('0x26')](removeEntity(_0x32c8e5,null))[_0x30f0('0x46')](handleError(_0x32c8e5,null));}; \ No newline at end of file +var _0x0a8a=['path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','Content-Range','reject','then','destroy','error','stack','name','index','type','key','model','map','keys','query','filters','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','VIRTUAL','field','filter','merge','options','VoiceQueuesLog','includeAll','include','findAll','rows','catch','show','params','rawAttributes','intersection','find','create','body','update','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0x2039fd,_0x30e7f2){var _0x5019dc=function(_0x4766b6){while(--_0x4766b6){_0x2039fd['push'](_0x2039fd['shift']());}};_0x5019dc(++_0x30e7f2);}(_0x0a8a,0x89));var _0xa0a8=function(_0xe326ae,_0x49dd64){_0xe326ae=_0xe326ae-0x0;var _0x2bde3c=_0x0a8a[_0xe326ae];return _0x2bde3c;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xa0a8('0x0'));var zipdir=require(_0xa0a8('0x1'));var jsonpatch=require(_0xa0a8('0x2'));var rp=require(_0xa0a8('0x3'));var moment=require('moment');var BPromise=require(_0xa0a8('0x4'));var Mustache=require(_0xa0a8('0x5'));var util=require(_0xa0a8('0x6'));var path=require(_0xa0a8('0x7'));var sox=require('sox');var csv=require(_0xa0a8('0x8'));var ejs=require(_0xa0a8('0x9'));var fs=require('fs');var _=require(_0xa0a8('0xa'));var squel=require(_0xa0a8('0xb'));var crypto=require(_0xa0a8('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xa0a8('0xd'));var toCsv=require(_0xa0a8('0x8'));var querystring=require(_0xa0a8('0xe'));var Papa=require(_0xa0a8('0xf'));var Redis=require(_0xa0a8('0x10'));var authService=require(_0xa0a8('0x11'));var qs=require(_0xa0a8('0x12'));var as=require(_0xa0a8('0x13'));var hardwareService=require(_0xa0a8('0x14'));var logger=require(_0xa0a8('0x15'))('api');var utils=require(_0xa0a8('0x16'));var config=require(_0xa0a8('0x17'));var db=require(_0xa0a8('0x18'))['db'];function respondWithStatusCode(_0x42f083,_0x785125){_0x785125=_0x785125||0xcc;return function(_0x34bf11){if(_0x34bf11){return _0x42f083[_0xa0a8('0x19')](_0x785125);}return _0x42f083[_0xa0a8('0x1a')](_0x785125)['end']();};}function respondWithResult(_0x2bf1df,_0x741471){_0x741471=_0x741471||0xc8;return function(_0x57888a){if(_0x57888a){return _0x2bf1df['status'](_0x741471)['json'](_0x57888a);}};}function respondWithFilteredResult(_0x44d0d3,_0x3e29fd){return function(_0x3a1b0c){if(_0x3a1b0c){var _0x3c9893=_0x3a1b0c[_0xa0a8('0x1b')],_0x1c4ec9=_0x3e29fd['offset'],_0x1ba1a1=_0x3e29fd[_0xa0a8('0x1c')]+_0x3e29fd['limit'],_0x416d93;if(_0x1ba1a1>=_0x3c9893){_0x1ba1a1=_0x3c9893;_0x416d93=0xc8;}else{_0x416d93=0xce;}_0x44d0d3['status'](_0x416d93);return _0x44d0d3['set'](_0xa0a8('0x1d'),_0x1c4ec9+'-'+_0x1ba1a1+'/'+_0x3c9893)['json'](_0x3a1b0c);}return null;};}function patchUpdates(_0x19352e){return function(_0x4a27e3){try{jsonpatch['apply'](_0x4a27e3,_0x19352e,!![]);}catch(_0x45dd99){return BPromise[_0xa0a8('0x1e')](_0x45dd99);}return _0x4a27e3['save']();};}function saveUpdates(_0x2369c7,_0x440125){return function(_0x3bc943){if(_0x3bc943){return _0x3bc943['update'](_0x2369c7)[_0xa0a8('0x1f')](function(_0x4f93e1){return _0x4f93e1;});}return null;};}function removeEntity(_0x47b1c9,_0x545116){return function(_0x903ca7){if(_0x903ca7){return _0x903ca7[_0xa0a8('0x20')]()[_0xa0a8('0x1f')](function(){_0x47b1c9[_0xa0a8('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x259fa0,_0x5ab1ed){return function(_0x4b64dd){if(!_0x4b64dd){_0x259fa0['sendStatus'](0x194);}return _0x4b64dd;};}function handleError(_0x1e8152,_0x425280){_0x425280=_0x425280||0x1f4;return function(_0x350282){logger[_0xa0a8('0x21')](_0x350282[_0xa0a8('0x22')]);if(_0x350282[_0xa0a8('0x23')]){delete _0x350282[_0xa0a8('0x23')];}_0x1e8152['status'](_0x425280)['send'](_0x350282);};}exports[_0xa0a8('0x24')]=function(_0x49151c,_0xd05db0){var _0x35a612={},_0x10b13d={},_0x23c7f1={'count':0x0,'rows':[]};var _0x516715=_['map'](db['VoiceQueuesLog']['rawAttributes'],function(_0x22b25e){return{'name':_0x22b25e['fieldName'],'type':_0x22b25e[_0xa0a8('0x25')][_0xa0a8('0x26')]};});_0x10b13d[_0xa0a8('0x27')]=_[_0xa0a8('0x28')](_0x516715,_0xa0a8('0x23'));_0x10b13d['query']=_[_0xa0a8('0x29')](_0x49151c[_0xa0a8('0x2a')]);_0x10b13d[_0xa0a8('0x2b')]=_['intersection'](_0x10b13d[_0xa0a8('0x27')],_0x10b13d[_0xa0a8('0x2a')]);_0x35a612[_0xa0a8('0x2c')]=_['intersection'](_0x10b13d[_0xa0a8('0x27')],qs['fields'](_0x49151c['query'][_0xa0a8('0x2d')]));_0x35a612['attributes']=_0x35a612[_0xa0a8('0x2c')][_0xa0a8('0x2e')]?_0x35a612[_0xa0a8('0x2c')]:_0x10b13d['model'];if(!_0x49151c['query'][_0xa0a8('0x2f')]('nolimit')){_0x35a612[_0xa0a8('0x30')]=qs[_0xa0a8('0x30')](_0x49151c[_0xa0a8('0x2a')][_0xa0a8('0x30')]);_0x35a612[_0xa0a8('0x1c')]=qs[_0xa0a8('0x1c')](_0x49151c[_0xa0a8('0x2a')][_0xa0a8('0x1c')]);}_0x35a612[_0xa0a8('0x31')]=qs[_0xa0a8('0x32')](_0x49151c[_0xa0a8('0x2a')][_0xa0a8('0x32')]);_0x35a612[_0xa0a8('0x33')]=qs[_0xa0a8('0x2b')](_[_0xa0a8('0x34')](_0x49151c[_0xa0a8('0x2a')],_0x10b13d[_0xa0a8('0x2b')]));if(_0x49151c[_0xa0a8('0x2a')]['filter']){_0x35a612[_0xa0a8('0x33')]=_['merge'](_0x35a612[_0xa0a8('0x33')],{'$or':_['map'](_0x516715,function(_0xb26598){if(_0xb26598[_0xa0a8('0x25')][_0xa0a8('0x26')]!==_0xa0a8('0x35')){var _0xd490a9={};_0xd490a9[_0xb26598[_0xa0a8('0x36')]]={'$like':'%'+_0x49151c[_0xa0a8('0x2a')][_0xa0a8('0x37')]+'%'};return _0xd490a9;}})});}_0x35a612=_[_0xa0a8('0x38')]({},_0x35a612,_0x49151c[_0xa0a8('0x39')]);var _0x3c61b4={'where':_0x35a612[_0xa0a8('0x33')]};return db[_0xa0a8('0x3a')][_0xa0a8('0x1b')](_0x3c61b4)[_0xa0a8('0x1f')](function(_0x2ccb06){_0x23c7f1[_0xa0a8('0x1b')]=_0x2ccb06;if(_0x49151c['query'][_0xa0a8('0x3b')]){_0x35a612[_0xa0a8('0x3c')]=[{'all':!![]}];}return db[_0xa0a8('0x3a')][_0xa0a8('0x3d')](_0x35a612);})[_0xa0a8('0x1f')](function(_0x495a7f){_0x23c7f1[_0xa0a8('0x3e')]=_0x495a7f;return _0x23c7f1;})[_0xa0a8('0x1f')](respondWithFilteredResult(_0xd05db0,_0x35a612))[_0xa0a8('0x3f')](handleError(_0xd05db0,null));};exports[_0xa0a8('0x40')]=function(_0x5993fd,_0x341dcf){var _0x500b75={'raw':!![],'where':{'id':_0x5993fd[_0xa0a8('0x41')]['id']}},_0x2f9f99={};_0x2f9f99[_0xa0a8('0x27')]=_['keys'](db[_0xa0a8('0x3a')][_0xa0a8('0x42')]);_0x2f9f99[_0xa0a8('0x2a')]=_['keys'](_0x5993fd[_0xa0a8('0x2a')]);_0x2f9f99[_0xa0a8('0x2b')]=_['intersection'](_0x2f9f99[_0xa0a8('0x27')],_0x2f9f99[_0xa0a8('0x2a')]);_0x500b75[_0xa0a8('0x2c')]=_[_0xa0a8('0x43')](_0x2f9f99['model'],qs[_0xa0a8('0x2d')](_0x5993fd['query'][_0xa0a8('0x2d')]));_0x500b75[_0xa0a8('0x2c')]=_0x500b75[_0xa0a8('0x2c')][_0xa0a8('0x2e')]?_0x500b75[_0xa0a8('0x2c')]:_0x2f9f99[_0xa0a8('0x27')];if(_0x5993fd['query'][_0xa0a8('0x3b')]){_0x500b75[_0xa0a8('0x3c')]=[{'all':!![]}];}_0x500b75=_['merge']({},_0x500b75,_0x5993fd[_0xa0a8('0x39')]);return db[_0xa0a8('0x3a')][_0xa0a8('0x44')](_0x500b75)[_0xa0a8('0x1f')](handleEntityNotFound(_0x341dcf,null))['then'](respondWithResult(_0x341dcf,null))['catch'](handleError(_0x341dcf,null));};exports[_0xa0a8('0x45')]=function(_0x2ee4c4,_0x45de85){return db['VoiceQueuesLog'][_0xa0a8('0x45')](_0x2ee4c4[_0xa0a8('0x46')],{})['then'](respondWithResult(_0x45de85,0xc9))[_0xa0a8('0x3f')](handleError(_0x45de85,null));};exports[_0xa0a8('0x47')]=function(_0x40bec6,_0x2698f1){if(_0x40bec6[_0xa0a8('0x46')]['id']){delete _0x40bec6['body']['id'];}return db[_0xa0a8('0x3a')]['find']({'where':{'id':_0x40bec6['params']['id']}})[_0xa0a8('0x1f')](handleEntityNotFound(_0x2698f1,null))[_0xa0a8('0x1f')](saveUpdates(_0x40bec6['body'],null))[_0xa0a8('0x1f')](respondWithResult(_0x2698f1,null))[_0xa0a8('0x3f')](handleError(_0x2698f1,null));};exports['destroy']=function(_0x23cedb,_0x5e0511){return db[_0xa0a8('0x3a')][_0xa0a8('0x44')]({'where':{'id':_0x23cedb[_0xa0a8('0x41')]['id']}})[_0xa0a8('0x1f')](handleEntityNotFound(_0x5e0511,null))[_0xa0a8('0x1f')](removeEntity(_0x5e0511,null))['catch'](handleError(_0x5e0511,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 9082832..93ffc5e 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 _0x19d2=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','define','voice_queues_log','event','dtm','lodash','util'];(function(_0x3a4318,_0x13c6eb){var _0x36d746=function(_0x508617){while(--_0x508617){_0x3a4318['push'](_0x3a4318['shift']());}};_0x36d746(++_0x13c6eb);}(_0x19d2,0x1cf));var _0x219d=function(_0x1de801,_0x2d4de5){_0x1de801=_0x1de801-0x0;var _0x3d539d=_0x19d2[_0x1de801];return _0x3d539d;};'use strict';var _=require(_0x219d('0x0'));var util=require(_0x219d('0x1'));var logger=require(_0x219d('0x2'))(_0x219d('0x3'));var moment=require(_0x219d('0x4'));var BPromise=require(_0x219d('0x5'));var rp=require(_0x219d('0x6'));var fs=require('fs');var path=require(_0x219d('0x7'));var rimraf=require(_0x219d('0x8'));var config=require(_0x219d('0x9'));var attributes=require(_0x219d('0xa'));module['exports']=function(_0xf4c420,_0x511f40){return _0xf4c420[_0x219d('0xb')]('VoiceQueuesLog',attributes,{'tableName':_0x219d('0xc'),'paranoid':![],'indexes':[{'name':'event_dtm','fields':[_0x219d('0xd'),_0x219d('0xe')]}],'timestamps':![]});}; \ No newline at end of file +var _0x7594=['path','rimraf','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','voice_queues_log','event_dtm','event','dtm','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x290492,_0x18cfad){var _0x52b5bf=function(_0x3c3c63){while(--_0x3c3c63){_0x290492['push'](_0x290492['shift']());}};_0x52b5bf(++_0x18cfad);}(_0x7594,0x92));var _0x4759=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0x7594[_0x1ddedd];return _0xa3e1ac;};'use strict';var _=require(_0x4759('0x0'));var util=require(_0x4759('0x1'));var logger=require(_0x4759('0x2'))(_0x4759('0x3'));var moment=require(_0x4759('0x4'));var BPromise=require(_0x4759('0x5'));var rp=require(_0x4759('0x6'));var fs=require('fs');var path=require(_0x4759('0x7'));var rimraf=require(_0x4759('0x8'));var config=require('../../config/environment');var attributes=require(_0x4759('0x9'));module[_0x4759('0xa')]=function(_0x3a02a5,_0x3801eb){return _0x3a02a5[_0x4759('0xb')](_0x4759('0xc'),attributes,{'tableName':_0x4759('0xd'),'paranoid':![],'indexes':[{'name':_0x4759('0xe'),'fields':[_0x4759('0xf'),_0x4759('0x10')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index fc71879..db278a8 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 _0x4fc2=['bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0x4fc2,0x111));var _0x24fc=function(_0x296d93,_0x27ee37){_0x296d93=_0x296d93-0x0;var _0xba3f66=_0x4fc2[_0x296d93];return _0xba3f66;};'use strict';var _=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var moment=require(_0x24fc('0x2'));var BPromise=require(_0x24fc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x24fc('0x4'));var db=require(_0x24fc('0x5'))['db'];var utils=require(_0x24fc('0x6'));var logger=require('../../config/logger')(_0x24fc('0x7'));var config=require(_0x24fc('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x24fc('0x9')][_0x24fc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4889f4,_0x115851,_0x22a0c8){return new BPromise(function(_0x220f9a,_0x123eff){return client[_0x24fc('0xb')](_0x4889f4,_0x22a0c8)[_0x24fc('0xc')](function(_0x5afdf1){logger[_0x24fc('0xd')](_0x24fc('0xe'),_0x115851,_0x24fc('0xf'));logger[_0x24fc('0x10')](_0x24fc('0x11'),_0x115851,_0x24fc('0xf'),JSON[_0x24fc('0x12')](_0x5afdf1));if(_0x5afdf1[_0x24fc('0x13')]){if(_0x5afdf1['error'][_0x24fc('0x14')]===0x1f4){logger[_0x24fc('0x13')]('VoiceQueuesLog,\x20%s,\x20%s',_0x115851,_0x5afdf1[_0x24fc('0x13')][_0x24fc('0x15')]);return _0x123eff(_0x5afdf1[_0x24fc('0x13')][_0x24fc('0x15')]);}logger[_0x24fc('0x13')](_0x24fc('0xe'),_0x115851,_0x5afdf1['error'][_0x24fc('0x15')]);return _0x220f9a(_0x5afdf1[_0x24fc('0x13')][_0x24fc('0x15')]);}else{logger[_0x24fc('0xd')]('VoiceQueuesLog,\x20%s,\x20%s',_0x115851,_0x24fc('0xf'));_0x220f9a(_0x5afdf1['result'][_0x24fc('0x15')]);}})[_0x24fc('0x16')](function(_0x218fb6){logger[_0x24fc('0x13')](_0x24fc('0xe'),_0x115851,_0x218fb6);_0x123eff(_0x218fb6);});});} \ No newline at end of file +var _0x19e1=['moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','VoiceQueuesLog,\x20%s,\x20%s','message','info','result','catch','lodash','util'];(function(_0x3d3239,_0x35780c){var _0x492724=function(_0x5da258){while(--_0x5da258){_0x3d3239['push'](_0x3d3239['shift']());}};_0x492724(++_0x35780c);}(_0x19e1,0x163));var _0x119e=function(_0x198446,_0x119c8f){_0x198446=_0x198446-0x0;var _0x38d7b7=_0x19e1[_0x198446];return _0x38d7b7;};'use strict';var _=require(_0x119e('0x0'));var util=require(_0x119e('0x1'));var moment=require(_0x119e('0x2'));var BPromise=require(_0x119e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x119e('0x4'))['db'];var utils=require(_0x119e('0x5'));var logger=require('../../config/logger')(_0x119e('0x6'));var config=require(_0x119e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x119e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b5306,_0x25e166,_0x16a2ee){return new BPromise(function(_0x1b3797,_0x53d5b7){return client[_0x119e('0x9')](_0x1b5306,_0x16a2ee)[_0x119e('0xa')](function(_0x1a6747){logger['info']('VoiceQueuesLog,\x20%s,\x20%s',_0x25e166,_0x119e('0xb'));logger[_0x119e('0xc')](_0x119e('0xd'),_0x25e166,_0x119e('0xb'),JSON[_0x119e('0xe')](_0x1a6747));if(_0x1a6747[_0x119e('0xf')]){if(_0x1a6747[_0x119e('0xf')]['code']===0x1f4){logger[_0x119e('0xf')](_0x119e('0x10'),_0x25e166,_0x1a6747[_0x119e('0xf')][_0x119e('0x11')]);return _0x53d5b7(_0x1a6747[_0x119e('0xf')][_0x119e('0x11')]);}logger['error'](_0x119e('0x10'),_0x25e166,_0x1a6747[_0x119e('0xf')][_0x119e('0x11')]);return _0x1b3797(_0x1a6747[_0x119e('0xf')][_0x119e('0x11')]);}else{logger[_0x119e('0x12')](_0x119e('0x10'),_0x25e166,_0x119e('0xb'));_0x1b3797(_0x1a6747[_0x119e('0x13')][_0x119e('0x11')]);}})[_0x119e('0x14')](function(_0x54c326){logger[_0x119e('0xf')](_0x119e('0x10'),_0x25e166,_0x54c326);_0x53d5b7(_0x54c326);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 61273fd..fecd83a 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 _0xe726=['delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','/:id/download','post','create','put','update'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xe726,0x132));var _0x6e72=function(_0x2e265e,_0x6d5200){_0x2e265e=_0x2e265e-0x0;var _0x3a6690=_0xe726[_0x2e265e];return _0x3a6690;};'use strict';var multer=require(_0x6e72('0x0'));var util=require(_0x6e72('0x1'));var path=require(_0x6e72('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e72('0x3'));var router=express[_0x6e72('0x4')]();var auth=require(_0x6e72('0x5'));var interaction=require(_0x6e72('0x6'));var config=require(_0x6e72('0x7'));var controller=require('./voiceRecording.controller');router[_0x6e72('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6e72('0x8')]('/describe',auth[_0x6e72('0x9')](),controller[_0x6e72('0xa')]);router[_0x6e72('0x8')](_0x6e72('0xb'),auth[_0x6e72('0x9')](),controller['show']);router[_0x6e72('0x8')](_0x6e72('0xc'),auth[_0x6e72('0x9')](),controller['download']);router[_0x6e72('0x8')]('/:id/downloads',controller['downloads']);router[_0x6e72('0xd')]('/',auth['isAuthenticated'](),controller[_0x6e72('0xe')]);router[_0x6e72('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x6e72('0x10')]);router[_0x6e72('0x11')]('/:id',auth[_0x6e72('0x9')](),controller[_0x6e72('0x12')]);module['exports']=router; \ No newline at end of file +var _0x6729=['/:id/download','isAuthenticated','downloads','delete','destroy','exports','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./voiceRecording.controller','get','index','/describe','describe','/:id','show'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x6729,0xba));var _0x9672=function(_0x24c450,_0x27627d){_0x24c450=_0x24c450-0x0;var _0x187d7a=_0x6729[_0x24c450];return _0x187d7a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9672('0x0'));var timeout=require(_0x9672('0x1'));var express=require('express');var router=express[_0x9672('0x2')]();var auth=require(_0x9672('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x9672('0x4'));var controller=require(_0x9672('0x5'));router[_0x9672('0x6')]('/',auth['isAuthenticated'](),controller[_0x9672('0x7')]);router[_0x9672('0x6')](_0x9672('0x8'),auth['isAuthenticated'](),controller[_0x9672('0x9')]);router[_0x9672('0x6')](_0x9672('0xa'),auth['isAuthenticated'](),controller[_0x9672('0xb')]);router[_0x9672('0x6')](_0x9672('0xc'),auth[_0x9672('0xd')](),controller['download']);router[_0x9672('0x6')]('/:id/downloads',controller[_0x9672('0xe')]);router['post']('/',auth[_0x9672('0xd')](),controller['create']);router['put']('/:id',auth[_0x9672('0xd')](),controller['update']);router[_0x9672('0xf')]('/:id',auth[_0x9672('0xd')](),controller[_0x9672('0x10')]);module[_0x9672('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index bf9e10d..0cdaa24 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 _0xf6de=['channel','membername','STRING','INTEGER','createdAt','format','MM-DD-YYYY\x20HH:mm','toString','DATE','sequelize','moment','path','VIRTUAL','getDataValue','extname','setDataValue'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf6de,0x139));var _0xef6d=function(_0x3207aa,_0xe86a72){_0x3207aa=_0x3207aa-0x0;var _0x51758f=_0xf6de[_0x3207aa];return _0x51758f;};'use strict';var Sequelize=require(_0xef6d('0x0'));var moment=require(_0xef6d('0x1'));var path=require(_0xef6d('0x2'));module['exports']={'format':{'type':Sequelize[_0xef6d('0x3')],'get':function(){return this[_0xef6d('0x4')]('value')?path[_0xef6d('0x5')](this[_0xef6d('0x4')]('value')):undefined;}},'uniqueid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING'],'set':function(_0x14c7bf){if(_0x14c7bf){this[_0xef6d('0x6')](_0xef6d('0x7'),_0x14c7bf);this[_0xef6d('0x6')](_0xef6d('0x8'),_0x14c7bf['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xef6d('0x9')]},'calleridname':{'type':Sequelize[_0xef6d('0x9')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xef6d('0x9')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xef6d('0x9')]},'exten':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0xef6d('0x9')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize[_0xef6d('0xa')],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize[_0xef6d('0x9')]},'userDisposition':{'type':Sequelize[_0xef6d('0x9')]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xef6d('0x4')](_0xef6d('0xb')))[_0xef6d('0xc')](_0xef6d('0xd'))[_0xef6d('0xe')]();}},'updatedAt':{'type':Sequelize[_0xef6d('0xf')],'get':function(){return moment(this[_0xef6d('0x4')]('updatedAt'))['format'](_0xef6d('0xd'))[_0xef6d('0xe')]();}}}; \ No newline at end of file +var _0x2da7=['moment','path','exports','VIRTUAL','extname','getDataValue','value','STRING','setDataValue','channel','membername','split','DATE','format','MM-DD-YYYY\x20HH:mm','toString','updatedAt','sequelize'];(function(_0x4a750e,_0x5ede18){var _0x57b7cf=function(_0x393133){while(--_0x393133){_0x4a750e['push'](_0x4a750e['shift']());}};_0x57b7cf(++_0x5ede18);}(_0x2da7,0xc5));var _0x72da=function(_0x4829a5,_0x4766c3){_0x4829a5=_0x4829a5-0x0;var _0x22d951=_0x2da7[_0x4829a5];return _0x22d951;};'use strict';var Sequelize=require(_0x72da('0x0'));var moment=require(_0x72da('0x1'));var path=require(_0x72da('0x2'));module[_0x72da('0x3')]={'format':{'type':Sequelize[_0x72da('0x4')],'get':function(){return this['getDataValue']('value')?path[_0x72da('0x5')](this[_0x72da('0x6')](_0x72da('0x7'))):undefined;}},'uniqueid':{'type':Sequelize[_0x72da('0x8')]},'channel':{'type':Sequelize['STRING'],'set':function(_0x3327b8){if(_0x3327b8){this[_0x72da('0x9')](_0x72da('0xa'),_0x3327b8);this[_0x72da('0x9')](_0x72da('0xb'),_0x3327b8[_0x72da('0xc')](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x72da('0x8')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x72da('0x8')]},'connectedlinenum':{'type':Sequelize[_0x72da('0x8')]},'connectedlinename':{'type':Sequelize[_0x72da('0x8')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x72da('0x8')]},'exten':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0x72da('0x8')]},'type':{'type':Sequelize[_0x72da('0x8')]},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize[_0x72da('0x8')]},'userDisposition':{'type':Sequelize['STRING']},'createdAt':{'type':Sequelize[_0x72da('0xd')],'get':function(){return moment(this[_0x72da('0x6')]('createdAt'))[_0x72da('0xe')](_0x72da('0xf'))[_0x72da('0x10')]();}},'updatedAt':{'type':Sequelize[_0x72da('0xd')],'get':function(){return moment(this['getDataValue'](_0x72da('0x11')))[_0x72da('0xe')](_0x72da('0xf'))[_0x72da('0x10')]();}}}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.controller.js b/server/api/voiceRecording/voiceRecording.controller.js index 491133f..81dd5f5 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 _0xdbda=['end','error','stack','name','index','map','rawAttributes','type','key','model','differenceBy','format','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','field','options','VoiceRecording','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','describe','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','filename','download','extname','unlink','message','VoiceRecording\x20not\x20found','send','Not\x20found','sequelize','MD5','col','token','$and','push','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','apply','reject','update','destroy','then'];(function(_0x498e87,_0x8b9a73){var _0x2f2c4f=function(_0x1a8ac7){while(--_0x1a8ac7){_0x498e87['push'](_0x498e87['shift']());}};_0x2f2c4f(++_0x8b9a73);}(_0xdbda,0x111));var _0xadbd=function(_0x378ac5,_0x52ec15){_0x378ac5=_0x378ac5-0x0;var _0x111b50=_0xdbda[_0x378ac5];return _0x111b50;};'use strict';var pdf=require(_0xadbd('0x0'));var emlformat=require(_0xadbd('0x1'));var rimraf=require(_0xadbd('0x2'));var zipdir=require(_0xadbd('0x3'));var jsonpatch=require(_0xadbd('0x4'));var rp=require('request-promise');var moment=require(_0xadbd('0x5'));var BPromise=require(_0xadbd('0x6'));var Mustache=require(_0xadbd('0x7'));var util=require(_0xadbd('0x8'));var path=require(_0xadbd('0x9'));var sox=require(_0xadbd('0xa'));var csv=require(_0xadbd('0xb'));var ejs=require(_0xadbd('0xc'));var fs=require('fs');var _=require(_0xadbd('0xd'));var squel=require(_0xadbd('0xe'));var crypto=require(_0xadbd('0xf'));var jsforce=require(_0xadbd('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xadbd('0x11'));var Papa=require(_0xadbd('0x12'));var Redis=require(_0xadbd('0x13'));var authService=require(_0xadbd('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xadbd('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xadbd('0x16'))(_0xadbd('0x17'));var utils=require(_0xadbd('0x18'));var config=require(_0xadbd('0x19'));var db=require(_0xadbd('0x1a'))['db'];function respondWithStatusCode(_0x1eb7d2,_0x5f37e7){_0x5f37e7=_0x5f37e7||0xcc;return function(_0x35c17c){if(_0x35c17c){return _0x1eb7d2[_0xadbd('0x1b')](_0x5f37e7);}return _0x1eb7d2[_0xadbd('0x1c')](_0x5f37e7)['end']();};}function respondWithResult(_0x37c979,_0x331708){_0x331708=_0x331708||0xc8;return function(_0x5872dc){if(_0x5872dc){return _0x37c979[_0xadbd('0x1c')](_0x331708)[_0xadbd('0x1d')](_0x5872dc);}};}function respondWithFilteredResult(_0x2f2366,_0x4f6802){return function(_0x319c77){if(_0x319c77){var _0x36e232=_0x319c77[_0xadbd('0x1e')],_0x80ecf6=_0x4f6802[_0xadbd('0x1f')],_0x415ac4=_0x4f6802['offset']+_0x4f6802[_0xadbd('0x20')],_0x6f42c4;if(_0x415ac4>=_0x36e232){_0x415ac4=_0x36e232;_0x6f42c4=0xc8;}else{_0x6f42c4=0xce;}_0x2f2366['status'](_0x6f42c4);return _0x2f2366[_0xadbd('0x21')]('Content-Range',_0x80ecf6+'-'+_0x415ac4+'/'+_0x36e232)['json'](_0x319c77);}return null;};}function patchUpdates(_0x11ff14){return function(_0x4b10d7){try{jsonpatch[_0xadbd('0x22')](_0x4b10d7,_0x11ff14,!![]);}catch(_0x46af91){return BPromise[_0xadbd('0x23')](_0x46af91);}return _0x4b10d7['save']();};}function saveUpdates(_0x1d1a71,_0x42a729){return function(_0x50bcd3){if(_0x50bcd3){return _0x50bcd3[_0xadbd('0x24')](_0x1d1a71)['then'](function(_0x1e339d){return _0x1e339d;});}return null;};}function removeEntity(_0x50f946,_0x30265b){return function(_0x23c1d7){if(_0x23c1d7){return _0x23c1d7[_0xadbd('0x25')]()[_0xadbd('0x26')](function(){_0x50f946[_0xadbd('0x1c')](0xcc)[_0xadbd('0x27')]();});}};}function handleEntityNotFound(_0x5d8c3b,_0x17e4cc){return function(_0x4f7c0a){if(!_0x4f7c0a){_0x5d8c3b[_0xadbd('0x1b')](0x194);}return _0x4f7c0a;};}function handleError(_0x2b4c50,_0x3fb46f){_0x3fb46f=_0x3fb46f||0x1f4;return function(_0x4d3aa8){logger[_0xadbd('0x28')](_0x4d3aa8[_0xadbd('0x29')]);if(_0x4d3aa8[_0xadbd('0x2a')]){delete _0x4d3aa8[_0xadbd('0x2a')];}_0x2b4c50[_0xadbd('0x1c')](_0x3fb46f)['send'](_0x4d3aa8);};}exports[_0xadbd('0x2b')]=function(_0x25154c,_0x2d5851){var _0x400556={},_0x42e22d={},_0x38dd99={'count':0x0,'rows':[]};var _0x1ad883=_[_0xadbd('0x2c')](db['VoiceRecording'][_0xadbd('0x2d')],function(_0x14615a){return{'name':_0x14615a['fieldName'],'type':_0x14615a[_0xadbd('0x2e')][_0xadbd('0x2f')]};});_0x42e22d[_0xadbd('0x30')]=_[_0xadbd('0x31')](_[_0xadbd('0x2c')](_0x1ad883,_0xadbd('0x2a')),[_0xadbd('0x32')]);_0x42e22d[_0xadbd('0x33')]=_[_0xadbd('0x34')](_0x25154c[_0xadbd('0x33')]);_0x42e22d[_0xadbd('0x35')]=_[_0xadbd('0x36')](_0x42e22d[_0xadbd('0x30')],_0x42e22d[_0xadbd('0x33')]);_0x400556[_0xadbd('0x37')]=_[_0xadbd('0x36')](_0x42e22d[_0xadbd('0x30')],qs[_0xadbd('0x38')](_0x25154c[_0xadbd('0x33')][_0xadbd('0x38')]));_0x400556['attributes']=_0x400556[_0xadbd('0x37')]['length']?_0x400556[_0xadbd('0x37')]:_0x42e22d['model'];if(!_0x25154c[_0xadbd('0x33')][_0xadbd('0x39')](_0xadbd('0x3a'))){_0x400556[_0xadbd('0x20')]=qs[_0xadbd('0x20')](_0x25154c[_0xadbd('0x33')]['limit']);_0x400556[_0xadbd('0x1f')]=qs['offset'](_0x25154c[_0xadbd('0x33')][_0xadbd('0x1f')]);}_0x400556[_0xadbd('0x3b')]=qs[_0xadbd('0x3c')](_0x25154c[_0xadbd('0x33')][_0xadbd('0x3c')]);_0x400556['where']=qs[_0xadbd('0x35')](_[_0xadbd('0x3d')](_0x25154c[_0xadbd('0x33')],_0x42e22d[_0xadbd('0x35')]));if(_0x25154c[_0xadbd('0x33')][_0xadbd('0x3e')]){_0x400556['where']=_[_0xadbd('0x3f')](_0x400556[_0xadbd('0x40')],{'$or':_['map'](_0x1ad883,function(_0x31bc25){if(_0x31bc25[_0xadbd('0x2e')][_0xadbd('0x2f')]!=='VIRTUAL'){var _0x25cd06={};_0x25cd06[_0x31bc25[_0xadbd('0x41')]]={'$like':'%'+_0x25154c[_0xadbd('0x33')][_0xadbd('0x3e')]+'%'};return _0x25cd06;}})});}_0x400556=_[_0xadbd('0x3f')]({},_0x400556,_0x25154c[_0xadbd('0x42')]);var _0x2ea82c={'where':_0x400556['where']};return db[_0xadbd('0x43')][_0xadbd('0x1e')](_0x2ea82c)[_0xadbd('0x26')](function(_0x2ec2be){_0x38dd99[_0xadbd('0x1e')]=_0x2ec2be;if(_0x25154c[_0xadbd('0x33')][_0xadbd('0x44')]){_0x400556[_0xadbd('0x45')]=[{'all':!![]}];}return db[_0xadbd('0x43')][_0xadbd('0x46')](_0x400556);})[_0xadbd('0x26')](function(_0x2e0185){_0x38dd99[_0xadbd('0x47')]=_0x2e0185;return _0x38dd99;})['then'](respondWithFilteredResult(_0x2d5851,_0x400556))[_0xadbd('0x48')](handleError(_0x2d5851,null));};exports[_0xadbd('0x49')]=function(_0x2119aa,_0xf32ed1){var _0x3ee004={'raw':![],'where':{'id':_0x2119aa[_0xadbd('0x4a')]['id']}},_0x11af1f={};_0x11af1f[_0xadbd('0x30')]=_['keys'](db[_0xadbd('0x43')][_0xadbd('0x2d')]);_0x11af1f[_0xadbd('0x33')]=_[_0xadbd('0x34')](_0x2119aa['query']);_0x11af1f[_0xadbd('0x35')]=_[_0xadbd('0x36')](_0x11af1f[_0xadbd('0x30')],_0x11af1f[_0xadbd('0x33')]);_0x3ee004[_0xadbd('0x37')]=_[_0xadbd('0x36')](_0x11af1f[_0xadbd('0x30')],qs[_0xadbd('0x38')](_0x2119aa[_0xadbd('0x33')][_0xadbd('0x38')]));_0x3ee004[_0xadbd('0x37')]=_0x3ee004['attributes'][_0xadbd('0x4b')]?_0x3ee004[_0xadbd('0x37')]:_0x11af1f[_0xadbd('0x30')];if(_0x2119aa[_0xadbd('0x33')][_0xadbd('0x44')]){_0x3ee004[_0xadbd('0x45')]=[{'all':!![]}];}_0x3ee004=_[_0xadbd('0x3f')]({},_0x3ee004,_0x2119aa['options']);return db[_0xadbd('0x43')][_0xadbd('0x4c')](_0x3ee004)[_0xadbd('0x26')](handleEntityNotFound(_0xf32ed1,null))[_0xadbd('0x26')](respondWithResult(_0xf32ed1,null))[_0xadbd('0x48')](handleError(_0xf32ed1,null));};exports[_0xadbd('0x4d')]=function(_0x996cc4,_0x571f77){return db['VoiceRecording'][_0xadbd('0x4d')](_0x996cc4[_0xadbd('0x4e')],{})[_0xadbd('0x26')](respondWithResult(_0x571f77,0xc9))[_0xadbd('0x48')](handleError(_0x571f77,null));};exports['update']=function(_0x4642a1,_0x2ce849){if(_0x4642a1['body']['id']){delete _0x4642a1['body']['id'];}return db[_0xadbd('0x43')][_0xadbd('0x4c')]({'where':{'id':_0x4642a1['params']['id']}})['then'](handleEntityNotFound(_0x2ce849,null))[_0xadbd('0x26')](saveUpdates(_0x4642a1[_0xadbd('0x4e')],null))[_0xadbd('0x26')](respondWithResult(_0x2ce849,null))[_0xadbd('0x48')](handleError(_0x2ce849,null));};exports[_0xadbd('0x25')]=function(_0x2d5b35,_0x30252d){return db[_0xadbd('0x43')][_0xadbd('0x4c')]({'where':{'id':_0x2d5b35[_0xadbd('0x4a')]['id']}})[_0xadbd('0x26')](handleEntityNotFound(_0x30252d,null))[_0xadbd('0x26')](removeEntity(_0x30252d,null))[_0xadbd('0x48')](handleError(_0x30252d,null));};exports['describe']=function(_0x711ebe,_0x19ffec){return db[_0xadbd('0x43')][_0xadbd('0x4f')]()[_0xadbd('0x26')](respondWithResult(_0x19ffec,null))[_0xadbd('0x48')](handleError(_0x19ffec,null));};exports['download']=function(_0x396587,_0xcc87f2,_0x2f6477){var _0x5b6d04=require(_0xadbd('0x50'));var _0xd11597=![];var _0x51b6e8={};if(_0x396587['query'][_0xadbd('0x2e')]&&_0x396587[_0xadbd('0x33')][_0xadbd('0x2e')]==='uniqueid'){_0x51b6e8[_0xadbd('0x51')]=_0x396587[_0xadbd('0x4a')]['id'];}else{_0x51b6e8['id']=_0x396587['params']['id'];}return db['VoiceRecording'][_0xadbd('0x4c')]({'where':_0x51b6e8,'attributes':['id','value'],'raw':!![]})[_0xadbd('0x26')](handleEntityNotFound(_0xcc87f2,null))[_0xadbd('0x26')](function(_0x2467f4){if(_0x2467f4){var _0x4cef53=_0x2467f4[_0xadbd('0x52')];var _0x53c1e4=util[_0xadbd('0x32')](_0xadbd('0x53'),_0x4cef53);if(fs[_0xadbd('0x54')](_0x53c1e4)){_0xd11597=!![];return _0x5b6d04[_0xadbd('0x55')](_0x53c1e4,_0x4cef53,config[_0xadbd('0x56')][_0xadbd('0x57')])[_0xadbd('0x26')](function(){return _0x2467f4;});}return _0x2467f4;}})['then'](function(_0x5cb98d){if(_0x5cb98d){var _0x267364=_0x5cb98d[_0xadbd('0x52')];if(!fs[_0xadbd('0x54')](_0x267364)){throw new db[(_0xadbd('0x58'))][(_0xadbd('0x59'))]('VoiceRecording\x20not\x20found');}if(_0x5cb98d[_0xadbd('0x5a')]){return _0xcc87f2[_0xadbd('0x5b')](_0x267364,_0x5cb98d['filename']+path[_0xadbd('0x5c')](_0x267364),function(){if(_0xd11597){fs[_0xadbd('0x5d')](_0x267364);}});}else{return _0xcc87f2[_0xadbd('0x5b')](_0x267364,function(_0x35227d){if(_0xd11597){fs[_0xadbd('0x5d')](_0x267364);}});}}})[_0xadbd('0x48')](function(_0x17736d){if(_0x17736d[_0xadbd('0x5e')]===_0xadbd('0x5f')){_0xcc87f2[_0xadbd('0x1c')](0x194)[_0xadbd('0x60')](_0xadbd('0x61'));}else{return handleError(_0xcc87f2,null);}});};exports['downloads']=function(_0x4a5783,_0x2fbd79,_0x191835){var _0x2e0778=require('../../components/encryptor');var _0x3ee734=![];var _0x4b1431={'$and':[db['sequelize'][_0xadbd('0x40')](db[_0xadbd('0x62')]['fn'](_0xadbd('0x63'),db[_0xadbd('0x62')][_0xadbd('0x64')](_0xadbd('0x51'))),_0x4a5783[_0xadbd('0x33')][_0xadbd('0x65')])]};if(_0x4a5783[_0xadbd('0x33')][_0xadbd('0x2e')]&&_0x4a5783[_0xadbd('0x33')][_0xadbd('0x2e')]==='uniqueid'){_0x4b1431[_0xadbd('0x66')]['push']({'uniqueid':_0x4a5783['params']['id']});}else{_0x4b1431['$and'][_0xadbd('0x67')]({'id':_0x4a5783[_0xadbd('0x4a')]['id']});}return db[_0xadbd('0x43')][_0xadbd('0x4c')]({'where':_0x4b1431,'attributes':['id',_0xadbd('0x52')],'raw':!![]})['then'](handleEntityNotFound(_0x2fbd79,null))['then'](function(_0x13f5a5){if(_0x13f5a5){var _0x597126=util[_0xadbd('0x32')](_0xadbd('0x53'),_0x13f5a5[_0xadbd('0x52')]);if(fs['existsSync'](_0x597126)){_0x3ee734=!![];return _0x2e0778[_0xadbd('0x55')](_0x597126,_0x13f5a5['value'],config[_0xadbd('0x56')][_0xadbd('0x57')])['then'](function(){return _0x13f5a5;});}return _0x13f5a5;}})[_0xadbd('0x26')](function(_0x4bdb69){if(_0x4bdb69){if(!fs[_0xadbd('0x54')](_0x4bdb69['value'])){throw new db[(_0xadbd('0x58'))][(_0xadbd('0x59'))](_0xadbd('0x5f'));}if(_0x4bdb69[_0xadbd('0x5a')]){return _0x2fbd79[_0xadbd('0x5b')](_0x4bdb69[_0xadbd('0x52')],_0x4bdb69['filename']+path[_0xadbd('0x5c')](_0x4bdb69['value']),function(){if(_0x3ee734){fs[_0xadbd('0x5d')](_0x4bdb69[_0xadbd('0x52')]);}});}else{return _0x2fbd79['download'](_0x4bdb69[_0xadbd('0x52')],function(_0x5cfdc3){if(_0x3ee734){fs[_0xadbd('0x5d')](_0x4bdb69['value']);}});}}})[_0xadbd('0x48')](handleError(_0x2fbd79,null));}; \ No newline at end of file +var _0x9ba8=['../../components/encryptor','uniqueid','value','%s.cypher','existsSync','decryptFile','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','sequelize','MD5','col','token','$and','push','secrets','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','status','json','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','name','send','index','map','VoiceRecording','rawAttributes','type','key','format','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','offset','sort','where','pick','filter','merge','VIRTUAL','field','options','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','download'];(function(_0x3ce3e7,_0x865ef1){var _0x23c4ae=function(_0x9c0bb6){while(--_0x9c0bb6){_0x3ce3e7['push'](_0x3ce3e7['shift']());}};_0x23c4ae(++_0x865ef1);}(_0x9ba8,0xd6));var _0x89ba=function(_0x4528cf,_0x3b1892){_0x4528cf=_0x4528cf-0x0;var _0x4bca53=_0x9ba8[_0x4528cf];return _0x4bca53;};'use strict';var pdf=require(_0x89ba('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x89ba('0x1'));var zipdir=require(_0x89ba('0x2'));var jsonpatch=require(_0x89ba('0x3'));var rp=require(_0x89ba('0x4'));var moment=require('moment');var BPromise=require(_0x89ba('0x5'));var Mustache=require(_0x89ba('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x89ba('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x89ba('0x8'));var squel=require(_0x89ba('0x9'));var crypto=require('crypto');var jsforce=require(_0x89ba('0xa'));var deskjs=require(_0x89ba('0xb'));var toCsv=require(_0x89ba('0x7'));var querystring=require(_0x89ba('0xc'));var Papa=require(_0x89ba('0xd'));var Redis=require(_0x89ba('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x89ba('0xf'));var as=require(_0x89ba('0x10'));var hardwareService=require(_0x89ba('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x89ba('0x12'));var config=require(_0x89ba('0x13'));var db=require(_0x89ba('0x14'))['db'];function respondWithStatusCode(_0x40bec1,_0x461626){_0x461626=_0x461626||0xcc;return function(_0x4204f3){if(_0x4204f3){return _0x40bec1['sendStatus'](_0x461626);}return _0x40bec1['status'](_0x461626)['end']();};}function respondWithResult(_0x42bad5,_0x4798fa){_0x4798fa=_0x4798fa||0xc8;return function(_0x31bd18){if(_0x31bd18){return _0x42bad5[_0x89ba('0x15')](_0x4798fa)[_0x89ba('0x16')](_0x31bd18);}};}function respondWithFilteredResult(_0x178ee0,_0x2b7bae){return function(_0x3e1968){if(_0x3e1968){var _0x685f89=_0x3e1968['count'],_0x9b90d4=_0x2b7bae['offset'],_0x505009=_0x2b7bae['offset']+_0x2b7bae[_0x89ba('0x17')],_0x195d66;if(_0x505009>=_0x685f89){_0x505009=_0x685f89;_0x195d66=0xc8;}else{_0x195d66=0xce;}_0x178ee0['status'](_0x195d66);return _0x178ee0[_0x89ba('0x18')](_0x89ba('0x19'),_0x9b90d4+'-'+_0x505009+'/'+_0x685f89)['json'](_0x3e1968);}return null;};}function patchUpdates(_0x524ec0){return function(_0x12ce7d){try{jsonpatch[_0x89ba('0x1a')](_0x12ce7d,_0x524ec0,!![]);}catch(_0x12507d){return BPromise[_0x89ba('0x1b')](_0x12507d);}return _0x12ce7d[_0x89ba('0x1c')]();};}function saveUpdates(_0x4bbaa6,_0x1c0772){return function(_0x1c8425){if(_0x1c8425){return _0x1c8425[_0x89ba('0x1d')](_0x4bbaa6)[_0x89ba('0x1e')](function(_0x39af14){return _0x39af14;});}return null;};}function removeEntity(_0x6637f8,_0x265db6){return function(_0x43796c){if(_0x43796c){return _0x43796c[_0x89ba('0x1f')]()[_0x89ba('0x1e')](function(){_0x6637f8[_0x89ba('0x15')](0xcc)[_0x89ba('0x20')]();});}};}function handleEntityNotFound(_0x584b4d,_0x3c4362){return function(_0x32135c){if(!_0x32135c){_0x584b4d[_0x89ba('0x21')](0x194);}return _0x32135c;};}function handleError(_0x4d2b13,_0xbdd4e8){_0xbdd4e8=_0xbdd4e8||0x1f4;return function(_0x12a0ef){logger['error'](_0x12a0ef['stack']);if(_0x12a0ef['name']){delete _0x12a0ef[_0x89ba('0x22')];}_0x4d2b13[_0x89ba('0x15')](_0xbdd4e8)[_0x89ba('0x23')](_0x12a0ef);};}exports[_0x89ba('0x24')]=function(_0x131d67,_0x343580){var _0x3d45f6={},_0x251690={},_0x4d9fe6={'count':0x0,'rows':[]};var _0x434150=_[_0x89ba('0x25')](db[_0x89ba('0x26')][_0x89ba('0x27')],function(_0x4e2c6e){return{'name':_0x4e2c6e['fieldName'],'type':_0x4e2c6e[_0x89ba('0x28')][_0x89ba('0x29')]};});_0x251690['model']=_['differenceBy'](_[_0x89ba('0x25')](_0x434150,_0x89ba('0x22')),[_0x89ba('0x2a')]);_0x251690[_0x89ba('0x2b')]=_[_0x89ba('0x2c')](_0x131d67[_0x89ba('0x2b')]);_0x251690[_0x89ba('0x2d')]=_[_0x89ba('0x2e')](_0x251690[_0x89ba('0x2f')],_0x251690[_0x89ba('0x2b')]);_0x3d45f6[_0x89ba('0x30')]=_['intersection'](_0x251690[_0x89ba('0x2f')],qs[_0x89ba('0x31')](_0x131d67['query'][_0x89ba('0x31')]));_0x3d45f6[_0x89ba('0x30')]=_0x3d45f6[_0x89ba('0x30')][_0x89ba('0x32')]?_0x3d45f6[_0x89ba('0x30')]:_0x251690[_0x89ba('0x2f')];if(!_0x131d67[_0x89ba('0x2b')][_0x89ba('0x33')]('nolimit')){_0x3d45f6[_0x89ba('0x17')]=qs['limit'](_0x131d67[_0x89ba('0x2b')][_0x89ba('0x17')]);_0x3d45f6[_0x89ba('0x34')]=qs[_0x89ba('0x34')](_0x131d67[_0x89ba('0x2b')][_0x89ba('0x34')]);}_0x3d45f6['order']=qs[_0x89ba('0x35')](_0x131d67['query'][_0x89ba('0x35')]);_0x3d45f6[_0x89ba('0x36')]=qs[_0x89ba('0x2d')](_[_0x89ba('0x37')](_0x131d67[_0x89ba('0x2b')],_0x251690[_0x89ba('0x2d')]));if(_0x131d67[_0x89ba('0x2b')][_0x89ba('0x38')]){_0x3d45f6[_0x89ba('0x36')]=_[_0x89ba('0x39')](_0x3d45f6['where'],{'$or':_[_0x89ba('0x25')](_0x434150,function(_0x428abc){if(_0x428abc[_0x89ba('0x28')][_0x89ba('0x29')]!==_0x89ba('0x3a')){var _0x3c6ebd={};_0x3c6ebd[_0x428abc[_0x89ba('0x3b')]]={'$like':'%'+_0x131d67[_0x89ba('0x2b')][_0x89ba('0x38')]+'%'};return _0x3c6ebd;}})});}_0x3d45f6=_[_0x89ba('0x39')]({},_0x3d45f6,_0x131d67[_0x89ba('0x3c')]);var _0x3f8917={'where':_0x3d45f6[_0x89ba('0x36')]};return db[_0x89ba('0x26')][_0x89ba('0x3d')](_0x3f8917)[_0x89ba('0x1e')](function(_0x3bd6dd){_0x4d9fe6[_0x89ba('0x3d')]=_0x3bd6dd;if(_0x131d67['query'][_0x89ba('0x3e')]){_0x3d45f6[_0x89ba('0x3f')]=[{'all':!![]}];}return db[_0x89ba('0x26')][_0x89ba('0x40')](_0x3d45f6);})[_0x89ba('0x1e')](function(_0x3e26e3){_0x4d9fe6[_0x89ba('0x41')]=_0x3e26e3;return _0x4d9fe6;})[_0x89ba('0x1e')](respondWithFilteredResult(_0x343580,_0x3d45f6))[_0x89ba('0x42')](handleError(_0x343580,null));};exports[_0x89ba('0x43')]=function(_0x2ba03f,_0x40e4fb){var _0xe7cc23={'raw':![],'where':{'id':_0x2ba03f[_0x89ba('0x44')]['id']}},_0x32c78f={};_0x32c78f['model']=_['keys'](db[_0x89ba('0x26')][_0x89ba('0x27')]);_0x32c78f[_0x89ba('0x2b')]=_[_0x89ba('0x2c')](_0x2ba03f[_0x89ba('0x2b')]);_0x32c78f[_0x89ba('0x2d')]=_[_0x89ba('0x2e')](_0x32c78f[_0x89ba('0x2f')],_0x32c78f['query']);_0xe7cc23[_0x89ba('0x30')]=_[_0x89ba('0x2e')](_0x32c78f[_0x89ba('0x2f')],qs[_0x89ba('0x31')](_0x2ba03f['query'][_0x89ba('0x31')]));_0xe7cc23[_0x89ba('0x30')]=_0xe7cc23[_0x89ba('0x30')]['length']?_0xe7cc23[_0x89ba('0x30')]:_0x32c78f[_0x89ba('0x2f')];if(_0x2ba03f[_0x89ba('0x2b')][_0x89ba('0x3e')]){_0xe7cc23[_0x89ba('0x3f')]=[{'all':!![]}];}_0xe7cc23=_[_0x89ba('0x39')]({},_0xe7cc23,_0x2ba03f[_0x89ba('0x3c')]);return db[_0x89ba('0x26')][_0x89ba('0x45')](_0xe7cc23)[_0x89ba('0x1e')](handleEntityNotFound(_0x40e4fb,null))['then'](respondWithResult(_0x40e4fb,null))[_0x89ba('0x42')](handleError(_0x40e4fb,null));};exports[_0x89ba('0x46')]=function(_0x285087,_0x474dd8){return db[_0x89ba('0x26')][_0x89ba('0x46')](_0x285087[_0x89ba('0x47')],{})[_0x89ba('0x1e')](respondWithResult(_0x474dd8,0xc9))[_0x89ba('0x42')](handleError(_0x474dd8,null));};exports[_0x89ba('0x1d')]=function(_0x24fe6e,_0x4d0aaa){if(_0x24fe6e[_0x89ba('0x47')]['id']){delete _0x24fe6e['body']['id'];}return db[_0x89ba('0x26')]['find']({'where':{'id':_0x24fe6e[_0x89ba('0x44')]['id']}})['then'](handleEntityNotFound(_0x4d0aaa,null))[_0x89ba('0x1e')](saveUpdates(_0x24fe6e[_0x89ba('0x47')],null))[_0x89ba('0x1e')](respondWithResult(_0x4d0aaa,null))[_0x89ba('0x42')](handleError(_0x4d0aaa,null));};exports['destroy']=function(_0x112d6d,_0xa8c103){return db['VoiceRecording'][_0x89ba('0x45')]({'where':{'id':_0x112d6d[_0x89ba('0x44')]['id']}})[_0x89ba('0x1e')](handleEntityNotFound(_0xa8c103,null))[_0x89ba('0x1e')](removeEntity(_0xa8c103,null))[_0x89ba('0x42')](handleError(_0xa8c103,null));};exports[_0x89ba('0x48')]=function(_0x723b28,_0x4914c6){return db[_0x89ba('0x26')]['describe']()[_0x89ba('0x1e')](respondWithResult(_0x4914c6,null))[_0x89ba('0x42')](handleError(_0x4914c6,null));};exports[_0x89ba('0x49')]=function(_0x151622,_0xb9429e,_0x18d232){var _0x515866=require(_0x89ba('0x4a'));var _0x232d2a=![];var _0x412f03={};if(_0x151622[_0x89ba('0x2b')][_0x89ba('0x28')]&&_0x151622[_0x89ba('0x2b')][_0x89ba('0x28')]===_0x89ba('0x4b')){_0x412f03['uniqueid']=_0x151622[_0x89ba('0x44')]['id'];}else{_0x412f03['id']=_0x151622[_0x89ba('0x44')]['id'];}return db[_0x89ba('0x26')][_0x89ba('0x45')]({'where':_0x412f03,'attributes':['id',_0x89ba('0x4c')],'raw':!![]})[_0x89ba('0x1e')](handleEntityNotFound(_0xb9429e,null))[_0x89ba('0x1e')](function(_0x1a67ff){if(_0x1a67ff){var _0x199b6c=_0x1a67ff[_0x89ba('0x4c')];var _0x1095cc=util[_0x89ba('0x2a')](_0x89ba('0x4d'),_0x199b6c);if(fs[_0x89ba('0x4e')](_0x1095cc)){_0x232d2a=!![];return _0x515866[_0x89ba('0x4f')](_0x1095cc,_0x199b6c,config['secrets'][_0x89ba('0x50')])[_0x89ba('0x1e')](function(){return _0x1a67ff;});}return _0x1a67ff;}})['then'](function(_0x3e87bd){if(_0x3e87bd){var _0x4d7dec=_0x3e87bd['value'];if(!fs['existsSync'](_0x4d7dec)){throw new db[(_0x89ba('0x51'))][(_0x89ba('0x52'))](_0x89ba('0x53'));}if(_0x3e87bd[_0x89ba('0x54')]){return _0xb9429e[_0x89ba('0x49')](_0x4d7dec,_0x3e87bd['filename']+path[_0x89ba('0x55')](_0x4d7dec),function(){if(_0x232d2a){fs[_0x89ba('0x56')](_0x4d7dec);}});}else{return _0xb9429e[_0x89ba('0x49')](_0x4d7dec,function(_0x46f7ff){if(_0x232d2a){fs[_0x89ba('0x56')](_0x4d7dec);}});}}})['catch'](function(_0x370add){if(_0x370add[_0x89ba('0x57')]===_0x89ba('0x53')){_0xb9429e[_0x89ba('0x15')](0x194)['send'](_0x89ba('0x58'));}else{return handleError(_0xb9429e,null);}});};exports['downloads']=function(_0x3a63b6,_0x617c15,_0x4f5d02){var _0x3f3193=require(_0x89ba('0x4a'));var _0x5b141d=![];var _0x529ba0={'$and':[db[_0x89ba('0x59')]['where'](db[_0x89ba('0x59')]['fn'](_0x89ba('0x5a'),db[_0x89ba('0x59')][_0x89ba('0x5b')]('uniqueid')),_0x3a63b6[_0x89ba('0x2b')][_0x89ba('0x5c')])]};if(_0x3a63b6[_0x89ba('0x2b')][_0x89ba('0x28')]&&_0x3a63b6[_0x89ba('0x2b')]['type']===_0x89ba('0x4b')){_0x529ba0[_0x89ba('0x5d')][_0x89ba('0x5e')]({'uniqueid':_0x3a63b6[_0x89ba('0x44')]['id']});}else{_0x529ba0['$and']['push']({'id':_0x3a63b6[_0x89ba('0x44')]['id']});}return db['VoiceRecording'][_0x89ba('0x45')]({'where':_0x529ba0,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x617c15,null))[_0x89ba('0x1e')](function(_0x31bcae){if(_0x31bcae){var _0x2230fd=util[_0x89ba('0x2a')]('%s.cypher',_0x31bcae[_0x89ba('0x4c')]);if(fs[_0x89ba('0x4e')](_0x2230fd)){_0x5b141d=!![];return _0x3f3193[_0x89ba('0x4f')](_0x2230fd,_0x31bcae[_0x89ba('0x4c')],config[_0x89ba('0x5f')]['recording'])[_0x89ba('0x1e')](function(){return _0x31bcae;});}return _0x31bcae;}})[_0x89ba('0x1e')](function(_0x54514e){if(_0x54514e){if(!fs[_0x89ba('0x4e')](_0x54514e[_0x89ba('0x4c')])){throw new db[(_0x89ba('0x51'))][(_0x89ba('0x52'))](_0x89ba('0x53'));}if(_0x54514e['filename']){return _0x617c15[_0x89ba('0x49')](_0x54514e[_0x89ba('0x4c')],_0x54514e['filename']+path[_0x89ba('0x55')](_0x54514e[_0x89ba('0x4c')]),function(){if(_0x5b141d){fs['unlink'](_0x54514e[_0x89ba('0x4c')]);}});}else{return _0x617c15['download'](_0x54514e[_0x89ba('0x4c')],function(_0x147dae){if(_0x5b141d){fs[_0x89ba('0x56')](_0x54514e[_0x89ba('0x4c')]);}});}}})['catch'](handleError(_0x617c15,null));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index e7478a2..e4a5138 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 _0x7d2b=['define','VoiceRecording','voice_recordings','uniqueid','lodash','../../config/logger','moment','bluebird','rimraf','./voiceRecording.attributes'];(function(_0x4aa906,_0x487be7){var _0x1c23a2=function(_0x5b7d46){while(--_0x5b7d46){_0x4aa906['push'](_0x4aa906['shift']());}};_0x1c23a2(++_0x487be7);}(_0x7d2b,0x14e));var _0xb7d2=function(_0x2d8cec,_0xa01e98){_0x2d8cec=_0x2d8cec-0x0;var _0x161a6b=_0x7d2b[_0x2d8cec];return _0x161a6b;};'use strict';var _=require(_0xb7d2('0x0'));var util=require('util');var logger=require(_0xb7d2('0x1'))('api');var moment=require(_0xb7d2('0x2'));var BPromise=require(_0xb7d2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb7d2('0x4'));var config=require('../../config/environment');var attributes=require(_0xb7d2('0x5'));module['exports']=function(_0x4960bc,_0x31bd66){return _0x4960bc[_0xb7d2('0x6')](_0xb7d2('0x7'),attributes,{'tableName':_0xb7d2('0x8'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xb7d2('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x43d0=['./voiceRecording.attributes','exports','define','VoiceRecording','voice_recordings','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x148c09,_0x4fd39f){var _0x18e613=function(_0xfaa810){while(--_0xfaa810){_0x148c09['push'](_0x148c09['shift']());}};_0x18e613(++_0x4fd39f);}(_0x43d0,0x185));var _0x043d=function(_0x580971,_0x10984d){_0x580971=_0x580971-0x0;var _0x16d873=_0x43d0[_0x580971];return _0x16d873;};'use strict';var _=require('lodash');var util=require(_0x043d('0x0'));var logger=require(_0x043d('0x1'))(_0x043d('0x2'));var moment=require(_0x043d('0x3'));var BPromise=require('bluebird');var rp=require(_0x043d('0x4'));var fs=require('fs');var path=require(_0x043d('0x5'));var rimraf=require(_0x043d('0x6'));var config=require('../../config/environment');var attributes=require(_0x043d('0x7'));module[_0x043d('0x8')]=function(_0x3067ac,_0x21ac0c){return _0x3067ac[_0x043d('0x9')](_0x043d('0xa'),attributes,{'tableName':_0x043d('0xb'),'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 c510182..56b12a8 100644 --- a/server/api/voiceRecording/voiceRecording.rpc.js +++ b/server/api/voiceRecording/voiceRecording.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['findOne','callRecordingEncryption','create','existsSync','value','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','VoiceRecording','update','body','options','raw','then','UpdateVoiceRecording','stringify','CreateVoiceRecording'];(function(_0x531e48,_0x4bb96b){var _0x202971=function(_0x403bf5){while(--_0x403bf5){_0x531e48['push'](_0x531e48['shift']());}};_0x202971(++_0x4bb96b);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['UpdateVoiceRecording']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')](_0x459eb1[_0x0a9e('0x16')],{'raw':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')][_0x0a9e('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')]['where']||null:null,'attributes':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')]['attributes']||null:null,'limit':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1['options']['limit']||null:null})[_0x0a9e('0x19')](function(_0x432e56){logger[_0x0a9e('0xa')](_0x0a9e('0x1a'),_0x459eb1);logger['debug'](_0x0a9e('0x1a'),_0x459eb1,JSON[_0x0a9e('0x1b')](_0x432e56));_0x106033(_0x432e56);})[_0x0a9e('0x13')](function(_0x4d00e6){logger[_0x0a9e('0x10')](_0x0a9e('0x1a'),_0x4d00e6[_0x0a9e('0x11')],_0x459eb1);_0x205fd6(_0x478723['error'](0x1f4,_0x4d00e6['message']));});});};exports[_0x0a9e('0x1c')]=function(_0x3a8e58){var _0x40c424=this;return new Promise(function(_0x33161b,_0x526cf3){var _0x384319=require('../../components/encryptor');var _0x45a1e7;return db['Setting'][_0x0a9e('0x1d')]({'attributes':['id',_0x0a9e('0x1e')],'where':{'id':0x1},'raw':!![]})[_0x0a9e('0x19')](function(_0x14433c){_0x45a1e7=_0x14433c;return db[_0x0a9e('0x14')][_0x0a9e('0x1f')](_0x3a8e58[_0x0a9e('0x16')]);})[_0x0a9e('0x19')](function(_0x5a101a){if(_0x45a1e7[_0x0a9e('0x1e')]&&fs[_0x0a9e('0x20')](_0x5a101a[_0x0a9e('0x21')])){var _0x2ec755=util['format'](_0x0a9e('0x22'),_0x5a101a[_0x0a9e('0x21')]);return _0x384319[_0x0a9e('0x23')](_0x5a101a[_0x0a9e('0x21')],_0x2ec755,config[_0x0a9e('0x24')][_0x0a9e('0x25')])[_0x0a9e('0x19')](function(){fs[_0x0a9e('0x26')](_0x5a101a[_0x0a9e('0x21')]);logger['info'](_0x0a9e('0x27'));return _0x5a101a;});}return _0x5a101a;})['then'](function(_0x2407f9){logger[_0x0a9e('0xa')](_0x0a9e('0x1c'),_0x3a8e58);logger[_0x0a9e('0xd')](_0x0a9e('0x1c'),_0x3a8e58,JSON['stringify'](_0x2407f9));_0x33161b(_0x2407f9);})[_0x0a9e('0x13')](function(_0x46f0a5){logger[_0x0a9e('0x10')](_0x0a9e('0x1c'),_0x46f0a5[_0x0a9e('0x11')],_0x3a8e58);_0x526cf3(_0x40c424[_0x0a9e('0x10')](0x1f4,_0x46f0a5[_0x0a9e('0x11')]));});});}; \ No newline at end of file +var _0xa9e0=['findOne','callRecordingEncryption','create','existsSync','value','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','VoiceRecording','update','body','options','raw','then','UpdateVoiceRecording','stringify','CreateVoiceRecording'];(function(_0x135f1f,_0x45e875){var _0x547ed6=function(_0x466b4c){while(--_0x466b4c){_0x135f1f['push'](_0x135f1f['shift']());}};_0x547ed6(++_0x45e875);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['UpdateVoiceRecording']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')](_0x459eb1[_0x0a9e('0x16')],{'raw':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')][_0x0a9e('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')]['where']||null:null,'attributes':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')]['attributes']||null:null,'limit':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1['options']['limit']||null:null})[_0x0a9e('0x19')](function(_0x432e56){logger[_0x0a9e('0xa')](_0x0a9e('0x1a'),_0x459eb1);logger['debug'](_0x0a9e('0x1a'),_0x459eb1,JSON[_0x0a9e('0x1b')](_0x432e56));_0x106033(_0x432e56);})[_0x0a9e('0x13')](function(_0x4d00e6){logger[_0x0a9e('0x10')](_0x0a9e('0x1a'),_0x4d00e6[_0x0a9e('0x11')],_0x459eb1);_0x205fd6(_0x478723['error'](0x1f4,_0x4d00e6['message']));});});};exports[_0x0a9e('0x1c')]=function(_0x3a8e58){var _0x40c424=this;return new Promise(function(_0x33161b,_0x526cf3){var _0x384319=require('../../components/encryptor');var _0x45a1e7;return db['Setting'][_0x0a9e('0x1d')]({'attributes':['id',_0x0a9e('0x1e')],'where':{'id':0x1},'raw':!![]})[_0x0a9e('0x19')](function(_0x14433c){_0x45a1e7=_0x14433c;return db[_0x0a9e('0x14')][_0x0a9e('0x1f')](_0x3a8e58[_0x0a9e('0x16')]);})[_0x0a9e('0x19')](function(_0x5a101a){if(_0x45a1e7[_0x0a9e('0x1e')]&&fs[_0x0a9e('0x20')](_0x5a101a[_0x0a9e('0x21')])){var _0x2ec755=util['format'](_0x0a9e('0x22'),_0x5a101a[_0x0a9e('0x21')]);return _0x384319[_0x0a9e('0x23')](_0x5a101a[_0x0a9e('0x21')],_0x2ec755,config[_0x0a9e('0x24')][_0x0a9e('0x25')])[_0x0a9e('0x19')](function(){fs[_0x0a9e('0x26')](_0x5a101a[_0x0a9e('0x21')]);logger['info'](_0x0a9e('0x27'));return _0x5a101a;});}return _0x5a101a;})['then'](function(_0x2407f9){logger[_0x0a9e('0xa')](_0x0a9e('0x1c'),_0x3a8e58);logger[_0x0a9e('0xd')](_0x0a9e('0x1c'),_0x3a8e58,JSON['stringify'](_0x2407f9));_0x33161b(_0x2407f9);})[_0x0a9e('0x13')](function(_0x46f0a5){logger[_0x0a9e('0x10')](_0x0a9e('0x1c'),_0x46f0a5[_0x0a9e('0x11')],_0x3a8e58);_0x526cf3(_0x40c424[_0x0a9e('0x10')](0x1f4,_0x46f0a5[_0x0a9e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index f79b5e0..c489fb6 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 _0xba34=['get','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','../../config/environment','./voiceTransferReport.controller'];(function(_0x1b71de,_0x346936){var _0x2a4f4d=function(_0x544ce7){while(--_0x544ce7){_0x1b71de['push'](_0x1b71de['shift']());}};_0x2a4f4d(++_0x346936);}(_0xba34,0x119));var _0x4ba3=function(_0x13c837,_0x4293e9){_0x13c837=_0x13c837-0x0;var _0x1e9a54=_0xba34[_0x13c837];return _0x1e9a54;};'use strict';var multer=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var path=require(_0x4ba3('0x2'));var timeout=require(_0x4ba3('0x3'));var express=require(_0x4ba3('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4ba3('0x5'));var controller=require(_0x4ba3('0x6'));router[_0x4ba3('0x7')]('/',auth[_0x4ba3('0x8')](),controller[_0x4ba3('0x9')]);router[_0x4ba3('0x7')](_0x4ba3('0xa'),auth['isAuthenticated'](),controller[_0x4ba3('0xb')]);router[_0x4ba3('0xc')]('/',auth[_0x4ba3('0x8')](),controller[_0x4ba3('0xd')]);router[_0x4ba3('0xe')](_0x4ba3('0xa'),auth[_0x4ba3('0x8')](),controller[_0x4ba3('0xf')]);router[_0x4ba3('0x10')](_0x4ba3('0xa'),auth[_0x4ba3('0x8')](),controller['destroy']);module[_0x4ba3('0x11')]=router; \ No newline at end of file +var _0x01d9=['../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service'];(function(_0x171520,_0x1cee8c){var _0x3cc729=function(_0x201c4a){while(--_0x201c4a){_0x171520['push'](_0x171520['shift']());}};_0x3cc729(++_0x1cee8c);}(_0x01d9,0x6c));var _0x901d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x01d9[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x901d('0x0'));var util=require(_0x901d('0x1'));var path=require(_0x901d('0x2'));var timeout=require(_0x901d('0x3'));var express=require('express');var router=express[_0x901d('0x4')]();var auth=require(_0x901d('0x5'));var interaction=require(_0x901d('0x6'));var config=require(_0x901d('0x7'));var controller=require(_0x901d('0x8'));router[_0x901d('0x9')]('/',auth[_0x901d('0xa')](),controller['index']);router[_0x901d('0x9')](_0x901d('0xb'),auth[_0x901d('0xa')](),controller[_0x901d('0xc')]);router[_0x901d('0xd')]('/',auth[_0x901d('0xa')](),controller[_0x901d('0xe')]);router[_0x901d('0xf')](_0x901d('0xb'),auth[_0x901d('0xa')](),controller[_0x901d('0x10')]);router[_0x901d('0x11')](_0x901d('0xb'),auth['isAuthenticated'](),controller[_0x901d('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 8c73004..d9f8bfb 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 _0xec25=['attended','STRING','Yes','sequelize','moment','blind'];(function(_0x154296,_0x1215fe){var _0x579ad1=function(_0xe56bf4){while(--_0xe56bf4){_0x154296['push'](_0x154296['shift']());}};_0x579ad1(++_0x1215fe);}(_0xec25,0x171));var _0x5ec2=function(_0x50ef68,_0x179185){_0x50ef68=_0x50ef68-0x0;var _0x2c55f5=_0xec25[_0x50ef68];return _0x2c55f5;};'use strict';var Sequelize=require(_0x5ec2('0x0'));var moment=require(_0x5ec2('0x1'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x5ec2('0x2'),_0x5ec2('0x3'))},'result':{'type':Sequelize[_0x5ec2('0x4')]},'transfererchannel':{'type':Sequelize[_0x5ec2('0x4')]},'transferercalleridnum':{'type':Sequelize[_0x5ec2('0x4')]},'transferercalleridname':{'type':Sequelize[_0x5ec2('0x4')]},'transfererconnectedlinenum':{'type':Sequelize[_0x5ec2('0x4')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0x5ec2('0x4')]},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0x5ec2('0x4')]},'transfereechannel':{'type':Sequelize[_0x5ec2('0x4')]},'transfereecalleridnum':{'type':Sequelize[_0x5ec2('0x4')]},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize[_0x5ec2('0x4')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize[_0x5ec2('0x4')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0x5ec2('0x4')]},'transfereelinkedid':{'type':Sequelize[_0x5ec2('0x4')]},'isexternal':{'type':Sequelize['ENUM'](_0x5ec2('0x5'),'No')},'context':{'type':Sequelize[_0x5ec2('0x4')]},'extension':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4c9a=['sequelize','blind','STRING'];(function(_0x14af02,_0x404485){var _0x53a7a6=function(_0x11e47f){while(--_0x11e47f){_0x14af02['push'](_0x14af02['shift']());}};_0x53a7a6(++_0x404485);}(_0x4c9a,0x1a1));var _0xa4c9=function(_0x968e1f,_0x4e487f){_0x968e1f=_0x968e1f-0x0;var _0x5ca62d=_0x4c9a[_0x968e1f];return _0x5ca62d;};'use strict';var Sequelize=require(_0xa4c9('0x0'));var moment=require('moment');module['exports']={'type':{'type':Sequelize['ENUM'](_0xa4c9('0x1'),'attended')},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize[_0xa4c9('0x2')]},'transferercalleridname':{'type':Sequelize[_0xa4c9('0x2')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0xa4c9('0x2')]},'transfereraccountcode':{'type':Sequelize[_0xa4c9('0x2')]},'transferercontext':{'type':Sequelize[_0xa4c9('0x2')]},'transfererexten':{'type':Sequelize[_0xa4c9('0x2')]},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize[_0xa4c9('0x2')]},'transfereecalleridnum':{'type':Sequelize[_0xa4c9('0x2')]},'transfereecalleridname':{'type':Sequelize[_0xa4c9('0x2')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xa4c9('0x2')]},'transfereeconnectedlinename':{'type':Sequelize[_0xa4c9('0x2')]},'transfereeaccountcode':{'type':Sequelize[_0xa4c9('0x2')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0xa4c9('0x2')]},'transfereelinkedid':{'type':Sequelize[_0xa4c9('0x2')]},'isexternal':{'type':Sequelize['ENUM']('Yes','No')},'context':{'type':Sequelize[_0xa4c9('0x2')]},'extension':{'type':Sequelize[_0xa4c9('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index dd10786..269ac48 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 _0xdda3=['../../config/environment','../../mysqldb','status','end','json','count','offset','Content-Range','apply','reject','update','destroy','sendStatus','error','stack','name','send','index','map','VoiceTransferReport','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','field','options','then','includeAll','include','catch','show','keys','find','create','body','params','html-pdf','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x32b5af,_0x4221a0){var _0x43522d=function(_0x5686aa){while(--_0x5686aa){_0x32b5af['push'](_0x32b5af['shift']());}};_0x43522d(++_0x4221a0);}(_0xdda3,0xc3));var _0x3dda=function(_0x1cb9eb,_0x5bff99){_0x1cb9eb=_0x1cb9eb-0x0;var _0x28f380=_0xdda3[_0x1cb9eb];return _0x28f380;};'use strict';var pdf=require(_0x3dda('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x3dda('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3dda('0x2'));var moment=require(_0x3dda('0x3'));var BPromise=require(_0x3dda('0x4'));var Mustache=require('mustache');var util=require(_0x3dda('0x5'));var path=require(_0x3dda('0x6'));var sox=require(_0x3dda('0x7'));var csv=require(_0x3dda('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x3dda('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3dda('0xa'));var toCsv=require(_0x3dda('0x8'));var querystring=require(_0x3dda('0xb'));var Papa=require(_0x3dda('0xc'));var Redis=require(_0x3dda('0xd'));var authService=require(_0x3dda('0xe'));var qs=require(_0x3dda('0xf'));var as=require(_0x3dda('0x10'));var hardwareService=require(_0x3dda('0x11'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x3dda('0x12'));var db=require(_0x3dda('0x13'))['db'];function respondWithStatusCode(_0x2249d0,_0x2d5e7c){_0x2d5e7c=_0x2d5e7c||0xcc;return function(_0x11f06a){if(_0x11f06a){return _0x2249d0['sendStatus'](_0x2d5e7c);}return _0x2249d0[_0x3dda('0x14')](_0x2d5e7c)[_0x3dda('0x15')]();};}function respondWithResult(_0x156e3d,_0x113292){_0x113292=_0x113292||0xc8;return function(_0x49b898){if(_0x49b898){return _0x156e3d[_0x3dda('0x14')](_0x113292)[_0x3dda('0x16')](_0x49b898);}};}function respondWithFilteredResult(_0x3e607a,_0x54aa88){return function(_0x398252){if(_0x398252){var _0x5f21ba=_0x398252[_0x3dda('0x17')],_0x364fbc=_0x54aa88[_0x3dda('0x18')],_0x32331c=_0x54aa88[_0x3dda('0x18')]+_0x54aa88['limit'],_0x56a31f;if(_0x32331c>=_0x5f21ba){_0x32331c=_0x5f21ba;_0x56a31f=0xc8;}else{_0x56a31f=0xce;}_0x3e607a[_0x3dda('0x14')](_0x56a31f);return _0x3e607a['set'](_0x3dda('0x19'),_0x364fbc+'-'+_0x32331c+'/'+_0x5f21ba)['json'](_0x398252);}return null;};}function patchUpdates(_0x1936d5){return function(_0x3dc563){try{jsonpatch[_0x3dda('0x1a')](_0x3dc563,_0x1936d5,!![]);}catch(_0x5c3ecd){return BPromise[_0x3dda('0x1b')](_0x5c3ecd);}return _0x3dc563['save']();};}function saveUpdates(_0x1875b0,_0x576af8){return function(_0x3742aa){if(_0x3742aa){return _0x3742aa[_0x3dda('0x1c')](_0x1875b0)['then'](function(_0x55ac02){return _0x55ac02;});}return null;};}function removeEntity(_0x4d8a78,_0x548dbf){return function(_0x5b7cd0){if(_0x5b7cd0){return _0x5b7cd0[_0x3dda('0x1d')]()['then'](function(){_0x4d8a78[_0x3dda('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x155c74,_0x2d84a3){return function(_0x531cb7){if(!_0x531cb7){_0x155c74[_0x3dda('0x1e')](0x194);}return _0x531cb7;};}function handleError(_0x37ffc7,_0x26e699){_0x26e699=_0x26e699||0x1f4;return function(_0x147b76){logger[_0x3dda('0x1f')](_0x147b76[_0x3dda('0x20')]);if(_0x147b76[_0x3dda('0x21')]){delete _0x147b76['name'];}_0x37ffc7[_0x3dda('0x14')](_0x26e699)[_0x3dda('0x22')](_0x147b76);};}exports[_0x3dda('0x23')]=function(_0x57c790,_0x22150b){var _0x4a6e8f={},_0x37af60={},_0x57ee04={'count':0x0,'rows':[]};var _0x8e9eba=_[_0x3dda('0x24')](db[_0x3dda('0x25')][_0x3dda('0x26')],function(_0x1e0dd6){return{'name':_0x1e0dd6[_0x3dda('0x27')],'type':_0x1e0dd6['type'][_0x3dda('0x28')]};});_0x37af60[_0x3dda('0x29')]=_[_0x3dda('0x24')](_0x8e9eba,'name');_0x37af60[_0x3dda('0x2a')]=_['keys'](_0x57c790[_0x3dda('0x2a')]);_0x37af60[_0x3dda('0x2b')]=_[_0x3dda('0x2c')](_0x37af60[_0x3dda('0x29')],_0x37af60['query']);_0x4a6e8f[_0x3dda('0x2d')]=_[_0x3dda('0x2c')](_0x37af60[_0x3dda('0x29')],qs['fields'](_0x57c790[_0x3dda('0x2a')][_0x3dda('0x2e')]));_0x4a6e8f[_0x3dda('0x2d')]=_0x4a6e8f['attributes'][_0x3dda('0x2f')]?_0x4a6e8f[_0x3dda('0x2d')]:_0x37af60[_0x3dda('0x29')];if(!_0x57c790[_0x3dda('0x2a')][_0x3dda('0x30')](_0x3dda('0x31'))){_0x4a6e8f[_0x3dda('0x32')]=qs[_0x3dda('0x32')](_0x57c790[_0x3dda('0x2a')][_0x3dda('0x32')]);_0x4a6e8f[_0x3dda('0x18')]=qs[_0x3dda('0x18')](_0x57c790[_0x3dda('0x2a')][_0x3dda('0x18')]);}_0x4a6e8f[_0x3dda('0x33')]=qs[_0x3dda('0x34')](_0x57c790[_0x3dda('0x2a')][_0x3dda('0x34')]);_0x4a6e8f[_0x3dda('0x35')]=qs[_0x3dda('0x2b')](_[_0x3dda('0x36')](_0x57c790[_0x3dda('0x2a')],_0x37af60[_0x3dda('0x2b')]));if(_0x57c790['query'][_0x3dda('0x37')]){_0x4a6e8f[_0x3dda('0x35')]=_[_0x3dda('0x38')](_0x4a6e8f[_0x3dda('0x35')],{'$or':_[_0x3dda('0x24')](_0x8e9eba,function(_0x15f019){if(_0x15f019[_0x3dda('0x39')][_0x3dda('0x28')]!==_0x3dda('0x3a')){var _0x1494d9={};_0x1494d9[_0x15f019[_0x3dda('0x3b')]]={'$like':'%'+_0x57c790[_0x3dda('0x2a')][_0x3dda('0x37')]+'%'};return _0x1494d9;}})});}_0x4a6e8f=_[_0x3dda('0x38')]({},_0x4a6e8f,_0x57c790[_0x3dda('0x3c')]);var _0x10d124={'where':_0x4a6e8f[_0x3dda('0x35')]};return db[_0x3dda('0x25')]['count'](_0x10d124)[_0x3dda('0x3d')](function(_0x18657b){_0x57ee04[_0x3dda('0x17')]=_0x18657b;if(_0x57c790[_0x3dda('0x2a')][_0x3dda('0x3e')]){_0x4a6e8f[_0x3dda('0x3f')]=[{'all':!![]}];}return db[_0x3dda('0x25')]['findAll'](_0x4a6e8f);})[_0x3dda('0x3d')](function(_0x5b450c){_0x57ee04['rows']=_0x5b450c;return _0x57ee04;})[_0x3dda('0x3d')](respondWithFilteredResult(_0x22150b,_0x4a6e8f))[_0x3dda('0x40')](handleError(_0x22150b,null));};exports[_0x3dda('0x41')]=function(_0x120128,_0xe16a7e){var _0x14f8d0={'raw':!![],'where':{'id':_0x120128['params']['id']}},_0x35ae4f={};_0x35ae4f[_0x3dda('0x29')]=_['keys'](db[_0x3dda('0x25')]['rawAttributes']);_0x35ae4f[_0x3dda('0x2a')]=_[_0x3dda('0x42')](_0x120128[_0x3dda('0x2a')]);_0x35ae4f[_0x3dda('0x2b')]=_[_0x3dda('0x2c')](_0x35ae4f[_0x3dda('0x29')],_0x35ae4f[_0x3dda('0x2a')]);_0x14f8d0[_0x3dda('0x2d')]=_[_0x3dda('0x2c')](_0x35ae4f[_0x3dda('0x29')],qs[_0x3dda('0x2e')](_0x120128[_0x3dda('0x2a')]['fields']));_0x14f8d0[_0x3dda('0x2d')]=_0x14f8d0['attributes'][_0x3dda('0x2f')]?_0x14f8d0[_0x3dda('0x2d')]:_0x35ae4f[_0x3dda('0x29')];if(_0x120128['query']['includeAll']){_0x14f8d0[_0x3dda('0x3f')]=[{'all':!![]}];}_0x14f8d0=_[_0x3dda('0x38')]({},_0x14f8d0,_0x120128[_0x3dda('0x3c')]);return db[_0x3dda('0x25')][_0x3dda('0x43')](_0x14f8d0)['then'](handleEntityNotFound(_0xe16a7e,null))[_0x3dda('0x3d')](respondWithResult(_0xe16a7e,null))['catch'](handleError(_0xe16a7e,null));};exports['create']=function(_0x62eecf,_0x207f1a){return db['VoiceTransferReport'][_0x3dda('0x44')](_0x62eecf['body'],{})[_0x3dda('0x3d')](respondWithResult(_0x207f1a,0xc9))[_0x3dda('0x40')](handleError(_0x207f1a,null));};exports[_0x3dda('0x1c')]=function(_0xfef902,_0x8ba883){if(_0xfef902[_0x3dda('0x45')]['id']){delete _0xfef902[_0x3dda('0x45')]['id'];}return db[_0x3dda('0x25')][_0x3dda('0x43')]({'where':{'id':_0xfef902[_0x3dda('0x46')]['id']}})['then'](handleEntityNotFound(_0x8ba883,null))[_0x3dda('0x3d')](saveUpdates(_0xfef902[_0x3dda('0x45')],null))[_0x3dda('0x3d')](respondWithResult(_0x8ba883,null))[_0x3dda('0x40')](handleError(_0x8ba883,null));};exports[_0x3dda('0x1d')]=function(_0x481e71,_0x4f7986){return db[_0x3dda('0x25')][_0x3dda('0x43')]({'where':{'id':_0x481e71['params']['id']}})[_0x3dda('0x3d')](handleEntityNotFound(_0x4f7986,null))[_0x3dda('0x3d')](removeEntity(_0x4f7986,null))['catch'](handleError(_0x4f7986,null));}; \ No newline at end of file +var _0xa47a=['nolimit','order','sort','where','pick','merge','VIRTUAL','field','filter','options','includeAll','include','findAll','rows','catch','show','params','fields','find','create','body','html-pdf','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','count','offset','limit','status','Content-Range','json','apply','reject','save','update','then','destroy','end','error','stack','name','send','map','VoiceTransferReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','length','hasOwnProperty'];(function(_0x4049fc,_0x845a9b){var _0x202024=function(_0x250e51){while(--_0x250e51){_0x4049fc['push'](_0x4049fc['shift']());}};_0x202024(++_0x845a9b);}(_0xa47a,0xa9));var _0xaa47=function(_0x366498,_0x1ad63a){_0x366498=_0x366498-0x0;var _0x321c8a=_0xa47a[_0x366498];return _0x321c8a;};'use strict';var pdf=require(_0xaa47('0x0'));var emlformat=require(_0xaa47('0x1'));var rimraf=require(_0xaa47('0x2'));var zipdir=require(_0xaa47('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xaa47('0x4'));var Mustache=require(_0xaa47('0x5'));var util=require(_0xaa47('0x6'));var path=require(_0xaa47('0x7'));var sox=require(_0xaa47('0x8'));var csv=require(_0xaa47('0x9'));var ejs=require(_0xaa47('0xa'));var fs=require('fs');var _=require(_0xaa47('0xb'));var squel=require(_0xaa47('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xaa47('0xd'));var toCsv=require(_0xaa47('0x9'));var querystring=require('querystring');var Papa=require(_0xaa47('0xe'));var Redis=require(_0xaa47('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xaa47('0x10'));var hardwareService=require(_0xaa47('0x11'));var logger=require('../../config/logger')(_0xaa47('0x12'));var utils=require(_0xaa47('0x13'));var config=require(_0xaa47('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x446cf6,_0x23adba){_0x23adba=_0x23adba||0xcc;return function(_0x949d5b){if(_0x949d5b){return _0x446cf6[_0xaa47('0x15')](_0x23adba);}return _0x446cf6['status'](_0x23adba)['end']();};}function respondWithResult(_0x4439a5,_0x37a72d){_0x37a72d=_0x37a72d||0xc8;return function(_0x457807){if(_0x457807){return _0x4439a5['status'](_0x37a72d)['json'](_0x457807);}};}function respondWithFilteredResult(_0x13bd82,_0x5393b2){return function(_0x133b0b){if(_0x133b0b){var _0x2f8dc6=_0x133b0b[_0xaa47('0x16')],_0x1bb71f=_0x5393b2[_0xaa47('0x17')],_0x2ce6ce=_0x5393b2[_0xaa47('0x17')]+_0x5393b2[_0xaa47('0x18')],_0x384586;if(_0x2ce6ce>=_0x2f8dc6){_0x2ce6ce=_0x2f8dc6;_0x384586=0xc8;}else{_0x384586=0xce;}_0x13bd82[_0xaa47('0x19')](_0x384586);return _0x13bd82['set'](_0xaa47('0x1a'),_0x1bb71f+'-'+_0x2ce6ce+'/'+_0x2f8dc6)[_0xaa47('0x1b')](_0x133b0b);}return null;};}function patchUpdates(_0x3828c5){return function(_0x4aedd9){try{jsonpatch[_0xaa47('0x1c')](_0x4aedd9,_0x3828c5,!![]);}catch(_0x74457b){return BPromise[_0xaa47('0x1d')](_0x74457b);}return _0x4aedd9[_0xaa47('0x1e')]();};}function saveUpdates(_0x2b90b4,_0x3eaa11){return function(_0x1ea347){if(_0x1ea347){return _0x1ea347[_0xaa47('0x1f')](_0x2b90b4)[_0xaa47('0x20')](function(_0x4ba206){return _0x4ba206;});}return null;};}function removeEntity(_0x298dbe,_0x1b8385){return function(_0x243ab3){if(_0x243ab3){return _0x243ab3[_0xaa47('0x21')]()[_0xaa47('0x20')](function(){_0x298dbe[_0xaa47('0x19')](0xcc)[_0xaa47('0x22')]();});}};}function handleEntityNotFound(_0x341961,_0x4eb835){return function(_0x1d169d){if(!_0x1d169d){_0x341961[_0xaa47('0x15')](0x194);}return _0x1d169d;};}function handleError(_0x218bb4,_0x543ae6){_0x543ae6=_0x543ae6||0x1f4;return function(_0x51152e){logger[_0xaa47('0x23')](_0x51152e[_0xaa47('0x24')]);if(_0x51152e[_0xaa47('0x25')]){delete _0x51152e[_0xaa47('0x25')];}_0x218bb4[_0xaa47('0x19')](_0x543ae6)[_0xaa47('0x26')](_0x51152e);};}exports['index']=function(_0x4aa6af,_0x23af53){var _0x3dbc6b={},_0x3f8d31={},_0x35e639={'count':0x0,'rows':[]};var _0x5b9e71=_[_0xaa47('0x27')](db[_0xaa47('0x28')][_0xaa47('0x29')],function(_0x5c0a3f){return{'name':_0x5c0a3f[_0xaa47('0x2a')],'type':_0x5c0a3f[_0xaa47('0x2b')][_0xaa47('0x2c')]};});_0x3f8d31[_0xaa47('0x2d')]=_[_0xaa47('0x27')](_0x5b9e71,_0xaa47('0x25'));_0x3f8d31['query']=_[_0xaa47('0x2e')](_0x4aa6af[_0xaa47('0x2f')]);_0x3f8d31[_0xaa47('0x30')]=_['intersection'](_0x3f8d31[_0xaa47('0x2d')],_0x3f8d31[_0xaa47('0x2f')]);_0x3dbc6b['attributes']=_[_0xaa47('0x31')](_0x3f8d31[_0xaa47('0x2d')],qs['fields'](_0x4aa6af[_0xaa47('0x2f')]['fields']));_0x3dbc6b['attributes']=_0x3dbc6b[_0xaa47('0x32')][_0xaa47('0x33')]?_0x3dbc6b[_0xaa47('0x32')]:_0x3f8d31[_0xaa47('0x2d')];if(!_0x4aa6af[_0xaa47('0x2f')][_0xaa47('0x34')](_0xaa47('0x35'))){_0x3dbc6b['limit']=qs[_0xaa47('0x18')](_0x4aa6af[_0xaa47('0x2f')][_0xaa47('0x18')]);_0x3dbc6b[_0xaa47('0x17')]=qs[_0xaa47('0x17')](_0x4aa6af['query'][_0xaa47('0x17')]);}_0x3dbc6b[_0xaa47('0x36')]=qs['sort'](_0x4aa6af[_0xaa47('0x2f')][_0xaa47('0x37')]);_0x3dbc6b[_0xaa47('0x38')]=qs['filters'](_[_0xaa47('0x39')](_0x4aa6af[_0xaa47('0x2f')],_0x3f8d31[_0xaa47('0x30')]));if(_0x4aa6af[_0xaa47('0x2f')]['filter']){_0x3dbc6b[_0xaa47('0x38')]=_[_0xaa47('0x3a')](_0x3dbc6b[_0xaa47('0x38')],{'$or':_[_0xaa47('0x27')](_0x5b9e71,function(_0x5588be){if(_0x5588be['type'][_0xaa47('0x2c')]!==_0xaa47('0x3b')){var _0x41faea={};_0x41faea[_0x5588be[_0xaa47('0x3c')]]={'$like':'%'+_0x4aa6af['query'][_0xaa47('0x3d')]+'%'};return _0x41faea;}})});}_0x3dbc6b=_[_0xaa47('0x3a')]({},_0x3dbc6b,_0x4aa6af[_0xaa47('0x3e')]);var _0x501ed8={'where':_0x3dbc6b[_0xaa47('0x38')]};return db[_0xaa47('0x28')][_0xaa47('0x16')](_0x501ed8)[_0xaa47('0x20')](function(_0x50487b){_0x35e639[_0xaa47('0x16')]=_0x50487b;if(_0x4aa6af[_0xaa47('0x2f')][_0xaa47('0x3f')]){_0x3dbc6b[_0xaa47('0x40')]=[{'all':!![]}];}return db['VoiceTransferReport'][_0xaa47('0x41')](_0x3dbc6b);})[_0xaa47('0x20')](function(_0x543e5c){_0x35e639[_0xaa47('0x42')]=_0x543e5c;return _0x35e639;})[_0xaa47('0x20')](respondWithFilteredResult(_0x23af53,_0x3dbc6b))[_0xaa47('0x43')](handleError(_0x23af53,null));};exports[_0xaa47('0x44')]=function(_0x295553,_0x519066){var _0x2d137c={'raw':!![],'where':{'id':_0x295553[_0xaa47('0x45')]['id']}},_0x17b02a={};_0x17b02a['model']=_[_0xaa47('0x2e')](db[_0xaa47('0x28')][_0xaa47('0x29')]);_0x17b02a[_0xaa47('0x2f')]=_[_0xaa47('0x2e')](_0x295553[_0xaa47('0x2f')]);_0x17b02a[_0xaa47('0x30')]=_['intersection'](_0x17b02a[_0xaa47('0x2d')],_0x17b02a[_0xaa47('0x2f')]);_0x2d137c['attributes']=_[_0xaa47('0x31')](_0x17b02a[_0xaa47('0x2d')],qs[_0xaa47('0x46')](_0x295553['query'][_0xaa47('0x46')]));_0x2d137c[_0xaa47('0x32')]=_0x2d137c[_0xaa47('0x32')][_0xaa47('0x33')]?_0x2d137c[_0xaa47('0x32')]:_0x17b02a[_0xaa47('0x2d')];if(_0x295553[_0xaa47('0x2f')][_0xaa47('0x3f')]){_0x2d137c[_0xaa47('0x40')]=[{'all':!![]}];}_0x2d137c=_[_0xaa47('0x3a')]({},_0x2d137c,_0x295553['options']);return db['VoiceTransferReport'][_0xaa47('0x47')](_0x2d137c)[_0xaa47('0x20')](handleEntityNotFound(_0x519066,null))['then'](respondWithResult(_0x519066,null))['catch'](handleError(_0x519066,null));};exports[_0xaa47('0x48')]=function(_0x5ad11c,_0x552afa){return db['VoiceTransferReport'][_0xaa47('0x48')](_0x5ad11c['body'],{})[_0xaa47('0x20')](respondWithResult(_0x552afa,0xc9))[_0xaa47('0x43')](handleError(_0x552afa,null));};exports[_0xaa47('0x1f')]=function(_0x1535fb,_0x39caa6){if(_0x1535fb[_0xaa47('0x49')]['id']){delete _0x1535fb[_0xaa47('0x49')]['id'];}return db[_0xaa47('0x28')][_0xaa47('0x47')]({'where':{'id':_0x1535fb[_0xaa47('0x45')]['id']}})[_0xaa47('0x20')](handleEntityNotFound(_0x39caa6,null))[_0xaa47('0x20')](saveUpdates(_0x1535fb['body'],null))[_0xaa47('0x20')](respondWithResult(_0x39caa6,null))['catch'](handleError(_0x39caa6,null));};exports['destroy']=function(_0x58d4a3,_0x5d9ce8){return db['VoiceTransferReport'][_0xaa47('0x47')]({'where':{'id':_0x58d4a3[_0xaa47('0x45')]['id']}})[_0xaa47('0x20')](handleEntityNotFound(_0x5d9ce8,null))['then'](removeEntity(_0x5d9ce8,null))[_0xaa47('0x43')](handleError(_0x5d9ce8,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 339aad6..ab010e1 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 _0x609a=['api','moment','request-promise','path','rimraf','exports','define','VoiceTransferReport','report_call_transfer','lodash','util'];(function(_0x1e0e0c,_0x73df8b){var _0x5dabc2=function(_0x2ef0bc){while(--_0x2ef0bc){_0x1e0e0c['push'](_0x1e0e0c['shift']());}};_0x5dabc2(++_0x73df8b);}(_0x609a,0x11c));var _0xa609=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x609a[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0xa609('0x0'));var util=require(_0xa609('0x1'));var logger=require('../../config/logger')(_0xa609('0x2'));var moment=require(_0xa609('0x3'));var BPromise=require('bluebird');var rp=require(_0xa609('0x4'));var fs=require('fs');var path=require(_0xa609('0x5'));var rimraf=require(_0xa609('0x6'));var config=require('../../config/environment');var attributes=require('./voiceTransferReport.attributes');module[_0xa609('0x7')]=function(_0x2b1b54,_0x18bbb4){return _0x2b1b54[_0xa609('0x8')](_0xa609('0x9'),attributes,{'tableName':_0xa609('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb982=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','report_call_transfer','../../config/logger'];(function(_0x2ea601,_0x10cf59){var _0x2124ed=function(_0x201818){while(--_0x201818){_0x2ea601['push'](_0x2ea601['shift']());}};_0x2124ed(++_0x10cf59);}(_0xb982,0x15e));var _0x2b98=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb982[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2b98('0x0'))(_0x2b98('0x1'));var moment=require(_0x2b98('0x2'));var BPromise=require(_0x2b98('0x3'));var rp=require(_0x2b98('0x4'));var fs=require('fs');var path=require(_0x2b98('0x5'));var rimraf=require(_0x2b98('0x6'));var config=require(_0x2b98('0x7'));var attributes=require(_0x2b98('0x8'));module[_0x2b98('0x9')]=function(_0x55f7b8,_0xe2657d){return _0x55f7b8[_0x2b98('0xa')](_0x2b98('0xb'),attributes,{'tableName':_0x2b98('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.rpc.js b/server/api/voiceTransferReport/voiceTransferReport.rpc.js index 208acc9..1b974f9 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 _0x2b78=['catch','lodash','util','moment','bluebird','randomstring','../../config/logger','../../config/environment','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','create','body','options','CreateVoiceTransferReport'];(function(_0xc28d37,_0x1ed113){var _0x5a3429=function(_0x1a36a0){while(--_0x1a36a0){_0xc28d37['push'](_0xc28d37['shift']());}};_0x5a3429(++_0x1ed113);}(_0x2b78,0x115));var _0x82b7=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0x2b78[_0x9cd4c3];return _0x4c9025;};'use strict';var _=require(_0x82b7('0x0'));var util=require(_0x82b7('0x1'));var moment=require(_0x82b7('0x2'));var BPromise=require(_0x82b7('0x3'));var rs=require(_0x82b7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x82b7('0x5'))('rpc');var config=require(_0x82b7('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x82b7('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x17c9b3,_0x51eed6,_0x3f07d1){return new BPromise(function(_0x1a9186,_0x1008bc){return client[_0x82b7('0x8')](_0x17c9b3,_0x3f07d1)[_0x82b7('0x9')](function(_0x5f4e50){logger[_0x82b7('0xa')](_0x82b7('0xb'),_0x51eed6,_0x82b7('0xc'));logger[_0x82b7('0xd')]('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x51eed6,_0x82b7('0xc'),JSON[_0x82b7('0xe')](_0x5f4e50));if(_0x5f4e50[_0x82b7('0xf')]){if(_0x5f4e50[_0x82b7('0xf')]['code']===0x1f4){logger[_0x82b7('0xf')](_0x82b7('0xb'),_0x51eed6,_0x5f4e50[_0x82b7('0xf')]['message']);return _0x1008bc(_0x5f4e50[_0x82b7('0xf')][_0x82b7('0x10')]);}logger[_0x82b7('0xf')]('VoiceTransferReport,\x20%s,\x20%s',_0x51eed6,_0x5f4e50[_0x82b7('0xf')][_0x82b7('0x10')]);return _0x1a9186(_0x5f4e50[_0x82b7('0xf')][_0x82b7('0x10')]);}else{logger[_0x82b7('0xa')](_0x82b7('0xb'),_0x51eed6,_0x82b7('0xc'));_0x1a9186(_0x5f4e50[_0x82b7('0x11')]['message']);}})['catch'](function(_0x4b8162){logger[_0x82b7('0xf')]('VoiceTransferReport,\x20%s,\x20%s',_0x51eed6,_0x4b8162);_0x1008bc(_0x4b8162);});});}exports['CreateVoiceTransferReport']=function(_0x208d13){var _0x3bacc6=this;return new Promise(function(_0x6c0383,_0x330d20){return db['VoiceTransferReport'][_0x82b7('0x12')](_0x208d13[_0x82b7('0x13')],{'raw':_0x208d13['options']?_0x208d13[_0x82b7('0x14')]['raw']===undefined?!![]:![]:!![]})[_0x82b7('0x9')](function(_0x143f75){logger[_0x82b7('0xa')](_0x82b7('0x15'),_0x208d13);logger[_0x82b7('0xd')](_0x82b7('0x15'),_0x208d13,JSON['stringify'](_0x143f75));_0x6c0383(_0x143f75);})[_0x82b7('0x16')](function(_0x290d41){logger[_0x82b7('0xf')](_0x82b7('0x15'),_0x290d41[_0x82b7('0x10')],_0x208d13);_0x330d20(_0x3bacc6[_0x82b7('0xf')](0x1f4,_0x290d41[_0x82b7('0x10')]));});});}; \ No newline at end of file +var _0x5cd5=['util','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','request','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','options','raw','stringify'];(function(_0x48e3eb,_0x39d531){var _0x1caadd=function(_0x484054){while(--_0x484054){_0x48e3eb['push'](_0x48e3eb['shift']());}};_0x1caadd(++_0x39d531);}(_0x5cd5,0x11e));var _0x55cd=function(_0xaa335c,_0x3d1128){_0xaa335c=_0xaa335c-0x0;var _0x37a04c=_0x5cd5[_0xaa335c];return _0x37a04c;};'use strict';var _=require('lodash');var util=require(_0x55cd('0x0'));var moment=require('moment');var BPromise=require(_0x55cd('0x1'));var rs=require(_0x55cd('0x2'));var fs=require('fs');var Redis=require(_0x55cd('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x55cd('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x55cd('0x5'));var jayson=require(_0x55cd('0x6'));var client=jayson[_0x55cd('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x420f1a,_0x4a0747,_0xbd4b91){return new BPromise(function(_0x4ab7fe,_0x298db5){return client[_0x55cd('0x8')](_0x420f1a,_0xbd4b91)['then'](function(_0x1f39f7){logger[_0x55cd('0x9')](_0x55cd('0xa'),_0x4a0747,_0x55cd('0xb'));logger[_0x55cd('0xc')]('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x4a0747,_0x55cd('0xb'),JSON['stringify'](_0x1f39f7));if(_0x1f39f7['error']){if(_0x1f39f7[_0x55cd('0xd')]['code']===0x1f4){logger[_0x55cd('0xd')]('VoiceTransferReport,\x20%s,\x20%s',_0x4a0747,_0x1f39f7[_0x55cd('0xd')][_0x55cd('0xe')]);return _0x298db5(_0x1f39f7[_0x55cd('0xd')][_0x55cd('0xe')]);}logger[_0x55cd('0xd')](_0x55cd('0xa'),_0x4a0747,_0x1f39f7[_0x55cd('0xd')][_0x55cd('0xe')]);return _0x4ab7fe(_0x1f39f7[_0x55cd('0xd')][_0x55cd('0xe')]);}else{logger[_0x55cd('0x9')](_0x55cd('0xa'),_0x4a0747,'request\x20sent');_0x4ab7fe(_0x1f39f7[_0x55cd('0xf')][_0x55cd('0xe')]);}})[_0x55cd('0x10')](function(_0x2001f2){logger['error'](_0x55cd('0xa'),_0x4a0747,_0x2001f2);_0x298db5(_0x2001f2);});});}exports[_0x55cd('0x11')]=function(_0x488f85){var _0x4d8e8b=this;return new Promise(function(_0x2b7d4b,_0x155ef0){return db[_0x55cd('0x12')]['create'](_0x488f85['body'],{'raw':_0x488f85[_0x55cd('0x13')]?_0x488f85[_0x55cd('0x13')][_0x55cd('0x14')]===undefined?!![]:![]:!![]})['then'](function(_0x32cb57){logger[_0x55cd('0x9')](_0x55cd('0x11'),_0x488f85);logger['debug'](_0x55cd('0x11'),_0x488f85,JSON[_0x55cd('0x15')](_0x32cb57));_0x2b7d4b(_0x32cb57);})[_0x55cd('0x10')](function(_0x99b159){logger[_0x55cd('0xd')]('CreateVoiceTransferReport',_0x99b159['message'],_0x488f85);_0x155ef0(_0x4d8e8b[_0x55cd('0xd')](0x1f4,_0x99b159[_0x55cd('0xe')]));});});}; \ No newline at end of file diff --git a/server/app.js b/server/app.js index 93766b0..73b9423 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8602=['seedDB','./config/seedDB','./config/license','default','error','exit','lodash','./mysqldb','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','sequelize','sync','then','listen','info','start','Online\x20apps:','map','filter','join','Offline\x20apps:','status','name'];(function(_0x2a4b8a,_0x2f7ea4){var _0x26306f=function(_0x1ff0b7){while(--_0x1ff0b7){_0x2a4b8a['push'](_0x2a4b8a['shift']());}};_0x26306f(++_0x2f7ea4);}(_0x8602,0x19c));var _0x2860=function(_0x21f3bf,_0xfb0f59){_0x21f3bf=_0x21f3bf-0x0;var _0x249d08=_0x8602[_0x21f3bf];return _0x249d08;};'use strict';var _=require(_0x2860('0x0'));var mysqldb=require(_0x2860('0x1'));var rpc=require(_0x2860('0x2'));var config=require(_0x2860('0x3'));var logger=require(_0x2860('0x4'))(_0x2860('0x5'));var pm2=require(_0x2860('0x6'));var pm2Config=require(_0x2860('0x7'));var schedule=require(_0x2860('0x8'));var chat=require(_0x2860('0x9'));function main(){return mysqldb['db'][_0x2860('0xa')][_0x2860('0xb')]()[_0x2860('0xc')](function(){return rpc[_0x2860('0xd')]();})[_0x2860('0xc')](function(_0x5be182){logger[_0x2860('0xe')](_0x5be182);return chat['start']();})[_0x2860('0xc')](function(){return schedule[_0x2860('0xf')]();})[_0x2860('0xc')](function(_0x27a9cd){logger[_0x2860('0xe')](_0x27a9cd);return pm2[_0x2860('0xf')](pm2Config);})[_0x2860('0xc')](function(_0x95a42f){logger[_0x2860('0xe')](_0x2860('0x10'),_[_0x2860('0x11')](_[_0x2860('0x12')](_0x95a42f,{'status':'online'}),'name')[_0x2860('0x13')]());logger[_0x2860('0xe')](_0x2860('0x14'),_[_0x2860('0x11')](_[_0x2860('0x12')](_0x95a42f,function(_0x413085){return _0x413085[_0x2860('0x15')]!=='online';}),_0x2860('0x16'))[_0x2860('0x13')]()||'None');config[_0x2860('0x17')]&&require(_0x2860('0x18'))['default']();require(_0x2860('0x19'))[_0x2860('0x1a')]();})['catch'](function(_0x5181bf){logger[_0x2860('0x1b')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x5181bf);process[_0x2860('0x1c')](0x1);});}main(); \ No newline at end of file +var _0xf07f=['./config/environment','./config/logger','app','./config/pm2/config','./config/schedule','sequelize','sync','then','listen','info','start','Online\x20apps:','filter','online','name','join','Offline\x20apps:','map','None','./config/seedDB','default','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./rpc'];(function(_0x1f2901,_0x23104a){var _0x23e15b=function(_0xdd45fd){while(--_0xdd45fd){_0x1f2901['push'](_0x1f2901['shift']());}};_0x23e15b(++_0x23104a);}(_0xf07f,0xdd));var _0xff07=function(_0x46c6d6,_0x2ab3f2){_0x46c6d6=_0x46c6d6-0x0;var _0x10f7ca=_0xf07f[_0x46c6d6];return _0x10f7ca;};'use strict';var _=require(_0xff07('0x0'));var mysqldb=require(_0xff07('0x1'));var rpc=require(_0xff07('0x2'));var config=require(_0xff07('0x3'));var logger=require(_0xff07('0x4'))(_0xff07('0x5'));var pm2=require('./config/pm2');var pm2Config=require(_0xff07('0x6'));var schedule=require(_0xff07('0x7'));var chat=require('./config/schedule/chat');function main(){return mysqldb['db'][_0xff07('0x8')][_0xff07('0x9')]()[_0xff07('0xa')](function(){return rpc[_0xff07('0xb')]();})[_0xff07('0xa')](function(_0x3342d0){logger[_0xff07('0xc')](_0x3342d0);return chat[_0xff07('0xd')]();})[_0xff07('0xa')](function(){return schedule[_0xff07('0xd')]();})[_0xff07('0xa')](function(_0x5581e8){logger['info'](_0x5581e8);return pm2['start'](pm2Config);})[_0xff07('0xa')](function(_0x1ca83c){logger[_0xff07('0xc')](_0xff07('0xe'),_['map'](_[_0xff07('0xf')](_0x1ca83c,{'status':_0xff07('0x10')}),_0xff07('0x11'))[_0xff07('0x12')]());logger['info'](_0xff07('0x13'),_[_0xff07('0x14')](_['filter'](_0x1ca83c,function(_0x1011e8){return _0x1011e8['status']!=='online';}),_0xff07('0x11'))[_0xff07('0x12')]()||_0xff07('0x15'));config['seedDB']&&require(_0xff07('0x16'))[_0xff07('0x17')]();require('./config/license')[_0xff07('0x17')]();})[_0xff07('0x18')](function(_0x4b822b){logger[_0xff07('0x19')](_0xff07('0x1a'),_0x4b822b);process[_0xff07('0x1b')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 1b06cfe..a452494 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 _0xfe2a=['floor','toString','../../mysqldb','../../config/license/hardware','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','bluebird','secrets','session','fullname','email','permissions','md5secret','voicePause','chatPause','faxPause','smsPause','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','interface','userProfileId','isChatInteractionAuthorized','isAuthenticated','use','user','findOne','params','closed','disposition','then','status','unmanaged','Unmanaged.','authorization','Basic','User','authenticate','json','Wrong\x20credentials.','catch','startsWith','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','find','sub','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','User\x20object\x20not\x20found.','../../config/license/util','update','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','role','cookie','motion.token','redirect','/dashboards/general','send','retrieveApiKey','isNil','apiKeyIat','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','promisify','secret','payload','verify','randomBytes','hex'];(function(_0x573b3f,_0x172d1b){var _0x4e307b=function(_0x6599c7){while(--_0x6599c7){_0x573b3f['push'](_0x573b3f['shift']());}};_0x4e307b(++_0x172d1b);}(_0xfe2a,0xbc));var _0xafe2=function(_0x56756b,_0x3e8cc7){_0x56756b=_0x56756b-0x0;var _0xa3002=_0xfe2a[_0x56756b];return _0xa3002;};'use strict';var db=require(_0xafe2('0x0'))['db'];var config=require('../../config/environment');var hardwareConf=require(_0xafe2('0x1'));var _=require(_0xafe2('0x2'));var jwt=require(_0xafe2('0x3'));var expressJwt=require(_0xafe2('0x4'));var compose=require(_0xafe2('0x5'));var basicAuth=require(_0xafe2('0x6'));var crypto=require(_0xafe2('0x7'));var BPromise=require(_0xafe2('0x8'));var validateJwt=expressJwt({'secret':config[_0xafe2('0x9')][_0xafe2('0xa')]});var userAttributes=['id','role',_0xafe2('0xb'),'name','internal',_0xafe2('0xc'),'userpic',_0xafe2('0xd'),_0xafe2('0xe'),_0xafe2('0xf'),_0xafe2('0x10'),'mailPause',_0xafe2('0x11'),_0xafe2('0x12'),'openchannelPause','pauseType',_0xafe2('0x13'),_0xafe2('0x14'),_0xafe2('0x15'),_0xafe2('0x16'),_0xafe2('0x17'),_0xafe2('0x18'),_0xafe2('0x19'),_0xafe2('0x1a'),_0xafe2('0x1b'),_0xafe2('0x1c'),_0xafe2('0x1d'),_0xafe2('0x1e'),_0xafe2('0x1f'),_0xafe2('0x20'),_0xafe2('0x21'),'phoneBarRemoteControlPort','hotdesk',_0xafe2('0x22'),_0xafe2('0x23')];exports[_0xafe2('0x24')]=function(){return this[_0xafe2('0x25')](!![])[_0xafe2('0x26')](function(_0x81e9ad,_0x3ce44f,_0x53c580){if(_0x81e9ad[_0xafe2('0x27')]){_0x53c580();}else{return db['ChatInteraction'][_0xafe2('0x28')]({'where':{'id':_0x81e9ad[_0xafe2('0x29')]['id']},'attributes':['id',_0xafe2('0x2a'),_0xafe2('0x2b')],'raw':!![]})[_0xafe2('0x2c')](function(_0x55ca3c){if(_0x55ca3c&&_0x55ca3c[_0xafe2('0x2a')]){return _0x3ce44f[_0xafe2('0x2d')](_0x55ca3c[_0xafe2('0x2b')]===_0xafe2('0x2e')?0x195:0x193)['json']({'message':_0x55ca3c[_0xafe2('0x2b')]===_0xafe2('0x2e')?_0xafe2('0x2f'):'Forbidden.'});}else{_0x53c580();}})['catch'](function(_0x470406){_0x53c580(_0x470406);});}});};exports['isAuthenticated']=function isAuthenticated(_0x384bc0){return compose()[_0xafe2('0x26')](function(_0x403cd8,_0x126a24,_0x2c8e77){if(_0x403cd8['headers'][_0xafe2('0x30')]){if(_['startsWith'](_0x403cd8['headers'][_0xafe2('0x30')],_0xafe2('0x31'))){var _0x29cc85=basicAuth(_0x403cd8);db[_0xafe2('0x32')]['find']({'where':{'name':_0x29cc85['name']}})[_0xafe2('0x2c')](function(_0x5c9b8a){if(!_0x5c9b8a||!_0x5c9b8a[_0xafe2('0x33')](_0x29cc85['pass'])){return _0x126a24[_0xafe2('0x2d')](0x191)[_0xafe2('0x34')]({'message':_0xafe2('0x35')});}_0x403cd8[_0xafe2('0x27')]={'id':_0x5c9b8a['id']};_0x2c8e77();})[_0xafe2('0x36')](function(_0x3b164a){_0x2c8e77(_0x3b164a);});}else if(_[_0xafe2('0x37')](_0x403cd8['headers'][_0xafe2('0x30')],_0xafe2('0x38'))){validateJwt(_0x403cd8,_0x126a24,_0x2c8e77);}else{if(_0x384bc0){_0x2c8e77();}else{return _0x126a24[_0xafe2('0x2d')](0x193)['json']({'message':_0xafe2('0x39')});}}}else if(_0x403cd8[_0xafe2('0x3a')][_0xafe2('0x3b')]){var _0x25a002={'audience':hardwareConf[_0xafe2('0x3c')](),'issuer':hardwareConf[_0xafe2('0x3c')]()};verifyJwt(_0x403cd8[_0xafe2('0x3a')][_0xafe2('0x3b')],_0x25a002)[_0xafe2('0x2c')](function(_0x3a374c){return db['User'][_0xafe2('0x3d')]({'where':{'id':_0x3a374c[_0xafe2('0x3e')]}})['then'](function(_0x1f8b7b){if(!_0x1f8b7b||!_[_0xafe2('0x3f')](_0x1f8b7b[_0xafe2('0x40')],_0x3a374c[_0xafe2('0x41')])){return _0x126a24['status'](0x193)['json']({'message':_0xafe2('0x42')});}_0x403cd8[_0xafe2('0x27')]={'id':_0x1f8b7b['id']};_0x2c8e77();});})[_0xafe2('0x36')](function(_0x5c32b7){_0x2c8e77(_0x5c32b7);});}else if(_0x384bc0){_0x2c8e77();}else{return _0x126a24['status'](0x193)[_0xafe2('0x34')]({'message':_0xafe2('0x39')});}})[_0xafe2('0x26')](function(_0x344421,_0x26d5db,_0x229fff){if(_0x344421[_0xafe2('0x27')]){db[_0xafe2('0x32')]['find']({'where':{'id':_0x344421[_0xafe2('0x27')]['id']},'attributes':userAttributes})[_0xafe2('0x2c')](function(_0x5ad303){if(!_0x5ad303){return _0x26d5db[_0xafe2('0x2d')](0x194)[_0xafe2('0x34')]({'message':'User\x20not\x20found.'});}_0x344421[_0xafe2('0x27')]=_0x5ad303;_0x229fff();})[_0xafe2('0x36')](function(_0x3d6d64){_0x229fff(_0x3d6d64);});}else if(_0x384bc0){_0x229fff();}else{return _0x26d5db[_0xafe2('0x2d')](0x194)[_0xafe2('0x34')]({'message':_0xafe2('0x43')});}});};exports['canUpdate']=function canUpdate(){return compose()[_0xafe2('0x26')](function(_0x56e908,_0x20e877,_0x32c134){return require(_0xafe2('0x44'))['getLicense']()[_0xafe2('0x2c')](function(_0x51669d){if(_0x51669d[_0xafe2('0x45')]){_0x32c134();}else{return _0x20e877[_0xafe2('0x2d')](0x193)[_0xafe2('0x34')]({'message':'Forbidden'});}})[_0xafe2('0x36')](function(_0x182c68){_0x32c134(_0x182c68);});});};exports[_0xafe2('0x46')]=function(_0xbbf31,_0x45c736,_0x3b055f){_0xbbf31['isMiddleware']=!![];return _0x3b055f();};exports[_0xafe2('0x47')]=function signToken(_0x501bdb){return signJwt(_0x501bdb);};exports[_0xafe2('0x48')]=function(_0x3b08a7,_0x1d8a9f){if(!_0x3b08a7[_0xafe2('0x27')]){return _0x1d8a9f[_0xafe2('0x2d')](0x194)[_0xafe2('0x34')]({'message':_0xafe2('0x49')});}var _0x4cb9bf={'payload':{'id':_0x3b08a7[_0xafe2('0x27')]['id'],'role':_0x3b08a7['user'][_0xafe2('0x4a')]},'options':{'expiresIn':0x15180}};return signJwt(_0x4cb9bf)[_0xafe2('0x2c')](function(_0x57cab8){_0x1d8a9f[_0xafe2('0x4b')](_0xafe2('0x4c'),_0x57cab8);_0x1d8a9f[_0xafe2('0x4d')](_0xafe2('0x4e'));})['catch'](function(_0x16b997){return _0x1d8a9f['status'](0x1f4)[_0xafe2('0x4f')](_0x16b997);});};exports[_0xafe2('0x50')]=function(_0x340edf){if(_[_0xafe2('0x51')](_0x340edf[_0xafe2('0x40')])||_[_0xafe2('0x51')](_0x340edf['apiKeyIat'])){return null;}else{return createJwt(_0x340edf);}};exports['generateApiKey']=function(_0x397b2d){_0x397b2d[_0xafe2('0x40')]=generateNonce();_0x397b2d[_0xafe2('0x52')]=generateIssuedAt();return createJwt(_0x397b2d);};exports[_0xafe2('0x53')]=function(_0x434627,_0x20094b){var _0x252291=_0x434627[_0xafe2('0x3a')][_0xafe2('0x3b')];if(_0x252291){var _0x274d17={'nonce':_0x20094b[_0xafe2('0x40')],'iat':_0x20094b[_0xafe2('0x52')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xafe2('0x3c')]()};return verifyJwt(_0x252291,_0x274d17)[_0xafe2('0x2c')](function(){return generateApiKey(_0x20094b);});}else{throw{'message':_0xafe2('0x54')};}};function signJwt(_0x553a94){var _0x289a43=BPromise[_0xafe2('0x55')](jwt['sign'],{'context':jwt});var _0x28029e=_0x553a94[_0xafe2('0x56')]||config[_0xafe2('0x9')][_0xafe2('0xa')];return new BPromise(function(_0x2ccb31,_0x1c1364){_0x289a43(_0x553a94[_0xafe2('0x57')],_0x28029e,_0x553a94['options'])[_0xafe2('0x2c')](function(_0x4219d8){_0x2ccb31(_0x4219d8);})[_0xafe2('0x36')](function(_0x3978a0){_0x1c1364(_0x3978a0);});});}function verifyJwt(_0x25b982,_0x126a4b,_0xd6126e){var _0x58207d=BPromise[_0xafe2('0x55')](jwt[_0xafe2('0x58')],{'context':jwt});var _0x12b789=_0xd6126e||config['secrets']['session'];return new BPromise(function(_0x455449,_0x3d5a51){_0x58207d(_0x25b982,_0x12b789,_0x126a4b)['then'](function(_0xb0c1b0){_0x455449(_0xb0c1b0);})[_0xafe2('0x36')](function(_0xfea470){_0x3d5a51(_0xfea470);});});}function generateNonce(){return crypto[_0xafe2('0x59')](0x10)['toString'](_0xafe2('0x5a'));}function generateIssuedAt(){return Math[_0xafe2('0x5b')](Date['now']()/0x3e8)['toString']();}function createJwt(_0x10f068){var _0x49eb3b={'payload':{'iat':_0x10f068[_0xafe2('0x52')],'nonce':_0x10f068[_0xafe2('0x40')]},'options':{'algorithm':'HS512','subject':_0x10f068['id'][_0xafe2('0x5c')](),'issuer':hardwareConf[_0xafe2('0x3c')](),'audience':hardwareConf[_0xafe2('0x3c')]()}};return signJwt(_0x49eb3b)['then'](function(_0x55cf51){return{'iat':_0x10f068[_0xafe2('0x52')],'nonce':_0x10f068['apiKeyNonce'],'token':_0x55cf51};});} \ No newline at end of file +var _0x89f2=['retrieveApiKey','isNil','apiKeyIat','generateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','promisify','sign','secret','payload','verify','randomBytes','hex','floor','now','toString','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','lodash','express-jwt','basic-auth','bluebird','secrets','session','role','name','internal','email','userpic','voicePause','chatPause','mailPause','faxPause','openchannelPause','pauseType','lastLoginAt','lastPauseAt','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','params','disposition','closed','json','unmanaged','Forbidden.','catch','authorization','startsWith','headers','Basic','find','authenticate','pass','status','Wrong\x20credentials.','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','then','User','isEqual','apiKeyNonce','nonce','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','../../config/license/util','getLicense','update','Forbidden','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','/dashboards/general','send'];(function(_0x3c4f1f,_0x20d3ec){var _0x19cb69=function(_0x2e04bc){while(--_0x2e04bc){_0x3c4f1f['push'](_0x3c4f1f['shift']());}};_0x19cb69(++_0x20d3ec);}(_0x89f2,0x19c));var _0x289f=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0x89f2[_0x36dfbd];return _0x4ecad9;};'use strict';var db=require(_0x289f('0x0'))['db'];var config=require(_0x289f('0x1'));var hardwareConf=require(_0x289f('0x2'));var _=require(_0x289f('0x3'));var jwt=require('jsonwebtoken');var expressJwt=require(_0x289f('0x4'));var compose=require('composable-middleware');var basicAuth=require(_0x289f('0x5'));var crypto=require('crypto');var BPromise=require(_0x289f('0x6'));var validateJwt=expressJwt({'secret':config[_0x289f('0x7')][_0x289f('0x8')]});var userAttributes=['id',_0x289f('0x9'),'fullname',_0x289f('0xa'),_0x289f('0xb'),_0x289f('0xc'),_0x289f('0xd'),'permissions','md5secret',_0x289f('0xe'),_0x289f('0xf'),_0x289f('0x10'),_0x289f('0x11'),'smsPause',_0x289f('0x12'),_0x289f('0x13'),'showWebBar',_0x289f('0x14'),_0x289f('0x15'),'crudPermissions',_0x289f('0x16'),_0x289f('0x17'),_0x289f('0x18'),_0x289f('0x19'),'phoneBarAutoAnswerDelay',_0x289f('0x1a'),_0x289f('0x1b'),_0x289f('0x1c'),_0x289f('0x1d'),'phoneBarPrefixRequired',_0x289f('0x1e'),_0x289f('0x1f'),_0x289f('0x20'),_0x289f('0x21'),_0x289f('0x22')];exports[_0x289f('0x23')]=function(){return this[_0x289f('0x24')](!![])[_0x289f('0x25')](function(_0x469f8a,_0x5dbf5b,_0x53ae6c){if(_0x469f8a[_0x289f('0x26')]){_0x53ae6c();}else{return db[_0x289f('0x27')][_0x289f('0x28')]({'where':{'id':_0x469f8a[_0x289f('0x29')]['id']},'attributes':['id','closed',_0x289f('0x2a')],'raw':!![]})['then'](function(_0x52cedf){if(_0x52cedf&&_0x52cedf[_0x289f('0x2b')]){return _0x5dbf5b['status'](_0x52cedf['disposition']==='unmanaged'?0x195:0x193)[_0x289f('0x2c')]({'message':_0x52cedf[_0x289f('0x2a')]===_0x289f('0x2d')?'Unmanaged.':_0x289f('0x2e')});}else{_0x53ae6c();}})[_0x289f('0x2f')](function(_0x3dcd46){_0x53ae6c(_0x3dcd46);});}});};exports[_0x289f('0x24')]=function isAuthenticated(_0x46faef){return compose()['use'](function(_0x2d863c,_0x2f8ecb,_0x34f06e){if(_0x2d863c['headers'][_0x289f('0x30')]){if(_[_0x289f('0x31')](_0x2d863c[_0x289f('0x32')][_0x289f('0x30')],_0x289f('0x33'))){var _0xfd225c=basicAuth(_0x2d863c);db['User'][_0x289f('0x34')]({'where':{'name':_0xfd225c['name']}})['then'](function(_0x393435){if(!_0x393435||!_0x393435[_0x289f('0x35')](_0xfd225c[_0x289f('0x36')])){return _0x2f8ecb[_0x289f('0x37')](0x191)[_0x289f('0x2c')]({'message':_0x289f('0x38')});}_0x2d863c[_0x289f('0x26')]={'id':_0x393435['id']};_0x34f06e();})[_0x289f('0x2f')](function(_0x3f7ba5){_0x34f06e(_0x3f7ba5);});}else if(_[_0x289f('0x31')](_0x2d863c[_0x289f('0x32')][_0x289f('0x30')],_0x289f('0x39'))){validateJwt(_0x2d863c,_0x2f8ecb,_0x34f06e);}else{if(_0x46faef){_0x34f06e();}else{return _0x2f8ecb[_0x289f('0x37')](0x193)[_0x289f('0x2c')]({'message':_0x289f('0x3a')});}}}else if(_0x2d863c[_0x289f('0x3b')][_0x289f('0x3c')]){var _0x4dcf93={'audience':hardwareConf[_0x289f('0x3d')](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x2d863c[_0x289f('0x3b')]['apikey'],_0x4dcf93)[_0x289f('0x3e')](function(_0x3e0567){return db[_0x289f('0x3f')][_0x289f('0x34')]({'where':{'id':_0x3e0567['sub']}})[_0x289f('0x3e')](function(_0x2eaf0a){if(!_0x2eaf0a||!_[_0x289f('0x40')](_0x2eaf0a[_0x289f('0x41')],_0x3e0567[_0x289f('0x42')])){return _0x2f8ecb[_0x289f('0x37')](0x193)[_0x289f('0x2c')]({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}_0x2d863c['user']={'id':_0x2eaf0a['id']};_0x34f06e();});})[_0x289f('0x2f')](function(_0x2f941e){_0x34f06e(_0x2f941e);});}else if(_0x46faef){_0x34f06e();}else{return _0x2f8ecb[_0x289f('0x37')](0x193)['json']({'message':_0x289f('0x3a')});}})[_0x289f('0x25')](function(_0x2569bf,_0x30268b,_0x5bc5b4){if(_0x2569bf['user']){db[_0x289f('0x3f')]['find']({'where':{'id':_0x2569bf['user']['id']},'attributes':userAttributes})['then'](function(_0x5d16bc){if(!_0x5d16bc){return _0x30268b[_0x289f('0x37')](0x194)[_0x289f('0x2c')]({'message':_0x289f('0x43')});}_0x2569bf['user']=_0x5d16bc;_0x5bc5b4();})[_0x289f('0x2f')](function(_0x4a4993){_0x5bc5b4(_0x4a4993);});}else if(_0x46faef){_0x5bc5b4();}else{return _0x30268b[_0x289f('0x37')](0x194)[_0x289f('0x2c')]({'message':_0x289f('0x44')});}});};exports[_0x289f('0x45')]=function canUpdate(){return compose()[_0x289f('0x25')](function(_0x2168c1,_0x5e5ca8,_0x5cea61){return require(_0x289f('0x46'))[_0x289f('0x47')]()[_0x289f('0x3e')](function(_0x499098){if(_0x499098[_0x289f('0x48')]){_0x5cea61();}else{return _0x5e5ca8[_0x289f('0x37')](0x193)[_0x289f('0x2c')]({'message':_0x289f('0x49')});}})[_0x289f('0x2f')](function(_0x311e92){_0x5cea61(_0x311e92);});});};exports[_0x289f('0x4a')]=function(_0xa0f3e9,_0x28276f,_0x355b90){_0xa0f3e9['isMiddleware']=!![];return _0x355b90();};exports[_0x289f('0x4b')]=function signToken(_0x575e12){return signJwt(_0x575e12);};exports[_0x289f('0x4c')]=function(_0x547650,_0x2bd6cd){if(!_0x547650[_0x289f('0x26')]){return _0x2bd6cd[_0x289f('0x37')](0x194)['json']({'message':_0x289f('0x4d')});}var _0x484c2a={'payload':{'id':_0x547650[_0x289f('0x26')]['id'],'role':_0x547650[_0x289f('0x26')][_0x289f('0x9')]},'options':{'expiresIn':0x15180}};return signJwt(_0x484c2a)['then'](function(_0x123787){_0x2bd6cd[_0x289f('0x4e')](_0x289f('0x4f'),_0x123787);_0x2bd6cd[_0x289f('0x50')](_0x289f('0x51'));})['catch'](function(_0x91c2b1){return _0x2bd6cd[_0x289f('0x37')](0x1f4)[_0x289f('0x52')](_0x91c2b1);});};exports[_0x289f('0x53')]=function(_0x1897cc){if(_['isNil'](_0x1897cc['apiKeyNonce'])||_[_0x289f('0x54')](_0x1897cc[_0x289f('0x55')])){return null;}else{return createJwt(_0x1897cc);}};exports[_0x289f('0x56')]=function(_0x29a80d){_0x29a80d[_0x289f('0x41')]=generateNonce();_0x29a80d['apiKeyIat']=generateIssuedAt();return createJwt(_0x29a80d);};exports['regenerateApiKey']=function(_0x2522b2,_0x181d10){var _0x325b33=_0x2522b2[_0x289f('0x3b')][_0x289f('0x3c')];if(_0x325b33){var _0x270265={'nonce':_0x181d10[_0x289f('0x41')],'iat':_0x181d10[_0x289f('0x55')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x325b33,_0x270265)[_0x289f('0x3e')](function(){return generateApiKey(_0x181d10);});}else{throw{'message':_0x289f('0x57')};}};function signJwt(_0x28446b){var _0x48891e=BPromise[_0x289f('0x58')](jwt[_0x289f('0x59')],{'context':jwt});var _0x4ffbb4=_0x28446b[_0x289f('0x5a')]||config[_0x289f('0x7')][_0x289f('0x8')];return new BPromise(function(_0x205fea,_0x449566){_0x48891e(_0x28446b[_0x289f('0x5b')],_0x4ffbb4,_0x28446b['options'])[_0x289f('0x3e')](function(_0x190fa7){_0x205fea(_0x190fa7);})[_0x289f('0x2f')](function(_0x5c899f){_0x449566(_0x5c899f);});});}function verifyJwt(_0x991cf6,_0x228ff0,_0x463502){var _0x3e367e=BPromise[_0x289f('0x58')](jwt[_0x289f('0x5c')],{'context':jwt});var _0x2a580f=_0x463502||config[_0x289f('0x7')]['session'];return new BPromise(function(_0x24934a,_0x2e6923){_0x3e367e(_0x991cf6,_0x2a580f,_0x228ff0)[_0x289f('0x3e')](function(_0xb87cd9){_0x24934a(_0xb87cd9);})[_0x289f('0x2f')](function(_0x28155e){_0x2e6923(_0x28155e);});});}function generateNonce(){return crypto[_0x289f('0x5d')](0x10)['toString'](_0x289f('0x5e'));}function generateIssuedAt(){return Math[_0x289f('0x5f')](Date[_0x289f('0x60')]()/0x3e8)[_0x289f('0x61')]();}function createJwt(_0x58d28b){var _0x3204b9={'payload':{'iat':_0x58d28b[_0x289f('0x55')],'nonce':_0x58d28b[_0x289f('0x41')]},'options':{'algorithm':_0x289f('0x62'),'subject':_0x58d28b['id']['toString'](),'issuer':hardwareConf[_0x289f('0x3d')](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x3204b9)['then'](function(_0x379394){return{'iat':_0x58d28b[_0x289f('0x55')],'nonce':_0x58d28b[_0x289f('0x41')],'token':_0x379394};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 8bcac7e..c4d5857 100644 --- a/server/components/encryptor/index.js +++ b/server/components/encryptor/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['data','update','binary','write','end','decryptFile','createDecipher','final','close','unlink','bluebird','aes192','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','algorithm'];(function(_0x9db5d3,_0x4eea5e){var _0x477a81=function(_0x28e774){while(--_0x28e774){_0x9db5d3['push'](_0x9db5d3['shift']());}};_0x477a81(++_0x4eea5e);}(_0xbaf0,0x12a));var _0x0baf=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xbaf0[_0x3947c9];return _0x2e7871;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require(_0x0baf('0x0'));var defaultOptions={'algorithm':_0x0baf('0x1')};function combineOptions(_0x1e212d){var _0x263f79={};for(var _0x1688bc in defaultOptions){if(defaultOptions[_0x0baf('0x2')](_0x1688bc)){_0x263f79[_0x1688bc]=defaultOptions[_0x1688bc];}}if(_0x1e212d){for(var _0x5a3e42 in _0x1e212d){if(_0x1e212d[_0x0baf('0x2')](_0x5a3e42)){_0x263f79[_0x5a3e42]=_0x1e212d[_0x5a3e42];}}}return _0x263f79;}exports[_0x0baf('0x3')]=function(_0x2d3fa5,_0x39b8f3,_0xe4c3c4,_0x335e24){return new BPromise(function(_0x1a10b1,_0x2dcaac){_0x335e24=combineOptions(_0x335e24);var _0x1d0a0d=new Buffer(_0xe4c3c4);var _0x5f5030=fs[_0x0baf('0x4')](_0x2d3fa5);var _0x5f20aa=fs[_0x0baf('0x5')](_0x39b8f3);var _0x2c7442=crypto[_0x0baf('0x6')](_0x335e24[_0x0baf('0x7')],_0x1d0a0d);_0x5f5030['on'](_0x0baf('0x8'),function(_0xf4c8ac){var _0x41cead=new Buffer(_0x2c7442[_0x0baf('0x9')](_0xf4c8ac),_0x0baf('0xa'));_0x5f20aa[_0x0baf('0xb')](_0x41cead);});_0x5f5030['on'](_0x0baf('0xc'),function(){try{var _0x51d93c=new Buffer(_0x2c7442['final'](_0x0baf('0xa')),_0x0baf('0xa'));_0x5f20aa[_0x0baf('0xb')](_0x51d93c);_0x5f20aa[_0x0baf('0xc')]();_0x5f20aa['on']('close',function(){return _0x1a10b1(_0x39b8f3);});}catch(_0x2ab33e){fs['unlink'](_0x39b8f3);return _0x2dcaac(_0x2ab33e);}});});};exports[_0x0baf('0xd')]=function(_0x1f50c3,_0x7fbf67,_0x2bc381,_0xb8339e){return new BPromise(function(_0x469599,_0x4f80a8){_0xb8339e=combineOptions(_0xb8339e);var _0x4cd79d=new Buffer(_0x2bc381);var _0x2312c7=fs[_0x0baf('0x4')](_0x1f50c3);var _0x283408=fs[_0x0baf('0x5')](_0x7fbf67);var _0x2cf7da=crypto[_0x0baf('0xe')](_0xb8339e['algorithm'],_0x4cd79d);_0x2312c7['on'](_0x0baf('0x8'),function(_0xfbecec){var _0x1ef0e5=new Buffer(_0x2cf7da[_0x0baf('0x9')](_0xfbecec),_0x0baf('0xa'));_0x283408[_0x0baf('0xb')](_0x1ef0e5);});_0x2312c7['on']('end',function(){try{var _0x5cff5d=new Buffer(_0x2cf7da[_0x0baf('0xf')](_0x0baf('0xa')),_0x0baf('0xa'));_0x283408[_0x0baf('0xb')](_0x5cff5d);_0x283408[_0x0baf('0xc')]();_0x283408['on'](_0x0baf('0x10'),function(){return _0x469599(_0x7fbf67);});}catch(_0x210cd8){fs[_0x0baf('0x11')](_0x7fbf67);return _0x4f80a8(_0x210cd8);}});});}; \ No newline at end of file +var _0xbaf0=['data','update','binary','write','end','decryptFile','createDecipher','final','close','unlink','bluebird','aes192','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','algorithm'];(function(_0x213518,_0x51e022){var _0x1baf75=function(_0x5c8444){while(--_0x5c8444){_0x213518['push'](_0x213518['shift']());}};_0x1baf75(++_0x51e022);}(_0xbaf0,0x12a));var _0x0baf=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xbaf0[_0x432682];return _0x463d05;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require(_0x0baf('0x0'));var defaultOptions={'algorithm':_0x0baf('0x1')};function combineOptions(_0x1e212d){var _0x263f79={};for(var _0x1688bc in defaultOptions){if(defaultOptions[_0x0baf('0x2')](_0x1688bc)){_0x263f79[_0x1688bc]=defaultOptions[_0x1688bc];}}if(_0x1e212d){for(var _0x5a3e42 in _0x1e212d){if(_0x1e212d[_0x0baf('0x2')](_0x5a3e42)){_0x263f79[_0x5a3e42]=_0x1e212d[_0x5a3e42];}}}return _0x263f79;}exports[_0x0baf('0x3')]=function(_0x2d3fa5,_0x39b8f3,_0xe4c3c4,_0x335e24){return new BPromise(function(_0x1a10b1,_0x2dcaac){_0x335e24=combineOptions(_0x335e24);var _0x1d0a0d=new Buffer(_0xe4c3c4);var _0x5f5030=fs[_0x0baf('0x4')](_0x2d3fa5);var _0x5f20aa=fs[_0x0baf('0x5')](_0x39b8f3);var _0x2c7442=crypto[_0x0baf('0x6')](_0x335e24[_0x0baf('0x7')],_0x1d0a0d);_0x5f5030['on'](_0x0baf('0x8'),function(_0xf4c8ac){var _0x41cead=new Buffer(_0x2c7442[_0x0baf('0x9')](_0xf4c8ac),_0x0baf('0xa'));_0x5f20aa[_0x0baf('0xb')](_0x41cead);});_0x5f5030['on'](_0x0baf('0xc'),function(){try{var _0x51d93c=new Buffer(_0x2c7442['final'](_0x0baf('0xa')),_0x0baf('0xa'));_0x5f20aa[_0x0baf('0xb')](_0x51d93c);_0x5f20aa[_0x0baf('0xc')]();_0x5f20aa['on']('close',function(){return _0x1a10b1(_0x39b8f3);});}catch(_0x2ab33e){fs['unlink'](_0x39b8f3);return _0x2dcaac(_0x2ab33e);}});});};exports[_0x0baf('0xd')]=function(_0x1f50c3,_0x7fbf67,_0x2bc381,_0xb8339e){return new BPromise(function(_0x469599,_0x4f80a8){_0xb8339e=combineOptions(_0xb8339e);var _0x4cd79d=new Buffer(_0x2bc381);var _0x2312c7=fs[_0x0baf('0x4')](_0x1f50c3);var _0x283408=fs[_0x0baf('0x5')](_0x7fbf67);var _0x2cf7da=crypto[_0x0baf('0xe')](_0xb8339e['algorithm'],_0x4cd79d);_0x2312c7['on'](_0x0baf('0x8'),function(_0xfbecec){var _0x1ef0e5=new Buffer(_0x2cf7da[_0x0baf('0x9')](_0xfbecec),_0x0baf('0xa'));_0x283408[_0x0baf('0xb')](_0x1ef0e5);});_0x2312c7['on']('end',function(){try{var _0x5cff5d=new Buffer(_0x2cf7da[_0x0baf('0xf')](_0x0baf('0xa')),_0x0baf('0xa'));_0x283408[_0x0baf('0xb')](_0x5cff5d);_0x283408[_0x0baf('0xc')]();_0x283408['on'](_0x0baf('0x10'),function(){return _0x469599(_0x7fbf67);});}catch(_0x210cd8){fs[_0x0baf('0x11')](_0x7fbf67);return _0x4f80a8(_0x210cd8);}});});}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 78c7bed..3d56b63 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 _0xe14d=['.csv','join','mkdirSync','each','%s%d.%s','csv','%s.%s','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','util','path','lodash','to-csv','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','Empty','length','num','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','push','dirname','basename'];(function(_0xd6a1c9,_0x203324){var _0x51ea29=function(_0x165a30){while(--_0x165a30){_0xd6a1c9['push'](_0xd6a1c9['shift']());}};_0x51ea29(++_0x203324);}(_0xe14d,0x1ee));var _0xde14=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0xe14d[_0x4e9628];return _0x27bc8c;};'use strict';var util=require(_0xde14('0x0'));var path=require(_0xde14('0x1'));var _=require(_0xde14('0x2'));var csv=require(_0xde14('0x3'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0xde14('0x4'));var rimraf=require(_0xde14('0x5'));var db=require('../../mysqldb')['db'];var dbH=require(_0xde14('0x6'))[_0xde14('0x7')];var logger=require(_0xde14('0x8'))(_0xde14('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0xde14('0xa')][0x2]);var QUERY=process[_0xde14('0xa')][0x3];var PATH=process['argv'][0x4];function analyticExtractedReport(_0x5a1344,_0x1bd49d){var _0x115b7d={'status':_0x5a1344};var _0x2b0e7c={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1bd49d){_0x115b7d[_0xde14('0xb')]=_0x1bd49d;}return db[_0xde14('0xc')][_0xde14('0xd')](_0x115b7d,_0x2b0e7c);}function main(){var _0xa17e8=0x1388;var _0x1ce0a2;logger['info'](util[_0xde14('0xe')](_0xde14('0xf'),EXTRACTED_REPORT_ID,_0xde14('0x10')));return db[_0xde14('0x11')][_0xde14('0x12')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xde14('0x13'),_0xde14('0x14')]})[_0xde14('0x15')](function(_0x34e28f){if(_0x34e28f){_0x1ce0a2=_0x34e28f;_0xa17e8=_0x1ce0a2[_0xde14('0x14')]||0x1388;}})[_0xde14('0x15')](function(){return dbH[_0xde14('0x16')][_0xde14('0x17')](util[_0xde14('0xe')](_0xde14('0x18'),QUERY),{'type':dbH['sequelize']['QueryTypes'][_0xde14('0x19')]});})[_0xde14('0x15')](function(_0x26c1ec){if(!_0x26c1ec[0x0]['num']){return analyticExtractedReport(_0xde14('0x1a'));}var _0x31adb3=[];var _0x257390=0x0;var _0x31902a=!![];if(_0x26c1ec&&_0x26c1ec[_0xde14('0x1b')]){var _0x1b9d4b=_0x26c1ec[0x0][_0xde14('0x1c')]%(_0x257390+_0xa17e8);if(_0x1ce0a2[_0xde14('0x13')]){for(;_0x31902a;_0x257390+=_0xa17e8,_0x1b9d4b=_0x26c1ec[0x0][_0xde14('0x1c')]%(_0x257390+_0xa17e8)){if(_0x1b9d4b==0x0||_0x1b9d4b==_0x26c1ec[0x0][_0xde14('0x1c')]){_0x31902a=![];}_0x31adb3['push'](dbH[_0xde14('0x16')][_0xde14('0x17')](util[_0xde14('0xe')](_0xde14('0x1d'),QUERY,_0xa17e8,_0x257390),{'type':dbH['sequelize'][_0xde14('0x1e')]['SELECT']}));}}else{_0x31adb3[_0xde14('0x1f')](dbH['sequelize'][_0xde14('0x17')](QUERY,{'type':dbH[_0xde14('0x16')][_0xde14('0x1e')][_0xde14('0x19')]}));}}var _0x39bdc5=path[_0xde14('0x20')](PATH);var _0x40b648=path[_0xde14('0x21')](PATH,_0xde14('0x22'));var _0x163b79=_0x1ce0a2[_0xde14('0x13')]&&_0x31adb3[_0xde14('0x1b')]>0x1;var _0x8f8033=[];if(!fs['existsSync'](path[_0xde14('0x23')](_0x39bdc5,_0x40b648))&&_0x163b79){fs[_0xde14('0x24')](path[_0xde14('0x23')](_0x39bdc5,_0x40b648));}return BPromise[_0xde14('0x25')](_0x31adb3,function(_0x1bb7be){_0x8f8033[_0xde14('0x1f')](_0x1bb7be);})[_0xde14('0x15')](function(){for(var _0x23c735=0x0;_0x23c735<_0x8f8033[_0xde14('0x1b')];_0x23c735+=0x1){var _0x350a78;var _0x4eff65=_0x8f8033[_0x23c735];if(_0x163b79){_0x350a78=path[_0xde14('0x23')](_0x39bdc5,_0x40b648,util[_0xde14('0xe')](_0xde14('0x26'),_0x40b648,_0x23c735,_0xde14('0x27')));}else{_0x350a78=path['join'](_0x39bdc5,util[_0xde14('0xe')](_0xde14('0x28'),_0x40b648,_0xde14('0x27')));}fs['writeFileSync'](_0x350a78,csv(_0x4eff65));}})[_0xde14('0x15')](function(){if(_0x163b79){zipdir(path['join'](_0x39bdc5,_0x40b648),{'saveTo':path[_0xde14('0x23')](_0x39bdc5,util[_0xde14('0xe')](_0xde14('0x28'),_0x40b648,_0xde14('0x29')))},function(_0x2aca96,_0x237d3f){});rimraf(path[_0xde14('0x23')](_0x39bdc5,_0x40b648),function(){});}})[_0xde14('0x15')](function(){logger['info'](util[_0xde14('0xe')](_0xde14('0x2a'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0xde14('0x2b'),_0x163b79?util['format'](_0xde14('0x28'),_0x40b648,_0x163b79?_0xde14('0x29'):_0xde14('0x27')):null);});})[_0xde14('0x2c')](function(_0x13c164){logger['info'](util[_0xde14('0xe')](_0xde14('0x2d'),EXTRACTED_REPORT_ID,'CSV'),util[_0xde14('0x2e')](_0x13c164,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0xde14('0x2f'));});}main(); \ No newline at end of file +var _0x91a7=['push','csv','%s.%s','writeFileSync','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','path','lodash','to-csv','zip-dir','../../mysqldb','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','format','CSV','Setting','find','split','splitSizeCsv','then','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','Empty','%s\x20limit\x20%d\x20OFFSET\x20%d','query','dirname','basename','.csv','length','existsSync','join','each'];(function(_0x474c66,_0xbce925){var _0xcbd9bf=function(_0x44019d){while(--_0x44019d){_0x474c66['push'](_0x474c66['shift']());}};_0xcbd9bf(++_0xbce925);}(_0x91a7,0xe7));var _0x791a=function(_0x40f8fc,_0x38e3f7){_0x40f8fc=_0x40f8fc-0x0;var _0x52d2d0=_0x91a7[_0x40f8fc];return _0x52d2d0;};'use strict';var util=require('util');var path=require(_0x791a('0x0'));var _=require(_0x791a('0x1'));var csv=require(_0x791a('0x2'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0x791a('0x3'));var rimraf=require('rimraf');var db=require(_0x791a('0x4'))['db'];var dbH=require('../../mysqldb')['dbH'];var logger=require(_0x791a('0x5'))(_0x791a('0x6'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x791a('0x7')][0x3];var PATH=process['argv'][0x4];function analyticExtractedReport(_0x33baac,_0x159e24){var _0x5aa10a={'status':_0x33baac};var _0x1a32b4={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x159e24){_0x5aa10a[_0x791a('0x8')]=_0x159e24;}return db[_0x791a('0x9')][_0x791a('0xa')](_0x5aa10a,_0x1a32b4);}function main(){var _0x266e4b=0x1388;var _0x5249d5;logger[_0x791a('0xb')](util[_0x791a('0xc')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x791a('0xd')));return db[_0x791a('0xe')][_0x791a('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x791a('0x10'),_0x791a('0x11')]})[_0x791a('0x12')](function(_0x53dc41){if(_0x53dc41){_0x5249d5=_0x53dc41;_0x266e4b=_0x5249d5['splitSizeCsv']||0x1388;}})[_0x791a('0x12')](function(){return dbH[_0x791a('0x13')]['query'](util[_0x791a('0xc')](_0x791a('0x14'),QUERY),{'type':dbH['sequelize'][_0x791a('0x15')][_0x791a('0x16')]});})[_0x791a('0x12')](function(_0x5cdf2){if(!_0x5cdf2[0x0]['num']){return analyticExtractedReport(_0x791a('0x17'));}var _0x575d11=[];var _0x43dea6=0x0;var _0x355155=!![];if(_0x5cdf2&&_0x5cdf2['length']){var _0x237adb=_0x5cdf2[0x0]['num']%(_0x43dea6+_0x266e4b);if(_0x5249d5[_0x791a('0x10')]){for(;_0x355155;_0x43dea6+=_0x266e4b,_0x237adb=_0x5cdf2[0x0]['num']%(_0x43dea6+_0x266e4b)){if(_0x237adb==0x0||_0x237adb==_0x5cdf2[0x0]['num']){_0x355155=![];}_0x575d11['push'](dbH[_0x791a('0x13')]['query'](util['format'](_0x791a('0x18'),QUERY,_0x266e4b,_0x43dea6),{'type':dbH[_0x791a('0x13')][_0x791a('0x15')][_0x791a('0x16')]}));}}else{_0x575d11['push'](dbH[_0x791a('0x13')][_0x791a('0x19')](QUERY,{'type':dbH[_0x791a('0x13')][_0x791a('0x15')]['SELECT']}));}}var _0x448085=path[_0x791a('0x1a')](PATH);var _0x25bae5=path[_0x791a('0x1b')](PATH,_0x791a('0x1c'));var _0x1091af=_0x5249d5[_0x791a('0x10')]&&_0x575d11[_0x791a('0x1d')]>0x1;var _0x323c6a=[];if(!fs[_0x791a('0x1e')](path[_0x791a('0x1f')](_0x448085,_0x25bae5))&&_0x1091af){fs['mkdirSync'](path[_0x791a('0x1f')](_0x448085,_0x25bae5));}return BPromise[_0x791a('0x20')](_0x575d11,function(_0x380329){_0x323c6a[_0x791a('0x21')](_0x380329);})['then'](function(){for(var _0x456480=0x0;_0x456480<_0x323c6a[_0x791a('0x1d')];_0x456480+=0x1){var _0x51dcca;var _0xdfa84f=_0x323c6a[_0x456480];if(_0x1091af){_0x51dcca=path[_0x791a('0x1f')](_0x448085,_0x25bae5,util[_0x791a('0xc')]('%s%d.%s',_0x25bae5,_0x456480,_0x791a('0x22')));}else{_0x51dcca=path[_0x791a('0x1f')](_0x448085,util[_0x791a('0xc')](_0x791a('0x23'),_0x25bae5,_0x791a('0x22')));}fs[_0x791a('0x24')](_0x51dcca,csv(_0xdfa84f));}})[_0x791a('0x12')](function(){if(_0x1091af){zipdir(path[_0x791a('0x1f')](_0x448085,_0x25bae5),{'saveTo':path['join'](_0x448085,util[_0x791a('0xc')](_0x791a('0x23'),_0x25bae5,_0x791a('0x25')))},function(_0x59d2c0,_0x1cdda9){});rimraf(path['join'](_0x448085,_0x25bae5),function(){});}})[_0x791a('0x12')](function(){logger[_0x791a('0xb')](util[_0x791a('0xc')](_0x791a('0x26'),EXTRACTED_REPORT_ID,_0x791a('0xd')));return analyticExtractedReport(_0x791a('0x27'),_0x1091af?util[_0x791a('0xc')]('%s.%s',_0x25bae5,_0x1091af?_0x791a('0x25'):_0x791a('0x22')):null);});})[_0x791a('0x28')](function(_0x27f758){logger[_0x791a('0xb')](util['format'](_0x791a('0x29'),EXTRACTED_REPORT_ID,_0x791a('0xd')),util[_0x791a('0x2a')](_0x27f758,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x791a('0x2b'));});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 68dc167..22a876b 100644 --- a/server/components/export/pdf.js +++ b/server/components/export/pdf.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['query','format','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','push','SELECT','existsSync','join','mkdirSync','each','name','startDate','endDate','landscape','black','body','content','/fonts/Roboto-Medium.ttf','/fonts/Roboto-Italic.ttf','/fonts/Roboto-MediumItalic.ttf','createPdfKitDocument','pdf','%s.%s','pipe','createWriteStream','finish','log','err','end','zip','info','Completed','PDF','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','lodash','util','path','moment','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','hasOwnProperty','tableHeader','num','Empty','dirname','basename','.pdf','Setting','find','split','then','splitSizePdf','length','sequelize'];(function(_0x333ffa,_0x4f91db){var _0xeb723e=function(_0x379896){while(--_0x379896){_0x333ffa['push'](_0x333ffa['shift']());}};_0xeb723e(++_0x4f91db);}(_0xb10b,0x12a));var _0xbb10=function(_0x7cf586,_0xd0ff06){_0x7cf586=_0x7cf586-0x0;var _0x3c38a4=_0xb10b[_0x7cf586];return _0x3c38a4;};'use strict';var _=require(_0xbb10('0x0'));var fs=require('fs');var BPromise=require('bluebird');var util=require(_0xbb10('0x1'));var path=require(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require(_0xbb10('0x4'));var rimraf=require(_0xbb10('0x5'));var db=require(_0xbb10('0x6'))['db'];var dbH=require(_0xbb10('0x6'))[_0xbb10('0x7')];var logger=require(_0xbb10('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xbb10('0x9')][0x2]);var QUERY=process[_0xbb10('0x9')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0xbb10('0x9')][0x5];var FORMAT=_0xbb10('0xa');var _extractedReport;function analyticExtractedReport(_0x21370f,_0x1c3ee5){var _0x2353ef={'status':_0x21370f};var _0x1ce33e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1c3ee5){_0x2353ef[_0xbb10('0xb')]=_0x1c3ee5;}return db[_0xbb10('0xc')]['update'](_0x2353ef,_0x1ce33e);}function getHeader(_0x4e47f8){var _0x20bd61=[];for(var _0x118a74 in _0x4e47f8){if(_0x4e47f8[_0xbb10('0xd')](_0x118a74)){_0x20bd61['push']({'text':_0x118a74,'style':_0xbb10('0xe')});}}return _0x20bd61;}function extractReport(_0x5be7e0){var _0x44fb19=0x1388;var _0x916a32;if(!_0x5be7e0[0x0][_0xbb10('0xf')]){return analyticExtractedReport(_0xbb10('0x10'));}var _0x442548=[];var _0x147230=0x0;var _0x58a612=!![];var _0x26e021=path[_0xbb10('0x11')](PATH);var _0x45b9d6=path[_0xbb10('0x12')](PATH,_0xbb10('0x13'));var _0x2f2ebf=![];var _0x24a57b=[];return db[_0xbb10('0x14')][_0xbb10('0x15')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xbb10('0x16'),'splitSizePdf']})[_0xbb10('0x17')](function(_0x1145f1){if(_0x1145f1){_0x916a32=_0x1145f1;_0x44fb19=_0x916a32[_0xbb10('0x18')]||0x3e8;}})[_0xbb10('0x17')](function(){if(_0x5be7e0&&_0x5be7e0[_0xbb10('0x19')]){var _0x1682a4=_0x5be7e0[0x0][_0xbb10('0xf')]%(_0x147230+_0x44fb19);if(_0x916a32[_0xbb10('0x16')]){for(;_0x58a612;_0x147230+=_0x44fb19,_0x1682a4=_0x5be7e0[0x0][_0xbb10('0xf')]%(_0x147230+_0x44fb19)){if(_0x1682a4==0x0||_0x1682a4==_0x5be7e0[0x0][_0xbb10('0xf')]){_0x58a612=![];}_0x442548['push'](dbH[_0xbb10('0x1a')][_0xbb10('0x1b')](util[_0xbb10('0x1c')](_0xbb10('0x1d'),QUERY,_0x44fb19,_0x147230),{'type':dbH[_0xbb10('0x1a')][_0xbb10('0x1e')]['SELECT']}));}}else{_0x442548[_0xbb10('0x1f')](dbH[_0xbb10('0x1a')]['query'](QUERY,{'type':dbH['sequelize'][_0xbb10('0x1e')][_0xbb10('0x20')]}));}}_0x2f2ebf=_0x916a32[_0xbb10('0x16')]&&_0x442548[_0xbb10('0x19')]>0x1;if(!fs[_0xbb10('0x21')](path[_0xbb10('0x22')](_0x26e021,_0x45b9d6))&&_0x2f2ebf){fs[_0xbb10('0x23')](path[_0xbb10('0x22')](_0x26e021,_0x45b9d6));}return BPromise[_0xbb10('0x24')](_0x442548,function(_0x395404){_0x24a57b[_0xbb10('0x1f')](_0x395404);});})[_0xbb10('0x17')](function(){return BPromise['each'](_0x442548,function(_0x4fedac,_0x4fb5e0){var _0xc93a04;var _0x3c5ae7=util[_0xbb10('0x1c')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,_extractedReport[_0xbb10('0x25')],moment(_extractedReport[_0xbb10('0x26')])[_0xbb10('0x1c')](FORMAT),moment(_extractedReport[_0xbb10('0x27')])[_0xbb10('0x1c')](FORMAT));var _0x20d946={'pageSize':'A4','pageOrientation':_0xbb10('0x28'),'content':[{'text':_0x3c5ae7,'style':'header'}],'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xbb10('0x29')}}};var _0x21ac54={'headerRows':0x1,'body':[]};_0x21ac54[_0xbb10('0x2a')][_0xbb10('0x1f')](getHeader(_0x4fedac[0x0]));var _0x1d30aa;for(var _0x2ff4c1=0x0;_0x2ff4c1<_0x4fedac['length'];_0x2ff4c1+=0x1){_0x1d30aa=[];for(var _0x221624 in _0x4fedac[_0x2ff4c1]){if(_0x4fedac[_0x2ff4c1]['hasOwnProperty'](_0x221624)){_0x1d30aa[_0xbb10('0x1f')](_0x4fedac[_0x2ff4c1][_0x221624]?_['toString'](_0x4fedac[_0x2ff4c1][_0x221624]):'');}}_0x21ac54[_0xbb10('0x2a')][_0xbb10('0x1f')](_0x1d30aa);}_0x20d946[_0xbb10('0x2b')]['push']({'table':_0x21ac54});return new BPromise(function(_0x518d47,_0x4c3744){var _0x34f65e=new PdfPrinter({'Roboto':{'normal':__dirname+'/fonts/Roboto-Regular.ttf','bold':__dirname+_0xbb10('0x2c'),'italics':__dirname+_0xbb10('0x2d'),'bolditalics':__dirname+_0xbb10('0x2e')}});var _0x1c0b57=_0x34f65e[_0xbb10('0x2f')](_0x20d946);if(_0x2f2ebf){_0xc93a04=path[_0xbb10('0x22')](_0x26e021,_0x45b9d6,util[_0xbb10('0x1c')]('%s%d.%s',_0x45b9d6,_0x4fb5e0,_0xbb10('0x30')));}else{_0xc93a04=path[_0xbb10('0x22')](_0x26e021,util[_0xbb10('0x1c')](_0xbb10('0x31'),_0x45b9d6,_0xbb10('0x30')));}var _0x9de708=_0x1c0b57[_0xbb10('0x32')](fs[_0xbb10('0x33')](_0xc93a04));_0x9de708['on'](_0xbb10('0x34'),function(){_0x518d47();});_0x9de708['on']('error',function(_0x2b5352){console[_0xbb10('0x35')](_0xbb10('0x36'),_0x2b5352);_0x4c3744(_0x2b5352);});_0x1c0b57[_0xbb10('0x37')]();});});})['then'](function(){if(_0x2f2ebf){return new BPromise(function(_0x111762,_0x5de37b){zipdir(path['join'](_0x26e021,_0x45b9d6),{'saveTo':path[_0xbb10('0x22')](_0x26e021,util[_0xbb10('0x1c')](_0xbb10('0x31'),_0x45b9d6,_0xbb10('0x38')))},function(_0x15d895){if(_0x15d895){_0x5de37b(_0x15d895);}else{_0x111762();}});});}})[_0xbb10('0x17')](function(){if(_0x2f2ebf){rimraf(path['join'](_0x26e021,_0x45b9d6),function(){});}})[_0xbb10('0x17')](function(){logger[_0xbb10('0x39')](util['format']('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0xbb10('0x3a'),_0x2f2ebf?util[_0xbb10('0x1c')](_0xbb10('0x31'),_0x45b9d6,_0x2f2ebf?'zip':_0xbb10('0x30')):null);});}function main(){logger[_0xbb10('0x39')](util[_0xbb10('0x1c')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xbb10('0x3b')));return db[_0xbb10('0xc')][_0xbb10('0x3c')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xbb10('0x17')](function(_0x4f1cdd){_extractedReport=_0x4f1cdd;return dbH[_0xbb10('0x1a')][_0xbb10('0x1b')](util['format'](_0xbb10('0x3d'),QUERY),{'type':dbH[_0xbb10('0x1a')][_0xbb10('0x1e')][_0xbb10('0x20')]});})[_0xbb10('0x17')](extractReport)[_0xbb10('0x3e')](function(_0x5f3d67){logger[_0xbb10('0x39')](util[_0xbb10('0x1c')](_0xbb10('0x3f'),EXTRACTED_REPORT_ID,_0xbb10('0x3b')),util['inspect'](_0x5f3d67,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0xbb10('0x40'));});}main(); \ No newline at end of file +var _0xd8b0=['format','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','existsSync','join','mkdirSync','each','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','endDate','landscape','black','body','toString','/fonts/Roboto-Medium.ttf','/fonts/Roboto-Italic.ttf','/fonts/Roboto-MediumItalic.ttf','createPdfKitDocument','%s%d.%s','pdf','pipe','finish','error','log','err','%s.%s','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','findOne','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','lodash','bluebird','pdfmake/src/printer','zip-dir','rimraf','../../mysqldb','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','hasOwnProperty','tableHeader','num','Empty','dirname','basename','.pdf','Setting','find','split','splitSizePdf','then','length','push','sequelize','query'];(function(_0x24afab,_0x169b1f){var _0xc93fdc=function(_0x417352){while(--_0x417352){_0x24afab['push'](_0x24afab['shift']());}};_0xc93fdc(++_0x169b1f);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0d8b('0x0'));var fs=require('fs');var BPromise=require(_0x0d8b('0x1'));var util=require('util');var path=require('path');var moment=require('moment');var PdfPrinter=require(_0x0d8b('0x2'));var zipdir=require(_0x0d8b('0x3'));var rimraf=require(_0x0d8b('0x4'));var db=require(_0x0d8b('0x5'))['db'];var dbH=require(_0x0d8b('0x5'))['dbH'];var logger=require('../../config/logger')(_0x0d8b('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0x0d8b('0x7')][0x2]);var QUERY=process[_0x0d8b('0x7')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0x0d8b('0x7')][0x5];var FORMAT=_0x0d8b('0x8');var _extractedReport;function analyticExtractedReport(_0x58e4e2,_0x129310){var _0x348e65={'status':_0x58e4e2};var _0x3b027f={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x129310){_0x348e65[_0x0d8b('0x9')]=_0x129310;}return db[_0x0d8b('0xa')][_0x0d8b('0xb')](_0x348e65,_0x3b027f);}function getHeader(_0x2c5e9e){var _0x28f87c=[];for(var _0x48fa16 in _0x2c5e9e){if(_0x2c5e9e[_0x0d8b('0xc')](_0x48fa16)){_0x28f87c['push']({'text':_0x48fa16,'style':_0x0d8b('0xd')});}}return _0x28f87c;}function extractReport(_0xc574a3){var _0x340cc4=0x1388;var _0x92cdd8;if(!_0xc574a3[0x0][_0x0d8b('0xe')]){return analyticExtractedReport(_0x0d8b('0xf'));}var _0x15dd0f=[];var _0x31a8cc=0x0;var _0x1d4bbc=!![];var _0x2ce75e=path[_0x0d8b('0x10')](PATH);var _0xe65334=path[_0x0d8b('0x11')](PATH,_0x0d8b('0x12'));var _0x4f6f21=![];var _0x23eb7b=[];return db[_0x0d8b('0x13')][_0x0d8b('0x14')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x0d8b('0x15'),_0x0d8b('0x16')]})['then'](function(_0x106a01){if(_0x106a01){_0x92cdd8=_0x106a01;_0x340cc4=_0x92cdd8[_0x0d8b('0x16')]||0x3e8;}})[_0x0d8b('0x17')](function(){if(_0xc574a3&&_0xc574a3[_0x0d8b('0x18')]){var _0x333674=_0xc574a3[0x0][_0x0d8b('0xe')]%(_0x31a8cc+_0x340cc4);if(_0x92cdd8[_0x0d8b('0x15')]){for(;_0x1d4bbc;_0x31a8cc+=_0x340cc4,_0x333674=_0xc574a3[0x0][_0x0d8b('0xe')]%(_0x31a8cc+_0x340cc4)){if(_0x333674==0x0||_0x333674==_0xc574a3[0x0]['num']){_0x1d4bbc=![];}_0x15dd0f[_0x0d8b('0x19')](dbH[_0x0d8b('0x1a')][_0x0d8b('0x1b')](util[_0x0d8b('0x1c')](_0x0d8b('0x1d'),QUERY,_0x340cc4,_0x31a8cc),{'type':dbH[_0x0d8b('0x1a')][_0x0d8b('0x1e')][_0x0d8b('0x1f')]}));}}else{_0x15dd0f['push'](dbH['sequelize'][_0x0d8b('0x1b')](QUERY,{'type':dbH['sequelize']['QueryTypes']['SELECT']}));}}_0x4f6f21=_0x92cdd8[_0x0d8b('0x15')]&&_0x15dd0f[_0x0d8b('0x18')]>0x1;if(!fs[_0x0d8b('0x20')](path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334))&&_0x4f6f21){fs[_0x0d8b('0x22')](path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334));}return BPromise[_0x0d8b('0x23')](_0x15dd0f,function(_0x4562cb){_0x23eb7b[_0x0d8b('0x19')](_0x4562cb);});})['then'](function(){return BPromise[_0x0d8b('0x23')](_0x15dd0f,function(_0x4463ee,_0x5363e3){var _0xe1ef20;var _0x4a0ae4=util[_0x0d8b('0x1c')](_0x0d8b('0x24'),NAME,_extractedReport[_0x0d8b('0x25')],moment(_extractedReport['startDate'])['format'](FORMAT),moment(_extractedReport[_0x0d8b('0x26')])[_0x0d8b('0x1c')](FORMAT));var _0x4c05ee={'pageSize':'A4','pageOrientation':_0x0d8b('0x27'),'content':[{'text':_0x4a0ae4,'style':'header'}],'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x0d8b('0x28')}}};var _0x4b59e5={'headerRows':0x1,'body':[]};_0x4b59e5[_0x0d8b('0x29')]['push'](getHeader(_0x4463ee[0x0]));var _0x2ab00d;for(var _0x546bf6=0x0;_0x546bf6<_0x4463ee[_0x0d8b('0x18')];_0x546bf6+=0x1){_0x2ab00d=[];for(var _0x544735 in _0x4463ee[_0x546bf6]){if(_0x4463ee[_0x546bf6][_0x0d8b('0xc')](_0x544735)){_0x2ab00d[_0x0d8b('0x19')](_0x4463ee[_0x546bf6][_0x544735]?_[_0x0d8b('0x2a')](_0x4463ee[_0x546bf6][_0x544735]):'');}}_0x4b59e5['body']['push'](_0x2ab00d);}_0x4c05ee['content'][_0x0d8b('0x19')]({'table':_0x4b59e5});return new BPromise(function(_0x5515d2,_0x3cdf3c){var _0x54f6f3=new PdfPrinter({'Roboto':{'normal':__dirname+'/fonts/Roboto-Regular.ttf','bold':__dirname+_0x0d8b('0x2b'),'italics':__dirname+_0x0d8b('0x2c'),'bolditalics':__dirname+_0x0d8b('0x2d')}});var _0xdeee5d=_0x54f6f3[_0x0d8b('0x2e')](_0x4c05ee);if(_0x4f6f21){_0xe1ef20=path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334,util[_0x0d8b('0x1c')](_0x0d8b('0x2f'),_0xe65334,_0x5363e3,'pdf'));}else{_0xe1ef20=path[_0x0d8b('0x21')](_0x2ce75e,util[_0x0d8b('0x1c')]('%s.%s',_0xe65334,_0x0d8b('0x30')));}var _0x23f7f6=_0xdeee5d[_0x0d8b('0x31')](fs['createWriteStream'](_0xe1ef20));_0x23f7f6['on'](_0x0d8b('0x32'),function(){_0x5515d2();});_0x23f7f6['on'](_0x0d8b('0x33'),function(_0x206157){console[_0x0d8b('0x34')](_0x0d8b('0x35'),_0x206157);_0x3cdf3c(_0x206157);});_0xdeee5d['end']();});});})[_0x0d8b('0x17')](function(){if(_0x4f6f21){return new BPromise(function(_0x1649fc,_0x5ad0fe){zipdir(path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334),{'saveTo':path[_0x0d8b('0x21')](_0x2ce75e,util[_0x0d8b('0x1c')](_0x0d8b('0x36'),_0xe65334,_0x0d8b('0x37')))},function(_0x519088){if(_0x519088){_0x5ad0fe(_0x519088);}else{_0x1649fc();}});});}})['then'](function(){if(_0x4f6f21){rimraf(path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334),function(){});}})['then'](function(){logger['info'](util[_0x0d8b('0x1c')](_0x0d8b('0x38'),EXTRACTED_REPORT_ID,_0x0d8b('0x39')));return analyticExtractedReport(_0x0d8b('0x3a'),_0x4f6f21?util[_0x0d8b('0x1c')](_0x0d8b('0x36'),_0xe65334,_0x4f6f21?'zip':_0x0d8b('0x30')):null);});}function main(){logger[_0x0d8b('0x3b')](util[_0x0d8b('0x1c')](_0x0d8b('0x3c'),EXTRACTED_REPORT_ID,_0x0d8b('0x3d')));return db[_0x0d8b('0xa')][_0x0d8b('0x3e')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x1d06b6){_extractedReport=_0x1d06b6;return dbH[_0x0d8b('0x1a')][_0x0d8b('0x1b')](util[_0x0d8b('0x1c')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x0d8b('0x1a')]['QueryTypes'][_0x0d8b('0x1f')]});})[_0x0d8b('0x17')](extractReport)[_0x0d8b('0x3f')](function(_0x26ac10){logger[_0x0d8b('0x3b')](util[_0x0d8b('0x1c')](_0x0d8b('0x40'),EXTRACTED_REPORT_ID,_0x0d8b('0x3d')),util[_0x0d8b('0x41')](_0x26ac10,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x0d8b('0x42'));});}main(); \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 28d325f..4eb5658 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 _0x5b2e=['SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','split','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','.xlsx','length','existsSync','join','mkdirSync','each','%s%d.%s','%s.%s','writeFileSync','binary','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','xlsx','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','util','path','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','analytics','argv','savename','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','splitSizeXlsx','then','sequelize','query'];(function(_0x4ce0b0,_0x572278){var _0x58115a=function(_0x5a6b24){while(--_0x5a6b24){_0x4ce0b0['push'](_0x4ce0b0['shift']());}};_0x58115a(++_0x572278);}(_0x5b2e,0x147));var _0xe5b2=function(_0x1a4f2d,_0x4e337d){_0x1a4f2d=_0x1a4f2d-0x0;var _0x35f83d=_0x5b2e[_0x1a4f2d];return _0x35f83d;};'use strict';var util=require(_0xe5b2('0x0'));var path=require(_0xe5b2('0x1'));var _=require(_0xe5b2('0x2'));var fs=require('fs');var json2xls=require(_0xe5b2('0x3'));var BPromise=require(_0xe5b2('0x4'));var zipdir=require(_0xe5b2('0x5'));var rimraf=require(_0xe5b2('0x6'));var db=require(_0xe5b2('0x7'))['db'];var dbH=require(_0xe5b2('0x7'))[_0xe5b2('0x8')];var logger=require('../../config/logger')(_0xe5b2('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0xe5b2('0xa')][0x2]);var QUERY=process[_0xe5b2('0xa')][0x3];var PATH=process['argv'][0x4];function analyticExtractedReport(_0xe22a30,_0x257ad2){var _0x12c0e6={'status':_0xe22a30};var _0x865d8a={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x257ad2){_0x12c0e6[_0xe5b2('0xb')]=_0x257ad2;}return db[_0xe5b2('0xc')]['update'](_0x12c0e6,_0x865d8a);}function main(){var _0x257b27=0x1388;var _0x2c3823;logger[_0xe5b2('0xd')](util[_0xe5b2('0xe')](_0xe5b2('0xf'),EXTRACTED_REPORT_ID,_0xe5b2('0x10')));return db[_0xe5b2('0x11')][_0xe5b2('0x12')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xe5b2('0x13')]})[_0xe5b2('0x14')](function(_0x1ca9b2){if(_0x1ca9b2){_0x2c3823=_0x1ca9b2;_0x257b27=_0x2c3823[_0xe5b2('0x13')]||0x1388;}})[_0xe5b2('0x14')](function(){return dbH[_0xe5b2('0x15')][_0xe5b2('0x16')](util[_0xe5b2('0xe')](_0xe5b2('0x17'),QUERY),{'type':dbH[_0xe5b2('0x15')][_0xe5b2('0x18')][_0xe5b2('0x19')]});})['then'](function(_0x57932b){if(!_0x57932b[0x0][_0xe5b2('0x1a')]){return analyticExtractedReport(_0xe5b2('0x1b'));}var _0x929558=[];var _0x3c0c8c=0x0;var _0x14ff57=!![];if(_0x2c3823[_0xe5b2('0x1c')]){if(_0x57932b&&_0x57932b['length']){var _0x1287e5=_0x57932b[0x0][_0xe5b2('0x1a')]%(_0x3c0c8c+_0x257b27);for(;_0x14ff57;_0x3c0c8c+=_0x257b27,_0x1287e5=_0x57932b[0x0][_0xe5b2('0x1a')]%(_0x3c0c8c+_0x257b27)){if(_0x1287e5==0x0||_0x1287e5==_0x57932b[0x0]['num']){_0x14ff57=![];}_0x929558[_0xe5b2('0x1d')](dbH[_0xe5b2('0x15')][_0xe5b2('0x16')](util[_0xe5b2('0xe')](_0xe5b2('0x1e'),QUERY,_0x257b27,_0x3c0c8c),{'type':dbH[_0xe5b2('0x15')][_0xe5b2('0x18')][_0xe5b2('0x19')]}));}}}else{_0x929558[_0xe5b2('0x1d')](dbH[_0xe5b2('0x15')][_0xe5b2('0x16')](QUERY,{'type':dbH[_0xe5b2('0x15')][_0xe5b2('0x18')]['SELECT']}));}var _0xd4de7b=path[_0xe5b2('0x1f')](PATH);var _0x5ab60a=path['basename'](PATH,_0xe5b2('0x20'));var _0x3c2aaf=_0x2c3823[_0xe5b2('0x1c')]&&_0x929558[_0xe5b2('0x21')]>0x1;var _0x6f263d=[];if(!fs[_0xe5b2('0x22')](path[_0xe5b2('0x23')](_0xd4de7b,_0x5ab60a))&&_0x3c2aaf){fs[_0xe5b2('0x24')](path[_0xe5b2('0x23')](_0xd4de7b,_0x5ab60a));}return BPromise[_0xe5b2('0x25')](_0x929558,function(_0x57f425){_0x6f263d[_0xe5b2('0x1d')](_0x57f425);})[_0xe5b2('0x14')](function(){for(var _0x781506=0x0;_0x781506<_0x6f263d['length'];_0x781506+=0x1){var _0x2d1a3d;var _0x54478b=_0x6f263d[_0x781506];if(_0x3c2aaf){_0x2d1a3d=path[_0xe5b2('0x23')](_0xd4de7b,_0x5ab60a,util[_0xe5b2('0xe')](_0xe5b2('0x26'),_0x5ab60a,_0x781506,'xlsx'));}else{_0x2d1a3d=path['join'](_0xd4de7b,util[_0xe5b2('0xe')](_0xe5b2('0x27'),_0x5ab60a,'xlsx'));}fs[_0xe5b2('0x28')](_0x2d1a3d,json2xls(_0x54478b),_0xe5b2('0x29'));}})[_0xe5b2('0x14')](function(){if(_0x3c2aaf){zipdir(path[_0xe5b2('0x23')](_0xd4de7b,_0x5ab60a),{'saveTo':path[_0xe5b2('0x23')](_0xd4de7b,util[_0xe5b2('0xe')](_0xe5b2('0x27'),_0x5ab60a,_0xe5b2('0x2a')))},function(_0x4618dd,_0x55bdcd){});rimraf(path[_0xe5b2('0x23')](_0xd4de7b,_0x5ab60a),function(){});}})['then'](function(){logger[_0xe5b2('0xd')](util[_0xe5b2('0xe')](_0xe5b2('0x2b'),EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport(_0xe5b2('0x2c'),_0x3c2aaf?util[_0xe5b2('0xe')](_0xe5b2('0x27'),_0x5ab60a,_0x3c2aaf?_0xe5b2('0x2a'):_0xe5b2('0x2d')):null);});})[_0xe5b2('0x2e')](function(_0x4bf90a){logger[_0xe5b2('0xd')](util[_0xe5b2('0xe')](_0xe5b2('0x2f'),EXTRACTED_REPORT_ID,_0xe5b2('0x10')),util[_0xe5b2('0x30')](_0x4bf90a,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0xe5b2('0x31'));});}main(); \ No newline at end of file +var _0xa3a1=['Setting','find','splitSizeXlsx','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','SELECT','Empty','split','length','num','push','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','.xlsx','existsSync','mkdirSync','each','join','%s%d.%s','xlsx','%s.%s','writeFileSync','binary','XLSX','Completed','zip','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','util','path','lodash','json2xls','bluebird','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format'];(function(_0x45fc6a,_0x166adb){var _0x14bcfd=function(_0x3ba718){while(--_0x3ba718){_0x45fc6a['push'](_0x45fc6a['shift']());}};_0x14bcfd(++_0x166adb);}(_0xa3a1,0x85));var _0x1a3a=function(_0xf645bb,_0x53c703){_0xf645bb=_0xf645bb-0x0;var _0x12148a=_0xa3a1[_0xf645bb];return _0x12148a;};'use strict';var util=require(_0x1a3a('0x0'));var path=require(_0x1a3a('0x1'));var _=require(_0x1a3a('0x2'));var fs=require('fs');var json2xls=require(_0x1a3a('0x3'));var BPromise=require(_0x1a3a('0x4'));var zipdir=require('zip-dir');var rimraf=require(_0x1a3a('0x5'));var db=require('../../mysqldb')['db'];var dbH=require(_0x1a3a('0x6'))[_0x1a3a('0x7')];var logger=require(_0x1a3a('0x8'))(_0x1a3a('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0x1a3a('0xa')][0x2]);var QUERY=process[_0x1a3a('0xa')][0x3];var PATH=process[_0x1a3a('0xa')][0x4];function analyticExtractedReport(_0x4b2683,_0x2f442c){var _0x569ac9={'status':_0x4b2683};var _0x389c31={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2f442c){_0x569ac9[_0x1a3a('0xb')]=_0x2f442c;}return db[_0x1a3a('0xc')][_0x1a3a('0xd')](_0x569ac9,_0x389c31);}function main(){var _0x2c537d=0x1388;var _0x3f0fb8;logger[_0x1a3a('0xe')](util[_0x1a3a('0xf')](_0x1a3a('0x10'),EXTRACTED_REPORT_ID,'XLSX'));return db[_0x1a3a('0x11')][_0x1a3a('0x12')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x1a3a('0x13')]})[_0x1a3a('0x14')](function(_0x36a89a){if(_0x36a89a){_0x3f0fb8=_0x36a89a;_0x2c537d=_0x3f0fb8[_0x1a3a('0x13')]||0x1388;}})[_0x1a3a('0x14')](function(){return dbH['sequelize'][_0x1a3a('0x15')](util[_0x1a3a('0xf')](_0x1a3a('0x16'),QUERY),{'type':dbH[_0x1a3a('0x17')][_0x1a3a('0x18')][_0x1a3a('0x19')]});})[_0x1a3a('0x14')](function(_0xdbd047){if(!_0xdbd047[0x0]['num']){return analyticExtractedReport(_0x1a3a('0x1a'));}var _0x3165f7=[];var _0x1f3af6=0x0;var _0xf424b2=!![];if(_0x3f0fb8[_0x1a3a('0x1b')]){if(_0xdbd047&&_0xdbd047[_0x1a3a('0x1c')]){var _0x521e65=_0xdbd047[0x0][_0x1a3a('0x1d')]%(_0x1f3af6+_0x2c537d);for(;_0xf424b2;_0x1f3af6+=_0x2c537d,_0x521e65=_0xdbd047[0x0][_0x1a3a('0x1d')]%(_0x1f3af6+_0x2c537d)){if(_0x521e65==0x0||_0x521e65==_0xdbd047[0x0][_0x1a3a('0x1d')]){_0xf424b2=![];}_0x3165f7[_0x1a3a('0x1e')](dbH[_0x1a3a('0x17')][_0x1a3a('0x15')](util[_0x1a3a('0xf')](_0x1a3a('0x1f'),QUERY,_0x2c537d,_0x1f3af6),{'type':dbH[_0x1a3a('0x17')][_0x1a3a('0x18')][_0x1a3a('0x19')]}));}}}else{_0x3165f7[_0x1a3a('0x1e')](dbH[_0x1a3a('0x17')]['query'](QUERY,{'type':dbH[_0x1a3a('0x17')][_0x1a3a('0x18')][_0x1a3a('0x19')]}));}var _0x26451d=path['dirname'](PATH);var _0x4d23bb=path[_0x1a3a('0x20')](PATH,_0x1a3a('0x21'));var _0x36bd44=_0x3f0fb8[_0x1a3a('0x1b')]&&_0x3165f7[_0x1a3a('0x1c')]>0x1;var _0x373106=[];if(!fs[_0x1a3a('0x22')](path['join'](_0x26451d,_0x4d23bb))&&_0x36bd44){fs[_0x1a3a('0x23')](path['join'](_0x26451d,_0x4d23bb));}return BPromise[_0x1a3a('0x24')](_0x3165f7,function(_0x2a30dc){_0x373106['push'](_0x2a30dc);})['then'](function(){for(var _0x277f3b=0x0;_0x277f3b<_0x373106[_0x1a3a('0x1c')];_0x277f3b+=0x1){var _0x10c49d;var _0x733e43=_0x373106[_0x277f3b];if(_0x36bd44){_0x10c49d=path[_0x1a3a('0x25')](_0x26451d,_0x4d23bb,util['format'](_0x1a3a('0x26'),_0x4d23bb,_0x277f3b,_0x1a3a('0x27')));}else{_0x10c49d=path[_0x1a3a('0x25')](_0x26451d,util['format'](_0x1a3a('0x28'),_0x4d23bb,_0x1a3a('0x27')));}fs[_0x1a3a('0x29')](_0x10c49d,json2xls(_0x733e43),_0x1a3a('0x2a'));}})[_0x1a3a('0x14')](function(){if(_0x36bd44){zipdir(path[_0x1a3a('0x25')](_0x26451d,_0x4d23bb),{'saveTo':path[_0x1a3a('0x25')](_0x26451d,util['format'](_0x1a3a('0x28'),_0x4d23bb,'zip'))},function(_0x3acb83,_0x4d7b95){});rimraf(path[_0x1a3a('0x25')](_0x26451d,_0x4d23bb),function(){});}})[_0x1a3a('0x14')](function(){logger[_0x1a3a('0xe')](util[_0x1a3a('0xf')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x1a3a('0x2b')));return analyticExtractedReport(_0x1a3a('0x2c'),_0x36bd44?util['format'](_0x1a3a('0x28'),_0x4d23bb,_0x36bd44?_0x1a3a('0x2d'):_0x1a3a('0x27')):null);});})[_0x1a3a('0x2e')](function(_0x41fa27){logger[_0x1a3a('0xe')](util['format'](_0x1a3a('0x2f'),EXTRACTED_REPORT_ID,_0x1a3a('0x2b')),util[_0x1a3a('0x30')](_0x41fa27,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x1a3a('0x31'));});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 52e166b..1948b30 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 _0x58df=['push','type','Set','CDR(type)=%s','VoiceExtensionId','CDR(destination)=','${EXTEN:','${EXTEN}','context','CDR(routeid)=','ExecIf','):Goto(','CDR(prefix)=${EXTEN:0:','cutdigits','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','toLowerCase','createdAt','interval','*,*,*,*','IntervalId','hasOwnProperty','tag','CDR(tag)=','length','callerID','answer','app','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','destroy','sortBy','rewrite','lodash','models','Interval','findAll','then','intervals','VoiceExtension','uniq','map','exten','filter','groupBy','queue','priority','extensions','extension','find'];(function(_0x5c6e84,_0x18417e){var _0xa58306=function(_0x4ff031){while(--_0x4ff031){_0x5c6e84['push'](_0x5c6e84['shift']());}};_0xa58306(++_0x18417e);}(_0x58df,0xb2));var _0xf58d=function(_0x57d766,_0x43e8de){_0x57d766=_0x57d766-0x0;var _0x5b9e0a=_0x58df[_0x57d766];return _0x5b9e0a;};'use strict';var _=require(_0xf58d('0x0'));var util=require('util');function rewrite(_0xd70697,_0x47af9e){var _0x4f5a85=this;return _0xd70697[_0xf58d('0x1')][_0xf58d('0x2')][_0xf58d('0x3')]({'raw':!![]})[_0xf58d('0x4')](function(_0xd04e71){_0x4f5a85[_0xf58d('0x5')]=_0xd04e71;return _0xd70697[_0xf58d('0x1')][_0xf58d('0x6')][_0xf58d('0x3')]({'where':{'IntervalId':_0x47af9e['IntervalId']},'raw':!![]});})['then'](function(_0x315832){return _0xd70697[_0xf58d('0x1')][_0xf58d('0x6')]['findAll']({'where':{'exten':{'$in':_[_0xf58d('0x7')](_[_0xf58d('0x8')](_0x315832,_0xf58d('0x9')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0xf58d('0x4')](function(_0x3ce168){var _0x29da5e=_[_0xf58d('0xa')](_0x3ce168,{'priority':'1'});var _0x3ea899=_['filter'](_0x3ce168,{'isApp':0x1});var _0x2547b4=_[_0xf58d('0xb')](_0x3ea899,_0xf58d('0x9'));var _0x221a8d=[_0xf58d('0xc'),'playback'];var _0x3939ec=[];var _0xef4159=[];for(var _0x582f95 in _0x2547b4){if(_0x2547b4['hasOwnProperty'](_0x582f95)){_0x4f5a85[_0xf58d('0xd')]=0x2;_0x4f5a85[_0xf58d('0xe')]=[];_0x4f5a85[_0xf58d('0xf')]=_[_0xf58d('0x10')](_0x29da5e,{'exten':_0x2547b4[_0x582f95][0x0]['exten']});_0x4f5a85[_0xf58d('0xe')][_0xf58d('0x11')]({'type':_0x2547b4[_0x582f95][0x0][_0xf58d('0x12')],'app':_0xf58d('0x13'),'appdata':util['format'](_0xf58d('0x14'),_0x2547b4[_0x582f95][0x0]['type']),'context':_0x2547b4[_0x582f95][0x0]['context'],'exten':_0x2547b4[_0x582f95][0x0]['exten'],'priority':_0x4f5a85[_0xf58d('0xd')]++,'VoiceExtensionId':_0x2547b4[_0x582f95][0x0][_0xf58d('0x15')]});if(_0x2547b4[_0x582f95][0x0][_0xf58d('0x12')]==='outbound'){if(_0x4f5a85[_0xf58d('0xf')]){_0x4f5a85[_0xf58d('0xe')]['push']({'type':_0x2547b4[_0x582f95][0x0][_0xf58d('0x12')],'app':_0xf58d('0x13'),'appdata':_0xf58d('0x16')+(_0x4f5a85[_0xf58d('0xf')]['cutdigits']?_0xf58d('0x17')+_0x4f5a85['extension']['cutdigits']+'}':_0xf58d('0x18')),'context':_0x2547b4[_0x582f95][0x0][_0xf58d('0x19')],'exten':_0x2547b4[_0x582f95][0x0][_0xf58d('0x9')],'priority':_0x4f5a85[_0xf58d('0xd')]++,'VoiceExtensionId':_0x2547b4[_0x582f95][0x0][_0xf58d('0x15')]});}_0x4f5a85[_0xf58d('0xe')][_0xf58d('0x11')]({'type':_0x2547b4[_0x582f95][0x0][_0xf58d('0x12')],'app':_0xf58d('0x13'),'appdata':_0xf58d('0x1a')+_0x2547b4[_0x582f95][0x0][_0xf58d('0x15')],'context':_0x2547b4[_0x582f95][0x0]['context'],'exten':_0x2547b4[_0x582f95][0x0][_0xf58d('0x9')],'priority':_0x4f5a85[_0xf58d('0xd')]++,'VoiceExtensionId':_0x2547b4[_0x582f95][0x0][_0xf58d('0x15')]});var _0x5075ef=_0x4f5a85[_0xf58d('0xd')]++;_0x4f5a85[_0xf58d('0xe')]['push']({'type':_0x2547b4[_0x582f95][0x0]['type'],'app':_0xf58d('0x1b'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x5075ef+0x2)+_0xf58d('0x1c')+(_0x5075ef+0x1)+')','context':_0x2547b4[_0x582f95][0x0][_0xf58d('0x19')],'exten':_0x2547b4[_0x582f95][0x0]['exten'],'priority':_0x5075ef,'VoiceExtensionId':_0x2547b4[_0x582f95][0x0][_0xf58d('0x15')]});if(_0x4f5a85['extension']){_0x4f5a85['extensions'][_0xf58d('0x11')]({'type':_0x2547b4[_0x582f95][0x0]['type'],'app':_0xf58d('0x13'),'appdata':_0x4f5a85[_0xf58d('0xf')]['cutdigits']?_0xf58d('0x1d')+_0x4f5a85[_0xf58d('0xf')][_0xf58d('0x1e')]+'}':'CDR(prefix)=noprefix','context':_0x2547b4[_0x582f95][0x0][_0xf58d('0x19')],'exten':_0x2547b4[_0x582f95][0x0][_0xf58d('0x9')],'priority':_0x4f5a85[_0xf58d('0xd')]++,'VoiceExtensionId':_0x2547b4[_0x582f95][0x0]['VoiceExtensionId']});}_0x4f5a85['extensions'][_0xf58d('0x11')]({'type':_0x2547b4[_0x582f95][0x0][_0xf58d('0x12')],'app':_0xf58d('0x13'),'appdata':'outboundrouteid='+_0x2547b4[_0x582f95][0x0]['VoiceExtensionId'],'context':_0x2547b4[_0x582f95][0x0][_0xf58d('0x19')],'exten':_0x2547b4[_0x582f95][0x0][_0xf58d('0x9')],'priority':_0x4f5a85[_0xf58d('0xd')]++,'VoiceExtensionId':_0x2547b4[_0x582f95][0x0][_0xf58d('0x15')]});if(_0x4f5a85['extension']&&_0x4f5a85['extension']['hasOwnProperty'](_0xf58d('0x1f'))&&_0x4f5a85[_0xf58d('0xf')]['recordingFormat']!==_0xf58d('0x20')){_0x4f5a85['extensions'][_0xf58d('0x11')]({'type':_0x2547b4[_0x582f95][0x0]['type'],'app':_0xf58d('0x13'),'appdata':_0xf58d('0x21'),'context':_0x2547b4[_0x582f95][0x0][_0xf58d('0x19')],'exten':_0x2547b4[_0x582f95][0x0]['exten'],'priority':_0x4f5a85[_0xf58d('0xd')]++,'VoiceExtensionId':_0x2547b4[_0x582f95][0x0]['VoiceExtensionId']});_0x4f5a85['extensions'][_0xf58d('0x11')]({'type':_0x2547b4[_0x582f95][0x0][_0xf58d('0x12')],'app':_0xf58d('0x13'),'appdata':_0xf58d('0x22')+_0x4f5a85[_0xf58d('0xf')][_0xf58d('0x1f')]||'wav','context':_0x2547b4[_0x582f95][0x0]['context'],'exten':_0x2547b4[_0x582f95][0x0][_0xf58d('0x9')],'priority':_0x4f5a85[_0xf58d('0xd')]++,'VoiceExtensionId':_0x2547b4[_0x582f95][0x0]['VoiceExtensionId']});}}_0x4f5a85[_0xf58d('0xe')]['push']({'type':_0x2547b4[_0x582f95][0x0][_0xf58d('0x12')],'app':_0xf58d('0x13'),'appdata':_0xf58d('0x23'),'context':_0x2547b4[_0x582f95][0x0]['context'],'exten':_0x2547b4[_0x582f95][0x0][_0xf58d('0x9')],'priority':_0x4f5a85[_0xf58d('0xd')]++,'VoiceExtensionId':_0x2547b4[_0x582f95][0x0][_0xf58d('0x15')]});_0x4f5a85[_0xf58d('0xe')][_0xf58d('0x11')]({'type':_0x2547b4[_0x582f95][0x0]['type'],'app':'Set','appdata':_0xf58d('0x24'),'context':_0x2547b4[_0x582f95][0x0][_0xf58d('0x19')],'exten':_0x2547b4[_0x582f95][0x0][_0xf58d('0x9')],'priority':_0x4f5a85[_0xf58d('0xd')]++,'VoiceExtensionId':_0x2547b4[_0x582f95][0x0][_0xf58d('0x15')]});_0x4f5a85[_0xf58d('0xe')][_0xf58d('0x11')]({'type':_0x2547b4[_0x582f95][0x0][_0xf58d('0x12')],'app':_0xf58d('0x13'),'appdata':_0xf58d('0x25'),'context':_0x2547b4[_0x582f95][0x0][_0xf58d('0x19')],'exten':_0x2547b4[_0x582f95][0x0][_0xf58d('0x9')],'priority':_0x4f5a85[_0xf58d('0xd')]++,'VoiceExtensionId':_0x2547b4[_0x582f95][0x0][_0xf58d('0x15')]});for(var _0x3d9ce2=0x0,_0x4d739e=0x0;_0x3d9ce2<_0x2547b4[_0x582f95]['length'];_0x3d9ce2+=0x1,_0x4d739e=0x0){var _0x2898eb=_0x2547b4[_0x582f95][_0x3d9ce2];if(_0x2898eb['type']){_0x2898eb[_0xf58d('0x12')]=_0x2898eb[_0xf58d('0x12')][_0xf58d('0x26')]();}var _0x440be6=[];var _0x4ea6c5=[];delete _0x2898eb['id'];delete _0x2898eb[_0xf58d('0x27')];delete _0x2898eb['updatedAt'];var _0x28c2e8=_0x2898eb[_0xf58d('0x28')]!==_0xf58d('0x29')?[_0x2898eb['interval']]:_0x2898eb[_0xf58d('0x2a')]?_[_0xf58d('0x8')](_['filter'](_0x4f5a85['intervals'],{'IntervalId':_0x2898eb[_0xf58d('0x2a')]}),_0xf58d('0x28')):[];if(_0x2898eb[_0xf58d('0x2b')]('tag')){if(_0x2898eb[_0xf58d('0x2c')]&&_0x2898eb[_0xf58d('0x2c')]!=='--'){_0x440be6[_0xf58d('0x11')]({'type':_0x2898eb[_0xf58d('0x12')],'app':'Set','appdata':_0xf58d('0x2d')+_0x2898eb[_0xf58d('0x2c')],'context':_0x2898eb[_0xf58d('0x19')],'exten':_0x2898eb['exten'],'priority':_0x28c2e8[_0xf58d('0x2e')]+_0x4f5a85[_0xf58d('0xd')]+_0x4d739e++,'VoiceExtensionId':_0x2898eb[_0xf58d('0x15')]});}}if(_0x2898eb[_0xf58d('0x12')]==='outbound'&&_0x2898eb[_0xf58d('0x2b')]('callerID')){if(_0x2898eb[_0xf58d('0x2f')]){_0x440be6[_0xf58d('0x11')]({'type':_0x2898eb[_0xf58d('0x12')],'app':_0xf58d('0x1b'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x2898eb['callerID']+')','context':_0x2898eb[_0xf58d('0x19')],'exten':_0x2898eb['exten'],'priority':_0x28c2e8[_0xf58d('0x2e')]+_0x4f5a85[_0xf58d('0xd')]+_0x4d739e++,'VoiceExtensionId':_0x2898eb[_0xf58d('0x15')]});}else{_0x440be6[_0xf58d('0x11')]({'type':_0x2898eb[_0xf58d('0x12')],'app':'ExecIf','appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x2898eb['context'],'exten':_0x2898eb[_0xf58d('0x9')],'priority':_0x28c2e8[_0xf58d('0x2e')]+_0x4f5a85[_0xf58d('0xd')]+_0x4d739e++,'VoiceExtensionId':_0x2898eb[_0xf58d('0x15')]});}}if(_0x2898eb[_0xf58d('0x2b')](_0xf58d('0x30'))){if(_0x221a8d['indexOf'](_0x2898eb[_0xf58d('0x31')][_0xf58d('0x26')]())>=0x0&&_0x2898eb['appType']!==_0xf58d('0x32')){if(_0x2898eb[_0xf58d('0x30')]){_0x440be6[_0xf58d('0x11')]({'type':_0x2898eb[_0xf58d('0x12')],'app':_0xf58d('0x1b'),'appdata':_0xf58d('0x33'),'context':_0x2898eb[_0xf58d('0x19')],'exten':_0x2898eb['exten'],'priority':_0x28c2e8['length']+_0x4f5a85[_0xf58d('0xd')]+_0x4d739e++,'VoiceExtensionId':_0x2898eb[_0xf58d('0x15')]});_0x440be6[_0xf58d('0x11')]({'type':_0x2898eb['type'],'app':_0xf58d('0x13'),'appdata':_0xf58d('0x34'),'context':_0x2898eb[_0xf58d('0x19')],'exten':_0x2898eb[_0xf58d('0x9')],'priority':_0x28c2e8[_0xf58d('0x2e')]+_0x4f5a85[_0xf58d('0xd')]+_0x4d739e++,'VoiceExtensionId':_0x2898eb[_0xf58d('0x15')]});}else{_0x440be6[_0xf58d('0x11')]({'type':_0x2898eb[_0xf58d('0x12')],'app':_0xf58d('0x1b'),'appdata':_0xf58d('0x35'),'context':_0x2898eb[_0xf58d('0x19')],'exten':_0x2898eb[_0xf58d('0x9')],'priority':_0x28c2e8[_0xf58d('0x2e')]+_0x4f5a85[_0xf58d('0xd')]+_0x4d739e++,'VoiceExtensionId':_0x2898eb[_0xf58d('0x15')]});_0x440be6['push']({'type':_0x2898eb['type'],'app':_0xf58d('0x13'),'appdata':_0xf58d('0x36'),'context':_0x2898eb[_0xf58d('0x19')],'exten':_0x2898eb[_0xf58d('0x9')],'priority':_0x28c2e8['length']+_0x4f5a85[_0xf58d('0xd')]+_0x4d739e++,'VoiceExtensionId':_0x2898eb[_0xf58d('0x15')]});}}}for(var _0x3c1fa5=0x0;_0x3c1fa5<_0x28c2e8['length'];_0x3c1fa5+=0x1){var _0x4356a6=_0x4f5a85[_0xf58d('0xd')]+_0x28c2e8['length'];var _0x5b28fc=_0x3c1fa5===_0x28c2e8[_0xf58d('0x2e')]-0x1?_0x4f5a85[_0xf58d('0xd')]+_0x440be6[_0xf58d('0x2e')]+_0x4ea6c5[_0xf58d('0x2e')]+0x2:_0x4f5a85['priority']+_0x3c1fa5+0x1;_0x440be6[_0xf58d('0x37')](_0x3c1fa5,0x0,{'type':_0x2898eb[_0xf58d('0x12')],'app':_0xf58d('0x38'),'appdata':_0x28c2e8[_0x3c1fa5]+'?'+_0x2898eb[_0xf58d('0x19')]+_0xf58d('0x39')+_0x4356a6+':'+_0x2898eb[_0xf58d('0x19')]+_0xf58d('0x39')+_0x5b28fc,'exten':_0x2898eb[_0xf58d('0x9')],'context':_0x2898eb[_0xf58d('0x19')],'priority':_0x4f5a85[_0xf58d('0xd')]+_0x3c1fa5,'VoiceExtensionId':_0x2547b4[_0x582f95][0x0]['VoiceExtensionId']});}_0x2898eb[_0xf58d('0xd')]=_0x440be6[_0xf58d('0x2e')]?_[_0xf58d('0x3a')](_0x440be6)['priority']+0x1:_0x4f5a85[_0xf58d('0xd')];_0x4f5a85[_0xf58d('0xd')]=(_0x4ea6c5[_0xf58d('0x2e')]?_['last'](_0x4ea6c5)['priority']:_0x2898eb[_0xf58d('0xd')])+0x1;_0x4f5a85[_0xf58d('0xe')]=_[_0xf58d('0x3b')](_0x4f5a85[_0xf58d('0xe')],_0x440be6,[_0x2898eb],_0x4ea6c5);}_0x4f5a85[_0xf58d('0xe')][_0xf58d('0x11')]({'type':_0x2547b4[_0x582f95][0x0]['type'],'app':_0xf58d('0x3c'),'exten':_0x2547b4[_0x582f95][0x0][_0xf58d('0x9')],'context':_0x2547b4[_0x582f95][0x0]['context'],'priority':_0x4f5a85['priority'],'VoiceExtensionId':_0x2547b4[_0x582f95][0x0]['VoiceExtensionId']});_0x3939ec[_0xf58d('0x11')](_0x2547b4[_0x582f95][0x0]['VoiceExtensionId']);_0xef4159=_[_0xf58d('0x3b')](_0xef4159,_0x4f5a85[_0xf58d('0xe')]);}}return _0xd70697[_0xf58d('0x3d')](function(_0x31393f){return _0xd70697[_0xf58d('0x1')][_0xf58d('0x6')][_0xf58d('0x3e')]({'where':{'VoiceExtensionId':{'$in':_0x3939ec}},'transaction':_0x31393f})[_0xf58d('0x4')](function(_0x19a755){return _0xd70697['models'][_0xf58d('0x6')]['bulkCreate'](_[_0xf58d('0x3f')](_0xef4159,'priority'),{'transaction':_0x31393f});});});})['catch'](function(_0x7f4b1d){console['error'](_0x7f4b1d);});}exports[_0xf58d('0x40')]=rewrite; \ No newline at end of file +var _0x0f61=['$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','answer','indexOf','app','toLowerCase','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','destroy','sortBy','catch','error','util','models','findAll','then','intervals','VoiceExtension','IntervalId','uniq','map','CAST(priority\x20AS\x20UNSIGNED)','filter','exten','playback','hasOwnProperty','priority','extension','find','extensions','type','Set','format','CDR(type)=%s','VoiceExtensionId','outbound','push','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','context','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=noprefix','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','createdAt','updatedAt','interval','*,*,*,*','tag','CDR(tag)=','callerID'];(function(_0x30c00d,_0x292f14){var _0x269bdb=function(_0x126394){while(--_0x126394){_0x30c00d['push'](_0x30c00d['shift']());}};_0x269bdb(++_0x292f14);}(_0x0f61,0xa6));var _0x10f6=function(_0x2e1500,_0x4229ab){_0x2e1500=_0x2e1500-0x0;var _0x162f22=_0x0f61[_0x2e1500];return _0x162f22;};'use strict';var _=require('lodash');var util=require(_0x10f6('0x0'));function rewrite(_0x4f0ddf,_0x5104e6){var _0x20aa43=this;return _0x4f0ddf[_0x10f6('0x1')]['Interval'][_0x10f6('0x2')]({'raw':!![]})[_0x10f6('0x3')](function(_0x2289e3){_0x20aa43[_0x10f6('0x4')]=_0x2289e3;return _0x4f0ddf[_0x10f6('0x1')][_0x10f6('0x5')][_0x10f6('0x2')]({'where':{'IntervalId':_0x5104e6[_0x10f6('0x6')]},'raw':!![]});})[_0x10f6('0x3')](function(_0x3e349f){return _0x4f0ddf['models'][_0x10f6('0x5')]['findAll']({'where':{'exten':{'$in':_[_0x10f6('0x7')](_[_0x10f6('0x8')](_0x3e349f,'exten'))}},'order':[{'raw':_0x10f6('0x9')}],'raw':!![]});})[_0x10f6('0x3')](function(_0x520625){var _0x35f938=_[_0x10f6('0xa')](_0x520625,{'priority':'1'});var _0x42ee2a=_['filter'](_0x520625,{'isApp':0x1});var _0x4d5b7a=_['groupBy'](_0x42ee2a,_0x10f6('0xb'));var _0x359dce=['queue',_0x10f6('0xc')];var _0xb5ef70=[];var _0x51e0ba=[];for(var _0x3d25c6 in _0x4d5b7a){if(_0x4d5b7a[_0x10f6('0xd')](_0x3d25c6)){_0x20aa43[_0x10f6('0xe')]=0x2;_0x20aa43['extensions']=[];_0x20aa43[_0x10f6('0xf')]=_[_0x10f6('0x10')](_0x35f938,{'exten':_0x4d5b7a[_0x3d25c6][0x0]['exten']});_0x20aa43[_0x10f6('0x11')]['push']({'type':_0x4d5b7a[_0x3d25c6][0x0][_0x10f6('0x12')],'app':_0x10f6('0x13'),'appdata':util[_0x10f6('0x14')](_0x10f6('0x15'),_0x4d5b7a[_0x3d25c6][0x0][_0x10f6('0x12')]),'context':_0x4d5b7a[_0x3d25c6][0x0]['context'],'exten':_0x4d5b7a[_0x3d25c6][0x0]['exten'],'priority':_0x20aa43[_0x10f6('0xe')]++,'VoiceExtensionId':_0x4d5b7a[_0x3d25c6][0x0][_0x10f6('0x16')]});if(_0x4d5b7a[_0x3d25c6][0x0][_0x10f6('0x12')]===_0x10f6('0x17')){if(_0x20aa43[_0x10f6('0xf')]){_0x20aa43[_0x10f6('0x11')][_0x10f6('0x18')]({'type':_0x4d5b7a[_0x3d25c6][0x0][_0x10f6('0x12')],'app':_0x10f6('0x13'),'appdata':_0x10f6('0x19')+(_0x20aa43['extension'][_0x10f6('0x1a')]?_0x10f6('0x1b')+_0x20aa43[_0x10f6('0xf')][_0x10f6('0x1a')]+'}':_0x10f6('0x1c')),'context':_0x4d5b7a[_0x3d25c6][0x0][_0x10f6('0x1d')],'exten':_0x4d5b7a[_0x3d25c6][0x0][_0x10f6('0xb')],'priority':_0x20aa43['priority']++,'VoiceExtensionId':_0x4d5b7a[_0x3d25c6][0x0]['VoiceExtensionId']});}_0x20aa43[_0x10f6('0x11')][_0x10f6('0x18')]({'type':_0x4d5b7a[_0x3d25c6][0x0][_0x10f6('0x12')],'app':_0x10f6('0x13'),'appdata':_0x10f6('0x1e')+_0x4d5b7a[_0x3d25c6][0x0][_0x10f6('0x16')],'context':_0x4d5b7a[_0x3d25c6][0x0]['context'],'exten':_0x4d5b7a[_0x3d25c6][0x0][_0x10f6('0xb')],'priority':_0x20aa43[_0x10f6('0xe')]++,'VoiceExtensionId':_0x4d5b7a[_0x3d25c6][0x0]['VoiceExtensionId']});var _0x1083c7=_0x20aa43['priority']++;_0x20aa43[_0x10f6('0x11')][_0x10f6('0x18')]({'type':_0x4d5b7a[_0x3d25c6][0x0][_0x10f6('0x12')],'app':_0x10f6('0x1f'),'appdata':_0x10f6('0x20')+(_0x1083c7+0x2)+_0x10f6('0x21')+(_0x1083c7+0x1)+')','context':_0x4d5b7a[_0x3d25c6][0x0][_0x10f6('0x1d')],'exten':_0x4d5b7a[_0x3d25c6][0x0][_0x10f6('0xb')],'priority':_0x1083c7,'VoiceExtensionId':_0x4d5b7a[_0x3d25c6][0x0][_0x10f6('0x16')]});if(_0x20aa43[_0x10f6('0xf')]){_0x20aa43[_0x10f6('0x11')]['push']({'type':_0x4d5b7a[_0x3d25c6][0x0][_0x10f6('0x12')],'app':'Set','appdata':_0x20aa43[_0x10f6('0xf')]['cutdigits']?'CDR(prefix)=${EXTEN:0:'+_0x20aa43['extension']['cutdigits']+'}':_0x10f6('0x22'),'context':_0x4d5b7a[_0x3d25c6][0x0][_0x10f6('0x1d')],'exten':_0x4d5b7a[_0x3d25c6][0x0][_0x10f6('0xb')],'priority':_0x20aa43[_0x10f6('0xe')]++,'VoiceExtensionId':_0x4d5b7a[_0x3d25c6][0x0][_0x10f6('0x16')]});}_0x20aa43['extensions'][_0x10f6('0x18')]({'type':_0x4d5b7a[_0x3d25c6][0x0][_0x10f6('0x12')],'app':_0x10f6('0x13'),'appdata':'outboundrouteid='+_0x4d5b7a[_0x3d25c6][0x0][_0x10f6('0x16')],'context':_0x4d5b7a[_0x3d25c6][0x0]['context'],'exten':_0x4d5b7a[_0x3d25c6][0x0][_0x10f6('0xb')],'priority':_0x20aa43[_0x10f6('0xe')]++,'VoiceExtensionId':_0x4d5b7a[_0x3d25c6][0x0][_0x10f6('0x16')]});if(_0x20aa43['extension']&&_0x20aa43['extension'][_0x10f6('0xd')](_0x10f6('0x23'))&&_0x20aa43[_0x10f6('0xf')][_0x10f6('0x23')]!==_0x10f6('0x24')){_0x20aa43[_0x10f6('0x11')][_0x10f6('0x18')]({'type':_0x4d5b7a[_0x3d25c6][0x0][_0x10f6('0x12')],'app':'Set','appdata':_0x10f6('0x25'),'context':_0x4d5b7a[_0x3d25c6][0x0]['context'],'exten':_0x4d5b7a[_0x3d25c6][0x0]['exten'],'priority':_0x20aa43[_0x10f6('0xe')]++,'VoiceExtensionId':_0x4d5b7a[_0x3d25c6][0x0][_0x10f6('0x16')]});_0x20aa43['extensions'][_0x10f6('0x18')]({'type':_0x4d5b7a[_0x3d25c6][0x0]['type'],'app':'Set','appdata':_0x10f6('0x26')+_0x20aa43['extension']['recordingFormat']||_0x10f6('0x27'),'context':_0x4d5b7a[_0x3d25c6][0x0][_0x10f6('0x1d')],'exten':_0x4d5b7a[_0x3d25c6][0x0][_0x10f6('0xb')],'priority':_0x20aa43['priority']++,'VoiceExtensionId':_0x4d5b7a[_0x3d25c6][0x0][_0x10f6('0x16')]});}}_0x20aa43[_0x10f6('0x11')][_0x10f6('0x18')]({'type':_0x4d5b7a[_0x3d25c6][0x0][_0x10f6('0x12')],'app':_0x10f6('0x13'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x4d5b7a[_0x3d25c6][0x0][_0x10f6('0x1d')],'exten':_0x4d5b7a[_0x3d25c6][0x0][_0x10f6('0xb')],'priority':_0x20aa43['priority']++,'VoiceExtensionId':_0x4d5b7a[_0x3d25c6][0x0][_0x10f6('0x16')]});_0x20aa43[_0x10f6('0x11')]['push']({'type':_0x4d5b7a[_0x3d25c6][0x0][_0x10f6('0x12')],'app':'Set','appdata':_0x10f6('0x28'),'context':_0x4d5b7a[_0x3d25c6][0x0][_0x10f6('0x1d')],'exten':_0x4d5b7a[_0x3d25c6][0x0]['exten'],'priority':_0x20aa43['priority']++,'VoiceExtensionId':_0x4d5b7a[_0x3d25c6][0x0][_0x10f6('0x16')]});_0x20aa43[_0x10f6('0x11')][_0x10f6('0x18')]({'type':_0x4d5b7a[_0x3d25c6][0x0]['type'],'app':_0x10f6('0x13'),'appdata':_0x10f6('0x29'),'context':_0x4d5b7a[_0x3d25c6][0x0][_0x10f6('0x1d')],'exten':_0x4d5b7a[_0x3d25c6][0x0][_0x10f6('0xb')],'priority':_0x20aa43[_0x10f6('0xe')]++,'VoiceExtensionId':_0x4d5b7a[_0x3d25c6][0x0][_0x10f6('0x16')]});for(var _0x2373ad=0x0,_0x16796b=0x0;_0x2373ad<_0x4d5b7a[_0x3d25c6][_0x10f6('0x2a')];_0x2373ad+=0x1,_0x16796b=0x0){var _0x31ea10=_0x4d5b7a[_0x3d25c6][_0x2373ad];if(_0x31ea10[_0x10f6('0x12')]){_0x31ea10[_0x10f6('0x12')]=_0x31ea10[_0x10f6('0x12')]['toLowerCase']();}var _0x317dba=[];var _0x2a45d1=[];delete _0x31ea10['id'];delete _0x31ea10[_0x10f6('0x2b')];delete _0x31ea10[_0x10f6('0x2c')];var _0x2b7884=_0x31ea10[_0x10f6('0x2d')]!==_0x10f6('0x2e')?[_0x31ea10[_0x10f6('0x2d')]]:_0x31ea10[_0x10f6('0x6')]?_['map'](_['filter'](_0x20aa43[_0x10f6('0x4')],{'IntervalId':_0x31ea10[_0x10f6('0x6')]}),_0x10f6('0x2d')):[];if(_0x31ea10['hasOwnProperty'](_0x10f6('0x2f'))){if(_0x31ea10[_0x10f6('0x2f')]&&_0x31ea10[_0x10f6('0x2f')]!=='--'){_0x317dba[_0x10f6('0x18')]({'type':_0x31ea10[_0x10f6('0x12')],'app':_0x10f6('0x13'),'appdata':_0x10f6('0x30')+_0x31ea10[_0x10f6('0x2f')],'context':_0x31ea10[_0x10f6('0x1d')],'exten':_0x31ea10[_0x10f6('0xb')],'priority':_0x2b7884[_0x10f6('0x2a')]+_0x20aa43['priority']+_0x16796b++,'VoiceExtensionId':_0x31ea10[_0x10f6('0x16')]});}}if(_0x31ea10[_0x10f6('0x12')]===_0x10f6('0x17')&&_0x31ea10['hasOwnProperty'](_0x10f6('0x31'))){if(_0x31ea10[_0x10f6('0x31')]){_0x317dba[_0x10f6('0x18')]({'type':_0x31ea10[_0x10f6('0x12')],'app':'ExecIf','appdata':_0x10f6('0x32')+_0x31ea10[_0x10f6('0x31')]+')','context':_0x31ea10[_0x10f6('0x1d')],'exten':_0x31ea10[_0x10f6('0xb')],'priority':_0x2b7884[_0x10f6('0x2a')]+_0x20aa43[_0x10f6('0xe')]+_0x16796b++,'VoiceExtensionId':_0x31ea10[_0x10f6('0x16')]});}else{_0x317dba['push']({'type':_0x31ea10[_0x10f6('0x12')],'app':_0x10f6('0x1f'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x31ea10[_0x10f6('0x1d')],'exten':_0x31ea10['exten'],'priority':_0x2b7884[_0x10f6('0x2a')]+_0x20aa43['priority']+_0x16796b++,'VoiceExtensionId':_0x31ea10[_0x10f6('0x16')]});}}if(_0x31ea10['hasOwnProperty'](_0x10f6('0x33'))){if(_0x359dce[_0x10f6('0x34')](_0x31ea10[_0x10f6('0x35')][_0x10f6('0x36')]())>=0x0&&_0x31ea10[_0x10f6('0x37')]!==_0x10f6('0x38')){if(_0x31ea10[_0x10f6('0x33')]){_0x317dba[_0x10f6('0x18')]({'type':_0x31ea10[_0x10f6('0x12')],'app':'ExecIf','appdata':_0x10f6('0x39'),'context':_0x31ea10[_0x10f6('0x1d')],'exten':_0x31ea10[_0x10f6('0xb')],'priority':_0x2b7884['length']+_0x20aa43['priority']+_0x16796b++,'VoiceExtensionId':_0x31ea10[_0x10f6('0x16')]});_0x317dba[_0x10f6('0x18')]({'type':_0x31ea10[_0x10f6('0x12')],'app':_0x10f6('0x13'),'appdata':_0x10f6('0x3a'),'context':_0x31ea10[_0x10f6('0x1d')],'exten':_0x31ea10[_0x10f6('0xb')],'priority':_0x2b7884[_0x10f6('0x2a')]+_0x20aa43[_0x10f6('0xe')]+_0x16796b++,'VoiceExtensionId':_0x31ea10[_0x10f6('0x16')]});}else{_0x317dba['push']({'type':_0x31ea10[_0x10f6('0x12')],'app':'ExecIf','appdata':_0x10f6('0x3b'),'context':_0x31ea10[_0x10f6('0x1d')],'exten':_0x31ea10[_0x10f6('0xb')],'priority':_0x2b7884[_0x10f6('0x2a')]+_0x20aa43[_0x10f6('0xe')]+_0x16796b++,'VoiceExtensionId':_0x31ea10[_0x10f6('0x16')]});_0x317dba[_0x10f6('0x18')]({'type':_0x31ea10[_0x10f6('0x12')],'app':_0x10f6('0x13'),'appdata':_0x10f6('0x3c'),'context':_0x31ea10['context'],'exten':_0x31ea10[_0x10f6('0xb')],'priority':_0x2b7884['length']+_0x20aa43[_0x10f6('0xe')]+_0x16796b++,'VoiceExtensionId':_0x31ea10[_0x10f6('0x16')]});}}}for(var _0x116c29=0x0;_0x116c29<_0x2b7884[_0x10f6('0x2a')];_0x116c29+=0x1){var _0x2e02b9=_0x20aa43[_0x10f6('0xe')]+_0x2b7884[_0x10f6('0x2a')];var _0x5ceef6=_0x116c29===_0x2b7884[_0x10f6('0x2a')]-0x1?_0x20aa43[_0x10f6('0xe')]+_0x317dba[_0x10f6('0x2a')]+_0x2a45d1[_0x10f6('0x2a')]+0x2:_0x20aa43[_0x10f6('0xe')]+_0x116c29+0x1;_0x317dba[_0x10f6('0x3d')](_0x116c29,0x0,{'type':_0x31ea10[_0x10f6('0x12')],'app':_0x10f6('0x3e'),'appdata':_0x2b7884[_0x116c29]+'?'+_0x31ea10[_0x10f6('0x1d')]+',${EXTEN},'+_0x2e02b9+':'+_0x31ea10[_0x10f6('0x1d')]+_0x10f6('0x3f')+_0x5ceef6,'exten':_0x31ea10[_0x10f6('0xb')],'context':_0x31ea10[_0x10f6('0x1d')],'priority':_0x20aa43[_0x10f6('0xe')]+_0x116c29,'VoiceExtensionId':_0x4d5b7a[_0x3d25c6][0x0][_0x10f6('0x16')]});}_0x31ea10[_0x10f6('0xe')]=_0x317dba[_0x10f6('0x2a')]?_[_0x10f6('0x40')](_0x317dba)[_0x10f6('0xe')]+0x1:_0x20aa43['priority'];_0x20aa43[_0x10f6('0xe')]=(_0x2a45d1[_0x10f6('0x2a')]?_['last'](_0x2a45d1)[_0x10f6('0xe')]:_0x31ea10['priority'])+0x1;_0x20aa43['extensions']=_[_0x10f6('0x41')](_0x20aa43[_0x10f6('0x11')],_0x317dba,[_0x31ea10],_0x2a45d1);}_0x20aa43[_0x10f6('0x11')][_0x10f6('0x18')]({'type':_0x4d5b7a[_0x3d25c6][0x0][_0x10f6('0x12')],'app':_0x10f6('0x42'),'exten':_0x4d5b7a[_0x3d25c6][0x0][_0x10f6('0xb')],'context':_0x4d5b7a[_0x3d25c6][0x0][_0x10f6('0x1d')],'priority':_0x20aa43[_0x10f6('0xe')],'VoiceExtensionId':_0x4d5b7a[_0x3d25c6][0x0][_0x10f6('0x16')]});_0xb5ef70[_0x10f6('0x18')](_0x4d5b7a[_0x3d25c6][0x0][_0x10f6('0x16')]);_0x51e0ba=_[_0x10f6('0x41')](_0x51e0ba,_0x20aa43[_0x10f6('0x11')]);}}return _0x4f0ddf[_0x10f6('0x43')](function(_0x7f7c4a){return _0x4f0ddf[_0x10f6('0x1')][_0x10f6('0x5')][_0x10f6('0x44')]({'where':{'VoiceExtensionId':{'$in':_0xb5ef70}},'transaction':_0x7f7c4a})[_0x10f6('0x3')](function(_0x1d320c){return _0x4f0ddf[_0x10f6('0x1')][_0x10f6('0x5')]['bulkCreate'](_[_0x10f6('0x45')](_0x51e0ba,'priority'),{'transaction':_0x7f7c4a});});});})[_0x10f6('0x46')](function(_0x5eb318){console[_0x10f6('0x47')](_0x5eb318);});}exports['rewrite']=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 6227822..059b248 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 _0x0713=['papaparse','ioredis','../../../mysqldb','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','split','Missing\x20ListId\x20parameter!','error','contact','index','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email\x20format\x20is\x20not\x20valid!','ListId','find','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','catch','Error\x20while\x20creating\x20contact:\x20','stringify','checkHopper','inspect','insert','fromQuery','phone','scheduledAt','updatedAt','field','NOW()','ContactId','toString','createdAt','from','ListId\x20=\x20?','where','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','cm_hopper','\x20=\x20?','into','deletedAt\x20IS\x20NULL','id\x20IN\x20?','str','calleridnum','cm_hopper_final','cm_hopper_black','cm_contacts','VoiceQueue','findAll','outbound','dialCheckDuplicateType','Lists','get','sequelize','query','VoiceQueueId','onlyIfOpen','push','all','CmList','Campaign','CampaignId','BlackLists','cmContact,\x20%s,\x20%s','Error\x20processing\x20rows\x20block:','emit','contact:csv_','resume','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','resolve','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','lodash','squel'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0x3071('0x0'));var fs=require('fs');var squel=require(_0x3071('0x1'));var Papa=require(_0x3071('0x2'));var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var config=require('../../../config/environment');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));config[_0x3071('0x7')]=_[_0x3071('0x8')](config[_0x3071('0x7')],{'host':_0x3071('0x9'),'port':0x18eb});var socket=require(_0x3071('0xa'))(new Redis(config[_0x3071('0x7')]));require(_0x3071('0xb'))[_0x3071('0xc')](socket);try{if(!process[_0x3071('0xd')][0x2]||process[_0x3071('0xd')][0x2]===_0x3071('0xe')||process['argv'][0x2]===_0x3071('0xf')){throw new Error(_0x3071('0x10'));}var FILEPATH=process[_0x3071('0xd')][0x2];if(!process[_0x3071('0xd')][0x3]||process[_0x3071('0xd')][0x3]==='undefined'||process[_0x3071('0xd')][0x3]===_0x3071('0xf')||!process[_0x3071('0xd')][0x4]||process[_0x3071('0xd')][0x4]===_0x3071('0xe')||process['argv'][0x4]==='null'){throw new Error(_0x3071('0x11'));}var FIELDS=_['zipObject'](process[_0x3071('0xd')][0x3][_0x3071('0x12')](','),process['argv'][0x4][_0x3071('0x12')](','));if(!process['argv'][0x5]||process[_0x3071('0xd')][0x5]===_0x3071('0xe')||process[_0x3071('0xd')][0x5]===_0x3071('0xf')){throw new Error(_0x3071('0x13'));}var LISTID=process[_0x3071('0xd')][0x5];var COMPANYID=process[_0x3071('0xd')][0x6]&&process[_0x3071('0xd')][0x6]!==_0x3071('0xe')&&process[_0x3071('0xd')][0x6]!=='null'?process[_0x3071('0xd')][0x6]:null;var DUPLICATES=process[_0x3071('0xd')][0x7]&&process[_0x3071('0xd')][0x7]!==_0x3071('0xe')&&process[_0x3071('0xd')][0x7]!==_0x3071('0xf')?process[_0x3071('0xd')][0x7]:null;if(!process[_0x3071('0xd')][0x8]||process['argv'][0x8]===_0x3071('0xe')||process[_0x3071('0xd')][0x8]===_0x3071('0xf')){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0x3071('0xd')][0x8];}catch(_0x5cd80d){logger[_0x3071('0x14')](_0x5cd80d);endCsv();}var total=0x0;var pTotal=0x0;var success=0x0;var errors=0x0;var duplicates=0x0;var rows=[];var hopperContacts='';var promises=[];var index=0x0;var alreadyInvalid=![];function handleCheckRowError(_0x43128c,_0x3762d8,_0x457b57,_0x33090c){var _0x34c50e={'message':_0x3762d8};_0x34c50e[_0x43128c]=!![];if(_0x457b57){_0x34c50e[_0x3071('0x15')]=_0x457b57;}if(_0x33090c){_0x34c50e[_0x3071('0x16')]=_0x33090c;}return _0x34c50e;}function isEmail(_0x542646){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0x542646);}function checkRow(_0x2ce48a,_0xb05b1d,_0x412652){return new BPromise(function(_0x13df9f,_0x2793ef){if(_[_0x3071('0x17')](_0x2ce48a)){return _0x2793ef(handleCheckRowError(_0x3071('0x14'),_0x3071('0x18'),null,_0x412652));}if(_0x2ce48a[_0x3071('0x19')]&&_0x2ce48a['errors'][_0x3071('0x1a')]){var _0x3f1e6e=_[_0x3071('0x1b')](_0x2ce48a['errors'],_0x3071('0x1c'))[_0x3071('0x1d')](';');return _0x2793ef(handleCheckRowError(_0x3071('0x14'),_0x3f1e6e,null,_0x412652));}var _0x950fde={};for(var _0x3fa3b8 in FIELDS){if(FIELDS[_0x3071('0x1e')](_0x3fa3b8)&&FIELDS[_0x3fa3b8]){_0x950fde[_0x3fa3b8]=_0x2ce48a[_0x3071('0x1f')][0x0][FIELDS[_0x3fa3b8]]||_0x2ce48a[_0x3071('0x1f')][0x0]['\ufeff'+FIELDS[_0x3fa3b8]];}}if(!_0x950fde[_0x3071('0x20')]){return _0x2793ef(handleCheckRowError(_0x3071('0x14'),_0x3071('0x21'),null,_0x412652));}if(!_0x950fde['phone']){return _0x2793ef(handleCheckRowError('error',_0x3071('0x22'),null,_0x412652));}if(_0x950fde[_0x3071('0x23')]){var _0x6ddf96=moment(_0x950fde[_0x3071('0x23')],_0x3071('0x24'));if(!_0x6ddf96[_0x3071('0x25')]()){return _0x2793ef(handleCheckRowError(_0x3071('0x14'),_0x3071('0x26'),null,_0x412652));}}if(_0x950fde['email']){if(!isEmail(_0x950fde['email'])){return _0x2793ef(handleCheckRowError('error',_0x3071('0x27'),null,_0x412652));}}_0x950fde[_0x3071('0x28')]=LISTID;_0x950fde['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x3071('0x1a')]&&_0xb05b1d){var _0x28747d={};for(var _0x25250e=0x0,_0x13ae2c=DUPLICATES['length'];_0x25250e<_0x13ae2c;_0x25250e+=0x1){_0x28747d[DUPLICATES[_0x25250e]]=_0x950fde[DUPLICATES[_0x25250e]];}var _0x218a82=_[_0x3071('0x29')](_0xb05b1d,_0x28747d);if(_0x218a82){return _0x2793ef(handleCheckRowError(_0x3071('0x2a'),_0x3071('0x2b'),_0x218a82,_0x412652));}}return db[_0x3071('0x2c')][_0x3071('0x2d')](_0x950fde,{'raw':!![],'hooks':![],'fields':_[_0x3071('0x2e')](_0x950fde)})[_0x3071('0x2f')](function(_0x596cc3){if(DUPLICATES&&DUPLICATES[_0x3071('0x1a')]&&_0xb05b1d){_0xb05b1d['push'](_['pick'](_0x950fde,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x596cc3['id'];return _0x13df9f();})[_0x3071('0x30')](function(_0xa3a7ae){return _0x2793ef(handleCheckRowError('error',_0x3071('0x31')+(_0xa3a7ae[_0x3071('0x1c')]||JSON[_0x3071('0x32')](_0xa3a7ae)),null,_0x412652));});});}function checkHopper(){function _0x14ac42(){return function(_0xc60572){logger[_0x3071('0x14')]('cmContact',_0x3071('0x33'),util[_0x3071('0x34')](_0xc60572,{'showHidden':![],'depth':null}));};}var _0x4ce6d4=function(_0x44ad05,_0x5b1392){var _0x28f855=squel[_0x3071('0x35')]()['into']('cm_hopper')[_0x3071('0x36')]([_0x3071('0x37'),_0x3071('0x38'),'ContactId',_0x3071('0x28'),_0x5b1392,'createdAt',_0x3071('0x39')],squel['select']()[_0x3071('0x3a')](_0x3071('0x37'),_0x3071('0x37'))[_0x3071('0x3a')](_0x3071('0x3b'),'scheduledAt')['field']('id',_0x3071('0x3c'))[_0x3071('0x3a')](LISTID[_0x3071('0x3d')](),_0x3071('0x28'))['field'](_0x44ad05['id'][_0x3071('0x3d')](),_0x5b1392)[_0x3071('0x3a')](_0x3071('0x3b'),_0x3071('0x3e'))[_0x3071('0x3a')](_0x3071('0x3b'),'updatedAt')[_0x3071('0x3f')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')['where'](_0x3071('0x40'),LISTID[_0x3071('0x3d')]())[_0x3071('0x41')](_0x3071('0x42'))[_0x3071('0x41')](_0x3071('0x43'),squel[_0x3071('0x44')]()[_0x3071('0x3a')]('phone')[_0x3071('0x3f')](_0x3071('0x45'))[_0x3071('0x41')](_0x5b1392+_0x3071('0x46'),_0x44ad05['id'][_0x3071('0x3d')]())))['toString']();return _0x28f855;};var _0x5c93c7=function(_0x1721d0,_0x3c2f5e){var _0x1fe5e0=squel[_0x3071('0x35')]()[_0x3071('0x47')]('cm_hopper')[_0x3071('0x36')](['phone',_0x3071('0x38'),'ContactId','ListId',_0x3c2f5e,_0x3071('0x3e'),'updatedAt'],squel[_0x3071('0x44')]()['field'](_0x3071('0x37'),_0x3071('0x37'))[_0x3071('0x3a')](_0x3071('0x3b'),'scheduledAt')[_0x3071('0x3a')]('id','ContactId')[_0x3071('0x3a')](LISTID['toString'](),_0x3071('0x28'))[_0x3071('0x3a')](_0x1721d0['id']['toString'](),_0x3c2f5e)[_0x3071('0x3a')](_0x3071('0x3b'),_0x3071('0x3e'))[_0x3071('0x3a')](_0x3071('0x3b'),_0x3071('0x39'))[_0x3071('0x3f')]('cm_contacts')[_0x3071('0x41')](_0x3071('0x48'))[_0x3071('0x41')](_0x3071('0x40'),LISTID['toString']())[_0x3071('0x41')](_0x3071('0x49'),squel[_0x3071('0x4a')](hopperContacts))[_0x3071('0x41')](_0x3071('0x42'))[_0x3071('0x41')](_0x3071('0x43'),squel[_0x3071('0x44')]()[_0x3071('0x3a')](_0x3071('0x4b'))[_0x3071('0x3f')](_0x3071('0x4c'))[_0x3071('0x41')](_0x3c2f5e+_0x3071('0x46'),_0x1721d0['id'][_0x3071('0x3d')]()))[_0x3071('0x41')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x3071('0x3a')]('phone')[_0x3071('0x3f')](_0x3071('0x45'))[_0x3071('0x41')](_0x3c2f5e+'\x20=\x20?',_0x1721d0['id'][_0x3071('0x3d')]())))[_0x3071('0x3d')]();return _0x1fe5e0;};function _0x5bc69e(_0x4b8ec0,_0x1b89ea){var _0x15abc4=squel[_0x3071('0x35')]()[_0x3071('0x47')]('cm_hopper')[_0x3071('0x36')]([_0x3071('0x37'),_0x3071('0x38'),_0x3071('0x3c'),_0x3071('0x28'),_0x1b89ea,'createdAt',_0x3071('0x39')],squel[_0x3071('0x44')]()[_0x3071('0x3a')](_0x3071('0x37'),_0x3071('0x37'))[_0x3071('0x3a')](_0x3071('0x3b'),'scheduledAt')['field']('id',_0x3071('0x3c'))['field'](LISTID[_0x3071('0x3d')](),_0x3071('0x28'))['field'](_0x4b8ec0['id'][_0x3071('0x3d')](),_0x1b89ea)[_0x3071('0x3a')]('NOW()',_0x3071('0x3e'))[_0x3071('0x3a')](_0x3071('0x3b'),_0x3071('0x39'))[_0x3071('0x3f')]('cm_contacts')[_0x3071('0x41')](_0x3071('0x48'))[_0x3071('0x41')]('ListId\x20=\x20?',LISTID[_0x3071('0x3d')]())[_0x3071('0x41')](_0x3071('0x49'),squel[_0x3071('0x4a')](hopperContacts))[_0x3071('0x41')](_0x3071('0x42')))[_0x3071('0x3d')]();return _0x15abc4;}function _0x2e39ff(_0x3b47e8,_0x5cb3b3){var _0x5d1316=squel[_0x3071('0x35')]()[_0x3071('0x47')](_0x3071('0x4d'))[_0x3071('0x36')]([_0x3071('0x37'),_0x3071('0x3c'),_0x3071('0x28'),_0x5cb3b3,_0x3071('0x3e'),_0x3071('0x39')],squel[_0x3071('0x44')]()['field'](_0x3071('0x37'),_0x3071('0x37'))[_0x3071('0x3a')]('id',_0x3071('0x3c'))[_0x3071('0x3a')](LISTID[_0x3071('0x3d')](),_0x3071('0x28'))[_0x3071('0x3a')](_0x3b47e8['id']['toString'](),_0x5cb3b3)[_0x3071('0x3a')](_0x3071('0x3b'),'createdAt')['field'](_0x3071('0x3b'),_0x3071('0x39'))[_0x3071('0x3f')](_0x3071('0x4e'))['where']('deletedAt\x20IS\x20NULL')[_0x3071('0x41')]('ListId\x20=\x20?',LISTID['toString']())['where']('id\x20IN\x20?',squel[_0x3071('0x4a')](hopperContacts))[_0x3071('0x41')](_0x3071('0x42')))['toString']();return _0x5d1316;}return db[_0x3071('0x4f')][_0x3071('0x50')]({'where':{'type':_0x3071('0x51')},'attributes':['id',_0x3071('0x52')],'include':[{'model':db['CmList'],'as':_0x3071('0x53'),'where':{'id':LISTID}}]})[_0x3071('0x2f')](function(_0x588406){var _0x1b35d3=[];if(_0x588406){var _0x29ee70;for(var _0x388cd1=0x0,_0x40c258;_0x388cd1<_0x588406[_0x3071('0x1a')];_0x388cd1+=0x1){_0x40c258=_0x588406[_0x388cd1][_0x3071('0x54')]({'plain':!![]});switch(_0x40c258[_0x3071('0x52')]){case'always':_0x1b35d3['push'](db[_0x3071('0x55')][_0x3071('0x56')](_0x5c93c7(_0x40c258,_0x3071('0x57')))['then'](function(){})['catch'](_0x14ac42()));break;case _0x3071('0x58'):_0x1b35d3[_0x3071('0x59')](db[_0x3071('0x55')][_0x3071('0x56')](_0x4ce6d4(_0x40c258,_0x3071('0x57')))[_0x3071('0x2f')](function(){})[_0x3071('0x30')](_0x14ac42()));break;default:_0x1b35d3[_0x3071('0x59')](db['sequelize'][_0x3071('0x56')](_0x5bc69e(_0x40c258,'VoiceQueueId'))[_0x3071('0x2f')](function(){})[_0x3071('0x30')](_0x14ac42()));}}}return _0x1b35d3;})[_0x3071('0x5a')]()[_0x3071('0x2f')](function(){return db[_0x3071('0x4f')][_0x3071('0x50')]({'where':{'type':_0x3071('0x51')},'attributes':['id'],'include':[{'model':db[_0x3071('0x5b')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x3071('0x2f')](function(_0x138a94){var _0x1da477=[];if(_0x138a94){var _0x4f06c0;for(var _0x2a2e7a=0x0,_0x22ec7b;_0x2a2e7a<_0x138a94[_0x3071('0x1a')];_0x2a2e7a+=0x1){_0x22ec7b=_0x138a94[_0x2a2e7a]['get']({'plain':!![]});_0x1da477['push'](db[_0x3071('0x55')]['query'](_0x2e39ff(_0x22ec7b,_0x3071('0x57')))[_0x3071('0x2f')](function(){})[_0x3071('0x30')](_0x14ac42()));}}return _0x1da477;})[_0x3071('0x5a')]();})[_0x3071('0x2f')](function(){return db[_0x3071('0x5c')][_0x3071('0x50')]({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x3071('0x5b')],'as':_0x3071('0x53'),'where':{'id':LISTID}}]})[_0x3071('0x2f')](function(_0x3cc937){var _0x98d0fb=[];if(_0x3cc937){for(var _0x1fea60=0x0,_0x435dcb;_0x1fea60<_0x3cc937[_0x3071('0x1a')];_0x1fea60+=0x1){_0x435dcb=_0x3cc937[_0x1fea60]['get']({'plain':!![]});switch(_0x435dcb[_0x3071('0x52')]){case'always':_0x98d0fb[_0x3071('0x59')](db[_0x3071('0x55')][_0x3071('0x56')](_0x5c93c7(_0x435dcb,_0x3071('0x5d')))[_0x3071('0x2f')](function(){})[_0x3071('0x30')](_0x14ac42()));break;case _0x3071('0x58'):_0x98d0fb[_0x3071('0x59')](db[_0x3071('0x55')][_0x3071('0x56')](_0x4ce6d4(_0x435dcb,'CampaignId'))[_0x3071('0x2f')](function(){})[_0x3071('0x30')](_0x14ac42()));break;default:_0x98d0fb['push'](db[_0x3071('0x55')][_0x3071('0x56')](_0x5bc69e(_0x435dcb,_0x3071('0x5d')))[_0x3071('0x2f')](function(){})[_0x3071('0x30')](_0x14ac42()));}}}return _0x98d0fb;})['all']();})['then'](function(){return db[_0x3071('0x5c')]['findAll']({'attributes':['id'],'include':[{'model':db[_0x3071('0x5b')],'as':_0x3071('0x5e'),'where':{'id':LISTID}}]})[_0x3071('0x2f')](function(_0x136278){var _0x22783b=[];if(_0x136278){for(var _0x2f31b7=0x0,_0x568386;_0x2f31b7<_0x136278[_0x3071('0x1a')];_0x2f31b7+=0x1){_0x568386=_0x136278[_0x2f31b7][_0x3071('0x54')]({'plain':!![]});_0x22783b[_0x3071('0x59')](db[_0x3071('0x55')]['query'](_0x2e39ff(_0x568386,_0x3071('0x5d')))[_0x3071('0x2f')](function(){})['catch'](_0x14ac42()));}}return _0x22783b;})[_0x3071('0x5a')]();})[_0x3071('0x30')](function(_0x391887){logger[_0x3071('0x14')](_0x3071('0x5f'),'generalCheckHopper',_0x391887[_0x3071('0x1c')]);});}var processPromises=function(_0x479fe7){return BPromise[_0x3071('0x5a')](promises)[_0x3071('0x2f')](function(_0x39060f){})[_0x3071('0x30')](function(_0x1120ec){logger[_0x3071('0x14')](_0x3071('0x60'),JSON[_0x3071('0x32')](_0x1120ec));})['finally'](function(){socket[_0x3071('0x61')](_0x3071('0x62')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x479fe7){return _0x479fe7[_0x3071('0x63')]();}});};var endCsv=function(){return BPromise['resolve']()[_0x3071('0x2f')](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket[_0x3071('0x61')](_0x3071('0x62')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x3071('0x64')](FILEPATH);}catch(_0x5e0cbd){logger[_0x3071('0x14')](_0x3071('0x65'),JSON[_0x3071('0x32')](_0x5e0cbd));}finally{process[_0x3071('0x66')](0x0);}});};process['on'](_0x3071('0x67'),function(){logger[_0x3071('0x68')](_0x3071('0x69'));endCsv();});function main(){return BPromise[_0x3071('0x6a')]()[_0x3071('0x2f')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db[_0x3071('0x2c')][_0x3071('0x50')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x3071('0x2f')](function(_0x5b2830){var _0x561030=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x561030,{'header':!![],'skipEmptyLines':!![],'step':function(_0x4eb9e2,_0x8c77b7){total+=0x1;var _0x44b4c9=total;promises['push'](checkRow(_0x4eb9e2,_0x5b2830,_0x44b4c9)[_0x3071('0x2f')](function(){success+=0x1;})[_0x3071('0x30')](function(_0x1f61df){if(_0x1f61df['error']){errors+=0x1;delete _0x1f61df['error'];}else if(_0x1f61df[_0x3071('0x2a')]){duplicates+=0x1;delete _0x1f61df[_0x3071('0x2a')];}rows[_0x3071('0x59')](_0x1f61df);}));if(total%0xc8===0x0){_0x8c77b7[_0x3071('0x6b')]();return processPromises(_0x8c77b7);}},'complete':function(){return processPromises()[_0x3071('0x2f')](function(){logger[_0x3071('0x68')](_0x3071('0x6c'));endCsv();});},'error':function(_0x5eb60d,_0x58b62c){logger[_0x3071('0x68')](_0x3071('0x6d'),JSON[_0x3071('0x32')](_0x5eb60d));endCsv();}});})[_0x3071('0x30')](function(_0x5a3b64){logger[_0x3071('0x14')](_0x3071('0x6e'),JSON[_0x3071('0x32')](_0x5a3b64));});}main(); \ No newline at end of file +var _0xd8b0=['find','Duplicate\x20Contact','CmContact','keys','then','push','pick','catch','message','stringify','cmContact','checkHopper','inspect','into','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','field','ListId','toString','NOW()','from','cm_contacts','where','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','ListId\x20=\x20?','id\x20IN\x20?','insert','deletedAt\x20IS\x20NULL','str','cm_hopper_black','VoiceQueue','outbound','Lists','get','dialCheckDuplicateType','always','sequelize','VoiceQueueId','onlyIfOpen','query','all','CmList','Campaign','findAll','CampaignId','cmContact,\x20%s,\x20%s','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','info','createReadStream','parse','duplicate','pause','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','contact','index','test','error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','map','hasOwnProperty','data','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','email','CompanyId','length'];(function(_0x3956e3,_0x4816ac){var _0x36b277=function(_0x2fc311){while(--_0x2fc311){_0x3956e3['push'](_0x3956e3['shift']());}};_0x36b277(++_0x4816ac);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var BPromise=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var _=require('lodash');var fs=require('fs');var squel=require('squel');var Papa=require('papaparse');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var config=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));config['redis']=_['defaults'](config[_0x0d8b('0x7')],{'host':_0x0d8b('0x8'),'port':0x18eb});var socket=require(_0x0d8b('0x9'))(new Redis(config['redis']));require(_0x0d8b('0xa'))[_0x0d8b('0xb')](socket);try{if(!process['argv'][0x2]||process[_0x0d8b('0xc')][0x2]===_0x0d8b('0xd')||process[_0x0d8b('0xc')][0x2]===_0x0d8b('0xe')){throw new Error(_0x0d8b('0xf'));}var FILEPATH=process[_0x0d8b('0xc')][0x2];if(!process[_0x0d8b('0xc')][0x3]||process[_0x0d8b('0xc')][0x3]==='undefined'||process[_0x0d8b('0xc')][0x3]==='null'||!process[_0x0d8b('0xc')][0x4]||process[_0x0d8b('0xc')][0x4]===_0x0d8b('0xd')||process[_0x0d8b('0xc')][0x4]===_0x0d8b('0xe')){throw new Error(_0x0d8b('0x10'));}var FIELDS=_[_0x0d8b('0x11')](process[_0x0d8b('0xc')][0x3][_0x0d8b('0x12')](','),process[_0x0d8b('0xc')][0x4][_0x0d8b('0x12')](','));if(!process[_0x0d8b('0xc')][0x5]||process[_0x0d8b('0xc')][0x5]===_0x0d8b('0xd')||process['argv'][0x5]===_0x0d8b('0xe')){throw new Error(_0x0d8b('0x13'));}var LISTID=process[_0x0d8b('0xc')][0x5];var COMPANYID=process[_0x0d8b('0xc')][0x6]&&process[_0x0d8b('0xc')][0x6]!=='undefined'&&process[_0x0d8b('0xc')][0x6]!==_0x0d8b('0xe')?process[_0x0d8b('0xc')][0x6]:null;var DUPLICATES=process[_0x0d8b('0xc')][0x7]&&process[_0x0d8b('0xc')][0x7]!==_0x0d8b('0xd')&&process[_0x0d8b('0xc')][0x7]!==_0x0d8b('0xe')?process['argv'][0x7]:null;if(!process[_0x0d8b('0xc')][0x8]||process[_0x0d8b('0xc')][0x8]===_0x0d8b('0xd')||process[_0x0d8b('0xc')][0x8]===_0x0d8b('0xe')){throw new Error(_0x0d8b('0x14'));}var SOCKET_TIMESTAMP=process[_0x0d8b('0xc')][0x8];}catch(_0x352c17){logger['error'](_0x352c17);endCsv();}var total=0x0;var pTotal=0x0;var success=0x0;var errors=0x0;var duplicates=0x0;var rows=[];var hopperContacts='';var promises=[];var index=0x0;var alreadyInvalid=![];function handleCheckRowError(_0x4f0a1a,_0x33fb87,_0x54a9a7,_0x56c729){var _0x5527d8={'message':_0x33fb87};_0x5527d8[_0x4f0a1a]=!![];if(_0x54a9a7){_0x5527d8[_0x0d8b('0x15')]=_0x54a9a7;}if(_0x56c729){_0x5527d8[_0x0d8b('0x16')]=_0x56c729;}return _0x5527d8;}function isEmail(_0x214778){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/[_0x0d8b('0x17')](_0x214778);}function checkRow(_0x221071,_0x2c64e2,_0x30980c){return new BPromise(function(_0x4562cb,_0x27b695){if(_['isNil'](_0x221071)){return _0x27b695(handleCheckRowError(_0x0d8b('0x18'),_0x0d8b('0x19'),null,_0x30980c));}if(_0x221071['errors']&&_0x221071[_0x0d8b('0x1a')]['length']){var _0x3dd149=_[_0x0d8b('0x1b')](_0x221071[_0x0d8b('0x1a')],'message')['join'](';');return _0x27b695(handleCheckRowError(_0x0d8b('0x18'),_0x3dd149,null,_0x30980c));}var _0x3ef745={};for(var _0x4c05ee in FIELDS){if(FIELDS[_0x0d8b('0x1c')](_0x4c05ee)&&FIELDS[_0x4c05ee]){_0x3ef745[_0x4c05ee]=_0x221071['data'][0x0][FIELDS[_0x4c05ee]]||_0x221071[_0x0d8b('0x1d')][0x0]['\ufeff'+FIELDS[_0x4c05ee]];}}if(!_0x3ef745['firstName']){return _0x27b695(handleCheckRowError(_0x0d8b('0x18'),'firstName\x20not\x20specified!',null,_0x30980c));}if(!_0x3ef745[_0x0d8b('0x1e')]){return _0x27b695(handleCheckRowError('error',_0x0d8b('0x1f'),null,_0x30980c));}if(_0x3ef745['birthDate']){var _0x3c8887=moment(_0x3ef745[_0x0d8b('0x20')],_0x0d8b('0x21'));if(!_0x3c8887['isValid']()){return _0x27b695(handleCheckRowError('error','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x30980c));}}if(_0x3ef745[_0x0d8b('0x22')]){if(!isEmail(_0x3ef745['email'])){return _0x27b695(handleCheckRowError(_0x0d8b('0x18'),'email\x20format\x20is\x20not\x20valid!',null,_0x30980c));}}_0x3ef745['ListId']=LISTID;_0x3ef745[_0x0d8b('0x23')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x0d8b('0x24')]&&_0x2c64e2){var _0x109c14={};for(var _0xdeee5d=0x0,_0x183220=DUPLICATES[_0x0d8b('0x24')];_0xdeee5d<_0x183220;_0xdeee5d+=0x1){_0x109c14[DUPLICATES[_0xdeee5d]]=_0x3ef745[DUPLICATES[_0xdeee5d]];}var _0x4a99d3=_[_0x0d8b('0x25')](_0x2c64e2,_0x109c14);if(_0x4a99d3){return _0x27b695(handleCheckRowError('duplicate',_0x0d8b('0x26'),_0x4a99d3,_0x30980c));}}return db[_0x0d8b('0x27')]['create'](_0x3ef745,{'raw':!![],'hooks':![],'fields':_[_0x0d8b('0x28')](_0x3ef745)})[_0x0d8b('0x29')](function(_0x18a905){if(DUPLICATES&&DUPLICATES['length']&&_0x2c64e2){_0x2c64e2[_0x0d8b('0x2a')](_[_0x0d8b('0x2b')](_0x3ef745,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x18a905['id'];return _0x4562cb();})[_0x0d8b('0x2c')](function(_0x31ceba){return _0x27b695(handleCheckRowError(_0x0d8b('0x18'),'Error\x20while\x20creating\x20contact:\x20'+(_0x31ceba[_0x0d8b('0x2d')]||JSON[_0x0d8b('0x2e')](_0x31ceba)),null,_0x30980c));});});}function checkHopper(){function _0x5ad0fe(){return function(_0x1180ac){logger[_0x0d8b('0x18')](_0x0d8b('0x2f'),_0x0d8b('0x30'),util[_0x0d8b('0x31')](_0x1180ac,{'showHidden':![],'depth':null}));};}var _0x519088=function(_0x497a71,_0x41b4f9){var _0x5c2c04=squel['insert']()[_0x0d8b('0x32')](_0x0d8b('0x33'))[_0x0d8b('0x34')]([_0x0d8b('0x1e'),_0x0d8b('0x35'),_0x0d8b('0x36'),'ListId',_0x41b4f9,_0x0d8b('0x37'),_0x0d8b('0x38')],squel[_0x0d8b('0x39')]()[_0x0d8b('0x3a')](_0x0d8b('0x1e'),_0x0d8b('0x1e'))[_0x0d8b('0x3a')]('NOW()',_0x0d8b('0x35'))[_0x0d8b('0x3a')]('id',_0x0d8b('0x36'))[_0x0d8b('0x3a')](LISTID['toString'](),_0x0d8b('0x3b'))['field'](_0x497a71['id'][_0x0d8b('0x3c')](),_0x41b4f9)[_0x0d8b('0x3a')](_0x0d8b('0x3d'),_0x0d8b('0x37'))[_0x0d8b('0x3a')](_0x0d8b('0x3d'),_0x0d8b('0x38'))[_0x0d8b('0x3e')](_0x0d8b('0x3f'))[_0x0d8b('0x40')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',LISTID['toString']())['where'](_0x0d8b('0x41'))[_0x0d8b('0x40')](_0x0d8b('0x42'),squel['select']()['field'](_0x0d8b('0x1e'))[_0x0d8b('0x3e')](_0x0d8b('0x33'))['where'](_0x41b4f9+_0x0d8b('0x43'),_0x497a71['id'][_0x0d8b('0x3c')]())))['toString']();return _0x5c2c04;};var _0x4d7bb0=function(_0x372740,_0x495870){var _0x1e22e5=squel['insert']()['into'](_0x0d8b('0x33'))[_0x0d8b('0x34')](['phone','scheduledAt','ContactId','ListId',_0x495870,_0x0d8b('0x37'),_0x0d8b('0x38')],squel[_0x0d8b('0x39')]()['field'](_0x0d8b('0x1e'),_0x0d8b('0x1e'))[_0x0d8b('0x3a')](_0x0d8b('0x3d'),_0x0d8b('0x35'))[_0x0d8b('0x3a')]('id',_0x0d8b('0x36'))[_0x0d8b('0x3a')](LISTID[_0x0d8b('0x3c')](),_0x0d8b('0x3b'))[_0x0d8b('0x3a')](_0x372740['id'][_0x0d8b('0x3c')](),_0x495870)[_0x0d8b('0x3a')](_0x0d8b('0x3d'),_0x0d8b('0x37'))[_0x0d8b('0x3a')](_0x0d8b('0x3d'),_0x0d8b('0x38'))[_0x0d8b('0x3e')]('cm_contacts')[_0x0d8b('0x40')]('deletedAt\x20IS\x20NULL')['where'](_0x0d8b('0x44'),LISTID[_0x0d8b('0x3c')]())[_0x0d8b('0x40')](_0x0d8b('0x45'),squel['str'](hopperContacts))[_0x0d8b('0x40')](_0x0d8b('0x41'))[_0x0d8b('0x40')](_0x0d8b('0x42'),squel[_0x0d8b('0x39')]()['field']('calleridnum')['from']('cm_hopper_final')[_0x0d8b('0x40')](_0x495870+_0x0d8b('0x43'),_0x372740['id']['toString']()))['where'](_0x0d8b('0x42'),squel[_0x0d8b('0x39')]()['field']('phone')[_0x0d8b('0x3e')](_0x0d8b('0x33'))[_0x0d8b('0x40')](_0x495870+_0x0d8b('0x43'),_0x372740['id'][_0x0d8b('0x3c')]())))['toString']();return _0x1e22e5;};function _0x2de903(_0x2afe34,_0x5481fc){var _0x580580=squel[_0x0d8b('0x46')]()[_0x0d8b('0x32')]('cm_hopper')['fromQuery']([_0x0d8b('0x1e'),_0x0d8b('0x35'),_0x0d8b('0x36'),_0x0d8b('0x3b'),_0x5481fc,'createdAt',_0x0d8b('0x38')],squel['select']()['field'](_0x0d8b('0x1e'),_0x0d8b('0x1e'))['field']('NOW()',_0x0d8b('0x35'))[_0x0d8b('0x3a')]('id',_0x0d8b('0x36'))[_0x0d8b('0x3a')](LISTID[_0x0d8b('0x3c')](),_0x0d8b('0x3b'))[_0x0d8b('0x3a')](_0x2afe34['id'][_0x0d8b('0x3c')](),_0x5481fc)['field'](_0x0d8b('0x3d'),_0x0d8b('0x37'))[_0x0d8b('0x3a')](_0x0d8b('0x3d'),_0x0d8b('0x38'))[_0x0d8b('0x3e')](_0x0d8b('0x3f'))[_0x0d8b('0x40')](_0x0d8b('0x47'))['where'](_0x0d8b('0x44'),LISTID[_0x0d8b('0x3c')]())[_0x0d8b('0x40')](_0x0d8b('0x45'),squel[_0x0d8b('0x48')](hopperContacts))['where'](_0x0d8b('0x41')))[_0x0d8b('0x3c')]();return _0x580580;}function _0x181d49(_0x17a87f,_0x1d6cd4){var _0x59ada2=squel['insert']()[_0x0d8b('0x32')](_0x0d8b('0x49'))[_0x0d8b('0x34')]([_0x0d8b('0x1e'),'ContactId',_0x0d8b('0x3b'),_0x1d6cd4,_0x0d8b('0x37'),_0x0d8b('0x38')],squel['select']()[_0x0d8b('0x3a')]('phone',_0x0d8b('0x1e'))[_0x0d8b('0x3a')]('id',_0x0d8b('0x36'))[_0x0d8b('0x3a')](LISTID[_0x0d8b('0x3c')](),_0x0d8b('0x3b'))['field'](_0x17a87f['id'][_0x0d8b('0x3c')](),_0x1d6cd4)['field'](_0x0d8b('0x3d'),_0x0d8b('0x37'))[_0x0d8b('0x3a')](_0x0d8b('0x3d'),'updatedAt')[_0x0d8b('0x3e')](_0x0d8b('0x3f'))[_0x0d8b('0x40')](_0x0d8b('0x47'))[_0x0d8b('0x40')](_0x0d8b('0x44'),LISTID[_0x0d8b('0x3c')]())[_0x0d8b('0x40')](_0x0d8b('0x45'),squel[_0x0d8b('0x48')](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))[_0x0d8b('0x3c')]();return _0x59ada2;}return db[_0x0d8b('0x4a')]['findAll']({'where':{'type':_0x0d8b('0x4b')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db['CmList'],'as':_0x0d8b('0x4c'),'where':{'id':LISTID}}]})[_0x0d8b('0x29')](function(_0x4f4b4d){var _0x587128=[];if(_0x4f4b4d){var _0x1900e3;for(var _0x1c007b=0x0,_0x70e4b2;_0x1c007b<_0x4f4b4d[_0x0d8b('0x24')];_0x1c007b+=0x1){_0x70e4b2=_0x4f4b4d[_0x1c007b][_0x0d8b('0x4d')]({'plain':!![]});switch(_0x70e4b2[_0x0d8b('0x4e')]){case _0x0d8b('0x4f'):_0x587128['push'](db[_0x0d8b('0x50')]['query'](_0x4d7bb0(_0x70e4b2,_0x0d8b('0x51')))[_0x0d8b('0x29')](function(){})[_0x0d8b('0x2c')](_0x5ad0fe()));break;case _0x0d8b('0x52'):_0x587128['push'](db[_0x0d8b('0x50')]['query'](_0x519088(_0x70e4b2,_0x0d8b('0x51')))[_0x0d8b('0x29')](function(){})[_0x0d8b('0x2c')](_0x5ad0fe()));break;default:_0x587128[_0x0d8b('0x2a')](db[_0x0d8b('0x50')][_0x0d8b('0x53')](_0x2de903(_0x70e4b2,_0x0d8b('0x51')))[_0x0d8b('0x29')](function(){})[_0x0d8b('0x2c')](_0x5ad0fe()));}}}return _0x587128;})[_0x0d8b('0x54')]()['then'](function(){return db[_0x0d8b('0x4a')]['findAll']({'where':{'type':_0x0d8b('0x4b')},'attributes':['id'],'include':[{'model':db[_0x0d8b('0x55')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x0d8b('0x29')](function(_0x56e03c){var _0x10c318=[];if(_0x56e03c){var _0x445a00;for(var _0x24f75=0x0,_0x259ac9;_0x24f75<_0x56e03c[_0x0d8b('0x24')];_0x24f75+=0x1){_0x259ac9=_0x56e03c[_0x24f75][_0x0d8b('0x4d')]({'plain':!![]});_0x10c318[_0x0d8b('0x2a')](db[_0x0d8b('0x50')]['query'](_0x181d49(_0x259ac9,_0x0d8b('0x51')))[_0x0d8b('0x29')](function(){})['catch'](_0x5ad0fe()));}}return _0x10c318;})[_0x0d8b('0x54')]();})[_0x0d8b('0x29')](function(){return db[_0x0d8b('0x56')][_0x0d8b('0x57')]({'attributes':['id',_0x0d8b('0x4e')],'include':[{'model':db[_0x0d8b('0x55')],'as':_0x0d8b('0x4c'),'where':{'id':LISTID}}]})[_0x0d8b('0x29')](function(_0x466082){var _0x5007c0=[];if(_0x466082){for(var _0xe35028=0x0,_0x16df83;_0xe35028<_0x466082['length'];_0xe35028+=0x1){_0x16df83=_0x466082[_0xe35028][_0x0d8b('0x4d')]({'plain':!![]});switch(_0x16df83[_0x0d8b('0x4e')]){case _0x0d8b('0x4f'):_0x5007c0['push'](db['sequelize'][_0x0d8b('0x53')](_0x4d7bb0(_0x16df83,_0x0d8b('0x58')))[_0x0d8b('0x29')](function(){})['catch'](_0x5ad0fe()));break;case'onlyIfOpen':_0x5007c0[_0x0d8b('0x2a')](db[_0x0d8b('0x50')][_0x0d8b('0x53')](_0x519088(_0x16df83,_0x0d8b('0x58')))[_0x0d8b('0x29')](function(){})[_0x0d8b('0x2c')](_0x5ad0fe()));break;default:_0x5007c0[_0x0d8b('0x2a')](db[_0x0d8b('0x50')][_0x0d8b('0x53')](_0x2de903(_0x16df83,_0x0d8b('0x58')))[_0x0d8b('0x29')](function(){})[_0x0d8b('0x2c')](_0x5ad0fe()));}}}return _0x5007c0;})[_0x0d8b('0x54')]();})['then'](function(){return db[_0x0d8b('0x56')][_0x0d8b('0x57')]({'attributes':['id'],'include':[{'model':db['CmList'],'as':'BlackLists','where':{'id':LISTID}}]})[_0x0d8b('0x29')](function(_0x1dad9f){var _0x3573b4=[];if(_0x1dad9f){for(var _0x14b1b8=0x0,_0x23e2e0;_0x14b1b8<_0x1dad9f[_0x0d8b('0x24')];_0x14b1b8+=0x1){_0x23e2e0=_0x1dad9f[_0x14b1b8]['get']({'plain':!![]});_0x3573b4['push'](db['sequelize'][_0x0d8b('0x53')](_0x181d49(_0x23e2e0,_0x0d8b('0x58')))[_0x0d8b('0x29')](function(){})[_0x0d8b('0x2c')](_0x5ad0fe()));}}return _0x3573b4;})[_0x0d8b('0x54')]();})[_0x0d8b('0x2c')](function(_0x5ef461){logger[_0x0d8b('0x18')](_0x0d8b('0x59'),'generalCheckHopper',_0x5ef461[_0x0d8b('0x2d')]);});}var processPromises=function(_0x57e3c2){return BPromise[_0x0d8b('0x54')](promises)[_0x0d8b('0x29')](function(_0x9dfa5a){})[_0x0d8b('0x2c')](function(_0x10c7ab){logger[_0x0d8b('0x18')](_0x0d8b('0x5a'),JSON[_0x0d8b('0x2e')](_0x10c7ab));})[_0x0d8b('0x5b')](function(){socket[_0x0d8b('0x5c')](_0x0d8b('0x5d')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x57e3c2){return _0x57e3c2[_0x0d8b('0x5e')]();}});};var endCsv=function(){return BPromise['resolve']()['then'](function(){if(hopperContacts){return checkHopper();}})[_0x0d8b('0x29')](function(){socket[_0x0d8b('0x5c')](_0x0d8b('0x5d')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x0d8b('0x5f')](FILEPATH);}catch(_0xf91ecd){logger[_0x0d8b('0x18')](_0x0d8b('0x60'),JSON['stringify'](_0xf91ecd));}finally{process[_0x0d8b('0x61')](0x0);}});};process['on']('SIGINT',function(){logger[_0x0d8b('0x62')]('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise['resolve']()[_0x0d8b('0x29')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x0d8b('0x12')](',');return db[_0x0d8b('0x27')][_0x0d8b('0x57')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x0d8b('0x29')](function(_0x2eece2){var _0x3c7b9b=fs[_0x0d8b('0x63')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x0d8b('0x64')](_0x3c7b9b,{'header':!![],'skipEmptyLines':!![],'step':function(_0x20a8b6,_0x3a6014){total+=0x1;var _0x180539=total;promises['push'](checkRow(_0x20a8b6,_0x2eece2,_0x180539)[_0x0d8b('0x29')](function(){success+=0x1;})[_0x0d8b('0x2c')](function(_0x8be77c){if(_0x8be77c['error']){errors+=0x1;delete _0x8be77c['error'];}else if(_0x8be77c[_0x0d8b('0x65')]){duplicates+=0x1;delete _0x8be77c[_0x0d8b('0x65')];}rows[_0x0d8b('0x2a')](_0x8be77c);}));if(total%0xc8===0x0){_0x3a6014[_0x0d8b('0x66')]();return processPromises(_0x3a6014);}},'complete':function(){return processPromises()[_0x0d8b('0x29')](function(){logger[_0x0d8b('0x62')]('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x1a96ce,_0x3d6267){logger[_0x0d8b('0x62')](_0x0d8b('0x67'),JSON[_0x0d8b('0x2e')](_0x1a96ce));endCsv();}});})['catch'](function(_0x4dbcfc){logger[_0x0d8b('0x18')](_0x0d8b('0x68'),JSON[_0x0d8b('0x2e')](_0x4dbcfc));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 6a10c8d..2b9adee 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 _0xce79=['campaigns_has_cm_lists','campaigns','CampaignId','campaigns_has_cm_blacklists','each','then','finish','affectedRows','unlink','complete','argv','arguments\x20\x20\x20','root','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','SIGINT','uncaughtException','path','papaparse','moment','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','select','field','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','insert','into','cm_hopper','fromQuery','phone','ContactId','ListId','updatedAt','priority','recallme','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.ListId','cm_hopper_black','createdAt','fields','cm_contacts.ListId\x20=\x20','ListId\x20=\x20?','\x20=\x20?','concat','keys','CompanyId','cm_contacts','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','error','message','exit','errors','push','code','spread','catch','main','send','start','binding','server/files/tmp','.csv','header','writeFileSync','parse','createReadStream','data','trim','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','UserId','isNumber','agent\x20not\x20exists','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','\x20not\x20specified','length','appendFileSync','rows','emit','Abort\x20parser','SystemError','duplicates','\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','scheduledat',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues','VoiceQueueId'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0xce79,0x9c));var _0x9ce7=function(_0x2cde0a,_0x1f9695){_0x2cde0a=_0x2cde0a-0x0;var _0x260610=_0xce79[_0x2cde0a];return _0x260610;};'use strict';var fs=require('fs');var path=require(_0x9ce7('0x0'));var _=require('lodash');var Papa=require(_0x9ce7('0x1'));var util=require('util');var BPromise=require('bluebird');var moment=require(_0x9ce7('0x2'));var squel=require('squel');var Redis=require(_0x9ce7('0x3'));var db=require(_0x9ce7('0x4'))['db'];var config=require(_0x9ce7('0x5'));var logger=require(_0x9ce7('0x6'))(_0x9ce7('0x7'));config[_0x9ce7('0x8')]=_[_0x9ce7('0x9')](config['redis'],{'host':_0x9ce7('0xa'),'port':0x18eb});var socket=require(_0x9ce7('0xb'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x9ce7('0xc')](_0x9ce7('0xd'));function isEmail(_0x35d0ee){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'](_0x35d0ee);}function selectNotIn(_0x19cb61,_0x6aa200,_0x3742b1,_0x2e3cb2,_0x3751e4){return squel[_0x9ce7('0xe')]()[_0x9ce7('0xf')]('phone')[_0x9ce7('0x10')](_0x2e3cb2)[_0x9ce7('0x11')](_0x6aa200,null,_0x6aa200+_0x9ce7('0x12')+_0x2e3cb2+'.'+_0x3742b1)[_0x9ce7('0x13')](_0x2e3cb2+'.'+_0x3742b1+_0x9ce7('0x14')+_0x19cb61+'.'+_0x3742b1)['where'](_0x6aa200+_0x9ce7('0x15')+_0x3751e4['join']()+')');}function insertCmHopper(_0x556a1a,_0x26d1f9,_0x3b9e42,_0x11dbcd,_0x3fd287){var _0x4516b4=[_0x9ce7('0x16'),_0x9ce7('0x17'),_0x9ce7('0x18'),'cm_contacts.ListId',_0x26d1f9+'.'+_0x11dbcd,_0x9ce7('0x19'),_0x9ce7('0x1a'),_0x9ce7('0x1b'),'cm_contacts.UserId','\x22'+_0x3fd287+'\x22'];return squel[_0x9ce7('0x1c')]()[_0x9ce7('0x1d')](_0x9ce7('0x1e'))[_0x9ce7('0x1f')]([_0x9ce7('0x20'),'scheduledat',_0x9ce7('0x21'),_0x9ce7('0x22'),_0x11dbcd,'createdAt',_0x9ce7('0x23'),_0x9ce7('0x24'),'UserId',_0x9ce7('0x25')],squel[_0x9ce7('0xe')]()['fields'](_0x4516b4)[_0x9ce7('0x10')](_0x26d1f9)[_0x9ce7('0x11')]('cm_contacts',null,'cm_contacts.ListId\x20=\x20'+_0x26d1f9+_0x9ce7('0x26'))[_0x9ce7('0x11')](_0x3b9e42,null,_0x3b9e42+'.id\x20=\x20'+_0x26d1f9+'.'+_0x11dbcd)[_0x9ce7('0x13')](_0x26d1f9+_0x9ce7('0x27'),_0x556a1a)['where'](_0x9ce7('0x28'),NOW)['where'](_0x9ce7('0x29'),selectNotIn(_0x26d1f9,_0x3b9e42,_0x11dbcd,_0x9ce7('0x1e'),[_0x9ce7('0x2a'),_0x9ce7('0x2b')]))['where'](_0x9ce7('0x29'),selectNotIn(_0x26d1f9,_0x3b9e42,_0x11dbcd,'cm_hopper',[_0x9ce7('0x2a')])))[_0x9ce7('0x2c')]();}function insertCmHopperBlack(_0x22c2c7,_0x4024ab,_0x50e784,_0x5b0ef3){var _0x931bca=['cm_contacts.phone',_0x9ce7('0x18'),_0x9ce7('0x2d'),_0x4024ab+'.'+_0x5b0ef3,_0x9ce7('0x19'),_0x9ce7('0x1a')];return squel[_0x9ce7('0x1c')]()['into'](_0x9ce7('0x2e'))[_0x9ce7('0x1f')]([_0x9ce7('0x20'),_0x9ce7('0x21'),_0x9ce7('0x22'),_0x5b0ef3,_0x9ce7('0x2f'),_0x9ce7('0x23')],squel['select']()[_0x9ce7('0x30')](_0x931bca)[_0x9ce7('0x10')](_0x4024ab)[_0x9ce7('0x11')]('cm_contacts',null,_0x9ce7('0x31')+_0x4024ab+_0x9ce7('0x26'))[_0x9ce7('0x11')](_0x50e784,null,_0x50e784+_0x9ce7('0x12')+_0x4024ab+'.'+_0x5b0ef3)['where'](_0x4024ab+_0x9ce7('0x27'),_0x22c2c7)[_0x9ce7('0x13')](_0x9ce7('0x28'),NOW)[_0x9ce7('0x13')](_0x9ce7('0x29'),squel['select']()[_0x9ce7('0xf')](_0x9ce7('0x20'))[_0x9ce7('0x10')](_0x9ce7('0x2e'))['where'](_0x9ce7('0x32'),_0x22c2c7)[_0x9ce7('0x13')](_0x5b0ef3+_0x9ce7('0x33'),_0x4024ab+'.'+_0x5b0ef3)))['toString']();}function insertCmContact(_0x2e9d31,_0x3d40db,_0x43c1ef,_0x13d959){var _0x12a9cf=_[_0x9ce7('0x34')](_[_0x9ce7('0x35')](_0x13d959),[_0x9ce7('0x22'),_0x9ce7('0x36'),_0x9ce7('0x2f'),_0x9ce7('0x23')]);return squel['insert']()[_0x9ce7('0x1d')](_0x9ce7('0x37'))[_0x9ce7('0x1f')](_0x12a9cf,squel['select']()['fields'](_0x12a9cf)[_0x9ce7('0x10')](_0x3d40db)[_0x9ce7('0x13')]('('+_0x43c1ef[_0x9ce7('0x11')](',')+')\x20NOT\x20IN\x20?',squel[_0x9ce7('0xe')]()[_0x9ce7('0x30')](_0x43c1ef)[_0x9ce7('0x10')](_0x9ce7('0x37'))[_0x9ce7('0x13')](_0x9ce7('0x32'),_0x2e9d31))['where'](_0x9ce7('0x38'),squel[_0x9ce7('0xe')]()[_0x9ce7('0xf')](_0x9ce7('0x39'),_0x9ce7('0x3a'))[_0x9ce7('0x10')](_0x3d40db)[_0x9ce7('0x3b')](_0x43c1ef['join'](','))))[_0x9ce7('0x2c')]();}function handleStop(){logger[_0x9ce7('0x3c')](_0x9ce7('0x3d'));stopped=!![];}function handleUncaughtException(_0x544601){logger[_0x9ce7('0x3e')](_0x544601[_0x9ce7('0x3f')]);process[_0x9ce7('0x40')](0x1);}function handleError(_0x4829eb,_0x12df1b){stats[_0x9ce7('0x41')][_0x9ce7('0x42')]({'name':_0x12df1b[_0x9ce7('0x43')],'message':_0x12df1b[_0x9ce7('0x3f')],'row':_0x4829eb});}function handleQuery(_0x55ffa9){logger[_0x9ce7('0x3c')](_0x55ffa9);return db['sequelize']['query'](_0x55ffa9)[_0x9ce7('0x44')](function(_0x1dba14){results['push'](_0x1dba14);})[_0x9ce7('0x45')](function(_0x20f2cd){logger[_0x9ce7('0x3e')](_0x20f2cd[_0x9ce7('0x3f')]);});}function main(_0x3f9cea,_0x32f3b3,_0x482c2b,_0x1dee4b){logger[_0x9ce7('0x3c')](_0x9ce7('0x46'),_0x3f9cea,JSON['stringify'](_0x32f3b3));process[_0x9ce7('0x47')](_0x9ce7('0x48'));var _0x1adecc=_0x32f3b3[_0x9ce7('0x49')];var _0x13649d=_0x32f3b3['socket_timestamp'];var _0x651049=path[_0x9ce7('0x11')](config['root'],_0x9ce7('0x4a'),_0x13649d+_0x9ce7('0x4b'));var _0x2e8555=_[_0x9ce7('0x35')](_0x1adecc)[_0x9ce7('0x11')]();logger[_0x9ce7('0x3c')](_0x9ce7('0x4c'),_0x2e8555);fs[_0x9ce7('0x4d')](_0x651049,_0x2e8555+'\x0a');Papa[_0x9ce7('0x4e')](fs[_0x9ce7('0x4f')](_0x3f9cea),{'header':!![],'skipEmptyLines':!![],'step':function(_0x4b9a3e,_0x2282ea){try{for(var _0x3d53a8=0x0,_0x25f374=[];_0x3d53a8<_0x4b9a3e[_0x9ce7('0x50')]['length'];_0x3d53a8++){stats['rows']+=0x1;if(_0x4b9a3e[_0x9ce7('0x41')][_0x3d53a8]){handleError(_0x4b9a3e[_0x9ce7('0x50')][_0x3d53a8],_0x4b9a3e[_0x9ce7('0x41')][_0x3d53a8]);}else{var _0xad1ed8=[];for(var _0x1302ed in _0x1adecc){if(_0x1adecc['hasOwnProperty'](_0x1302ed)){if(_0x4b9a3e[_0x9ce7('0x50')][_0x3d53a8][_0x1adecc[_0x1302ed]]){var _0x43043e=_[_0x9ce7('0x51')](_0x4b9a3e[_0x9ce7('0x50')][_0x3d53a8][_0x1adecc[_0x1302ed]]['replace'](/"/g,'\x27'));switch(_0x1302ed){case'scheduledat':var _0x2ae164=moment(_0x43043e,_0x9ce7('0xd'),!![]);if(_0x2ae164[_0x9ce7('0x52')]()){_0x25f374[_0x9ce7('0x42')]('\x22'+_0x43043e+'\x22');}else{_0xad1ed8[_0x9ce7('0x42')](_0x9ce7('0x53'));}break;case _0x9ce7('0x24'):var _0x1e665c=parseInt(_0x43043e);_0x43043e=_[_0x9ce7('0x54')](_0x1e665c)||_0x1e665c<0x0||_0x1e665c>0x4?_0x1dee4b?0x3:0x2:_0x1e665c;_0x25f374[_0x9ce7('0x42')]('\x22'+_0x43043e+'\x22');break;case _0x9ce7('0x55'):var _0x481052=parseInt(_0x43043e);if(_[_0x9ce7('0x56')](_0x481052)&&_['includes'](_0x482c2b,_0x481052)){_0x25f374[_0x9ce7('0x42')]('\x22'+_0x481052+'\x22');}else{_0xad1ed8[_0x9ce7('0x42')](_0x9ce7('0x57'));}break;case'email':if(isEmail(_0x43043e)){_0x25f374['push']('\x22'+_0x43043e+'\x22');}else{_0xad1ed8[_0x9ce7('0x42')]('email\x20wrong\x20format');}break;case _0x9ce7('0x58'):var _0x1465d9=moment(_0x43043e,_0x9ce7('0x59'),!![]);if(_0x1465d9[_0x9ce7('0x52')]()){_0x25f374[_0x9ce7('0x42')]('\x22'+_0x43043e+'\x22');}else{_0xad1ed8[_0x9ce7('0x42')](_0x9ce7('0x5a'));}break;default:_0x25f374[_0x9ce7('0x42')]('\x22'+_0x43043e+'\x22');}}else{switch(_0x1302ed){case'firstName':case _0x9ce7('0x20'):_0xad1ed8[_0x9ce7('0x42')](_0x1302ed+_0x9ce7('0x5b'));break;default:_0x25f374[_0x9ce7('0x42')]('\x22\x22');}}}}if(_0xad1ed8[_0x9ce7('0x5c')]){handleError(_0x4b9a3e[_0x9ce7('0x50')][_0x3d53a8],{'code':'SystemRow','message':_0xad1ed8[_0x9ce7('0x11')]()});}else{fs[_0x9ce7('0x5d')](_0x651049,_0x25f374[_0x9ce7('0x11')]()+'\x0a');}_0x25f374=[];}if(!(stats[_0x9ce7('0x5e')]%0xc8)){socket[_0x9ce7('0x5f')]('contact:import:'+_0x13649d,stats);stats[_0x9ce7('0x41')]=[];}}if(stopped){logger[_0x9ce7('0x3c')](_0x9ce7('0x60'));_0x2282ea['abort']();}}catch(_0x24207d){handleError(_0x4b9a3e['data'][_0x3d53a8],{'code':_0x9ce7('0x61'),'message':_0x24207d[_0x9ce7('0x3f')]});logger[_0x9ce7('0x3e')]('step',_0x24207d[_0x9ce7('0x3f')]);}},'complete':function(){try{var _0x57912e=[];var _0x41f8b6='cm_contacts';if(_0x32f3b3[_0x9ce7('0x62')]&&_0x32f3b3['duplicates'][_0x9ce7('0x5c')]){_0x41f8b6='cm_contacts_'+_0x13649d;_0x57912e[_0x9ce7('0x42')]('CREATE\x20TABLE\x20'+_0x41f8b6+_0x9ce7('0x63'));}var _0x3297b4=util['format'](_0x9ce7('0x64'),_0x651049,_0x41f8b6,_0x2e8555,_0x32f3b3[_0x9ce7('0x22')],_0x32f3b3['CompanyId']||null,NOW,NOW);if(_[_0x9ce7('0x65')](_0x1adecc[_0x9ce7('0x66')])){_0x3297b4+=_0x9ce7('0x67');}_0x57912e[_0x9ce7('0x42')](_0x3297b4);if(_0x32f3b3['duplicates']&&_0x32f3b3[_0x9ce7('0x62')][_0x9ce7('0x5c')]){_0x57912e[_0x9ce7('0x42')](insertCmContact(_0x32f3b3[_0x9ce7('0x22')],_0x41f8b6,_0x32f3b3[_0x9ce7('0x62')],_0x1adecc));_0x57912e[_0x9ce7('0x42')](_0x9ce7('0x68')+_0x41f8b6+';');}_0x57912e[_0x9ce7('0x42')](insertCmHopper(_0x32f3b3['ListId'],_0x9ce7('0x69'),_0x9ce7('0x6a'),_0x9ce7('0x6b'),_0x1dee4b));_0x57912e['push'](insertCmHopperBlack(_0x32f3b3[_0x9ce7('0x22')],'voice_queues_has_cm_blacklists',_0x9ce7('0x6a'),_0x9ce7('0x6b')));_0x57912e['push'](insertCmHopper(_0x32f3b3['ListId'],_0x9ce7('0x6c'),_0x9ce7('0x6d'),_0x9ce7('0x6e'),_0x1dee4b));_0x57912e[_0x9ce7('0x42')](insertCmHopperBlack(_0x32f3b3[_0x9ce7('0x22')],_0x9ce7('0x6f'),_0x9ce7('0x6d'),'CampaignId'));BPromise[_0x9ce7('0x70')](_0x57912e,handleQuery)[_0x9ce7('0x71')](function(_0x1366fd){stats[_0x9ce7('0x72')]=!![];stats[_0x9ce7('0x73')]=_0x32f3b3[_0x9ce7('0x62')]&&_0x32f3b3[_0x9ce7('0x62')]['length']?results[0x2][_0x9ce7('0x73')]:results[0x0][_0x9ce7('0x73')];socket[_0x9ce7('0x5f')]('contact:import:'+_0x13649d,stats);fs[_0x9ce7('0x74')](_0x3f9cea);fs[_0x9ce7('0x74')](_0x651049);process[_0x9ce7('0x40')](0x0);})[_0x9ce7('0x45')](function(_0x455458){logger[_0x9ce7('0x3e')](_0x455458[_0x9ce7('0x3f')]);process['exit'](0x1);});}catch(_0x12a4ec){logger['error'](_0x9ce7('0x75'),_0x12a4ec[_0x9ce7('0x3f')]);process['exit'](0x1);}},'error':function(_0x385ed1,_0x4b2e5a,_0x3adeac,_0x48e968){throw new Error(_0x48e968);}});}function validate(){if(process['argv']&&process[_0x9ce7('0x76')][_0x9ce7('0x5c')]<0x4){throw new Error(_0x9ce7('0x77'));}var _0x6c4346=path[_0x9ce7('0x11')](config[_0x9ce7('0x78')],_0x9ce7('0x4a'),process['argv'][0x2]);if(!fs[_0x9ce7('0x79')](_0x6c4346)){throw new Error(_0x9ce7('0x7a'));}var _0x4f0b02={};try{_0x4f0b02=JSON['parse'](process['argv'][0x3]);if(!_0x4f0b02[_0x9ce7('0x49')]){throw new Error(_0x9ce7('0x7b'));}if(!_0x4f0b02[_0x9ce7('0x49')]['phone']){throw new Error(_0x9ce7('0x7c'));}if(!_0x4f0b02['binding'][_0x9ce7('0x7d')]){throw new Error(_0x9ce7('0x7e'));}var _0x3aae2a=0x0;if(_0x4f0b02['binding']['UserId']){_0x3aae2a=0x1;}if(!_0x4f0b02[_0x9ce7('0x22')]){throw new Error(_0x9ce7('0x7f'));}}catch(_0x5239a3){throw new Error(_0x9ce7('0x80'));}var _0x5a7a00=[];try{_0x5a7a00=_[_0x9ce7('0x81')](JSON[_0x9ce7('0x4e')](process[_0x9ce7('0x76')][0x4]),'id');}catch(_0xb3484f){logger[_0x9ce7('0x3c')]('No\x20agent\x20available');}main(_0x6c4346,_0x4f0b02,_0x5a7a00,_0x3aae2a);}validate();process['on'](_0x9ce7('0x82'),handleStop);process['on'](_0x9ce7('0x83'),handleUncaughtException); \ No newline at end of file +var _0x7c52=['select','field','from','join','.id\x20=\x20','\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','phone','scheduledat','ContactId','ListId','createdAt','priority','UserId','recallme','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','toString','cm_contacts.updatedAt','fields','cm_hopper_black','\x20=\x20?','keys','updatedAt','ListId\x20=\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','message','exit','errors','query','spread','push','main','send','start','root','.csv','header','writeFileSync','data','length','rows','hasOwnProperty','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','includes','email','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','\x20not\x20specified','SystemRow','appendFileSync','emit','Abort\x20parser','abort','SystemError','step','cm_contacts_','CREATE\x20TABLE\x20','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','CompanyId','isNil',',\x20scheduledAt\x20=\x20NOW()','duplicates','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','campaigns','CampaignId','each','then','finish','affectedRows','contact:import:','unlink','error','complete','argv','arguments\x20\x20\x20','server/files/tmp','existsSync','file\x20doesn\x27t\x20exists','parse','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','binding','firstName','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','uncaughtException','path','lodash','bluebird','moment','squel','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test'];(function(_0x399781,_0x32be77){var _0x2642e0=function(_0x38a7ea){while(--_0x38a7ea){_0x399781['push'](_0x399781['shift']());}};_0x2642e0(++_0x32be77);}(_0x7c52,0x76));var _0x27c5=function(_0x4fe93e,_0x12465d){_0x4fe93e=_0x4fe93e-0x0;var _0x4acc86=_0x7c52[_0x4fe93e];return _0x4acc86;};'use strict';var fs=require('fs');var path=require(_0x27c5('0x0'));var _=require(_0x27c5('0x1'));var Papa=require('papaparse');var util=require('util');var BPromise=require(_0x27c5('0x2'));var moment=require(_0x27c5('0x3'));var squel=require(_0x27c5('0x4'));var Redis=require('ioredis');var db=require('../../../mysqldb')['db'];var config=require('../../../config/environment');var logger=require(_0x27c5('0x5'))(_0x27c5('0x6'));config[_0x27c5('0x7')]=_[_0x27c5('0x8')](config['redis'],{'host':_0x27c5('0x9'),'port':0x18eb});var socket=require(_0x27c5('0xa'))(new Redis(config[_0x27c5('0x7')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x27c5('0xb')](_0x27c5('0xc'));function isEmail(_0x10eb2c){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))*$/[_0x27c5('0xd')](_0x10eb2c);}function selectNotIn(_0x1a673d,_0x12d596,_0x143dbb,_0x276171,_0x2ce82e){return squel[_0x27c5('0xe')]()[_0x27c5('0xf')]('phone')[_0x27c5('0x10')](_0x276171)[_0x27c5('0x11')](_0x12d596,null,_0x12d596+_0x27c5('0x12')+_0x276171+'.'+_0x143dbb)['where'](_0x276171+'.'+_0x143dbb+_0x27c5('0x13')+_0x1a673d+'.'+_0x143dbb)[_0x27c5('0x14')](_0x12d596+_0x27c5('0x15')+_0x2ce82e[_0x27c5('0x11')]()+')');}function insertCmHopper(_0x642e70,_0x520eb2,_0x27b3fe,_0x1f5287,_0x2f935c){var _0x42c967=[_0x27c5('0x16'),_0x27c5('0x17'),_0x27c5('0x18'),_0x27c5('0x19'),_0x520eb2+'.'+_0x1f5287,_0x27c5('0x1a'),'cm_contacts.updatedAt',_0x27c5('0x1b'),_0x27c5('0x1c'),'\x22'+_0x2f935c+'\x22'];return squel[_0x27c5('0x1d')]()[_0x27c5('0x1e')](_0x27c5('0x1f'))[_0x27c5('0x20')]([_0x27c5('0x21'),_0x27c5('0x22'),_0x27c5('0x23'),_0x27c5('0x24'),_0x1f5287,_0x27c5('0x25'),'updatedAt',_0x27c5('0x26'),_0x27c5('0x27'),_0x27c5('0x28')],squel[_0x27c5('0xe')]()['fields'](_0x42c967)['from'](_0x520eb2)[_0x27c5('0x11')](_0x27c5('0x29'),null,_0x27c5('0x2a')+_0x520eb2+_0x27c5('0x2b'))[_0x27c5('0x11')](_0x27b3fe,null,_0x27b3fe+_0x27c5('0x12')+_0x520eb2+'.'+_0x1f5287)[_0x27c5('0x14')](_0x520eb2+_0x27c5('0x2c'),_0x642e70)['where'](_0x27c5('0x2d'),NOW)[_0x27c5('0x14')](_0x27c5('0x2e'),selectNotIn(_0x520eb2,_0x27b3fe,_0x1f5287,_0x27c5('0x1f'),[_0x27c5('0x2f'),'\x22onlyIfOpen\x22']))[_0x27c5('0x14')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x520eb2,_0x27b3fe,_0x1f5287,_0x27c5('0x1f'),[_0x27c5('0x2f')])))[_0x27c5('0x30')]();}function insertCmHopperBlack(_0x41beaf,_0x5eb210,_0x17ab4f,_0x53ffa3){var _0x565933=[_0x27c5('0x16'),_0x27c5('0x18'),_0x27c5('0x19'),_0x5eb210+'.'+_0x53ffa3,_0x27c5('0x1a'),_0x27c5('0x31')];return squel[_0x27c5('0x1d')]()['into']('cm_hopper_black')[_0x27c5('0x20')](['phone',_0x27c5('0x23'),_0x27c5('0x24'),_0x53ffa3,_0x27c5('0x25'),'updatedAt'],squel[_0x27c5('0xe')]()[_0x27c5('0x32')](_0x565933)[_0x27c5('0x10')](_0x5eb210)[_0x27c5('0x11')](_0x27c5('0x29'),null,'cm_contacts.ListId\x20=\x20'+_0x5eb210+_0x27c5('0x2b'))[_0x27c5('0x11')](_0x17ab4f,null,_0x17ab4f+_0x27c5('0x12')+_0x5eb210+'.'+_0x53ffa3)[_0x27c5('0x14')](_0x5eb210+'.CmListId\x20=\x20?',_0x41beaf)[_0x27c5('0x14')](_0x27c5('0x2d'),NOW)[_0x27c5('0x14')](_0x27c5('0x2e'),squel['select']()[_0x27c5('0xf')]('phone')['from'](_0x27c5('0x33'))[_0x27c5('0x14')]('ListId\x20=\x20?',_0x41beaf)[_0x27c5('0x14')](_0x53ffa3+_0x27c5('0x34'),_0x5eb210+'.'+_0x53ffa3)))[_0x27c5('0x30')]();}function insertCmContact(_0xc437c2,_0x2e6c83,_0x5c5851,_0x5bce4b){var _0x159617=_['concat'](_[_0x27c5('0x35')](_0x5bce4b),[_0x27c5('0x24'),'CompanyId',_0x27c5('0x25'),_0x27c5('0x36')]);return squel[_0x27c5('0x1d')]()['into'](_0x27c5('0x29'))[_0x27c5('0x20')](_0x159617,squel[_0x27c5('0xe')]()[_0x27c5('0x32')](_0x159617)[_0x27c5('0x10')](_0x2e6c83)['where']('('+_0x5c5851[_0x27c5('0x11')](',')+')\x20NOT\x20IN\x20?',squel[_0x27c5('0xe')]()[_0x27c5('0x32')](_0x5c5851)['from'](_0x27c5('0x29'))[_0x27c5('0x14')](_0x27c5('0x37'),_0xc437c2))['where']('id\x20IN\x20?',squel['select']()['field'](_0x27c5('0x38'),_0x27c5('0x39'))[_0x27c5('0x10')](_0x2e6c83)[_0x27c5('0x3a')](_0x5c5851[_0x27c5('0x11')](','))))[_0x27c5('0x30')]();}function handleStop(){logger[_0x27c5('0x3b')](_0x27c5('0x3c'));stopped=!![];}function handleUncaughtException(_0x13429e){logger['error'](_0x13429e[_0x27c5('0x3d')]);process[_0x27c5('0x3e')](0x1);}function handleError(_0x55c678,_0x5965c6){stats[_0x27c5('0x3f')]['push']({'name':_0x5965c6['code'],'message':_0x5965c6['message'],'row':_0x55c678});}function handleQuery(_0x27a5e8){logger[_0x27c5('0x3b')](_0x27a5e8);return db['sequelize'][_0x27c5('0x40')](_0x27a5e8)[_0x27c5('0x41')](function(_0x1f4a5e){results[_0x27c5('0x42')](_0x1f4a5e);})['catch'](function(_0x77d0e5){logger['error'](_0x77d0e5[_0x27c5('0x3d')]);});}function main(_0x346474,_0x559327,_0xa6d71d,_0x3cd0d0){logger[_0x27c5('0x3b')](_0x27c5('0x43'),_0x346474,JSON['stringify'](_0x559327));process[_0x27c5('0x44')](_0x27c5('0x45'));var _0xde9b73=_0x559327['binding'];var _0x2ac291=_0x559327['socket_timestamp'];var _0x101022=path[_0x27c5('0x11')](config[_0x27c5('0x46')],'server/files/tmp',_0x2ac291+_0x27c5('0x47'));var _0x55e2ab=_[_0x27c5('0x35')](_0xde9b73)[_0x27c5('0x11')]();logger[_0x27c5('0x3b')](_0x27c5('0x48'),_0x55e2ab);fs[_0x27c5('0x49')](_0x101022,_0x55e2ab+'\x0a');Papa['parse'](fs['createReadStream'](_0x346474),{'header':!![],'skipEmptyLines':!![],'step':function(_0x535c38,_0x4ac919){try{for(var _0x30c302=0x0,_0x7b8f8b=[];_0x30c302<_0x535c38[_0x27c5('0x4a')][_0x27c5('0x4b')];_0x30c302++){stats[_0x27c5('0x4c')]+=0x1;if(_0x535c38['errors'][_0x30c302]){handleError(_0x535c38['data'][_0x30c302],_0x535c38['errors'][_0x30c302]);}else{var _0xb344b4=[];for(var _0x18a6ff in _0xde9b73){if(_0xde9b73[_0x27c5('0x4d')](_0x18a6ff)){if(_0x535c38['data'][_0x30c302][_0xde9b73[_0x18a6ff]]){var _0x290a28=_[_0x27c5('0x4e')](_0x535c38[_0x27c5('0x4a')][_0x30c302][_0xde9b73[_0x18a6ff]][_0x27c5('0x4f')](/"/g,'\x27'));switch(_0x18a6ff){case'scheduledat':var _0x4a0ee3=moment(_0x290a28,_0x27c5('0xc'),!![]);if(_0x4a0ee3[_0x27c5('0x50')]()){_0x7b8f8b[_0x27c5('0x42')]('\x22'+_0x290a28+'\x22');}else{_0xb344b4[_0x27c5('0x42')](_0x27c5('0x51'));}break;case'priority':var _0x47a7ba=parseInt(_0x290a28);_0x290a28=_[_0x27c5('0x52')](_0x47a7ba)||_0x47a7ba<0x0||_0x47a7ba>0x4?_0x3cd0d0?0x3:0x2:_0x47a7ba;_0x7b8f8b[_0x27c5('0x42')]('\x22'+_0x290a28+'\x22');break;case'UserId':var _0x2969a8=parseInt(_0x290a28);if(_['isNumber'](_0x2969a8)&&_[_0x27c5('0x53')](_0xa6d71d,_0x2969a8)){_0x7b8f8b[_0x27c5('0x42')]('\x22'+_0x2969a8+'\x22');}else{_0xb344b4['push']('agent\x20not\x20exists');}break;case _0x27c5('0x54'):if(isEmail(_0x290a28)){_0x7b8f8b[_0x27c5('0x42')]('\x22'+_0x290a28+'\x22');}else{_0xb344b4[_0x27c5('0x42')]('email\x20wrong\x20format');}break;case'dateOfBirth':var _0x54b4a1=moment(_0x290a28,_0x27c5('0x55'),!![]);if(_0x54b4a1[_0x27c5('0x50')]()){_0x7b8f8b[_0x27c5('0x42')]('\x22'+_0x290a28+'\x22');}else{_0xb344b4[_0x27c5('0x42')](_0x27c5('0x56'));}break;default:_0x7b8f8b['push']('\x22'+_0x290a28+'\x22');}}else{switch(_0x18a6ff){case'firstName':case _0x27c5('0x21'):_0xb344b4['push'](_0x18a6ff+_0x27c5('0x57'));break;default:_0x7b8f8b[_0x27c5('0x42')]('\x22\x22');}}}}if(_0xb344b4[_0x27c5('0x4b')]){handleError(_0x535c38[_0x27c5('0x4a')][_0x30c302],{'code':_0x27c5('0x58'),'message':_0xb344b4['join']()});}else{fs[_0x27c5('0x59')](_0x101022,_0x7b8f8b['join']()+'\x0a');}_0x7b8f8b=[];}if(!(stats[_0x27c5('0x4c')]%0xc8)){socket[_0x27c5('0x5a')]('contact:import:'+_0x2ac291,stats);stats[_0x27c5('0x3f')]=[];}}if(stopped){logger[_0x27c5('0x3b')](_0x27c5('0x5b'));_0x4ac919[_0x27c5('0x5c')]();}}catch(_0x19f3f5){handleError(_0x535c38[_0x27c5('0x4a')][_0x30c302],{'code':_0x27c5('0x5d'),'message':_0x19f3f5[_0x27c5('0x3d')]});logger['error'](_0x27c5('0x5e'),_0x19f3f5[_0x27c5('0x3d')]);}},'complete':function(){try{var _0x1083e2=[];var _0x189b20=_0x27c5('0x29');if(_0x559327['duplicates']&&_0x559327['duplicates'][_0x27c5('0x4b')]){_0x189b20=_0x27c5('0x5f')+_0x2ac291;_0x1083e2[_0x27c5('0x42')](_0x27c5('0x60')+_0x189b20+'\x20LIKE\x20cm_contacts;');}var _0x32c07c=util[_0x27c5('0xb')](_0x27c5('0x61'),_0x101022,_0x189b20,_0x55e2ab,_0x559327[_0x27c5('0x24')],_0x559327[_0x27c5('0x62')]||null,NOW,NOW);if(_[_0x27c5('0x63')](_0xde9b73[_0x27c5('0x22')])){_0x32c07c+=_0x27c5('0x64');}_0x1083e2['push'](_0x32c07c);if(_0x559327[_0x27c5('0x65')]&&_0x559327[_0x27c5('0x65')][_0x27c5('0x4b')]){_0x1083e2[_0x27c5('0x42')](insertCmContact(_0x559327[_0x27c5('0x24')],_0x189b20,_0x559327[_0x27c5('0x65')],_0xde9b73));_0x1083e2['push'](_0x27c5('0x66')+_0x189b20+';');}_0x1083e2[_0x27c5('0x42')](insertCmHopper(_0x559327['ListId'],_0x27c5('0x67'),_0x27c5('0x68'),_0x27c5('0x69'),_0x3cd0d0));_0x1083e2[_0x27c5('0x42')](insertCmHopperBlack(_0x559327[_0x27c5('0x24')],_0x27c5('0x6a'),'voice_queues',_0x27c5('0x69')));_0x1083e2[_0x27c5('0x42')](insertCmHopper(_0x559327[_0x27c5('0x24')],_0x27c5('0x6b'),_0x27c5('0x6c'),_0x27c5('0x6d'),_0x3cd0d0));_0x1083e2['push'](insertCmHopperBlack(_0x559327[_0x27c5('0x24')],'campaigns_has_cm_blacklists',_0x27c5('0x6c'),'CampaignId'));BPromise[_0x27c5('0x6e')](_0x1083e2,handleQuery)[_0x27c5('0x6f')](function(_0x8500c8){stats[_0x27c5('0x70')]=!![];stats[_0x27c5('0x71')]=_0x559327[_0x27c5('0x65')]&&_0x559327[_0x27c5('0x65')][_0x27c5('0x4b')]?results[0x2][_0x27c5('0x71')]:results[0x0]['affectedRows'];socket[_0x27c5('0x5a')](_0x27c5('0x72')+_0x2ac291,stats);fs[_0x27c5('0x73')](_0x346474);fs[_0x27c5('0x73')](_0x101022);process[_0x27c5('0x3e')](0x0);})['catch'](function(_0x2d187a){logger[_0x27c5('0x74')](_0x2d187a[_0x27c5('0x3d')]);process['exit'](0x1);});}catch(_0x39395b){logger[_0x27c5('0x74')](_0x27c5('0x75'),_0x39395b[_0x27c5('0x3d')]);process['exit'](0x1);}},'error':function(_0x5244ad,_0x1c7902,_0x551f93,_0x402e26){throw new Error(_0x402e26);}});}function validate(){if(process[_0x27c5('0x76')]&&process['argv'][_0x27c5('0x4b')]<0x4){throw new Error(_0x27c5('0x77'));}var _0x544804=path[_0x27c5('0x11')](config['root'],_0x27c5('0x78'),process['argv'][0x2]);if(!fs[_0x27c5('0x79')](_0x544804)){throw new Error(_0x27c5('0x7a'));}var _0x34a57d={};try{_0x34a57d=JSON[_0x27c5('0x7b')](process[_0x27c5('0x76')][0x3]);if(!_0x34a57d['binding']){throw new Error(_0x27c5('0x7c'));}if(!_0x34a57d['binding'][_0x27c5('0x21')]){throw new Error(_0x27c5('0x7d'));}if(!_0x34a57d[_0x27c5('0x7e')][_0x27c5('0x7f')]){throw new Error(_0x27c5('0x80'));}var _0x4af44a=0x0;if(_0x34a57d[_0x27c5('0x7e')]['UserId']){_0x4af44a=0x1;}if(!_0x34a57d['ListId']){throw new Error(_0x27c5('0x81'));}}catch(_0x487eda){throw new Error(_0x27c5('0x82'));}var _0x5f321a=[];try{_0x5f321a=_['map'](JSON[_0x27c5('0x7b')](process[_0x27c5('0x76')][0x4]),'id');}catch(_0x48e835){logger['info']('No\x20agent\x20available');}main(_0x544804,_0x34a57d,_0x5f321a,_0x4af44a);}validate();process['on']('SIGINT',handleStop);process['on'](_0x27c5('0x83'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index 3294122..76137f7 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 _0x34b7=['membername','UniqueId','starttime','answertime','Complete\x20Time','endtime','Duration','duration','Billable\x20Time','billableseconds','string','[xCALLY\x20Ticket]','toLowerCase','voice','push','variable','queue','calleridnum','destcalleridnum','inbound','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','calleridname','Call\x20To','destexten','Queue','uniqueid','Date','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','agentcalledAt','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','Called\x20Number','Member\x20Name'];(function(_0x1ebce2,_0x10e903){var _0x4a330c=function(_0x4fd810){while(--_0x4fd810){_0x1ebce2['push'](_0x1ebce2['shift']());}};_0x4a330c(++_0x10e903);}(_0x34b7,0x196));var _0x734b=function(_0x586319,_0xf3ac9a){_0x586319=_0x586319-0x0;var _0x2127d2=_0x34b7[_0x586319];return _0x2127d2;};'use strict';exports['getSubjects']=function(_0x57123d,_0x43a5f1){var _0x1aedd0=[{'type':_0x734b('0x0'),'content':_0x734b('0x1'),'variableName':null}];switch(_0x57123d[_0x734b('0x2')]()){case _0x734b('0x3'):switch(_0x43a5f1['toLowerCase']()){case'inbound':_0x1aedd0[_0x734b('0x4')]({'type':_0x734b('0x5'),'content':'','variableName':_0x734b('0x6')});_0x1aedd0[_0x734b('0x4')]({'type':_0x734b('0x5'),'content':'','variableName':_0x734b('0x7')});break;case'outbound':_0x1aedd0[_0x734b('0x4')]({'type':_0x734b('0x0'),'content':'Outbound\x20Call','variableName':null});_0x1aedd0['push']({'type':'variable','content':'','variableName':_0x734b('0x8')});break;}}return _0x1aedd0;};exports['getDescriptions']=function(_0x43c5e0,_0x333738){var _0x2860a2=[];switch(_0x43c5e0[_0x734b('0x2')]()){case _0x734b('0x3'):switch(_0x333738[_0x734b('0x2')]()){case _0x734b('0x9'):_0x2860a2=[{'type':_0x734b('0x0'),'content':_0x734b('0xa'),'key':null,'keyType':null,'variableName':null},{'type':_0x734b('0xb'),'content':'','key':_0x734b('0xc'),'keyType':_0x734b('0x5'),'variableName':_0x734b('0x7')},{'type':_0x734b('0xb'),'content':'','key':'Caller\x20Name','keyType':_0x734b('0x5'),'variableName':_0x734b('0xd')},{'type':_0x734b('0xb'),'content':'','key':_0x734b('0xe'),'keyType':_0x734b('0x5'),'variableName':_0x734b('0xf')},{'type':_0x734b('0xb'),'content':'','key':_0x734b('0x10'),'keyType':_0x734b('0x5'),'variableName':_0x734b('0x6')},{'type':_0x734b('0xb'),'content':'','key':'UniqueId','keyType':_0x734b('0x5'),'variableName':_0x734b('0x11')},{'type':_0x734b('0xb'),'content':'','key':_0x734b('0x12'),'keyType':'variable','variableName':'agentcalledAt'},{'type':_0x734b('0x0'),'content':_0x734b('0x13'),'key':null,'keyType':null,'variableName':null},{'type':_0x734b('0xb'),'content':'','key':_0x734b('0x14'),'keyType':_0x734b('0x5'),'variableName':_0x734b('0x15')},{'type':_0x734b('0xb'),'content':'','key':_0x734b('0x16'),'keyType':_0x734b('0x5'),'variableName':_0x734b('0x8')},{'type':_0x734b('0x0'),'content':_0x734b('0x17'),'key':null,'keyType':null,'variableName':null},{'type':_0x734b('0xb'),'content':'','key':_0x734b('0x18'),'keyType':'variable','variableName':_0x734b('0x19')},{'type':_0x734b('0xb'),'content':'','key':'Agent\x20Connect','keyType':_0x734b('0x5'),'variableName':_0x734b('0x1a')},{'type':_0x734b('0xb'),'content':'','key':_0x734b('0x1b'),'keyType':_0x734b('0x5'),'variableName':_0x734b('0x1c')},{'type':_0x734b('0xb'),'content':'','key':_0x734b('0x1d'),'keyType':_0x734b('0x5'),'variableName':_0x734b('0x1e')},{'type':_0x734b('0xb'),'content':'','key':_0x734b('0x1f'),'keyType':_0x734b('0x5'),'variableName':'talktime'}];break;case'outbound':_0x2860a2=[{'type':_0x734b('0x0'),'content':_0x734b('0xa'),'variableName':null},{'type':'keyValue','content':'','key':_0x734b('0x20'),'keyType':_0x734b('0x5'),'keyContent':'','variableName':_0x734b('0x8')},{'type':_0x734b('0xb'),'content':'','key':_0x734b('0x21'),'keyType':_0x734b('0x5'),'keyContent':'','variableName':_0x734b('0x22')},{'type':'keyValue','content':'','key':_0x734b('0x23'),'keyType':_0x734b('0x5'),'keyContent':'','variableName':_0x734b('0x11')},{'type':_0x734b('0xb'),'content':'','key':_0x734b('0x12'),'keyType':_0x734b('0x5'),'keyContent':'','variableName':_0x734b('0x24')},{'type':_0x734b('0x0'),'content':_0x734b('0x17')},{'type':_0x734b('0xb'),'content':'','key':'Answer\x20Time','keyType':_0x734b('0x5'),'keyContent':'','variableName':_0x734b('0x25')},{'type':'keyValue','content':'','key':_0x734b('0x26'),'keyType':_0x734b('0x5'),'keyContent':'','variableName':_0x734b('0x27')},{'type':_0x734b('0xb'),'content':'','key':_0x734b('0x28'),'keyType':_0x734b('0x5'),'keyContent':'','variableName':_0x734b('0x29')},{'type':_0x734b('0xb'),'content':'','key':_0x734b('0x2a'),'keyType':_0x734b('0x5'),'keyContent':'','variableName':_0x734b('0x2b')}];break;}}return _0x2860a2;}; \ No newline at end of file +var _0xa699=['agentconnectAt','Agent\x20Complete','agentcompleteAt','talktime','Called\x20Number','Member\x20Name','membername','starttime','Answer\x20Time','answertime','Complete\x20Time','endtime','Duration','duration','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase','voice','inbound','push','variable','queue','calleridnum','outbound','Outbound\x20Call','destcalleridnum','getDescriptions','***\x20Call\x20Info\x20***','Caller\x20Number','keyValue','Caller\x20Name','calleridname','Call\x20To','destexten','Queue','UniqueId','uniqueid','Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','***\x20Time\x20Info\x20***','Agent\x20Ring'];(function(_0x1962cc,_0x111de1){var _0x204470=function(_0x2fa3da){while(--_0x2fa3da){_0x1962cc['push'](_0x1962cc['shift']());}};_0x204470(++_0x111de1);}(_0xa699,0x6b));var _0x9a69=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa699[_0x2cfb58];return _0xd99951;};'use strict';exports[_0x9a69('0x0')]=function(_0x3ef4b4,_0x331c94){var _0x4157aa=[{'type':_0x9a69('0x1'),'content':_0x9a69('0x2'),'variableName':null}];switch(_0x3ef4b4[_0x9a69('0x3')]()){case _0x9a69('0x4'):switch(_0x331c94[_0x9a69('0x3')]()){case _0x9a69('0x5'):_0x4157aa[_0x9a69('0x6')]({'type':_0x9a69('0x7'),'content':'','variableName':_0x9a69('0x8')});_0x4157aa['push']({'type':_0x9a69('0x7'),'content':'','variableName':_0x9a69('0x9')});break;case _0x9a69('0xa'):_0x4157aa[_0x9a69('0x6')]({'type':'string','content':_0x9a69('0xb'),'variableName':null});_0x4157aa[_0x9a69('0x6')]({'type':_0x9a69('0x7'),'content':'','variableName':_0x9a69('0xc')});break;}}return _0x4157aa;};exports[_0x9a69('0xd')]=function(_0x58b59e,_0x47cc82){var _0x1562e2=[];switch(_0x58b59e['toLowerCase']()){case _0x9a69('0x4'):switch(_0x47cc82[_0x9a69('0x3')]()){case'inbound':_0x1562e2=[{'type':_0x9a69('0x1'),'content':_0x9a69('0xe'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x9a69('0xf'),'keyType':_0x9a69('0x7'),'variableName':_0x9a69('0x9')},{'type':_0x9a69('0x10'),'content':'','key':_0x9a69('0x11'),'keyType':_0x9a69('0x7'),'variableName':_0x9a69('0x12')},{'type':_0x9a69('0x10'),'content':'','key':_0x9a69('0x13'),'keyType':'variable','variableName':_0x9a69('0x14')},{'type':_0x9a69('0x10'),'content':'','key':_0x9a69('0x15'),'keyType':'variable','variableName':_0x9a69('0x8')},{'type':_0x9a69('0x10'),'content':'','key':_0x9a69('0x16'),'keyType':_0x9a69('0x7'),'variableName':_0x9a69('0x17')},{'type':'keyValue','content':'','key':_0x9a69('0x18'),'keyType':_0x9a69('0x7'),'variableName':_0x9a69('0x19')},{'type':_0x9a69('0x1'),'content':_0x9a69('0x1a'),'key':null,'keyType':null,'variableName':null},{'type':_0x9a69('0x10'),'content':'','key':_0x9a69('0x1b'),'keyType':_0x9a69('0x7'),'variableName':_0x9a69('0x1c')},{'type':_0x9a69('0x10'),'content':'','key':'Agent\x20Number','keyType':'variable','variableName':_0x9a69('0xc')},{'type':_0x9a69('0x1'),'content':_0x9a69('0x1d'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x9a69('0x1e'),'keyType':_0x9a69('0x7'),'variableName':_0x9a69('0x19')},{'type':'keyValue','content':'','key':'Agent\x20Connect','keyType':'variable','variableName':_0x9a69('0x1f')},{'type':'keyValue','content':'','key':_0x9a69('0x20'),'keyType':_0x9a69('0x7'),'variableName':_0x9a69('0x21')},{'type':_0x9a69('0x10'),'content':'','key':'Hold\x20Time','keyType':_0x9a69('0x7'),'variableName':'holdtime'},{'type':_0x9a69('0x10'),'content':'','key':'Talk\x20Time','keyType':'variable','variableName':_0x9a69('0x22')}];break;case _0x9a69('0xa'):_0x1562e2=[{'type':_0x9a69('0x1'),'content':_0x9a69('0xe'),'variableName':null},{'type':_0x9a69('0x10'),'content':'','key':_0x9a69('0x23'),'keyType':_0x9a69('0x7'),'keyContent':'','variableName':_0x9a69('0xc')},{'type':_0x9a69('0x10'),'content':'','key':_0x9a69('0x24'),'keyType':'variable','keyContent':'','variableName':_0x9a69('0x25')},{'type':_0x9a69('0x10'),'content':'','key':'UniqueId','keyType':'variable','keyContent':'','variableName':'uniqueid'},{'type':_0x9a69('0x10'),'content':'','key':'Date','keyType':_0x9a69('0x7'),'keyContent':'','variableName':_0x9a69('0x26')},{'type':_0x9a69('0x1'),'content':_0x9a69('0x1d')},{'type':_0x9a69('0x10'),'content':'','key':_0x9a69('0x27'),'keyType':_0x9a69('0x7'),'keyContent':'','variableName':_0x9a69('0x28')},{'type':_0x9a69('0x10'),'content':'','key':_0x9a69('0x29'),'keyType':_0x9a69('0x7'),'keyContent':'','variableName':_0x9a69('0x2a')},{'type':_0x9a69('0x10'),'content':'','key':_0x9a69('0x2b'),'keyType':_0x9a69('0x7'),'keyContent':'','variableName':_0x9a69('0x2c')},{'type':_0x9a69('0x10'),'content':'','key':'Billable\x20Time','keyType':'variable','keyContent':'','variableName':_0x9a69('0x2d')}];break;}}return _0x1562e2;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index 6f410f6..1c10792 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 _0xaacf=['stringify','null','findOne','then','update','info','error','tracked','user','query','clone','body','phone','fax','mobile','lodash','../../config/logger','openchannel-interactions','fax-interactions','sms-interactions','chat-interactions','upperFirst','InteractionId','unknown','toLowerCase','name','role'];(function(_0xe43d52,_0x217f8e){var _0xe0162b=function(_0x4df542){while(--_0x4df542){_0xe43d52['push'](_0xe43d52['shift']());}};_0xe0162b(++_0x217f8e);}(_0xaacf,0xcc));var _0xfaac=function(_0x46d50b,_0x2b7924){_0x46d50b=_0x46d50b-0x0;var _0x560f0e=_0xaacf[_0x46d50b];return _0x560f0e;};'use strict';var _=require(_0xfaac('0x0'));var db=require('../../mysqldb')['db'];var loggers={'openchannel':require(_0xfaac('0x1'))(_0xfaac('0x2')),'mail':require(_0xfaac('0x1'))('mail-interactions'),'fax':require(_0xfaac('0x1'))(_0xfaac('0x3')),'sms':require(_0xfaac('0x1'))(_0xfaac('0x4')),'chat':require(_0xfaac('0x1'))(_0xfaac('0x5'))};function getInteractionId(_0x360a61,_0x48bace,_0x10149b){if(_0x360a61&&_0x360a61[_[_0xfaac('0x6')](_0x10149b)+_0xfaac('0x7')]){return _0x360a61[_[_0xfaac('0x6')](_0x10149b)+_0xfaac('0x7')];}else if(_0x360a61&&_0x360a61['id']){return _0x360a61['id'];}else if(_0x48bace&&_0x48bace['id']){return _0x48bace['id'];}else{return _0xfaac('0x8');}}function log(_0x162b22,_0x1ced9a,_0x128921,_0xa6b449,_0x202806,_0x5d4ac4){loggers[_0x202806[_0xfaac('0x9')]()][_0x162b22]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5d4ac4['toUpperCase'](),_0x1ced9a?_0x1ced9a['id']:null,_0x1ced9a?_0x1ced9a[_0xfaac('0xa')]:null,_0x1ced9a?_0x1ced9a[_0xfaac('0xb')]:null,getInteractionId(_0x128921,_0xa6b449,_0x202806),_0x128921?JSON[_0xfaac('0xc')](_0x128921):_0xfaac('0xd'));}function updateUser(_0x50cc3b,_0xc43889,_0x4ca4f8,_0x2e30be,_0x231b82){db[_[_0xfaac('0x6')](_0x2e30be)+'Interaction'][_0xfaac('0xe')]({'where':{'id':getInteractionId(_0xc43889,_0x4ca4f8,_0x2e30be)}})[_0xfaac('0xf')](function(_0x5e969f){if(_0x5e969f){return _0x5e969f[_0xfaac('0x10')]({'UserId':_0x50cc3b?_0x50cc3b['id']:null});}})[_0xfaac('0xf')](function(_0x72320e){if(_0x72320e){log(_0xfaac('0x11'),_0x50cc3b,_0xc43889,_0x4ca4f8,_0x2e30be,_0x231b82);}})['catch'](function(){log(_0xfaac('0x12'),_0x50cc3b,_0xc43889,_0x4ca4f8,_0x2e30be,_0x231b82);});}exports[_0xfaac('0x13')]=function(_0x421cbd,_0x21f558){return function(_0x1360b8,_0xe2c623,_0x1c0149){var _0x39515f=_0x1360b8[_0xfaac('0x14')];var _0x64008e={};var _0x14fd80=_0x1360b8[_0xfaac('0x15')];if(_0x64008e){_0x64008e=_[_0xfaac('0x16')](_0x1360b8['body']);_0x64008e=_['omit'](_0x64008e,[_0xfaac('0x17'),'html',_0xfaac('0x18'),_0xfaac('0x19'),_0xfaac('0x1a')]);}updateUser(_0x39515f,_0x64008e,_0x14fd80,_0x421cbd,_0x21f558);_0x1c0149(null);};}; \ No newline at end of file +var _0x5bf4=['null','Interaction','then','update','info','catch','user','query','clone','body','omit','fax','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','chat-interactions','upperFirst','InteractionId','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','stringify'];(function(_0x23d5cf,_0x2832e4){var _0x26009e=function(_0x36c627){while(--_0x36c627){_0x23d5cf['push'](_0x23d5cf['shift']());}};_0x26009e(++_0x2832e4);}(_0x5bf4,0x144));var _0x45bf=function(_0x46ecea,_0x3f8863){_0x46ecea=_0x46ecea-0x0;var _0x53c9a2=_0x5bf4[_0x46ecea];return _0x53c9a2;};'use strict';var _=require(_0x45bf('0x0'));var db=require(_0x45bf('0x1'))['db'];var loggers={'openchannel':require(_0x45bf('0x2'))(_0x45bf('0x3')),'mail':require(_0x45bf('0x2'))(_0x45bf('0x4')),'fax':require(_0x45bf('0x2'))(_0x45bf('0x5')),'sms':require(_0x45bf('0x2'))('sms-interactions'),'chat':require(_0x45bf('0x2'))(_0x45bf('0x6'))};function getInteractionId(_0x300895,_0x292ef1,_0x177610){if(_0x300895&&_0x300895[_[_0x45bf('0x7')](_0x177610)+'InteractionId']){return _0x300895[_[_0x45bf('0x7')](_0x177610)+_0x45bf('0x8')];}else if(_0x300895&&_0x300895['id']){return _0x300895['id'];}else if(_0x292ef1&&_0x292ef1['id']){return _0x292ef1['id'];}else{return'unknown';}}function log(_0x5c5065,_0x45abb7,_0x5a5b6c,_0x452ff1,_0x468a61,_0x4dc382){loggers[_0x468a61[_0x45bf('0x9')]()][_0x5c5065](_0x45bf('0xa'),_0x4dc382[_0x45bf('0xb')](),_0x45abb7?_0x45abb7['id']:null,_0x45abb7?_0x45abb7[_0x45bf('0xc')]:null,_0x45abb7?_0x45abb7['role']:null,getInteractionId(_0x5a5b6c,_0x452ff1,_0x468a61),_0x5a5b6c?JSON[_0x45bf('0xd')](_0x5a5b6c):_0x45bf('0xe'));}function updateUser(_0x25f0de,_0x4a68ea,_0x10e6a5,_0xd89665,_0x5f5965){db[_[_0x45bf('0x7')](_0xd89665)+_0x45bf('0xf')]['findOne']({'where':{'id':getInteractionId(_0x4a68ea,_0x10e6a5,_0xd89665)}})[_0x45bf('0x10')](function(_0x3111fe){if(_0x3111fe){return _0x3111fe[_0x45bf('0x11')]({'UserId':_0x25f0de?_0x25f0de['id']:null});}})[_0x45bf('0x10')](function(_0x50c625){if(_0x50c625){log(_0x45bf('0x12'),_0x25f0de,_0x4a68ea,_0x10e6a5,_0xd89665,_0x5f5965);}})[_0x45bf('0x13')](function(){log('error',_0x25f0de,_0x4a68ea,_0x10e6a5,_0xd89665,_0x5f5965);});}exports['tracked']=function(_0x1c640,_0xba564b){return function(_0x33e5c1,_0x17027b,_0x258250){var _0x3dbe88=_0x33e5c1[_0x45bf('0x14')];var _0x228fb3={};var _0x1b54ed=_0x33e5c1[_0x45bf('0x15')];if(_0x228fb3){_0x228fb3=_[_0x45bf('0x16')](_0x33e5c1[_0x45bf('0x17')]);_0x228fb3=_[_0x45bf('0x18')](_0x228fb3,[_0x45bf('0x17'),'html','phone',_0x45bf('0x19'),'mobile']);}updateUser(_0x3dbe88,_0x228fb3,_0x1b54ed,_0x1c640,_0xba564b);_0x258250(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index c57562f..e845062 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 _0x8c25=['license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','base64','final','utf8','hasOwnProperty','use','License','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','admin','user','isUserLimit','crypto','util','composable-middleware','../../mysqldb','../../config/environment','data1'];(function(_0x294e14,_0x599514){var _0x2929bf=function(_0x6814fa){while(--_0x6814fa){_0x294e14['push'](_0x294e14['shift']());}};_0x2929bf(++_0x599514);}(_0x8c25,0x180));var _0x58c2=function(_0x23cbb9,_0x21ae0d){_0x23cbb9=_0x23cbb9-0x0;var _0x202f6a=_0x8c25[_0x23cbb9];return _0x202f6a;};'use strict';var crypto=require(_0x58c2('0x0'));var util=require(_0x58c2('0x1'));var compose=require(_0x58c2('0x2'));var db=require(_0x58c2('0x3'))['db'];var config=require(_0x58c2('0x4'));function getValueFromLicense(_0x1a6eeb,_0x29382c){if(_0x1a6eeb&&_0x29382c){if(_0x29382c[_0x58c2('0x5')]&&_0x29382c[_0x58c2('0x6')]){var _0x3876e5=_0x29382c[_0x58c2('0x5')];var _0x46f309=_0x29382c['license'];var _0x315226=_0x3876e5[_0x58c2('0x7')]('-')[0x4];var _0x51dd4c=_0x3876e5[_0x58c2('0x7')]('-')[0x0];var _0x449e3e=crypto[_0x58c2('0x8')](_0x58c2('0x9'),util[_0x58c2('0xa')](_0x58c2('0xb'),_0x315226,_0x3876e5,_0x51dd4c));var _0x29abb8=_0x449e3e['update'](_0x46f309,_0x58c2('0xc'),'utf8');_0x29abb8+=_0x449e3e[_0x58c2('0xd')](_0x58c2('0xe'));var _0x1530c6=JSON['parse'](_0x29abb8);return _0x1530c6[_0x58c2('0xf')](_0x1a6eeb)?_0x1530c6[_0x1a6eeb]:null;}}return null;}function isLimit(_0x56ca6f,_0x432893,_0xd282c0,_0x340bef){var _0xdda81d=_0x432893;return compose()[_0x58c2('0x10')](function(_0x34bc04,_0x44bdb5,_0x217b28){return db[_0x58c2('0x11')]['findOne']({'where':{'id':0x1},'raw':!![]})['then'](function(_0x56e1ab){var _0x20d3cb=getValueFromLicense(_0x56ca6f,_0x56e1ab);return _0x20d3cb?_0x20d3cb:_0xdda81d;})['then'](function(_0x479456){_0xdda81d=_0x479456;return _0xd282c0[_0x58c2('0x12')](_0x340bef);})['then'](function(_0x324064){if(_0x324064>=_0xdda81d){return _0x44bdb5[_0x58c2('0x13')](0x193)[_0x58c2('0x14')]({'message':util[_0x58c2('0xa')](_0x58c2('0x15'),_0x56ca6f)});}_0x217b28();})[_0x58c2('0x16')](function(_0x287b6b){_0x217b28(_0x287b6b);});});}function isUserLimit(){return isLimit('users',0x1,db['User'],{'where':{'$or':[{'role':_0x58c2('0x17')},{'role':_0x58c2('0x18')}]}});}exports[_0x58c2('0x19')]=isUserLimit; \ No newline at end of file +var _0xf95f=['status','json','format','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','admin','user','isUserLimit','crypto','util','../../mysqldb','data1','license','split','aes-256-ctr','%s:%s:%s','base64','utf8','final','parse','use','then','count'];(function(_0x560625,_0x21566a){var _0x3ba933=function(_0x538519){while(--_0x538519){_0x560625['push'](_0x560625['shift']());}};_0x3ba933(++_0x21566a);}(_0xf95f,0x168));var _0xff95=function(_0x28e424,_0x4d6508){_0x28e424=_0x28e424-0x0;var _0x25ab59=_0xf95f[_0x28e424];return _0x25ab59;};'use strict';var crypto=require(_0xff95('0x0'));var util=require(_0xff95('0x1'));var compose=require('composable-middleware');var db=require(_0xff95('0x2'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x199d90,_0x351015){if(_0x199d90&&_0x351015){if(_0x351015[_0xff95('0x3')]&&_0x351015[_0xff95('0x4')]){var _0x2dde64=_0x351015['data1'];var _0x6922a=_0x351015[_0xff95('0x4')];var _0x53f620=_0x2dde64[_0xff95('0x5')]('-')[0x4];var _0x24bd23=_0x2dde64[_0xff95('0x5')]('-')[0x0];var _0x1df160=crypto['createDecipher'](_0xff95('0x6'),util['format'](_0xff95('0x7'),_0x53f620,_0x2dde64,_0x24bd23));var _0x335c3f=_0x1df160['update'](_0x6922a,_0xff95('0x8'),_0xff95('0x9'));_0x335c3f+=_0x1df160[_0xff95('0xa')]('utf8');var _0x48554f=JSON[_0xff95('0xb')](_0x335c3f);return _0x48554f['hasOwnProperty'](_0x199d90)?_0x48554f[_0x199d90]:null;}}return null;}function isLimit(_0x304db3,_0xef95bf,_0x4efce4,_0xc58b23){var _0x4f7416=_0xef95bf;return compose()[_0xff95('0xc')](function(_0x278324,_0xdec754,_0x57a4ff){return db['License']['findOne']({'where':{'id':0x1},'raw':!![]})[_0xff95('0xd')](function(_0x37e62d){var _0x6dd3aa=getValueFromLicense(_0x304db3,_0x37e62d);return _0x6dd3aa?_0x6dd3aa:_0x4f7416;})['then'](function(_0x1d22cd){_0x4f7416=_0x1d22cd;return _0x4efce4[_0xff95('0xe')](_0xc58b23);})['then'](function(_0x99d106){if(_0x99d106>=_0x4f7416){return _0xdec754[_0xff95('0xf')](0x193)[_0xff95('0x10')]({'message':util[_0xff95('0x11')](_0xff95('0x12'),_0x304db3)});}_0x57a4ff();})[_0xff95('0x13')](function(_0x18319f){_0x57a4ff(_0x18319f);});});}function isUserLimit(){return isLimit(_0xff95('0x14'),0x1,db[_0xff95('0x15')],{'where':{'$or':[{'role':_0xff95('0x16')},{'role':_0xff95('0x17')}]}});}exports[_0xff95('0x18')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 631585e..a2fda35 100644 --- a/server/components/parsers/advancedSearch.js +++ b/server/components/parsers/advancedSearch.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe5ee=['castTo','text','operator','field','value','IN\x20?','$notIn','NOT\x20IN\x20?','=\x20?','$ne','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','<\x20?','$gt','>\x20?','<=\x20?','$gte','>=\x20?','$in','start','$between','shift','DATE','utcOffset','format','hours','add','minutes','seconds','lodash','moment','sqlOperator','and','[$and]','replace','[$or]','split','slice','forEach','match','filter','indexOf','conditions'];(function(_0x2aeb1c,_0x534af7){var _0x322b9b=function(_0x491a1b){while(--_0x491a1b){_0x2aeb1c['push'](_0x2aeb1c['shift']());}};_0x322b9b(++_0x534af7);}(_0xe5ee,0xd8));var _0xee5e=function(_0x4a1d58,_0x29c509){_0x4a1d58=_0x4a1d58-0x0;var _0xafa39d=_0xe5ee[_0x4a1d58];return _0xafa39d;};'use strict';var _=require(_0xee5e('0x0'));var moment=require(_0xee5e('0x1'));exports['parseSearch']=function(_0x47c919){var _0x3846a8={'conditions':[]};_0x3846a8[_0xee5e('0x2')]=_['startsWith'](_0x47c919,'[$or]')?'or':_0xee5e('0x3');var _0x2786c2=_0x47c919['replace'](_0xee5e('0x4'),'')[_0xee5e('0x5')](_0xee5e('0x6'),'')[_0xee5e('0x7')]('||');for(var _0x4e57cb=0x0;_0x4e57cb<_0x2786c2['length'];_0x4e57cb++){var _0x433a4b=_0x2786c2[_0x4e57cb]['split'](':=');var _0x57fec6=_0x433a4b[0x0];var _0x163425=_0x433a4b[_0xee5e('0x8')](0x1);_0x163425[_0xee5e('0x9')](function(_0x5a5822){var _0xff86ab=_0x5a5822[_0xee5e('0x7')]('[')['shift']();var _0x1315c8=_0x5a5822[_0xee5e('0xa')](/\[(.*?)\]/g);_0x1315c8[_0xee5e('0x9')](function(_0x2a5c22){var _0x4d5e61=_0x2a5c22[_0xee5e('0x7')]('[')[_0xee5e('0xb')](function(_0x3126b0){return _0x3126b0[_0xee5e('0xc')](']')>-0x1;})['map'](function(_0x5cf3f6){return _0x5cf3f6[_0xee5e('0x7')](']')[0x0];})[0x0];_0x3846a8[_0xee5e('0xd')]['push']({'field':_0x57fec6,'operator':_0xff86ab,'value':_0x4d5e61});});});}return _0x3846a8;};exports['buildExpression']=function(_0x253c6a,_0x42782f,_0x59f5ce){var _0x36fc59={};if(_0x59f5ce[_0xee5e('0xe')]){_0x42782f=_0x59f5ce[_0xee5e('0xe')];_0x36fc59[_0xee5e('0xf')]='CAST('+_0x253c6a+'.'+_0x59f5ce['field']+'\x20AS\x20'+_0x59f5ce['castTo']+')\x20'+parseOperator(_0x59f5ce[_0xee5e('0x10')]);}else{_0x36fc59[_0xee5e('0xf')]=_0x253c6a+'.'+_0x59f5ce[_0xee5e('0x11')]+'\x20'+parseOperator(_0x59f5ce[_0xee5e('0x10')]);}_0x36fc59['value']=parseValue(_0x42782f,_0x59f5ce[_0xee5e('0x10')],_0x59f5ce[_0xee5e('0x12')]);return _0x36fc59;};function parseOperator(_0x3adae8){var _0x3f0b39;switch(_0x3adae8){case'$in':_0x3f0b39=_0xee5e('0x13');break;case _0xee5e('0x14'):_0x3f0b39=_0xee5e('0x15');break;case'$eq':_0x3f0b39=_0xee5e('0x16');break;case _0xee5e('0x17'):_0x3f0b39=_0xee5e('0x18');break;case _0xee5e('0x19'):case _0xee5e('0x1a'):case _0xee5e('0x1b'):_0x3f0b39=_0xee5e('0x1c');break;case'$lt':_0x3f0b39=_0xee5e('0x1d');break;case _0xee5e('0x1e'):_0x3f0b39=_0xee5e('0x1f');break;case'$lte':_0x3f0b39=_0xee5e('0x20');break;case _0xee5e('0x21'):_0x3f0b39=_0xee5e('0x22');break;case'$between':_0x3f0b39='BETWEEN\x20?\x20AND\x20?';break;}return _0x3f0b39;}function parseValue(_0x27aa79,_0x3a0757,_0x216ce4){var _0x6b4c1a={'start':undefined,'end':undefined};switch(_0x3a0757){case _0xee5e('0x23'):case'$notIn':_0x6b4c1a[_0xee5e('0x24')]=_0x216ce4[_0xee5e('0x7')](',');break;case _0xee5e('0x19'):_0x6b4c1a['start']='%'+_0x216ce4+'%';break;case _0xee5e('0x1a'):_0x6b4c1a['start']=_0x216ce4+'%';break;case _0xee5e('0x1b'):_0x6b4c1a[_0xee5e('0x24')]='%'+_0x216ce4;break;case _0xee5e('0x25'):var _0x27a72c=_0x216ce4[_0xee5e('0x7')](',');var _0x216ce4=_0x27a72c[_0xee5e('0x26')]();var _0x15391e=_0x27a72c['pop']();if(_0x27aa79===_0xee5e('0x27')){_0x216ce4=moment(_0x216ce4)[_0xee5e('0x28')](0x0,!![])[_0xee5e('0x29')]();_0x15391e=moment(_0x15391e)[_0xee5e('0x28')](0x0,!![])['add'](0x17,_0xee5e('0x2a'))[_0xee5e('0x2b')](0x3b,_0xee5e('0x2c'))[_0xee5e('0x2b')](0x3b,_0xee5e('0x2d'))[_0xee5e('0x29')]();}_0x6b4c1a={'start':_0x216ce4,'end':_0x15391e};break;default:_0x6b4c1a[_0xee5e('0x24')]=_0x216ce4;break;}return _0x6b4c1a;} \ No newline at end of file +var _0x951c=['minutes','seconds','moment','parseSearch','sqlOperator','startsWith','[$or]','and','[$and]','replace','split','length','slice','forEach','shift','match','filter','indexOf','map','conditions','push','castTo','text','CAST(','field','\x20AS\x20','operator','IN\x20?','$notIn','$eq','=\x20?','$ne','<>\x20?','$endsWith','LIKE\x20?','$gt','>\x20?','<=\x20?','$gte','$between','BETWEEN\x20?\x20AND\x20?','$in','start','$substring','$startsWith','pop','DATE','utcOffset','format','add'];(function(_0x264c58,_0x3c5bb1){var _0x5db60b=function(_0x4dc1a5){while(--_0x4dc1a5){_0x264c58['push'](_0x264c58['shift']());}};_0x5db60b(++_0x3c5bb1);}(_0x951c,0x192));var _0xc951=function(_0x4e246d,_0x295764){_0x4e246d=_0x4e246d-0x0;var _0x5ff745=_0x951c[_0x4e246d];return _0x5ff745;};'use strict';var _=require('lodash');var moment=require(_0xc951('0x0'));exports[_0xc951('0x1')]=function(_0x33a60f){var _0x10b7e2={'conditions':[]};_0x10b7e2[_0xc951('0x2')]=_[_0xc951('0x3')](_0x33a60f,_0xc951('0x4'))?'or':_0xc951('0x5');var _0x56e67b=_0x33a60f['replace'](_0xc951('0x6'),'')[_0xc951('0x7')](_0xc951('0x4'),'')[_0xc951('0x8')]('||');for(var _0x1c0cb5=0x0;_0x1c0cb5<_0x56e67b[_0xc951('0x9')];_0x1c0cb5++){var _0x20aee2=_0x56e67b[_0x1c0cb5][_0xc951('0x8')](':=');var _0x3cd760=_0x20aee2[0x0];var _0x153dbc=_0x20aee2[_0xc951('0xa')](0x1);_0x153dbc[_0xc951('0xb')](function(_0x4d1801){var _0x221c0a=_0x4d1801[_0xc951('0x8')]('[')[_0xc951('0xc')]();var _0x4fad6b=_0x4d1801[_0xc951('0xd')](/\[(.*?)\]/g);_0x4fad6b[_0xc951('0xb')](function(_0x3e3c1c){var _0x44d6fc=_0x3e3c1c[_0xc951('0x8')]('[')[_0xc951('0xe')](function(_0x134e5f){return _0x134e5f[_0xc951('0xf')](']')>-0x1;})[_0xc951('0x10')](function(_0x47e153){return _0x47e153[_0xc951('0x8')](']')[0x0];})[0x0];_0x10b7e2[_0xc951('0x11')][_0xc951('0x12')]({'field':_0x3cd760,'operator':_0x221c0a,'value':_0x44d6fc});});});}return _0x10b7e2;};exports['buildExpression']=function(_0x566813,_0x29b1c8,_0x2bc1b7){var _0x438cf1={};if(_0x2bc1b7['castTo']){_0x29b1c8=_0x2bc1b7[_0xc951('0x13')];_0x438cf1[_0xc951('0x14')]=_0xc951('0x15')+_0x566813+'.'+_0x2bc1b7[_0xc951('0x16')]+_0xc951('0x17')+_0x2bc1b7[_0xc951('0x13')]+')\x20'+parseOperator(_0x2bc1b7[_0xc951('0x18')]);}else{_0x438cf1[_0xc951('0x14')]=_0x566813+'.'+_0x2bc1b7[_0xc951('0x16')]+'\x20'+parseOperator(_0x2bc1b7[_0xc951('0x18')]);}_0x438cf1['value']=parseValue(_0x29b1c8,_0x2bc1b7['operator'],_0x2bc1b7['value']);return _0x438cf1;};function parseOperator(_0x35fe71){var _0x379bf6;switch(_0x35fe71){case'$in':_0x379bf6=_0xc951('0x19');break;case _0xc951('0x1a'):_0x379bf6='NOT\x20IN\x20?';break;case _0xc951('0x1b'):_0x379bf6=_0xc951('0x1c');break;case _0xc951('0x1d'):_0x379bf6=_0xc951('0x1e');break;case'$substring':case'$startsWith':case _0xc951('0x1f'):_0x379bf6=_0xc951('0x20');break;case'$lt':_0x379bf6='<\x20?';break;case _0xc951('0x21'):_0x379bf6=_0xc951('0x22');break;case'$lte':_0x379bf6=_0xc951('0x23');break;case _0xc951('0x24'):_0x379bf6='>=\x20?';break;case _0xc951('0x25'):_0x379bf6=_0xc951('0x26');break;}return _0x379bf6;}function parseValue(_0x242479,_0x4920e7,_0x3d0bba){var _0x370c4d={'start':undefined,'end':undefined};switch(_0x4920e7){case _0xc951('0x27'):case _0xc951('0x1a'):_0x370c4d[_0xc951('0x28')]=_0x3d0bba[_0xc951('0x8')](',');break;case _0xc951('0x29'):_0x370c4d[_0xc951('0x28')]='%'+_0x3d0bba+'%';break;case _0xc951('0x2a'):_0x370c4d['start']=_0x3d0bba+'%';break;case _0xc951('0x1f'):_0x370c4d[_0xc951('0x28')]='%'+_0x3d0bba;break;case _0xc951('0x25'):var _0x513eca=_0x3d0bba['split'](',');var _0x3d0bba=_0x513eca[_0xc951('0xc')]();var _0x3f38a4=_0x513eca[_0xc951('0x2b')]();if(_0x242479===_0xc951('0x2c')){_0x3d0bba=moment(_0x3d0bba)[_0xc951('0x2d')](0x0,!![])[_0xc951('0x2e')]();_0x3f38a4=moment(_0x3f38a4)['utcOffset'](0x0,!![])[_0xc951('0x2f')](0x17,'hours')[_0xc951('0x2f')](0x3b,_0xc951('0x30'))[_0xc951('0x2f')](0x3b,_0xc951('0x31'))[_0xc951('0x2e')]();}_0x370c4d={'start':_0x3d0bba,'end':_0x3f38a4};break;default:_0x370c4d['start']=_0x3d0bba;break;}return _0x370c4d;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 592f91c..bd51e93 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 _0x82af=['substr','cast','ASC','omit','length','isObject','isString','unset','isNumeric','match','isEmail','lodash','sequelize','fields','split','filters','isEmpty','forOwn','isArray','parse','limit','offset','sort','indexOf','priority','col','unsigned'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x82af,0x92));var _0xf82a=function(_0x24f326,_0x616a7){_0x24f326=_0x24f326-0x0;var _0x488e2d=_0x82af[_0x24f326];return _0x488e2d;};'use strict';var _=require(_0xf82a('0x0'));var sequelize=require(_0xf82a('0x1'));var LIMIT_VALUE=0xfa;exports[_0xf82a('0x2')]=function(_0x1d0893){var _0x14cd69=null;if(_0x1d0893){_0x14cd69=_0x1d0893[_0xf82a('0x3')](',');}return _0x14cd69;};exports[_0xf82a('0x4')]=function(_0x1af326){var _0x5e5d00={};if(!_[_0xf82a('0x5')](_0x1af326)){_0x5e5d00={};_[_0xf82a('0x6')](_0x1af326,function(_0x367ff2,_0x34bd77){try{_0x5e5d00[_0x34bd77]=_[_0xf82a('0x7')](_0x367ff2)?_0x367ff2:JSON[_0xf82a('0x8')](_0x367ff2);}catch(_0x56e06f){_0x5e5d00[_0x34bd77]=_0x367ff2['split'](',');}});}return _0x5e5d00;};exports[_0xf82a('0x9')]=function(_0x52d394){_0x52d394=parseInt(_0x52d394,0xa);if(!_0x52d394||_0x52d394<0x0){_0x52d394=LIMIT_VALUE;}return _0x52d394;};exports[_0xf82a('0xa')]=function(_0x298dad){_0x298dad=parseInt(_0x298dad,0xa);if(!_0x298dad||_0x298dad<0x0){_0x298dad=0x0;}return _0x298dad;};exports[_0xf82a('0xb')]=function(_0x599c22){var _0x33a4bc,_0x252569=null;if(_0x599c22){_0x33a4bc=_0x599c22[_0xf82a('0x3')](',');_0x252569=_['map'](_0x33a4bc,function(_0x1d85f8){if(_0x1d85f8[_0xf82a('0xc')]('-')===0x0){return[_0x1d85f8===_0xf82a('0xd')?sequelize['cast'](sequelize[_0xf82a('0xe')](_0xf82a('0xd')),_0xf82a('0xf')):_0x1d85f8[_0xf82a('0x10')](0x1),'DESC'];}else{return[_0x1d85f8===_0xf82a('0xd')?sequelize[_0xf82a('0x11')](sequelize['col'](_0xf82a('0xd')),_0xf82a('0xf')):_0x1d85f8,_0xf82a('0x12')];}});}return _0x252569;};exports[_0xf82a('0x13')]=function(_0x26ad26,_0x40d714){if(_[_0xf82a('0x5')](_0x26ad26)){return _0x26ad26;}if(_['isArray'](_0x26ad26)){for(var _0x51b65c=0x0;_0x51b65c<_0x26ad26[_0xf82a('0x14')];_0x51b65c+=0x1){_0x26ad26[_0x51b65c]=this[_0xf82a('0x13')](_0x26ad26[_0x51b65c],_0x40d714);}return _0x26ad26;}if(!_[_0xf82a('0x15')](_0x26ad26)){return _0x26ad26;}if(_[_0xf82a('0x16')](_0x40d714)){_0x40d714=[_0x40d714];}if(!_[_0xf82a('0x7')](_0x40d714)){return _0x26ad26;}for(var _0x541ffe=0x0;_0x541ffe<_0x40d714[_0xf82a('0x14')];_0x541ffe+=0x1){_[_0xf82a('0x17')](_0x26ad26,_0x40d714[_0x541ffe]);}for(var _0x300960 in _0x26ad26){if(_0x26ad26['hasOwnProperty'](_0x300960)){_0x26ad26[_0x300960]=this['omit'](_0x26ad26[_0x300960],_0x40d714);}}return _0x26ad26;};exports[_0xf82a('0x18')]=function(_0x567fd3){return _0x567fd3[_0xf82a('0x19')](RegExp('^[0-9]*$'))?!![]:![];};exports[_0xf82a('0x1a')]=function(_0x286c39){return _0x286c39['match'](/^\S+@\S+$/)?!![]:![];}; \ No newline at end of file +var _0x9ca7=['isEmpty','forOwn','isArray','parse','limit','offset','sort','map','priority','cast','unsigned','substr','ASC','omit','length','isString','unset','hasOwnProperty','^[0-9]*$','isEmail','match','sequelize','fields','split','filters'];(function(_0x13b330,_0x297092){var _0x1f666c=function(_0x5ebc84){while(--_0x5ebc84){_0x13b330['push'](_0x13b330['shift']());}};_0x1f666c(++_0x297092);}(_0x9ca7,0xf6));var _0x79ca=function(_0x299611,_0x2a97ff){_0x299611=_0x299611-0x0;var _0x443eae=_0x9ca7[_0x299611];return _0x443eae;};'use strict';var _=require('lodash');var sequelize=require(_0x79ca('0x0'));var LIMIT_VALUE=0xfa;exports[_0x79ca('0x1')]=function(_0x11cae8){var _0x2dce58=null;if(_0x11cae8){_0x2dce58=_0x11cae8[_0x79ca('0x2')](',');}return _0x2dce58;};exports[_0x79ca('0x3')]=function(_0x40dca0){var _0x51aefc={};if(!_[_0x79ca('0x4')](_0x40dca0)){_0x51aefc={};_[_0x79ca('0x5')](_0x40dca0,function(_0x27b1a7,_0x26a869){try{_0x51aefc[_0x26a869]=_[_0x79ca('0x6')](_0x27b1a7)?_0x27b1a7:JSON[_0x79ca('0x7')](_0x27b1a7);}catch(_0x41fb8f){_0x51aefc[_0x26a869]=_0x27b1a7['split'](',');}});}return _0x51aefc;};exports[_0x79ca('0x8')]=function(_0x268657){_0x268657=parseInt(_0x268657,0xa);if(!_0x268657||_0x268657<0x0){_0x268657=LIMIT_VALUE;}return _0x268657;};exports[_0x79ca('0x9')]=function(_0x12e1b5){_0x12e1b5=parseInt(_0x12e1b5,0xa);if(!_0x12e1b5||_0x12e1b5<0x0){_0x12e1b5=0x0;}return _0x12e1b5;};exports[_0x79ca('0xa')]=function(_0x48b09f){var _0x4493fe,_0x3dff9c=null;if(_0x48b09f){_0x4493fe=_0x48b09f[_0x79ca('0x2')](',');_0x3dff9c=_[_0x79ca('0xb')](_0x4493fe,function(_0x3a1e9a){if(_0x3a1e9a['indexOf']('-')===0x0){return[_0x3a1e9a===_0x79ca('0xc')?sequelize[_0x79ca('0xd')](sequelize['col']('priority'),_0x79ca('0xe')):_0x3a1e9a[_0x79ca('0xf')](0x1),'DESC'];}else{return[_0x3a1e9a===_0x79ca('0xc')?sequelize['cast'](sequelize['col'](_0x79ca('0xc')),_0x79ca('0xe')):_0x3a1e9a,_0x79ca('0x10')];}});}return _0x3dff9c;};exports[_0x79ca('0x11')]=function(_0x32d8f4,_0x428d1b){if(_[_0x79ca('0x4')](_0x32d8f4)){return _0x32d8f4;}if(_[_0x79ca('0x6')](_0x32d8f4)){for(var _0xdf291f=0x0;_0xdf291f<_0x32d8f4[_0x79ca('0x12')];_0xdf291f+=0x1){_0x32d8f4[_0xdf291f]=this[_0x79ca('0x11')](_0x32d8f4[_0xdf291f],_0x428d1b);}return _0x32d8f4;}if(!_['isObject'](_0x32d8f4)){return _0x32d8f4;}if(_[_0x79ca('0x13')](_0x428d1b)){_0x428d1b=[_0x428d1b];}if(!_[_0x79ca('0x6')](_0x428d1b)){return _0x32d8f4;}for(var _0x2108b9=0x0;_0x2108b9<_0x428d1b[_0x79ca('0x12')];_0x2108b9+=0x1){_[_0x79ca('0x14')](_0x32d8f4,_0x428d1b[_0x2108b9]);}for(var _0x5830f8 in _0x32d8f4){if(_0x32d8f4[_0x79ca('0x15')](_0x5830f8)){_0x32d8f4[_0x5830f8]=this[_0x79ca('0x11')](_0x32d8f4[_0x5830f8],_0x428d1b);}}return _0x32d8f4;};exports['isNumeric']=function(_0x496fa7){return _0x496fa7['match'](RegExp(_0x79ca('0x16')))?!![]:![];};exports[_0x79ca('0x17')]=function(_0x45200a){return _0x45200a[_0x79ca('0x18')](/^\S+@\S+$/)?!![]:![];}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 3863933..12a479c 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x750a=['passport','cors','moment','./environment','../mysqldb','default','get','env','appPath','root','public','test','set','use','toISOString','static','views','/server/views','engine','html','renderFile','50mb','initialize','serve-favicon','cookie-parser','errorhandler','path'];(function(_0x3095ac,_0x5cd686){var _0x2c3fb6=function(_0x3982cc){while(--_0x3982cc){_0x3095ac['push'](_0x3095ac['shift']());}};_0x2c3fb6(++_0x5cd686);}(_0x750a,0x140));var _0xa750=function(_0x275ae6,_0x51d1cb){_0x275ae6=_0x275ae6-0x0;var _0x4e6bd3=_0x750a[_0x275ae6];return _0x4e6bd3;};'use strict';var express=require('express');var favicon=require(_0xa750('0x0'));var bodyParser=require('body-parser');var methodOverride=require('method-override');var cookieParser=require(_0xa750('0x1'));var errorHandler=require(_0xa750('0x2'));var path=require(_0xa750('0x3'));var passport=require(_0xa750('0x4'));var cors=require(_0xa750('0x5'));var moment=require(_0xa750('0x6'));var config=require(_0xa750('0x7'));var db=require(_0xa750('0x8'))['db'];exports[_0xa750('0x9')]=function(_0x2497df){var _0x197299=_0x2497df[_0xa750('0xa')](_0xa750('0xb'));if(_0x197299==='production'){_0x2497df['set'](_0xa750('0xc'),path['join'](config[_0xa750('0xd')],_0xa750('0xe')));}if(_0x197299==='development'||_0x197299===_0xa750('0xf')){_0x2497df[_0xa750('0x10')]('appPath',path['join'](config[_0xa750('0xd')],'client'));_0x2497df[_0xa750('0x11')](errorHandler());}_0x2497df[_0xa750('0x10')]('json\x20replacer',function(_0x24ec62,_0x1c5657){if(this[_0x24ec62]instanceof Date){_0x1c5657=this[_0x24ec62][_0xa750('0x12')]()['split']('.')[0x0]+'Z';}return _0x1c5657;});_0x2497df[_0xa750('0x11')](express[_0xa750('0x13')](_0x2497df[_0xa750('0xa')](_0xa750('0xc'))));_0x2497df[_0xa750('0x10')](_0xa750('0x14'),config['root']+_0xa750('0x15'));_0x2497df[_0xa750('0x16')](_0xa750('0x17'),require('ejs')[_0xa750('0x18')]);_0x2497df[_0xa750('0x10')]('view\x20engine','html');_0x2497df[_0xa750('0x11')](bodyParser['urlencoded']({'limit':_0xa750('0x19'),'extended':!![]}));_0x2497df[_0xa750('0x11')](bodyParser['json']({'limit':_0xa750('0x19')}));_0x2497df['use'](cors());_0x2497df['use'](methodOverride());_0x2497df[_0xa750('0x11')](cookieParser());_0x2497df['use'](passport[_0xa750('0x1a')]());}; \ No newline at end of file +var _0xaa88=['./environment','get','env','production','set','join','root','public','test','appPath','client','use','json\x20replacer','split','static','/server/views','engine','html','ejs','renderFile','view\x20engine','50mb','initialize','express','serve-favicon','body-parser','method-override','errorhandler','path','passport','cors','moment'];(function(_0x6cc68a,_0x29032f){var _0x50a4ea=function(_0x87a5ff){while(--_0x87a5ff){_0x6cc68a['push'](_0x6cc68a['shift']());}};_0x50a4ea(++_0x29032f);}(_0xaa88,0x137));var _0x8aa8=function(_0x2bfd4f,_0x1bbf2c){_0x2bfd4f=_0x2bfd4f-0x0;var _0x341849=_0xaa88[_0x2bfd4f];return _0x341849;};'use strict';var express=require(_0x8aa8('0x0'));var favicon=require(_0x8aa8('0x1'));var bodyParser=require(_0x8aa8('0x2'));var methodOverride=require(_0x8aa8('0x3'));var cookieParser=require('cookie-parser');var errorHandler=require(_0x8aa8('0x4'));var path=require(_0x8aa8('0x5'));var passport=require(_0x8aa8('0x6'));var cors=require(_0x8aa8('0x7'));var moment=require(_0x8aa8('0x8'));var config=require(_0x8aa8('0x9'));var db=require('../mysqldb')['db'];exports['default']=function(_0x460042){var _0x5264ff=_0x460042[_0x8aa8('0xa')](_0x8aa8('0xb'));if(_0x5264ff===_0x8aa8('0xc')){_0x460042[_0x8aa8('0xd')]('appPath',path[_0x8aa8('0xe')](config[_0x8aa8('0xf')],_0x8aa8('0x10')));}if(_0x5264ff==='development'||_0x5264ff===_0x8aa8('0x11')){_0x460042[_0x8aa8('0xd')](_0x8aa8('0x12'),path[_0x8aa8('0xe')](config['root'],_0x8aa8('0x13')));_0x460042[_0x8aa8('0x14')](errorHandler());}_0x460042['set'](_0x8aa8('0x15'),function(_0xa691d6,_0x28132f){if(this[_0xa691d6]instanceof Date){_0x28132f=this[_0xa691d6]['toISOString']()[_0x8aa8('0x16')]('.')[0x0]+'Z';}return _0x28132f;});_0x460042[_0x8aa8('0x14')](express[_0x8aa8('0x17')](_0x460042['get'](_0x8aa8('0x12'))));_0x460042['set']('views',config[_0x8aa8('0xf')]+_0x8aa8('0x18'));_0x460042[_0x8aa8('0x19')](_0x8aa8('0x1a'),require(_0x8aa8('0x1b'))[_0x8aa8('0x1c')]);_0x460042[_0x8aa8('0xd')](_0x8aa8('0x1d'),_0x8aa8('0x1a'));_0x460042['use'](bodyParser['urlencoded']({'limit':_0x8aa8('0x1e'),'extended':!![]}));_0x460042['use'](bodyParser['json']({'limit':_0x8aa8('0x1e')}));_0x460042['use'](cors());_0x460042[_0x8aa8('0x14')](methodOverride());_0x460042[_0x8aa8('0x14')](cookieParser());_0x460042[_0x8aa8('0x14')](passport[_0x8aa8('0x1f')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index e22411c..77cd6b3 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 _0x0d84=['macAddress','ipAddress','substring','lodash','bimedia-machine-uuid','execSync','networkInterfaces','orderBy','keys','length','filter','family','IPv4','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','join','createHash','md5','update','digest','hex','getUuid','dmidecode\x20--string\x20system-uuid'];(function(_0x1b4002,_0x5b4094){var _0x1716f3=function(_0x47cfd1){while(--_0x47cfd1){_0x1b4002['push'](_0x1b4002['shift']());}};_0x1716f3(++_0x5b4094);}(_0x0d84,0x77));var _0x40d8=function(_0x25826d,_0x25e81e){_0x25826d=_0x25826d-0x0;var _0xae17f1=_0x0d84[_0x25826d];return _0xae17f1;};'use strict';var _=require(_0x40d8('0x0'));var os=require('os');var crypto=require('crypto');var machine=require(_0x40d8('0x1'));var exec=require('child_process')[_0x40d8('0x2')];function getInterfaces(){var _0x315ff2=[];var _0xf44b61=os[_0x40d8('0x3')]();var _0x1a93f9=_[_0x40d8('0x4')](_[_0x40d8('0x5')](_0xf44b61));for(var _0x22398f=0x0;_0x22398f<_0x1a93f9[_0x40d8('0x6')];_0x22398f++){var _0x55356a=_0xf44b61[_0x1a93f9[_0x22398f]][_0x40d8('0x7')](function(_0x137f3b){return _0x137f3b[_0x40d8('0x8')]===_0x40d8('0x9')&&_0x137f3b['internal']===![];});_0x315ff2=_0x315ff2[_0x40d8('0xa')](_0x55356a);}return _0x315ff2;}function getFirstInterface(){var _0x350c71=_[_0x40d8('0xb')](getInterfaces());return{'macAddress':_0x350c71&&_0x350c71['mac']?_0x350c71[_0x40d8('0xc')]:_0x40d8('0xd'),'ipAddress':_0x350c71&&_0x350c71['address']?_0x350c71[_0x40d8('0xe')]:_0x40d8('0xf')};}exports[_0x40d8('0x10')]=getFirstInterface;function getCPUhash(){var _0x481812=_[_0x40d8('0x4')](os[_0x40d8('0x11')]()['map'](function(_0x2cb607){return _0x2cb607['model'];}))[_0x40d8('0x12')](':');return crypto[_0x40d8('0x13')](_0x40d8('0x14'))[_0x40d8('0x15')](_0x481812)[_0x40d8('0x16')](_0x40d8('0x17'));}exports[_0x40d8('0x18')]=function(){switch(os['platform']()){case'win32':return exec(_0x40d8('0x19'),{'encoding':'utf8'})['replace']('\x0d\x0a','');default:var _0x44f5e4=getFirstInterface();var _0xa45598=getCPUhash();var _0xbb1df2=_0xa45598+'|'+os['hostname']()+'|'+_0x44f5e4[_0x40d8('0x1a')]+'|'+_0x44f5e4[_0x40d8('0x1b')];var _0x5d7bcf=crypto[_0x40d8('0x13')](_0x40d8('0x14'))['update'](_0xbb1df2)[_0x40d8('0x16')](_0x40d8('0x17'));return _0x5d7bcf['substring'](0x0,0x8)+'-'+_0x5d7bcf[_0x40d8('0x1c')](0x8,0xc)+'-'+_0x5d7bcf['substring'](0xc,0x10)+'-'+_0x5d7bcf['substring'](0x10,0x14)+'-'+_0x5d7bcf[_0x40d8('0x1c')](0x14);}}; \ No newline at end of file +var _0x9a40=['filter','internal','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','orderBy','cpus','map','model','join','md5','update','digest','getUuid','platform','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress','ipAddress','hex','substring','lodash','crypto','execSync','keys'];(function(_0x269ee8,_0x477226){var _0x4d98bd=function(_0x20d4c4){while(--_0x20d4c4){_0x269ee8['push'](_0x269ee8['shift']());}};_0x4d98bd(++_0x477226);}(_0x9a40,0x151));var _0x09a4=function(_0x2cc9a0,_0x1c456d){_0x2cc9a0=_0x2cc9a0-0x0;var _0x15d5b2=_0x9a40[_0x2cc9a0];return _0x15d5b2;};'use strict';var _=require(_0x09a4('0x0'));var os=require('os');var crypto=require(_0x09a4('0x1'));var machine=require('bimedia-machine-uuid');var exec=require('child_process')[_0x09a4('0x2')];function getInterfaces(){var _0x47fd7b=[];var _0x73ffd3=os['networkInterfaces']();var _0x320427=_['orderBy'](_[_0x09a4('0x3')](_0x73ffd3));for(var _0x30426d=0x0;_0x30426d<_0x320427['length'];_0x30426d++){var _0x2babe1=_0x73ffd3[_0x320427[_0x30426d]][_0x09a4('0x4')](function(_0x16f5e6){return _0x16f5e6['family']==='IPv4'&&_0x16f5e6[_0x09a4('0x5')]===![];});_0x47fd7b=_0x47fd7b[_0x09a4('0x6')](_0x2babe1);}return _0x47fd7b;}function getFirstInterface(){var _0xec8e5a=_[_0x09a4('0x7')](getInterfaces());return{'macAddress':_0xec8e5a&&_0xec8e5a[_0x09a4('0x8')]?_0xec8e5a[_0x09a4('0x8')]:_0x09a4('0x9'),'ipAddress':_0xec8e5a&&_0xec8e5a[_0x09a4('0xa')]?_0xec8e5a['address']:_0x09a4('0xb')};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x5cdb96=_[_0x09a4('0xc')](os[_0x09a4('0xd')]()[_0x09a4('0xe')](function(_0x793de7){return _0x793de7[_0x09a4('0xf')];}))[_0x09a4('0x10')](':');return crypto['createHash'](_0x09a4('0x11'))[_0x09a4('0x12')](_0x5cdb96)[_0x09a4('0x13')]('hex');}exports[_0x09a4('0x14')]=function(){switch(os[_0x09a4('0x15')]()){case _0x09a4('0x16'):return exec(_0x09a4('0x17'),{'encoding':_0x09a4('0x18')})[_0x09a4('0x19')]('\x0d\x0a','');default:var _0x401415=getFirstInterface();var _0x30bbcd=getCPUhash();var _0x37e7b3=_0x30bbcd+'|'+os[_0x09a4('0x1a')]()+'|'+_0x401415[_0x09a4('0x1b')]+'|'+_0x401415[_0x09a4('0x1c')];var _0x48778e=crypto['createHash'](_0x09a4('0x11'))[_0x09a4('0x12')](_0x37e7b3)[_0x09a4('0x13')](_0x09a4('0x1d'));return _0x48778e[_0x09a4('0x1e')](0x0,0x8)+'-'+_0x48778e['substring'](0x8,0xc)+'-'+_0x48778e[_0x09a4('0x1e')](0xc,0x10)+'-'+_0x48778e[_0x09a4('0x1e')](0x10,0x14)+'-'+_0x48778e[_0x09a4('0x1e')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 2cb3a98..061fb70 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 _0xa9e0=['https://www.xcallymotion.com','format','version','%s/api/servers/%s/check?version=%s&oldtoken=%s','exports','createCipher','aes-256-ctr','secrets','update','utf8','base64','final','session','||FIELD||VALUE||\x0a','User','findOne','admin','fullname','email','|reason|','|machineUuid|','|email|','then','getFirstInterface','ipAddress','openIssue','MOTLICENSE','Motion\x20License\x20Alert','Alert','get','active','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','data1','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','uuid','toUpperCase','YYYY-MM-DD\x20HH:mm','diff','message','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','error','util','crypto','moment','pkginfo','../../mysqldb','../environment','./hardware','../logger','license'];(function(_0x14d713,_0xdff4d3){var _0x3559a2=function(_0x2624f2){while(--_0x2624f2){_0x14d713['push'](_0x14d713['shift']());}};_0x3559a2(++_0xdff4d3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'use strict';var util=require(_0x0a9e('0x0'));var crypto=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var rp=require('request-promise');var BPromise=require('bluebird');var pkginfo=require(_0x0a9e('0x3'))(module,'version');var db=require(_0x0a9e('0x4'))['db'];var config=require(_0x0a9e('0x5'));var hardware=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var jira=require('../../api/jira/jira.controller');var HOST=_0x0a9e('0x9');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;var oldToken;function httpRequest(_0x441e3a){return new BPromise(function(_0x2cc193,_0x5f41ea){var _0x503809=util[_0x0a9e('0xa')]('%s/api/servers/%s/check?version=%s',HOST,_0x441e3a,module['exports'][_0x0a9e('0xb')]);if(oldToken){_0x503809=util[_0x0a9e('0xa')](_0x0a9e('0xc'),HOST,_0x441e3a,module[_0x0a9e('0xd')][_0x0a9e('0xb')],oldToken);}var _0xbd1168={'uri':_0x503809,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0xbd1168)['then'](function(_0x527cdd){_0x2cc193(_0x527cdd);})['catch'](function(_0x273d4d){_0x5f41ea(_0x273d4d);});});}function encryptDate(_0x36471c){var _0xd5b662=crypto[_0x0a9e('0xe')](_0x0a9e('0xf'),config[_0x0a9e('0x10')]['session']);var _0x4283ce=_0xd5b662[_0x0a9e('0x11')](_0x36471c,_0x0a9e('0x12'),_0x0a9e('0x13'));_0x4283ce+=_0xd5b662[_0x0a9e('0x14')](_0x0a9e('0x13'));return _0x4283ce;}function decryptDate(_0x52a03d){var _0x22dccb=crypto['createDecipher'](_0x0a9e('0xf'),config['secrets'][_0x0a9e('0x15')]);var _0x12066b=_0x22dccb['update'](_0x52a03d,_0x0a9e('0x13'),'utf8');_0x12066b+=_0x22dccb[_0x0a9e('0x14')](_0x0a9e('0x12'));return _0x12066b;}function sendJiraAlert(_0x106033,_0x205fd6,_0x31b1ca){var _0x2eb11f=_0x0a9e('0x16');return db[_0x0a9e('0x17')][_0x0a9e('0x18')]({'where':{'role':_0x0a9e('0x19')},'attributes':[_0x0a9e('0x1a'),_0x0a9e('0x1b')],'raw':!![]})['then'](function(_0x2c3407){ADMIN=_0x2c3407;_0x2eb11f+=_0x0a9e('0x1c')+_0x31b1ca+'|\x0a';_0x2eb11f+='|uuid|'+_0x106033+'|\x0a';_0x2eb11f+=_0x0a9e('0x1d')+_0x205fd6+'|\x0a';_0x2eb11f+='|name|'+ADMIN['fullname']+'|\x0a';_0x2eb11f+=_0x0a9e('0x1e')+ADMIN[_0x0a9e('0x1b')]+'|\x0a';return _0x2eb11f;})[_0x0a9e('0x1f')](function(_0x30bae6){var _0x4abc77=hardware[_0x0a9e('0x20')]()[_0x0a9e('0x21')];return jira[_0x0a9e('0x22')]({'key':_0x0a9e('0x23'),'summary':_0x0a9e('0x24'),'description':_0x30bae6,'issuetype':_0x0a9e('0x25'),'oldToken':_0x106033,'newToken':_0x205fd6,'email':ADMIN[_0x0a9e('0x1b')],'name':ADMIN['fullname'],'reason':GRAY_PERIOD_REASON,'ip':_0x4abc77});});}function manageLicense(_0x59181e,_0x197ec0){var _0x3a8e58=_0x197ec0[_0x0a9e('0x26')]({'plain':!![]});httpRequest(_0x59181e)[_0x0a9e('0x1f')](function(_0x526cf3){if(oldToken){oldToken=undefined;}if(_0x526cf3[_0x0a9e('0x27')]){if(!_0x3a8e58['license']&&_0x3a8e58[_0x0a9e('0x8')]!=_0x526cf3['license']||_0x3a8e58[_0x0a9e('0x8')]&&_0x3a8e58[_0x0a9e('0x28')]){logger[_0x0a9e('0x29')](_0x0a9e('0x2a'));}if(_0x3a8e58[_0x0a9e('0x8')]&&!_0x3a8e58[_0x0a9e('0x28')]&&_0x3a8e58[_0x0a9e('0x8')]!=_0x526cf3[_0x0a9e('0x8')]){logger['info'](_0x0a9e('0x2b'));}if(_0x3a8e58[_0x0a9e('0x8')]&&!_0x3a8e58[_0x0a9e('0x28')]&&_0x3a8e58[_0x0a9e('0x8')]==_0x526cf3['license']){return _0x197ec0;}return _0x197ec0[_0x0a9e('0x11')]({'data1':_0x59181e,'data2':null,'license':_0x526cf3[_0x0a9e('0x8')]});}else{if(_0x526cf3[_0x0a9e('0x8')]||_0x3a8e58[_0x0a9e('0x8')]){if(!_0x3a8e58[_0x0a9e('0x28')]){if(_0x3a8e58[_0x0a9e('0x2c')]==_0x59181e){GRAY_PERIOD_REASON=_0x0a9e('0x2d');logger[_0x0a9e('0x29')](_0x0a9e('0x2e'));}else{GRAY_PERIOD_REASON='Changed';oldToken=_0x3a8e58[_0x0a9e('0x2c')];logger['info'](_0x0a9e('0x2f'),_0x3a8e58[_0x0a9e('0x2c')],_0x59181e);}sendJiraAlert(_0x3a8e58[_0x0a9e('0x2c')],_0x526cf3[_0x0a9e('0x30')],GRAY_PERIOD_REASON);logger[_0x0a9e('0x29')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0x0a9e('0x31')](),moment()[_0x0a9e('0xa')](_0x0a9e('0x32')));return _0x197ec0[_0x0a9e('0x11')]({'data2':encryptDate(moment()[_0x0a9e('0xa')](_0x0a9e('0x32')))});}else{if(moment()[_0x0a9e('0x33')](decryptDate(_0x3a8e58[_0x0a9e('0x28')]),'days')>DAYS){logger[_0x0a9e('0x29')]('DEMO\x20START\x20AT\x20%s',moment()[_0x0a9e('0xa')](_0x0a9e('0x32')));return _0x197ec0[_0x0a9e('0x11')]({'data1':_0x59181e,'data2':null,'license':null});}}}else{if(_0x3a8e58[_0x0a9e('0x2c')]!=_0x59181e){logger['info'](_0x0a9e('0x2f'),_0x3a8e58[_0x0a9e('0x2c')],_0x59181e);return _0x197ec0[_0x0a9e('0x11')]({'data1':_0x59181e,'data2':null,'license':null});}}}return _0x197ec0;})[_0x0a9e('0x1f')](function(_0x4853b1){_0x197ec0=_0x4853b1;})['catch'](function(_0x1e8694){logger['error'](_0x1e8694[_0x0a9e('0x34')]);})[_0x0a9e('0x35')](function(){setTimeout(function(){manageLicense(hardware[_0x0a9e('0x36')](),_0x197ec0);},TIME);});}function defaultLicense(){var _0x1ef87a=hardware['getUuid']();if(_0x1ef87a){return db[_0x0a9e('0x37')][_0x0a9e('0x38')]({'where':{'id':0x1},'defaults':{'data1':_0x1ef87a}})[_0x0a9e('0x39')](function(_0x533942,_0x1dbf74){logger[_0x0a9e('0x29')](_0x0a9e('0x3a'),_0x1ef87a);manageLicense(_0x1ef87a,_0x533942);})['catch'](function(_0x546ef8){logger[_0x0a9e('0x3b')](_0x546ef8[_0x0a9e('0x34')]);});}}exports['default']=defaultLicense; \ No newline at end of file +var _0xa9e0=['https://www.xcallymotion.com','format','version','%s/api/servers/%s/check?version=%s&oldtoken=%s','exports','createCipher','aes-256-ctr','secrets','update','utf8','base64','final','session','||FIELD||VALUE||\x0a','User','findOne','admin','fullname','email','|reason|','|machineUuid|','|email|','then','getFirstInterface','ipAddress','openIssue','MOTLICENSE','Motion\x20License\x20Alert','Alert','get','active','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','data1','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','uuid','toUpperCase','YYYY-MM-DD\x20HH:mm','diff','message','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','error','util','crypto','moment','pkginfo','../../mysqldb','../environment','./hardware','../logger','license'];(function(_0x4f4941,_0x4f739c){var _0x30060a=function(_0x16be8b){while(--_0x16be8b){_0x4f4941['push'](_0x4f4941['shift']());}};_0x30060a(++_0x4f739c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'use strict';var util=require(_0x0a9e('0x0'));var crypto=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var rp=require('request-promise');var BPromise=require('bluebird');var pkginfo=require(_0x0a9e('0x3'))(module,'version');var db=require(_0x0a9e('0x4'))['db'];var config=require(_0x0a9e('0x5'));var hardware=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var jira=require('../../api/jira/jira.controller');var HOST=_0x0a9e('0x9');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;var oldToken;function httpRequest(_0x441e3a){return new BPromise(function(_0x2cc193,_0x5f41ea){var _0x503809=util[_0x0a9e('0xa')]('%s/api/servers/%s/check?version=%s',HOST,_0x441e3a,module['exports'][_0x0a9e('0xb')]);if(oldToken){_0x503809=util[_0x0a9e('0xa')](_0x0a9e('0xc'),HOST,_0x441e3a,module[_0x0a9e('0xd')][_0x0a9e('0xb')],oldToken);}var _0xbd1168={'uri':_0x503809,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0xbd1168)['then'](function(_0x527cdd){_0x2cc193(_0x527cdd);})['catch'](function(_0x273d4d){_0x5f41ea(_0x273d4d);});});}function encryptDate(_0x36471c){var _0xd5b662=crypto[_0x0a9e('0xe')](_0x0a9e('0xf'),config[_0x0a9e('0x10')]['session']);var _0x4283ce=_0xd5b662[_0x0a9e('0x11')](_0x36471c,_0x0a9e('0x12'),_0x0a9e('0x13'));_0x4283ce+=_0xd5b662[_0x0a9e('0x14')](_0x0a9e('0x13'));return _0x4283ce;}function decryptDate(_0x52a03d){var _0x22dccb=crypto['createDecipher'](_0x0a9e('0xf'),config['secrets'][_0x0a9e('0x15')]);var _0x12066b=_0x22dccb['update'](_0x52a03d,_0x0a9e('0x13'),'utf8');_0x12066b+=_0x22dccb[_0x0a9e('0x14')](_0x0a9e('0x12'));return _0x12066b;}function sendJiraAlert(_0x106033,_0x205fd6,_0x31b1ca){var _0x2eb11f=_0x0a9e('0x16');return db[_0x0a9e('0x17')][_0x0a9e('0x18')]({'where':{'role':_0x0a9e('0x19')},'attributes':[_0x0a9e('0x1a'),_0x0a9e('0x1b')],'raw':!![]})['then'](function(_0x2c3407){ADMIN=_0x2c3407;_0x2eb11f+=_0x0a9e('0x1c')+_0x31b1ca+'|\x0a';_0x2eb11f+='|uuid|'+_0x106033+'|\x0a';_0x2eb11f+=_0x0a9e('0x1d')+_0x205fd6+'|\x0a';_0x2eb11f+='|name|'+ADMIN['fullname']+'|\x0a';_0x2eb11f+=_0x0a9e('0x1e')+ADMIN[_0x0a9e('0x1b')]+'|\x0a';return _0x2eb11f;})[_0x0a9e('0x1f')](function(_0x30bae6){var _0x4abc77=hardware[_0x0a9e('0x20')]()[_0x0a9e('0x21')];return jira[_0x0a9e('0x22')]({'key':_0x0a9e('0x23'),'summary':_0x0a9e('0x24'),'description':_0x30bae6,'issuetype':_0x0a9e('0x25'),'oldToken':_0x106033,'newToken':_0x205fd6,'email':ADMIN[_0x0a9e('0x1b')],'name':ADMIN['fullname'],'reason':GRAY_PERIOD_REASON,'ip':_0x4abc77});});}function manageLicense(_0x59181e,_0x197ec0){var _0x3a8e58=_0x197ec0[_0x0a9e('0x26')]({'plain':!![]});httpRequest(_0x59181e)[_0x0a9e('0x1f')](function(_0x526cf3){if(oldToken){oldToken=undefined;}if(_0x526cf3[_0x0a9e('0x27')]){if(!_0x3a8e58['license']&&_0x3a8e58[_0x0a9e('0x8')]!=_0x526cf3['license']||_0x3a8e58[_0x0a9e('0x8')]&&_0x3a8e58[_0x0a9e('0x28')]){logger[_0x0a9e('0x29')](_0x0a9e('0x2a'));}if(_0x3a8e58[_0x0a9e('0x8')]&&!_0x3a8e58[_0x0a9e('0x28')]&&_0x3a8e58[_0x0a9e('0x8')]!=_0x526cf3[_0x0a9e('0x8')]){logger['info'](_0x0a9e('0x2b'));}if(_0x3a8e58[_0x0a9e('0x8')]&&!_0x3a8e58[_0x0a9e('0x28')]&&_0x3a8e58[_0x0a9e('0x8')]==_0x526cf3['license']){return _0x197ec0;}return _0x197ec0[_0x0a9e('0x11')]({'data1':_0x59181e,'data2':null,'license':_0x526cf3[_0x0a9e('0x8')]});}else{if(_0x526cf3[_0x0a9e('0x8')]||_0x3a8e58[_0x0a9e('0x8')]){if(!_0x3a8e58[_0x0a9e('0x28')]){if(_0x3a8e58[_0x0a9e('0x2c')]==_0x59181e){GRAY_PERIOD_REASON=_0x0a9e('0x2d');logger[_0x0a9e('0x29')](_0x0a9e('0x2e'));}else{GRAY_PERIOD_REASON='Changed';oldToken=_0x3a8e58[_0x0a9e('0x2c')];logger['info'](_0x0a9e('0x2f'),_0x3a8e58[_0x0a9e('0x2c')],_0x59181e);}sendJiraAlert(_0x3a8e58[_0x0a9e('0x2c')],_0x526cf3[_0x0a9e('0x30')],GRAY_PERIOD_REASON);logger[_0x0a9e('0x29')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0x0a9e('0x31')](),moment()[_0x0a9e('0xa')](_0x0a9e('0x32')));return _0x197ec0[_0x0a9e('0x11')]({'data2':encryptDate(moment()[_0x0a9e('0xa')](_0x0a9e('0x32')))});}else{if(moment()[_0x0a9e('0x33')](decryptDate(_0x3a8e58[_0x0a9e('0x28')]),'days')>DAYS){logger[_0x0a9e('0x29')]('DEMO\x20START\x20AT\x20%s',moment()[_0x0a9e('0xa')](_0x0a9e('0x32')));return _0x197ec0[_0x0a9e('0x11')]({'data1':_0x59181e,'data2':null,'license':null});}}}else{if(_0x3a8e58[_0x0a9e('0x2c')]!=_0x59181e){logger['info'](_0x0a9e('0x2f'),_0x3a8e58[_0x0a9e('0x2c')],_0x59181e);return _0x197ec0[_0x0a9e('0x11')]({'data1':_0x59181e,'data2':null,'license':null});}}}return _0x197ec0;})[_0x0a9e('0x1f')](function(_0x4853b1){_0x197ec0=_0x4853b1;})['catch'](function(_0x1e8694){logger['error'](_0x1e8694[_0x0a9e('0x34')]);})[_0x0a9e('0x35')](function(){setTimeout(function(){manageLicense(hardware[_0x0a9e('0x36')](),_0x197ec0);},TIME);});}function defaultLicense(){var _0x1ef87a=hardware['getUuid']();if(_0x1ef87a){return db[_0x0a9e('0x37')][_0x0a9e('0x38')]({'where':{'id':0x1},'defaults':{'data1':_0x1ef87a}})[_0x0a9e('0x39')](function(_0x533942,_0x1dbf74){logger[_0x0a9e('0x29')](_0x0a9e('0x3a'),_0x1ef87a);manageLicense(_0x1ef87a,_0x533942);})['catch'](function(_0x546ef8){logger[_0x0a9e('0x3b')](_0x546ef8[_0x0a9e('0x34')]);});}}exports['default']=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 88b870b..182db7a 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 _0x6792=['moment','./hardware','../environment','../../mysqldb','license','isEmpty','data1','data2','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','final','parse','demo','uuid','machineUuid','getUuid','secrets','gray','deadline','days','grayReason','changed','disabled','2027-01-01T00:00:00.000Z','Breaking\x20license','message','getLicense','License','defaults','then','checkLicense','crypto','util','lodash'];(function(_0x2ae489,_0x9f8183){var _0x144cd2=function(_0x3a62b7){while(--_0x3a62b7){_0x2ae489['push'](_0x2ae489['shift']());}};_0x144cd2(++_0x9f8183);}(_0x6792,0x115));var _0x2679=function(_0x4993cc,_0x247534){_0x4993cc=_0x4993cc-0x0;var _0x356520=_0x6792[_0x4993cc];return _0x356520;};'use strict';var crypto=require(_0x2679('0x0'));var util=require(_0x2679('0x1'));var _=require(_0x2679('0x2'));var moment=require(_0x2679('0x3'));var hardware=require(_0x2679('0x4'));var config=require(_0x2679('0x5'));var db=require(_0x2679('0x6'))['db'];function checkLicense(_0x295ae0,_0x1e6389){if(_0x295ae0){try{var _0x561ff3=_0x1e6389||_0x295ae0[_0x2679('0x7')];if(_[_0x2679('0x8')](_0x561ff3)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x485ec8=_0x295ae0[_0x2679('0x9')];var _0x161e1a=_0x295ae0[_0x2679('0xa')];var _0x51e703=_0x485ec8[_0x2679('0xb')]('-')[0x4];var _0x2776f6=_0x485ec8[_0x2679('0xb')]('-')[0x0];var _0x42082d=crypto[_0x2679('0xc')](_0x2679('0xd'),util[_0x2679('0xe')](_0x2679('0xf'),_0x51e703,_0x485ec8,_0x2776f6));var _0x4bd649=_0x42082d[_0x2679('0x10')](_0x561ff3,_0x2679('0x11'),_0x2679('0x12'));_0x4bd649+=_0x42082d[_0x2679('0x13')](_0x2679('0x12'));var _0x4cc952=JSON[_0x2679('0x14')](_0x4bd649);_0x4cc952[_0x2679('0x15')]=![];_0x4cc952[_0x2679('0x16')]=_0x485ec8;_0x4cc952[_0x2679('0x17')]=hardware[_0x2679('0x18')]();if(_0x161e1a){var _0x3dbe7b=crypto[_0x2679('0xc')](_0x2679('0xd'),config[_0x2679('0x19')]['session']);var _0x1144c4=_0x3dbe7b[_0x2679('0x10')](_0x161e1a,_0x2679('0x11'),_0x2679('0x12'));_0x1144c4+=_0x3dbe7b['final']('utf8');_0x4cc952[_0x2679('0x1a')]=_0x1144c4;_0x4cc952[_0x2679('0x1b')]=moment(_0x1144c4)['add'](0x7,_0x2679('0x1c'))[_0x2679('0xe')]();_0x4cc952[_0x2679('0x1d')]=_0x4cc952[_0x2679('0x16')]!=_0x4cc952['machineUuid']?_0x2679('0x1e'):_0x2679('0x1f');}return _0x4cc952;}catch(_0x332501){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x2679('0x20'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x2679('0x21'),'uuid':_0x295ae0[_0x2679('0x9')],'machineUuid':hardware['getUuid'](),'message':_0x332501[_0x2679('0x22')],'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'appzone':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x2679('0x20'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','uuid':_0x295ae0[_0x2679('0x9')],'machineUuid':hardware[_0x2679('0x18')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'appzone':![]};}exports[_0x2679('0x23')]=function(_0x56f440){return db[_0x2679('0x24')]['find'](_[_0x2679('0x25')](_0x56f440,{'raw':!![],'where':{'id':0x1}}))[_0x2679('0x26')](function(_0x33c185){return checkLicense(_0x33c185,null);});};exports[_0x2679('0x27')]=checkLicense; \ No newline at end of file +var _0x784e=['Demo\x20license','getLicense','License','defaults','then','crypto','util','moment','./hardware','../environment','isEmpty','License\x20key\x20value\x20not\x20found','data1','data2','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','utf8','final','parse','machineUuid','getUuid','secrets','base64','gray','deadline','days','grayReason','uuid','changed','2027-01-01T00:00:00.000Z','Breaking\x20license','message'];(function(_0x4e789e,_0x1372de){var _0x1bd5e2=function(_0x13099e){while(--_0x13099e){_0x4e789e['push'](_0x4e789e['shift']());}};_0x1bd5e2(++_0x1372de);}(_0x784e,0x125));var _0xe784=function(_0x27e5ce,_0x441236){_0x27e5ce=_0x27e5ce-0x0;var _0x50d685=_0x784e[_0x27e5ce];return _0x50d685;};'use strict';var crypto=require(_0xe784('0x0'));var util=require(_0xe784('0x1'));var _=require('lodash');var moment=require(_0xe784('0x2'));var hardware=require(_0xe784('0x3'));var config=require(_0xe784('0x4'));var db=require('../../mysqldb')['db'];function checkLicense(_0x10ee4a,_0x10f501){if(_0x10ee4a){try{var _0x4259b5=_0x10f501||_0x10ee4a['license'];if(_[_0xe784('0x5')](_0x4259b5)){throw new Error(_0xe784('0x6'));}var _0x225b2e=_0x10ee4a[_0xe784('0x7')];var _0x32057a=_0x10ee4a[_0xe784('0x8')];var _0x3576cb=_0x225b2e['split']('-')[0x4];var _0x7d1b5b=_0x225b2e[_0xe784('0x9')]('-')[0x0];var _0x2de47d=crypto[_0xe784('0xa')](_0xe784('0xb'),util[_0xe784('0xc')](_0xe784('0xd'),_0x3576cb,_0x225b2e,_0x7d1b5b));var _0x1b2c25=_0x2de47d[_0xe784('0xe')](_0x4259b5,'base64',_0xe784('0xf'));_0x1b2c25+=_0x2de47d[_0xe784('0x10')](_0xe784('0xf'));var _0x183954=JSON[_0xe784('0x11')](_0x1b2c25);_0x183954['demo']=![];_0x183954['uuid']=_0x225b2e;_0x183954[_0xe784('0x12')]=hardware[_0xe784('0x13')]();if(_0x32057a){var _0x103b1a=crypto[_0xe784('0xa')](_0xe784('0xb'),config[_0xe784('0x14')]['session']);var _0x2bbf01=_0x103b1a[_0xe784('0xe')](_0x32057a,_0xe784('0x15'),'utf8');_0x2bbf01+=_0x103b1a[_0xe784('0x10')](_0xe784('0xf'));_0x183954[_0xe784('0x16')]=_0x2bbf01;_0x183954[_0xe784('0x17')]=moment(_0x2bbf01)['add'](0x7,_0xe784('0x18'))[_0xe784('0xc')]();_0x183954[_0xe784('0x19')]=_0x183954[_0xe784('0x1a')]!=_0x183954[_0xe784('0x12')]?_0xe784('0x1b'):'disabled';}return _0x183954;}catch(_0x44576b){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xe784('0x1c'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xe784('0x1d'),'uuid':_0x10ee4a[_0xe784('0x7')],'machineUuid':hardware[_0xe784('0x13')](),'message':_0x44576b[_0xe784('0x1e')],'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'appzone':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xe784('0x1c'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xe784('0x1f'),'uuid':_0x10ee4a[_0xe784('0x7')],'machineUuid':hardware[_0xe784('0x13')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'appzone':![]};}exports[_0xe784('0x20')]=function(_0x4ae439){return db[_0xe784('0x21')]['find'](_[_0xe784('0x22')](_0x4ae439,{'raw':!![],'where':{'id':0x1}}))[_0xe784('0x23')](function(_0x42945d){return checkLicense(_0x42945d,null);});};exports['checkLicense']=checkLicense; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index 16de677..21360b1 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 _0xa968=['exports','http://localhost:9000','myappanuglar-secret','secret'];(function(_0x131acd,_0xab927){var _0xdfc70f=function(_0x3cba77){while(--_0x3cba77){_0x131acd['push'](_0x131acd['shift']());}};_0xdfc70f(++_0xab927);}(_0xa968,0x120));var _0x8a96=function(_0x4114a0,_0x5c1bae){_0x4114a0=_0x4114a0-0x0;var _0x23ddd6=_0xa968[_0x4114a0];return _0x23ddd6;};'use strict';module[_0x8a96('0x0')]={'DOMAIN':_0x8a96('0x1'),'SESSION_SECRET':_0x8a96('0x2'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':_0x8a96('0x3'),'DEBUG':''}; \ No newline at end of file +var _0xdc83=['exports','http://localhost:9000','myappanuglar-secret','secret'];(function(_0x116573,_0x234dde){var _0x4274e0=function(_0x5a3da4){while(--_0x5a3da4){_0x116573['push'](_0x116573['shift']());}};_0x4274e0(++_0x234dde);}(_0xdc83,0x104));var _0x3dc8=function(_0x3539cf,_0x197081){_0x3539cf=_0x3539cf-0x0;var _0xb3f48d=_0xdc83[_0x3539cf];return _0xb3f48d;};'use strict';module[_0x3dc8('0x0')]={'DOMAIN':_0x3dc8('0x1'),'SESSION_SECRET':_0x3dc8('0x2'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':_0x3dc8('0x3'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 21a933b..88b340f 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x12d3=['path','INFO','join','/var','log','xcally','format','[%s]\x20[%s]\x20%s\x20-\x20%s','level','toUpperCase','message','transports','File','%s-%s','error','info','Console','env','debugLevel','moment'];(function(_0x3af85d,_0x3c1c47){var _0x4e973a=function(_0xdb23c9){while(--_0xdb23c9){_0x3af85d['push'](_0x3af85d['shift']());}};_0x4e973a(++_0x3c1c47);}(_0x12d3,0x18f));var _0x312d=function(_0xf3d5f7,_0x37313e){_0xf3d5f7=_0xf3d5f7-0x0;var _0x50c92a=_0x12d3[_0xf3d5f7];return _0x50c92a;};'use strict';var moment=require(_0x312d('0x0'));var winston=require('winston');var util=require('util');var path=require(_0x312d('0x1'));var debugLevel=_0x312d('0x2');function filename(_0x1ef391,_0x225cee){return path[_0x312d('0x3')](_0x312d('0x4'),_0x312d('0x5'),_0x312d('0x6'),util[_0x312d('0x7')]('%s-%s.log',_0x1ef391,_0x225cee));}function formatter(_0x6cf6ae,_0x293f70){return util[_0x312d('0x7')](_0x312d('0x8'),moment()[_0x312d('0x7')]('YYYY-MM-DD\x20HH:mm:ss'),_0x293f70[_0x312d('0x9')][_0x312d('0xa')](),_0x6cf6ae,_0x293f70[_0x312d('0xb')]);}module['exports']=function(_0x2425c2){return new winston['Logger']({'transports':[new winston[(_0x312d('0xc'))][(_0x312d('0xd'))]({'name':util[_0x312d('0x7')](_0x312d('0xe'),_0x2425c2,'error'),'filename':filename(_0x2425c2,_0x312d('0xf')),'level':_0x312d('0xf'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x2b749e){return formatter(_0x2425c2,_0x2b749e);}}),new winston[(_0x312d('0xc'))][(_0x312d('0xd'))]({'name':util[_0x312d('0x7')]('%s-%s',_0x2425c2,'info'),'filename':filename(_0x2425c2,_0x312d('0x10')),'level':_0x312d('0x10'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x224c68){return formatter(_0x2425c2,_0x224c68);}}),new winston[(_0x312d('0xc'))][(_0x312d('0x11'))]({'level':process[_0x312d('0x12')][_0x312d('0x13')]||debugLevel,'json':![],'formatter':function(_0x1b6958){return formatter(_0x2425c2,_0x1b6958);}})]});}; \ No newline at end of file +var _0x184b=['File','error','%s-%s','info','Console','env','debugLevel','moment','util','path','INFO','join','xcally','format','%s-%s.log','[%s]\x20[%s]\x20%s\x20-\x20%s','level','toUpperCase','exports','Logger','transports'];(function(_0x357fbd,_0x310516){var _0xf84d92=function(_0x3ee154){while(--_0x3ee154){_0x357fbd['push'](_0x357fbd['shift']());}};_0xf84d92(++_0x310516);}(_0x184b,0xaf));var _0xb184=function(_0x2f7b7f,_0x398b24){_0x2f7b7f=_0x2f7b7f-0x0;var _0xbd9c7a=_0x184b[_0x2f7b7f];return _0xbd9c7a;};'use strict';var moment=require(_0xb184('0x0'));var winston=require('winston');var util=require(_0xb184('0x1'));var path=require(_0xb184('0x2'));var debugLevel=_0xb184('0x3');function filename(_0xe00dae,_0x2196df){return path[_0xb184('0x4')]('/var','log',_0xb184('0x5'),util[_0xb184('0x6')](_0xb184('0x7'),_0xe00dae,_0x2196df));}function formatter(_0x545e81,_0x5b3f6d){return util['format'](_0xb184('0x8'),moment()[_0xb184('0x6')]('YYYY-MM-DD\x20HH:mm:ss'),_0x5b3f6d[_0xb184('0x9')][_0xb184('0xa')](),_0x545e81,_0x5b3f6d['message']);}module[_0xb184('0xb')]=function(_0x2b3118){return new winston[(_0xb184('0xc'))]({'transports':[new winston[(_0xb184('0xd'))][(_0xb184('0xe'))]({'name':util[_0xb184('0x6')]('%s-%s',_0x2b3118,_0xb184('0xf')),'filename':filename(_0x2b3118,'error'),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x4072ab){return formatter(_0x2b3118,_0x4072ab);}}),new winston[(_0xb184('0xd'))][(_0xb184('0xe'))]({'name':util['format'](_0xb184('0x10'),_0x2b3118,_0xb184('0x11')),'filename':filename(_0x2b3118,_0xb184('0x11')),'level':_0xb184('0x11'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x49befa){return formatter(_0x2b3118,_0x49befa);}}),new winston[(_0xb184('0xd'))][(_0xb184('0x12'))]({'level':process[_0xb184('0x13')][_0xb184('0x14')]||debugLevel,'json':![],'formatter':function(_0x49474f){return formatter(_0x2b3118,_0x49474f);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index a63cdd3..1e76d96 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 _0x2e35=['xdr','exports','path','express','join','ami','../../services/ami/index.js','agi','../../services/agi/index.js','email','../../services/email/index.js'];(function(_0x359743,_0x3e0f07){var _0x57f84a=function(_0xae4813){while(--_0xae4813){_0x359743['push'](_0x359743['shift']());}};_0x57f84a(++_0x3e0f07);}(_0x2e35,0x1d0));var _0x52e3=function(_0x53cc5c,_0x5191a4){_0x53cc5c=_0x53cc5c-0x0;var _0x50b4b0=_0x2e35[_0x53cc5c];return _0x50b4b0;};'use strict';var path=require(_0x52e3('0x0'));var os=require('os');var config={'apps':[{'name':_0x52e3('0x1'),'script':path[_0x52e3('0x2')](__dirname,'../../services/express/index.js')},{'name':_0x52e3('0x3'),'script':path[_0x52e3('0x2')](__dirname,_0x52e3('0x4'))},{'name':_0x52e3('0x5'),'script':path['join'](__dirname,_0x52e3('0x6'))},{'name':_0x52e3('0x7'),'script':path[_0x52e3('0x2')](__dirname,_0x52e3('0x8'))},{'name':'routing','script':path['join'](__dirname,'../../services/routing/index.js')},{'name':_0x52e3('0x9'),'script':path['join'](__dirname,'../../services/xdr/index.js')}]};module[_0x52e3('0xa')]=config; \ No newline at end of file +var _0xe700=['../../services/agi/index.js','../../services/email/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','path','express','join','ami','agi'];(function(_0x4f693c,_0x5dc87a){var _0x3a7974=function(_0x45e100){while(--_0x45e100){_0x4f693c['push'](_0x4f693c['shift']());}};_0x3a7974(++_0x5dc87a);}(_0xe700,0xf7));var _0x0e70=function(_0x3c6b47,_0x3721ee){_0x3c6b47=_0x3c6b47-0x0;var _0x1c841a=_0xe700[_0x3c6b47];return _0x1c841a;};'use strict';var path=require(_0x0e70('0x0'));var os=require('os');var config={'apps':[{'name':_0x0e70('0x1'),'script':path[_0x0e70('0x2')](__dirname,'../../services/express/index.js')},{'name':_0x0e70('0x3'),'script':path['join'](__dirname,'../../services/ami/index.js')},{'name':_0x0e70('0x4'),'script':path[_0x0e70('0x2')](__dirname,_0x0e70('0x5'))},{'name':'email','script':path[_0x0e70('0x2')](__dirname,_0x0e70('0x6'))},{'name':_0x0e70('0x7'),'script':path[_0x0e70('0x2')](__dirname,_0x0e70('0x8'))},{'name':_0x0e70('0x9'),'script':path[_0x0e70('0x2')](__dirname,_0x0e70('0xa'))}]};module[_0x0e70('0xb')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 485c2c8..438be17 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 _0x7e1e=['then','disconnect','stop','restart','list','describe','delete','dump','saved','pm2','bluebird','./config','connect','start'];(function(_0x2f2763,_0x4d9637){var _0x442362=function(_0xaed4fa){while(--_0xaed4fa){_0x2f2763['push'](_0x2f2763['shift']());}};_0x442362(++_0x4d9637);}(_0x7e1e,0x183));var _0xe7e1=function(_0x3b3190,_0x473466){_0x3b3190=_0x3b3190-0x0;var _0x766d25=_0x7e1e[_0x3b3190];return _0x766d25;};'use strict';var pm2=require(_0xe7e1('0x0'));var BPromise=require(_0xe7e1('0x1'));var config=require(_0xe7e1('0x2'));function connect(){return new BPromise(function(_0x2050e6,_0x584966){return pm2[_0xe7e1('0x3')](function(_0x30b599){if(_0x30b599){return _0x584966(_0x30b599);}return _0x2050e6('connected');});});};exports[_0xe7e1('0x4')]=function(_0x1fa1fd){return connect()[_0xe7e1('0x5')](function(){return new BPromise(function(_0x3f5030,_0x55da3d){return pm2[_0xe7e1('0x4')](_0x1fa1fd,function(_0xecc921,_0x230d8a){if(_0xecc921){return _0x55da3d(_0xecc921);}pm2[_0xe7e1('0x6')]();return _0x3f5030(_0x230d8a);});});});};exports[_0xe7e1('0x7')]=function(_0x35bbd0){return connect()[_0xe7e1('0x5')](function(){return new BPromise(function(_0xf395b3,_0x2a6bc9){return pm2[_0xe7e1('0x7')](_0x35bbd0,function(_0x1b2a4e,_0x192b8a){if(_0x1b2a4e){return _0x2a6bc9(_0x1b2a4e);}pm2['disconnect']();return _0xf395b3(_0x192b8a);});});});};exports[_0xe7e1('0x8')]=function(_0x23b536){return connect()[_0xe7e1('0x5')](function(){return new BPromise(function(_0x1f39be,_0x4b09a2){return pm2[_0xe7e1('0x8')](_0x23b536,function(_0x273484,_0x2b9ffd){if(_0x273484){return _0x4b09a2(_0x273484);}pm2[_0xe7e1('0x6')]();return _0x1f39be(_0x2b9ffd);});});});};exports[_0xe7e1('0x9')]=function(){return connect()[_0xe7e1('0x5')](function(){return new BPromise(function(_0x33843d,_0x5ac57a){return pm2['list'](function(_0x207d51,_0x189c17){if(_0x207d51){return _0x5ac57a(_0x207d51);}pm2[_0xe7e1('0x6')]();return _0x33843d(_0x189c17);});});});};exports['describe']=function(_0x3219aa){return connect()[_0xe7e1('0x5')](function(){return new BPromise(function(_0x2732d4,_0x46c1f6){return pm2[_0xe7e1('0xa')](_0x3219aa,function(_0x31e6fb,_0x2c193f){if(_0x31e6fb){return _0x46c1f6(_0x31e6fb);}pm2[_0xe7e1('0x6')]();return _0x2732d4(_0x2c193f);});});});};exports['delete']=function(_0x2a3b0f){return connect()[_0xe7e1('0x5')](function(){return new BPromise(function(_0x13dd08,_0x5ad153){return pm2[_0xe7e1('0xb')](_0x2a3b0f,function(_0x2a284f,_0x15f7e5){if(_0x2a284f){return _0x5ad153(_0x2a284f);}pm2[_0xe7e1('0x6')]();return _0x13dd08(_0x15f7e5);});});});};exports[_0xe7e1('0xc')]=function(){return connect()[_0xe7e1('0x5')](function(){return new BPromise(function(_0x783ea2,_0x43997f){return pm2[_0xe7e1('0xc')](function(_0x2ec709){if(_0x2ec709){return _0x43997f(_0x2ec709);}return _0x783ea2(_0xe7e1('0xd'));});});});}; \ No newline at end of file +var _0x644f=['connect','connected','start','then','stop','disconnect','restart','list','describe','delete','dump','saved','pm2','bluebird'];(function(_0x296144,_0x26bbbf){var _0x5329b1=function(_0x5d321b){while(--_0x5d321b){_0x296144['push'](_0x296144['shift']());}};_0x5329b1(++_0x26bbbf);}(_0x644f,0xc2));var _0xf644=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0x644f[_0xaa1b3e];return _0x454d7d;};'use strict';var pm2=require(_0xf644('0x0'));var BPromise=require(_0xf644('0x1'));var config=require('./config');function connect(){return new BPromise(function(_0x4c36ba,_0x19242f){return pm2[_0xf644('0x2')](function(_0x240500){if(_0x240500){return _0x19242f(_0x240500);}return _0x4c36ba(_0xf644('0x3'));});});};exports[_0xf644('0x4')]=function(_0x3759da){return connect()[_0xf644('0x5')](function(){return new BPromise(function(_0x639a71,_0x9938ed){return pm2[_0xf644('0x4')](_0x3759da,function(_0x2c7aaf,_0x454018){if(_0x2c7aaf){return _0x9938ed(_0x2c7aaf);}pm2['disconnect']();return _0x639a71(_0x454018);});});});};exports[_0xf644('0x6')]=function(_0x11fa91){return connect()['then'](function(){return new BPromise(function(_0x127499,_0x5746ae){return pm2['stop'](_0x11fa91,function(_0x390284,_0x4a490d){if(_0x390284){return _0x5746ae(_0x390284);}pm2[_0xf644('0x7')]();return _0x127499(_0x4a490d);});});});};exports[_0xf644('0x8')]=function(_0x4d0b61){return connect()[_0xf644('0x5')](function(){return new BPromise(function(_0x27c7c5,_0x1ef872){return pm2['restart'](_0x4d0b61,function(_0x296647,_0x301425){if(_0x296647){return _0x1ef872(_0x296647);}pm2['disconnect']();return _0x27c7c5(_0x301425);});});});};exports[_0xf644('0x9')]=function(){return connect()[_0xf644('0x5')](function(){return new BPromise(function(_0x4ed4d6,_0x400906){return pm2[_0xf644('0x9')](function(_0x228cf7,_0x14d787){if(_0x228cf7){return _0x400906(_0x228cf7);}pm2['disconnect']();return _0x4ed4d6(_0x14d787);});});});};exports[_0xf644('0xa')]=function(_0xc0182){return connect()['then'](function(){return new BPromise(function(_0x5b0b81,_0x4c197b){return pm2['describe'](_0xc0182,function(_0x2587f5,_0x331478){if(_0x2587f5){return _0x4c197b(_0x2587f5);}pm2[_0xf644('0x7')]();return _0x5b0b81(_0x331478);});});});};exports[_0xf644('0xb')]=function(_0x5f38f9){return connect()[_0xf644('0x5')](function(){return new BPromise(function(_0x15d065,_0x4650b5){return pm2[_0xf644('0xb')](_0x5f38f9,function(_0x1846c7,_0x57cdcc){if(_0x1846c7){return _0x4650b5(_0x1846c7);}pm2['disconnect']();return _0x15d065(_0x57cdcc);});});});};exports[_0xf644('0xc')]=function(){return connect()[_0xf644('0x5')](function(){return new BPromise(function(_0x6d3229,_0x6a8936){return pm2[_0xf644('0xc')](function(_0x2bc954){if(_0x2bc954){return _0x6a8936(_0x2bc954);}return _0x6d3229(_0xf644('0xd'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 52ed4ab..39da22a 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 _0x6a67=['map','emit','catch','error','start','lodash','moment','../../mysqldb','../../config/environment','redis','defaults','localhost','socket.io-emitter','Setting','find','then','chatTimeout','ChatInteraction','findAll','lastMsgAt','subtract','minutes','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x3c0ee1,_0x3702ce){var _0x35d80f=function(_0x5cec83){while(--_0x5cec83){_0x3c0ee1['push'](_0x3c0ee1['shift']());}};_0x35d80f(++_0x3702ce);}(_0x6a67,0x13d));var _0x76a6=function(_0x393500,_0x1037af){_0x393500=_0x393500-0x0;var _0x120d3b=_0x6a67[_0x393500];return _0x120d3b;};'use strict';var _=require(_0x76a6('0x0'));var moment=require(_0x76a6('0x1'));var Redis=require('ioredis');var db=require(_0x76a6('0x2'))['db'];var config=require(_0x76a6('0x3'));config[_0x76a6('0x4')]=_[_0x76a6('0x5')](config[_0x76a6('0x4')],{'host':_0x76a6('0x6'),'port':0x18eb});var io=require(_0x76a6('0x7'))(new Redis(config[_0x76a6('0x4')]));function closeInteractions(){var _0x35d46f=0x0;var _0x1d6601=[];return db[_0x76a6('0x8')][_0x76a6('0x9')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0x76a6('0xa')](function(_0x307095){_0x35d46f=_0x307095[_0x76a6('0xb')];if(_0x35d46f){return db[_0x76a6('0xc')][_0x76a6('0xd')]({'raw':!![],'attributes':['id',_0x76a6('0xe')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x76a6('0xf')](_0x307095['chatTimeout'],_0x76a6('0x10'))}}});}else{return[];}})[_0x76a6('0xa')](function(_0x4d34eb){_0x1d6601=_0x4d34eb;if(_0x35d46f){return db[_0x76a6('0xc')]['update']({'closeReason':_0x76a6('0x11'),'disposition':_0x76a6('0x12'),'closed':!![],'closedAt':moment()[_0x76a6('0x13')](_0x76a6('0x14'))},{'where':{'id':_[_0x76a6('0x15')](_0x1d6601||[],'id')}});}})[_0x76a6('0xa')](function(_0x105903){for(var _0x347d93=0x0;_0x347d93<_0x1d6601['length'];_0x347d93++){io[_0x76a6('0x16')]('chatInteraction:update',{'id':_0x1d6601[_0x347d93]['id'],'closed':!![]});}})[_0x76a6('0x17')](function(_0x4278cb){console[_0x76a6('0x18')](_0x4278cb);});}exports[_0x76a6('0x19')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x395d=['catch','lodash','moment','ioredis','../../mysqldb','redis','defaults','localhost','socket.io-emitter','Setting','chatTimeout','then','ChatInteraction','findAll','subtract','minutes','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','map','length'];(function(_0x2622d3,_0x3ad014){var _0x18c615=function(_0x38b0ca){while(--_0x38b0ca){_0x2622d3['push'](_0x2622d3['shift']());}};_0x18c615(++_0x3ad014);}(_0x395d,0x143));var _0xd395=function(_0x135220,_0x181b3e){_0x135220=_0x135220-0x0;var _0x12f252=_0x395d[_0x135220];return _0x12f252;};'use strict';var _=require(_0xd395('0x0'));var moment=require(_0xd395('0x1'));var Redis=require(_0xd395('0x2'));var db=require(_0xd395('0x3'))['db'];var config=require('../../config/environment');config[_0xd395('0x4')]=_[_0xd395('0x5')](config[_0xd395('0x4')],{'host':_0xd395('0x6'),'port':0x18eb});var io=require(_0xd395('0x7'))(new Redis(config['redis']));function closeInteractions(){var _0xe7e65b=0x0;var _0x249189=[];return db[_0xd395('0x8')]['find']({'raw':!![],'attributes':['id',_0xd395('0x9')],'where':{'id':0x1}})[_0xd395('0xa')](function(_0x2a8bca){_0xe7e65b=_0x2a8bca[_0xd395('0x9')];if(_0xe7e65b){return db[_0xd395('0xb')][_0xd395('0xc')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xd395('0xd')](_0x2a8bca[_0xd395('0x9')],_0xd395('0xe'))}}});}else{return[];}})[_0xd395('0xa')](function(_0x3b351b){_0x249189=_0x3b351b;if(_0xe7e65b){return db[_0xd395('0xb')][_0xd395('0xf')]({'closeReason':_0xd395('0x10'),'disposition':_0xd395('0x11'),'closed':!![],'closedAt':moment()[_0xd395('0x12')](_0xd395('0x13'))},{'where':{'id':_[_0xd395('0x14')](_0x249189||[],'id')}});}})[_0xd395('0xa')](function(_0x39ead7){for(var _0x3622ca=0x0;_0x3622ca<_0x249189[_0xd395('0x15')];_0x3622ca++){io['emit']('chatInteraction:update',{'id':_0x249189[_0x3622ca]['id'],'closed':!![]});}})[_0xd395('0x16')](function(_0x14e95c){console['error'](_0x14e95c);});}exports['start']=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 3ea3f2f..7ecc2a1 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 _0xd874=['add','add\x20cron','update\x20cron','stop\x20cron','run','start','util','path','lodash','moment','cron-job-manager','jayson/promise','bluebird','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','MailAccount','Smtp','service','host','port','secure','authentication','auth','user','format','\x22%s\x22\x20<%s>','name','email','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','savename','basename','extname','zip','join','status','Sent','message','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','existsSync','attachments','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','then','error','error\x20mail','email\x20sent','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','Schedule','MailServerOut','keys','jobs','keyBy','toString','intersection','difference','length','exists','stop','toRun','index','my\x20id','resolve','run\x20job','cron','active','isBetween','startAt','endAt'];(function(_0x2a75da,_0x1c2954){var _0x4e5cc4=function(_0x4ddeb6){while(--_0x4ddeb6){_0x2a75da['push'](_0x2a75da['shift']());}};_0x4e5cc4(++_0x1c2954);}(_0xd874,0xba));var _0x4d87=function(_0x54454a,_0x5f31c9){_0x54454a=_0x54454a-0x0;var _0x47049d=_0xd874[_0x54454a];return _0x47049d;};'use strict';var fs=require('fs');var util=require(_0x4d87('0x0'));var path=require(_0x4d87('0x1'));var _=require(_0x4d87('0x2'));var moment=require(_0x4d87('0x3'));var CronJobManager=require(_0x4d87('0x4'));var jayson=require(_0x4d87('0x5'));var BPromise=require(_0x4d87('0x6'));var logger=require('../logger')('schedule');var db=require(_0x4d87('0x7'))['db'];var analyticCustomReportController=require(_0x4d87('0x8'));var analyticDefaultReportController=require(_0x4d87('0x9'));var client=jayson[_0x4d87('0xa')][_0x4d87('0xb')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x45a6c6,_0x3fbdc5){return function(){logger[_0x4d87('0xc')](_0x4d87('0xd'),_0x45a6c6['email']);var _0x1dc3a5=!![];var _0x330db7={'tls':{'rejectUnauthorized':![]}};if(_0x45a6c6[_0x4d87('0xe')][_0x4d87('0xf')]['service']){_0x330db7[_0x4d87('0x10')]=_0x45a6c6['MailAccount'][_0x4d87('0xf')][_0x4d87('0x10')];}else{_0x330db7[_0x4d87('0x11')]=_0x45a6c6[_0x4d87('0xe')][_0x4d87('0xf')][_0x4d87('0x11')];_0x330db7[_0x4d87('0x12')]=_0x45a6c6[_0x4d87('0xe')][_0x4d87('0xf')][_0x4d87('0x12')];_0x330db7[_0x4d87('0x13')]=_0x45a6c6[_0x4d87('0xe')][_0x4d87('0xf')]['secure'];}if(_0x45a6c6[_0x4d87('0xe')][_0x4d87('0xf')][_0x4d87('0x14')]){_0x330db7[_0x4d87('0x15')]={'user':_0x45a6c6[_0x4d87('0xe')][_0x4d87('0xf')][_0x4d87('0x16')],'pass':_0x45a6c6['MailAccount']['Smtp']['pass']};}var _0x30d9d5={'account':_0x330db7,'message':{'from':util[_0x4d87('0x17')](_0x4d87('0x18'),_0x45a6c6[_0x4d87('0xe')][_0x4d87('0x19')],_0x45a6c6[_0x4d87('0xe')][_0x4d87('0x1a')]||_0x45a6c6[_0x4d87('0xe')]['Smtp'][_0x4d87('0x16')]),'to':_0x45a6c6['email'],'cc':_0x45a6c6['cc'],'bcc':_0x45a6c6[_0x4d87('0x1b')],'subject':util[_0x4d87('0x17')](_0x4d87('0x1c'),_0x3fbdc5[_0x4d87('0x19')],_0x45a6c6[_0x4d87('0x1d')],_0x45a6c6[_0x4d87('0x1e')])}};var _0xc0fba6=path['join'](__dirname,'../../files/reports');var _0x2207b1=_0x3fbdc5[_0x4d87('0x1f')];var _0x55597e=util['format']('%s.%s',path[_0x4d87('0x20')](_0x3fbdc5['savename'],path[_0x4d87('0x21')](_0x3fbdc5[_0x4d87('0x1f')])),_0x4d87('0x22'));var _0x13b1f8=path[_0x4d87('0x23')](_0xc0fba6,_0x2207b1);var _0x5afb6d=path[_0x4d87('0x23')](_0xc0fba6,_0x55597e);if(fs['existsSync'](_0x13b1f8)){_0x3fbdc5[_0x4d87('0x24')]=_0x4d87('0x25');_0x30d9d5[_0x4d87('0x26')]['attachments']=[{'filename':_0x2207b1,'path':_0x13b1f8}];_0x30d9d5['message']['text']=util[_0x4d87('0x17')](_0x4d87('0x27'),JSON[_0x4d87('0x28')](_0x3fbdc5,null,0x2));}else if(fs[_0x4d87('0x29')](_0x5afb6d)){_0x3fbdc5[_0x4d87('0x24')]=_0x4d87('0x25');_0x30d9d5[_0x4d87('0x26')][_0x4d87('0x2a')]=[{'filename':_0x55597e,'path':_0x5afb6d}];}else{_0x30d9d5['message']['text']=_0x4d87('0x2b');if(!_0x45a6c6[_0x4d87('0x2c')]){_0x1dc3a5=![];logger[_0x4d87('0xc')](_0x4d87('0x2d'));}}if(_0x1dc3a5){return client['request']('SendMail',_0x30d9d5)[_0x4d87('0x2e')](function(_0x249503){if(_0x249503[_0x4d87('0x2f')]){return logger[_0x4d87('0x2f')](_0x4d87('0x30'),JSON[_0x4d87('0x28')](_0x249503));}return logger[_0x4d87('0xc')](_0x4d87('0x31'));})[_0x4d87('0x32')](function(_0x4a16e8){return logger[_0x4d87('0x2f')](_0x4d87('0x30'),JSON['stringify'](_0x4a16e8));});}};}function handleError(){return function(_0x5b23b9){return logger[_0x4d87('0x2f')](JSON[_0x4d87('0x28')](_0x5b23b9));};}function handleResult(_0x4c227d){return function(_0x5ab081){logger[_0x4d87('0xc')](_0x4d87('0x33'),JSON[_0x4d87('0x28')](_0x5ab081));if(_0x4c227d[_0x4d87('0xe')]&&_0x4c227d[_0x4d87('0xe')][_0x4d87('0xf')]&&!_[_0x4d87('0x34')](_0x4c227d[_0x4d87('0x1a')])){setTimeout(handleSendEmail(_0x4c227d,_0x5ab081),0x3c*0x3e8);}};}function handleJob(_0xa39ba4){return function(){try{if(_['isNil'](_0xa39ba4[_0x4d87('0x1d')])){return logger['info'](_0x4d87('0x35'));}if(_[_0x4d87('0x34')](_0xa39ba4['subtractUnit'])){return logger[_0x4d87('0xc')](_0x4d87('0x36'));}var _0x3381e3={'startDate':moment()['subtract'](_0xa39ba4['subtractNumber'],_0xa39ba4[_0x4d87('0x1e')])['format'](_0x4d87('0x37')),'endDate':moment()[_0x4d87('0x17')](_0x4d87('0x37')),'type':_0x4d87('0x38'),'output':_0xa39ba4[_0x4d87('0x39')],'name':_0xa39ba4[_0x4d87('0x19')]};if(!_['isNil'](_0xa39ba4[_0x4d87('0x3a')])){logger[_0x4d87('0xc')](_0x4d87('0x3b'),_0xa39ba4['DefaultReportId']);return analyticDefaultReportController[_0x4d87('0x3c')]({'id':_0xa39ba4[_0x4d87('0x3a')]},_0x3381e3)[_0x4d87('0x2e')](handleResult(_0xa39ba4))[_0x4d87('0x32')](handleError());}if(!_['isNil'](_0xa39ba4[_0x4d87('0x3d')])){logger[_0x4d87('0xc')](_0x4d87('0x3e'),_0xa39ba4[_0x4d87('0x3d')]);return analyticCustomReportController['runReport']({'id':_0xa39ba4['CustomReportId']},_0x3381e3)[_0x4d87('0x2e')](handleResult(_0xa39ba4))[_0x4d87('0x32')](handleError());}}catch(_0x16fae3){logger[_0x4d87('0x2f')](JSON[_0x4d87('0x28')](_0x16fae3));}return logger[_0x4d87('0xc')]('no\x20report\x20id');};}function getJobs(_0x627b00){var _0x3aa8a6={};if(_0x627b00){_0x3aa8a6['id']=_0x627b00;}return db[_0x4d87('0x3f')]['findAll']({'where':_0x3aa8a6,'include':[{'model':db[_0x4d87('0xe')],'attributes':['id',_0x4d87('0x19'),_0x4d87('0x1a')],'include':[{'model':db[_0x4d87('0x40')],'as':_0x4d87('0xf')}]}]})['then'](function(_0x2400cd){var _0x4079e8=_[_0x4d87('0x41')](manager[_0x4d87('0x42')]);var _0xf5079e=_['map'](_0x2400cd,function(_0x7a0b07){return _0x7a0b07['id']['toString']();});var _0x6da8a9=_[_0x4d87('0x43')](_0x2400cd,function(_0x326995){return _0x326995['id'][_0x4d87('0x44')]();});var _0x3c5dd7=_0x627b00?_0xf5079e:_['difference'](_0xf5079e,_0x4079e8);var _0x4c2a26=_[_0x4d87('0x45')](_0xf5079e,_0x4079e8);var _0x3a9234=_[_0x4d87('0x46')](_0x4079e8,_0xf5079e);var _0x52565b;var _0x1f4c2f;for(_0x52565b=0x0;_0x52565b<_0x3a9234[_0x4d87('0x47')]&&!_0x627b00;_0x52565b+=0x1){_0x1f4c2f=_0x3a9234[_0x52565b][_0x4d87('0x44')]();if(manager[_0x4d87('0x48')](_0x1f4c2f)){manager[_0x4d87('0x49')](_0x1f4c2f);manager['deleteJob'](_0x1f4c2f);logger[_0x4d87('0xc')]('delete\x20cron',_0x1f4c2f);}}logger['info'](_0x4d87('0x4a'),JSON['stringify'](_0x3c5dd7));for(_0x52565b=0x0;_0x52565b<_0x3c5dd7[_0x4d87('0x47')];_0x52565b+=0x1){_0x1f4c2f=_0x3c5dd7[_0x52565b][_0x4d87('0x44')]();logger[_0x4d87('0xc')](_0x4d87('0x4b'),_0x1f4c2f);if(_0x627b00){logger['info'](_0x4d87('0x4c'),_0x627b00);logger[_0x4d87('0xc')](JSON[_0x4d87('0x28')](_0x6da8a9[_0x1f4c2f]));BPromise[_0x4d87('0x4d')]()[_0x4d87('0x2e')](handleJob(_0x6da8a9[_0x1f4c2f]));logger[_0x4d87('0xc')](_0x4d87('0x4e'),_0x6da8a9[_0x1f4c2f]['name'],_0x6da8a9[_0x1f4c2f][_0x4d87('0x4f')]);}else if(_0x6da8a9[_0x1f4c2f][_0x4d87('0x4f')]&&_0x6da8a9[_0x1f4c2f][_0x4d87('0x50')]&&moment()[_0x4d87('0x51')](_0x6da8a9[_0x1f4c2f][_0x4d87('0x52')],_0x6da8a9[_0x1f4c2f][_0x4d87('0x53')])){manager[_0x4d87('0x54')](_0x1f4c2f,_0x6da8a9[_0x1f4c2f][_0x4d87('0x4f')],handleJob(_0x6da8a9[_0x1f4c2f]));manager['start'](_0x1f4c2f);logger[_0x4d87('0xc')](_0x4d87('0x55'),_0x6da8a9[_0x1f4c2f][_0x4d87('0x19')],_0x6da8a9[_0x1f4c2f][_0x4d87('0x4f')]);}else if(manager[_0x4d87('0x48')](_0x1f4c2f)){manager['stop'](_0x1f4c2f);manager['deleteJob'](_0x1f4c2f);logger[_0x4d87('0xc')]('stop\x20cron',_0x6da8a9[_0x1f4c2f][_0x4d87('0x19')],_0x6da8a9[_0x1f4c2f][_0x4d87('0x4f')]);}}for(_0x52565b=0x0,_0x1f4c2f;_0x52565b<_0x4c2a26[_0x4d87('0x47')]&&!_0x627b00;_0x52565b+=0x1){_0x1f4c2f=_0x4c2a26[_0x52565b]['toString']();if(manager[_0x4d87('0x48')](_0x1f4c2f)){if(_0x6da8a9[_0x1f4c2f][_0x4d87('0x4f')]&&_0x6da8a9[_0x1f4c2f]['active']&&moment()[_0x4d87('0x51')](_0x6da8a9[_0x1f4c2f][_0x4d87('0x52')],_0x6da8a9[_0x1f4c2f][_0x4d87('0x53')])){manager['update'](_0x1f4c2f,_0x6da8a9[_0x1f4c2f][_0x4d87('0x4f')],handleJob(_0x6da8a9[_0x1f4c2f]));logger['info'](_0x4d87('0x56'),_0x6da8a9[_0x1f4c2f]['name'],_0x6da8a9[_0x1f4c2f]['cron']);}else{manager[_0x4d87('0x49')](_0x1f4c2f);manager['deleteJob'](_0x1f4c2f);logger[_0x4d87('0xc')](_0x4d87('0x57'),_0x6da8a9[_0x1f4c2f][_0x4d87('0x19')],_0x6da8a9[_0x1f4c2f][_0x4d87('0x4f')]);}}}})['catch'](function(_0x36d31f){logger['error'](JSON[_0x4d87('0x28')](_0x36d31f));});}exports[_0x4d87('0x58')]=function(_0x3b6fc0){return getJobs(_0x3b6fc0);};exports[_0x4d87('0x59')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0xabab=['Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','attachments','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','info','email\x20sent','catch','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit','subtractUnit\x20null\x20or\x20undefined','subtract','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','Schedule','findAll','jobs','map','toString','keyBy','intersection','difference','exists','stop','deleteJob','delete\x20cron','toRun','length','my\x20id','resolve','run\x20job','active','startAt','endAt','add','cron','start','update\x20cron','run','util','path','lodash','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','client','http','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','Smtp','service','host','port','secure','authentication','auth','pass','\x22%s\x22\x20<%s>','name','user','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','join','../../files/reports','savename','%s.%s','basename','extname','zip','existsSync','status','Sent','message','text','format'];(function(_0x53093e,_0x197539){var _0x2aee9f=function(_0x516855){while(--_0x516855){_0x53093e['push'](_0x53093e['shift']());}};_0x2aee9f(++_0x197539);}(_0xabab,0x1a2));var _0xbaba=function(_0x22e238,_0x162408){_0x22e238=_0x22e238-0x0;var _0x4ea2e5=_0xabab[_0x22e238];return _0x4ea2e5;};'use strict';var fs=require('fs');var util=require(_0xbaba('0x0'));var path=require(_0xbaba('0x1'));var _=require(_0xbaba('0x2'));var moment=require('moment');var CronJobManager=require(_0xbaba('0x3'));var jayson=require(_0xbaba('0x4'));var BPromise=require(_0xbaba('0x5'));var logger=require(_0xbaba('0x6'))(_0xbaba('0x7'));var db=require(_0xbaba('0x8'))['db'];var analyticCustomReportController=require(_0xbaba('0x9'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0xbaba('0xa')][_0xbaba('0xb')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0xe8086e,_0xe6d5f7){return function(){logger['info'](_0xbaba('0xc'),_0xe8086e[_0xbaba('0xd')]);var _0x24f5c0=!![];var _0x134c57={'tls':{'rejectUnauthorized':![]}};if(_0xe8086e[_0xbaba('0xe')][_0xbaba('0xf')]['service']){_0x134c57[_0xbaba('0x10')]=_0xe8086e[_0xbaba('0xe')]['Smtp'][_0xbaba('0x10')];}else{_0x134c57[_0xbaba('0x11')]=_0xe8086e[_0xbaba('0xe')][_0xbaba('0xf')]['host'];_0x134c57[_0xbaba('0x12')]=_0xe8086e[_0xbaba('0xe')][_0xbaba('0xf')][_0xbaba('0x12')];_0x134c57[_0xbaba('0x13')]=_0xe8086e[_0xbaba('0xe')]['Smtp'][_0xbaba('0x13')];}if(_0xe8086e[_0xbaba('0xe')][_0xbaba('0xf')][_0xbaba('0x14')]){_0x134c57[_0xbaba('0x15')]={'user':_0xe8086e['MailAccount'][_0xbaba('0xf')]['user'],'pass':_0xe8086e['MailAccount'][_0xbaba('0xf')][_0xbaba('0x16')]};}var _0x55b85e={'account':_0x134c57,'message':{'from':util['format'](_0xbaba('0x17'),_0xe8086e[_0xbaba('0xe')][_0xbaba('0x18')],_0xe8086e[_0xbaba('0xe')][_0xbaba('0xd')]||_0xe8086e[_0xbaba('0xe')]['Smtp'][_0xbaba('0x19')]),'to':_0xe8086e[_0xbaba('0xd')],'cc':_0xe8086e['cc'],'bcc':_0xe8086e[_0xbaba('0x1a')],'subject':util['format'](_0xbaba('0x1b'),_0xe6d5f7[_0xbaba('0x18')],_0xe8086e[_0xbaba('0x1c')],_0xe8086e['subtractUnit'])}};var _0x3513f2=path[_0xbaba('0x1d')](__dirname,_0xbaba('0x1e'));var _0x446cff=_0xe6d5f7[_0xbaba('0x1f')];var _0x5842d7=util['format'](_0xbaba('0x20'),path[_0xbaba('0x21')](_0xe6d5f7[_0xbaba('0x1f')],path[_0xbaba('0x22')](_0xe6d5f7['savename'])),_0xbaba('0x23'));var _0x3cd009=path[_0xbaba('0x1d')](_0x3513f2,_0x446cff);var _0x51c872=path[_0xbaba('0x1d')](_0x3513f2,_0x5842d7);if(fs[_0xbaba('0x24')](_0x3cd009)){_0xe6d5f7[_0xbaba('0x25')]=_0xbaba('0x26');_0x55b85e[_0xbaba('0x27')]['attachments']=[{'filename':_0x446cff,'path':_0x3cd009}];_0x55b85e[_0xbaba('0x27')][_0xbaba('0x28')]=util[_0xbaba('0x29')](_0xbaba('0x2a'),JSON[_0xbaba('0x2b')](_0xe6d5f7,null,0x2));}else if(fs[_0xbaba('0x24')](_0x51c872)){_0xe6d5f7[_0xbaba('0x25')]=_0xbaba('0x26');_0x55b85e['message'][_0xbaba('0x2c')]=[{'filename':_0x5842d7,'path':_0x51c872}];}else{_0x55b85e[_0xbaba('0x27')][_0xbaba('0x28')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0xe8086e[_0xbaba('0x2d')]){_0x24f5c0=![];logger['info'](_0xbaba('0x2e'));}}if(_0x24f5c0){return client[_0xbaba('0x2f')](_0xbaba('0x30'),_0x55b85e)[_0xbaba('0x31')](function(_0x1b29a2){if(_0x1b29a2[_0xbaba('0x32')]){return logger['error'](_0xbaba('0x33'),JSON[_0xbaba('0x2b')](_0x1b29a2));}return logger[_0xbaba('0x34')](_0xbaba('0x35'));})[_0xbaba('0x36')](function(_0x20f37d){return logger[_0xbaba('0x32')](_0xbaba('0x33'),JSON[_0xbaba('0x2b')](_0x20f37d));});}};}function handleError(){return function(_0x57fa2f){return logger[_0xbaba('0x32')](JSON['stringify'](_0x57fa2f));};}function handleResult(_0x14a8a3){return function(_0x313906){logger[_0xbaba('0x34')]('data',JSON[_0xbaba('0x2b')](_0x313906));if(_0x14a8a3[_0xbaba('0xe')]&&_0x14a8a3['MailAccount']['Smtp']&&!_[_0xbaba('0x37')](_0x14a8a3[_0xbaba('0xd')])){setTimeout(handleSendEmail(_0x14a8a3,_0x313906),0x3c*0x3e8);}};}function handleJob(_0x2031bd){return function(){try{if(_[_0xbaba('0x37')](_0x2031bd[_0xbaba('0x1c')])){return logger[_0xbaba('0x34')](_0xbaba('0x38'));}if(_[_0xbaba('0x37')](_0x2031bd[_0xbaba('0x39')])){return logger['info'](_0xbaba('0x3a'));}var _0x56f60c={'startDate':moment()[_0xbaba('0x3b')](_0x2031bd[_0xbaba('0x1c')],_0x2031bd[_0xbaba('0x39')])[_0xbaba('0x29')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0xbaba('0x29')]('YYYY-MM-DD\x20HH:mm:ss'),'type':_0xbaba('0x3c'),'output':_0x2031bd[_0xbaba('0x3d')],'name':_0x2031bd[_0xbaba('0x18')]};if(!_[_0xbaba('0x37')](_0x2031bd[_0xbaba('0x3e')])){logger[_0xbaba('0x34')](_0xbaba('0x3f'),_0x2031bd['DefaultReportId']);return analyticDefaultReportController[_0xbaba('0x40')]({'id':_0x2031bd['DefaultReportId']},_0x56f60c)['then'](handleResult(_0x2031bd))[_0xbaba('0x36')](handleError());}if(!_[_0xbaba('0x37')](_0x2031bd[_0xbaba('0x41')])){logger[_0xbaba('0x34')](_0xbaba('0x42'),_0x2031bd[_0xbaba('0x41')]);return analyticCustomReportController[_0xbaba('0x40')]({'id':_0x2031bd[_0xbaba('0x41')]},_0x56f60c)[_0xbaba('0x31')](handleResult(_0x2031bd))[_0xbaba('0x36')](handleError());}}catch(_0x54bc7f){logger[_0xbaba('0x32')](JSON[_0xbaba('0x2b')](_0x54bc7f));}return logger[_0xbaba('0x34')]('no\x20report\x20id');};}function getJobs(_0x57cdfb){var _0x2412ee={};if(_0x57cdfb){_0x2412ee['id']=_0x57cdfb;}return db[_0xbaba('0x43')][_0xbaba('0x44')]({'where':_0x2412ee,'include':[{'model':db[_0xbaba('0xe')],'attributes':['id','name','email'],'include':[{'model':db['MailServerOut'],'as':'Smtp'}]}]})[_0xbaba('0x31')](function(_0x2c5045){var _0x2605a4=_['keys'](manager[_0xbaba('0x45')]);var _0x11ed89=_[_0xbaba('0x46')](_0x2c5045,function(_0x27baf2){return _0x27baf2['id'][_0xbaba('0x47')]();});var _0x14e542=_[_0xbaba('0x48')](_0x2c5045,function(_0x22769f){return _0x22769f['id'][_0xbaba('0x47')]();});var _0xfc6bb0=_0x57cdfb?_0x11ed89:_['difference'](_0x11ed89,_0x2605a4);var _0x21d471=_[_0xbaba('0x49')](_0x11ed89,_0x2605a4);var _0x2bfc7c=_[_0xbaba('0x4a')](_0x2605a4,_0x11ed89);var _0x572e49;var _0x5df34a;for(_0x572e49=0x0;_0x572e49<_0x2bfc7c['length']&&!_0x57cdfb;_0x572e49+=0x1){_0x5df34a=_0x2bfc7c[_0x572e49][_0xbaba('0x47')]();if(manager[_0xbaba('0x4b')](_0x5df34a)){manager[_0xbaba('0x4c')](_0x5df34a);manager[_0xbaba('0x4d')](_0x5df34a);logger[_0xbaba('0x34')](_0xbaba('0x4e'),_0x5df34a);}}logger[_0xbaba('0x34')](_0xbaba('0x4f'),JSON[_0xbaba('0x2b')](_0xfc6bb0));for(_0x572e49=0x0;_0x572e49<_0xfc6bb0[_0xbaba('0x50')];_0x572e49+=0x1){_0x5df34a=_0xfc6bb0[_0x572e49][_0xbaba('0x47')]();logger[_0xbaba('0x34')]('index',_0x5df34a);if(_0x57cdfb){logger[_0xbaba('0x34')](_0xbaba('0x51'),_0x57cdfb);logger['info'](JSON['stringify'](_0x14e542[_0x5df34a]));BPromise[_0xbaba('0x52')]()[_0xbaba('0x31')](handleJob(_0x14e542[_0x5df34a]));logger[_0xbaba('0x34')](_0xbaba('0x53'),_0x14e542[_0x5df34a][_0xbaba('0x18')],_0x14e542[_0x5df34a]['cron']);}else if(_0x14e542[_0x5df34a]['cron']&&_0x14e542[_0x5df34a][_0xbaba('0x54')]&&moment()['isBetween'](_0x14e542[_0x5df34a][_0xbaba('0x55')],_0x14e542[_0x5df34a][_0xbaba('0x56')])){manager[_0xbaba('0x57')](_0x5df34a,_0x14e542[_0x5df34a][_0xbaba('0x58')],handleJob(_0x14e542[_0x5df34a]));manager[_0xbaba('0x59')](_0x5df34a);logger[_0xbaba('0x34')]('add\x20cron',_0x14e542[_0x5df34a]['name'],_0x14e542[_0x5df34a][_0xbaba('0x58')]);}else if(manager[_0xbaba('0x4b')](_0x5df34a)){manager[_0xbaba('0x4c')](_0x5df34a);manager[_0xbaba('0x4d')](_0x5df34a);logger[_0xbaba('0x34')]('stop\x20cron',_0x14e542[_0x5df34a][_0xbaba('0x18')],_0x14e542[_0x5df34a][_0xbaba('0x58')]);}}for(_0x572e49=0x0,_0x5df34a;_0x572e49<_0x21d471['length']&&!_0x57cdfb;_0x572e49+=0x1){_0x5df34a=_0x21d471[_0x572e49][_0xbaba('0x47')]();if(manager[_0xbaba('0x4b')](_0x5df34a)){if(_0x14e542[_0x5df34a][_0xbaba('0x58')]&&_0x14e542[_0x5df34a]['active']&&moment()['isBetween'](_0x14e542[_0x5df34a][_0xbaba('0x55')],_0x14e542[_0x5df34a][_0xbaba('0x56')])){manager['update'](_0x5df34a,_0x14e542[_0x5df34a][_0xbaba('0x58')],handleJob(_0x14e542[_0x5df34a]));logger[_0xbaba('0x34')](_0xbaba('0x5a'),_0x14e542[_0x5df34a][_0xbaba('0x18')],_0x14e542[_0x5df34a]['cron']);}else{manager[_0xbaba('0x4c')](_0x5df34a);manager['deleteJob'](_0x5df34a);logger[_0xbaba('0x34')]('stop\x20cron',_0x14e542[_0x5df34a]['name'],_0x14e542[_0x5df34a]['cron']);}}}})[_0xbaba('0x36')](function(_0x3ee15d){logger[_0xbaba('0x32')](JSON[_0xbaba('0x2b')](_0x3ee15d));});}exports[_0xbaba('0x5b')]=function(_0x43bf29){return getJobs(_0x43bf29);};exports[_0xbaba('0x59')]=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 ea1d68d..4a5e4e7 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6a8f=['CmHopper','hopper2','catch','util','../mysqldb','push','Biondo','innocenzo.biondo','now','Innocenzo','@xcally.com','CmContact','then','bulkCreate','log','finished\x20populating','destroy'];(function(_0x1007b9,_0x14ebe3){var _0x3b43d4=function(_0x474010){while(--_0x474010){_0x1007b9['push'](_0x1007b9['shift']());}};_0x3b43d4(++_0x14ebe3);}(_0x6a8f,0x8b));var _0xf6a8=function(_0xc08f00,_0x28067f){_0xc08f00=_0xc08f00-0x0;var _0x8649f7=_0x6a8f[_0xc08f00];return _0x8649f7;};'use strict';var util=require(_0xf6a8('0x0'));var db=require(_0xf6a8('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xf6a8('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0xf6a8('0x3')+i,'phone':0xf879fb460+i,'email':_0xf6a8('0x4')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xf6a8('0x5')](),'updatedAt':Date[_0xf6a8('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xf6a8('0x2')]({'id':i,'firstName':_0xf6a8('0x6')+i,'lastName':_0xf6a8('0x3')+i,'phone':0xf879fb460+i,'email':_0xf6a8('0x4')+i+_0xf6a8('0x7')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xf6a8('0x2')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xf6a8('0x5')](),'updatedAt':Date[_0xf6a8('0x5')]()});}db[_0xf6a8('0x8')]['destroy']({'where':{}})[_0xf6a8('0x9')](function(){return db[_0xf6a8('0x8')][_0xf6a8('0xa')](contacts);})[_0xf6a8('0x9')](function(){console[_0xf6a8('0xb')](_0xf6a8('0xc'),'contacts1');return db['CmHopper'][_0xf6a8('0xd')]({'where':{}});})['then'](function(){return db[_0xf6a8('0xe')][_0xf6a8('0xa')](hopper);})[_0xf6a8('0x9')](function(){console['log'](_0xf6a8('0xc'),'hopper1');return db[_0xf6a8('0x8')][_0xf6a8('0xa')](contacts2);})[_0xf6a8('0x9')](function(){console[_0xf6a8('0xb')](_0xf6a8('0xc'),'contacts2');return db[_0xf6a8('0xe')]['bulkCreate'](hopper2);})[_0xf6a8('0x9')](function(){console['log'](_0xf6a8('0xc'),_0xf6a8('0xf'));})[_0xf6a8('0x10')](function(_0x4b350f){console[_0xf6a8('0xb')](_0x4b350f);}); \ No newline at end of file +var _0xcd6d=['bulkCreate','finished\x20populating','contacts1','CmHopper','log','contacts2','hopper2','../mysqldb','Innocenzo','Biondo','@xcally.com','push','now','CmContact','destroy','then'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xcd6d,0xb7));var _0xdcd6=function(_0x363cac,_0x1f4022){_0x363cac=_0x363cac-0x0;var _0xa5d91b=_0xcd6d[_0x363cac];return _0xa5d91b;};'use strict';var util=require('util');var db=require(_0xdcd6('0x0'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':_0xdcd6('0x1')+i,'lastName':_0xdcd6('0x2')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0xdcd6('0x3')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xdcd6('0x4')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xdcd6('0x5')](),'updatedAt':Date[_0xdcd6('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xdcd6('0x4')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0xdcd6('0x2')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0xdcd6('0x3')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xdcd6('0x4')]({'id':i,'active':![],'scheduledat':Date[_0xdcd6('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0xdcd6('0x5')]()});}db[_0xdcd6('0x6')][_0xdcd6('0x7')]({'where':{}})[_0xdcd6('0x8')](function(){return db['CmContact'][_0xdcd6('0x9')](contacts);})[_0xdcd6('0x8')](function(){console['log'](_0xdcd6('0xa'),_0xdcd6('0xb'));return db[_0xdcd6('0xc')][_0xdcd6('0x7')]({'where':{}});})[_0xdcd6('0x8')](function(){return db['CmHopper'][_0xdcd6('0x9')](hopper);})[_0xdcd6('0x8')](function(){console[_0xdcd6('0xd')](_0xdcd6('0xa'),'hopper1');return db['CmContact'][_0xdcd6('0x9')](contacts2);})[_0xdcd6('0x8')](function(){console['log']('finished\x20populating',_0xdcd6('0xe'));return db[_0xdcd6('0xc')][_0xdcd6('0x9')](hopper2);})['then'](function(){console[_0xdcd6('0xd')](_0xdcd6('0xa'),_0xdcd6('0xf'));})['catch'](function(_0x2603ae){console[_0xdcd6('0xd')](_0x2603ae);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 27dc269..c5bb0a3 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7f1e=['friend','udp','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','../mysqldb','push','format','agent','%s%s','%s%s@xcally.com','password'];(function(_0x1c8cc6,_0x411e5c){var _0x522936=function(_0x38d044){while(--_0x38d044){_0x1c8cc6['push'](_0x1c8cc6['shift']());}};_0x522936(++_0x411e5c);}(_0x7f1e,0x139));var _0xe7f1=function(_0x44ac8f,_0x608d50){_0x44ac8f=_0x44ac8f-0x0;var _0x430169=_0x7f1e[_0x44ac8f];return _0x430169;};'use strict';var util=require('util');var db=require(_0xe7f1('0x0'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xe7f1('0x1')]({'name':util[_0xe7f1('0x2')]('%s%s',_0xe7f1('0x3'),i),'fullname':util['format'](_0xe7f1('0x4'),_0xe7f1('0x3'),i),'email':util[_0xe7f1('0x2')](_0xe7f1('0x5'),'agent',i),'role':_0xe7f1('0x3'),'password':_0xe7f1('0x6'),'internal':0xfa0+i,'type':_0xe7f1('0x7'),'transport':[_0xe7f1('0x8'),'ws','wss'],'disallow':[_0xe7f1('0x9')],'allow':[_0xe7f1('0xa')],'defaultuser':util['format']('%s%s',_0xe7f1('0x3'),i),'encryption':_0xe7f1('0xb'),'avpf':_0xe7f1('0xb'),'force_avp':_0xe7f1('0xb'),'icesupport':_0xe7f1('0xb'),'dtlsenable':_0xe7f1('0xb'),'dtlsverify':'no','dtlscertfile':_0xe7f1('0xc'),'dtlsprivatekey':_0xe7f1('0xd'),'dtlssetup':_0xe7f1('0xe'),'callerid':util['format'](_0xe7f1('0xf'),util['format']('%s%s',_0xe7f1('0x3'),i),0xfa0+i)});}db[_0xe7f1('0x10')][_0xe7f1('0x11')](users)[_0xe7f1('0x12')](function(){console[_0xe7f1('0x13')]('add\x20user');})['catch'](function(_0x5edf4b){console[_0xe7f1('0x13')](_0x5edf4b);}); \ No newline at end of file +var _0x9fc9=['%s%s@xcally.com','password','friend','udp','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','bulkCreate','then','log','add\x20user','util','push','agent','%s%s','format'];(function(_0x524b2a,_0x13e281){var _0x176cc5=function(_0x5c9851){while(--_0x5c9851){_0x524b2a['push'](_0x524b2a['shift']());}};_0x176cc5(++_0x13e281);}(_0x9fc9,0x6d));var _0x99fc=function(_0x19bc6e,_0x461381){_0x19bc6e=_0x19bc6e-0x0;var _0x4d1dfd=_0x9fc9[_0x19bc6e];return _0x4d1dfd;};'use strict';var util=require(_0x99fc('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x99fc('0x1')]({'name':util['format']('%s%s',_0x99fc('0x2'),i),'fullname':util['format'](_0x99fc('0x3'),'agent',i),'email':util[_0x99fc('0x4')](_0x99fc('0x5'),_0x99fc('0x2'),i),'role':_0x99fc('0x2'),'password':_0x99fc('0x6'),'internal':0xfa0+i,'type':_0x99fc('0x7'),'transport':[_0x99fc('0x8'),'ws',_0x99fc('0x9')],'disallow':[_0x99fc('0xa')],'allow':[_0x99fc('0xb')],'defaultuser':util[_0x99fc('0x4')](_0x99fc('0x3'),_0x99fc('0x2'),i),'encryption':_0x99fc('0xc'),'avpf':_0x99fc('0xc'),'force_avp':'yes','icesupport':_0x99fc('0xc'),'dtlsenable':_0x99fc('0xc'),'dtlsverify':'no','dtlscertfile':_0x99fc('0xd'),'dtlsprivatekey':_0x99fc('0xe'),'dtlssetup':'actpass','callerid':util['format']('\x22%s\x22\x20<%s>',util[_0x99fc('0x4')](_0x99fc('0x3'),'agent',i),0xfa0+i)});}db['User'][_0x99fc('0xf')](users)[_0x99fc('0x10')](function(){console[_0x99fc('0x11')](_0x99fc('0x12'));})['catch'](function(_0x135e42){console[_0x99fc('0x11')](_0x135e42);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index bc9637a..8f771d9 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x682b=['FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','findAll','IvrCampaigns','where','Campaign','type','format','%s:queue:%s','length','user:%s','handshake','query','find','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','Trunk','user','userProfileId','Telephones','Trunks','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','all','fax','mail','openchannel','campaign:%s:%s','leave','map','removeChatInteractions','emit','user_has_chat_interactions:remove','user_has_mail_interactions:remove','removeFaxInteractions','user_has_sms_interactions:remove','log','join','default','connection','setMaxListeners','address','remoteAddress','remotePort','SocketIO\x20','disconnect','CONNECTED','bluebird','../mysqldb','./environment','Agents','User','name','role','agent','telephone','ivr','UserProfileSection','findOne','then','VoiceQueues','ChatQueues'];(function(_0x4e7769,_0x37c68b){var _0x181676=function(_0xc6a2ab){while(--_0xc6a2ab){_0x4e7769['push'](_0x4e7769['shift']());}};_0x181676(++_0x37c68b);}(_0x682b,0x9f));var _0xb682=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0x682b[_0x4b2863];return _0x567d67;};'use strict';var _=require('lodash');var util=require('util');var BPromise=require(_0xb682('0x0'));var db=require(_0xb682('0x1'))['db'];var config=require(_0xb682('0x2'));var queryQueues={'attributes':['id','name'],'include':[{'as':_0xb682('0x3'),'model':db[_0xb682('0x4')],'attributes':['id',_0xb682('0x5'),_0xb682('0x6')],'raw':!![],'where':{'role':_0xb682('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xb682('0x5')],'where':{'role':_0xb682('0x8')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id',_0xb682('0x5')],'where':{'role':_0xb682('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xb682('0x5'),'type'],'where':{'type':_0xb682('0x9')}};function getAssociatedResources(_0x1f2813,_0x5b4d67,_0xc5e1bb){return db[_0xb682('0xa')][_0xb682('0xb')]({'where':{'name':_0x1f2813,'userProfileId':_0x5b4d67},'raw':!![]})[_0xb682('0xc')](function(_0x300818){if(_0x300818){if(_0x300818['autoAssociation']){switch(_0x1f2813){case _0xb682('0xd'):case _0xb682('0xe'):case _0xb682('0xf'):case _0xb682('0x10'):case _0xb682('0x11'):case _0xb682('0x12'):return db[_0xc5e1bb][_0xb682('0x13')](queryQueues);case'Telephones':return db[_0xc5e1bb][_0xb682('0x13')](queryTelephones);case'Trunks':return db[_0xc5e1bb][_0xb682('0x13')](queryTrunks);case _0xb682('0x14'):return db[_0xc5e1bb][_0xb682('0x13')](queryCampaigns);}}else{return db['UserProfileResource'][_0xb682('0x13')]({'attributes':['resourceId'],'where':{'sectionId':_0x300818['id']},'raw':!![]})[_0xb682('0xc')](function(_0x7780b5){if(_0x7780b5){var _0x5ce99c={'where':{'id':_['map'](_0x7780b5,'resourceId')},'raw':!![]};switch(_0xc5e1bb){case _0xb682('0x4'):_0x5ce99c[_0xb682('0x15')][_0xb682('0x6')]=_0xb682('0x8');break;case _0xb682('0x16'):_0x5ce99c['where'][_0xb682('0x17')]=_0xb682('0x9');break;}return db[_0xc5e1bb][_0xb682('0x13')](_0x5ce99c);}else{return[];}});}}else{return[];}})['then'](function(_0x954ac3){return _0x954ac3;});}function joinOrLeaveQueues(_0x309d01,_0x79b221,_0x50a2b7,_0x21a8f8){_0x309d01[_0x79b221](util[_0xb682('0x18')](_0xb682('0x19'),_0x50a2b7,_0x21a8f8[_0xb682('0x5')]));if(_0x21a8f8[_0xb682('0x3')]){for(var _0x5563f0=0x0;_0x5563f0<_0x21a8f8['Agents'][_0xb682('0x1a')];_0x5563f0+=0x1){_0x309d01[_0x79b221](util[_0xb682('0x18')](_0xb682('0x1b'),_0x21a8f8[_0xb682('0x3')][_0x5563f0]['name']));}}}function joinOrLeave(_0x464aea,_0x3519b9,_0x49509b){var _0x49fa08;if(_0x464aea[_0xb682('0x1c')][_0xb682('0x1d')]['id']){db['User'][_0xb682('0x1e')]({'attributes':['id',_0xb682('0x5'),_0xb682('0x6'),'userProfileId'],'where':{'id':_0x464aea[_0xb682('0x1c')][_0xb682('0x1d')]['id']},'include':[{'model':db[_0xb682('0x1f')],'as':_0xb682('0x20'),'attributes':['id'],'raw':!![]},{'model':db[_0xb682('0x21')],'as':_0xb682('0x22'),'attributes':['id'],'raw':!![]},{'model':db[_0xb682('0x23')],'as':_0xb682('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0xb682('0x25')],'as':_0xb682('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0xb682('0x27')],'as':_0xb682('0x28'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x27fc69){if(_0x27fc69){_0x49fa08=_0x27fc69;_0x464aea[_0x3519b9](util['format']('user:%s',_0x27fc69[_0xb682('0x5')]));var _0x328a3f=[];switch(_0x27fc69['role']){case _0xb682('0x29'):_0x464aea[_0x3519b9](_0xb682('0x2a'));_0x464aea[_0x3519b9](_0xb682('0x2b'));if(queryQueues[_0xb682('0x2c')](_0xb682('0x2d'))){delete queryQueues[_0xb682('0x2d')];}_0x328a3f[_0xb682('0x2e')](db[_0xb682('0x2f')][_0xb682('0x13')](queryQueues));_0x328a3f['push'](db[_0xb682('0x30')][_0xb682('0x13')](queryQueues));_0x328a3f[_0xb682('0x2e')](db[_0xb682('0x31')][_0xb682('0x13')](queryQueues));_0x328a3f['push'](db[_0xb682('0x32')][_0xb682('0x13')](queryQueues));_0x328a3f[_0xb682('0x2e')](db[_0xb682('0x33')][_0xb682('0x13')](queryQueues));_0x328a3f[_0xb682('0x2e')](db[_0xb682('0x34')][_0xb682('0x13')](queryQueues));_0x328a3f[_0xb682('0x2e')](db[_0xb682('0x4')][_0xb682('0x13')](queryTelephones));_0x328a3f['push'](db[_0xb682('0x35')][_0xb682('0x13')](queryTrunks));_0x328a3f[_0xb682('0x2e')](db['Campaign'][_0xb682('0x13')](queryCampaigns));_0x328a3f['push'](db[_0xb682('0x4')]['findAll'](queryAgents));break;case _0xb682('0x36'):_0x464aea[_0x3519b9](_0xb682('0x2a'));_0x464aea[_0x3519b9](_0xb682('0x2b'));_0x328a3f['push'](getAssociatedResources(_0xb682('0xd'),_0x27fc69[_0xb682('0x37')],'VoiceQueue'));_0x328a3f[_0xb682('0x2e')](getAssociatedResources('ChatQueues',_0x27fc69['userProfileId'],_0xb682('0x30')));_0x328a3f[_0xb682('0x2e')](getAssociatedResources(_0xb682('0xf'),_0x27fc69[_0xb682('0x37')],_0xb682('0x31')));_0x328a3f[_0xb682('0x2e')](getAssociatedResources(_0xb682('0x10'),_0x27fc69[_0xb682('0x37')],'SmsQueue'));_0x328a3f[_0xb682('0x2e')](getAssociatedResources('MailQueues',_0x27fc69['userProfileId'],_0xb682('0x33')));_0x328a3f[_0xb682('0x2e')](getAssociatedResources('OpenchannelQueues',_0x27fc69[_0xb682('0x37')],'OpenchannelQueue'));_0x328a3f[_0xb682('0x2e')](getAssociatedResources(_0xb682('0x38'),_0x27fc69[_0xb682('0x37')],_0xb682('0x4')));_0x328a3f[_0xb682('0x2e')](getAssociatedResources(_0xb682('0x39'),_0x27fc69[_0xb682('0x37')],'Trunk'));_0x328a3f[_0xb682('0x2e')](getAssociatedResources('IvrCampaigns',_0x27fc69[_0xb682('0x37')],'Campaign'));_0x328a3f[_0xb682('0x2e')](db[_0xb682('0x4')][_0xb682('0x13')](queryAgents));break;case _0xb682('0x7'):_0x464aea[_0x3519b9](_0xb682('0x2a'));_0x464aea[_0x3519b9](_0xb682('0x2b'));_0x328a3f['push'](_0x27fc69['getVoiceQueues']({'attributes':['id','name']}));_0x328a3f[_0xb682('0x2e')](_0x27fc69[_0xb682('0x3a')]({'attributes':['id',_0xb682('0x5')]}));_0x328a3f[_0xb682('0x2e')](_0x27fc69[_0xb682('0x3b')]({'attributes':['id','name']}));_0x328a3f[_0xb682('0x2e')](_0x27fc69[_0xb682('0x3c')]({'attributes':['id',_0xb682('0x5')]}));_0x328a3f[_0xb682('0x2e')](_0x27fc69[_0xb682('0x3d')]({'attributes':['id',_0xb682('0x5')]}));_0x328a3f['push'](_0x27fc69[_0xb682('0x3e')]({'attributes':['id',_0xb682('0x5')]}));break;}return BPromise[_0xb682('0x3f')](_0x328a3f);}})[_0xb682('0xc')](function(_0xcffd03){if(_0xcffd03&&_0xcffd03[_0xb682('0x1a')]){for(var _0x3a3b35=0x0;_0x3a3b35<_0xcffd03[_0xb682('0x1a')];_0x3a3b35+=0x1){for(var _0x3078b4=0x0;_0x3078b4<_0xcffd03[_0x3a3b35][_0xb682('0x1a')];_0x3078b4+=0x1){switch(_0x3a3b35){case 0x0:joinOrLeaveQueues(_0x464aea,_0x3519b9,'voice',_0xcffd03[_0x3a3b35][_0x3078b4]);break;case 0x1:joinOrLeaveQueues(_0x464aea,_0x3519b9,'chat',_0xcffd03[_0x3a3b35][_0x3078b4]);break;case 0x2:joinOrLeaveQueues(_0x464aea,_0x3519b9,_0xb682('0x40'),_0xcffd03[_0x3a3b35][_0x3078b4]);break;case 0x3:joinOrLeaveQueues(_0x464aea,_0x3519b9,'sms',_0xcffd03[_0x3a3b35][_0x3078b4]);break;case 0x4:joinOrLeaveQueues(_0x464aea,_0x3519b9,_0xb682('0x41'),_0xcffd03[_0x3a3b35][_0x3078b4]);break;case 0x5:joinOrLeaveQueues(_0x464aea,_0x3519b9,_0xb682('0x42'),_0xcffd03[_0x3a3b35][_0x3078b4]);break;case 0x6:_0x464aea[_0x3519b9](util['format']('telephone:%s',_0xcffd03[_0x3a3b35][_0x3078b4][_0xb682('0x5')]));break;case 0x7:_0x464aea[_0x3519b9](util[_0xb682('0x18')]('trunk:%s',_0xcffd03[_0x3a3b35][_0x3078b4][_0xb682('0x5')]));break;case 0x8:_0x464aea[_0x3519b9](util[_0xb682('0x18')](_0xb682('0x43'),_0xcffd03[_0x3a3b35][_0x3078b4][_0xb682('0x17')],_0xcffd03[_0x3a3b35][_0x3078b4][_0xb682('0x5')]));break;case 0x9:_0x464aea[_0x3519b9](util[_0xb682('0x18')](_0xb682('0x1b'),_0xcffd03[_0x3a3b35][_0x3078b4][_0xb682('0x5')]));break;}}}}})[_0xb682('0xc')](function(){if(_0x3519b9===_0xb682('0x44')){var _0x20231a=_[_0xb682('0x45')](_0x49fa08[_0xb682('0x20')],'id');return _0x49fa08[_0xb682('0x46')](_0x20231a)[_0xb682('0xc')](function(){for(var _0x2104f2=0x0;_0x2104f2<_0x20231a[_0xb682('0x1a')];_0x2104f2+=0x1){_0x49509b[_0xb682('0x47')](_0xb682('0x48'),{'ChatInteractionId':Number(_0x20231a[_0x2104f2]),'UserId':Number(_0x49fa08['id'])});}});}})[_0xb682('0xc')](function(){if(_0x3519b9===_0xb682('0x44')){var _0x10ceb6=_[_0xb682('0x45')](_0x49fa08[_0xb682('0x22')],'id');return _0x49fa08['removeMailInteractions'](_0x10ceb6)[_0xb682('0xc')](function(){for(var _0x394740=0x0;_0x394740<_0x10ceb6[_0xb682('0x1a')];_0x394740+=0x1){_0x49509b[_0xb682('0x47')](_0xb682('0x49'),{'MailInteractionId':Number(_0x10ceb6[_0x394740]),'UserId':Number(_0x49fa08['id'])});}});}})['then'](function(){if(_0x3519b9===_0xb682('0x44')){var _0x52acd5=_[_0xb682('0x45')](_0x49fa08[_0xb682('0x24')],'id');return _0x49fa08[_0xb682('0x4a')](_0x52acd5)['then'](function(){for(var _0x30b5ad=0x0;_0x30b5ad<_0x52acd5[_0xb682('0x1a')];_0x30b5ad+=0x1){_0x49509b[_0xb682('0x47')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x52acd5[_0x30b5ad]),'UserId':Number(_0x49fa08['id'])});}});}})[_0xb682('0xc')](function(){if(_0x3519b9===_0xb682('0x44')){var _0x4fb836=_[_0xb682('0x45')](_0x49fa08[_0xb682('0x26')],'id');return _0x49fa08['removeSmsInteractions'](_0x4fb836)[_0xb682('0xc')](function(){for(var _0x2919ce=0x0;_0x2919ce<_0x4fb836[_0xb682('0x1a')];_0x2919ce+=0x1){_0x49509b['emit'](_0xb682('0x4b'),{'SmsInteractionId':Number(_0x4fb836[_0x2919ce]),'UserId':Number(_0x49fa08['id'])});}});}})['then'](function(){if(_0x3519b9==='leave'){var _0x33a929=_[_0xb682('0x45')](_0x49fa08['OpenchannelInteractions'],'id');return _0x49fa08['removeOpenchannelInteractions'](_0x33a929)[_0xb682('0xc')](function(){for(var _0x597280=0x0;_0x597280<_0x33a929[_0xb682('0x1a')];_0x597280+=0x1){_0x49509b['emit']('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x33a929[_0x597280]),'UserId':Number(_0x49fa08['id'])});}});}})['catch'](function(_0x17a2e0){_0x464aea[_0xb682('0x4c')](_0x17a2e0);});}}function onDisconnect(_0x12ce8a,_0x5a797b){joinOrLeave(_0x12ce8a,'leave',_0x5a797b);}function onConnect(_0x2f08a1){joinOrLeave(_0x2f08a1,_0xb682('0x4d'));}exports[_0xb682('0x4e')]=function(_0x3f5e15){_0x3f5e15['on'](_0xb682('0x4f'),function(_0x16841f){_0x16841f[_0xb682('0x50')](0x0);_0x16841f[_0xb682('0x51')]=_0x16841f['request']['connection'][_0xb682('0x52')]+':'+_0x16841f['request'][_0xb682('0x4f')][_0xb682('0x53')];_0x16841f['connectedAt']=new Date();_0x16841f['log']=function(_0x15f264){console['log'](_0xb682('0x54')+_0x16841f['nsp'][_0xb682('0x5')]+'['+_0x16841f[_0xb682('0x51')]+']',_0x15f264);};_0x16841f['on'](_0xb682('0x55'),function(){onDisconnect(_0x16841f,_0x3f5e15);_0x16841f[_0xb682('0x4c')]('DISCONNECTED');});onConnect(_0x16841f);_0x16841f['log'](_0xb682('0x56'));});}; \ No newline at end of file +var _0x0d6d=['emit','user_has_chat_interactions:remove','user_has_fax_interactions:remove','user_has_sms_interactions:remove','OpenchannelInteractions','catch','join','default','connection','setMaxListeners','address','request','remotePort','connectedAt','log','SocketIO\x20','nsp','DISCONNECTED','CONNECTED','../mysqldb','name','Agents','role','agent','type','ivr','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','findAll','Trunks','IvrCampaigns','UserProfileResource','resourceId','User','where','telephone','format','user:%s','handshake','query','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','OpenchannelInteraction','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','MailQueue','Campaign','voice:inbound','voice:outbound','OpenchannelQueue','Telephones','Trunk','getVoiceQueues','getChatQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','all','length','voice','chat','mail','telephone:%s','trunk:%s','leave','map','removeChatInteractions'];(function(_0x21ef58,_0x316da4){var _0xa70994=function(_0x448fcb){while(--_0x448fcb){_0x21ef58['push'](_0x21ef58['shift']());}};_0xa70994(++_0x316da4);}(_0x0d6d,0x115));var _0xd0d6=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x0d6d[_0x5f09c5];return _0x426ad9;};'use strict';var _=require('lodash');var util=require('util');var BPromise=require('bluebird');var db=require(_0xd0d6('0x0'))['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0xd0d6('0x1')],'include':[{'as':_0xd0d6('0x2'),'model':db['User'],'attributes':['id',_0xd0d6('0x1'),_0xd0d6('0x3')],'raw':!![],'where':{'role':_0xd0d6('0x4')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id',_0xd0d6('0x1')]};var queryAgents={'raw':!![],'attributes':['id',_0xd0d6('0x1')],'where':{'role':_0xd0d6('0x4')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xd0d6('0x1'),_0xd0d6('0x5')],'where':{'type':_0xd0d6('0x6')}};function getAssociatedResources(_0x396e2c,_0x5edb0f,_0x463822){return db[_0xd0d6('0x7')][_0xd0d6('0x8')]({'where':{'name':_0x396e2c,'userProfileId':_0x5edb0f},'raw':!![]})[_0xd0d6('0x9')](function(_0x4a87ee){if(_0x4a87ee){if(_0x4a87ee[_0xd0d6('0xa')]){switch(_0x396e2c){case _0xd0d6('0xb'):case _0xd0d6('0xc'):case _0xd0d6('0xd'):case _0xd0d6('0xe'):case _0xd0d6('0xf'):case _0xd0d6('0x10'):return db[_0x463822][_0xd0d6('0x11')](queryQueues);case'Telephones':return db[_0x463822][_0xd0d6('0x11')](queryTelephones);case _0xd0d6('0x12'):return db[_0x463822][_0xd0d6('0x11')](queryTrunks);case _0xd0d6('0x13'):return db[_0x463822][_0xd0d6('0x11')](queryCampaigns);}}else{return db[_0xd0d6('0x14')]['findAll']({'attributes':[_0xd0d6('0x15')],'where':{'sectionId':_0x4a87ee['id']},'raw':!![]})[_0xd0d6('0x9')](function(_0x5cd0aa){if(_0x5cd0aa){var _0x5b0950={'where':{'id':_['map'](_0x5cd0aa,'resourceId')},'raw':!![]};switch(_0x463822){case _0xd0d6('0x16'):_0x5b0950[_0xd0d6('0x17')][_0xd0d6('0x3')]=_0xd0d6('0x18');break;case'Campaign':_0x5b0950[_0xd0d6('0x17')][_0xd0d6('0x5')]=_0xd0d6('0x6');break;}return db[_0x463822][_0xd0d6('0x11')](_0x5b0950);}else{return[];}});}}else{return[];}})[_0xd0d6('0x9')](function(_0x4387f2){return _0x4387f2;});}function joinOrLeaveQueues(_0x189703,_0x2decc6,_0x626fce,_0x28ba25){_0x189703[_0x2decc6](util[_0xd0d6('0x19')]('%s:queue:%s',_0x626fce,_0x28ba25[_0xd0d6('0x1')]));if(_0x28ba25[_0xd0d6('0x2')]){for(var _0x1ba045=0x0;_0x1ba045<_0x28ba25[_0xd0d6('0x2')]['length'];_0x1ba045+=0x1){_0x189703[_0x2decc6](util[_0xd0d6('0x19')](_0xd0d6('0x1a'),_0x28ba25[_0xd0d6('0x2')][_0x1ba045][_0xd0d6('0x1')]));}}}function joinOrLeave(_0xe2b489,_0x4d8bc4,_0x2a0e11){var _0x427727;if(_0xe2b489[_0xd0d6('0x1b')][_0xd0d6('0x1c')]['id']){db['User']['find']({'attributes':['id',_0xd0d6('0x1'),'role',_0xd0d6('0x1d')],'where':{'id':_0xe2b489[_0xd0d6('0x1b')]['query']['id']},'include':[{'model':db[_0xd0d6('0x1e')],'as':_0xd0d6('0x1f'),'attributes':['id'],'raw':!![]},{'model':db[_0xd0d6('0x20')],'as':_0xd0d6('0x21'),'attributes':['id'],'raw':!![]},{'model':db[_0xd0d6('0x22')],'as':_0xd0d6('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0xd0d6('0x24')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xd0d6('0x25')],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]}]})[_0xd0d6('0x9')](function(_0x497f5d){if(_0x497f5d){_0x427727=_0x497f5d;_0xe2b489[_0x4d8bc4](util[_0xd0d6('0x19')](_0xd0d6('0x1a'),_0x497f5d['name']));var _0xa9d53f=[];switch(_0x497f5d[_0xd0d6('0x3')]){case'admin':_0xe2b489[_0x4d8bc4]('voice:inbound');_0xe2b489[_0x4d8bc4]('voice:outbound');if(queryQueues[_0xd0d6('0x26')](_0xd0d6('0x27'))){delete queryQueues[_0xd0d6('0x27')];}_0xa9d53f[_0xd0d6('0x28')](db[_0xd0d6('0x29')][_0xd0d6('0x11')](queryQueues));_0xa9d53f[_0xd0d6('0x28')](db[_0xd0d6('0x2a')][_0xd0d6('0x11')](queryQueues));_0xa9d53f['push'](db[_0xd0d6('0x2b')][_0xd0d6('0x11')](queryQueues));_0xa9d53f[_0xd0d6('0x28')](db[_0xd0d6('0x2c')][_0xd0d6('0x11')](queryQueues));_0xa9d53f[_0xd0d6('0x28')](db[_0xd0d6('0x2d')]['findAll'](queryQueues));_0xa9d53f[_0xd0d6('0x28')](db['OpenchannelQueue']['findAll'](queryQueues));_0xa9d53f[_0xd0d6('0x28')](db[_0xd0d6('0x16')][_0xd0d6('0x11')](queryTelephones));_0xa9d53f[_0xd0d6('0x28')](db['Trunk'][_0xd0d6('0x11')](queryTrunks));_0xa9d53f[_0xd0d6('0x28')](db[_0xd0d6('0x2e')][_0xd0d6('0x11')](queryCampaigns));_0xa9d53f[_0xd0d6('0x28')](db[_0xd0d6('0x16')][_0xd0d6('0x11')](queryAgents));break;case'user':_0xe2b489[_0x4d8bc4](_0xd0d6('0x2f'));_0xe2b489[_0x4d8bc4](_0xd0d6('0x30'));_0xa9d53f[_0xd0d6('0x28')](getAssociatedResources(_0xd0d6('0xb'),_0x497f5d[_0xd0d6('0x1d')],_0xd0d6('0x29')));_0xa9d53f[_0xd0d6('0x28')](getAssociatedResources(_0xd0d6('0xc'),_0x497f5d[_0xd0d6('0x1d')],'ChatQueue'));_0xa9d53f[_0xd0d6('0x28')](getAssociatedResources(_0xd0d6('0xd'),_0x497f5d['userProfileId'],'FaxQueue'));_0xa9d53f[_0xd0d6('0x28')](getAssociatedResources(_0xd0d6('0xe'),_0x497f5d[_0xd0d6('0x1d')],_0xd0d6('0x2c')));_0xa9d53f[_0xd0d6('0x28')](getAssociatedResources(_0xd0d6('0xf'),_0x497f5d[_0xd0d6('0x1d')],_0xd0d6('0x2d')));_0xa9d53f[_0xd0d6('0x28')](getAssociatedResources(_0xd0d6('0x10'),_0x497f5d['userProfileId'],_0xd0d6('0x31')));_0xa9d53f[_0xd0d6('0x28')](getAssociatedResources(_0xd0d6('0x32'),_0x497f5d['userProfileId'],_0xd0d6('0x16')));_0xa9d53f[_0xd0d6('0x28')](getAssociatedResources('Trunks',_0x497f5d[_0xd0d6('0x1d')],_0xd0d6('0x33')));_0xa9d53f[_0xd0d6('0x28')](getAssociatedResources('IvrCampaigns',_0x497f5d[_0xd0d6('0x1d')],'Campaign'));_0xa9d53f['push'](db[_0xd0d6('0x16')][_0xd0d6('0x11')](queryAgents));break;case'agent':_0xe2b489[_0x4d8bc4](_0xd0d6('0x2f'));_0xe2b489[_0x4d8bc4](_0xd0d6('0x30'));_0xa9d53f[_0xd0d6('0x28')](_0x497f5d[_0xd0d6('0x34')]({'attributes':['id','name']}));_0xa9d53f[_0xd0d6('0x28')](_0x497f5d[_0xd0d6('0x35')]({'attributes':['id',_0xd0d6('0x1')]}));_0xa9d53f['push'](_0x497f5d['getFaxQueues']({'attributes':['id',_0xd0d6('0x1')]}));_0xa9d53f[_0xd0d6('0x28')](_0x497f5d[_0xd0d6('0x36')]({'attributes':['id',_0xd0d6('0x1')]}));_0xa9d53f['push'](_0x497f5d[_0xd0d6('0x37')]({'attributes':['id',_0xd0d6('0x1')]}));_0xa9d53f['push'](_0x497f5d[_0xd0d6('0x38')]({'attributes':['id',_0xd0d6('0x1')]}));break;}return BPromise[_0xd0d6('0x39')](_0xa9d53f);}})['then'](function(_0x20ef4b){if(_0x20ef4b&&_0x20ef4b[_0xd0d6('0x3a')]){for(var _0x59448f=0x0;_0x59448f<_0x20ef4b[_0xd0d6('0x3a')];_0x59448f+=0x1){for(var _0x37d1c0=0x0;_0x37d1c0<_0x20ef4b[_0x59448f][_0xd0d6('0x3a')];_0x37d1c0+=0x1){switch(_0x59448f){case 0x0:joinOrLeaveQueues(_0xe2b489,_0x4d8bc4,_0xd0d6('0x3b'),_0x20ef4b[_0x59448f][_0x37d1c0]);break;case 0x1:joinOrLeaveQueues(_0xe2b489,_0x4d8bc4,_0xd0d6('0x3c'),_0x20ef4b[_0x59448f][_0x37d1c0]);break;case 0x2:joinOrLeaveQueues(_0xe2b489,_0x4d8bc4,'fax',_0x20ef4b[_0x59448f][_0x37d1c0]);break;case 0x3:joinOrLeaveQueues(_0xe2b489,_0x4d8bc4,'sms',_0x20ef4b[_0x59448f][_0x37d1c0]);break;case 0x4:joinOrLeaveQueues(_0xe2b489,_0x4d8bc4,_0xd0d6('0x3d'),_0x20ef4b[_0x59448f][_0x37d1c0]);break;case 0x5:joinOrLeaveQueues(_0xe2b489,_0x4d8bc4,'openchannel',_0x20ef4b[_0x59448f][_0x37d1c0]);break;case 0x6:_0xe2b489[_0x4d8bc4](util[_0xd0d6('0x19')](_0xd0d6('0x3e'),_0x20ef4b[_0x59448f][_0x37d1c0][_0xd0d6('0x1')]));break;case 0x7:_0xe2b489[_0x4d8bc4](util[_0xd0d6('0x19')](_0xd0d6('0x3f'),_0x20ef4b[_0x59448f][_0x37d1c0][_0xd0d6('0x1')]));break;case 0x8:_0xe2b489[_0x4d8bc4](util[_0xd0d6('0x19')]('campaign:%s:%s',_0x20ef4b[_0x59448f][_0x37d1c0]['type'],_0x20ef4b[_0x59448f][_0x37d1c0]['name']));break;case 0x9:_0xe2b489[_0x4d8bc4](util['format'](_0xd0d6('0x1a'),_0x20ef4b[_0x59448f][_0x37d1c0][_0xd0d6('0x1')]));break;}}}}})[_0xd0d6('0x9')](function(){if(_0x4d8bc4===_0xd0d6('0x40')){var _0x1c0b83=_[_0xd0d6('0x41')](_0x427727['ChatInteractions'],'id');return _0x427727[_0xd0d6('0x42')](_0x1c0b83)['then'](function(){for(var _0x127840=0x0;_0x127840<_0x1c0b83['length'];_0x127840+=0x1){_0x2a0e11[_0xd0d6('0x43')](_0xd0d6('0x44'),{'ChatInteractionId':Number(_0x1c0b83[_0x127840]),'UserId':Number(_0x427727['id'])});}});}})[_0xd0d6('0x9')](function(){if(_0x4d8bc4===_0xd0d6('0x40')){var _0x1b54c4=_[_0xd0d6('0x41')](_0x427727[_0xd0d6('0x21')],'id');return _0x427727['removeMailInteractions'](_0x1b54c4)[_0xd0d6('0x9')](function(){for(var _0x240275=0x0;_0x240275<_0x1b54c4['length'];_0x240275+=0x1){_0x2a0e11[_0xd0d6('0x43')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x1b54c4[_0x240275]),'UserId':Number(_0x427727['id'])});}});}})[_0xd0d6('0x9')](function(){if(_0x4d8bc4===_0xd0d6('0x40')){var _0x3bd999=_[_0xd0d6('0x41')](_0x427727['FaxInteractions'],'id');return _0x427727['removeFaxInteractions'](_0x3bd999)[_0xd0d6('0x9')](function(){for(var _0x1e9b09=0x0;_0x1e9b09<_0x3bd999[_0xd0d6('0x3a')];_0x1e9b09+=0x1){_0x2a0e11[_0xd0d6('0x43')](_0xd0d6('0x45'),{'FaxInteractionId':Number(_0x3bd999[_0x1e9b09]),'UserId':Number(_0x427727['id'])});}});}})['then'](function(){if(_0x4d8bc4==='leave'){var _0x29719a=_[_0xd0d6('0x41')](_0x427727['SmsInteractions'],'id');return _0x427727['removeSmsInteractions'](_0x29719a)[_0xd0d6('0x9')](function(){for(var _0x289f6=0x0;_0x289f6<_0x29719a[_0xd0d6('0x3a')];_0x289f6+=0x1){_0x2a0e11[_0xd0d6('0x43')](_0xd0d6('0x46'),{'SmsInteractionId':Number(_0x29719a[_0x289f6]),'UserId':Number(_0x427727['id'])});}});}})[_0xd0d6('0x9')](function(){if(_0x4d8bc4===_0xd0d6('0x40')){var _0x2ce07d=_[_0xd0d6('0x41')](_0x427727[_0xd0d6('0x47')],'id');return _0x427727['removeOpenchannelInteractions'](_0x2ce07d)[_0xd0d6('0x9')](function(){for(var _0x26a3e0=0x0;_0x26a3e0<_0x2ce07d['length'];_0x26a3e0+=0x1){_0x2a0e11['emit']('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x2ce07d[_0x26a3e0]),'UserId':Number(_0x427727['id'])});}});}})[_0xd0d6('0x48')](function(_0x140132){_0xe2b489['log'](_0x140132);});}}function onDisconnect(_0x364649,_0xb313b7){joinOrLeave(_0x364649,_0xd0d6('0x40'),_0xb313b7);}function onConnect(_0x529558){joinOrLeave(_0x529558,_0xd0d6('0x49'));}exports[_0xd0d6('0x4a')]=function(_0x20c12e){_0x20c12e['on'](_0xd0d6('0x4b'),function(_0x12dcac){_0x12dcac[_0xd0d6('0x4c')](0x0);_0x12dcac[_0xd0d6('0x4d')]=_0x12dcac[_0xd0d6('0x4e')][_0xd0d6('0x4b')]['remoteAddress']+':'+_0x12dcac[_0xd0d6('0x4e')][_0xd0d6('0x4b')][_0xd0d6('0x4f')];_0x12dcac[_0xd0d6('0x50')]=new Date();_0x12dcac[_0xd0d6('0x51')]=function(_0x29384b){console[_0xd0d6('0x51')](_0xd0d6('0x52')+_0x12dcac[_0xd0d6('0x53')][_0xd0d6('0x1')]+'['+_0x12dcac[_0xd0d6('0x4d')]+']',_0x29384b);};_0x12dcac['on']('disconnect',function(){onDisconnect(_0x12dcac,_0x20c12e);_0x12dcac[_0xd0d6('0x51')](_0xd0d6('0x54'));});onConnect(_0x12dcac);_0x12dcac[_0xd0d6('0x51')](_0xd0d6('0x55'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 7734598..c95bdfb 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 _0x4a9a=['closedinteraction','newmessage','Sms','newinteraction','SmsMessage','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','MailMessage','OpenchannelInteraction','Openchannel','OpenchannelMessage','EventManager','then','error','code','Trigger,\x20%s','get','channel','UserId','User','find','name','interface','format','SIP/%s','incomingmessage','catch','outgoingmessage','event','changed','closed','default','length','hasOwnProperty','model','callback','toLowerCase','util','../../mysqldb','jayson/promise','../logger','client','http','ChatInteraction','afterCreate','Chat','afterUpdate'];(function(_0x1a8dcd,_0x289ae9){var _0x183bf8=function(_0x243141){while(--_0x243141){_0x1a8dcd['push'](_0x1a8dcd['shift']());}};_0x183bf8(++_0x289ae9);}(_0x4a9a,0xf0));var _0xa4a9=function(_0x314504,_0xf3c826){_0x314504=_0x314504-0x0;var _0x5b8464=_0x4a9a[_0x314504];return _0x5b8464;};'use strict';var util=require(_0xa4a9('0x0'));var db=require(_0xa4a9('0x1'))['db'];var jayson=require(_0xa4a9('0x2'));var logger=require(_0xa4a9('0x3'))('triggers');var client=jayson[_0xa4a9('0x4')][_0xa4a9('0x5')]({'port':0x232a});var triggers=[{'channel':'Chat','model':_0xa4a9('0x6'),'event':_0xa4a9('0x7'),'condition':'newinteraction','callback':afterCreate},{'channel':_0xa4a9('0x8'),'model':_0xa4a9('0x6'),'event':_0xa4a9('0x9'),'condition':_0xa4a9('0xa'),'callback':afterUpdate},{'channel':_0xa4a9('0x8'),'model':'ChatMessage','event':_0xa4a9('0x7'),'condition':_0xa4a9('0xb'),'callback':afterCreateMessage},{'channel':_0xa4a9('0xc'),'model':'SmsInteraction','event':_0xa4a9('0x7'),'condition':_0xa4a9('0xd'),'callback':afterCreate},{'channel':_0xa4a9('0xc'),'model':'SmsInteraction','event':_0xa4a9('0x9'),'condition':_0xa4a9('0xa'),'callback':afterUpdate},{'channel':_0xa4a9('0xc'),'model':_0xa4a9('0xe'),'event':'afterCreate','condition':_0xa4a9('0xb'),'callback':afterCreateMessage},{'channel':_0xa4a9('0xf'),'model':'FaxInteraction','event':_0xa4a9('0x7'),'condition':'newinteraction','callback':afterCreate},{'channel':_0xa4a9('0xf'),'model':_0xa4a9('0x10'),'event':_0xa4a9('0x9'),'condition':_0xa4a9('0xa'),'callback':afterUpdate},{'channel':_0xa4a9('0xf'),'model':_0xa4a9('0x11'),'event':'afterCreate','condition':_0xa4a9('0xb'),'callback':afterCreateMessage},{'channel':_0xa4a9('0x12'),'model':_0xa4a9('0x13'),'event':_0xa4a9('0x7'),'condition':_0xa4a9('0xd'),'callback':afterCreate},{'channel':_0xa4a9('0x12'),'model':'MailInteraction','event':_0xa4a9('0x9'),'condition':_0xa4a9('0xa'),'callback':afterUpdate},{'channel':_0xa4a9('0x12'),'model':_0xa4a9('0x14'),'event':_0xa4a9('0x7'),'condition':'newmessage','callback':afterCreateMessage},{'channel':'Openchannel','model':_0xa4a9('0x15'),'event':'afterCreate','condition':_0xa4a9('0xd'),'callback':afterCreate},{'channel':_0xa4a9('0x16'),'model':_0xa4a9('0x15'),'event':'afterUpdate','condition':_0xa4a9('0xa'),'callback':afterUpdate},{'channel':_0xa4a9('0x16'),'model':_0xa4a9('0x17'),'event':_0xa4a9('0x7'),'condition':_0xa4a9('0xb'),'callback':afterCreateMessage}];function request(_0x2ceb5e){return client['request'](_0xa4a9('0x18'),_0x2ceb5e)[_0xa4a9('0x19')](function(_0x3995e7){logger['info']('Trigger,\x20%s',_0xa4a9('0x18'),_0x3995e7);if(_0x3995e7[_0xa4a9('0x1a')]){if(_0x3995e7[_0xa4a9('0x1a')][_0xa4a9('0x1b')]===0x1f4){logger[_0xa4a9('0x1a')](_0xa4a9('0x1c'),'EventManager',_0x3995e7['error']);}}})['catch'](function(_0x512e98){logger[_0xa4a9('0x1a')]('Trigger,\x20%s',_0xa4a9('0x18'),_0x512e98);});}function afterCreateMessage(_0x1501bf,_0x1b5e99){return function(_0x23487f,_0x3a8d62){_0x23487f=_0x23487f[_0xa4a9('0x1d')]({'plain':!![]});_0x23487f[_0xa4a9('0x1e')]=_0x1501bf;_0x23487f['event']=_0x23487f['direction'];if(_0x23487f[_0xa4a9('0x1f')]){return db[_0xa4a9('0x20')][_0xa4a9('0x21')]({'where':{'id':_0x23487f[_0xa4a9('0x1f')]},'attributes':['id',_0xa4a9('0x22')],'raw':!![]})[_0xa4a9('0x19')](function(_0x4cd312){_0x23487f[_0xa4a9('0x23')]=util[_0xa4a9('0x24')](_0xa4a9('0x25'),_0x4cd312[_0xa4a9('0x22')]);_0x23487f[_0xa4a9('0x1e')]=_0x1501bf;return request({'event':_0xa4a9('0x26'),'message':_0x23487f});})[_0xa4a9('0x27')](function(_0xeb8b5){console[_0xa4a9('0x1a')](_0xeb8b5);});}else{return request({'event':_0xa4a9('0x28'),'message':_0x23487f});}};}function afterCreate(_0x49c9c4,_0x379293){return function(_0x4d47d3,_0x3a6aa3){_0x4d47d3=_0x4d47d3[_0xa4a9('0x1d')]({'plain':!![]});_0x4d47d3[_0xa4a9('0x1e')]=_0x49c9c4;_0x4d47d3[_0xa4a9('0x29')]='opened';return request({'event':_0x379293,'message':_0x4d47d3});};}function afterUpdate(_0x45b882,_0x2620e3){return function(_0x5a453f,_0x440b7d){if(_0x5a453f[_0xa4a9('0x2a')](_0xa4a9('0x2b'))&&_0x5a453f['closed']){_0x5a453f=_0x5a453f[_0xa4a9('0x1d')]({'plain':!![]});_0x5a453f[_0xa4a9('0x1e')]=_0x45b882;_0x5a453f[_0xa4a9('0x29')]='closed';if(_0x5a453f[_0xa4a9('0x1f')]){return db[_0xa4a9('0x20')]['find']({'where':{'id':_0x5a453f[_0xa4a9('0x1f')]},'attributes':['id',_0xa4a9('0x22')],'raw':!![]})[_0xa4a9('0x19')](function(_0x455f23){_0x5a453f['interface']=util['format'](_0xa4a9('0x25'),_0x455f23[_0xa4a9('0x22')]);return request({'event':_0x2620e3,'message':_0x5a453f});})[_0xa4a9('0x27')](function(_0x2053d3){console['error'](_0x2053d3);});}else{return request({'event':_0x2620e3,'message':_0x5a453f});}}};}exports[_0xa4a9('0x2c')]=function(){for(var _0x3dd9d9=0x0;_0x3dd9d9=_0x246b3b[_0xa131('0x13')]){throw Error(_0xa131('0x14'));}_0x582e3b(_0x41df15);})[_0xa131('0x15')](function(_0x414e07){_0x4fcef2(_0x414e07);});});}; \ No newline at end of file +var _0xa6b3=['updateAttributes','getLicense','role','User','count','agent','then','agents','Maximum\x20login\x20has\x20been\x20reached','bluebird','./license/util','mail','chat','sms','openchannel','getChannels','isValidChannel','toLowerCase','clearBlockUser','isUndefined','blockedAt'];(function(_0x1d5400,_0x567e3c){var _0x21d9fe=function(_0x23fb75){while(--_0x23fb75){_0x1d5400['push'](_0x1d5400['shift']());}};_0x21d9fe(++_0x567e3c);}(_0xa6b3,0x72));var _0x3a6b=function(_0x54e0c6,_0x399cb0){_0x54e0c6=_0x54e0c6-0x0;var _0x4577d8=_0xa6b3[_0x54e0c6];return _0x4577d8;};'use strict';var _=require('lodash');var BPromise=require(_0x3a6b('0x0'));var db=require('../mysqldb')['db'];var util=require(_0x3a6b('0x1'));var channels=['voice',_0x3a6b('0x2'),_0x3a6b('0x3'),'fax',_0x3a6b('0x4'),_0x3a6b('0x5')];exports[_0x3a6b('0x6')]=function(){return channels;};exports[_0x3a6b('0x7')]=function(_0x425173){_0x425173=_0x425173[_0x3a6b('0x8')]();return _['includes'](channels,_0x425173);};exports[_0x3a6b('0x9')]=function(_0x2e9e61,_0x1798fb,_0x43e67e,_0x36d03e){var _0x490441={'loginAttempts':_0x1798fb,'blocked':_0x43e67e};if(!_[_0x3a6b('0xa')](_0x36d03e)){_0x490441[_0x3a6b('0xb')]=_0x36d03e;}return _0x2e9e61[_0x3a6b('0xc')](_0x490441);};exports[_0x3a6b('0xd')]=function(_0x535076){return new BPromise(function(_0x359d5a,_0x491bef){var _0x3c4c80=0x0;if(_0x535076[_0x3a6b('0xe')]!=='agent'){_0x359d5a(_0x535076);}db[_0x3a6b('0xf')][_0x3a6b('0x10')]({'where':{'role':_0x3a6b('0x11'),'online':!![],'id':{'$ne':_0x535076['id']}}})[_0x3a6b('0x12')](function(_0xc09f5a){_0x3c4c80=_0xc09f5a;return util[_0x3a6b('0xd')]();})[_0x3a6b('0x12')](function(_0xb784e5){if(_0xb784e5&&_0xb784e5[_0x3a6b('0x13')]&&_0x3c4c80>=_0xb784e5[_0x3a6b('0x13')]){throw Error(_0x3a6b('0x14'));}_0x359d5a(_0x535076);})['catch'](function(_0x359443){_0x491bef(_0x359443);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 3c927fa..5454122 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x97a0=['send','404','status'];(function(_0x17d69e,_0x27717d){var _0x4b153f=function(_0x542e11){while(--_0x542e11){_0x17d69e['push'](_0x17d69e['shift']());}};_0x4b153f(++_0x27717d);}(_0x97a0,0x151));var _0x097a=function(_0x43c637,_0x16f433){_0x43c637=_0x43c637-0x0;var _0x3342c0=_0x97a0[_0x43c637];return _0x3342c0;};'use strict';module['exports'][0x194]=function pageNotFound(_0x4a98d7,_0x158612){var _0x2749ad=_0x097a('0x0');var _0x45af68=0x194;var _0x212344={'status':_0x45af68};_0x158612[_0x097a('0x1')](_0x212344[_0x097a('0x1')]);_0x158612['render'](_0x2749ad,{},function(_0x399853,_0xb60d5a){if(_0x399853){return _0x158612[_0x097a('0x1')](_0x212344[_0x097a('0x1')])['json'](_0x212344);}_0x158612[_0x097a('0x2')](_0xb60d5a);});}; \ No newline at end of file +var _0x7ccd=['exports','status','json','send'];(function(_0x5aef17,_0x592cd4){var _0x43f9d0=function(_0x49ea9c){while(--_0x49ea9c){_0x5aef17['push'](_0x5aef17['shift']());}};_0x43f9d0(++_0x592cd4);}(_0x7ccd,0x1ec));var _0xd7cc=function(_0x2789b3,_0x412c9a){_0x2789b3=_0x2789b3-0x0;var _0x1682aa=_0x7ccd[_0x2789b3];return _0x1682aa;};'use strict';module[_0xd7cc('0x0')][0x194]=function pageNotFound(_0x39c4a5,_0x50162e){var _0x4c1680='404';var _0x579e73=0x194;var _0x1251bc={'status':_0x579e73};_0x50162e[_0xd7cc('0x1')](_0x1251bc[_0xd7cc('0x1')]);_0x50162e['render'](_0x4c1680,{},function(_0x276833,_0x388582){if(_0x276833){return _0x50162e[_0xd7cc('0x1')](_0x1251bc[_0xd7cc('0x1')])[_0xd7cc('0x2')](_0x1251bc);}_0x50162e[_0xd7cc('0x3')](_0x388582);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 9bd2313..fac9a22 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0baf=['JscriptySessions','Trunk','TrunkId','TrunkBackupId','IntervalId','voice_queues_has_cm_lists','Agents','BlackLists','ScreenRecording','mailboxuser','mailbox','VoiceCallReport','QueueCalls','uniqueid','VoiceAgentReport','AgentReports','Contact','MailAccountId','Imap','Smtp','Dispositions','Interactions','List','Template','TemplateId','mandatoryDispositionPause','mandatoryDispositionPauseId','Teams','Messages','MailInteractionId','ContactId','Owner','mail_interaction_has_tags','Tags','ThroughTags','Attachments','Interaction','Account','restrict','MailQueueReport','Items','FaxAccountId','Answers','Exntensions','ListId','FaxApplication','FaxInteractionId','fax_interaction_has_tags','user_has_fax_interactions','AttachmentId','team_has_fax_queues','SmsAccountId','user_has_sms_accounts','sms_interaction_has_tags','SmsQueueId','OpenchannelAccountId','user_has_openchannel_accounts','OpenchannelQueueId','TagId','OpenchannelInteractionId','openchannel_interaction_has_tags','Users','user_has_openchannel_interactions','team_has_openchannel_queues','ChatWebsiteId','user_has_chat_websites','Agent','ChatQueue','Queue','ChatQueueId','Website','ChatMessage','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','team_has_chat_queues','ChatInternalMessage','CmCompany','CompanyId','cm_user_has_contacts','cm_contact_has_tags','Campaign','CampaignId','OwnerId','Automation','All','OneAll','AutomationAllId','OneAny','AutomationAnyId','Action','Actions','AutomationId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','Mohs','Trigger','TriggerAllId','AnyCondition','TriggerAnyId','TriggerId','Fields','CustomReportId','MetricId','Configurations','AccountId','DescriptionId','FieldId','Description','Field','VariableId','SugarcrmAccount','SugarcrmConfiguration','SugarcrmField','SubjectId','Descriptions','Subject','DeskConfiguration','Subjects','ZendeskField','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','VtigerConfiguration','VtigerField','ServicenowConfiguration','ChatQueueReport','FromId','SessionId','JscriptyProject','ProjectId','user_has_square_projects','team_has_voice_queues','ChatQueues','team_has_sms_queues','TrunkBackup','campaigns_has_cm_lists','MailTransferReport','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToMailQueueId','ToQueue','ToMailAccountId','FromChatWebsiteId','ToChatQueueId','ToChatWebsiteId','FaxTransferReport','FromFaxAccountId','ToFaxAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','ToSmsQueueId','ToSmsAccountId','ToAccount','CustomFields','HopperHistory','Queues','UserProfileSections','UserProfileResource','Resources','sectionId','exports','path','sequelize','lodash','determine','motion2','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8','utf8_general_ci','defaultsDeep','sequelizeHistory','database','password','options','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','../api/screenRecording/screenRecording.model','VoiceMailMessage','../api/voiceCallReport/voiceCallReport.model','../api/voiceDialReport/voiceDialReport.model','VoiceQueueReport','MemberReport','../api/memberReport/memberReport.model','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userChatQueue/userChatQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','MailServerIn','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','ChatInteraction','../api/chatInteraction/chatInteraction.model','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','CmContact','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','ReportAgentPreview','CmCustomField','../api/cmCustomField/cmCustomField.model','../api/action/action.model','../api/automation/automation.model','CannedAnswer','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Tag','../api/tag/tag.model','../api/template/template.model','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','SalesforceField','../api/intSalesforceField/intSalesforceField.model','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerConfiguration/intVtigerConfiguration.model','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','Network','../api/chatQueueReport/chatQueueReport.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','UserProfileSection','../api/userProfileSection/userProfileSection.model','../api/userProfileResource/userProfileResource.model','hasOne','VoiceMail','UserId','hasMany','VoiceQueuesRt','Extensions','cascade','HopperFinals','CmHopperHistory','SmsInteractions','FaxInteractions','MailInteraction','belongsTo','userProfileId','belongsToMany','Groups','chat_group_has_users','Contacts','CmList','Lists','cm_user_has_lists','user_has_teams','MailInteractions','user_has_mail_interactions','ChatInteractions','user_has_sms_interactions','OpenchannelInteractions','VoiceQueues','MailQueues','UserMailQueue','UserChatQueue','FaxQueues','UserFaxQueue','SmsQueues','OpenchannelQueues','VoicePrefixes','user_has_voice_prefixes','ChatWebsites','FaxAccounts','user_has_fax_accounts','user_has_mail_accounts','SmsAccounts','SquareProjects','ChanSpyId','Applications','Sound','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperHistories','HopperBlacks'];(function(_0x2dbc35,_0x1efafa){var _0x589a4b=function(_0x5340de){while(--_0x5340de){_0x2dbc35['push'](_0x2dbc35['shift']());}};_0x589a4b(++_0x1efafa);}(_0x0baf,0xa8));var _0xf0ba=function(_0x56756b,_0x3e8cc7){_0x56756b=_0x56756b-0x0;var _0xa3002=_0x0baf[_0x56756b];return _0xa3002;};'use strict';var path=require(_0xf0ba('0x0'));var config=require('../config/environment');var Sequelize=require(_0xf0ba('0x1'));var _=require(_0xf0ba('0x2'));var jstz=require('jstz');var timezone=jstz[_0xf0ba('0x3')]();config[_0xf0ba('0x1')]=_['defaultsDeep'](config[_0xf0ba('0x1')],{'database':_0xf0ba('0x4'),'username':_0xf0ba('0x5'),'password':_0xf0ba('0x6'),'options':{'host':_0xf0ba('0x7'),'port':0xcea,'dialect':_0xf0ba('0x8'),'dialectOptions':{'charset':_0xf0ba('0x9')},'logging':![],'timezone':timezone[_0xf0ba('0xa')](),'define':{'charset':_0xf0ba('0xb'),'collate':_0xf0ba('0xc')}}});config['sequelizeHistory']=_[_0xf0ba('0xd')](config[_0xf0ba('0xe')],{'database':_0xf0ba('0x4'),'username':_0xf0ba('0x5'),'password':_0xf0ba('0x6'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0xf0ba('0x8'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0xf0ba('0xa')](),'define':{'charset':_0xf0ba('0xb'),'collate':_0xf0ba('0xc')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xf0ba('0x1')][_0xf0ba('0xf')],config[_0xf0ba('0x1')]['username'],config['sequelize'][_0xf0ba('0x10')],config[_0xf0ba('0x1')][_0xf0ba('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0xf0ba('0xf')],config[_0xf0ba('0xe')]['username'],config[_0xf0ba('0xe')][_0xf0ba('0x10')],config[_0xf0ba('0xe')][_0xf0ba('0x11')])};db[_0xf0ba('0x12')]=db[_0xf0ba('0x1')][_0xf0ba('0x13')](_0xf0ba('0x14'));db[_0xf0ba('0x15')]=db[_0xf0ba('0x1')]['import'](_0xf0ba('0x16'));db[_0xf0ba('0x17')]=db['sequelize']['import'](_0xf0ba('0x18'));db[_0xf0ba('0x19')]=db['sequelize'][_0xf0ba('0x13')](_0xf0ba('0x1a'));db[_0xf0ba('0x1b')]=db['sequelize'][_0xf0ba('0x13')](_0xf0ba('0x1c'));db[_0xf0ba('0x1d')]=db['sequelize'][_0xf0ba('0x13')](_0xf0ba('0x1e'));db[_0xf0ba('0x1f')]=db[_0xf0ba('0x1')]['import'](_0xf0ba('0x20'));db['ScreenRecording']=db['sequelize'][_0xf0ba('0x13')](_0xf0ba('0x21'));db['VoiceMail']=db[_0xf0ba('0x1')][_0xf0ba('0x13')]('../api/voiceMail/voiceMail.model');db[_0xf0ba('0x22')]=db['sequelize']['import']('../api/voiceMailMessage/voiceMailMessage.model');db['VoiceCallReport']=db[_0xf0ba('0x1')]['import'](_0xf0ba('0x23'));db['VoiceDialReport']=db['sequelize'][_0xf0ba('0x13')](_0xf0ba('0x24'));db['VoiceAgentReport']=db[_0xf0ba('0x1')]['import']('../api/voiceAgentReport/voiceAgentReport.model');db[_0xf0ba('0x25')]=db[_0xf0ba('0x1')][_0xf0ba('0x13')]('../api/voiceQueueReport/voiceQueueReport.model');db[_0xf0ba('0x26')]=db[_0xf0ba('0x1')][_0xf0ba('0x13')](_0xf0ba('0x27'));db['Trunk']=db[_0xf0ba('0x1')][_0xf0ba('0x13')](_0xf0ba('0x28'));db['VoiceTransferReport']=db[_0xf0ba('0x1')][_0xf0ba('0x13')](_0xf0ba('0x29'));db[_0xf0ba('0x2a')]=db[_0xf0ba('0x1')][_0xf0ba('0x13')](_0xf0ba('0x2b'));db[_0xf0ba('0x2c')]=db[_0xf0ba('0x1')]['import']('../api/userVoiceQueue/userVoiceQueue.model');db['UserChatQueue']=db[_0xf0ba('0x1')][_0xf0ba('0x13')](_0xf0ba('0x2d'));db['UserMailQueue']=db[_0xf0ba('0x1')][_0xf0ba('0x13')]('../api/userMailQueue/userMailQueue.model');db['UserFaxQueue']=db[_0xf0ba('0x1')][_0xf0ba('0x13')]('../api/userFaxQueue/userFaxQueue.model');db[_0xf0ba('0x2e')]=db[_0xf0ba('0x1')]['import'](_0xf0ba('0x2f'));db[_0xf0ba('0x30')]=db[_0xf0ba('0x1')][_0xf0ba('0x13')](_0xf0ba('0x31'));db[_0xf0ba('0x32')]=db[_0xf0ba('0x1')][_0xf0ba('0x13')]('../api/mailServerIn/mailServerIn.model');db[_0xf0ba('0x33')]=db[_0xf0ba('0x1')][_0xf0ba('0x13')](_0xf0ba('0x34'));db[_0xf0ba('0x35')]=db[_0xf0ba('0x1')][_0xf0ba('0x13')](_0xf0ba('0x36'));db[_0xf0ba('0x37')]=db['sequelize'][_0xf0ba('0x13')]('../api/mailQueue/mailQueue.model');db[_0xf0ba('0x38')]=db[_0xf0ba('0x1')]['import'](_0xf0ba('0x39'));db['MailInteraction']=db['sequelize'][_0xf0ba('0x13')](_0xf0ba('0x3a'));db[_0xf0ba('0x3b')]=db[_0xf0ba('0x1')][_0xf0ba('0x13')](_0xf0ba('0x3c'));db[_0xf0ba('0x3d')]=db[_0xf0ba('0x1')]['import']('../api/mailApplication/mailApplication.model');db['MailQueueReport']=db[_0xf0ba('0x1')]['import'](_0xf0ba('0x3e'));db[_0xf0ba('0x3f')]=db['sequelize'][_0xf0ba('0x13')](_0xf0ba('0x40'));db[_0xf0ba('0x41')]=db[_0xf0ba('0x1')][_0xf0ba('0x13')](_0xf0ba('0x42'));db[_0xf0ba('0x43')]=db[_0xf0ba('0x1')][_0xf0ba('0x13')]('../api/faxAccount/faxAccount.model');db['FaxApplication']=db[_0xf0ba('0x1')][_0xf0ba('0x13')](_0xf0ba('0x44'));db[_0xf0ba('0x45')]=db[_0xf0ba('0x1')]['import'](_0xf0ba('0x46'));db[_0xf0ba('0x47')]=db['sequelize']['import'](_0xf0ba('0x48'));db[_0xf0ba('0x49')]=db[_0xf0ba('0x1')]['import'](_0xf0ba('0x4a'));db[_0xf0ba('0x4b')]=db['sequelize']['import'](_0xf0ba('0x4c'));db[_0xf0ba('0x4d')]=db[_0xf0ba('0x1')]['import'](_0xf0ba('0x4e'));db[_0xf0ba('0x4f')]=db[_0xf0ba('0x1')]['import'](_0xf0ba('0x50'));db[_0xf0ba('0x51')]=db[_0xf0ba('0x1')][_0xf0ba('0x13')](_0xf0ba('0x52'));db[_0xf0ba('0x53')]=db[_0xf0ba('0x1')]['import']('../api/smsMessage/smsMessage.model');db[_0xf0ba('0x54')]=db[_0xf0ba('0x1')][_0xf0ba('0x13')](_0xf0ba('0x55'));db[_0xf0ba('0x56')]=db[_0xf0ba('0x1')]['import'](_0xf0ba('0x57'));db[_0xf0ba('0x58')]=db['sequelize'][_0xf0ba('0x13')](_0xf0ba('0x59'));db[_0xf0ba('0x5a')]=db[_0xf0ba('0x1')]['import'](_0xf0ba('0x5b'));db[_0xf0ba('0x5c')]=db[_0xf0ba('0x1')][_0xf0ba('0x13')]('../api/openchannelMessage/openchannelMessage.model');db[_0xf0ba('0x5d')]=db[_0xf0ba('0x1')][_0xf0ba('0x13')](_0xf0ba('0x5e'));db[_0xf0ba('0x5f')]=db[_0xf0ba('0x1')][_0xf0ba('0x13')](_0xf0ba('0x60'));db[_0xf0ba('0x61')]=db[_0xf0ba('0x1')][_0xf0ba('0x13')](_0xf0ba('0x62'));db[_0xf0ba('0x63')]=db['sequelize']['import']('../api/chatApplication/chatApplication.model');db[_0xf0ba('0x64')]=db[_0xf0ba('0x1')][_0xf0ba('0x13')](_0xf0ba('0x65'));db['ChatMessage']=db[_0xf0ba('0x1')][_0xf0ba('0x13')](_0xf0ba('0x66'));db[_0xf0ba('0x67')]=db[_0xf0ba('0x1')][_0xf0ba('0x13')](_0xf0ba('0x68'));db['ChatQueue']=db['sequelize']['import'](_0xf0ba('0x69'));db[_0xf0ba('0x6a')]=db['sequelize']['import'](_0xf0ba('0x6b'));db[_0xf0ba('0x6c')]=db[_0xf0ba('0x1')]['import'](_0xf0ba('0x6d'));db['CmCompany']=db['sequelize'][_0xf0ba('0x13')](_0xf0ba('0x6e'));db[_0xf0ba('0x6f')]=db[_0xf0ba('0x1')]['import']('../api/cmContact/cmContact.model');db[_0xf0ba('0x70')]=db[_0xf0ba('0x1')]['import'](_0xf0ba('0x71'));db[_0xf0ba('0x72')]=db[_0xf0ba('0x1')][_0xf0ba('0x13')]('../api/cmHopperBlack/cmHopperBlack.model');db[_0xf0ba('0x73')]=db[_0xf0ba('0x1')][_0xf0ba('0x13')](_0xf0ba('0x74'));db['CmHopperHistory']=db[_0xf0ba('0x1')]['import']('../api/cmHopperHistory/cmHopperHistory.model');db[_0xf0ba('0x75')]=db[_0xf0ba('0x1')][_0xf0ba('0x13')]('../api/reportAgentPreview/reportAgentPreview.model');db[_0xf0ba('0x76')]=db[_0xf0ba('0x1')]['import'](_0xf0ba('0x77'));db['Action']=db[_0xf0ba('0x1')][_0xf0ba('0x13')](_0xf0ba('0x78'));db['Automation']=db['sequelize'][_0xf0ba('0x13')](_0xf0ba('0x79'));db[_0xf0ba('0x7a')]=db[_0xf0ba('0x1')][_0xf0ba('0x13')]('../api/cannedAnswer/cannedAnswer.model');db[_0xf0ba('0x7b')]=db[_0xf0ba('0x1')]['import'](_0xf0ba('0x7c'));db[_0xf0ba('0x7d')]=db[_0xf0ba('0x1')]['import'](_0xf0ba('0x7e'));db[_0xf0ba('0x7f')]=db[_0xf0ba('0x1')][_0xf0ba('0x13')](_0xf0ba('0x80'));db[_0xf0ba('0x81')]=db[_0xf0ba('0x1')][_0xf0ba('0x13')](_0xf0ba('0x82'));db[_0xf0ba('0x83')]=db[_0xf0ba('0x1')][_0xf0ba('0x13')](_0xf0ba('0x84'));db['VoiceQueuesLog']=db[_0xf0ba('0x1')]['import'](_0xf0ba('0x85'));db[_0xf0ba('0x86')]=db[_0xf0ba('0x1')][_0xf0ba('0x13')](_0xf0ba('0x87'));db['Sound']=db['sequelize'][_0xf0ba('0x13')]('../api/sound/sound.model');db[_0xf0ba('0x88')]=db['sequelize'][_0xf0ba('0x13')](_0xf0ba('0x89'));db['Template']=db['sequelize'][_0xf0ba('0x13')](_0xf0ba('0x8a'));db['Trigger']=db['sequelize']['import'](_0xf0ba('0x8b'));db[_0xf0ba('0x8c')]=db[_0xf0ba('0x1')][_0xf0ba('0x13')](_0xf0ba('0x8d'));db[_0xf0ba('0x8e')]=db['sequelize'][_0xf0ba('0x13')](_0xf0ba('0x8f'));db[_0xf0ba('0x90')]=db[_0xf0ba('0x1')]['import']('../api/integrationReport/integrationReport.model');db[_0xf0ba('0x91')]=db[_0xf0ba('0x1')][_0xf0ba('0x13')](_0xf0ba('0x92'));db[_0xf0ba('0x93')]=db[_0xf0ba('0x1')][_0xf0ba('0x13')](_0xf0ba('0x94'));db['AnalyticExtractedReport']=db[_0xf0ba('0x1')][_0xf0ba('0x13')](_0xf0ba('0x95'));db[_0xf0ba('0x96')]=db[_0xf0ba('0x1')][_0xf0ba('0x13')](_0xf0ba('0x97'));db[_0xf0ba('0x98')]=db[_0xf0ba('0x1')][_0xf0ba('0x13')](_0xf0ba('0x99'));db[_0xf0ba('0x9a')]=db['sequelize'][_0xf0ba('0x13')](_0xf0ba('0x9b'));db[_0xf0ba('0x9c')]=db[_0xf0ba('0x1')][_0xf0ba('0x13')](_0xf0ba('0x9d'));db[_0xf0ba('0x9e')]=db[_0xf0ba('0x1')][_0xf0ba('0x13')]('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db[_0xf0ba('0x9f')]=db[_0xf0ba('0x1')][_0xf0ba('0x13')](_0xf0ba('0xa0'));db['SugarcrmAccount']=db[_0xf0ba('0x1')]['import']('../api/intSugarcrmAccount/intSugarcrmAccount.model');db['SugarcrmConfiguration']=db[_0xf0ba('0x1')][_0xf0ba('0x13')](_0xf0ba('0xa1'));db['SugarcrmField']=db[_0xf0ba('0x1')][_0xf0ba('0x13')](_0xf0ba('0xa2'));db[_0xf0ba('0xa3')]=db['sequelize'][_0xf0ba('0x13')]('../api/intDeskAccount/intDeskAccount.model');db['DeskConfiguration']=db[_0xf0ba('0x1')][_0xf0ba('0x13')](_0xf0ba('0xa4'));db[_0xf0ba('0xa5')]=db[_0xf0ba('0x1')][_0xf0ba('0x13')](_0xf0ba('0xa6'));db[_0xf0ba('0xa7')]=db[_0xf0ba('0x1')][_0xf0ba('0x13')](_0xf0ba('0xa8'));db[_0xf0ba('0xa9')]=db[_0xf0ba('0x1')][_0xf0ba('0x13')]('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0xf0ba('0xaa')]=db[_0xf0ba('0x1')][_0xf0ba('0x13')](_0xf0ba('0xab'));db[_0xf0ba('0xac')]=db['sequelize'][_0xf0ba('0x13')](_0xf0ba('0xad'));db[_0xf0ba('0xae')]=db[_0xf0ba('0x1')][_0xf0ba('0x13')](_0xf0ba('0xaf'));db['ZendeskField']=db[_0xf0ba('0x1')][_0xf0ba('0x13')]('../api/intZendeskField/intZendeskField.model');db[_0xf0ba('0xb0')]=db['sequelize'][_0xf0ba('0x13')](_0xf0ba('0xb1'));db[_0xf0ba('0xb2')]=db[_0xf0ba('0x1')][_0xf0ba('0x13')](_0xf0ba('0xb3'));db[_0xf0ba('0xb4')]=db['sequelize'][_0xf0ba('0x13')](_0xf0ba('0xb5'));db[_0xf0ba('0xb6')]=db['sequelize']['import']('../api/intVtigerAccount/intVtigerAccount.model');db['VtigerConfiguration']=db[_0xf0ba('0x1')]['import'](_0xf0ba('0xb7'));db['VtigerField']=db[_0xf0ba('0x1')][_0xf0ba('0x13')](_0xf0ba('0xb8'));db[_0xf0ba('0xb9')]=db[_0xf0ba('0x1')][_0xf0ba('0x13')](_0xf0ba('0xba'));db['ServicenowConfiguration']=db['sequelize'][_0xf0ba('0x13')](_0xf0ba('0xbb'));db[_0xf0ba('0xbc')]=db['sequelize'][_0xf0ba('0x13')](_0xf0ba('0xbd'));db[_0xf0ba('0xbe')]=db[_0xf0ba('0x1')][_0xf0ba('0x13')](_0xf0ba('0xbf'));db[_0xf0ba('0xc0')]=db['sequelize'][_0xf0ba('0x13')]('../api/intDynamics365Configuration/intDynamics365Configuration.model');db[_0xf0ba('0xc1')]=db['sequelize'][_0xf0ba('0x13')](_0xf0ba('0xc2'));db[_0xf0ba('0x8e')]=db['sequelize'][_0xf0ba('0x13')](_0xf0ba('0x8f'));db[_0xf0ba('0xc3')]=db[_0xf0ba('0x1')][_0xf0ba('0x13')]('../api/network/network.model');db['ChatQueueReport']=db[_0xf0ba('0x1')][_0xf0ba('0x13')](_0xf0ba('0xc4'));db['ChatInternalMessage']=db[_0xf0ba('0x1')]['import']('../api/chatInternalMessage/chatInternalMessage.model');db[_0xf0ba('0xc5')]=db[_0xf0ba('0x1')][_0xf0ba('0x13')](_0xf0ba('0xc6'));db[_0xf0ba('0xc7')]=db[_0xf0ba('0x1')][_0xf0ba('0x13')](_0xf0ba('0xc8'));db[_0xf0ba('0xc9')]=db['sequelize']['import'](_0xf0ba('0xca'));db[_0xf0ba('0xcb')]=db[_0xf0ba('0x1')][_0xf0ba('0x13')](_0xf0ba('0xcc'));db[_0xf0ba('0xcd')]=db['sequelize'][_0xf0ba('0x13')]('../api/squareReport/squareReport.model');db[_0xf0ba('0xce')]=db['sequelize'][_0xf0ba('0x13')](_0xf0ba('0xcf'));db['JscriptyProject']=db[_0xf0ba('0x1')][_0xf0ba('0x13')](_0xf0ba('0xd0'));db[_0xf0ba('0xd1')]=db[_0xf0ba('0x1')]['import'](_0xf0ba('0xd2'));db[_0xf0ba('0xd3')]=db[_0xf0ba('0x1')][_0xf0ba('0x13')](_0xf0ba('0xd4'));db[_0xf0ba('0xd5')]=db[_0xf0ba('0x1')][_0xf0ba('0x13')](_0xf0ba('0xd6'));db[_0xf0ba('0xd7')]=db['sequelize'][_0xf0ba('0x13')](_0xf0ba('0xd8'));db[_0xf0ba('0xd9')]=db['sequelize'][_0xf0ba('0x13')](_0xf0ba('0xda'));db[_0xf0ba('0xdb')]=db[_0xf0ba('0x1')][_0xf0ba('0x13')](_0xf0ba('0xdc'));db[_0xf0ba('0xdd')]=db[_0xf0ba('0x1')][_0xf0ba('0x13')](_0xf0ba('0xde'));db['Campaign']=db['sequelize'][_0xf0ba('0x13')](_0xf0ba('0xdf'));db[_0xf0ba('0xe0')]=db[_0xf0ba('0x1')][_0xf0ba('0x13')](_0xf0ba('0xe1'));db[_0xf0ba('0xe2')]=db[_0xf0ba('0x1')][_0xf0ba('0x13')](_0xf0ba('0xe3'));db[_0xf0ba('0xe4')]=db[_0xf0ba('0x1')]['import'](_0xf0ba('0xe5'));db['MailTransferReport']=db[_0xf0ba('0x1')][_0xf0ba('0x13')](_0xf0ba('0xe6'));db[_0xf0ba('0xe7')]=db[_0xf0ba('0x1')]['import']('../api/chatTransferReport/chatTransferReport.model');db['FaxTransferReport']=db['sequelize'][_0xf0ba('0x13')](_0xf0ba('0xe8'));db[_0xf0ba('0xe9')]=db[_0xf0ba('0x1')][_0xf0ba('0x13')](_0xf0ba('0xea'));db[_0xf0ba('0xeb')]=db['sequelize'][_0xf0ba('0x13')](_0xf0ba('0xec'));db['CmList']=db['sequelize']['import'](_0xf0ba('0xed'));db[_0xf0ba('0xee')]=db[_0xf0ba('0x1')]['import'](_0xf0ba('0xef'));db[_0xf0ba('0xf0')]=db[_0xf0ba('0x1')][_0xf0ba('0x13')]('../api/userProfile/userProfile.model');db[_0xf0ba('0xf1')]=db[_0xf0ba('0x1')][_0xf0ba('0x13')](_0xf0ba('0xf2'));db['UserProfileResource']=db[_0xf0ba('0x1')][_0xf0ba('0x13')](_0xf0ba('0xf3'));db[_0xf0ba('0x12')][_0xf0ba('0xf4')](db[_0xf0ba('0xf5')],{'as':_0xf0ba('0xf5'),'onDelete':'cascade','foreignKey':_0xf0ba('0xf6')});db[_0xf0ba('0x12')][_0xf0ba('0xf7')](db['VoiceRecording'],{'as':'Recordings','foreignKey':'UserId'});db[_0xf0ba('0x12')][_0xf0ba('0xf7')](db[_0xf0ba('0x2a')],{'as':_0xf0ba('0xf8'),'foreignKey':_0xf0ba('0xf6')});db[_0xf0ba('0x12')][_0xf0ba('0xf7')](db[_0xf0ba('0x19')],{'as':_0xf0ba('0xf9'),'onDelete':_0xf0ba('0xfa'),'hooks':!![]});db[_0xf0ba('0x12')][_0xf0ba('0xf7')](db['CmHopperFinal'],{'as':_0xf0ba('0xfb'),'foreignKey':_0xf0ba('0xf6')});db['User']['hasMany'](db[_0xf0ba('0xfc')],{'as':'HopperHistory','foreignKey':_0xf0ba('0xf6')});db[_0xf0ba('0x12')]['hasMany'](db[_0xf0ba('0x75')],{'as':'ReportAgentPreview','foreignKey':_0xf0ba('0xf6')});db[_0xf0ba('0x12')]['hasMany'](db['OpenchannelInteraction'],{'as':'OpenchannelInteractions','foreignKey':_0xf0ba('0xf6')});db[_0xf0ba('0x12')][_0xf0ba('0xf7')](db['ChatInteraction'],{'as':'ChatInteractions','foreignKey':_0xf0ba('0xf6')});db[_0xf0ba('0x12')][_0xf0ba('0xf7')](db['SmsInteraction'],{'as':_0xf0ba('0xfd'),'foreignKey':_0xf0ba('0xf6')});db[_0xf0ba('0x12')][_0xf0ba('0xf7')](db[_0xf0ba('0x45')],{'as':_0xf0ba('0xfe'),'foreignKey':'UserId'});db['User'][_0xf0ba('0xf7')](db[_0xf0ba('0xff')],{'as':'MailInteractions','foreignKey':_0xf0ba('0xf6')});db['User'][_0xf0ba('0x100')](db[_0xf0ba('0xf0')],{'as':_0xf0ba('0xf0'),'foreignKey':_0xf0ba('0x101')});db[_0xf0ba('0x12')][_0xf0ba('0x102')](db[_0xf0ba('0x6a')],{'as':_0xf0ba('0x103'),'through':_0xf0ba('0x104')});db[_0xf0ba('0x12')][_0xf0ba('0x102')](db['CmContact'],{'as':_0xf0ba('0x105'),'through':'cm_user_has_contacts'});db['User']['belongsToMany'](db[_0xf0ba('0x106')],{'as':_0xf0ba('0x107'),'through':_0xf0ba('0x108')});db[_0xf0ba('0x12')][_0xf0ba('0x102')](db[_0xf0ba('0xdb')],{'through':_0xf0ba('0x109')});db[_0xf0ba('0x12')][_0xf0ba('0x102')](db[_0xf0ba('0xff')],{'as':_0xf0ba('0x10a'),'through':_0xf0ba('0x10b')});db[_0xf0ba('0x12')][_0xf0ba('0x102')](db[_0xf0ba('0x64')],{'as':_0xf0ba('0x10c'),'through':'user_has_chat_interactions'});db[_0xf0ba('0x12')][_0xf0ba('0x102')](db[_0xf0ba('0x45')],{'as':_0xf0ba('0xfe'),'through':'user_has_fax_interactions'});db['User']['belongsToMany'](db[_0xf0ba('0x51')],{'as':_0xf0ba('0xfd'),'through':_0xf0ba('0x10d')});db['User'][_0xf0ba('0x102')](db[_0xf0ba('0x5a')],{'as':_0xf0ba('0x10e'),'through':'user_has_openchannel_interactions'});db[_0xf0ba('0x12')]['belongsToMany'](db[_0xf0ba('0x1d')],{'as':_0xf0ba('0x10f'),'through':'UserVoiceQueue','required':![]});db[_0xf0ba('0x12')]['belongsToMany'](db[_0xf0ba('0x37')],{'as':_0xf0ba('0x110'),'through':_0xf0ba('0x111'),'required':![]});db[_0xf0ba('0x12')][_0xf0ba('0x102')](db['ChatQueue'],{'as':'ChatQueues','through':_0xf0ba('0x112'),'required':![],'hooks':!![]});db[_0xf0ba('0x12')][_0xf0ba('0x102')](db[_0xf0ba('0x49')],{'as':_0xf0ba('0x113'),'through':_0xf0ba('0x114'),'required':![]});db[_0xf0ba('0x12')][_0xf0ba('0x102')](db[_0xf0ba('0x54')],{'as':_0xf0ba('0x115'),'through':_0xf0ba('0x2e'),'required':![]});db[_0xf0ba('0x12')][_0xf0ba('0x102')](db[_0xf0ba('0x5d')],{'as':_0xf0ba('0x116'),'through':'UserOpenchannelQueue','required':![]});db[_0xf0ba('0x12')][_0xf0ba('0x102')](db[_0xf0ba('0x106')],{'through':_0xf0ba('0x108')});db[_0xf0ba('0x12')][_0xf0ba('0x102')](db['VoicePrefix'],{'as':_0xf0ba('0x117'),'through':_0xf0ba('0x118'),'required':![]});db['User'][_0xf0ba('0x102')](db['ChatWebsite'],{'as':_0xf0ba('0x119'),'through':'user_has_chat_websites'});db[_0xf0ba('0x12')]['belongsToMany'](db[_0xf0ba('0x43')],{'as':_0xf0ba('0x11a'),'through':_0xf0ba('0x11b')});db['User'][_0xf0ba('0x102')](db[_0xf0ba('0x35')],{'as':'MailAccounts','through':_0xf0ba('0x11c')});db[_0xf0ba('0x12')]['belongsToMany'](db[_0xf0ba('0x56')],{'as':'OpenchannelAccounts','through':'user_has_openchannel_accounts'});db['User'][_0xf0ba('0x102')](db['SmsAccount'],{'as':_0xf0ba('0x11d'),'through':'user_has_sms_accounts'});db[_0xf0ba('0x12')]['belongsToMany'](db['SquareProject'],{'as':_0xf0ba('0x11e'),'through':'user_has_square_projects'});db[_0xf0ba('0x15')][_0xf0ba('0xf7')](db[_0xf0ba('0x19')],{'as':'SpiedAgents','onDelete':'cascade','foreignKey':_0xf0ba('0x11f')});db[_0xf0ba('0x17')]['hasMany'](db['VoiceExtension'],{'onDelete':_0xf0ba('0xfa')});db[_0xf0ba('0x19')][_0xf0ba('0xf7')](db['VoiceExtension'],{'as':_0xf0ba('0x120'),'onDelete':'cascade'});db['VoiceMusicOnHold'][_0xf0ba('0x102')](db[_0xf0ba('0x121')],{'as':'Sounds','through':_0xf0ba('0x122')});db[_0xf0ba('0x1d')][_0xf0ba('0xf7')](db[_0xf0ba('0x2a')],{'as':_0xf0ba('0x123'),'foreignKey':_0xf0ba('0x124')});db[_0xf0ba('0x1d')][_0xf0ba('0xf7')](db[_0xf0ba('0x70')],{'as':_0xf0ba('0x125'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0xf0ba('0xf7')](db[_0xf0ba('0x73')],{'as':_0xf0ba('0xfb'),'foreignKey':_0xf0ba('0x124')});db[_0xf0ba('0x1d')]['hasMany'](db[_0xf0ba('0xfc')],{'as':_0xf0ba('0x126'),'foreignKey':'VoiceQueueId'});db[_0xf0ba('0x1d')][_0xf0ba('0xf7')](db[_0xf0ba('0x75')],{'as':_0xf0ba('0x75'),'foreignKey':_0xf0ba('0x124')});db[_0xf0ba('0x1d')][_0xf0ba('0xf7')](db[_0xf0ba('0x72')],{'as':_0xf0ba('0x127'),'foreignKey':_0xf0ba('0x124')});db[_0xf0ba('0x1d')][_0xf0ba('0xf7')](db[_0xf0ba('0xc9')],{'as':_0xf0ba('0x128'),'foreignKey':_0xf0ba('0x124')});db[_0xf0ba('0x1d')][_0xf0ba('0x100')](db[_0xf0ba('0x129')],{'as':_0xf0ba('0x129'),'foreignKey':_0xf0ba('0x12a')});db['VoiceQueue'][_0xf0ba('0x100')](db[_0xf0ba('0x129')],{'as':'TrunkBackup','foreignKey':_0xf0ba('0x12b')});db[_0xf0ba('0x1d')][_0xf0ba('0x100')](db[_0xf0ba('0x7f')],{'as':_0xf0ba('0x7f'),'foreignKey':_0xf0ba('0x12c')});db['VoiceQueue'][_0xf0ba('0x100')](db[_0xf0ba('0x81')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0xf0ba('0x1d')]['belongsToMany'](db[_0xf0ba('0x106')],{'as':'Lists','through':_0xf0ba('0x12d')});db['VoiceQueue']['belongsToMany'](db[_0xf0ba('0x12')],{'as':_0xf0ba('0x12e'),'through':_0xf0ba('0x2c')});db[_0xf0ba('0x1d')][_0xf0ba('0x102')](db['Team'],{'as':'Teams','through':'team_has_voice_queues'});db[_0xf0ba('0x1d')][_0xf0ba('0x102')](db['CmList'],{'as':_0xf0ba('0x12f'),'through':'voice_queues_has_cm_blacklists'});db['VoiceRecording']['belongsTo'](db[_0xf0ba('0x12')],{'as':_0xf0ba('0x12'),'foreignKey':_0xf0ba('0xf6')});db[_0xf0ba('0x130')][_0xf0ba('0x100')](db['User'],{'as':_0xf0ba('0x12'),'foreignKey':_0xf0ba('0xf6')});db[_0xf0ba('0xf5')][_0xf0ba('0xf7')](db[_0xf0ba('0x22')],{'as':'Messages','onDelete':'cascade','foreignKey':_0xf0ba('0x131'),'sourceKey':_0xf0ba('0x132')});db[_0xf0ba('0x22')][_0xf0ba('0x100')](db[_0xf0ba('0xf5')],{'foreignKey':_0xf0ba('0x131'),'targetKey':_0xf0ba('0x132')});db[_0xf0ba('0x133')][_0xf0ba('0xf7')](db[_0xf0ba('0x25')],{'as':_0xf0ba('0x134'),'foreignKey':_0xf0ba('0x135'),'constraints':![]});db[_0xf0ba('0x133')][_0xf0ba('0xf7')](db[_0xf0ba('0x136')],{'as':_0xf0ba('0x137'),'foreignKey':_0xf0ba('0x135'),'constraints':![]});db[_0xf0ba('0x133')][_0xf0ba('0x100')](db[_0xf0ba('0x12')],{'as':'User','foreignKey':_0xf0ba('0xf6')});db[_0xf0ba('0x133')]['belongsTo'](db['CmContact'],{'as':_0xf0ba('0x138'),'foreignKey':'ContactId'});db[_0xf0ba('0x32')]['belongsTo'](db[_0xf0ba('0x35')],{'as':_0xf0ba('0x35'),'foreignKey':_0xf0ba('0x139')});db[_0xf0ba('0x33')]['belongsTo'](db['MailAccount'],{'as':_0xf0ba('0x35'),'foreignKey':_0xf0ba('0x139')});db[_0xf0ba('0x35')]['hasOne'](db[_0xf0ba('0x32')],{'as':_0xf0ba('0x13a'),'onDelete':'cascade'});db['MailAccount'][_0xf0ba('0xf4')](db[_0xf0ba('0x33')],{'as':_0xf0ba('0x13b'),'onDelete':'cascade'});db[_0xf0ba('0x35')][_0xf0ba('0xf7')](db[_0xf0ba('0x7b')],{'as':_0xf0ba('0x13c'),'foreignKey':_0xf0ba('0x139')});db[_0xf0ba('0x35')]['hasMany'](db[_0xf0ba('0x7a')],{'as':'Answers','foreignKey':'MailAccountId'});db[_0xf0ba('0x35')][_0xf0ba('0xf7')](db['MailMessage'],{'as':'Messages','foreignKey':_0xf0ba('0x139')});db[_0xf0ba('0x35')][_0xf0ba('0xf7')](db['MailInteraction'],{'as':_0xf0ba('0x13d')});db['MailAccount'][_0xf0ba('0xf7')](db[_0xf0ba('0x3d')],{'as':_0xf0ba('0x120')});db[_0xf0ba('0x35')][_0xf0ba('0x100')](db[_0xf0ba('0x106')],{'as':_0xf0ba('0x13e'),'foreignKey':'ListId'});db[_0xf0ba('0x35')][_0xf0ba('0x100')](db[_0xf0ba('0x13f')],{'as':_0xf0ba('0x13f'),'foreignKey':_0xf0ba('0x140')});db[_0xf0ba('0x35')][_0xf0ba('0x100')](db[_0xf0ba('0x81')],{'as':_0xf0ba('0x141'),'foreignKey':_0xf0ba('0x142')});db[_0xf0ba('0x35')][_0xf0ba('0x102')](db[_0xf0ba('0x12')],{'as':'Agents','through':_0xf0ba('0x11c')});db[_0xf0ba('0x37')][_0xf0ba('0x102')](db['User'],{'as':'Agents','through':_0xf0ba('0x111')});db[_0xf0ba('0x37')][_0xf0ba('0x102')](db[_0xf0ba('0xdb')],{'through':'team_has_mail_queues','as':_0xf0ba('0x143')});db[_0xf0ba('0xff')]['hasMany'](db['MailMessage'],{'as':_0xf0ba('0x144'),'onDelete':'cascade','foreignKey':_0xf0ba('0x145')});db['MailInteraction']['belongsTo'](db[_0xf0ba('0x35')],{'as':'Account','foreignKey':_0xf0ba('0x139')});db[_0xf0ba('0xff')]['belongsTo'](db[_0xf0ba('0x6f')],{'as':_0xf0ba('0x138'),'foreignKey':_0xf0ba('0x146')});db[_0xf0ba('0xff')]['belongsTo'](db['User'],{'as':_0xf0ba('0x147'),'foreignKey':_0xf0ba('0xf6')});db[_0xf0ba('0xff')]['belongsToMany'](db[_0xf0ba('0x88')],{'through':_0xf0ba('0x148'),'as':_0xf0ba('0x149')});db[_0xf0ba('0xff')][_0xf0ba('0x102')](db[_0xf0ba('0x88')],{'through':_0xf0ba('0x148'),'as':_0xf0ba('0x14a')});db['MailInteraction'][_0xf0ba('0x102')](db[_0xf0ba('0x12')],{'as':'Users','through':_0xf0ba('0x10b'),'foreignKey':_0xf0ba('0x145')});db[_0xf0ba('0x3b')][_0xf0ba('0xf7')](db[_0xf0ba('0xe2')],{'as':_0xf0ba('0x14b'),'onDelete':_0xf0ba('0xfa')});db[_0xf0ba('0x3b')][_0xf0ba('0x100')](db['User'],{'as':_0xf0ba('0x12')});db['MailMessage']['belongsTo'](db[_0xf0ba('0x6f')],{'onDelete':_0xf0ba('0xfa'),'as':'Contact'});db[_0xf0ba('0x3b')]['belongsTo'](db[_0xf0ba('0xff')],{'as':_0xf0ba('0x14c'),'foreignKey':_0xf0ba('0x145')});db['MailMessage'][_0xf0ba('0x100')](db[_0xf0ba('0x35')],{'as':_0xf0ba('0x14d'),'foreignKey':_0xf0ba('0x139')});db[_0xf0ba('0x3d')][_0xf0ba('0x100')](db[_0xf0ba('0x12')],{'onDelete':_0xf0ba('0x14e')});db['MailApplication']['belongsTo'](db[_0xf0ba('0x37')],{'onDelete':_0xf0ba('0x14e')});db[_0xf0ba('0x3d')][_0xf0ba('0x100')](db['MailAccount'],{'onDelete':_0xf0ba('0x14e')});db[_0xf0ba('0x3d')][_0xf0ba('0x100')](db['Interval'],{'onDelete':_0xf0ba('0x14e'),'foreignKey':'IntervalId'});db[_0xf0ba('0x3d')][_0xf0ba('0x100')](db[_0xf0ba('0x88')],{'onDelete':_0xf0ba('0x14e'),'foreignKey':'TagId'});db[_0xf0ba('0x14f')][_0xf0ba('0x100')](db[_0xf0ba('0x35')],{});db[_0xf0ba('0x14f')][_0xf0ba('0x100')](db[_0xf0ba('0x106')],{'as':'List','foreignKey':'ListId'});db['MailQueueReport'][_0xf0ba('0x100')](db[_0xf0ba('0x6f')],{'as':_0xf0ba('0x138'),'foreignKey':_0xf0ba('0x146')});db['MailQueueReport'][_0xf0ba('0x100')](db[_0xf0ba('0xff')],{});db[_0xf0ba('0x14f')]['belongsTo'](db[_0xf0ba('0x3b')],{});db['MailQueueReport'][_0xf0ba('0x100')](db[_0xf0ba('0x12')],{});db[_0xf0ba('0x14f')]['belongsTo'](db[_0xf0ba('0x37')],{});db[_0xf0ba('0x3f')]['hasMany'](db[_0xf0ba('0x41')],{'as':_0xf0ba('0x150'),'onDelete':_0xf0ba('0xfa')});db[_0xf0ba('0x43')]['hasMany'](db[_0xf0ba('0x7b')],{'as':_0xf0ba('0x13c'),'foreignKey':_0xf0ba('0x151')});db['FaxAccount'][_0xf0ba('0xf7')](db['CannedAnswer'],{'as':_0xf0ba('0x152'),'foreignKey':_0xf0ba('0x151')});db[_0xf0ba('0x43')][_0xf0ba('0xf7')](db['FaxInteraction'],{'as':_0xf0ba('0x13d')});db[_0xf0ba('0x43')][_0xf0ba('0xf7')](db['FaxApplication'],{'as':_0xf0ba('0x120')});db[_0xf0ba('0x43')][_0xf0ba('0xf7')](db[_0xf0ba('0x19')],{'as':_0xf0ba('0x153'),'onDelete':_0xf0ba('0xfa')});db[_0xf0ba('0x43')][_0xf0ba('0xf7')](db['FaxMessage'],{'as':_0xf0ba('0x144')});db[_0xf0ba('0x43')][_0xf0ba('0x100')](db[_0xf0ba('0x129')],{'as':_0xf0ba('0x129')});db[_0xf0ba('0x43')][_0xf0ba('0x100')](db['CmList'],{'as':_0xf0ba('0x13e'),'foreignKey':_0xf0ba('0x154')});db['FaxAccount']['belongsTo'](db[_0xf0ba('0x81')],{'as':_0xf0ba('0x141'),'foreignKey':_0xf0ba('0x142')});db[_0xf0ba('0x43')][_0xf0ba('0x102')](db[_0xf0ba('0x12')],{'as':'Agents','through':_0xf0ba('0x11b')});db[_0xf0ba('0x155')][_0xf0ba('0x100')](db[_0xf0ba('0x12')],{'onDelete':'restrict'});db[_0xf0ba('0x155')][_0xf0ba('0x100')](db[_0xf0ba('0x49')],{'onDelete':'restrict'});db[_0xf0ba('0x155')][_0xf0ba('0x100')](db[_0xf0ba('0x43')],{'onDelete':'restrict'});db[_0xf0ba('0x155')][_0xf0ba('0x100')](db[_0xf0ba('0x88')],{'onDelete':_0xf0ba('0x14e'),'foreignKey':'TagId'});db[_0xf0ba('0x45')]['hasMany'](db[_0xf0ba('0x47')],{'as':_0xf0ba('0x144'),'onDelete':_0xf0ba('0xfa'),'foreignKey':_0xf0ba('0x156')});db['FaxInteraction'][_0xf0ba('0x100')](db['FaxAccount'],{'as':_0xf0ba('0x14d'),'foreignKey':_0xf0ba('0x151')});db[_0xf0ba('0x45')][_0xf0ba('0x100')](db[_0xf0ba('0x6f')],{'as':_0xf0ba('0x138'),'foreignKey':'ContactId'});db[_0xf0ba('0x45')][_0xf0ba('0x100')](db[_0xf0ba('0x12')],{'as':_0xf0ba('0x147'),'foreignKey':_0xf0ba('0xf6')});db[_0xf0ba('0x45')]['belongsToMany'](db[_0xf0ba('0x88')],{'through':_0xf0ba('0x157'),'as':_0xf0ba('0x149')});db['FaxInteraction'][_0xf0ba('0x102')](db['Tag'],{'through':_0xf0ba('0x157'),'as':_0xf0ba('0x14a')});db['FaxInteraction'][_0xf0ba('0x102')](db[_0xf0ba('0x12')],{'as':'Users','through':_0xf0ba('0x158'),'foreignKey':_0xf0ba('0x156')});db[_0xf0ba('0x47')][_0xf0ba('0x100')](db['User'],{'onDelete':_0xf0ba('0xfa'),'as':_0xf0ba('0x12')});db[_0xf0ba('0x47')][_0xf0ba('0x100')](db[_0xf0ba('0x45')],{'as':_0xf0ba('0x14c'),'foreignKey':_0xf0ba('0x156')});db[_0xf0ba('0x47')]['belongsTo'](db['CmContact'],{'onDelete':_0xf0ba('0xfa'),'as':_0xf0ba('0x138')});db[_0xf0ba('0x47')]['belongsTo'](db[_0xf0ba('0xe2')],{'as':'Attachment','foreignKey':_0xf0ba('0x159')});db[_0xf0ba('0x47')]['belongsTo'](db[_0xf0ba('0x43')],{'as':_0xf0ba('0x14d'),'foreignKey':_0xf0ba('0x151')});db[_0xf0ba('0x49')]['belongsToMany'](db['User'],{'as':_0xf0ba('0x12e'),'through':_0xf0ba('0x114')});db['FaxQueue']['belongsToMany'](db[_0xf0ba('0xdb')],{'through':_0xf0ba('0x15a'),'as':_0xf0ba('0x143')});db[_0xf0ba('0x4b')][_0xf0ba('0x100')](db[_0xf0ba('0x43')],{});db[_0xf0ba('0x4b')]['belongsTo'](db[_0xf0ba('0x106')],{'as':_0xf0ba('0x13e'),'foreignKey':'ListId'});db[_0xf0ba('0x4b')][_0xf0ba('0x100')](db[_0xf0ba('0x6f')],{'as':_0xf0ba('0x138'),'foreignKey':_0xf0ba('0x146')});db[_0xf0ba('0x4b')][_0xf0ba('0x100')](db[_0xf0ba('0x45')],{});db[_0xf0ba('0x4b')]['belongsTo'](db[_0xf0ba('0x47')],{});db[_0xf0ba('0x4b')][_0xf0ba('0x100')](db[_0xf0ba('0x12')],{});db[_0xf0ba('0x4b')][_0xf0ba('0x100')](db[_0xf0ba('0x49')],{});db[_0xf0ba('0x4d')][_0xf0ba('0xf7')](db['Disposition'],{'as':'Dispositions','foreignKey':_0xf0ba('0x15b')});db['SmsAccount'][_0xf0ba('0xf7')](db[_0xf0ba('0x7a')],{'as':'Answers','foreignKey':_0xf0ba('0x15b')});db[_0xf0ba('0x4d')][_0xf0ba('0xf7')](db['SmsMessage'],{'as':_0xf0ba('0x144'),'foreignKey':_0xf0ba('0x15b')});db['SmsAccount'][_0xf0ba('0xf7')](db['SmsInteraction'],{'as':_0xf0ba('0x13d')});db[_0xf0ba('0x4d')]['hasMany'](db[_0xf0ba('0x4f')],{'as':_0xf0ba('0x120')});db['SmsAccount']['belongsTo'](db[_0xf0ba('0x106')],{'as':_0xf0ba('0x13e'),'foreignKey':_0xf0ba('0x154')});db[_0xf0ba('0x4d')][_0xf0ba('0x100')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0xf0ba('0x142')});db['SmsAccount'][_0xf0ba('0x102')](db[_0xf0ba('0x12')],{'as':_0xf0ba('0x12e'),'through':_0xf0ba('0x15c')});db['SmsApplication'][_0xf0ba('0x100')](db[_0xf0ba('0x12')],{'onDelete':_0xf0ba('0x14e')});db['SmsApplication'][_0xf0ba('0x100')](db[_0xf0ba('0x54')],{'onDelete':_0xf0ba('0x14e')});db[_0xf0ba('0x4f')][_0xf0ba('0x100')](db[_0xf0ba('0x4d')],{'onDelete':_0xf0ba('0x14e')});db['SmsApplication'][_0xf0ba('0x100')](db[_0xf0ba('0x7f')],{'onDelete':_0xf0ba('0x14e'),'foreignKey':_0xf0ba('0x12c')});db[_0xf0ba('0x4f')][_0xf0ba('0x100')](db[_0xf0ba('0x88')],{'onDelete':_0xf0ba('0x14e'),'foreignKey':'TagId'});db['SmsInteraction'][_0xf0ba('0xf7')](db['SmsMessage'],{'as':_0xf0ba('0x144'),'onDelete':_0xf0ba('0xfa'),'foreignKey':'SmsInteractionId'});db[_0xf0ba('0x51')][_0xf0ba('0x100')](db[_0xf0ba('0x4d')],{'as':_0xf0ba('0x14d'),'foreignKey':_0xf0ba('0x15b')});db[_0xf0ba('0x51')][_0xf0ba('0x100')](db[_0xf0ba('0x6f')],{'as':'Contact','foreignKey':_0xf0ba('0x146')});db[_0xf0ba('0x51')]['belongsTo'](db[_0xf0ba('0x12')],{'as':_0xf0ba('0x147'),'foreignKey':'UserId'});db['SmsInteraction'][_0xf0ba('0x102')](db[_0xf0ba('0x88')],{'through':_0xf0ba('0x15d'),'as':_0xf0ba('0x149')});db[_0xf0ba('0x51')][_0xf0ba('0x102')](db[_0xf0ba('0x88')],{'through':_0xf0ba('0x15d'),'as':'ThroughTags'});db[_0xf0ba('0x51')][_0xf0ba('0x102')](db[_0xf0ba('0x12')],{'as':'Users','through':_0xf0ba('0x10d'),'foreignKey':'SmsInteractionId'});db['SmsMessage'][_0xf0ba('0x100')](db['User'],{'as':'User'});db[_0xf0ba('0x53')][_0xf0ba('0x100')](db[_0xf0ba('0x6f')],{'onDelete':'cascade','as':'Contact'});db['SmsMessage'][_0xf0ba('0x100')](db[_0xf0ba('0x51')],{'onDelete':'cascade','as':_0xf0ba('0x14c'),'foreignKey':'SmsInteractionId'});db[_0xf0ba('0x53')][_0xf0ba('0x100')](db[_0xf0ba('0x4d')],{'as':_0xf0ba('0x14d'),'foreignKey':_0xf0ba('0x15b')});db[_0xf0ba('0x54')][_0xf0ba('0x102')](db[_0xf0ba('0x12')],{'as':'Agents','through':'UserSmsQueue','foreignKey':_0xf0ba('0x15e')});db[_0xf0ba('0x54')][_0xf0ba('0x102')](db['Team'],{'through':'team_has_sms_queues','as':_0xf0ba('0x143')});db[_0xf0ba('0x56')]['hasMany'](db[_0xf0ba('0x7b')],{'as':_0xf0ba('0x13c'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0xf0ba('0xf7')](db[_0xf0ba('0x7a')],{'as':_0xf0ba('0x152'),'foreignKey':_0xf0ba('0x15f')});db[_0xf0ba('0x56')][_0xf0ba('0xf7')](db[_0xf0ba('0x5a')],{'as':_0xf0ba('0x13d'),'foreignKey':_0xf0ba('0x15f')});db[_0xf0ba('0x56')]['hasMany'](db['OpenchannelMessage'],{'as':_0xf0ba('0x144'),'foreignKey':_0xf0ba('0x15f')});db[_0xf0ba('0x56')][_0xf0ba('0xf7')](db['OpenchannelApplication'],{'as':'Applications','foreignKey':_0xf0ba('0x15f')});db['OpenchannelAccount']['belongsTo'](db['CmList'],{'as':_0xf0ba('0x13e'),'foreignKey':_0xf0ba('0x154')});db[_0xf0ba('0x56')][_0xf0ba('0x100')](db['Pause'],{'as':_0xf0ba('0x141'),'foreignKey':_0xf0ba('0x142')});db[_0xf0ba('0x56')][_0xf0ba('0x102')](db[_0xf0ba('0x12')],{'as':_0xf0ba('0x12e'),'through':_0xf0ba('0x160')});db['OpenchannelApplication'][_0xf0ba('0x100')](db[_0xf0ba('0x12')],{'onDelete':_0xf0ba('0x14e')});db['OpenchannelApplication']['belongsTo'](db['OpenchannelQueue'],{'onDelete':_0xf0ba('0x14e'),'foreignKey':_0xf0ba('0x161')});db[_0xf0ba('0x58')][_0xf0ba('0x100')](db[_0xf0ba('0x56')],{'onDelete':'restrict','foreignKey':'OpenchannelAccountId'});db[_0xf0ba('0x58')][_0xf0ba('0x100')](db[_0xf0ba('0x7f')],{'onDelete':_0xf0ba('0x14e'),'foreignKey':_0xf0ba('0x12c')});db['OpenchannelApplication'][_0xf0ba('0x100')](db[_0xf0ba('0x88')],{'onDelete':_0xf0ba('0x14e'),'foreignKey':_0xf0ba('0x162')});db['OpenchannelInteraction'][_0xf0ba('0xf7')](db[_0xf0ba('0x5c')],{'as':_0xf0ba('0x144'),'onDelete':_0xf0ba('0xfa'),'foreignKey':_0xf0ba('0x163')});db[_0xf0ba('0x5a')][_0xf0ba('0x100')](db[_0xf0ba('0x56')],{'as':_0xf0ba('0x14d'),'foreignKey':_0xf0ba('0x15f')});db[_0xf0ba('0x5a')][_0xf0ba('0x100')](db[_0xf0ba('0x6f')],{'as':_0xf0ba('0x138'),'foreignKey':_0xf0ba('0x146')});db['OpenchannelInteraction'][_0xf0ba('0x100')](db[_0xf0ba('0x12')],{'as':_0xf0ba('0x147'),'foreignKey':_0xf0ba('0xf6')});db[_0xf0ba('0x5a')]['belongsToMany'](db[_0xf0ba('0x88')],{'through':_0xf0ba('0x164'),'as':_0xf0ba('0x149')});db[_0xf0ba('0x5a')][_0xf0ba('0x102')](db[_0xf0ba('0x88')],{'through':_0xf0ba('0x164'),'as':_0xf0ba('0x14a')});db[_0xf0ba('0x5a')]['belongsToMany'](db['User'],{'as':_0xf0ba('0x165'),'through':_0xf0ba('0x166'),'foreignKey':_0xf0ba('0x163')});db['OpenchannelMessage']['belongsTo'](db[_0xf0ba('0x12')],{'onDelete':'cascade','as':'User'});db[_0xf0ba('0x5c')]['belongsTo'](db['CmContact'],{'onDelete':'cascade','as':_0xf0ba('0x138')});db[_0xf0ba('0x5c')][_0xf0ba('0x100')](db[_0xf0ba('0x5a')],{'onDelete':_0xf0ba('0xfa'),'as':_0xf0ba('0x14c'),'foreignKey':_0xf0ba('0x163')});db[_0xf0ba('0x5c')][_0xf0ba('0x100')](db[_0xf0ba('0xe2')],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0xf0ba('0x5c')][_0xf0ba('0x100')](db[_0xf0ba('0x56')],{'as':'Account','foreignKey':_0xf0ba('0x15f')});db['OpenchannelQueue'][_0xf0ba('0x102')](db[_0xf0ba('0x12')],{'as':_0xf0ba('0x12e'),'through':_0xf0ba('0x30'),'foreignKey':_0xf0ba('0x161')});db[_0xf0ba('0x5d')][_0xf0ba('0x102')](db[_0xf0ba('0xdb')],{'through':_0xf0ba('0x167'),'as':'Teams'});db[_0xf0ba('0x5f')][_0xf0ba('0xf7')](db[_0xf0ba('0x7b')],{'as':_0xf0ba('0x13c'),'foreignKey':'ChatWebsiteId'});db[_0xf0ba('0x5f')][_0xf0ba('0xf7')](db[_0xf0ba('0x7a')],{'as':_0xf0ba('0x152'),'foreignKey':_0xf0ba('0x168')});db['ChatWebsite'][_0xf0ba('0xf7')](db[_0xf0ba('0x6c')],{'as':'ProactiveActions'});db[_0xf0ba('0x5f')][_0xf0ba('0xf7')](db[_0xf0ba('0x64')],{'as':_0xf0ba('0x13d')});db[_0xf0ba('0x5f')][_0xf0ba('0xf7')](db['ChatApplication'],{'as':'Applications'});db['ChatWebsite'][_0xf0ba('0xf7')](db['ChatMessage'],{'as':'Messages'});db[_0xf0ba('0x5f')][_0xf0ba('0x100')](db[_0xf0ba('0x106')],{'as':_0xf0ba('0x13e'),'foreignKey':_0xf0ba('0x154')});db['ChatWebsite'][_0xf0ba('0x100')](db[_0xf0ba('0x7f')],{'as':_0xf0ba('0x7f'),'foreignKey':_0xf0ba('0x12c')});db['ChatWebsite'][_0xf0ba('0x100')](db[_0xf0ba('0x81')],{'as':_0xf0ba('0x141'),'foreignKey':_0xf0ba('0x142')});db['ChatWebsite'][_0xf0ba('0x102')](db['User'],{'as':_0xf0ba('0x12e'),'through':_0xf0ba('0x169')});db[_0xf0ba('0x61')][_0xf0ba('0x100')](db[_0xf0ba('0x56')],{});db[_0xf0ba('0x61')]['belongsTo'](db[_0xf0ba('0x106')],{'as':_0xf0ba('0x13e'),'foreignKey':'ListId'});db['OpenchannelQueueReport'][_0xf0ba('0x100')](db[_0xf0ba('0x6f')],{'as':_0xf0ba('0x138'),'foreignKey':_0xf0ba('0x146')});db[_0xf0ba('0x61')]['belongsTo'](db['OpenchannelInteraction'],{});db[_0xf0ba('0x61')][_0xf0ba('0x100')](db['OpenchannelMessage'],{});db[_0xf0ba('0x61')][_0xf0ba('0x100')](db['User'],{});db[_0xf0ba('0x61')][_0xf0ba('0x100')](db['OpenchannelQueue'],{});db[_0xf0ba('0x63')][_0xf0ba('0x100')](db[_0xf0ba('0x12')],{'as':_0xf0ba('0x16a'),'foreignKey':_0xf0ba('0xf6'),'onDelete':_0xf0ba('0x14e')});db['ChatApplication'][_0xf0ba('0x100')](db[_0xf0ba('0x16b')],{'as':_0xf0ba('0x16c'),'foreignKey':_0xf0ba('0x16d'),'onDelete':_0xf0ba('0x14e')});db['ChatApplication'][_0xf0ba('0x100')](db['ChatWebsite'],{'as':_0xf0ba('0x16e'),'foreignKey':_0xf0ba('0x168'),'onDelete':_0xf0ba('0x14e')});db[_0xf0ba('0x63')]['belongsTo'](db[_0xf0ba('0x88')],{'onDelete':_0xf0ba('0x14e'),'foreignKey':_0xf0ba('0x162')});db[_0xf0ba('0x64')][_0xf0ba('0xf7')](db[_0xf0ba('0x16f')],{'as':_0xf0ba('0x144'),'onDelete':_0xf0ba('0xfa'),'foreignKey':_0xf0ba('0x170')});db[_0xf0ba('0x64')][_0xf0ba('0x100')](db[_0xf0ba('0x5f')],{'as':_0xf0ba('0x14d'),'foreignKey':'ChatWebsiteId'});db[_0xf0ba('0x64')]['belongsTo'](db[_0xf0ba('0x6f')],{'as':'Contact','foreignKey':_0xf0ba('0x146')});db[_0xf0ba('0x64')][_0xf0ba('0x100')](db[_0xf0ba('0x12')],{'as':_0xf0ba('0x147'),'foreignKey':_0xf0ba('0xf6')});db[_0xf0ba('0x64')][_0xf0ba('0x102')](db['Tag'],{'through':_0xf0ba('0x171'),'as':'Tags'});db['ChatInteraction']['belongsToMany'](db[_0xf0ba('0x88')],{'through':'chat_interaction_has_tags','as':_0xf0ba('0x14a')});db[_0xf0ba('0x64')][_0xf0ba('0x102')](db[_0xf0ba('0x12')],{'as':'Users','through':_0xf0ba('0x172'),'foreignKey':_0xf0ba('0x170')});db[_0xf0ba('0x16f')][_0xf0ba('0x100')](db[_0xf0ba('0x12')],{'onDelete':_0xf0ba('0xfa'),'as':_0xf0ba('0x12')});db[_0xf0ba('0x16f')]['belongsTo'](db[_0xf0ba('0x6f')],{'onDelete':_0xf0ba('0xfa'),'as':_0xf0ba('0x138'),'foreignKey':_0xf0ba('0x146')});db[_0xf0ba('0x16f')]['belongsTo'](db[_0xf0ba('0x64')],{'onDelete':_0xf0ba('0xfa'),'as':_0xf0ba('0x14c'),'foreignKey':_0xf0ba('0x170')});db[_0xf0ba('0x16f')][_0xf0ba('0x100')](db[_0xf0ba('0xe2')],{'as':_0xf0ba('0xe2'),'foreignKey':_0xf0ba('0x159')});db[_0xf0ba('0x16f')][_0xf0ba('0x100')](db[_0xf0ba('0x5f')],{'as':_0xf0ba('0x14d'),'foreignKey':_0xf0ba('0x168')});db['ChatOfflineMessage'][_0xf0ba('0x100')](db['CmContact'],{'onDelete':_0xf0ba('0xfa'),'as':_0xf0ba('0x138'),'foreignKey':_0xf0ba('0x146')});db[_0xf0ba('0x67')][_0xf0ba('0x100')](db['ChatWebsite'],{'as':_0xf0ba('0x14d'),'foreignKey':'ChatWebsiteId'});db[_0xf0ba('0x16b')]['belongsToMany'](db['User'],{'as':_0xf0ba('0x12e'),'through':_0xf0ba('0x112'),'hooks':!![]});db['ChatQueue'][_0xf0ba('0x102')](db[_0xf0ba('0xdb')],{'through':_0xf0ba('0x173'),'as':_0xf0ba('0x143')});db[_0xf0ba('0x6a')]['hasMany'](db[_0xf0ba('0x174')],{'as':_0xf0ba('0x144'),'foreignKey':'ChatGroupId','onDelete':_0xf0ba('0xfa')});db[_0xf0ba('0x6a')]['belongsToMany'](db[_0xf0ba('0x12')],{'as':_0xf0ba('0x123'),'through':_0xf0ba('0x104')});db[_0xf0ba('0x6c')][_0xf0ba('0x100')](db[_0xf0ba('0x5f')],{'as':_0xf0ba('0x16e'),'foreignKey':_0xf0ba('0x168')});db[_0xf0ba('0x175')][_0xf0ba('0xf7')](db[_0xf0ba('0x6f')],{'as':'Contacts','foreignKey':_0xf0ba('0x176')});db['CmContact']['hasMany'](db[_0xf0ba('0x70')],{'as':_0xf0ba('0x125'),'foreignKey':_0xf0ba('0x146')});db[_0xf0ba('0x6f')][_0xf0ba('0xf7')](db['CmHopperFinal'],{'as':_0xf0ba('0xfb'),'foreignKey':_0xf0ba('0x146')});db[_0xf0ba('0x6f')][_0xf0ba('0xf7')](db['CmHopperHistory'],{'as':_0xf0ba('0x126'),'foreignKey':_0xf0ba('0x146')});db[_0xf0ba('0x6f')][_0xf0ba('0xf7')](db[_0xf0ba('0x75')],{'as':_0xf0ba('0x75'),'foreignKey':_0xf0ba('0x146')});db[_0xf0ba('0x6f')][_0xf0ba('0xf7')](db[_0xf0ba('0xc9')],{'as':_0xf0ba('0x128'),'foreignKey':_0xf0ba('0x146')});db['CmContact'][_0xf0ba('0xf7')](db[_0xf0ba('0x5a')],{'as':_0xf0ba('0x10e'),'foreignKey':'ContactId','onDelete':_0xf0ba('0x14e')});db[_0xf0ba('0x6f')][_0xf0ba('0xf7')](db[_0xf0ba('0x64')],{'as':_0xf0ba('0x10c'),'foreignKey':'ContactId','onDelete':_0xf0ba('0x14e')});db[_0xf0ba('0x6f')][_0xf0ba('0xf7')](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':_0xf0ba('0x146'),'onDelete':_0xf0ba('0x14e')});db['CmContact'][_0xf0ba('0xf7')](db[_0xf0ba('0x45')],{'as':_0xf0ba('0xfe'),'foreignKey':_0xf0ba('0x146'),'onDelete':_0xf0ba('0x14e')});db['CmContact'][_0xf0ba('0xf7')](db[_0xf0ba('0xff')],{'as':_0xf0ba('0x10a'),'foreignKey':'ContactId','onDelete':'restrict'});db[_0xf0ba('0x6f')][_0xf0ba('0x100')](db[_0xf0ba('0x175')],{'as':'Company','foreignKey':_0xf0ba('0x176')});db['CmContact'][_0xf0ba('0x100')](db[_0xf0ba('0x106')],{'as':_0xf0ba('0x13e'),'foreignKey':'ListId','onDelete':_0xf0ba('0xfa')});db[_0xf0ba('0x6f')][_0xf0ba('0x102')](db['User'],{'as':_0xf0ba('0x165'),'through':_0xf0ba('0x177')});db[_0xf0ba('0x6f')][_0xf0ba('0x102')](db[_0xf0ba('0x88')],{'as':_0xf0ba('0x149'),'through':'cm_contact_has_tags'});db[_0xf0ba('0x6f')][_0xf0ba('0x102')](db[_0xf0ba('0x88')],{'through':_0xf0ba('0x178'),'as':_0xf0ba('0x14a')});db['CmHopper'][_0xf0ba('0x100')](db[_0xf0ba('0x6f')],{'as':'Contact','foreignKey':_0xf0ba('0x146'),'onDelete':'cascade'});db[_0xf0ba('0x70')][_0xf0ba('0x100')](db[_0xf0ba('0x106')],{'as':_0xf0ba('0x13e'),'foreignKey':'ListId','onDelete':_0xf0ba('0xfa')});db[_0xf0ba('0x70')]['belongsTo'](db['User'],{'as':'Agent','foreignKey':_0xf0ba('0xf6')});db[_0xf0ba('0x70')][_0xf0ba('0x100')](db[_0xf0ba('0x1d')],{'as':_0xf0ba('0x16c'),'foreignKey':_0xf0ba('0x124'),'onDelete':'cascade'});db['CmHopper'][_0xf0ba('0x100')](db[_0xf0ba('0x179')],{'as':_0xf0ba('0x179'),'foreignKey':_0xf0ba('0x17a'),'onDelete':'cascade'});db['CmHopper']['belongsTo'](db[_0xf0ba('0x12')],{'as':_0xf0ba('0x147'),'foreignKey':_0xf0ba('0x17b')});db['CmHopperBlack'][_0xf0ba('0x100')](db[_0xf0ba('0x6f')],{'as':'Contact','foreignKey':_0xf0ba('0x146'),'onDelete':_0xf0ba('0xfa')});db['CmHopperBlack'][_0xf0ba('0x100')](db[_0xf0ba('0x106')],{'as':_0xf0ba('0x13e'),'foreignKey':'ListId','onDelete':_0xf0ba('0xfa')});db[_0xf0ba('0x72')][_0xf0ba('0x100')](db[_0xf0ba('0x1d')],{'as':'Queue','foreignKey':_0xf0ba('0x124'),'onDelete':_0xf0ba('0xfa')});db['CmHopperBlack'][_0xf0ba('0x100')](db[_0xf0ba('0x179')],{'as':_0xf0ba('0x179'),'foreignKey':_0xf0ba('0x17a'),'onDelete':_0xf0ba('0xfa')});db[_0xf0ba('0x17c')][_0xf0ba('0xf7')](db['Condition'],{'as':{'plural':_0xf0ba('0x17d'),'singular':_0xf0ba('0x17e')},'foreignKey':_0xf0ba('0x17f'),'onDelete':'cascade','hooks':!![]});db['Automation'][_0xf0ba('0xf7')](db[_0xf0ba('0x7d')],{'as':{'plural':'Any','singular':_0xf0ba('0x180')},'foreignKey':_0xf0ba('0x181'),'onDelete':_0xf0ba('0xfa'),'hooks':!![]});db['Automation'][_0xf0ba('0xf7')](db[_0xf0ba('0x182')],{'as':_0xf0ba('0x183'),'foreignKey':_0xf0ba('0x184'),'onDelete':_0xf0ba('0xfa'),'hooks':!![]});db[_0xf0ba('0x7f')][_0xf0ba('0xf7')](db[_0xf0ba('0x7f')],{'as':_0xf0ba('0x185'),'foreignKey':_0xf0ba('0x12c'),'onDelete':_0xf0ba('0xfa'),'hooks':!![],'required':![]});db['Interval'][_0xf0ba('0xf7')](db['VoiceExtension'],{'as':'Extensions','foreignKey':'IntervalId','onDelete':_0xf0ba('0x14e')});db[_0xf0ba('0x7f')]['hasMany'](db['MailApplication'],{'as':_0xf0ba('0x186'),'foreignKey':'IntervalId'});db[_0xf0ba('0x7f')][_0xf0ba('0xf7')](db[_0xf0ba('0x63')],{'as':_0xf0ba('0x187'),'foreignKey':_0xf0ba('0x12c')});db['Interval'][_0xf0ba('0xf7')](db[_0xf0ba('0x155')],{'as':_0xf0ba('0x188'),'foreignKey':_0xf0ba('0x12c')});db[_0xf0ba('0x7f')][_0xf0ba('0xf7')](db['SmsApplication'],{'as':_0xf0ba('0x189'),'foreignKey':_0xf0ba('0x12c')});db[_0xf0ba('0x86')][_0xf0ba('0x100')](db[_0xf0ba('0x35')],{});db[_0xf0ba('0x86')][_0xf0ba('0x100')](db[_0xf0ba('0x93')],{'foreignKey':_0xf0ba('0x18a')});db[_0xf0ba('0x86')][_0xf0ba('0x100')](db[_0xf0ba('0x91')],{'foreignKey':'CustomReportId'});db[_0xf0ba('0x121')][_0xf0ba('0x102')](db[_0xf0ba('0x1b')],{'as':_0xf0ba('0x18b'),'through':_0xf0ba('0x122'),'onDelete':_0xf0ba('0x14e')});db['Tag'][_0xf0ba('0x102')](db[_0xf0ba('0x6f')],{'through':_0xf0ba('0x178')});db[_0xf0ba('0x88')][_0xf0ba('0x102')](db[_0xf0ba('0x64')],{'through':_0xf0ba('0x171')});db[_0xf0ba('0x88')][_0xf0ba('0x102')](db[_0xf0ba('0xff')],{'through':'mail_interaction_has_tags'});db[_0xf0ba('0x88')][_0xf0ba('0x102')](db[_0xf0ba('0x51')],{'through':_0xf0ba('0x15d')});db[_0xf0ba('0x88')][_0xf0ba('0x102')](db[_0xf0ba('0x45')],{'through':'fax_interaction_has_tags'});db[_0xf0ba('0x88')]['belongsToMany'](db[_0xf0ba('0x5a')],{'through':_0xf0ba('0x164')});db[_0xf0ba('0x18c')]['hasMany'](db['Condition'],{'as':{'plural':'AllConditions','singular':'AllCondition'},'foreignKey':_0xf0ba('0x18d'),'onDelete':_0xf0ba('0xfa'),'hooks':!![]});db[_0xf0ba('0x18c')]['hasMany'](db[_0xf0ba('0x7d')],{'as':{'plural':'AnyConditions','singular':_0xf0ba('0x18e')},'foreignKey':_0xf0ba('0x18f'),'onDelete':_0xf0ba('0xfa'),'hooks':!![]});db[_0xf0ba('0x18c')][_0xf0ba('0xf7')](db[_0xf0ba('0x182')],{'as':_0xf0ba('0x183'),'foreignKey':_0xf0ba('0x190'),'onDelete':_0xf0ba('0xfa'),'hooks':!![]});db[_0xf0ba('0x91')][_0xf0ba('0xf7')](db[_0xf0ba('0x98')],{'as':_0xf0ba('0x191'),'onDelete':_0xf0ba('0xfa'),'foreignKey':_0xf0ba('0x192'),'hooks':!![]});db[_0xf0ba('0x93')]['hasMany'](db['AnalyticFieldReport'],{'as':'Fields','onDelete':_0xf0ba('0xfa'),'foreignKey':_0xf0ba('0x18a')});db['AnalyticMetric'][_0xf0ba('0xf7')](db[_0xf0ba('0x98')],{'as':_0xf0ba('0x191'),'onDelete':_0xf0ba('0xfa'),'foreignKey':_0xf0ba('0x193')});db['AnalyticFieldReport'][_0xf0ba('0x100')](db['AnalyticMetric'],{'foreignKey':_0xf0ba('0x193')});db[_0xf0ba('0x9c')]['hasMany'](db[_0xf0ba('0x9e')],{'as':_0xf0ba('0x194'),'onDelete':_0xf0ba('0xfa'),'foreignKey':_0xf0ba('0x195')});db[_0xf0ba('0x9e')][_0xf0ba('0xf7')](db['SalesforceField'],{'as':'Subjects','onDelete':_0xf0ba('0xfa'),'foreignKey':'SubjectId'});db['SalesforceConfiguration'][_0xf0ba('0xf7')](db[_0xf0ba('0x9f')],{'as':'Descriptions','onDelete':_0xf0ba('0xfa'),'foreignKey':_0xf0ba('0x196')});db[_0xf0ba('0x9e')][_0xf0ba('0xf7')](db[_0xf0ba('0x9f')],{'as':_0xf0ba('0x191'),'onDelete':_0xf0ba('0xfa'),'foreignKey':_0xf0ba('0x197')});db[_0xf0ba('0x9e')]['belongsTo'](db['SalesforceAccount'],{'as':_0xf0ba('0x14d'),'foreignKey':_0xf0ba('0x195')});db[_0xf0ba('0x9f')][_0xf0ba('0xf7')](db[_0xf0ba('0x9f')],{'as':'Subject','foreignKey':'SubjectId'});db[_0xf0ba('0x9f')][_0xf0ba('0xf7')](db[_0xf0ba('0x9f')],{'as':_0xf0ba('0x198'),'foreignKey':_0xf0ba('0x196')});db[_0xf0ba('0x9f')][_0xf0ba('0xf7')](db[_0xf0ba('0x9f')],{'as':_0xf0ba('0x199'),'foreignKey':_0xf0ba('0x197')});db[_0xf0ba('0x9f')][_0xf0ba('0x100')](db[_0xf0ba('0x8c')],{'as':'Variable','foreignKey':_0xf0ba('0x19a')});db[_0xf0ba('0x19b')][_0xf0ba('0xf7')](db[_0xf0ba('0x19c')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0xf0ba('0x195')});db[_0xf0ba('0x19c')][_0xf0ba('0xf7')](db[_0xf0ba('0x19d')],{'as':'Subjects','onDelete':_0xf0ba('0xfa'),'foreignKey':_0xf0ba('0x19e')});db[_0xf0ba('0x19c')][_0xf0ba('0xf7')](db[_0xf0ba('0x19d')],{'as':_0xf0ba('0x19f'),'onDelete':_0xf0ba('0xfa'),'foreignKey':_0xf0ba('0x196')});db[_0xf0ba('0x19c')][_0xf0ba('0xf7')](db[_0xf0ba('0x19d')],{'as':'Fields','onDelete':'cascade','foreignKey':'FieldId'});db[_0xf0ba('0x19c')][_0xf0ba('0x100')](db[_0xf0ba('0x19b')],{'as':_0xf0ba('0x14d'),'foreignKey':_0xf0ba('0x195')});db[_0xf0ba('0x19d')][_0xf0ba('0xf7')](db[_0xf0ba('0x19d')],{'as':_0xf0ba('0x1a0'),'foreignKey':_0xf0ba('0x19e')});db['SugarcrmField']['hasMany'](db['SugarcrmField'],{'as':_0xf0ba('0x198'),'foreignKey':'DescriptionId'});db['SugarcrmField']['hasMany'](db[_0xf0ba('0x19d')],{'as':_0xf0ba('0x199'),'foreignKey':_0xf0ba('0x197')});db[_0xf0ba('0x19d')][_0xf0ba('0x100')](db[_0xf0ba('0x8c')],{'as':_0xf0ba('0x8c'),'foreignKey':_0xf0ba('0x19a')});db['DeskAccount'][_0xf0ba('0xf7')](db['DeskConfiguration'],{'as':_0xf0ba('0x194'),'onDelete':_0xf0ba('0xfa'),'foreignKey':_0xf0ba('0x195')});db[_0xf0ba('0x1a1')][_0xf0ba('0xf7')](db[_0xf0ba('0xa5')],{'as':_0xf0ba('0x1a2'),'onDelete':_0xf0ba('0xfa'),'foreignKey':_0xf0ba('0x19e')});db['DeskConfiguration'][_0xf0ba('0xf7')](db[_0xf0ba('0xa5')],{'as':_0xf0ba('0x19f'),'onDelete':'cascade','foreignKey':_0xf0ba('0x196')});db[_0xf0ba('0x1a1')]['hasMany'](db['DeskField'],{'as':'Fields','onDelete':_0xf0ba('0xfa'),'foreignKey':_0xf0ba('0x197')});db[_0xf0ba('0x1a1')][_0xf0ba('0x100')](db['DeskAccount'],{'as':'Account','foreignKey':'AccountId'});db['DeskConfiguration'][_0xf0ba('0x102')](db['Tag'],{'through':'int_desk_configuration_has_tags'});db[_0xf0ba('0xa5')][_0xf0ba('0xf7')](db[_0xf0ba('0xa5')],{'as':_0xf0ba('0x1a0'),'foreignKey':_0xf0ba('0x19e')});db[_0xf0ba('0xa5')][_0xf0ba('0xf7')](db[_0xf0ba('0xa5')],{'as':_0xf0ba('0x198'),'foreignKey':'DescriptionId'});db[_0xf0ba('0xa5')][_0xf0ba('0xf7')](db['DeskField'],{'as':'Field','foreignKey':'FieldId'});db[_0xf0ba('0xa5')]['belongsTo'](db[_0xf0ba('0x8c')],{'as':'Variable','foreignKey':_0xf0ba('0x19a')});db[_0xf0ba('0xa7')][_0xf0ba('0xf7')](db['ZohoConfiguration'],{'as':_0xf0ba('0x194'),'onDelete':_0xf0ba('0xfa'),'foreignKey':_0xf0ba('0x195')});db['ZohoConfiguration'][_0xf0ba('0xf7')](db[_0xf0ba('0xaa')],{'as':_0xf0ba('0x1a2'),'onDelete':_0xf0ba('0xfa'),'foreignKey':_0xf0ba('0x19e')});db[_0xf0ba('0xa9')]['hasMany'](db[_0xf0ba('0xaa')],{'as':_0xf0ba('0x19f'),'onDelete':_0xf0ba('0xfa'),'foreignKey':_0xf0ba('0x196')});db[_0xf0ba('0xa9')][_0xf0ba('0xf7')](db[_0xf0ba('0xaa')],{'as':_0xf0ba('0x191'),'onDelete':_0xf0ba('0xfa'),'foreignKey':'FieldId'});db['ZohoConfiguration'][_0xf0ba('0x100')](db[_0xf0ba('0xa7')],{'as':_0xf0ba('0x14d'),'foreignKey':_0xf0ba('0x195')});db[_0xf0ba('0xaa')][_0xf0ba('0xf7')](db[_0xf0ba('0xaa')],{'as':_0xf0ba('0x1a0'),'foreignKey':'SubjectId'});db['ZohoField'][_0xf0ba('0xf7')](db[_0xf0ba('0xaa')],{'as':'Description','foreignKey':_0xf0ba('0x196')});db[_0xf0ba('0xaa')][_0xf0ba('0xf7')](db[_0xf0ba('0xaa')],{'as':_0xf0ba('0x199'),'foreignKey':_0xf0ba('0x197')});db[_0xf0ba('0xaa')][_0xf0ba('0x100')](db['Variable'],{'as':'Variable','foreignKey':_0xf0ba('0x19a')});db['ZendeskAccount'][_0xf0ba('0xf7')](db[_0xf0ba('0xae')],{'as':_0xf0ba('0x194'),'onDelete':_0xf0ba('0xfa'),'foreignKey':_0xf0ba('0x195')});db[_0xf0ba('0xae')][_0xf0ba('0xf7')](db[_0xf0ba('0x1a3')],{'as':_0xf0ba('0x1a2'),'foreignKey':_0xf0ba('0x19e')});db['ZendeskConfiguration']['hasMany'](db[_0xf0ba('0x1a3')],{'as':_0xf0ba('0x19f'),'foreignKey':_0xf0ba('0x196')});db[_0xf0ba('0xae')]['hasMany'](db[_0xf0ba('0x1a3')],{'as':_0xf0ba('0x191'),'foreignKey':'FieldId'});db[_0xf0ba('0xae')]['belongsTo'](db[_0xf0ba('0xac')],{'as':_0xf0ba('0x14d'),'foreignKey':'AccountId'});db[_0xf0ba('0xae')][_0xf0ba('0x102')](db[_0xf0ba('0x88')],{'through':_0xf0ba('0x1a4')});db[_0xf0ba('0x1a3')][_0xf0ba('0xf7')](db['ZendeskField'],{'as':_0xf0ba('0x1a0'),'foreignKey':_0xf0ba('0x19e')});db[_0xf0ba('0x1a3')]['hasMany'](db[_0xf0ba('0x1a3')],{'as':_0xf0ba('0x198'),'foreignKey':_0xf0ba('0x196')});db[_0xf0ba('0x1a3')][_0xf0ba('0xf7')](db['ZendeskField'],{'as':_0xf0ba('0x199'),'foreignKey':'FieldId'});db[_0xf0ba('0x1a3')][_0xf0ba('0x100')](db[_0xf0ba('0x8c')],{'as':_0xf0ba('0x8c'),'foreignKey':'VariableId'});db[_0xf0ba('0xb0')][_0xf0ba('0xf7')](db[_0xf0ba('0xb2')],{'as':_0xf0ba('0x194'),'onDelete':_0xf0ba('0xfa'),'foreignKey':_0xf0ba('0x195')});db[_0xf0ba('0xb2')][_0xf0ba('0xf7')](db[_0xf0ba('0xb4')],{'as':_0xf0ba('0x1a2'),'onDelete':'cascade','foreignKey':_0xf0ba('0x19e')});db[_0xf0ba('0xb2')][_0xf0ba('0xf7')](db['FreshdeskField'],{'as':_0xf0ba('0x19f'),'onDelete':_0xf0ba('0xfa'),'foreignKey':_0xf0ba('0x196')});db[_0xf0ba('0xb2')][_0xf0ba('0xf7')](db[_0xf0ba('0xb4')],{'as':_0xf0ba('0x191'),'onDelete':_0xf0ba('0xfa'),'foreignKey':'FieldId'});db[_0xf0ba('0xb2')][_0xf0ba('0x100')](db['FreshdeskAccount'],{'as':_0xf0ba('0x14d'),'foreignKey':_0xf0ba('0x195')});db['FreshdeskConfiguration'][_0xf0ba('0x102')](db[_0xf0ba('0x88')],{'through':_0xf0ba('0x1a5')});db[_0xf0ba('0xb4')][_0xf0ba('0xf7')](db[_0xf0ba('0xb4')],{'as':_0xf0ba('0x1a0'),'foreignKey':_0xf0ba('0x19e')});db[_0xf0ba('0xb4')][_0xf0ba('0xf7')](db['FreshdeskField'],{'as':'Description','foreignKey':_0xf0ba('0x196')});db[_0xf0ba('0xb4')][_0xf0ba('0xf7')](db[_0xf0ba('0xb4')],{'as':_0xf0ba('0x199'),'foreignKey':_0xf0ba('0x197')});db[_0xf0ba('0xb4')][_0xf0ba('0x100')](db[_0xf0ba('0x8c')],{'as':_0xf0ba('0x8c'),'foreignKey':_0xf0ba('0x19a')});db[_0xf0ba('0xb6')]['hasMany'](db[_0xf0ba('0x1a6')],{'as':_0xf0ba('0x194'),'onDelete':_0xf0ba('0xfa'),'foreignKey':'AccountId'});db[_0xf0ba('0x1a6')]['hasMany'](db[_0xf0ba('0x1a7')],{'as':'Subjects','foreignKey':_0xf0ba('0x19e')});db[_0xf0ba('0x1a6')][_0xf0ba('0xf7')](db['VtigerField'],{'as':_0xf0ba('0x19f'),'foreignKey':_0xf0ba('0x196')});db[_0xf0ba('0x1a6')][_0xf0ba('0xf7')](db[_0xf0ba('0x1a7')],{'as':_0xf0ba('0x191'),'foreignKey':_0xf0ba('0x197')});db['VtigerConfiguration'][_0xf0ba('0x100')](db[_0xf0ba('0xb6')],{'as':_0xf0ba('0x14d'),'foreignKey':'AccountId'});db[_0xf0ba('0x1a6')][_0xf0ba('0x102')](db[_0xf0ba('0x88')],{'through':'int_vtiger_configuration_has_tags'});db['VtigerField'][_0xf0ba('0xf7')](db[_0xf0ba('0x1a7')],{'as':_0xf0ba('0x1a0'),'foreignKey':_0xf0ba('0x19e')});db[_0xf0ba('0x1a7')][_0xf0ba('0xf7')](db['VtigerField'],{'as':_0xf0ba('0x198'),'foreignKey':'DescriptionId'});db['VtigerField'][_0xf0ba('0xf7')](db['VtigerField'],{'as':_0xf0ba('0x199'),'foreignKey':_0xf0ba('0x197')});db[_0xf0ba('0x1a7')][_0xf0ba('0x100')](db[_0xf0ba('0x8c')],{'as':_0xf0ba('0x8c'),'foreignKey':_0xf0ba('0x19a')});db[_0xf0ba('0xb9')]['hasMany'](db[_0xf0ba('0x1a8')],{'as':_0xf0ba('0x194'),'onDelete':_0xf0ba('0xfa'),'foreignKey':'AccountId'});db['ServicenowConfiguration'][_0xf0ba('0xf7')](db[_0xf0ba('0xbc')],{'as':_0xf0ba('0x1a2'),'foreignKey':_0xf0ba('0x19e')});db[_0xf0ba('0x1a8')][_0xf0ba('0xf7')](db['ServicenowField'],{'as':_0xf0ba('0x19f'),'foreignKey':_0xf0ba('0x196')});db[_0xf0ba('0x1a8')][_0xf0ba('0xf7')](db[_0xf0ba('0xbc')],{'as':_0xf0ba('0x191'),'foreignKey':_0xf0ba('0x197')});db[_0xf0ba('0x1a8')][_0xf0ba('0x100')](db['ServicenowAccount'],{'as':_0xf0ba('0x14d'),'foreignKey':_0xf0ba('0x195')});db[_0xf0ba('0xbc')][_0xf0ba('0xf7')](db[_0xf0ba('0xbc')],{'as':_0xf0ba('0x1a0'),'foreignKey':_0xf0ba('0x19e')});db[_0xf0ba('0xbc')][_0xf0ba('0xf7')](db[_0xf0ba('0xbc')],{'as':'Description','foreignKey':_0xf0ba('0x196')});db[_0xf0ba('0xbc')][_0xf0ba('0xf7')](db[_0xf0ba('0xbc')],{'as':'Field','foreignKey':'FieldId'});db[_0xf0ba('0xbc')][_0xf0ba('0x100')](db[_0xf0ba('0x8c')],{'as':_0xf0ba('0x8c'),'foreignKey':'VariableId'});db[_0xf0ba('0xbe')][_0xf0ba('0xf7')](db[_0xf0ba('0xc0')],{'as':_0xf0ba('0x194'),'onDelete':_0xf0ba('0xfa'),'foreignKey':_0xf0ba('0x195')});db[_0xf0ba('0xc0')][_0xf0ba('0xf7')](db['Dynamics365Field'],{'as':_0xf0ba('0x1a2'),'onDelete':_0xf0ba('0xfa'),'foreignKey':_0xf0ba('0x19e')});db['Dynamics365Configuration'][_0xf0ba('0xf7')](db[_0xf0ba('0xc1')],{'as':_0xf0ba('0x19f'),'onDelete':_0xf0ba('0xfa'),'foreignKey':_0xf0ba('0x196')});db[_0xf0ba('0xc0')][_0xf0ba('0xf7')](db[_0xf0ba('0xc1')],{'as':'Fields','onDelete':_0xf0ba('0xfa'),'foreignKey':'FieldId'});db[_0xf0ba('0xc0')][_0xf0ba('0x100')](db[_0xf0ba('0xbe')],{'as':_0xf0ba('0x14d'),'foreignKey':_0xf0ba('0x195')});db[_0xf0ba('0xc1')][_0xf0ba('0xf7')](db[_0xf0ba('0xc1')],{'as':_0xf0ba('0x1a0'),'foreignKey':'SubjectId'});db['Dynamics365Field'][_0xf0ba('0xf7')](db[_0xf0ba('0xc1')],{'as':_0xf0ba('0x198'),'foreignKey':'DescriptionId'});db[_0xf0ba('0xc1')][_0xf0ba('0xf7')](db[_0xf0ba('0xc1')],{'as':_0xf0ba('0x199'),'foreignKey':_0xf0ba('0x197')});db[_0xf0ba('0xc1')]['belongsTo'](db[_0xf0ba('0x8c')],{'as':_0xf0ba('0x8c'),'foreignKey':'VariableId'});db[_0xf0ba('0x1a9')]['belongsTo'](db[_0xf0ba('0x5f')],{});db[_0xf0ba('0x1a9')][_0xf0ba('0x100')](db[_0xf0ba('0x106')],{'as':'List','foreignKey':_0xf0ba('0x154')});db['ChatQueueReport'][_0xf0ba('0x100')](db[_0xf0ba('0x6f')],{'as':_0xf0ba('0x138'),'foreignKey':_0xf0ba('0x146')});db[_0xf0ba('0x1a9')][_0xf0ba('0x100')](db[_0xf0ba('0x64')],{});db[_0xf0ba('0x1a9')]['belongsTo'](db[_0xf0ba('0x16f')],{});db['ChatQueueReport'][_0xf0ba('0x100')](db['User'],{});db['ChatQueueReport'][_0xf0ba('0x100')](db[_0xf0ba('0x16b')],{});db['ChatInternalMessage'][_0xf0ba('0x100')](db[_0xf0ba('0x12')],{'onDelete':_0xf0ba('0xfa'),'foreignKey':_0xf0ba('0x1aa')});db[_0xf0ba('0x174')]['belongsTo'](db[_0xf0ba('0x12')],{'onDelete':_0xf0ba('0xfa'),'foreignKey':'ToId'});db[_0xf0ba('0xc9')]['hasMany'](db[_0xf0ba('0xc7')],{'foreignKey':_0xf0ba('0x1ab'),'onDelete':'cascade'});db['JscriptySessionReport'][_0xf0ba('0xf7')](db[_0xf0ba('0xc5')],{'foreignKey':_0xf0ba('0x1ab'),'onDelete':'cascade'});db[_0xf0ba('0xcb')]['belongsTo'](db[_0xf0ba('0x4d')],{});db[_0xf0ba('0xcb')][_0xf0ba('0x100')](db[_0xf0ba('0x106')],{'as':_0xf0ba('0x13e'),'foreignKey':_0xf0ba('0x154')});db[_0xf0ba('0xcb')]['belongsTo'](db['CmContact'],{'as':'Contact','foreignKey':_0xf0ba('0x146')});db[_0xf0ba('0xcb')][_0xf0ba('0x100')](db['SmsInteraction'],{});db[_0xf0ba('0xcb')]['belongsTo'](db[_0xf0ba('0x53')],{});db[_0xf0ba('0xcb')]['belongsTo'](db[_0xf0ba('0x12')],{});db[_0xf0ba('0xcb')][_0xf0ba('0x100')](db[_0xf0ba('0x54')],{});db[_0xf0ba('0x1ac')][_0xf0ba('0xf7')](db[_0xf0ba('0xc9')],{'foreignKey':'ProjectId'});db[_0xf0ba('0x1ac')]['hasMany'](db['JscriptyQuestionReport'],{'foreignKey':'ProjectId'});db[_0xf0ba('0x1ac')][_0xf0ba('0xf7')](db[_0xf0ba('0xc5')],{'foreignKey':_0xf0ba('0x1ad')});db[_0xf0ba('0xd5')]['belongsToMany'](db[_0xf0ba('0x12')],{'as':'Users','through':_0xf0ba('0x1ae')});db[_0xf0ba('0xdb')][_0xf0ba('0x102')](db[_0xf0ba('0x12')],{'as':_0xf0ba('0x12e'),'through':_0xf0ba('0x109')});db[_0xf0ba('0xdb')][_0xf0ba('0x102')](db[_0xf0ba('0x1d')],{'through':_0xf0ba('0x1af'),'as':_0xf0ba('0x10f')});db[_0xf0ba('0xdb')][_0xf0ba('0x102')](db[_0xf0ba('0x37')],{'through':'team_has_mail_queues','as':'MailQueues'});db[_0xf0ba('0xdb')][_0xf0ba('0x102')](db[_0xf0ba('0x16b')],{'through':_0xf0ba('0x173'),'as':_0xf0ba('0x1b0')});db[_0xf0ba('0xdb')][_0xf0ba('0x102')](db[_0xf0ba('0x49')],{'through':_0xf0ba('0x15a'),'as':_0xf0ba('0x113')});db[_0xf0ba('0xdb')]['belongsToMany'](db['SmsQueue'],{'through':_0xf0ba('0x1b1'),'as':_0xf0ba('0x115')});db[_0xf0ba('0xdb')]['belongsToMany'](db[_0xf0ba('0x5d')],{'through':_0xf0ba('0x167'),'as':'OpenchannelQueues'});db[_0xf0ba('0x179')]['hasMany'](db['CmHopper'],{'as':_0xf0ba('0x125'),'foreignKey':_0xf0ba('0x17a')});db[_0xf0ba('0x179')][_0xf0ba('0xf7')](db['CmHopperFinal'],{'as':_0xf0ba('0xfb'),'foreignKey':'CampaignId'});db[_0xf0ba('0x179')][_0xf0ba('0xf7')](db[_0xf0ba('0xfc')],{'as':_0xf0ba('0x126'),'foreignKey':'CampaignId'});db[_0xf0ba('0x179')]['hasMany'](db[_0xf0ba('0x72')],{'as':'HopperBlacks','foreignKey':_0xf0ba('0x17a')});db[_0xf0ba('0x179')][_0xf0ba('0x100')](db[_0xf0ba('0x129')],{'as':_0xf0ba('0x129'),'foreignKey':_0xf0ba('0x12a')});db[_0xf0ba('0x179')][_0xf0ba('0x100')](db[_0xf0ba('0x129')],{'as':_0xf0ba('0x1b2'),'foreignKey':_0xf0ba('0x12b')});db[_0xf0ba('0x179')][_0xf0ba('0x100')](db[_0xf0ba('0x7f')],{'as':_0xf0ba('0x7f'),'foreignKey':'IntervalId'});db[_0xf0ba('0x179')][_0xf0ba('0x100')](db[_0xf0ba('0xd5')],{'as':'SquareProject','foreignKey':'SquareProjectId'});db[_0xf0ba('0x179')][_0xf0ba('0x102')](db[_0xf0ba('0x106')],{'as':_0xf0ba('0x107'),'through':_0xf0ba('0x1b3')});db[_0xf0ba('0x179')]['belongsToMany'](db[_0xf0ba('0x106')],{'as':'BlackLists','through':'campaigns_has_cm_blacklists'});db[_0xf0ba('0x1b4')][_0xf0ba('0x100')](db[_0xf0ba('0x3b')],{});db[_0xf0ba('0x1b4')][_0xf0ba('0x100')](db[_0xf0ba('0xff')],{});db['MailTransferReport'][_0xf0ba('0x100')](db[_0xf0ba('0x35')],{'foreignKey':_0xf0ba('0x1b5'),'as':_0xf0ba('0x1b6')});db[_0xf0ba('0x1b4')][_0xf0ba('0x100')](db['User'],{'foreignKey':_0xf0ba('0x1b7'),'as':_0xf0ba('0x1b8')});db[_0xf0ba('0x1b4')][_0xf0ba('0x100')](db[_0xf0ba('0x12')],{'foreignKey':_0xf0ba('0x1b9'),'as':'ToAgent'});db[_0xf0ba('0x1b4')]['belongsTo'](db[_0xf0ba('0x37')],{'foreignKey':_0xf0ba('0x1ba'),'as':_0xf0ba('0x1bb')});db[_0xf0ba('0x1b4')][_0xf0ba('0x100')](db[_0xf0ba('0x35')],{'foreignKey':_0xf0ba('0x1bc'),'as':'ToAccount'});db[_0xf0ba('0xe7')][_0xf0ba('0x100')](db[_0xf0ba('0x16f')],{});db[_0xf0ba('0xe7')]['belongsTo'](db[_0xf0ba('0x64')],{});db[_0xf0ba('0xe7')][_0xf0ba('0x100')](db[_0xf0ba('0x5f')],{'foreignKey':_0xf0ba('0x1bd'),'as':_0xf0ba('0x1b6')});db[_0xf0ba('0xe7')][_0xf0ba('0x100')](db[_0xf0ba('0x12')],{'foreignKey':_0xf0ba('0x1b7'),'as':_0xf0ba('0x1b8')});db['ChatTransferReport'][_0xf0ba('0x100')](db[_0xf0ba('0x12')],{'foreignKey':_0xf0ba('0x1b9'),'as':'ToAgent'});db['ChatTransferReport'][_0xf0ba('0x100')](db[_0xf0ba('0x16b')],{'foreignKey':_0xf0ba('0x1be'),'as':_0xf0ba('0x1bb')});db[_0xf0ba('0xe7')][_0xf0ba('0x100')](db[_0xf0ba('0x5f')],{'foreignKey':_0xf0ba('0x1bf'),'as':'ToAccount'});db[_0xf0ba('0x1c0')][_0xf0ba('0x100')](db[_0xf0ba('0x47')],{});db[_0xf0ba('0x1c0')][_0xf0ba('0x100')](db[_0xf0ba('0x45')],{});db[_0xf0ba('0x1c0')][_0xf0ba('0x100')](db[_0xf0ba('0x43')],{'foreignKey':_0xf0ba('0x1c1'),'as':_0xf0ba('0x1b6')});db['FaxTransferReport'][_0xf0ba('0x100')](db[_0xf0ba('0x12')],{'foreignKey':_0xf0ba('0x1b7'),'as':_0xf0ba('0x1b8')});db[_0xf0ba('0x1c0')][_0xf0ba('0x100')](db[_0xf0ba('0x12')],{'foreignKey':_0xf0ba('0x1b9'),'as':'ToAgent'});db[_0xf0ba('0x1c0')][_0xf0ba('0x100')](db[_0xf0ba('0x49')],{'foreignKey':'ToFaxQueueId','as':'ToQueue'});db[_0xf0ba('0x1c0')][_0xf0ba('0x100')](db['FaxAccount'],{'foreignKey':_0xf0ba('0x1c2'),'as':'ToAccount'});db['OpenchannelTransferReport'][_0xf0ba('0x100')](db[_0xf0ba('0x5c')],{});db[_0xf0ba('0xe9')][_0xf0ba('0x100')](db[_0xf0ba('0x5a')],{});db[_0xf0ba('0xe9')][_0xf0ba('0x100')](db['OpenchannelAccount'],{'foreignKey':'FromOpenchannelAccountId','as':'FromAccount'});db[_0xf0ba('0xe9')][_0xf0ba('0x100')](db['User'],{'foreignKey':'FromUserId','as':_0xf0ba('0x1b8')});db[_0xf0ba('0xe9')][_0xf0ba('0x100')](db[_0xf0ba('0x12')],{'foreignKey':_0xf0ba('0x1b9'),'as':'ToAgent'});db[_0xf0ba('0xe9')]['belongsTo'](db[_0xf0ba('0x5d')],{'foreignKey':_0xf0ba('0x1c3'),'as':'ToQueue'});db['OpenchannelTransferReport']['belongsTo'](db[_0xf0ba('0x56')],{'foreignKey':_0xf0ba('0x1c4'),'as':'ToAccount'});db[_0xf0ba('0xeb')][_0xf0ba('0x100')](db[_0xf0ba('0x53')],{});db['SmsTransferReport'][_0xf0ba('0x100')](db[_0xf0ba('0x51')],{});db[_0xf0ba('0xeb')]['belongsTo'](db['SmsAccount'],{'foreignKey':'FromSmsAccountId','as':_0xf0ba('0x1b6')});db[_0xf0ba('0xeb')][_0xf0ba('0x100')](db['User'],{'foreignKey':_0xf0ba('0x1b7'),'as':_0xf0ba('0x1b8')});db['SmsTransferReport']['belongsTo'](db[_0xf0ba('0x12')],{'foreignKey':_0xf0ba('0x1b9'),'as':'ToAgent'});db[_0xf0ba('0xeb')][_0xf0ba('0x100')](db[_0xf0ba('0x54')],{'foreignKey':_0xf0ba('0x1c5'),'as':_0xf0ba('0x1bb')});db[_0xf0ba('0xeb')][_0xf0ba('0x100')](db[_0xf0ba('0x4d')],{'foreignKey':_0xf0ba('0x1c6'),'as':_0xf0ba('0x1c7')});db[_0xf0ba('0x106')][_0xf0ba('0xf7')](db[_0xf0ba('0x7b')],{'as':_0xf0ba('0x13c'),'foreignKey':'ListId'});db[_0xf0ba('0x106')]['hasMany'](db['CmCustomField'],{'as':_0xf0ba('0x1c8'),'foreignKey':_0xf0ba('0x154')});db[_0xf0ba('0x106')][_0xf0ba('0xf7')](db[_0xf0ba('0x6f')],{'as':_0xf0ba('0x105'),'onDelete':'cascade','foreignKey':_0xf0ba('0x154')});db['CmList'][_0xf0ba('0xf7')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0xf0ba('0x154')});db[_0xf0ba('0x106')][_0xf0ba('0xf7')](db[_0xf0ba('0xfc')],{'as':_0xf0ba('0x1c9'),'foreignKey':'ListId'});db[_0xf0ba('0x106')][_0xf0ba('0xf7')](db[_0xf0ba('0x75')],{'as':_0xf0ba('0x75'),'foreignKey':'ListId'});db['CmList']['belongsToMany'](db[_0xf0ba('0x1d')],{'as':_0xf0ba('0x1ca'),'through':_0xf0ba('0x12d')});db[_0xf0ba('0x106')][_0xf0ba('0x102')](db[_0xf0ba('0x12')],{'as':_0xf0ba('0x12e'),'through':_0xf0ba('0x108')});db[_0xf0ba('0xee')][_0xf0ba('0xf7')](db[_0xf0ba('0x19')],{'as':_0xf0ba('0xf9'),'onDelete':_0xf0ba('0x14e')});db[_0xf0ba('0xee')][_0xf0ba('0x102')](db[_0xf0ba('0x12')],{'as':_0xf0ba('0x12e'),'through':_0xf0ba('0x118')});db[_0xf0ba('0xf0')][_0xf0ba('0xf7')](db['User'],{'as':_0xf0ba('0x165'),'foreignKey':_0xf0ba('0x101')});db[_0xf0ba('0xf0')][_0xf0ba('0xf7')](db[_0xf0ba('0xf1')],{'as':_0xf0ba('0x1cb'),'foreignKey':_0xf0ba('0x101'),'onDelete':_0xf0ba('0xfa')});db[_0xf0ba('0xf1')][_0xf0ba('0xf7')](db[_0xf0ba('0x1cc')],{'as':_0xf0ba('0x1cd'),'foreignKey':_0xf0ba('0x1ce'),'onDelete':'cascade'});module[_0xf0ba('0x1cf')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x7514=['../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','Team','License','../api/license/license.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','../api/chatTransferReport/chatTransferReport.model','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','UserProfileResource','../api/userProfileResource/userProfileResource.model','hasOne','UserId','hasMany','VoiceRecording','VoiceQueuesRt','User','VoiceExtension','Extensions','HopperHistory','OpenchannelInteractions','ChatInteractions','MailInteractions','belongsTo','userProfileId','belongsToMany','ChatGroup','Groups','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','FaxInteractions','user_has_fax_interactions','SmsInteractions','user_has_sms_interactions','user_has_openchannel_interactions','VoiceQueue','VoiceQueues','MailQueues','FaxQueues','SmsQueues','OpenchannelQueues','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccount','SmsAccounts','user_has_sms_accounts','user_has_square_projects','SpiedAgents','cascade','ChanSpyId','Sounds','moh_has_sounds','Members','VoiceQueueId','CmHopper','Hoppers','HopperFinals','HopperHistories','HopperBlacks','JscriptySessions','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','voice_queues_has_cm_lists','Agents','Teams','team_has_voice_queues','BlackLists','voice_queues_has_cm_blacklists','mailbox','QueueCalls','uniqueid','VoiceCallReport','Contact','ContactId','MailAccountId','Imap','Dispositions','CannedAnswer','Answers','Messages','Interactions','ListId','TemplateId','team_has_mail_queues','MailInteractionId','Account','Owner','mail_interaction_has_tags','Tags','Users','Attachments','Interaction','restrict','TagId','FaxAccountId','Applications','Exntensions','FaxInteractionId','fax_interaction_has_tags','AttachmentId','List','SmsAccountId','SmsMessage','SmsApplication','mandatoryDispositionPauseId','SmsInteractionId','ThroughTags','SmsQueueId','team_has_sms_queues','OpenchannelAccount','OpenchannelAccountId','OpenchannelApplication','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ChatWebsiteId','ProactiveActions','ChatApplication','Agent','Queue','ChatInteractionId','team_has_chat_queues','ChatInternalMessage','ChatGroupId','chat_group_has_users','Website','Contacts','CompanyId','Company','cm_contact_has_tags','Campaign','CampaignId','OwnerId','All','OneAll','AutomationAllId','Any','OneAny','AutomationAnyId','AutomationId','MailApplications','ChatApplications','DefaultReportId','Mohs','chat_interaction_has_tags','sms_interaction_has_tags','AllConditions','AllCondition','TriggerAllId','AnyConditions','TriggerAnyId','Action','Actions','TriggerId','Fields','MetricId','Configurations','SubjectId','Descriptions','AccountId','Subject','Description','DescriptionId','Field','FieldId','VariableId','Subjects','DeskConfiguration','int_desk_configuration_has_tags','ZohoAccount','ZendeskAccount','int_freshdesk_configuration_has_tags','VtigerAccount','VtigerConfiguration','int_vtiger_configuration_has_tags','ToId','JscriptyQuestionReport','SessionId','JscriptyAnswerReport','ProjectId','ChatQueues','team_has_fax_queues','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToMailAccountId','ToAccount','ChatTransferReport','FromChatWebsiteId','ToChatWebsiteId','FaxTransferReport','ToFaxQueueId','ToQueue','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','SmsTransferReport','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','Queues','user_has_voice_prefixes','UserProfileSections','exports','../config/environment','sequelize','lodash','jstz','determine','defaultsDeep','motion2','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8','sequelizeHistory','utf8_general_ci','database','username','password','options','import','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceQueue/voiceQueue.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','UserVoiceQueue','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','MailServerIn','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','FaxApplication','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','../api/smsAccount/smsAccount.model','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','OpenchannelMessage','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','ChatQueue','../api/chatQueue/chatQueue.model','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','CmContact','../api/cmContact/cmContact.model','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/action/action.model','Automation','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','Disposition','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','Template','Trigger','../api/trigger/trigger.model','Variable','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','ServicenowAccount','ServicenowConfiguration','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','Dynamics365Configuration','Dynamics365Field','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','../api/chatInternalMessage/chatInternalMessage.model','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model'];(function(_0x10df1e,_0xf56f85){var _0x3e24fb=function(_0x5cdb59){while(--_0x5cdb59){_0x10df1e['push'](_0x10df1e['shift']());}};_0x3e24fb(++_0xf56f85);}(_0x7514,0xf2));var _0x4751=function(_0x59b9a8,_0xc7cbb2){_0x59b9a8=_0x59b9a8-0x0;var _0x4c0dba=_0x7514[_0x59b9a8];return _0x4c0dba;};'use strict';var path=require('path');var config=require(_0x4751('0x0'));var Sequelize=require(_0x4751('0x1'));var _=require(_0x4751('0x2'));var jstz=require(_0x4751('0x3'));var timezone=jstz[_0x4751('0x4')]();config['sequelize']=_[_0x4751('0x5')](config['sequelize'],{'database':_0x4751('0x6'),'username':'xcall','password':_0x4751('0x7'),'options':{'host':_0x4751('0x8'),'port':0xcea,'dialect':_0x4751('0x9'),'dialectOptions':{'charset':_0x4751('0xa')},'logging':![],'timezone':timezone[_0x4751('0xb')](),'define':{'charset':_0x4751('0xc'),'collate':'utf8_general_ci'}}});config[_0x4751('0xd')]=_[_0x4751('0x5')](config[_0x4751('0xd')],{'database':_0x4751('0x6'),'username':'xcall','password':_0x4751('0x7'),'options':{'host':_0x4751('0x8'),'port':0xcea,'dialect':_0x4751('0x9'),'dialectOptions':{'charset':_0x4751('0xa')},'logging':![],'timezone':timezone[_0x4751('0xb')](),'define':{'charset':_0x4751('0xc'),'collate':_0x4751('0xe')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize'][_0x4751('0xf')],config[_0x4751('0x1')][_0x4751('0x10')],config[_0x4751('0x1')][_0x4751('0x11')],config[_0x4751('0x1')][_0x4751('0x12')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x4751('0xd')]['database'],config['sequelizeHistory'][_0x4751('0x10')],config[_0x4751('0xd')][_0x4751('0x11')],config['sequelizeHistory'][_0x4751('0x12')])};db['User']=db[_0x4751('0x1')][_0x4751('0x13')]('../api/user/user.model');db[_0x4751('0x14')]=db['sequelize'][_0x4751('0x13')](_0x4751('0x15'));db[_0x4751('0x16')]=db[_0x4751('0x1')][_0x4751('0x13')](_0x4751('0x17'));db['VoiceExtension']=db[_0x4751('0x1')][_0x4751('0x13')](_0x4751('0x18'));db[_0x4751('0x19')]=db[_0x4751('0x1')][_0x4751('0x13')]('../api/voiceMusicOnHold/voiceMusicOnHold.model');db['VoiceQueue']=db[_0x4751('0x1')][_0x4751('0x13')](_0x4751('0x1a'));db['VoiceRecording']=db[_0x4751('0x1')][_0x4751('0x13')]('../api/voiceRecording/voiceRecording.model');db[_0x4751('0x1b')]=db['sequelize'][_0x4751('0x13')](_0x4751('0x1c'));db[_0x4751('0x1d')]=db[_0x4751('0x1')][_0x4751('0x13')](_0x4751('0x1e'));db[_0x4751('0x1f')]=db['sequelize'][_0x4751('0x13')](_0x4751('0x20'));db['VoiceCallReport']=db[_0x4751('0x1')][_0x4751('0x13')](_0x4751('0x21'));db[_0x4751('0x22')]=db[_0x4751('0x1')]['import'](_0x4751('0x23'));db[_0x4751('0x24')]=db[_0x4751('0x1')][_0x4751('0x13')](_0x4751('0x25'));db[_0x4751('0x26')]=db['sequelize']['import'](_0x4751('0x27'));db[_0x4751('0x28')]=db[_0x4751('0x1')][_0x4751('0x13')](_0x4751('0x29'));db[_0x4751('0x2a')]=db['sequelize']['import']('../api/trunk/trunk.model');db['VoiceTransferReport']=db[_0x4751('0x1')][_0x4751('0x13')](_0x4751('0x2b'));db[_0x4751('0x2c')]=db[_0x4751('0x1')][_0x4751('0x13')]('../api/userVoiceQueueRt/userVoiceQueueRt.model');db[_0x4751('0x2d')]=db[_0x4751('0x1')]['import']('../api/userVoiceQueue/userVoiceQueue.model');db[_0x4751('0x2e')]=db[_0x4751('0x1')][_0x4751('0x13')](_0x4751('0x2f'));db[_0x4751('0x30')]=db['sequelize']['import'](_0x4751('0x31'));db[_0x4751('0x32')]=db[_0x4751('0x1')][_0x4751('0x13')](_0x4751('0x33'));db[_0x4751('0x34')]=db[_0x4751('0x1')][_0x4751('0x13')]('../api/userSmsQueue/userSmsQueue.model');db[_0x4751('0x35')]=db[_0x4751('0x1')][_0x4751('0x13')](_0x4751('0x36'));db[_0x4751('0x37')]=db['sequelize'][_0x4751('0x13')]('../api/mailServerIn/mailServerIn.model');db[_0x4751('0x38')]=db[_0x4751('0x1')][_0x4751('0x13')](_0x4751('0x39'));db[_0x4751('0x3a')]=db[_0x4751('0x1')][_0x4751('0x13')](_0x4751('0x3b'));db[_0x4751('0x3c')]=db[_0x4751('0x1')][_0x4751('0x13')](_0x4751('0x3d'));db[_0x4751('0x3e')]=db[_0x4751('0x1')][_0x4751('0x13')](_0x4751('0x3f'));db[_0x4751('0x40')]=db[_0x4751('0x1')][_0x4751('0x13')](_0x4751('0x41'));db[_0x4751('0x42')]=db[_0x4751('0x1')][_0x4751('0x13')](_0x4751('0x43'));db[_0x4751('0x44')]=db['sequelize'][_0x4751('0x13')](_0x4751('0x45'));db[_0x4751('0x46')]=db[_0x4751('0x1')][_0x4751('0x13')]('../api/mailQueueReport/mailQueueReport.model');db[_0x4751('0x47')]=db[_0x4751('0x1')][_0x4751('0x13')](_0x4751('0x48'));db[_0x4751('0x49')]=db[_0x4751('0x1')][_0x4751('0x13')](_0x4751('0x4a'));db[_0x4751('0x4b')]=db['sequelize'][_0x4751('0x13')]('../api/faxAccount/faxAccount.model');db[_0x4751('0x4c')]=db[_0x4751('0x1')][_0x4751('0x13')]('../api/faxApplication/faxApplication.model');db[_0x4751('0x4d')]=db[_0x4751('0x1')]['import'](_0x4751('0x4e'));db[_0x4751('0x4f')]=db['sequelize'][_0x4751('0x13')](_0x4751('0x50'));db[_0x4751('0x51')]=db['sequelize'][_0x4751('0x13')](_0x4751('0x52'));db[_0x4751('0x53')]=db[_0x4751('0x1')][_0x4751('0x13')](_0x4751('0x54'));db['SmsAccount']=db[_0x4751('0x1')][_0x4751('0x13')](_0x4751('0x55'));db['SmsApplication']=db['sequelize'][_0x4751('0x13')](_0x4751('0x56'));db[_0x4751('0x57')]=db[_0x4751('0x1')][_0x4751('0x13')](_0x4751('0x58'));db['SmsMessage']=db[_0x4751('0x1')]['import'](_0x4751('0x59'));db[_0x4751('0x5a')]=db[_0x4751('0x1')][_0x4751('0x13')](_0x4751('0x5b'));db['OpenchannelAccount']=db[_0x4751('0x1')][_0x4751('0x13')]('../api/openchannelAccount/openchannelAccount.model');db['OpenchannelApplication']=db[_0x4751('0x1')]['import'](_0x4751('0x5c'));db[_0x4751('0x5d')]=db[_0x4751('0x1')][_0x4751('0x13')]('../api/openchannelInteraction/openchannelInteraction.model');db[_0x4751('0x5e')]=db['sequelize']['import']('../api/openchannelMessage/openchannelMessage.model');db[_0x4751('0x5f')]=db['sequelize'][_0x4751('0x13')](_0x4751('0x60'));db[_0x4751('0x61')]=db[_0x4751('0x1')][_0x4751('0x13')](_0x4751('0x62'));db[_0x4751('0x63')]=db['sequelize'][_0x4751('0x13')](_0x4751('0x64'));db['ChatApplication']=db[_0x4751('0x1')]['import'](_0x4751('0x65'));db[_0x4751('0x66')]=db[_0x4751('0x1')][_0x4751('0x13')](_0x4751('0x67'));db[_0x4751('0x68')]=db[_0x4751('0x1')][_0x4751('0x13')](_0x4751('0x69'));db[_0x4751('0x6a')]=db[_0x4751('0x1')]['import']('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0x4751('0x6b')]=db[_0x4751('0x1')]['import'](_0x4751('0x6c'));db['ChatGroup']=db[_0x4751('0x1')][_0x4751('0x13')](_0x4751('0x6d'));db[_0x4751('0x6e')]=db[_0x4751('0x1')][_0x4751('0x13')](_0x4751('0x6f'));db[_0x4751('0x70')]=db[_0x4751('0x1')][_0x4751('0x13')]('../api/cmCompany/cmCompany.model');db[_0x4751('0x71')]=db[_0x4751('0x1')][_0x4751('0x13')](_0x4751('0x72'));db['CmHopper']=db['sequelize'][_0x4751('0x13')](_0x4751('0x73'));db[_0x4751('0x74')]=db[_0x4751('0x1')][_0x4751('0x13')](_0x4751('0x75'));db[_0x4751('0x76')]=db[_0x4751('0x1')][_0x4751('0x13')](_0x4751('0x77'));db[_0x4751('0x78')]=db[_0x4751('0x1')][_0x4751('0x13')](_0x4751('0x79'));db[_0x4751('0x7a')]=db['sequelize']['import'](_0x4751('0x7b'));db[_0x4751('0x7c')]=db['sequelize'][_0x4751('0x13')]('../api/cmCustomField/cmCustomField.model');db['Action']=db[_0x4751('0x1')]['import'](_0x4751('0x7d'));db[_0x4751('0x7e')]=db[_0x4751('0x1')][_0x4751('0x13')](_0x4751('0x7f'));db['CannedAnswer']=db['sequelize'][_0x4751('0x13')](_0x4751('0x80'));db[_0x4751('0x81')]=db[_0x4751('0x1')][_0x4751('0x13')]('../api/disposition/disposition.model');db[_0x4751('0x82')]=db[_0x4751('0x1')]['import'](_0x4751('0x83'));db[_0x4751('0x84')]=db[_0x4751('0x1')][_0x4751('0x13')](_0x4751('0x85'));db[_0x4751('0x86')]=db[_0x4751('0x1')][_0x4751('0x13')](_0x4751('0x87'));db[_0x4751('0x88')]=db['sequelize'][_0x4751('0x13')](_0x4751('0x89'));db[_0x4751('0x8a')]=db['sequelize'][_0x4751('0x13')](_0x4751('0x8b'));db[_0x4751('0x8c')]=db['sequelize'][_0x4751('0x13')](_0x4751('0x8d'));db[_0x4751('0x8e')]=db[_0x4751('0x1')]['import'](_0x4751('0x8f'));db[_0x4751('0x90')]=db[_0x4751('0x1')][_0x4751('0x13')](_0x4751('0x91'));db[_0x4751('0x92')]=db[_0x4751('0x1')][_0x4751('0x13')]('../api/template/template.model');db[_0x4751('0x93')]=db['sequelize'][_0x4751('0x13')](_0x4751('0x94'));db[_0x4751('0x95')]=db[_0x4751('0x1')][_0x4751('0x13')]('../api/variable/variable.model');db[_0x4751('0x96')]=db[_0x4751('0x1')][_0x4751('0x13')](_0x4751('0x97'));db[_0x4751('0x98')]=db[_0x4751('0x1')]['import'](_0x4751('0x99'));db[_0x4751('0x9a')]=db[_0x4751('0x1')][_0x4751('0x13')](_0x4751('0x9b'));db[_0x4751('0x9c')]=db[_0x4751('0x1')]['import']('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0x4751('0x9d')]=db[_0x4751('0x1')]['import'](_0x4751('0x9e'));db[_0x4751('0x9f')]=db[_0x4751('0x1')][_0x4751('0x13')]('../api/analyticMetric/analyticMetric.model');db[_0x4751('0xa0')]=db[_0x4751('0x1')][_0x4751('0x13')](_0x4751('0xa1'));db[_0x4751('0xa2')]=db['sequelize'][_0x4751('0x13')](_0x4751('0xa3'));db[_0x4751('0xa4')]=db[_0x4751('0x1')][_0x4751('0x13')](_0x4751('0xa5'));db[_0x4751('0xa6')]=db['sequelize'][_0x4751('0x13')](_0x4751('0xa7'));db[_0x4751('0xa8')]=db[_0x4751('0x1')][_0x4751('0x13')](_0x4751('0xa9'));db[_0x4751('0xaa')]=db[_0x4751('0x1')]['import'](_0x4751('0xab'));db[_0x4751('0xac')]=db[_0x4751('0x1')][_0x4751('0x13')](_0x4751('0xad'));db[_0x4751('0xae')]=db[_0x4751('0x1')][_0x4751('0x13')](_0x4751('0xaf'));db[_0x4751('0xb0')]=db[_0x4751('0x1')][_0x4751('0x13')](_0x4751('0xb1'));db['DeskConfiguration']=db[_0x4751('0x1')][_0x4751('0x13')](_0x4751('0xb2'));db[_0x4751('0xb3')]=db['sequelize'][_0x4751('0x13')]('../api/intDeskField/intDeskField.model');db['ZohoAccount']=db[_0x4751('0x1')][_0x4751('0x13')]('../api/intZohoAccount/intZohoAccount.model');db[_0x4751('0xb4')]=db[_0x4751('0x1')][_0x4751('0x13')](_0x4751('0xb5'));db[_0x4751('0xb6')]=db[_0x4751('0x1')][_0x4751('0x13')](_0x4751('0xb7'));db['ZendeskAccount']=db[_0x4751('0x1')][_0x4751('0x13')](_0x4751('0xb8'));db[_0x4751('0xb9')]=db[_0x4751('0x1')]['import']('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0x4751('0xba')]=db[_0x4751('0x1')][_0x4751('0x13')](_0x4751('0xbb'));db[_0x4751('0xbc')]=db[_0x4751('0x1')][_0x4751('0x13')](_0x4751('0xbd'));db[_0x4751('0xbe')]=db[_0x4751('0x1')][_0x4751('0x13')]('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db[_0x4751('0xbf')]=db['sequelize'][_0x4751('0x13')](_0x4751('0xc0'));db['VtigerAccount']=db[_0x4751('0x1')][_0x4751('0x13')](_0x4751('0xc1'));db['VtigerConfiguration']=db['sequelize'][_0x4751('0x13')](_0x4751('0xc2'));db[_0x4751('0xc3')]=db[_0x4751('0x1')]['import']('../api/intVtigerField/intVtigerField.model');db[_0x4751('0xc4')]=db[_0x4751('0x1')][_0x4751('0x13')]('../api/intServicenowAccount/intServicenowAccount.model');db[_0x4751('0xc5')]=db['sequelize'][_0x4751('0x13')]('../api/intServicenowConfiguration/intServicenowConfiguration.model');db[_0x4751('0xc6')]=db[_0x4751('0x1')][_0x4751('0x13')](_0x4751('0xc7'));db[_0x4751('0xc8')]=db['sequelize'][_0x4751('0x13')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0x4751('0xc9')]=db[_0x4751('0x1')][_0x4751('0x13')]('../api/intDynamics365Configuration/intDynamics365Configuration.model');db[_0x4751('0xca')]=db[_0x4751('0x1')][_0x4751('0x13')]('../api/intDynamics365Field/intDynamics365Field.model');db[_0x4751('0x96')]=db[_0x4751('0x1')][_0x4751('0x13')](_0x4751('0x97'));db['Network']=db[_0x4751('0x1')][_0x4751('0x13')]('../api/network/network.model');db[_0x4751('0xcb')]=db[_0x4751('0x1')][_0x4751('0x13')](_0x4751('0xcc'));db['ChatInternalMessage']=db[_0x4751('0x1')][_0x4751('0x13')](_0x4751('0xcd'));db['JscriptyAnswerReport']=db[_0x4751('0x1')][_0x4751('0x13')](_0x4751('0xce'));db['JscriptyQuestionReport']=db[_0x4751('0x1')][_0x4751('0x13')]('../api/jscriptyQuestionReport/jscriptyQuestionReport.model');db[_0x4751('0xcf')]=db[_0x4751('0x1')][_0x4751('0x13')](_0x4751('0xd0'));db[_0x4751('0xd1')]=db[_0x4751('0x1')][_0x4751('0x13')](_0x4751('0xd2'));db[_0x4751('0xd3')]=db[_0x4751('0x1')]['import']('../api/squareReport/squareReport.model');db[_0x4751('0xd4')]=db['sequelize'][_0x4751('0x13')](_0x4751('0xd5'));db[_0x4751('0xd6')]=db[_0x4751('0x1')][_0x4751('0x13')](_0x4751('0xd7'));db[_0x4751('0xd8')]=db[_0x4751('0x1')][_0x4751('0x13')](_0x4751('0xd9'));db['SquareOdbc']=db[_0x4751('0x1')][_0x4751('0x13')](_0x4751('0xda'));db[_0x4751('0xdb')]=db[_0x4751('0x1')][_0x4751('0x13')](_0x4751('0xdc'));db[_0x4751('0xdd')]=db['sequelize']['import'](_0x4751('0xde'));db[_0x4751('0xdf')]=db[_0x4751('0x1')][_0x4751('0x13')]('../api/squareMessage/squareMessage.model');db[_0x4751('0xe0')]=db['sequelize'][_0x4751('0x13')]('../api/team/team.model');db[_0x4751('0xe1')]=db[_0x4751('0x1')][_0x4751('0x13')](_0x4751('0xe2'));db['Campaign']=db[_0x4751('0x1')]['import']('../api/campaign/campaign.model');db[_0x4751('0xe3')]=db[_0x4751('0x1')][_0x4751('0x13')](_0x4751('0xe4'));db[_0x4751('0xe5')]=db[_0x4751('0x1')][_0x4751('0x13')](_0x4751('0xe6'));db[_0x4751('0xe7')]=db[_0x4751('0x1')]['import'](_0x4751('0xe8'));db[_0x4751('0xe9')]=db[_0x4751('0x1')][_0x4751('0x13')](_0x4751('0xea'));db['ChatTransferReport']=db['sequelize'][_0x4751('0x13')](_0x4751('0xeb'));db['FaxTransferReport']=db[_0x4751('0x1')]['import'](_0x4751('0xec'));db[_0x4751('0xed')]=db['sequelize'][_0x4751('0x13')]('../api/openchannelTransferReport/openchannelTransferReport.model');db['SmsTransferReport']=db[_0x4751('0x1')][_0x4751('0x13')]('../api/smsTransferReport/smsTransferReport.model');db[_0x4751('0xee')]=db[_0x4751('0x1')]['import'](_0x4751('0xef'));db[_0x4751('0xf0')]=db[_0x4751('0x1')][_0x4751('0x13')](_0x4751('0xf1'));db[_0x4751('0xf2')]=db[_0x4751('0x1')][_0x4751('0x13')](_0x4751('0xf3'));db[_0x4751('0xf4')]=db['sequelize'][_0x4751('0x13')]('../api/userProfileSection/userProfileSection.model');db[_0x4751('0xf5')]=db['sequelize'][_0x4751('0x13')](_0x4751('0xf6'));db['User'][_0x4751('0xf7')](db['VoiceMail'],{'as':'VoiceMail','onDelete':'cascade','foreignKey':_0x4751('0xf8')});db['User'][_0x4751('0xf9')](db[_0x4751('0xfa')],{'as':'Recordings','foreignKey':'UserId'});db['User'][_0x4751('0xf9')](db[_0x4751('0x2c')],{'as':_0x4751('0xfb'),'foreignKey':_0x4751('0xf8')});db[_0x4751('0xfc')][_0x4751('0xf9')](db[_0x4751('0xfd')],{'as':_0x4751('0xfe'),'onDelete':'cascade','hooks':!![]});db[_0x4751('0xfc')]['hasMany'](db[_0x4751('0x76')],{'as':'HopperFinals','foreignKey':'UserId'});db[_0x4751('0xfc')][_0x4751('0xf9')](db['CmHopperHistory'],{'as':_0x4751('0xff'),'foreignKey':'UserId'});db[_0x4751('0xfc')][_0x4751('0xf9')](db['ReportAgentPreview'],{'as':_0x4751('0x7a'),'foreignKey':_0x4751('0xf8')});db[_0x4751('0xfc')][_0x4751('0xf9')](db[_0x4751('0x5d')],{'as':_0x4751('0x100'),'foreignKey':_0x4751('0xf8')});db['User'][_0x4751('0xf9')](db[_0x4751('0x66')],{'as':_0x4751('0x101'),'foreignKey':_0x4751('0xf8')});db[_0x4751('0xfc')][_0x4751('0xf9')](db[_0x4751('0x57')],{'as':'SmsInteractions','foreignKey':_0x4751('0xf8')});db[_0x4751('0xfc')][_0x4751('0xf9')](db[_0x4751('0x4d')],{'as':'FaxInteractions','foreignKey':_0x4751('0xf8')});db[_0x4751('0xfc')][_0x4751('0xf9')](db[_0x4751('0x40')],{'as':_0x4751('0x102'),'foreignKey':_0x4751('0xf8')});db['User'][_0x4751('0x103')](db['UserProfile'],{'as':_0x4751('0xf2'),'foreignKey':_0x4751('0x104')});db[_0x4751('0xfc')][_0x4751('0x105')](db[_0x4751('0x106')],{'as':_0x4751('0x107'),'through':'chat_group_has_users'});db[_0x4751('0xfc')][_0x4751('0x105')](db[_0x4751('0x71')],{'as':'Contacts','through':_0x4751('0x108')});db[_0x4751('0xfc')][_0x4751('0x105')](db[_0x4751('0xee')],{'as':_0x4751('0x109'),'through':_0x4751('0x10a')});db[_0x4751('0xfc')][_0x4751('0x105')](db[_0x4751('0xe0')],{'through':_0x4751('0x10b')});db[_0x4751('0xfc')]['belongsToMany'](db[_0x4751('0x40')],{'as':_0x4751('0x102'),'through':_0x4751('0x10c')});db[_0x4751('0xfc')]['belongsToMany'](db[_0x4751('0x66')],{'as':_0x4751('0x101'),'through':_0x4751('0x10d')});db['User'][_0x4751('0x105')](db[_0x4751('0x4d')],{'as':_0x4751('0x10e'),'through':_0x4751('0x10f')});db['User'][_0x4751('0x105')](db[_0x4751('0x57')],{'as':_0x4751('0x110'),'through':_0x4751('0x111')});db[_0x4751('0xfc')][_0x4751('0x105')](db[_0x4751('0x5d')],{'as':'OpenchannelInteractions','through':_0x4751('0x112')});db[_0x4751('0xfc')][_0x4751('0x105')](db[_0x4751('0x113')],{'as':_0x4751('0x114'),'through':_0x4751('0x2d'),'required':![]});db[_0x4751('0xfc')]['belongsToMany'](db[_0x4751('0x3c')],{'as':_0x4751('0x115'),'through':_0x4751('0x30'),'required':![]});db['User'][_0x4751('0x105')](db[_0x4751('0x6b')],{'as':'ChatQueues','through':_0x4751('0x2e'),'required':![],'hooks':!![]});db[_0x4751('0xfc')][_0x4751('0x105')](db[_0x4751('0x51')],{'as':_0x4751('0x116'),'through':_0x4751('0x32'),'required':![]});db[_0x4751('0xfc')][_0x4751('0x105')](db[_0x4751('0x5a')],{'as':_0x4751('0x117'),'through':_0x4751('0x34'),'required':![]});db[_0x4751('0xfc')][_0x4751('0x105')](db['OpenchannelQueue'],{'as':_0x4751('0x118'),'through':_0x4751('0x35'),'required':![]});db[_0x4751('0xfc')][_0x4751('0x105')](db[_0x4751('0xee')],{'through':_0x4751('0x10a')});db[_0x4751('0xfc')]['belongsToMany'](db['VoicePrefix'],{'as':'VoicePrefixes','through':'user_has_voice_prefixes','required':![]});db['User'][_0x4751('0x105')](db['ChatWebsite'],{'as':_0x4751('0x119'),'through':_0x4751('0x11a')});db['User'][_0x4751('0x105')](db['FaxAccount'],{'as':_0x4751('0x11b'),'through':_0x4751('0x11c')});db[_0x4751('0xfc')]['belongsToMany'](db['MailAccount'],{'as':'MailAccounts','through':_0x4751('0x11d')});db[_0x4751('0xfc')]['belongsToMany'](db['OpenchannelAccount'],{'as':_0x4751('0x11e'),'through':_0x4751('0x11f')});db['User'][_0x4751('0x105')](db[_0x4751('0x120')],{'as':_0x4751('0x121'),'through':_0x4751('0x122')});db[_0x4751('0xfc')][_0x4751('0x105')](db[_0x4751('0xdb')],{'as':'SquareProjects','through':_0x4751('0x123')});db['VoiceChanSpy'][_0x4751('0xf9')](db[_0x4751('0xfd')],{'as':_0x4751('0x124'),'onDelete':_0x4751('0x125'),'foreignKey':_0x4751('0x126')});db[_0x4751('0x16')][_0x4751('0xf9')](db[_0x4751('0xfd')],{'onDelete':_0x4751('0x125')});db[_0x4751('0xfd')][_0x4751('0xf9')](db['VoiceExtension'],{'as':'Applications','onDelete':'cascade'});db[_0x4751('0x19')][_0x4751('0x105')](db[_0x4751('0x8e')],{'as':_0x4751('0x127'),'through':_0x4751('0x128')});db[_0x4751('0x113')][_0x4751('0xf9')](db['UserVoiceQueueRt'],{'as':_0x4751('0x129'),'foreignKey':_0x4751('0x12a')});db[_0x4751('0x113')]['hasMany'](db[_0x4751('0x12b')],{'as':_0x4751('0x12c'),'foreignKey':_0x4751('0x12a')});db[_0x4751('0x113')][_0x4751('0xf9')](db[_0x4751('0x76')],{'as':_0x4751('0x12d'),'foreignKey':_0x4751('0x12a')});db[_0x4751('0x113')][_0x4751('0xf9')](db[_0x4751('0x78')],{'as':_0x4751('0x12e'),'foreignKey':_0x4751('0x12a')});db[_0x4751('0x113')][_0x4751('0xf9')](db[_0x4751('0x7a')],{'as':_0x4751('0x7a'),'foreignKey':_0x4751('0x12a')});db[_0x4751('0x113')][_0x4751('0xf9')](db['CmHopperBlack'],{'as':_0x4751('0x12f'),'foreignKey':_0x4751('0x12a')});db[_0x4751('0x113')][_0x4751('0xf9')](db[_0x4751('0xcf')],{'as':_0x4751('0x130'),'foreignKey':_0x4751('0x12a')});db[_0x4751('0x113')][_0x4751('0x103')](db[_0x4751('0x2a')],{'as':_0x4751('0x2a'),'foreignKey':_0x4751('0x131')});db['VoiceQueue'][_0x4751('0x103')](db[_0x4751('0x2a')],{'as':_0x4751('0x132'),'foreignKey':_0x4751('0x133')});db[_0x4751('0x113')]['belongsTo'](db[_0x4751('0x84')],{'as':_0x4751('0x84'),'foreignKey':_0x4751('0x134')});db['VoiceQueue'][_0x4751('0x103')](db[_0x4751('0x86')],{'as':_0x4751('0x135'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x4751('0x113')][_0x4751('0x105')](db[_0x4751('0xee')],{'as':'Lists','through':_0x4751('0x136')});db[_0x4751('0x113')][_0x4751('0x105')](db[_0x4751('0xfc')],{'as':_0x4751('0x137'),'through':_0x4751('0x2d')});db[_0x4751('0x113')][_0x4751('0x105')](db[_0x4751('0xe0')],{'as':_0x4751('0x138'),'through':_0x4751('0x139')});db[_0x4751('0x113')][_0x4751('0x105')](db[_0x4751('0xee')],{'as':_0x4751('0x13a'),'through':_0x4751('0x13b')});db[_0x4751('0xfa')]['belongsTo'](db[_0x4751('0xfc')],{'as':'User','foreignKey':_0x4751('0xf8')});db[_0x4751('0x1b')][_0x4751('0x103')](db[_0x4751('0xfc')],{'as':_0x4751('0xfc'),'foreignKey':_0x4751('0xf8')});db[_0x4751('0x1d')][_0x4751('0xf9')](db['VoiceMailMessage'],{'as':'Messages','onDelete':_0x4751('0x125'),'foreignKey':'mailboxuser','sourceKey':'mailbox'});db[_0x4751('0x1f')][_0x4751('0x103')](db[_0x4751('0x1d')],{'foreignKey':'mailboxuser','targetKey':_0x4751('0x13c')});db['VoiceCallReport'][_0x4751('0xf9')](db['VoiceQueueReport'],{'as':_0x4751('0x13d'),'foreignKey':_0x4751('0x13e'),'constraints':![]});db[_0x4751('0x13f')][_0x4751('0xf9')](db[_0x4751('0x24')],{'as':'AgentReports','foreignKey':_0x4751('0x13e'),'constraints':![]});db[_0x4751('0x13f')][_0x4751('0x103')](db[_0x4751('0xfc')],{'as':'User','foreignKey':_0x4751('0xf8')});db[_0x4751('0x13f')][_0x4751('0x103')](db[_0x4751('0x71')],{'as':_0x4751('0x140'),'foreignKey':_0x4751('0x141')});db[_0x4751('0x37')][_0x4751('0x103')](db['MailAccount'],{'as':_0x4751('0x3a'),'foreignKey':_0x4751('0x142')});db[_0x4751('0x38')][_0x4751('0x103')](db[_0x4751('0x3a')],{'as':_0x4751('0x3a'),'foreignKey':_0x4751('0x142')});db[_0x4751('0x3a')]['hasOne'](db['MailServerIn'],{'as':_0x4751('0x143'),'onDelete':_0x4751('0x125')});db[_0x4751('0x3a')]['hasOne'](db[_0x4751('0x38')],{'as':'Smtp','onDelete':'cascade'});db[_0x4751('0x3a')][_0x4751('0xf9')](db[_0x4751('0x81')],{'as':_0x4751('0x144'),'foreignKey':_0x4751('0x142')});db[_0x4751('0x3a')][_0x4751('0xf9')](db[_0x4751('0x145')],{'as':_0x4751('0x146'),'foreignKey':_0x4751('0x142')});db[_0x4751('0x3a')][_0x4751('0xf9')](db[_0x4751('0x42')],{'as':_0x4751('0x147'),'foreignKey':'MailAccountId'});db['MailAccount'][_0x4751('0xf9')](db[_0x4751('0x40')],{'as':_0x4751('0x148')});db[_0x4751('0x3a')][_0x4751('0xf9')](db[_0x4751('0x44')],{'as':'Applications'});db['MailAccount']['belongsTo'](db[_0x4751('0xee')],{'as':'List','foreignKey':_0x4751('0x149')});db[_0x4751('0x3a')][_0x4751('0x103')](db[_0x4751('0x92')],{'as':_0x4751('0x92'),'foreignKey':_0x4751('0x14a')});db['MailAccount'][_0x4751('0x103')](db[_0x4751('0x86')],{'as':_0x4751('0x135'),'foreignKey':'mandatoryDispositionPauseId'});db['MailAccount']['belongsToMany'](db[_0x4751('0xfc')],{'as':'Agents','through':'user_has_mail_accounts'});db[_0x4751('0x3c')][_0x4751('0x105')](db[_0x4751('0xfc')],{'as':_0x4751('0x137'),'through':'UserMailQueue'});db[_0x4751('0x3c')][_0x4751('0x105')](db[_0x4751('0xe0')],{'through':_0x4751('0x14b'),'as':_0x4751('0x138')});db[_0x4751('0x40')][_0x4751('0xf9')](db[_0x4751('0x42')],{'as':_0x4751('0x147'),'onDelete':_0x4751('0x125'),'foreignKey':_0x4751('0x14c')});db[_0x4751('0x40')][_0x4751('0x103')](db[_0x4751('0x3a')],{'as':_0x4751('0x14d'),'foreignKey':_0x4751('0x142')});db[_0x4751('0x40')][_0x4751('0x103')](db['CmContact'],{'as':_0x4751('0x140'),'foreignKey':_0x4751('0x141')});db[_0x4751('0x40')][_0x4751('0x103')](db[_0x4751('0xfc')],{'as':_0x4751('0x14e'),'foreignKey':'UserId'});db[_0x4751('0x40')][_0x4751('0x105')](db[_0x4751('0x90')],{'through':_0x4751('0x14f'),'as':_0x4751('0x150')});db['MailInteraction'][_0x4751('0x105')](db[_0x4751('0x90')],{'through':_0x4751('0x14f'),'as':'ThroughTags'});db[_0x4751('0x40')]['belongsToMany'](db[_0x4751('0xfc')],{'as':_0x4751('0x151'),'through':'user_has_mail_interactions','foreignKey':_0x4751('0x14c')});db[_0x4751('0x42')][_0x4751('0xf9')](db[_0x4751('0xe5')],{'as':_0x4751('0x152'),'onDelete':_0x4751('0x125')});db[_0x4751('0x42')][_0x4751('0x103')](db[_0x4751('0xfc')],{'as':_0x4751('0xfc')});db[_0x4751('0x42')][_0x4751('0x103')](db['CmContact'],{'onDelete':_0x4751('0x125'),'as':_0x4751('0x140')});db['MailMessage']['belongsTo'](db[_0x4751('0x40')],{'as':_0x4751('0x153'),'foreignKey':_0x4751('0x14c')});db['MailMessage'][_0x4751('0x103')](db[_0x4751('0x3a')],{'as':_0x4751('0x14d'),'foreignKey':_0x4751('0x142')});db[_0x4751('0x44')][_0x4751('0x103')](db[_0x4751('0xfc')],{'onDelete':_0x4751('0x154')});db['MailApplication'][_0x4751('0x103')](db['MailQueue'],{'onDelete':_0x4751('0x154')});db[_0x4751('0x44')][_0x4751('0x103')](db[_0x4751('0x3a')],{'onDelete':_0x4751('0x154')});db[_0x4751('0x44')]['belongsTo'](db[_0x4751('0x84')],{'onDelete':_0x4751('0x154'),'foreignKey':_0x4751('0x134')});db['MailApplication']['belongsTo'](db['Tag'],{'onDelete':_0x4751('0x154'),'foreignKey':_0x4751('0x155')});db[_0x4751('0x46')][_0x4751('0x103')](db[_0x4751('0x3a')],{});db[_0x4751('0x46')][_0x4751('0x103')](db[_0x4751('0xee')],{'as':'List','foreignKey':_0x4751('0x149')});db[_0x4751('0x46')]['belongsTo'](db[_0x4751('0x71')],{'as':_0x4751('0x140'),'foreignKey':'ContactId'});db[_0x4751('0x46')][_0x4751('0x103')](db[_0x4751('0x40')],{});db[_0x4751('0x46')][_0x4751('0x103')](db[_0x4751('0x42')],{});db[_0x4751('0x46')][_0x4751('0x103')](db[_0x4751('0xfc')],{});db[_0x4751('0x46')][_0x4751('0x103')](db[_0x4751('0x3c')],{});db[_0x4751('0x47')][_0x4751('0xf9')](db['DashboardItem'],{'as':'Items','onDelete':_0x4751('0x125')});db[_0x4751('0x4b')]['hasMany'](db[_0x4751('0x81')],{'as':_0x4751('0x144'),'foreignKey':_0x4751('0x156')});db[_0x4751('0x4b')][_0x4751('0xf9')](db['CannedAnswer'],{'as':_0x4751('0x146'),'foreignKey':_0x4751('0x156')});db[_0x4751('0x4b')][_0x4751('0xf9')](db[_0x4751('0x4d')],{'as':'Interactions'});db[_0x4751('0x4b')]['hasMany'](db['FaxApplication'],{'as':_0x4751('0x157')});db[_0x4751('0x4b')][_0x4751('0xf9')](db['VoiceExtension'],{'as':_0x4751('0x158'),'onDelete':_0x4751('0x125')});db[_0x4751('0x4b')][_0x4751('0xf9')](db[_0x4751('0x4f')],{'as':'Messages'});db[_0x4751('0x4b')][_0x4751('0x103')](db['Trunk'],{'as':_0x4751('0x2a')});db[_0x4751('0x4b')][_0x4751('0x103')](db['CmList'],{'as':'List','foreignKey':_0x4751('0x149')});db['FaxAccount'][_0x4751('0x103')](db['Pause'],{'as':_0x4751('0x135'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x4751('0x4b')][_0x4751('0x105')](db[_0x4751('0xfc')],{'as':_0x4751('0x137'),'through':_0x4751('0x11c')});db[_0x4751('0x4c')]['belongsTo'](db[_0x4751('0xfc')],{'onDelete':'restrict'});db[_0x4751('0x4c')]['belongsTo'](db[_0x4751('0x51')],{'onDelete':_0x4751('0x154')});db[_0x4751('0x4c')][_0x4751('0x103')](db[_0x4751('0x4b')],{'onDelete':_0x4751('0x154')});db[_0x4751('0x4c')]['belongsTo'](db[_0x4751('0x90')],{'onDelete':'restrict','foreignKey':_0x4751('0x155')});db['FaxInteraction']['hasMany'](db[_0x4751('0x4f')],{'as':'Messages','onDelete':_0x4751('0x125'),'foreignKey':_0x4751('0x159')});db[_0x4751('0x4d')][_0x4751('0x103')](db[_0x4751('0x4b')],{'as':'Account','foreignKey':'FaxAccountId'});db['FaxInteraction'][_0x4751('0x103')](db['CmContact'],{'as':_0x4751('0x140'),'foreignKey':_0x4751('0x141')});db['FaxInteraction'][_0x4751('0x103')](db['User'],{'as':_0x4751('0x14e'),'foreignKey':_0x4751('0xf8')});db['FaxInteraction'][_0x4751('0x105')](db[_0x4751('0x90')],{'through':_0x4751('0x15a'),'as':_0x4751('0x150')});db[_0x4751('0x4d')][_0x4751('0x105')](db[_0x4751('0x90')],{'through':_0x4751('0x15a'),'as':'ThroughTags'});db[_0x4751('0x4d')][_0x4751('0x105')](db['User'],{'as':_0x4751('0x151'),'through':_0x4751('0x10f'),'foreignKey':_0x4751('0x159')});db[_0x4751('0x4f')]['belongsTo'](db[_0x4751('0xfc')],{'onDelete':'cascade','as':_0x4751('0xfc')});db[_0x4751('0x4f')][_0x4751('0x103')](db[_0x4751('0x4d')],{'as':_0x4751('0x153'),'foreignKey':_0x4751('0x159')});db['FaxMessage'][_0x4751('0x103')](db[_0x4751('0x71')],{'onDelete':_0x4751('0x125'),'as':_0x4751('0x140')});db[_0x4751('0x4f')][_0x4751('0x103')](db[_0x4751('0xe5')],{'as':_0x4751('0xe5'),'foreignKey':_0x4751('0x15b')});db[_0x4751('0x4f')]['belongsTo'](db['FaxAccount'],{'as':_0x4751('0x14d'),'foreignKey':_0x4751('0x156')});db[_0x4751('0x51')][_0x4751('0x105')](db[_0x4751('0xfc')],{'as':_0x4751('0x137'),'through':_0x4751('0x32')});db[_0x4751('0x51')]['belongsToMany'](db[_0x4751('0xe0')],{'through':'team_has_fax_queues','as':_0x4751('0x138')});db[_0x4751('0x53')][_0x4751('0x103')](db[_0x4751('0x4b')],{});db[_0x4751('0x53')][_0x4751('0x103')](db[_0x4751('0xee')],{'as':_0x4751('0x15c'),'foreignKey':_0x4751('0x149')});db[_0x4751('0x53')][_0x4751('0x103')](db[_0x4751('0x71')],{'as':_0x4751('0x140'),'foreignKey':_0x4751('0x141')});db['FaxQueueReport'][_0x4751('0x103')](db['FaxInteraction'],{});db[_0x4751('0x53')][_0x4751('0x103')](db[_0x4751('0x4f')],{});db[_0x4751('0x53')]['belongsTo'](db[_0x4751('0xfc')],{});db['FaxQueueReport'][_0x4751('0x103')](db[_0x4751('0x51')],{});db['SmsAccount']['hasMany'](db[_0x4751('0x81')],{'as':_0x4751('0x144'),'foreignKey':'SmsAccountId'});db[_0x4751('0x120')][_0x4751('0xf9')](db['CannedAnswer'],{'as':'Answers','foreignKey':_0x4751('0x15d')});db[_0x4751('0x120')][_0x4751('0xf9')](db[_0x4751('0x15e')],{'as':_0x4751('0x147'),'foreignKey':'SmsAccountId'});db['SmsAccount']['hasMany'](db[_0x4751('0x57')],{'as':_0x4751('0x148')});db[_0x4751('0x120')][_0x4751('0xf9')](db[_0x4751('0x15f')],{'as':_0x4751('0x157')});db[_0x4751('0x120')]['belongsTo'](db[_0x4751('0xee')],{'as':'List','foreignKey':_0x4751('0x149')});db[_0x4751('0x120')][_0x4751('0x103')](db[_0x4751('0x86')],{'as':_0x4751('0x135'),'foreignKey':_0x4751('0x160')});db[_0x4751('0x120')]['belongsToMany'](db[_0x4751('0xfc')],{'as':'Agents','through':_0x4751('0x122')});db[_0x4751('0x15f')]['belongsTo'](db[_0x4751('0xfc')],{'onDelete':'restrict'});db['SmsApplication'][_0x4751('0x103')](db['SmsQueue'],{'onDelete':_0x4751('0x154')});db[_0x4751('0x15f')]['belongsTo'](db[_0x4751('0x120')],{'onDelete':_0x4751('0x154')});db[_0x4751('0x15f')]['belongsTo'](db[_0x4751('0x84')],{'onDelete':_0x4751('0x154'),'foreignKey':_0x4751('0x134')});db[_0x4751('0x15f')][_0x4751('0x103')](db[_0x4751('0x90')],{'onDelete':_0x4751('0x154'),'foreignKey':_0x4751('0x155')});db[_0x4751('0x57')][_0x4751('0xf9')](db[_0x4751('0x15e')],{'as':_0x4751('0x147'),'onDelete':_0x4751('0x125'),'foreignKey':_0x4751('0x161')});db['SmsInteraction']['belongsTo'](db[_0x4751('0x120')],{'as':'Account','foreignKey':_0x4751('0x15d')});db[_0x4751('0x57')]['belongsTo'](db[_0x4751('0x71')],{'as':'Contact','foreignKey':_0x4751('0x141')});db['SmsInteraction'][_0x4751('0x103')](db[_0x4751('0xfc')],{'as':'Owner','foreignKey':'UserId'});db[_0x4751('0x57')][_0x4751('0x105')](db[_0x4751('0x90')],{'through':'sms_interaction_has_tags','as':_0x4751('0x150')});db['SmsInteraction'][_0x4751('0x105')](db['Tag'],{'through':'sms_interaction_has_tags','as':_0x4751('0x162')});db[_0x4751('0x57')][_0x4751('0x105')](db['User'],{'as':_0x4751('0x151'),'through':_0x4751('0x111'),'foreignKey':'SmsInteractionId'});db[_0x4751('0x15e')]['belongsTo'](db[_0x4751('0xfc')],{'as':_0x4751('0xfc')});db['SmsMessage'][_0x4751('0x103')](db[_0x4751('0x71')],{'onDelete':_0x4751('0x125'),'as':_0x4751('0x140')});db['SmsMessage'][_0x4751('0x103')](db[_0x4751('0x57')],{'onDelete':_0x4751('0x125'),'as':_0x4751('0x153'),'foreignKey':_0x4751('0x161')});db[_0x4751('0x15e')]['belongsTo'](db[_0x4751('0x120')],{'as':'Account','foreignKey':'SmsAccountId'});db['SmsQueue'][_0x4751('0x105')](db[_0x4751('0xfc')],{'as':_0x4751('0x137'),'through':_0x4751('0x34'),'foreignKey':_0x4751('0x163')});db[_0x4751('0x5a')]['belongsToMany'](db[_0x4751('0xe0')],{'through':_0x4751('0x164'),'as':_0x4751('0x138')});db[_0x4751('0x165')][_0x4751('0xf9')](db['Disposition'],{'as':_0x4751('0x144'),'foreignKey':_0x4751('0x166')});db[_0x4751('0x165')][_0x4751('0xf9')](db['CannedAnswer'],{'as':_0x4751('0x146'),'foreignKey':'OpenchannelAccountId'});db[_0x4751('0x165')][_0x4751('0xf9')](db[_0x4751('0x5d')],{'as':_0x4751('0x148'),'foreignKey':_0x4751('0x166')});db[_0x4751('0x165')]['hasMany'](db[_0x4751('0x5e')],{'as':_0x4751('0x147'),'foreignKey':_0x4751('0x166')});db[_0x4751('0x165')][_0x4751('0xf9')](db[_0x4751('0x167')],{'as':_0x4751('0x157'),'foreignKey':_0x4751('0x166')});db[_0x4751('0x165')]['belongsTo'](db[_0x4751('0xee')],{'as':_0x4751('0x15c'),'foreignKey':_0x4751('0x149')});db['OpenchannelAccount'][_0x4751('0x103')](db[_0x4751('0x86')],{'as':_0x4751('0x135'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x4751('0x165')][_0x4751('0x105')](db[_0x4751('0xfc')],{'as':_0x4751('0x137'),'through':_0x4751('0x11f')});db['OpenchannelApplication'][_0x4751('0x103')](db[_0x4751('0xfc')],{'onDelete':_0x4751('0x154')});db['OpenchannelApplication'][_0x4751('0x103')](db[_0x4751('0x5f')],{'onDelete':_0x4751('0x154'),'foreignKey':_0x4751('0x168')});db[_0x4751('0x167')][_0x4751('0x103')](db[_0x4751('0x165')],{'onDelete':_0x4751('0x154'),'foreignKey':_0x4751('0x166')});db[_0x4751('0x167')][_0x4751('0x103')](db['Interval'],{'onDelete':_0x4751('0x154'),'foreignKey':'IntervalId'});db['OpenchannelApplication'][_0x4751('0x103')](db['Tag'],{'onDelete':_0x4751('0x154'),'foreignKey':_0x4751('0x155')});db[_0x4751('0x5d')][_0x4751('0xf9')](db[_0x4751('0x5e')],{'as':_0x4751('0x147'),'onDelete':_0x4751('0x125'),'foreignKey':_0x4751('0x169')});db[_0x4751('0x5d')][_0x4751('0x103')](db[_0x4751('0x165')],{'as':'Account','foreignKey':_0x4751('0x166')});db[_0x4751('0x5d')][_0x4751('0x103')](db[_0x4751('0x71')],{'as':_0x4751('0x140'),'foreignKey':_0x4751('0x141')});db[_0x4751('0x5d')]['belongsTo'](db[_0x4751('0xfc')],{'as':_0x4751('0x14e'),'foreignKey':_0x4751('0xf8')});db[_0x4751('0x5d')]['belongsToMany'](db[_0x4751('0x90')],{'through':_0x4751('0x16a'),'as':'Tags'});db[_0x4751('0x5d')]['belongsToMany'](db[_0x4751('0x90')],{'through':'openchannel_interaction_has_tags','as':_0x4751('0x162')});db[_0x4751('0x5d')][_0x4751('0x105')](db['User'],{'as':'Users','through':_0x4751('0x112'),'foreignKey':_0x4751('0x169')});db[_0x4751('0x5e')]['belongsTo'](db[_0x4751('0xfc')],{'onDelete':_0x4751('0x125'),'as':_0x4751('0xfc')});db['OpenchannelMessage'][_0x4751('0x103')](db['CmContact'],{'onDelete':_0x4751('0x125'),'as':_0x4751('0x140')});db[_0x4751('0x5e')][_0x4751('0x103')](db[_0x4751('0x5d')],{'onDelete':_0x4751('0x125'),'as':'Interaction','foreignKey':'OpenchannelInteractionId'});db[_0x4751('0x5e')][_0x4751('0x103')](db[_0x4751('0xe5')],{'as':_0x4751('0xe5'),'foreignKey':'AttachmentId'});db[_0x4751('0x5e')][_0x4751('0x103')](db[_0x4751('0x165')],{'as':_0x4751('0x14d'),'foreignKey':'OpenchannelAccountId'});db[_0x4751('0x5f')][_0x4751('0x105')](db[_0x4751('0xfc')],{'as':'Agents','through':_0x4751('0x35'),'foreignKey':_0x4751('0x168')});db[_0x4751('0x5f')][_0x4751('0x105')](db[_0x4751('0xe0')],{'through':_0x4751('0x16b'),'as':_0x4751('0x138')});db['ChatWebsite'][_0x4751('0xf9')](db['Disposition'],{'as':'Dispositions','foreignKey':_0x4751('0x16c')});db[_0x4751('0x61')][_0x4751('0xf9')](db[_0x4751('0x145')],{'as':_0x4751('0x146'),'foreignKey':_0x4751('0x16c')});db[_0x4751('0x61')][_0x4751('0xf9')](db[_0x4751('0x6e')],{'as':_0x4751('0x16d')});db[_0x4751('0x61')][_0x4751('0xf9')](db[_0x4751('0x66')],{'as':'Interactions'});db[_0x4751('0x61')][_0x4751('0xf9')](db[_0x4751('0x16e')],{'as':_0x4751('0x157')});db[_0x4751('0x61')][_0x4751('0xf9')](db[_0x4751('0x68')],{'as':_0x4751('0x147')});db[_0x4751('0x61')][_0x4751('0x103')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0x4751('0x61')]['belongsTo'](db['Interval'],{'as':_0x4751('0x84'),'foreignKey':_0x4751('0x134')});db['ChatWebsite']['belongsTo'](db['Pause'],{'as':_0x4751('0x135'),'foreignKey':'mandatoryDispositionPauseId'});db['ChatWebsite'][_0x4751('0x105')](db[_0x4751('0xfc')],{'as':_0x4751('0x137'),'through':'user_has_chat_websites'});db[_0x4751('0x63')]['belongsTo'](db[_0x4751('0x165')],{});db[_0x4751('0x63')][_0x4751('0x103')](db[_0x4751('0xee')],{'as':'List','foreignKey':'ListId'});db[_0x4751('0x63')][_0x4751('0x103')](db[_0x4751('0x71')],{'as':_0x4751('0x140'),'foreignKey':_0x4751('0x141')});db['OpenchannelQueueReport'][_0x4751('0x103')](db[_0x4751('0x5d')],{});db[_0x4751('0x63')][_0x4751('0x103')](db[_0x4751('0x5e')],{});db[_0x4751('0x63')]['belongsTo'](db[_0x4751('0xfc')],{});db['OpenchannelQueueReport'][_0x4751('0x103')](db[_0x4751('0x5f')],{});db['ChatApplication'][_0x4751('0x103')](db[_0x4751('0xfc')],{'as':_0x4751('0x16f'),'foreignKey':_0x4751('0xf8'),'onDelete':_0x4751('0x154')});db[_0x4751('0x16e')][_0x4751('0x103')](db[_0x4751('0x6b')],{'as':_0x4751('0x170'),'foreignKey':'ChatQueueId','onDelete':'restrict'});db[_0x4751('0x16e')][_0x4751('0x103')](db[_0x4751('0x61')],{'as':'Website','foreignKey':'ChatWebsiteId','onDelete':_0x4751('0x154')});db[_0x4751('0x16e')][_0x4751('0x103')](db[_0x4751('0x90')],{'onDelete':_0x4751('0x154'),'foreignKey':'TagId'});db[_0x4751('0x66')]['hasMany'](db['ChatMessage'],{'as':_0x4751('0x147'),'onDelete':_0x4751('0x125'),'foreignKey':'ChatInteractionId'});db['ChatInteraction'][_0x4751('0x103')](db[_0x4751('0x61')],{'as':_0x4751('0x14d'),'foreignKey':_0x4751('0x16c')});db['ChatInteraction'][_0x4751('0x103')](db['CmContact'],{'as':_0x4751('0x140'),'foreignKey':'ContactId'});db['ChatInteraction']['belongsTo'](db[_0x4751('0xfc')],{'as':_0x4751('0x14e'),'foreignKey':_0x4751('0xf8')});db[_0x4751('0x66')][_0x4751('0x105')](db[_0x4751('0x90')],{'through':'chat_interaction_has_tags','as':_0x4751('0x150')});db['ChatInteraction']['belongsToMany'](db['Tag'],{'through':'chat_interaction_has_tags','as':_0x4751('0x162')});db['ChatInteraction'][_0x4751('0x105')](db[_0x4751('0xfc')],{'as':_0x4751('0x151'),'through':_0x4751('0x10d'),'foreignKey':_0x4751('0x171')});db[_0x4751('0x68')][_0x4751('0x103')](db[_0x4751('0xfc')],{'onDelete':'cascade','as':_0x4751('0xfc')});db[_0x4751('0x68')][_0x4751('0x103')](db['CmContact'],{'onDelete':_0x4751('0x125'),'as':'Contact','foreignKey':_0x4751('0x141')});db[_0x4751('0x68')][_0x4751('0x103')](db['ChatInteraction'],{'onDelete':_0x4751('0x125'),'as':_0x4751('0x153'),'foreignKey':_0x4751('0x171')});db[_0x4751('0x68')][_0x4751('0x103')](db[_0x4751('0xe5')],{'as':_0x4751('0xe5'),'foreignKey':_0x4751('0x15b')});db[_0x4751('0x68')][_0x4751('0x103')](db[_0x4751('0x61')],{'as':'Account','foreignKey':_0x4751('0x16c')});db[_0x4751('0x6a')]['belongsTo'](db[_0x4751('0x71')],{'onDelete':_0x4751('0x125'),'as':_0x4751('0x140'),'foreignKey':_0x4751('0x141')});db[_0x4751('0x6a')][_0x4751('0x103')](db[_0x4751('0x61')],{'as':_0x4751('0x14d'),'foreignKey':_0x4751('0x16c')});db[_0x4751('0x6b')][_0x4751('0x105')](db[_0x4751('0xfc')],{'as':'Agents','through':_0x4751('0x2e'),'hooks':!![]});db[_0x4751('0x6b')][_0x4751('0x105')](db['Team'],{'through':_0x4751('0x172'),'as':_0x4751('0x138')});db[_0x4751('0x106')][_0x4751('0xf9')](db[_0x4751('0x173')],{'as':_0x4751('0x147'),'foreignKey':_0x4751('0x174'),'onDelete':_0x4751('0x125')});db[_0x4751('0x106')]['belongsToMany'](db['User'],{'as':_0x4751('0x129'),'through':_0x4751('0x175')});db[_0x4751('0x6e')][_0x4751('0x103')](db['ChatWebsite'],{'as':_0x4751('0x176'),'foreignKey':'ChatWebsiteId'});db[_0x4751('0x70')][_0x4751('0xf9')](db['CmContact'],{'as':_0x4751('0x177'),'foreignKey':_0x4751('0x178')});db[_0x4751('0x71')][_0x4751('0xf9')](db['CmHopper'],{'as':'Hoppers','foreignKey':'ContactId'});db['CmContact'][_0x4751('0xf9')](db['CmHopperFinal'],{'as':_0x4751('0x12d'),'foreignKey':_0x4751('0x141')});db['CmContact']['hasMany'](db['CmHopperHistory'],{'as':_0x4751('0x12e'),'foreignKey':_0x4751('0x141')});db[_0x4751('0x71')]['hasMany'](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0x4751('0x141')});db[_0x4751('0x71')]['hasMany'](db[_0x4751('0xcf')],{'as':_0x4751('0x130'),'foreignKey':_0x4751('0x141')});db[_0x4751('0x71')][_0x4751('0xf9')](db[_0x4751('0x5d')],{'as':_0x4751('0x100'),'foreignKey':_0x4751('0x141'),'onDelete':_0x4751('0x154')});db[_0x4751('0x71')]['hasMany'](db[_0x4751('0x66')],{'as':_0x4751('0x101'),'foreignKey':_0x4751('0x141'),'onDelete':'restrict'});db[_0x4751('0x71')][_0x4751('0xf9')](db['SmsInteraction'],{'as':_0x4751('0x110'),'foreignKey':'ContactId','onDelete':_0x4751('0x154')});db['CmContact'][_0x4751('0xf9')](db[_0x4751('0x4d')],{'as':_0x4751('0x10e'),'foreignKey':_0x4751('0x141'),'onDelete':_0x4751('0x154')});db['CmContact'][_0x4751('0xf9')](db[_0x4751('0x40')],{'as':_0x4751('0x102'),'foreignKey':_0x4751('0x141'),'onDelete':'restrict'});db[_0x4751('0x71')]['belongsTo'](db[_0x4751('0x70')],{'as':_0x4751('0x179'),'foreignKey':'CompanyId'});db[_0x4751('0x71')]['belongsTo'](db['CmList'],{'as':'List','foreignKey':'ListId','onDelete':_0x4751('0x125')});db[_0x4751('0x71')][_0x4751('0x105')](db['User'],{'as':_0x4751('0x151'),'through':_0x4751('0x108')});db[_0x4751('0x71')][_0x4751('0x105')](db[_0x4751('0x90')],{'as':'Tags','through':_0x4751('0x17a')});db[_0x4751('0x71')][_0x4751('0x105')](db[_0x4751('0x90')],{'through':'cm_contact_has_tags','as':_0x4751('0x162')});db[_0x4751('0x12b')][_0x4751('0x103')](db[_0x4751('0x71')],{'as':_0x4751('0x140'),'foreignKey':_0x4751('0x141'),'onDelete':_0x4751('0x125')});db[_0x4751('0x12b')][_0x4751('0x103')](db['CmList'],{'as':_0x4751('0x15c'),'foreignKey':_0x4751('0x149'),'onDelete':_0x4751('0x125')});db[_0x4751('0x12b')][_0x4751('0x103')](db[_0x4751('0xfc')],{'as':_0x4751('0x16f'),'foreignKey':_0x4751('0xf8')});db[_0x4751('0x12b')][_0x4751('0x103')](db[_0x4751('0x113')],{'as':_0x4751('0x170'),'foreignKey':'VoiceQueueId','onDelete':_0x4751('0x125')});db[_0x4751('0x12b')][_0x4751('0x103')](db['Campaign'],{'as':_0x4751('0x17b'),'foreignKey':_0x4751('0x17c'),'onDelete':_0x4751('0x125')});db['CmHopper'][_0x4751('0x103')](db['User'],{'as':_0x4751('0x14e'),'foreignKey':_0x4751('0x17d')});db[_0x4751('0x74')][_0x4751('0x103')](db[_0x4751('0x71')],{'as':_0x4751('0x140'),'foreignKey':_0x4751('0x141'),'onDelete':_0x4751('0x125')});db[_0x4751('0x74')]['belongsTo'](db[_0x4751('0xee')],{'as':_0x4751('0x15c'),'foreignKey':_0x4751('0x149'),'onDelete':_0x4751('0x125')});db[_0x4751('0x74')][_0x4751('0x103')](db['VoiceQueue'],{'as':_0x4751('0x170'),'foreignKey':_0x4751('0x12a'),'onDelete':_0x4751('0x125')});db['CmHopperBlack']['belongsTo'](db[_0x4751('0x17b')],{'as':_0x4751('0x17b'),'foreignKey':_0x4751('0x17c'),'onDelete':_0x4751('0x125')});db[_0x4751('0x7e')][_0x4751('0xf9')](db[_0x4751('0x82')],{'as':{'plural':_0x4751('0x17e'),'singular':_0x4751('0x17f')},'foreignKey':_0x4751('0x180'),'onDelete':_0x4751('0x125'),'hooks':!![]});db[_0x4751('0x7e')][_0x4751('0xf9')](db[_0x4751('0x82')],{'as':{'plural':_0x4751('0x181'),'singular':_0x4751('0x182')},'foreignKey':_0x4751('0x183'),'onDelete':_0x4751('0x125'),'hooks':!![]});db[_0x4751('0x7e')][_0x4751('0xf9')](db['Action'],{'as':'Actions','foreignKey':_0x4751('0x184'),'onDelete':'cascade','hooks':!![]});db[_0x4751('0x84')][_0x4751('0xf9')](db[_0x4751('0x84')],{'as':'Intervals','foreignKey':_0x4751('0x134'),'onDelete':_0x4751('0x125'),'hooks':!![],'required':![]});db[_0x4751('0x84')][_0x4751('0xf9')](db[_0x4751('0xfd')],{'as':_0x4751('0xfe'),'foreignKey':_0x4751('0x134'),'onDelete':_0x4751('0x154')});db['Interval'][_0x4751('0xf9')](db[_0x4751('0x44')],{'as':_0x4751('0x185'),'foreignKey':_0x4751('0x134')});db[_0x4751('0x84')]['hasMany'](db[_0x4751('0x16e')],{'as':_0x4751('0x186'),'foreignKey':_0x4751('0x134')});db[_0x4751('0x84')][_0x4751('0xf9')](db['FaxApplication'],{'as':'FaxApplications','foreignKey':_0x4751('0x134')});db[_0x4751('0x84')][_0x4751('0xf9')](db['SmsApplication'],{'as':'SmsApplications','foreignKey':'IntervalId'});db['Schedule']['belongsTo'](db[_0x4751('0x3a')],{});db[_0x4751('0x8c')][_0x4751('0x103')](db['AnalyticDefaultReport'],{'foreignKey':_0x4751('0x187')});db[_0x4751('0x8c')][_0x4751('0x103')](db['AnalyticCustomReport'],{'foreignKey':'CustomReportId'});db[_0x4751('0x8e')][_0x4751('0x105')](db[_0x4751('0x19')],{'as':_0x4751('0x188'),'through':_0x4751('0x128'),'onDelete':_0x4751('0x154')});db['Tag']['belongsToMany'](db[_0x4751('0x71')],{'through':_0x4751('0x17a')});db[_0x4751('0x90')][_0x4751('0x105')](db['ChatInteraction'],{'through':_0x4751('0x189')});db[_0x4751('0x90')][_0x4751('0x105')](db[_0x4751('0x40')],{'through':'mail_interaction_has_tags'});db[_0x4751('0x90')][_0x4751('0x105')](db[_0x4751('0x57')],{'through':_0x4751('0x18a')});db[_0x4751('0x90')][_0x4751('0x105')](db[_0x4751('0x4d')],{'through':'fax_interaction_has_tags'});db['Tag'][_0x4751('0x105')](db[_0x4751('0x5d')],{'through':_0x4751('0x16a')});db[_0x4751('0x93')][_0x4751('0xf9')](db[_0x4751('0x82')],{'as':{'plural':_0x4751('0x18b'),'singular':_0x4751('0x18c')},'foreignKey':_0x4751('0x18d'),'onDelete':'cascade','hooks':!![]});db[_0x4751('0x93')][_0x4751('0xf9')](db['Condition'],{'as':{'plural':_0x4751('0x18e'),'singular':'AnyCondition'},'foreignKey':_0x4751('0x18f'),'onDelete':_0x4751('0x125'),'hooks':!![]});db[_0x4751('0x93')][_0x4751('0xf9')](db[_0x4751('0x190')],{'as':_0x4751('0x191'),'foreignKey':_0x4751('0x192'),'onDelete':_0x4751('0x125'),'hooks':!![]});db[_0x4751('0x9a')]['hasMany'](db[_0x4751('0xa0')],{'as':'Fields','onDelete':_0x4751('0x125'),'foreignKey':'CustomReportId','hooks':!![]});db['AnalyticDefaultReport']['hasMany'](db[_0x4751('0xa0')],{'as':_0x4751('0x193'),'onDelete':_0x4751('0x125'),'foreignKey':'DefaultReportId'});db[_0x4751('0x9f')][_0x4751('0xf9')](db[_0x4751('0xa0')],{'as':_0x4751('0x193'),'onDelete':_0x4751('0x125'),'foreignKey':_0x4751('0x194')});db[_0x4751('0xa0')]['belongsTo'](db[_0x4751('0x9f')],{'foreignKey':_0x4751('0x194')});db['SalesforceAccount'][_0x4751('0xf9')](db[_0x4751('0xa6')],{'as':_0x4751('0x195'),'onDelete':_0x4751('0x125'),'foreignKey':'AccountId'});db[_0x4751('0xa6')][_0x4751('0xf9')](db[_0x4751('0xa8')],{'as':'Subjects','onDelete':_0x4751('0x125'),'foreignKey':_0x4751('0x196')});db[_0x4751('0xa6')]['hasMany'](db[_0x4751('0xa8')],{'as':_0x4751('0x197'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0x4751('0xa6')]['hasMany'](db[_0x4751('0xa8')],{'as':_0x4751('0x193'),'onDelete':'cascade','foreignKey':'FieldId'});db[_0x4751('0xa6')][_0x4751('0x103')](db[_0x4751('0xa4')],{'as':_0x4751('0x14d'),'foreignKey':_0x4751('0x198')});db[_0x4751('0xa8')][_0x4751('0xf9')](db[_0x4751('0xa8')],{'as':_0x4751('0x199'),'foreignKey':'SubjectId'});db['SalesforceField']['hasMany'](db[_0x4751('0xa8')],{'as':_0x4751('0x19a'),'foreignKey':_0x4751('0x19b')});db[_0x4751('0xa8')][_0x4751('0xf9')](db[_0x4751('0xa8')],{'as':_0x4751('0x19c'),'foreignKey':_0x4751('0x19d')});db[_0x4751('0xa8')][_0x4751('0x103')](db['Variable'],{'as':'Variable','foreignKey':_0x4751('0x19e')});db[_0x4751('0xaa')]['hasMany'](db[_0x4751('0xac')],{'as':_0x4751('0x195'),'onDelete':_0x4751('0x125'),'foreignKey':'AccountId'});db['SugarcrmConfiguration'][_0x4751('0xf9')](db[_0x4751('0xae')],{'as':_0x4751('0x19f'),'onDelete':_0x4751('0x125'),'foreignKey':_0x4751('0x196')});db['SugarcrmConfiguration'][_0x4751('0xf9')](db['SugarcrmField'],{'as':_0x4751('0x197'),'onDelete':_0x4751('0x125'),'foreignKey':_0x4751('0x19b')});db[_0x4751('0xac')][_0x4751('0xf9')](db['SugarcrmField'],{'as':_0x4751('0x193'),'onDelete':_0x4751('0x125'),'foreignKey':_0x4751('0x19d')});db['SugarcrmConfiguration'][_0x4751('0x103')](db[_0x4751('0xaa')],{'as':'Account','foreignKey':_0x4751('0x198')});db['SugarcrmField'][_0x4751('0xf9')](db[_0x4751('0xae')],{'as':_0x4751('0x199'),'foreignKey':_0x4751('0x196')});db[_0x4751('0xae')][_0x4751('0xf9')](db[_0x4751('0xae')],{'as':'Description','foreignKey':_0x4751('0x19b')});db[_0x4751('0xae')][_0x4751('0xf9')](db[_0x4751('0xae')],{'as':_0x4751('0x19c'),'foreignKey':_0x4751('0x19d')});db[_0x4751('0xae')][_0x4751('0x103')](db['Variable'],{'as':_0x4751('0x95'),'foreignKey':'VariableId'});db['DeskAccount'][_0x4751('0xf9')](db[_0x4751('0x1a0')],{'as':'Configurations','onDelete':_0x4751('0x125'),'foreignKey':'AccountId'});db['DeskConfiguration'][_0x4751('0xf9')](db[_0x4751('0xb3')],{'as':'Subjects','onDelete':_0x4751('0x125'),'foreignKey':_0x4751('0x196')});db[_0x4751('0x1a0')]['hasMany'](db[_0x4751('0xb3')],{'as':_0x4751('0x197'),'onDelete':'cascade','foreignKey':_0x4751('0x19b')});db[_0x4751('0x1a0')][_0x4751('0xf9')](db[_0x4751('0xb3')],{'as':_0x4751('0x193'),'onDelete':_0x4751('0x125'),'foreignKey':_0x4751('0x19d')});db[_0x4751('0x1a0')][_0x4751('0x103')](db[_0x4751('0xb0')],{'as':_0x4751('0x14d'),'foreignKey':'AccountId'});db[_0x4751('0x1a0')]['belongsToMany'](db[_0x4751('0x90')],{'through':_0x4751('0x1a1')});db['DeskField'][_0x4751('0xf9')](db[_0x4751('0xb3')],{'as':'Subject','foreignKey':_0x4751('0x196')});db[_0x4751('0xb3')][_0x4751('0xf9')](db[_0x4751('0xb3')],{'as':'Description','foreignKey':_0x4751('0x19b')});db[_0x4751('0xb3')]['hasMany'](db[_0x4751('0xb3')],{'as':_0x4751('0x19c'),'foreignKey':_0x4751('0x19d')});db[_0x4751('0xb3')][_0x4751('0x103')](db['Variable'],{'as':_0x4751('0x95'),'foreignKey':_0x4751('0x19e')});db[_0x4751('0x1a2')][_0x4751('0xf9')](db[_0x4751('0xb4')],{'as':'Configurations','onDelete':_0x4751('0x125'),'foreignKey':_0x4751('0x198')});db[_0x4751('0xb4')][_0x4751('0xf9')](db[_0x4751('0xb6')],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db[_0x4751('0xb4')][_0x4751('0xf9')](db['ZohoField'],{'as':_0x4751('0x197'),'onDelete':_0x4751('0x125'),'foreignKey':_0x4751('0x19b')});db[_0x4751('0xb4')]['hasMany'](db[_0x4751('0xb6')],{'as':_0x4751('0x193'),'onDelete':'cascade','foreignKey':_0x4751('0x19d')});db[_0x4751('0xb4')]['belongsTo'](db['ZohoAccount'],{'as':_0x4751('0x14d'),'foreignKey':'AccountId'});db[_0x4751('0xb6')]['hasMany'](db[_0x4751('0xb6')],{'as':_0x4751('0x199'),'foreignKey':_0x4751('0x196')});db[_0x4751('0xb6')][_0x4751('0xf9')](db['ZohoField'],{'as':_0x4751('0x19a'),'foreignKey':_0x4751('0x19b')});db['ZohoField'][_0x4751('0xf9')](db[_0x4751('0xb6')],{'as':_0x4751('0x19c'),'foreignKey':_0x4751('0x19d')});db[_0x4751('0xb6')][_0x4751('0x103')](db[_0x4751('0x95')],{'as':_0x4751('0x95'),'foreignKey':_0x4751('0x19e')});db['ZendeskAccount'][_0x4751('0xf9')](db[_0x4751('0xb9')],{'as':_0x4751('0x195'),'onDelete':_0x4751('0x125'),'foreignKey':_0x4751('0x198')});db[_0x4751('0xb9')]['hasMany'](db[_0x4751('0xba')],{'as':_0x4751('0x19f'),'foreignKey':_0x4751('0x196')});db[_0x4751('0xb9')][_0x4751('0xf9')](db['ZendeskField'],{'as':_0x4751('0x197'),'foreignKey':_0x4751('0x19b')});db['ZendeskConfiguration'][_0x4751('0xf9')](db[_0x4751('0xba')],{'as':_0x4751('0x193'),'foreignKey':_0x4751('0x19d')});db[_0x4751('0xb9')]['belongsTo'](db[_0x4751('0x1a3')],{'as':_0x4751('0x14d'),'foreignKey':_0x4751('0x198')});db[_0x4751('0xb9')][_0x4751('0x105')](db[_0x4751('0x90')],{'through':'int_zendesk_configuration_has_tags'});db[_0x4751('0xba')][_0x4751('0xf9')](db[_0x4751('0xba')],{'as':_0x4751('0x199'),'foreignKey':'SubjectId'});db[_0x4751('0xba')][_0x4751('0xf9')](db['ZendeskField'],{'as':_0x4751('0x19a'),'foreignKey':_0x4751('0x19b')});db[_0x4751('0xba')][_0x4751('0xf9')](db['ZendeskField'],{'as':_0x4751('0x19c'),'foreignKey':_0x4751('0x19d')});db[_0x4751('0xba')][_0x4751('0x103')](db['Variable'],{'as':'Variable','foreignKey':'VariableId'});db[_0x4751('0xbc')]['hasMany'](db[_0x4751('0xbe')],{'as':_0x4751('0x195'),'onDelete':_0x4751('0x125'),'foreignKey':_0x4751('0x198')});db[_0x4751('0xbe')][_0x4751('0xf9')](db['FreshdeskField'],{'as':_0x4751('0x19f'),'onDelete':_0x4751('0x125'),'foreignKey':'SubjectId'});db[_0x4751('0xbe')][_0x4751('0xf9')](db['FreshdeskField'],{'as':'Descriptions','onDelete':_0x4751('0x125'),'foreignKey':_0x4751('0x19b')});db['FreshdeskConfiguration'][_0x4751('0xf9')](db[_0x4751('0xbf')],{'as':_0x4751('0x193'),'onDelete':_0x4751('0x125'),'foreignKey':_0x4751('0x19d')});db[_0x4751('0xbe')]['belongsTo'](db[_0x4751('0xbc')],{'as':_0x4751('0x14d'),'foreignKey':_0x4751('0x198')});db[_0x4751('0xbe')][_0x4751('0x105')](db[_0x4751('0x90')],{'through':_0x4751('0x1a4')});db[_0x4751('0xbf')][_0x4751('0xf9')](db[_0x4751('0xbf')],{'as':_0x4751('0x199'),'foreignKey':_0x4751('0x196')});db['FreshdeskField'][_0x4751('0xf9')](db[_0x4751('0xbf')],{'as':_0x4751('0x19a'),'foreignKey':_0x4751('0x19b')});db['FreshdeskField'][_0x4751('0xf9')](db[_0x4751('0xbf')],{'as':_0x4751('0x19c'),'foreignKey':_0x4751('0x19d')});db['FreshdeskField']['belongsTo'](db['Variable'],{'as':_0x4751('0x95'),'foreignKey':_0x4751('0x19e')});db[_0x4751('0x1a5')][_0x4751('0xf9')](db[_0x4751('0x1a6')],{'as':_0x4751('0x195'),'onDelete':_0x4751('0x125'),'foreignKey':_0x4751('0x198')});db[_0x4751('0x1a6')]['hasMany'](db['VtigerField'],{'as':'Subjects','foreignKey':_0x4751('0x196')});db[_0x4751('0x1a6')][_0x4751('0xf9')](db[_0x4751('0xc3')],{'as':_0x4751('0x197'),'foreignKey':_0x4751('0x19b')});db[_0x4751('0x1a6')][_0x4751('0xf9')](db[_0x4751('0xc3')],{'as':_0x4751('0x193'),'foreignKey':_0x4751('0x19d')});db[_0x4751('0x1a6')][_0x4751('0x103')](db['VtigerAccount'],{'as':_0x4751('0x14d'),'foreignKey':'AccountId'});db[_0x4751('0x1a6')]['belongsToMany'](db['Tag'],{'through':_0x4751('0x1a7')});db['VtigerField'][_0x4751('0xf9')](db['VtigerField'],{'as':_0x4751('0x199'),'foreignKey':_0x4751('0x196')});db[_0x4751('0xc3')][_0x4751('0xf9')](db[_0x4751('0xc3')],{'as':_0x4751('0x19a'),'foreignKey':_0x4751('0x19b')});db['VtigerField'][_0x4751('0xf9')](db[_0x4751('0xc3')],{'as':'Field','foreignKey':_0x4751('0x19d')});db['VtigerField'][_0x4751('0x103')](db[_0x4751('0x95')],{'as':_0x4751('0x95'),'foreignKey':_0x4751('0x19e')});db[_0x4751('0xc4')][_0x4751('0xf9')](db[_0x4751('0xc5')],{'as':'Configurations','onDelete':_0x4751('0x125'),'foreignKey':_0x4751('0x198')});db[_0x4751('0xc5')][_0x4751('0xf9')](db[_0x4751('0xc6')],{'as':_0x4751('0x19f'),'foreignKey':_0x4751('0x196')});db['ServicenowConfiguration'][_0x4751('0xf9')](db[_0x4751('0xc6')],{'as':'Descriptions','foreignKey':_0x4751('0x19b')});db[_0x4751('0xc5')][_0x4751('0xf9')](db[_0x4751('0xc6')],{'as':_0x4751('0x193'),'foreignKey':_0x4751('0x19d')});db[_0x4751('0xc5')][_0x4751('0x103')](db['ServicenowAccount'],{'as':_0x4751('0x14d'),'foreignKey':_0x4751('0x198')});db[_0x4751('0xc6')][_0x4751('0xf9')](db[_0x4751('0xc6')],{'as':_0x4751('0x199'),'foreignKey':_0x4751('0x196')});db[_0x4751('0xc6')][_0x4751('0xf9')](db['ServicenowField'],{'as':_0x4751('0x19a'),'foreignKey':'DescriptionId'});db[_0x4751('0xc6')][_0x4751('0xf9')](db['ServicenowField'],{'as':_0x4751('0x19c'),'foreignKey':_0x4751('0x19d')});db[_0x4751('0xc6')][_0x4751('0x103')](db[_0x4751('0x95')],{'as':_0x4751('0x95'),'foreignKey':_0x4751('0x19e')});db[_0x4751('0xc8')][_0x4751('0xf9')](db['Dynamics365Configuration'],{'as':_0x4751('0x195'),'onDelete':'cascade','foreignKey':_0x4751('0x198')});db['Dynamics365Configuration'][_0x4751('0xf9')](db[_0x4751('0xca')],{'as':'Subjects','onDelete':_0x4751('0x125'),'foreignKey':_0x4751('0x196')});db[_0x4751('0xc9')][_0x4751('0xf9')](db['Dynamics365Field'],{'as':_0x4751('0x197'),'onDelete':_0x4751('0x125'),'foreignKey':'DescriptionId'});db[_0x4751('0xc9')][_0x4751('0xf9')](db[_0x4751('0xca')],{'as':'Fields','onDelete':_0x4751('0x125'),'foreignKey':_0x4751('0x19d')});db[_0x4751('0xc9')][_0x4751('0x103')](db['Dynamics365Account'],{'as':'Account','foreignKey':_0x4751('0x198')});db[_0x4751('0xca')][_0x4751('0xf9')](db['Dynamics365Field'],{'as':_0x4751('0x199'),'foreignKey':'SubjectId'});db[_0x4751('0xca')][_0x4751('0xf9')](db[_0x4751('0xca')],{'as':'Description','foreignKey':'DescriptionId'});db['Dynamics365Field'][_0x4751('0xf9')](db[_0x4751('0xca')],{'as':_0x4751('0x19c'),'foreignKey':_0x4751('0x19d')});db[_0x4751('0xca')][_0x4751('0x103')](db['Variable'],{'as':_0x4751('0x95'),'foreignKey':_0x4751('0x19e')});db[_0x4751('0xcb')][_0x4751('0x103')](db[_0x4751('0x61')],{});db[_0x4751('0xcb')]['belongsTo'](db[_0x4751('0xee')],{'as':_0x4751('0x15c'),'foreignKey':_0x4751('0x149')});db[_0x4751('0xcb')][_0x4751('0x103')](db[_0x4751('0x71')],{'as':_0x4751('0x140'),'foreignKey':'ContactId'});db[_0x4751('0xcb')][_0x4751('0x103')](db[_0x4751('0x66')],{});db[_0x4751('0xcb')]['belongsTo'](db[_0x4751('0x68')],{});db[_0x4751('0xcb')][_0x4751('0x103')](db[_0x4751('0xfc')],{});db[_0x4751('0xcb')][_0x4751('0x103')](db[_0x4751('0x6b')],{});db[_0x4751('0x173')][_0x4751('0x103')](db['User'],{'onDelete':_0x4751('0x125'),'foreignKey':'FromId'});db['ChatInternalMessage'][_0x4751('0x103')](db[_0x4751('0xfc')],{'onDelete':'cascade','foreignKey':_0x4751('0x1a8')});db[_0x4751('0xcf')]['hasMany'](db[_0x4751('0x1a9')],{'foreignKey':_0x4751('0x1aa'),'onDelete':_0x4751('0x125')});db['JscriptySessionReport'][_0x4751('0xf9')](db[_0x4751('0x1ab')],{'foreignKey':'SessionId','onDelete':_0x4751('0x125')});db[_0x4751('0xd1')][_0x4751('0x103')](db[_0x4751('0x120')],{});db[_0x4751('0xd1')][_0x4751('0x103')](db[_0x4751('0xee')],{'as':_0x4751('0x15c'),'foreignKey':_0x4751('0x149')});db[_0x4751('0xd1')][_0x4751('0x103')](db[_0x4751('0x71')],{'as':_0x4751('0x140'),'foreignKey':_0x4751('0x141')});db['SmsQueueReport'][_0x4751('0x103')](db[_0x4751('0x57')],{});db['SmsQueueReport']['belongsTo'](db[_0x4751('0x15e')],{});db[_0x4751('0xd1')][_0x4751('0x103')](db[_0x4751('0xfc')],{});db['SmsQueueReport']['belongsTo'](db[_0x4751('0x5a')],{});db[_0x4751('0xd6')][_0x4751('0xf9')](db[_0x4751('0xcf')],{'foreignKey':_0x4751('0x1ac')});db[_0x4751('0xd6')][_0x4751('0xf9')](db['JscriptyQuestionReport'],{'foreignKey':_0x4751('0x1ac')});db[_0x4751('0xd6')][_0x4751('0xf9')](db[_0x4751('0x1ab')],{'foreignKey':_0x4751('0x1ac')});db[_0x4751('0xdb')][_0x4751('0x105')](db[_0x4751('0xfc')],{'as':_0x4751('0x151'),'through':_0x4751('0x123')});db[_0x4751('0xe0')][_0x4751('0x105')](db[_0x4751('0xfc')],{'as':_0x4751('0x137'),'through':_0x4751('0x10b')});db[_0x4751('0xe0')][_0x4751('0x105')](db[_0x4751('0x113')],{'through':_0x4751('0x139'),'as':_0x4751('0x114')});db[_0x4751('0xe0')][_0x4751('0x105')](db['MailQueue'],{'through':_0x4751('0x14b'),'as':_0x4751('0x115')});db[_0x4751('0xe0')][_0x4751('0x105')](db[_0x4751('0x6b')],{'through':_0x4751('0x172'),'as':_0x4751('0x1ad')});db[_0x4751('0xe0')][_0x4751('0x105')](db[_0x4751('0x51')],{'through':_0x4751('0x1ae'),'as':'FaxQueues'});db['Team']['belongsToMany'](db[_0x4751('0x5a')],{'through':_0x4751('0x164'),'as':_0x4751('0x117')});db[_0x4751('0xe0')][_0x4751('0x105')](db[_0x4751('0x5f')],{'through':_0x4751('0x16b'),'as':_0x4751('0x118')});db[_0x4751('0x17b')]['hasMany'](db[_0x4751('0x12b')],{'as':_0x4751('0x12c'),'foreignKey':_0x4751('0x17c')});db['Campaign'][_0x4751('0xf9')](db[_0x4751('0x76')],{'as':_0x4751('0x12d'),'foreignKey':_0x4751('0x17c')});db[_0x4751('0x17b')][_0x4751('0xf9')](db[_0x4751('0x78')],{'as':_0x4751('0x12e'),'foreignKey':_0x4751('0x17c')});db[_0x4751('0x17b')][_0x4751('0xf9')](db['CmHopperBlack'],{'as':'HopperBlacks','foreignKey':_0x4751('0x17c')});db[_0x4751('0x17b')][_0x4751('0x103')](db['Trunk'],{'as':_0x4751('0x2a'),'foreignKey':_0x4751('0x131')});db[_0x4751('0x17b')]['belongsTo'](db[_0x4751('0x2a')],{'as':_0x4751('0x132'),'foreignKey':_0x4751('0x133')});db[_0x4751('0x17b')]['belongsTo'](db['Interval'],{'as':_0x4751('0x84'),'foreignKey':_0x4751('0x134')});db[_0x4751('0x17b')][_0x4751('0x103')](db[_0x4751('0xdb')],{'as':_0x4751('0xdb'),'foreignKey':'SquareProjectId'});db[_0x4751('0x17b')][_0x4751('0x105')](db[_0x4751('0xee')],{'as':'Lists','through':_0x4751('0x1af')});db[_0x4751('0x17b')][_0x4751('0x105')](db[_0x4751('0xee')],{'as':'BlackLists','through':_0x4751('0x1b0')});db[_0x4751('0xe9')]['belongsTo'](db[_0x4751('0x42')],{});db[_0x4751('0xe9')][_0x4751('0x103')](db[_0x4751('0x40')],{});db[_0x4751('0xe9')][_0x4751('0x103')](db[_0x4751('0x3a')],{'foreignKey':_0x4751('0x1b1'),'as':_0x4751('0x1b2')});db[_0x4751('0xe9')][_0x4751('0x103')](db['User'],{'foreignKey':_0x4751('0x1b3'),'as':_0x4751('0x1b4')});db[_0x4751('0xe9')]['belongsTo'](db[_0x4751('0xfc')],{'foreignKey':_0x4751('0x1b5'),'as':_0x4751('0x1b6')});db['MailTransferReport'][_0x4751('0x103')](db[_0x4751('0x3c')],{'foreignKey':_0x4751('0x1b7'),'as':'ToQueue'});db[_0x4751('0xe9')]['belongsTo'](db['MailAccount'],{'foreignKey':_0x4751('0x1b8'),'as':_0x4751('0x1b9')});db[_0x4751('0x1ba')][_0x4751('0x103')](db[_0x4751('0x68')],{});db[_0x4751('0x1ba')][_0x4751('0x103')](db[_0x4751('0x66')],{});db[_0x4751('0x1ba')]['belongsTo'](db[_0x4751('0x61')],{'foreignKey':_0x4751('0x1bb'),'as':_0x4751('0x1b2')});db['ChatTransferReport'][_0x4751('0x103')](db[_0x4751('0xfc')],{'foreignKey':_0x4751('0x1b3'),'as':_0x4751('0x1b4')});db[_0x4751('0x1ba')][_0x4751('0x103')](db[_0x4751('0xfc')],{'foreignKey':_0x4751('0x1b5'),'as':_0x4751('0x1b6')});db['ChatTransferReport'][_0x4751('0x103')](db[_0x4751('0x6b')],{'foreignKey':'ToChatQueueId','as':'ToQueue'});db[_0x4751('0x1ba')][_0x4751('0x103')](db[_0x4751('0x61')],{'foreignKey':_0x4751('0x1bc'),'as':_0x4751('0x1b9')});db[_0x4751('0x1bd')]['belongsTo'](db['FaxMessage'],{});db[_0x4751('0x1bd')]['belongsTo'](db[_0x4751('0x4d')],{});db['FaxTransferReport'][_0x4751('0x103')](db[_0x4751('0x4b')],{'foreignKey':'FromFaxAccountId','as':_0x4751('0x1b2')});db[_0x4751('0x1bd')][_0x4751('0x103')](db[_0x4751('0xfc')],{'foreignKey':_0x4751('0x1b3'),'as':_0x4751('0x1b4')});db[_0x4751('0x1bd')]['belongsTo'](db[_0x4751('0xfc')],{'foreignKey':'ToUserId','as':_0x4751('0x1b6')});db[_0x4751('0x1bd')][_0x4751('0x103')](db[_0x4751('0x51')],{'foreignKey':_0x4751('0x1be'),'as':_0x4751('0x1bf')});db[_0x4751('0x1bd')][_0x4751('0x103')](db['FaxAccount'],{'foreignKey':_0x4751('0x1c0'),'as':'ToAccount'});db['OpenchannelTransferReport'][_0x4751('0x103')](db[_0x4751('0x5e')],{});db[_0x4751('0xed')][_0x4751('0x103')](db[_0x4751('0x5d')],{});db[_0x4751('0xed')][_0x4751('0x103')](db[_0x4751('0x165')],{'foreignKey':_0x4751('0x1c1'),'as':_0x4751('0x1b2')});db[_0x4751('0xed')][_0x4751('0x103')](db[_0x4751('0xfc')],{'foreignKey':'FromUserId','as':_0x4751('0x1b4')});db[_0x4751('0xed')][_0x4751('0x103')](db[_0x4751('0xfc')],{'foreignKey':'ToUserId','as':_0x4751('0x1b6')});db[_0x4751('0xed')]['belongsTo'](db['OpenchannelQueue'],{'foreignKey':_0x4751('0x1c2'),'as':_0x4751('0x1bf')});db[_0x4751('0xed')][_0x4751('0x103')](db['OpenchannelAccount'],{'foreignKey':_0x4751('0x1c3'),'as':_0x4751('0x1b9')});db[_0x4751('0x1c4')]['belongsTo'](db[_0x4751('0x15e')],{});db[_0x4751('0x1c4')][_0x4751('0x103')](db[_0x4751('0x57')],{});db['SmsTransferReport'][_0x4751('0x103')](db[_0x4751('0x120')],{'foreignKey':_0x4751('0x1c5'),'as':_0x4751('0x1b2')});db[_0x4751('0x1c4')][_0x4751('0x103')](db[_0x4751('0xfc')],{'foreignKey':_0x4751('0x1b3'),'as':_0x4751('0x1b4')});db['SmsTransferReport'][_0x4751('0x103')](db[_0x4751('0xfc')],{'foreignKey':'ToUserId','as':_0x4751('0x1b6')});db[_0x4751('0x1c4')][_0x4751('0x103')](db[_0x4751('0x5a')],{'foreignKey':_0x4751('0x1c6'),'as':'ToQueue'});db[_0x4751('0x1c4')][_0x4751('0x103')](db[_0x4751('0x120')],{'foreignKey':_0x4751('0x1c7'),'as':_0x4751('0x1b9')});db[_0x4751('0xee')][_0x4751('0xf9')](db['Disposition'],{'as':_0x4751('0x144'),'foreignKey':_0x4751('0x149')});db['CmList'][_0x4751('0xf9')](db[_0x4751('0x7c')],{'as':'CustomFields','foreignKey':_0x4751('0x149')});db[_0x4751('0xee')][_0x4751('0xf9')](db[_0x4751('0x71')],{'as':_0x4751('0x177'),'onDelete':_0x4751('0x125'),'foreignKey':'ListId'});db[_0x4751('0xee')][_0x4751('0xf9')](db[_0x4751('0x76')],{'as':_0x4751('0x12d'),'foreignKey':'ListId'});db['CmList'][_0x4751('0xf9')](db[_0x4751('0x78')],{'as':'HopperHistory','foreignKey':_0x4751('0x149')});db['CmList'][_0x4751('0xf9')](db[_0x4751('0x7a')],{'as':'ReportAgentPreview','foreignKey':_0x4751('0x149')});db[_0x4751('0xee')]['belongsToMany'](db[_0x4751('0x113')],{'as':_0x4751('0x1c8'),'through':_0x4751('0x136')});db[_0x4751('0xee')][_0x4751('0x105')](db[_0x4751('0xfc')],{'as':_0x4751('0x137'),'through':_0x4751('0x10a')});db['VoicePrefix'][_0x4751('0xf9')](db[_0x4751('0xfd')],{'as':_0x4751('0xfe'),'onDelete':_0x4751('0x154')});db[_0x4751('0xf0')][_0x4751('0x105')](db[_0x4751('0xfc')],{'as':'Agents','through':_0x4751('0x1c9')});db[_0x4751('0xf2')][_0x4751('0xf9')](db[_0x4751('0xfc')],{'as':'Users','foreignKey':_0x4751('0x104')});db[_0x4751('0xf2')]['hasMany'](db['UserProfileSection'],{'as':_0x4751('0x1ca'),'foreignKey':_0x4751('0x104'),'onDelete':'cascade'});db['UserProfileSection'][_0x4751('0xf9')](db[_0x4751('0xf5')],{'as':'Resources','foreignKey':'sectionId','onDelete':_0x4751('0x125')});module[_0x4751('0x1cb')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index daf4fb2..5442809 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x19a8=['./config/logger','api','auth','default','logger','format','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','method','x-forwarded-for','headers','connection','remoteAddress','url','responseTime','user','name','role','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','body','device','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','other','agent_name','test','use','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','/api/voice/calls/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','/api/mail/accounts','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','./api/mailInteraction','/api/mail/messages','/api/mail/applications','./api/mailApplication','./api/mailQueueReport','/api/dashboards','./api/dashboard','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','./api/chatQueue','/api/chat/groups','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','./api/action','/api/automations','./api/cannedAnswer','./api/disposition','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/tag','/api/templates','./api/template','./api/variable','/api/integrations','./api/integration','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticFieldReport','./api/analyticTreeReport','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','/api/integrations/desk/configurations','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','/api/integrations/zoho/fields','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','/api/integrations/vtiger/fields','/api/integrations/servicenow/accounts','/api/integrations/servicenow/configurations','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','./api/squareMessage','/api/teams','./api/team','./api/license','/api/campaigns','./api/campaign','./api/migration','/api/attachments','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','/api/fax/reports/transfer','./api/faxTransferReport','./api/openchannelTransferReport','./api/cmList','/api/voice/prefixes','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/auth/local','/api/auth/google','./api/authGoogle','/api/jira','./api/jira','./api/rpc','/api/version','/api/system','./api/system','/api/pm2','/apidoc','static','root','/www','join','/demo','snippet','1.0.15','/plugins','/server/files/plugins','route','get','sendFile','resolve','appPath','/index.html','express','util','./errors'];(function(_0x25f306,_0x586946){var _0x2b6e5e=function(_0xbf2605){while(--_0xbf2605){_0x25f306['push'](_0x25f306['shift']());}};_0x2b6e5e(++_0x586946);}(_0x19a8,0x10e));var _0x819a=function(_0x23a93c,_0x367041){_0x23a93c=_0x23a93c-0x0;var _0x54cfb2=_0x19a8[_0x23a93c];return _0x54cfb2;};'use strict';var path=require('path');var express=require(_0x819a('0x0'));var ewinston=require('express-winston');var util=require(_0x819a('0x1'));var errors=require(_0x819a('0x2'));var config=require('./config/environment');var logger=require(_0x819a('0x3'))(_0x819a('0x4'));var authLogger=require(_0x819a('0x3'))(_0x819a('0x5'));exports[_0x819a('0x6')]=function(_0x5464a2){_0x5464a2['use'](ewinston[_0x819a('0x7')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x27c7cf,_0x73ba38){return util[_0x819a('0x8')](_0x819a('0x9'),_0x27c7cf[_0x819a('0xa')],_0x27c7cf['headers'][_0x819a('0xb')]?_0x27c7cf[_0x819a('0xc')]['x-forwarded-for']:_0x27c7cf[_0x819a('0xd')][_0x819a('0xe')]||_0x27c7cf['ip'],_0x27c7cf[_0x819a('0xf')],_0x73ba38['statusCode'],_0x73ba38[_0x819a('0x10')],_0x27c7cf[_0x819a('0x11')]?_0x27c7cf['user']['id']:null,_0x27c7cf[_0x819a('0x11')]?_0x27c7cf[_0x819a('0x11')][_0x819a('0x12')]:null,_0x27c7cf[_0x819a('0x11')]?_0x27c7cf['user'][_0x819a('0x13')]:null);}}));_0x5464a2['use'](ewinston[_0x819a('0x7')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x41d7f8,_0x16fd4f){var _0x58c14a=_0x819a('0x14');if(_0x41d7f8[_0x819a('0x15')]&&_0x41d7f8[_0x819a('0x15')][_0x819a('0x16')]&&_0x41d7f8[_0x819a('0x15')]['agent_id']){_0x58c14a=_0x819a('0x17');}return util[_0x819a('0x8')](_0x58c14a,_0x41d7f8[_0x819a('0xa')],_0x41d7f8[_0x819a('0xc')]['x-forwarded-for']?_0x41d7f8[_0x819a('0xc')][_0x819a('0xb')]:_0x41d7f8[_0x819a('0xd')][_0x819a('0xe')]||_0x41d7f8['ip'],_0x41d7f8[_0x819a('0xf')],_0x16fd4f['statusCode'],_0x16fd4f[_0x819a('0x10')],_0x41d7f8[_0x819a('0x11')]?_0x41d7f8[_0x819a('0x11')]['id']:null,_0x41d7f8[_0x819a('0x11')]?_0x41d7f8[_0x819a('0x11')][_0x819a('0x12')]:null,_0x41d7f8[_0x819a('0x11')]?_0x41d7f8[_0x819a('0x11')][_0x819a('0x13')]:null,_0x41d7f8[_0x819a('0x15')]&&_0x41d7f8['body'][_0x819a('0x16')]?_0x41d7f8[_0x819a('0x15')][_0x819a('0x16')]:_0x819a('0x18'),_0x41d7f8['body']&&_0x41d7f8[_0x819a('0x15')]['agent_id']?_0x41d7f8[_0x819a('0x15')]['agent_id']:'',_0x41d7f8[_0x819a('0x15')]&&_0x41d7f8['body']['agent_name']?_0x41d7f8[_0x819a('0x15')][_0x819a('0x19')]:'');},'ignoreRoute':function(_0x22c7ee){var _0x200003=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x200003[_0x819a('0x1a')](_0x22c7ee[_0x819a('0xf')]);}}));_0x5464a2[_0x819a('0x1b')](_0x819a('0x1c'),require(_0x819a('0x1d')));_0x5464a2[_0x819a('0x1b')](_0x819a('0x1e'),require(_0x819a('0x1f')));_0x5464a2[_0x819a('0x1b')](_0x819a('0x20'),require(_0x819a('0x21')));_0x5464a2[_0x819a('0x1b')]('/api/voice/extensions',require(_0x819a('0x22')));_0x5464a2[_0x819a('0x1b')](_0x819a('0x23'),require(_0x819a('0x24')));_0x5464a2['use']('/api/voice/queues',require('./api/voiceQueue'));_0x5464a2[_0x819a('0x1b')](_0x819a('0x25'),require(_0x819a('0x26')));_0x5464a2[_0x819a('0x1b')](_0x819a('0x27'),require(_0x819a('0x28')));_0x5464a2[_0x819a('0x1b')](_0x819a('0x29'),require(_0x819a('0x2a')));_0x5464a2[_0x819a('0x1b')](_0x819a('0x2b'),require('./api/voiceMailMessage'));_0x5464a2[_0x819a('0x1b')](_0x819a('0x2c'),require('./api/voiceCallReport'));_0x5464a2[_0x819a('0x1b')]('/api/voice/dials/reports',require(_0x819a('0x2d')));_0x5464a2[_0x819a('0x1b')](_0x819a('0x2e'),require(_0x819a('0x2f')));_0x5464a2[_0x819a('0x1b')](_0x819a('0x30'),require(_0x819a('0x31')));_0x5464a2['use'](_0x819a('0x32'),require(_0x819a('0x33')));_0x5464a2['use'](_0x819a('0x34'),require('./api/trunk'));_0x5464a2[_0x819a('0x1b')](_0x819a('0x35'),require(_0x819a('0x36')));_0x5464a2[_0x819a('0x1b')](_0x819a('0x37'),require('./api/mailServerOut'));_0x5464a2[_0x819a('0x1b')](_0x819a('0x38'),require('./api/mailAccount'));_0x5464a2[_0x819a('0x1b')](_0x819a('0x39'),require(_0x819a('0x3a')));_0x5464a2[_0x819a('0x1b')](_0x819a('0x3b'),require(_0x819a('0x3c')));_0x5464a2[_0x819a('0x1b')]('/api/mail/interactions',require(_0x819a('0x3d')));_0x5464a2[_0x819a('0x1b')](_0x819a('0x3e'),require('./api/mailMessage'));_0x5464a2[_0x819a('0x1b')](_0x819a('0x3f'),require(_0x819a('0x40')));_0x5464a2[_0x819a('0x1b')]('/api/mail/reports/queue',require(_0x819a('0x41')));_0x5464a2[_0x819a('0x1b')](_0x819a('0x42'),require(_0x819a('0x43')));_0x5464a2[_0x819a('0x1b')]('/api/dashboards/items',require(_0x819a('0x44')));_0x5464a2[_0x819a('0x1b')](_0x819a('0x45'),require(_0x819a('0x46')));_0x5464a2[_0x819a('0x1b')]('/api/fax/applications',require(_0x819a('0x47')));_0x5464a2[_0x819a('0x1b')](_0x819a('0x48'),require(_0x819a('0x49')));_0x5464a2[_0x819a('0x1b')](_0x819a('0x4a'),require(_0x819a('0x4b')));_0x5464a2['use'](_0x819a('0x4c'),require(_0x819a('0x4d')));_0x5464a2[_0x819a('0x1b')](_0x819a('0x4e'),require(_0x819a('0x4f')));_0x5464a2[_0x819a('0x1b')](_0x819a('0x50'),require(_0x819a('0x51')));_0x5464a2[_0x819a('0x1b')](_0x819a('0x52'),require(_0x819a('0x53')));_0x5464a2['use'](_0x819a('0x54'),require('./api/smsInteraction'));_0x5464a2[_0x819a('0x1b')](_0x819a('0x55'),require(_0x819a('0x56')));_0x5464a2[_0x819a('0x1b')](_0x819a('0x57'),require(_0x819a('0x58')));_0x5464a2[_0x819a('0x1b')](_0x819a('0x59'),require(_0x819a('0x5a')));_0x5464a2['use'](_0x819a('0x5b'),require(_0x819a('0x5c')));_0x5464a2[_0x819a('0x1b')](_0x819a('0x5d'),require(_0x819a('0x5e')));_0x5464a2[_0x819a('0x1b')](_0x819a('0x5f'),require(_0x819a('0x60')));_0x5464a2['use']('/api/openchannel/queues',require(_0x819a('0x61')));_0x5464a2[_0x819a('0x1b')](_0x819a('0x62'),require(_0x819a('0x63')));_0x5464a2[_0x819a('0x1b')](_0x819a('0x64'),require(_0x819a('0x65')));_0x5464a2['use'](_0x819a('0x66'),require(_0x819a('0x67')));_0x5464a2['use'](_0x819a('0x68'),require(_0x819a('0x69')));_0x5464a2[_0x819a('0x1b')](_0x819a('0x6a'),require(_0x819a('0x6b')));_0x5464a2['use'](_0x819a('0x6c'),require(_0x819a('0x6d')));_0x5464a2[_0x819a('0x1b')]('/api/chat/queues',require(_0x819a('0x6e')));_0x5464a2[_0x819a('0x1b')](_0x819a('0x6f'),require('./api/chatGroup'));_0x5464a2[_0x819a('0x1b')]('/api/chat/proactive_actions',require(_0x819a('0x70')));_0x5464a2['use'](_0x819a('0x71'),require(_0x819a('0x72')));_0x5464a2['use'](_0x819a('0x73'),require(_0x819a('0x74')));_0x5464a2[_0x819a('0x1b')](_0x819a('0x75'),require(_0x819a('0x76')));_0x5464a2['use'](_0x819a('0x77'),require(_0x819a('0x78')));_0x5464a2['use'](_0x819a('0x79'),require('./api/cmHopperFinal'));_0x5464a2[_0x819a('0x1b')](_0x819a('0x7a'),require(_0x819a('0x7b')));_0x5464a2[_0x819a('0x1b')](_0x819a('0x7c'),require(_0x819a('0x7d')));_0x5464a2[_0x819a('0x1b')]('/api/actions',require(_0x819a('0x7e')));_0x5464a2[_0x819a('0x1b')](_0x819a('0x7f'),require('./api/automation'));_0x5464a2[_0x819a('0x1b')]('/api/canned_answers',require(_0x819a('0x80')));_0x5464a2[_0x819a('0x1b')]('/api/dispositions',require(_0x819a('0x81')));_0x5464a2[_0x819a('0x1b')]('/api/conditions',require('./api/condition'));_0x5464a2[_0x819a('0x1b')](_0x819a('0x82'),require(_0x819a('0x83')));_0x5464a2[_0x819a('0x1b')](_0x819a('0x84'),require(_0x819a('0x85')));_0x5464a2[_0x819a('0x1b')](_0x819a('0x86'),require(_0x819a('0x87')));_0x5464a2[_0x819a('0x1b')](_0x819a('0x88'),require(_0x819a('0x89')));_0x5464a2[_0x819a('0x1b')](_0x819a('0x8a'),require(_0x819a('0x8b')));_0x5464a2['use'](_0x819a('0x8c'),require(_0x819a('0x8d')));_0x5464a2['use'](_0x819a('0x8e'),require(_0x819a('0x8f')));_0x5464a2[_0x819a('0x1b')](_0x819a('0x90'),require(_0x819a('0x91')));_0x5464a2[_0x819a('0x1b')]('/api/triggers',require('./api/trigger'));_0x5464a2['use']('/api/variables',require(_0x819a('0x92')));_0x5464a2[_0x819a('0x1b')](_0x819a('0x93'),require(_0x819a('0x94')));_0x5464a2[_0x819a('0x1b')]('/api/integrations/reports',require(_0x819a('0x95')));_0x5464a2['use'](_0x819a('0x96'),require(_0x819a('0x97')));_0x5464a2['use'](_0x819a('0x98'),require(_0x819a('0x99')));_0x5464a2[_0x819a('0x1b')](_0x819a('0x9a'),require(_0x819a('0x9b')));_0x5464a2['use'](_0x819a('0x9c'),require('./api/analyticMetric'));_0x5464a2[_0x819a('0x1b')]('/api/analytics/field_reports',require(_0x819a('0x9d')));_0x5464a2['use']('/api/analytics/tree_reports',require(_0x819a('0x9e')));_0x5464a2['use']('/api/integrations/salesforce/accounts',require(_0x819a('0x9f')));_0x5464a2[_0x819a('0x1b')](_0x819a('0xa0'),require(_0x819a('0xa1')));_0x5464a2[_0x819a('0x1b')](_0x819a('0xa2'),require(_0x819a('0xa3')));_0x5464a2[_0x819a('0x1b')](_0x819a('0xa4'),require(_0x819a('0xa5')));_0x5464a2[_0x819a('0x1b')](_0x819a('0xa6'),require('./api/intSugarcrmConfiguration'));_0x5464a2[_0x819a('0x1b')](_0x819a('0xa7'),require(_0x819a('0xa8')));_0x5464a2[_0x819a('0x1b')](_0x819a('0xa9'),require('./api/intDeskAccount'));_0x5464a2['use'](_0x819a('0xaa'),require('./api/intDeskConfiguration'));_0x5464a2[_0x819a('0x1b')](_0x819a('0xab'),require(_0x819a('0xac')));_0x5464a2['use'](_0x819a('0xad'),require('./api/intZohoAccount'));_0x5464a2[_0x819a('0x1b')]('/api/integrations/zoho/configurations',require('./api/intZohoConfiguration'));_0x5464a2['use'](_0x819a('0xae'),require('./api/intZohoField'));_0x5464a2['use'](_0x819a('0xaf'),require(_0x819a('0xb0')));_0x5464a2[_0x819a('0x1b')](_0x819a('0xb1'),require('./api/intZendeskConfiguration'));_0x5464a2[_0x819a('0x1b')]('/api/integrations/zendesk/fields',require(_0x819a('0xb2')));_0x5464a2[_0x819a('0x1b')](_0x819a('0xb3'),require(_0x819a('0xb4')));_0x5464a2[_0x819a('0x1b')](_0x819a('0xb5'),require(_0x819a('0xb6')));_0x5464a2[_0x819a('0x1b')](_0x819a('0xb7'),require(_0x819a('0xb8')));_0x5464a2[_0x819a('0x1b')](_0x819a('0xb9'),require(_0x819a('0xba')));_0x5464a2[_0x819a('0x1b')](_0x819a('0xbb'),require('./api/intVtigerConfiguration'));_0x5464a2[_0x819a('0x1b')](_0x819a('0xbc'),require('./api/intVtigerField'));_0x5464a2[_0x819a('0x1b')](_0x819a('0xbd'),require('./api/intServicenowAccount'));_0x5464a2[_0x819a('0x1b')](_0x819a('0xbe'),require('./api/intServicenowConfiguration'));_0x5464a2[_0x819a('0x1b')](_0x819a('0xbf'),require(_0x819a('0xc0')));_0x5464a2[_0x819a('0x1b')](_0x819a('0xc1'),require(_0x819a('0xc2')));_0x5464a2[_0x819a('0x1b')](_0x819a('0xc3'),require('./api/intDynamics365Configuration'));_0x5464a2[_0x819a('0x1b')](_0x819a('0xc4'),require(_0x819a('0xc5')));_0x5464a2[_0x819a('0x1b')](_0x819a('0xc6'),require(_0x819a('0xc7')));_0x5464a2['use'](_0x819a('0xc8'),require(_0x819a('0xc9')));_0x5464a2[_0x819a('0x1b')](_0x819a('0xca'),require(_0x819a('0xcb')));_0x5464a2['use'](_0x819a('0xcc'),require(_0x819a('0xcd')));_0x5464a2[_0x819a('0x1b')](_0x819a('0xce'),require(_0x819a('0xcf')));_0x5464a2['use'](_0x819a('0xd0'),require(_0x819a('0xd1')));_0x5464a2[_0x819a('0x1b')]('/api/sms/reports/queue',require(_0x819a('0xd2')));_0x5464a2[_0x819a('0x1b')](_0x819a('0xd3'),require(_0x819a('0xd4')));_0x5464a2[_0x819a('0x1b')](_0x819a('0xd5'),require(_0x819a('0xd6')));_0x5464a2[_0x819a('0x1b')]('/api/jscripty/projects',require(_0x819a('0xd7')));_0x5464a2['use'](_0x819a('0xd8'),require(_0x819a('0xd9')));_0x5464a2[_0x819a('0x1b')](_0x819a('0xda'),require(_0x819a('0xdb')));_0x5464a2[_0x819a('0x1b')](_0x819a('0xdc'),require(_0x819a('0xdd')));_0x5464a2[_0x819a('0x1b')](_0x819a('0xde'),require(_0x819a('0xdf')));_0x5464a2['use']('/api/square/messages',require(_0x819a('0xe0')));_0x5464a2[_0x819a('0x1b')](_0x819a('0xe1'),require(_0x819a('0xe2')));_0x5464a2[_0x819a('0x1b')]('/api/license',require(_0x819a('0xe3')));_0x5464a2[_0x819a('0x1b')](_0x819a('0xe4'),require(_0x819a('0xe5')));_0x5464a2[_0x819a('0x1b')]('/api/migrations',require(_0x819a('0xe6')));_0x5464a2[_0x819a('0x1b')](_0x819a('0xe7'),require('./api/attachment'));_0x5464a2[_0x819a('0x1b')]('/api/plugins',require(_0x819a('0xe8')));_0x5464a2[_0x819a('0x1b')](_0x819a('0xe9'),require(_0x819a('0xea')));_0x5464a2[_0x819a('0x1b')](_0x819a('0xeb'),require('./api/chatTransferReport'));_0x5464a2[_0x819a('0x1b')](_0x819a('0xec'),require(_0x819a('0xed')));_0x5464a2[_0x819a('0x1b')]('/api/openchannel/reports/transfer',require(_0x819a('0xee')));_0x5464a2[_0x819a('0x1b')]('/api/sms/reports/transfer',require('./api/smsTransferReport'));_0x5464a2['use']('/api/cm/lists',require(_0x819a('0xef')));_0x5464a2['use'](_0x819a('0xf0'),require('./api/voicePrefix'));_0x5464a2[_0x819a('0x1b')](_0x819a('0xf1'),require(_0x819a('0xf2')));_0x5464a2[_0x819a('0x1b')](_0x819a('0xf3'),require(_0x819a('0xf4')));_0x5464a2[_0x819a('0x1b')](_0x819a('0xf5'),require(_0x819a('0xf6')));_0x5464a2[_0x819a('0x1b')](_0x819a('0xf7'),require('./api/authLocal'));_0x5464a2[_0x819a('0x1b')](_0x819a('0xf8'),require(_0x819a('0xf9')));_0x5464a2[_0x819a('0x1b')](_0x819a('0xfa'),require(_0x819a('0xfb')));_0x5464a2[_0x819a('0x1b')]('/api/rpc',require(_0x819a('0xfc')));_0x5464a2['use'](_0x819a('0xfd'),require('./api/version'));_0x5464a2[_0x819a('0x1b')](_0x819a('0xfe'),require(_0x819a('0xff')));_0x5464a2[_0x819a('0x1b')](_0x819a('0x100'),require('./api/pm2'));_0x5464a2['use'](_0x819a('0x101'),express[_0x819a('0x102')](path['join'](config[_0x819a('0x103')],'/apidoc')));_0x5464a2[_0x819a('0x1b')](_0x819a('0x104'),express[_0x819a('0x102')](path[_0x819a('0x105')](config['root'],_0x819a('0x104'))));_0x5464a2[_0x819a('0x1b')]('/demo',express[_0x819a('0x102')](path[_0x819a('0x105')](config[_0x819a('0x103')],_0x819a('0x106'))));_0x5464a2['use']('/snippet',express[_0x819a('0x102')](path[_0x819a('0x105')](config[_0x819a('0x103')],_0x819a('0x107'),_0x819a('0x108'))));_0x5464a2[_0x819a('0x1b')](_0x819a('0x109'),express[_0x819a('0x102')](path[_0x819a('0x105')](config[_0x819a('0x103')],_0x819a('0x10a'))));_0x5464a2[_0x819a('0x10b')]('/:url(api|auth|components|app|bower_components|assets)/*')[_0x819a('0x10c')](errors[0x194]);_0x5464a2[_0x819a('0x10b')]('/*')['get'](function(_0x5c76e2,_0x378b3c){_0x378b3c[_0x819a('0x10d')](path[_0x819a('0x10e')](_0x5464a2[_0x819a('0x10c')](_0x819a('0x10f'))+_0x819a('0x110')));});}; \ No newline at end of file +var _0xee43=['./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/configurations','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','/api/integrations/servicenow/fields','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','./api/smsQueueReport','./api/squareReport','/api/square/details/reports','/api/jscripty/projects','./api/jscriptyProject','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','./api/squareRecording','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','/api/voice/prefixes','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','./api/userProfileResource','/api/auth/local','./api/authLocal','/api/jira','/api/version','/api/system','./api/system','/api/pm2','./api/pm2','/apidoc','static','join','root','/www','/demo','/snippet','snippet','1.0.15','/plugins','/server/files/plugins','route','get','sendFile','appPath','/index.html','path','express','express-winston','util','./config/logger','auth','default','use','logger','format','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','method','headers','x-forwarded-for','remoteAddress','url','statusCode','user','name','role','body','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','connection','responseTime','device','other','agent_name','test','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','./api/voiceExtension','/api/voice/mohs','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','/api/trunks','./api/trunk','/api/voice/transfers/reports','/api/mail/out_servers','./api/mailServerOut','./api/mailAccount','/api/mail/queues','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','./api/mailMessage','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','/api/fax/queues','/api/fax/reports/queue','./api/faxQueueReport','./api/smsAccount','/api/sms/applications','/api/sms/interactions','./api/smsInteraction','/api/sms/queues','./api/smsQueue','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','/api/chat/proactive_actions','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','/api/cm/hopper_black','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','/api/integrations','./api/integration','/api/integrations/reports'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0xee43,0x184));var _0x3ee4=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xee43[_0x14add3];return _0x4a174f;};'use strict';var path=require(_0x3ee4('0x0'));var express=require(_0x3ee4('0x1'));var ewinston=require(_0x3ee4('0x2'));var util=require(_0x3ee4('0x3'));var errors=require('./errors');var config=require('./config/environment');var logger=require(_0x3ee4('0x4'))('api');var authLogger=require(_0x3ee4('0x4'))(_0x3ee4('0x5'));exports[_0x3ee4('0x6')]=function(_0x37ffba){_0x37ffba[_0x3ee4('0x7')](ewinston[_0x3ee4('0x8')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0xcf4003,_0x3363f4){return util[_0x3ee4('0x9')](_0x3ee4('0xa'),_0xcf4003[_0x3ee4('0xb')],_0xcf4003[_0x3ee4('0xc')][_0x3ee4('0xd')]?_0xcf4003[_0x3ee4('0xc')]['x-forwarded-for']:_0xcf4003['connection'][_0x3ee4('0xe')]||_0xcf4003['ip'],_0xcf4003[_0x3ee4('0xf')],_0x3363f4[_0x3ee4('0x10')],_0x3363f4['responseTime'],_0xcf4003['user']?_0xcf4003[_0x3ee4('0x11')]['id']:null,_0xcf4003[_0x3ee4('0x11')]?_0xcf4003[_0x3ee4('0x11')][_0x3ee4('0x12')]:null,_0xcf4003[_0x3ee4('0x11')]?_0xcf4003[_0x3ee4('0x11')][_0x3ee4('0x13')]:null);}}));_0x37ffba[_0x3ee4('0x7')](ewinston[_0x3ee4('0x8')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x481fed,_0x2d91e0){var _0x31275d='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x481fed[_0x3ee4('0x14')]&&_0x481fed[_0x3ee4('0x14')]['device']&&_0x481fed[_0x3ee4('0x14')][_0x3ee4('0x15')]){_0x31275d=_0x3ee4('0x16');}return util[_0x3ee4('0x9')](_0x31275d,_0x481fed[_0x3ee4('0xb')],_0x481fed[_0x3ee4('0xc')]['x-forwarded-for']?_0x481fed[_0x3ee4('0xc')][_0x3ee4('0xd')]:_0x481fed[_0x3ee4('0x17')]['remoteAddress']||_0x481fed['ip'],_0x481fed[_0x3ee4('0xf')],_0x2d91e0[_0x3ee4('0x10')],_0x2d91e0[_0x3ee4('0x18')],_0x481fed[_0x3ee4('0x11')]?_0x481fed[_0x3ee4('0x11')]['id']:null,_0x481fed[_0x3ee4('0x11')]?_0x481fed[_0x3ee4('0x11')]['name']:null,_0x481fed[_0x3ee4('0x11')]?_0x481fed['user'][_0x3ee4('0x13')]:null,_0x481fed[_0x3ee4('0x14')]&&_0x481fed[_0x3ee4('0x14')][_0x3ee4('0x19')]?_0x481fed['body'][_0x3ee4('0x19')]:_0x3ee4('0x1a'),_0x481fed[_0x3ee4('0x14')]&&_0x481fed[_0x3ee4('0x14')]['agent_id']?_0x481fed[_0x3ee4('0x14')][_0x3ee4('0x15')]:'',_0x481fed[_0x3ee4('0x14')]&&_0x481fed[_0x3ee4('0x14')]['agent_name']?_0x481fed[_0x3ee4('0x14')][_0x3ee4('0x1b')]:'');},'ignoreRoute':function(_0xcab911){var _0x4a542d=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x4a542d[_0x3ee4('0x1c')](_0xcab911['url']);}}));_0x37ffba[_0x3ee4('0x7')]('/api/users',require(_0x3ee4('0x1d')));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0x1e'),require(_0x3ee4('0x1f')));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0x20'),require(_0x3ee4('0x21')));_0x37ffba[_0x3ee4('0x7')]('/api/voice/extensions',require(_0x3ee4('0x22')));_0x37ffba['use'](_0x3ee4('0x23'),require('./api/voiceMusicOnHold'));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0x24'),require(_0x3ee4('0x25')));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0x26'),require('./api/voiceRecording'));_0x37ffba[_0x3ee4('0x7')]('/api/screen/recordings',require('./api/screenRecording'));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0x27'),require(_0x3ee4('0x28')));_0x37ffba['use'](_0x3ee4('0x29'),require(_0x3ee4('0x2a')));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0x2b'),require('./api/voiceCallReport'));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0x2c'),require(_0x3ee4('0x2d')));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0x2e'),require(_0x3ee4('0x2f')));_0x37ffba['use'](_0x3ee4('0x30'),require(_0x3ee4('0x31')));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0x32'),require('./api/memberReport'));_0x37ffba['use'](_0x3ee4('0x33'),require(_0x3ee4('0x34')));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0x35'),require('./api/voiceTransferReport'));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0x36'),require(_0x3ee4('0x37')));_0x37ffba[_0x3ee4('0x7')]('/api/mail/accounts',require(_0x3ee4('0x38')));_0x37ffba['use'](_0x3ee4('0x39'),require('./api/mailQueue'));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0x3a'),require(_0x3ee4('0x3b')));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0x3c'),require(_0x3ee4('0x3d')));_0x37ffba['use']('/api/mail/messages',require(_0x3ee4('0x3e')));_0x37ffba[_0x3ee4('0x7')]('/api/mail/applications',require(_0x3ee4('0x3f')));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0x40'),require(_0x3ee4('0x41')));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0x42'),require('./api/dashboard'));_0x37ffba[_0x3ee4('0x7')]('/api/dashboards/items',require('./api/dashboardItem'));_0x37ffba[_0x3ee4('0x7')]('/api/fax/accounts',require(_0x3ee4('0x43')));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0x44'),require(_0x3ee4('0x45')));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0x46'),require('./api/faxInteraction'));_0x37ffba['use']('/api/fax/messages',require('./api/faxMessage'));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0x47'),require('./api/faxQueue'));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0x48'),require(_0x3ee4('0x49')));_0x37ffba[_0x3ee4('0x7')]('/api/sms/accounts',require(_0x3ee4('0x4a')));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0x4b'),require('./api/smsApplication'));_0x37ffba['use'](_0x3ee4('0x4c'),require(_0x3ee4('0x4d')));_0x37ffba[_0x3ee4('0x7')]('/api/sms/messages',require('./api/smsMessage'));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0x4e'),require(_0x3ee4('0x4f')));_0x37ffba[_0x3ee4('0x7')]('/api/openchannel/accounts',require(_0x3ee4('0x50')));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0x51'),require(_0x3ee4('0x52')));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0x53'),require(_0x3ee4('0x54')));_0x37ffba['use']('/api/openchannel/messages',require('./api/openchannelMessage'));_0x37ffba['use']('/api/openchannel/queues',require(_0x3ee4('0x55')));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0x56'),require(_0x3ee4('0x57')));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0x58'),require(_0x3ee4('0x59')));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0x5a'),require(_0x3ee4('0x5b')));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0x5c'),require(_0x3ee4('0x5d')));_0x37ffba['use'](_0x3ee4('0x5e'),require(_0x3ee4('0x5f')));_0x37ffba['use'](_0x3ee4('0x60'),require(_0x3ee4('0x61')));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0x62'),require(_0x3ee4('0x63')));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0x64'),require('./api/chatGroup'));_0x37ffba['use'](_0x3ee4('0x65'),require('./api/chatProactiveAction'));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0x66'),require(_0x3ee4('0x67')));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0x68'),require(_0x3ee4('0x69')));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0x6a'),require('./api/cmHopper'));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0x6b'),require('./api/cmHopperBlack'));_0x37ffba[_0x3ee4('0x7')]('/api/cm/hopper_final',require('./api/cmHopperFinal'));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0x6c'),require(_0x3ee4('0x6d')));_0x37ffba['use'](_0x3ee4('0x6e'),require(_0x3ee4('0x6f')));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0x70'),require(_0x3ee4('0x71')));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0x72'),require(_0x3ee4('0x73')));_0x37ffba[_0x3ee4('0x7')]('/api/canned_answers',require('./api/cannedAnswer'));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0x74'),require(_0x3ee4('0x75')));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0x76'),require(_0x3ee4('0x77')));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0x78'),require(_0x3ee4('0x79')));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0x7a'),require(_0x3ee4('0x7b')));_0x37ffba['use'](_0x3ee4('0x7c'),require('./api/cdr'));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0x7d'),require(_0x3ee4('0x7e')));_0x37ffba['use'](_0x3ee4('0x7f'),require(_0x3ee4('0x80')));_0x37ffba['use'](_0x3ee4('0x81'),require('./api/sound'));_0x37ffba[_0x3ee4('0x7')]('/api/tags',require('./api/tag'));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0x82'),require(_0x3ee4('0x83')));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0x84'),require(_0x3ee4('0x85')));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0x86'),require('./api/variable'));_0x37ffba['use'](_0x3ee4('0x87'),require(_0x3ee4('0x88')));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0x89'),require(_0x3ee4('0x8a')));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0x8b'),require(_0x3ee4('0x8c')));_0x37ffba[_0x3ee4('0x7')]('/api/analytics/default_reports',require(_0x3ee4('0x8d')));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0x8e'),require(_0x3ee4('0x8f')));_0x37ffba['use'](_0x3ee4('0x90'),require(_0x3ee4('0x91')));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0x92'),require(_0x3ee4('0x93')));_0x37ffba[_0x3ee4('0x7')]('/api/analytics/tree_reports',require('./api/analyticTreeReport'));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0x94'),require(_0x3ee4('0x95')));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0x96'),require(_0x3ee4('0x97')));_0x37ffba['use']('/api/integrations/salesforce/fields',require(_0x3ee4('0x98')));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0x99'),require(_0x3ee4('0x9a')));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0x9b'),require(_0x3ee4('0x9c')));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0x9d'),require(_0x3ee4('0x9e')));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0x9f'),require('./api/intDeskAccount'));_0x37ffba['use'](_0x3ee4('0xa0'),require(_0x3ee4('0xa1')));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0xa2'),require(_0x3ee4('0xa3')));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0xa4'),require(_0x3ee4('0xa5')));_0x37ffba[_0x3ee4('0x7')]('/api/integrations/zoho/configurations',require(_0x3ee4('0xa6')));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0xa7'),require(_0x3ee4('0xa8')));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0xa9'),require(_0x3ee4('0xaa')));_0x37ffba['use'](_0x3ee4('0xab'),require(_0x3ee4('0xac')));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0xad'),require(_0x3ee4('0xae')));_0x37ffba['use'](_0x3ee4('0xaf'),require('./api/intFreshdeskAccount'));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0xb0'),require(_0x3ee4('0xb1')));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0xb2'),require(_0x3ee4('0xb3')));_0x37ffba[_0x3ee4('0x7')]('/api/integrations/vtiger/accounts',require('./api/intVtigerAccount'));_0x37ffba['use'](_0x3ee4('0xb4'),require('./api/intVtigerConfiguration'));_0x37ffba['use'](_0x3ee4('0xb5'),require(_0x3ee4('0xb6')));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0xb7'),require(_0x3ee4('0xb8')));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0xb9'),require('./api/intServicenowConfiguration'));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0xba'),require('./api/intServicenowField'));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0xbb'),require(_0x3ee4('0xbc')));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0xbd'),require(_0x3ee4('0xbe')));_0x37ffba['use'](_0x3ee4('0xbf'),require(_0x3ee4('0xc0')));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0xc1'),require(_0x3ee4('0xc2')));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0xc3'),require(_0x3ee4('0xc4')));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0xc5'),require('./api/chatInternalMessage'));_0x37ffba['use'](_0x3ee4('0xc6'),require(_0x3ee4('0xc7')));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0xc8'),require(_0x3ee4('0xc9')));_0x37ffba['use'](_0x3ee4('0xca'),require(_0x3ee4('0xcb')));_0x37ffba['use']('/api/sms/reports/queue',require(_0x3ee4('0xcc')));_0x37ffba[_0x3ee4('0x7')]('/api/square/reports',require(_0x3ee4('0xcd')));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0xce'),require('./api/squareReportDetail'));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0xcf'),require(_0x3ee4('0xd0')));_0x37ffba[_0x3ee4('0x7')]('/api/settings',require(_0x3ee4('0xd1')));_0x37ffba['use'](_0x3ee4('0xd2'),require(_0x3ee4('0xd3')));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0xd4'),require(_0x3ee4('0xd5')));_0x37ffba[_0x3ee4('0x7')]('/api/square/recordings',require(_0x3ee4('0xd6')));_0x37ffba['use']('/api/square/messages',require(_0x3ee4('0xd7')));_0x37ffba['use'](_0x3ee4('0xd8'),require(_0x3ee4('0xd9')));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0xda'),require(_0x3ee4('0xdb')));_0x37ffba['use'](_0x3ee4('0xdc'),require('./api/campaign'));_0x37ffba[_0x3ee4('0x7')]('/api/migrations',require('./api/migration'));_0x37ffba['use']('/api/attachments',require(_0x3ee4('0xdd')));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0xde'),require(_0x3ee4('0xdf')));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0xe0'),require(_0x3ee4('0xe1')));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0xe2'),require(_0x3ee4('0xe3')));_0x37ffba[_0x3ee4('0x7')]('/api/fax/reports/transfer',require('./api/faxTransferReport'));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0xe4'),require(_0x3ee4('0xe5')));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0xe6'),require(_0x3ee4('0xe7')));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0xe8'),require('./api/cmList'));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0xe9'),require('./api/voicePrefix'));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0xea'),require(_0x3ee4('0xeb')));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0xec'),require(_0x3ee4('0xed')));_0x37ffba[_0x3ee4('0x7')]('/api/userProfile/resources',require(_0x3ee4('0xee')));_0x37ffba['use'](_0x3ee4('0xef'),require(_0x3ee4('0xf0')));_0x37ffba[_0x3ee4('0x7')]('/api/auth/google',require('./api/authGoogle'));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0xf1'),require('./api/jira'));_0x37ffba['use']('/api/rpc',require('./api/rpc'));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0xf2'),require('./api/version'));_0x37ffba['use'](_0x3ee4('0xf3'),require(_0x3ee4('0xf4')));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0xf5'),require(_0x3ee4('0xf6')));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0xf7'),express[_0x3ee4('0xf8')](path[_0x3ee4('0xf9')](config[_0x3ee4('0xfa')],_0x3ee4('0xf7'))));_0x37ffba['use'](_0x3ee4('0xfb'),express['static'](path['join'](config[_0x3ee4('0xfa')],'/www')));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0xfc'),express['static'](path[_0x3ee4('0xf9')](config['root'],_0x3ee4('0xfc'))));_0x37ffba['use'](_0x3ee4('0xfd'),express[_0x3ee4('0xf8')](path[_0x3ee4('0xf9')](config['root'],_0x3ee4('0xfe'),_0x3ee4('0xff'))));_0x37ffba[_0x3ee4('0x7')](_0x3ee4('0x100'),express[_0x3ee4('0xf8')](path[_0x3ee4('0xf9')](config[_0x3ee4('0xfa')],_0x3ee4('0x101'))));_0x37ffba[_0x3ee4('0x102')]('/:url(api|auth|components|app|bower_components|assets)/*')[_0x3ee4('0x103')](errors[0x194]);_0x37ffba[_0x3ee4('0x102')]('/*')[_0x3ee4('0x103')](function(_0x1a953a,_0xbe7c7b){_0xbe7c7b[_0x3ee4('0x104')](path['resolve'](_0x37ffba[_0x3ee4('0x103')](_0x3ee4('0x105'))+_0x3ee4('0x106')));});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index e92c9c8..f815616 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1820=['../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.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/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/pause/pause.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','server','port','rpc','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','RPC\x20listening\x20on\x20','jayson/promise','lodash','../config/environment','listen','merge','../api/user/user.rpc'];(function(_0x542843,_0x2558af){var _0x458933=function(_0x57320a){while(--_0x57320a){_0x542843['push'](_0x542843['shift']());}};_0x458933(++_0x2558af);}(_0x1820,0x18c));var _0x0182=function(_0x4ae625,_0xf396d0){_0x4ae625=_0x4ae625-0x0;var _0x31accf=_0x1820[_0x4ae625];return _0x31accf;};'use strict';var jayson=require(_0x0182('0x0'));var BPromise=require('bluebird');var _=require(_0x0182('0x1'));var config=require(_0x0182('0x2'));exports[_0x0182('0x3')]=function(){return new BPromise(function(_0x47d969,_0x4c0a4a){var _0x554bbf={};_0x554bbf=_[_0x0182('0x4')](_0x554bbf,require(_0x0182('0x5')));_0x554bbf=_[_0x0182('0x4')](_0x554bbf,require(_0x0182('0x6')));_0x554bbf=_[_0x0182('0x4')](_0x554bbf,require(_0x0182('0x7')));_0x554bbf=_['merge'](_0x554bbf,require(_0x0182('0x8')));_0x554bbf=_[_0x0182('0x4')](_0x554bbf,require(_0x0182('0x9')));_0x554bbf=_[_0x0182('0x4')](_0x554bbf,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x554bbf=_['merge'](_0x554bbf,require(_0x0182('0xa')));_0x554bbf=_[_0x0182('0x4')](_0x554bbf,require(_0x0182('0xb')));_0x554bbf=_[_0x0182('0x4')](_0x554bbf,require(_0x0182('0xc')));_0x554bbf=_[_0x0182('0x4')](_0x554bbf,require('../api/trunk/trunk.rpc'));_0x554bbf=_[_0x0182('0x4')](_0x554bbf,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x554bbf=_[_0x0182('0x4')](_0x554bbf,require(_0x0182('0xd')));_0x554bbf=_[_0x0182('0x4')](_0x554bbf,require(_0x0182('0xe')));_0x554bbf=_['merge'](_0x554bbf,require(_0x0182('0xf')));_0x554bbf=_[_0x0182('0x4')](_0x554bbf,require(_0x0182('0x10')));_0x554bbf=_[_0x0182('0x4')](_0x554bbf,require(_0x0182('0x11')));_0x554bbf=_[_0x0182('0x4')](_0x554bbf,require(_0x0182('0x12')));_0x554bbf=_[_0x0182('0x4')](_0x554bbf,require('../api/mailApplication/mailApplication.rpc'));_0x554bbf=_[_0x0182('0x4')](_0x554bbf,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x554bbf=_[_0x0182('0x4')](_0x554bbf,require(_0x0182('0x13')));_0x554bbf=_['merge'](_0x554bbf,require(_0x0182('0x14')));_0x554bbf=_['merge'](_0x554bbf,require('../api/faxInteraction/faxInteraction.rpc'));_0x554bbf=_[_0x0182('0x4')](_0x554bbf,require(_0x0182('0x15')));_0x554bbf=_[_0x0182('0x4')](_0x554bbf,require(_0x0182('0x16')));_0x554bbf=_[_0x0182('0x4')](_0x554bbf,require(_0x0182('0x17')));_0x554bbf=_[_0x0182('0x4')](_0x554bbf,require(_0x0182('0x18')));_0x554bbf=_[_0x0182('0x4')](_0x554bbf,require(_0x0182('0x19')));_0x554bbf=_[_0x0182('0x4')](_0x554bbf,require(_0x0182('0x1a')));_0x554bbf=_[_0x0182('0x4')](_0x554bbf,require(_0x0182('0x1b')));_0x554bbf=_[_0x0182('0x4')](_0x554bbf,require(_0x0182('0x1c')));_0x554bbf=_['merge'](_0x554bbf,require(_0x0182('0x1d')));_0x554bbf=_[_0x0182('0x4')](_0x554bbf,require(_0x0182('0x1e')));_0x554bbf=_[_0x0182('0x4')](_0x554bbf,require(_0x0182('0x1f')));_0x554bbf=_['merge'](_0x554bbf,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x554bbf=_[_0x0182('0x4')](_0x554bbf,require(_0x0182('0x20')));_0x554bbf=_[_0x0182('0x4')](_0x554bbf,require(_0x0182('0x21')));_0x554bbf=_[_0x0182('0x4')](_0x554bbf,require(_0x0182('0x22')));_0x554bbf=_[_0x0182('0x4')](_0x554bbf,require(_0x0182('0x23')));_0x554bbf=_['merge'](_0x554bbf,require(_0x0182('0x24')));_0x554bbf=_[_0x0182('0x4')](_0x554bbf,require(_0x0182('0x25')));_0x554bbf=_['merge'](_0x554bbf,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x554bbf=_[_0x0182('0x4')](_0x554bbf,require(_0x0182('0x26')));_0x554bbf=_[_0x0182('0x4')](_0x554bbf,require(_0x0182('0x27')));_0x554bbf=_['merge'](_0x554bbf,require('../api/interval/interval.rpc'));_0x554bbf=_[_0x0182('0x4')](_0x554bbf,require(_0x0182('0x28')));_0x554bbf=_[_0x0182('0x4')](_0x554bbf,require('../api/sound/sound.rpc'));_0x554bbf=_['merge'](_0x554bbf,require(_0x0182('0x29')));_0x554bbf=_['merge'](_0x554bbf,require(_0x0182('0x2a')));_0x554bbf=_[_0x0182('0x4')](_0x554bbf,require(_0x0182('0x2b')));_0x554bbf=_[_0x0182('0x4')](_0x554bbf,require(_0x0182('0x2c')));_0x554bbf=_[_0x0182('0x4')](_0x554bbf,require(_0x0182('0x2d')));_0x554bbf=_[_0x0182('0x4')](_0x554bbf,require(_0x0182('0x2e')));_0x554bbf=_[_0x0182('0x4')](_0x554bbf,require(_0x0182('0x2f')));_0x554bbf=_[_0x0182('0x4')](_0x554bbf,require(_0x0182('0x30')));_0x554bbf=_[_0x0182('0x4')](_0x554bbf,require(_0x0182('0x31')));_0x554bbf=_[_0x0182('0x4')](_0x554bbf,require(_0x0182('0x32')));_0x554bbf=_[_0x0182('0x4')](_0x554bbf,require(_0x0182('0x33')));_0x554bbf=_[_0x0182('0x4')](_0x554bbf,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x554bbf=_['merge'](_0x554bbf,require(_0x0182('0x34')));_0x554bbf=_[_0x0182('0x4')](_0x554bbf,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x554bbf=_['merge'](_0x554bbf,require(_0x0182('0x35')));_0x554bbf=_['merge'](_0x554bbf,require(_0x0182('0x36')));_0x554bbf=_[_0x0182('0x4')](_0x554bbf,require(_0x0182('0x37')));_0x554bbf=_[_0x0182('0x4')](_0x554bbf,require(_0x0182('0x38')));_0x554bbf=_['merge'](_0x554bbf,require('../api/squareRecording/squareRecording.rpc'));_0x554bbf=_[_0x0182('0x4')](_0x554bbf,require(_0x0182('0x39')));_0x554bbf=_[_0x0182('0x4')](_0x554bbf,require(_0x0182('0x3a')));_0x554bbf=_[_0x0182('0x4')](_0x554bbf,require('../api/attachment/attachment.rpc'));_0x554bbf=_[_0x0182('0x4')](_0x554bbf,require('../api/plugin/plugin.rpc'));var _0x1df8f7=jayson[_0x0182('0x3b')](_0x554bbf)['http']();var _0x56cca1=config['rpc'][_0x0182('0x3c')]||config[_0x0182('0x3c')]+0x1;var _0x1a79eb=config[_0x0182('0x3d')]['ip']||_0x0182('0x3e');_0x1df8f7['on'](_0x0182('0x3f'),function(_0x402a6e){return _0x4c0a4a(_0x402a6e);});_0x1df8f7[_0x0182('0x3')](_0x56cca1,_0x1a79eb,function(){console[_0x0182('0x40')](_0x0182('0x41'),_0x1a79eb,_0x56cca1);require('../config/triggers')['default']();return _0x47d969(_0x0182('0x42')+_0x1a79eb+':'+_0x56cca1);});});}; \ No newline at end of file +var _0x443c=['../api/interval/interval.rpc','../api/sound/sound.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/intDynamics365Account/intDynamics365Account.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.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/attachment/attachment.rpc','../api/plugin/plugin.rpc','server','rpc','port','localhost','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','lodash','../config/environment','listen','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.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/faxAccount/faxAccount.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/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/reportAgentPreview/reportAgentPreview.rpc'];(function(_0x5024e1,_0x2a8d6c){var _0x394a3a=function(_0x3306cf){while(--_0x3306cf){_0x5024e1['push'](_0x5024e1['shift']());}};_0x394a3a(++_0x2a8d6c);}(_0x443c,0xe0));var _0xc443=function(_0x12723c,_0x148a5a){_0x12723c=_0x12723c-0x0;var _0x3fc804=_0x443c[_0x12723c];return _0x3fc804;};'use strict';var jayson=require(_0xc443('0x0'));var BPromise=require('bluebird');var _=require(_0xc443('0x1'));var config=require(_0xc443('0x2'));exports[_0xc443('0x3')]=function(){return new BPromise(function(_0x3fcd33,_0x13a514){var _0x2f841f={};_0x2f841f=_[_0xc443('0x4')](_0x2f841f,require('../api/user/user.rpc'));_0x2f841f=_[_0xc443('0x4')](_0x2f841f,require(_0xc443('0x5')));_0x2f841f=_[_0xc443('0x4')](_0x2f841f,require(_0xc443('0x6')));_0x2f841f=_[_0xc443('0x4')](_0x2f841f,require(_0xc443('0x7')));_0x2f841f=_[_0xc443('0x4')](_0x2f841f,require(_0xc443('0x8')));_0x2f841f=_[_0xc443('0x4')](_0x2f841f,require(_0xc443('0x9')));_0x2f841f=_['merge'](_0x2f841f,require(_0xc443('0xa')));_0x2f841f=_[_0xc443('0x4')](_0x2f841f,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x2f841f=_['merge'](_0x2f841f,require('../api/memberReport/memberReport.rpc'));_0x2f841f=_[_0xc443('0x4')](_0x2f841f,require(_0xc443('0xb')));_0x2f841f=_[_0xc443('0x4')](_0x2f841f,require(_0xc443('0xc')));_0x2f841f=_[_0xc443('0x4')](_0x2f841f,require(_0xc443('0xd')));_0x2f841f=_[_0xc443('0x4')](_0x2f841f,require(_0xc443('0xe')));_0x2f841f=_[_0xc443('0x4')](_0x2f841f,require(_0xc443('0xf')));_0x2f841f=_['merge'](_0x2f841f,require(_0xc443('0x10')));_0x2f841f=_[_0xc443('0x4')](_0x2f841f,require(_0xc443('0x11')));_0x2f841f=_[_0xc443('0x4')](_0x2f841f,require('../api/mailMessage/mailMessage.rpc'));_0x2f841f=_[_0xc443('0x4')](_0x2f841f,require('../api/mailApplication/mailApplication.rpc'));_0x2f841f=_[_0xc443('0x4')](_0x2f841f,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x2f841f=_[_0xc443('0x4')](_0x2f841f,require(_0xc443('0x12')));_0x2f841f=_[_0xc443('0x4')](_0x2f841f,require(_0xc443('0x13')));_0x2f841f=_[_0xc443('0x4')](_0x2f841f,require(_0xc443('0x14')));_0x2f841f=_[_0xc443('0x4')](_0x2f841f,require('../api/faxMessage/faxMessage.rpc'));_0x2f841f=_[_0xc443('0x4')](_0x2f841f,require(_0xc443('0x15')));_0x2f841f=_[_0xc443('0x4')](_0x2f841f,require(_0xc443('0x16')));_0x2f841f=_[_0xc443('0x4')](_0x2f841f,require(_0xc443('0x17')));_0x2f841f=_['merge'](_0x2f841f,require(_0xc443('0x18')));_0x2f841f=_[_0xc443('0x4')](_0x2f841f,require(_0xc443('0x19')));_0x2f841f=_[_0xc443('0x4')](_0x2f841f,require(_0xc443('0x1a')));_0x2f841f=_[_0xc443('0x4')](_0x2f841f,require(_0xc443('0x1b')));_0x2f841f=_['merge'](_0x2f841f,require(_0xc443('0x1c')));_0x2f841f=_['merge'](_0x2f841f,require(_0xc443('0x1d')));_0x2f841f=_[_0xc443('0x4')](_0x2f841f,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x2f841f=_['merge'](_0x2f841f,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x2f841f=_[_0xc443('0x4')](_0x2f841f,require(_0xc443('0x1e')));_0x2f841f=_['merge'](_0x2f841f,require(_0xc443('0x1f')));_0x2f841f=_[_0xc443('0x4')](_0x2f841f,require(_0xc443('0x20')));_0x2f841f=_['merge'](_0x2f841f,require('../api/cmContact/cmContact.rpc'));_0x2f841f=_[_0xc443('0x4')](_0x2f841f,require(_0xc443('0x21')));_0x2f841f=_['merge'](_0x2f841f,require(_0xc443('0x22')));_0x2f841f=_[_0xc443('0x4')](_0x2f841f,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x2f841f=_[_0xc443('0x4')](_0x2f841f,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x2f841f=_[_0xc443('0x4')](_0x2f841f,require(_0xc443('0x23')));_0x2f841f=_[_0xc443('0x4')](_0x2f841f,require(_0xc443('0x24')));_0x2f841f=_['merge'](_0x2f841f,require('../api/pause/pause.rpc'));_0x2f841f=_[_0xc443('0x4')](_0x2f841f,require(_0xc443('0x25')));_0x2f841f=_[_0xc443('0x4')](_0x2f841f,require('../api/template/template.rpc'));_0x2f841f=_[_0xc443('0x4')](_0x2f841f,require(_0xc443('0x26')));_0x2f841f=_[_0xc443('0x4')](_0x2f841f,require(_0xc443('0x27')));_0x2f841f=_['merge'](_0x2f841f,require(_0xc443('0x28')));_0x2f841f=_[_0xc443('0x4')](_0x2f841f,require(_0xc443('0x29')));_0x2f841f=_['merge'](_0x2f841f,require(_0xc443('0x2a')));_0x2f841f=_[_0xc443('0x4')](_0x2f841f,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x2f841f=_[_0xc443('0x4')](_0x2f841f,require(_0xc443('0x2b')));_0x2f841f=_['merge'](_0x2f841f,require(_0xc443('0x2c')));_0x2f841f=_[_0xc443('0x4')](_0x2f841f,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x2f841f=_[_0xc443('0x4')](_0x2f841f,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x2f841f=_[_0xc443('0x4')](_0x2f841f,require(_0xc443('0x2d')));_0x2f841f=_[_0xc443('0x4')](_0x2f841f,require(_0xc443('0x2e')));_0x2f841f=_['merge'](_0x2f841f,require(_0xc443('0x2f')));_0x2f841f=_[_0xc443('0x4')](_0x2f841f,require(_0xc443('0x30')));_0x2f841f=_[_0xc443('0x4')](_0x2f841f,require(_0xc443('0x31')));_0x2f841f=_['merge'](_0x2f841f,require(_0xc443('0x32')));_0x2f841f=_['merge'](_0x2f841f,require(_0xc443('0x33')));_0x2f841f=_[_0xc443('0x4')](_0x2f841f,require(_0xc443('0x34')));_0x2f841f=_[_0xc443('0x4')](_0x2f841f,require(_0xc443('0x35')));_0x2f841f=_[_0xc443('0x4')](_0x2f841f,require('../api/campaign/campaign.rpc'));_0x2f841f=_[_0xc443('0x4')](_0x2f841f,require(_0xc443('0x36')));_0x2f841f=_[_0xc443('0x4')](_0x2f841f,require(_0xc443('0x37')));var _0x5d4817=jayson[_0xc443('0x38')](_0x2f841f)['http']();var _0x2b1cfc=config[_0xc443('0x39')][_0xc443('0x3a')]||config['port']+0x1;var _0x3d343f=config[_0xc443('0x39')]['ip']||_0xc443('0x3b');_0x5d4817['on']('error',function(_0x36dcc4){return _0x13a514(_0x36dcc4);});_0x5d4817[_0xc443('0x3')](_0x2b1cfc,_0x3d343f,function(){console[_0xc443('0x3c')](_0xc443('0x3d'),_0x3d343f,_0x2b1cfc);require(_0xc443('0x3e'))[_0xc443('0x3f')]();return _0x3fcd33(_0xc443('0x40')+_0x3d343f+':'+_0x2b1cfc);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 6a5f506..106a180 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 _0x9c13=['setEncoding','utf8','setTimeout','headers','emit','ready','line','toLowerCase','hangup','substring','search','result=','indexOf','substr','startsWith','split','length','match','error','code','close','E_AGI_SOCKET_CLOSE','timeout','pipe','command','function','write','destroy','sendRequest','sync','prototype','ANSWER','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','EXEC\x20%s\x20%s','join','setContext','setExtension','SET\x20EXTENSION\x20%s','setPriority','setVariable','SET\x20VARIABLE\x20%s\x20\x22%s\x22','toString','replace','sayNumber','sayDigits','SAY\x20DIGITS\x20%s\x20%s','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','GOTO\x20%s\x20%s\x20%s','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','agi','wait','WAIT','noop','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','events','./reply'];(function(_0x137a17,_0x1c17f9){var _0x5a2d0c=function(_0xa31f74){while(--_0xa31f74){_0x137a17['push'](_0x137a17['shift']());}};_0x5a2d0c(++_0x1c17f9);}(_0x9c13,0xd4));var _0x39c1=function(_0x2f3d29,_0x150e7b){_0x2f3d29=_0x2f3d29-0x0;var _0x53d69d=_0x9c13[_0x2f3d29];return _0x53d69d;};'use strict';var util=require(_0x39c1('0x0'));var _=require(_0x39c1('0x1'));var EventEmitter=require(_0x39c1('0x2'))['EventEmitter'];var AGIReply=require(_0x39c1('0x3'));var AGIError=require('./error');function AGIChannel(_0x1d0eb1){var _0x1cda64=this,_0x5c0d7e=new AGIReply(),_0x3790cf=![],_0x383755={};EventEmitter['call'](_0x1cda64);_0x1d0eb1[_0x39c1('0x4')](_0x39c1('0x5'));_0x1d0eb1[_0x39c1('0x6')](0x8*0x3c*0x3c*0x3e8);_0x5c0d7e[_0x39c1('0x4')](_0x39c1('0x5'));_0x5c0d7e['on'](_0x39c1('0x7'),function(_0x5048d9){for(var _0x4355c7 in _0x5048d9){_0x1cda64[_0x4355c7]=_0x5048d9[_0x4355c7];}_0x1cda64[_0x39c1('0x8')](_0x39c1('0x9'));});_0x5c0d7e['on'](_0x39c1('0xa'),function(_0x1ea7e6){if(_0x1ea7e6[_0x39c1('0xb')]()==_0x39c1('0xc')){_0x1cda64[_0x39c1('0x8')](_0x39c1('0xc'));return;}if(_0x1ea7e6[_0x39c1('0xd')](0x0,0xb)=='520-Invalid'){_0x3790cf=!![];}if(_0x3790cf){_0x383755['rx']+=_0x1ea7e6+'\x0a';if(_0x1ea7e6[_0x39c1('0xe')]('520\x20End\x20of\x20proper')!=-0x1){_0x3790cf=![];}}else{_0x383755['rx']=_0x1ea7e6;}if(_0x3790cf){return;}if(typeof _0x383755['cb']=='function'){var _0x4688d9=_0x383755['rx'][_0x39c1('0xd')](0x0,0x3),_0x423386=null,_0x5ea532=null;_0x4688d9=parseInt(_0x4688d9);if(isNaN(_0x4688d9)){_0x383755['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x4688d9!=0xc8){_0x383755['cb'](null,{'code':_0x4688d9,'result':-0x1,'extra':'KO'});return;}_0x423386=_0x383755['rx'][_0x39c1('0xd')](0x4)['replace'](_0x39c1('0xf'),'');if(_0x423386[_0x39c1('0x10')]('\x20')!=-0x1){_0x423386=_0x423386[_0x39c1('0x11')](0x0,_0x423386['indexOf']('\x20'));}if(_[_0x39c1('0x12')](_0x423386,'-1')){_0x423386=parseInt(_0x423386);}_0x5ea532=_0x383755['rx'][_0x39c1('0x13')]('\x20');if(_0x5ea532[_0x39c1('0x14')]==0x3){_0x5ea532=_0x5ea532[0x2][_0x39c1('0xd')](0x1,_0x5ea532[0x2][_0x39c1('0x14')]-0x1);}else if(_0x5ea532[_0x39c1('0x14')]>0x3){var _0x1471cd=/\((.+)\)/;var _0x11b1c6=_0x383755['rx'][_0x39c1('0x15')](_0x1471cd);if(_0x11b1c6){_0x5ea532=_0x11b1c6[0x1];}else{_0x5ea532=null;}}else{_0x5ea532=null;}_0x383755['cb'](null,{'code':_0x4688d9,'result':_0x423386,'extra':_0x5ea532});}});_0x1d0eb1['on'](_0x39c1('0x16'),function(_0x554295){_0x1cda64[_0x39c1('0x8')](_0x39c1('0x16'),new AGIError('E_AGI_SOCKET_ERROR',_0x554295[_0x39c1('0x17')]));});_0x1d0eb1['on'](_0x39c1('0x18'),function(){_0x1cda64['emit'](_0x39c1('0x18'),new AGIError(_0x39c1('0x19')));});_0x1d0eb1['on'](_0x39c1('0x1a'),function(){_0x1cda64['emit'](_0x39c1('0x1a'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x1d0eb1['destroy']();});_0x1d0eb1[_0x39c1('0x1b')](_0x5c0d7e);this[_0x39c1('0x1c')]=function(_0x76547c,_0x3e022b){var _0x76547c=_0x76547c||'',_0x3e022b=typeof _0x3e022b==_0x39c1('0x1d')?_0x3e022b:new Function();_0x383755={'tx':_0x76547c,'rx':'','cb':_0x3e022b};_0x1d0eb1[_0x39c1('0x1e')](_0x76547c+'\x0a');},this['close']=function(){_0x1d0eb1[_0x39c1('0x1f')]();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel['prototype'][_0x39c1('0x20')]=function(_0x2d2878){return this[_0x39c1('0x1c')][_0x39c1('0x21')](this,_0x2d2878);};AGIChannel[_0x39c1('0x22')]['answer']=function(){return this['sendRequest'](_0x39c1('0x23'));};AGIChannel['prototype'][_0x39c1('0x24')]=function(_0x37c746,_0x2564da,_0x47c33e){_0x37c746=_0x37c746===undefined?_0x39c1('0x25'):_0x37c746;_0x2564da=_0x2564da===undefined?'5':_0x2564da;_0x47c33e=_0x47c33e===undefined?'1':_0x47c33e;return this['sendRequest'](util[_0x39c1('0x26')](_0x39c1('0x27'),_0x37c746,_0x2564da*0x3e8,_0x47c33e));};AGIChannel[_0x39c1('0x22')]['noop']=function(_0xa1b20f){_0xa1b20f=_0xa1b20f||_0x39c1('0x28');return this[_0x39c1('0x20')](util[_0x39c1('0x26')](_0x39c1('0x29'),_0xa1b20f));};AGIChannel[_0x39c1('0x22')][_0x39c1('0x2a')]=function(_0x92b5b0,_0x13cd0f){if(_['isArray'](_0x13cd0f)){return this[_0x39c1('0x20')](util[_0x39c1('0x26')](_0x39c1('0x2b'),_0x92b5b0,_0x13cd0f[_0x39c1('0x2c')](',')));}return this[_0x39c1('0x20')](util[_0x39c1('0x26')]('EXEC\x20%s\x20%s',_0x92b5b0,_0x13cd0f));};AGIChannel[_0x39c1('0x22')][_0x39c1('0x2d')]=function(_0xa2ebb1){return this[_0x39c1('0x20')](util[_0x39c1('0x26')]('SET\x20CONTEXT\x20%s',_0xa2ebb1));};AGIChannel[_0x39c1('0x22')][_0x39c1('0x2e')]=function(_0x35897b){return this['sendRequest'](util[_0x39c1('0x26')](_0x39c1('0x2f'),_0x35897b));};AGIChannel[_0x39c1('0x22')][_0x39c1('0x30')]=function(_0x41d1b0){return this[_0x39c1('0x20')](util['format']('SET\x20PRIORITY\x20%s',_0x41d1b0));};AGIChannel[_0x39c1('0x22')][_0x39c1('0xc')]=function(){return this[_0x39c1('0x20')]('HANGUP');};AGIChannel[_0x39c1('0x22')][_0x39c1('0x31')]=function(_0xdef166,_0x4fdf3a){return this['sendRequest'](util[_0x39c1('0x26')](_0x39c1('0x32'),_0xdef166,_0x4fdf3a?_0x4fdf3a[_0x39c1('0x33')]()[_0x39c1('0x34')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x39c1('0x22')][_0x39c1('0x35')]=function(_0x39f3d1,_0x39226a){return this[_0x39c1('0x20')](util[_0x39c1('0x26')]('SAY\x20NUMBER\x20%s\x20%s',_0x39f3d1,_0x39226a));};AGIChannel[_0x39c1('0x22')][_0x39c1('0x36')]=function(_0x2093c2,_0x43005c){return this[_0x39c1('0x20')](util[_0x39c1('0x26')](_0x39c1('0x37'),_0x2093c2,_0x43005c));};AGIChannel['prototype']['sayPhonetic']=function(_0x134b22,_0x27fabf){return this[_0x39c1('0x20')](util['format'](_0x39c1('0x38'),_0x134b22,_0x27fabf));};AGIChannel[_0x39c1('0x22')][_0x39c1('0x39')]=function(_0x38e6df,_0x1df403,_0x3a022a){_0x1df403=_0x1df403||this['extension'];_0x3a022a=_0x3a022a||0x1;this[_0x39c1('0x2d')](_0x38e6df);this[_0x39c1('0x2e')](_0x1df403);this[_0x39c1('0x30')](_0x3a022a);return this['noop'](util[_0x39c1('0x26')](_0x39c1('0x3a'),_0x38e6df,_0x1df403,_0x3a022a));};AGIChannel['prototype']['getVariable']=function(_0x1551ee){return this['sendRequest'](util[_0x39c1('0x26')](_0x39c1('0x3b'),_0x1551ee));};AGIChannel[_0x39c1('0x22')][_0x39c1('0x3c')]=function(_0x117616,_0x113672,_0x348d8f,_0x4e2a1a,_0x1d5e6e,_0x4ab840){_0x113672=_0x113672||_0x39c1('0x3d');_0x348d8f=_0x348d8f||'';_0x4e2a1a=_0x4e2a1a===undefined?-0x1:_0x4e2a1a==='-1'?-0x1:_0x4e2a1a*0x3e8;_0x1d5e6e=_0x1d5e6e===undefined?'':'s='+_0x1d5e6e;_0x4ab840=_0x4ab840?_0x39c1('0x3e'):'';return this[_0x39c1('0x20')](util[_0x39c1('0x26')](_0x39c1('0x3f'),_0x117616,_0x113672,_0x348d8f,_0x4e2a1a,_0x4ab840,_0x1d5e6e));};AGIChannel[_0x39c1('0x22')][_0x39c1('0x40')]=function(_0x1f9cb9,_0x274f10){_0x274f10=_0x274f10||'';return this[_0x39c1('0x20')](util['format']('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x1f9cb9,_0x274f10));};AGIChannel[_0x39c1('0x22')][_0x39c1('0x41')]=function(_0x32ff20){return this[_0x39c1('0x2a')]('AGI',_0x32ff20);};AGIChannel[_0x39c1('0x22')][_0x39c1('0x42')]=function(_0x1a2fe8){return this[_0x39c1('0x2a')](_0x39c1('0x43'),_0x1a2fe8);};AGIChannel['prototype'][_0x39c1('0x16')]=function(_0x427020,_0x32e735){this[_0x39c1('0x44')](util[_0x39c1('0x26')](_0x39c1('0x45'),_0x427020['id'],_0x427020[_0x39c1('0x46')],_0x32e735));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x39c1('0x47')]=AGIChannel; \ No newline at end of file +var _0xc9e3=['emit','line','substring','520-Invalid','search','520\x20End\x20of\x20proper','no\x20code','replace','indexOf','substr','startsWith','split','length','match','error','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','pipe','command','function','write','destroy','prototype','sendRequest','sync','beep','exec','isArray','format','EXEC\x20%s\x20%s','join','setExtension','SET\x20EXTENSION\x20%s','setPriority','hangup','setVariable','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','continueAt','extension','setContext','noop','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','util','lodash','events','EventEmitter','./reply','./error','call','setEncoding','utf8','setTimeout','headers'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xc9e3,0x10d));var _0x3c9e=function(_0x4bd999,_0x29106e){_0x4bd999=_0x4bd999-0x0;var _0x3d7060=_0xc9e3[_0x4bd999];return _0x3d7060;};'use strict';var util=require(_0x3c9e('0x0'));var _=require(_0x3c9e('0x1'));var EventEmitter=require(_0x3c9e('0x2'))[_0x3c9e('0x3')];var AGIReply=require(_0x3c9e('0x4'));var AGIError=require(_0x3c9e('0x5'));function AGIChannel(_0x5ce617){var _0x3046be=this,_0x2fa54a=new AGIReply(),_0x272024=![],_0x2a5b96={};EventEmitter[_0x3c9e('0x6')](_0x3046be);_0x5ce617[_0x3c9e('0x7')](_0x3c9e('0x8'));_0x5ce617[_0x3c9e('0x9')](0x8*0x3c*0x3c*0x3e8);_0x2fa54a['setEncoding'](_0x3c9e('0x8'));_0x2fa54a['on'](_0x3c9e('0xa'),function(_0x4374f7){for(var _0x54cac2 in _0x4374f7){_0x3046be[_0x54cac2]=_0x4374f7[_0x54cac2];}_0x3046be[_0x3c9e('0xb')]('ready');});_0x2fa54a['on'](_0x3c9e('0xc'),function(_0x5b187d){if(_0x5b187d['toLowerCase']()=='hangup'){_0x3046be[_0x3c9e('0xb')]('hangup');return;}if(_0x5b187d[_0x3c9e('0xd')](0x0,0xb)==_0x3c9e('0xe')){_0x272024=!![];}if(_0x272024){_0x2a5b96['rx']+=_0x5b187d+'\x0a';if(_0x5b187d[_0x3c9e('0xf')](_0x3c9e('0x10'))!=-0x1){_0x272024=![];}}else{_0x2a5b96['rx']=_0x5b187d;}if(_0x272024){return;}if(typeof _0x2a5b96['cb']=='function'){var _0x513ade=_0x2a5b96['rx']['substring'](0x0,0x3),_0x40d972=null,_0x551128=null;_0x513ade=parseInt(_0x513ade);if(isNaN(_0x513ade)){_0x2a5b96['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x3c9e('0x11')});return;}if(_0x513ade!=0xc8){_0x2a5b96['cb'](null,{'code':_0x513ade,'result':-0x1,'extra':'KO'});return;}_0x40d972=_0x2a5b96['rx'][_0x3c9e('0xd')](0x4)[_0x3c9e('0x12')]('result=','');if(_0x40d972[_0x3c9e('0x13')]('\x20')!=-0x1){_0x40d972=_0x40d972[_0x3c9e('0x14')](0x0,_0x40d972[_0x3c9e('0x13')]('\x20'));}if(_[_0x3c9e('0x15')](_0x40d972,'-1')){_0x40d972=parseInt(_0x40d972);}_0x551128=_0x2a5b96['rx'][_0x3c9e('0x16')]('\x20');if(_0x551128[_0x3c9e('0x17')]==0x3){_0x551128=_0x551128[0x2][_0x3c9e('0xd')](0x1,_0x551128[0x2][_0x3c9e('0x17')]-0x1);}else if(_0x551128[_0x3c9e('0x17')]>0x3){var _0x2bd56b=/\((.+)\)/;var _0x3975b5=_0x2a5b96['rx'][_0x3c9e('0x18')](_0x2bd56b);if(_0x3975b5){_0x551128=_0x3975b5[0x1];}else{_0x551128=null;}}else{_0x551128=null;}_0x2a5b96['cb'](null,{'code':_0x513ade,'result':_0x40d972,'extra':_0x551128});}});_0x5ce617['on'](_0x3c9e('0x19'),function(_0x768dad){_0x3046be[_0x3c9e('0xb')](_0x3c9e('0x19'),new AGIError('E_AGI_SOCKET_ERROR',_0x768dad['code']));});_0x5ce617['on'](_0x3c9e('0x1a'),function(){_0x3046be[_0x3c9e('0xb')](_0x3c9e('0x1a'),new AGIError(_0x3c9e('0x1b')));});_0x5ce617['on'](_0x3c9e('0x1c'),function(){_0x3046be[_0x3c9e('0xb')](_0x3c9e('0x1c'),new AGIError(_0x3c9e('0x1d')));_0x5ce617['destroy']();});_0x5ce617[_0x3c9e('0x1e')](_0x2fa54a);this[_0x3c9e('0x1f')]=function(_0x362252,_0x592287){var _0x362252=_0x362252||'',_0x592287=typeof _0x592287==_0x3c9e('0x20')?_0x592287:new Function();_0x2a5b96={'tx':_0x362252,'rx':'','cb':_0x592287};_0x5ce617[_0x3c9e('0x21')](_0x362252+'\x0a');},this[_0x3c9e('0x1a')]=function(){_0x5ce617[_0x3c9e('0x22')]();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0x3c9e('0x23')][_0x3c9e('0x24')]=function(_0x585b14){return this[_0x3c9e('0x1f')][_0x3c9e('0x25')](this,_0x585b14);};AGIChannel['prototype']['answer']=function(){return this[_0x3c9e('0x24')]('ANSWER');};AGIChannel[_0x3c9e('0x23')]['getData']=function(_0x514348,_0x267aec,_0x46245b){_0x514348=_0x514348===undefined?_0x3c9e('0x26'):_0x514348;_0x267aec=_0x267aec===undefined?'5':_0x267aec;_0x46245b=_0x46245b===undefined?'1':_0x46245b;return this[_0x3c9e('0x24')](util['format']('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x514348,_0x267aec*0x3e8,_0x46245b));};AGIChannel['prototype']['noop']=function(_0xac615e){_0xac615e=_0xac615e||'NO\x20MESSAGE';return this[_0x3c9e('0x24')](util['format']('VERBOSE\x20\x22%s\x22',_0xac615e));};AGIChannel[_0x3c9e('0x23')][_0x3c9e('0x27')]=function(_0x3a5090,_0xf7349e){if(_[_0x3c9e('0x28')](_0xf7349e)){return this[_0x3c9e('0x24')](util[_0x3c9e('0x29')](_0x3c9e('0x2a'),_0x3a5090,_0xf7349e[_0x3c9e('0x2b')](',')));}return this[_0x3c9e('0x24')](util[_0x3c9e('0x29')]('EXEC\x20%s\x20%s',_0x3a5090,_0xf7349e));};AGIChannel[_0x3c9e('0x23')]['setContext']=function(_0x5741a0){return this[_0x3c9e('0x24')](util[_0x3c9e('0x29')]('SET\x20CONTEXT\x20%s',_0x5741a0));};AGIChannel['prototype'][_0x3c9e('0x2c')]=function(_0x3e369d){return this[_0x3c9e('0x24')](util['format'](_0x3c9e('0x2d'),_0x3e369d));};AGIChannel[_0x3c9e('0x23')][_0x3c9e('0x2e')]=function(_0x400d9c){return this['sendRequest'](util['format']('SET\x20PRIORITY\x20%s',_0x400d9c));};AGIChannel[_0x3c9e('0x23')][_0x3c9e('0x2f')]=function(){return this[_0x3c9e('0x24')]('HANGUP');};AGIChannel[_0x3c9e('0x23')][_0x3c9e('0x30')]=function(_0x664c6d,_0x562ef3){return this[_0x3c9e('0x24')](util[_0x3c9e('0x29')](_0x3c9e('0x31'),_0x664c6d,_0x562ef3?_0x562ef3['toString']()[_0x3c9e('0x12')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x3c9e('0x23')][_0x3c9e('0x32')]=function(_0x1d9f76,_0x126090){return this[_0x3c9e('0x24')](util['format'](_0x3c9e('0x33'),_0x1d9f76,_0x126090));};AGIChannel[_0x3c9e('0x23')]['sayDigits']=function(_0x35656f,_0x40f8b4){return this[_0x3c9e('0x24')](util[_0x3c9e('0x29')](_0x3c9e('0x34'),_0x35656f,_0x40f8b4));};AGIChannel[_0x3c9e('0x23')][_0x3c9e('0x35')]=function(_0x2c349f,_0x347ba0){return this[_0x3c9e('0x24')](util[_0x3c9e('0x29')]('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x2c349f,_0x347ba0));};AGIChannel[_0x3c9e('0x23')][_0x3c9e('0x36')]=function(_0x3dddd0,_0x12d803,_0x31f196){_0x12d803=_0x12d803||this[_0x3c9e('0x37')];_0x31f196=_0x31f196||0x1;this[_0x3c9e('0x38')](_0x3dddd0);this['setExtension'](_0x12d803);this['setPriority'](_0x31f196);return this[_0x3c9e('0x39')](util[_0x3c9e('0x29')]('GOTO\x20%s\x20%s\x20%s',_0x3dddd0,_0x12d803,_0x31f196));};AGIChannel['prototype'][_0x3c9e('0x3a')]=function(_0x2918fa){return this[_0x3c9e('0x24')](util[_0x3c9e('0x29')](_0x3c9e('0x3b'),_0x2918fa));};AGIChannel['prototype'][_0x3c9e('0x3c')]=function(_0xfc2694,_0x8d3cdd,_0x1617f4,_0x252b86,_0x4be346,_0x549c4f){_0x8d3cdd=_0x8d3cdd||_0x3c9e('0x3d');_0x1617f4=_0x1617f4||'';_0x252b86=_0x252b86===undefined?-0x1:_0x252b86==='-1'?-0x1:_0x252b86*0x3e8;_0x4be346=_0x4be346===undefined?'':'s='+_0x4be346;_0x549c4f=_0x549c4f?'BEEP':'';return this[_0x3c9e('0x24')](util['format']('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0xfc2694,_0x8d3cdd,_0x1617f4,_0x252b86,_0x549c4f,_0x4be346));};AGIChannel[_0x3c9e('0x23')][_0x3c9e('0x3e')]=function(_0x3b9414,_0x5db525){_0x5db525=_0x5db525||'';return this[_0x3c9e('0x24')](util[_0x3c9e('0x29')](_0x3c9e('0x3f'),_0x3b9414,_0x5db525));};AGIChannel[_0x3c9e('0x23')][_0x3c9e('0x40')]=function(_0x14afd0){return this[_0x3c9e('0x27')](_0x3c9e('0x41'),_0x14afd0);};AGIChannel[_0x3c9e('0x23')][_0x3c9e('0x42')]=function(_0x2298a7){return this[_0x3c9e('0x27')](_0x3c9e('0x43'),_0x2298a7);};AGIChannel[_0x3c9e('0x23')][_0x3c9e('0x19')]=function(_0x2bbeb8,_0x3c6112){this[_0x3c9e('0x39')](util[_0x3c9e('0x29')](_0x3c9e('0x44'),_0x2bbeb8['id'],_0x2bbeb8[_0x3c9e('0x45')],_0x3c6112));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 75045d2..fdd5c09 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 _0x43e7=['format','name','util','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20closed.','Socket\x20timeout.','Missing\x20\x27ivr.entry\x27\x20menu.','push'];(function(_0x27be55,_0x1164d0){var _0xae876a=function(_0x2114a3){while(--_0x2114a3){_0x27be55['push'](_0x27be55['shift']());}};_0xae876a(++_0x1164d0);}(_0x43e7,0xda));var _0x743e=function(_0x377a6e,_0x59b99d){_0x377a6e=_0x377a6e-0x0;var _0x37f751=_0x43e7[_0x377a6e];return _0x37f751;};'use strict';var util=require(_0x743e('0x0'));var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':_0x743e('0x1'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0x743e('0x2'),'E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':_0x743e('0x3'),'E_AGI_SOCKET_TIMEOUT':_0x743e('0x4'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0x743e('0x5')};function AGIError(_0x54a27d){var _0x54a27d=_0x54a27d||null,_0x4a5957=_0x4a5957||[],_0x577c24=0x1,_0x4fb48e='';if(!error[_0x54a27d]){_0x54a27d='E_AGI_UNDEFINED';}_0x4a5957[_0x743e('0x6')](error[_0x54a27d]);while(arguments[_0x577c24]){_0x4a5957[_0x743e('0x6')](arguments[_0x577c24]);_0x577c24++;}_0x4fb48e=util[_0x743e('0x7')]['apply'](util,_0x4a5957);this['message']=_0x4fb48e;this[_0x743e('0x8')]=_0x54a27d;}module['exports']=AGIError; \ No newline at end of file +var _0xc688=['[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20timeout.','Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_UNDEFINED','push','format','message','name','exports','util','Undefined\x20error.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.'];(function(_0x57a1fb,_0xc3f0c9){var _0x468b8a=function(_0x5e0a2a){while(--_0x5e0a2a){_0x57a1fb['push'](_0x57a1fb['shift']());}};_0x468b8a(++_0xc3f0c9);}(_0xc688,0xc0));var _0x8c68=function(_0x1ec4bd,_0x44744b){_0x1ec4bd=_0x1ec4bd-0x0;var _0x1f2610=_0xc688[_0x1ec4bd];return _0x1f2610;};'use strict';var util=require(_0x8c68('0x0'));var error={'E_AGI_UNDEFINED':_0x8c68('0x1'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0x8c68('0x2'),'E_AGI_SERVER_CLOSE':_0x8c68('0x3'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0x8c68('0x4'),'E_AGI_SOCKET_ERROR':_0x8c68('0x5'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0x8c68('0x6'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x8c68('0x7'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x488bd4){var _0x488bd4=_0x488bd4||null,_0x17f5a3=_0x17f5a3||[],_0x5e62be=0x1,_0x496f4f='';if(!error[_0x488bd4]){_0x488bd4=_0x8c68('0x8');}_0x17f5a3[_0x8c68('0x9')](error[_0x488bd4]);while(arguments[_0x5e62be]){_0x17f5a3['push'](arguments[_0x5e62be]);_0x5e62be++;}_0x496f4f=util[_0x8c68('0xa')]['apply'](util,_0x17f5a3);this[_0x8c68('0xb')]=_0x496f4f;this[_0x8c68('0xc')]=_0x488bd4;}module[_0x8c68('0xd')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 4ec95a6..a68ff84 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 _0x1c9a=['default','agicommand','menu','invalid','traverseBFS','default\x20on\x20switch\x20not\x20found','condition\x20not\x20found','lodash','agi','getdigits','getsecretdigits','vertices','numberOfEdges','prototype','addVertex','edges','addEdge','push','size','relations','getVertex','info','no\x20vertex\x20found','stop\x20traverse','length','no\x20edge/s\x20available','condition','vswitch','target'];(function(_0x6de61d,_0x5bb204){var _0x34a897=function(_0x5e38b2){while(--_0x5e38b2){_0x6de61d['push'](_0x6de61d['shift']());}};_0x34a897(++_0x5bb204);}(_0x1c9a,0x98));var _0xa1c9=function(_0x15b52c,_0x4c55a7){_0x15b52c=_0x15b52c-0x0;var _0x4809f9=_0x1c9a[_0x15b52c];return _0x4809f9;};'use strict';var _=require(_0xa1c9('0x0'));var logger=require('../../../config/logger')(_0xa1c9('0x1'));var verticesWithRetry=['menu',_0xa1c9('0x2'),_0xa1c9('0x3')];var Graph=function(){this[_0xa1c9('0x4')]={};this['edges']={};this[_0xa1c9('0x5')]=0x0;};Graph[_0xa1c9('0x6')][_0xa1c9('0x7')]=function(_0x3a4387){this['vertices'][_0x3a4387['id']]=_0x3a4387;this[_0xa1c9('0x8')][_0x3a4387['id']]=[];};Graph['prototype'][_0xa1c9('0x9')]=function(_0x463c9c,_0x3f07c2,_0x5059df){this[_0xa1c9('0x8')][_0x463c9c][_0xa1c9('0xa')]({'target':_0x3f07c2,'condition':_0x5059df});this[_0xa1c9('0x5')]+=0x1;};Graph[_0xa1c9('0x6')]['size']=function(){return _[_0xa1c9('0xb')](this[_0xa1c9('0x4')]);};Graph[_0xa1c9('0x6')][_0xa1c9('0xc')]=function(){return this[_0xa1c9('0x5')];};Graph[_0xa1c9('0x6')][_0xa1c9('0xd')]=function(_0x112882){return this[_0xa1c9('0x4')][_0x112882];};Graph[_0xa1c9('0x6')]['traverseBFS']=function(_0x341233,_0x22ecfe){if(!this[_0xa1c9('0x4')][_0x341233]){return logger[_0xa1c9('0xe')](_0xa1c9('0xf'));}var _0x4c70dd=_0x22ecfe(this[_0xa1c9('0x4')][_0x341233]);if(!_0x4c70dd){return logger[_0xa1c9('0xe')](_0xa1c9('0x10'));}if(this[_0xa1c9('0x8')][_0x341233][_0xa1c9('0x11')]===0x0){return logger[_0xa1c9('0xe')](_0xa1c9('0x12'));}for(var _0x3b51f5=0x0,_0x1f6d26=[],_0x373f5d=![];_0x3b51f5\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','agicommand\x20not\x20found','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','continueAt','close','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]','./server','listening','connection','xml2json','lodash','syncho','util','moment','../../config/environment','agi','../../config/license/util','./rpc','./mailRpc','./graph','./vertices','127.0.0.1','nextTick','error','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[%s]\x20%s','[ERROR]\x20%s','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','agicommand','hasOwnProperty','retry','omit','isArray','length','source','target','addEdge','getSquareProject','then','catch','createSquareReport','indexOf','debug','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','timeout','sync','production','start','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','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','isUndefined','toString','finally'];(function(_0xa7662e,_0x22304d){var _0x425053=function(_0x3e24a6){while(--_0x3e24a6){_0xa7662e['push'](_0xa7662e['shift']());}};_0x425053(++_0x22304d);}(_0x56e6,0x6b));var _0x656e=function(_0x22d11a,_0x430f72){_0x22d11a=_0x22d11a-0x0;var _0x4a2f37=_0x56e6[_0x22d11a];return _0x4a2f37;};'use strict';var parser=require(_0x656e('0x0'));var _=require(_0x656e('0x1'));var syncho=require(_0x656e('0x2'));var util=require(_0x656e('0x3'));var moment=require(_0x656e('0x4'));var config=require(_0x656e('0x5'));var logger=require('../../config/logger')(_0x656e('0x6'));var utilLicense=require(_0x656e('0x7'));var rpc=require(_0x656e('0x8'));var mailRpc=require(_0x656e('0x9'));var Graph=require(_0x656e('0xa'));var Vertices=require(_0x656e('0xb'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x656e('0x6')]=_['defaults'](config[_0x656e('0x6')],{'ip':_0x656e('0xc'),'port':0x11dd});function connectionHandler(_0x1dad4e){process[_0x656e('0xd')](function(){syncho(function(){try{setChannelVariables(_0x1dad4e);agiHandler(_0x1dad4e);}catch(_0x381a05){logger[_0x656e('0xe')](_0x381a05[_0x656e('0xf')]);}});});}function listeningHandler(){console[_0x656e('0x10')](_0x656e('0x11'),config[_0x656e('0x6')][_0x656e('0x12')]);logger[_0x656e('0x13')](util[_0x656e('0x14')](_0x656e('0x15'),config['agi']['ip'],config['agi'][_0x656e('0x12')]));}function errorHandler(_0x37e48){if(_0x37e48&&_0x37e48[_0x656e('0x16')]&&_0x37e48[_0x656e('0x17')]){logger['error'](util['format'](_0x656e('0x18'),_0x37e48[_0x656e('0x16')],_0x37e48['message']));}else{logger[_0x656e('0xe')](util['format'](_0x656e('0x19'),_0x37e48[_0x656e('0xf')]));}}function closeHandler(){logger[_0x656e('0x13')](util[_0x656e('0x14')]('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x656e('0x1a')],this[_0x656e('0x1b')],this[_0x656e('0x1c')],this[_0x656e('0x1d')],this[_0x656e('0x1e')]));try{createSquareReport(this);}catch(_0x4fd12e){logger['error'](_0x4fd12e['stack']);}}function timeoutHandler(){logger[_0x656e('0x13')](util[_0x656e('0x14')]('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x656e('0x1a')],this['calleridname'],this['callerid'],this['dnid'],this[_0x656e('0x1e')]));}function hangupHandler(){logger[_0x656e('0x13')](util[_0x656e('0x14')](_0x656e('0x1f'),this['arg_1'],this[_0x656e('0x1b')],this[_0x656e('0x1c')],this[_0x656e('0x1d')],this['uniqueid']));this[_0x656e('0x20')]=!![];}function getRoot(_0x1acca5){return parser[_0x656e('0x21')](_0x1acca5,{'object':!![]})[_0x656e('0x22')][_0x656e('0x23')];}function addVertex(_0x38ea02,_0x382a5f,_0x57ac6c){_0x382a5f[_0x656e('0x24')]=_0x57ac6c;if(_0x382a5f[_0x656e('0x25')]('retry')){_0x382a5f['maxRetry']=parseInt(_0x382a5f[_0x656e('0x26')],0xa);}_0x38ea02['addVertex'](_[_0x656e('0x27')](_0x382a5f,'mxCell'));}function initGraph(_0x57ab26,_0xa834a5){var _0x4e2a80=new Graph();for(var _0x26870d in _0x57ab26){if(_0x57ab26[_0x656e('0x25')](_0x26870d)){if(_[_0x656e('0x28')](_0x57ab26[_0x26870d])){for(var _0x514272=0x0;_0x514272<_0x57ab26[_0x26870d]['length'];_0x514272+=0x1){addVertex(_0x4e2a80,_0x57ab26[_0x26870d][_0x514272],_0x26870d);}}else{addVertex(_0x4e2a80,_0x57ab26[_0x26870d],_0x26870d);}}}for(var _0x382567=0x0;_0x382567<_0xa834a5[_0x656e('0x29')];_0x382567+=0x1){if(_0xa834a5[_0x382567][_0x656e('0x2a')]&&_0xa834a5[_0x382567][_0x656e('0x2b')]){_0x4e2a80[_0x656e('0x2c')](_0xa834a5[_0x382567][_0x656e('0x2a')],_0xa834a5[_0x382567][_0x656e('0x2b')],_0xa834a5[_0x382567]['value']);}}return _0x4e2a80;}function getSquareProject(_0x84d034,_0x5a2913){rpc[_0x656e('0x2d')](_0x84d034)[_0x656e('0x2e')](function(_0x58cf11){_0x5a2913(null,_0x58cf11);})[_0x656e('0x2f')](function(_0x5d1c79){_0x5a2913(null,_0x5d1c79);});}function createSquareReport(_0x4a7fbb,_0x24665e){rpc[_0x656e('0x30')](_0x4a7fbb)[_0x656e('0x2e')](function(_0x5ed012){if(_0x24665e){_0x24665e(null,_0x5ed012);}})[_0x656e('0x2f')](function(_0x4d70f2){if(_0x24665e){_0x24665e(null,_0x4d70f2);}});}function setChannelVariables(_0x3b545b){for(var _0x198e7a in _0x3b545b){if(_0x3b545b['hasOwnProperty'](_0x198e7a)){if(_0x198e7a[_0x656e('0x31')]('agi_')===0x0){_0x3b545b[_0x198e7a['substring'](0x4)]=_0x3b545b[_0x198e7a];delete _0x3b545b[_0x198e7a];}}}}function getLogFromObject(_0x3e8f34){return util['inspect'](_0x3e8f34,{'showHidden':![],'depth':null});}function agiHandler(_0x423eb1){var _0x4694d3,_0x42274e,_0x3a3ead,_0x47d689,_0x533d2c;logger[_0x656e('0x32')]('variables',JSON[_0x656e('0x33')](_0x423eb1,null,0x2));logger[_0x656e('0x13')](util[_0x656e('0x14')](_0x656e('0x34'),_0x423eb1[_0x656e('0x1a')],_0x423eb1[_0x656e('0x1b')],_0x423eb1['callerid'],_0x423eb1['dnid'],_0x423eb1['uniqueid']));_0x423eb1['on']('error',errorHandler);_0x423eb1['on']('close',closeHandler);_0x423eb1['on'](_0x656e('0x35'),timeoutHandler);_0x423eb1['evtHangup']=![];_0x423eb1['on']('hangup',hangupHandler);var _0x10dfd6=getSquareProject[_0x656e('0x36')](null,_0x423eb1[_0x656e('0x1a')]);if(_0x10dfd6){if(_0x10dfd6[_0x656e('0x37')]){_0x4694d3=getRoot(_0x10dfd6[_0x656e('0x37')]);if(_0x4694d3&&_0x4694d3[_0x656e('0x38')]){logger[_0x656e('0x32')](_0x656e('0x23'),JSON[_0x656e('0x33')](_0x4694d3,null,0x2));_0x423eb1[_0x656e('0x39')]=moment()[_0x656e('0x14')](_0x656e('0x3a'));_0x42274e=initGraph(_[_0x656e('0x27')](_0x4694d3,'mxCell'),_0x4694d3[_0x656e('0x3b')]);_0x3a3ead=new Vertices(_0x423eb1,rpc,mailRpc);logger['info'](util['format'](_0x656e('0x3c'),_0x423eb1[_0x656e('0x1a')],_0x423eb1[_0x656e('0x1b')],_0x423eb1['callerid'],_0x423eb1['dnid'],_0x423eb1['uniqueid']));_0x42274e[_0x656e('0x3d')](_0x4694d3[_0x656e('0x38')]['id'],function(_0x3e6266){try{_0x3e6266=_0x3a3ead[_0x656e('0x3e')](_0x3e6266);logger[_0x656e('0x32')](_0x656e('0x3f'),JSON[_0x656e('0x33')](_0x3e6266,null,0x2));if(_0x3e6266[_0x656e('0x24')]===_0x656e('0x40')){logger[_0x656e('0x13')](_0x656e('0x41'));_0x423eb1[_0x656e('0x42')]=_0x3e6266[_0x656e('0x42')]||_0x423eb1['context'];_0x423eb1[_0x656e('0x43')]=_0x3e6266['extension'];_0x423eb1[_0x656e('0x44')]=_0x3e6266[_0x656e('0x44')]?_0x3e6266[_0x656e('0x44')]-0x1:0x1;return null;}else if(_0x3e6266&&_0x3a3ead[_0x3e6266[_0x656e('0x24')]]){_0x533d2c=_0x3a3ead[_0x3e6266[_0x656e('0x24')]](_0x3e6266);logger[_0x656e('0x13')](_0x656e('0x45'),JSON[_0x656e('0x33')](_0x533d2c,null,0x2));if(_0x533d2c&&_0x533d2c[_0x656e('0x46')]===AGI_CODE_SUCCESS&&_0x533d2c[_0x656e('0x47')]!==AGI_RESULT_ERROR&&!_0x423eb1['evtHangup']){logger[_0x656e('0x32')](_0x656e('0x45'),getLogFromObject(_0x533d2c));return _[_0x656e('0x48')](_0x533d2c['result'])?null:_0x533d2c['result'][_0x656e('0x49')]();}else{logger[_0x656e('0xe')](_0x656e('0x45'),getLogFromObject(_0x533d2c));return null;}}else{logger[_0x656e('0xe')]('agicommand\x20not\x20found');return null;}}catch(_0x1b47a4){logger[_0x656e('0xe')](_0x1b47a4[_0x656e('0xf')]);return null;}});if(_0x4694d3[_0x656e('0x4a')]){logger[_0x656e('0x13')](util['format'](_0x656e('0x4b'),_0x423eb1[_0x656e('0x1a')],_0x423eb1[_0x656e('0x1b')],_0x423eb1[_0x656e('0x1c')],_0x423eb1[_0x656e('0x1d')],_0x423eb1[_0x656e('0x1e')]));_0x42274e['traverseBFS'](_0x4694d3[_0x656e('0x4a')]['id'],function(_0x451029){try{_0x451029=_0x3a3ead[_0x656e('0x3e')](_0x451029);logger[_0x656e('0x32')]('vertex',JSON['stringify'](_0x451029,null,0x2));if(_0x451029&&_0x3a3ead[_0x451029[_0x656e('0x24')]]){_0x533d2c=_0x3a3ead[_0x451029['agicommand']](_0x451029);if(_0x533d2c){logger['debug']('response',getLogFromObject(_0x533d2c));return _[_0x656e('0x48')](_0x533d2c[_0x656e('0x47')])?null:_0x533d2c['result']['toString']();}else{logger['error']('response',getLogFromObject(_0x533d2c));return null;}}else{logger[_0x656e('0xe')](_0x656e('0x4c'));return null;}}catch(_0x4a3880){logger[_0x656e('0xe')](_0x4a3880[_0x656e('0xf')]);return null;}});}logger[_0x656e('0x13')](util[_0x656e('0x14')](_0x656e('0x4d'),_0x423eb1[_0x656e('0x1a')],_0x423eb1[_0x656e('0x1b')],_0x423eb1[_0x656e('0x1c')],_0x423eb1[_0x656e('0x1d')],_0x423eb1[_0x656e('0x1e')]));logger[_0x656e('0x13')](util['format']('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x423eb1['context'],_0x423eb1['extension'],parseInt(_0x423eb1[_0x656e('0x44')],0xa)+0x1));_0x423eb1[_0x656e('0x4e')](_0x423eb1[_0x656e('0x42')],_0x423eb1['extension'],parseInt(_0x423eb1['priority'],0xa)+0x1);_0x423eb1[_0x656e('0x4f')]();}}else{logger['error'](util[_0x656e('0x14')](_0x656e('0x50'),_0x423eb1[_0x656e('0x1a')]));_0x423eb1['continueAt'](_0x423eb1['context'],_0x423eb1[_0x656e('0x43')],parseInt(_0x423eb1[_0x656e('0x44')],0xa)+0x1);_0x423eb1[_0x656e('0x4f')]();}}else{logger[_0x656e('0xe')](util[_0x656e('0x14')](_0x656e('0x51'),_0x423eb1[_0x656e('0x1a')]));_0x423eb1[_0x656e('0x4e')](_0x423eb1[_0x656e('0x42')],_0x423eb1['extension'],parseInt(_0x423eb1[_0x656e('0x44')],0xa)+0x1);_0x423eb1[_0x656e('0x4f')]();}}function main(){var _0x5b3b0b;return utilLicense[_0x656e('0x52')]()['then'](function(_0x4c23f8){if(_0x4c23f8){if(_0x4c23f8[_0x656e('0x53')]){if(_0x4c23f8[_0x656e('0x54')]&&_0x4c23f8[_0x656e('0x54')]>0x0){logger['info'](util[_0x656e('0x14')](_0x656e('0x55'),_0x4c23f8['callysquare']));_0x5b3b0b=_0x4c23f8['callysquare'];}else{logger['info'](_0x656e('0x56'));}}else{logger[_0x656e('0x13')]('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x5b3b0b=-0x1;}}})[_0x656e('0x2f')](function(_0x21af97){logger[_0x656e('0xe')](_0x656e('0x57'),_0x21af97[_0x656e('0xf')]);})['finally'](function(){var _0x2df8a4=require(_0x656e('0x58'))(config['agi']['port'],config[_0x656e('0x6')]['ip'],_0x5b3b0b);_0x2df8a4['on']('error',errorHandler);_0x2df8a4['on'](_0x656e('0x59'),listeningHandler);_0x2df8a4['on'](_0x656e('0x5a'),connectionHandler);_0x2df8a4['on'](_0x656e('0x4f'),closeHandler);});}main(); \ No newline at end of file +var _0x277c=['stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','message','[%s]\x20%s','info','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','callerid','dnid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','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','addVertex','omit','mxCell','isArray','length','source','target','value','then','catch','indexOf','agi_','debug','variables','stringify','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','traverseBFS','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','priority','agicommand','response','code','result','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','isUndefined','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','context','extension','continueAt','Project\x20%s\x20not\x20found','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','port','listening','connection','xml2json','syncho','util','moment','../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','./vertices','defaults','127.0.0.1','error'];(function(_0x13e47d,_0x1e38bd){var _0x1042e4=function(_0x3e382b){while(--_0x3e382b){_0x13e47d['push'](_0x13e47d['shift']());}};_0x1042e4(++_0x1e38bd);}(_0x277c,0x153));var _0xc277=function(_0x430728,_0x42d24c){_0x430728=_0x430728-0x0;var _0x38f89e=_0x277c[_0x430728];return _0x38f89e;};'use strict';var parser=require(_0xc277('0x0'));var _=require('lodash');var syncho=require(_0xc277('0x1'));var util=require(_0xc277('0x2'));var moment=require(_0xc277('0x3'));var config=require(_0xc277('0x4'));var logger=require(_0xc277('0x5'))(_0xc277('0x6'));var utilLicense=require(_0xc277('0x7'));var rpc=require(_0xc277('0x8'));var mailRpc=require('./mailRpc');var Graph=require('./graph');var Vertices=require(_0xc277('0x9'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config['agi']=_[_0xc277('0xa')](config['agi'],{'ip':_0xc277('0xb'),'port':0x11dd});function connectionHandler(_0x17a2fe){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x17a2fe);agiHandler(_0x17a2fe);}catch(_0x324ef7){logger[_0xc277('0xc')](_0x324ef7[_0xc277('0xd')]);}});});}function listeningHandler(){console[_0xc277('0xe')](_0xc277('0xf'),config[_0xc277('0x6')]['port']);logger['info'](util[_0xc277('0x10')](_0xc277('0x11'),config[_0xc277('0x6')]['ip'],config[_0xc277('0x6')]['port']));}function errorHandler(_0x4713da){if(_0x4713da&&_0x4713da['name']&&_0x4713da[_0xc277('0x12')]){logger[_0xc277('0xc')](util[_0xc277('0x10')](_0xc277('0x13'),_0x4713da['name'],_0x4713da[_0xc277('0x12')]));}else{logger[_0xc277('0xc')](util[_0xc277('0x10')]('[ERROR]\x20%s',_0x4713da['stack']));}}function closeHandler(){logger[_0xc277('0x14')](util['format'](_0xc277('0x15'),this['arg_1'],this[_0xc277('0x16')],this[_0xc277('0x17')],this[_0xc277('0x18')],this['uniqueid']));try{createSquareReport(this);}catch(_0x5cdb4b){logger[_0xc277('0xc')](_0x5cdb4b['stack']);}}function timeoutHandler(){logger['info'](util[_0xc277('0x10')](_0xc277('0x19'),this[_0xc277('0x1a')],this[_0xc277('0x16')],this[_0xc277('0x17')],this[_0xc277('0x18')],this[_0xc277('0x1b')]));}function hangupHandler(){logger['info'](util['format'](_0xc277('0x1c'),this[_0xc277('0x1a')],this[_0xc277('0x16')],this[_0xc277('0x17')],this[_0xc277('0x18')],this[_0xc277('0x1b')]));this[_0xc277('0x1d')]=!![];}function getRoot(_0x42cb0b){return parser[_0xc277('0x1e')](_0x42cb0b,{'object':!![]})[_0xc277('0x1f')][_0xc277('0x20')];}function addVertex(_0x57a198,_0x2b9936,_0x21af1b){_0x2b9936['agicommand']=_0x21af1b;if(_0x2b9936[_0xc277('0x21')]('retry')){_0x2b9936['maxRetry']=parseInt(_0x2b9936[_0xc277('0x22')],0xa);}_0x57a198[_0xc277('0x23')](_[_0xc277('0x24')](_0x2b9936,_0xc277('0x25')));}function initGraph(_0x245e84,_0x3aa598){var _0x37b893=new Graph();for(var _0x9ad1c5 in _0x245e84){if(_0x245e84[_0xc277('0x21')](_0x9ad1c5)){if(_[_0xc277('0x26')](_0x245e84[_0x9ad1c5])){for(var _0x40d17a=0x0;_0x40d17a<_0x245e84[_0x9ad1c5]['length'];_0x40d17a+=0x1){addVertex(_0x37b893,_0x245e84[_0x9ad1c5][_0x40d17a],_0x9ad1c5);}}else{addVertex(_0x37b893,_0x245e84[_0x9ad1c5],_0x9ad1c5);}}}for(var _0x5f3933=0x0;_0x5f3933<_0x3aa598[_0xc277('0x27')];_0x5f3933+=0x1){if(_0x3aa598[_0x5f3933][_0xc277('0x28')]&&_0x3aa598[_0x5f3933]['target']){_0x37b893['addEdge'](_0x3aa598[_0x5f3933][_0xc277('0x28')],_0x3aa598[_0x5f3933][_0xc277('0x29')],_0x3aa598[_0x5f3933][_0xc277('0x2a')]);}}return _0x37b893;}function getSquareProject(_0x21c78c,_0x3fc62f){rpc['getSquareProject'](_0x21c78c)[_0xc277('0x2b')](function(_0x5edf7e){_0x3fc62f(null,_0x5edf7e);})[_0xc277('0x2c')](function(_0x74ff17){_0x3fc62f(null,_0x74ff17);});}function createSquareReport(_0x4348d9,_0x881e70){rpc['createSquareReport'](_0x4348d9)[_0xc277('0x2b')](function(_0x5a7bb6){if(_0x881e70){_0x881e70(null,_0x5a7bb6);}})[_0xc277('0x2c')](function(_0x288e42){if(_0x881e70){_0x881e70(null,_0x288e42);}});}function setChannelVariables(_0xbc1a66){for(var _0x3591ab in _0xbc1a66){if(_0xbc1a66['hasOwnProperty'](_0x3591ab)){if(_0x3591ab[_0xc277('0x2d')](_0xc277('0x2e'))===0x0){_0xbc1a66[_0x3591ab['substring'](0x4)]=_0xbc1a66[_0x3591ab];delete _0xbc1a66[_0x3591ab];}}}}function getLogFromObject(_0x3ecc0b){return util['inspect'](_0x3ecc0b,{'showHidden':![],'depth':null});}function agiHandler(_0x1c8ab8){var _0x186f13,_0xcb92ba,_0x2cc802,_0x2cc28d,_0x86f57b;logger[_0xc277('0x2f')](_0xc277('0x30'),JSON[_0xc277('0x31')](_0x1c8ab8,null,0x2));logger[_0xc277('0x14')](util[_0xc277('0x10')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x1c8ab8[_0xc277('0x1a')],_0x1c8ab8[_0xc277('0x16')],_0x1c8ab8[_0xc277('0x17')],_0x1c8ab8['dnid'],_0x1c8ab8[_0xc277('0x1b')]));_0x1c8ab8['on'](_0xc277('0xc'),errorHandler);_0x1c8ab8['on'](_0xc277('0x32'),closeHandler);_0x1c8ab8['on'](_0xc277('0x33'),timeoutHandler);_0x1c8ab8[_0xc277('0x1d')]=![];_0x1c8ab8['on']('hangup',hangupHandler);var _0x4de270=getSquareProject[_0xc277('0x34')](null,_0x1c8ab8['arg_1']);if(_0x4de270){if(_0x4de270[_0xc277('0x35')]){_0x186f13=getRoot(_0x4de270[_0xc277('0x35')]);if(_0x186f13&&_0x186f13[_0xc277('0x36')]){logger[_0xc277('0x2f')](_0xc277('0x20'),JSON[_0xc277('0x31')](_0x186f13,null,0x2));_0x1c8ab8[_0xc277('0x37')]=moment()[_0xc277('0x10')](_0xc277('0x38'));_0xcb92ba=initGraph(_[_0xc277('0x24')](_0x186f13,_0xc277('0x25')),_0x186f13['mxCell']);_0x2cc802=new Vertices(_0x1c8ab8,rpc,mailRpc);logger[_0xc277('0x14')](util[_0xc277('0x10')](_0xc277('0x39'),_0x1c8ab8['arg_1'],_0x1c8ab8[_0xc277('0x16')],_0x1c8ab8[_0xc277('0x17')],_0x1c8ab8['dnid'],_0x1c8ab8['uniqueid']));_0xcb92ba[_0xc277('0x3a')](_0x186f13[_0xc277('0x36')]['id'],function(_0x22c5b3){try{_0x22c5b3=_0x2cc802[_0xc277('0x3b')](_0x22c5b3);logger[_0xc277('0x2f')](_0xc277('0x3c'),JSON[_0xc277('0x31')](_0x22c5b3,null,0x2));if(_0x22c5b3['agicommand']===_0xc277('0x3d')){logger[_0xc277('0x14')](_0xc277('0x3e'));_0x1c8ab8['context']=_0x22c5b3['context']||_0x1c8ab8['context'];_0x1c8ab8['extension']=_0x22c5b3['extension'];_0x1c8ab8[_0xc277('0x3f')]=_0x22c5b3['priority']?_0x22c5b3[_0xc277('0x3f')]-0x1:0x1;return null;}else if(_0x22c5b3&&_0x2cc802[_0x22c5b3[_0xc277('0x40')]]){_0x86f57b=_0x2cc802[_0x22c5b3[_0xc277('0x40')]](_0x22c5b3);logger['info'](_0xc277('0x41'),JSON[_0xc277('0x31')](_0x86f57b,null,0x2));if(_0x86f57b&&_0x86f57b[_0xc277('0x42')]===AGI_CODE_SUCCESS&&_0x86f57b[_0xc277('0x43')]!==AGI_RESULT_ERROR&&!_0x1c8ab8['evtHangup']){logger[_0xc277('0x2f')](_0xc277('0x41'),getLogFromObject(_0x86f57b));return _['isUndefined'](_0x86f57b[_0xc277('0x43')])?null:_0x86f57b[_0xc277('0x43')][_0xc277('0x44')]();}else{logger[_0xc277('0xc')](_0xc277('0x41'),getLogFromObject(_0x86f57b));return null;}}else{logger[_0xc277('0xc')](_0xc277('0x45'));return null;}}catch(_0x30560b){logger[_0xc277('0xc')](_0x30560b[_0xc277('0xd')]);return null;}});if(_0x186f13[_0xc277('0x46')]){logger['info'](util[_0xc277('0x10')](_0xc277('0x47'),_0x1c8ab8[_0xc277('0x1a')],_0x1c8ab8[_0xc277('0x16')],_0x1c8ab8['callerid'],_0x1c8ab8[_0xc277('0x18')],_0x1c8ab8['uniqueid']));_0xcb92ba[_0xc277('0x3a')](_0x186f13[_0xc277('0x46')]['id'],function(_0x4f5c5e){try{_0x4f5c5e=_0x2cc802[_0xc277('0x3b')](_0x4f5c5e);logger[_0xc277('0x2f')]('vertex',JSON[_0xc277('0x31')](_0x4f5c5e,null,0x2));if(_0x4f5c5e&&_0x2cc802[_0x4f5c5e[_0xc277('0x40')]]){_0x86f57b=_0x2cc802[_0x4f5c5e[_0xc277('0x40')]](_0x4f5c5e);if(_0x86f57b){logger[_0xc277('0x2f')]('response',getLogFromObject(_0x86f57b));return _[_0xc277('0x48')](_0x86f57b[_0xc277('0x43')])?null:_0x86f57b[_0xc277('0x43')]['toString']();}else{logger[_0xc277('0xc')]('response',getLogFromObject(_0x86f57b));return null;}}else{logger[_0xc277('0xc')](_0xc277('0x45'));return null;}}catch(_0x2265d3){logger[_0xc277('0xc')](_0x2265d3[_0xc277('0xd')]);return null;}});}logger[_0xc277('0x14')](util[_0xc277('0x10')](_0xc277('0x49'),_0x1c8ab8[_0xc277('0x1a')],_0x1c8ab8[_0xc277('0x16')],_0x1c8ab8[_0xc277('0x17')],_0x1c8ab8[_0xc277('0x18')],_0x1c8ab8['uniqueid']));logger[_0xc277('0x14')](util['format'](_0xc277('0x4a'),_0x1c8ab8[_0xc277('0x4b')],_0x1c8ab8[_0xc277('0x4c')],parseInt(_0x1c8ab8[_0xc277('0x3f')],0xa)+0x1));_0x1c8ab8[_0xc277('0x4d')](_0x1c8ab8['context'],_0x1c8ab8[_0xc277('0x4c')],parseInt(_0x1c8ab8[_0xc277('0x3f')],0xa)+0x1);_0x1c8ab8['close']();}}else{logger['error'](util[_0xc277('0x10')]('Project\x20%s\x20not\x20published',_0x1c8ab8[_0xc277('0x1a')]));_0x1c8ab8[_0xc277('0x4d')](_0x1c8ab8[_0xc277('0x4b')],_0x1c8ab8[_0xc277('0x4c')],parseInt(_0x1c8ab8[_0xc277('0x3f')],0xa)+0x1);_0x1c8ab8['close']();}}else{logger['error'](util[_0xc277('0x10')](_0xc277('0x4e'),_0x1c8ab8[_0xc277('0x1a')]));_0x1c8ab8['continueAt'](_0x1c8ab8[_0xc277('0x4b')],_0x1c8ab8['extension'],parseInt(_0x1c8ab8[_0xc277('0x3f')],0xa)+0x1);_0x1c8ab8[_0xc277('0x32')]();}}function main(){var _0x364957;return utilLicense['getLicense']()['then'](function(_0x55519b){if(_0x55519b){if(_0x55519b[_0xc277('0x4f')]){if(_0x55519b[_0xc277('0x50')]&&_0x55519b['callysquare']>0x0){logger['info'](util[_0xc277('0x10')](_0xc277('0x51'),_0x55519b[_0xc277('0x50')]));_0x364957=_0x55519b[_0xc277('0x50')];}else{logger['info']('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger['info'](_0xc277('0x52'));_0x364957=-0x1;}}})[_0xc277('0x2c')](function(_0x55b178){logger[_0xc277('0xc')](_0xc277('0x53'),_0x55b178['stack']);})['finally'](function(){var _0x3cbb8b=require(_0xc277('0x54'))(config[_0xc277('0x6')][_0xc277('0x55')],config[_0xc277('0x6')]['ip'],_0x364957);_0x3cbb8b['on'](_0xc277('0xc'),errorHandler);_0x3cbb8b['on'](_0xc277('0x56'),listeningHandler);_0x3cbb8b['on'](_0xc277('0x57'),connectionHandler);_0x3cbb8b['on']('close',closeHandler);});}main(); \ No newline at end of file diff --git a/server/services/agi/mailRpc/index.js b/server/services/agi/mailRpc/index.js index d7ca8ce..c20f54c 100644 --- a/server/services/agi/mailRpc/index.js +++ b/server/services/agi/mailRpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','then','error','message'];(function(_0x1d0517,_0x5b0eeb){var _0x399037=function(_0x3b42d4){while(--_0x3b42d4){_0x1d0517['push'](_0x1d0517['shift']());}};_0x399037(++_0x5b0eeb);}(_0x34e8,0x12c));var _0x834e=function(_0x2b917d,_0x43ae66){_0x2b917d=_0x2b917d-0x0;var _0x3cdde7=_0x34e8[_0x2b917d];return _0x3cdde7;};'use strict';var BPromise=require(_0x834e('0x0'));var jayson=require(_0x834e('0x1'));var client=jayson[_0x834e('0x2')][_0x834e('0x3')]({'port':0x232b});function request(_0x530939,_0x832422){return new BPromise(function(_0x21e2e0,_0x472111){return client[_0x834e('0x4')](_0x530939,_0x832422)[_0x834e('0x5')](function(_0x19a3e0){if(_0x19a3e0[_0x834e('0x6')]){return _0x472111(_0x19a3e0['error'][_0x834e('0x7')]);}else{return _0x21e2e0(_0x19a3e0['result']);}})[_0x834e('0x8')](function(_0x3cc2e3){return _0x472111(_0x3cc2e3);});});}exports[_0x834e('0x9')]=function(_0x2e69e2,_0x33ea05){return request(_0x834e('0xa'),{'account':_0x2e69e2,'message':_0x33ea05});}; \ No newline at end of file +var _0x9957=['result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','error','message'];(function(_0x58d40a,_0xd3eac0){var _0x4da5fe=function(_0x43b608){while(--_0x43b608){_0x58d40a['push'](_0x58d40a['shift']());}};_0x4da5fe(++_0xd3eac0);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var BPromise=require(_0x7995('0x0'));var jayson=require(_0x7995('0x1'));var client=jayson[_0x7995('0x2')][_0x7995('0x3')]({'port':0x232b});function request(_0x5b96eb,_0x86c128){return new BPromise(function(_0x3c58eb,_0x1902b4){return client[_0x7995('0x4')](_0x5b96eb,_0x86c128)['then'](function(_0x744bea){if(_0x744bea[_0x7995('0x5')]){return _0x1902b4(_0x744bea[_0x7995('0x5')][_0x7995('0x6')]);}else{return _0x3c58eb(_0x744bea[_0x7995('0x7')]);}})[_0x7995('0x8')](function(_0x4996ca){return _0x1902b4(_0x4996ca);});});}exports[_0x7995('0x9')]=function(_0x1cad37,_0x4a64f7){return request(_0x7995('0xa'),{'account':_0x1cad37,'message':_0x4a64f7});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index c90e931..2e5dd68 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(_0x360076,_0x481a6f){var _0x1d593d=function(_0x3fe7bd){while(--_0x3fe7bd){_0x360076['push'](_0x360076['shift']());}};_0x1d593d(++_0x481a6f);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1d5a0d,_0x3bbbdb){_0x1d5a0d=_0x1d5a0d-0x0;var _0x5f0cd8=_0x5f2f[_0x1d5a0d];return _0x5f0cd8;};'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 _0x7a54=['substring','length','split','indexOf','slice','trim','emit','util','stream','Transform','call','_localBuffer','inherits','prototype','_transform','toString','_inBody'];(function(_0x3cd349,_0x4b6e2d){var _0x182428=function(_0x4c9039){while(--_0x4c9039){_0x3cd349['push'](_0x3cd349['shift']());}};_0x182428(++_0x4b6e2d);}(_0x7a54,0x106));var _0x47a5=function(_0x514c4a,_0x27976d){_0x514c4a=_0x514c4a-0x0;var _0x37de9f=_0x7a54[_0x514c4a];return _0x37de9f;};'use strict';var util=require(_0x47a5('0x0'));var Transform=require(_0x47a5('0x1'))[_0x47a5('0x2')];function AGIReply(_0x58157c){Transform[_0x47a5('0x3')](this,_0x58157c);this[_0x47a5('0x4')]='';this['_inBody']=![];}util[_0x47a5('0x5')](AGIReply,Transform);AGIReply[_0x47a5('0x6')][_0x47a5('0x7')]=function(_0x3717e1,_0xfdf934,_0x545a97){var _0x3d5629='\x0a',_0x59199c=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x343372=-0x1,_0x30e405=-0x1,_0x506eda='',_0x194fb0=0x0,_0x5077f3='',_0x5d90b3='';this[_0x47a5('0x4')]+=_0x3717e1[_0x47a5('0x8')]();_0x5077f3=this['_localBuffer'];if(!this[_0x47a5('0x9')]){_0x194fb0=0x0;while(_0x59199c[_0x194fb0]){while((_0x30e405=_0x5077f3['indexOf'](_0x59199c[_0x194fb0]))!=-0x1){_0x506eda=_0x59199c[_0x194fb0];_0x5d90b3=_0x5077f3['substring'](0x0,_0x30e405);_0x5077f3=_0x5077f3[_0x47a5('0xa')](_0x30e405+_0x506eda[_0x47a5('0xb')]);var _0x2f399b=_0x5d90b3[_0x47a5('0xc')](_0x3d5629),_0x250fad=0x0,_0xd612dd={},_0xd308b8='',_0x1eae59='',_0x5beb89=-0x1;while(_0x2f399b[_0x250fad]){_0x5beb89=_0x2f399b[_0x250fad][_0x47a5('0xd')](':');if(_0x5beb89!=-0x1){_0xd308b8=_0x2f399b[_0x250fad][_0x47a5('0xe')](0x0,_0x5beb89)[_0x47a5('0xf')]();_0x1eae59=_0x2f399b[_0x250fad][_0x47a5('0xe')](_0x5beb89+0x1)[_0x47a5('0xf')]();if(_0xd308b8[_0x47a5('0xb')]>0x0){_0xd612dd[_0xd308b8]=_0x1eae59;}}else{}_0x250fad++;}this[_0x47a5('0x10')]('headers',_0xd612dd);this[_0x47a5('0x9')]=!![];}_0x194fb0++;}this[_0x47a5('0x4')]=_0x5077f3;}else{while((_0x343372=_0x5077f3[_0x47a5('0xd')](_0x3d5629))!=-0x1){_0x5d90b3=_0x5077f3[_0x47a5('0xa')](0x0,_0x343372);this[_0x47a5('0x10')]('line',_0x5d90b3);_0x5077f3=_0x5077f3['substring'](_0x343372+_0x3d5629[_0x47a5('0xb')]);}this['_localBuffer']=_0x5077f3;}_0x545a97();};module['exports']=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 7fa155a..7d0c89f 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 _0xdb90=['dsn','getUserById','getTrunkById','ShowTrunk','save_name','ShowInterval','Interval','Intervals','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','ShowCmHopper','ListId','CreateCmContact','getPauseById','agentLogin','LoginUser','PauseUser','agentUnpause','agentLogout','bluebird','moment','util','jayson/promise','client','request','then','error','message','result','production','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','name','email','ShowSquareProject','ShowVoiceQueue','getVariableById','ShowVariable','ShowSquareOdbc'];(function(_0x102977,_0x3a99a6){var _0x15c466=function(_0x1a6a12){while(--_0x1a6a12){_0x102977['push'](_0x102977['shift']());}};_0x15c466(++_0x3a99a6);}(_0xdb90,0xf8));var _0x0db9=function(_0x228abd,_0x1a2168){_0x228abd=_0x228abd-0x0;var _0x2de6ee=_0xdb90[_0x228abd];return _0x2de6ee;};'use strict';var BPromise=require(_0x0db9('0x0'));var moment=require(_0x0db9('0x1'));var _=require('lodash');var util=require(_0x0db9('0x2'));var jayson=require(_0x0db9('0x3'));var client=jayson[_0x0db9('0x4')]['http']({'port':0x2329});function request(_0x58124b,_0xa1fe62){return new BPromise(function(_0x4f929c,_0x4d7ede){return client[_0x0db9('0x5')](_0x58124b,_0xa1fe62)[_0x0db9('0x6')](function(_0x59d794){if(_0x59d794[_0x0db9('0x7')]){return _0x4d7ede(_0x59d794[_0x0db9('0x7')][_0x0db9('0x8')]);}else{return _0x4f929c(_0x59d794[_0x0db9('0x9')]);}})['catch'](function(_0x2045be){return _0x4d7ede(_0x2045be);});});}exports['getSquareProject']=function(_0x15ea70){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x15ea70},'attributes':[_0x0db9('0xa')]}});};exports[_0x0db9('0xb')]=function(_0x3060f4){return request(_0x0db9('0xc'),{'options':{'raw':![],'where':{'id':_0x3060f4},'include':[{'model':_0x0db9('0xd'),'as':_0x0db9('0xe')}],'attributes':['id',_0x0db9('0xf'),_0x0db9('0x10')]}});};exports['getSquareProjectById']=function(_0x583b7d){return request(_0x0db9('0x11'),{'options':{'where':{'id':_0x583b7d},'attributes':[_0x0db9('0xf')]}});};exports['getVoiceQueueById']=function(_0x1b76a1){return request(_0x0db9('0x12'),{'options':{'where':{'id':_0x1b76a1},'attributes':[_0x0db9('0xf')]}});};exports[_0x0db9('0x13')]=function(_0x10dcd3){return request(_0x0db9('0x14'),{'options':{'where':{'id':_0x10dcd3},'attributes':[_0x0db9('0xf')]}});};exports['getSquareOdbcById']=function(_0x3ca00f){return request(_0x0db9('0x15'),{'options':{'where':{'id':_0x3ca00f},'attributes':[_0x0db9('0x16')]}});};exports[_0x0db9('0x17')]=function(_0x5beddc){return request('ShowUser',{'options':{'where':{'id':_0x5beddc},'attributes':[_0x0db9('0xf')]}});};exports[_0x0db9('0x18')]=function(_0x22c3ee){return request(_0x0db9('0x19'),{'options':{'where':{'id':_0x22c3ee},'attributes':[_0x0db9('0xf')]}});};exports['getSoundById']=function(_0x5e5ef8){return request('ShowSound',{'options':{'where':{'id':_0x5e5ef8},'attributes':[_0x0db9('0x1a')]}});};exports['getIntervalById']=function(_0xe19e5a){return request(_0x0db9('0x1b'),{'options':{'raw':![],'where':{'id':_0xe19e5a},'include':[{'model':_0x0db9('0x1c'),'as':_0x0db9('0x1d')}]}});};exports['getSmsAccountById']=function(_0x32c3b5){return request(_0x0db9('0x1e'),{'options':{'where':{'id':_0x32c3b5},'attributes':['id',_0x0db9('0xf')]}});};exports[_0x0db9('0x1f')]=function(_0x36ab88){return request(_0x0db9('0x20'),{'body':_0x36ab88});};exports[_0x0db9('0x21')]=function(_0x27797e){return request(_0x0db9('0x22'),{'body':_0x27797e});};exports[_0x0db9('0x23')]=function(_0x3b0220){return request(_0x0db9('0x24'),{'body':_[_0x0db9('0x25')](_0x3b0220,{'project_name':_0x3b0220['arg_1'],'prev_project_name':_0x3b0220[_0x0db9('0x26')]||'','is_subproject':_0x3b0220[_0x0db9('0x26')]?!![]:![],'leaveAt':moment()[_0x0db9('0x27')](_0x0db9('0x28'))})});};exports[_0x0db9('0x29')]=function(_0x2ad3e8){return request(_0x0db9('0x2a'),{'body':_0x2ad3e8});};exports[_0x0db9('0x2b')]=function(_0x33c220){return request(_0x0db9('0x2c'),{'body':_0x33c220});};exports['createCmContact']=function(_0x216dd1){return request(_0x0db9('0x2d'),{'options':{'raw':![],'where':{'phone':_0x216dd1['phone'],'ListId':_0x216dd1[_0x0db9('0x2e')]}}})['then'](function(_0x1b8880){if(_0x1b8880){return _0x1b8880;}return request(_0x0db9('0x2f'),{'body':_0x216dd1});});};exports[_0x0db9('0x30')]=function(_0x2101d0){return request('ShowPause',{'options':{'where':{'id':_0x2101d0},'attributes':[_0x0db9('0xf')]}});};exports[_0x0db9('0x31')]=function(_0x44b2dc,_0x26f59e){return request(_0x0db9('0x32'),{'body':{'interface':_0x26f59e},'options':{'where':_0x44b2dc}});};exports['agentPause']=function(_0x4eb1b9,_0x2541a3,_0x239995){return request(_0x0db9('0x33'),{'body':{'type':_0x2541a3,'uniqueid':_0x239995},'options':{'where':_0x4eb1b9}});};exports[_0x0db9('0x34')]=function(_0x234da8){return request('UnpauseUser',{'body':{},'options':{'where':_0x234da8}});};exports[_0x0db9('0x35')]=function(_0x15f78c){return request('LogoutUser',{'body':{},'options':{'where':_0x15f78c}});}; \ No newline at end of file +var _0x05f5=['agentUnpause','UnpauseUser','agentLogout','bluebird','moment','lodash','jayson/promise','client','http','request','then','error','result','getSquareProject','ShowSquareProject','production','MailServerOut','name','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','getUserById','ShowUser','ShowTrunk','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','CreateSmsMessage','createSquareReport','CreateSquareReport','merge','arg_2','createSquareMessage','createCmContact','ShowCmHopper','phone','ListId','CreateCmContact','ShowPause','agentPause'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x05f5,0xcf));var _0x505f=function(_0xc28702,_0x145b87){_0xc28702=_0xc28702-0x0;var _0x3b6e9e=_0x05f5[_0xc28702];return _0x3b6e9e;};'use strict';var BPromise=require(_0x505f('0x0'));var moment=require(_0x505f('0x1'));var _=require(_0x505f('0x2'));var util=require('util');var jayson=require(_0x505f('0x3'));var client=jayson[_0x505f('0x4')][_0x505f('0x5')]({'port':0x2329});function request(_0x32ecca,_0xbc163d){return new BPromise(function(_0xe1aa8,_0x1a3eb3){return client[_0x505f('0x6')](_0x32ecca,_0xbc163d)[_0x505f('0x7')](function(_0x1ae5ba){if(_0x1ae5ba[_0x505f('0x8')]){return _0x1a3eb3(_0x1ae5ba[_0x505f('0x8')]['message']);}else{return _0xe1aa8(_0x1ae5ba[_0x505f('0x9')]);}})['catch'](function(_0x5a9610){return _0x1a3eb3(_0x5a9610);});});}exports[_0x505f('0xa')]=function(_0x5b0b6e){return request(_0x505f('0xb'),{'options':{'raw':![],'where':{'name':_0x5b0b6e},'attributes':[_0x505f('0xc')]}});};exports['getMailAccountById']=function(_0x2cf0f4){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x2cf0f4},'include':[{'model':_0x505f('0xd'),'as':'Smtp'}],'attributes':['id',_0x505f('0xe'),_0x505f('0xf')]}});};exports[_0x505f('0x10')]=function(_0x457a1c){return request(_0x505f('0xb'),{'options':{'where':{'id':_0x457a1c},'attributes':[_0x505f('0xe')]}});};exports[_0x505f('0x11')]=function(_0x2269e4){return request(_0x505f('0x12'),{'options':{'where':{'id':_0x2269e4},'attributes':[_0x505f('0xe')]}});};exports[_0x505f('0x13')]=function(_0x4f4ce3){return request(_0x505f('0x14'),{'options':{'where':{'id':_0x4f4ce3},'attributes':[_0x505f('0xe')]}});};exports[_0x505f('0x15')]=function(_0x18c09d){return request(_0x505f('0x16'),{'options':{'where':{'id':_0x18c09d},'attributes':['dsn']}});};exports[_0x505f('0x17')]=function(_0x38fcdd){return request(_0x505f('0x18'),{'options':{'where':{'id':_0x38fcdd},'attributes':[_0x505f('0xe')]}});};exports['getTrunkById']=function(_0x203010){return request(_0x505f('0x19'),{'options':{'where':{'id':_0x203010},'attributes':['name']}});};exports[_0x505f('0x1a')]=function(_0x5d3294){return request(_0x505f('0x1b'),{'options':{'where':{'id':_0x5d3294},'attributes':[_0x505f('0x1c')]}});};exports[_0x505f('0x1d')]=function(_0x22702e){return request(_0x505f('0x1e'),{'options':{'raw':![],'where':{'id':_0x22702e},'include':[{'model':_0x505f('0x1f'),'as':_0x505f('0x20')}]}});};exports[_0x505f('0x21')]=function(_0x4e6715){return request(_0x505f('0x22'),{'options':{'where':{'id':_0x4e6715},'attributes':['id',_0x505f('0xe')]}});};exports['createSmsMessage']=function(_0x186395){return request(_0x505f('0x23'),{'body':_0x186395});};exports['createSquareDetailsReport']=function(_0x514f60){return request('CreateSquareDetailsReport',{'body':_0x514f60});};exports[_0x505f('0x24')]=function(_0x3d300d){return request(_0x505f('0x25'),{'body':_[_0x505f('0x26')](_0x3d300d,{'project_name':_0x3d300d['arg_1'],'prev_project_name':_0x3d300d[_0x505f('0x27')]||'','is_subproject':_0x3d300d[_0x505f('0x27')]?!![]:![],'leaveAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')})});};exports['createSquareRecording']=function(_0x195cbb){return request('CreateSquareRecording',{'body':_0x195cbb});};exports[_0x505f('0x28')]=function(_0x1cab37){return request('CreateSquareMessage',{'body':_0x1cab37});};exports[_0x505f('0x29')]=function(_0x23e2c9){return request(_0x505f('0x2a'),{'options':{'raw':![],'where':{'phone':_0x23e2c9[_0x505f('0x2b')],'ListId':_0x23e2c9[_0x505f('0x2c')]}}})[_0x505f('0x7')](function(_0x21c983){if(_0x21c983){return _0x21c983;}return request(_0x505f('0x2d'),{'body':_0x23e2c9});});};exports['getPauseById']=function(_0x2ca820){return request(_0x505f('0x2e'),{'options':{'where':{'id':_0x2ca820},'attributes':[_0x505f('0xe')]}});};exports['agentLogin']=function(_0x4242b0,_0x5e18cf){return request('LoginUser',{'body':{'interface':_0x5e18cf},'options':{'where':_0x4242b0}});};exports[_0x505f('0x2f')]=function(_0x5b48db,_0x3f3877,_0xf93978){return request('PauseUser',{'body':{'type':_0x3f3877,'uniqueid':_0xf93978},'options':{'where':_0x5b48db}});};exports[_0x505f('0x30')]=function(_0x44c562){return request(_0x505f('0x31'),{'body':{},'options':{'where':_0x44c562}});};exports[_0x505f('0x32')]=function(_0xbedaa1){return request('LogoutUser',{'body':{},'options':{'where':_0xbedaa1}});}; \ 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 917d582..dc9d772 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 _0xa41a=['./lex','./polly'];(function(_0x3d63bd,_0x3c2595){var _0xb937e=function(_0x2f9332){while(--_0x2f9332){_0x3d63bd['push'](_0x3d63bd['shift']());}};_0xb937e(++_0x3c2595);}(_0xa41a,0x6b));var _0xaa41=function(_0x139674,_0x49384c){_0x139674=_0x139674-0x0;var _0x2044b0=_0xa41a[_0x139674];return _0x2044b0;};var polly=require(_0xaa41('0x0'));var lex=require(_0xaa41('0x1'));module['exports']={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x54ef=['exports','./polly','./lex'];(function(_0xca67bf,_0x47e13f){var _0x17af83=function(_0x275cac){while(--_0x275cac){_0xca67bf['push'](_0xca67bf['shift']());}};_0x17af83(++_0x47e13f);}(_0x54ef,0x112));var _0xf54e=function(_0x355550,_0x49d19f){_0x355550=_0x355550-0x0;var _0x29eb52=_0x54ef[_0x355550];return _0x29eb52;};var polly=require(_0xf54e('0x0'));var lex=require(_0xf54e('0x1'));module[_0xf54e('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 8225d71..51bb5e6 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 _0xecd5=['exports'];(function(_0x3cd91d,_0x163516){var _0x3b4fab=function(_0x1b3319){while(--_0x1b3319){_0x3cd91d['push'](_0x3cd91d['shift']());}};_0x3b4fab(++_0x163516);}(_0xecd5,0x110));var _0x5ecd=function(_0x5072e7,_0x3a4cee){_0x5072e7=_0x5072e7-0x0;var _0x59a010=_0xecd5[_0x5072e7];return _0x59a010;};'use strict';var lex=require('./lib/api');module[_0x5ecd('0x0')]=function(_0x2baced,_0x1aa184,_0x4e96ee,_0x982997,_0x23f625,_0x469fd0){return lex(_0x2baced,_0x1aa184,_0x4e96ee,_0x982997,_0x23f625,_0x469fd0);}; \ No newline at end of file +var _0x7a72=['exports'];(function(_0x485f35,_0x45a0fc){var _0x2ad118=function(_0x296650){while(--_0x296650){_0x485f35['push'](_0x485f35['shift']());}};_0x2ad118(++_0x45a0fc);}(_0x7a72,0x1be));var _0x27a7=function(_0x259ec3,_0x1a150a){_0x259ec3=_0x259ec3-0x0;var _0x48ce3f=_0x7a72[_0x259ec3];return _0x48ce3f;};'use strict';var lex=require('./lib/api');module[_0x27a7('0x0')]=function(_0x2944f0,_0x47e485,_0x316bd3,_0x4b4ed5,_0x15d71f,_0x4e68c6){return lex(_0x2944f0,_0x47e485,_0x316bd3,_0x4b4ed5,_0x15d71f,_0x4e68c6);}; \ 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 e535d38..2659774 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 _0xfe70=['hasOwnProperty','slot_','exports','LexRuntime','$LATEST','bluebird','aws-sdk','slots'];(function(_0x253796,_0x4d840c){var _0x33a6c6=function(_0x2f8c18){while(--_0x2f8c18){_0x253796['push'](_0x253796['shift']());}};_0x33a6c6(++_0x4d840c);}(_0xfe70,0x195));var _0x0fe7=function(_0x313df3,_0x4fca45){_0x313df3=_0x313df3-0x0;var _0x241d59=_0xfe70[_0x313df3];return _0x241d59;};'use strict';var BPromise=require(_0x0fe7('0x0'));var AWS=require(_0x0fe7('0x1'));function lexResult(_0x20d88c,_0x58ed62){return new BPromise(function(_0xbe2880,_0x102ca2){_0x20d88c['postText'](_0x58ed62,function(_0x27d1b4,_0x9e14b4){if(_0x27d1b4){_0x102ca2(_0x27d1b4);}if(_0x9e14b4['slots']){for(const _0x38216d in _0x9e14b4[_0x0fe7('0x2')]){if(_0x9e14b4[_0x0fe7('0x2')][_0x0fe7('0x3')](_0x38216d)){var _0x32ad62=_0x9e14b4['slots'][_0x38216d];_0x9e14b4[_0x0fe7('0x4')+_0x38216d]=_0x32ad62;}}}_0xbe2880(_0x9e14b4);});});}module[_0x0fe7('0x5')]=function(_0x5737b8,_0x196488,_0x4cac95,_0x567945,_0x1750bc,_0x42b540){var _0x59b37b=new AWS[(_0x0fe7('0x6'))]({'accessKeyId':_0x196488,'secretAccessKey':_0x4cac95,'region':_0x567945});var _0x192149={'botAlias':_0x0fe7('0x7'),'botName':_0x42b540,'inputText':_0x1750bc,'userId':_0x5737b8};return lexResult(_0x59b37b,_0x192149);}; \ No newline at end of file +var _0x71a5=['$LATEST','bluebird','postText','slots','hasOwnProperty','slot_','exports','LexRuntime'];(function(_0x8e2cec,_0x5d94f8){var _0x2f843f=function(_0x445e99){while(--_0x445e99){_0x8e2cec['push'](_0x8e2cec['shift']());}};_0x2f843f(++_0x5d94f8);}(_0x71a5,0x131));var _0x571a=function(_0x1769df,_0x45b7d4){_0x1769df=_0x1769df-0x0;var _0x2ff14c=_0x71a5[_0x1769df];return _0x2ff14c;};'use strict';var BPromise=require(_0x571a('0x0'));var AWS=require('aws-sdk');function lexResult(_0x2ef87f,_0x20ed07){return new BPromise(function(_0x4ca8d3,_0x3c2c2b){_0x2ef87f[_0x571a('0x1')](_0x20ed07,function(_0x4f9df0,_0xb148fd){if(_0x4f9df0){_0x3c2c2b(_0x4f9df0);}if(_0xb148fd[_0x571a('0x2')]){for(const _0x58ec1e in _0xb148fd[_0x571a('0x2')]){if(_0xb148fd[_0x571a('0x2')][_0x571a('0x3')](_0x58ec1e)){var _0x47cc39=_0xb148fd[_0x571a('0x2')][_0x58ec1e];_0xb148fd[_0x571a('0x4')+_0x58ec1e]=_0x47cc39;}}}_0x4ca8d3(_0xb148fd);});});}module[_0x571a('0x5')]=function(_0x2aa8e1,_0xe8e085,_0x264dac,_0x19d9a5,_0x14e24d,_0x8149a8){var _0x2ce823=new AWS[(_0x571a('0x6'))]({'accessKeyId':_0xe8e085,'secretAccessKey':_0x264dac,'region':_0x19d9a5});var _0x19a776={'botAlias':_0x571a('0x7'),'botName':_0x8149a8,'inputText':_0x14e24d,'userId':_0x2aa8e1};return lexResult(_0x2ce823,_0x19a776);}; \ 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 b66cd40..3ee00c0 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 _0x84c6=['exports','./lib/api'];(function(_0xe8363c,_0x9cd46e){var _0xb5c714=function(_0x20c676){while(--_0x20c676){_0xe8363c['push'](_0xe8363c['shift']());}};_0xb5c714(++_0x9cd46e);}(_0x84c6,0xa9));var _0x684c=function(_0x428536,_0x1dc560){_0x428536=_0x428536-0x0;var _0x4bfe84=_0x84c6[_0x428536];return _0x4bfe84;};'use strict';var polly=require(_0x684c('0x0'));module[_0x684c('0x1')]=function(_0x4f9df5,_0xc40c87,_0x4a3980,_0x41a8a1,_0x123005,_0x3d7e2f,_0x12ee85){return polly(_0x4f9df5,_0xc40c87,_0x4a3980,_0x41a8a1,_0x123005,_0x3d7e2f,_0x12ee85);}; \ No newline at end of file +var _0x493d=['exports'];(function(_0x454ea9,_0x4f9868){var _0x5dbe48=function(_0x37ea31){while(--_0x37ea31){_0x454ea9['push'](_0x454ea9['shift']());}};_0x5dbe48(++_0x4f9868);}(_0x493d,0xcd));var _0xd493=function(_0x15c818,_0x22bc5a){_0x15c818=_0x15c818-0x0;var _0x26c610=_0x493d[_0x15c818];return _0x26c610;};'use strict';var polly=require('./lib/api');module[_0xd493('0x0')]=function(_0x4796b7,_0x24c77d,_0x39491a,_0x3014a9,_0x2bfad2,_0x13be8b,_0x37b4b7){return polly(_0x4796b7,_0x24c77d,_0x39491a,_0x3014a9,_0x2bfad2,_0x13be8b,_0x37b4b7);}; \ 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 e709e0e..bd77bdd 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 _0x1c26=['path','bluebird','aws-sdk','synthesizeSpeech','AudioStream','exports','Polly','text','mp3'];(function(_0x499638,_0x13681d){var _0xa3511e=function(_0x267ea0){while(--_0x267ea0){_0x499638['push'](_0x499638['shift']());}};_0xa3511e(++_0x13681d);}(_0x1c26,0xf3));var _0x61c2=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x1c26[_0x4565bf];return _0x5610ba;};'use strict';var fs=require('fs');var path=require(_0x61c2('0x0'));var BPromise=require(_0x61c2('0x1'));var rs=require('randomstring');var AWS=require(_0x61c2('0x2'));function pollyResult(_0x5057c3,_0x547516,_0x15fe1d){return new BPromise(function(_0x15f144,_0x54ecba){_0x5057c3[_0x61c2('0x3')](_0x547516,function(_0x10866c,_0x18fa6f){if(_0x10866c){_0x54ecba(_0x10866c);}else if(_0x18fa6f){if(_0x18fa6f[_0x61c2('0x4')]instanceof Buffer){fs['writeFile'](_0x15fe1d,_0x18fa6f[_0x61c2('0x4')],function(_0x644a00){if(_0x644a00){_0x54ecba(_0x644a00);}else{_0x15f144();}});}else{_0x54ecba(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x54ecba(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0x61c2('0x5')]=function(_0x17d258,_0x444637,_0x5e94a4,_0x104c8c,_0x4f8e7d,_0x396036,_0x25c06c){var _0x1f4c6d=new AWS[(_0x61c2('0x6'))]({'accessKeyId':_0x17d258,'secretAccessKey':_0x444637,'region':_0x5e94a4});var _0x12a3ea={'Text':_0x4f8e7d,'TextType':_0x396036||_0x61c2('0x7'),'OutputFormat':_0x61c2('0x8'),'VoiceId':_0x104c8c};return pollyResult(_0x1f4c6d,_0x12a3ea,_0x25c06c);}; \ No newline at end of file +var _0xc65d=['text','mp3','path','aws-sdk','synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly'];(function(_0x5e6c6b,_0x394668){var _0x14a242=function(_0x5dc425){while(--_0x5dc425){_0x5e6c6b['push'](_0x5e6c6b['shift']());}};_0x14a242(++_0x394668);}(_0xc65d,0x14c));var _0xdc65=function(_0x393369,_0x180278){_0x393369=_0x393369-0x0;var _0xc0527b=_0xc65d[_0x393369];return _0xc0527b;};'use strict';var fs=require('fs');var path=require(_0xdc65('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var AWS=require(_0xdc65('0x1'));function pollyResult(_0x5b2f71,_0x271775,_0x2e3294){return new BPromise(function(_0x39d342,_0x50766d){_0x5b2f71[_0xdc65('0x2')](_0x271775,function(_0x55b677,_0x10a0dc){if(_0x55b677){_0x50766d(_0x55b677);}else if(_0x10a0dc){if(_0x10a0dc[_0xdc65('0x3')]instanceof Buffer){fs[_0xdc65('0x4')](_0x2e3294,_0x10a0dc[_0xdc65('0x3')],function(_0x35cf68){if(_0x35cf68){_0x50766d(_0x35cf68);}else{_0x39d342();}});}else{_0x50766d(new Error(_0xdc65('0x5')));}}else{_0x50766d(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0xdc65('0x6')]=function(_0x519999,_0x4331ac,_0x1d0c4f,_0x5a525a,_0x3b1e64,_0x261df9,_0x2c77ea){var _0x1846e4=new AWS[(_0xdc65('0x7'))]({'accessKeyId':_0x519999,'secretAccessKey':_0x4331ac,'region':_0x1d0c4f});var _0x5a4806={'Text':_0x3b1e64,'TextType':_0x261df9||_0xdc65('0x8'),'OutputFormat':_0xdc65('0x9'),'VoiceId':_0x5a525a};return pollyResult(_0x1846e4,_0x5a4806,_0x2c77ea);}; \ 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 7fbd881..f4e8560 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 _0xc13a=['./lib/api','exports'];(function(_0x51ab83,_0x2721b9){var _0x14b6de=function(_0x243483){while(--_0x243483){_0x51ab83['push'](_0x51ab83['shift']());}};_0x14b6de(++_0x2721b9);}(_0xc13a,0x18e));var _0xac13=function(_0x41768c,_0x1b2884){_0x41768c=_0x41768c-0x0;var _0x3ab8c0=_0xc13a[_0x41768c];return _0x3ab8c0;};'use strict';var asr=require(_0xac13('0x0'));module[_0xac13('0x1')]=function(_0x37f291,_0x2da258,_0xab1f56,_0x1993b2){return asr(_0x37f291,_0x2da258,_0xab1f56);}; \ No newline at end of file +var _0x52f4=['exports','./lib/api'];(function(_0x4697fa,_0x21c841){var _0x390950=function(_0x3deb8a){while(--_0x3deb8a){_0x4697fa['push'](_0x4697fa['shift']());}};_0x390950(++_0x21c841);}(_0x52f4,0x107));var _0x452f=function(_0x2a3eb0,_0x46ec9f){_0x2a3eb0=_0x2a3eb0-0x0;var _0x3f19e7=_0x52f4[_0x2a3eb0];return _0x3f19e7;};'use strict';var asr=require(_0x452f('0x0'));module[_0x452f('0x1')]=function(_0x41e12b,_0x5780aa,_0x139c3d,_0x3f67a1){return asr(_0x41e12b,_0x5780aa,_0x139c3d);}; \ 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 ab4e53f..0ef759d 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 _0x56a8=['url','bluebird','https://speech.googleapis.com','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','readFileSync','toString','POST','LINEAR16','8000'];(function(_0x342782,_0x4236e0){var _0xadb50c=function(_0x33ff6f){while(--_0x33ff6f){_0x342782['push'](_0x342782['shift']());}};_0xadb50c(++_0x4236e0);}(_0x56a8,0xe7));var _0x856a=function(_0x23227c,_0xa84de8){_0x23227c=_0x23227c-0x0;var _0x1947c2=_0x56a8[_0x23227c];return _0x1947c2;};'use strict';var url=require(_0x856a('0x0'));var BPromise=require(_0x856a('0x1'));var fs=require('fs');var host=_0x856a('0x2');module['exports']=function(_0x4d9d0d,_0x2b4264,_0x40f438){return new BPromise(function(_0x34cf25,_0x23a395){var _0x279c80;if(typeof _0x4d9d0d!=='string'||_0x4d9d0d[_0x856a('0x3')]===0x0){return _0x23a395(_0x856a('0x4'));}if(typeof _0x2b4264!=='string'||_0x2b4264['length']===0x0){return _0x23a395(_0x856a('0x5'));}if(typeof _0x40f438!=='undefined'&&(typeof _0x40f438!=='string'||_0x40f438[_0x856a('0x3')]===0x0)){return _0x23a395('lang\x20should\x20be\x20a\x20string');}try{_0x279c80=fs[_0x856a('0x6')](_0x4d9d0d)[_0x856a('0x7')]('base64');}catch(_0x156f9b){return _0x23a395(_0x156f9b);}return _0x34cf25({'method':_0x856a('0x8'),'uri':host+'/v1/speech:recognize?key='+_0x2b4264,'body':{'config':{'encoding':_0x856a('0x9'),'sampleRateHertz':_0x856a('0xa'),'languageCode':_0x40f438},'audio':{'content':_0x279c80}},'json':!![]});});}; \ No newline at end of file +var _0x5290=['bluebird','exports','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','toString','base64','/v1/speech:recognize?key=','LINEAR16','url'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x5290,0x14f));var _0x0529=function(_0x2faa2c,_0x5b0aa0){_0x2faa2c=_0x2faa2c-0x0;var _0xfce15f=_0x5290[_0x2faa2c];return _0xfce15f;};'use strict';var url=require(_0x0529('0x0'));var BPromise=require(_0x0529('0x1'));var fs=require('fs');var host='https://speech.googleapis.com';module[_0x0529('0x2')]=function(_0x54e855,_0x2efdc1,_0x19e9c4){return new BPromise(function(_0x1b33e5,_0x2a6542){var _0x1ecbc2;if(typeof _0x54e855!==_0x0529('0x3')||_0x54e855[_0x0529('0x4')]===0x0){return _0x2a6542(_0x0529('0x5'));}if(typeof _0x2efdc1!==_0x0529('0x3')||_0x2efdc1[_0x0529('0x4')]===0x0){return _0x2a6542(_0x0529('0x6'));}if(typeof _0x19e9c4!==_0x0529('0x7')&&(typeof _0x19e9c4!==_0x0529('0x3')||_0x19e9c4['length']===0x0)){return _0x2a6542('lang\x20should\x20be\x20a\x20string');}try{_0x1ecbc2=fs['readFileSync'](_0x54e855)[_0x0529('0x8')](_0x0529('0x9'));}catch(_0x2c6818){return _0x2a6542(_0x2c6818);}return _0x1b33e5({'method':'POST','uri':host+_0x0529('0xa')+_0x2efdc1,'body':{'config':{'encoding':_0x0529('0xb'),'sampleRateHertz':'8000','languageCode':_0x19e9c4},'audio':{'content':_0x1ecbc2}},'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 6fc05a5..59e36f2 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 _0xd9ee=['./asr'];(function(_0x3d06b9,_0x27e455){var _0x331615=function(_0x3cc50f){while(--_0x3cc50f){_0x3d06b9['push'](_0x3d06b9['shift']());}};_0x331615(++_0x27e455);}(_0xd9ee,0x9f));var _0xed9e=function(_0xfbc414,_0x28e194){_0xfbc414=_0xfbc414-0x0;var _0x13b07a=_0xd9ee[_0xfbc414];return _0x13b07a;};var asr=require(_0xed9e('0x0'));module['exports']={'asr':asr}; \ No newline at end of file +var _0xb1b4=['exports','./asr'];(function(_0x4f96b8,_0x2cffb9){var _0x5524ca=function(_0x874542){while(--_0x874542){_0x4f96b8['push'](_0x4f96b8['shift']());}};_0x5524ca(++_0x2cffb9);}(_0xb1b4,0x175));var _0x4b1b=function(_0x1f38c6,_0x428650){_0x1f38c6=_0x1f38c6-0x0;var _0x259367=_0xb1b4[_0x1f38c6];return _0x259367;};var asr=require(_0x4b1b('0x0'));module[_0x4b1b('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 869e724..7469b10 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 _0xe272=['sox','request-promise','util','querystring','google-tts-api','apiai-promise','md5','./google','./aws','./tilde','./sestek','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','host','path','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','close','unlink','download\x20error','pipe','WHAT_EVER','data','end','wav','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','writeFileSync','then','chmodSync','777','split','readFileSync','toString','https://texttospeech.googleapis.com/v1/','ssml','input','voice','audioConfig','text:synthesize','POST','audioContent','base64','writeFile','googleCloudTTS\x20path','.mp3','goggleTTS\x20path','googleASR','asr','uri','results','map','alternatives','transcript','confidence','googleASR\x20confidence','name','message','textRequest','stringify','result','resolvedQuery','action','fulfillment','speech','score','status','code','endConversation','metadata','isFallbackIntent','tildeASR','Tilde\x20ASR\x20confidence','polly','awsLex','lex','ispeechTTS','format','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','sestekNDA','nda','channelData','CustomAction','CustomActionData','http','https','url','parse','bluebird','randomstring'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xe272,0x138));var _0x2e27=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xe272[_0x4243a3];return _0x1b2a33;};'use strict';var fs=require('fs');var path=require('path');var http=require(_0x2e27('0x0'));var https=require(_0x2e27('0x1'));var urlParse=require(_0x2e27('0x2'))[_0x2e27('0x3')];var BPromise=require(_0x2e27('0x4'));var rs=require(_0x2e27('0x5'));var sox=require(_0x2e27('0x6'));var rp=require(_0x2e27('0x7'));var util=require(_0x2e27('0x8'));var querystring=require(_0x2e27('0x9'));var moment=require('moment');var tts=require(_0x2e27('0xa'));var apiai=require(_0x2e27('0xb'));var md5=require(_0x2e27('0xc'));var google=require(_0x2e27('0xd'));var aws=require(_0x2e27('0xe'));var tilde=require(_0x2e27('0xf'));var sestek=require(_0x2e27('0x10'));var logger=require(_0x2e27('0x11'))(_0x2e27('0x12'));var ISPEECH_API=_0x2e27('0x13');function downloadFile(_0x5ef9b6,_0x44b9c4){return new BPromise(function(_0x18fe49,_0x12335e){var _0x1ee3fd=urlParse(_0x5ef9b6);var _0x3e9f6e=_0x1ee3fd[_0x2e27('0x14')]===_0x2e27('0x15')?https:http;var _0x4f8727={'host':_0x1ee3fd[_0x2e27('0x16')],'path':_0x1ee3fd[_0x2e27('0x17')],'headers':{'user-agent':'WHAT_EVER'}};_0x3e9f6e[_0x2e27('0x18')](_0x4f8727,function(_0x313c36){if(_0x313c36[_0x2e27('0x19')]!==0xc8){logger[_0x2e27('0x1a')](_0x2e27('0x1b')+_0x5ef9b6+_0x2e27('0x1c')+_0x313c36[_0x2e27('0x19')]+'\x20('+_0x313c36['statusMessage']+')');_0x12335e(new Error(_0x2e27('0x1b')+_0x5ef9b6+_0x2e27('0x1c')+_0x313c36[_0x2e27('0x19')]+'\x20('+_0x313c36[_0x2e27('0x1d')]+')'));return;}var _0x18d778=fs[_0x2e27('0x1e')](_0x44b9c4);_0x18d778['on'](_0x2e27('0x1f'),function(){logger[_0x2e27('0x20')]('finish\x20download\x20file');_0x18d778[_0x2e27('0x21')](_0x18fe49);});_0x18d778['on'](_0x2e27('0x1a'),function(_0x44e6f8){fs[_0x2e27('0x22')](_0x44b9c4);logger['error'](_0x2e27('0x23'),_0x44e6f8);_0x12335e(_0x44e6f8);});_0x313c36[_0x2e27('0x24')](_0x18d778);})['on'](_0x2e27('0x1a'),function(_0x716e19){logger['error'](_0x716e19);_0x12335e(_0x716e19);})['end']();});}function uploadFile(_0x1e0a5b){return new BPromise(function(_0x105aca,_0x5bed4d){var _0xf8cfb=urlParse(_0x1e0a5b);var _0x4b9d4f=_0xf8cfb[_0x2e27('0x14')]==='https:'?https:http;var _0x1ce008={'host':_0xf8cfb[_0x2e27('0x16')],'path':_0xf8cfb[_0x2e27('0x17')],'headers':{'user-agent':_0x2e27('0x25')}};_0x4b9d4f[_0x2e27('0x18')](_0x1ce008,function(_0x53e8be){if(_0x53e8be['statusCode']!==0xc8){_0x5bed4d(new Error('request\x20to\x20'+_0x1e0a5b+_0x2e27('0x1c')+_0x53e8be['statusCode']+'\x20('+_0x53e8be['statusMessage']+')'));return;}var _0x2d7d3c='';_0x53e8be['on'](_0x2e27('0x26'),function(_0x57df5e){_0x2d7d3c+=_0x57df5e;});_0x53e8be['on'](_0x2e27('0x27'),function(){_0x105aca(_0x2d7d3c);});})['on']('error',function(_0xd16379){_0x5bed4d(_0xd16379);})['end']();});}function convertFile(_0x46caa3,_0x237181){return new BPromise(function(_0x47b237,_0x3446a1){var _0x1dde3e=sox['transcode'](_0x46caa3,_0x237181,{'sampleRate':0x1f40,'format':_0x2e27('0x28'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x1dde3e['on']('error',function(_0xf8afde){logger[_0x2e27('0x1a')]('error\x20convert',_0xf8afde);_0x3446a1(_0xf8afde);});_0x1dde3e['on'](_0x2e27('0x27'),function(){logger['info'](_0x2e27('0x29'));_0x47b237();});_0x1dde3e[_0x2e27('0x2a')]();});}function base64Decode(_0x35a3ba,_0xb5b19d){var _0x4e2a45=path[_0x2e27('0x2b')](__dirname,_0x2e27('0x2c'),rs[_0x2e27('0x2d')](0x4)+_0x2e27('0x2e'));fs[_0x2e27('0x2f')](_0x4e2a45,_0x35a3ba,'base64');return convertFile(_0x4e2a45,_0xb5b19d)[_0x2e27('0x30')](function(){try{fs[_0x2e27('0x22')](_0x4e2a45);fs[_0x2e27('0x31')](_0xb5b19d,_0x2e27('0x32'));}catch(_0x53dda6){logger[_0x2e27('0x1a')](_0x53dda6);}return _0xb5b19d[_0x2e27('0x33')]('.')[0x0];});}function base64Encode(_0x3d210b){var _0x2f3c02=fs[_0x2e27('0x34')](_0x3d210b);return new Buffer(_0x2f3c02)[_0x2e27('0x35')]('base64');}exports['googleCloudTTS']=function(_0x25d22e,_0x98f25a,_0x4b6600,_0xcce87b,_0x2a87ea,_0x250234){var _0x3cc447,_0x5a5f3c;var _0x77e9f7=_0x2e27('0x36');var _0x20e492='?key='+_0x25d22e;var _0x43bb21={};if(_0x98f25a===_0x2e27('0x37')){_0x43bb21[_0x2e27('0x38')]={'ssml':_0x4b6600};}else{_0x43bb21['input']={'text':_0x4b6600};};_0x43bb21[_0x2e27('0x39')]={'languageCode':_0xcce87b,'ssmlGender':_0x2a87ea};_0x43bb21[_0x2e27('0x3a')]={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x5ca2e9={'url':_0x77e9f7+_0x2e27('0x3b')+_0x20e492,'method':_0x2e27('0x3c'),'json':!![],'body':_0x43bb21};return rp(_0x5ca2e9)[_0x2e27('0x30')](function(_0x3d67ba){return new BPromise(function(_0x2c2f1c,_0xc45cdf){_0x3cc447=path['resolve'](__dirname,_0x2e27('0x2c'),rs[_0x2e27('0x2d')](0x4)+'.mp3');var _0x5178d2=Buffer['from'](_0x3d67ba[_0x2e27('0x3d')],_0x2e27('0x3e'));return fs[_0x2e27('0x3f')](_0x3cc447,_0x5178d2,function(_0x5f8ca9){_0xc45cdf(_0x5f8ca9);},function(_0x2d5a6f){fs['chmodSync'](_0x3cc447,_0x2e27('0x32'));_0x2c2f1c(_0x2d5a6f);});});})[_0x2e27('0x30')](function(_0x58c212){_0x5a5f3c=path[_0x2e27('0x2b')](__dirname,_0x2e27('0x2c'),rs[_0x2e27('0x2d')](0x4)+_0x2e27('0x2e'));return convertFile(_0x3cc447,_0x5a5f3c);})['then'](function(){try{fs[_0x2e27('0x22')](_0x3cc447);fs[_0x2e27('0x31')](_0x5a5f3c,_0x2e27('0x32'));}catch(_0x3c0a1c){logger[_0x2e27('0x1a')](_0x3c0a1c);}logger[_0x2e27('0x20')](_0x2e27('0x40'),_0x5a5f3c[_0x2e27('0x33')]('.')[0x0]);return _0x5a5f3c[_0x2e27('0x33')]('.')[0x0];});};exports['googleTTS']=function(_0x403906,_0x4d7608){var _0x18942d,_0x4fb6d3;return tts(_0x403906,_0x4d7608||'en',0x1)['then'](function(_0x567fcc){logger['info'](_0x567fcc);_0x18942d=path[_0x2e27('0x2b')](__dirname,_0x2e27('0x2c'),rs[_0x2e27('0x2d')](0x4)+_0x2e27('0x41'));return downloadFile(_0x567fcc,_0x18942d);})[_0x2e27('0x30')](function(){_0x4fb6d3=path[_0x2e27('0x2b')](__dirname,_0x2e27('0x2c'),rs[_0x2e27('0x2d')](0x4)+_0x2e27('0x2e'));return convertFile(_0x18942d,_0x4fb6d3);})['then'](function(){try{fs[_0x2e27('0x22')](_0x18942d);fs[_0x2e27('0x31')](_0x4fb6d3,_0x2e27('0x32'));}catch(_0x27860c){logger['error'](_0x27860c);}logger[_0x2e27('0x20')](_0x2e27('0x42'),_0x4fb6d3['split']('.')[0x0]);return _0x4fb6d3[_0x2e27('0x33')]('.')[0x0];});};exports[_0x2e27('0x43')]=function(_0x1a0fbc,_0x3756a6,_0x18104e){return google[_0x2e27('0x44')](_0x1a0fbc,_0x3756a6,_0x18104e)['then'](function(_0x304c7a){logger[_0x2e27('0x20')](_0x304c7a[_0x2e27('0x45')]);return rp(_0x304c7a);})[_0x2e27('0x30')](function(_0x34b34e){var _0x246128='';var _0xdded8d=0x0;try{fs[_0x2e27('0x22')](_0x1a0fbc);}catch(_0x4a0ee3){logger[_0x2e27('0x1a')](_0x4a0ee3);}if(_0x34b34e&&_0x34b34e[_0x2e27('0x46')]){_0x246128=_0x34b34e['results'][_0x2e27('0x47')](function(_0xa218a1){return _0xa218a1&&_0xa218a1[_0x2e27('0x48')][0x0]&&_0xa218a1[_0x2e27('0x48')][0x0]['transcript']?_0xa218a1['alternatives'][0x0][_0x2e27('0x49')]:'';})['join']('\x0a');_0xdded8d=_0x34b34e[_0x2e27('0x46')][_0x2e27('0x47')](function(_0x35d39d){return _0x35d39d&&_0x35d39d[_0x2e27('0x48')][0x0]&&_0x35d39d[_0x2e27('0x48')][0x0][_0x2e27('0x4a')]?_0x35d39d[_0x2e27('0x48')][0x0][_0x2e27('0x4a')]:0x0;})['join']('\x0a');}logger[_0x2e27('0x20')]('googleASR\x20transcription',_0x246128);logger[_0x2e27('0x20')](_0x2e27('0x4b'),_0xdded8d);return{'transcript':_0x246128,'confidence':_0xdded8d};})['catch'](function(_0x1b48a3){logger[_0x2e27('0x1a')]('[%s]\x20%s:%s',_0x1b48a3['statusCode'],_0x1b48a3[_0x2e27('0x4c')],_0x1b48a3[_0x2e27('0x4d')]);});};exports['googleDialogflow']=function(_0x4330cc,_0x1e16bc,_0x49045f,_0x2a3bac){var _0x17ff0c=apiai(_0x1e16bc,{'language':_0x2a3bac||'en'});return _0x17ff0c[_0x2e27('0x4e')](_0x49045f,{'sessionId':md5(_0x4330cc)})['then'](function(_0x574ab4){logger[_0x2e27('0x20')](JSON[_0x2e27('0x4f')](_0x574ab4));return{'source':_0x574ab4[_0x2e27('0x50')]['source'],'resolvedQuery':_0x574ab4[_0x2e27('0x50')][_0x2e27('0x51')],'action':_0x574ab4[_0x2e27('0x50')][_0x2e27('0x52')],'actionIncomplete':_0x574ab4[_0x2e27('0x50')]['actionIncomplete'],'speech':_0x574ab4[_0x2e27('0x50')][_0x2e27('0x53')][_0x2e27('0x54')],'score':_0x574ab4['result'][_0x2e27('0x55')],'statusCode':_0x574ab4[_0x2e27('0x56')][_0x2e27('0x57')],'endConversation':_0x574ab4[_0x2e27('0x50')]['metadata'][_0x2e27('0x58')]||![],'isFallbackIntent':_0x574ab4['result'][_0x2e27('0x59')][_0x2e27('0x5a')]};});};exports[_0x2e27('0x5b')]=function(_0x38927a,_0x3801aa,_0x30ac94,_0xba0b70){return tilde['asr'](_0x38927a,_0x3801aa,_0x30ac94,_0xba0b70)[_0x2e27('0x30')](function(_0x35ba33){try{fs['unlink'](_0x38927a);}catch(_0x5c1c42){logger[_0x2e27('0x1a')](_0x5c1c42);}logger[_0x2e27('0x20')]('Tilde\x20ASR\x20transcription',_0x35ba33['transcript']);logger[_0x2e27('0x20')](_0x2e27('0x5c'),_0x35ba33[_0x2e27('0x4a')]);return _0x35ba33;});};exports['awsPolly']=function(_0x180996,_0x4e24e6,_0x53a2f0,_0x4c1f6f,_0x5bacd7,_0x505b9e){var _0x55c799=path[_0x2e27('0x2b')](__dirname,_0x2e27('0x2c'),rs[_0x2e27('0x2d')](0x4)+_0x2e27('0x41'));var _0x3793fe;return aws[_0x2e27('0x5d')](_0x180996,_0x4e24e6,_0x53a2f0,_0x4c1f6f,_0x5bacd7,_0x505b9e,_0x55c799)['then'](function(){_0x3793fe=path[_0x2e27('0x2b')](__dirname,_0x2e27('0x2c'),rs[_0x2e27('0x2d')](0x4)+_0x2e27('0x2e'));return convertFile(_0x55c799,_0x3793fe);})['then'](function(){try{fs[_0x2e27('0x22')](_0x55c799);fs[_0x2e27('0x31')](_0x3793fe,_0x2e27('0x32'));}catch(_0x2d0a39){logger[_0x2e27('0x1a')](_0x2d0a39);}return _0x3793fe[_0x2e27('0x33')]('.')[0x0];});};exports[_0x2e27('0x5e')]=function(_0x549da6,_0x197540,_0x58ca55,_0x3ff2b8,_0x6c773d,_0x57c5e0){return aws[_0x2e27('0x5f')](_0x549da6,_0x197540,_0x58ca55,_0x3ff2b8,_0x6c773d,_0x57c5e0)[_0x2e27('0x30')](function(_0x567397){logger[_0x2e27('0x20')](JSON[_0x2e27('0x4f')](_0x567397));return _0x567397;});};exports[_0x2e27('0x60')]=function(_0x14d3f9,_0x34a12d,_0x1fe3c8,_0x32de2b){var _0x4f4f66=util[_0x2e27('0x61')]('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x14d3f9,encodeURIComponent(_0x34a12d),_0x1fe3c8,_0x32de2b);var _0xbec213=path['resolve'](__dirname,_0x2e27('0x2c'),rs[_0x2e27('0x2d')](0x4)+'.mp3');var _0x500bbb;return downloadFile(_0x4f4f66,_0xbec213)[_0x2e27('0x30')](function(){_0x500bbb=path[_0x2e27('0x2b')](__dirname,_0x2e27('0x2c'),rs[_0x2e27('0x2d')](0x4)+_0x2e27('0x2e'));return convertFile(_0xbec213,_0x500bbb);})[_0x2e27('0x30')](function(){try{fs[_0x2e27('0x22')](_0xbec213);fs['chmodSync'](_0x500bbb,_0x2e27('0x32'));}catch(_0x262255){logger['error'](_0x262255);}return _0x500bbb[_0x2e27('0x33')]('.')[0x0];});};exports[_0x2e27('0x62')]=function(_0x472763,_0x28b9bd,_0x1f021e,_0x2101f1){var _0x5efc69=util[_0x2e27('0x61')](_0x2e27('0x63'),ISPEECH_API,_0x28b9bd,_0x1f021e,base64Encode(_0x472763),_0x2101f1?util[_0x2e27('0x61')](_0x2e27('0x64'),encodeURIComponent(_0x2101f1)):'freeform=3');return uploadFile(_0x5efc69)['then'](function(_0x573b95){return querystring[_0x2e27('0x3')](_0x573b95);});};exports[_0x2e27('0x65')]=function(_0x1b9a53,_0x555109){return sestek[_0x2e27('0x66')](_0x1b9a53,_0x555109)[_0x2e27('0x30')](function(_0x19a3da){logger['info'](JSON[_0x2e27('0x4f')](_0x19a3da));var _0x128014={'speech':_0x19a3da['text'],'action':_0x19a3da[_0x2e27('0x67')]?_0x19a3da['channelData'][_0x2e27('0x68')]:undefined,'actiondata':_0x19a3da['channelData']?_0x19a3da[_0x2e27('0x67')][_0x2e27('0x69')]:undefined};if(_0x19a3da['channelData']&&_0x19a3da[_0x2e27('0x67')]['AudioFromTts']){return base64Decode(_0x19a3da[_0x2e27('0x67')]['AudioFromTts']['Data'],path[_0x2e27('0x2b')](__dirname,_0x2e27('0x2c'),rs[_0x2e27('0x2d')](0x4)+_0x2e27('0x2e')))[_0x2e27('0x30')](function(_0x2e2195){_0x128014['audiofile']=_0x2e2195;return _0x128014;});}return _0x128014;});};exports['dirName']=function(){return __dirname;}; \ No newline at end of file +var _0x0090=['text','channelData','CustomAction','AudioFromTts','Data','dirName','path','http','https','bluebird','randomstring','sox','request-promise','querystring','google-tts-api','apiai-promise','md5','./google','./tilde','./sestek','../../../config/logger','https://api.ispeech.org/api/rest','protocol','https:','WHAT_EVER','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','finish','finish\x20download\x20file','close','unlink','download\x20error','end','host','transcode','wav','start','resolve','tmp','generate','.wav','writeFileSync','base64','chmodSync','777','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','audioConfig','text:synthesize','then','.mp3','audioContent','writeFile','split','info','googleASR','asr','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','stringify','result','source','resolvedQuery','actionIncomplete','fulfillment','speech','score','status','code','metadata','endConversation','isFallbackIntent','Tilde\x20ASR\x20confidence','awsPolly','polly','ispeechTTS','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','format','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','parse','sestekNDA','nda'];(function(_0x53278c,_0x43f099){var _0x1e7980=function(_0x26258c){while(--_0x26258c){_0x53278c['push'](_0x53278c['shift']());}};_0x1e7980(++_0x43f099);}(_0x0090,0x70));var _0x0009=function(_0x1cd39b,_0x268193){_0x1cd39b=_0x1cd39b-0x0;var _0x181945=_0x0090[_0x1cd39b];return _0x181945;};'use strict';var fs=require('fs');var path=require(_0x0009('0x0'));var http=require(_0x0009('0x1'));var https=require(_0x0009('0x2'));var urlParse=require('url')['parse'];var BPromise=require(_0x0009('0x3'));var rs=require(_0x0009('0x4'));var sox=require(_0x0009('0x5'));var rp=require(_0x0009('0x6'));var util=require('util');var querystring=require(_0x0009('0x7'));var moment=require('moment');var tts=require(_0x0009('0x8'));var apiai=require(_0x0009('0x9'));var md5=require(_0x0009('0xa'));var google=require(_0x0009('0xb'));var aws=require('./aws');var tilde=require(_0x0009('0xc'));var sestek=require(_0x0009('0xd'));var logger=require(_0x0009('0xe'))('agi');var ISPEECH_API=_0x0009('0xf');function downloadFile(_0x3d11b1,_0x2b2a08){return new BPromise(function(_0x5d6140,_0x3fc8a5){var _0x513803=urlParse(_0x3d11b1);var _0x2acf95=_0x513803[_0x0009('0x10')]===_0x0009('0x11')?https:http;var _0x432740={'host':_0x513803['host'],'path':_0x513803[_0x0009('0x0')],'headers':{'user-agent':_0x0009('0x12')}};_0x2acf95[_0x0009('0x13')](_0x432740,function(_0x2d580b){if(_0x2d580b[_0x0009('0x14')]!==0xc8){logger[_0x0009('0x15')](_0x0009('0x16')+_0x3d11b1+_0x0009('0x17')+_0x2d580b[_0x0009('0x14')]+'\x20('+_0x2d580b[_0x0009('0x18')]+')');_0x3fc8a5(new Error(_0x0009('0x16')+_0x3d11b1+'\x20failed,\x20status\x20code\x20=\x20'+_0x2d580b[_0x0009('0x14')]+'\x20('+_0x2d580b[_0x0009('0x18')]+')'));return;}var _0x46440c=fs['createWriteStream'](_0x2b2a08);_0x46440c['on'](_0x0009('0x19'),function(){logger['info'](_0x0009('0x1a'));_0x46440c[_0x0009('0x1b')](_0x5d6140);});_0x46440c['on'](_0x0009('0x15'),function(_0x52d02f){fs[_0x0009('0x1c')](_0x2b2a08);logger[_0x0009('0x15')](_0x0009('0x1d'),_0x52d02f);_0x3fc8a5(_0x52d02f);});_0x2d580b['pipe'](_0x46440c);})['on'](_0x0009('0x15'),function(_0x2cd7b0){logger[_0x0009('0x15')](_0x2cd7b0);_0x3fc8a5(_0x2cd7b0);})[_0x0009('0x1e')]();});}function uploadFile(_0x41b90a){return new BPromise(function(_0x3e730f,_0x1adae9){var _0x20219f=urlParse(_0x41b90a);var _0x574336=_0x20219f[_0x0009('0x10')]===_0x0009('0x11')?https:http;var _0x1775bb={'host':_0x20219f[_0x0009('0x1f')],'path':_0x20219f[_0x0009('0x0')],'headers':{'user-agent':_0x0009('0x12')}};_0x574336[_0x0009('0x13')](_0x1775bb,function(_0x134fe7){if(_0x134fe7[_0x0009('0x14')]!==0xc8){_0x1adae9(new Error(_0x0009('0x16')+_0x41b90a+_0x0009('0x17')+_0x134fe7[_0x0009('0x14')]+'\x20('+_0x134fe7[_0x0009('0x18')]+')'));return;}var _0x554d0b='';_0x134fe7['on']('data',function(_0x224e70){_0x554d0b+=_0x224e70;});_0x134fe7['on'](_0x0009('0x1e'),function(){_0x3e730f(_0x554d0b);});})['on'](_0x0009('0x15'),function(_0x289868){_0x1adae9(_0x289868);})[_0x0009('0x1e')]();});}function convertFile(_0x980ef,_0x4796bf){return new BPromise(function(_0xc8f95a,_0x4f50c7){var _0xdcaedb=sox[_0x0009('0x20')](_0x980ef,_0x4796bf,{'sampleRate':0x1f40,'format':_0x0009('0x21'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0xdcaedb['on'](_0x0009('0x15'),function(_0x4ddc9d){logger[_0x0009('0x15')]('error\x20convert',_0x4ddc9d);_0x4f50c7(_0x4ddc9d);});_0xdcaedb['on'](_0x0009('0x1e'),function(){logger['info']('finish\x20to\x20convert');_0xc8f95a();});_0xdcaedb[_0x0009('0x22')]();});}function base64Decode(_0x4c6452,_0x44e9ae){var _0x45710d=path[_0x0009('0x23')](__dirname,_0x0009('0x24'),rs[_0x0009('0x25')](0x4)+_0x0009('0x26'));fs[_0x0009('0x27')](_0x45710d,_0x4c6452,_0x0009('0x28'));return convertFile(_0x45710d,_0x44e9ae)['then'](function(){try{fs['unlink'](_0x45710d);fs[_0x0009('0x29')](_0x44e9ae,_0x0009('0x2a'));}catch(_0x2c915a){logger[_0x0009('0x15')](_0x2c915a);}return _0x44e9ae['split']('.')[0x0];});}function base64Encode(_0x53277d){var _0x40f56e=fs[_0x0009('0x2b')](_0x53277d);return new Buffer(_0x40f56e)[_0x0009('0x2c')](_0x0009('0x28'));}exports[_0x0009('0x2d')]=function(_0x4285f8,_0x8d291b,_0x36efb5,_0x323726,_0x46fce2,_0x552f6c){var _0x34e3d0,_0x3518a0;var _0x4168d6=_0x0009('0x2e');var _0x4661b6=_0x0009('0x2f')+_0x4285f8;var _0x51f20d={};if(_0x8d291b===_0x0009('0x30')){_0x51f20d[_0x0009('0x31')]={'ssml':_0x36efb5};}else{_0x51f20d[_0x0009('0x31')]={'text':_0x36efb5};};_0x51f20d['voice']={'languageCode':_0x323726,'ssmlGender':_0x46fce2};_0x51f20d[_0x0009('0x32')]={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x150334={'url':_0x4168d6+_0x0009('0x33')+_0x4661b6,'method':'POST','json':!![],'body':_0x51f20d};return rp(_0x150334)[_0x0009('0x34')](function(_0x2e48ae){return new BPromise(function(_0x1c50b0,_0x50e6e0){_0x34e3d0=path[_0x0009('0x23')](__dirname,_0x0009('0x24'),rs[_0x0009('0x25')](0x4)+_0x0009('0x35'));var _0x44e88f=Buffer['from'](_0x2e48ae[_0x0009('0x36')],_0x0009('0x28'));return fs[_0x0009('0x37')](_0x34e3d0,_0x44e88f,function(_0x2e7750){_0x50e6e0(_0x2e7750);},function(_0xe2e7f3){fs[_0x0009('0x29')](_0x34e3d0,'777');_0x1c50b0(_0xe2e7f3);});});})[_0x0009('0x34')](function(_0x52116b){_0x3518a0=path[_0x0009('0x23')](__dirname,_0x0009('0x24'),rs[_0x0009('0x25')](0x4)+_0x0009('0x26'));return convertFile(_0x34e3d0,_0x3518a0);})[_0x0009('0x34')](function(){try{fs[_0x0009('0x1c')](_0x34e3d0);fs['chmodSync'](_0x3518a0,_0x0009('0x2a'));}catch(_0x20dc22){logger[_0x0009('0x15')](_0x20dc22);}logger['info']('googleCloudTTS\x20path',_0x3518a0[_0x0009('0x38')]('.')[0x0]);return _0x3518a0[_0x0009('0x38')]('.')[0x0];});};exports['googleTTS']=function(_0x3407e9,_0x668436){var _0x439e4d,_0x47514b;return tts(_0x3407e9,_0x668436||'en',0x1)[_0x0009('0x34')](function(_0x6aab12){logger[_0x0009('0x39')](_0x6aab12);_0x439e4d=path[_0x0009('0x23')](__dirname,_0x0009('0x24'),rs['generate'](0x4)+_0x0009('0x35'));return downloadFile(_0x6aab12,_0x439e4d);})[_0x0009('0x34')](function(){_0x47514b=path[_0x0009('0x23')](__dirname,_0x0009('0x24'),rs[_0x0009('0x25')](0x4)+_0x0009('0x26'));return convertFile(_0x439e4d,_0x47514b);})[_0x0009('0x34')](function(){try{fs['unlink'](_0x439e4d);fs[_0x0009('0x29')](_0x47514b,_0x0009('0x2a'));}catch(_0x53cc97){logger[_0x0009('0x15')](_0x53cc97);}logger[_0x0009('0x39')]('goggleTTS\x20path',_0x47514b[_0x0009('0x38')]('.')[0x0]);return _0x47514b[_0x0009('0x38')]('.')[0x0];});};exports[_0x0009('0x3a')]=function(_0x145b45,_0x6313a7,_0x57a2e5){return google[_0x0009('0x3b')](_0x145b45,_0x6313a7,_0x57a2e5)[_0x0009('0x34')](function(_0x5a58f9){logger[_0x0009('0x39')](_0x5a58f9['uri']);return rp(_0x5a58f9);})[_0x0009('0x34')](function(_0x44fa9a){var _0x1f6aa2='';var _0x4f76aa=0x0;try{fs['unlink'](_0x145b45);}catch(_0x423cb){logger[_0x0009('0x15')](_0x423cb);}if(_0x44fa9a&&_0x44fa9a[_0x0009('0x3c')]){_0x1f6aa2=_0x44fa9a[_0x0009('0x3c')][_0x0009('0x3d')](function(_0x27489b){return _0x27489b&&_0x27489b[_0x0009('0x3e')][0x0]&&_0x27489b[_0x0009('0x3e')][0x0][_0x0009('0x3f')]?_0x27489b[_0x0009('0x3e')][0x0][_0x0009('0x3f')]:'';})[_0x0009('0x40')]('\x0a');_0x4f76aa=_0x44fa9a[_0x0009('0x3c')][_0x0009('0x3d')](function(_0x116e24){return _0x116e24&&_0x116e24[_0x0009('0x3e')][0x0]&&_0x116e24['alternatives'][0x0]['confidence']?_0x116e24[_0x0009('0x3e')][0x0][_0x0009('0x41')]:0x0;})[_0x0009('0x40')]('\x0a');}logger['info'](_0x0009('0x42'),_0x1f6aa2);logger['info'](_0x0009('0x43'),_0x4f76aa);return{'transcript':_0x1f6aa2,'confidence':_0x4f76aa};})[_0x0009('0x44')](function(_0x740a24){logger[_0x0009('0x15')](_0x0009('0x45'),_0x740a24[_0x0009('0x14')],_0x740a24[_0x0009('0x46')],_0x740a24[_0x0009('0x47')]);});};exports[_0x0009('0x48')]=function(_0x5313b2,_0x112060,_0x4b52af,_0x35b04c){var _0x4e62e2=apiai(_0x112060,{'language':_0x35b04c||'en'});return _0x4e62e2[_0x0009('0x49')](_0x4b52af,{'sessionId':md5(_0x5313b2)})[_0x0009('0x34')](function(_0x29354f){logger[_0x0009('0x39')](JSON[_0x0009('0x4a')](_0x29354f));return{'source':_0x29354f[_0x0009('0x4b')][_0x0009('0x4c')],'resolvedQuery':_0x29354f[_0x0009('0x4b')][_0x0009('0x4d')],'action':_0x29354f[_0x0009('0x4b')]['action'],'actionIncomplete':_0x29354f[_0x0009('0x4b')][_0x0009('0x4e')],'speech':_0x29354f[_0x0009('0x4b')][_0x0009('0x4f')][_0x0009('0x50')],'score':_0x29354f['result'][_0x0009('0x51')],'statusCode':_0x29354f[_0x0009('0x52')][_0x0009('0x53')],'endConversation':_0x29354f['result'][_0x0009('0x54')][_0x0009('0x55')]||![],'isFallbackIntent':_0x29354f[_0x0009('0x4b')][_0x0009('0x54')][_0x0009('0x56')]};});};exports['tildeASR']=function(_0x16eb5d,_0x5cd546,_0x52a1e7,_0x554549){return tilde[_0x0009('0x3b')](_0x16eb5d,_0x5cd546,_0x52a1e7,_0x554549)[_0x0009('0x34')](function(_0x380c6f){try{fs[_0x0009('0x1c')](_0x16eb5d);}catch(_0xc3b838){logger[_0x0009('0x15')](_0xc3b838);}logger[_0x0009('0x39')]('Tilde\x20ASR\x20transcription',_0x380c6f['transcript']);logger[_0x0009('0x39')](_0x0009('0x57'),_0x380c6f[_0x0009('0x41')]);return _0x380c6f;});};exports[_0x0009('0x58')]=function(_0x13f0d1,_0x30a766,_0x4c0f9a,_0x6ffd5b,_0x5de0c6,_0x5a3cad){var _0x1f8b84=path[_0x0009('0x23')](__dirname,_0x0009('0x24'),rs[_0x0009('0x25')](0x4)+_0x0009('0x35'));var _0x18ddc1;return aws[_0x0009('0x59')](_0x13f0d1,_0x30a766,_0x4c0f9a,_0x6ffd5b,_0x5de0c6,_0x5a3cad,_0x1f8b84)[_0x0009('0x34')](function(){_0x18ddc1=path[_0x0009('0x23')](__dirname,_0x0009('0x24'),rs[_0x0009('0x25')](0x4)+'.wav');return convertFile(_0x1f8b84,_0x18ddc1);})[_0x0009('0x34')](function(){try{fs[_0x0009('0x1c')](_0x1f8b84);fs[_0x0009('0x29')](_0x18ddc1,_0x0009('0x2a'));}catch(_0x1dba9a){logger[_0x0009('0x15')](_0x1dba9a);}return _0x18ddc1['split']('.')[0x0];});};exports['awsLex']=function(_0x2e1ae3,_0x5dc4c0,_0x54b146,_0x4e44b7,_0x1d116f,_0x41b607){return aws['lex'](_0x2e1ae3,_0x5dc4c0,_0x54b146,_0x4e44b7,_0x1d116f,_0x41b607)[_0x0009('0x34')](function(_0x4d3a50){logger[_0x0009('0x39')](JSON[_0x0009('0x4a')](_0x4d3a50));return _0x4d3a50;});};exports[_0x0009('0x5a')]=function(_0x4dfe92,_0x4f1e84,_0x4f0e33,_0xad2f0){var _0x29f5c5=util['format'](_0x0009('0x5b'),ISPEECH_API,_0x4dfe92,encodeURIComponent(_0x4f1e84),_0x4f0e33,_0xad2f0);var _0x48de00=path[_0x0009('0x23')](__dirname,'tmp',rs[_0x0009('0x25')](0x4)+_0x0009('0x35'));var _0x266cc4;return downloadFile(_0x29f5c5,_0x48de00)[_0x0009('0x34')](function(){_0x266cc4=path[_0x0009('0x23')](__dirname,_0x0009('0x24'),rs['generate'](0x4)+_0x0009('0x26'));return convertFile(_0x48de00,_0x266cc4);})[_0x0009('0x34')](function(){try{fs[_0x0009('0x1c')](_0x48de00);fs[_0x0009('0x29')](_0x266cc4,_0x0009('0x2a'));}catch(_0x235766){logger[_0x0009('0x15')](_0x235766);}return _0x266cc4[_0x0009('0x38')]('.')[0x0];});};exports[_0x0009('0x5c')]=function(_0x2335ca,_0x460465,_0x4fb443,_0x5baf19){var _0x1e7555=util[_0x0009('0x5d')](_0x0009('0x5e'),ISPEECH_API,_0x460465,_0x4fb443,base64Encode(_0x2335ca),_0x5baf19?util[_0x0009('0x5d')](_0x0009('0x5f'),encodeURIComponent(_0x5baf19)):_0x0009('0x60'));return uploadFile(_0x1e7555)[_0x0009('0x34')](function(_0x4bd62b){return querystring[_0x0009('0x61')](_0x4bd62b);});};exports[_0x0009('0x62')]=function(_0x5183ef,_0x9d0fc0){return sestek[_0x0009('0x63')](_0x5183ef,_0x9d0fc0)[_0x0009('0x34')](function(_0x531c02){logger['info'](JSON[_0x0009('0x4a')](_0x531c02));var _0x4031bf={'speech':_0x531c02[_0x0009('0x64')],'action':_0x531c02[_0x0009('0x65')]?_0x531c02[_0x0009('0x65')][_0x0009('0x66')]:undefined,'actiondata':_0x531c02[_0x0009('0x65')]?_0x531c02[_0x0009('0x65')]['CustomActionData']:undefined};if(_0x531c02['channelData']&&_0x531c02[_0x0009('0x65')][_0x0009('0x67')]){return base64Decode(_0x531c02[_0x0009('0x65')][_0x0009('0x67')][_0x0009('0x68')],path[_0x0009('0x23')](__dirname,_0x0009('0x24'),rs['generate'](0x4)+_0x0009('0x26')))[_0x0009('0x34')](function(_0x2ca8da){_0x4031bf['audiofile']=_0x2ca8da;return _0x4031bf;});}return _0x4031bf;});};exports[_0x0009('0x69')]=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 751a9c9..d339fe0 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 _0x2f8e=['exports','./nda'];(function(_0x1af05b,_0x5134b5){var _0x5be7cc=function(_0x2d4ac0){while(--_0x2d4ac0){_0x1af05b['push'](_0x1af05b['shift']());}};_0x5be7cc(++_0x5134b5);}(_0x2f8e,0x1e1));var _0xe2f8=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x2f8e[_0x432682];return _0x463d05;};var nda=require(_0xe2f8('0x0'));module[_0xe2f8('0x1')]={'nda':nda}; \ No newline at end of file +var _0x2f0e=['exports'];(function(_0x1c7cd4,_0x207c65){var _0x4192bd=function(_0x2b2932){while(--_0x2b2932){_0x1c7cd4['push'](_0x1c7cd4['shift']());}};_0x4192bd(++_0x207c65);}(_0x2f0e,0xd2));var _0xe2f0=function(_0x2c62b6,_0x4d06d6){_0x2c62b6=_0x2c62b6-0x0;var _0x30a66a=_0x2f0e[_0x2c62b6];return _0x30a66a;};var nda=require('./nda');module[_0xe2f0('0x0')]={'nda':nda}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index 201e575..3b7b4de 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 _0xf2f7=['agi','exports','resolve','ndauth_url','/token','password','POST','ndassistant_url','ndaactivity_type','message','Nda','uniqueid','callerid','calleridname','dnid','extension','Bearer\x20','access_token','project','channelData','ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action','body','custom_action_data','CustomActionData','info','request-promise','url'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0xf2f7,0xd0));var _0x7f2f=function(_0x41b8c5,_0x353f67){_0x41b8c5=_0x41b8c5-0x0;var _0x277dcb=_0xf2f7[_0x41b8c5];return _0x277dcb;};'use strict';var rp=require(_0x7f2f('0x0'));var url=require(_0x7f2f('0x1'));var logger=require('../../../../../config/logger')(_0x7f2f('0x2'));module[_0x7f2f('0x3')]=function(_0x21e3e3,_0x20b274){var _0x3f0aa4={'method':'POST','uri':url[_0x7f2f('0x4')](_0x20b274[_0x7f2f('0x5')],_0x7f2f('0x6')),'form':{'grant_type':_0x7f2f('0x7'),'username':_0x20b274['username'],'password':_0x20b274[_0x7f2f('0x7')]},'json':!![]};return rp(_0x3f0aa4)['then'](function(_0x27a991){var _0xe2bd84={'method':_0x7f2f('0x8'),'uri':url[_0x7f2f('0x4')](_0x20b274[_0x7f2f('0x9')],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x20b274[_0x7f2f('0xa')]||_0x7f2f('0xb'),'channelId':_0x7f2f('0xc'),'conversation':{'id':_0x21e3e3[_0x7f2f('0xd')]},'from':{'id':_0x21e3e3[_0x7f2f('0xe')],'name':_0x21e3e3[_0x7f2f('0xf')]},'recipient':{'id':_0x21e3e3[_0x7f2f('0x10')],'name':_0x21e3e3[_0x7f2f('0x11')]},'text':_0x20b274['text'],'channelData':{}},'headers':{'Authorization':_0x7f2f('0x12')+_0x27a991[_0x7f2f('0x13')]},'json':!![]};if(_0x20b274[_0x7f2f('0x14')]){_0xe2bd84['body'][_0x7f2f('0x15')]['ProjectName']=_0x20b274[_0x7f2f('0x14')];}if(_0x20b274[_0x7f2f('0x16')]=='1'){_0xe2bd84['body'][_0x7f2f('0x15')][_0x7f2f('0x17')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x7f2f('0x18')};}if(_0x20b274[_0x7f2f('0x19')]){_0xe2bd84[_0x7f2f('0x1a')][_0x7f2f('0x15')]['CustomAction']=_0x20b274[_0x7f2f('0x19')];if(_0x20b274[_0x7f2f('0x1b')]){_0xe2bd84[_0x7f2f('0x1a')][_0x7f2f('0x15')][_0x7f2f('0x1c')]=_0x20b274['custom_action_data'];}}logger[_0x7f2f('0x1d')](JSON['stringify'](_0xe2bd84));return rp(_0xe2bd84);});}; \ No newline at end of file +var _0x55ac=['ProjectName','ndagenerate_audio','channelData','AudioOutputSettings','custom_action','CustomAction','custom_action_data','CustomActionData','info','stringify','request-promise','url','../../../../../config/logger','POST','resolve','ndauth_url','password','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','message','Nda','callerid','calleridname','dnid','extension','text','access_token','project','body'];(function(_0x2cff69,_0x39a6bb){var _0x34e0c3=function(_0x48060c){while(--_0x48060c){_0x2cff69['push'](_0x2cff69['shift']());}};_0x34e0c3(++_0x39a6bb);}(_0x55ac,0x1cc));var _0xc55a=function(_0x2e432a,_0x20c898){_0x2e432a=_0x2e432a-0x0;var _0x5ea193=_0x55ac[_0x2e432a];return _0x5ea193;};'use strict';var rp=require(_0xc55a('0x0'));var url=require(_0xc55a('0x1'));var logger=require(_0xc55a('0x2'))('agi');module['exports']=function(_0x521f67,_0x427467){var _0x5614bd={'method':_0xc55a('0x3'),'uri':url[_0xc55a('0x4')](_0x427467[_0xc55a('0x5')],'/token'),'form':{'grant_type':'password','username':_0x427467['username'],'password':_0x427467[_0xc55a('0x6')]},'json':!![]};return rp(_0x5614bd)[_0xc55a('0x7')](function(_0x322499){var _0x3d053b={'method':'POST','uri':url['resolve'](_0x427467[_0xc55a('0x8')],_0xc55a('0x9')),'body':{'type':_0x427467['ndaactivity_type']||_0xc55a('0xa'),'channelId':_0xc55a('0xb'),'conversation':{'id':_0x521f67['uniqueid']},'from':{'id':_0x521f67[_0xc55a('0xc')],'name':_0x521f67[_0xc55a('0xd')]},'recipient':{'id':_0x521f67[_0xc55a('0xe')],'name':_0x521f67[_0xc55a('0xf')]},'text':_0x427467[_0xc55a('0x10')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x322499[_0xc55a('0x11')]},'json':!![]};if(_0x427467[_0xc55a('0x12')]){_0x3d053b[_0xc55a('0x13')]['channelData'][_0xc55a('0x14')]=_0x427467[_0xc55a('0x12')];}if(_0x427467[_0xc55a('0x15')]=='1'){_0x3d053b[_0xc55a('0x13')][_0xc55a('0x16')][_0xc55a('0x17')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x427467[_0xc55a('0x18')]){_0x3d053b[_0xc55a('0x13')][_0xc55a('0x16')][_0xc55a('0x19')]=_0x427467[_0xc55a('0x18')];if(_0x427467[_0xc55a('0x1a')]){_0x3d053b['body'][_0xc55a('0x16')][_0xc55a('0x1b')]=_0x427467[_0xc55a('0x1a')];}}logger[_0xc55a('0x1c')](JSON[_0xc55a('0x1d')](_0x3d053b));return rp(_0x3d053b);});}; \ 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 2198c20..bd6e490 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 _0x7e30=['./lib/api'];(function(_0x4fc3a0,_0x4d87bb){var _0x3abe9b=function(_0x1a4880){while(--_0x1a4880){_0x4fc3a0['push'](_0x4fc3a0['shift']());}};_0x3abe9b(++_0x4d87bb);}(_0x7e30,0x8a));var _0x07e3=function(_0x159496,_0x2cf3c0){_0x159496=_0x159496-0x0;var _0x460dba=_0x7e30[_0x159496];return _0x460dba;};'use strict';var asr=require(_0x07e3('0x0'));module['exports']=function(_0x19b365,_0x12bc73,_0x4ce820,_0x186d1e){return asr(_0x19b365,_0x12bc73,_0x4ce820,_0x186d1e);}; \ No newline at end of file +var _0x07e3=['exports'];(function(_0x1df7b8,_0x2fe5e5){var _0x29d911=function(_0x340121){while(--_0x340121){_0x1df7b8['push'](_0x1df7b8['shift']());}};_0x29d911(++_0x2fe5e5);}(_0x07e3,0x8c));var _0x307e=function(_0x1269c6,_0x1c8942){_0x1269c6=_0x1269c6-0x0;var _0x4868c7=_0x07e3[_0x1269c6];return _0x4868c7;};'use strict';var asr=require('./lib/api');module[_0x307e('0x0')]=function(_0x2a6c0e,_0xa515d,_0x38b3b1,_0x501742){return asr(_0x2a6c0e,_0xa515d,_0x38b3b1,_0x501742);}; \ 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 13a2a2b..488d7c1 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 _0xcf23=['Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','terminate','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','open','message','bluebird','lodash','moment','crypto','../../../../../../config/logger','exports','info','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','sha1','digest','hex','stringify','data','send','close','EOS','error','Tilde\x20ASR\x20send\x20error','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript'];(function(_0x5dceb7,_0x4fed9d){var _0x3268bc=function(_0x12f6b5){while(--_0x12f6b5){_0x5dceb7['push'](_0x5dceb7['shift']());}};_0x3268bc(++_0x4fed9d);}(_0xcf23,0x1c8));var _0x3cf2=function(_0x48bdac,_0x143136){_0x48bdac=_0x48bdac-0x0;var _0x28517d=_0xcf23[_0x48bdac];return _0x28517d;};'use strict';var BPromise=require(_0x3cf2('0x0'));var _=require(_0x3cf2('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x3cf2('0x2'));var crypto=require(_0x3cf2('0x3'));var logger=require(_0x3cf2('0x4'))('agi');module[_0x3cf2('0x5')]=function(_0xfa9c0f,_0x48404c,_0x49b1b2,_0x11d5cd){return new BPromise(function(_0x5f38da,_0xfae0a9){logger[_0x3cf2('0x6')]('Tilde\x20URI',_0x11d5cd||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0xf27455=new WebSocket(_0x11d5cd||_0x3cf2('0x7'),{'perMessageDeflate':![]});var _0x3f5afa='';var _0x3e32f4='0';var _0x27eb9c='1';var _0xb086c7=_0x3cf2('0x8');function _0x5a85be(_0x4484aa){var _0x443bde=crypto['createHash'](_0x3cf2('0x9'));_0x443bde['update'](_0x4484aa);return _0x443bde[_0x3cf2('0xa')](_0x3cf2('0xb'));}function _0x152bba(){try{logger['info']('Open\x20Tilde\x20ASR\x20socket');var _0x44b8a2=moment()['unix']();var _0x1106e3=_0x5a85be(_0x44b8a2+_0x48404c+_0x49b1b2);_0xf27455['send'](JSON[_0x3cf2('0xc')]({'appID':_0x48404c,'timestamp':_0x44b8a2,'appKey':_0x1106e3}));var _0x5b70e2=fs['createReadStream'](_0xfa9c0f);_0x5b70e2['on'](_0x3cf2('0xd'),function(_0x235143){_0xf27455[_0x3cf2('0xe')](_0x235143);});_0x5b70e2['on'](_0x3cf2('0xf'),function(){_0xf27455['send'](_0x3cf2('0x10'));});}catch(_0x2973c6){logger[_0x3cf2('0x11')](_0x3cf2('0x12'),JSON[_0x3cf2('0xc')](_0x2973c6));_0xf27455['terminate']();}}function _0x301830(_0x163554){try{if(_0x163554){var _0x16d7ab=JSON['parse'](_0x163554);switch(_0x16d7ab[_0x3cf2('0x13')]){case 0x0:if(_0x16d7ab[_0x3cf2('0x14')]){if(_0x16d7ab['result'][_0x3cf2('0x15')]){logger[_0x3cf2('0x6')](_0x3cf2('0x16'),JSON[_0x3cf2('0xc')](_0x16d7ab[_0x3cf2('0x14')][_0x3cf2('0x17')]));_0x3f5afa=_0x16d7ab[_0x3cf2('0x14')][_0x3cf2('0x17')][0x0][_0x3cf2('0x18')];_0x3e32f4=_0x16d7ab[_0x3cf2('0x14')][_0x3cf2('0x17')][0x0]['likelihood'];_0x27eb9c='0';_0xb086c7=_0x3cf2('0x19');_0xf27455['terminate']();}}break;case 0x1:logger[_0x3cf2('0x6')]('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x27eb9c='1';_0xb086c7=_0x3cf2('0x8');break;case 0x2:logger['info'](_0x3cf2('0x1a'));_0x27eb9c='2';_0xb086c7=_0x3cf2('0x1a');break;case 0x9:logger[_0x3cf2('0x6')](_0x3cf2('0x1b'));_0x27eb9c='9';_0xb086c7=_0x3cf2('0x1b');break;case 0xa:logger[_0x3cf2('0x6')](_0x3cf2('0x1c'));_0x27eb9c='10';_0xb086c7='Authentication\x20failed.';break;case 0xb:logger[_0x3cf2('0x6')](_0x3cf2('0x1d'));_0x27eb9c='11';_0xb086c7=_0x3cf2('0x1d');}}}catch(_0x423a8a){logger[_0x3cf2('0x11')](_0x3cf2('0x1e'),JSON[_0x3cf2('0xc')](_0x423a8a));_0xf27455[_0x3cf2('0x1f')]();}}function _0x7ca2eb(){logger['info'](_0x3cf2('0x20'));_0x5f38da({'transcript':_0x3f5afa,'confidence':_0x3e32f4,'status':_0x27eb9c,'status_message':_0xb086c7});}function _0x5e4401(_0x4c11ad){logger[_0x3cf2('0x11')](_0x3cf2('0x21'));if(!_[_0x3cf2('0x22')](_0x4c11ad)){logger['error'](_['isObject'](_0x4c11ad)?JSON[_0x3cf2('0xc')](_0x4c11ad):_0x4c11ad);}}_0xf27455['on'](_0x3cf2('0x23'),_0x152bba);_0xf27455['on'](_0x3cf2('0x24'),_0x301830);_0xf27455['on'](_0x3cf2('0xf'),_0x7ca2eb);_0xf27455['on']('error',_0x5e4401);});}; \ No newline at end of file +var _0xa0e7=['data','close','send','error','Tilde\x20ASR\x20send\x20error','terminate','status','final','Tilde\x20ASR\x20hypoteses','result','hypotheses','transcript','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','message','bluebird','lodash','../../../../../../config/logger','agi','exports','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','sha1','update','digest','hex','info','Open\x20Tilde\x20ASR\x20socket','unix','stringify','createReadStream'];(function(_0xe9c1a6,_0x21ada1){var _0x1da035=function(_0x24c2ea){while(--_0x24c2ea){_0xe9c1a6['push'](_0xe9c1a6['shift']());}};_0x1da035(++_0x21ada1);}(_0xa0e7,0x87));var _0x7a0e=function(_0x574cd5,_0x2cff10){_0x574cd5=_0x574cd5-0x0;var _0x2a0180=_0xa0e7[_0x574cd5];return _0x2a0180;};'use strict';var BPromise=require(_0x7a0e('0x0'));var _=require(_0x7a0e('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require('crypto');var logger=require(_0x7a0e('0x2'))(_0x7a0e('0x3'));module[_0x7a0e('0x4')]=function(_0x592e2e,_0x584b8b,_0x541ade,_0x53a135){return new BPromise(function(_0x297b41,_0x536665){logger['info'](_0x7a0e('0x5'),_0x53a135||_0x7a0e('0x6'));var _0x444169=new WebSocket(_0x53a135||_0x7a0e('0x6'),{'perMessageDeflate':![]});var _0x161911='';var _0x5e881c='0';var _0x33d47d='1';var _0x14ea44=_0x7a0e('0x7');function _0x1e9150(_0x1120c5){var _0xbe124=crypto['createHash'](_0x7a0e('0x8'));_0xbe124[_0x7a0e('0x9')](_0x1120c5);return _0xbe124[_0x7a0e('0xa')](_0x7a0e('0xb'));}function _0x188580(){try{logger[_0x7a0e('0xc')](_0x7a0e('0xd'));var _0x3fb0cc=moment()[_0x7a0e('0xe')]();var _0x268cf4=_0x1e9150(_0x3fb0cc+_0x584b8b+_0x541ade);_0x444169['send'](JSON[_0x7a0e('0xf')]({'appID':_0x584b8b,'timestamp':_0x3fb0cc,'appKey':_0x268cf4}));var _0x191d96=fs[_0x7a0e('0x10')](_0x592e2e);_0x191d96['on'](_0x7a0e('0x11'),function(_0x40c15c){_0x444169['send'](_0x40c15c);});_0x191d96['on'](_0x7a0e('0x12'),function(){_0x444169[_0x7a0e('0x13')]('EOS');});}catch(_0xdaedcb){logger[_0x7a0e('0x14')](_0x7a0e('0x15'),JSON[_0x7a0e('0xf')](_0xdaedcb));_0x444169[_0x7a0e('0x16')]();}}function _0x5171f0(_0x148b89){try{if(_0x148b89){var _0xb2f0b0=JSON['parse'](_0x148b89);switch(_0xb2f0b0[_0x7a0e('0x17')]){case 0x0:if(_0xb2f0b0['result']){if(_0xb2f0b0['result'][_0x7a0e('0x18')]){logger[_0x7a0e('0xc')](_0x7a0e('0x19'),JSON['stringify'](_0xb2f0b0[_0x7a0e('0x1a')][_0x7a0e('0x1b')]));_0x161911=_0xb2f0b0[_0x7a0e('0x1a')][_0x7a0e('0x1b')][0x0][_0x7a0e('0x1c')];_0x5e881c=_0xb2f0b0[_0x7a0e('0x1a')][_0x7a0e('0x1b')][0x0]['likelihood'];_0x33d47d='0';_0x14ea44=_0x7a0e('0x1d');_0x444169[_0x7a0e('0x16')]();}}break;case 0x1:logger[_0x7a0e('0xc')]('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x33d47d='1';_0x14ea44=_0x7a0e('0x7');break;case 0x2:logger[_0x7a0e('0xc')](_0x7a0e('0x1e'));_0x33d47d='2';_0x14ea44=_0x7a0e('0x1e');break;case 0x9:logger[_0x7a0e('0xc')](_0x7a0e('0x1f'));_0x33d47d='9';_0x14ea44=_0x7a0e('0x1f');break;case 0xa:logger[_0x7a0e('0xc')]('Authentication\x20failed.');_0x33d47d='10';_0x14ea44=_0x7a0e('0x20');break;case 0xb:logger[_0x7a0e('0xc')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x33d47d='11';_0x14ea44=_0x7a0e('0x21');}}}catch(_0x2f05c4){logger[_0x7a0e('0x14')](_0x7a0e('0x22'),JSON[_0x7a0e('0xf')](_0x2f05c4));_0x444169[_0x7a0e('0x16')]();}}function _0x1e8da6(){logger[_0x7a0e('0xc')](_0x7a0e('0x23'));_0x297b41({'transcript':_0x161911,'confidence':_0x5e881c,'status':_0x33d47d,'status_message':_0x14ea44});}function _0x49ea88(_0xb449d2){logger[_0x7a0e('0x14')](_0x7a0e('0x24'));if(!_['isNil'](_0xb449d2)){logger['error'](_['isObject'](_0xb449d2)?JSON[_0x7a0e('0xf')](_0xb449d2):_0xb449d2);}}_0x444169['on']('open',_0x188580);_0x444169['on'](_0x7a0e('0x25'),_0x5171f0);_0x444169['on'](_0x7a0e('0x12'),_0x1e8da6);_0x444169['on'](_0x7a0e('0x14'),_0x49ea88);});}; \ 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 60e71ed..1f1b8d7 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 _0x62fc=['exports','./asr'];(function(_0x3d78d7,_0x44acea){var _0x4b6784=function(_0x284157){while(--_0x284157){_0x3d78d7['push'](_0x3d78d7['shift']());}};_0x4b6784(++_0x44acea);}(_0x62fc,0x9d));var _0xc62f=function(_0x22f493,_0x55c7ac){_0x22f493=_0x22f493-0x0;var _0x40e159=_0x62fc[_0x22f493];return _0x40e159;};var asr=require(_0xc62f('0x0'));module[_0xc62f('0x1')]={'asr':asr}; \ No newline at end of file +var _0x97e4=['./asr'];(function(_0x1585ee,_0x3a9d61){var _0x23ef05=function(_0x89316a){while(--_0x89316a){_0x1585ee['push'](_0x1585ee['shift']());}};_0x23ef05(++_0x3a9d61);}(_0x97e4,0x13f));var _0x497e=function(_0x211576,_0xcc41af){_0x211576=_0x211576-0x0;var _0x3ce235=_0x97e4[_0x211576];return _0x3ce235;};var asr=require(_0x497e('0x0'));module['exports']={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index c76ed10..bcb7ec2 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 _0x385b=['code','close','E_AGI_SERVER_CLOSE','nextTick','inherits','net','EventEmitter','./error','./channel','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listening','connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','E_AGI_SERVER_MAXCONNECTION','ready'];(function(_0x343aa1,_0x443588){var _0x145484=function(_0x4f14ee){while(--_0x4f14ee){_0x343aa1['push'](_0x343aa1['shift']());}};_0x145484(++_0x443588);}(_0x385b,0x1a7));var _0xb385=function(_0x3f2abd,_0x23b3a9){_0x3f2abd=_0x3f2abd-0x0;var _0x3d8338=_0x385b[_0x3f2abd];return _0x3d8338;};'use strict';var util=require('util');var net=require(_0xb385('0x0'));var EventEmitter=require('events')[_0xb385('0x1')];var AGIError=require(_0xb385('0x2'));var AGIChannel=require(_0xb385('0x3'));var AGIServer=function(_0x1f7c4f,_0x55c2c8,_0x2ea8dd){var _0xd61b87=this,_0x1f7c4f=_0x1f7c4f||0x11dd,_0x55c2c8=_0x55c2c8||_0xb385('0x4'),_0x3268bc=null,_0x576d81=0x0;EventEmitter[_0xb385('0x5')](_0xd61b87);function _0x5b7929(){if(!_0x1f7c4f){_0xd61b87[_0xb385('0x6')](_0xb385('0x7'),new AGIError(_0xb385('0x8')));return![];}_0x3268bc=net[_0xb385('0x9')]();_0x3268bc['listen'](_0x1f7c4f,_0x55c2c8);_0x3268bc['on'](_0xb385('0xa'),function(){_0xd61b87[_0xb385('0x6')]('listening');});_0x3268bc['on'](_0xb385('0xb'),function(_0x39f291){_0x3268bc[_0xb385('0xc')](function(_0x371315,_0x1b0471){if(_0x371315){_0xd61b87[_0xb385('0x6')]('error',new AGIError(_0xb385('0xd'),_0x371315));}else if(_0x2ea8dd&&_0x2ea8dd<0x0){_0xd61b87['emit']('error',new AGIError(_0xb385('0xe')));_0x39f291['destroy']();}else if(_0x2ea8dd&&_0x2ea8dd>0x0&&_0x2ea8dd<_0x1b0471){_0x576d81+=0x1;_0xd61b87[_0xb385('0x6')](_0xb385('0x7'),new AGIError(_0xb385('0xf'),_0x576d81));_0x39f291['destroy']();}else{var _0x1577c5=new AGIChannel(_0x39f291);_0x1577c5['on'](_0xb385('0x10'),function(){_0xd61b87[_0xb385('0x6')]('connection',_0x1577c5);});}});});_0x3268bc['on'](_0xb385('0x7'),function(_0x58bffd){_0xd61b87[_0xb385('0x6')]('error',new AGIError(_0xb385('0xd'),_0x58bffd[_0xb385('0x11')]));});_0x3268bc['on'](_0xb385('0x12'),function(){_0xd61b87[_0xb385('0x6')](_0xb385('0x12'),new AGIError(_0xb385('0x13')));});}process[_0xb385('0x14')](function(){_0x5b7929();});};util[_0xb385('0x15')](AGIServer,EventEmitter);module['exports']=function(_0xb26b53,_0x5bd050,_0x19c4ce){return new AGIServer(_0xb26b53,_0x5bd050,_0x19c4ce);}; \ No newline at end of file +var _0x4d46=['E_AGI_SERVER_ERROR','destroy','E_AGI_SERVER_MAXCONNECTION','close','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','util','net','events','EventEmitter','./error','./channel','127.0.0.1','call','emit','error','listening','connection','getConnections'];(function(_0x48c741,_0x11c78c){var _0x438d3d=function(_0x30153e){while(--_0x30153e){_0x48c741['push'](_0x48c741['shift']());}};_0x438d3d(++_0x11c78c);}(_0x4d46,0x197));var _0x64d4=function(_0x4c4220,_0x5e8b5d){_0x4c4220=_0x4c4220-0x0;var _0x244cab=_0x4d46[_0x4c4220];return _0x244cab;};'use strict';var util=require(_0x64d4('0x0'));var net=require(_0x64d4('0x1'));var EventEmitter=require(_0x64d4('0x2'))[_0x64d4('0x3')];var AGIError=require(_0x64d4('0x4'));var AGIChannel=require(_0x64d4('0x5'));var AGIServer=function(_0x51c43f,_0x3025f0,_0xc60ca5){var _0x200491=this,_0x51c43f=_0x51c43f||0x11dd,_0x3025f0=_0x3025f0||_0x64d4('0x6'),_0x3b8932=null,_0x4d9222=0x0;EventEmitter[_0x64d4('0x7')](_0x200491);function _0x51faf7(){if(!_0x51c43f){_0x200491[_0x64d4('0x8')](_0x64d4('0x9'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x3b8932=net['createServer']();_0x3b8932['listen'](_0x51c43f,_0x3025f0);_0x3b8932['on']('listening',function(){_0x200491['emit'](_0x64d4('0xa'));});_0x3b8932['on'](_0x64d4('0xb'),function(_0xda30b3){_0x3b8932[_0x64d4('0xc')](function(_0x766524,_0x2b3a6e){if(_0x766524){_0x200491[_0x64d4('0x8')](_0x64d4('0x9'),new AGIError(_0x64d4('0xd'),_0x766524));}else if(_0xc60ca5&&_0xc60ca5<0x0){_0x200491['emit'](_0x64d4('0x9'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0xda30b3[_0x64d4('0xe')]();}else if(_0xc60ca5&&_0xc60ca5>0x0&&_0xc60ca5<_0x2b3a6e){_0x4d9222+=0x1;_0x200491[_0x64d4('0x8')](_0x64d4('0x9'),new AGIError(_0x64d4('0xf'),_0x4d9222));_0xda30b3[_0x64d4('0xe')]();}else{var _0x2b0c39=new AGIChannel(_0xda30b3);_0x2b0c39['on']('ready',function(){_0x200491[_0x64d4('0x8')](_0x64d4('0xb'),_0x2b0c39);});}});});_0x3b8932['on'](_0x64d4('0x9'),function(_0x3a25a3){_0x200491[_0x64d4('0x8')](_0x64d4('0x9'),new AGIError(_0x64d4('0xd'),_0x3a25a3['code']));});_0x3b8932['on'](_0x64d4('0x10'),function(){_0x200491[_0x64d4('0x8')]('close',new AGIError(_0x64d4('0x11')));});}process[_0x64d4('0x12')](function(){_0x51faf7();});};util[_0x64d4('0x13')](AGIServer,EventEmitter);module[_0x64d4('0x14')]=function(_0x21455d,_0x2b487d,_0x1b2516){return new AGIServer(_0x21455d,_0x2b487d,_0x1b2516);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 8d4cd6a..74436eb 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 _0xa908=['Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','set','Enter\x20in\x20SET\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','AGI','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','agentUnpause','voicemail','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','no\x20variable\x20selected','replaceAll','path','lodash','odbc','randomstring','moment','mustache','../../config/logger','../../config/environment','./scripts','menu','getdigits','getsecretdigits','rpc','prototype','getVariableById','then','name','getVoiceQueue','getVoiceQueueById','catch','getSquareProject','getSquareOdbc','dsn','getTrunk','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervalById','IntervalId','map','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','open','error','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','channel','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','calleridname','context','priority','accountcode','file','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','getPause','getPauseById','agentPause','agent','agentLogout','agentLogin','internal','%s/%s@from-sip/n','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','google_tts_language','googleDialogflow','key','dialogflow_language','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','googleASR','google_asr_language','tildeASR','appid','appsecret','uri','clear','includes','clone','hasOwnProperty','isString','replaceAllVariables','split','length','getVariable','extra','getAndSetVariable','result','setVariable','maxRetry','sync','agi','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','timeout','Wait\x20%s\x20seconds\x20before\x20answer','wait','list_id','delay','callback_priority','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','application','Executed\x20command\x20%s\x20%s','options','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','grammar','MRCPRecog','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','RECOG_INPUT()','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','getUser','no\x20user\x20found','SIP/%s','opts','url','Executed\x20command\x20%s','DIAL','dialogflow','no\x20key\x20configured','createSquareMessage','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','toUpperCase','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','password','no\x20password\x20configured','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','no\x20file\x20audio\x20selected','file_id','no\x20file\x20audio\x20found','getData','response','maxdigit','stringify','mindigit','no\x20variable\x20found','hiddendigitsnum','generate','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','awsPolly','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','aws_bot_name','no\x20bot\x20name\x20configured','bot','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','message','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s.%s','beep','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','%s/recordings/%s','NOBEEP','recordFile','intKey','TildeASR\x20Result\x20%s','gotoc','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','true','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','getIntervals','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','false','Enter\x20in\x20HANGUP\x20(%s)\x20block','hangup','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','.wav','ispeech\x20TTS\x20is\x20unreachable','login','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','Enter\x20in\x20LOGOUT\x20(%s)\x20block','no\x20find\x20by\x20configured','math','Enter\x20in\x20MATH\x20(%s)\x20block','math\x20%s','operation','isArray','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','retry','getSound','Enter\x20in\x20NOOP\x20(%s)\x20block','output','Enter\x20in\x20PAUSE\x20(%s)\x20block','FIND\x20AGENT\x20%s\x20BY\x20%s','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','indexOf','toLowerCase','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','RECORDING_SAVENAME','escape_digits','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','sayNumber','number','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','Smtp','user','subject','service','host','port','secure','authentication','auth','pass','template_id','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax'];(function(_0x67098f,_0x55e2d0){var _0x4cf120=function(_0x3a442f){while(--_0x3a442f){_0x67098f['push'](_0x67098f['shift']());}};_0x4cf120(++_0x55e2d0);}(_0xa908,0x1c3));var _0x8a90=function(_0x5a3d49,_0x24b21a){_0x5a3d49=_0x5a3d49-0x0;var _0x4d5c23=_0xa908[_0x5a3d49];return _0x4d5c23;};'use strict';var fs=require('fs');var path=require(_0x8a90('0x0'));var util=require('util');var _=require(_0x8a90('0x1'));var sh=require('shelljs');var odbc=require(_0x8a90('0x2'))();var rs=require(_0x8a90('0x3'));var moment=require(_0x8a90('0x4'));var Mustache=require(_0x8a90('0x5'));var logger=require(_0x8a90('0x6'))('agi');var config=require(_0x8a90('0x7'));var scripts=require(_0x8a90('0x8'));var FILES_PATH='/var/opt/motion2/server/files';var verticesWithRetry=[_0x8a90('0x9'),_0x8a90('0xa'),_0x8a90('0xb')];var AGIVertices=function(_0x3faf88,_0x20f8bf,_0x200f95){this['channel']=_0x3faf88;this[_0x8a90('0xc')]=_0x20f8bf;this['mailRpc']=_0x200f95;};AGIVertices[_0x8a90('0xd')]['getVariable']=function(_0x46cee4,_0x35a76f){this[_0x8a90('0xc')][_0x8a90('0xe')](_0x46cee4)[_0x8a90('0xf')](function(_0x95f56){_0x35a76f(null,_0x95f56?_0x95f56[_0x8a90('0x10')]:![]);})['catch'](function(_0x4bcb3d){_0x35a76f(_0x4bcb3d);});};AGIVertices[_0x8a90('0xd')][_0x8a90('0x11')]=function(_0x110f2e,_0x579403){this[_0x8a90('0xc')][_0x8a90('0x12')](_0x110f2e)[_0x8a90('0xf')](function(_0x499ca6){_0x579403(null,_0x499ca6?_0x499ca6[_0x8a90('0x10')]:![]);})[_0x8a90('0x13')](function(_0x4b2067){_0x579403(_0x4b2067);});};AGIVertices[_0x8a90('0xd')][_0x8a90('0x14')]=function(_0x1f667a,_0x1bfd6c){this['rpc']['getSquareProjectById'](_0x1f667a)[_0x8a90('0xf')](function(_0x16a7d1){_0x1bfd6c(null,_0x16a7d1?_0x16a7d1[_0x8a90('0x10')]:![]);})[_0x8a90('0x13')](function(_0x17ba83){_0x1bfd6c(_0x17ba83);});};AGIVertices[_0x8a90('0xd')][_0x8a90('0x15')]=function(_0x1cfce7,_0x57577d){this[_0x8a90('0xc')]['getSquareOdbcById'](_0x1cfce7)[_0x8a90('0xf')](function(_0x3d0861){_0x57577d(null,_0x3d0861?_0x3d0861[_0x8a90('0x16')]:![]);})[_0x8a90('0x13')](function(_0xce9cc3){_0x57577d(_0xce9cc3);});};AGIVertices[_0x8a90('0xd')]['getUser']=function(_0x3b7852,_0x3c41d9){this[_0x8a90('0xc')]['getUserById'](_0x3b7852)[_0x8a90('0xf')](function(_0x43b8f6){_0x3c41d9(null,_0x43b8f6?_0x43b8f6['name']:![]);})[_0x8a90('0x13')](function(_0x15f93f){_0x3c41d9(_0x15f93f);});};AGIVertices['prototype'][_0x8a90('0x17')]=function(_0x36a334,_0x4acc5e){this[_0x8a90('0xc')]['getTrunkById'](_0x36a334)['then'](function(_0x22fd3f){_0x4acc5e(null,_0x22fd3f?_0x22fd3f[_0x8a90('0x10')]:![]);})[_0x8a90('0x13')](function(_0x2bc216){_0x4acc5e(_0x2bc216);});};AGIVertices[_0x8a90('0xd')]['getSound']=function(_0x16a228,_0x1ddc6f){var _0x128375=this;this[_0x8a90('0xc')]['getSoundById'](_0x16a228)[_0x8a90('0xf')](function(_0x55c74b){_0x1ddc6f(null,_0x55c74b?_0x128375[_0x8a90('0x18')](_0x55c74b[_0x8a90('0x19')]):![]);})[_0x8a90('0x13')](function(_0x4b641d){_0x1ddc6f(_0x4b641d);});};AGIVertices[_0x8a90('0xd')][_0x8a90('0x1a')]=function(_0x16cbbf,_0x57596d){this[_0x8a90('0xc')][_0x8a90('0x1b')](_0x16cbbf)[_0x8a90('0xf')](function(_0x153154){_0x57596d(null,_0x153154?_0x153154:![]);})[_0x8a90('0x13')](function(_0xd3db18){_0x57596d(_0xd3db18);});};AGIVertices['prototype'][_0x8a90('0x1c')]=function(_0x38fb85,_0x5cc98c,_0x47ef20){this['mailRpc'][_0x8a90('0x1c')](_0x38fb85,_0x5cc98c)[_0x8a90('0xf')](function(){_0x47ef20(null);})[_0x8a90('0x13')](function(_0x10f729){_0x47ef20(_0x10f729);});};AGIVertices[_0x8a90('0xd')]['getIntervals']=function(_0x1dba81,_0x2bb3e0){this[_0x8a90('0xc')][_0x8a90('0x1d')](_0x1dba81)['then'](function(_0x4ae251){if(_0x4ae251){if(_0x4ae251[_0x8a90('0x1e')]){_0x2bb3e0(null,[_0x4ae251['interval']]);}else{_0x2bb3e0(null,_[_0x8a90('0x1f')](_0x4ae251[_0x8a90('0x20')],'interval'));}}else{_0x2bb3e0(null,![]);}})[_0x8a90('0x13')](function(_0x5a3f04){_0x2bb3e0(_0x5a3f04);});};AGIVertices[_0x8a90('0xd')]['getSoundPath']=function(_0x35436e){return util[_0x8a90('0x21')](_0x8a90('0x22'),FILES_PATH,_0x35436e);};AGIVertices[_0x8a90('0xd')][_0x8a90('0x23')]=function(_0x3d8d72,_0x21fb3c,_0x95485a){odbc[_0x8a90('0x24')](_0x3d8d72,function(_0x9a3bd6){if(_0x9a3bd6){logger[_0x8a90('0x25')]('Error\x20getting\x20ODBC\x20connection\x20%s',_0x9a3bd6);_0x95485a(_0x9a3bd6);}else{logger[_0x8a90('0x26')](_0x8a90('0x27'));odbc[_0x8a90('0x28')](_0x21fb3c,function(_0x2f09a6,_0x22cfdd){if(_0x2f09a6){logger['info'](_0x8a90('0x29'),_0x21fb3c);_0x95485a(_0x2f09a6);}else{logger[_0x8a90('0x26')](_0x8a90('0x2a'),_0x21fb3c);odbc['close'](function(_0x43c0c8){if(_0x43c0c8){logger[_0x8a90('0x25')](_0x8a90('0x2b'),_0x43c0c8);}_0x95485a(null,_0x22cfdd);});}});}});};AGIVertices[_0x8a90('0xd')][_0x8a90('0x2c')]=function(_0x2765f1,_0x294289){this['rpc'][_0x8a90('0x2d')](_0x2765f1)[_0x8a90('0xf')](function(_0x57a838){_0x294289(null,_0x57a838?_0x57a838:![]);})[_0x8a90('0x13')](function(_0x129d80){_0x294289(_0x129d80);});};AGIVertices['prototype'][_0x8a90('0x2e')]=function(_0x27667a,_0x8d64e6){this[_0x8a90('0xc')]['createSmsMessage'](_0x27667a)[_0x8a90('0xf')](function(_0x141b39){_0x8d64e6(null,_0x141b39);})[_0x8a90('0x13')](function(_0x28827e){_0x8d64e6(_0x28827e);});};AGIVertices[_0x8a90('0xd')][_0x8a90('0x2f')]=function(_0xa5939c,_0x273ccf,_0x478644){this[_0x8a90('0xc')][_0x8a90('0x2f')]({'uniqueid':this[_0x8a90('0x30')][_0x8a90('0x31')],'node':_0xa5939c[_0x8a90('0x32')],'application':_0xa5939c[_0x8a90('0x33')],'data':_0x273ccf||null,'project_name':this['channel'][_0x8a90('0x34')],'callerid':this['channel'][_0x8a90('0x35')]})[_0x8a90('0xf')](function(_0x5106a4){if(_0x478644){_0x478644(null,_0x5106a4);}})[_0x8a90('0x13')](function(_0x1c1e45){if(_0x478644){_0x478644(_0x1c1e45);}});};AGIVertices[_0x8a90('0xd')][_0x8a90('0x36')]=function(_0x66af29,_0x549807,_0x1d5b89,_0x79713d){this[_0x8a90('0xc')][_0x8a90('0x36')]({'uniqueid':this[_0x8a90('0x30')][_0x8a90('0x31')],'callerid':this[_0x8a90('0x30')][_0x8a90('0x35')],'calleridname':this[_0x8a90('0x30')][_0x8a90('0x37')],'context':this[_0x8a90('0x30')][_0x8a90('0x38')],'extension':this[_0x8a90('0x30')]['extension'],'priority':this[_0x8a90('0x30')][_0x8a90('0x39')],'accountcode':this[_0x8a90('0x30')][_0x8a90('0x3a')],'dnid':this['channel']['dnid'],'projectName':this['channel'][_0x8a90('0x34')],'saveName':_0x549807,'filename':_0x66af29[_0x8a90('0x3b')]||_0x549807,'savePath':_0x1d5b89})[_0x8a90('0xf')](function(_0x396f03){_0x79713d(null,_0x396f03);})[_0x8a90('0x13')](function(_0x2a027c){_0x79713d(_0x2a027c);});};AGIVertices['prototype']['createSquareMessage']=function(_0x3b22f6,_0x2d2d04,_0x3b9c30){this[_0x8a90('0xc')]['createSquareMessage']({'uniqueid':this[_0x8a90('0x30')][_0x8a90('0x31')],'body':_0x3b22f6,'direction':_0x2d2d04})[_0x8a90('0xf')](function(_0x41500d){if(_0x3b9c30){_0x3b9c30(null,_0x41500d);}})[_0x8a90('0x13')](function(_0x453e7e){if(_0x3b9c30){_0x3b9c30(_0x453e7e);}});};AGIVertices[_0x8a90('0xd')][_0x8a90('0x3c')]=function(_0x13a4fb,_0x3ac0c4){this[_0x8a90('0xc')][_0x8a90('0x3c')]({'firstName':_[_0x8a90('0x3d')](_0x13a4fb[_0x8a90('0x10')])||_[_0x8a90('0x3e')](_0x13a4fb[_0x8a90('0x10')])?_0x8a90('0x3f')+Math[_0x8a90('0x40')]():_0x13a4fb[_0x8a90('0x10')],'lastName':_[_0x8a90('0x3d')](_0x13a4fb['lastName'])||_[_0x8a90('0x3e')](_0x13a4fb['lastName'])?null:_0x13a4fb[_0x8a90('0x41')],'phone':_0x13a4fb[_0x8a90('0x42')],'ListId':_0x13a4fb['list_id'],'scheduledAt':_0x13a4fb[_0x8a90('0x43')],'callbackUniqueid':this['channel']['uniqueid'],'tags':_0x8a90('0x44'),'description':_0x8a90('0x45')+_0x13a4fb[_0x8a90('0x43')][_0x8a90('0x46')](),'priority':_0x13a4fb['callback_priority']})[_0x8a90('0xf')](function(_0x3aa8e4){_0x3ac0c4(null,_0x3aa8e4);})[_0x8a90('0x13')](function(_0x5ce0af){_0x3ac0c4(_0x5ce0af);});};AGIVertices['prototype'][_0x8a90('0x47')]=function(_0x4e226b,_0x17a9cd){this[_0x8a90('0xc')][_0x8a90('0x48')](_0x4e226b)['then'](function(_0x10db6d){_0x17a9cd(null,_0x10db6d?_0x10db6d['name']:![]);})[_0x8a90('0x13')](function(_0x5b1372){_0x17a9cd(_0x5b1372);});};AGIVertices[_0x8a90('0xd')][_0x8a90('0x49')]=function(_0x22f5ad,_0x1da003,_0x46a464){var _0x288d0d={'role':_0x8a90('0x4a')};_0x288d0d[_0x22f5ad]=this[_0x8a90('0x30')][_0x8a90('0x35')];this[_0x8a90('0xc')][_0x8a90('0x49')](_0x288d0d,_0x1da003,this[_0x8a90('0x30')]['uniqueid'])[_0x8a90('0xf')](function(_0x349b13){_0x46a464(null,_[_0x8a90('0x3e')](_0x349b13)?![]:!![]);})[_0x8a90('0x13')](function(_0x5e8514){logger[_0x8a90('0x25')](_0x5e8514);_0x46a464(null,![]);});};AGIVertices[_0x8a90('0xd')]['agentUnpause']=function(_0x5166ff,_0x15e160){var _0x3ff756={'role':_0x8a90('0x4a')};_0x3ff756[_0x5166ff]=this[_0x8a90('0x30')][_0x8a90('0x35')];this[_0x8a90('0xc')]['agentUnpause'](_0x3ff756)[_0x8a90('0xf')](function(_0x48e098){_0x15e160(null,_[_0x8a90('0x3e')](_0x48e098)?![]:!![]);})[_0x8a90('0x13')](function(_0x374391){logger[_0x8a90('0x25')](_0x374391);_0x15e160(null,![]);});};AGIVertices[_0x8a90('0xd')][_0x8a90('0x4b')]=function(_0x4ed8c3,_0x6a3147){var _0xd05cc1={'role':'agent'};_0xd05cc1[_0x4ed8c3]=this[_0x8a90('0x30')][_0x8a90('0x35')];this['rpc'][_0x8a90('0x4b')](_0xd05cc1)[_0x8a90('0xf')](function(_0x937cc4){_0x6a3147(null,_['isNil'](_0x937cc4)?![]:!![]);})[_0x8a90('0x13')](function(_0x83cdee){logger[_0x8a90('0x25')](_0x83cdee);_0x6a3147(null,![]);});};AGIVertices[_0x8a90('0xd')][_0x8a90('0x4c')]=function(_0x122484,_0x4e01a7){var _0xf98680={'role':_0x8a90('0x4a')};_0xf98680[_0x122484]=this[_0x8a90('0x30')][_0x8a90('0x35')];var _0xc99868=_0x122484!=_0x8a90('0x4d')?util['format'](_0x8a90('0x4e'),'LOCAL',this[_0x8a90('0x30')][_0x8a90('0x35')]):undefined;this[_0x8a90('0xc')][_0x8a90('0x4c')](_0xf98680,_0xc99868)[_0x8a90('0xf')](function(_0x321601){_0x4e01a7(null,_[_0x8a90('0x3e')](_0x321601)?![]:!![]);})[_0x8a90('0x13')](function(_0xf2a226){logger[_0x8a90('0x25')](_0xf2a226);_0x4e01a7(null,![]);});};AGIVertices['prototype'][_0x8a90('0x4f')]=function(_0x47bcda,_0x1b6a15){sh[_0x8a90('0x50')](_[_0x8a90('0x51')](_0x47bcda),function(_0x3f6273,_0x11d1ab){var _0xcd2ad8=_0x11d1ab[_0x8a90('0x52')](/(\r\n|\n|\r)/gm,'');_0x1b6a15(null,_0xcd2ad8);});};AGIVertices[_0x8a90('0xd')][_0x8a90('0x53')]=function(_0x5934f4,_0x31d01f){scripts['googleCloudTTS'](_0x5934f4[_0x8a90('0x54')],_0x5934f4[_0x8a90('0x55')]||_0x8a90('0x56'),_0x5934f4['text'],_0x5934f4['languageCode']||_0x8a90('0x57'),_0x5934f4[_0x8a90('0x58')]||_0x8a90('0x59'),_0x5934f4[_0x8a90('0x5a')]||_0x8a90('0x5b'))['then'](function(_0x2f6509){_0x31d01f(null,_0x2f6509);})['catch'](function(_0x35046c){_0x31d01f(_0x35046c);});};AGIVertices['prototype']['googleTTS']=function(_0x28ca91,_0x51621c){scripts[_0x8a90('0x5c')](_0x28ca91[_0x8a90('0x56')],_0x28ca91[_0x8a90('0x5d')]||'en',0x1)[_0x8a90('0xf')](function(_0x3a8ed0){_0x51621c(null,_0x3a8ed0);})['catch'](function(_0x4ae34e){_0x51621c(_0x4ae34e);});};AGIVertices['prototype'][_0x8a90('0x5e')]=function(_0x46c969,_0x520e0a){scripts[_0x8a90('0x5e')](this[_0x8a90('0x30')][_0x8a90('0x31')],_0x46c969[_0x8a90('0x5f')],_0x46c969['text'],_0x46c969[_0x8a90('0x60')]||'en')[_0x8a90('0xf')](function(_0x21b99a){_0x520e0a(null,_0x21b99a);})['catch'](function(_0x328278){_0x520e0a(_0x328278);});};AGIVertices[_0x8a90('0xd')]['sestekNDA']=function(_0x251243,_0xd837d9){scripts['sestekNDA'](this[_0x8a90('0x30')],_0x251243)['then'](function(_0x53ecc6){_0xd837d9(null,_0x53ecc6);})['catch'](function(_0x36c4d9){_0xd837d9(_0x36c4d9);});};AGIVertices[_0x8a90('0xd')][_0x8a90('0x61')]=function(_0x48701a,_0x1d9904){scripts[_0x8a90('0x61')](_0x48701a['key'],_0x48701a[_0x8a90('0x56')],_0x48701a[_0x8a90('0x62')]||_0x8a90('0x57'),_0x48701a[_0x8a90('0x63')])['then'](function(_0xb6dc5e){_0x1d9904(null,_0xb6dc5e);})[_0x8a90('0x13')](function(_0x1af1c3){_0x1d9904(_0x1af1c3);});};AGIVertices[_0x8a90('0xd')][_0x8a90('0x64')]=function(_0x47e22a,_0x120ba1,_0x3d2de8){scripts[_0x8a90('0x64')](_0x120ba1,_0x47e22a[_0x8a90('0x5f')],_0x47e22a[_0x8a90('0x65')]||_0x8a90('0x57'),this[_0x8a90('0x66')](_0x47e22a['model'])?_0x47e22a[_0x8a90('0x67')]:undefined)['then'](function(_0x2c7399){_0x3d2de8(null,_0x2c7399);})[_0x8a90('0x13')](function(_0x37ffac){_0x3d2de8(_0x37ffac);});};AGIVertices[_0x8a90('0xd')]['awsPolly']=function(_0x1f8534,_0x2be003){scripts['awsPolly'](_0x1f8534[_0x8a90('0x68')],_0x1f8534[_0x8a90('0x69')],_0x1f8534[_0x8a90('0x6a')],_0x1f8534[_0x8a90('0x6b')]||_0x8a90('0x6c'),_0x1f8534[_0x8a90('0x56')],_0x1f8534[_0x8a90('0x6d')]||'text')[_0x8a90('0xf')](function(_0x5c3757){_0x2be003(null,_0x5c3757);})[_0x8a90('0x13')](function(_0x5b8285){_0x2be003(_0x5b8285);});};AGIVertices[_0x8a90('0xd')][_0x8a90('0x6e')]=function(_0x45857a,_0x1fd51c){scripts[_0x8a90('0x6e')](this[_0x8a90('0x30')][_0x8a90('0x31')],_0x45857a[_0x8a90('0x68')],_0x45857a[_0x8a90('0x69')],_0x45857a['aws_lex_region'],_0x45857a[_0x8a90('0x56')],_0x45857a['aws_bot_name'])['then'](function(_0x20306a){_0x1fd51c(null,_0x20306a);})[_0x8a90('0x13')](function(_0x47b26b){_0x1fd51c(_0x47b26b);});};AGIVertices['prototype'][_0x8a90('0x6f')]=function(_0x856d2c,_0x300aa0,_0x56b6f6){scripts['googleASR'](_0x300aa0,_0x856d2c['key'],_0x856d2c[_0x8a90('0x70')]||_0x8a90('0x57'))[_0x8a90('0xf')](function(_0x1e251c){_0x56b6f6(null,_0x1e251c);})['catch'](function(_0x22e8d0){_0x56b6f6(_0x22e8d0);});};AGIVertices[_0x8a90('0xd')][_0x8a90('0x71')]=function(_0x295cf6,_0x503c48,_0x17f1d5){scripts['tildeASR'](_0x503c48,_0x295cf6[_0x8a90('0x72')],_0x295cf6[_0x8a90('0x73')],_0x295cf6[_0x8a90('0x74')])[_0x8a90('0xf')](function(_0x1e5785){_0x17f1d5(null,_0x1e5785);})[_0x8a90('0x13')](function(_0x53f51e){_0x17f1d5(_0x53f51e);});};AGIVertices[_0x8a90('0xd')][_0x8a90('0x75')]=function(_0x40180d){var _0x44defe=_[_0x8a90('0x76')](verticesWithRetry,_0x40180d[_0x8a90('0x33')])?_0x40180d:_[_0x8a90('0x77')](_0x40180d);for(var _0x26a8b5 in _0x44defe){if(_0x44defe[_0x8a90('0x78')](_0x26a8b5)){if(_0x44defe[_0x26a8b5]&&_[_0x8a90('0x79')](_0x44defe[_0x26a8b5])){_0x44defe[_0x26a8b5]=this['replaceAllVariables'](_0x44defe[_0x26a8b5]);}}}return _0x44defe;};AGIVertices[_0x8a90('0xd')][_0x8a90('0x7a')]=function(_0x56f248){var _0xb264e7=_0x56f248[_0x8a90('0x7b')]('{');for(var _0x3defbc=0x1;_0x3defbc<_0xb264e7['length'];_0x3defbc+=0x1){var _0x59108a=_0xb264e7[_0x3defbc][_0x8a90('0x7b')]('}');if(_0x59108a[_0x8a90('0x7c')]>0x1){_0x56f248=_0x56f248['replaceAll']('{'+_0x59108a[0x0]+'}',this['channel'][_0x8a90('0x7d')](_0x59108a[0x0])[_0x8a90('0x7e')]||_0x59108a[0x0]);}}if(_0xb264e7[_0x8a90('0x7c')]===0x1){return _0x56f248[_0x8a90('0x46')]();}return this[_0x8a90('0x7a')](_0x56f248);};AGIVertices[_0x8a90('0xd')][_0x8a90('0x7f')]=function(_0x108651,_0x16b427){var _0x56ea27=this[_0x8a90('0x30')]['getVariable'](_0x108651);if(_0x56ea27[_0x8a90('0x80')]===-0x1){return _0x56ea27;}logger['info'](util[_0x8a90('0x21')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x16b427,_0x56ea27[_0x8a90('0x7e')]));return this[_0x8a90('0x30')][_0x8a90('0x81')](_0x16b427,_0x56ea27[_0x8a90('0x7e')]);};AGIVertices[_0x8a90('0xd')][_0x8a90('0x66')]=function(_0x120e1c){return _0x120e1c&&_0x120e1c!=='0'&&_0x120e1c!=='-1'&&_0x120e1c!=='';};AGIVertices[_0x8a90('0xd')][_0x8a90('0x82')]=function(_0x211f0f){this[_0x8a90('0x2f')][_0x8a90('0x83')](this,_0x211f0f,'-');_0x211f0f['retry']=_0x211f0f['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0x8a90('0xd')][_0x8a90('0x84')]=function(_0x339df0){logger[_0x8a90('0x26')](util[_0x8a90('0x21')](_0x8a90('0x85'),_0x339df0['label']));return this[_0x8a90('0x30')]['agi']([_0x339df0[_0x8a90('0x86')],_0x339df0[_0x8a90('0x87')]]);};AGIVertices[_0x8a90('0xd')][_0x8a90('0x88')]=function(_0x2ace8f){logger[_0x8a90('0x26')](util[_0x8a90('0x21')](_0x8a90('0x89'),_0x2ace8f['label']));if(this[_0x8a90('0x66')](_0x2ace8f[_0x8a90('0x8a')])){logger[_0x8a90('0x26')](util[_0x8a90('0x21')](_0x8a90('0x8b'),_0x2ace8f[_0x8a90('0x8a')]));var _0x5dffb0=this[_0x8a90('0x30')][_0x8a90('0x8c')](_0x2ace8f['timeout']);if(_0x5dffb0['result']===-0x1){return _0x5dffb0;}}return this[_0x8a90('0x30')][_0x8a90('0x88')]();};AGIVertices[_0x8a90('0xd')][_0x8a90('0x44')]=function(_0x3df6d5){logger[_0x8a90('0x26')](util[_0x8a90('0x21')]('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x3df6d5['label']));if(!this['isConfigured'](_0x3df6d5[_0x8a90('0x8d')])){return this['channel'][_0x8a90('0x25')](_0x3df6d5,'no\x20list\x20selected');}_0x3df6d5['scheduledAt']=moment();if(this[_0x8a90('0x66')](_0x3df6d5['delay'])){_0x3df6d5[_0x8a90('0x43')]=moment()['add'](_0x3df6d5[_0x8a90('0x8e')],'minutes');}if(!this['isConfigured'](_0x3df6d5[_0x8a90('0x8f')])){_0x3df6d5[_0x8a90('0x8f')]=0x2;}this[_0x8a90('0x3c')]['sync'](this,_0x3df6d5);return this[_0x8a90('0x30')]['noop'](util['format'](_0x8a90('0x90'),_0x3df6d5[_0x8a90('0x42')],_0x3df6d5[_0x8a90('0x8d')],_0x3df6d5[_0x8a90('0x43')]));};AGIVertices[_0x8a90('0xd')]['custom_app']=function(_0x364bae){logger[_0x8a90('0x26')](util[_0x8a90('0x21')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x364bae[_0x8a90('0x32')]));var _0x12e1b8=this[_0x8a90('0x30')]['exec'](_0x364bae[_0x8a90('0x91')],_0x364bae['options']);if(_0x12e1b8[_0x8a90('0x80')]===-0x1){return _0x12e1b8;}return this[_0x8a90('0x30')]['noop'](util[_0x8a90('0x21')](_0x8a90('0x92'),_0x364bae[_0x8a90('0x91')],_0x364bae[_0x8a90('0x93')]));};AGIVertices['prototype'][_0x8a90('0x94')]=function(_0x273ff7){logger[_0x8a90('0x26')](util[_0x8a90('0x21')](_0x8a90('0x95'),_0x273ff7[_0x8a90('0x32')]));if(!this[_0x8a90('0x66')](_0x273ff7[_0x8a90('0x56')])){return this[_0x8a90('0x30')][_0x8a90('0x96')](_0x8a90('0x97'));}var _0x5dc3e5='\x22'+_0x273ff7[_0x8a90('0x56')]+'\x22';if(this[_0x8a90('0x66')](_0x273ff7['options'])){_0x5dc3e5+=','+_0x273ff7[_0x8a90('0x93')];}var _0x4e6570=this[_0x8a90('0x30')][_0x8a90('0x50')](_0x8a90('0x98'),_0x5dc3e5);if(_0x4e6570[_0x8a90('0x80')]===-0x1){return _0x4e6570;}return this['channel'][_0x8a90('0x96')](util[_0x8a90('0x21')](_0x8a90('0x99'),_0x5dc3e5));};AGIVertices['prototype'][_0x8a90('0x9a')]=function(_0x12277f){logger['info'](util['format'](_0x8a90('0x9b'),_0x12277f['label']));if(!this[_0x8a90('0x66')](_0x12277f[_0x8a90('0x56')])){return this[_0x8a90('0x30')][_0x8a90('0x96')](_0x8a90('0x97'));}var _0x51cb09='\x22'+_0x12277f[_0x8a90('0x56')]+'\x22';if(this[_0x8a90('0x66')](_0x12277f[_0x8a90('0x93')])){_0x51cb09+=','+_0x12277f[_0x8a90('0x93')];}var _0x3f0922=this['channel'][_0x8a90('0x50')](_0x8a90('0x98'),_0x51cb09);if(_0x3f0922[_0x8a90('0x80')]===-0x1){return _0x3f0922;}return this[_0x8a90('0x30')][_0x8a90('0x96')](util[_0x8a90('0x21')](_0x8a90('0x99'),_0x51cb09));};AGIVertices['prototype'][_0x8a90('0x9c')]=function(_0x997841){logger[_0x8a90('0x26')](util['format'](_0x8a90('0x9d'),_0x997841[_0x8a90('0x32')]));if(!this[_0x8a90('0x66')](_0x997841[_0x8a90('0x9e')])){return this['channel'][_0x8a90('0x96')]('no\x20grammar\x20configured');}var _0x3ae6f8=_0x997841[_0x8a90('0x9e')];if(this[_0x8a90('0x66')](_0x997841['options'])){_0x3ae6f8+=','+_0x997841[_0x8a90('0x93')];}var _0x36ff88=this['channel'][_0x8a90('0x50')](_0x8a90('0x9f'),_0x3ae6f8);if(_0x36ff88[_0x8a90('0x80')]===-0x1){return _0x36ff88;}var _0x4ce59f=this[_0x8a90('0x7f')](_0x8a90('0xa0'),_0x8a90('0xa1'));if(_0x4ce59f[_0x8a90('0x80')]===-0x1){return _0x4ce59f;}var _0x510c43=this['getAndSetVariable']('RECOG_INPUT()',_0x8a90('0xa2'));if(_0x510c43[_0x8a90('0x80')]===-0x1){return _0x510c43;}var _0x318e6a=this[_0x8a90('0x7f')](_0x8a90('0xa3'),_0x8a90('0xa4'));if(_0x318e6a[_0x8a90('0x80')]===-0x1){return _0x318e6a;}return this['channel']['noop'](util[_0x8a90('0x21')](_0x8a90('0xa5'),_0x3ae6f8));};AGIVertices[_0x8a90('0xd')]['sestekasr']=function(_0xb17cbd){logger[_0x8a90('0x26')](util['format'](_0x8a90('0xa6'),_0xb17cbd[_0x8a90('0x32')]));if(!this[_0x8a90('0x66')](_0xb17cbd['grammar'])){return this[_0x8a90('0x30')]['noop']('no\x20grammar\x20configured');}var _0x5d3c0c=_0xb17cbd[_0x8a90('0x9e')];if(this[_0x8a90('0x66')](_0xb17cbd[_0x8a90('0x93')])){_0x5d3c0c+=','+_0xb17cbd[_0x8a90('0x93')];}var _0x4f182f=this['channel'][_0x8a90('0x50')](_0x8a90('0x9f'),_0x5d3c0c);if(_0x4f182f[_0x8a90('0x80')]===-0x1){return _0x4f182f;}var _0x2f1810=this[_0x8a90('0x7f')](_0x8a90('0xa0'),'SESTEK_ASR_CONFIDENCE');if(_0x2f1810[_0x8a90('0x80')]===-0x1){return _0x2f1810;}var _0x6d0285=this[_0x8a90('0x7f')](_0x8a90('0xa7'),_0x8a90('0xa8'));if(_0x6d0285[_0x8a90('0x80')]===-0x1){return _0x6d0285;}var _0xb81db5=this[_0x8a90('0x7f')](_0x8a90('0xa3'),_0x8a90('0xa9'));if(_0xb81db5[_0x8a90('0x80')]===-0x1){return _0xb81db5;}return this[_0x8a90('0x30')][_0x8a90('0x96')](util[_0x8a90('0x21')](_0x8a90('0xa5'),_0x5d3c0c));};AGIVertices['prototype']['database']=function(_0x4d6269){logger[_0x8a90('0x26')](util[_0x8a90('0x21')](_0x8a90('0xaa'),_0x4d6269[_0x8a90('0x32')]));if(!this[_0x8a90('0x66')](_0x4d6269[_0x8a90('0xab')])){return this[_0x8a90('0x30')][_0x8a90('0x25')](_0x4d6269,'no\x20database\x20selected');}var _0x414f68=this[_0x8a90('0x15')][_0x8a90('0x83')](this,_0x4d6269[_0x8a90('0xab')]);if(!_0x414f68){return this[_0x8a90('0x30')][_0x8a90('0x25')](_0x4d6269,_0x8a90('0xac'));}if(!this['isConfigured'](_0x4d6269[_0x8a90('0x28')])){return this[_0x8a90('0x30')][_0x8a90('0x25')](_0x4d6269,_0x8a90('0xad'));}var _0x1d45fc=_0x4d6269[_0x8a90('0x28')]['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0x8a90('0x30')][_0x8a90('0x96')](util[_0x8a90('0x21')](_0x8a90('0xae'),_0x1d45fc));var _0x30c639=this[_0x8a90('0x23')][_0x8a90('0x83')](this,_0x414f68,_0x1d45fc);this[_0x8a90('0x2f')][_0x8a90('0x83')](this,_0x4d6269,_0x1d45fc);if(!this['isConfigured'](_0x4d6269[_0x8a90('0xaf')])){return this['channel']['noop'](_0x8a90('0xb0'));}var _0x2f97bc=this['getVariable']['sync'](this,_0x4d6269['variable_id']);if(!_0x2f97bc){return this[_0x8a90('0x30')]['error'](_0x4d6269,'no\x20variable\x20found');}var _0x10f5fe=this;_0x30c639[_0x8a90('0xb1')](function(_0x263c16,_0xec3c9){Object[_0x8a90('0xb2')](_0x263c16)[_0x8a90('0xb1')](function(_0x4ed471){_0x10f5fe[_0x8a90('0x30')][_0x8a90('0x81')](util['format'](_0x8a90('0xb3'),_0x2f97bc,_0xec3c9,_0x4ed471),_0x263c16[_0x4ed471]);});});this['channel'][_0x8a90('0x81')](util[_0x8a90('0x21')](_0x8a90('0xb4'),_0x2f97bc),_0x30c639[_0x8a90('0x7c')]);return this[_0x8a90('0x30')]['noop'](util[_0x8a90('0x21')]('variable\x20%s\x20set',_0x2f97bc));};AGIVertices[_0x8a90('0xd')][_0x8a90('0xb5')]=function(_0x36bab2){logger[_0x8a90('0xb6')](util['format'](_0x8a90('0xb7'),_0x36bab2[_0x8a90('0x32')]));if(!this['isConfigured'](_0x36bab2[_0x8a90('0xb8')])){return this['channel'][_0x8a90('0x25')](_0x36bab2,_0x8a90('0xb9'));}var _0x194738=this[_0x8a90('0xba')][_0x8a90('0x83')](this,_0x36bab2[_0x8a90('0xb8')]);if(!_0x194738){return this[_0x8a90('0x30')][_0x8a90('0x25')](_0x36bab2,_0x8a90('0xbb'));}var _0x565bc8=this[_0x8a90('0x30')][_0x8a90('0x50')]('DIAL',[util[_0x8a90('0x21')](_0x8a90('0xbc'),_0x194738),_0x36bab2['timeout'],_0x36bab2[_0x8a90('0xbd')],_0x36bab2[_0x8a90('0xbe')]]);if(_0x565bc8[_0x8a90('0x80')]===-0x1){return _0x565bc8;}return this[_0x8a90('0x30')][_0x8a90('0x96')](util[_0x8a90('0x21')](_0x8a90('0xbf'),_0x8a90('0xc0')));};AGIVertices['prototype'][_0x8a90('0xc1')]=function(_0x2565f1){logger[_0x8a90('0x26')](util[_0x8a90('0x21')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x2565f1[_0x8a90('0x32')]));if(!this[_0x8a90('0x66')](_0x2565f1['key'])){return this['channel'][_0x8a90('0x96')](_0x8a90('0xc2'));}if(!this['isConfigured'](_0x2565f1[_0x8a90('0x56')])){return this[_0x8a90('0x30')][_0x8a90('0x96')]('no\x20text\x20configured');}this[_0x8a90('0x30')]['bot']=!![];this['createSquareDetailsReport'](_0x2565f1);this[_0x8a90('0xc3')](_0x2565f1[_0x8a90('0x56')],'in');this[_0x8a90('0x30')][_0x8a90('0x96')](util[_0x8a90('0x21')](_0x8a90('0xc4'),_0x2565f1[_0x8a90('0x56')]));var _0x239a4c=this[_0x8a90('0x5e')][_0x8a90('0x83')](this,_0x2565f1);if(_0x239a4c){for(var _0x1e5d53 in _0x239a4c){if(_0x239a4c[_0x8a90('0x78')](_0x1e5d53)){this[_0x8a90('0x30')][_0x8a90('0x81')](util[_0x8a90('0x21')](_0x8a90('0xc5'),_0x1e5d53[_0x8a90('0xc6')]()),_0x239a4c[_0x1e5d53]);}}this[_0x8a90('0xc3')](_0x239a4c[_0x8a90('0xc7')],_0x8a90('0xc8'));return this['channel'][_0x8a90('0x96')](util[_0x8a90('0x21')](_0x8a90('0xc9'),_0x239a4c[_0x8a90('0xc7')]));}return this['channel']['error'](_0x2565f1,_0x8a90('0xca'));};AGIVertices[_0x8a90('0xd')]['sesteknda']=function(_0x37bfce){logger[_0x8a90('0x26')](util[_0x8a90('0x21')](_0x8a90('0xcb'),_0x37bfce['label']));if(!this[_0x8a90('0x66')](_0x37bfce[_0x8a90('0xcc')])){return this[_0x8a90('0x30')][_0x8a90('0x96')]('no\x20ndauth\x20url\x20configured');}if(!this[_0x8a90('0x66')](_0x37bfce['username'])){return this[_0x8a90('0x30')]['noop']('no\x20username\x20configured');}if(!this[_0x8a90('0x66')](_0x37bfce[_0x8a90('0xcd')])){return this['channel']['noop'](_0x8a90('0xce'));}if(!this[_0x8a90('0x66')](_0x37bfce['ndassistant_url'])){return this[_0x8a90('0x30')][_0x8a90('0x96')]('no\x20text\x20configured');}this[_0x8a90('0x30')]['bot']=!![];this['createSquareDetailsReport'](_0x37bfce);this[_0x8a90('0xc3')](_0x37bfce[_0x8a90('0x56')],'in');this[_0x8a90('0x30')][_0x8a90('0x96')](util[_0x8a90('0x21')](_0x8a90('0xcf'),_0x37bfce[_0x8a90('0x56')]));var _0x1c038b=this['sestekNDA']['sync'](this,_0x37bfce);if(_0x1c038b){for(var _0xd59b04 in _0x1c038b){if(_0x1c038b[_0x8a90('0x78')](_0xd59b04)){this[_0x8a90('0x30')][_0x8a90('0x81')](util[_0x8a90('0x21')](_0x8a90('0xd0'),_0xd59b04[_0x8a90('0xc6')]()),_0x1c038b[_0xd59b04]);}}this['createSquareMessage'](_0x1c038b[_0x8a90('0xc7')],_0x8a90('0xc8'));if(_0x1c038b[_0x8a90('0xd1')]){this[_0x8a90('0x30')][_0x8a90('0x96')](util[_0x8a90('0x21')](_0x8a90('0xd2'),_0x1c038b[_0x8a90('0xd1')]));var _0x127716=this[_0x8a90('0x30')][_0x8a90('0xd3')](_0x1c038b[_0x8a90('0xd1')]);try{fs[_0x8a90('0xd4')](_0x1c038b[_0x8a90('0xd1')]+'.wav');}catch(_0x593aae){logger[_0x8a90('0x25')](_0x593aae);}return _0x127716;}else{return this[_0x8a90('0x30')][_0x8a90('0x96')](util['format']('SestekNDA\x20Result\x20%s',_0x1c038b[_0x8a90('0xc7')]));}}return this['channel'][_0x8a90('0x25')](_0x37bfce,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0x8a90('0xd')][_0x8a90('0xd5')]=function(_0x26b3e1){logger[_0x8a90('0x26')](util[_0x8a90('0x21')](_0x8a90('0xd6'),_0x26b3e1[_0x8a90('0x32')]));return this[_0x8a90('0x30')]['noop'](_0x8a90('0xd5'));};AGIVertices[_0x8a90('0xd')][_0x8a90('0xd7')]=function(_0x31ec6c){logger['info'](util['format']('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x31ec6c[_0x8a90('0x32')]));var _0x44cb43='';if(_0x31ec6c['trunk_id']){if(!this[_0x8a90('0x66')](_0x31ec6c[_0x8a90('0xd8')])){return this['channel']['error'](_0x31ec6c,_0x8a90('0xd9'));}else{var _0xff0e85=parseInt(_0x31ec6c[_0x8a90('0xd8')],0xa);if(isNaN(_0xff0e85)){_0x44cb43=_0x31ec6c[_0x8a90('0xd8')];}else{_0x44cb43=this['getTrunk']['sync'](this,_0x31ec6c['trunk_id']);if(!_0x44cb43){return this[_0x8a90('0x30')]['error'](_0x31ec6c,_0x8a90('0xda'));}}}}else if(_0x31ec6c['trunk_name']){_0x44cb43=_0x31ec6c['trunk_name'];}else{return this[_0x8a90('0x30')]['error'](_0x31ec6c,_0x8a90('0xd9'));}var _0x1b8fdb=this[_0x8a90('0x30')][_0x8a90('0x50')](_0x8a90('0xc0'),[util['format']('SIP/%s/%s',_0x44cb43,_0x31ec6c[_0x8a90('0x42')]),_0x31ec6c[_0x8a90('0x8a')],_0x31ec6c[_0x8a90('0xbd')],_0x31ec6c[_0x8a90('0xbe')]]);if(_0x1b8fdb['result']===-0x1){return _0x1b8fdb;}return this['channel'][_0x8a90('0x96')](util[_0x8a90('0x21')](_0x8a90('0xbf'),_0x8a90('0xc0')));};AGIVertices[_0x8a90('0xd')]['finally']=function(_0x421b8c){logger[_0x8a90('0x26')](util[_0x8a90('0x21')](_0x8a90('0xdb'),_0x421b8c['label']));return this[_0x8a90('0x30')]['noop']('finally');};AGIVertices[_0x8a90('0xd')][_0x8a90('0xa')]=function(_0x221dd2){logger[_0x8a90('0x26')](util[_0x8a90('0x21')](_0x8a90('0xdc'),_0x221dd2[_0x8a90('0x32')]));if(_0x221dd2['retry']===0x0){return this[_0x8a90('0x82')](_0x221dd2);}_0x221dd2['retry']-=0x1;if(!this[_0x8a90('0x66')](_0x221dd2['file_id'])){return this[_0x8a90('0x30')][_0x8a90('0x25')](_0x221dd2,_0x8a90('0xdd'));}var _0x272a3c=this['getSound']['sync'](this,_0x221dd2[_0x8a90('0xde')]);if(!_0x272a3c){return this['channel'][_0x8a90('0x25')](_0x221dd2,_0x8a90('0xdf'));}if(!this[_0x8a90('0x66')](_0x221dd2['variable_id'])){return this[_0x8a90('0x30')][_0x8a90('0x25')](_0x8a90('0xb0'));}var _0x43d311=this['channel'][_0x8a90('0xe0')](_0x272a3c,_0x221dd2[_0x8a90('0xe1')],_0x221dd2[_0x8a90('0xe2')]);var _0x33407b=_0x43d311[_0x8a90('0x80')]?_0x43d311['result'][_0x8a90('0x46')]():'';logger[_0x8a90('0x26')]('test',JSON[_0x8a90('0xe3')](_0x43d311));if(_0x43d311['result']===-0x1){this[_0x8a90('0x2f')][_0x8a90('0x83')](this,_0x221dd2,_0x33407b);return _0x43d311;}else if(_0x43d311['extra']===_0x8a90('0x8a')){_0x43d311[_0x8a90('0x80')]=_0x33407b[_0x8a90('0x7c')]>=parseInt(_0x221dd2[_0x8a90('0xe4')])?'x':'i';}else{_0x43d311['result']=_0x33407b[_0x8a90('0x7c')]>=parseInt(_0x221dd2[_0x8a90('0xe4')])&&_0x33407b[_0x8a90('0x7c')]<=parseInt(_0x221dd2['maxdigit'])?'x':'i';}var _0xe41469=this[_0x8a90('0x7d')]['sync'](this,_0x221dd2[_0x8a90('0xaf')]);if(!_0xe41469){return this[_0x8a90('0x30')][_0x8a90('0x25')](_0x221dd2,_0x8a90('0xe5'));}this['channel'][_0x8a90('0x81')](_0xe41469,_0x33407b);if(this[_0x8a90('0x66')](_0x221dd2['hiddendigitsnum'])){var _0x6b7c87=parseInt(_0x221dd2[_0x8a90('0xe6')],0xa);var _0x4a14ba=rs[_0x8a90('0xe7')]({'charset':'*','length':_0x6b7c87});var _0x276d33=_0x33407b[_0x8a90('0x7c')];if(_0x276d33>0x0){if(_0x276d33>_0x6b7c87){this[_0x8a90('0x2f')][_0x8a90('0x83')](this,_0x221dd2,_0x221dd2['hiddendigitspos']===_0x8a90('0xe8')?_0x4a14ba+_0x33407b[_0x8a90('0xe9')](_0x6b7c87):_0x33407b['substr'](0x0,_0x276d33-_0x6b7c87)+_0x4a14ba);}else{this['createSquareDetailsReport'][_0x8a90('0x83')](this,_0x221dd2,rs[_0x8a90('0xe7')]({'charset':'*','length':_0x276d33}));}}else{this['createSquareDetailsReport'][_0x8a90('0x83')](this,_0x221dd2,'');}}else{this[_0x8a90('0x2f')][_0x8a90('0x83')](this,_0x221dd2,_0x33407b);}return _0x43d311;};AGIVertices['prototype'][_0x8a90('0xb')]=function(_0x385e15){logger[_0x8a90('0x26')](util['format'](_0x8a90('0xea'),_0x385e15[_0x8a90('0x32')]));return this[_0x8a90('0xa')](_0x385e15);};AGIVertices[_0x8a90('0xd')][_0x8a90('0xeb')]=function(_0x5e8bf5){logger[_0x8a90('0x26')](util[_0x8a90('0x21')](_0x8a90('0xec'),_0x5e8bf5['label']));this[_0x8a90('0x2f')][_0x8a90('0x83')](this,_0x5e8bf5,_0x5e8bf5[_0x8a90('0xed')]);return this[_0x8a90('0x30')][_0x8a90('0x96')](util[_0x8a90('0x21')](_0x8a90('0xee'),_0x5e8bf5[_0x8a90('0xed')]));};AGIVertices[_0x8a90('0xd')]['awspolly']=function(_0x3ba345){logger[_0x8a90('0x26')](util[_0x8a90('0x21')](_0x8a90('0xef'),_0x3ba345['label']));if(!this[_0x8a90('0x66')](_0x3ba345['aws_access_key_id'])||!this[_0x8a90('0x66')](_0x3ba345[_0x8a90('0x69')])){return this[_0x8a90('0x30')][_0x8a90('0x96')]('no\x20valid\x20credentials\x20configured');}if(!this[_0x8a90('0x66')](_0x3ba345[_0x8a90('0x56')])){return this[_0x8a90('0x30')][_0x8a90('0x96')](_0x8a90('0x97'));}this[_0x8a90('0x30')][_0x8a90('0x96')](util['format']('Trying\x20aws\x20Polly\x20%s',_0x3ba345[_0x8a90('0x56')]));var _0x24eb22=this[_0x8a90('0xf0')][_0x8a90('0x83')](this,_0x3ba345);if(_0x24eb22){this[_0x8a90('0x30')][_0x8a90('0x96')](util[_0x8a90('0x21')](_0x8a90('0xf1'),_0x24eb22));var _0x581976=this[_0x8a90('0x30')][_0x8a90('0xd3')](_0x24eb22);try{fs[_0x8a90('0xd4')](_0x24eb22+'.wav');}catch(_0x276318){logger[_0x8a90('0x25')](_0x276318);}return _0x581976;}return this[_0x8a90('0x30')]['error'](_0x3ba345,_0x8a90('0xf2'));};AGIVertices[_0x8a90('0xd')][_0x8a90('0xf3')]=function(_0x27ece6){logger[_0x8a90('0x26')](util[_0x8a90('0x21')](_0x8a90('0xf4'),_0x27ece6[_0x8a90('0x32')]));if(!this[_0x8a90('0x66')](_0x27ece6[_0x8a90('0x68')])||!this[_0x8a90('0x66')](_0x27ece6[_0x8a90('0x69')])){return this['channel'][_0x8a90('0x96')](_0x8a90('0xf5'));}if(!this[_0x8a90('0x66')](_0x27ece6[_0x8a90('0xf6')])){return this['channel'][_0x8a90('0x96')](_0x8a90('0xf7'));}if(!this['isConfigured'](_0x27ece6[_0x8a90('0x56')])){return this[_0x8a90('0x30')][_0x8a90('0x96')]('no\x20text\x20configured');}this[_0x8a90('0x30')][_0x8a90('0xf8')]=!![];this[_0x8a90('0x2f')](_0x27ece6);this[_0x8a90('0xc3')](_0x27ece6[_0x8a90('0x56')],'in');this['channel']['noop'](util[_0x8a90('0x21')](_0x8a90('0xf9'),_0x27ece6['text']));var _0x1278b2=this['awsLex']['sync'](this,_0x27ece6);if(_0x1278b2){for(var _0x34679b in _0x1278b2){if(_0x1278b2[_0x8a90('0x78')](_0x34679b)&&_[_0x8a90('0x79')](_0x1278b2[_0x34679b])){this['channel'][_0x8a90('0x81')](util[_0x8a90('0x21')](_0x8a90('0xfa'),_0x34679b[_0x8a90('0xc6')]()),_0x1278b2[_0x34679b]);}}if(_['isNil'](_0x1278b2[_0x8a90('0xfb')])){return this[_0x8a90('0x30')]['noop']('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0x8a90('0xc3')](_0x1278b2[_0x8a90('0xfb')],_0x8a90('0xc8'));return this[_0x8a90('0x30')]['noop'](util['format']('Amazon\x20Lex\x20Result\x20%s',_0x1278b2[_0x8a90('0xfb')]));}}return this['channel'][_0x8a90('0x25')](_0x27ece6,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices['prototype'][_0x8a90('0xfc')]=function(_0x56123f){logger[_0x8a90('0x26')](util['format'](_0x8a90('0xfd'),_0x56123f[_0x8a90('0x32')],_0x56123f[_0x8a90('0x8a')]));if(!this[_0x8a90('0x66')](_0x56123f[_0x8a90('0x5f')])){return this[_0x8a90('0x30')]['noop']('no\x20key\x20configured');}var _0x312415=_0x8a90('0xfe');var _0x4aebb4=util['format']('%s/recordings/%s',FILES_PATH,rs[_0x8a90('0xe7')](0x4));var _0x51782f=util[_0x8a90('0x21')](_0x8a90('0xff'),_0x4aebb4,_0x312415);var _0x54aefc=!![];if(_0x56123f[_0x8a90('0x100')]==='NOBEEP'){_0x54aefc=![];}var _0xda0a97=this[_0x8a90('0x30')]['recordFile'](_0x4aebb4,_0x312415,_0x56123f['intKey'],_0x56123f[_0x8a90('0x8a')],undefined,_0x54aefc);if(_0xda0a97[_0x8a90('0x80')]!==-0x1){this[_0x8a90('0x30')][_0x8a90('0x96')](util[_0x8a90('0x21')]('google\x20%s\x20file\x20created',_0x51782f));var _0x5410d2=this[_0x8a90('0x6f')][_0x8a90('0x83')](this,_0x56123f,_0x51782f);if(_0x5410d2){for(var _0x4734e1 in _0x5410d2){if(_0x5410d2[_0x8a90('0x78')](_0x4734e1)){this['channel'][_0x8a90('0x81')](util[_0x8a90('0x21')](_0x8a90('0x101'),_0x4734e1[_0x8a90('0xc6')]()),_0x5410d2[_0x4734e1]);}}return this[_0x8a90('0x30')]['noop'](util['format'](_0x8a90('0x102'),JSON['stringify'](_0x5410d2)));}}return _0xda0a97;};AGIVertices[_0x8a90('0xd')][_0x8a90('0x103')]=function(_0x3fcacf){logger[_0x8a90('0x26')](util[_0x8a90('0x21')](_0x8a90('0x104'),_0x3fcacf[_0x8a90('0x32')]));if(!this[_0x8a90('0x66')](_0x3fcacf[_0x8a90('0x72')])){return this[_0x8a90('0x30')][_0x8a90('0x96')](_0x8a90('0x105'));}if(!this[_0x8a90('0x66')](_0x3fcacf['appsecret'])){return this[_0x8a90('0x30')][_0x8a90('0x96')](_0x8a90('0x106'));}var _0x1a890d=_0x8a90('0xfe');var _0x479f0f=util[_0x8a90('0x21')](_0x8a90('0x107'),FILES_PATH,rs[_0x8a90('0xe7')](0x4));var _0xf7735f=util[_0x8a90('0x21')](_0x8a90('0xff'),_0x479f0f,_0x1a890d);var _0x4f568c=!![];if(_0x3fcacf[_0x8a90('0x100')]===_0x8a90('0x108')){_0x4f568c=![];}var _0x50ede2=this['channel'][_0x8a90('0x109')](_0x479f0f,_0x1a890d,_0x3fcacf[_0x8a90('0x10a')],_0x3fcacf[_0x8a90('0x8a')],undefined,_0x4f568c);if(_0x50ede2['result']!==-0x1){this[_0x8a90('0x30')][_0x8a90('0x96')](util[_0x8a90('0x21')]('tilde\x20%s\x20file\x20created',_0xf7735f));var _0x3591a9=this[_0x8a90('0x71')][_0x8a90('0x83')](this,_0x3fcacf,_0xf7735f);if(_0x3591a9){for(var _0x2bec9f in _0x3591a9){if(_0x3591a9['hasOwnProperty'](_0x2bec9f)){this['channel'][_0x8a90('0x81')](util[_0x8a90('0x21')]('TILDE_ASR_%s',_0x2bec9f[_0x8a90('0xc6')]()),_0x3591a9[_0x2bec9f]);}}return this['channel'][_0x8a90('0x96')](util[_0x8a90('0x21')](_0x8a90('0x10b'),JSON[_0x8a90('0xe3')](_0x3591a9)));}}return _0x50ede2;};AGIVertices[_0x8a90('0xd')][_0x8a90('0x10c')]=function(_0x50b9bc){logger[_0x8a90('0x26')](util[_0x8a90('0x21')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x50b9bc['label']));return this[_0x8a90('0x30')]['continueAt'](_0x50b9bc[_0x8a90('0x38')],_0x50b9bc['extension'],_0x50b9bc[_0x8a90('0x39')]);};AGIVertices[_0x8a90('0xd')][_0x8a90('0x10d')]=function(_0x596a65){logger[_0x8a90('0x26')](util['format'](_0x8a90('0x10e'),_0x596a65[_0x8a90('0x32')]));if(!this[_0x8a90('0x66')](_0x596a65[_0x8a90('0x10f')])){return this[_0x8a90('0x30')]['error'](_0x596a65,'no\x20condition\x20configured');}try{var _0xb362f7=eval(_0x596a65['condition'])?_0x8a90('0x110'):'false';this['channel'][_0x8a90('0x96')](util[_0x8a90('0x21')](_0x8a90('0x111'),_0x596a65[_0x8a90('0x10f')],_0xb362f7));return{'code':0xc8,'result':_0xb362f7};}catch(_0x1a5ca2){return{'code':0xc8,'result':'false'};}};AGIVertices[_0x8a90('0xd')][_0x8a90('0x112')]=function(_0xb5e139){logger[_0x8a90('0x26')](util[_0x8a90('0x21')](_0x8a90('0x113'),_0xb5e139[_0x8a90('0x32')]));if(!this[_0x8a90('0x66')](_0xb5e139[_0x8a90('0x114')])){return this['channel'][_0x8a90('0x25')](_0xb5e139,'no\x20interval\x20configured');}var _0x1edb83=this[_0x8a90('0x115')][_0x8a90('0x83')](this,_0xb5e139[_0x8a90('0x114')]);if(!_0x1edb83){return this['channel']['error'](_0xb5e139,_0x8a90('0x116'));}for(var _0x14a4df=0x0;_0x14a4df<_0x1edb83['length'];_0x14a4df+=0x1){var _0x1df712=this[_0x8a90('0x30')]['getVariable'](util[_0x8a90('0x21')](_0x8a90('0x117'),_0x1edb83[_0x14a4df]));if(_0x1df712[_0x8a90('0x80')]===-0x1){return _0x1df712;}logger['info'](util['format'](_0x8a90('0x118'),_0x1edb83[_0x14a4df],_0x1df712[_0x8a90('0x7e')]));if(_0x1df712['extra']==='true'){logger[_0x8a90('0x26')](util[_0x8a90('0x21')](_0x8a90('0x118'),_0x1edb83[_0x14a4df],_0x8a90('0x110')));this[_0x8a90('0x30')][_0x8a90('0x96')](util[_0x8a90('0x21')](_0x8a90('0x118'),_0x1edb83[_0x14a4df],_0x8a90('0x110')));return{'code':0xc8,'result':_0x8a90('0x110')};}else{logger['info'](util[_0x8a90('0x21')](_0x8a90('0x118'),_0x1edb83[_0x14a4df],_0x8a90('0x119')));this[_0x8a90('0x30')][_0x8a90('0x96')](util[_0x8a90('0x21')](_0x8a90('0x118'),_0x1edb83[_0x14a4df],_0x8a90('0x119')));}}return{'code':0xc8,'result':_0x8a90('0x119')};};AGIVertices['prototype']['hangup']=function(_0x533bd5){logger['info'](util[_0x8a90('0x21')](_0x8a90('0x11a'),_0x533bd5[_0x8a90('0x32')]));return this[_0x8a90('0x30')][_0x8a90('0x11b')]();};AGIVertices['prototype']['ispeechasr']=function(_0x5bb555){logger[_0x8a90('0x26')](util[_0x8a90('0x21')]('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x5bb555[_0x8a90('0x32')]));if(!this[_0x8a90('0x66')](_0x5bb555[_0x8a90('0x5f')])){return this[_0x8a90('0x30')][_0x8a90('0x96')](_0x8a90('0xc2'));}var _0x5d0d9c=_0x8a90('0xfe');var _0x5dc4c1=util[_0x8a90('0x21')]('%s/recordings/%s',FILES_PATH,rs[_0x8a90('0xe7')](0x4));var _0x415e0f=util[_0x8a90('0x21')](_0x8a90('0xff'),_0x5dc4c1,_0x5d0d9c);var _0x1f63bf=!![];if(_0x5bb555[_0x8a90('0x100')]==='NOBEEP'){_0x1f63bf=![];}var _0xa74b36=this[_0x8a90('0x30')]['recordFile'](_0x5dc4c1,_0x5d0d9c,_0x5bb555[_0x8a90('0x10a')],_0x5bb555[_0x8a90('0x8a')],undefined,_0x1f63bf);if(_0xa74b36[_0x8a90('0x80')]!==-0x1){this['channel'][_0x8a90('0x96')](util[_0x8a90('0x21')](_0x8a90('0x11c'),_0x415e0f));var _0x5d526d=this[_0x8a90('0x64')]['sync'](this,_0x5bb555,_0x415e0f);if(_0x5d526d){for(var _0x3849ca in _0x5d526d){if(_0x5d526d[_0x8a90('0x78')](_0x3849ca)){this['channel'][_0x8a90('0x81')](util[_0x8a90('0x21')](_0x8a90('0x11d'),_0x3849ca['toUpperCase']()),_0x5d526d[_0x3849ca]);}}return this[_0x8a90('0x30')]['noop'](util[_0x8a90('0x21')](_0x8a90('0x11e'),JSON[_0x8a90('0xe3')](_0x5d526d)));}}return _0xa74b36;};AGIVertices['prototype'][_0x8a90('0x11f')]=function(_0x5e6cdd){logger[_0x8a90('0x26')](util['format'](_0x8a90('0x120'),_0x5e6cdd[_0x8a90('0x32')]));if(!this['isConfigured'](_0x5e6cdd['key'])){return this[_0x8a90('0x30')][_0x8a90('0x96')](_0x8a90('0xc2'));}if(!this[_0x8a90('0x66')](_0x5e6cdd['text'])){return this[_0x8a90('0x30')][_0x8a90('0x96')](_0x8a90('0x97'));}this[_0x8a90('0x30')][_0x8a90('0x96')](util[_0x8a90('0x21')](_0x8a90('0x121'),_0x5e6cdd['text']));var _0x213f4b=this['ispeechTTS']['sync'](this,_0x5e6cdd);if(_0x213f4b){this[_0x8a90('0x30')][_0x8a90('0x96')](util['format']('ispeech\x20%s\x20file\x20created',_0x213f4b));var _0x26adfe=this[_0x8a90('0x30')][_0x8a90('0xd3')](_0x213f4b,_0x5e6cdd[_0x8a90('0x10a')]);try{fs['unlink'](_0x213f4b+_0x8a90('0x122'));}catch(_0x5db222){logger[_0x8a90('0x25')](_0x5db222);}return _0x26adfe;}return this[_0x8a90('0x30')][_0x8a90('0x25')](_0x5e6cdd,_0x8a90('0x123'));};AGIVertices[_0x8a90('0xd')][_0x8a90('0x124')]=function(_0x5cf87a){logger[_0x8a90('0x26')](util[_0x8a90('0x21')]('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x5cf87a[_0x8a90('0x32')]));if(!this[_0x8a90('0x66')](_0x5cf87a[_0x8a90('0x125')])){return this[_0x8a90('0x30')][_0x8a90('0x25')](_0x5cf87a,'no\x20find\x20by\x20configured');}logger[_0x8a90('0x26')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x8a90('0x30')][_0x8a90('0x35')],_0x5cf87a['findBy']));var _0x582428=this[_0x8a90('0x4c')]['sync'](this,_0x5cf87a[_0x8a90('0x125')]);if(_0x582428){logger[_0x8a90('0x26')](util[_0x8a90('0x21')](_0x8a90('0x126'),this[_0x8a90('0x30')][_0x8a90('0x35')],_0x5cf87a[_0x8a90('0x125')]));this['channel'][_0x8a90('0x96')](util['format'](_0x8a90('0x126'),this['channel']['callerid'],_0x5cf87a[_0x8a90('0x125')]));return{'code':0xc8,'result':_0x8a90('0x127')};}else{logger[_0x8a90('0x26')](util[_0x8a90('0x21')](_0x8a90('0x128'),this[_0x8a90('0x30')][_0x8a90('0x35')],_0x5cf87a[_0x8a90('0x125')]));this[_0x8a90('0x30')][_0x8a90('0x96')](util[_0x8a90('0x21')](_0x8a90('0x128'),this['channel'][_0x8a90('0x35')],_0x5cf87a[_0x8a90('0x125')]));return{'code':0xc8,'result':_0x8a90('0x129')};}};AGIVertices[_0x8a90('0xd')]['logout']=function(_0x1f1d33){logger['info'](util[_0x8a90('0x21')](_0x8a90('0x12a'),_0x1f1d33[_0x8a90('0x32')]));if(!this[_0x8a90('0x66')](_0x1f1d33[_0x8a90('0x125')])){return this[_0x8a90('0x30')][_0x8a90('0x25')](_0x1f1d33,_0x8a90('0x12b'));}logger[_0x8a90('0x26')](util[_0x8a90('0x21')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x8a90('0x30')][_0x8a90('0x35')],_0x1f1d33[_0x8a90('0x125')]));var _0x319495=this[_0x8a90('0x4b')][_0x8a90('0x83')](this,_0x1f1d33[_0x8a90('0x125')]);if(_0x319495){logger[_0x8a90('0x26')](util[_0x8a90('0x21')](_0x8a90('0x126'),this['channel']['callerid'],_0x1f1d33[_0x8a90('0x125')]));this[_0x8a90('0x30')][_0x8a90('0x96')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this['channel']['callerid'],_0x1f1d33['findBy']));return{'code':0xc8,'result':_0x8a90('0x127')};}else{logger[_0x8a90('0x26')](util['format'](_0x8a90('0x128'),this[_0x8a90('0x30')][_0x8a90('0x35')],_0x1f1d33[_0x8a90('0x125')]));this['channel'][_0x8a90('0x96')](util['format'](_0x8a90('0x128'),this[_0x8a90('0x30')][_0x8a90('0x35')],_0x1f1d33[_0x8a90('0x125')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x8a90('0xd')][_0x8a90('0x12c')]=function(_0x378b97){logger[_0x8a90('0x26')](util[_0x8a90('0x21')](_0x8a90('0x12d'),_0x378b97[_0x8a90('0x32')]));if(!this[_0x8a90('0x66')](_0x378b97['operation'])){return this[_0x8a90('0x30')][_0x8a90('0x25')](_0x378b97,'no\x20operation\x20configured');}this[_0x8a90('0x30')][_0x8a90('0x96')](util[_0x8a90('0x21')](_0x8a90('0x12e'),_0x378b97[_0x8a90('0x12f')]));var _0xec15b1=eval(_0x378b97['operation']);if(!this[_0x8a90('0x66')](_0x378b97[_0x8a90('0xaf')])){return this[_0x8a90('0x30')]['noop'](_0x8a90('0xb0'));}var _0x201264=this['getVariable'][_0x8a90('0x83')](this,_0x378b97[_0x8a90('0xaf')]);if(!_0x201264){return this[_0x8a90('0x30')][_0x8a90('0x25')](_0x378b97,_0x8a90('0xe5'));}if(_[_0x8a90('0x130')](_0xec15b1)){var _0x5d7c7c=this;_0xec15b1['forEach'](function(_0x2671e3,_0x1f7e30){_0x5d7c7c['channel'][_0x8a90('0x81')](util[_0x8a90('0x21')](_0x8a90('0x131'),_0x201264,_0x1f7e30),_0x2671e3);});return this['channel'][_0x8a90('0x96')](util[_0x8a90('0x21')](_0x8a90('0x132'),_0x201264));}else{return this[_0x8a90('0x30')][_0x8a90('0x81')](_0x201264,_0xec15b1);}};AGIVertices['prototype'][_0x8a90('0x9')]=function(_0x67c724){logger['info'](util[_0x8a90('0x21')](_0x8a90('0x133'),_0x67c724[_0x8a90('0x32')]));if(_0x67c724[_0x8a90('0x134')]===0x0){return this[_0x8a90('0x82')](_0x67c724);}_0x67c724[_0x8a90('0x134')]-=0x1;if(!this[_0x8a90('0x66')](_0x67c724[_0x8a90('0xde')])){return this['channel'][_0x8a90('0x25')](_0x67c724,'no\x20file\x20audio\x20selected');}var _0x912620=this[_0x8a90('0x135')]['sync'](this,_0x67c724['file_id']);if(!_0x912620){return this[_0x8a90('0x30')][_0x8a90('0x25')](_0x67c724,'no\x20file\x20audio\x20found');}var _0x1deb25=this[_0x8a90('0x30')]['getData'](_0x912620,_0x67c724[_0x8a90('0xe1')],_0x67c724['digit']);var _0x8b2faa=_0x1deb25[_0x8a90('0x80')];if(_0x1deb25[_0x8a90('0x80')]===-0x1){this[_0x8a90('0x2f')]['sync'](this,_0x67c724,'-1');return _0x1deb25;}else if(_0x1deb25[_0x8a90('0x7e')]===_0x8a90('0x8a')){_0x1deb25[_0x8a90('0x80')]=_0x1deb25[_0x8a90('0x80')][_0x8a90('0x7c')]>0x0?_0x1deb25[_0x8a90('0x80')]:'t';}else if(_[_0x8a90('0x3d')](_0x1deb25[_0x8a90('0x80')])){_0x1deb25[_0x8a90('0x80')]='#';_0x8b2faa='#';}if(!this[_0x8a90('0x66')](_0x67c724[_0x8a90('0xaf')])){this['channel']['noop'](_0x8a90('0xb0'));}else{var _0x4e3c7a=this[_0x8a90('0x7d')]['sync'](this,_0x67c724[_0x8a90('0xaf')]);if(!_0x4e3c7a){return this['channel'][_0x8a90('0x25')](_0x67c724,'no\x20variable\x20found');}this['channel']['setVariable'](_0x4e3c7a,_0x8b2faa);}this[_0x8a90('0x2f')][_0x8a90('0x83')](this,_0x67c724,_0x8b2faa);return _0x1deb25;};AGIVertices['prototype']['noop']=function(_0x31fb62){logger[_0x8a90('0x26')](util[_0x8a90('0x21')](_0x8a90('0x136'),_0x31fb62[_0x8a90('0x32')]));return this[_0x8a90('0x30')][_0x8a90('0x96')](_0x31fb62[_0x8a90('0x137')]||_0x31fb62[_0x8a90('0x32')]);};AGIVertices[_0x8a90('0xd')]['pause']=function(_0x72dac3){logger['info'](util[_0x8a90('0x21')](_0x8a90('0x138'),_0x72dac3['label']));if(!this['isConfigured'](_0x72dac3[_0x8a90('0x125')])){return this[_0x8a90('0x30')]['error'](_0x72dac3,_0x8a90('0x12b'));}logger[_0x8a90('0x26')](util[_0x8a90('0x21')](_0x8a90('0x139'),this[_0x8a90('0x30')][_0x8a90('0x35')],_0x72dac3[_0x8a90('0x125')]));var _0x2fe420=this[_0x8a90('0x47')][_0x8a90('0x83')](this,_0x72dac3['pause_id']);var _0x5b3042=this[_0x8a90('0x49')][_0x8a90('0x83')](this,_0x72dac3[_0x8a90('0x125')],_0x2fe420);if(_0x5b3042){logger[_0x8a90('0x26')](util[_0x8a90('0x21')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x8a90('0x30')][_0x8a90('0x35')],_0x72dac3['findBy']));this[_0x8a90('0x30')]['noop'](util[_0x8a90('0x21')](_0x8a90('0x126'),this[_0x8a90('0x30')][_0x8a90('0x35')],_0x72dac3['findBy']));return{'code':0xc8,'result':_0x8a90('0x127')};}else{logger[_0x8a90('0x26')](util['format'](_0x8a90('0x128'),this[_0x8a90('0x30')][_0x8a90('0x35')],_0x72dac3['findBy']));this[_0x8a90('0x30')]['noop'](util[_0x8a90('0x21')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x8a90('0x30')][_0x8a90('0x35')],_0x72dac3[_0x8a90('0x125')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x8a90('0xd')][_0x8a90('0x13a')]=function(_0x49a194){logger[_0x8a90('0x26')](util[_0x8a90('0x21')](_0x8a90('0x13b'),_0x49a194[_0x8a90('0x32')]));if(!this['isConfigured'](_0x49a194[_0x8a90('0xde')])){return this[_0x8a90('0x30')][_0x8a90('0x25')](_0x49a194,_0x8a90('0xdd'));}var _0x33c174=this[_0x8a90('0x135')][_0x8a90('0x83')](this,_0x49a194['file_id']);if(!_0x33c174){return this[_0x8a90('0x30')][_0x8a90('0x25')](_0x49a194,_0x8a90('0xdf'));}var _0x6b6a33=this[_0x8a90('0x30')][_0x8a90('0x50')]('PLAYBACK',[_0x33c174,_0x49a194[_0x8a90('0xbd')]]);if(_0x6b6a33[_0x8a90('0x80')]===-0x1){return _0x6b6a33;}return this[_0x8a90('0x30')]['noop'](util[_0x8a90('0x21')](_0x8a90('0x92'),_0x8a90('0x13c'),_0x33c174));};AGIVertices[_0x8a90('0xd')][_0x8a90('0x13d')]=function(_0x305a34){logger[_0x8a90('0x26')](util[_0x8a90('0x21')](_0x8a90('0x13e'),_0x305a34[_0x8a90('0x32')]));if(!this[_0x8a90('0x66')](_0x305a34[_0x8a90('0x13f')])){return this[_0x8a90('0x30')][_0x8a90('0x25')](_0x305a34,_0x8a90('0x140'));}var _0x5dd39c='';var _0xd31d68=parseInt(_0x305a34[_0x8a90('0x13f')],0xa);if(isNaN(_0xd31d68)){_0x5dd39c=_0x305a34[_0x8a90('0x13f')];}else{_0x5dd39c=this['getVoiceQueue'][_0x8a90('0x83')](this,_0x305a34[_0x8a90('0x13f')]);if(!_0x5dd39c){return this[_0x8a90('0x30')]['error'](_0x305a34,'no\x20queue\x20found');}}var _0x116482='';if(this[_0x8a90('0x66')](_0x305a34['file_id'])){var _0x9abd04=this[_0x8a90('0x135')][_0x8a90('0x83')](this,_0x305a34[_0x8a90('0xde')]);if(_0x9abd04){_0x116482=_0x9abd04;}}this[_0x8a90('0x2f')]['sync'](this,_0x305a34,_0x5dd39c);if(_0x305a34['opts'][_0x8a90('0x141')]('x')<0x0){_0x305a34[_0x8a90('0xbd')]+='x';}if(_0x305a34[_0x8a90('0xbd')][_0x8a90('0x141')]('X')<0x0){_0x305a34['opts']+='X';}this[_0x8a90('0x30')][_0x8a90('0x81')]('XMCS-QUEUE',_0x5dd39c?_0x5dd39c[_0x8a90('0x142')]():'');var _0x2f736d=this['channel'][_0x8a90('0x50')](_0x8a90('0x143'),[_0x5dd39c,_0x305a34['opts'],_0x305a34[_0x8a90('0xbe')],_0x116482,_0x305a34[_0x8a90('0x8a')],_0x305a34[_0x8a90('0x84')],_0x305a34[_0x8a90('0x144')],_0x305a34[_0x8a90('0x145')],'',_0x305a34[_0x8a90('0x146')]]);if(_0x2f736d[_0x8a90('0x80')]===-0x1){return _0x2f736d;}return this[_0x8a90('0x30')][_0x8a90('0x96')](util[_0x8a90('0x21')](_0x8a90('0x92'),_0x8a90('0x143'),_0x5dd39c));};AGIVertices[_0x8a90('0xd')][_0x8a90('0x147')]=function(_0x1960c1){logger[_0x8a90('0x26')](util[_0x8a90('0x21')](_0x8a90('0x148'),_0x1960c1[_0x8a90('0x32')]));var _0x531a9e=_0x1960c1[_0x8a90('0x149')]||'wav';var _0x399775=util[_0x8a90('0x21')]('%s_%s',this[_0x8a90('0x30')][_0x8a90('0x31')],rs['generate'](0x5));var _0x1a46a9=util[_0x8a90('0x21')]('%s/recordings/%s.%s',FILES_PATH,_0x399775,_0x531a9e);var _0x30af7f=util['format'](_0x8a90('0x107'),FILES_PATH,_0x399775);this[_0x8a90('0x36')][_0x8a90('0x83')](this,_0x1960c1,_0x399775,_0x1a46a9);this[_0x8a90('0x30')]['setVariable'](_0x8a90('0x14a'),_0x399775);logger['info']('Recording\x20%s\x20%s\x20%s\x20%s',_0x30af7f,_0x531a9e,_0x1960c1[_0x8a90('0x14b')],_0x1960c1[_0x8a90('0x8a')]);return this[_0x8a90('0x30')]['recordFile'](_0x30af7f,_0x531a9e,_0x1960c1[_0x8a90('0x14b')],_0x1960c1[_0x8a90('0x8a')],undefined,!![]);};AGIVertices[_0x8a90('0xd')][_0x8a90('0x14c')]=function(_0x313877){logger[_0x8a90('0x26')](util[_0x8a90('0x21')](_0x8a90('0x14d'),_0x313877['label']));return this[_0x8a90('0x30')][_0x8a90('0x14e')](_0x313877[_0x8a90('0x14f')][_0x8a90('0x52')](/\s+/g,''),_0x313877['escape_digits']);};AGIVertices['prototype'][_0x8a90('0x150')]=function(_0x4c39ea){logger[_0x8a90('0x26')](util[_0x8a90('0x21')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x4c39ea[_0x8a90('0x32')]));return this[_0x8a90('0x30')][_0x8a90('0x151')](_0x4c39ea[_0x8a90('0x152')][_0x8a90('0x52')](/\s+/g,''),_0x4c39ea['escape_digits']);};AGIVertices[_0x8a90('0xd')][_0x8a90('0x153')]=function(_0x5d95df){logger[_0x8a90('0x26')](util[_0x8a90('0x21')](_0x8a90('0x154'),_0x5d95df[_0x8a90('0x32')]));return this[_0x8a90('0x30')][_0x8a90('0x155')](_0x5d95df[_0x8a90('0x56')],_0x5d95df['escape_digits']);};AGIVertices[_0x8a90('0xd')]['sendMail']=function(_0x540fbc){logger['info'](util[_0x8a90('0x21')](_0x8a90('0x156'),_0x540fbc[_0x8a90('0x32')]));if(!this[_0x8a90('0x66')](_0x540fbc[_0x8a90('0x157')])){return this[_0x8a90('0x30')][_0x8a90('0x96')](_0x8a90('0x158'));}var _0xb85fbc=this[_0x8a90('0x1a')][_0x8a90('0x83')](this,_0x540fbc[_0x8a90('0x157')]);if(!_0xb85fbc||!_0xb85fbc['Smtp']){return this['channel']['error'](_0x540fbc,_0x8a90('0x159'));}var _0x34a23f={'from':util['format'](_0x8a90('0x15a'),_0xb85fbc['name'],_0xb85fbc['email']||_0xb85fbc[_0x8a90('0x15b')][_0x8a90('0x15c')]),'to':_0x540fbc['to']||'','cc':_0x540fbc['cc']||'','bcc':_0x540fbc['bcc']||'','subject':_0x540fbc[_0x8a90('0x15d')],'html':_0x540fbc[_0x8a90('0x56')],'text':_0x540fbc[_0x8a90('0x56')]};var _0x105a7b={'tls':{'rejectUnauthorized':![]}};if(_0xb85fbc[_0x8a90('0x15b')][_0x8a90('0x15e')]){_0x105a7b['service']=_0xb85fbc['Smtp'][_0x8a90('0x15e')];}else{_0x105a7b[_0x8a90('0x15f')]=_0xb85fbc['Smtp']['host'];_0x105a7b[_0x8a90('0x160')]=_0xb85fbc['Smtp']['port'];_0x105a7b['secure']=_0xb85fbc[_0x8a90('0x15b')][_0x8a90('0x161')];}if(_0xb85fbc[_0x8a90('0x15b')][_0x8a90('0x162')]){_0x105a7b[_0x8a90('0x163')]={'user':_0xb85fbc['Smtp']['user'],'pass':_0xb85fbc[_0x8a90('0x15b')][_0x8a90('0x164')]};}if(this[_0x8a90('0x66')](_0x540fbc[_0x8a90('0x165')])){}logger[_0x8a90('0xb6')]('sendMail\x20message',JSON[_0x8a90('0xe3')](_0x34a23f));this['createSquareDetailsReport']['sync'](this,_0x540fbc,_0x540fbc[_0x8a90('0x157')]);this[_0x8a90('0x30')][_0x8a90('0x96')](util['format'](_0x8a90('0x166'),_0xb85fbc[_0x8a90('0x10')]));this[_0x8a90('0x1c')][_0x8a90('0x83')](this,_0x105a7b,_0x34a23f);return this[_0x8a90('0x30')][_0x8a90('0x96')](_0x8a90('0x167'));};AGIVertices[_0x8a90('0xd')][_0x8a90('0x168')]=function(_0x2dee53){logger[_0x8a90('0x26')](util[_0x8a90('0x21')]('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x2dee53[_0x8a90('0x32')]));return this['channel']['noop']('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0x8a90('0xd')]['sendSMS']=function(_0x317576){logger[_0x8a90('0x26')](util[_0x8a90('0x21')](_0x8a90('0x169'),_0x317576['label']));if(!this[_0x8a90('0x66')](_0x317576[_0x8a90('0x16a')])){return this['channel'][_0x8a90('0x96')](_0x8a90('0x16b'));}var _0x42f59f=this[_0x8a90('0x2c')][_0x8a90('0x83')](this,_0x317576['sms_account_id']);if(!_0x42f59f){return this[_0x8a90('0x30')]['error'](_0x317576,_0x8a90('0x16c'));}var _0x43b95e={'body':_0x317576[_0x8a90('0x16d')],'phone':_0x317576['to']||'','SmsAccountId':_0x42f59f['id']};logger[_0x8a90('0xb6')](_0x8a90('0x16e'),JSON['stringify'](_0x43b95e));this[_0x8a90('0x2f')][_0x8a90('0x83')](this,_0x317576,_0x317576['sms_account_id']);this[_0x8a90('0x30')][_0x8a90('0x96')](util[_0x8a90('0x21')](_0x8a90('0x16f'),_0x42f59f[_0x8a90('0x10')]));this[_0x8a90('0x2e')]['sync'](this,_0x43b95e);return this[_0x8a90('0x30')][_0x8a90('0x96')]('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x8a90('0xd')][_0x8a90('0x170')]=function(_0x3987a8){logger[_0x8a90('0x26')](util[_0x8a90('0x21')](_0x8a90('0x171'),_0x3987a8[_0x8a90('0x32')]));if(!this[_0x8a90('0x66')](_0x3987a8[_0x8a90('0xaf')])){return this[_0x8a90('0x30')][_0x8a90('0x25')](_0x3987a8,'no\x20variable\x20selected');}var _0x4c6dc5=this[_0x8a90('0x7d')][_0x8a90('0x83')](this,_0x3987a8[_0x8a90('0xaf')]);if(!_0x4c6dc5){return this[_0x8a90('0x30')][_0x8a90('0x25')](_0x3987a8,'no\x20variable\x20found');}return this[_0x8a90('0x30')]['setVariable'](_0x4c6dc5,_0x3987a8['variable_value']);};AGIVertices[_0x8a90('0xd')]['start']=function(_0x18fc39){logger['info'](util[_0x8a90('0x21')]('Enter\x20in\x20START\x20(%s)\x20block',_0x18fc39[_0x8a90('0x32')]));this[_0x8a90('0x30')]['noop'](_0x8a90('0x172'));if(_0x18fc39[_0x8a90('0x88')]===_0x8a90('0x173')){this[_0x8a90('0x30')][_0x8a90('0x96')](_0x8a90('0x174'));return this[_0x8a90('0x30')][_0x8a90('0x88')]();}return this[_0x8a90('0x30')][_0x8a90('0x96')](_0x8a90('0x175'));};AGIVertices[_0x8a90('0xd')][_0x8a90('0x176')]=function(_0x593ad2){logger[_0x8a90('0x26')](util[_0x8a90('0x21')](_0x8a90('0x177'),_0x593ad2[_0x8a90('0x32')]));if(!this[_0x8a90('0x66')](_0x593ad2[_0x8a90('0x178')])){return this['channel']['error'](_0x593ad2,_0x8a90('0x179'));}var _0x5230fe=this[_0x8a90('0x14')]['sync'](this,_0x593ad2['project_id']);if(!this['isConfigured'](_0x5230fe)){return this[_0x8a90('0x30')]['error'](_0x593ad2,util[_0x8a90('0x21')]('no\x20subproject\x20found\x20with\x20id\x20%d',_0x593ad2['project_id']));}if(_0x5230fe===this[_0x8a90('0x30')][_0x8a90('0x34')]){return this[_0x8a90('0x30')]['error'](_0x593ad2,_0x8a90('0x17a'));}this[_0x8a90('0x2f')]['sync'](this,_0x593ad2,_0x5230fe);var _0x546596=this[_0x8a90('0x30')][_0x8a90('0x50')]('AGI',util[_0x8a90('0x21')](_0x8a90('0x17b'),config[_0x8a90('0x84')][_0x8a90('0x15f')]||_0x8a90('0x17c'),_0x5230fe,this['channel']['arg_1']));if(_0x546596[_0x8a90('0x80')]===-0x1){return _0x546596;}return this['channel']['noop'](util[_0x8a90('0x21')]('Executed\x20command\x20%s\x20%s',_0x8a90('0x17d'),_0x5230fe));};AGIVertices[_0x8a90('0xd')][_0x8a90('0x17e')]=function(_0x5d2efd){logger['info'](util['format'](_0x8a90('0x17f'),_0x5d2efd[_0x8a90('0x32')]));var _0x5b1061=this[_0x8a90('0x4f')][_0x8a90('0x83')](this,_0x5d2efd['command']);this['createSquareDetailsReport']['sync'](this,_0x5d2efd,_0x5d2efd['command']);if(this[_0x8a90('0x66')](_0x5d2efd['variable_id'])){var _0x568690=this[_0x8a90('0x7d')][_0x8a90('0x83')](this,_0x5d2efd[_0x8a90('0xaf')]);if(_0x568690){this[_0x8a90('0x30')][_0x8a90('0x81')](_0x568690,_0x5b1061);return this[_0x8a90('0x30')]['noop'](util['format'](_0x8a90('0x180'),_0x5d2efd[_0x8a90('0x86')],_0x568690));}}return this['channel']['noop'](util[_0x8a90('0x21')](_0x8a90('0x181'),_0x5d2efd['command']));};AGIVertices[_0x8a90('0xd')][_0x8a90('0x182')]=function(_0x3e35c2){logger['info'](util[_0x8a90('0x21')](_0x8a90('0x183'),_0x3e35c2[_0x8a90('0x32')]));if(!this[_0x8a90('0x66')](_0x3e35c2[_0x8a90('0x54')])){return this[_0x8a90('0x30')][_0x8a90('0x96')](_0x8a90('0x184'));}if(!this[_0x8a90('0x66')](_0x3e35c2[_0x8a90('0x56')])){return this[_0x8a90('0x30')][_0x8a90('0x96')](_0x8a90('0x97'));}this[_0x8a90('0x30')]['noop'](util['format'](_0x8a90('0x185'),_0x3e35c2['text']));var _0x25f3d7=this[_0x8a90('0x53')][_0x8a90('0x83')](this,_0x3e35c2);if(_0x25f3d7){this[_0x8a90('0x30')]['noop'](util[_0x8a90('0x21')](_0x8a90('0x186'),_0x25f3d7));var _0x1fd262=this[_0x8a90('0x30')][_0x8a90('0xd3')](_0x25f3d7);try{fs[_0x8a90('0xd4')](_0x25f3d7+_0x8a90('0x122'));}catch(_0x245959){logger[_0x8a90('0x25')](_0x245959);}return _0x1fd262;}return this[_0x8a90('0x30')][_0x8a90('0x25')](_0x3e35c2,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices[_0x8a90('0xd')][_0x8a90('0x187')]=function(_0x51e392){logger[_0x8a90('0x26')](util['format'](_0x8a90('0x188'),_0x51e392[_0x8a90('0x32')]));if(!this[_0x8a90('0x66')](_0x51e392[_0x8a90('0x56')])){return this['channel']['noop'](_0x8a90('0x97'));}this['channel'][_0x8a90('0x96')](util['format'](_0x8a90('0x189'),_0x51e392[_0x8a90('0x56')]));var _0x256713=this[_0x8a90('0x5c')]['sync'](this,_0x51e392);if(_0x256713){this[_0x8a90('0x30')]['noop'](util[_0x8a90('0x21')](_0x8a90('0x18a'),_0x256713));var _0x10e0f7=this['channel'][_0x8a90('0xd3')](_0x256713);try{fs['unlink'](_0x256713+'.wav');}catch(_0x185b13){logger[_0x8a90('0x25')](_0x185b13);}return _0x10e0f7;}return this['channel'][_0x8a90('0x25')](_0x51e392,_0x8a90('0x18b'));};AGIVertices[_0x8a90('0xd')][_0x8a90('0x18c')]=function(_0x5c1481){logger['info'](util['format'](_0x8a90('0x18d'),_0x5c1481[_0x8a90('0x32')]));if(!this[_0x8a90('0x66')](_0x5c1481[_0x8a90('0x125')])){return this[_0x8a90('0x30')][_0x8a90('0x25')](_0x5c1481,'no\x20find\x20by\x20configured');}logger[_0x8a90('0x26')](util[_0x8a90('0x21')](_0x8a90('0x139'),this[_0x8a90('0x30')][_0x8a90('0x35')],_0x5c1481[_0x8a90('0x125')]));var _0x301b13=this[_0x8a90('0x18e')][_0x8a90('0x83')](this,_0x5c1481['findBy']);if(_0x301b13){logger[_0x8a90('0x26')](util['format'](_0x8a90('0x126'),this['channel'][_0x8a90('0x35')],_0x5c1481['findBy']));this['channel'][_0x8a90('0x96')](util[_0x8a90('0x21')](_0x8a90('0x126'),this[_0x8a90('0x30')][_0x8a90('0x35')],_0x5c1481[_0x8a90('0x125')]));return{'code':0xc8,'result':_0x8a90('0x127')};}else{logger[_0x8a90('0x26')](util[_0x8a90('0x21')](_0x8a90('0x128'),this[_0x8a90('0x30')][_0x8a90('0x35')],_0x5c1481[_0x8a90('0x125')]));this[_0x8a90('0x30')][_0x8a90('0x96')](util[_0x8a90('0x21')](_0x8a90('0x128'),this[_0x8a90('0x30')]['callerid'],_0x5c1481[_0x8a90('0x125')]));return{'code':0xc8,'result':_0x8a90('0x129')};}};AGIVertices[_0x8a90('0xd')][_0x8a90('0x18f')]=function(_0x47b11a){logger[_0x8a90('0x26')](util[_0x8a90('0x21')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x47b11a['label']));var _0x4ddd8e=this[_0x8a90('0x30')][_0x8a90('0x50')](_0x8a90('0x190'),[_0x47b11a['mailbox'],_0x47b11a['options']]);if(_0x4ddd8e['result']===-0x1){return _0x4ddd8e;}return this[_0x8a90('0x30')][_0x8a90('0x96')](util['format'](_0x8a90('0x92'),_0x8a90('0x190'),_0x47b11a[_0x8a90('0x191')]));};AGIVertices[_0x8a90('0xd')][_0x8a90('0x192')]=function(_0xa37c04){logger[_0x8a90('0x26')](util[_0x8a90('0x21')](_0x8a90('0x193'),_0xa37c04[_0x8a90('0x32')]));if(!this[_0x8a90('0x66')](_0xa37c04['variable_id'])){return this[_0x8a90('0x30')][_0x8a90('0x25')](_0xa37c04,_0x8a90('0x194'));}var _0x30fe58=this[_0x8a90('0x7d')][_0x8a90('0x83')](this,_0xa37c04[_0x8a90('0xaf')]);if(!_0x30fe58){return this[_0x8a90('0x30')][_0x8a90('0x25')](_0xa37c04,'no\x20variable\x20found');}var _0x404f82=this['channel'][_0x8a90('0x7d')](_0x30fe58);return{'code':0xc8,'result':_0x404f82['extra']?_0x404f82[_0x8a90('0x7e')]:'-'};};String[_0x8a90('0xd')][_0x8a90('0x195')]=function(_0x44a545,_0x4f7d6a){return this[_0x8a90('0x7b')](_0x44a545)['join'](_0x4f7d6a);};module['exports']=AGIVertices; \ No newline at end of file +var _0x1932=['test','stringify','mindigit','hiddendigitsnum','hiddendigitspos','first','substr','generate','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','no\x20bot\x20name\x20configured','AWS_LEX_%s','toUpperCase','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','no\x20key\x20configured','wav','%s.%s','NOBEEP','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','no\x20appsecret\x20configured','%s/recordings/%s','beep','recordFile','intKey','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','context','extension','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','getIntervals','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','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','math','Enter\x20in\x20MATH\x20(%s)\x20block','no\x20operation\x20configured','math\x20%s','operation','no\x20variable\x20found','isArray','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','response','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','FIND\x20AGENT\x20%s\x20BY\x20%s','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','indexOf','XMCS-QUEUE','toLowerCase','macro','gosub','position','QUEUE','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','digits','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','number','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','Smtp','\x22%s\x22\x20<%s>','email','user','bcc','subject','service','port','secure','authentication','auth','pass','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','sendSMS','sms_account_id','no\x20sms\x20account\x20configured','getSmsAccount','no\x20sms\x20account\x20found','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','no\x20subproject\x20selected','getSquareProject','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','host','system','command','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','google_cloud_tts','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','.wav','Google\x20Cloud\x20TTS\x20is\x20unreachable','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','mailbox','VOICEMAIL','vswitch','replaceAll','exports','path','util','lodash','shelljs','odbc','moment','mustache','../../config/logger','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','menu','getdigits','getsecretdigits','channel','mailRpc','prototype','getVariable','getVariableById','then','name','catch','getVoiceQueue','rpc','getSquareProjectById','getSquareOdbc','getSquareOdbcById','getUser','getSound','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervalById','IntervalId','interval','map','format','%s/sounds/converted/%s','getQueryOdbc','error','info','ODBC\x20connection\x20successfully','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','createSmsMessage','createSquareDetailsReport','uniqueid','label','arg_1','callerid','createSquareRecording','calleridname','priority','accountcode','dnid','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','list_id','callback','scheduledAt','toString','getPause','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','shellCommand','exec','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','ssmlGender','MP3','googleTTS','google_tts_language','googleDialogflow','key','sestekNDA','ispeechTTS','ispeech_tts_language','en-US','speed','ispeechASR','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','tildeASR','appid','uri','includes','agicommand','clone','hasOwnProperty','isString','replaceAllVariables','split','length','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','setVariable','maxRetry','sync','retry','Enter\x20in\x20AGI\x20(%s)\x20block','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','timeout','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','callback_priority','noop','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','options','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','grammar','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','query:\x20%s','no\x20variable\x20selected\x20for\x20the\x20result','forEach','keys','%s_ROWS_COUNT','variable\x20%s\x20set','debug','sip_id','no\x20user\x20selected','no\x20user\x20found','SIP/%s','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','Dialogflow\x20Result\x20%s','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','getTrunk','no\x20trunk\x20found','trunk_name','no\x20trunk\x20selected','DIAL','SIP/%s/%s','phone','opts','url','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','variable_id','getData','maxdigit'];(function(_0x10d54d,_0x54fdaa){var _0x59b0b5=function(_0x39cb33){while(--_0x39cb33){_0x10d54d['push'](_0x10d54d['shift']());}};_0x59b0b5(++_0x54fdaa);}(_0x1932,0xbb));var _0x2193=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0x1932[_0x543084];return _0x306a57;};'use strict';var fs=require('fs');var path=require(_0x2193('0x0'));var util=require(_0x2193('0x1'));var _=require(_0x2193('0x2'));var sh=require(_0x2193('0x3'));var odbc=require(_0x2193('0x4'))();var rs=require('randomstring');var moment=require(_0x2193('0x5'));var Mustache=require(_0x2193('0x6'));var logger=require(_0x2193('0x7'))(_0x2193('0x8'));var config=require(_0x2193('0x9'));var scripts=require(_0x2193('0xa'));var FILES_PATH=_0x2193('0xb');var verticesWithRetry=[_0x2193('0xc'),_0x2193('0xd'),_0x2193('0xe')];var AGIVertices=function(_0xe886ff,_0x436b26,_0x3f4e40){this[_0x2193('0xf')]=_0xe886ff;this['rpc']=_0x436b26;this[_0x2193('0x10')]=_0x3f4e40;};AGIVertices[_0x2193('0x11')][_0x2193('0x12')]=function(_0x11f366,_0x18ea17){this['rpc'][_0x2193('0x13')](_0x11f366)[_0x2193('0x14')](function(_0x362cd8){_0x18ea17(null,_0x362cd8?_0x362cd8[_0x2193('0x15')]:![]);})[_0x2193('0x16')](function(_0x1ee807){_0x18ea17(_0x1ee807);});};AGIVertices[_0x2193('0x11')][_0x2193('0x17')]=function(_0x2d530c,_0x58d784){this[_0x2193('0x18')]['getVoiceQueueById'](_0x2d530c)[_0x2193('0x14')](function(_0x4626b5){_0x58d784(null,_0x4626b5?_0x4626b5[_0x2193('0x15')]:![]);})[_0x2193('0x16')](function(_0x4c3924){_0x58d784(_0x4c3924);});};AGIVertices[_0x2193('0x11')]['getSquareProject']=function(_0xc2da5,_0x5334c6){this[_0x2193('0x18')][_0x2193('0x19')](_0xc2da5)[_0x2193('0x14')](function(_0x115e39){_0x5334c6(null,_0x115e39?_0x115e39[_0x2193('0x15')]:![]);})[_0x2193('0x16')](function(_0x2feed3){_0x5334c6(_0x2feed3);});};AGIVertices[_0x2193('0x11')][_0x2193('0x1a')]=function(_0x4aee56,_0x5836c0){this[_0x2193('0x18')][_0x2193('0x1b')](_0x4aee56)['then'](function(_0x5e756e){_0x5836c0(null,_0x5e756e?_0x5e756e['dsn']:![]);})[_0x2193('0x16')](function(_0x3a08bd){_0x5836c0(_0x3a08bd);});};AGIVertices[_0x2193('0x11')][_0x2193('0x1c')]=function(_0x4ccb87,_0x49f811){this[_0x2193('0x18')]['getUserById'](_0x4ccb87)[_0x2193('0x14')](function(_0xb2aab5){_0x49f811(null,_0xb2aab5?_0xb2aab5[_0x2193('0x15')]:![]);})[_0x2193('0x16')](function(_0x4fa1ee){_0x49f811(_0x4fa1ee);});};AGIVertices[_0x2193('0x11')]['getTrunk']=function(_0x5a7ed8,_0x149121){this[_0x2193('0x18')]['getTrunkById'](_0x5a7ed8)['then'](function(_0x1833d7){_0x149121(null,_0x1833d7?_0x1833d7[_0x2193('0x15')]:![]);})['catch'](function(_0x3a3cf1){_0x149121(_0x3a3cf1);});};AGIVertices[_0x2193('0x11')][_0x2193('0x1d')]=function(_0xbb0387,_0x3f9bba){var _0x29346f=this;this[_0x2193('0x18')]['getSoundById'](_0xbb0387)['then'](function(_0x395e5e){_0x3f9bba(null,_0x395e5e?_0x29346f[_0x2193('0x1e')](_0x395e5e[_0x2193('0x1f')]):![]);})[_0x2193('0x16')](function(_0x3a472a){_0x3f9bba(_0x3a472a);});};AGIVertices[_0x2193('0x11')][_0x2193('0x20')]=function(_0x2a6937,_0x34c867){this['rpc'][_0x2193('0x21')](_0x2a6937)[_0x2193('0x14')](function(_0x1af6c9){_0x34c867(null,_0x1af6c9?_0x1af6c9:![]);})[_0x2193('0x16')](function(_0x4bd8c1){_0x34c867(_0x4bd8c1);});};AGIVertices[_0x2193('0x11')][_0x2193('0x22')]=function(_0x1b2c12,_0x4475a8,_0x581703){this[_0x2193('0x10')]['sendMailMessage'](_0x1b2c12,_0x4475a8)[_0x2193('0x14')](function(){_0x581703(null);})[_0x2193('0x16')](function(_0x52f84c){_0x581703(_0x52f84c);});};AGIVertices[_0x2193('0x11')]['getIntervals']=function(_0x2ed625,_0x88dbe5){this[_0x2193('0x18')][_0x2193('0x23')](_0x2ed625)[_0x2193('0x14')](function(_0x35f728){if(_0x35f728){if(_0x35f728[_0x2193('0x24')]){_0x88dbe5(null,[_0x35f728[_0x2193('0x25')]]);}else{_0x88dbe5(null,_[_0x2193('0x26')](_0x35f728['Intervals'],_0x2193('0x25')));}}else{_0x88dbe5(null,![]);}})[_0x2193('0x16')](function(_0x39a915){_0x88dbe5(_0x39a915);});};AGIVertices[_0x2193('0x11')][_0x2193('0x1e')]=function(_0x49045f){return util[_0x2193('0x27')](_0x2193('0x28'),FILES_PATH,_0x49045f);};AGIVertices[_0x2193('0x11')][_0x2193('0x29')]=function(_0x172e9e,_0x16cf0b,_0x25aa2f){odbc['open'](_0x172e9e,function(_0x10d1dc){if(_0x10d1dc){logger[_0x2193('0x2a')]('Error\x20getting\x20ODBC\x20connection\x20%s',_0x10d1dc);_0x25aa2f(_0x10d1dc);}else{logger[_0x2193('0x2b')](_0x2193('0x2c'));odbc['query'](_0x16cf0b,function(_0x19d7e5,_0xf41c4){if(_0x19d7e5){logger[_0x2193('0x2b')](_0x2193('0x2d'),_0x16cf0b);_0x25aa2f(_0x19d7e5);}else{logger[_0x2193('0x2b')](_0x2193('0x2e'),_0x16cf0b);odbc[_0x2193('0x2f')](function(_0x5506a4){if(_0x5506a4){logger[_0x2193('0x2a')]('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x5506a4);}_0x25aa2f(null,_0xf41c4);});}});}});};AGIVertices[_0x2193('0x11')]['getSmsAccount']=function(_0x4d7354,_0x239b31){this[_0x2193('0x18')]['getSmsAccountById'](_0x4d7354)[_0x2193('0x14')](function(_0x2e45dc){_0x239b31(null,_0x2e45dc?_0x2e45dc:![]);})[_0x2193('0x16')](function(_0xe75388){_0x239b31(_0xe75388);});};AGIVertices['prototype']['createSmsMessage']=function(_0x516562,_0x4b7dd7){this[_0x2193('0x18')][_0x2193('0x30')](_0x516562)[_0x2193('0x14')](function(_0x45f6ed){_0x4b7dd7(null,_0x45f6ed);})[_0x2193('0x16')](function(_0x484e79){_0x4b7dd7(_0x484e79);});};AGIVertices[_0x2193('0x11')][_0x2193('0x31')]=function(_0x10f942,_0x26fa3f,_0x3ec4c9){this[_0x2193('0x18')]['createSquareDetailsReport']({'uniqueid':this[_0x2193('0xf')][_0x2193('0x32')],'node':_0x10f942[_0x2193('0x33')],'application':_0x10f942['agicommand'],'data':_0x26fa3f||null,'project_name':this[_0x2193('0xf')][_0x2193('0x34')],'callerid':this[_0x2193('0xf')][_0x2193('0x35')]})[_0x2193('0x14')](function(_0x272eaf){if(_0x3ec4c9){_0x3ec4c9(null,_0x272eaf);}})['catch'](function(_0x28b55e){if(_0x3ec4c9){_0x3ec4c9(_0x28b55e);}});};AGIVertices[_0x2193('0x11')]['createSquareRecording']=function(_0x5cb1b4,_0xe87e9c,_0x38f011,_0x45413f){this[_0x2193('0x18')][_0x2193('0x36')]({'uniqueid':this[_0x2193('0xf')][_0x2193('0x32')],'callerid':this['channel'][_0x2193('0x35')],'calleridname':this[_0x2193('0xf')][_0x2193('0x37')],'context':this[_0x2193('0xf')]['context'],'extension':this[_0x2193('0xf')]['extension'],'priority':this[_0x2193('0xf')][_0x2193('0x38')],'accountcode':this['channel'][_0x2193('0x39')],'dnid':this['channel'][_0x2193('0x3a')],'projectName':this[_0x2193('0xf')][_0x2193('0x34')],'saveName':_0xe87e9c,'filename':_0x5cb1b4['file']||_0xe87e9c,'savePath':_0x38f011})['then'](function(_0x5c1a9d){_0x45413f(null,_0x5c1a9d);})['catch'](function(_0x60734d){_0x45413f(_0x60734d);});};AGIVertices[_0x2193('0x11')][_0x2193('0x3b')]=function(_0x47b078,_0x2de65b,_0x3f33a0){this[_0x2193('0x18')][_0x2193('0x3b')]({'uniqueid':this[_0x2193('0xf')][_0x2193('0x32')],'body':_0x47b078,'direction':_0x2de65b})[_0x2193('0x14')](function(_0x2b43b4){if(_0x3f33a0){_0x3f33a0(null,_0x2b43b4);}})['catch'](function(_0x4ad4b3){if(_0x3f33a0){_0x3f33a0(_0x4ad4b3);}});};AGIVertices[_0x2193('0x11')][_0x2193('0x3c')]=function(_0xf988b,_0x350e71){this[_0x2193('0x18')][_0x2193('0x3c')]({'firstName':_[_0x2193('0x3d')](_0xf988b[_0x2193('0x15')])||_[_0x2193('0x3e')](_0xf988b[_0x2193('0x15')])?_0x2193('0x3f')+Math[_0x2193('0x40')]():_0xf988b[_0x2193('0x15')],'lastName':_['isEmpty'](_0xf988b['lastName'])||_['isNil'](_0xf988b[_0x2193('0x41')])?null:_0xf988b[_0x2193('0x41')],'phone':_0xf988b['phone'],'ListId':_0xf988b[_0x2193('0x42')],'scheduledAt':_0xf988b['scheduledAt'],'callbackUniqueid':this[_0x2193('0xf')]['uniqueid'],'tags':_0x2193('0x43'),'description':'Callback\x20scheduled\x20at\x20'+_0xf988b[_0x2193('0x44')][_0x2193('0x45')](),'priority':_0xf988b['callback_priority']})['then'](function(_0x50351f){_0x350e71(null,_0x50351f);})['catch'](function(_0x140083){_0x350e71(_0x140083);});};AGIVertices[_0x2193('0x11')][_0x2193('0x46')]=function(_0x54cafc,_0x187f0a){this[_0x2193('0x18')]['getPauseById'](_0x54cafc)[_0x2193('0x14')](function(_0x5be8c2){_0x187f0a(null,_0x5be8c2?_0x5be8c2[_0x2193('0x15')]:![]);})[_0x2193('0x16')](function(_0x48ea66){_0x187f0a(_0x48ea66);});};AGIVertices[_0x2193('0x11')][_0x2193('0x47')]=function(_0x56cc4f,_0x41dea2,_0x554c92){var _0x2dade0={'role':_0x2193('0x48')};_0x2dade0[_0x56cc4f]=this[_0x2193('0xf')][_0x2193('0x35')];this[_0x2193('0x18')][_0x2193('0x47')](_0x2dade0,_0x41dea2,this[_0x2193('0xf')]['uniqueid'])[_0x2193('0x14')](function(_0x957bf5){_0x554c92(null,_[_0x2193('0x3e')](_0x957bf5)?![]:!![]);})[_0x2193('0x16')](function(_0x218c61){logger[_0x2193('0x2a')](_0x218c61);_0x554c92(null,![]);});};AGIVertices[_0x2193('0x11')][_0x2193('0x49')]=function(_0x1d52c9,_0x22e0e1){var _0x323e75={'role':'agent'};_0x323e75[_0x1d52c9]=this['channel'][_0x2193('0x35')];this['rpc'][_0x2193('0x49')](_0x323e75)[_0x2193('0x14')](function(_0x11e3d4){_0x22e0e1(null,_[_0x2193('0x3e')](_0x11e3d4)?![]:!![]);})[_0x2193('0x16')](function(_0x1ae7ea){logger['error'](_0x1ae7ea);_0x22e0e1(null,![]);});};AGIVertices[_0x2193('0x11')][_0x2193('0x4a')]=function(_0x245d1c,_0x1635fe){var _0x2ee995={'role':'agent'};_0x2ee995[_0x245d1c]=this[_0x2193('0xf')][_0x2193('0x35')];this[_0x2193('0x18')][_0x2193('0x4a')](_0x2ee995)['then'](function(_0x26b701){_0x1635fe(null,_[_0x2193('0x3e')](_0x26b701)?![]:!![]);})[_0x2193('0x16')](function(_0x2b940b){logger['error'](_0x2b940b);_0x1635fe(null,![]);});};AGIVertices[_0x2193('0x11')][_0x2193('0x4b')]=function(_0xa38d55,_0x37a056){var _0x4d44c5={'role':_0x2193('0x48')};_0x4d44c5[_0xa38d55]=this[_0x2193('0xf')][_0x2193('0x35')];var _0x707d61=_0xa38d55!=_0x2193('0x4c')?util[_0x2193('0x27')](_0x2193('0x4d'),'LOCAL',this['channel'][_0x2193('0x35')]):undefined;this[_0x2193('0x18')][_0x2193('0x4b')](_0x4d44c5,_0x707d61)['then'](function(_0x1187c7){_0x37a056(null,_[_0x2193('0x3e')](_0x1187c7)?![]:!![]);})[_0x2193('0x16')](function(_0x3d50b5){logger[_0x2193('0x2a')](_0x3d50b5);_0x37a056(null,![]);});};AGIVertices[_0x2193('0x11')][_0x2193('0x4e')]=function(_0x766c98,_0x56cc1e){sh[_0x2193('0x4f')](_['trim'](_0x766c98),function(_0x53d8b3,_0x5b1475){var _0x269f02=_0x5b1475[_0x2193('0x50')](/(\r\n|\n|\r)/gm,'');_0x56cc1e(null,_0x269f02);});};AGIVertices[_0x2193('0x11')][_0x2193('0x51')]=function(_0x12d720,_0x49f56e){scripts['googleCloudTTS'](_0x12d720[_0x2193('0x52')],_0x12d720[_0x2193('0x53')]||_0x2193('0x54'),_0x12d720['text'],_0x12d720[_0x2193('0x55')]||'en-US',_0x12d720[_0x2193('0x56')]||'MALE',_0x12d720['audioEncoding']||_0x2193('0x57'))[_0x2193('0x14')](function(_0x52342d){_0x49f56e(null,_0x52342d);})[_0x2193('0x16')](function(_0x47eb91){_0x49f56e(_0x47eb91);});};AGIVertices['prototype']['googleTTS']=function(_0x323b94,_0x18668d){scripts[_0x2193('0x58')](_0x323b94[_0x2193('0x54')],_0x323b94[_0x2193('0x59')]||'en',0x1)[_0x2193('0x14')](function(_0x2b2be8){_0x18668d(null,_0x2b2be8);})[_0x2193('0x16')](function(_0x4e5c5e){_0x18668d(_0x4e5c5e);});};AGIVertices[_0x2193('0x11')][_0x2193('0x5a')]=function(_0x4b23eb,_0x35bd1b){scripts['googleDialogflow'](this['channel'][_0x2193('0x32')],_0x4b23eb[_0x2193('0x5b')],_0x4b23eb[_0x2193('0x54')],_0x4b23eb['dialogflow_language']||'en')[_0x2193('0x14')](function(_0x1343cd){_0x35bd1b(null,_0x1343cd);})[_0x2193('0x16')](function(_0x5b9fe3){_0x35bd1b(_0x5b9fe3);});};AGIVertices[_0x2193('0x11')]['sestekNDA']=function(_0x45cc4a,_0x334fce){scripts[_0x2193('0x5c')](this[_0x2193('0xf')],_0x45cc4a)[_0x2193('0x14')](function(_0x475dc8){_0x334fce(null,_0x475dc8);})[_0x2193('0x16')](function(_0x2a1de6){_0x334fce(_0x2a1de6);});};AGIVertices[_0x2193('0x11')][_0x2193('0x5d')]=function(_0x44174a,_0x221052){scripts[_0x2193('0x5d')](_0x44174a[_0x2193('0x5b')],_0x44174a[_0x2193('0x54')],_0x44174a[_0x2193('0x5e')]||_0x2193('0x5f'),_0x44174a[_0x2193('0x60')])[_0x2193('0x14')](function(_0x223148){_0x221052(null,_0x223148);})[_0x2193('0x16')](function(_0x52057a){_0x221052(_0x52057a);});};AGIVertices[_0x2193('0x11')][_0x2193('0x61')]=function(_0x21aea8,_0x5e0a11,_0x1d0ee0){scripts[_0x2193('0x61')](_0x5e0a11,_0x21aea8['key'],_0x21aea8[_0x2193('0x62')]||'en-US',this[_0x2193('0x63')](_0x21aea8['model'])?_0x21aea8[_0x2193('0x64')]:undefined)[_0x2193('0x14')](function(_0x2b0907){_0x1d0ee0(null,_0x2b0907);})[_0x2193('0x16')](function(_0x3d6297){_0x1d0ee0(_0x3d6297);});};AGIVertices[_0x2193('0x11')][_0x2193('0x65')]=function(_0x3527d3,_0x202e87){scripts[_0x2193('0x65')](_0x3527d3[_0x2193('0x66')],_0x3527d3[_0x2193('0x67')],_0x3527d3[_0x2193('0x68')],_0x3527d3[_0x2193('0x69')]||_0x2193('0x6a'),_0x3527d3[_0x2193('0x54')],_0x3527d3[_0x2193('0x6b')]||_0x2193('0x54'))['then'](function(_0x4d754a){_0x202e87(null,_0x4d754a);})[_0x2193('0x16')](function(_0x47bc32){_0x202e87(_0x47bc32);});};AGIVertices[_0x2193('0x11')]['awsLex']=function(_0x179325,_0x211a4e){scripts[_0x2193('0x6c')](this[_0x2193('0xf')]['uniqueid'],_0x179325[_0x2193('0x66')],_0x179325[_0x2193('0x67')],_0x179325[_0x2193('0x6d')],_0x179325[_0x2193('0x54')],_0x179325[_0x2193('0x6e')])['then'](function(_0x4eb9d0){_0x211a4e(null,_0x4eb9d0);})['catch'](function(_0x49c8ec){_0x211a4e(_0x49c8ec);});};AGIVertices['prototype'][_0x2193('0x6f')]=function(_0x21ce3d,_0x2e856c,_0x20ce05){scripts['googleASR'](_0x2e856c,_0x21ce3d['key'],_0x21ce3d['google_asr_language']||_0x2193('0x5f'))[_0x2193('0x14')](function(_0x2fd809){_0x20ce05(null,_0x2fd809);})[_0x2193('0x16')](function(_0x14797c){_0x20ce05(_0x14797c);});};AGIVertices[_0x2193('0x11')][_0x2193('0x70')]=function(_0x1429f3,_0x1eea72,_0x5764f1){scripts[_0x2193('0x70')](_0x1eea72,_0x1429f3[_0x2193('0x71')],_0x1429f3['appsecret'],_0x1429f3[_0x2193('0x72')])[_0x2193('0x14')](function(_0x4bd9ac){_0x5764f1(null,_0x4bd9ac);})[_0x2193('0x16')](function(_0x208644){_0x5764f1(_0x208644);});};AGIVertices[_0x2193('0x11')]['clear']=function(_0x30d149){var _0x43614e=_[_0x2193('0x73')](verticesWithRetry,_0x30d149[_0x2193('0x74')])?_0x30d149:_[_0x2193('0x75')](_0x30d149);for(var _0x5cdb1b in _0x43614e){if(_0x43614e[_0x2193('0x76')](_0x5cdb1b)){if(_0x43614e[_0x5cdb1b]&&_[_0x2193('0x77')](_0x43614e[_0x5cdb1b])){_0x43614e[_0x5cdb1b]=this[_0x2193('0x78')](_0x43614e[_0x5cdb1b]);}}}return _0x43614e;};AGIVertices[_0x2193('0x11')][_0x2193('0x78')]=function(_0x28fa50){var _0x4e5c4a=_0x28fa50[_0x2193('0x79')]('{');for(var _0xe6fae5=0x1;_0xe6fae5<_0x4e5c4a[_0x2193('0x7a')];_0xe6fae5+=0x1){var _0x5379df=_0x4e5c4a[_0xe6fae5][_0x2193('0x79')]('}');if(_0x5379df[_0x2193('0x7a')]>0x1){_0x28fa50=_0x28fa50['replaceAll']('{'+_0x5379df[0x0]+'}',this[_0x2193('0xf')][_0x2193('0x12')](_0x5379df[0x0])[_0x2193('0x7b')]||_0x5379df[0x0]);}}if(_0x4e5c4a[_0x2193('0x7a')]===0x1){return _0x28fa50[_0x2193('0x45')]();}return this[_0x2193('0x78')](_0x28fa50);};AGIVertices[_0x2193('0x11')][_0x2193('0x7c')]=function(_0x4dad42,_0x4886a5){var _0x3e0dad=this[_0x2193('0xf')]['getVariable'](_0x4dad42);if(_0x3e0dad[_0x2193('0x7d')]===-0x1){return _0x3e0dad;}logger['info'](util[_0x2193('0x27')](_0x2193('0x7e'),_0x4886a5,_0x3e0dad[_0x2193('0x7b')]));return this[_0x2193('0xf')][_0x2193('0x7f')](_0x4886a5,_0x3e0dad[_0x2193('0x7b')]);};AGIVertices[_0x2193('0x11')][_0x2193('0x63')]=function(_0x46a4d4){return _0x46a4d4&&_0x46a4d4!=='0'&&_0x46a4d4!=='-1'&&_0x46a4d4!=='';};AGIVertices[_0x2193('0x11')][_0x2193('0x80')]=function(_0x1c4aba){this[_0x2193('0x31')][_0x2193('0x81')](this,_0x1c4aba,'-');_0x1c4aba[_0x2193('0x82')]=_0x1c4aba[_0x2193('0x80')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x2193('0x11')][_0x2193('0x8')]=function(_0x55c232){logger[_0x2193('0x2b')](util['format'](_0x2193('0x83'),_0x55c232[_0x2193('0x33')]));return this[_0x2193('0xf')]['agi']([_0x55c232['command'],_0x55c232[_0x2193('0x84')]]);};AGIVertices[_0x2193('0x11')][_0x2193('0x85')]=function(_0xb3cbae){logger[_0x2193('0x2b')](util[_0x2193('0x27')](_0x2193('0x86'),_0xb3cbae[_0x2193('0x33')]));if(this[_0x2193('0x63')](_0xb3cbae['timeout'])){logger['info'](util[_0x2193('0x27')]('Wait\x20%s\x20seconds\x20before\x20answer',_0xb3cbae[_0x2193('0x87')]));var _0x5028ed=this[_0x2193('0xf')][_0x2193('0x88')](_0xb3cbae['timeout']);if(_0x5028ed[_0x2193('0x7d')]===-0x1){return _0x5028ed;}}return this[_0x2193('0xf')]['answer']();};AGIVertices[_0x2193('0x11')][_0x2193('0x43')]=function(_0x315000){logger[_0x2193('0x2b')](util[_0x2193('0x27')](_0x2193('0x89'),_0x315000[_0x2193('0x33')]));if(!this['isConfigured'](_0x315000[_0x2193('0x42')])){return this[_0x2193('0xf')]['error'](_0x315000,_0x2193('0x8a'));}_0x315000['scheduledAt']=moment();if(this['isConfigured'](_0x315000[_0x2193('0x8b')])){_0x315000[_0x2193('0x44')]=moment()['add'](_0x315000[_0x2193('0x8b')],'minutes');}if(!this[_0x2193('0x63')](_0x315000['callback_priority'])){_0x315000[_0x2193('0x8c')]=0x2;}this[_0x2193('0x3c')][_0x2193('0x81')](this,_0x315000);return this['channel'][_0x2193('0x8d')](util['format'](_0x2193('0x8e'),_0x315000['phone'],_0x315000['list_id'],_0x315000['scheduledAt']));};AGIVertices['prototype'][_0x2193('0x8f')]=function(_0x57dffd){logger['info'](util[_0x2193('0x27')](_0x2193('0x90'),_0x57dffd[_0x2193('0x33')]));var _0xfee497=this[_0x2193('0xf')][_0x2193('0x4f')](_0x57dffd[_0x2193('0x91')],_0x57dffd['options']);if(_0xfee497[_0x2193('0x7d')]===-0x1){return _0xfee497;}return this[_0x2193('0xf')][_0x2193('0x8d')](util['format'](_0x2193('0x92'),_0x57dffd[_0x2193('0x91')],_0x57dffd[_0x2193('0x93')]));};AGIVertices[_0x2193('0x11')][_0x2193('0x94')]=function(_0x3b56a7){logger['info'](util['format'](_0x2193('0x95'),_0x3b56a7[_0x2193('0x33')]));if(!this[_0x2193('0x63')](_0x3b56a7[_0x2193('0x54')])){return this['channel'][_0x2193('0x8d')](_0x2193('0x96'));}var _0x333350='\x22'+_0x3b56a7[_0x2193('0x54')]+'\x22';if(this[_0x2193('0x63')](_0x3b56a7[_0x2193('0x93')])){_0x333350+=','+_0x3b56a7[_0x2193('0x93')];}var _0x2c663e=this[_0x2193('0xf')][_0x2193('0x4f')](_0x2193('0x97'),_0x333350);if(_0x2c663e[_0x2193('0x7d')]===-0x1){return _0x2c663e;}return this[_0x2193('0xf')][_0x2193('0x8d')](util[_0x2193('0x27')](_0x2193('0x98'),_0x333350));};AGIVertices[_0x2193('0x11')][_0x2193('0x99')]=function(_0x45a55d){logger[_0x2193('0x2b')](util['format'](_0x2193('0x9a'),_0x45a55d[_0x2193('0x33')]));if(!this[_0x2193('0x63')](_0x45a55d[_0x2193('0x54')])){return this[_0x2193('0xf')]['noop'](_0x2193('0x96'));}var _0x23454d='\x22'+_0x45a55d[_0x2193('0x54')]+'\x22';if(this[_0x2193('0x63')](_0x45a55d[_0x2193('0x93')])){_0x23454d+=','+_0x45a55d['options'];}var _0x5bc24a=this[_0x2193('0xf')][_0x2193('0x4f')](_0x2193('0x97'),_0x23454d);if(_0x5bc24a[_0x2193('0x7d')]===-0x1){return _0x5bc24a;}return this[_0x2193('0xf')][_0x2193('0x8d')](util[_0x2193('0x27')](_0x2193('0x98'),_0x23454d));};AGIVertices['prototype'][_0x2193('0x9b')]=function(_0x3c2a7e){logger[_0x2193('0x2b')](util['format'](_0x2193('0x9c'),_0x3c2a7e[_0x2193('0x33')]));if(!this[_0x2193('0x63')](_0x3c2a7e['grammar'])){return this['channel'][_0x2193('0x8d')](_0x2193('0x9d'));}var _0x37b503=_0x3c2a7e['grammar'];if(this[_0x2193('0x63')](_0x3c2a7e[_0x2193('0x93')])){_0x37b503+=','+_0x3c2a7e[_0x2193('0x93')];}var _0x46a23d=this['channel']['exec'](_0x2193('0x9e'),_0x37b503);if(_0x46a23d['result']===-0x1){return _0x46a23d;}var _0xdbd11c=this[_0x2193('0x7c')](_0x2193('0x9f'),'LUMENVOX_ASR_CONFIDENCE');if(_0xdbd11c[_0x2193('0x7d')]===-0x1){return _0xdbd11c;}var _0x273447=this[_0x2193('0x7c')](_0x2193('0xa0'),_0x2193('0xa1'));if(_0x273447[_0x2193('0x7d')]===-0x1){return _0x273447;}var _0x2536dc=this[_0x2193('0x7c')](_0x2193('0xa2'),_0x2193('0xa3'));if(_0x2536dc[_0x2193('0x7d')]===-0x1){return _0x2536dc;}return this[_0x2193('0xf')][_0x2193('0x8d')](util[_0x2193('0x27')](_0x2193('0xa4'),_0x37b503));};AGIVertices[_0x2193('0x11')]['sestekasr']=function(_0x55150f){logger[_0x2193('0x2b')](util['format'](_0x2193('0xa5'),_0x55150f[_0x2193('0x33')]));if(!this[_0x2193('0x63')](_0x55150f[_0x2193('0xa6')])){return this[_0x2193('0xf')][_0x2193('0x8d')]('no\x20grammar\x20configured');}var _0x4ad390=_0x55150f[_0x2193('0xa6')];if(this[_0x2193('0x63')](_0x55150f[_0x2193('0x93')])){_0x4ad390+=','+_0x55150f['options'];}var _0x118de3=this[_0x2193('0xf')][_0x2193('0x4f')]('MRCPRecog',_0x4ad390);if(_0x118de3['result']===-0x1){return _0x118de3;}var _0x2458cf=this[_0x2193('0x7c')]('RECOG_CONFIDENCE()',_0x2193('0xa7'));if(_0x2458cf[_0x2193('0x7d')]===-0x1){return _0x2458cf;}var _0x27ab7e=this[_0x2193('0x7c')]('RECOG_INPUT()',_0x2193('0xa8'));if(_0x27ab7e[_0x2193('0x7d')]===-0x1){return _0x27ab7e;}var _0x308265=this['getAndSetVariable']('RECOG_INSTANCE()','SESTEK_ASR_INSTANCE');if(_0x308265[_0x2193('0x7d')]===-0x1){return _0x308265;}return this[_0x2193('0xf')][_0x2193('0x8d')](util['format'](_0x2193('0xa4'),_0x4ad390));};AGIVertices[_0x2193('0x11')]['database']=function(_0x3ee5fd){logger[_0x2193('0x2b')](util[_0x2193('0x27')](_0x2193('0xa9'),_0x3ee5fd['label']));if(!this[_0x2193('0x63')](_0x3ee5fd[_0x2193('0xaa')])){return this['channel'][_0x2193('0x2a')](_0x3ee5fd,_0x2193('0xab'));}var _0xa0e172=this[_0x2193('0x1a')]['sync'](this,_0x3ee5fd[_0x2193('0xaa')]);if(!_0xa0e172){return this[_0x2193('0xf')][_0x2193('0x2a')](_0x3ee5fd,_0x2193('0xac'));}if(!this[_0x2193('0x63')](_0x3ee5fd['query'])){return this[_0x2193('0xf')][_0x2193('0x2a')](_0x3ee5fd,'no\x20query\x20configured');}var _0xdc2823=_0x3ee5fd['query'][_0x2193('0x50')](/(\r\n|\n|\r)/gm,'\x20');this[_0x2193('0xf')]['noop'](util[_0x2193('0x27')](_0x2193('0xad'),_0xdc2823));var _0x14b870=this[_0x2193('0x29')][_0x2193('0x81')](this,_0xa0e172,_0xdc2823);this[_0x2193('0x31')][_0x2193('0x81')](this,_0x3ee5fd,_0xdc2823);if(!this[_0x2193('0x63')](_0x3ee5fd['variable_id'])){return this[_0x2193('0xf')]['noop'](_0x2193('0xae'));}var _0x1e966e=this[_0x2193('0x12')][_0x2193('0x81')](this,_0x3ee5fd['variable_id']);if(!_0x1e966e){return this[_0x2193('0xf')][_0x2193('0x2a')](_0x3ee5fd,'no\x20variable\x20found');}var _0x15c14a=this;_0x14b870[_0x2193('0xaf')](function(_0x466755,_0x3d89f1){Object[_0x2193('0xb0')](_0x466755)[_0x2193('0xaf')](function(_0x480daa){_0x15c14a[_0x2193('0xf')][_0x2193('0x7f')](util['format']('%s[%s][%s]',_0x1e966e,_0x3d89f1,_0x480daa),_0x466755[_0x480daa]);});});this[_0x2193('0xf')][_0x2193('0x7f')](util[_0x2193('0x27')](_0x2193('0xb1'),_0x1e966e),_0x14b870[_0x2193('0x7a')]);return this[_0x2193('0xf')][_0x2193('0x8d')](util[_0x2193('0x27')](_0x2193('0xb2'),_0x1e966e));};AGIVertices['prototype']['dial']=function(_0x33f184){logger[_0x2193('0xb3')](util[_0x2193('0x27')]('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x33f184['label']));if(!this[_0x2193('0x63')](_0x33f184[_0x2193('0xb4')])){return this[_0x2193('0xf')]['error'](_0x33f184,_0x2193('0xb5'));}var _0x42f3c1=this[_0x2193('0x1c')][_0x2193('0x81')](this,_0x33f184[_0x2193('0xb4')]);if(!_0x42f3c1){return this[_0x2193('0xf')]['error'](_0x33f184,_0x2193('0xb6'));}var _0x15daba=this['channel'][_0x2193('0x4f')]('DIAL',[util[_0x2193('0x27')](_0x2193('0xb7'),_0x42f3c1),_0x33f184[_0x2193('0x87')],_0x33f184['opts'],_0x33f184['url']]);if(_0x15daba['result']===-0x1){return _0x15daba;}return this[_0x2193('0xf')]['noop'](util[_0x2193('0x27')](_0x2193('0xb8'),'DIAL'));};AGIVertices['prototype'][_0x2193('0xb9')]=function(_0x3879e1){logger[_0x2193('0x2b')](util['format'](_0x2193('0xba'),_0x3879e1['label']));if(!this[_0x2193('0x63')](_0x3879e1[_0x2193('0x5b')])){return this['channel']['noop']('no\x20key\x20configured');}if(!this[_0x2193('0x63')](_0x3879e1['text'])){return this[_0x2193('0xf')]['noop'](_0x2193('0x96'));}this[_0x2193('0xf')][_0x2193('0xbb')]=!![];this['createSquareDetailsReport'](_0x3879e1);this[_0x2193('0x3b')](_0x3879e1['text'],'in');this[_0x2193('0xf')][_0x2193('0x8d')](util['format'](_0x2193('0xbc'),_0x3879e1['text']));var _0x2855e4=this['googleDialogflow'][_0x2193('0x81')](this,_0x3879e1);if(_0x2855e4){for(var _0x3e40cd in _0x2855e4){if(_0x2855e4['hasOwnProperty'](_0x3e40cd)){this[_0x2193('0xf')]['setVariable'](util[_0x2193('0x27')](_0x2193('0xbd'),_0x3e40cd['toUpperCase']()),_0x2855e4[_0x3e40cd]);}}this[_0x2193('0x3b')](_0x2855e4[_0x2193('0xbe')],_0x2193('0xbf'));return this[_0x2193('0xf')][_0x2193('0x8d')](util[_0x2193('0x27')](_0x2193('0xc0'),_0x2855e4[_0x2193('0xbe')]));}return this[_0x2193('0xf')]['error'](_0x3879e1,'Dialogflow\x20is\x20unreachable');};AGIVertices[_0x2193('0x11')]['sesteknda']=function(_0x17fe5a){logger[_0x2193('0x2b')](util[_0x2193('0x27')](_0x2193('0xc1'),_0x17fe5a['label']));if(!this['isConfigured'](_0x17fe5a[_0x2193('0xc2')])){return this[_0x2193('0xf')][_0x2193('0x8d')](_0x2193('0xc3'));}if(!this[_0x2193('0x63')](_0x17fe5a[_0x2193('0xc4')])){return this['channel'][_0x2193('0x8d')](_0x2193('0xc5'));}if(!this[_0x2193('0x63')](_0x17fe5a[_0x2193('0xc6')])){return this[_0x2193('0xf')][_0x2193('0x8d')](_0x2193('0xc7'));}if(!this[_0x2193('0x63')](_0x17fe5a[_0x2193('0xc8')])){return this[_0x2193('0xf')][_0x2193('0x8d')](_0x2193('0x96'));}this['channel'][_0x2193('0xbb')]=!![];this[_0x2193('0x31')](_0x17fe5a);this['createSquareMessage'](_0x17fe5a[_0x2193('0x54')],'in');this[_0x2193('0xf')][_0x2193('0x8d')](util['format'](_0x2193('0xc9'),_0x17fe5a[_0x2193('0x54')]));var _0x375a44=this[_0x2193('0x5c')][_0x2193('0x81')](this,_0x17fe5a);if(_0x375a44){for(var _0x37571d in _0x375a44){if(_0x375a44['hasOwnProperty'](_0x37571d)){this[_0x2193('0xf')][_0x2193('0x7f')](util[_0x2193('0x27')](_0x2193('0xca'),_0x37571d['toUpperCase']()),_0x375a44[_0x37571d]);}}this['createSquareMessage'](_0x375a44[_0x2193('0xbe')],_0x2193('0xbf'));if(_0x375a44[_0x2193('0xcb')]){this[_0x2193('0xf')][_0x2193('0x8d')](util[_0x2193('0x27')](_0x2193('0xcc'),_0x375a44[_0x2193('0xcb')]));var _0x4072d7=this['channel'][_0x2193('0xcd')](_0x375a44[_0x2193('0xcb')]);try{fs[_0x2193('0xce')](_0x375a44[_0x2193('0xcb')]+'.wav');}catch(_0x28ad59){logger[_0x2193('0x2a')](_0x28ad59);}return _0x4072d7;}else{return this[_0x2193('0xf')]['noop'](util[_0x2193('0x27')](_0x2193('0xcf'),_0x375a44[_0x2193('0xbe')]));}}return this[_0x2193('0xf')][_0x2193('0x2a')](_0x17fe5a,_0x2193('0xd0'));};AGIVertices[_0x2193('0x11')]['end']=function(_0x611aa0){logger[_0x2193('0x2b')](util['format']('Enter\x20in\x20END\x20(%s)\x20block',_0x611aa0[_0x2193('0x33')]));return this[_0x2193('0xf')]['noop']('end');};AGIVertices[_0x2193('0x11')]['ext_dial']=function(_0xeec6ff){logger['info'](util[_0x2193('0x27')](_0x2193('0xd1'),_0xeec6ff[_0x2193('0x33')]));var _0x5e803f='';if(_0xeec6ff['trunk_id']){if(!this[_0x2193('0x63')](_0xeec6ff[_0x2193('0xd2')])){return this[_0x2193('0xf')][_0x2193('0x2a')](_0xeec6ff,'no\x20trunk\x20selected');}else{var _0x261b65=parseInt(_0xeec6ff[_0x2193('0xd2')],0xa);if(isNaN(_0x261b65)){_0x5e803f=_0xeec6ff[_0x2193('0xd2')];}else{_0x5e803f=this[_0x2193('0xd3')][_0x2193('0x81')](this,_0xeec6ff[_0x2193('0xd2')]);if(!_0x5e803f){return this[_0x2193('0xf')]['error'](_0xeec6ff,_0x2193('0xd4'));}}}}else if(_0xeec6ff[_0x2193('0xd5')]){_0x5e803f=_0xeec6ff['trunk_name'];}else{return this[_0x2193('0xf')]['error'](_0xeec6ff,_0x2193('0xd6'));}var _0x4fe463=this['channel'][_0x2193('0x4f')](_0x2193('0xd7'),[util[_0x2193('0x27')](_0x2193('0xd8'),_0x5e803f,_0xeec6ff[_0x2193('0xd9')]),_0xeec6ff[_0x2193('0x87')],_0xeec6ff[_0x2193('0xda')],_0xeec6ff[_0x2193('0xdb')]]);if(_0x4fe463[_0x2193('0x7d')]===-0x1){return _0x4fe463;}return this[_0x2193('0xf')][_0x2193('0x8d')](util[_0x2193('0x27')](_0x2193('0xb8'),_0x2193('0xd7')));};AGIVertices[_0x2193('0x11')]['finally']=function(_0x9660c4){logger[_0x2193('0x2b')](util[_0x2193('0x27')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x9660c4[_0x2193('0x33')]));return this[_0x2193('0xf')][_0x2193('0x8d')](_0x2193('0xdc'));};AGIVertices['prototype'][_0x2193('0xd')]=function(_0x4f2382){logger[_0x2193('0x2b')](util['format'](_0x2193('0xdd'),_0x4f2382[_0x2193('0x33')]));if(_0x4f2382[_0x2193('0x82')]===0x0){return this[_0x2193('0x80')](_0x4f2382);}_0x4f2382['retry']-=0x1;if(!this[_0x2193('0x63')](_0x4f2382[_0x2193('0xde')])){return this['channel'][_0x2193('0x2a')](_0x4f2382,_0x2193('0xdf'));}var _0xe5466a=this[_0x2193('0x1d')][_0x2193('0x81')](this,_0x4f2382['file_id']);if(!_0xe5466a){return this[_0x2193('0xf')]['error'](_0x4f2382,_0x2193('0xe0'));}if(!this[_0x2193('0x63')](_0x4f2382[_0x2193('0xe1')])){return this[_0x2193('0xf')][_0x2193('0x2a')](_0x2193('0xae'));}var _0x571669=this[_0x2193('0xf')][_0x2193('0xe2')](_0xe5466a,_0x4f2382['response'],_0x4f2382[_0x2193('0xe3')]);var _0x497565=_0x571669[_0x2193('0x7d')]?_0x571669[_0x2193('0x7d')][_0x2193('0x45')]():'';logger[_0x2193('0x2b')](_0x2193('0xe4'),JSON[_0x2193('0xe5')](_0x571669));if(_0x571669[_0x2193('0x7d')]===-0x1){this[_0x2193('0x31')][_0x2193('0x81')](this,_0x4f2382,_0x497565);return _0x571669;}else if(_0x571669[_0x2193('0x7b')]===_0x2193('0x87')){_0x571669[_0x2193('0x7d')]=_0x497565[_0x2193('0x7a')]>=parseInt(_0x4f2382[_0x2193('0xe6')])?'x':'i';}else{_0x571669[_0x2193('0x7d')]=_0x497565[_0x2193('0x7a')]>=parseInt(_0x4f2382[_0x2193('0xe6')])&&_0x497565[_0x2193('0x7a')]<=parseInt(_0x4f2382[_0x2193('0xe3')])?'x':'i';}var _0x3c54a4=this[_0x2193('0x12')][_0x2193('0x81')](this,_0x4f2382['variable_id']);if(!_0x3c54a4){return this[_0x2193('0xf')][_0x2193('0x2a')](_0x4f2382,'no\x20variable\x20found');}this[_0x2193('0xf')]['setVariable'](_0x3c54a4,_0x497565);if(this[_0x2193('0x63')](_0x4f2382['hiddendigitsnum'])){var _0x1b0870=parseInt(_0x4f2382[_0x2193('0xe7')],0xa);var _0x106f92=rs['generate']({'charset':'*','length':_0x1b0870});var _0x3bbc56=_0x497565[_0x2193('0x7a')];if(_0x3bbc56>0x0){if(_0x3bbc56>_0x1b0870){this[_0x2193('0x31')][_0x2193('0x81')](this,_0x4f2382,_0x4f2382[_0x2193('0xe8')]===_0x2193('0xe9')?_0x106f92+_0x497565[_0x2193('0xea')](_0x1b0870):_0x497565[_0x2193('0xea')](0x0,_0x3bbc56-_0x1b0870)+_0x106f92);}else{this[_0x2193('0x31')]['sync'](this,_0x4f2382,rs[_0x2193('0xeb')]({'charset':'*','length':_0x3bbc56}));}}else{this['createSquareDetailsReport'][_0x2193('0x81')](this,_0x4f2382,'');}}else{this['createSquareDetailsReport'][_0x2193('0x81')](this,_0x4f2382,_0x497565);}return _0x571669;};AGIVertices[_0x2193('0x11')][_0x2193('0xe')]=function(_0x10ce61){logger['info'](util[_0x2193('0x27')](_0x2193('0xec'),_0x10ce61[_0x2193('0x33')]));return this['getdigits'](_0x10ce61);};AGIVertices[_0x2193('0x11')][_0x2193('0xed')]=function(_0x7ecc19){logger[_0x2193('0x2b')](util[_0x2193('0x27')](_0x2193('0xee'),_0x7ecc19['label']));this[_0x2193('0x31')][_0x2193('0x81')](this,_0x7ecc19,_0x7ecc19[_0x2193('0xef')]);return this[_0x2193('0xf')][_0x2193('0x8d')](util[_0x2193('0x27')]('GOAL\x20%s',_0x7ecc19['goalname']));};AGIVertices[_0x2193('0x11')][_0x2193('0xf0')]=function(_0xeecf47){logger[_0x2193('0x2b')](util['format'](_0x2193('0xf1'),_0xeecf47[_0x2193('0x33')]));if(!this[_0x2193('0x63')](_0xeecf47['aws_access_key_id'])||!this['isConfigured'](_0xeecf47[_0x2193('0x67')])){return this['channel'][_0x2193('0x8d')]('no\x20valid\x20credentials\x20configured');}if(!this[_0x2193('0x63')](_0xeecf47[_0x2193('0x54')])){return this[_0x2193('0xf')][_0x2193('0x8d')](_0x2193('0x96'));}this[_0x2193('0xf')][_0x2193('0x8d')](util[_0x2193('0x27')](_0x2193('0xf2'),_0xeecf47[_0x2193('0x54')]));var _0x21a8ee=this[_0x2193('0x65')]['sync'](this,_0xeecf47);if(_0x21a8ee){this[_0x2193('0xf')][_0x2193('0x8d')](util[_0x2193('0x27')](_0x2193('0xf3'),_0x21a8ee));var _0x307e61=this[_0x2193('0xf')][_0x2193('0xcd')](_0x21a8ee);try{fs[_0x2193('0xce')](_0x21a8ee+'.wav');}catch(_0x473760){logger[_0x2193('0x2a')](_0x473760);}return _0x307e61;}return this[_0x2193('0xf')][_0x2193('0x2a')](_0xeecf47,_0x2193('0xf4'));};AGIVertices[_0x2193('0x11')][_0x2193('0xf5')]=function(_0x112931){logger[_0x2193('0x2b')](util[_0x2193('0x27')]('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x112931['label']));if(!this['isConfigured'](_0x112931[_0x2193('0x66')])||!this[_0x2193('0x63')](_0x112931[_0x2193('0x67')])){return this[_0x2193('0xf')][_0x2193('0x8d')]('no\x20valid\x20credentials\x20configured');}if(!this[_0x2193('0x63')](_0x112931[_0x2193('0x6e')])){return this[_0x2193('0xf')][_0x2193('0x8d')](_0x2193('0xf6'));}if(!this[_0x2193('0x63')](_0x112931['text'])){return this['channel']['noop'](_0x2193('0x96'));}this[_0x2193('0xf')][_0x2193('0xbb')]=!![];this[_0x2193('0x31')](_0x112931);this[_0x2193('0x3b')](_0x112931[_0x2193('0x54')],'in');this[_0x2193('0xf')][_0x2193('0x8d')](util[_0x2193('0x27')]('Trying\x20Amazon\x20Lex:\x20%s',_0x112931[_0x2193('0x54')]));var _0x575e0b=this['awsLex']['sync'](this,_0x112931);if(_0x575e0b){for(var _0x56ce26 in _0x575e0b){if(_0x575e0b[_0x2193('0x76')](_0x56ce26)&&_[_0x2193('0x77')](_0x575e0b[_0x56ce26])){this[_0x2193('0xf')][_0x2193('0x7f')](util[_0x2193('0x27')](_0x2193('0xf7'),_0x56ce26[_0x2193('0xf8')]()),_0x575e0b[_0x56ce26]);}}if(_[_0x2193('0x3e')](_0x575e0b['message'])){return this[_0x2193('0xf')][_0x2193('0x8d')](_0x2193('0xf9'));}else{this[_0x2193('0x3b')](_0x575e0b['message'],_0x2193('0xbf'));return this[_0x2193('0xf')][_0x2193('0x8d')](util[_0x2193('0x27')]('Amazon\x20Lex\x20Result\x20%s',_0x575e0b['message']));}}return this[_0x2193('0xf')][_0x2193('0x2a')](_0x112931,_0x2193('0xfa'));};AGIVertices[_0x2193('0x11')][_0x2193('0xfb')]=function(_0x821f80){logger[_0x2193('0x2b')](util[_0x2193('0x27')](_0x2193('0xfc'),_0x821f80[_0x2193('0x33')],_0x821f80[_0x2193('0x87')]));if(!this[_0x2193('0x63')](_0x821f80[_0x2193('0x5b')])){return this['channel'][_0x2193('0x8d')](_0x2193('0xfd'));}var _0x58283b=_0x2193('0xfe');var _0x521a3a=util[_0x2193('0x27')]('%s/recordings/%s',FILES_PATH,rs[_0x2193('0xeb')](0x4));var _0x4b9127=util['format'](_0x2193('0xff'),_0x521a3a,_0x58283b);var _0x2228fc=!![];if(_0x821f80['beep']===_0x2193('0x100')){_0x2228fc=![];}var _0x5cfa7f=this[_0x2193('0xf')]['recordFile'](_0x521a3a,_0x58283b,_0x821f80['intKey'],_0x821f80[_0x2193('0x87')],undefined,_0x2228fc);if(_0x5cfa7f[_0x2193('0x7d')]!==-0x1){this[_0x2193('0xf')][_0x2193('0x8d')](util[_0x2193('0x27')](_0x2193('0x101'),_0x4b9127));var _0x5f54cc=this[_0x2193('0x6f')][_0x2193('0x81')](this,_0x821f80,_0x4b9127);if(_0x5f54cc){for(var _0x53804b in _0x5f54cc){if(_0x5f54cc[_0x2193('0x76')](_0x53804b)){this['channel'][_0x2193('0x7f')](util['format'](_0x2193('0x102'),_0x53804b['toUpperCase']()),_0x5f54cc[_0x53804b]);}}return this[_0x2193('0xf')][_0x2193('0x8d')](util['format'](_0x2193('0x103'),JSON[_0x2193('0xe5')](_0x5f54cc)));}}return _0x5cfa7f;};AGIVertices[_0x2193('0x11')][_0x2193('0x104')]=function(_0x951b28){logger[_0x2193('0x2b')](util['format']('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x951b28[_0x2193('0x33')]));if(!this[_0x2193('0x63')](_0x951b28[_0x2193('0x71')])){return this[_0x2193('0xf')][_0x2193('0x8d')]('no\x20appid\x20configured');}if(!this[_0x2193('0x63')](_0x951b28['appsecret'])){return this[_0x2193('0xf')][_0x2193('0x8d')](_0x2193('0x105'));}var _0x246d09=_0x2193('0xfe');var _0x14d030=util[_0x2193('0x27')](_0x2193('0x106'),FILES_PATH,rs['generate'](0x4));var _0x436d62=util['format'](_0x2193('0xff'),_0x14d030,_0x246d09);var _0x55e95a=!![];if(_0x951b28[_0x2193('0x107')]===_0x2193('0x100')){_0x55e95a=![];}var _0x4938a9=this['channel'][_0x2193('0x108')](_0x14d030,_0x246d09,_0x951b28[_0x2193('0x109')],_0x951b28[_0x2193('0x87')],undefined,_0x55e95a);if(_0x4938a9['result']!==-0x1){this['channel'][_0x2193('0x8d')](util[_0x2193('0x27')](_0x2193('0x10a'),_0x436d62));var _0x2c06a5=this[_0x2193('0x70')]['sync'](this,_0x951b28,_0x436d62);if(_0x2c06a5){for(var _0x56f172 in _0x2c06a5){if(_0x2c06a5[_0x2193('0x76')](_0x56f172)){this['channel'][_0x2193('0x7f')](util[_0x2193('0x27')](_0x2193('0x10b'),_0x56f172[_0x2193('0xf8')]()),_0x2c06a5[_0x56f172]);}}return this[_0x2193('0xf')][_0x2193('0x8d')](util[_0x2193('0x27')]('TildeASR\x20Result\x20%s',JSON[_0x2193('0xe5')](_0x2c06a5)));}}return _0x4938a9;};AGIVertices[_0x2193('0x11')][_0x2193('0x10c')]=function(_0x259de3){logger[_0x2193('0x2b')](util['format'](_0x2193('0x10d'),_0x259de3['label']));return this[_0x2193('0xf')][_0x2193('0x10e')](_0x259de3[_0x2193('0x10f')],_0x259de3[_0x2193('0x110')],_0x259de3[_0x2193('0x38')]);};AGIVertices[_0x2193('0x11')][_0x2193('0x111')]=function(_0x1eba6e){logger[_0x2193('0x2b')](util[_0x2193('0x27')](_0x2193('0x112'),_0x1eba6e[_0x2193('0x33')]));if(!this[_0x2193('0x63')](_0x1eba6e[_0x2193('0x113')])){return this[_0x2193('0xf')][_0x2193('0x2a')](_0x1eba6e,_0x2193('0x114'));}try{var _0x4b47ac=eval(_0x1eba6e[_0x2193('0x113')])?_0x2193('0x115'):_0x2193('0x116');this['channel'][_0x2193('0x8d')](util[_0x2193('0x27')](_0x2193('0x117'),_0x1eba6e[_0x2193('0x113')],_0x4b47ac));return{'code':0xc8,'result':_0x4b47ac};}catch(_0x8f8c0a){return{'code':0xc8,'result':_0x2193('0x116')};}};AGIVertices[_0x2193('0x11')][_0x2193('0x118')]=function(_0x192d63){logger[_0x2193('0x2b')](util[_0x2193('0x27')](_0x2193('0x119'),_0x192d63[_0x2193('0x33')]));if(!this[_0x2193('0x63')](_0x192d63[_0x2193('0x11a')])){return this[_0x2193('0xf')][_0x2193('0x2a')](_0x192d63,_0x2193('0x11b'));}var _0x337bf0=this[_0x2193('0x11c')][_0x2193('0x81')](this,_0x192d63[_0x2193('0x11a')]);if(!_0x337bf0){return this[_0x2193('0xf')]['error'](_0x192d63,'no\x20intervals\x20found');}for(var _0x426016=0x0;_0x426016<_0x337bf0[_0x2193('0x7a')];_0x426016+=0x1){var _0x339500=this['channel']['getVariable'](util[_0x2193('0x27')](_0x2193('0x11d'),_0x337bf0[_0x426016]));if(_0x339500['result']===-0x1){return _0x339500;}logger[_0x2193('0x2b')](util[_0x2193('0x27')]('IFTIME\x20%s\x20%s',_0x337bf0[_0x426016],_0x339500['extra']));if(_0x339500[_0x2193('0x7b')]===_0x2193('0x115')){logger['info'](util[_0x2193('0x27')](_0x2193('0x11e'),_0x337bf0[_0x426016],'true'));this['channel'][_0x2193('0x8d')](util[_0x2193('0x27')](_0x2193('0x11e'),_0x337bf0[_0x426016],'true'));return{'code':0xc8,'result':_0x2193('0x115')};}else{logger[_0x2193('0x2b')](util[_0x2193('0x27')](_0x2193('0x11e'),_0x337bf0[_0x426016],_0x2193('0x116')));this[_0x2193('0xf')]['noop'](util[_0x2193('0x27')](_0x2193('0x11e'),_0x337bf0[_0x426016],_0x2193('0x116')));}}return{'code':0xc8,'result':_0x2193('0x116')};};AGIVertices[_0x2193('0x11')][_0x2193('0x11f')]=function(_0x373f0f){logger['info'](util[_0x2193('0x27')](_0x2193('0x120'),_0x373f0f['label']));return this['channel'][_0x2193('0x11f')]();};AGIVertices[_0x2193('0x11')][_0x2193('0x121')]=function(_0x5be72c){logger[_0x2193('0x2b')](util[_0x2193('0x27')](_0x2193('0x122'),_0x5be72c[_0x2193('0x33')]));if(!this['isConfigured'](_0x5be72c[_0x2193('0x5b')])){return this[_0x2193('0xf')][_0x2193('0x8d')](_0x2193('0xfd'));}var _0x3d8bbc='wav';var _0x46f06e=util[_0x2193('0x27')](_0x2193('0x106'),FILES_PATH,rs[_0x2193('0xeb')](0x4));var _0x37b2a0=util[_0x2193('0x27')]('%s.%s',_0x46f06e,_0x3d8bbc);var _0xd2a021=!![];if(_0x5be72c[_0x2193('0x107')]===_0x2193('0x100')){_0xd2a021=![];}var _0x3c95d8=this[_0x2193('0xf')][_0x2193('0x108')](_0x46f06e,_0x3d8bbc,_0x5be72c['intKey'],_0x5be72c[_0x2193('0x87')],undefined,_0xd2a021);if(_0x3c95d8[_0x2193('0x7d')]!==-0x1){this[_0x2193('0xf')][_0x2193('0x8d')](util['format'](_0x2193('0x123'),_0x37b2a0));var _0x33725c=this[_0x2193('0x61')]['sync'](this,_0x5be72c,_0x37b2a0);if(_0x33725c){for(var _0x46d9dc in _0x33725c){if(_0x33725c[_0x2193('0x76')](_0x46d9dc)){this[_0x2193('0xf')][_0x2193('0x7f')](util[_0x2193('0x27')](_0x2193('0x124'),_0x46d9dc[_0x2193('0xf8')]()),_0x33725c[_0x46d9dc]);}}return this['channel'][_0x2193('0x8d')](util['format'](_0x2193('0x125'),JSON[_0x2193('0xe5')](_0x33725c)));}}return _0x3c95d8;};AGIVertices['prototype'][_0x2193('0x126')]=function(_0x3c6754){logger[_0x2193('0x2b')](util[_0x2193('0x27')](_0x2193('0x127'),_0x3c6754[_0x2193('0x33')]));if(!this[_0x2193('0x63')](_0x3c6754[_0x2193('0x5b')])){return this['channel'][_0x2193('0x8d')](_0x2193('0xfd'));}if(!this[_0x2193('0x63')](_0x3c6754[_0x2193('0x54')])){return this[_0x2193('0xf')][_0x2193('0x8d')](_0x2193('0x96'));}this['channel'][_0x2193('0x8d')](util['format'](_0x2193('0x128'),_0x3c6754[_0x2193('0x54')]));var _0x3d4e74=this[_0x2193('0x5d')][_0x2193('0x81')](this,_0x3c6754);if(_0x3d4e74){this[_0x2193('0xf')]['noop'](util[_0x2193('0x27')](_0x2193('0x123'),_0x3d4e74));var _0x507ed7=this[_0x2193('0xf')][_0x2193('0xcd')](_0x3d4e74,_0x3c6754['intKey']);try{fs[_0x2193('0xce')](_0x3d4e74+'.wav');}catch(_0x1fc59e){logger[_0x2193('0x2a')](_0x1fc59e);}return _0x507ed7;}return this[_0x2193('0xf')][_0x2193('0x2a')](_0x3c6754,_0x2193('0x129'));};AGIVertices[_0x2193('0x11')][_0x2193('0x12a')]=function(_0x48d9bf){logger[_0x2193('0x2b')](util[_0x2193('0x27')](_0x2193('0x12b'),_0x48d9bf[_0x2193('0x33')]));if(!this[_0x2193('0x63')](_0x48d9bf[_0x2193('0x12c')])){return this[_0x2193('0xf')][_0x2193('0x2a')](_0x48d9bf,_0x2193('0x12d'));}logger['info'](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel'][_0x2193('0x35')],_0x48d9bf[_0x2193('0x12c')]));var _0x939511=this[_0x2193('0x4b')][_0x2193('0x81')](this,_0x48d9bf[_0x2193('0x12c')]);if(_0x939511){logger['info'](util[_0x2193('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x2193('0x35')],_0x48d9bf['findBy']));this[_0x2193('0xf')][_0x2193('0x8d')](util[_0x2193('0x27')](_0x2193('0x12e'),this[_0x2193('0xf')][_0x2193('0x35')],_0x48d9bf[_0x2193('0x12c')]));return{'code':0xc8,'result':_0x2193('0x12f')};}else{logger[_0x2193('0x2b')](util[_0x2193('0x27')](_0x2193('0x130'),this[_0x2193('0xf')][_0x2193('0x35')],_0x48d9bf['findBy']));this[_0x2193('0xf')][_0x2193('0x8d')](util[_0x2193('0x27')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x2193('0x35')],_0x48d9bf[_0x2193('0x12c')]));return{'code':0xc8,'result':_0x2193('0x131')};}};AGIVertices[_0x2193('0x11')][_0x2193('0x132')]=function(_0x188ce0){logger['info'](util['format'](_0x2193('0x133'),_0x188ce0[_0x2193('0x33')]));if(!this[_0x2193('0x63')](_0x188ce0['findBy'])){return this[_0x2193('0xf')]['error'](_0x188ce0,_0x2193('0x12d'));}logger[_0x2193('0x2b')](util[_0x2193('0x27')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel'][_0x2193('0x35')],_0x188ce0[_0x2193('0x12c')]));var _0x63b42b=this[_0x2193('0x4a')][_0x2193('0x81')](this,_0x188ce0[_0x2193('0x12c')]);if(_0x63b42b){logger['info'](util[_0x2193('0x27')](_0x2193('0x12e'),this[_0x2193('0xf')][_0x2193('0x35')],_0x188ce0[_0x2193('0x12c')]));this[_0x2193('0xf')][_0x2193('0x8d')](util[_0x2193('0x27')](_0x2193('0x12e'),this[_0x2193('0xf')]['callerid'],_0x188ce0[_0x2193('0x12c')]));return{'code':0xc8,'result':'success'};}else{logger[_0x2193('0x2b')](util[_0x2193('0x27')](_0x2193('0x130'),this[_0x2193('0xf')][_0x2193('0x35')],_0x188ce0['findBy']));this[_0x2193('0xf')][_0x2193('0x8d')](util[_0x2193('0x27')](_0x2193('0x130'),this[_0x2193('0xf')][_0x2193('0x35')],_0x188ce0['findBy']));return{'code':0xc8,'result':_0x2193('0x131')};}};AGIVertices[_0x2193('0x11')][_0x2193('0x134')]=function(_0x52c84b){logger['info'](util[_0x2193('0x27')](_0x2193('0x135'),_0x52c84b[_0x2193('0x33')]));if(!this[_0x2193('0x63')](_0x52c84b['operation'])){return this[_0x2193('0xf')][_0x2193('0x2a')](_0x52c84b,_0x2193('0x136'));}this[_0x2193('0xf')][_0x2193('0x8d')](util[_0x2193('0x27')](_0x2193('0x137'),_0x52c84b[_0x2193('0x138')]));var _0x2b4029=eval(_0x52c84b[_0x2193('0x138')]);if(!this[_0x2193('0x63')](_0x52c84b[_0x2193('0xe1')])){return this[_0x2193('0xf')][_0x2193('0x8d')](_0x2193('0xae'));}var _0x506731=this[_0x2193('0x12')]['sync'](this,_0x52c84b['variable_id']);if(!_0x506731){return this['channel'][_0x2193('0x2a')](_0x52c84b,_0x2193('0x139'));}if(_[_0x2193('0x13a')](_0x2b4029)){var _0x24f4ff=this;_0x2b4029[_0x2193('0xaf')](function(_0x16d54d,_0xebc0a3){_0x24f4ff[_0x2193('0xf')][_0x2193('0x7f')](util[_0x2193('0x27')]('%s[%s]',_0x506731,_0xebc0a3),_0x16d54d);});return this[_0x2193('0xf')]['noop'](util[_0x2193('0x27')](_0x2193('0x13b'),_0x506731));}else{return this['channel'][_0x2193('0x7f')](_0x506731,_0x2b4029);}};AGIVertices[_0x2193('0x11')][_0x2193('0xc')]=function(_0x59295d){logger[_0x2193('0x2b')](util[_0x2193('0x27')](_0x2193('0x13c'),_0x59295d[_0x2193('0x33')]));if(_0x59295d['retry']===0x0){return this['maxRetry'](_0x59295d);}_0x59295d[_0x2193('0x82')]-=0x1;if(!this['isConfigured'](_0x59295d[_0x2193('0xde')])){return this[_0x2193('0xf')][_0x2193('0x2a')](_0x59295d,_0x2193('0xdf'));}var _0x534dc5=this[_0x2193('0x1d')][_0x2193('0x81')](this,_0x59295d[_0x2193('0xde')]);if(!_0x534dc5){return this[_0x2193('0xf')]['error'](_0x59295d,_0x2193('0xe0'));}var _0x43c4f8=this[_0x2193('0xf')]['getData'](_0x534dc5,_0x59295d[_0x2193('0x13d')],_0x59295d[_0x2193('0x13e')]);var _0x526428=_0x43c4f8[_0x2193('0x7d')];if(_0x43c4f8[_0x2193('0x7d')]===-0x1){this['createSquareDetailsReport'][_0x2193('0x81')](this,_0x59295d,'-1');return _0x43c4f8;}else if(_0x43c4f8[_0x2193('0x7b')]===_0x2193('0x87')){_0x43c4f8[_0x2193('0x7d')]=_0x43c4f8[_0x2193('0x7d')][_0x2193('0x7a')]>0x0?_0x43c4f8[_0x2193('0x7d')]:'t';}else if(_[_0x2193('0x3d')](_0x43c4f8['result'])){_0x43c4f8['result']='#';_0x526428='#';}if(!this[_0x2193('0x63')](_0x59295d[_0x2193('0xe1')])){this[_0x2193('0xf')][_0x2193('0x8d')](_0x2193('0xae'));}else{var _0x24ed3d=this[_0x2193('0x12')][_0x2193('0x81')](this,_0x59295d[_0x2193('0xe1')]);if(!_0x24ed3d){return this[_0x2193('0xf')][_0x2193('0x2a')](_0x59295d,_0x2193('0x139'));}this[_0x2193('0xf')][_0x2193('0x7f')](_0x24ed3d,_0x526428);}this[_0x2193('0x31')]['sync'](this,_0x59295d,_0x526428);return _0x43c4f8;};AGIVertices['prototype'][_0x2193('0x8d')]=function(_0x1b4f6e){logger[_0x2193('0x2b')](util[_0x2193('0x27')](_0x2193('0x13f'),_0x1b4f6e['label']));return this[_0x2193('0xf')][_0x2193('0x8d')](_0x1b4f6e[_0x2193('0x140')]||_0x1b4f6e[_0x2193('0x33')]);};AGIVertices['prototype'][_0x2193('0x141')]=function(_0x5ebd4e){logger[_0x2193('0x2b')](util[_0x2193('0x27')](_0x2193('0x142'),_0x5ebd4e[_0x2193('0x33')]));if(!this[_0x2193('0x63')](_0x5ebd4e['findBy'])){return this[_0x2193('0xf')][_0x2193('0x2a')](_0x5ebd4e,'no\x20find\x20by\x20configured');}logger[_0x2193('0x2b')](util[_0x2193('0x27')](_0x2193('0x143'),this['channel'][_0x2193('0x35')],_0x5ebd4e['findBy']));var _0x4ddc66=this[_0x2193('0x46')][_0x2193('0x81')](this,_0x5ebd4e[_0x2193('0x144')]);var _0x2d719c=this['agentPause'][_0x2193('0x81')](this,_0x5ebd4e[_0x2193('0x12c')],_0x4ddc66);if(_0x2d719c){logger[_0x2193('0x2b')](util[_0x2193('0x27')](_0x2193('0x12e'),this[_0x2193('0xf')]['callerid'],_0x5ebd4e['findBy']));this[_0x2193('0xf')][_0x2193('0x8d')](util[_0x2193('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x2193('0xf')][_0x2193('0x35')],_0x5ebd4e[_0x2193('0x12c')]));return{'code':0xc8,'result':_0x2193('0x12f')};}else{logger['info'](util[_0x2193('0x27')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x2193('0x35')],_0x5ebd4e[_0x2193('0x12c')]));this[_0x2193('0xf')][_0x2193('0x8d')](util['format'](_0x2193('0x12e'),this['channel']['callerid'],_0x5ebd4e[_0x2193('0x12c')]));return{'code':0xc8,'result':_0x2193('0x131')};}};AGIVertices[_0x2193('0x11')][_0x2193('0x145')]=function(_0x2fe5e8){logger[_0x2193('0x2b')](util[_0x2193('0x27')](_0x2193('0x146'),_0x2fe5e8[_0x2193('0x33')]));if(!this[_0x2193('0x63')](_0x2fe5e8[_0x2193('0xde')])){return this[_0x2193('0xf')]['error'](_0x2fe5e8,_0x2193('0xdf'));}var _0x53322d=this[_0x2193('0x1d')][_0x2193('0x81')](this,_0x2fe5e8[_0x2193('0xde')]);if(!_0x53322d){return this[_0x2193('0xf')][_0x2193('0x2a')](_0x2fe5e8,_0x2193('0xe0'));}var _0x2baa7c=this[_0x2193('0xf')][_0x2193('0x4f')](_0x2193('0x147'),[_0x53322d,_0x2fe5e8[_0x2193('0xda')]]);if(_0x2baa7c[_0x2193('0x7d')]===-0x1){return _0x2baa7c;}return this[_0x2193('0xf')][_0x2193('0x8d')](util[_0x2193('0x27')]('Executed\x20command\x20%s\x20%s','PLAYBACK',_0x53322d));};AGIVertices[_0x2193('0x11')]['queue']=function(_0x2a0768){logger[_0x2193('0x2b')](util[_0x2193('0x27')](_0x2193('0x148'),_0x2a0768[_0x2193('0x33')]));if(!this[_0x2193('0x63')](_0x2a0768[_0x2193('0x149')])){return this[_0x2193('0xf')][_0x2193('0x2a')](_0x2a0768,'no\x20queue\x20selected');}var _0x339432='';var _0x2037a2=parseInt(_0x2a0768[_0x2193('0x149')],0xa);if(isNaN(_0x2037a2)){_0x339432=_0x2a0768[_0x2193('0x149')];}else{_0x339432=this[_0x2193('0x17')][_0x2193('0x81')](this,_0x2a0768[_0x2193('0x149')]);if(!_0x339432){return this['channel'][_0x2193('0x2a')](_0x2a0768,'no\x20queue\x20found');}}var _0x100b58='';if(this[_0x2193('0x63')](_0x2a0768[_0x2193('0xde')])){var _0x2cff66=this[_0x2193('0x1d')][_0x2193('0x81')](this,_0x2a0768[_0x2193('0xde')]);if(_0x2cff66){_0x100b58=_0x2cff66;}}this['createSquareDetailsReport']['sync'](this,_0x2a0768,_0x339432);if(_0x2a0768[_0x2193('0xda')]['indexOf']('x')<0x0){_0x2a0768[_0x2193('0xda')]+='x';}if(_0x2a0768['opts'][_0x2193('0x14a')]('X')<0x0){_0x2a0768[_0x2193('0xda')]+='X';}this[_0x2193('0xf')][_0x2193('0x7f')](_0x2193('0x14b'),_0x339432?_0x339432[_0x2193('0x14c')]():'');var _0x19f617=this[_0x2193('0xf')][_0x2193('0x4f')]('QUEUE',[_0x339432,_0x2a0768['opts'],_0x2a0768[_0x2193('0xdb')],_0x100b58,_0x2a0768[_0x2193('0x87')],_0x2a0768['agi'],_0x2a0768[_0x2193('0x14d')],_0x2a0768[_0x2193('0x14e')],'',_0x2a0768[_0x2193('0x14f')]]);if(_0x19f617[_0x2193('0x7d')]===-0x1){return _0x19f617;}return this['channel'][_0x2193('0x8d')](util['format'](_0x2193('0x92'),_0x2193('0x150'),_0x339432));};AGIVertices[_0x2193('0x11')][_0x2193('0x151')]=function(_0x3ee6dd){logger[_0x2193('0x2b')](util[_0x2193('0x27')](_0x2193('0x152'),_0x3ee6dd[_0x2193('0x33')]));var _0x26e5f8=_0x3ee6dd[_0x2193('0x153')]||_0x2193('0xfe');var _0x7ffbbe=util[_0x2193('0x27')]('%s_%s',this[_0x2193('0xf')]['uniqueid'],rs[_0x2193('0xeb')](0x5));var _0x2f3d27=util['format'](_0x2193('0x154'),FILES_PATH,_0x7ffbbe,_0x26e5f8);var _0x1c2bbe=util[_0x2193('0x27')](_0x2193('0x106'),FILES_PATH,_0x7ffbbe);this[_0x2193('0x36')][_0x2193('0x81')](this,_0x3ee6dd,_0x7ffbbe,_0x2f3d27);this[_0x2193('0xf')][_0x2193('0x7f')](_0x2193('0x155'),_0x7ffbbe);logger['info'](_0x2193('0x156'),_0x1c2bbe,_0x26e5f8,_0x3ee6dd[_0x2193('0x157')],_0x3ee6dd[_0x2193('0x87')]);return this[_0x2193('0xf')][_0x2193('0x108')](_0x1c2bbe,_0x26e5f8,_0x3ee6dd[_0x2193('0x157')],_0x3ee6dd[_0x2193('0x87')],undefined,!![]);};AGIVertices[_0x2193('0x11')][_0x2193('0x158')]=function(_0x40b41d){logger['info'](util[_0x2193('0x27')](_0x2193('0x159'),_0x40b41d[_0x2193('0x33')]));return this[_0x2193('0xf')]['sayDigits'](_0x40b41d[_0x2193('0x15a')][_0x2193('0x50')](/\s+/g,''),_0x40b41d[_0x2193('0x157')]);};AGIVertices['prototype']['saynumber']=function(_0x313345){logger[_0x2193('0x2b')](util['format'](_0x2193('0x15b'),_0x313345[_0x2193('0x33')]));return this[_0x2193('0xf')]['sayNumber'](_0x313345[_0x2193('0x15c')][_0x2193('0x50')](/\s+/g,''),_0x313345[_0x2193('0x157')]);};AGIVertices[_0x2193('0x11')][_0x2193('0x15d')]=function(_0x1e8015){logger[_0x2193('0x2b')](util[_0x2193('0x27')](_0x2193('0x15e'),_0x1e8015['label']));return this['channel'][_0x2193('0x15f')](_0x1e8015['text'],_0x1e8015[_0x2193('0x157')]);};AGIVertices['prototype'][_0x2193('0x160')]=function(_0x5b9a3a){logger[_0x2193('0x2b')](util[_0x2193('0x27')](_0x2193('0x161'),_0x5b9a3a['label']));if(!this['isConfigured'](_0x5b9a3a['account_id'])){return this[_0x2193('0xf')][_0x2193('0x8d')]('no\x20mail\x20account\x20configured');}var _0x11fc94=this['getMailAccount'][_0x2193('0x81')](this,_0x5b9a3a[_0x2193('0x162')]);if(!_0x11fc94||!_0x11fc94[_0x2193('0x163')]){return this['channel'][_0x2193('0x2a')](_0x5b9a3a,'no\x20mail\x20account\x20found');}var _0x5f6c86={'from':util[_0x2193('0x27')](_0x2193('0x164'),_0x11fc94['name'],_0x11fc94[_0x2193('0x165')]||_0x11fc94[_0x2193('0x163')][_0x2193('0x166')]),'to':_0x5b9a3a['to']||'','cc':_0x5b9a3a['cc']||'','bcc':_0x5b9a3a[_0x2193('0x167')]||'','subject':_0x5b9a3a[_0x2193('0x168')],'html':_0x5b9a3a[_0x2193('0x54')],'text':_0x5b9a3a['text']};var _0x4f5da6={'tls':{'rejectUnauthorized':![]}};if(_0x11fc94[_0x2193('0x163')]['service']){_0x4f5da6[_0x2193('0x169')]=_0x11fc94[_0x2193('0x163')][_0x2193('0x169')];}else{_0x4f5da6['host']=_0x11fc94['Smtp']['host'];_0x4f5da6[_0x2193('0x16a')]=_0x11fc94[_0x2193('0x163')][_0x2193('0x16a')];_0x4f5da6[_0x2193('0x16b')]=_0x11fc94[_0x2193('0x163')][_0x2193('0x16b')];}if(_0x11fc94[_0x2193('0x163')][_0x2193('0x16c')]){_0x4f5da6[_0x2193('0x16d')]={'user':_0x11fc94[_0x2193('0x163')][_0x2193('0x166')],'pass':_0x11fc94[_0x2193('0x163')][_0x2193('0x16e')]};}if(this[_0x2193('0x63')](_0x5b9a3a[_0x2193('0x16f')])){}logger[_0x2193('0xb3')](_0x2193('0x170'),JSON[_0x2193('0xe5')](_0x5f6c86));this[_0x2193('0x31')][_0x2193('0x81')](this,_0x5b9a3a,_0x5b9a3a[_0x2193('0x162')]);this['channel'][_0x2193('0x8d')](util['format'](_0x2193('0x171'),_0x11fc94['name']));this['sendMailMessage'][_0x2193('0x81')](this,_0x4f5da6,_0x5f6c86);return this['channel'][_0x2193('0x8d')](_0x2193('0x172'));};AGIVertices[_0x2193('0x11')][_0x2193('0x173')]=function(_0x188d27){logger['info'](util[_0x2193('0x27')]('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x188d27[_0x2193('0x33')]));return this[_0x2193('0xf')]['noop']('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0x2193('0x11')][_0x2193('0x174')]=function(_0x3d429e){logger[_0x2193('0x2b')](util[_0x2193('0x27')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x3d429e[_0x2193('0x33')]));if(!this[_0x2193('0x63')](_0x3d429e[_0x2193('0x175')])){return this['channel'][_0x2193('0x8d')](_0x2193('0x176'));}var _0x434af2=this[_0x2193('0x177')][_0x2193('0x81')](this,_0x3d429e[_0x2193('0x175')]);if(!_0x434af2){return this['channel'][_0x2193('0x2a')](_0x3d429e,_0x2193('0x178'));}var _0x1c4607={'body':_0x3d429e['sms_text'],'phone':_0x3d429e['to']||'','SmsAccountId':_0x434af2['id']};logger[_0x2193('0xb3')]('sendSMS\x20message',JSON[_0x2193('0xe5')](_0x1c4607));this[_0x2193('0x31')][_0x2193('0x81')](this,_0x3d429e,_0x3d429e[_0x2193('0x175')]);this[_0x2193('0xf')]['noop'](util[_0x2193('0x27')]('Trying\x20SendSMS\x20with\x20account\x20%s',_0x434af2[_0x2193('0x15')]));this[_0x2193('0x30')][_0x2193('0x81')](this,_0x1c4607);return this[_0x2193('0xf')]['noop'](_0x2193('0x179'));};AGIVertices[_0x2193('0x11')][_0x2193('0x17a')]=function(_0xc481e6){logger['info'](util[_0x2193('0x27')](_0x2193('0x17b'),_0xc481e6[_0x2193('0x33')]));if(!this[_0x2193('0x63')](_0xc481e6[_0x2193('0xe1')])){return this[_0x2193('0xf')][_0x2193('0x2a')](_0xc481e6,'no\x20variable\x20selected');}var _0x514b2c=this[_0x2193('0x12')][_0x2193('0x81')](this,_0xc481e6[_0x2193('0xe1')]);if(!_0x514b2c){return this[_0x2193('0xf')][_0x2193('0x2a')](_0xc481e6,'no\x20variable\x20found');}return this['channel']['setVariable'](_0x514b2c,_0xc481e6['variable_value']);};AGIVertices['prototype'][_0x2193('0x17c')]=function(_0xdd65e5){logger[_0x2193('0x2b')](util[_0x2193('0x27')](_0x2193('0x17d'),_0xdd65e5[_0x2193('0x33')]));this[_0x2193('0xf')][_0x2193('0x8d')](_0x2193('0x17e'));if(_0xdd65e5[_0x2193('0x85')]===_0x2193('0x17f')){this[_0x2193('0xf')][_0x2193('0x8d')](_0x2193('0x180'));return this[_0x2193('0xf')][_0x2193('0x85')]();}return this['channel'][_0x2193('0x8d')](_0x2193('0x181'));};AGIVertices[_0x2193('0x11')][_0x2193('0x182')]=function(_0x4fe7df){logger[_0x2193('0x2b')](util[_0x2193('0x27')](_0x2193('0x183'),_0x4fe7df[_0x2193('0x33')]));if(!this[_0x2193('0x63')](_0x4fe7df['project_id'])){return this[_0x2193('0xf')]['error'](_0x4fe7df,_0x2193('0x184'));}var _0x52be4e=this[_0x2193('0x185')][_0x2193('0x81')](this,_0x4fe7df[_0x2193('0x186')]);if(!this[_0x2193('0x63')](_0x52be4e)){return this[_0x2193('0xf')][_0x2193('0x2a')](_0x4fe7df,util[_0x2193('0x27')](_0x2193('0x187'),_0x4fe7df[_0x2193('0x186')]));}if(_0x52be4e===this[_0x2193('0xf')][_0x2193('0x34')]){return this[_0x2193('0xf')][_0x2193('0x2a')](_0x4fe7df,_0x2193('0x188'));}this['createSquareDetailsReport'][_0x2193('0x81')](this,_0x4fe7df,_0x52be4e);var _0x49be10=this['channel'][_0x2193('0x4f')](_0x2193('0x189'),util[_0x2193('0x27')](_0x2193('0x18a'),config[_0x2193('0x8')][_0x2193('0x18b')]||'127.0.0.1',_0x52be4e,this[_0x2193('0xf')][_0x2193('0x34')]));if(_0x49be10[_0x2193('0x7d')]===-0x1){return _0x49be10;}return this['channel'][_0x2193('0x8d')](util[_0x2193('0x27')](_0x2193('0x92'),_0x2193('0x189'),_0x52be4e));};AGIVertices['prototype'][_0x2193('0x18c')]=function(_0x33840f){logger['info'](util['format']('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x33840f[_0x2193('0x33')]));var _0xf85d7c=this[_0x2193('0x4e')]['sync'](this,_0x33840f[_0x2193('0x18d')]);this[_0x2193('0x31')]['sync'](this,_0x33840f,_0x33840f[_0x2193('0x18d')]);if(this['isConfigured'](_0x33840f[_0x2193('0xe1')])){var _0x5643c7=this['getVariable'][_0x2193('0x81')](this,_0x33840f['variable_id']);if(_0x5643c7){this[_0x2193('0xf')][_0x2193('0x7f')](_0x5643c7,_0xf85d7c);return this[_0x2193('0xf')][_0x2193('0x8d')](util[_0x2193('0x27')](_0x2193('0x18e'),_0x33840f[_0x2193('0x18d')],_0x5643c7));}}return this[_0x2193('0xf')][_0x2193('0x8d')](util[_0x2193('0x27')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x33840f[_0x2193('0x18d')]));};AGIVertices[_0x2193('0x11')][_0x2193('0x18f')]=function(_0x580c76){logger[_0x2193('0x2b')](util[_0x2193('0x27')]('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x580c76[_0x2193('0x33')]));if(!this[_0x2193('0x63')](_0x580c76[_0x2193('0x52')])){return this[_0x2193('0xf')][_0x2193('0x8d')](_0x2193('0x190'));}if(!this[_0x2193('0x63')](_0x580c76['text'])){return this[_0x2193('0xf')][_0x2193('0x8d')]('no\x20text\x20configured');}this[_0x2193('0xf')][_0x2193('0x8d')](util[_0x2193('0x27')](_0x2193('0x191'),_0x580c76[_0x2193('0x54')]));var _0x3711fc=this[_0x2193('0x51')][_0x2193('0x81')](this,_0x580c76);if(_0x3711fc){this[_0x2193('0xf')][_0x2193('0x8d')](util[_0x2193('0x27')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x3711fc));var _0x65a6e9=this[_0x2193('0xf')][_0x2193('0xcd')](_0x3711fc);try{fs[_0x2193('0xce')](_0x3711fc+_0x2193('0x192'));}catch(_0x320112){logger[_0x2193('0x2a')](_0x320112);}return _0x65a6e9;}return this[_0x2193('0xf')][_0x2193('0x2a')](_0x580c76,_0x2193('0x193'));};AGIVertices[_0x2193('0x11')]['tts']=function(_0x134b3e){logger['info'](util['format'](_0x2193('0x194'),_0x134b3e[_0x2193('0x33')]));if(!this[_0x2193('0x63')](_0x134b3e[_0x2193('0x54')])){return this[_0x2193('0xf')][_0x2193('0x8d')](_0x2193('0x96'));}this[_0x2193('0xf')][_0x2193('0x8d')](util[_0x2193('0x27')](_0x2193('0x195'),_0x134b3e[_0x2193('0x54')]));var _0x1fddfe=this[_0x2193('0x58')]['sync'](this,_0x134b3e);if(_0x1fddfe){this[_0x2193('0xf')]['noop'](util[_0x2193('0x27')](_0x2193('0x196'),_0x1fddfe));var _0x567129=this['channel']['streamFile'](_0x1fddfe);try{fs[_0x2193('0xce')](_0x1fddfe+_0x2193('0x192'));}catch(_0x371090){logger['error'](_0x371090);}return _0x567129;}return this[_0x2193('0xf')][_0x2193('0x2a')](_0x134b3e,_0x2193('0x197'));};AGIVertices[_0x2193('0x11')]['unpause']=function(_0x456b34){logger[_0x2193('0x2b')](util[_0x2193('0x27')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x456b34[_0x2193('0x33')]));if(!this['isConfigured'](_0x456b34[_0x2193('0x12c')])){return this[_0x2193('0xf')]['error'](_0x456b34,'no\x20find\x20by\x20configured');}logger[_0x2193('0x2b')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x2193('0xf')][_0x2193('0x35')],_0x456b34['findBy']));var _0x5aca4b=this[_0x2193('0x49')][_0x2193('0x81')](this,_0x456b34[_0x2193('0x12c')]);if(_0x5aca4b){logger[_0x2193('0x2b')](util['format'](_0x2193('0x12e'),this['channel'][_0x2193('0x35')],_0x456b34[_0x2193('0x12c')]));this[_0x2193('0xf')][_0x2193('0x8d')](util['format'](_0x2193('0x12e'),this[_0x2193('0xf')][_0x2193('0x35')],_0x456b34[_0x2193('0x12c')]));return{'code':0xc8,'result':_0x2193('0x12f')};}else{logger[_0x2193('0x2b')](util[_0x2193('0x27')](_0x2193('0x130'),this[_0x2193('0xf')]['callerid'],_0x456b34[_0x2193('0x12c')]));this['channel'][_0x2193('0x8d')](util[_0x2193('0x27')](_0x2193('0x130'),this[_0x2193('0xf')][_0x2193('0x35')],_0x456b34[_0x2193('0x12c')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x2193('0x11')][_0x2193('0x198')]=function(_0x23a0b0){logger[_0x2193('0x2b')](util[_0x2193('0x27')](_0x2193('0x199'),_0x23a0b0[_0x2193('0x33')]));var _0x360804=this[_0x2193('0xf')]['exec']('VOICEMAIL',[_0x23a0b0[_0x2193('0x19a')],_0x23a0b0[_0x2193('0x93')]]);if(_0x360804[_0x2193('0x7d')]===-0x1){return _0x360804;}return this[_0x2193('0xf')][_0x2193('0x8d')](util['format'](_0x2193('0x92'),_0x2193('0x19b'),_0x23a0b0['mailbox']));};AGIVertices[_0x2193('0x11')][_0x2193('0x19c')]=function(_0x567ed3){logger[_0x2193('0x2b')](util[_0x2193('0x27')]('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x567ed3[_0x2193('0x33')]));if(!this['isConfigured'](_0x567ed3['variable_id'])){return this[_0x2193('0xf')]['error'](_0x567ed3,'no\x20variable\x20selected');}var _0x18aaca=this[_0x2193('0x12')][_0x2193('0x81')](this,_0x567ed3[_0x2193('0xe1')]);if(!_0x18aaca){return this[_0x2193('0xf')][_0x2193('0x2a')](_0x567ed3,'no\x20variable\x20found');}var _0x4d0aae=this['channel'][_0x2193('0x12')](_0x18aaca);return{'code':0xc8,'result':_0x4d0aae[_0x2193('0x7b')]?_0x4d0aae[_0x2193('0x7b')]:'-'};};String['prototype'][_0x2193('0x19d')]=function(_0x23d26f,_0x4ba510){return this[_0x2193('0x79')](_0x23d26f)['join'](_0x4ba510);};module[_0x2193('0x19e')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 815aebc..f1eef69 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 _0xbec5=['syncAttendedTransfer','syncBlindTransfer','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','interface','queue','mandatoryDisposition','mandatoryDispositionPause','name','Action','then','getAgent','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','acwTimeout','stopAcw','YYYY-MM-DD\x20HH:mm:ss','uniqueid','lastPauseAt','timer','update','[%s][UPDATE][ACWTIME:%s]','catch','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','error','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','[ACW][START]\x20%s','message','[TIMER][STOP][AGENT:%s]','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','linkedid','[ACW][syncHangupRequest]\x20%s','syncHangup','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','util','lodash','../ami','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer'];(function(_0x22ee39,_0x160d26){var _0x37b9e6=function(_0x11c8fc){while(--_0x11c8fc){_0x22ee39['push'](_0x22ee39['shift']());}};_0x37b9e6(++_0x160d26);}(_0xbec5,0xe5));var _0x5bec=function(_0x178856,_0x41f045){_0x178856=_0x178856-0x0;var _0x3c7fe7=_0xbec5[_0x178856];return _0x3c7fe7;};'use strict';var util=require(_0x5bec('0x0'));var _=require(_0x5bec('0x1'));var moment=require('moment');var ami=require(_0x5bec('0x2'));var logger=require(_0x5bec('0x3'))(_0x5bec('0x4'));var RpcUser=require(_0x5bec('0x5'));var RpcVoiceAgentReport=require(_0x5bec('0x6'));function Acw(_0x4ee982){this[_0x5bec('0x7')]=_0x4ee982[_0x5bec('0x7')];this[_0x5bec('0x8')]=_0x4ee982['agents'];this[_0x5bec('0x9')]=_0x4ee982[_0x5bec('0x9')];this[_0x5bec('0xa')]={};ami['on'](_0x5bec('0xb'),this[_0x5bec('0xc')][_0x5bec('0xd')](this));ami['on'](_0x5bec('0xe'),this[_0x5bec('0xf')]['bind'](this));ami['on'](_0x5bec('0x10'),this['syncHangup'][_0x5bec('0xd')](this));ami['on'](_0x5bec('0x11'),this[_0x5bec('0x12')]['bind'](this));ami['on'](_0x5bec('0x13'),this[_0x5bec('0x14')][_0x5bec('0xd')](this));ami['on']('blindtransfer',this[_0x5bec('0x15')][_0x5bec('0xd')](this));ami['on']('custom:agentConnectPreview',this[_0x5bec('0x16')][_0x5bec('0xd')](this));}function getDiff(_0x35393a){var _0x6888a4=moment()[_0x5bec('0x17')](0x0);var _0xcd6d90=moment(_0x35393a)[_0x5bec('0x17')](0x0);return _0x6888a4[_0x5bec('0x18')](_0xcd6d90,_0x5bec('0x19'));}Acw[_0x5bec('0x1a')][_0x5bec('0x1b')]=function(_0x325daf){try{var _0x11fb8e=this;var _0x506639=this['channels'][_0x325daf][_0x5bec('0x1c')];var _0x773740=this[_0x5bec('0xa')][_0x325daf][_0x5bec('0x1d')];var _0x5cd7ae=this['voiceQueues'][_0x773740];var _0x3cd354=![];var _0x6c0d35='ACW';if(_0x5cd7ae[_0x5bec('0x1e')]){if(_0x5cd7ae[_0x5bec('0x1f')][_0x5bec('0x20')]){_0x3cd354=!![];_0x6c0d35=_0x5cd7ae[_0x5bec('0x1f')]['name'];}}ami[_0x5bec('0x21')]({'action':'QueuePause','interface':_0x506639,'paused':!![],'reason':_0x6c0d35})[_0x5bec('0x22')](function(_0x208d99){if(_0x11fb8e[_0x5bec('0x8')][_0x506639]){return RpcUser[_0x5bec('0x23')](_0x11fb8e[_0x5bec('0x8')][_0x506639]['id'])['then'](function(_0x232584){if(_0x232584&&!_0x232584['voicePause']){logger[_0x5bec('0x24')](_0x5bec('0x25'),_0x325daf,_0x506639,_0x773740);var _0x5b2636=_0x11fb8e[_0x5bec('0xa')][_0x325daf][_0x5bec('0x26')]&&_0x11fb8e['channels'][_0x325daf][_0x5bec('0x27')]?_0x11fb8e[_0x5bec('0xa')][_0x325daf][_0x5bec('0x27')]:_0x325daf;return RpcUser[_0x5bec('0x28')](_0x11fb8e[_0x5bec('0x8')][_0x506639],_0x6c0d35,_0x5b2636)[_0x5bec('0x22')](function(_0x2dc014){if(!_0x3cd354){_0x11fb8e['timers'][_0x506639]={};logger['info']('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x325daf,_0x11fb8e[_0x5bec('0x7')][_0x773740][_0x5bec('0x29')],_0x506639,_0x773740);_0x11fb8e[_0x5bec('0x9')][_0x506639]['timer']=setTimeout(_0x11fb8e[_0x5bec('0x2a')][_0x5bec('0xd')](_0x11fb8e,_0x506639),_0x11fb8e['voiceQueues'][_0x773740][_0x5bec('0x29')]*0x3e8);_0x11fb8e[_0x5bec('0x9')][_0x506639]['lastPauseAt']=moment()['format'](_0x5bec('0x2b'));_0x11fb8e[_0x5bec('0x9')][_0x506639][_0x5bec('0x2c')]=_0x325daf;_0x11fb8e[_0x5bec('0x9')][_0x506639][_0x5bec('0x1d')]=_0x773740;_0x11fb8e[_0x5bec('0x9')][_0x506639]['updateAcw']=function(){var _0x2987ca=getDiff(_0x11fb8e['timers'][_0x506639][_0x5bec('0x2d')]);clearTimeout(_0x11fb8e[_0x5bec('0x9')][_0x506639][_0x5bec('0x2e')]);_0x11fb8e[_0x5bec('0x9')][_0x506639]['timer']=![];RpcVoiceAgentReport[_0x5bec('0x2f')]({'acwtime':_0x2987ca},_0x11fb8e[_0x5bec('0x9')][_0x506639][_0x5bec('0x2c')],_0x506639)['then'](function(_0xf6ae6b){logger['info'](_0x5bec('0x30'),_0x325daf,_0x2987ca,_0xf6ae6b);})[_0x5bec('0x31')](function(_0x29df14){logger['error'](_0x5bec('0x32'),_0x325daf,_0x29df14);});delete _0x11fb8e[_0x5bec('0x9')][_0x506639];};}});}else{logger['info'](_0x5bec('0x33'),_0x325daf,_0x506639,_0x773740);}});}})[_0x5bec('0x31')](function(_0x24aa2f){logger[_0x5bec('0x34')](_0x5bec('0x35'),_0x325daf,_0x11fb8e['voiceQueues'][_0x773740][_0x5bec('0x29')],_0x506639,_0x773740);})['finally'](function(){delete _0x11fb8e[_0x5bec('0xa')][_0x325daf];});}catch(_0x384f04){logger[_0x5bec('0x34')](_0x5bec('0x36'),_0x384f04[_0x5bec('0x37')]);}};Acw[_0x5bec('0x1a')]['stopAcw']=function(_0x1c6cc3){try{var _0xb515bb=this;if(_0xb515bb[_0x5bec('0x9')][_0x1c6cc3]){_0xb515bb['timers'][_0x1c6cc3][_0x5bec('0x2e')]=![];var _0x355707=_0xb515bb['timers'][_0x1c6cc3][_0x5bec('0x2c')];var _0x58c34e=_0xb515bb[_0x5bec('0x9')][_0x1c6cc3][_0x5bec('0x1d')];var _0x402e5d=_0xb515bb['voiceQueues'][_0x58c34e][_0x5bec('0x29')];logger[_0x5bec('0x24')](_0x5bec('0x38'),_0x1c6cc3);RpcUser[_0x5bec('0x39')](this[_0x5bec('0x8')][_0x1c6cc3]);RpcVoiceAgentReport[_0x5bec('0x2f')]({'acwtime':_0x402e5d,'agentacw':!![]},_0x355707,_0x1c6cc3)[_0x5bec('0x22')](function(_0x4a8b0b){logger[_0x5bec('0x24')](_0x5bec('0x30'),_0x355707,_0x402e5d,_0x4a8b0b);})[_0x5bec('0x31')](function(_0x414d59){logger['error'](_0x5bec('0x32'),_0x355707,_0x414d59);});}else{logger[_0x5bec('0x34')](_0x5bec('0x3a'),_0x1c6cc3);if(_0xb515bb['timers']){logger['info'](_0x5bec('0x3b'),JSON[_0x5bec('0x3c')](_0xb515bb[_0x5bec('0x9')]));}}}catch(_0x11f667){logger[_0x5bec('0x34')]('[ACW][STOP]\x20%s',_0x11f667['message']);}};Acw[_0x5bec('0x1a')]['syncAgentConnect']=function(_0x39597c){try{if(this[_0x5bec('0x7')][_0x39597c[_0x5bec('0x1d')]]&&(this['voiceQueues'][_0x39597c[_0x5bec('0x1d')]][_0x5bec('0x4')]||this['voiceQueues'][_0x39597c[_0x5bec('0x1d')]][_0x5bec('0x1e')])){if(this[_0x5bec('0x8')][_0x39597c[_0x5bec('0x1c')]]){this[_0x5bec('0xa')][_0x39597c[_0x5bec('0x2c')]]={'queue':_0x39597c[_0x5bec('0x1d')],'interface':_0x39597c['interface'],'destlinkedid':_0x39597c['destlinkedid']};}}}catch(_0x776912){logger['error']('[ACW][syncAgentConnect]\x20%s',_0x776912[_0x5bec('0x37')]);}};Acw['prototype']['syncAgentConnectPreview']=function(_0x48bff0){try{if(this[_0x5bec('0x7')][_0x48bff0[_0x5bec('0x1d')]]&&(this[_0x5bec('0x7')][_0x48bff0[_0x5bec('0x1d')]]['acw']||this[_0x5bec('0x7')][_0x48bff0[_0x5bec('0x1d')]][_0x5bec('0x1e')])){if(this[_0x5bec('0x8')][_0x48bff0['interface']]){this[_0x5bec('0xa')][_0x48bff0[_0x5bec('0x2c')]]={'queue':_0x48bff0[_0x5bec('0x1d')],'interface':_0x48bff0['interface']};}}}catch(_0x2752ba){logger['error'](_0x5bec('0x3d'),_0x2752ba[_0x5bec('0x37')]);}};Acw[_0x5bec('0x1a')][_0x5bec('0xf')]=function(_0x54b11a){try{if(this[_0x5bec('0xa')][_0x54b11a[_0x5bec('0x2c')]]&&_[_0x5bec('0x3e')](this[_0x5bec('0xa')][_0x54b11a[_0x5bec('0x2c')]][_0x5bec('0x26')])){logger[_0x5bec('0x24')]('[%s][HANGUP:UNIQUEID]',_0x54b11a[_0x5bec('0x2c')]);this[_0x5bec('0x1b')](_0x54b11a['uniqueid']);}else if(this[_0x5bec('0xa')][_0x54b11a[_0x5bec('0x3f')]]&&_[_0x5bec('0x3e')](this[_0x5bec('0xa')][_0x54b11a[_0x5bec('0x3f')]][_0x5bec('0x26')])){logger[_0x5bec('0x24')]('[%s][HANGUP:LINKEDID]',_0x54b11a[_0x5bec('0x3f')]);this['startAcw'](_0x54b11a[_0x5bec('0x3f')]);}}catch(_0x208c7b){logger[_0x5bec('0x34')](_0x5bec('0x40'),_0x208c7b[_0x5bec('0x37')]);}};Acw[_0x5bec('0x1a')][_0x5bec('0x41')]=function(_0x3bc0c9){try{if(this[_0x5bec('0xa')][_0x3bc0c9[_0x5bec('0x2c')]]&&this['channels'][_0x3bc0c9[_0x5bec('0x2c')]]['attended']){logger['info'](_0x5bec('0x42'),_0x3bc0c9['uniqueid']);this['startAcw'](_0x3bc0c9[_0x5bec('0x2c')]);}else if(this[_0x5bec('0xa')][_0x3bc0c9[_0x5bec('0x3f')]]&&this['channels'][_0x3bc0c9[_0x5bec('0x3f')]][_0x5bec('0x26')]){logger[_0x5bec('0x24')](_0x5bec('0x43'),_0x3bc0c9['linkedid']);this[_0x5bec('0x1b')](_0x3bc0c9[_0x5bec('0x3f')]);}}catch(_0x9cae50){logger[_0x5bec('0x34')](_0x5bec('0x44'),_0x9cae50[_0x5bec('0x37')]);}};Acw[_0x5bec('0x1a')]['syncAttendedTransfer']=function(_0x504dda){try{if(!_[_0x5bec('0x45')](this['channels'][_0x504dda[_0x5bec('0x46')]])){this[_0x5bec('0x1b')](_0x504dda['transfereeuniqueid']);if(this[_0x5bec('0xa')][_0x504dda['secondtransfereruniqueid']]){this[_0x5bec('0xa')][_0x504dda[_0x5bec('0x47')]][_0x5bec('0x26')]=!![];this[_0x5bec('0xa')][_0x504dda[_0x5bec('0x48')]]=this[_0x5bec('0xa')][_0x504dda[_0x5bec('0x47')]];delete this[_0x5bec('0xa')][_0x504dda[_0x5bec('0x47')]];}}else if(!_[_0x5bec('0x45')](this[_0x5bec('0xa')][_0x504dda[_0x5bec('0x48')]])){this[_0x5bec('0x1b')](_0x504dda[_0x5bec('0x48')]);if(this['channels'][_0x504dda[_0x5bec('0x49')]]){this[_0x5bec('0xa')][_0x504dda[_0x5bec('0x49')]]['attended']=!![];this[_0x5bec('0xa')][_0x504dda[_0x5bec('0x46')]]=this[_0x5bec('0xa')][_0x504dda[_0x5bec('0x49')]];delete this[_0x5bec('0xa')][_0x504dda['origtransfereruniqueid']];}}}catch(_0x3e3108){logger[_0x5bec('0x34')](_0x5bec('0x4a'),_0x3e3108[_0x5bec('0x37')]);}};Acw['prototype'][_0x5bec('0x15')]=function(_0x5dda24){try{if(this[_0x5bec('0xa')][_0x5dda24[_0x5bec('0x4b')]]){logger[_0x5bec('0x24')](_0x5bec('0x4c'),JSON['stringify'](_0x5dda24[_0x5bec('0x4b')]));this[_0x5bec('0x1b')](_0x5dda24[_0x5bec('0x4b')]);}else if(this[_0x5bec('0xa')][_0x5dda24[_0x5bec('0x4d')]]){logger[_0x5bec('0x24')](_0x5bec('0x4e'),JSON[_0x5bec('0x3c')](_0x5dda24[_0x5bec('0x4d')]));this[_0x5bec('0x1b')](_0x5dda24[_0x5bec('0x4d')]);}}catch(_0x42d4e4){logger[_0x5bec('0x34')](_0x5bec('0x4f'),_0x42d4e4[_0x5bec('0x37')]);}};Acw['prototype'][_0x5bec('0x12')]=function(_0x27c160){try{if(this['voiceQueues'][_0x27c160[_0x5bec('0x1d')]]&&this['voiceQueues'][_0x27c160[_0x5bec('0x1d')]][_0x5bec('0x50')]==='all'){if(this['agents'][_0x27c160[_0x5bec('0x1c')]]){logger[_0x5bec('0x24')](_0x5bec('0x51'),_0x27c160[_0x5bec('0x2c')],_0x27c160[_0x5bec('0x1c')],_0x27c160['queue']);return RpcUser[_0x5bec('0x28')](this[_0x5bec('0x8')][_0x27c160['interface']],_0x5bec('0x52'),_0x27c160[_0x5bec('0x2c')]);}}}catch(_0x44a945){logger[_0x5bec('0x34')]('[ACW][syncAgentRingNoAnswer]\x20%s',_0x44a945[_0x5bec('0x37')]);}};module['exports']=Acw; \ No newline at end of file +var _0x55ca=['error','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','stopAcw','[TIMER][STOP][AGENT:%s]','[%s][UPDATE][ERRORS:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','stringify','[ACW][STOP]\x20%s','message','destlinkedid','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','attended','[%s][HANGUP:UNIQUEID]','startAcw','linkedid','isUndefined','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','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:%]','Auto-Pause','util','lodash','acw','../rpc/user','voiceQueues','agents','timers','agentconnect','syncAgentConnect','hanguprequest','syncHangupRequest','syncHangup','bind','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','channels','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','lastPauseAt','update','[%s][UPDATE][ACWTIME:%s]','catch'];(function(_0x393f71,_0x316106){var _0x5f4a88=function(_0x360169){while(--_0x360169){_0x393f71['push'](_0x393f71['shift']());}};_0x5f4a88(++_0x316106);}(_0x55ca,0x126));var _0xa55c=function(_0xc2869e,_0x105457){_0xc2869e=_0xc2869e-0x0;var _0x243be2=_0x55ca[_0xc2869e];return _0x243be2;};'use strict';var util=require(_0xa55c('0x0'));var _=require(_0xa55c('0x1'));var moment=require('moment');var ami=require('../ami');var logger=require('../../../config/logger')(_0xa55c('0x2'));var RpcUser=require(_0xa55c('0x3'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x3b478a){this[_0xa55c('0x4')]=_0x3b478a[_0xa55c('0x4')];this[_0xa55c('0x5')]=_0x3b478a[_0xa55c('0x5')];this[_0xa55c('0x6')]=_0x3b478a[_0xa55c('0x6')];this['channels']={};ami['on'](_0xa55c('0x7'),this[_0xa55c('0x8')]['bind'](this));ami['on'](_0xa55c('0x9'),this[_0xa55c('0xa')]['bind'](this));ami['on']('hangup',this[_0xa55c('0xb')][_0xa55c('0xc')](this));ami['on'](_0xa55c('0xd'),this[_0xa55c('0xe')][_0xa55c('0xc')](this));ami['on'](_0xa55c('0xf'),this[_0xa55c('0x10')][_0xa55c('0xc')](this));ami['on'](_0xa55c('0x11'),this[_0xa55c('0x12')]['bind'](this));ami['on']('custom:agentConnectPreview',this[_0xa55c('0x13')]['bind'](this));}function getDiff(_0x5a3672){var _0x59ea8d=moment()[_0xa55c('0x14')](0x0);var _0x3930e4=moment(_0x5a3672)[_0xa55c('0x14')](0x0);return _0x59ea8d[_0xa55c('0x15')](_0x3930e4,_0xa55c('0x16'));}Acw[_0xa55c('0x17')]['startAcw']=function(_0x3ccf65){try{var _0x3dcf4f=this;var _0x25934f=this[_0xa55c('0x18')][_0x3ccf65][_0xa55c('0x19')];var _0x3ae86b=this[_0xa55c('0x18')][_0x3ccf65][_0xa55c('0x1a')];var _0x24783b=this['voiceQueues'][_0x3ae86b];var _0x3d4c9e=![];var _0x104a99=_0xa55c('0x1b');if(_0x24783b[_0xa55c('0x1c')]){if(_0x24783b[_0xa55c('0x1d')][_0xa55c('0x1e')]){_0x3d4c9e=!![];_0x104a99=_0x24783b['mandatoryDispositionPause']['name'];}}ami[_0xa55c('0x1f')]({'action':_0xa55c('0x20'),'interface':_0x25934f,'paused':!![],'reason':_0x104a99})[_0xa55c('0x21')](function(_0x4cfe10){if(_0x3dcf4f[_0xa55c('0x5')][_0x25934f]){return RpcUser[_0xa55c('0x22')](_0x3dcf4f['agents'][_0x25934f]['id'])[_0xa55c('0x21')](function(_0x133096){if(_0x133096&&!_0x133096[_0xa55c('0x23')]){logger[_0xa55c('0x24')](_0xa55c('0x25'),_0x3ccf65,_0x25934f,_0x3ae86b);var _0x49ed04=_0x3dcf4f[_0xa55c('0x18')][_0x3ccf65]['attended']&&_0x3dcf4f['channels'][_0x3ccf65]['destlinkedid']?_0x3dcf4f[_0xa55c('0x18')][_0x3ccf65]['destlinkedid']:_0x3ccf65;return RpcUser[_0xa55c('0x26')](_0x3dcf4f[_0xa55c('0x5')][_0x25934f],_0x104a99,_0x49ed04)[_0xa55c('0x21')](function(_0xf0e574){if(!_0x3d4c9e){_0x3dcf4f[_0xa55c('0x6')][_0x25934f]={};logger[_0xa55c('0x24')](_0xa55c('0x27'),_0x3ccf65,_0x3dcf4f[_0xa55c('0x4')][_0x3ae86b][_0xa55c('0x28')],_0x25934f,_0x3ae86b);_0x3dcf4f[_0xa55c('0x6')][_0x25934f][_0xa55c('0x29')]=setTimeout(_0x3dcf4f['stopAcw'][_0xa55c('0xc')](_0x3dcf4f,_0x25934f),_0x3dcf4f[_0xa55c('0x4')][_0x3ae86b][_0xa55c('0x28')]*0x3e8);_0x3dcf4f[_0xa55c('0x6')][_0x25934f]['lastPauseAt']=moment()[_0xa55c('0x2a')](_0xa55c('0x2b'));_0x3dcf4f[_0xa55c('0x6')][_0x25934f][_0xa55c('0x2c')]=_0x3ccf65;_0x3dcf4f[_0xa55c('0x6')][_0x25934f][_0xa55c('0x1a')]=_0x3ae86b;_0x3dcf4f['timers'][_0x25934f][_0xa55c('0x2d')]=function(){var _0x490b7d=getDiff(_0x3dcf4f[_0xa55c('0x6')][_0x25934f][_0xa55c('0x2e')]);clearTimeout(_0x3dcf4f[_0xa55c('0x6')][_0x25934f][_0xa55c('0x29')]);_0x3dcf4f['timers'][_0x25934f][_0xa55c('0x29')]=![];RpcVoiceAgentReport[_0xa55c('0x2f')]({'acwtime':_0x490b7d},_0x3dcf4f[_0xa55c('0x6')][_0x25934f][_0xa55c('0x2c')],_0x25934f)[_0xa55c('0x21')](function(_0x1225c3){logger[_0xa55c('0x24')](_0xa55c('0x30'),_0x3ccf65,_0x490b7d,_0x1225c3);})[_0xa55c('0x31')](function(_0xcbaf2e){logger[_0xa55c('0x32')]('[%s][UPDATE][ERRORS:%s]',_0x3ccf65,_0xcbaf2e);});delete _0x3dcf4f['timers'][_0x25934f];};}});}else{logger[_0xa55c('0x24')](_0xa55c('0x33'),_0x3ccf65,_0x25934f,_0x3ae86b);}});}})['catch'](function(_0x30fadd){logger[_0xa55c('0x32')](_0xa55c('0x27'),_0x3ccf65,_0x3dcf4f[_0xa55c('0x4')][_0x3ae86b][_0xa55c('0x28')],_0x25934f,_0x3ae86b);})[_0xa55c('0x34')](function(){delete _0x3dcf4f[_0xa55c('0x18')][_0x3ccf65];});}catch(_0x222d4b){logger[_0xa55c('0x32')]('[ACW][START]\x20%s',_0x222d4b['message']);}};Acw['prototype'][_0xa55c('0x35')]=function(_0x18e00e){try{var _0x2bb4f0=this;if(_0x2bb4f0['timers'][_0x18e00e]){_0x2bb4f0[_0xa55c('0x6')][_0x18e00e]['timer']=![];var _0x119220=_0x2bb4f0['timers'][_0x18e00e][_0xa55c('0x2c')];var _0x39267c=_0x2bb4f0[_0xa55c('0x6')][_0x18e00e]['queue'];var _0x7c4a47=_0x2bb4f0[_0xa55c('0x4')][_0x39267c]['acwTimeout'];logger[_0xa55c('0x24')](_0xa55c('0x36'),_0x18e00e);RpcUser['saveUnpause'](this['agents'][_0x18e00e]);RpcVoiceAgentReport[_0xa55c('0x2f')]({'acwtime':_0x7c4a47,'agentacw':!![]},_0x119220,_0x18e00e)['then'](function(_0x1e75dc){logger[_0xa55c('0x24')]('[%s][UPDATE][ACWTIME:%s]',_0x119220,_0x7c4a47,_0x1e75dc);})['catch'](function(_0x5e50b6){logger['error'](_0xa55c('0x37'),_0x119220,_0x5e50b6);});}else{logger[_0xa55c('0x32')](_0xa55c('0x38'),_0x18e00e);if(_0x2bb4f0[_0xa55c('0x6')]){logger[_0xa55c('0x24')]('[ACW][TIMERS]',JSON[_0xa55c('0x39')](_0x2bb4f0[_0xa55c('0x6')]));}}}catch(_0x77d623){logger[_0xa55c('0x32')](_0xa55c('0x3a'),_0x77d623[_0xa55c('0x3b')]);}};Acw['prototype'][_0xa55c('0x8')]=function(_0x5ee63d){try{if(this['voiceQueues'][_0x5ee63d[_0xa55c('0x1a')]]&&(this[_0xa55c('0x4')][_0x5ee63d['queue']][_0xa55c('0x2')]||this['voiceQueues'][_0x5ee63d['queue']][_0xa55c('0x1c')])){if(this[_0xa55c('0x5')][_0x5ee63d[_0xa55c('0x19')]]){this['channels'][_0x5ee63d[_0xa55c('0x2c')]]={'queue':_0x5ee63d[_0xa55c('0x1a')],'interface':_0x5ee63d['interface'],'destlinkedid':_0x5ee63d[_0xa55c('0x3c')]};}}}catch(_0x514661){logger[_0xa55c('0x32')](_0xa55c('0x3d'),_0x514661['message']);}};Acw[_0xa55c('0x17')][_0xa55c('0x13')]=function(_0x5d834d){try{if(this[_0xa55c('0x4')][_0x5d834d[_0xa55c('0x1a')]]&&(this[_0xa55c('0x4')][_0x5d834d['queue']][_0xa55c('0x2')]||this['voiceQueues'][_0x5d834d[_0xa55c('0x1a')]][_0xa55c('0x1c')])){if(this[_0xa55c('0x5')][_0x5d834d['interface']]){this[_0xa55c('0x18')][_0x5d834d[_0xa55c('0x2c')]]={'queue':_0x5d834d['queue'],'interface':_0x5d834d[_0xa55c('0x19')]};}}}catch(_0x931907){logger['error'](_0xa55c('0x3e'),_0x931907[_0xa55c('0x3b')]);}};Acw['prototype'][_0xa55c('0xa')]=function(_0x81cee8){try{if(this[_0xa55c('0x18')][_0x81cee8[_0xa55c('0x2c')]]&&_['isUndefined'](this[_0xa55c('0x18')][_0x81cee8['uniqueid']][_0xa55c('0x3f')])){logger[_0xa55c('0x24')](_0xa55c('0x40'),_0x81cee8['uniqueid']);this[_0xa55c('0x41')](_0x81cee8[_0xa55c('0x2c')]);}else if(this['channels'][_0x81cee8[_0xa55c('0x42')]]&&_[_0xa55c('0x43')](this[_0xa55c('0x18')][_0x81cee8[_0xa55c('0x42')]][_0xa55c('0x3f')])){logger[_0xa55c('0x24')](_0xa55c('0x44'),_0x81cee8[_0xa55c('0x42')]);this[_0xa55c('0x41')](_0x81cee8[_0xa55c('0x42')]);}}catch(_0x4fc0a9){logger[_0xa55c('0x32')](_0xa55c('0x45'),_0x4fc0a9[_0xa55c('0x3b')]);}};Acw['prototype'][_0xa55c('0xb')]=function(_0x35bf0a){try{if(this['channels'][_0x35bf0a[_0xa55c('0x2c')]]&&this['channels'][_0x35bf0a[_0xa55c('0x2c')]][_0xa55c('0x3f')]){logger[_0xa55c('0x24')](_0xa55c('0x46'),_0x35bf0a[_0xa55c('0x2c')]);this['startAcw'](_0x35bf0a[_0xa55c('0x2c')]);}else if(this[_0xa55c('0x18')][_0x35bf0a['linkedid']]&&this[_0xa55c('0x18')][_0x35bf0a[_0xa55c('0x42')]][_0xa55c('0x3f')]){logger[_0xa55c('0x24')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x35bf0a['linkedid']);this[_0xa55c('0x41')](_0x35bf0a[_0xa55c('0x42')]);}}catch(_0x3ca5b8){logger[_0xa55c('0x32')]('[ACW][syncHangup]\x20%s',_0x3ca5b8[_0xa55c('0x3b')]);}};Acw['prototype'][_0xa55c('0x10')]=function(_0x437ced){try{if(!_[_0xa55c('0x47')](this[_0xa55c('0x18')][_0x437ced[_0xa55c('0x48')]])){this['startAcw'](_0x437ced[_0xa55c('0x48')]);if(this['channels'][_0x437ced[_0xa55c('0x49')]]){this[_0xa55c('0x18')][_0x437ced[_0xa55c('0x49')]][_0xa55c('0x3f')]=!![];this[_0xa55c('0x18')][_0x437ced[_0xa55c('0x4a')]]=this[_0xa55c('0x18')][_0x437ced['secondtransfereruniqueid']];delete this[_0xa55c('0x18')][_0x437ced[_0xa55c('0x49')]];}}else if(!_[_0xa55c('0x47')](this[_0xa55c('0x18')][_0x437ced[_0xa55c('0x4a')]])){this['startAcw'](_0x437ced[_0xa55c('0x4a')]);if(this[_0xa55c('0x18')][_0x437ced[_0xa55c('0x4b')]]){this[_0xa55c('0x18')][_0x437ced[_0xa55c('0x4b')]]['attended']=!![];this[_0xa55c('0x18')][_0x437ced[_0xa55c('0x48')]]=this[_0xa55c('0x18')][_0x437ced[_0xa55c('0x4b')]];delete this[_0xa55c('0x18')][_0x437ced['origtransfereruniqueid']];}}}catch(_0x419fc3){logger['error'](_0xa55c('0x4c'),_0x419fc3['message']);}};Acw[_0xa55c('0x17')]['syncBlindTransfer']=function(_0x34edc5){try{if(this[_0xa55c('0x18')][_0x34edc5[_0xa55c('0x4d')]]){logger[_0xa55c('0x24')](_0xa55c('0x4e'),JSON[_0xa55c('0x39')](_0x34edc5[_0xa55c('0x4d')]));this[_0xa55c('0x41')](_0x34edc5[_0xa55c('0x4d')]);}else if(this[_0xa55c('0x18')][_0x34edc5['transfererlinkedid']]){logger[_0xa55c('0x24')](_0xa55c('0x4f'),JSON['stringify'](_0x34edc5[_0xa55c('0x50')]));this[_0xa55c('0x41')](_0x34edc5[_0xa55c('0x50')]);}}catch(_0x9fe234){logger[_0xa55c('0x32')](_0xa55c('0x51'),_0x9fe234[_0xa55c('0x3b')]);}};Acw[_0xa55c('0x17')]['syncAgentRingNoAnswer']=function(_0x1dfaf7){try{if(this[_0xa55c('0x4')][_0x1dfaf7[_0xa55c('0x1a')]]&&this[_0xa55c('0x4')][_0x1dfaf7[_0xa55c('0x1a')]][_0xa55c('0x52')]===_0xa55c('0x53')){if(this[_0xa55c('0x5')][_0x1dfaf7[_0xa55c('0x19')]]){logger['info'](_0xa55c('0x54'),_0x1dfaf7[_0xa55c('0x2c')],_0x1dfaf7[_0xa55c('0x19')],_0x1dfaf7[_0xa55c('0x1a')]);return RpcUser[_0xa55c('0x26')](this[_0xa55c('0x5')][_0x1dfaf7[_0xa55c('0x19')]],_0xa55c('0x55'),_0x1dfaf7[_0xa55c('0x2c')]);}}}catch(_0x3178a6){logger[_0xa55c('0x32')]('[ACW][syncAgentRingNoAnswer]\x20%s',_0x3178a6[_0xa55c('0x3b')]);}};module['exports']=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 5cb30eb..d6a912d 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 _0xf29d=['ami','port','asterisk','username','password','keepConnected','Action','action','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','error','actionSipShowRegistry','sipshowregistry','devicestatelist','actionSipPeerStatus','sippeerstatus','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','inspect','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionDeviceStateList','actionQueueSummary','asterisk-manager','bluebird','moment','util','lodash','../../config/logger'];(function(_0x4b2494,_0x494d41){var _0x2c1436=function(_0x3eaf82){while(--_0x3eaf82){_0x4b2494['push'](_0x4b2494['shift']());}};_0x2c1436(++_0x494d41);}(_0xf29d,0xb8));var _0xdf29=function(_0x669b35,_0x4d8403){_0x669b35=_0x669b35-0x0;var _0x34b763=_0xf29d[_0x669b35];return _0x34b763;};'use strict';var Manager=require(_0xdf29('0x0'));var BPromise=require(_0xdf29('0x1'));var moment=require(_0xdf29('0x2'));var util=require(_0xdf29('0x3'));var _=require(_0xdf29('0x4'));var logger=require(_0xdf29('0x5'))(_0xdf29('0x6'));var config=require('../../config/environment');var ami=new Manager(config['asterisk'][_0xdf29('0x7')],config['asterisk']['ip'],config[_0xdf29('0x8')][_0xdf29('0x9')],config['asterisk'][_0xdf29('0xa')],!![]);ami[_0xdf29('0xb')]();ami[_0xdf29('0xc')]=BPromise['promisify'](ami[_0xdf29('0xd')]);function error(_0x33a2a6){logger['error'](util[_0xdf29('0xe')](_0xdf29('0xf'),config['asterisk'][_0xdf29('0x9')],config['asterisk']['ip'],config['asterisk'][_0xdf29('0x7')],util['inspect'](_0x33a2a6,![],null)));}function close(){logger[_0xdf29('0x10')](util[_0xdf29('0xe')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0xdf29('0x8')][_0xdf29('0x9')],config[_0xdf29('0x8')]['ip'],config[_0xdf29('0x8')][_0xdf29('0x7')]));}ami[_0xdf29('0x11')]=function(){return function(){return ami[_0xdf29('0xc')]({'action':_0xdf29('0x12')});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0xdf29('0xc')]({'action':_0xdf29('0x13')});};};ami[_0xdf29('0x14')]=function(){return function(){return ami[_0xdf29('0xc')]({'action':_0xdf29('0x15')});};};ami['actionQueueSummary']=function(){return function(){return ami[_0xdf29('0xc')]({'action':'queuesummary'});};};ami[_0xdf29('0x16')]=function(){return function(){return ami[_0xdf29('0xc')]({'action':_0xdf29('0x17')});};};function connect(_0x371f6d){logger[_0xdf29('0x18')](util[_0xdf29('0xe')](_0xdf29('0x19'),config[_0xdf29('0x8')][_0xdf29('0x9')],config[_0xdf29('0x8')]['ip'],config[_0xdf29('0x8')][_0xdf29('0x7')]));ami['once'](_0xdf29('0x10'),error);ami[_0xdf29('0x1a')](_0xdf29('0x1b'),close);}ami['on'](_0xdf29('0x1c'),connect);ami['on'](_0xdf29('0x1d'),function(_0xb9e3f8){logger['info'](util[_0xdf29('0xe')](_0xdf29('0x1e'),config[_0xdf29('0x8')][_0xdf29('0x9')],config['asterisk']['ip'],config[_0xdf29('0x8')]['port'],util[_0xdf29('0x1f')](_0xb9e3f8,![],null)));});ami['on'](_0xdf29('0x20'),function(_0x4bc7c8){logger[_0xdf29('0x18')](util[_0xdf29('0xe')](_0xdf29('0x21'),config['asterisk']['username'],config[_0xdf29('0x8')]['ip'],config[_0xdf29('0x8')][_0xdf29('0x7')]));return BPromise[_0xdf29('0x22')]()['then'](ami[_0xdf29('0x11')]())[_0xdf29('0x23')](ami[_0xdf29('0x24')]())['then'](ami[_0xdf29('0x14')]())[_0xdf29('0x23')](ami[_0xdf29('0x25')]())['then'](ami[_0xdf29('0x16')]())['catch'](function(_0x3fcd87){console['log'](_0x3fcd87);});});ami[_0xdf29('0x1a')]('error',error);ami[_0xdf29('0x1a')](_0xdf29('0x1b'),close);module['exports']=ami; \ No newline at end of file +var _0x5780=['Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','queuesummary','actionCoreShowChannels','coreshowchannels','info','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','actionSipShowRegistry','actionQueueSummary','log','exports','asterisk-manager','bluebird','util','lodash','ami','../../config/environment','port','asterisk','username','password','keepConnected','Action','promisify','action','error','format'];(function(_0x2f7475,_0x29a27e){var _0xda5df=function(_0x23cb11){while(--_0x23cb11){_0x2f7475['push'](_0x2f7475['shift']());}};_0xda5df(++_0x29a27e);}(_0x5780,0x65));var _0x0578=function(_0x1b259f,_0x32dc87){_0x1b259f=_0x1b259f-0x0;var _0x97ffa1=_0x5780[_0x1b259f];return _0x97ffa1;};'use strict';var Manager=require(_0x0578('0x0'));var BPromise=require(_0x0578('0x1'));var moment=require('moment');var util=require(_0x0578('0x2'));var _=require(_0x0578('0x3'));var logger=require('../../config/logger')(_0x0578('0x4'));var config=require(_0x0578('0x5'));var ami=new Manager(config['asterisk'][_0x0578('0x6')],config[_0x0578('0x7')]['ip'],config['asterisk'][_0x0578('0x8')],config[_0x0578('0x7')][_0x0578('0x9')],!![]);ami[_0x0578('0xa')]();ami[_0x0578('0xb')]=BPromise[_0x0578('0xc')](ami[_0x0578('0xd')]);function error(_0x29e078){logger[_0x0578('0xe')](util[_0x0578('0xf')](_0x0578('0x10'),config[_0x0578('0x7')][_0x0578('0x8')],config[_0x0578('0x7')]['ip'],config['asterisk']['port'],util[_0x0578('0x11')](_0x29e078,![],null)));}function close(){logger['error'](util[_0x0578('0xf')](_0x0578('0x12'),config['asterisk'][_0x0578('0x8')],config[_0x0578('0x7')]['ip'],config['asterisk']['port']));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x0578('0xb')]({'action':'sipshowregistry'});};};ami[_0x0578('0x13')]=function(){return function(){return ami[_0x0578('0xb')]({'action':_0x0578('0x14')});};};ami[_0x0578('0x15')]=function(){return function(){return ami['Action']({'action':_0x0578('0x16')});};};ami['actionQueueSummary']=function(){return function(){return ami[_0x0578('0xb')]({'action':_0x0578('0x17')});};};ami[_0x0578('0x18')]=function(){return function(){return ami[_0x0578('0xb')]({'action':_0x0578('0x19')});};};function connect(_0x466c78){logger[_0x0578('0x1a')](util[_0x0578('0xf')]('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0x0578('0x7')][_0x0578('0x8')],config[_0x0578('0x7')]['ip'],config['asterisk'][_0x0578('0x6')]));ami[_0x0578('0x1b')](_0x0578('0xe'),error);ami[_0x0578('0x1b')](_0x0578('0x1c'),close);}ami['on'](_0x0578('0x1d'),connect);ami['on']('shutdown',function(_0x279604){logger[_0x0578('0x1a')](util[_0x0578('0xf')](_0x0578('0x1e'),config[_0x0578('0x7')]['username'],config['asterisk']['ip'],config[_0x0578('0x7')][_0x0578('0x6')],util['inspect'](_0x279604,![],null)));});ami['on'](_0x0578('0x1f'),function(_0x5972a6){logger[_0x0578('0x1a')](util[_0x0578('0xf')](_0x0578('0x20'),config['asterisk'][_0x0578('0x8')],config[_0x0578('0x7')]['ip'],config[_0x0578('0x7')]['port']));return BPromise[_0x0578('0x21')]()[_0x0578('0x22')](ami[_0x0578('0x23')]())[_0x0578('0x22')](ami[_0x0578('0x13')]())[_0x0578('0x22')](ami[_0x0578('0x15')]())[_0x0578('0x22')](ami[_0x0578('0x24')]())[_0x0578('0x22')](ami[_0x0578('0x18')]())['catch'](function(_0x35f383){console[_0x0578('0x25')](_0x35f383);});});ami[_0x0578('0x1b')](_0x0578('0xe'),error);ami[_0x0578('0x1b')](_0x0578('0x1c'),close);module[_0x0578('0x26')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 3ce3a8c..2b22983 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 _0xd54a=['debug','rpc','memberReport','error','message','catch','exports','jayson/promise','bluebird','../../config/logger','http','Request','then'];(function(_0x291795,_0x37a4de){var _0xdd4d2c=function(_0x4d9e7b){while(--_0x4d9e7b){_0x291795['push'](_0x291795['shift']());}};_0xdd4d2c(++_0x37a4de);}(_0xd54a,0xa3));var _0xad54=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xd54a[_0x2641f9];return _0x585741;};'use strict';var jayson=require(_0xad54('0x0'));var BPromise=require(_0xad54('0x1'));var logger=require(_0xad54('0x2'))('ami');var client=jayson['client'][_0xad54('0x3')]({'port':0x2329});client[_0xad54('0x4')]=function(_0x243d2e,_0x22d98d){return new BPromise(function(_0x2cd10a,_0x159725){return client['request'](_0x243d2e,_0x22d98d)[_0xad54('0x5')](function(_0x17f4dc){logger[_0xad54('0x6')](_0xad54('0x7'),_0xad54('0x8'),_0x243d2e,_0x22d98d,_0x17f4dc);if(_0x17f4dc['error']){logger['error']('rpc',_0xad54('0x8'),_0x243d2e,_0x17f4dc[_0xad54('0x9')][_0xad54('0xa')],_0x22d98d);return _0x159725(_0x17f4dc[_0xad54('0x9')][_0xad54('0xa')]);}else{return _0x2cd10a(_0x17f4dc['result']);}})[_0xad54('0xb')](function(_0x116de5){logger['error'](_0xad54('0x7'),'memberReport',_0x243d2e,_0x116de5,_0x22d98d);return _0x159725(_0x116de5);});});};module[_0xad54('0xc')]=client; \ No newline at end of file +var _0x49e0=['http','Request','request','rpc','memberReport','error','message','catch','exports','jayson/promise','bluebird','../../config/logger','ami','client'];(function(_0xbfcb58,_0x420385){var _0x1d379e=function(_0x112e1a){while(--_0x112e1a){_0xbfcb58['push'](_0xbfcb58['shift']());}};_0x1d379e(++_0x420385);}(_0x49e0,0x1c9));var _0x049e=function(_0x483acb,_0xf3efdc){_0x483acb=_0x483acb-0x0;var _0x598083=_0x49e0[_0x483acb];return _0x598083;};'use strict';var jayson=require(_0x049e('0x0'));var BPromise=require(_0x049e('0x1'));var logger=require(_0x049e('0x2'))(_0x049e('0x3'));var client=jayson[_0x049e('0x4')][_0x049e('0x5')]({'port':0x2329});client[_0x049e('0x6')]=function(_0x13609f,_0x5c5c65){return new BPromise(function(_0x58ad07,_0x3e2587){return client[_0x049e('0x7')](_0x13609f,_0x5c5c65)['then'](function(_0x2f15c4){logger['debug'](_0x049e('0x8'),_0x049e('0x9'),_0x13609f,_0x5c5c65,_0x2f15c4);if(_0x2f15c4['error']){logger['error'](_0x049e('0x8'),_0x049e('0x9'),_0x13609f,_0x2f15c4[_0x049e('0xa')][_0x049e('0xb')],_0x5c5c65);return _0x3e2587(_0x2f15c4[_0x049e('0xa')]['message']);}else{return _0x58ad07(_0x2f15c4['result']);}})[_0x049e('0xc')](function(_0x42758f){logger[_0x049e('0xa')](_0x049e('0x8'),'memberReport',_0x13609f,_0x42758f,_0x5c5c65);return _0x3e2587(_0x42758f);});});};module[_0x049e('0xd')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index 8988c2e..8761adc 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 _0xbf16=['exports','util','lodash','moment','isNil','string','voiceQueue','uniqueid','name','phone','Contact','firstName','lastName','number','queue','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','format','callback','callbackuniqueid','callbackat','recallme','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','substring','getQueue'];(function(_0x48318a,_0xd7d7fe){var _0x3208fe=function(_0x5d320d){while(--_0x5d320d){_0x48318a['push'](_0x48318a['shift']());}};_0x3208fe(++_0xd7d7fe);}(_0xbf16,0x73));var _0x6bf1=function(_0xa32430,_0x5cecc7){_0xa32430=_0xa32430-0x0;var _0x95d372=_0xbf16[_0xa32430];return _0x95d372;};'use strict';var util=require(_0x6bf1('0x0'));var _=require(_0x6bf1('0x1'));var moment=require(_0x6bf1('0x2'));function checkNameSurname(_0x5525f6,_0x761f02,_0x5a340e){var _0x20480c='';if(!_[_0x6bf1('0x3')](_0x761f02)&&_0x6bf1('0x4')===typeof _0x761f02){_0x20480c+=_0x761f02;}if(!_[_0x6bf1('0x3')](_0x5a340e)&&_0x6bf1('0x4')===typeof _0x5a340e){_0x20480c+='\x20'+_0x5a340e;}if(_0x20480c!==''){return _0x20480c;}return _0x5525f6;}function Action(_0x4b2c9a,_0x200657,_0x379d93){this[_0x6bf1('0x5')]=_0x4b2c9a;this[_0x6bf1('0x6')]=_0x379d93||undefined;this[_0x6bf1('0x7')]=checkNameSurname(_0x200657['Contact'][_0x6bf1('0x8')],_0x200657[_0x6bf1('0x9')][_0x6bf1('0xa')],_0x200657[_0x6bf1('0x9')][_0x6bf1('0xb')]);this[_0x6bf1('0xc')]=_0x200657[_0x6bf1('0x9')]['phone'];this[_0x6bf1('0xd')]=_0x4b2c9a['name'];this['active']=_0x200657['active']||![];this[_0x6bf1('0xe')]=_0x4b2c9a[_0x6bf1('0xe')];this[_0x6bf1('0xf')]=_0x4b2c9a[_0x6bf1('0xf')]||0x3;this['scheduledat']=_0x200657[_0x6bf1('0x10')];this[_0x6bf1('0x11')]=_0x200657[_0x6bf1('0x11')];this[_0x6bf1('0x12')]=_0x200657[_0x6bf1('0x12')];this[_0x6bf1('0x13')]=_0x200657[_0x6bf1('0x13')];this['ContactId']=_0x200657[_0x6bf1('0x14')];this[_0x6bf1('0x15')]=_0x200657[_0x6bf1('0x15')];this[_0x6bf1('0x16')]=_0x200657[_0x6bf1('0x16')];this[_0x6bf1('0x17')]=_0x200657[_0x6bf1('0x17')];this[_0x6bf1('0x18')]=_0x200657[_0x6bf1('0x18')];this['idHopper']=_0x200657['id'];this['ContactFirstName']=_0x200657[_0x6bf1('0x9')][_0x6bf1('0xa')]||'';this['starttime']=moment()[_0x6bf1('0x19')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x6bf1('0x1a')]=_0x200657[_0x6bf1('0x1a')];this[_0x6bf1('0x1b')]=_0x200657['callbackuniqueid'];this[_0x6bf1('0x1c')]=_0x200657[_0x6bf1('0x1c')];this['recallme']=_0x200657[_0x6bf1('0x1d')];this['originatecalleridnum']='';this[_0x6bf1('0x1e')]='';}Action[_0x6bf1('0x1f')][_0x6bf1('0x20')]=function(){return util[_0x6bf1('0x19')](_0x6bf1('0x21'),this[_0x6bf1('0x7')],this[_0x6bf1('0x5')][_0x6bf1('0x22')]>0x0?this[_0x6bf1('0xc')][_0x6bf1('0x23')](this[_0x6bf1('0x5')]['dialCutDigit']):this[_0x6bf1('0xc')]);};Action[_0x6bf1('0x1f')][_0x6bf1('0x24')]=function(){return this[_0x6bf1('0xd')];};module[_0x6bf1('0x25')]=Action; \ No newline at end of file +var _0x060c=['firstName','lastName','queue','name','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','ContactId','ListId','UserId','VoiceQueueId','idHopper','ContactFirstName','starttime','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','substring','number','prototype','getQueue','exports','util','lodash','moment','isNil','string','voiceQueue','Contact','phone'];(function(_0x3e3d5b,_0x5d1311){var _0x5de775=function(_0x4561a4){while(--_0x4561a4){_0x3e3d5b['push'](_0x3e3d5b['shift']());}};_0x5de775(++_0x5d1311);}(_0x060c,0x1e4));var _0xc060=function(_0x557d15,_0x489159){_0x557d15=_0x557d15-0x0;var _0x5172a5=_0x060c[_0x557d15];return _0x5172a5;};'use strict';var util=require(_0xc060('0x0'));var _=require(_0xc060('0x1'));var moment=require(_0xc060('0x2'));function checkNameSurname(_0x2aca23,_0x5dcc88,_0x23b03e){var _0x10f6da='';if(!_[_0xc060('0x3')](_0x5dcc88)&&_0xc060('0x4')===typeof _0x5dcc88){_0x10f6da+=_0x5dcc88;}if(!_[_0xc060('0x3')](_0x23b03e)&&_0xc060('0x4')===typeof _0x23b03e){_0x10f6da+='\x20'+_0x23b03e;}if(_0x10f6da!==''){return _0x10f6da;}return _0x2aca23;}function Action(_0x24b932,_0x8a57f3,_0x3edf4e){this[_0xc060('0x5')]=_0x24b932;this['uniqueid']=_0x3edf4e||undefined;this['name']=checkNameSurname(_0x8a57f3[_0xc060('0x6')][_0xc060('0x7')],_0x8a57f3[_0xc060('0x6')][_0xc060('0x8')],_0x8a57f3[_0xc060('0x6')][_0xc060('0x9')]);this['number']=_0x8a57f3[_0xc060('0x6')][_0xc060('0x7')];this[_0xc060('0xa')]=_0x24b932[_0xc060('0xb')];this[_0xc060('0xc')]=_0x8a57f3[_0xc060('0xc')]||![];this[_0xc060('0xd')]=_0x24b932[_0xc060('0xd')];this[_0xc060('0xe')]=_0x24b932['dialQueueTimeout']||0x3;this['scheduledat']=_0x8a57f3[_0xc060('0xf')];this[_0xc060('0x10')]=_0x8a57f3['countbusyretry'];this[_0xc060('0x11')]=_0x8a57f3[_0xc060('0x11')];this[_0xc060('0x12')]=_0x8a57f3[_0xc060('0x12')];this[_0xc060('0x13')]=_0x8a57f3[_0xc060('0x13')];this[_0xc060('0x14')]=_0x8a57f3['ListId'];this[_0xc060('0x15')]=_0x8a57f3['UserId'];this[_0xc060('0x16')]=_0x8a57f3[_0xc060('0x16')];this['CampaignId']=_0x8a57f3['CampaignId'];this[_0xc060('0x17')]=_0x8a57f3['id'];this[_0xc060('0x18')]=_0x8a57f3[_0xc060('0x6')][_0xc060('0x8')]||'';this[_0xc060('0x19')]=moment()['format'](_0xc060('0x1a'));this['callback']=_0x8a57f3[_0xc060('0x1b')];this[_0xc060('0x1c')]=_0x8a57f3[_0xc060('0x1c')];this[_0xc060('0x1d')]=_0x8a57f3[_0xc060('0x1d')];this[_0xc060('0x1e')]=_0x8a57f3['recallme'];this[_0xc060('0x1f')]='';this[_0xc060('0x20')]='';}Action['prototype'][_0xc060('0x21')]=function(){return util['format'](_0xc060('0x22'),this[_0xc060('0xb')],this[_0xc060('0x5')][_0xc060('0x23')]>0x0?this['number'][_0xc060('0x24')](this[_0xc060('0x5')]['dialCutDigit']):this[_0xc060('0x25')]);};Action[_0xc060('0x26')][_0xc060('0x27')]=function(){return this[_0xc060('0xa')];};module[_0xc060('0x28')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index b9faee5..b266e8d 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 _0xfec0=['callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','milliseconds','seconds','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','uniqueid','name','calleridnum','number','starttime','responsetime','answertime','format','ringtime','holdtime','talktime','endtime','membername','reason','callback'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xfec0,0x11b));var _0x0fec=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0xfec0[_0x4fde08];return _0x12e725;};'use strict';var util=require(_0x0fec('0x0'));var _=require('lodash');var moment=require('moment');function getSeconds(_0x48670a,_0x5b3834){var _0x4f055c=moment(_0x48670a)[_0x0fec('0x1')](0x0);var _0x251ccf=moment(_0x5b3834)[_0x0fec('0x1')](0x0);return _0x4f055c['diff'](_0x251ccf,_0x0fec('0x2'));}function AgentComplete(_0x5c326d,_0x3faf16){this['state']=0x4;this[_0x0fec('0x3')]=_0x0fec('0x4');this[_0x0fec('0x5')]=_0x5c326d['scheduledat'];this[_0x0fec('0x6')]=_0x5c326d[_0x0fec('0x6')];this[_0x0fec('0x7')]=_0x5c326d['type']===_0x0fec('0x8')?_0x0fec('0x9'):_0x5c326d[_0x0fec('0x6')];this['countbusyretry']=_0x5c326d['countbusyretry'];this['countcongestionretry']=_0x5c326d[_0x0fec('0xa')];this[_0x0fec('0xb')]=_0x5c326d[_0x0fec('0xb')];this[_0x0fec('0xc')]=_0x5c326d[_0x0fec('0xd')]+_0x5c326d[_0x0fec('0xa')]+_0x5c326d[_0x0fec('0xb')];this[_0x0fec('0xe')]=_0x3faf16[_0x0fec('0xe')];this['calleridname']=_0x5c326d[_0x0fec('0xf')];this[_0x0fec('0x10')]=_0x5c326d[_0x0fec('0x11')];this[_0x0fec('0x12')]=_0x5c326d[_0x0fec('0x12')];this[_0x0fec('0x13')]=_0x5c326d['responsetime'];this[_0x0fec('0x14')]=_0x5c326d[_0x0fec('0x14')];this['endtime']=moment()[_0x0fec('0x15')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x0fec('0x16')]=getSeconds(_0x5c326d['responsetime'],_0x5c326d['starttime']);this[_0x0fec('0x17')]=getSeconds(_0x5c326d[_0x0fec('0x14')],_0x5c326d['responsetime']);this[_0x0fec('0x18')]=getSeconds(this[_0x0fec('0x19')],_0x5c326d[_0x0fec('0x14')]);this[_0x0fec('0x9')]=_0x3faf16[_0x0fec('0x9')];this[_0x0fec('0x1a')]=_0x3faf16[_0x0fec('0x1a')];this[_0x0fec('0x1b')]=_0x3faf16[_0x0fec('0x1b')];this[_0x0fec('0x1c')]=_0x5c326d['callback'];this[_0x0fec('0x1d')]=_0x5c326d[_0x0fec('0x1d')];this[_0x0fec('0x1e')]=_0x5c326d[_0x0fec('0x1e')];this['recallme']=_0x5c326d['recallme'];this[_0x0fec('0x1f')]=_0x5c326d[_0x0fec('0x1f')];this[_0x0fec('0x20')]=_0x5c326d[_0x0fec('0x20')];this[_0x0fec('0x21')]=_0x5c326d[_0x0fec('0x21')];this[_0x0fec('0x22')]=_0x5c326d[_0x0fec('0x22')];this[_0x0fec('0x23')]=_0x5c326d[_0x0fec('0x23')];this[_0x0fec('0x24')]=_0x5c326d[_0x0fec('0x24')]||'';this[_0x0fec('0x25')]=_0x5c326d[_0x0fec('0x25')]||'';}module[_0x0fec('0x26')]=AgentComplete; \ No newline at end of file +var _0x2c70=['CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','endtime','membername','reason','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId'];(function(_0xf574a6,_0x30e873){var _0x1cba1f=function(_0x3e439a){while(--_0x3e439a){_0xf574a6['push'](_0xf574a6['shift']());}};_0x1cba1f(++_0x30e873);}(_0x2c70,0x1d2));var _0x02c7=function(_0x2dd465,_0x4c16dc){_0x2dd465=_0x2dd465-0x0;var _0x27b7b8=_0x2c70[_0x2dd465];return _0x27b7b8;};'use strict';var util=require(_0x02c7('0x0'));var _=require(_0x02c7('0x1'));var moment=require(_0x02c7('0x2'));function getSeconds(_0x3d98d0,_0x13dd02){var _0x39e9b7=moment(_0x3d98d0)[_0x02c7('0x3')](0x0);var _0x4f0d10=moment(_0x13dd02)[_0x02c7('0x3')](0x0);return _0x39e9b7[_0x02c7('0x4')](_0x4f0d10,_0x02c7('0x5'));}function AgentComplete(_0x2f5c7c,_0x459c0d){this['state']=0x4;this[_0x02c7('0x6')]=_0x02c7('0x7');this[_0x02c7('0x8')]=_0x2f5c7c[_0x02c7('0x8')];this[_0x02c7('0x9')]=_0x2f5c7c[_0x02c7('0x9')];this[_0x02c7('0xa')]=_0x2f5c7c['type']===_0x02c7('0xb')?_0x02c7('0xc'):_0x2f5c7c[_0x02c7('0x9')];this[_0x02c7('0xd')]=_0x2f5c7c[_0x02c7('0xd')];this[_0x02c7('0xe')]=_0x2f5c7c['countcongestionretry'];this[_0x02c7('0xf')]=_0x2f5c7c[_0x02c7('0xf')];this[_0x02c7('0x10')]=_0x2f5c7c[_0x02c7('0xd')]+_0x2f5c7c[_0x02c7('0xe')]+_0x2f5c7c[_0x02c7('0xf')];this[_0x02c7('0x11')]=_0x459c0d[_0x02c7('0x11')];this[_0x02c7('0x12')]=_0x2f5c7c[_0x02c7('0x13')];this[_0x02c7('0x14')]=_0x2f5c7c[_0x02c7('0x15')];this[_0x02c7('0x16')]=_0x2f5c7c[_0x02c7('0x16')];this[_0x02c7('0x17')]=_0x2f5c7c[_0x02c7('0x17')];this[_0x02c7('0x18')]=_0x2f5c7c[_0x02c7('0x18')];this['endtime']=moment()['format'](_0x02c7('0x19'));this[_0x02c7('0x1a')]=getSeconds(_0x2f5c7c[_0x02c7('0x17')],_0x2f5c7c[_0x02c7('0x16')]);this[_0x02c7('0x1b')]=getSeconds(_0x2f5c7c[_0x02c7('0x18')],_0x2f5c7c['responsetime']);this['talktime']=getSeconds(this[_0x02c7('0x1c')],_0x2f5c7c['answertime']);this[_0x02c7('0xc')]=_0x459c0d[_0x02c7('0xc')];this['membername']=_0x459c0d[_0x02c7('0x1d')];this[_0x02c7('0x1e')]=_0x459c0d[_0x02c7('0x1e')];this['callback']=_0x2f5c7c[_0x02c7('0x1f')];this['callbackuniqueid']=_0x2f5c7c['callbackuniqueid'];this[_0x02c7('0x20')]=_0x2f5c7c[_0x02c7('0x20')];this[_0x02c7('0x21')]=_0x2f5c7c[_0x02c7('0x21')];this['ContactId']=_0x2f5c7c[_0x02c7('0x22')];this[_0x02c7('0x23')]=_0x2f5c7c[_0x02c7('0x23')];this[_0x02c7('0x24')]=_0x2f5c7c['UserId'];this[_0x02c7('0x25')]=_0x2f5c7c[_0x02c7('0x25')];this[_0x02c7('0x26')]=_0x2f5c7c[_0x02c7('0x26')];this[_0x02c7('0x27')]=_0x2f5c7c[_0x02c7('0x27')]||'';this[_0x02c7('0x28')]=_0x2f5c7c['originatecalleridname']||'';}module[_0x02c7('0x29')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index 63a5e7c..361bd8c 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 _0x3c85=['ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','seconds','uniqueid','type','outbound','queue','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','calleridname','calleridnum','starttime','responsetime','endtime'];(function(_0x28fbe7,_0x2451f2){var _0x13af0e=function(_0x4aa6cd){while(--_0x4aa6cd){_0x28fbe7['push'](_0x28fbe7['shift']());}};_0x13af0e(++_0x2451f2);}(_0x3c85,0x1a0));var _0x53c8=function(_0x5a61ed,_0x383f47){_0x5a61ed=_0x5a61ed-0x0;var _0x418837=_0x3c85[_0x5a61ed];return _0x418837;};'use strict';var util=require(_0x53c8('0x0'));var _=require(_0x53c8('0x1'));var moment=require(_0x53c8('0x2'));function getSeconds(_0x3581a4,_0x5c2e85){var _0x4ad111=moment(_0x3581a4)[_0x53c8('0x3')](0x0);var _0xcc2f5f=moment(_0x5c2e85)[_0x53c8('0x3')](0x0);return _0x4ad111['diff'](_0xcc2f5f,_0x53c8('0x4'));}function Final(_0x190db9){this[_0x53c8('0x5')]=_0x190db9['uniqueid'];this['scheduledat']=_0x190db9['scheduledat'];this['type']=_0x190db9[_0x53c8('0x6')];this['campaigntype']=_0x190db9['type']===_0x53c8('0x7')?_0x53c8('0x8'):_0x190db9['type'];this['countbusyretry']=_0x190db9['countbusyretry'];this[_0x53c8('0x9')]=_0x190db9['countcongestionretry'];this['countnoanswerretry']=_0x190db9[_0x53c8('0xa')];this[_0x53c8('0xb')]=_0x190db9[_0x53c8('0xc')]+_0x190db9[_0x53c8('0x9')]+_0x190db9[_0x53c8('0xa')];this['queue']=_0x190db9[_0x53c8('0x8')];this[_0x53c8('0xd')]=_0x190db9[_0x53c8('0xd')];this['calleridnum']=_0x190db9[_0x53c8('0xe')];this[_0x53c8('0xf')]=_0x190db9['starttime'];this[_0x53c8('0x10')]=_0x190db9[_0x53c8('0x10')];this[_0x53c8('0x11')]=_0x190db9[_0x53c8('0x10')];this[_0x53c8('0x12')]=_0x190db9[_0x53c8('0x12')]||0x0;this[_0x53c8('0x13')]=_0x190db9[_0x53c8('0x13')]||0x0;this[_0x53c8('0x14')]=_0x190db9[_0x53c8('0x14')]||0x0;this[_0x53c8('0x15')]=_0x190db9[_0x53c8('0x15')];this[_0x53c8('0x16')]=_0x190db9[_0x53c8('0x16')];this[_0x53c8('0x17')]=_0x190db9[_0x53c8('0x17')];this['recallme']=_0x190db9['recallme'];this[_0x53c8('0x18')]=_0x190db9[_0x53c8('0x18')];this[_0x53c8('0x19')]=_0x190db9[_0x53c8('0x19')];this['UserId']=_0x190db9[_0x53c8('0x1a')];this[_0x53c8('0x1b')]=_0x190db9[_0x53c8('0x1b')];this[_0x53c8('0x1c')]=_0x190db9[_0x53c8('0x1c')];this[_0x53c8('0x1d')]=_0x190db9[_0x53c8('0x1d')]||'';this['originatecalleridname']=_0x190db9[_0x53c8('0x1e')]||'';}module['exports']=Final; \ No newline at end of file +var _0xe1d7=['countcongestionretry','countnoanswerretry','queue','calleridname','calleridnum','starttime','endtime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridname','exports','lodash','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','countbusyretry'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe1d7,0x1a9));var _0x7e1d=function(_0x49d27a,_0x166543){_0x49d27a=_0x49d27a-0x0;var _0x3f0b62=_0xe1d7[_0x49d27a];return _0x3f0b62;};'use strict';var util=require('util');var _=require(_0x7e1d('0x0'));var moment=require('moment');function getSeconds(_0x525d3a,_0x47dd6d){var _0x2cf781=moment(_0x525d3a)[_0x7e1d('0x1')](0x0);var _0x416747=moment(_0x47dd6d)['milliseconds'](0x0);return _0x2cf781[_0x7e1d('0x2')](_0x416747,_0x7e1d('0x3'));}function Final(_0xf1d24a){this[_0x7e1d('0x4')]=_0xf1d24a[_0x7e1d('0x4')];this['scheduledat']=_0xf1d24a[_0x7e1d('0x5')];this[_0x7e1d('0x6')]=_0xf1d24a['type'];this[_0x7e1d('0x7')]=_0xf1d24a[_0x7e1d('0x6')]==='outbound'?'queue':_0xf1d24a[_0x7e1d('0x6')];this[_0x7e1d('0x8')]=_0xf1d24a[_0x7e1d('0x8')];this[_0x7e1d('0x9')]=_0xf1d24a[_0x7e1d('0x9')];this[_0x7e1d('0xa')]=_0xf1d24a[_0x7e1d('0xa')];this['countglobal']=_0xf1d24a[_0x7e1d('0x8')]+_0xf1d24a[_0x7e1d('0x9')]+_0xf1d24a[_0x7e1d('0xa')];this[_0x7e1d('0xb')]=_0xf1d24a['queue'];this[_0x7e1d('0xc')]=_0xf1d24a[_0x7e1d('0xc')];this[_0x7e1d('0xd')]=_0xf1d24a['calleridnum'];this[_0x7e1d('0xe')]=_0xf1d24a[_0x7e1d('0xe')];this['responsetime']=_0xf1d24a['responsetime'];this[_0x7e1d('0xf')]=_0xf1d24a[_0x7e1d('0x10')];this[_0x7e1d('0x11')]=_0xf1d24a['ringtime']||0x0;this[_0x7e1d('0x12')]=_0xf1d24a[_0x7e1d('0x12')]||0x0;this['talktime']=_0xf1d24a[_0x7e1d('0x13')]||0x0;this[_0x7e1d('0x14')]=_0xf1d24a[_0x7e1d('0x14')];this[_0x7e1d('0x15')]=_0xf1d24a['callbackuniqueid'];this[_0x7e1d('0x16')]=_0xf1d24a[_0x7e1d('0x16')];this[_0x7e1d('0x17')]=_0xf1d24a[_0x7e1d('0x17')];this[_0x7e1d('0x18')]=_0xf1d24a[_0x7e1d('0x18')];this[_0x7e1d('0x19')]=_0xf1d24a['ListId'];this[_0x7e1d('0x1a')]=_0xf1d24a[_0x7e1d('0x1a')];this[_0x7e1d('0x1b')]=_0xf1d24a[_0x7e1d('0x1b')];this[_0x7e1d('0x1c')]=_0xf1d24a['CampaignId'];this['originatecalleridnum']=_0xf1d24a['originatecalleridnum']||'';this[_0x7e1d('0x1d')]=_0xf1d24a[_0x7e1d('0x1d')]||'';}module[_0x7e1d('0x1e')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 5d37a30..5bf363c 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(_0x1e40dd,_0x36b4e7){var _0x12f914=function(_0x33170b){while(--_0x33170b){_0x1e40dd['push'](_0x1e40dd['shift']());}};_0x12f914(++_0x36b4e7);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'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(_0x373bea,_0x1920a5){var _0x37b169=function(_0x32970b){while(--_0x32970b){_0x373bea['push'](_0x373bea['shift']());}};_0x37b169(++_0x1920a5);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var util=require(_0x7995('0x0'));var _=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));function getSeconds(_0x10a05d,_0x5b96eb){var _0x86c128=moment(_0x10a05d)[_0x7995('0x3')](0x0);var _0x1902b4=moment(_0x5b96eb)[_0x7995('0x3')](0x0);return _0x86c128['diff'](_0x1902b4,_0x7995('0x4'));}function Hangup(_0x1a36d8,_0x137b6b){this[_0x7995('0x5')]=0x4;this[_0x7995('0x6')]=_0x7995('0x7');this['scheduledat']=_0x1a36d8[_0x7995('0x8')];this[_0x7995('0x9')]=_0x1a36d8['type'];this[_0x7995('0xa')]=_0x1a36d8[_0x7995('0x9')]===_0x7995('0xb')?_0x7995('0xc'):_0x1a36d8[_0x7995('0x9')];this[_0x7995('0xd')]=_0x1a36d8[_0x7995('0xd')];this['countcongestionretry']=_0x1a36d8[_0x7995('0xe')];this[_0x7995('0xf')]=_0x1a36d8['countnoanswerretry'];this[_0x7995('0x10')]=_0x1a36d8[_0x7995('0xd')]+_0x1a36d8[_0x7995('0xe')]+_0x1a36d8[_0x7995('0xf')];this[_0x7995('0x11')]=_0x137b6b[_0x7995('0x11')];this[_0x7995('0x12')]=_0x1a36d8['name'];this['calleridnum']=_0x1a36d8[_0x7995('0x13')];this[_0x7995('0x14')]=_0x1a36d8[_0x7995('0x14')];this[_0x7995('0x15')]=_0x1a36d8[_0x7995('0x15')];this[_0x7995('0x16')]=moment()[_0x7995('0x17')](_0x7995('0x18'));this['ringtime']=getSeconds(_0x1a36d8[_0x7995('0x15')],_0x1a36d8['starttime']);this[_0x7995('0x19')]=0x0;this[_0x7995('0x1a')]=getSeconds(this[_0x7995('0x16')],_0x1a36d8[_0x7995('0x15')]);this[_0x7995('0xc')]=_0x1a36d8[_0x7995('0xc')];this['membername']='IVR';this[_0x7995('0x1b')]=_0x137b6b['cause-txt'];this['callback']=_0x1a36d8[_0x7995('0x1c')];this[_0x7995('0x1d')]=_0x1a36d8['callbackuniqueid'];this[_0x7995('0x1e')]=_0x1a36d8['callbackat'];this['recallme']=_0x1a36d8[_0x7995('0x1f')];this[_0x7995('0x20')]=_0x1a36d8[_0x7995('0x20')];this[_0x7995('0x21')]=_0x1a36d8[_0x7995('0x21')];this[_0x7995('0x22')]=_0x1a36d8['UserId'];this[_0x7995('0x23')]=_0x1a36d8[_0x7995('0x23')];this[_0x7995('0x24')]=_0x1a36d8[_0x7995('0x24')];}module[_0x7995('0x25')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index cb3e0ee..f035c50 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 _0xc6ca=['ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','calleridname','name','calleridnum','number','starttime','responsetime','endtime','talktime','callback','callbackuniqueid','callbackat','recallme'];(function(_0x3c0631,_0x121d6c){var _0x3f3ab7=function(_0x3cc73a){while(--_0x3cc73a){_0x3c0631['push'](_0x3c0631['shift']());}};_0x3f3ab7(++_0x121d6c);}(_0xc6ca,0x1e3));var _0xac6c=function(_0x1f864e,_0x474f41){_0x1f864e=_0x1f864e-0x0;var _0xb806b0=_0xc6ca[_0x1f864e];return _0xb806b0;};'use strict';var util=require(_0xac6c('0x0'));var _=require(_0xac6c('0x1'));var moment=require(_0xac6c('0x2'));function getSeconds(_0x9fedc8,_0x6bcbd6){var _0x203100=moment(_0x9fedc8)[_0xac6c('0x3')](0x0);var _0x43efeb=moment(_0x6bcbd6)['milliseconds'](0x0);return _0x203100['diff'](_0x43efeb,_0xac6c('0x4'));}function History(_0x4abdea){this[_0xac6c('0x5')]=_0x4abdea[_0xac6c('0x5')];this[_0xac6c('0x6')]=_0x4abdea[_0xac6c('0x6')]||undefined;this[_0xac6c('0x7')]=_0x4abdea['type'];this[_0xac6c('0x8')]=_0x4abdea[_0xac6c('0x7')]===_0xac6c('0x9')?_0xac6c('0xa'):_0x4abdea['type'];this['countbusyretry']=_0x4abdea['countbusyretry'];this[_0xac6c('0xb')]=_0x4abdea['countcongestionretry'];this[_0xac6c('0xc')]=_0x4abdea[_0xac6c('0xc')];this[_0xac6c('0xd')]=_0x4abdea[_0xac6c('0xe')]+_0x4abdea[_0xac6c('0xb')]+_0x4abdea['countnoanswerretry'];this[_0xac6c('0xa')]=_0x4abdea['queue'];this[_0xac6c('0xf')]=_0x4abdea[_0xac6c('0x10')];this[_0xac6c('0x11')]=_0x4abdea[_0xac6c('0x12')];this[_0xac6c('0x13')]=_0x4abdea['starttime'];this[_0xac6c('0x14')]=_0x4abdea['responsetime'];this[_0xac6c('0x15')]=_0x4abdea[_0xac6c('0x14')];this['ringtime']=getSeconds(_0x4abdea[_0xac6c('0x14')],_0x4abdea['starttime']);this['holdtime']=0x0;this[_0xac6c('0x16')]=0x0;this[_0xac6c('0x17')]=_0x4abdea[_0xac6c('0x17')];this['callbackuniqueid']=_0x4abdea[_0xac6c('0x18')];this['callbackat']=_0x4abdea[_0xac6c('0x19')];this[_0xac6c('0x1a')]=_0x4abdea[_0xac6c('0x1a')];this['ContactId']=_0x4abdea[_0xac6c('0x1b')];this[_0xac6c('0x1c')]=_0x4abdea[_0xac6c('0x1c')];this[_0xac6c('0x1d')]=_0x4abdea[_0xac6c('0x1d')];this[_0xac6c('0x1e')]=_0x4abdea['VoiceQueueId'];this[_0xac6c('0x1f')]=_0x4abdea[_0xac6c('0x1f')];this[_0xac6c('0x20')]=_0x4abdea['originatecalleridnum']||'';this[_0xac6c('0x21')]=_0x4abdea[_0xac6c('0x21')]||'';}module['exports']=History; \ No newline at end of file +var _0xd4d1=['scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','queue','name','calleridnum','number','starttime','responsetime','endtime','ringtime','holdtime','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','uniqueid'];(function(_0x27612d,_0x8d3208){var _0xab268f=function(_0x1bb033){while(--_0x1bb033){_0x27612d['push'](_0x27612d['shift']());}};_0xab268f(++_0x8d3208);}(_0xd4d1,0xc1));var _0x1d4d=function(_0x131ed4,_0x4720ee){_0x131ed4=_0x131ed4-0x0;var _0x515518=_0xd4d1[_0x131ed4];return _0x515518;};'use strict';var util=require(_0x1d4d('0x0'));var _=require(_0x1d4d('0x1'));var moment=require(_0x1d4d('0x2'));function getSeconds(_0x30fc7e,_0x2667ce){var _0x22e06e=moment(_0x30fc7e)[_0x1d4d('0x3')](0x0);var _0x446ce7=moment(_0x2667ce)['milliseconds'](0x0);return _0x22e06e['diff'](_0x446ce7,'seconds');}function History(_0x19e135){this[_0x1d4d('0x4')]=_0x19e135['uniqueid'];this['scheduledat']=_0x19e135[_0x1d4d('0x5')]||undefined;this[_0x1d4d('0x6')]=_0x19e135[_0x1d4d('0x6')];this[_0x1d4d('0x7')]=_0x19e135[_0x1d4d('0x6')]===_0x1d4d('0x8')?'queue':_0x19e135['type'];this[_0x1d4d('0x9')]=_0x19e135[_0x1d4d('0x9')];this['countcongestionretry']=_0x19e135[_0x1d4d('0xa')];this[_0x1d4d('0xb')]=_0x19e135['countnoanswerretry'];this[_0x1d4d('0xc')]=_0x19e135[_0x1d4d('0x9')]+_0x19e135[_0x1d4d('0xa')]+_0x19e135[_0x1d4d('0xb')];this[_0x1d4d('0xd')]=_0x19e135['queue'];this['calleridname']=_0x19e135[_0x1d4d('0xe')];this[_0x1d4d('0xf')]=_0x19e135[_0x1d4d('0x10')];this[_0x1d4d('0x11')]=_0x19e135['starttime'];this[_0x1d4d('0x12')]=_0x19e135[_0x1d4d('0x12')];this[_0x1d4d('0x13')]=_0x19e135['responsetime'];this[_0x1d4d('0x14')]=getSeconds(_0x19e135[_0x1d4d('0x12')],_0x19e135[_0x1d4d('0x11')]);this[_0x1d4d('0x15')]=0x0;this['talktime']=0x0;this[_0x1d4d('0x16')]=_0x19e135['callback'];this[_0x1d4d('0x17')]=_0x19e135[_0x1d4d('0x17')];this['callbackat']=_0x19e135['callbackat'];this[_0x1d4d('0x18')]=_0x19e135[_0x1d4d('0x18')];this[_0x1d4d('0x19')]=_0x19e135['ContactId'];this[_0x1d4d('0x1a')]=_0x19e135[_0x1d4d('0x1a')];this[_0x1d4d('0x1b')]=_0x19e135['UserId'];this['VoiceQueueId']=_0x19e135[_0x1d4d('0x1c')];this[_0x1d4d('0x1d')]=_0x19e135[_0x1d4d('0x1d')];this[_0x1d4d('0x1e')]=_0x19e135[_0x1d4d('0x1e')]||'';this[_0x1d4d('0x1f')]=_0x19e135[_0x1d4d('0x1f')]||'';}module[_0x1d4d('0x20')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index e298eb1..308223b 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 _0x6eb4=['info','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','isUndefined','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','diff','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','outbound','string','\x22\x22\x20<>','error','inspect','stack','length','hasOwnProperty','[decremetOriginate]\x20object\x20originated\x20is\x20negative','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','is\x20disactive','IS_DISACTIVED','state','statedesc','endtime','starttime','clearZombieChannels','[uniqueid]','[actions]','enqueue','isNil','Action','status','catch','No\x20such\x20channel','updateOriginated','[Dialer][checkChannel]','queue','resolve','then','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','averageHandleTime','rescheduleContact','[rescheduleContact]\x20','getContactDialer','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','emptyContact','notFound','saveInDb','pick','ListId','UserId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','SIP/%s','reachable','unmonitored','variable','amdstatus','xcally-motion-dialer','value','uniqueid','AMD','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','dialAMDActive','MACHINE','membername','amd','[syncMachine][createHistory]','[syncMachine]','HangupInAMD','[syncHangupInAMDIvr]','Machine','[syncMachineIvr][createHistory]','[syncMachineIvr]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','AGI','dialQueueProject','cause-txt','Unknow','agent','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','YYYY-MM-DD\x20HH:mm:ss','queueCallerAbandonCreateState','responsetime','dropreason','TIMEOUT','outboundDropCallsDayCallersExit','Abandoned','CALLEREXIT','channel','actionid','strategy','locked','paused','stateinterface','queueBooked','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[Catch][Preview][syncQueueStatusComplete]','finally','ContactId','VoiceQueueId','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','run','[booked][RR][finaly]','contactAgent-idHopper:\x20','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','checkIsTrunkReachable','isTrunkReachable','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','INTERVAL_IS_EMPTY','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','push','command','iftime\x20%s,%s','interval','timezones','content','true','all','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','power','handlePower','dialPowerLevel','Queue','launchHandleIvr','dialGlobalInterval','dialTimezone','[syncQueueSummary]','[syncCampaigns]','\x5cw{0,','pow','random','match','actionOriginate','object','originate','Contact','getCaller','\x22agi://%s/square,%s\x22','NONE','dialQueueOptions','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','XMD-AMDBETWEENWORDSSILENCE','XMD-AMDMAXIMUMNUMBEROFWORDS','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-CAMPAIGNID','tags','updatedAt','%s%s','XMD-','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','substring','dialCutDigit','phone','TrunkBackup','trim','OriginateError','[originate][error]','Error','originate\x20action\x20Error','response','callProgressDetecting','countbusyretry','countcongestionretry','countnoanswerretry','dialGlobalMaxRetry','dialNoAnswerMaxRetry','add','minutes','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Congestion]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','reason','[syncAgentComplete][createHistory][0]','checkRetriveMax','createStateFinal','reason\x200\x20no\x20such\x20number....','NoAnswer','countglobal','reason\x203\x20ringing\x20no\x20answer','stateGlobal','Busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','[syncAgentComplete][createHistory][?]','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','talking','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','dropRate','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','outboundQueuePauses','[CatchErlangB]','one\x20call\x20every:','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','queuestatus','[booked][checkContactBlack][else]','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','scheduledat','dialRecallMeTimeout','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','handleIvr','limitCalls','temp','dialOrderByScheduledAt','AVAILABLE_CONTACTS_FINISHED','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','Contact.phone','loggerHandler','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','countReScheduled','[actionOriginate]\x20','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','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','Ts\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','p\x20=\x20','Umin\x20=\x20','exports','util','lodash','uuid','moment','md5','ioredis','dialer','../../../config/logger','booked','predictive','predictiveCalls','syncQueueSummary','redis','defaults','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./history','./agentComplete','./queueCallerAbandon','XCALLY_IP_AGI','rrmemory','roundrobin','prototype','tail','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','ivrOriginated','queueBookedRR','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','syncHangup','newexten','syncNewExten','varset','syncVarSet','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','[ifTime][Action]','stringify','milliseconds','seconds','emit','type','answered','available','loggedIn','pTalking','sumHoldTime','unmanaged','abandoned','waiting','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','voice:queue:%s','voice_queue:save','ivr','format','campaign:ivr:%s','campaign:save','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'];(function(_0x323fc6,_0x5a424c){var _0x274dd2=function(_0x196107){while(--_0x196107){_0x323fc6['push'](_0x323fc6['shift']());}};_0x274dd2(++_0x5a424c);}(_0x6eb4,0x166));var _0x46eb=function(_0x1b8c45,_0x24a5fb){_0x1b8c45=_0x1b8c45-0x0;var _0x41bffd=_0x6eb4[_0x1b8c45];return _0x41bffd;};'use strict';var util=require(_0x46eb('0x0'));var _=require(_0x46eb('0x1'));var BPromise=require('bluebird');var uuid=require(_0x46eb('0x2'));var moment=require(_0x46eb('0x3'));var rr=require('rr');var md5=require(_0x46eb('0x4'));var Redis=require(_0x46eb('0x5'));var config=require('../../../config/environment/');var logger=require('../../../config/logger')(_0x46eb('0x6'));var loggerBooked=require(_0x46eb('0x7'))(_0x46eb('0x8'));var loggerPredictive=require(_0x46eb('0x7'))(_0x46eb('0x9'));var loggerPredictiveCalls=require(_0x46eb('0x7'))(_0x46eb('0xa'));var loggerSyncQueueSummary=require(_0x46eb('0x7'))(_0x46eb('0xb'));var ami=require('../ami');config[_0x46eb('0xc')]=_[_0x46eb('0xd')](config[_0x46eb('0xc')],{'host':'localhost','port':0x18eb});var io=require(_0x46eb('0xe'))(new Redis(config[_0x46eb('0xc')]));var cmHopper=require(_0x46eb('0xf'));var cmHopperFinal=require(_0x46eb('0x10'));var cmHopperHistory=require(_0x46eb('0x11'));var cmHopperBlack=require(_0x46eb('0x12'));var voiceQueueRt=require(_0x46eb('0x13'));var Action=require('./action');var History=require(_0x46eb('0x14'));var Final=require('./final');var AgentComplete=require(_0x46eb('0x15'));var QueueCallerAbandon=require(_0x46eb('0x16'));var Hangup=require('./hangup');var ipAgi=process['env'][_0x46eb('0x17')]||'127.0.0.1';var strategy={'rrmemory':_0x46eb('0x18'),'roundrobin':_0x46eb('0x19')};var Sequence=function(){};Sequence[_0x46eb('0x1a')]['enqueue']=function(_0x4a7bfe){this[_0x46eb('0x1b')]=this['tail']?this['tail']['finally'](_0x4a7bfe):_0x4a7bfe();};function Dialer(_0x4b4a34,_0x111960){this['sequence']=new Sequence();this[_0x46eb('0x1c')]=_0x111960;this['voiceQueues']=_0x4b4a34[_0x46eb('0x1d')];this[_0x46eb('0x1e')]=_0x4b4a34[_0x46eb('0x1e')];this[_0x46eb('0x1f')]=_0x4b4a34['agents'];this[_0x46eb('0x20')]=_0x4b4a34['trunks'];this['maxNumberOriginate']=config[_0x46eb('0x21')]||0x2;this[_0x46eb('0x22')]={};this[_0x46eb('0x23')]={};this[_0x46eb('0x24')]={};this[_0x46eb('0x25')]={};this[_0x46eb('0x26')]={};this['startPredictive']={};this['startProgressive']={};this[_0x46eb('0x27')]={};this['queueBooked']={};this[_0x46eb('0x28')]={};ami['on']('agentconnect',this[_0x46eb('0x29')][_0x46eb('0x2a')](this));ami['on'](_0x46eb('0x2b'),this[_0x46eb('0x2c')][_0x46eb('0x2a')](this));ami['on'](_0x46eb('0x2d'),this[_0x46eb('0x2e')][_0x46eb('0x2a')](this));ami['on'](_0x46eb('0x2f'),this[_0x46eb('0x30')][_0x46eb('0x2a')](this));ami['on'](_0x46eb('0x31'),this['syncQueueSummary'][_0x46eb('0x2a')](this));ami['on']('hangup',this[_0x46eb('0x32')][_0x46eb('0x2a')](this));ami['on'](_0x46eb('0x33'),this[_0x46eb('0x34')][_0x46eb('0x2a')](this));ami['on'](_0x46eb('0x35'),this[_0x46eb('0x36')][_0x46eb('0x2a')](this));ami['on']('queuemember',this[_0x46eb('0x37')][_0x46eb('0x2a')](this));ami['on'](_0x46eb('0x38'),this[_0x46eb('0x39')][_0x46eb('0x2a')](this));this[_0x46eb('0x3a')]();this[_0x46eb('0x3b')]();}function isNotNull(_0x464cc6){return _0x464cc6!==null&&!_['isUndefined'](_0x464cc6);}function checkIsLoggedIn(_0xc9f6ae,_0x2be1e6){return function(){if(_0x2be1e6<=0x0){_0xc9f6ae[_0x46eb('0x3c')]=_0x46eb('0x3d');throw _0xc9f6ae[_0x46eb('0x3e')]+_0x46eb('0x3f');}};}function isActive(_0x36693d){return _0x36693d;}function checkIsActive(_0x207f58,_0x5f00a2){return function(){if(!isActive(_0x5f00a2)){_0x207f58[_0x46eb('0x3c')]=_0x46eb('0x40');throw _0x207f58[_0x46eb('0x3e')]+_0x46eb('0x41');}};}function checkInterval(_0x40a109){return function(){if(!isNotNull(_0x40a109[_0x46eb('0x42')])){_0x40a109[_0x46eb('0x3c')]=_0x46eb('0x43');throw _0x40a109[_0x46eb('0x3e')]+_0x46eb('0x44');}if(!isNotNull(_0x40a109['Interval'][_0x46eb('0x45')])){_0x40a109[_0x46eb('0x3c')]='INTERVAL_IS_NULL';throw _0x40a109[_0x46eb('0x3e')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0x46eb('0x46')](_0x40a109[_0x46eb('0x42')]['Intervals']))){_0x40a109[_0x46eb('0x3c')]=_0x46eb('0x43');throw _0x40a109['name']+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0x4b18db,_0x485e99,_0x27f66d){return{'action':_0x4b18db,'response':_0x485e99,'message':_0x27f66d,'stack':_0x27f66d};}function myreject(_0x5318e2){return function(_0x1fc74f){return _0x5318e2(msgResponse(_0x46eb('0x47'),'Error',JSON[_0x46eb('0x48')](_0x1fc74f)));};}function getSeconds(_0x6f3015,_0x329b61){var _0x5555bd=moment(_0x6f3015)[_0x46eb('0x49')](0x0);var _0x2148a8=moment(_0x329b61)[_0x46eb('0x49')](0x0);return _0x5555bd['diff'](_0x2148a8,_0x46eb('0x4a'));}function emit(_0x363d88,_0xbb7eea,_0x10e78d){io['to'](_0x363d88)[_0x46eb('0x4b')](_0xbb7eea,_0x10e78d);}function emitVoiceQueueSummary(_0xee5bf9){if(_0xee5bf9[_0x46eb('0x4c')]==='outbound'){var _0x13bf43={'id':_0xee5bf9['id'],'name':_0xee5bf9[_0x46eb('0x3e')],'strategy':_0xee5bf9['strategy'],'answered':_0xee5bf9[_0x46eb('0x4d')],'available':_0xee5bf9[_0x46eb('0x4e')],'loggedIn':_0xee5bf9[_0x46eb('0x4f')],'pTalking':_0xee5bf9[_0x46eb('0x50')],'sumBillable':_0xee5bf9['sumBillable'],'sumDuration':_0xee5bf9['sumDuration'],'sumHoldTime':_0xee5bf9[_0x46eb('0x51')]||0x0,'talking':_0xee5bf9['talking'],'total':_0xee5bf9['total'],'type':_0xee5bf9[_0x46eb('0x4c')],'unmanaged':_0xee5bf9[_0x46eb('0x52')],'abandoned':_0xee5bf9[_0x46eb('0x53')],'waiting':_0xee5bf9[_0x46eb('0x54')],'loggedInDb':_0xee5bf9['loggedInDb'],'dialActive':_0xee5bf9[_0x46eb('0x55')],'dialMethod':_0xee5bf9[_0x46eb('0x56')],'dialOriginateCallerIdName':_0xee5bf9[_0x46eb('0x57')],'dialOriginateCallerIdNumber':_0xee5bf9[_0x46eb('0x58')],'dialOriginateTimeout':_0xee5bf9[_0x46eb('0x59')],'dialPrefix':_0xee5bf9[_0x46eb('0x5a')],'outboundAnswerAgiCallsDay':_0xee5bf9[_0x46eb('0x5b')],'outboundAnswerCallsDay':_0xee5bf9[_0x46eb('0x5c')],'outboundBlacklistCallsDay':_0xee5bf9[_0x46eb('0x5d')],'outboundBusyCallsDay':_0xee5bf9[_0x46eb('0x5e')],'outboundCongestionCallsDay':_0xee5bf9[_0x46eb('0x5f')],'outboundDropCallsDayACS':_0xee5bf9[_0x46eb('0x60')],'outboundDropCallsDayCallersExit':_0xee5bf9['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0xee5bf9[_0x46eb('0x61')],'outboundNoAnswerCallsDay':_0xee5bf9[_0x46eb('0x62')],'outboundNoSuchCallsDay':_0xee5bf9[_0x46eb('0x63')],'outboundOriginateFailureCallsDay':_0xee5bf9[_0x46eb('0x64')],'outboundReCallsDay':_0xee5bf9['outboundReCallsDay'],'outboundRejectCallsDay':_0xee5bf9[_0x46eb('0x65')],'outboundUnknownCallsDay':_0xee5bf9[_0x46eb('0x66')],'predictiveIntervalAnsweredCalls':_0xee5bf9[_0x46eb('0x67')],'predictiveIntervalAvgHoldtime':_0xee5bf9[_0x46eb('0x68')],'predictiveIntervalAvgTalktime':_0xee5bf9['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0xee5bf9[_0x46eb('0x69')],'predictiveIntervalDroppedCallsTimeout':_0xee5bf9[_0x46eb('0x6a')],'predictiveIntervalErlangCalls':_0xee5bf9[_0x46eb('0x6b')],'predictiveIntervalErlangCallsDroppedCalls':_0xee5bf9[_0x46eb('0x6c')],'predictiveIntervalHitRate':_0xee5bf9[_0x46eb('0x6d')],'predictiveIntervalMultiplicativeFactor':_0xee5bf9['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0xee5bf9[_0x46eb('0x6e')],'predictiveIntervalAvailable':_0xee5bf9[_0x46eb('0x6f')],'predictiveIntervalTotalCalls':_0xee5bf9[_0x46eb('0x70')],'message':_0xee5bf9[_0x46eb('0x3c')],'originated':_0xee5bf9[_0x46eb('0x71')],'erlangCalls':_0xee5bf9['erlangCalls'],'erlangCallToSecond':_0xee5bf9[_0x46eb('0x72')],'erlangAbandonmentRate':_0xee5bf9[_0x46eb('0x73')],'erlangBusyFactor':_0xee5bf9[_0x46eb('0x74')],'startPredictive':_0xee5bf9[_0x46eb('0x75')],'startProgressive':_0xee5bf9[_0x46eb('0x76')]};if(_0xee5bf9[_0x46eb('0x77')]){_0x13bf43[_0x46eb('0x77')]={'id':_0xee5bf9[_0x46eb('0x77')]['id'],'name':_0xee5bf9['Trunk'][_0x46eb('0x3e')],'active':_0xee5bf9[_0x46eb('0x77')][_0x46eb('0x78')],'callerid':_0xee5bf9[_0x46eb('0x77')][_0x46eb('0x79')]};}if(_0xee5bf9['Interval']){_0x13bf43[_0x46eb('0x42')]={'id':_0xee5bf9[_0x46eb('0x42')]['id'],'name':_0xee5bf9[_0x46eb('0x42')][_0x46eb('0x3e')]};}var _0x47eae2=md5(JSON['stringify'](_0x13bf43));if(_0xee5bf9[_0x46eb('0x4')]!==_0x47eae2){_0xee5bf9[_0x46eb('0x4')]=_0x47eae2;emit(util['format'](_0x46eb('0x7a'),_0x13bf43[_0x46eb('0x3e')]),_0x46eb('0x7b'),_0x13bf43);}}}function emitCampaignSummary(_0x34e59b){if(_0x34e59b[_0x46eb('0x4c')]===_0x46eb('0x7c')){emit(util[_0x46eb('0x7d')](_0x46eb('0x7e'),_0x34e59b[_0x46eb('0x3e')]),_0x46eb('0x7f'),_0x34e59b);}}function checkGetDataPredictive(_0x19490e){if(isNotNull(_0x19490e)){if(!_[_0x46eb('0x46')](_0x19490e)){loggerPredictive['info'](_0x46eb('0x80'));loggerPredictive['info'](_0x46eb('0x81'),_0x19490e[_0x46eb('0x70')]);loggerPredictive[_0x46eb('0x82')](_0x46eb('0x83'),_0x19490e['predictiveIntervalAnsweredCalls']);loggerPredictive['info'](_0x46eb('0x84'),_0x19490e['predictiveIntervalDroppedCallsTimeout']);loggerPredictive[_0x46eb('0x82')](_0x46eb('0x85'),_0x19490e[_0x46eb('0x69')]);loggerPredictive[_0x46eb('0x82')](_0x46eb('0x86'),_0x19490e['predictiveIntervalAvgHoldtime']);loggerPredictive[_0x46eb('0x82')](_0x46eb('0x87'),_0x19490e['predictiveIntervalAvgTalktime']);loggerPredictive[_0x46eb('0x82')](_0x46eb('0x88'));if(_0x19490e[_0x46eb('0x70')]>0x0){if(!_['isUndefined'](_0x19490e[_0x46eb('0x89')])&&_0x19490e[_0x46eb('0x89')]>0x0){return!![];}else{loggerPredictive[_0x46eb('0x82')](_0x46eb('0x8a'));}if(!_[_0x46eb('0x8b')](_0x19490e['predictiveIntervalAvgHoldtime'])&&_0x19490e[_0x46eb('0x68')]>0x0){return!![];}else{loggerPredictive[_0x46eb('0x82')](_0x46eb('0x8c'));}}else{loggerPredictive[_0x46eb('0x82')](_0x46eb('0x8d'));}}else{loggerPredictive[_0x46eb('0x82')](_0x46eb('0x8e'));}}else{loggerPredictive[_0x46eb('0x82')](_0x46eb('0x8e'));}return![];}function mergeDataErlangB(_0x472a40){return function(_0x25393f){loggerPredictive[_0x46eb('0x82')]('---------\x20ErlangB\x20---------');loggerPredictive['info'](_0x46eb('0x8f'),_0x25393f[_0x46eb('0x90')]);loggerPredictive[_0x46eb('0x82')](_0x46eb('0x91'),_0x25393f['erlangCallToSecond']);loggerPredictive[_0x46eb('0x82')](_0x46eb('0x92'),_0x25393f[_0x46eb('0x73')]);loggerPredictive[_0x46eb('0x82')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x25393f[_0x46eb('0x74')]);loggerPredictive['info']('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x25393f[_0x46eb('0x73')]);loggerPredictive[_0x46eb('0x82')](_0x46eb('0x88'));_[_0x46eb('0x93')](_0x472a40,_0x25393f);};}function getDiff(_0x18a8ec){var _0x378f32=moment()[_0x46eb('0x49')](0x0);var _0x568247=moment(_0x18a8ec)['milliseconds'](0x0);return _0x378f32[_0x46eb('0x94')](_0x568247,_0x46eb('0x4a'));}function ifInterval(_0x4e5965,_0x145b5f){if(_['isUndefined'](_0x145b5f)){return![];}if(getDiff(_0x145b5f)<_0x4e5965*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x492e34){if(isNotNull(_0x492e34)){if(!_[_0x46eb('0x8b')](_0x492e34[_0x46eb('0x76')])){_0x492e34['startProgressive']=undefined;loggerPredictive[_0x46eb('0x82')](_0x492e34[_0x46eb('0x3e')],_0x46eb('0x95'));}if(!_[_0x46eb('0x8b')](_0x492e34[_0x46eb('0x75')])){_0x492e34[_0x46eb('0x75')]=undefined;loggerPredictive[_0x46eb('0x82')](_0x492e34[_0x46eb('0x3e')],_0x46eb('0x96'));}if(!_[_0x46eb('0x8b')](_0x492e34[_0x46eb('0x97')])){clearInterval(_0x492e34['handlePredictive']);_0x492e34[_0x46eb('0x97')]=undefined;loggerPredictive['info'](_0x492e34[_0x46eb('0x3e')],_0x46eb('0x98'));}}}function erlangb(_0x19cbe7,_0x172b67){if(_0x172b67===0x0){return 0x0;}var _0xe81f3f=0x1;for(var _0x26bcfd=0x1;_0x26bcfd<=_0x172b67;_0x26bcfd+=0x1){_0xe81f3f=0x1+_0xe81f3f*_0x26bcfd/_0x19cbe7;}return 0x1/_0xe81f3f;}function isVoiceQueueOutbound(_0x33a0f6){return _0x33a0f6===_0x46eb('0x99');}function isNotPreview(_0x18a8d0){return _0x18a8d0!==_0x46eb('0x1c');}function isCampaignIvr(_0x4bfa77){return _0x4bfa77===_0x46eb('0x7c');}function getCallerId(_0x504fc8,_0x58c107,_0x477d51){if(!_['isUndefined'](_0x477d51)&&'string'===typeof _0x477d51&&!_[_0x46eb('0x46')](_0x477d51)){if(!_[_0x46eb('0x8b')](_0x58c107)&&_0x46eb('0x9a')===typeof _0x58c107&&!_[_0x46eb('0x46')](_0x58c107)){return util[_0x46eb('0x7d')]('\x22%s\x22\x20<%s>',_0x58c107,_0x477d51);}return util[_0x46eb('0x7d')]('\x22%s\x22\x20<%s>',_0x477d51,_0x477d51);}if(!_['isUndefined'](_0x504fc8)&&_0x46eb('0x9a')===typeof _0x504fc8&&!_[_0x46eb('0x46')](_0x504fc8)){return _0x504fc8;}return _0x46eb('0x9b');}function loggerCatchQueueSummary(_0x221de5,_0xf42a7f){return function(_0x357d0b){freeVariablesPredictive(_0xf42a7f);emitVoiceQueueSummary(_0xf42a7f);emitCampaignSummary(_0xf42a7f);loggerSyncQueueSummary[_0x46eb('0x9c')](_0x221de5,util[_0x46eb('0x9d')](_0x357d0b,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x2c874a,_0x3991d1){return function(_0x2ce963){loggerPredictive[_0x46eb('0x9c')](_0x3991d1['name'],_0x2c874a);loggerPredictive[_0x46eb('0x9c')](_0x2ce963[_0x46eb('0x9e')]);freeVariablesPredictive(_0x3991d1);};}function loggerCatch(_0x23bc05){return function(_0x5c7d62){logger[_0x46eb('0x9c')](_0x23bc05,util[_0x46eb('0x9d')](_0x5c7d62,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x176ca3){return _0x176ca3&&!_[_0x46eb('0x8b')](_0x176ca3)&&_0x176ca3[_0x46eb('0x9f')]>0x0;}function decremetOriginate(_0x191f95){if(!_[_0x46eb('0x8b')](_0x191f95)&&_0x191f95!==null){if(_0x191f95[_0x46eb('0xa0')](_0x46eb('0x71'))){if(_0x191f95['originated']>0x0){_0x191f95[_0x46eb('0x71')]-=0x1;}else{logger[_0x46eb('0x9c')](_0x46eb('0xa1'));}}}else{logger['error']('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x5b8238,_0x358b7c,_0x5f2cae){if(_0x358b7c>_0x5f2cae){for(var _0xf54462=0x0;_0xf54462<_0x358b7c-_0x5f2cae;_0xf54462+=0x1){decremetOriginate(_0x5b8238);}}}function loggerGetContactDialer(_0x440d44,_0x23ea88,_0x1f7b40){return function(_0x979f1c){checkContactLowerLimitOriginate(_0x23ea88,_0x1f7b40,0x0);logger['error'](_0x440d44,util['inspect'](_0x979f1c,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x5bb721){return function(_0x6cf3d1){if(isNotNull(_0x6cf3d1)&&isNotNull(_0x6cf3d1[0x0])){if(_0x6cf3d1[0x0]['contactsRescheduled']>0x0){_0x5bb721[_0x46eb('0x3c')]=_0x46eb('0xa2');logger[_0x46eb('0x82')](_0x46eb('0xa3')+_0x5bb721['name'],_0x6cf3d1[0x0]['contactsRescheduled'],'contacts');}else{_0x5bb721[_0x46eb('0x3c')]='AVAILABLE_CONTACTS_FINISHED';logger[_0x46eb('0x82')]('[getContactDialer2][Empty]'+_0x5bb721['name']);}}};}function notSendMessagesQueue(_0x3bc74b){if(_0x3bc74b['sendMessageOneNotActive']){freeVariablesPredictive(_0x3bc74b);if(_0x3bc74b[_0x46eb('0x71')]===0x0&&_0x3bc74b['talking']===0x0&&_0x3bc74b[_0x46eb('0x54')]===0x0&&(_0x3bc74b[_0x46eb('0x50')]||0x0)===0x0){_0x3bc74b[_0x46eb('0xa4')]=![];_0x3bc74b['available']=0x0;_0x3bc74b[_0x46eb('0x3c')]=_0x46eb('0x40');loggerSyncQueueSummary[_0x46eb('0x9c')](_0x46eb('0xa5'),_0x3bc74b['name'],_0x46eb('0xa6'));}else{_0x3bc74b[_0x46eb('0x3c')]='IS_DISACTIVED';loggerSyncQueueSummary[_0x46eb('0x9c')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x3bc74b['name'],_0x46eb('0xa7'));}emitVoiceQueueSummary(_0x3bc74b);}}function notSendMessagesCampaign(_0x392cdf){if(_0x392cdf['sendMessageOneNotActive']){if(_0x392cdf[_0x46eb('0x71')]===0x0){_0x392cdf['sendMessageOneNotActive']=![];_0x392cdf[_0x46eb('0x3c')]='NOT_ACTIVE';loggerSyncQueueSummary[_0x46eb('0x9c')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x392cdf[_0x46eb('0x3e')],'is\x20not\x20active');}else{_0x392cdf[_0x46eb('0x3c')]=_0x46eb('0xa8');loggerSyncQueueSummary['error']('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x392cdf['name'],'is\x20disactive');}emitCampaignSummary(_0x392cdf);}}function createObjHistory(_0x140541,_0x1e46af,_0x35cccb,_0x2a2baa,_0x5f0d24){_0x140541[_0x46eb('0x3c')]=_0x35cccb;var _0x2c8789=new Action(_0x140541,_0x1e46af);var _0xa24446=new History(_0x2c8789);_0xa24446[_0x46eb('0xa9')]=_0x2a2baa;_0xa24446[_0x46eb('0xaa')]=_0x5f0d24;_0xa24446[_0x46eb('0xab')]=_0x2c8789[_0x46eb('0xac')];return _0xa24446;}Dialer[_0x46eb('0x1a')][_0x46eb('0x3b')]=function(){var _0x3e33d4=this;setInterval(function(){_0x3e33d4[_0x46eb('0xad')](_0x3e33d4[_0x46eb('0x25')],_0x46eb('0xae'));_0x3e33d4[_0x46eb('0xad')](_0x3e33d4['actions'],_0x46eb('0xaf'));},0x32c8);};Dialer[_0x46eb('0x1a')][_0x46eb('0xad')]=function(_0x5335ef,_0x2de551){var _0x36b318=this;for(var _0x25311f in _0x5335ef){if(_0x5335ef[_0x46eb('0xa0')](_0x25311f)){this['sequence'][_0x46eb('0xb0')](function(){if(!_[_0x46eb('0xb1')](_0x5335ef[_0x25311f])){return ami[_0x46eb('0xb2')]({'action':_0x46eb('0xb3'),'channel':_0x5335ef[_0x25311f]['channel']})[_0x46eb('0xb4')](function(_0x159f8f){if(_0x159f8f[_0x46eb('0x3c')]===_0x46eb('0xb5')){setTimeout(function(){if(_0x5335ef[_0x25311f]&&_0x5335ef[_0x25311f][_0x46eb('0x4c')]!==_0x46eb('0x7c')){_0x36b318[_0x46eb('0xb6')](_0x36b318[_0x46eb('0x1d')][_0x5335ef[_0x25311f]['queue']]);logger[_0x46eb('0x9c')](_0x46eb('0xb7'),_0x2de551,_0x25311f,_0x5335ef[_0x25311f][_0x46eb('0xb8')]);delete _0x5335ef[_0x25311f];}if(_0x5335ef[_0x25311f]&&_0x5335ef[_0x25311f]['type']===_0x46eb('0x7c')){_0x36b318[_0x46eb('0xb6')](_0x36b318['campaigns'][_0x5335ef[_0x25311f][_0x46eb('0xb8')]]);logger[_0x46eb('0x9c')]('[Dialer][checkChannel][ivr]',_0x2de551,_0x25311f,_0x5335ef[_0x25311f][_0x46eb('0xb8')]);delete _0x5335ef[_0x25311f];}},0x2328);}});}});}}};Dialer['prototype']['countReScheduled']=function(_0x46f2bc){return BPromise[_0x46eb('0xb9')]()[_0x46eb('0xba')](cmHopper['countReScheduled'](_0x46f2bc))[_0x46eb('0xb4')](loggerCatch(_0x46eb('0xbb')));};Dialer[_0x46eb('0x1a')][_0x46eb('0xbc')]=function(_0x1e9037){return BPromise['resolve']()['then'](cmHopperBlack[_0x46eb('0xbc')](_0x1e9037))[_0x46eb('0xb4')](loggerCatch(_0x46eb('0xbd')));};Dialer[_0x46eb('0x1a')][_0x46eb('0xbe')]=function(_0x42b9fc){return BPromise[_0x46eb('0xb9')]()[_0x46eb('0xba')](cmHopperBlack[_0x46eb('0xbe')](_0x42b9fc))[_0x46eb('0xb4')](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer[_0x46eb('0x1a')][_0x46eb('0xbf')]=function(_0x4f1da6){return BPromise[_0x46eb('0xb9')]()['then'](cmHopperHistory['avgHandleTime'](_0x4f1da6))[_0x46eb('0xb4')](loggerCatch('[averageHandleTime]\x20'));};Dialer['prototype']['rescheduleContact']=function(_0x3ab4a0){return BPromise['resolve']()[_0x46eb('0xba')](cmHopper[_0x46eb('0xc0')](_0x3ab4a0))[_0x46eb('0xb4')](loggerCatch(_0x46eb('0xc1')));};Dialer['prototype'][_0x46eb('0xc2')]=function(_0x4cd1da,_0x2bd773,_0x445750,_0x409c34){return BPromise[_0x46eb('0xb9')]()['then'](cmHopper['getContactDialer'](_0x4cd1da,_0x2bd773,_0x445750,_0x409c34))['catch'](loggerCatch(_0x46eb('0xc3')));};Dialer[_0x46eb('0x1a')][_0x46eb('0xc4')]=function(_0x5f5a00,_0x305e1f,_0x1015cb){return BPromise['resolve']()[_0x46eb('0xba')](cmHopper[_0x46eb('0xc4')](_0x5f5a00,_0x305e1f,_0x1015cb))['catch'](loggerCatch(_0x46eb('0xc3')));};Dialer[_0x46eb('0x1a')][_0x46eb('0xc5')]=function(_0x52cc29){return BPromise[_0x46eb('0xb9')]()[_0x46eb('0xba')](voiceQueueRt[_0x46eb('0xc5')](_0x52cc29))[_0x46eb('0xb4')](loggerCatch(_0x46eb('0xc6')));};Dialer[_0x46eb('0x1a')][_0x46eb('0xc7')]=function(_0x39b099){return BPromise[_0x46eb('0xb9')]()['then'](cmHopper[_0x46eb('0xc7')](_0x39b099))['catch'](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer['prototype'][_0x46eb('0xc8')]=function(_0x49f94b){return BPromise['resolve']()[_0x46eb('0xba')](cmHopperHistory[_0x46eb('0xc8')](_0x49f94b))[_0x46eb('0xb4')](loggerCatch(_0x46eb('0xc9')));};Dialer[_0x46eb('0x1a')][_0x46eb('0xb6')]=function(_0x2c2983){if(!_[_0x46eb('0x8b')](_0x2c2983)&&_0x2c2983!==null){if(_0x2c2983['hasOwnProperty'](_0x46eb('0x71'))){if(_0x2c2983['originated']>0x0){_0x2c2983[_0x46eb('0x71')]-=0x1;}else{logger[_0x46eb('0x9c')](_0x46eb('0xca'));}}}else{logger[_0x46eb('0x9c')](_0x46eb('0xcb'));}};Dialer['prototype']['loggerHandler']=function(_0x3ee6d1,_0x38391f){var _0x1284ba=this;return function(_0x355968){_0x1284ba['updateOriginated'](_0x38391f);logger[_0x46eb('0x9c')](_0x3ee6d1,util[_0x46eb('0x9d')](_0x355968,{'showHidden':![],'depth':null}));};};Dialer[_0x46eb('0x1a')][_0x46eb('0xcc')]=function(_0x12bfe6,_0x5d5548,_0x1e3674){var _0x3933a6={'state':0x19,'statedesc':_0x46eb('0xcd')};this[_0x46eb('0xb6')](_0x5d5548);this[_0x46eb('0xce')](_[_0x46eb('0x93')](_0x3933a6,_[_0x46eb('0xcf')](_0x1e3674,['ContactId',_0x46eb('0xd0'),_0x46eb('0xd1'),'VoiceQueueId',_0x46eb('0xd2')])),_0x46eb('0xd3'),_0x46eb('0xd4'));logger[_0x46eb('0x9c')](_0x12bfe6);};Dialer[_0x46eb('0x1a')][_0x46eb('0xd5')]=function(_0x235d49){return _0x235d49==='Success';};Dialer[_0x46eb('0x1a')]['isTrunkReachable']=function(_0x3a4da7){return!_[_0x46eb('0x8b')](_0x3a4da7)&&_0x3a4da7&&!_[_0x46eb('0x8b')](_0x3a4da7[_0x46eb('0x3e')])&&!_['isUndefined'](_0x3a4da7[_0x46eb('0x78')])&&_0x3a4da7[_0x46eb('0x78')]&&(this[_0x46eb('0x20')][util[_0x46eb('0x7d')](_0x46eb('0xd6'),_0x3a4da7[_0x46eb('0x3e')])][_0x46eb('0xb3')]===_0x46eb('0xd7')||this[_0x46eb('0x20')][util['format'](_0x46eb('0xd6'),_0x3a4da7[_0x46eb('0x3e')])][_0x46eb('0xb3')]===_0x46eb('0xd8'));};Dialer[_0x46eb('0x1a')][_0x46eb('0xce')]=function(_0x325c0c,_0x563d42,_0xe524ac){this['createHistory'](_0x325c0c)['catch'](loggerCatch(_0x563d42));this[_0x46eb('0xc7')](_0x325c0c)[_0x46eb('0xb4')](loggerCatch(_0xe524ac));};Dialer[_0x46eb('0x1a')][_0x46eb('0x36')]=function(_0x55a2cf){var _0x53986b=this[_0x46eb('0x25')][_0x55a2cf['uniqueid']];var _0x3c074d;if(!_['isNil'](_0x55a2cf)&&!_['isNil'](_0x55a2cf[_0x46eb('0xd9')])&&!_[_0x46eb('0xb1')](_0x55a2cf['variable'][_0x46eb('0xda')])&&_0x55a2cf['exten']===_0x46eb('0xdb')&&_0x53986b){if(_0x53986b[_0x46eb('0x4c')]!==_0x46eb('0x7c')&&this[_0x46eb('0x1d')][_0x53986b[_0x46eb('0xb8')]]['dialAMDActive']&&_0x55a2cf[_0x46eb('0xdc')]==='HANGUP'){delete this['uniqueId'][_0x55a2cf[_0x46eb('0xdd')]];this[_0x46eb('0xb6')](this[_0x46eb('0x1d')][_0x53986b[_0x46eb('0xb8')]]);this['voiceQueues'][_0x53986b[_0x46eb('0xb8')]]['outboundAnswerCallsDay']+=0x1;this['voiceQueues'][_0x53986b[_0x46eb('0xb8')]]['outboundAnswerAgiCallsDay']+=0x1;_0x3c074d=new Hangup(_0x53986b,_0x55a2cf);_0x3c074d[_0x46eb('0xa9')]=0x12;_0x3c074d[_0x46eb('0xaa')]='HangupInAMD';_0x3c074d['membername']=_0x46eb('0xde');this[_0x46eb('0xce')](_0x3c074d,_0x46eb('0xdf'),_0x46eb('0xe0'));}if(_0x53986b[_0x46eb('0x4c')]!==_0x46eb('0x7c')&&this[_0x46eb('0x1d')][_0x53986b[_0x46eb('0xb8')]][_0x46eb('0xe1')]&&_0x55a2cf[_0x46eb('0xdc')]===_0x46eb('0xe2')){delete this[_0x46eb('0x25')][_0x55a2cf['uniqueid']];this[_0x46eb('0xb6')](this[_0x46eb('0x1d')][_0x53986b[_0x46eb('0xb8')]]);this[_0x46eb('0x1d')][_0x53986b[_0x46eb('0xb8')]][_0x46eb('0x5c')]+=0x1;this[_0x46eb('0x1d')][_0x53986b['queue']][_0x46eb('0x5b')]+=0x1;_0x3c074d=new Hangup(_0x53986b,_0x55a2cf);_0x3c074d[_0x46eb('0xa9')]=0x13;_0x3c074d[_0x46eb('0xaa')]='Machine';_0x3c074d[_0x46eb('0xe3')]=_0x46eb('0xde');_0x3c074d[_0x46eb('0xe4')]=!![];this[_0x46eb('0xce')](_0x3c074d,_0x46eb('0xe5'),_0x46eb('0xe6'));}if(_0x53986b[_0x46eb('0x4c')]===_0x46eb('0x7c')&&this[_0x46eb('0x1e')][_0x53986b[_0x46eb('0xb8')]][_0x46eb('0xe1')]&&_0x55a2cf[_0x46eb('0xdc')]==='HANGUP'){delete this['uniqueId'][_0x55a2cf[_0x46eb('0xdd')]];this[_0x46eb('0xb6')](this[_0x46eb('0x1e')][_0x53986b[_0x46eb('0xb8')]]);_0x3c074d=new Hangup(_0x53986b,_0x55a2cf);_0x3c074d[_0x46eb('0xa9')]=0x12;_0x3c074d[_0x46eb('0xaa')]=_0x46eb('0xe7');_0x3c074d[_0x46eb('0xe3')]=_0x46eb('0xde');this['saveInDb'](_0x3c074d,'[syncHangupInAMDIvr][createHistory]',_0x46eb('0xe8'));}if(_0x53986b[_0x46eb('0x4c')]===_0x46eb('0x7c')&&this[_0x46eb('0x1e')][_0x53986b['queue']][_0x46eb('0xe1')]&&_0x55a2cf[_0x46eb('0xdc')]===_0x46eb('0xe2')){delete this[_0x46eb('0x25')][_0x55a2cf[_0x46eb('0xdd')]];this[_0x46eb('0xb6')](this[_0x46eb('0x1e')][_0x53986b[_0x46eb('0xb8')]]);_0x3c074d=new Hangup(_0x53986b,_0x55a2cf);_0x3c074d['state']=0x13;_0x3c074d[_0x46eb('0xaa')]=_0x46eb('0xe9');_0x3c074d[_0x46eb('0xe3')]='AMD';_0x3c074d[_0x46eb('0xe4')]=!![];this[_0x46eb('0xce')](_0x3c074d,_0x46eb('0xea'),_0x46eb('0xeb'));}}};Dialer['prototype'][_0x46eb('0x32')]=function(_0x4079d9){var _0x454609=this[_0x46eb('0x25')][_0x4079d9[_0x46eb('0xdd')]];var _0x1573e8=this;var _0x1bc8f4;if(_0x454609&&_0x454609['type']===_0x46eb('0x7c')){delete this[_0x46eb('0x25')][_0x4079d9[_0x46eb('0xdd')]];this['updateOriginated'](this[_0x46eb('0x1e')][_0x454609[_0x46eb('0xb8')]]);this[_0x46eb('0x1e')][_0x454609[_0x46eb('0xb8')]][_0x46eb('0xec')]+=0x1;_0x1bc8f4=new Hangup(_0x454609,_0x4079d9);this['createHistory'](_0x1bc8f4)['catch'](loggerCatch(_0x46eb('0xed')));this[_0x46eb('0xc7')](_0x1bc8f4)['catch'](loggerCatch(_0x46eb('0xee')));}if(_0x454609&&_0x454609[_0x46eb('0x4c')]!==_0x46eb('0x7c')&&isNotNull(this[_0x46eb('0x1d')][_0x454609['queue']]['dialQueueProject'])){delete this[_0x46eb('0x25')][_0x4079d9['uniqueid']];this[_0x46eb('0xb6')](this[_0x46eb('0x1d')][_0x454609[_0x46eb('0xb8')]]);this['voiceQueues'][_0x454609['queue']]['outboundAnswerCallsDay']+=0x1;this[_0x46eb('0x1d')][_0x454609['queue']][_0x46eb('0x5b')]+=0x1;_0x1bc8f4=new Hangup(_0x454609,_0x4079d9);_0x1bc8f4[_0x46eb('0xa9')]=0x10;_0x1bc8f4[_0x46eb('0xaa')]='AnswerAGI';_0x1bc8f4['membername']=_0x46eb('0xef');this[_0x46eb('0xc8')](_0x1bc8f4)[_0x46eb('0xb4')](loggerCatch(_0x46eb('0xed')));this[_0x46eb('0xc7')](_0x1bc8f4)['catch'](loggerCatch(_0x46eb('0xee')));}if(_0x454609&&_0x454609['type']!==_0x46eb('0x7c')&&!isNotNull(this['voiceQueues'][_0x454609[_0x46eb('0xb8')]][_0x46eb('0xf0')])){delete this['uniqueId'][_0x4079d9[_0x46eb('0xdd')]];this[_0x46eb('0xb6')](this[_0x46eb('0x1d')][_0x454609[_0x46eb('0xb8')]]);this[_0x46eb('0x1d')][_0x454609['queue']][_0x46eb('0x66')]+=0x1;_0x1bc8f4=new Hangup(_0x454609,_0x4079d9);_0x1bc8f4[_0x46eb('0xa9')]=0xc;_0x1bc8f4['statedesc']=_0x4079d9[_0x46eb('0xf1')];_0x1bc8f4['membername']=_0x46eb('0xf2');this[_0x46eb('0xc8')](_0x1bc8f4)[_0x46eb('0xb4')](loggerCatch(_0x46eb('0xed')));this[_0x46eb('0xc7')](_0x1bc8f4)[_0x46eb('0xb4')](loggerCatch(_0x46eb('0xee')));}};Dialer[_0x46eb('0x1a')][_0x46eb('0x30')]=function(_0x38f57e){var _0x4155fe=this['uniqueId'][_0x38f57e[_0x46eb('0xdd')]];var _0x4996ee=this;if(this['voiceQueues'][_0x38f57e[_0x46eb('0xb8')]]){if(_0x4155fe&&_0x4155fe[_0x46eb('0x4c')]!=='ivr'){delete this['uniqueId'][_0x38f57e[_0x46eb('0xdd')]];this['voiceQueues'][_0x38f57e[_0x46eb('0xb8')]][_0x46eb('0x5c')]+=0x1;var _0x1da8ef=new AgentComplete(_0x4155fe,_0x38f57e);if(_0x38f57e['reason']===_0x46eb('0xf3')){_0x1da8ef['agiafterat']=this[_0x46eb('0x1d')][_0x38f57e['queue']][_0x46eb('0xf4')]&&this[_0x46eb('0x1d')][_0x38f57e[_0x46eb('0xb8')]][_0x46eb('0xf5')]?moment()[_0x46eb('0x7d')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}this['createHistory'](_0x1da8ef)[_0x46eb('0xb4')](loggerCatch(_0x46eb('0xf6')));this['moveContactManagedDialer'](_0x1da8ef)[_0x46eb('0xb4')](loggerCatch(_0x46eb('0xf7')));}}};Dialer[_0x46eb('0x1a')]['syncAgentConnect']=function(_0x588319){if(this['voiceQueues'][_0x588319[_0x46eb('0xb8')]]){if(this[_0x46eb('0x25')][_0x588319['uniqueid']]&&this[_0x46eb('0x25')][_0x588319[_0x46eb('0xdd')]][_0x46eb('0x4c')]!==_0x46eb('0x7c')){this[_0x46eb('0xb6')](this[_0x46eb('0x1d')][_0x588319[_0x46eb('0xb8')]]);this[_0x46eb('0x25')][_0x588319[_0x46eb('0xdd')]][_0x46eb('0xf8')]=moment()['format'](_0x46eb('0xf9'));}}};Dialer[_0x46eb('0x1a')][_0x46eb('0xfa')]=function(_0x1d0a8a){this[_0x46eb('0xc8')](_0x1d0a8a)[_0x46eb('0xb4')](loggerCatch(_0x46eb('0xf6')));this[_0x46eb('0xc7')](_0x1d0a8a)[_0x46eb('0xb4')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));};Dialer[_0x46eb('0x1a')][_0x46eb('0x2c')]=function(_0x5e4ac6){var _0x150088=this['uniqueId'][_0x5e4ac6[_0x46eb('0xdd')]];var _0x37b336=this;if(this[_0x46eb('0x1d')][_0x5e4ac6['queue']]){if(_0x150088&&_0x150088[_0x46eb('0x4c')]!==_0x46eb('0x7c')){delete this[_0x46eb('0x25')][_0x5e4ac6['uniqueid']];this[_0x46eb('0xb6')](this[_0x46eb('0x1d')][_0x5e4ac6[_0x46eb('0xb8')]]);_0x150088['droptime']=moment()[_0x46eb('0x7d')](_0x46eb('0xf9'));var _0x6004f0=new QueueCallerAbandon(_0x150088,_0x5e4ac6);if(getSeconds(_0x150088['droptime'],_0x150088[_0x46eb('0xfb')])>=_0x150088['dialQueueTimeout']){this[_0x46eb('0x1d')][_0x5e4ac6['queue']]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0x46eb('0x1d')][_0x5e4ac6[_0x46eb('0xb8')]][_0x46eb('0x61')]+=0x1;this[_0x46eb('0x1d')][_0x5e4ac6[_0x46eb('0xb8')]][_0x46eb('0x6c')]+=0x1;_0x6004f0[_0x46eb('0xa9')]=0xa;_0x6004f0[_0x46eb('0xaa')]='Drop';_0x6004f0[_0x46eb('0xfc')]=_0x46eb('0xfd');_0x6004f0['agiafterat']=this[_0x46eb('0x1d')][_0x5e4ac6['queue']][_0x46eb('0xf4')]?moment()[_0x46eb('0x7d')](_0x46eb('0xf9')):undefined;this['queueCallerAbandonCreateState'](_0x6004f0);}else{this['voiceQueues'][_0x5e4ac6[_0x46eb('0xb8')]][_0x46eb('0x69')]+=0x1;this['voiceQueues'][_0x5e4ac6['queue']][_0x46eb('0xfe')]+=0x1;_0x6004f0[_0x46eb('0xa9')]=0xb;_0x6004f0['statedesc']=_0x46eb('0xff');_0x6004f0[_0x46eb('0xfc')]=_0x46eb('0x100');this[_0x46eb('0xfa')](_0x6004f0);}}}};Dialer['prototype'][_0x46eb('0x34')]=function(_0x173bfc){if(this[_0x46eb('0x23')][_0x173bfc[_0x46eb('0xdd')]]){this[_0x46eb('0x23')][_0x173bfc['uniqueid']]['channel']=_0x173bfc[_0x46eb('0x101')];}if(this['uniqueId'][_0x173bfc[_0x46eb('0xdd')]]){this[_0x46eb('0x25')][_0x173bfc[_0x46eb('0xdd')]][_0x46eb('0x101')]=_0x173bfc[_0x46eb('0x101')];}};Dialer[_0x46eb('0x1a')][_0x46eb('0x37')]=function(_0xcc8c01){if(strategy[this[_0x46eb('0x1d')][this[_0x46eb('0x23')][_0xcc8c01[_0x46eb('0x102')]][_0x46eb('0xb8')]][_0x46eb('0x103')]]===_0x46eb('0x19')){if(this['actions'][_0xcc8c01[_0x46eb('0x102')]]&&_[_0x46eb('0xb1')](this['actions'][_0xcc8c01[_0x46eb('0x102')]][_0x46eb('0x104')])&&_0xcc8c01[_0x46eb('0xb3')]==='1'&&_0xcc8c01[_0x46eb('0x105')]==='0'){if(this['agents'][_0xcc8c01[_0x46eb('0x106')]]){if(!this[_0x46eb('0x1f')][_0xcc8c01[_0x46eb('0x106')]][_0x46eb('0x104')]){this[_0x46eb('0x1f')][_0xcc8c01[_0x46eb('0x106')]][_0x46eb('0x104')]=!![];this[_0x46eb('0x23')][_0xcc8c01[_0x46eb('0x102')]]['locked']=!![];this['actions'][_0xcc8c01['actionid']]['stateinterface']=_0xcc8c01[_0x46eb('0x106')];}}}}else if((strategy[this[_0x46eb('0x1d')][this[_0x46eb('0x23')][_0xcc8c01[_0x46eb('0x102')]]['queue']][_0x46eb('0x103')]]||'rrmemory')===_0x46eb('0x18')){if(this[_0x46eb('0x23')][_0xcc8c01[_0x46eb('0x102')]]){if(this[_0x46eb('0x1f')][_0xcc8c01['stateinterface']]){this[_0x46eb('0x23')][_0xcc8c01['actionid']][_0x46eb('0x106')]=_0xcc8c01[_0x46eb('0x106')];if(_['isNil'](this[_0x46eb('0x107')][this[_0x46eb('0x23')][_0xcc8c01[_0x46eb('0x102')]][_0x46eb('0xb8')]])){this['queueBooked'][this['actions'][_0xcc8c01[_0x46eb('0x102')]]['queue']]=[];}this[_0x46eb('0x107')][this[_0x46eb('0x23')][_0xcc8c01[_0x46eb('0x102')]][_0x46eb('0xb8')]]['push'](_[_0x46eb('0x93')](_[_0x46eb('0xcf')](this[_0x46eb('0x23')][_0xcc8c01[_0x46eb('0x102')]],[_0x46eb('0x108'),_0x46eb('0x106')]),{'status':_0xcc8c01['status'],'paused':_0xcc8c01['paused']}));}}}};function unlockQueueStatus(_0x2bc61a,_0x3f6ad9){setTimeout(function(){if(_[_0x46eb('0x8b')](_0x2bc61a[_0x46eb('0x109')])){loggerBooked['error'](_0x46eb('0x10a'),_0x3f6ad9);}_0x2bc61a[_0x46eb('0x109')]=!![];loggerBooked[_0x46eb('0x82')]('[booked][unlockQueueStatus]',_0x3f6ad9,JSON[_0x46eb('0x48')](_[_0x46eb('0xcf')](_0x2bc61a,['name','queueStatusComplete'])));},0x1f3);}Dialer[_0x46eb('0x1a')][_0x46eb('0x39')]=function(_0x5e962d){var _0x3cd438=this;var _0x3ac943=_0x3cd438[_0x46eb('0x1d')][_0x3cd438['actions'][_0x5e962d['actionid']][_0x46eb('0xb8')]];if(strategy[this[_0x46eb('0x1d')][this[_0x46eb('0x23')][_0x5e962d[_0x46eb('0x102')]][_0x46eb('0xb8')]][_0x46eb('0x103')]]===_0x46eb('0x19')){if(this[_0x46eb('0x23')][_0x5e962d[_0x46eb('0x102')]]&&this[_0x46eb('0x23')][_0x5e962d[_0x46eb('0x102')]][_0x46eb('0x106')]){this[_0x46eb('0x1c')]['run'](this['actions'][_0x5e962d[_0x46eb('0x102')]][_0x46eb('0x108')],this[_0x46eb('0x23')][_0x5e962d[_0x46eb('0x102')]][_0x46eb('0x106')])['catch'](function(_0x50c7ec){logger[_0x46eb('0x9c')](_0x46eb('0x10b'),util[_0x46eb('0x9d')](_0x50c7ec,{'showHidden':![],'depth':null}));})[_0x46eb('0x10c')](function(){_0x3cd438['updateOriginated'](_0x3cd438['voiceQueues'][_0x3cd438[_0x46eb('0x23')][_0x5e962d[_0x46eb('0x102')]][_0x46eb('0xb8')]]);_0x3cd438[_0x46eb('0x1f')][_0x3cd438[_0x46eb('0x23')][_0x5e962d[_0x46eb('0x102')]][_0x46eb('0x106')]][_0x46eb('0x104')]=![];delete _0x3cd438['actions'][_0x5e962d[_0x46eb('0x102')]];unlockQueueStatus(_0x3ac943);});}else{this['updateOriginated'](this[_0x46eb('0x1d')][this[_0x46eb('0x23')][_0x5e962d[_0x46eb('0x102')]][_0x46eb('0xb8')]]);this[_0x46eb('0xc0')]({'active':![],'ContactId':this[_0x46eb('0x23')][_0x5e962d[_0x46eb('0x102')]][_0x46eb('0x10d')],'ListId':this[_0x46eb('0x23')][_0x5e962d[_0x46eb('0x102')]]['ListId'],'VoiceQueueId':this[_0x46eb('0x23')][_0x5e962d[_0x46eb('0x102')]][_0x46eb('0x10e')]||undefined,'CampaignId':this[_0x46eb('0x23')][_0x5e962d[_0x46eb('0x102')]][_0x46eb('0xd2')]||undefined})['catch'](loggerCatch(_0x46eb('0x10f')));delete this[_0x46eb('0x23')][_0x5e962d[_0x46eb('0x102')]];unlockQueueStatus(_0x3ac943);}}else if((strategy[this[_0x46eb('0x1d')][this['actions'][_0x5e962d[_0x46eb('0x102')]]['queue']][_0x46eb('0x103')]]||_0x46eb('0x18'))===_0x46eb('0x18')){var _0x4d8589;if(this['actions'][_0x5e962d[_0x46eb('0x102')]]&&!_[_0x46eb('0x46')](this['queueBooked'][this['actions'][_0x5e962d[_0x46eb('0x102')]]['queue']])){if(this['queueBookedRR'][_0x3cd438[_0x46eb('0x23')][_0x5e962d[_0x46eb('0x102')]]['queue']]){this['queueBookedRR'][_0x3cd438[_0x46eb('0x23')][_0x5e962d[_0x46eb('0x102')]][_0x46eb('0xb8')]]=this[_0x46eb('0x28')][this[_0x46eb('0x23')][_0x5e962d[_0x46eb('0x102')]][_0x46eb('0xb8')]]?this['queueBookedRR'][this['actions'][_0x5e962d['actionid']][_0x46eb('0xb8')]]:this['queueBooked'][this['actions'][_0x5e962d['actionid']][_0x46eb('0xb8')]]?this['queueBooked'][this['actions'][_0x5e962d[_0x46eb('0x102')]][_0x46eb('0xb8')]][_0x46eb('0x110')]||0x0:0x0;}this['queueBooked'][this[_0x46eb('0x23')][_0x5e962d[_0x46eb('0x102')]][_0x46eb('0xb8')]][_0x46eb('0x110')]=this[_0x46eb('0x28')][this[_0x46eb('0x23')][_0x5e962d[_0x46eb('0x102')]][_0x46eb('0xb8')]];for(var _0xb38bc6=0x0;_0xb38bc6=0x0?!![]:![];})['catch'](myreject(_0x5a114d)));}}else{_0x58a303[_0x46eb('0x126')](ami['Action']({'action':_0x46eb('0x127'),'command':util[_0x46eb('0x7d')]('iftime\x20%s,%s',_0x5ef058,!_[_0x46eb('0x8b')](config[_0x46eb('0x12a')][_0x1547b7])?_0x1547b7:'')})[_0x46eb('0xba')](function(_0x42817b){return _0x42817b[_0x46eb('0x12b')]['indexOf'](_0x46eb('0x12c'))>=0x0?!![]:![];})[_0x46eb('0xb4')](myreject(_0x5a114d)));}BPromise[_0x46eb('0x12d')](_0x58a303)[_0x46eb('0xba')](function(_0x28974f){var _0x59d188=_['some'](_0x28974f);if(_0x59d188){return _0xd47a8e(_0x59d188);}else{_0xd2353e[_0x46eb('0x3c')]=_0x35f9fe?_0x46eb('0x12e'):_0x46eb('0x12f');return _0x5a114d(msgResponse(_0x46eb('0x130'),'Failure','Global:\x20'+_0x35f9fe+'\x20'+_0x11a371+_0x46eb('0x131')+util[_0x46eb('0x9d')](_0x5ef058,{'showHidden':![],'depth':null})+_0x46eb('0x132')+_0x1547b7));}})[_0x46eb('0xb4')](function(_0x128a0b){return _0x5a114d(msgResponse(_0x46eb('0x120'),_0x46eb('0x122'),JSON[_0x46eb('0x48')](_0x128a0b)));});});};Dialer[_0x46eb('0x1a')][_0x46eb('0x133')]=function(_0x55fd52){var _0x385b7d=this;return function(){switch(_0x55fd52['dialMethod']){case'progressive':freeVariablesPredictive(_0x55fd52);_0x385b7d['handlePower'](_0x55fd52,0x1);break;case _0x46eb('0x134'):freeVariablesPredictive(_0x55fd52);_0x385b7d[_0x46eb('0x135')](_0x55fd52,_0x55fd52[_0x46eb('0x136')]);break;case'predictive':_0x385b7d[_0x46eb('0x9')](_0x55fd52);break;case _0x46eb('0x8'):freeVariablesPredictive(_0x55fd52);_0x385b7d[_0x46eb('0x135')](_0x55fd52,0x1);break;default:freeVariablesPredictive(_0x55fd52);logger['error'](_0x46eb('0x137'),_0x55fd52[_0x46eb('0x3e')],'method\x20not\x20recognized');}};};Dialer[_0x46eb('0x1a')][_0x46eb('0x138')]=function(_0x58f142){var _0x5d882e=this;return function(){_0x5d882e['handleIvr'](_0x58f142);};};Dialer['prototype'][_0x46eb('0xb')]=function(_0x46c0fe){var _0x521c30=this;if(isNotPreview(_0x46c0fe[_0x46eb('0x56')])){if(isVoiceQueueOutbound(_0x46c0fe[_0x46eb('0x4c')])&&isActive(_0x46c0fe[_0x46eb('0x55')])){_0x46c0fe[_0x46eb('0xa4')]=!![];BPromise[_0x46eb('0xb9')]()[_0x46eb('0xba')](checkIsLoggedIn(_0x46c0fe,_0x46c0fe[_0x46eb('0x4f')]))[_0x46eb('0xba')](checkIsActive(_0x46c0fe,_0x46c0fe[_0x46eb('0x55')]))[_0x46eb('0xba')](checkInterval(_0x46c0fe))[_0x46eb('0xba')](_0x521c30[_0x46eb('0x11c')](_0x46c0fe))[_0x46eb('0xba')](_0x521c30['checkIfTime'](_0x46c0fe[_0x46eb('0x139')],_0x46c0fe[_0x46eb('0x13a')],_0x46c0fe['name'],_0x46c0fe))['then'](_0x521c30[_0x46eb('0x121')](_0x46c0fe[_0x46eb('0x42')],_0x46c0fe[_0x46eb('0x13a')],_0x46c0fe[_0x46eb('0x3e')],_0x46c0fe))[_0x46eb('0xba')](_0x521c30[_0x46eb('0x133')](_0x46c0fe))[_0x46eb('0xb4')](loggerCatchQueueSummary(_0x46eb('0x13b'),_0x46c0fe));}else{notSendMessagesQueue(_0x46c0fe);}}else{freeVariablesPredictive(_0x46c0fe);}};Dialer[_0x46eb('0x1a')]['syncCampaigns']=function(){var _0x4945ef=this;var _0x1ae50b;for(var _0x1b9b8a in this[_0x46eb('0x1e')]){if(this[_0x46eb('0x1e')][_0x46eb('0xa0')](_0x1b9b8a)){_0x1ae50b=this['campaigns'][_0x1b9b8a];if(isCampaignIvr(_0x1ae50b[_0x46eb('0x4c')])&&isActive(_0x1ae50b[_0x46eb('0x78')])){_0x1ae50b[_0x46eb('0xa4')]=!![];BPromise[_0x46eb('0xb9')]()['then'](checkIsActive(_0x1ae50b,_0x1ae50b[_0x46eb('0x78')]))[_0x46eb('0xba')](checkInterval(_0x1ae50b))[_0x46eb('0xba')](_0x4945ef[_0x46eb('0x11c')](_0x1ae50b))[_0x46eb('0xba')](_0x4945ef['checkIfTime'](_0x1ae50b['dialGlobalInterval'],_0x1ae50b[_0x46eb('0x13a')],_0x1ae50b[_0x46eb('0x3e')],_0x1ae50b))[_0x46eb('0xba')](_0x4945ef[_0x46eb('0x121')](_0x1ae50b['Interval'],_0x1ae50b[_0x46eb('0x13a')],_0x1ae50b[_0x46eb('0x3e')],_0x1ae50b))['then'](_0x4945ef['launchHandleIvr'](_0x1ae50b))[_0x46eb('0xb4')](loggerCatchQueueSummary(_0x46eb('0x13c'),_0x1ae50b));}else{notSendMessagesCampaign(_0x1ae50b);}}}};function getCallerIdRandom(_0x497a9e,_0x64aea6){var _0x51d41e,_0x3bf5f9,_0x4b1cc8;if(_0x64aea6<=0x0){_0x64aea6=0x1;}_0x51d41e=new RegExp(_0x46eb('0x13d')+_0x64aea6+'}$');_0x3bf5f9=Math['pow'](0xa,_0x64aea6-0x1);_0x4b1cc8=Math[_0x46eb('0x13e')](0xa,_0x64aea6)-0x1;return util[_0x46eb('0x7d')]('%s',_['replace'](_0x497a9e,_0x51d41e,_[_0x46eb('0x13f')](_0x3bf5f9,_0x4b1cc8)));}function extractCalleridName(_0xd03e2a){var _0x2fd973=_0xd03e2a[_0x46eb('0x140')](/"(.*?)"/);return _0x2fd973?_0x2fd973[0x1]:_0xd03e2a;}function extractCalleridNumber(_0x4b65bb){var _0x1720bd=_0x4b65bb[_0x46eb('0x140')](/<(.*?)>/);return _0x1720bd?_0x1720bd[0x1]:_0x4b65bb;}Dialer[_0x46eb('0x1a')][_0x46eb('0x141')]=function(_0x419b75,_0xf1ac09){var _0xa8f5ff=this;var _0x2bcc63=uuid['v4']();this[_0x46eb('0x23')][_0x2bcc63]=new Action(_0x419b75,_0xf1ac09,_0x2bcc63);return new BPromise(function(_0x2257aa,_0x600f27){if(_['isUndefined'](_0x419b75)&&_0x46eb('0x142')!==typeof _0x419b75){return _0x600f27(msgResponse(_0x46eb('0x143'),_0x46eb('0x122'),'voiceQueue\x20is\x20undefine'));}if(_[_0x46eb('0x8b')](_0xf1ac09[_0x46eb('0x144')]['phone'])||_0xf1ac09['Contact']['phone']===null){return _0x600f27(msgResponse(_0x46eb('0x143'),_0x46eb('0x122'),'contact\x20is\x20undefine'));}var _0x5f1b6e={'XMD-CALLERID':_0xa8f5ff[_0x46eb('0x23')][_0x2bcc63][_0x46eb('0x145')](),'XMD-AGI':_0x419b75[_0x46eb('0xf0')]?util[_0x46eb('0x7d')](_0x46eb('0x146'),ipAgi,_0x419b75[_0x46eb('0xf0')]):'NONE','XMD-AGIAFTER':_0x419b75[_0x46eb('0xf4')]?util['format'](_0x46eb('0x146'),ipAgi,_0x419b75[_0x46eb('0xf4')]):_0x46eb('0x147'),'XMD-QUEUE':_0x419b75[_0x46eb('0x4c')]===_0x46eb('0x99')?util[_0x46eb('0x7d')]('\x22%s,%s%s,,,%s\x22',_0x419b75[_0x46eb('0x3e')],_0x419b75[_0x46eb('0x148')]||'',_0x419b75[_0x46eb('0xf5')]?'c':'',_0x419b75['dialQueueTimeout']||0x3):_0x46eb('0x147'),'XMD-CONTACTID':_0xf1ac09[_0x46eb('0x10d')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0xa8f5ff['actions'][_0x2bcc63][_0x46eb('0x145')](),'XMD-AMD':_0x419b75[_0x46eb('0xe1')]?_0x46eb('0x149'):_0x46eb('0x147'),'XMD-DESTINATION':_0x46eb('0xdb')};if(_0x419b75[_0x46eb('0xe1')]){_0x5f1b6e[_0x46eb('0x14a')]=_0x419b75[_0x46eb('0x14b')]||0x9c4;_0x5f1b6e[_0x46eb('0x14c')]=_0x419b75['dialAMDGreeting']||0x5dc;_0x5f1b6e['XMD-AMDAFTERGREETINGSILENCE']=_0x419b75[_0x46eb('0x14d')]||0x320;_0x5f1b6e[_0x46eb('0x14e')]=_0x419b75[_0x46eb('0x14f')]||0x1388;_0x5f1b6e[_0x46eb('0x150')]=_0x419b75['dialAMDMinWordLength']||0x64;_0x5f1b6e[_0x46eb('0x151')]=_0x419b75['dialAMDBetweenWordsSilence']||0x32;_0x5f1b6e[_0x46eb('0x152')]=_0x419b75['dialAMDMaximumNumberOfWords']||0x3;_0x5f1b6e[_0x46eb('0x153')]=_0x419b75[_0x46eb('0x154')]||0x100;_0x5f1b6e[_0x46eb('0x155')]=_0x419b75[_0x46eb('0x156')]||0x1388;}if(_0x419b75[_0x46eb('0x4c')]===_0x46eb('0x99')){_0x5f1b6e['XMD-VOICEQUEUEID']=_0xf1ac09[_0x46eb('0x10e')];}else{_0x5f1b6e[_0x46eb('0x157')]=_0xf1ac09[_0x46eb('0xd2')];}for(var _0x15c447 in _0xf1ac09['Contact']){if(_0xf1ac09['Contact']['hasOwnProperty'](_0x15c447)){if(isNotNull(_0xf1ac09[_0x46eb('0x144')][_0x15c447])&&_0x15c447!=='id'&&_0x15c447!==_0x46eb('0x158')&&_0x15c447!=='createdAt'&&_0x15c447!==_0x46eb('0x159')){_0x5f1b6e[util[_0x46eb('0x7d')](_0x46eb('0x15a'),_0x46eb('0x15b'),_['toUpper'](_0x15c447))]=_0xf1ac09[_0x46eb('0x144')][_0x15c447];}}}var _0x21d071=_0xa8f5ff[_0x46eb('0x11d')](_0x419b75['Trunk'])?getCallerId(_0x419b75[_0x46eb('0x77')][_0x46eb('0x79')],_0x419b75['dialOriginateCallerIdName'],_0x419b75[_0x46eb('0x15c')]>0x0?getCallerIdRandom(_0x419b75[_0x46eb('0x58')],_0x419b75['dialRandomLastDigitCallerIdNumber']):_0x419b75[_0x46eb('0x58')]):getCallerId(_['isNil'](_0x419b75['TrunkBackup'])?_0x419b75['Trunk']['callerid']:_0x419b75['TrunkBackup'][_0x46eb('0x79')],_0x419b75['dialOriginateCallerIdName'],_0x419b75[_0x46eb('0x15c')]>0x0?getCallerIdRandom(_0x419b75[_0x46eb('0x58')],_0x419b75['dialRandomLastDigitCallerIdNumber']):_0x419b75[_0x46eb('0x58')]);if(_0x21d071){_0x5f1b6e[_0x46eb('0x15d')]=_0xa8f5ff['actions'][_0x2bcc63][_0x46eb('0x15e')]=extractCalleridName(_0x21d071);_0x5f1b6e[_0x46eb('0x15f')]=_0xa8f5ff[_0x46eb('0x23')][_0x2bcc63][_0x46eb('0x160')]=extractCalleridNumber(_0x21d071);}return ami[_0x46eb('0xb2')]({'actionid':_0x2bcc63,'action':_0x46eb('0x143'),'channel':_0xa8f5ff[_0x46eb('0x11d')](_0x419b75[_0x46eb('0x77')])?util[_0x46eb('0x7d')](_0x46eb('0x161'),_0x419b75['Trunk']['name'],isNotNull(_0x419b75[_0x46eb('0x5a')])?_0x419b75[_0x46eb('0x5a')]['trim']()||'':'',_0x419b75['dialCutDigit']>0x0?_0xf1ac09['Contact']['phone'][_0x46eb('0x162')](_0x419b75[_0x46eb('0x163')]):_0xf1ac09[_0x46eb('0x144')][_0x46eb('0x164')]):util[_0x46eb('0x7d')](_0x46eb('0x161'),_[_0x46eb('0xb1')](_0x419b75[_0x46eb('0x165')])?_0x419b75['Trunk'][_0x46eb('0x3e')]:_0x419b75['TrunkBackup'][_0x46eb('0x3e')],isNotNull(_0x419b75[_0x46eb('0x5a')])?_0x419b75['dialPrefix'][_0x46eb('0x166')]()||'':'',_0x419b75[_0x46eb('0x163')]>0x0?_0xf1ac09[_0x46eb('0x144')]['phone'][_0x46eb('0x162')](_0x419b75[_0x46eb('0x163')]):_0xf1ac09[_0x46eb('0x144')][_0x46eb('0x164')]),'callerid':_0x21d071,'Exten':'xcally-motion-dialer','Context':'from-sip','Priority':'1','variable':_0x5f1b6e,'timeout':(_0x419b75[_0x46eb('0x59')]||0x1e)*0x3e8,'async':!![],'channelid':_0x2bcc63})[_0x46eb('0xba')](function(_0x5c581f){return _0x2257aa(_0x5c581f);})[_0x46eb('0xb4')](function(_0x440228){_0x419b75[_0x46eb('0x64')]+=0x1;var _0x3bd821=new History(_0xa8f5ff[_0x46eb('0x23')][_0x2bcc63]);logger['error'](util[_0x46eb('0x7d')]('[originateError]:\x20%s',JSON[_0x46eb('0x48')](_0x440228)));_0x3bd821['state']=0xe;_0x3bd821[_0x46eb('0xaa')]=_0x46eb('0x167');_0x3bd821[_0x46eb('0xac')]=moment()[_0x46eb('0x7d')](_0x46eb('0xf9'));_0x3bd821[_0x46eb('0xab')]=_0x3bd821[_0x46eb('0xac')];_0xa8f5ff[_0x46eb('0xc8')](_0x3bd821)[_0x46eb('0xb4')](loggerCatch(_0x46eb('0x168')));_0xa8f5ff[_0x46eb('0xc7')](_0x3bd821)[_0x46eb('0xb4')](loggerCatch('[originate][error]'))[_0x46eb('0x10c')](function(){delete _0xa8f5ff[_0x46eb('0x23')][_0x2bcc63];return _0x600f27(msgResponse(_0x46eb('0x143'),_0x46eb('0x169'),_0x46eb('0x16a')));});});});};Dialer[_0x46eb('0x1a')][_0x46eb('0x2e')]=function(_0x835a41){var _0x47816b=this[_0x46eb('0x23')][_0x835a41[_0x46eb('0x102')]];var _0x14e976=this;if(_0x47816b){delete this[_0x46eb('0x23')][_0x835a41[_0x46eb('0x102')]];_0x47816b['responsetime']=moment()[_0x46eb('0x7d')]('YYYY-MM-DD\x20HH:mm:ss');var _0x3bb565=_0x47816b[_0x46eb('0x4c')]===_0x46eb('0x7c')?this[_0x46eb('0x1e')][_0x47816b[_0x46eb('0xb8')]]:this[_0x46eb('0x1d')][_0x47816b['getQueue']()];if(!this[_0x46eb('0xd5')](_0x835a41[_0x46eb('0x16b')])){this[_0x46eb('0xb6')](_0x3bb565);return this[_0x46eb('0x16c')](_0x47816b,_0x3bb565,_0x835a41)[_0x46eb('0xba')](function(_0x217c3b){})[_0x46eb('0xb4')](loggerCatch('[callProgressDetecting]\x20'));}else{this['uniqueId'][_0x835a41[_0x46eb('0xdd')]]=_0x47816b;}}};Dialer[_0x46eb('0x1a')]['checkRetriveMax']=function(_0x388c6a,_0x32929e,_0x3f0d31){var _0x531e06=new History(_0x32929e);if(_0x531e06[_0x46eb('0x16d')]+_0x531e06[_0x46eb('0x16e')]+_0x531e06[_0x46eb('0x16f')]>=_0x3f0d31[_0x46eb('0x170')]-0x1){return!![];}switch(_0x388c6a){case 0x3:if(_0x531e06[_0x46eb('0x16f')]>=_0x3f0d31[_0x46eb('0x171')]-0x1){return!![];}else{this[_0x46eb('0xc0')]({'active':![],'countnoanswerretry':_0x531e06[_0x46eb('0x16f')]+=0x1,'scheduledat':moment()[_0x46eb('0x172')](_0x3f0d31['dialNoAnswerRetryFrequency'],_0x46eb('0x173'))[_0x46eb('0x7d')](_0x46eb('0xf9')),'ContactId':_0x531e06['ContactId'],'ListId':_0x531e06[_0x46eb('0xd0')],'VoiceQueueId':_0x531e06[_0x46eb('0x10e')]||undefined,'CampaignId':_0x531e06['CampaignId']||undefined})[_0x46eb('0xb4')](loggerCatch(_0x46eb('0x174')));}break;case 0x5:if(_0x531e06[_0x46eb('0x16d')]>=_0x3f0d31[_0x46eb('0x175')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countbusyretry':_0x531e06['countbusyretry']+=0x1,'scheduledat':moment()[_0x46eb('0x172')](_0x3f0d31[_0x46eb('0x176')],'minutes')['format'](_0x46eb('0xf9')),'ContactId':_0x531e06['ContactId'],'ListId':_0x531e06[_0x46eb('0xd0')],'VoiceQueueId':_0x531e06[_0x46eb('0x10e')]||undefined,'CampaignId':_0x531e06[_0x46eb('0xd2')]||undefined})[_0x46eb('0xb4')](loggerCatch('[rescheduleContact]\x20[Busy]'));}break;case 0x8:if(_0x531e06[_0x46eb('0x16e')]>=_0x3f0d31['dialCongestionMaxRetry']-0x1){return!![];}else{this[_0x46eb('0xc0')]({'active':![],'countcongestionretry':_0x531e06[_0x46eb('0x16e')]+=0x1,'scheduledat':moment()[_0x46eb('0x172')](_0x3f0d31['dialCongestionRetryFrequency'],'minutes')['format'](_0x46eb('0xf9')),'ContactId':_0x531e06[_0x46eb('0x10d')],'ListId':_0x531e06[_0x46eb('0xd0')],'VoiceQueueId':_0x531e06[_0x46eb('0x10e')]||undefined,'CampaignId':_0x531e06[_0x46eb('0xd2')]||undefined})[_0x46eb('0xb4')](loggerCatch(_0x46eb('0x177')));}break;default:return!![];}};Dialer[_0x46eb('0x1a')]['callProgressDetecting']=function(_0x256678,_0x250492,_0x92e0a5){var _0x104beb=this;var _0x560283=new History(_0x256678);return new BPromise(function(_0x1c7108,_0x289f6a){if(_[_0x46eb('0x8b')](_0x250492)&&_0x46eb('0x142')!==typeof _0x250492){return _0x289f6a(msgResponse(_0x46eb('0x178'),'Failure',_0x46eb('0x179')));}if(_['isUndefined'](_0x92e0a5)&&_0x46eb('0x142')!==typeof _0x92e0a5){return _0x289f6a(msgResponse(_0x46eb('0x178'),'Failure',_0x46eb('0x17a')));}switch(_0x92e0a5[_0x46eb('0x17b')]){case'0':_0x250492[_0x46eb('0x63')]+=0x1;_0x560283[_0x46eb('0xa9')]=0x0;_0x560283[_0x46eb('0xaa')]='NoSuchNumber';_0x104beb[_0x46eb('0xc8')](_0x560283)[_0x46eb('0xb4')](loggerCatch(_0x46eb('0x17c')));if(_0x104beb[_0x46eb('0x17d')](0x0,_0x256678,_0x250492)){if(_0x560283[_0x46eb('0x16d')]+_0x560283['countcongestionretry']+_0x560283[_0x46eb('0x16f')]>=_0x250492['dialGlobalMaxRetry']){_0x104beb['stateGlobal'](_0x560283,_0x1c7108,_0x289f6a,'reason\x200\x20no\x20such\x20number....');}else{_0x104beb[_0x46eb('0x17e')](_0x560283,_0x1c7108,_0x289f6a,_0x46eb('0x17f'));}}break;case'3':_0x250492[_0x46eb('0x62')]+=0x1;_0x560283[_0x46eb('0xa9')]=0x3;_0x560283[_0x46eb('0xaa')]=_0x46eb('0x180');_0x560283[_0x46eb('0x16f')]+=0x1;_0x560283[_0x46eb('0x181')]+=0x1;_0x104beb[_0x46eb('0xc8')](_0x560283)[_0x46eb('0xb4')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x104beb['checkRetriveMax'](0x3,_0x256678,_0x250492)){if(_0x560283[_0x46eb('0x16f')]>=_0x250492[_0x46eb('0x171')]){_0x104beb['createStateFinal'](_0x560283,_0x1c7108,_0x289f6a,_0x46eb('0x182'));}else{_0x104beb[_0x46eb('0x183')](_0x560283,_0x1c7108,_0x289f6a,_0x46eb('0x182'));}}break;case'5':_0x250492[_0x46eb('0x5e')]+=0x1;_0x560283[_0x46eb('0xa9')]=0x5;_0x560283[_0x46eb('0xaa')]=_0x46eb('0x184');_0x560283[_0x46eb('0x16d')]+=0x1;_0x560283['countglobal']+=0x1;_0x104beb[_0x46eb('0xc8')](_0x560283)[_0x46eb('0xb4')](loggerCatch(_0x46eb('0x185')));if(_0x104beb['checkRetriveMax'](0x5,_0x256678,_0x250492)){if(_0x560283[_0x46eb('0x16d')]>=_0x250492[_0x46eb('0x175')]){_0x104beb['createStateFinal'](_0x560283,_0x1c7108,_0x289f6a,_0x46eb('0x186'));}else{_0x104beb[_0x46eb('0x183')](_0x560283,_0x1c7108,_0x289f6a,'reason\x205\x20busy');}}break;case'8':_0x250492[_0x46eb('0x5f')]+=0x1;_0x560283[_0x46eb('0xa9')]=0x8;_0x560283['statedesc']=_0x46eb('0x187');_0x560283[_0x46eb('0x16e')]+=0x1;_0x560283['countglobal']+=0x1;_0x104beb[_0x46eb('0xc8')](_0x560283)[_0x46eb('0xb4')](loggerCatch(_0x46eb('0x188')));if(_0x104beb[_0x46eb('0x17d')](0x8,_0x256678,_0x250492)){if(_0x560283[_0x46eb('0x16e')]>=_0x250492['dialCongestionMaxRetry']){_0x104beb[_0x46eb('0x17e')](_0x560283,_0x1c7108,_0x289f6a,'reason\x208\x20congestion');}else{_0x104beb[_0x46eb('0x183')](_0x560283,_0x1c7108,_0x289f6a,_0x46eb('0x189'));}}break;default:_0x250492['outboundUnknownCallsDay']+=0x1;_0x560283[_0x46eb('0xa9')]=0xc;_0x560283['statedesc']=_0x92e0a5[_0x46eb('0x17b')];_0x104beb[_0x46eb('0xc8')](_0x560283)[_0x46eb('0xb4')](loggerCatch(_0x46eb('0x18a')));if(_0x104beb[_0x46eb('0x17d')](_0x92e0a5['reason'],_0x256678,_0x250492)){if(_0x560283['countbusyretry']+_0x560283[_0x46eb('0x16e')]+_0x560283[_0x46eb('0x16f')]>=_0x250492[_0x46eb('0x170')]){_0x104beb['stateGlobal'](_0x560283,_0x1c7108,_0x289f6a,_0x92e0a5[_0x46eb('0x17b')]);}else{_0x104beb[_0x46eb('0x17e')](_0x560283,_0x1c7108,_0x289f6a,_0x92e0a5['reason']);}}}});};Dialer['prototype'][_0x46eb('0x183')]=function(_0x29b571,_0x20fe15,_0x3fd93c,_0x5a84e9){var _0x5675e8=new Final(_0x29b571);_0x5675e8[_0x46eb('0xa9')]=0xf;_0x5675e8[_0x46eb('0xaa')]='Global';this[_0x46eb('0x17e')](_0x5675e8,_0x20fe15,_0x3fd93c,_0x5a84e9);};Dialer[_0x46eb('0x1a')][_0x46eb('0x17e')]=function(_0x17f5f9,_0x429419,_0x19d0bc,_0x4f3eca){this['moveContactManagedDialer'](_0x17f5f9)[_0x46eb('0xba')](function(_0x3056ee){return _0x429419(msgResponse('[callProgressDetecting]','Success',_0x4f3eca));})[_0x46eb('0xb4')](function(_0x503627){return _0x19d0bc(msgResponse(_0x46eb('0x18b'),'Failure',_0x46eb('0x18c')));});};Dialer['prototype'][_0x46eb('0x9')]=function(_0x488d6f){var _0x3e1f47=this;var _0x4263e6=_0x488d6f[_0x46eb('0x18d')]/0x64;var _0x3eca8e=_0x488d6f[_0x46eb('0x61')]/(_0x488d6f[_0x46eb('0x61')]+_0x488d6f[_0x46eb('0x5c')]);var _0x1b1789=Math[_0x46eb('0x18e')](_0x488d6f['predictiveIntervalAvailable']*(_0x488d6f[_0x46eb('0x18f')]/0x64));var _0x1060b2=Math[_0x46eb('0x18e')](_0x488d6f[_0x46eb('0x6f')]*(_0x488d6f[_0x46eb('0x190')]/0x64));var _0x55e806=_0x488d6f[_0x46eb('0x4e')]+_0x488d6f[_0x46eb('0x191')];var _0x36679e=Math[_0x46eb('0x192')](_0x488d6f['erlangCalls']*_0x488d6f[_0x46eb('0x73')]*_0x488d6f[_0x46eb('0x6d')]*_0x488d6f['predictiveIntervalMultiplicativeFactor']);if(_[_0x46eb('0x8b')](_0x488d6f['startProgressive'])){if(!_[_0x46eb('0x8b')](_0x488d6f['startPredictive'])){_0x488d6f[_0x46eb('0x75')]=undefined;loggerPredictive[_0x46eb('0x9c')](_0x46eb('0x193'),_0x46eb('0x194'));}if(!_['isUndefined'](_0x488d6f[_0x46eb('0x97')])){loggerPredictive['error'](_0x46eb('0x193'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x488d6f[_0x46eb('0x97')]);_0x488d6f[_0x46eb('0x97')]=undefined;}_0x488d6f[_0x46eb('0x76')]=moment()[_0x46eb('0x7d')](_0x46eb('0xf9'));loggerPredictive[_0x46eb('0x82')](_0x488d6f[_0x46eb('0x3e')],_0x46eb('0x195'),_0x488d6f[_0x46eb('0x76')]);this[_0x46eb('0x135')](_0x488d6f,0x1);}else if(ifInterval(_0x488d6f[_0x46eb('0x196')],_0x488d6f[_0x46eb('0x76')])){this[_0x46eb('0x135')](_0x488d6f,0x1);loggerPredictiveCalls[_0x46eb('0x82')](_0x46eb('0x197'),_0x488d6f[_0x46eb('0x76')],_0x488d6f[_0x46eb('0x3e')]);_0x488d6f[_0x46eb('0x90')]=0x0;_0x488d6f[_0x46eb('0x6c')]=0x0;}else if(_0x4263e6<_0x3eca8e&&_0x488d6f[_0x46eb('0x198')]==='dropRate'){freeVariablesPredictive(_0x488d6f);loggerPredictive[_0x46eb('0x82')](_0x46eb('0x199'),_0x46eb('0x19a'),_0x3eca8e,_0x46eb('0x76'),_0x488d6f[_0x46eb('0x3e')]);}else if(_0x36679e<_0x488d6f['predictiveIntervalErlangCallsDroppedCalls']&&_0x488d6f[_0x46eb('0x198')]==='dropRate'){freeVariablesPredictive(_0x488d6f);loggerPredictive['info']('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20',_0x36679e,_0x46eb('0x19b'),_0x488d6f[_0x46eb('0x6c')],_0x46eb('0x76'),_0x488d6f[_0x46eb('0x3e')]);}else if(!ifInterval(_0x488d6f[_0x46eb('0x196')],_0x488d6f[_0x46eb('0x76')])&&_['isUndefined'](_0x488d6f[_0x46eb('0x75')])&&!_['isUndefined'](_0x488d6f['startProgressive'])){_0x488d6f[_0x46eb('0x75')]=moment()[_0x46eb('0x7d')](_0x46eb('0xf9'));loggerPredictive[_0x46eb('0x82')](_0x488d6f['name'],_0x46eb('0x19c'),_0x488d6f[_0x46eb('0x75')]);this[_0x46eb('0xbf')](_0x488d6f['dialPredictiveInterval'])['then'](this[_0x46eb('0x19d')](_0x488d6f))[_0x46eb('0xba')](mergeDataErlangB(_0x488d6f))[_0x46eb('0xba')](this[_0x46eb('0x19e')](_0x488d6f))[_0x46eb('0xb4')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x488d6f));}else if(!ifInterval(_0x488d6f['dialPredictiveInterval'],_0x488d6f[_0x46eb('0x75')])){_0x488d6f[_0x46eb('0x6c')]=0x0;_0x488d6f[_0x46eb('0x75')]=moment()[_0x46eb('0x7d')](_0x46eb('0xf9'));loggerPredictive['info'](_0x488d6f['name'],_0x46eb('0x19f'),_0x488d6f[_0x46eb('0x75')]);clearInterval(_0x488d6f[_0x46eb('0x97')]);_0x488d6f['handlePredictive']=undefined;this[_0x46eb('0xbf')](_0x488d6f[_0x46eb('0x196')])[_0x46eb('0xba')](this[_0x46eb('0x19d')](_0x488d6f))['then'](mergeDataErlangB(_0x488d6f))[_0x46eb('0xba')](this['startMethodPredictive'](_0x488d6f))[_0x46eb('0xb4')](loggerCatchPredictive(_0x46eb('0x1a0'),_0x488d6f));}else if(_0x488d6f[_0x46eb('0x6f')]&&_0x55e806<_0x488d6f[_0x46eb('0x6f')]-_0x1060b2){freeVariablesPredictive(_0x488d6f);loggerPredictive[_0x46eb('0x82')](_0x488d6f[_0x46eb('0x3e')],_0x46eb('0x1a1'),_0x55e806,')\x20are\x20less\x20than\x20threshold\x20(',_0x488d6f['predictiveIntervalAvailable'],'-',_0x1060b2,'=',_0x488d6f[_0x46eb('0x6f')]-_0x1060b2,')');}else if(_0x488d6f[_0x46eb('0x6f')]&&_0x55e806>_0x488d6f[_0x46eb('0x6f')]+_0x1b1789){freeVariablesPredictive(_0x488d6f);loggerPredictive[_0x46eb('0x82')](_0x488d6f[_0x46eb('0x3e')],_0x46eb('0x1a1'),_0x55e806,_0x46eb('0x1a2'),_0x488d6f[_0x46eb('0x6f')],'+',_0x1b1789,'=',_0x488d6f['predictiveIntervalAvailable']+_0x1b1789,')');}};Dialer['prototype'][_0x46eb('0x19d')]=function(_0x313b86){var _0x4f4edc=this;return function(_0x5d72e9){return new BPromise(function(_0x486549,_0x356ee9){_[_0x46eb('0x93')](_0x313b86,_0x5d72e9[0x0]);if(checkGetDataPredictive(_0x5d72e9[0x0])){var _0x18a7c9=_0x313b86[_0x46eb('0x6f')]=_0x313b86[_0x46eb('0x191')]+_0x313b86[_0x46eb('0x4e')];var _0x12edbf=_0x313b86[_0x46eb('0x196')]*0x3c;var _0x31dd27=_0x5d72e9[0x0]['predictiveIntervalAvgTalktime']+_0x5d72e9[0x0]['predictiveIntervalAvgHoldtime'];var _0x3ff0ed=(_0x5d72e9[0x0][_0x46eb('0x67')]+_0x5d72e9[0x0][_0x46eb('0x6a')]+_0x5d72e9[0x0][_0x46eb('0x69')])/_0x5d72e9[0x0][_0x46eb('0x70')];_0x313b86[_0x46eb('0x6d')]=_0x3ff0ed>0x0?_0x3ff0ed:0x1;switch(_0x313b86[_0x46eb('0x198')]){case _0x46eb('0x1a3'):var _0x10bee8=_0x313b86[_0x46eb('0x18d')]/0x64;return _0x4f4edc[_0x46eb('0x1a4')](_0x18a7c9,_0x12edbf,_0x31dd27,_0x3ff0ed,_0x10bee8)[_0x46eb('0xba')](function(_0x2d4c44){return _0x486549(_0x2d4c44);});case _0x46eb('0x1a5'):var _0x81f8b5=_0x313b86[_0x46eb('0x18d')]/0x64;return _0x4f4edc[_0x46eb('0x1a6')](_0x18a7c9,_0x12edbf,_0x31dd27,_0x3ff0ed,_0x81f8b5)[_0x46eb('0xba')](function(_0x2ca8f0){return _0x486549(_0x2ca8f0);});default:return _0x356ee9(msgResponse(_0x46eb('0x1a7'),_0x46eb('0x122'),_0x46eb('0x1a8')));}}else{return _0x356ee9(msgResponse(_0x46eb('0x1a7'),'Failure',_0x46eb('0x1a9')));}});};};Dialer[_0x46eb('0x1a')]['getDataPredictiveOld']=function(_0x4b1281){var _0x10ed2c=this;return function(_0x1e82bd){return new BPromise(function(_0x417d46,_0x49f4b8){_[_0x46eb('0x93')](_0x4b1281,_0x1e82bd[0x0]);if(checkGetDataPredictive(_0x1e82bd[0x0])){loggerPredictive['info'](JSON[_0x46eb('0x48')](_0x1e82bd[0x0]));if(_0x4b1281['dialPredictiveOptimization']===_0x46eb('0x1a3')){return _0x10ed2c[_0x46eb('0xc5')](_0x4b1281['id'])[_0x46eb('0xba')](function(_0x50c149){var _0x4164aa=_0x4b1281[_0x46eb('0x4f')]-_0x50c149[0x0][_0x46eb('0x1aa')];var _0x2110ae=_0x4b1281['dialPredictiveInterval']*0x3c;var _0x3b0b80=_0x1e82bd[0x0]['predictiveIntervalAvgTalktime']+_0x1e82bd[0x0][_0x46eb('0x68')];var _0x28b0aa=(_0x1e82bd[0x0]['predictiveIntervalAnsweredCalls']+_0x1e82bd[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x1e82bd[0x0][_0x46eb('0x69')])/_0x1e82bd[0x0]['predictiveIntervalTotalCalls'];var _0x254950=_0x4b1281['dialPredictiveOptimizationPercentage']/0x64;_0x4b1281[_0x46eb('0x6e')]=_0x50c149[0x0][_0x46eb('0x1aa')]||0x0;_0x4b1281[_0x46eb('0x6d')]=_0x28b0aa>0x0?_0x28b0aa:0x1;return _0x10ed2c[_0x46eb('0x1a4')](_0x4164aa,_0x2110ae,_0x3b0b80,_0x28b0aa,_0x254950);})['then'](function(_0x43fbbf){return _0x417d46(_0x43fbbf);})[_0x46eb('0xb4')](function(_0xcbe6fb){return _0x49f4b8(msgResponse(_0x46eb('0x1ab'),'Failure',JSON[_0x46eb('0x48')](_0xcbe6fb)));});}if(_0x4b1281['dialPredictiveOptimization']===_0x46eb('0x1a5')){return _0x10ed2c['getVoiceQueueRtPauses'](_0x4b1281['id'])[_0x46eb('0xba')](function(_0x3fe282){var _0x586e47=_0x4b1281[_0x46eb('0x4f')]-_0x3fe282[0x0][_0x46eb('0x1aa')];var _0x1b9914=_0x4b1281[_0x46eb('0x196')]*0x3c;var _0x5ad7df=_0x1e82bd[0x0]['predictiveIntervalAvgTalktime']+_0x1e82bd[0x0][_0x46eb('0x68')];var _0x14b15b=(_0x1e82bd[0x0]['predictiveIntervalAnsweredCalls']+_0x1e82bd[0x0][_0x46eb('0x6a')]+_0x1e82bd[0x0][_0x46eb('0x69')])/_0x1e82bd[0x0][_0x46eb('0x70')];var _0xd36559=_0x4b1281[_0x46eb('0x18d')]/0x64;_0x4b1281[_0x46eb('0x6e')]=_0x3fe282[0x0][_0x46eb('0x1aa')]||0x0;_0x4b1281[_0x46eb('0x6d')]=_0x14b15b>0x0?_0x14b15b:0x1;return _0x10ed2c['busyFactor'](_0x586e47,_0x1b9914,_0x5ad7df,_0x14b15b,_0xd36559);})['then'](function(_0x312c94){return _0x417d46(_0x312c94);})[_0x46eb('0xb4')](function(_0x186de3){return _0x49f4b8(msgResponse(_0x46eb('0x1ab'),'Failure',JSON[_0x46eb('0x48')](_0x186de3)));});}}else{return _0x49f4b8(msgResponse('[getDataPredictive]','Failure',_0x46eb('0x1a9')));}});};};Dialer[_0x46eb('0x1a')]['startMethodPredictive']=function(_0x8a52c6){var _0x25d88e=this;return function(){var _0x57153c=0x0;var _0x5cd4fd=Math[_0x46eb('0x192')](_0x8a52c6[_0x46eb('0x72')]*0x3e8);if(_0x5cd4fd>0x0){_0x5cd4fd=_0x5cd4fd<0x64?0x64:_0x5cd4fd;loggerPredictive[_0x46eb('0x82')](_0x8a52c6[_0x46eb('0x3e')],_0x46eb('0x1ac'),_0x5cd4fd,_0x46eb('0x49'));_0x8a52c6[_0x46eb('0x97')]=setInterval(function(){_0x25d88e[_0x46eb('0x97')](_0x8a52c6);loggerPredictiveCalls[_0x46eb('0x82')]('[handlePredictive]',_0x57153c+=0x1);},_0x5cd4fd);}else{loggerPredictive[_0x46eb('0x82')](_0x8a52c6['name'],_0x46eb('0x1ad'));}};};Dialer[_0x46eb('0x1a')][_0x46eb('0x1ae')]=function(_0x522a0c,_0x130382){var _0x1b6bab=this;return function(_0x27fd7a){if(_[_0x46eb('0x46')](_0x27fd7a)){if(_[_0x46eb('0xb1')](_0x130382[_0x46eb('0xd1')])||!_0x130382[_0x46eb('0x1af')]){if(_0x522a0c[_0x46eb('0x56')]==='booked'){_0x522a0c[_0x46eb('0x109')]=_['isUndefined'](_0x522a0c[_0x46eb('0x109')])?!![]:_0x522a0c[_0x46eb('0x109')];var _0x4d86c5=uuid['v4']();_0x1b6bab[_0x46eb('0x23')][_0x4d86c5]=new Action(_0x522a0c,_0x130382,_0x4d86c5);loggerBooked[_0x46eb('0x82')](_0x46eb('0x1b0'),_0x4d86c5,_0x46eb('0x1b1'),JSON['stringify'](_0x522a0c[_0x46eb('0x109')]),'Queue:\x20',_0x522a0c['name']);if(_0x522a0c[_0x46eb('0x109')]){_0x522a0c[_0x46eb('0x109')]=![];_0x1b6bab[_0x46eb('0x107')][_0x1b6bab[_0x46eb('0x23')][_0x4d86c5][_0x46eb('0xb8')]]=[];ami[_0x46eb('0xb2')]({'actionid':_0x4d86c5,'action':_0x46eb('0x1b2'),'queue':_0x522a0c[_0x46eb('0x3e')]})[_0x46eb('0xb4')](function(_0x364718){_0x1b6bab['updateOriginated'](_0x522a0c);_0x1b6bab[_0x46eb('0xc0')]({'active':![],'ContactId':_0x1b6bab[_0x46eb('0x23')][_0x4d86c5]['ContactId'],'ListId':_0x1b6bab[_0x46eb('0x23')][_0x4d86c5]['ListId'],'VoiceQueueId':_0x1b6bab[_0x46eb('0x23')][_0x4d86c5][_0x46eb('0x10e')]||undefined,'CampaignId':_0x1b6bab['actions'][_0x4d86c5][_0x46eb('0xd2')]||undefined})[_0x46eb('0xb4')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x1b6bab[_0x46eb('0x23')][_0x4d86c5];});}else{loggerBooked[_0x46eb('0x82')](_0x46eb('0x1b3'),JSON[_0x46eb('0x48')](_0x522a0c[_0x46eb('0x109')]),_0x46eb('0x1b4'),_0x522a0c[_0x46eb('0x3e')]);_0x1b6bab[_0x46eb('0xb6')](_0x522a0c);_0x1b6bab['rescheduleContact']({'active':![],'ContactId':_0x1b6bab['actions'][_0x4d86c5][_0x46eb('0x10d')],'ListId':_0x1b6bab['actions'][_0x4d86c5][_0x46eb('0xd0')],'VoiceQueueId':_0x1b6bab['actions'][_0x4d86c5][_0x46eb('0x10e')]||undefined,'CampaignId':_0x1b6bab[_0x46eb('0x23')][_0x4d86c5][_0x46eb('0xd2')]||undefined})[_0x46eb('0xb4')](loggerCatch(_0x46eb('0x1b5')));delete _0x1b6bab[_0x46eb('0x23')][_0x4d86c5];}}else{return _0x1b6bab[_0x46eb('0x141')](_0x522a0c,_0x130382);}}else{if(getDiff(_0x130382[_0x46eb('0x1b6')])<_0x522a0c[_0x46eb('0x1b7')]*0x3c){_0x1b6bab[_0x46eb('0x1c')]['run'](_0x130382['id'])[_0x46eb('0x10c')](function(){_0x1b6bab[_0x46eb('0xb6')](_0x522a0c);});}else{_0x522a0c['outboundReCallsDay']+=0x1;_0x1b6bab['updateOriginated'](_0x522a0c);if(_0x522a0c[_0x46eb('0x1b8')]){_0x1b6bab[_0x46eb('0xc0')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x130382[_0x46eb('0x10d')],'ListId':_0x130382[_0x46eb('0xd0')],'VoiceQueueId':_0x130382[_0x46eb('0x10e')]||undefined,'CampaignId':_0x130382['CampaignId']||undefined})['catch'](loggerCatch(_0x46eb('0x1b9')));_0x1b6bab['createHistory'](createObjHistory(_0x522a0c,_0x130382,_0x46eb('0x1ba'),0x17,_0x46eb('0x1bb')))[_0x46eb('0xb4')](loggerCatch(_0x46eb('0x1bc')));}else{_0x1b6bab['saveInDb'](createObjHistory(_0x522a0c,_0x130382,'RECALLFAILEDTIMEOUT',0x16,'RecallFailedTimeout'),_0x46eb('0x1bd'),_0x46eb('0x1be'));}}}}else{_0x522a0c[_0x46eb('0x5d')]+=0x1;_0x1b6bab[_0x46eb('0xce')](createObjHistory(_0x522a0c,_0x130382,_0x46eb('0x1bf'),0xd,_0x46eb('0x1c0')),_0x46eb('0x1c1'),_0x46eb('0x1c2'));throw _0x46eb('0x1c3');}};};Dialer[_0x46eb('0x1a')][_0x46eb('0x1c4')]=function(_0x39198d){var _0x102b4c=this;var _0x5a6db1=[];var _0x3e747d=_0x39198d[_0x46eb('0x1c5')]-_0x39198d[_0x46eb('0x71')]-_0x39198d[_0x46eb('0x1c6')];emitCampaignSummary(_0x39198d);if(_0x3e747d>0x0){if(_0x3e747d>this['maxNumberOriginate']){_0x3e747d=this['maxNumberOriginate'];}_0x39198d[_0x46eb('0x1c6')]+=_0x3e747d;this[_0x46eb('0xc4')](_0x39198d['id'],_0x3e747d,_0x39198d[_0x46eb('0x1c7')])[_0x46eb('0xba')](function(_0x3692ad){_0x39198d['temp']-=_0x3e747d;_0x39198d[_0x46eb('0x1c6')]=_0x39198d[_0x46eb('0x1c6')]>0x0?_0x39198d[_0x46eb('0x1c6')]:0x0;if(!checkContactEmpty(_0x3692ad)){_0x39198d[_0x46eb('0x3c')]=_0x46eb('0x1c8');logger[_0x46eb('0x82')](_0x46eb('0x1c9')+_0x39198d[_0x46eb('0x3e')]);}else{_0x39198d[_0x46eb('0x71')]+=_0x3692ad[_0x46eb('0x9f')];_0x39198d[_0x46eb('0x3c')]=_0x46eb('0x1ca');for(var _0x564437=0x0;_0x564437<_0x3692ad[_0x46eb('0x9f')];_0x564437+=0x1){_0x39198d[_0x46eb('0x1cb')]+=0x1;if(_['isNil'](_0x3692ad[_0x564437])||_[_0x46eb('0xb1')](_0x3692ad[_0x564437][_0x46eb('0x144')])||_[_0x46eb('0xb1')](_0x3692ad[_0x564437][_0x46eb('0x144')]['phone'])){_0x102b4c['emptyContact']('[actionOriginate]\x20',_0x39198d,_0x3692ad[_0x564437]);}else{_0x102b4c[_0x46eb('0xbe')](_[_0x46eb('0xcf')](_0x3692ad[_0x564437],['CampaignId',_0x46eb('0x1cc')]))[_0x46eb('0xba')](_0x102b4c[_0x46eb('0x1ae')](_0x39198d,_0x3692ad[_0x564437]))[_0x46eb('0xb4')](_0x102b4c[_0x46eb('0x1cd')](_0x46eb('0x1ce'),_0x39198d));}}}})[_0x46eb('0xb4')](loggerGetContactDialer(_0x46eb('0x1cf'),_0x39198d,_0x3e747d));}};Dialer[_0x46eb('0x1a')]['handlePower']=function(_0x291b6c,_0x5a2d0a){var _0x45a746=this;var _0x593258=[];var _0x5858ba=_0x5a2d0a>=0x1?_0x5a2d0a:0x1;var _0x1354d4=[];if(_0x291b6c[_0x46eb('0x56')]===_0x46eb('0x8')){_0x5858ba=0x1;}var _0xfcb39f=Math[_0x46eb('0x192')](_0x291b6c[_0x46eb('0x4e')]*_0x5858ba)-_0x291b6c[_0x46eb('0x71')]-_0x291b6c['temp'];emitVoiceQueueSummary(_0x291b6c);if(_0x291b6c[_0x46eb('0x1d0')]>0x0){var _0x3694fa=_0x291b6c[_0x46eb('0x1d0')]-_0x291b6c[_0x46eb('0x71')]-_0x291b6c[_0x46eb('0x191')]-_0x291b6c[_0x46eb('0x1c6')]-_0x291b6c[_0x46eb('0x50')];if(_0xfcb39f>_0x3694fa){_0xfcb39f=_0x3694fa;}}if(_0xfcb39f>0x0){if(_0x291b6c['dialMethod']===_0x46eb('0x8')){_0xfcb39f=0x1;}if(_0xfcb39f>this[_0x46eb('0x21')]){_0xfcb39f=this['maxNumberOriginate'];}_0x291b6c[_0x46eb('0x1c6')]+=_0xfcb39f;for(var _0x8bf9c3 in this[_0x46eb('0x1f')]){if(this[_0x46eb('0x1f')][_0x46eb('0xa0')](_0x8bf9c3)){if(this[_0x46eb('0x1f')][_0x8bf9c3][_0x46eb('0xa9')]==='not_inuse'&&this['agents'][_0x8bf9c3][_0x46eb('0xb3')]===_0x46eb('0xd7')){_0x593258[_0x46eb('0x126')](this[_0x46eb('0x1f')][_0x8bf9c3]['id']);}}}this[_0x46eb('0xc2')](_0x291b6c['id'],_0x593258,_0xfcb39f,_0x291b6c['dialOrderByScheduledAt'])['then'](function(_0x293856){_0x291b6c[_0x46eb('0x1c6')]-=_0xfcb39f;_0x291b6c['temp']=_0x291b6c[_0x46eb('0x1c6')]>0x0?_0x291b6c[_0x46eb('0x1c6')]:0x0;if(!checkContactEmpty(_0x293856)){_0x45a746[_0x46eb('0x1d1')](_0x291b6c)[_0x46eb('0xba')](sendMessageReschedule(_0x291b6c))[_0x46eb('0xb4')](loggerCatch(_0x46eb('0xbb')));}else{_0x291b6c[_0x46eb('0x71')]+=_0x293856[_0x46eb('0x9f')];_0x291b6c[_0x46eb('0x3c')]=_0x291b6c[_0x46eb('0x56')]==='booked'?_0x46eb('0x149'):_0x46eb('0x1ca');for(var _0xb48ea8=0x0;_0xb48ea8<_0x293856['length'];_0xb48ea8+=0x1){if(_['isNil'](_0x293856[_0xb48ea8])||_['isNil'](_0x293856[_0xb48ea8][_0x46eb('0x144')])||_[_0x46eb('0xb1')](_0x293856[_0xb48ea8][_0x46eb('0x144')][_0x46eb('0x164')])){_0x45a746[_0x46eb('0xcc')](_0x46eb('0x1d2'),_0x291b6c,_0x293856[_0xb48ea8]);}else{_0x45a746['checkIsBlackList'](_['pick'](_0x293856[_0xb48ea8],[_0x46eb('0x10e'),_0x46eb('0x1cc')]))[_0x46eb('0xba')](_0x45a746['checkContactBlack'](_0x291b6c,_0x293856[_0xb48ea8]))[_0x46eb('0xb4')](_0x45a746[_0x46eb('0x1cd')](_0x46eb('0x1d2'),_0x291b6c));}}}})[_0x46eb('0xb4')](loggerGetContactDialer('[getContactDialer2]',_0x291b6c,_0xfcb39f));}};Dialer[_0x46eb('0x1a')][_0x46eb('0x97')]=function(_0x37d6d1){var _0x1074e1=this;if(_0x37d6d1[_0x46eb('0x1d0')]>0x0){var _0x3372f1=_0x37d6d1['dialLimitQueue']-_0x37d6d1['originated']-_0x37d6d1[_0x46eb('0x191')];if(_0x3372f1>0x0){this[_0x46eb('0x1d3')](_0x37d6d1);}else{loggerPredictiveCalls[_0x46eb('0x82')](_0x46eb('0x1d4'));}}else{this['tryOriginatePredictive'](_0x37d6d1);}};Dialer[_0x46eb('0x1a')][_0x46eb('0x1d3')]=function(_0x4df999){var _0x95d296=this;var _0x462657=[];_0x4df999[_0x46eb('0x71')]+=0x1;for(var _0x43faa5 in this['agents']){if(this[_0x46eb('0x1f')]['hasOwnProperty'](_0x43faa5)){if(this[_0x46eb('0x1f')][_0x43faa5][_0x46eb('0xa9')]===_0x46eb('0x1d5')&&this['agents'][_0x43faa5][_0x46eb('0xb3')]===_0x46eb('0xd7')){_0x462657[_0x46eb('0x126')](this['agents'][_0x43faa5]['id']);}}}this[_0x46eb('0xc2')](_0x4df999['id'],_0x462657,0x1,_0x4df999[_0x46eb('0x1c7')])[_0x46eb('0xba')](function(_0x456c10){if(!checkContactEmpty(_0x456c10)){checkContactLowerLimitOriginate(_0x4df999,0x1,0x0);_0x95d296['countReScheduled'](_0x4df999)[_0x46eb('0xba')](sendMessageReschedule(_0x4df999))[_0x46eb('0xb4')](loggerCatch(_0x46eb('0xbb')));}else{_0x4df999[_0x46eb('0x3c')]='RUNNING';if(_[_0x46eb('0xb1')](_0x456c10[0x0])||_[_0x46eb('0xb1')](_0x456c10[0x0][_0x46eb('0x144')])||_['isNil'](_0x456c10[0x0][_0x46eb('0x144')][_0x46eb('0x164')])){_0x95d296[_0x46eb('0xcc')]('[actionOriginate]\x20',_0x4df999,_0x456c10[0x0]);}else{_0x95d296[_0x46eb('0xbc')](_['pick'](_0x456c10[0x0],[_0x46eb('0x10e'),_0x46eb('0x1cc')]))[_0x46eb('0xba')](_0x95d296[_0x46eb('0x1ae')](_0x4df999,_0x456c10[0x0]))[_0x46eb('0xb4')](_0x95d296[_0x46eb('0x1cd')](_0x46eb('0x1d6'),_0x4df999));}}})['catch'](loggerGetContactDialer(_0x46eb('0x1d7'),_0x4df999,0x1));emitVoiceQueueSummary(_0x4df999);};Dialer[_0x46eb('0x1a')][_0x46eb('0x1a4')]=function(_0x13291a,_0x15eccb,_0x5ccd29,_0x3cf0f2,_0x5b60c7,_0x488464){loggerPredictive[_0x46eb('0x82')](_0x46eb('0x1d8'));loggerPredictive['info']('M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x13291a);loggerPredictive[_0x46eb('0x82')](_0x46eb('0x1d9'),_0x15eccb);loggerPredictive[_0x46eb('0x82')]('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',_0x5ccd29);loggerPredictive['info'](_0x46eb('0x1da'),_0x3cf0f2);loggerPredictive['info'](_0x46eb('0x1db'),_0x5b60c7);loggerPredictive['info']('---------------------------');return new BPromise(function(_0x5279d3,_0x509b87){if(_0x13291a<=0x0||isNaN(_0x13291a)){return _0x509b87(msgResponse(_0x46eb('0x1dc'),_0x46eb('0x169'),'m\x20=\x20'+_0x13291a));}if(_0x5ccd29<=0x0||isNaN(_0x5ccd29)){return _0x509b87(msgResponse(_0x46eb('0x1dc'),_0x46eb('0x169'),_0x46eb('0x1dd')+_0x5ccd29));}if(_0x3cf0f2<=0x0||isNaN(_0x3cf0f2)){return _0x509b87(msgResponse(_0x46eb('0x1dc'),'Error','p\x20=\x20'+_0x3cf0f2));}if(_0x15eccb<=0x0||isNaN(_0x15eccb)){return _0x509b87(msgResponse('[abandonmentRate]','Error',_0x46eb('0x1de')+_0x15eccb));}if(_0x5b60c7<=0x0||isNaN(_0x5b60c7)){return _0x509b87(msgResponse(_0x46eb('0x1dc'),'Error',_0x46eb('0x1df')+_0x5b60c7));}_0x488464=_0x488464||0x0;var _0xd3b63b=0x1/_0x5ccd29;var _0x510376=0x0;var _0x53ac70=0x0;var _0x6b8eea=0x0;var _0xcb495f=0x0;for(var _0x3f31b6=0x0;_0x6b8eea<_0x5b60c7;_0x3f31b6+=0x1){_0x53ac70=_0x3f31b6/_0x15eccb;_0x510376=(_0x3cf0f2*_0x53ac70+_0x488464)/_0xd3b63b;_0x6b8eea=erlangb(_0x510376,_0x13291a);_0xcb495f=_0x510376/_0x13291a*(0x1-erlangb(_0x510376,_0x13291a));}return _0x5279d3({'erlangCalls':_0x3f31b6,'erlangCallToSecond':_0x15eccb/_0x3f31b6,'erlangAbandonmentRate':_0x6b8eea,'erlangBusyFactor':_0xcb495f});});};Dialer[_0x46eb('0x1a')][_0x46eb('0x1a6')]=function(_0x53e903,_0xe33423,_0x24fb0b,_0x2dd763,_0x378926,_0x35ca2c){loggerPredictive[_0x46eb('0x82')](_0x46eb('0x1e0'));loggerPredictive['info'](_0x46eb('0x1e1'),_0x53e903);loggerPredictive[_0x46eb('0x82')](_0x46eb('0x1d9'),_0xe33423);loggerPredictive[_0x46eb('0x82')](_0x46eb('0x1e2'),_0x24fb0b);loggerPredictive[_0x46eb('0x82')](_0x46eb('0x1da'),_0x2dd763);loggerPredictive[_0x46eb('0x82')](_0x46eb('0x1e3'),_0x378926);loggerPredictive[_0x46eb('0x82')]('---------------------------');return new BPromise(function(_0x1efd68,_0x41709d){if(_0x53e903<=0x0||isNaN(_0x53e903)){return _0x41709d(msgResponse(_0x46eb('0x1e4'),_0x46eb('0x169'),'m\x20=\x20'+_0x53e903));}if(_0x24fb0b<=0x0||isNaN(_0x24fb0b)){return _0x41709d(msgResponse('[busyFactor]',_0x46eb('0x169'),_0x46eb('0x1dd')+_0x24fb0b));}if(_0x2dd763<=0x0||isNaN(_0x2dd763)){return _0x41709d(msgResponse(_0x46eb('0x1e4'),_0x46eb('0x169'),_0x46eb('0x1e5')+_0x2dd763));}if(_0xe33423<=0x0||isNaN(_0xe33423)){return _0x41709d(msgResponse(_0x46eb('0x1e4'),_0x46eb('0x169'),'interval\x20=\x20'+_0xe33423));}if(_0x378926<=0x0||isNaN(_0x378926)){return _0x41709d(msgResponse(_0x46eb('0x1e4'),'Error',_0x46eb('0x1e6')+_0x378926));}_0x35ca2c=_0x35ca2c||0x0;var _0x2a9708=0x1/_0x24fb0b;var _0x2f8045=0x0;var _0x24a626=0x0;var _0x5be3f1=0x0;var _0x3f69df=0x0;for(var _0x50b113=0x0;_0x3f69df<_0x378926;_0x50b113+=0x1){_0x24a626=_0x50b113/_0xe33423;_0x2f8045=(_0x2dd763*_0x24a626+_0x35ca2c)/_0x2a9708;_0x5be3f1=erlangb(_0x2f8045,_0x53e903);_0x3f69df=_0x2f8045/_0x53e903*(0x1-erlangb(_0x2f8045,_0x53e903));}return _0x1efd68({'erlangCalls':_0x50b113,'erlangCallToSecond':_0xe33423/_0x50b113,'erlangAbandonmentRate':_0x5be3f1,'erlangBusyFactor':_0x3f69df});});};module[_0x46eb('0x1e7')]=Dialer; \ No newline at end of file +var _0xd0dc=['actionid','locked','paused','stateinterface','push','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','[Catch][Preview][syncQueueStatusComplete]','ContactId','CampaignId','[unlock][syncQueueStatusComplete]','_rr','unlockRR','contactAgent-idHopper:\x20','run','[booked][RR][finaly]','Agent:\x20','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','syncCampaigns','isTrunkReachable','TrunkBackup','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','command','iftime\x20%s,%s','interval','content','indexOf','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','Timezone:\x20','checkDialMethod','dialMethod','progressive','power','dialPowerLevel','Queue','method\x20not\x20recognized','launchHandleIvr','loggedIn','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','\x5cw{0,','replace','random','match','actionOriginate','object','originate','Contact','phone','\x22agi://%s/square,%s\x22','NONE','dialQueueOptions','getCaller','ACTIVE','XMD-AMDINITIALSILENCE','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','createdAt','%s%s','XMD-','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','trim','dialCutDigit','substring','from-sip','dialOriginateTimeout','[originateError]:\x20%s','OriginateError','starttime','[originate][error]','Error','getQueue','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','countbusyretry','countcongestionretry','countnoanswerretry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','minutes','dialBusyMaxRetry','add','dialBusyRetryFrequency','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','[syncAgentComplete][createHistory][0]','dialGlobalMaxRetry','stateGlobal','createStateFinal','reason\x200\x20no\x20such\x20number....','NoAnswer','countglobal','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','Global','[moveContactManagedDialer][0]','round','predictiveIntervalMaxThreshold','predictiveIntervalAvailable','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','handlePower','dialPredictiveInterval','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(','dialPredictiveOptimizationPercentage','abandonmentRate','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','agentBusyFactor','one\x20call\x20every:','[handlePredictive]','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','handleIvr','limitCalls','temp','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','loggerHandler','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','dialOrderByScheduledAt','checkContactBlack','[getContactDialer2]','[handlePredictive][limitChannel]','tryOriginatePredictive','[countReScheduled]\x20','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','exports','lodash','moment','md5','ioredis','../../../config/environment/','dialer','../../../config/logger','booked','predictive','predictiveCalls','syncQueueSummary','redis','defaults','localhost','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperBlack','./action','./history','./final','./agentComplete','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','uniqueId','startPredictive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','hangup','syncHangup','newexten','syncNewExten','syncVarSet','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','name','NOT_ACTIVE','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','[ifTime][Action]','milliseconds','seconds','emit','outbound','strategy','answered','available','pTalking','sumHoldTime','talking','total','type','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalTotalCalls','originated','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','startProgressive','Trunk','active','callerid','stringify','voice_queue:save','ivr','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','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','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','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','diff','clearing\x20variable\x20start\x20progressive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','length','hasOwnProperty','[decremetOriginate]\x20object\x20originated\x20is\x20negative','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','IS_DISACTIVED','endtime','clearZombieChannels','isNil','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','countReScheduled','resolve','checkIsBlackList','then','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','rescheduleContact','[rescheduleContact]\x20','getContactDialer','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','emptyContact','notFound','saveInDb','pick','ListId','UserId','VoiceQueueId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','reachable','unmonitored','variable','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','uniqueid','outboundAnswerAgiCallsDay','state','HangupInAMD','membername','[syncHangupInAMD][createHistory]','MACHINE','Machine','AMD','amd','[syncMachine][createHistory]','[syncMachine]','statedesc','[syncHangupInAMDIvr][createHistory]','[syncMachineIvr][createHistory]','[syncMachineIvr]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','dialQueueProject','AGI','[syncHangupIvr]','cause-txt','Unknow','syncAgentComplete','reason','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','YYYY-MM-DD\x20HH:mm:ss','[syncAgentComplete]','syncAgentConnect','queueCallerAbandonCreateState','[syncAgentComplete][createHistory]','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','outboundDropCallsDayTimeout','Drop','dropreason','TIMEOUT','Abandoned','CALLEREXIT'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xd0dc,0xed));var _0xcd0d=function(_0x465d8c,_0x101ece){_0x465d8c=_0x465d8c-0x0;var _0x28f93e=_0xd0dc[_0x465d8c];return _0x28f93e;};'use strict';var util=require('util');var _=require(_0xcd0d('0x0'));var BPromise=require('bluebird');var uuid=require('uuid');var moment=require(_0xcd0d('0x1'));var rr=require('rr');var md5=require(_0xcd0d('0x2'));var Redis=require(_0xcd0d('0x3'));var config=require(_0xcd0d('0x4'));var logger=require('../../../config/logger')(_0xcd0d('0x5'));var loggerBooked=require(_0xcd0d('0x6'))(_0xcd0d('0x7'));var loggerPredictive=require('../../../config/logger')(_0xcd0d('0x8'));var loggerPredictiveCalls=require(_0xcd0d('0x6'))(_0xcd0d('0x9'));var loggerSyncQueueSummary=require(_0xcd0d('0x6'))(_0xcd0d('0xa'));var ami=require('../ami');config[_0xcd0d('0xb')]=_[_0xcd0d('0xc')](config['redis'],{'host':_0xcd0d('0xd'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xcd0d('0xb')]));var cmHopper=require(_0xcd0d('0xe'));var cmHopperFinal=require(_0xcd0d('0xf'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0xcd0d('0x10'));var voiceQueueRt=require('../rpc/voiceQueueRt');var Action=require(_0xcd0d('0x11'));var History=require(_0xcd0d('0x12'));var Final=require(_0xcd0d('0x13'));var AgentComplete=require(_0xcd0d('0x14'));var QueueCallerAbandon=require('./queueCallerAbandon');var Hangup=require(_0xcd0d('0x15'));var ipAgi=process[_0xcd0d('0x16')][_0xcd0d('0x17')]||_0xcd0d('0x18');var strategy={'rrmemory':_0xcd0d('0x19'),'roundrobin':_0xcd0d('0x1a')};var Sequence=function(){};Sequence[_0xcd0d('0x1b')][_0xcd0d('0x1c')]=function(_0x474232){this[_0xcd0d('0x1d')]=this[_0xcd0d('0x1d')]?this[_0xcd0d('0x1d')][_0xcd0d('0x1e')](_0x474232):_0x474232();};function Dialer(_0x3d22f3,_0x156d94){this[_0xcd0d('0x1f')]=new Sequence();this[_0xcd0d('0x20')]=_0x156d94;this[_0xcd0d('0x21')]=_0x3d22f3['voiceQueues'];this['campaigns']=_0x3d22f3[_0xcd0d('0x22')];this[_0xcd0d('0x23')]=_0x3d22f3[_0xcd0d('0x23')];this['trunks']=_0x3d22f3[_0xcd0d('0x24')];this[_0xcd0d('0x25')]=config[_0xcd0d('0x25')]||0x2;this[_0xcd0d('0x26')]={};this[_0xcd0d('0x27')]={};this['contactsId']={};this[_0xcd0d('0x28')]={};this['optionPredictive']={};this[_0xcd0d('0x29')]={};this['startProgressive']={};this[_0xcd0d('0x2a')]={};this[_0xcd0d('0x2b')]={};this[_0xcd0d('0x2c')]={};ami['on'](_0xcd0d('0x2d'),this['syncAgentConnect'][_0xcd0d('0x2e')](this));ami['on'](_0xcd0d('0x2f'),this[_0xcd0d('0x30')][_0xcd0d('0x2e')](this));ami['on'](_0xcd0d('0x31'),this[_0xcd0d('0x32')][_0xcd0d('0x2e')](this));ami['on'](_0xcd0d('0x33'),this['syncAgentComplete']['bind'](this));ami['on']('custom:queuesummary',this[_0xcd0d('0xa')][_0xcd0d('0x2e')](this));ami['on'](_0xcd0d('0x34'),this[_0xcd0d('0x35')][_0xcd0d('0x2e')](this));ami['on'](_0xcd0d('0x36'),this[_0xcd0d('0x37')][_0xcd0d('0x2e')](this));ami['on']('varset',this[_0xcd0d('0x38')][_0xcd0d('0x2e')](this));ami['on']('queuemember',this[_0xcd0d('0x39')]['bind'](this));ami['on'](_0xcd0d('0x3a'),this[_0xcd0d('0x3b')]['bind'](this));this[_0xcd0d('0x3c')]();this[_0xcd0d('0x3d')]();}function isNotNull(_0x5742cd){return _0x5742cd!==null&&!_[_0xcd0d('0x3e')](_0x5742cd);}function checkIsLoggedIn(_0xfa4a54,_0x37cbee){return function(){if(_0x37cbee<=0x0){_0xfa4a54[_0xcd0d('0x3f')]=_0xcd0d('0x40');throw _0xfa4a54[_0xcd0d('0x41')]+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x24b5d5){return _0x24b5d5;}function checkIsActive(_0x5e4d28,_0x16c799){return function(){if(!isActive(_0x16c799)){_0x5e4d28[_0xcd0d('0x3f')]=_0xcd0d('0x42');throw _0x5e4d28[_0xcd0d('0x41')]+'\x20NOT\x20Active';}};}function checkInterval(_0x4f9c48){return function(){if(!isNotNull(_0x4f9c48[_0xcd0d('0x43')])){_0x4f9c48[_0xcd0d('0x3f')]=_0xcd0d('0x44');throw _0x4f9c48['name']+_0xcd0d('0x45');}if(!isNotNull(_0x4f9c48['Interval'][_0xcd0d('0x46')])){_0x4f9c48[_0xcd0d('0x3f')]=_0xcd0d('0x44');throw _0x4f9c48[_0xcd0d('0x41')]+_0xcd0d('0x45');}if(!isNotNull(_[_0xcd0d('0x47')](_0x4f9c48['Interval'][_0xcd0d('0x46')]))){_0x4f9c48[_0xcd0d('0x3f')]=_0xcd0d('0x44');throw _0x4f9c48['name']+_0xcd0d('0x45');}};}function msgResponse(_0x1aff21,_0x100eb1,_0x434239){return{'action':_0x1aff21,'response':_0x100eb1,'message':_0x434239,'stack':_0x434239};}function myreject(_0xbfd4a){return function(_0xa840a3){return _0xbfd4a(msgResponse(_0xcd0d('0x48'),'Error',JSON['stringify'](_0xa840a3)));};}function getSeconds(_0x1297da,_0x2058de){var _0x10f12f=moment(_0x1297da)['milliseconds'](0x0);var _0x4bf307=moment(_0x2058de)[_0xcd0d('0x49')](0x0);return _0x10f12f['diff'](_0x4bf307,_0xcd0d('0x4a'));}function emit(_0x29d310,_0x2ff5f9,_0x1b9096){io['to'](_0x29d310)[_0xcd0d('0x4b')](_0x2ff5f9,_0x1b9096);}function emitVoiceQueueSummary(_0x221bcd){if(_0x221bcd['type']===_0xcd0d('0x4c')){var _0x2aea8f={'id':_0x221bcd['id'],'name':_0x221bcd[_0xcd0d('0x41')],'strategy':_0x221bcd[_0xcd0d('0x4d')],'answered':_0x221bcd[_0xcd0d('0x4e')],'available':_0x221bcd[_0xcd0d('0x4f')],'loggedIn':_0x221bcd['loggedIn'],'pTalking':_0x221bcd[_0xcd0d('0x50')],'sumBillable':_0x221bcd['sumBillable'],'sumDuration':_0x221bcd['sumDuration'],'sumHoldTime':_0x221bcd[_0xcd0d('0x51')]||0x0,'talking':_0x221bcd[_0xcd0d('0x52')],'total':_0x221bcd[_0xcd0d('0x53')],'type':_0x221bcd[_0xcd0d('0x54')],'unmanaged':_0x221bcd[_0xcd0d('0x55')],'abandoned':_0x221bcd[_0xcd0d('0x56')],'waiting':_0x221bcd[_0xcd0d('0x57')],'loggedInDb':_0x221bcd[_0xcd0d('0x58')],'dialActive':_0x221bcd[_0xcd0d('0x59')],'dialMethod':_0x221bcd['dialMethod'],'dialOriginateCallerIdName':_0x221bcd['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x221bcd[_0xcd0d('0x5a')],'dialOriginateTimeout':_0x221bcd['dialOriginateTimeout'],'dialPrefix':_0x221bcd[_0xcd0d('0x5b')],'outboundAnswerAgiCallsDay':_0x221bcd['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x221bcd[_0xcd0d('0x5c')],'outboundBlacklistCallsDay':_0x221bcd['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x221bcd[_0xcd0d('0x5d')],'outboundCongestionCallsDay':_0x221bcd[_0xcd0d('0x5e')],'outboundDropCallsDayACS':_0x221bcd[_0xcd0d('0x5f')],'outboundDropCallsDayCallersExit':_0x221bcd[_0xcd0d('0x60')],'outboundDropCallsDayTimeout':_0x221bcd['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x221bcd[_0xcd0d('0x61')],'outboundNoSuchCallsDay':_0x221bcd[_0xcd0d('0x62')],'outboundOriginateFailureCallsDay':_0x221bcd[_0xcd0d('0x63')],'outboundReCallsDay':_0x221bcd[_0xcd0d('0x64')],'outboundRejectCallsDay':_0x221bcd[_0xcd0d('0x65')],'outboundUnknownCallsDay':_0x221bcd[_0xcd0d('0x66')],'predictiveIntervalAnsweredCalls':_0x221bcd['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x221bcd[_0xcd0d('0x67')],'predictiveIntervalAvgTalktime':_0x221bcd['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x221bcd[_0xcd0d('0x68')],'predictiveIntervalDroppedCallsTimeout':_0x221bcd[_0xcd0d('0x69')],'predictiveIntervalErlangCalls':_0x221bcd[_0xcd0d('0x6a')],'predictiveIntervalErlangCallsDroppedCalls':_0x221bcd[_0xcd0d('0x6b')],'predictiveIntervalHitRate':_0x221bcd[_0xcd0d('0x6c')],'predictiveIntervalMultiplicativeFactor':_0x221bcd['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x221bcd['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x221bcd['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x221bcd[_0xcd0d('0x6d')],'message':_0x221bcd[_0xcd0d('0x3f')],'originated':_0x221bcd[_0xcd0d('0x6e')],'erlangCalls':_0x221bcd[_0xcd0d('0x6f')],'erlangCallToSecond':_0x221bcd['erlangCallToSecond'],'erlangAbandonmentRate':_0x221bcd[_0xcd0d('0x70')],'erlangBusyFactor':_0x221bcd[_0xcd0d('0x71')],'startPredictive':_0x221bcd[_0xcd0d('0x29')],'startProgressive':_0x221bcd[_0xcd0d('0x72')]};if(_0x221bcd['Trunk']){_0x2aea8f[_0xcd0d('0x73')]={'id':_0x221bcd['Trunk']['id'],'name':_0x221bcd[_0xcd0d('0x73')]['name'],'active':_0x221bcd['Trunk'][_0xcd0d('0x74')],'callerid':_0x221bcd['Trunk'][_0xcd0d('0x75')]};}if(_0x221bcd[_0xcd0d('0x43')]){_0x2aea8f[_0xcd0d('0x43')]={'id':_0x221bcd[_0xcd0d('0x43')]['id'],'name':_0x221bcd['Interval'][_0xcd0d('0x41')]};}var _0x33b8f7=md5(JSON[_0xcd0d('0x76')](_0x2aea8f));if(_0x221bcd[_0xcd0d('0x2')]!==_0x33b8f7){_0x221bcd['md5']=_0x33b8f7;emit(util['format']('voice:queue:%s',_0x2aea8f[_0xcd0d('0x41')]),_0xcd0d('0x77'),_0x2aea8f);}}}function emitCampaignSummary(_0x3adbf5){if(_0x3adbf5[_0xcd0d('0x54')]===_0xcd0d('0x78')){emit(util[_0xcd0d('0x79')]('campaign:ivr:%s',_0x3adbf5[_0xcd0d('0x41')]),'campaign:save',_0x3adbf5);}}function checkGetDataPredictive(_0x42f206){if(isNotNull(_0x42f206)){if(!_[_0xcd0d('0x47')](_0x42f206)){loggerPredictive[_0xcd0d('0x7a')](_0xcd0d('0x7b'));loggerPredictive[_0xcd0d('0x7a')](_0xcd0d('0x7c'),_0x42f206[_0xcd0d('0x6d')]);loggerPredictive[_0xcd0d('0x7a')](_0xcd0d('0x7d'),_0x42f206[_0xcd0d('0x7e')]);loggerPredictive[_0xcd0d('0x7a')](_0xcd0d('0x7f'),_0x42f206[_0xcd0d('0x69')]);loggerPredictive[_0xcd0d('0x7a')](_0xcd0d('0x80'),_0x42f206[_0xcd0d('0x68')]);loggerPredictive[_0xcd0d('0x7a')](_0xcd0d('0x81'),_0x42f206['predictiveIntervalAvgHoldtime']);loggerPredictive[_0xcd0d('0x7a')](_0xcd0d('0x82'),_0x42f206[_0xcd0d('0x83')]);loggerPredictive[_0xcd0d('0x7a')](_0xcd0d('0x84'));if(_0x42f206[_0xcd0d('0x6d')]>0x0){if(!_[_0xcd0d('0x3e')](_0x42f206[_0xcd0d('0x83')])&&_0x42f206[_0xcd0d('0x83')]>0x0){return!![];}else{loggerPredictive[_0xcd0d('0x7a')](_0xcd0d('0x85'));}if(!_[_0xcd0d('0x3e')](_0x42f206[_0xcd0d('0x67')])&&_0x42f206[_0xcd0d('0x67')]>0x0){return!![];}else{loggerPredictive[_0xcd0d('0x7a')](_0xcd0d('0x86'));}}else{loggerPredictive[_0xcd0d('0x7a')](_0xcd0d('0x87'));}}else{loggerPredictive[_0xcd0d('0x7a')]('History\x20information\x20are\x20empty');}}else{loggerPredictive[_0xcd0d('0x7a')](_0xcd0d('0x88'));}return![];}function mergeDataErlangB(_0x455039){return function(_0x471857){loggerPredictive[_0xcd0d('0x7a')]('---------\x20ErlangB\x20---------');loggerPredictive[_0xcd0d('0x7a')](_0xcd0d('0x89'),_0x471857[_0xcd0d('0x6f')]);loggerPredictive['info'](_0xcd0d('0x8a'),_0x471857[_0xcd0d('0x8b')]);loggerPredictive[_0xcd0d('0x7a')](_0xcd0d('0x8c'),_0x471857['erlangAbandonmentRate']);loggerPredictive[_0xcd0d('0x7a')](_0xcd0d('0x8d'),_0x471857[_0xcd0d('0x71')]);loggerPredictive[_0xcd0d('0x7a')](_0xcd0d('0x8c'),_0x471857[_0xcd0d('0x70')]);loggerPredictive['info'](_0xcd0d('0x84'));_[_0xcd0d('0x8e')](_0x455039,_0x471857);};}function getDiff(_0x5f4dc3){var _0x42859a=moment()['milliseconds'](0x0);var _0x3b08d8=moment(_0x5f4dc3)[_0xcd0d('0x49')](0x0);return _0x42859a[_0xcd0d('0x8f')](_0x3b08d8,_0xcd0d('0x4a'));}function ifInterval(_0x561247,_0xaa79af){if(_[_0xcd0d('0x3e')](_0xaa79af)){return![];}if(getDiff(_0xaa79af)<_0x561247*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x4376f4){if(isNotNull(_0x4376f4)){if(!_[_0xcd0d('0x3e')](_0x4376f4[_0xcd0d('0x72')])){_0x4376f4[_0xcd0d('0x72')]=undefined;loggerPredictive[_0xcd0d('0x7a')](_0x4376f4[_0xcd0d('0x41')],_0xcd0d('0x90'));}if(!_['isUndefined'](_0x4376f4['startPredictive'])){_0x4376f4[_0xcd0d('0x29')]=undefined;loggerPredictive[_0xcd0d('0x7a')](_0x4376f4['name'],'clearing\x20variable\x20start\x20predictive');}if(!_[_0xcd0d('0x3e')](_0x4376f4[_0xcd0d('0x91')])){clearInterval(_0x4376f4[_0xcd0d('0x91')]);_0x4376f4[_0xcd0d('0x91')]=undefined;loggerPredictive['info'](_0x4376f4['name'],_0xcd0d('0x92'));}}}function erlangb(_0x215247,_0x56b095){if(_0x56b095===0x0){return 0x0;}var _0x55c9f7=0x1;for(var _0x571032=0x1;_0x571032<=_0x56b095;_0x571032+=0x1){_0x55c9f7=0x1+_0x55c9f7*_0x571032/_0x215247;}return 0x1/_0x55c9f7;}function isVoiceQueueOutbound(_0x53876e){return _0x53876e==='outbound';}function isNotPreview(_0x3fae4f){return _0x3fae4f!=='preview';}function isCampaignIvr(_0x4bc206){return _0x4bc206===_0xcd0d('0x78');}function getCallerId(_0xb1bce5,_0x51d7b8,_0x30b983){if(!_[_0xcd0d('0x3e')](_0x30b983)&&_0xcd0d('0x93')===typeof _0x30b983&&!_[_0xcd0d('0x47')](_0x30b983)){if(!_[_0xcd0d('0x3e')](_0x51d7b8)&&_0xcd0d('0x93')===typeof _0x51d7b8&&!_[_0xcd0d('0x47')](_0x51d7b8)){return util[_0xcd0d('0x79')]('\x22%s\x22\x20<%s>',_0x51d7b8,_0x30b983);}return util['format'](_0xcd0d('0x94'),_0x30b983,_0x30b983);}if(!_['isUndefined'](_0xb1bce5)&&_0xcd0d('0x93')===typeof _0xb1bce5&&!_[_0xcd0d('0x47')](_0xb1bce5)){return _0xb1bce5;}return _0xcd0d('0x95');}function loggerCatchQueueSummary(_0x528c62,_0x5dbff0){return function(_0x22f2bf){freeVariablesPredictive(_0x5dbff0);emitVoiceQueueSummary(_0x5dbff0);emitCampaignSummary(_0x5dbff0);loggerSyncQueueSummary[_0xcd0d('0x96')](_0x528c62,util[_0xcd0d('0x97')](_0x22f2bf,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x47df7d,_0x8fd609){return function(_0x7d8a1d){loggerPredictive[_0xcd0d('0x96')](_0x8fd609['name'],_0x47df7d);loggerPredictive[_0xcd0d('0x96')](_0x7d8a1d[_0xcd0d('0x98')]);freeVariablesPredictive(_0x8fd609);};}function loggerCatch(_0x397931){return function(_0x32c695){logger['error'](_0x397931,util[_0xcd0d('0x97')](_0x32c695,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x5dd266){return _0x5dd266&&!_[_0xcd0d('0x3e')](_0x5dd266)&&_0x5dd266[_0xcd0d('0x99')]>0x0;}function decremetOriginate(_0x30e719){if(!_[_0xcd0d('0x3e')](_0x30e719)&&_0x30e719!==null){if(_0x30e719[_0xcd0d('0x9a')](_0xcd0d('0x6e'))){if(_0x30e719['originated']>0x0){_0x30e719['originated']-=0x1;}else{logger[_0xcd0d('0x96')](_0xcd0d('0x9b'));}}}else{logger['error']('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x3978e1,_0x5a7c40,_0x26a7a1){if(_0x5a7c40>_0x26a7a1){for(var _0x5d3644=0x0;_0x5d3644<_0x5a7c40-_0x26a7a1;_0x5d3644+=0x1){decremetOriginate(_0x3978e1);}}}function loggerGetContactDialer(_0x3c0375,_0x31cbee,_0x2345f1){return function(_0x559c9f){checkContactLowerLimitOriginate(_0x31cbee,_0x2345f1,0x0);logger[_0xcd0d('0x96')](_0x3c0375,util['inspect'](_0x559c9f,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x2beb9a){return function(_0x575f56){if(isNotNull(_0x575f56)&&isNotNull(_0x575f56[0x0])){if(_0x575f56[0x0][_0xcd0d('0x9c')]>0x0){_0x2beb9a['message']=_0xcd0d('0x9d');logger['info'](_0xcd0d('0x9e')+_0x2beb9a[_0xcd0d('0x41')],_0x575f56[0x0][_0xcd0d('0x9c')],'contacts');}else{_0x2beb9a['message']=_0xcd0d('0x9f');logger['info'](_0xcd0d('0xa0')+_0x2beb9a[_0xcd0d('0x41')]);}}};}function notSendMessagesQueue(_0x300433){if(_0x300433[_0xcd0d('0xa1')]){freeVariablesPredictive(_0x300433);if(_0x300433['originated']===0x0&&_0x300433[_0xcd0d('0x52')]===0x0&&_0x300433['waiting']===0x0&&(_0x300433[_0xcd0d('0x50')]||0x0)===0x0){_0x300433[_0xcd0d('0xa1')]=![];_0x300433[_0xcd0d('0x4f')]=0x0;_0x300433['message']='NOT_ACTIVE';loggerSyncQueueSummary[_0xcd0d('0x96')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x300433[_0xcd0d('0x41')],'is\x20not\x20active');}else{_0x300433[_0xcd0d('0x3f')]='IS_DISACTIVED';loggerSyncQueueSummary[_0xcd0d('0x96')](_0xcd0d('0xa2'),_0x300433[_0xcd0d('0x41')],_0xcd0d('0xa3'));}emitVoiceQueueSummary(_0x300433);}}function notSendMessagesCampaign(_0x2467fc){if(_0x2467fc[_0xcd0d('0xa1')]){if(_0x2467fc['originated']===0x0){_0x2467fc[_0xcd0d('0xa1')]=![];_0x2467fc[_0xcd0d('0x3f')]='NOT_ACTIVE';loggerSyncQueueSummary[_0xcd0d('0x96')](_0xcd0d('0xa4'),_0x2467fc[_0xcd0d('0x41')],'is\x20not\x20active');}else{_0x2467fc['message']=_0xcd0d('0xa5');loggerSyncQueueSummary[_0xcd0d('0x96')](_0xcd0d('0xa4'),_0x2467fc[_0xcd0d('0x41')],_0xcd0d('0xa3'));}emitCampaignSummary(_0x2467fc);}}function createObjHistory(_0x386542,_0x1819da,_0x6debdf,_0x432768,_0x39c845){_0x386542[_0xcd0d('0x3f')]=_0x6debdf;var _0x5c4e31=new Action(_0x386542,_0x1819da);var _0x4f4007=new History(_0x5c4e31);_0x4f4007['state']=_0x432768;_0x4f4007['statedesc']=_0x39c845;_0x4f4007[_0xcd0d('0xa6')]=_0x5c4e31['starttime'];return _0x4f4007;}Dialer[_0xcd0d('0x1b')][_0xcd0d('0x3d')]=function(){var _0x589b79=this;setInterval(function(){_0x589b79['clearZombieChannels'](_0x589b79[_0xcd0d('0x28')],'[uniqueid]');_0x589b79[_0xcd0d('0xa7')](_0x589b79[_0xcd0d('0x27')],'[actions]');},0x32c8);};Dialer[_0xcd0d('0x1b')][_0xcd0d('0xa7')]=function(_0x10486b,_0x59a518){var _0x2edc55=this;for(var _0x3e18f8 in _0x10486b){if(_0x10486b[_0xcd0d('0x9a')](_0x3e18f8)){this[_0xcd0d('0x1f')][_0xcd0d('0x1c')](function(){if(!_[_0xcd0d('0xa8')](_0x10486b[_0x3e18f8])){return ami[_0xcd0d('0xa9')]({'action':_0xcd0d('0xaa'),'channel':_0x10486b[_0x3e18f8][_0xcd0d('0xab')]})[_0xcd0d('0xac')](function(_0x4e53eb){if(_0x4e53eb[_0xcd0d('0x3f')]===_0xcd0d('0xad')){setTimeout(function(){if(_0x10486b[_0x3e18f8]&&_0x10486b[_0x3e18f8][_0xcd0d('0x54')]!==_0xcd0d('0x78')){_0x2edc55[_0xcd0d('0xae')](_0x2edc55[_0xcd0d('0x21')][_0x10486b[_0x3e18f8][_0xcd0d('0xaf')]]);logger['error'](_0xcd0d('0xb0'),_0x59a518,_0x3e18f8,_0x10486b[_0x3e18f8]['queue']);delete _0x10486b[_0x3e18f8];}if(_0x10486b[_0x3e18f8]&&_0x10486b[_0x3e18f8][_0xcd0d('0x54')]===_0xcd0d('0x78')){_0x2edc55[_0xcd0d('0xae')](_0x2edc55[_0xcd0d('0x22')][_0x10486b[_0x3e18f8]['queue']]);logger['error'](_0xcd0d('0xb1'),_0x59a518,_0x3e18f8,_0x10486b[_0x3e18f8][_0xcd0d('0xaf')]);delete _0x10486b[_0x3e18f8];}},0x2328);}});}});}}};Dialer['prototype'][_0xcd0d('0xb2')]=function(_0x25e313){return BPromise[_0xcd0d('0xb3')]()['then'](cmHopper[_0xcd0d('0xb2')](_0x25e313))[_0xcd0d('0xac')](loggerCatch('[countReScheduled]\x20'));};Dialer[_0xcd0d('0x1b')][_0xcd0d('0xb4')]=function(_0x1b2d27){return BPromise['resolve']()['then'](cmHopperBlack[_0xcd0d('0xb4')](_0x1b2d27))[_0xcd0d('0xac')](loggerCatch('[checkIsBlackList]\x20'));};Dialer['prototype']['checkIsBlackListIvr']=function(_0x36fa3c){return BPromise[_0xcd0d('0xb3')]()[_0xcd0d('0xb5')](cmHopperBlack[_0xcd0d('0xb6')](_0x36fa3c))[_0xcd0d('0xac')](loggerCatch(_0xcd0d('0xb7')));};Dialer[_0xcd0d('0x1b')][_0xcd0d('0xb8')]=function(_0x1ae898){return BPromise['resolve']()[_0xcd0d('0xb5')](cmHopperHistory['avgHandleTime'](_0x1ae898))['catch'](loggerCatch('[averageHandleTime]\x20'));};Dialer[_0xcd0d('0x1b')][_0xcd0d('0xb9')]=function(_0x2e42e7){return BPromise['resolve']()[_0xcd0d('0xb5')](cmHopper['rescheduleContact'](_0x2e42e7))['catch'](loggerCatch(_0xcd0d('0xba')));};Dialer[_0xcd0d('0x1b')][_0xcd0d('0xbb')]=function(_0x54437e,_0xa8ca0,_0x2f69a0,_0x184cee){return BPromise[_0xcd0d('0xb3')]()[_0xcd0d('0xb5')](cmHopper['getContactDialer'](_0x54437e,_0xa8ca0,_0x2f69a0,_0x184cee))[_0xcd0d('0xac')](loggerCatch(_0xcd0d('0xbc')));};Dialer[_0xcd0d('0x1b')][_0xcd0d('0xbd')]=function(_0x438cd0,_0x5c3d08,_0x32b689){return BPromise[_0xcd0d('0xb3')]()[_0xcd0d('0xb5')](cmHopper['getContactDialerIvr'](_0x438cd0,_0x5c3d08,_0x32b689))[_0xcd0d('0xac')](loggerCatch(_0xcd0d('0xbc')));};Dialer[_0xcd0d('0x1b')][_0xcd0d('0xbe')]=function(_0x2d4b5b){return BPromise[_0xcd0d('0xb3')]()['then'](voiceQueueRt[_0xcd0d('0xbe')](_0x2d4b5b))[_0xcd0d('0xac')](loggerCatch(_0xcd0d('0xbf')));};Dialer[_0xcd0d('0x1b')][_0xcd0d('0xc0')]=function(_0x2ac0b9){return BPromise['resolve']()['then'](cmHopper[_0xcd0d('0xc0')](_0x2ac0b9))['catch'](loggerCatch(_0xcd0d('0xc1')));};Dialer[_0xcd0d('0x1b')][_0xcd0d('0xc2')]=function(_0x3cc551){return BPromise['resolve']()['then'](cmHopperHistory['createHistory'](_0x3cc551))['catch'](loggerCatch('[createHistory]\x20'));};Dialer[_0xcd0d('0x1b')][_0xcd0d('0xae')]=function(_0x20da29){if(!_['isUndefined'](_0x20da29)&&_0x20da29!==null){if(_0x20da29[_0xcd0d('0x9a')](_0xcd0d('0x6e'))){if(_0x20da29[_0xcd0d('0x6e')]>0x0){_0x20da29[_0xcd0d('0x6e')]-=0x1;}else{logger['error'](_0xcd0d('0xc3'));}}}else{logger['error'](_0xcd0d('0xc4'));}};Dialer[_0xcd0d('0x1b')]['loggerHandler']=function(_0xf6f9bd,_0x4a7027){var _0x12cfe7=this;return function(_0x140d94){_0x12cfe7[_0xcd0d('0xae')](_0x4a7027);logger[_0xcd0d('0x96')](_0xf6f9bd,util[_0xcd0d('0x97')](_0x140d94,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0xcd0d('0xc5')]=function(_0x3fc843,_0x3afec1,_0x28ac84){var _0x2eb802={'state':0x19,'statedesc':_0xcd0d('0xc6')};this[_0xcd0d('0xae')](_0x3afec1);this[_0xcd0d('0xc7')](_[_0xcd0d('0x8e')](_0x2eb802,_[_0xcd0d('0xc8')](_0x28ac84,['ContactId',_0xcd0d('0xc9'),_0xcd0d('0xca'),_0xcd0d('0xcb'),'CampaignId'])),_0xcd0d('0xcc'),_0xcd0d('0xcd'));logger[_0xcd0d('0x96')](_0x3fc843);};Dialer[_0xcd0d('0x1b')][_0xcd0d('0xce')]=function(_0x53d4dc){return _0x53d4dc===_0xcd0d('0xcf');};Dialer[_0xcd0d('0x1b')]['isTrunkReachable']=function(_0x65fb13){return!_[_0xcd0d('0x3e')](_0x65fb13)&&_0x65fb13&&!_['isUndefined'](_0x65fb13[_0xcd0d('0x41')])&&!_['isUndefined'](_0x65fb13[_0xcd0d('0x74')])&&_0x65fb13['active']&&(this[_0xcd0d('0x24')][util[_0xcd0d('0x79')]('SIP/%s',_0x65fb13[_0xcd0d('0x41')])][_0xcd0d('0xaa')]===_0xcd0d('0xd0')||this[_0xcd0d('0x24')][util[_0xcd0d('0x79')]('SIP/%s',_0x65fb13['name'])][_0xcd0d('0xaa')]===_0xcd0d('0xd1'));};Dialer[_0xcd0d('0x1b')][_0xcd0d('0xc7')]=function(_0x14e8eb,_0x41cd3a,_0x588d4f){this[_0xcd0d('0xc2')](_0x14e8eb)[_0xcd0d('0xac')](loggerCatch(_0x41cd3a));this[_0xcd0d('0xc0')](_0x14e8eb)[_0xcd0d('0xac')](loggerCatch(_0x588d4f));};Dialer[_0xcd0d('0x1b')][_0xcd0d('0x38')]=function(_0x2a6f84){var _0x5992b9=this['uniqueId'][_0x2a6f84['uniqueid']];var _0x328cc6;if(!_[_0xcd0d('0xa8')](_0x2a6f84)&&!_[_0xcd0d('0xa8')](_0x2a6f84[_0xcd0d('0xd2')])&&!_[_0xcd0d('0xa8')](_0x2a6f84[_0xcd0d('0xd2')]['amdstatus'])&&_0x2a6f84[_0xcd0d('0xd3')]===_0xcd0d('0xd4')&&_0x5992b9){if(_0x5992b9[_0xcd0d('0x54')]!==_0xcd0d('0x78')&&this[_0xcd0d('0x21')][_0x5992b9['queue']][_0xcd0d('0xd5')]&&_0x2a6f84[_0xcd0d('0xd6')]===_0xcd0d('0xd7')){delete this[_0xcd0d('0x28')][_0x2a6f84[_0xcd0d('0xd8')]];this['updateOriginated'](this[_0xcd0d('0x21')][_0x5992b9[_0xcd0d('0xaf')]]);this[_0xcd0d('0x21')][_0x5992b9[_0xcd0d('0xaf')]][_0xcd0d('0x5c')]+=0x1;this[_0xcd0d('0x21')][_0x5992b9[_0xcd0d('0xaf')]][_0xcd0d('0xd9')]+=0x1;_0x328cc6=new Hangup(_0x5992b9,_0x2a6f84);_0x328cc6[_0xcd0d('0xda')]=0x12;_0x328cc6['statedesc']=_0xcd0d('0xdb');_0x328cc6[_0xcd0d('0xdc')]='AMD';this[_0xcd0d('0xc7')](_0x328cc6,_0xcd0d('0xdd'),'[syncHangupInAMD]');}if(_0x5992b9['type']!==_0xcd0d('0x78')&&this['voiceQueues'][_0x5992b9['queue']][_0xcd0d('0xd5')]&&_0x2a6f84[_0xcd0d('0xd6')]===_0xcd0d('0xde')){delete this[_0xcd0d('0x28')][_0x2a6f84[_0xcd0d('0xd8')]];this[_0xcd0d('0xae')](this[_0xcd0d('0x21')][_0x5992b9[_0xcd0d('0xaf')]]);this[_0xcd0d('0x21')][_0x5992b9[_0xcd0d('0xaf')]][_0xcd0d('0x5c')]+=0x1;this[_0xcd0d('0x21')][_0x5992b9[_0xcd0d('0xaf')]][_0xcd0d('0xd9')]+=0x1;_0x328cc6=new Hangup(_0x5992b9,_0x2a6f84);_0x328cc6[_0xcd0d('0xda')]=0x13;_0x328cc6['statedesc']=_0xcd0d('0xdf');_0x328cc6[_0xcd0d('0xdc')]=_0xcd0d('0xe0');_0x328cc6[_0xcd0d('0xe1')]=!![];this[_0xcd0d('0xc7')](_0x328cc6,_0xcd0d('0xe2'),_0xcd0d('0xe3'));}if(_0x5992b9[_0xcd0d('0x54')]==='ivr'&&this[_0xcd0d('0x22')][_0x5992b9[_0xcd0d('0xaf')]][_0xcd0d('0xd5')]&&_0x2a6f84['value']===_0xcd0d('0xd7')){delete this[_0xcd0d('0x28')][_0x2a6f84[_0xcd0d('0xd8')]];this[_0xcd0d('0xae')](this[_0xcd0d('0x22')][_0x5992b9['queue']]);_0x328cc6=new Hangup(_0x5992b9,_0x2a6f84);_0x328cc6[_0xcd0d('0xda')]=0x12;_0x328cc6[_0xcd0d('0xe4')]=_0xcd0d('0xdb');_0x328cc6[_0xcd0d('0xdc')]='AMD';this[_0xcd0d('0xc7')](_0x328cc6,_0xcd0d('0xe5'),'[syncHangupInAMDIvr]');}if(_0x5992b9['type']===_0xcd0d('0x78')&&this['campaigns'][_0x5992b9[_0xcd0d('0xaf')]][_0xcd0d('0xd5')]&&_0x2a6f84['value']===_0xcd0d('0xde')){delete this['uniqueId'][_0x2a6f84[_0xcd0d('0xd8')]];this['updateOriginated'](this['campaigns'][_0x5992b9[_0xcd0d('0xaf')]]);_0x328cc6=new Hangup(_0x5992b9,_0x2a6f84);_0x328cc6[_0xcd0d('0xda')]=0x13;_0x328cc6['statedesc']='Machine';_0x328cc6['membername']=_0xcd0d('0xe0');_0x328cc6[_0xcd0d('0xe1')]=!![];this[_0xcd0d('0xc7')](_0x328cc6,_0xcd0d('0xe6'),_0xcd0d('0xe7'));}}};Dialer[_0xcd0d('0x1b')][_0xcd0d('0x35')]=function(_0x152674){var _0x19eff9=this['uniqueId'][_0x152674['uniqueid']];var _0x4bc9b4=this;var _0x132161;if(_0x19eff9&&_0x19eff9[_0xcd0d('0x54')]===_0xcd0d('0x78')){delete this['uniqueId'][_0x152674[_0xcd0d('0xd8')]];this[_0xcd0d('0xae')](this[_0xcd0d('0x22')][_0x19eff9[_0xcd0d('0xaf')]]);this[_0xcd0d('0x22')][_0x19eff9[_0xcd0d('0xaf')]][_0xcd0d('0xe8')]+=0x1;_0x132161=new Hangup(_0x19eff9,_0x152674);this['createHistory'](_0x132161)['catch'](loggerCatch(_0xcd0d('0xe9')));this[_0xcd0d('0xc0')](_0x132161)[_0xcd0d('0xac')](loggerCatch('[syncHangupIvr]'));}if(_0x19eff9&&_0x19eff9[_0xcd0d('0x54')]!==_0xcd0d('0x78')&&isNotNull(this['voiceQueues'][_0x19eff9[_0xcd0d('0xaf')]][_0xcd0d('0xea')])){delete this['uniqueId'][_0x152674[_0xcd0d('0xd8')]];this[_0xcd0d('0xae')](this[_0xcd0d('0x21')][_0x19eff9[_0xcd0d('0xaf')]]);this['voiceQueues'][_0x19eff9['queue']]['outboundAnswerCallsDay']+=0x1;this['voiceQueues'][_0x19eff9['queue']][_0xcd0d('0xd9')]+=0x1;_0x132161=new Hangup(_0x19eff9,_0x152674);_0x132161[_0xcd0d('0xda')]=0x10;_0x132161[_0xcd0d('0xe4')]='AnswerAGI';_0x132161['membername']=_0xcd0d('0xeb');this['createHistory'](_0x132161)['catch'](loggerCatch(_0xcd0d('0xe9')));this[_0xcd0d('0xc0')](_0x132161)['catch'](loggerCatch(_0xcd0d('0xec')));}if(_0x19eff9&&_0x19eff9[_0xcd0d('0x54')]!==_0xcd0d('0x78')&&!isNotNull(this[_0xcd0d('0x21')][_0x19eff9[_0xcd0d('0xaf')]][_0xcd0d('0xea')])){delete this[_0xcd0d('0x28')][_0x152674[_0xcd0d('0xd8')]];this[_0xcd0d('0xae')](this['voiceQueues'][_0x19eff9[_0xcd0d('0xaf')]]);this[_0xcd0d('0x21')][_0x19eff9[_0xcd0d('0xaf')]][_0xcd0d('0x66')]+=0x1;_0x132161=new Hangup(_0x19eff9,_0x152674);_0x132161[_0xcd0d('0xda')]=0xc;_0x132161[_0xcd0d('0xe4')]=_0x152674[_0xcd0d('0xed')];_0x132161[_0xcd0d('0xdc')]=_0xcd0d('0xee');this['createHistory'](_0x132161)[_0xcd0d('0xac')](loggerCatch(_0xcd0d('0xe9')));this[_0xcd0d('0xc0')](_0x132161)['catch'](loggerCatch(_0xcd0d('0xec')));}};Dialer['prototype'][_0xcd0d('0xef')]=function(_0x4a601a){var _0x1380b1=this[_0xcd0d('0x28')][_0x4a601a['uniqueid']];var _0x15a735=this;if(this[_0xcd0d('0x21')][_0x4a601a['queue']]){if(_0x1380b1&&_0x1380b1[_0xcd0d('0x54')]!==_0xcd0d('0x78')){delete this[_0xcd0d('0x28')][_0x4a601a['uniqueid']];this[_0xcd0d('0x21')][_0x4a601a[_0xcd0d('0xaf')]]['outboundAnswerCallsDay']+=0x1;var _0xbf84a5=new AgentComplete(_0x1380b1,_0x4a601a);if(_0x4a601a[_0xcd0d('0xf0')]==='agent'){_0xbf84a5[_0xcd0d('0xf1')]=this[_0xcd0d('0x21')][_0x4a601a['queue']][_0xcd0d('0xf2')]&&this[_0xcd0d('0x21')][_0x4a601a['queue']][_0xcd0d('0xf3')]?moment()[_0xcd0d('0x79')](_0xcd0d('0xf4')):undefined;}this[_0xcd0d('0xc2')](_0xbf84a5)[_0xcd0d('0xac')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0xcd0d('0xc0')](_0xbf84a5)['catch'](loggerCatch(_0xcd0d('0xf5')));}}};Dialer[_0xcd0d('0x1b')][_0xcd0d('0xf6')]=function(_0x236df9){if(this['voiceQueues'][_0x236df9[_0xcd0d('0xaf')]]){if(this[_0xcd0d('0x28')][_0x236df9[_0xcd0d('0xd8')]]&&this[_0xcd0d('0x28')][_0x236df9[_0xcd0d('0xd8')]]['type']!=='ivr'){this[_0xcd0d('0xae')](this[_0xcd0d('0x21')][_0x236df9[_0xcd0d('0xaf')]]);this['uniqueId'][_0x236df9[_0xcd0d('0xd8')]]['answertime']=moment()[_0xcd0d('0x79')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0xcd0d('0x1b')][_0xcd0d('0xf7')]=function(_0x47d86a){this['createHistory'](_0x47d86a)[_0xcd0d('0xac')](loggerCatch(_0xcd0d('0xf8')));this[_0xcd0d('0xc0')](_0x47d86a)['catch'](loggerCatch(_0xcd0d('0xf9')));};Dialer[_0xcd0d('0x1b')][_0xcd0d('0x30')]=function(_0x5bf090){var _0x24fa06=this[_0xcd0d('0x28')][_0x5bf090[_0xcd0d('0xd8')]];var _0x226a52=this;if(this[_0xcd0d('0x21')][_0x5bf090[_0xcd0d('0xaf')]]){if(_0x24fa06&&_0x24fa06[_0xcd0d('0x54')]!=='ivr'){delete this[_0xcd0d('0x28')][_0x5bf090['uniqueid']];this[_0xcd0d('0xae')](this[_0xcd0d('0x21')][_0x5bf090['queue']]);_0x24fa06[_0xcd0d('0xfa')]=moment()[_0xcd0d('0x79')](_0xcd0d('0xf4'));var _0xe3cc69=new QueueCallerAbandon(_0x24fa06,_0x5bf090);if(getSeconds(_0x24fa06[_0xcd0d('0xfa')],_0x24fa06[_0xcd0d('0xfb')])>=_0x24fa06[_0xcd0d('0xfc')]){this[_0xcd0d('0x21')][_0x5bf090['queue']][_0xcd0d('0x69')]+=0x1;this[_0xcd0d('0x21')][_0x5bf090[_0xcd0d('0xaf')]][_0xcd0d('0xfd')]+=0x1;this[_0xcd0d('0x21')][_0x5bf090[_0xcd0d('0xaf')]][_0xcd0d('0x6b')]+=0x1;_0xe3cc69['state']=0xa;_0xe3cc69[_0xcd0d('0xe4')]=_0xcd0d('0xfe');_0xe3cc69[_0xcd0d('0xff')]=_0xcd0d('0x100');_0xe3cc69['agiafterat']=this['voiceQueues'][_0x5bf090['queue']][_0xcd0d('0xf2')]?moment()[_0xcd0d('0x79')](_0xcd0d('0xf4')):undefined;this[_0xcd0d('0xf7')](_0xe3cc69);}else{this[_0xcd0d('0x21')][_0x5bf090[_0xcd0d('0xaf')]][_0xcd0d('0x68')]+=0x1;this[_0xcd0d('0x21')][_0x5bf090[_0xcd0d('0xaf')]][_0xcd0d('0x60')]+=0x1;_0xe3cc69[_0xcd0d('0xda')]=0xb;_0xe3cc69['statedesc']=_0xcd0d('0x101');_0xe3cc69[_0xcd0d('0xff')]=_0xcd0d('0x102');this[_0xcd0d('0xf7')](_0xe3cc69);}}}};Dialer[_0xcd0d('0x1b')][_0xcd0d('0x37')]=function(_0xe8087c){if(this[_0xcd0d('0x27')][_0xe8087c[_0xcd0d('0xd8')]]){this['actions'][_0xe8087c['uniqueid']]['channel']=_0xe8087c[_0xcd0d('0xab')];}if(this[_0xcd0d('0x28')][_0xe8087c[_0xcd0d('0xd8')]]){this[_0xcd0d('0x28')][_0xe8087c[_0xcd0d('0xd8')]][_0xcd0d('0xab')]=_0xe8087c[_0xcd0d('0xab')];}};Dialer[_0xcd0d('0x1b')][_0xcd0d('0x39')]=function(_0x1421a0){if(strategy[this['voiceQueues'][this[_0xcd0d('0x27')][_0x1421a0[_0xcd0d('0x103')]][_0xcd0d('0xaf')]][_0xcd0d('0x4d')]]===_0xcd0d('0x1a')){if(this[_0xcd0d('0x27')][_0x1421a0[_0xcd0d('0x103')]]&&_[_0xcd0d('0xa8')](this[_0xcd0d('0x27')][_0x1421a0[_0xcd0d('0x103')]][_0xcd0d('0x104')])&&_0x1421a0[_0xcd0d('0xaa')]==='1'&&_0x1421a0[_0xcd0d('0x105')]==='0'){if(this[_0xcd0d('0x23')][_0x1421a0[_0xcd0d('0x106')]]){if(!this['agents'][_0x1421a0['stateinterface']][_0xcd0d('0x104')]){this['agents'][_0x1421a0['stateinterface']][_0xcd0d('0x104')]=!![];this['actions'][_0x1421a0[_0xcd0d('0x103')]][_0xcd0d('0x104')]=!![];this[_0xcd0d('0x27')][_0x1421a0[_0xcd0d('0x103')]][_0xcd0d('0x106')]=_0x1421a0[_0xcd0d('0x106')];}}}}else if((strategy[this['voiceQueues'][this[_0xcd0d('0x27')][_0x1421a0['actionid']]['queue']][_0xcd0d('0x4d')]]||'rrmemory')===_0xcd0d('0x19')){if(this[_0xcd0d('0x27')][_0x1421a0[_0xcd0d('0x103')]]){if(this[_0xcd0d('0x23')][_0x1421a0[_0xcd0d('0x106')]]){this[_0xcd0d('0x27')][_0x1421a0[_0xcd0d('0x103')]][_0xcd0d('0x106')]=_0x1421a0['stateinterface'];if(_['isNil'](this['queueBooked'][this['actions'][_0x1421a0[_0xcd0d('0x103')]][_0xcd0d('0xaf')]])){this[_0xcd0d('0x2b')][this[_0xcd0d('0x27')][_0x1421a0[_0xcd0d('0x103')]][_0xcd0d('0xaf')]]=[];}this[_0xcd0d('0x2b')][this[_0xcd0d('0x27')][_0x1421a0['actionid']][_0xcd0d('0xaf')]][_0xcd0d('0x107')](_[_0xcd0d('0x8e')](_[_0xcd0d('0xc8')](this[_0xcd0d('0x27')][_0x1421a0[_0xcd0d('0x103')]],[_0xcd0d('0x108'),_0xcd0d('0x106')]),{'status':_0x1421a0[_0xcd0d('0xaa')],'paused':_0x1421a0[_0xcd0d('0x105')]}));}}}};function unlockQueueStatus(_0x1be8fe,_0xc1e25d){setTimeout(function(){if(_[_0xcd0d('0x3e')](_0x1be8fe[_0xcd0d('0x109')])){loggerBooked[_0xcd0d('0x96')](_0xcd0d('0x10a'),_0xc1e25d);}_0x1be8fe[_0xcd0d('0x109')]=!![];loggerBooked[_0xcd0d('0x7a')](_0xcd0d('0x10b'),_0xc1e25d,JSON['stringify'](_[_0xcd0d('0xc8')](_0x1be8fe,[_0xcd0d('0x41'),_0xcd0d('0x109')])));},0x1f3);}Dialer['prototype'][_0xcd0d('0x3b')]=function(_0x2dc010){var _0x48d9f4=this;var _0x5a453b=_0x48d9f4['voiceQueues'][_0x48d9f4[_0xcd0d('0x27')][_0x2dc010['actionid']]['queue']];if(strategy[this[_0xcd0d('0x21')][this['actions'][_0x2dc010[_0xcd0d('0x103')]][_0xcd0d('0xaf')]][_0xcd0d('0x4d')]]===_0xcd0d('0x1a')){if(this['actions'][_0x2dc010[_0xcd0d('0x103')]]&&this[_0xcd0d('0x27')][_0x2dc010[_0xcd0d('0x103')]][_0xcd0d('0x106')]){this[_0xcd0d('0x20')]['run'](this['actions'][_0x2dc010[_0xcd0d('0x103')]]['idHopper'],this[_0xcd0d('0x27')][_0x2dc010[_0xcd0d('0x103')]]['stateinterface'])[_0xcd0d('0xac')](function(_0x40dfe9){logger[_0xcd0d('0x96')](_0xcd0d('0x10c'),util[_0xcd0d('0x97')](_0x40dfe9,{'showHidden':![],'depth':null}));})[_0xcd0d('0x1e')](function(){_0x48d9f4[_0xcd0d('0xae')](_0x48d9f4[_0xcd0d('0x21')][_0x48d9f4[_0xcd0d('0x27')][_0x2dc010[_0xcd0d('0x103')]][_0xcd0d('0xaf')]]);_0x48d9f4[_0xcd0d('0x23')][_0x48d9f4[_0xcd0d('0x27')][_0x2dc010['actionid']][_0xcd0d('0x106')]]['locked']=![];delete _0x48d9f4[_0xcd0d('0x27')][_0x2dc010[_0xcd0d('0x103')]];unlockQueueStatus(_0x5a453b);});}else{this['updateOriginated'](this[_0xcd0d('0x21')][this[_0xcd0d('0x27')][_0x2dc010[_0xcd0d('0x103')]][_0xcd0d('0xaf')]]);this[_0xcd0d('0xb9')]({'active':![],'ContactId':this[_0xcd0d('0x27')][_0x2dc010[_0xcd0d('0x103')]][_0xcd0d('0x10d')],'ListId':this[_0xcd0d('0x27')][_0x2dc010['actionid']]['ListId'],'VoiceQueueId':this['actions'][_0x2dc010[_0xcd0d('0x103')]]['VoiceQueueId']||undefined,'CampaignId':this[_0xcd0d('0x27')][_0x2dc010[_0xcd0d('0x103')]][_0xcd0d('0x10e')]||undefined})['catch'](loggerCatch(_0xcd0d('0x10f')));delete this[_0xcd0d('0x27')][_0x2dc010['actionid']];unlockQueueStatus(_0x5a453b);}}else if((strategy[this['voiceQueues'][this[_0xcd0d('0x27')][_0x2dc010[_0xcd0d('0x103')]]['queue']]['strategy']]||_0xcd0d('0x19'))===_0xcd0d('0x19')){var _0x1d8ba9;if(this[_0xcd0d('0x27')][_0x2dc010['actionid']]&&!_[_0xcd0d('0x47')](this['queueBooked'][this[_0xcd0d('0x27')][_0x2dc010[_0xcd0d('0x103')]][_0xcd0d('0xaf')]])){if(this['queueBookedRR'][_0x48d9f4['actions'][_0x2dc010[_0xcd0d('0x103')]]['queue']]){this[_0xcd0d('0x2c')][_0x48d9f4[_0xcd0d('0x27')][_0x2dc010[_0xcd0d('0x103')]]['queue']]=this[_0xcd0d('0x2c')][this[_0xcd0d('0x27')][_0x2dc010[_0xcd0d('0x103')]][_0xcd0d('0xaf')]]?this[_0xcd0d('0x2c')][this[_0xcd0d('0x27')][_0x2dc010[_0xcd0d('0x103')]]['queue']]:this[_0xcd0d('0x2b')][this[_0xcd0d('0x27')][_0x2dc010[_0xcd0d('0x103')]][_0xcd0d('0xaf')]]?this[_0xcd0d('0x2b')][this[_0xcd0d('0x27')][_0x2dc010[_0xcd0d('0x103')]][_0xcd0d('0xaf')]][_0xcd0d('0x110')]||0x0:0x0;}this[_0xcd0d('0x2b')][this['actions'][_0x2dc010[_0xcd0d('0x103')]][_0xcd0d('0xaf')]][_0xcd0d('0x110')]=this[_0xcd0d('0x2c')][this[_0xcd0d('0x27')][_0x2dc010[_0xcd0d('0x103')]][_0xcd0d('0xaf')]];for(var _0xdaaaa=0x0;_0xdaaaa=0x0?!![]:![];})['catch'](myreject(_0x53caf1)));}}else{_0x155fe4[_0xcd0d('0x107')](ami['Action']({'action':_0xcd0d('0x128'),'command':util[_0xcd0d('0x79')]('iftime\x20%s,%s',_0x1b53fa,!_[_0xcd0d('0x3e')](config[_0xcd0d('0x124')][_0x366feb])?_0x366feb:'')})[_0xcd0d('0xb5')](function(_0x23de8d){return _0x23de8d[_0xcd0d('0x12b')]['indexOf']('true')>=0x0?!![]:![];})[_0xcd0d('0xac')](myreject(_0x53caf1)));}BPromise[_0xcd0d('0x12d')](_0x155fe4)[_0xcd0d('0xb5')](function(_0x4bd2de){var _0x4d40f0=_[_0xcd0d('0x12e')](_0x4bd2de);if(_0x4d40f0){return _0x438833(_0x4d40f0);}else{_0x48f837[_0xcd0d('0x3f')]=_0x16ec28?_0xcd0d('0x12f'):_0xcd0d('0x130');return _0x53caf1(msgResponse(_0xcd0d('0x131'),_0xcd0d('0x121'),_0xcd0d('0x132')+_0x16ec28+'\x20'+_0x3a6f2d+'\x20Interval\x20is\x20overtime:\x20'+util[_0xcd0d('0x97')](_0x1b53fa,{'showHidden':![],'depth':null})+_0xcd0d('0x133')+_0x366feb));}})[_0xcd0d('0xac')](function(_0x952c9f){return _0x53caf1(msgResponse(_0xcd0d('0x11f'),'Failure',JSON['stringify'](_0x952c9f)));});});};Dialer['prototype'][_0xcd0d('0x134')]=function(_0x5a5882){var _0x18c131=this;return function(){switch(_0x5a5882[_0xcd0d('0x135')]){case _0xcd0d('0x136'):freeVariablesPredictive(_0x5a5882);_0x18c131['handlePower'](_0x5a5882,0x1);break;case _0xcd0d('0x137'):freeVariablesPredictive(_0x5a5882);_0x18c131['handlePower'](_0x5a5882,_0x5a5882[_0xcd0d('0x138')]);break;case _0xcd0d('0x8'):_0x18c131['predictive'](_0x5a5882);break;case _0xcd0d('0x7'):freeVariablesPredictive(_0x5a5882);_0x18c131['handlePower'](_0x5a5882,0x1);break;default:freeVariablesPredictive(_0x5a5882);logger[_0xcd0d('0x96')](_0xcd0d('0x139'),_0x5a5882[_0xcd0d('0x41')],_0xcd0d('0x13a'));}};};Dialer[_0xcd0d('0x1b')][_0xcd0d('0x13b')]=function(_0x7812c2){var _0xfc1a1a=this;return function(){_0xfc1a1a['handleIvr'](_0x7812c2);};};Dialer['prototype'][_0xcd0d('0xa')]=function(_0x444f30){var _0x59b8cd=this;if(isNotPreview(_0x444f30['dialMethod'])){if(isVoiceQueueOutbound(_0x444f30[_0xcd0d('0x54')])&&isActive(_0x444f30['dialActive'])){_0x444f30['sendMessageOneNotActive']=!![];BPromise[_0xcd0d('0xb3')]()[_0xcd0d('0xb5')](checkIsLoggedIn(_0x444f30,_0x444f30[_0xcd0d('0x13c')]))[_0xcd0d('0xb5')](checkIsActive(_0x444f30,_0x444f30['dialActive']))[_0xcd0d('0xb5')](checkInterval(_0x444f30))[_0xcd0d('0xb5')](_0x59b8cd[_0xcd0d('0x13d')](_0x444f30))[_0xcd0d('0xb5')](_0x59b8cd[_0xcd0d('0x11e')](_0x444f30[_0xcd0d('0x13e')],_0x444f30[_0xcd0d('0x13f')],_0x444f30[_0xcd0d('0x41')],_0x444f30))[_0xcd0d('0xb5')](_0x59b8cd[_0xcd0d('0x120')](_0x444f30[_0xcd0d('0x43')],_0x444f30['dialTimezone'],_0x444f30[_0xcd0d('0x41')],_0x444f30))['then'](_0x59b8cd[_0xcd0d('0x134')](_0x444f30))[_0xcd0d('0xac')](loggerCatchQueueSummary('[syncQueueSummary]',_0x444f30));}else{notSendMessagesQueue(_0x444f30);}}else{freeVariablesPredictive(_0x444f30);}};Dialer[_0xcd0d('0x1b')]['syncCampaigns']=function(){var _0x4170fc=this;var _0xecdf8d;for(var _0x44e560 in this['campaigns']){if(this[_0xcd0d('0x22')][_0xcd0d('0x9a')](_0x44e560)){_0xecdf8d=this[_0xcd0d('0x22')][_0x44e560];if(isCampaignIvr(_0xecdf8d['type'])&&isActive(_0xecdf8d[_0xcd0d('0x74')])){_0xecdf8d[_0xcd0d('0xa1')]=!![];BPromise[_0xcd0d('0xb3')]()[_0xcd0d('0xb5')](checkIsActive(_0xecdf8d,_0xecdf8d[_0xcd0d('0x74')]))['then'](checkInterval(_0xecdf8d))[_0xcd0d('0xb5')](_0x4170fc[_0xcd0d('0x13d')](_0xecdf8d))[_0xcd0d('0xb5')](_0x4170fc[_0xcd0d('0x11e')](_0xecdf8d[_0xcd0d('0x13e')],_0xecdf8d['dialTimezone'],_0xecdf8d['name'],_0xecdf8d))[_0xcd0d('0xb5')](_0x4170fc[_0xcd0d('0x120')](_0xecdf8d['Interval'],_0xecdf8d[_0xcd0d('0x13f')],_0xecdf8d[_0xcd0d('0x41')],_0xecdf8d))[_0xcd0d('0xb5')](_0x4170fc[_0xcd0d('0x13b')](_0xecdf8d))[_0xcd0d('0xac')](loggerCatchQueueSummary('[syncCampaigns]',_0xecdf8d));}else{notSendMessagesCampaign(_0xecdf8d);}}}};function getCallerIdRandom(_0x55df8f,_0x1341a1){var _0x1b0c9d,_0x13c954,_0xad7e4;if(_0x1341a1<=0x0){_0x1341a1=0x1;}_0x1b0c9d=new RegExp(_0xcd0d('0x140')+_0x1341a1+'}$');_0x13c954=Math['pow'](0xa,_0x1341a1-0x1);_0xad7e4=Math['pow'](0xa,_0x1341a1)-0x1;return util[_0xcd0d('0x79')]('%s',_[_0xcd0d('0x141')](_0x55df8f,_0x1b0c9d,_[_0xcd0d('0x142')](_0x13c954,_0xad7e4)));}function extractCalleridName(_0xb94537){var _0x3942ae=_0xb94537['match'](/"(.*?)"/);return _0x3942ae?_0x3942ae[0x1]:_0xb94537;}function extractCalleridNumber(_0xb4e7e8){var _0x133df9=_0xb4e7e8[_0xcd0d('0x143')](/<(.*?)>/);return _0x133df9?_0x133df9[0x1]:_0xb4e7e8;}Dialer['prototype'][_0xcd0d('0x144')]=function(_0xf15d8b,_0x2b6fd2){var _0x5828d4=this;var _0x52f7d6=uuid['v4']();this[_0xcd0d('0x27')][_0x52f7d6]=new Action(_0xf15d8b,_0x2b6fd2,_0x52f7d6);return new BPromise(function(_0x2b9758,_0x282247){if(_[_0xcd0d('0x3e')](_0xf15d8b)&&_0xcd0d('0x145')!==typeof _0xf15d8b){return _0x282247(msgResponse(_0xcd0d('0x146'),_0xcd0d('0x121'),'voiceQueue\x20is\x20undefine'));}if(_[_0xcd0d('0x3e')](_0x2b6fd2[_0xcd0d('0x147')]['phone'])||_0x2b6fd2['Contact'][_0xcd0d('0x148')]===null){return _0x282247(msgResponse('originate',_0xcd0d('0x121'),'contact\x20is\x20undefine'));}var _0x2e75a0={'XMD-CALLERID':_0x5828d4[_0xcd0d('0x27')][_0x52f7d6]['getCaller'](),'XMD-AGI':_0xf15d8b[_0xcd0d('0xea')]?util['format'](_0xcd0d('0x149'),ipAgi,_0xf15d8b['dialQueueProject']):_0xcd0d('0x14a'),'XMD-AGIAFTER':_0xf15d8b[_0xcd0d('0xf2')]?util[_0xcd0d('0x79')](_0xcd0d('0x149'),ipAgi,_0xf15d8b[_0xcd0d('0xf2')]):_0xcd0d('0x14a'),'XMD-QUEUE':_0xf15d8b[_0xcd0d('0x54')]===_0xcd0d('0x4c')?util[_0xcd0d('0x79')]('\x22%s,%s%s,,,%s\x22',_0xf15d8b['name'],_0xf15d8b[_0xcd0d('0x14b')]||'',_0xf15d8b[_0xcd0d('0xf3')]?'c':'',_0xf15d8b[_0xcd0d('0xfc')]||0x3):'NONE','XMD-CONTACTID':_0x2b6fd2[_0xcd0d('0x10d')],'XMD-CDRTYPE':_0xcd0d('0x5'),'CALLERID(all)':_0x5828d4[_0xcd0d('0x27')][_0x52f7d6][_0xcd0d('0x14c')](),'XMD-AMD':_0xf15d8b[_0xcd0d('0xd5')]?_0xcd0d('0x14d'):'NONE','XMD-DESTINATION':'xcally-motion-dialer'};if(_0xf15d8b['dialAMDActive']){_0x2e75a0[_0xcd0d('0x14e')]=_0xf15d8b['dialAMDInitialSilence']||0x9c4;_0x2e75a0[_0xcd0d('0x14f')]=_0xf15d8b[_0xcd0d('0x150')]||0x5dc;_0x2e75a0[_0xcd0d('0x151')]=_0xf15d8b[_0xcd0d('0x152')]||0x320;_0x2e75a0['XMD-AMDTOTALANALYSISTIME']=_0xf15d8b[_0xcd0d('0x153')]||0x1388;_0x2e75a0[_0xcd0d('0x154')]=_0xf15d8b[_0xcd0d('0x155')]||0x64;_0x2e75a0[_0xcd0d('0x156')]=_0xf15d8b[_0xcd0d('0x157')]||0x32;_0x2e75a0[_0xcd0d('0x158')]=_0xf15d8b['dialAMDMaximumNumberOfWords']||0x3;_0x2e75a0[_0xcd0d('0x159')]=_0xf15d8b[_0xcd0d('0x15a')]||0x100;_0x2e75a0['XMD-AMDMAXIMUMWORDLENGTH']=_0xf15d8b[_0xcd0d('0x15b')]||0x1388;}if(_0xf15d8b[_0xcd0d('0x54')]===_0xcd0d('0x4c')){_0x2e75a0[_0xcd0d('0x15c')]=_0x2b6fd2[_0xcd0d('0xcb')];}else{_0x2e75a0[_0xcd0d('0x15d')]=_0x2b6fd2[_0xcd0d('0x10e')];}for(var _0x28acb4 in _0x2b6fd2['Contact']){if(_0x2b6fd2[_0xcd0d('0x147')][_0xcd0d('0x9a')](_0x28acb4)){if(isNotNull(_0x2b6fd2[_0xcd0d('0x147')][_0x28acb4])&&_0x28acb4!=='id'&&_0x28acb4!=='tags'&&_0x28acb4!==_0xcd0d('0x15e')&&_0x28acb4!=='updatedAt'){_0x2e75a0[util[_0xcd0d('0x79')](_0xcd0d('0x15f'),_0xcd0d('0x160'),_['toUpper'](_0x28acb4))]=_0x2b6fd2[_0xcd0d('0x147')][_0x28acb4];}}}var _0x27af14=_0x5828d4[_0xcd0d('0x11b')](_0xf15d8b['Trunk'])?getCallerId(_0xf15d8b[_0xcd0d('0x73')][_0xcd0d('0x75')],_0xf15d8b[_0xcd0d('0x161')],_0xf15d8b[_0xcd0d('0x162')]>0x0?getCallerIdRandom(_0xf15d8b[_0xcd0d('0x5a')],_0xf15d8b['dialRandomLastDigitCallerIdNumber']):_0xf15d8b['dialOriginateCallerIdNumber']):getCallerId(_['isNil'](_0xf15d8b[_0xcd0d('0x11c')])?_0xf15d8b[_0xcd0d('0x73')][_0xcd0d('0x75')]:_0xf15d8b[_0xcd0d('0x11c')][_0xcd0d('0x75')],_0xf15d8b[_0xcd0d('0x161')],_0xf15d8b[_0xcd0d('0x162')]>0x0?getCallerIdRandom(_0xf15d8b[_0xcd0d('0x5a')],_0xf15d8b[_0xcd0d('0x162')]):_0xf15d8b[_0xcd0d('0x5a')]);if(_0x27af14){_0x2e75a0[_0xcd0d('0x163')]=_0x5828d4[_0xcd0d('0x27')][_0x52f7d6]['originatecalleridname']=extractCalleridName(_0x27af14);_0x2e75a0[_0xcd0d('0x164')]=_0x5828d4[_0xcd0d('0x27')][_0x52f7d6][_0xcd0d('0x165')]=extractCalleridNumber(_0x27af14);}return ami[_0xcd0d('0xa9')]({'actionid':_0x52f7d6,'action':_0xcd0d('0x146'),'channel':_0x5828d4['isTrunkReachable'](_0xf15d8b[_0xcd0d('0x73')])?util[_0xcd0d('0x79')](_0xcd0d('0x166'),_0xf15d8b[_0xcd0d('0x73')]['name'],isNotNull(_0xf15d8b[_0xcd0d('0x5b')])?_0xf15d8b['dialPrefix'][_0xcd0d('0x167')]()||'':'',_0xf15d8b[_0xcd0d('0x168')]>0x0?_0x2b6fd2[_0xcd0d('0x147')][_0xcd0d('0x148')][_0xcd0d('0x169')](_0xf15d8b[_0xcd0d('0x168')]):_0x2b6fd2[_0xcd0d('0x147')][_0xcd0d('0x148')]):util['format'](_0xcd0d('0x166'),_[_0xcd0d('0xa8')](_0xf15d8b[_0xcd0d('0x11c')])?_0xf15d8b[_0xcd0d('0x73')][_0xcd0d('0x41')]:_0xf15d8b[_0xcd0d('0x11c')][_0xcd0d('0x41')],isNotNull(_0xf15d8b[_0xcd0d('0x5b')])?_0xf15d8b[_0xcd0d('0x5b')][_0xcd0d('0x167')]()||'':'',_0xf15d8b[_0xcd0d('0x168')]>0x0?_0x2b6fd2[_0xcd0d('0x147')][_0xcd0d('0x148')][_0xcd0d('0x169')](_0xf15d8b[_0xcd0d('0x168')]):_0x2b6fd2[_0xcd0d('0x147')][_0xcd0d('0x148')]),'callerid':_0x27af14,'Exten':_0xcd0d('0xd4'),'Context':_0xcd0d('0x16a'),'Priority':'1','variable':_0x2e75a0,'timeout':(_0xf15d8b[_0xcd0d('0x16b')]||0x1e)*0x3e8,'async':!![],'channelid':_0x52f7d6})[_0xcd0d('0xb5')](function(_0x3f4aad){return _0x2b9758(_0x3f4aad);})[_0xcd0d('0xac')](function(_0x2ddb6c){_0xf15d8b[_0xcd0d('0x63')]+=0x1;var _0x22cc97=new History(_0x5828d4[_0xcd0d('0x27')][_0x52f7d6]);logger[_0xcd0d('0x96')](util['format'](_0xcd0d('0x16c'),JSON[_0xcd0d('0x76')](_0x2ddb6c)));_0x22cc97[_0xcd0d('0xda')]=0xe;_0x22cc97[_0xcd0d('0xe4')]=_0xcd0d('0x16d');_0x22cc97[_0xcd0d('0x16e')]=moment()[_0xcd0d('0x79')](_0xcd0d('0xf4'));_0x22cc97['endtime']=_0x22cc97[_0xcd0d('0x16e')];_0x5828d4[_0xcd0d('0xc2')](_0x22cc97)[_0xcd0d('0xac')](loggerCatch(_0xcd0d('0x16f')));_0x5828d4[_0xcd0d('0xc0')](_0x22cc97)['catch'](loggerCatch(_0xcd0d('0x16f')))[_0xcd0d('0x1e')](function(){delete _0x5828d4[_0xcd0d('0x27')][_0x52f7d6];return _0x282247(msgResponse('originate',_0xcd0d('0x170'),'originate\x20action\x20Error'));});});});};Dialer[_0xcd0d('0x1b')][_0xcd0d('0x32')]=function(_0x356c34){var _0x5c103b=this[_0xcd0d('0x27')][_0x356c34[_0xcd0d('0x103')]];var _0x47659d=this;if(_0x5c103b){delete this['actions'][_0x356c34[_0xcd0d('0x103')]];_0x5c103b[_0xcd0d('0xfb')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x425276=_0x5c103b[_0xcd0d('0x54')]===_0xcd0d('0x78')?this[_0xcd0d('0x22')][_0x5c103b[_0xcd0d('0xaf')]]:this[_0xcd0d('0x21')][_0x5c103b[_0xcd0d('0x171')]()];if(!this['isSuccess'](_0x356c34['response'])){this[_0xcd0d('0xae')](_0x425276);return this[_0xcd0d('0x172')](_0x5c103b,_0x425276,_0x356c34)['then'](function(_0x3eba89){})[_0xcd0d('0xac')](loggerCatch(_0xcd0d('0x173')));}else{this[_0xcd0d('0x28')][_0x356c34[_0xcd0d('0xd8')]]=_0x5c103b;}}};Dialer[_0xcd0d('0x1b')][_0xcd0d('0x174')]=function(_0x4422e7,_0x14ed8a,_0x274599){var _0x2d5c5c=new History(_0x14ed8a);if(_0x2d5c5c[_0xcd0d('0x175')]+_0x2d5c5c[_0xcd0d('0x176')]+_0x2d5c5c[_0xcd0d('0x177')]>=_0x274599['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x4422e7){case 0x3:if(_0x2d5c5c[_0xcd0d('0x177')]>=_0x274599[_0xcd0d('0x178')]-0x1){return!![];}else{this[_0xcd0d('0xb9')]({'active':![],'countnoanswerretry':_0x2d5c5c[_0xcd0d('0x177')]+=0x1,'scheduledat':moment()['add'](_0x274599[_0xcd0d('0x179')],_0xcd0d('0x17a'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2d5c5c['ContactId'],'ListId':_0x2d5c5c[_0xcd0d('0xc9')],'VoiceQueueId':_0x2d5c5c[_0xcd0d('0xcb')]||undefined,'CampaignId':_0x2d5c5c['CampaignId']||undefined})[_0xcd0d('0xac')](loggerCatch('[rescheduleContact][NoAnswer]'));}break;case 0x5:if(_0x2d5c5c[_0xcd0d('0x175')]>=_0x274599[_0xcd0d('0x17b')]-0x1){return!![];}else{this[_0xcd0d('0xb9')]({'active':![],'countbusyretry':_0x2d5c5c['countbusyretry']+=0x1,'scheduledat':moment()[_0xcd0d('0x17c')](_0x274599[_0xcd0d('0x17d')],_0xcd0d('0x17a'))['format'](_0xcd0d('0xf4')),'ContactId':_0x2d5c5c[_0xcd0d('0x10d')],'ListId':_0x2d5c5c[_0xcd0d('0xc9')],'VoiceQueueId':_0x2d5c5c[_0xcd0d('0xcb')]||undefined,'CampaignId':_0x2d5c5c[_0xcd0d('0x10e')]||undefined})['catch'](loggerCatch('[rescheduleContact]\x20[Busy]'));}break;case 0x8:if(_0x2d5c5c[_0xcd0d('0x176')]>=_0x274599[_0xcd0d('0x17e')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countcongestionretry':_0x2d5c5c[_0xcd0d('0x176')]+=0x1,'scheduledat':moment()['add'](_0x274599[_0xcd0d('0x17f')],_0xcd0d('0x17a'))[_0xcd0d('0x79')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2d5c5c[_0xcd0d('0x10d')],'ListId':_0x2d5c5c[_0xcd0d('0xc9')],'VoiceQueueId':_0x2d5c5c[_0xcd0d('0xcb')]||undefined,'CampaignId':_0x2d5c5c[_0xcd0d('0x10e')]||undefined})[_0xcd0d('0xac')](loggerCatch(_0xcd0d('0x180')));}break;default:return!![];}};Dialer[_0xcd0d('0x1b')][_0xcd0d('0x172')]=function(_0x8353e3,_0x5a1d69,_0x59ea9f){var _0x6ad67f=this;var _0x10d413=new History(_0x8353e3);return new BPromise(function(_0x4b36f1,_0x5f2266){if(_[_0xcd0d('0x3e')](_0x5a1d69)&&_0xcd0d('0x145')!==typeof _0x5a1d69){return _0x5f2266(msgResponse(_0xcd0d('0x181'),'Failure',_0xcd0d('0x182')));}if(_[_0xcd0d('0x3e')](_0x59ea9f)&&_0xcd0d('0x145')!==typeof _0x59ea9f){return _0x5f2266(msgResponse(_0xcd0d('0x181'),_0xcd0d('0x121'),_0xcd0d('0x183')));}switch(_0x59ea9f[_0xcd0d('0xf0')]){case'0':_0x5a1d69[_0xcd0d('0x62')]+=0x1;_0x10d413[_0xcd0d('0xda')]=0x0;_0x10d413[_0xcd0d('0xe4')]='NoSuchNumber';_0x6ad67f[_0xcd0d('0xc2')](_0x10d413)['catch'](loggerCatch(_0xcd0d('0x184')));if(_0x6ad67f[_0xcd0d('0x174')](0x0,_0x8353e3,_0x5a1d69)){if(_0x10d413['countbusyretry']+_0x10d413[_0xcd0d('0x176')]+_0x10d413[_0xcd0d('0x177')]>=_0x5a1d69[_0xcd0d('0x185')]){_0x6ad67f[_0xcd0d('0x186')](_0x10d413,_0x4b36f1,_0x5f2266,'reason\x200\x20no\x20such\x20number....');}else{_0x6ad67f[_0xcd0d('0x187')](_0x10d413,_0x4b36f1,_0x5f2266,_0xcd0d('0x188'));}}break;case'3':_0x5a1d69[_0xcd0d('0x61')]+=0x1;_0x10d413[_0xcd0d('0xda')]=0x3;_0x10d413[_0xcd0d('0xe4')]=_0xcd0d('0x189');_0x10d413[_0xcd0d('0x177')]+=0x1;_0x10d413[_0xcd0d('0x18a')]+=0x1;_0x6ad67f[_0xcd0d('0xc2')](_0x10d413)['catch'](loggerCatch(_0xcd0d('0x18b')));if(_0x6ad67f['checkRetriveMax'](0x3,_0x8353e3,_0x5a1d69)){if(_0x10d413[_0xcd0d('0x177')]>=_0x5a1d69['dialNoAnswerMaxRetry']){_0x6ad67f[_0xcd0d('0x187')](_0x10d413,_0x4b36f1,_0x5f2266,_0xcd0d('0x18c'));}else{_0x6ad67f['stateGlobal'](_0x10d413,_0x4b36f1,_0x5f2266,_0xcd0d('0x18c'));}}break;case'5':_0x5a1d69[_0xcd0d('0x5d')]+=0x1;_0x10d413['state']=0x5;_0x10d413[_0xcd0d('0xe4')]=_0xcd0d('0x18d');_0x10d413[_0xcd0d('0x175')]+=0x1;_0x10d413['countglobal']+=0x1;_0x6ad67f[_0xcd0d('0xc2')](_0x10d413)[_0xcd0d('0xac')](loggerCatch(_0xcd0d('0x18e')));if(_0x6ad67f[_0xcd0d('0x174')](0x5,_0x8353e3,_0x5a1d69)){if(_0x10d413[_0xcd0d('0x175')]>=_0x5a1d69[_0xcd0d('0x17b')]){_0x6ad67f[_0xcd0d('0x187')](_0x10d413,_0x4b36f1,_0x5f2266,_0xcd0d('0x18f'));}else{_0x6ad67f[_0xcd0d('0x186')](_0x10d413,_0x4b36f1,_0x5f2266,_0xcd0d('0x18f'));}}break;case'8':_0x5a1d69[_0xcd0d('0x5e')]+=0x1;_0x10d413[_0xcd0d('0xda')]=0x8;_0x10d413[_0xcd0d('0xe4')]=_0xcd0d('0x190');_0x10d413[_0xcd0d('0x176')]+=0x1;_0x10d413[_0xcd0d('0x18a')]+=0x1;_0x6ad67f[_0xcd0d('0xc2')](_0x10d413)['catch'](loggerCatch(_0xcd0d('0x191')));if(_0x6ad67f['checkRetriveMax'](0x8,_0x8353e3,_0x5a1d69)){if(_0x10d413[_0xcd0d('0x176')]>=_0x5a1d69[_0xcd0d('0x17e')]){_0x6ad67f['createStateFinal'](_0x10d413,_0x4b36f1,_0x5f2266,_0xcd0d('0x192'));}else{_0x6ad67f[_0xcd0d('0x186')](_0x10d413,_0x4b36f1,_0x5f2266,_0xcd0d('0x192'));}}break;default:_0x5a1d69['outboundUnknownCallsDay']+=0x1;_0x10d413[_0xcd0d('0xda')]=0xc;_0x10d413[_0xcd0d('0xe4')]=_0x59ea9f['reason'];_0x6ad67f[_0xcd0d('0xc2')](_0x10d413)[_0xcd0d('0xac')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x6ad67f[_0xcd0d('0x174')](_0x59ea9f[_0xcd0d('0xf0')],_0x8353e3,_0x5a1d69)){if(_0x10d413[_0xcd0d('0x175')]+_0x10d413[_0xcd0d('0x176')]+_0x10d413['countnoanswerretry']>=_0x5a1d69[_0xcd0d('0x185')]){_0x6ad67f[_0xcd0d('0x186')](_0x10d413,_0x4b36f1,_0x5f2266,_0x59ea9f[_0xcd0d('0xf0')]);}else{_0x6ad67f['createStateFinal'](_0x10d413,_0x4b36f1,_0x5f2266,_0x59ea9f[_0xcd0d('0xf0')]);}}}});};Dialer[_0xcd0d('0x1b')][_0xcd0d('0x186')]=function(_0x3d1b97,_0x4da0b5,_0x529393,_0x5978af){var _0x54bc94=new Final(_0x3d1b97);_0x54bc94['state']=0xf;_0x54bc94[_0xcd0d('0xe4')]=_0xcd0d('0x193');this[_0xcd0d('0x187')](_0x54bc94,_0x4da0b5,_0x529393,_0x5978af);};Dialer[_0xcd0d('0x1b')][_0xcd0d('0x187')]=function(_0x45e4fa,_0x55c135,_0xfb3647,_0x342aef){this[_0xcd0d('0xc0')](_0x45e4fa)['then'](function(_0x5e718d){return _0x55c135(msgResponse(_0xcd0d('0x181'),_0xcd0d('0xcf'),_0x342aef));})[_0xcd0d('0xac')](function(_0x1795f0){return _0xfb3647(msgResponse(_0xcd0d('0x194'),_0xcd0d('0x121'),'contact\x20not\x20moved'));});};Dialer['prototype'][_0xcd0d('0x8')]=function(_0x9b1ddc){var _0xbda909=this;var _0xd06d34=_0x9b1ddc['dialPredictiveOptimizationPercentage']/0x64;var _0x1015c6=_0x9b1ddc['outboundDropCallsDayTimeout']/(_0x9b1ddc[_0xcd0d('0xfd')]+_0x9b1ddc[_0xcd0d('0x5c')]);var _0x47fc87=Math[_0xcd0d('0x195')](_0x9b1ddc['predictiveIntervalAvailable']*(_0x9b1ddc[_0xcd0d('0x196')]/0x64));var _0x49d0d9=Math[_0xcd0d('0x195')](_0x9b1ddc[_0xcd0d('0x197')]*(_0x9b1ddc[_0xcd0d('0x198')]/0x64));var _0x4529c2=_0x9b1ddc[_0xcd0d('0x4f')]+_0x9b1ddc[_0xcd0d('0x52')];var _0x3eda9b=Math[_0xcd0d('0x199')](_0x9b1ddc[_0xcd0d('0x6f')]*_0x9b1ddc[_0xcd0d('0x70')]*_0x9b1ddc['predictiveIntervalHitRate']*_0x9b1ddc['predictiveIntervalMultiplicativeFactor']);if(_[_0xcd0d('0x3e')](_0x9b1ddc['startProgressive'])){if(!_[_0xcd0d('0x3e')](_0x9b1ddc[_0xcd0d('0x29')])){_0x9b1ddc[_0xcd0d('0x29')]=undefined;loggerPredictive['error'](_0xcd0d('0x19a'),'check\x20predictive\x20is\x20not\x20undefine');}if(!_[_0xcd0d('0x3e')](_0x9b1ddc['handlePredictive'])){loggerPredictive[_0xcd0d('0x96')](_0xcd0d('0x19a'),_0xcd0d('0x19b'));clearInterval(_0x9b1ddc[_0xcd0d('0x91')]);_0x9b1ddc[_0xcd0d('0x91')]=undefined;}_0x9b1ddc[_0xcd0d('0x72')]=moment()[_0xcd0d('0x79')](_0xcd0d('0xf4'));loggerPredictive[_0xcd0d('0x7a')](_0x9b1ddc['name'],_0xcd0d('0x19c'),_0x9b1ddc[_0xcd0d('0x72')]);this[_0xcd0d('0x19d')](_0x9b1ddc,0x1);}else if(ifInterval(_0x9b1ddc[_0xcd0d('0x19e')],_0x9b1ddc[_0xcd0d('0x72')])){this['handlePower'](_0x9b1ddc,0x1);loggerPredictiveCalls[_0xcd0d('0x7a')]('[startMethodPredictive][StartProgressive][Loop]',_0x9b1ddc[_0xcd0d('0x72')],_0x9b1ddc[_0xcd0d('0x41')]);_0x9b1ddc[_0xcd0d('0x6f')]=0x0;_0x9b1ddc[_0xcd0d('0x6b')]=0x0;}else if(_0xd06d34<_0x1015c6&&_0x9b1ddc[_0xcd0d('0x19f')]===_0xcd0d('0x1a0')){freeVariablesPredictive(_0x9b1ddc);loggerPredictive[_0xcd0d('0x7a')](_0xcd0d('0x1a1'),_0xcd0d('0x1a2'),_0x1015c6,_0xcd0d('0x72'),_0x9b1ddc[_0xcd0d('0x41')]);}else if(_0x3eda9b<_0x9b1ddc[_0xcd0d('0x6b')]&&_0x9b1ddc[_0xcd0d('0x19f')]===_0xcd0d('0x1a0')){freeVariablesPredictive(_0x9b1ddc);loggerPredictive[_0xcd0d('0x7a')]('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0xcd0d('0x1a3'),_0x3eda9b,_0xcd0d('0x1a4'),_0x9b1ddc[_0xcd0d('0x6b')],_0xcd0d('0x72'),_0x9b1ddc[_0xcd0d('0x41')]);}else if(!ifInterval(_0x9b1ddc[_0xcd0d('0x19e')],_0x9b1ddc['startProgressive'])&&_['isUndefined'](_0x9b1ddc[_0xcd0d('0x29')])&&!_[_0xcd0d('0x3e')](_0x9b1ddc[_0xcd0d('0x72')])){_0x9b1ddc[_0xcd0d('0x29')]=moment()[_0xcd0d('0x79')](_0xcd0d('0xf4'));loggerPredictive[_0xcd0d('0x7a')](_0x9b1ddc['name'],_0xcd0d('0x1a5'),_0x9b1ddc[_0xcd0d('0x29')]);this[_0xcd0d('0xb8')](_0x9b1ddc[_0xcd0d('0x19e')])['then'](this[_0xcd0d('0x1a6')](_0x9b1ddc))[_0xcd0d('0xb5')](mergeDataErlangB(_0x9b1ddc))['then'](this[_0xcd0d('0x1a7')](_0x9b1ddc))[_0xcd0d('0xac')](loggerCatchPredictive(_0xcd0d('0x1a8'),_0x9b1ddc));}else if(!ifInterval(_0x9b1ddc['dialPredictiveInterval'],_0x9b1ddc[_0xcd0d('0x29')])){_0x9b1ddc[_0xcd0d('0x6b')]=0x0;_0x9b1ddc[_0xcd0d('0x29')]=moment()[_0xcd0d('0x79')](_0xcd0d('0xf4'));loggerPredictive['info'](_0x9b1ddc[_0xcd0d('0x41')],_0xcd0d('0x1a9'),_0x9b1ddc['startPredictive']);clearInterval(_0x9b1ddc[_0xcd0d('0x91')]);_0x9b1ddc[_0xcd0d('0x91')]=undefined;this[_0xcd0d('0xb8')](_0x9b1ddc['dialPredictiveInterval'])[_0xcd0d('0xb5')](this[_0xcd0d('0x1a6')](_0x9b1ddc))['then'](mergeDataErlangB(_0x9b1ddc))['then'](this[_0xcd0d('0x1a7')](_0x9b1ddc))[_0xcd0d('0xac')](loggerCatchPredictive(_0xcd0d('0x1aa'),_0x9b1ddc));}else if(_0x9b1ddc[_0xcd0d('0x197')]&&_0x4529c2<_0x9b1ddc[_0xcd0d('0x197')]-_0x49d0d9){freeVariablesPredictive(_0x9b1ddc);loggerPredictive[_0xcd0d('0x7a')](_0x9b1ddc[_0xcd0d('0x41')],_0xcd0d('0x1ab'),_0x4529c2,')\x20are\x20less\x20than\x20threshold\x20(',_0x9b1ddc[_0xcd0d('0x197')],'-',_0x49d0d9,'=',_0x9b1ddc[_0xcd0d('0x197')]-_0x49d0d9,')');}else if(_0x9b1ddc[_0xcd0d('0x197')]&&_0x4529c2>_0x9b1ddc[_0xcd0d('0x197')]+_0x47fc87){freeVariablesPredictive(_0x9b1ddc);loggerPredictive[_0xcd0d('0x7a')](_0x9b1ddc[_0xcd0d('0x41')],_0xcd0d('0x1ab'),_0x4529c2,')\x20are\x20more\x20than\x20threshold\x20(',_0x9b1ddc['predictiveIntervalAvailable'],'+',_0x47fc87,'=',_0x9b1ddc[_0xcd0d('0x197')]+_0x47fc87,')');}};Dialer[_0xcd0d('0x1b')][_0xcd0d('0x1a6')]=function(_0x5838cd){var _0x3e240c=this;return function(_0x5be747){return new BPromise(function(_0x584e62,_0x398639){_[_0xcd0d('0x8e')](_0x5838cd,_0x5be747[0x0]);if(checkGetDataPredictive(_0x5be747[0x0])){var _0x47ab50=_0x5838cd[_0xcd0d('0x197')]=_0x5838cd['talking']+_0x5838cd[_0xcd0d('0x4f')];var _0x1706ff=_0x5838cd[_0xcd0d('0x19e')]*0x3c;var _0x583a25=_0x5be747[0x0]['predictiveIntervalAvgTalktime']+_0x5be747[0x0]['predictiveIntervalAvgHoldtime'];var _0x488644=(_0x5be747[0x0][_0xcd0d('0x7e')]+_0x5be747[0x0][_0xcd0d('0x69')]+_0x5be747[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x5be747[0x0][_0xcd0d('0x6d')];_0x5838cd[_0xcd0d('0x6c')]=_0x488644>0x0?_0x488644:0x1;switch(_0x5838cd[_0xcd0d('0x19f')]){case _0xcd0d('0x1a0'):var _0x500509=_0x5838cd[_0xcd0d('0x1ac')]/0x64;return _0x3e240c[_0xcd0d('0x1ad')](_0x47ab50,_0x1706ff,_0x583a25,_0x488644,_0x500509)[_0xcd0d('0xb5')](function(_0x1005c4){return _0x584e62(_0x1005c4);});case'agentBusyFactor':var _0x208f4f=_0x5838cd[_0xcd0d('0x1ac')]/0x64;return _0x3e240c[_0xcd0d('0x1ae')](_0x47ab50,_0x1706ff,_0x583a25,_0x488644,_0x208f4f)['then'](function(_0x1123c2){return _0x584e62(_0x1123c2);});default:return _0x398639(msgResponse(_0xcd0d('0x1af'),_0xcd0d('0x121'),_0xcd0d('0x1b0')));}}else{return _0x398639(msgResponse(_0xcd0d('0x1af'),_0xcd0d('0x121'),_0xcd0d('0x1b1')));}});};};Dialer['prototype'][_0xcd0d('0x1b2')]=function(_0x23bcfe){var _0x17bfcf=this;return function(_0x1ee17d){return new BPromise(function(_0x15a695,_0x36253c){_[_0xcd0d('0x8e')](_0x23bcfe,_0x1ee17d[0x0]);if(checkGetDataPredictive(_0x1ee17d[0x0])){loggerPredictive[_0xcd0d('0x7a')](JSON['stringify'](_0x1ee17d[0x0]));if(_0x23bcfe['dialPredictiveOptimization']==='dropRate'){return _0x17bfcf[_0xcd0d('0xbe')](_0x23bcfe['id'])[_0xcd0d('0xb5')](function(_0x29831d){var _0x22dfa6=_0x23bcfe[_0xcd0d('0x13c')]-_0x29831d[0x0][_0xcd0d('0x1b3')];var _0x387880=_0x23bcfe[_0xcd0d('0x19e')]*0x3c;var _0x1deb6a=_0x1ee17d[0x0][_0xcd0d('0x83')]+_0x1ee17d[0x0][_0xcd0d('0x67')];var _0x186417=(_0x1ee17d[0x0][_0xcd0d('0x7e')]+_0x1ee17d[0x0][_0xcd0d('0x69')]+_0x1ee17d[0x0][_0xcd0d('0x68')])/_0x1ee17d[0x0][_0xcd0d('0x6d')];var _0x5c3695=_0x23bcfe[_0xcd0d('0x1ac')]/0x64;_0x23bcfe[_0xcd0d('0x1b4')]=_0x29831d[0x0][_0xcd0d('0x1b3')]||0x0;_0x23bcfe[_0xcd0d('0x6c')]=_0x186417>0x0?_0x186417:0x1;return _0x17bfcf[_0xcd0d('0x1ad')](_0x22dfa6,_0x387880,_0x1deb6a,_0x186417,_0x5c3695);})[_0xcd0d('0xb5')](function(_0x5efd35){return _0x15a695(_0x5efd35);})[_0xcd0d('0xac')](function(_0x259ef2){return _0x36253c(msgResponse(_0xcd0d('0x1b5'),_0xcd0d('0x121'),JSON[_0xcd0d('0x76')](_0x259ef2)));});}if(_0x23bcfe[_0xcd0d('0x19f')]===_0xcd0d('0x1b6')){return _0x17bfcf[_0xcd0d('0xbe')](_0x23bcfe['id'])[_0xcd0d('0xb5')](function(_0x3a5060){var _0x21eec4=_0x23bcfe[_0xcd0d('0x13c')]-_0x3a5060[0x0][_0xcd0d('0x1b3')];var _0x4ce0da=_0x23bcfe[_0xcd0d('0x19e')]*0x3c;var _0x25b664=_0x1ee17d[0x0][_0xcd0d('0x83')]+_0x1ee17d[0x0][_0xcd0d('0x67')];var _0x5dc4ed=(_0x1ee17d[0x0]['predictiveIntervalAnsweredCalls']+_0x1ee17d[0x0][_0xcd0d('0x69')]+_0x1ee17d[0x0][_0xcd0d('0x68')])/_0x1ee17d[0x0][_0xcd0d('0x6d')];var _0x1e5254=_0x23bcfe[_0xcd0d('0x1ac')]/0x64;_0x23bcfe['predictiveIntervalPauses']=_0x3a5060[0x0]['outboundQueuePauses']||0x0;_0x23bcfe[_0xcd0d('0x6c')]=_0x5dc4ed>0x0?_0x5dc4ed:0x1;return _0x17bfcf['busyFactor'](_0x21eec4,_0x4ce0da,_0x25b664,_0x5dc4ed,_0x1e5254);})[_0xcd0d('0xb5')](function(_0x5700cf){return _0x15a695(_0x5700cf);})['catch'](function(_0x1b25d9){return _0x36253c(msgResponse('[CatchErlangB]',_0xcd0d('0x121'),JSON['stringify'](_0x1b25d9)));});}}else{return _0x36253c(msgResponse(_0xcd0d('0x1af'),_0xcd0d('0x121'),_0xcd0d('0x1b1')));}});};};Dialer[_0xcd0d('0x1b')][_0xcd0d('0x1a7')]=function(_0x1d683a){var _0x551df3=this;return function(){var _0x1642a8=0x0;var _0x139ea4=Math[_0xcd0d('0x199')](_0x1d683a[_0xcd0d('0x8b')]*0x3e8);if(_0x139ea4>0x0){_0x139ea4=_0x139ea4<0x64?0x64:_0x139ea4;loggerPredictive[_0xcd0d('0x7a')](_0x1d683a[_0xcd0d('0x41')],_0xcd0d('0x1b7'),_0x139ea4,_0xcd0d('0x49'));_0x1d683a[_0xcd0d('0x91')]=setInterval(function(){_0x551df3[_0xcd0d('0x91')](_0x1d683a);loggerPredictiveCalls['info'](_0xcd0d('0x1b8'),_0x1642a8+=0x1);},_0x139ea4);}else{loggerPredictive[_0xcd0d('0x7a')](_0x1d683a[_0xcd0d('0x41')],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0xcd0d('0x1b')]['checkContactBlack']=function(_0x1fc236,_0x27b439){var _0x107a41=this;return function(_0x1ed4f1){if(_['isEmpty'](_0x1ed4f1)){if(_[_0xcd0d('0xa8')](_0x27b439[_0xcd0d('0xca')])||!_0x27b439[_0xcd0d('0x1b9')]){if(_0x1fc236[_0xcd0d('0x135')]==='booked'){_0x1fc236[_0xcd0d('0x109')]=_[_0xcd0d('0x3e')](_0x1fc236[_0xcd0d('0x109')])?!![]:_0x1fc236[_0xcd0d('0x109')];var _0x3ba65c=uuid['v4']();_0x107a41[_0xcd0d('0x27')][_0x3ba65c]=new Action(_0x1fc236,_0x27b439,_0x3ba65c);loggerBooked[_0xcd0d('0x7a')](_0xcd0d('0x1ba'),_0x3ba65c,_0xcd0d('0x1bb'),JSON[_0xcd0d('0x76')](_0x1fc236[_0xcd0d('0x109')]),_0xcd0d('0x1bc'),_0x1fc236[_0xcd0d('0x41')]);if(_0x1fc236[_0xcd0d('0x109')]){_0x1fc236[_0xcd0d('0x109')]=![];_0x107a41[_0xcd0d('0x2b')][_0x107a41[_0xcd0d('0x27')][_0x3ba65c][_0xcd0d('0xaf')]]=[];ami[_0xcd0d('0xa9')]({'actionid':_0x3ba65c,'action':_0xcd0d('0x1bd'),'queue':_0x1fc236[_0xcd0d('0x41')]})[_0xcd0d('0xac')](function(_0x37e3f6){_0x107a41['updateOriginated'](_0x1fc236);_0x107a41['rescheduleContact']({'active':![],'ContactId':_0x107a41[_0xcd0d('0x27')][_0x3ba65c][_0xcd0d('0x10d')],'ListId':_0x107a41[_0xcd0d('0x27')][_0x3ba65c][_0xcd0d('0xc9')],'VoiceQueueId':_0x107a41[_0xcd0d('0x27')][_0x3ba65c][_0xcd0d('0xcb')]||undefined,'CampaignId':_0x107a41[_0xcd0d('0x27')][_0x3ba65c][_0xcd0d('0x10e')]||undefined})['catch'](loggerCatch(_0xcd0d('0x1be')));delete _0x107a41['actions'][_0x3ba65c];});}else{loggerBooked[_0xcd0d('0x7a')](_0xcd0d('0x1bf'),JSON[_0xcd0d('0x76')](_0x1fc236[_0xcd0d('0x109')]),'Queue:\x20',_0x1fc236[_0xcd0d('0x41')]);_0x107a41[_0xcd0d('0xae')](_0x1fc236);_0x107a41[_0xcd0d('0xb9')]({'active':![],'ContactId':_0x107a41['actions'][_0x3ba65c][_0xcd0d('0x10d')],'ListId':_0x107a41[_0xcd0d('0x27')][_0x3ba65c][_0xcd0d('0xc9')],'VoiceQueueId':_0x107a41[_0xcd0d('0x27')][_0x3ba65c][_0xcd0d('0xcb')]||undefined,'CampaignId':_0x107a41[_0xcd0d('0x27')][_0x3ba65c][_0xcd0d('0x10e')]||undefined})[_0xcd0d('0xac')](loggerCatch(_0xcd0d('0x1be')));delete _0x107a41['actions'][_0x3ba65c];}}else{return _0x107a41[_0xcd0d('0x144')](_0x1fc236,_0x27b439);}}else{if(getDiff(_0x27b439[_0xcd0d('0x1c0')])<_0x1fc236[_0xcd0d('0x1c1')]*0x3c){_0x107a41[_0xcd0d('0x20')][_0xcd0d('0x113')](_0x27b439['id'])[_0xcd0d('0x1e')](function(){_0x107a41[_0xcd0d('0xae')](_0x1fc236);});}else{_0x1fc236[_0xcd0d('0x64')]+=0x1;_0x107a41[_0xcd0d('0xae')](_0x1fc236);if(_0x1fc236['dialRecallInQueue']){_0x107a41[_0xcd0d('0xb9')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x27b439[_0xcd0d('0x10d')],'ListId':_0x27b439[_0xcd0d('0xc9')],'VoiceQueueId':_0x27b439[_0xcd0d('0xcb')]||undefined,'CampaignId':_0x27b439[_0xcd0d('0x10e')]||undefined})[_0xcd0d('0xac')](loggerCatch(_0xcd0d('0x1c2')));_0x107a41[_0xcd0d('0xc2')](createObjHistory(_0x1fc236,_0x27b439,_0xcd0d('0x1c3'),0x17,'RecallInQueue'))[_0xcd0d('0xac')](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x107a41[_0xcd0d('0xc7')](createObjHistory(_0x1fc236,_0x27b439,_0xcd0d('0x1c4'),0x16,_0xcd0d('0x1c5')),_0xcd0d('0x1c6'),_0xcd0d('0x1c7'));}}}}else{_0x1fc236[_0xcd0d('0x1c8')]+=0x1;_0x107a41[_0xcd0d('0xc7')](createObjHistory(_0x1fc236,_0x27b439,_0xcd0d('0x1c9'),0xd,_0xcd0d('0x1ca')),_0xcd0d('0x1cb'),_0xcd0d('0x1cc'));throw _0xcd0d('0x1cd');}};};Dialer[_0xcd0d('0x1b')][_0xcd0d('0x1ce')]=function(_0x22eed6){var _0x18150b=this;var _0x5d7b59=[];var _0x570f06=_0x22eed6[_0xcd0d('0x1cf')]-_0x22eed6['originated']-_0x22eed6[_0xcd0d('0x1d0')];emitCampaignSummary(_0x22eed6);if(_0x570f06>0x0){if(_0x570f06>this[_0xcd0d('0x25')]){_0x570f06=this['maxNumberOriginate'];}_0x22eed6[_0xcd0d('0x1d0')]+=_0x570f06;this[_0xcd0d('0xbd')](_0x22eed6['id'],_0x570f06,_0x22eed6['dialOrderByScheduledAt'])[_0xcd0d('0xb5')](function(_0xcb5e7){_0x22eed6[_0xcd0d('0x1d0')]-=_0x570f06;_0x22eed6[_0xcd0d('0x1d0')]=_0x22eed6[_0xcd0d('0x1d0')]>0x0?_0x22eed6[_0xcd0d('0x1d0')]:0x0;if(!checkContactEmpty(_0xcb5e7)){_0x22eed6[_0xcd0d('0x3f')]=_0xcd0d('0x9f');logger[_0xcd0d('0x7a')](_0xcd0d('0x1d1')+_0x22eed6[_0xcd0d('0x41')]);}else{_0x22eed6[_0xcd0d('0x6e')]+=_0xcb5e7['length'];_0x22eed6['message']=_0xcd0d('0x1d2');for(var _0x518017=0x0;_0x518017<_0xcb5e7['length'];_0x518017+=0x1){_0x22eed6[_0xcd0d('0x1d3')]+=0x1;if(_[_0xcd0d('0xa8')](_0xcb5e7[_0x518017])||_[_0xcd0d('0xa8')](_0xcb5e7[_0x518017][_0xcd0d('0x147')])||_[_0xcd0d('0xa8')](_0xcb5e7[_0x518017][_0xcd0d('0x147')]['phone'])){_0x18150b[_0xcd0d('0xc5')](_0xcd0d('0x1d4'),_0x22eed6,_0xcb5e7[_0x518017]);}else{_0x18150b[_0xcd0d('0xb6')](_[_0xcd0d('0xc8')](_0xcb5e7[_0x518017],[_0xcd0d('0x10e'),_0xcd0d('0x1d5')]))[_0xcd0d('0xb5')](_0x18150b['checkContactBlack'](_0x22eed6,_0xcb5e7[_0x518017]))[_0xcd0d('0xac')](_0x18150b[_0xcd0d('0x1d6')](_0xcd0d('0x1d7'),_0x22eed6));}}}})[_0xcd0d('0xac')](loggerGetContactDialer(_0xcd0d('0x1d8'),_0x22eed6,_0x570f06));}};Dialer[_0xcd0d('0x1b')][_0xcd0d('0x19d')]=function(_0x4b4c1f,_0x33a3f4){var _0x189db6=this;var _0x17717f=[];var _0x5c7356=_0x33a3f4>=0x1?_0x33a3f4:0x1;var _0x3bbbc9=[];if(_0x4b4c1f[_0xcd0d('0x135')]===_0xcd0d('0x7')){_0x5c7356=0x1;}var _0x1ccb77=Math[_0xcd0d('0x199')](_0x4b4c1f['available']*_0x5c7356)-_0x4b4c1f[_0xcd0d('0x6e')]-_0x4b4c1f[_0xcd0d('0x1d0')];emitVoiceQueueSummary(_0x4b4c1f);if(_0x4b4c1f[_0xcd0d('0x1d9')]>0x0){var _0x4db176=_0x4b4c1f[_0xcd0d('0x1d9')]-_0x4b4c1f[_0xcd0d('0x6e')]-_0x4b4c1f[_0xcd0d('0x52')]-_0x4b4c1f[_0xcd0d('0x1d0')]-_0x4b4c1f[_0xcd0d('0x50')];if(_0x1ccb77>_0x4db176){_0x1ccb77=_0x4db176;}}if(_0x1ccb77>0x0){if(_0x4b4c1f[_0xcd0d('0x135')]==='booked'){_0x1ccb77=0x1;}if(_0x1ccb77>this[_0xcd0d('0x25')]){_0x1ccb77=this[_0xcd0d('0x25')];}_0x4b4c1f[_0xcd0d('0x1d0')]+=_0x1ccb77;for(var _0x3409e5 in this[_0xcd0d('0x23')]){if(this[_0xcd0d('0x23')][_0xcd0d('0x9a')](_0x3409e5)){if(this[_0xcd0d('0x23')][_0x3409e5][_0xcd0d('0xda')]===_0xcd0d('0x1da')&&this[_0xcd0d('0x23')][_0x3409e5][_0xcd0d('0xaa')]===_0xcd0d('0xd0')){_0x17717f[_0xcd0d('0x107')](this['agents'][_0x3409e5]['id']);}}}this[_0xcd0d('0xbb')](_0x4b4c1f['id'],_0x17717f,_0x1ccb77,_0x4b4c1f[_0xcd0d('0x1db')])[_0xcd0d('0xb5')](function(_0x1b73fb){_0x4b4c1f[_0xcd0d('0x1d0')]-=_0x1ccb77;_0x4b4c1f[_0xcd0d('0x1d0')]=_0x4b4c1f[_0xcd0d('0x1d0')]>0x0?_0x4b4c1f[_0xcd0d('0x1d0')]:0x0;if(!checkContactEmpty(_0x1b73fb)){_0x189db6[_0xcd0d('0xb2')](_0x4b4c1f)[_0xcd0d('0xb5')](sendMessageReschedule(_0x4b4c1f))['catch'](loggerCatch('[countReScheduled]\x20'));}else{_0x4b4c1f[_0xcd0d('0x6e')]+=_0x1b73fb[_0xcd0d('0x99')];_0x4b4c1f[_0xcd0d('0x3f')]=_0x4b4c1f[_0xcd0d('0x135')]===_0xcd0d('0x7')?_0xcd0d('0x14d'):_0xcd0d('0x1d2');for(var _0x3cfc0d=0x0;_0x3cfc0d<_0x1b73fb[_0xcd0d('0x99')];_0x3cfc0d+=0x1){if(_[_0xcd0d('0xa8')](_0x1b73fb[_0x3cfc0d])||_[_0xcd0d('0xa8')](_0x1b73fb[_0x3cfc0d][_0xcd0d('0x147')])||_[_0xcd0d('0xa8')](_0x1b73fb[_0x3cfc0d]['Contact']['phone'])){_0x189db6['emptyContact']('[actionOriginate]\x20',_0x4b4c1f,_0x1b73fb[_0x3cfc0d]);}else{_0x189db6[_0xcd0d('0xb4')](_[_0xcd0d('0xc8')](_0x1b73fb[_0x3cfc0d],[_0xcd0d('0xcb'),_0xcd0d('0x1d5')]))['then'](_0x189db6[_0xcd0d('0x1dc')](_0x4b4c1f,_0x1b73fb[_0x3cfc0d]))[_0xcd0d('0xac')](_0x189db6[_0xcd0d('0x1d6')](_0xcd0d('0x1d4'),_0x4b4c1f));}}}})['catch'](loggerGetContactDialer(_0xcd0d('0x1dd'),_0x4b4c1f,_0x1ccb77));}};Dialer[_0xcd0d('0x1b')]['handlePredictive']=function(_0x51780b){var _0x2bcb17=this;if(_0x51780b['dialLimitQueue']>0x0){var _0x20869e=_0x51780b['dialLimitQueue']-_0x51780b[_0xcd0d('0x6e')]-_0x51780b['talking'];if(_0x20869e>0x0){this['tryOriginatePredictive'](_0x51780b);}else{loggerPredictiveCalls[_0xcd0d('0x7a')](_0xcd0d('0x1de'));}}else{this[_0xcd0d('0x1df')](_0x51780b);}};Dialer['prototype']['tryOriginatePredictive']=function(_0x7314f9){var _0x5b13fc=this;var _0x554662=[];_0x7314f9[_0xcd0d('0x6e')]+=0x1;for(var _0xe016b in this[_0xcd0d('0x23')]){if(this[_0xcd0d('0x23')][_0xcd0d('0x9a')](_0xe016b)){if(this[_0xcd0d('0x23')][_0xe016b][_0xcd0d('0xda')]==='not_inuse'&&this['agents'][_0xe016b][_0xcd0d('0xaa')]===_0xcd0d('0xd0')){_0x554662['push'](this['agents'][_0xe016b]['id']);}}}this[_0xcd0d('0xbb')](_0x7314f9['id'],_0x554662,0x1,_0x7314f9[_0xcd0d('0x1db')])['then'](function(_0xed8ecb){if(!checkContactEmpty(_0xed8ecb)){checkContactLowerLimitOriginate(_0x7314f9,0x1,0x0);_0x5b13fc[_0xcd0d('0xb2')](_0x7314f9)[_0xcd0d('0xb5')](sendMessageReschedule(_0x7314f9))['catch'](loggerCatch(_0xcd0d('0x1e0')));}else{_0x7314f9['message']=_0xcd0d('0x1d2');if(_[_0xcd0d('0xa8')](_0xed8ecb[0x0])||_['isNil'](_0xed8ecb[0x0][_0xcd0d('0x147')])||_[_0xcd0d('0xa8')](_0xed8ecb[0x0][_0xcd0d('0x147')]['phone'])){_0x5b13fc['emptyContact'](_0xcd0d('0x1d4'),_0x7314f9,_0xed8ecb[0x0]);}else{_0x5b13fc[_0xcd0d('0xb4')](_['pick'](_0xed8ecb[0x0],[_0xcd0d('0xcb'),_0xcd0d('0x1d5')]))[_0xcd0d('0xb5')](_0x5b13fc['checkContactBlack'](_0x7314f9,_0xed8ecb[0x0]))[_0xcd0d('0xac')](_0x5b13fc[_0xcd0d('0x1d6')]('[actionOriginatePredictive]\x20',_0x7314f9));}}})[_0xcd0d('0xac')](loggerGetContactDialer('[getContactDialerPredictive]',_0x7314f9,0x1));emitVoiceQueueSummary(_0x7314f9);};Dialer['prototype']['abandonmentRate']=function(_0x261b73,_0x1b05fc,_0x4a72c0,_0x238d3d,_0x58f130,_0x50a7bf){loggerPredictive[_0xcd0d('0x7a')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0xcd0d('0x7a')](_0xcd0d('0x1e1'),_0x261b73);loggerPredictive[_0xcd0d('0x7a')](_0xcd0d('0x1e2'),_0x1b05fc);loggerPredictive[_0xcd0d('0x7a')](_0xcd0d('0x1e3'),_0x4a72c0);loggerPredictive[_0xcd0d('0x7a')](_0xcd0d('0x1e4'),_0x238d3d);loggerPredictive['info'](_0xcd0d('0x1e5'),_0x58f130);loggerPredictive[_0xcd0d('0x7a')]('---------------------------');return new BPromise(function(_0x370965,_0x3519a5){if(_0x261b73<=0x0||isNaN(_0x261b73)){return _0x3519a5(msgResponse(_0xcd0d('0x1e6'),_0xcd0d('0x170'),_0xcd0d('0x1e7')+_0x261b73));}if(_0x4a72c0<=0x0||isNaN(_0x4a72c0)){return _0x3519a5(msgResponse(_0xcd0d('0x1e6'),_0xcd0d('0x170'),_0xcd0d('0x1e8')+_0x4a72c0));}if(_0x238d3d<=0x0||isNaN(_0x238d3d)){return _0x3519a5(msgResponse(_0xcd0d('0x1e6'),_0xcd0d('0x170'),_0xcd0d('0x1e9')+_0x238d3d));}if(_0x1b05fc<=0x0||isNaN(_0x1b05fc)){return _0x3519a5(msgResponse(_0xcd0d('0x1e6'),_0xcd0d('0x170'),_0xcd0d('0x1ea')+_0x1b05fc));}if(_0x58f130<=0x0||isNaN(_0x58f130)){return _0x3519a5(msgResponse(_0xcd0d('0x1e6'),_0xcd0d('0x170'),_0xcd0d('0x1eb')+_0x58f130));}_0x50a7bf=_0x50a7bf||0x0;var _0x764583=0x1/_0x4a72c0;var _0x11c21d=0x0;var _0x18b6cc=0x0;var _0x483a4a=0x0;var _0x1cd438=0x0;for(var _0x1c9be9=0x0;_0x483a4a<_0x58f130;_0x1c9be9+=0x1){_0x18b6cc=_0x1c9be9/_0x1b05fc;_0x11c21d=(_0x238d3d*_0x18b6cc+_0x50a7bf)/_0x764583;_0x483a4a=erlangb(_0x11c21d,_0x261b73);_0x1cd438=_0x11c21d/_0x261b73*(0x1-erlangb(_0x11c21d,_0x261b73));}return _0x370965({'erlangCalls':_0x1c9be9,'erlangCallToSecond':_0x1b05fc/_0x1c9be9,'erlangAbandonmentRate':_0x483a4a,'erlangBusyFactor':_0x1cd438});});};Dialer['prototype'][_0xcd0d('0x1ae')]=function(_0x301dd2,_0xb2d026,_0x14113c,_0x280386,_0x19b369,_0x4f22b2){loggerPredictive['info'](_0xcd0d('0x1ec'));loggerPredictive[_0xcd0d('0x7a')](_0xcd0d('0x1e1'),_0x301dd2);loggerPredictive[_0xcd0d('0x7a')](_0xcd0d('0x1e2'),_0xb2d026);loggerPredictive[_0xcd0d('0x7a')](_0xcd0d('0x1e3'),_0x14113c);loggerPredictive[_0xcd0d('0x7a')](_0xcd0d('0x1e4'),_0x280386);loggerPredictive[_0xcd0d('0x7a')](_0xcd0d('0x1ed'),_0x19b369);loggerPredictive[_0xcd0d('0x7a')](_0xcd0d('0x84'));return new BPromise(function(_0x27fdb2,_0x19f62b){if(_0x301dd2<=0x0||isNaN(_0x301dd2)){return _0x19f62b(msgResponse(_0xcd0d('0x1ee'),_0xcd0d('0x170'),_0xcd0d('0x1e7')+_0x301dd2));}if(_0x14113c<=0x0||isNaN(_0x14113c)){return _0x19f62b(msgResponse(_0xcd0d('0x1ee'),_0xcd0d('0x170'),_0xcd0d('0x1e8')+_0x14113c));}if(_0x280386<=0x0||isNaN(_0x280386)){return _0x19f62b(msgResponse(_0xcd0d('0x1ee'),_0xcd0d('0x170'),_0xcd0d('0x1e9')+_0x280386));}if(_0xb2d026<=0x0||isNaN(_0xb2d026)){return _0x19f62b(msgResponse('[busyFactor]','Error',_0xcd0d('0x1ea')+_0xb2d026));}if(_0x19b369<=0x0||isNaN(_0x19b369)){return _0x19f62b(msgResponse('[busyFactor]',_0xcd0d('0x170'),'Umin\x20=\x20'+_0x19b369));}_0x4f22b2=_0x4f22b2||0x0;var _0x1dea5c=0x1/_0x14113c;var _0x1d4e2a=0x0;var _0x5a1b5b=0x0;var _0x59fd79=0x0;var _0x593c6a=0x0;for(var _0x4ea5f3=0x0;_0x593c6a<_0x19b369;_0x4ea5f3+=0x1){_0x5a1b5b=_0x4ea5f3/_0xb2d026;_0x1d4e2a=(_0x280386*_0x5a1b5b+_0x4f22b2)/_0x1dea5c;_0x59fd79=erlangb(_0x1d4e2a,_0x301dd2);_0x593c6a=_0x1d4e2a/_0x301dd2*(0x1-erlangb(_0x1d4e2a,_0x301dd2));}return _0x27fdb2({'erlangCalls':_0x4ea5f3,'erlangCallToSecond':_0xb2d026/_0x4ea5f3,'erlangAbandonmentRate':_0x59fd79,'erlangBusyFactor':_0x593c6a});});};module[_0xcd0d('0x1ef')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index 1b0c973..a2fbbb2 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 _0xf5b0=['CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds','diff','seconds','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','name','calleridnum','number','starttime','responsetime','droptime','endtime','ringtime','holdtime','talktime','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId'];(function(_0x2a992f,_0x2d3fab){var _0x597f14=function(_0x52537e){while(--_0x52537e){_0x2a992f['push'](_0x2a992f['shift']());}};_0x597f14(++_0x2d3fab);}(_0xf5b0,0x19b));var _0x0f5b=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0xf5b0[_0x1d9aa0];return _0x226868;};'use strict';var util=require(_0x0f5b('0x0'));var _=require('lodash');var moment=require(_0x0f5b('0x1'));function getSeconds(_0x28e8f6,_0x31b24a){var _0x4ccaff=moment(_0x28e8f6)['milliseconds'](0x0);var _0x52596a=moment(_0x31b24a)[_0x0f5b('0x2')](0x0);return _0x4ccaff[_0x0f5b('0x3')](_0x52596a,_0x0f5b('0x4'));}function QueueCallerAbandon(_0x2a949c,_0x5c57c8){this[_0x0f5b('0x5')]=_0x2a949c[_0x0f5b('0x5')];this[_0x0f5b('0x6')]=_0x2a949c[_0x0f5b('0x6')];this['campaigntype']=_0x2a949c[_0x0f5b('0x6')]===_0x0f5b('0x7')?_0x0f5b('0x8'):_0x2a949c[_0x0f5b('0x6')];this[_0x0f5b('0x9')]=_0x2a949c[_0x0f5b('0x9')];this[_0x0f5b('0xa')]=_0x2a949c[_0x0f5b('0xa')];this[_0x0f5b('0xb')]=_0x2a949c[_0x0f5b('0xb')];this[_0x0f5b('0xc')]=_0x2a949c[_0x0f5b('0x9')]+_0x2a949c[_0x0f5b('0xa')]+_0x2a949c[_0x0f5b('0xb')];this['uniqueid']=_0x5c57c8[_0x0f5b('0xd')];this['calleridname']=_0x2a949c[_0x0f5b('0xe')];this[_0x0f5b('0xf')]=_0x2a949c[_0x0f5b('0x10')];this[_0x0f5b('0x11')]=_0x2a949c[_0x0f5b('0x11')];this[_0x0f5b('0x12')]=_0x2a949c['responsetime'];this[_0x0f5b('0x13')]=_0x2a949c[_0x0f5b('0x13')];this[_0x0f5b('0x14')]=this[_0x0f5b('0x13')];this[_0x0f5b('0x15')]=getSeconds(_0x2a949c[_0x0f5b('0x12')],_0x2a949c[_0x0f5b('0x11')]);this[_0x0f5b('0x16')]=getSeconds(this['droptime'],_0x2a949c[_0x0f5b('0x12')]);this[_0x0f5b('0x17')]=0x0;this[_0x0f5b('0x8')]=_0x5c57c8[_0x0f5b('0x8')];this['membername']=_0x5c57c8[_0x0f5b('0x18')];this[_0x0f5b('0x19')]=_0x5c57c8['reason'];this['callback']=_0x2a949c[_0x0f5b('0x1a')];this[_0x0f5b('0x1b')]=_0x2a949c['callbackuniqueid'];this[_0x0f5b('0x1c')]=_0x2a949c[_0x0f5b('0x1c')];this[_0x0f5b('0x1d')]=_0x2a949c['recallme'];this[_0x0f5b('0x1e')]=_0x2a949c[_0x0f5b('0x1e')];this['ListId']=_0x2a949c['ListId'];this[_0x0f5b('0x1f')]=_0x2a949c[_0x0f5b('0x1f')];this[_0x0f5b('0x20')]=_0x2a949c[_0x0f5b('0x20')];this[_0x0f5b('0x21')]=_0x2a949c[_0x0f5b('0x21')];this[_0x0f5b('0x22')]=_0x2a949c[_0x0f5b('0x22')]||'';this[_0x0f5b('0x23')]=_0x2a949c[_0x0f5b('0x23')]||'';}module[_0x0f5b('0x24')]=QueueCallerAbandon; \ No newline at end of file +var _0x0b0e=['scheduledat','campaigntype','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','calleridname','name','calleridnum','starttime','responsetime','droptime','endtime','ringtime','holdtime','talktime','membername','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','moment','milliseconds','diff','seconds'];(function(_0x35fd86,_0x509107){var _0x564e86=function(_0x5b79d5){while(--_0x5b79d5){_0x35fd86['push'](_0x35fd86['shift']());}};_0x564e86(++_0x509107);}(_0x0b0e,0x187));var _0xe0b0=function(_0x33c637,_0x597c26){_0x33c637=_0x33c637-0x0;var _0x14aa20=_0x0b0e[_0x33c637];return _0x14aa20;};'use strict';var util=require(_0xe0b0('0x0'));var _=require('lodash');var moment=require(_0xe0b0('0x1'));function getSeconds(_0x536e9b,_0x7e5a8a){var _0xdf715e=moment(_0x536e9b)[_0xe0b0('0x2')](0x0);var _0x25153a=moment(_0x7e5a8a)[_0xe0b0('0x2')](0x0);return _0xdf715e[_0xe0b0('0x3')](_0x25153a,_0xe0b0('0x4'));}function QueueCallerAbandon(_0x185efa,_0x30e20d){this[_0xe0b0('0x5')]=_0x185efa[_0xe0b0('0x5')];this['type']=_0x185efa['type'];this[_0xe0b0('0x6')]=_0x185efa[_0xe0b0('0x7')]===_0xe0b0('0x8')?_0xe0b0('0x9'):_0x185efa['type'];this[_0xe0b0('0xa')]=_0x185efa[_0xe0b0('0xa')];this['countcongestionretry']=_0x185efa[_0xe0b0('0xb')];this[_0xe0b0('0xc')]=_0x185efa['countnoanswerretry'];this[_0xe0b0('0xd')]=_0x185efa[_0xe0b0('0xa')]+_0x185efa[_0xe0b0('0xb')]+_0x185efa['countnoanswerretry'];this[_0xe0b0('0xe')]=_0x30e20d[_0xe0b0('0xe')];this[_0xe0b0('0xf')]=_0x185efa[_0xe0b0('0x10')];this[_0xe0b0('0x11')]=_0x185efa['number'];this[_0xe0b0('0x12')]=_0x185efa[_0xe0b0('0x12')];this[_0xe0b0('0x13')]=_0x185efa[_0xe0b0('0x13')];this[_0xe0b0('0x14')]=_0x185efa['droptime'];this[_0xe0b0('0x15')]=this['droptime'];this[_0xe0b0('0x16')]=getSeconds(_0x185efa[_0xe0b0('0x13')],_0x185efa['starttime']);this[_0xe0b0('0x17')]=getSeconds(this['droptime'],_0x185efa[_0xe0b0('0x13')]);this[_0xe0b0('0x18')]=0x0;this['queue']=_0x30e20d['queue'];this[_0xe0b0('0x19')]=_0x30e20d['connectedlinename'];this['reason']=_0x30e20d['reason'];this[_0xe0b0('0x1a')]=_0x185efa['callback'];this['callbackuniqueid']=_0x185efa[_0xe0b0('0x1b')];this['callbackat']=_0x185efa[_0xe0b0('0x1c')];this['recallme']=_0x185efa[_0xe0b0('0x1d')];this[_0xe0b0('0x1e')]=_0x185efa[_0xe0b0('0x1e')];this[_0xe0b0('0x1f')]=_0x185efa[_0xe0b0('0x1f')];this['UserId']=_0x185efa['UserId'];this[_0xe0b0('0x20')]=_0x185efa['VoiceQueueId'];this[_0xe0b0('0x21')]=_0x185efa[_0xe0b0('0x21')];this['originatecalleridnum']=_0x185efa[_0xe0b0('0x22')]||'';this['originatecalleridname']=_0x185efa[_0xe0b0('0x23')]||'';}module['exports']=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 1328fcd..d884b8c 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 _0x955b=['AttachmentId','exports','lodash','moment','channel','format','%s/%s/%s','tech','Trunk','name','fax','path'];(function(_0x262ad8,_0x222f5c){var _0x454092=function(_0x5bc219){while(--_0x5bc219){_0x262ad8['push'](_0x262ad8['shift']());}};_0x454092(++_0x222f5c);}(_0x955b,0x12e));var _0xb955=function(_0x1057cd,_0x4fe93d){_0x1057cd=_0x1057cd-0x0;var _0x149799=_0x955b[_0x1057cd];return _0x149799;};'use strict';var util=require('util');var _=require(_0xb955('0x0'));var moment=require(_0xb955('0x1'));function Action(_0x517f66,_0x6374a8,_0x4e0578){this['uniqueid']=_0x517f66||undefined;this[_0xb955('0x2')]=util[_0xb955('0x3')](_0xb955('0x4'),_0x6374a8[_0xb955('0x5')],_0x6374a8[_0xb955('0x6')][_0xb955('0x7')],_0x4e0578[_0xb955('0x8')]);this['localstationid']=_0x6374a8['localstationid'];this['headerinfo']=_0x6374a8['headerinfo'];this[_0xb955('0x9')]=_0x4e0578[_0xb955('0x9')];this['AttachmentId']=_0x4e0578[_0xb955('0xa')];}module[_0xb955('0xb')]=Action; \ No newline at end of file +var _0xa12b=['format','%s/%s/%s','tech','Trunk','name','fax','headerinfo','path','AttachmentId','exports','moment','uniqueid'];(function(_0x102789,_0x24217f){var _0x4aeb4f=function(_0x48bbcb){while(--_0x48bbcb){_0x102789['push'](_0x102789['shift']());}};_0x4aeb4f(++_0x24217f);}(_0xa12b,0x136));var _0xba12=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa12b[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0xba12('0x0'));function Action(_0x11fc5d,_0x42d060,_0x5be4a2){this[_0xba12('0x1')]=_0x11fc5d||undefined;this['channel']=util[_0xba12('0x2')](_0xba12('0x3'),_0x42d060[_0xba12('0x4')],_0x42d060[_0xba12('0x5')][_0xba12('0x6')],_0x5be4a2[_0xba12('0x7')]);this['localstationid']=_0x42d060['localstationid'];this['headerinfo']=_0x42d060[_0xba12('0x8')];this[_0xba12('0x9')]=_0x5be4a2[_0xba12('0x9')];this['AttachmentId']=_0x5be4a2[_0xba12('0xa')];}module[_0xba12('0xb')]=Action; \ No newline at end of file diff --git a/server/services/ami/fax/index.js b/server/services/ami/fax/index.js index c9c199f..10da64c 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 _0xd64f=['../ami','./rpcDb','./util/util','../rpc/attachment','faxAccounts','trunks','actions','newchannel','syncNewchannel','varset','syncVarSet','newstate','bind','faxstatus','syncFaxStatus','syncReceiveFax','hangup','originateresponse','syncOriginateResponse','prototype','context','from-voip-provider','hasOwnProperty','exten','channels','uniqueid','name','info','\x20syncNewchannel\x20','channel','variable','value','syncNewState','channelstate','channelstatedesc','syncNewExten','operation','status','localstationid','filename','remotestationid','pagestransferred','resolution','transferrate','calleridnum','\x20result\x20conversion\x20file\x20','create','parse','.pdf','application/pdf','notify','error','\x20notify\x20','catch','stringify','\x20receiveFax\x20','merge','AttachmentId','update','SENDING\x20FAILED\x20','then','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','syncHangup','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','SUCCESS','faxstatusstring','SENDING\x20FAILED','send','execOriginate','logger','[Fax][execOriginate][success]','message','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','isValid','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','util','lodash','uuid','path','tiff2pdf','../../../config/logger','fax'];(function(_0x5e64ac,_0x2924c2){var _0xda5065=function(_0x421f45){while(--_0x421f45){_0x5e64ac['push'](_0x5e64ac['shift']());}};_0xda5065(++_0x2924c2);}(_0xd64f,0x1cd));var _0xfd64=function(_0x18ccf5,_0x44915f){_0x18ccf5=_0x18ccf5-0x0;var _0x419f3d=_0xd64f[_0x18ccf5];return _0x419f3d;};'use strict';var util=require(_0xfd64('0x0'));var _=require(_0xfd64('0x1'));var BPromise=require('bluebird');var uuid=require(_0xfd64('0x2'));var moment=require('moment');var path=require(_0xfd64('0x3'));var tiff2pdf=require(_0xfd64('0x4'));var gs=require('./util/gs');var logger=require(_0xfd64('0x5'))(_0xfd64('0x6'));var ami=require(_0xfd64('0x7'));var rpcDb=require(_0xfd64('0x8'));var Channel=require('./channel');var ut=require(_0xfd64('0x9'));var Action=require('./action');var faxAccount=require('../rpc/faxAccount');var attachment=require(_0xfd64('0xa'));var faxMessage=require('../rpc/faxMessage');function Fax(_0x485009){this['channels']={};this[_0xfd64('0xb')]=_0x485009['faxAccounts'];this[_0xfd64('0xc')]=_0x485009[_0xfd64('0xc')];this[_0xfd64('0xd')]={};ami['on'](_0xfd64('0xe'),this[_0xfd64('0xf')]['bind'](this));ami['on'](_0xfd64('0x10'),this[_0xfd64('0x11')]['bind'](this));ami['on'](_0xfd64('0x12'),this['syncNewState'][_0xfd64('0x13')](this));ami['on']('newexten',this['syncNewExten']['bind'](this));ami['on'](_0xfd64('0x14'),this[_0xfd64('0x15')]['bind'](this));ami['on']('receivefax',this[_0xfd64('0x16')]['bind'](this));ami['on'](_0xfd64('0x17'),this['syncHangup']['bind'](this));ami['on'](_0xfd64('0x18'),this[_0xfd64('0x19')][_0xfd64('0x13')](this));}Fax[_0xfd64('0x1a')][_0xfd64('0xf')]=function(_0x2d9db2){if(_0x2d9db2[_0xfd64('0x1b')]===_0xfd64('0x1c')){for(var _0xece1bc in this['faxAccounts']){if(this[_0xfd64('0xb')][_0xfd64('0x1d')](_0xece1bc)){if(_0x2d9db2[_0xfd64('0x1e')]===this[_0xfd64('0xb')][_0xece1bc]['localstationid']){this[_0xfd64('0x1f')][_0x2d9db2[_0xfd64('0x20')]]={};this['channels'][_0x2d9db2[_0xfd64('0x20')]]['channel']=_0x2d9db2['channel'];this[_0xfd64('0x1f')][_0x2d9db2[_0xfd64('0x20')]]['id']=this[_0xfd64('0xb')][_0xece1bc]['id'];this['channels'][_0x2d9db2[_0xfd64('0x20')]][_0xfd64('0x21')]=this[_0xfd64('0xb')][_0xece1bc][_0xfd64('0x21')];logger[_0xfd64('0x22')](_0x2d9db2[_0xfd64('0x20')],_0xfd64('0x23'));}}}}if(this[_0xfd64('0xd')][_0x2d9db2['uniqueid']]){this[_0xfd64('0x1f')][_0x2d9db2[_0xfd64('0x20')]]={};this[_0xfd64('0x1f')][_0x2d9db2['uniqueid']][_0xfd64('0x24')]=_0x2d9db2[_0xfd64('0x24')];logger['info'](_0x2d9db2['uniqueid'],_0xfd64('0x23'));}};Fax[_0xfd64('0x1a')]['syncVarSet']=function(_0x39a225){if(this[_0xfd64('0x1f')][_0x39a225[_0xfd64('0x20')]]){for(var _0x5ea9a8 in _0x39a225[_0xfd64('0x25')]){if(_0x39a225[_0xfd64('0x25')]['hasOwnProperty'](_0x5ea9a8)){this[_0xfd64('0x1f')][_0x39a225['uniqueid']][_0x5ea9a8]=_0x39a225[_0xfd64('0x26')];}}}};Fax[_0xfd64('0x1a')][_0xfd64('0x27')]=function(_0x226f51){if(this[_0xfd64('0x1f')][_0x226f51[_0xfd64('0x20')]]){this['channels'][_0x226f51[_0xfd64('0x20')]][_0xfd64('0x28')]=_0x226f51[_0xfd64('0x28')];this[_0xfd64('0x1f')][_0x226f51['uniqueid']]['channelstatedesc']=_0x226f51[_0xfd64('0x29')];}};Fax[_0xfd64('0x1a')][_0xfd64('0x2a')]=function(_0x4c0e7d){if(this[_0xfd64('0x1f')][_0x4c0e7d[_0xfd64('0x20')]]){for(var _0x86fc67 in _0x4c0e7d[_0xfd64('0x25')]){if(_0x4c0e7d[_0xfd64('0x25')][_0xfd64('0x1d')](_0x86fc67)){this['channels'][_0x4c0e7d['uniqueid']][_0x86fc67]=_0x4c0e7d[_0xfd64('0x26')];}}}};Fax[_0xfd64('0x1a')][_0xfd64('0x15')]=function(_0xd230e8){if(this['channels'][_0xd230e8[_0xfd64('0x20')]]){this[_0xfd64('0x1f')][_0xd230e8[_0xfd64('0x20')]][_0xfd64('0x2b')]=_0xd230e8[_0xfd64('0x2b')];this[_0xfd64('0x1f')][_0xd230e8[_0xfd64('0x20')]][_0xfd64('0x2c')]=_0xd230e8[_0xfd64('0x2c')];this['channels'][_0xd230e8[_0xfd64('0x20')]][_0xfd64('0x2d')]=_0xd230e8['localstationid'];this[_0xfd64('0x1f')][_0xd230e8[_0xfd64('0x20')]]['filename']=_0xd230e8[_0xfd64('0x2e')];logger[_0xfd64('0x22')](_0xd230e8['uniqueid'],'\x20syncFaxStatus\x20');}};Fax[_0xfd64('0x1a')]['syncReceiveFax']=function(_0x36b864){var _0x1c8aa9=this;if(this['channels'][_0x36b864[_0xfd64('0x20')]]){var _0x1fb133=this[_0xfd64('0x1f')][_0x36b864[_0xfd64('0x20')]]['id'];this['channels'][_0x36b864[_0xfd64('0x20')]][_0xfd64('0x2f')]=_0x36b864[_0xfd64('0x2f')];this[_0xfd64('0x1f')][_0x36b864['uniqueid']][_0xfd64('0x30')]=_0x36b864[_0xfd64('0x30')];this['channels'][_0x36b864[_0xfd64('0x20')]]['localstationid']=_0x36b864[_0xfd64('0x2d')];this[_0xfd64('0x1f')][_0x36b864[_0xfd64('0x20')]][_0xfd64('0x31')]=_0x36b864[_0xfd64('0x31')];this[_0xfd64('0x1f')][_0x36b864[_0xfd64('0x20')]][_0xfd64('0x32')]=_0x36b864[_0xfd64('0x32')];this[_0xfd64('0x1f')][_0x36b864[_0xfd64('0x20')]][_0xfd64('0x2e')]=_0x36b864[_0xfd64('0x2e')];this[_0xfd64('0x1f')][_0x36b864[_0xfd64('0x20')]][_0xfd64('0x33')]=_0x36b864[_0xfd64('0x33')];if(this[_0xfd64('0x1f')][_0x36b864[_0xfd64('0x20')]][_0xfd64('0x30')]>0x0){tiff2pdf(_0x36b864[_0xfd64('0x2e')],'/var/opt/motion2/server/files/attachments/',function(_0x273afb){logger['info'](_0x36b864[_0xfd64('0x20')],_0xfd64('0x34'),_0x273afb['message']);attachment[_0xfd64('0x35')]({'name':path[_0xfd64('0x36')](_0x36b864[_0xfd64('0x2e')])[_0xfd64('0x21')],'basename':path[_0xfd64('0x36')](_0x36b864[_0xfd64('0x2e')])[_0xfd64('0x21')]+_0xfd64('0x37'),'type':_0xfd64('0x38')})['then'](function(_0x65e593){faxAccount[_0xfd64('0x39')](_0x1fb133,{'from':_0x36b864['calleridnum'],'mapKey':_0xfd64('0x6'),'body':path[_0xfd64('0x36')](_0x36b864[_0xfd64('0x2e')])['name']+'.pdf','AttachmentId':_0x65e593['id']})['catch'](function(_0x5c3de2){logger[_0xfd64('0x3a')](_0x36b864[_0xfd64('0x20')],_0xfd64('0x3b'),JSON['stringify'](_0x5c3de2));});})[_0xfd64('0x3c')](function(_0x2a35b9){logger['error'](_0x36b864[_0xfd64('0x20')],'\x20receiveFax\x20',JSON[_0xfd64('0x3d')](_0x2a35b9));});});}logger['info'](_0x36b864[_0xfd64('0x20')],_0xfd64('0x3e'));}};Fax[_0xfd64('0x1a')][_0xfd64('0x19')]=function(_0x1c956a){if(this[_0xfd64('0xd')][_0x1c956a[_0xfd64('0x20')]]){_[_0xfd64('0x3f')](this[_0xfd64('0x1f')][_0x1c956a[_0xfd64('0x20')]],_['pick'](_0x1c956a,['response','reason']));}};function updateStatus(_0x4af433){if(_0x4af433[_0xfd64('0x40')]){faxMessage[_0xfd64('0x41')](_0x4af433[_0xfd64('0x40')],{'failMessage':_0xfd64('0x42')})[_0xfd64('0x43')](function(_0x1a0b2e){ut['logger'](_0xfd64('0x44'),_0x1a0b2e);})[_0xfd64('0x3c')](function(_0x1ba7b2){ut['logger'](_0xfd64('0x45'),_0x1ba7b2);});}else{ut['logger'](_0xfd64('0x46'));}}Fax[_0xfd64('0x1a')][_0xfd64('0x47')]=function(_0x183c98,_0x32f40a,_0x407688){var _0x1872e3=this;var _0x590a6c={};if(_0x32f40a){_0x590a6c={'read':_0x32f40a};}else{_0x590a6c={'failMessage':_0x407688};}if(this['actions'][_0x183c98]['AttachmentId']){faxMessage[_0xfd64('0x41')](this[_0xfd64('0xd')][_0x183c98][_0xfd64('0x40')],_0x590a6c)[_0xfd64('0x43')](function(_0x435b8f){ut['logger'](_0xfd64('0x48'),_0x435b8f);})['catch'](function(_0xd93661){ut['logger'](_0xfd64('0x49'),_0xd93661);})[_0xfd64('0x4a')](function(){delete _0x1872e3[_0xfd64('0x1f')][_0x183c98];delete _0x1872e3['actions'][_0x183c98];});}else{ut['logger'](_0xfd64('0x4b'));delete this[_0xfd64('0x1f')][_0x183c98];delete this[_0xfd64('0xd')][_0x183c98];}};Fax['prototype'][_0xfd64('0x4c')]=function(_0x321a40){var _0x171b7a=this;if(this[_0xfd64('0x1f')][_0x321a40['uniqueid']]){if(this['actions'][_0x321a40['uniqueid']]){this['channels'][_0x321a40[_0xfd64('0x20')]]['id']=this[_0xfd64('0xd')][_0x321a40['uniqueid']]['id'];this[_0xfd64('0x1f')][_0x321a40[_0xfd64('0x20')]][_0xfd64('0x21')]=this['actions'][_0x321a40[_0xfd64('0x20')]][_0xfd64('0x21')];}logger[_0xfd64('0x22')](_0x321a40[_0xfd64('0x20')],this['actions'][_0x321a40[_0xfd64('0x20')]]?_0xfd64('0x4d'):_0xfd64('0x4e'),JSON['stringify'](this[_0xfd64('0x1f')][_0x321a40[_0xfd64('0x20')]]));if(this[_0xfd64('0xd')][_0x321a40[_0xfd64('0x20')]]){if(this[_0xfd64('0x1f')][_0x321a40[_0xfd64('0x20')]]['faxpages']>0x0&&this[_0xfd64('0x1f')][_0x321a40[_0xfd64('0x20')]][_0xfd64('0x14')]===_0xfd64('0x4f')){this[_0xfd64('0x47')](_0x321a40[_0xfd64('0x20')],!![]);}else{this[_0xfd64('0x47')](_0x321a40[_0xfd64('0x20')],![],this[_0xfd64('0x1f')][_0x321a40['uniqueid']][_0xfd64('0x50')]?'SENDING\x20FAILED:\x20'+this[_0xfd64('0x1f')][_0x321a40[_0xfd64('0x20')]]['faxstatusstring']:_0xfd64('0x51'));}}}};Fax['prototype'][_0xfd64('0x52')]=function(_0x5e1d79){var _0x233c4b=this;return new BPromise(function(_0x15e2b6,_0x47229d){_0x233c4b[_0xfd64('0x53')](_0x5e1d79,_0x233c4b[_0xfd64('0xb')][_0x5e1d79['FaxAccountId']])[_0xfd64('0x43')](function(_0x132e6c){ut[_0xfd64('0x54')](_0xfd64('0x55'),_0x132e6c);_0x15e2b6(ut[_0xfd64('0x56')]('Fax\x20received'));})[_0xfd64('0x3c')](function(_0x564c51){ut[_0xfd64('0x54')](_0xfd64('0x57'),_0x564c51);updateStatus(_0x5e1d79);_0x47229d(ut[_0xfd64('0x56')](_0xfd64('0x58')));});});};Fax[_0xfd64('0x1a')][_0xfd64('0x59')]=function(_0xa0f9a8){var _0x1906f=this;return new BPromise(function(_0x3de856,_0x1327d9){var _0xc408cb=_0x1906f[_0xfd64('0x5a')](_0x1906f[_0xfd64('0xb')][_0xa0f9a8['FaxAccountId']][_0xfd64('0x5b')],_0xa0f9a8);if(_0xc408cb[_0xfd64('0x5c')]){_0x3de856(ut[_0xfd64('0x56')]('Trunk\x20Reachable'));}else{_0x1327d9(ut[_0xfd64('0x56')](_0xc408cb['message']));}});};function originate(_0x264989,_0x28caf,_0x1e98a3){return new BPromise(function(_0x2b5b71,_0x57714c){if(_0x1e98a3){var _0x14f97f=util[_0xfd64('0x5d')](_0xfd64('0x5e'),path[_0xfd64('0x36')](_0x264989[_0xfd64('0x3')])[_0xfd64('0x21')],_0x264989['path']);gs[_0xfd64('0x5f')](_0x14f97f)[_0xfd64('0x43')](function(){_0x264989[_0xfd64('0x3')]=util[_0xfd64('0x5d')](_0xfd64('0x60'),path['parse'](_0x264989[_0xfd64('0x3')])[_0xfd64('0x61')],path[_0xfd64('0x36')](_0x264989['path'])['name']);_0x28caf[_0xfd64('0x62')]=_0x264989['path'];ut[_0xfd64('0x54')](_0xfd64('0x63'),'');ami[_0xfd64('0x64')](ut[_0xfd64('0x65')](_0x264989,_0x28caf))[_0xfd64('0x43')](function(_0x57b5c9){_0x2b5b71(_0x57b5c9);})[_0xfd64('0x3c')](function(_0x258c18){_0x57714c(_0x258c18);});})[_0xfd64('0x3c')](function(_0x867947){_0x57714c(_0x867947);});}else{ami['Action'](ut[_0xfd64('0x65')](_0x264989,_0x28caf))[_0xfd64('0x43')](function(_0x5a7b67){_0x2b5b71(_0x5a7b67);})[_0xfd64('0x3c')](function(_0x1fc9a0){_0x57714c(_0x1fc9a0);});}});}Fax[_0xfd64('0x1a')][_0xfd64('0x53')]=function(_0x5e19c2,_0x305954){var _0x31d4e7=this;return new BPromise(function(_0x192399,_0x2ddede){var _0x565029=uuid['v4']();var _0x5b0b76=ut[_0xfd64('0x66')](_0x5e19c2,_0x305954);_0x31d4e7[_0xfd64('0xd')][_0x565029]=new Action(_0x565029,_0x305954,_0x5e19c2);var _0x254823=_0x31d4e7[_0xfd64('0xd')][_0x565029];if(path[_0xfd64('0x36')](_0x5e19c2[_0xfd64('0x3')])['ext']===_0xfd64('0x37')){originate(_0x254823,_0x5b0b76,!![])['then'](function(_0x3e57bd){_0x192399(_0x3e57bd);})['catch'](function(_0x4f61a7){_0x2ddede(_0x4f61a7);});}else{originate(_0x254823,_0x5b0b76,![])[_0xfd64('0x43')](function(_0x5c91f5){_0x192399(_0x5c91f5);})['catch'](function(_0x284a79){_0x2ddede(_0x284a79);});}});};Fax['prototype'][_0xfd64('0x67')]=function(_0x210bfe){return!_[_0xfd64('0x68')](_0x210bfe)&&!_[_0xfd64('0x68')](_0x210bfe[_0xfd64('0x21')])&&!_[_0xfd64('0x68')](_0x210bfe[_0xfd64('0x69')])&&_0x210bfe[_0xfd64('0x69')]&&!_['isNil'](this[_0xfd64('0xc')][util[_0xfd64('0x5d')]('SIP/%s',_0x210bfe[_0xfd64('0x21')])])&&!_['isNil'](this[_0xfd64('0xc')][util['format'](_0xfd64('0x6a'),_0x210bfe[_0xfd64('0x21')])][_0xfd64('0x2c')])&&(this[_0xfd64('0xc')][util[_0xfd64('0x5d')](_0xfd64('0x6a'),_0x210bfe[_0xfd64('0x21')])][_0xfd64('0x2c')]===_0xfd64('0x6b')||this['trunks'][util[_0xfd64('0x5d')](_0xfd64('0x6a'),_0x210bfe['name'])]['status']===_0xfd64('0x6c'));};Fax[_0xfd64('0x1a')][_0xfd64('0x5a')]=function(_0x1c7f44,_0x4b744b){if(!this[_0xfd64('0x67')](_0x1c7f44)){ut[_0xfd64('0x54')](_0xfd64('0x6d'),_[_0xfd64('0x68')](_0x1c7f44)?'':_0x1c7f44[_0xfd64('0x21')]+_0xfd64('0x6e'));return{'isValid':![],'message':_0xfd64('0x6f')};}if(_['isNil'](_0x4b744b[_0xfd64('0x6')])){ut[_0xfd64('0x54')](_0xfd64('0x70'),JSON[_0xfd64('0x3d')](_0x4b744b));return{'isValid':![],'message':_0xfd64('0x71')};}if(_[_0xfd64('0x68')](_0x4b744b[_0xfd64('0x3')])){ut[_0xfd64('0x54')](_0xfd64('0x72'),JSON[_0xfd64('0x3d')](_0x4b744b));return{'isValid':![],'message':_0xfd64('0x73')};}return{'isValid':!![],'message':_0xfd64('0x74')};};module['exports']=Fax; \ No newline at end of file +var _0x24ea=['[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','send','FaxAccountId','[Fax][execOriginate][success]','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','Empty\x20path','Is\x20Valid','exports','util','lodash','moment','path','tiff2pdf','../../../config/logger','fax','./channel','./util/util','./action','../rpc/attachment','../rpc/faxMessage','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','syncVarSet','newstate','newexten','syncNewExten','faxstatus','syncFaxStatus','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','context','hasOwnProperty','exten','localstationid','channels','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','syncNewState','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','then','catch','error','\x20receiveFax\x20','stringify','response','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]'];(function(_0x571001,_0x2ae183){var _0x46d37c=function(_0x1b34ce){while(--_0x1b34ce){_0x571001['push'](_0x571001['shift']());}};_0x46d37c(++_0x2ae183);}(_0x24ea,0xa1));var _0xa24e=function(_0x7f943a,_0x44ce53){_0x7f943a=_0x7f943a-0x0;var _0x5fa814=_0x24ea[_0x7f943a];return _0x5fa814;};'use strict';var util=require(_0xa24e('0x0'));var _=require(_0xa24e('0x1'));var BPromise=require('bluebird');var uuid=require('uuid');var moment=require(_0xa24e('0x2'));var path=require(_0xa24e('0x3'));var tiff2pdf=require(_0xa24e('0x4'));var gs=require('./util/gs');var logger=require(_0xa24e('0x5'))(_0xa24e('0x6'));var ami=require('../ami');var rpcDb=require('./rpcDb');var Channel=require(_0xa24e('0x7'));var ut=require(_0xa24e('0x8'));var Action=require(_0xa24e('0x9'));var faxAccount=require('../rpc/faxAccount');var attachment=require(_0xa24e('0xa'));var faxMessage=require(_0xa24e('0xb'));function Fax(_0x11e87c){this['channels']={};this[_0xa24e('0xc')]=_0x11e87c[_0xa24e('0xc')];this[_0xa24e('0xd')]=_0x11e87c[_0xa24e('0xd')];this[_0xa24e('0xe')]={};ami['on'](_0xa24e('0xf'),this[_0xa24e('0x10')][_0xa24e('0x11')](this));ami['on']('varset',this[_0xa24e('0x12')][_0xa24e('0x11')](this));ami['on'](_0xa24e('0x13'),this['syncNewState'][_0xa24e('0x11')](this));ami['on'](_0xa24e('0x14'),this[_0xa24e('0x15')][_0xa24e('0x11')](this));ami['on'](_0xa24e('0x16'),this[_0xa24e('0x17')]['bind'](this));ami['on']('receivefax',this[_0xa24e('0x18')]['bind'](this));ami['on'](_0xa24e('0x19'),this[_0xa24e('0x1a')][_0xa24e('0x11')](this));ami['on'](_0xa24e('0x1b'),this[_0xa24e('0x1c')][_0xa24e('0x11')](this));}Fax[_0xa24e('0x1d')][_0xa24e('0x10')]=function(_0x3d4860){if(_0x3d4860[_0xa24e('0x1e')]==='from-voip-provider'){for(var _0x5e4442 in this[_0xa24e('0xc')]){if(this[_0xa24e('0xc')][_0xa24e('0x1f')](_0x5e4442)){if(_0x3d4860[_0xa24e('0x20')]===this[_0xa24e('0xc')][_0x5e4442][_0xa24e('0x21')]){this[_0xa24e('0x22')][_0x3d4860[_0xa24e('0x23')]]={};this['channels'][_0x3d4860['uniqueid']][_0xa24e('0x24')]=_0x3d4860['channel'];this[_0xa24e('0x22')][_0x3d4860[_0xa24e('0x23')]]['id']=this[_0xa24e('0xc')][_0x5e4442]['id'];this[_0xa24e('0x22')][_0x3d4860['uniqueid']][_0xa24e('0x25')]=this[_0xa24e('0xc')][_0x5e4442][_0xa24e('0x25')];logger[_0xa24e('0x26')](_0x3d4860[_0xa24e('0x23')],_0xa24e('0x27'));}}}}if(this[_0xa24e('0xe')][_0x3d4860[_0xa24e('0x23')]]){this[_0xa24e('0x22')][_0x3d4860['uniqueid']]={};this[_0xa24e('0x22')][_0x3d4860[_0xa24e('0x23')]][_0xa24e('0x24')]=_0x3d4860[_0xa24e('0x24')];logger[_0xa24e('0x26')](_0x3d4860[_0xa24e('0x23')],'\x20syncNewchannel\x20');}};Fax[_0xa24e('0x1d')][_0xa24e('0x12')]=function(_0x524404){if(this[_0xa24e('0x22')][_0x524404[_0xa24e('0x23')]]){for(var _0x5818b3 in _0x524404['variable']){if(_0x524404[_0xa24e('0x28')][_0xa24e('0x1f')](_0x5818b3)){this[_0xa24e('0x22')][_0x524404[_0xa24e('0x23')]][_0x5818b3]=_0x524404[_0xa24e('0x29')];}}}};Fax[_0xa24e('0x1d')][_0xa24e('0x2a')]=function(_0x5ac6c7){if(this[_0xa24e('0x22')][_0x5ac6c7['uniqueid']]){this[_0xa24e('0x22')][_0x5ac6c7['uniqueid']][_0xa24e('0x2b')]=_0x5ac6c7[_0xa24e('0x2b')];this[_0xa24e('0x22')][_0x5ac6c7[_0xa24e('0x23')]][_0xa24e('0x2c')]=_0x5ac6c7['channelstatedesc'];}};Fax[_0xa24e('0x1d')][_0xa24e('0x15')]=function(_0x4ba43d){if(this[_0xa24e('0x22')][_0x4ba43d[_0xa24e('0x23')]]){for(var _0xab0eb3 in _0x4ba43d[_0xa24e('0x28')]){if(_0x4ba43d[_0xa24e('0x28')][_0xa24e('0x1f')](_0xab0eb3)){this[_0xa24e('0x22')][_0x4ba43d['uniqueid']][_0xab0eb3]=_0x4ba43d[_0xa24e('0x29')];}}}};Fax[_0xa24e('0x1d')][_0xa24e('0x17')]=function(_0x44c39d){if(this[_0xa24e('0x22')][_0x44c39d[_0xa24e('0x23')]]){this[_0xa24e('0x22')][_0x44c39d[_0xa24e('0x23')]][_0xa24e('0x2d')]=_0x44c39d[_0xa24e('0x2d')];this['channels'][_0x44c39d[_0xa24e('0x23')]][_0xa24e('0x2e')]=_0x44c39d['status'];this[_0xa24e('0x22')][_0x44c39d[_0xa24e('0x23')]]['localstationid']=_0x44c39d[_0xa24e('0x21')];this[_0xa24e('0x22')][_0x44c39d['uniqueid']][_0xa24e('0x2f')]=_0x44c39d[_0xa24e('0x2f')];logger['info'](_0x44c39d['uniqueid'],_0xa24e('0x30'));}};Fax[_0xa24e('0x1d')]['syncReceiveFax']=function(_0x36132a){var _0x36e266=this;if(this[_0xa24e('0x22')][_0x36132a[_0xa24e('0x23')]]){var _0x31a79e=this[_0xa24e('0x22')][_0x36132a['uniqueid']]['id'];this['channels'][_0x36132a['uniqueid']][_0xa24e('0x31')]=_0x36132a[_0xa24e('0x31')];this[_0xa24e('0x22')][_0x36132a[_0xa24e('0x23')]]['pagestransferred']=_0x36132a['pagestransferred'];this['channels'][_0x36132a['uniqueid']]['localstationid']=_0x36132a[_0xa24e('0x21')];this[_0xa24e('0x22')][_0x36132a[_0xa24e('0x23')]][_0xa24e('0x32')]=_0x36132a[_0xa24e('0x32')];this[_0xa24e('0x22')][_0x36132a[_0xa24e('0x23')]][_0xa24e('0x33')]=_0x36132a[_0xa24e('0x33')];this[_0xa24e('0x22')][_0x36132a[_0xa24e('0x23')]][_0xa24e('0x2f')]=_0x36132a[_0xa24e('0x2f')];this[_0xa24e('0x22')][_0x36132a[_0xa24e('0x23')]][_0xa24e('0x34')]=_0x36132a[_0xa24e('0x34')];if(this['channels'][_0x36132a[_0xa24e('0x23')]]['pagestransferred']>0x0){tiff2pdf(_0x36132a[_0xa24e('0x2f')],_0xa24e('0x35'),function(_0x23315f){logger[_0xa24e('0x26')](_0x36132a[_0xa24e('0x23')],_0xa24e('0x36'),_0x23315f[_0xa24e('0x37')]);attachment[_0xa24e('0x38')]({'name':path[_0xa24e('0x39')](_0x36132a[_0xa24e('0x2f')])[_0xa24e('0x25')],'basename':path['parse'](_0x36132a[_0xa24e('0x2f')])[_0xa24e('0x25')]+_0xa24e('0x3a'),'type':_0xa24e('0x3b')})[_0xa24e('0x3c')](function(_0x8b84b9){faxAccount['notify'](_0x31a79e,{'from':_0x36132a['calleridnum'],'mapKey':_0xa24e('0x6'),'body':path[_0xa24e('0x39')](_0x36132a['filename'])[_0xa24e('0x25')]+'.pdf','AttachmentId':_0x8b84b9['id']})[_0xa24e('0x3d')](function(_0x39fb7c){logger[_0xa24e('0x3e')](_0x36132a['uniqueid'],'\x20notify\x20',JSON['stringify'](_0x39fb7c));});})['catch'](function(_0x377e74){logger[_0xa24e('0x3e')](_0x36132a[_0xa24e('0x23')],_0xa24e('0x3f'),JSON[_0xa24e('0x40')](_0x377e74));});});}logger[_0xa24e('0x26')](_0x36132a['uniqueid'],_0xa24e('0x3f'));}};Fax['prototype']['syncOriginateResponse']=function(_0x1af394){if(this[_0xa24e('0xe')][_0x1af394[_0xa24e('0x23')]]){_['merge'](this[_0xa24e('0x22')][_0x1af394[_0xa24e('0x23')]],_['pick'](_0x1af394,[_0xa24e('0x41'),'reason']));}};function updateStatus(_0x58b50d){if(_0x58b50d[_0xa24e('0x42')]){faxMessage[_0xa24e('0x43')](_0x58b50d['AttachmentId'],{'failMessage':_0xa24e('0x44')})[_0xa24e('0x3c')](function(_0x1e083f){ut[_0xa24e('0x45')](_0xa24e('0x46'),_0x1e083f);})['catch'](function(_0x2b3f60){ut[_0xa24e('0x45')]('[Fax][Message][Error][NoUpdate1]',_0x2b3f60);});}else{ut[_0xa24e('0x45')](_0xa24e('0x47'));}}Fax[_0xa24e('0x1d')][_0xa24e('0x48')]=function(_0x3bcde9,_0x1a0f73,_0x2c1700){var _0x479f90=this;var _0xd2d5f1={};if(_0x1a0f73){_0xd2d5f1={'read':_0x1a0f73};}else{_0xd2d5f1={'failMessage':_0x2c1700};}if(this[_0xa24e('0xe')][_0x3bcde9][_0xa24e('0x42')]){faxMessage[_0xa24e('0x43')](this[_0xa24e('0xe')][_0x3bcde9][_0xa24e('0x42')],_0xd2d5f1)[_0xa24e('0x3c')](function(_0x203889){ut['logger'](_0xa24e('0x49'),_0x203889);})['catch'](function(_0x1a7047){ut[_0xa24e('0x45')](_0xa24e('0x4a'),_0x1a7047);})[_0xa24e('0x4b')](function(){delete _0x479f90[_0xa24e('0x22')][_0x3bcde9];delete _0x479f90[_0xa24e('0xe')][_0x3bcde9];});}else{ut[_0xa24e('0x45')]('[Fax][Message][NoUpdate2]');delete this[_0xa24e('0x22')][_0x3bcde9];delete this['actions'][_0x3bcde9];}};Fax[_0xa24e('0x1d')][_0xa24e('0x1a')]=function(_0x38431a){var _0x5906fb=this;if(this['channels'][_0x38431a[_0xa24e('0x23')]]){if(this[_0xa24e('0xe')][_0x38431a['uniqueid']]){this[_0xa24e('0x22')][_0x38431a['uniqueid']]['id']=this[_0xa24e('0xe')][_0x38431a[_0xa24e('0x23')]]['id'];this[_0xa24e('0x22')][_0x38431a[_0xa24e('0x23')]][_0xa24e('0x25')]=this['actions'][_0x38431a[_0xa24e('0x23')]]['name'];}logger[_0xa24e('0x26')](_0x38431a['uniqueid'],this[_0xa24e('0xe')][_0x38431a[_0xa24e('0x23')]]?_0xa24e('0x4c'):_0xa24e('0x4d'),JSON[_0xa24e('0x40')](this[_0xa24e('0x22')][_0x38431a[_0xa24e('0x23')]]));if(this[_0xa24e('0xe')][_0x38431a[_0xa24e('0x23')]]){if(this['channels'][_0x38431a[_0xa24e('0x23')]][_0xa24e('0x4e')]>0x0&&this[_0xa24e('0x22')][_0x38431a[_0xa24e('0x23')]][_0xa24e('0x16')]===_0xa24e('0x4f')){this[_0xa24e('0x48')](_0x38431a['uniqueid'],!![]);}else{this[_0xa24e('0x48')](_0x38431a['uniqueid'],![],this[_0xa24e('0x22')][_0x38431a['uniqueid']][_0xa24e('0x50')]?_0xa24e('0x51')+this['channels'][_0x38431a[_0xa24e('0x23')]][_0xa24e('0x50')]:'SENDING\x20FAILED');}}}};Fax[_0xa24e('0x1d')][_0xa24e('0x52')]=function(_0x42726b){var _0x4a100c=this;return new BPromise(function(_0x26a81e,_0x10e188){_0x4a100c['execOriginate'](_0x42726b,_0x4a100c[_0xa24e('0xc')][_0x42726b[_0xa24e('0x53')]])[_0xa24e('0x3c')](function(_0x25aab5){ut[_0xa24e('0x45')](_0xa24e('0x54'),_0x25aab5);_0x26a81e(ut['message']('Fax\x20received'));})[_0xa24e('0x3d')](function(_0x664b63){ut['logger'](_0xa24e('0x55'),_0x664b63);updateStatus(_0x42726b);_0x10e188(ut[_0xa24e('0x37')](_0xa24e('0x56')));});});};Fax[_0xa24e('0x1d')][_0xa24e('0x57')]=function(_0x27f1b5){var _0xa816f6=this;return new BPromise(function(_0x3cddd7,_0x3819a3){var _0xa9161f=_0xa816f6[_0xa24e('0x58')](_0xa816f6[_0xa24e('0xc')][_0x27f1b5['FaxAccountId']][_0xa24e('0x59')],_0x27f1b5);if(_0xa9161f[_0xa24e('0x5a')]){_0x3cddd7(ut['message'](_0xa24e('0x5b')));}else{_0x3819a3(ut[_0xa24e('0x37')](_0xa9161f[_0xa24e('0x37')]));}});};function originate(_0x4d8beb,_0x265573,_0x25673a){return new BPromise(function(_0xf5a61d,_0x21b134){if(_0x25673a){var _0x58cae3=util[_0xa24e('0x5c')](_0xa24e('0x5d'),path[_0xa24e('0x39')](_0x4d8beb[_0xa24e('0x3')])[_0xa24e('0x25')],_0x4d8beb[_0xa24e('0x3')]);gs[_0xa24e('0x5e')](_0x58cae3)[_0xa24e('0x3c')](function(){_0x4d8beb['path']=util['format']('%s/%s.tif',path['parse'](_0x4d8beb[_0xa24e('0x3')])[_0xa24e('0x5f')],path[_0xa24e('0x39')](_0x4d8beb[_0xa24e('0x3')])[_0xa24e('0x25')]);_0x265573[_0xa24e('0x60')]=_0x4d8beb['path'];ut[_0xa24e('0x45')](_0xa24e('0x61'),'');ami[_0xa24e('0x62')](ut[_0xa24e('0x63')](_0x4d8beb,_0x265573))[_0xa24e('0x3c')](function(_0x370703){_0xf5a61d(_0x370703);})['catch'](function(_0x225b09){_0x21b134(_0x225b09);});})[_0xa24e('0x3d')](function(_0x3caf48){_0x21b134(_0x3caf48);});}else{ami[_0xa24e('0x62')](ut[_0xa24e('0x63')](_0x4d8beb,_0x265573))[_0xa24e('0x3c')](function(_0x15d146){_0xf5a61d(_0x15d146);})[_0xa24e('0x3d')](function(_0x559bb6){_0x21b134(_0x559bb6);});}});}Fax[_0xa24e('0x1d')]['execOriginate']=function(_0x34ce1e,_0x2cf9e5){var _0x4d2711=this;return new BPromise(function(_0x4dd354,_0x1e75b5){var _0x338cb5=uuid['v4']();var _0x4f3b2d=ut[_0xa24e('0x64')](_0x34ce1e,_0x2cf9e5);_0x4d2711[_0xa24e('0xe')][_0x338cb5]=new Action(_0x338cb5,_0x2cf9e5,_0x34ce1e);var _0x33eb9f=_0x4d2711[_0xa24e('0xe')][_0x338cb5];if(path[_0xa24e('0x39')](_0x34ce1e[_0xa24e('0x3')])[_0xa24e('0x65')]==='.pdf'){originate(_0x33eb9f,_0x4f3b2d,!![])['then'](function(_0x4dc2ff){_0x4dd354(_0x4dc2ff);})[_0xa24e('0x3d')](function(_0x1ff48a){_0x1e75b5(_0x1ff48a);});}else{originate(_0x33eb9f,_0x4f3b2d,![])[_0xa24e('0x3c')](function(_0x150695){_0x4dd354(_0x150695);})[_0xa24e('0x3d')](function(_0x32aa7f){_0x1e75b5(_0x32aa7f);});}});};Fax[_0xa24e('0x1d')][_0xa24e('0x66')]=function(_0x33c054){return!_[_0xa24e('0x67')](_0x33c054)&&!_['isNil'](_0x33c054[_0xa24e('0x25')])&&!_[_0xa24e('0x67')](_0x33c054[_0xa24e('0x68')])&&_0x33c054[_0xa24e('0x68')]&&!_[_0xa24e('0x67')](this[_0xa24e('0xd')][util[_0xa24e('0x5c')](_0xa24e('0x69'),_0x33c054[_0xa24e('0x25')])])&&!_[_0xa24e('0x67')](this[_0xa24e('0xd')][util[_0xa24e('0x5c')](_0xa24e('0x69'),_0x33c054[_0xa24e('0x25')])][_0xa24e('0x2e')])&&(this[_0xa24e('0xd')][util[_0xa24e('0x5c')](_0xa24e('0x69'),_0x33c054['name'])][_0xa24e('0x2e')]===_0xa24e('0x6a')||this['trunks'][util[_0xa24e('0x5c')]('SIP/%s',_0x33c054['name'])][_0xa24e('0x2e')]===_0xa24e('0x6b'));};Fax[_0xa24e('0x1d')][_0xa24e('0x58')]=function(_0x4c9412,_0x14b658){if(!this[_0xa24e('0x66')](_0x4c9412)){ut[_0xa24e('0x45')](_0xa24e('0x6c'),_['isNil'](_0x4c9412)?'':_0x4c9412[_0xa24e('0x25')]+_0xa24e('0x6d'));return{'isValid':![],'message':_0xa24e('0x6e')};}if(_[_0xa24e('0x67')](_0x14b658[_0xa24e('0x6')])){ut[_0xa24e('0x45')](_0xa24e('0x6f'),JSON['stringify'](_0x14b658));return{'isValid':![],'message':_0xa24e('0x70')};}if(_[_0xa24e('0x67')](_0x14b658[_0xa24e('0x3')])){ut[_0xa24e('0x45')]('[Fax][checkTrunk][Empty\x20path]',JSON[_0xa24e('0x40')](_0x14b658));return{'isValid':![],'message':_0xa24e('0x71')};}return{'isValid':!![],'message':_0xa24e('0x72')};};module[_0xa24e('0x73')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 66be5f6..b88f321 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 _0x402a=['error','resolve','then','notify','catch','../../../config/logger','preview','lodash'];(function(_0x47341e,_0x341983){var _0x2a8ae4=function(_0x266dbc){while(--_0x266dbc){_0x47341e['push'](_0x47341e['shift']());}};_0x2a8ae4(++_0x341983);}(_0x402a,0xed));var _0xa402=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x402a[_0x3947c9];return _0x2e7871;};'use strict';var util=require('util');var BPromise=require('bluebird');var logger=require(_0xa402('0x0'))(_0xa402('0x1'));var _=require(_0xa402('0x2'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x322d2b){return function(_0x53a5bc){logger[_0xa402('0x3')](_0x322d2b,util['inspect'](_0x53a5bc,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0xd3f32a,_0x1d71ee){return BPromise[_0xa402('0x4')]()[_0xa402('0x5')](faxAccount[_0xa402('0x6')](_0xd3f32a,_0x1d71ee))[_0xa402('0x7')](loggerCatch('[Notify]\x20'));}; \ No newline at end of file +var _0xc3b0=['../../../config/logger','preview','lodash','../rpc/faxAccount','error','inspect','notify','resolve','catch','[Notify]\x20'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xc3b0,0x15e));var _0x0c3b=function(_0x4fe07a,_0xe0a338){_0x4fe07a=_0x4fe07a-0x0;var _0x1ddbaf=_0xc3b0[_0x4fe07a];return _0x1ddbaf;};'use strict';var util=require('util');var BPromise=require('bluebird');var logger=require(_0x0c3b('0x0'))(_0x0c3b('0x1'));var _=require(_0x0c3b('0x2'));var faxAccount=require(_0x0c3b('0x3'));function loggerCatch(_0x2dde0c){return function(_0x17e0a7){logger[_0x0c3b('0x4')](_0x2dde0c,util[_0x0c3b('0x5')](_0x17e0a7,{'showHidden':![],'depth':null}));};}exports[_0x0c3b('0x6')]=function(_0x30f7a1,_0x402ace){return BPromise[_0x0c3b('0x7')]()['then'](faxAccount[_0x0c3b('0x6')](_0x30f7a1,_0x402ace))[_0x0c3b('0x8')](loggerCatch(_0x0c3b('0x9')));}; \ 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 283cb83..b4240cd 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 _0x0709=['info','Exec\x20gs','\x20Error\x20:','inspect','util','bluebird','exec','execute'];(function(_0x62c958,_0x2bfdbc){var _0x57ec61=function(_0x5c0094){while(--_0x5c0094){_0x62c958['push'](_0x62c958['shift']());}};_0x57ec61(++_0x2bfdbc);}(_0x0709,0x11c));var _0x9070=function(_0x39609a,_0x28a563){_0x39609a=_0x39609a-0x0;var _0xecd92=_0x0709[_0x39609a];return _0xecd92;};'use strict';var util=require(_0x9070('0x0'));var logger=require('../../../../config/logger')('fax');var BPromise=require(_0x9070('0x1'));var exec=require('child_process')[_0x9070('0x2')];exports[_0x9070('0x3')]=function(_0x1f9228){return new BPromise(function(_0x4e65e1,_0xf72506){exec(_0x1f9228,function(_0x258f72,_0x3a2ae9,_0x137be4){logger['info']('Exec\x20gs',_0x3a2ae9);if(_0x258f72){logger[_0x9070('0x4')](_0x9070('0x5'),_0x9070('0x6'),util[_0x9070('0x7')](_0x258f72,{'showHidden':![],'depth':null}),_0x3a2ae9,_0x137be4);_0xf72506(_0x258f72);}_0x4e65e1(_0x3a2ae9);});});}; \ No newline at end of file +var _0x9f4a=['Exec\x20gs','../../../../config/logger','fax','bluebird','info'];(function(_0x1c31f4,_0x21f326){var _0x36ce94=function(_0x3d3b0c){while(--_0x3d3b0c){_0x1c31f4['push'](_0x1c31f4['shift']());}};_0x36ce94(++_0x21f326);}(_0x9f4a,0x173));var _0xa9f4=function(_0x5ea3ff,_0x3729a1){_0x5ea3ff=_0x5ea3ff-0x0;var _0x300b7e=_0x9f4a[_0x5ea3ff];return _0x300b7e;};'use strict';var util=require('util');var logger=require(_0xa9f4('0x0'))(_0xa9f4('0x1'));var BPromise=require(_0xa9f4('0x2'));var exec=require('child_process')['exec'];exports['execute']=function(_0x3b817b){return new BPromise(function(_0x356c8b,_0x34f4ce){exec(_0x3b817b,function(_0x207ec1,_0x2974a0,_0x3006d9){logger[_0xa9f4('0x3')](_0xa9f4('0x4'),_0x2974a0);if(_0x207ec1){logger['info'](_0xa9f4('0x4'),'\x20Error\x20:',util['inspect'](_0x207ec1,{'showHidden':![],'depth':null}),_0x2974a0,_0x3006d9);_0x34f4ce(_0x207ec1);}_0x356c8b(_0x2974a0);});});}; \ 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 5271733..5280c40 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 _0x3140=['util','lodash','moment','../../../../config/logger','logger','info','inspect','addVariables','ecm','minrate','maxrate','modem','faxdetect','t38timeout','localstationid','path','variablesAction','uniqueid','originate','channel','xcally-motion-fax','from-sip','format','\x22%s\x22\x20<%s>','headerinfo'];(function(_0x2cacef,_0xba1573){var _0x289ba6=function(_0x4ac8b9){while(--_0x4ac8b9){_0x2cacef['push'](_0x2cacef['shift']());}};_0x289ba6(++_0xba1573);}(_0x3140,0xaf));var _0x0314=function(_0x53cfb9,_0x10bfb6){_0x53cfb9=_0x53cfb9-0x0;var _0x5072c7=_0x3140[_0x53cfb9];return _0x5072c7;};'use strict';var util=require(_0x0314('0x0'));var _=require(_0x0314('0x1'));var moment=require(_0x0314('0x2'));var logger=require(_0x0314('0x3'))('fax');exports['message']=function(_0x285be5){return{'message':_0x285be5};};exports[_0x0314('0x4')]=function(_0x1c0f66,_0x3e4284){logger[_0x0314('0x5')](_0x1c0f66,util[_0x0314('0x6')](_0x3e4284,{'showHidden':![],'depth':null}));};exports[_0x0314('0x7')]=function(_0xf87d26,_0x11ee94){var _0x44762d={'XMF-ECM':_0x11ee94[_0x0314('0x8')],'XMF-HEADERINFO':_0x11ee94['headerinfo'],'XMF-MINRATE':_0x11ee94[_0x0314('0x9')],'XMF-MAXRATE':_0x11ee94[_0x0314('0xa')],'XMF-MODEM':util['format']('\x22%s\x22',_0x11ee94[_0x0314('0xb')]),'XMF-GATEWAY':_0x11ee94['gateway'],'XMF-FAXDETECT':_0x11ee94[_0x0314('0xc')],'XMF-T38TIMEOUT':_0x11ee94[_0x0314('0xd')],'XMF-LOCALSTATIONID':_0x11ee94[_0x0314('0xe')],'XMF-PATH':_0xf87d26[_0x0314('0xf')]};return _0x44762d;};exports[_0x0314('0x10')]=function(_0x3e9964,_0x516448){return{'actionid':_0x3e9964[_0x0314('0x11')],'action':_0x0314('0x12'),'channel':_0x3e9964[_0x0314('0x13')],'Exten':_0x0314('0x14'),'Context':_0x0314('0x15'),'Priority':'1','callerid':util[_0x0314('0x16')](_0x0314('0x17'),_0x3e9964['headerinfo']?_0x3e9964[_0x0314('0x18')]:'',_0x3e9964[_0x0314('0xe')]),'variable':_0x516448,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x3e9964[_0x0314('0x11')]};}; \ No newline at end of file +var _0x5ff3=['originate','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','headerinfo','uniqueid','lodash','../../../../config/logger','message','logger','info','inspect','addVariables','ecm','minrate','maxrate','format','modem','faxdetect','t38timeout','variablesAction'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x5ff3,0x17d));var _0x35ff=function(_0x425cab,_0xca81f3){_0x425cab=_0x425cab-0x0;var _0x5699e4=_0x5ff3[_0x425cab];return _0x5699e4;};'use strict';var util=require('util');var _=require(_0x35ff('0x0'));var moment=require('moment');var logger=require(_0x35ff('0x1'))('fax');exports[_0x35ff('0x2')]=function(_0x1bb200){return{'message':_0x1bb200};};exports[_0x35ff('0x3')]=function(_0xd0846d,_0x551514){logger[_0x35ff('0x4')](_0xd0846d,util[_0x35ff('0x5')](_0x551514,{'showHidden':![],'depth':null}));};exports[_0x35ff('0x6')]=function(_0x11e738,_0x30c3ff){var _0x495c31={'XMF-ECM':_0x30c3ff[_0x35ff('0x7')],'XMF-HEADERINFO':_0x30c3ff['headerinfo'],'XMF-MINRATE':_0x30c3ff[_0x35ff('0x8')],'XMF-MAXRATE':_0x30c3ff[_0x35ff('0x9')],'XMF-MODEM':util[_0x35ff('0xa')]('\x22%s\x22',_0x30c3ff[_0x35ff('0xb')]),'XMF-GATEWAY':_0x30c3ff['gateway'],'XMF-FAXDETECT':_0x30c3ff[_0x35ff('0xc')],'XMF-T38TIMEOUT':_0x30c3ff[_0x35ff('0xd')],'XMF-LOCALSTATIONID':_0x30c3ff['localstationid'],'XMF-PATH':_0x11e738['path']};return _0x495c31;};exports[_0x35ff('0xe')]=function(_0x574c81,_0x592295){return{'actionid':_0x574c81['uniqueid'],'action':_0x35ff('0xf'),'channel':_0x574c81[_0x35ff('0x10')],'Exten':_0x35ff('0x11'),'Context':_0x35ff('0x12'),'Priority':'1','callerid':util['format'](_0x35ff('0x13'),_0x574c81[_0x35ff('0x14')]?_0x574c81[_0x35ff('0x14')]:'',_0x574c81['localstationid']),'variable':_0x592295,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x574c81[_0x35ff('0x15')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index b3d44e4..5e69f29 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 _0x0569=['resolve','initVoiceQueueReports','initVoiceQueueHopperHistory','getCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','log','sync','bluebird','util','./server','./realtime','./report','./acw','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/cmHopperHistory','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/desk','./rpc/integrations/vtiger','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','hour','then','initAgents','getTelephones','initTelephones','getTrunks','getVoiceQueues','initVoiceQueues','initTriggers','initTemplates','getZendeskAccounts','initZendeskAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getVtigerAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts'];(function(_0x23f798,_0x2f0ef5){var _0x2ae64c=function(_0x5d0556){while(--_0x5d0556){_0x23f798['push'](_0x23f798['shift']());}};_0x2ae64c(++_0x2f0ef5);}(_0x0569,0x183));var _0x9056=function(_0x473738,_0x15ea31){_0x473738=_0x473738-0x0;var _0x1df4ae=_0x0569[_0x473738];return _0x1df4ae;};'use strict';var BPromise=require(_0x9056('0x0'));var util=require(_0x9056('0x1'));var moment=require('moment');var server=require(_0x9056('0x2'));var Realtime=require(_0x9056('0x3'));var Report=require(_0x9056('0x4'));var Acw=require(_0x9056('0x5'));var Trigger=require('./trigger');var Dialer=require(_0x9056('0x6'));var Preview=require(_0x9056('0x7'));var Fax=require(_0x9056('0x8'));var user=require(_0x9056('0x9'));var voiceQueue=require(_0x9056('0xa'));var voiceQueueReport=require(_0x9056('0xb'));var voiceCallReport=require(_0x9056('0xc'));var trunk=require(_0x9056('0xd'));var trigger=require(_0x9056('0xe'));var template=require('./rpc/template');var cmHopperHistory=require(_0x9056('0xf'));var campaign=require('./rpc/campaign');var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require('./rpc/faxAccount');var zendesk=require(_0x9056('0x10'));var salesforce=require(_0x9056('0x11'));var sugarcrm=require(_0x9056('0x12'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0x9056('0x13'));var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0x9056('0x14'));var servicenow=require(_0x9056('0x15'));var dynamics365=require(_0x9056('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()[_0x9056('0x17')](_0x9056('0x18'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x9056('0x17')](_0x9056('0x18'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()[_0x9056('0x19')](user['getAgents']())[_0x9056('0x19')](realtime[_0x9056('0x1a')]())[_0x9056('0x19')](user[_0x9056('0x1b')]())['then'](realtime[_0x9056('0x1c')]())[_0x9056('0x19')](trunk[_0x9056('0x1d')]())['then'](realtime['initTrunks']())['then'](voiceQueue[_0x9056('0x1e')]())[_0x9056('0x19')](realtime[_0x9056('0x1f')]())[_0x9056('0x19')](trigger['getTriggers']())['then'](realtime[_0x9056('0x20')]())[_0x9056('0x19')](template['getTemplates']())[_0x9056('0x19')](realtime[_0x9056('0x21')]())[_0x9056('0x19')](zendesk[_0x9056('0x22')]())[_0x9056('0x19')](realtime[_0x9056('0x23')]())['then'](salesforce['getSalesforceAccounts']())[_0x9056('0x19')](realtime[_0x9056('0x24')]())[_0x9056('0x19')](sugarcrm[_0x9056('0x25')]())['then'](realtime[_0x9056('0x26')]())[_0x9056('0x19')](freshdesk[_0x9056('0x27')]())['then'](realtime[_0x9056('0x28')]())['then'](desk[_0x9056('0x29')]())[_0x9056('0x19')](realtime[_0x9056('0x2a')]())[_0x9056('0x19')](zoho['getZohoAccounts']())[_0x9056('0x19')](realtime['initZohoAccounts']())[_0x9056('0x19')](vtiger[_0x9056('0x2b')]())[_0x9056('0x19')](realtime['initVtigerAccounts']())[_0x9056('0x19')](servicenow[_0x9056('0x2c')]())['then'](realtime[_0x9056('0x2d')]())['then'](dynamics365[_0x9056('0x2e')]())[_0x9056('0x19')](realtime[_0x9056('0x2f')]())[_0x9056('0x19')](campaign[_0x9056('0x30')]())[_0x9056('0x19')](realtime[_0x9056('0x31')]())[_0x9056('0x19')](voiceExtension[_0x9056('0x32')]())[_0x9056('0x19')](realtime[_0x9056('0x33')]())[_0x9056('0x19')](faxAccount[_0x9056('0x34')]())[_0x9056('0x19')](realtime[_0x9056('0x35')]())[_0x9056('0x19')](function(){return realtime;});}function initParams(){return BPromise[_0x9056('0x36')]()[_0x9056('0x19')](voiceQueueReport['getVoiceQueueReports']())[_0x9056('0x19')](realtime[_0x9056('0x37')]())[_0x9056('0x19')](cmHopperHistory['getVoiceQueueHopperHistory']())[_0x9056('0x19')](realtime[_0x9056('0x38')]())[_0x9056('0x19')](cmHopperHistory[_0x9056('0x39')]())['then'](realtime['initCampaignHopperHistory']())[_0x9056('0x19')](voiceCallReport[_0x9056('0x3a')]())[_0x9056('0x19')](realtime[_0x9056('0x3b')]())['then'](function(_0xc38c87){})[_0x9056('0x3c')](function(_0x429b5f){console[_0x9056('0x3d')](_0x429b5f);});}function main(){return server['listen'](realtime,preview,fax)[_0x9056('0x19')](function(_0x484981){return initRealtime();})[_0x9056('0x19')](function(){return initParams();})[_0x9056('0x19')](function(){report[_0x9056('0x3e')]();setInterval(initRealtime,0x1388);})[_0x9056('0x3c')](function(_0x2d1580){console[_0x9056('0x3d')](_0x2d1580);});}main(); \ No newline at end of file +var _0xbffb=['./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/salesforce','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/vtiger','./rpc/integrations/servicenow','get','hour','resolve','then','getAgents','getTelephones','initTelephones','initTrunks','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getZohoAccounts','initZohoAccounts','getServicenowAccounts','initServicenowAccounts','getCampaigns','initCampaigns','initVoiceExtensions','getFaxAccounts','getVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','log','listen','sync','bluebird','moment','./server','./realtime','./report','./acw','./dialer','./preview','./fax','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk'];(function(_0x147497,_0x43e433){var _0x35f45=function(_0x584421){while(--_0x584421){_0x147497['push'](_0x147497['shift']());}};_0x35f45(++_0x43e433);}(_0xbffb,0xa5));var _0xbbff=function(_0x214709,_0x3b6a76){_0x214709=_0x214709-0x0;var _0x4e594e=_0xbffb[_0x214709];return _0x4e594e;};'use strict';var BPromise=require(_0xbbff('0x0'));var util=require('util');var moment=require(_0xbbff('0x1'));var server=require(_0xbbff('0x2'));var Realtime=require(_0xbbff('0x3'));var Report=require(_0xbbff('0x4'));var Acw=require(_0xbbff('0x5'));var Trigger=require('./trigger');var Dialer=require(_0xbbff('0x6'));var Preview=require(_0xbbff('0x7'));var Fax=require(_0xbbff('0x8'));var user=require('./rpc/user');var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0xbbff('0x9'));var voiceCallReport=require(_0xbbff('0xa'));var trunk=require(_0xbbff('0xb'));var trigger=require(_0xbbff('0xc'));var template=require(_0xbbff('0xd'));var cmHopperHistory=require(_0xbbff('0xe'));var campaign=require(_0xbbff('0xf'));var voiceExtension=require(_0xbbff('0x10'));var faxAccount=require(_0xbbff('0x11'));var zendesk=require('./rpc/integrations/zendesk');var salesforce=require(_0xbbff('0x12'));var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require(_0xbbff('0x13'));var desk=require(_0xbbff('0x14'));var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0xbbff('0x15'));var servicenow=require(_0xbbff('0x16'));var dynamics365=require('./rpc/integrations/dynamics365');var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xbbff('0x17')](_0xbbff('0x18'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xbbff('0x17')](_0xbbff('0x18'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0xbbff('0x19')]()[_0xbbff('0x1a')](user[_0xbbff('0x1b')]())[_0xbbff('0x1a')](realtime['initAgents']())[_0xbbff('0x1a')](user[_0xbbff('0x1c')]())[_0xbbff('0x1a')](realtime[_0xbbff('0x1d')]())[_0xbbff('0x1a')](trunk['getTrunks']())['then'](realtime[_0xbbff('0x1e')]())[_0xbbff('0x1a')](voiceQueue['getVoiceQueues']())['then'](realtime['initVoiceQueues']())[_0xbbff('0x1a')](trigger['getTriggers']())[_0xbbff('0x1a')](realtime['initTriggers']())['then'](template[_0xbbff('0x1f')]())[_0xbbff('0x1a')](realtime[_0xbbff('0x20')]())[_0xbbff('0x1a')](zendesk[_0xbbff('0x21')]())[_0xbbff('0x1a')](realtime[_0xbbff('0x22')]())[_0xbbff('0x1a')](salesforce[_0xbbff('0x23')]())['then'](realtime[_0xbbff('0x24')]())[_0xbbff('0x1a')](sugarcrm['getSugarcrmAccounts']())[_0xbbff('0x1a')](realtime[_0xbbff('0x25')]())['then'](freshdesk[_0xbbff('0x26')]())[_0xbbff('0x1a')](realtime[_0xbbff('0x27')]())[_0xbbff('0x1a')](desk['getDeskAccounts']())[_0xbbff('0x1a')](realtime['initDeskAccounts']())[_0xbbff('0x1a')](zoho[_0xbbff('0x28')]())[_0xbbff('0x1a')](realtime[_0xbbff('0x29')]())[_0xbbff('0x1a')](vtiger['getVtigerAccounts']())[_0xbbff('0x1a')](realtime['initVtigerAccounts']())[_0xbbff('0x1a')](servicenow[_0xbbff('0x2a')]())[_0xbbff('0x1a')](realtime[_0xbbff('0x2b')]())[_0xbbff('0x1a')](dynamics365['getDynamics365Accounts']())[_0xbbff('0x1a')](realtime['initDynamics365Accounts']())[_0xbbff('0x1a')](campaign[_0xbbff('0x2c')]())[_0xbbff('0x1a')](realtime[_0xbbff('0x2d')]())['then'](voiceExtension['getVoiceExtensions']())[_0xbbff('0x1a')](realtime[_0xbbff('0x2e')]())[_0xbbff('0x1a')](faxAccount[_0xbbff('0x2f')]())[_0xbbff('0x1a')](realtime['initFaxAccounts']())[_0xbbff('0x1a')](function(){return realtime;});}function initParams(){return BPromise[_0xbbff('0x19')]()[_0xbbff('0x1a')](voiceQueueReport[_0xbbff('0x30')]())['then'](realtime['initVoiceQueueReports']())['then'](cmHopperHistory[_0xbbff('0x31')]())[_0xbbff('0x1a')](realtime[_0xbbff('0x32')]())[_0xbbff('0x1a')](cmHopperHistory[_0xbbff('0x33')]())[_0xbbff('0x1a')](realtime[_0xbbff('0x34')]())[_0xbbff('0x1a')](voiceCallReport[_0xbbff('0x35')]())[_0xbbff('0x1a')](realtime[_0xbbff('0x36')]())[_0xbbff('0x1a')](function(_0x51a286){})[_0xbbff('0x37')](function(_0x3fafff){console[_0xbbff('0x38')](_0x3fafff);});}function main(){return server[_0xbbff('0x39')](realtime,preview,fax)[_0xbbff('0x1a')](function(_0xeb23c2){return initRealtime();})[_0xbbff('0x1a')](function(){return initParams();})[_0xbbff('0x1a')](function(){report[_0xbbff('0x3a')]();setInterval(initRealtime,0x1388);})[_0xbbff('0x37')](function(_0x25a9f4){console[_0xbbff('0x38')](_0x25a9f4);});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index 3077edb..a04be81 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 _0xcef9=['moment','md5','ioredis','redis','localhost','socket.io-emitter','name','email','fullname','state','unknown','stateTime','phone','interface','online','voiceStatus','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','prototype','idle','inuse','voiceStatusTime','format','address','stringify','emit','user:save','exports','lodash','util'];(function(_0x119a07,_0x2289f6){var _0x36025c=function(_0xf28f4){while(--_0xf28f4){_0x119a07['push'](_0x119a07['shift']());}};_0x36025c(++_0x2289f6);}(_0xcef9,0x99));var _0x9cef=function(_0x394939,_0xc426dd){_0x394939=_0x394939-0x0;var _0x335251=_0xcef9[_0x394939];return _0x335251;};'use strict';var _=require(_0x9cef('0x0'));var util=require(_0x9cef('0x1'));var moment=require(_0x9cef('0x2'));var md5=require(_0x9cef('0x3'));var Redis=require(_0x9cef('0x4'));var config=require('../../../config/environment');config[_0x9cef('0x5')]=_['defaults'](config[_0x9cef('0x5')],{'host':_0x9cef('0x6'),'port':0x18eb});var io=require(_0x9cef('0x7'))(new Redis(config[_0x9cef('0x5')]));function Agent(_0x10af1b){this['id']=_0x10af1b['id']||0x0;this[_0x9cef('0x8')]=_0x10af1b[_0x9cef('0x8')]||'';this[_0x9cef('0x9')]=_0x10af1b[_0x9cef('0x9')]||'';this['accountcode']=_0x10af1b['accountcode']||'';this[_0x9cef('0xa')]=_0x10af1b[_0x9cef('0xa')]||'';this[_0x9cef('0xb')]=_0x9cef('0xc');this[_0x9cef('0xd')]=0x0;this['status']=_0x9cef('0xc');this['address']='';this[_0x9cef('0xe')]='';this['mobile']='';this[_0x9cef('0xf')]='';this[_0x9cef('0x10')]=_0x10af1b[_0x9cef('0x10')]||![];this[_0x9cef('0x11')]=_0x9cef('0xc');this['voiceStatusTime']=0x0;this[_0x9cef('0x12')]='';this[_0x9cef('0x13')]='';this[_0x9cef('0x14')]=![];this['local']=![];this[_0x9cef('0x3')]='';}Agent[_0x9cef('0x15')]['updateStatusRealtime']=function(_0x52d15c){var _0x40f6a4;if(_0x52d15c&&_0x52d15c[_0x9cef('0xb')]){_0x40f6a4=_0x52d15c[_0x9cef('0xb')]['toLowerCase']();switch(_0x40f6a4){case'not_inuse':_0x40f6a4=_0x9cef('0x16');break;case _0x9cef('0x17'):_0x40f6a4='talking';break;}}if(_0x40f6a4&&this[_0x9cef('0x11')]!==_0x40f6a4||_0x52d15c['statePause']){this[_0x9cef('0x18')]=_['toNumber'](moment()[_0x9cef('0x19')]('x'));}if(_0x40f6a4){this[_0x9cef('0x11')]=_0x40f6a4;}var _0xd1db5c={'id':this['id'],'name':this[_0x9cef('0x8')],'email':this[_0x9cef('0x9')],'accountcode':this['accountcode'],'fullname':this[_0x9cef('0xa')],'state':this[_0x9cef('0xb')],'stateTime':this[_0x9cef('0xd')],'status':this['status'],'address':this[_0x9cef('0x1a')],'online':this['online'],'voiceStatus':this[_0x9cef('0x11')],'voiceStatusTime':this['voiceStatusTime'],'voiceStatusCallerIdNumber':this[_0x9cef('0x12')],'voiceStatusQueue':this[_0x9cef('0x13')],'interface':this[_0x9cef('0xf')],'onhold':this[_0x9cef('0x14')]};var _0x1f1cc6=md5(JSON[_0x9cef('0x1b')](_0xd1db5c));if(this[_0x9cef('0x3')]!==_0x1f1cc6){this[_0x9cef('0x3')]=_0x1f1cc6;io['to'](util[_0x9cef('0x19')]('user:%s',_0xd1db5c[_0x9cef('0x8')]))[_0x9cef('0x1c')](_0x9cef('0x1d'),_0xd1db5c);}};module[_0x9cef('0x1e')]=Agent; \ No newline at end of file +var _0x8a54=['stringify','user:%s','user:save','exports','lodash','util','moment','md5','redis','defaults','socket.io-emitter','name','email','accountcode','state','unknown','stateTime','address','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','local','prototype','not_inuse','idle','statePause','toNumber','format','fullname'];(function(_0x33d698,_0x229e2){var _0x10ef84=function(_0x4b2741){while(--_0x4b2741){_0x33d698['push'](_0x33d698['shift']());}};_0x10ef84(++_0x229e2);}(_0x8a54,0xca));var _0x48a5=function(_0x5e8df0,_0x350fef){_0x5e8df0=_0x5e8df0-0x0;var _0x2c40b5=_0x8a54[_0x5e8df0];return _0x2c40b5;};'use strict';var _=require(_0x48a5('0x0'));var util=require(_0x48a5('0x1'));var moment=require(_0x48a5('0x2'));var md5=require(_0x48a5('0x3'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x48a5('0x4')]=_[_0x48a5('0x5')](config[_0x48a5('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x48a5('0x6'))(new Redis(config[_0x48a5('0x4')]));function Agent(_0x4a681a){this['id']=_0x4a681a['id']||0x0;this['name']=_0x4a681a[_0x48a5('0x7')]||'';this[_0x48a5('0x8')]=_0x4a681a[_0x48a5('0x8')]||'';this[_0x48a5('0x9')]=_0x4a681a[_0x48a5('0x9')]||'';this['fullname']=_0x4a681a['fullname']||'';this[_0x48a5('0xa')]=_0x48a5('0xb');this[_0x48a5('0xc')]=0x0;this['status']=_0x48a5('0xb');this[_0x48a5('0xd')]='';this['phone']='';this[_0x48a5('0xe')]='';this[_0x48a5('0xf')]='';this[_0x48a5('0x10')]=_0x4a681a['online']||![];this[_0x48a5('0x11')]=_0x48a5('0xb');this[_0x48a5('0x12')]=0x0;this[_0x48a5('0x13')]='';this[_0x48a5('0x14')]='';this['onhold']=![];this[_0x48a5('0x15')]=![];this[_0x48a5('0x3')]='';}Agent[_0x48a5('0x16')]['updateStatusRealtime']=function(_0x2ce538){var _0x51dbf1;if(_0x2ce538&&_0x2ce538[_0x48a5('0xa')]){_0x51dbf1=_0x2ce538[_0x48a5('0xa')]['toLowerCase']();switch(_0x51dbf1){case _0x48a5('0x17'):_0x51dbf1=_0x48a5('0x18');break;case'inuse':_0x51dbf1='talking';break;}}if(_0x51dbf1&&this['voiceStatus']!==_0x51dbf1||_0x2ce538[_0x48a5('0x19')]){this[_0x48a5('0x12')]=_[_0x48a5('0x1a')](moment()[_0x48a5('0x1b')]('x'));}if(_0x51dbf1){this[_0x48a5('0x11')]=_0x51dbf1;}var _0x2f2253={'id':this['id'],'name':this[_0x48a5('0x7')],'email':this[_0x48a5('0x8')],'accountcode':this['accountcode'],'fullname':this[_0x48a5('0x1c')],'state':this[_0x48a5('0xa')],'stateTime':this[_0x48a5('0xc')],'status':this['status'],'address':this['address'],'online':this[_0x48a5('0x10')],'voiceStatus':this[_0x48a5('0x11')],'voiceStatusTime':this['voiceStatusTime'],'voiceStatusCallerIdNumber':this[_0x48a5('0x13')],'voiceStatusQueue':this[_0x48a5('0x14')],'interface':this[_0x48a5('0xf')],'onhold':this['onhold']};var _0x5110ed=md5(JSON[_0x48a5('0x1d')](_0x2f2253));if(this['md5']!==_0x5110ed){this[_0x48a5('0x3')]=_0x5110ed;io['to'](util[_0x48a5('0x1b')](_0x48a5('0x1e'),_0x2f2253[_0x48a5('0x7')]))['emit'](_0x48a5('0x1f'),_0x2f2253);}};module[_0x48a5('0x20')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index f21995d..011a461 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 _0x757a=['sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message'];(function(_0x126977,_0x25df7f){var _0x15e83e=function(_0xcaa3b9){while(--_0xcaa3b9){_0x126977['push'](_0x126977['shift']());}};_0x15e83e(++_0x25df7f);}(_0x757a,0xde));var _0xa757=function(_0x4ae506,_0x4c708f){_0x4ae506=_0x4ae506-0x0;var _0x3ad7dd=_0x757a[_0x4ae506];return _0x3ad7dd;};'use strict';function Campaign(_0x1acf7d){this['id']=_0x1acf7d['id']||0x0;this[_0xa757('0x0')]=_0x1acf7d[_0xa757('0x0')]||'';this['type']=_0x1acf7d['type']||'campaign';this[_0xa757('0x1')]=0x0;this[_0xa757('0x2')]=0x0;this[_0xa757('0x3')]=0x0;this[_0xa757('0x4')]=0x0;this[_0xa757('0x5')]='';this[_0xa757('0x6')]=!![];this['active']=_0x1acf7d[_0xa757('0x7')];this[_0xa757('0x8')]=_0x1acf7d['limitCalls'];this[_0xa757('0x9')]=_0x1acf7d[_0xa757('0x9')]||null;this[_0xa757('0xa')]=_0x1acf7d[_0xa757('0xa')]?_0x1acf7d[_0xa757('0xa')]:null;this['dialOriginateCallerIdName']=_0x1acf7d[_0xa757('0xb')];this[_0xa757('0xc')]=_0x1acf7d[_0xa757('0xc')];this[_0xa757('0xd')]=_0x1acf7d[_0xa757('0xd')]||0x1e;this[_0xa757('0xe')]=_0x1acf7d[_0xa757('0xe')];this['dialCongestionRetryFrequency']=_0x1acf7d['dialCongestionRetryFrequency'];this['dialBusyMaxRetry']=_0x1acf7d['dialBusyMaxRetry'];this['dialBusyRetryFrequency']=_0x1acf7d[_0xa757('0xf')];this['dialNoAnswerMaxRetry']=_0x1acf7d['dialNoAnswerMaxRetry'];this[_0xa757('0x10')]=_0x1acf7d['dialNoAnswerRetryFrequency'];this['dialGlobalMaxRetry']=_0x1acf7d[_0xa757('0x11')];this[_0xa757('0x12')]=_0x1acf7d[_0xa757('0x12')]||_0xa757('0x13');this[_0xa757('0x14')]=_0x1acf7d[_0xa757('0x14')]||undefined;this[_0xa757('0x15')]=_0x1acf7d[_0xa757('0x15')]||undefined;this[_0xa757('0x16')]=_0x1acf7d[_0xa757('0x16')]||undefined;this['TrunkBackup']=_0x1acf7d[_0xa757('0x17')]?_0x1acf7d[_0xa757('0x17')]:undefined;this[_0xa757('0x18')]=_0x1acf7d['Trunk']?_0x1acf7d['Trunk']:undefined;this[_0xa757('0x19')]=_0x1acf7d[_0xa757('0x19')]?_0x1acf7d[_0xa757('0x19')]:undefined;this[_0xa757('0x1a')]=_0x1acf7d[_0xa757('0x1a')]?_0x1acf7d[_0xa757('0x1a')]:undefined;this['dialQueueProject']=_0x1acf7d[_0xa757('0x1a')]?_0x1acf7d['SquareProject'][_0xa757('0x0')]:undefined;this[_0xa757('0x1b')]=_0x1acf7d[_0xa757('0x1b')]||![];this[_0xa757('0x1c')]=_0x1acf7d['dialAMDInitialSilence'];this['dialAMDGreeting']=_0x1acf7d[_0xa757('0x1d')];this[_0xa757('0x1e')]=_0x1acf7d[_0xa757('0x1e')];this[_0xa757('0x1f')]=_0x1acf7d[_0xa757('0x1f')];this[_0xa757('0x20')]=_0x1acf7d[_0xa757('0x20')];this[_0xa757('0x21')]=_0x1acf7d[_0xa757('0x21')];this['dialAMDMaximumNumberOfWords']=_0x1acf7d[_0xa757('0x22')];this['dialAMDSilenceThreshold']=_0x1acf7d[_0xa757('0x23')];this['dialAMDMaximumWordLength']=_0x1acf7d[_0xa757('0x24')];}module[_0xa757('0x25')]=Campaign; \ No newline at end of file +var _0x2032=['ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name','type','campaign','originated','ivrAnswerCallsDay'];(function(_0x11314f,_0x21d160){var _0x2e2e5a=function(_0x14cca1){while(--_0x14cca1){_0x11314f['push'](_0x11314f['shift']());}};_0x2e2e5a(++_0x21d160);}(_0x2032,0xd9));var _0x2203=function(_0x3981b7,_0x536cb1){_0x3981b7=_0x3981b7-0x0;var _0x2446f0=_0x2032[_0x3981b7];return _0x2446f0;};'use strict';function Campaign(_0x4d6c97){this['id']=_0x4d6c97['id']||0x0;this[_0x2203('0x0')]=_0x4d6c97[_0x2203('0x0')]||'';this[_0x2203('0x1')]=_0x4d6c97['type']||_0x2203('0x2');this[_0x2203('0x3')]=0x0;this['temp']=0x0;this[_0x2203('0x4')]=0x0;this[_0x2203('0x5')]=0x0;this[_0x2203('0x6')]='';this[_0x2203('0x7')]=!![];this[_0x2203('0x8')]=_0x4d6c97[_0x2203('0x8')];this[_0x2203('0x9')]=_0x4d6c97[_0x2203('0x9')];this[_0x2203('0xa')]=_0x4d6c97[_0x2203('0xa')]||null;this[_0x2203('0xb')]=_0x4d6c97['dialGlobalInterval']?_0x4d6c97['dialGlobalInterval']:null;this[_0x2203('0xc')]=_0x4d6c97['dialOriginateCallerIdName'];this[_0x2203('0xd')]=_0x4d6c97[_0x2203('0xd')];this[_0x2203('0xe')]=_0x4d6c97['dialOriginateTimeout']||0x1e;this[_0x2203('0xf')]=_0x4d6c97['dialCongestionMaxRetry'];this[_0x2203('0x10')]=_0x4d6c97['dialCongestionRetryFrequency'];this[_0x2203('0x11')]=_0x4d6c97[_0x2203('0x11')];this['dialBusyRetryFrequency']=_0x4d6c97['dialBusyRetryFrequency'];this['dialNoAnswerMaxRetry']=_0x4d6c97['dialNoAnswerMaxRetry'];this['dialNoAnswerRetryFrequency']=_0x4d6c97[_0x2203('0x12')];this['dialGlobalMaxRetry']=_0x4d6c97['dialGlobalMaxRetry'];this[_0x2203('0x13')]=_0x4d6c97[_0x2203('0x13')]||_0x2203('0x14');this[_0x2203('0x15')]=_0x4d6c97[_0x2203('0x15')]||undefined;this[_0x2203('0x16')]=_0x4d6c97[_0x2203('0x16')]||undefined;this[_0x2203('0x17')]=_0x4d6c97[_0x2203('0x17')]||undefined;this[_0x2203('0x18')]=_0x4d6c97['TrunkBackup']?_0x4d6c97[_0x2203('0x18')]:undefined;this[_0x2203('0x19')]=_0x4d6c97['Trunk']?_0x4d6c97[_0x2203('0x19')]:undefined;this[_0x2203('0x1a')]=_0x4d6c97['Interval']?_0x4d6c97[_0x2203('0x1a')]:undefined;this['SquareProject']=_0x4d6c97[_0x2203('0x1b')]?_0x4d6c97[_0x2203('0x1b')]:undefined;this[_0x2203('0x1c')]=_0x4d6c97[_0x2203('0x1b')]?_0x4d6c97[_0x2203('0x1b')][_0x2203('0x0')]:undefined;this['dialAMDActive']=_0x4d6c97[_0x2203('0x1d')]||![];this['dialAMDInitialSilence']=_0x4d6c97['dialAMDInitialSilence'];this[_0x2203('0x1e')]=_0x4d6c97['dialAMDGreeting'];this[_0x2203('0x1f')]=_0x4d6c97[_0x2203('0x1f')];this['dialAMDTotalAnalysisTime']=_0x4d6c97[_0x2203('0x20')];this['dialAMDMinWordLength']=_0x4d6c97['dialAMDMinWordLength'];this[_0x2203('0x21')]=_0x4d6c97[_0x2203('0x21')];this[_0x2203('0x22')]=_0x4d6c97[_0x2203('0x22')];this[_0x2203('0x23')]=_0x4d6c97[_0x2203('0x23')];this[_0x2203('0x24')]=_0x4d6c97[_0x2203('0x24')];}module['exports']=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index df4be12..be7ddde 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 _0x3149=['exports','starttime','destinationchannel','calleridnum','calleridname','connectedlinenum','accountcode','context','uniqueid','linkedid','exten','answertime','endtime','unmanaged','abandoned','lastapplication','duration','holdtime','tag','disposition','monitorFilename','monitors','transfercalleridnum','transferconnectedlinenum'];(function(_0x43970b,_0xcdaba6){var _0x38f892=function(_0x1ab5ef){while(--_0x1ab5ef){_0x43970b['push'](_0x43970b['shift']());}};_0x38f892(++_0xcdaba6);}(_0x3149,0x181));var _0x9314=function(_0x1559e4,_0x4518d1){_0x1559e4=_0x1559e4-0x0;var _0x51e4ca=_0x3149[_0x1559e4];return _0x51e4ca;};'use strict';function Channel(){this[_0x9314('0x0')]=null;this['channel']='';this[_0x9314('0x1')]='';this[_0x9314('0x2')]=0x0;this[_0x9314('0x3')]='';this[_0x9314('0x4')]=undefined;this['connectedlinename']=undefined;this[_0x9314('0x5')]=0x0;this[_0x9314('0x6')]='';this[_0x9314('0x7')]=0x0;this[_0x9314('0x8')]=0x0;this[_0x9314('0x9')]=0x0;this['answered']=![];this[_0x9314('0xa')]=null;this[_0x9314('0xb')]=null;this[_0x9314('0xc')]=![];this[_0x9314('0xd')]=![];this[_0x9314('0xe')]='';this['lastdata']='';this[_0x9314('0xf')]=0x0;this['billableseconds']=0x0;this[_0x9314('0x10')]=0x0;this['type']=null;this[_0x9314('0x11')]=null;this[_0x9314('0x12')]=null;this['monitor']=![];this[_0x9314('0x13')]=null;this['queue']=null;this[_0x9314('0x14')]=[];this[_0x9314('0x15')]=undefined;this[_0x9314('0x16')]=undefined;this['mohtime']=0x0;}module[_0x9314('0x17')]=Channel; \ No newline at end of file +var _0x8ae2=['answered','answertime','endtime','abandoned','lastdata','duration','billableseconds','holdtime','type','tag','disposition','monitor','queue','monitors','exports','starttime','channel','calleridnum','connectedlinenum','accountcode','context','uniqueid'];(function(_0x74c71c,_0x1f424b){var _0x8c1e24=function(_0x318a52){while(--_0x318a52){_0x74c71c['push'](_0x74c71c['shift']());}};_0x8c1e24(++_0x1f424b);}(_0x8ae2,0x143));var _0x28ae=function(_0x415452,_0x5c29cf){_0x415452=_0x415452-0x0;var _0x3d1e19=_0x8ae2[_0x415452];return _0x3d1e19;};'use strict';function Channel(){this[_0x28ae('0x0')]=null;this[_0x28ae('0x1')]='';this['destinationchannel']='';this[_0x28ae('0x2')]=0x0;this['calleridname']='';this[_0x28ae('0x3')]=undefined;this['connectedlinename']=undefined;this[_0x28ae('0x4')]=0x0;this[_0x28ae('0x5')]='';this[_0x28ae('0x6')]=0x0;this['linkedid']=0x0;this['exten']=0x0;this[_0x28ae('0x7')]=![];this[_0x28ae('0x8')]=null;this[_0x28ae('0x9')]=null;this['unmanaged']=![];this[_0x28ae('0xa')]=![];this['lastapplication']='';this[_0x28ae('0xb')]='';this[_0x28ae('0xc')]=0x0;this[_0x28ae('0xd')]=0x0;this[_0x28ae('0xe')]=0x0;this[_0x28ae('0xf')]=null;this[_0x28ae('0x10')]=null;this[_0x28ae('0x11')]=null;this[_0x28ae('0x12')]=![];this['monitorFilename']=null;this[_0x28ae('0x13')]=null;this[_0x28ae('0x14')]=[];this['transfercalleridnum']=undefined;this['transferconnectedlinenum']=undefined;this['mohtime']=0x0;}module[_0x28ae('0x15')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 6dbb8c8..7deb1f7 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 _0x7c8e=['authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri'];(function(_0x503564,_0x55867e){var _0x4be9fd=function(_0x41c543){while(--_0x41c543){_0x503564['push'](_0x503564['shift']());}};_0x4be9fd(++_0x55867e);}(_0x7c8e,0x10e));var _0xe7c8=function(_0x493696,_0x1c1d41){_0x493696=_0x493696-0x0;var _0x3c4e2a=_0x7c8e[_0x493696];return _0x3c4e2a;};'use strict';function DeskAccount(_0x3aa870){this['id']=_0x3aa870['id']||0x0;this[_0xe7c8('0x0')]=_0x3aa870[_0xe7c8('0x0')]||'';this[_0xe7c8('0x1')]=_0x3aa870[_0xe7c8('0x1')]||'';this[_0xe7c8('0x2')]=_0x3aa870[_0xe7c8('0x2')]||'';this[_0xe7c8('0x3')]=_0x3aa870[_0xe7c8('0x3')]||'';this[_0xe7c8('0x4')]=_0x3aa870[_0xe7c8('0x4')]||'';this[_0xe7c8('0x5')]=_0x3aa870[_0xe7c8('0x5')]||'';this[_0xe7c8('0x6')]=_0x3aa870[_0xe7c8('0x6')]||'';this[_0xe7c8('0x7')]=_0x3aa870[_0xe7c8('0x7')]||'';this[_0xe7c8('0x8')]=_0x3aa870[_0xe7c8('0x8')]||'';this['type']=_0x3aa870[_0xe7c8('0x9')]||'';this[_0xe7c8('0xa')]=_0x3aa870[_0xe7c8('0xa')]||'';this['Configurations']=_0x3aa870[_0xe7c8('0xb')]||{};}module[_0xe7c8('0xc')]=DeskAccount; \ No newline at end of file +var _0x04e7=['Configurations','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl'];(function(_0x4d3c4f,_0x56dd8f){var _0x2dadf8=function(_0x55e0aa){while(--_0x55e0aa){_0x4d3c4f['push'](_0x4d3c4f['shift']());}};_0x2dadf8(++_0x56dd8f);}(_0x04e7,0x121));var _0x704e=function(_0x5311e8,_0x57c5bb){_0x5311e8=_0x5311e8-0x0;var _0x582ad8=_0x04e7[_0x5311e8];return _0x582ad8;};'use strict';function DeskAccount(_0x4e3bdd){this['id']=_0x4e3bdd['id']||0x0;this[_0x704e('0x0')]=_0x4e3bdd[_0x704e('0x0')]||'';this[_0x704e('0x1')]=_0x4e3bdd[_0x704e('0x1')]||'';this[_0x704e('0x2')]=_0x4e3bdd[_0x704e('0x2')]||'';this[_0x704e('0x3')]=_0x4e3bdd[_0x704e('0x3')]||'';this[_0x704e('0x4')]=_0x4e3bdd[_0x704e('0x4')]||'';this[_0x704e('0x5')]=_0x4e3bdd['consumerKey']||'';this[_0x704e('0x6')]=_0x4e3bdd[_0x704e('0x6')]||'';this[_0x704e('0x7')]=_0x4e3bdd[_0x704e('0x7')]||'';this[_0x704e('0x8')]=_0x4e3bdd[_0x704e('0x8')]||'';this[_0x704e('0x9')]=_0x4e3bdd[_0x704e('0x9')]||'';this[_0x704e('0xa')]=_0x4e3bdd[_0x704e('0xa')]||'';this[_0x704e('0xb')]=_0x4e3bdd[_0x704e('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 e5f065b..45ff06c 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 _0xdeec=['password','remoteUri','tenantId','clientId','clientSecret','serverUrl','Configurations','name','username'];(function(_0x44ace6,_0x448496){var _0x1b5359=function(_0x149c04){while(--_0x149c04){_0x44ace6['push'](_0x44ace6['shift']());}};_0x1b5359(++_0x448496);}(_0xdeec,0x115));var _0xcdee=function(_0x403baa,_0x3b9824){_0x403baa=_0x403baa-0x0;var _0x65cefc=_0xdeec[_0x403baa];return _0x65cefc;};'use strict';function Dynamics365Account(_0x839933){this['id']=_0x839933['id']||0x0;this['name']=_0x839933[_0xcdee('0x0')]||'';this[_0xcdee('0x1')]=_0x839933[_0xcdee('0x1')]||'';this[_0xcdee('0x2')]=_0x839933[_0xcdee('0x2')]||'';this[_0xcdee('0x3')]=_0x839933['remoteUri']||'';this[_0xcdee('0x4')]=_0x839933[_0xcdee('0x4')]||'';this[_0xcdee('0x5')]=_0x839933[_0xcdee('0x5')]||'';this[_0xcdee('0x6')]=_0x839933[_0xcdee('0x6')]||{};this['serverUrl']=_0x839933[_0xcdee('0x7')]||'';this[_0xcdee('0x8')]=_0x839933[_0xcdee('0x8')]||{};}module['exports']=Dynamics365Account; \ No newline at end of file +var _0xa19d=['exports','name','username','password','remoteUri','tenantId','clientSecret','serverUrl','Configurations'];(function(_0x4ee8be,_0x1c06c6){var _0x2b6758=function(_0x5eba08){while(--_0x5eba08){_0x4ee8be['push'](_0x4ee8be['shift']());}};_0x2b6758(++_0x1c06c6);}(_0xa19d,0x13c));var _0xda19=function(_0x5c5e72,_0x2d1492){_0x5c5e72=_0x5c5e72-0x0;var _0x62d470=_0xa19d[_0x5c5e72];return _0x62d470;};'use strict';function Dynamics365Account(_0x512d3f){this['id']=_0x512d3f['id']||0x0;this['name']=_0x512d3f[_0xda19('0x0')]||'';this[_0xda19('0x1')]=_0x512d3f[_0xda19('0x1')]||'';this[_0xda19('0x2')]=_0x512d3f[_0xda19('0x2')]||'';this[_0xda19('0x3')]=_0x512d3f[_0xda19('0x3')]||'';this[_0xda19('0x4')]=_0x512d3f[_0xda19('0x4')]||'';this['clientId']=_0x512d3f['clientId']||'';this[_0xda19('0x5')]=_0x512d3f['clientSecret']||{};this[_0xda19('0x6')]=_0x512d3f['serverUrl']||'';this[_0xda19('0x7')]=_0x512d3f[_0xda19('0x7')]||{};}module[_0xda19('0x8')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 9de9886..35e700a 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 _0x2786=['exports','name','description','ecm','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId'];(function(_0x26dd96,_0x1e70a6){var _0x1aa18f=function(_0x1e846){while(--_0x1e846){_0x26dd96['push'](_0x26dd96['shift']());}};_0x1aa18f(++_0x1e70a6);}(_0x2786,0xc1));var _0x6278=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x2786[_0x2dafbe];return _0x58a45a;};'use strict';function FaxAccount(_0x46cccf){this['id']=_0x46cccf['id']||0x0;this[_0x6278('0x0')]=_0x46cccf[_0x6278('0x0')]||'';this['description']=_0x46cccf[_0x6278('0x1')];this[_0x6278('0x2')]=_0x46cccf['ecm'];this['headerinfo']=_0x46cccf['headerinfo'];this[_0x6278('0x3')]=_0x46cccf[_0x6278('0x3')];this['minrate']=_0x46cccf[_0x6278('0x4')]||0x960;this[_0x6278('0x5')]=_0x46cccf['maxrate']||0x3840;this[_0x6278('0x6')]=_0x46cccf[_0x6278('0x6')]||_0x6278('0x7');this[_0x6278('0x8')]=_0x46cccf[_0x6278('0x8')]||'no';this[_0x6278('0x9')]=_0x46cccf[_0x6278('0x9')]||'no';this[_0x6278('0xa')]=_0x46cccf['t38timeout']||0x1388;this[_0x6278('0xb')]=_0x46cccf[_0x6278('0xb')]||_0x6278('0xc');this[_0x6278('0xd')]=_0x46cccf[_0x6278('0xd')]?_0x46cccf['Trunk']:undefined;this[_0x6278('0xe')]=_0x46cccf[_0x6278('0xe')];this['key']=_0x46cccf['key'];}module[_0x6278('0xf')]=FaxAccount; \ No newline at end of file +var _0x2507=['headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','Trunk','ListId','key','exports','name','description','ecm'];(function(_0x5e4935,_0x295ab4){var _0x49ca9e=function(_0xd39e51){while(--_0xd39e51){_0x5e4935['push'](_0x5e4935['shift']());}};_0x49ca9e(++_0x295ab4);}(_0x2507,0xda));var _0x7250=function(_0x1c67cf,_0x39cd28){_0x1c67cf=_0x1c67cf-0x0;var _0x5c7969=_0x2507[_0x1c67cf];return _0x5c7969;};'use strict';function FaxAccount(_0x522f6f){this['id']=_0x522f6f['id']||0x0;this[_0x7250('0x0')]=_0x522f6f[_0x7250('0x0')]||'';this[_0x7250('0x1')]=_0x522f6f[_0x7250('0x1')];this['ecm']=_0x522f6f[_0x7250('0x2')];this['headerinfo']=_0x522f6f[_0x7250('0x3')];this[_0x7250('0x4')]=_0x522f6f[_0x7250('0x4')];this[_0x7250('0x5')]=_0x522f6f[_0x7250('0x5')]||0x960;this[_0x7250('0x6')]=_0x522f6f[_0x7250('0x6')]||0x3840;this['modem']=_0x522f6f[_0x7250('0x7')]||_0x7250('0x8');this[_0x7250('0x9')]=_0x522f6f[_0x7250('0x9')]||'no';this['faxdetect']=_0x522f6f[_0x7250('0xa')]||'no';this['t38timeout']=_0x522f6f[_0x7250('0xb')]||0x1388;this[_0x7250('0xc')]=_0x522f6f[_0x7250('0xc')]||'SIP';this[_0x7250('0xd')]=_0x522f6f[_0x7250('0xd')]?_0x522f6f[_0x7250('0xd')]:undefined;this[_0x7250('0xe')]=_0x522f6f[_0x7250('0xe')];this[_0x7250('0xf')]=_0x522f6f['key'];}module[_0x7250('0x10')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 33676f3..375c1dd 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 _0x7d49=['remoteUri','serverUrl','Configurations','name','username','apiKey','token'];(function(_0x10f68e,_0xf198ea){var _0x4c8372=function(_0x38517){while(--_0x38517){_0x10f68e['push'](_0x10f68e['shift']());}};_0x4c8372(++_0xf198ea);}(_0x7d49,0x17d));var _0x97d4=function(_0xf98719,_0x19b25a){_0xf98719=_0xf98719-0x0;var _0xb7d7cd=_0x7d49[_0xf98719];return _0xb7d7cd;};'use strict';function FreshdeskAccount(_0x5f02a7){this['id']=_0x5f02a7['id']||0x0;this[_0x97d4('0x0')]=_0x5f02a7[_0x97d4('0x0')]||'';this['username']=_0x5f02a7[_0x97d4('0x1')]||'';this[_0x97d4('0x2')]=_0x5f02a7[_0x97d4('0x3')]||'';this[_0x97d4('0x4')]=_0x5f02a7[_0x97d4('0x4')]||'';this[_0x97d4('0x5')]=_0x5f02a7[_0x97d4('0x5')]||'';this[_0x97d4('0x6')]=_0x5f02a7[_0x97d4('0x6')]||{};}module['exports']=FreshdeskAccount; \ No newline at end of file +var _0x0f24=['token','serverUrl','Configurations','username','apiKey'];(function(_0x1cfacc,_0x167cca){var _0x5e8766=function(_0x49819e){while(--_0x49819e){_0x1cfacc['push'](_0x1cfacc['shift']());}};_0x5e8766(++_0x167cca);}(_0x0f24,0x80));var _0x40f2=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0f24[_0x14add3];return _0x4a174f;};'use strict';function FreshdeskAccount(_0x19ccb5){this['id']=_0x19ccb5['id']||0x0;this['name']=_0x19ccb5['name']||'';this['username']=_0x19ccb5[_0x40f2('0x0')]||'';this[_0x40f2('0x1')]=_0x19ccb5[_0x40f2('0x2')]||'';this['remoteUri']=_0x19ccb5['remoteUri']||'';this['serverUrl']=_0x19ccb5[_0x40f2('0x3')]||'';this[_0x40f2('0x4')]=_0x19ccb5['Configurations']||{};}module['exports']=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index dd80491..6855b44 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 _0xf1a0=['originalposition','channel','connectedlinenum','connectedlinename','accountcode','context','exten','priority','holdtime','assigned','lastAssignedTo','exports','type','inbound','uniqueid','calleridnum','calleridname','queue','queuecallerleaveAt','position','count','queuecallercompleteAt','queuecallerexit','queuecallerexitAt'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf1a0,0xfc));var _0x0f1a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf1a0[_0x14add3];return _0x4a174f;};'use strict';function QueueReport(){this[_0x0f1a('0x0')]=_0x0f1a('0x1');this[_0x0f1a('0x2')]='';this[_0x0f1a('0x3')]='';this[_0x0f1a('0x4')]='';this[_0x0f1a('0x5')]='';this['queuecallerjoinAt']=null;this[_0x0f1a('0x6')]=null;this[_0x0f1a('0x7')]=0x1;this[_0x0f1a('0x8')]=0x1;this['queuecallerabandon']=![];this['queuecallerabandonAt']=null;this['queuecallercomplete']=![];this[_0x0f1a('0x9')]=null;this[_0x0f1a('0xa')]=![];this[_0x0f1a('0xb')]=null;this[_0x0f1a('0xc')]=0x1;this[_0x0f1a('0xd')]='';this[_0x0f1a('0xe')]='';this[_0x0f1a('0xf')]='';this[_0x0f1a('0x10')]='';this[_0x0f1a('0x11')]='';this[_0x0f1a('0x12')]='';this[_0x0f1a('0x13')]='';this[_0x0f1a('0x14')]=0x0;this[_0x0f1a('0x15')]=![];this[_0x0f1a('0x16')]='';this['mohtime']=0x0;this['variables']={};}module[_0x0f1a('0x17')]=QueueReport; \ No newline at end of file +var _0x271f=['lastAssignedTo','exports','type','inbound','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','channel','connectedlinenum','connectedlinename','accountcode','context','exten','priority','assigned'];(function(_0x5b0fc7,_0x4e34ed){var _0xb806a=function(_0x3cf761){while(--_0x3cf761){_0x5b0fc7['push'](_0x5b0fc7['shift']());}};_0xb806a(++_0x4e34ed);}(_0x271f,0xaa));var _0xf271=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x271f[_0x2b4411];return _0x8e41ef;};'use strict';function QueueReport(){this[_0xf271('0x0')]=_0xf271('0x1');this[_0xf271('0x2')]='';this[_0xf271('0x3')]='';this[_0xf271('0x4')]='';this[_0xf271('0x5')]='';this[_0xf271('0x6')]=null;this['queuecallerleaveAt']=null;this[_0xf271('0x7')]=0x1;this[_0xf271('0x8')]=0x1;this[_0xf271('0x9')]=![];this[_0xf271('0xa')]=null;this['queuecallercomplete']=![];this[_0xf271('0xb')]=null;this[_0xf271('0xc')]=![];this[_0xf271('0xd')]=null;this['originalposition']=0x1;this[_0xf271('0xe')]='';this[_0xf271('0xf')]='';this[_0xf271('0x10')]='';this[_0xf271('0x11')]='';this[_0xf271('0x12')]='';this[_0xf271('0x13')]='';this[_0xf271('0x14')]='';this['holdtime']=0x0;this[_0xf271('0x15')]=![];this[_0xf271('0x16')]='';this['mohtime']=0x0;this['variables']={};}module[_0xf271('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 7dba476..028ed9d 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 _0xb3a3=['password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports','name','remoteUri'];(function(_0x5db740,_0x52dbe2){var _0x3b97a2=function(_0x4bf608){while(--_0x4bf608){_0x5db740['push'](_0x5db740['shift']());}};_0x3b97a2(++_0x52dbe2);}(_0xb3a3,0x132));var _0x3b3a=function(_0x4ff91f,_0xcdecb7){_0x4ff91f=_0x4ff91f-0x0;var _0x320991=_0xb3a3[_0x4ff91f];return _0x320991;};'use strict';function SalesforceAccount(_0x26fc4f){this['id']=_0x26fc4f['id']||0x0;this['name']=_0x26fc4f[_0x3b3a('0x0')]||'';this['username']=_0x26fc4f['username']||'';this[_0x3b3a('0x1')]=_0x26fc4f[_0x3b3a('0x1')]||'';this[_0x3b3a('0x2')]=_0x26fc4f[_0x3b3a('0x2')]||'';this['clientId']=_0x26fc4f[_0x3b3a('0x3')]||'';this[_0x3b3a('0x4')]=_0x26fc4f['clientSecret']||'';this[_0x3b3a('0x5')]=_0x26fc4f[_0x3b3a('0x5')]||'';this[_0x3b3a('0x6')]=_0x26fc4f[_0x3b3a('0x6')]||_0x3b3a('0x7');this['serverUrl']=_0x26fc4f[_0x3b3a('0x8')]||'';this[_0x3b3a('0x9')]=_0x26fc4f[_0x3b3a('0x9')]||{};}module[_0x3b3a('0xa')]=SalesforceAccount; \ No newline at end of file +var _0x402d=['remoteUri','password','clientId','clientSecret','securityToken','type','serverUrl','Configurations','name','username'];(function(_0x4538d5,_0x1ea089){var _0x5e1c67=function(_0x421ade){while(--_0x421ade){_0x4538d5['push'](_0x4538d5['shift']());}};_0x5e1c67(++_0x1ea089);}(_0x402d,0x13e));var _0xd402=function(_0xbee9b3,_0x344eab){_0xbee9b3=_0xbee9b3-0x0;var _0x26960e=_0x402d[_0xbee9b3];return _0x26960e;};'use strict';function SalesforceAccount(_0x2d3355){this['id']=_0x2d3355['id']||0x0;this[_0xd402('0x0')]=_0x2d3355[_0xd402('0x0')]||'';this[_0xd402('0x1')]=_0x2d3355[_0xd402('0x1')]||'';this[_0xd402('0x2')]=_0x2d3355[_0xd402('0x2')]||'';this[_0xd402('0x3')]=_0x2d3355['password']||'';this['clientId']=_0x2d3355[_0xd402('0x4')]||'';this[_0xd402('0x5')]=_0x2d3355[_0xd402('0x5')]||'';this[_0xd402('0x6')]=_0x2d3355[_0xd402('0x6')]||'';this['type']=_0x2d3355[_0xd402('0x7')]||'integrationTab';this[_0xd402('0x8')]=_0x2d3355[_0xd402('0x8')]||'';this[_0xd402('0x9')]=_0x2d3355['Configurations']||{};}module['exports']=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 0a0d06a..9df30cc 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 _0x200f=['remoteUri','Configurations','exports','name','username','password'];(function(_0x52e0ee,_0x52f7c1){var _0x32534c=function(_0x535d65){while(--_0x535d65){_0x52e0ee['push'](_0x52e0ee['shift']());}};_0x32534c(++_0x52f7c1);}(_0x200f,0xc9));var _0xf200=function(_0x4db6d7,_0x5f4e37){_0x4db6d7=_0x4db6d7-0x0;var _0x32ab94=_0x200f[_0x4db6d7];return _0x32ab94;};'use strict';function ServicenowAccount(_0x5139bb){this['id']=_0x5139bb['id']||0x0;this[_0xf200('0x0')]=_0x5139bb['name']||'';this[_0xf200('0x1')]=_0x5139bb[_0xf200('0x1')]||'';this['password']=_0x5139bb[_0xf200('0x2')]||'';this[_0xf200('0x3')]=_0x5139bb[_0xf200('0x3')]||'';this['serverUrl']=_0x5139bb['serverUrl']||'';this[_0xf200('0x4')]=_0x5139bb[_0xf200('0x4')]||{};}module[_0xf200('0x5')]=ServicenowAccount; \ No newline at end of file +var _0x0458=['remoteUri','serverUrl','Configurations','exports','name','username','password'];(function(_0x46f3f8,_0x12c74b){var _0xbc57cd=function(_0x34df37){while(--_0x34df37){_0x46f3f8['push'](_0x46f3f8['shift']());}};_0xbc57cd(++_0x12c74b);}(_0x0458,0xe4));var _0x8045=function(_0x18d5f3,_0x496800){_0x18d5f3=_0x18d5f3-0x0;var _0x1a9106=_0x0458[_0x18d5f3];return _0x1a9106;};'use strict';function ServicenowAccount(_0x33930a){this['id']=_0x33930a['id']||0x0;this[_0x8045('0x0')]=_0x33930a[_0x8045('0x0')]||'';this['username']=_0x33930a[_0x8045('0x1')]||'';this[_0x8045('0x2')]=_0x33930a['password']||'';this[_0x8045('0x3')]=_0x33930a[_0x8045('0x3')]||'';this[_0x8045('0x4')]=_0x33930a[_0x8045('0x4')]||'';this[_0x8045('0x5')]=_0x33930a[_0x8045('0x5')]||{};}module[_0x8045('0x6')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 8e65070..6b060fb 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 _0xf977=['serverUrl','Configurations','exports','name','username','remoteUri'];(function(_0x21ae22,_0x54911f){var _0x1e610a=function(_0x1d2cef){while(--_0x1d2cef){_0x21ae22['push'](_0x21ae22['shift']());}};_0x1e610a(++_0x54911f);}(_0xf977,0x6f));var _0x7f97=function(_0x9d9d9e,_0x349303){_0x9d9d9e=_0x9d9d9e-0x0;var _0x35036a=_0xf977[_0x9d9d9e];return _0x35036a;};'use strict';function SugarcrmAccount(_0x141240){this['id']=_0x141240['id']||0x0;this['name']=_0x141240[_0x7f97('0x0')]||'';this[_0x7f97('0x1')]=_0x141240[_0x7f97('0x1')]||'';this['password']=_0x141240['password']||'';this[_0x7f97('0x2')]=_0x141240[_0x7f97('0x2')]||'';this[_0x7f97('0x3')]=_0x141240[_0x7f97('0x3')]||'';this[_0x7f97('0x4')]=_0x141240[_0x7f97('0x4')]||{};}module[_0x7f97('0x5')]=SugarcrmAccount; \ No newline at end of file +var _0xec76=['Configurations','exports','username','password','remoteUri','serverUrl'];(function(_0x2415a3,_0x4d9c9d){var _0x17a985=function(_0x3f7273){while(--_0x3f7273){_0x2415a3['push'](_0x2415a3['shift']());}};_0x17a985(++_0x4d9c9d);}(_0xec76,0x1d6));var _0x6ec7=function(_0x2b3373,_0x58eab8){_0x2b3373=_0x2b3373-0x0;var _0x23b563=_0xec76[_0x2b3373];return _0x23b563;};'use strict';function SugarcrmAccount(_0x5ace35){this['id']=_0x5ace35['id']||0x0;this['name']=_0x5ace35['name']||'';this['username']=_0x5ace35[_0x6ec7('0x0')]||'';this[_0x6ec7('0x1')]=_0x5ace35[_0x6ec7('0x1')]||'';this[_0x6ec7('0x2')]=_0x5ace35['remoteUri']||'';this[_0x6ec7('0x3')]=_0x5ace35[_0x6ec7('0x3')]||'';this[_0x6ec7('0x4')]=_0x5ace35[_0x6ec7('0x4')]||{};}module[_0x6ec7('0x5')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 4267403..c332750 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 _0x5202=['accountcode','state','unknown','status','address','exports','name'];(function(_0x4d20c0,_0x33210c){var _0x1afcc3=function(_0x1fcc87){while(--_0x1fcc87){_0x4d20c0['push'](_0x4d20c0['shift']());}};_0x1afcc3(++_0x33210c);}(_0x5202,0x76));var _0x2520=function(_0x4754c0,_0x21cf68){_0x4754c0=_0x4754c0-0x0;var _0x275b1a=_0x5202[_0x4754c0];return _0x275b1a;};'use strict';function Telephone(_0x1d82cb){this['id']=_0x1d82cb['id']||0x0;this[_0x2520('0x0')]=_0x1d82cb[_0x2520('0x0')]||'';this['accountcode']=_0x1d82cb[_0x2520('0x1')]||'';this[_0x2520('0x2')]=_0x2520('0x3');this['stateTime']=0x0;this[_0x2520('0x4')]=_0x2520('0x3');this[_0x2520('0x5')]='';}module[_0x2520('0x6')]=Telephone; \ No newline at end of file +var _0x65f8=['unknown','stateTime','status','address','exports','name','accountcode'];(function(_0x4fe463,_0x405d81){var _0x1cfc1b=function(_0x36c2f8){while(--_0x36c2f8){_0x4fe463['push'](_0x4fe463['shift']());}};_0x1cfc1b(++_0x405d81);}(_0x65f8,0xf3));var _0x865f=function(_0x243aca,_0x272cb3){_0x243aca=_0x243aca-0x0;var _0x4a586d=_0x65f8[_0x243aca];return _0x4a586d;};'use strict';function Telephone(_0x57665b){this['id']=_0x57665b['id']||0x0;this[_0x865f('0x0')]=_0x57665b[_0x865f('0x0')]||'';this[_0x865f('0x1')]=_0x57665b['accountcode']||'';this['state']=_0x865f('0x2');this[_0x865f('0x3')]=0x0;this[_0x865f('0x4')]=_0x865f('0x2');this[_0x865f('0x5')]='';}module[_0x865f('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 20934a1..18d634b 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 _0x9c2b=['exports','name','html'];(function(_0xd7b0a4,_0x53c7d3){var _0x184e9e=function(_0x325bbd){while(--_0x325bbd){_0xd7b0a4['push'](_0xd7b0a4['shift']());}};_0x184e9e(++_0x53c7d3);}(_0x9c2b,0x1a5));var _0xb9c2=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0x9c2b[_0x344a3f];return _0x264712;};'use strict';function template(_0x368f7a){this['id']=_0x368f7a['id']||0x0;this[_0xb9c2('0x0')]=_0x368f7a['name']||'';this[_0xb9c2('0x1')]=_0x368f7a[_0xb9c2('0x1')]||'';}module[_0xb9c2('0x2')]=template; \ No newline at end of file +var _0x8fc5=['html','exports','name'];(function(_0x374483,_0x77bebb){var _0x1eced5=function(_0x2dbb3d){while(--_0x2dbb3d){_0x374483['push'](_0x374483['shift']());}};_0x1eced5(++_0x77bebb);}(_0x8fc5,0x1ca));var _0x58fc=function(_0x1f9bb4,_0x525ad2){_0x1f9bb4=_0x1f9bb4-0x0;var _0x101b19=_0x8fc5[_0x1f9bb4];return _0x101b19;};'use strict';function template(_0x1f6dd4){this['id']=_0x1f6dd4['id']||0x0;this[_0x58fc('0x0')]=_0x1f6dd4['name']||'';this[_0x58fc('0x1')]=_0x1f6dd4[_0x58fc('0x1')]||'';}module[_0x58fc('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 9a34475..a46860c 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 _0x00bb=['status','AllConditions','AnyConditions','exports','name','channel'];(function(_0xac1190,_0x5bc363){var _0x34e36f=function(_0x3e9d57){while(--_0x3e9d57){_0xac1190['push'](_0xac1190['shift']());}};_0x34e36f(++_0x5bc363);}(_0x00bb,0x1d8));var _0xb00b=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x00bb[_0x618414];return _0x21c19a;};'use strict';function Trigger(_0x4b870b){this['id']=_0x4b870b['id']||0x0;this[_0xb00b('0x0')]=_0x4b870b[_0xb00b('0x0')]||'';this['channel']=_0x4b870b[_0xb00b('0x1')]||'voice';this[_0xb00b('0x2')]=_0x4b870b[_0xb00b('0x2')]||![];this['AllConditions']=_0x4b870b[_0xb00b('0x3')]||[];this[_0xb00b('0x4')]=_0x4b870b['AnyConditions']||[];this['Actions']=_0x4b870b['Actions']||[];}module[_0xb00b('0x5')]=Trigger; \ No newline at end of file +var _0x3e74=['Actions','name','channel','status','AllConditions','AnyConditions'];(function(_0x1bbdee,_0x4fd560){var _0x42c549=function(_0x2dcd8e){while(--_0x2dcd8e){_0x1bbdee['push'](_0x1bbdee['shift']());}};_0x42c549(++_0x4fd560);}(_0x3e74,0x175));var _0x43e7=function(_0x145d4d,_0x582b2b){_0x145d4d=_0x145d4d-0x0;var _0x55a000=_0x3e74[_0x145d4d];return _0x55a000;};'use strict';function Trigger(_0x284ef8){this['id']=_0x284ef8['id']||0x0;this['name']=_0x284ef8[_0x43e7('0x0')]||'';this[_0x43e7('0x1')]=_0x284ef8[_0x43e7('0x1')]||'voice';this['status']=_0x284ef8[_0x43e7('0x2')]||![];this['AllConditions']=_0x284ef8[_0x43e7('0x3')]||[];this[_0x43e7('0x4')]=_0x284ef8[_0x43e7('0x4')]||[];this[_0x43e7('0x5')]=_0x284ef8[_0x43e7('0x5')]||[];}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 b16d87f..5c6b114 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 _0xa042=['exports','active','name','unknown','stateTime','status','registry','split','domain','domainport','refresh','stateRegistry','address'];(function(_0x1100ec,_0x4c97b1){var _0x9d4dee=function(_0x2bf8a9){while(--_0x2bf8a9){_0x1100ec['push'](_0x1100ec['shift']());}};_0x9d4dee(++_0x4c97b1);}(_0xa042,0xaa));var _0x2a04=function(_0x1c3dcf,_0x2bab00){_0x1c3dcf=_0x1c3dcf-0x0;var _0x343dc1=_0xa042[_0x1c3dcf];return _0x343dc1;};'use strict';function Trunk(_0x51e8dc){this['id']=_0x51e8dc['id']||0x0;this[_0x2a04('0x0')]=_0x51e8dc['active']||![];this[_0x2a04('0x1')]=_0x51e8dc[_0x2a04('0x1')]||'';this['state']=_0x2a04('0x2');this[_0x2a04('0x3')]=0x0;this[_0x2a04('0x4')]=_0x2a04('0x2');this['registry']=_0x51e8dc[_0x2a04('0x5')]&&_0x51e8dc[_0x2a04('0x5')]['indexOf'](':')?_0x51e8dc[_0x2a04('0x5')][_0x2a04('0x6')](':')[0x0]:'';this['host']='';this['port']='';this[_0x2a04('0x7')]='';this[_0x2a04('0x8')]='';this[_0x2a04('0x9')]='';this[_0x2a04('0xa')]=_0x2a04('0x2');this['registrationtime']='';this[_0x2a04('0xb')]='';}module[_0x2a04('0xc')]=Trunk; \ No newline at end of file +var _0x0d52=['stateRegistry','registrationtime','address','active','name','state','unknown','stateTime','status','registry','indexOf','split','domain','domainport','refresh'];(function(_0x237546,_0xa81b26){var _0x233e29=function(_0x728aa4){while(--_0x728aa4){_0x237546['push'](_0x237546['shift']());}};_0x233e29(++_0xa81b26);}(_0x0d52,0x1d4));var _0x20d5=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x0d52[_0x46e363];return _0x3fb059;};'use strict';function Trunk(_0x270de8){this['id']=_0x270de8['id']||0x0;this[_0x20d5('0x0')]=_0x270de8[_0x20d5('0x0')]||![];this[_0x20d5('0x1')]=_0x270de8[_0x20d5('0x1')]||'';this[_0x20d5('0x2')]=_0x20d5('0x3');this[_0x20d5('0x4')]=0x0;this[_0x20d5('0x5')]=_0x20d5('0x3');this[_0x20d5('0x6')]=_0x270de8['registry']&&_0x270de8['registry'][_0x20d5('0x7')](':')?_0x270de8['registry'][_0x20d5('0x8')](':')[0x0]:'';this['host']='';this['port']='';this[_0x20d5('0x9')]='';this[_0x20d5('0xa')]='';this[_0x20d5('0xb')]='';this[_0x20d5('0xc')]='unknown';this[_0x20d5('0xd')]='';this[_0x20d5('0xe')]='';}module['exports']=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 46c6f30..666a740 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 _0xf90d=['recordingFormat','none','mandatoryDisposition','exten'];(function(_0x34bf97,_0xc60f9d){var _0x292719=function(_0x31354e){while(--_0x31354e){_0x34bf97['push'](_0x34bf97['shift']());}};_0x292719(++_0xc60f9d);}(_0xf90d,0xdf));var _0xdf90=function(_0x198035,_0x32ed5c){_0x198035=_0x198035-0x0;var _0x29e8ef=_0xf90d[_0x198035];return _0x29e8ef;};'use strict';function voiceExtension(_0x35fc62){this['id']=_0x35fc62['id']||0x0;this[_0xdf90('0x0')]=_0x35fc62[_0xdf90('0x0')]||'';this[_0xdf90('0x1')]=_0x35fc62[_0xdf90('0x1')]||_0xdf90('0x2');this[_0xdf90('0x3')]=_0x35fc62[_0xdf90('0x3')]||![];}module['exports']=voiceExtension; \ No newline at end of file +var _0xda4b=['exten','recordingFormat','none','mandatoryDisposition','exports'];(function(_0x38c7e3,_0x34b4bc){var _0x34b66f=function(_0x46c913){while(--_0x46c913){_0x38c7e3['push'](_0x38c7e3['shift']());}};_0x34b66f(++_0x34b4bc);}(_0xda4b,0x136));var _0xbda4=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xda4b[_0x5ddb1c];return _0x354adc;};'use strict';function voiceExtension(_0x1191f2){this['id']=_0x1191f2['id']||0x0;this[_0xbda4('0x0')]=_0x1191f2[_0xbda4('0x0')]||'';this['recordingFormat']=_0x1191f2[_0xbda4('0x1')]||_0xbda4('0x2');this['mandatoryDisposition']=_0x1191f2[_0xbda4('0x3')]||![];}module[_0xbda4('0x4')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index b6288c8..b45e2fe 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 _0x8e62=['dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','strategy','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','startProgressive','predictiveIntervalMultiplicativeFactor','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','not_inuse','inuse','busy','invalid','unavailable','ringing','onhold','wav49','gsm','rrmemory','roundrobin','name','monitor_format','type','inbound','waiting','talking','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','loggedIn','available','acw','acwTimeout','autopause','message','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','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval'];(function(_0x255706,_0x4e7e0e){var _0xd7c8f3=function(_0x378571){while(--_0x378571){_0x255706['push'](_0x255706['shift']());}};_0xd7c8f3(++_0x4e7e0e);}(_0x8e62,0x16b));var _0x28e6=function(_0x268111,_0x31c1f9){_0x268111=_0x268111-0x0;var _0x54e72a=_0x8e62[_0x268111];return _0x54e72a;};'use strict';var statusDesc=['unknown',_0x28e6('0x0'),_0x28e6('0x1'),_0x28e6('0x2'),_0x28e6('0x3'),_0x28e6('0x4'),_0x28e6('0x5'),'ringinuse',_0x28e6('0x6')];var monitorFormat={'wav':'wav','wav49':_0x28e6('0x7'),'gsm':_0x28e6('0x8')};var strategy={'rrmemory':_0x28e6('0x9'),'roundrobin':_0x28e6('0xa')};function VoiceQueue(_0x4771fd){this['id']=_0x4771fd['id']||0x0;this[_0x28e6('0xb')]=_0x4771fd['name']||'';this['monitor_format']=_0x4771fd[_0x28e6('0xc')]||'';this[_0x28e6('0xd')]=_0x4771fd[_0x28e6('0xd')]||_0x28e6('0xe');this[_0x28e6('0xf')]=0x0;this[_0x28e6('0x10')]=0x0;this['total']=0x0;this[_0x28e6('0x11')]=0x0;this[_0x28e6('0x12')]=0x0;this[_0x28e6('0x13')]=0x0;this[_0x28e6('0x14')]=0x0;this[_0x28e6('0x15')]=0x0;this[_0x28e6('0x16')]=0x0;this[_0x28e6('0x17')]=0x0;this[_0x28e6('0x18')]=0x0;this[_0x28e6('0x19')]=_0x4771fd[_0x28e6('0x19')]||![];this[_0x28e6('0x1a')]=_0x4771fd[_0x28e6('0x1a')]||0xa;this[_0x28e6('0x1b')]=_0x4771fd['autopause']||'no';this['sendMessageOneNotActive']=!![];this[_0x28e6('0x1c')]='';this['originated']=0x0;this[_0x28e6('0x1d')]=0x0;this[_0x28e6('0x1e')]=_0x4771fd['dialTimezone']||null;this[_0x28e6('0x1f')]=_0x4771fd[_0x28e6('0x1f')]?_0x4771fd[_0x28e6('0x1f')]:null;this[_0x28e6('0x20')]=_0x4771fd[_0x28e6('0x20')];this[_0x28e6('0x21')]=_0x4771fd['dialMethod']||_0x28e6('0x22');this[_0x28e6('0x23')]=_0x4771fd[_0x28e6('0x23')]||0x0;this['dialLimitQueue']=_0x4771fd[_0x28e6('0x24')]||0x0;this[_0x28e6('0x25')]=_0x4771fd[_0x28e6('0x25')]||0x1;this[_0x28e6('0x26')]=_0x4771fd['dialPredictiveOptimization']||_0x28e6('0x27');this[_0x28e6('0x28')]=_0x4771fd[_0x28e6('0x28')]||0.03;this[_0x28e6('0x29')]=_0x4771fd[_0x28e6('0x29')]||0x258;this[_0x28e6('0x2a')]=_0x4771fd[_0x28e6('0x2a')]||_0x28e6('0x2b');this[_0x28e6('0x2c')]=_0x4771fd['dialOriginateCallerIdNumber']||_0x28e6('0x2b');this[_0x28e6('0x2d')]=_0x4771fd[_0x28e6('0x2d')]||0x1e;this[_0x28e6('0x2e')]=_0x4771fd[_0x28e6('0x2e')]||_0x28e6('0x2f');this[_0x28e6('0x30')]=_0x4771fd[_0x28e6('0x30')]||0x3;this[_0x28e6('0x31')]=_0x4771fd[_0x28e6('0x31')]||undefined;this[_0x28e6('0x32')]=_0x4771fd[_0x28e6('0x32')]||0x3;this[_0x28e6('0x33')]=_0x4771fd[_0x28e6('0x33')]||0x96;this[_0x28e6('0x34')]=_0x4771fd[_0x28e6('0x34')]||0x3;this[_0x28e6('0x35')]=_0x4771fd[_0x28e6('0x35')]||0x96;this[_0x28e6('0x36')]=_0x4771fd['dialNoAnswerMaxRetry']||0x3;this[_0x28e6('0x37')]=_0x4771fd[_0x28e6('0x37')]||0x96;this[_0x28e6('0x38')]=_0x4771fd[_0x28e6('0x38')]||0x4;this[_0x28e6('0x39')]=_0x4771fd[_0x28e6('0x39')]?_0x4771fd[_0x28e6('0x39')]:undefined;this['TrunkBackup']=_0x4771fd[_0x28e6('0x3a')]?_0x4771fd[_0x28e6('0x3a')]:undefined;this[_0x28e6('0x3b')]=_0x4771fd[_0x28e6('0x3b')]||undefined;this[_0x28e6('0x3c')]=_0x4771fd['Interval']?_0x4771fd[_0x28e6('0x3c')]:undefined;this[_0x28e6('0x3d')]=_0x4771fd[_0x28e6('0x3d')]||_0x28e6('0x3e');this[_0x28e6('0x3f')]=_0x4771fd[_0x28e6('0x3f')]||undefined;this['dialCutDigit']=_0x4771fd['dialCutDigit']||undefined;this['strategy']=strategy[_0x4771fd[_0x28e6('0x40')]]||_0x28e6('0x9');this['queueStatusComplete']=!![];this[_0x28e6('0x41')]=_0x4771fd[_0x28e6('0x41')]||![];this['dialAMDInitialSilence']=_0x4771fd[_0x28e6('0x42')];this[_0x28e6('0x43')]=_0x4771fd[_0x28e6('0x43')];this['dialAMDAfterGreetingSilence']=_0x4771fd[_0x28e6('0x44')];this[_0x28e6('0x45')]=_0x4771fd['dialAMDTotalAnalysisTime'];this[_0x28e6('0x46')]=_0x4771fd[_0x28e6('0x46')];this[_0x28e6('0x47')]=_0x4771fd[_0x28e6('0x47')];this['dialAMDMaximumNumberOfWords']=_0x4771fd[_0x28e6('0x48')];this['dialAMDSilenceThreshold']=_0x4771fd[_0x28e6('0x49')];this[_0x28e6('0x4a')]=_0x4771fd[_0x28e6('0x4a')];this[_0x28e6('0x4b')]=0x0;this['pTalking']=0x0;this['timeout']=_0x4771fd['timeout'];this[_0x28e6('0x4c')]=0x0;this[_0x28e6('0x4d')]=0x0;this[_0x28e6('0x4e')]=0x0;this['outboundBusyCallsDay']=0x0;this[_0x28e6('0x4f')]=0x0;this[_0x28e6('0x50')]=0x0;this[_0x28e6('0x51')]=0x0;this['outboundBlacklistCallsDay']=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0x28e6('0x52')]=0x0;this[_0x28e6('0x53')]=0x0;this['outboundDropCallsDayACS']=0x0;this['outboundReCallsDay']=0x0;this[_0x28e6('0x54')]=undefined;this['startPredictive']=undefined;this['handlePredictive']=undefined;this[_0x28e6('0x55')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0x28e6('0x56')]=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0x28e6('0x57')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0x28e6('0x58')]=0x0;this['predictiveIntervalPauses']=0x0;this['predictiveIntervalAvailable']=0x0;this[_0x28e6('0x59')]=_0x4771fd[_0x28e6('0x5a')]||0x14;this['predictiveIntervalMinThreshold']=_0x4771fd['dialPredictiveIntervalMaxThreshold']||0xa;this[_0x28e6('0x5b')]=0x0;this[_0x28e6('0x5c')]=0x0;this[_0x28e6('0x5d')]=0x1;this[_0x28e6('0x5e')]=0x0;this[_0x28e6('0x5f')]=0x0;this[_0x28e6('0x60')]=0x0;this[_0x28e6('0x61')]=0x0;this['dialRecallMeTimeout']=_0x4771fd[_0x28e6('0x62')]||0x1e;this['dialRecallInQueue']=_0x4771fd[_0x28e6('0x63')]||![];this['dialQueueProject2']=_0x4771fd[_0x28e6('0x64')]||undefined;this[_0x28e6('0x65')]=_0x4771fd[_0x28e6('0x65')]||![];this[_0x28e6('0x66')]=_0x4771fd[_0x28e6('0x66')]||![];this['monitor_format']=monitorFormat[_0x4771fd[_0x28e6('0xc')]]?monitorFormat[_0x4771fd[_0x28e6('0xc')]]:undefined;this[_0x28e6('0x67')]=_0x4771fd[_0x28e6('0x67')]||![];this[_0x28e6('0x68')]=_0x4771fd[_0x28e6('0x68')]?_0x4771fd[_0x28e6('0x68')]:undefined;}module[_0x28e6('0x69')]=VoiceQueue; \ No newline at end of file +var _0x4869=['startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalHitRate','erlangCalls','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','not_inuse','busy','invalid','ringinuse','onhold','wav','wav49','gsm','rrmemory','roundrobin','name','monitor_format','type','inbound','waiting','talking','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','acwTimeout','autopause','message','originated','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','Trunk','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayTimeout','outboundReCallsDay','startProgressive'];(function(_0xd06a8b,_0x3ce43e){var _0xe9b203=function(_0x50b56b){while(--_0x50b56b){_0xd06a8b['push'](_0xd06a8b['shift']());}};_0xe9b203(++_0x3ce43e);}(_0x4869,0x7d));var _0x9486=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0x4869[_0x21549c];return _0x426cbd;};'use strict';var statusDesc=['unknown',_0x9486('0x0'),'inuse',_0x9486('0x1'),_0x9486('0x2'),'unavailable','ringing',_0x9486('0x3'),_0x9486('0x4')];var monitorFormat={'wav':_0x9486('0x5'),'wav49':_0x9486('0x6'),'gsm':_0x9486('0x7')};var strategy={'rrmemory':_0x9486('0x8'),'roundrobin':_0x9486('0x9')};function VoiceQueue(_0x4791b0){this['id']=_0x4791b0['id']||0x0;this[_0x9486('0xa')]=_0x4791b0[_0x9486('0xa')]||'';this['monitor_format']=_0x4791b0[_0x9486('0xb')]||'';this[_0x9486('0xc')]=_0x4791b0[_0x9486('0xc')]||_0x9486('0xd');this[_0x9486('0xe')]=0x0;this[_0x9486('0xf')]=0x0;this['total']=0x0;this[_0x9486('0x10')]=0x0;this[_0x9486('0x11')]=0x0;this[_0x9486('0x12')]=0x0;this[_0x9486('0x13')]=0x0;this[_0x9486('0x14')]=0x0;this['abandoned']=0x0;this['loggedIn']=0x0;this['available']=0x0;this['acw']=_0x4791b0['acw']||![];this[_0x9486('0x15')]=_0x4791b0[_0x9486('0x15')]||0xa;this[_0x9486('0x16')]=_0x4791b0[_0x9486('0x16')]||'no';this['sendMessageOneNotActive']=!![];this[_0x9486('0x17')]='';this[_0x9486('0x18')]=0x0;this['temp']=0x0;this[_0x9486('0x19')]=_0x4791b0[_0x9486('0x19')]||null;this[_0x9486('0x1a')]=_0x4791b0[_0x9486('0x1a')]?_0x4791b0[_0x9486('0x1a')]:null;this[_0x9486('0x1b')]=_0x4791b0[_0x9486('0x1b')];this[_0x9486('0x1c')]=_0x4791b0[_0x9486('0x1c')]||_0x9486('0x1d');this['dialLimitChannel']=_0x4791b0[_0x9486('0x1e')]||0x0;this[_0x9486('0x1f')]=_0x4791b0['dialLimitQueue']||0x0;this['dialPowerLevel']=_0x4791b0[_0x9486('0x20')]||0x1;this[_0x9486('0x21')]=_0x4791b0['dialPredictiveOptimization']||_0x9486('0x22');this[_0x9486('0x23')]=_0x4791b0['dialPredictiveOptimizationPercentage']||0.03;this['dialPredictiveInterval']=_0x4791b0[_0x9486('0x24')]||0x258;this[_0x9486('0x25')]=_0x4791b0['dialOriginateCallerIdName']||_0x9486('0x26');this[_0x9486('0x27')]=_0x4791b0[_0x9486('0x27')]||_0x9486('0x26');this[_0x9486('0x28')]=_0x4791b0['dialOriginateTimeout']||0x1e;this[_0x9486('0x29')]=_0x4791b0[_0x9486('0x29')]||_0x9486('0x2a');this[_0x9486('0x2b')]=_0x4791b0[_0x9486('0x2b')]||0x3;this[_0x9486('0x2c')]=_0x4791b0[_0x9486('0x2c')]||undefined;this[_0x9486('0x2d')]=_0x4791b0[_0x9486('0x2d')]||0x3;this[_0x9486('0x2e')]=_0x4791b0[_0x9486('0x2e')]||0x96;this['dialBusyMaxRetry']=_0x4791b0['dialBusyMaxRetry']||0x3;this[_0x9486('0x2f')]=_0x4791b0[_0x9486('0x2f')]||0x96;this[_0x9486('0x30')]=_0x4791b0[_0x9486('0x30')]||0x3;this['dialNoAnswerRetryFrequency']=_0x4791b0[_0x9486('0x31')]||0x96;this[_0x9486('0x32')]=_0x4791b0[_0x9486('0x32')]||0x4;this['Trunk']=_0x4791b0['Trunk']?_0x4791b0[_0x9486('0x33')]:undefined;this['TrunkBackup']=_0x4791b0['TrunkBackup']?_0x4791b0['TrunkBackup']:undefined;this[_0x9486('0x34')]=_0x4791b0['dialPrefix']||undefined;this['Interval']=_0x4791b0[_0x9486('0x35')]?_0x4791b0['Interval']:undefined;this['dialOrderByScheduledAt']=_0x4791b0[_0x9486('0x36')]||_0x9486('0x37');this[_0x9486('0x38')]=_0x4791b0['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x9486('0x39')]=_0x4791b0[_0x9486('0x39')]||undefined;this[_0x9486('0x3a')]=strategy[_0x4791b0[_0x9486('0x3a')]]||_0x9486('0x8');this[_0x9486('0x3b')]=!![];this[_0x9486('0x3c')]=_0x4791b0[_0x9486('0x3c')]||![];this[_0x9486('0x3d')]=_0x4791b0[_0x9486('0x3d')];this[_0x9486('0x3e')]=_0x4791b0['dialAMDGreeting'];this[_0x9486('0x3f')]=_0x4791b0[_0x9486('0x3f')];this[_0x9486('0x40')]=_0x4791b0[_0x9486('0x40')];this[_0x9486('0x41')]=_0x4791b0['dialAMDMinWordLength'];this[_0x9486('0x42')]=_0x4791b0[_0x9486('0x42')];this[_0x9486('0x43')]=_0x4791b0['dialAMDMaximumNumberOfWords'];this[_0x9486('0x44')]=_0x4791b0[_0x9486('0x44')];this[_0x9486('0x45')]=_0x4791b0[_0x9486('0x45')];this[_0x9486('0x46')]=0x0;this[_0x9486('0x47')]=0x0;this[_0x9486('0x48')]=_0x4791b0['timeout'];this['outboundAnswerCallsDay']=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0x9486('0x49')]=0x0;this['outboundBusyCallsDay']=0x0;this[_0x9486('0x4a')]=0x0;this[_0x9486('0x4b')]=0x0;this[_0x9486('0x4c')]=0x0;this[_0x9486('0x4d')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0x9486('0x4e')]=0x0;this['outboundDropCallsDayACS']=0x0;this[_0x9486('0x4f')]=0x0;this[_0x9486('0x50')]=undefined;this[_0x9486('0x51')]=undefined;this[_0x9486('0x52')]=undefined;this[_0x9486('0x53')]=1.05;this[_0x9486('0x54')]=0x0;this[_0x9486('0x55')]=0x0;this[_0x9486('0x56')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this[_0x9486('0x57')]=0x0;this['predictiveIntervalAvgTalktime']=0x0;this['predictiveIntervalPauses']=0x0;this['predictiveIntervalAvailable']=0x0;this[_0x9486('0x58')]=_0x4791b0['dialPredictiveIntervalMaxThreshold']||0x14;this[_0x9486('0x59')]=_0x4791b0[_0x9486('0x5a')]||0xa;this[_0x9486('0x5b')]=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this[_0x9486('0x5c')]=0x1;this[_0x9486('0x5d')]=0x0;this['erlangCallToSecond']=0x0;this['erlangAbandonmentRate']=0x0;this[_0x9486('0x5e')]=0x0;this[_0x9486('0x5f')]=_0x4791b0['dialRecallMeTimeout']||0x1e;this[_0x9486('0x60')]=_0x4791b0[_0x9486('0x60')]||![];this[_0x9486('0x61')]=_0x4791b0['dialQueueProject2']||undefined;this[_0x9486('0x62')]=_0x4791b0[_0x9486('0x62')]||![];this[_0x9486('0x63')]=_0x4791b0[_0x9486('0x63')]||![];this[_0x9486('0xb')]=monitorFormat[_0x4791b0[_0x9486('0xb')]]?monitorFormat[_0x4791b0[_0x9486('0xb')]]:undefined;this['mandatoryDisposition']=_0x4791b0[_0x9486('0x64')]||![];this['mandatoryDispositionPause']=_0x4791b0[_0x9486('0x65')]?_0x4791b0[_0x9486('0x65')]:undefined;}module[_0x9486('0x66')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index dad1d9c..afb008e 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 _0x14d9=['name','username','accessKey','remoteUri','serverUrl','Configurations','exports'];(function(_0x51e347,_0x1b565a){var _0x49ab46=function(_0x5962cf){while(--_0x5962cf){_0x51e347['push'](_0x51e347['shift']());}};_0x49ab46(++_0x1b565a);}(_0x14d9,0x85));var _0x914d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x14d9[_0x3dd15e];return _0x231fd0;};'use strict';function VtigerAccount(_0x139b30){this['id']=_0x139b30['id']||0x0;this[_0x914d('0x0')]=_0x139b30[_0x914d('0x0')]||'';this[_0x914d('0x1')]=_0x139b30['username']||'';this[_0x914d('0x2')]=_0x139b30[_0x914d('0x2')]||'';this[_0x914d('0x3')]=_0x139b30[_0x914d('0x3')]||'';this['serverUrl']=_0x139b30[_0x914d('0x4')]||'';this[_0x914d('0x5')]=_0x139b30[_0x914d('0x5')]||{};}module[_0x914d('0x6')]=VtigerAccount; \ No newline at end of file +var _0xbdae=['serverUrl','Configurations','name','username','accessKey','remoteUri'];(function(_0xb4e65b,_0x4cbbda){var _0x558a11=function(_0xeb05ee){while(--_0xeb05ee){_0xb4e65b['push'](_0xb4e65b['shift']());}};_0x558a11(++_0x4cbbda);}(_0xbdae,0x1dc));var _0xebda=function(_0x4f9a7b,_0x572650){_0x4f9a7b=_0x4f9a7b-0x0;var _0x28ea0e=_0xbdae[_0x4f9a7b];return _0x28ea0e;};'use strict';function VtigerAccount(_0x4446ef){this['id']=_0x4446ef['id']||0x0;this[_0xebda('0x0')]=_0x4446ef['name']||'';this[_0xebda('0x1')]=_0x4446ef['username']||'';this[_0xebda('0x2')]=_0x4446ef[_0xebda('0x2')]||'';this[_0xebda('0x3')]=_0x4446ef['remoteUri']||'';this[_0xebda('0x4')]=_0x4446ef[_0xebda('0x4')]||'';this[_0xebda('0x5')]=_0x4446ef[_0xebda('0x5')]||{};}module['exports']=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 5a2cf71..5930131 100644 --- a/server/services/ami/model/zendeskAccount.js +++ b/server/services/ami/model/zendeskAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['authType','type','integrationTab','serverUrl','Configurations','name','username','password','token','remoteUri'];(function(_0x3ece46,_0x586b81){var _0x395097=function(_0x50b47a){while(--_0x50b47a){_0x3ece46['push'](_0x3ece46['shift']());}};_0x395097(++_0x586b81);}(_0x5f2f,0x73));var _0xf5f2=function(_0x150e5d,_0x30ec0f){_0x150e5d=_0x150e5d-0x0;var _0x5a5f9f=_0x5f2f[_0x150e5d];return _0x5a5f9f;};'use strict';function ZendeskAccount(_0x7c86d8){this['id']=_0x7c86d8['id']||0x0;this[_0xf5f2('0x0')]=_0x7c86d8[_0xf5f2('0x0')]||'';this[_0xf5f2('0x1')]=_0x7c86d8[_0xf5f2('0x1')]||'';this[_0xf5f2('0x2')]=_0x7c86d8[_0xf5f2('0x2')]||'';this[_0xf5f2('0x3')]=_0x7c86d8['token']||'';this['remoteUri']=_0x7c86d8[_0xf5f2('0x4')]||'';this[_0xf5f2('0x5')]=_0x7c86d8[_0xf5f2('0x5')]||'';this[_0xf5f2('0x6')]=_0x7c86d8[_0xf5f2('0x6')]||_0xf5f2('0x7');this['serverUrl']=_0x7c86d8[_0xf5f2('0x8')]||'';this[_0xf5f2('0x9')]=_0x7c86d8[_0xf5f2('0x9')]||{};}module['exports']=ZendeskAccount; \ No newline at end of file +var _0xdb28=['Configurations','exports','name','username','password','token','remoteUri','authType','integrationTab','serverUrl'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdb28,0x106));var _0x8db2=function(_0x5f1c7f,_0x5e3f72){_0x5f1c7f=_0x5f1c7f-0x0;var _0x4ead59=_0xdb28[_0x5f1c7f];return _0x4ead59;};'use strict';function ZendeskAccount(_0x2f1285){this['id']=_0x2f1285['id']||0x0;this[_0x8db2('0x0')]=_0x2f1285[_0x8db2('0x0')]||'';this[_0x8db2('0x1')]=_0x2f1285['username']||'';this[_0x8db2('0x2')]=_0x2f1285[_0x8db2('0x2')]||'';this[_0x8db2('0x3')]=_0x2f1285[_0x8db2('0x3')]||'';this[_0x8db2('0x4')]=_0x2f1285['remoteUri']||'';this[_0x8db2('0x5')]=_0x2f1285[_0x8db2('0x5')]||'';this['type']=_0x2f1285['type']||_0x8db2('0x6');this[_0x8db2('0x7')]=_0x2f1285[_0x8db2('0x7')]||'';this[_0x8db2('0x8')]=_0x2f1285[_0x8db2('0x8')]||{};}module[_0x8db2('0x9')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 65f7022..bc4f86a 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 _0xdc7a=['zone','clientSecret','serverUrl','code','refreshToken','Configurations','exports','name','description','host'];(function(_0x3fca4f,_0x281d07){var _0x32aa77=function(_0x1f8746){while(--_0x1f8746){_0x3fca4f['push'](_0x3fca4f['shift']());}};_0x32aa77(++_0x281d07);}(_0xdc7a,0x10b));var _0xadc7=function(_0x4448bc,_0xba2c16){_0x4448bc=_0x4448bc-0x0;var _0x3d460c=_0xdc7a[_0x4448bc];return _0x3d460c;};'use strict';function ZohoAccount(_0x4c0513){this['id']=_0x4c0513['id']||0x0;this[_0xadc7('0x0')]=_0x4c0513[_0xadc7('0x0')]||'';this[_0xadc7('0x1')]=_0x4c0513[_0xadc7('0x1')]||'';this['host']=_0x4c0513[_0xadc7('0x2')]||'';this[_0xadc7('0x3')]=_0x4c0513[_0xadc7('0x3')]||'';this['clientId']=_0x4c0513['clientId']||'';this[_0xadc7('0x4')]=_0x4c0513[_0xadc7('0x4')]||'';this['serverUrl']=_0x4c0513[_0xadc7('0x5')]||'';this[_0xadc7('0x6')]=_0x4c0513['code']||'';this[_0xadc7('0x7')]=_0x4c0513[_0xadc7('0x7')]||'';this[_0xadc7('0x8')]=_0x4c0513[_0xadc7('0x8')]||{};}module[_0xadc7('0x9')]=ZohoAccount; \ No newline at end of file +var _0x3539=['clientSecret','serverUrl','code','refreshToken','Configurations','name','description','host','zone','clientId'];(function(_0xae9c1,_0x1dd854){var _0x532f38=function(_0x1f031d){while(--_0x1f031d){_0xae9c1['push'](_0xae9c1['shift']());}};_0x532f38(++_0x1dd854);}(_0x3539,0x1db));var _0x9353=function(_0x1e9057,_0x608999){_0x1e9057=_0x1e9057-0x0;var _0x5319ac=_0x3539[_0x1e9057];return _0x5319ac;};'use strict';function ZohoAccount(_0x1f512e){this['id']=_0x1f512e['id']||0x0;this[_0x9353('0x0')]=_0x1f512e['name']||'';this[_0x9353('0x1')]=_0x1f512e[_0x9353('0x1')]||'';this[_0x9353('0x2')]=_0x1f512e[_0x9353('0x2')]||'';this[_0x9353('0x3')]=_0x1f512e[_0x9353('0x3')]||'';this[_0x9353('0x4')]=_0x1f512e[_0x9353('0x4')]||'';this[_0x9353('0x5')]=_0x1f512e['clientSecret']||'';this[_0x9353('0x6')]=_0x1f512e[_0x9353('0x6')]||'';this[_0x9353('0x7')]=_0x1f512e[_0x9353('0x7')]||'';this[_0x9353('0x8')]=_0x1f512e[_0x9353('0x8')]||'';this['Configurations']=_0x1f512e[_0x9353('0x9')]||{};}module['exports']=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 5d27224..df7b868 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 _0xc3ee=['type','campaigntype','membername','Agent','name','channelAgent','format','calleridname','Contact','phone','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countglobal','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','\x22%s\x22\x20<%s>','number','exports','util','lodash','moment','isNil','string','uniqueid','queue'];(function(_0x3564d6,_0x37d1cb){var _0x1f2267=function(_0xbf7dfb){while(--_0xbf7dfb){_0x3564d6['push'](_0x3564d6['shift']());}};_0x1f2267(++_0x37d1cb);}(_0xc3ee,0x6b));var _0xec3e=function(_0x5addc1,_0x10b2f5){_0x5addc1=_0x5addc1-0x0;var _0x3ea7d9=_0xc3ee[_0x5addc1];return _0x3ea7d9;};'use strict';var util=require(_0xec3e('0x0'));var _=require(_0xec3e('0x1'));var moment=require(_0xec3e('0x2'));function checkNameSurname(_0x14cc20,_0x26004,_0x2e3115){var _0x5d0198='';if(!_[_0xec3e('0x3')](_0x26004)&&_0xec3e('0x4')===typeof _0x26004){_0x5d0198+=_0x26004;}if(!_[_0xec3e('0x3')](_0x2e3115)&&_0xec3e('0x4')===typeof _0x2e3115){_0x5d0198+='\x20'+_0x2e3115;}if(_0x5d0198!==''){return _0x5d0198;}return _0x14cc20;}function Action(_0x4c73a1,_0x16945d,_0x40286f,_0x2d9880,_0x14ef94){this[_0xec3e('0x5')]=_0x40286f||undefined;this['idContact']=_0x4c73a1['id'];this[_0xec3e('0x6')]=_0x16945d['name'];this[_0xec3e('0x7')]=_0x16945d[_0xec3e('0x7')];this[_0xec3e('0x8')]=_0xec3e('0x6');this['dialAnswer']=![];this[_0xec3e('0x9')]=_[_0xec3e('0x3')](_0x4c73a1[_0xec3e('0xa')])?undefined:_0x4c73a1[_0xec3e('0xa')][_0xec3e('0xb')];this[_0xec3e('0xc')]=this[_0xec3e('0x9')]?util[_0xec3e('0xd')]('SIP/%s',this[_0xec3e('0x9')]):_0x2d9880||undefined;this[_0xec3e('0xe')]=checkNameSurname(_0x4c73a1[_0xec3e('0xf')][_0xec3e('0x10')],_0x4c73a1[_0xec3e('0xf')]['firstName'],_0x4c73a1['Contact'][_0xec3e('0x11')]);this[_0xec3e('0x12')]=_0x4c73a1[_0xec3e('0x12')]||![];this[_0xec3e('0x13')]=_0x4c73a1[_0xec3e('0xf')]['phone'];this['scheduledat']=_0x4c73a1[_0xec3e('0x14')];this[_0xec3e('0x15')]=_0x4c73a1['countbusyretry']||0x0;this[_0xec3e('0x16')]=_0x4c73a1[_0xec3e('0x16')]||0x0;this['countnoanswerretry']=_0x4c73a1['countnoanswerretry']||0x0;this[_0xec3e('0x17')]=(_0x4c73a1[_0xec3e('0x15')]||0x0)+(_0x4c73a1[_0xec3e('0x16')]||0x0)+(_0x4c73a1['countnoanswerretry']||0x0);this[_0xec3e('0x18')]=_0x4c73a1[_0xec3e('0x18')];this[_0xec3e('0x19')]=_0x4c73a1[_0xec3e('0x19')];this[_0xec3e('0x1a')]=_0x4c73a1[_0xec3e('0x1a')];this[_0xec3e('0x1b')]=_0x4c73a1[_0xec3e('0x1b')];this[_0xec3e('0x1c')]=_0x4c73a1['ContactId'];this[_0xec3e('0x1d')]=_0x4c73a1['ListId'];this[_0xec3e('0x1e')]=_[_0xec3e('0x3')](_0x4c73a1['Agent'])?_0x4c73a1[_0xec3e('0x1e')]:_0x4c73a1[_0xec3e('0xa')]['id'];this[_0xec3e('0x1f')]=_0x4c73a1[_0xec3e('0x1f')];this[_0xec3e('0x20')]='';this[_0xec3e('0x21')]='';}Action[_0xec3e('0x22')]['getCaller']=function(){return util[_0xec3e('0xd')](_0xec3e('0x23'),this[_0xec3e('0xe')],this[_0xec3e('0x24')]);};module[_0xec3e('0x25')]=Action; \ No newline at end of file +var _0x4df4=['getCaller','exports','util','lodash','moment','isNil','string','uniqueid','queue','type','dialAnswer','membername','Agent','name','channelAgent','format','calleridname','Contact','firstName','lastName','active','calleridnum','phone','scheduledat','countbusyretry','countnoanswerretry','countglobal','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridname','prototype'];(function(_0x46a407,_0xf78031){var _0x29821c=function(_0xc9bf7f){while(--_0xc9bf7f){_0x46a407['push'](_0x46a407['shift']());}};_0x29821c(++_0xf78031);}(_0x4df4,0x105));var _0x44df=function(_0x48c4ef,_0x319d44){_0x48c4ef=_0x48c4ef-0x0;var _0x435715=_0x4df4[_0x48c4ef];return _0x435715;};'use strict';var util=require(_0x44df('0x0'));var _=require(_0x44df('0x1'));var moment=require(_0x44df('0x2'));function checkNameSurname(_0x1d764f,_0x46563d,_0xa727b8){var _0x38193a='';if(!_[_0x44df('0x3')](_0x46563d)&&_0x44df('0x4')===typeof _0x46563d){_0x38193a+=_0x46563d;}if(!_['isNil'](_0xa727b8)&&_0x44df('0x4')===typeof _0xa727b8){_0x38193a+='\x20'+_0xa727b8;}if(_0x38193a!==''){return _0x38193a;}return _0x1d764f;}function Action(_0x57a797,_0x168957,_0x4a0559,_0x2a1873,_0x3cd0ca){this[_0x44df('0x5')]=_0x4a0559||undefined;this['idContact']=_0x57a797['id'];this[_0x44df('0x6')]=_0x168957['name'];this[_0x44df('0x7')]=_0x168957[_0x44df('0x7')];this['campaigntype']='queue';this[_0x44df('0x8')]=![];this[_0x44df('0x9')]=_[_0x44df('0x3')](_0x57a797[_0x44df('0xa')])?undefined:_0x57a797[_0x44df('0xa')][_0x44df('0xb')];this[_0x44df('0xc')]=this['membername']?util[_0x44df('0xd')]('SIP/%s',this[_0x44df('0x9')]):_0x2a1873||undefined;this[_0x44df('0xe')]=checkNameSurname(_0x57a797['Contact']['phone'],_0x57a797[_0x44df('0xf')][_0x44df('0x10')],_0x57a797['Contact'][_0x44df('0x11')]);this[_0x44df('0x12')]=_0x57a797[_0x44df('0x12')]||![];this[_0x44df('0x13')]=_0x57a797['Contact'][_0x44df('0x14')];this[_0x44df('0x15')]=_0x57a797[_0x44df('0x15')];this[_0x44df('0x16')]=_0x57a797[_0x44df('0x16')]||0x0;this['countcongestionretry']=_0x57a797['countcongestionretry']||0x0;this[_0x44df('0x17')]=_0x57a797[_0x44df('0x17')]||0x0;this[_0x44df('0x18')]=(_0x57a797[_0x44df('0x16')]||0x0)+(_0x57a797['countcongestionretry']||0x0)+(_0x57a797['countnoanswerretry']||0x0);this[_0x44df('0x19')]=_0x57a797[_0x44df('0x19')];this[_0x44df('0x1a')]=_0x57a797['callbackuniqueid'];this[_0x44df('0x1b')]=_0x57a797[_0x44df('0x1b')];this['recallme']=_0x57a797[_0x44df('0x1c')];this[_0x44df('0x1d')]=_0x57a797[_0x44df('0x1d')];this[_0x44df('0x1e')]=_0x57a797[_0x44df('0x1e')];this[_0x44df('0x1f')]=_['isNil'](_0x57a797['Agent'])?_0x57a797['UserId']:_0x57a797[_0x44df('0xa')]['id'];this[_0x44df('0x20')]=_0x57a797['VoiceQueueId'];this['originatecalleridnum']='';this[_0x44df('0x21')]='';}Action[_0x44df('0x22')][_0x44df('0x23')]=function(){return util[_0x44df('0xd')]('\x22%s\x22\x20<%s>',this[_0x44df('0xe')],this['number']);};module[_0x44df('0x24')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 163d9b0..7a4e722 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 _0x1863=['[clearZombieChannels][talking]','queue','originated:\x20','dialAnswer','pick','contactId','UserId','ListId','Action','channel','No\x20such\x20channel','updateOriginated','decrementTalkink','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','info','[action]','size','getContactRecallMe','then','length','getDiff','scheduledat','dialRecallMeTimeout','run','logger2','[RecallMe]','catch','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','createCustomerFinal','[getContactRecallMe]','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countglobal','totalGlobal','NoSuchNumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','linkedid','ANSWER','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','pTalking:\x20','custom:agentconnect','buildObj','connect','acw','custom:agentcomplete','complete','answered','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','BUSY','outboundBusyCallsDay','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','rescheduleContact','dialBusyRetryFrequency','activeContact','NOANSWER','countnoanswerretry','[callProgressDetectingCustomer][logNoAnswer]','dialNoAnswerMaxRetry','scheduledAt','dialNoAnswerRetryFrequency','unlockAgent','CONGESTION','countcongestionretry','[callProgressDetectingCustomer][logCongestion]','dialCongestionMaxRetry','CANCEL','AgentReject','[syncHangupRequest][logAgentReject]','unlockContact','disableContact','[Dialer][decrementTalkink][no\x20Hangup][Preview]','cause-txt','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','destlinkedid','callProgressDetectingAgent','object','isUndefined','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','NoAnswer','[callProgressDetectingAgent][logNoAnswer]','Busy','[callProgressDetectingAgent][logBusy]','Congestion','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','reason','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','phone','VoiceQueueId','Contact\x20is\x20undefined','Queue','lookAgent','isEmpty','execCall','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','Calling','logBlacklist','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','status','reachable','unmonitored','execRun','unlock','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','Agent','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','campaign\x20Name:\x20','Is\x20Valid','SIP/%s/%s%s','trim','dialCutDigit','substring','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','getCallerId','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','variablesAction','OriginateError','[originateFailure][logOriginateFailure]','actionid','clone','responsetime','isFailure','response','idContact','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','destuniqueid','dialstatus','addVariable','variables','filterKey','variable','keys','value','[syncVarSet][Preview]','syncAttendedTransfer','transfertargetlinkedid','transfererlinkedid','exports','lodash','bluebird','uuid','moment','md5','ioredis','../../../config/environment','../../../config/logger','../ami','./rpcDb','./action','./util/util','redis','localhost','socket.io-emitter','prototype','tail','finally','sequence','campaignsPreview','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','syncHangupRequest','dialend','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','attendedtransfer','syncBlindTransfer','loopCampaigns','emit','type','outbound','name','strategy','loggedIn','sumBillable','sumDuration','sumHoldTime','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','callerid','Interval','stringify','format','voice_queue:save','voice_queue_channel:remove','sendMessageOneNotActive','pTalking','available','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','syncCampaigns','hasOwnProperty','clearZombieChannels','recallMe','clearZombieChannel','enqueue','isNil'];(function(_0x1ad342,_0x25d8d8){var _0x495570=function(_0xfd13f6){while(--_0xfd13f6){_0x1ad342['push'](_0x1ad342['shift']());}};_0x495570(++_0x25d8d8);}(_0x1863,0xd5));var _0x3186=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0x1863[_0x819464];return _0x49dcc0;};'use strict';var util=require('util');var _=require(_0x3186('0x0'));var BPromise=require(_0x3186('0x1'));var uuid=require(_0x3186('0x2'));var moment=require(_0x3186('0x3'));var md5=require(_0x3186('0x4'));var Redis=require(_0x3186('0x5'));var config=require(_0x3186('0x6'));var logger=require(_0x3186('0x7'))('preview');var loggerAction=require(_0x3186('0x7'))('actionPreview');var ami=require(_0x3186('0x8'));var rpcDb=require(_0x3186('0x9'));var Action=require(_0x3186('0xa'));var ut=require(_0x3186('0xb'));config[_0x3186('0xc')]=_['defaults'](config[_0x3186('0xc')],{'host':_0x3186('0xd'),'port':0x18eb});var io=require(_0x3186('0xe'))(new Redis(config[_0x3186('0xc')]));var Sequence=function(){};Sequence[_0x3186('0xf')]['enqueue']=function(_0x586a72){this[_0x3186('0x10')]=this[_0x3186('0x10')]?this[_0x3186('0x10')][_0x3186('0x11')](_0x586a72):_0x586a72();};function Preview(_0x59f146){this[_0x3186('0x12')]=new Sequence();this[_0x3186('0x13')]=_0x59f146['voiceQueues'];this[_0x3186('0x14')]=_0x59f146[_0x3186('0x14')];this[_0x3186('0x15')]={};this[_0x3186('0x16')]=_0x59f146[_0x3186('0x16')];this[_0x3186('0x17')]=0x0;ami['on'](_0x3186('0x18'),this[_0x3186('0x19')][_0x3186('0x1a')](this));ami['on'](_0x3186('0x1b'),this[_0x3186('0x1c')][_0x3186('0x1a')](this));ami['on']('hanguprequest',this[_0x3186('0x1d')][_0x3186('0x1a')](this));ami['on'](_0x3186('0x1e'),this[_0x3186('0x1f')]['bind'](this));ami['on'](_0x3186('0x20'),this[_0x3186('0x21')]['bind'](this));ami['on'](_0x3186('0x22'),this[_0x3186('0x23')][_0x3186('0x1a')](this));ami['on'](_0x3186('0x24'),this['syncAttendedTransfer'][_0x3186('0x1a')](this));ami['on']('blindtransfer',this[_0x3186('0x25')][_0x3186('0x1a')](this));this[_0x3186('0x26')](this[_0x3186('0x13')]);}function emit(_0xeee3f2,_0x43bae5,_0x4f8241){io['to'](_0xeee3f2)[_0x3186('0x27')](_0x43bae5,_0x4f8241);}function emitCampaignPreview(_0xfa8629){if(_0xfa8629[_0x3186('0x28')]===_0x3186('0x29')){var _0x13b383={'id':_0xfa8629['id'],'name':_0xfa8629[_0x3186('0x2a')],'strategy':_0xfa8629[_0x3186('0x2b')],'answered':_0xfa8629['answered'],'available':_0xfa8629['available'],'loggedIn':_0xfa8629[_0x3186('0x2c')],'pTalking':_0xfa8629['pTalking'],'sumBillable':_0xfa8629[_0x3186('0x2d')],'sumDuration':_0xfa8629[_0x3186('0x2e')],'sumHoldTime':_0xfa8629[_0x3186('0x2f')]||0x0,'talking':_0xfa8629['talking'],'total':_0xfa8629['total'],'type':_0xfa8629[_0x3186('0x28')],'unmanaged':_0xfa8629['unmanaged'],'abandoned':_0xfa8629[_0x3186('0x30')],'waiting':_0xfa8629[_0x3186('0x31')],'loggedInDb':_0xfa8629[_0x3186('0x32')],'dialActive':_0xfa8629[_0x3186('0x33')],'dialMethod':_0xfa8629[_0x3186('0x34')],'dialOriginateCallerIdName':_0xfa8629['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0xfa8629['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0xfa8629[_0x3186('0x35')],'dialPrefix':_0xfa8629[_0x3186('0x36')],'outboundAnswerAgiCallsDay':_0xfa8629[_0x3186('0x37')],'outboundAnswerCallsDay':_0xfa8629[_0x3186('0x38')],'outboundBlacklistCallsDay':_0xfa8629[_0x3186('0x39')],'outboundBusyCallsDay':_0xfa8629['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0xfa8629[_0x3186('0x3a')],'outboundDropCallsDayACS':_0xfa8629[_0x3186('0x3b')],'outboundDropCallsDayCallersExit':_0xfa8629[_0x3186('0x3c')],'outboundDropCallsDayTimeout':_0xfa8629[_0x3186('0x3d')],'outboundNoAnswerCallsDay':_0xfa8629['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0xfa8629[_0x3186('0x3e')],'outboundOriginateFailureCallsDay':_0xfa8629[_0x3186('0x3f')],'outboundReCallsDay':_0xfa8629[_0x3186('0x40')],'outboundRejectCallsDay':_0xfa8629[_0x3186('0x41')],'outboundUnknownCallsDay':_0xfa8629[_0x3186('0x42')],'predictiveIntervalAnsweredCalls':_0xfa8629['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0xfa8629['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0xfa8629[_0x3186('0x43')],'predictiveIntervalDroppedCallsCallersExit':_0xfa8629[_0x3186('0x44')],'predictiveIntervalDroppedCallsTimeout':_0xfa8629['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0xfa8629[_0x3186('0x45')],'predictiveIntervalErlangCallsDroppedCalls':_0xfa8629[_0x3186('0x46')],'predictiveIntervalHitRate':_0xfa8629['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0xfa8629['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0xfa8629[_0x3186('0x47')],'predictiveIntervalAvailable':_0xfa8629[_0x3186('0x48')],'predictiveIntervalTotalCalls':_0xfa8629[_0x3186('0x49')],'message':_0xfa8629[_0x3186('0x4a')],'originated':_0xfa8629[_0x3186('0x4b')],'erlangCalls':_0xfa8629[_0x3186('0x4c')],'erlangCallToSecond':_0xfa8629[_0x3186('0x4d')],'erlangAbandonmentRate':_0xfa8629[_0x3186('0x4e')],'erlangBusyFactor':_0xfa8629[_0x3186('0x4f')],'startPredictive':_0xfa8629['startPredictive'],'startProgressive':_0xfa8629['startProgressive']};if(_0xfa8629['Trunk']){_0x13b383[_0x3186('0x50')]={'id':_0xfa8629['Trunk']['id'],'name':_0xfa8629[_0x3186('0x50')]['name'],'active':_0xfa8629['Trunk'][_0x3186('0x51')],'callerid':_0xfa8629[_0x3186('0x50')][_0x3186('0x52')]};}if(_0xfa8629[_0x3186('0x53')]){_0x13b383['Interval']={'id':_0xfa8629['Interval']['id'],'name':_0xfa8629[_0x3186('0x53')][_0x3186('0x2a')]};}var _0x3671f2=md5(JSON[_0x3186('0x54')](_0x13b383));if(_0xfa8629['md5']!==_0x3671f2){_0xfa8629['md5']=_0x3671f2;emit(util[_0x3186('0x55')]('voice:queue:%s',_0x13b383[_0x3186('0x2a')]),_0x3186('0x56'),_0x13b383);}}}function emitVoiceQueueChannelRemove(_0x6d6e17){emit(util[_0x3186('0x55')]('voice:queue:%s',_0x6d6e17[_0x3186('0x2a')]),_0x3186('0x57'),_0x6d6e17);}function notSendMessagesQueue(_0x2c3b6d){if(_0x2c3b6d[_0x3186('0x58')]){if(_0x2c3b6d[_0x3186('0x4b')]===0x0&&_0x2c3b6d[_0x3186('0x59')]===0x0){_0x2c3b6d[_0x3186('0x58')]=![];_0x2c3b6d[_0x3186('0x5a')]=0x0;_0x2c3b6d['paused']=0x0;_0x2c3b6d[_0x3186('0x4a')]=_0x3186('0x5b');ut[_0x3186('0x5c')](_0x3186('0x5d'),_0x2c3b6d[_0x3186('0x2a')]+'\x20is\x20not\x20active');}else{_0x2c3b6d[_0x3186('0x4a')]='IS_DISACTIVED';ut[_0x3186('0x5c')](_0x3186('0x5d'),_0x2c3b6d[_0x3186('0x2a')]+'\x20is\x20disactive');}emitCampaignPreview(_0x2c3b6d);}}Preview['prototype'][_0x3186('0x26')]=function(){var _0x4073a4=this;setInterval(function(){_0x4073a4[_0x3186('0x5e')]();},0x7cf);};Preview['prototype'][_0x3186('0x5e')]=function(){var _0x208403=this['campaignsPreview'];this[_0x3186('0x17')]+=0x1;for(var _0x51abf2 in _0x208403){if(_0x208403[_0x3186('0x5f')](_0x51abf2)&&(_0x208403[_0x51abf2][_0x3186('0x34')]==='preview'||_0x208403[_0x51abf2][_0x3186('0x34')]==='booked')&&_0x208403[_0x51abf2][_0x3186('0x28')]===_0x3186('0x29')){if(this[_0x3186('0x17')]>0x7){this[_0x3186('0x17')]=0x0;this[_0x3186('0x60')]();}}if(_0x208403[_0x3186('0x5f')](_0x51abf2)&&_0x208403[_0x51abf2][_0x3186('0x34')]==='preview'&&_0x208403[_0x51abf2][_0x3186('0x28')]===_0x3186('0x29')){if(_0x208403[_0x51abf2][_0x3186('0x33')]){this['setMessage'](_0x208403[_0x51abf2]);this[_0x3186('0x61')](_0x208403[_0x51abf2]);}else{notSendMessagesQueue(_0x208403[_0x51abf2]);}}}};Preview[_0x3186('0xf')][_0x3186('0x62')]=function(_0x5f1558){var _0x37af89=this;this[_0x3186('0x12')][_0x3186('0x63')](function(){if(!_[_0x3186('0x64')](_0x37af89[_0x3186('0x15')][_0x5f1558])){loggerAction['info'](_0x3186('0x65'),_0x5f1558,'Queue',_0x37af89[_0x3186('0x15')][_0x5f1558][_0x3186('0x66')],_0x3186('0x67'),JSON[_0x3186('0x54')](_0x37af89[_0x3186('0x13')][_0x37af89[_0x3186('0x15')][_0x5f1558][_0x3186('0x66')]]['originated']),'pTalking:\x20',JSON[_0x3186('0x54')](_0x37af89[_0x3186('0x13')][_0x37af89['actions'][_0x5f1558][_0x3186('0x66')]][_0x3186('0x59')]),JSON[_0x3186('0x54')](_0x37af89[_0x3186('0x15')][_0x5f1558][_0x3186('0x68')]),JSON[_0x3186('0x54')](_[_0x3186('0x69')](_0x37af89['actions'][_0x5f1558],[_0x3186('0x6a'),_0x3186('0x6b'),'VoiceQueueId',_0x3186('0x6c')])));return ami[_0x3186('0x6d')]({'action':'status','channel':_0x37af89[_0x3186('0x15')][_0x5f1558][_0x3186('0x6e')]})['catch'](function(_0x284d98){if(_0x284d98[_0x3186('0x4a')]===_0x3186('0x6f')){setTimeout(function(){if(_0x37af89[_0x3186('0x15')][_0x5f1558]){ut[_0x3186('0x70')](_0x37af89[_0x3186('0x13')][_0x37af89[_0x3186('0x15')][_0x5f1558][_0x3186('0x66')]],'[clearZombieChannel]');if(_0x37af89[_0x3186('0x15')][_0x5f1558]['dialAnswer']===!![]){ut[_0x3186('0x71')](_0x37af89[_0x3186('0x13')][_0x37af89[_0x3186('0x15')][_0x5f1558][_0x3186('0x66')]],_0x3186('0x72'));ut[_0x3186('0x73')](_0x3186('0x74')+_0x5f1558,_0x37af89['actions'][_0x5f1558][_0x3186('0x66')]);}ut[_0x3186('0x73')]('[Dialer][checkChannel][Preview]'+_0x5f1558,_0x37af89['actions'][_0x5f1558][_0x3186('0x66')]);delete _0x37af89[_0x3186('0x15')][_0x5f1558];}},0x2328);}});}});};Preview[_0x3186('0xf')][_0x3186('0x60')]=function(){var _0x11ac14=this;loggerAction[_0x3186('0x75')](_0x3186('0x76'),_[_0x3186('0x77')](this[_0x3186('0x15')]));for(var _0x9baff4 in this['actions']){if(_0x11ac14[_0x3186('0x15')][_0x3186('0x5f')](_0x9baff4)){_0x11ac14[_0x3186('0x62')](_0x9baff4);}}};Preview[_0x3186('0xf')]['recallMe']=function(_0x35dba8){var _0x57b36b=this;rpcDb[_0x3186('0x78')](_0x35dba8['id'],ut['agentReadyId'](this[_0x3186('0x16')]))[_0x3186('0x79')](function(_0x16dd81){if(!_[_0x3186('0x64')](_0x16dd81)){for(var _0x1fc319=0x0;_0x1fc319<_0x16dd81[_0x3186('0x7a')];_0x1fc319+=0x1){if(ut[_0x3186('0x7b')](_0x16dd81[_0x1fc319][_0x3186('0x7c')])<_0x35dba8[_0x3186('0x7d')]*0x3c){_0x57b36b[_0x3186('0x7e')](_0x16dd81[_0x1fc319]['id'])['then'](ut[_0x3186('0x7f')](_0x3186('0x80')))[_0x3186('0x81')](ut[_0x3186('0x7f')](_0x3186('0x80')));}else{var _0x43895a=new Action(_0x16dd81[_0x1fc319],_0x35dba8);_0x43895a[_0x3186('0x82')]=moment()[_0x3186('0x55')](_0x3186('0x83'));_0x35dba8[_0x3186('0x40')]+=0x1;ut[_0x3186('0x84')](_0x43895a,0x17,_0x3186('0x85'));if(_0x35dba8[_0x3186('0x86')]){rpcDb[_0x3186('0x87')](ut[_0x3186('0x88')](_0x16dd81[_0x1fc319]));rpcDb[_0x3186('0x89')](_0x43895a,_0x3186('0x8a'));}else{ut[_0x3186('0x84')](_0x43895a,0x16,_0x3186('0x8b'));rpcDb[_0x3186('0x89')](_0x43895a,'[HistoryRecallClose]');rpcDb[_0x3186('0x8c')](_0x43895a,'[HistoryRecallClose]');}}}}})[_0x3186('0x81')](ut[_0x3186('0x7f')](_0x3186('0x8d')));};Preview['prototype']['setMessage']=function(_0x4cf78d){_0x4cf78d[_0x3186('0x58')]=!![];if(ut['IsNotLoggedIn'](_0x4cf78d[_0x3186('0x2c')])){_0x4cf78d[_0x3186('0x4a')]=_0x3186('0x8e');}else if(!ut[_0x3186('0x8f')](_0x4cf78d[_0x3186('0x33')])){_0x4cf78d[_0x3186('0x4a')]='NOT_ACTIVE';}else if(!this[_0x3186('0x90')](_0x4cf78d['Trunk'])){if(!this['isTrunkReachable'](_0x4cf78d['TrunkBackup'])){_0x4cf78d[_0x3186('0x4a')]=_0x3186('0x91');}else{_0x4cf78d[_0x3186('0x4a')]=_0x3186('0x92');}}else{_0x4cf78d[_0x3186('0x4a')]=_0x3186('0x92');}emitCampaignPreview(_0x4cf78d);};Preview[_0x3186('0xf')][_0x3186('0x93')]=function(_0xddbc23,_0x2e9757,_0xda3086){var _0x2c083a=this;var _0x53a35a=this[_0x3186('0x15')][_0x2e9757];var _0x164ae9=this['campaignsPreview'][_0x53a35a[_0x3186('0x66')]];var _0x16cbc2;if(_0x164ae9){switch(_0xda3086){case'1':_0x164ae9[_0x3186('0x3e')]+=0x1;_0x53a35a[_0x3186('0x94')]=ut[_0x3186('0x95')](_0x53a35a);ut[_0x3186('0x84')](_0x53a35a,0x0,_0x3186('0x96'));rpcDb['createCustomerHistory'](_0x53a35a,_0x3186('0x97'));if(ut[_0x3186('0x95')](_0x53a35a)>=_0x164ae9[_0x3186('0x98')]){_0x16cbc2=ut[_0x3186('0x99')](_0x53a35a,0xf,_0x3186('0x9a'));rpcDb['createCustomerFinal'](_0x16cbc2,_0x3186('0x9b'));}else{rpcDb[_0x3186('0x8c')](_0x53a35a,_0x3186('0x9b'));}delete this['actions'][_0xddbc23[_0x3186('0x9c')]];break;case _0x3186('0x9d'):var _0x5c2c43=moment()[_0x3186('0x55')](_0x3186('0x83'));_0x53a35a['responsetime']=_0x5c2c43;_0x53a35a[_0x3186('0x9e')]=_0x5c2c43;_0x53a35a[_0x3186('0x68')]=!![];_0x164ae9['pTalking']+=0x1;logger[_0x3186('0x75')](_0x3186('0x9f'),_0x53a35a[_0x3186('0xa0')],_0x3186('0xa1'),_0x164ae9[_0x3186('0x2a')],_0x3186('0xa2'),_0x164ae9['pTalking']);ami[_0x3186('0x27')](_0x3186('0xa3'),ut[_0x3186('0xa4')](_0x53a35a,_0x3186('0xa5')));if(_0x164ae9[_0x3186('0xa6')]){ami['emit']('custom:agentConnectPreview',ut['buildAcw'](_0x53a35a));}break;case'16':ami[_0x3186('0x27')](_0x3186('0xa7'),ut['buildObj'](_0x53a35a,'complete'));emitVoiceQueueChannelRemove(ut[_0x3186('0xa4')](_0x53a35a,_0x3186('0xa8')));_0x164ae9['outboundAnswerCallsDay']+=0x1;_0x164ae9['total']+=0x1;_0x164ae9[_0x3186('0xa9')]+=0x1;ut['decrementTalkink'](_0x164ae9,_0x3186('0xaa'));_0x53a35a[_0x3186('0x94')]=ut[_0x3186('0x95')](_0x53a35a);ut[_0x3186('0x84')](_0x53a35a,0x4,_0x3186('0xab'));rpcDb['createCustomerHistory'](_0x53a35a,_0x3186('0xac'));rpcDb['createCustomerFinal'](_0x53a35a,_0x3186('0xad'));rpcDb[_0x3186('0xae')](_0x53a35a);_0x164ae9[_0x3186('0x2e')]+=_0x53a35a[_0x3186('0xaf')];_0x164ae9['sumBillable']+=_0x53a35a[_0x3186('0xaf')];logger[_0x3186('0x75')](_0x3186('0xb0'),_0x53a35a[_0x3186('0xa0')],_0x3186('0xa1'),_0x164ae9['name'],_0x3186('0xa2'),_0x164ae9[_0x3186('0x59')]);delete this['actions'][_0xddbc23['linkedid']];break;case _0x3186('0xb1'):_0x164ae9[_0x3186('0xb2')]+=0x1;_0x53a35a['countbusyretry']+=0x1;_0x53a35a['countglobal']=ut[_0x3186('0x95')](_0x53a35a);ut[_0x3186('0x84')](_0x53a35a,0x5,'Busy');rpcDb['createCustomerHistory'](_0x53a35a,_0x3186('0xb3'));if(ut[_0x3186('0x95')](_0x53a35a)>=_0x164ae9['dialGlobalMaxRetry']){_0x16cbc2=ut[_0x3186('0x99')](_0x53a35a,0xf,_0x3186('0x9a'));rpcDb[_0x3186('0x8c')](_0x16cbc2,_0x3186('0xb4'));}else{if(_0x53a35a['countbusyretry']>=_0x164ae9[_0x3186('0xb5')]){rpcDb[_0x3186('0x8c')](_0x53a35a,_0x3186('0xb3'));}else{rpcDb[_0x3186('0xb6')](ut['scheduledAt'](_0x53a35a,'countbusyretry',_0x164ae9[_0x3186('0xb7')]),_0x53a35a['unlockAgent'],_0x53a35a[_0x3186('0xb8')]);}}break;case _0x3186('0xb9'):_0x164ae9['outboundNoAnswerCallsDay']+=0x1;_0x53a35a[_0x3186('0xba')]+=0x1;_0x53a35a[_0x3186('0x94')]=ut[_0x3186('0x95')](_0x53a35a);ut[_0x3186('0x84')](_0x53a35a,0x3,'NoAnswer');rpcDb[_0x3186('0x89')](_0x53a35a,_0x3186('0xbb'));if(ut[_0x3186('0x95')](_0x53a35a)>=_0x164ae9[_0x3186('0x98')]){_0x16cbc2=ut[_0x3186('0x99')](_0x53a35a,0xf,'Global');rpcDb[_0x3186('0x8c')](_0x16cbc2,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x53a35a[_0x3186('0xba')]>=_0x164ae9[_0x3186('0xbc')]){rpcDb[_0x3186('0x8c')](_0x53a35a,_0x3186('0xbb'));}else{rpcDb['rescheduleContact'](ut[_0x3186('0xbd')](_0x53a35a,'countnoanswerretry',_0x164ae9[_0x3186('0xbe')]),_0x53a35a[_0x3186('0xbf')],_0x53a35a['activeContact']);}}break;case _0x3186('0xc0'):_0x164ae9[_0x3186('0x3a')]+=0x1;_0x53a35a[_0x3186('0xc1')]+=0x1;_0x53a35a['countglobal']=ut['totalGlobal'](_0x53a35a);ut['logCustomer'](_0x53a35a,0x8,'Congestion');rpcDb[_0x3186('0x89')](_0x53a35a,_0x3186('0xc2'));if(ut[_0x3186('0x95')](_0x53a35a)>=_0x164ae9[_0x3186('0x98')]){_0x16cbc2=ut[_0x3186('0x99')](_0x53a35a,0xf,_0x3186('0x9a'));rpcDb[_0x3186('0x8c')](_0x16cbc2,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0x53a35a[_0x3186('0xc1')]>=_0x164ae9[_0x3186('0xc3')]){rpcDb[_0x3186('0x8c')](_0x53a35a,_0x3186('0xc2'));}else{rpcDb[_0x3186('0xb6')](ut[_0x3186('0xbd')](_0x53a35a,_0x3186('0xc1'),_0x164ae9[_0x3186('0xb7')]),_0x53a35a[_0x3186('0xbf')],_0x53a35a[_0x3186('0xb8')]);}}break;case _0x3186('0xc4'):_0x164ae9[_0x3186('0x41')]+=0x1;_0x53a35a['countglobal']=ut[_0x3186('0x95')](_0x53a35a);ut[_0x3186('0x84')](_0x53a35a,0x14,_0x3186('0xc5'));rpcDb[_0x3186('0x89')](_0x53a35a,_0x3186('0xc6'));if(_0x53a35a['unlockAgent']){rpcDb[_0x3186('0xc7')](_0x53a35a['idContact']);}if(_0x53a35a['activeContact']){rpcDb[_0x3186('0xc8')](_0x53a35a['idContact']);}break;default:if(_0x53a35a[_0x3186('0x68')]){ut[_0x3186('0x71')](_0x164ae9,'[default]');ut[_0x3186('0x73')](_0x3186('0xc9')+_0x164ae9[_0x3186('0x2a')],_0xddbc23);}_0x164ae9[_0x3186('0x42')]+=0x1;_0x53a35a['countglobal']=ut[_0x3186('0x95')](_0x53a35a);ut['logCustomer'](_0x53a35a,0xc,_0xddbc23[_0x3186('0xca')]||_0xddbc23['dialstatus']);rpcDb[_0x3186('0x89')](_0x53a35a,_0x3186('0xcb'));if(ut[_0x3186('0x95')](_0x53a35a)>=_0x164ae9[_0x3186('0x98')]){_0x16cbc2=ut[_0x3186('0x99')](_0x53a35a,0xf,_0x3186('0x9a'));rpcDb['createCustomerFinal'](_0x16cbc2,_0x3186('0xcc'));}else{rpcDb['createCustomerFinal'](_0x53a35a,_0x3186('0xcc'));}delete this[_0x3186('0x15')][_0xddbc23['linkedid']];}if(!(_0x53a35a[_0x3186('0x68')]&&_0xda3086==='16')){ut['updateOriginated'](_0x164ae9,'[callProgressDetectingCustomer]');logger[_0x3186('0x75')]('[originated][decrement][callProgressDetectingCustomer]',_0x53a35a[_0x3186('0xa0')],_0x3186('0xa1'),_0x164ae9['name'],_0x3186('0x67'),_0x164ae9[_0x3186('0x4b')]);}if(_0xda3086!==_0x3186('0x9d')){delete this['actions'][_0xddbc23[_0x3186('0x9c')]];delete this[_0x3186('0x15')][_0xddbc23[_0x3186('0xcd')]];}}};Preview['prototype'][_0x3186('0xce')]=function(_0x211018,_0xc150bc,_0x2997d1){if(_['isUndefined'](_0xc150bc)&&_0x3186('0xcf')!==typeof _0xc150bc){return;}if(_[_0x3186('0xd0')](_0x2997d1)&&'object'!==typeof _0x2997d1){return;}switch(_0x2997d1['reason']){case'0':ut[_0x3186('0xd1')](_0x211018,0x0,_0x3186('0x96'));rpcDb[_0x3186('0xd2')](_0x211018,_0x3186('0xd3'));break;case'3':ut[_0x3186('0xd1')](_0x211018,0x3,_0x3186('0xd4'));rpcDb[_0x3186('0xd2')](_0x211018,_0x3186('0xd5'));break;case'5':ut[_0x3186('0xd1')](_0x211018,0x5,_0x3186('0xd6'));rpcDb[_0x3186('0xd2')](_0x211018,_0x3186('0xd7'));break;case'8':ut[_0x3186('0xd1')](_0x211018,0x8,_0x3186('0xd8'));rpcDb['createAgentHistory'](_0x211018,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut[_0x3186('0xd1')](_0x211018,0x16,_0x3186('0xd9'));rpcDb[_0x3186('0xd2')](_0x211018,_0x3186('0xda'));break;default:ut[_0x3186('0xd1')](_0x211018,0xc,_0x2997d1[_0x3186('0xdb')]);rpcDb[_0x3186('0xd2')](_0x211018,_0x3186('0xdc'));}ut['updateOriginated'](_0xc150bc,_0x3186('0xdd'));logger[_0x3186('0x75')](_0x3186('0xde'),_0x211018['uniqueid'],_0x3186('0xa1'),_0xc150bc[_0x3186('0x2a')],_0x3186('0x67'),_0xc150bc[_0x3186('0x4b')]);delete this[_0x3186('0x15')][_0x211018[_0x3186('0xa0')]];};Preview[_0x3186('0xf')][_0x3186('0xdf')]=function(_0x39b77b,_0x5dc443,_0x43694a,_0x3b3695,_0x30141c){var _0x4a724d=this;return new BPromise(function(_0x4de304,_0x17d401){if(_['isNil'](_0x5dc443)||_[_0x3186('0x64')](_0x5dc443[_0x3186('0xe0')])||_[_0x3186('0x64')](_0x5dc443[_0x3186('0xe0')][_0x3186('0xe1')])||_[_0x3186('0x64')](_0x5dc443[_0x3186('0xe2')])){_0x17d401(ut[_0x3186('0x4a')](_0x3186('0xe3'),_0x3b3695,_0x30141c));return;}var _0x3a2df8=uuid['v4']();var _0x3fa2c6=_0x4a724d[_0x3186('0x13')][_0x5dc443[_0x3186('0xe4')][_0x3186('0x2a')]];var _0x13fa18=_0x43694a?_0x4a724d[_0x3186('0x16')][_0x43694a]['id']:undefined;_0x4a724d[_0x3186('0x15')][_0x3a2df8]=new Action(_0x5dc443,_0x3fa2c6,_0x3a2df8,_0x43694a,_0x13fa18);var _0x5db3ac=_0x4a724d[_0x3186('0x15')][_0x3a2df8];_0x5db3ac[_0x3186('0xbf')]=_0x3b3695;_0x5db3ac[_0x3186('0xb8')]=_0x30141c;_0x5db3ac[_0x3186('0xe5')]=_0x43694a;if(_[_0x3186('0xe6')](_0x39b77b)){_0x4a724d[_0x3186('0xe7')](_0x5db3ac,_0x3fa2c6,_0x5dc443,_0x43694a)[_0x3186('0x79')](function(_0x41e9d0){logger[_0x3186('0x75')]('[Preview][execCall][success]',_0x3186('0xe8')+_0x5db3ac[_0x3186('0x66')]+_0x3186('0xe9')+_0x5db3ac['idContact'],JSON[_0x3186('0x54')](_0x41e9d0));ami[_0x3186('0x27')](_0x3186('0xea'),ut[_0x3186('0xa4')](_0x5db3ac,_0x3186('0xeb')));_0x4de304(ut[_0x3186('0x4a')](_0x3186('0xec')));})['catch'](function(_0x2e344e){ut[_0x3186('0x5c')]('[Preview][execCall][failure]',_0x2e344e);_0x17d401(ut[_0x3186('0x4a')]('Call\x20failed',_0x3b3695,_0x30141c));});}else{_0x3fa2c6['outboundBlacklistCallsDay']+=0x1;ut[_0x3186('0xed')](_0x5db3ac);rpcDb['createHistory'](_0x5db3ac,_0x3186('0xee'));delete _0x4a724d[_0x3186('0x15')][_0x3a2df8];_0x17d401(ut['message'](_0x3186('0xef'),_0x3b3695,_0x30141c));}});};Preview['prototype']['isTrunkReachable']=function(_0x256447){return!_[_0x3186('0x64')](_0x256447)&&!_[_0x3186('0x64')](_0x256447[_0x3186('0x2a')])&&!_['isNil'](_0x256447[_0x3186('0x51')])&&_0x256447['active']&&!_[_0x3186('0x64')](this[_0x3186('0x14')][util[_0x3186('0x55')](_0x3186('0xf0'),_0x256447[_0x3186('0x2a')])])&&!_[_0x3186('0x64')](this[_0x3186('0x14')][util[_0x3186('0x55')](_0x3186('0xf0'),_0x256447[_0x3186('0x2a')])][_0x3186('0xf1')])&&(this[_0x3186('0x14')][util['format']('SIP/%s',_0x256447['name'])][_0x3186('0xf1')]===_0x3186('0xf2')||this[_0x3186('0x14')][util[_0x3186('0x55')](_0x3186('0xf0'),_0x256447[_0x3186('0x2a')])][_0x3186('0xf1')]===_0x3186('0xf3'));};Preview[_0x3186('0xf')]['run']=function(_0x2374b5,_0x5677e7){var _0x19d581=this;return new BPromise(function(_0x5f301a,_0x2eea42){_0x19d581[_0x3186('0xf4')](_0x2374b5,_0x5677e7)[_0x3186('0x79')](function(_0x59c960){_0x5f301a(_[_0x3186('0x69')](_0x59c960,[_0x3186('0x4a')]));})[_0x3186('0x81')](function(_0x168982){if(_0x168982[_0x3186('0xf5')]){rpcDb[_0x3186('0xc7')](_0x2374b5);}if(_0x168982['active']){rpcDb[_0x3186('0xc8')](_0x2374b5);}_0x2eea42(_['pick'](_0x168982,[_0x3186('0x4a')]));});});};Preview[_0x3186('0xf')]['execRun']=function(_0x14cfce,_0x5782cd){var _0xb437aa=this;return new BPromise(function(_0x4e193b,_0x2202f9){var _0x4aeddc,_0xea8f41;rpcDb[_0x3186('0xf6')](_0x14cfce)[_0x3186('0x79')](function(_0x4e0b5b){if(!_[_0x3186('0x64')](_0x4e0b5b[0x0])){_0xea8f41=_0x4e0b5b[0x0][_0x3186('0xf7')]?![]:!![];_0x4aeddc=_0x4e0b5b[0x0][_0x3186('0xf7')]?!![]:![];_0x4aeddc=_0x5782cd?!![]:_0x4aeddc;}var _0x508f12=_0xb437aa[_0x3186('0xf8')](_0x4e0b5b);if(_0x508f12[_0x3186('0xf9')]){rpcDb[_0x3186('0xfa')](_[_0x3186('0x69')](_0x4e0b5b[0x0],['VoiceQueueId','Contact.phone']))[_0x3186('0x79')](function(_0x5db619){_0xb437aa['checkInBlack'](_0x5db619,_0x4e0b5b[0x0],_0x5782cd,_0xea8f41,_0x4aeddc)['then'](function(_0x26038f){_0x4e193b(_0x26038f);})[_0x3186('0x81')](function(_0xdcb1ab){_0x2202f9(_0xdcb1ab);});})[_0x3186('0x81')](function(_0x30a874){ut['logger'](_0x3186('0xfb'),_0x30a874);_0x2202f9(ut[_0x3186('0x4a')]('Call\x20unsuccessful',_0xea8f41,_0x4aeddc));});}else{_0x2202f9(ut[_0x3186('0x4a')](_0x508f12[_0x3186('0x4a')],_0xea8f41,_0x4aeddc));}})[_0x3186('0x81')](function(_0x24a965){ut['logger'](_0x3186('0xfc'),_0x24a965);_0x2202f9(ut[_0x3186('0x4a')](_0x3186('0xfd'),![],!![]));});});};Preview[_0x3186('0xf')][_0x3186('0xf8')]=function(_0x398211){if(_['isNil'](_0x398211)||_[_0x3186('0xe6')](_0x398211)||!_[_0x3186('0x64')](_0x398211[0x0][_0x3186('0xfe')])&&_[_0x3186('0x64')](_0x398211[0x0][_0x3186('0xfe')][_0x3186('0x2a')])){ut['logger'](_0x3186('0xff'),_0x398211);return{'isValid':![],'message':_0x3186('0x100')};}var _0x32e090=this[_0x3186('0x13')][_0x398211[0x0][_0x3186('0xe4')][_0x3186('0x2a')]];_0x32e090[_0x3186('0x4a')]=_0x3186('0x92');if(_[_0x3186('0x64')](_0x32e090)){ut['logger'](_0x3186('0x101'),_0x32e090);return{'isValid':![],'message':_0x3186('0x102')};}if(!this[_0x3186('0x90')](_0x32e090[_0x3186('0x50')])){ut[_0x3186('0x5c')](_0x3186('0x103'),'campaign\x20Name:\x20'+_0x32e090['name']+_0x3186('0x104'));if(!this[_0x3186('0x90')](_0x32e090[_0x3186('0x105')])){ut[_0x3186('0x5c')](_0x3186('0x103'),_0x32e090['name']+_0x3186('0x106'));return{'isValid':![],'message':_0x3186('0x107')};}}if(!ut[_0x3186('0x8f')](_0x32e090['dialActive'])){ut[_0x3186('0x5c')](_0x3186('0x108'),_0x32e090['name']+_0x3186('0x109'));return{'isValid':![],'message':_0x3186('0x10a')+_0x32e090[_0x3186('0x2a')]+_0x3186('0x109')};}return{'isValid':!![],'message':_0x3186('0x10b')};};Preview[_0x3186('0xf')][_0x3186('0xe7')]=function(_0x5ae8e4,_0x37d063,_0x5c37bf,_0x20a0b3){var _0xf5a8a7=this;return new BPromise(function(_0x30e675,_0x53b510){var _0x139dea=_0x5ae8e4[_0x3186('0xa0')];var _0x470fe9=_0xf5a8a7['isTrunkReachable'](_0x37d063[_0x3186('0x50')])?util['format'](_0x3186('0x10c'),_0x37d063[_0x3186('0x50')][_0x3186('0x2a')],_['isNil'](_0x37d063[_0x3186('0x36')])?'':_0x37d063[_0x3186('0x36')][_0x3186('0x10d')]()||'',_0x37d063[_0x3186('0x10e')]>0x0?_0x5c37bf[_0x3186('0xe0')]['phone'][_0x3186('0x10f')](_0x37d063[_0x3186('0x10e')]):_0x5c37bf[_0x3186('0xe0')][_0x3186('0xe1')]):util[_0x3186('0x55')](_0x3186('0x10c'),_[_0x3186('0x64')](_0x37d063[_0x3186('0x105')])?_0x37d063['Trunk'][_0x3186('0x2a')]:_0x37d063[_0x3186('0x105')][_0x3186('0x2a')],_['isNil'](_0x37d063[_0x3186('0x36')])?'':_0x37d063[_0x3186('0x36')][_0x3186('0x10d')]()||'',_0x37d063[_0x3186('0x10e')]>0x0?_0x5c37bf[_0x3186('0xe0')][_0x3186('0xe1')]['substring'](_0x37d063['dialCutDigit']):_0x5c37bf[_0x3186('0xe0')][_0x3186('0xe1')]);var _0x354d30=_0xf5a8a7[_0x3186('0x90')](_0x37d063[_0x3186('0x50')])?ut['getCallerId'](_0x37d063['Trunk'][_0x3186('0x52')],_0x37d063[_0x3186('0x110')],_0x37d063[_0x3186('0x111')]>0x0?ut[_0x3186('0x112')](_0x37d063[_0x3186('0x113')],_0x37d063[_0x3186('0x111')]):_0x37d063['dialOriginateCallerIdNumber']):ut[_0x3186('0x114')](_[_0x3186('0x64')](_0x37d063['TrunkBackup'])?_0x37d063[_0x3186('0x50')]['callerid']:_0x37d063['TrunkBackup'][_0x3186('0x52')],_0x37d063['dialOriginateCallerIdName'],_0x37d063[_0x3186('0x111')]>0x0?ut[_0x3186('0x112')](_0x37d063[_0x3186('0x113')],_0x37d063['dialRandomLastDigitCallerIdNumber']):_0x37d063[_0x3186('0x113')]);if(_0x354d30){_0x5ae8e4[_0x3186('0x115')]=ut[_0x3186('0x116')](_0x354d30);_0x5ae8e4[_0x3186('0x117')]=ut[_0x3186('0x118')](_0x354d30);}var _0x303894=ut[_0x3186('0x119')](_0x37d063,_0x5c37bf,_0x470fe9,_0x354d30,_0x139dea,_0x5ae8e4);_['merge'](_0x5ae8e4,ut['toLowerVariables'](_0x303894));_0x5ae8e4[_0x3186('0x82')]=moment()[_0x3186('0x55')](_0x3186('0x83'));ami[_0x3186('0x6d')](ut[_0x3186('0x11a')](_0x5ae8e4,_0x37d063,_0x303894,_0x5ae8e4['activeContact'],_0x20a0b3))[_0x3186('0x79')](function(_0x57bb24){_0x37d063[_0x3186('0x4b')]+=0x1;logger[_0x3186('0x75')]('[originated][increment]',_0x139dea,_0x3186('0xa1'),_0x37d063[_0x3186('0x2a')],_0x3186('0x67'),_0x37d063['originated']);_0x30e675(_0x57bb24);})[_0x3186('0x81')](function(_0x880bb9){ut[_0x3186('0xd1')](_0x5ae8e4,0xe,_0x3186('0x11b'));rpcDb[_0x3186('0xd2')](_0x5ae8e4,_0x3186('0x11c'));_0x53b510(_0x880bb9);});});};Preview[_0x3186('0xf')][_0x3186('0x21')]=function(_0x11de6c){if(this[_0x3186('0x15')][_0x11de6c[_0x3186('0x9c')]]){this[_0x3186('0x15')][_0x11de6c['linkedid']][_0x3186('0x6e')]=_0x11de6c[_0x3186('0x6e')];}};Preview['prototype'][_0x3186('0x19')]=function(_0x101d74){var _0x322925=this;var _0x278aa7=this[_0x3186('0x15')][_0x101d74[_0x3186('0x11d')]];if(_0x278aa7){if(_0x278aa7[_0x3186('0xe5')]&&this[_0x3186('0x16')][_0x278aa7[_0x3186('0xe5')]]){ut['logLookAgent'](_0x278aa7,this[_0x3186('0x16')][_0x278aa7[_0x3186('0xe5')]][_0x3186('0x2a')],this[_0x3186('0x16')][_0x278aa7[_0x3186('0xe5')]]['id']);}var _0x116dae=_[_0x3186('0x11e')](_0x278aa7);_0x116dae[_0x3186('0x11f')]=moment()[_0x3186('0x55')](_0x3186('0x83'));var _0x17eedb=_0x322925[_0x3186('0x13')][_0x278aa7['queue']];if(ut[_0x3186('0x120')](_0x101d74[_0x3186('0x121')])){if(_0x278aa7[_0x3186('0xbf')]){rpcDb[_0x3186('0xc7')](_0x278aa7[_0x3186('0x122')]);}if(_0x278aa7[_0x3186('0xb8')]){rpcDb['disableContact'](_0x278aa7[_0x3186('0x122')]);}ami['emit'](_0x3186('0x123'),ut[_0x3186('0xa4')](_0x278aa7,_0x3186('0x124')));this[_0x3186('0xce')](_0x116dae,_0x17eedb,_0x101d74);}else{_0x278aa7[_0x3186('0x82')]=moment()['format'](_0x3186('0x83'));ut[_0x3186('0xd1')](_0x116dae,0x4,_0x3186('0xab'));rpcDb[_0x3186('0xd2')](_0x116dae,_0x3186('0x125'));}}};Preview['prototype'][_0x3186('0x1c')]=function(_0x5c3894){var _0x171a96=this;var _0x2eab72=this[_0x3186('0x15')][_0x5c3894['linkedid']];var _0x4a95b4;if(_0x2eab72){_0x4a95b4=this[_0x3186('0x13')][_0x2eab72[_0x3186('0x66')]];logger[_0x3186('0x75')]('[syncHangup][talking]',_0x5c3894['linkedid'],_0x3186('0xa1'),_0x4a95b4[_0x3186('0x2a')],_0x3186('0xa2'),_0x4a95b4['pTalking']);}if(this['actions'][_0x5c3894[_0x3186('0x9c')]]&&_0x5c3894[_0x3186('0x9c')]!==_0x5c3894[_0x3186('0xa0')]){if(_0x5c3894[_0x3186('0x126')]==='16'&&this['actions'][_0x5c3894[_0x3186('0x9c')]][_0x3186('0x68')]){this[_0x3186('0x93')](_0x5c3894,_0x5c3894['linkedid'],_0x5c3894[_0x3186('0x126')]);}else if(this[_0x3186('0x15')][_0x5c3894['linkedid']][_0x3186('0x68')]){logger[_0x3186('0x75')](_0x3186('0x127'),_0x5c3894[_0x3186('0x9c')],_0x5c3894['cause'],'\x20Queue',_0x4a95b4[_0x3186('0x2a')],'pTalking:\x20',_0x4a95b4['pTalking']);this[_0x3186('0x93')](_0x5c3894,_0x5c3894[_0x3186('0x9c')],_0x5c3894[_0x3186('0x126')]);}}else if(_0x2eab72&&_[_0x3186('0x64')](_0x2eab72[_0x3186('0x128')])&&_0x4a95b4[_0x3186('0x129')]&&_0x5c3894[_0x3186('0x9c')]===_0x5c3894['uniqueid']&&_['isNil'](_0x5c3894[_0x3186('0xdb')])&&_0x5c3894[_0x3186('0x126')]==='16'&&_0x5c3894[_0x3186('0x12a')]==='6'&&_['isUndefined'](_0x2eab72[_0x3186('0x12b')])){if(_0x2eab72[_0x3186('0xbf')]){rpcDb[_0x3186('0xc7')](_0x2eab72[_0x3186('0x122')]);}if(_0x2eab72['activeContact']){rpcDb[_0x3186('0xc8')](_0x2eab72['idContact']);}_0x5c3894['reason']='22';this['callProgressDetectingAgent'](_0x2eab72,_0x4a95b4,_0x5c3894);}else if(_0x2eab72&&_0x2eab72[_0x3186('0x12b')]){if(_0x5c3894[_0x3186('0x126')]==='16'&&this[_0x3186('0x15')][_0x5c3894[_0x3186('0x9c')]]['dialAnswer']){logger[_0x3186('0x75')](_0x3186('0x12c'),_0x5c3894[_0x3186('0x9c')],_0x5c3894[_0x3186('0x126')],_0x3186('0xa1'),_0x4a95b4[_0x3186('0x2a')],_0x3186('0xa2'),_0x4a95b4[_0x3186('0x59')]);this[_0x3186('0x93')](_0x5c3894,_0x5c3894[_0x3186('0x9c')],_0x5c3894['cause']);}else if(this['actions'][_0x5c3894[_0x3186('0x9c')]][_0x3186('0x68')]){logger[_0x3186('0x75')](_0x3186('0x127'),_0x5c3894[_0x3186('0x9c')],_0x5c3894[_0x3186('0x126')],_0x3186('0xa1'),_0x4a95b4[_0x3186('0x2a')],'pTalking:\x20',_0x4a95b4[_0x3186('0x59')]);this[_0x3186('0x93')](_0x5c3894,_0x5c3894['linkedid'],_0x5c3894[_0x3186('0x126')]);}}};Preview[_0x3186('0xf')][_0x3186('0x1f')]=function(_0x38fc55){if(this[_0x3186('0x15')][_0x38fc55[_0x3186('0xcd')]]&&_0x38fc55[_0x3186('0xcd')]!==_0x38fc55[_0x3186('0x12d')]){this[_0x3186('0x93')](_0x38fc55,_0x38fc55[_0x3186('0xcd')],_0x38fc55[_0x3186('0x12e')]);}};Preview[_0x3186('0xf')][_0x3186('0x1d')]=function(_0x37a1f2){if(this[_0x3186('0x15')][_0x37a1f2[_0x3186('0x9c')]]&&_0x37a1f2[_0x3186('0x9c')]!==_0x37a1f2[_0x3186('0xa0')]&&!this[_0x3186('0x15')][_0x37a1f2[_0x3186('0x9c')]][_0x3186('0x68')]){if(_0x37a1f2[_0x3186('0x126')]==='1'){this['callProgressDetectingCustomer'](_0x37a1f2,_0x37a1f2[_0x3186('0x9c')],_0x37a1f2[_0x3186('0x126')]);}}};Preview['prototype'][_0x3186('0x12f')]=function(_0x4fd8b2,_0x4133ac,_0x85c689){if(this['actions'][_0x4fd8b2]){if(_['isNil'](this[_0x3186('0x15')][_0x4fd8b2][_0x3186('0x130')])){this[_0x3186('0x15')][_0x4fd8b2][_0x3186('0x130')]={};}this[_0x3186('0x15')][_0x4fd8b2][_0x3186('0x130')][_0x4133ac]=_0x85c689;}};Preview[_0x3186('0xf')][_0x3186('0x23')]=function(_0x53a5f3){try{if(!_[_0x3186('0x64')](_0x53a5f3)){if(ut[_0x3186('0x131')](_['keys'](_0x53a5f3[_0x3186('0x132')])[0x0])){this[_0x3186('0x12f')](_0x53a5f3[_0x3186('0xa0')],_[_0x3186('0x133')](_0x53a5f3[_0x3186('0x132')])[0x0],_0x53a5f3[_0x3186('0x134')]);}}}catch(_0x5576e6){logger['error'](_0x3186('0x135'),util['inspect'](_0x5576e6,{'showHidden':![],'depth':null}));}};Preview[_0x3186('0xf')][_0x3186('0x136')]=function(_0x186b3d){if(_0x186b3d){if(this['actions'][_0x186b3d['transfertargetlinkedid']]){this[_0x3186('0x15')][_0x186b3d[_0x3186('0x137')]]['transfer']=!![];}}};Preview[_0x3186('0xf')][_0x3186('0x25')]=function(_0x5c593c){if(_0x5c593c){if(this[_0x3186('0x15')][_0x5c593c['transfererlinkedid']]){this[_0x3186('0x15')][_0x5c593c[_0x3186('0x138')]][_0x3186('0x12b')]=!![];}}};module[_0x3186('0x139')]=Preview; \ No newline at end of file +var _0x7b5f=['dialNoAnswerRetryFrequency','CONGESTION','countcongestionretry','Congestion','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','AgentReject','[syncHangupRequest][logAgentReject]','idContact','disableContact','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','cause-txt','dialstatus','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','object','isUndefined','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent]','checkInBlack','Contact','phone','VoiceQueueId','Contact\x20is\x20undefined','execCall','[Preview][execCall][success]','Queue:\x20','Calling','[Preview][execCall][failure]','Call\x20failed','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','unmonitored','execRun','pick','unlock','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','Contact.phone','Call\x20unsuccessful','[Preview][getContactPreview]','isEmpty','Agent','[Preview][validateContact][Empty\x20Campaign]','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','isActive','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','dialCutDigit','trim','substring','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','addVariables','toLowerVariables','starttime','variablesAction','OriginateError','[originateFailure][logOriginateFailure]','actionid','lookAgent','logLookAgent','responsetime','isFailure','response','rejected','Answer','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','unlockContact','destuniqueid','variables','filterKey','keys','addVariable','variable','value','error','[syncVarSet][Preview]','transfertargetlinkedid','transfererlinkedid','util','lodash','bluebird','uuid','md5','ioredis','../../../config/environment','../../../config/logger','preview','./action','defaults','redis','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest','dialend','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','campaignsPreview','outbound','strategy','answered','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','type','unmanaged','abandoned','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','name','active','callerid','Interval','format','voice:queue:%s','voice_queue:save','voice_queue_channel:remove','sendMessageOneNotActive','paused','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','loopCampaigns','syncCampaigns','hasOwnProperty','booked','setMessage','recallMe','clearZombieChannel','isNil','[clearZombieChannels][talking]','Queue','queue','originated:\x20','stringify','pTalking:\x20','dialAnswer','contactId','UserId','ListId','Action','status','channel','catch','No\x20such\x20channel','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','clearZombieChannels','info','[action]','size','getContactRecallMe','agentReadyId','then','length','getDiff','scheduledat','dialRecallMeTimeout','run','logger2','[RecallMe]','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','dialRecallInQueue','createBody','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','createCustomerHistory','[HistoryRecallClose]','[getContactRecallMe]','IsNotLoggedIn','isTrunkReachable','TrunkBackup','ACTIVE','callProgressDetectingCustomer','totalGlobal','NoSuchNumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','Global','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','linkedid','ANSWER','[syncHangup][talking][increment]','uniqueid','\x20Queue','emit','buildObj','connect','acw','custom:agentConnectPreview','buildAcw','complete','[16]','[callProgressDetectingCustomer][logAnswer]','crateCustomerReportQueue','talktime','BUSY','countbusyretry','countglobal','Busy','[callProgressDetectingCustomer][logBusy]','cloneAction','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','rescheduleContact','dialBusyRetryFrequency','unlockAgent','activeContact','NOANSWER','countnoanswerretry','NoAnswer','[callProgressDetectingCustomer][logNoAnswer]','dialNoAnswerMaxRetry','scheduledAt'];(function(_0x5090fe,_0x165e95){var _0x939dfb=function(_0x45b59a){while(--_0x45b59a){_0x5090fe['push'](_0x5090fe['shift']());}};_0x939dfb(++_0x165e95);}(_0x7b5f,0x1ac));var _0xf7b5=function(_0x47e8bd,_0x1131e7){_0x47e8bd=_0x47e8bd-0x0;var _0x440ea5=_0x7b5f[_0x47e8bd];return _0x440ea5;};'use strict';var util=require(_0xf7b5('0x0'));var _=require(_0xf7b5('0x1'));var BPromise=require(_0xf7b5('0x2'));var uuid=require(_0xf7b5('0x3'));var moment=require('moment');var md5=require(_0xf7b5('0x4'));var Redis=require(_0xf7b5('0x5'));var config=require(_0xf7b5('0x6'));var logger=require(_0xf7b5('0x7'))(_0xf7b5('0x8'));var loggerAction=require(_0xf7b5('0x7'))('actionPreview');var ami=require('../ami');var rpcDb=require('./rpcDb');var Action=require(_0xf7b5('0x9'));var ut=require('./util/util');config['redis']=_[_0xf7b5('0xa')](config[_0xf7b5('0xb')],{'host':_0xf7b5('0xc'),'port':0x18eb});var io=require(_0xf7b5('0xd'))(new Redis(config[_0xf7b5('0xb')]));var Sequence=function(){};Sequence[_0xf7b5('0xe')][_0xf7b5('0xf')]=function(_0x23a6ca){this[_0xf7b5('0x10')]=this[_0xf7b5('0x10')]?this[_0xf7b5('0x10')][_0xf7b5('0x11')](_0x23a6ca):_0x23a6ca();};function Preview(_0x1a7ce9){this[_0xf7b5('0x12')]=new Sequence();this['campaignsPreview']=_0x1a7ce9[_0xf7b5('0x13')];this[_0xf7b5('0x14')]=_0x1a7ce9[_0xf7b5('0x14')];this[_0xf7b5('0x15')]={};this[_0xf7b5('0x16')]=_0x1a7ce9[_0xf7b5('0x16')];this[_0xf7b5('0x17')]=0x0;ami['on'](_0xf7b5('0x18'),this[_0xf7b5('0x19')][_0xf7b5('0x1a')](this));ami['on'](_0xf7b5('0x1b'),this[_0xf7b5('0x1c')][_0xf7b5('0x1a')](this));ami['on'](_0xf7b5('0x1d'),this[_0xf7b5('0x1e')]['bind'](this));ami['on'](_0xf7b5('0x1f'),this[_0xf7b5('0x20')][_0xf7b5('0x1a')](this));ami['on'](_0xf7b5('0x21'),this[_0xf7b5('0x22')][_0xf7b5('0x1a')](this));ami['on'](_0xf7b5('0x23'),this[_0xf7b5('0x24')][_0xf7b5('0x1a')](this));ami['on'](_0xf7b5('0x25'),this[_0xf7b5('0x26')][_0xf7b5('0x1a')](this));ami['on'](_0xf7b5('0x27'),this[_0xf7b5('0x28')][_0xf7b5('0x1a')](this));this['loopCampaigns'](this[_0xf7b5('0x29')]);}function emit(_0x50ea2c,_0xe8867d,_0x2725fa){io['to'](_0x50ea2c)['emit'](_0xe8867d,_0x2725fa);}function emitCampaignPreview(_0x4206cb){if(_0x4206cb['type']===_0xf7b5('0x2a')){var _0x4ab6d3={'id':_0x4206cb['id'],'name':_0x4206cb['name'],'strategy':_0x4206cb[_0xf7b5('0x2b')],'answered':_0x4206cb[_0xf7b5('0x2c')],'available':_0x4206cb['available'],'loggedIn':_0x4206cb[_0xf7b5('0x2d')],'pTalking':_0x4206cb[_0xf7b5('0x2e')],'sumBillable':_0x4206cb[_0xf7b5('0x2f')],'sumDuration':_0x4206cb[_0xf7b5('0x30')],'sumHoldTime':_0x4206cb[_0xf7b5('0x31')]||0x0,'talking':_0x4206cb[_0xf7b5('0x32')],'total':_0x4206cb[_0xf7b5('0x33')],'type':_0x4206cb[_0xf7b5('0x34')],'unmanaged':_0x4206cb[_0xf7b5('0x35')],'abandoned':_0x4206cb[_0xf7b5('0x36')],'waiting':_0x4206cb['waiting'],'loggedInDb':_0x4206cb[_0xf7b5('0x37')],'dialActive':_0x4206cb[_0xf7b5('0x38')],'dialMethod':_0x4206cb[_0xf7b5('0x39')],'dialOriginateCallerIdName':_0x4206cb[_0xf7b5('0x3a')],'dialOriginateCallerIdNumber':_0x4206cb[_0xf7b5('0x3b')],'dialOriginateTimeout':_0x4206cb[_0xf7b5('0x3c')],'dialPrefix':_0x4206cb[_0xf7b5('0x3d')],'outboundAnswerAgiCallsDay':_0x4206cb[_0xf7b5('0x3e')],'outboundAnswerCallsDay':_0x4206cb[_0xf7b5('0x3f')],'outboundBlacklistCallsDay':_0x4206cb[_0xf7b5('0x40')],'outboundBusyCallsDay':_0x4206cb[_0xf7b5('0x41')],'outboundCongestionCallsDay':_0x4206cb[_0xf7b5('0x42')],'outboundDropCallsDayACS':_0x4206cb['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x4206cb[_0xf7b5('0x43')],'outboundDropCallsDayTimeout':_0x4206cb[_0xf7b5('0x44')],'outboundNoAnswerCallsDay':_0x4206cb[_0xf7b5('0x45')],'outboundNoSuchCallsDay':_0x4206cb['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x4206cb['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x4206cb[_0xf7b5('0x46')],'outboundRejectCallsDay':_0x4206cb[_0xf7b5('0x47')],'outboundUnknownCallsDay':_0x4206cb[_0xf7b5('0x48')],'predictiveIntervalAnsweredCalls':_0x4206cb[_0xf7b5('0x49')],'predictiveIntervalAvgHoldtime':_0x4206cb[_0xf7b5('0x4a')],'predictiveIntervalAvgTalktime':_0x4206cb[_0xf7b5('0x4b')],'predictiveIntervalDroppedCallsCallersExit':_0x4206cb[_0xf7b5('0x4c')],'predictiveIntervalDroppedCallsTimeout':_0x4206cb[_0xf7b5('0x4d')],'predictiveIntervalErlangCalls':_0x4206cb[_0xf7b5('0x4e')],'predictiveIntervalErlangCallsDroppedCalls':_0x4206cb[_0xf7b5('0x4f')],'predictiveIntervalHitRate':_0x4206cb[_0xf7b5('0x50')],'predictiveIntervalMultiplicativeFactor':_0x4206cb[_0xf7b5('0x51')],'predictiveIntervalPauses':_0x4206cb[_0xf7b5('0x52')],'predictiveIntervalAvailable':_0x4206cb[_0xf7b5('0x53')],'predictiveIntervalTotalCalls':_0x4206cb[_0xf7b5('0x54')],'message':_0x4206cb[_0xf7b5('0x55')],'originated':_0x4206cb[_0xf7b5('0x56')],'erlangCalls':_0x4206cb[_0xf7b5('0x57')],'erlangCallToSecond':_0x4206cb[_0xf7b5('0x58')],'erlangAbandonmentRate':_0x4206cb[_0xf7b5('0x59')],'erlangBusyFactor':_0x4206cb[_0xf7b5('0x5a')],'startPredictive':_0x4206cb[_0xf7b5('0x5b')],'startProgressive':_0x4206cb[_0xf7b5('0x5c')]};if(_0x4206cb[_0xf7b5('0x5d')]){_0x4ab6d3[_0xf7b5('0x5d')]={'id':_0x4206cb[_0xf7b5('0x5d')]['id'],'name':_0x4206cb[_0xf7b5('0x5d')][_0xf7b5('0x5e')],'active':_0x4206cb[_0xf7b5('0x5d')][_0xf7b5('0x5f')],'callerid':_0x4206cb[_0xf7b5('0x5d')][_0xf7b5('0x60')]};}if(_0x4206cb[_0xf7b5('0x61')]){_0x4ab6d3[_0xf7b5('0x61')]={'id':_0x4206cb[_0xf7b5('0x61')]['id'],'name':_0x4206cb[_0xf7b5('0x61')][_0xf7b5('0x5e')]};}var _0x5856dc=md5(JSON['stringify'](_0x4ab6d3));if(_0x4206cb[_0xf7b5('0x4')]!==_0x5856dc){_0x4206cb[_0xf7b5('0x4')]=_0x5856dc;emit(util[_0xf7b5('0x62')](_0xf7b5('0x63'),_0x4ab6d3[_0xf7b5('0x5e')]),_0xf7b5('0x64'),_0x4ab6d3);}}}function emitVoiceQueueChannelRemove(_0x38b4e9){emit(util[_0xf7b5('0x62')]('voice:queue:%s',_0x38b4e9[_0xf7b5('0x5e')]),_0xf7b5('0x65'),_0x38b4e9);}function notSendMessagesQueue(_0x570827){if(_0x570827[_0xf7b5('0x66')]){if(_0x570827[_0xf7b5('0x56')]===0x0&&_0x570827[_0xf7b5('0x2e')]===0x0){_0x570827[_0xf7b5('0x66')]=![];_0x570827['available']=0x0;_0x570827[_0xf7b5('0x67')]=0x0;_0x570827[_0xf7b5('0x55')]=_0xf7b5('0x68');ut[_0xf7b5('0x69')](_0xf7b5('0x6a'),_0x570827[_0xf7b5('0x5e')]+_0xf7b5('0x6b'));}else{_0x570827[_0xf7b5('0x55')]=_0xf7b5('0x6c');ut['logger'](_0xf7b5('0x6a'),_0x570827[_0xf7b5('0x5e')]+_0xf7b5('0x6d'));}emitCampaignPreview(_0x570827);}}Preview[_0xf7b5('0xe')][_0xf7b5('0x6e')]=function(){var _0xe6c8f1=this;setInterval(function(){_0xe6c8f1[_0xf7b5('0x6f')]();},0x7cf);};Preview[_0xf7b5('0xe')]['syncCampaigns']=function(){var _0x4a8918=this[_0xf7b5('0x29')];this[_0xf7b5('0x17')]+=0x1;for(var _0x4639e6 in _0x4a8918){if(_0x4a8918[_0xf7b5('0x70')](_0x4639e6)&&(_0x4a8918[_0x4639e6]['dialMethod']===_0xf7b5('0x8')||_0x4a8918[_0x4639e6][_0xf7b5('0x39')]===_0xf7b5('0x71'))&&_0x4a8918[_0x4639e6][_0xf7b5('0x34')]==='outbound'){if(this[_0xf7b5('0x17')]>0x7){this[_0xf7b5('0x17')]=0x0;this['clearZombieChannels']();}}if(_0x4a8918['hasOwnProperty'](_0x4639e6)&&_0x4a8918[_0x4639e6]['dialMethod']===_0xf7b5('0x8')&&_0x4a8918[_0x4639e6][_0xf7b5('0x34')]===_0xf7b5('0x2a')){if(_0x4a8918[_0x4639e6]['dialActive']){this[_0xf7b5('0x72')](_0x4a8918[_0x4639e6]);this[_0xf7b5('0x73')](_0x4a8918[_0x4639e6]);}else{notSendMessagesQueue(_0x4a8918[_0x4639e6]);}}}};Preview[_0xf7b5('0xe')][_0xf7b5('0x74')]=function(_0x153983){var _0xda06c2=this;this[_0xf7b5('0x12')][_0xf7b5('0xf')](function(){if(!_[_0xf7b5('0x75')](_0xda06c2[_0xf7b5('0x15')][_0x153983])){loggerAction['info'](_0xf7b5('0x76'),_0x153983,_0xf7b5('0x77'),_0xda06c2[_0xf7b5('0x15')][_0x153983][_0xf7b5('0x78')],_0xf7b5('0x79'),JSON[_0xf7b5('0x7a')](_0xda06c2[_0xf7b5('0x29')][_0xda06c2[_0xf7b5('0x15')][_0x153983][_0xf7b5('0x78')]][_0xf7b5('0x56')]),_0xf7b5('0x7b'),JSON[_0xf7b5('0x7a')](_0xda06c2[_0xf7b5('0x29')][_0xda06c2['actions'][_0x153983]['queue']]['pTalking']),JSON['stringify'](_0xda06c2[_0xf7b5('0x15')][_0x153983][_0xf7b5('0x7c')]),JSON['stringify'](_['pick'](_0xda06c2[_0xf7b5('0x15')][_0x153983],[_0xf7b5('0x7d'),_0xf7b5('0x7e'),'VoiceQueueId',_0xf7b5('0x7f')])));return ami[_0xf7b5('0x80')]({'action':_0xf7b5('0x81'),'channel':_0xda06c2[_0xf7b5('0x15')][_0x153983][_0xf7b5('0x82')]})[_0xf7b5('0x83')](function(_0x54ceb1){if(_0x54ceb1[_0xf7b5('0x55')]===_0xf7b5('0x84')){setTimeout(function(){if(_0xda06c2[_0xf7b5('0x15')][_0x153983]){ut['updateOriginated'](_0xda06c2[_0xf7b5('0x29')][_0xda06c2[_0xf7b5('0x15')][_0x153983]['queue']],_0xf7b5('0x85'));if(_0xda06c2['actions'][_0x153983][_0xf7b5('0x7c')]===!![]){ut[_0xf7b5('0x86')](_0xda06c2[_0xf7b5('0x29')][_0xda06c2[_0xf7b5('0x15')][_0x153983][_0xf7b5('0x78')]],_0xf7b5('0x85'));ut[_0xf7b5('0x87')](_0xf7b5('0x88')+_0x153983,_0xda06c2[_0xf7b5('0x15')][_0x153983][_0xf7b5('0x78')]);}ut['loggerError'](_0xf7b5('0x89')+_0x153983,_0xda06c2[_0xf7b5('0x15')][_0x153983][_0xf7b5('0x78')]);delete _0xda06c2[_0xf7b5('0x15')][_0x153983];}},0x2328);}});}});};Preview[_0xf7b5('0xe')][_0xf7b5('0x8a')]=function(){var _0x70f3c2=this;loggerAction[_0xf7b5('0x8b')](_0xf7b5('0x8c'),_[_0xf7b5('0x8d')](this[_0xf7b5('0x15')]));for(var _0xbde363 in this[_0xf7b5('0x15')]){if(_0x70f3c2[_0xf7b5('0x15')][_0xf7b5('0x70')](_0xbde363)){_0x70f3c2[_0xf7b5('0x74')](_0xbde363);}}};Preview[_0xf7b5('0xe')]['recallMe']=function(_0x5cb8d3){var _0x589090=this;rpcDb[_0xf7b5('0x8e')](_0x5cb8d3['id'],ut[_0xf7b5('0x8f')](this[_0xf7b5('0x16')]))[_0xf7b5('0x90')](function(_0x3296ff){if(!_[_0xf7b5('0x75')](_0x3296ff)){for(var _0x1ebf4b=0x0;_0x1ebf4b<_0x3296ff[_0xf7b5('0x91')];_0x1ebf4b+=0x1){if(ut[_0xf7b5('0x92')](_0x3296ff[_0x1ebf4b][_0xf7b5('0x93')])<_0x5cb8d3[_0xf7b5('0x94')]*0x3c){_0x589090[_0xf7b5('0x95')](_0x3296ff[_0x1ebf4b]['id'])[_0xf7b5('0x90')](ut[_0xf7b5('0x96')]('[RecallMe]'))['catch'](ut['logger2'](_0xf7b5('0x97')));}else{var _0xb17558=new Action(_0x3296ff[_0x1ebf4b],_0x5cb8d3);_0xb17558['starttime']=moment()[_0xf7b5('0x62')](_0xf7b5('0x98'));_0x5cb8d3[_0xf7b5('0x46')]+=0x1;ut[_0xf7b5('0x99')](_0xb17558,0x17,_0xf7b5('0x9a'));if(_0x5cb8d3[_0xf7b5('0x9b')]){rpcDb['rescheduleContactInQueue'](ut[_0xf7b5('0x9c')](_0x3296ff[_0x1ebf4b]));rpcDb['createCustomerHistory'](_0xb17558,_0xf7b5('0x9d'));}else{ut[_0xf7b5('0x99')](_0xb17558,0x16,_0xf7b5('0x9e'));rpcDb[_0xf7b5('0x9f')](_0xb17558,_0xf7b5('0xa0'));rpcDb['createCustomerFinal'](_0xb17558,_0xf7b5('0xa0'));}}}}})[_0xf7b5('0x83')](ut[_0xf7b5('0x96')](_0xf7b5('0xa1')));};Preview[_0xf7b5('0xe')][_0xf7b5('0x72')]=function(_0x299030){_0x299030[_0xf7b5('0x66')]=!![];if(ut[_0xf7b5('0xa2')](_0x299030[_0xf7b5('0x2d')])){_0x299030[_0xf7b5('0x55')]='AGENTS_NOT_LOGGED';}else if(!ut['isActive'](_0x299030[_0xf7b5('0x38')])){_0x299030['message']=_0xf7b5('0x68');}else if(!this[_0xf7b5('0xa3')](_0x299030['Trunk'])){if(!this[_0xf7b5('0xa3')](_0x299030[_0xf7b5('0xa4')])){_0x299030[_0xf7b5('0x55')]='TRUNK_IS_NOT_REACHABLE';}else{_0x299030[_0xf7b5('0x55')]=_0xf7b5('0xa5');}}else{_0x299030[_0xf7b5('0x55')]=_0xf7b5('0xa5');}emitCampaignPreview(_0x299030);};Preview[_0xf7b5('0xe')][_0xf7b5('0xa6')]=function(_0x32be15,_0x132163,_0x31ab1c){var _0x5c4cee=this;var _0xcd0802=this['actions'][_0x132163];var _0x44330c=this[_0xf7b5('0x29')][_0xcd0802[_0xf7b5('0x78')]];var _0x560cf1;if(_0x44330c){switch(_0x31ab1c){case'1':_0x44330c['outboundNoSuchCallsDay']+=0x1;_0xcd0802['countglobal']=ut[_0xf7b5('0xa7')](_0xcd0802);ut['logCustomer'](_0xcd0802,0x0,_0xf7b5('0xa8'));rpcDb[_0xf7b5('0x9f')](_0xcd0802,_0xf7b5('0xa9'));if(ut[_0xf7b5('0xa7')](_0xcd0802)>=_0x44330c[_0xf7b5('0xaa')]){_0x560cf1=ut['cloneAction'](_0xcd0802,0xf,_0xf7b5('0xab'));rpcDb[_0xf7b5('0xac')](_0x560cf1,_0xf7b5('0xad'));}else{rpcDb[_0xf7b5('0xac')](_0xcd0802,_0xf7b5('0xad'));}delete this[_0xf7b5('0x15')][_0x32be15[_0xf7b5('0xae')]];break;case _0xf7b5('0xaf'):var _0x805a21=moment()[_0xf7b5('0x62')](_0xf7b5('0x98'));_0xcd0802['responsetime']=_0x805a21;_0xcd0802['answertime']=_0x805a21;_0xcd0802['dialAnswer']=!![];_0x44330c[_0xf7b5('0x2e')]+=0x1;logger['info'](_0xf7b5('0xb0'),_0xcd0802[_0xf7b5('0xb1')],_0xf7b5('0xb2'),_0x44330c[_0xf7b5('0x5e')],_0xf7b5('0x7b'),_0x44330c[_0xf7b5('0x2e')]);ami[_0xf7b5('0xb3')]('custom:agentconnect',ut[_0xf7b5('0xb4')](_0xcd0802,_0xf7b5('0xb5')));if(_0x44330c[_0xf7b5('0xb6')]){ami['emit'](_0xf7b5('0xb7'),ut[_0xf7b5('0xb8')](_0xcd0802));}break;case'16':ami[_0xf7b5('0xb3')]('custom:agentcomplete',ut[_0xf7b5('0xb4')](_0xcd0802,_0xf7b5('0xb9')));emitVoiceQueueChannelRemove(ut['buildObj'](_0xcd0802,_0xf7b5('0xb9')));_0x44330c['outboundAnswerCallsDay']+=0x1;_0x44330c[_0xf7b5('0x33')]+=0x1;_0x44330c[_0xf7b5('0x2c')]+=0x1;ut[_0xf7b5('0x86')](_0x44330c,_0xf7b5('0xba'));_0xcd0802['countglobal']=ut[_0xf7b5('0xa7')](_0xcd0802);ut['logCustomer'](_0xcd0802,0x4,'Answer');rpcDb[_0xf7b5('0x9f')](_0xcd0802,_0xf7b5('0xbb'));rpcDb[_0xf7b5('0xac')](_0xcd0802,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb[_0xf7b5('0xbc')](_0xcd0802);_0x44330c[_0xf7b5('0x30')]+=_0xcd0802[_0xf7b5('0xbd')];_0x44330c[_0xf7b5('0x2f')]+=_0xcd0802[_0xf7b5('0xbd')];logger[_0xf7b5('0x8b')]('[syncHangup][talking][decrement]',_0xcd0802[_0xf7b5('0xb1')],_0xf7b5('0xb2'),_0x44330c['name'],_0xf7b5('0x7b'),_0x44330c['pTalking']);delete this[_0xf7b5('0x15')][_0x32be15['linkedid']];break;case _0xf7b5('0xbe'):_0x44330c[_0xf7b5('0x41')]+=0x1;_0xcd0802[_0xf7b5('0xbf')]+=0x1;_0xcd0802[_0xf7b5('0xc0')]=ut['totalGlobal'](_0xcd0802);ut[_0xf7b5('0x99')](_0xcd0802,0x5,_0xf7b5('0xc1'));rpcDb[_0xf7b5('0x9f')](_0xcd0802,_0xf7b5('0xc2'));if(ut[_0xf7b5('0xa7')](_0xcd0802)>=_0x44330c[_0xf7b5('0xaa')]){_0x560cf1=ut[_0xf7b5('0xc3')](_0xcd0802,0xf,_0xf7b5('0xab'));rpcDb[_0xf7b5('0xac')](_0x560cf1,_0xf7b5('0xc4'));}else{if(_0xcd0802[_0xf7b5('0xbf')]>=_0x44330c[_0xf7b5('0xc5')]){rpcDb[_0xf7b5('0xac')](_0xcd0802,_0xf7b5('0xc2'));}else{rpcDb[_0xf7b5('0xc6')](ut['scheduledAt'](_0xcd0802,_0xf7b5('0xbf'),_0x44330c[_0xf7b5('0xc7')]),_0xcd0802[_0xf7b5('0xc8')],_0xcd0802[_0xf7b5('0xc9')]);}}break;case _0xf7b5('0xca'):_0x44330c[_0xf7b5('0x45')]+=0x1;_0xcd0802[_0xf7b5('0xcb')]+=0x1;_0xcd0802[_0xf7b5('0xc0')]=ut[_0xf7b5('0xa7')](_0xcd0802);ut[_0xf7b5('0x99')](_0xcd0802,0x3,_0xf7b5('0xcc'));rpcDb[_0xf7b5('0x9f')](_0xcd0802,_0xf7b5('0xcd'));if(ut[_0xf7b5('0xa7')](_0xcd0802)>=_0x44330c[_0xf7b5('0xaa')]){_0x560cf1=ut[_0xf7b5('0xc3')](_0xcd0802,0xf,_0xf7b5('0xab'));rpcDb['createCustomerFinal'](_0x560cf1,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0xcd0802['countnoanswerretry']>=_0x44330c[_0xf7b5('0xce')]){rpcDb[_0xf7b5('0xac')](_0xcd0802,_0xf7b5('0xcd'));}else{rpcDb['rescheduleContact'](ut[_0xf7b5('0xcf')](_0xcd0802,'countnoanswerretry',_0x44330c[_0xf7b5('0xd0')]),_0xcd0802['unlockAgent'],_0xcd0802[_0xf7b5('0xc9')]);}}break;case _0xf7b5('0xd1'):_0x44330c[_0xf7b5('0x42')]+=0x1;_0xcd0802[_0xf7b5('0xd2')]+=0x1;_0xcd0802[_0xf7b5('0xc0')]=ut['totalGlobal'](_0xcd0802);ut[_0xf7b5('0x99')](_0xcd0802,0x8,_0xf7b5('0xd3'));rpcDb[_0xf7b5('0x9f')](_0xcd0802,'[callProgressDetectingCustomer][logCongestion]');if(ut[_0xf7b5('0xa7')](_0xcd0802)>=_0x44330c[_0xf7b5('0xaa')]){_0x560cf1=ut[_0xf7b5('0xc3')](_0xcd0802,0xf,_0xf7b5('0xab'));rpcDb['createCustomerFinal'](_0x560cf1,_0xf7b5('0xd4'));}else{if(_0xcd0802[_0xf7b5('0xd2')]>=_0x44330c[_0xf7b5('0xd5')]){rpcDb[_0xf7b5('0xac')](_0xcd0802,_0xf7b5('0xd6'));}else{rpcDb[_0xf7b5('0xc6')](ut[_0xf7b5('0xcf')](_0xcd0802,'countcongestionretry',_0x44330c[_0xf7b5('0xc7')]),_0xcd0802[_0xf7b5('0xc8')],_0xcd0802[_0xf7b5('0xc9')]);}}break;case'CANCEL':_0x44330c[_0xf7b5('0x47')]+=0x1;_0xcd0802[_0xf7b5('0xc0')]=ut['totalGlobal'](_0xcd0802);ut[_0xf7b5('0x99')](_0xcd0802,0x14,_0xf7b5('0xd7'));rpcDb['createCustomerHistory'](_0xcd0802,_0xf7b5('0xd8'));if(_0xcd0802['unlockAgent']){rpcDb['unlockContact'](_0xcd0802[_0xf7b5('0xd9')]);}if(_0xcd0802[_0xf7b5('0xc9')]){rpcDb[_0xf7b5('0xda')](_0xcd0802['idContact']);}break;default:if(_0xcd0802[_0xf7b5('0x7c')]){ut['decrementTalkink'](_0x44330c,_0xf7b5('0xdb'));ut[_0xf7b5('0x87')](_0xf7b5('0xdc')+_0x44330c['name'],_0x32be15);}_0x44330c['outboundUnknownCallsDay']+=0x1;_0xcd0802['countglobal']=ut[_0xf7b5('0xa7')](_0xcd0802);ut[_0xf7b5('0x99')](_0xcd0802,0xc,_0x32be15[_0xf7b5('0xdd')]||_0x32be15[_0xf7b5('0xde')]);rpcDb[_0xf7b5('0x9f')](_0xcd0802,_0xf7b5('0xdf'));if(ut[_0xf7b5('0xa7')](_0xcd0802)>=_0x44330c['dialGlobalMaxRetry']){_0x560cf1=ut[_0xf7b5('0xc3')](_0xcd0802,0xf,_0xf7b5('0xab'));rpcDb[_0xf7b5('0xac')](_0x560cf1,_0xf7b5('0xe0'));}else{rpcDb[_0xf7b5('0xac')](_0xcd0802,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this[_0xf7b5('0x15')][_0x32be15['linkedid']];}if(!(_0xcd0802[_0xf7b5('0x7c')]&&_0x31ab1c==='16')){ut[_0xf7b5('0xe1')](_0x44330c,_0xf7b5('0xe2'));logger[_0xf7b5('0x8b')](_0xf7b5('0xe3'),_0xcd0802[_0xf7b5('0xb1')],_0xf7b5('0xb2'),_0x44330c[_0xf7b5('0x5e')],_0xf7b5('0x79'),_0x44330c[_0xf7b5('0x56')]);}if(_0x31ab1c!==_0xf7b5('0xaf')){delete this[_0xf7b5('0x15')][_0x32be15[_0xf7b5('0xae')]];delete this[_0xf7b5('0x15')][_0x32be15[_0xf7b5('0xe4')]];}}};Preview[_0xf7b5('0xe')]['callProgressDetectingAgent']=function(_0x1e15ad,_0x1eeb49,_0x1d1160){if(_['isUndefined'](_0x1eeb49)&&_0xf7b5('0xe5')!==typeof _0x1eeb49){return;}if(_[_0xf7b5('0xe6')](_0x1d1160)&&_0xf7b5('0xe5')!==typeof _0x1d1160){return;}switch(_0x1d1160[_0xf7b5('0xe7')]){case'0':ut[_0xf7b5('0xe8')](_0x1e15ad,0x0,_0xf7b5('0xa8'));rpcDb[_0xf7b5('0xe9')](_0x1e15ad,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut[_0xf7b5('0xe8')](_0x1e15ad,0x3,_0xf7b5('0xcc'));rpcDb['createAgentHistory'](_0x1e15ad,_0xf7b5('0xea'));break;case'5':ut['logAgent'](_0x1e15ad,0x5,'Busy');rpcDb[_0xf7b5('0xe9')](_0x1e15ad,_0xf7b5('0xeb'));break;case'8':ut[_0xf7b5('0xe8')](_0x1e15ad,0x8,'Congestion');rpcDb[_0xf7b5('0xe9')](_0x1e15ad,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut[_0xf7b5('0xe8')](_0x1e15ad,0x16,_0xf7b5('0xec'));rpcDb[_0xf7b5('0xe9')](_0x1e15ad,_0xf7b5('0xed'));break;default:ut[_0xf7b5('0xe8')](_0x1e15ad,0xc,_0x1d1160[_0xf7b5('0xe7')]);rpcDb['createAgentHistory'](_0x1e15ad,_0xf7b5('0xee'));}ut[_0xf7b5('0xe1')](_0x1eeb49,_0xf7b5('0xef'));logger[_0xf7b5('0x8b')]('[originated][decrement][callProgressDetectingAgent]',_0x1e15ad[_0xf7b5('0xb1')],'\x20Queue',_0x1eeb49[_0xf7b5('0x5e')],_0xf7b5('0x79'),_0x1eeb49[_0xf7b5('0x56')]);delete this[_0xf7b5('0x15')][_0x1e15ad[_0xf7b5('0xb1')]];};Preview['prototype'][_0xf7b5('0xf0')]=function(_0x101a3c,_0x3f4f01,_0x571f44,_0x432b18,_0x51cc86){var _0x26aea4=this;return new BPromise(function(_0x1c90c2,_0x19def4){if(_[_0xf7b5('0x75')](_0x3f4f01)||_['isNil'](_0x3f4f01[_0xf7b5('0xf1')])||_['isNil'](_0x3f4f01[_0xf7b5('0xf1')][_0xf7b5('0xf2')])||_[_0xf7b5('0x75')](_0x3f4f01[_0xf7b5('0xf3')])){_0x19def4(ut[_0xf7b5('0x55')](_0xf7b5('0xf4'),_0x432b18,_0x51cc86));return;}var _0x1acc58=uuid['v4']();var _0xef3838=_0x26aea4[_0xf7b5('0x29')][_0x3f4f01[_0xf7b5('0x77')][_0xf7b5('0x5e')]];var _0x141c72=_0x571f44?_0x26aea4['agents'][_0x571f44]['id']:undefined;_0x26aea4['actions'][_0x1acc58]=new Action(_0x3f4f01,_0xef3838,_0x1acc58,_0x571f44,_0x141c72);var _0x1d4d2d=_0x26aea4[_0xf7b5('0x15')][_0x1acc58];_0x1d4d2d[_0xf7b5('0xc8')]=_0x432b18;_0x1d4d2d[_0xf7b5('0xc9')]=_0x51cc86;_0x1d4d2d['lookAgent']=_0x571f44;if(_['isEmpty'](_0x101a3c)){_0x26aea4[_0xf7b5('0xf5')](_0x1d4d2d,_0xef3838,_0x3f4f01,_0x571f44)[_0xf7b5('0x90')](function(_0x190526){logger[_0xf7b5('0x8b')](_0xf7b5('0xf6'),_0xf7b5('0xf7')+_0x1d4d2d['queue']+'\x20IdHopper:\x20'+_0x1d4d2d[_0xf7b5('0xd9')],JSON['stringify'](_0x190526));ami[_0xf7b5('0xb3')]('custom:agentcalled',ut['buildObj'](_0x1d4d2d,'called'));_0x1c90c2(ut[_0xf7b5('0x55')](_0xf7b5('0xf8')));})[_0xf7b5('0x83')](function(_0x524e4b){ut[_0xf7b5('0x69')](_0xf7b5('0xf9'),_0x524e4b);_0x19def4(ut[_0xf7b5('0x55')](_0xf7b5('0xfa'),_0x432b18,_0x51cc86));});}else{_0xef3838[_0xf7b5('0x40')]+=0x1;ut['logBlacklist'](_0x1d4d2d);rpcDb['createHistory'](_0x1d4d2d,_0xf7b5('0xfb'));delete _0x26aea4['actions'][_0x1acc58];_0x19def4(ut['message'](_0xf7b5('0xfc'),_0x432b18,_0x51cc86));}});};Preview[_0xf7b5('0xe')]['isTrunkReachable']=function(_0x46f68f){return!_[_0xf7b5('0x75')](_0x46f68f)&&!_[_0xf7b5('0x75')](_0x46f68f[_0xf7b5('0x5e')])&&!_[_0xf7b5('0x75')](_0x46f68f['active'])&&_0x46f68f[_0xf7b5('0x5f')]&&!_[_0xf7b5('0x75')](this[_0xf7b5('0x14')][util[_0xf7b5('0x62')](_0xf7b5('0xfd'),_0x46f68f['name'])])&&!_[_0xf7b5('0x75')](this['trunks'][util[_0xf7b5('0x62')](_0xf7b5('0xfd'),_0x46f68f[_0xf7b5('0x5e')])][_0xf7b5('0x81')])&&(this[_0xf7b5('0x14')][util['format']('SIP/%s',_0x46f68f['name'])]['status']==='reachable'||this[_0xf7b5('0x14')][util[_0xf7b5('0x62')](_0xf7b5('0xfd'),_0x46f68f[_0xf7b5('0x5e')])]['status']===_0xf7b5('0xfe'));};Preview[_0xf7b5('0xe')][_0xf7b5('0x95')]=function(_0x597704,_0x3e97dc){var _0x5d908e=this;return new BPromise(function(_0x223065,_0x5550fc){_0x5d908e[_0xf7b5('0xff')](_0x597704,_0x3e97dc)['then'](function(_0x4700d0){_0x223065(_[_0xf7b5('0x100')](_0x4700d0,[_0xf7b5('0x55')]));})[_0xf7b5('0x83')](function(_0x201966){if(_0x201966[_0xf7b5('0x101')]){rpcDb['unlockContact'](_0x597704);}if(_0x201966[_0xf7b5('0x5f')]){rpcDb[_0xf7b5('0xda')](_0x597704);}_0x5550fc(_['pick'](_0x201966,[_0xf7b5('0x55')]));});});};Preview[_0xf7b5('0xe')][_0xf7b5('0xff')]=function(_0x1180dd,_0x25f667){var _0x3ff41c=this;return new BPromise(function(_0x2e1055,_0x556791){var _0x1eb343,_0xe60d04;rpcDb[_0xf7b5('0x102')](_0x1180dd)['then'](function(_0x391c7f){if(!_[_0xf7b5('0x75')](_0x391c7f[0x0])){_0xe60d04=_0x391c7f[0x0][_0xf7b5('0x103')]?![]:!![];_0x1eb343=_0x391c7f[0x0][_0xf7b5('0x103')]?!![]:![];_0x1eb343=_0x25f667?!![]:_0x1eb343;}var _0x355898=_0x3ff41c[_0xf7b5('0x104')](_0x391c7f);if(_0x355898[_0xf7b5('0x105')]){rpcDb[_0xf7b5('0x106')](_[_0xf7b5('0x100')](_0x391c7f[0x0],[_0xf7b5('0xf3'),_0xf7b5('0x107')]))[_0xf7b5('0x90')](function(_0x102054){_0x3ff41c['checkInBlack'](_0x102054,_0x391c7f[0x0],_0x25f667,_0xe60d04,_0x1eb343)['then'](function(_0x1a4388){_0x2e1055(_0x1a4388);})[_0xf7b5('0x83')](function(_0x56a8bf){_0x556791(_0x56a8bf);});})[_0xf7b5('0x83')](function(_0x420917){ut[_0xf7b5('0x69')]('[Preview][checkIsBlackList]',_0x420917);_0x556791(ut[_0xf7b5('0x55')](_0xf7b5('0x108'),_0xe60d04,_0x1eb343));});}else{_0x556791(ut[_0xf7b5('0x55')](_0x355898[_0xf7b5('0x55')],_0xe60d04,_0x1eb343));}})[_0xf7b5('0x83')](function(_0x49d38a){ut[_0xf7b5('0x69')](_0xf7b5('0x109'),_0x49d38a);_0x556791(ut['message']('Call\x20unsuccessful',![],!![]));});});};Preview['prototype'][_0xf7b5('0x104')]=function(_0x51c0c9){if(_[_0xf7b5('0x75')](_0x51c0c9)||_[_0xf7b5('0x10a')](_0x51c0c9)||!_['isNil'](_0x51c0c9[0x0][_0xf7b5('0x10b')])&&_['isNil'](_0x51c0c9[0x0][_0xf7b5('0x10b')][_0xf7b5('0x5e')])){ut[_0xf7b5('0x69')]('[Preview][validateContact][Empty\x20Contact]',_0x51c0c9);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x14bca0=this[_0xf7b5('0x29')][_0x51c0c9[0x0][_0xf7b5('0x77')][_0xf7b5('0x5e')]];_0x14bca0[_0xf7b5('0x55')]=_0xf7b5('0xa5');if(_[_0xf7b5('0x75')](_0x14bca0)){ut[_0xf7b5('0x69')](_0xf7b5('0x10c'),_0x14bca0);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this[_0xf7b5('0xa3')](_0x14bca0[_0xf7b5('0x5d')])){ut[_0xf7b5('0x69')](_0xf7b5('0x10d'),_0xf7b5('0x10e')+_0x14bca0[_0xf7b5('0x5e')]+_0xf7b5('0x10f'));if(!this[_0xf7b5('0xa3')](_0x14bca0[_0xf7b5('0xa4')])){ut[_0xf7b5('0x69')]('[Preview][validateContact][Trunk\x20not\x20work]',_0x14bca0['name']+_0xf7b5('0x110'));return{'isValid':![],'message':_0xf7b5('0x111')};}}if(!ut[_0xf7b5('0x112')](_0x14bca0[_0xf7b5('0x38')])){ut[_0xf7b5('0x69')]('[Preview][validateContact][Campaign\x20Active]',_0x14bca0[_0xf7b5('0x5e')]+_0xf7b5('0x113'));return{'isValid':![],'message':_0xf7b5('0x10e')+_0x14bca0[_0xf7b5('0x5e')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0xf7b5('0x114')};};Preview['prototype']['execCall']=function(_0x27a3e2,_0x209cad,_0x257e4f,_0x3e6332){var _0x134afb=this;return new BPromise(function(_0x34a32f,_0x465042){var _0x2f9d86=_0x27a3e2[_0xf7b5('0xb1')];var _0x365e35=_0x134afb[_0xf7b5('0xa3')](_0x209cad[_0xf7b5('0x5d')])?util['format'](_0xf7b5('0x115'),_0x209cad['Trunk'][_0xf7b5('0x5e')],_[_0xf7b5('0x75')](_0x209cad[_0xf7b5('0x3d')])?'':_0x209cad[_0xf7b5('0x3d')]['trim']()||'',_0x209cad[_0xf7b5('0x116')]>0x0?_0x257e4f[_0xf7b5('0xf1')][_0xf7b5('0xf2')]['substring'](_0x209cad[_0xf7b5('0x116')]):_0x257e4f[_0xf7b5('0xf1')][_0xf7b5('0xf2')]):util[_0xf7b5('0x62')](_0xf7b5('0x115'),_[_0xf7b5('0x75')](_0x209cad[_0xf7b5('0xa4')])?_0x209cad[_0xf7b5('0x5d')]['name']:_0x209cad[_0xf7b5('0xa4')][_0xf7b5('0x5e')],_['isNil'](_0x209cad[_0xf7b5('0x3d')])?'':_0x209cad['dialPrefix'][_0xf7b5('0x117')]()||'',_0x209cad[_0xf7b5('0x116')]>0x0?_0x257e4f['Contact'][_0xf7b5('0xf2')][_0xf7b5('0x118')](_0x209cad[_0xf7b5('0x116')]):_0x257e4f[_0xf7b5('0xf1')]['phone']);var _0x29aa3e=_0x134afb[_0xf7b5('0xa3')](_0x209cad[_0xf7b5('0x5d')])?ut[_0xf7b5('0x119')](_0x209cad['Trunk'][_0xf7b5('0x60')],_0x209cad[_0xf7b5('0x3a')],_0x209cad[_0xf7b5('0x11a')]>0x0?ut[_0xf7b5('0x11b')](_0x209cad[_0xf7b5('0x3b')],_0x209cad[_0xf7b5('0x11a')]):_0x209cad['dialOriginateCallerIdNumber']):ut[_0xf7b5('0x119')](_[_0xf7b5('0x75')](_0x209cad[_0xf7b5('0xa4')])?_0x209cad[_0xf7b5('0x5d')][_0xf7b5('0x60')]:_0x209cad[_0xf7b5('0xa4')][_0xf7b5('0x60')],_0x209cad['dialOriginateCallerIdName'],_0x209cad[_0xf7b5('0x11a')]>0x0?ut['getCallerIdRandom'](_0x209cad[_0xf7b5('0x3b')],_0x209cad[_0xf7b5('0x11a')]):_0x209cad['dialOriginateCallerIdNumber']);if(_0x29aa3e){_0x27a3e2[_0xf7b5('0x11c')]=ut['extractCalleridName'](_0x29aa3e);_0x27a3e2['originatecalleridnum']=ut['extractCalleridNumber'](_0x29aa3e);}var _0x2f49fa=ut[_0xf7b5('0x11d')](_0x209cad,_0x257e4f,_0x365e35,_0x29aa3e,_0x2f9d86,_0x27a3e2);_['merge'](_0x27a3e2,ut[_0xf7b5('0x11e')](_0x2f49fa));_0x27a3e2[_0xf7b5('0x11f')]=moment()[_0xf7b5('0x62')]('YYYY-MM-DD\x20HH:mm:ss');ami[_0xf7b5('0x80')](ut[_0xf7b5('0x120')](_0x27a3e2,_0x209cad,_0x2f49fa,_0x27a3e2['activeContact'],_0x3e6332))['then'](function(_0xc78ba6){_0x209cad['originated']+=0x1;logger[_0xf7b5('0x8b')]('[originated][increment]',_0x2f9d86,_0xf7b5('0xb2'),_0x209cad[_0xf7b5('0x5e')],_0xf7b5('0x79'),_0x209cad[_0xf7b5('0x56')]);_0x34a32f(_0xc78ba6);})[_0xf7b5('0x83')](function(_0x2684ad){ut[_0xf7b5('0xe8')](_0x27a3e2,0xe,_0xf7b5('0x121'));rpcDb[_0xf7b5('0xe9')](_0x27a3e2,_0xf7b5('0x122'));_0x465042(_0x2684ad);});});};Preview[_0xf7b5('0xe')][_0xf7b5('0x22')]=function(_0x354f6f){if(this[_0xf7b5('0x15')][_0x354f6f[_0xf7b5('0xae')]]){this[_0xf7b5('0x15')][_0x354f6f[_0xf7b5('0xae')]][_0xf7b5('0x82')]=_0x354f6f[_0xf7b5('0x82')];}};Preview['prototype'][_0xf7b5('0x19')]=function(_0x1a5be8){var _0x2d939c=this;var _0x2985e1=this[_0xf7b5('0x15')][_0x1a5be8[_0xf7b5('0x123')]];if(_0x2985e1){if(_0x2985e1['lookAgent']&&this['agents'][_0x2985e1[_0xf7b5('0x124')]]){ut[_0xf7b5('0x125')](_0x2985e1,this[_0xf7b5('0x16')][_0x2985e1['lookAgent']]['name'],this[_0xf7b5('0x16')][_0x2985e1[_0xf7b5('0x124')]]['id']);}var _0x1b2fb7=_['clone'](_0x2985e1);_0x1b2fb7[_0xf7b5('0x126')]=moment()[_0xf7b5('0x62')](_0xf7b5('0x98'));var _0xff52a7=_0x2d939c[_0xf7b5('0x29')][_0x2985e1['queue']];if(ut[_0xf7b5('0x127')](_0x1a5be8[_0xf7b5('0x128')])){if(_0x2985e1[_0xf7b5('0xc8')]){rpcDb['unlockContact'](_0x2985e1[_0xf7b5('0xd9')]);}if(_0x2985e1[_0xf7b5('0xc9')]){rpcDb[_0xf7b5('0xda')](_0x2985e1[_0xf7b5('0xd9')]);}ami[_0xf7b5('0xb3')]('custom:agentringnoanswer',ut[_0xf7b5('0xb4')](_0x2985e1,_0xf7b5('0x129')));this['callProgressDetectingAgent'](_0x1b2fb7,_0xff52a7,_0x1a5be8);}else{_0x2985e1[_0xf7b5('0x11f')]=moment()[_0xf7b5('0x62')](_0xf7b5('0x98'));ut['logAgent'](_0x1b2fb7,0x4,_0xf7b5('0x12a'));rpcDb[_0xf7b5('0xe9')](_0x1b2fb7,'[callProgressDetectingAgent][logAnswer]');}}};Preview['prototype'][_0xf7b5('0x1c')]=function(_0x4b0ca0){var _0xf7e8fd=this;var _0x929717=this[_0xf7b5('0x15')][_0x4b0ca0[_0xf7b5('0xae')]];var _0x1c9b50;if(_0x929717){_0x1c9b50=this['campaignsPreview'][_0x929717['queue']];logger[_0xf7b5('0x8b')](_0xf7b5('0x12b'),_0x4b0ca0['linkedid'],_0xf7b5('0xb2'),_0x1c9b50[_0xf7b5('0x5e')],_0xf7b5('0x7b'),_0x1c9b50[_0xf7b5('0x2e')]);}if(this[_0xf7b5('0x15')][_0x4b0ca0[_0xf7b5('0xae')]]&&_0x4b0ca0[_0xf7b5('0xae')]!==_0x4b0ca0[_0xf7b5('0xb1')]){if(_0x4b0ca0[_0xf7b5('0x12c')]==='16'&&this[_0xf7b5('0x15')][_0x4b0ca0[_0xf7b5('0xae')]]['dialAnswer']){this[_0xf7b5('0xa6')](_0x4b0ca0,_0x4b0ca0[_0xf7b5('0xae')],_0x4b0ca0[_0xf7b5('0x12c')]);}else if(this[_0xf7b5('0x15')][_0x4b0ca0[_0xf7b5('0xae')]]['dialAnswer']){logger['info'](_0xf7b5('0x12d'),_0x4b0ca0[_0xf7b5('0xae')],_0x4b0ca0[_0xf7b5('0x12c')],_0xf7b5('0xb2'),_0x1c9b50[_0xf7b5('0x5e')],_0xf7b5('0x7b'),_0x1c9b50['pTalking']);this['callProgressDetectingCustomer'](_0x4b0ca0,_0x4b0ca0['linkedid'],_0x4b0ca0[_0xf7b5('0x12c')]);}}else if(_0x929717&&_[_0xf7b5('0x75')](_0x929717[_0xf7b5('0x12e')])&&_0x1c9b50[_0xf7b5('0x12f')]&&_0x4b0ca0[_0xf7b5('0xae')]===_0x4b0ca0[_0xf7b5('0xb1')]&&_[_0xf7b5('0x75')](_0x4b0ca0[_0xf7b5('0xe7')])&&_0x4b0ca0[_0xf7b5('0x12c')]==='16'&&_0x4b0ca0[_0xf7b5('0x130')]==='6'&&_[_0xf7b5('0xe6')](_0x929717[_0xf7b5('0x131')])){if(_0x929717['unlockAgent']){rpcDb[_0xf7b5('0x132')](_0x929717[_0xf7b5('0xd9')]);}if(_0x929717[_0xf7b5('0xc9')]){rpcDb[_0xf7b5('0xda')](_0x929717[_0xf7b5('0xd9')]);}_0x4b0ca0[_0xf7b5('0xe7')]='22';this['callProgressDetectingAgent'](_0x929717,_0x1c9b50,_0x4b0ca0);}else if(_0x929717&&_0x929717[_0xf7b5('0x131')]){if(_0x4b0ca0[_0xf7b5('0x12c')]==='16'&&this['actions'][_0x4b0ca0[_0xf7b5('0xae')]]['dialAnswer']){logger[_0xf7b5('0x8b')]('[syncHangup][talking][transfer]',_0x4b0ca0[_0xf7b5('0xae')],_0x4b0ca0['cause'],_0xf7b5('0xb2'),_0x1c9b50['name'],'pTalking:\x20',_0x1c9b50[_0xf7b5('0x2e')]);this[_0xf7b5('0xa6')](_0x4b0ca0,_0x4b0ca0['linkedid'],_0x4b0ca0[_0xf7b5('0x12c')]);}else if(this['actions'][_0x4b0ca0[_0xf7b5('0xae')]]['dialAnswer']){logger[_0xf7b5('0x8b')](_0xf7b5('0x12d'),_0x4b0ca0[_0xf7b5('0xae')],_0x4b0ca0[_0xf7b5('0x12c')],_0xf7b5('0xb2'),_0x1c9b50[_0xf7b5('0x5e')],_0xf7b5('0x7b'),_0x1c9b50['pTalking']);this[_0xf7b5('0xa6')](_0x4b0ca0,_0x4b0ca0[_0xf7b5('0xae')],_0x4b0ca0['cause']);}}};Preview['prototype']['syncDialEnd']=function(_0x2163a4){if(this[_0xf7b5('0x15')][_0x2163a4['destlinkedid']]&&_0x2163a4[_0xf7b5('0xe4')]!==_0x2163a4[_0xf7b5('0x133')]){this[_0xf7b5('0xa6')](_0x2163a4,_0x2163a4[_0xf7b5('0xe4')],_0x2163a4[_0xf7b5('0xde')]);}};Preview[_0xf7b5('0xe')][_0xf7b5('0x1e')]=function(_0x1da721){if(this[_0xf7b5('0x15')][_0x1da721[_0xf7b5('0xae')]]&&_0x1da721['linkedid']!==_0x1da721[_0xf7b5('0xb1')]&&!this['actions'][_0x1da721[_0xf7b5('0xae')]][_0xf7b5('0x7c')]){if(_0x1da721[_0xf7b5('0x12c')]==='1'){this[_0xf7b5('0xa6')](_0x1da721,_0x1da721[_0xf7b5('0xae')],_0x1da721[_0xf7b5('0x12c')]);}}};Preview[_0xf7b5('0xe')]['addVariable']=function(_0x15fd9c,_0x4b9c7b,_0x52f850){if(this[_0xf7b5('0x15')][_0x15fd9c]){if(_[_0xf7b5('0x75')](this['actions'][_0x15fd9c][_0xf7b5('0x134')])){this[_0xf7b5('0x15')][_0x15fd9c][_0xf7b5('0x134')]={};}this[_0xf7b5('0x15')][_0x15fd9c][_0xf7b5('0x134')][_0x4b9c7b]=_0x52f850;}};Preview['prototype']['syncVarSet']=function(_0x5e7014){try{if(!_[_0xf7b5('0x75')](_0x5e7014)){if(ut[_0xf7b5('0x135')](_[_0xf7b5('0x136')](_0x5e7014['variable'])[0x0])){this[_0xf7b5('0x137')](_0x5e7014[_0xf7b5('0xb1')],_[_0xf7b5('0x136')](_0x5e7014[_0xf7b5('0x138')])[0x0],_0x5e7014[_0xf7b5('0x139')]);}}}catch(_0x59b88a){logger[_0xf7b5('0x13a')](_0xf7b5('0x13b'),util['inspect'](_0x59b88a,{'showHidden':![],'depth':null}));}};Preview[_0xf7b5('0xe')][_0xf7b5('0x26')]=function(_0x1ab8bd){if(_0x1ab8bd){if(this['actions'][_0x1ab8bd['transfertargetlinkedid']]){this[_0xf7b5('0x15')][_0x1ab8bd[_0xf7b5('0x13c')]][_0xf7b5('0x131')]=!![];}}};Preview['prototype'][_0xf7b5('0x28')]=function(_0x18c10e){if(_0x18c10e){if(this[_0xf7b5('0x15')][_0x18c10e['transfererlinkedid']]){this[_0xf7b5('0x15')][_0x18c10e[_0xf7b5('0x13d')]]['transfer']=!![];}}};module['exports']=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 19a6235..55f281c 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 _0x98a8=['[countReScheduled]\x20','unlockContact','disableContact','[activeContact]\x20','crateCustomerReportQueue','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercompleteAt','endtime','connectedlinename','membername','context','xcally-motion-preview','holdtime','assigned','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','rescheduleContactInQueue','util','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','then','createHistory','catch','[createHistory]\x20','resolve','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled'];(function(_0x162955,_0x567cf4){var _0x2eeb6c=function(_0x5bdccd){while(--_0x5bdccd){_0x162955['push'](_0x162955['shift']());}};_0x2eeb6c(++_0x567cf4);}(_0x98a8,0x12c));var _0x898a=function(_0x34b506,_0xc3ac50){_0x34b506=_0x34b506-0x0;var _0x1b90d4=_0x98a8[_0x34b506];return _0x1b90d4;};'use strict';var util=require(_0x898a('0x0'));var BPromise=require(_0x898a('0x1'));var logger=require(_0x898a('0x2'))(_0x898a('0x3'));var _=require(_0x898a('0x4'));var cmHopper=require(_0x898a('0x5'));var cmHopperFinal=require(_0x898a('0x6'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x898a('0x7'));var voiceQueueRt=require(_0x898a('0x8'));var agentReportPreview=require(_0x898a('0x9'));var voiceQueueReport=require(_0x898a('0xa'));function loggerCatch(_0x3e7ddd){return function(_0x5d7e59){logger[_0x898a('0xb')](_0x3e7ddd,util['inspect'](_0x5d7e59,{'showHidden':![],'depth':null}));};}function create(_0xfa8c50){return BPromise['resolve']()[_0x898a('0xc')](cmHopperHistory[_0x898a('0xd')](_0xfa8c50))[_0x898a('0xe')](loggerCatch(_0x898a('0xf')));}function createAgent(_0x3150df){return BPromise[_0x898a('0x10')]()[_0x898a('0xc')](agentReportPreview[_0x898a('0xd')](_0x3150df))[_0x898a('0xe')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x3e1867){return BPromise['resolve']()[_0x898a('0xc')](cmHopper['moveContactManagedDialer'](_0x3e1867,!![]))[_0x898a('0xe')](loggerCatch(_0x898a('0x11')));}exports[_0x898a('0x12')]=function(_0x5f5e06){return BPromise['resolve']()['then'](cmHopperBlack[_0x898a('0x12')](_0x5f5e06))[_0x898a('0xe')](loggerCatch(_0x898a('0x13')));};exports[_0x898a('0x14')]=function(_0x1873e9){return BPromise[_0x898a('0x10')]()['then'](cmHopper[_0x898a('0x14')](_0x1873e9))['catch'](loggerCatch(_0x898a('0x15')));};exports['createHistory']=function(_0x303321,_0x4fb05b){create(_0x303321)[_0x898a('0xe')](loggerCatch(_0x4fb05b));moveContact(_0x303321)['catch'](loggerCatch(_0x4fb05b));};exports[_0x898a('0x16')]=function(_0x3197f7,_0x28cc63){createAgent(_0x3197f7)['catch'](loggerCatch(_0x28cc63));};exports[_0x898a('0x17')]=function(_0x5960e0,_0x54c8f3){create(_0x5960e0)[_0x898a('0xe')](loggerCatch(_0x54c8f3));};exports[_0x898a('0x18')]=function(_0x58c3ab,_0x4d374b){moveContact(_0x58c3ab)[_0x898a('0xe')](loggerCatch(_0x4d374b));};exports[_0x898a('0x19')]=function(_0x38a8f0,_0x2917ff,_0x2da52d){if(_0x2917ff){_0x38a8f0[_0x898a('0x1a')]=null;}if(_0x2da52d){_0x38a8f0[_0x898a('0x1b')]=![];}return BPromise['resolve']()[_0x898a('0xc')](cmHopper[_0x898a('0x19')](_0x38a8f0))[_0x898a('0xe')](loggerCatch(_0x898a('0x1c')));};exports[_0x898a('0x1d')]=function(_0x310bfa){return BPromise['resolve']()[_0x898a('0xc')](cmHopper[_0x898a('0x1d')](_0x310bfa))[_0x898a('0xe')](loggerCatch(_0x898a('0x1e')));};exports[_0x898a('0x1f')]=function(_0x1426e3){return BPromise['resolve']()[_0x898a('0xc')](cmHopper['unlockContact']({'UserId':null},_0x1426e3,0x1))['catch'](loggerCatch('[unlockContact]\x20'));};exports[_0x898a('0x20')]=function(_0x1f4d86){return BPromise[_0x898a('0x10')]()[_0x898a('0xc')](cmHopper[_0x898a('0x1f')]({'active':![]},_0x1f4d86,0x1))[_0x898a('0xe')](loggerCatch(_0x898a('0x21')));};exports[_0x898a('0x22')]=function(_0xd31922){var _0x58149d={};_0x58149d['type']=_0xd31922['type'];_0x58149d[_0x898a('0x23')]=_0xd31922[_0x898a('0x23')];_0x58149d[_0x898a('0x24')]=_0xd31922[_0x898a('0x24')];_0x58149d[_0x898a('0x25')]=_0xd31922[_0x898a('0x25')];_0x58149d[_0x898a('0x26')]=_0xd31922[_0x898a('0x26')];_0x58149d[_0x898a('0x27')]=_0xd31922[_0x898a('0x28')];_0x58149d[_0x898a('0x29')]=_0xd31922[_0x898a('0x28')];_0x58149d['queuecallercomplete']=0x1;_0x58149d[_0x898a('0x2a')]=_0xd31922[_0x898a('0x2b')];_0x58149d[_0x898a('0x2c')]=_0xd31922[_0x898a('0x2d')];_0x58149d[_0x898a('0x2e')]='from-sip';_0x58149d['exten']=_0x898a('0x2f');_0x58149d[_0x898a('0x30')]=0x0;_0x58149d[_0x898a('0x31')]=0x1;_0x58149d['lastAssignedTo']=_0xd31922[_0x898a('0x2d')];_0x58149d[_0x898a('0x32')]=_0x898a('0x33');return BPromise[_0x898a('0x10')]()[_0x898a('0xc')](voiceQueueReport[_0x898a('0x34')](_0x58149d))[_0x898a('0xe')](loggerCatch(_0x898a('0x35')));};exports['getContactRecallMe']=function(_0x33a191,_0x5baf5b){return BPromise['resolve']()[_0x898a('0xc')](cmHopper['getContactRecallMe'](_0x33a191,_0x5baf5b))[_0x898a('0xe')](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0x898a('0x36')]=function(_0x4f202c){return BPromise[_0x898a('0x10')]()[_0x898a('0xc')](cmHopper[_0x898a('0x19')](_0x4f202c,!![],!![]))['catch'](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ No newline at end of file +var _0xae24=['resolve','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','[activeContact]\x20','crateCustomerReportQueue','type','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','holdtime','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','../../../config/logger','lodash','../rpc/cmHopper','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','then','[createHistory]\x20','createHistory','catch'];(function(_0x130705,_0x2d266b){var _0x1fa991=function(_0x395639){while(--_0x395639){_0x130705['push'](_0x130705['shift']());}};_0x1fa991(++_0x2d266b);}(_0xae24,0x182));var _0x4ae2=function(_0x37bfbd,_0x5851e4){_0x37bfbd=_0x37bfbd-0x0;var _0x3a3065=_0xae24[_0x37bfbd];return _0x3a3065;};'use strict';var util=require(_0x4ae2('0x0'));var BPromise=require('bluebird');var logger=require(_0x4ae2('0x1'))('preview');var _=require(_0x4ae2('0x2'));var cmHopper=require(_0x4ae2('0x3'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x4ae2('0x4'));var voiceQueueRt=require('../rpc/voiceQueueRt');var agentReportPreview=require(_0x4ae2('0x5'));var voiceQueueReport=require(_0x4ae2('0x6'));function loggerCatch(_0x20c85c){return function(_0x3e6055){logger[_0x4ae2('0x7')](_0x20c85c,util[_0x4ae2('0x8')](_0x3e6055,{'showHidden':![],'depth':null}));};}function create(_0x4f2e84){return BPromise['resolve']()[_0x4ae2('0x9')](cmHopperHistory['createHistory'](_0x4f2e84))['catch'](loggerCatch(_0x4ae2('0xa')));}function createAgent(_0xb01e8e){return BPromise['resolve']()[_0x4ae2('0x9')](agentReportPreview[_0x4ae2('0xb')](_0xb01e8e))[_0x4ae2('0xc')](loggerCatch(_0x4ae2('0xa')));}function moveContact(_0x52458f){return BPromise[_0x4ae2('0xd')]()[_0x4ae2('0x9')](cmHopper[_0x4ae2('0xe')](_0x52458f,!![]))['catch'](loggerCatch(_0x4ae2('0xf')));}exports[_0x4ae2('0x10')]=function(_0x30d6c4){return BPromise[_0x4ae2('0xd')]()[_0x4ae2('0x9')](cmHopperBlack[_0x4ae2('0x10')](_0x30d6c4))[_0x4ae2('0xc')](loggerCatch(_0x4ae2('0x11')));};exports[_0x4ae2('0x12')]=function(_0x5e2bfd){return BPromise['resolve']()['then'](cmHopper[_0x4ae2('0x12')](_0x5e2bfd))[_0x4ae2('0xc')](loggerCatch('[getContactPreview]\x20'));};exports[_0x4ae2('0xb')]=function(_0x9fb8db,_0x1fde63){create(_0x9fb8db)[_0x4ae2('0xc')](loggerCatch(_0x1fde63));moveContact(_0x9fb8db)[_0x4ae2('0xc')](loggerCatch(_0x1fde63));};exports[_0x4ae2('0x13')]=function(_0x3d4259,_0xdc8798){createAgent(_0x3d4259)[_0x4ae2('0xc')](loggerCatch(_0xdc8798));};exports[_0x4ae2('0x14')]=function(_0x4d5071,_0x4a97af){create(_0x4d5071)[_0x4ae2('0xc')](loggerCatch(_0x4a97af));};exports[_0x4ae2('0x15')]=function(_0x51e20c,_0x45c1bf){moveContact(_0x51e20c)[_0x4ae2('0xc')](loggerCatch(_0x45c1bf));};exports[_0x4ae2('0x16')]=function(_0x2ad222,_0x8732bb,_0x497218){if(_0x8732bb){_0x2ad222[_0x4ae2('0x17')]=null;}if(_0x497218){_0x2ad222['active']=![];}return BPromise['resolve']()[_0x4ae2('0x9')](cmHopper[_0x4ae2('0x16')](_0x2ad222))[_0x4ae2('0xc')](loggerCatch(_0x4ae2('0x18')));};exports[_0x4ae2('0x19')]=function(_0x526768){return BPromise[_0x4ae2('0xd')]()['then'](cmHopper[_0x4ae2('0x19')](_0x526768))[_0x4ae2('0xc')](loggerCatch(_0x4ae2('0x1a')));};exports['unlockContact']=function(_0x43f112){return BPromise[_0x4ae2('0xd')]()[_0x4ae2('0x9')](cmHopper[_0x4ae2('0x1b')]({'UserId':null},_0x43f112,0x1))[_0x4ae2('0xc')](loggerCatch(_0x4ae2('0x1c')));};exports['disableContact']=function(_0x5962b0){return BPromise[_0x4ae2('0xd')]()[_0x4ae2('0x9')](cmHopper[_0x4ae2('0x1b')]({'active':![]},_0x5962b0,0x1))[_0x4ae2('0xc')](loggerCatch(_0x4ae2('0x1d')));};exports[_0x4ae2('0x1e')]=function(_0x57a377){var _0x5ec1fd={};_0x5ec1fd[_0x4ae2('0x1f')]=_0x57a377['type'];_0x5ec1fd['uniqueid']=_0x57a377['uniqueid'];_0x5ec1fd[_0x4ae2('0x20')]=_0x57a377[_0x4ae2('0x20')];_0x5ec1fd['calleridname']=_0x57a377[_0x4ae2('0x21')];_0x5ec1fd[_0x4ae2('0x22')]=_0x57a377[_0x4ae2('0x22')];_0x5ec1fd[_0x4ae2('0x23')]=_0x57a377[_0x4ae2('0x24')];_0x5ec1fd[_0x4ae2('0x25')]=_0x57a377[_0x4ae2('0x24')];_0x5ec1fd[_0x4ae2('0x26')]=0x1;_0x5ec1fd[_0x4ae2('0x27')]=_0x57a377[_0x4ae2('0x28')];_0x5ec1fd[_0x4ae2('0x29')]=_0x57a377[_0x4ae2('0x2a')];_0x5ec1fd[_0x4ae2('0x2b')]=_0x4ae2('0x2c');_0x5ec1fd[_0x4ae2('0x2d')]=_0x4ae2('0x2e');_0x5ec1fd[_0x4ae2('0x2f')]=0x0;_0x5ec1fd['assigned']=0x1;_0x5ec1fd[_0x4ae2('0x30')]=_0x57a377['membername'];_0x5ec1fd[_0x4ae2('0x31')]=_0x4ae2('0x32');return BPromise['resolve']()[_0x4ae2('0x9')](voiceQueueReport[_0x4ae2('0x33')](_0x5ec1fd))[_0x4ae2('0xc')](loggerCatch(_0x4ae2('0x34')));};exports['getContactRecallMe']=function(_0x349c84,_0x269a91){return BPromise[_0x4ae2('0xd')]()[_0x4ae2('0x9')](cmHopper[_0x4ae2('0x35')](_0x349c84,_0x269a91))[_0x4ae2('0xc')](loggerCatch(_0x4ae2('0x36')));};exports[_0x4ae2('0x37')]=function(_0xe99f9d){return BPromise['resolve']()[_0x4ae2('0x9')](cmHopper['rescheduleContact'](_0xe99f9d,!![],!![]))[_0x4ae2('0xc')](loggerCatch(_0x4ae2('0x38')));}; \ 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 05eaf32..27ecc65 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 _0xf712=['callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-phone','xmd-listid','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-contactid','xmd-cdrtype','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','bridgepeer','getCallerIdRandom','pow','match','util','moment','../../../../config/logger','preview','env','127.0.0.1','milliseconds','loggerCatch','error','inspect','logger','info','logger2','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','calleridname','calleridnum','ContactId','dialer','dialOriginateTimeout','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','Contact','hasOwnProperty','tags','updatedAt','%s%s','XMD-','toUpper','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','logLookAgent','membername','UserId','endtime','ringtime','talktime','answertime','Failure','variablesAction','BOOKED','uniqueid','originate','channelAgent','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','cloneAction','clone','Global','scheduledAt','scheduledat','add','ListId','VoiceQueueId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','lastevent','interface','buildAcw','queue','agentReadyId','status','reachable','getDiff','diff','seconds','CampaignId','idContact','campaigntype','active','countglobal','callback'];(function(_0x1d6f62,_0x4cf24d){var _0x44467d=function(_0x2384fa){while(--_0x2384fa){_0x1d6f62['push'](_0x1d6f62['shift']());}};_0x44467d(++_0x4cf24d);}(_0xf712,0x19c));var _0x2f71=function(_0x1ce3dd,_0x4009a9){_0x1ce3dd=_0x1ce3dd-0x0;var _0x2eef5c=_0xf712[_0x1ce3dd];return _0x2eef5c;};'use strict';var util=require(_0x2f71('0x0'));var _=require('lodash');var moment=require(_0x2f71('0x1'));var logger=require(_0x2f71('0x2'))(_0x2f71('0x3'));var ipAgi=process[_0x2f71('0x4')]['XCALLY_IP_AGI']||_0x2f71('0x5');function getSeconds(_0x11e656,_0x421a9c){var _0x16174e=moment(_0x11e656)[_0x2f71('0x6')](0x0);var _0x53ecbf=moment(_0x421a9c)[_0x2f71('0x6')](0x0);return _0x16174e['diff'](_0x53ecbf,'seconds');}exports[_0x2f71('0x7')]=function(_0x578b74){return function(_0x31a7bc){logger[_0x2f71('0x8')](_0x578b74,util[_0x2f71('0x9')](_0x31a7bc,{'showHidden':![],'depth':null}));};};exports[_0x2f71('0xa')]=function(_0x113d97,_0x1b2680){logger[_0x2f71('0xb')](_0x113d97,util[_0x2f71('0x9')](_0x1b2680,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x235822,_0x757ea4){logger['error'](_0x235822,util[_0x2f71('0x9')](_0x757ea4,{'showHidden':![],'depth':null}));};exports[_0x2f71('0xc')]=function(_0x23ea1b){return function(_0x59fda8){logger['info'](_0x23ea1b,util[_0x2f71('0x9')](_0x59fda8,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x31c39f,_0x2797d4,_0x2fc423){return{'message':_0x31c39f,'unlock':_0x2797d4,'active':_0x2fc423};};exports[_0x2f71('0xd')]=function(_0x216724,_0x36aef6,_0x73d438){if(!_[_0x2f71('0xe')](_0x73d438)&&_0x2f71('0xf')===typeof _0x73d438&&!_[_0x2f71('0x10')](_0x73d438)){if(!_[_0x2f71('0xe')](_0x36aef6)&&_0x2f71('0xf')===typeof _0x36aef6&&!_['isEmpty'](_0x36aef6)){return util[_0x2f71('0x11')](_0x2f71('0x12'),_0x36aef6,_0x73d438);}return util[_0x2f71('0x11')](_0x2f71('0x12'),_0x73d438,_0x73d438);}if(!_[_0x2f71('0xe')](_0x216724)&&_0x2f71('0xf')===typeof _0x216724&&!_['isEmpty'](_0x216724)){return _0x216724;}return _0x2f71('0x13');};exports[_0x2f71('0x14')]=function(_0x24a8f8){if(_[_0x2f71('0x15')](_0x24a8f8)){return![];}return _0x24a8f8;};exports[_0x2f71('0x16')]=function(_0x116b5b,_0x9327e4,_0x456e07,_0x1f938b,_0x502b29,_0x3c0d9a){var _0x5bb8d9={'XMD-QUEUE':_0x9327e4[_0x2f71('0x17')]?_0x9327e4[_0x2f71('0x17')][_0x2f71('0x18')]:'','XMD-CALLERID':_0x1f938b,'XMD-CALLERID-PREVIEW':_0x3c0d9a?util['format']('\x22%s\x22\x20<%s>',_0x3c0d9a[_0x2f71('0x19')],_0x3c0d9a[_0x2f71('0x1a')]):_0x1f938b,'XMD-DIALID':_0x502b29,'XMD-CONTACTID':_0x9327e4[_0x2f71('0x1b')],'XMD-CDRTYPE':_0x2f71('0x1c'),'CALLERID(all)':_0x1f938b,'XMD-VOICEQUEUEID':_0x9327e4['VoiceQueueId'],'XMD-DIALCHANNEL':_0x456e07,'XMD-DIALTIMEOUT':_0x116b5b[_0x2f71('0x1d')]||0x1e,'XMD-DIALOPTIONS':util[_0x2f71('0x11')]('\x22rtTxX%s%s\x22',_0x116b5b[_0x2f71('0x1e')]?'g':'',_[_0x2f71('0x10')](_0x116b5b[_0x2f71('0x1f')])?'':_0x2f71('0x20')),'XMD-DIALURL':_0x116b5b[_0x2f71('0x21')]||'','XMD-AGI':_0x116b5b[_0x2f71('0x22')]?util['format'](_0x2f71('0x23'),ipAgi,_0x116b5b[_0x2f71('0x22')]):_0x2f71('0x24'),'XMD-AGIAFTER':_0x116b5b[_0x2f71('0x1e')]?util['format'](_0x2f71('0x23'),ipAgi,_0x116b5b[_0x2f71('0x1e')]):_0x2f71('0x24'),'XMD-ORIGINATECALLERIDNUM':_0x3c0d9a?_0x3c0d9a[_0x2f71('0x25')]:'','XMD-ORIGINATECALLERIDNAME':_0x3c0d9a?_0x3c0d9a[_0x2f71('0x26')]:'','XMD-DESTINATION':_0x2f71('0x27')};if(!_[_0x2f71('0x10')](_0x116b5b[_0x2f71('0x1f')])){_0x5bb8d9[util['format']('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x116b5b[_0x2f71('0x1f')];_0x5bb8d9[util[_0x2f71('0x11')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x502b29;}if(_0x9327e4&&_0x9327e4[_0x2f71('0x28')]){for(var _0x2790fd in _0x9327e4['Contact']){if(_0x9327e4['Contact'][_0x2f71('0x29')](_0x2790fd)){if(!_[_0x2f71('0x15')](_0x9327e4[_0x2f71('0x28')][_0x2790fd])&&_0x2790fd!=='id'&&_0x2790fd!==_0x2f71('0x2a')&&_0x2790fd!=='createdAt'&&_0x2790fd!==_0x2f71('0x2b')){_0x5bb8d9[util[_0x2f71('0x11')](_0x2f71('0x2c'),_0x2f71('0x2d'),_[_0x2f71('0x2e')](_0x2790fd))]=_0x9327e4[_0x2f71('0x28')][_0x2790fd];}}}}return _0x5bb8d9;};exports[_0x2f71('0x2f')]=function(_0x4309d6){var _0x46dc91={};for(var _0x3afa7e in _0x4309d6){if(_0x4309d6[_0x2f71('0x29')](_0x3afa7e)){_0x46dc91[util[_0x2f71('0x11')]('%s',_[_0x2f71('0x30')](_0x3afa7e))]=_0x4309d6[_0x3afa7e];}}return{'variables':_0x46dc91};};exports[_0x2f71('0x31')]=function(_0x3e815f,_0xbb7c97){if(!_[_0x2f71('0x15')](_0x3e815f)){if(_0x3e815f[_0x2f71('0x29')](_0x2f71('0x32'))){if(_0x3e815f[_0x2f71('0x32')]>0x0){_0x3e815f[_0x2f71('0x32')]-=0x1;}else{logger['error'](_0x2f71('0x33'),_0xbb7c97);}}}else{logger[_0x2f71('0x8')](_0x2f71('0x34'),_0xbb7c97);}};exports[_0x2f71('0x35')]=function(_0x1eddff){var _0x1fadd2=moment()[_0x2f71('0x11')](_0x2f71('0x36'));_0x1eddff[_0x2f71('0x37')]=0xd;_0x1eddff[_0x2f71('0x38')]=_0x2f71('0x39');_0x1eddff[_0x2f71('0x3a')]=_0x1fadd2;_0x1eddff['responsetime']=_0x1fadd2;_0x1eddff['endtime']=_0x1fadd2;};exports['logAgent']=function(_0x17f896,_0x43efcd,_0x3242cd){var _0x4098e7=moment()['format'](_0x2f71('0x36'));_0x17f896['state']=_0x43efcd;_0x17f896['statedesc']=_0x3242cd;_0x17f896[_0x2f71('0x3b')]=_0x4098e7;_0x17f896['ringtime']=getSeconds(_0x17f896[_0x2f71('0x3b')],_0x17f896[_0x2f71('0x3a')]);};exports[_0x2f71('0x3c')]=function(_0x5615db,_0x67597c,_0xf52fe5){_0x5615db[_0x2f71('0x3d')]=_0x67597c;_0x5615db[_0x2f71('0x3e')]=_0xf52fe5;};exports['logCustomer']=function(_0x3d4acd,_0x56193c,_0x54ebac){var _0x1bb753=moment()[_0x2f71('0x11')]('YYYY-MM-DD\x20HH:mm:ss');_0x3d4acd[_0x2f71('0x37')]=_0x56193c;_0x3d4acd[_0x2f71('0x38')]=_0x54ebac;_0x3d4acd[_0x2f71('0x3b')]=_0x3d4acd[_0x2f71('0x3b')]?_0x3d4acd[_0x2f71('0x3b')]:_0x1bb753;_0x3d4acd['endtime']=_0x3d4acd['endtime']?_0x3d4acd[_0x2f71('0x3f')]:_0x1bb753;_0x3d4acd[_0x2f71('0x40')]=getSeconds(_0x3d4acd[_0x2f71('0x3b')]||0x0,_0x3d4acd[_0x2f71('0x3a')]||0x0);_0x3d4acd[_0x2f71('0x41')]=_0x3d4acd[_0x2f71('0x42')]?getSeconds(_0x3d4acd[_0x2f71('0x3f')],_0x3d4acd[_0x2f71('0x42')]):0x0;};exports['isFailure']=function(_0x3eb7b0){return _0x3eb7b0===_0x2f71('0x43');};exports[_0x2f71('0x44')]=function(_0x433b49,_0x46aa99,_0x3624e7,_0x4e266f,_0x2126f7){var _0xcb160e=_0x4e266f?'RECALL':_0x433b49[_0x2f71('0x19')];_0xcb160e=_0x2126f7?_0x2f71('0x45'):_0xcb160e;return{'actionid':_0x433b49[_0x2f71('0x46')],'action':_0x2f71('0x47'),'channel':_0x433b49[_0x2f71('0x48')],'callerid':util[_0x2f71('0x11')](_0x2f71('0x12'),_0xcb160e,_0x433b49[_0x2f71('0x1a')]),'Exten':_0x2f71('0x27'),'Context':_0x2f71('0x49'),'Priority':'1','variable':_0x3624e7,'timeout':(_0x46aa99[_0x2f71('0x4a')]||0x1e)*0x3e8,'async':!![],'channelid':_0x433b49[_0x2f71('0x46')]};};exports[_0x2f71('0x4b')]=function(_0x54823e){return _0x54823e[_0x2f71('0x4c')]+_0x54823e[_0x2f71('0x4d')]+_0x54823e['countnoanswerretry'];};exports[_0x2f71('0x4e')]=function(_0x3cbe30){var _0x344652=_[_0x2f71('0x4f')](_0x3cbe30);_0x344652[_0x2f71('0x37')]=0xf;_0x344652[_0x2f71('0x38')]=_0x2f71('0x50');return _0x344652;};exports[_0x2f71('0x51')]=function(_0x2ce83f,_0x1a86c8,_0x3bfd13){var _0x5f0467={};_0x5f0467[_0x1a86c8]=_0x2ce83f[_0x1a86c8];_0x5f0467['active']=![];_0x5f0467[_0x2f71('0x52')]=moment()[_0x2f71('0x53')](_0x3bfd13,'minutes')[_0x2f71('0x11')](_0x2f71('0x36'));_0x5f0467[_0x2f71('0x1b')]=_0x2ce83f[_0x2f71('0x1b')];_0x5f0467[_0x2f71('0x54')]=_0x2ce83f[_0x2f71('0x54')];_0x5f0467[_0x2f71('0x55')]=_0x2ce83f[_0x2f71('0x55')]||undefined;return _0x5f0467;};exports[_0x2f71('0x56')]=function(_0x26a627,_0x322440){if(!_['isNil'](_0x26a627)){if(_0x26a627[_0x2f71('0x57')]>0x0){_0x26a627[_0x2f71('0x57')]-=0x1;}else{logger[_0x2f71('0x8')](_0x322440,_0x2f71('0x58'));}}else{logger[_0x2f71('0x8')](_0x322440,_0x2f71('0x59'));}};exports[_0x2f71('0x5a')]=function(_0x568b30){if(_0x568b30<=0x0){return!![];}return![];};exports[_0x2f71('0x5b')]=function(_0x39a968,_0x34551c){_0x39a968[_0x2f71('0x5c')]=_0x34551c;_0x39a968['name']=_0x39a968['queue'];_0x39a968[_0x2f71('0x5d')]=_0x39a968['channelAgent'];return _0x39a968;};exports[_0x2f71('0x5e')]=function(_0x3f64a7){var _0x283273={};_0x283273['queue']=_0x3f64a7[_0x2f71('0x5f')];_0x283273[_0x2f71('0x5d')]=_0x3f64a7[_0x2f71('0x48')];_0x283273[_0x2f71('0x46')]=_0x3f64a7[_0x2f71('0x46')];return _0x283273;};exports[_0x2f71('0x60')]=function(_0x123d34){var _0x2c668c=[];for(var _0x3395ef in _0x123d34){if(_0x123d34[_0x2f71('0x29')](_0x3395ef)){if(!_['isNil'](_0x123d34[_0x3395ef])&&_0x123d34[_0x3395ef]['state']==='not_inuse'&&_0x123d34[_0x3395ef][_0x2f71('0x61')]===_0x2f71('0x62')){_0x2c668c['push'](_0x123d34[_0x3395ef]['id']);}}}return _0x2c668c;};exports[_0x2f71('0x63')]=function(_0x1827cb){var _0x2f37fb=moment()[_0x2f71('0x6')](0x0);var _0x273874=moment(_0x1827cb)[_0x2f71('0x6')](0x0);return _0x2f37fb[_0x2f71('0x64')](_0x273874,_0x2f71('0x65'));};exports['createBody']=function(_0x56a127){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x56a127[_0x2f71('0x1b')],'ListId':_0x56a127['ListId'],'VoiceQueueId':_0x56a127[_0x2f71('0x55')]||undefined,'CampaignId':_0x56a127[_0x2f71('0x66')]||undefined};};exports['filterKey']=function(_0x271fc9){if(_0x271fc9===_0x2f71('0x46')||_0x271fc9===_0x2f71('0x67')||_0x271fc9==='queue'||_0x271fc9==='type'||_0x271fc9===_0x2f71('0x68')||_0x271fc9==='dialAnswer'||_0x271fc9===_0x2f71('0x3d')||_0x271fc9===_0x2f71('0x48')||_0x271fc9===_0x2f71('0x19')||_0x271fc9===_0x2f71('0x69')||_0x271fc9===_0x2f71('0x1a')||_0x271fc9===_0x2f71('0x52')||_0x271fc9===_0x2f71('0x4c')||_0x271fc9==='countcongestionretry'||_0x271fc9==='countnoanswerretry'||_0x271fc9===_0x2f71('0x6a')||_0x271fc9===_0x2f71('0x6b')||_0x271fc9===_0x2f71('0x6c')||_0x271fc9===_0x2f71('0x6d')||_0x271fc9===_0x2f71('0x6e')||_0x271fc9==='ContactId'||_0x271fc9==='ListId'||_0x271fc9==='UserId'||_0x271fc9===_0x2f71('0x55')||_0x271fc9===_0x2f71('0x6f')||_0x271fc9===_0x2f71('0x70')||_0x271fc9==='xmd-queue'||_0x271fc9===_0x2f71('0x71')||_0x271fc9===_0x2f71('0x72')||_0x271fc9==='xmd-dialurl'||_0x271fc9===_0x2f71('0x73')||_0x271fc9===_0x2f71('0x74')||_0x271fc9===_0x2f71('0x75')||_0x271fc9==='xmd-dialchannel'||_0x271fc9===_0x2f71('0x76')||_0x271fc9===_0x2f71('0x77')||_0x271fc9==='xmd-callerid'||_0x271fc9==='xmd-agiafter'||_0x271fc9==='xmd-agi'||_0x271fc9===_0x2f71('0x78')||_0x271fc9===_0x2f71('0x79')||_0x271fc9==='rtpaudioqosjitter'||_0x271fc9===_0x2f71('0x7a')||_0x271fc9===_0x2f71('0x7b')||_0x271fc9===_0x2f71('0x7c')||_0x271fc9==='rtpaudioqosrtt'||_0x271fc9===_0x2f71('0x7d')||_0x271fc9===_0x2f71('0x78')||_0x271fc9===_0x2f71('0x79')||_0x271fc9==='rtpaudioqosjitter'||_0x271fc9===_0x2f71('0x7a')||_0x271fc9==='rtpaudioqosloss'||_0x271fc9===_0x2f71('0x7c')||_0x271fc9==='rtpaudioqosrtt'||_0x271fc9===_0x2f71('0x7d')||_0x271fc9===_0x2f71('0x7e')||_0x271fc9==='bridgepvtcallid'||_0x271fc9===_0x2f71('0x37')||_0x271fc9===_0x2f71('0x38')){return![];}return!![];};exports[_0x2f71('0x7f')]=function(_0xdb1e63,_0x2a1c90){var _0x2b6e8b,_0x8f9049,_0x5def77;if(_0x2a1c90<=0x0){_0x2a1c90=0x1;}_0x2b6e8b=new RegExp('\x5cw{0,'+_0x2a1c90+'}$');_0x8f9049=Math[_0x2f71('0x80')](0xa,_0x2a1c90-0x1);_0x5def77=Math[_0x2f71('0x80')](0xa,_0x2a1c90)-0x1;return util['format']('%s',_['replace'](_0xdb1e63,_0x2b6e8b,_['random'](_0x8f9049,_0x5def77)));};exports['extractCalleridName']=function(_0x5cc964){var _0x5557ca=_0x5cc964[_0x2f71('0x81')](/"(.*?)"/);return _0x5557ca?_0x5557ca[0x1]:_0x5cc964;};exports['extractCalleridNumber']=function(_0x848935){var _0x21e822=_0x848935['match'](/<(.*?)>/);return _0x21e822?_0x21e822[0x1]:_0x848935;}; \ No newline at end of file +var _0x6697=['logLookAgent','UserId','logCustomer','talktime','answertime','isFailure','Failure','variablesAction','RECALL','BOOKED','originate','channelAgent','timeout','uniqueid','totalGlobal','countbusyretry','countcongestionretry','cloneAction','Global','scheduledAt','active','scheduledat','add','minutes','ListId','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','name','queue','interface','buildAcw','agentReadyId','status','reachable','push','getDiff','createBody','CampaignId','filterKey','type','dialAnswer','calleridname','countnoanswerretry','countglobal','callbackuniqueid','callbackat','sipcallid','xmd-voicequeueid','xmd-queue','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-agiafter','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqoslossbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridName','match','util','lodash','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','milliseconds','diff','seconds','loggerCatch','error','inspect','logger','info','loggerError','getCallerId','isUndefined','string','isEmpty','\x22%s\x22\x20<%s>','format','\x22\x22\x20<>','isActive','isNil','Queue','calleridnum','ContactId','VoiceQueueId','dialQueueProject2','U(xcally-mixmonitor-context)','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','xcally-motion-preview','monitor_format','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','%s%s','XMD-','toLowerVariables','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','responsetime','endtime','logAgent','ringtime','starttime'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x6697,0x1c3));var _0x7669=function(_0x2c7626,_0x6c430e){_0x2c7626=_0x2c7626-0x0;var _0x3a2add=_0x6697[_0x2c7626];return _0x3a2add;};'use strict';var util=require(_0x7669('0x0'));var _=require(_0x7669('0x1'));var moment=require(_0x7669('0x2'));var logger=require(_0x7669('0x3'))(_0x7669('0x4'));var ipAgi=process[_0x7669('0x5')][_0x7669('0x6')]||'127.0.0.1';function getSeconds(_0x110284,_0x168fac){var _0x1f3ea0=moment(_0x110284)[_0x7669('0x7')](0x0);var _0x40bccf=moment(_0x168fac)['milliseconds'](0x0);return _0x1f3ea0[_0x7669('0x8')](_0x40bccf,_0x7669('0x9'));}exports[_0x7669('0xa')]=function(_0x40a096){return function(_0x2721c1){logger[_0x7669('0xb')](_0x40a096,util[_0x7669('0xc')](_0x2721c1,{'showHidden':![],'depth':null}));};};exports[_0x7669('0xd')]=function(_0xb82cb4,_0x551ac8){logger[_0x7669('0xe')](_0xb82cb4,util[_0x7669('0xc')](_0x551ac8,{'showHidden':![],'depth':null}));};exports[_0x7669('0xf')]=function(_0x266c30,_0x5e4a55){logger[_0x7669('0xb')](_0x266c30,util[_0x7669('0xc')](_0x5e4a55,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x4f7c43){return function(_0x37c518){logger[_0x7669('0xe')](_0x4f7c43,util['inspect'](_0x37c518,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x40cd34,_0x59d82c,_0xfcc26c){return{'message':_0x40cd34,'unlock':_0x59d82c,'active':_0xfcc26c};};exports[_0x7669('0x10')]=function(_0x4848b2,_0x4c4524,_0x2cfb7b){if(!_[_0x7669('0x11')](_0x2cfb7b)&&_0x7669('0x12')===typeof _0x2cfb7b&&!_[_0x7669('0x13')](_0x2cfb7b)){if(!_['isUndefined'](_0x4c4524)&&'string'===typeof _0x4c4524&&!_[_0x7669('0x13')](_0x4c4524)){return util['format'](_0x7669('0x14'),_0x4c4524,_0x2cfb7b);}return util[_0x7669('0x15')](_0x7669('0x14'),_0x2cfb7b,_0x2cfb7b);}if(!_[_0x7669('0x11')](_0x4848b2)&&'string'===typeof _0x4848b2&&!_[_0x7669('0x13')](_0x4848b2)){return _0x4848b2;}return _0x7669('0x16');};exports[_0x7669('0x17')]=function(_0x10e4ca){if(_[_0x7669('0x18')](_0x10e4ca)){return![];}return _0x10e4ca;};exports['addVariables']=function(_0x31fcc6,_0x4c547e,_0x14c0e0,_0xd64177,_0x3f6f7a,_0x3ad0c8){var _0x393726={'XMD-QUEUE':_0x4c547e[_0x7669('0x19')]?_0x4c547e['Queue']['name']:'','XMD-CALLERID':_0xd64177,'XMD-CALLERID-PREVIEW':_0x3ad0c8?util[_0x7669('0x15')](_0x7669('0x14'),_0x3ad0c8['calleridname'],_0x3ad0c8[_0x7669('0x1a')]):_0xd64177,'XMD-DIALID':_0x3f6f7a,'XMD-CONTACTID':_0x4c547e[_0x7669('0x1b')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0xd64177,'XMD-VOICEQUEUEID':_0x4c547e[_0x7669('0x1c')],'XMD-DIALCHANNEL':_0x14c0e0,'XMD-DIALTIMEOUT':_0x31fcc6['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util[_0x7669('0x15')]('\x22rtTxX%s%s\x22',_0x31fcc6[_0x7669('0x1d')]?'g':'',_[_0x7669('0x13')](_0x31fcc6['monitor_format'])?'':_0x7669('0x1e')),'XMD-DIALURL':_0x31fcc6['dialPreviewUrl']||'','XMD-AGI':_0x31fcc6[_0x7669('0x1f')]?util[_0x7669('0x15')](_0x7669('0x20'),ipAgi,_0x31fcc6[_0x7669('0x1f')]):'NONE','XMD-AGIAFTER':_0x31fcc6[_0x7669('0x1d')]?util[_0x7669('0x15')](_0x7669('0x20'),ipAgi,_0x31fcc6[_0x7669('0x1d')]):_0x7669('0x21'),'XMD-ORIGINATECALLERIDNUM':_0x3ad0c8?_0x3ad0c8['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x3ad0c8?_0x3ad0c8['originatecalleridname']:'','XMD-DESTINATION':_0x7669('0x22')};if(!_[_0x7669('0x13')](_0x31fcc6['monitor_format'])){_0x393726[util[_0x7669('0x15')]('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x31fcc6[_0x7669('0x23')];_0x393726[util[_0x7669('0x15')]('%s',_0x7669('0x24'))]=_0x3f6f7a;}if(_0x4c547e&&_0x4c547e[_0x7669('0x25')]){for(var _0x23c3c4 in _0x4c547e['Contact']){if(_0x4c547e['Contact'][_0x7669('0x26')](_0x23c3c4)){if(!_[_0x7669('0x18')](_0x4c547e['Contact'][_0x23c3c4])&&_0x23c3c4!=='id'&&_0x23c3c4!==_0x7669('0x27')&&_0x23c3c4!==_0x7669('0x28')&&_0x23c3c4!=='updatedAt'){_0x393726[util[_0x7669('0x15')](_0x7669('0x29'),_0x7669('0x2a'),_['toUpper'](_0x23c3c4))]=_0x4c547e[_0x7669('0x25')][_0x23c3c4];}}}}return _0x393726;};exports[_0x7669('0x2b')]=function(_0x57df2d){var _0x5a4e28={};for(var _0x22db8a in _0x57df2d){if(_0x57df2d[_0x7669('0x26')](_0x22db8a)){_0x5a4e28[util['format']('%s',_['toLower'](_0x22db8a))]=_0x57df2d[_0x22db8a];}}return{'variables':_0x5a4e28};};exports[_0x7669('0x2c')]=function(_0x4a6585,_0x5dd29e){if(!_[_0x7669('0x18')](_0x4a6585)){if(_0x4a6585[_0x7669('0x26')](_0x7669('0x2d'))){if(_0x4a6585[_0x7669('0x2d')]>0x0){_0x4a6585['originated']-=0x1;}else{logger[_0x7669('0xb')](_0x7669('0x2e'),_0x5dd29e);}}}else{logger[_0x7669('0xb')](_0x7669('0x2f'),_0x5dd29e);}};exports['logBlacklist']=function(_0x48c753){var _0x3f262a=moment()[_0x7669('0x15')](_0x7669('0x30'));_0x48c753[_0x7669('0x31')]=0xd;_0x48c753[_0x7669('0x32')]=_0x7669('0x33');_0x48c753['starttime']=_0x3f262a;_0x48c753[_0x7669('0x34')]=_0x3f262a;_0x48c753[_0x7669('0x35')]=_0x3f262a;};exports[_0x7669('0x36')]=function(_0x160775,_0x57ab94,_0x407444){var _0x410f63=moment()[_0x7669('0x15')](_0x7669('0x30'));_0x160775[_0x7669('0x31')]=_0x57ab94;_0x160775[_0x7669('0x32')]=_0x407444;_0x160775[_0x7669('0x34')]=_0x410f63;_0x160775[_0x7669('0x37')]=getSeconds(_0x160775[_0x7669('0x34')],_0x160775[_0x7669('0x38')]);};exports[_0x7669('0x39')]=function(_0x3628ba,_0x4e224f,_0x58c709){_0x3628ba['membername']=_0x4e224f;_0x3628ba[_0x7669('0x3a')]=_0x58c709;};exports[_0x7669('0x3b')]=function(_0x7d35a2,_0x4f62f3,_0x272ad1){var _0x17bd47=moment()[_0x7669('0x15')](_0x7669('0x30'));_0x7d35a2['state']=_0x4f62f3;_0x7d35a2[_0x7669('0x32')]=_0x272ad1;_0x7d35a2[_0x7669('0x34')]=_0x7d35a2[_0x7669('0x34')]?_0x7d35a2[_0x7669('0x34')]:_0x17bd47;_0x7d35a2[_0x7669('0x35')]=_0x7d35a2[_0x7669('0x35')]?_0x7d35a2['endtime']:_0x17bd47;_0x7d35a2[_0x7669('0x37')]=getSeconds(_0x7d35a2[_0x7669('0x34')]||0x0,_0x7d35a2[_0x7669('0x38')]||0x0);_0x7d35a2[_0x7669('0x3c')]=_0x7d35a2[_0x7669('0x3d')]?getSeconds(_0x7d35a2[_0x7669('0x35')],_0x7d35a2[_0x7669('0x3d')]):0x0;};exports[_0x7669('0x3e')]=function(_0x591234){return _0x591234===_0x7669('0x3f');};exports[_0x7669('0x40')]=function(_0x4cdb51,_0x49ac8b,_0x109d69,_0x653823,_0x204509){var _0x443c64=_0x653823?_0x7669('0x41'):_0x4cdb51['calleridname'];_0x443c64=_0x204509?_0x7669('0x42'):_0x443c64;return{'actionid':_0x4cdb51['uniqueid'],'action':_0x7669('0x43'),'channel':_0x4cdb51[_0x7669('0x44')],'callerid':util[_0x7669('0x15')](_0x7669('0x14'),_0x443c64,_0x4cdb51[_0x7669('0x1a')]),'Exten':_0x7669('0x22'),'Context':'from-sip','Priority':'1','variable':_0x109d69,'timeout':(_0x49ac8b[_0x7669('0x45')]||0x1e)*0x3e8,'async':!![],'channelid':_0x4cdb51[_0x7669('0x46')]};};exports[_0x7669('0x47')]=function(_0x174fec){return _0x174fec[_0x7669('0x48')]+_0x174fec[_0x7669('0x49')]+_0x174fec['countnoanswerretry'];};exports[_0x7669('0x4a')]=function(_0x10bf62){var _0x6e189f=_['clone'](_0x10bf62);_0x6e189f['state']=0xf;_0x6e189f[_0x7669('0x32')]=_0x7669('0x4b');return _0x6e189f;};exports[_0x7669('0x4c')]=function(_0x714113,_0x3cbc0a,_0x3190e9){var _0x3004c6={};_0x3004c6[_0x3cbc0a]=_0x714113[_0x3cbc0a];_0x3004c6[_0x7669('0x4d')]=![];_0x3004c6[_0x7669('0x4e')]=moment()[_0x7669('0x4f')](_0x3190e9,_0x7669('0x50'))['format'](_0x7669('0x30'));_0x3004c6[_0x7669('0x1b')]=_0x714113[_0x7669('0x1b')];_0x3004c6[_0x7669('0x51')]=_0x714113['ListId'];_0x3004c6[_0x7669('0x1c')]=_0x714113[_0x7669('0x1c')]||undefined;return _0x3004c6;};exports['decrementTalkink']=function(_0x1f3d5e,_0x35055b){if(!_[_0x7669('0x18')](_0x1f3d5e)){if(_0x1f3d5e['pTalking']>0x0){_0x1f3d5e[_0x7669('0x52')]-=0x1;}else{logger['error'](_0x35055b,_0x7669('0x53'));}}else{logger[_0x7669('0xb')](_0x35055b,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports['IsNotLoggedIn']=function(_0x5d87c4){if(_0x5d87c4<=0x0){return!![];}return![];};exports['buildObj']=function(_0x5761e4,_0x3cad30){_0x5761e4['lastevent']=_0x3cad30;_0x5761e4[_0x7669('0x54')]=_0x5761e4[_0x7669('0x55')];_0x5761e4[_0x7669('0x56')]=_0x5761e4[_0x7669('0x44')];return _0x5761e4;};exports[_0x7669('0x57')]=function(_0x3fc1fb){var _0x9f0663={};_0x9f0663[_0x7669('0x55')]=_0x3fc1fb['queue'];_0x9f0663[_0x7669('0x56')]=_0x3fc1fb['channelAgent'];_0x9f0663[_0x7669('0x46')]=_0x3fc1fb[_0x7669('0x46')];return _0x9f0663;};exports[_0x7669('0x58')]=function(_0x5210d7){var _0x3e33c7=[];for(var _0x45560c in _0x5210d7){if(_0x5210d7[_0x7669('0x26')](_0x45560c)){if(!_[_0x7669('0x18')](_0x5210d7[_0x45560c])&&_0x5210d7[_0x45560c][_0x7669('0x31')]==='not_inuse'&&_0x5210d7[_0x45560c][_0x7669('0x59')]===_0x7669('0x5a')){_0x3e33c7[_0x7669('0x5b')](_0x5210d7[_0x45560c]['id']);}}}return _0x3e33c7;};exports[_0x7669('0x5c')]=function(_0xc092e4){var _0x72c105=moment()[_0x7669('0x7')](0x0);var _0x2effde=moment(_0xc092e4)[_0x7669('0x7')](0x0);return _0x72c105[_0x7669('0x8')](_0x2effde,'seconds');};exports[_0x7669('0x5d')]=function(_0x1ca591){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x1ca591['ContactId'],'ListId':_0x1ca591[_0x7669('0x51')],'VoiceQueueId':_0x1ca591[_0x7669('0x1c')]||undefined,'CampaignId':_0x1ca591[_0x7669('0x5e')]||undefined};};exports[_0x7669('0x5f')]=function(_0x23f3b8){if(_0x23f3b8===_0x7669('0x46')||_0x23f3b8==='idContact'||_0x23f3b8===_0x7669('0x55')||_0x23f3b8===_0x7669('0x60')||_0x23f3b8==='campaigntype'||_0x23f3b8===_0x7669('0x61')||_0x23f3b8==='membername'||_0x23f3b8===_0x7669('0x44')||_0x23f3b8===_0x7669('0x62')||_0x23f3b8===_0x7669('0x4d')||_0x23f3b8===_0x7669('0x1a')||_0x23f3b8===_0x7669('0x4e')||_0x23f3b8==='countbusyretry'||_0x23f3b8===_0x7669('0x49')||_0x23f3b8===_0x7669('0x63')||_0x23f3b8===_0x7669('0x64')||_0x23f3b8==='callback'||_0x23f3b8===_0x7669('0x65')||_0x23f3b8===_0x7669('0x66')||_0x23f3b8==='recallme'||_0x23f3b8===_0x7669('0x1b')||_0x23f3b8===_0x7669('0x51')||_0x23f3b8===_0x7669('0x3a')||_0x23f3b8===_0x7669('0x1c')||_0x23f3b8===_0x7669('0x67')||_0x23f3b8===_0x7669('0x68')||_0x23f3b8===_0x7669('0x69')||_0x23f3b8==='xmd-phone'||_0x23f3b8==='xmd-listid'||_0x23f3b8==='xmd-dialurl'||_0x23f3b8==='xmd-dialtimeout'||_0x23f3b8==='xmd-dialoptions'||_0x23f3b8===_0x7669('0x6a')||_0x23f3b8===_0x7669('0x6b')||_0x23f3b8===_0x7669('0x6c')||_0x23f3b8===_0x7669('0x6d')||_0x23f3b8==='xmd-callerid'||_0x23f3b8===_0x7669('0x6e')||_0x23f3b8==='xmd-agi'||_0x23f3b8==='rtpaudioqos'||_0x23f3b8===_0x7669('0x6f')||_0x23f3b8===_0x7669('0x70')||_0x23f3b8===_0x7669('0x71')||_0x23f3b8===_0x7669('0x72')||_0x23f3b8==='rtpaudioqoslossbridged'||_0x23f3b8===_0x7669('0x73')||_0x23f3b8===_0x7669('0x74')||_0x23f3b8==='rtpaudioqos'||_0x23f3b8===_0x7669('0x6f')||_0x23f3b8===_0x7669('0x70')||_0x23f3b8===_0x7669('0x71')||_0x23f3b8==='rtpaudioqosloss'||_0x23f3b8===_0x7669('0x75')||_0x23f3b8===_0x7669('0x73')||_0x23f3b8===_0x7669('0x74')||_0x23f3b8===_0x7669('0x76')||_0x23f3b8===_0x7669('0x77')||_0x23f3b8==='state'||_0x23f3b8===_0x7669('0x32')){return![];}return!![];};exports[_0x7669('0x78')]=function(_0x4df17d,_0x594ca5){var _0xccb36b,_0x4375c4,_0x240b12;if(_0x594ca5<=0x0){_0x594ca5=0x1;}_0xccb36b=new RegExp(_0x7669('0x79')+_0x594ca5+'}$');_0x4375c4=Math[_0x7669('0x7a')](0xa,_0x594ca5-0x1);_0x240b12=Math['pow'](0xa,_0x594ca5)-0x1;return util[_0x7669('0x15')]('%s',_[_0x7669('0x7b')](_0x4df17d,_0xccb36b,_[_0x7669('0x7c')](_0x4375c4,_0x240b12)));};exports[_0x7669('0x7d')]=function(_0x51d129){var _0x13af9a=_0x51d129[_0x7669('0x7e')](/"(.*?)"/);return _0x13af9a?_0x13af9a[0x1]:_0x51d129;};exports['extractCalleridNumber']=function(_0x4e0ad6){var _0xf50827=_0x4e0ad6['match'](/<(.*?)>/);return _0xf50827?_0xf50827[0x1]:_0x4e0ad6;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index ee8a0ed..9c28886 100644 --- a/server/services/ami/properties.js +++ b/server/services/ami/properties.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['number','boolean','queueremove','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','queueadd','string'];(function(_0x30036f,_0x11f581){var _0xc15db5=function(_0x5b0a40){while(--_0x5b0a40){_0x30036f['push'](_0x30036f['shift']());}};_0xc15db5(++_0x11f581);}(_0x5f2f,0x73));var _0xf5f2=function(_0xc844f8,_0x2f093a){_0xc844f8=_0xc844f8-0x0;var _0x10e0aa=_0x5f2f[_0xc844f8];return _0x10e0aa;};'use strict';exports[_0xf5f2('0x0')]={'queue':{'type':_0xf5f2('0x1'),'required':!![]},'interface':{'type':_0xf5f2('0x1'),'required':!![]},'membername':{'type':_0xf5f2('0x1'),'required':!![]},'penalty':{'type':_0xf5f2('0x2'),'required':![]},'paused':{'type':_0xf5f2('0x3'),'required':![]}};exports[_0xf5f2('0x4')]={'queue':{'type':_0xf5f2('0x1'),'required':!![]},'interface':{'type':'string','required':!![]}};exports['queuepause']={'interface':{'type':_0xf5f2('0x1'),'required':!![]},'paused':{'type':_0xf5f2('0x3')},'reason':{'type':_0xf5f2('0x1'),'required':![]}};exports[_0xf5f2('0x5')]={'module':{'type':_0xf5f2('0x1'),'required':![]}};exports[_0xf5f2('0x6')]={'uniqueid':{'type':'string','required':!![]}};exports[_0xf5f2('0x7')]={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]},'filename':{'type':_0xf5f2('0x1')},'format':{'type':'string'},'mixmonitorid':{'type':_0xf5f2('0x1')}};exports[_0xf5f2('0x8')]={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':'string'}}; \ No newline at end of file +var _0x5f2f=['number','boolean','queueremove','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','queueadd','string'];(function(_0x1d1d09,_0x504d77){var _0x8827e=function(_0x4f3128){while(--_0x4f3128){_0x1d1d09['push'](_0x1d1d09['shift']());}};_0x8827e(++_0x504d77);}(_0x5f2f,0x73));var _0xf5f2=function(_0x24eac6,_0x143987){_0x24eac6=_0x24eac6-0x0;var _0x4e0ce6=_0x5f2f[_0x24eac6];return _0x4e0ce6;};'use strict';exports[_0xf5f2('0x0')]={'queue':{'type':_0xf5f2('0x1'),'required':!![]},'interface':{'type':_0xf5f2('0x1'),'required':!![]},'membername':{'type':_0xf5f2('0x1'),'required':!![]},'penalty':{'type':_0xf5f2('0x2'),'required':![]},'paused':{'type':_0xf5f2('0x3'),'required':![]}};exports[_0xf5f2('0x4')]={'queue':{'type':_0xf5f2('0x1'),'required':!![]},'interface':{'type':'string','required':!![]}};exports['queuepause']={'interface':{'type':_0xf5f2('0x1'),'required':!![]},'paused':{'type':_0xf5f2('0x3')},'reason':{'type':_0xf5f2('0x1'),'required':![]}};exports[_0xf5f2('0x5')]={'module':{'type':_0xf5f2('0x1'),'required':![]}};exports[_0xf5f2('0x6')]={'uniqueid':{'type':'string','required':!![]}};exports[_0xf5f2('0x7')]={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]},'filename':{'type':_0xf5f2('0x1')},'format':{'type':'string'},'mixmonitorid':{'type':_0xf5f2('0x1')}};exports[_0xf5f2('0x8')]={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':'string'}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 674063c..fc431e3 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 _0x71a1=['format','SIP/%s','name','isNil','interface','total','answered','sumHoldTime','sumDuration','sumBillable','ivrTotalCallsDays','ivrAnswerCallsDay','isEmpty','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayCallersExit','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','length','initTelephones','isUndefined','initTrunks','initVoiceQueues','voiceQueues','initZendeskAccounts','zendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','freshdeskAccounts','initDeskAccounts','initServicenowAccounts','initDynamics365Accounts','initVoiceQueueHopperHistory','merge','groupBy','uniqueid','queuecallerexit','unmanaged','diff','queuecallerjoinAt','seconds','queuecallerexitAt','queuecallercompleteAt','duration','disposition','ANSWERED','billableseconds','initCampaigns','initVoiceExtensions','initCampaignHopperHistory','faxAccounts','exports','bluebird','util','lodash','../model/telephone','../model/trunk','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/deskAccount','../model/servicenowAccount','../model/dynamics365Account','../model/faxAccount','agents','telephones','trunks','triggers','campaigns','templates','outbound','voiceExtensions','channels','queueChannels','outboundChannels','timers','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','mapKeys','hasOwnProperty'];(function(_0x595504,_0x12c792){var _0x5981af=function(_0x2403dd){while(--_0x2403dd){_0x595504['push'](_0x595504['shift']());}};_0x5981af(++_0x12c792);}(_0x71a1,0x9c));var _0x171a=function(_0x2a4315,_0x35df7a){_0x2a4315=_0x2a4315-0x0;var _0x2fb185=_0x71a1[_0x2a4315];return _0x2fb185;};'use strict';var BPromise=require(_0x171a('0x0'));var util=require(_0x171a('0x1'));var _=require(_0x171a('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Telephone=require(_0x171a('0x3'));var Trunk=require(_0x171a('0x4'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require('../model/trigger');var Template=require(_0x171a('0x5'));var Campaign=require(_0x171a('0x6'));var VoiceExtension=require(_0x171a('0x7'));var ZendeskAccount=require(_0x171a('0x8'));var SalesforceAccount=require(_0x171a('0x9'));var FreshdeskAccount=require(_0x171a('0xa'));var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0x171a('0xb'));var VtigerAccount=require('../model/vtigerAccount');var ServicenowAccount=require(_0x171a('0xc'));var Dynamics365Account=require(_0x171a('0xd'));var FaxAccount=require(_0x171a('0xe'));var Realtime=function(){this[_0x171a('0xf')]={};this[_0x171a('0x10')]={};this[_0x171a('0x11')]={};this['voiceQueues']={};this[_0x171a('0x12')]={};this[_0x171a('0x13')]={};this[_0x171a('0x14')]={};this[_0x171a('0x15')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x171a('0x16')]={};this[_0x171a('0x17')]={};this[_0x171a('0x18')]={};this[_0x171a('0x19')]={};this[_0x171a('0x1a')]={};this['zendeskAccounts']={};this[_0x171a('0x1b')]={};this[_0x171a('0x1c')]={};this['freshdeskAccounts']={};this[_0x171a('0x1d')]={};this[_0x171a('0x1e')]={};this[_0x171a('0x1f')]={};this[_0x171a('0x20')]={};this[_0x171a('0x21')]={};this['faxAccounts']={};};function freeIsNotKey(_0x4cd416,_0x8d9f38,_0x122706){var _0x3c54ca=_[_0x171a('0x22')](_0x4cd416,function(_0x15dc06,_0x257043){return _0x15dc06[_0x122706];});for(var _0xa95ae in _0x8d9f38){if(_0x8d9f38[_0x171a('0x23')](_0xa95ae)){if(!_0x3c54ca[_0xa95ae]){delete _0x8d9f38[_0xa95ae];}}}}function freeIsNotKeySip(_0x2d32fa,_0x404a1c){var _0x1d819c=_[_0x171a('0x22')](_0x2d32fa,function(_0x35c526,_0x4019b1){return util[_0x171a('0x24')](_0x171a('0x25'),_0x35c526[_0x171a('0x26')]);});for(var _0xed7114 in _0x404a1c){if(_0x404a1c['hasOwnProperty'](_0xed7114)){if(!_0x1d819c[_0xed7114]){delete _0x404a1c[_0xed7114];}}}}function freeIsNotKeyAgent(_0x22195d,_0x372b4c){var _0x3bda1d=_[_0x171a('0x22')](_0x22195d,function(_0x38852b,_0x25a749){var _0x2d602d=_[_0x171a('0x27')](_0x38852b['interface'])?util['format']('SIP/%s',_0x38852b[_0x171a('0x26')]):_0x38852b[_0x171a('0x28')];return _0x2d602d;});for(var _0x51600b in _0x372b4c){if(_0x372b4c[_0x171a('0x23')](_0x51600b)){if(!_0x3bda1d[_0x51600b]){delete _0x372b4c[_0x51600b];}}}}function clearVoiceCallReports(_0x3b2959){_0x3b2959[_0x171a('0x29')]=0x0;_0x3b2959[_0x171a('0x2a')]=0x0;_0x3b2959[_0x171a('0x2b')]=0x0;_0x3b2959[_0x171a('0x2c')]=0x0;_0x3b2959[_0x171a('0x2d')]=0x0;}function clearCampaigns(_0x52846a){if(!_['isEmpty'](_0x52846a)){for(var _0x4b4616 in _0x52846a){if(_0x52846a[_0x171a('0x23')](_0x4b4616)){_0x52846a[_0x4b4616][_0x171a('0x2e')]=0x0;_0x52846a[_0x4b4616][_0x171a('0x2f')]=0x0;}}}}function clearVoiceQueues(_0x35a32d){if(!_[_0x171a('0x30')](_0x35a32d)){for(var _0x4a92ed in _0x35a32d){if(_0x35a32d['hasOwnProperty'](_0x4a92ed)){_0x35a32d[_0x4a92ed]['total']=0x0;_0x35a32d[_0x4a92ed][_0x171a('0x2a')]=0x0;_0x35a32d[_0x4a92ed]['unmanaged']=0x0;_0x35a32d[_0x4a92ed]['abandoned']=0x0;_0x35a32d[_0x4a92ed][_0x171a('0x2b')]=0x0;_0x35a32d[_0x4a92ed][_0x171a('0x2c')]=0x0;_0x35a32d[_0x4a92ed][_0x171a('0x2d')]=0x0;_0x35a32d[_0x4a92ed][_0x171a('0x31')]=0x0;_0x35a32d[_0x4a92ed][_0x171a('0x32')]=0x0;_0x35a32d[_0x4a92ed][_0x171a('0x33')]=0x0;_0x35a32d[_0x4a92ed][_0x171a('0x34')]=0x0;_0x35a32d[_0x4a92ed]['outboundNoSuchCallsDay']=0x0;_0x35a32d[_0x4a92ed][_0x171a('0x35')]=0x0;_0x35a32d[_0x4a92ed]['outboundDropCallsDayTimeout']=0x0;_0x35a32d[_0x4a92ed][_0x171a('0x36')]=0x0;_0x35a32d[_0x4a92ed]['outboundBlacklistCallsDay']=0x0;_0x35a32d[_0x4a92ed]['outboundOriginateFailureCallsDay']=0x0;_0x35a32d[_0x4a92ed][_0x171a('0x37')]=0x0;_0x35a32d[_0x4a92ed][_0x171a('0x38')]=0x0;_0x35a32d[_0x4a92ed][_0x171a('0x31')]=0x0;_0x35a32d[_0x4a92ed][_0x171a('0x39')]=0x0;_0x35a32d[_0x4a92ed][_0x171a('0x3a')]=!![];}}}}Realtime[_0x171a('0x3b')][_0x171a('0x3c')]=function(_0x1d4b46,_0x4f159b){for(var _0x521a6d in _0x4f159b){if(_0x1d4b46[_0x171a('0x23')](_0x521a6d)){_0x1d4b46[_0x521a6d]=_0x4f159b[_0x521a6d];}}};Realtime[_0x171a('0x3b')][_0x171a('0x3d')]=function(){var _0x274740=this;return function(_0xbd50be){if(_0xbd50be){freeIsNotKeyAgent(_0xbd50be,_0x274740[_0x171a('0xf')]);for(var _0x171cc0=0x0,_0x5ad0fb={},_0x48f0d7={};_0x171cc0<_0xbd50be[_0x171a('0x3e')];_0x171cc0+=0x1){_0x5ad0fb=_0xbd50be[_0x171cc0];var _0x39ba0f=_[_0x171a('0x27')](_0x5ad0fb[_0x171a('0x28')])?util[_0x171a('0x24')](_0x171a('0x25'),_0x5ad0fb[_0x171a('0x26')]):_0x5ad0fb[_0x171a('0x28')];if(_['isUndefined'](_0x274740[_0x171a('0xf')][_0x39ba0f])){_0x274740[_0x171a('0xf')][_0x39ba0f]=new Agent(_0x5ad0fb);}else{_0x274740[_0x171a('0x3c')](_0x274740[_0x171a('0xf')][_0x39ba0f],_0x5ad0fb);}}}return _0x274740[_0x171a('0xf')];};};Realtime[_0x171a('0x3b')][_0x171a('0x3f')]=function(){var _0x28a007=this;return function(_0x2f8e9f){if(_0x2f8e9f){freeIsNotKeySip(_0x2f8e9f,_0x28a007[_0x171a('0x10')]);for(var _0xa2b573=0x0,_0x5ab2c9={},_0x549d91={};_0xa2b573<_0x2f8e9f[_0x171a('0x3e')];_0xa2b573+=0x1){_0x5ab2c9=_0x2f8e9f[_0xa2b573];if(_[_0x171a('0x40')](_0x28a007[_0x171a('0x10')][util['format']('SIP/%s',_0x5ab2c9['name'])])){_0x28a007['telephones'][util[_0x171a('0x24')](_0x171a('0x25'),_0x5ab2c9[_0x171a('0x26')])]=new Telephone(_0x5ab2c9);}else{_0x28a007['mergeFromDatabase'](_0x28a007['telephones'][util[_0x171a('0x24')](_0x171a('0x25'),_0x5ab2c9[_0x171a('0x26')])],_0x5ab2c9);}}}return _0x28a007[_0x171a('0x10')];};};Realtime['prototype'][_0x171a('0x41')]=function(){var _0xa63a72=this;return function(_0x359297){if(_0x359297){freeIsNotKeySip(_0x359297,_0xa63a72[_0x171a('0x11')]);for(var _0x276fe7=0x0,_0x283108={},_0x53e55b={};_0x276fe7<_0x359297[_0x171a('0x3e')];_0x276fe7+=0x1){_0x283108=_0x359297[_0x276fe7];if(_['isUndefined'](_0xa63a72['trunks'][util['format'](_0x171a('0x25'),_0x283108[_0x171a('0x26')])])){_0xa63a72['trunks'][util['format'](_0x171a('0x25'),_0x283108[_0x171a('0x26')])]=new Trunk(_0x283108);}else{_0xa63a72[_0x171a('0x3c')](_0xa63a72['trunks'][util[_0x171a('0x24')](_0x171a('0x25'),_0x283108[_0x171a('0x26')])],_0x283108);}}}return _0xa63a72['trunks'];};};Realtime[_0x171a('0x3b')][_0x171a('0x42')]=function(){var _0x3aa7b8=this;return function(_0x586e49){if(_0x586e49){freeIsNotKey(_0x586e49,_0x3aa7b8['voiceQueues'],_0x171a('0x26'));for(var _0x1e611d=0x0,_0xf72554={},_0x34df32={};_0x1e611d<_0x586e49['length'];_0x1e611d+=0x1){_0xf72554=_0x586e49[_0x1e611d];if(_[_0x171a('0x40')](_0x3aa7b8[_0x171a('0x43')][_0xf72554['name']])){_0x3aa7b8['voiceQueues'][_0xf72554[_0x171a('0x26')]]=new VoiceQueue(_0xf72554);}else{_0x3aa7b8[_0x171a('0x3c')](_0x3aa7b8['voiceQueues'][_0xf72554[_0x171a('0x26')]],_0xf72554);}}}return _0x3aa7b8[_0x171a('0x43')];};};Realtime[_0x171a('0x3b')]['initTriggers']=function(){var _0x37e343=this;return function(_0x2ba660){if(_0x2ba660){freeIsNotKey(_0x2ba660,_0x37e343['triggers'],'id');for(var _0x22b287=0x0,_0x3dcefa={},_0x10cad7={};_0x22b287<_0x2ba660[_0x171a('0x3e')];_0x22b287+=0x1){_0x3dcefa=_0x2ba660[_0x22b287];if(_[_0x171a('0x40')](_0x37e343[_0x171a('0x12')][_0x3dcefa['id']])){_0x37e343[_0x171a('0x12')][_0x3dcefa['id']]=new Trigger(_0x3dcefa);}else{_0x37e343['mergeFromDatabase'](_0x37e343[_0x171a('0x12')][_0x3dcefa['id']],_0x3dcefa);}}}return _0x37e343['triggers'];};};Realtime[_0x171a('0x3b')]['initTemplates']=function(){var _0x1a18e4=this;return function(_0x456baa){if(_0x456baa){freeIsNotKey(_0x456baa,_0x1a18e4['templates'],'id');for(var _0x3735fc=0x0,_0x12cbd8={},_0x155479={};_0x3735fc<_0x456baa[_0x171a('0x3e')];_0x3735fc+=0x1){_0x12cbd8=_0x456baa[_0x3735fc];if(_[_0x171a('0x40')](_0x1a18e4[_0x171a('0x14')][_0x12cbd8['id']])){_0x1a18e4[_0x171a('0x14')][_0x12cbd8['id']]=new Template(_0x12cbd8);}else{_0x1a18e4[_0x171a('0x3c')](_0x1a18e4['templates'][_0x12cbd8['id']],_0x12cbd8);}}}return _0x1a18e4['templates'];};};Realtime[_0x171a('0x3b')][_0x171a('0x44')]=function(){var _0x14ea63=this;return function(_0x11b257){if(_0x11b257){freeIsNotKey(_0x11b257,_0x14ea63[_0x171a('0x45')],'id');for(var _0x304b58=0x0,_0x410007={},_0x42ad54={};_0x304b58<_0x11b257['length'];_0x304b58+=0x1){_0x410007=_0x11b257[_0x304b58];if(_[_0x171a('0x40')](_0x14ea63['zendeskAccounts'][_0x410007['id']])){_0x14ea63['zendeskAccounts'][_0x410007['id']]=new ZendeskAccount(_0x410007);}else{_0x14ea63[_0x171a('0x3c')](_0x14ea63['zendeskAccounts'][_0x410007['id']],_0x410007);}}}return _0x14ea63[_0x171a('0x45')];};};Realtime[_0x171a('0x3b')][_0x171a('0x46')]=function(){var _0x3f8a89=this;return function(_0x1b9477){if(_0x1b9477){freeIsNotKey(_0x1b9477,_0x3f8a89['salesforceAccounts'],'id');for(var _0x7afb87=0x0,_0x41c70a={},_0x5186cd={};_0x7afb87<_0x1b9477[_0x171a('0x3e')];_0x7afb87+=0x1){_0x41c70a=_0x1b9477[_0x7afb87];if(_[_0x171a('0x40')](_0x3f8a89['salesforceAccounts'][_0x41c70a['id']])){_0x3f8a89[_0x171a('0x1b')][_0x41c70a['id']]=new SalesforceAccount(_0x41c70a);}else{_0x3f8a89[_0x171a('0x3c')](_0x3f8a89[_0x171a('0x1b')][_0x41c70a['id']],_0x41c70a);}}}return _0x3f8a89[_0x171a('0x1b')];};};Realtime[_0x171a('0x3b')][_0x171a('0x47')]=function(){var _0x656940=this;return function(_0x3ad901){if(_0x3ad901){freeIsNotKey(_0x3ad901,_0x656940['freshdeskAccounts'],'id');for(var _0x2ae20c=0x0,_0x467d26={},_0x3a8014={};_0x2ae20c<_0x3ad901[_0x171a('0x3e')];_0x2ae20c+=0x1){_0x467d26=_0x3ad901[_0x2ae20c];if(_[_0x171a('0x40')](_0x656940[_0x171a('0x48')][_0x467d26['id']])){_0x656940[_0x171a('0x48')][_0x467d26['id']]=new FreshdeskAccount(_0x467d26);}else{_0x656940[_0x171a('0x3c')](_0x656940[_0x171a('0x48')][_0x467d26['id']],_0x467d26);}}}return _0x656940[_0x171a('0x48')];};};Realtime[_0x171a('0x3b')]['initZohoAccounts']=function(){var _0x2c135f=this;return function(_0xbdfe25){if(_0xbdfe25){freeIsNotKey(_0xbdfe25,_0x2c135f[_0x171a('0x1d')],'id');for(var _0x821e01=0x0,_0x334d47={},_0x12b210={};_0x821e01<_0xbdfe25[_0x171a('0x3e')];_0x821e01+=0x1){_0x334d47=_0xbdfe25[_0x821e01];if(_[_0x171a('0x40')](_0x2c135f[_0x171a('0x1d')][_0x334d47['id']])){_0x2c135f[_0x171a('0x1d')][_0x334d47['id']]=new ZohoAccount(_0x334d47);}else{_0x2c135f[_0x171a('0x3c')](_0x2c135f[_0x171a('0x1d')][_0x334d47['id']],_0x334d47);}}}return _0x2c135f[_0x171a('0x1d')];};};Realtime['prototype'][_0x171a('0x49')]=function(){var _0x3fdb92=this;return function(_0x2230d2){if(_0x2230d2){freeIsNotKey(_0x2230d2,_0x3fdb92[_0x171a('0x1e')],'id');for(var _0x5e3b63=0x0,_0x2035c0={},_0x5de7d7={};_0x5e3b63<_0x2230d2[_0x171a('0x3e')];_0x5e3b63+=0x1){_0x2035c0=_0x2230d2[_0x5e3b63];if(_[_0x171a('0x40')](_0x3fdb92['deskAccounts'][_0x2035c0['id']])){_0x3fdb92[_0x171a('0x1e')][_0x2035c0['id']]=new DeskAccount(_0x2035c0);}else{_0x3fdb92[_0x171a('0x3c')](_0x3fdb92[_0x171a('0x1e')][_0x2035c0['id']],_0x2035c0);}}}return _0x3fdb92['deskAccounts'];};};Realtime[_0x171a('0x3b')]['initSugarcrmAccounts']=function(){var _0x37fa09=this;return function(_0x2433f7){if(_0x2433f7){freeIsNotKey(_0x2433f7,_0x37fa09['sugarcrmAccounts'],'id');for(var _0x54ef0e=0x0,_0x2acee8={},_0x47963d={};_0x54ef0e<_0x2433f7[_0x171a('0x3e')];_0x54ef0e+=0x1){_0x2acee8=_0x2433f7[_0x54ef0e];if(_[_0x171a('0x40')](_0x37fa09[_0x171a('0x1c')][_0x2acee8['id']])){_0x37fa09[_0x171a('0x1c')][_0x2acee8['id']]=new SugarcrmAccount(_0x2acee8);}else{_0x37fa09[_0x171a('0x3c')](_0x37fa09[_0x171a('0x1c')][_0x2acee8['id']],_0x2acee8);}}}return _0x37fa09[_0x171a('0x1c')];};};Realtime[_0x171a('0x3b')]['initVtigerAccounts']=function(){var _0x42d1bc=this;return function(_0x3a0ff5){if(_0x3a0ff5){freeIsNotKey(_0x3a0ff5,_0x42d1bc[_0x171a('0x1f')],'id');for(var _0x3b9d1e=0x0,_0x38ab80={},_0x25870e={};_0x3b9d1e<_0x3a0ff5[_0x171a('0x3e')];_0x3b9d1e+=0x1){_0x38ab80=_0x3a0ff5[_0x3b9d1e];if(_[_0x171a('0x40')](_0x42d1bc[_0x171a('0x1f')][_0x38ab80['id']])){_0x42d1bc[_0x171a('0x1f')][_0x38ab80['id']]=new VtigerAccount(_0x38ab80);}else{_0x42d1bc[_0x171a('0x3c')](_0x42d1bc[_0x171a('0x1f')][_0x38ab80['id']],_0x38ab80);}}}return _0x42d1bc[_0x171a('0x1f')];};};Realtime[_0x171a('0x3b')][_0x171a('0x4a')]=function(){var _0x490ec5=this;return function(_0x39412e){if(_0x39412e){freeIsNotKey(_0x39412e,_0x490ec5[_0x171a('0x20')],'id');for(var _0x246b14=0x0,_0x47df6d={},_0x13484f={};_0x246b14<_0x39412e[_0x171a('0x3e')];_0x246b14+=0x1){_0x47df6d=_0x39412e[_0x246b14];if(_['isUndefined'](_0x490ec5[_0x171a('0x20')][_0x47df6d['id']])){_0x490ec5[_0x171a('0x20')][_0x47df6d['id']]=new ServicenowAccount(_0x47df6d);}else{_0x490ec5[_0x171a('0x3c')](_0x490ec5['servicenowAccounts'][_0x47df6d['id']],_0x47df6d);}}}return _0x490ec5[_0x171a('0x20')];};};Realtime[_0x171a('0x3b')][_0x171a('0x4b')]=function(){var _0x299ae8=this;return function(_0x351fb9){if(_0x351fb9){freeIsNotKey(_0x351fb9,_0x299ae8['dynamics365Accounts'],'id');for(var _0x2d2a1=0x0,_0x24a002={},_0x23e8f1={};_0x2d2a1<_0x351fb9[_0x171a('0x3e')];_0x2d2a1+=0x1){_0x24a002=_0x351fb9[_0x2d2a1];if(_[_0x171a('0x40')](_0x299ae8[_0x171a('0x21')][_0x24a002['id']])){_0x299ae8[_0x171a('0x21')][_0x24a002['id']]=new Dynamics365Account(_0x24a002);}else{_0x299ae8[_0x171a('0x3c')](_0x299ae8[_0x171a('0x21')][_0x24a002['id']],_0x24a002);}}}return _0x299ae8['dynamics365Accounts'];};};Realtime['prototype'][_0x171a('0x4c')]=function(){var _0x363e43=this;return function(_0x4d08fa){for(var _0x41b718=0x0;_0x41b718<_0x4d08fa[_0x171a('0x3e')];_0x41b718+=0x1){_[_0x171a('0x4d')](_0x363e43[_0x171a('0x43')][_0x4d08fa[_0x41b718][_0x171a('0x26')]],_0x4d08fa[_0x41b718]);}return _0x363e43[_0x171a('0x43')];};};Realtime[_0x171a('0x3b')]['initVoiceQueueReports']=function(){var _0x9cde8c=this;return function(_0x936981){clearVoiceQueues(_0x9cde8c['voiceQueues']);if(_0x936981){_0x936981=_[_0x171a('0x4e')](_0x936981,_0x171a('0x4f'));for(var _0x7619f1 in _0x936981){if(_0x936981[_0x171a('0x23')](_0x7619f1)){var _0x482c50={};for(var _0x533505=0x0;_0x533505<_0x936981[_0x7619f1][_0x171a('0x3e')];_0x533505+=0x1){var _0x2fe6d1=_0x936981[_0x7619f1][_0x533505]['queue'];if(_0x9cde8c[_0x171a('0x43')][_0x2fe6d1]){if(_0x936981[_0x7619f1][_0x533505][_0x171a('0x50')]){_0x9cde8c[_0x171a('0x43')][_0x2fe6d1][_0x171a('0x51')]+=0x1;}if(_0x936981[_0x7619f1][_0x533505]['queuecallerabandon']){_0x9cde8c['voiceQueues'][_0x2fe6d1]['abandoned']+=0x1;}_0x9cde8c[_0x171a('0x43')][_0x2fe6d1][_0x171a('0x2b')]+=moment(_0x936981[_0x7619f1][_0x533505]['queuecallerleaveAt'])[_0x171a('0x52')](moment(_0x936981[_0x7619f1][_0x533505][_0x171a('0x53')]),_0x171a('0x54'))||0x0;if(_0x533505===_0x936981[_0x7619f1][_0x171a('0x3e')]-0x1){_0x9cde8c[_0x171a('0x43')][_0x2fe6d1]['sumDuration']+=moment(_0x936981[_0x7619f1][_0x533505]['queuecallercompleteAt']||_0x936981[_0x7619f1][_0x533505]['queuecallerabandonAt']||_0x936981[_0x7619f1][_0x533505][_0x171a('0x55')])[_0x171a('0x52')](moment(_0x936981[_0x7619f1][_0x533505]['queuecallerjoinAt']),_0x171a('0x54'))||0x0;_0x9cde8c[_0x171a('0x43')][_0x2fe6d1]['total']+=0x1;if(_0x936981[_0x7619f1][_0x533505]['queuecallercomplete']){_0x9cde8c[_0x171a('0x43')][_0x2fe6d1]['answered']+=0x1;_0x9cde8c[_0x171a('0x43')][_0x2fe6d1][_0x171a('0x2d')]+=moment(_0x936981[_0x7619f1][_0x533505][_0x171a('0x56')])['diff'](moment(_0x936981[_0x7619f1][_0x533505]['queuecallerleaveAt']),_0x171a('0x54'))||0x0;}}else{_0x9cde8c[_0x171a('0x43')][_0x2fe6d1][_0x171a('0x2c')]+=_0x9cde8c['voiceQueues'][_0x2fe6d1][_0x171a('0x2b')]||0x0;}}}}}}return _0x9cde8c[_0x171a('0x43')];};};Realtime['prototype']['initVoiceCallReports']=function(){var _0x264be4=this;return function(_0x388959){clearVoiceCallReports(_0x264be4[_0x171a('0x15')]);if(_0x388959){for(var _0x3f7688=0x0;_0x3f7688<_0x388959[_0x171a('0x3e')];_0x3f7688+=0x1){_0x264be4['outbound'][_0x171a('0x29')]+=0x1;_0x264be4[_0x171a('0x15')]['sumDuration']+=_0x388959[_0x3f7688][_0x171a('0x57')];if(_0x388959[_0x3f7688][_0x171a('0x58')]===_0x171a('0x59')){_0x264be4['outbound'][_0x171a('0x2a')]+=0x1;_0x264be4['outbound']['sumHoldTime']+=_0x388959[_0x3f7688][_0x171a('0x57')]-_0x388959[_0x3f7688][_0x171a('0x5a')]||0x0;_0x264be4[_0x171a('0x15')][_0x171a('0x2d')]+=_0x388959[_0x3f7688][_0x171a('0x5a')];}}}return _0x264be4[_0x171a('0x15')];};};Realtime['prototype'][_0x171a('0x5b')]=function(){var _0x1e3a1e=this;return function(_0x59dfd9){if(_0x59dfd9){freeIsNotKey(_0x59dfd9,_0x1e3a1e['campaigns'],_0x171a('0x26'));for(var _0x2f7309=0x0,_0x3302cd={};_0x2f7309<_0x59dfd9['length'];_0x2f7309+=0x1){_0x3302cd=_0x59dfd9[_0x2f7309];if(_['isUndefined'](_0x1e3a1e[_0x171a('0x13')][_0x3302cd[_0x171a('0x26')]])){_0x1e3a1e['campaigns'][_0x3302cd[_0x171a('0x26')]]=new Campaign(_0x3302cd);}else{_0x1e3a1e[_0x171a('0x3c')](_0x1e3a1e['campaigns'][_0x3302cd['name']],_0x3302cd);}}}return _0x1e3a1e[_0x171a('0x13')];};};Realtime['prototype'][_0x171a('0x5c')]=function(){var _0x2b239a=this;return function(_0x863c7a){if(_0x863c7a){freeIsNotKey(_0x863c7a,_0x2b239a[_0x171a('0x16')],'id');for(var _0x13d470=0x0,_0x3a0267={};_0x13d470<_0x863c7a[_0x171a('0x3e')];_0x13d470+=0x1){_0x3a0267=_0x863c7a[_0x13d470];if(_[_0x171a('0x40')](_0x2b239a['voiceExtensions'][_0x3a0267['id']])){_0x2b239a[_0x171a('0x16')][_0x3a0267['id']]=new VoiceExtension(_0x3a0267);}else{_0x2b239a[_0x171a('0x3c')](_0x2b239a['voiceExtensions'][_0x3a0267['id']],_0x3a0267);}}}return _0x2b239a[_0x171a('0x16')];};};Realtime[_0x171a('0x3b')][_0x171a('0x5d')]=function(){var _0x536e7b=this;return function(_0x3291cf){clearCampaigns(_0x536e7b[_0x171a('0x13')]);for(var _0x14aeb8=0x0;_0x14aeb8<_0x3291cf[_0x171a('0x3e')];_0x14aeb8+=0x1){_[_0x171a('0x4d')](_0x536e7b[_0x171a('0x13')][_0x3291cf[_0x14aeb8]['name']],_0x3291cf[_0x14aeb8]);}return _0x536e7b[_0x171a('0x13')];};};Realtime[_0x171a('0x3b')]['initFaxAccounts']=function(){var _0x551383=this;return function(_0x1b6eed){if(_0x1b6eed){freeIsNotKey(_0x1b6eed,_0x551383[_0x171a('0x5e')],'id');for(var _0x5caeea=0x0,_0xfee31f={},_0x158819={};_0x5caeea<_0x1b6eed[_0x171a('0x3e')];_0x5caeea+=0x1){_0xfee31f=_0x1b6eed[_0x5caeea];if(_[_0x171a('0x40')](_0x551383[_0x171a('0x5e')][_0xfee31f['id']])){_0x551383[_0x171a('0x5e')][_0xfee31f['id']]=new FaxAccount(_0xfee31f);}else{_0x551383[_0x171a('0x3c')](_0x551383[_0x171a('0x5e')][_0xfee31f['id']],_0xfee31f);}}}return _0x551383[_0x171a('0x5e')];};};module[_0x171a('0x5f')]=Realtime; \ No newline at end of file +var _0x7a33=['zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','faxAccounts','hasOwnProperty','mapKeys','SIP/%s','name','isNil','interface','format','answered','sumHoldTime','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','abandoned','sumDuration','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','prototype','initAgents','length','isUndefined','initTrunks','initVoiceQueues','initTriggers','initTemplates','initZendeskAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','merge','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','diff','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','total','queuecallercomplete','queuecallerleaveAt','outbound','ANSWERED','duration','billableseconds','initCampaigns','campaigns','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','bluebird','util','../model/telephone','../model/voiceQueue','../model/campaign','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/faxAccount','agents','telephones','trunks','voiceQueues','triggers','templates','voiceExtensions','channels','queueChannels','outboundChannels','timers','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts'];(function(_0xd5f8c9,_0xdf425b){var _0x5ae8f6=function(_0xc5d316){while(--_0xc5d316){_0xd5f8c9['push'](_0xd5f8c9['shift']());}};_0x5ae8f6(++_0xdf425b);}(_0x7a33,0xae));var _0x37a3=function(_0x105fb6,_0x1f0e10){_0x105fb6=_0x105fb6-0x0;var _0x1a3c1e=_0x7a33[_0x105fb6];return _0x1a3c1e;};'use strict';var BPromise=require(_0x37a3('0x0'));var util=require(_0x37a3('0x1'));var _=require('lodash');var moment=require('moment');var Agent=require('../model/agent');var Telephone=require(_0x37a3('0x2'));var Trunk=require('../model/trunk');var VoiceQueue=require(_0x37a3('0x3'));var Trigger=require('../model/trigger');var Template=require('../model/template');var Campaign=require(_0x37a3('0x4'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0x37a3('0x5'));var SalesforceAccount=require(_0x37a3('0x6'));var FreshdeskAccount=require(_0x37a3('0x7'));var SugarcrmAccount=require(_0x37a3('0x8'));var ZohoAccount=require(_0x37a3('0x9'));var DeskAccount=require(_0x37a3('0xa'));var VtigerAccount=require(_0x37a3('0xb'));var ServicenowAccount=require(_0x37a3('0xc'));var Dynamics365Account=require(_0x37a3('0xd'));var FaxAccount=require(_0x37a3('0xe'));var Realtime=function(){this[_0x37a3('0xf')]={};this[_0x37a3('0x10')]={};this[_0x37a3('0x11')]={};this[_0x37a3('0x12')]={};this[_0x37a3('0x13')]={};this['campaigns']={};this[_0x37a3('0x14')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x37a3('0x15')]={};this[_0x37a3('0x16')]={};this[_0x37a3('0x17')]={};this[_0x37a3('0x18')]={};this[_0x37a3('0x19')]={};this[_0x37a3('0x1a')]={};this[_0x37a3('0x1b')]={};this[_0x37a3('0x1c')]={};this[_0x37a3('0x1d')]={};this[_0x37a3('0x1e')]={};this[_0x37a3('0x1f')]={};this[_0x37a3('0x20')]={};this[_0x37a3('0x21')]={};this[_0x37a3('0x22')]={};this[_0x37a3('0x23')]={};};function freeIsNotKey(_0x88bb51,_0x5ec24a,_0x100b10){var _0x8a6c52=_['mapKeys'](_0x88bb51,function(_0x21fb39,_0x50dd66){return _0x21fb39[_0x100b10];});for(var _0x3932fa in _0x5ec24a){if(_0x5ec24a[_0x37a3('0x24')](_0x3932fa)){if(!_0x8a6c52[_0x3932fa]){delete _0x5ec24a[_0x3932fa];}}}}function freeIsNotKeySip(_0x453cec,_0x59be4d){var _0x545fb1=_[_0x37a3('0x25')](_0x453cec,function(_0x30ec25,_0x17dc48){return util['format'](_0x37a3('0x26'),_0x30ec25[_0x37a3('0x27')]);});for(var _0x2e52d2 in _0x59be4d){if(_0x59be4d[_0x37a3('0x24')](_0x2e52d2)){if(!_0x545fb1[_0x2e52d2]){delete _0x59be4d[_0x2e52d2];}}}}function freeIsNotKeyAgent(_0x25bb58,_0x6e20c3){var _0x24d6ad=_[_0x37a3('0x25')](_0x25bb58,function(_0x119664,_0x325c64){var _0x2ab752=_[_0x37a3('0x28')](_0x119664[_0x37a3('0x29')])?util[_0x37a3('0x2a')](_0x37a3('0x26'),_0x119664['name']):_0x119664[_0x37a3('0x29')];return _0x2ab752;});for(var _0x2edae1 in _0x6e20c3){if(_0x6e20c3['hasOwnProperty'](_0x2edae1)){if(!_0x24d6ad[_0x2edae1]){delete _0x6e20c3[_0x2edae1];}}}}function clearVoiceCallReports(_0x19afed){_0x19afed['total']=0x0;_0x19afed[_0x37a3('0x2b')]=0x0;_0x19afed[_0x37a3('0x2c')]=0x0;_0x19afed['sumDuration']=0x0;_0x19afed[_0x37a3('0x2d')]=0x0;}function clearCampaigns(_0x31469a){if(!_[_0x37a3('0x2e')](_0x31469a)){for(var _0x834095 in _0x31469a){if(_0x31469a[_0x37a3('0x24')](_0x834095)){_0x31469a[_0x834095][_0x37a3('0x2f')]=0x0;_0x31469a[_0x834095][_0x37a3('0x30')]=0x0;}}}}function clearVoiceQueues(_0x23b55f){if(!_['isEmpty'](_0x23b55f)){for(var _0x4b513e in _0x23b55f){if(_0x23b55f['hasOwnProperty'](_0x4b513e)){_0x23b55f[_0x4b513e]['total']=0x0;_0x23b55f[_0x4b513e][_0x37a3('0x2b')]=0x0;_0x23b55f[_0x4b513e][_0x37a3('0x31')]=0x0;_0x23b55f[_0x4b513e][_0x37a3('0x32')]=0x0;_0x23b55f[_0x4b513e][_0x37a3('0x2c')]=0x0;_0x23b55f[_0x4b513e][_0x37a3('0x33')]=0x0;_0x23b55f[_0x4b513e]['sumBillable']=0x0;_0x23b55f[_0x4b513e]['outboundAnswerAgiCallsDay']=0x0;_0x23b55f[_0x4b513e][_0x37a3('0x34')]=0x0;_0x23b55f[_0x4b513e]['outboundBusyCallsDay']=0x0;_0x23b55f[_0x4b513e][_0x37a3('0x35')]=0x0;_0x23b55f[_0x4b513e][_0x37a3('0x36')]=0x0;_0x23b55f[_0x4b513e][_0x37a3('0x37')]=0x0;_0x23b55f[_0x4b513e][_0x37a3('0x38')]=0x0;_0x23b55f[_0x4b513e][_0x37a3('0x39')]=0x0;_0x23b55f[_0x4b513e][_0x37a3('0x3a')]=0x0;_0x23b55f[_0x4b513e]['outboundOriginateFailureCallsDay']=0x0;_0x23b55f[_0x4b513e][_0x37a3('0x3b')]=0x0;_0x23b55f[_0x4b513e][_0x37a3('0x3c')]=0x0;_0x23b55f[_0x4b513e][_0x37a3('0x3d')]=0x0;_0x23b55f[_0x4b513e][_0x37a3('0x3e')]=0x0;_0x23b55f[_0x4b513e][_0x37a3('0x3f')]=!![];}}}}Realtime['prototype'][_0x37a3('0x40')]=function(_0x5a68d6,_0x247cdb){for(var _0x2fe841 in _0x247cdb){if(_0x5a68d6[_0x37a3('0x24')](_0x2fe841)){_0x5a68d6[_0x2fe841]=_0x247cdb[_0x2fe841];}}};Realtime[_0x37a3('0x41')][_0x37a3('0x42')]=function(){var _0x4f3407=this;return function(_0x11fbec){if(_0x11fbec){freeIsNotKeyAgent(_0x11fbec,_0x4f3407[_0x37a3('0xf')]);for(var _0x148e29=0x0,_0x42a539={},_0x4f15fd={};_0x148e29<_0x11fbec[_0x37a3('0x43')];_0x148e29+=0x1){_0x42a539=_0x11fbec[_0x148e29];var _0x1a6f1a=_['isNil'](_0x42a539[_0x37a3('0x29')])?util['format'](_0x37a3('0x26'),_0x42a539[_0x37a3('0x27')]):_0x42a539[_0x37a3('0x29')];if(_[_0x37a3('0x44')](_0x4f3407['agents'][_0x1a6f1a])){_0x4f3407[_0x37a3('0xf')][_0x1a6f1a]=new Agent(_0x42a539);}else{_0x4f3407[_0x37a3('0x40')](_0x4f3407[_0x37a3('0xf')][_0x1a6f1a],_0x42a539);}}}return _0x4f3407[_0x37a3('0xf')];};};Realtime[_0x37a3('0x41')]['initTelephones']=function(){var _0xc552f=this;return function(_0x56c01a){if(_0x56c01a){freeIsNotKeySip(_0x56c01a,_0xc552f[_0x37a3('0x10')]);for(var _0x42a12f=0x0,_0x2b49cb={},_0x5946cd={};_0x42a12f<_0x56c01a[_0x37a3('0x43')];_0x42a12f+=0x1){_0x2b49cb=_0x56c01a[_0x42a12f];if(_[_0x37a3('0x44')](_0xc552f[_0x37a3('0x10')][util[_0x37a3('0x2a')](_0x37a3('0x26'),_0x2b49cb[_0x37a3('0x27')])])){_0xc552f[_0x37a3('0x10')][util[_0x37a3('0x2a')]('SIP/%s',_0x2b49cb[_0x37a3('0x27')])]=new Telephone(_0x2b49cb);}else{_0xc552f[_0x37a3('0x40')](_0xc552f[_0x37a3('0x10')][util[_0x37a3('0x2a')](_0x37a3('0x26'),_0x2b49cb[_0x37a3('0x27')])],_0x2b49cb);}}}return _0xc552f[_0x37a3('0x10')];};};Realtime[_0x37a3('0x41')][_0x37a3('0x45')]=function(){var _0xbdf26d=this;return function(_0x897454){if(_0x897454){freeIsNotKeySip(_0x897454,_0xbdf26d[_0x37a3('0x11')]);for(var _0x4f1f44=0x0,_0x265111={},_0xd9f45b={};_0x4f1f44<_0x897454['length'];_0x4f1f44+=0x1){_0x265111=_0x897454[_0x4f1f44];if(_[_0x37a3('0x44')](_0xbdf26d[_0x37a3('0x11')][util['format'](_0x37a3('0x26'),_0x265111[_0x37a3('0x27')])])){_0xbdf26d[_0x37a3('0x11')][util[_0x37a3('0x2a')]('SIP/%s',_0x265111[_0x37a3('0x27')])]=new Trunk(_0x265111);}else{_0xbdf26d['mergeFromDatabase'](_0xbdf26d[_0x37a3('0x11')][util[_0x37a3('0x2a')](_0x37a3('0x26'),_0x265111[_0x37a3('0x27')])],_0x265111);}}}return _0xbdf26d[_0x37a3('0x11')];};};Realtime[_0x37a3('0x41')][_0x37a3('0x46')]=function(){var _0x432877=this;return function(_0x458c26){if(_0x458c26){freeIsNotKey(_0x458c26,_0x432877[_0x37a3('0x12')],'name');for(var _0x41148a=0x0,_0x4085b2={},_0x1203d3={};_0x41148a<_0x458c26[_0x37a3('0x43')];_0x41148a+=0x1){_0x4085b2=_0x458c26[_0x41148a];if(_['isUndefined'](_0x432877['voiceQueues'][_0x4085b2[_0x37a3('0x27')]])){_0x432877[_0x37a3('0x12')][_0x4085b2[_0x37a3('0x27')]]=new VoiceQueue(_0x4085b2);}else{_0x432877['mergeFromDatabase'](_0x432877[_0x37a3('0x12')][_0x4085b2[_0x37a3('0x27')]],_0x4085b2);}}}return _0x432877['voiceQueues'];};};Realtime['prototype'][_0x37a3('0x47')]=function(){var _0x2243f3=this;return function(_0x49447e){if(_0x49447e){freeIsNotKey(_0x49447e,_0x2243f3[_0x37a3('0x13')],'id');for(var _0x356abe=0x0,_0x3758c2={},_0x1a876d={};_0x356abe<_0x49447e['length'];_0x356abe+=0x1){_0x3758c2=_0x49447e[_0x356abe];if(_[_0x37a3('0x44')](_0x2243f3['triggers'][_0x3758c2['id']])){_0x2243f3[_0x37a3('0x13')][_0x3758c2['id']]=new Trigger(_0x3758c2);}else{_0x2243f3[_0x37a3('0x40')](_0x2243f3['triggers'][_0x3758c2['id']],_0x3758c2);}}}return _0x2243f3['triggers'];};};Realtime[_0x37a3('0x41')][_0x37a3('0x48')]=function(){var _0x116109=this;return function(_0x544b07){if(_0x544b07){freeIsNotKey(_0x544b07,_0x116109[_0x37a3('0x14')],'id');for(var _0x61a151=0x0,_0x1f02c1={},_0x52f994={};_0x61a151<_0x544b07['length'];_0x61a151+=0x1){_0x1f02c1=_0x544b07[_0x61a151];if(_['isUndefined'](_0x116109[_0x37a3('0x14')][_0x1f02c1['id']])){_0x116109['templates'][_0x1f02c1['id']]=new Template(_0x1f02c1);}else{_0x116109[_0x37a3('0x40')](_0x116109[_0x37a3('0x14')][_0x1f02c1['id']],_0x1f02c1);}}}return _0x116109[_0x37a3('0x14')];};};Realtime['prototype'][_0x37a3('0x49')]=function(){var _0x392402=this;return function(_0x1cba5a){if(_0x1cba5a){freeIsNotKey(_0x1cba5a,_0x392402['zendeskAccounts'],'id');for(var _0x5b6036=0x0,_0x133513={},_0xd9c646={};_0x5b6036<_0x1cba5a['length'];_0x5b6036+=0x1){_0x133513=_0x1cba5a[_0x5b6036];if(_[_0x37a3('0x44')](_0x392402[_0x37a3('0x1a')][_0x133513['id']])){_0x392402['zendeskAccounts'][_0x133513['id']]=new ZendeskAccount(_0x133513);}else{_0x392402['mergeFromDatabase'](_0x392402[_0x37a3('0x1a')][_0x133513['id']],_0x133513);}}}return _0x392402[_0x37a3('0x1a')];};};Realtime['prototype']['initSalesforceAccounts']=function(){var _0x48e705=this;return function(_0x28d694){if(_0x28d694){freeIsNotKey(_0x28d694,_0x48e705['salesforceAccounts'],'id');for(var _0x55437c=0x0,_0x812cbc={},_0x48844a={};_0x55437c<_0x28d694[_0x37a3('0x43')];_0x55437c+=0x1){_0x812cbc=_0x28d694[_0x55437c];if(_[_0x37a3('0x44')](_0x48e705[_0x37a3('0x1b')][_0x812cbc['id']])){_0x48e705[_0x37a3('0x1b')][_0x812cbc['id']]=new SalesforceAccount(_0x812cbc);}else{_0x48e705[_0x37a3('0x40')](_0x48e705[_0x37a3('0x1b')][_0x812cbc['id']],_0x812cbc);}}}return _0x48e705[_0x37a3('0x1b')];};};Realtime[_0x37a3('0x41')]['initFreshdeskAccounts']=function(){var _0x5616c0=this;return function(_0xce0cbf){if(_0xce0cbf){freeIsNotKey(_0xce0cbf,_0x5616c0[_0x37a3('0x1d')],'id');for(var _0x198ec3=0x0,_0x584dc1={},_0x42d029={};_0x198ec3<_0xce0cbf['length'];_0x198ec3+=0x1){_0x584dc1=_0xce0cbf[_0x198ec3];if(_[_0x37a3('0x44')](_0x5616c0[_0x37a3('0x1d')][_0x584dc1['id']])){_0x5616c0['freshdeskAccounts'][_0x584dc1['id']]=new FreshdeskAccount(_0x584dc1);}else{_0x5616c0['mergeFromDatabase'](_0x5616c0[_0x37a3('0x1d')][_0x584dc1['id']],_0x584dc1);}}}return _0x5616c0['freshdeskAccounts'];};};Realtime[_0x37a3('0x41')]['initZohoAccounts']=function(){var _0x44de94=this;return function(_0x26ab03){if(_0x26ab03){freeIsNotKey(_0x26ab03,_0x44de94[_0x37a3('0x1e')],'id');for(var _0x27a2af=0x0,_0x3d34ac={},_0x601026={};_0x27a2af<_0x26ab03['length'];_0x27a2af+=0x1){_0x3d34ac=_0x26ab03[_0x27a2af];if(_[_0x37a3('0x44')](_0x44de94[_0x37a3('0x1e')][_0x3d34ac['id']])){_0x44de94[_0x37a3('0x1e')][_0x3d34ac['id']]=new ZohoAccount(_0x3d34ac);}else{_0x44de94[_0x37a3('0x40')](_0x44de94[_0x37a3('0x1e')][_0x3d34ac['id']],_0x3d34ac);}}}return _0x44de94[_0x37a3('0x1e')];};};Realtime[_0x37a3('0x41')][_0x37a3('0x4a')]=function(){var _0x39079a=this;return function(_0x26cbf8){if(_0x26cbf8){freeIsNotKey(_0x26cbf8,_0x39079a[_0x37a3('0x1f')],'id');for(var _0x10cf04=0x0,_0x29fe1c={},_0x2fef19={};_0x10cf04<_0x26cbf8[_0x37a3('0x43')];_0x10cf04+=0x1){_0x29fe1c=_0x26cbf8[_0x10cf04];if(_[_0x37a3('0x44')](_0x39079a[_0x37a3('0x1f')][_0x29fe1c['id']])){_0x39079a[_0x37a3('0x1f')][_0x29fe1c['id']]=new DeskAccount(_0x29fe1c);}else{_0x39079a[_0x37a3('0x40')](_0x39079a[_0x37a3('0x1f')][_0x29fe1c['id']],_0x29fe1c);}}}return _0x39079a[_0x37a3('0x1f')];};};Realtime[_0x37a3('0x41')][_0x37a3('0x4b')]=function(){var _0x5f3b02=this;return function(_0x4c1fee){if(_0x4c1fee){freeIsNotKey(_0x4c1fee,_0x5f3b02[_0x37a3('0x1c')],'id');for(var _0xd89e18=0x0,_0x25b308={},_0x1931d7={};_0xd89e18<_0x4c1fee[_0x37a3('0x43')];_0xd89e18+=0x1){_0x25b308=_0x4c1fee[_0xd89e18];if(_[_0x37a3('0x44')](_0x5f3b02['sugarcrmAccounts'][_0x25b308['id']])){_0x5f3b02['sugarcrmAccounts'][_0x25b308['id']]=new SugarcrmAccount(_0x25b308);}else{_0x5f3b02[_0x37a3('0x40')](_0x5f3b02['sugarcrmAccounts'][_0x25b308['id']],_0x25b308);}}}return _0x5f3b02[_0x37a3('0x1c')];};};Realtime['prototype'][_0x37a3('0x4c')]=function(){var _0x2bf7e7=this;return function(_0x389087){if(_0x389087){freeIsNotKey(_0x389087,_0x2bf7e7[_0x37a3('0x20')],'id');for(var _0x2fa50f=0x0,_0x2c3632={},_0xbf6778={};_0x2fa50f<_0x389087['length'];_0x2fa50f+=0x1){_0x2c3632=_0x389087[_0x2fa50f];if(_[_0x37a3('0x44')](_0x2bf7e7[_0x37a3('0x20')][_0x2c3632['id']])){_0x2bf7e7['vtigerAccounts'][_0x2c3632['id']]=new VtigerAccount(_0x2c3632);}else{_0x2bf7e7[_0x37a3('0x40')](_0x2bf7e7['vtigerAccounts'][_0x2c3632['id']],_0x2c3632);}}}return _0x2bf7e7[_0x37a3('0x20')];};};Realtime[_0x37a3('0x41')][_0x37a3('0x4d')]=function(){var _0x44825f=this;return function(_0x1e7d0a){if(_0x1e7d0a){freeIsNotKey(_0x1e7d0a,_0x44825f[_0x37a3('0x21')],'id');for(var _0x109c4b=0x0,_0xfbb859={},_0x465267={};_0x109c4b<_0x1e7d0a[_0x37a3('0x43')];_0x109c4b+=0x1){_0xfbb859=_0x1e7d0a[_0x109c4b];if(_[_0x37a3('0x44')](_0x44825f[_0x37a3('0x21')][_0xfbb859['id']])){_0x44825f[_0x37a3('0x21')][_0xfbb859['id']]=new ServicenowAccount(_0xfbb859);}else{_0x44825f[_0x37a3('0x40')](_0x44825f['servicenowAccounts'][_0xfbb859['id']],_0xfbb859);}}}return _0x44825f['servicenowAccounts'];};};Realtime[_0x37a3('0x41')][_0x37a3('0x4e')]=function(){var _0x571323=this;return function(_0x274ee6){if(_0x274ee6){freeIsNotKey(_0x274ee6,_0x571323[_0x37a3('0x22')],'id');for(var _0x491246=0x0,_0x3e32be={},_0x4ae429={};_0x491246<_0x274ee6['length'];_0x491246+=0x1){_0x3e32be=_0x274ee6[_0x491246];if(_[_0x37a3('0x44')](_0x571323[_0x37a3('0x22')][_0x3e32be['id']])){_0x571323['dynamics365Accounts'][_0x3e32be['id']]=new Dynamics365Account(_0x3e32be);}else{_0x571323['mergeFromDatabase'](_0x571323[_0x37a3('0x22')][_0x3e32be['id']],_0x3e32be);}}}return _0x571323[_0x37a3('0x22')];};};Realtime['prototype']['initVoiceQueueHopperHistory']=function(){var _0xf24c25=this;return function(_0x1ebd43){for(var _0x111c75=0x0;_0x111c75<_0x1ebd43['length'];_0x111c75+=0x1){_[_0x37a3('0x4f')](_0xf24c25[_0x37a3('0x12')][_0x1ebd43[_0x111c75][_0x37a3('0x27')]],_0x1ebd43[_0x111c75]);}return _0xf24c25[_0x37a3('0x12')];};};Realtime[_0x37a3('0x41')]['initVoiceQueueReports']=function(){var _0x203c1a=this;return function(_0x316fde){clearVoiceQueues(_0x203c1a[_0x37a3('0x12')]);if(_0x316fde){_0x316fde=_[_0x37a3('0x50')](_0x316fde,_0x37a3('0x51'));for(var _0x4d0710 in _0x316fde){if(_0x316fde[_0x37a3('0x24')](_0x4d0710)){var _0x3edf86={};for(var _0x1bf7a2=0x0;_0x1bf7a2<_0x316fde[_0x4d0710][_0x37a3('0x43')];_0x1bf7a2+=0x1){var _0x4155dd=_0x316fde[_0x4d0710][_0x1bf7a2][_0x37a3('0x52')];if(_0x203c1a[_0x37a3('0x12')][_0x4155dd]){if(_0x316fde[_0x4d0710][_0x1bf7a2][_0x37a3('0x53')]){_0x203c1a[_0x37a3('0x12')][_0x4155dd][_0x37a3('0x31')]+=0x1;}if(_0x316fde[_0x4d0710][_0x1bf7a2][_0x37a3('0x54')]){_0x203c1a[_0x37a3('0x12')][_0x4155dd]['abandoned']+=0x1;}_0x203c1a[_0x37a3('0x12')][_0x4155dd][_0x37a3('0x2c')]+=moment(_0x316fde[_0x4d0710][_0x1bf7a2]['queuecallerleaveAt'])[_0x37a3('0x55')](moment(_0x316fde[_0x4d0710][_0x1bf7a2]['queuecallerjoinAt']),_0x37a3('0x56'))||0x0;if(_0x1bf7a2===_0x316fde[_0x4d0710]['length']-0x1){_0x203c1a['voiceQueues'][_0x4155dd][_0x37a3('0x33')]+=moment(_0x316fde[_0x4d0710][_0x1bf7a2][_0x37a3('0x57')]||_0x316fde[_0x4d0710][_0x1bf7a2][_0x37a3('0x58')]||_0x316fde[_0x4d0710][_0x1bf7a2][_0x37a3('0x59')])[_0x37a3('0x55')](moment(_0x316fde[_0x4d0710][_0x1bf7a2]['queuecallerjoinAt']),'seconds')||0x0;_0x203c1a['voiceQueues'][_0x4155dd][_0x37a3('0x5a')]+=0x1;if(_0x316fde[_0x4d0710][_0x1bf7a2][_0x37a3('0x5b')]){_0x203c1a['voiceQueues'][_0x4155dd][_0x37a3('0x2b')]+=0x1;_0x203c1a['voiceQueues'][_0x4155dd]['sumBillable']+=moment(_0x316fde[_0x4d0710][_0x1bf7a2]['queuecallercompleteAt'])[_0x37a3('0x55')](moment(_0x316fde[_0x4d0710][_0x1bf7a2][_0x37a3('0x5c')]),'seconds')||0x0;}}else{_0x203c1a[_0x37a3('0x12')][_0x4155dd][_0x37a3('0x33')]+=_0x203c1a[_0x37a3('0x12')][_0x4155dd][_0x37a3('0x2c')]||0x0;}}}}}}return _0x203c1a[_0x37a3('0x12')];};};Realtime[_0x37a3('0x41')]['initVoiceCallReports']=function(){var _0x1efcad=this;return function(_0x5323d8){clearVoiceCallReports(_0x1efcad['outbound']);if(_0x5323d8){for(var _0x5b0e1e=0x0;_0x5b0e1e<_0x5323d8[_0x37a3('0x43')];_0x5b0e1e+=0x1){_0x1efcad['outbound'][_0x37a3('0x5a')]+=0x1;_0x1efcad[_0x37a3('0x5d')]['sumDuration']+=_0x5323d8[_0x5b0e1e]['duration'];if(_0x5323d8[_0x5b0e1e]['disposition']===_0x37a3('0x5e')){_0x1efcad['outbound'][_0x37a3('0x2b')]+=0x1;_0x1efcad[_0x37a3('0x5d')]['sumHoldTime']+=_0x5323d8[_0x5b0e1e][_0x37a3('0x5f')]-_0x5323d8[_0x5b0e1e][_0x37a3('0x60')]||0x0;_0x1efcad['outbound'][_0x37a3('0x2d')]+=_0x5323d8[_0x5b0e1e]['billableseconds'];}}}return _0x1efcad[_0x37a3('0x5d')];};};Realtime[_0x37a3('0x41')][_0x37a3('0x61')]=function(){var _0x4d1b0e=this;return function(_0x27da2f){if(_0x27da2f){freeIsNotKey(_0x27da2f,_0x4d1b0e['campaigns'],_0x37a3('0x27'));for(var _0x174860=0x0,_0x1acf43={};_0x174860<_0x27da2f[_0x37a3('0x43')];_0x174860+=0x1){_0x1acf43=_0x27da2f[_0x174860];if(_[_0x37a3('0x44')](_0x4d1b0e[_0x37a3('0x62')][_0x1acf43[_0x37a3('0x27')]])){_0x4d1b0e[_0x37a3('0x62')][_0x1acf43[_0x37a3('0x27')]]=new Campaign(_0x1acf43);}else{_0x4d1b0e[_0x37a3('0x40')](_0x4d1b0e[_0x37a3('0x62')][_0x1acf43[_0x37a3('0x27')]],_0x1acf43);}}}return _0x4d1b0e['campaigns'];};};Realtime[_0x37a3('0x41')][_0x37a3('0x63')]=function(){var _0x6f61=this;return function(_0x5753fd){if(_0x5753fd){freeIsNotKey(_0x5753fd,_0x6f61[_0x37a3('0x15')],'id');for(var _0x3de8cb=0x0,_0x13b821={};_0x3de8cb<_0x5753fd['length'];_0x3de8cb+=0x1){_0x13b821=_0x5753fd[_0x3de8cb];if(_[_0x37a3('0x44')](_0x6f61[_0x37a3('0x15')][_0x13b821['id']])){_0x6f61[_0x37a3('0x15')][_0x13b821['id']]=new VoiceExtension(_0x13b821);}else{_0x6f61['mergeFromDatabase'](_0x6f61[_0x37a3('0x15')][_0x13b821['id']],_0x13b821);}}}return _0x6f61['voiceExtensions'];};};Realtime[_0x37a3('0x41')][_0x37a3('0x64')]=function(){var _0x4d4197=this;return function(_0x5dc6fd){clearCampaigns(_0x4d4197[_0x37a3('0x62')]);for(var _0x4854c5=0x0;_0x4854c5<_0x5dc6fd['length'];_0x4854c5+=0x1){_[_0x37a3('0x4f')](_0x4d4197[_0x37a3('0x62')][_0x5dc6fd[_0x4854c5][_0x37a3('0x27')]],_0x5dc6fd[_0x4854c5]);}return _0x4d4197[_0x37a3('0x62')];};};Realtime['prototype'][_0x37a3('0x65')]=function(){var _0x4628ed=this;return function(_0xba3f56){if(_0xba3f56){freeIsNotKey(_0xba3f56,_0x4628ed[_0x37a3('0x23')],'id');for(var _0x11311a=0x0,_0x2c0dc7={},_0x524181={};_0x11311a<_0xba3f56[_0x37a3('0x43')];_0x11311a+=0x1){_0x2c0dc7=_0xba3f56[_0x11311a];if(_[_0x37a3('0x44')](_0x4628ed[_0x37a3('0x23')][_0x2c0dc7['id']])){_0x4628ed['faxAccounts'][_0x2c0dc7['id']]=new FaxAccount(_0x2c0dc7);}else{_0x4628ed[_0x37a3('0x40')](_0x4628ed[_0x37a3('0x23')][_0x2c0dc7['id']],_0x2c0dc7);}}}return _0x4628ed[_0x37a3('0x23')];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 81e5412..937de17 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 _0x5363=['phone','blindTransfer','exports','bluebird','lodash','moment','util','../../../config/environment','../../../config/logger','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','voiceDialReport','bind','blindtransfer','attendedtransfer','attendedTransfer','findAgent','find','accountcode','name','isNil','interface','format','SIP/%s','length','connectedlinenum','lastAssignedTo','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','destination','exten','type','dialer','lastapplication','queue','lastdata','from-voip-provider','callerid','from-sip','xcally-motion-preview','calleridpreview','originatecalleridnum','destinationchannel','channel','calleridnum','ANSWERED','calleridname','monitor','monitorFilename','createdAt','connectedlinename','isArray','startsWith','Local','substring','indexOf','mobile'];(function(_0x14477e,_0x44d4da){var _0x5d4a05=function(_0x5e0fa3){while(--_0x5e0fa3){_0x14477e['push'](_0x14477e['shift']());}};_0x5d4a05(++_0x44d4da);}(_0x5363,0x19d));var _0x3536=function(_0x4ba1e1,_0x38d0c6){_0x4ba1e1=_0x4ba1e1-0x0;var _0x17705e=_0x5363[_0x4ba1e1];return _0x17705e;};'use strict';var BPromise=require(_0x3536('0x0'));var _=require(_0x3536('0x1'));var moment=require(_0x3536('0x2'));var util=require(_0x3536('0x3'));var config=require(_0x3536('0x4'));var logger=require(_0x3536('0x5'))('ami');var ami=require('../ami');var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0x3536('0x6'));var RpcMemberReport=require(_0x3536('0x7'));var RpcVoiceQueueReport=require(_0x3536('0x8'));var RpcVoiceRecording=require(_0x3536('0x9'));var RpcVoiceTransferReport=require(_0x3536('0xa'));var VoiceQueueReport=require(_0x3536('0xb'));var VoiceCallReport=require(_0x3536('0xc'));var VoiceAgentReport=require(_0x3536('0xd'));var VoiceDialReport=require('./voiceDialReport');var UserReport=require(_0x3536('0xe'));function Report(_0x2d3a34){this[_0x3536('0xf')]=_0x2d3a34;this[_0x3536('0x10')]=_0x2d3a34['agents'];this['telephones']=_0x2d3a34[_0x3536('0x11')];}Report[_0x3536('0x12')][_0x3536('0x13')]=function(_0x1a607e){var _0x4546eb=new VoiceQueueReport(this[_0x3536('0xf')]);var _0xbf560a=new VoiceAgentReport(this[_0x3536('0xf')]);var _0x394cae=new VoiceDialReport(this['realtime']);var _0x127ade=new VoiceCallReport(this[_0x3536('0xf')]);var _0x493a80=new UserReport(this[_0x3536('0xf')]);if(config['xdr']&&config[_0x3536('0x14')][_0x3536('0x15')]){ami['on'](_0x3536('0x16'),this[_0x3536('0x17')]['bind'](this));ami['on'](_0x3536('0x18'),this[_0x3536('0x19')]['bind'](this));ami['on'](_0x3536('0x1a'),this[_0x3536('0x1b')]['bind'](this));ami['on']('custom:voiceDialReport',this[_0x3536('0x1c')][_0x3536('0x1d')](this));ami['on'](_0x3536('0x1e'),this['blindTransfer']['bind'](this));ami['on'](_0x3536('0x1f'),this[_0x3536('0x20')]['bind'](this));}};Report['prototype'][_0x3536('0x21')]=function(_0x1630fd){var _0x1fb595=undefined;_0x1fb595=_[_0x3536('0x22')](this[_0x3536('0x10')],function(_0x4fbcff){return _0x4fbcff[_0x3536('0x23')]==_0x1630fd||_0x4fbcff[_0x3536('0x24')]==_0x1630fd;});if(_[_0x3536('0x25')](_0x1fb595)){var _0x390cbc=_['find'](this['telephones'],function(_0x2a370f){return _0x2a370f[_0x3536('0x23')]==_0x1630fd||_0x2a370f[_0x3536('0x24')]==_0x1630fd;});if(_0x390cbc){_0x1fb595=_[_0x3536('0x22')](this[_0x3536('0x10')],function(_0x472c50){return _0x472c50[_0x3536('0x26')]==util[_0x3536('0x27')](_0x3536('0x28'),_0x390cbc['name']);});}}return _0x1fb595;};Report[_0x3536('0x12')][_0x3536('0x17')]=function(_0x22777f){for(var _0x1882ef=0x0;_0x1882ef<_0x22777f[_0x3536('0x29')];_0x1882ef+=0x1){var _0x409679=this[_0x3536('0x21')](_0x22777f[_0x1882ef][_0x3536('0x2a')]);if(_0x409679){_0x22777f[_0x1882ef][_0x3536('0x23')]=_0x409679['accountcode'];_0x22777f[_0x1882ef]['assigned']=!![];_0x22777f[_0x1882ef][_0x3536('0x2b')]=_0x409679[_0x3536('0x24')];_0x22777f[_0x1882ef]['interface']=_[_0x3536('0x25')](_0x409679[_0x3536('0x26')])?util['format'](_0x3536('0x28'),_0x409679[_0x3536('0x24')]):_0x409679[_0x3536('0x26')];if(_0x22777f[_0x1882ef][_0x3536('0x2c')]){_0x22777f[_0x1882ef][_0x3536('0x2d')]=moment()[_0x3536('0x27')](_0x3536('0x2e'));}if(_0x22777f[_0x1882ef][_0x3536('0x2f')]){_0x22777f[_0x1882ef][_0x3536('0x30')]=moment()[_0x3536('0x27')](_0x3536('0x2e'));}RpcMemberReport['voiceQueueReport'](_0x22777f[_0x1882ef]);}RpcVoiceQueueReport[_0x3536('0x31')](_0x22777f[_0x1882ef]);}};function extractCalleridNumber(_0x4a922e){var _0x3a1303=_0x4a922e[_0x3536('0x32')](/<(.*?)>/);return _0x3a1303?_0x3a1303[0x1]:_0x4a922e;}Report[_0x3536('0x12')]['voiceCallReport']=function(_0x3c8e1c){_0x3c8e1c[_0x3536('0x33')]=_0x3c8e1c[_0x3536('0x33')]||_0x3c8e1c[_0x3536('0x34')];if(_0x3c8e1c[_0x3536('0x35')]==_0x3536('0x36')){_0x3c8e1c[_0x3536('0x37')]=_0x3536('0x38');_0x3c8e1c[_0x3536('0x39')]=_0x3c8e1c[_0x3536('0x38')];if(_0x3c8e1c['context']==_0x3536('0x3a')){_0x3c8e1c[_0x3536('0x23')]='';_0x3c8e1c[_0x3536('0x33')]=extractCalleridNumber(_0x3c8e1c[_0x3536('0x3b')]);}else if(_0x3c8e1c['context']==_0x3536('0x3c')){if(_0x3c8e1c[_0x3536('0x33')]==_0x3536('0x3d')){_0x3c8e1c[_0x3536('0x33')]=extractCalleridNumber(_0x3c8e1c[_0x3536('0x3e')]);_0x3c8e1c['calleridnum']=_0x3c8e1c[_0x3536('0x3f')];_0x3c8e1c[_0x3536('0x40')]=[_0x3c8e1c['channel'],_0x3c8e1c[_0x3536('0x41')]=_0x3c8e1c['destinationchannel']][0x0];_0x3c8e1c['callerid']=_0x3c8e1c['calleridpreview'];}else{_0x3c8e1c[_0x3536('0x33')]=_0x3c8e1c[_0x3536('0x42')];_0x3c8e1c['calleridnum']=_0x3c8e1c['originatecalleridnum'];if(_0x3c8e1c['disposition']==_0x3536('0x43')){_0x3c8e1c[_0x3536('0x23')]=_0x3c8e1c[_0x3536('0x2a')];}else{_0x3c8e1c[_0x3536('0x23')]='';}}}}else{_0x3c8e1c[_0x3536('0x3b')]=util[_0x3536('0x27')]('\x22%s\x22\x20<%s>',_0x3c8e1c[_0x3536('0x44')],_0x3c8e1c[_0x3536('0x42')]);}RpcVoiceCallReport[_0x3536('0x31')](_0x3c8e1c);if(_0x3c8e1c[_0x3536('0x45')]){for(var _0x121713=0x0;_0x121713<_0x3c8e1c['monitors'][_0x3536('0x29')];_0x121713+=0x1){_0x3c8e1c[_0x3536('0x46')]=_0x3c8e1c['monitors'][_0x121713]['filename'];_0x3c8e1c['createdAt']=_0x3c8e1c['monitors'][_0x121713][_0x3536('0x47')];if(_0x3c8e1c[_0x3536('0x34')]==_0x3536('0x3d')){_0x3c8e1c[_0x3536('0x42')]=_0x3c8e1c[_0x3536('0x2a')];_0x3c8e1c[_0x3536('0x44')]=_0x3c8e1c[_0x3536('0x48')];_0x3c8e1c[_0x3536('0x2a')]=_0x3c8e1c[_0x3536('0x23')];_0x3c8e1c[_0x3536('0x48')]=_0x3c8e1c['membername'];_0x3c8e1c[_0x3536('0x34')]=_0x3c8e1c[_0x3536('0x3f')];}else if(_0x3c8e1c[_0x3536('0x34')]=='xcally-motion-dialer'){_0x3c8e1c['calleridnum']=_0x3c8e1c[_0x3536('0x33')];_0x3c8e1c[_0x3536('0x34')]=_0x3c8e1c['originatecalleridnum'];}RpcVoiceRecording[_0x3536('0x31')](_0x3c8e1c);}}};Report[_0x3536('0x12')][_0x3536('0x1b')]=function(_0x572b4b){if(_[_0x3536('0x49')](_0x572b4b)){_0x572b4b['forEach'](function(_0x5c170d){RpcVoiceAgentReport['create'](_0x5c170d);});}else{RpcVoiceAgentReport[_0x3536('0x31')](_0x572b4b);}};Report[_0x3536('0x12')][_0x3536('0x1c')]=function(_0x2f2691){RpcVoiceDialReport[_0x3536('0x31')](_0x2f2691);var _0x2b35ca=undefined;var _0x5b9362=_0x2f2691[_0x3536('0x41')];if(_[_0x3536('0x4a')](_0x5b9362,_0x3536('0x4b'))){var _0x515260=_0x5b9362[_0x3536('0x4c')](_0x5b9362[_0x3536('0x4d')]('/')+0x1,_0x5b9362[_0x3536('0x4d')]('@'));_0x2b35ca=_[_0x3536('0x22')](this[_0x3536('0x10')],function(_0x36a8ad){return _0x36a8ad[_0x3536('0x4e')]==_0x515260||_0x36a8ad[_0x3536('0x4f')]==_0x515260||_0x36a8ad[_0x3536('0x23')]==_0x515260;});}else{var _0x515260=_0x5b9362[_0x3536('0x4c')](_0x5b9362[_0x3536('0x4d')]('/')+0x1,_0x5b9362['lastIndexOf']('-'));_0x2b35ca=this[_0x3536('0x21')](_0x515260);}if(_0x2b35ca){_0x2f2691['interface']=_[_0x3536('0x25')](_0x2b35ca[_0x3536('0x26')])?util['format'](_0x3536('0x28'),_0x2b35ca[_0x3536('0x24')]):_0x2b35ca[_0x3536('0x26')];_0x2f2691['membername']=_0x2b35ca[_0x3536('0x24')];_0x2f2691[_0x3536('0x23')]=_0x2b35ca[_0x3536('0x23')];RpcMemberReport['voiceDialReport'](_0x2f2691);}};Report[_0x3536('0x12')][_0x3536('0x50')]=function(_0x4d2a23){RpcVoiceTransferReport[_0x3536('0x50')](_0x4d2a23);};Report[_0x3536('0x12')][_0x3536('0x20')]=function(_0x8afa12){RpcVoiceTransferReport[_0x3536('0x20')](_0x8afa12);};module[_0x3536('0x51')]=Report; \ No newline at end of file +var _0x3886=['custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','prototype','findAgent','find','name','isNil','accountcode','interface','format','length','assigned','SIP/%s','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexitAt','create','destination','exten','type','dialer','lastapplication','queue','lastdata','from-voip-provider','from-sip','calleridpreview','originatecalleridnum','destinationchannel','channel','callerid','calleridnum','ANSWERED','connectedlinenum','calleridname','monitor','monitors','monitorFilename','filename','connectedlinename','membername','xcally-motion-dialer','startsWith','indexOf','mobile','phone','lastIndexOf','exports','lodash','moment','util','../../../config/environment','../../../config/logger','../ami','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','xdr','custom:voiceQueueReport','voiceQueueReport','custom:voiceCallReport','voiceCallReport','bind'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0x3886,0x87));var _0x6388=function(_0x6ec093,_0x566a0a){_0x6ec093=_0x6ec093-0x0;var _0xb7cda4=_0x3886[_0x6ec093];return _0xb7cda4;};'use strict';var BPromise=require('bluebird');var _=require(_0x6388('0x0'));var moment=require(_0x6388('0x1'));var util=require(_0x6388('0x2'));var config=require(_0x6388('0x3'));var logger=require(_0x6388('0x4'))('ami');var ami=require(_0x6388('0x5'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0x6388('0x6'));var RpcVoiceDialReport=require(_0x6388('0x7'));var RpcMemberReport=require(_0x6388('0x8'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0x6388('0x9'));var RpcVoiceTransferReport=require(_0x6388('0xa'));var VoiceQueueReport=require(_0x6388('0xb'));var VoiceCallReport=require(_0x6388('0xc'));var VoiceAgentReport=require(_0x6388('0xd'));var VoiceDialReport=require(_0x6388('0xe'));var UserReport=require(_0x6388('0xf'));function Report(_0x17f783){this[_0x6388('0x10')]=_0x17f783;this[_0x6388('0x11')]=_0x17f783[_0x6388('0x11')];this[_0x6388('0x12')]=_0x17f783[_0x6388('0x12')];}Report['prototype']['sync']=function(_0x53efb3){var _0x6003a1=new VoiceQueueReport(this[_0x6388('0x10')]);var _0x1c337d=new VoiceAgentReport(this['realtime']);var _0x5a9012=new VoiceDialReport(this['realtime']);var _0x15c062=new VoiceCallReport(this['realtime']);var _0x3a2e59=new UserReport(this['realtime']);if(config[_0x6388('0x13')]&&config['xdr']['disabled']){ami['on'](_0x6388('0x14'),this[_0x6388('0x15')]['bind'](this));ami['on'](_0x6388('0x16'),this[_0x6388('0x17')][_0x6388('0x18')](this));ami['on'](_0x6388('0x19'),this[_0x6388('0x1a')][_0x6388('0x18')](this));ami['on'](_0x6388('0x1b'),this[_0x6388('0x1c')]['bind'](this));ami['on'](_0x6388('0x1d'),this[_0x6388('0x1e')]['bind'](this));ami['on'](_0x6388('0x1f'),this[_0x6388('0x20')]['bind'](this));}};Report[_0x6388('0x21')][_0x6388('0x22')]=function(_0x212cb2){var _0x5d022c=undefined;_0x5d022c=_[_0x6388('0x23')](this['agents'],function(_0x495ea6){return _0x495ea6['accountcode']==_0x212cb2||_0x495ea6[_0x6388('0x24')]==_0x212cb2;});if(_[_0x6388('0x25')](_0x5d022c)){var _0x42e581=_[_0x6388('0x23')](this[_0x6388('0x12')],function(_0x4e85a4){return _0x4e85a4[_0x6388('0x26')]==_0x212cb2||_0x4e85a4['name']==_0x212cb2;});if(_0x42e581){_0x5d022c=_[_0x6388('0x23')](this[_0x6388('0x11')],function(_0xf70e18){return _0xf70e18[_0x6388('0x27')]==util[_0x6388('0x28')]('SIP/%s',_0x42e581[_0x6388('0x24')]);});}}return _0x5d022c;};Report['prototype'][_0x6388('0x15')]=function(_0x1b5263){for(var _0xeb5087=0x0;_0xeb5087<_0x1b5263[_0x6388('0x29')];_0xeb5087+=0x1){var _0xa69b86=this['findAgent'](_0x1b5263[_0xeb5087]['connectedlinenum']);if(_0xa69b86){_0x1b5263[_0xeb5087]['accountcode']=_0xa69b86[_0x6388('0x26')];_0x1b5263[_0xeb5087][_0x6388('0x2a')]=!![];_0x1b5263[_0xeb5087]['lastAssignedTo']=_0xa69b86[_0x6388('0x24')];_0x1b5263[_0xeb5087]['interface']=_[_0x6388('0x25')](_0xa69b86[_0x6388('0x27')])?util['format'](_0x6388('0x2b'),_0xa69b86[_0x6388('0x24')]):_0xa69b86[_0x6388('0x27')];if(_0x1b5263[_0xeb5087][_0x6388('0x2c')]){_0x1b5263[_0xeb5087][_0x6388('0x2d')]=moment()[_0x6388('0x28')](_0x6388('0x2e'));}if(_0x1b5263[_0xeb5087]['queuecallerexit']){_0x1b5263[_0xeb5087][_0x6388('0x2f')]=moment()[_0x6388('0x28')](_0x6388('0x2e'));}RpcMemberReport[_0x6388('0x15')](_0x1b5263[_0xeb5087]);}RpcVoiceQueueReport[_0x6388('0x30')](_0x1b5263[_0xeb5087]);}};function extractCalleridNumber(_0x236251){var _0x30a4d9=_0x236251['match'](/<(.*?)>/);return _0x30a4d9?_0x30a4d9[0x1]:_0x236251;}Report[_0x6388('0x21')][_0x6388('0x17')]=function(_0x259f96){_0x259f96[_0x6388('0x31')]=_0x259f96[_0x6388('0x31')]||_0x259f96[_0x6388('0x32')];if(_0x259f96[_0x6388('0x33')]==_0x6388('0x34')){_0x259f96[_0x6388('0x35')]=_0x6388('0x36');_0x259f96[_0x6388('0x37')]=_0x259f96[_0x6388('0x36')];if(_0x259f96['context']==_0x6388('0x38')){_0x259f96[_0x6388('0x26')]='';_0x259f96['destination']=extractCalleridNumber(_0x259f96['callerid']);}else if(_0x259f96['context']==_0x6388('0x39')){if(_0x259f96[_0x6388('0x31')]=='xcally-motion-preview'){_0x259f96['destination']=extractCalleridNumber(_0x259f96[_0x6388('0x3a')]);_0x259f96['calleridnum']=_0x259f96[_0x6388('0x3b')];_0x259f96[_0x6388('0x3c')]=[_0x259f96[_0x6388('0x3d')],_0x259f96[_0x6388('0x3d')]=_0x259f96[_0x6388('0x3c')]][0x0];_0x259f96[_0x6388('0x3e')]=_0x259f96[_0x6388('0x3a')];}else{_0x259f96[_0x6388('0x31')]=_0x259f96['calleridnum'];_0x259f96[_0x6388('0x3f')]=_0x259f96[_0x6388('0x3b')];if(_0x259f96['disposition']==_0x6388('0x40')){_0x259f96['accountcode']=_0x259f96[_0x6388('0x41')];}else{_0x259f96[_0x6388('0x26')]='';}}}}else{_0x259f96['callerid']=util['format']('\x22%s\x22\x20<%s>',_0x259f96[_0x6388('0x42')],_0x259f96[_0x6388('0x3f')]);}RpcVoiceCallReport[_0x6388('0x30')](_0x259f96);if(_0x259f96[_0x6388('0x43')]){for(var _0x2225d2=0x0;_0x2225d2<_0x259f96[_0x6388('0x44')]['length'];_0x2225d2+=0x1){_0x259f96[_0x6388('0x45')]=_0x259f96[_0x6388('0x44')][_0x2225d2][_0x6388('0x46')];_0x259f96['createdAt']=_0x259f96['monitors'][_0x2225d2]['createdAt'];if(_0x259f96[_0x6388('0x32')]=='xcally-motion-preview'){_0x259f96[_0x6388('0x3f')]=_0x259f96[_0x6388('0x41')];_0x259f96[_0x6388('0x42')]=_0x259f96[_0x6388('0x47')];_0x259f96[_0x6388('0x41')]=_0x259f96[_0x6388('0x26')];_0x259f96[_0x6388('0x47')]=_0x259f96[_0x6388('0x48')];_0x259f96['exten']=_0x259f96['originatecalleridnum'];}else if(_0x259f96[_0x6388('0x32')]==_0x6388('0x49')){_0x259f96[_0x6388('0x3f')]=_0x259f96[_0x6388('0x31')];_0x259f96[_0x6388('0x32')]=_0x259f96[_0x6388('0x3b')];}RpcVoiceRecording[_0x6388('0x30')](_0x259f96);}}};Report[_0x6388('0x21')][_0x6388('0x1a')]=function(_0x1c04a8){if(_['isArray'](_0x1c04a8)){_0x1c04a8['forEach'](function(_0x1bd958){RpcVoiceAgentReport[_0x6388('0x30')](_0x1bd958);});}else{RpcVoiceAgentReport[_0x6388('0x30')](_0x1c04a8);}};Report[_0x6388('0x21')][_0x6388('0x1c')]=function(_0x471b86){RpcVoiceDialReport[_0x6388('0x30')](_0x471b86);var _0x2aedc4=undefined;var _0x36eeb2=_0x471b86['channel'];if(_[_0x6388('0x4a')](_0x36eeb2,'Local')){var _0x495d1e=_0x36eeb2['substring'](_0x36eeb2[_0x6388('0x4b')]('/')+0x1,_0x36eeb2[_0x6388('0x4b')]('@'));_0x2aedc4=_['find'](this['agents'],function(_0x2186b2){return _0x2186b2[_0x6388('0x4c')]==_0x495d1e||_0x2186b2[_0x6388('0x4d')]==_0x495d1e||_0x2186b2[_0x6388('0x26')]==_0x495d1e;});}else{var _0x495d1e=_0x36eeb2['substring'](_0x36eeb2[_0x6388('0x4b')]('/')+0x1,_0x36eeb2[_0x6388('0x4e')]('-'));_0x2aedc4=this[_0x6388('0x22')](_0x495d1e);}if(_0x2aedc4){_0x471b86[_0x6388('0x27')]=_[_0x6388('0x25')](_0x2aedc4[_0x6388('0x27')])?util[_0x6388('0x28')](_0x6388('0x2b'),_0x2aedc4[_0x6388('0x24')]):_0x2aedc4[_0x6388('0x27')];_0x471b86[_0x6388('0x48')]=_0x2aedc4['name'];_0x471b86[_0x6388('0x26')]=_0x2aedc4[_0x6388('0x26')];RpcMemberReport['voiceDialReport'](_0x471b86);}};Report['prototype']['blindTransfer']=function(_0x4fbb22){RpcVoiceTransferReport['blindTransfer'](_0x4fbb22);};Report['prototype'][_0x6388('0x20')]=function(_0x1774e1){RpcVoiceTransferReport[_0x6388('0x20')](_0x1774e1);};module[_0x6388('0x4f')]=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index 2084d08..e6501bb 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 _0x6f5a=['telephone:save','name','startsWith','Local','substring','indexOf','phone','accountcode','error','[syncDeviceState][UserReport]','peer','registered','status','address','updateStatusRealtime','[syncPeerStatus][UserReport]','exports','bluebird','../../../config/environment','../../../config/logger','../ami','redis','localhost','trunks','agents','telephones','registryentry','syncRegistry','bind','registry','devicestatechange','syncDeviceState','peerstatus','syncPeerStatus','loopSyncRealTimeShow','resolve','then','actionSipShowRegistry','actionSipPeerStatus','catch','inspect','prototype','actionDeviceStateList','[loopSyncRealTimeShow]','isNotNull','isUndefined','emit','find','username','stateRegistry','merge','omit','actionid','format','trunk:save','[syncRegistry][UserReport]','device','local','state','toLowerCase','inuse','stateTime','toNumber','telephone:%s'];(function(_0x13114a,_0x3a35e8){var _0x18ac54=function(_0x258682){while(--_0x258682){_0x13114a['push'](_0x13114a['shift']());}};_0x18ac54(++_0x3a35e8);}(_0x6f5a,0x91));var _0xa6f5=function(_0x16630a,_0x3c9b0c){_0x16630a=_0x16630a-0x0;var _0x314e4e=_0x6f5a[_0x16630a];return _0x314e4e;};'use strict';var _=require('lodash');var moment=require('moment');var BPromise=require(_0xa6f5('0x0'));var util=require('util');var Redis=require('ioredis');var config=require(_0xa6f5('0x1'));var logger=require(_0xa6f5('0x2'))('ami');var ami=require(_0xa6f5('0x3'));config[_0xa6f5('0x4')]=_['defaults'](config[_0xa6f5('0x4')],{'host':_0xa6f5('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa6f5('0x4')]));function UserReport(_0x48678d){this[_0xa6f5('0x6')]=_0x48678d[_0xa6f5('0x6')];this['agents']=_0x48678d[_0xa6f5('0x7')];this[_0xa6f5('0x8')]=_0x48678d[_0xa6f5('0x8')];ami['on'](_0xa6f5('0x9'),this[_0xa6f5('0xa')][_0xa6f5('0xb')](this));ami['on'](_0xa6f5('0xc'),this['syncRegistry'][_0xa6f5('0xb')](this));ami['on'](_0xa6f5('0xd'),this[_0xa6f5('0xe')]['bind'](this));ami['on'](_0xa6f5('0xf'),this[_0xa6f5('0x10')][_0xa6f5('0xb')](this));this[_0xa6f5('0x11')]();return BPromise[_0xa6f5('0x12')]()[_0xa6f5('0x13')](ami[_0xa6f5('0x14')]())[_0xa6f5('0x13')](ami['actionDeviceStateList']())[_0xa6f5('0x13')](ami[_0xa6f5('0x15')]())[_0xa6f5('0x16')](loggerCatch('[loopSyncRealTimeShow]'));}function loggerCatch(_0x4590b0){return function(_0x32ca71){logger['error'](_0x4590b0,util[_0xa6f5('0x17')](_0x32ca71,{'showHidden':![],'depth':null}));};}UserReport[_0xa6f5('0x18')][_0xa6f5('0x11')]=function(){setInterval(function(){BPromise[_0xa6f5('0x12')]()[_0xa6f5('0x13')](ami[_0xa6f5('0x14')]())[_0xa6f5('0x13')](ami[_0xa6f5('0x19')]())[_0xa6f5('0x13')](ami[_0xa6f5('0x15')]())[_0xa6f5('0x16')](loggerCatch(_0xa6f5('0x1a')));},0x32c8);};UserReport[_0xa6f5('0x18')][_0xa6f5('0x1b')]=function(_0x2a9680){return _0x2a9680!==null&&!_[_0xa6f5('0x1c')](_0x2a9680);};UserReport[_0xa6f5('0x18')][_0xa6f5('0x1d')]=function(_0x25add4,_0xc3c3d6,_0x3ad154){io['to'](_0x25add4)[_0xa6f5('0x1d')](_0xc3c3d6,_0x3ad154);};UserReport['prototype'][_0xa6f5('0xa')]=function(_0x45030e){try{if(this[_0xa6f5('0x1b')](_0x45030e)){var _0x2a5b84=_[_0xa6f5('0x1e')](this['trunks'],{'registry':_0x45030e[_0xa6f5('0x1f')]});if(_0x2a5b84){_0x45030e[_0xa6f5('0x20')]=_0x45030e['state'];_[_0xa6f5('0x21')](_0x2a5b84,_[_0xa6f5('0x22')](_0x45030e,['event',_0xa6f5('0x23'),'username','state']));this[_0xa6f5('0x1d')](util[_0xa6f5('0x24')]('trunk:%s',_0x2a5b84['name']),_0xa6f5('0x25'),_0x2a5b84);}}}catch(_0x4c79d9){logger['error'](_0xa6f5('0x26'),util['inspect'](_0x4c79d9,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0xa6f5('0xe')]=function(_0x1644b2){try{if(this[_0xa6f5('0x1b')](_0x1644b2)){if(this[_0xa6f5('0x7')][_0x1644b2[_0xa6f5('0x27')]]){if(!this['agents'][_0x1644b2['device']][_0xa6f5('0x28')]||_0x1644b2[_0xa6f5('0x29')][_0xa6f5('0x2a')]()==_0xa6f5('0x2b')){this[_0xa6f5('0x7')][_0x1644b2[_0xa6f5('0x27')]][_0xa6f5('0x28')]=![];if(this['agents'][_0x1644b2[_0xa6f5('0x27')]][_0xa6f5('0x29')]!==_0x1644b2[_0xa6f5('0x29')][_0xa6f5('0x2a')]()){this[_0xa6f5('0x7')][_0x1644b2[_0xa6f5('0x27')]][_0xa6f5('0x2c')]=_['toNumber'](moment()[_0xa6f5('0x24')]('x'));}this[_0xa6f5('0x7')][_0x1644b2['device']][_0xa6f5('0x29')]=_0x1644b2['state'][_0xa6f5('0x2a')]();this['agents'][_0x1644b2[_0xa6f5('0x27')]]['updateStatusRealtime'](_0x1644b2);}}else if(this['telephones'][_0x1644b2[_0xa6f5('0x27')]]){if(this[_0xa6f5('0x8')][_0x1644b2[_0xa6f5('0x27')]][_0xa6f5('0x29')]!==_0x1644b2[_0xa6f5('0x29')][_0xa6f5('0x2a')]()){this['telephones'][_0x1644b2[_0xa6f5('0x27')]]['stateTime']=_[_0xa6f5('0x2d')](moment()[_0xa6f5('0x24')]('x'));}this[_0xa6f5('0x8')][_0x1644b2[_0xa6f5('0x27')]][_0xa6f5('0x29')]=_0x1644b2['state'][_0xa6f5('0x2a')]();this[_0xa6f5('0x1d')](util[_0xa6f5('0x24')](_0xa6f5('0x2e'),this[_0xa6f5('0x8')][_0x1644b2['device']]['name']),_0xa6f5('0x2f'),this[_0xa6f5('0x8')][_0x1644b2[_0xa6f5('0x27')]]);}else if(this[_0xa6f5('0x6')][_0x1644b2['device']]){if(this[_0xa6f5('0x6')][_0x1644b2[_0xa6f5('0x27')]][_0xa6f5('0x29')]!==_0x1644b2[_0xa6f5('0x29')][_0xa6f5('0x2a')]()){this['trunks'][_0x1644b2[_0xa6f5('0x27')]][_0xa6f5('0x2c')]=_[_0xa6f5('0x2d')](moment()['format']('x'));}this[_0xa6f5('0x6')][_0x1644b2[_0xa6f5('0x27')]][_0xa6f5('0x29')]=_0x1644b2[_0xa6f5('0x29')][_0xa6f5('0x2a')]();this['emit'](util['format']('trunk:%s',this[_0xa6f5('0x6')][_0x1644b2[_0xa6f5('0x27')]][_0xa6f5('0x30')]),_0xa6f5('0x25'),this[_0xa6f5('0x6')][_0x1644b2[_0xa6f5('0x27')]]);}else if(_[_0xa6f5('0x31')](_0x1644b2[_0xa6f5('0x27')],'Queue')){}else if(_['startsWith'](_0x1644b2[_0xa6f5('0x27')],_0xa6f5('0x32'))){var _0x3a4839=_0x1644b2[_0xa6f5('0x27')];var _0x479d3b=_0x3a4839[_0xa6f5('0x33')](_0x3a4839[_0xa6f5('0x34')]('/')+0x1,_0x3a4839[_0xa6f5('0x34')]('@'));var _0xfde966=_[_0xa6f5('0x1e')](this[_0xa6f5('0x7')],function(_0x49c7d5){return _0x49c7d5['mobile']==_0x479d3b||_0x49c7d5[_0xa6f5('0x35')]==_0x479d3b||_0x49c7d5[_0xa6f5('0x36')]==_0x479d3b;});if(_0xfde966){if(_0xfde966[_0xa6f5('0x29')]!==_0x1644b2[_0xa6f5('0x29')][_0xa6f5('0x2a')]()){_0xfde966[_0xa6f5('0x2c')]=_['toNumber'](moment()[_0xa6f5('0x24')]('x'));}_0xfde966['state']=_0x1644b2[_0xa6f5('0x29')][_0xa6f5('0x2a')]();_0xfde966[_0xa6f5('0x28')]=!![];_0xfde966['updateStatusRealtime'](_0x1644b2);}}else{}}}catch(_0x3fe115){logger[_0xa6f5('0x37')](_0xa6f5('0x38'),util[_0xa6f5('0x17')](_0x3fe115,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0xa6f5('0x10')]=function(_0x561975){try{if(this[_0xa6f5('0x1b')](_0x561975)&&this[_0xa6f5('0x1b')](_0x561975[_0xa6f5('0xf')])){if(this['agents'][_0x561975[_0xa6f5('0x39')]]){if(!this[_0xa6f5('0x7')][_0x561975['peer']][_0xa6f5('0x28')]||_0x561975['peerstatus'][_0xa6f5('0x2a')]()==_0xa6f5('0x3a')){this[_0xa6f5('0x7')][_0x561975['peer']][_0xa6f5('0x28')]=![];this[_0xa6f5('0x7')][_0x561975[_0xa6f5('0x39')]][_0xa6f5('0x3b')]=_0x561975[_0xa6f5('0xf')][_0xa6f5('0x2a')]();this[_0xa6f5('0x7')][_0x561975[_0xa6f5('0x39')]][_0xa6f5('0x3c')]=_0x561975[_0xa6f5('0x3c')];this[_0xa6f5('0x7')][_0x561975[_0xa6f5('0x39')]][_0xa6f5('0x3d')](_0x561975);}}else if(this['telephones'][_0x561975['peer']]){this[_0xa6f5('0x8')][_0x561975['peer']][_0xa6f5('0x3b')]=_0x561975[_0xa6f5('0xf')]['toLowerCase']();this[_0xa6f5('0x8')][_0x561975[_0xa6f5('0x39')]]['address']=_0x561975[_0xa6f5('0x3c')];this['emit'](util[_0xa6f5('0x24')](_0xa6f5('0x2e'),this[_0xa6f5('0x8')][_0x561975[_0xa6f5('0x39')]][_0xa6f5('0x30')]),_0xa6f5('0x2f'),this['telephones'][_0x561975[_0xa6f5('0x39')]]);}else if(this[_0xa6f5('0x6')][_0x561975['peer']]){this[_0xa6f5('0x6')][_0x561975[_0xa6f5('0x39')]]['status']=_0x561975[_0xa6f5('0xf')]['toLowerCase']();this[_0xa6f5('0x6')][_0x561975[_0xa6f5('0x39')]][_0xa6f5('0x3c')]=_0x561975['address'];this[_0xa6f5('0x1d')](util[_0xa6f5('0x24')]('trunk:%s',this[_0xa6f5('0x6')][_0x561975[_0xa6f5('0x39')]][_0xa6f5('0x30')]),_0xa6f5('0x25'),this[_0xa6f5('0x6')][_0x561975[_0xa6f5('0x39')]]);}else{}}}catch(_0x51896d){logger['error'](_0xa6f5('0x3e'),util[_0xa6f5('0x17')](_0x51896d,{'showHidden':![],'depth':null}));}};module[_0xa6f5('0x3f')]=UserReport; \ No newline at end of file +var _0xaa1a=['find','mobile','phone','accountcode','error','[syncDeviceState][UserReport]','peer','registered','status','address','[syncPeerStatus][UserReport]','lodash','moment','bluebird','../../../config/environment','../../../config/logger','../ami','defaults','redis','localhost','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','bind','registry','syncDeviceState','peerstatus','syncPeerStatus','resolve','then','actionSipShowRegistry','actionSipPeerStatus','catch','[loopSyncRealTimeShow]','inspect','prototype','actionDeviceStateList','isNotNull','emit','username','stateRegistry','state','merge','omit','name','trunk:save','[syncRegistry][UserReport]','device','toLowerCase','inuse','local','stateTime','toNumber','format','updateStatusRealtime','telephone:%s','telephone:save','trunk:%s','startsWith','Queue','Local','substring','indexOf'];(function(_0x3d9f9d,_0x40d259){var _0xc90558=function(_0x2cfd84){while(--_0x2cfd84){_0x3d9f9d['push'](_0x3d9f9d['shift']());}};_0xc90558(++_0x40d259);}(_0xaa1a,0x1d9));var _0xaaa1=function(_0x17a32f,_0x5a51a){_0x17a32f=_0x17a32f-0x0;var _0x15a293=_0xaa1a[_0x17a32f];return _0x15a293;};'use strict';var _=require(_0xaaa1('0x0'));var moment=require(_0xaaa1('0x1'));var BPromise=require(_0xaaa1('0x2'));var util=require('util');var Redis=require('ioredis');var config=require(_0xaaa1('0x3'));var logger=require(_0xaaa1('0x4'))('ami');var ami=require(_0xaaa1('0x5'));config['redis']=_[_0xaaa1('0x6')](config[_0xaaa1('0x7')],{'host':_0xaaa1('0x8'),'port':0x18eb});var io=require(_0xaaa1('0x9'))(new Redis(config[_0xaaa1('0x7')]));function UserReport(_0x5a0bb5){this[_0xaaa1('0xa')]=_0x5a0bb5[_0xaaa1('0xa')];this[_0xaaa1('0xb')]=_0x5a0bb5[_0xaaa1('0xb')];this[_0xaaa1('0xc')]=_0x5a0bb5['telephones'];ami['on'](_0xaaa1('0xd'),this[_0xaaa1('0xe')][_0xaaa1('0xf')](this));ami['on'](_0xaaa1('0x10'),this['syncRegistry'][_0xaaa1('0xf')](this));ami['on']('devicestatechange',this[_0xaaa1('0x11')][_0xaaa1('0xf')](this));ami['on'](_0xaaa1('0x12'),this[_0xaaa1('0x13')][_0xaaa1('0xf')](this));this['loopSyncRealTimeShow']();return BPromise[_0xaaa1('0x14')]()[_0xaaa1('0x15')](ami[_0xaaa1('0x16')]())[_0xaaa1('0x15')](ami['actionDeviceStateList']())[_0xaaa1('0x15')](ami[_0xaaa1('0x17')]())[_0xaaa1('0x18')](loggerCatch(_0xaaa1('0x19')));}function loggerCatch(_0x2e5d63){return function(_0xf7a0a1){logger['error'](_0x2e5d63,util[_0xaaa1('0x1a')](_0xf7a0a1,{'showHidden':![],'depth':null}));};}UserReport[_0xaaa1('0x1b')]['loopSyncRealTimeShow']=function(){setInterval(function(){BPromise[_0xaaa1('0x14')]()[_0xaaa1('0x15')](ami[_0xaaa1('0x16')]())[_0xaaa1('0x15')](ami[_0xaaa1('0x1c')]())[_0xaaa1('0x15')](ami[_0xaaa1('0x17')]())['catch'](loggerCatch(_0xaaa1('0x19')));},0x32c8);};UserReport[_0xaaa1('0x1b')][_0xaaa1('0x1d')]=function(_0x3d5842){return _0x3d5842!==null&&!_['isUndefined'](_0x3d5842);};UserReport[_0xaaa1('0x1b')][_0xaaa1('0x1e')]=function(_0x12aacc,_0xaa8c6d,_0x18b7e7){io['to'](_0x12aacc)[_0xaaa1('0x1e')](_0xaa8c6d,_0x18b7e7);};UserReport[_0xaaa1('0x1b')][_0xaaa1('0xe')]=function(_0x49670b){try{if(this[_0xaaa1('0x1d')](_0x49670b)){var _0x458e27=_['find'](this['trunks'],{'registry':_0x49670b[_0xaaa1('0x1f')]});if(_0x458e27){_0x49670b[_0xaaa1('0x20')]=_0x49670b[_0xaaa1('0x21')];_[_0xaaa1('0x22')](_0x458e27,_[_0xaaa1('0x23')](_0x49670b,['event','actionid','username',_0xaaa1('0x21')]));this[_0xaaa1('0x1e')](util['format']('trunk:%s',_0x458e27[_0xaaa1('0x24')]),_0xaaa1('0x25'),_0x458e27);}}}catch(_0x3ffa5f){logger['error'](_0xaaa1('0x26'),util[_0xaaa1('0x1a')](_0x3ffa5f,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0xaaa1('0x11')]=function(_0x1ea7ff){try{if(this[_0xaaa1('0x1d')](_0x1ea7ff)){if(this[_0xaaa1('0xb')][_0x1ea7ff[_0xaaa1('0x27')]]){if(!this[_0xaaa1('0xb')][_0x1ea7ff[_0xaaa1('0x27')]]['local']||_0x1ea7ff[_0xaaa1('0x21')][_0xaaa1('0x28')]()==_0xaaa1('0x29')){this[_0xaaa1('0xb')][_0x1ea7ff[_0xaaa1('0x27')]][_0xaaa1('0x2a')]=![];if(this[_0xaaa1('0xb')][_0x1ea7ff[_0xaaa1('0x27')]][_0xaaa1('0x21')]!==_0x1ea7ff['state']['toLowerCase']()){this[_0xaaa1('0xb')][_0x1ea7ff[_0xaaa1('0x27')]][_0xaaa1('0x2b')]=_[_0xaaa1('0x2c')](moment()[_0xaaa1('0x2d')]('x'));}this['agents'][_0x1ea7ff['device']][_0xaaa1('0x21')]=_0x1ea7ff[_0xaaa1('0x21')]['toLowerCase']();this[_0xaaa1('0xb')][_0x1ea7ff[_0xaaa1('0x27')]][_0xaaa1('0x2e')](_0x1ea7ff);}}else if(this['telephones'][_0x1ea7ff[_0xaaa1('0x27')]]){if(this['telephones'][_0x1ea7ff[_0xaaa1('0x27')]]['state']!==_0x1ea7ff['state']['toLowerCase']()){this[_0xaaa1('0xc')][_0x1ea7ff[_0xaaa1('0x27')]][_0xaaa1('0x2b')]=_['toNumber'](moment()[_0xaaa1('0x2d')]('x'));}this[_0xaaa1('0xc')][_0x1ea7ff['device']]['state']=_0x1ea7ff[_0xaaa1('0x21')][_0xaaa1('0x28')]();this['emit'](util[_0xaaa1('0x2d')](_0xaaa1('0x2f'),this['telephones'][_0x1ea7ff[_0xaaa1('0x27')]][_0xaaa1('0x24')]),_0xaaa1('0x30'),this[_0xaaa1('0xc')][_0x1ea7ff[_0xaaa1('0x27')]]);}else if(this['trunks'][_0x1ea7ff[_0xaaa1('0x27')]]){if(this['trunks'][_0x1ea7ff[_0xaaa1('0x27')]][_0xaaa1('0x21')]!==_0x1ea7ff[_0xaaa1('0x21')][_0xaaa1('0x28')]()){this[_0xaaa1('0xa')][_0x1ea7ff['device']][_0xaaa1('0x2b')]=_[_0xaaa1('0x2c')](moment()[_0xaaa1('0x2d')]('x'));}this[_0xaaa1('0xa')][_0x1ea7ff[_0xaaa1('0x27')]][_0xaaa1('0x21')]=_0x1ea7ff[_0xaaa1('0x21')][_0xaaa1('0x28')]();this[_0xaaa1('0x1e')](util[_0xaaa1('0x2d')](_0xaaa1('0x31'),this[_0xaaa1('0xa')][_0x1ea7ff[_0xaaa1('0x27')]]['name']),_0xaaa1('0x25'),this['trunks'][_0x1ea7ff[_0xaaa1('0x27')]]);}else if(_[_0xaaa1('0x32')](_0x1ea7ff[_0xaaa1('0x27')],_0xaaa1('0x33'))){}else if(_[_0xaaa1('0x32')](_0x1ea7ff[_0xaaa1('0x27')],_0xaaa1('0x34'))){var _0x186bb5=_0x1ea7ff['device'];var _0x374b9d=_0x186bb5[_0xaaa1('0x35')](_0x186bb5[_0xaaa1('0x36')]('/')+0x1,_0x186bb5['indexOf']('@'));var _0x342dac=_[_0xaaa1('0x37')](this[_0xaaa1('0xb')],function(_0x1d96d3){return _0x1d96d3[_0xaaa1('0x38')]==_0x374b9d||_0x1d96d3[_0xaaa1('0x39')]==_0x374b9d||_0x1d96d3[_0xaaa1('0x3a')]==_0x374b9d;});if(_0x342dac){if(_0x342dac[_0xaaa1('0x21')]!==_0x1ea7ff['state'][_0xaaa1('0x28')]()){_0x342dac[_0xaaa1('0x2b')]=_[_0xaaa1('0x2c')](moment()[_0xaaa1('0x2d')]('x'));}_0x342dac[_0xaaa1('0x21')]=_0x1ea7ff[_0xaaa1('0x21')]['toLowerCase']();_0x342dac[_0xaaa1('0x2a')]=!![];_0x342dac[_0xaaa1('0x2e')](_0x1ea7ff);}}else{}}}catch(_0x184712){logger[_0xaaa1('0x3b')](_0xaaa1('0x3c'),util[_0xaaa1('0x1a')](_0x184712,{'showHidden':![],'depth':null}));}};UserReport[_0xaaa1('0x1b')][_0xaaa1('0x13')]=function(_0x1e5a21){try{if(this[_0xaaa1('0x1d')](_0x1e5a21)&&this[_0xaaa1('0x1d')](_0x1e5a21['peerstatus'])){if(this[_0xaaa1('0xb')][_0x1e5a21[_0xaaa1('0x3d')]]){if(!this['agents'][_0x1e5a21[_0xaaa1('0x3d')]]['local']||_0x1e5a21[_0xaaa1('0x12')][_0xaaa1('0x28')]()==_0xaaa1('0x3e')){this[_0xaaa1('0xb')][_0x1e5a21[_0xaaa1('0x3d')]][_0xaaa1('0x2a')]=![];this[_0xaaa1('0xb')][_0x1e5a21[_0xaaa1('0x3d')]][_0xaaa1('0x3f')]=_0x1e5a21[_0xaaa1('0x12')]['toLowerCase']();this['agents'][_0x1e5a21[_0xaaa1('0x3d')]][_0xaaa1('0x40')]=_0x1e5a21[_0xaaa1('0x40')];this[_0xaaa1('0xb')][_0x1e5a21[_0xaaa1('0x3d')]][_0xaaa1('0x2e')](_0x1e5a21);}}else if(this[_0xaaa1('0xc')][_0x1e5a21[_0xaaa1('0x3d')]]){this[_0xaaa1('0xc')][_0x1e5a21[_0xaaa1('0x3d')]][_0xaaa1('0x3f')]=_0x1e5a21[_0xaaa1('0x12')][_0xaaa1('0x28')]();this['telephones'][_0x1e5a21[_0xaaa1('0x3d')]][_0xaaa1('0x40')]=_0x1e5a21[_0xaaa1('0x40')];this[_0xaaa1('0x1e')](util['format'](_0xaaa1('0x2f'),this[_0xaaa1('0xc')][_0x1e5a21[_0xaaa1('0x3d')]][_0xaaa1('0x24')]),_0xaaa1('0x30'),this[_0xaaa1('0xc')][_0x1e5a21[_0xaaa1('0x3d')]]);}else if(this[_0xaaa1('0xa')][_0x1e5a21[_0xaaa1('0x3d')]]){this[_0xaaa1('0xa')][_0x1e5a21['peer']][_0xaaa1('0x3f')]=_0x1e5a21[_0xaaa1('0x12')][_0xaaa1('0x28')]();this[_0xaaa1('0xa')][_0x1e5a21[_0xaaa1('0x3d')]][_0xaaa1('0x40')]=_0x1e5a21[_0xaaa1('0x40')];this[_0xaaa1('0x1e')](util[_0xaaa1('0x2d')]('trunk:%s',this['trunks'][_0x1e5a21[_0xaaa1('0x3d')]]['name']),_0xaaa1('0x25'),this[_0xaaa1('0xa')][_0x1e5a21['peer']]);}else{}}}catch(_0x2d8dea){logger['error'](_0xaaa1('0x41'),util['inspect'](_0x2d8dea,{'showHidden':![],'depth':null}));}};module['exports']=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index 5334b98..06a0e1b 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 _0x4a40=['diff','seconds','secondtransfereruniqueid','[syncAttendedTransfer][VoiceAgentReport]','syncBlindTransfer','transfereruniqueid','channel','substring','lastIndexOf','[syncMusicOnHoldStart][VoiceAgentReport]','onhold','[syncMusicOnHoldStop][VoiceAgentReport]','exports','lodash','moment','util','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','channels','voiceQueues','agents','syncAgentCalled','agentconnect','syncAgentConnect','agentringnoanswer','bind','agentcomplete','syncAgentComplete','varset','hangup','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','prototype','emit','isNotNull','isUndefined','uniqueid','destuniqueid','YYYY-MM-DD\x20HH:mm:ss','called','variables','type','inbound','event','privilege','custom:agentcalled','format','user:%s','user:called','error','[syncAgentCalled][VoiceAgentReport]','inspect','agentconnectAt','connect','holdtime','connectedlinenum','connectedlinename','destchannelstate','destchannelstatedesc','queue','destconnectedlinenum','membername','user:agentconnect','custom:agentconnect','agentringnoanswerAt','reason','answered_elsewhere','lastevent','answeredelsewheredestinationuniqueid','answeredelsewheremembername','syncAgentRingNoAnswer','rejected','custom:agentringnoanswer','[syncAgentRingNoAnswer][VoiceAgentReport]','syncQueueCallerAbandon','hasOwnProperty','abandoned','custom:agentqueuecallerabandon','[syncQueueCallerAbandon][VoiceAgentReport]','complete','transfer','acw','acwtime','acwTimeout','interface','omit','user:agentcomplete','custom:agentcomplete','[syncAgentComplete][VoiceAgentReport]','addVariable','keys','variable','value','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','bridgepeer','membercalls','memberdynamic','memberlastcall','memberpenalty','isNil','includes','syncHangup','agentcompleteAt','custom:voiceAgentReport','values','transfereeuniqueid','origtransfereruniqueid','talktime'];(function(_0x3026bf,_0x599a68){var _0x291a7f=function(_0x3935ef){while(--_0x3935ef){_0x3026bf['push'](_0x3026bf['shift']());}};_0x291a7f(++_0x599a68);}(_0x4a40,0x17e));var _0x04a4=function(_0x2c0fe4,_0x3c60cc){_0x2c0fe4=_0x2c0fe4-0x0;var _0x19c3ed=_0x4a40[_0x2c0fe4];return _0x19c3ed;};'use strict';var _=require(_0x04a4('0x0'));var moment=require(_0x04a4('0x1'));var util=require(_0x04a4('0x2'));var Redis=require('ioredis');var config=require(_0x04a4('0x3'));var logger=require(_0x04a4('0x4'))(_0x04a4('0x5'));var ami=require(_0x04a4('0x6'));config[_0x04a4('0x7')]=_[_0x04a4('0x8')](config[_0x04a4('0x7')],{'host':_0x04a4('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x04a4('0x7')]));function VoiceAgentReport(_0x27dec5){this[_0x04a4('0xa')]={};this[_0x04a4('0xb')]=_0x27dec5[_0x04a4('0xb')];this[_0x04a4('0xc')]=_0x27dec5[_0x04a4('0xc')];this['variables']={};ami['on']('agentcalled',this[_0x04a4('0xd')]['bind'](this));ami['on'](_0x04a4('0xe'),this[_0x04a4('0xf')]['bind'](this));ami['on'](_0x04a4('0x10'),this['syncAgentRingNoAnswer'][_0x04a4('0x11')](this));ami['on']('queuecallerabandon',this['syncQueueCallerAbandon'][_0x04a4('0x11')](this));ami['on'](_0x04a4('0x12'),this[_0x04a4('0x13')][_0x04a4('0x11')](this));ami['on'](_0x04a4('0x14'),this['syncVarSet'][_0x04a4('0x11')](this));ami['on'](_0x04a4('0x15'),this['syncHangup']['bind'](this));ami['on']('musiconholdstart',this[_0x04a4('0x16')][_0x04a4('0x11')](this));ami['on'](_0x04a4('0x17'),this[_0x04a4('0x18')][_0x04a4('0x11')](this));ami['on'](_0x04a4('0x19'),this[_0x04a4('0x1a')][_0x04a4('0x11')](this));ami['on'](_0x04a4('0x1b'),this['syncBlindTransfer'][_0x04a4('0x11')](this));}VoiceAgentReport[_0x04a4('0x1c')][_0x04a4('0x1d')]=function(_0x30f841,_0x31a59a,_0xf79ec2){io['to'](_0x30f841)[_0x04a4('0x1d')](_0x31a59a,_0xf79ec2);};VoiceAgentReport[_0x04a4('0x1c')][_0x04a4('0x1e')]=function(_0x5c83b3){return _0x5c83b3!==null&&!_[_0x04a4('0x1f')](_0x5c83b3);};VoiceAgentReport[_0x04a4('0x1c')][_0x04a4('0xd')]=function(_0x47753e){try{if(this[_0x04a4('0x1e')](_0x47753e)){if(_[_0x04a4('0x1f')](this[_0x04a4('0xa')][_0x47753e['uniqueid']])){this['channels'][_0x47753e[_0x04a4('0x20')]]={};}if(_[_0x04a4('0x1f')](this[_0x04a4('0xa')][_0x47753e[_0x04a4('0x20')]][_0x47753e[_0x04a4('0x21')]])){this['channels'][_0x47753e['uniqueid']][_0x47753e['destuniqueid']]={'agentcalledAt':moment()['format'](_0x04a4('0x22')),'lastevent':_0x04a4('0x23'),'variables':this[_0x04a4('0x24')][_0x47753e[_0x04a4('0x20')]],'type':this[_0x04a4('0xb')][_0x47753e['queue']]?this[_0x04a4('0xb')][_0x47753e['queue']][_0x04a4('0x25')]||_0x04a4('0x26'):_0x04a4('0x26')};}_['merge'](this[_0x04a4('0xa')][_0x47753e[_0x04a4('0x20')]][_0x47753e[_0x04a4('0x21')]],_['omit'](_0x47753e,[_0x04a4('0x27'),_0x04a4('0x28')]));ami[_0x04a4('0x1d')](_0x04a4('0x29'),this[_0x04a4('0xa')][_0x47753e[_0x04a4('0x20')]][_0x47753e[_0x04a4('0x21')]]);this[_0x04a4('0x1d')](util[_0x04a4('0x2a')](_0x04a4('0x2b'),_0x47753e['membername']),_0x04a4('0x2c'),this['channels'][_0x47753e[_0x04a4('0x20')]][_0x47753e[_0x04a4('0x21')]]);}}catch(_0x58dc39){logger[_0x04a4('0x2d')](_0x04a4('0x2e'),util[_0x04a4('0x2f')](_0x58dc39,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x04a4('0x1c')][_0x04a4('0xf')]=function(_0x3ef2bf){try{if(this[_0x04a4('0x1e')](_0x3ef2bf)){if(this[_0x04a4('0xa')][_0x3ef2bf['uniqueid']]){for(var _0x2056c1 in this['channels'][_0x3ef2bf[_0x04a4('0x20')]]){if(this[_0x04a4('0xa')][_0x3ef2bf[_0x04a4('0x20')]]['hasOwnProperty'](_0x2056c1)){if(_0x3ef2bf['destuniqueid']===_0x2056c1){this['channels'][_0x3ef2bf[_0x04a4('0x20')]][_0x2056c1][_0x04a4('0x30')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x04a4('0xa')][_0x3ef2bf[_0x04a4('0x20')]][_0x2056c1]['lastevent']=_0x04a4('0x31');this['channels'][_0x3ef2bf[_0x04a4('0x20')]][_0x2056c1][_0x04a4('0x32')]=_0x3ef2bf[_0x04a4('0x32')];this[_0x04a4('0xa')][_0x3ef2bf[_0x04a4('0x20')]][_0x2056c1][_0x04a4('0x33')]=_0x3ef2bf['connectedlinenum'];this[_0x04a4('0xa')][_0x3ef2bf[_0x04a4('0x20')]][_0x2056c1][_0x04a4('0x34')]=_0x3ef2bf[_0x04a4('0x34')];this[_0x04a4('0xa')][_0x3ef2bf['uniqueid']][_0x2056c1][_0x04a4('0x35')]=_0x3ef2bf['destchannelstate'];this[_0x04a4('0xa')][_0x3ef2bf[_0x04a4('0x20')]][_0x2056c1][_0x04a4('0x36')]=_0x3ef2bf[_0x04a4('0x36')];_['merge'](this[_0x04a4('0xc')][_0x3ef2bf['interface']],_['pick'](_0x3ef2bf,[_0x04a4('0x37'),_0x04a4('0x38')]));this[_0x04a4('0x1d')](util['format'](_0x04a4('0x2b'),_0x3ef2bf[_0x04a4('0x39')]),_0x04a4('0x3a'),this[_0x04a4('0xa')][_0x3ef2bf[_0x04a4('0x20')]][_0x3ef2bf[_0x04a4('0x21')]]);ami['emit'](_0x04a4('0x3b'),this[_0x04a4('0xa')][_0x3ef2bf[_0x04a4('0x20')]][_0x2056c1]);}else if(!this[_0x04a4('0xa')][_0x3ef2bf['uniqueid']][_0x2056c1][_0x04a4('0x10')]&&!this[_0x04a4('0xa')][_0x3ef2bf['uniqueid']][_0x2056c1][_0x04a4('0x12')]){this['channels'][_0x3ef2bf[_0x04a4('0x20')]][_0x2056c1][_0x04a4('0x10')]=!![];this[_0x04a4('0xa')][_0x3ef2bf[_0x04a4('0x20')]][_0x2056c1][_0x04a4('0x3c')]=moment()[_0x04a4('0x2a')](_0x04a4('0x22'));this[_0x04a4('0xa')][_0x3ef2bf['uniqueid']][_0x2056c1][_0x04a4('0x3d')]=_0x04a4('0x3e');this[_0x04a4('0xa')][_0x3ef2bf[_0x04a4('0x20')]][_0x2056c1][_0x04a4('0x3f')]=_0x04a4('0x3e');this[_0x04a4('0xa')][_0x3ef2bf['uniqueid']][_0x2056c1][_0x04a4('0x40')]=_0x3ef2bf['destuniqueid'];this['channels'][_0x3ef2bf[_0x04a4('0x20')]][_0x2056c1][_0x04a4('0x41')]=_0x3ef2bf['membername'];ami[_0x04a4('0x1d')]('custom:agentansweredelsewhere',this[_0x04a4('0xa')][_0x3ef2bf['uniqueid']][_0x2056c1]);}}}}}}catch(_0x2b82d2){logger[_0x04a4('0x2d')]('[syncAgentConnect][VoiceAgentReport]',util['inspect'](_0x2b82d2,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x04a4('0x42')]=function(_0xc6036){try{if(this['isNotNull'](_0xc6036)){if(this[_0x04a4('0xa')][_0xc6036[_0x04a4('0x20')]]&&this['channels'][_0xc6036['uniqueid']][_0xc6036[_0x04a4('0x21')]]){this[_0x04a4('0xa')][_0xc6036[_0x04a4('0x20')]][_0xc6036[_0x04a4('0x21')]][_0x04a4('0x10')]=!![];this['channels'][_0xc6036[_0x04a4('0x20')]][_0xc6036[_0x04a4('0x21')]][_0x04a4('0x3c')]=moment()[_0x04a4('0x2a')](_0x04a4('0x22'));this[_0x04a4('0xa')][_0xc6036['uniqueid']][_0xc6036[_0x04a4('0x21')]]['reason']=_0x04a4('0x43');this['channels'][_0xc6036[_0x04a4('0x20')]][_0xc6036[_0x04a4('0x21')]]['lastevent']=_0x04a4('0x43');ami[_0x04a4('0x1d')](_0x04a4('0x44'),this[_0x04a4('0xa')][_0xc6036[_0x04a4('0x20')]][_0xc6036['destuniqueid']]);}}}catch(_0x46a5e6){logger[_0x04a4('0x2d')](_0x04a4('0x45'),util[_0x04a4('0x2f')](_0x46a5e6,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x04a4('0x1c')][_0x04a4('0x46')]=function(_0xc6c4ee){try{if(this[_0x04a4('0x1e')](_0xc6c4ee)){if(this['channels'][_0xc6c4ee[_0x04a4('0x20')]]){for(var _0x39662c in this['channels'][_0xc6c4ee[_0x04a4('0x20')]]){if(this[_0x04a4('0xa')][_0xc6c4ee[_0x04a4('0x20')]][_0x04a4('0x47')](_0x39662c)&&!this['channels'][_0xc6c4ee[_0x04a4('0x20')]][_0x39662c][_0x04a4('0x10')]&&!this[_0x04a4('0xa')][_0xc6c4ee[_0x04a4('0x20')]][_0x39662c][_0x04a4('0x12')]){this['channels'][_0xc6c4ee[_0x04a4('0x20')]][_0x39662c][_0x04a4('0x10')]=!![];this[_0x04a4('0xa')][_0xc6c4ee[_0x04a4('0x20')]][_0x39662c][_0x04a4('0x3c')]=moment()[_0x04a4('0x2a')](_0x04a4('0x22'));this['channels'][_0xc6c4ee['uniqueid']][_0x39662c][_0x04a4('0x3d')]=_0x04a4('0x48');this[_0x04a4('0xa')][_0xc6c4ee[_0x04a4('0x20')]][_0x39662c]['lastevent']='abandoned';ami[_0x04a4('0x1d')](_0x04a4('0x49'),this[_0x04a4('0xa')][_0xc6c4ee[_0x04a4('0x20')]][_0x39662c]);}}}}}catch(_0x24539a){logger['error'](_0x04a4('0x4a'),util[_0x04a4('0x2f')](_0x24539a,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x04a4('0x1c')][_0x04a4('0x13')]=function(_0x15e550){try{if(this[_0x04a4('0x1e')](_0x15e550)){if(this[_0x04a4('0xa')][_0x15e550[_0x04a4('0x20')]]){for(var _0x190172 in this[_0x04a4('0xa')][_0x15e550[_0x04a4('0x20')]]){if(this['channels'][_0x15e550[_0x04a4('0x20')]][_0x04a4('0x47')](_0x190172)){if(this['channels'][_0x15e550[_0x04a4('0x20')]][_0x190172]['agentconnectAt']&&!this[_0x04a4('0xa')][_0x15e550['uniqueid']][_0x190172][_0x04a4('0x12')]){this['channels'][_0x15e550[_0x04a4('0x20')]][_0x190172]['agentcomplete']=!![];this[_0x04a4('0xa')][_0x15e550['uniqueid']][_0x190172]['agentcompleteAt']=moment()[_0x04a4('0x2a')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x04a4('0xa')][_0x15e550[_0x04a4('0x20')]][_0x190172][_0x04a4('0x3f')]=_0x04a4('0x4b');this['channels'][_0x15e550[_0x04a4('0x20')]][_0x190172]['talktime']=_0x15e550['talktime'];this[_0x04a4('0xa')][_0x15e550[_0x04a4('0x20')]][_0x190172][_0x04a4('0x3d')]=_0x15e550[_0x04a4('0x3d')]==_0x04a4('0x4c')?'agent':_0x15e550[_0x04a4('0x3d')];if(this[_0x04a4('0xb')][_0x15e550['queue']]&&this[_0x04a4('0xb')][_0x15e550['queue']][_0x04a4('0x4d')]){this[_0x04a4('0xa')][_0x15e550[_0x04a4('0x20')]][_0x190172]['agentacw']=!![];this[_0x04a4('0xa')][_0x15e550[_0x04a4('0x20')]][_0x190172][_0x04a4('0x4e')]=this[_0x04a4('0xb')][_0x15e550[_0x04a4('0x37')]][_0x04a4('0x4f')];}this[_0x04a4('0xc')][_0x15e550[_0x04a4('0x50')]]=_[_0x04a4('0x51')](this['agents'][_0x15e550[_0x04a4('0x50')]],[_0x04a4('0x37'),_0x04a4('0x38')]);this[_0x04a4('0x1d')](util[_0x04a4('0x2a')]('user:%s',_0x15e550[_0x04a4('0x39')]),_0x04a4('0x52'),this[_0x04a4('0xa')][_0x15e550[_0x04a4('0x20')]][_0x190172]);ami[_0x04a4('0x1d')](_0x04a4('0x53'),this['channels'][_0x15e550['uniqueid']][_0x190172]);}}}}}}catch(_0x5bd18f){logger[_0x04a4('0x2d')](_0x04a4('0x54'),util[_0x04a4('0x2f')](_0x5bd18f,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncVarSet']=function(_0xd324a5){try{if(this['isNotNull'](_0xd324a5)){this[_0x04a4('0x55')](_0xd324a5[_0x04a4('0x20')],_[_0x04a4('0x56')](_0xd324a5[_0x04a4('0x57')])[0x0],_0xd324a5[_0x04a4('0x58')]);if(this[_0x04a4('0xa')][_0xd324a5[_0x04a4('0x20')]]){for(var _0x51364e in this[_0x04a4('0xa')][_0xd324a5[_0x04a4('0x20')]]){if(this[_0x04a4('0xa')][_0xd324a5[_0x04a4('0x20')]][_0x04a4('0x47')](_0x51364e)){if(_[_0x04a4('0x1f')](this[_0x04a4('0xa')][_0xd324a5['uniqueid']][_0x51364e]['variables'])){this[_0x04a4('0xa')][_0xd324a5[_0x04a4('0x20')]][_0x51364e][_0x04a4('0x24')]={};}this[_0x04a4('0xa')][_0xd324a5[_0x04a4('0x20')]][_0x51364e][_0x04a4('0x24')]=this[_0x04a4('0x24')][_0xd324a5[_0x04a4('0x20')]];}}}}}catch(_0x33ad16){logger['error']('[syncVarSet][VoiceAgentReport]',util[_0x04a4('0x2f')](_0x33ad16,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x04a4('0x1c')]['addVariable']=function(_0x230295,_0x52bc52,_0x15d7d3){var _0x119f3e=[_0x04a4('0x59'),_0x04a4('0x5a'),_0x04a4('0x5b'),'rtpaudioqosjitterbridged','rtpaudioqosloss',_0x04a4('0x5c'),_0x04a4('0x5d'),_0x04a4('0x5e'),_0x04a4('0x5f'),'sipuri',_0x04a4('0x60'),'bridgepvtcallid',_0x04a4('0x61'),_0x04a4('0x62'),'memberinterface',_0x04a4('0x63'),'membername',_0x04a4('0x64'),'memberrealtime'];if(!_[_0x04a4('0x65')](_0x52bc52)&&!_[_0x04a4('0x66')](_0x119f3e,_0x52bc52)){if(_['isUndefined'](this[_0x04a4('0x24')][_0x230295])){this['variables'][_0x230295]={};}this[_0x04a4('0x24')][_0x230295][_0x52bc52]=_0x15d7d3;}};VoiceAgentReport[_0x04a4('0x1c')][_0x04a4('0x67')]=function(_0x36dc5d){try{if(this[_0x04a4('0x1e')](_0x36dc5d)){if(this[_0x04a4('0xa')][_0x36dc5d[_0x04a4('0x20')]]){for(var _0x32ab39 in this['channels'][_0x36dc5d['uniqueid']]){if(this[_0x04a4('0xa')][_0x36dc5d['uniqueid']][_0x04a4('0x47')](_0x32ab39)){if(this[_0x04a4('0xa')][_0x36dc5d[_0x04a4('0x20')]][_0x32ab39][_0x04a4('0x3d')]==_0x04a4('0x4c')&&this[_0x04a4('0xa')][_0x36dc5d[_0x04a4('0x20')]][_0x32ab39][_0x04a4('0x12')]){this['channels'][_0x36dc5d[_0x04a4('0x20')]][_0x32ab39][_0x04a4('0x68')]=moment()[_0x04a4('0x2a')]('YYYY-MM-DD\x20HH:mm:ss');}}}ami['emit'](_0x04a4('0x69'),_[_0x04a4('0x6a')](this['channels'][_0x36dc5d[_0x04a4('0x20')]]));delete this[_0x04a4('0xa')][_0x36dc5d[_0x04a4('0x20')]];}if(this[_0x04a4('0x24')][_0x36dc5d['uniqueid']]){delete this[_0x04a4('0x24')][_0x36dc5d[_0x04a4('0x20')]];}}}catch(_0x3a8c48){logger[_0x04a4('0x2d')]('[syncHangup][VoiceAgentReport]',util['inspect'](_0x3a8c48,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x04a4('0x1c')]['syncAttendedTransfer']=function(_0x24e622){try{if(this[_0x04a4('0x1e')](_0x24e622)){if(this[_0x04a4('0xa')][_0x24e622[_0x04a4('0x6b')]]){for(var _0x4cc9e0 in this[_0x04a4('0xa')][_0x24e622['transfereeuniqueid']]){if(this[_0x04a4('0xa')][_0x24e622[_0x04a4('0x6b')]][_0x04a4('0x47')](_0x4cc9e0)){if(_0x24e622[_0x04a4('0x6c')]===_0x4cc9e0){var _0x24d4f3=moment();this['channels'][_0x24e622[_0x04a4('0x6b')]][_0x4cc9e0][_0x04a4('0x12')]=!![];this['channels'][_0x24e622[_0x04a4('0x6b')]][_0x4cc9e0][_0x04a4('0x68')]=moment()[_0x04a4('0x2a')](_0x04a4('0x22'));this['channels'][_0x24e622[_0x04a4('0x6b')]][_0x4cc9e0][_0x04a4('0x3d')]=_0x04a4('0x4c');this[_0x04a4('0xa')][_0x24e622['transfereeuniqueid']][_0x4cc9e0][_0x04a4('0x3f')]=_0x04a4('0x4b');this[_0x04a4('0xa')][_0x24e622[_0x04a4('0x6b')]][_0x4cc9e0][_0x04a4('0x6d')]=_0x24d4f3[_0x04a4('0x6e')](this[_0x04a4('0xa')][_0x24e622[_0x04a4('0x6b')]][_0x4cc9e0][_0x04a4('0x30')],_0x04a4('0x6f'));}}}}if(this[_0x04a4('0xa')][_0x24e622[_0x04a4('0x70')]]){var _0xb35abd=this[_0x04a4('0xa')][_0x24e622['secondtransfereruniqueid']];this[_0x04a4('0xa')][_0x24e622['secondtransfereruniqueid']]=this[_0x04a4('0xa')][_0x24e622[_0x04a4('0x6b')]];this[_0x04a4('0xa')][_0x24e622[_0x04a4('0x6b')]]=_0xb35abd;}}}catch(_0x1dbcca){logger[_0x04a4('0x2d')](_0x04a4('0x71'),util[_0x04a4('0x2f')](_0x1dbcca,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x04a4('0x72')]=function(_0x2c528d){try{if(this[_0x04a4('0x1e')](_0x2c528d)){if(this[_0x04a4('0xa')][_0x2c528d['transfereeuniqueid']]){for(var _0x4961bc in this['channels'][_0x2c528d['transfereeuniqueid']]){if(this['channels'][_0x2c528d[_0x04a4('0x6b')]][_0x04a4('0x47')](_0x4961bc)){if(_0x2c528d[_0x04a4('0x73')]===_0x4961bc){var _0xfaaca2=moment();this[_0x04a4('0xa')][_0x2c528d[_0x04a4('0x6b')]][_0x4961bc][_0x04a4('0x12')]=!![];this[_0x04a4('0xa')][_0x2c528d[_0x04a4('0x6b')]][_0x4961bc]['agentcompleteAt']=_0xfaaca2;this[_0x04a4('0xa')][_0x2c528d[_0x04a4('0x6b')]][_0x4961bc][_0x04a4('0x3d')]='transfer';this['channels'][_0x2c528d['transfereeuniqueid']][_0x4961bc][_0x04a4('0x3f')]='complete';this[_0x04a4('0xa')][_0x2c528d[_0x04a4('0x6b')]][_0x4961bc]['talktime']=_0xfaaca2[_0x04a4('0x6e')](this[_0x04a4('0xa')][_0x2c528d[_0x04a4('0x6b')]][_0x4961bc][_0x04a4('0x30')],_0x04a4('0x6f'));}}}}}}catch(_0x586d34){logger[_0x04a4('0x2d')]('[syncBlindTransfer][VoiceAgentReport]',util[_0x04a4('0x2f')](_0x586d34,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x04a4('0x1c')]['syncMusicOnHoldStart']=function(_0x5776e6){var _0x52a058='';try{if(this['isNotNull'](_0x5776e6)){if(_0x5776e6['channel']){_0x52a058=_0x5776e6[_0x04a4('0x74')][_0x04a4('0x75')](0x0,_0x5776e6['channel'][_0x04a4('0x76')]('-'));if(this[_0x04a4('0xc')][_0x52a058]){this[_0x04a4('0xc')][_0x52a058]['onhold']=!![];}}}}catch(_0x13736c){logger[_0x04a4('0x2d')](_0x04a4('0x77'),util[_0x04a4('0x2f')](_0x13736c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x04a4('0x1c')][_0x04a4('0x18')]=function(_0x5a3333){var _0x3b01e6='';try{if(this[_0x04a4('0x1e')](_0x5a3333)){if(_0x5a3333[_0x04a4('0x74')]){_0x3b01e6=_0x5a3333[_0x04a4('0x74')][_0x04a4('0x75')](0x0,_0x5a3333[_0x04a4('0x74')]['lastIndexOf']('-'));if(this['agents'][_0x3b01e6]){this[_0x04a4('0xc')][_0x3b01e6][_0x04a4('0x78')]=![];}}}}catch(_0x49a34f){logger[_0x04a4('0x2d')](_0x04a4('0x79'),util[_0x04a4('0x2f')](_0x49a34f,{'showHidden':![],'depth':null}));}};module[_0x04a4('0x7a')]=VoiceAgentReport; \ No newline at end of file +var _0xed38=['error','inspect','hasOwnProperty','agentconnectAt','lastevent','connect','holdtime','connectedlinenum','connectedlinename','destchannelstate','destchannelstatedesc','interface','pick','destconnectedlinenum','user:agentconnect','custom:agentconnect','agentringnoanswerAt','reason','answered_elsewhere','answeredelsewheredestinationuniqueid','custom:agentansweredelsewhere','[syncAgentConnect][VoiceAgentReport]','rejected','custom:agentringnoanswer','[syncAgentRingNoAnswer][VoiceAgentReport]','abandoned','custom:agentqueuecallerabandon','[syncQueueCallerAbandon][VoiceAgentReport]','complete','talktime','transfer','agent','agentacw','acwtime','user:%s','user:agentcomplete','custom:agentcomplete','[syncAgentComplete][VoiceAgentReport]','addVariable','keys','[syncVarSet][VoiceAgentReport]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','membercalls','memberinterface','memberlastcall','memberrealtime','isNil','includes','agentcompleteAt','custom:voiceAgentReport','values','[syncHangup][VoiceAgentReport]','transfereeuniqueid','origtransfereruniqueid','seconds','secondtransfereruniqueid','[syncAttendedTransfer][VoiceAgentReport]','transfereruniqueid','diff','[syncBlindTransfer][VoiceAgentReport]','channel','lastIndexOf','onhold','[syncMusicOnHoldStart][VoiceAgentReport]','substring','[syncMusicOnHoldStop][VoiceAgentReport]','exports','lodash','util','ioredis','../../../config/environment','../ami','redis','defaults','localhost','socket.io-emitter','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','agentconnect','syncAgentConnect','bind','agentringnoanswer','syncAgentRingNoAnswer','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','prototype','emit','isUndefined','isNotNull','uniqueid','destuniqueid','format','YYYY-MM-DD\x20HH:mm:ss','called','queue','inbound','merge','event','custom:agentcalled','membername','user:called'];(function(_0x25bea7,_0x49ab45){var _0x175952=function(_0x56a0b5){while(--_0x56a0b5){_0x25bea7['push'](_0x25bea7['shift']());}};_0x175952(++_0x49ab45);}(_0xed38,0xcb));var _0x8ed3=function(_0x24cd31,_0x1fbddf){_0x24cd31=_0x24cd31-0x0;var _0x5f13b8=_0xed38[_0x24cd31];return _0x5f13b8;};'use strict';var _=require(_0x8ed3('0x0'));var moment=require('moment');var util=require(_0x8ed3('0x1'));var Redis=require(_0x8ed3('0x2'));var config=require(_0x8ed3('0x3'));var logger=require('../../../config/logger')('ami');var ami=require(_0x8ed3('0x4'));config[_0x8ed3('0x5')]=_[_0x8ed3('0x6')](config[_0x8ed3('0x5')],{'host':_0x8ed3('0x7'),'port':0x18eb});var io=require(_0x8ed3('0x8'))(new Redis(config[_0x8ed3('0x5')]));function VoiceAgentReport(_0x503cca){this[_0x8ed3('0x9')]={};this[_0x8ed3('0xa')]=_0x503cca[_0x8ed3('0xa')];this[_0x8ed3('0xb')]=_0x503cca['agents'];this[_0x8ed3('0xc')]={};ami['on'](_0x8ed3('0xd'),this[_0x8ed3('0xe')]['bind'](this));ami['on'](_0x8ed3('0xf'),this[_0x8ed3('0x10')][_0x8ed3('0x11')](this));ami['on'](_0x8ed3('0x12'),this[_0x8ed3('0x13')][_0x8ed3('0x11')](this));ami['on']('queuecallerabandon',this[_0x8ed3('0x14')][_0x8ed3('0x11')](this));ami['on'](_0x8ed3('0x15'),this[_0x8ed3('0x16')]['bind'](this));ami['on'](_0x8ed3('0x17'),this[_0x8ed3('0x18')]['bind'](this));ami['on'](_0x8ed3('0x19'),this[_0x8ed3('0x1a')][_0x8ed3('0x11')](this));ami['on'](_0x8ed3('0x1b'),this[_0x8ed3('0x1c')][_0x8ed3('0x11')](this));ami['on'](_0x8ed3('0x1d'),this[_0x8ed3('0x1e')][_0x8ed3('0x11')](this));ami['on'](_0x8ed3('0x1f'),this[_0x8ed3('0x20')][_0x8ed3('0x11')](this));ami['on'](_0x8ed3('0x21'),this[_0x8ed3('0x22')][_0x8ed3('0x11')](this));}VoiceAgentReport[_0x8ed3('0x23')][_0x8ed3('0x24')]=function(_0x5496fa,_0x4b2355,_0x3060e){io['to'](_0x5496fa)[_0x8ed3('0x24')](_0x4b2355,_0x3060e);};VoiceAgentReport[_0x8ed3('0x23')]['isNotNull']=function(_0x588e3f){return _0x588e3f!==null&&!_[_0x8ed3('0x25')](_0x588e3f);};VoiceAgentReport[_0x8ed3('0x23')][_0x8ed3('0xe')]=function(_0x4bccf7){try{if(this[_0x8ed3('0x26')](_0x4bccf7)){if(_[_0x8ed3('0x25')](this[_0x8ed3('0x9')][_0x4bccf7[_0x8ed3('0x27')]])){this[_0x8ed3('0x9')][_0x4bccf7[_0x8ed3('0x27')]]={};}if(_[_0x8ed3('0x25')](this['channels'][_0x4bccf7[_0x8ed3('0x27')]][_0x4bccf7[_0x8ed3('0x28')]])){this[_0x8ed3('0x9')][_0x4bccf7['uniqueid']][_0x4bccf7[_0x8ed3('0x28')]]={'agentcalledAt':moment()[_0x8ed3('0x29')](_0x8ed3('0x2a')),'lastevent':_0x8ed3('0x2b'),'variables':this[_0x8ed3('0xc')][_0x4bccf7[_0x8ed3('0x27')]],'type':this[_0x8ed3('0xa')][_0x4bccf7[_0x8ed3('0x2c')]]?this[_0x8ed3('0xa')][_0x4bccf7[_0x8ed3('0x2c')]]['type']||'inbound':_0x8ed3('0x2d')};}_[_0x8ed3('0x2e')](this['channels'][_0x4bccf7[_0x8ed3('0x27')]][_0x4bccf7[_0x8ed3('0x28')]],_['omit'](_0x4bccf7,[_0x8ed3('0x2f'),'privilege']));ami['emit'](_0x8ed3('0x30'),this[_0x8ed3('0x9')][_0x4bccf7[_0x8ed3('0x27')]][_0x4bccf7[_0x8ed3('0x28')]]);this[_0x8ed3('0x24')](util[_0x8ed3('0x29')]('user:%s',_0x4bccf7[_0x8ed3('0x31')]),_0x8ed3('0x32'),this[_0x8ed3('0x9')][_0x4bccf7[_0x8ed3('0x27')]][_0x4bccf7[_0x8ed3('0x28')]]);}}catch(_0xbb418b){logger[_0x8ed3('0x33')]('[syncAgentCalled][VoiceAgentReport]',util[_0x8ed3('0x34')](_0xbb418b,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x8ed3('0x10')]=function(_0x58496a){try{if(this[_0x8ed3('0x26')](_0x58496a)){if(this[_0x8ed3('0x9')][_0x58496a['uniqueid']]){for(var _0x349f1b in this[_0x8ed3('0x9')][_0x58496a[_0x8ed3('0x27')]]){if(this[_0x8ed3('0x9')][_0x58496a['uniqueid']][_0x8ed3('0x35')](_0x349f1b)){if(_0x58496a['destuniqueid']===_0x349f1b){this[_0x8ed3('0x9')][_0x58496a[_0x8ed3('0x27')]][_0x349f1b][_0x8ed3('0x36')]=moment()['format'](_0x8ed3('0x2a'));this[_0x8ed3('0x9')][_0x58496a['uniqueid']][_0x349f1b][_0x8ed3('0x37')]=_0x8ed3('0x38');this[_0x8ed3('0x9')][_0x58496a[_0x8ed3('0x27')]][_0x349f1b]['holdtime']=_0x58496a[_0x8ed3('0x39')];this[_0x8ed3('0x9')][_0x58496a[_0x8ed3('0x27')]][_0x349f1b][_0x8ed3('0x3a')]=_0x58496a['connectedlinenum'];this[_0x8ed3('0x9')][_0x58496a[_0x8ed3('0x27')]][_0x349f1b][_0x8ed3('0x3b')]=_0x58496a['connectedlinename'];this[_0x8ed3('0x9')][_0x58496a['uniqueid']][_0x349f1b][_0x8ed3('0x3c')]=_0x58496a[_0x8ed3('0x3c')];this[_0x8ed3('0x9')][_0x58496a[_0x8ed3('0x27')]][_0x349f1b]['destchannelstatedesc']=_0x58496a[_0x8ed3('0x3d')];_['merge'](this[_0x8ed3('0xb')][_0x58496a[_0x8ed3('0x3e')]],_[_0x8ed3('0x3f')](_0x58496a,[_0x8ed3('0x2c'),_0x8ed3('0x40')]));this[_0x8ed3('0x24')](util[_0x8ed3('0x29')]('user:%s',_0x58496a[_0x8ed3('0x31')]),_0x8ed3('0x41'),this['channels'][_0x58496a[_0x8ed3('0x27')]][_0x58496a[_0x8ed3('0x28')]]);ami['emit'](_0x8ed3('0x42'),this['channels'][_0x58496a[_0x8ed3('0x27')]][_0x349f1b]);}else if(!this['channels'][_0x58496a[_0x8ed3('0x27')]][_0x349f1b][_0x8ed3('0x12')]&&!this[_0x8ed3('0x9')][_0x58496a[_0x8ed3('0x27')]][_0x349f1b][_0x8ed3('0x15')]){this[_0x8ed3('0x9')][_0x58496a[_0x8ed3('0x27')]][_0x349f1b][_0x8ed3('0x12')]=!![];this[_0x8ed3('0x9')][_0x58496a[_0x8ed3('0x27')]][_0x349f1b][_0x8ed3('0x43')]=moment()['format'](_0x8ed3('0x2a'));this['channels'][_0x58496a[_0x8ed3('0x27')]][_0x349f1b][_0x8ed3('0x44')]=_0x8ed3('0x45');this[_0x8ed3('0x9')][_0x58496a[_0x8ed3('0x27')]][_0x349f1b][_0x8ed3('0x37')]=_0x8ed3('0x45');this[_0x8ed3('0x9')][_0x58496a['uniqueid']][_0x349f1b][_0x8ed3('0x46')]=_0x58496a[_0x8ed3('0x28')];this[_0x8ed3('0x9')][_0x58496a[_0x8ed3('0x27')]][_0x349f1b]['answeredelsewheremembername']=_0x58496a[_0x8ed3('0x31')];ami[_0x8ed3('0x24')](_0x8ed3('0x47'),this[_0x8ed3('0x9')][_0x58496a[_0x8ed3('0x27')]][_0x349f1b]);}}}}}}catch(_0x3232f9){logger['error'](_0x8ed3('0x48'),util[_0x8ed3('0x34')](_0x3232f9,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8ed3('0x23')][_0x8ed3('0x13')]=function(_0x5326ca){try{if(this[_0x8ed3('0x26')](_0x5326ca)){if(this[_0x8ed3('0x9')][_0x5326ca[_0x8ed3('0x27')]]&&this[_0x8ed3('0x9')][_0x5326ca['uniqueid']][_0x5326ca[_0x8ed3('0x28')]]){this[_0x8ed3('0x9')][_0x5326ca[_0x8ed3('0x27')]][_0x5326ca[_0x8ed3('0x28')]][_0x8ed3('0x12')]=!![];this[_0x8ed3('0x9')][_0x5326ca['uniqueid']][_0x5326ca[_0x8ed3('0x28')]][_0x8ed3('0x43')]=moment()[_0x8ed3('0x29')](_0x8ed3('0x2a'));this['channels'][_0x5326ca[_0x8ed3('0x27')]][_0x5326ca[_0x8ed3('0x28')]][_0x8ed3('0x44')]=_0x8ed3('0x49');this['channels'][_0x5326ca['uniqueid']][_0x5326ca[_0x8ed3('0x28')]][_0x8ed3('0x37')]=_0x8ed3('0x49');ami[_0x8ed3('0x24')](_0x8ed3('0x4a'),this[_0x8ed3('0x9')][_0x5326ca[_0x8ed3('0x27')]][_0x5326ca['destuniqueid']]);}}}catch(_0x21f729){logger[_0x8ed3('0x33')](_0x8ed3('0x4b'),util[_0x8ed3('0x34')](_0x21f729,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x8ed3('0x14')]=function(_0x541fe5){try{if(this[_0x8ed3('0x26')](_0x541fe5)){if(this[_0x8ed3('0x9')][_0x541fe5[_0x8ed3('0x27')]]){for(var _0x5927d2 in this[_0x8ed3('0x9')][_0x541fe5[_0x8ed3('0x27')]]){if(this[_0x8ed3('0x9')][_0x541fe5[_0x8ed3('0x27')]][_0x8ed3('0x35')](_0x5927d2)&&!this[_0x8ed3('0x9')][_0x541fe5[_0x8ed3('0x27')]][_0x5927d2][_0x8ed3('0x12')]&&!this[_0x8ed3('0x9')][_0x541fe5['uniqueid']][_0x5927d2][_0x8ed3('0x15')]){this['channels'][_0x541fe5[_0x8ed3('0x27')]][_0x5927d2][_0x8ed3('0x12')]=!![];this[_0x8ed3('0x9')][_0x541fe5['uniqueid']][_0x5927d2][_0x8ed3('0x43')]=moment()['format'](_0x8ed3('0x2a'));this[_0x8ed3('0x9')][_0x541fe5[_0x8ed3('0x27')]][_0x5927d2][_0x8ed3('0x44')]=_0x8ed3('0x4c');this[_0x8ed3('0x9')][_0x541fe5[_0x8ed3('0x27')]][_0x5927d2]['lastevent']=_0x8ed3('0x4c');ami[_0x8ed3('0x24')](_0x8ed3('0x4d'),this['channels'][_0x541fe5[_0x8ed3('0x27')]][_0x5927d2]);}}}}}catch(_0x43c22d){logger['error'](_0x8ed3('0x4e'),util[_0x8ed3('0x34')](_0x43c22d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8ed3('0x23')]['syncAgentComplete']=function(_0x5a2703){try{if(this[_0x8ed3('0x26')](_0x5a2703)){if(this[_0x8ed3('0x9')][_0x5a2703[_0x8ed3('0x27')]]){for(var _0x6ca73b in this['channels'][_0x5a2703[_0x8ed3('0x27')]]){if(this['channels'][_0x5a2703[_0x8ed3('0x27')]][_0x8ed3('0x35')](_0x6ca73b)){if(this[_0x8ed3('0x9')][_0x5a2703[_0x8ed3('0x27')]][_0x6ca73b][_0x8ed3('0x36')]&&!this[_0x8ed3('0x9')][_0x5a2703[_0x8ed3('0x27')]][_0x6ca73b][_0x8ed3('0x15')]){this[_0x8ed3('0x9')][_0x5a2703[_0x8ed3('0x27')]][_0x6ca73b]['agentcomplete']=!![];this[_0x8ed3('0x9')][_0x5a2703[_0x8ed3('0x27')]][_0x6ca73b]['agentcompleteAt']=moment()[_0x8ed3('0x29')](_0x8ed3('0x2a'));this[_0x8ed3('0x9')][_0x5a2703[_0x8ed3('0x27')]][_0x6ca73b][_0x8ed3('0x37')]=_0x8ed3('0x4f');this[_0x8ed3('0x9')][_0x5a2703['uniqueid']][_0x6ca73b][_0x8ed3('0x50')]=_0x5a2703[_0x8ed3('0x50')];this['channels'][_0x5a2703[_0x8ed3('0x27')]][_0x6ca73b][_0x8ed3('0x44')]=_0x5a2703[_0x8ed3('0x44')]==_0x8ed3('0x51')?_0x8ed3('0x52'):_0x5a2703[_0x8ed3('0x44')];if(this['voiceQueues'][_0x5a2703[_0x8ed3('0x2c')]]&&this[_0x8ed3('0xa')][_0x5a2703[_0x8ed3('0x2c')]]['acw']){this[_0x8ed3('0x9')][_0x5a2703['uniqueid']][_0x6ca73b][_0x8ed3('0x53')]=!![];this[_0x8ed3('0x9')][_0x5a2703[_0x8ed3('0x27')]][_0x6ca73b][_0x8ed3('0x54')]=this[_0x8ed3('0xa')][_0x5a2703[_0x8ed3('0x2c')]]['acwTimeout'];}this[_0x8ed3('0xb')][_0x5a2703['interface']]=_['omit'](this['agents'][_0x5a2703['interface']],['queue',_0x8ed3('0x40')]);this[_0x8ed3('0x24')](util[_0x8ed3('0x29')](_0x8ed3('0x55'),_0x5a2703[_0x8ed3('0x31')]),_0x8ed3('0x56'),this[_0x8ed3('0x9')][_0x5a2703[_0x8ed3('0x27')]][_0x6ca73b]);ami[_0x8ed3('0x24')](_0x8ed3('0x57'),this[_0x8ed3('0x9')][_0x5a2703[_0x8ed3('0x27')]][_0x6ca73b]);}}}}}}catch(_0x33e901){logger['error'](_0x8ed3('0x58'),util[_0x8ed3('0x34')](_0x33e901,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8ed3('0x23')][_0x8ed3('0x18')]=function(_0x282466){try{if(this[_0x8ed3('0x26')](_0x282466)){this[_0x8ed3('0x59')](_0x282466[_0x8ed3('0x27')],_[_0x8ed3('0x5a')](_0x282466['variable'])[0x0],_0x282466['value']);if(this[_0x8ed3('0x9')][_0x282466[_0x8ed3('0x27')]]){for(var _0x535c78 in this[_0x8ed3('0x9')][_0x282466['uniqueid']]){if(this[_0x8ed3('0x9')][_0x282466[_0x8ed3('0x27')]][_0x8ed3('0x35')](_0x535c78)){if(_[_0x8ed3('0x25')](this[_0x8ed3('0x9')][_0x282466['uniqueid']][_0x535c78][_0x8ed3('0xc')])){this[_0x8ed3('0x9')][_0x282466['uniqueid']][_0x535c78]['variables']={};}this[_0x8ed3('0x9')][_0x282466[_0x8ed3('0x27')]][_0x535c78]['variables']=this[_0x8ed3('0xc')][_0x282466[_0x8ed3('0x27')]];}}}}}catch(_0x3e0953){logger[_0x8ed3('0x33')](_0x8ed3('0x5b'),util[_0x8ed3('0x34')](_0x3e0953,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x8ed3('0x59')]=function(_0x5d441f,_0x3e5ac3,_0x33eaf6){var _0x400dcb=[_0x8ed3('0x5c'),_0x8ed3('0x5d'),_0x8ed3('0x5e'),_0x8ed3('0x5f'),_0x8ed3('0x60'),'rtpaudioqoslossbridged',_0x8ed3('0x61'),_0x8ed3('0x62'),_0x8ed3('0x63'),_0x8ed3('0x64'),_0x8ed3('0x65'),'bridgepvtcallid',_0x8ed3('0x66'),'memberdynamic',_0x8ed3('0x67'),_0x8ed3('0x68'),_0x8ed3('0x31'),'memberpenalty',_0x8ed3('0x69')];if(!_[_0x8ed3('0x6a')](_0x3e5ac3)&&!_[_0x8ed3('0x6b')](_0x400dcb,_0x3e5ac3)){if(_['isUndefined'](this[_0x8ed3('0xc')][_0x5d441f])){this[_0x8ed3('0xc')][_0x5d441f]={};}this['variables'][_0x5d441f][_0x3e5ac3]=_0x33eaf6;}};VoiceAgentReport[_0x8ed3('0x23')][_0x8ed3('0x1a')]=function(_0x798225){try{if(this[_0x8ed3('0x26')](_0x798225)){if(this[_0x8ed3('0x9')][_0x798225[_0x8ed3('0x27')]]){for(var _0x59a2f9 in this[_0x8ed3('0x9')][_0x798225[_0x8ed3('0x27')]]){if(this[_0x8ed3('0x9')][_0x798225['uniqueid']][_0x8ed3('0x35')](_0x59a2f9)){if(this[_0x8ed3('0x9')][_0x798225[_0x8ed3('0x27')]][_0x59a2f9]['reason']=='transfer'&&this[_0x8ed3('0x9')][_0x798225[_0x8ed3('0x27')]][_0x59a2f9][_0x8ed3('0x15')]){this['channels'][_0x798225[_0x8ed3('0x27')]][_0x59a2f9][_0x8ed3('0x6c')]=moment()[_0x8ed3('0x29')]('YYYY-MM-DD\x20HH:mm:ss');}}}ami[_0x8ed3('0x24')](_0x8ed3('0x6d'),_[_0x8ed3('0x6e')](this['channels'][_0x798225[_0x8ed3('0x27')]]));delete this[_0x8ed3('0x9')][_0x798225['uniqueid']];}if(this['variables'][_0x798225[_0x8ed3('0x27')]]){delete this[_0x8ed3('0xc')][_0x798225[_0x8ed3('0x27')]];}}}catch(_0x224e8f){logger[_0x8ed3('0x33')](_0x8ed3('0x6f'),util[_0x8ed3('0x34')](_0x224e8f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8ed3('0x23')][_0x8ed3('0x20')]=function(_0x431dde){try{if(this[_0x8ed3('0x26')](_0x431dde)){if(this[_0x8ed3('0x9')][_0x431dde[_0x8ed3('0x70')]]){for(var _0x23485d in this[_0x8ed3('0x9')][_0x431dde[_0x8ed3('0x70')]]){if(this[_0x8ed3('0x9')][_0x431dde['transfereeuniqueid']]['hasOwnProperty'](_0x23485d)){if(_0x431dde[_0x8ed3('0x71')]===_0x23485d){var _0x5ce6c1=moment();this[_0x8ed3('0x9')][_0x431dde[_0x8ed3('0x70')]][_0x23485d][_0x8ed3('0x15')]=!![];this['channels'][_0x431dde['transfereeuniqueid']][_0x23485d][_0x8ed3('0x6c')]=moment()[_0x8ed3('0x29')](_0x8ed3('0x2a'));this[_0x8ed3('0x9')][_0x431dde[_0x8ed3('0x70')]][_0x23485d][_0x8ed3('0x44')]=_0x8ed3('0x51');this['channels'][_0x431dde[_0x8ed3('0x70')]][_0x23485d][_0x8ed3('0x37')]=_0x8ed3('0x4f');this[_0x8ed3('0x9')][_0x431dde['transfereeuniqueid']][_0x23485d][_0x8ed3('0x50')]=_0x5ce6c1['diff'](this['channels'][_0x431dde[_0x8ed3('0x70')]][_0x23485d][_0x8ed3('0x36')],_0x8ed3('0x72'));}}}}if(this[_0x8ed3('0x9')][_0x431dde[_0x8ed3('0x73')]]){var _0x57408a=this[_0x8ed3('0x9')][_0x431dde[_0x8ed3('0x73')]];this[_0x8ed3('0x9')][_0x431dde[_0x8ed3('0x73')]]=this['channels'][_0x431dde['transfereeuniqueid']];this[_0x8ed3('0x9')][_0x431dde[_0x8ed3('0x70')]]=_0x57408a;}}}catch(_0x443b18){logger['error'](_0x8ed3('0x74'),util[_0x8ed3('0x34')](_0x443b18,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8ed3('0x23')][_0x8ed3('0x22')]=function(_0x372dfa){try{if(this[_0x8ed3('0x26')](_0x372dfa)){if(this[_0x8ed3('0x9')][_0x372dfa[_0x8ed3('0x70')]]){for(var _0x5428ad in this[_0x8ed3('0x9')][_0x372dfa['transfereeuniqueid']]){if(this[_0x8ed3('0x9')][_0x372dfa[_0x8ed3('0x70')]][_0x8ed3('0x35')](_0x5428ad)){if(_0x372dfa[_0x8ed3('0x75')]===_0x5428ad){var _0x454b70=moment();this[_0x8ed3('0x9')][_0x372dfa[_0x8ed3('0x70')]][_0x5428ad][_0x8ed3('0x15')]=!![];this[_0x8ed3('0x9')][_0x372dfa[_0x8ed3('0x70')]][_0x5428ad][_0x8ed3('0x6c')]=_0x454b70;this[_0x8ed3('0x9')][_0x372dfa[_0x8ed3('0x70')]][_0x5428ad][_0x8ed3('0x44')]=_0x8ed3('0x51');this[_0x8ed3('0x9')][_0x372dfa[_0x8ed3('0x70')]][_0x5428ad][_0x8ed3('0x37')]=_0x8ed3('0x4f');this[_0x8ed3('0x9')][_0x372dfa[_0x8ed3('0x70')]][_0x5428ad][_0x8ed3('0x50')]=_0x454b70[_0x8ed3('0x76')](this['channels'][_0x372dfa[_0x8ed3('0x70')]][_0x5428ad][_0x8ed3('0x36')],_0x8ed3('0x72'));}}}}}}catch(_0x527076){logger[_0x8ed3('0x33')](_0x8ed3('0x77'),util[_0x8ed3('0x34')](_0x527076,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8ed3('0x23')][_0x8ed3('0x1c')]=function(_0x5e84de){var _0x129d21='';try{if(this[_0x8ed3('0x26')](_0x5e84de)){if(_0x5e84de['channel']){_0x129d21=_0x5e84de[_0x8ed3('0x78')]['substring'](0x0,_0x5e84de[_0x8ed3('0x78')][_0x8ed3('0x79')]('-'));if(this['agents'][_0x129d21]){this[_0x8ed3('0xb')][_0x129d21][_0x8ed3('0x7a')]=!![];}}}}catch(_0x18f243){logger['error'](_0x8ed3('0x7b'),util[_0x8ed3('0x34')](_0x18f243,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x8ed3('0x1e')]=function(_0x141024){var _0x2d4e9d='';try{if(this[_0x8ed3('0x26')](_0x141024)){if(_0x141024[_0x8ed3('0x78')]){_0x2d4e9d=_0x141024[_0x8ed3('0x78')][_0x8ed3('0x7c')](0x0,_0x141024[_0x8ed3('0x78')][_0x8ed3('0x79')]('-'));if(this['agents'][_0x2d4e9d]){this[_0x8ed3('0xb')][_0x2d4e9d][_0x8ed3('0x7a')]=![];}}}}catch(_0x556346){logger[_0x8ed3('0x33')](_0x8ed3('0x7d'),util[_0x8ed3('0x34')](_0x556346,{'showHidden':![],'depth':null}));}};module[_0x8ed3('0x7e')]=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index 539aa18..2c3a198 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 _0xb4c7=['[syncAttendedTransfer][VoiceCallReport]','transfereecalleridnum','extension','BlindTransfer','[syncBlindTransfer][VoiceCallReport]','mohstarttime','[syncMusicOnHoldStart][VoiceCallReport]','mohtime','milliseconds','exports','bluebird','lodash','moment','util','path','../../../config/environment','../../../config/logger','ami','../ami','../model/channel','not_inuse','inuse','busy','unavailable','ringing','onhold','set','queue','agi','dial','playback','voicemail','NO\x20ANSWER','FAILED','ANSWERED','BUSY','redis','defaults','localhost','channels','agents','coreshowchannel','syncNewExten','newexten','bind','newchannel','newstate','syncNewState','varset','syncVarSet','hangup','syncHangup','newcallerid','syncNewCallerId','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','musiconholdstop','syncMusicOnHoldStop','resolve','then','actionCoreShowChannels','catch','log','prototype','isNotNull','emit','uniqueid','linkedid','isUndefined','merge','pick','error','[syncNewCallerId][VoiceCallReport]','inspect','syncNewChannel','channel','OutgoingSpoolFailed','starttime','format','disposition','channelstate','keys','context','from-sip','split','exten','user:%s','name','user:agentconnect','accountcode','[syncNewChannel][VoiceCallReport]','application','toLowerCase','applicationdata','appdata','duration','subtract','seconds','YYYY-MM-DD\x20HH:mm:ss','lastapplication','lastdata','startsWith','cdr(','match','[syncNewExten][VoiceCallReport]','holdtime','diff','calleridnum','xcally-motion-preview','connectedlinenum','connectedlinename','calleridname','destinationchannel','membername','UserId','[syncNewState][VoiceCallReport]','monitor','endsWith','.wav49','replace','.WAV','find','monitors','isNil','push','rec','variable','mixmonitor_filename','value','xmd-phone','xmd-cdrtype','xmd-queue','xmd-originatecalleridnum','xmd-destination','destination','xmd-callerid-preview','calleridpreview','sipcallid','sipcalluniqueid','parse','syncMixMonitorFilename','sipcalllinkedid','[syncVarSet][VoiceCallReport]','endtime','answered','billableseconds','answertime','destconnectedlinenum','custom:voiceCallReport','transfereeuniqueid','transfercalleridnum','origtransferercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','transfertargetuniqueid','transfertargetcalleridnum','origtransfereruniqueid'];(function(_0x21e0d2,_0x29083c){var _0x17f247=function(_0x3a123e){while(--_0x3a123e){_0x21e0d2['push'](_0x21e0d2['shift']());}};_0x17f247(++_0x29083c);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x5887bb,_0x2398e3){_0x5887bb=_0x5887bb-0x0;var _0x176579=_0xb4c7[_0x5887bb];return _0x176579;};'use strict';var BPromise=require(_0x7b4c('0x0'));var _=require(_0x7b4c('0x1'));var moment=require(_0x7b4c('0x2'));var util=require(_0x7b4c('0x3'));var path=require(_0x7b4c('0x4'));var Redis=require('ioredis');var config=require(_0x7b4c('0x5'));var logger=require(_0x7b4c('0x6'))(_0x7b4c('0x7'));var ami=require(_0x7b4c('0x8'));var Channel=require(_0x7b4c('0x9'));var statusDesc=['unknown',_0x7b4c('0xa'),_0x7b4c('0xb'),_0x7b4c('0xc'),'invalid',_0x7b4c('0xd'),_0x7b4c('0xe'),'ringinuse',_0x7b4c('0xf')];var applications=[_0x7b4c('0x10'),_0x7b4c('0x11'),_0x7b4c('0x12'),_0x7b4c('0x13'),_0x7b4c('0x14'),_0x7b4c('0x15')];var dispositions=[_0x7b4c('0x16'),_0x7b4c('0x17'),_0x7b4c('0x17'),'NO\x20ANSWER','NO\x20ANSWER',_0x7b4c('0x16'),_0x7b4c('0x18'),_0x7b4c('0x19'),_0x7b4c('0x17'),_0x7b4c('0x17'),_0x7b4c('0x17')];var actions={};config[_0x7b4c('0x1a')]=_[_0x7b4c('0x1b')](config[_0x7b4c('0x1a')],{'host':_0x7b4c('0x1c'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x7b4c('0x1a')]));function VoiceCallReport(_0x3d8362){this[_0x7b4c('0x1d')]=_0x3d8362[_0x7b4c('0x1d')];this[_0x7b4c('0x1e')]=_0x3d8362[_0x7b4c('0x1e')];ami['on'](_0x7b4c('0x1f'),this[_0x7b4c('0x20')]['bind'](this));ami['on'](_0x7b4c('0x21'),this[_0x7b4c('0x20')][_0x7b4c('0x22')](this));ami['on'](_0x7b4c('0x23'),this['syncNewChannel'][_0x7b4c('0x22')](this));ami['on'](_0x7b4c('0x24'),this[_0x7b4c('0x25')][_0x7b4c('0x22')](this));ami['on'](_0x7b4c('0x26'),this[_0x7b4c('0x27')][_0x7b4c('0x22')](this));ami['on'](_0x7b4c('0x28'),this[_0x7b4c('0x29')]['bind'](this));ami['on'](_0x7b4c('0x2a'),this[_0x7b4c('0x2b')][_0x7b4c('0x22')](this));ami['on'](_0x7b4c('0x2c'),this[_0x7b4c('0x2d')][_0x7b4c('0x22')](this));ami['on'](_0x7b4c('0x2e'),this[_0x7b4c('0x2f')][_0x7b4c('0x22')](this));ami['on'](_0x7b4c('0x30'),this['syncMusicOnHoldStart'][_0x7b4c('0x22')](this));ami['on'](_0x7b4c('0x31'),this[_0x7b4c('0x32')][_0x7b4c('0x22')](this));return BPromise[_0x7b4c('0x33')]()[_0x7b4c('0x34')](ami[_0x7b4c('0x35')]())[_0x7b4c('0x36')](function(_0x1f311e){console[_0x7b4c('0x37')](_0x1f311e);});}VoiceCallReport[_0x7b4c('0x38')][_0x7b4c('0x39')]=function(_0x316e5f){return _0x316e5f!==null&&!_['isUndefined'](_0x316e5f);};VoiceCallReport[_0x7b4c('0x38')][_0x7b4c('0x3a')]=function(_0x1fe0f5,_0x3671c4,_0x207c2f){io['to'](_0x1fe0f5)[_0x7b4c('0x3a')](_0x3671c4,_0x207c2f);};VoiceCallReport[_0x7b4c('0x38')][_0x7b4c('0x2b')]=function(_0x3e4a46){try{if(this[_0x7b4c('0x39')](_0x3e4a46)){if(_0x3e4a46[_0x7b4c('0x3b')]===_0x3e4a46[_0x7b4c('0x3c')]){if(!_[_0x7b4c('0x3d')](this[_0x7b4c('0x1d')][_0x3e4a46[_0x7b4c('0x3b')]])){_[_0x7b4c('0x3e')](this[_0x7b4c('0x1d')][_0x3e4a46[_0x7b4c('0x3b')]],_[_0x7b4c('0x3f')](_0x3e4a46,_['keys'](this['channels'][_0x3e4a46['uniqueid']])));}}}}catch(_0x2fe0f4){logger[_0x7b4c('0x40')](_0x7b4c('0x41'),util[_0x7b4c('0x42')](_0x2fe0f4,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x7b4c('0x43')]=function(_0x344325){try{if(this['isNotNull'](_0x344325)){if(_0x344325[_0x7b4c('0x3b')]===_0x344325['linkedid']&&_0x344325[_0x7b4c('0x44')]!=_0x7b4c('0x45')){if(_[_0x7b4c('0x3d')](this['channels'][_0x344325[_0x7b4c('0x3b')]])){this[_0x7b4c('0x1d')][_0x344325['uniqueid']]=new Channel();this[_0x7b4c('0x1d')][_0x344325[_0x7b4c('0x3b')]][_0x7b4c('0x46')]=moment()[_0x7b4c('0x47')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x344325[_0x7b4c('0x3b')]][_0x7b4c('0x48')]=dispositions[_['toNumber'](_0x344325[_0x7b4c('0x49')])];_['merge'](this['channels'][_0x344325[_0x7b4c('0x3b')]],_[_0x7b4c('0x3f')](_0x344325,_[_0x7b4c('0x4a')](this[_0x7b4c('0x1d')][_0x344325['uniqueid']])));if(_0x344325[_0x7b4c('0x4b')]===_0x7b4c('0x4c')){if(this[_0x7b4c('0x1e')][_0x344325[_0x7b4c('0x44')][_0x7b4c('0x4d')]('-')[0x0]]){this[_0x7b4c('0x1e')][_0x344325[_0x7b4c('0x44')]['split']('-')[0x0]]['destconnectedlinenum']=_0x344325[_0x7b4c('0x4e')];this[_0x7b4c('0x3a')](util[_0x7b4c('0x47')](_0x7b4c('0x4f'),this[_0x7b4c('0x1e')][_0x344325['channel'][_0x7b4c('0x4d')]('-')[0x0]][_0x7b4c('0x50')]),_0x7b4c('0x51'),{'destaccountcode':this[_0x7b4c('0x1e')][_0x344325[_0x7b4c('0x44')][_0x7b4c('0x4d')]('-')[0x0]][_0x7b4c('0x52')],'destconnectedlinenum':_0x344325[_0x7b4c('0x4e')]});}}}}}}catch(_0x3d8126){logger['error'](_0x7b4c('0x53'),util['inspect'](_0x3d8126,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x7b4c('0x38')]['syncNewExten']=function(_0xd464aa){try{if(this[_0x7b4c('0x39')](_0xd464aa)){if(_0xd464aa['uniqueid']===_0xd464aa['linkedid']&&_0xd464aa[_0x7b4c('0x4e')]!='h'&&_0xd464aa[_0x7b4c('0x44')]!=_0x7b4c('0x45')){_0xd464aa[_0x7b4c('0x54')]=_0xd464aa['application'][_0x7b4c('0x55')]();_0xd464aa[_0x7b4c('0x56')]=(_0xd464aa[_0x7b4c('0x57')]||_0xd464aa['applicationdata'])[_0x7b4c('0x55')]();if(_['isUndefined'](this['channels'][_0xd464aa[_0x7b4c('0x3b')]])){this['channels'][_0xd464aa[_0x7b4c('0x3b')]]=new Channel();this[_0x7b4c('0x1d')][_0xd464aa[_0x7b4c('0x3b')]][_0x7b4c('0x46')]=_0xd464aa[_0x7b4c('0x58')]?moment()[_0x7b4c('0x59')](moment[_0x7b4c('0x58')](_0xd464aa[_0x7b4c('0x58')])[_0x7b4c('0x5a')](),'seconds')[_0x7b4c('0x47')]('YYYY-MM-DD\x20HH:mm:ss'):moment()['format'](_0x7b4c('0x5b'));this[_0x7b4c('0x1d')][_0xd464aa['uniqueid']]['disposition']=_0x7b4c('0x16');}_[_0x7b4c('0x3e')](this[_0x7b4c('0x1d')][_0xd464aa[_0x7b4c('0x3b')]],_[_0x7b4c('0x3f')](_0xd464aa,_[_0x7b4c('0x4a')](this[_0x7b4c('0x1d')][_0xd464aa[_0x7b4c('0x3b')]])));if(_['includes'](applications,_0xd464aa[_0x7b4c('0x54')])){this[_0x7b4c('0x1d')][_0xd464aa[_0x7b4c('0x3b')]][_0x7b4c('0x5c')]=_0xd464aa[_0x7b4c('0x54')];this[_0x7b4c('0x1d')][_0xd464aa[_0x7b4c('0x3b')]][_0x7b4c('0x5d')]=_0xd464aa[_0x7b4c('0x56')];if(_0xd464aa['application']==='set'&&_[_0x7b4c('0x5e')](_0xd464aa[_0x7b4c('0x56')],_0x7b4c('0x5f'))){var _0x5d4192=_0xd464aa[_0x7b4c('0x56')][_0x7b4c('0x4d')]('=');var _0x5ddf41=_0x5d4192[0x0][_0x7b4c('0x60')](/cdr\((.*)\)/);if(_0x5ddf41){this['channels'][_0xd464aa[_0x7b4c('0x3b')]][_0x5ddf41[0x1]]=_0x5d4192[0x1];}}else if(_0xd464aa['application']===_0x7b4c('0x11')){this['channels'][_0xd464aa[_0x7b4c('0x3b')]][_0x7b4c('0x11')]=_0xd464aa['applicationdata']['split'](',')[0x0];}}}}}catch(_0x981e8b){logger[_0x7b4c('0x40')](_0x7b4c('0x61'),util['inspect'](_0x981e8b,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x7b4c('0x25')]=function(_0x1c118a){try{if(this['isNotNull'](_0x1c118a)){if(_0x1c118a['uniqueid']!==_0x1c118a[_0x7b4c('0x3c')]){if(this[_0x7b4c('0x1d')][_0x1c118a[_0x7b4c('0x3c')]]){if(_0x1c118a['channelstate']==='6'){if(!this[_0x7b4c('0x1d')][_0x1c118a[_0x7b4c('0x3c')]]['answered']){var _0x484e80=moment();this[_0x7b4c('0x1d')][_0x1c118a['linkedid']]['answered']=!![];this[_0x7b4c('0x1d')][_0x1c118a['linkedid']]['answertime']=_0x484e80[_0x7b4c('0x47')](_0x7b4c('0x5b'));if(this[_0x7b4c('0x1d')][_0x1c118a[_0x7b4c('0x3c')]]['starttime']){this['channels'][_0x1c118a[_0x7b4c('0x3c')]][_0x7b4c('0x62')]=_0x484e80[_0x7b4c('0x63')](this['channels'][_0x1c118a[_0x7b4c('0x3c')]][_0x7b4c('0x46')],_0x7b4c('0x5a'));}}this['channels'][_0x1c118a[_0x7b4c('0x3c')]][_0x7b4c('0x3c')]=_0x1c118a['uniqueid'];if(_0x1c118a[_0x7b4c('0x64')]!==_0x7b4c('0x65')){this[_0x7b4c('0x1d')][_0x1c118a[_0x7b4c('0x3c')]][_0x7b4c('0x66')]=_0x1c118a[_0x7b4c('0x64')];}this[_0x7b4c('0x1d')][_0x1c118a['linkedid']][_0x7b4c('0x67')]=_0x1c118a[_0x7b4c('0x68')];this['channels'][_0x1c118a[_0x7b4c('0x3c')]][_0x7b4c('0x69')]=_0x1c118a[_0x7b4c('0x44')];this[_0x7b4c('0x1d')][_0x1c118a['linkedid']][_0x7b4c('0x48')]=dispositions[_['toNumber'](_0x1c118a['channelstate'])];if(this[_0x7b4c('0x1e')][_0x1c118a[_0x7b4c('0x44')][_0x7b4c('0x4d')]('-')[0x0]]){this[_0x7b4c('0x1d')][_0x1c118a[_0x7b4c('0x3c')]]['UserId']=this['agents'][_0x1c118a[_0x7b4c('0x44')][_0x7b4c('0x4d')]('-')[0x0]]['id'];this[_0x7b4c('0x1d')][_0x1c118a['linkedid']][_0x7b4c('0x6a')]=this[_0x7b4c('0x1e')][_0x1c118a[_0x7b4c('0x44')]['split']('-')[0x0]][_0x7b4c('0x50')];}}}}else{if(this[_0x7b4c('0x1d')][_0x1c118a[_0x7b4c('0x3b')]]){if(_0x1c118a['channelstate']==='6'){if(this[_0x7b4c('0x1e')][_0x1c118a[_0x7b4c('0x44')]['split']('-')[0x0]]){this[_0x7b4c('0x1d')][_0x1c118a['uniqueid']][_0x7b4c('0x6b')]=this[_0x7b4c('0x1e')][_0x1c118a[_0x7b4c('0x44')]['split']('-')[0x0]]['id'];this['channels'][_0x1c118a[_0x7b4c('0x3b')]][_0x7b4c('0x6a')]=this[_0x7b4c('0x1e')][_0x1c118a['channel'][_0x7b4c('0x4d')]('-')[0x0]]['name'];}}}}}}catch(_0xc501e7){logger[_0x7b4c('0x40')](_0x7b4c('0x6c'),util[_0x7b4c('0x42')](_0xc501e7,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x7b4c('0x38')]['syncMixMonitorFilename']=function(_0x240534,_0x21a669){if(this['channels'][_0x240534]){this[_0x7b4c('0x1d')][_0x240534][_0x7b4c('0x6d')]=!![];if(_[_0x7b4c('0x6e')](_0x21a669,_0x7b4c('0x6f'))){_0x21a669=_0x21a669[_0x7b4c('0x70')](_0x7b4c('0x6f'),_0x7b4c('0x71'));}this[_0x7b4c('0x1d')][_0x240534]['monitorFilename']=_0x21a669;var _0x10d5b3=_[_0x7b4c('0x72')](this[_0x7b4c('0x1d')][_0x240534][_0x7b4c('0x73')],{'filename':_0x21a669});if(_[_0x7b4c('0x74')](_0x10d5b3)){this[_0x7b4c('0x1d')][_0x240534][_0x7b4c('0x73')][_0x7b4c('0x75')]({'filename':_0x21a669,'createdAt':moment()[_0x7b4c('0x47')](_0x7b4c('0x5b')),'mixmonitorid':'','status':_0x7b4c('0x76')});}}};VoiceCallReport[_0x7b4c('0x38')][_0x7b4c('0x27')]=function(_0x225f38){try{if(this[_0x7b4c('0x39')](_0x225f38)){if(this[_0x7b4c('0x1d')][_0x225f38[_0x7b4c('0x3b')]]&&_0x225f38[_0x7b4c('0x44')]!=_0x7b4c('0x45')){if(this[_0x7b4c('0x39')](_0x225f38['variable'])){if(this['isNotNull'](_0x225f38[_0x7b4c('0x77')][_0x7b4c('0x78')])){this['syncMixMonitorFilename'](_0x225f38[_0x7b4c('0x3b')],_0x225f38[_0x7b4c('0x79')]);}else if(this[_0x7b4c('0x39')](_0x225f38[_0x7b4c('0x77')][_0x7b4c('0x7a')])){this[_0x7b4c('0x1d')][_0x225f38[_0x7b4c('0x3b')]][_0x7b4c('0x64')]=_0x225f38[_0x7b4c('0x79')];}else if(this['isNotNull'](_0x225f38[_0x7b4c('0x77')]['xmd-callerid'])){this[_0x7b4c('0x1d')][_0x225f38['uniqueid']]['callerid']=_0x225f38[_0x7b4c('0x79')];}else if(this['isNotNull'](_0x225f38['variable'][_0x7b4c('0x7b')])){this[_0x7b4c('0x1d')][_0x225f38[_0x7b4c('0x3b')]]['type']=_0x225f38[_0x7b4c('0x79')];}else if(this[_0x7b4c('0x39')](_0x225f38[_0x7b4c('0x77')][_0x7b4c('0x7c')])){this[_0x7b4c('0x1d')][_0x225f38[_0x7b4c('0x3b')]][_0x7b4c('0x11')]=_0x225f38[_0x7b4c('0x79')][_0x7b4c('0x4d')](',')[0x0];}else if(this[_0x7b4c('0x39')](_0x225f38[_0x7b4c('0x77')][_0x7b4c('0x7d')])){this[_0x7b4c('0x1d')][_0x225f38[_0x7b4c('0x3b')]]['originatecalleridnum']=_0x225f38[_0x7b4c('0x79')];}else if(this[_0x7b4c('0x39')](_0x225f38[_0x7b4c('0x77')][_0x7b4c('0x7e')])){this['channels'][_0x225f38[_0x7b4c('0x3b')]][_0x7b4c('0x7f')]=_0x225f38[_0x7b4c('0x79')];}else if(this[_0x7b4c('0x39')](_0x225f38[_0x7b4c('0x77')][_0x7b4c('0x80')])){this[_0x7b4c('0x1d')][_0x225f38['uniqueid']][_0x7b4c('0x81')]=_0x225f38[_0x7b4c('0x79')];}else if(this['isNotNull'](_0x225f38['variable']['xmcs-queue'])){this[_0x7b4c('0x1d')][_0x225f38[_0x7b4c('0x3b')]][_0x7b4c('0x11')]=_0x225f38[_0x7b4c('0x79')];}else if(this[_0x7b4c('0x39')](_0x225f38[_0x7b4c('0x77')][_0x7b4c('0x82')])){this[_0x7b4c('0x1d')][_0x225f38[_0x7b4c('0x3b')]][_0x7b4c('0x83')]=_0x225f38[_0x7b4c('0x79')];}}}else if(this[_0x7b4c('0x39')](_0x225f38[_0x7b4c('0x77')]['mixmonitor_filename'])){if(_0x225f38[_0x7b4c('0x79')]){var _0x302605=path[_0x7b4c('0x84')](_0x225f38['value'])[_0x7b4c('0x50')];this[_0x7b4c('0x85')](_0x302605,_0x225f38[_0x7b4c('0x79')]);}}else if(this[_0x7b4c('0x1d')][_0x225f38[_0x7b4c('0x3c')]]){if(this['isNotNull'](_0x225f38[_0x7b4c('0x77')])){if(this[_0x7b4c('0x39')](_0x225f38[_0x7b4c('0x77')][_0x7b4c('0x82')])){this['channels'][_0x225f38[_0x7b4c('0x3c')]][_0x7b4c('0x86')]=_0x225f38[_0x7b4c('0x79')];}}}}}catch(_0x5f0d72){logger[_0x7b4c('0x40')](_0x7b4c('0x87'),util[_0x7b4c('0x42')](_0x5f0d72,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x7b4c('0x38')]['syncHangup']=function(_0x3d9c3c){try{if(this[_0x7b4c('0x39')](_0x3d9c3c)){if(this[_0x7b4c('0x1d')][_0x3d9c3c[_0x7b4c('0x3b')]]){var _0x50c382=moment();this[_0x7b4c('0x1d')][_0x3d9c3c['uniqueid']][_0x7b4c('0x88')]=_0x50c382['format'](_0x7b4c('0x5b'));this[_0x7b4c('0x1d')][_0x3d9c3c[_0x7b4c('0x3b')]]['duration']=_0x50c382[_0x7b4c('0x63')](this['channels'][_0x3d9c3c[_0x7b4c('0x3b')]][_0x7b4c('0x46')],'seconds');if(this[_0x7b4c('0x1d')][_0x3d9c3c[_0x7b4c('0x3b')]][_0x7b4c('0x89')]){this[_0x7b4c('0x1d')][_0x3d9c3c['uniqueid']][_0x7b4c('0x8a')]=_0x50c382[_0x7b4c('0x63')](this['channels'][_0x3d9c3c[_0x7b4c('0x3b')]][_0x7b4c('0x8b')],_0x7b4c('0x5a'));this[_0x7b4c('0x1d')][_0x3d9c3c[_0x7b4c('0x3b')]][_0x7b4c('0x62')]=this[_0x7b4c('0x1d')][_0x3d9c3c['uniqueid']]['duration']-this[_0x7b4c('0x1d')][_0x3d9c3c[_0x7b4c('0x3b')]][_0x7b4c('0x8a')];}if(_0x3d9c3c[_0x7b4c('0x4b')]===_0x7b4c('0x4c')){if(this['agents'][_0x3d9c3c[_0x7b4c('0x44')][_0x7b4c('0x4d')]('-')[0x0]]){this[_0x7b4c('0x1e')][_0x3d9c3c[_0x7b4c('0x44')]['split']('-')[0x0]]=_['omit'](this[_0x7b4c('0x1e')][_0x3d9c3c[_0x7b4c('0x44')][_0x7b4c('0x4d')]('-')[0x0]],[_0x7b4c('0x8c')]);this[_0x7b4c('0x3a')](util['format'](_0x7b4c('0x4f'),this[_0x7b4c('0x1e')][_0x3d9c3c[_0x7b4c('0x44')][_0x7b4c('0x4d')]('-')[0x0]]['name']),'user:agentcomplete',{'destaccountcode':this['agents'][_0x3d9c3c[_0x7b4c('0x44')][_0x7b4c('0x4d')]('-')[0x0]][_0x7b4c('0x52')]});}}ami['emit'](_0x7b4c('0x8d'),this['channels'][_0x3d9c3c['uniqueid']]);delete this[_0x7b4c('0x1d')][_0x3d9c3c['uniqueid']];}}}catch(_0x437ef7){logger[_0x7b4c('0x40')]('[syncHangup][VoiceCallReport]',util['inspect'](_0x437ef7,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x7b4c('0x38')][_0x7b4c('0x2d')]=function(_0x3fd132){try{if(this[_0x7b4c('0x39')](_0x3fd132)){if(this['channels'][_0x3fd132['transfereeuniqueid']]){this[_0x7b4c('0x1d')][_0x3fd132[_0x7b4c('0x8e')]][_0x7b4c('0x8f')]=_0x3fd132[_0x7b4c('0x90')];this[_0x7b4c('0x1d')][_0x3fd132[_0x7b4c('0x8e')]][_0x7b4c('0x91')]=_0x3fd132['transfertargetcalleridnum'];if(this[_0x7b4c('0x1d')][_0x3fd132[_0x7b4c('0x92')]]){var _0x22ffdb=this[_0x7b4c('0x1d')][_0x3fd132[_0x7b4c('0x92')]];this[_0x7b4c('0x1d')][_0x3fd132[_0x7b4c('0x92')]]=this[_0x7b4c('0x1d')][_0x3fd132[_0x7b4c('0x8e')]];this['channels'][_0x3fd132[_0x7b4c('0x8e')]]=_0x22ffdb;}}else if(this[_0x7b4c('0x1d')][_0x3fd132[_0x7b4c('0x93')]]){this[_0x7b4c('0x1d')][_0x3fd132[_0x7b4c('0x93')]][_0x7b4c('0x8f')]=_0x3fd132[_0x7b4c('0x90')];this[_0x7b4c('0x1d')][_0x3fd132[_0x7b4c('0x93')]]['transferconnectedlinenum']=_0x3fd132[_0x7b4c('0x94')];if(this[_0x7b4c('0x1d')][_0x3fd132[_0x7b4c('0x95')]]){var _0x22ffdb=this[_0x7b4c('0x1d')][_0x3fd132[_0x7b4c('0x95')]];this['channels'][_0x3fd132[_0x7b4c('0x95')]]=this[_0x7b4c('0x1d')][_0x3fd132['transfertargetuniqueid']];this['channels'][_0x3fd132[_0x7b4c('0x93')]]=_0x22ffdb;}}}}catch(_0x589628){logger[_0x7b4c('0x40')](_0x7b4c('0x96'),util[_0x7b4c('0x42')](_0x589628,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x7b4c('0x38')]['syncBlindTransfer']=function(_0x5e6c26){try{if(this[_0x7b4c('0x39')](_0x5e6c26)){if(this[_0x7b4c('0x1d')][_0x5e6c26[_0x7b4c('0x8e')]]){this[_0x7b4c('0x1d')][_0x5e6c26[_0x7b4c('0x8e')]][_0x7b4c('0x8f')]=_0x5e6c26[_0x7b4c('0x97')];this[_0x7b4c('0x1d')][_0x5e6c26[_0x7b4c('0x8e')]][_0x7b4c('0x91')]=_0x5e6c26[_0x7b4c('0x98')];this[_0x7b4c('0x29')]({'event':_0x7b4c('0x99'),'uniqueid':_0x5e6c26[_0x7b4c('0x8e')],'context':_0x5e6c26[_0x7b4c('0x4b')],'channel':_0x5e6c26['transfererchannel']});}}}catch(_0x23a11f){logger[_0x7b4c('0x40')](_0x7b4c('0x9a'),util[_0x7b4c('0x42')](_0x23a11f,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncMusicOnHoldStart']=function(_0x316952){try{if(this[_0x7b4c('0x39')](_0x316952)){if(this[_0x7b4c('0x1d')][_0x316952[_0x7b4c('0x3b')]]){if(!_[_0x7b4c('0x74')](this[_0x7b4c('0x1d')][_0x316952[_0x7b4c('0x3b')]][_0x7b4c('0x8b')])){this[_0x7b4c('0x1d')][_0x316952['uniqueid']][_0x7b4c('0x9b')]=moment()[_0x7b4c('0x47')](_0x7b4c('0x5b'));}}}}catch(_0x5f6b34){logger[_0x7b4c('0x40')](_0x7b4c('0x9c'),util[_0x7b4c('0x42')](_0x5f6b34,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x7b4c('0x38')][_0x7b4c('0x32')]=function(_0x203041){try{if(this[_0x7b4c('0x39')](_0x203041)){if(this[_0x7b4c('0x1d')][_0x203041['uniqueid']]){if(!_['isNil'](this[_0x7b4c('0x1d')][_0x203041[_0x7b4c('0x3b')]][_0x7b4c('0x9b')])){this[_0x7b4c('0x1d')][_0x203041[_0x7b4c('0x3b')]][_0x7b4c('0x9d')]+=moment()[_0x7b4c('0x9e')](0x0)[_0x7b4c('0x63')](this[_0x7b4c('0x1d')][_0x203041[_0x7b4c('0x3b')]][_0x7b4c('0x9b')],_0x7b4c('0x5a'));delete this['channels'][_0x203041[_0x7b4c('0x3b')]][_0x7b4c('0x9b')];}}}}catch(_0x175050){logger[_0x7b4c('0x40')]('[syncMusicOnHoldStop][VoiceCallReport]',util['inspect'](_0x175050,{'showHidden':![],'depth':null}));}};module[_0x7b4c('0x9f')]=VoiceCallReport; \ No newline at end of file +var _0x5f44=['isNil','mohstarttime','mohtime','milliseconds','[syncMusicOnHoldStop][VoiceCallReport]','bluebird','lodash','util','path','ioredis','../../../config/environment','../../../config/logger','ami','../ami','../model/channel','unknown','not_inuse','inuse','busy','unavailable','ringing','ringinuse','onhold','set','queue','dial','playback','NO\x20ANSWER','FAILED','ANSWERED','BUSY','localhost','socket.io-emitter','redis','channels','agents','syncNewExten','newexten','bind','syncNewChannel','syncNewState','hangup','newcallerid','syncNewCallerId','attendedtransfer','syncAttendedTransfer','blindtransfer','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','actionCoreShowChannels','catch','log','prototype','isNotNull','isUndefined','emit','uniqueid','pick','error','[syncNewCallerId][VoiceCallReport]','linkedid','channel','OutgoingSpoolFailed','starttime','format','YYYY-MM-DD\x20HH:mm:ss','channelstate','merge','keys','context','split','destconnectedlinenum','exten','user:agentconnect','accountcode','[syncNewChannel][VoiceCallReport]','inspect','application','toLowerCase','applicationdata','duration','subtract','seconds','disposition','includes','lastapplication','cdr(','[syncNewExten][VoiceCallReport]','answered','answertime','holdtime','diff','calleridnum','xcally-motion-preview','connectedlinename','calleridname','toNumber','UserId','name','.wav49','replace','.WAV','monitorFilename','monitors','push','syncVarSet','variable','value','xmd-phone','xmd-callerid','callerid','xmd-cdrtype','type','xmd-queue','xmd-originatecalleridnum','originatecalleridnum','xmd-destination','destination','xmd-callerid-preview','xmcs-queue','sipcallid','sipcalluniqueid','mixmonitor_filename','parse','syncMixMonitorFilename','sipcalllinkedid','[syncVarSet][VoiceCallReport]','endtime','billableseconds','user:%s','user:agentcomplete','custom:voiceCallReport','[syncHangup][VoiceCallReport]','transfereeuniqueid','transfercalleridnum','origtransferercalleridnum','transferconnectedlinenum','transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[syncAttendedTransfer][VoiceCallReport]','transfereecalleridnum','extension','syncHangup','BlindTransfer','transfererchannel','[syncBlindTransfer][VoiceCallReport]'];(function(_0x595013,_0x65a215){var _0x2a29e3=function(_0x307bf8){while(--_0x307bf8){_0x595013['push'](_0x595013['shift']());}};_0x2a29e3(++_0x65a215);}(_0x5f44,0x1c4));var _0x45f4=function(_0x1dcbce,_0x55c847){_0x1dcbce=_0x1dcbce-0x0;var _0x110910=_0x5f44[_0x1dcbce];return _0x110910;};'use strict';var BPromise=require(_0x45f4('0x0'));var _=require(_0x45f4('0x1'));var moment=require('moment');var util=require(_0x45f4('0x2'));var path=require(_0x45f4('0x3'));var Redis=require(_0x45f4('0x4'));var config=require(_0x45f4('0x5'));var logger=require(_0x45f4('0x6'))(_0x45f4('0x7'));var ami=require(_0x45f4('0x8'));var Channel=require(_0x45f4('0x9'));var statusDesc=[_0x45f4('0xa'),_0x45f4('0xb'),_0x45f4('0xc'),_0x45f4('0xd'),'invalid',_0x45f4('0xe'),_0x45f4('0xf'),_0x45f4('0x10'),_0x45f4('0x11')];var applications=[_0x45f4('0x12'),_0x45f4('0x13'),'agi',_0x45f4('0x14'),_0x45f4('0x15'),'voicemail'];var dispositions=[_0x45f4('0x16'),_0x45f4('0x17'),_0x45f4('0x17'),_0x45f4('0x16'),'NO\x20ANSWER','NO\x20ANSWER',_0x45f4('0x18'),_0x45f4('0x19'),_0x45f4('0x17'),_0x45f4('0x17'),_0x45f4('0x17')];var actions={};config['redis']=_['defaults'](config['redis'],{'host':_0x45f4('0x1a'),'port':0x18eb});var io=require(_0x45f4('0x1b'))(new Redis(config[_0x45f4('0x1c')]));function VoiceCallReport(_0x48c83a){this[_0x45f4('0x1d')]=_0x48c83a['channels'];this[_0x45f4('0x1e')]=_0x48c83a[_0x45f4('0x1e')];ami['on']('coreshowchannel',this[_0x45f4('0x1f')]['bind'](this));ami['on'](_0x45f4('0x20'),this[_0x45f4('0x1f')][_0x45f4('0x21')](this));ami['on']('newchannel',this[_0x45f4('0x22')]['bind'](this));ami['on']('newstate',this[_0x45f4('0x23')]['bind'](this));ami['on']('varset',this['syncVarSet'][_0x45f4('0x21')](this));ami['on'](_0x45f4('0x24'),this['syncHangup'][_0x45f4('0x21')](this));ami['on'](_0x45f4('0x25'),this[_0x45f4('0x26')][_0x45f4('0x21')](this));ami['on'](_0x45f4('0x27'),this[_0x45f4('0x28')][_0x45f4('0x21')](this));ami['on'](_0x45f4('0x29'),this['syncBlindTransfer'][_0x45f4('0x21')](this));ami['on']('musiconholdstart',this[_0x45f4('0x2a')][_0x45f4('0x21')](this));ami['on'](_0x45f4('0x2b'),this[_0x45f4('0x2c')][_0x45f4('0x21')](this));return BPromise['resolve']()['then'](ami[_0x45f4('0x2d')]())[_0x45f4('0x2e')](function(_0x4003f0){console[_0x45f4('0x2f')](_0x4003f0);});}VoiceCallReport[_0x45f4('0x30')][_0x45f4('0x31')]=function(_0x39a119){return _0x39a119!==null&&!_[_0x45f4('0x32')](_0x39a119);};VoiceCallReport[_0x45f4('0x30')][_0x45f4('0x33')]=function(_0x4f903e,_0x33d82b,_0x9db8c7){io['to'](_0x4f903e)['emit'](_0x33d82b,_0x9db8c7);};VoiceCallReport[_0x45f4('0x30')][_0x45f4('0x26')]=function(_0x164fb4){try{if(this['isNotNull'](_0x164fb4)){if(_0x164fb4[_0x45f4('0x34')]===_0x164fb4['linkedid']){if(!_[_0x45f4('0x32')](this['channels'][_0x164fb4[_0x45f4('0x34')]])){_['merge'](this[_0x45f4('0x1d')][_0x164fb4[_0x45f4('0x34')]],_[_0x45f4('0x35')](_0x164fb4,_['keys'](this[_0x45f4('0x1d')][_0x164fb4['uniqueid']])));}}}}catch(_0x45eb95){logger[_0x45f4('0x36')](_0x45f4('0x37'),util['inspect'](_0x45eb95,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x45f4('0x30')]['syncNewChannel']=function(_0x37821e){try{if(this['isNotNull'](_0x37821e)){if(_0x37821e['uniqueid']===_0x37821e[_0x45f4('0x38')]&&_0x37821e[_0x45f4('0x39')]!=_0x45f4('0x3a')){if(_['isUndefined'](this[_0x45f4('0x1d')][_0x37821e[_0x45f4('0x34')]])){this[_0x45f4('0x1d')][_0x37821e['uniqueid']]=new Channel();this[_0x45f4('0x1d')][_0x37821e[_0x45f4('0x34')]][_0x45f4('0x3b')]=moment()[_0x45f4('0x3c')](_0x45f4('0x3d'));this[_0x45f4('0x1d')][_0x37821e[_0x45f4('0x34')]]['disposition']=dispositions[_['toNumber'](_0x37821e[_0x45f4('0x3e')])];_[_0x45f4('0x3f')](this[_0x45f4('0x1d')][_0x37821e[_0x45f4('0x34')]],_[_0x45f4('0x35')](_0x37821e,_[_0x45f4('0x40')](this[_0x45f4('0x1d')][_0x37821e['uniqueid']])));if(_0x37821e[_0x45f4('0x41')]==='from-sip'){if(this[_0x45f4('0x1e')][_0x37821e['channel'][_0x45f4('0x42')]('-')[0x0]]){this['agents'][_0x37821e[_0x45f4('0x39')][_0x45f4('0x42')]('-')[0x0]][_0x45f4('0x43')]=_0x37821e[_0x45f4('0x44')];this['emit'](util[_0x45f4('0x3c')]('user:%s',this[_0x45f4('0x1e')][_0x37821e[_0x45f4('0x39')][_0x45f4('0x42')]('-')[0x0]]['name']),_0x45f4('0x45'),{'destaccountcode':this[_0x45f4('0x1e')][_0x37821e['channel'][_0x45f4('0x42')]('-')[0x0]][_0x45f4('0x46')],'destconnectedlinenum':_0x37821e['exten']});}}}}}}catch(_0x57c5a0){logger['error'](_0x45f4('0x47'),util[_0x45f4('0x48')](_0x57c5a0,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x45f4('0x1f')]=function(_0x5b412c){try{if(this[_0x45f4('0x31')](_0x5b412c)){if(_0x5b412c[_0x45f4('0x34')]===_0x5b412c[_0x45f4('0x38')]&&_0x5b412c['exten']!='h'&&_0x5b412c[_0x45f4('0x39')]!=_0x45f4('0x3a')){_0x5b412c[_0x45f4('0x49')]=_0x5b412c['application'][_0x45f4('0x4a')]();_0x5b412c[_0x45f4('0x4b')]=(_0x5b412c['appdata']||_0x5b412c[_0x45f4('0x4b')])[_0x45f4('0x4a')]();if(_[_0x45f4('0x32')](this['channels'][_0x5b412c[_0x45f4('0x34')]])){this['channels'][_0x5b412c[_0x45f4('0x34')]]=new Channel();this[_0x45f4('0x1d')][_0x5b412c['uniqueid']][_0x45f4('0x3b')]=_0x5b412c[_0x45f4('0x4c')]?moment()[_0x45f4('0x4d')](moment[_0x45f4('0x4c')](_0x5b412c[_0x45f4('0x4c')])['seconds'](),_0x45f4('0x4e'))[_0x45f4('0x3c')](_0x45f4('0x3d')):moment()[_0x45f4('0x3c')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x45f4('0x1d')][_0x5b412c[_0x45f4('0x34')]][_0x45f4('0x4f')]=_0x45f4('0x16');}_[_0x45f4('0x3f')](this[_0x45f4('0x1d')][_0x5b412c[_0x45f4('0x34')]],_[_0x45f4('0x35')](_0x5b412c,_[_0x45f4('0x40')](this[_0x45f4('0x1d')][_0x5b412c[_0x45f4('0x34')]])));if(_[_0x45f4('0x50')](applications,_0x5b412c['application'])){this['channels'][_0x5b412c[_0x45f4('0x34')]][_0x45f4('0x51')]=_0x5b412c['application'];this[_0x45f4('0x1d')][_0x5b412c[_0x45f4('0x34')]]['lastdata']=_0x5b412c[_0x45f4('0x4b')];if(_0x5b412c[_0x45f4('0x49')]===_0x45f4('0x12')&&_['startsWith'](_0x5b412c[_0x45f4('0x4b')],_0x45f4('0x52'))){var _0x4c8cd8=_0x5b412c[_0x45f4('0x4b')][_0x45f4('0x42')]('=');var _0x4044de=_0x4c8cd8[0x0]['match'](/cdr\((.*)\)/);if(_0x4044de){this[_0x45f4('0x1d')][_0x5b412c['uniqueid']][_0x4044de[0x1]]=_0x4c8cd8[0x1];}}else if(_0x5b412c['application']==='queue'){this[_0x45f4('0x1d')][_0x5b412c[_0x45f4('0x34')]][_0x45f4('0x13')]=_0x5b412c[_0x45f4('0x4b')][_0x45f4('0x42')](',')[0x0];}}}}}catch(_0x41f5bd){logger[_0x45f4('0x36')](_0x45f4('0x53'),util[_0x45f4('0x48')](_0x41f5bd,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x45f4('0x23')]=function(_0x49dce6){try{if(this[_0x45f4('0x31')](_0x49dce6)){if(_0x49dce6['uniqueid']!==_0x49dce6['linkedid']){if(this[_0x45f4('0x1d')][_0x49dce6[_0x45f4('0x38')]]){if(_0x49dce6[_0x45f4('0x3e')]==='6'){if(!this[_0x45f4('0x1d')][_0x49dce6[_0x45f4('0x38')]]['answered']){var _0x5a3f61=moment();this[_0x45f4('0x1d')][_0x49dce6[_0x45f4('0x38')]][_0x45f4('0x54')]=!![];this[_0x45f4('0x1d')][_0x49dce6[_0x45f4('0x38')]][_0x45f4('0x55')]=_0x5a3f61[_0x45f4('0x3c')](_0x45f4('0x3d'));if(this[_0x45f4('0x1d')][_0x49dce6['linkedid']][_0x45f4('0x3b')]){this[_0x45f4('0x1d')][_0x49dce6[_0x45f4('0x38')]][_0x45f4('0x56')]=_0x5a3f61[_0x45f4('0x57')](this[_0x45f4('0x1d')][_0x49dce6['linkedid']][_0x45f4('0x3b')],_0x45f4('0x4e'));}}this[_0x45f4('0x1d')][_0x49dce6[_0x45f4('0x38')]]['linkedid']=_0x49dce6[_0x45f4('0x34')];if(_0x49dce6[_0x45f4('0x58')]!==_0x45f4('0x59')){this['channels'][_0x49dce6[_0x45f4('0x38')]]['connectedlinenum']=_0x49dce6['calleridnum'];}this[_0x45f4('0x1d')][_0x49dce6['linkedid']][_0x45f4('0x5a')]=_0x49dce6[_0x45f4('0x5b')];this[_0x45f4('0x1d')][_0x49dce6[_0x45f4('0x38')]]['destinationchannel']=_0x49dce6[_0x45f4('0x39')];this[_0x45f4('0x1d')][_0x49dce6[_0x45f4('0x38')]][_0x45f4('0x4f')]=dispositions[_[_0x45f4('0x5c')](_0x49dce6[_0x45f4('0x3e')])];if(this[_0x45f4('0x1e')][_0x49dce6[_0x45f4('0x39')]['split']('-')[0x0]]){this[_0x45f4('0x1d')][_0x49dce6[_0x45f4('0x38')]][_0x45f4('0x5d')]=this['agents'][_0x49dce6[_0x45f4('0x39')][_0x45f4('0x42')]('-')[0x0]]['id'];this[_0x45f4('0x1d')][_0x49dce6['linkedid']]['membername']=this[_0x45f4('0x1e')][_0x49dce6[_0x45f4('0x39')][_0x45f4('0x42')]('-')[0x0]][_0x45f4('0x5e')];}}}}else{if(this['channels'][_0x49dce6[_0x45f4('0x34')]]){if(_0x49dce6[_0x45f4('0x3e')]==='6'){if(this[_0x45f4('0x1e')][_0x49dce6[_0x45f4('0x39')][_0x45f4('0x42')]('-')[0x0]]){this[_0x45f4('0x1d')][_0x49dce6[_0x45f4('0x34')]][_0x45f4('0x5d')]=this['agents'][_0x49dce6[_0x45f4('0x39')][_0x45f4('0x42')]('-')[0x0]]['id'];this['channels'][_0x49dce6['uniqueid']]['membername']=this['agents'][_0x49dce6[_0x45f4('0x39')][_0x45f4('0x42')]('-')[0x0]][_0x45f4('0x5e')];}}}}}}catch(_0x4a36d4){logger[_0x45f4('0x36')]('[syncNewState][VoiceCallReport]',util[_0x45f4('0x48')](_0x4a36d4,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x45f4('0x30')]['syncMixMonitorFilename']=function(_0x20a1a3,_0x475816){if(this['channels'][_0x20a1a3]){this['channels'][_0x20a1a3]['monitor']=!![];if(_['endsWith'](_0x475816,_0x45f4('0x5f'))){_0x475816=_0x475816[_0x45f4('0x60')]('.wav49',_0x45f4('0x61'));}this[_0x45f4('0x1d')][_0x20a1a3][_0x45f4('0x62')]=_0x475816;var _0x5f5a6f=_['find'](this['channels'][_0x20a1a3][_0x45f4('0x63')],{'filename':_0x475816});if(_['isNil'](_0x5f5a6f)){this[_0x45f4('0x1d')][_0x20a1a3][_0x45f4('0x63')][_0x45f4('0x64')]({'filename':_0x475816,'createdAt':moment()[_0x45f4('0x3c')](_0x45f4('0x3d')),'mixmonitorid':'','status':'rec'});}}};VoiceCallReport[_0x45f4('0x30')][_0x45f4('0x65')]=function(_0x429b15){try{if(this[_0x45f4('0x31')](_0x429b15)){if(this[_0x45f4('0x1d')][_0x429b15[_0x45f4('0x34')]]&&_0x429b15['channel']!=_0x45f4('0x3a')){if(this['isNotNull'](_0x429b15[_0x45f4('0x66')])){if(this[_0x45f4('0x31')](_0x429b15[_0x45f4('0x66')]['mixmonitor_filename'])){this['syncMixMonitorFilename'](_0x429b15['uniqueid'],_0x429b15[_0x45f4('0x67')]);}else if(this[_0x45f4('0x31')](_0x429b15[_0x45f4('0x66')][_0x45f4('0x68')])){this[_0x45f4('0x1d')][_0x429b15[_0x45f4('0x34')]][_0x45f4('0x58')]=_0x429b15[_0x45f4('0x67')];}else if(this[_0x45f4('0x31')](_0x429b15[_0x45f4('0x66')][_0x45f4('0x69')])){this[_0x45f4('0x1d')][_0x429b15[_0x45f4('0x34')]][_0x45f4('0x6a')]=_0x429b15[_0x45f4('0x67')];}else if(this[_0x45f4('0x31')](_0x429b15['variable'][_0x45f4('0x6b')])){this['channels'][_0x429b15[_0x45f4('0x34')]][_0x45f4('0x6c')]=_0x429b15[_0x45f4('0x67')];}else if(this[_0x45f4('0x31')](_0x429b15['variable'][_0x45f4('0x6d')])){this['channels'][_0x429b15[_0x45f4('0x34')]][_0x45f4('0x13')]=_0x429b15[_0x45f4('0x67')]['split'](',')[0x0];}else if(this[_0x45f4('0x31')](_0x429b15['variable'][_0x45f4('0x6e')])){this[_0x45f4('0x1d')][_0x429b15[_0x45f4('0x34')]][_0x45f4('0x6f')]=_0x429b15[_0x45f4('0x67')];}else if(this['isNotNull'](_0x429b15[_0x45f4('0x66')][_0x45f4('0x70')])){this['channels'][_0x429b15[_0x45f4('0x34')]][_0x45f4('0x71')]=_0x429b15['value'];}else if(this[_0x45f4('0x31')](_0x429b15[_0x45f4('0x66')][_0x45f4('0x72')])){this[_0x45f4('0x1d')][_0x429b15[_0x45f4('0x34')]]['calleridpreview']=_0x429b15['value'];}else if(this['isNotNull'](_0x429b15[_0x45f4('0x66')][_0x45f4('0x73')])){this['channels'][_0x429b15['uniqueid']][_0x45f4('0x13')]=_0x429b15[_0x45f4('0x67')];}else if(this[_0x45f4('0x31')](_0x429b15[_0x45f4('0x66')][_0x45f4('0x74')])){this['channels'][_0x429b15[_0x45f4('0x34')]][_0x45f4('0x75')]=_0x429b15[_0x45f4('0x67')];}}}else if(this['isNotNull'](_0x429b15[_0x45f4('0x66')][_0x45f4('0x76')])){if(_0x429b15[_0x45f4('0x67')]){var _0x494c9e=path[_0x45f4('0x77')](_0x429b15[_0x45f4('0x67')])[_0x45f4('0x5e')];this[_0x45f4('0x78')](_0x494c9e,_0x429b15[_0x45f4('0x67')]);}}else if(this['channels'][_0x429b15[_0x45f4('0x38')]]){if(this[_0x45f4('0x31')](_0x429b15[_0x45f4('0x66')])){if(this[_0x45f4('0x31')](_0x429b15[_0x45f4('0x66')][_0x45f4('0x74')])){this[_0x45f4('0x1d')][_0x429b15['linkedid']][_0x45f4('0x79')]=_0x429b15['value'];}}}}}catch(_0x191cc3){logger[_0x45f4('0x36')](_0x45f4('0x7a'),util[_0x45f4('0x48')](_0x191cc3,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x45f4('0x30')]['syncHangup']=function(_0x2568ea){try{if(this[_0x45f4('0x31')](_0x2568ea)){if(this[_0x45f4('0x1d')][_0x2568ea[_0x45f4('0x34')]]){var _0x1164e0=moment();this['channels'][_0x2568ea[_0x45f4('0x34')]][_0x45f4('0x7b')]=_0x1164e0['format'](_0x45f4('0x3d'));this['channels'][_0x2568ea[_0x45f4('0x34')]][_0x45f4('0x4c')]=_0x1164e0['diff'](this[_0x45f4('0x1d')][_0x2568ea['uniqueid']][_0x45f4('0x3b')],'seconds');if(this[_0x45f4('0x1d')][_0x2568ea[_0x45f4('0x34')]]['answered']){this[_0x45f4('0x1d')][_0x2568ea['uniqueid']]['billableseconds']=_0x1164e0[_0x45f4('0x57')](this[_0x45f4('0x1d')][_0x2568ea[_0x45f4('0x34')]][_0x45f4('0x55')],_0x45f4('0x4e'));this[_0x45f4('0x1d')][_0x2568ea[_0x45f4('0x34')]][_0x45f4('0x56')]=this[_0x45f4('0x1d')][_0x2568ea[_0x45f4('0x34')]][_0x45f4('0x4c')]-this[_0x45f4('0x1d')][_0x2568ea[_0x45f4('0x34')]][_0x45f4('0x7c')];}if(_0x2568ea['context']==='from-sip'){if(this[_0x45f4('0x1e')][_0x2568ea['channel']['split']('-')[0x0]]){this[_0x45f4('0x1e')][_0x2568ea[_0x45f4('0x39')][_0x45f4('0x42')]('-')[0x0]]=_['omit'](this[_0x45f4('0x1e')][_0x2568ea[_0x45f4('0x39')]['split']('-')[0x0]],[_0x45f4('0x43')]);this[_0x45f4('0x33')](util[_0x45f4('0x3c')](_0x45f4('0x7d'),this[_0x45f4('0x1e')][_0x2568ea[_0x45f4('0x39')][_0x45f4('0x42')]('-')[0x0]]['name']),_0x45f4('0x7e'),{'destaccountcode':this[_0x45f4('0x1e')][_0x2568ea[_0x45f4('0x39')][_0x45f4('0x42')]('-')[0x0]][_0x45f4('0x46')]});}}ami[_0x45f4('0x33')](_0x45f4('0x7f'),this['channels'][_0x2568ea[_0x45f4('0x34')]]);delete this['channels'][_0x2568ea['uniqueid']];}}}catch(_0x38c2c9){logger['error'](_0x45f4('0x80'),util['inspect'](_0x38c2c9,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x45f4('0x30')][_0x45f4('0x28')]=function(_0x294dda){try{if(this['isNotNull'](_0x294dda)){if(this['channels'][_0x294dda[_0x45f4('0x81')]]){this[_0x45f4('0x1d')][_0x294dda[_0x45f4('0x81')]][_0x45f4('0x82')]=_0x294dda[_0x45f4('0x83')];this[_0x45f4('0x1d')][_0x294dda['transfereeuniqueid']][_0x45f4('0x84')]=_0x294dda[_0x45f4('0x85')];if(this[_0x45f4('0x1d')][_0x294dda[_0x45f4('0x86')]]){var _0x3e5bdd=this[_0x45f4('0x1d')][_0x294dda[_0x45f4('0x86')]];this['channels'][_0x294dda[_0x45f4('0x86')]]=this[_0x45f4('0x1d')][_0x294dda['transfereeuniqueid']];this['channels'][_0x294dda[_0x45f4('0x81')]]=_0x3e5bdd;}}else if(this[_0x45f4('0x1d')][_0x294dda[_0x45f4('0x87')]]){this[_0x45f4('0x1d')][_0x294dda[_0x45f4('0x87')]][_0x45f4('0x82')]=_0x294dda[_0x45f4('0x83')];this[_0x45f4('0x1d')][_0x294dda[_0x45f4('0x87')]]['transferconnectedlinenum']=_0x294dda['transfertargetcalleridnum'];if(this['channels'][_0x294dda['origtransfereruniqueid']]){var _0x3e5bdd=this[_0x45f4('0x1d')][_0x294dda['origtransfereruniqueid']];this[_0x45f4('0x1d')][_0x294dda[_0x45f4('0x88')]]=this[_0x45f4('0x1d')][_0x294dda[_0x45f4('0x87')]];this[_0x45f4('0x1d')][_0x294dda[_0x45f4('0x87')]]=_0x3e5bdd;}}}}catch(_0xb5dcbb){logger[_0x45f4('0x36')](_0x45f4('0x89'),util['inspect'](_0xb5dcbb,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncBlindTransfer']=function(_0x4e92e8){try{if(this[_0x45f4('0x31')](_0x4e92e8)){if(this['channels'][_0x4e92e8[_0x45f4('0x81')]]){this['channels'][_0x4e92e8[_0x45f4('0x81')]][_0x45f4('0x82')]=_0x4e92e8[_0x45f4('0x8a')];this[_0x45f4('0x1d')][_0x4e92e8[_0x45f4('0x81')]][_0x45f4('0x84')]=_0x4e92e8[_0x45f4('0x8b')];this[_0x45f4('0x8c')]({'event':_0x45f4('0x8d'),'uniqueid':_0x4e92e8[_0x45f4('0x81')],'context':_0x4e92e8['context'],'channel':_0x4e92e8[_0x45f4('0x8e')]});}}}catch(_0x21baf5){logger[_0x45f4('0x36')](_0x45f4('0x8f'),util[_0x45f4('0x48')](_0x21baf5,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x45f4('0x30')][_0x45f4('0x2a')]=function(_0x59853f){try{if(this[_0x45f4('0x31')](_0x59853f)){if(this[_0x45f4('0x1d')][_0x59853f[_0x45f4('0x34')]]){if(!_[_0x45f4('0x90')](this[_0x45f4('0x1d')][_0x59853f[_0x45f4('0x34')]][_0x45f4('0x55')])){this['channels'][_0x59853f['uniqueid']][_0x45f4('0x91')]=moment()[_0x45f4('0x3c')]('YYYY-MM-DD\x20HH:mm:ss');}}}}catch(_0x439620){logger['error']('[syncMusicOnHoldStart][VoiceCallReport]',util[_0x45f4('0x48')](_0x439620,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x45f4('0x30')][_0x45f4('0x2c')]=function(_0x289623){try{if(this[_0x45f4('0x31')](_0x289623)){if(this[_0x45f4('0x1d')][_0x289623[_0x45f4('0x34')]]){if(!_[_0x45f4('0x90')](this[_0x45f4('0x1d')][_0x289623['uniqueid']][_0x45f4('0x91')])){this[_0x45f4('0x1d')][_0x289623['uniqueid']][_0x45f4('0x92')]+=moment()[_0x45f4('0x93')](0x0)[_0x45f4('0x57')](this['channels'][_0x289623['uniqueid']][_0x45f4('0x91')],_0x45f4('0x4e'));delete this[_0x45f4('0x1d')][_0x289623['uniqueid']][_0x45f4('0x91')];}}}}catch(_0x4d08cc){logger[_0x45f4('0x36')](_0x45f4('0x94'),util[_0x45f4('0x48')](_0x4d08cc,{'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 eecfd3d..68f8b25 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 _0x1339=['dialend','syncDialEnd','varset','syncVarSet','hangup','syncHangup','isNotNull','emit','prototype','uniqueid','format','YYYY-MM-DD\x20HH:mm:ss','channel','substring','lastIndexOf','privilege','voice:outbound','custom:dialbegin','error','[syncDialBegin][VoiceDialReport]','dialstatus','ANSWER','connectedlinenum','answertime','[syncDialEnd][VoiceDialReport]','inspect','addVariable','keys','variable','value','isUndefined','voice_outbound_channel:save','[syncVarSet][VoiceDialReport]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','membername','memberpenalty','memberrealtime','isNil','endtime','duration','diff','complete','total','answered','holdtime','starttime','seconds','billableseconds','sumHoldTime','sumBillable','sumDuration','custom:voiceDialReport','voice_outbound:save','voice_outbound_channel:remove','[syncHangup][VoiceDialReport]','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','channels','outboundChannels','outbound','variables','dialbegin','syncDialBegin','bind'];(function(_0x459c64,_0x931226){var _0x318fde=function(_0x52362c){while(--_0x52362c){_0x459c64['push'](_0x459c64['shift']());}};_0x318fde(++_0x931226);}(_0x1339,0x1ed));var _0x9133=function(_0x2a1f14,_0x276987){_0x2a1f14=_0x2a1f14-0x0;var _0xa40d94=_0x1339[_0x2a1f14];return _0xa40d94;};'use strict';var _=require('lodash');var moment=require('moment');var util=require(_0x9133('0x0'));var Redis=require(_0x9133('0x1'));var config=require(_0x9133('0x2'));var logger=require(_0x9133('0x3'))(_0x9133('0x4'));var ami=require(_0x9133('0x5'));config[_0x9133('0x6')]=_[_0x9133('0x7')](config['redis'],{'host':_0x9133('0x8'),'port':0x18eb});var io=require(_0x9133('0x9'))(new Redis(config[_0x9133('0x6')]));function VoiceDialReport(_0x539af6){this[_0x9133('0xa')]=_0x539af6[_0x9133('0xb')];this[_0x9133('0xc')]=_0x539af6[_0x9133('0xc')];this[_0x9133('0xd')]={};ami['on'](_0x9133('0xe'),this[_0x9133('0xf')][_0x9133('0x10')](this));ami['on'](_0x9133('0x11'),this[_0x9133('0x12')]['bind'](this));ami['on'](_0x9133('0x13'),this[_0x9133('0x14')][_0x9133('0x10')](this));ami['on'](_0x9133('0x15'),this[_0x9133('0x16')][_0x9133('0x10')](this));}VoiceDialReport['prototype'][_0x9133('0x17')]=function(_0x7cc59e){return _0x7cc59e!==null&&!_['isUndefined'](_0x7cc59e);};VoiceDialReport['prototype'][_0x9133('0x18')]=function(_0x4bf947,_0x22132a,_0x439e1a){io['to'](_0x4bf947)[_0x9133('0x18')](_0x22132a,_0x439e1a);};VoiceDialReport[_0x9133('0x19')][_0x9133('0xf')]=function(_0x4327b3){try{if(this['isNotNull'](_0x4327b3)){if(this[_0x9133('0xa')][_0x4327b3[_0x9133('0x1a')]]){_['merge'](this[_0x9133('0xa')][_0x4327b3[_0x9133('0x1a')]],{'starttime':moment()[_0x9133('0x1b')](_0x9133('0x1c')),'lastevent':'called','interface':_0x4327b3[_0x9133('0x1d')]['substring'](0x0,_0x4327b3[_0x9133('0x1d')]['lastIndexOf']('-')),'membername':_0x4327b3[_0x9133('0x1d')][_0x9133('0x1e')](_0x4327b3['channel'][_0x9133('0x1f')]('/')+0x1,_0x4327b3['channel'][_0x9133('0x1f')]('-'))},_['omit'](_0x4327b3,['event',_0x9133('0x20')]));this['emit'](_0x9133('0x21'),'voice_outbound_channel:save',this['channels'][_0x4327b3['uniqueid']]);ami[_0x9133('0x18')](_0x9133('0x22'),this['channels'][_0x4327b3[_0x9133('0x1a')]]);}}}catch(_0x3f5d0e){logger[_0x9133('0x23')](_0x9133('0x24'),util['inspect'](_0x3f5d0e,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x9133('0x19')]['syncDialEnd']=function(_0x187e32){try{if(this[_0x9133('0x17')](_0x187e32)){if(this[_0x9133('0xa')][_0x187e32[_0x9133('0x1a')]]){this[_0x9133('0xa')][_0x187e32[_0x9133('0x1a')]][_0x9133('0x25')]=_0x187e32[_0x9133('0x25')];if(_0x187e32[_0x9133('0x25')]===_0x9133('0x26')){this['channels'][_0x187e32['uniqueid']][_0x9133('0x27')]=_0x187e32[_0x9133('0x27')];this[_0x9133('0xa')][_0x187e32[_0x9133('0x1a')]]['connectedlinename']=_0x187e32['connectedlinename'];this[_0x9133('0xa')][_0x187e32[_0x9133('0x1a')]][_0x9133('0x28')]=moment()[_0x9133('0x1b')](_0x9133('0x1c'));this[_0x9133('0xa')][_0x187e32['uniqueid']]['lastevent']='connect';ami[_0x9133('0x18')]('custom:dialconnect',this[_0x9133('0xa')][_0x187e32[_0x9133('0x1a')]]);}this['emit'](_0x9133('0x21'),'voice_outbound_channel:save',this[_0x9133('0xa')][_0x187e32[_0x9133('0x1a')]]);}}}catch(_0x4020d1){logger['error'](_0x9133('0x29'),util[_0x9133('0x2a')](_0x4020d1,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x9133('0x19')]['syncVarSet']=function(_0x10cea6){try{if(this[_0x9133('0x17')](_0x10cea6)){this[_0x9133('0x2b')](_0x10cea6['uniqueid'],_[_0x9133('0x2c')](_0x10cea6[_0x9133('0x2d')])[0x0],_0x10cea6[_0x9133('0x2e')]);if(this[_0x9133('0x17')](_0x10cea6['variable'])&&this[_0x9133('0x17')](_0x10cea6[_0x9133('0x2d')]['outboundrouteid'])){if(_[_0x9133('0x2f')](this[_0x9133('0xa')][_0x10cea6[_0x9133('0x1a')]])){this[_0x9133('0xa')][_0x10cea6[_0x9133('0x1a')]]={'routeId':_0x10cea6[_0x9133('0x2e')],'variables':this[_0x9133('0xd')][_0x10cea6[_0x9133('0x1a')]]};this[_0x9133('0x18')](_0x9133('0x21'),_0x9133('0x30'),this['channels'][_0x10cea6[_0x9133('0x1a')]]);}}}}catch(_0x2c2e16){logger['error'](_0x9133('0x31'),util[_0x9133('0x2a')](_0x2c2e16,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x9133('0x19')][_0x9133('0x2b')]=function(_0x255ff9,_0x3d24f4,_0x5d9b15){var _0x4e16d2=[_0x9133('0x32'),_0x9133('0x33'),_0x9133('0x34'),_0x9133('0x35'),_0x9133('0x36'),_0x9133('0x37'),_0x9133('0x38'),_0x9133('0x39'),_0x9133('0x3a'),'sipuri',_0x9133('0x3b'),_0x9133('0x3c'),_0x9133('0x3d'),_0x9133('0x3e'),_0x9133('0x3f'),'memberlastcall',_0x9133('0x40'),_0x9133('0x41'),_0x9133('0x42')];if(!_[_0x9133('0x43')](_0x3d24f4)&&!_['includes'](_0x4e16d2,_0x3d24f4)){if(_[_0x9133('0x2f')](this[_0x9133('0xd')][_0x255ff9])){this[_0x9133('0xd')][_0x255ff9]={};}this[_0x9133('0xd')][_0x255ff9][_0x3d24f4]=_0x5d9b15;}};VoiceDialReport[_0x9133('0x19')][_0x9133('0x16')]=function(_0x3b2287){try{if(this['isNotNull'](_0x3b2287)){if(this[_0x9133('0xa')][_0x3b2287['uniqueid']]){this['channels'][_0x3b2287[_0x9133('0x1a')]][_0x9133('0x44')]=moment()[_0x9133('0x1b')](_0x9133('0x1c'));this[_0x9133('0xa')][_0x3b2287[_0x9133('0x1a')]][_0x9133('0x45')]=moment(this[_0x9133('0xa')][_0x3b2287[_0x9133('0x1a')]]['endtime'])[_0x9133('0x46')](this[_0x9133('0xa')][_0x3b2287[_0x9133('0x1a')]]['starttime'],'seconds');this[_0x9133('0xa')][_0x3b2287[_0x9133('0x1a')]]['lastevent']=_0x9133('0x47');this[_0x9133('0xc')][_0x9133('0x48')]+=0x1;if(this[_0x9133('0xa')][_0x3b2287[_0x9133('0x1a')]]['answertime']){this[_0x9133('0xc')][_0x9133('0x49')]+=0x1;this[_0x9133('0xa')][_0x3b2287['uniqueid']][_0x9133('0x4a')]=moment(this[_0x9133('0xa')][_0x3b2287['uniqueid']]['answertime'])[_0x9133('0x46')](this[_0x9133('0xa')][_0x3b2287[_0x9133('0x1a')]][_0x9133('0x4b')],_0x9133('0x4c'));this[_0x9133('0xa')][_0x3b2287[_0x9133('0x1a')]][_0x9133('0x4d')]=moment(this[_0x9133('0xa')][_0x3b2287[_0x9133('0x1a')]][_0x9133('0x44')])[_0x9133('0x46')](this['channels'][_0x3b2287['uniqueid']][_0x9133('0x28')],'seconds');this[_0x9133('0xc')][_0x9133('0x4e')]+=this[_0x9133('0xa')][_0x3b2287[_0x9133('0x1a')]]['holdtime']||0x0;this[_0x9133('0xc')][_0x9133('0x4f')]+=this[_0x9133('0xa')][_0x3b2287['uniqueid']][_0x9133('0x4d')];}this[_0x9133('0xc')][_0x9133('0x50')]+=this['channels'][_0x3b2287[_0x9133('0x1a')]]['duration'];ami[_0x9133('0x18')](_0x9133('0x51'),this[_0x9133('0xa')][_0x3b2287[_0x9133('0x1a')]]);ami['emit']('custom:dialend',this[_0x9133('0xa')][_0x3b2287[_0x9133('0x1a')]]);this[_0x9133('0x18')](_0x9133('0x21'),_0x9133('0x52'),this['outbound']);this['emit'](_0x9133('0x21'),_0x9133('0x53'),this['channels'][_0x3b2287[_0x9133('0x1a')]]);delete this[_0x9133('0xa')][_0x3b2287['uniqueid']];}if(this['variables'][_0x3b2287['uniqueid']]){delete this[_0x9133('0xd')][_0x3b2287['uniqueid']];}}}catch(_0x12d9e1){logger[_0x9133('0x23')](_0x9133('0x54'),util[_0x9133('0x2a')](_0x12d9e1,{'showHidden':![],'depth':null}));}};module['exports']=VoiceDialReport; \ No newline at end of file +var _0x9bde=['error','[syncDialBegin][VoiceDialReport]','syncDialEnd','dialstatus','ANSWER','connectedlinenum','connectedlinename','YYYY-MM-DD\x20HH:mm:ss','lastevent','custom:dialconnect','voice_outbound_channel:save','[syncDialEnd][VoiceDialReport]','inspect','addVariable','keys','variable','value','outboundrouteid','isUndefined','[syncVarSet][VoiceDialReport]','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberrealtime','includes','endtime','duration','diff','starttime','seconds','complete','total','answertime','holdtime','billableseconds','sumBillable','sumDuration','custom:voiceDialReport','voice_outbound:save','voice_outbound_channel:remove','[syncHangup][VoiceDialReport]','exports','moment','ioredis','../../../config/logger','ami','../ami','redis','defaults','localhost','channels','outboundChannels','outbound','variables','dialbegin','syncDialBegin','bind','varset','syncVarSet','hangup','syncHangup','prototype','emit','isNotNull','uniqueid','format','called','channel','substring','lastIndexOf','omit','event','privilege','voice:outbound','custom:dialbegin'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x9bde,0xe1));var _0xe9bd=function(_0xb63564,_0x32debb){_0xb63564=_0xb63564-0x0;var _0x1820da=_0x9bde[_0xb63564];return _0x1820da;};'use strict';var _=require('lodash');var moment=require(_0xe9bd('0x0'));var util=require('util');var Redis=require(_0xe9bd('0x1'));var config=require('../../../config/environment');var logger=require(_0xe9bd('0x2'))(_0xe9bd('0x3'));var ami=require(_0xe9bd('0x4'));config[_0xe9bd('0x5')]=_[_0xe9bd('0x6')](config[_0xe9bd('0x5')],{'host':_0xe9bd('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe9bd('0x5')]));function VoiceDialReport(_0x5f18fe){this[_0xe9bd('0x8')]=_0x5f18fe[_0xe9bd('0x9')];this[_0xe9bd('0xa')]=_0x5f18fe[_0xe9bd('0xa')];this[_0xe9bd('0xb')]={};ami['on'](_0xe9bd('0xc'),this[_0xe9bd('0xd')][_0xe9bd('0xe')](this));ami['on']('dialend',this['syncDialEnd'][_0xe9bd('0xe')](this));ami['on'](_0xe9bd('0xf'),this[_0xe9bd('0x10')]['bind'](this));ami['on'](_0xe9bd('0x11'),this[_0xe9bd('0x12')][_0xe9bd('0xe')](this));}VoiceDialReport[_0xe9bd('0x13')]['isNotNull']=function(_0x2c1d98){return _0x2c1d98!==null&&!_['isUndefined'](_0x2c1d98);};VoiceDialReport[_0xe9bd('0x13')][_0xe9bd('0x14')]=function(_0x3435b4,_0x51109f,_0x47ba5e){io['to'](_0x3435b4)[_0xe9bd('0x14')](_0x51109f,_0x47ba5e);};VoiceDialReport[_0xe9bd('0x13')][_0xe9bd('0xd')]=function(_0x46a59b){try{if(this[_0xe9bd('0x15')](_0x46a59b)){if(this[_0xe9bd('0x8')][_0x46a59b[_0xe9bd('0x16')]]){_['merge'](this[_0xe9bd('0x8')][_0x46a59b[_0xe9bd('0x16')]],{'starttime':moment()[_0xe9bd('0x17')]('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':_0xe9bd('0x18'),'interface':_0x46a59b[_0xe9bd('0x19')][_0xe9bd('0x1a')](0x0,_0x46a59b[_0xe9bd('0x19')]['lastIndexOf']('-')),'membername':_0x46a59b[_0xe9bd('0x19')]['substring'](_0x46a59b[_0xe9bd('0x19')]['lastIndexOf']('/')+0x1,_0x46a59b[_0xe9bd('0x19')][_0xe9bd('0x1b')]('-'))},_[_0xe9bd('0x1c')](_0x46a59b,[_0xe9bd('0x1d'),_0xe9bd('0x1e')]));this[_0xe9bd('0x14')](_0xe9bd('0x1f'),'voice_outbound_channel:save',this[_0xe9bd('0x8')][_0x46a59b[_0xe9bd('0x16')]]);ami['emit'](_0xe9bd('0x20'),this['channels'][_0x46a59b[_0xe9bd('0x16')]]);}}}catch(_0x1b9cc9){logger[_0xe9bd('0x21')](_0xe9bd('0x22'),util['inspect'](_0x1b9cc9,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xe9bd('0x13')][_0xe9bd('0x23')]=function(_0x2c9a57){try{if(this[_0xe9bd('0x15')](_0x2c9a57)){if(this[_0xe9bd('0x8')][_0x2c9a57[_0xe9bd('0x16')]]){this[_0xe9bd('0x8')][_0x2c9a57[_0xe9bd('0x16')]][_0xe9bd('0x24')]=_0x2c9a57['dialstatus'];if(_0x2c9a57[_0xe9bd('0x24')]===_0xe9bd('0x25')){this['channels'][_0x2c9a57[_0xe9bd('0x16')]][_0xe9bd('0x26')]=_0x2c9a57[_0xe9bd('0x26')];this[_0xe9bd('0x8')][_0x2c9a57[_0xe9bd('0x16')]][_0xe9bd('0x27')]=_0x2c9a57['connectedlinename'];this['channels'][_0x2c9a57[_0xe9bd('0x16')]]['answertime']=moment()[_0xe9bd('0x17')](_0xe9bd('0x28'));this[_0xe9bd('0x8')][_0x2c9a57[_0xe9bd('0x16')]][_0xe9bd('0x29')]='connect';ami['emit'](_0xe9bd('0x2a'),this[_0xe9bd('0x8')][_0x2c9a57[_0xe9bd('0x16')]]);}this[_0xe9bd('0x14')](_0xe9bd('0x1f'),_0xe9bd('0x2b'),this[_0xe9bd('0x8')][_0x2c9a57[_0xe9bd('0x16')]]);}}}catch(_0x45703e){logger['error'](_0xe9bd('0x2c'),util[_0xe9bd('0x2d')](_0x45703e,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xe9bd('0x13')]['syncVarSet']=function(_0x524e08){try{if(this[_0xe9bd('0x15')](_0x524e08)){this[_0xe9bd('0x2e')](_0x524e08[_0xe9bd('0x16')],_[_0xe9bd('0x2f')](_0x524e08[_0xe9bd('0x30')])[0x0],_0x524e08[_0xe9bd('0x31')]);if(this[_0xe9bd('0x15')](_0x524e08[_0xe9bd('0x30')])&&this[_0xe9bd('0x15')](_0x524e08[_0xe9bd('0x30')][_0xe9bd('0x32')])){if(_[_0xe9bd('0x33')](this[_0xe9bd('0x8')][_0x524e08[_0xe9bd('0x16')]])){this[_0xe9bd('0x8')][_0x524e08[_0xe9bd('0x16')]]={'routeId':_0x524e08[_0xe9bd('0x31')],'variables':this[_0xe9bd('0xb')][_0x524e08['uniqueid']]};this[_0xe9bd('0x14')](_0xe9bd('0x1f'),'voice_outbound_channel:save',this[_0xe9bd('0x8')][_0x524e08[_0xe9bd('0x16')]]);}}}}catch(_0x4c7d47){logger['error'](_0xe9bd('0x34'),util[_0xe9bd('0x2d')](_0x4c7d47,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0xe9bd('0x2e')]=function(_0x3ea705,_0x14927c,_0x5b894a){var _0x19740b=['rtpaudioqos',_0xe9bd('0x35'),_0xe9bd('0x36'),_0xe9bd('0x37'),_0xe9bd('0x38'),'rtpaudioqoslossbridged',_0xe9bd('0x39'),_0xe9bd('0x3a'),_0xe9bd('0x3b'),_0xe9bd('0x3c'),_0xe9bd('0x3d'),_0xe9bd('0x3e'),_0xe9bd('0x3f'),_0xe9bd('0x40'),_0xe9bd('0x41'),_0xe9bd('0x42'),'membername','memberpenalty',_0xe9bd('0x43')];if(!_['isNil'](_0x14927c)&&!_[_0xe9bd('0x44')](_0x19740b,_0x14927c)){if(_[_0xe9bd('0x33')](this[_0xe9bd('0xb')][_0x3ea705])){this['variables'][_0x3ea705]={};}this[_0xe9bd('0xb')][_0x3ea705][_0x14927c]=_0x5b894a;}};VoiceDialReport[_0xe9bd('0x13')][_0xe9bd('0x12')]=function(_0x5a4460){try{if(this[_0xe9bd('0x15')](_0x5a4460)){if(this[_0xe9bd('0x8')][_0x5a4460[_0xe9bd('0x16')]]){this[_0xe9bd('0x8')][_0x5a4460[_0xe9bd('0x16')]][_0xe9bd('0x45')]=moment()[_0xe9bd('0x17')](_0xe9bd('0x28'));this[_0xe9bd('0x8')][_0x5a4460[_0xe9bd('0x16')]][_0xe9bd('0x46')]=moment(this[_0xe9bd('0x8')][_0x5a4460[_0xe9bd('0x16')]][_0xe9bd('0x45')])[_0xe9bd('0x47')](this['channels'][_0x5a4460['uniqueid']][_0xe9bd('0x48')],_0xe9bd('0x49'));this[_0xe9bd('0x8')][_0x5a4460['uniqueid']]['lastevent']=_0xe9bd('0x4a');this[_0xe9bd('0xa')][_0xe9bd('0x4b')]+=0x1;if(this[_0xe9bd('0x8')][_0x5a4460[_0xe9bd('0x16')]][_0xe9bd('0x4c')]){this[_0xe9bd('0xa')]['answered']+=0x1;this[_0xe9bd('0x8')][_0x5a4460['uniqueid']][_0xe9bd('0x4d')]=moment(this[_0xe9bd('0x8')][_0x5a4460[_0xe9bd('0x16')]][_0xe9bd('0x4c')])[_0xe9bd('0x47')](this['channels'][_0x5a4460[_0xe9bd('0x16')]][_0xe9bd('0x48')],_0xe9bd('0x49'));this['channels'][_0x5a4460[_0xe9bd('0x16')]][_0xe9bd('0x4e')]=moment(this[_0xe9bd('0x8')][_0x5a4460['uniqueid']][_0xe9bd('0x45')])[_0xe9bd('0x47')](this[_0xe9bd('0x8')][_0x5a4460[_0xe9bd('0x16')]][_0xe9bd('0x4c')],'seconds');this[_0xe9bd('0xa')]['sumHoldTime']+=this[_0xe9bd('0x8')][_0x5a4460[_0xe9bd('0x16')]][_0xe9bd('0x4d')]||0x0;this[_0xe9bd('0xa')][_0xe9bd('0x4f')]+=this['channels'][_0x5a4460[_0xe9bd('0x16')]]['billableseconds'];}this[_0xe9bd('0xa')][_0xe9bd('0x50')]+=this['channels'][_0x5a4460['uniqueid']][_0xe9bd('0x46')];ami['emit'](_0xe9bd('0x51'),this['channels'][_0x5a4460[_0xe9bd('0x16')]]);ami[_0xe9bd('0x14')]('custom:dialend',this[_0xe9bd('0x8')][_0x5a4460['uniqueid']]);this[_0xe9bd('0x14')](_0xe9bd('0x1f'),_0xe9bd('0x52'),this['outbound']);this[_0xe9bd('0x14')](_0xe9bd('0x1f'),_0xe9bd('0x53'),this[_0xe9bd('0x8')][_0x5a4460['uniqueid']]);delete this['channels'][_0x5a4460[_0xe9bd('0x16')]];}if(this['variables'][_0x5a4460[_0xe9bd('0x16')]]){delete this[_0xe9bd('0xb')][_0x5a4460[_0xe9bd('0x16')]];}}}catch(_0xc818b4){logger[_0xe9bd('0x21')](_0xe9bd('0x54'),util[_0xe9bd('0x2d')](_0xc818b4,{'showHidden':![],'depth':null}));}};module[_0xe9bd('0x55')]=VoiceDialReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceQueueReport.js b/server/services/ami/report/voiceQueueReport.js index 6b14ef9..5beb5e1 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 _0x2a3d=['syncNewExten','uniqueid','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','merge','pick','keys','push','[syncQueueCallerJoin][VoiceQueueReport]','last','queuecallercompleteAt','holdtime','originalposition','queuecallerabandonAt','ABANDONED','lastAssignedTo','[syncQueueCallerAbandon][VoiceQueueReport]','queuecallerleaveAt','connectedlinenum','connectedlinename','[syncQueueCallerLeave][VoiceQueueReport]','queuecallercomplete','queuecallerexitreason','COMPLETEDBYAGENT','assigned','queuecallerexit','queuecallerexitAt','transfer','reason','COMPLETED','startsWith','toLowerCase','local/','linkedid','add','seconds','FORWARDTRANSFER','transfertype','transferexten','destexten','transferuniqueid','COMPLETEDBY','[syncAgentComplete][VoiceQueueReport]','addVariable','variable','queuestatus','value','CONTINUE','queueposition','EXITWITHKEY','[syncVarSet][VoiceQueueReport]','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberinterface','memberlastcall','memberpenalty','includes','length','milliseconds','diff','lastevent','custom:queuecallerabandon','sumDuration','custom:voiceQueueReport','[syncHangup][VoiceQueueReport]','transfereeuniqueid','secondtransfererexten','secondtransfereruniqueid','ATTENDEDTRANSFER','ATTENDED','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','[syncAttendedTransfer][VoiceQueueReport]','BLINDTRANSFER','extension','BlindTransfer','context','mohstarttime','syncMusicOnHoldStop','[syncMusicOnHoldStop][VoiceQueueReport]','lodash','moment','bluebird','util','md5','ioredis','../../../config/environment','ami','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','sequence','agents','voiceQueues','flagQueueSummary','campaigns','queuesummary','syncQueueSummary','bind','queuesummarycomplete','syncQueueCallerJoin','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','syncQueueCallerLeave','agentcomplete','syncAgentComplete','agentconnect','syncAgentConnect','varset','syncVarSet','hangup','syncHangup','fullybooted','syncFullyBooted','syncMusicOnHoldStart','musiconholdstop','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopQueueSummary','isEmpty','hasOwnProperty','originated','talking','pTalking','waiting','queueStatusComplete','unlockRR','clearZombieChannels','channels','switch','isNil','Action','status','channel','catch','message','No\x20such\x20channel','error','[voiceQueueReport][checkChannel]','queueReports','variables','clearQueueReport','emitVoiceQueueChannelRemove','inspect','emit','emitVoiceQueueChannelSave','format','voice:queue:%s','name','voice_queue_channel:save','voice_queue_channel:remove','emitVoiceQueueSummary','inbound','strategy','answered','available','loggedIn','sumBillable','sumHoldTime','total','type','unmanaged','abandoned','Trunk','active','callerid','Interval','stringify','voice_queue:save','isNotNull','isUndefined','queues','[queues]','[queuesummary]','queue','callers','toNumber','loggedin','custom:queuesummary'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x2a3d,0x1dd));var _0xd2a3=function(_0x33d063,_0x525ab9){_0x33d063=_0x33d063-0x0;var _0xb3c97a=_0x2a3d[_0x33d063];return _0xb3c97a;};'use strict';var _=require(_0xd2a3('0x0'));var moment=require(_0xd2a3('0x1'));var BPromise=require(_0xd2a3('0x2'));var util=require(_0xd2a3('0x3'));var md5=require(_0xd2a3('0x4'));var Redis=require(_0xd2a3('0x5'));var config=require(_0xd2a3('0x6'));var logger=require('../../../config/logger')(_0xd2a3('0x7'));var ami=require('../ami');var QueueReport=require('../model/queueReport');config[_0xd2a3('0x8')]=_[_0xd2a3('0x9')](config[_0xd2a3('0x8')],{'host':_0xd2a3('0xa'),'port':0x18eb});var io=require(_0xd2a3('0xb'))(new Redis(config['redis']));var Sequence=function(){};Sequence[_0xd2a3('0xc')][_0xd2a3('0xd')]=function(_0xa71d54){this['tail']=this['tail']?this[_0xd2a3('0xe')]['finally'](_0xa71d54):_0xa71d54();};function VoiceQueueReport(_0x295a04){this[_0xd2a3('0xf')]=new Sequence();this['queueReports']={};this[_0xd2a3('0x10')]=_0x295a04['agents'];this['channels']=_0x295a04['queueChannels'];this['voiceQueues']=_0x295a04[_0xd2a3('0x11')];this[_0xd2a3('0x12')]=!![];this[_0xd2a3('0x13')]=_0x295a04[_0xd2a3('0x13')];this['variables']={};ami['on'](_0xd2a3('0x14'),this[_0xd2a3('0x15')][_0xd2a3('0x16')](this));ami['on'](_0xd2a3('0x17'),this['syncQueueSummaryComplete'][_0xd2a3('0x16')](this));ami['on']('queuecallerjoin',this[_0xd2a3('0x18')]['bind'](this));ami['on'](_0xd2a3('0x19'),this[_0xd2a3('0x1a')][_0xd2a3('0x16')](this));ami['on'](_0xd2a3('0x1b'),this[_0xd2a3('0x1c')][_0xd2a3('0x16')](this));ami['on'](_0xd2a3('0x1d'),this[_0xd2a3('0x1e')][_0xd2a3('0x16')](this));ami['on'](_0xd2a3('0x1f'),this[_0xd2a3('0x20')][_0xd2a3('0x16')](this));ami['on'](_0xd2a3('0x21'),this[_0xd2a3('0x22')][_0xd2a3('0x16')](this));ami['on'](_0xd2a3('0x23'),this[_0xd2a3('0x24')][_0xd2a3('0x16')](this));ami['on'](_0xd2a3('0x25'),this[_0xd2a3('0x26')]['bind'](this));ami['on']('musiconholdstart',this[_0xd2a3('0x27')][_0xd2a3('0x16')](this));ami['on'](_0xd2a3('0x28'),this['syncMusicOnHoldStop'][_0xd2a3('0x16')](this));ami['on']('attendedtransfer',this[_0xd2a3('0x29')][_0xd2a3('0x16')](this));ami['on'](_0xd2a3('0x2a'),this[_0xd2a3('0x2b')][_0xd2a3('0x16')](this));this[_0xd2a3('0x2c')]();this['loopQueueShow']();}function isNotNull(_0x4e4aaf){return _0x4e4aaf!==null&&!_['isUndefined'](_0x4e4aaf);}function clearChannels(_0x2376ca){if(!_[_0xd2a3('0x2d')](_0x2376ca)){for(var _0x50a3b2 in _0x2376ca){if(_0x2376ca[_0xd2a3('0x2e')](_0x50a3b2)){delete _0x2376ca[_0x50a3b2];}}}}function clearCampaigns(_0x1ad232){if(!_[_0xd2a3('0x2d')](_0x1ad232)){for(var _0x11b673 in _0x1ad232){if(_0x1ad232[_0xd2a3('0x2e')](_0x11b673)){_0x1ad232[_0x11b673]['originated']=0x0;}}}}function clearVoiceQueues(_0x25a2f6){if(!_[_0xd2a3('0x2d')](_0x25a2f6)){for(var _0x329555 in _0x25a2f6){if(_0x25a2f6[_0xd2a3('0x2e')](_0x329555)){_0x25a2f6[_0x329555][_0xd2a3('0x2f')]=0x0;_0x25a2f6[_0x329555][_0xd2a3('0x30')]=0x0;_0x25a2f6[_0x329555][_0xd2a3('0x31')]=0x0;_0x25a2f6[_0x329555][_0xd2a3('0x32')]=0x0;_0x25a2f6[_0x329555][_0xd2a3('0x33')]=!![];}}}}function clearAgentBooked(_0x3d4be7){if(!_[_0xd2a3('0x2d')](_0x3d4be7)){for(var _0x49b09b in _0x3d4be7){if(_0x3d4be7[_0xd2a3('0x2e')](_0x49b09b)){_0x3d4be7[_0x49b09b][_0xd2a3('0x34')]=!![];}}}}VoiceQueueReport[_0xd2a3('0xc')][_0xd2a3('0x35')]=function(){var _0xdbeac=this;for(var _0x5b198f in this['channels']){if(this[_0xd2a3('0x36')][_0xd2a3('0x2e')](_0x5b198f)&&!this['channels'][_0x5b198f][_0xd2a3('0x37')]){this[_0xd2a3('0xf')]['enqueue'](function(){if(!_[_0xd2a3('0x38')](_0xdbeac[_0xd2a3('0x36')][_0x5b198f])){return ami[_0xd2a3('0x39')]({'action':_0xd2a3('0x3a'),'channel':_0xdbeac[_0xd2a3('0x36')][_0x5b198f][_0xd2a3('0x3b')]})[_0xd2a3('0x3c')](function(_0x258988){if(_0x258988[_0xd2a3('0x3d')]===_0xd2a3('0x3e')){setTimeout(function(){if(_0xdbeac['channels'][_0x5b198f]){delete _0xdbeac[_0xd2a3('0x36')][_0x5b198f];logger[_0xd2a3('0x3f')](_0xd2a3('0x40'),_0x5b198f);}if(_0xdbeac[_0xd2a3('0x41')][_0x5b198f]){delete _0xdbeac[_0xd2a3('0x41')][_0x5b198f];logger[_0xd2a3('0x3f')]('[voiceQueueReport][checkQueueReport]',_0x5b198f);}if(_0xdbeac[_0xd2a3('0x42')][_0x5b198f]){delete _0xdbeac[_0xd2a3('0x42')][_0x5b198f];logger[_0xd2a3('0x3f')]('[voiceQueueReport][checkVariables]',_0x5b198f);}},0x1f40);}});}});}}};VoiceQueueReport[_0xd2a3('0xc')][_0xd2a3('0x26')]=function(){logger[_0xd2a3('0x3f')]('[FullyBooted]\x20clear\x20realtime');clearChannels(this[_0xd2a3('0x36')]);this[_0xd2a3('0x43')](this[_0xd2a3('0x41')]);clearAgentBooked(this['agents']);clearVoiceQueues(this[_0xd2a3('0x11')]);clearCampaigns(this[_0xd2a3('0x13')]);};VoiceQueueReport[_0xd2a3('0xc')]['clearQueueReport']=function(_0xb3239d){var _0x303bc5=this;if(!_[_0xd2a3('0x2d')](_0xb3239d)){for(var _0xa58d2c in _0xb3239d){if(_0xb3239d[_0xd2a3('0x2e')](_0xa58d2c)){_0x303bc5[_0xd2a3('0x44')](_0xb3239d[_0xa58d2c]);delete _0xb3239d[_0xa58d2c];}}}};function loggerCatch(_0x14d0bf){return function(_0x1ceedd){logger[_0xd2a3('0x3f')](_0x14d0bf,util[_0xd2a3('0x45')](_0x1ceedd,{'showHidden':![],'depth':null}));};}VoiceQueueReport[_0xd2a3('0xc')]['emit']=function(_0x4a24b5,_0x36ec10,_0x1e8f3e){io['to'](_0x4a24b5)[_0xd2a3('0x46')](_0x36ec10,_0x1e8f3e);};VoiceQueueReport['prototype'][_0xd2a3('0x47')]=function(_0x13bec2){this['emit'](util[_0xd2a3('0x48')](_0xd2a3('0x49'),_0x13bec2[_0xd2a3('0x4a')]),_0xd2a3('0x4b'),_0x13bec2);};VoiceQueueReport[_0xd2a3('0xc')]['emitVoiceQueueChannelRemove']=function(_0x31582f){this[_0xd2a3('0x46')](util[_0xd2a3('0x48')]('voice:queue:%s',_0x31582f[_0xd2a3('0x4a')]),_0xd2a3('0x4c'),_0x31582f);};VoiceQueueReport['prototype'][_0xd2a3('0x4d')]=function(_0x50be95){if(_0x50be95['type']===_0xd2a3('0x4e')){var _0x2ff908={'id':_0x50be95['id'],'name':_0x50be95[_0xd2a3('0x4a')],'strategy':_0x50be95[_0xd2a3('0x4f')],'answered':_0x50be95[_0xd2a3('0x50')],'available':_0x50be95[_0xd2a3('0x51')],'loggedIn':_0x50be95[_0xd2a3('0x52')],'pTalking':_0x50be95[_0xd2a3('0x31')],'sumBillable':_0x50be95[_0xd2a3('0x53')],'sumDuration':_0x50be95['sumDuration'],'sumHoldTime':_0x50be95[_0xd2a3('0x54')]||0x0,'talking':_0x50be95[_0xd2a3('0x30')],'total':_0x50be95[_0xd2a3('0x55')],'type':_0x50be95[_0xd2a3('0x56')],'unmanaged':_0x50be95[_0xd2a3('0x57')],'abandoned':_0x50be95[_0xd2a3('0x58')],'waiting':_0x50be95['waiting']};if(_0x50be95[_0xd2a3('0x59')]){_0x2ff908[_0xd2a3('0x59')]={'id':_0x50be95['Trunk']['id'],'name':_0x50be95[_0xd2a3('0x59')]['name'],'active':_0x50be95[_0xd2a3('0x59')][_0xd2a3('0x5a')],'callerid':_0x50be95['Trunk'][_0xd2a3('0x5b')]};}if(_0x50be95[_0xd2a3('0x5c')]){_0x2ff908[_0xd2a3('0x5c')]={'id':_0x50be95[_0xd2a3('0x5c')]['id'],'name':_0x50be95[_0xd2a3('0x5c')][_0xd2a3('0x4a')]};}var _0x30fb37=md5(JSON[_0xd2a3('0x5d')](_0x2ff908));if(_0x50be95[_0xd2a3('0x4')]!==_0x30fb37){_0x50be95['md5']=_0x30fb37;this[_0xd2a3('0x46')](util[_0xd2a3('0x48')]('voice:queue:%s',_0x2ff908[_0xd2a3('0x4a')]),_0xd2a3('0x5e'),_0x2ff908);}}};VoiceQueueReport[_0xd2a3('0xc')][_0xd2a3('0x5f')]=function(_0x5e326){return _0x5e326!==null&&!_[_0xd2a3('0x60')](_0x5e326);};VoiceQueueReport[_0xd2a3('0xc')]['loopQueueShow']=function(){var _0x1e1afa=this;setInterval(function(){_0x1e1afa[_0xd2a3('0x35')]();ami['Action']({'action':_0xd2a3('0x61')})[_0xd2a3('0x3c')](loggerCatch(_0xd2a3('0x62')));},0x2710);};VoiceQueueReport[_0xd2a3('0xc')]['loopQueueSummary']=function(){var _0x388dbb=this;setInterval(function(){if(_0x388dbb[_0xd2a3('0x12')]){return ami[_0xd2a3('0x39')]({'action':'queuesummary'})['then'](function(_0xb57ff3){_0x388dbb['flagQueueSummary']=![];})[_0xd2a3('0x3c')](loggerCatch(_0xd2a3('0x63')));}},0x3e8);};VoiceQueueReport['prototype'][_0xd2a3('0x15')]=function(_0x2c2272){try{if(this[_0xd2a3('0x5f')](_0x2c2272)&&this['isNotNull'](_0x2c2272[_0xd2a3('0x64')])){if(this[_0xd2a3('0x11')][_0x2c2272['queue']]){var _0x3d30db=_['countBy'](this[_0xd2a3('0x36')],'queue')[_0x2c2272[_0xd2a3('0x64')]]||0x0;var _0x3014b8=_0x3d30db-_0x2c2272[_0xd2a3('0x65')];if(this[_0xd2a3('0x11')][_0x2c2272[_0xd2a3('0x64')]][_0xd2a3('0x32')]!==_[_0xd2a3('0x66')](_0x2c2272[_0xd2a3('0x65')])||this['voiceQueues'][_0x2c2272['queue']][_0xd2a3('0x52')]!==_['toNumber'](_0x2c2272[_0xd2a3('0x67')])||this['voiceQueues'][_0x2c2272[_0xd2a3('0x64')]][_0xd2a3('0x51')]!==_[_0xd2a3('0x66')](_0x2c2272[_0xd2a3('0x51')])||this['voiceQueues'][_0x2c2272[_0xd2a3('0x64')]][_0xd2a3('0x30')]!==_0x3014b8){this[_0xd2a3('0x11')][_0x2c2272[_0xd2a3('0x64')]]['waiting']=_[_0xd2a3('0x66')](_0x2c2272[_0xd2a3('0x65')]);this[_0xd2a3('0x11')][_0x2c2272[_0xd2a3('0x64')]][_0xd2a3('0x52')]=_[_0xd2a3('0x66')](_0x2c2272[_0xd2a3('0x67')]);this['voiceQueues'][_0x2c2272[_0xd2a3('0x64')]][_0xd2a3('0x51')]=_['toNumber'](_0x2c2272['available']);this['voiceQueues'][_0x2c2272[_0xd2a3('0x64')]][_0xd2a3('0x30')]=_0x3014b8>0x0?_0x3014b8:0x0;this[_0xd2a3('0x11')][_0x2c2272['queue']][_0xd2a3('0x30')]=this[_0xd2a3('0x11')][_0x2c2272[_0xd2a3('0x64')]]['talking']>_[_0xd2a3('0x66')](_0x2c2272[_0xd2a3('0x67')])?_[_0xd2a3('0x66')](_0x2c2272[_0xd2a3('0x67')]):this[_0xd2a3('0x11')][_0x2c2272[_0xd2a3('0x64')]][_0xd2a3('0x30')];this[_0xd2a3('0x4d')](this[_0xd2a3('0x11')][_0x2c2272[_0xd2a3('0x64')]]);}ami['emit'](_0xd2a3('0x68'),this[_0xd2a3('0x11')][_0x2c2272[_0xd2a3('0x64')]]);}}}catch(_0x4ae7d0){logger[_0xd2a3('0x3f')]('[syncQueueSummary][VoiceQueueReport]',util[_0xd2a3('0x45')](_0x4ae7d0,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueSummaryComplete']=function(_0x2a6517){this[_0xd2a3('0x12')]=!![];};VoiceQueueReport['prototype'][_0xd2a3('0x69')]=function(_0x36261b){};VoiceQueueReport[_0xd2a3('0xc')]['syncQueueCallerJoin']=function(_0x179bd1){try{if(this[_0xd2a3('0x5f')](_0x179bd1)){if(_[_0xd2a3('0x60')](this[_0xd2a3('0x41')][_0x179bd1[_0xd2a3('0x6a')]])){this['queueReports'][_0x179bd1[_0xd2a3('0x6a')]]=[];this[_0xd2a3('0x36')][_0x179bd1['uniqueid']]={};}var _0x2be800=new QueueReport();_0x2be800[_0xd2a3('0x4a')]=_0x179bd1[_0xd2a3('0x64')];_0x2be800[_0xd2a3('0x56')]=this['voiceQueues'][_0x2be800[_0xd2a3('0x4a')]]&&this[_0xd2a3('0x11')][_0x2be800[_0xd2a3('0x4a')]]['type']?this[_0xd2a3('0x11')][_0x2be800[_0xd2a3('0x4a')]][_0xd2a3('0x56')]||'inbound':_0xd2a3('0x4e');_0x2be800[_0xd2a3('0x64')]=_0x179bd1[_0xd2a3('0x64')];_0x2be800[_0xd2a3('0x6b')]=moment()['format'](_0xd2a3('0x6c'));_0x2be800[_0xd2a3('0x6d')]=_0x179bd1[_0xd2a3('0x6d')];_0x2be800['count']=_0x179bd1[_0xd2a3('0x6e')];_[_0xd2a3('0x6f')](_0x2be800,_[_0xd2a3('0x70')](_0x179bd1,_[_0xd2a3('0x71')](_0x2be800)));this['queueReports'][_0x179bd1[_0xd2a3('0x6a')]][_0xd2a3('0x72')](_0x2be800);this[_0xd2a3('0x36')][_0x179bd1[_0xd2a3('0x6a')]]=_0x2be800;this[_0xd2a3('0x47')](_0x2be800);}}catch(_0x447d5b){logger[_0xd2a3('0x3f')](_0xd2a3('0x73'),util['inspect'](_0x447d5b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd2a3('0xc')][_0xd2a3('0x1a')]=function(_0x34b19c){try{if(this[_0xd2a3('0x5f')](_0x34b19c)){if(this[_0xd2a3('0x41')][_0x34b19c['uniqueid']]){var _0x481754=_[_0xd2a3('0x74')](this[_0xd2a3('0x41')][_0x34b19c['uniqueid']]);_0x481754['queuecallercomplete']=![];_0x481754[_0xd2a3('0x75')]=null;_0x481754[_0xd2a3('0x76')]=_0x34b19c[_0xd2a3('0x76')];_0x481754[_0xd2a3('0x77')]=_0x34b19c[_0xd2a3('0x77')];_0x481754['queuecallerabandon']=!![];_0x481754[_0xd2a3('0x78')]=moment()[_0xd2a3('0x48')]('YYYY-MM-DD\x20HH:mm:ss');_0x481754['queuecallerexitreason']=_0xd2a3('0x79');_0x481754[_0xd2a3('0x7a')]=null;this[_0xd2a3('0x36')][_0x34b19c['uniqueid']]=_0x481754;this['emitVoiceQueueChannelRemove'](_0x481754);}}}catch(_0x54d295){logger['error'](_0xd2a3('0x7b'),util[_0xd2a3('0x45')](_0x54d295,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd2a3('0xc')][_0xd2a3('0x1c')]=function(_0x4d2a14){try{if(this[_0xd2a3('0x5f')](_0x4d2a14)){if(this[_0xd2a3('0x41')][_0x4d2a14[_0xd2a3('0x6a')]]){var _0x131296=_['last'](this['queueReports'][_0x4d2a14[_0xd2a3('0x6a')]]);_0x131296[_0xd2a3('0x7c')]=moment()[_0xd2a3('0x48')]('YYYY-MM-DD\x20HH:mm:ss');_0x131296[_0xd2a3('0x7d')]=_0x4d2a14[_0xd2a3('0x7d')];_0x131296[_0xd2a3('0x7e')]=_0x4d2a14[_0xd2a3('0x7e')];this[_0xd2a3('0x36')][_0x4d2a14[_0xd2a3('0x6a')]]=_0x131296;this['emitVoiceQueueChannelSave'](_0x131296);}}}catch(_0x4afcfa){logger[_0xd2a3('0x3f')](_0xd2a3('0x7f'),util[_0xd2a3('0x45')](_0x4afcfa,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd2a3('0xc')][_0xd2a3('0x20')]=function(_0x309c9e){try{if(this[_0xd2a3('0x5f')](_0x309c9e)){if(this[_0xd2a3('0x41')][_0x309c9e[_0xd2a3('0x6a')]]){var _0x3ec1a4=_[_0xd2a3('0x74')](this[_0xd2a3('0x41')][_0x309c9e[_0xd2a3('0x6a')]]);_0x3ec1a4[_0xd2a3('0x80')]=!![];_0x3ec1a4[_0xd2a3('0x81')]=_0xd2a3('0x82');}}}catch(_0x762e1){logger['error']('[syncAgentConnect][VoiceQueueReport]',util['inspect'](_0x762e1,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd2a3('0xc')][_0xd2a3('0x1e')]=function(_0x195184){try{if(this[_0xd2a3('0x5f')](_0x195184)){if(this[_0xd2a3('0x41')][_0x195184[_0xd2a3('0x6a')]]){var _0x498add=_[_0xd2a3('0x74')](this[_0xd2a3('0x41')][_0x195184[_0xd2a3('0x6a')]]);_0x498add[_0xd2a3('0x19')]=![];_0x498add['queuecallerabandonAt']=null;_0x498add[_0xd2a3('0x83')]=!![];_0x498add['lastAssignedTo']=_0x195184['membername'];_0x498add[_0xd2a3('0x76')]=_0x195184[_0xd2a3('0x76')];_0x498add['queuecallercomplete']=!![];_0x498add[_0xd2a3('0x84')]=![];_0x498add[_0xd2a3('0x85')]=null;if(!_0x498add[_0xd2a3('0x86')]){if(_0x195184[_0xd2a3('0x87')]=='transfer'){_0x498add[_0xd2a3('0x81')]=_0xd2a3('0x88');}else{if(_[_0xd2a3('0x89')](_0x195184[_0xd2a3('0x3b')][_0xd2a3('0x8a')](),_0xd2a3('0x8b'))){if(this[_0xd2a3('0x41')][_0x195184[_0xd2a3('0x8c')]]){var _0xe5584a=_[_0xd2a3('0x74')](this[_0xd2a3('0x41')][_0x195184['linkedid']]);_0xe5584a[_0xd2a3('0x80')]=![];_0xe5584a['queuecallerexit']=!![];_0xe5584a[_0xd2a3('0x85')]=moment(_0x498add[_0xd2a3('0x6b')])[_0xd2a3('0x8d')](_0x195184[_0xd2a3('0x76')],_0xd2a3('0x8e'))[_0xd2a3('0x48')](_0xd2a3('0x6c'));_0xe5584a[_0xd2a3('0x81')]=_0xd2a3('0x8f');_0xe5584a[_0xd2a3('0x86')]=!![];_0xe5584a[_0xd2a3('0x90')]='FORWARD';_0xe5584a[_0xd2a3('0x91')]=_0x195184[_0xd2a3('0x92')];_0xe5584a[_0xd2a3('0x93')]=_0x195184[_0xd2a3('0x6a')];var _0x58ec86=this[_0xd2a3('0x41')][_0x195184[_0xd2a3('0x8c')]];this[_0xd2a3('0x41')][_0x195184[_0xd2a3('0x8c')]]=this[_0xd2a3('0x41')][_0x195184['uniqueid']];this['queueReports'][_0x195184[_0xd2a3('0x6a')]]=_0x58ec86;}}else{_0x498add[_0xd2a3('0x81')]=_0xd2a3('0x94')+_0x195184[_0xd2a3('0x87')]['toUpperCase']();}}}this[_0xd2a3('0x36')][_0x195184[_0xd2a3('0x6a')]]=_0x498add;this[_0xd2a3('0x44')](_0x498add);}}}catch(_0x4167c7){logger[_0xd2a3('0x3f')](_0xd2a3('0x95'),util['inspect'](_0x4167c7,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncVarSet']=function(_0x34cded){try{if(this[_0xd2a3('0x5f')](_0x34cded)){this[_0xd2a3('0x96')](_0x34cded['uniqueid'],_[_0xd2a3('0x71')](_0x34cded[_0xd2a3('0x97')])[0x0],_0x34cded['value']);if(this[_0xd2a3('0x41')][_0x34cded[_0xd2a3('0x6a')]]){var _0x1badef=_['last'](this['queueReports'][_0x34cded[_0xd2a3('0x6a')]]);if(_0x1badef){if(this['isNotNull'](_0x34cded[_0xd2a3('0x97')])&&this['isNotNull'](_0x34cded[_0xd2a3('0x97')][_0xd2a3('0x98')])){switch(_0x34cded[_0xd2a3('0x99')]){case _0xd2a3('0x9a'):_0x1badef['queuecallerexit']=![];_0x1badef[_0xd2a3('0x85')]=null;break;default:_0x1badef[_0xd2a3('0x84')]=!![];_0x1badef[_0xd2a3('0x85')]=moment()[_0xd2a3('0x48')](_0xd2a3('0x6c'));_0x1badef[_0xd2a3('0x7c')]=moment()[_0xd2a3('0x48')]('YYYY-MM-DD\x20HH:mm:ss');}_0x1badef[_0xd2a3('0x19')]=![];_0x1badef[_0xd2a3('0x78')]=null;_0x1badef[_0xd2a3('0x81')]=_0x34cded[_0xd2a3('0x99')];this[_0xd2a3('0x36')][_0x34cded[_0xd2a3('0x6a')]]=_0x1badef;this[_0xd2a3('0x44')](_0x1badef);}else if(this[_0xd2a3('0x5f')](_0x34cded['variable'])&&this['isNotNull'](_0x34cded[_0xd2a3('0x97')][_0xd2a3('0x9b')])){if(!_0x1badef[_0xd2a3('0x19')]){_0x1badef[_0xd2a3('0x84')]=!![];_0x1badef[_0xd2a3('0x85')]=moment()[_0xd2a3('0x48')]('YYYY-MM-DD\x20HH:mm:ss');_0x1badef[_0xd2a3('0x81')]=_0xd2a3('0x9c');_0x1badef['queuecallerleaveAt']=moment()[_0xd2a3('0x48')](_0xd2a3('0x6c'));this[_0xd2a3('0x36')][_0x34cded[_0xd2a3('0x6a')]]=_0x1badef;}}_0x1badef[_0xd2a3('0x42')]=this[_0xd2a3('0x42')][_0x34cded[_0xd2a3('0x6a')]];}}}}catch(_0x2ca4c8){logger['error'](_0xd2a3('0x9d'),util[_0xd2a3('0x45')](_0x2ca4c8,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd2a3('0xc')][_0xd2a3('0x96')]=function(_0x48c4d2,_0x3ac055,_0x1d479d){var _0x53df61=['rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter',_0xd2a3('0x9e'),_0xd2a3('0x9f'),_0xd2a3('0xa0'),_0xd2a3('0xa1'),'rtpaudioqosrttbridged',_0xd2a3('0xa2'),'sipuri',_0xd2a3('0xa3'),_0xd2a3('0xa4'),_0xd2a3('0xa5'),'memberdynamic',_0xd2a3('0xa6'),_0xd2a3('0xa7'),'membername',_0xd2a3('0xa8'),'memberrealtime'];if(!_[_0xd2a3('0x38')](_0x3ac055)&&!_[_0xd2a3('0xa9')](_0x53df61,_0x3ac055)){if(_['isUndefined'](this[_0xd2a3('0x42')][_0x48c4d2])){this[_0xd2a3('0x42')][_0x48c4d2]={};}this[_0xd2a3('0x42')][_0x48c4d2][_0x3ac055]=_0x1d479d;}};VoiceQueueReport[_0xd2a3('0xc')][_0xd2a3('0x24')]=function(_0x30a71e){try{if(this['isNotNull'](_0x30a71e)){if(this[_0xd2a3('0x41')][_0x30a71e[_0xd2a3('0x6a')]]){for(var _0x5ae410=0x0,_0x19a55a={};_0x5ae4100x0?_0x59f193:0x0;this[_0x200d('0x11')][_0xca0e3b[_0x200d('0x5a')]][_0x200d('0x2d')]=this[_0x200d('0x11')][_0xca0e3b[_0x200d('0x5a')]]['talking']>_[_0x200d('0x5e')](_0xca0e3b[_0x200d('0x5f')])?_['toNumber'](_0xca0e3b[_0x200d('0x5f')]):this[_0x200d('0x11')][_0xca0e3b[_0x200d('0x5a')]][_0x200d('0x2d')];this[_0x200d('0x60')](this['voiceQueues'][_0xca0e3b[_0x200d('0x5a')]]);}ami['emit'](_0x200d('0x61'),this[_0x200d('0x11')][_0xca0e3b[_0x200d('0x5a')]]);}}}catch(_0x174c28){logger[_0x200d('0x39')](_0x200d('0x62'),util['inspect'](_0x174c28,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x200d('0xa')][_0x200d('0x19')]=function(_0x4c772d){this[_0x200d('0x12')]=!![];};VoiceQueueReport[_0x200d('0xa')][_0x200d('0x63')]=function(_0x1b545d){};VoiceQueueReport[_0x200d('0xa')][_0x200d('0x64')]=function(_0x47ba18){try{if(this[_0x200d('0x52')](_0x47ba18)){if(_[_0x200d('0x53')](this[_0x200d('0xd')][_0x47ba18[_0x200d('0x65')]])){this[_0x200d('0xd')][_0x47ba18[_0x200d('0x65')]]=[];this[_0x200d('0xf')][_0x47ba18[_0x200d('0x65')]]={};}var _0x1b4ef5=new QueueReport();_0x1b4ef5[_0x200d('0x42')]=_0x47ba18[_0x200d('0x5a')];_0x1b4ef5[_0x200d('0x66')]=this[_0x200d('0x11')][_0x1b4ef5['name']]&&this['voiceQueues'][_0x1b4ef5[_0x200d('0x42')]]['type']?this[_0x200d('0x11')][_0x1b4ef5[_0x200d('0x42')]][_0x200d('0x66')]||_0x200d('0x46'):'inbound';_0x1b4ef5[_0x200d('0x5a')]=_0x47ba18['queue'];_0x1b4ef5[_0x200d('0x67')]=moment()[_0x200d('0x41')](_0x200d('0x68'));_0x1b4ef5['position']=_0x47ba18[_0x200d('0x69')];_0x1b4ef5['count']=_0x47ba18[_0x200d('0x6a')];_['merge'](_0x1b4ef5,_[_0x200d('0x6b')](_0x47ba18,_[_0x200d('0x6c')](_0x1b4ef5)));this['queueReports'][_0x47ba18[_0x200d('0x65')]][_0x200d('0x6d')](_0x1b4ef5);this[_0x200d('0xf')][_0x47ba18[_0x200d('0x65')]]=_0x1b4ef5;this[_0x200d('0x40')](_0x1b4ef5);}}catch(_0x442baf){logger['error'](_0x200d('0x6e'),util[_0x200d('0x6f')](_0x442baf,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x200d('0xa')]['syncQueueCallerAbandon']=function(_0x81d872){try{if(this['isNotNull'](_0x81d872)){if(this[_0x200d('0xd')][_0x81d872['uniqueid']]){var _0x5c9243=_[_0x200d('0x70')](this[_0x200d('0xd')][_0x81d872['uniqueid']]);_0x5c9243[_0x200d('0x71')]=![];_0x5c9243['queuecallercompleteAt']=null;_0x5c9243[_0x200d('0x72')]=_0x81d872[_0x200d('0x72')];_0x5c9243['originalposition']=_0x81d872['originalposition'];_0x5c9243[_0x200d('0x1b')]=!![];_0x5c9243[_0x200d('0x73')]=moment()[_0x200d('0x41')]('YYYY-MM-DD\x20HH:mm:ss');_0x5c9243[_0x200d('0x74')]=_0x200d('0x75');_0x5c9243[_0x200d('0x76')]=null;this['channels'][_0x81d872[_0x200d('0x65')]]=_0x5c9243;this[_0x200d('0x3e')](_0x5c9243);}}}catch(_0x4be639){logger[_0x200d('0x39')](_0x200d('0x77'),util[_0x200d('0x6f')](_0x4be639,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x200d('0xa')][_0x200d('0x78')]=function(_0x16ed4b){try{if(this[_0x200d('0x52')](_0x16ed4b)){if(this[_0x200d('0xd')][_0x16ed4b[_0x200d('0x65')]]){var _0x377f18=_[_0x200d('0x70')](this[_0x200d('0xd')][_0x16ed4b['uniqueid']]);_0x377f18[_0x200d('0x79')]=moment()[_0x200d('0x41')](_0x200d('0x68'));_0x377f18['connectedlinenum']=_0x16ed4b[_0x200d('0x7a')];_0x377f18[_0x200d('0x7b')]=_0x16ed4b['connectedlinename'];this[_0x200d('0xf')][_0x16ed4b[_0x200d('0x65')]]=_0x377f18;this[_0x200d('0x40')](_0x377f18);}}}catch(_0x503772){logger[_0x200d('0x39')](_0x200d('0x7c'),util['inspect'](_0x503772,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x200d('0x21')]=function(_0x274989){try{if(this[_0x200d('0x52')](_0x274989)){if(this['queueReports'][_0x274989['uniqueid']]){var _0x42985b=_['last'](this['queueReports'][_0x274989['uniqueid']]);_0x42985b[_0x200d('0x71')]=!![];_0x42985b[_0x200d('0x74')]='COMPLETEDBYAGENT';}}}catch(_0x9a7a92){logger[_0x200d('0x39')](_0x200d('0x7d'),util[_0x200d('0x6f')](_0x9a7a92,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x200d('0xa')][_0x200d('0x1f')]=function(_0x1abee3){try{if(this['isNotNull'](_0x1abee3)){if(this[_0x200d('0xd')][_0x1abee3[_0x200d('0x65')]]){var _0x55aae9=_[_0x200d('0x70')](this[_0x200d('0xd')][_0x1abee3[_0x200d('0x65')]]);_0x55aae9[_0x200d('0x1b')]=![];_0x55aae9['queuecallerabandonAt']=null;_0x55aae9['assigned']=!![];_0x55aae9[_0x200d('0x76')]=_0x1abee3[_0x200d('0x7e')];_0x55aae9[_0x200d('0x72')]=_0x1abee3[_0x200d('0x72')];_0x55aae9[_0x200d('0x71')]=!![];_0x55aae9[_0x200d('0x7f')]=![];_0x55aae9[_0x200d('0x80')]=null;if(!_0x55aae9[_0x200d('0x81')]){if(_0x1abee3['reason']=='transfer'){_0x55aae9[_0x200d('0x74')]=_0x200d('0x82');}else{if(_[_0x200d('0x83')](_0x1abee3[_0x200d('0x84')][_0x200d('0x85')](),_0x200d('0x86'))){if(this['queueReports'][_0x1abee3[_0x200d('0x87')]]){var _0x38a911=_[_0x200d('0x70')](this['queueReports'][_0x1abee3[_0x200d('0x87')]]);_0x38a911[_0x200d('0x71')]=![];_0x38a911[_0x200d('0x7f')]=!![];_0x38a911[_0x200d('0x80')]=moment(_0x55aae9[_0x200d('0x67')])[_0x200d('0x88')](_0x1abee3[_0x200d('0x72')],_0x200d('0x89'))[_0x200d('0x41')](_0x200d('0x68'));_0x38a911[_0x200d('0x74')]=_0x200d('0x8a');_0x38a911['transfer']=!![];_0x38a911['transfertype']=_0x200d('0x8b');_0x38a911[_0x200d('0x8c')]=_0x1abee3[_0x200d('0x8d')];_0x38a911[_0x200d('0x8e')]=_0x1abee3[_0x200d('0x65')];var _0x2c0dce=this['queueReports'][_0x1abee3[_0x200d('0x87')]];this[_0x200d('0xd')][_0x1abee3[_0x200d('0x87')]]=this[_0x200d('0xd')][_0x1abee3[_0x200d('0x65')]];this[_0x200d('0xd')][_0x1abee3[_0x200d('0x65')]]=_0x2c0dce;}}else{_0x55aae9['queuecallerexitreason']=_0x200d('0x8f')+_0x1abee3[_0x200d('0x90')]['toUpperCase']();}}}this['channels'][_0x1abee3['uniqueid']]=_0x55aae9;this[_0x200d('0x3e')](_0x55aae9);}}}catch(_0xa062a3){logger[_0x200d('0x39')](_0x200d('0x91'),util[_0x200d('0x6f')](_0xa062a3,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x200d('0xa')][_0x200d('0x23')]=function(_0x8c4aa9){try{if(this[_0x200d('0x52')](_0x8c4aa9)){this['addVariable'](_0x8c4aa9[_0x200d('0x65')],_[_0x200d('0x6c')](_0x8c4aa9[_0x200d('0x92')])[0x0],_0x8c4aa9[_0x200d('0x93')]);if(this[_0x200d('0xd')][_0x8c4aa9[_0x200d('0x65')]]){var _0x12e2e3=_[_0x200d('0x70')](this[_0x200d('0xd')][_0x8c4aa9[_0x200d('0x65')]]);if(_0x12e2e3){if(this[_0x200d('0x52')](_0x8c4aa9[_0x200d('0x92')])&&this[_0x200d('0x52')](_0x8c4aa9[_0x200d('0x92')]['queuestatus'])){switch(_0x8c4aa9['value']){case _0x200d('0x94'):_0x12e2e3[_0x200d('0x7f')]=![];_0x12e2e3['queuecallerexitAt']=null;break;default:_0x12e2e3[_0x200d('0x7f')]=!![];_0x12e2e3['queuecallerexitAt']=moment()[_0x200d('0x41')]('YYYY-MM-DD\x20HH:mm:ss');_0x12e2e3[_0x200d('0x79')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x12e2e3[_0x200d('0x1b')]=![];_0x12e2e3[_0x200d('0x73')]=null;_0x12e2e3['queuecallerexitreason']=_0x8c4aa9[_0x200d('0x93')];this['channels'][_0x8c4aa9[_0x200d('0x65')]]=_0x12e2e3;this[_0x200d('0x3e')](_0x12e2e3);}else if(this['isNotNull'](_0x8c4aa9[_0x200d('0x92')])&&this[_0x200d('0x52')](_0x8c4aa9['variable']['queueposition'])){if(!_0x12e2e3['queuecallerabandon']){_0x12e2e3[_0x200d('0x7f')]=!![];_0x12e2e3[_0x200d('0x80')]=moment()['format'](_0x200d('0x68'));_0x12e2e3['queuecallerexitreason']=_0x200d('0x95');_0x12e2e3[_0x200d('0x79')]=moment()[_0x200d('0x41')](_0x200d('0x68'));this['channels'][_0x8c4aa9[_0x200d('0x65')]]=_0x12e2e3;}}_0x12e2e3[_0x200d('0x14')]=this[_0x200d('0x14')][_0x8c4aa9[_0x200d('0x65')]];}}}}catch(_0x48697e){logger[_0x200d('0x39')](_0x200d('0x96'),util[_0x200d('0x6f')](_0x48697e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x200d('0xa')][_0x200d('0x97')]=function(_0x52366c,_0x120860,_0x5ed04e){var _0x17f714=[_0x200d('0x98'),'rtpaudioqosbridged',_0x200d('0x99'),'rtpaudioqosjitterbridged',_0x200d('0x9a'),_0x200d('0x9b'),_0x200d('0x9c'),'rtpaudioqosrttbridged',_0x200d('0x9d'),'sipuri',_0x200d('0x9e'),'bridgepvtcallid',_0x200d('0x9f'),'memberdynamic',_0x200d('0xa0'),'memberlastcall',_0x200d('0x7e'),_0x200d('0xa1'),_0x200d('0xa2')];if(!_['isNil'](_0x120860)&&!_[_0x200d('0xa3')](_0x17f714,_0x120860)){if(_['isUndefined'](this[_0x200d('0x14')][_0x52366c])){this[_0x200d('0x14')][_0x52366c]={};}this['variables'][_0x52366c][_0x120860]=_0x5ed04e;}};VoiceQueueReport[_0x200d('0xa')][_0x200d('0x24')]=function(_0x409000){try{if(this[_0x200d('0x52')](_0x409000)){if(this['queueReports'][_0x409000[_0x200d('0x65')]]){for(var _0x37baf8=0x0,_0x274a50={};_0x37baf8=0x0?moment(_0x389c4d[_0xd8f5('0x16')])[_0xd8f5('0x17')](_0x389c4d[_0xd8f5('0x18')],'seconds'):null,'data1':'outbound','data2':_0x389c4d[_0xd8f5('0x14')],'data3':_0x389c4d['exten'],'data4':_0x389c4d[_0xd8f5('0x19')]||null,'role':'agent','internal':_0x389c4d['accountcode']?_[_0xd8f5('0x1a')](_0x389c4d[_0xd8f5('0x14')]):undefined,'uniqueid':_0x389c4d[_0xd8f5('0x1b')]},'log':'CreateMemberReport'});}; \ No newline at end of file +var _0x1fa5=['dialstring','agent','lodash','../client','queuecallerexitAt','Request','CreateMemberReport','voice','lastAssignedTo','isNil','format','TALKING','queuecallerleaveAt','diff','seconds','inbound','exten','queue','accountcode','toNumber','uniqueid','membername','interface','starttime','endtime'];(function(_0x35fd22,_0x43accf){var _0x27cedb=function(_0xcce33e){while(--_0xcce33e){_0x35fd22['push'](_0x35fd22['shift']());}};_0x27cedb(++_0x43accf);}(_0x1fa5,0x1ab));var _0x51fa=function(_0x5d80de,_0x2cf15d){_0x5d80de=_0x5d80de-0x0;var _0x1c7556=_0x1fa5[_0x5d80de];return _0x1c7556;};'use strict';var moment=require('moment');var _=require(_0x51fa('0x0'));var util=require('util');var client=require(_0x51fa('0x1'));exports['voiceQueueReport']=function(_0x3d546e){var _0x567ace=_0x3d546e['queuecallercompleteAt']||_0x3d546e[_0x51fa('0x2')];return client[_0x51fa('0x3')](_0x51fa('0x4'),{'body':{'channel':_0x51fa('0x5'),'membername':_0x3d546e[_0x51fa('0x6')],'interface':_[_0x51fa('0x7')](_0x3d546e['interface'])?util[_0x51fa('0x8')]('SIP/%s',_0x3d546e[_0x51fa('0x6')]):_0x3d546e['interface'],'type':_0x51fa('0x9'),'enterAt':_0x3d546e[_0x51fa('0xa')],'exitAt':_0x567ace,'duration':moment(_0x567ace)[_0x51fa('0xb')](_0x3d546e[_0x51fa('0xa')],_0x51fa('0xc')),'data1':_0x51fa('0xd'),'data2':_0x3d546e['calleridnum'],'data3':_0x3d546e[_0x51fa('0xe')],'data4':null,'data5':_0x3d546e[_0x51fa('0xf')],'role':'agent','internal':_0x3d546e[_0x51fa('0x10')]?_[_0x51fa('0x11')](_0x3d546e[_0x51fa('0x10')]):undefined,'uniqueid':_0x3d546e[_0x51fa('0x12')]},'log':_0x51fa('0x4')});};exports['voiceDialReport']=function(_0x5e27b7){return client[_0x51fa('0x3')](_0x51fa('0x4'),{'body':{'channel':'voice','membername':_0x5e27b7[_0x51fa('0x13')],'interface':_0x5e27b7[_0x51fa('0x14')],'type':_0x51fa('0x9'),'enterAt':_0x5e27b7[_0x51fa('0x15')],'exitAt':_0x5e27b7['endtime'],'duration':moment(_0x5e27b7[_0x51fa('0x16')])[_0x51fa('0xb')](_0x5e27b7[_0x51fa('0x15')],'seconds')>=0x0?moment(_0x5e27b7[_0x51fa('0x16')])[_0x51fa('0xb')](_0x5e27b7['starttime'],_0x51fa('0xc')):null,'data1':'outbound','data2':_0x5e27b7[_0x51fa('0x10')],'data3':_0x5e27b7['exten'],'data4':_0x5e27b7[_0x51fa('0x17')]||null,'role':_0x51fa('0x18'),'internal':_0x5e27b7[_0x51fa('0x10')]?_['toNumber'](_0x5e27b7[_0x51fa('0x10')]):undefined,'uniqueid':_0x5e27b7[_0x51fa('0x12')]},'log':'CreateMemberReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index e2daa37..191766c 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 _0xe130=['html','../client','getTemplates','Request','GetTemplate','name'];(function(_0x4f2c3a,_0x6bde90){var _0x17d91c=function(_0xaaf630){while(--_0xaaf630){_0x4f2c3a['push'](_0x4f2c3a['shift']());}};_0x17d91c(++_0x6bde90);}(_0xe130,0x127));var _0x0e13=function(_0xcdfa71,_0x1e42ae){_0xcdfa71=_0xcdfa71-0x0;var _0x16aea1=_0xe130[_0xcdfa71];return _0x16aea1;};'use strict';var client=require(_0x0e13('0x0'));exports[_0x0e13('0x1')]=function(_0x51aabf){return function(_0x35c7af){return client[_0x0e13('0x2')](_0x0e13('0x3'),{'options':{'raw':!![],'attributes':['id',_0x0e13('0x4'),_0x0e13('0x5')]},'log':'GetTemplate'});};}; \ No newline at end of file +var _0x04b8=['html','getTemplates','Request','name'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x04b8,0x159));var _0x804b=function(_0x29b9f8,_0x31e7ac){_0x29b9f8=_0x29b9f8-0x0;var _0x1e27e6=_0x04b8[_0x29b9f8];return _0x1e27e6;};'use strict';var client=require('../client');exports[_0x804b('0x0')]=function(_0x49c1b2){return function(_0x241a4f){return client[_0x804b('0x1')]('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0x804b('0x2'),_0x804b('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 d2102b0..9dddc38 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 _0x3576=['value','field','operator','Action','Actions','action','data1','data2','data3','data4','data6','data7','../client','getTriggers','Request','GetTrigger','name','channel','Condition'];(function(_0x4c7d8b,_0x572388){var _0x187158=function(_0x5e956d){while(--_0x5e956d){_0x4c7d8b['push'](_0x4c7d8b['shift']());}};_0x187158(++_0x572388);}(_0x3576,0x1e7));var _0x6357=function(_0x3eb6ae,_0x346a13){_0x3eb6ae=_0x3eb6ae-0x0;var _0x39bfbd=_0x3576[_0x3eb6ae];return _0x39bfbd;};'use strict';var client=require(_0x6357('0x0'));exports[_0x6357('0x1')]=function(_0x1f76a4){return function(_0x589ffa){return client[_0x6357('0x2')](_0x6357('0x3'),{'options':{'raw':![],'attributes':['id',_0x6357('0x4'),_0x6357('0x5'),'status'],'include':[{'model':_0x6357('0x6'),'as':'AllConditions','attributes':['id','field','operator',_0x6357('0x7')]},{'model':_0x6357('0x6'),'as':'AnyConditions','attributes':['id',_0x6357('0x8'),_0x6357('0x9'),_0x6357('0x7')]},{'model':_0x6357('0xa'),'as':_0x6357('0xb'),'attributes':['id',_0x6357('0xc'),_0x6357('0xd'),_0x6357('0xe'),_0x6357('0xf'),_0x6357('0x10'),'data5',_0x6357('0x11'),_0x6357('0x12')]}]},'log':_0x6357('0x3')});};}; \ No newline at end of file +var _0x50ee=['data3','data6','GetTrigger','getTriggers','Request','name','channel','status','Condition','field','operator','value','AnyConditions','Actions','data1','data2'];(function(_0x1d21b0,_0x4f29ce){var _0x12620b=function(_0x3bc49f){while(--_0x3bc49f){_0x1d21b0['push'](_0x1d21b0['shift']());}};_0x12620b(++_0x4f29ce);}(_0x50ee,0x143));var _0xe50e=function(_0x1e17eb,_0x2e15c5){_0x1e17eb=_0x1e17eb-0x0;var _0x4de4c7=_0x50ee[_0x1e17eb];return _0x4de4c7;};'use strict';var client=require('../client');exports[_0xe50e('0x0')]=function(_0x36f8d1){return function(_0xbe7406){return client[_0xe50e('0x1')]('GetTrigger',{'options':{'raw':![],'attributes':['id',_0xe50e('0x2'),_0xe50e('0x3'),_0xe50e('0x4')],'include':[{'model':_0xe50e('0x5'),'as':'AllConditions','attributes':['id',_0xe50e('0x6'),_0xe50e('0x7'),_0xe50e('0x8')]},{'model':_0xe50e('0x5'),'as':_0xe50e('0x9'),'attributes':['id',_0xe50e('0x6'),'operator',_0xe50e('0x8')]},{'model':'Action','as':_0xe50e('0xa'),'attributes':['id','action',_0xe50e('0xb'),_0xe50e('0xc'),_0xe50e('0xd'),'data4','data5',_0xe50e('0xe'),'data7']}]},'log':_0xe50e('0xf')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 993e593..e07c3e7 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 _0x30ed=['GetTrunk','../client','getTrunks'];(function(_0x17633c,_0x4e8385){var _0x3627fc=function(_0x4dcea5){while(--_0x4dcea5){_0x17633c['push'](_0x17633c['shift']());}};_0x3627fc(++_0x4e8385);}(_0x30ed,0x16f));var _0xd30e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x30ed[_0x321bb2];return _0x9c12ed;};'use strict';var client=require(_0xd30e('0x0'));exports[_0xd30e('0x1')]=function(_0x1bf723){return function(_0x3bd146){return client['Request'](_0xd30e('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name','registry']},'log':'GetTrunk'});};}; \ No newline at end of file +var _0xa69f=['Request','GetTrunk','name','registry','../client','getTrunks'];(function(_0x506d2f,_0x5ab76e){var _0x101255=function(_0x1596b1){while(--_0x1596b1){_0x506d2f['push'](_0x506d2f['shift']());}};_0x101255(++_0x5ab76e);}(_0xa69f,0xa0));var _0xfa69=function(_0x50de8b,_0x4ed0b9){_0x50de8b=_0x50de8b-0x0;var _0x446601=_0xa69f[_0x50de8b];return _0x446601;};'use strict';var client=require(_0xfa69('0x0'));exports[_0xfa69('0x1')]=function(_0x10d5b5){return function(_0x10017c){return client[_0xfa69('0x2')](_0xfa69('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xfa69('0x4'),_0xfa69('0x5')]},'log':_0xfa69('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 52fd54e..04ac5e7 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 _0x277d=['pauseType','lastPauseAt','voicePause','phone','interface','getTelephones','telephone','internal','savePause','UnpauseUser','getAgent','ShowUser','agent','../client','getAgents','Request','GetUser','name','email','accountcode','fullname','lastLoginAt'];(function(_0x12b07e,_0x5136e6){var _0x267997=function(_0x5f44e2){while(--_0x5f44e2){_0x12b07e['push'](_0x12b07e['shift']());}};_0x267997(++_0x5136e6);}(_0x277d,0x65));var _0xd277=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x277d[_0x2c91e9];return _0x13f0ff;};'use strict';var client=require(_0xd277('0x0'));exports[_0xd277('0x1')]=function(){return function(){return client[_0xd277('0x2')](_0xd277('0x3'),{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0xd277('0x4'),_0xd277('0x5'),_0xd277('0x6'),_0xd277('0x7'),'online',_0xd277('0x8'),_0xd277('0x9'),_0xd277('0xa'),_0xd277('0xb'),_0xd277('0xc'),'mobile',_0xd277('0xd')]},'log':_0xd277('0x1')});};};exports[_0xd277('0xe')]=function(){return function(){return client[_0xd277('0x2')](_0xd277('0x3'),{'options':{'raw':!![],'where':{'role':_0xd277('0xf')},'attributes':['id',_0xd277('0x4'),_0xd277('0x6'),_0xd277('0x10')]},'log':_0xd277('0xe')});};};exports['savePause']=function(_0x5d0ea8,_0x53753c,_0x3abed8){return client[_0xd277('0x2')]('PauseUser',{'body':{'type':_0x53753c,'uniqueid':_0x3abed8},'options':{'where':{'id':_0x5d0ea8['id']}},'log':_0xd277('0x11')});};exports['saveUnpause']=function(_0x123758){return client['Request'](_0xd277('0x12'),{'body':{},'options':{'where':{'id':_0x123758['id']}},'log':_0xd277('0x11')});};exports[_0xd277('0x13')]=function(_0x56d4ec){return client['Request'](_0xd277('0x14'),{'options':{'raw':![],'where':{'role':_0xd277('0x15'),'id':_0x56d4ec},'attributes':['id',_0xd277('0x4'),'email',_0xd277('0x6'),_0xd277('0x7'),'online',_0xd277('0x8'),'pauseType',_0xd277('0xa'),'voicePause',_0xd277('0xd')]},'log':_0xd277('0x13')});}; \ No newline at end of file +var _0x4c9e=['telephone','PauseUser','savePause','saveUnpause','getAgent','voicePause','../client','Request','agent','name','email','accountcode','fullname','online','lastLoginAt','pauseType','phone','interface','getAgents','getTelephones','GetUser'];(function(_0x500392,_0xb44c75){var _0x20d522=function(_0x2bc1d6){while(--_0x2bc1d6){_0x500392['push'](_0x500392['shift']());}};_0x20d522(++_0xb44c75);}(_0x4c9e,0x180));var _0xe4c9=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x4c9e[_0x5c351c];return _0x26f3b3;};'use strict';var client=require(_0xe4c9('0x0'));exports['getAgents']=function(){return function(){return client[_0xe4c9('0x1')]('GetUser',{'options':{'raw':![],'where':{'role':_0xe4c9('0x2')},'attributes':['id',_0xe4c9('0x3'),_0xe4c9('0x4'),_0xe4c9('0x5'),_0xe4c9('0x6'),_0xe4c9('0x7'),_0xe4c9('0x8'),_0xe4c9('0x9'),'lastPauseAt','voicePause',_0xe4c9('0xa'),'mobile',_0xe4c9('0xb')]},'log':_0xe4c9('0xc')});};};exports[_0xe4c9('0xd')]=function(){return function(){return client['Request'](_0xe4c9('0xe'),{'options':{'raw':!![],'where':{'role':_0xe4c9('0xf')},'attributes':['id','name',_0xe4c9('0x5'),'internal']},'log':_0xe4c9('0xd')});};};exports['savePause']=function(_0x414de8,_0x5299c1,_0x48ca72){return client[_0xe4c9('0x1')](_0xe4c9('0x10'),{'body':{'type':_0x5299c1,'uniqueid':_0x48ca72},'options':{'where':{'id':_0x414de8['id']}},'log':_0xe4c9('0x11')});};exports[_0xe4c9('0x12')]=function(_0x539155){return client[_0xe4c9('0x1')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x539155['id']}},'log':_0xe4c9('0x11')});};exports[_0xe4c9('0x13')]=function(_0x5edf53){return client[_0xe4c9('0x1')]('ShowUser',{'options':{'raw':![],'where':{'role':_0xe4c9('0x2'),'id':_0x5edf53},'attributes':['id',_0xe4c9('0x3'),_0xe4c9('0x4'),_0xe4c9('0x5'),'fullname',_0xe4c9('0x7'),_0xe4c9('0x8'),'pauseType','lastPauseAt',_0xe4c9('0x14'),_0xe4c9('0xb')]},'log':_0xe4c9('0x13')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 1590a5a..03e6b08 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 _0x0cf5=['CreateVoiceAgentReport','update','UpdateVoiceAgentReport','../client','create','Request'];(function(_0x480c1d,_0x440851){var _0x340293=function(_0x2a07a6){while(--_0x2a07a6){_0x480c1d['push'](_0x480c1d['shift']());}};_0x340293(++_0x440851);}(_0x0cf5,0xab));var _0x50cf=function(_0x35934c,_0x391a01){_0x35934c=_0x35934c-0x0;var _0x11f132=_0x0cf5[_0x35934c];return _0x11f132;};'use strict';var client=require(_0x50cf('0x0'));exports[_0x50cf('0x1')]=function(_0x1d5e95){return client[_0x50cf('0x2')](_0x50cf('0x3'),{'body':_0x1d5e95,'log':_0x50cf('0x3')});};exports[_0x50cf('0x4')]=function(_0x4065e6,_0x502ea5,_0x785b9e){return client[_0x50cf('0x2')](_0x50cf('0x5'),{'body':_0x4065e6,'options':{'where':{'uniqueid':_0x502ea5,'interface':_0x785b9e}},'log':'UpdateVoiceAgentReport'});}; \ No newline at end of file +var _0x8add=['update','UpdateVoiceAgentReport','../client','create','Request'];(function(_0x2d8e23,_0x137866){var _0x1eb51a=function(_0x25165d){while(--_0x25165d){_0x2d8e23['push'](_0x2d8e23['shift']());}};_0x1eb51a(++_0x137866);}(_0x8add,0x11f));var _0xd8ad=function(_0x54758e,_0x27351f){_0x54758e=_0x54758e-0x0;var _0x5343b9=_0x8add[_0x54758e];return _0x5343b9;};'use strict';var client=require(_0xd8ad('0x0'));exports[_0xd8ad('0x1')]=function(_0x2e21eb){return client[_0xd8ad('0x2')]('CreateVoiceAgentReport',{'body':_0x2e21eb,'log':'CreateVoiceAgentReport'});};exports[_0xd8ad('0x3')]=function(_0x2a9157,_0x4bd5bd,_0x1ddcba){return client['Request'](_0xd8ad('0x4'),{'body':_0x2a9157,'options':{'where':{'uniqueid':_0x4bd5bd,'interface':_0x1ddcba}},'log':_0xd8ad('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 8467a1f..6dbdfe1 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 _0x6f2c=['../client','create','Request','merge','calleridnum','context','callerid','DOCUMENTATION','CreateVoiceCallReport','getVoiceCallReports','outbound','startOf','day','endOf','type','disposition','duration','billableseconds','GetVoiceCallReports','util','lodash'];(function(_0x46ef1d,_0x24926){var _0x49ce69=function(_0x5db4fc){while(--_0x5db4fc){_0x46ef1d['push'](_0x46ef1d['shift']());}};_0x49ce69(++_0x24926);}(_0x6f2c,0xbb));var _0xc6f2=function(_0x1a6746,_0x126500){_0x1a6746=_0x1a6746-0x0;var _0x669183=_0x6f2c[_0x1a6746];return _0x669183;};'use strict';var moment=require('moment');var util=require(_0xc6f2('0x0'));var _=require(_0xc6f2('0x1'));var client=require(_0xc6f2('0x2'));exports[_0xc6f2('0x3')]=function(_0x63d67d){return client[_0xc6f2('0x4')]('CreateVoiceCallReport',{'body':_[_0xc6f2('0x5')](_0x63d67d,{'source':_0x63d67d[_0xc6f2('0x6')],'destinationcontext':_0x63d67d[_0xc6f2('0x7')],'callerid':_0x63d67d[_0xc6f2('0x8')],'amaflags':_0xc6f2('0x9')}),'log':_0xc6f2('0xa')});};exports[_0xc6f2('0xb')]=function(){return function(){return client[_0xc6f2('0x4')]('GetVoiceCallReport',{'options':{'where':{'type':[_0xc6f2('0xc')],'createdAt':{'$between':[moment()[_0xc6f2('0xd')](_0xc6f2('0xe'))['format']('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0xc6f2('0xf')]('day')['format']('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':[_0xc6f2('0x10'),_0xc6f2('0x11'),_0xc6f2('0x12'),_0xc6f2('0x13')]},'log':_0xc6f2('0x14')});};}; \ No newline at end of file +var _0x8432=['util','lodash','create','Request','CreateVoiceCallReport','merge','context','callerid','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','disposition','duration','billableseconds','GetVoiceCallReports'];(function(_0x35703d,_0x4763ad){var _0x47d8aa=function(_0x34c0e8){while(--_0x34c0e8){_0x35703d['push'](_0x35703d['shift']());}};_0x47d8aa(++_0x4763ad);}(_0x8432,0x18f));var _0x2843=function(_0x3b2d81,_0x3a5ee8){_0x3b2d81=_0x3b2d81-0x0;var _0x1ac262=_0x8432[_0x3b2d81];return _0x1ac262;};'use strict';var moment=require('moment');var util=require(_0x2843('0x0'));var _=require(_0x2843('0x1'));var client=require('../client');exports[_0x2843('0x2')]=function(_0x141043){return client[_0x2843('0x3')](_0x2843('0x4'),{'body':_[_0x2843('0x5')](_0x141043,{'source':_0x141043['calleridnum'],'destinationcontext':_0x141043[_0x2843('0x6')],'callerid':_0x141043[_0x2843('0x7')],'amaflags':'DOCUMENTATION'}),'log':_0x2843('0x4')});};exports[_0x2843('0x8')]=function(){return function(){return client[_0x2843('0x3')](_0x2843('0x9'),{'options':{'where':{'type':[_0x2843('0xa')],'createdAt':{'$between':[moment()[_0x2843('0xb')](_0x2843('0xc'))[_0x2843('0xd')](_0x2843('0xe')),moment()['endOf'](_0x2843('0xc'))[_0x2843('0xd')](_0x2843('0xe'))]}},'attributes':['type',_0x2843('0xf'),_0x2843('0x10'),_0x2843('0x11')]},'log':_0x2843('0x12')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 175ccc5..cd9878d 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 _0xdff7=['CreateVoiceDialReport','create','Request'];(function(_0x47be61,_0x32fbfe){var _0x434e46=function(_0x462fc7){while(--_0x462fc7){_0x47be61['push'](_0x47be61['shift']());}};_0x434e46(++_0x32fbfe);}(_0xdff7,0x1cf));var _0x7dff=function(_0x1a9c5b,_0x5495f3){_0x1a9c5b=_0x1a9c5b-0x0;var _0x50ad5b=_0xdff7[_0x1a9c5b];return _0x50ad5b;};'use strict';var client=require('../client');exports[_0x7dff('0x0')]=function(_0x1a5ea5){return client[_0x7dff('0x1')](_0x7dff('0x2'),{'body':_0x1a5ea5,'log':_0x7dff('0x2')});}; \ No newline at end of file +var _0x42ed=['CreateVoiceDialReport','create'];(function(_0x2e63c4,_0x3eebe9){var _0x41ae37=function(_0x51139b){while(--_0x51139b){_0x2e63c4['push'](_0x2e63c4['shift']());}};_0x41ae37(++_0x3eebe9);}(_0x42ed,0x105));var _0xd42e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x42ed[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports[_0xd42e('0x0')]=function(_0x527a8e){return client['Request'](_0xd42e('0x1'),{'body':_0x527a8e,'log':_0xd42e('0x1')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index d9ae888..896c4c7 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 _0xf45e=['recordingFormat','getVoiceExtensions','../client','Request','exten'];(function(_0x2ae489,_0x9f8183){var _0x144cd2=function(_0x3a62b7){while(--_0x3a62b7){_0x2ae489['push'](_0x2ae489['shift']());}};_0x144cd2(++_0x9f8183);}(_0xf45e,0x115));var _0xef45=function(_0x55d9e1,_0x4e728c){_0x55d9e1=_0x55d9e1-0x0;var _0x3f3d53=_0xf45e[_0x55d9e1];return _0x3f3d53;};'use strict';var client=require(_0xef45('0x0'));exports['getVoiceExtensions']=function(){return function(){return client[_0xef45('0x1')]('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0xef45('0x2'),_0xef45('0x3')],'where':{'VoiceExtensionId':null}},'log':_0xef45('0x4')});};}; \ No newline at end of file +var _0x4273=['exten','recordingFormat','../client','getVoiceExtensions','Request'];(function(_0x200c43,_0x1825d5){var _0x5c14d3=function(_0x5efdca){while(--_0x5efdca){_0x200c43['push'](_0x200c43['shift']());}};_0x5c14d3(++_0x1825d5);}(_0x4273,0xc5));var _0x3427=function(_0x177ce8,_0x534822){_0x177ce8=_0x177ce8-0x0;var _0x1c4c01=_0x4273[_0x177ce8];return _0x1c4c01;};'use strict';var client=require(_0x3427('0x0'));exports[_0x3427('0x1')]=function(){return function(){return client[_0x3427('0x2')]('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0x3427('0x3'),_0x3427('0x4')],'where':{'VoiceExtensionId':null}},'log':_0x3427('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index a8aa5c8..0d8127e 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 _0xe9bd=['../client','getVoiceQueues','Request','acwTimeout','autopause','monitor_format','dialActive','dialMethod','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','timeout','dialRecallMeTimeout','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','name','callerid','active','Pause','mandatoryDispositionPause','Trunk','TrunkBackup','Interval','Intervals','interval'];(function(_0x1c9ed0,_0x568bc2){var _0x244153=function(_0x2cb7b7){while(--_0x2cb7b7){_0x1c9ed0['push'](_0x1c9ed0['shift']());}};_0x244153(++_0x568bc2);}(_0xe9bd,0x1d4));var _0xde9b=function(_0x18339f,_0x137240){_0x18339f=_0x18339f-0x0;var _0x120dc3=_0xe9bd[_0x18339f];return _0x120dc3;};'use strict';var client=require(_0xde9b('0x0'));exports[_0xde9b('0x1')]=function(){return function(){return client[_0xde9b('0x2')]('GetVoiceQueue',{'options':{'raw':![],'attributes':['id','name','acw',_0xde9b('0x3'),_0xde9b('0x4'),_0xde9b('0x5'),'type',_0xde9b('0x6'),_0xde9b('0x7'),'dialLimitChannel',_0xde9b('0x8'),_0xde9b('0x9'),_0xde9b('0xa'),_0xde9b('0xb'),'dialPredictiveInterval',_0xde9b('0xc'),_0xde9b('0xd'),'dialOriginateTimeout','dialQueueOptions',_0xde9b('0xe'),_0xde9b('0xf'),_0xde9b('0x10'),_0xde9b('0x11'),_0xde9b('0x12'),_0xde9b('0x13'),'dialNoAnswerMaxRetry',_0xde9b('0x14'),'dialGlobalMaxRetry',_0xde9b('0x15'),_0xde9b('0x16'),_0xde9b('0x17'),_0xde9b('0x18'),_0xde9b('0x19'),_0xde9b('0x1a'),_0xde9b('0x1b'),_0xde9b('0x1c'),_0xde9b('0x1d'),_0xde9b('0x1e'),_0xde9b('0x1f'),'dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength',_0xde9b('0x20'),_0xde9b('0x21'),'dialRecallInQueue','dialOrderByScheduledAt',_0xde9b('0x22'),_0xde9b('0x23'),_0xde9b('0x24'),_0xde9b('0x5'),_0xde9b('0x25'),_0xde9b('0x26'),_0xde9b('0x27'),'mandatoryDisposition',_0xde9b('0x28'),_0xde9b('0x29')],'include':[{'model':'Trunk','as':'Trunk','attributes':['id',_0xde9b('0x2a'),_0xde9b('0x2b'),_0xde9b('0x2c')]},{'model':_0xde9b('0x2d'),'as':_0xde9b('0x2e'),'attributes':['id','name']},{'model':_0xde9b('0x2f'),'as':_0xde9b('0x30'),'attributes':['id',_0xde9b('0x2a'),'callerid',_0xde9b('0x2c')]},{'model':'Interval','as':_0xde9b('0x31'),'attributes':['id',_0xde9b('0x2a')],'include':[{'model':_0xde9b('0x31'),'as':_0xde9b('0x32'),'attributes':['id','name',_0xde9b('0x33')]}]}]},'log':_0xde9b('0x1')});};}; \ No newline at end of file +var _0x583c=['dialCheckDuplicateType','dialAMDActive','dialAMDGreeting','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','monitor_format','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','mandatoryDisposition','dialPredictiveIntervalMinThreshold','Trunk','active','Pause','mandatoryDispositionPause','TrunkBackup','callerid','Interval','../client','getVoiceQueues','Request','GetVoiceQueue','name','acwTimeout','type','dialActive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix'];(function(_0x3f467f,_0x389c73){var _0x2d0956=function(_0x1e9e5a){while(--_0x1e9e5a){_0x3f467f['push'](_0x3f467f['shift']());}};_0x2d0956(++_0x389c73);}(_0x583c,0xe4));var _0xc583=function(_0x295a3d,_0x56d487){_0x295a3d=_0x295a3d-0x0;var _0x23a732=_0x583c[_0x295a3d];return _0x23a732;};'use strict';var client=require(_0xc583('0x0'));exports[_0xc583('0x1')]=function(){return function(){return client[_0xc583('0x2')](_0xc583('0x3'),{'options':{'raw':![],'attributes':['id',_0xc583('0x4'),'acw',_0xc583('0x5'),'autopause','monitor_format',_0xc583('0x6'),_0xc583('0x7'),'dialMethod',_0xc583('0x8'),_0xc583('0x9'),_0xc583('0xa'),_0xc583('0xb'),_0xc583('0xc'),'dialPredictiveInterval',_0xc583('0xd'),_0xc583('0xe'),_0xc583('0xf'),_0xc583('0x10'),_0xc583('0x11'),'dialQueueProject',_0xc583('0x12'),_0xc583('0x13'),_0xc583('0x14'),_0xc583('0x15'),_0xc583('0x16'),'dialNoAnswerRetryFrequency',_0xc583('0x17'),_0xc583('0x18'),_0xc583('0x19'),_0xc583('0x1a'),_0xc583('0x1b'),_0xc583('0x1c'),'dialAMDInitialSilence',_0xc583('0x1d'),'dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength',_0xc583('0x1e'),_0xc583('0x1f'),_0xc583('0x20'),_0xc583('0x21'),_0xc583('0x22'),'dialRecallMeTimeout',_0xc583('0x23'),_0xc583('0x24'),_0xc583('0x25'),'dialAgiAfterHangupClient','dialQueueProject2',_0xc583('0x26'),_0xc583('0x27'),_0xc583('0x28'),_0xc583('0x29'),_0xc583('0x2a'),'dialPredictiveIntervalMaxThreshold',_0xc583('0x2b')],'include':[{'model':_0xc583('0x2c'),'as':'Trunk','attributes':['id',_0xc583('0x4'),'callerid',_0xc583('0x2d')]},{'model':_0xc583('0x2e'),'as':_0xc583('0x2f'),'attributes':['id',_0xc583('0x4')]},{'model':'Trunk','as':_0xc583('0x30'),'attributes':['id',_0xc583('0x4'),_0xc583('0x31'),'active']},{'model':_0xc583('0x32'),'as':_0xc583('0x32'),'attributes':['id',_0xc583('0x4')],'include':[{'model':'Interval','as':'Intervals','attributes':['id',_0xc583('0x4'),'interval']}]}]},'log':_0xc583('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index bea2401..9b069cf 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 _0x2558=['GetVoiceQueueReport','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','queue','queuecallerjoinAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','queuecallerabandon','GetVoiceQueueReports','lodash','../client','create','Request','CreateVoiceQueueReport','getVoiceQueueReports'];(function(_0x22943d,_0x2e167b){var _0x3fb073=function(_0x49d52d){while(--_0x49d52d){_0x22943d['push'](_0x22943d['shift']());}};_0x3fb073(++_0x2e167b);}(_0x2558,0x126));var _0x8255=function(_0x5bff0,_0x20716d){_0x5bff0=_0x5bff0-0x0;var _0x3ead2e=_0x2558[_0x5bff0];return _0x3ead2e;};'use strict';var moment=require('moment');var _=require(_0x8255('0x0'));var client=require(_0x8255('0x1'));exports[_0x8255('0x2')]=function(_0x28bea5){return client[_0x8255('0x3')](_0x8255('0x4'),{'body':_0x28bea5,'log':'CreateVoiceQueueReport'});};exports[_0x8255('0x5')]=function(){return function(){return client[_0x8255('0x3')](_0x8255('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x8255('0x7')](_0x8255('0x8'))[_0x8255('0x9')]('YYYY-MM-DD\x20HH:mm:ss'),moment()['endOf'](_0x8255('0x8'))['format'](_0x8255('0xa'))]}},'attributes':[_0x8255('0xb'),_0x8255('0xc'),_0x8255('0xd'),'queuecallerleaveAt',_0x8255('0xe'),_0x8255('0xf'),_0x8255('0x10'),_0x8255('0x11'),_0x8255('0x12'),'queuecallerabandonAt']},'log':_0x8255('0x13')});};}; \ No newline at end of file +var _0x34ce=['GetVoiceQueueReports','lodash','../client','Request','CreateVoiceQueueReport','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','uniqueid','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','queuecallerabandon'];(function(_0x2ea780,_0x41ef96){var _0x438113=function(_0x2ee9d6){while(--_0x2ee9d6){_0x2ea780['push'](_0x2ea780['shift']());}};_0x438113(++_0x41ef96);}(_0x34ce,0x191));var _0xe34c=function(_0x117821,_0xaa1933){_0x117821=_0x117821-0x0;var _0x4ae9ff=_0x34ce[_0x117821];return _0x4ae9ff;};'use strict';var moment=require('moment');var _=require(_0xe34c('0x0'));var client=require(_0xe34c('0x1'));exports['create']=function(_0x534b18){return client[_0xe34c('0x2')](_0xe34c('0x3'),{'body':_0x534b18,'log':_0xe34c('0x3')});};exports['getVoiceQueueReports']=function(){return function(){return client[_0xe34c('0x2')]('GetVoiceQueueReport',{'options':{'where':{'createdAt':{'$between':[moment()[_0xe34c('0x4')](_0xe34c('0x5'))[_0xe34c('0x6')](_0xe34c('0x7')),moment()[_0xe34c('0x8')](_0xe34c('0x5'))[_0xe34c('0x6')](_0xe34c('0x7'))]}},'attributes':[_0xe34c('0x9'),'queue','queuecallerjoinAt','queuecallerleaveAt',_0xe34c('0xa'),_0xe34c('0xb'),_0xe34c('0xc'),_0xe34c('0xd'),_0xe34c('0xe'),'queuecallerabandonAt']},'log':_0xe34c('0xf')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueRt.js b/server/services/ami/rpc/voiceQueueRt.js index 09b8363..f871796 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 _0x167b=['Request','GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses'];(function(_0x2638d2,_0x263e52){var _0x2453b4=function(_0x5e8e8e){while(--_0x5e8e8e){_0x2638d2['push'](_0x2638d2['shift']());}};_0x2453b4(++_0x263e52);}(_0x167b,0x15e));var _0xb167=function(_0x28b65e,_0x1f697e){_0x28b65e=_0x28b65e-0x0;var _0x498086=_0x167b[_0x28b65e];return _0x498086;};'use strict';var client=require(_0xb167('0x0'));exports[_0xb167('0x1')]=function(_0x5f457e){return function(){return client[_0xb167('0x2')](_0xb167('0x3'),{'options':{'where':{'VoiceQueueId':_0x5f457e,'paused':!![]},'raw':!![]},'log':_0xb167('0x1')});};}; \ No newline at end of file +var _0x363f=['GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses'];(function(_0x28fc5b,_0x50a44c){var _0x1894c6=function(_0x273ab3){while(--_0x273ab3){_0x28fc5b['push'](_0x28fc5b['shift']());}};_0x1894c6(++_0x50a44c);}(_0x363f,0xd0));var _0xf363=function(_0x1948a5,_0x5b045c){_0x1948a5=_0x1948a5-0x0;var _0x1c3e1e=_0x363f[_0x1948a5];return _0x1c3e1e;};'use strict';var client=require(_0xf363('0x0'));exports[_0xf363('0x1')]=function(_0x3a9c15){return function(){return client['Request'](_0xf363('0x2'),{'options':{'where':{'VoiceQueueId':_0x3a9c15,'paused':!![]},'raw':!![]},'log':_0xf363('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 8448b6a..4a3e84d 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 _0x2043=['monitorFilename','lodash','../client','create','Request','CreateVoiceRecording','merge'];(function(_0x2385fc,_0x4c17b4){var _0x5e7e2e=function(_0x2063e8){while(--_0x2063e8){_0x2385fc['push'](_0x2385fc['shift']());}};_0x5e7e2e(++_0x4c17b4);}(_0x2043,0x190));var _0x3204=function(_0x4ac654,_0x59b7c1){_0x4ac654=_0x4ac654-0x0;var _0x4d69fc=_0x2043[_0x4ac654];return _0x4d69fc;};'use strict';var _=require(_0x3204('0x0'));var client=require(_0x3204('0x1'));exports[_0x3204('0x2')]=function(_0x2a1dbb){return client[_0x3204('0x3')](_0x3204('0x4'),{'body':_[_0x3204('0x5')](_0x2a1dbb,{'value':_0x2a1dbb[_0x3204('0x6')]}),'log':_0x3204('0x4')});}; \ No newline at end of file +var _0xd035=['../client','create','CreateVoiceRecording','merge','monitorFilename','lodash'];(function(_0x117a96,_0xde6af9){var _0x4de793=function(_0x3da8fe){while(--_0x3da8fe){_0x117a96['push'](_0x117a96['shift']());}};_0x4de793(++_0xde6af9);}(_0xd035,0x1f1));var _0x5d03=function(_0x644ecd,_0x397f36){_0x644ecd=_0x644ecd-0x0;var _0x1c66ce=_0xd035[_0x644ecd];return _0x1c66ce;};'use strict';var _=require(_0x5d03('0x0'));var client=require(_0x5d03('0x1'));exports[_0x5d03('0x2')]=function(_0x540ceb){return client['Request'](_0x5d03('0x3'),{'body':_[_0x5d03('0x4')](_0x540ceb,{'value':_0x540ceb[_0x5d03('0x5')]}),'log':_0x5d03('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index 3af658d..1f7ac35 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 _0xec2f=['isexternal','context','extension','blind','attendedTransfer','Request','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','transfertargetlinkedid','origtransferercontext','attended','../client','blindTransfer','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereeexten'];(function(_0x6e51f1,_0x11371a){var _0x141b4c=function(_0x2e85e7){while(--_0x2e85e7){_0x6e51f1['push'](_0x6e51f1['shift']());}};_0x141b4c(++_0x11371a);}(_0xec2f,0xd8));var _0xfec2=function(_0x477611,_0x133172){_0x477611=_0x477611-0x0;var _0x4c1287=_0xec2f[_0x477611];return _0x4c1287;};'use strict';var client=require(_0xfec2('0x0'));exports[_0xfec2('0x1')]=function(_0x2479fa){return client['Request'](_0xfec2('0x2'),{'body':{'result':_0x2479fa[_0xfec2('0x3')],'transfererchannel':_0x2479fa[_0xfec2('0x4')],'transferercalleridnum':_0x2479fa[_0xfec2('0x5')],'transferercalleridname':_0x2479fa[_0xfec2('0x6')],'transfererconnectedlinenum':_0x2479fa[_0xfec2('0x7')],'transfererconnectedlinename':_0x2479fa['transfererconnectedlinename'],'transfereraccountcode':_0x2479fa[_0xfec2('0x8')],'transferercontext':_0x2479fa[_0xfec2('0x9')],'transfererexten':_0x2479fa[_0xfec2('0xa')],'transfererlinkedid':_0x2479fa[_0xfec2('0xb')],'transfereechannel':_0x2479fa[_0xfec2('0xc')],'transfereecalleridnum':_0x2479fa['transfereecalleridnum'],'transfereecalleridname':_0x2479fa[_0xfec2('0xd')],'transfereeconnectedlinenum':_0x2479fa[_0xfec2('0xe')],'transfereeconnectedlinename':_0x2479fa[_0xfec2('0xf')],'transfereeaccountcode':_0x2479fa[_0xfec2('0x10')],'transfereecontext':_0x2479fa['transfereecontext'],'transfereeexten':_0x2479fa[_0xfec2('0x11')],'transfereelinkedid':_0x2479fa['transfereelinkedid'],'isexternal':_0x2479fa[_0xfec2('0x12')],'context':_0x2479fa[_0xfec2('0x13')],'extension':_0x2479fa[_0xfec2('0x14')],'type':_0xfec2('0x15')},'log':_0xfec2('0x2')});};exports[_0xfec2('0x16')]=function(_0x4a1abb){return client[_0xfec2('0x17')](_0xfec2('0x2'),{'body':{'result':_0x4a1abb[_0xfec2('0x3')],'transfererchannel':_0x4a1abb[_0xfec2('0x18')],'transferercalleridnum':_0x4a1abb['origtransferercalleridnum'],'transferercalleridname':_0x4a1abb[_0xfec2('0x19')],'transfererconnectedlinenum':_0x4a1abb[_0xfec2('0x1a')],'transfererconnectedlinename':_0x4a1abb['secondtransfererconnectedlinename'],'transfereraccountcode':_0x4a1abb[_0xfec2('0x1b')],'transferercontext':_0x4a1abb[_0xfec2('0x1c')],'transfererexten':_0x4a1abb[_0xfec2('0x1d')],'transfererlinkedid':_0x4a1abb['origtransfererlinkedid'],'transfereechannel':_0x4a1abb['transfertargetchannel'],'transfereecalleridnum':_0x4a1abb[_0xfec2('0x1e')],'transfereecalleridname':_0x4a1abb[_0xfec2('0x1f')],'transfereeconnectedlinenum':_0x4a1abb[_0xfec2('0x20')],'transfereeconnectedlinename':_0x4a1abb[_0xfec2('0x21')],'transfereeaccountcode':_0x4a1abb[_0xfec2('0x22')],'transfereecontext':_0x4a1abb['transfertargetcontext'],'transfereeexten':_0x4a1abb[_0xfec2('0x23')],'transfereelinkedid':_0x4a1abb[_0xfec2('0x24')],'isexternal':_0x4a1abb[_0xfec2('0x12')],'context':_0x4a1abb[_0xfec2('0x25')],'extension':_0x4a1abb['origtransfererexten'],'type':_0xfec2('0x26')},'log':_0xfec2('0x2')});}; \ No newline at end of file +var _0x49a0=['transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','origtransferercontext','attended','../client','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereelinkedid','isexternal','extension','blind','attendedTransfer','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel'];(function(_0x4ee2f0,_0x5ad7eb){var _0x16c217=function(_0x3881c7){while(--_0x3881c7){_0x4ee2f0['push'](_0x4ee2f0['shift']());}};_0x16c217(++_0x5ad7eb);}(_0x49a0,0xf3));var _0x049a=function(_0x27ab99,_0x5a6d79){_0x27ab99=_0x27ab99-0x0;var _0x1e66c2=_0x49a0[_0x27ab99];return _0x1e66c2;};'use strict';var client=require(_0x049a('0x0'));exports[_0x049a('0x1')]=function(_0x470f31){return client[_0x049a('0x2')](_0x049a('0x3'),{'body':{'result':_0x470f31[_0x049a('0x4')],'transfererchannel':_0x470f31[_0x049a('0x5')],'transferercalleridnum':_0x470f31['transferercalleridnum'],'transferercalleridname':_0x470f31[_0x049a('0x6')],'transfererconnectedlinenum':_0x470f31[_0x049a('0x7')],'transfererconnectedlinename':_0x470f31[_0x049a('0x8')],'transfereraccountcode':_0x470f31['transfereraccountcode'],'transferercontext':_0x470f31[_0x049a('0x9')],'transfererexten':_0x470f31[_0x049a('0xa')],'transfererlinkedid':_0x470f31[_0x049a('0xb')],'transfereechannel':_0x470f31[_0x049a('0xc')],'transfereecalleridnum':_0x470f31[_0x049a('0xd')],'transfereecalleridname':_0x470f31[_0x049a('0xe')],'transfereeconnectedlinenum':_0x470f31[_0x049a('0xf')],'transfereeconnectedlinename':_0x470f31['transfereeconnectedlinename'],'transfereeaccountcode':_0x470f31['transfereeaccountcode'],'transfereecontext':_0x470f31['transfereecontext'],'transfereeexten':_0x470f31['transfereeexten'],'transfereelinkedid':_0x470f31[_0x049a('0x10')],'isexternal':_0x470f31[_0x049a('0x11')],'context':_0x470f31['context'],'extension':_0x470f31[_0x049a('0x12')],'type':_0x049a('0x13')},'log':_0x049a('0x3')});};exports[_0x049a('0x14')]=function(_0x35f650){return client[_0x049a('0x2')](_0x049a('0x3'),{'body':{'result':_0x35f650[_0x049a('0x4')],'transfererchannel':_0x35f650[_0x049a('0x15')],'transferercalleridnum':_0x35f650[_0x049a('0x16')],'transferercalleridname':_0x35f650[_0x049a('0x17')],'transfererconnectedlinenum':_0x35f650['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x35f650[_0x049a('0x18')],'transfereraccountcode':_0x35f650[_0x049a('0x19')],'transferercontext':_0x35f650[_0x049a('0x1a')],'transfererexten':_0x35f650[_0x049a('0x1b')],'transfererlinkedid':_0x35f650[_0x049a('0x1c')],'transfereechannel':_0x35f650[_0x049a('0x1d')],'transfereecalleridnum':_0x35f650[_0x049a('0x1e')],'transfereecalleridname':_0x35f650[_0x049a('0x1f')],'transfereeconnectedlinenum':_0x35f650[_0x049a('0x20')],'transfereeconnectedlinename':_0x35f650[_0x049a('0x21')],'transfereeaccountcode':_0x35f650[_0x049a('0x22')],'transfereecontext':_0x35f650[_0x049a('0x23')],'transfereeexten':_0x35f650[_0x049a('0x24')],'transfereelinkedid':_0x35f650['transfertargetlinkedid'],'isexternal':_0x35f650['isexternal'],'context':_0x35f650[_0x049a('0x25')],'extension':_0x35f650['origtransfererexten'],'type':_0x049a('0x26')},'log':_0x049a('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 4db4dfa..0ad51fe 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 _0x19ab=['outbound','campaigns','event','Event\x20name\x20mandatory','emit','faxAccounts','checkAfterSend','http','listen','127.0.0.1','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate','bluebird','moment','../../../config/environment','../properties','%s/%s','SIP','name','timers','timer','updateAcw','agents','pause','isConnected','error','asterisk','username','ami\x20disconnected','pick','keys','module','action','Action','then','message','join','command','Command','content','voiceQueues','hasOwnProperty','answered','loggedIn','pTalking','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','type','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','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','callerid','Interval','push','length','values','channels','map','find','format','%s.%s','filename','uniqueid','wav','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','MixMonitor\x20Success','catch','toLowerCase','Channel\x20doesn\x27t\x20exist','voicechannel','resolve','channel','destinationchannel','StopMixMonitor','stop','StopMixMonitor\x20Success','voicequeuechannel','queueChannels','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','outboundChannels'];(function(_0x1d8e8a,_0x4fdfaa){var _0x42afac=function(_0x3f3a30){while(--_0x3f3a30){_0x1d8e8a['push'](_0x1d8e8a['shift']());}};_0x42afac(++_0x4fdfaa);}(_0x19ab,0x11b));var _0xb19a=function(_0x5821fc,_0x1e703b){_0x5821fc=_0x5821fc-0x0;var _0x49851e=_0x19ab[_0x5821fc];return _0x49851e;};'use strict';var _=require(_0xb19a('0x0'));var util=require(_0xb19a('0x1'));var jayson=require(_0xb19a('0x2'));var schema=require(_0xb19a('0x3'));var BPromise=require(_0xb19a('0x4'));var moment=require(_0xb19a('0x5'));var config=require(_0xb19a('0x6'));var properties=require(_0xb19a('0x7'));var ami=require('../ami');exports['listen']=function(_0x3deaff,_0x4c7ae3,_0x364573){return new BPromise(function(_0x47a5d2,_0xb61b7e){var _0x3d7224={'QueuePause':function(_0x376b19){return new Promise(function(_0x2b72dc,_0x28453b){var _0x5b886b=util['format'](_0xb19a('0x8'),_0xb19a('0x9'),_0x376b19[_0xb19a('0xa')]);if(_0x3deaff['timers']&&_0x3deaff[_0xb19a('0xb')][_0x5b886b]&&_0x3deaff['timers'][_0x5b886b][_0xb19a('0xc')]){_0x3deaff[_0xb19a('0xb')][_0x5b886b][_0xb19a('0xd')]();}if(_0x3deaff[_0xb19a('0xe')][_0x5b886b]){_0x3deaff['agents'][_0x5b886b]['updateStatusRealtime']({'statePause':_0x376b19[_0xb19a('0xf')]?!![]:![]});}_0x2b72dc({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x2bc763){var _0x36bf38=this;return new Promise(function(_0x388f9b,_0x5cb4b2){if(ami[_0xb19a('0x10')]()==![]){return _0x5cb4b2(_0x36bf38[_0xb19a('0x11')](0x1f4,[config[_0xb19a('0x12')]['ip'],config[_0xb19a('0x12')][_0xb19a('0x13')],_0xb19a('0x14')]['join']('\x20')));}_0x2bc763=_[_0xb19a('0x15')](_0x2bc763,_[_0xb19a('0x16')](properties[_0xb19a('0x17')]));_0x2bc763[_0xb19a('0x18')]='Reload';return ami[_0xb19a('0x19')](_0x2bc763)[_0xb19a('0x1a')](function(_0x1ed996){_0x388f9b({'code':0xc8,'message':_0x1ed996['message']});})['catch'](function(_0x5055ca){_0x5cb4b2(_0x36bf38[_0xb19a('0x11')](0x1f5,_0x5055ca[_0xb19a('0x1b')]));});});},'Command':function(_0x9d238c){var _0x4ef29f=this;return new Promise(function(_0x2b730a,_0x1cde38){if(ami['isConnected']()==![]){return _0x1cde38(_0x4ef29f['error'](0x1f4,[config[_0xb19a('0x12')]['ip'],config['asterisk'][_0xb19a('0x13')],_0xb19a('0x14')][_0xb19a('0x1c')]('\x20')));}_0x9d238c=_[_0xb19a('0x15')](_0x9d238c,_0xb19a('0x1d'));_0x9d238c[_0xb19a('0x18')]=_0xb19a('0x1e');return ami[_0xb19a('0x19')](_0x9d238c)[_0xb19a('0x1a')](function(_0x417bc3){_0x2b730a({'code':0xc8,'message':_0x417bc3[_0xb19a('0x1f')]});})['catch'](function(_0x4f7458){_0x1cde38(_0x4ef29f[_0xb19a('0x11')](0x1f5,_0x4f7458[_0xb19a('0x1b')]));});});},'VoiceQueues':function(_0x42a58d){return new Promise(function(_0x6f703a,_0x1d1eff){var _0x3037ab=[];for(var _0x1d7392 in _0x3deaff[_0xb19a('0x20')]){if(_0x3deaff['voiceQueues'][_0xb19a('0x21')](_0x1d7392)){var _0x226ce7=_0x3deaff[_0xb19a('0x20')][_0x1d7392];var _0x3db89e={'id':_0x226ce7['id'],'name':_0x226ce7[_0xb19a('0xa')],'strategy':_0x226ce7['strategy'],'answered':_0x226ce7[_0xb19a('0x22')],'available':_0x226ce7['available'],'loggedIn':_0x226ce7[_0xb19a('0x23')],'pTalking':_0x226ce7[_0xb19a('0x24')],'sumBillable':_0x226ce7['sumBillable'],'sumDuration':_0x226ce7[_0xb19a('0x25')],'sumHoldTime':_0x226ce7[_0xb19a('0x26')]||0x0,'talking':_0x226ce7[_0xb19a('0x27')],'total':_0x226ce7[_0xb19a('0x28')],'type':_0x226ce7['type'],'unmanaged':_0x226ce7[_0xb19a('0x29')],'abandoned':_0x226ce7[_0xb19a('0x2a')],'waiting':_0x226ce7[_0xb19a('0x2b')],'loggedInDb':_0x226ce7[_0xb19a('0x2c')]};if(_0x226ce7[_0xb19a('0x2d')]==='outbound'){_0x3db89e[_0xb19a('0x2e')]=_0x226ce7['dialActive'];_0x3db89e['dialMethod']=_0x226ce7[_0xb19a('0x2f')];_0x3db89e[_0xb19a('0x30')]=_0x226ce7[_0xb19a('0x30')];_0x3db89e[_0xb19a('0x31')]=_0x226ce7['dialOriginateCallerIdNumber'];_0x3db89e[_0xb19a('0x32')]=_0x226ce7['dialOriginateTimeout'];_0x3db89e[_0xb19a('0x33')]=_0x226ce7['dialPrefix'];_0x3db89e['outboundAnswerAgiCallsDay']=_0x226ce7['outboundAnswerAgiCallsDay'];_0x3db89e[_0xb19a('0x34')]=_0x226ce7['outboundAnswerCallsDay'];_0x3db89e[_0xb19a('0x35')]=_0x226ce7[_0xb19a('0x35')];_0x3db89e['outboundBusyCallsDay']=_0x226ce7['outboundBusyCallsDay'];_0x3db89e[_0xb19a('0x36')]=_0x226ce7[_0xb19a('0x36')];_0x3db89e[_0xb19a('0x37')]=_0x226ce7[_0xb19a('0x37')];_0x3db89e[_0xb19a('0x38')]=_0x226ce7['outboundDropCallsDayCallersExit'];_0x3db89e[_0xb19a('0x39')]=_0x226ce7[_0xb19a('0x39')];_0x3db89e['outboundNoAnswerCallsDay']=_0x226ce7['outboundNoAnswerCallsDay'];_0x3db89e[_0xb19a('0x3a')]=_0x226ce7[_0xb19a('0x3a')];_0x3db89e[_0xb19a('0x3b')]=_0x226ce7[_0xb19a('0x3b')];_0x3db89e[_0xb19a('0x3c')]=_0x226ce7[_0xb19a('0x3c')];_0x3db89e[_0xb19a('0x3d')]=_0x226ce7['outboundRejectCallsDay'];_0x3db89e[_0xb19a('0x3e')]=_0x226ce7['outboundUnknownCallsDay'];_0x3db89e[_0xb19a('0x3f')]=_0x226ce7[_0xb19a('0x3f')];_0x3db89e['predictiveIntervalAvgHoldtime']=_0x226ce7[_0xb19a('0x40')];_0x3db89e[_0xb19a('0x41')]=_0x226ce7['predictiveIntervalAvgTalktime'];_0x3db89e[_0xb19a('0x42')]=_0x226ce7['predictiveIntervalDroppedCallsCallersExit'];_0x3db89e[_0xb19a('0x43')]=_0x226ce7[_0xb19a('0x43')];_0x3db89e[_0xb19a('0x44')]=_0x226ce7[_0xb19a('0x44')];_0x3db89e[_0xb19a('0x45')]=_0x226ce7[_0xb19a('0x45')];_0x3db89e['predictiveIntervalHitRate']=_0x226ce7[_0xb19a('0x46')];_0x3db89e[_0xb19a('0x47')]=_0x226ce7[_0xb19a('0x47')];_0x3db89e[_0xb19a('0x48')]=_0x226ce7[_0xb19a('0x48')];_0x3db89e[_0xb19a('0x49')]=_0x226ce7[_0xb19a('0x49')];_0x3db89e['predictiveIntervalTotalCalls']=_0x226ce7[_0xb19a('0x4a')];_0x3db89e[_0xb19a('0x1b')]=_0x226ce7[_0xb19a('0x1b')];_0x3db89e[_0xb19a('0x4b')]=_0x226ce7[_0xb19a('0x4b')];_0x3db89e['erlangCalls']=_0x226ce7[_0xb19a('0x4c')];_0x3db89e['erlangCallToSecond']=_0x226ce7[_0xb19a('0x4d')];_0x3db89e[_0xb19a('0x4e')]=_0x226ce7[_0xb19a('0x4e')];_0x3db89e['erlangBusyFactor']=_0x226ce7[_0xb19a('0x4f')];_0x3db89e[_0xb19a('0x50')]=_0x226ce7[_0xb19a('0x50')];_0x3db89e[_0xb19a('0x51')]=_0x226ce7[_0xb19a('0x51')];}if(_0x226ce7[_0xb19a('0x52')]){_0x3db89e[_0xb19a('0x52')]={'id':_0x226ce7[_0xb19a('0x52')]['id'],'name':_0x226ce7[_0xb19a('0x52')][_0xb19a('0xa')],'active':_0x226ce7[_0xb19a('0x52')]['active'],'callerid':_0x226ce7[_0xb19a('0x52')][_0xb19a('0x53')]};}if(_0x226ce7[_0xb19a('0x54')]){_0x3db89e[_0xb19a('0x54')]={'id':_0x226ce7[_0xb19a('0x54')]['id'],'name':_0x226ce7[_0xb19a('0x54')]['name']};}_0x3037ab[_0xb19a('0x55')](_0x3db89e);}}_0x6f703a({'count':_0x3037ab[_0xb19a('0x56')],'rows':_0x3037ab});});},'VoiceChannels':function(_0x5f2aea){return new Promise(function(_0x29e3b3,_0x4bdc8e){var _0x27b528=_[_0xb19a('0x57')](_0x3deaff[_0xb19a('0x58')]);_0x29e3b3({'count':_0x27b528['length'],'rows':_0x27b528});});},'VoiceChannelMixMonitor':function(_0x2d5bac){var _0x251d0e=this;return new Promise(function(_0x12b24d,_0x5dc661){if(ami['isConnected']()==![]){return _0x5dc661(_0x251d0e[_0xb19a('0x11')](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0xb19a('0x13')],_0xb19a('0x14')][_0xb19a('0x1c')]('\x20')));}var _0x45edfe=schema(properties['voicechannel'])['validate'](_0x2d5bac);if(_0x45edfe[_0xb19a('0x56')]>0x0){return _0x5dc661(_0x251d0e[_0xb19a('0x11')](0x1f4,_[_0xb19a('0x59')](_0x45edfe,_0xb19a('0x1b'))[_0xb19a('0x1c')](',\x20')));}var _0x1398dd=_[_0xb19a('0x5a')](_0x3deaff['channels'],{'uniqueid':_0x2d5bac['uniqueid']});if(_0x1398dd&&_0x1398dd['channel']){var _0x1d20ad=util[_0xb19a('0x5b')](_0xb19a('0x5c'),_0x2d5bac[_0xb19a('0x5d')]||_0x2d5bac[_0xb19a('0x5e')],_0x2d5bac[_0xb19a('0x5b')]||_0xb19a('0x5f'));return ami[_0xb19a('0x19')]({'action':'MixMonitor','channel':_0x1398dd['channel'],'file':_0x1d20ad,'options':_0xb19a('0x60')})[_0xb19a('0x1a')](function(_0x36f015){var _0x45f56f=_['find'](_0x1398dd[_0xb19a('0x61')],{'filename':'/var/spool/asterisk/monitor/'+_0x1d20ad['toLowerCase']()});if(_['isNil'](_0x45f56f)){_0x1398dd[_0xb19a('0x61')][_0xb19a('0x55')]({'filename':_0xb19a('0x62')+_0x1d20ad['toLowerCase'](),'createdAt':moment()[_0xb19a('0x5b')](_0xb19a('0x63')),'mixmonitorid':_0x36f015[_0xb19a('0x64')],'status':_0xb19a('0x65')});}else{_0x45f56f[_0xb19a('0x64')]=_0x36f015[_0xb19a('0x64')];_0x45f56f[_0xb19a('0x66')]='rec';}_0x12b24d({'code':0xc8,'message':[_0x2d5bac[_0xb19a('0x5e')],_0xb19a('0x67'),_0x36f015[_0xb19a('0x64')]]['join']('\x20'),'mixmonitorid':_0x36f015[_0xb19a('0x64')]});})[_0xb19a('0x68')](function(_0x2f6d24){_0x5dc661(_0x251d0e['error'](0x1f5,[_0x2d5bac['uniqueid'],_0x2f6d24[_0xb19a('0x1b')][_0xb19a('0x69')]()]['join']('\x20')));});}else{return _0x5dc661(_0x251d0e[_0xb19a('0x11')](0x1f5,_0xb19a('0x6a')));}});},'VoiceChannelStopMixMonitor':function(_0x2f99e6){var _0x65ad88=this;return new Promise(function(_0x18c407,_0xb5207c){if(ami[_0xb19a('0x10')]()==![]){return _0xb5207c(_0x65ad88[_0xb19a('0x11')](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0xb19a('0x13')],'ami\x20disconnected']['join']('\x20')));}var _0x136ab0=schema(properties[_0xb19a('0x6b')])[_0xb19a('0x3')](_0x2f99e6);if(_0x136ab0[_0xb19a('0x56')]>0x0){return _0xb5207c(_0x65ad88[_0xb19a('0x11')](0x1f4,_[_0xb19a('0x59')](_0x136ab0,_0xb19a('0x1b'))[_0xb19a('0x1c')](',\x20')));}var _0x436f4c=_[_0xb19a('0x5a')](_0x3deaff['channels'],{'uniqueid':_0x2f99e6['uniqueid']});if(_0x436f4c){return BPromise[_0xb19a('0x6c')]()['then'](function(){if(_0x436f4c[_0xb19a('0x6d')]){return ami[_0xb19a('0x19')]({'action':'StopMixMonitor','channel':_0x436f4c[_0xb19a('0x6d')],'mixmonitorid':_0x2f99e6['mixmonitorid']})[_0xb19a('0x68')](function(_0x3bb01c){});}})[_0xb19a('0x1a')](function(){if(_0x436f4c[_0xb19a('0x6e')]){return ami[_0xb19a('0x19')]({'action':_0xb19a('0x6f'),'channel':_0x436f4c[_0xb19a('0x6e')],'mixmonitorid':_0x2f99e6['mixmonitorid']})[_0xb19a('0x68')](function(_0x20a108){});}})[_0xb19a('0x1a')](function(_0x2a1410){var _0x791b37=_[_0xb19a('0x5a')](_0x436f4c[_0xb19a('0x61')],{'mixmonitorid':_0x2f99e6[_0xb19a('0x64')]});if(_0x791b37){_0x791b37['status']=_0xb19a('0x70');}})['then'](function(){var _0x5f53a7=util[_0xb19a('0x5b')](_0xb19a('0x5c'),_0x2f99e6[_0xb19a('0x5d')]||_0x2f99e6[_0xb19a('0x5e')],_0x2f99e6['format']||_0xb19a('0x5f'));var _0x240b75=_['find'](_0x436f4c[_0xb19a('0x61')],{'filename':'/var/spool/asterisk/monitor/'+_0x5f53a7[_0xb19a('0x69')]()});if(_0x240b75){_0x240b75['status']=_0xb19a('0x70');}})[_0xb19a('0x1a')](function(){_0x18c407({'code':0xc8,'message':[_0x2f99e6[_0xb19a('0x5e')],_0xb19a('0x71')][_0xb19a('0x1c')]('\x20')});})[_0xb19a('0x68')](function(_0x49c9dc){_0xb5207c(_0x65ad88[_0xb19a('0x11')](0x1f5,[_0x2f99e6['uniqueid'],_0x49c9dc['message'][_0xb19a('0x69')]()][_0xb19a('0x1c')]('\x20')));});}else{return _0xb5207c(_0x65ad88[_0xb19a('0x11')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(_0x5c07fb){return new Promise(function(_0x53d78b,_0x356a37){var _0x472806=_[_0xb19a('0x57')](_0x3deaff['queueChannels']);_0x53d78b({'count':_0x472806['length'],'rows':_0x472806});});},'VoiceQueuesChannel':function(_0x1df317){var _0x329482=this;return new Promise(function(_0x35b305,_0x14d103){var _0x39e714=schema(properties[_0xb19a('0x72')])[_0xb19a('0x3')](_0x1df317);if(_0x39e714[_0xb19a('0x56')]>0x0){return _0x14d103(_0x329482[_0xb19a('0x11')](0x1f4,_[_0xb19a('0x59')](_0x39e714,_0xb19a('0x1b'))[_0xb19a('0x1c')](',\x20')));}var _0x1fa65c=_[_0xb19a('0x5a')](_0x3deaff[_0xb19a('0x73')],{'uniqueid':_0x1df317[_0xb19a('0x5e')]});if(_0x1fa65c){_0x35b305(_0x1fa65c);}else{return _0x14d103(_0x329482[_0xb19a('0x11')](0x1f5,_0xb19a('0x6a')));}});},'VoiceQueuesChannelHangup':function(_0x80e89b){var _0x23b976=this;return new Promise(function(_0x5322f6,_0x3566d3){if(ami[_0xb19a('0x10')]()==![]){return _0x3566d3(_0x23b976[_0xb19a('0x11')](0x1f4,[config['asterisk']['ip'],config[_0xb19a('0x12')][_0xb19a('0x13')],_0xb19a('0x14')]['join']('\x20')));}var _0x1300e0=schema(properties[_0xb19a('0x74')])[_0xb19a('0x3')](_0x80e89b);if(_0x1300e0['length']>0x0){return _0x3566d3(_0x23b976[_0xb19a('0x11')](0x1f4,_[_0xb19a('0x59')](_0x1300e0,_0xb19a('0x1b'))[_0xb19a('0x1c')](',\x20')));}var _0x1cdbb6=_[_0xb19a('0x5a')](_0x3deaff['queueChannels'],{'uniqueid':_0x80e89b[_0xb19a('0x5e')]});if(_0x1cdbb6&&_0x1cdbb6[_0xb19a('0x6d')]){return ami['Action']({'action':_0xb19a('0x75'),'channel':_0x1cdbb6[_0xb19a('0x6d')]})[_0xb19a('0x1a')](function(_0x5e1a8f){_0x5322f6({'code':0xc8,'message':[_0x80e89b[_0xb19a('0x5e')],_0x5e1a8f['message'][_0xb19a('0x69')]()][_0xb19a('0x1c')]('\x20')});})[_0xb19a('0x68')](function(_0x3cc6f8){_0x3566d3(_0x23b976[_0xb19a('0x11')](0x1f5,[_0x80e89b[_0xb19a('0x5e')],_0x3cc6f8[_0xb19a('0x1b')]['toLowerCase']()]['join']('\x20')));});}else{return _0x3566d3(_0x23b976[_0xb19a('0x11')](0x1f5,_0xb19a('0x6a')));}});},'VoiceQueuesChannelRedirect':function(_0x88db8d){var _0x46ae8e=this;return new Promise(function(_0x48f99c,_0x102c92){if(ami[_0xb19a('0x10')]()==![]){return _0x102c92(_0x46ae8e[_0xb19a('0x11')](0x1f4,[config[_0xb19a('0x12')]['ip'],config['asterisk'][_0xb19a('0x13')],_0xb19a('0x14')][_0xb19a('0x1c')]('\x20')));}var _0x479448=schema(properties[_0xb19a('0x76')])['validate'](_0x88db8d);if(_0x479448[_0xb19a('0x56')]>0x0){return _0x102c92(_0x46ae8e['error'](0x1f4,_[_0xb19a('0x59')](_0x479448,_0xb19a('0x1b'))['join'](',\x20')));}var _0x3a68a7=_[_0xb19a('0x5a')](_0x3deaff[_0xb19a('0x73')],{'uniqueid':_0x88db8d[_0xb19a('0x5e')]});if(_0x3a68a7&&_0x3a68a7[_0xb19a('0x6d')]){return ami[_0xb19a('0x19')]({'action':_0xb19a('0x77'),'channel':_0x3a68a7[_0xb19a('0x6d')],'exten':_0x88db8d[_0xb19a('0x78')],'context':_0x88db8d['context']||_0x3a68a7[_0xb19a('0x79')],'priority':0x1})[_0xb19a('0x1a')](function(_0x6bdf21){_0x48f99c({'code':0xc8,'message':[_0x88db8d[_0xb19a('0x5e')],_0x6bdf21[_0xb19a('0x1b')][_0xb19a('0x69')]()][_0xb19a('0x1c')]('\x20')});})['catch'](function(_0x3d4657){_0x102c92(_0x46ae8e[_0xb19a('0x11')](0x1f5,[_0x88db8d[_0xb19a('0x5e')],_0x3d4657[_0xb19a('0x1b')][_0xb19a('0x69')]()][_0xb19a('0x1c')]('\x20')));});}else{return _0x102c92(_0x46ae8e['error'](0x1f5,_0xb19a('0x6a')));}});},'Agents':function(_0x442169){return new Promise(function(_0xa0e3e0,_0x4e5dac){var _0x3cb3f1=_[_0xb19a('0x57')](_0x3deaff['agents']);_0xa0e3e0({'count':_0x3cb3f1[_0xb19a('0x56')],'rows':_0x3cb3f1});});},'Telephones':function(_0x2f8ee5){return new Promise(function(_0x28f279,_0x1b597){var _0x5754fe=_[_0xb19a('0x57')](_0x3deaff[_0xb19a('0x7a')]);_0x28f279({'count':_0x5754fe['length'],'rows':_0x5754fe});});},'Trunks':function(_0x4a61f8){return new Promise(function(_0x55fe06,_0x3aa8e4){var _0x23d560=_[_0xb19a('0x57')](_0x3deaff[_0xb19a('0x7b')]);_0x55fe06({'count':_0x23d560[_0xb19a('0x56')],'rows':_0x23d560});});},'OutboundChannels':function(_0x161099){return new Promise(function(_0x219f4e,_0x374e51){var _0x60926a=_[_0xb19a('0x57')](_0x3deaff[_0xb19a('0x7c')]);_0x219f4e({'count':_0x60926a[_0xb19a('0x56')],'rows':_0x60926a});});},'Outbound':function(_0x532b6b){return new Promise(function(_0x56f2c6,_0xcf9703){_0x56f2c6(_0x3deaff[_0xb19a('0x7d')]);});},'Campaigns':function(_0x5b0736){return new Promise(function(_0x5893ce,_0x223619){var _0x491ded=_['values'](_0x3deaff[_0xb19a('0x7e')]);_0x5893ce({'count':_0x491ded['length'],'rows':_0x491ded});});},'VoiceQueuesPreview':function(_0x5c0a2d){var _0x2a4290=this;return new Promise(function(_0xed7185,_0x27650c){_0x4c7ae3['run'](_0x5c0a2d['id'])[_0xb19a('0x1a')](function(_0x3b3b43){_0xed7185({'code':0xc8,'message':_0x3b3b43[_0xb19a('0x1b')]});})['catch'](function(_0x4a5e2d){_0x27650c(_0x2a4290[_0xb19a('0x11')](0x1f4,_0x4a5e2d[_0xb19a('0x1b')]));});});},'EventManager':function(_0x42b3c8){var _0x55fccb=this;return new Promise(function(_0x2a00b2,_0x33d561){if(!_0x42b3c8[_0xb19a('0x7f')]){return _0x33d561(_0x55fccb[_0xb19a('0x11')](0x1f4,_0xb19a('0x80')));}ami[_0xb19a('0x81')]('custom:'+_0x42b3c8[_0xb19a('0x7f')],_0x42b3c8[_0xb19a('0x1b')]);_0x2a00b2({'code':0xc8,'message':_0x42b3c8});});},'FaxAccounts':function(_0x2b5a03){return new Promise(function(_0x39af21,_0x507974){var _0x32f47b=_[_0xb19a('0x57')](_0x3deaff[_0xb19a('0x82')]);_0x39af21({'count':_0x32f47b[_0xb19a('0x56')],'rows':_0x32f47b});});},'SendFax':function(_0x365d50){var _0x3c9d9f=this;return new Promise(function(_0x310d16,_0x1d250a){_0x364573['send'](_0x365d50)[_0xb19a('0x1a')](function(_0x2c5e4c){_0x310d16({'code':0xc8,'message':_0x2c5e4c['message']});})['catch'](function(_0x93b509){_0x1d250a(_0x3c9d9f['error'](0x1f4,_0x93b509['message']));});});},'CheckAfterSend':function(_0x29442a){var _0x24ad8d=this;return new Promise(function(_0x2d286c,_0x5bd9b9){_0x364573[_0xb19a('0x83')](_0x29442a)['then'](function(_0x5228ee){_0x2d286c({'code':0xc8,'message':_0x5228ee[_0xb19a('0x1b')]});})['catch'](function(_0x4303fa){_0x5bd9b9(_0x24ad8d[_0xb19a('0x11')](0x1f4,_0x4303fa[_0xb19a('0x1b')]));});});}};var _0x2939bf=jayson['server'](_0x3d7224)[_0xb19a('0x84')]();_0x2939bf['on'](_0xb19a('0x11'),function(_0x1c5a27){return _0xb61b7e(_0x1c5a27);});_0x2939bf[_0xb19a('0x85')](0x232a,_0xb19a('0x86'),function(){console['log']('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x47a5d2(_0xb19a('0x87')+0x232a);});});}; \ No newline at end of file +var _0xf1f6=['http','127.0.0.1','log','util','jayson/promise','bluebird','moment','../../../config/environment','../properties','../ami','listen','format','%s/%s','name','timers','timer','agents','QueuePause','isConnected','error','asterisk','ami\x20disconnected','pick','keys','module','Reload','Action','then','catch','username','join','Command','content','voiceQueues','hasOwnProperty','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','talking','total','type','unmanaged','abandoned','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','length','values','channels','validate','map','find','channel','filename','uniqueid','wav','ai(mixmonitorid)','/var/spool/asterisk/monitor/','toLowerCase','isNil','monitors','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','Channel\x20doesn\x27t\x20exist','voicechannel','resolve','destinationchannel','StopMixMonitor','stop','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','voicequeuechannelhangup','Hangup','Redirect','exten','context','telephones','trunks','outboundChannels','campaigns','run','Event\x20name\x20mandatory','emit','event','faxAccounts','send','server'];(function(_0x3fc055,_0x5b3660){var _0x3f38eb=function(_0x4ac5e2){while(--_0x4ac5e2){_0x3fc055['push'](_0x3fc055['shift']());}};_0x3f38eb(++_0x5b3660);}(_0xf1f6,0x19b));var _0x6f1f=function(_0x14e206,_0x1e5b1a){_0x14e206=_0x14e206-0x0;var _0x146e6c=_0xf1f6[_0x14e206];return _0x146e6c;};'use strict';var _=require('lodash');var util=require(_0x6f1f('0x0'));var jayson=require(_0x6f1f('0x1'));var schema=require('validate');var BPromise=require(_0x6f1f('0x2'));var moment=require(_0x6f1f('0x3'));var config=require(_0x6f1f('0x4'));var properties=require(_0x6f1f('0x5'));var ami=require(_0x6f1f('0x6'));exports[_0x6f1f('0x7')]=function(_0x288357,_0x5ba838,_0x555c2e){return new BPromise(function(_0x5d9f74,_0x477268){var _0x5e870f={'QueuePause':function(_0x4c3e2e){return new Promise(function(_0x2af737,_0x455504){var _0x3e244f=util[_0x6f1f('0x8')](_0x6f1f('0x9'),'SIP',_0x4c3e2e[_0x6f1f('0xa')]);if(_0x288357[_0x6f1f('0xb')]&&_0x288357[_0x6f1f('0xb')][_0x3e244f]&&_0x288357['timers'][_0x3e244f][_0x6f1f('0xc')]){_0x288357[_0x6f1f('0xb')][_0x3e244f]['updateAcw']();}if(_0x288357[_0x6f1f('0xd')][_0x3e244f]){_0x288357[_0x6f1f('0xd')][_0x3e244f]['updateStatusRealtime']({'statePause':_0x4c3e2e['pause']?!![]:![]});}_0x2af737({'code':0xc8,'message':_0x6f1f('0xe')});});},'Reload':function(_0xafbb5c){var _0x3f1a6b=this;return new Promise(function(_0x2086a6,_0x13f6aa){if(ami[_0x6f1f('0xf')]()==![]){return _0x13f6aa(_0x3f1a6b[_0x6f1f('0x10')](0x1f4,[config['asterisk']['ip'],config[_0x6f1f('0x11')]['username'],_0x6f1f('0x12')]['join']('\x20')));}_0xafbb5c=_[_0x6f1f('0x13')](_0xafbb5c,_[_0x6f1f('0x14')](properties[_0x6f1f('0x15')]));_0xafbb5c['action']=_0x6f1f('0x16');return ami[_0x6f1f('0x17')](_0xafbb5c)[_0x6f1f('0x18')](function(_0xaaa740){_0x2086a6({'code':0xc8,'message':_0xaaa740['message']});})[_0x6f1f('0x19')](function(_0x302499){_0x13f6aa(_0x3f1a6b[_0x6f1f('0x10')](0x1f5,_0x302499['message']));});});},'Command':function(_0x443f82){var _0x1dfb02=this;return new Promise(function(_0x4b9a99,_0x5ca2c9){if(ami[_0x6f1f('0xf')]()==![]){return _0x5ca2c9(_0x1dfb02[_0x6f1f('0x10')](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0x6f1f('0x1a')],_0x6f1f('0x12')][_0x6f1f('0x1b')]('\x20')));}_0x443f82=_[_0x6f1f('0x13')](_0x443f82,'command');_0x443f82['action']=_0x6f1f('0x1c');return ami[_0x6f1f('0x17')](_0x443f82)['then'](function(_0x37df5e){_0x4b9a99({'code':0xc8,'message':_0x37df5e[_0x6f1f('0x1d')]});})[_0x6f1f('0x19')](function(_0x4ee322){_0x5ca2c9(_0x1dfb02['error'](0x1f5,_0x4ee322['message']));});});},'VoiceQueues':function(_0xe2465d){return new Promise(function(_0x433a77,_0x285475){var _0x5c110d=[];for(var _0x2d1cb1 in _0x288357[_0x6f1f('0x1e')]){if(_0x288357[_0x6f1f('0x1e')][_0x6f1f('0x1f')](_0x2d1cb1)){var _0x54502b=_0x288357[_0x6f1f('0x1e')][_0x2d1cb1];var _0x5623a1={'id':_0x54502b['id'],'name':_0x54502b[_0x6f1f('0xa')],'strategy':_0x54502b[_0x6f1f('0x20')],'answered':_0x54502b[_0x6f1f('0x21')],'available':_0x54502b[_0x6f1f('0x22')],'loggedIn':_0x54502b[_0x6f1f('0x23')],'pTalking':_0x54502b[_0x6f1f('0x24')],'sumBillable':_0x54502b[_0x6f1f('0x25')],'sumDuration':_0x54502b[_0x6f1f('0x26')],'sumHoldTime':_0x54502b['sumHoldTime']||0x0,'talking':_0x54502b[_0x6f1f('0x27')],'total':_0x54502b[_0x6f1f('0x28')],'type':_0x54502b[_0x6f1f('0x29')],'unmanaged':_0x54502b[_0x6f1f('0x2a')],'abandoned':_0x54502b[_0x6f1f('0x2b')],'waiting':_0x54502b[_0x6f1f('0x2c')],'loggedInDb':_0x54502b[_0x6f1f('0x2d')]};if(_0x54502b['type']===_0x6f1f('0x2e')){_0x5623a1['dialActive']=_0x54502b[_0x6f1f('0x2f')];_0x5623a1[_0x6f1f('0x30')]=_0x54502b[_0x6f1f('0x30')];_0x5623a1[_0x6f1f('0x31')]=_0x54502b[_0x6f1f('0x31')];_0x5623a1[_0x6f1f('0x32')]=_0x54502b[_0x6f1f('0x32')];_0x5623a1['dialOriginateTimeout']=_0x54502b[_0x6f1f('0x33')];_0x5623a1['dialPrefix']=_0x54502b['dialPrefix'];_0x5623a1[_0x6f1f('0x34')]=_0x54502b['outboundAnswerAgiCallsDay'];_0x5623a1['outboundAnswerCallsDay']=_0x54502b[_0x6f1f('0x35')];_0x5623a1[_0x6f1f('0x36')]=_0x54502b['outboundBlacklistCallsDay'];_0x5623a1[_0x6f1f('0x37')]=_0x54502b[_0x6f1f('0x37')];_0x5623a1[_0x6f1f('0x38')]=_0x54502b[_0x6f1f('0x38')];_0x5623a1[_0x6f1f('0x39')]=_0x54502b[_0x6f1f('0x39')];_0x5623a1[_0x6f1f('0x3a')]=_0x54502b['outboundDropCallsDayCallersExit'];_0x5623a1[_0x6f1f('0x3b')]=_0x54502b['outboundDropCallsDayTimeout'];_0x5623a1[_0x6f1f('0x3c')]=_0x54502b[_0x6f1f('0x3c')];_0x5623a1[_0x6f1f('0x3d')]=_0x54502b[_0x6f1f('0x3d')];_0x5623a1[_0x6f1f('0x3e')]=_0x54502b[_0x6f1f('0x3e')];_0x5623a1['outboundReCallsDay']=_0x54502b[_0x6f1f('0x3f')];_0x5623a1['outboundRejectCallsDay']=_0x54502b[_0x6f1f('0x40')];_0x5623a1['outboundUnknownCallsDay']=_0x54502b['outboundUnknownCallsDay'];_0x5623a1[_0x6f1f('0x41')]=_0x54502b[_0x6f1f('0x41')];_0x5623a1[_0x6f1f('0x42')]=_0x54502b[_0x6f1f('0x42')];_0x5623a1[_0x6f1f('0x43')]=_0x54502b[_0x6f1f('0x43')];_0x5623a1['predictiveIntervalDroppedCallsCallersExit']=_0x54502b[_0x6f1f('0x44')];_0x5623a1[_0x6f1f('0x45')]=_0x54502b[_0x6f1f('0x45')];_0x5623a1[_0x6f1f('0x46')]=_0x54502b[_0x6f1f('0x46')];_0x5623a1[_0x6f1f('0x47')]=_0x54502b[_0x6f1f('0x47')];_0x5623a1[_0x6f1f('0x48')]=_0x54502b[_0x6f1f('0x48')];_0x5623a1['predictiveIntervalMultiplicativeFactor']=_0x54502b['predictiveIntervalMultiplicativeFactor'];_0x5623a1[_0x6f1f('0x49')]=_0x54502b['predictiveIntervalPauses'];_0x5623a1[_0x6f1f('0x4a')]=_0x54502b[_0x6f1f('0x4a')];_0x5623a1[_0x6f1f('0x4b')]=_0x54502b[_0x6f1f('0x4b')];_0x5623a1['message']=_0x54502b[_0x6f1f('0x4c')];_0x5623a1[_0x6f1f('0x4d')]=_0x54502b[_0x6f1f('0x4d')];_0x5623a1[_0x6f1f('0x4e')]=_0x54502b[_0x6f1f('0x4e')];_0x5623a1['erlangCallToSecond']=_0x54502b[_0x6f1f('0x4f')];_0x5623a1['erlangAbandonmentRate']=_0x54502b[_0x6f1f('0x50')];_0x5623a1[_0x6f1f('0x51')]=_0x54502b[_0x6f1f('0x51')];_0x5623a1['startPredictive']=_0x54502b[_0x6f1f('0x52')];_0x5623a1[_0x6f1f('0x53')]=_0x54502b[_0x6f1f('0x53')];}if(_0x54502b[_0x6f1f('0x54')]){_0x5623a1[_0x6f1f('0x54')]={'id':_0x54502b[_0x6f1f('0x54')]['id'],'name':_0x54502b[_0x6f1f('0x54')][_0x6f1f('0xa')],'active':_0x54502b['Trunk'][_0x6f1f('0x55')],'callerid':_0x54502b['Trunk'][_0x6f1f('0x56')]};}if(_0x54502b[_0x6f1f('0x57')]){_0x5623a1[_0x6f1f('0x57')]={'id':_0x54502b[_0x6f1f('0x57')]['id'],'name':_0x54502b[_0x6f1f('0x57')][_0x6f1f('0xa')]};}_0x5c110d[_0x6f1f('0x58')](_0x5623a1);}}_0x433a77({'count':_0x5c110d[_0x6f1f('0x59')],'rows':_0x5c110d});});},'VoiceChannels':function(_0x12e03e){return new Promise(function(_0x19be6e,_0x1f36eb){var _0x23926f=_[_0x6f1f('0x5a')](_0x288357[_0x6f1f('0x5b')]);_0x19be6e({'count':_0x23926f[_0x6f1f('0x59')],'rows':_0x23926f});});},'VoiceChannelMixMonitor':function(_0x376a18){var _0x2c9a1c=this;return new Promise(function(_0x282a34,_0x406083){if(ami[_0x6f1f('0xf')]()==![]){return _0x406083(_0x2c9a1c[_0x6f1f('0x10')](0x1f4,[config[_0x6f1f('0x11')]['ip'],config[_0x6f1f('0x11')]['username'],'ami\x20disconnected'][_0x6f1f('0x1b')]('\x20')));}var _0x24fa7a=schema(properties['voicechannel'])[_0x6f1f('0x5c')](_0x376a18);if(_0x24fa7a[_0x6f1f('0x59')]>0x0){return _0x406083(_0x2c9a1c[_0x6f1f('0x10')](0x1f4,_[_0x6f1f('0x5d')](_0x24fa7a,'message')[_0x6f1f('0x1b')](',\x20')));}var _0x589499=_[_0x6f1f('0x5e')](_0x288357[_0x6f1f('0x5b')],{'uniqueid':_0x376a18['uniqueid']});if(_0x589499&&_0x589499[_0x6f1f('0x5f')]){var _0x5e5f6b=util[_0x6f1f('0x8')]('%s.%s',_0x376a18[_0x6f1f('0x60')]||_0x376a18[_0x6f1f('0x61')],_0x376a18[_0x6f1f('0x8')]||_0x6f1f('0x62'));return ami[_0x6f1f('0x17')]({'action':'MixMonitor','channel':_0x589499[_0x6f1f('0x5f')],'file':_0x5e5f6b,'options':_0x6f1f('0x63')})[_0x6f1f('0x18')](function(_0x44a339){var _0x468a31=_['find'](_0x589499['monitors'],{'filename':_0x6f1f('0x64')+_0x5e5f6b[_0x6f1f('0x65')]()});if(_[_0x6f1f('0x66')](_0x468a31)){_0x589499[_0x6f1f('0x67')][_0x6f1f('0x58')]({'filename':_0x6f1f('0x64')+_0x5e5f6b[_0x6f1f('0x65')](),'createdAt':moment()[_0x6f1f('0x8')](_0x6f1f('0x68')),'mixmonitorid':_0x44a339[_0x6f1f('0x69')],'status':_0x6f1f('0x6a')});}else{_0x468a31[_0x6f1f('0x69')]=_0x44a339[_0x6f1f('0x69')];_0x468a31[_0x6f1f('0x6b')]=_0x6f1f('0x6a');}_0x282a34({'code':0xc8,'message':[_0x376a18[_0x6f1f('0x61')],'MixMonitor\x20Success',_0x44a339[_0x6f1f('0x69')]][_0x6f1f('0x1b')]('\x20'),'mixmonitorid':_0x44a339[_0x6f1f('0x69')]});})[_0x6f1f('0x19')](function(_0xe24288){_0x406083(_0x2c9a1c[_0x6f1f('0x10')](0x1f5,[_0x376a18[_0x6f1f('0x61')],_0xe24288['message'][_0x6f1f('0x65')]()]['join']('\x20')));});}else{return _0x406083(_0x2c9a1c['error'](0x1f5,_0x6f1f('0x6c')));}});},'VoiceChannelStopMixMonitor':function(_0x286b0c){var _0x5f29f0=this;return new Promise(function(_0x57feda,_0x4025b9){if(ami[_0x6f1f('0xf')]()==![]){return _0x4025b9(_0x5f29f0[_0x6f1f('0x10')](0x1f4,[config[_0x6f1f('0x11')]['ip'],config['asterisk'][_0x6f1f('0x1a')],_0x6f1f('0x12')][_0x6f1f('0x1b')]('\x20')));}var _0x500db7=schema(properties[_0x6f1f('0x6d')])['validate'](_0x286b0c);if(_0x500db7['length']>0x0){return _0x4025b9(_0x5f29f0[_0x6f1f('0x10')](0x1f4,_[_0x6f1f('0x5d')](_0x500db7,_0x6f1f('0x4c'))[_0x6f1f('0x1b')](',\x20')));}var _0x321c7f=_[_0x6f1f('0x5e')](_0x288357[_0x6f1f('0x5b')],{'uniqueid':_0x286b0c[_0x6f1f('0x61')]});if(_0x321c7f){return BPromise[_0x6f1f('0x6e')]()['then'](function(){if(_0x321c7f['channel']){return ami[_0x6f1f('0x17')]({'action':'StopMixMonitor','channel':_0x321c7f[_0x6f1f('0x5f')],'mixmonitorid':_0x286b0c['mixmonitorid']})[_0x6f1f('0x19')](function(_0x2b3830){});}})[_0x6f1f('0x18')](function(){if(_0x321c7f[_0x6f1f('0x6f')]){return ami[_0x6f1f('0x17')]({'action':_0x6f1f('0x70'),'channel':_0x321c7f['destinationchannel'],'mixmonitorid':_0x286b0c[_0x6f1f('0x69')]})['catch'](function(_0x81b86f){});}})[_0x6f1f('0x18')](function(_0x4956e2){var _0x1e5e47=_[_0x6f1f('0x5e')](_0x321c7f['monitors'],{'mixmonitorid':_0x286b0c[_0x6f1f('0x69')]});if(_0x1e5e47){_0x1e5e47[_0x6f1f('0x6b')]=_0x6f1f('0x71');}})[_0x6f1f('0x18')](function(){var _0x5c5c81=util['format']('%s.%s',_0x286b0c[_0x6f1f('0x60')]||_0x286b0c['uniqueid'],_0x286b0c['format']||_0x6f1f('0x62'));var _0x54f6c8=_[_0x6f1f('0x5e')](_0x321c7f['monitors'],{'filename':_0x6f1f('0x64')+_0x5c5c81[_0x6f1f('0x65')]()});if(_0x54f6c8){_0x54f6c8[_0x6f1f('0x6b')]=_0x6f1f('0x71');}})[_0x6f1f('0x18')](function(){_0x57feda({'code':0xc8,'message':[_0x286b0c[_0x6f1f('0x61')],_0x6f1f('0x72')][_0x6f1f('0x1b')]('\x20')});})[_0x6f1f('0x19')](function(_0x57f0b4){_0x4025b9(_0x5f29f0[_0x6f1f('0x10')](0x1f5,[_0x286b0c['uniqueid'],_0x57f0b4[_0x6f1f('0x4c')][_0x6f1f('0x65')]()][_0x6f1f('0x1b')]('\x20')));});}else{return _0x4025b9(_0x5f29f0['error'](0x1f5,_0x6f1f('0x6c')));}});},'VoiceQueuesChannels':function(_0x7deff9){return new Promise(function(_0x225819,_0x68b833){var _0x4fe07e=_[_0x6f1f('0x5a')](_0x288357[_0x6f1f('0x73')]);_0x225819({'count':_0x4fe07e[_0x6f1f('0x59')],'rows':_0x4fe07e});});},'VoiceQueuesChannel':function(_0x2b0f33){var _0x22361f=this;return new Promise(function(_0x1eb4c5,_0xdf2c0c){var _0x2ecd36=schema(properties[_0x6f1f('0x74')])[_0x6f1f('0x5c')](_0x2b0f33);if(_0x2ecd36['length']>0x0){return _0xdf2c0c(_0x22361f[_0x6f1f('0x10')](0x1f4,_[_0x6f1f('0x5d')](_0x2ecd36,_0x6f1f('0x4c'))['join'](',\x20')));}var _0x3fd6fc=_['find'](_0x288357[_0x6f1f('0x73')],{'uniqueid':_0x2b0f33[_0x6f1f('0x61')]});if(_0x3fd6fc){_0x1eb4c5(_0x3fd6fc);}else{return _0xdf2c0c(_0x22361f[_0x6f1f('0x10')](0x1f5,_0x6f1f('0x6c')));}});},'VoiceQueuesChannelHangup':function(_0x1c9343){var _0x21b24f=this;return new Promise(function(_0x32f58d,_0x5f8fed){if(ami[_0x6f1f('0xf')]()==![]){return _0x5f8fed(_0x21b24f[_0x6f1f('0x10')](0x1f4,[config[_0x6f1f('0x11')]['ip'],config[_0x6f1f('0x11')][_0x6f1f('0x1a')],_0x6f1f('0x12')][_0x6f1f('0x1b')]('\x20')));}var _0x59475a=schema(properties[_0x6f1f('0x75')])[_0x6f1f('0x5c')](_0x1c9343);if(_0x59475a[_0x6f1f('0x59')]>0x0){return _0x5f8fed(_0x21b24f[_0x6f1f('0x10')](0x1f4,_[_0x6f1f('0x5d')](_0x59475a,'message')[_0x6f1f('0x1b')](',\x20')));}var _0x252e25=_[_0x6f1f('0x5e')](_0x288357[_0x6f1f('0x73')],{'uniqueid':_0x1c9343[_0x6f1f('0x61')]});if(_0x252e25&&_0x252e25[_0x6f1f('0x5f')]){return ami[_0x6f1f('0x17')]({'action':_0x6f1f('0x76'),'channel':_0x252e25[_0x6f1f('0x5f')]})['then'](function(_0x2fc6ed){_0x32f58d({'code':0xc8,'message':[_0x1c9343[_0x6f1f('0x61')],_0x2fc6ed[_0x6f1f('0x4c')][_0x6f1f('0x65')]()][_0x6f1f('0x1b')]('\x20')});})[_0x6f1f('0x19')](function(_0x2d86b8){_0x5f8fed(_0x21b24f[_0x6f1f('0x10')](0x1f5,[_0x1c9343[_0x6f1f('0x61')],_0x2d86b8[_0x6f1f('0x4c')][_0x6f1f('0x65')]()][_0x6f1f('0x1b')]('\x20')));});}else{return _0x5f8fed(_0x21b24f[_0x6f1f('0x10')](0x1f5,_0x6f1f('0x6c')));}});},'VoiceQueuesChannelRedirect':function(_0x5d3045){var _0x360faa=this;return new Promise(function(_0x2177b8,_0x45e098){if(ami['isConnected']()==![]){return _0x45e098(_0x360faa[_0x6f1f('0x10')](0x1f4,[config[_0x6f1f('0x11')]['ip'],config[_0x6f1f('0x11')][_0x6f1f('0x1a')],_0x6f1f('0x12')][_0x6f1f('0x1b')]('\x20')));}var _0x442897=schema(properties['voicequeuechannelredirect'])['validate'](_0x5d3045);if(_0x442897['length']>0x0){return _0x45e098(_0x360faa[_0x6f1f('0x10')](0x1f4,_[_0x6f1f('0x5d')](_0x442897,_0x6f1f('0x4c'))[_0x6f1f('0x1b')](',\x20')));}var _0x4a313d=_[_0x6f1f('0x5e')](_0x288357[_0x6f1f('0x73')],{'uniqueid':_0x5d3045[_0x6f1f('0x61')]});if(_0x4a313d&&_0x4a313d[_0x6f1f('0x5f')]){return ami[_0x6f1f('0x17')]({'action':_0x6f1f('0x77'),'channel':_0x4a313d[_0x6f1f('0x5f')],'exten':_0x5d3045[_0x6f1f('0x78')],'context':_0x5d3045['context']||_0x4a313d[_0x6f1f('0x79')],'priority':0x1})['then'](function(_0x9e5548){_0x2177b8({'code':0xc8,'message':[_0x5d3045[_0x6f1f('0x61')],_0x9e5548[_0x6f1f('0x4c')]['toLowerCase']()][_0x6f1f('0x1b')]('\x20')});})[_0x6f1f('0x19')](function(_0x3a0f3e){_0x45e098(_0x360faa[_0x6f1f('0x10')](0x1f5,[_0x5d3045[_0x6f1f('0x61')],_0x3a0f3e[_0x6f1f('0x4c')]['toLowerCase']()]['join']('\x20')));});}else{return _0x45e098(_0x360faa[_0x6f1f('0x10')](0x1f5,_0x6f1f('0x6c')));}});},'Agents':function(_0x4e4fb5){return new Promise(function(_0x36d79e,_0x10e4cb){var _0x47040e=_[_0x6f1f('0x5a')](_0x288357['agents']);_0x36d79e({'count':_0x47040e[_0x6f1f('0x59')],'rows':_0x47040e});});},'Telephones':function(_0x36d07d){return new Promise(function(_0x1710c9,_0x21aac7){var _0x544a75=_[_0x6f1f('0x5a')](_0x288357[_0x6f1f('0x7a')]);_0x1710c9({'count':_0x544a75['length'],'rows':_0x544a75});});},'Trunks':function(_0x21ad0b){return new Promise(function(_0x5e7bf8,_0x1cb3ff){var _0x333e91=_[_0x6f1f('0x5a')](_0x288357[_0x6f1f('0x7b')]);_0x5e7bf8({'count':_0x333e91[_0x6f1f('0x59')],'rows':_0x333e91});});},'OutboundChannels':function(_0x154c8a){return new Promise(function(_0xcc563e,_0x3d5358){var _0x3c67f0=_['values'](_0x288357[_0x6f1f('0x7c')]);_0xcc563e({'count':_0x3c67f0[_0x6f1f('0x59')],'rows':_0x3c67f0});});},'Outbound':function(_0x120661){return new Promise(function(_0x26a3ce,_0x52cc9e){_0x26a3ce(_0x288357[_0x6f1f('0x2e')]);});},'Campaigns':function(_0x5c01d4){return new Promise(function(_0x2b83d0,_0xbee3c2){var _0x56e75e=_[_0x6f1f('0x5a')](_0x288357[_0x6f1f('0x7d')]);_0x2b83d0({'count':_0x56e75e[_0x6f1f('0x59')],'rows':_0x56e75e});});},'VoiceQueuesPreview':function(_0xf88f96){var _0x3b8d7d=this;return new Promise(function(_0x35ae0a,_0x2b80cd){_0x5ba838[_0x6f1f('0x7e')](_0xf88f96['id'])[_0x6f1f('0x18')](function(_0x124628){_0x35ae0a({'code':0xc8,'message':_0x124628['message']});})['catch'](function(_0x421e9){_0x2b80cd(_0x3b8d7d[_0x6f1f('0x10')](0x1f4,_0x421e9[_0x6f1f('0x4c')]));});});},'EventManager':function(_0x2ad0dc){var _0xd872d9=this;return new Promise(function(_0x3f2e2a,_0x20b017){if(!_0x2ad0dc['event']){return _0x20b017(_0xd872d9[_0x6f1f('0x10')](0x1f4,_0x6f1f('0x7f')));}ami[_0x6f1f('0x80')]('custom:'+_0x2ad0dc[_0x6f1f('0x81')],_0x2ad0dc[_0x6f1f('0x4c')]);_0x3f2e2a({'code':0xc8,'message':_0x2ad0dc});});},'FaxAccounts':function(_0x465d4c){return new Promise(function(_0x590ab3,_0x2a852f){var _0x6d8298=_[_0x6f1f('0x5a')](_0x288357[_0x6f1f('0x82')]);_0x590ab3({'count':_0x6d8298[_0x6f1f('0x59')],'rows':_0x6d8298});});},'SendFax':function(_0x51e709){var _0x178ad4=this;return new Promise(function(_0x41024e,_0xc7e0d0){_0x555c2e[_0x6f1f('0x83')](_0x51e709)[_0x6f1f('0x18')](function(_0x78acfa){_0x41024e({'code':0xc8,'message':_0x78acfa[_0x6f1f('0x4c')]});})[_0x6f1f('0x19')](function(_0xc2ed11){_0xc7e0d0(_0x178ad4[_0x6f1f('0x10')](0x1f4,_0xc2ed11[_0x6f1f('0x4c')]));});});},'CheckAfterSend':function(_0x252dec){var _0x122ad2=this;return new Promise(function(_0x5bf43e,_0x37c659){_0x555c2e['checkAfterSend'](_0x252dec)[_0x6f1f('0x18')](function(_0x1d4be7){_0x5bf43e({'code':0xc8,'message':_0x1d4be7[_0x6f1f('0x4c')]});})[_0x6f1f('0x19')](function(_0x546ad2){_0x37c659(_0x122ad2['error'](0x1f4,_0x546ad2['message']));});});}};var _0x2a6717=jayson[_0x6f1f('0x84')](_0x5e870f)[_0x6f1f('0x85')]();_0x2a6717['on'](_0x6f1f('0x10'),function(_0x3bba2b){return _0x477268(_0x3bba2b);});_0x2a6717[_0x6f1f('0x7')](0x232a,_0x6f1f('0x86'),function(){console[_0x6f1f('0x87')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x5d9f74('RPC\x20listening\x20on\x20port:'+0x232a);});});}; \ No newline at end of file diff --git a/server/services/ami/trigger/cmContact/index.js b/server/services/ami/trigger/cmContact/index.js index 1ec3138..993f7bf 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 _0x0eeb=['merge','data1','resolve','createContact','action','error','Error\x20creating\x20contact','bluebird','util','lodash','ioredis','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','stringify','emit','exec','data2','isNil','routeId','firstName','calleridname','','destcalleridname','destcalleridnum','uniqueid','phone','then','showContact','xmd-contactid2','user:%s','name','format','trigger:%s','toLowerCase'];(function(_0x351fd3,_0x543412){var _0x362288=function(_0x404150){while(--_0x404150){_0x351fd3['push'](_0x351fd3['shift']());}};_0x362288(++_0x543412);}(_0x0eeb,0xc5));var _0xb0ee=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x0eeb[_0x4565bf];return _0x5610ba;};'use strict';var BPromise=require(_0xb0ee('0x0'));var util=require(_0xb0ee('0x1'));var _=require(_0xb0ee('0x2'));var Redis=require(_0xb0ee('0x3'));var config=require(_0xb0ee('0x4'));var logger=require(_0xb0ee('0x5'))('trigger');var cmContactRpc=require('../../rpc/cmContact');config[_0xb0ee('0x6')]=_[_0xb0ee('0x7')](config[_0xb0ee('0x6')],{'host':_0xb0ee('0x8'),'port':0x18eb});var io=require(_0xb0ee('0x9'))(new Redis(config[_0xb0ee('0x6')]));function emit(_0x17f445,_0x5377b4,_0x207a85){logger['info'](_0x17f445,_0x5377b4,JSON[_0xb0ee('0xa')](_0x207a85));io['to'](_0x17f445)[_0xb0ee('0xb')](_0x5377b4,_0x207a85);}exports[_0xb0ee('0xc')]=function(_0x308603,_0x1d5d1b,_0x266794){_0x266794['autoCreate']=0x0;if(_0x1d5d1b['data2']&&parseInt(_0x1d5d1b[_0xb0ee('0xd')],0xa)){var _0x99f91b={'ListId':parseInt(_0x1d5d1b['data1'],0xa),'phone':_0x266794['calleridnum']};if(_[_0xb0ee('0xe')](_0x266794[_0xb0ee('0xf')])){_0x99f91b[_0xb0ee('0x10')]=_0x266794[_0xb0ee('0x11')]&&_0x266794['calleridname']!==_0xb0ee('0x12')?_0x266794['calleridname']:_0x266794['calleridnum']||_0x266794['uniqueid'];}else{_0x99f91b[_0xb0ee('0x10')]=_0x266794[_0xb0ee('0x13')]&&_0x266794['destcalleridname']!==_0xb0ee('0x12')?_0x266794[_0xb0ee('0x13')]:_0x266794[_0xb0ee('0x14')]||_0x266794[_0xb0ee('0x15')];_0x99f91b[_0xb0ee('0x16')]=_0x266794[_0xb0ee('0x13')]&&_0x266794[_0xb0ee('0x13')]!==_0xb0ee('0x12')?_0x266794['destcalleridname']:_0x266794['destcalleridnum']||_0x266794[_0xb0ee('0x15')];}BPromise['resolve']()[_0xb0ee('0x17')](cmContactRpc[_0xb0ee('0x18')]({'where':_['omit'](_0x99f91b,['firstName'])}))[_0xb0ee('0x17')](function(_0x2bd14a){if(_0x2bd14a){_0x266794[_0xb0ee('0x19')]=_0x2bd14a['id'];emit(util['format'](_0xb0ee('0x1a'),_0x308603[_0xb0ee('0x1b')]),util[_0xb0ee('0x1c')](_0xb0ee('0x1d'),_0x1d5d1b['action'][_0xb0ee('0x1e')]()),_[_0xb0ee('0x1f')](_0x266794,{'ListId':parseInt(_0x1d5d1b[_0xb0ee('0x20')],0xa)}));return;}else{return BPromise[_0xb0ee('0x21')]()[_0xb0ee('0x17')](cmContactRpc[_0xb0ee('0x22')](_0x99f91b));}})[_0xb0ee('0x17')](function(_0x2b19f2){if(_0x2b19f2){_0x266794[_0xb0ee('0x19')]=_0x2b19f2['id'];emit(util[_0xb0ee('0x1c')](_0xb0ee('0x1a'),_0x308603[_0xb0ee('0x1b')]),util[_0xb0ee('0x1c')](_0xb0ee('0x1d'),_0x1d5d1b[_0xb0ee('0x23')]['toLowerCase']()),_[_0xb0ee('0x1f')](_0x266794,{'ListId':parseInt(_0x1d5d1b['data1'],0xa)}));}})['catch'](function(_0x3442b7){logger[_0xb0ee('0x24')](_0xb0ee('0x25'),JSON[_0xb0ee('0xa')](_0x3442b7));});}else{if(_0x308603){emit(util['format'](_0xb0ee('0x1a'),_0x308603[_0xb0ee('0x1b')]),util[_0xb0ee('0x1c')](_0xb0ee('0x1d'),_0x1d5d1b['action']['toLowerCase']()),_[_0xb0ee('0x1f')]({'ListId':parseInt(_0x1d5d1b[_0xb0ee('0x20')],0xa)},_0x266794));}}}; \ No newline at end of file +var _0x41d0=['defaults','localhost','socket.io-emitter','info','emit','exec','autoCreate','data2','data1','calleridnum','isNil','routeId','firstName','calleridname','','uniqueid','destcalleridname','phone','resolve','then','omit','xmd-contactid2','user:%s','trigger:%s','toLowerCase','merge','createContact','format','name','catch','error','Error\x20creating\x20contact','stringify','action','bluebird','util','lodash','ioredis','../../../../config/logger','trigger','../../rpc/cmContact','redis'];(function(_0x308213,_0x224541){var _0x2e1619=function(_0x972b51){while(--_0x972b51){_0x308213['push'](_0x308213['shift']());}};_0x2e1619(++_0x224541);}(_0x41d0,0x1c6));var _0x041d=function(_0x7b7e39,_0x5a5a05){_0x7b7e39=_0x7b7e39-0x0;var _0x87fa3f=_0x41d0[_0x7b7e39];return _0x87fa3f;};'use strict';var BPromise=require(_0x041d('0x0'));var util=require(_0x041d('0x1'));var _=require(_0x041d('0x2'));var Redis=require(_0x041d('0x3'));var config=require('../../../../config/environment');var logger=require(_0x041d('0x4'))(_0x041d('0x5'));var cmContactRpc=require(_0x041d('0x6'));config[_0x041d('0x7')]=_[_0x041d('0x8')](config[_0x041d('0x7')],{'host':_0x041d('0x9'),'port':0x18eb});var io=require(_0x041d('0xa'))(new Redis(config[_0x041d('0x7')]));function emit(_0x5f083c,_0x372840,_0x50dae8){logger[_0x041d('0xb')](_0x5f083c,_0x372840,JSON['stringify'](_0x50dae8));io['to'](_0x5f083c)[_0x041d('0xc')](_0x372840,_0x50dae8);}exports[_0x041d('0xd')]=function(_0x556017,_0x5d82e0,_0x53962d){_0x53962d[_0x041d('0xe')]=0x0;if(_0x5d82e0['data2']&&parseInt(_0x5d82e0[_0x041d('0xf')],0xa)){var _0x517f82={'ListId':parseInt(_0x5d82e0[_0x041d('0x10')],0xa),'phone':_0x53962d[_0x041d('0x11')]};if(_[_0x041d('0x12')](_0x53962d[_0x041d('0x13')])){_0x517f82[_0x041d('0x14')]=_0x53962d[_0x041d('0x15')]&&_0x53962d[_0x041d('0x15')]!==_0x041d('0x16')?_0x53962d[_0x041d('0x15')]:_0x53962d['calleridnum']||_0x53962d[_0x041d('0x17')];}else{_0x517f82[_0x041d('0x14')]=_0x53962d[_0x041d('0x18')]&&_0x53962d[_0x041d('0x18')]!==_0x041d('0x16')?_0x53962d[_0x041d('0x18')]:_0x53962d['destcalleridnum']||_0x53962d[_0x041d('0x17')];_0x517f82[_0x041d('0x19')]=_0x53962d[_0x041d('0x18')]&&_0x53962d[_0x041d('0x18')]!==_0x041d('0x16')?_0x53962d[_0x041d('0x18')]:_0x53962d['destcalleridnum']||_0x53962d['uniqueid'];}BPromise[_0x041d('0x1a')]()[_0x041d('0x1b')](cmContactRpc['showContact']({'where':_[_0x041d('0x1c')](_0x517f82,['firstName'])}))[_0x041d('0x1b')](function(_0x2d51dc){if(_0x2d51dc){_0x53962d[_0x041d('0x1d')]=_0x2d51dc['id'];emit(util['format'](_0x041d('0x1e'),_0x556017['name']),util['format'](_0x041d('0x1f'),_0x5d82e0['action'][_0x041d('0x20')]()),_[_0x041d('0x21')](_0x53962d,{'ListId':parseInt(_0x5d82e0[_0x041d('0x10')],0xa)}));return;}else{return BPromise[_0x041d('0x1a')]()[_0x041d('0x1b')](cmContactRpc[_0x041d('0x22')](_0x517f82));}})[_0x041d('0x1b')](function(_0x3c606b){if(_0x3c606b){_0x53962d['xmd-contactid2']=_0x3c606b['id'];emit(util[_0x041d('0x23')](_0x041d('0x1e'),_0x556017[_0x041d('0x24')]),util[_0x041d('0x23')](_0x041d('0x1f'),_0x5d82e0['action'][_0x041d('0x20')]()),_[_0x041d('0x21')](_0x53962d,{'ListId':parseInt(_0x5d82e0[_0x041d('0x10')],0xa)}));}})[_0x041d('0x25')](function(_0x315d73){logger[_0x041d('0x26')](_0x041d('0x27'),JSON[_0x041d('0x28')](_0x315d73));});}else{if(_0x556017){emit(util[_0x041d('0x23')](_0x041d('0x1e'),_0x556017[_0x041d('0x24')]),util[_0x041d('0x23')](_0x041d('0x1f'),_0x5d82e0[_0x041d('0x29')][_0x041d('0x20')]()),_[_0x041d('0x21')]({'ListId':parseInt(_0x5d82e0[_0x041d('0x10')],0xa)},_0x53962d));}}}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index fc1e6d3..ce414d4 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 _0x1cb9=['value','queue','agent','membername','lastevent','routeId','exports','util','url','mustache','ioredis','./urlforward','./cmContact','./script','../../../config/environment','../../../config/logger','trigger','../ami','redis','defaults','localhost','popup','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','bind','custom:agentconnect','syncCustomEvent','custom:agentcomplete','custom:queuecallerabandon','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:newinteraction','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','prototype','emit','info','stringify','clone','checkTriggers','interface','merge','variables','Actions','length','toLowerCase','contactmanager','browser','data2','html','render','template\x20not\x20found','uri','isNil','data3','data4','location','uriLocation','windowWidth','data5','800','windowHeight','data6','winApplication','winArguments','user:%s','name','format','trigger:%s:%s','action','data1','jscripty','exec','integration','accounts','urlforward','script','buildUri','parse','search','replace','AllConditions','every','checkConditions','channel','AnyConditions','some','field','chat','ChatWebsiteId','operator','upperFirst','AccountId'];(function(_0x19997d,_0x2c92a4){var _0x49be7f=function(_0x2e5d31){while(--_0x2e5d31){_0x19997d['push'](_0x19997d['shift']());}};_0x49be7f(++_0x2c92a4);}(_0x1cb9,0x14e));var _0x91cb=function(_0x14c903,_0x1e8467){_0x14c903=_0x14c903-0x0;var _0x2f43a4=_0x1cb9[_0x14c903];return _0x2f43a4;};'use strict';var util=require(_0x91cb('0x0'));var _=require('lodash');var url=require(_0x91cb('0x1'));var Mustache=require(_0x91cb('0x2'));var Redis=require(_0x91cb('0x3'));var urlforward=require(_0x91cb('0x4'));var integration=require('./integration');var cmContact=require(_0x91cb('0x5'));var script=require(_0x91cb('0x6'));var cmContactRpc=require('../rpc/cmContact');var config=require(_0x91cb('0x7'));var logger=require(_0x91cb('0x8'))(_0x91cb('0x9'));var ami=require(_0x91cb('0xa'));config[_0x91cb('0xb')]=_[_0x91cb('0xc')](config['redis'],{'host':_0x91cb('0xd'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x91cb('0xb')]));var operators={'equals':function(_0x4cf9ed,_0xa43e7a){return _0x4cf9ed==_0xa43e7a;},'not_equals':function(_0x317df0,_0x45317f){return _0x317df0!=_0x45317f;}};var barAndWebActions=[_0x91cb('0xe'),_0x91cb('0x1'),_0x91cb('0xf')];function Trigger(_0x21a0a5){this[_0x91cb('0x10')]=_0x21a0a5[_0x91cb('0x10')];this[_0x91cb('0x11')]=_0x21a0a5['agents'];this[_0x91cb('0x12')]=_0x21a0a5[_0x91cb('0x12')];this['templates']=_0x21a0a5[_0x91cb('0x13')];this[_0x91cb('0x14')]=_0x21a0a5[_0x91cb('0x14')];this[_0x91cb('0x15')]=_0x21a0a5['zendeskAccounts'];this['freshdeskAccounts']=_0x21a0a5[_0x91cb('0x16')];this[_0x91cb('0x17')]=_0x21a0a5['salesforceAccounts'];this['sugarcrmAccounts']=_0x21a0a5[_0x91cb('0x18')];this[_0x91cb('0x19')]=_0x21a0a5[_0x91cb('0x19')];this['deskAccounts']=_0x21a0a5[_0x91cb('0x1a')];this[_0x91cb('0x1b')]=_0x21a0a5['vtigerAccounts'];this[_0x91cb('0x1c')]=_0x21a0a5[_0x91cb('0x1c')];this[_0x91cb('0x1d')]=_0x21a0a5[_0x91cb('0x1d')];this['accounts']={'zendesk':this[_0x91cb('0x15')],'salesforce':this[_0x91cb('0x17')],'freshdesk':this['freshdeskAccounts'],'sugarcrm':this[_0x91cb('0x18')],'zoho':this['zohoAccounts'],'desk':this['deskAccounts'],'vtiger':this[_0x91cb('0x1b')],'servicenow':this[_0x91cb('0x1c')],'dynamics365':this['dynamics365Accounts']};ami['on']('custom:agentcalled',this['syncCustomEvent'][_0x91cb('0x1e')](this));ami['on'](_0x91cb('0x1f'),this[_0x91cb('0x20')][_0x91cb('0x1e')](this));ami['on']('custom:agentringnoanswer',this[_0x91cb('0x20')][_0x91cb('0x1e')](this));ami['on'](_0x91cb('0x21'),this['syncCustomEvent'][_0x91cb('0x1e')](this));ami['on'](_0x91cb('0x22'),this[_0x91cb('0x20')][_0x91cb('0x1e')](this));ami['on'](_0x91cb('0x23'),this[_0x91cb('0x24')][_0x91cb('0x1e')](this));ami['on'](_0x91cb('0x25'),this[_0x91cb('0x24')]['bind'](this));ami['on']('custom:dialend',this[_0x91cb('0x24')]['bind'](this));ami['on'](_0x91cb('0x26'),this[_0x91cb('0x20')][_0x91cb('0x1e')](this));ami['on']('custom:closedinteraction',this[_0x91cb('0x20')]['bind'](this));ami['on'](_0x91cb('0x27'),this[_0x91cb('0x20')][_0x91cb('0x1e')](this));ami['on'](_0x91cb('0x28'),this[_0x91cb('0x20')]['bind'](this));ami['on'](_0x91cb('0x29'),this['syncCustomEvent'][_0x91cb('0x1e')](this));ami['on'](_0x91cb('0x2a'),this[_0x91cb('0x20')]['bind'](this));}Trigger[_0x91cb('0x2b')][_0x91cb('0x2c')]=function(_0x25bbf9,_0x361e4c,_0xf296bc){logger[_0x91cb('0x2d')](_0x25bbf9,_0x361e4c,JSON[_0x91cb('0x2e')](_0xf296bc));io['to'](_0x25bbf9)[_0x91cb('0x2c')](_0x361e4c,_0xf296bc);};Trigger[_0x91cb('0x2b')]['syncCustomEvent']=function(_0x2ccf6e){var _0x474a15=_[_0x91cb('0x2f')](_0x2ccf6e);this[_0x91cb('0x30')](_0x474a15);};Trigger[_0x91cb('0x2b')]['syncAgentDial']=function(_0x2409d3){if(this[_0x91cb('0x11')][_0x2409d3[_0x91cb('0x31')]]){this[_0x91cb('0x20')](_0x2409d3);}};Trigger[_0x91cb('0x2b')]['checkTriggers']=function(_0x121c37){var _0x5927cb;for(var _0x47fc17 in this['triggers']){if(this[_0x91cb('0x10')]['hasOwnProperty'](_0x47fc17)){if(this[_0x91cb('0x10')][_0x47fc17]['status']){_0x5927cb=this['checkTrigger'](this[_0x91cb('0x10')][_0x47fc17],_0x121c37);if(_0x5927cb){_[_0x91cb('0x32')](_0x121c37,_0x121c37[_0x91cb('0x33')]);for(var _0x14319b=0x0,_0x2d8fb9,_0x4b0ca6,_0x8beb3a;_0x14319b0x0){_0x2ab8a8=_['map'](_0x36b1fe,_0x5bb425);}return _0x2ab8a8;}function getCustomFields(_0x3db664,_0x4024fa){var _0x196956=[];var _0x1032d6={'custom_fields':{}};if(_0x3db664[_0xced3('0x28')]>0x0){_[_0xced3('0x29')](_0x3db664,function(_0x895a32){if(_0x895a32[_0xced3('0x2a')]===_0xced3('0x2b')&&_0x895a32['nameField']&&!_0x895a32[_0xced3('0x2c')]){_0x1032d6[_0x895a32[_0xced3('0x2d')][_0xced3('0x2e')]()]=_0x895a32[_0xced3('0x2f')][_0xced3('0x23')]();}else if(_0x895a32[_0xced3('0x2a')]===_0xced3('0x2b')&&_0x895a32[_0xced3('0x30')]&&_0x895a32[_0xced3('0x2c')]){_0x1032d6[_0xced3('0x31')][_0x895a32[_0xced3('0x30')]]=_0x895a32[_0xced3('0x2f')][_0xced3('0x23')]();}else if(_0x895a32[_0xced3('0x2a')]===_0xced3('0x32')&&_0x895a32[_0xced3('0x33')]&&_0x895a32[_0xced3('0x30')]&&_0x895a32[_0xced3('0x2c')]){_0x4024fa[_0x895a32[_0xced3('0x33')]]&&(_0x1032d6[_0xced3('0x31')][_0x895a32[_0xced3('0x30')]]=_0x4024fa[_0x895a32['variableName']][_0xced3('0x23')]());}else if(_0x895a32['type']===_0xced3('0x34')&&_0x895a32[_0xced3('0x35')]&&_0x895a32[_0xced3('0x35')][_0xced3('0x36')]&&_0x895a32[_0xced3('0x30')]&&_0x895a32[_0xced3('0x2c')]){_0x4024fa[_0x895a32[_0xced3('0x35')][_0xced3('0x36')][_0xced3('0x2e')]()]&&(_0x1032d6[_0xced3('0x31')][_0x895a32['idField']]=_0x4024fa[_0x895a32[_0xced3('0x35')][_0xced3('0x36')]['toLowerCase']()][_0xced3('0x23')]());}});}if(_0x1032d6[_0xced3('0x37')]){_0x1032d6[_0xced3('0x37')]=Number(_0x1032d6['priority']);}return _0x1032d6;}function getTicket(_0x59c3aa,_0x197ab3,_0x529d5e,_0x410357,_0x413da3){logger['info'](_0xced3('0x38'));var _0x15ca03=_[_0xced3('0x39')]({'subject':intUtil['getString'](_0x410357[_0xced3('0x3a')],_0x413da3,'\x20'),'type':'phone','status':'new','labels':[_0xced3('0x3b'),_0xced3('0x3c'),_0xced3('0x3d')]['concat'](getTags(_0x410357[_0xced3('0x3e')],_0xced3('0x36'))),'description':intUtil[_0xced3('0x3f')](_0x410357[_0xced3('0x40')],_0x413da3,'\x0a'),'_links':{'assigned_user':{'href':util[_0xced3('0x15')](_0xced3('0x41'),_0x197ab3['id']),'class':_0xced3('0x42')}},'message':{'direction':'in','body':intUtil[_0xced3('0x3f')](_0x410357[_0xced3('0x40')],_0x413da3,'\x0a')}},getCustomFields(_0x410357[_0xced3('0x43')],_0x413da3));return request({'uri':util[_0xced3('0x15')](_0xced3('0x44'),_0x59c3aa[_0xced3('0xf')],_0x529d5e['id']),'method':_0xced3('0x45'),'body':_0x15ca03});}exports[_0xced3('0x46')]=function(_0x489546,_0x4279a3,_0x2ec0ad,_0x44ff72,_0x1a6c1f,_0x1de086){var _0x446f34,_0x145157;_0x1de086[_0xced3('0xf')]=intUtil[_0xced3('0x47')](_0x1de086['remoteUri']);_0x1de086[_0xced3('0x48')]=intUtil['stripTrailingSlash'](_0x1de086[_0xced3('0x48')]);if(_0x1a6c1f&&_0x1a6c1f[_0xced3('0x49')]){logger[_0xced3('0xc')]('[QUEUE]',_0xced3('0x4a'));_0x4279a3[_0xced3('0x4b')]=util[_0xced3('0x15')](_0xced3('0x4c'),_0x1de086['serverUrl'],_0x4279a3[_0xced3('0x4d')],md5(_0x4279a3[_0xced3('0x4d')]));}else{_0x4279a3[_0xced3('0x4b')]='';}headers[_0xced3('0x4e')]=getAuth(_0x1de086);return getUser(_0x1de086,_0x44ff72[_0xced3('0x4f')])['then'](function(_0x12e085){_0x446f34=_0x12e085;logger[_0xced3('0xc')](_0xced3('0x50'),_0x446f34['id']);return getEndUser(_0x1de086,_0x4279a3[_0xced3('0x51')],_0x4279a3[_0xced3('0x52')]);})[_0xced3('0x10')](function(_0x3fa9fd){_0x145157=_0x3fa9fd;logger['info'](_0xced3('0x53'),_0x145157['id']);return getTicket(_0x1de086,_0x446f34,_0x145157,_0x2ec0ad,_0x4279a3);})[_0xced3('0x10')](function(_0x4804e3){if(_0x4804e3){logger['info'](_0xced3('0x54'));logger['info'](_0xced3('0x55'),_0x4804e3['id']);switch(_0x1de086[_0xced3('0x2a')]){case _0xced3('0x56'):logger[_0xced3('0xc')](_0xced3('0x57'),_0xced3('0x58'));emit(util[_0xced3('0x15')](_0xced3('0x59'),_0x44ff72[_0xced3('0x36')]),'trigger:desk:display',{'recordId':_0x4804e3['id']});break;case _0xced3('0x5a'):logger[_0xced3('0xc')](_0xced3('0x57'),_0xced3('0x5b'));emit(util[_0xced3('0x15')](_0xced3('0x59'),_0x44ff72['name']),_0xced3('0x5c'),{'uri':util[_0xced3('0x15')](_0xced3('0x5d'),_0x4804e3['id'])});break;default:logger[_0xced3('0x5e')](_0xced3('0x57'),_0xced3('0x5f'));}}})[_0xced3('0x60')](function(_0x120439){console[_0xced3('0x5e')](_0x120439);logger[_0xced3('0x5e')](_0xced3('0x57'),JSON[_0xced3('0x19')](_0x120439));});};exports['outbound']=function(_0x1c69df,_0x4bd3cb,_0x466ffb,_0x27ce0b,_0xc93e05,_0x5e040c,_0x5eaf05){var _0x210e8b,_0x219a11;_0x5e040c['remoteUri']=intUtil[_0xced3('0x47')](_0x5e040c['remoteUri']);_0x5e040c[_0xced3('0x48')]=intUtil[_0xced3('0x47')](_0x5e040c['serverUrl']);if(_0x5eaf05&&_0x5eaf05[_0xced3('0x61')]&&_0x5eaf05[_0xced3('0x61')]!==_0xced3('0x62')){logger['info'](_0xced3('0x63'),'Recording\x20is\x20enabled!');_0x4bd3cb[_0xced3('0x4b')]=util[_0xced3('0x15')](_0xced3('0x4c'),_0x5e040c[_0xced3('0x48')],_0x4bd3cb[_0xced3('0x4d')],md5(_0x4bd3cb[_0xced3('0x4d')]));}headers[_0xced3('0x4e')]=getAuth(_0x5e040c);return getUser(_0x5e040c,_0x27ce0b[_0xced3('0x4f')])[_0xced3('0x10')](function(_0x24ca7d){_0x210e8b=_0x24ca7d;logger[_0xced3('0xc')]('The\x20User\x20ID\x20is:',_0x210e8b['id']);return getEndUser(_0x5e040c,_0x4bd3cb[_0xced3('0x64')],_0x4bd3cb[_0xced3('0x65')]);})[_0xced3('0x10')](function(_0x176d53){_0x219a11=_0x176d53;logger[_0xced3('0xc')](_0xced3('0x53'),_0x219a11['id']);return getTicket(_0x5e040c,_0x210e8b,_0x219a11,_0x466ffb,_0x4bd3cb);})['then'](function(_0x9db425){if(_0x9db425){logger[_0xced3('0xc')](_0xced3('0x54'));logger[_0xced3('0xc')](_0xced3('0x55'),_0x9db425['id']);switch(_0x5e040c[_0xced3('0x2a')]){case'integrationTab':logger[_0xced3('0xc')]('[QUEUE]',_0xced3('0x58'));emit(util['format'](_0xced3('0x59'),_0x27ce0b[_0xced3('0x36')]),'trigger:desk:display',{'recordId':_0x9db425['id']});break;case _0xced3('0x5a'):logger[_0xced3('0xc')](_0xced3('0x57'),_0xced3('0x5b'));emit(util[_0xced3('0x15')](_0xced3('0x59'),_0x27ce0b[_0xced3('0x36')]),_0xced3('0x5c'),{'uri':util[_0xced3('0x15')](_0xced3('0x66'),_0x5e040c[_0xced3('0xf')],_0x9db425['id'])});break;default:logger[_0xced3('0x5e')](_0xced3('0x63'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0xced3('0x60')](function(_0xb2b5d7){logger[_0xced3('0x5e')](_0xced3('0x63'),JSON['stringify'](_0xb2b5d7));});};exports[_0xced3('0x67')]=function(_0x979b24,_0x404241,_0x373f31,_0x2a62f5,_0x13643c,_0x43828b){var _0x4df923,_0x13c304;_0x43828b[_0xced3('0xf')]=intUtil['stripTrailingSlash'](_0x43828b[_0xced3('0xf')]);_0x43828b[_0xced3('0x48')]=intUtil[_0xced3('0x47')](_0x43828b[_0xced3('0x48')]);if(_0x13643c&&_0x13643c['monitor_format']){logger[_0xced3('0xc')](_0xced3('0x68'),_0xced3('0x4a'));_0x404241[_0xced3('0x4b')]=util[_0xced3('0x15')](_0xced3('0x4c'),_0x43828b[_0xced3('0x48')],_0x404241[_0xced3('0x4d')],md5(_0x404241[_0xced3('0x4d')]));}else{_0x404241[_0xced3('0x4b')]='';}headers['Authorization']=getAuth(_0x43828b);return getUser(_0x43828b)[_0xced3('0x10')](function(_0x34e345){_0x4df923=_0x34e345;logger['info']('The\x20User\x20ID\x20is:',_0x4df923['id']);return getEndUser(_0x43828b,_0x404241[_0xced3('0x51')],_0x404241['calleridnum']);})[_0xced3('0x10')](function(_0x256216){_0x13c304=_0x256216;logger['info'](_0xced3('0x53'),_0x13c304['id']);return getTicket(_0x43828b,_0x4df923,_0x13c304,_0x373f31,_0x404241);})[_0xced3('0x10')](function(_0x5ad22e){if(_0x5ad22e){logger[_0xced3('0xc')]('Ticket\x20created!');logger[_0xced3('0xc')]('The\x20Ticket\x20ID\x20is:',_0x5ad22e['id']);}})[_0xced3('0x60')](function(_0x3c9de8){logger[_0xced3('0x5e')]('[ABANDONED]',JSON[_0xced3('0x19')](_0x3c9de8));});}; \ No newline at end of file +var _0x236c=['[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','error','Desk\x20account\x20type\x20not\x20recognized','catch','stringify','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Enduser\x20ID\x20is:','integrationTab','%s/agent/tickets/%s','abandoned','[ABANDONED]','calleridname','lodash','md5','util','ioredis','./util','../../../../config/environment','desk','redis','defaults','localhost','socket.io-emitter','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','remoteUri','then','total_entries','find','entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','GET','authType','%s:%s','username','password','token','%s/token:%s','Basic\x20%s','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','_embedded','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','work','length','map','forEach','string','customField','toLowerCase','content','idField','custom_fields','toString','type','variable','variableName','customVariable','Variable','name','priority','Creating\x20new\x20ticket...','merge','getString','Motion','concat','Tags','Descriptions','/api/v2/users/%d','user','Fields','%s/customers/%d/cases','POST','stripTrailingSlash','serverUrl'];(function(_0x339e3c,_0x2a5c61){var _0x55aa9=function(_0xf5773e){while(--_0xf5773e){_0x339e3c['push'](_0x339e3c['shift']());}};_0x55aa9(++_0x2a5c61);}(_0x236c,0x155));var _0xc236=function(_0x268667,_0x4666b7){_0x268667=_0x268667-0x0;var _0x4ff79c=_0x236c[_0x268667];return _0x4ff79c;};'use strict';var _=require(_0xc236('0x0'));var rp=require('request-promise');var md5=require(_0xc236('0x1'));var util=require(_0xc236('0x2'));var Redis=require(_0xc236('0x3'));var intUtil=require(_0xc236('0x4'));var config=require(_0xc236('0x5'));var logger=require('../../../../config/logger')(_0xc236('0x6'));config[_0xc236('0x7')]=_[_0xc236('0x8')](config[_0xc236('0x7')],{'host':_0xc236('0x9'),'port':0x18eb});var io=require(_0xc236('0xa'))(new Redis(config['redis']));function emit(_0xd612c6,_0x4d349b,_0x51a13b){io['to'](_0xd612c6)['emit'](_0x4d349b,_0x51a13b);}var headers={'Content-Type':'application/json','Accept':_0xc236('0xb')};function getUser(_0x4b8dc6,_0x30a28d){if(intUtil[_0xc236('0xc')](_0x30a28d)===!![]){logger[_0xc236('0xd')](_0xc236('0xe'),_0x30a28d);return request({'uri':util[_0xc236('0xf')]('%s/users',_0x4b8dc6[_0xc236('0x10')])})[_0xc236('0x11')](function(_0x58acb0){if(_0x58acb0[_0xc236('0x12')]){return _[_0xc236('0x13')](_0x58acb0['_embedded'][_0xc236('0x14')],{'email':_0x30a28d});}})['then'](function(_0x599d36){if(_0x599d36){logger[_0xc236('0xd')](_0xc236('0x15'));return _0x599d36;}else{logger[_0xc236('0xd')](_0xc236('0x16'));return request({'uri':util['format'](_0xc236('0x17'),_0x4b8dc6['remoteUri'])});}});}else{logger['info'](_0xc236('0x18'));return request({'uri':util[_0xc236('0xf')](_0xc236('0x17'),_0x4b8dc6[_0xc236('0x10')])});}}function request(_0x267913){logger['debug']('[HTTP]',JSON['stringify'](_0x267913));return rp(_[_0xc236('0x8')](_0x267913,{'method':_0xc236('0x19'),'headers':headers,'json':!![]}));}function getAuth(_0x11ec65){var _0x541a20;if(_0x11ec65[_0xc236('0x1a')]==='basic'){_0x541a20=util['format'](_0xc236('0x1b'),_0x11ec65[_0xc236('0x1c')],_0x11ec65[_0xc236('0x1d')]);}else if(_0x11ec65[_0xc236('0x1a')]===_0xc236('0x1e')){_0x541a20=util[_0xc236('0xf')](_0xc236('0x1f'),_0x11ec65[_0xc236('0x1c')],_0x11ec65[_0xc236('0x1e')]);}return util[_0xc236('0xf')](_0xc236('0x20'),new Buffer(_0x541a20)['toString'](_0xc236('0x21')));}function getEndUser(_0x34d73a,_0x3bd41b,_0xd18bd0){logger[_0xc236('0xd')](_0xc236('0x22'),_0xd18bd0);return request({'uri':util[_0xc236('0xf')](_0xc236('0x23'),_0x34d73a[_0xc236('0x10')]),'qs':{'phone':_0xd18bd0}})[_0xc236('0x11')](function(_0x17cb3b){if(_0x17cb3b['total_entries']){logger[_0xc236('0xd')](_0xc236('0x24'));return _0x17cb3b[_0xc236('0x25')][_0xc236('0x14')][0x0];}else{logger['info'](_0xc236('0x26'));return request({'uri':util['format']('%s/customers',_0x34d73a[_0xc236('0x10')]),'method':'POST','body':{'first_name':_0x3bd41b,'title':_0x3bd41b,'phone_numbers':[{'type':_0xc236('0x27'),'value':_0xd18bd0}]}});}});}function getTags(_0x4f753c,_0x54365){var _0x5c79d6=[];if(_0x4f753c&&_0x4f753c[_0xc236('0x28')]>0x0){_0x5c79d6=_[_0xc236('0x29')](_0x4f753c,_0x54365);}return _0x5c79d6;}function getCustomFields(_0x4f5175,_0x5a61b5){var _0x265c8d=[];var _0x1fd31d={'custom_fields':{}};if(_0x4f5175[_0xc236('0x28')]>0x0){_[_0xc236('0x2a')](_0x4f5175,function(_0x5f3891){if(_0x5f3891['type']===_0xc236('0x2b')&&_0x5f3891['nameField']&&!_0x5f3891[_0xc236('0x2c')]){_0x1fd31d[_0x5f3891['nameField'][_0xc236('0x2d')]()]=_0x5f3891[_0xc236('0x2e')]['toString']();}else if(_0x5f3891['type']===_0xc236('0x2b')&&_0x5f3891[_0xc236('0x2f')]&&_0x5f3891[_0xc236('0x2c')]){_0x1fd31d[_0xc236('0x30')][_0x5f3891[_0xc236('0x2f')]]=_0x5f3891[_0xc236('0x2e')][_0xc236('0x31')]();}else if(_0x5f3891[_0xc236('0x32')]===_0xc236('0x33')&&_0x5f3891['variableName']&&_0x5f3891['idField']&&_0x5f3891['customField']){_0x5a61b5[_0x5f3891[_0xc236('0x34')]]&&(_0x1fd31d[_0xc236('0x30')][_0x5f3891[_0xc236('0x2f')]]=_0x5a61b5[_0x5f3891[_0xc236('0x34')]][_0xc236('0x31')]());}else if(_0x5f3891[_0xc236('0x32')]===_0xc236('0x35')&&_0x5f3891['Variable']&&_0x5f3891[_0xc236('0x36')][_0xc236('0x37')]&&_0x5f3891[_0xc236('0x2f')]&&_0x5f3891['customField']){_0x5a61b5[_0x5f3891[_0xc236('0x36')][_0xc236('0x37')][_0xc236('0x2d')]()]&&(_0x1fd31d[_0xc236('0x30')][_0x5f3891['idField']]=_0x5a61b5[_0x5f3891[_0xc236('0x36')][_0xc236('0x37')][_0xc236('0x2d')]()][_0xc236('0x31')]());}});}if(_0x1fd31d[_0xc236('0x38')]){_0x1fd31d[_0xc236('0x38')]=Number(_0x1fd31d[_0xc236('0x38')]);}return _0x1fd31d;}function getTicket(_0x11ca1c,_0x131212,_0x1251af,_0x2bb05e,_0x6aa23b){logger[_0xc236('0xd')](_0xc236('0x39'));var _0x12e802=_[_0xc236('0x3a')]({'subject':intUtil[_0xc236('0x3b')](_0x2bb05e['Subjects'],_0x6aa23b,'\x20'),'type':'phone','status':'new','labels':['xCALLY',_0xc236('0x3c'),'CTI'][_0xc236('0x3d')](getTags(_0x2bb05e[_0xc236('0x3e')],_0xc236('0x37'))),'description':intUtil[_0xc236('0x3b')](_0x2bb05e[_0xc236('0x3f')],_0x6aa23b,'\x0a'),'_links':{'assigned_user':{'href':util[_0xc236('0xf')](_0xc236('0x40'),_0x131212['id']),'class':_0xc236('0x41')}},'message':{'direction':'in','body':intUtil[_0xc236('0x3b')](_0x2bb05e[_0xc236('0x3f')],_0x6aa23b,'\x0a')}},getCustomFields(_0x2bb05e[_0xc236('0x42')],_0x6aa23b));return request({'uri':util[_0xc236('0xf')](_0xc236('0x43'),_0x11ca1c[_0xc236('0x10')],_0x1251af['id']),'method':_0xc236('0x44'),'body':_0x12e802});}exports['queue']=function(_0x31bd91,_0x24b851,_0x506ba0,_0xb90a83,_0x5b0bc5,_0x1cecc5){var _0x5e3910,_0x30f391;_0x1cecc5[_0xc236('0x10')]=intUtil[_0xc236('0x45')](_0x1cecc5['remoteUri']);_0x1cecc5[_0xc236('0x46')]=intUtil[_0xc236('0x45')](_0x1cecc5[_0xc236('0x46')]);if(_0x5b0bc5&&_0x5b0bc5['monitor_format']){logger[_0xc236('0xd')](_0xc236('0x47'),_0xc236('0x48'));_0x24b851[_0xc236('0x49')]=util[_0xc236('0xf')](_0xc236('0x4a'),_0x1cecc5['serverUrl'],_0x24b851[_0xc236('0x4b')],md5(_0x24b851['uniqueid']));}else{_0x24b851[_0xc236('0x49')]='';}headers[_0xc236('0x4c')]=getAuth(_0x1cecc5);return getUser(_0x1cecc5,_0xb90a83[_0xc236('0x4d')])[_0xc236('0x11')](function(_0x3cf9f8){_0x5e3910=_0x3cf9f8;logger[_0xc236('0xd')](_0xc236('0x4e'),_0x5e3910['id']);return getEndUser(_0x1cecc5,_0x24b851['calleridname'],_0x24b851[_0xc236('0x4f')]);})['then'](function(_0x4674fe){_0x30f391=_0x4674fe;logger[_0xc236('0xd')]('The\x20Enduser\x20ID\x20is:',_0x30f391['id']);return getTicket(_0x1cecc5,_0x5e3910,_0x30f391,_0x506ba0,_0x24b851);})[_0xc236('0x11')](function(_0x14ed4b){if(_0x14ed4b){logger[_0xc236('0xd')](_0xc236('0x50'));logger[_0xc236('0xd')](_0xc236('0x51'),_0x14ed4b['id']);switch(_0x1cecc5[_0xc236('0x32')]){case'integrationTab':logger['info'](_0xc236('0x47'),_0xc236('0x52'));emit(util['format'](_0xc236('0x53'),_0xb90a83[_0xc236('0x37')]),_0xc236('0x54'),{'recordId':_0x14ed4b['id']});break;case _0xc236('0x55'):logger[_0xc236('0xd')](_0xc236('0x47'),_0xc236('0x56'));emit(util[_0xc236('0xf')](_0xc236('0x53'),_0xb90a83['name']),_0xc236('0x57'),{'uri':util[_0xc236('0xf')](_0xc236('0x58'),_0x14ed4b['id'])});break;default:logger[_0xc236('0x59')](_0xc236('0x47'),_0xc236('0x5a'));}}})[_0xc236('0x5b')](function(_0x53724f){console[_0xc236('0x59')](_0x53724f);logger[_0xc236('0x59')](_0xc236('0x47'),JSON[_0xc236('0x5c')](_0x53724f));});};exports['outbound']=function(_0xa34c01,_0x3e6da6,_0xad71ea,_0x2f3d08,_0x9d81c8,_0x48238b,_0x38d504){var _0x4a1251,_0xae369a;_0x48238b[_0xc236('0x10')]=intUtil[_0xc236('0x45')](_0x48238b[_0xc236('0x10')]);_0x48238b[_0xc236('0x46')]=intUtil['stripTrailingSlash'](_0x48238b['serverUrl']);if(_0x38d504&&_0x38d504[_0xc236('0x5d')]&&_0x38d504[_0xc236('0x5d')]!==_0xc236('0x5e')){logger[_0xc236('0xd')](_0xc236('0x5f'),_0xc236('0x48'));_0x3e6da6[_0xc236('0x49')]=util[_0xc236('0xf')](_0xc236('0x4a'),_0x48238b[_0xc236('0x46')],_0x3e6da6['uniqueid'],md5(_0x3e6da6['uniqueid']));}headers[_0xc236('0x4c')]=getAuth(_0x48238b);return getUser(_0x48238b,_0x2f3d08[_0xc236('0x4d')])[_0xc236('0x11')](function(_0x659f37){_0x4a1251=_0x659f37;logger['info'](_0xc236('0x4e'),_0x4a1251['id']);return getEndUser(_0x48238b,_0x3e6da6[_0xc236('0x60')],_0x3e6da6['destcalleridnum']);})[_0xc236('0x11')](function(_0x3adb81){_0xae369a=_0x3adb81;logger[_0xc236('0xd')](_0xc236('0x61'),_0xae369a['id']);return getTicket(_0x48238b,_0x4a1251,_0xae369a,_0xad71ea,_0x3e6da6);})['then'](function(_0x1558dd){if(_0x1558dd){logger[_0xc236('0xd')](_0xc236('0x50'));logger[_0xc236('0xd')](_0xc236('0x51'),_0x1558dd['id']);switch(_0x48238b[_0xc236('0x32')]){case _0xc236('0x62'):logger['info'](_0xc236('0x47'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0xc236('0xf')](_0xc236('0x53'),_0x2f3d08[_0xc236('0x37')]),_0xc236('0x54'),{'recordId':_0x1558dd['id']});break;case'newTab':logger[_0xc236('0xd')](_0xc236('0x47'),_0xc236('0x56'));emit(util['format'](_0xc236('0x53'),_0x2f3d08[_0xc236('0x37')]),_0xc236('0x57'),{'uri':util[_0xc236('0xf')](_0xc236('0x63'),_0x48238b[_0xc236('0x10')],_0x1558dd['id'])});break;default:logger['error']('[OUTBOUND]',_0xc236('0x5a'));}}})[_0xc236('0x5b')](function(_0x125f9a){logger[_0xc236('0x59')](_0xc236('0x5f'),JSON[_0xc236('0x5c')](_0x125f9a));});};exports[_0xc236('0x64')]=function(_0x553f58,_0x59466f,_0x4b59d3,_0x119710,_0x3c11da,_0x2ea07c){var _0x2d6b00,_0x47aa3f;_0x2ea07c['remoteUri']=intUtil['stripTrailingSlash'](_0x2ea07c['remoteUri']);_0x2ea07c[_0xc236('0x46')]=intUtil['stripTrailingSlash'](_0x2ea07c[_0xc236('0x46')]);if(_0x3c11da&&_0x3c11da['monitor_format']){logger[_0xc236('0xd')](_0xc236('0x65'),_0xc236('0x48'));_0x59466f[_0xc236('0x49')]=util[_0xc236('0xf')](_0xc236('0x4a'),_0x2ea07c[_0xc236('0x46')],_0x59466f['uniqueid'],md5(_0x59466f[_0xc236('0x4b')]));}else{_0x59466f['recordingURL']='';}headers[_0xc236('0x4c')]=getAuth(_0x2ea07c);return getUser(_0x2ea07c)[_0xc236('0x11')](function(_0x281dc6){_0x2d6b00=_0x281dc6;logger[_0xc236('0xd')](_0xc236('0x4e'),_0x2d6b00['id']);return getEndUser(_0x2ea07c,_0x59466f[_0xc236('0x66')],_0x59466f['calleridnum']);})[_0xc236('0x11')](function(_0x94f65d){_0x47aa3f=_0x94f65d;logger['info'](_0xc236('0x61'),_0x47aa3f['id']);return getTicket(_0x2ea07c,_0x2d6b00,_0x47aa3f,_0x4b59d3,_0x59466f);})[_0xc236('0x11')](function(_0x11d899){if(_0x11d899){logger['info'](_0xc236('0x50'));logger[_0xc236('0xd')](_0xc236('0x51'),_0x11d899['id']);}})[_0xc236('0x5b')](function(_0x340f7c){logger[_0xc236('0x59')](_0xc236('0x65'),JSON[_0xc236('0x5c')](_0x340f7c));});}; \ 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 0b463f0..25cfa23 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 _0xbc6b=['../../../../config/environment','redis','defaults','localhost','POST','clientId','remoteUri','username','password','clientSecret','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','Bearer\x20','4.0','then','value','email','userEmail','length','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','toLowerCase','outbound','destcalleridnum','calleridnum','substring','lastIndexOf','GET','contacts?$select=telephone1','contactid',']\x20Enduser\x20created!','enduserId',']\x20Enduser\x20Created!','forEach','type','string','nameField','customField','idField','indexOf','content','ticketType','incidents','assign','Subjects','getString','Descriptions','phonecall','phonecalls','/contacts(','/systemusers(','callDirection','queue','Fields','headers','odata-entityid','ticketId','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','serverUrl','stripTrailingSlash','abandoned','format','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId','uniqueid','[QUEUE]','recordingURL','recordingFormat','none','Recording\x20is\x20enabled!',']\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...',']\x20Error\x20running\x20Dynamics365\x20integration','bluebird','request-promise','./util','md5','ioredis','../../../../config/logger','dynamics365'];(function(_0x5b7309,_0x4f2311){var _0xa987f7=function(_0x443261){while(--_0x443261){_0x5b7309['push'](_0x5b7309['shift']());}};_0xa987f7(++_0x4f2311);}(_0xbc6b,0xbd));var _0xbbc6=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0xbc6b[_0x39096d];return _0x13da4f;};'use strict';var _=require('lodash');var BPromise=require(_0xbbc6('0x0'));var rp=require(_0xbbc6('0x1'));var util=require('util');var intUtil=require(_0xbbc6('0x2'));var md5=require(_0xbbc6('0x3'));var Redis=require(_0xbbc6('0x4'));var logger=require(_0xbbc6('0x5'))(_0xbbc6('0x6'));var config=require(_0xbbc6('0x7'));config[_0xbbc6('0x8')]=_[_0xbbc6('0x9')](config[_0xbbc6('0x8')],{'host':_0xbbc6('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xbbc6('0x8')]));function getAuthToken(_0x18113c,_0xd0b7e0,_0x5c28ce){var _0x384b41={'method':_0xbbc6('0xb'),'uri':_0xd0b7e0,'form':{'client_id':_0x18113c[_0xbbc6('0xc')],'resource':_0x18113c[_0xbbc6('0xd')],'username':_0x18113c[_0xbbc6('0xe')],'password':_0x18113c[_0xbbc6('0xf')],'grant_type':_0xbbc6('0xf'),'client_secret':_0x18113c[_0xbbc6('0x10')]},'json':!![]};return rp(_0x384b41)['then'](function(_0x4f21a9){return _0x4f21a9[_0xbbc6('0x11')];})[_0xbbc6('0x12')](function(_0x2505d0){logger[_0xbbc6('0x13')]('['+[_0x5c28ce[_0xbbc6('0x14')]()]+_0xbbc6('0x15'));return _0x2505d0[_0xbbc6('0x16')];});}function getUser(_0x5ba56b,_0x1c82fc,_0x3437d2,_0xf94834,_0x2a1a6d,_0x2aab6f){return new BPromise(function(_0x12629b,_0x53ef11){return getAuthToken(_0x1c82fc,_0xf94834,_0x2aab6f)['then'](function(_0x210ac1){var _0x38f526={'method':'GET','uri':_0x2a1a6d+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':_0xbbc6('0x17')+_0x210ac1,'OData-Version':_0xbbc6('0x18')},'json':!![]};return rp(_0x38f526);})[_0xbbc6('0x19')](function(_0x31b0d4){var _0x46be61=_0x31b0d4[_0xbbc6('0x1a')];var _0x45b2b4=![];var _0x473bc3=null;if(!_['isNil'](_0x3437d2)){if(intUtil['validateEmail'](_0x3437d2[_0xbbc6('0x1b')])){_0x5ba56b[_0xbbc6('0x1c')]=_0x3437d2[_0xbbc6('0x1b')];for(_0x473bc3=0x0;_0x473bc3<_0x46be61[_0xbbc6('0x1d')];_0x473bc3++){if(_0x46be61[_0x473bc3][_0xbbc6('0x1e')]===_0x3437d2[_0xbbc6('0x1b')]&&!_0x46be61[_0x473bc3][_0xbbc6('0x1f')]){_0x45b2b4=!![];logger[_0xbbc6('0x20')]('['+[_0x2aab6f[_0xbbc6('0x14')]()]+_0xbbc6('0x21')+_0x46be61[_0x473bc3][_0xbbc6('0x22')]+'!');_0x5ba56b[_0xbbc6('0x23')]=_0x46be61[_0x473bc3][_0xbbc6('0x22')];}}}}if(!_0x45b2b4){logger[_0xbbc6('0x20')]('['+[_0x2aab6f[_0xbbc6('0x14')]()]+_0xbbc6('0x24'));_0x5ba56b['userEmail']=_0x1c82fc[_0xbbc6('0xe')];for(_0x473bc3=0x0;_0x473bc3<_0x46be61[_0xbbc6('0x1d')];_0x473bc3++){if(_0x46be61[_0x473bc3][_0xbbc6('0x1e')]===_0x1c82fc['username']){_0x5ba56b[_0xbbc6('0x23')]=_0x46be61[_0x473bc3][_0xbbc6('0x22')];}}}_0x12629b(_0x5ba56b);})[_0xbbc6('0x12')](function(_0x1f4659){_0x53ef11(_0x1f4659[_0xbbc6('0x16')]);});});}function createEndUser(_0x4a7758,_0x4a14b9,_0x2646db,_0x42725a,_0x3ff9ee,_0x544a87){return new BPromise(function(_0x46fb79,_0x359d60){return getAuthToken(_0x4a14b9,_0x2646db,_0x544a87)[_0xbbc6('0x19')](function(_0x271c95){var _0x4cf3b8=_0x544a87[_0xbbc6('0x25')]()===_0xbbc6('0x26')?_0x3ff9ee[_0xbbc6('0x27')]:_0x3ff9ee[_0xbbc6('0x28')];var _0x1485e1={'method':_0xbbc6('0xb'),'uri':_0x42725a+'contacts','body':{'telephone1':_0x4cf3b8,'fullname':_0x4cf3b8,'firstname':_0x4cf3b8,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x4a7758[_0xbbc6('0x23')]+')'},'headers':{'Authorization':_0xbbc6('0x17')+_0x271c95,'OData-Version':_0xbbc6('0x18')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x1485e1);})['then'](function(_0x587f58){var _0x354213=_0x587f58['headers']['odata-entityid'];var _0x5d991b=_0x354213[_0xbbc6('0x29')](_0x354213[_0xbbc6('0x2a')]('(')+0x1,_0x354213[_0xbbc6('0x2a')](')'));_0x4a7758['enduserId']=_0x5d991b;_0x46fb79(_0x4a7758);})[_0xbbc6('0x12')](function(_0x502939){_0x359d60(_0x502939[_0xbbc6('0x16')]);});});}function getEndUser(_0x3a1ca1,_0x8f48b0,_0x8dd0c2,_0x3bd3c7,_0x5b49c3,_0x4bfc66){return new BPromise(function(_0x3300cc,_0x41dba3){return getAuthToken(_0x8f48b0,_0x8dd0c2,_0x4bfc66)[_0xbbc6('0x19')](function(_0x48190b){var _0x26b025={'method':_0xbbc6('0x2b'),'uri':_0x3bd3c7+_0xbbc6('0x2c'),'headers':{'Authorization':_0xbbc6('0x17')+_0x48190b,'If-None-Match':null,'OData-Version':_0xbbc6('0x18')},'json':!![]};return rp(_0x26b025);})[_0xbbc6('0x19')](function(_0x4d9782){var _0xa9cce0=null;if(_0x4d9782){var _0x5f1cbc=_0x4d9782[_0xbbc6('0x1a')];var _0x4b5c3c=![];for(_0xa9cce0=0x0;_0xa9cce0<_0x5f1cbc['length'];_0xa9cce0++){var _0x18977a=_0x4bfc66[_0xbbc6('0x25')]()===_0xbbc6('0x26')?_0x5b49c3[_0xbbc6('0x27')]:_0x5b49c3['calleridnum'];if(_0x5f1cbc[_0xa9cce0]['telephone1']===_0x18977a){_0x4b5c3c=!![];_0x3a1ca1['enduserId']=_0x5f1cbc[_0xa9cce0][_0xbbc6('0x2d')];}}if(_0x4b5c3c){_0x3300cc(_0x3a1ca1);}else{return createEndUser(_0x3a1ca1,_0x8f48b0,_0x8dd0c2,_0x3bd3c7,_0x5b49c3,_0x4bfc66)[_0xbbc6('0x19')](function(_0xfdf77a){logger[_0xbbc6('0x20')]('['+[_0x4bfc66['toUpperCase']()]+_0xbbc6('0x2e'),_0xfdf77a[_0xbbc6('0x2f')]);_0x3300cc(_0xfdf77a);});}}else{return createEndUser(_0x3a1ca1,_0x8f48b0,_0x8dd0c2,_0x3bd3c7,_0x5b49c3,_0x4bfc66)['then'](function(_0x47cbcd){logger[_0xbbc6('0x20')]('['+[_0x4bfc66[_0xbbc6('0x14')]()]+_0xbbc6('0x30'),_0x47cbcd[_0xbbc6('0x2f')]);_0x3300cc(_0x47cbcd);});}});});}function getCustomFields(_0x59fcbb,_0x428cdc,_0x5959ec){var _0x5029ce={};if(_0x59fcbb['length']>0x0){_[_0xbbc6('0x31')](_0x59fcbb,function(_0x5f4954){if(_0x5f4954[_0xbbc6('0x32')]===_0xbbc6('0x33')&&_0x5f4954[_0xbbc6('0x34')]&&!_0x5f4954[_0xbbc6('0x35')]){var _0x1cfa2d=_0x5f4954[_0xbbc6('0x36')][_0xbbc6('0x25')]();var _0x1f378f=_0x1cfa2d[_0xbbc6('0x29')](0x0,_0x1cfa2d[_0xbbc6('0x37')]('_'));var _0x4f574f=_0x1cfa2d[_0xbbc6('0x29')](_0x1cfa2d[_0xbbc6('0x37')]('_')+0x1);if(_0x1f378f===_0x5959ec){_0x5029ce[_0x4f574f]=_0x5f4954[_0xbbc6('0x38')];}}});}return _0x5029ce;}function getTicket(_0x57ac6b,_0x5a448f,_0x46eeb8,_0xea4a9f,_0x15c7ad,_0x5b2d73,_0x152cf7){return new BPromise(function(_0x3ca075,_0x542d72){var _0x1f6e44;return getAuthToken(_0x5a448f,_0x46eeb8,_0x152cf7)[_0xbbc6('0x19')](function(_0xdae0ab){if(_0x5b2d73[_0xbbc6('0x39')]==='incident'){_0x1f6e44={'method':_0xbbc6('0xb'),'uri':_0xea4a9f+_0xbbc6('0x3a'),'body':Object[_0xbbc6('0x3b')]({},{'title':intUtil['getString'](_0x5b2d73[_0xbbc6('0x3c')],_0x15c7ad,'\x20'),'description':intUtil[_0xbbc6('0x3d')](_0x5b2d73[_0xbbc6('0x3e')],_0x15c7ad,'\x0a'),'customerid_contact@odata.bind':'/contacts('+_0x57ac6b[_0xbbc6('0x2f')]+')','ownerid@odata.bind':'/systemusers('+_0x57ac6b[_0xbbc6('0x23')]+')','caseorigincode':'1'},getCustomFields(_0x5b2d73['Fields'],_0x15c7ad,_0x5b2d73[_0xbbc6('0x39')])),'headers':{'Authorization':'Bearer\x20'+_0xdae0ab,'OData-Version':_0xbbc6('0x18')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x5b2d73[_0xbbc6('0x39')]===_0xbbc6('0x3f')){_0x1f6e44={'method':_0xbbc6('0xb'),'uri':_0xea4a9f+_0xbbc6('0x40'),'body':Object[_0xbbc6('0x3b')]({},{'subject':intUtil['getString'](_0x5b2d73[_0xbbc6('0x3c')],_0x15c7ad,'\x20'),'phonenumber':String(_0x15c7ad[_0xbbc6('0x28')]),'description':intUtil[_0xbbc6('0x3d')](_0x5b2d73[_0xbbc6('0x3e')],_0x15c7ad,'\x0a'),'regardingobjectid_contact@odata.bind':_0xbbc6('0x41')+_0x57ac6b[_0xbbc6('0x2f')]+')','ownerid@odata.bind':_0xbbc6('0x42')+_0x57ac6b[_0xbbc6('0x23')]+')','directioncode':_0x57ac6b[_0xbbc6('0x43')]===_0xbbc6('0x44')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0xbbc6('0x42')+_0x57ac6b['userId']+')','participationtypemask':_0x57ac6b[_0xbbc6('0x43')]===_0xbbc6('0x44')?0x2:0x1},{'partyid_contact@odata.bind':_0xbbc6('0x41')+_0x57ac6b[_0xbbc6('0x2f')]+')','participationtypemask':_0x57ac6b[_0xbbc6('0x43')]==='queue'?0x1:0x2}]},getCustomFields(_0x5b2d73[_0xbbc6('0x45')],_0x15c7ad,_0x5b2d73[_0xbbc6('0x39')])),'headers':{'Authorization':_0xbbc6('0x17')+_0xdae0ab,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x1f6e44);})[_0xbbc6('0x19')](function(_0x59c1d4){var _0x45bf4f=_0x59c1d4[_0xbbc6('0x46')][_0xbbc6('0x47')];var _0x3cb198=_0x45bf4f['substring'](_0x45bf4f[_0xbbc6('0x2a')]('(')+0x1,_0x45bf4f[_0xbbc6('0x2a')](')'));_0x57ac6b[_0xbbc6('0x48')]=_0x3cb198;_0x3ca075(_0x57ac6b);})[_0xbbc6('0x12')](function(_0x386d99){_0x542d72(_0x386d99[_0xbbc6('0x16')]);});});}function emit(_0xeba064,_0x8713a2,_0x59cd75,_0x1eb8ef){var _0x5bc949={'uri':util['format'](_0xbbc6('0x49'),_0xeba064,_0x59cd75,_0x1eb8ef)};io['to'](util['format'](_0xbbc6('0x4a'),_0x8713a2))[_0xbbc6('0x4b')](_0xbbc6('0x4c'),_0x5bc949);}exports['cs']=function(_0x5d9a64,_0xeb6610,_0x24d778,_0x31f941,_0x1fbd21,_0x41398f,_0x10323e,_0x1d4ec7){var _0x52298f={};_0x41398f[_0xbbc6('0xd')]=intUtil['stripTrailingSlash'](_0x41398f[_0xbbc6('0xd')]);_0x41398f[_0xbbc6('0x4d')]=intUtil[_0xbbc6('0x4e')](_0x41398f['serverUrl']);_0x52298f[_0xbbc6('0x43')]=_0x1d4ec7===_0xbbc6('0x44')||_0x1d4ec7===_0xbbc6('0x4f')?'queue':_0xbbc6('0x26');var _0x4420d3=util[_0xbbc6('0x50')](_0xbbc6('0x51'),_0x41398f[_0xbbc6('0xd')]);var _0x309db5=util['format'](_0xbbc6('0x52'),_0x41398f[_0xbbc6('0x53')]);var _0x3d617f=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x41398f[_0xbbc6('0x4d')],_0xeb6610['uniqueid'],md5(_0xeb6610[_0xbbc6('0x54')]));if(_0x1fbd21&&_0x1fbd21['monitor_format']){logger[_0xbbc6('0x20')](_0xbbc6('0x55'),'Recording\x20is\x20enabled!');_0xeb6610[_0xbbc6('0x56')]=_0x3d617f;}else if(_0x10323e&&_0x10323e[_0xbbc6('0x57')]&&_0x10323e[_0xbbc6('0x57')]!==_0xbbc6('0x58')){logger[_0xbbc6('0x20')]('[OUTBOUND]',_0xbbc6('0x59'));_0xeb6610[_0xbbc6('0x56')]=_0x3d617f;}else{_0xeb6610[_0xbbc6('0x56')]='';}return getUser(_0x52298f,_0x41398f,_0x31f941,_0x309db5,_0x4420d3,_0x1d4ec7)[_0xbbc6('0x19')](function(_0x377b53){logger[_0xbbc6('0x20')]('['+_0x1d4ec7['toUpperCase']()+_0xbbc6('0x5a'),_0x377b53[_0xbbc6('0x23')]);logger[_0xbbc6('0x20')]('['+_0x1d4ec7[_0xbbc6('0x14')]()+_0xbbc6('0x5b'),_0x377b53[_0xbbc6('0x1c')]);return getEndUser(_0x377b53,_0x41398f,_0x309db5,_0x4420d3,_0xeb6610,_0x1d4ec7);})[_0xbbc6('0x19')](function(_0x222ec4){logger[_0xbbc6('0x20')]('['+_0x1d4ec7[_0xbbc6('0x14')]()+_0xbbc6('0x5c'),_0x222ec4[_0xbbc6('0x2f')]);logger[_0xbbc6('0x20')]('['+_0x1d4ec7['toUpperCase']()+_0xbbc6('0x5d'),_0xeb6610[_0xbbc6('0x28')]);return getTicket(_0x222ec4,_0x41398f,_0x309db5,_0x4420d3,_0xeb6610,_0x24d778,_0x1d4ec7);})[_0xbbc6('0x19')](function(_0x13a39f){logger[_0xbbc6('0x20')](util[_0xbbc6('0x50')]('['+_0x1d4ec7['toUpperCase']()+_0xbbc6('0x5e'),_0x24d778[_0xbbc6('0x39')],_0x13a39f[_0xbbc6('0x48')]));logger[_0xbbc6('0x20')](util[_0xbbc6('0x50')]('['+_0x1d4ec7[_0xbbc6('0x14')]()+_0xbbc6('0x5f'),_0x1d4ec7));if(_0x1d4ec7!==_0xbbc6('0x4f')){logger['info']('['+_0x1d4ec7[_0xbbc6('0x14')]()+']',_0xbbc6('0x60'));emit(_0x41398f['remoteUri'],_0x31f941['name'],_0x24d778[_0xbbc6('0x39')],_0x13a39f[_0xbbc6('0x48')]);}})[_0xbbc6('0x12')](function(_0x43d5bc){logger[_0xbbc6('0x13')]('['+_0x1d4ec7[_0xbbc6('0x14')]()+_0xbbc6('0x61'),util['inspect'](_0x43d5bc,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xfff1=['idField','indexOf','content','ticketType','incident','incidents','assign','getString','Subjects','Descriptions','/contacts(','Fields','phonecall','phonecalls','callDirection','queue','odata-entityid','ticketId','format','emit','trigger:browser:url','stripTrailingSlash','serverUrl','abandoned','https://login.microsoftonline.com/%s/oauth2/token','tenantId','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\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','inspect','lodash','bluebird','util','./util','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','POST','clientId','remoteUri','username','password','then','access_token','catch','toUpperCase','message','GET','Bearer\x20','4.0','value','validateEmail','userEmail','email','internalemailaddress','isdisabled',']\x20Agent\x20found\x20','systemuserid','info',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','toLowerCase','destcalleridnum','calleridnum','contacts','/systemusers(','headers','substring','lastIndexOf','contacts?$select=telephone1','outbound','telephone1',']\x20Enduser\x20created!','enduserId',']\x20Enduser\x20Created!','length','forEach','type','string','customField'];(function(_0x486b00,_0x501df5){var _0x47ea82=function(_0x997782){while(--_0x997782){_0x486b00['push'](_0x486b00['shift']());}};_0x47ea82(++_0x501df5);}(_0xfff1,0xe9));var _0x1fff=function(_0x3934ee,_0xa692f){_0x3934ee=_0x3934ee-0x0;var _0x26179a=_0xfff1[_0x3934ee];return _0x26179a;};'use strict';var _=require(_0x1fff('0x0'));var BPromise=require(_0x1fff('0x1'));var rp=require('request-promise');var util=require(_0x1fff('0x2'));var intUtil=require(_0x1fff('0x3'));var md5=require('md5');var Redis=require(_0x1fff('0x4'));var logger=require(_0x1fff('0x5'))(_0x1fff('0x6'));var config=require(_0x1fff('0x7'));config[_0x1fff('0x8')]=_[_0x1fff('0x9')](config['redis'],{'host':_0x1fff('0xa'),'port':0x18eb});var io=require(_0x1fff('0xb'))(new Redis(config[_0x1fff('0x8')]));function getAuthToken(_0x29a960,_0x34f151,_0x1a44e3){var _0x28dc61={'method':_0x1fff('0xc'),'uri':_0x34f151,'form':{'client_id':_0x29a960[_0x1fff('0xd')],'resource':_0x29a960[_0x1fff('0xe')],'username':_0x29a960[_0x1fff('0xf')],'password':_0x29a960[_0x1fff('0x10')],'grant_type':_0x1fff('0x10'),'client_secret':_0x29a960['clientSecret']},'json':!![]};return rp(_0x28dc61)[_0x1fff('0x11')](function(_0xb8414b){return _0xb8414b[_0x1fff('0x12')];})[_0x1fff('0x13')](function(_0x350c1e){logger['error']('['+[_0x1a44e3[_0x1fff('0x14')]()]+']\x20Wrong\x20credentials!');return _0x350c1e[_0x1fff('0x15')];});}function getUser(_0x55d9c7,_0x12ee48,_0x2f17af,_0x5474f9,_0x28e915,_0x1bcea8){return new BPromise(function(_0x29a9d9,_0x5cf9e6){return getAuthToken(_0x12ee48,_0x5474f9,_0x1bcea8)[_0x1fff('0x11')](function(_0xec4e73){var _0x377bc1={'method':_0x1fff('0x16'),'uri':_0x28e915+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':_0x1fff('0x17')+_0xec4e73,'OData-Version':_0x1fff('0x18')},'json':!![]};return rp(_0x377bc1);})[_0x1fff('0x11')](function(_0xb38020){var _0x3f1ec4=_0xb38020[_0x1fff('0x19')];var _0x4dceec=![];var _0x55b193=null;if(!_['isNil'](_0x2f17af)){if(intUtil[_0x1fff('0x1a')](_0x2f17af['email'])){_0x55d9c7[_0x1fff('0x1b')]=_0x2f17af[_0x1fff('0x1c')];for(_0x55b193=0x0;_0x55b193<_0x3f1ec4['length'];_0x55b193++){if(_0x3f1ec4[_0x55b193][_0x1fff('0x1d')]===_0x2f17af[_0x1fff('0x1c')]&&!_0x3f1ec4[_0x55b193][_0x1fff('0x1e')]){_0x4dceec=!![];logger['info']('['+[_0x1bcea8[_0x1fff('0x14')]()]+_0x1fff('0x1f')+_0x3f1ec4[_0x55b193][_0x1fff('0x20')]+'!');_0x55d9c7['userId']=_0x3f1ec4[_0x55b193][_0x1fff('0x20')];}}}}if(!_0x4dceec){logger[_0x1fff('0x21')]('['+[_0x1bcea8[_0x1fff('0x14')]()]+_0x1fff('0x22'));_0x55d9c7['userEmail']=_0x12ee48[_0x1fff('0xf')];for(_0x55b193=0x0;_0x55b193<_0x3f1ec4['length'];_0x55b193++){if(_0x3f1ec4[_0x55b193][_0x1fff('0x1d')]===_0x12ee48[_0x1fff('0xf')]){_0x55d9c7[_0x1fff('0x23')]=_0x3f1ec4[_0x55b193][_0x1fff('0x20')];}}}_0x29a9d9(_0x55d9c7);})[_0x1fff('0x13')](function(_0x2f04b0){_0x5cf9e6(_0x2f04b0[_0x1fff('0x15')]);});});}function createEndUser(_0x32f373,_0xec7d36,_0x4040db,_0xf1c67,_0x5d14dd,_0x54f1b1){return new BPromise(function(_0x502b00,_0xdb66d5){return getAuthToken(_0xec7d36,_0x4040db,_0x54f1b1)['then'](function(_0x1cafa3){var _0xd9ef47=_0x54f1b1[_0x1fff('0x24')]()==='outbound'?_0x5d14dd[_0x1fff('0x25')]:_0x5d14dd[_0x1fff('0x26')];var _0x22ec85={'method':_0x1fff('0xc'),'uri':_0xf1c67+_0x1fff('0x27'),'body':{'telephone1':_0xd9ef47,'fullname':_0xd9ef47,'firstname':_0xd9ef47,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x1fff('0x28')+_0x32f373[_0x1fff('0x23')]+')'},'headers':{'Authorization':_0x1fff('0x17')+_0x1cafa3,'OData-Version':_0x1fff('0x18')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x22ec85);})[_0x1fff('0x11')](function(_0x2f01a9){var _0x5a6c6d=_0x2f01a9[_0x1fff('0x29')]['odata-entityid'];var _0x3ffef7=_0x5a6c6d[_0x1fff('0x2a')](_0x5a6c6d[_0x1fff('0x2b')]('(')+0x1,_0x5a6c6d[_0x1fff('0x2b')](')'));_0x32f373['enduserId']=_0x3ffef7;_0x502b00(_0x32f373);})[_0x1fff('0x13')](function(_0x5b6661){_0xdb66d5(_0x5b6661[_0x1fff('0x15')]);});});}function getEndUser(_0x590d1f,_0x1de9a1,_0x540f32,_0x5bae36,_0x4d9226,_0x3f31ff){return new BPromise(function(_0xb48b6c,_0x4bc6a5){return getAuthToken(_0x1de9a1,_0x540f32,_0x3f31ff)[_0x1fff('0x11')](function(_0x5975dc){var _0x520b8f={'method':'GET','uri':_0x5bae36+_0x1fff('0x2c'),'headers':{'Authorization':_0x1fff('0x17')+_0x5975dc,'If-None-Match':null,'OData-Version':_0x1fff('0x18')},'json':!![]};return rp(_0x520b8f);})[_0x1fff('0x11')](function(_0x5379f0){var _0x298a37=null;if(_0x5379f0){var _0xef989d=_0x5379f0[_0x1fff('0x19')];var _0x5009e4=![];for(_0x298a37=0x0;_0x298a37<_0xef989d['length'];_0x298a37++){var _0x20cb43=_0x3f31ff[_0x1fff('0x24')]()===_0x1fff('0x2d')?_0x4d9226['destcalleridnum']:_0x4d9226['calleridnum'];if(_0xef989d[_0x298a37][_0x1fff('0x2e')]===_0x20cb43){_0x5009e4=!![];_0x590d1f['enduserId']=_0xef989d[_0x298a37]['contactid'];}}if(_0x5009e4){_0xb48b6c(_0x590d1f);}else{return createEndUser(_0x590d1f,_0x1de9a1,_0x540f32,_0x5bae36,_0x4d9226,_0x3f31ff)[_0x1fff('0x11')](function(_0x1a08f1){logger[_0x1fff('0x21')]('['+[_0x3f31ff[_0x1fff('0x14')]()]+_0x1fff('0x2f'),_0x1a08f1[_0x1fff('0x30')]);_0xb48b6c(_0x1a08f1);});}}else{return createEndUser(_0x590d1f,_0x1de9a1,_0x540f32,_0x5bae36,_0x4d9226,_0x3f31ff)[_0x1fff('0x11')](function(_0x17e867){logger[_0x1fff('0x21')]('['+[_0x3f31ff[_0x1fff('0x14')]()]+_0x1fff('0x31'),_0x17e867[_0x1fff('0x30')]);_0xb48b6c(_0x17e867);});}});});}function getCustomFields(_0x31a072,_0x10311d,_0x566129){var _0x554c6f={};if(_0x31a072[_0x1fff('0x32')]>0x0){_[_0x1fff('0x33')](_0x31a072,function(_0x3ef984){if(_0x3ef984[_0x1fff('0x34')]===_0x1fff('0x35')&&_0x3ef984['nameField']&&!_0x3ef984[_0x1fff('0x36')]){var _0x4eec33=_0x3ef984[_0x1fff('0x37')]['toLowerCase']();var _0x216578=_0x4eec33['substring'](0x0,_0x4eec33[_0x1fff('0x38')]('_'));var _0x2fe641=_0x4eec33[_0x1fff('0x2a')](_0x4eec33['indexOf']('_')+0x1);if(_0x216578===_0x566129){_0x554c6f[_0x2fe641]=_0x3ef984[_0x1fff('0x39')];}}});}return _0x554c6f;}function getTicket(_0x5c58f0,_0x8b18c4,_0x36a339,_0x221725,_0x4bf7e8,_0x132142,_0x3e8234){return new BPromise(function(_0x47d0c8,_0x11cbe1){var _0x474746;return getAuthToken(_0x8b18c4,_0x36a339,_0x3e8234)[_0x1fff('0x11')](function(_0x3fa7a3){if(_0x132142[_0x1fff('0x3a')]===_0x1fff('0x3b')){_0x474746={'method':_0x1fff('0xc'),'uri':_0x221725+_0x1fff('0x3c'),'body':Object[_0x1fff('0x3d')]({},{'title':intUtil[_0x1fff('0x3e')](_0x132142[_0x1fff('0x3f')],_0x4bf7e8,'\x20'),'description':intUtil[_0x1fff('0x3e')](_0x132142[_0x1fff('0x40')],_0x4bf7e8,'\x0a'),'customerid_contact@odata.bind':_0x1fff('0x41')+_0x5c58f0['enduserId']+')','ownerid@odata.bind':'/systemusers('+_0x5c58f0['userId']+')','caseorigincode':'1'},getCustomFields(_0x132142[_0x1fff('0x42')],_0x4bf7e8,_0x132142[_0x1fff('0x3a')])),'headers':{'Authorization':_0x1fff('0x17')+_0x3fa7a3,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x132142[_0x1fff('0x3a')]===_0x1fff('0x43')){_0x474746={'method':'POST','uri':_0x221725+_0x1fff('0x44'),'body':Object[_0x1fff('0x3d')]({},{'subject':intUtil[_0x1fff('0x3e')](_0x132142[_0x1fff('0x3f')],_0x4bf7e8,'\x20'),'phonenumber':String(_0x4bf7e8[_0x1fff('0x26')]),'description':intUtil[_0x1fff('0x3e')](_0x132142[_0x1fff('0x40')],_0x4bf7e8,'\x0a'),'regardingobjectid_contact@odata.bind':'/contacts('+_0x5c58f0['enduserId']+')','ownerid@odata.bind':_0x1fff('0x28')+_0x5c58f0[_0x1fff('0x23')]+')','directioncode':_0x5c58f0['callDirection']==='queue'?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x1fff('0x28')+_0x5c58f0[_0x1fff('0x23')]+')','participationtypemask':_0x5c58f0[_0x1fff('0x45')]===_0x1fff('0x46')?0x2:0x1},{'partyid_contact@odata.bind':_0x1fff('0x41')+_0x5c58f0['enduserId']+')','participationtypemask':_0x5c58f0[_0x1fff('0x45')]===_0x1fff('0x46')?0x1:0x2}]},getCustomFields(_0x132142[_0x1fff('0x42')],_0x4bf7e8,_0x132142[_0x1fff('0x3a')])),'headers':{'Authorization':_0x1fff('0x17')+_0x3fa7a3,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x474746);})[_0x1fff('0x11')](function(_0x37c175){var _0x1137a3=_0x37c175[_0x1fff('0x29')][_0x1fff('0x47')];var _0x12192c=_0x1137a3[_0x1fff('0x2a')](_0x1137a3[_0x1fff('0x2b')]('(')+0x1,_0x1137a3[_0x1fff('0x2b')](')'));_0x5c58f0[_0x1fff('0x48')]=_0x12192c;_0x47d0c8(_0x5c58f0);})[_0x1fff('0x13')](function(_0x1c2267){_0x11cbe1(_0x1c2267[_0x1fff('0x15')]);});});}function emit(_0x2cd44f,_0x175259,_0x104e0f,_0x4e7a4b){var _0x5e2952={'uri':util['format']('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x2cd44f,_0x104e0f,_0x4e7a4b)};io['to'](util[_0x1fff('0x49')]('user:%s',_0x175259))[_0x1fff('0x4a')](_0x1fff('0x4b'),_0x5e2952);}exports['cs']=function(_0x460596,_0x3f92d6,_0x45024e,_0x448c5f,_0x346b52,_0x5bb80f,_0xd936c7,_0x23abe5){var _0x20276a={};_0x5bb80f[_0x1fff('0xe')]=intUtil[_0x1fff('0x4c')](_0x5bb80f['remoteUri']);_0x5bb80f[_0x1fff('0x4d')]=intUtil[_0x1fff('0x4c')](_0x5bb80f['serverUrl']);_0x20276a['callDirection']=_0x23abe5===_0x1fff('0x46')||_0x23abe5===_0x1fff('0x4e')?_0x1fff('0x46'):_0x1fff('0x2d');var _0x48f0e1=util[_0x1fff('0x49')]('%s/api/data/v9.0/',_0x5bb80f[_0x1fff('0xe')]);var _0x568900=util[_0x1fff('0x49')](_0x1fff('0x4f'),_0x5bb80f[_0x1fff('0x50')]);var _0x1cf74c=util[_0x1fff('0x49')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5bb80f['serverUrl'],_0x3f92d6['uniqueid'],md5(_0x3f92d6[_0x1fff('0x51')]));if(_0x346b52&&_0x346b52[_0x1fff('0x52')]){logger[_0x1fff('0x21')]('[QUEUE]',_0x1fff('0x53'));_0x3f92d6[_0x1fff('0x54')]=_0x1cf74c;}else if(_0xd936c7&&_0xd936c7[_0x1fff('0x55')]&&_0xd936c7[_0x1fff('0x55')]!==_0x1fff('0x56')){logger['info'](_0x1fff('0x57'),_0x1fff('0x53'));_0x3f92d6[_0x1fff('0x54')]=_0x1cf74c;}else{_0x3f92d6['recordingURL']='';}return getUser(_0x20276a,_0x5bb80f,_0x448c5f,_0x568900,_0x48f0e1,_0x23abe5)[_0x1fff('0x11')](function(_0x1514d2){logger['info']('['+_0x23abe5[_0x1fff('0x14')]()+_0x1fff('0x58'),_0x1514d2[_0x1fff('0x23')]);logger[_0x1fff('0x21')]('['+_0x23abe5[_0x1fff('0x14')]()+']\x20The\x20User\x20email\x20is:',_0x1514d2[_0x1fff('0x1b')]);return getEndUser(_0x1514d2,_0x5bb80f,_0x568900,_0x48f0e1,_0x3f92d6,_0x23abe5);})[_0x1fff('0x11')](function(_0x5256b7){logger[_0x1fff('0x21')]('['+_0x23abe5['toUpperCase']()+_0x1fff('0x59'),_0x5256b7['enduserId']);logger['info']('['+_0x23abe5[_0x1fff('0x14')]()+_0x1fff('0x5a'),_0x3f92d6[_0x1fff('0x26')]);return getTicket(_0x5256b7,_0x5bb80f,_0x568900,_0x48f0e1,_0x3f92d6,_0x45024e,_0x23abe5);})['then'](function(_0x50d917){logger[_0x1fff('0x21')](util[_0x1fff('0x49')]('['+_0x23abe5[_0x1fff('0x14')]()+_0x1fff('0x5b'),_0x45024e[_0x1fff('0x3a')],_0x50d917[_0x1fff('0x48')]));logger[_0x1fff('0x21')](util[_0x1fff('0x49')]('['+_0x23abe5['toUpperCase']()+_0x1fff('0x5c'),_0x23abe5));if(_0x23abe5!==_0x1fff('0x4e')){logger[_0x1fff('0x21')]('['+_0x23abe5['toUpperCase']()+']',_0x1fff('0x5d'));emit(_0x5bb80f[_0x1fff('0xe')],_0x448c5f[_0x1fff('0x5e')],_0x45024e['ticketType'],_0x50d917[_0x1fff('0x48')]);}})['catch'](function(_0x1b9569){logger['error']('['+_0x23abe5[_0x1fff('0x14')]()+']\x20Error\x20running\x20Dynamics365\x20integration',util[_0x1fff('0x5f')](_0x1b9569,{'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 b98ce20..7e7d4e2 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 _0x52ad=['Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','then','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','%s/api/v2/contacts','length','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','[HTTP]','GET','map','forEach','type','string','nameField','content','idField','push','variableName','customVariable','Variable','name','customField','toLowerCase','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','stringify','recordingFormat','none','[OUTBOUND]','Authorization','destcalleridname','destcalleridnum','abandoned','[ABANDONED]','Recording\x20is\x20enabled!','error','md5','util','./util','../../../../config/environment','../../../../config/logger','freshdesk','defaults','redis','localhost','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','format','Caller\x20-\x20%s','calleridnum','getString','Descriptions','Tags','Fields','keyBy','custom_fields','value','%s/api/v2/tickets','POST','Ticket\x20created!','validateEmail','%s/api/v2/agents','remoteUri','find','contact','email'];(function(_0x11d10f,_0x275d65){var _0x4f3a86=function(_0x32bc32){while(--_0x32bc32){_0x11d10f['push'](_0x11d10f['shift']());}};_0x4f3a86(++_0x275d65);}(_0x52ad,0xeb));var _0xd52a=function(_0x10a083,_0x5a4578){_0x10a083=_0x10a083-0x0;var _0x980a7=_0x52ad[_0x10a083];return _0x980a7;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0xd52a('0x0'));var util=require(_0xd52a('0x1'));var Redis=require('ioredis');var intUtil=require(_0xd52a('0x2'));var config=require(_0xd52a('0x3'));var logger=require(_0xd52a('0x4'))(_0xd52a('0x5'));config['redis']=_[_0xd52a('0x6')](config[_0xd52a('0x7')],{'host':_0xd52a('0x8'),'port':0x18eb});var io=require(_0xd52a('0x9'))(new Redis(config['redis']));var headers={'Content-Type':_0xd52a('0xa'),'Accept':_0xd52a('0xa')};function emit(_0x4f3433,_0x10ec86,_0x2f4791){io['to'](_0x4f3433)['emit'](_0x10ec86,_0x2f4791);}function getTicket(_0x15c415,_0x73f6ed,_0x4b2b6a,_0xcb6276,_0x3f23c9){logger[_0xd52a('0xb')](_0xd52a('0xc'));var _0x3aaa28=_['merge']({'responder_id':_0x73f6ed['id'],'requester_id':_0x4b2b6a['id'],'name':util[_0xd52a('0xd')](_0xd52a('0xe'),_0x3f23c9['calleridname']),'phone':_0x3f23c9[_0xd52a('0xf')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0xcb6276['Subjects'],_0x3f23c9,'\x20'),'description':intUtil[_0xd52a('0x10')](_0xcb6276[_0xd52a('0x11')],_0x3f23c9,'
'),'tags':getTags(_0xcb6276[_0xd52a('0x12')],'name')},getCustomFields(_0xcb6276[_0xd52a('0x13')],_0x3f23c9));_0x3aaa28['custom_fields']=_['mapValues'](_[_0xd52a('0x14')](_0x3aaa28[_0xd52a('0x15')],'id'),_0xd52a('0x16'));return request({'uri':util[_0xd52a('0xd')](_0xd52a('0x17'),_0x15c415['remoteUri']),'method':_0xd52a('0x18'),'body':_0x3aaa28})['then'](function(_0x22c196){logger[_0xd52a('0xb')](_0xd52a('0x19'));return _0x22c196;});}function getUser(_0x3b5ad3,_0x5acd52){if(intUtil[_0xd52a('0x1a')](_0x5acd52)){return request({'uri':util[_0xd52a('0xd')](_0xd52a('0x1b'),_0x3b5ad3[_0xd52a('0x1c')]),'qs':{'email':_0x5acd52}})['then'](function(_0x1316c5){if(_0x1316c5['length']){logger[_0xd52a('0xb')]('Agent\x20found!');return _[_0xd52a('0x1d')](_0x1316c5,function(_0x455f79){return _0x455f79[_0xd52a('0x1e')][_0xd52a('0x1f')]===_0x5acd52;});}else{logger[_0xd52a('0xb')](_0xd52a('0x20'));return request({'uri':util[_0xd52a('0xd')]('%s/api/v2/agents/me',_0x3b5ad3[_0xd52a('0x1c')])})[_0xd52a('0x21')](function(_0x411702){logger[_0xd52a('0xb')](_0xd52a('0x22'));return _0x411702;});}});}else{logger[_0xd52a('0xb')](_0xd52a('0x23'));return request({'uri':util[_0xd52a('0xd')](_0xd52a('0x24'),_0x3b5ad3['remoteUri'])})['then'](function(_0x27c865){logger[_0xd52a('0xb')](_0xd52a('0x22'));return _0x27c865;});}}function getEndUser(_0xad426a,_0x5878b4,_0x57d8c6){logger[_0xd52a('0xb')]('Searching\x20enduser\x20with\x20phone',_0x57d8c6);return request({'uri':util[_0xd52a('0xd')](_0xd52a('0x25'),_0xad426a[_0xd52a('0x1c')]),'qs':{'phone':_0x57d8c6}})[_0xd52a('0x21')](function(_0x1350f1){if(_0x1350f1[_0xd52a('0x26')]){logger[_0xd52a('0xb')](_0xd52a('0x27'));return _['find'](_0x1350f1,{'phone':_0x57d8c6});}else{logger[_0xd52a('0xb')](_0xd52a('0x28'));return request({'uri':util[_0xd52a('0xd')](_0xd52a('0x25'),_0xad426a[_0xd52a('0x1c')]),'method':_0xd52a('0x18'),'body':{'name':_0x5878b4,'phone':_0x57d8c6}})[_0xd52a('0x21')](function(_0x1c80ed){logger[_0xd52a('0xb')](_0xd52a('0x29'));return _0x1c80ed;});}});}function getAuth(_0x273559){return util[_0xd52a('0xd')](_0xd52a('0x2a'),new Buffer(_0x273559[_0xd52a('0x2b')]+':X')[_0xd52a('0x2c')](_0xd52a('0x2d')));}function request(_0x2a6614){logger['debug'](_0xd52a('0x2e'),JSON['stringify'](_0x2a6614));return rp(_[_0xd52a('0x6')](_0x2a6614,{'method':_0xd52a('0x2f'),'headers':headers,'json':!![]}));}function getTags(_0x16c573,_0x58cdf8){var _0x4cbdaa=[];if(_0x16c573&&_0x16c573[_0xd52a('0x26')]>0x0){_0x4cbdaa=_[_0xd52a('0x30')](_0x16c573,_0x58cdf8);}return _0x4cbdaa;}function getCustomFields(_0x2f8cb3,_0x5b4072){var _0x45076a=[];var _0x599d25={'custom_fields':[]};if(_0x2f8cb3[_0xd52a('0x26')]>0x0){_[_0xd52a('0x31')](_0x2f8cb3,function(_0x55e88f){if(_0x55e88f[_0xd52a('0x32')]===_0xd52a('0x33')&&_0x55e88f[_0xd52a('0x34')]&&!_0x55e88f['customField']){_0x599d25[_0x55e88f['nameField']['toLowerCase']()]=_0x55e88f[_0xd52a('0x35')]['toString']();}else if(_0x55e88f['type']==='string'&&_0x55e88f[_0xd52a('0x36')]&&_0x55e88f['customField']){_0x599d25[_0xd52a('0x15')][_0xd52a('0x37')]({'id':_0x55e88f[_0xd52a('0x36')],'value':_0x55e88f[_0xd52a('0x35')][_0xd52a('0x2c')]()});}else if(_0x55e88f[_0xd52a('0x32')]==='variable'&&_0x55e88f[_0xd52a('0x38')]&&_0x55e88f['idField']&&_0x55e88f['customField']){_0x5b4072[_0x55e88f[_0xd52a('0x38')]]&&_0x599d25[_0xd52a('0x15')]['push']({'id':_0x55e88f['idField'],'value':_0x5b4072[_0x55e88f[_0xd52a('0x38')]][_0xd52a('0x2c')]()});}else if(_0x55e88f[_0xd52a('0x32')]===_0xd52a('0x39')&&_0x55e88f[_0xd52a('0x3a')]&&_0x55e88f[_0xd52a('0x3a')][_0xd52a('0x3b')]&&_0x55e88f[_0xd52a('0x36')]&&_0x55e88f[_0xd52a('0x3c')]){_0x5b4072[_0x55e88f['Variable'][_0xd52a('0x3b')][_0xd52a('0x3d')]()]&&_0x599d25[_0xd52a('0x15')][_0xd52a('0x37')]({'id':_0x55e88f[_0xd52a('0x36')],'value':_0x5b4072[_0x55e88f['Variable'][_0xd52a('0x3b')][_0xd52a('0x3d')]()]['toString']()});}});}return _0x599d25;}exports[_0xd52a('0x3e')]=function(_0x5c4560,_0x596810,_0x75a69e,_0x135777,_0x5945b0,_0x20ae5f){var _0x37ee44,_0xa8004f;_0x20ae5f[_0xd52a('0x1c')]=intUtil[_0xd52a('0x3f')](_0x20ae5f[_0xd52a('0x1c')]);_0x20ae5f[_0xd52a('0x40')]=intUtil[_0xd52a('0x3f')](_0x20ae5f[_0xd52a('0x40')]);if(_0x5945b0&&_0x5945b0[_0xd52a('0x41')]){logger[_0xd52a('0xb')](_0xd52a('0x42'),'Recording\x20is\x20enabled!');_0x596810[_0xd52a('0x43')]=util[_0xd52a('0xd')](_0xd52a('0x44'),_0x20ae5f[_0xd52a('0x40')],_0x596810[_0xd52a('0x45')],md5(_0x596810['uniqueid']));}else{_0x596810['recordingURL']='';}headers['Authorization']=getAuth(_0x20ae5f);return getUser(_0x20ae5f,_0x135777[_0xd52a('0x1f')])['then'](function(_0xb613fc){_0x37ee44=_0xb613fc;logger['info'](_0xd52a('0x46'),_0x37ee44['id']);return getEndUser(_0x20ae5f,_0x596810[_0xd52a('0x47')],_0x596810['calleridnum']);})['then'](function(_0x44f489){_0xa8004f=_0x44f489;logger[_0xd52a('0xb')](_0xd52a('0x48'),_0xa8004f['id']);return getTicket(_0x20ae5f,_0x37ee44,_0xa8004f,_0x75a69e,_0x596810);})['then'](function(_0x2b947a){if(_0x2b947a&&_0x2b947a['id']){logger[_0xd52a('0xb')](_0xd52a('0x19'));logger[_0xd52a('0xb')](_0xd52a('0x49'),_0x2b947a['id']);logger[_0xd52a('0xb')](_0xd52a('0x42'),_0xd52a('0x4a'));emit(util[_0xd52a('0xd')](_0xd52a('0x4b'),_0x135777[_0xd52a('0x3b')]),_0xd52a('0x4c'),{'uri':util[_0xd52a('0xd')]('%s/helpdesk/tickets/%d',_0x20ae5f['remoteUri'],_0x2b947a['id'])});}})[_0xd52a('0x4d')](function(_0xdc2a56){logger['error'](_0xd52a('0x42'),JSON[_0xd52a('0x4e')](_0xdc2a56));});};exports['outbound']=function(_0x4b495b,_0x158600,_0x35a893,_0x81b8f9,_0x1986bc,_0x2b214b,_0x3a990f){var _0x46f514,_0x23ea2d;_0x2b214b[_0xd52a('0x1c')]=intUtil[_0xd52a('0x3f')](_0x2b214b['remoteUri']);_0x2b214b[_0xd52a('0x40')]=intUtil[_0xd52a('0x3f')](_0x2b214b['serverUrl']);if(_0x3a990f&&_0x3a990f[_0xd52a('0x4f')]&&_0x3a990f['recordingFormat']!==_0xd52a('0x50')){logger[_0xd52a('0xb')](_0xd52a('0x51'),'Recording\x20is\x20enabled!');_0x158600[_0xd52a('0x43')]=util[_0xd52a('0xd')](_0xd52a('0x44'),_0x2b214b['serverUrl'],_0x158600['uniqueid'],md5(_0x158600['uniqueid']));}headers[_0xd52a('0x52')]=getAuth(_0x2b214b);return getUser(_0x2b214b,_0x81b8f9[_0xd52a('0x1f')])[_0xd52a('0x21')](function(_0x55b7b4){_0x46f514=_0x55b7b4;logger[_0xd52a('0xb')]('The\x20User\x20ID\x20is:',_0x46f514['id']);return getEndUser(_0x2b214b,_0x158600[_0xd52a('0x53')],_0x158600[_0xd52a('0x54')]);})[_0xd52a('0x21')](function(_0x6a9995){_0x23ea2d=_0x6a9995;logger[_0xd52a('0xb')]('The\x20Enduser\x20ID\x20is:',_0x23ea2d['id']);return getTicket(_0x2b214b,_0x46f514,_0x23ea2d,_0x35a893,_0x158600);})[_0xd52a('0x21')](function(_0x5e9873){if(_0x5e9873&&_0x5e9873['id']){logger[_0xd52a('0xb')](_0xd52a('0x19'));logger[_0xd52a('0xb')](_0xd52a('0x49'),_0x5e9873['id']);logger[_0xd52a('0xb')]('[OUTBOUND]',_0xd52a('0x4a'));emit(util[_0xd52a('0xd')](_0xd52a('0x4b'),_0x81b8f9[_0xd52a('0x3b')]),'trigger:browser:url',{'uri':util[_0xd52a('0xd')]('%s/helpdesk/tickets/%d',_0x2b214b['remoteUri'],_0x5e9873['id'])});}})[_0xd52a('0x4d')](function(_0x46f08c){logger['error']('[OUTBOUND]',JSON[_0xd52a('0x4e')](_0x46f08c));});};exports[_0xd52a('0x55')]=function(_0x4db356,_0x5014d3,_0x319d97,_0x149f37,_0x200429,_0x4f7de4){var _0x1ba43d,_0x1e69d8;_0x4f7de4['remoteUri']=intUtil[_0xd52a('0x3f')](_0x4f7de4['remoteUri']);_0x4f7de4[_0xd52a('0x40')]=intUtil[_0xd52a('0x3f')](_0x4f7de4[_0xd52a('0x40')]);if(_0x200429&&_0x200429['monitor_format']){logger[_0xd52a('0xb')](_0xd52a('0x56'),_0xd52a('0x57'));_0x5014d3[_0xd52a('0x43')]=util[_0xd52a('0xd')](_0xd52a('0x44'),_0x4f7de4['serverUrl'],_0x5014d3[_0xd52a('0x45')],md5(_0x5014d3[_0xd52a('0x45')]));}else{_0x5014d3[_0xd52a('0x43')]='';}headers[_0xd52a('0x52')]=getAuth(_0x4f7de4);return getUser(_0x4f7de4,'')[_0xd52a('0x21')](function(_0x48e06e){_0x1ba43d=_0x48e06e;logger[_0xd52a('0xb')]('The\x20User\x20ID\x20is:',_0x1ba43d['id']);return getEndUser(_0x4f7de4,_0x5014d3[_0xd52a('0x47')],_0x5014d3['calleridnum']);})['then'](function(_0x5538f9){_0x1e69d8=_0x5538f9;logger[_0xd52a('0xb')]('The\x20Enduser\x20ID\x20is:',_0x1e69d8['id']);return getTicket(_0x4f7de4,_0x1ba43d,_0x1e69d8,_0x319d97,_0x5014d3);})[_0xd52a('0x21')](function(_0x3c1964){if(_0x3c1964){logger[_0xd52a('0xb')](_0xd52a('0x19'));logger[_0xd52a('0xb')](_0xd52a('0x49'),_0x3c1964['id']);}})['catch'](function(_0x22a680){logger[_0xd52a('0x58')](_0xd52a('0x56'),JSON[_0xd52a('0x4e')](_0x22a680));});}; \ No newline at end of file +var _0xf2b7=['%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','user:%s','trigger:browser:url','catch','error','recordingFormat','[OUTBOUND]','Authorization','destcalleridname','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','%s/helpdesk/tickets/%d','abandoned','[ABANDONED]','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','merge','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','Descriptions','
','name','custom_fields','mapValues','keyBy','value','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','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','debug','[HTTP]','stringify','GET','forEach','string','nameField','customField','toLowerCase','content','idField','type','variableName','push','customVariable','Variable','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL'];(function(_0x6cb9a5,_0x517979){var _0x2d5ffb=function(_0x1eb8fe){while(--_0x1eb8fe){_0x6cb9a5['push'](_0x6cb9a5['shift']());}};_0x2d5ffb(++_0x517979);}(_0xf2b7,0x1d8));var _0x7f2b=function(_0x43f3ef,_0x5d975d){_0x43f3ef=_0x43f3ef-0x0;var _0x1c021f=_0xf2b7[_0x43f3ef];return _0x1c021f;};'use strict';var _=require(_0x7f2b('0x0'));var rp=require(_0x7f2b('0x1'));var md5=require(_0x7f2b('0x2'));var util=require(_0x7f2b('0x3'));var Redis=require(_0x7f2b('0x4'));var intUtil=require(_0x7f2b('0x5'));var config=require(_0x7f2b('0x6'));var logger=require(_0x7f2b('0x7'))(_0x7f2b('0x8'));config[_0x7f2b('0x9')]=_[_0x7f2b('0xa')](config[_0x7f2b('0x9')],{'host':_0x7f2b('0xb'),'port':0x18eb});var io=require(_0x7f2b('0xc'))(new Redis(config[_0x7f2b('0x9')]));var headers={'Content-Type':_0x7f2b('0xd'),'Accept':_0x7f2b('0xd')};function emit(_0x4bfc60,_0x1f589e,_0x5be21e){io['to'](_0x4bfc60)['emit'](_0x1f589e,_0x5be21e);}function getTicket(_0x192ad8,_0x475477,_0x325dbd,_0x9a945e,_0x2bca30){logger[_0x7f2b('0xe')](_0x7f2b('0xf'));var _0x251a59=_[_0x7f2b('0x10')]({'responder_id':_0x475477['id'],'requester_id':_0x325dbd['id'],'name':util['format'](_0x7f2b('0x11'),_0x2bca30[_0x7f2b('0x12')]),'phone':_0x2bca30[_0x7f2b('0x13')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x7f2b('0x14')](_0x9a945e[_0x7f2b('0x15')],_0x2bca30,'\x20'),'description':intUtil[_0x7f2b('0x14')](_0x9a945e[_0x7f2b('0x16')],_0x2bca30,_0x7f2b('0x17')),'tags':getTags(_0x9a945e['Tags'],_0x7f2b('0x18'))},getCustomFields(_0x9a945e['Fields'],_0x2bca30));_0x251a59[_0x7f2b('0x19')]=_[_0x7f2b('0x1a')](_[_0x7f2b('0x1b')](_0x251a59[_0x7f2b('0x19')],'id'),_0x7f2b('0x1c'));return request({'uri':util['format']('%s/api/v2/tickets',_0x192ad8[_0x7f2b('0x1d')]),'method':_0x7f2b('0x1e'),'body':_0x251a59})[_0x7f2b('0x1f')](function(_0x152000){logger[_0x7f2b('0xe')](_0x7f2b('0x20'));return _0x152000;});}function getUser(_0x1379cc,_0x4d9e05){if(intUtil['validateEmail'](_0x4d9e05)){return request({'uri':util[_0x7f2b('0x21')](_0x7f2b('0x22'),_0x1379cc['remoteUri']),'qs':{'email':_0x4d9e05}})[_0x7f2b('0x1f')](function(_0x33b59f){if(_0x33b59f[_0x7f2b('0x23')]){logger['info']('Agent\x20found!');return _[_0x7f2b('0x24')](_0x33b59f,function(_0x484886){return _0x484886[_0x7f2b('0x25')][_0x7f2b('0x26')]===_0x4d9e05;});}else{logger[_0x7f2b('0xe')](_0x7f2b('0x27'));return request({'uri':util[_0x7f2b('0x21')](_0x7f2b('0x28'),_0x1379cc[_0x7f2b('0x1d')])})['then'](function(_0x32fc74){logger[_0x7f2b('0xe')](_0x7f2b('0x29'));return _0x32fc74;});}});}else{logger[_0x7f2b('0xe')](_0x7f2b('0x2a'));return request({'uri':util[_0x7f2b('0x21')](_0x7f2b('0x28'),_0x1379cc['remoteUri'])})[_0x7f2b('0x1f')](function(_0x24950a){logger['info'](_0x7f2b('0x29'));return _0x24950a;});}}function getEndUser(_0x4ab08e,_0x335b11,_0x10954c){logger['info'](_0x7f2b('0x2b'),_0x10954c);return request({'uri':util[_0x7f2b('0x21')](_0x7f2b('0x2c'),_0x4ab08e[_0x7f2b('0x1d')]),'qs':{'phone':_0x10954c}})['then'](function(_0x14b00b){if(_0x14b00b[_0x7f2b('0x23')]){logger['info'](_0x7f2b('0x2d'));return _[_0x7f2b('0x24')](_0x14b00b,{'phone':_0x10954c});}else{logger[_0x7f2b('0xe')](_0x7f2b('0x2e'));return request({'uri':util[_0x7f2b('0x21')](_0x7f2b('0x2c'),_0x4ab08e[_0x7f2b('0x1d')]),'method':_0x7f2b('0x1e'),'body':{'name':_0x335b11,'phone':_0x10954c}})[_0x7f2b('0x1f')](function(_0x2293a9){logger[_0x7f2b('0xe')](_0x7f2b('0x2f'));return _0x2293a9;});}});}function getAuth(_0x380a85){return util[_0x7f2b('0x21')](_0x7f2b('0x30'),new Buffer(_0x380a85[_0x7f2b('0x31')]+':X')[_0x7f2b('0x32')](_0x7f2b('0x33')));}function request(_0x4a4c5a){logger[_0x7f2b('0x34')](_0x7f2b('0x35'),JSON[_0x7f2b('0x36')](_0x4a4c5a));return rp(_[_0x7f2b('0xa')](_0x4a4c5a,{'method':_0x7f2b('0x37'),'headers':headers,'json':!![]}));}function getTags(_0x6fef8,_0x4853a1){var _0x57c2b9=[];if(_0x6fef8&&_0x6fef8[_0x7f2b('0x23')]>0x0){_0x57c2b9=_['map'](_0x6fef8,_0x4853a1);}return _0x57c2b9;}function getCustomFields(_0x576f5e,_0x455356){var _0xd53ad9=[];var _0x2db8d2={'custom_fields':[]};if(_0x576f5e['length']>0x0){_[_0x7f2b('0x38')](_0x576f5e,function(_0x3a8912){if(_0x3a8912['type']===_0x7f2b('0x39')&&_0x3a8912[_0x7f2b('0x3a')]&&!_0x3a8912[_0x7f2b('0x3b')]){_0x2db8d2[_0x3a8912[_0x7f2b('0x3a')][_0x7f2b('0x3c')]()]=_0x3a8912[_0x7f2b('0x3d')][_0x7f2b('0x32')]();}else if(_0x3a8912['type']===_0x7f2b('0x39')&&_0x3a8912[_0x7f2b('0x3e')]&&_0x3a8912['customField']){_0x2db8d2[_0x7f2b('0x19')]['push']({'id':_0x3a8912['idField'],'value':_0x3a8912[_0x7f2b('0x3d')]['toString']()});}else if(_0x3a8912[_0x7f2b('0x3f')]==='variable'&&_0x3a8912[_0x7f2b('0x40')]&&_0x3a8912[_0x7f2b('0x3e')]&&_0x3a8912[_0x7f2b('0x3b')]){_0x455356[_0x3a8912['variableName']]&&_0x2db8d2[_0x7f2b('0x19')][_0x7f2b('0x41')]({'id':_0x3a8912['idField'],'value':_0x455356[_0x3a8912['variableName']]['toString']()});}else if(_0x3a8912[_0x7f2b('0x3f')]===_0x7f2b('0x42')&&_0x3a8912['Variable']&&_0x3a8912[_0x7f2b('0x43')][_0x7f2b('0x18')]&&_0x3a8912[_0x7f2b('0x3e')]&&_0x3a8912[_0x7f2b('0x3b')]){_0x455356[_0x3a8912[_0x7f2b('0x43')][_0x7f2b('0x18')]['toLowerCase']()]&&_0x2db8d2['custom_fields'][_0x7f2b('0x41')]({'id':_0x3a8912['idField'],'value':_0x455356[_0x3a8912[_0x7f2b('0x43')]['name']['toLowerCase']()][_0x7f2b('0x32')]()});}});}return _0x2db8d2;}exports['queue']=function(_0x3b13c3,_0x2d3d2c,_0x3098a4,_0x1b1456,_0x41b555,_0x2cf448){var _0x4879b9,_0x584f9d;_0x2cf448['remoteUri']=intUtil['stripTrailingSlash'](_0x2cf448[_0x7f2b('0x1d')]);_0x2cf448[_0x7f2b('0x44')]=intUtil[_0x7f2b('0x45')](_0x2cf448['serverUrl']);if(_0x41b555&&_0x41b555[_0x7f2b('0x46')]){logger[_0x7f2b('0xe')](_0x7f2b('0x47'),_0x7f2b('0x48'));_0x2d3d2c[_0x7f2b('0x49')]=util[_0x7f2b('0x21')](_0x7f2b('0x4a'),_0x2cf448['serverUrl'],_0x2d3d2c[_0x7f2b('0x4b')],md5(_0x2d3d2c['uniqueid']));}else{_0x2d3d2c[_0x7f2b('0x49')]='';}headers['Authorization']=getAuth(_0x2cf448);return getUser(_0x2cf448,_0x1b1456[_0x7f2b('0x26')])[_0x7f2b('0x1f')](function(_0x5e7543){_0x4879b9=_0x5e7543;logger['info'](_0x7f2b('0x4c'),_0x4879b9['id']);return getEndUser(_0x2cf448,_0x2d3d2c[_0x7f2b('0x12')],_0x2d3d2c[_0x7f2b('0x13')]);})['then'](function(_0x53601c){_0x584f9d=_0x53601c;logger[_0x7f2b('0xe')](_0x7f2b('0x4d'),_0x584f9d['id']);return getTicket(_0x2cf448,_0x4879b9,_0x584f9d,_0x3098a4,_0x2d3d2c);})[_0x7f2b('0x1f')](function(_0x1ce6d1){if(_0x1ce6d1&&_0x1ce6d1['id']){logger[_0x7f2b('0xe')](_0x7f2b('0x20'));logger['info'](_0x7f2b('0x4e'),_0x1ce6d1['id']);logger[_0x7f2b('0xe')](_0x7f2b('0x47'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x7f2b('0x21')](_0x7f2b('0x4f'),_0x1b1456[_0x7f2b('0x18')]),_0x7f2b('0x50'),{'uri':util[_0x7f2b('0x21')]('%s/helpdesk/tickets/%d',_0x2cf448['remoteUri'],_0x1ce6d1['id'])});}})[_0x7f2b('0x51')](function(_0x228f51){logger[_0x7f2b('0x52')](_0x7f2b('0x47'),JSON[_0x7f2b('0x36')](_0x228f51));});};exports['outbound']=function(_0xd1446f,_0x146886,_0x4bba69,_0x5f237a,_0x20a81a,_0x4be830,_0x40e7aa){var _0x400abd,_0x4c833a;_0x4be830[_0x7f2b('0x1d')]=intUtil[_0x7f2b('0x45')](_0x4be830[_0x7f2b('0x1d')]);_0x4be830[_0x7f2b('0x44')]=intUtil[_0x7f2b('0x45')](_0x4be830[_0x7f2b('0x44')]);if(_0x40e7aa&&_0x40e7aa[_0x7f2b('0x53')]&&_0x40e7aa['recordingFormat']!=='none'){logger[_0x7f2b('0xe')](_0x7f2b('0x54'),'Recording\x20is\x20enabled!');_0x146886[_0x7f2b('0x49')]=util[_0x7f2b('0x21')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4be830[_0x7f2b('0x44')],_0x146886[_0x7f2b('0x4b')],md5(_0x146886[_0x7f2b('0x4b')]));}headers[_0x7f2b('0x55')]=getAuth(_0x4be830);return getUser(_0x4be830,_0x5f237a['email'])[_0x7f2b('0x1f')](function(_0x360352){_0x400abd=_0x360352;logger[_0x7f2b('0xe')](_0x7f2b('0x4c'),_0x400abd['id']);return getEndUser(_0x4be830,_0x146886[_0x7f2b('0x56')],_0x146886['destcalleridnum']);})[_0x7f2b('0x1f')](function(_0x4289fb){_0x4c833a=_0x4289fb;logger[_0x7f2b('0xe')](_0x7f2b('0x4d'),_0x4c833a['id']);return getTicket(_0x4be830,_0x400abd,_0x4c833a,_0x4bba69,_0x146886);})[_0x7f2b('0x1f')](function(_0xa3c75c){if(_0xa3c75c&&_0xa3c75c['id']){logger[_0x7f2b('0xe')](_0x7f2b('0x20'));logger['info'](_0x7f2b('0x4e'),_0xa3c75c['id']);logger[_0x7f2b('0xe')](_0x7f2b('0x54'),_0x7f2b('0x57'));emit(util[_0x7f2b('0x21')](_0x7f2b('0x4f'),_0x5f237a[_0x7f2b('0x18')]),_0x7f2b('0x50'),{'uri':util[_0x7f2b('0x21')](_0x7f2b('0x58'),_0x4be830[_0x7f2b('0x1d')],_0xa3c75c['id'])});}})['catch'](function(_0x81b86d){logger[_0x7f2b('0x52')](_0x7f2b('0x54'),JSON[_0x7f2b('0x36')](_0x81b86d));});};exports[_0x7f2b('0x59')]=function(_0xd8ef56,_0x407f03,_0xa61727,_0x1e386c,_0x56f09c,_0x3c4729){var _0x4ef15e,_0x1c95bb;_0x3c4729[_0x7f2b('0x1d')]=intUtil[_0x7f2b('0x45')](_0x3c4729[_0x7f2b('0x1d')]);_0x3c4729[_0x7f2b('0x44')]=intUtil[_0x7f2b('0x45')](_0x3c4729[_0x7f2b('0x44')]);if(_0x56f09c&&_0x56f09c[_0x7f2b('0x46')]){logger[_0x7f2b('0xe')](_0x7f2b('0x5a'),_0x7f2b('0x48'));_0x407f03[_0x7f2b('0x49')]=util[_0x7f2b('0x21')](_0x7f2b('0x4a'),_0x3c4729[_0x7f2b('0x44')],_0x407f03[_0x7f2b('0x4b')],md5(_0x407f03[_0x7f2b('0x4b')]));}else{_0x407f03[_0x7f2b('0x49')]='';}headers[_0x7f2b('0x55')]=getAuth(_0x3c4729);return getUser(_0x3c4729,'')[_0x7f2b('0x1f')](function(_0x43df5f){_0x4ef15e=_0x43df5f;logger[_0x7f2b('0xe')](_0x7f2b('0x4c'),_0x4ef15e['id']);return getEndUser(_0x3c4729,_0x407f03[_0x7f2b('0x12')],_0x407f03[_0x7f2b('0x13')]);})[_0x7f2b('0x1f')](function(_0x339039){_0x1c95bb=_0x339039;logger[_0x7f2b('0xe')](_0x7f2b('0x4d'),_0x1c95bb['id']);return getTicket(_0x3c4729,_0x4ef15e,_0x1c95bb,_0xa61727,_0x407f03);})[_0x7f2b('0x1f')](function(_0x4100ef){if(_0x4100ef){logger[_0x7f2b('0xe')](_0x7f2b('0x20'));logger[_0x7f2b('0xe')](_0x7f2b('0x4e'),_0x4100ef['id']);}})[_0x7f2b('0x51')](function(_0x108e04){logger[_0x7f2b('0x52')](_0x7f2b('0x5a'),JSON[_0x7f2b('0x36')](_0x108e04));});}; \ 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 395b259..7707e6e 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 _0x04b5=['error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./desk','./vtiger','./servicenow','zendesk','sugarcrm','freshdesk','zoho','desk','vtiger','servicenow','dynamics365','exec','includes','data1','toLowerCase','data2','find','Configurations','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unknown\x20integration','../../../../config/logger'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0x04b5,0xbe));var _0x504b=function(_0x12b8e8,_0x10385f){_0x12b8e8=_0x12b8e8-0x0;var _0x35c736=_0x04b5[_0x12b8e8];return _0x35c736;};'use strict';var _=require(_0x504b('0x0'));var util=require(_0x504b('0x1'));var zendesk=require(_0x504b('0x2'));var salesforce=require(_0x504b('0x3'));var sugarcrm=require(_0x504b('0x4'));var freshdesk=require(_0x504b('0x5'));var zoho=require('./zoho');var desk=require(_0x504b('0x6'));var vtiger=require(_0x504b('0x7'));var servicenow=require(_0x504b('0x8'));var dynamics365=require('./dynamics365');var integrations=[_0x504b('0x9'),'salesforce',_0x504b('0xa'),_0x504b('0xb'),_0x504b('0xc'),_0x504b('0xd'),_0x504b('0xe'),_0x504b('0xf'),_0x504b('0x10')];exports[_0x504b('0x11')]=function(_0xd26308,_0x54728c,_0x23828b,_0x32927e,_0x2b47d5,_0x18c57f){if(_0x23828b){if(_[_0x504b('0x12')](integrations,_0xd26308[_0x504b('0x13')][_0x504b('0x14')]())){try{var _0x3202f3=null;var _0x204a1d='';var _0x58aabe=_0x23828b[_0xd26308[_0x504b('0x13')][_0x504b('0x14')]()];if(_0x58aabe){var _0x17959a=_0x58aabe[_0xd26308[_0x504b('0x15')]];if(_0x17959a){var _0x6ce9cc=_[_0x504b('0x16')](_0x17959a[_0x504b('0x17')],{'id':parseInt(_0xd26308[_0x504b('0x18')],0xa)});if(_0x6ce9cc){if(_0x32927e){if(_0x2b47d5&&_0x54728c[_0x504b('0x19')]){_0x204a1d=_0x504b('0x19');}else if(_0x54728c[_0x504b('0x1a')]){_0x204a1d=_0x504b('0x1b');}else{console[_0x504b('0x1c')](_0x504b('0x1d'),_0x54728c);}}else{_0x204a1d='abandoned';}switch(_0xd26308[_0x504b('0x13')][_0x504b('0x14')]()){case'zendesk':zendesk[_0x204a1d](_0xd26308,_0x54728c,_0x6ce9cc,_0x32927e,_0x2b47d5,_0x17959a,_0x18c57f);break;case'salesforce':salesforce[_0x204a1d](_0xd26308,_0x54728c,_0x6ce9cc,_0x32927e,_0x2b47d5,_0x17959a,_0x18c57f);break;case _0x504b('0xa'):sugarcrm[_0x204a1d](_0xd26308,_0x54728c,_0x6ce9cc,_0x32927e,_0x2b47d5,_0x17959a,_0x18c57f);break;case _0x504b('0xb'):freshdesk[_0x204a1d](_0xd26308,_0x54728c,_0x6ce9cc,_0x32927e,_0x2b47d5,_0x17959a,_0x18c57f);break;case _0x504b('0xc'):zoho[_0x204a1d](_0xd26308,_0x54728c,_0x6ce9cc,_0x32927e,_0x2b47d5,_0x17959a,_0x18c57f);break;case _0x504b('0xd'):desk[_0x204a1d](_0xd26308,_0x54728c,_0x6ce9cc,_0x32927e,_0x2b47d5,_0x17959a,_0x18c57f);break;case _0x504b('0xe'):vtiger[_0x204a1d](_0xd26308,_0x54728c,_0x6ce9cc,_0x32927e,_0x2b47d5,_0x17959a,_0x18c57f);break;case'servicenow':servicenow['cs'](_0xd26308,_0x54728c,_0x6ce9cc,_0x32927e,_0x2b47d5,_0x17959a,_0x18c57f,_0x204a1d);break;case'dynamics365':dynamics365['cs'](_0xd26308,_0x54728c,_0x6ce9cc,_0x32927e,_0x2b47d5,_0x17959a,_0x18c57f,_0x204a1d);break;default:console[_0x504b('0x1c')](_0x504b('0x1e'));}}else{_0x3202f3=require(_0x504b('0x1f'))(_0xd26308[_0x504b('0x13')][_0x504b('0x14')]());_0x3202f3[_0x504b('0x20')](_0x504b('0x21'),util[_0x504b('0x22')](_0x504b('0x23'),_0xd26308[_0x504b('0x13')][_0x504b('0x14')](),_0xd26308[_0x504b('0x18')]));}}else{_0x3202f3=require('../../../../config/logger')(_0xd26308[_0x504b('0x13')][_0x504b('0x14')]());_0x3202f3['error']('[EXEC]',util[_0x504b('0x22')](_0x504b('0x24'),_0xd26308['data1'][_0x504b('0x14')](),_0xd26308[_0x504b('0x15')]));}}else{}}catch(_0x2fe072){console[_0x504b('0x20')](_0x2fe072);}}}}; \ No newline at end of file +var _0x75e8=['format','data3','%s\x20account\x20#%s\x20not\x20found','lodash','./salesforce','./sugarcrm','./freshdesk','./desk','./vtiger','zendesk','sugarcrm','freshdesk','zoho','vtiger','servicenow','dynamics365','exec','data1','toLowerCase','find','Configurations','queue','routeId','EVENT\x20UNKNOWN','desk','unknown\x20integration','../../../../config/logger','error','[EXEC]'];(function(_0x1c79a7,_0x38220e){var _0x4de69f=function(_0x569582){while(--_0x569582){_0x1c79a7['push'](_0x1c79a7['shift']());}};_0x4de69f(++_0x38220e);}(_0x75e8,0x1b6));var _0x875e=function(_0x32dc80,_0x2d4b48){_0x32dc80=_0x32dc80-0x0;var _0x1665a4=_0x75e8[_0x32dc80];return _0x1665a4;};'use strict';var _=require(_0x875e('0x0'));var util=require('util');var zendesk=require('./zendesk');var salesforce=require(_0x875e('0x1'));var sugarcrm=require(_0x875e('0x2'));var freshdesk=require(_0x875e('0x3'));var zoho=require('./zoho');var desk=require(_0x875e('0x4'));var vtiger=require(_0x875e('0x5'));var servicenow=require('./servicenow');var dynamics365=require('./dynamics365');var integrations=[_0x875e('0x6'),'salesforce',_0x875e('0x7'),_0x875e('0x8'),_0x875e('0x9'),'desk',_0x875e('0xa'),_0x875e('0xb'),_0x875e('0xc')];exports[_0x875e('0xd')]=function(_0x5caae6,_0x4cadd5,_0x23ad8c,_0x208ece,_0x3e1888,_0x435c68){if(_0x23ad8c){if(_['includes'](integrations,_0x5caae6[_0x875e('0xe')][_0x875e('0xf')]())){try{var _0x1f1a65=null;var _0x1268f2='';var _0x36e82c=_0x23ad8c[_0x5caae6['data1'][_0x875e('0xf')]()];if(_0x36e82c){var _0x3ed6bf=_0x36e82c[_0x5caae6['data2']];if(_0x3ed6bf){var _0x2b3755=_[_0x875e('0x10')](_0x3ed6bf[_0x875e('0x11')],{'id':parseInt(_0x5caae6['data3'],0xa)});if(_0x2b3755){if(_0x208ece){if(_0x3e1888&&_0x4cadd5['queue']){_0x1268f2=_0x875e('0x12');}else if(_0x4cadd5[_0x875e('0x13')]){_0x1268f2='outbound';}else{console['log'](_0x875e('0x14'),_0x4cadd5);}}else{_0x1268f2='abandoned';}switch(_0x5caae6[_0x875e('0xe')]['toLowerCase']()){case _0x875e('0x6'):zendesk[_0x1268f2](_0x5caae6,_0x4cadd5,_0x2b3755,_0x208ece,_0x3e1888,_0x3ed6bf,_0x435c68);break;case'salesforce':salesforce[_0x1268f2](_0x5caae6,_0x4cadd5,_0x2b3755,_0x208ece,_0x3e1888,_0x3ed6bf,_0x435c68);break;case _0x875e('0x7'):sugarcrm[_0x1268f2](_0x5caae6,_0x4cadd5,_0x2b3755,_0x208ece,_0x3e1888,_0x3ed6bf,_0x435c68);break;case'freshdesk':freshdesk[_0x1268f2](_0x5caae6,_0x4cadd5,_0x2b3755,_0x208ece,_0x3e1888,_0x3ed6bf,_0x435c68);break;case'zoho':zoho[_0x1268f2](_0x5caae6,_0x4cadd5,_0x2b3755,_0x208ece,_0x3e1888,_0x3ed6bf,_0x435c68);break;case _0x875e('0x15'):desk[_0x1268f2](_0x5caae6,_0x4cadd5,_0x2b3755,_0x208ece,_0x3e1888,_0x3ed6bf,_0x435c68);break;case _0x875e('0xa'):vtiger[_0x1268f2](_0x5caae6,_0x4cadd5,_0x2b3755,_0x208ece,_0x3e1888,_0x3ed6bf,_0x435c68);break;case'servicenow':servicenow['cs'](_0x5caae6,_0x4cadd5,_0x2b3755,_0x208ece,_0x3e1888,_0x3ed6bf,_0x435c68,_0x1268f2);break;case _0x875e('0xc'):dynamics365['cs'](_0x5caae6,_0x4cadd5,_0x2b3755,_0x208ece,_0x3e1888,_0x3ed6bf,_0x435c68,_0x1268f2);break;default:console['log'](_0x875e('0x16'));}}else{_0x1f1a65=require(_0x875e('0x17'))(_0x5caae6['data1'][_0x875e('0xf')]());_0x1f1a65[_0x875e('0x18')](_0x875e('0x19'),util[_0x875e('0x1a')]('%s\x20configuration\x20#%s\x20not\x20found',_0x5caae6[_0x875e('0xe')]['toLowerCase'](),_0x5caae6[_0x875e('0x1b')]));}}else{_0x1f1a65=require(_0x875e('0x17'))(_0x5caae6['data1'][_0x875e('0xf')]());_0x1f1a65[_0x875e('0x18')](_0x875e('0x19'),util[_0x875e('0x1a')](_0x875e('0x1c'),_0x5caae6['data1'][_0x875e('0xf')](),_0x5caae6['data2']));}}else{}}catch(_0x2d2c70){console[_0x875e('0x18')](_0x2d2c70);}}}}; \ 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 f17aa99..6c98553 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 _0x543b=['ContactId','sobject','create','User','execute','then','Email','info','Agent\x20%s\x20found.','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','resolve','user_id','identity','display_name','moduleSearch','contact_lead','length','Lead','find','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','contact','Phone','Enduser\x20with\x20phone\x20%s\x20found.','','format','Caller\x20-\x20%s','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','lead','Company','No\x20Company','upperFirst','forEach','type','string','idField','content','toString','variableName','customVariable','Variable','name','toLowerCase','password','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.','serverUrl','remoteUri','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','calleridnum','queue','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','outbound','recordingFormat','none','[OUTBOUND]','email','destcalleridname','Fields','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','instanceUrl','Salesforce\x20account\x20type\x20not\x20recognized','stringify','abandoned','monitor_format','[ABANDONED]','[ABANDONED]\x20Ticket\x20%s\x20created.','catch','request-promise','jsforce','util','ioredis','./util','../../../../config/environment','salesforce','redis','localhost','socket.io-emitter','emit','ticketType','Task','utc','getString','Subjects','Descriptions','Case','assign'];(function(_0x10f9b9,_0x188dc5){var _0x39a9ca=function(_0x192a0c){while(--_0x192a0c){_0x10f9b9['push'](_0x10f9b9['shift']());}};_0x39a9ca(++_0x188dc5);}(_0x543b,0x12e));var _0xb543=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x543b[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var rp=require(_0xb543('0x0'));var moment=require('moment');var BPromise=require('bluebird');var md5=require('md5');var jsforce=require(_0xb543('0x1'));var util=require(_0xb543('0x2'));var Redis=require(_0xb543('0x3'));var intUtil=require(_0xb543('0x4'));var config=require(_0xb543('0x5'));var logger=require('../../../../config/logger')(_0xb543('0x6'));config['redis']=_['defaults'](config[_0xb543('0x7')],{'host':_0xb543('0x8'),'port':0x18eb});var io=require(_0xb543('0x9'))(new Redis(config[_0xb543('0x7')]));function emit(_0x3cfbc1,_0x237afe,_0x4ce9f6){io['to'](_0x3cfbc1)[_0xb543('0xa')](_0x237afe,_0x4ce9f6);}function getTicket(_0x2c332a,_0x2908bd,_0x538934,_0x1201df,_0x360209,_0x9acc0b,_0x4a234a,_0x340c54){var _0x3ed256={};if(_0x1201df[_0xb543('0xb')]===_0xb543('0xc')){_0x3ed256=Object['assign']({},{'OwnerId':_0x2908bd['id'],'ActivityDate':moment[_0xb543('0xd')](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil[_0xb543('0xe')](_0x1201df[_0xb543('0xf')],_0x360209,'\x20'),'Description':intUtil['getString'](_0x1201df[_0xb543('0x10')],_0x360209,'\x0a')},getCustomFields(_0x9acc0b,_0x360209));if(_0x538934){_0x3ed256['WhoId']=_0x538934['id'];}}else if(_0x1201df[_0xb543('0xb')]===_0xb543('0x11')){_0x3ed256=Object[_0xb543('0x12')]({},{'OwnerId':_0x2908bd['id'],'Subject':intUtil[_0xb543('0xe')](_0x1201df['Subjects'],_0x360209,'\x20'),'Description':intUtil[_0xb543('0xe')](_0x1201df[_0xb543('0x10')],_0x360209,'\x0a')},getCustomFields(_0x9acc0b,_0x360209));if(_0x538934){_0x3ed256[_0xb543('0x13')]=_0x538934['id'];}}return _0x4a234a[_0xb543('0x14')](_0x1201df[_0xb543('0xb')])[_0xb543('0x15')](_0x3ed256);}function getUser(_0x5f5d87,_0x276bcd,_0x54f5ac){if(!_['isNil'](_0x276bcd)&&intUtil['validateEmail'](_0x276bcd)){var _0x13e7a9={'Email':_0x276bcd};var _0x1a7161={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x54f5ac[_0xb543('0x14')](_0xb543('0x16'))['find'](_0x13e7a9,_0x1a7161)[_0xb543('0x17')]()[_0xb543('0x18')](function(_0x570b95){if(_0x570b95['length']){var _0x26364c=_['find'](_0x570b95,function(_0x1d31f6){return _0x1d31f6[_0xb543('0x19')]===_0x276bcd;});if(_0x26364c){logger[_0xb543('0x1a')](_0xb543('0x1b'),_0x276bcd);return BPromise['resolve']({'id':_0x26364c['Id'],'name':_0x26364c[_0xb543('0x1c')]});}}else{logger[_0xb543('0x1a')](_0xb543('0x1d'),_0x276bcd);return _0x54f5ac['identity']()[_0xb543('0x18')](function(_0x89a974){return BPromise[_0xb543('0x1e')]({'id':_0x89a974[_0xb543('0x1f')],'name':_0x89a974['display_name']});});}});}else{logger['info'](_0xb543('0x1d'),_0x276bcd);return _0x54f5ac[_0xb543('0x20')]()[_0xb543('0x18')](function(_0x2d4209){return BPromise[_0xb543('0x1e')]({'id':_0x2d4209[_0xb543('0x1f')],'name':_0x2d4209[_0xb543('0x21')]});});}}function getEndUser(_0x590358,_0x573837,_0x31d6d1,_0x47a993,_0xda2bec){var _0x1ec0db={'Phone':_0x47a993};var _0x284654={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xb543('0x1e')]()[_0xb543('0x18')](function(){if(_0x573837[_0xb543('0xb')]===_0xb543('0xc')){logger['info']('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x47a993,_0x573837[_0xb543('0x22')]);switch(_0x573837[_0xb543('0x22')]){case _0xb543('0x23'):return _0xda2bec['sobject']('Contact')['find'](_0x1ec0db,_0x284654)[_0xb543('0x17')]()[_0xb543('0x18')](function(_0x5d1a9a){if(_0x5d1a9a&&_0x5d1a9a[_0xb543('0x24')]){return _0x5d1a9a;}else{return _0xda2bec[_0xb543('0x14')](_0xb543('0x25'))[_0xb543('0x26')](_0x1ec0db,_0x284654);}});case'contact':return _0xda2bec[_0xb543('0x14')]('Contact')[_0xb543('0x26')](_0x1ec0db,_0x284654)[_0xb543('0x17')]();case'lead':return _0xda2bec[_0xb543('0x14')]('Lead')[_0xb543('0x26')](_0x1ec0db,_0x284654);default:return null;}}else if(_0x573837[_0xb543('0xb')]===_0xb543('0x11')){logger['info'](_0xb543('0x27'),_0x47a993,_0xb543('0x28'));return _0xda2bec[_0xb543('0x14')]('Contact')['find'](_0x1ec0db,_0x284654)[_0xb543('0x17')]();}})['then'](function(_0x208e0d){if(_0x208e0d&&_0x208e0d['length']){var _0x391911=_[_0xb543('0x26')](_0x208e0d,function(_0x554f6e){return _0x554f6e['Phone']===_0x47a993;});if(_0x391911){return BPromise[_0xb543('0x1e')]({'id':_0x391911['Id'],'name':_0x391911['Name'],'phone':_0x391911[_0xb543('0x29')]});}}})[_0xb543('0x18')](function(_0x29db47){if(_0x29db47){logger[_0xb543('0x1a')](_0xb543('0x2a'),_0x47a993);return BPromise[_0xb543('0x1e')](_0x29db47);}else{logger[_0xb543('0x1a')]('Enduser\x20with\x20phone\x20%s\x20not\x20found.',_0x47a993);var _0x351caa={'LastName':_0x31d6d1!==_0xb543('0x2b')?_0x31d6d1:util[_0xb543('0x2c')](_0xb543('0x2d'),_0x47a993),'Phone':_0x47a993};if(_0x573837[_0xb543('0x2e')]){if(_0x573837[_0xb543('0x2e')]===_0xb543('0x28')){logger[_0xb543('0x1a')](_0xb543('0x2f'),_0x47a993,_0x573837[_0xb543('0x2e')]);}else if(_0x573837[_0xb543('0x2e')]===_0xb543('0x30')&&_0x573837['ticketType']===_0xb543('0xc')){logger[_0xb543('0x1a')](_0xb543('0x2f'),_0x47a993,_0x573837[_0xb543('0x2e')]);_0x351caa[_0xb543('0x31')]=_0xb543('0x32');}else{return null;}}return _0xda2bec[_0xb543('0x14')](_[_0xb543('0x33')](_0x573837[_0xb543('0x2e')]))['create'](_0x351caa);}});}function getCustomFields(_0xeb2eae,_0x56f04e){var _0x517470={};if(_0xeb2eae[_0xb543('0x24')]>0x0){_[_0xb543('0x34')](_0xeb2eae,function(_0x2fbc7e){if(_0x2fbc7e[_0xb543('0x35')]===_0xb543('0x36')&&_0x2fbc7e[_0xb543('0x37')]){_0x517470[_0x2fbc7e[_0xb543('0x37')]]=_0x2fbc7e[_0xb543('0x38')][_0xb543('0x39')]();}else if(_0x2fbc7e['type']==='variable'&&_0x2fbc7e[_0xb543('0x3a')]&&_0x2fbc7e['idField']){_0x56f04e[_0x2fbc7e[_0xb543('0x3a')]]&&(_0x517470[_0x2fbc7e[_0xb543('0x37')]]=_0x56f04e[_0x2fbc7e[_0xb543('0x3a')]][_0xb543('0x39')]());}else if(_0x2fbc7e['type']===_0xb543('0x3b')&&_0x2fbc7e[_0xb543('0x3c')]&&_0x2fbc7e[_0xb543('0x3c')][_0xb543('0x3d')]&&_0x2fbc7e[_0xb543('0x37')]){_0x56f04e[_0x2fbc7e[_0xb543('0x3c')]['name'][_0xb543('0x3e')]()]&&(_0x517470[_0x2fbc7e[_0xb543('0x37')]]=_0x56f04e[_0x2fbc7e[_0xb543('0x3c')][_0xb543('0x3d')]['toLowerCase']()]['toString']());}});}return _0x517470;}function getConnection(_0x1be808){var _0x1f98eb=_0x1be808[_0xb543('0x3f')]['concat'](_0x1be808['securityToken']);var _0x3f89e2=new jsforce['Connection']({'oauth2':{'loginUrl':_0x1be808['remoteUri']||_0xb543('0x40'),'clientId':_0x1be808[_0xb543('0x41')],'clientSecret':_0x1be808[_0xb543('0x42')]}});return _0x3f89e2[_0xb543('0x43')](_0x1be808[_0xb543('0x44')],_0x1f98eb)['then'](function(){logger[_0xb543('0x1a')](_0xb543('0x45'));return _0x3f89e2;});}exports['queue']=function(_0x5ea2e6,_0x36f570,_0x235d01,_0x44d42e,_0x4bae8b,_0x47dfa6){var _0x2ab908,_0x1dbfbd,_0x3fc8fd,_0xb21a0f;_0x47dfa6[_0xb543('0x46')]=intUtil['stripTrailingSlash'](_0x47dfa6[_0xb543('0x46')]);_0x47dfa6[_0xb543('0x47')]=intUtil[_0xb543('0x48')](_0x47dfa6['remoteUri']);if(_0x4bae8b&&_0x4bae8b['monitor_format']){logger[_0xb543('0x1a')](_0xb543('0x49'),_0xb543('0x4a'));_0x36f570[_0xb543('0x4b')]=util['format'](_0xb543('0x4c'),_0x47dfa6[_0xb543('0x46')],_0x36f570[_0xb543('0x4d')],md5(_0x36f570[_0xb543('0x4d')]));}else{_0x36f570[_0xb543('0x4b')]='';}return getConnection(_0x47dfa6)[_0xb543('0x18')](function(_0x229010){_0xb21a0f=_0x229010;return getUser(_0x47dfa6,_0x44d42e['email'],_0xb21a0f);})[_0xb543('0x18')](function(_0x5231f1){_0x2ab908=_0x5231f1;return getEndUser(_0x47dfa6,_0x235d01,_0x36f570[_0xb543('0x4e')],_0x36f570[_0xb543('0x4f')],_0xb21a0f);})[_0xb543('0x18')](function(_0x174baa){_0x1dbfbd=_0x174baa;return getTicket(_0x47dfa6,_0x2ab908,_0x1dbfbd,_0x235d01,_0x36f570,_0x235d01['Fields'],_0xb21a0f,_0xb543('0x50'));})['then'](function(_0x1bbbda){_0x3fc8fd=_0x1bbbda;logger[_0xb543('0x1a')](_0xb543('0x51'),_0x3fc8fd['id']);logger[_0xb543('0x1a')](_0xb543('0x52'),_0x3fc8fd['id'],_0x44d42e['name'],_0x47dfa6[_0xb543('0x35')]);switch(_0x47dfa6[_0xb543('0x35')]){case'integrationTab':emit(util[_0xb543('0x2c')](_0xb543('0x53'),_0x44d42e['name']),_0xb543('0x54'),{'recordId':_0x3fc8fd['id']});break;case _0xb543('0x55'):emit(util[_0xb543('0x2c')](_0xb543('0x53'),_0x44d42e['name']),_0xb543('0x56'),{'uri':util[_0xb543('0x2c')](_0xb543('0x57'),_0xb21a0f['instanceUrl'],_0x3fc8fd['id'])});break;default:logger[_0xb543('0x58')](_0xb543('0x59'));}})['catch'](function(_0x2a034a){logger['error'](_0xb543('0x49'),JSON['stringify'](_0x2a034a));});};exports[_0xb543('0x5a')]=function(_0x3a31b5,_0x4ac761,_0x37c102,_0x3d98e7,_0x46f2d2,_0x1dc249,_0x5dbe33){var _0x5ce7bd,_0x557d6f,_0x3836c4,_0x360d3b;_0x1dc249[_0xb543('0x46')]=intUtil['stripTrailingSlash'](_0x1dc249[_0xb543('0x46')]);_0x1dc249[_0xb543('0x47')]=intUtil[_0xb543('0x48')](_0x1dc249[_0xb543('0x47')]);if(_0x5dbe33&&_0x5dbe33[_0xb543('0x5b')]&&_0x5dbe33[_0xb543('0x5b')]!==_0xb543('0x5c')){logger[_0xb543('0x1a')](_0xb543('0x5d'),'Recording\x20is\x20enabled!');_0x4ac761[_0xb543('0x4b')]=util[_0xb543('0x2c')](_0xb543('0x4c'),_0x1dc249[_0xb543('0x46')],_0x4ac761[_0xb543('0x4d')],md5(_0x4ac761[_0xb543('0x4d')]));}return getConnection(_0x1dc249)[_0xb543('0x18')](function(_0x4446a2){_0x360d3b=_0x4446a2;return getUser(_0x1dc249,_0x3d98e7[_0xb543('0x5e')],_0x360d3b);})[_0xb543('0x18')](function(_0x1107e9){_0x5ce7bd=_0x1107e9;return getEndUser(_0x1dc249,_0x37c102,_0x4ac761[_0xb543('0x5f')],_0x4ac761['destcalleridnum'],_0x360d3b);})[_0xb543('0x18')](function(_0x244bd0){_0x557d6f=_0x244bd0;return getTicket(_0x1dc249,_0x5ce7bd,_0x557d6f,_0x37c102,_0x4ac761,_0x37c102[_0xb543('0x60')],_0x360d3b,'outbound');})[_0xb543('0x18')](function(_0xcc606e){_0x3836c4=_0xcc606e;logger['info']('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x3836c4['id']);logger[_0xb543('0x1a')](_0xb543('0x61'),_0x3836c4['id'],_0x3d98e7['name'],_0x1dc249['type']);switch(_0x1dc249[_0xb543('0x35')]){case _0xb543('0x62'):emit(util[_0xb543('0x2c')](_0xb543('0x53'),_0x3d98e7[_0xb543('0x3d')]),'trigger:salesforce:display',{'recordId':_0x3836c4['id']});break;case _0xb543('0x55'):emit(util[_0xb543('0x2c')](_0xb543('0x53'),_0x3d98e7[_0xb543('0x3d')]),'trigger:browser:url',{'uri':util[_0xb543('0x2c')]('%s/%s/e',_0x360d3b[_0xb543('0x63')],_0x3836c4['id'])});break;default:logger['error'](_0xb543('0x5d'),_0xb543('0x64'));}})['catch'](function(_0x3b44ed){logger[_0xb543('0x58')](_0xb543('0x5d'),JSON[_0xb543('0x65')](_0x3b44ed));});};exports[_0xb543('0x66')]=function(_0x24fd64,_0x41ec59,_0xd60142,_0x500876,_0x13438f,_0x16e3a7){var _0x2e9fc5,_0x5d7cfa,_0x3e7801,_0x31ba01;_0x16e3a7[_0xb543('0x46')]=intUtil[_0xb543('0x48')](_0x16e3a7[_0xb543('0x46')]);_0x16e3a7[_0xb543('0x47')]=intUtil[_0xb543('0x48')](_0x16e3a7['remoteUri']);if(_0x13438f&&_0x13438f[_0xb543('0x67')]){logger[_0xb543('0x1a')](_0xb543('0x68'),'Recording\x20is\x20enabled!');_0x41ec59['recordingURL']=util[_0xb543('0x2c')](_0xb543('0x4c'),_0x16e3a7[_0xb543('0x46')],_0x41ec59[_0xb543('0x4d')],md5(_0x41ec59[_0xb543('0x4d')]));}else{_0x41ec59['recordingURL']='';}return getConnection(_0x16e3a7)[_0xb543('0x18')](function(_0x57ab60){_0x31ba01=_0x57ab60;if(!_['isNil'](_0x500876)){return getUser(_0x16e3a7,_0x500876[_0xb543('0x3d')],_0x31ba01);}else{return getUser(_0x16e3a7,null,_0x31ba01);}})[_0xb543('0x18')](function(_0x2e5e8f){_0x2e9fc5=_0x2e5e8f;return getEndUser(_0x16e3a7,_0xd60142,_0x41ec59[_0xb543('0x4e')],_0x41ec59[_0xb543('0x4f')],_0x31ba01);})['then'](function(_0x1c488e){_0x5d7cfa=_0x1c488e;return getTicket(_0x16e3a7,_0x2e9fc5,_0x5d7cfa,_0xd60142,_0x41ec59,_0xd60142['Fields'],_0x31ba01);})[_0xb543('0x18')](function(_0x230edf){_0x3e7801=_0x230edf;logger[_0xb543('0x1a')](_0xb543('0x69'),_0x3e7801['id']);logger[_0xb543('0x1a')]('[ABANDONED]\x20Integration\x20account\x20type\x20%s.',_0x16e3a7['type']);})[_0xb543('0x6a')](function(_0x3655e5){logger[_0xb543('0x58')]('[ABANDONED]',JSON[_0xb543('0x65')](_0x3655e5));});}; \ No newline at end of file +var _0xa639=['Task','assign','utc','getString','Subjects','WhoId','Descriptions','ContactId','isNil','validateEmail','sobject','find','then','length','Email','info','Agent\x20%s\x20found.','resolve','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','Contact','execute','Lead','contact','Case','Phone','Name','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.','lead','Company','No\x20Company','upperFirst','type','string','idField','content','toString','variable','variableName','customVariable','name','Variable','toLowerCase','password','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientSecret','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','user:%s','trigger:browser:url','%s/%s/e','instanceUrl','error','catch','[QUEUE]','stringify','outbound','recordingFormat','none','destcalleridnum','trigger:salesforce:display','Salesforce\x20account\x20type\x20not\x20recognized','[ABANDONED]','calleridnum','[ABANDONED]\x20Ticket\x20%s\x20created.','[ABANDONED]\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','jsforce','./util','../../../../config/logger','salesforce','redis','defaults','localhost','socket.io-emitter','emit','ticketType'];(function(_0x4be6f4,_0x385b23){var _0x3e9098=function(_0x17ff9a){while(--_0x17ff9a){_0x4be6f4['push'](_0x4be6f4['shift']());}};_0x3e9098(++_0x385b23);}(_0xa639,0x12d));var _0x9a63=function(_0x11249d,_0xf63215){_0x11249d=_0x11249d-0x0;var _0x5cdc5a=_0xa639[_0x11249d];return _0x5cdc5a;};'use strict';var _=require(_0x9a63('0x0'));var rp=require(_0x9a63('0x1'));var moment=require(_0x9a63('0x2'));var BPromise=require(_0x9a63('0x3'));var md5=require('md5');var jsforce=require(_0x9a63('0x4'));var util=require('util');var Redis=require('ioredis');var intUtil=require(_0x9a63('0x5'));var config=require('../../../../config/environment');var logger=require(_0x9a63('0x6'))(_0x9a63('0x7'));config[_0x9a63('0x8')]=_[_0x9a63('0x9')](config[_0x9a63('0x8')],{'host':_0x9a63('0xa'),'port':0x18eb});var io=require(_0x9a63('0xb'))(new Redis(config[_0x9a63('0x8')]));function emit(_0x272494,_0xf5aeac,_0x15215f){io['to'](_0x272494)[_0x9a63('0xc')](_0xf5aeac,_0x15215f);}function getTicket(_0x3d5483,_0x13e4de,_0x2296db,_0xc51b2d,_0x1af19c,_0x25bce9,_0x1f42ec,_0x492d6e){var _0x370c62={};if(_0xc51b2d[_0x9a63('0xd')]===_0x9a63('0xe')){_0x370c62=Object[_0x9a63('0xf')]({},{'OwnerId':_0x13e4de['id'],'ActivityDate':moment[_0x9a63('0x10')](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil[_0x9a63('0x11')](_0xc51b2d[_0x9a63('0x12')],_0x1af19c,'\x20'),'Description':intUtil[_0x9a63('0x11')](_0xc51b2d['Descriptions'],_0x1af19c,'\x0a')},getCustomFields(_0x25bce9,_0x1af19c));if(_0x2296db){_0x370c62[_0x9a63('0x13')]=_0x2296db['id'];}}else if(_0xc51b2d[_0x9a63('0xd')]==='Case'){_0x370c62=Object[_0x9a63('0xf')]({},{'OwnerId':_0x13e4de['id'],'Subject':intUtil['getString'](_0xc51b2d[_0x9a63('0x12')],_0x1af19c,'\x20'),'Description':intUtil['getString'](_0xc51b2d[_0x9a63('0x14')],_0x1af19c,'\x0a')},getCustomFields(_0x25bce9,_0x1af19c));if(_0x2296db){_0x370c62[_0x9a63('0x15')]=_0x2296db['id'];}}return _0x1f42ec['sobject'](_0xc51b2d[_0x9a63('0xd')])['create'](_0x370c62);}function getUser(_0x95587f,_0x38291d,_0x428e83){if(!_[_0x9a63('0x16')](_0x38291d)&&intUtil[_0x9a63('0x17')](_0x38291d)){var _0x170130={'Email':_0x38291d};var _0x521172={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x428e83[_0x9a63('0x18')]('User')[_0x9a63('0x19')](_0x170130,_0x521172)['execute']()[_0x9a63('0x1a')](function(_0x24402f){if(_0x24402f[_0x9a63('0x1b')]){var _0x494f5b=_[_0x9a63('0x19')](_0x24402f,function(_0x13a138){return _0x13a138[_0x9a63('0x1c')]===_0x38291d;});if(_0x494f5b){logger[_0x9a63('0x1d')](_0x9a63('0x1e'),_0x38291d);return BPromise[_0x9a63('0x1f')]({'id':_0x494f5b['Id'],'name':_0x494f5b['Name']});}}else{logger[_0x9a63('0x1d')](_0x9a63('0x20'),_0x38291d);return _0x428e83[_0x9a63('0x21')]()[_0x9a63('0x1a')](function(_0x629842){return BPromise[_0x9a63('0x1f')]({'id':_0x629842['user_id'],'name':_0x629842[_0x9a63('0x22')]});});}});}else{logger['info'](_0x9a63('0x20'),_0x38291d);return _0x428e83[_0x9a63('0x21')]()[_0x9a63('0x1a')](function(_0x4da3fe){return BPromise['resolve']({'id':_0x4da3fe['user_id'],'name':_0x4da3fe['display_name']});});}}function getEndUser(_0x5ccdfc,_0x1ab232,_0x31ba72,_0x4635da,_0x3c6d97){var _0x4ee913={'Phone':_0x4635da};var _0x4e205e={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0x9a63('0x1a')](function(){if(_0x1ab232['ticketType']===_0x9a63('0xe')){logger[_0x9a63('0x1d')](_0x9a63('0x23'),_0x4635da,_0x1ab232['moduleSearch']);switch(_0x1ab232[_0x9a63('0x24')]){case _0x9a63('0x25'):return _0x3c6d97[_0x9a63('0x18')](_0x9a63('0x26'))[_0x9a63('0x19')](_0x4ee913,_0x4e205e)[_0x9a63('0x27')]()[_0x9a63('0x1a')](function(_0x3f4ce5){if(_0x3f4ce5&&_0x3f4ce5['length']){return _0x3f4ce5;}else{return _0x3c6d97[_0x9a63('0x18')](_0x9a63('0x28'))['find'](_0x4ee913,_0x4e205e);}});case _0x9a63('0x29'):return _0x3c6d97['sobject']('Contact')[_0x9a63('0x19')](_0x4ee913,_0x4e205e)[_0x9a63('0x27')]();case'lead':return _0x3c6d97[_0x9a63('0x18')](_0x9a63('0x28'))[_0x9a63('0x19')](_0x4ee913,_0x4e205e);default:return null;}}else if(_0x1ab232['ticketType']===_0x9a63('0x2a')){logger[_0x9a63('0x1d')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x4635da,_0x9a63('0x29'));return _0x3c6d97['sobject']('Contact')[_0x9a63('0x19')](_0x4ee913,_0x4e205e)[_0x9a63('0x27')]();}})[_0x9a63('0x1a')](function(_0x2a77de){if(_0x2a77de&&_0x2a77de[_0x9a63('0x1b')]){var _0x58e22d=_[_0x9a63('0x19')](_0x2a77de,function(_0x37c183){return _0x37c183[_0x9a63('0x2b')]===_0x4635da;});if(_0x58e22d){return BPromise['resolve']({'id':_0x58e22d['Id'],'name':_0x58e22d[_0x9a63('0x2c')],'phone':_0x58e22d['Phone']});}}})[_0x9a63('0x1a')](function(_0x5cb6fd){if(_0x5cb6fd){logger['info'](_0x9a63('0x2d'),_0x4635da);return BPromise['resolve'](_0x5cb6fd);}else{logger[_0x9a63('0x1d')](_0x9a63('0x2e'),_0x4635da);var _0x2ca25c={'LastName':_0x31ba72!==_0x9a63('0x2f')?_0x31ba72:util[_0x9a63('0x30')]('Caller\x20-\x20%s',_0x4635da),'Phone':_0x4635da};if(_0x1ab232['moduleCreate']){if(_0x1ab232[_0x9a63('0x31')]===_0x9a63('0x29')){logger[_0x9a63('0x1d')](_0x9a63('0x32'),_0x4635da,_0x1ab232['moduleCreate']);}else if(_0x1ab232[_0x9a63('0x31')]===_0x9a63('0x33')&&_0x1ab232[_0x9a63('0xd')]==='Task'){logger[_0x9a63('0x1d')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x4635da,_0x1ab232[_0x9a63('0x31')]);_0x2ca25c[_0x9a63('0x34')]=_0x9a63('0x35');}else{return null;}}return _0x3c6d97[_0x9a63('0x18')](_[_0x9a63('0x36')](_0x1ab232[_0x9a63('0x31')]))['create'](_0x2ca25c);}});}function getCustomFields(_0x190a11,_0x465638){var _0x1ac60c={};if(_0x190a11['length']>0x0){_['forEach'](_0x190a11,function(_0x20a0e8){if(_0x20a0e8[_0x9a63('0x37')]===_0x9a63('0x38')&&_0x20a0e8[_0x9a63('0x39')]){_0x1ac60c[_0x20a0e8[_0x9a63('0x39')]]=_0x20a0e8[_0x9a63('0x3a')][_0x9a63('0x3b')]();}else if(_0x20a0e8[_0x9a63('0x37')]===_0x9a63('0x3c')&&_0x20a0e8[_0x9a63('0x3d')]&&_0x20a0e8[_0x9a63('0x39')]){_0x465638[_0x20a0e8['variableName']]&&(_0x1ac60c[_0x20a0e8[_0x9a63('0x39')]]=_0x465638[_0x20a0e8[_0x9a63('0x3d')]][_0x9a63('0x3b')]());}else if(_0x20a0e8['type']===_0x9a63('0x3e')&&_0x20a0e8['Variable']&&_0x20a0e8['Variable'][_0x9a63('0x3f')]&&_0x20a0e8['idField']){_0x465638[_0x20a0e8[_0x9a63('0x40')][_0x9a63('0x3f')][_0x9a63('0x41')]()]&&(_0x1ac60c[_0x20a0e8[_0x9a63('0x39')]]=_0x465638[_0x20a0e8[_0x9a63('0x40')][_0x9a63('0x3f')][_0x9a63('0x41')]()][_0x9a63('0x3b')]());}});}return _0x1ac60c;}function getConnection(_0x2f56a1){var _0x4610a3=_0x2f56a1[_0x9a63('0x42')][_0x9a63('0x43')](_0x2f56a1[_0x9a63('0x44')]);var _0x1b7e46=new jsforce[(_0x9a63('0x45'))]({'oauth2':{'loginUrl':_0x2f56a1[_0x9a63('0x46')]||_0x9a63('0x47'),'clientId':_0x2f56a1['clientId'],'clientSecret':_0x2f56a1[_0x9a63('0x48')]}});return _0x1b7e46['login'](_0x2f56a1['username'],_0x4610a3)[_0x9a63('0x1a')](function(){logger[_0x9a63('0x1d')](_0x9a63('0x49'));return _0x1b7e46;});}exports[_0x9a63('0x4a')]=function(_0x1fcb70,_0x33b68e,_0x5e2cbd,_0x37c11e,_0x217429,_0xefa209){var _0x41b65b,_0x3eeb75,_0x3b7f3f,_0x6f226e;_0xefa209[_0x9a63('0x4b')]=intUtil['stripTrailingSlash'](_0xefa209['serverUrl']);_0xefa209[_0x9a63('0x46')]=intUtil[_0x9a63('0x4c')](_0xefa209[_0x9a63('0x46')]);if(_0x217429&&_0x217429[_0x9a63('0x4d')]){logger[_0x9a63('0x1d')]('[QUEUE]',_0x9a63('0x4e'));_0x33b68e[_0x9a63('0x4f')]=util['format'](_0x9a63('0x50'),_0xefa209[_0x9a63('0x4b')],_0x33b68e[_0x9a63('0x51')],md5(_0x33b68e[_0x9a63('0x51')]));}else{_0x33b68e[_0x9a63('0x4f')]='';}return getConnection(_0xefa209)[_0x9a63('0x1a')](function(_0x6a16c3){_0x6f226e=_0x6a16c3;return getUser(_0xefa209,_0x37c11e[_0x9a63('0x52')],_0x6f226e);})['then'](function(_0x3d57fa){_0x41b65b=_0x3d57fa;return getEndUser(_0xefa209,_0x5e2cbd,_0x33b68e[_0x9a63('0x53')],_0x33b68e['calleridnum'],_0x6f226e);})[_0x9a63('0x1a')](function(_0x5d1b93){_0x3eeb75=_0x5d1b93;return getTicket(_0xefa209,_0x41b65b,_0x3eeb75,_0x5e2cbd,_0x33b68e,_0x5e2cbd[_0x9a63('0x54')],_0x6f226e,_0x9a63('0x4a'));})[_0x9a63('0x1a')](function(_0x3f75ea){_0x3b7f3f=_0x3f75ea;logger[_0x9a63('0x1d')](_0x9a63('0x55'),_0x3b7f3f['id']);logger['info'](_0x9a63('0x56'),_0x3b7f3f['id'],_0x37c11e['name'],_0xefa209[_0x9a63('0x37')]);switch(_0xefa209['type']){case'integrationTab':emit(util[_0x9a63('0x30')](_0x9a63('0x57'),_0x37c11e['name']),'trigger:salesforce:display',{'recordId':_0x3b7f3f['id']});break;case'newTab':emit(util[_0x9a63('0x30')]('user:%s',_0x37c11e[_0x9a63('0x3f')]),_0x9a63('0x58'),{'uri':util[_0x9a63('0x30')](_0x9a63('0x59'),_0x6f226e[_0x9a63('0x5a')],_0x3b7f3f['id'])});break;default:logger[_0x9a63('0x5b')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0x9a63('0x5c')](function(_0x4fc80e){logger[_0x9a63('0x5b')](_0x9a63('0x5d'),JSON[_0x9a63('0x5e')](_0x4fc80e));});};exports[_0x9a63('0x5f')]=function(_0x2a1c67,_0x1de766,_0x4c83c8,_0x230803,_0x2d4529,_0x3f58a6,_0x105daa){var _0x37d70b,_0xf9a696,_0x5809a2,_0x480f9f;_0x3f58a6[_0x9a63('0x4b')]=intUtil[_0x9a63('0x4c')](_0x3f58a6['serverUrl']);_0x3f58a6['remoteUri']=intUtil[_0x9a63('0x4c')](_0x3f58a6[_0x9a63('0x46')]);if(_0x105daa&&_0x105daa[_0x9a63('0x60')]&&_0x105daa[_0x9a63('0x60')]!==_0x9a63('0x61')){logger[_0x9a63('0x1d')]('[OUTBOUND]',_0x9a63('0x4e'));_0x1de766[_0x9a63('0x4f')]=util[_0x9a63('0x30')](_0x9a63('0x50'),_0x3f58a6[_0x9a63('0x4b')],_0x1de766[_0x9a63('0x51')],md5(_0x1de766[_0x9a63('0x51')]));}return getConnection(_0x3f58a6)[_0x9a63('0x1a')](function(_0x3e0648){_0x480f9f=_0x3e0648;return getUser(_0x3f58a6,_0x230803[_0x9a63('0x52')],_0x480f9f);})[_0x9a63('0x1a')](function(_0x1ad134){_0x37d70b=_0x1ad134;return getEndUser(_0x3f58a6,_0x4c83c8,_0x1de766['destcalleridname'],_0x1de766[_0x9a63('0x62')],_0x480f9f);})[_0x9a63('0x1a')](function(_0x118bc1){_0xf9a696=_0x118bc1;return getTicket(_0x3f58a6,_0x37d70b,_0xf9a696,_0x4c83c8,_0x1de766,_0x4c83c8[_0x9a63('0x54')],_0x480f9f,_0x9a63('0x5f'));})['then'](function(_0x3ec9fa){_0x5809a2=_0x3ec9fa;logger[_0x9a63('0x1d')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x5809a2['id']);logger['info']('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x5809a2['id'],_0x230803['name'],_0x3f58a6[_0x9a63('0x37')]);switch(_0x3f58a6[_0x9a63('0x37')]){case'integrationTab':emit(util[_0x9a63('0x30')]('user:%s',_0x230803[_0x9a63('0x3f')]),_0x9a63('0x63'),{'recordId':_0x5809a2['id']});break;case'newTab':emit(util['format']('user:%s',_0x230803[_0x9a63('0x3f')]),_0x9a63('0x58'),{'uri':util[_0x9a63('0x30')](_0x9a63('0x59'),_0x480f9f[_0x9a63('0x5a')],_0x5809a2['id'])});break;default:logger[_0x9a63('0x5b')]('[OUTBOUND]',_0x9a63('0x64'));}})[_0x9a63('0x5c')](function(_0x290cb6){logger['error']('[OUTBOUND]',JSON['stringify'](_0x290cb6));});};exports['abandoned']=function(_0x10c03f,_0x304012,_0x38b01d,_0x29c15b,_0x47629e,_0x3ec771){var _0x9b530e,_0x58608d,_0x382bcc,_0x43cc42;_0x3ec771[_0x9a63('0x4b')]=intUtil[_0x9a63('0x4c')](_0x3ec771[_0x9a63('0x4b')]);_0x3ec771[_0x9a63('0x46')]=intUtil[_0x9a63('0x4c')](_0x3ec771[_0x9a63('0x46')]);if(_0x47629e&&_0x47629e[_0x9a63('0x4d')]){logger[_0x9a63('0x1d')](_0x9a63('0x65'),_0x9a63('0x4e'));_0x304012[_0x9a63('0x4f')]=util[_0x9a63('0x30')](_0x9a63('0x50'),_0x3ec771[_0x9a63('0x4b')],_0x304012['uniqueid'],md5(_0x304012[_0x9a63('0x51')]));}else{_0x304012[_0x9a63('0x4f')]='';}return getConnection(_0x3ec771)[_0x9a63('0x1a')](function(_0x539b6a){_0x43cc42=_0x539b6a;if(!_[_0x9a63('0x16')](_0x29c15b)){return getUser(_0x3ec771,_0x29c15b[_0x9a63('0x3f')],_0x43cc42);}else{return getUser(_0x3ec771,null,_0x43cc42);}})[_0x9a63('0x1a')](function(_0x11cc85){_0x9b530e=_0x11cc85;return getEndUser(_0x3ec771,_0x38b01d,_0x304012[_0x9a63('0x53')],_0x304012[_0x9a63('0x66')],_0x43cc42);})[_0x9a63('0x1a')](function(_0x278722){_0x58608d=_0x278722;return getTicket(_0x3ec771,_0x9b530e,_0x58608d,_0x38b01d,_0x304012,_0x38b01d[_0x9a63('0x54')],_0x43cc42);})[_0x9a63('0x1a')](function(_0x13f516){_0x382bcc=_0x13f516;logger[_0x9a63('0x1d')](_0x9a63('0x67'),_0x382bcc['id']);logger[_0x9a63('0x1d')](_0x9a63('0x68'),_0x3ec771['type']);})[_0x9a63('0x5c')](function(_0xdb29a3){logger[_0x9a63('0x5b')]('[ABANDONED]',JSON[_0x9a63('0x5e')](_0xdb29a3));});}; \ 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 88d1f7f..877fd90 100644 --- a/server/services/ami/trigger/integration/servicenow.js +++ b/server/services/ami/trigger/integration/servicenow.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','then','],\x20getUser\x20entity','userId','adminEmail','],\x20getUser\x20crm','catch','],\x20createEndUser\x20input\x20crm','POST','sys_user?','user','endUserNumber','true','System','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','length','forEach','type','customField','idField','content','toString','toLowerCase','variable','variableName','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema',']\x20getTicket\x20crm','label','Incident','ticketId','Incident\x20-\x20','ticketNumber','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','password','sysparm_limit=1','sysparm_display_value=true','serverUrl','stripTrailingSlash','%s/api/now/table/','remoteUri','email','destcalleridnum','calleridnum','queue','abandoned','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s',']\x20Error\x20running\x20ServiceNow\x20integration','lodash','bluebird','request-promise','ioredis','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','adminId','result','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','error','message'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'use strict';var _=require(_0x0a9e('0x0'));var Promise=require(_0x0a9e('0x1'));var rp=require(_0x0a9e('0x2'));var util=require('util');var md5=require('md5');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function getAdminUser(_0x5f41ea,_0x503809,_0xe42b77,_0x56465b,_0x52cace,_0x39753a){return new Promise(function(_0xf81284,_0x307b3e){var _0x3ab53f={'method':_0x0a9e('0xb'),'uri':_0x56465b+_0x0a9e('0xc')+'&'+_0x52cace+'&'+_0x39753a,'auth':_0x503809,'json':!![]};return rp(_0x3ab53f)['then'](function(_0x50dfb2){if(_0x50dfb2['result']['length']>0x0){_0xe42b77[_0x0a9e('0xd')]=_0x50dfb2[_0x0a9e('0xe')][0x0][_0x0a9e('0xf')];}logger[_0x0a9e('0x10')]('['+[_0x5f41ea[_0x0a9e('0x11')]()]+_0x0a9e('0x12'),_0xe42b77);_0xf81284(_0xe42b77);})['catch'](function(_0x4283ce){logger[_0x0a9e('0x13')]('['+[_0x5f41ea[_0x0a9e('0x11')]()]+']',_0x4283ce[_0x0a9e('0x14')]);_0x307b3e(_0x4283ce[_0x0a9e('0x14')]);});});}function getUser(_0x4d5611,_0x52a03d,_0x22dccb,_0x5d0880,_0x1985b6){return function(_0x519dfd){logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+'],\x20getUser\x20input\x20crm',_0x519dfd);return new Promise(function(_0x225616,_0x5a0a06){if(intUtil[_0x0a9e('0x15')](_0x519dfd[_0x0a9e('0x16')])){var _0x106033={'method':_0x0a9e('0xb'),'uri':_0x22dccb+_0x0a9e('0x17')+_0x519dfd[_0x0a9e('0x16')]+'&'+_0x5d0880+'&'+_0x1985b6,'auth':_0x52a03d,'json':!![]};logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+_0x0a9e('0x18'),_0x106033);return rp(_0x106033)[_0x0a9e('0x19')](function(_0x1c696a){logger[_0x0a9e('0x10')]('['+[_0x4d5611['toUpperCase']()]+_0x0a9e('0x1a'),_0x1c696a);if(_0x1c696a[_0x0a9e('0xe')]['length']>0x0&&String(_0x1c696a[_0x0a9e('0xe')][0x0]['active'])==='true'){_0x519dfd[_0x0a9e('0x1b')]=_0x1c696a[_0x0a9e('0xe')][0x0][_0x0a9e('0xf')];}else{_0x519dfd[_0x0a9e('0x1b')]=_0x519dfd['adminId'];_0x519dfd[_0x0a9e('0x16')]=_0x519dfd[_0x0a9e('0x1c')];}logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+_0x0a9e('0x1d'),_0x519dfd);_0x225616(_0x519dfd);})[_0x0a9e('0x1e')](function(_0x16b1ca){logger['error']('['+[_0x4d5611['toUpperCase']()]+']',_0x16b1ca[_0x0a9e('0x14')]);_0x5a0a06(_0x16b1ca[_0x0a9e('0x14')]);});}else{logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+']\x20using\x20admin\x20profile');_0x519dfd[_0x0a9e('0x1b')]=_0x519dfd['adminId'];_0x519dfd[_0x0a9e('0x16')]=_0x519dfd['adminEmail'];_0x225616(_0x519dfd);}});};}function createEndUser(_0x1dc186,_0x34dc65,_0x25fba9,_0x14433c,_0x140511){logger[_0x0a9e('0x10')]('['+[_0x1dc186[_0x0a9e('0x11')]()]+_0x0a9e('0x1f'),_0x25fba9);return new Promise(function(_0x5a101a,_0x3652a7){var _0x468813={'method':_0x0a9e('0x20'),'uri':_0x14433c+_0x0a9e('0x21')+_0x140511,'body':{'user_name':_0x25fba9['endUserNumber'],'roles':_0x0a9e('0x22'),'first_name':_0x25fba9[_0x0a9e('0x23')],'active':_0x0a9e('0x24'),'date_format':_0x0a9e('0x25'),'phone':_0x25fba9[_0x0a9e('0x23')]},'auth':_0x34dc65,'json':!![]};return rp(_0x468813)[_0x0a9e('0x19')](function(_0x296f41){logger[_0x0a9e('0x10')]('['+[_0x1dc186[_0x0a9e('0x11')]()]+'],\x20EndUser\x20schema',_0x296f41[_0x0a9e('0xe')]);_0x25fba9['endUserId']=_0x296f41[_0x0a9e('0xe')][_0x0a9e('0xf')];_0x5a101a(_0x25fba9);})[_0x0a9e('0x1e')](function(_0x33bdb7){logger[_0x0a9e('0x13')]('['+[_0x1dc186['toUpperCase']()]+']',_0x33bdb7[_0x0a9e('0x14')]);_0x3652a7(_0x33bdb7[_0x0a9e('0x14')]);});});}function getEndUser(_0x40cb85,_0x2da5c0,_0x2b45ea,_0x409319,_0x332d35){return function(_0x39e565){logger['info']('['+[_0x40cb85[_0x0a9e('0x11')]()]+'],\x20getEndUser\x20input\x20crm',_0x39e565);return new Promise(function(_0x2cc7a0,_0x14b13f){var _0x2b7e7f={'method':_0x0a9e('0xb'),'uri':_0x2b45ea+'sys_user?sysparm_query=phone%3D'+_0x39e565[_0x0a9e('0x23')]+'&'+_0x409319+'&'+_0x332d35,'auth':_0x2da5c0,'json':!![]};return rp(_0x2b7e7f)[_0x0a9e('0x19')](function(_0x1fa90d){if(_0x1fa90d[_0x0a9e('0xe')]['length']>0x0){_0x39e565['endUserId']=_0x1fa90d[_0x0a9e('0xe')][0x0]['sys_id'];logger[_0x0a9e('0x10')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+_0x0a9e('0x26'),_0x39e565);_0x2cc7a0(_0x39e565);}else{return createEndUser(_0x40cb85,_0x2da5c0,_0x39e565,_0x2b45ea,_0x409319)[_0x0a9e('0x19')](function(_0x4f41ae){logger[_0x0a9e('0x10')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+_0x0a9e('0x27'),_0x4f41ae);_0x2cc7a0(_0x4f41ae);});}})['catch'](function(_0x1dbf74){logger[_0x0a9e('0x13')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+']',_0x1dbf74['message']);_0x14b13f(_0x1dbf74['message']);});});};}function getCustomFields(_0x11b61d,_0x40d766){var _0x5adda1={};if(_0x11b61d[_0x0a9e('0x28')]>0x0){_[_0x0a9e('0x29')](_0x11b61d,function(_0x2e1b3a){if(_0x2e1b3a[_0x0a9e('0x2a')]==='string'&&_0x2e1b3a['nameField']&&!_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')]['toLowerCase']()]=_0x2e1b3a[_0x0a9e('0x2d')][_0x0a9e('0x2e')]();}else if(_0x2e1b3a[_0x0a9e('0x2a')]==='string'&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x2e1b3a[_0x0a9e('0x2d')][_0x0a9e('0x2e')]();}else if(_0x2e1b3a[_0x0a9e('0x2a')]===_0x0a9e('0x30')&&_0x2e1b3a[_0x0a9e('0x31')]&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x40d766[_0x2e1b3a[_0x0a9e('0x31')]][_0x0a9e('0x2e')]();}else if(_0x2e1b3a['type']==='customVariable'&&_0x2e1b3a[_0x0a9e('0x32')]&&_0x2e1b3a[_0x0a9e('0x32')][_0x0a9e('0x33')]&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x40d766[_0x2e1b3a[_0x0a9e('0x32')][_0x0a9e('0x33')][_0x0a9e('0x2f')]()][_0x0a9e('0x2e')]();}});}return _0x5adda1;}function getTicket(_0x35ed4a,_0x5026aa,_0x117c99,_0x138b8b,_0xdd268f,_0xfbd5ad){return function(_0x2e8caf){logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x34'),_0x2e8caf);return new Promise(function(_0x59afe8,_0x2e9d90){var _0x48fd45=_0x35ed4a[_0x0a9e('0x2f')]()===_0x0a9e('0x35')?_0x2e8caf[_0x0a9e('0x1b')]:_0x2e8caf['endUserId'];var _0x14bec2={'method':_0x0a9e('0x20'),'uri':_0x117c99+_0x0a9e('0x36')+'?'+_0xfbd5ad,'body':Object[_0x0a9e('0x37')]({},{'active':_0x0a9e('0x24'),'caller_id':_0x48fd45,'assigned_to':_0x2e8caf[_0x0a9e('0x1b')],'short_description':intUtil[_0x0a9e('0x38')](_0x138b8b['Subjects'],_0xdd268f,'\x20'),'description':intUtil[_0x0a9e('0x38')](_0x138b8b[_0x0a9e('0x39')],_0xdd268f,'\x0a')},getCustomFields(_0x138b8b[_0x0a9e('0x3a')],_0xdd268f)),'auth':_0x5026aa,'json':!![]};return rp(_0x14bec2)[_0x0a9e('0x19')](function(_0x409789){logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x3b'),_0x409789[_0x0a9e('0xe')]);_0x2e8caf['ticketId']=_0x409789[_0x0a9e('0xe')][_0x0a9e('0xf')];_0x2e8caf['ticketNumber']=_0x409789['result']['number'];logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x3c'),_0x2e8caf);_0x59afe8(_0x2e8caf);})[_0x0a9e('0x1e')](function(_0x61bb17){logger[_0x0a9e('0x13')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+']',_0x61bb17[_0x0a9e('0x14')]);_0x2e9d90(_0x61bb17['message']);});});};}function createRemoteTag(_0x4b1b9f,_0x53975a,_0x39d77d,_0x204173){return new Promise(function(_0x14d602,_0x5bb3ed){var _0x2b69d9={'method':_0x0a9e('0x20'),'uri':_0x39d77d+'label'+'?'+_0x204173,'body':{'short_description':_0x4b1b9f,'global':!![],'active':!![],'name':_0x4b1b9f},'auth':_0x53975a,'json':!![]};return rp(_0x2b69d9)['then'](function(_0x2ef381){var _0x59c6ff=_0x2ef381[_0x0a9e('0xe')]['sys_id'];_0x14d602(_0x59c6ff);});});}function getRemoteTag(_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a,_0x2f82da){return new Promise(function(_0x1bf38a,_0x508b47){var _0x50f687={'method':_0x0a9e('0xb'),'uri':_0x439340+_0x0a9e('0x3d')+'?sysparm_query=name%3D'+_0x2e5e62+'&'+_0x53613a,'auth':_0x3c20b2,'json':!![]};return rp(_0x50f687)[_0x0a9e('0x19')](function(_0x5ce9ac){if(_0x5ce9ac[_0x0a9e('0xe')]['length']>0x0){var _0xe22ccc=_0x5ce9ac['result'][0x0]['sys_id'];_0x1bf38a(_0xe22ccc);}else{return createRemoteTag(_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a)['then'](function(_0x2da03c){_0x1bf38a(_0x2da03c);});}});});}function assignTagToIncident(_0x47de4c,_0x2f7092,_0x65432,_0x3cfd00,_0x19b4df){return new Promise(function(_0x232830,_0x272738){var _0xd10662={'method':_0x0a9e('0x20'),'uri':_0x65432+'label_entry'+'?'+_0x19b4df,'body':{'label':_0x47de4c,'table':_0x0a9e('0x36'),'id_type':_0x0a9e('0x3e'),'table_key':_0x3cfd00[_0x0a9e('0x3f')],'title':_0x0a9e('0x40')+_0x3cfd00[_0x0a9e('0x41')],'id_display':_0x3cfd00[_0x0a9e('0x41')]},'auth':_0x2f7092,'json':!![]};return rp(_0xd10662)['then'](function(_0x956fbe){_0x232830();})[_0x0a9e('0x1e')](function(){_0x232830();});});}function manageTags(_0x5239ef,_0x3649cc,_0x5cc8fb,_0x20c668,_0x5ba1f9,_0x4b3c1a,_0x5674ee){return new Promise(function(_0x273cb5,_0x49d231){var _0x2244d6=[];_0x3649cc[_0x0a9e('0x29')](function(_0x261adb){_0x2244d6[_0x0a9e('0x42')](getRemoteTag(_0x261adb,_0x5cc8fb,_0x20c668,_0x4b3c1a,_0x5674ee));});return Promise[_0x0a9e('0x43')](_0x2244d6)[_0x0a9e('0x19')](function(_0x49eed0){if(_0x49eed0[_0x0a9e('0x28')]){logger['info']('['+[_0x5239ef[_0x0a9e('0x11')]()]+_0x0a9e('0x44'),_0x49eed0);var _0x51aaf7=[];_0x49eed0['forEach'](function(_0x453360){_0x51aaf7[_0x0a9e('0x42')](assignTagToIncident(_0x453360,_0x5cc8fb,_0x20c668,_0x5ba1f9,_0x4b3c1a));});return Promise[_0x0a9e('0x43')](_0x51aaf7)[_0x0a9e('0x19')](function(){_0x273cb5();})['catch'](function(){_0x273cb5();});}else{_0x273cb5();}});});}function getTags(_0x1d0dc8,_0xe05a5a,_0x54327c,_0x797b45,_0x17e88c,_0x88dcbf){return function(_0x409b29){return new Promise(function(_0x401837,_0x4d4a35){var _0x176840=[];var _0x2937e0=_0x797b45[_0x0a9e('0x45')];if(_0x2937e0&&_0x2937e0['length']>0x0){_0x176840=_[_0x0a9e('0x46')](_0x2937e0,'name');}if(_0x176840['length']>0x0){return manageTags(_0x1d0dc8,_0x176840,_0xe05a5a,_0x54327c,_0x409b29,_0x17e88c,_0x88dcbf)[_0x0a9e('0x19')](function(){_0x401837(_0x409b29);});}else{_0x401837(_0x409b29);}});};}function emit(_0x4556c5,_0x9375fb,_0x19c995){var _0x186f39=_0x0a9e('0x47')+_0x0a9e('0x48')+_0x0a9e('0x49')+_0x0a9e('0x4a');var _0x1cc4f3={'uri':_0x4556c5+_0x0a9e('0x4b')+_0x19c995+_0x186f39};io['to'](util[_0x0a9e('0x4c')](_0x0a9e('0x4d'),_0x9375fb))[_0x0a9e('0x4e')](_0x0a9e('0x4f'),_0x1cc4f3);}exports['cs']=function(_0x412a72,_0x2a28c0,_0x4257c9,_0x5150a4,_0x1b0b98,_0x295763,_0x243d12,_0x4edbb0){var _0x1148a1={};var _0x30944e={'user':_0x295763['username'],'pass':_0x295763[_0x0a9e('0x50')]};var _0x56e31e=_0x0a9e('0x51');var _0x427946=_0x0a9e('0x52');_0x295763['remoteUri']=intUtil['stripTrailingSlash'](_0x295763['remoteUri']);_0x295763[_0x0a9e('0x53')]=intUtil[_0x0a9e('0x54')](_0x295763[_0x0a9e('0x53')]);var _0x23a7d3=util[_0x0a9e('0x4c')](_0x0a9e('0x55'),_0x295763[_0x0a9e('0x56')]);_0x1148a1[_0x0a9e('0x16')]=!_['isNil'](_0x5150a4)?_0x5150a4[_0x0a9e('0x57')]:null;_0x1148a1[_0x0a9e('0x1c')]=_0x295763[_0x0a9e('0x57')];_0x1148a1['endUserNumber']=_0x4edbb0[_0x0a9e('0x2f')]()==='outbound'?_0x2a28c0[_0x0a9e('0x58')]:_0x2a28c0[_0x0a9e('0x59')];_0x1148a1['callDirection']=_0x4edbb0===_0x0a9e('0x5a')||_0x4edbb0===_0x0a9e('0x5b')?_0x0a9e('0x5a'):_0x0a9e('0x35');var _0x542ece=util[_0x0a9e('0x4c')](_0x0a9e('0x5c'),_0x295763[_0x0a9e('0x53')],_0x2a28c0[_0x0a9e('0x5d')],md5(_0x2a28c0['uniqueid']));if(_0x1b0b98&&_0x1b0b98[_0x0a9e('0x5e')]){logger[_0x0a9e('0x10')](_0x0a9e('0x5f'),_0x0a9e('0x60'));_0x2a28c0['recordingURL']=_0x542ece;}else if(_0x243d12&&_0x243d12[_0x0a9e('0x61')]&&_0x243d12[_0x0a9e('0x61')]!==_0x0a9e('0x62')){logger[_0x0a9e('0x10')](_0x0a9e('0x63'),_0x0a9e('0x60'));_0x2a28c0[_0x0a9e('0x64')]=_0x542ece;}else{_0x2a28c0[_0x0a9e('0x64')]='';}return getAdminUser(_0x4edbb0,_0x30944e,_0x1148a1,_0x23a7d3,_0x427946,_0x56e31e)[_0x0a9e('0x19')](getUser(_0x4edbb0,_0x30944e,_0x23a7d3,_0x427946,_0x56e31e))[_0x0a9e('0x19')](getEndUser(_0x4edbb0,_0x30944e,_0x23a7d3,_0x427946,_0x56e31e))[_0x0a9e('0x19')](getTicket(_0x4edbb0,_0x30944e,_0x23a7d3,_0x4257c9,_0x2a28c0,_0x427946))[_0x0a9e('0x19')](function(_0x25744a){logger[_0x0a9e('0x10')](util['format'](_0x0a9e('0x65'),_0x25744a[_0x0a9e('0x3f')]));logger[_0x0a9e('0x10')](util['format'](_0x0a9e('0x66'),_0x4edbb0));if(_0x4edbb0!==_0x0a9e('0x5b')){logger[_0x0a9e('0x10')]('['+[_0x4edbb0[_0x0a9e('0x11')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x295763['remoteUri'],_0x5150a4[_0x0a9e('0x33')],_0x25744a[_0x0a9e('0x3f')]);}})['catch'](function(_0x45108c){logger['error']('['+[_0x4edbb0[_0x0a9e('0x11')]()]+_0x0a9e('0x67'),util['inspect'](_0x45108c,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xa9e0=['validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','then','],\x20getUser\x20entity','userId','adminEmail','],\x20getUser\x20crm','catch','],\x20createEndUser\x20input\x20crm','POST','sys_user?','user','endUserNumber','true','System','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','length','forEach','type','customField','idField','content','toString','toLowerCase','variable','variableName','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema',']\x20getTicket\x20crm','label','Incident','ticketId','Incident\x20-\x20','ticketNumber','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','password','sysparm_limit=1','sysparm_display_value=true','serverUrl','stripTrailingSlash','%s/api/now/table/','remoteUri','email','destcalleridnum','calleridnum','queue','abandoned','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s',']\x20Error\x20running\x20ServiceNow\x20integration','lodash','bluebird','request-promise','ioredis','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','adminId','result','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','error','message'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'use strict';var _=require(_0x0a9e('0x0'));var Promise=require(_0x0a9e('0x1'));var rp=require(_0x0a9e('0x2'));var util=require('util');var md5=require('md5');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function getAdminUser(_0x5f41ea,_0x503809,_0xe42b77,_0x56465b,_0x52cace,_0x39753a){return new Promise(function(_0xf81284,_0x307b3e){var _0x3ab53f={'method':_0x0a9e('0xb'),'uri':_0x56465b+_0x0a9e('0xc')+'&'+_0x52cace+'&'+_0x39753a,'auth':_0x503809,'json':!![]};return rp(_0x3ab53f)['then'](function(_0x50dfb2){if(_0x50dfb2['result']['length']>0x0){_0xe42b77[_0x0a9e('0xd')]=_0x50dfb2[_0x0a9e('0xe')][0x0][_0x0a9e('0xf')];}logger[_0x0a9e('0x10')]('['+[_0x5f41ea[_0x0a9e('0x11')]()]+_0x0a9e('0x12'),_0xe42b77);_0xf81284(_0xe42b77);})['catch'](function(_0x4283ce){logger[_0x0a9e('0x13')]('['+[_0x5f41ea[_0x0a9e('0x11')]()]+']',_0x4283ce[_0x0a9e('0x14')]);_0x307b3e(_0x4283ce[_0x0a9e('0x14')]);});});}function getUser(_0x4d5611,_0x52a03d,_0x22dccb,_0x5d0880,_0x1985b6){return function(_0x519dfd){logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+'],\x20getUser\x20input\x20crm',_0x519dfd);return new Promise(function(_0x225616,_0x5a0a06){if(intUtil[_0x0a9e('0x15')](_0x519dfd[_0x0a9e('0x16')])){var _0x106033={'method':_0x0a9e('0xb'),'uri':_0x22dccb+_0x0a9e('0x17')+_0x519dfd[_0x0a9e('0x16')]+'&'+_0x5d0880+'&'+_0x1985b6,'auth':_0x52a03d,'json':!![]};logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+_0x0a9e('0x18'),_0x106033);return rp(_0x106033)[_0x0a9e('0x19')](function(_0x1c696a){logger[_0x0a9e('0x10')]('['+[_0x4d5611['toUpperCase']()]+_0x0a9e('0x1a'),_0x1c696a);if(_0x1c696a[_0x0a9e('0xe')]['length']>0x0&&String(_0x1c696a[_0x0a9e('0xe')][0x0]['active'])==='true'){_0x519dfd[_0x0a9e('0x1b')]=_0x1c696a[_0x0a9e('0xe')][0x0][_0x0a9e('0xf')];}else{_0x519dfd[_0x0a9e('0x1b')]=_0x519dfd['adminId'];_0x519dfd[_0x0a9e('0x16')]=_0x519dfd[_0x0a9e('0x1c')];}logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+_0x0a9e('0x1d'),_0x519dfd);_0x225616(_0x519dfd);})[_0x0a9e('0x1e')](function(_0x16b1ca){logger['error']('['+[_0x4d5611['toUpperCase']()]+']',_0x16b1ca[_0x0a9e('0x14')]);_0x5a0a06(_0x16b1ca[_0x0a9e('0x14')]);});}else{logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+']\x20using\x20admin\x20profile');_0x519dfd[_0x0a9e('0x1b')]=_0x519dfd['adminId'];_0x519dfd[_0x0a9e('0x16')]=_0x519dfd['adminEmail'];_0x225616(_0x519dfd);}});};}function createEndUser(_0x1dc186,_0x34dc65,_0x25fba9,_0x14433c,_0x140511){logger[_0x0a9e('0x10')]('['+[_0x1dc186[_0x0a9e('0x11')]()]+_0x0a9e('0x1f'),_0x25fba9);return new Promise(function(_0x5a101a,_0x3652a7){var _0x468813={'method':_0x0a9e('0x20'),'uri':_0x14433c+_0x0a9e('0x21')+_0x140511,'body':{'user_name':_0x25fba9['endUserNumber'],'roles':_0x0a9e('0x22'),'first_name':_0x25fba9[_0x0a9e('0x23')],'active':_0x0a9e('0x24'),'date_format':_0x0a9e('0x25'),'phone':_0x25fba9[_0x0a9e('0x23')]},'auth':_0x34dc65,'json':!![]};return rp(_0x468813)[_0x0a9e('0x19')](function(_0x296f41){logger[_0x0a9e('0x10')]('['+[_0x1dc186[_0x0a9e('0x11')]()]+'],\x20EndUser\x20schema',_0x296f41[_0x0a9e('0xe')]);_0x25fba9['endUserId']=_0x296f41[_0x0a9e('0xe')][_0x0a9e('0xf')];_0x5a101a(_0x25fba9);})[_0x0a9e('0x1e')](function(_0x33bdb7){logger[_0x0a9e('0x13')]('['+[_0x1dc186['toUpperCase']()]+']',_0x33bdb7[_0x0a9e('0x14')]);_0x3652a7(_0x33bdb7[_0x0a9e('0x14')]);});});}function getEndUser(_0x40cb85,_0x2da5c0,_0x2b45ea,_0x409319,_0x332d35){return function(_0x39e565){logger['info']('['+[_0x40cb85[_0x0a9e('0x11')]()]+'],\x20getEndUser\x20input\x20crm',_0x39e565);return new Promise(function(_0x2cc7a0,_0x14b13f){var _0x2b7e7f={'method':_0x0a9e('0xb'),'uri':_0x2b45ea+'sys_user?sysparm_query=phone%3D'+_0x39e565[_0x0a9e('0x23')]+'&'+_0x409319+'&'+_0x332d35,'auth':_0x2da5c0,'json':!![]};return rp(_0x2b7e7f)[_0x0a9e('0x19')](function(_0x1fa90d){if(_0x1fa90d[_0x0a9e('0xe')]['length']>0x0){_0x39e565['endUserId']=_0x1fa90d[_0x0a9e('0xe')][0x0]['sys_id'];logger[_0x0a9e('0x10')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+_0x0a9e('0x26'),_0x39e565);_0x2cc7a0(_0x39e565);}else{return createEndUser(_0x40cb85,_0x2da5c0,_0x39e565,_0x2b45ea,_0x409319)[_0x0a9e('0x19')](function(_0x4f41ae){logger[_0x0a9e('0x10')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+_0x0a9e('0x27'),_0x4f41ae);_0x2cc7a0(_0x4f41ae);});}})['catch'](function(_0x1dbf74){logger[_0x0a9e('0x13')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+']',_0x1dbf74['message']);_0x14b13f(_0x1dbf74['message']);});});};}function getCustomFields(_0x11b61d,_0x40d766){var _0x5adda1={};if(_0x11b61d[_0x0a9e('0x28')]>0x0){_[_0x0a9e('0x29')](_0x11b61d,function(_0x2e1b3a){if(_0x2e1b3a[_0x0a9e('0x2a')]==='string'&&_0x2e1b3a['nameField']&&!_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')]['toLowerCase']()]=_0x2e1b3a[_0x0a9e('0x2d')][_0x0a9e('0x2e')]();}else if(_0x2e1b3a[_0x0a9e('0x2a')]==='string'&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x2e1b3a[_0x0a9e('0x2d')][_0x0a9e('0x2e')]();}else if(_0x2e1b3a[_0x0a9e('0x2a')]===_0x0a9e('0x30')&&_0x2e1b3a[_0x0a9e('0x31')]&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x40d766[_0x2e1b3a[_0x0a9e('0x31')]][_0x0a9e('0x2e')]();}else if(_0x2e1b3a['type']==='customVariable'&&_0x2e1b3a[_0x0a9e('0x32')]&&_0x2e1b3a[_0x0a9e('0x32')][_0x0a9e('0x33')]&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x40d766[_0x2e1b3a[_0x0a9e('0x32')][_0x0a9e('0x33')][_0x0a9e('0x2f')]()][_0x0a9e('0x2e')]();}});}return _0x5adda1;}function getTicket(_0x35ed4a,_0x5026aa,_0x117c99,_0x138b8b,_0xdd268f,_0xfbd5ad){return function(_0x2e8caf){logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x34'),_0x2e8caf);return new Promise(function(_0x59afe8,_0x2e9d90){var _0x48fd45=_0x35ed4a[_0x0a9e('0x2f')]()===_0x0a9e('0x35')?_0x2e8caf[_0x0a9e('0x1b')]:_0x2e8caf['endUserId'];var _0x14bec2={'method':_0x0a9e('0x20'),'uri':_0x117c99+_0x0a9e('0x36')+'?'+_0xfbd5ad,'body':Object[_0x0a9e('0x37')]({},{'active':_0x0a9e('0x24'),'caller_id':_0x48fd45,'assigned_to':_0x2e8caf[_0x0a9e('0x1b')],'short_description':intUtil[_0x0a9e('0x38')](_0x138b8b['Subjects'],_0xdd268f,'\x20'),'description':intUtil[_0x0a9e('0x38')](_0x138b8b[_0x0a9e('0x39')],_0xdd268f,'\x0a')},getCustomFields(_0x138b8b[_0x0a9e('0x3a')],_0xdd268f)),'auth':_0x5026aa,'json':!![]};return rp(_0x14bec2)[_0x0a9e('0x19')](function(_0x409789){logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x3b'),_0x409789[_0x0a9e('0xe')]);_0x2e8caf['ticketId']=_0x409789[_0x0a9e('0xe')][_0x0a9e('0xf')];_0x2e8caf['ticketNumber']=_0x409789['result']['number'];logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x3c'),_0x2e8caf);_0x59afe8(_0x2e8caf);})[_0x0a9e('0x1e')](function(_0x61bb17){logger[_0x0a9e('0x13')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+']',_0x61bb17[_0x0a9e('0x14')]);_0x2e9d90(_0x61bb17['message']);});});};}function createRemoteTag(_0x4b1b9f,_0x53975a,_0x39d77d,_0x204173){return new Promise(function(_0x14d602,_0x5bb3ed){var _0x2b69d9={'method':_0x0a9e('0x20'),'uri':_0x39d77d+'label'+'?'+_0x204173,'body':{'short_description':_0x4b1b9f,'global':!![],'active':!![],'name':_0x4b1b9f},'auth':_0x53975a,'json':!![]};return rp(_0x2b69d9)['then'](function(_0x2ef381){var _0x59c6ff=_0x2ef381[_0x0a9e('0xe')]['sys_id'];_0x14d602(_0x59c6ff);});});}function getRemoteTag(_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a,_0x2f82da){return new Promise(function(_0x1bf38a,_0x508b47){var _0x50f687={'method':_0x0a9e('0xb'),'uri':_0x439340+_0x0a9e('0x3d')+'?sysparm_query=name%3D'+_0x2e5e62+'&'+_0x53613a,'auth':_0x3c20b2,'json':!![]};return rp(_0x50f687)[_0x0a9e('0x19')](function(_0x5ce9ac){if(_0x5ce9ac[_0x0a9e('0xe')]['length']>0x0){var _0xe22ccc=_0x5ce9ac['result'][0x0]['sys_id'];_0x1bf38a(_0xe22ccc);}else{return createRemoteTag(_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a)['then'](function(_0x2da03c){_0x1bf38a(_0x2da03c);});}});});}function assignTagToIncident(_0x47de4c,_0x2f7092,_0x65432,_0x3cfd00,_0x19b4df){return new Promise(function(_0x232830,_0x272738){var _0xd10662={'method':_0x0a9e('0x20'),'uri':_0x65432+'label_entry'+'?'+_0x19b4df,'body':{'label':_0x47de4c,'table':_0x0a9e('0x36'),'id_type':_0x0a9e('0x3e'),'table_key':_0x3cfd00[_0x0a9e('0x3f')],'title':_0x0a9e('0x40')+_0x3cfd00[_0x0a9e('0x41')],'id_display':_0x3cfd00[_0x0a9e('0x41')]},'auth':_0x2f7092,'json':!![]};return rp(_0xd10662)['then'](function(_0x956fbe){_0x232830();})[_0x0a9e('0x1e')](function(){_0x232830();});});}function manageTags(_0x5239ef,_0x3649cc,_0x5cc8fb,_0x20c668,_0x5ba1f9,_0x4b3c1a,_0x5674ee){return new Promise(function(_0x273cb5,_0x49d231){var _0x2244d6=[];_0x3649cc[_0x0a9e('0x29')](function(_0x261adb){_0x2244d6[_0x0a9e('0x42')](getRemoteTag(_0x261adb,_0x5cc8fb,_0x20c668,_0x4b3c1a,_0x5674ee));});return Promise[_0x0a9e('0x43')](_0x2244d6)[_0x0a9e('0x19')](function(_0x49eed0){if(_0x49eed0[_0x0a9e('0x28')]){logger['info']('['+[_0x5239ef[_0x0a9e('0x11')]()]+_0x0a9e('0x44'),_0x49eed0);var _0x51aaf7=[];_0x49eed0['forEach'](function(_0x453360){_0x51aaf7[_0x0a9e('0x42')](assignTagToIncident(_0x453360,_0x5cc8fb,_0x20c668,_0x5ba1f9,_0x4b3c1a));});return Promise[_0x0a9e('0x43')](_0x51aaf7)[_0x0a9e('0x19')](function(){_0x273cb5();})['catch'](function(){_0x273cb5();});}else{_0x273cb5();}});});}function getTags(_0x1d0dc8,_0xe05a5a,_0x54327c,_0x797b45,_0x17e88c,_0x88dcbf){return function(_0x409b29){return new Promise(function(_0x401837,_0x4d4a35){var _0x176840=[];var _0x2937e0=_0x797b45[_0x0a9e('0x45')];if(_0x2937e0&&_0x2937e0['length']>0x0){_0x176840=_[_0x0a9e('0x46')](_0x2937e0,'name');}if(_0x176840['length']>0x0){return manageTags(_0x1d0dc8,_0x176840,_0xe05a5a,_0x54327c,_0x409b29,_0x17e88c,_0x88dcbf)[_0x0a9e('0x19')](function(){_0x401837(_0x409b29);});}else{_0x401837(_0x409b29);}});};}function emit(_0x4556c5,_0x9375fb,_0x19c995){var _0x186f39=_0x0a9e('0x47')+_0x0a9e('0x48')+_0x0a9e('0x49')+_0x0a9e('0x4a');var _0x1cc4f3={'uri':_0x4556c5+_0x0a9e('0x4b')+_0x19c995+_0x186f39};io['to'](util[_0x0a9e('0x4c')](_0x0a9e('0x4d'),_0x9375fb))[_0x0a9e('0x4e')](_0x0a9e('0x4f'),_0x1cc4f3);}exports['cs']=function(_0x412a72,_0x2a28c0,_0x4257c9,_0x5150a4,_0x1b0b98,_0x295763,_0x243d12,_0x4edbb0){var _0x1148a1={};var _0x30944e={'user':_0x295763['username'],'pass':_0x295763[_0x0a9e('0x50')]};var _0x56e31e=_0x0a9e('0x51');var _0x427946=_0x0a9e('0x52');_0x295763['remoteUri']=intUtil['stripTrailingSlash'](_0x295763['remoteUri']);_0x295763[_0x0a9e('0x53')]=intUtil[_0x0a9e('0x54')](_0x295763[_0x0a9e('0x53')]);var _0x23a7d3=util[_0x0a9e('0x4c')](_0x0a9e('0x55'),_0x295763[_0x0a9e('0x56')]);_0x1148a1[_0x0a9e('0x16')]=!_['isNil'](_0x5150a4)?_0x5150a4[_0x0a9e('0x57')]:null;_0x1148a1[_0x0a9e('0x1c')]=_0x295763[_0x0a9e('0x57')];_0x1148a1['endUserNumber']=_0x4edbb0[_0x0a9e('0x2f')]()==='outbound'?_0x2a28c0[_0x0a9e('0x58')]:_0x2a28c0[_0x0a9e('0x59')];_0x1148a1['callDirection']=_0x4edbb0===_0x0a9e('0x5a')||_0x4edbb0===_0x0a9e('0x5b')?_0x0a9e('0x5a'):_0x0a9e('0x35');var _0x542ece=util[_0x0a9e('0x4c')](_0x0a9e('0x5c'),_0x295763[_0x0a9e('0x53')],_0x2a28c0[_0x0a9e('0x5d')],md5(_0x2a28c0['uniqueid']));if(_0x1b0b98&&_0x1b0b98[_0x0a9e('0x5e')]){logger[_0x0a9e('0x10')](_0x0a9e('0x5f'),_0x0a9e('0x60'));_0x2a28c0['recordingURL']=_0x542ece;}else if(_0x243d12&&_0x243d12[_0x0a9e('0x61')]&&_0x243d12[_0x0a9e('0x61')]!==_0x0a9e('0x62')){logger[_0x0a9e('0x10')](_0x0a9e('0x63'),_0x0a9e('0x60'));_0x2a28c0[_0x0a9e('0x64')]=_0x542ece;}else{_0x2a28c0[_0x0a9e('0x64')]='';}return getAdminUser(_0x4edbb0,_0x30944e,_0x1148a1,_0x23a7d3,_0x427946,_0x56e31e)[_0x0a9e('0x19')](getUser(_0x4edbb0,_0x30944e,_0x23a7d3,_0x427946,_0x56e31e))[_0x0a9e('0x19')](getEndUser(_0x4edbb0,_0x30944e,_0x23a7d3,_0x427946,_0x56e31e))[_0x0a9e('0x19')](getTicket(_0x4edbb0,_0x30944e,_0x23a7d3,_0x4257c9,_0x2a28c0,_0x427946))[_0x0a9e('0x19')](function(_0x25744a){logger[_0x0a9e('0x10')](util['format'](_0x0a9e('0x65'),_0x25744a[_0x0a9e('0x3f')]));logger[_0x0a9e('0x10')](util['format'](_0x0a9e('0x66'),_0x4edbb0));if(_0x4edbb0!==_0x0a9e('0x5b')){logger[_0x0a9e('0x10')]('['+[_0x4edbb0[_0x0a9e('0x11')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x295763['remoteUri'],_0x5150a4[_0x0a9e('0x33')],_0x25744a[_0x0a9e('0x3f')]);}})['catch'](function(_0x45108c){logger['error']('['+[_0x4edbb0[_0x0a9e('0x11')]()]+_0x0a9e('0x67'),util['inspect'](_0x45108c,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/sugarcrm.js b/server/services/ami/trigger/integration/sugarcrm.js index fff6c66..f0642d8 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 _0x1092=['Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','first_name','Enduser\x20created.','debug','[HTTP]','merge','map','type','string','customField','nameField','toLowerCase','content','custom_fields','variable','customVariable','Variable','login','username','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','remoteUri','serverUrl','stripTrailingSlash','uri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','users','contacts','version','%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','%s/service/v4_1/rest.php','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','The\x20Ticket\x20ID\x20is:','abandoned','[ABANDONED]','calleridnum','error','lodash','request-promise','md5','ioredis','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','socket.io-emitter','Creating\x20new\x20ticket...','getString','description','date_start','toISOString','slice','replace','duration_minutes','parent_name','direction','length','forEach','variableName','push','idField','set_entry','JSON','stringify','Calls','format','Basic\x20%s','toString','base64','get_server_info','isNil','info','get_entry_list','Employees','name','user_name','then','entry_list','find','name_value_list','value','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','resolve','user_id','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!'];(function(_0x4d6554,_0x24a2bf){var _0xd9f05b=function(_0x679c5e){while(--_0x679c5e){_0x4d6554['push'](_0x4d6554['shift']());}};_0xd9f05b(++_0x24a2bf);}(_0x1092,0x190));var _0x2109=function(_0x47a6ea,_0x38d256){_0x47a6ea=_0x47a6ea-0x0;var _0x425ac1=_0x1092[_0x47a6ea];return _0x425ac1;};'use strict';var _=require(_0x2109('0x0'));var rp=require(_0x2109('0x1'));var BPromise=require('bluebird');var md5=require(_0x2109('0x2'));var util=require('util');var Redis=require(_0x2109('0x3'));var intUtil=require('./util');var config=require(_0x2109('0x4'));var logger=require(_0x2109('0x5'))(_0x2109('0x6'));config[_0x2109('0x7')]=_[_0x2109('0x8')](config[_0x2109('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x2109('0x9'))(new Redis(config[_0x2109('0x7')]));var def={'method':'POST','json':!![]};function emit(_0x2cebdf,_0xbbc09a,_0x254017){io['to'](_0x2cebdf)['emit'](_0xbbc09a,_0x254017);}function getTicket(_0x1f2bcd,_0xd7ca4b,_0x27bb06,_0xb3227a,_0x54ee13,_0x26a1c6,_0x598d59,_0x1ac9cf){logger['info'](_0x2109('0xa'));var _0x5f3106=new Date();var _0x447a3b=[{'name':'name','value':intUtil[_0x2109('0xb')](_0xb3227a['Subjects'],_0x54ee13,'\x20')},{'name':'assigned_user_id','value':_0xd7ca4b['id']},{'name':'created_by','value':_0xd7ca4b['id']},{'name':_0x2109('0xc'),'value':intUtil['getString'](_0xb3227a['Descriptions'],_0x54ee13,'\x0a')},{'name':_0x2109('0xd'),'value':_0x5f3106[_0x2109('0xe')]()[_0x2109('0xf')](0x0,0x13)[_0x2109('0x10')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0x2109('0x11'),'value':'15'},{'name':'parent_id','value':_0x27bb06['id']},{'name':'parent_type','value':'Contacts'},{'name':_0x2109('0x12'),'value':_0x27bb06['name']},{'name':_0x2109('0x13'),'value':_0x1ac9cf}];if(_0x26a1c6[_0x2109('0x14')]){_[_0x2109('0x15')](_0x26a1c6,function(_0x4ee5e4){if(_0x54ee13[_0x4ee5e4[_0x2109('0x16')]]){_0x447a3b[_0x2109('0x17')]({'name':_0x4ee5e4[_0x2109('0x18')],'value':_0x54ee13[_0x4ee5e4['variableName']]});}});}return request({'form':{'method':_0x2109('0x19'),'input_type':'JSON','response_type':_0x2109('0x1a'),'rest_data':JSON[_0x2109('0x1b')]({'session':_0x598d59['id'],'module_name':_0x2109('0x1c'),'name_value_list':_0x447a3b})}});}function getAuth(_0x211a3f){return util[_0x2109('0x1d')](_0x2109('0x1e'),new Buffer(_0x211a3f['apiKey']+':X')[_0x2109('0x1f')](_0x2109('0x20')));}function getServerInfo(_0x2444b0){return request({'form':{'method':_0x2109('0x21'),'input_type':'JSON','response_type':_0x2109('0x1a'),'rest_data':JSON[_0x2109('0x1b')]({'session':_0x2444b0['id']})}});}function getUser(_0x56f072,_0x870c67,_0x2a5e9e){if(!_[_0x2109('0x22')](_0x870c67)){logger[_0x2109('0x23')]('Getting\x20agent\x20with\x20name',_0x870c67);return request({'form':{'method':_0x2109('0x24'),'input_type':_0x2109('0x1a'),'response_type':_0x2109('0x1a'),'rest_data':JSON[_0x2109('0x1b')]({'session':_0x2a5e9e['id'],'module_name':_0x2109('0x25'),'query':util[_0x2109('0x1d')]('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x870c67),'order_by':'','offset':'0','select_fields':['id',_0x2109('0x26'),_0x2109('0x27')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x2109('0x28')](function(_0x327445){if(_0x327445[_0x2109('0x29')][_0x2109('0x14')]){var _0x4adc3a=_[_0x2109('0x2a')](_0x327445[_0x2109('0x29')],function(_0x15ffb2){return _0x15ffb2[_0x2109('0x2b')]['user_name'][_0x2109('0x2c')]===_0x870c67;});if(_0x4adc3a){logger[_0x2109('0x23')]('Agent\x20found!');return BPromise['resolve']({'id':_0x4adc3a[_0x2109('0x2b')]['id'][_0x2109('0x2c')],'name':_0x4adc3a['name_value_list'][_0x2109('0x26')][_0x2109('0x2c')]});}}logger[_0x2109('0x23')](_0x2109('0x2d'));return BPromise[_0x2109('0x2e')]({'id':_0x2a5e9e[_0x2109('0x2b')][_0x2109('0x2f')][_0x2109('0x2c')],'name':_0x2a5e9e[_0x2109('0x2b')][_0x2109('0x27')][_0x2109('0x2c')]});});}else{logger['info']('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise['resolve']({'id':_0x2a5e9e['name_value_list']['user_id']['value'],'name':_0x2a5e9e[_0x2109('0x2b')]['user_name'][_0x2109('0x2c')]});}}function getEndUser(_0x28bb8f,_0x5b940b,_0x2d57e8,_0x5b1c03){logger['info'](_0x2109('0x30'),_0x2d57e8);return request({'form':{'method':'get_entry_list','input_type':'JSON','response_type':_0x2109('0x1a'),'rest_data':JSON[_0x2109('0x1b')]({'session':_0x5b1c03['id'],'module_name':'Contacts','query':util['format'](_0x2109('0x31'),_0x2d57e8),'order_by':'','offset':'0','select_fields':['id',_0x2109('0x26'),_0x2109('0x32')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x2109('0x28')](function(_0x3d3019){if(_0x3d3019[_0x2109('0x29')]['length']){var _0x6895b2=_[_0x2109('0x2a')](_0x3d3019['entry_list'],function(_0xd87702){return _0xd87702[_0x2109('0x2b')][_0x2109('0x32')]['value']===_0x2d57e8;});if(_0x6895b2){logger['info'](_0x2109('0x33'));return BPromise[_0x2109('0x2e')]({'id':_0x6895b2[_0x2109('0x2b')]['id'][_0x2109('0x2c')],'name':_0x6895b2[_0x2109('0x2b')][_0x2109('0x26')][_0x2109('0x2c')],'phone':_0x6895b2[_0x2109('0x2b')][_0x2109('0x32')][_0x2109('0x2c')]});}}else{logger[_0x2109('0x23')](_0x2109('0x34'));return request({'form':{'method':_0x2109('0x19'),'input_type':_0x2109('0x1a'),'response_type':_0x2109('0x1a'),'rest_data':JSON[_0x2109('0x1b')]({'session':_0x5b1c03['id'],'module_name':_0x2109('0x35'),'name_value_list':[{'name':_0x2109('0x36'),'value':_0x5b940b!==''?_0x5b940b:util[_0x2109('0x1d')]('Caller\x20-\x20%s',_0x2d57e8)},{'name':_0x2109('0x32'),'value':_0x2d57e8}]})}})[_0x2109('0x28')](function(_0x508e80){logger[_0x2109('0x23')](_0x2109('0x37'));return BPromise[_0x2109('0x2e')]({'id':_0x508e80['id'],'name':_0x508e80['entry_list'][_0x2109('0x36')][_0x2109('0x2c')],'phone':_0x508e80[_0x2109('0x29')][_0x2109('0x32')][_0x2109('0x2c')]});});}});}function request(_0x30d561){logger[_0x2109('0x38')](_0x2109('0x39'),JSON[_0x2109('0x1b')](_0x30d561));return rp(_[_0x2109('0x3a')](def,_0x30d561));}function getTags(_0x40027a,_0x305a6f){var _0x4332b8=[];if(_0x40027a&&_0x40027a[_0x2109('0x14')]>0x0){_0x4332b8=_[_0x2109('0x3b')](_0x40027a,_0x305a6f);}return _0x4332b8;}function getCustomFields(_0x35f7ff,_0x3be055){var _0x24125d=[];var _0x99a2b0={'custom_fields':[]};if(_0x35f7ff['length']>0x0){_[_0x2109('0x15')](_0x35f7ff,function(_0x58c086){if(_0x58c086[_0x2109('0x3c')]===_0x2109('0x3d')&&_0x58c086['nameField']&&!_0x58c086[_0x2109('0x3e')]){_0x99a2b0[_0x58c086[_0x2109('0x3f')][_0x2109('0x40')]()]=_0x58c086[_0x2109('0x41')][_0x2109('0x1f')]();}else if(_0x58c086[_0x2109('0x3c')]===_0x2109('0x3d')&&_0x58c086['idField']&&_0x58c086['customField']){_0x99a2b0[_0x2109('0x42')]['push']({'id':_0x58c086[_0x2109('0x18')],'value':_0x58c086[_0x2109('0x41')][_0x2109('0x1f')]()});}else if(_0x58c086['type']===_0x2109('0x43')&&_0x58c086[_0x2109('0x16')]&&_0x58c086[_0x2109('0x18')]&&_0x58c086[_0x2109('0x3e')]){_0x3be055[_0x58c086['variableName']]&&_0x99a2b0[_0x2109('0x42')][_0x2109('0x17')]({'id':_0x58c086[_0x2109('0x18')],'value':_0x3be055[_0x58c086[_0x2109('0x16')]][_0x2109('0x1f')]()});}else if(_0x58c086[_0x2109('0x3c')]===_0x2109('0x44')&&_0x58c086[_0x2109('0x45')]&&_0x58c086[_0x2109('0x45')][_0x2109('0x26')]&&_0x58c086[_0x2109('0x18')]&&_0x58c086[_0x2109('0x3e')]){_0x3be055[_0x58c086[_0x2109('0x45')][_0x2109('0x26')][_0x2109('0x40')]()]&&_0x99a2b0[_0x2109('0x42')][_0x2109('0x17')]({'id':_0x58c086[_0x2109('0x18')],'value':_0x3be055[_0x58c086[_0x2109('0x45')][_0x2109('0x26')]['toLowerCase']()][_0x2109('0x1f')]()});}});}return _0x99a2b0;}function getConnection(_0x5843a9){return request({'method':'POST','form':{'method':_0x2109('0x46'),'input_type':'JSON','response_type':_0x2109('0x1a'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x5843a9[_0x2109('0x47')],'password':_0x5843a9['password'],'encryption':_0x2109('0x48')},'application':_0x2109('0x49')})}})[_0x2109('0x28')](function(_0x52800b){var _0x88e37a=_0x52800b;if(_0x88e37a['id']){def[_0x2109('0x4a')]=_0x88e37a['id'];return BPromise['resolve'](_0x88e37a);}else{throw new Error(util['format'](_0x2109('0x4b'),_0x5843a9['id']));}});}function setRelationship(_0x9b173a,_0x42168e,_0x5b354e,_0x3ec390){return request({'form':{'method':_0x2109('0x4c'),'input_type':_0x2109('0x1a'),'response_type':_0x2109('0x1a'),'rest_data':JSON['stringify']({'session':_0x9b173a['id'],'module_name':_0x2109('0x1c'),'module_id':_0x5b354e['id'],'link_field_name':_0x3ec390,'related_ids':[_0x42168e['id']]})}});}exports['queue']=function(_0x56f5d7,_0x40407b,_0x197339,_0x698ab5,_0x3d03d4,_0x1a7cc5){var _0x2e5949,_0x1ffbd2,_0x1e242a,_0x596af6;_0x1a7cc5[_0x2109('0x4d')]=intUtil['stripTrailingSlash'](_0x1a7cc5[_0x2109('0x4d')]);_0x1a7cc5[_0x2109('0x4e')]=intUtil[_0x2109('0x4f')](_0x1a7cc5['serverUrl']);def[_0x2109('0x50')]=util[_0x2109('0x1d')]('%s/service/v4_1/rest.php',_0x1a7cc5[_0x2109('0x4d')]);if(_0x3d03d4&&_0x3d03d4[_0x2109('0x51')]){logger[_0x2109('0x23')](_0x2109('0x52'),_0x2109('0x53'));_0x40407b[_0x2109('0x54')]=util['format'](_0x2109('0x55'),_0x1a7cc5['serverUrl'],_0x40407b[_0x2109('0x56')],md5(_0x40407b['uniqueid']));}else{_0x40407b['recordingURL']='';}return getConnection(_0x1a7cc5)['then'](function(_0x9f8c7c){_0x596af6=_0x9f8c7c;return getUser(_0x1a7cc5,_0x698ab5[_0x2109('0x26')],_0x596af6);})[_0x2109('0x28')](function(_0x2cbb78){_0x2e5949=_0x2cbb78;logger['info'](_0x2109('0x57'),_0x2e5949['id']);return getEndUser(_0x1a7cc5,_0x40407b[_0x2109('0x58')],_0x40407b['calleridnum'],_0x596af6);})[_0x2109('0x28')](function(_0x7f8ee7){_0x1ffbd2=_0x7f8ee7;logger[_0x2109('0x23')](_0x2109('0x59'),_0x1ffbd2['id']);return getTicket(_0x1a7cc5,_0x2e5949,_0x1ffbd2,_0x197339,_0x40407b,_0x197339[_0x2109('0x5a')],_0x596af6,_0x2109('0x5b'));})[_0x2109('0x28')](function(_0x45bf40){_0x1e242a=_0x45bf40;logger[_0x2109('0x23')](_0x2109('0x5c'));logger[_0x2109('0x23')]('The\x20Ticket\x20ID\x20is:',_0x1e242a['id']);return setRelationship(_0x596af6,_0x2e5949,_0x1e242a,_0x2109('0x5d'));})[_0x2109('0x28')](function(){return setRelationship(_0x596af6,_0x1ffbd2,_0x1e242a,_0x2109('0x5e'));})['then'](function(){return getServerInfo(_0x596af6);})[_0x2109('0x28')](function(_0x2fad91){var _0x4e16cb=parseInt(_0x2fad91[_0x2109('0x5f')]['charAt'](0x0));var _0x1e2313=util['format']('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x1a7cc5[_0x2109('0x4d')],_0x1e242a['id']);if(_0x4e16cb>0x6){_0x1e2313=util['format'](_0x2109('0x60'),_0x1a7cc5[_0x2109('0x4d')],_0x1e242a['id']);}logger[_0x2109('0x23')]('[QUEUE]',_0x2109('0x61'));emit(util[_0x2109('0x1d')](_0x2109('0x62'),_0x698ab5[_0x2109('0x26')]),_0x2109('0x63'),{'uri':_0x1e2313});})[_0x2109('0x64')](function(_0x267bf6){logger['error'](_0x2109('0x52'),JSON[_0x2109('0x1b')](_0x267bf6));});};exports[_0x2109('0x65')]=function(_0x1dc0bb,_0x4b6361,_0x13c16a,_0x17b537,_0xed93c7,_0x4e7448,_0x181d36){var _0x2e198b,_0x5f44b5,_0x351ebf,_0x439f3;_0x4e7448[_0x2109('0x4d')]=intUtil[_0x2109('0x4f')](_0x4e7448[_0x2109('0x4d')]);_0x4e7448[_0x2109('0x4e')]=intUtil[_0x2109('0x4f')](_0x4e7448[_0x2109('0x4e')]);def[_0x2109('0x50')]=util[_0x2109('0x1d')](_0x2109('0x66'),_0x4e7448['remoteUri']);if(_0x181d36&&_0x181d36[_0x2109('0x67')]&&_0x181d36[_0x2109('0x67')]!=='none'){logger[_0x2109('0x23')](_0x2109('0x68'),_0x2109('0x53'));_0x4b6361[_0x2109('0x54')]=util[_0x2109('0x1d')](_0x2109('0x55'),_0x4e7448[_0x2109('0x4e')],_0x4b6361[_0x2109('0x56')],md5(_0x4b6361[_0x2109('0x56')]));}return getConnection(_0x4e7448)['then'](function(_0x5297b3){_0x439f3=_0x5297b3;return getUser(_0x4e7448,_0x17b537[_0x2109('0x26')],_0x439f3);})[_0x2109('0x28')](function(_0x41dcd7){_0x2e198b=_0x41dcd7;logger['info'](_0x2109('0x57'),_0x2e198b['id']);return getEndUser(_0x4e7448,_0x4b6361[_0x2109('0x69')],_0x4b6361[_0x2109('0x6a')],_0x439f3);})[_0x2109('0x28')](function(_0x24117f){_0x5f44b5=_0x24117f;logger[_0x2109('0x23')]('The\x20Enduser\x20ID\x20is:',_0x5f44b5['id']);return getTicket(_0x4e7448,_0x2e198b,_0x5f44b5,_0x13c16a,_0x4b6361,_0x13c16a['Fields'],_0x439f3,_0x2109('0x6b'));})[_0x2109('0x28')](function(_0x499a5a){_0x351ebf=_0x499a5a;logger['info'](_0x2109('0x5c'));logger['info'](_0x2109('0x6c'),_0x351ebf['id']);return setRelationship(_0x439f3,_0x2e198b,_0x351ebf,_0x2109('0x5d'));})[_0x2109('0x28')](function(){return setRelationship(_0x439f3,_0x5f44b5,_0x351ebf,_0x2109('0x5e'));})['then'](function(){return getServerInfo(_0x439f3);})[_0x2109('0x28')](function(_0x2a9f88){var _0x24f8fd=parseInt(_0x2a9f88['version']['charAt'](0x0));var _0x4f07af=util[_0x2109('0x1d')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x4e7448[_0x2109('0x4d')],_0x351ebf['id']);if(_0x24f8fd>0x6){_0x4f07af=util[_0x2109('0x1d')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x4e7448[_0x2109('0x4d')],_0x351ebf['id']);}logger[_0x2109('0x23')]('[OUTBOUND]',_0x2109('0x61'));emit(util[_0x2109('0x1d')](_0x2109('0x62'),_0x17b537['name']),_0x2109('0x63'),{'uri':_0x4f07af});})[_0x2109('0x64')](function(_0x3f6c58){logger['error'](_0x2109('0x68'),JSON[_0x2109('0x1b')](_0x3f6c58));});};exports[_0x2109('0x6d')]=function(_0x1d7489,_0x43a0ce,_0x4e9047,_0x2c7a96,_0x35a551,_0x45e0ed){var _0x3c2f97,_0x3c4af7,_0xdfdb5e,_0x5a302f;_0x45e0ed[_0x2109('0x4d')]=intUtil[_0x2109('0x4f')](_0x45e0ed[_0x2109('0x4d')]);_0x45e0ed[_0x2109('0x4e')]=intUtil[_0x2109('0x4f')](_0x45e0ed[_0x2109('0x4e')]);def['uri']=util[_0x2109('0x1d')](_0x2109('0x66'),_0x45e0ed['remoteUri']);if(_0x35a551&&_0x35a551[_0x2109('0x51')]){logger[_0x2109('0x23')](_0x2109('0x6e'),'Recording\x20is\x20enabled!');_0x43a0ce['recordingURL']=util[_0x2109('0x1d')](_0x2109('0x55'),_0x45e0ed[_0x2109('0x4e')],_0x43a0ce['uniqueid'],md5(_0x43a0ce[_0x2109('0x56')]));}else{_0x43a0ce['recordingURL']='';}return getConnection(_0x45e0ed)[_0x2109('0x28')](function(_0x5cc4a0){_0x5a302f=_0x5cc4a0;if(!_[_0x2109('0x22')](_0x2c7a96)){return getUser(_0x45e0ed,_0x2c7a96['name'],_0x5a302f);}else{return getUser(_0x45e0ed,null,_0x5a302f);}})['then'](function(_0x1ae5e3){_0x3c2f97=_0x1ae5e3;logger['info'](_0x2109('0x57'),_0x3c2f97['id']);return getEndUser(_0x45e0ed,_0x43a0ce[_0x2109('0x58')],_0x43a0ce[_0x2109('0x6f')],_0x5a302f);})[_0x2109('0x28')](function(_0x40c46b){_0x3c4af7=_0x40c46b;logger[_0x2109('0x23')](_0x2109('0x59'),_0x3c4af7['id']);return getTicket(_0x45e0ed,_0x3c2f97,_0x3c4af7,_0x4e9047,_0x43a0ce,_0x4e9047[_0x2109('0x5a')],_0x5a302f,'Inbound');})[_0x2109('0x28')](function(_0x324eef){_0xdfdb5e=_0x324eef;logger[_0x2109('0x23')](_0x2109('0x5c'));logger['info'](_0x2109('0x6c'),_0xdfdb5e['id']);return setRelationship(_0x5a302f,_0x3c2f97,_0xdfdb5e,'users');})[_0x2109('0x28')](function(){return setRelationship(_0x5a302f,_0x3c4af7,_0xdfdb5e,'contacts');})[_0x2109('0x28')](function(){return getServerInfo(_0x5a302f);})[_0x2109('0x64')](function(_0x361d8c){logger[_0x2109('0x70')](_0x2109('0x6e'),JSON[_0x2109('0x1b')](_0x361d8c));});}; \ No newline at end of file +var _0x76cb=['destcalleridnum','Fields','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','[OUTBOUND]','[ABANDONED]','calleridname','lodash','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','created_by','description','Descriptions','date_start','slice','duration_hours','duration_minutes','parent_id','Contacts','parent_name','length','forEach','variableName','idField','set_entry','JSON','stringify','format','apiKey','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','name_value_list','value','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','resolve','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!','','Caller\x20-\x20%s','Enduser\x20created.','debug','merge','map','string','nameField','customField','toLowerCase','toString','type','custom_fields','push','content','customVariable','Variable','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','Calls','queue','stripTrailingSlash','remoteUri','serverUrl','%s/service/v4_1/rest.php','monitor_format','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','version','charAt','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','outbound','uri','recordingFormat','none','destcalleridname'];(function(_0x80795e,_0x587d29){var _0xa750f5=function(_0x2c0418){while(--_0x2c0418){_0x80795e['push'](_0x80795e['shift']());}};_0xa750f5(++_0x587d29);}(_0x76cb,0x86));var _0xb76c=function(_0x3d4ef1,_0x5a957c){_0x3d4ef1=_0x3d4ef1-0x0;var _0x409423=_0x76cb[_0x3d4ef1];return _0x409423;};'use strict';var _=require(_0xb76c('0x0'));var rp=require(_0xb76c('0x1'));var BPromise=require(_0xb76c('0x2'));var md5=require(_0xb76c('0x3'));var util=require(_0xb76c('0x4'));var Redis=require(_0xb76c('0x5'));var intUtil=require(_0xb76c('0x6'));var config=require(_0xb76c('0x7'));var logger=require(_0xb76c('0x8'))(_0xb76c('0x9'));config[_0xb76c('0xa')]=_[_0xb76c('0xb')](config[_0xb76c('0xa')],{'host':_0xb76c('0xc'),'port':0x18eb});var io=require(_0xb76c('0xd'))(new Redis(config['redis']));var def={'method':_0xb76c('0xe'),'json':!![]};function emit(_0x1d05dd,_0x31735b,_0xbb7171){io['to'](_0x1d05dd)[_0xb76c('0xf')](_0x31735b,_0xbb7171);}function getTicket(_0x692e3b,_0x4e90b0,_0x3b640d,_0x578871,_0xb5de8f,_0x44b68a,_0x3c39f9,_0x1411c3){logger[_0xb76c('0x10')](_0xb76c('0x11'));var _0x36e881=new Date();var _0x3214fa=[{'name':_0xb76c('0x12'),'value':intUtil[_0xb76c('0x13')](_0x578871[_0xb76c('0x14')],_0xb5de8f,'\x20')},{'name':_0xb76c('0x15'),'value':_0x4e90b0['id']},{'name':_0xb76c('0x16'),'value':_0x4e90b0['id']},{'name':_0xb76c('0x17'),'value':intUtil['getString'](_0x578871[_0xb76c('0x18')],_0xb5de8f,'\x0a')},{'name':_0xb76c('0x19'),'value':_0x36e881['toISOString']()[_0xb76c('0x1a')](0x0,0x13)['replace']('T','\x20')},{'name':_0xb76c('0x1b'),'value':'0'},{'name':_0xb76c('0x1c'),'value':'15'},{'name':_0xb76c('0x1d'),'value':_0x3b640d['id']},{'name':'parent_type','value':_0xb76c('0x1e')},{'name':_0xb76c('0x1f'),'value':_0x3b640d['name']},{'name':'direction','value':_0x1411c3}];if(_0x44b68a[_0xb76c('0x20')]){_[_0xb76c('0x21')](_0x44b68a,function(_0x58a4b2){if(_0xb5de8f[_0x58a4b2[_0xb76c('0x22')]]){_0x3214fa['push']({'name':_0x58a4b2[_0xb76c('0x23')],'value':_0xb5de8f[_0x58a4b2[_0xb76c('0x22')]]});}});}return request({'form':{'method':_0xb76c('0x24'),'input_type':_0xb76c('0x25'),'response_type':_0xb76c('0x25'),'rest_data':JSON[_0xb76c('0x26')]({'session':_0x3c39f9['id'],'module_name':'Calls','name_value_list':_0x3214fa})}});}function getAuth(_0x4f6bc6){return util[_0xb76c('0x27')]('Basic\x20%s',new Buffer(_0x4f6bc6[_0xb76c('0x28')]+':X')['toString'](_0xb76c('0x29')));}function getServerInfo(_0x31be2d){return request({'form':{'method':_0xb76c('0x2a'),'input_type':_0xb76c('0x25'),'response_type':_0xb76c('0x25'),'rest_data':JSON[_0xb76c('0x26')]({'session':_0x31be2d['id']})}});}function getUser(_0x10db60,_0x3d56e9,_0x31a1b5){if(!_[_0xb76c('0x2b')](_0x3d56e9)){logger['info'](_0xb76c('0x2c'),_0x3d56e9);return request({'form':{'method':_0xb76c('0x2d'),'input_type':_0xb76c('0x25'),'response_type':_0xb76c('0x25'),'rest_data':JSON[_0xb76c('0x26')]({'session':_0x31a1b5['id'],'module_name':_0xb76c('0x2e'),'query':util[_0xb76c('0x27')](_0xb76c('0x2f'),_0x3d56e9),'order_by':'','offset':'0','select_fields':['id',_0xb76c('0x12'),_0xb76c('0x30')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xb76c('0x31')](function(_0x1f7ec1){if(_0x1f7ec1[_0xb76c('0x32')][_0xb76c('0x20')]){var _0x17b4eb=_['find'](_0x1f7ec1[_0xb76c('0x32')],function(_0x3c761b){return _0x3c761b[_0xb76c('0x33')][_0xb76c('0x30')][_0xb76c('0x34')]===_0x3d56e9;});if(_0x17b4eb){logger[_0xb76c('0x10')](_0xb76c('0x35'));return BPromise['resolve']({'id':_0x17b4eb[_0xb76c('0x33')]['id'][_0xb76c('0x34')],'name':_0x17b4eb['name_value_list'][_0xb76c('0x12')][_0xb76c('0x34')]});}}logger['info'](_0xb76c('0x36'));return BPromise[_0xb76c('0x37')]({'id':_0x31a1b5[_0xb76c('0x33')][_0xb76c('0x38')][_0xb76c('0x34')],'name':_0x31a1b5['name_value_list'][_0xb76c('0x30')][_0xb76c('0x34')]});});}else{logger[_0xb76c('0x10')](_0xb76c('0x39'));return BPromise[_0xb76c('0x37')]({'id':_0x31a1b5[_0xb76c('0x33')][_0xb76c('0x38')][_0xb76c('0x34')],'name':_0x31a1b5[_0xb76c('0x33')][_0xb76c('0x30')]['value']});}}function getEndUser(_0x7102d2,_0x524926,_0x3d73a8,_0x208837){logger[_0xb76c('0x10')](_0xb76c('0x3a'),_0x3d73a8);return request({'form':{'method':_0xb76c('0x2d'),'input_type':_0xb76c('0x25'),'response_type':_0xb76c('0x25'),'rest_data':JSON[_0xb76c('0x26')]({'session':_0x208837['id'],'module_name':_0xb76c('0x1e'),'query':util[_0xb76c('0x27')](_0xb76c('0x3b'),_0x3d73a8),'order_by':'','offset':'0','select_fields':['id',_0xb76c('0x12'),_0xb76c('0x3c')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xb76c('0x31')](function(_0x99ca0f){if(_0x99ca0f['entry_list'][_0xb76c('0x20')]){var _0x2a67fa=_[_0xb76c('0x3d')](_0x99ca0f['entry_list'],function(_0x35a2ea){return _0x35a2ea['name_value_list'][_0xb76c('0x3c')][_0xb76c('0x34')]===_0x3d73a8;});if(_0x2a67fa){logger[_0xb76c('0x10')](_0xb76c('0x3e'));return BPromise['resolve']({'id':_0x2a67fa[_0xb76c('0x33')]['id'][_0xb76c('0x34')],'name':_0x2a67fa['name_value_list'][_0xb76c('0x12')][_0xb76c('0x34')],'phone':_0x2a67fa['name_value_list'][_0xb76c('0x3c')][_0xb76c('0x34')]});}}else{logger[_0xb76c('0x10')](_0xb76c('0x3f'));return request({'form':{'method':_0xb76c('0x24'),'input_type':_0xb76c('0x25'),'response_type':_0xb76c('0x25'),'rest_data':JSON[_0xb76c('0x26')]({'session':_0x208837['id'],'module_name':_0xb76c('0x1e'),'name_value_list':[{'name':'first_name','value':_0x524926!==_0xb76c('0x40')?_0x524926:util[_0xb76c('0x27')](_0xb76c('0x41'),_0x3d73a8)},{'name':_0xb76c('0x3c'),'value':_0x3d73a8}]})}})['then'](function(_0x3fe7db){logger[_0xb76c('0x10')](_0xb76c('0x42'));return BPromise[_0xb76c('0x37')]({'id':_0x3fe7db['id'],'name':_0x3fe7db[_0xb76c('0x32')]['first_name'][_0xb76c('0x34')],'phone':_0x3fe7db['entry_list']['phone_home'][_0xb76c('0x34')]});});}});}function request(_0x30856b){logger[_0xb76c('0x43')]('[HTTP]',JSON[_0xb76c('0x26')](_0x30856b));return rp(_[_0xb76c('0x44')](def,_0x30856b));}function getTags(_0x49f45f,_0x3a12b1){var _0x148bd5=[];if(_0x49f45f&&_0x49f45f[_0xb76c('0x20')]>0x0){_0x148bd5=_[_0xb76c('0x45')](_0x49f45f,_0x3a12b1);}return _0x148bd5;}function getCustomFields(_0x43e020,_0x540316){var _0x2fe5cf=[];var _0x366b79={'custom_fields':[]};if(_0x43e020[_0xb76c('0x20')]>0x0){_[_0xb76c('0x21')](_0x43e020,function(_0x18051e){if(_0x18051e['type']===_0xb76c('0x46')&&_0x18051e[_0xb76c('0x47')]&&!_0x18051e[_0xb76c('0x48')]){_0x366b79[_0x18051e[_0xb76c('0x47')][_0xb76c('0x49')]()]=_0x18051e['content'][_0xb76c('0x4a')]();}else if(_0x18051e[_0xb76c('0x4b')]==='string'&&_0x18051e[_0xb76c('0x23')]&&_0x18051e[_0xb76c('0x48')]){_0x366b79[_0xb76c('0x4c')][_0xb76c('0x4d')]({'id':_0x18051e[_0xb76c('0x23')],'value':_0x18051e[_0xb76c('0x4e')][_0xb76c('0x4a')]()});}else if(_0x18051e[_0xb76c('0x4b')]==='variable'&&_0x18051e[_0xb76c('0x22')]&&_0x18051e[_0xb76c('0x23')]&&_0x18051e[_0xb76c('0x48')]){_0x540316[_0x18051e[_0xb76c('0x22')]]&&_0x366b79[_0xb76c('0x4c')][_0xb76c('0x4d')]({'id':_0x18051e[_0xb76c('0x23')],'value':_0x540316[_0x18051e['variableName']][_0xb76c('0x4a')]()});}else if(_0x18051e[_0xb76c('0x4b')]===_0xb76c('0x4f')&&_0x18051e[_0xb76c('0x50')]&&_0x18051e[_0xb76c('0x50')][_0xb76c('0x12')]&&_0x18051e[_0xb76c('0x23')]&&_0x18051e[_0xb76c('0x48')]){_0x540316[_0x18051e[_0xb76c('0x50')][_0xb76c('0x12')]['toLowerCase']()]&&_0x366b79['custom_fields'][_0xb76c('0x4d')]({'id':_0x18051e[_0xb76c('0x23')],'value':_0x540316[_0x18051e['Variable'][_0xb76c('0x12')][_0xb76c('0x49')]()]['toString']()});}});}return _0x366b79;}function getConnection(_0x2cb42b){return request({'method':_0xb76c('0xe'),'form':{'method':_0xb76c('0x51'),'input_type':'JSON','response_type':_0xb76c('0x25'),'rest_data':JSON[_0xb76c('0x26')]({'user_auth':{'user_name':_0x2cb42b[_0xb76c('0x52')],'password':_0x2cb42b[_0xb76c('0x53')],'encryption':_0xb76c('0x54')},'application':_0xb76c('0x55')})}})[_0xb76c('0x31')](function(_0x25e14b){var _0x1a2284=_0x25e14b;if(_0x1a2284['id']){def[_0xb76c('0x56')]=_0x1a2284['id'];return BPromise['resolve'](_0x1a2284);}else{throw new Error(util[_0xb76c('0x27')](_0xb76c('0x57'),_0x2cb42b['id']));}});}function setRelationship(_0x1b279b,_0x5656fe,_0x14099a,_0x1b0f5a){return request({'form':{'method':_0xb76c('0x58'),'input_type':_0xb76c('0x25'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x1b279b['id'],'module_name':_0xb76c('0x59'),'module_id':_0x14099a['id'],'link_field_name':_0x1b0f5a,'related_ids':[_0x5656fe['id']]})}});}exports[_0xb76c('0x5a')]=function(_0xc0fe5a,_0x47dc32,_0x22a7eb,_0x194c1f,_0x345602,_0x59d745){var _0x3fbc8f,_0x371baa,_0x152901,_0xacd913;_0x59d745['remoteUri']=intUtil[_0xb76c('0x5b')](_0x59d745[_0xb76c('0x5c')]);_0x59d745[_0xb76c('0x5d')]=intUtil[_0xb76c('0x5b')](_0x59d745[_0xb76c('0x5d')]);def['uri']=util[_0xb76c('0x27')](_0xb76c('0x5e'),_0x59d745[_0xb76c('0x5c')]);if(_0x345602&&_0x345602[_0xb76c('0x5f')]){logger[_0xb76c('0x10')]('[QUEUE]',_0xb76c('0x60'));_0x47dc32['recordingURL']=util[_0xb76c('0x27')](_0xb76c('0x61'),_0x59d745['serverUrl'],_0x47dc32[_0xb76c('0x62')],md5(_0x47dc32[_0xb76c('0x62')]));}else{_0x47dc32[_0xb76c('0x63')]='';}return getConnection(_0x59d745)[_0xb76c('0x31')](function(_0x24c12b){_0xacd913=_0x24c12b;return getUser(_0x59d745,_0x194c1f[_0xb76c('0x12')],_0xacd913);})[_0xb76c('0x31')](function(_0x1b8952){_0x3fbc8f=_0x1b8952;logger[_0xb76c('0x10')](_0xb76c('0x64'),_0x3fbc8f['id']);return getEndUser(_0x59d745,_0x47dc32['calleridname'],_0x47dc32[_0xb76c('0x65')],_0xacd913);})['then'](function(_0x369fab){_0x371baa=_0x369fab;logger[_0xb76c('0x10')](_0xb76c('0x66'),_0x371baa['id']);return getTicket(_0x59d745,_0x3fbc8f,_0x371baa,_0x22a7eb,_0x47dc32,_0x22a7eb['Fields'],_0xacd913,_0xb76c('0x67'));})[_0xb76c('0x31')](function(_0x511a0b){_0x152901=_0x511a0b;logger['info'](_0xb76c('0x68'));logger[_0xb76c('0x10')](_0xb76c('0x69'),_0x152901['id']);return setRelationship(_0xacd913,_0x3fbc8f,_0x152901,_0xb76c('0x6a'));})[_0xb76c('0x31')](function(){return setRelationship(_0xacd913,_0x371baa,_0x152901,_0xb76c('0x6b'));})['then'](function(){return getServerInfo(_0xacd913);})[_0xb76c('0x31')](function(_0x46ba59){var _0xbd2bc2=parseInt(_0x46ba59[_0xb76c('0x6c')][_0xb76c('0x6d')](0x0));var _0x321904=util['format']('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x59d745[_0xb76c('0x5c')],_0x152901['id']);if(_0xbd2bc2>0x6){_0x321904=util[_0xb76c('0x27')](_0xb76c('0x6e'),_0x59d745[_0xb76c('0x5c')],_0x152901['id']);}logger[_0xb76c('0x10')](_0xb76c('0x6f'),_0xb76c('0x70'));emit(util[_0xb76c('0x27')](_0xb76c('0x71'),_0x194c1f[_0xb76c('0x12')]),_0xb76c('0x72'),{'uri':_0x321904});})[_0xb76c('0x73')](function(_0x2db68c){logger[_0xb76c('0x74')](_0xb76c('0x6f'),JSON[_0xb76c('0x26')](_0x2db68c));});};exports[_0xb76c('0x75')]=function(_0xb96136,_0x2385f0,_0x1a8673,_0x267983,_0x32f520,_0x2c97a5,_0x3894e9){var _0x59a0d0,_0x53243a,_0x14ce06,_0x4f2634;_0x2c97a5[_0xb76c('0x5c')]=intUtil[_0xb76c('0x5b')](_0x2c97a5[_0xb76c('0x5c')]);_0x2c97a5['serverUrl']=intUtil[_0xb76c('0x5b')](_0x2c97a5[_0xb76c('0x5d')]);def[_0xb76c('0x76')]=util[_0xb76c('0x27')](_0xb76c('0x5e'),_0x2c97a5['remoteUri']);if(_0x3894e9&&_0x3894e9[_0xb76c('0x77')]&&_0x3894e9[_0xb76c('0x77')]!==_0xb76c('0x78')){logger[_0xb76c('0x10')]('[OUTBOUND]',_0xb76c('0x60'));_0x2385f0[_0xb76c('0x63')]=util[_0xb76c('0x27')](_0xb76c('0x61'),_0x2c97a5[_0xb76c('0x5d')],_0x2385f0['uniqueid'],md5(_0x2385f0['uniqueid']));}return getConnection(_0x2c97a5)['then'](function(_0x3a5013){_0x4f2634=_0x3a5013;return getUser(_0x2c97a5,_0x267983[_0xb76c('0x12')],_0x4f2634);})[_0xb76c('0x31')](function(_0x2f38b7){_0x59a0d0=_0x2f38b7;logger[_0xb76c('0x10')](_0xb76c('0x64'),_0x59a0d0['id']);return getEndUser(_0x2c97a5,_0x2385f0[_0xb76c('0x79')],_0x2385f0[_0xb76c('0x7a')],_0x4f2634);})[_0xb76c('0x31')](function(_0x3bed5a){_0x53243a=_0x3bed5a;logger['info'](_0xb76c('0x66'),_0x53243a['id']);return getTicket(_0x2c97a5,_0x59a0d0,_0x53243a,_0x1a8673,_0x2385f0,_0x1a8673[_0xb76c('0x7b')],_0x4f2634,'Outbound');})['then'](function(_0x3db791){_0x14ce06=_0x3db791;logger['info']('Ticket\x20created!');logger[_0xb76c('0x10')](_0xb76c('0x69'),_0x14ce06['id']);return setRelationship(_0x4f2634,_0x59a0d0,_0x14ce06,_0xb76c('0x6a'));})[_0xb76c('0x31')](function(){return setRelationship(_0x4f2634,_0x53243a,_0x14ce06,_0xb76c('0x6b'));})[_0xb76c('0x31')](function(){return getServerInfo(_0x4f2634);})['then'](function(_0x5975b3){var _0x2b5f80=parseInt(_0x5975b3[_0xb76c('0x6c')][_0xb76c('0x6d')](0x0));var _0x150770=util['format'](_0xb76c('0x7c'),_0x2c97a5[_0xb76c('0x5c')],_0x14ce06['id']);if(_0x2b5f80>0x6){_0x150770=util[_0xb76c('0x27')](_0xb76c('0x6e'),_0x2c97a5['remoteUri'],_0x14ce06['id']);}logger['info'](_0xb76c('0x7d'),_0xb76c('0x70'));emit(util[_0xb76c('0x27')](_0xb76c('0x71'),_0x267983['name']),_0xb76c('0x72'),{'uri':_0x150770});})['catch'](function(_0x306be5){logger[_0xb76c('0x74')](_0xb76c('0x7d'),JSON[_0xb76c('0x26')](_0x306be5));});};exports['abandoned']=function(_0x2acf56,_0x46f76c,_0x3d9289,_0x1de1e9,_0x2b9ed5,_0x1239e5){var _0x5f34a0,_0x520dfc,_0x7df9e1,_0x30ef3e;_0x1239e5[_0xb76c('0x5c')]=intUtil[_0xb76c('0x5b')](_0x1239e5['remoteUri']);_0x1239e5[_0xb76c('0x5d')]=intUtil[_0xb76c('0x5b')](_0x1239e5[_0xb76c('0x5d')]);def[_0xb76c('0x76')]=util['format'](_0xb76c('0x5e'),_0x1239e5[_0xb76c('0x5c')]);if(_0x2b9ed5&&_0x2b9ed5[_0xb76c('0x5f')]){logger[_0xb76c('0x10')](_0xb76c('0x7e'),_0xb76c('0x60'));_0x46f76c[_0xb76c('0x63')]=util[_0xb76c('0x27')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1239e5[_0xb76c('0x5d')],_0x46f76c[_0xb76c('0x62')],md5(_0x46f76c[_0xb76c('0x62')]));}else{_0x46f76c[_0xb76c('0x63')]='';}return getConnection(_0x1239e5)[_0xb76c('0x31')](function(_0x40a60f){_0x30ef3e=_0x40a60f;if(!_[_0xb76c('0x2b')](_0x1de1e9)){return getUser(_0x1239e5,_0x1de1e9[_0xb76c('0x12')],_0x30ef3e);}else{return getUser(_0x1239e5,null,_0x30ef3e);}})[_0xb76c('0x31')](function(_0x394e77){_0x5f34a0=_0x394e77;logger[_0xb76c('0x10')](_0xb76c('0x64'),_0x5f34a0['id']);return getEndUser(_0x1239e5,_0x46f76c[_0xb76c('0x7f')],_0x46f76c[_0xb76c('0x65')],_0x30ef3e);})[_0xb76c('0x31')](function(_0x30e3b6){_0x520dfc=_0x30e3b6;logger['info'](_0xb76c('0x66'),_0x520dfc['id']);return getTicket(_0x1239e5,_0x5f34a0,_0x520dfc,_0x3d9289,_0x46f76c,_0x3d9289[_0xb76c('0x7b')],_0x30ef3e,_0xb76c('0x67'));})[_0xb76c('0x31')](function(_0x443924){_0x7df9e1=_0x443924;logger[_0xb76c('0x10')](_0xb76c('0x68'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x7df9e1['id']);return setRelationship(_0x30ef3e,_0x5f34a0,_0x7df9e1,_0xb76c('0x6a'));})[_0xb76c('0x31')](function(){return setRelationship(_0x30ef3e,_0x520dfc,_0x7df9e1,_0xb76c('0x6b'));})[_0xb76c('0x31')](function(){return getServerInfo(_0x30ef3e);})[_0xb76c('0x73')](function(_0x19a5bc){logger[_0xb76c('0x74')](_0xb76c('0x7e'),JSON['stringify'](_0x19a5bc));});}; \ 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 61a969b..294432c 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 _0xbfbf=['lastIndexOf','isNil','test','getString','length','sortBy','type','string','push','content','variable','variableName','customVariable','Variable','name','toLowerCase','toString','keyValue','keyType','key','format','%s:\x20%s','join','stripTrailingSlash','slice','substring'];(function(_0x1c6efd,_0xb2f3cd){var _0x53a918=function(_0x14c19b){while(--_0x14c19b){_0x1c6efd['push'](_0x1c6efd['shift']());}};_0x53a918(++_0xb2f3cd);}(_0xbfbf,0x85));var _0xfbfb=function(_0x3c3957,_0x1358a7){_0x3c3957=_0x3c3957-0x0;var _0x115d98=_0xbfbf[_0x3c3957];return _0x115d98;};'use strict';var _=require('lodash');var util=require('util');exports[_0xfbfb('0x0')]=function(_0x5bef31,_0x324661,_0x225433){var _0x406b66=[];if(_0x5bef31[_0xfbfb('0x1')]>0x0){var _0x496c5d=_[_0xfbfb('0x2')](_0x5bef31,['id']);for(var _0x33f13c=0x0;_0x33f13c<_0x496c5d[_0xfbfb('0x1')];_0x33f13c++){var _0x35e5a8=_0x496c5d[_0x33f13c];if(_0x35e5a8[_0xfbfb('0x3')]===_0xfbfb('0x4')){_0x406b66[_0xfbfb('0x5')](_0x35e5a8[_0xfbfb('0x6')]);}else if(_0x35e5a8[_0xfbfb('0x3')]===_0xfbfb('0x7')&&_0x35e5a8[_0xfbfb('0x8')]){_0x324661[_0x35e5a8['variableName']]&&_0x406b66[_0xfbfb('0x5')](_0x324661[_0x35e5a8['variableName']]['toString']());}else if(_0x35e5a8[_0xfbfb('0x3')]===_0xfbfb('0x9')&&_0x35e5a8[_0xfbfb('0xa')]&&_0x35e5a8[_0xfbfb('0xa')][_0xfbfb('0xb')]){_0x324661[_0x35e5a8[_0xfbfb('0xa')][_0xfbfb('0xb')][_0xfbfb('0xc')]()]&&_0x406b66[_0xfbfb('0x5')](_0x324661[_0x35e5a8['Variable'][_0xfbfb('0xb')][_0xfbfb('0xc')]()][_0xfbfb('0xd')]());}else if(_0x35e5a8[_0xfbfb('0x3')]===_0xfbfb('0xe')){if(_0x35e5a8[_0xfbfb('0xf')]===_0xfbfb('0x4')&&_0x35e5a8[_0xfbfb('0x10')]){_0x406b66[_0xfbfb('0x5')](util[_0xfbfb('0x11')]('%s:\x20%s',_0x35e5a8[_0xfbfb('0x10')],_0x35e5a8['keyContent']));}else if(_0x35e5a8[_0xfbfb('0xf')]===_0xfbfb('0x7')&&_0x35e5a8[_0xfbfb('0x8')]&&_0x35e5a8[_0xfbfb('0x10')]){_0x324661[_0x35e5a8[_0xfbfb('0x8')]]&&_0x406b66[_0xfbfb('0x5')](util[_0xfbfb('0x11')]('%s:\x20%s',_0x35e5a8[_0xfbfb('0x10')],_0x324661[_0x35e5a8[_0xfbfb('0x8')]]));}else if(_0x35e5a8['keyType']==='customVariable'&&_0x35e5a8[_0xfbfb('0xa')]&&_0x35e5a8[_0xfbfb('0xa')][_0xfbfb('0xb')]&&_0x35e5a8[_0xfbfb('0x10')]){_0x324661[_0x35e5a8['Variable'][_0xfbfb('0xb')]['toLowerCase']()]&&_0x406b66[_0xfbfb('0x5')](util['format'](_0xfbfb('0x12'),_0x35e5a8['key'],_0x324661[_0x35e5a8[_0xfbfb('0xa')]['name'][_0xfbfb('0xc')]()]));}}}}return _0x406b66[_0xfbfb('0x13')](_0x225433);};exports[_0xfbfb('0x14')]=function(_0x28bf4a){var _0x574d9f=_0x28bf4a[_0xfbfb('0x15')](-0x1);if(_0x574d9f==='/'){_0x28bf4a=_0x28bf4a[_0xfbfb('0x16')](0x0,_0x28bf4a[_0xfbfb('0x17')](_0x574d9f));}return _0x28bf4a;};exports['validateEmail']=function(_0x705c9f){if(!_[_0xfbfb('0x18')](_0x705c9f)&&_0x705c9f!==''){var _0x5a77d0=/^(([^<>()\[\]\\.,;:\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 _0x5a77d0[_0xfbfb('0x19')](String(_0x705c9f)[_0xfbfb('0xc')]());}else{return![];}}; \ No newline at end of file +var _0x261b=['getString','length','sortBy','content','variable','variableName','push','toString','type','customVariable','Variable','name','toLowerCase','keyType','key','format','%s:\x20%s','keyContent','stripTrailingSlash','substring','isNil','test','util'];(function(_0x30ba61,_0x48b905){var _0x7300ad=function(_0x3b4f73){while(--_0x3b4f73){_0x30ba61['push'](_0x30ba61['shift']());}};_0x7300ad(++_0x48b905);}(_0x261b,0xe5));var _0xb261=function(_0x1682a8,_0x2a27f8){_0x1682a8=_0x1682a8-0x0;var _0x21a36d=_0x261b[_0x1682a8];return _0x21a36d;};'use strict';var _=require('lodash');var util=require(_0xb261('0x0'));exports[_0xb261('0x1')]=function(_0x5377ad,_0xcd52f9,_0x2337e2){var _0x38bbee=[];if(_0x5377ad[_0xb261('0x2')]>0x0){var _0x294e24=_[_0xb261('0x3')](_0x5377ad,['id']);for(var _0x4391a5=0x0;_0x4391a5<_0x294e24[_0xb261('0x2')];_0x4391a5++){var _0x2cdefb=_0x294e24[_0x4391a5];if(_0x2cdefb['type']==='string'){_0x38bbee['push'](_0x2cdefb[_0xb261('0x4')]);}else if(_0x2cdefb['type']===_0xb261('0x5')&&_0x2cdefb[_0xb261('0x6')]){_0xcd52f9[_0x2cdefb[_0xb261('0x6')]]&&_0x38bbee[_0xb261('0x7')](_0xcd52f9[_0x2cdefb[_0xb261('0x6')]][_0xb261('0x8')]());}else if(_0x2cdefb[_0xb261('0x9')]===_0xb261('0xa')&&_0x2cdefb[_0xb261('0xb')]&&_0x2cdefb[_0xb261('0xb')][_0xb261('0xc')]){_0xcd52f9[_0x2cdefb[_0xb261('0xb')][_0xb261('0xc')][_0xb261('0xd')]()]&&_0x38bbee[_0xb261('0x7')](_0xcd52f9[_0x2cdefb[_0xb261('0xb')][_0xb261('0xc')][_0xb261('0xd')]()]['toString']());}else if(_0x2cdefb[_0xb261('0x9')]==='keyValue'){if(_0x2cdefb[_0xb261('0xe')]==='string'&&_0x2cdefb[_0xb261('0xf')]){_0x38bbee[_0xb261('0x7')](util[_0xb261('0x10')](_0xb261('0x11'),_0x2cdefb[_0xb261('0xf')],_0x2cdefb[_0xb261('0x12')]));}else if(_0x2cdefb[_0xb261('0xe')]===_0xb261('0x5')&&_0x2cdefb[_0xb261('0x6')]&&_0x2cdefb['key']){_0xcd52f9[_0x2cdefb[_0xb261('0x6')]]&&_0x38bbee['push'](util[_0xb261('0x10')](_0xb261('0x11'),_0x2cdefb[_0xb261('0xf')],_0xcd52f9[_0x2cdefb[_0xb261('0x6')]]));}else if(_0x2cdefb[_0xb261('0xe')]===_0xb261('0xa')&&_0x2cdefb['Variable']&&_0x2cdefb[_0xb261('0xb')]['name']&&_0x2cdefb[_0xb261('0xf')]){_0xcd52f9[_0x2cdefb['Variable'][_0xb261('0xc')][_0xb261('0xd')]()]&&_0x38bbee[_0xb261('0x7')](util[_0xb261('0x10')]('%s:\x20%s',_0x2cdefb[_0xb261('0xf')],_0xcd52f9[_0x2cdefb[_0xb261('0xb')][_0xb261('0xc')][_0xb261('0xd')]()]));}}}}return _0x38bbee['join'](_0x2337e2);};exports[_0xb261('0x13')]=function(_0xa1d1e1){var _0x33d23b=_0xa1d1e1['slice'](-0x1);if(_0x33d23b==='/'){_0xa1d1e1=_0xa1d1e1[_0xb261('0x14')](0x0,_0xa1d1e1['lastIndexOf'](_0x33d23b));}return _0xa1d1e1;};exports['validateEmail']=function(_0x2030d0){if(!_[_0xb261('0x15')](_0x2030d0)&&_0x2030d0!==''){var _0x169bb2=/^(([^<>()\[\]\\.,;:\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 _0x169bb2[_0xb261('0x16')](String(_0x2030d0)[_0xb261('0xd')]());}else{return![];}}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/vtiger.js b/server/services/ami/trigger/integration/vtiger.js index 47aafbf..167cadc 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 _0x4024=['getEndUser','accessKey','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','queue','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','email','destcalleridname','destcalleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','abandoned','uniqueid','[ABANDONED]','lodash','request-promise','md5','util','./util','../../../../config/logger','vTiger','redis','localhost','socket.io-emitter','emit','forEach','type','idField','toString','variable','variableName','customVariable','Variable','name','toLowerCase','info','Open','getString','Subjects','Descriptions','format','%s/webservice.php','remoteUri','create','username','sessionName','HelpDesk','stringify','then','success','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','length','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','getUser','resolve','Searching\x20end\x20user\x20with\x20phone','GET','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;','firstname','POST','Contacts','Enduser\x20created.','lastname','phone'];(function(_0x2eff9b,_0x549f39){var _0x135814=function(_0x3d6d98){while(--_0x3d6d98){_0x2eff9b['push'](_0x2eff9b['shift']());}};_0x135814(++_0x549f39);}(_0x4024,0x89));var _0x4402=function(_0x29567e,_0x490b13){_0x29567e=_0x29567e-0x0;var _0x3aa82d=_0x4024[_0x29567e];return _0x3aa82d;};'use strict';var _=require(_0x4402('0x0'));var rp=require(_0x4402('0x1'));var BPromise=require('bluebird');var md5=require(_0x4402('0x2'));var util=require(_0x4402('0x3'));var Redis=require('ioredis');var intUtil=require(_0x4402('0x4'));var config=require('../../../../config/environment');var logger=require(_0x4402('0x5'))(_0x4402('0x6'));config['redis']=_['defaults'](config[_0x4402('0x7')],{'host':_0x4402('0x8'),'port':0x18eb});var io=require(_0x4402('0x9'))(new Redis(config['redis']));function emit(_0x3045ae,_0x5d7ca4,_0x5c0b70){io['to'](_0x3045ae)[_0x4402('0xa')](_0x5d7ca4,_0x5c0b70);}function getCustomFields(_0x4c6ca4,_0x4d2882){var _0x30fd34={};if(_0x4c6ca4['length']>0x0){_[_0x4402('0xb')](_0x4c6ca4,function(_0x4e1a7e){if(_0x4e1a7e[_0x4402('0xc')]==='string'&&_0x4e1a7e[_0x4402('0xd')]){_0x30fd34[_0x4e1a7e[_0x4402('0xd')]]=_0x4e1a7e['content'][_0x4402('0xe')]();}else if(_0x4e1a7e[_0x4402('0xc')]===_0x4402('0xf')&&_0x4e1a7e['variableName']&&_0x4e1a7e[_0x4402('0xd')]&&_0x4d2882[_0x4e1a7e[_0x4402('0x10')]]){_0x30fd34[_0x4e1a7e[_0x4402('0xd')]]=_0x4d2882[_0x4e1a7e[_0x4402('0x10')]][_0x4402('0xe')]();}else if(_0x4e1a7e[_0x4402('0xc')]===_0x4402('0x11')&&_0x4e1a7e[_0x4402('0x12')]&&_0x4e1a7e[_0x4402('0x12')][_0x4402('0x13')]&&_0x4e1a7e[_0x4402('0xd')]&&_0x4d2882[_0x4e1a7e[_0x4402('0x12')][_0x4402('0x13')][_0x4402('0x14')]()]){_0x30fd34[_0x4e1a7e[_0x4402('0xd')]]=_0x4d2882[_0x4e1a7e[_0x4402('0x12')][_0x4402('0x13')][_0x4402('0x14')]()][_0x4402('0xe')]();}});}return _0x30fd34;}function createTicket(_0x231382,_0x5b127f,_0x494389,_0x663ab7,_0x2a7afc,_0x5681c5,_0x756962){logger[_0x4402('0x15')]('Creating\x20new\x20ticket...');var _0x38b459=_['merge']({'parent_id':'','assigned_user_id':_0x5b127f['id'],'ticketpriorities':'Normal','ticketstatus':_0x4402('0x16'),'ticket_title':intUtil[_0x4402('0x17')](_0x663ab7[_0x4402('0x18')],_0x2a7afc,'\x20'),'description':intUtil['getString'](_0x663ab7[_0x4402('0x19')],_0x2a7afc,'\x0a'),'contact_id':_0x494389['id']},getCustomFields(_0x5681c5,_0x2a7afc));var _0x57a25e={'method':'POST','uri':util[_0x4402('0x1a')](_0x4402('0x1b'),_0x231382[_0x4402('0x1c')]),'form':{'operation':_0x4402('0x1d'),'username':_0x231382[_0x4402('0x1e')],'sessionName':_0x756962[_0x4402('0x1f')],'elementType':_0x4402('0x20'),'element':JSON[_0x4402('0x21')](_0x38b459)},'json':!![]};return request(_0x57a25e)[_0x4402('0x22')](function(_0x4d6846){if(_0x4d6846[_0x4402('0x23')]){return BPromise['resolve']({'id':_0x4d6846[_0x4402('0x24')]['id']});}else{throw new Error(util[_0x4402('0x1a')](_0x4402('0x25'),JSON[_0x4402('0x21')](_0x4d6846['error'])));}})[_0x4402('0x26')](function(_0x4e9cb5){var _0x59d52f=_0x4e9cb5[_0x4402('0x27')]||0x1f4;logger[_0x4402('0x28')](_0x4402('0x29'),_0x4402('0x2a'),_0x59d52f,JSON[_0x4402('0x21')](_0x4e9cb5));});}function getUser(_0x514e41,_0x41de44,_0x52e625){if(intUtil[_0x4402('0x2b')](_0x41de44)){logger[_0x4402('0x15')](_0x4402('0x2c'),_0x41de44);return request({'method':'GET','uri':util[_0x4402('0x1a')](_0x4402('0x1b'),_0x514e41[_0x4402('0x1c')]),'qs':{'operation':_0x4402('0x2d'),'username':_0x514e41[_0x4402('0x1e')],'sessionName':_0x52e625[_0x4402('0x1f')],'query':util[_0x4402('0x1a')](_0x4402('0x2e'),_0x41de44)},'json':!![]})[_0x4402('0x22')](function(_0xd46d0){if(_0xd46d0[_0x4402('0x23')]&&_0xd46d0['result'][_0x4402('0x2f')]){logger['info'](_0x4402('0x30'));return BPromise['resolve']({'id':_0xd46d0[_0x4402('0x24')][0x0]['id'],'email':_0xd46d0[_0x4402('0x24')][0x0][_0x4402('0x31')],'name':_0xd46d0[_0x4402('0x24')][0x0][_0x4402('0x32')]+'\x20'+_0xd46d0['result'][_0x4402('0x33')]});}else{logger[_0x4402('0x15')](_0x4402('0x34'));return BPromise['resolve']({'id':_0x52e625[_0x4402('0x35')],'email':_0x514e41[_0x4402('0x1e')],'name':'admin'});}})[_0x4402('0x26')](function(_0x437e83){var _0x2f59e9=_0x437e83[_0x4402('0x27')]||0x1f4;logger[_0x4402('0x28')](_0x4402('0x29'),_0x4402('0x36'),_0x2f59e9,JSON[_0x4402('0x21')](_0x437e83));});}else{logger[_0x4402('0x15')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x4402('0x37')]({'id':_0x52e625[_0x4402('0x35')],'email':_0x514e41[_0x4402('0x1e')],'name':'admin'})[_0x4402('0x26')](function(_0x1c1ac3){var _0x48ca82=_0x1c1ac3['statusCode']||0x1f4;logger[_0x4402('0x28')](_0x4402('0x29'),_0x4402('0x36'),_0x48ca82,JSON[_0x4402('0x21')](_0x1c1ac3));});}}function getEndUser(_0x5569a2,_0x4d8c1f,_0x4b0672,_0x3a5e62){logger[_0x4402('0x15')](_0x4402('0x38'),_0x4b0672);return request({'method':_0x4402('0x39'),'uri':util['format'](_0x4402('0x1b'),_0x5569a2[_0x4402('0x1c')]),'qs':{'operation':_0x4402('0x2d'),'username':_0x5569a2['username'],'sessionName':_0x3a5e62[_0x4402('0x1f')],'query':util['format'](_0x4402('0x3a'),_0x4b0672,_0x4b0672,_0x4b0672,_0x4b0672,_0x4b0672)},'json':!![]})[_0x4402('0x22')](function(_0x5c74b1){if(_0x5c74b1[_0x4402('0x23')]&&_0x5c74b1['result'][_0x4402('0x2f')]){logger[_0x4402('0x15')]('Enduser\x20found!');return BPromise[_0x4402('0x37')]({'id':_0x5c74b1[_0x4402('0x24')][0x0]['id'],'name':_0x5c74b1[_0x4402('0x24')][0x0][_0x4402('0x3b')]+'\x20'+_0x5c74b1['result'][0x0]['lastname'],'phone':_0x4b0672});}else{logger[_0x4402('0x15')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'method':_0x4402('0x3c'),'uri':util[_0x4402('0x1a')](_0x4402('0x1b'),_0x5569a2[_0x4402('0x1c')]),'form':{'operation':_0x4402('0x1d'),'sessionName':_0x3a5e62[_0x4402('0x1f')],'elementType':_0x4402('0x3d'),'element':JSON[_0x4402('0x21')]({'lastname':_0x4d8c1f,'phone':_0x4b0672,'assigned_user_id':'\x20'})},'json':!![]})[_0x4402('0x22')](function(_0x42812b){logger['info'](_0x4402('0x3e'));return BPromise[_0x4402('0x37')]({'id':_0x42812b['result']['id'],'name':_0x42812b[_0x4402('0x24')][_0x4402('0x3f')],'phone':_0x42812b['result'][_0x4402('0x40')]});})[_0x4402('0x26')](function(_0x1822c8){var _0x3278fc=_0x1822c8[_0x4402('0x27')]||0x1f4;logger['error'](_0x4402('0x29'),_0x4402('0x41'),_0x3278fc,JSON[_0x4402('0x21')](_0x1822c8));});}});}function getConnection(_0x443c53){var _0x17c236=_0x443c53[_0x4402('0x1e')];var _0x390682=_0x443c53[_0x4402('0x42')];return request({'method':_0x4402('0x39'),'uri':util[_0x4402('0x1a')](_0x4402('0x1b'),_0x443c53['remoteUri']),'qs':{'operation':_0x4402('0x43'),'username':_0x17c236},'json':!![]})['then'](function(_0xc45af6){if(_0xc45af6[_0x4402('0x23')]){return request({'method':'POST','uri':util[_0x4402('0x1a')](_0x4402('0x1b'),_0x443c53[_0x4402('0x1c')]),'form':{'operation':_0x4402('0x44'),'username':_0x17c236,'accessKey':md5(_0xc45af6[_0x4402('0x24')][_0x4402('0x45')]+_0x390682)},'json':!![]});}})['then'](function(_0xd0c9a5){if(_0xd0c9a5[_0x4402('0x23')]){return BPromise[_0x4402('0x37')](_0xd0c9a5[_0x4402('0x24')]);}else{throw new Error(util[_0x4402('0x1a')](_0x4402('0x46'),_0x443c53['id']));}})[_0x4402('0x26')](function(_0x2e3934){var _0x216488=_0x2e3934['statusCode']||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s','getConnection',_0x216488,JSON[_0x4402('0x21')](_0x2e3934));});}function request(_0x29e67b){logger[_0x4402('0x15')](_0x4402('0x47'),JSON['stringify'](_0x29e67b));return rp(_0x29e67b);}exports[_0x4402('0x48')]=function(_0x12d6de,_0x203b33,_0x2a4ea7,_0x196b2f,_0x352898,_0x12f1fa){var _0x53d306,_0x325b20,_0x2a8085,_0x38e6d1;_0x12f1fa[_0x4402('0x1c')]=intUtil[_0x4402('0x49')](_0x12f1fa[_0x4402('0x1c')]);if(_0x352898&&_0x352898['monitor_format']){logger[_0x4402('0x15')](_0x4402('0x4a'),_0x4402('0x4b'));_0x203b33[_0x4402('0x4c')]=util[_0x4402('0x1a')](_0x4402('0x4d'),_0x12f1fa[_0x4402('0x4e')],_0x203b33['uniqueid'],md5(_0x203b33['uniqueid']));}else{_0x203b33[_0x4402('0x4c')]='';}return getConnection(_0x12f1fa)[_0x4402('0x22')](function(_0x219472){_0x38e6d1=_0x219472;return getUser(_0x12f1fa,_0x196b2f['email'],_0x38e6d1);})['then'](function(_0x258926){_0x53d306=_0x258926;logger[_0x4402('0x15')](_0x4402('0x4f'),_0x53d306['id']);return getEndUser(_0x12f1fa,_0x203b33[_0x4402('0x50')],_0x203b33[_0x4402('0x51')],_0x38e6d1);})[_0x4402('0x22')](function(_0x248104){_0x325b20=_0x248104;logger[_0x4402('0x15')](_0x4402('0x52'),_0x325b20['id']);return createTicket(_0x12f1fa,_0x53d306,_0x325b20,_0x2a4ea7,_0x203b33,_0x2a4ea7[_0x4402('0x53')],_0x38e6d1);})[_0x4402('0x22')](function(_0x43e876){_0x2a8085=_0x43e876;logger[_0x4402('0x15')]('Ticket\x20created!');logger[_0x4402('0x15')]('The\x20Ticket\x20ID\x20is:',_0x2a8085['id']);var _0xe4530a=util['format'](_0x4402('0x54'),_0x12f1fa[_0x4402('0x1c')],_[_0x4402('0x55')](_0x2a8085['id'],'x')[0x1]);logger[_0x4402('0x15')](_0x4402('0x4a'),_0x4402('0x56'));emit(util['format'](_0x4402('0x57'),_0x196b2f[_0x4402('0x13')]),_0x4402('0x58'),{'uri':_0xe4530a});})[_0x4402('0x26')](function(_0xb341ab){logger['error'](_0x4402('0x4a'),JSON[_0x4402('0x21')](_0xb341ab));});};exports[_0x4402('0x59')]=function(_0xc15c0b,_0x309077,_0x3f8e3b,_0x33b605,_0x234070,_0x49bbe2,_0x11c1b8){var _0x323231,_0x53a9f3,_0x4771c8,_0x873eb2;_0x49bbe2['remoteUri']=intUtil['stripTrailingSlash'](_0x49bbe2[_0x4402('0x1c')]);_0x49bbe2[_0x4402('0x4e')]=intUtil[_0x4402('0x49')](_0x49bbe2['serverUrl']);if(_0x11c1b8&&_0x11c1b8[_0x4402('0x5a')]&&_0x11c1b8[_0x4402('0x5a')]!==_0x4402('0x5b')){logger['info'](_0x4402('0x5c'),_0x4402('0x4b'));_0x309077[_0x4402('0x4c')]=util['format'](_0x4402('0x4d'),_0x49bbe2[_0x4402('0x4e')],_0x309077['uniqueid'],md5(_0x309077['uniqueid']));}return getConnection(_0x49bbe2)[_0x4402('0x22')](function(_0x5f2c22){_0x873eb2=_0x5f2c22;return getUser(_0x49bbe2,_0x33b605[_0x4402('0x5d')],_0x873eb2);})[_0x4402('0x22')](function(_0x4a83ac){_0x323231=_0x4a83ac;logger['info'](_0x4402('0x4f'),_0x323231['id']);return getEndUser(_0x49bbe2,_0x309077[_0x4402('0x5e')],_0x309077[_0x4402('0x5f')],_0x873eb2);})[_0x4402('0x22')](function(_0x4ac95e){_0x53a9f3=_0x4ac95e;logger[_0x4402('0x15')](_0x4402('0x52'),_0x53a9f3['id']);return createTicket(_0x49bbe2,_0x323231,_0x53a9f3,_0x3f8e3b,_0x309077,_0x3f8e3b[_0x4402('0x53')],_0x873eb2);})[_0x4402('0x22')](function(_0x2b2b40){_0x4771c8=_0x2b2b40;logger[_0x4402('0x15')](_0x4402('0x60'));logger['info'](_0x4402('0x61'),_0x4771c8['id']);var _0x2ee6e8=util['format']('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x49bbe2[_0x4402('0x1c')],_['split'](_0x4771c8['id'],'x')[0x1]);logger[_0x4402('0x15')]('[OUTBOUND]',_0x4402('0x56'));emit(util[_0x4402('0x1a')](_0x4402('0x57'),_0x33b605[_0x4402('0x13')]),_0x4402('0x58'),{'uri':_0x2ee6e8});})[_0x4402('0x26')](function(_0x436a74){logger[_0x4402('0x28')](_0x4402('0x5c'),JSON[_0x4402('0x21')](_0x436a74));});};exports[_0x4402('0x62')]=function(_0xfd35f7,_0x441ee6,_0xcf5c20,_0x470624,_0x1d6af2,_0x53e553){var _0x2ce936,_0x144f5f,_0xccb64f,_0x50be1d;_0x53e553[_0x4402('0x1c')]=intUtil['stripTrailingSlash'](_0x53e553[_0x4402('0x1c')]);_0x53e553[_0x4402('0x4e')]=intUtil[_0x4402('0x49')](_0x53e553[_0x4402('0x4e')]);if(_0x1d6af2&&_0x1d6af2['monitor_format']){logger[_0x4402('0x15')]('[ABANDONED]',_0x4402('0x4b'));_0x441ee6[_0x4402('0x4c')]=util[_0x4402('0x1a')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x53e553[_0x4402('0x4e')],_0x441ee6['uniqueid'],md5(_0x441ee6[_0x4402('0x63')]));}else{_0x441ee6[_0x4402('0x4c')]='';}return getConnection(_0x53e553)[_0x4402('0x22')](function(_0x108288){_0x50be1d=_0x108288;return getUser(_0x53e553,'',_0x50be1d);})[_0x4402('0x22')](function(_0x1d0bf4){_0x2ce936=_0x1d0bf4;logger[_0x4402('0x15')](_0x4402('0x4f'),_0x2ce936['id']);return getEndUser(_0x53e553,_0x441ee6[_0x4402('0x50')],_0x441ee6['calleridnum'],_0x50be1d);})[_0x4402('0x22')](function(_0x55a767){_0x144f5f=_0x55a767;logger[_0x4402('0x15')](_0x4402('0x52'),_0x144f5f['id']);return createTicket(_0x53e553,_0x2ce936,_0x144f5f,_0xcf5c20,_0x441ee6,_0xcf5c20[_0x4402('0x53')],_0x50be1d);})[_0x4402('0x22')](function(_0x1f0917){_0xccb64f=_0x1f0917;logger[_0x4402('0x15')](_0x4402('0x60'));logger['info'](_0x4402('0x61'),_0xccb64f['id']);})[_0x4402('0x26')](function(_0x2eae1c){logger['error'](_0x4402('0x64'),JSON['stringify'](_0x2eae1c));});}; \ No newline at end of file +var _0xee5b=['lodash','bluebird','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','defaults','redis','localhost','socket.io-emitter','length','type','string','idField','content','toString','variable','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','getString','Descriptions','POST','format','%s/webservice.php','remoteUri','create','username','sessionName','HelpDesk','stringify','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','error','catch','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','result','Agent\x20found!','resolve','email1','first_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','getUser','statusCode','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;','then','success','Enduser\x20found!','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','login','[HTTP]','queue','stripTrailingSlash','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','outbound','serverUrl','recordingFormat','[OUTBOUND]','email','destcalleridname','destcalleridnum','abandoned','Recording\x20is\x20enabled!','[ABANDONED]'];(function(_0x1fad47,_0x333c80){var _0x46f225=function(_0x11b406){while(--_0x11b406){_0x1fad47['push'](_0x1fad47['shift']());}};_0x46f225(++_0x333c80);}(_0xee5b,0x1f4));var _0xbee5=function(_0x5dbf52,_0x358036){_0x5dbf52=_0x5dbf52-0x0;var _0xe0cce6=_0xee5b[_0x5dbf52];return _0xe0cce6;};'use strict';var _=require(_0xbee5('0x0'));var rp=require('request-promise');var BPromise=require(_0xbee5('0x1'));var md5=require(_0xbee5('0x2'));var util=require('util');var Redis=require(_0xbee5('0x3'));var intUtil=require(_0xbee5('0x4'));var config=require(_0xbee5('0x5'));var logger=require(_0xbee5('0x6'))('vTiger');config['redis']=_[_0xbee5('0x7')](config[_0xbee5('0x8')],{'host':_0xbee5('0x9'),'port':0x18eb});var io=require(_0xbee5('0xa'))(new Redis(config['redis']));function emit(_0x5505e3,_0x53d5b9,_0x5baf5c){io['to'](_0x5505e3)['emit'](_0x53d5b9,_0x5baf5c);}function getCustomFields(_0x20c66c,_0x7dda04){var _0x45c2c7={};if(_0x20c66c[_0xbee5('0xb')]>0x0){_['forEach'](_0x20c66c,function(_0x143bd6){if(_0x143bd6[_0xbee5('0xc')]===_0xbee5('0xd')&&_0x143bd6[_0xbee5('0xe')]){_0x45c2c7[_0x143bd6[_0xbee5('0xe')]]=_0x143bd6[_0xbee5('0xf')][_0xbee5('0x10')]();}else if(_0x143bd6[_0xbee5('0xc')]===_0xbee5('0x11')&&_0x143bd6['variableName']&&_0x143bd6[_0xbee5('0xe')]&&_0x7dda04[_0x143bd6['variableName']]){_0x45c2c7[_0x143bd6[_0xbee5('0xe')]]=_0x7dda04[_0x143bd6[_0xbee5('0x12')]][_0xbee5('0x10')]();}else if(_0x143bd6['type']==='customVariable'&&_0x143bd6[_0xbee5('0x13')]&&_0x143bd6['Variable'][_0xbee5('0x14')]&&_0x143bd6['idField']&&_0x7dda04[_0x143bd6[_0xbee5('0x13')][_0xbee5('0x14')][_0xbee5('0x15')]()]){_0x45c2c7[_0x143bd6['idField']]=_0x7dda04[_0x143bd6[_0xbee5('0x13')][_0xbee5('0x14')]['toLowerCase']()][_0xbee5('0x10')]();}});}return _0x45c2c7;}function createTicket(_0x538460,_0x11b4a3,_0x3c3f4e,_0x35eb5c,_0xac51f5,_0x982404,_0xa50ec9){logger[_0xbee5('0x16')](_0xbee5('0x17'));var _0x3d49b0=_[_0xbee5('0x18')]({'parent_id':'','assigned_user_id':_0x11b4a3['id'],'ticketpriorities':_0xbee5('0x19'),'ticketstatus':_0xbee5('0x1a'),'ticket_title':intUtil[_0xbee5('0x1b')](_0x35eb5c['Subjects'],_0xac51f5,'\x20'),'description':intUtil['getString'](_0x35eb5c[_0xbee5('0x1c')],_0xac51f5,'\x0a'),'contact_id':_0x3c3f4e['id']},getCustomFields(_0x982404,_0xac51f5));var _0x48bfb5={'method':_0xbee5('0x1d'),'uri':util[_0xbee5('0x1e')](_0xbee5('0x1f'),_0x538460[_0xbee5('0x20')]),'form':{'operation':_0xbee5('0x21'),'username':_0x538460[_0xbee5('0x22')],'sessionName':_0xa50ec9[_0xbee5('0x23')],'elementType':_0xbee5('0x24'),'element':JSON[_0xbee5('0x25')](_0x3d49b0)},'json':!![]};return request(_0x48bfb5)['then'](function(_0x5b43b3){if(_0x5b43b3['success']){return BPromise['resolve']({'id':_0x5b43b3['result']['id']});}else{throw new Error(util[_0xbee5('0x1e')](_0xbee5('0x26'),JSON[_0xbee5('0x25')](_0x5b43b3[_0xbee5('0x27')])));}})[_0xbee5('0x28')](function(_0x20e7e8){var _0x3c8643=_0x20e7e8['statusCode']||0x1f4;logger[_0xbee5('0x27')](_0xbee5('0x29'),_0xbee5('0x2a'),_0x3c8643,JSON[_0xbee5('0x25')](_0x20e7e8));});}function getUser(_0x1a8bcc,_0x5f0419,_0x21b993){if(intUtil[_0xbee5('0x2b')](_0x5f0419)){logger[_0xbee5('0x16')](_0xbee5('0x2c'),_0x5f0419);return request({'method':_0xbee5('0x2d'),'uri':util[_0xbee5('0x1e')](_0xbee5('0x1f'),_0x1a8bcc[_0xbee5('0x20')]),'qs':{'operation':_0xbee5('0x2e'),'username':_0x1a8bcc['username'],'sessionName':_0x21b993[_0xbee5('0x23')],'query':util['format'](_0xbee5('0x2f'),_0x5f0419)},'json':!![]})['then'](function(_0x2d20cd){if(_0x2d20cd['success']&&_0x2d20cd[_0xbee5('0x30')]['length']){logger[_0xbee5('0x16')](_0xbee5('0x31'));return BPromise[_0xbee5('0x32')]({'id':_0x2d20cd[_0xbee5('0x30')][0x0]['id'],'email':_0x2d20cd['result'][0x0][_0xbee5('0x33')],'name':_0x2d20cd[_0xbee5('0x30')][0x0][_0xbee5('0x34')]+'\x20'+_0x2d20cd[_0xbee5('0x30')]['last_name']});}else{logger[_0xbee5('0x16')](_0xbee5('0x35'));return BPromise[_0xbee5('0x32')]({'id':_0x21b993[_0xbee5('0x36')],'email':_0x1a8bcc['username'],'name':_0xbee5('0x37')});}})[_0xbee5('0x28')](function(_0x3e854){var _0x33aaba=_0x3e854['statusCode']||0x1f4;logger[_0xbee5('0x27')]('[vTiger],\x20%s,\x20%s,\x20%s',_0xbee5('0x38'),_0x33aaba,JSON['stringify'](_0x3e854));});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0xbee5('0x32')]({'id':_0x21b993[_0xbee5('0x36')],'email':_0x1a8bcc[_0xbee5('0x22')],'name':_0xbee5('0x37')})[_0xbee5('0x28')](function(_0x2b83d5){var _0x37dfd3=_0x2b83d5[_0xbee5('0x39')]||0x1f4;logger['error'](_0xbee5('0x29'),'getUser',_0x37dfd3,JSON[_0xbee5('0x25')](_0x2b83d5));});}}function getEndUser(_0x16ea3e,_0x4618e4,_0x49d700,_0x4a89ac){logger[_0xbee5('0x16')]('Searching\x20end\x20user\x20with\x20phone',_0x49d700);return request({'method':'GET','uri':util[_0xbee5('0x1e')](_0xbee5('0x1f'),_0x16ea3e[_0xbee5('0x20')]),'qs':{'operation':_0xbee5('0x2e'),'username':_0x16ea3e['username'],'sessionName':_0x4a89ac[_0xbee5('0x23')],'query':util[_0xbee5('0x1e')](_0xbee5('0x3a'),_0x49d700,_0x49d700,_0x49d700,_0x49d700,_0x49d700)},'json':!![]})[_0xbee5('0x3b')](function(_0xdcd148){if(_0xdcd148[_0xbee5('0x3c')]&&_0xdcd148[_0xbee5('0x30')][_0xbee5('0xb')]){logger[_0xbee5('0x16')](_0xbee5('0x3d'));return BPromise['resolve']({'id':_0xdcd148[_0xbee5('0x30')][0x0]['id'],'name':_0xdcd148[_0xbee5('0x30')][0x0]['firstname']+'\x20'+_0xdcd148[_0xbee5('0x30')][0x0][_0xbee5('0x3e')],'phone':_0x49d700});}else{logger[_0xbee5('0x16')](_0xbee5('0x3f'));return request({'method':'POST','uri':util['format']('%s/webservice.php',_0x16ea3e[_0xbee5('0x20')]),'form':{'operation':_0xbee5('0x21'),'sessionName':_0x4a89ac[_0xbee5('0x23')],'elementType':_0xbee5('0x40'),'element':JSON[_0xbee5('0x25')]({'lastname':_0x4618e4,'phone':_0x49d700,'assigned_user_id':'\x20'})},'json':!![]})[_0xbee5('0x3b')](function(_0x41cea0){logger[_0xbee5('0x16')](_0xbee5('0x41'));return BPromise['resolve']({'id':_0x41cea0['result']['id'],'name':_0x41cea0[_0xbee5('0x30')]['lastname'],'phone':_0x41cea0[_0xbee5('0x30')][_0xbee5('0x42')]});})['catch'](function(_0x3b8e4b){var _0x143ab2=_0x3b8e4b['statusCode']||0x1f4;logger['error'](_0xbee5('0x29'),_0xbee5('0x43'),_0x143ab2,JSON['stringify'](_0x3b8e4b));});}});}function getConnection(_0x303819){var _0x2974f6=_0x303819['username'];var _0x42b164=_0x303819[_0xbee5('0x44')];return request({'method':_0xbee5('0x2d'),'uri':util[_0xbee5('0x1e')](_0xbee5('0x1f'),_0x303819[_0xbee5('0x20')]),'qs':{'operation':_0xbee5('0x45'),'username':_0x2974f6},'json':!![]})['then'](function(_0xd9173){if(_0xd9173[_0xbee5('0x3c')]){return request({'method':_0xbee5('0x1d'),'uri':util[_0xbee5('0x1e')]('%s/webservice.php',_0x303819[_0xbee5('0x20')]),'form':{'operation':_0xbee5('0x46'),'username':_0x2974f6,'accessKey':md5(_0xd9173[_0xbee5('0x30')]['token']+_0x42b164)},'json':!![]});}})[_0xbee5('0x3b')](function(_0xf637bf){if(_0xf637bf['success']){return BPromise['resolve'](_0xf637bf['result']);}else{throw new Error(util[_0xbee5('0x1e')]('Account\x20%d\x20is\x20not\x20valid',_0x303819['id']));}})[_0xbee5('0x28')](function(_0x3ae748){var _0x702ce8=_0x3ae748[_0xbee5('0x39')]||0x1f4;logger[_0xbee5('0x27')](_0xbee5('0x29'),'getConnection',_0x702ce8,JSON[_0xbee5('0x25')](_0x3ae748));});}function request(_0x183926){logger[_0xbee5('0x16')](_0xbee5('0x47'),JSON['stringify'](_0x183926));return rp(_0x183926);}exports[_0xbee5('0x48')]=function(_0x594dcf,_0x358a3a,_0x45d114,_0xf48059,_0x22c51,_0x2484c7){var _0x1b02eb,_0xe8902,_0x35f1d1,_0x364ba2;_0x2484c7[_0xbee5('0x20')]=intUtil[_0xbee5('0x49')](_0x2484c7[_0xbee5('0x20')]);if(_0x22c51&&_0x22c51[_0xbee5('0x4a')]){logger[_0xbee5('0x16')](_0xbee5('0x4b'),'Recording\x20is\x20enabled!');_0x358a3a[_0xbee5('0x4c')]=util[_0xbee5('0x1e')](_0xbee5('0x4d'),_0x2484c7['serverUrl'],_0x358a3a[_0xbee5('0x4e')],md5(_0x358a3a[_0xbee5('0x4e')]));}else{_0x358a3a[_0xbee5('0x4c')]='';}return getConnection(_0x2484c7)['then'](function(_0x1cc152){_0x364ba2=_0x1cc152;return getUser(_0x2484c7,_0xf48059['email'],_0x364ba2);})[_0xbee5('0x3b')](function(_0x4ee645){_0x1b02eb=_0x4ee645;logger[_0xbee5('0x16')](_0xbee5('0x4f'),_0x1b02eb['id']);return getEndUser(_0x2484c7,_0x358a3a[_0xbee5('0x50')],_0x358a3a['calleridnum'],_0x364ba2);})['then'](function(_0x5528e8){_0xe8902=_0x5528e8;logger[_0xbee5('0x16')](_0xbee5('0x51'),_0xe8902['id']);return createTicket(_0x2484c7,_0x1b02eb,_0xe8902,_0x45d114,_0x358a3a,_0x45d114[_0xbee5('0x52')],_0x364ba2);})['then'](function(_0x4d8c34){_0x35f1d1=_0x4d8c34;logger['info'](_0xbee5('0x53'));logger[_0xbee5('0x16')](_0xbee5('0x54'),_0x35f1d1['id']);var _0x5cc68d=util[_0xbee5('0x1e')](_0xbee5('0x55'),_0x2484c7[_0xbee5('0x20')],_[_0xbee5('0x56')](_0x35f1d1['id'],'x')[0x1]);logger[_0xbee5('0x16')](_0xbee5('0x4b'),_0xbee5('0x57'));emit(util[_0xbee5('0x1e')](_0xbee5('0x58'),_0xf48059[_0xbee5('0x14')]),_0xbee5('0x59'),{'uri':_0x5cc68d});})[_0xbee5('0x28')](function(_0x318016){logger[_0xbee5('0x27')](_0xbee5('0x4b'),JSON[_0xbee5('0x25')](_0x318016));});};exports[_0xbee5('0x5a')]=function(_0x524b12,_0x12a9bd,_0x57c54d,_0x56d8b5,_0x43941c,_0x2af89b,_0x54faee){var _0x5a2544,_0x9c0fbb,_0x53cb9a,_0x2fa95e;_0x2af89b[_0xbee5('0x20')]=intUtil['stripTrailingSlash'](_0x2af89b[_0xbee5('0x20')]);_0x2af89b[_0xbee5('0x5b')]=intUtil[_0xbee5('0x49')](_0x2af89b[_0xbee5('0x5b')]);if(_0x54faee&&_0x54faee['recordingFormat']&&_0x54faee[_0xbee5('0x5c')]!=='none'){logger[_0xbee5('0x16')](_0xbee5('0x5d'),'Recording\x20is\x20enabled!');_0x12a9bd[_0xbee5('0x4c')]=util[_0xbee5('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2af89b[_0xbee5('0x5b')],_0x12a9bd[_0xbee5('0x4e')],md5(_0x12a9bd['uniqueid']));}return getConnection(_0x2af89b)[_0xbee5('0x3b')](function(_0x54f45e){_0x2fa95e=_0x54f45e;return getUser(_0x2af89b,_0x56d8b5[_0xbee5('0x5e')],_0x2fa95e);})['then'](function(_0xe486e6){_0x5a2544=_0xe486e6;logger['info']('The\x20User\x20ID\x20is:',_0x5a2544['id']);return getEndUser(_0x2af89b,_0x12a9bd[_0xbee5('0x5f')],_0x12a9bd[_0xbee5('0x60')],_0x2fa95e);})[_0xbee5('0x3b')](function(_0x2f025c){_0x9c0fbb=_0x2f025c;logger[_0xbee5('0x16')](_0xbee5('0x51'),_0x9c0fbb['id']);return createTicket(_0x2af89b,_0x5a2544,_0x9c0fbb,_0x57c54d,_0x12a9bd,_0x57c54d['Fields'],_0x2fa95e);})[_0xbee5('0x3b')](function(_0x1d434b){_0x53cb9a=_0x1d434b;logger[_0xbee5('0x16')](_0xbee5('0x53'));logger[_0xbee5('0x16')](_0xbee5('0x54'),_0x53cb9a['id']);var _0x3b0deb=util[_0xbee5('0x1e')](_0xbee5('0x55'),_0x2af89b['remoteUri'],_[_0xbee5('0x56')](_0x53cb9a['id'],'x')[0x1]);logger[_0xbee5('0x16')](_0xbee5('0x5d'),_0xbee5('0x57'));emit(util['format'](_0xbee5('0x58'),_0x56d8b5[_0xbee5('0x14')]),_0xbee5('0x59'),{'uri':_0x3b0deb});})[_0xbee5('0x28')](function(_0xbb683b){logger[_0xbee5('0x27')](_0xbee5('0x5d'),JSON[_0xbee5('0x25')](_0xbb683b));});};exports[_0xbee5('0x61')]=function(_0x3e6fcb,_0x185974,_0x24cd85,_0x4f9431,_0x20a9d2,_0x184f67){var _0x522463,_0x3612ee,_0x56ceeb,_0x3913d5;_0x184f67[_0xbee5('0x20')]=intUtil['stripTrailingSlash'](_0x184f67[_0xbee5('0x20')]);_0x184f67['serverUrl']=intUtil['stripTrailingSlash'](_0x184f67['serverUrl']);if(_0x20a9d2&&_0x20a9d2['monitor_format']){logger['info']('[ABANDONED]',_0xbee5('0x62'));_0x185974[_0xbee5('0x4c')]=util[_0xbee5('0x1e')](_0xbee5('0x4d'),_0x184f67[_0xbee5('0x5b')],_0x185974[_0xbee5('0x4e')],md5(_0x185974[_0xbee5('0x4e')]));}else{_0x185974[_0xbee5('0x4c')]='';}return getConnection(_0x184f67)[_0xbee5('0x3b')](function(_0x189147){_0x3913d5=_0x189147;return getUser(_0x184f67,'',_0x3913d5);})[_0xbee5('0x3b')](function(_0x4316bf){_0x522463=_0x4316bf;logger['info'](_0xbee5('0x4f'),_0x522463['id']);return getEndUser(_0x184f67,_0x185974[_0xbee5('0x50')],_0x185974['calleridnum'],_0x3913d5);})['then'](function(_0x64fa87){_0x3612ee=_0x64fa87;logger[_0xbee5('0x16')](_0xbee5('0x51'),_0x3612ee['id']);return createTicket(_0x184f67,_0x522463,_0x3612ee,_0x24cd85,_0x185974,_0x24cd85['Fields'],_0x3913d5);})[_0xbee5('0x3b')](function(_0x17a233){_0x56ceeb=_0x17a233;logger[_0xbee5('0x16')]('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x56ceeb['id']);})[_0xbee5('0x28')](function(_0x185219){logger[_0xbee5('0x27')](_0xbee5('0x63'),JSON[_0xbee5('0x25')](_0x185219));});}; \ 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 178c48a..9f46aa0 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 _0x2121=['../../../../config/environment','../../../../config/logger','zendesk','defaults','localhost','socket.io-emitter','redis','application/json','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','merge','Tags','name','getString','Subjects','Descriptions','Fields','then','info','Ticket\x20created!','ticket','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','Agent\x20found!','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','POST','Caller\x20-\x20%s','Enduser\x20created.','authType','password','username','token','%s/token:%s','Basic\x20%s','toString','debug','[HTTP]','map','forEach','type','string','nameField','customField','toLowerCase','content','idField','push','variable','variableName','custom_fields','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','email','calleridname','calleridnum','integrationTab','Displaying\x20ticket\x20to\x20agent...','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','%s/agent/tickets/%s','error','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','[OUTBOUND]','%s/channels/voice/agents/%d/tickets/%d/display.json','user:%s','trigger:browser:url','Zendesk\x20account\x20type\x20not\x20recognized','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','abandoned','[ABANDONED]','[ABANDONED]\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','ioredis','./util'];(function(_0x14da5e,_0x3d44b2){var _0x28b9cb=function(_0x52f6c9){while(--_0x52f6c9){_0x14da5e['push'](_0x14da5e['shift']());}};_0x28b9cb(++_0x3d44b2);}(_0x2121,0x1b4));var _0x1212=function(_0x2feee7,_0x5cc5f1){_0x2feee7=_0x2feee7-0x0;var _0x24bae8=_0x2121[_0x2feee7];return _0x24bae8;};'use strict';var _=require(_0x1212('0x0'));var rp=require(_0x1212('0x1'));var md5=require('md5');var util=require('util');var Redis=require(_0x1212('0x2'));var intUtil=require(_0x1212('0x3'));var config=require(_0x1212('0x4'));var logger=require(_0x1212('0x5'))(_0x1212('0x6'));config['redis']=_[_0x1212('0x7')](config['redis'],{'host':_0x1212('0x8'),'port':0x18eb});var io=require(_0x1212('0x9'))(new Redis(config[_0x1212('0xa')]));function emit(_0x1b1ef5,_0x233a53,_0x642ed5){io['to'](_0x1b1ef5)['emit'](_0x233a53,_0x642ed5);}var headers={'Content-Type':_0x1212('0xb'),'Accept':_0x1212('0xb')};function getTicket(_0x434d23,_0x9ce2c5,_0x15011d,_0x254eb9,_0x5498b0){logger['info'](_0x1212('0xc'));return request({'uri':util[_0x1212('0xd')](_0x1212('0xe'),_0x434d23[_0x1212('0xf')]),'method':'POST','body':{'ticket':_[_0x1212('0x10')]({'requester_id':_0x15011d['id'],'submitter_id':_0x9ce2c5?_0x9ce2c5['id']:undefined,'assignee_id':_0x9ce2c5?_0x9ce2c5['id']:undefined,'tags':getTags(_0x254eb9[_0x1212('0x11')],_0x1212('0x12')),'subject':intUtil[_0x1212('0x13')](_0x254eb9[_0x1212('0x14')],_0x5498b0,'\x20'),'description':intUtil[_0x1212('0x13')](_0x254eb9[_0x1212('0x15')],_0x5498b0,'\x0a'),'comment':{'public':![],'body':intUtil[_0x1212('0x13')](_0x254eb9[_0x1212('0x15')],_0x5498b0,'\x0a')}},getCustomFields(_0x254eb9[_0x1212('0x16')],_0x5498b0))}})[_0x1212('0x17')](function(_0x27343f){logger[_0x1212('0x18')](_0x1212('0x19'));return _0x27343f[_0x1212('0x1a')];});}function getUser(_0x5cc246,_0x568870){if(intUtil['validateEmail'](_0x568870)){logger[_0x1212('0x18')](_0x1212('0x1b'),_0x568870);return request({'uri':util[_0x1212('0xd')](_0x1212('0x1c'),_0x5cc246[_0x1212('0xf')]),'qs':{'query':util[_0x1212('0xd')](_0x1212('0x1d'),_0x568870)}})[_0x1212('0x17')](function(_0x359f88){if(_0x359f88['count']){logger[_0x1212('0x18')](_0x1212('0x1e'));return _[_0x1212('0x1f')](_0x359f88[_0x1212('0x20')],{'email':_0x568870,'role':_0x1212('0x21')});}else{logger[_0x1212('0x18')](_0x1212('0x22'));return request({'uri':util[_0x1212('0xd')]('%s/users/me.json',_0x5cc246[_0x1212('0xf')])})[_0x1212('0x17')](function(_0x46d6df){logger[_0x1212('0x18')](_0x1212('0x23'));return _0x46d6df[_0x1212('0x24')];});}});}else{logger[_0x1212('0x18')](_0x1212('0x22'));return request({'uri':util['format']('%s/users/me.json',_0x5cc246['remoteUri'])})['then'](function(_0x573273){logger[_0x1212('0x18')](_0x1212('0x23'));return _0x573273['user'];});}}function getEndUser(_0x7875d2,_0xa1c850,_0x52c7b0){logger[_0x1212('0x18')](_0x1212('0x25'),_0x52c7b0);return request({'uri':util[_0x1212('0xd')](_0x1212('0x1c'),_0x7875d2[_0x1212('0xf')]),'qs':{'query':util[_0x1212('0xd')](_0x1212('0x26'),_0x52c7b0)}})[_0x1212('0x17')](function(_0x53aa25){var _0x156b50;if(_0x53aa25[_0x1212('0x20')][_0x1212('0x27')]){_0x53aa25[_0x1212('0x20')]=_[_0x1212('0x28')](_0x53aa25[_0x1212('0x20')],{'suspended':![],'role':_0x1212('0x29')});if(_0x53aa25[_0x1212('0x20')][_0x1212('0x27')]){_0x156b50=_[_0x1212('0x2a')](_0x53aa25['results']);}}if(_0x156b50){logger['info'](_0x1212('0x2b'));return _0x156b50;}else{logger['info'](_0x1212('0x2c'));return request({'uri':util['format'](_0x1212('0x2d'),_0x7875d2['remoteUri']),'method':_0x1212('0x2e'),'body':{'user':{'role':_0x1212('0x29'),'name':util[_0x1212('0xd')](_0x1212('0x2f'),_0xa1c850||_0x52c7b0),'phone':_0x52c7b0}}})['then'](function(_0x11cfe2){logger[_0x1212('0x18')](_0x1212('0x30'));return _0x11cfe2[_0x1212('0x24')];});}});}function getAuth(_0x1a691a){var _0x47c63f;if(_0x1a691a[_0x1212('0x31')]===_0x1212('0x32')){_0x47c63f=util[_0x1212('0xd')]('%s:%s',_0x1a691a[_0x1212('0x33')],_0x1a691a[_0x1212('0x32')]);}else if(_0x1a691a[_0x1212('0x31')]===_0x1212('0x34')){_0x47c63f=util['format'](_0x1212('0x35'),_0x1a691a[_0x1212('0x33')],_0x1a691a['token']);}return util[_0x1212('0xd')](_0x1212('0x36'),new Buffer(_0x47c63f)[_0x1212('0x37')]('base64'));}function request(_0x17f499){logger[_0x1212('0x38')](_0x1212('0x39'),JSON['stringify'](_0x17f499));return rp(_[_0x1212('0x7')](_0x17f499,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x4702b2,_0x1bb72c){var _0x4e0dbe=[];if(_0x4702b2&&_0x4702b2['length']>0x0){_0x4e0dbe=_[_0x1212('0x3a')](_0x4702b2,_0x1bb72c);}return _0x4e0dbe;}function getCustomFields(_0x47999e,_0x113a06){var _0x20e964=[];var _0x31a69c={'custom_fields':[]};if(_0x47999e[_0x1212('0x27')]>0x0){_[_0x1212('0x3b')](_0x47999e,function(_0x1f3b66){if(_0x1f3b66[_0x1212('0x3c')]===_0x1212('0x3d')&&_0x1f3b66[_0x1212('0x3e')]&&!_0x1f3b66[_0x1212('0x3f')]){_0x31a69c[_0x1f3b66[_0x1212('0x3e')][_0x1212('0x40')]()]=_0x1f3b66[_0x1212('0x41')][_0x1212('0x37')]();}else if(_0x1f3b66[_0x1212('0x3c')]===_0x1212('0x3d')&&_0x1f3b66[_0x1212('0x42')]&&_0x1f3b66[_0x1212('0x3f')]){_0x31a69c['custom_fields'][_0x1212('0x43')]({'id':_0x1f3b66['idField'],'value':_0x1f3b66['content'][_0x1212('0x37')]()});}else if(_0x1f3b66[_0x1212('0x3c')]===_0x1212('0x44')&&_0x1f3b66[_0x1212('0x45')]&&_0x1f3b66[_0x1212('0x42')]&&_0x1f3b66['customField']){_0x113a06[_0x1f3b66['variableName']]&&_0x31a69c[_0x1212('0x46')][_0x1212('0x43')]({'id':_0x1f3b66[_0x1212('0x42')],'value':_0x113a06[_0x1f3b66[_0x1212('0x45')]][_0x1212('0x37')]()});}else if(_0x1f3b66[_0x1212('0x3c')]===_0x1212('0x47')&&_0x1f3b66[_0x1212('0x48')]&&_0x1f3b66[_0x1212('0x48')][_0x1212('0x12')]&&_0x1f3b66[_0x1212('0x42')]&&_0x1f3b66[_0x1212('0x3f')]){_0x113a06[_0x1f3b66['Variable']['name'][_0x1212('0x40')]()]&&_0x31a69c[_0x1212('0x46')]['push']({'id':_0x1f3b66[_0x1212('0x42')],'value':_0x113a06[_0x1f3b66['Variable'][_0x1212('0x12')][_0x1212('0x40')]()][_0x1212('0x37')]()});}});}return _0x31a69c;}exports[_0x1212('0x49')]=function(_0x12e31f,_0x4f83dc,_0x15a0c3,_0xbc9304,_0x31c8ee,_0x52afc3){var _0x3548a1,_0x298538;_0x52afc3['remoteUri']=intUtil[_0x1212('0x4a')](_0x52afc3[_0x1212('0xf')]);_0x52afc3[_0x1212('0x4b')]=intUtil[_0x1212('0x4a')](_0x52afc3[_0x1212('0x4b')]);if(_0x31c8ee&&_0x31c8ee[_0x1212('0x4c')]){logger['info'](_0x1212('0x4d'),_0x1212('0x4e'));_0x4f83dc[_0x1212('0x4f')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x52afc3[_0x1212('0x4b')],_0x4f83dc['uniqueid'],md5(_0x4f83dc[_0x1212('0x50')]));}else{_0x4f83dc['recordingURL']='';}headers['Authorization']=getAuth(_0x52afc3);return getUser(_0x52afc3,_0xbc9304[_0x1212('0x51')])[_0x1212('0x17')](function(_0x5262b3){_0x3548a1=_0x5262b3;logger[_0x1212('0x18')]('The\x20User\x20ID\x20is:',_0x3548a1['id']);return getEndUser(_0x52afc3,_0x4f83dc[_0x1212('0x52')],_0x4f83dc[_0x1212('0x53')]);})['then'](function(_0x55b8df){_0x298538=_0x55b8df;logger[_0x1212('0x18')]('The\x20Enduser\x20ID\x20is:',_0x298538['id']);return getTicket(_0x52afc3,_0x3548a1,_0x298538,_0x15a0c3,_0x4f83dc);})[_0x1212('0x17')](function(_0x53a46f){if(_0x53a46f){logger[_0x1212('0x18')]('The\x20Ticket\x20ID\x20is:',_0x53a46f['id']);switch(_0x52afc3[_0x1212('0x3c')]){case _0x1212('0x54'):logger[_0x1212('0x18')](_0x1212('0x4d'),_0x1212('0x55'));return request({'uri':util[_0x1212('0xd')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x52afc3['remoteUri'],_0x3548a1['id'],_0x53a46f['id']),'method':_0x1212('0x2e')});case _0x1212('0x56'):logger[_0x1212('0x18')](_0x1212('0x4d'),_0x1212('0x57'));emit(util[_0x1212('0xd')]('user:%s',_0xbc9304['name']),'trigger:browser:url',{'uri':util[_0x1212('0xd')](_0x1212('0x58'),_0x52afc3[_0x1212('0xf')],_0x53a46f['id'])});break;default:logger[_0x1212('0x59')](_0x1212('0x4d'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x1212('0x5a')](function(_0xcbe356){logger[_0x1212('0x59')](_0x1212('0x5b'),util[_0x1212('0x5c')](_0xcbe356,{'showHidden':!![],'depth':null}));});};exports[_0x1212('0x5d')]=function(_0x4901c1,_0x3324ea,_0x42dbf4,_0x31d8be,_0x4a86bd,_0x24062a,_0x380cc9){var _0x39a27b,_0x27c944;_0x24062a['remoteUri']=intUtil[_0x1212('0x4a')](_0x24062a[_0x1212('0xf')]);_0x24062a[_0x1212('0x4b')]=intUtil[_0x1212('0x4a')](_0x24062a[_0x1212('0x4b')]);if(_0x380cc9&&_0x380cc9[_0x1212('0x5e')]&&_0x380cc9['recordingFormat']!==_0x1212('0x5f')){logger['info']('[OUTBOUND]',_0x1212('0x4e'));_0x3324ea[_0x1212('0x4f')]=util['format'](_0x1212('0x60'),_0x24062a['serverUrl'],_0x3324ea['uniqueid'],md5(_0x3324ea['uniqueid']));}headers['Authorization']=getAuth(_0x24062a);return getUser(_0x24062a,_0x31d8be['email'])[_0x1212('0x17')](function(_0x8d10c7){_0x39a27b=_0x8d10c7;logger[_0x1212('0x18')](_0x1212('0x61'),_0x39a27b['id']);return getEndUser(_0x24062a,_0x3324ea[_0x1212('0x62')],_0x3324ea[_0x1212('0x63')]);})[_0x1212('0x17')](function(_0x41f7be){_0x27c944=_0x41f7be;logger[_0x1212('0x18')](_0x1212('0x64'),_0x27c944['id']);return getTicket(_0x24062a,_0x39a27b,_0x27c944,_0x42dbf4,_0x3324ea);})[_0x1212('0x17')](function(_0x3a325f){if(_0x3a325f){logger[_0x1212('0x18')]('The\x20Ticket\x20ID\x20is:',_0x3a325f['id']);switch(_0x24062a[_0x1212('0x3c')]){case'integrationTab':logger[_0x1212('0x18')](_0x1212('0x65'),_0x1212('0x55'));return request({'uri':util[_0x1212('0xd')](_0x1212('0x66'),_0x24062a[_0x1212('0xf')],_0x39a27b['id'],_0x3a325f['id']),'method':_0x1212('0x2e')});case _0x1212('0x56'):logger['info'](_0x1212('0x65'),_0x1212('0x57'));emit(util[_0x1212('0xd')](_0x1212('0x67'),_0x31d8be['name']),_0x1212('0x68'),{'uri':util[_0x1212('0xd')]('%s/agent/tickets/%s',_0x24062a[_0x1212('0xf')],_0x3a325f['id'])});break;default:logger[_0x1212('0x59')]('[OUTBOUND]',_0x1212('0x69'));}}})[_0x1212('0x5a')](function(_0xe8ce07){logger[_0x1212('0x59')](_0x1212('0x6a'),util[_0x1212('0x5c')](_0xe8ce07,{'showHidden':!![],'depth':null}));});};exports[_0x1212('0x6b')]=function(_0x3b4bd,_0x388432,_0xbff8a9,_0x45fb5e,_0x59b660,_0x186c5d){var _0x5ca4ef,_0x2eca50;_0x186c5d['remoteUri']=intUtil[_0x1212('0x4a')](_0x186c5d[_0x1212('0xf')]);_0x186c5d[_0x1212('0x4b')]=intUtil[_0x1212('0x4a')](_0x186c5d['serverUrl']);if(_0x59b660&&_0x59b660['monitor_format']){logger[_0x1212('0x18')](_0x1212('0x6c'),_0x1212('0x4e'));_0x388432[_0x1212('0x4f')]=util['format'](_0x1212('0x60'),_0x186c5d[_0x1212('0x4b')],_0x388432[_0x1212('0x50')],md5(_0x388432[_0x1212('0x50')]));}else{_0x388432[_0x1212('0x4f')]='';}headers['Authorization']=getAuth(_0x186c5d);return getUser(_0x186c5d)[_0x1212('0x17')](function(_0x4179cd){_0x5ca4ef=_0x4179cd;logger[_0x1212('0x18')]('The\x20User\x20ID\x20is:',_0x5ca4ef['id']);return getEndUser(_0x186c5d,_0x388432[_0x1212('0x52')],_0x388432[_0x1212('0x53')]);})[_0x1212('0x17')](function(_0x46c3f6){_0x2eca50=_0x46c3f6;logger[_0x1212('0x18')](_0x1212('0x64'),_0x2eca50['id']);return getTicket(_0x186c5d,_0x5ca4ef,_0x2eca50,_0xbff8a9,_0x388432);})['then'](function(_0x1bab44){if(_0x1bab44){logger[_0x1212('0x18')]('The\x20Ticket\x20ID\x20is:',_0x1bab44['id']);}})[_0x1212('0x5a')](function(_0x456ff0){logger['error'](_0x1212('0x6d'),util[_0x1212('0x5c')](_0x456ff0,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xe1f0=['variableName','customVariable','Variable','name','push','queue','stripTrailingSlash','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','Authorization','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','%s/agent/tickets/%s','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','[OUTBOUND]','email','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','newTab','trigger:browser:url','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','abandoned','monitor_format','[ABANDONED]','calleridname','request-promise','md5','ioredis','./util','../../../../config/environment','zendesk','redis','defaults','localhost','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','merge','Tags','getString','Subjects','Descriptions','Fields','then','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','count','Agent\x20found!','find','results','Admin\x20account\x20selected.','user','%s/users/me.json','Searching\x20enduser\x20with\x20phone','length','filter','end-user','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','authType','password','%s:%s','username','token','%s/token:%s','Basic\x20%s','toString','base64','debug','GET','forEach','type','nameField','customField','toLowerCase','content','string','idField','variable'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe1f0,0x1c2));var _0x0e1f=function(_0x5e1157,_0x3dbcb4){_0x5e1157=_0x5e1157-0x0;var _0x51ab90=_0xe1f0[_0x5e1157];return _0x51ab90;};'use strict';var _=require('lodash');var rp=require(_0x0e1f('0x0'));var md5=require(_0x0e1f('0x1'));var util=require('util');var Redis=require(_0x0e1f('0x2'));var intUtil=require(_0x0e1f('0x3'));var config=require(_0x0e1f('0x4'));var logger=require('../../../../config/logger')(_0x0e1f('0x5'));config[_0x0e1f('0x6')]=_[_0x0e1f('0x7')](config['redis'],{'host':_0x0e1f('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0e1f('0x6')]));function emit(_0xdac52f,_0x171257,_0x4df3ae){io['to'](_0xdac52f)['emit'](_0x171257,_0x4df3ae);}var headers={'Content-Type':_0x0e1f('0x9'),'Accept':_0x0e1f('0x9')};function getTicket(_0x5b242a,_0x28359d,_0x3c24a0,_0x2f2a88,_0x71af43){logger[_0x0e1f('0xa')](_0x0e1f('0xb'));return request({'uri':util[_0x0e1f('0xc')](_0x0e1f('0xd'),_0x5b242a[_0x0e1f('0xe')]),'method':_0x0e1f('0xf'),'body':{'ticket':_[_0x0e1f('0x10')]({'requester_id':_0x3c24a0['id'],'submitter_id':_0x28359d?_0x28359d['id']:undefined,'assignee_id':_0x28359d?_0x28359d['id']:undefined,'tags':getTags(_0x2f2a88[_0x0e1f('0x11')],'name'),'subject':intUtil[_0x0e1f('0x12')](_0x2f2a88[_0x0e1f('0x13')],_0x71af43,'\x20'),'description':intUtil[_0x0e1f('0x12')](_0x2f2a88[_0x0e1f('0x14')],_0x71af43,'\x0a'),'comment':{'public':![],'body':intUtil[_0x0e1f('0x12')](_0x2f2a88[_0x0e1f('0x14')],_0x71af43,'\x0a')}},getCustomFields(_0x2f2a88[_0x0e1f('0x15')],_0x71af43))}})[_0x0e1f('0x16')](function(_0x195e86){logger[_0x0e1f('0xa')]('Ticket\x20created!');return _0x195e86[_0x0e1f('0x17')];});}function getUser(_0x15940f,_0x4a7d49){if(intUtil[_0x0e1f('0x18')](_0x4a7d49)){logger[_0x0e1f('0xa')](_0x0e1f('0x19'),_0x4a7d49);return request({'uri':util[_0x0e1f('0xc')](_0x0e1f('0x1a'),_0x15940f[_0x0e1f('0xe')]),'qs':{'query':util[_0x0e1f('0xc')]('type:user\x20role:agent\x20email:%s',_0x4a7d49)}})[_0x0e1f('0x16')](function(_0x270e7b){if(_0x270e7b[_0x0e1f('0x1b')]){logger[_0x0e1f('0xa')](_0x0e1f('0x1c'));return _[_0x0e1f('0x1d')](_0x270e7b[_0x0e1f('0x1e')],{'email':_0x4a7d49,'role':'agent'});}else{logger[_0x0e1f('0xa')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format']('%s/users/me.json',_0x15940f[_0x0e1f('0xe')])})[_0x0e1f('0x16')](function(_0x1503ee){logger['info'](_0x0e1f('0x1f'));return _0x1503ee[_0x0e1f('0x20')];});}});}else{logger[_0x0e1f('0xa')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x0e1f('0xc')](_0x0e1f('0x21'),_0x15940f[_0x0e1f('0xe')])})[_0x0e1f('0x16')](function(_0x3bd3e2){logger[_0x0e1f('0xa')](_0x0e1f('0x1f'));return _0x3bd3e2[_0x0e1f('0x20')];});}}function getEndUser(_0x5445ff,_0x9b7441,_0x79c32){logger[_0x0e1f('0xa')](_0x0e1f('0x22'),_0x79c32);return request({'uri':util['format'](_0x0e1f('0x1a'),_0x5445ff['remoteUri']),'qs':{'query':util[_0x0e1f('0xc')]('type:user\x20role:end-user\x20phone:%s',_0x79c32)}})[_0x0e1f('0x16')](function(_0x37937b){var _0x559f2d;if(_0x37937b['results'][_0x0e1f('0x23')]){_0x37937b[_0x0e1f('0x1e')]=_[_0x0e1f('0x24')](_0x37937b[_0x0e1f('0x1e')],{'suspended':![],'role':_0x0e1f('0x25')});if(_0x37937b['results'][_0x0e1f('0x23')]){_0x559f2d=_['first'](_0x37937b[_0x0e1f('0x1e')]);}}if(_0x559f2d){logger[_0x0e1f('0xa')](_0x0e1f('0x26'));return _0x559f2d;}else{logger[_0x0e1f('0xa')](_0x0e1f('0x27'));return request({'uri':util[_0x0e1f('0xc')]('%s/users.json',_0x5445ff[_0x0e1f('0xe')]),'method':_0x0e1f('0xf'),'body':{'user':{'role':_0x0e1f('0x25'),'name':util[_0x0e1f('0xc')]('Caller\x20-\x20%s',_0x9b7441||_0x79c32),'phone':_0x79c32}}})['then'](function(_0x16b3c9){logger[_0x0e1f('0xa')]('Enduser\x20created.');return _0x16b3c9[_0x0e1f('0x20')];});}});}function getAuth(_0x15ac7e){var _0x1479d7;if(_0x15ac7e[_0x0e1f('0x28')]===_0x0e1f('0x29')){_0x1479d7=util[_0x0e1f('0xc')](_0x0e1f('0x2a'),_0x15ac7e[_0x0e1f('0x2b')],_0x15ac7e[_0x0e1f('0x29')]);}else if(_0x15ac7e[_0x0e1f('0x28')]===_0x0e1f('0x2c')){_0x1479d7=util[_0x0e1f('0xc')](_0x0e1f('0x2d'),_0x15ac7e[_0x0e1f('0x2b')],_0x15ac7e[_0x0e1f('0x2c')]);}return util['format'](_0x0e1f('0x2e'),new Buffer(_0x1479d7)[_0x0e1f('0x2f')](_0x0e1f('0x30')));}function request(_0x45275){logger[_0x0e1f('0x31')]('[HTTP]',JSON['stringify'](_0x45275));return rp(_[_0x0e1f('0x7')](_0x45275,{'method':_0x0e1f('0x32'),'headers':headers,'json':!![]}));}function getTags(_0x19855b,_0x1af9f9){var _0x5c76bd=[];if(_0x19855b&&_0x19855b[_0x0e1f('0x23')]>0x0){_0x5c76bd=_['map'](_0x19855b,_0x1af9f9);}return _0x5c76bd;}function getCustomFields(_0x7abfc3,_0x546e22){var _0x3aea4d=[];var _0x31db04={'custom_fields':[]};if(_0x7abfc3[_0x0e1f('0x23')]>0x0){_[_0x0e1f('0x33')](_0x7abfc3,function(_0x5b30a7){if(_0x5b30a7[_0x0e1f('0x34')]==='string'&&_0x5b30a7[_0x0e1f('0x35')]&&!_0x5b30a7[_0x0e1f('0x36')]){_0x31db04[_0x5b30a7[_0x0e1f('0x35')][_0x0e1f('0x37')]()]=_0x5b30a7[_0x0e1f('0x38')][_0x0e1f('0x2f')]();}else if(_0x5b30a7[_0x0e1f('0x34')]===_0x0e1f('0x39')&&_0x5b30a7[_0x0e1f('0x3a')]&&_0x5b30a7['customField']){_0x31db04['custom_fields']['push']({'id':_0x5b30a7[_0x0e1f('0x3a')],'value':_0x5b30a7[_0x0e1f('0x38')][_0x0e1f('0x2f')]()});}else if(_0x5b30a7[_0x0e1f('0x34')]===_0x0e1f('0x3b')&&_0x5b30a7[_0x0e1f('0x3c')]&&_0x5b30a7['idField']&&_0x5b30a7[_0x0e1f('0x36')]){_0x546e22[_0x5b30a7['variableName']]&&_0x31db04['custom_fields']['push']({'id':_0x5b30a7[_0x0e1f('0x3a')],'value':_0x546e22[_0x5b30a7[_0x0e1f('0x3c')]][_0x0e1f('0x2f')]()});}else if(_0x5b30a7[_0x0e1f('0x34')]===_0x0e1f('0x3d')&&_0x5b30a7[_0x0e1f('0x3e')]&&_0x5b30a7[_0x0e1f('0x3e')][_0x0e1f('0x3f')]&&_0x5b30a7[_0x0e1f('0x3a')]&&_0x5b30a7[_0x0e1f('0x36')]){_0x546e22[_0x5b30a7['Variable']['name'][_0x0e1f('0x37')]()]&&_0x31db04['custom_fields'][_0x0e1f('0x40')]({'id':_0x5b30a7[_0x0e1f('0x3a')],'value':_0x546e22[_0x5b30a7[_0x0e1f('0x3e')][_0x0e1f('0x3f')]['toLowerCase']()][_0x0e1f('0x2f')]()});}});}return _0x31db04;}exports[_0x0e1f('0x41')]=function(_0x31d694,_0x197520,_0x2a75ca,_0x5d8223,_0x523a4f,_0x12aba1){var _0x3cf6f3,_0x358638;_0x12aba1[_0x0e1f('0xe')]=intUtil[_0x0e1f('0x42')](_0x12aba1['remoteUri']);_0x12aba1['serverUrl']=intUtil[_0x0e1f('0x42')](_0x12aba1['serverUrl']);if(_0x523a4f&&_0x523a4f['monitor_format']){logger['info']('[QUEUE]',_0x0e1f('0x43'));_0x197520[_0x0e1f('0x44')]=util[_0x0e1f('0xc')](_0x0e1f('0x45'),_0x12aba1[_0x0e1f('0x46')],_0x197520[_0x0e1f('0x47')],md5(_0x197520[_0x0e1f('0x47')]));}else{_0x197520['recordingURL']='';}headers[_0x0e1f('0x48')]=getAuth(_0x12aba1);return getUser(_0x12aba1,_0x5d8223['email'])[_0x0e1f('0x16')](function(_0x46a9f8){_0x3cf6f3=_0x46a9f8;logger[_0x0e1f('0xa')]('The\x20User\x20ID\x20is:',_0x3cf6f3['id']);return getEndUser(_0x12aba1,_0x197520['calleridname'],_0x197520[_0x0e1f('0x49')]);})[_0x0e1f('0x16')](function(_0x2e3422){_0x358638=_0x2e3422;logger[_0x0e1f('0xa')](_0x0e1f('0x4a'),_0x358638['id']);return getTicket(_0x12aba1,_0x3cf6f3,_0x358638,_0x2a75ca,_0x197520);})[_0x0e1f('0x16')](function(_0x4671dd){if(_0x4671dd){logger[_0x0e1f('0xa')](_0x0e1f('0x4b'),_0x4671dd['id']);switch(_0x12aba1[_0x0e1f('0x34')]){case _0x0e1f('0x4c'):logger[_0x0e1f('0xa')]('[QUEUE]',_0x0e1f('0x4d'));return request({'uri':util['format'](_0x0e1f('0x4e'),_0x12aba1[_0x0e1f('0xe')],_0x3cf6f3['id'],_0x4671dd['id']),'method':'POST'});case'newTab':logger[_0x0e1f('0xa')](_0x0e1f('0x4f'),_0x0e1f('0x50'));emit(util[_0x0e1f('0xc')](_0x0e1f('0x51'),_0x5d8223[_0x0e1f('0x3f')]),'trigger:browser:url',{'uri':util[_0x0e1f('0xc')](_0x0e1f('0x52'),_0x12aba1[_0x0e1f('0xe')],_0x4671dd['id'])});break;default:logger[_0x0e1f('0x53')](_0x0e1f('0x4f'),_0x0e1f('0x54'));}}})[_0x0e1f('0x55')](function(_0x3705aa){logger[_0x0e1f('0x53')](_0x0e1f('0x56'),util[_0x0e1f('0x57')](_0x3705aa,{'showHidden':!![],'depth':null}));});};exports[_0x0e1f('0x58')]=function(_0x3ff3cc,_0x348bda,_0x27515c,_0x59e2a8,_0x1a14ca,_0x5a7376,_0x4285ab){var _0xd4da63,_0x499dcf;_0x5a7376[_0x0e1f('0xe')]=intUtil[_0x0e1f('0x42')](_0x5a7376[_0x0e1f('0xe')]);_0x5a7376['serverUrl']=intUtil[_0x0e1f('0x42')](_0x5a7376[_0x0e1f('0x46')]);if(_0x4285ab&&_0x4285ab[_0x0e1f('0x59')]&&_0x4285ab[_0x0e1f('0x59')]!=='none'){logger['info'](_0x0e1f('0x5a'),_0x0e1f('0x43'));_0x348bda[_0x0e1f('0x44')]=util[_0x0e1f('0xc')](_0x0e1f('0x45'),_0x5a7376[_0x0e1f('0x46')],_0x348bda[_0x0e1f('0x47')],md5(_0x348bda[_0x0e1f('0x47')]));}headers[_0x0e1f('0x48')]=getAuth(_0x5a7376);return getUser(_0x5a7376,_0x59e2a8[_0x0e1f('0x5b')])[_0x0e1f('0x16')](function(_0xd96fdb){_0xd4da63=_0xd96fdb;logger[_0x0e1f('0xa')](_0x0e1f('0x5c'),_0xd4da63['id']);return getEndUser(_0x5a7376,_0x348bda[_0x0e1f('0x5d')],_0x348bda[_0x0e1f('0x5e')]);})['then'](function(_0x2f690f){_0x499dcf=_0x2f690f;logger['info'](_0x0e1f('0x4a'),_0x499dcf['id']);return getTicket(_0x5a7376,_0xd4da63,_0x499dcf,_0x27515c,_0x348bda);})[_0x0e1f('0x16')](function(_0x4ed6be){if(_0x4ed6be){logger[_0x0e1f('0xa')](_0x0e1f('0x4b'),_0x4ed6be['id']);switch(_0x5a7376[_0x0e1f('0x34')]){case _0x0e1f('0x4c'):logger[_0x0e1f('0xa')]('[OUTBOUND]',_0x0e1f('0x4d'));return request({'uri':util[_0x0e1f('0xc')](_0x0e1f('0x4e'),_0x5a7376['remoteUri'],_0xd4da63['id'],_0x4ed6be['id']),'method':_0x0e1f('0xf')});case _0x0e1f('0x5f'):logger[_0x0e1f('0xa')](_0x0e1f('0x5a'),_0x0e1f('0x50'));emit(util[_0x0e1f('0xc')](_0x0e1f('0x51'),_0x59e2a8['name']),_0x0e1f('0x60'),{'uri':util[_0x0e1f('0xc')](_0x0e1f('0x52'),_0x5a7376[_0x0e1f('0xe')],_0x4ed6be['id'])});break;default:logger[_0x0e1f('0x53')]('[OUTBOUND]',_0x0e1f('0x54'));}}})[_0x0e1f('0x55')](function(_0x2b1813){logger[_0x0e1f('0x53')](_0x0e1f('0x61'),util[_0x0e1f('0x57')](_0x2b1813,{'showHidden':!![],'depth':null}));});};exports[_0x0e1f('0x62')]=function(_0x58ca67,_0x367802,_0x7bfe96,_0x508915,_0x55b0f4,_0x5870e8){var _0x2bfa3d,_0x1f6a5e;_0x5870e8[_0x0e1f('0xe')]=intUtil['stripTrailingSlash'](_0x5870e8[_0x0e1f('0xe')]);_0x5870e8[_0x0e1f('0x46')]=intUtil[_0x0e1f('0x42')](_0x5870e8[_0x0e1f('0x46')]);if(_0x55b0f4&&_0x55b0f4[_0x0e1f('0x63')]){logger[_0x0e1f('0xa')](_0x0e1f('0x64'),_0x0e1f('0x43'));_0x367802[_0x0e1f('0x44')]=util['format'](_0x0e1f('0x45'),_0x5870e8[_0x0e1f('0x46')],_0x367802[_0x0e1f('0x47')],md5(_0x367802['uniqueid']));}else{_0x367802[_0x0e1f('0x44')]='';}headers[_0x0e1f('0x48')]=getAuth(_0x5870e8);return getUser(_0x5870e8)[_0x0e1f('0x16')](function(_0x5922e0){_0x2bfa3d=_0x5922e0;logger[_0x0e1f('0xa')]('The\x20User\x20ID\x20is:',_0x2bfa3d['id']);return getEndUser(_0x5870e8,_0x367802[_0x0e1f('0x65')],_0x367802[_0x0e1f('0x49')]);})['then'](function(_0x3266cb){_0x1f6a5e=_0x3266cb;logger[_0x0e1f('0xa')](_0x0e1f('0x4a'),_0x1f6a5e['id']);return getTicket(_0x5870e8,_0x2bfa3d,_0x1f6a5e,_0x7bfe96,_0x367802);})[_0x0e1f('0x16')](function(_0x350126){if(_0x350126){logger[_0x0e1f('0xa')](_0x0e1f('0x4b'),_0x350126['id']);}})['catch'](function(_0x1209f4){logger[_0x0e1f('0x53')]('[ABANDONED]\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x1209f4,{'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 d94ecf7..c9411cc 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 _0xa54c=['profile','Administrator','user','error','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','catch','Search\x20end\x20user','https://www.zohoapis.','Zoho-oauthtoken\x20','then','data','enduserType','End\x20user\x20found\x20(Contact)','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','End\x20user\x20found\x20(Lead)','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','/crm/v2/','moduleCreate','role','first_name','last_name','SUCCESS','Error\x20on\x20Lead\x20retrieve:\x20','Creating\x20new\x20call...','Owner','administrator','Description','getString','Descriptions','Contacts','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','utc','format','mm:ss','endtime','Call_Duration','YYYY-MM-DDTHH:mm:ss','diff','starttime','called','Call_Result','Called','complete','rejected','Rejected','abandoned','Abandoned','agentcalledAt','Call_Type','merge','Fields','/crm/v2/Calls','code','details','err','queue','host','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','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.','/crm/EntityInfo.do?module=Calls&id=','outbound','recordingFormat','[OUTBOUND]','destcalleridnum','monitor_format','[ABANDONED]','request-promise','util','moment','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','debug','[HTTP]','stringify','forEach','type','string','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','split','isNil','isBefore','expires_in','access_token','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','clientId','refresh_token','add','seconds','Failing\x20creating\x20the\x20access_token','GET','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','users','isArrayLikeObject','findIndex','email','info','Agent\x20found!','Using\x20the\x20admin\x20account!'];(function(_0x323bbb,_0x3b38af){var _0x178961=function(_0xdf9937){while(--_0xdf9937){_0x323bbb['push'](_0x323bbb['shift']());}};_0x178961(++_0x3b38af);}(_0xa54c,0xee));var _0xca54=function(_0x5d80de,_0x2cf15d){_0x5d80de=_0x5d80de-0x0;var _0x1c7556=_0xa54c[_0x5d80de];return _0x1c7556;};'use strict';var _=require('lodash');var rp=require(_0xca54('0x0'));var md5=require('md5');var util=require(_0xca54('0x1'));var intUtil=require('./util');var moment=require(_0xca54('0x2'));var Redis=require('ioredis');var config=require(_0xca54('0x3'));var logger=require(_0xca54('0x4'))('zoho');config[_0xca54('0x5')]=_[_0xca54('0x6')](config[_0xca54('0x5')],{'host':_0xca54('0x7'),'port':0x18eb});var io=require(_0xca54('0x8'))(new Redis(config['redis']));function emit(_0x4f55cf,_0x247241,_0x4937ba){io['to'](_0x4f55cf)[_0xca54('0x9')](_0x247241,_0x4937ba);}function request(_0x1811a6){logger[_0xca54('0xa')](_0xca54('0xb'),JSON[_0xca54('0xc')](_0x1811a6));return rp(_0x1811a6);}function getCustomFields(_0x1cb440,_0x17a78f){var _0x1394c8={};if(_0x1cb440['length']>0x0){_[_0xca54('0xd')](_0x1cb440,function(_0x47d594){if(_0x47d594[_0xca54('0xe')]===_0xca54('0xf')&&_0x47d594[_0xca54('0x10')]){_0x1394c8[_0x47d594[_0xca54('0x10')]]=_0x47d594[_0xca54('0x11')][_0xca54('0x12')]();}else if(_0x47d594['type']===_0xca54('0x13')&&_0x47d594[_0xca54('0x14')]&&_0x47d594[_0xca54('0x10')]&&_0x17a78f[_0x47d594[_0xca54('0x14')]]){_0x1394c8[_0x47d594[_0xca54('0x10')]]=_0x17a78f[_0x47d594['variableName']]['toString']();}else if(_0x47d594[_0xca54('0xe')]===_0xca54('0x15')&&_0x47d594[_0xca54('0x16')]&&_0x47d594[_0xca54('0x16')][_0xca54('0x17')]&&_0x47d594[_0xca54('0x10')]&&_0x17a78f[_0x47d594['Variable']['name'][_0xca54('0x18')]()]){_0x1394c8[_0x47d594[_0xca54('0x10')]]=_0x17a78f[_0x47d594[_0xca54('0x16')][_0xca54('0x17')][_0xca54('0x18')]()]['toString']();}});}return _0x1394c8;}function getName(_0x4612b3){if(_0x4612b3['indexOf']('\x20')>0x0){var _0x1c228f=_0x4612b3[_0xca54('0x19')](/ (.+)/);if(_0x1c228f[0x1]){return _0x1c228f;}}return[_0x4612b3,_0x4612b3];}var accountsTokens={};function getAccessToken(_0x28b771){return new Promise(function(_0x41effb,_0x506bab){if(!_[_0xca54('0x1a')](accountsTokens[_0x28b771['id']])&&!_['isNil'](accountsTokens[_0x28b771['id']]['access_token'])){if(moment()[_0xca54('0x1b')](accountsTokens[_0x28b771['id']][_0xca54('0x1c')])){_0x41effb(accountsTokens[_0x28b771['id']][_0xca54('0x1d')]);}}var _0x493a24;switch(_0x28b771[_0xca54('0x1e')]){case'US':_0x493a24=_0xca54('0x1f');break;case'AU':_0x493a24=_0xca54('0x20');break;case'EU':_0x493a24='https://accounts.zoho.eu';break;case'IN':_0x493a24=_0xca54('0x21');break;case'CN':_0x493a24=_0xca54('0x22');break;default:_0x493a24=_0xca54('0x23');break;}var _0x5eb882={'method':_0xca54('0x24'),'uri':_0x493a24+_0xca54('0x25'),'qs':{'refresh_token':_0x28b771[_0xca54('0x26')],'client_id':_0x28b771[_0xca54('0x27')],'client_secret':_0x28b771['clientSecret'],'grant_type':_0xca54('0x28')},'json':!![]};return rp(_0x5eb882)['then'](function(_0x4dd7a1){accountsTokens[_0x28b771['id']]={'access_token':_0x4dd7a1['access_token'],'expires_in':moment()[_0xca54('0x29')](_0x4dd7a1[_0xca54('0x1c')],_0xca54('0x2a'))};_0x41effb(_0x4dd7a1[_0xca54('0x1d')]);})['catch'](function(_0xda6dd){logger['error'](_0xca54('0x2b'),_0xda6dd['stack']);_0x506bab(_0xda6dd);});});}function getUser(_0xefae49,_0x410d1e,_0x440fc1,_0x2695e7){logger['info']('Search\x20user');return request({'method':_0xca54('0x2c'),'uri':util['format'](_0xca54('0x2d'),_0x410d1e),'qs':{'type':_0xca54('0x2e')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0xefae49},'json':!![]})['then'](function(_0x397996){if(_0x397996[_0xca54('0x2f')]){var _0x46bc52=-0x1;if(_[_0xca54('0x30')](_0x397996[_0xca54('0x2f')])){if(!_[_0xca54('0x1a')](_0x2695e7)){_0x46bc52=_[_0xca54('0x31')](_0x397996[_0xca54('0x2f')],function(_0x57cec8){return _0x57cec8[_0xca54('0x32')]===_0x2695e7;});}if(_0x46bc52>=0x0){logger[_0xca54('0x33')](_0xca54('0x34'));}else{logger[_0xca54('0x33')](_0xca54('0x35'));_0x46bc52=_[_0xca54('0x31')](_0x397996[_0xca54('0x2f')],function(_0x2738c8){return _0x2738c8[_0xca54('0x36')][_0xca54('0x17')]===_0xca54('0x37');});}return _0x397996[_0xca54('0x2f')][_0x46bc52];}else{if(_0x397996[_0xca54('0x38')][_0xca54('0x36')][_0xca54('0x17')]==='Administrator'){logger[_0xca54('0x33')]('Using\x20the\x20admin\x20account!');user=_0x397996[_0xca54('0x38')];return user;}else{logger[_0xca54('0x39')](_0xca54('0x3a'),JSON[_0xca54('0xc')](_0x397996));throw new Error(_0xca54('0x3b')+JSON[_0xca54('0xc')](_0x397996));}}}else{logger[_0xca54('0x39')](_0xca54('0x3a'),JSON['stringify'](_0x397996));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON['stringify'](_0x397996));}})[_0xca54('0x3c')](function(_0x1d3600){console[_0xca54('0x39')](_0x1d3600);});}function getEndUser(_0x222cd0,_0x46a5eb,_0x55b5c9,_0x1ee114,_0x56d16c,_0x3bd038,_0x54a718){logger[_0xca54('0x33')](_0xca54('0x3d'));return request({'method':_0xca54('0x2c'),'uri':_0xca54('0x3e')+_0x46a5eb+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x56d16c+'))','headers':{'Authorization':_0xca54('0x3f')+_0x222cd0},'json':!![]})[_0xca54('0x40')](function(_0x1f1e40){if(_0x1f1e40){var _0x5c6499=_0x1f1e40[_0xca54('0x41')][0x0];_0x5c6499[_0xca54('0x42')]='Contacts';logger[_0xca54('0x33')](_0xca54('0x43'));return _0x5c6499;}else{return request({'method':_0xca54('0x2c'),'uri':_0xca54('0x3e')+_0x46a5eb+_0xca54('0x44')+_0x56d16c+'))','headers':{'Authorization':_0xca54('0x3f')+_0x222cd0},'json':!![]})[_0xca54('0x40')](function(_0x2381ce){if(_0x2381ce){var _0x37b38f=_0x2381ce[_0xca54('0x41')][0x0];_0x37b38f[_0xca54('0x42')]=_0xca54('0x45');logger[_0xca54('0x33')](_0xca54('0x46'));return _0x37b38f;}else{logger[_0xca54('0x33')](_0xca54('0x47'));_0x1ee114=getName(_0x1ee114);return request({'method':'POST','uri':_0xca54('0x3e')+_0x46a5eb+_0xca54('0x48')+_0x54a718[_0xca54('0x49')],'body':{'data':[{'Last_Name':_0x1ee114[0x1],'First_Name':_0x1ee114[0x0],'Phone':_0x56d16c,'Owner':{'name':!_[_0xca54('0x1a')](_0x3bd038['role'][_0xca54('0x17')])?_0x3bd038[_0xca54('0x4a')][_0xca54('0x17')]:!_[_0xca54('0x1a')](_0x3bd038[_0xca54('0x4b')])?_0x3bd038[_0xca54('0x4b')]+'\x20'+_0x3bd038[_0xca54('0x4c')]:_0x3bd038[_0xca54('0x4c')],'id':_0x3bd038['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x222cd0},'json':!![]})['then'](function(_0x61e202){if(_0x61e202&&_0x61e202[_0xca54('0x41')][0x0]['code']===_0xca54('0x4d')){var _0x262f7a=_0x61e202[_0xca54('0x41')][0x0]['details'];_0x262f7a[_0xca54('0x42')]=_0x54a718[_0xca54('0x49')];return _0x262f7a;}logger[_0xca54('0x39')](_0xca54('0x3a'),JSON[_0xca54('0xc')](_0x61e202));throw new Error(_0xca54('0x4e')+JSON[_0xca54('0xc')](_0x61e202));});}});}});}function getCall(_0xec7165,_0x5cd4c8,_0x1ea944,_0x183ad4,_0x150a48,_0x2e8eb6,_0x583fdb,_0x2956c6){logger[_0xca54('0x33')](_0xca54('0x4f'));var _0x34032a={};_0x34032a[_0xca54('0x50')]={'name':!_[_0xca54('0x1a')](_0x183ad4[_0xca54('0x4a')][_0xca54('0x17')])&&!_['isNil'](_0x183ad4[_0xca54('0x36')][_0xca54('0x17')])&&_0x183ad4['profile']['name']===_0xca54('0x51')?_0x183ad4[_0xca54('0x4a')]['name']:!_['isNil'](_0x183ad4[_0xca54('0x4b')])?_0x183ad4[_0xca54('0x4b')]+'\x20'+_0x183ad4[_0xca54('0x4c')]:_0x183ad4[_0xca54('0x4c')],'id':_0x183ad4['id']};_0x34032a['Subject']=intUtil['getString'](_0x2e8eb6['Subjects'],_0x583fdb,'\x20');_0x34032a[_0xca54('0x52')]=intUtil[_0xca54('0x53')](_0x2e8eb6[_0xca54('0x54')],_0x583fdb,'\x0a');if(_0x150a48['enduserType']===_0xca54('0x55')){_0x34032a[_0xca54('0x56')]={'name':!_[_0xca54('0x1a')](_0x150a48[_0xca54('0x57')])?_0x150a48[_0xca54('0x57')]:!_[_0xca54('0x1a')](_0x150a48[_0xca54('0x58')])?_0x150a48[_0xca54('0x58')]+'\x20'+_0x150a48['Last_Name']:_0x150a48[_0xca54('0x59')],'id':_0x150a48['id']};}if(_0x150a48['enduserType']===_0xca54('0x45')){_0x34032a[_0xca54('0x5a')]={'name':!_[_0xca54('0x1a')](_0x150a48[_0xca54('0x57')])?_0x150a48[_0xca54('0x57')]:!_[_0xca54('0x1a')](_0x150a48[_0xca54('0x58')])?_0x150a48[_0xca54('0x58')]+'\x20'+_0x150a48[_0xca54('0x59')]:_0x150a48[_0xca54('0x59')],'id':_0x150a48['id']};_0x34032a[_0xca54('0x5b')]=_0x150a48[_0xca54('0x42')];}if(_0x583fdb[_0xca54('0x5c')]){_0x34032a['Call_Duration']=moment[_0xca54('0x5d')](parseInt(_0x583fdb[_0xca54('0x5c')])*0x3e8)[_0xca54('0x5e')](_0xca54('0x5f'));}else if(_0x583fdb['answertime']&&_0x583fdb[_0xca54('0x60')]){_0x34032a[_0xca54('0x61')]=moment[_0xca54('0x5d')](moment(_0x583fdb[_0xca54('0x60')],_0xca54('0x62'))[_0xca54('0x63')](moment(_0x583fdb[_0xca54('0x64')],_0xca54('0x62'))))[_0xca54('0x5e')](_0xca54('0x5f'));}switch(_0x583fdb['lastevent']){case _0xca54('0x65'):_0x34032a[_0xca54('0x66')]=_0xca54('0x67');break;case _0xca54('0x68'):case'connect':_0x34032a[_0xca54('0x66')]='Answered';break;case _0xca54('0x69'):_0x34032a[_0xca54('0x66')]=_0xca54('0x6a');break;case _0xca54('0x6b'):_0x34032a['Call_Result']=_0xca54('0x6c');break;default:}_0x34032a['Call_Start_Time']=(_0x2956c6==='outbound'?moment(_0x583fdb['starttime'])['format']('YYYY-MM-DDTHH:mm:ss'):moment(_0x583fdb[_0xca54('0x6d')])[_0xca54('0x5e')]('YYYY-MM-DDTHH:mm:ss'))||moment()[_0xca54('0x5e')](_0xca54('0x62'));_0x34032a[_0xca54('0x6e')]=_0x2956c6||'Inbound';_0x34032a=_[_0xca54('0x6f')](_0x34032a,getCustomFields(_0x2e8eb6[_0xca54('0x70')],_0x583fdb));return request({'method':_0xca54('0x24'),'uri':_0xca54('0x3e')+_0x5cd4c8+_0xca54('0x71'),'headers':{'Authorization':_0xca54('0x3f')+_0xec7165},'body':{'data':[_0x34032a]},'json':!![]})[_0xca54('0x40')](function(_0x23d445){if(_0x23d445&&_0x23d445['data'][0x0][_0xca54('0x72')]===_0xca54('0x4d')){logger[_0xca54('0x33')]('Call\x20created!');return{'id':_0x23d445[_0xca54('0x41')][0x0][_0xca54('0x73')]['id']};}})['catch'](function(_0x802406){logger['info']('err',_0x802406['stack']);console['log'](_0xca54('0x74'),_0x802406);});}exports[_0xca54('0x75')]=function(_0x15a1e2,_0x19d1ff,_0x565f6c,_0x188f74,_0x148e98,_0x5356ac){var _0x40e2f4,_0x119438,_0x2eadb4;_0x5356ac[_0xca54('0x76')]=intUtil[_0xca54('0x77')](_0x5356ac[_0xca54('0x76')]);_0x5356ac[_0xca54('0x78')]=intUtil[_0xca54('0x77')](_0x5356ac[_0xca54('0x78')]);if(_0x148e98&&_0x148e98['monitor_format']){logger['info'](_0xca54('0x79'),_0xca54('0x7a'));_0x19d1ff[_0xca54('0x7b')]=_0x5356ac[_0xca54('0x78')]+_0xca54('0x7c')+_0x19d1ff[_0xca54('0x7d')]+_0xca54('0x7e')+md5(_0x19d1ff[_0xca54('0x7d')]);}else{_0x19d1ff[_0xca54('0x7b')]='';}var _0x39f22c=_0x5356ac[_0xca54('0x76')]===_0xca54('0x7f')?'eu':_0xca54('0x80');return getAccessToken(_0x5356ac)[_0xca54('0x40')](function(_0x59d1e7){_0x2eadb4=_0x59d1e7;return getUser(_0x2eadb4,_0x39f22c,_0x5356ac,_0x188f74[_0xca54('0x32')]);})[_0xca54('0x40')](function(_0x4a7af4){_0x40e2f4=_0x4a7af4;logger['info'](_0xca54('0x81'),_0x40e2f4['id']);return getEndUser(_0x2eadb4,_0x39f22c,_0x5356ac,_0x19d1ff[_0xca54('0x82')],_0x19d1ff[_0xca54('0x83')],_0x40e2f4,_0x565f6c);})[_0xca54('0x40')](function(_0xa62c72){_0x119438=_0xa62c72;logger['info'](_0xca54('0x84'),_0x119438['id']);return getCall(_0x2eadb4,_0x39f22c,_0x5356ac,_0x40e2f4,_0x119438,_0x565f6c,_0x19d1ff,_0xca54('0x85'));})[_0xca54('0x40')](function(_0x2047fc){if(_0x2047fc){logger[_0xca54('0x33')](_0xca54('0x86'),_0x2047fc['id']);logger['info'](_0xca54('0x79'),_0xca54('0x87'));emit(util[_0xca54('0x5e')](_0xca54('0x88'),_0x188f74[_0xca54('0x17')]),_0xca54('0x89'),{'uri':_0xca54('0x8a')+_0x5356ac[_0xca54('0x76')]+_0xca54('0x8b')+_0x2047fc['id']});}})[_0xca54('0x3c')](function(_0x1dfbeb){logger[_0xca54('0x39')](_0xca54('0x79'),JSON[_0xca54('0xc')](_0x1dfbeb));});};exports[_0xca54('0x8c')]=function(_0x20c2ff,_0x287f1d,_0x97c9ab,_0x41eb0e,_0x4842d4,_0x2bc0ed,_0x2812c4){var _0x4f155a,_0x27db98,_0x44760f;_0x2bc0ed[_0xca54('0x76')]=intUtil[_0xca54('0x77')](_0x2bc0ed[_0xca54('0x76')]);_0x2bc0ed[_0xca54('0x78')]=intUtil['stripTrailingSlash'](_0x2bc0ed[_0xca54('0x78')]);if(_0x2812c4&&_0x2812c4[_0xca54('0x8d')]&&_0x2812c4[_0xca54('0x8d')]!=='none'){logger['info'](_0xca54('0x8e'),_0xca54('0x7a'));_0x287f1d[_0xca54('0x7b')]=_0x2bc0ed['serverUrl']+'/api/voice/recordings/'+_0x287f1d[_0xca54('0x7d')]+'/downloads?type=uniqueid&token='+md5(_0x287f1d[_0xca54('0x7d')]);}var _0x3506ff=_0x2bc0ed[_0xca54('0x76')]===_0xca54('0x7f')?'eu':_0xca54('0x80');return getAccessToken(_0x2bc0ed)[_0xca54('0x40')](function(_0x1dab6c){_0x44760f=_0x1dab6c;return getUser(_0x44760f,_0x3506ff,_0x2bc0ed,_0x41eb0e['email']);})['then'](function(_0x3361a0){_0x4f155a=_0x3361a0;logger[_0xca54('0x33')](_0xca54('0x81'),_0x4f155a['id']);return getEndUser(_0x44760f,_0x3506ff,_0x2bc0ed,_0x287f1d['destcalleridname'],_0x287f1d[_0xca54('0x8f')],_0x4f155a,_0x97c9ab);})[_0xca54('0x40')](function(_0x37704a){_0x27db98=_0x37704a;logger[_0xca54('0x33')](_0xca54('0x84'),_0x27db98['id']);return getCall(_0x44760f,_0x3506ff,_0x2bc0ed,_0x4f155a,_0x27db98,_0x97c9ab,_0x287f1d,'Outbound');})[_0xca54('0x40')](function(_0x94e8ef){if(_0x94e8ef){logger['info'](_0xca54('0x86'),_0x94e8ef['id']);logger[_0xca54('0x33')](_0xca54('0x8e'),_0xca54('0x87'));emit(util[_0xca54('0x5e')](_0xca54('0x88'),_0x41eb0e[_0xca54('0x17')]),_0xca54('0x89'),{'uri':_0xca54('0x8a')+_0x2bc0ed[_0xca54('0x76')]+'/crm/EntityInfo.do?module=Calls&id='+_0x94e8ef['id']});}})[_0xca54('0x3c')](function(_0x2ac6dd){logger[_0xca54('0x39')](_0xca54('0x8e'),JSON['stringify'](_0x2ac6dd));});};exports[_0xca54('0x6b')]=function(_0x34cd83,_0xc5a044,_0x23be74,_0x31d674,_0x3dbe1e,_0xe4baac){var _0x953327,_0x1594ae,_0xa2c5b8;_0xe4baac['host']=intUtil[_0xca54('0x77')](_0xe4baac[_0xca54('0x76')]);_0xe4baac['serverUrl']=intUtil[_0xca54('0x77')](_0xe4baac[_0xca54('0x78')]);if(_0x3dbe1e&&_0x3dbe1e[_0xca54('0x90')]){logger[_0xca54('0x33')](_0xca54('0x91'),_0xca54('0x7a'));_0xc5a044[_0xca54('0x7b')]=_0xe4baac[_0xca54('0x78')]+_0xca54('0x7c')+_0xc5a044[_0xca54('0x7d')]+_0xca54('0x7e')+md5(_0xc5a044[_0xca54('0x7d')]);}else{_0xc5a044[_0xca54('0x7b')]='';}var _0x24ea60=_0xe4baac[_0xca54('0x76')]===_0xca54('0x7f')?'eu':'com';return getAccessToken(_0xe4baac)['then'](function(_0x1d5e82){_0xa2c5b8=_0x1d5e82;return getUser(_0xa2c5b8,_0x24ea60,_0xe4baac);})['then'](function(_0x122dc3){_0x953327=_0x122dc3;logger['info']('The\x20User\x20ID\x20is:',_0x953327['id']);return getEndUser(_0xa2c5b8,_0x24ea60,_0xe4baac,_0xc5a044[_0xca54('0x82')],_0xc5a044[_0xca54('0x83')],_0x953327,_0x23be74);})['then'](function(_0xa78a56){_0x1594ae=_0xa78a56;logger[_0xca54('0x33')]('The\x20Enduser\x20ID\x20is:',_0x1594ae['id']);return getCall(_0xa2c5b8,_0x24ea60,_0xe4baac,_0x953327,_0x1594ae,_0x23be74,_0xc5a044,_0xca54('0x85'));})[_0xca54('0x40')](function(_0x3dba49){if(_0x3dba49){logger[_0xca54('0x33')](_0xca54('0x86'),_0x3dba49['id']);}})[_0xca54('0x3c')](function(_0x1693c3){logger[_0xca54('0x39')](_0xca54('0x91'),JSON[_0xca54('0xc')](_0x1693c3));});}; \ No newline at end of file +var _0x1055=['https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientSecret','refresh_token','then','add','seconds','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','format','ActiveUsers','Zoho-oauthtoken\x20','isArrayLikeObject','users','findIndex','email','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','error','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','catch','Search\x20end\x20user','https://www.zohoapis.','/crm/v2/Contacts/search?criteria=((Phone:equals:','data','enduserType','Contacts','End\x20user\x20found\x20(Contact)','/crm/v2/Leads/search?criteria=((Phone:equals:','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','moduleCreate','role','first_name','last_name','code','details','Creating\x20new\x20call...','Owner','administrator','Subject','getString','Subjects','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','Leads','What_Id','$se_module','talktime','Call_Duration','utc','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','mm:ss','lastevent','Call_Result','Called','complete','Answered','rejected','abandoned','Abandoned','Call_Start_Time','outbound','agentcalledAt','Call_Type','Inbound','merge','Fields','SUCCESS','Call\x20created!','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','com','calleridname','The\x20Enduser\x20ID\x20is:','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','zoho.eu','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Outbound','[ABANDONED]','calleridnum','request-promise','md5','util','./util','ioredis','../../../../config/logger','zoho','redis','defaults','socket.io-emitter','emit','debug','[HTTP]','stringify','length','forEach','type','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','expires_in','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu'];(function(_0x183e0d,_0x56285a){var _0x8d0789=function(_0x2e06df){while(--_0x2e06df){_0x183e0d['push'](_0x183e0d['shift']());}};_0x8d0789(++_0x56285a);}(_0x1055,0x1a5));var _0x5105=function(_0x2ef44b,_0x553359){_0x2ef44b=_0x2ef44b-0x0;var _0x2405b9=_0x1055[_0x2ef44b];return _0x2405b9;};'use strict';var _=require('lodash');var rp=require(_0x5105('0x0'));var md5=require(_0x5105('0x1'));var util=require(_0x5105('0x2'));var intUtil=require(_0x5105('0x3'));var moment=require('moment');var Redis=require(_0x5105('0x4'));var config=require('../../../../config/environment');var logger=require(_0x5105('0x5'))(_0x5105('0x6'));config[_0x5105('0x7')]=_[_0x5105('0x8')](config[_0x5105('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x5105('0x9'))(new Redis(config[_0x5105('0x7')]));function emit(_0x6154dd,_0x3d0737,_0x3ab79b){io['to'](_0x6154dd)[_0x5105('0xa')](_0x3d0737,_0x3ab79b);}function request(_0x3eb8c0){logger[_0x5105('0xb')](_0x5105('0xc'),JSON[_0x5105('0xd')](_0x3eb8c0));return rp(_0x3eb8c0);}function getCustomFields(_0x5e18d2,_0x26bfea){var _0xf0ec53={};if(_0x5e18d2[_0x5105('0xe')]>0x0){_[_0x5105('0xf')](_0x5e18d2,function(_0x48fc0d){if(_0x48fc0d[_0x5105('0x10')]==='string'&&_0x48fc0d[_0x5105('0x11')]){_0xf0ec53[_0x48fc0d[_0x5105('0x11')]]=_0x48fc0d[_0x5105('0x12')][_0x5105('0x13')]();}else if(_0x48fc0d[_0x5105('0x10')]===_0x5105('0x14')&&_0x48fc0d[_0x5105('0x15')]&&_0x48fc0d[_0x5105('0x11')]&&_0x26bfea[_0x48fc0d[_0x5105('0x15')]]){_0xf0ec53[_0x48fc0d[_0x5105('0x11')]]=_0x26bfea[_0x48fc0d[_0x5105('0x15')]]['toString']();}else if(_0x48fc0d[_0x5105('0x10')]===_0x5105('0x16')&&_0x48fc0d[_0x5105('0x17')]&&_0x48fc0d[_0x5105('0x17')][_0x5105('0x18')]&&_0x48fc0d[_0x5105('0x11')]&&_0x26bfea[_0x48fc0d['Variable'][_0x5105('0x18')][_0x5105('0x19')]()]){_0xf0ec53[_0x48fc0d[_0x5105('0x11')]]=_0x26bfea[_0x48fc0d['Variable']['name'][_0x5105('0x19')]()][_0x5105('0x13')]();}});}return _0xf0ec53;}function getName(_0xff191b){if(_0xff191b[_0x5105('0x1a')]('\x20')>0x0){var _0x908fe8=_0xff191b[_0x5105('0x1b')](/ (.+)/);if(_0x908fe8[0x1]){return _0x908fe8;}}return[_0xff191b,_0xff191b];}var accountsTokens={};function getAccessToken(_0x2373c5){return new Promise(function(_0x473bef,_0x32502a){if(!_[_0x5105('0x1c')](accountsTokens[_0x2373c5['id']])&&!_[_0x5105('0x1c')](accountsTokens[_0x2373c5['id']][_0x5105('0x1d')])){if(moment()[_0x5105('0x1e')](accountsTokens[_0x2373c5['id']][_0x5105('0x1f')])){_0x473bef(accountsTokens[_0x2373c5['id']][_0x5105('0x1d')]);}}var _0x97fa6b;switch(_0x2373c5['zone']){case'US':_0x97fa6b=_0x5105('0x20');break;case'AU':_0x97fa6b=_0x5105('0x21');break;case'EU':_0x97fa6b=_0x5105('0x22');break;case'IN':_0x97fa6b=_0x5105('0x23');break;case'CN':_0x97fa6b=_0x5105('0x24');break;default:_0x97fa6b='https://accounts.zoho.eu';break;}var _0x45fa59={'method':_0x5105('0x25'),'uri':_0x97fa6b+_0x5105('0x26'),'qs':{'refresh_token':_0x2373c5[_0x5105('0x27')],'client_id':_0x2373c5['clientId'],'client_secret':_0x2373c5[_0x5105('0x28')],'grant_type':_0x5105('0x29')},'json':!![]};return rp(_0x45fa59)[_0x5105('0x2a')](function(_0xe3e1bd){accountsTokens[_0x2373c5['id']]={'access_token':_0xe3e1bd[_0x5105('0x1d')],'expires_in':moment()[_0x5105('0x2b')](_0xe3e1bd[_0x5105('0x1f')],_0x5105('0x2c'))};_0x473bef(_0xe3e1bd['access_token']);})['catch'](function(_0x55d6f4){logger['error'](_0x5105('0x2d'),_0x55d6f4[_0x5105('0x2e')]);_0x32502a(_0x55d6f4);});});}function getUser(_0x22d230,_0x45e5ea,_0x40cada,_0x375846){logger[_0x5105('0x2f')](_0x5105('0x30'));return request({'method':_0x5105('0x31'),'uri':util[_0x5105('0x32')]('https://www.zohoapis.%s/crm/v2/users',_0x45e5ea),'qs':{'type':_0x5105('0x33')},'headers':{'Authorization':_0x5105('0x34')+_0x22d230},'json':!![]})[_0x5105('0x2a')](function(_0x258566){if(_0x258566['users']){var _0x2d6f1e=-0x1;if(_[_0x5105('0x35')](_0x258566[_0x5105('0x36')])){if(!_[_0x5105('0x1c')](_0x375846)){_0x2d6f1e=_[_0x5105('0x37')](_0x258566['users'],function(_0x272211){return _0x272211[_0x5105('0x38')]===_0x375846;});}if(_0x2d6f1e>=0x0){logger['info'](_0x5105('0x39'));}else{logger[_0x5105('0x2f')](_0x5105('0x3a'));_0x2d6f1e=_[_0x5105('0x37')](_0x258566[_0x5105('0x36')],function(_0x34ede6){return _0x34ede6[_0x5105('0x3b')]['name']===_0x5105('0x3c');});}return _0x258566[_0x5105('0x36')][_0x2d6f1e];}else{if(_0x258566['user']['profile'][_0x5105('0x18')]===_0x5105('0x3c')){logger['info'](_0x5105('0x3a'));user=_0x258566['user'];return user;}else{logger[_0x5105('0x3d')](_0x5105('0x3e'),JSON[_0x5105('0xd')](_0x258566));throw new Error(_0x5105('0x3f')+JSON['stringify'](_0x258566));}}}else{logger['error'](_0x5105('0x3e'),JSON[_0x5105('0xd')](_0x258566));throw new Error(_0x5105('0x3f')+JSON[_0x5105('0xd')](_0x258566));}})[_0x5105('0x40')](function(_0x49d216){console[_0x5105('0x3d')](_0x49d216);});}function getEndUser(_0x2882fd,_0x52a864,_0x3ce4ec,_0x252fd3,_0x1fcd32,_0x1e1b0c,_0x1c5893){logger[_0x5105('0x2f')](_0x5105('0x41'));return request({'method':'GET','uri':_0x5105('0x42')+_0x52a864+_0x5105('0x43')+_0x1fcd32+'))','headers':{'Authorization':_0x5105('0x34')+_0x2882fd},'json':!![]})[_0x5105('0x2a')](function(_0x299727){if(_0x299727){var _0x283217=_0x299727[_0x5105('0x44')][0x0];_0x283217[_0x5105('0x45')]=_0x5105('0x46');logger[_0x5105('0x2f')](_0x5105('0x47'));return _0x283217;}else{return request({'method':_0x5105('0x31'),'uri':_0x5105('0x42')+_0x52a864+_0x5105('0x48')+_0x1fcd32+'))','headers':{'Authorization':_0x5105('0x34')+_0x2882fd},'json':!![]})[_0x5105('0x2a')](function(_0x3468da){if(_0x3468da){var _0x2b9e63=_0x3468da['data'][0x0];_0x2b9e63[_0x5105('0x45')]='Leads';logger[_0x5105('0x2f')]('End\x20user\x20found\x20(Lead)');return _0x2b9e63;}else{logger[_0x5105('0x2f')](_0x5105('0x49'));_0x252fd3=getName(_0x252fd3);return request({'method':_0x5105('0x25'),'uri':'https://www.zohoapis.'+_0x52a864+'/crm/v2/'+_0x1c5893[_0x5105('0x4a')],'body':{'data':[{'Last_Name':_0x252fd3[0x1],'First_Name':_0x252fd3[0x0],'Phone':_0x1fcd32,'Owner':{'name':!_[_0x5105('0x1c')](_0x1e1b0c[_0x5105('0x4b')][_0x5105('0x18')])?_0x1e1b0c[_0x5105('0x4b')][_0x5105('0x18')]:!_[_0x5105('0x1c')](_0x1e1b0c[_0x5105('0x4c')])?_0x1e1b0c[_0x5105('0x4c')]+'\x20'+_0x1e1b0c[_0x5105('0x4d')]:_0x1e1b0c['last_name'],'id':_0x1e1b0c['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x2882fd},'json':!![]})[_0x5105('0x2a')](function(_0x20a7ed){if(_0x20a7ed&&_0x20a7ed[_0x5105('0x44')][0x0][_0x5105('0x4e')]==='SUCCESS'){var _0xec5d94=_0x20a7ed[_0x5105('0x44')][0x0][_0x5105('0x4f')];_0xec5d94['enduserType']=_0x1c5893[_0x5105('0x4a')];return _0xec5d94;}logger['error'](_0x5105('0x3e'),JSON[_0x5105('0xd')](_0x20a7ed));throw new Error('Error\x20on\x20Lead\x20retrieve:\x20'+JSON[_0x5105('0xd')](_0x20a7ed));});}});}});}function getCall(_0x4d5152,_0x578a99,_0x2c6d81,_0x24be60,_0x4f2a00,_0x5cbded,_0x486dbe,_0x2a3a32){logger[_0x5105('0x2f')](_0x5105('0x50'));var _0x3c1557={};_0x3c1557[_0x5105('0x51')]={'name':!_[_0x5105('0x1c')](_0x24be60['role'][_0x5105('0x18')])&&!_[_0x5105('0x1c')](_0x24be60[_0x5105('0x3b')]['name'])&&_0x24be60['profile'][_0x5105('0x18')]===_0x5105('0x52')?_0x24be60['role'][_0x5105('0x18')]:!_[_0x5105('0x1c')](_0x24be60[_0x5105('0x4c')])?_0x24be60[_0x5105('0x4c')]+'\x20'+_0x24be60[_0x5105('0x4d')]:_0x24be60[_0x5105('0x4d')],'id':_0x24be60['id']};_0x3c1557[_0x5105('0x53')]=intUtil[_0x5105('0x54')](_0x5cbded[_0x5105('0x55')],_0x486dbe,'\x20');_0x3c1557[_0x5105('0x56')]=intUtil['getString'](_0x5cbded[_0x5105('0x57')],_0x486dbe,'\x0a');if(_0x4f2a00[_0x5105('0x45')]===_0x5105('0x46')){_0x3c1557[_0x5105('0x58')]={'name':!_[_0x5105('0x1c')](_0x4f2a00[_0x5105('0x59')])?_0x4f2a00[_0x5105('0x59')]:!_[_0x5105('0x1c')](_0x4f2a00['First_Name'])?_0x4f2a00[_0x5105('0x5a')]+'\x20'+_0x4f2a00[_0x5105('0x5b')]:_0x4f2a00[_0x5105('0x5b')],'id':_0x4f2a00['id']};}if(_0x4f2a00[_0x5105('0x45')]===_0x5105('0x5c')){_0x3c1557[_0x5105('0x5d')]={'name':!_[_0x5105('0x1c')](_0x4f2a00[_0x5105('0x59')])?_0x4f2a00[_0x5105('0x59')]:!_[_0x5105('0x1c')](_0x4f2a00['First_Name'])?_0x4f2a00['First_Name']+'\x20'+_0x4f2a00[_0x5105('0x5b')]:_0x4f2a00[_0x5105('0x5b')],'id':_0x4f2a00['id']};_0x3c1557[_0x5105('0x5e')]=_0x4f2a00[_0x5105('0x45')];}if(_0x486dbe[_0x5105('0x5f')]){_0x3c1557[_0x5105('0x60')]=moment[_0x5105('0x61')](parseInt(_0x486dbe[_0x5105('0x5f')])*0x3e8)['format']('mm:ss');}else if(_0x486dbe[_0x5105('0x62')]&&_0x486dbe[_0x5105('0x63')]){_0x3c1557[_0x5105('0x60')]=moment[_0x5105('0x61')](moment(_0x486dbe['endtime'],_0x5105('0x64'))[_0x5105('0x65')](moment(_0x486dbe[_0x5105('0x66')],'YYYY-MM-DDTHH:mm:ss')))[_0x5105('0x32')](_0x5105('0x67'));}switch(_0x486dbe[_0x5105('0x68')]){case'called':_0x3c1557[_0x5105('0x69')]=_0x5105('0x6a');break;case _0x5105('0x6b'):case'connect':_0x3c1557[_0x5105('0x69')]=_0x5105('0x6c');break;case _0x5105('0x6d'):_0x3c1557[_0x5105('0x69')]='Rejected';break;case _0x5105('0x6e'):_0x3c1557[_0x5105('0x69')]=_0x5105('0x6f');break;default:}_0x3c1557[_0x5105('0x70')]=(_0x2a3a32===_0x5105('0x71')?moment(_0x486dbe['starttime'])[_0x5105('0x32')](_0x5105('0x64')):moment(_0x486dbe[_0x5105('0x72')])[_0x5105('0x32')](_0x5105('0x64')))||moment()['format'](_0x5105('0x64'));_0x3c1557[_0x5105('0x73')]=_0x2a3a32||_0x5105('0x74');_0x3c1557=_[_0x5105('0x75')](_0x3c1557,getCustomFields(_0x5cbded[_0x5105('0x76')],_0x486dbe));return request({'method':_0x5105('0x25'),'uri':'https://www.zohoapis.'+_0x578a99+'/crm/v2/Calls','headers':{'Authorization':_0x5105('0x34')+_0x4d5152},'body':{'data':[_0x3c1557]},'json':!![]})[_0x5105('0x2a')](function(_0x2277d9){if(_0x2277d9&&_0x2277d9[_0x5105('0x44')][0x0][_0x5105('0x4e')]===_0x5105('0x77')){logger[_0x5105('0x2f')](_0x5105('0x78'));return{'id':_0x2277d9['data'][0x0][_0x5105('0x4f')]['id']};}})['catch'](function(_0x1f52e6){logger[_0x5105('0x2f')](_0x5105('0x79'),_0x1f52e6[_0x5105('0x2e')]);console['log'](_0x5105('0x79'),_0x1f52e6);});}exports[_0x5105('0x7a')]=function(_0x207a83,_0x4da44a,_0x56e1c9,_0x48ba81,_0x3f7a6e,_0x8bc0fd){var _0x3079f7,_0x171bb9,_0xa86c14;_0x8bc0fd[_0x5105('0x7b')]=intUtil[_0x5105('0x7c')](_0x8bc0fd[_0x5105('0x7b')]);_0x8bc0fd[_0x5105('0x7d')]=intUtil['stripTrailingSlash'](_0x8bc0fd['serverUrl']);if(_0x3f7a6e&&_0x3f7a6e[_0x5105('0x7e')]){logger['info'](_0x5105('0x7f'),_0x5105('0x80'));_0x4da44a[_0x5105('0x81')]=_0x8bc0fd[_0x5105('0x7d')]+_0x5105('0x82')+_0x4da44a[_0x5105('0x83')]+_0x5105('0x84')+md5(_0x4da44a[_0x5105('0x83')]);}else{_0x4da44a[_0x5105('0x81')]='';}var _0xfe7859=_0x8bc0fd['host']==='zoho.eu'?'eu':_0x5105('0x85');return getAccessToken(_0x8bc0fd)[_0x5105('0x2a')](function(_0x29c522){_0xa86c14=_0x29c522;return getUser(_0xa86c14,_0xfe7859,_0x8bc0fd,_0x48ba81['email']);})['then'](function(_0x45b945){_0x3079f7=_0x45b945;logger['info']('The\x20User\x20ID\x20is:',_0x3079f7['id']);return getEndUser(_0xa86c14,_0xfe7859,_0x8bc0fd,_0x4da44a[_0x5105('0x86')],_0x4da44a['calleridnum'],_0x3079f7,_0x56e1c9);})[_0x5105('0x2a')](function(_0x3b3395){_0x171bb9=_0x3b3395;logger[_0x5105('0x2f')](_0x5105('0x87'),_0x171bb9['id']);return getCall(_0xa86c14,_0xfe7859,_0x8bc0fd,_0x3079f7,_0x171bb9,_0x56e1c9,_0x4da44a,_0x5105('0x74'));})['then'](function(_0x115cd2){if(_0x115cd2){logger[_0x5105('0x2f')](_0x5105('0x88'),_0x115cd2['id']);logger[_0x5105('0x2f')](_0x5105('0x7f'),_0x5105('0x89'));emit(util['format'](_0x5105('0x8a'),_0x48ba81['name']),_0x5105('0x8b'),{'uri':_0x5105('0x8c')+_0x8bc0fd['host']+_0x5105('0x8d')+_0x115cd2['id']});}})[_0x5105('0x40')](function(_0x328b40){logger[_0x5105('0x3d')]('[QUEUE]',JSON['stringify'](_0x328b40));});};exports[_0x5105('0x71')]=function(_0x52c58f,_0x5ced51,_0x4f63f0,_0x248b4a,_0x108bbe,_0x36d64c,_0x58bd62){var _0x20de5f,_0x4bb5b7,_0x1fb5ad;_0x36d64c[_0x5105('0x7b')]=intUtil[_0x5105('0x7c')](_0x36d64c[_0x5105('0x7b')]);_0x36d64c['serverUrl']=intUtil[_0x5105('0x7c')](_0x36d64c[_0x5105('0x7d')]);if(_0x58bd62&&_0x58bd62[_0x5105('0x8e')]&&_0x58bd62[_0x5105('0x8e')]!==_0x5105('0x8f')){logger[_0x5105('0x2f')](_0x5105('0x90'),_0x5105('0x80'));_0x5ced51[_0x5105('0x81')]=_0x36d64c[_0x5105('0x7d')]+'/api/voice/recordings/'+_0x5ced51[_0x5105('0x83')]+_0x5105('0x84')+md5(_0x5ced51['uniqueid']);}var _0x3748a8=_0x36d64c[_0x5105('0x7b')]===_0x5105('0x91')?'eu':_0x5105('0x85');return getAccessToken(_0x36d64c)[_0x5105('0x2a')](function(_0x93bc21){_0x1fb5ad=_0x93bc21;return getUser(_0x1fb5ad,_0x3748a8,_0x36d64c,_0x248b4a[_0x5105('0x38')]);})[_0x5105('0x2a')](function(_0x246fc6){_0x20de5f=_0x246fc6;logger['info'](_0x5105('0x92'),_0x20de5f['id']);return getEndUser(_0x1fb5ad,_0x3748a8,_0x36d64c,_0x5ced51[_0x5105('0x93')],_0x5ced51[_0x5105('0x94')],_0x20de5f,_0x4f63f0);})[_0x5105('0x2a')](function(_0x510e49){_0x4bb5b7=_0x510e49;logger['info'](_0x5105('0x87'),_0x4bb5b7['id']);return getCall(_0x1fb5ad,_0x3748a8,_0x36d64c,_0x20de5f,_0x4bb5b7,_0x4f63f0,_0x5ced51,_0x5105('0x95'));})[_0x5105('0x2a')](function(_0x3e6dc5){if(_0x3e6dc5){logger[_0x5105('0x2f')](_0x5105('0x88'),_0x3e6dc5['id']);logger[_0x5105('0x2f')](_0x5105('0x90'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x5105('0x32')]('user:%s',_0x248b4a[_0x5105('0x18')]),_0x5105('0x8b'),{'uri':'https://crm.'+_0x36d64c['host']+'/crm/EntityInfo.do?module=Calls&id='+_0x3e6dc5['id']});}})[_0x5105('0x40')](function(_0x46cc61){logger[_0x5105('0x3d')](_0x5105('0x90'),JSON['stringify'](_0x46cc61));});};exports[_0x5105('0x6e')]=function(_0x9aae78,_0x2da571,_0x57b3af,_0x4b4c90,_0x2eb21f,_0x48d52f){var _0x2a11f3,_0x304164,_0x72cd9a;_0x48d52f[_0x5105('0x7b')]=intUtil[_0x5105('0x7c')](_0x48d52f[_0x5105('0x7b')]);_0x48d52f[_0x5105('0x7d')]=intUtil[_0x5105('0x7c')](_0x48d52f[_0x5105('0x7d')]);if(_0x2eb21f&&_0x2eb21f[_0x5105('0x7e')]){logger['info'](_0x5105('0x96'),'Recording\x20is\x20enabled!');_0x2da571[_0x5105('0x81')]=_0x48d52f[_0x5105('0x7d')]+_0x5105('0x82')+_0x2da571['uniqueid']+'/downloads?type=uniqueid&token='+md5(_0x2da571[_0x5105('0x83')]);}else{_0x2da571['recordingURL']='';}var _0x5f2af9=_0x48d52f[_0x5105('0x7b')]==='zoho.eu'?'eu':_0x5105('0x85');return getAccessToken(_0x48d52f)[_0x5105('0x2a')](function(_0x45cb4b){_0x72cd9a=_0x45cb4b;return getUser(_0x72cd9a,_0x5f2af9,_0x48d52f);})[_0x5105('0x2a')](function(_0x34d888){_0x2a11f3=_0x34d888;logger[_0x5105('0x2f')](_0x5105('0x92'),_0x2a11f3['id']);return getEndUser(_0x72cd9a,_0x5f2af9,_0x48d52f,_0x2da571['calleridname'],_0x2da571[_0x5105('0x97')],_0x2a11f3,_0x57b3af);})[_0x5105('0x2a')](function(_0xc78e2d){_0x304164=_0xc78e2d;logger[_0x5105('0x2f')](_0x5105('0x87'),_0x304164['id']);return getCall(_0x72cd9a,_0x5f2af9,_0x48d52f,_0x2a11f3,_0x304164,_0x57b3af,_0x2da571,'Inbound');})[_0x5105('0x2a')](function(_0x166ff0){if(_0x166ff0){logger[_0x5105('0x2f')](_0x5105('0x88'),_0x166ff0['id']);}})[_0x5105('0x40')](function(_0xcab80c){logger[_0x5105('0x3d')](_0x5105('0x96'),JSON[_0x5105('0xd')](_0xcab80c));});}; \ 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 7b87ac9..782832f 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(_0xc2d579,_0x49c902){var _0x2a881b=function(_0x282b7d){while(--_0x282b7d){_0xc2d579['push'](_0xc2d579['shift']());}};_0x2a881b(++_0x49c902);}(_0x7a54,0x106));var _0x47a5=function(_0x5b27d,_0x54eb28){_0x5b27d=_0x5b27d-0x0;var _0x4efc08=_0x7a54[_0x5b27d];return _0x4efc08;};'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(_0x2970ab,_0x285d14){var _0x14c000=function(_0x575735){while(--_0x575735){_0x2970ab['push'](_0x2970ab['shift']());}};_0x14c000(++_0x285d14);}(_0x7a54,0x106));var _0x47a5=function(_0x4b955b,_0x23c8cb){_0x4b955b=_0x4b955b-0x0;var _0x42e201=_0x7a54[_0x4b955b];return _0x42e201;};'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 0166116..6657749 100644 --- a/server/services/ami/trigger/urlforward/index.js +++ b/server/services/ami/trigger/urlforward/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['data6','parse','stack','data1','GET','DELETE','POST','PUT','render','data7','body','error','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','then',',\x20request\x20body:\x20','object','stringify','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','name','request-promise','util','lodash','../../../../config/logger','trigger','toUpperCase','data2','data5'];(function(_0x262a5b,_0x547a00){var _0x5bc686=function(_0x2bbd3a){while(--_0x2bbd3a){_0x262a5b['push'](_0x262a5b['shift']());}};_0x5bc686(++_0x547a00);}(_0x7a54,0x106));var _0x47a5=function(_0x5cc5ee,_0x56b33b){_0x5cc5ee=_0x5cc5ee-0x0;var _0x12ba72=_0x7a54[_0x5cc5ee];return _0x12ba72;};'use strict';var rp=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var _=require(_0x47a5('0x2'));var Mustache=require('mustache');var logger=require(_0x47a5('0x3'))(_0x47a5('0x4'));exports['exec']=function(_0x5f7f12,_0x11bf85){var _0x2a1a7e,_0x3717e1;var _0xfdf934={'method':_0x5f7f12['data1'][_0x47a5('0x5')](),'uri':Mustache['render'](_0x5f7f12[_0x47a5('0x6')],_0x11bf85),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x5f7f12[_0x47a5('0x7')])==='number'&&parseInt(_0x5f7f12[_0x47a5('0x7')])>=0x3e8&&parseInt(_0x5f7f12['data5'])<=0x2710?parseInt(_0x5f7f12['data5']):0x1388};try{_0xfdf934['headers']=_0x5f7f12[_0x47a5('0x8')]?JSON[_0x47a5('0x9')](Mustache['render'](_0x5f7f12[_0x47a5('0x8')],_0x11bf85)):{};}catch(_0x49e844){logger['error'](_0x49e844[_0x47a5('0xa')]);}switch(_0x5f7f12[_0x47a5('0xb')][_0x47a5('0x5')]()){case _0x47a5('0xc'):case _0x47a5('0xd'):_0x2a1a7e=null;_0xfdf934['qs']=_0x11bf85;break;case _0x47a5('0xe'):case _0x47a5('0xf'):if(_0x5f7f12['data7']){try{_0x2a1a7e=JSON[_0x47a5('0x9')](Mustache[_0x47a5('0x10')](_0x5f7f12[_0x47a5('0x11')],_0x11bf85));_0xfdf934[_0x47a5('0x12')]=_0x2a1a7e;}catch(_0x139f25){logger[_0x47a5('0x13')](_0x139f25[_0x47a5('0xa')]);logger[_0x47a5('0x13')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x2a1a7e=_0x11bf85;_0xfdf934[_0x47a5('0x12')]=_0x2a1a7e;}break;}logger[_0x47a5('0x14')](util[_0x47a5('0x15')](_0x47a5('0x16'),_0x5f7f12[_0x47a5('0xb')],_0x5f7f12['data2'],JSON['stringify'](_0xfdf934)));rp(_0xfdf934)[_0x47a5('0x17')](function(_0x4b966e){_0x2a1a7e=!_['isNil'](_0x2a1a7e)?_0x47a5('0x18')+_0x2a1a7e:'';_0x3717e1=typeof _0x4b966e[_0x47a5('0x12')]===_0x47a5('0x19')?JSON[_0x47a5('0x1a')](_0x4b966e[_0x47a5('0x12')]):_0x4b966e[_0x47a5('0x12')];logger[_0x47a5('0x14')](util[_0x47a5('0x15')](_0x47a5('0x1b'),_0x5f7f12['data1'],_0x5f7f12[_0x47a5('0x6')],_0x4b966e[_0x47a5('0x1c')],_0x3717e1));})['catch'](function(_0x2b0360){logger[_0x47a5('0x13')](util[_0x47a5('0x15')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x5f7f12[_0x47a5('0xb')],_0x5f7f12[_0x47a5('0x6')],_0x2b0360[_0x47a5('0x1c')],_0x2b0360[_0x47a5('0x1d')],_0x2b0360['message']));});}; \ No newline at end of file +var _0x7a54=['data6','parse','stack','data1','GET','DELETE','POST','PUT','render','data7','body','error','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','then',',\x20request\x20body:\x20','object','stringify','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','name','request-promise','util','lodash','../../../../config/logger','trigger','toUpperCase','data2','data5'];(function(_0x4a3e84,_0x608b1c){var _0x1e4f0a=function(_0x17a8e7){while(--_0x17a8e7){_0x4a3e84['push'](_0x4a3e84['shift']());}};_0x1e4f0a(++_0x608b1c);}(_0x7a54,0x106));var _0x47a5=function(_0x18f5b5,_0x2cecb2){_0x18f5b5=_0x18f5b5-0x0;var _0x136441=_0x7a54[_0x18f5b5];return _0x136441;};'use strict';var rp=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var _=require(_0x47a5('0x2'));var Mustache=require('mustache');var logger=require(_0x47a5('0x3'))(_0x47a5('0x4'));exports['exec']=function(_0x5f7f12,_0x11bf85){var _0x2a1a7e,_0x3717e1;var _0xfdf934={'method':_0x5f7f12['data1'][_0x47a5('0x5')](),'uri':Mustache['render'](_0x5f7f12[_0x47a5('0x6')],_0x11bf85),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x5f7f12[_0x47a5('0x7')])==='number'&&parseInt(_0x5f7f12[_0x47a5('0x7')])>=0x3e8&&parseInt(_0x5f7f12['data5'])<=0x2710?parseInt(_0x5f7f12['data5']):0x1388};try{_0xfdf934['headers']=_0x5f7f12[_0x47a5('0x8')]?JSON[_0x47a5('0x9')](Mustache['render'](_0x5f7f12[_0x47a5('0x8')],_0x11bf85)):{};}catch(_0x49e844){logger['error'](_0x49e844[_0x47a5('0xa')]);}switch(_0x5f7f12[_0x47a5('0xb')][_0x47a5('0x5')]()){case _0x47a5('0xc'):case _0x47a5('0xd'):_0x2a1a7e=null;_0xfdf934['qs']=_0x11bf85;break;case _0x47a5('0xe'):case _0x47a5('0xf'):if(_0x5f7f12['data7']){try{_0x2a1a7e=JSON[_0x47a5('0x9')](Mustache[_0x47a5('0x10')](_0x5f7f12[_0x47a5('0x11')],_0x11bf85));_0xfdf934[_0x47a5('0x12')]=_0x2a1a7e;}catch(_0x139f25){logger[_0x47a5('0x13')](_0x139f25[_0x47a5('0xa')]);logger[_0x47a5('0x13')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x2a1a7e=_0x11bf85;_0xfdf934[_0x47a5('0x12')]=_0x2a1a7e;}break;}logger[_0x47a5('0x14')](util[_0x47a5('0x15')](_0x47a5('0x16'),_0x5f7f12[_0x47a5('0xb')],_0x5f7f12['data2'],JSON['stringify'](_0xfdf934)));rp(_0xfdf934)[_0x47a5('0x17')](function(_0x4b966e){_0x2a1a7e=!_['isNil'](_0x2a1a7e)?_0x47a5('0x18')+_0x2a1a7e:'';_0x3717e1=typeof _0x4b966e[_0x47a5('0x12')]===_0x47a5('0x19')?JSON[_0x47a5('0x1a')](_0x4b966e[_0x47a5('0x12')]):_0x4b966e[_0x47a5('0x12')];logger[_0x47a5('0x14')](util[_0x47a5('0x15')](_0x47a5('0x1b'),_0x5f7f12['data1'],_0x5f7f12[_0x47a5('0x6')],_0x4b966e[_0x47a5('0x1c')],_0x3717e1));})['catch'](function(_0x2b0360){logger[_0x47a5('0x13')](util[_0x47a5('0x15')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x5f7f12[_0x47a5('0xb')],_0x5f7f12[_0x47a5('0x6')],_0x2b0360[_0x47a5('0x1c')],_0x2b0360[_0x47a5('0x1d')],_0x2b0360['message']));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 9375b77..d9bb651 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 _0x4fde=['bluebird','../../config/logger','routing','http','Request','request','then','debug','rpc','error','message','exports','jayson/promise'];(function(_0x3c8e9a,_0x384306){var _0x2d4c57=function(_0x43d408){while(--_0x43d408){_0x3c8e9a['push'](_0x3c8e9a['shift']());}};_0x2d4c57(++_0x384306);}(_0x4fde,0x19f));var _0xe4fd=function(_0x1b1e76,_0x31695b){_0x1b1e76=_0x1b1e76-0x0;var _0x3d743a=_0x4fde[_0x1b1e76];return _0x3d743a;};'use strict';var jayson=require(_0xe4fd('0x0'));var BPromise=require(_0xe4fd('0x1'));var logger=require(_0xe4fd('0x2'))(_0xe4fd('0x3'));var client=jayson['client'][_0xe4fd('0x4')]({'port':0x2329});client[_0xe4fd('0x5')]=function(_0x4bf61e,_0x36d49f){return new BPromise(function(_0x3c4c49,_0x8b810a){return client[_0xe4fd('0x6')](_0x4bf61e,_0x36d49f)[_0xe4fd('0x7')](function(_0x73219e){logger[_0xe4fd('0x8')](_0xe4fd('0x9'),_0xe4fd('0x3'),_0x4bf61e,_0x36d49f,_0x73219e);if(_0x73219e['error']){logger[_0xe4fd('0xa')]('rpc',_0xe4fd('0x3'),_0x4bf61e,_0x73219e['error']['message'],_0x36d49f);return _0x8b810a(_0x73219e[_0xe4fd('0xa')][_0xe4fd('0xb')]);}else{return _0x3c4c49(_0x73219e['result']);}})['catch'](function(_0x1f88d3){logger[_0xe4fd('0xa')](_0xe4fd('0x9'),'routing',_0x4bf61e,_0x1f88d3,_0x36d49f);return _0x8b810a(_0x1f88d3);});});};module[_0xe4fd('0xc')]=client; \ No newline at end of file +var _0x4006=['../../config/logger','routing','client','then','debug','rpc','error','message','result','catch','exports','bluebird'];(function(_0x2d89ce,_0x24d58d){var _0x3fad10=function(_0xad0ec){while(--_0xad0ec){_0x2d89ce['push'](_0x2d89ce['shift']());}};_0x3fad10(++_0x24d58d);}(_0x4006,0x1c7));var _0x6400=function(_0x57d37f,_0x4cc06c){_0x57d37f=_0x57d37f-0x0;var _0x36408c=_0x4006[_0x57d37f];return _0x36408c;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x6400('0x0'));var logger=require(_0x6400('0x1'))(_0x6400('0x2'));var client=jayson[_0x6400('0x3')]['http']({'port':0x2329});client['Request']=function(_0xee0578,_0x4b0418){return new BPromise(function(_0xd858df,_0x59fba5){return client['request'](_0xee0578,_0x4b0418)[_0x6400('0x4')](function(_0x599e6f){logger[_0x6400('0x5')](_0x6400('0x6'),_0x6400('0x2'),_0xee0578,_0x4b0418,_0x599e6f);if(_0x599e6f[_0x6400('0x7')]){logger['error'](_0x6400('0x6'),_0x6400('0x2'),_0xee0578,_0x599e6f[_0x6400('0x7')][_0x6400('0x8')],_0x4b0418);return _0x59fba5(_0x599e6f[_0x6400('0x7')][_0x6400('0x8')]);}else{return _0xd858df(_0x599e6f[_0x6400('0x9')]);}})[_0x6400('0xa')](function(_0x237e22){logger[_0x6400('0x7')](_0x6400('0x6'),'routing',_0xee0578,_0x237e22,_0x4b0418);return _0x59fba5(_0x237e22);});});};module[_0x6400('0xb')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index b3381dc..e68aea5 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 _0x6873=['Setting','findOne','loginMailFrequency','log','./realtime','./lib/email','./rpc/mailAccount','../../mysqldb','resolve','getMailAccounts','initMailAccounts','then','mailAccounts','listen'];(function(_0x4478af,_0x20e560){var _0x283b28=function(_0x50b646){while(--_0x50b646){_0x4478af['push'](_0x4478af['shift']());}};_0x283b28(++_0x20e560);}(_0x6873,0xac));var _0x3687=function(_0x225f50,_0x48a77d){_0x225f50=_0x225f50-0x0;var _0x19d003=_0x6873[_0x225f50];return _0x19d003;};'use strict';var BPromise=require('bluebird');var server=require('./server');var Realtime=require(_0x3687('0x0'));var EmailChannel=require(_0x3687('0x1'));var mailAccount=require(_0x3687('0x2'));var realtime=new Realtime();var email=new EmailChannel(realtime);var db=require(_0x3687('0x3'))['db'];function initRealtime(){return BPromise[_0x3687('0x4')]()['then'](mailAccount[_0x3687('0x5')]())['then'](realtime[_0x3687('0x6')]())[_0x3687('0x7')](function(){email['refresh'](realtime[_0x3687('0x8')]);return realtime;});}function main(){return server[_0x3687('0x9')](realtime,email)[_0x3687('0x7')](function(_0x1be8c0){return initRealtime();})[_0x3687('0x7')](function(_0x761e4f){return db[_0x3687('0xa')][_0x3687('0xb')]({'attributes':['id',_0x3687('0xc')],'raw':!![]});})['then'](function(_0x32c490){return setInterval(initRealtime,_0x32c490[_0x3687('0xc')]*0x3e8);})['catch'](function(_0x3e81c1){console[_0x3687('0xd')](_0x3e81c1);});}main(); \ No newline at end of file +var _0x018c=['refresh','mailAccounts','listen','Setting','findOne','loginMailFrequency','catch','log','bluebird','./server','./realtime','../../mysqldb','then','getMailAccounts','initMailAccounts'];(function(_0x299028,_0x4d7e9f){var _0x12154e=function(_0x558d18){while(--_0x558d18){_0x299028['push'](_0x299028['shift']());}};_0x12154e(++_0x4d7e9f);}(_0x018c,0xda));var _0xc018=function(_0x58d1a4,_0x594aa3){_0x58d1a4=_0x58d1a4-0x0;var _0x451066=_0x018c[_0x58d1a4];return _0x451066;};'use strict';var BPromise=require(_0xc018('0x0'));var server=require(_0xc018('0x1'));var Realtime=require(_0xc018('0x2'));var EmailChannel=require('./lib/email');var mailAccount=require('./rpc/mailAccount');var realtime=new Realtime();var email=new EmailChannel(realtime);var db=require(_0xc018('0x3'))['db'];function initRealtime(){return BPromise['resolve']()[_0xc018('0x4')](mailAccount[_0xc018('0x5')]())[_0xc018('0x4')](realtime[_0xc018('0x6')]())['then'](function(){email[_0xc018('0x7')](realtime[_0xc018('0x8')]);return realtime;});}function main(){return server[_0xc018('0x9')](realtime,email)[_0xc018('0x4')](function(_0x29a572){return initRealtime();})[_0xc018('0x4')](function(_0x638610){return db[_0xc018('0xa')][_0xc018('0xb')]({'attributes':['id',_0xc018('0xc')],'raw':!![]});})[_0xc018('0x4')](function(_0x2ef3a3){return setInterval(initRealtime,_0x2ef3a3[_0xc018('0xc')]*0x3e8);})[_0xc018('0xd')](function(_0x254baf){console[_0xc018('0xe')](_0x254baf);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index eab2119..52317ee 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 _0x748a=['New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','from','then','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','sendMail','smtp','verifySmtp','Smtp','verified','verify','exports','lodash','bluebird','md5','email','defaults','socket.io-emitter','redis','../rpc/mailAccount','info','mailAccounts','imapAccounts','prototype','emit','key','active','Imap','messageStatus','total','isNil','mailAccount:update','refresh','hasOwnProperty','box','bind','end','handleImapEnd','error','handleImapError','disabled','handleImapBox','status','name','messages','handleImapEmail'];(function(_0x51a707,_0xb61cca){var _0xd3dbef=function(_0x4506d8){while(--_0x4506d8){_0x51a707['push'](_0x51a707['shift']());}};_0xd3dbef(++_0xb61cca);}(_0x748a,0x9e));var _0xa748=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x748a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa748('0x0'));var moment=require('moment');var BPromise=require(_0xa748('0x1'));var md5=require(_0xa748('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0xa748('0x3'));config['redis']=_[_0xa748('0x4')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xa748('0x5'))(new Redis(config[_0xa748('0x6')]));var EmailImap=require('./imap');var EmailSmtp=require('./smtp');var mailAccount=require(_0xa748('0x7'));var md5Accounts={};function EmailChannel(_0x4435dc){logger[_0xa748('0x8')]('start\x20email\x20channel');this[_0xa748('0x9')]=_0x4435dc[_0xa748('0x9')];this[_0xa748('0xa')]={};this['smtp']=new EmailSmtp();}EmailChannel[_0xa748('0xb')][_0xa748('0xc')]=function(_0x1904bc){var _0x52a65a=this['mailAccounts'][_0x1904bc];var _0x2870d5={'id':_0x52a65a['id'],'name':_0x52a65a['name'],'key':_0x52a65a[_0xa748('0xd')],'active':_0x52a65a[_0xa748('0xe')],'Imap':{'status':_0x52a65a[_0xa748('0xf')]['status'],'messageStatus':_0x52a65a[_0xa748('0xf')][_0xa748('0x10')],'total':_0x52a65a[_0xa748('0xf')][_0xa748('0x11')]}};if(_[_0xa748('0x12')](md5Accounts[_0x1904bc])){md5Accounts[_0x1904bc]={};}var _0x4534b0=md5(JSON['stringify'](_0x2870d5));if(md5Accounts[_0x1904bc][_0xa748('0x2')]!==_0x4534b0){md5Accounts[_0x1904bc]['md5']=_0x4534b0;io[_0xa748('0xc')](_0xa748('0x13'),_0x2870d5);}};EmailChannel[_0xa748('0xb')][_0xa748('0x14')]=function(_0x3cdf11){for(var _0x2de248 in _0x3cdf11){if(_0x3cdf11[_0xa748('0x15')](_0x2de248)){if(_0x3cdf11[_0x2de248]['Imap']&&_0x3cdf11[_0x2de248]['active']){var _0x3bd981=_0x3cdf11[_0x2de248][_0xa748('0xf')];if(!this[_0xa748('0xa')][_0xa748('0x15')](_0x3bd981['id'])){this['imapAccounts'][_0x3bd981['id']]=new EmailImap(_0x3bd981,_0x3cdf11[_0x2de248][_0xa748('0x3')]);this[_0xa748('0xa')][_0x3bd981['id']]['on'](_0xa748('0x16'),this['handleImapBox']['bind'](this,_0x2de248));this[_0xa748('0xa')][_0x3bd981['id']]['on'](_0xa748('0x3'),this['handleImapEmail'][_0xa748('0x17')](this,_0x2de248));this['imapAccounts'][_0x3bd981['id']]['on'](_0xa748('0x18'),this[_0xa748('0x19')]['bind'](this,_0x2de248));this[_0xa748('0xa')][_0x3bd981['id']]['on'](_0xa748('0x1a'),this[_0xa748('0x1b')][_0xa748('0x17')](this,_0x2de248));}}else{if(_[_0xa748('0x12')](this['mailAccounts'][_0x2de248][_0xa748('0xf')])){this[_0xa748('0x9')][_0x2de248][_0xa748('0xf')]={};}this['mailAccounts'][_0x2de248][_0xa748('0xf')]['status']=_0xa748('0x1c');this[_0xa748('0x9')][_0x2de248]['Imap']['messageStatus']='';this['emit'](_0x2de248);}}}};EmailChannel['prototype'][_0xa748('0x1d')]=function(_0x1f1247,_0x29d843){if(this[_0xa748('0x9')][_0x1f1247]){this[_0xa748('0x9')][_0x1f1247][_0xa748('0xf')][_0xa748('0x1e')]='connected';this[_0xa748('0x9')][_0x1f1247][_0xa748('0xf')][_0xa748('0x10')]=_0x29d843[_0xa748('0x1f')];if(_0x29d843['messages']){this[_0xa748('0x9')][_0x1f1247]['Imap'][_0xa748('0x11')]=_0x29d843[_0xa748('0x20')][_0xa748('0x11')];}return this[_0xa748('0xc')](_0x1f1247);}};EmailChannel['prototype'][_0xa748('0x21')]=function(_0x34e307,_0x175369){logger['info'](_0xa748('0x22'),_0x175369[_0xa748('0x23')],_0x175369['lastName'],_0x175369[_0xa748('0x24')],_0x34e307);if(this[_0xa748('0x9')][_0x34e307]){return mailAccount['notify'](_0x34e307,_0x175369)[_0xa748('0x25')](function(_0x51d3d0){if(_0x51d3d0){logger[_0xa748('0x8')]('Mail\x20accepted\x20from\x20routing');}})[_0xa748('0x26')](function(_0x50699f){logger[_0xa748('0x1a')](_0xa748('0x27'),JSON['stringify'](_0x50699f));});}};EmailChannel[_0xa748('0xb')][_0xa748('0x19')]=function(_0x2e0c04){if(this['mailAccounts'][_0x2e0c04]&&this[_0xa748('0x9')][_0x2e0c04]['Imap']){if(this[_0xa748('0xa')][this[_0xa748('0x9')][_0x2e0c04][_0xa748('0xf')]['id']]){delete this[_0xa748('0xa')][this[_0xa748('0x9')][_0x2e0c04][_0xa748('0xf')]['id']];}this['mailAccounts'][_0x2e0c04][_0xa748('0xf')][_0xa748('0x28')]=moment();this[_0xa748('0xc')](_0x2e0c04);}};EmailChannel[_0xa748('0xb')][_0xa748('0x1b')]=function(_0x59c408,_0x24d514){if(this[_0xa748('0x9')][_0x59c408]){this[_0xa748('0x9')][_0x59c408][_0xa748('0xf')]['status']='error';this[_0xa748('0x9')][_0x59c408][_0xa748('0xf')][_0xa748('0x10')]=_0x24d514;return this['emit'](_0x59c408);}};EmailChannel[_0xa748('0xb')][_0xa748('0x29')]=function(_0x3a1c8f,_0x25722c){return this[_0xa748('0x2a')]['send'](_0x3a1c8f,_0x25722c);};EmailChannel[_0xa748('0xb')][_0xa748('0x2b')]=function(_0x40267a){var _0x3dcce8=this;if(this[_0xa748('0x9')][_0x40267a['id']]){if(_[_0xa748('0x12')](this[_0xa748('0x9')][_0x40267a['id']]['Smtp'])){this[_0xa748('0x9')][_0x40267a['id']][_0xa748('0x2c')]={};}this[_0xa748('0x9')][_0x40267a['id']][_0xa748('0x2c')]['lastSync']=moment();return new BPromise(function(_0x118c3c,_0x43d445){return _0x3dcce8[_0xa748('0x2a')]['verify'](_0x40267a)['then'](function(_0x3d6e7c){_0x3dcce8[_0xa748('0x9')][_0x40267a['id']][_0xa748('0x2c')][_0xa748('0x1e')]=_0xa748('0x2d');_0x3dcce8[_0xa748('0x9')][_0x40267a['id']][_0xa748('0x2c')][_0xa748('0x10')]='';_0x3dcce8[_0xa748('0xc')](_0x40267a['id']);_0x118c3c(_0x3d6e7c);})['catch'](function(_0x9046e4){_0x3dcce8[_0xa748('0x9')][_0x40267a['id']]['Smtp'][_0xa748('0x1e')]=_0xa748('0x1a');_0x3dcce8[_0xa748('0x9')][_0x40267a['id']][_0xa748('0x2c')][_0xa748('0x10')]=_0x9046e4;_0x3dcce8[_0xa748('0xc')](_0x40267a['id']);_0x43d445(_0x9046e4);});});}return this[_0xa748('0x2a')][_0xa748('0x2e')](_0x40267a);};module[_0xa748('0x2f')]=EmailChannel; \ No newline at end of file +var _0x0274=['imapAccounts','smtp','emit','name','key','active','Imap','stringify','md5','prototype','box','bind','handleImapEmail','handleImapEnd','error','isNil','status','disabled','messageStatus','handleImapBox','messages','total','info','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','sendMail','send','verifySmtp','Smtp','verify','exports','lodash','bluebird','ioredis','../../../config/environment','email','redis','defaults','./smtp','start\x20email\x20channel','mailAccounts'];(function(_0x435e3c,_0x4ffd0b){var _0x5250b9=function(_0x1990c9){while(--_0x1990c9){_0x435e3c['push'](_0x435e3c['shift']());}};_0x5250b9(++_0x4ffd0b);}(_0x0274,0x17e));var _0x4027=function(_0x59e98e,_0x49b9db){_0x59e98e=_0x59e98e-0x0;var _0x5dddfd=_0x0274[_0x59e98e];return _0x5dddfd;};'use strict';var _=require(_0x4027('0x0'));var moment=require('moment');var BPromise=require(_0x4027('0x1'));var md5=require('md5');var Redis=require(_0x4027('0x2'));var config=require(_0x4027('0x3'));var logger=require('../../../config/logger')(_0x4027('0x4'));config[_0x4027('0x5')]=_[_0x4027('0x6')](config[_0x4027('0x5')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x4027('0x5')]));var EmailImap=require('./imap');var EmailSmtp=require(_0x4027('0x7'));var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x5baf3c){logger['info'](_0x4027('0x8'));this[_0x4027('0x9')]=_0x5baf3c[_0x4027('0x9')];this[_0x4027('0xa')]={};this[_0x4027('0xb')]=new EmailSmtp();}EmailChannel['prototype'][_0x4027('0xc')]=function(_0x561f14){var _0x414dbc=this[_0x4027('0x9')][_0x561f14];var _0x518f8c={'id':_0x414dbc['id'],'name':_0x414dbc[_0x4027('0xd')],'key':_0x414dbc[_0x4027('0xe')],'active':_0x414dbc[_0x4027('0xf')],'Imap':{'status':_0x414dbc[_0x4027('0x10')]['status'],'messageStatus':_0x414dbc[_0x4027('0x10')]['messageStatus'],'total':_0x414dbc[_0x4027('0x10')]['total']}};if(_['isNil'](md5Accounts[_0x561f14])){md5Accounts[_0x561f14]={};}var _0x2813fd=md5(JSON[_0x4027('0x11')](_0x518f8c));if(md5Accounts[_0x561f14][_0x4027('0x12')]!==_0x2813fd){md5Accounts[_0x561f14]['md5']=_0x2813fd;io[_0x4027('0xc')]('mailAccount:update',_0x518f8c);}};EmailChannel[_0x4027('0x13')]['refresh']=function(_0x11f3e9){for(var _0x245f78 in _0x11f3e9){if(_0x11f3e9['hasOwnProperty'](_0x245f78)){if(_0x11f3e9[_0x245f78][_0x4027('0x10')]&&_0x11f3e9[_0x245f78][_0x4027('0xf')]){var _0xdd38f3=_0x11f3e9[_0x245f78][_0x4027('0x10')];if(!this[_0x4027('0xa')]['hasOwnProperty'](_0xdd38f3['id'])){this[_0x4027('0xa')][_0xdd38f3['id']]=new EmailImap(_0xdd38f3,_0x11f3e9[_0x245f78]['email']);this['imapAccounts'][_0xdd38f3['id']]['on'](_0x4027('0x14'),this['handleImapBox'][_0x4027('0x15')](this,_0x245f78));this[_0x4027('0xa')][_0xdd38f3['id']]['on'](_0x4027('0x4'),this[_0x4027('0x16')][_0x4027('0x15')](this,_0x245f78));this[_0x4027('0xa')][_0xdd38f3['id']]['on']('end',this[_0x4027('0x17')][_0x4027('0x15')](this,_0x245f78));this['imapAccounts'][_0xdd38f3['id']]['on'](_0x4027('0x18'),this['handleImapError'][_0x4027('0x15')](this,_0x245f78));}}else{if(_[_0x4027('0x19')](this['mailAccounts'][_0x245f78][_0x4027('0x10')])){this[_0x4027('0x9')][_0x245f78][_0x4027('0x10')]={};}this[_0x4027('0x9')][_0x245f78][_0x4027('0x10')][_0x4027('0x1a')]=_0x4027('0x1b');this[_0x4027('0x9')][_0x245f78][_0x4027('0x10')][_0x4027('0x1c')]='';this[_0x4027('0xc')](_0x245f78);}}}};EmailChannel['prototype'][_0x4027('0x1d')]=function(_0x5e4e2a,_0x1ebeed){if(this[_0x4027('0x9')][_0x5e4e2a]){this[_0x4027('0x9')][_0x5e4e2a][_0x4027('0x10')][_0x4027('0x1a')]='connected';this[_0x4027('0x9')][_0x5e4e2a][_0x4027('0x10')][_0x4027('0x1c')]=_0x1ebeed[_0x4027('0xd')];if(_0x1ebeed[_0x4027('0x1e')]){this[_0x4027('0x9')][_0x5e4e2a]['Imap'][_0x4027('0x1f')]=_0x1ebeed[_0x4027('0x1e')][_0x4027('0x1f')];}return this[_0x4027('0xc')](_0x5e4e2a);}};EmailChannel[_0x4027('0x13')][_0x4027('0x16')]=function(_0x46a95a,_0x346a1c){logger[_0x4027('0x20')](_0x4027('0x21'),_0x346a1c[_0x4027('0x22')],_0x346a1c[_0x4027('0x23')],_0x346a1c[_0x4027('0x24')],_0x46a95a);if(this[_0x4027('0x9')][_0x46a95a]){return mailAccount[_0x4027('0x25')](_0x46a95a,_0x346a1c)[_0x4027('0x26')](function(_0x21f802){if(_0x21f802){logger[_0x4027('0x20')](_0x4027('0x27'));}})[_0x4027('0x28')](function(_0x23316f){logger[_0x4027('0x18')](_0x4027('0x29'),JSON[_0x4027('0x11')](_0x23316f));});}};EmailChannel['prototype'][_0x4027('0x17')]=function(_0x483d49){if(this[_0x4027('0x9')][_0x483d49]&&this[_0x4027('0x9')][_0x483d49][_0x4027('0x10')]){if(this[_0x4027('0xa')][this['mailAccounts'][_0x483d49][_0x4027('0x10')]['id']]){delete this[_0x4027('0xa')][this['mailAccounts'][_0x483d49][_0x4027('0x10')]['id']];}this[_0x4027('0x9')][_0x483d49]['Imap'][_0x4027('0x2a')]=moment();this[_0x4027('0xc')](_0x483d49);}};EmailChannel[_0x4027('0x13')]['handleImapError']=function(_0x50a7eb,_0xcb927d){if(this['mailAccounts'][_0x50a7eb]){this[_0x4027('0x9')][_0x50a7eb]['Imap'][_0x4027('0x1a')]=_0x4027('0x18');this[_0x4027('0x9')][_0x50a7eb]['Imap'][_0x4027('0x1c')]=_0xcb927d;return this[_0x4027('0xc')](_0x50a7eb);}};EmailChannel[_0x4027('0x13')][_0x4027('0x2b')]=function(_0x3f552a,_0x59ad47){return this[_0x4027('0xb')][_0x4027('0x2c')](_0x3f552a,_0x59ad47);};EmailChannel[_0x4027('0x13')][_0x4027('0x2d')]=function(_0x35ade7){var _0x32fb3f=this;if(this['mailAccounts'][_0x35ade7['id']]){if(_[_0x4027('0x19')](this[_0x4027('0x9')][_0x35ade7['id']]['Smtp'])){this[_0x4027('0x9')][_0x35ade7['id']][_0x4027('0x2e')]={};}this[_0x4027('0x9')][_0x35ade7['id']]['Smtp'][_0x4027('0x2a')]=moment();return new BPromise(function(_0xae7417,_0x493f18){return _0x32fb3f[_0x4027('0xb')]['verify'](_0x35ade7)['then'](function(_0x1e1e67){_0x32fb3f['mailAccounts'][_0x35ade7['id']]['Smtp'][_0x4027('0x1a')]='verified';_0x32fb3f[_0x4027('0x9')][_0x35ade7['id']]['Smtp'][_0x4027('0x1c')]='';_0x32fb3f['emit'](_0x35ade7['id']);_0xae7417(_0x1e1e67);})[_0x4027('0x28')](function(_0x1e766a){_0x32fb3f[_0x4027('0x9')][_0x35ade7['id']][_0x4027('0x2e')]['status']=_0x4027('0x18');_0x32fb3f['mailAccounts'][_0x35ade7['id']][_0x4027('0x2e')][_0x4027('0x1c')]=_0x1e766a;_0x32fb3f[_0x4027('0xc')](_0x35ade7['id']);_0x493f18(_0x1e766a);});});}return this[_0x4027('0xb')][_0x4027('0x2f')](_0x35ade7);};module[_0x4027('0x30')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 71ffc1b..f831ed0 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 _0xa346=['exports','path','util','imap','lodash','simpleParser','Iconv','EventEmitter','./utils','email','mailbox','once','ready','handleReady','bind','end','handleEnd','error','handleError','connect','prototype','connTimeout','authTimeout','isNil','service','user','password','host','port','tls','autotls','getHost','openBox','handleOpenBox','emit','box','readUnseen','UNSEEN','handleReadUnseen','fetch','message','handleFetchMessage','handleFetchError','handleFetchEnd','handleCloseBox','body','handleMessageBody','handleMessageAttributes','handleSimpleParser','handleMessageEnd','parser','account','closeBox','stringify','textCode','upperFirst'];(function(_0x28e7e1,_0x590d63){var _0x28e440=function(_0x22621a){while(--_0x22621a){_0x28e7e1['push'](_0x28e7e1['shift']());}};_0x28e440(++_0x590d63);}(_0xa346,0xe1));var _0x6a34=function(_0x354349,_0x34465b){_0x354349=_0x354349-0x0;var _0x340094=_0xa346[_0x354349];return _0x340094;};'use strict';var fs=require('fs');var path=require(_0x6a34('0x0'));var util=require(_0x6a34('0x1'));var Imap=require(_0x6a34('0x2'));var _=require(_0x6a34('0x3'));var rs=require('randomstring');var simpleParser=require('mailparser')[_0x6a34('0x4')];var Iconv=require('iconv')[_0x6a34('0x5')];var EventEmitter=require('events')[_0x6a34('0x6')];var utils=require(_0x6a34('0x7'));var logger=require('../../../config/logger')(_0x6a34('0x8'));function EmailImap(_0xbbcfd0,_0x383151){this[_0x6a34('0x9')]='INBOX';this['account']=this['getAccount'](_0xbbcfd0,_0x383151);this[_0x6a34('0x2')]=new Imap(this['account']);this[_0x6a34('0x2')][_0x6a34('0xa')](_0x6a34('0xb'),this[_0x6a34('0xc')][_0x6a34('0xd')](this));this[_0x6a34('0x2')][_0x6a34('0xa')](_0x6a34('0xe'),this[_0x6a34('0xf')][_0x6a34('0xd')](this));this[_0x6a34('0x2')]['on'](_0x6a34('0x10'),this[_0x6a34('0x11')][_0x6a34('0xd')](this));this[_0x6a34('0x2')][_0x6a34('0x12')]();}util['inherits'](EmailImap,EventEmitter);EmailImap[_0x6a34('0x13')]['getAccount']=function(_0x5d5179,_0x2ee31c){var _0x559b86={'connTimeout':_0x5d5179['connTimeout']?_0x5d5179[_0x6a34('0x14')]*0x3e8:0x2710,'authTimeout':_0x5d5179[_0x6a34('0x15')]?_0x5d5179['authTimeout']*0x3e8:0x1388};if(_[_0x6a34('0x16')](_0x5d5179[_0x6a34('0x17')])){if(_0x5d5179['authentication']){_0x559b86[_0x6a34('0x18')]=_0x5d5179['user'];_0x559b86['password']=_0x5d5179[_0x6a34('0x19')];}_0x559b86[_0x6a34('0x1a')]=_0x5d5179[_0x6a34('0x1a')];_0x559b86[_0x6a34('0x1b')]=_0x5d5179[_0x6a34('0x1b')]||0x3e1;if(_0x5d5179[_0x6a34('0x1c')]){_0x559b86[_0x6a34('0x1c')]=!![];}else{_0x559b86[_0x6a34('0x1c')]=![];_0x559b86[_0x6a34('0x1d')]='required';}}else{_0x559b86[_0x6a34('0x18')]=_0x5d5179[_0x6a34('0x18')];_0x559b86[_0x6a34('0x19')]=_0x5d5179['password'];_0x559b86[_0x6a34('0x1a')]=utils[_0x6a34('0x1e')](_0x5d5179['service']);_0x559b86[_0x6a34('0x1b')]=0x3e1;_0x559b86[_0x6a34('0x1c')]=!![];}_0x559b86['email']=_0x2ee31c||_0x5d5179[_0x6a34('0x18')]||'anonymous@xcally.com';return _0x559b86;};EmailImap[_0x6a34('0x13')][_0x6a34('0xc')]=function(){this[_0x6a34('0x2')][_0x6a34('0x1f')](this[_0x6a34('0x9')],![],this[_0x6a34('0x20')]['bind'](this));};EmailImap[_0x6a34('0x13')]['handleOpenBox']=function(_0x1b4a88,_0x281248){if(_0x1b4a88){this[_0x6a34('0x11')](_0x1b4a88,!![]);}else{this[_0x6a34('0x21')](_0x6a34('0x22'),_0x281248);this[_0x6a34('0x23')]();}};EmailImap[_0x6a34('0x13')]['handleCloseBox']=function(_0x3f5836){if(_0x3f5836){this[_0x6a34('0x11')](_0x3f5836,!![]);}else{this['imap'][_0x6a34('0xe')]();}};EmailImap['prototype'][_0x6a34('0x23')]=function(){this[_0x6a34('0x2')]['search']([_0x6a34('0x24')],this[_0x6a34('0x25')][_0x6a34('0xd')](this));};EmailImap[_0x6a34('0x13')][_0x6a34('0x25')]=function(_0x2da43d,_0x57f6ec){if(_0x2da43d){this['handleError'](_0x2da43d,!![]);}else{if(_0x57f6ec['length']){try{var _0x46514c=this[_0x6a34('0x2')][_0x6a34('0x26')](_0x57f6ec,{'bodies':'','markSeen':!![]});_0x46514c['on'](_0x6a34('0x27'),this[_0x6a34('0x28')][_0x6a34('0xd')](this));_0x46514c[_0x6a34('0xa')]('error',this[_0x6a34('0x29')][_0x6a34('0xd')](this));_0x46514c[_0x6a34('0xa')](_0x6a34('0xe'),this[_0x6a34('0x2a')][_0x6a34('0xd')](this));}catch(_0x3ac7c3){logger[_0x6a34('0x10')](_0x3ac7c3);}}else{this[_0x6a34('0x2')]['closeBox'](!![],this[_0x6a34('0x2b')][_0x6a34('0xd')](this));}}};EmailImap[_0x6a34('0x13')][_0x6a34('0x28')]=function(_0x4935ce,_0x50da57){_0x4935ce['on'](_0x6a34('0x2c'),this[_0x6a34('0x2d')][_0x6a34('0xd')](this));_0x4935ce[_0x6a34('0xa')]('attributes',this[_0x6a34('0x2e')][_0x6a34('0xd')](this));_0x4935ce['once'](_0x6a34('0xe'),this['handleMessageEnd'][_0x6a34('0xd')](this));};EmailImap[_0x6a34('0x13')][_0x6a34('0x2d')]=function(_0x2314c0,_0xf0dca7){simpleParser(_0x2314c0,{'Iconv':Iconv},this[_0x6a34('0x2f')]['bind'](this));};EmailImap[_0x6a34('0x13')][_0x6a34('0x2e')]=function(_0x7ee49d){};EmailImap[_0x6a34('0x13')][_0x6a34('0x30')]=function(){};EmailImap['prototype'][_0x6a34('0x2f')]=function(_0x154834,_0x174625){if(_0x154834){logger[_0x6a34('0x10')](_0x154834);}else{var _0x1bf202=this;utils[_0x6a34('0x31')](this[_0x6a34('0x32')],_0x174625,function(_0x2c053b){_0x1bf202[_0x6a34('0x21')](_0x6a34('0x8'),_0x2c053b);});}};EmailImap[_0x6a34('0x13')][_0x6a34('0x2a')]=function(){this[_0x6a34('0x2')]['closeBox'](!![],this[_0x6a34('0x2b')]['bind'](this));};EmailImap['prototype'][_0x6a34('0x29')]=function(_0xf1f2b4){this[_0x6a34('0x11')](_0xf1f2b4);this[_0x6a34('0x2')][_0x6a34('0x33')](!![],this['handleCloseBox']['bind'](this));};EmailImap['prototype']['handleEnd']=function(){this['emit']('end');};EmailImap[_0x6a34('0x13')][_0x6a34('0x11')]=function(_0x73fb27,_0x2fef78){logger[_0x6a34('0x10')]('handleError',this[_0x6a34('0x32')][_0x6a34('0x8')],JSON[_0x6a34('0x34')](_0x73fb27));var _0x3893b1='';if(_0x73fb27){if(_0x73fb27[_0x6a34('0x35')]){_0x3893b1=_0x73fb27[_0x6a34('0x35')];}else{for(var _0x4111f4 in _0x73fb27){if(_0x73fb27['hasOwnProperty'](_0x4111f4)){_0x3893b1+=_[_0x6a34('0x36')](_0x4111f4)+':\x20'+_0x73fb27[_0x4111f4]+'\x0a';}}}}if(_0x2fef78){this['imap'][_0x6a34('0xe')]();}else{this[_0x6a34('0x21')](_0x6a34('0x10'),_0x3893b1);this[_0x6a34('0x21')](_0x6a34('0xe'));}};module[_0x6a34('0x37')]=EmailImap; \ No newline at end of file +var _0xfede=['exports','path','util','lodash','randomstring','simpleParser','iconv','events','EventEmitter','./utils','../../../config/logger','email','mailbox','account','getAccount','once','handleReady','imap','end','error','bind','inherits','connTimeout','authTimeout','user','password','host','port','tls','autotls','required','getHost','service','anonymous@xcally.com','prototype','openBox','handleOpenBox','handleError','emit','box','handleCloseBox','search','handleReadUnseen','length','closeBox','handleFetchMessage','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','handleFetchError','handleEnd','stringify','textCode','hasOwnProperty','upperFirst'];(function(_0x4d672c,_0x15a6e0){var _0x22dc61=function(_0x1cc2f8){while(--_0x1cc2f8){_0x4d672c['push'](_0x4d672c['shift']());}};_0x22dc61(++_0x15a6e0);}(_0xfede,0x197));var _0xefed=function(_0x4360c4,_0x2f8209){_0x4360c4=_0x4360c4-0x0;var _0x3168c8=_0xfede[_0x4360c4];return _0x3168c8;};'use strict';var fs=require('fs');var path=require(_0xefed('0x0'));var util=require(_0xefed('0x1'));var Imap=require('imap');var _=require(_0xefed('0x2'));var rs=require(_0xefed('0x3'));var simpleParser=require('mailparser')[_0xefed('0x4')];var Iconv=require(_0xefed('0x5'))['Iconv'];var EventEmitter=require(_0xefed('0x6'))[_0xefed('0x7')];var utils=require(_0xefed('0x8'));var logger=require(_0xefed('0x9'))(_0xefed('0xa'));function EmailImap(_0x4aabf6,_0x38baee){this[_0xefed('0xb')]='INBOX';this[_0xefed('0xc')]=this[_0xefed('0xd')](_0x4aabf6,_0x38baee);this['imap']=new Imap(this['account']);this['imap'][_0xefed('0xe')]('ready',this[_0xefed('0xf')]['bind'](this));this[_0xefed('0x10')][_0xefed('0xe')](_0xefed('0x11'),this['handleEnd']['bind'](this));this[_0xefed('0x10')]['on'](_0xefed('0x12'),this['handleError'][_0xefed('0x13')](this));this[_0xefed('0x10')]['connect']();}util[_0xefed('0x14')](EmailImap,EventEmitter);EmailImap['prototype']['getAccount']=function(_0x2f630e,_0xe8f3c9){var _0xcac7dc={'connTimeout':_0x2f630e[_0xefed('0x15')]?_0x2f630e[_0xefed('0x15')]*0x3e8:0x2710,'authTimeout':_0x2f630e[_0xefed('0x16')]?_0x2f630e[_0xefed('0x16')]*0x3e8:0x1388};if(_['isNil'](_0x2f630e['service'])){if(_0x2f630e['authentication']){_0xcac7dc[_0xefed('0x17')]=_0x2f630e[_0xefed('0x17')];_0xcac7dc[_0xefed('0x18')]=_0x2f630e[_0xefed('0x18')];}_0xcac7dc[_0xefed('0x19')]=_0x2f630e[_0xefed('0x19')];_0xcac7dc[_0xefed('0x1a')]=_0x2f630e['port']||0x3e1;if(_0x2f630e[_0xefed('0x1b')]){_0xcac7dc[_0xefed('0x1b')]=!![];}else{_0xcac7dc['tls']=![];_0xcac7dc[_0xefed('0x1c')]=_0xefed('0x1d');}}else{_0xcac7dc[_0xefed('0x17')]=_0x2f630e[_0xefed('0x17')];_0xcac7dc[_0xefed('0x18')]=_0x2f630e[_0xefed('0x18')];_0xcac7dc[_0xefed('0x19')]=utils[_0xefed('0x1e')](_0x2f630e[_0xefed('0x1f')]);_0xcac7dc[_0xefed('0x1a')]=0x3e1;_0xcac7dc[_0xefed('0x1b')]=!![];}_0xcac7dc[_0xefed('0xa')]=_0xe8f3c9||_0x2f630e[_0xefed('0x17')]||_0xefed('0x20');return _0xcac7dc;};EmailImap[_0xefed('0x21')][_0xefed('0xf')]=function(){this[_0xefed('0x10')][_0xefed('0x22')](this[_0xefed('0xb')],![],this['handleOpenBox']['bind'](this));};EmailImap[_0xefed('0x21')][_0xefed('0x23')]=function(_0x45aabc,_0x465f41){if(_0x45aabc){this[_0xefed('0x24')](_0x45aabc,!![]);}else{this[_0xefed('0x25')](_0xefed('0x26'),_0x465f41);this['readUnseen']();}};EmailImap['prototype'][_0xefed('0x27')]=function(_0x596c7d){if(_0x596c7d){this[_0xefed('0x24')](_0x596c7d,!![]);}else{this['imap'][_0xefed('0x11')]();}};EmailImap[_0xefed('0x21')]['readUnseen']=function(){this['imap'][_0xefed('0x28')](['UNSEEN'],this[_0xefed('0x29')][_0xefed('0x13')](this));};EmailImap[_0xefed('0x21')][_0xefed('0x29')]=function(_0x4d7de8,_0x31f01f){if(_0x4d7de8){this['handleError'](_0x4d7de8,!![]);}else{if(_0x31f01f[_0xefed('0x2a')]){try{var _0x4f1574=this[_0xefed('0x10')]['fetch'](_0x31f01f,{'bodies':'','markSeen':!![]});_0x4f1574['on']('message',this['handleFetchMessage'][_0xefed('0x13')](this));_0x4f1574[_0xefed('0xe')](_0xefed('0x12'),this['handleFetchError'][_0xefed('0x13')](this));_0x4f1574['once'](_0xefed('0x11'),this['handleFetchEnd'][_0xefed('0x13')](this));}catch(_0x4cad98){logger['error'](_0x4cad98);}}else{this[_0xefed('0x10')][_0xefed('0x2b')](!![],this[_0xefed('0x27')][_0xefed('0x13')](this));}}};EmailImap['prototype'][_0xefed('0x2c')]=function(_0x483cfc,_0x1fa044){_0x483cfc['on'](_0xefed('0x2d'),this[_0xefed('0x2e')][_0xefed('0x13')](this));_0x483cfc[_0xefed('0xe')](_0xefed('0x2f'),this[_0xefed('0x30')][_0xefed('0x13')](this));_0x483cfc[_0xefed('0xe')]('end',this[_0xefed('0x31')][_0xefed('0x13')](this));};EmailImap['prototype']['handleMessageBody']=function(_0x195d4e,_0x54bfb3){simpleParser(_0x195d4e,{'Iconv':Iconv},this[_0xefed('0x32')]['bind'](this));};EmailImap[_0xefed('0x21')][_0xefed('0x30')]=function(_0x5aa44a){};EmailImap[_0xefed('0x21')][_0xefed('0x31')]=function(){};EmailImap[_0xefed('0x21')][_0xefed('0x32')]=function(_0xeb87c6,_0x4da975){if(_0xeb87c6){logger[_0xefed('0x12')](_0xeb87c6);}else{var _0x137908=this;utils['parser'](this[_0xefed('0xc')],_0x4da975,function(_0x2356e6){_0x137908['emit']('email',_0x2356e6);});}};EmailImap[_0xefed('0x21')]['handleFetchEnd']=function(){this[_0xefed('0x10')][_0xefed('0x2b')](!![],this[_0xefed('0x27')]['bind'](this));};EmailImap[_0xefed('0x21')][_0xefed('0x33')]=function(_0x10dcdc){this[_0xefed('0x24')](_0x10dcdc);this[_0xefed('0x10')][_0xefed('0x2b')](!![],this['handleCloseBox']['bind'](this));};EmailImap[_0xefed('0x21')][_0xefed('0x34')]=function(){this[_0xefed('0x25')]('end');};EmailImap[_0xefed('0x21')][_0xefed('0x24')]=function(_0x4705a3,_0x2144de){logger[_0xefed('0x12')]('handleError',this[_0xefed('0xc')][_0xefed('0xa')],JSON[_0xefed('0x35')](_0x4705a3));var _0x30e543='';if(_0x4705a3){if(_0x4705a3[_0xefed('0x36')]){_0x30e543=_0x4705a3['textCode'];}else{for(var _0x4df905 in _0x4705a3){if(_0x4705a3[_0xefed('0x37')](_0x4df905)){_0x30e543+=_[_0xefed('0x38')](_0x4df905)+':\x20'+_0x4705a3[_0x4df905]+'\x0a';}}}}if(_0x2144de){this['imap'][_0xefed('0x11')]();}else{this[_0xefed('0x25')](_0xefed('0x12'),_0x30e543);this[_0xefed('0x25')]('end');}};module[_0xefed('0x39')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 88b14d7..6ec57f2 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 _0x80b2=['nodemailer','bluebird','prototype','use','compile','toString','verify','createTransport','Not\x20verifired','exports'];(function(_0x254461,_0x45615a){var _0x28ee0e=function(_0x3f9881){while(--_0x3f9881){_0x254461['push'](_0x254461['shift']());}};_0x28ee0e(++_0x45615a);}(_0x80b2,0x96));var _0x280b=function(_0x1a4c58,_0x3ae4b4){_0x1a4c58=_0x1a4c58-0x0;var _0x156fe7=_0x80b2[_0x1a4c58];return _0x156fe7;};'use strict';var nodemailer=require(_0x280b('0x0'));var BPromise=require(_0x280b('0x1'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp[_0x280b('0x2')]['send']=function(_0xc3d23a,_0x15f780){return new BPromise(function(_0x3fc8f9,_0x180e95){var _0x2c6408=nodemailer['createTransport'](_0xc3d23a);_0x2c6408[_0x280b('0x3')](_0x280b('0x4'),inlineBase64());_0x2c6408['sendMail'](_0x15f780,function(_0xe49f1,_0x29832e){if(_0xe49f1){_0x180e95(_0xe49f1[_0x280b('0x5')]());}else{_0x3fc8f9(_0x29832e);}});});};EmailSmtp['prototype'][_0x280b('0x6')]=function(_0x14adb4){return new BPromise(function(_0x245695,_0x5ee5e){var _0x5e966c=nodemailer[_0x280b('0x7')](_0x14adb4);_0x5e966c[_0x280b('0x6')](function(_0x4e0a98,_0x3c80a4){if(_0x4e0a98){_0x5ee5e(_0x4e0a98['toString']());}else{if(_0x3c80a4){_0x245695(_0x3c80a4);}else{_0x5ee5e(_0x280b('0x8'));}}});});};module[_0x280b('0x9')]=EmailSmtp; \ No newline at end of file +var _0x14e1=['toString','nodemailer','bluebird','nodemailer-plugin-inline-base64','prototype','send','createTransport','use','compile','sendMail','verify'];(function(_0x11d39d,_0x50331e){var _0xff1afe=function(_0x5b88b0){while(--_0x5b88b0){_0x11d39d['push'](_0x11d39d['shift']());}};_0xff1afe(++_0x50331e);}(_0x14e1,0x14b));var _0x114e=function(_0xbdebbc,_0x4b6d84){_0xbdebbc=_0xbdebbc-0x0;var _0x505f93=_0x14e1[_0xbdebbc];return _0x505f93;};'use strict';var nodemailer=require(_0x114e('0x0'));var BPromise=require(_0x114e('0x1'));var inlineBase64=require(_0x114e('0x2'));function EmailSmtp(){}EmailSmtp[_0x114e('0x3')][_0x114e('0x4')]=function(_0x243316,_0x3c0c69){return new BPromise(function(_0x679113,_0x1bf4df){var _0x4d2588=nodemailer[_0x114e('0x5')](_0x243316);_0x4d2588[_0x114e('0x6')](_0x114e('0x7'),inlineBase64());_0x4d2588[_0x114e('0x8')](_0x3c0c69,function(_0x5028c7,_0x4fab34){if(_0x5028c7){_0x1bf4df(_0x5028c7['toString']());}else{_0x679113(_0x4fab34);}});});};EmailSmtp[_0x114e('0x3')]['verify']=function(_0x421307){return new BPromise(function(_0x56e992,_0x5800ab){var _0x59baf4=nodemailer[_0x114e('0x5')](_0x421307);_0x59baf4[_0x114e('0x9')](function(_0x54c5a4,_0x46f9e7){if(_0x54c5a4){_0x5800ab(_0x54c5a4[_0x114e('0xa')]());}else{if(_0x46f9e7){_0x56e992(_0x46f9e7);}else{_0x5800ab('Not\x20verifired');}}});});};module['exports']=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index a9ea51f..cff0556 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 _0x2a7c=['replace','body','Empty\x20message

','Attachments','Data','gmail','imap.gmail.com','yahoo','hotmail','imap-mail.outlook.com','outlook365','127.0.0.1','lodash','moment','randomstring','util','node-tnef','../../../config/logger','email','../../../config/environment','head','address','anonymous','generate','@xcally.com','value','name','split','length','slice','join','Anonymous','pop','html'];(function(_0x16d3f8,_0x3f5dd3){var _0x49a172=function(_0x2f730d){while(--_0x2f730d){_0x16d3f8['push'](_0x16d3f8['shift']());}};_0x49a172(++_0x3f5dd3);}(_0x2a7c,0xb3));var _0xc2a7=function(_0x10fc54,_0x45adbd){_0x10fc54=_0x10fc54-0x0;var _0x4f0903=_0x2a7c[_0x10fc54];return _0x4f0903;};'use strict';var _=require(_0xc2a7('0x0'));var moment=require(_0xc2a7('0x1'));var random=require(_0xc2a7('0x2'));var fs=require('fs');var path=require('path');var util=require(_0xc2a7('0x3'));var tnef=require(_0xc2a7('0x4'));var logger=require(_0xc2a7('0x5'))(_0xc2a7('0x6'));var config=require(_0xc2a7('0x7'));function getAddress(_0x324780){var _0x1b5c03=_[_0xc2a7('0x8')](_0x324780['value']);return _0x1b5c03&&_0x1b5c03[_0xc2a7('0x9')]?_0x1b5c03['address']:_0xc2a7('0xa')+random[_0xc2a7('0xb')](0x6)+_0xc2a7('0xc');}function getFirstName(_0x8be6d5){var _0x1a3af1=_[_0xc2a7('0x8')](_0x8be6d5[_0xc2a7('0xd')]);if(_0x1a3af1&&_0x1a3af1[_0xc2a7('0xe')]){var _0x4dd8bb=_0x1a3af1[_0xc2a7('0xe')][_0xc2a7('0xf')](/\s+/);return _0x4dd8bb[_0xc2a7('0x10')]?_0x4dd8bb[_0xc2a7('0x11')](0x0,-0x1)[_0xc2a7('0x12')]('\x20'):_0x1a3af1['name'];}return _0xc2a7('0x13');}function getLastName(_0x442bcf){var _0x211216=_['head'](_0x442bcf[_0xc2a7('0xd')]);if(_0x211216&&_0x211216[_0xc2a7('0xe')]){var _0x3eb538=_0x211216[_0xc2a7('0xe')]['split'](/\s+/);return _0x3eb538['length']>0x1?_0x3eb538[_0xc2a7('0x14')]():'';}return'';}function getMails(_0x10e8d8,_0x241d21){var _0x271eff='';for(var _0x36fb29=0x0;_0x36fb29<_0x241d21[_0xc2a7('0xd')][_0xc2a7('0x10')];_0x36fb29+=0x1){if(_0x241d21[_0xc2a7('0xd')][_0x36fb29][_0xc2a7('0x9')]!==_0x10e8d8){if(!_['isEmpty'](_0x271eff)){_0x271eff+=',';}_0x271eff+=_0x241d21[_0xc2a7('0xd')][_0x36fb29][_0xc2a7('0xe')]||_0x241d21['value'][_0x36fb29][_0xc2a7('0x9')]||'';_0x271eff+='\x20<';_0x271eff+=_0x241d21[_0xc2a7('0xd')][_0x36fb29]['address']?_0x241d21[_0xc2a7('0xd')][_0x36fb29][_0xc2a7('0x9')]:_0xc2a7('0xa')+random[_0xc2a7('0xb')](0x6)+_0xc2a7('0xc');_0x271eff+='>';}}return _0x271eff;}function parseEmail(_0x264174,_0xec6c43,_0x2e978c){if(_0xec6c43[_0xc2a7('0x15')]){var _0x5b09fc=/)<[^<]*)*<\/script>/gi;while(_0x5b09fc['test'](_0xec6c43[_0xc2a7('0x15')])){_0xec6c43['html']=_0xec6c43[_0xc2a7('0x15')][_0xc2a7('0x16')](_0x5b09fc,'');}_0x2e978c[_0xc2a7('0x17')]=_0xec6c43[_0xc2a7('0x15')];}else{_0x2e978c[_0xc2a7('0x17')]=_0xec6c43['textAsHtml'];}if(_0x2e978c[_0xc2a7('0x17')]){_0x2e978c['body']=_0x2e978c[_0xc2a7('0x17')][_0xc2a7('0x16')](/Empty\x20message

','Attachments','Title','imap.gmail.com','yahoo','hotmail','imap-mail.outlook.com','outlook365','127.0.0.1','lodash','moment','randomstring','node-tnef','../../../config/logger','email','value','address','@xcally.com','head'];(function(_0x1f2f61,_0x586f2f){var _0x10dabc=function(_0x3233b5){while(--_0x3233b5){_0x1f2f61['push'](_0x1f2f61['shift']());}};_0x10dabc(++_0x586f2f);}(_0xa25f,0x72));var _0xfa25=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa25f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xfa25('0x0'));var moment=require(_0xfa25('0x1'));var random=require(_0xfa25('0x2'));var fs=require('fs');var path=require('path');var util=require('util');var tnef=require(_0xfa25('0x3'));var logger=require(_0xfa25('0x4'))(_0xfa25('0x5'));var config=require('../../../config/environment');function getAddress(_0xeae206){var _0x4c59a2=_['head'](_0xeae206[_0xfa25('0x6')]);return _0x4c59a2&&_0x4c59a2[_0xfa25('0x7')]?_0x4c59a2[_0xfa25('0x7')]:'anonymous'+random['generate'](0x6)+_0xfa25('0x8');}function getFirstName(_0x5a9112){var _0x5683b3=_[_0xfa25('0x9')](_0x5a9112[_0xfa25('0x6')]);if(_0x5683b3&&_0x5683b3[_0xfa25('0xa')]){var _0x15f432=_0x5683b3['name']['split'](/\s+/);return _0x15f432[_0xfa25('0xb')]?_0x15f432[_0xfa25('0xc')](0x0,-0x1)[_0xfa25('0xd')]('\x20'):_0x5683b3[_0xfa25('0xa')];}return _0xfa25('0xe');}function getLastName(_0x5cb39a){var _0x4069a5=_[_0xfa25('0x9')](_0x5cb39a['value']);if(_0x4069a5&&_0x4069a5[_0xfa25('0xa')]){var _0x324128=_0x4069a5[_0xfa25('0xa')][_0xfa25('0xf')](/\s+/);return _0x324128[_0xfa25('0xb')]>0x1?_0x324128[_0xfa25('0x10')]():'';}return'';}function getMails(_0x587118,_0x4b38af){var _0x4539d9='';for(var _0x47d1f0=0x0;_0x47d1f0<_0x4b38af[_0xfa25('0x6')]['length'];_0x47d1f0+=0x1){if(_0x4b38af[_0xfa25('0x6')][_0x47d1f0][_0xfa25('0x7')]!==_0x587118){if(!_[_0xfa25('0x11')](_0x4539d9)){_0x4539d9+=',';}_0x4539d9+=_0x4b38af[_0xfa25('0x6')][_0x47d1f0][_0xfa25('0xa')]||_0x4b38af['value'][_0x47d1f0][_0xfa25('0x7')]||'';_0x4539d9+='\x20<';_0x4539d9+=_0x4b38af[_0xfa25('0x6')][_0x47d1f0][_0xfa25('0x7')]?_0x4b38af[_0xfa25('0x6')][_0x47d1f0][_0xfa25('0x7')]:_0xfa25('0x12')+random['generate'](0x6)+_0xfa25('0x8');_0x4539d9+='>';}}return _0x4539d9;}function parseEmail(_0x15f430,_0x422b1d,_0x2b241f){if(_0x422b1d[_0xfa25('0x13')]){var _0x96b11=/)<[^<]*)*<\/script>/gi;while(_0x96b11['test'](_0x422b1d[_0xfa25('0x13')])){_0x422b1d[_0xfa25('0x13')]=_0x422b1d[_0xfa25('0x13')][_0xfa25('0x14')](_0x96b11,'');}_0x2b241f['body']=_0x422b1d[_0xfa25('0x13')];}else{_0x2b241f[_0xfa25('0x15')]=_0x422b1d[_0xfa25('0x16')];}if(_0x2b241f[_0xfa25('0x15')]){_0x2b241f[_0xfa25('0x15')]=_0x2b241f['body'][_0xfa25('0x14')](/0x0){if(this[_0x5b7332+_0xb41b('0x20')]>0x0&&this[_0x5b7332+_0xb41b('0x21')]>=this[_0x5b7332+_0xb41b('0x20')]){return _0xb41b('0x22');}else{return _0xb41b('0x23');}}else{return _0xb41b('0x24');}};Agent['prototype']['updateRealtime']=function(){var _0x2b436f=[_0xb41b('0x25'),_0xb41b('0x26'),'openchannel',_0xb41b('0x27'),_0xb41b('0x28')];for(var _0x546101=0x0;_0x546101<_0x2b436f[_0xb41b('0x29')];_0x546101+=0x1){var _0x34f908=this['getChannelStatus'](_0x2b436f[_0x546101]);if(this[_0x2b436f[_0x546101]+_0xb41b('0x2a')]!==_0x34f908){this[_0x2b436f[_0x546101]+'StatusTime']=_[_0xb41b('0x2b')](moment()[_0xb41b('0x2c')]('x'));}this[_0x2b436f[_0x546101]+'Status']=_0x34f908;}var _0x3af2c={'id':this['id'],'name':this[_0xb41b('0x6')],'online':this['online'],'voicePause':this['voicePause'],'chatPause':this[_0xb41b('0x8')],'mailPause':this[_0xb41b('0x9')],'smsPause':this[_0xb41b('0xb')],'faxPause':this[_0xb41b('0xa')],'openchannelPause':this[_0xb41b('0xc')],'chatStatus':this[_0xb41b('0x2d')],'chatStatusTime':this[_0xb41b('0xe')],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this[_0xb41b('0x10')],'mailStatus':this[_0xb41b('0x2e')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0xb41b('0x12')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0xb41b('0x2f')],'faxStatusTime':this[_0xb41b('0x30')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0xb41b('0x15')],'smsStatus':this['smsStatus'],'smsStatusTime':this[_0xb41b('0x31')],'smsCapacity':this[_0xb41b('0x17')],'smsCurrentCapacity':this['smsCurrentCapacity'],'openchannelStatus':this[_0xb41b('0x19')],'openchannelStatusTime':this[_0xb41b('0x1a')],'openchannelCapacity':this[_0xb41b('0x1b')],'openchannelCurrentCapacity':this[_0xb41b('0x32')],'busy':this[_0xb41b('0x33')],'busyQueue':this[_0xb41b('0x1c')]};var _0x157048=md5(JSON[_0xb41b('0x34')](_0x3af2c));if(this[_0xb41b('0x35')]!==_0x157048){this[_0xb41b('0x35')]=_0x157048;io['emit'](_0xb41b('0x36'),_0x3af2c);}};module['exports']=Agent; \ No newline at end of file +var _0x2547=['chatCurrentCapacity','stringify','emit','user:save','exports','moment','md5','ioredis','../../../config/environment','redis','defaults','localhost','name','online','voicePause','chatPause','faxPause','smsPause','openchannelPause','chatStatus','chatStatusTime','chatCapacity','mailStatus','unknown','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','idle','mail','chat','sms','length','Status','StatusTime','format','mailPause'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2547,0x1cd));var _0x7254=function(_0x4e34a6,_0x673662){_0x4e34a6=_0x4e34a6-0x0;var _0x33dafc=_0x2547[_0x4e34a6];return _0x33dafc;};'use strict';var _=require('lodash');var moment=require(_0x7254('0x0'));var md5=require(_0x7254('0x1'));var Redis=require(_0x7254('0x2'));var config=require(_0x7254('0x3'));config[_0x7254('0x4')]=_[_0x7254('0x5')](config[_0x7254('0x4')],{'host':_0x7254('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x7254('0x4')]));function Agent(_0x59705f){this['id']=_0x59705f['id']||0x0;this[_0x7254('0x7')]=_0x59705f[_0x7254('0x7')]||'';this['online']=_0x59705f[_0x7254('0x8')]||!![];this[_0x7254('0x9')]=_0x59705f[_0x7254('0x9')]||![];this['chatPause']=_0x59705f[_0x7254('0xa')]||![];this['mailPause']=_0x59705f['mailPause']||![];this['faxPause']=_0x59705f[_0x7254('0xb')]||![];this[_0x7254('0xc')]=_0x59705f[_0x7254('0xc')]||![];this[_0x7254('0xd')]=_0x59705f[_0x7254('0xd')]||![];this[_0x7254('0xe')]='unknown';this[_0x7254('0xf')]=0x0;this['chatCapacity']=_0x59705f[_0x7254('0x10')]||0x0;this['chatCurrentCapacity']=0x0;this[_0x7254('0x11')]=_0x7254('0x12');this[_0x7254('0x13')]=0x0;this[_0x7254('0x14')]=_0x59705f[_0x7254('0x14')]||0x0;this[_0x7254('0x15')]=0x0;this[_0x7254('0x16')]=_0x7254('0x12');this[_0x7254('0x17')]=0x0;this[_0x7254('0x18')]=_0x59705f[_0x7254('0x18')]||0x0;this[_0x7254('0x19')]=0x0;this[_0x7254('0x1a')]='unknown';this[_0x7254('0x1b')]=0x0;this[_0x7254('0x1c')]=_0x59705f[_0x7254('0x1c')]||0x0;this[_0x7254('0x1d')]=0x0;this[_0x7254('0x1e')]=_0x7254('0x12');this[_0x7254('0x1f')]=0x0;this['openchannelCapacity']=_0x59705f[_0x7254('0x20')]||0x0;this[_0x7254('0x21')]=0x0;this[_0x7254('0x22')]=![];this[_0x7254('0x23')]=undefined;this[_0x7254('0x1')]='';this[_0x7254('0x24')]();}Agent[_0x7254('0x25')][_0x7254('0x26')]=function(_0x5a37f7){if(this[_0x5a37f7+_0x7254('0x27')]>0x0){if(this[_0x5a37f7+_0x7254('0x28')]>0x0&&this[_0x5a37f7+_0x7254('0x27')]>=this[_0x5a37f7+_0x7254('0x28')]){return _0x7254('0x29');}else{return _0x7254('0x2a');}}else{return _0x7254('0x2b');}};Agent[_0x7254('0x25')][_0x7254('0x24')]=function(){var _0x195fd2=[_0x7254('0x2c'),_0x7254('0x2d'),'openchannel','fax',_0x7254('0x2e')];for(var _0xd91c1f=0x0;_0xd91c1f<_0x195fd2[_0x7254('0x2f')];_0xd91c1f+=0x1){var _0x54dace=this[_0x7254('0x26')](_0x195fd2[_0xd91c1f]);if(this[_0x195fd2[_0xd91c1f]+_0x7254('0x30')]!==_0x54dace){this[_0x195fd2[_0xd91c1f]+_0x7254('0x31')]=_['toNumber'](moment()[_0x7254('0x32')]('x'));}this[_0x195fd2[_0xd91c1f]+_0x7254('0x30')]=_0x54dace;}var _0x2b4f46={'id':this['id'],'name':this['name'],'online':this[_0x7254('0x8')],'voicePause':this['voicePause'],'chatPause':this[_0x7254('0xa')],'mailPause':this[_0x7254('0x33')],'smsPause':this['smsPause'],'faxPause':this[_0x7254('0xb')],'openchannelPause':this[_0x7254('0xd')],'chatStatus':this['chatStatus'],'chatStatusTime':this[_0x7254('0xf')],'chatCapacity':this[_0x7254('0x10')],'chatCurrentCapacity':this[_0x7254('0x34')],'mailStatus':this[_0x7254('0x11')],'mailStatusTime':this[_0x7254('0x13')],'mailCapacity':this[_0x7254('0x14')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0x7254('0x16')],'faxStatusTime':this[_0x7254('0x17')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0x7254('0x19')],'smsStatus':this[_0x7254('0x1a')],'smsStatusTime':this[_0x7254('0x1b')],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this[_0x7254('0x1d')],'openchannelStatus':this[_0x7254('0x1e')],'openchannelStatusTime':this[_0x7254('0x1f')],'openchannelCapacity':this[_0x7254('0x20')],'openchannelCurrentCapacity':this[_0x7254('0x21')],'busy':this[_0x7254('0x22')],'busyQueue':this[_0x7254('0x23')]};var _0x560706=md5(JSON[_0x7254('0x35')](_0x2b4f46));if(this['md5']!==_0x560706){this['md5']=_0x560706;io[_0x7254('0x36')](_0x7254('0x37'),_0x2b4f46);}};module[_0x7254('0x38')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 843289c..ccb268c 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 _0x1b7a=['emit','chat_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','_rr','paused','loggedIn','available','stringify','chat:queue:%s'];(function(_0x56b138,_0x2396d6){var _0x3df878=function(_0x4b3ccc){while(--_0x4b3ccc){_0x56b138['push'](_0x56b138['shift']());}};_0x3df878(++_0x2396d6);}(_0x1b7a,0x17d));var _0xa1b7=function(_0x496903,_0x29455e){_0x496903=_0x496903-0x0;var _0x56ac7d=_0x1b7a[_0x496903];return _0x56ac7d;};'use strict';var _=require(_0xa1b7('0x0'));var md5=require(_0xa1b7('0x1'));var util=require(_0xa1b7('0x2'));var Redis=require(_0xa1b7('0x3'));var config=require(_0xa1b7('0x4'));config[_0xa1b7('0x5')]=_[_0xa1b7('0x6')](config['redis'],{'host':_0xa1b7('0x7'),'port':0x18eb});var io=require(_0xa1b7('0x8'))(new Redis(config['redis']));function ChatQueue(_0x587369){this['id']=_0x587369['id']||0x0;this[_0xa1b7('0x9')]=_0x587369[_0xa1b7('0x9')]||'';this[_0xa1b7('0xa')]=_0x587369[_0xa1b7('0xa')]||0xa;this[_0xa1b7('0xb')]=_0x587369[_0xa1b7('0xb')]||'beepall';this[_0xa1b7('0xc')]=_0x587369[_0xa1b7('0xc')];this[_0xa1b7('0xd')]={};this[_0xa1b7('0xe')]=0x0;this[_0xa1b7('0x1')]='';this['updateRouting']();this[_0xa1b7('0xf')]();}ChatQueue[_0xa1b7('0x10')][_0xa1b7('0x11')]=function(){var _0x4c8a22=this[_0xa1b7('0xd')][_0xa1b7('0x12')];this[_0xa1b7('0xd')]=_['map'](this[_0xa1b7('0xc')],'id');this[_0xa1b7('0xd')][_0xa1b7('0x12')]=_0x4c8a22;};ChatQueue['prototype']['updateRealtime']=function(){this['loggedIn']=0x0;this[_0xa1b7('0x13')]=0x0;for(var _0x23e97f=0x0;_0x23e97f=0x0?this['available']:0x0;var _0x222eb4={'id':this['id'],'available':this['available'],'loggedIn':this[_0xa1b7('0x14')],'name':this[_0xa1b7('0x9')],'paused':this[_0xa1b7('0x13')],'waiting':this[_0xa1b7('0xe')]};var _0x2e72c3=md5(JSON[_0xa1b7('0x16')](_0x222eb4));if(this['md5']!==_0x2e72c3){this[_0xa1b7('0x1')]=_0x2e72c3;io['to'](util['format'](_0xa1b7('0x17'),_0x222eb4[_0xa1b7('0x9')]))[_0xa1b7('0x18')](_0xa1b7('0x19'),_0x222eb4);}};module[_0xa1b7('0x1a')]=ChatQueue; \ No newline at end of file +var _0xe34d=['../../../config/environment','redis','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','_rr','map','prototype','updateRealtime','loggedIn','paused','length','available','waiting','stringify','format','chat:queue:%s','emit','chat_queue:save','lodash','md5','util'];(function(_0x4532e3,_0x4919f5){var _0x447bc5=function(_0x58ba57){while(--_0x58ba57){_0x4532e3['push'](_0x4532e3['shift']());}};_0x447bc5(++_0x4919f5);}(_0xe34d,0x126));var _0xde34=function(_0x424f7d,_0x46562f){_0x424f7d=_0x424f7d-0x0;var _0x241cce=_0xe34d[_0x424f7d];return _0x241cce;};'use strict';var _=require(_0xde34('0x0'));var md5=require(_0xde34('0x1'));var util=require(_0xde34('0x2'));var Redis=require('ioredis');var config=require(_0xde34('0x3'));config[_0xde34('0x4')]=_['defaults'](config[_0xde34('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0xde34('0x5'))(new Redis(config[_0xde34('0x4')]));function ChatQueue(_0x1867b5){this['id']=_0x1867b5['id']||0x0;this[_0xde34('0x6')]=_0x1867b5[_0xde34('0x6')]||'';this['timeout']=_0x1867b5[_0xde34('0x7')]||0xa;this[_0xde34('0x8')]=_0x1867b5[_0xde34('0x8')]||_0xde34('0x9');this[_0xde34('0xa')]=_0x1867b5[_0xde34('0xa')];this[_0xde34('0xb')]={};this['waiting']=0x0;this[_0xde34('0x1')]='';this[_0xde34('0xc')]();this['updateRealtime']();}ChatQueue['prototype'][_0xde34('0xc')]=function(){var _0x4df433=this[_0xde34('0xb')][_0xde34('0xd')];this['mapAgentsId']=_[_0xde34('0xe')](this[_0xde34('0xa')],'id');this['mapAgentsId'][_0xde34('0xd')]=_0x4df433;};ChatQueue[_0xde34('0xf')][_0xde34('0x10')]=function(){this[_0xde34('0x11')]=0x0;this[_0xde34('0x12')]=0x0;for(var _0x51e7f5=0x0;_0x51e7f5=0x0?this[_0xde34('0x14')]:0x0;var _0x210205={'id':this['id'],'available':this[_0xde34('0x14')],'loggedIn':this[_0xde34('0x11')],'name':this[_0xde34('0x6')],'paused':this[_0xde34('0x12')],'waiting':this[_0xde34('0x15')]};var _0x10326c=md5(JSON[_0xde34('0x16')](_0x210205));if(this[_0xde34('0x1')]!==_0x10326c){this['md5']=_0x10326c;io['to'](util[_0xde34('0x17')](_0xde34('0x18'),_0x210205[_0xde34('0x6')]))[_0xde34('0x19')](_0xde34('0x1a'),_0x210205);}};module['exports']=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index d8ba00b..056c568 100644 --- a/server/services/routing/model/faxQueue.js +++ b/server/services/routing/model/faxQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['available','stringify','format','emit','exports','lodash','md5','util','redis','localhost','socket.io-emitter','name','timeout','beepall','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','Agents','_rr','loggedIn','paused','length','faxPause'];(function(_0x47ec0a,_0x70608e){var _0x1f9052=function(_0x1fb63d){while(--_0x1fb63d){_0x47ec0a['push'](_0x47ec0a['shift']());}};_0x1f9052(++_0x70608e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'use strict';var _=require(_0x0a9e('0x0'));var md5=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x0a9e('0x3')]=_['defaults'](config[_0x0a9e('0x3')],{'host':_0x0a9e('0x4'),'port':0x18eb});var io=require(_0x0a9e('0x5'))(new Redis(config[_0x0a9e('0x3')]));function FaxQueue(_0x981158){this['id']=_0x981158['id']||0x0;this['name']=_0x981158[_0x0a9e('0x6')]||'';this[_0x0a9e('0x7')]=_0x981158[_0x0a9e('0x7')]||0xa;this['strategy']=_0x981158['strategy']||_0x0a9e('0x8');this['Agents']=_0x981158['Agents'];this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]=0x0;this[_0x0a9e('0x1')]='';this[_0x0a9e('0xb')]();this[_0x0a9e('0xc')]();}FaxQueue[_0x0a9e('0xd')]['updateRouting']=function(){var _0x50dfb2=this['mapAgentsId']['_rr'];this[_0x0a9e('0x9')]=_[_0x0a9e('0xe')](this[_0x0a9e('0xf')],'id');this[_0x0a9e('0x9')][_0x0a9e('0x10')]=_0x50dfb2;};FaxQueue[_0x0a9e('0xd')]['updateRealtime']=function(){this[_0x0a9e('0x11')]=0x0;this[_0x0a9e('0x12')]=0x0;for(var _0x2b4227=0x0;_0x2b4227=0x0?this[_0x0a9e('0x15')]:0x0;var _0x478723={'id':this['id'],'available':this[_0x0a9e('0x15')],'loggedIn':this[_0x0a9e('0x11')],'name':this[_0x0a9e('0x6')],'paused':this[_0x0a9e('0x12')],'waiting':this[_0x0a9e('0xa')]};var _0x20559e=md5(JSON[_0x0a9e('0x16')](_0x478723));if(this[_0x0a9e('0x1')]!==_0x20559e){this[_0x0a9e('0x1')]=_0x20559e;io['to'](util[_0x0a9e('0x17')]('fax:queue:%s',_0x478723[_0x0a9e('0x6')]))[_0x0a9e('0x18')]('fax_queue:save',_0x478723);}};module[_0x0a9e('0x19')]=FaxQueue; \ No newline at end of file +var _0xa9e0=['available','stringify','format','emit','exports','lodash','md5','util','redis','localhost','socket.io-emitter','name','timeout','beepall','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','Agents','_rr','loggedIn','paused','length','faxPause'];(function(_0x2f6cf1,_0x2a7295){var _0x17d1ab=function(_0x13a9eb){while(--_0x13a9eb){_0x2f6cf1['push'](_0x2f6cf1['shift']());}};_0x17d1ab(++_0x2a7295);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'use strict';var _=require(_0x0a9e('0x0'));var md5=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x0a9e('0x3')]=_['defaults'](config[_0x0a9e('0x3')],{'host':_0x0a9e('0x4'),'port':0x18eb});var io=require(_0x0a9e('0x5'))(new Redis(config[_0x0a9e('0x3')]));function FaxQueue(_0x981158){this['id']=_0x981158['id']||0x0;this['name']=_0x981158[_0x0a9e('0x6')]||'';this[_0x0a9e('0x7')]=_0x981158[_0x0a9e('0x7')]||0xa;this['strategy']=_0x981158['strategy']||_0x0a9e('0x8');this['Agents']=_0x981158['Agents'];this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]=0x0;this[_0x0a9e('0x1')]='';this[_0x0a9e('0xb')]();this[_0x0a9e('0xc')]();}FaxQueue[_0x0a9e('0xd')]['updateRouting']=function(){var _0x50dfb2=this['mapAgentsId']['_rr'];this[_0x0a9e('0x9')]=_[_0x0a9e('0xe')](this[_0x0a9e('0xf')],'id');this[_0x0a9e('0x9')][_0x0a9e('0x10')]=_0x50dfb2;};FaxQueue[_0x0a9e('0xd')]['updateRealtime']=function(){this[_0x0a9e('0x11')]=0x0;this[_0x0a9e('0x12')]=0x0;for(var _0x2b4227=0x0;_0x2b4227=0x0?this[_0x0a9e('0x15')]:0x0;var _0x478723={'id':this['id'],'available':this[_0x0a9e('0x15')],'loggedIn':this[_0x0a9e('0x11')],'name':this[_0x0a9e('0x6')],'paused':this[_0x0a9e('0x12')],'waiting':this[_0x0a9e('0xa')]};var _0x20559e=md5(JSON[_0x0a9e('0x16')](_0x478723));if(this[_0x0a9e('0x1')]!==_0x20559e){this[_0x0a9e('0x1')]=_0x20559e;io['to'](util[_0x0a9e('0x17')]('fax:queue:%s',_0x478723[_0x0a9e('0x6')]))[_0x0a9e('0x18')]('fax_queue:save',_0x478723);}};module[_0x0a9e('0x19')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index db0893e..67150b8 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 _0xbd4a=['exports','name','Intervals'];(function(_0x17a520,_0x42cdf3){var _0x4b08d6=function(_0x32ecfe){while(--_0x32ecfe){_0x17a520['push'](_0x17a520['shift']());}};_0x4b08d6(++_0x42cdf3);}(_0xbd4a,0xb5));var _0xabd4=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xbd4a[_0x59ee6f];return _0x4c0979;};'use strict';function Interval(_0x4304c9){this['id']=_0x4304c9['id']||0x0;this[_0xabd4('0x0')]=_0x4304c9[_0xabd4('0x0')]||'';this[_0xabd4('0x1')]=_0x4304c9['Intervals']||{};}module[_0xabd4('0x2')]=Interval; \ No newline at end of file +var _0x069b=['Intervals','exports','name'];(function(_0x38bcf8,_0x280dc5){var _0x280a6f=function(_0x4f21d8){while(--_0x4f21d8){_0x38bcf8['push'](_0x38bcf8['shift']());}};_0x280a6f(++_0x280dc5);}(_0x069b,0x1d0));var _0xb069=function(_0x1b7250,_0xd0de03){_0x1b7250=_0x1b7250-0x0;var _0x35f64c=_0x069b[_0x1b7250];return _0x35f64c;};'use strict';function Interval(_0x14fcab){this['id']=_0x14fcab['id']||0x0;this['name']=_0x14fcab[_0xb069('0x0')]||'';this[_0xb069('0x1')]=_0x14fcab[_0xb069('0x1')]||{};}module[_0xb069('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 8880d83..c48152f 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 _0x7726=['mail_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','mailPause','available','mail:queue:%s'];(function(_0x4a385c,_0x3b3e2c){var _0x3db987=function(_0x47a72d){while(--_0x47a72d){_0x4a385c['push'](_0x4a385c['shift']());}};_0x3db987(++_0x3b3e2c);}(_0x7726,0x107));var _0x6772=function(_0x86507b,_0x467677){_0x86507b=_0x86507b-0x0;var _0x4c3115=_0x7726[_0x86507b];return _0x4c3115;};'use strict';var _=require(_0x6772('0x0'));var md5=require(_0x6772('0x1'));var util=require(_0x6772('0x2'));var Redis=require(_0x6772('0x3'));var config=require(_0x6772('0x4'));config[_0x6772('0x5')]=_[_0x6772('0x6')](config['redis'],{'host':_0x6772('0x7'),'port':0x18eb});var io=require(_0x6772('0x8'))(new Redis(config[_0x6772('0x5')]));function MailQueue(_0x52956f){this['id']=_0x52956f['id']||0x0;this[_0x6772('0x9')]=_0x52956f[_0x6772('0x9')]||'';this[_0x6772('0xa')]=_0x52956f[_0x6772('0xa')]||0xa;this['strategy']=_0x52956f['strategy']||_0x6772('0xb');this[_0x6772('0xc')]=_0x52956f[_0x6772('0xc')];this[_0x6772('0xd')]={};this[_0x6772('0xe')]=0x0;this[_0x6772('0x1')]='';this[_0x6772('0xf')]();this[_0x6772('0x10')]();}MailQueue[_0x6772('0x11')][_0x6772('0xf')]=function(){var _0x4f37be=this[_0x6772('0xd')][_0x6772('0x12')];this['mapAgentsId']=_[_0x6772('0x13')](this['Agents'],'id');this['mapAgentsId'][_0x6772('0x12')]=_0x4f37be;};MailQueue['prototype'][_0x6772('0x10')]=function(){this[_0x6772('0x14')]=0x0;this[_0x6772('0x15')]=0x0;for(var _0x1f4440=0x0;_0x1f4440=0x0?this['available']:0x0;var _0x3ad94d={'id':this['id'],'available':this[_0x6772('0x19')],'loggedIn':this[_0x6772('0x14')],'name':this[_0x6772('0x9')],'paused':this[_0x6772('0x15')],'waiting':this[_0x6772('0xe')]};var _0x3084fe=md5(JSON['stringify'](_0x3ad94d));if(this[_0x6772('0x1')]!==_0x3084fe){this[_0x6772('0x1')]=_0x3084fe;io['to'](util['format'](_0x6772('0x1a'),_0x3ad94d[_0x6772('0x9')]))['emit'](_0x6772('0x1b'),_0x3ad94d);}};module[_0x6772('0x1c')]=MailQueue; \ No newline at end of file +var _0x682b=['prototype','mapAgentsId','_rr','map','loggedIn','paused','online','mailPause','available','format','emit','mail_queue:save','exports','lodash','md5','ioredis','redis','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x682b,0x1e1));var _0xb682=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x682b[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0xb682('0x0'));var md5=require(_0xb682('0x1'));var util=require('util');var Redis=require(_0xb682('0x2'));var config=require('../../../config/environment');config[_0xb682('0x3')]=_['defaults'](config[_0xb682('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0xb682('0x4'))(new Redis(config[_0xb682('0x3')]));function MailQueue(_0x3040b6){this['id']=_0x3040b6['id']||0x0;this[_0xb682('0x5')]=_0x3040b6['name']||'';this[_0xb682('0x6')]=_0x3040b6[_0xb682('0x6')]||0xa;this[_0xb682('0x7')]=_0x3040b6['strategy']||_0xb682('0x8');this[_0xb682('0x9')]=_0x3040b6['Agents'];this['mapAgentsId']={};this[_0xb682('0xa')]=0x0;this['md5']='';this[_0xb682('0xb')]();this[_0xb682('0xc')]();}MailQueue[_0xb682('0xd')][_0xb682('0xb')]=function(){var _0x1476db=this[_0xb682('0xe')][_0xb682('0xf')];this[_0xb682('0xe')]=_[_0xb682('0x10')](this['Agents'],'id');this[_0xb682('0xe')][_0xb682('0xf')]=_0x1476db;};MailQueue[_0xb682('0xd')][_0xb682('0xc')]=function(){this[_0xb682('0x11')]=0x0;this[_0xb682('0x12')]=0x0;for(var _0x3b3565=0x0;_0x3b3565=0x0?this['available']:0x0;var _0xfbe992={'id':this['id'],'available':this[_0xb682('0x15')],'loggedIn':this[_0xb682('0x11')],'name':this['name'],'paused':this[_0xb682('0x12')],'waiting':this[_0xb682('0xa')]};var _0x2b5b84=md5(JSON['stringify'](_0xfbe992));if(this[_0xb682('0x1')]!==_0x2b5b84){this[_0xb682('0x1')]=_0x2b5b84;io['to'](util[_0xb682('0x16')]('mail:queue:%s',_0xfbe992[_0xb682('0x5')]))[_0xb682('0x17')](_0xb682('0x18'),_0xfbe992);}};module[_0xb682('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 e395695..893288f 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 _0x80e9=['updateRealtime','online','loggedIn','openchannelPause','available','paused','waiting','stringify','format','openchannel:queue:%s','emit','openchannel_queue:save','exports','md5','util','ioredis','defaults','redis','name','timeout','strategy','beepall','Agents','updateRouting','prototype','mapAgentsId','_rr','map'];(function(_0xbcfb2a,_0x3dd170){var _0x8b884f=function(_0x487cda){while(--_0x487cda){_0xbcfb2a['push'](_0xbcfb2a['shift']());}};_0x8b884f(++_0x3dd170);}(_0x80e9,0x141));var _0x980e=function(_0x96f645,_0x5a0a6c){_0x96f645=_0x96f645-0x0;var _0x271545=_0x80e9[_0x96f645];return _0x271545;};'use strict';var _=require('lodash');var md5=require(_0x980e('0x0'));var util=require(_0x980e('0x1'));var Redis=require(_0x980e('0x2'));var config=require('../../../config/environment');config['redis']=_[_0x980e('0x3')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x980e('0x4')]));function OpenchannelQueue(_0x52dc87){this['id']=_0x52dc87['id']||0x0;this[_0x980e('0x5')]=_0x52dc87[_0x980e('0x5')]||'';this[_0x980e('0x6')]=_0x52dc87[_0x980e('0x6')]||0xa;this[_0x980e('0x7')]=_0x52dc87[_0x980e('0x7')]||_0x980e('0x8');this[_0x980e('0x9')]=_0x52dc87[_0x980e('0x9')];this['mapAgentsId']={};this['waiting']=0x0;this[_0x980e('0x0')]='';this[_0x980e('0xa')]();this['updateRealtime']();}OpenchannelQueue[_0x980e('0xb')][_0x980e('0xa')]=function(){var _0x186d10=this[_0x980e('0xc')][_0x980e('0xd')];this[_0x980e('0xc')]=_[_0x980e('0xe')](this[_0x980e('0x9')],'id');this[_0x980e('0xc')][_0x980e('0xd')]=_0x186d10;};OpenchannelQueue[_0x980e('0xb')][_0x980e('0xf')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x421edb=0x0;_0x421edb=0x0?this[_0x980e('0x13')]:0x0;var _0x21c509={'id':this['id'],'available':this[_0x980e('0x13')],'loggedIn':this[_0x980e('0x11')],'name':this[_0x980e('0x5')],'paused':this[_0x980e('0x14')],'waiting':this[_0x980e('0x15')]};var _0x35ec9b=md5(JSON[_0x980e('0x16')](_0x21c509));if(this['md5']!==_0x35ec9b){this[_0x980e('0x0')]=_0x35ec9b;io['to'](util[_0x980e('0x17')](_0x980e('0x18'),_0x21c509[_0x980e('0x5')]))[_0x980e('0x19')](_0x980e('0x1a'),_0x21c509);}};module[_0x980e('0x1b')]=OpenchannelQueue; \ No newline at end of file +var _0x4bbc=['online','openchannelPause','available','loggedIn','stringify','format','openchannel:queue:%s','emit','openchannel_queue:save','lodash','md5','util','ioredis','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','prototype','_rr','map','updateRealtime','paused','length'];(function(_0x5a89bf,_0x3833c2){var _0x43171c=function(_0x136fc1){while(--_0x136fc1){_0x5a89bf['push'](_0x5a89bf['shift']());}};_0x43171c(++_0x3833c2);}(_0x4bbc,0x19c));var _0xc4bb=function(_0x4f65de,_0x230398){_0x4f65de=_0x4f65de-0x0;var _0x170b0d=_0x4bbc[_0x4f65de];return _0x170b0d;};'use strict';var _=require(_0xc4bb('0x0'));var md5=require(_0xc4bb('0x1'));var util=require(_0xc4bb('0x2'));var Redis=require(_0xc4bb('0x3'));var config=require('../../../config/environment');config['redis']=_[_0xc4bb('0x4')](config[_0xc4bb('0x5')],{'host':_0xc4bb('0x6'),'port':0x18eb});var io=require(_0xc4bb('0x7'))(new Redis(config[_0xc4bb('0x5')]));function OpenchannelQueue(_0x4d8677){this['id']=_0x4d8677['id']||0x0;this[_0xc4bb('0x8')]=_0x4d8677['name']||'';this[_0xc4bb('0x9')]=_0x4d8677['timeout']||0xa;this[_0xc4bb('0xa')]=_0x4d8677[_0xc4bb('0xa')]||_0xc4bb('0xb');this[_0xc4bb('0xc')]=_0x4d8677[_0xc4bb('0xc')];this[_0xc4bb('0xd')]={};this[_0xc4bb('0xe')]=0x0;this[_0xc4bb('0x1')]='';this[_0xc4bb('0xf')]();this['updateRealtime']();}OpenchannelQueue[_0xc4bb('0x10')]['updateRouting']=function(){var _0xc7e1ef=this['mapAgentsId'][_0xc4bb('0x11')];this['mapAgentsId']=_[_0xc4bb('0x12')](this[_0xc4bb('0xc')],'id');this[_0xc4bb('0xd')][_0xc4bb('0x11')]=_0xc7e1ef;};OpenchannelQueue[_0xc4bb('0x10')][_0xc4bb('0x13')]=function(){this['loggedIn']=0x0;this[_0xc4bb('0x14')]=0x0;for(var _0x2d550a=0x0;_0x2d550a=0x0?this[_0xc4bb('0x18')]:0x0;var _0x409b62={'id':this['id'],'available':this[_0xc4bb('0x18')],'loggedIn':this['loggedIn'],'name':this[_0xc4bb('0x8')],'paused':this[_0xc4bb('0x14')],'waiting':this[_0xc4bb('0xe')]};var _0xa1b252=md5(JSON[_0xc4bb('0x1a')](_0x409b62));if(this[_0xc4bb('0x1')]!==_0xa1b252){this[_0xc4bb('0x1')]=_0xa1b252;io['to'](util[_0xc4bb('0x1b')](_0xc4bb('0x1c'),_0x409b62[_0xc4bb('0x8')]))[_0xc4bb('0x1d')](_0xc4bb('0x1e'),_0x409b62);}};module['exports']=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 9f9a0e0..5da4953 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 _0xb7e7=['util','../../../config/environment','defaults','localhost','socket.io-emitter','redis','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRealtime','prototype','updateRouting','_rr','map','loggedIn','length','online','paused','available','stringify','sms:queue:%s','emit','exports','lodash'];(function(_0x213e84,_0x2f1e07){var _0x376e7e=function(_0x332165){while(--_0x332165){_0x213e84['push'](_0x213e84['shift']());}};_0x376e7e(++_0x2f1e07);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0xb7e7[_0x1a36a5];return _0x746243;};'use strict';var _=require(_0x7b7e('0x0'));var md5=require('md5');var util=require(_0x7b7e('0x1'));var Redis=require('ioredis');var config=require(_0x7b7e('0x2'));config['redis']=_[_0x7b7e('0x3')](config['redis'],{'host':_0x7b7e('0x4'),'port':0x18eb});var io=require(_0x7b7e('0x5'))(new Redis(config[_0x7b7e('0x6')]));function SmsQueue(_0x52047f){this['id']=_0x52047f['id']||0x0;this['name']=_0x52047f[_0x7b7e('0x7')]||'';this[_0x7b7e('0x8')]=_0x52047f[_0x7b7e('0x8')]||0xa;this['strategy']=_0x52047f[_0x7b7e('0x9')]||_0x7b7e('0xa');this[_0x7b7e('0xb')]=_0x52047f[_0x7b7e('0xb')];this[_0x7b7e('0xc')]={};this[_0x7b7e('0xd')]=0x0;this[_0x7b7e('0xe')]='';this['updateRouting']();this[_0x7b7e('0xf')]();}SmsQueue[_0x7b7e('0x10')][_0x7b7e('0x11')]=function(){var _0x29b622=this[_0x7b7e('0xc')][_0x7b7e('0x12')];this[_0x7b7e('0xc')]=_[_0x7b7e('0x13')](this[_0x7b7e('0xb')],'id');this['mapAgentsId'][_0x7b7e('0x12')]=_0x29b622;};SmsQueue[_0x7b7e('0x10')]['updateRealtime']=function(){this[_0x7b7e('0x14')]=0x0;this['paused']=0x0;for(var _0x4c6011=0x0;_0x4c6011=0x0?this[_0x7b7e('0x18')]:0x0;var _0x200ef7={'id':this['id'],'available':this[_0x7b7e('0x18')],'loggedIn':this[_0x7b7e('0x14')],'name':this[_0x7b7e('0x7')],'paused':this[_0x7b7e('0x17')],'waiting':this[_0x7b7e('0xd')]};var _0x3bec7d=md5(JSON[_0x7b7e('0x19')](_0x200ef7));if(this[_0x7b7e('0xe')]!==_0x3bec7d){this[_0x7b7e('0xe')]=_0x3bec7d;io['to'](util['format'](_0x7b7e('0x1a'),_0x200ef7[_0x7b7e('0x7')]))[_0x7b7e('0x1b')]('sms_queue:save',_0x200ef7);}};module[_0x7b7e('0x1c')]=SmsQueue; \ No newline at end of file +var _0xbaf0=['online','paused','available','format','sms:queue:%s','emit','sms_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','loggedIn','length'];(function(_0x1a0c59,_0x3b4dcc){var _0xed67c9=function(_0x247698){while(--_0x247698){_0x1a0c59['push'](_0x1a0c59['shift']());}};_0xed67c9(++_0x3b4dcc);}(_0xbaf0,0x12a));var _0x0baf=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xbaf0[_0x432682];return _0x463d05;};'use strict';var _=require('lodash');var md5=require(_0x0baf('0x0'));var util=require(_0x0baf('0x1'));var Redis=require(_0x0baf('0x2'));var config=require(_0x0baf('0x3'));config[_0x0baf('0x4')]=_[_0x0baf('0x5')](config['redis'],{'host':_0x0baf('0x6'),'port':0x18eb});var io=require(_0x0baf('0x7'))(new Redis(config[_0x0baf('0x4')]));function SmsQueue(_0x39b8f3){this['id']=_0x39b8f3['id']||0x0;this[_0x0baf('0x8')]=_0x39b8f3[_0x0baf('0x8')]||'';this[_0x0baf('0x9')]=_0x39b8f3[_0x0baf('0x9')]||0xa;this[_0x0baf('0xa')]=_0x39b8f3['strategy']||_0x0baf('0xb');this['Agents']=_0x39b8f3[_0x0baf('0xc')];this[_0x0baf('0xd')]={};this[_0x0baf('0xe')]=0x0;this[_0x0baf('0x0')]='';this[_0x0baf('0xf')]();this[_0x0baf('0x10')]();}SmsQueue[_0x0baf('0x11')][_0x0baf('0xf')]=function(){var _0x1fc6b2=this[_0x0baf('0xd')][_0x0baf('0x12')];this['mapAgentsId']=_['map'](this[_0x0baf('0xc')],'id');this[_0x0baf('0xd')][_0x0baf('0x12')]=_0x1fc6b2;};SmsQueue[_0x0baf('0x11')]['updateRealtime']=function(){this[_0x0baf('0x13')]=0x0;this['paused']=0x0;for(var _0x1c76a8=0x0;_0x1c76a8=0x0?this['available']:0x0;var _0x63c820={'id':this['id'],'available':this[_0x0baf('0x17')],'loggedIn':this[_0x0baf('0x13')],'name':this[_0x0baf('0x8')],'paused':this[_0x0baf('0x16')],'waiting':this[_0x0baf('0xe')]};var _0x4ff793=md5(JSON['stringify'](_0x63c820));if(this[_0x0baf('0x0')]!==_0x4ff793){this[_0x0baf('0x0')]=_0x4ff793;io['to'](util[_0x0baf('0x18')](_0x0baf('0x19'),_0x63c820[_0x0baf('0x8')]))[_0x0baf('0x1a')](_0x0baf('0x1b'),_0x63c820);}};module[_0x0baf('0x1c')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 57cb940..b4d4065 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 _0x48bf=['initMailQueues','mailQueues','exports','bluebird','lodash','moment','../model/agent','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','agents','openchannelQueues','smsQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','isUndefined','initIntervals','intervals','length','updateRouting','updateRealtime','chatQueues','initSmsQueues'];(function(_0x403c20,_0x4a7b99){var _0x2b271a=function(_0x106ecb){while(--_0x106ecb){_0x403c20['push'](_0x403c20['shift']());}};_0x2b271a(++_0x4a7b99);}(_0x48bf,0xfb));var _0xf48b=function(_0x127c7e,_0x470192){_0x127c7e=_0x127c7e-0x0;var _0x45f955=_0x48bf[_0x127c7e];return _0x45f955;};'use strict';var BPromise=require(_0xf48b('0x0'));var util=require('util');var _=require(_0xf48b('0x1'));var moment=require(_0xf48b('0x2'));var Agent=require(_0xf48b('0x3'));var Interval=require(_0xf48b('0x4'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0xf48b('0x5'));var SmsQueue=require(_0xf48b('0x6'));var MailQueue=require(_0xf48b('0x7'));var FaxQueue=require('../model/faxQueue');var Realtime=function(){this[_0xf48b('0x8')]={};this['intervals']={};this[_0xf48b('0x9')]={};this['chatQueues']={};this[_0xf48b('0xa')]={};this['mailQueues']={};this[_0xf48b('0xb')]={};this['chatQueuesWaitingInteractions']={};this[_0xf48b('0xc')]={};this[_0xf48b('0xd')]={};this[_0xf48b('0xe')]={};this[_0xf48b('0xf')]={};};function freeIsNotKey(_0x31c31c,_0x418708,_0x357968){var _0x22451b=_[_0xf48b('0x10')](_0x31c31c,function(_0x384904,_0xefea8c){return _0x384904[_0x357968];});for(var _0x5370df in _0x418708){if(_0x418708[_0xf48b('0x11')](_0x5370df)){if(!_0x22451b[_0x5370df]){delete _0x418708[_0x5370df];}}}}Realtime[_0xf48b('0x12')][_0xf48b('0x13')]=function(_0x1b5dfe,_0xe22480){for(var _0x5620a8 in _0xe22480){if(_0x1b5dfe[_0xf48b('0x11')](_0x5620a8)){_0x1b5dfe[_0x5620a8]=_0xe22480[_0x5620a8];}}};Realtime['prototype']['initAgents']=function(){var _0x4c2a25=this;return function(_0x3b94c7){if(_0x3b94c7){freeIsNotKey(_0x3b94c7,_0x4c2a25[_0xf48b('0x8')],'id');for(var _0xb7ec32=0x0,_0x20ce94={},_0x2e85be={};_0xb7ec32<_0x3b94c7['length'];_0xb7ec32+=0x1){_0x20ce94=_0x3b94c7[_0xb7ec32];if(_[_0xf48b('0x14')](_0x4c2a25[_0xf48b('0x8')][_0x20ce94['id']])){_0x4c2a25['agents'][_0x20ce94['id']]=new Agent(_0x20ce94);}else{_0x4c2a25[_0xf48b('0x13')](_0x4c2a25[_0xf48b('0x8')][_0x20ce94['id']],_0x20ce94);}}}return _0x4c2a25[_0xf48b('0x8')];};};Realtime[_0xf48b('0x12')][_0xf48b('0x15')]=function(){var _0x330a4f=this;return function(_0x13304b){if(_0x13304b){freeIsNotKey(_0x13304b,_0x330a4f[_0xf48b('0x16')],'id');for(var _0x1cf93e=0x0,_0x49223e={},_0x50e54b={};_0x1cf93e<_0x13304b[_0xf48b('0x17')];_0x1cf93e+=0x1){_0x49223e=_0x13304b[_0x1cf93e];if(_['isUndefined'](_0x330a4f['intervals'][_0x49223e['id']])){_0x330a4f['intervals'][_0x49223e['id']]=new Interval(_0x49223e);}else{_0x330a4f[_0xf48b('0x13')](_0x330a4f[_0xf48b('0x16')][_0x49223e['id']],_0x49223e);}}}return _0x330a4f['intervals'];};};Realtime[_0xf48b('0x12')]['initOpenchannelQueues']=function(){var _0x4283c3=this;return function(_0x2cfded){if(_0x2cfded){freeIsNotKey(_0x2cfded,_0x4283c3[_0xf48b('0x9')],'id');for(var _0x4a6fed=0x0,_0x1dad45={},_0x55334d={};_0x4a6fed<_0x2cfded['length'];_0x4a6fed+=0x1){_0x1dad45=_0x2cfded[_0x4a6fed];if(_[_0xf48b('0x14')](_0x4283c3[_0xf48b('0x9')][_0x1dad45['id']])){_0x4283c3[_0xf48b('0x9')][_0x1dad45['id']]=new OpenchannelQueue(_0x1dad45);}else{_0x4283c3[_0xf48b('0x13')](_0x4283c3[_0xf48b('0x9')][_0x1dad45['id']],_0x1dad45);}_0x4283c3[_0xf48b('0x9')][_0x1dad45['id']][_0xf48b('0x18')]();_0x4283c3[_0xf48b('0x9')][_0x1dad45['id']][_0xf48b('0x19')]();}}return _0x4283c3[_0xf48b('0x9')];};};Realtime['prototype']['initChatQueues']=function(){var _0x238292=this;return function(_0x11fbaa){if(_0x11fbaa){freeIsNotKey(_0x11fbaa,_0x238292[_0xf48b('0x1a')],'id');for(var _0x3fa03b=0x0,_0x2da660={},_0x145d42={};_0x3fa03b<_0x11fbaa[_0xf48b('0x17')];_0x3fa03b+=0x1){_0x2da660=_0x11fbaa[_0x3fa03b];if(_[_0xf48b('0x14')](_0x238292['chatQueues'][_0x2da660['id']])){_0x238292[_0xf48b('0x1a')][_0x2da660['id']]=new ChatQueue(_0x2da660);}else{_0x238292['mergeFromDatabase'](_0x238292[_0xf48b('0x1a')][_0x2da660['id']],_0x2da660);}_0x238292[_0xf48b('0x1a')][_0x2da660['id']][_0xf48b('0x18')]();_0x238292['chatQueues'][_0x2da660['id']][_0xf48b('0x19')]();}}return _0x238292[_0xf48b('0x1a')];};};Realtime['prototype'][_0xf48b('0x1b')]=function(){var _0x491464=this;return function(_0x2667e6){if(_0x2667e6){freeIsNotKey(_0x2667e6,_0x491464['smsQueues'],'id');for(var _0x2ae696=0x0,_0x58cb20={},_0x4fe7fb={};_0x2ae696<_0x2667e6[_0xf48b('0x17')];_0x2ae696+=0x1){_0x58cb20=_0x2667e6[_0x2ae696];if(_[_0xf48b('0x14')](_0x491464[_0xf48b('0xa')][_0x58cb20['id']])){_0x491464[_0xf48b('0xa')][_0x58cb20['id']]=new SmsQueue(_0x58cb20);}else{_0x491464[_0xf48b('0x13')](_0x491464[_0xf48b('0xa')][_0x58cb20['id']],_0x58cb20);}_0x491464[_0xf48b('0xa')][_0x58cb20['id']][_0xf48b('0x18')]();_0x491464[_0xf48b('0xa')][_0x58cb20['id']][_0xf48b('0x19')]();}}return _0x491464[_0xf48b('0xa')];};};Realtime[_0xf48b('0x12')][_0xf48b('0x1c')]=function(){var _0x2fb058=this;return function(_0x23c9ec){if(_0x23c9ec){freeIsNotKey(_0x23c9ec,_0x2fb058[_0xf48b('0x1d')],'id');for(var _0x513934=0x0,_0x59e9e3={},_0x1d4c29={};_0x513934<_0x23c9ec[_0xf48b('0x17')];_0x513934+=0x1){_0x59e9e3=_0x23c9ec[_0x513934];if(_[_0xf48b('0x14')](_0x2fb058['mailQueues'][_0x59e9e3['id']])){_0x2fb058[_0xf48b('0x1d')][_0x59e9e3['id']]=new MailQueue(_0x59e9e3);}else{_0x2fb058[_0xf48b('0x13')](_0x2fb058[_0xf48b('0x1d')][_0x59e9e3['id']],_0x59e9e3);}_0x2fb058['mailQueues'][_0x59e9e3['id']]['updateRouting']();_0x2fb058[_0xf48b('0x1d')][_0x59e9e3['id']][_0xf48b('0x19')]();}}return _0x2fb058[_0xf48b('0x1d')];};};Realtime[_0xf48b('0x12')]['initFaxQueues']=function(){var _0xe18436=this;return function(_0x4055c1){if(_0x4055c1){freeIsNotKey(_0x4055c1,_0xe18436[_0xf48b('0xb')],'id');for(var _0x55ad05=0x0,_0x7fdb26={},_0x46a740={};_0x55ad05<_0x4055c1[_0xf48b('0x17')];_0x55ad05+=0x1){_0x7fdb26=_0x4055c1[_0x55ad05];if(_[_0xf48b('0x14')](_0xe18436['faxQueues'][_0x7fdb26['id']])){_0xe18436['faxQueues'][_0x7fdb26['id']]=new FaxQueue(_0x7fdb26);}else{_0xe18436['mergeFromDatabase'](_0xe18436['faxQueues'][_0x7fdb26['id']],_0x7fdb26);}_0xe18436[_0xf48b('0xb')][_0x7fdb26['id']][_0xf48b('0x18')]();_0xe18436[_0xf48b('0xb')][_0x7fdb26['id']][_0xf48b('0x19')]();}}return _0xe18436[_0xf48b('0xb')];};};module[_0xf48b('0x1e')]=Realtime; \ No newline at end of file +var _0x0183=['mailQueues','faxQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','length','isUndefined','initIntervals','initOpenchannelQueues','openchannelQueues','updateRouting','updateRealtime','chatQueues','initSmsQueues','initMailQueues','initFaxQueues','exports','bluebird','util','lodash','moment','../model/agent','../model/interval','../model/smsQueue','../model/mailQueue','../model/faxQueue','agents','intervals','smsQueues'];(function(_0x127e72,_0x4f4ed0){var _0x36842d=function(_0x524b3f){while(--_0x524b3f){_0x127e72['push'](_0x127e72['shift']());}};_0x36842d(++_0x4f4ed0);}(_0x0183,0x10c));var _0x3018=function(_0x9aaae1,_0x47d184){_0x9aaae1=_0x9aaae1-0x0;var _0x140888=_0x0183[_0x9aaae1];return _0x140888;};'use strict';var BPromise=require(_0x3018('0x0'));var util=require(_0x3018('0x1'));var _=require(_0x3018('0x2'));var moment=require(_0x3018('0x3'));var Agent=require(_0x3018('0x4'));var Interval=require(_0x3018('0x5'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require('../model/chatQueue');var SmsQueue=require(_0x3018('0x6'));var MailQueue=require(_0x3018('0x7'));var FaxQueue=require(_0x3018('0x8'));var Realtime=function(){this[_0x3018('0x9')]={};this[_0x3018('0xa')]={};this['openchannelQueues']={};this['chatQueues']={};this[_0x3018('0xb')]={};this[_0x3018('0xc')]={};this[_0x3018('0xd')]={};this[_0x3018('0xe')]={};this[_0x3018('0xf')]={};this[_0x3018('0x10')]={};this[_0x3018('0x11')]={};this[_0x3018('0x12')]={};};function freeIsNotKey(_0xdcece3,_0x429928,_0x3ee8d1){var _0xf2e0f9=_[_0x3018('0x13')](_0xdcece3,function(_0x3d1b93,_0x2ccb47){return _0x3d1b93[_0x3ee8d1];});for(var _0x54c82f in _0x429928){if(_0x429928[_0x3018('0x14')](_0x54c82f)){if(!_0xf2e0f9[_0x54c82f]){delete _0x429928[_0x54c82f];}}}}Realtime[_0x3018('0x15')][_0x3018('0x16')]=function(_0x525446,_0x425207){for(var _0x4fe004 in _0x425207){if(_0x525446[_0x3018('0x14')](_0x4fe004)){_0x525446[_0x4fe004]=_0x425207[_0x4fe004];}}};Realtime['prototype']['initAgents']=function(){var _0x397f2e=this;return function(_0x2bc006){if(_0x2bc006){freeIsNotKey(_0x2bc006,_0x397f2e['agents'],'id');for(var _0x19094b=0x0,_0x203487={},_0x9f1a9c={};_0x19094b<_0x2bc006[_0x3018('0x17')];_0x19094b+=0x1){_0x203487=_0x2bc006[_0x19094b];if(_[_0x3018('0x18')](_0x397f2e[_0x3018('0x9')][_0x203487['id']])){_0x397f2e[_0x3018('0x9')][_0x203487['id']]=new Agent(_0x203487);}else{_0x397f2e['mergeFromDatabase'](_0x397f2e['agents'][_0x203487['id']],_0x203487);}}}return _0x397f2e[_0x3018('0x9')];};};Realtime[_0x3018('0x15')][_0x3018('0x19')]=function(){var _0x3f4b30=this;return function(_0x2069bd){if(_0x2069bd){freeIsNotKey(_0x2069bd,_0x3f4b30[_0x3018('0xa')],'id');for(var _0xba7831=0x0,_0x4254f7={},_0x4633bc={};_0xba7831<_0x2069bd[_0x3018('0x17')];_0xba7831+=0x1){_0x4254f7=_0x2069bd[_0xba7831];if(_[_0x3018('0x18')](_0x3f4b30['intervals'][_0x4254f7['id']])){_0x3f4b30[_0x3018('0xa')][_0x4254f7['id']]=new Interval(_0x4254f7);}else{_0x3f4b30[_0x3018('0x16')](_0x3f4b30[_0x3018('0xa')][_0x4254f7['id']],_0x4254f7);}}}return _0x3f4b30['intervals'];};};Realtime['prototype'][_0x3018('0x1a')]=function(){var _0x89413e=this;return function(_0x47180f){if(_0x47180f){freeIsNotKey(_0x47180f,_0x89413e[_0x3018('0x1b')],'id');for(var _0x12f07a=0x0,_0xec6261={},_0x4129c8={};_0x12f07a<_0x47180f[_0x3018('0x17')];_0x12f07a+=0x1){_0xec6261=_0x47180f[_0x12f07a];if(_['isUndefined'](_0x89413e['openchannelQueues'][_0xec6261['id']])){_0x89413e[_0x3018('0x1b')][_0xec6261['id']]=new OpenchannelQueue(_0xec6261);}else{_0x89413e[_0x3018('0x16')](_0x89413e['openchannelQueues'][_0xec6261['id']],_0xec6261);}_0x89413e[_0x3018('0x1b')][_0xec6261['id']][_0x3018('0x1c')]();_0x89413e[_0x3018('0x1b')][_0xec6261['id']][_0x3018('0x1d')]();}}return _0x89413e[_0x3018('0x1b')];};};Realtime['prototype']['initChatQueues']=function(){var _0x303374=this;return function(_0x2040ac){if(_0x2040ac){freeIsNotKey(_0x2040ac,_0x303374['chatQueues'],'id');for(var _0x17f470=0x0,_0x49e2a7={},_0x27f2f0={};_0x17f470<_0x2040ac[_0x3018('0x17')];_0x17f470+=0x1){_0x49e2a7=_0x2040ac[_0x17f470];if(_[_0x3018('0x18')](_0x303374[_0x3018('0x1e')][_0x49e2a7['id']])){_0x303374['chatQueues'][_0x49e2a7['id']]=new ChatQueue(_0x49e2a7);}else{_0x303374[_0x3018('0x16')](_0x303374[_0x3018('0x1e')][_0x49e2a7['id']],_0x49e2a7);}_0x303374[_0x3018('0x1e')][_0x49e2a7['id']][_0x3018('0x1c')]();_0x303374[_0x3018('0x1e')][_0x49e2a7['id']][_0x3018('0x1d')]();}}return _0x303374['chatQueues'];};};Realtime[_0x3018('0x15')][_0x3018('0x1f')]=function(){var _0x1bf3ed=this;return function(_0x19ea0e){if(_0x19ea0e){freeIsNotKey(_0x19ea0e,_0x1bf3ed['smsQueues'],'id');for(var _0x3ee02d=0x0,_0x5e9ac9={},_0x593230={};_0x3ee02d<_0x19ea0e[_0x3018('0x17')];_0x3ee02d+=0x1){_0x5e9ac9=_0x19ea0e[_0x3ee02d];if(_['isUndefined'](_0x1bf3ed['smsQueues'][_0x5e9ac9['id']])){_0x1bf3ed[_0x3018('0xb')][_0x5e9ac9['id']]=new SmsQueue(_0x5e9ac9);}else{_0x1bf3ed[_0x3018('0x16')](_0x1bf3ed[_0x3018('0xb')][_0x5e9ac9['id']],_0x5e9ac9);}_0x1bf3ed[_0x3018('0xb')][_0x5e9ac9['id']][_0x3018('0x1c')]();_0x1bf3ed[_0x3018('0xb')][_0x5e9ac9['id']][_0x3018('0x1d')]();}}return _0x1bf3ed[_0x3018('0xb')];};};Realtime[_0x3018('0x15')][_0x3018('0x20')]=function(){var _0x35d0f9=this;return function(_0x2e6e60){if(_0x2e6e60){freeIsNotKey(_0x2e6e60,_0x35d0f9['mailQueues'],'id');for(var _0x56055f=0x0,_0x4f542a={},_0x5f4050={};_0x56055f<_0x2e6e60['length'];_0x56055f+=0x1){_0x4f542a=_0x2e6e60[_0x56055f];if(_[_0x3018('0x18')](_0x35d0f9['mailQueues'][_0x4f542a['id']])){_0x35d0f9[_0x3018('0xc')][_0x4f542a['id']]=new MailQueue(_0x4f542a);}else{_0x35d0f9[_0x3018('0x16')](_0x35d0f9['mailQueues'][_0x4f542a['id']],_0x4f542a);}_0x35d0f9[_0x3018('0xc')][_0x4f542a['id']][_0x3018('0x1c')]();_0x35d0f9['mailQueues'][_0x4f542a['id']][_0x3018('0x1d')]();}}return _0x35d0f9[_0x3018('0xc')];};};Realtime[_0x3018('0x15')][_0x3018('0x21')]=function(){var _0x259ac9=this;return function(_0x1a7818){if(_0x1a7818){freeIsNotKey(_0x1a7818,_0x259ac9[_0x3018('0xd')],'id');for(var _0xd070cf=0x0,_0x3e4508={},_0x43e326={};_0xd070cf<_0x1a7818[_0x3018('0x17')];_0xd070cf+=0x1){_0x3e4508=_0x1a7818[_0xd070cf];if(_[_0x3018('0x18')](_0x259ac9['faxQueues'][_0x3e4508['id']])){_0x259ac9[_0x3018('0xd')][_0x3e4508['id']]=new FaxQueue(_0x3e4508);}else{_0x259ac9[_0x3018('0x16')](_0x259ac9[_0x3018('0xd')][_0x3e4508['id']],_0x3e4508);}_0x259ac9['faxQueues'][_0x3e4508['id']]['updateRouting']();_0x259ac9[_0x3018('0xd')][_0x3e4508['id']][_0x3018('0x1d')]();}}return _0x259ac9[_0x3018('0xd')];};};module[_0x3018('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 7d2ba6d..4aa0019 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 _0xb1fe=['addTagsToChatInteraction','update','UpdateChatInteraction','addTags','Request'];(function(_0x28e388,_0x5ed424){var _0x45cb01=function(_0x317098){while(--_0x317098){_0x28e388['push'](_0x28e388['shift']());}};_0x45cb01(++_0x5ed424);}(_0xb1fe,0xec));var _0xeb1f=function(_0x1e37d2,_0x54bd51){_0x1e37d2=_0x1e37d2-0x0;var _0x2e1e59=_0xb1fe[_0x1e37d2];return _0x2e1e59;};'use strict';var client=require('../client');exports[_0xeb1f('0x0')]=function(_0xf1b11f,_0x5d574d){return client['Request'](_0xeb1f('0x1'),{'body':_0x5d574d,'options':{'where':{'id':_0xf1b11f}},'log':'updateChatInteraction'});};exports[_0xeb1f('0x2')]=function(_0x8c421,_0x3fc3ba){return client[_0xeb1f('0x3')]('AddTagsToChatInteraction',{'body':_0x3fc3ba,'options':{'where':{'id':_0x8c421}},'log':_0xeb1f('0x4')});}; \ No newline at end of file +var _0xe04b=['addTagsToChatInteraction','../client','update','Request','UpdateChatInteraction','updateChatInteraction','AddTagsToChatInteraction'];(function(_0x163583,_0xec6f6){var _0x41d373=function(_0x262759){while(--_0x262759){_0x163583['push'](_0x163583['shift']());}};_0x41d373(++_0xec6f6);}(_0xe04b,0x197));var _0xbe04=function(_0x3339db,_0x5700f7){_0x3339db=_0x3339db-0x0;var _0xe7341=_0xe04b[_0x3339db];return _0xe7341;};'use strict';var client=require(_0xbe04('0x0'));exports[_0xbe04('0x1')]=function(_0x317f7f,_0x3dddbb){return client[_0xbe04('0x2')](_0xbe04('0x3'),{'body':_0x3dddbb,'options':{'where':{'id':_0x317f7f}},'log':_0xbe04('0x4')});};exports['addTags']=function(_0xb627fe,_0x21bf3d){return client['Request'](_0xbe04('0x5'),{'body':_0x21bf3d,'options':{'where':{'id':_0xb627fe}},'log':_0xbe04('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 492013f..e2f4fbd 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 _0xe30a=['CreateChatMessage','../client','create','Request'];(function(_0x5ce3c8,_0x2503bd){var _0xa76867=function(_0x52815e){while(--_0x52815e){_0x5ce3c8['push'](_0x5ce3c8['shift']());}};_0xa76867(++_0x2503bd);}(_0xe30a,0x175));var _0xae30=function(_0x204736,_0x389f02){_0x204736=_0x204736-0x0;var _0x11f559=_0xe30a[_0x204736];return _0x11f559;};'use strict';var client=require(_0xae30('0x0'));exports[_0xae30('0x1')]=function(_0x2c94be){return client[_0xae30('0x2')](_0xae30('0x3'),{'body':_0x2c94be,'log':'createChatMessage'});}; \ No newline at end of file +var _0xc1c4=['create','Request','CreateChatMessage','createChatMessage'];(function(_0x5cdaf2,_0x4aad4d){var _0x3c9589=function(_0x1c75c0){while(--_0x1c75c0){_0x5cdaf2['push'](_0x5cdaf2['shift']());}};_0x3c9589(++_0x4aad4d);}(_0xc1c4,0x130));var _0x4c1c=function(_0x2537a2,_0x28e184){_0x2537a2=_0x2537a2-0x0;var _0x31c55e=_0xc1c4[_0x2537a2];return _0x31c55e;};'use strict';var client=require('../client');exports[_0x4c1c('0x0')]=function(_0x17f043){return client[_0x4c1c('0x1')](_0x4c1c('0x2'),{'body':_0x17f043,'log':_0x4c1c('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index a534903..049892f 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 _0x7c9e=['User','Agents','online','chatPause','getChatQueues','Request','GetChatQueue','name','timeout','strategy'];(function(_0x16225a,_0x5dfc7e){var _0x5a6e71=function(_0x4cac06){while(--_0x4cac06){_0x16225a['push'](_0x16225a['shift']());}};_0x5a6e71(++_0x5dfc7e);}(_0x7c9e,0x11d));var _0xe7c9=function(_0x48ba01,_0x1cec33){_0x48ba01=_0x48ba01-0x0;var _0x22a051=_0x7c9e[_0x48ba01];return _0x22a051;};'use strict';var client=require('../client');exports['getChatQueues']=function(){return function(){return client[_0xe7c9('0x0')](_0xe7c9('0x1'),{'options':{'raw':![],'attributes':['id',_0xe7c9('0x2'),_0xe7c9('0x3'),_0xe7c9('0x4')],'include':[{'model':_0xe7c9('0x5'),'as':_0xe7c9('0x6'),'attributes':['id','name',_0xe7c9('0x7'),_0xe7c9('0x8')]}]},'log':_0xe7c9('0x9')});};}; \ No newline at end of file +var _0x4991=['chatPause','getChatQueues','GetChatQueue','timeout','strategy','User','Agents','name'];(function(_0x36c6eb,_0x4fb127){var _0x30675b=function(_0x3a788b){while(--_0x3a788b){_0x36c6eb['push'](_0x36c6eb['shift']());}};_0x30675b(++_0x4fb127);}(_0x4991,0x89));var _0x1499=function(_0x50b156,_0xd33c41){_0x50b156=_0x50b156-0x0;var _0x55e4ef=_0x4991[_0x50b156];return _0x55e4ef;};'use strict';var client=require('../client');exports[_0x1499('0x0')]=function(){return function(){return client['Request'](_0x1499('0x1'),{'options':{'raw':![],'attributes':['id','name',_0x1499('0x2'),_0x1499('0x3')],'include':[{'model':_0x1499('0x4'),'as':_0x1499('0x5'),'attributes':['id',_0x1499('0x6'),'online',_0x1499('0x7')]}]},'log':'getChatQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 9921be4..933ae2e 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 _0x5d55=['create','Request','CreateChatQueueReport','update','UpdateChatQueueReport','DESC'];(function(_0x3b9e7d,_0x206181){var _0x5b9f29=function(_0x437dcd){while(--_0x437dcd){_0x3b9e7d['push'](_0x3b9e7d['shift']());}};_0x5b9f29(++_0x206181);}(_0x5d55,0x1a4));var _0x55d5=function(_0x519ebc,_0x3ab0fa){_0x519ebc=_0x519ebc-0x0;var _0x48af13=_0x5d55[_0x519ebc];return _0x48af13;};'use strict';var client=require('../client');exports[_0x55d5('0x0')]=function(_0x4cd0e2){return client[_0x55d5('0x1')](_0x55d5('0x2'),{'body':_0x4cd0e2,'log':'CreateChatQueueReport'});};exports[_0x55d5('0x3')]=function(_0x12beec,_0x3bca0b){return client['Request'](_0x55d5('0x4'),{'body':_0x3bca0b,'options':{'where':{'uniqueid':_0x12beec},'order':[['id',_0x55d5('0x5')]],'limit':0x1},'log':_0x55d5('0x4')});}; \ No newline at end of file +var _0xe105=['CreateChatQueueReport','update','UpdateChatQueueReport','DESC','../client'];(function(_0x14a852,_0x5ce935){var _0x3f8023=function(_0x4857ed){while(--_0x4857ed){_0x14a852['push'](_0x14a852['shift']());}};_0x3f8023(++_0x5ce935);}(_0xe105,0xef));var _0x5e10=function(_0x47c73b,_0x1622d4){_0x47c73b=_0x47c73b-0x0;var _0x416795=_0xe105[_0x47c73b];return _0x416795;};'use strict';var client=require(_0x5e10('0x0'));exports['create']=function(_0x4d5a73){return client['Request']('CreateChatQueueReport',{'body':_0x4d5a73,'log':_0x5e10('0x1')});};exports[_0x5e10('0x2')]=function(_0x1cddb3,_0x191ab2){return client['Request'](_0x5e10('0x3'),{'body':_0x191ab2,'options':{'where':{'uniqueid':_0x1cddb3},'order':[['id',_0x5e10('0x4')]],'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 e94d14d..c9e6b0f 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 _0xd0eb=['addTags','addTagsToFaxInteraction','update','Request','UpdateFaxInteraction','updateFaxInteraction'];(function(_0x19efbc,_0x10b7d7){var _0x205c5e=function(_0x49daa4){while(--_0x49daa4){_0x19efbc['push'](_0x19efbc['shift']());}};_0x205c5e(++_0x10b7d7);}(_0xd0eb,0x188));var _0xbd0e=function(_0x68ee8b,_0x3cc6c5){_0x68ee8b=_0x68ee8b-0x0;var _0x5148f7=_0xd0eb[_0x68ee8b];return _0x5148f7;};'use strict';var client=require('../client');exports[_0xbd0e('0x0')]=function(_0x2dbf35,_0x67fbc9){return client[_0xbd0e('0x1')](_0xbd0e('0x2'),{'body':_0x67fbc9,'options':{'where':{'id':_0x2dbf35}},'log':_0xbd0e('0x3')});};exports[_0xbd0e('0x4')]=function(_0x12d727,_0x34b33b){return client['Request']('AddTagsToFaxInteraction',{'body':_0x34b33b,'options':{'where':{'id':_0x12d727}},'log':_0xbd0e('0x5')});}; \ No newline at end of file +var _0x8b53=['updateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update','Request'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x8b53,0x171));var _0x38b5=function(_0x1ba252,_0x34411f){_0x1ba252=_0x1ba252-0x0;var _0x459466=_0x8b53[_0x1ba252];return _0x459466;};'use strict';var client=require(_0x38b5('0x0'));exports[_0x38b5('0x1')]=function(_0x5770dc,_0x1470af){return client[_0x38b5('0x2')]('UpdateFaxInteraction',{'body':_0x1470af,'options':{'where':{'id':_0x5770dc}},'log':_0x38b5('0x3')});};exports[_0x38b5('0x4')]=function(_0x367486,_0x5efbfb){return client[_0x38b5('0x2')](_0x38b5('0x5'),{'body':_0x5efbfb,'options':{'where':{'id':_0x367486}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index 4d702ef..460f5d4 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 _0x00b6=['Request','createFaxMessage'];(function(_0x2a7170,_0x546402){var _0x28dd33=function(_0x453d33){while(--_0x453d33){_0x2a7170['push'](_0x2a7170['shift']());}};_0x28dd33(++_0x546402);}(_0x00b6,0xce));var _0x600b=function(_0x1ae491,_0x5b83b9){_0x1ae491=_0x1ae491-0x0;var _0x4958a5=_0x00b6[_0x1ae491];return _0x4958a5;};'use strict';var client=require('../client');exports['create']=function(_0x550a18){return client[_0x600b('0x0')]('CreateFaxMessage',{'body':_0x550a18,'log':_0x600b('0x1')});}; \ No newline at end of file +var _0x3185=['create','Request','CreateFaxMessage','createFaxMessage','../client'];(function(_0x28681c,_0x48a278){var _0x4c7195=function(_0x3b2152){while(--_0x3b2152){_0x28681c['push'](_0x28681c['shift']());}};_0x4c7195(++_0x48a278);}(_0x3185,0x19e));var _0x5318=function(_0x3a83fe,_0x4fdf0a){_0x3a83fe=_0x3a83fe-0x0;var _0x34fafb=_0x3185[_0x3a83fe];return _0x34fafb;};'use strict';var client=require(_0x5318('0x0'));exports[_0x5318('0x1')]=function(_0x51b752){return client[_0x5318('0x2')](_0x5318('0x3'),{'body':_0x51b752,'log':_0x5318('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 1f1c637..5ecc81e 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 _0xd6b9=['name','timeout','User','faxPause','getFaxQueues','../client','GetFaxQueue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd6b9,0x91));var _0x9d6b=function(_0x5d3fb8,_0x126d3e){_0x5d3fb8=_0x5d3fb8-0x0;var _0x2397a7=_0xd6b9[_0x5d3fb8];return _0x2397a7;};'use strict';var client=require(_0x9d6b('0x0'));exports['getFaxQueues']=function(){return function(){return client['Request'](_0x9d6b('0x1'),{'options':{'raw':![],'attributes':['id',_0x9d6b('0x2'),_0x9d6b('0x3'),'strategy'],'include':[{'model':_0x9d6b('0x4'),'as':'Agents','attributes':['id','name','online',_0x9d6b('0x5')]}]},'log':_0x9d6b('0x6')});};}; \ No newline at end of file +var _0x6461=['../client','getFaxQueues','Request','GetFaxQueue','name','timeout','strategy','Agents','online'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x6461,0xe1));var _0x1646=function(_0x367e47,_0x3a82fd){_0x367e47=_0x367e47-0x0;var _0x587eb0=_0x6461[_0x367e47];return _0x587eb0;};'use strict';var client=require(_0x1646('0x0'));exports[_0x1646('0x1')]=function(){return function(){return client[_0x1646('0x2')](_0x1646('0x3'),{'options':{'raw':![],'attributes':['id',_0x1646('0x4'),_0x1646('0x5'),_0x1646('0x6')],'include':[{'model':'User','as':_0x1646('0x7'),'attributes':['id',_0x1646('0x4'),_0x1646('0x8'),'faxPause']}]},'log':_0x1646('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 751eb99..ed5c369 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 _0xc213=['Request','CreateFaxQueueReport','update','DESC','UpdateFaxQueueReport','../client','create'];(function(_0x4063a4,_0x19d730){var _0x17908d=function(_0x3ce714){while(--_0x3ce714){_0x4063a4['push'](_0x4063a4['shift']());}};_0x17908d(++_0x19d730);}(_0xc213,0x19b));var _0x3c21=function(_0x31822f,_0x1cf34e){_0x31822f=_0x31822f-0x0;var _0x22ba70=_0xc213[_0x31822f];return _0x22ba70;};'use strict';var client=require(_0x3c21('0x0'));exports[_0x3c21('0x1')]=function(_0x10744a){return client[_0x3c21('0x2')](_0x3c21('0x3'),{'body':_0x10744a,'log':_0x3c21('0x3')});};exports[_0x3c21('0x4')]=function(_0x217804,_0x3d445b){return client[_0x3c21('0x2')]('UpdateFaxQueueReport',{'body':_0x3d445b,'options':{'where':{'uniqueid':_0x217804},'order':[['id',_0x3c21('0x5')]],'limit':0x1},'log':_0x3c21('0x6')});}; \ No newline at end of file +var _0xfdb0=['DESC','../client','create','Request','CreateFaxQueueReport','update','UpdateFaxQueueReport'];(function(_0x39780c,_0x5782c9){var _0x53c19b=function(_0x594f01){while(--_0x594f01){_0x39780c['push'](_0x39780c['shift']());}};_0x53c19b(++_0x5782c9);}(_0xfdb0,0x10b));var _0x0fdb=function(_0x23f343,_0x193b4f){_0x23f343=_0x23f343-0x0;var _0x4927b4=_0xfdb0[_0x23f343];return _0x4927b4;};'use strict';var client=require(_0x0fdb('0x0'));exports[_0x0fdb('0x1')]=function(_0x15b675){return client[_0x0fdb('0x2')](_0x0fdb('0x3'),{'body':_0x15b675,'log':_0x0fdb('0x3')});};exports[_0x0fdb('0x4')]=function(_0x1c2592,_0x255f81){return client[_0x0fdb('0x2')](_0x0fdb('0x5'),{'body':_0x255f81,'options':{'where':{'uniqueid':_0x1c2592},'order':[['id',_0x0fdb('0x6')]],'limit':0x1},'log':'UpdateFaxQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 9b6813a..4ea03a8 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 _0x8cc8=['getIntervals','Request','GetInterval','name','Interval','Intervals','interval','../client'];(function(_0xce8519,_0x53bdf8){var _0x3c6ad5=function(_0x434743){while(--_0x434743){_0xce8519['push'](_0xce8519['shift']());}};_0x3c6ad5(++_0x53bdf8);}(_0x8cc8,0x177));var _0x88cc=function(_0x24377b,_0x31c48c){_0x24377b=_0x24377b-0x0;var _0x3f6f9b=_0x8cc8[_0x24377b];return _0x3f6f9b;};'use strict';var client=require(_0x88cc('0x0'));exports[_0x88cc('0x1')]=function(){return function(){return client[_0x88cc('0x2')](_0x88cc('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x88cc('0x4')],'include':[{'model':_0x88cc('0x5'),'as':_0x88cc('0x6'),'attributes':['id',_0x88cc('0x4'),_0x88cc('0x7')]}]},'log':_0x88cc('0x1')});};}; \ No newline at end of file +var _0xa7fa=['../client','GetInterval','name','Interval','Intervals','interval','getIntervals'];(function(_0x52b13a,_0x3733e6){var _0x22d30b=function(_0x9d944a){while(--_0x9d944a){_0x52b13a['push'](_0x52b13a['shift']());}};_0x22d30b(++_0x3733e6);}(_0xa7fa,0xfc));var _0xaa7f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa7fa[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0xaa7f('0x0'));exports['getIntervals']=function(){return function(){return client['Request'](_0xaa7f('0x1'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xaa7f('0x2')],'include':[{'model':_0xaa7f('0x3'),'as':_0xaa7f('0x4'),'attributes':['id','name',_0xaa7f('0x5')]}]},'log':_0xaa7f('0x6')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index a90eebd..a4ba9a8 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 _0xfb30=['UpdateMailInteraction','updateMailInteraction','addTags','AddTagsToMailInteraction','../client','Request'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xfb30,0x82));var _0x0fb3=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xfb30[_0xa464c9];return _0x3d73c4;};'use strict';var client=require(_0x0fb3('0x0'));exports['update']=function(_0x54d84f,_0x1f1d24){return client[_0x0fb3('0x1')](_0x0fb3('0x2'),{'body':_0x1f1d24,'options':{'where':{'id':_0x54d84f}},'log':_0x0fb3('0x3')});};exports[_0x0fb3('0x4')]=function(_0x100bbe,_0x1dd131){return client[_0x0fb3('0x1')](_0x0fb3('0x5'),{'body':_0x1dd131,'options':{'where':{'id':_0x100bbe}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x82ac=['UpdateMailInteraction','updateMailInteraction','addTags','AddTagsToMailInteraction','../client','update','Request'];(function(_0x310db6,_0x37055c){var _0x598379=function(_0x1747ea){while(--_0x1747ea){_0x310db6['push'](_0x310db6['shift']());}};_0x598379(++_0x37055c);}(_0x82ac,0xdd));var _0xc82a=function(_0x4f8994,_0x558a96){_0x4f8994=_0x4f8994-0x0;var _0x502e3f=_0x82ac[_0x4f8994];return _0x502e3f;};'use strict';var client=require(_0xc82a('0x0'));exports[_0xc82a('0x1')]=function(_0x12d0f8,_0x569773){return client[_0xc82a('0x2')](_0xc82a('0x3'),{'body':_0x569773,'options':{'where':{'id':_0x12d0f8}},'log':_0xc82a('0x4')});};exports[_0xc82a('0x5')]=function(_0x32adff,_0x381473){return client[_0xc82a('0x2')](_0xc82a('0x6'),{'body':_0x381473,'options':{'where':{'id':_0x32adff}},'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 cb2cfe8..c489fa1 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 _0xd6e9=['../client','create','Request','createMailMessage'];(function(_0x46e57e,_0x41b247){var _0x42579c=function(_0xc1b433){while(--_0xc1b433){_0x46e57e['push'](_0x46e57e['shift']());}};_0x42579c(++_0x41b247);}(_0xd6e9,0xb0));var _0x9d6e=function(_0x135020,_0x15b8cf){_0x135020=_0x135020-0x0;var _0xe824b4=_0xd6e9[_0x135020];return _0xe824b4;};'use strict';var client=require(_0x9d6e('0x0'));exports[_0x9d6e('0x1')]=function(_0x461882){return client[_0x9d6e('0x2')]('CreateMailMessage',{'body':_0x461882,'log':_0x9d6e('0x3')});}; \ No newline at end of file +var _0xf000=['createMailMessage','../client','create'];(function(_0x549cbc,_0x33645f){var _0x2fea2a=function(_0x4f2252){while(--_0x4f2252){_0x549cbc['push'](_0x549cbc['shift']());}};_0x2fea2a(++_0x33645f);}(_0xf000,0xc1));var _0x0f00=function(_0x342700,_0x569f75){_0x342700=_0x342700-0x0;var _0x53406f=_0xf000[_0x342700];return _0x53406f;};'use strict';var client=require(_0x0f00('0x0'));exports[_0x0f00('0x1')]=function(_0x4dbd6a){return client['Request']('CreateMailMessage',{'body':_0x4dbd6a,'log':_0x0f00('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 7e516f1..f3ab4ed 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 _0xe2fe=['online','../client','Request','GetMailQueue','name','timeout','strategy','User','Agents'];(function(_0x485469,_0x2a68a8){var _0x32a32e=function(_0x4bf0ee){while(--_0x4bf0ee){_0x485469['push'](_0x485469['shift']());}};_0x32a32e(++_0x2a68a8);}(_0xe2fe,0x14e));var _0xee2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe2fe[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0xee2f('0x0'));exports['getMailQueues']=function(){return function(){return client[_0xee2f('0x1')](_0xee2f('0x2'),{'options':{'raw':![],'attributes':['id',_0xee2f('0x3'),_0xee2f('0x4'),_0xee2f('0x5')],'include':[{'model':_0xee2f('0x6'),'as':_0xee2f('0x7'),'attributes':['id','name',_0xee2f('0x8'),'mailPause']}]},'log':'getMailQueues'});};}; \ No newline at end of file +var _0xd2db=['Request','GetMailQueue','name','timeout','strategy','User','Agents','online','mailPause','getMailQueues'];(function(_0x4adeab,_0x3a5189){var _0x1a6e36=function(_0x1e3840){while(--_0x1e3840){_0x4adeab['push'](_0x4adeab['shift']());}};_0x1a6e36(++_0x3a5189);}(_0xd2db,0x8c));var _0xbd2d=function(_0x282ebd,_0xc3baad){_0x282ebd=_0x282ebd-0x0;var _0x4dc079=_0xd2db[_0x282ebd];return _0x4dc079;};'use strict';var client=require('../client');exports['getMailQueues']=function(){return function(){return client[_0xbd2d('0x0')](_0xbd2d('0x1'),{'options':{'raw':![],'attributes':['id',_0xbd2d('0x2'),_0xbd2d('0x3'),_0xbd2d('0x4')],'include':[{'model':_0xbd2d('0x5'),'as':_0xbd2d('0x6'),'attributes':['id',_0xbd2d('0x2'),_0xbd2d('0x7'),_0xbd2d('0x8')]}]},'log':_0xbd2d('0x9')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index f4bbaac..3fa6408 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 _0x6a4a=['CreateMailQueueReport','update','../client','create','Request'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6a4a,0xb1));var _0xa6a4=function(_0x3cb30b,_0x504b3e){_0x3cb30b=_0x3cb30b-0x0;var _0x2ca717=_0x6a4a[_0x3cb30b];return _0x2ca717;};'use strict';var client=require(_0xa6a4('0x0'));exports[_0xa6a4('0x1')]=function(_0x214ac1){return client[_0xa6a4('0x2')](_0xa6a4('0x3'),{'body':_0x214ac1,'log':'CreateMailQueueReport'});};exports[_0xa6a4('0x4')]=function(_0x4498a8,_0x572dd1){return client[_0xa6a4('0x2')]('UpdateMailQueueReport',{'body':_0x572dd1,'options':{'where':{'uniqueid':_0x4498a8},'order':[['id','DESC']],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file +var _0x5546=['UpdateMailQueueReport','create','Request','CreateMailQueueReport','update'];(function(_0x57eccb,_0x136b18){var _0x1c1c22=function(_0x35cfa3){while(--_0x35cfa3){_0x57eccb['push'](_0x57eccb['shift']());}};_0x1c1c22(++_0x136b18);}(_0x5546,0x123));var _0x6554=function(_0xfce88c,_0x5d7dee){_0xfce88c=_0xfce88c-0x0;var _0x382bc9=_0x5546[_0xfce88c];return _0x382bc9;};'use strict';var client=require('../client');exports[_0x6554('0x0')]=function(_0x1bb6af){return client[_0x6554('0x1')](_0x6554('0x2'),{'body':_0x1bb6af,'log':_0x6554('0x2')});};exports[_0x6554('0x3')]=function(_0x472ac8,_0x112e7d){return client[_0x6554('0x1')](_0x6554('0x4'),{'body':_0x112e7d,'options':{'where':{'uniqueid':_0x472ac8},'order':[['id','DESC']],'limit':0x1},'log':_0x6554('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 6c0cc98..eea15ee 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 _0x941e=['../client','update','updateOpenchannelInteraction','Request','AddTagsToOpenchannelInteraction','addTagsToChatInteraction'];(function(_0x2cea96,_0x519b2f){var _0x362c99=function(_0x375b84){while(--_0x375b84){_0x2cea96['push'](_0x2cea96['shift']());}};_0x362c99(++_0x519b2f);}(_0x941e,0x1bc));var _0xe941=function(_0x4ce72d,_0x596fc4){_0x4ce72d=_0x4ce72d-0x0;var _0x445193=_0x941e[_0x4ce72d];return _0x445193;};'use strict';var client=require(_0xe941('0x0'));exports[_0xe941('0x1')]=function(_0xc27d59,_0xcf3b33){return client['Request']('UpdateOpenchannelInteraction',{'body':_0xcf3b33,'options':{'where':{'id':_0xc27d59}},'log':_0xe941('0x2')});};exports['addTags']=function(_0x4a252c,_0x447cbb){return client[_0xe941('0x3')](_0xe941('0x4'),{'body':_0x447cbb,'options':{'where':{'id':_0x4a252c}},'log':_0xe941('0x5')});}; \ No newline at end of file +var _0x6faf=['AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','Request','UpdateOpenchannelInteraction','addTags'];(function(_0x1b791f,_0x520b80){var _0x70c73b=function(_0x5c2f73){while(--_0x5c2f73){_0x1b791f['push'](_0x1b791f['shift']());}};_0x70c73b(++_0x520b80);}(_0x6faf,0xc2));var _0xf6fa=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6faf[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0xf6fa('0x0'));exports['update']=function(_0x246c2b,_0x32f927){return client[_0xf6fa('0x1')](_0xf6fa('0x2'),{'body':_0x32f927,'options':{'where':{'id':_0x246c2b}},'log':'updateOpenchannelInteraction'});};exports[_0xf6fa('0x3')]=function(_0x2f04e4,_0x34c041){return client[_0xf6fa('0x1')](_0xf6fa('0x4'),{'body':_0x34c041,'options':{'where':{'id':_0x2f04e4}},'log':_0xf6fa('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index a755b85..74537df 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 _0x750a=['CreateOpenchannelMessage','createOpenchannelMessage','create'];(function(_0x5e5658,_0x5ceb37){var _0x501ff8=function(_0x359ef1){while(--_0x359ef1){_0x5e5658['push'](_0x5e5658['shift']());}};_0x501ff8(++_0x5ceb37);}(_0x750a,0x140));var _0xa750=function(_0x59d51e,_0x5c9ea4){_0x59d51e=_0x59d51e-0x0;var _0x21b917=_0x750a[_0x59d51e];return _0x21b917;};'use strict';var client=require('../client');exports[_0xa750('0x0')]=function(_0x5368b2){return client['Request'](_0xa750('0x1'),{'body':_0x5368b2,'log':_0xa750('0x2')});}; \ No newline at end of file +var _0x91a7=['create','Request','createOpenchannelMessage'];(function(_0x367878,_0x3facd7){var _0x379cbc=function(_0x13fe23){while(--_0x13fe23){_0x367878['push'](_0x367878['shift']());}};_0x379cbc(++_0x3facd7);}(_0x91a7,0xe7));var _0x791a=function(_0xba7279,_0x47dc0d){_0xba7279=_0xba7279-0x0;var _0x10a735=_0x91a7[_0xba7279];return _0x10a735;};'use strict';var client=require('../client');exports[_0x791a('0x0')]=function(_0x3d6eab){return client[_0x791a('0x1')]('CreateOpenchannelMessage',{'body':_0x3d6eab,'log':_0x791a('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index efa5697..3333bf4 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 _0x9407=['Agents','online','getOpenchannelQueues','Request','GetOpenchannelQueue','name','strategy','User'];(function(_0x26c0cc,_0x4630bb){var _0x5e9332=function(_0x40b0ed){while(--_0x40b0ed){_0x26c0cc['push'](_0x26c0cc['shift']());}};_0x5e9332(++_0x4630bb);}(_0x9407,0xa2));var _0x7940=function(_0x2cf29c,_0x54ef6a){_0x2cf29c=_0x2cf29c-0x0;var _0x4dc72e=_0x9407[_0x2cf29c];return _0x4dc72e;};'use strict';var client=require('../client');exports[_0x7940('0x0')]=function(){return function(){return client[_0x7940('0x1')](_0x7940('0x2'),{'options':{'raw':![],'attributes':['id',_0x7940('0x3'),'timeout',_0x7940('0x4')],'include':[{'model':_0x7940('0x5'),'as':_0x7940('0x6'),'attributes':['id','name',_0x7940('0x7'),'openchannelPause']}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file +var _0xce55=['strategy','Agents','online','getOpenchannelQueues','../client','Request','GetOpenchannelQueue','name'];(function(_0x1edeab,_0x44b3d6){var _0x1577ab=function(_0x12964e){while(--_0x12964e){_0x1edeab['push'](_0x1edeab['shift']());}};_0x1577ab(++_0x44b3d6);}(_0xce55,0xe4));var _0x5ce5=function(_0x586e64,_0x4e6f01){_0x586e64=_0x586e64-0x0;var _0x3e237c=_0xce55[_0x586e64];return _0x3e237c;};'use strict';var client=require(_0x5ce5('0x0'));exports['getOpenchannelQueues']=function(){return function(){return client[_0x5ce5('0x1')](_0x5ce5('0x2'),{'options':{'raw':![],'attributes':['id',_0x5ce5('0x3'),'timeout',_0x5ce5('0x4')],'include':[{'model':'User','as':_0x5ce5('0x5'),'attributes':['id','name',_0x5ce5('0x6'),'openchannelPause']}]},'log':_0x5ce5('0x7')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index ba7ae8e..9301942 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 _0x03e5=['UpdateOpenchannelQueueReport','../client','create','CreateOpenchannelQueueReport','update'];(function(_0x4246fb,_0x49d59f){var _0x25f8ac=function(_0x10f570){while(--_0x10f570){_0x4246fb['push'](_0x4246fb['shift']());}};_0x25f8ac(++_0x49d59f);}(_0x03e5,0x1f0));var _0x503e=function(_0x2fab18,_0xc077a2){_0x2fab18=_0x2fab18-0x0;var _0x5a0eab=_0x03e5[_0x2fab18];return _0x5a0eab;};'use strict';var client=require(_0x503e('0x0'));exports[_0x503e('0x1')]=function(_0x2468d3){return client['Request'](_0x503e('0x2'),{'body':_0x2468d3,'log':'CreateOpenchannelQueueReport'});};exports[_0x503e('0x3')]=function(_0x154063,_0x55cbae){return client['Request']('UpdateOpenchannelQueueReport',{'body':_0x55cbae,'options':{'where':{'uniqueid':_0x154063},'order':[['id','DESC']],'limit':0x1},'log':_0x503e('0x4')});}; \ No newline at end of file +var _0x5fe5=['UpdateOpenchannelQueueReport','DESC','Request','CreateOpenchannelQueueReport','update'];(function(_0x43450f,_0x109af9){var _0x496603=function(_0x215f06){while(--_0x215f06){_0x43450f['push'](_0x43450f['shift']());}};_0x496603(++_0x109af9);}(_0x5fe5,0x16f));var _0x55fe=function(_0x1075b8,_0xd606e2){_0x1075b8=_0x1075b8-0x0;var _0x5d047f=_0x5fe5[_0x1075b8];return _0x5d047f;};'use strict';var client=require('../client');exports['create']=function(_0x48310a){return client[_0x55fe('0x0')](_0x55fe('0x1'),{'body':_0x48310a,'log':_0x55fe('0x1')});};exports[_0x55fe('0x2')]=function(_0x17143c,_0x35e9e1){return client[_0x55fe('0x0')](_0x55fe('0x3'),{'body':_0x35e9e1,'options':{'where':{'uniqueid':_0x17143c},'order':[['id',_0x55fe('0x4')]],'limit':0x1},'log':_0x55fe('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index c494b57..f0680d6 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 _0xf25a=['Request','updateSmsInteraction','addTags','AddTagsToSmsInteraction','../client','update'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0xf25a,0xac));var _0xaf25=function(_0x3742e6,_0x52e31c){_0x3742e6=_0x3742e6-0x0;var _0x46a0c0=_0xf25a[_0x3742e6];return _0x46a0c0;};'use strict';var client=require(_0xaf25('0x0'));exports[_0xaf25('0x1')]=function(_0x4288e4,_0x44ca39){return client[_0xaf25('0x2')]('UpdateSmsInteraction',{'body':_0x44ca39,'options':{'where':{'id':_0x4288e4}},'log':_0xaf25('0x3')});};exports[_0xaf25('0x4')]=function(_0x5ce8ab,_0x4e585b){return client[_0xaf25('0x2')](_0xaf25('0x5'),{'body':_0x4e585b,'options':{'where':{'id':_0x5ce8ab}},'log':'addTagsToSmsInteraction'});}; \ No newline at end of file +var _0x1b23=['Request','UpdateSmsInteraction','updateSmsInteraction','addTags','addTagsToSmsInteraction','../client','update'];(function(_0x508072,_0x4083c1){var _0x359b2e=function(_0x11d4de){while(--_0x11d4de){_0x508072['push'](_0x508072['shift']());}};_0x359b2e(++_0x4083c1);}(_0x1b23,0x1e1));var _0x31b2=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x1b23[_0xa464c9];return _0x3d73c4;};'use strict';var client=require(_0x31b2('0x0'));exports[_0x31b2('0x1')]=function(_0x3ae09d,_0x32ef6b){return client[_0x31b2('0x2')](_0x31b2('0x3'),{'body':_0x32ef6b,'options':{'where':{'id':_0x3ae09d}},'log':_0x31b2('0x4')});};exports[_0x31b2('0x5')]=function(_0x57ab96,_0x3e2955){return client[_0x31b2('0x2')]('AddTagsToSmsInteraction',{'body':_0x3e2955,'options':{'where':{'id':_0x57ab96}},'log':_0x31b2('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index f3137a0..b2cfada 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 _0xdccc=['../client','Request','createSmsMessage'];(function(_0x372019,_0x403f61){var _0x4e4046=function(_0x2940b3){while(--_0x2940b3){_0x372019['push'](_0x372019['shift']());}};_0x4e4046(++_0x403f61);}(_0xdccc,0x144));var _0xcdcc=function(_0x44218f,_0x563362){_0x44218f=_0x44218f-0x0;var _0x405267=_0xdccc[_0x44218f];return _0x405267;};'use strict';var client=require(_0xcdcc('0x0'));exports['create']=function(_0x29cf67){return client[_0xcdcc('0x1')]('CreateSmsMessage',{'body':_0x29cf67,'log':_0xcdcc('0x2')});}; \ No newline at end of file +var _0x6ac3=['create','CreateSmsMessage','createSmsMessage'];(function(_0x1d18ce,_0x4c1e33){var _0x780d41=function(_0x17cfb7){while(--_0x17cfb7){_0x1d18ce['push'](_0x1d18ce['shift']());}};_0x780d41(++_0x4c1e33);}(_0x6ac3,0x153));var _0x36ac=function(_0x3ffef2,_0xef6b52){_0x3ffef2=_0x3ffef2-0x0;var _0x287601=_0x6ac3[_0x3ffef2];return _0x287601;};'use strict';var client=require('../client');exports[_0x36ac('0x0')]=function(_0x1f9c86){return client['Request'](_0x36ac('0x1'),{'body':_0x1f9c86,'log':_0x36ac('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index e48bd28..87aa609 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 _0x651e=['Request','timeout','strategy','User','name','online','smsPause','../client','getSmsQueues'];(function(_0x220275,_0x2a699d){var _0x32d8d0=function(_0x40c3e3){while(--_0x40c3e3){_0x220275['push'](_0x220275['shift']());}};_0x32d8d0(++_0x2a699d);}(_0x651e,0x15d));var _0xe651=function(_0x4670f4,_0x2585de){_0x4670f4=_0x4670f4-0x0;var _0x5be670=_0x651e[_0x4670f4];return _0x5be670;};'use strict';var client=require(_0xe651('0x0'));exports[_0xe651('0x1')]=function(){return function(){return client[_0xe651('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0xe651('0x3'),_0xe651('0x4')],'include':[{'model':_0xe651('0x5'),'as':'Agents','attributes':['id',_0xe651('0x6'),_0xe651('0x7'),_0xe651('0x8')]}]},'log':_0xe651('0x1')});};}; \ No newline at end of file +var _0xbd6d=['getSmsQueues','Request','GetSmsQueue','name','strategy','User','Agents','online','../client'];(function(_0x1c1bbb,_0x38a0b8){var _0x2e667c=function(_0x154180){while(--_0x154180){_0x1c1bbb['push'](_0x1c1bbb['shift']());}};_0x2e667c(++_0x38a0b8);}(_0xbd6d,0xc5));var _0xdbd6=function(_0x32c649,_0x4401e0){_0x32c649=_0x32c649-0x0;var _0x440a0a=_0xbd6d[_0x32c649];return _0x440a0a;};'use strict';var client=require(_0xdbd6('0x0'));exports[_0xdbd6('0x1')]=function(){return function(){return client[_0xdbd6('0x2')](_0xdbd6('0x3'),{'options':{'raw':![],'attributes':['id',_0xdbd6('0x4'),'timeout',_0xdbd6('0x5')],'include':[{'model':_0xdbd6('0x6'),'as':_0xdbd6('0x7'),'attributes':['id',_0xdbd6('0x4'),_0xdbd6('0x8'),'smsPause']}]},'log':'getSmsQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index a3cc28b..567390f 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 _0x53eb=['update','Request','UpdateSmsQueueReport','DESC','../client','create','CreateSmsQueueReport'];(function(_0x5802d8,_0x17191b){var _0x1b5bf0=function(_0x251d02){while(--_0x251d02){_0x5802d8['push'](_0x5802d8['shift']());}};_0x1b5bf0(++_0x17191b);}(_0x53eb,0x115));var _0xb53e=function(_0x42d0f0,_0x40ce8e){_0x42d0f0=_0x42d0f0-0x0;var _0x17d19d=_0x53eb[_0x42d0f0];return _0x17d19d;};'use strict';var client=require(_0xb53e('0x0'));exports[_0xb53e('0x1')]=function(_0x598fe6){return client['Request'](_0xb53e('0x2'),{'body':_0x598fe6,'log':'CreateSmsQueueReport'});};exports[_0xb53e('0x3')]=function(_0x176b0,_0x4ffb02){return client[_0xb53e('0x4')](_0xb53e('0x5'),{'body':_0x4ffb02,'options':{'where':{'uniqueid':_0x176b0},'order':[['id',_0xb53e('0x6')]],'limit':0x1},'log':'UpdateSmsQueueReport'});}; \ No newline at end of file +var _0x1a21=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','../client'];(function(_0x4d8965,_0x5852df){var _0x2b69ef=function(_0x134a70){while(--_0x134a70){_0x4d8965['push'](_0x4d8965['shift']());}};_0x2b69ef(++_0x5852df);}(_0x1a21,0x1d9));var _0x11a2=function(_0x1f44e4,_0x22d9fd){_0x1f44e4=_0x1f44e4-0x0;var _0x591989=_0x1a21[_0x1f44e4];return _0x591989;};'use strict';var client=require(_0x11a2('0x0'));exports[_0x11a2('0x1')]=function(_0x3df01b){return client[_0x11a2('0x2')](_0x11a2('0x3'),{'body':_0x3df01b,'log':_0x11a2('0x3')});};exports[_0x11a2('0x4')]=function(_0x137d9f,_0x784c38){return client[_0x11a2('0x2')](_0x11a2('0x5'),{'body':_0x784c38,'options':{'where':{'uniqueid':_0x137d9f},'order':[['id','DESC']],'limit':0x1},'log':_0x11a2('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index b9a8511..11ccfbc 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 _0x9bdb=['getAgents','Request','GetUser','name','online','pauseType','voicePause','chatPause','mailPause','smsPause','openchannelPause','smsCapacity'];(function(_0x3e1da9,_0x510b98){var _0x12a58d=function(_0x1c2b64){while(--_0x1c2b64){_0x3e1da9['push'](_0x3e1da9['shift']());}};_0x12a58d(++_0x510b98);}(_0x9bdb,0xe4));var _0xb9bd=function(_0x25bb23,_0x112ebe){_0x25bb23=_0x25bb23-0x0;var _0x176297=_0x9bdb[_0x25bb23];return _0x176297;};'use strict';var client=require('../client');exports[_0xb9bd('0x0')]=function(){return function(){return client[_0xb9bd('0x1')](_0xb9bd('0x2'),{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id',_0xb9bd('0x3'),_0xb9bd('0x4'),_0xb9bd('0x5'),'lastPauseAt',_0xb9bd('0x6'),_0xb9bd('0x7'),_0xb9bd('0x8'),'faxPause',_0xb9bd('0x9'),_0xb9bd('0xa'),'chatCapacity','mailCapacity','faxCapacity',_0xb9bd('0xb'),'openchannelCapacity']},'log':_0xb9bd('0x0')});};}; \ No newline at end of file +var _0x82ca=['mailCapacity','faxCapacity','openchannelCapacity','../client','getAgents','agent','name','online','lastPauseAt','voicePause','chatPause','mailPause'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0x82ca,0x13b));var _0xa82c=function(_0x43776a,_0x4eb74c){_0x43776a=_0x43776a-0x0;var _0x18eb8f=_0x82ca[_0x43776a];return _0x18eb8f;};'use strict';var client=require(_0xa82c('0x0'));exports[_0xa82c('0x1')]=function(){return function(){return client['Request']('GetUser',{'options':{'raw':!![],'where':{'role':_0xa82c('0x2')},'attributes':['id',_0xa82c('0x3'),_0xa82c('0x4'),'pauseType',_0xa82c('0x5'),_0xa82c('0x6'),_0xa82c('0x7'),_0xa82c('0x8'),'faxPause','smsPause','openchannelPause','chatCapacity',_0xa82c('0x9'),_0xa82c('0xa'),'smsCapacity',_0xa82c('0xb')]},'log':_0xa82c('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index b9d04b8..fa49645 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 _0xeead=['stop','[%s][AGENT]\x20ROUTING\x20END','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','routing','./strategy','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','map','message','join','agents','timeout','createQueue','atimeout','channel','format','START:%s','rules','end','close'];(function(_0x1abae8,_0x5a3cf9){var _0x14af4a=function(_0x1508d5){while(--_0x1508d5){_0x1abae8['push'](_0x1abae8['shift']());}};_0x14af4a(++_0x5a3cf9);}(_0xeead,0x103));var _0xdeea=function(_0x56727f,_0x164838){_0x56727f=_0x56727f-0x0;var _0x1b2d48=_0xeead[_0x56727f];return _0x1b2d48;};'use strict';var schema=require(_0xdeea('0x0'));var _=require(_0xdeea('0x1'));var util=require(_0xdeea('0x2'));var seqqueue=require(_0xdeea('0x3'));var logger=require('../../../../config/logger')(_0xdeea('0x4'));var strategy=require(_0xdeea('0x5'));var queue=schema({'name':{'type':'string','required':!![],'message':_0xdeea('0x6')},'timeout':{'type':_0xdeea('0x7'),'message':_0xdeea('0x8')}});function writeLog(_0x2fbe43,_0xd66698,_0x485d0c){return logger[_0xdeea('0x9')](util['format']('[%s][AGENT][NAME:%s][STATUS:%s]',_0x2fbe43,_0xd66698[_0xdeea('0xa')],_0x485d0c));}function handleFindAgent(_0x1adbc3){return function(_0x3bf2ba){return _0x3bf2ba[_0xdeea('0xa')][_0xdeea('0xb')]()===_0x1adbc3[_0xdeea('0xb')]();};}exports[_0xdeea('0xc')]=function(_0x55d315,_0x19bcef,_0x208579,_0x37b53f){return function(_0x5c5816){try{var _0x2c2e93={'name':_0x19bcef[0x0],'timeout':_0x19bcef[0x1]};var _0x50e6fb=queue[_0xdeea('0x0')](_0x2c2e93,{'typecast':!![]});if(_0x50e6fb[_0xdeea('0xd')]){logger[_0xdeea('0xe')](_0xdeea('0xf'),_0x55d315,_[_0xdeea('0x10')](_0x50e6fb,_0xdeea('0x11'))[_0xdeea('0x12')](',\x20'));_0x5c5816['stop']();}else{var _0x397008=_['find'](_0x208579[_0xdeea('0x13')],handleFindAgent(_0x2c2e93[_0xdeea('0xa')]));if(_0x397008){var _0x31d9e2=(_0x2c2e93[_0xdeea('0x14')]||0xa)*0x3e8;var _0x36f55f,_0x12b535;var _0x29a2ca=seqqueue[_0xdeea('0x15')](_0x31d9e2);_0x29a2ca['id']=_0x55d315;_0x29a2ca[_0xdeea('0x16')]=_0x31d9e2;_0x29a2ca['channel']=_0x37b53f[_0xdeea('0x17')];writeLog(_0x55d315,_0x397008,util[_0xdeea('0x18')](_0xdeea('0x19'),_0x31d9e2));_0x208579[_0xdeea('0x1a')][_0x55d315]['on'](_0xdeea('0x1b'),function(){_0x29a2ca[_0xdeea('0x1c')]();clearTimeout(_0x12b535);_0x12b535=undefined;if(_0x208579[_0xdeea('0x1a')][_0x55d315]){delete _0x208579[_0xdeea('0x1a')][_0x55d315];}logger['info']('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x55d315);_0x5c5816[_0xdeea('0x1d')]();});_0x12b535=setTimeout(function(){clearTimeout(_0x12b535);_0x29a2ca[_0xdeea('0x1c')]();logger[_0xdeea('0x9')](_0xdeea('0x1e'),_0x55d315);_0x5c5816['next']();},_0x31d9e2);strategy[_0xdeea('0x1f')](_0x29a2ca,_0x397008,_0x208579,_0x37b53f);}else{logger[_0xdeea('0xe')](_0xdeea('0x20'),_0x55d315,_0x2c2e93[_0xdeea('0xa')]);_0x5c5816['stop']();}}}catch(_0x46fac2){console[_0xdeea('0x21')](_0x46fac2);logger[_0xdeea('0xe')](_0xdeea('0x22'),_0x55d315,_0x46fac2[_0xdeea('0x23')]);_0x5c5816[_0xdeea('0x1d')]();}};}; \ No newline at end of file +var _0xfe47=['number','timeout\x20is\x20a\x20number','info','[%s][AGENT][NAME:%s][STATUS:%s]','toLowerCase','consequence','length','error','map','message','join','stop','agents','name','timeout','atimeout','channel','format','START:%s','rules','end','close','[%s][AGENT]\x20ROUTING\x20END','next','agent','log','[%s][QUEUE]\x20%s','stack','lodash','util','seq-queue','routing','./strategy'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xfe47,0x103));var _0x7fe4=function(_0x14caf6,_0x23de34){_0x14caf6=_0x14caf6-0x0;var _0x3b0248=_0xfe47[_0x14caf6];return _0x3b0248;};'use strict';var schema=require('validate');var _=require(_0x7fe4('0x0'));var util=require(_0x7fe4('0x1'));var seqqueue=require(_0x7fe4('0x2'));var logger=require('../../../../config/logger')(_0x7fe4('0x3'));var strategy=require(_0x7fe4('0x4'));var queue=schema({'name':{'type':'string','required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x7fe4('0x5'),'message':_0x7fe4('0x6')}});function writeLog(_0x1ac384,_0x471fd6,_0x38aede){return logger[_0x7fe4('0x7')](util['format'](_0x7fe4('0x8'),_0x1ac384,_0x471fd6['name'],_0x38aede));}function handleFindAgent(_0x2809db){return function(_0x2e38bf){return _0x2e38bf['name'][_0x7fe4('0x9')]()===_0x2809db[_0x7fe4('0x9')]();};}exports[_0x7fe4('0xa')]=function(_0x108a20,_0x5cad38,_0x14f4fd,_0x1918c0){return function(_0x339f9b){try{var _0x4ff13c={'name':_0x5cad38[0x0],'timeout':_0x5cad38[0x1]};var _0x48b80c=queue['validate'](_0x4ff13c,{'typecast':!![]});if(_0x48b80c[_0x7fe4('0xb')]){logger[_0x7fe4('0xc')]('[%s][AGENT]\x20%s',_0x108a20,_[_0x7fe4('0xd')](_0x48b80c,_0x7fe4('0xe'))[_0x7fe4('0xf')](',\x20'));_0x339f9b[_0x7fe4('0x10')]();}else{var _0x1be062=_['find'](_0x14f4fd[_0x7fe4('0x11')],handleFindAgent(_0x4ff13c[_0x7fe4('0x12')]));if(_0x1be062){var _0x5e4e2d=(_0x4ff13c[_0x7fe4('0x13')]||0xa)*0x3e8;var _0x147e50,_0x4d521d;var _0x18fbda=seqqueue['createQueue'](_0x5e4e2d);_0x18fbda['id']=_0x108a20;_0x18fbda[_0x7fe4('0x14')]=_0x5e4e2d;_0x18fbda['channel']=_0x1918c0[_0x7fe4('0x15')];writeLog(_0x108a20,_0x1be062,util[_0x7fe4('0x16')](_0x7fe4('0x17'),_0x5e4e2d));_0x14f4fd[_0x7fe4('0x18')][_0x108a20]['on'](_0x7fe4('0x19'),function(){_0x18fbda['close']();clearTimeout(_0x4d521d);_0x4d521d=undefined;if(_0x14f4fd[_0x7fe4('0x18')][_0x108a20]){delete _0x14f4fd[_0x7fe4('0x18')][_0x108a20];}logger[_0x7fe4('0x7')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x108a20);_0x339f9b['stop']();});_0x4d521d=setTimeout(function(){clearTimeout(_0x4d521d);_0x18fbda[_0x7fe4('0x1a')]();logger['info'](_0x7fe4('0x1b'),_0x108a20);_0x339f9b[_0x7fe4('0x1c')]();},_0x5e4e2d);strategy[_0x7fe4('0x1d')](_0x18fbda,_0x1be062,_0x14f4fd,_0x1918c0);}else{logger['error']('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x108a20,_0x4ff13c['name']);_0x339f9b[_0x7fe4('0x10')]();}}}catch(_0x40fd3f){console[_0x7fe4('0x1e')](_0x40fd3f);logger[_0x7fe4('0xc')](_0x7fe4('0x1f'),_0x108a20,_0x40fd3f[_0x7fe4('0x20')]);_0x339f9b[_0x7fe4('0x10')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/amazonlex.js b/server/services/routing/server/applications/amazonlex.js index 19cec99..92d6f5e 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 _0x7233=['upperFirst','InteractionId','created','isEmpty','body','Message','then','catch','error','stringify','finally','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','toString','message','amazonlex','create','moment','./utils','../../../../config/logger','../../rpc/mailMessage','../../rpc/smsMessage','consequence','interaction','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','chat','ChatWebsiteId','account','AccountId'];(function(_0xaf52f9,_0x3608bc){var _0xd9e03e=function(_0xaf82d3){while(--_0xaf82d3){_0xaf52f9['push'](_0xaf52f9['shift']());}};_0xd9e03e(++_0x3608bc);}(_0x7233,0x142));var _0x3723=function(_0x5135e1,_0x28957a){_0x5135e1=_0x5135e1-0x0;var _0x541326=_0x7233[_0x5135e1];return _0x541326;};'use strict';var _=require('lodash');var moment=require(_0x3723('0x0'));var AWS=require('aws-sdk');var utils=require(_0x3723('0x1'));var logger=require(_0x3723('0x2'))('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x3723('0x3')),'smsMessage':require(_0x3723('0x4')),'faxMessage':require('../../rpc/faxMessage')};exports[_0x3723('0x5')]=function(_0x20825f,_0x54b5dd){return function(_0x33c094){try{if(!_['isNil'](this[_0x3723('0x6')]['UserId'])){logger[_0x3723('0x7')](_0x3723('0x8'),_0x20825f,_0x3723('0x9'));return _0x33c094[_0x3723('0xa')]();}var _0x47fd9b={'ContactId':this[_0x3723('0xb')]['id'],'sentAt':moment()[_0x3723('0xc')](_0x3723('0xd')),'direction':_0x3723('0xe')};var _0x36df92=this[_0x3723('0xf')];if(_0x36df92===_0x3723('0x10')){_0x47fd9b[_0x3723('0x11')]=this[_0x3723('0x12')]['id'];}else{_0x47fd9b[_['upperFirst'](_0x36df92)+_0x3723('0x13')]=this[_0x3723('0x12')]['id'];}_0x47fd9b[_[_0x3723('0x14')](_0x36df92)+_0x3723('0x15')]=this[_0x3723('0x6')]['id'];if(this[_0x3723('0x6')][_0x3723('0x16')]){var _0x4d3558=_0x54b5dd[0x4];if(!_[_0x3723('0x17')](_0x4d3558)){_0x47fd9b[_0x3723('0x18')]=utils['getMustacheRender'](_0x4d3558,this);return rpc[_0x36df92+_0x3723('0x19')]['create'](_0x47fd9b)[_0x3723('0x1a')](function(_0x45adfe){logger['info']('[%s][AMAZONLEX]\x20%s',_0x20825f,_0x47fd9b[_0x3723('0x18')]);})[_0x3723('0x1b')](function(_0x279620){logger[_0x3723('0x1c')](_0x3723('0x8'),_0x20825f,JSON[_0x3723('0x1d')](_0x279620));})[_0x3723('0x1e')](function(){logger[_0x3723('0x7')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x20825f);_0x33c094[_0x3723('0x1f')]();});}else{logger[_0x3723('0x7')](_0x3723('0x20'),_0x20825f);_0x33c094[_0x3723('0x1f')]();}}else{var _0x542a38=this;var _0x5ef84=new AWS[(_0x3723('0x21'))]({'accessKeyId':_0x54b5dd[0x0],'secretAccessKey':_0x54b5dd[0x1],'region':_0x54b5dd[0x2]});var _0x43ed7f={'botAlias':'$LATEST','botName':_0x54b5dd[0x3],'inputText':this['message'][_0x3723('0x18')],'userId':this[_0x3723('0x6')]['id'][_0x3723('0x22')]()};_0x5ef84['postText'](_0x43ed7f,function(_0x2822cd,_0x3a3793){if(_0x2822cd){logger['error']('[%s][AMAZONLEX]\x20%s',_0x20825f,_0x2822cd[_0x3723('0x23')]);_0x33c094[_0x3723('0xa')]();}else if(_0x3a3793&&_0x3a3793['message']){_0x542a38[_0x3723('0x18')][_0x3723('0x24')]=_0x3a3793;_0x47fd9b[_0x3723('0x18')]=_0x3a3793[_0x3723('0x23')];return rpc[_0x36df92+_0x3723('0x19')][_0x3723('0x25')](_0x47fd9b)['then'](function(_0x57c81c){logger[_0x3723('0x7')](_0x3723('0x8'),_0x20825f,_0x47fd9b[_0x3723('0x18')]);if(_0x3a3793['dialogState']=='Failed'){_0x33c094[_0x3723('0xa')]();}else{_0x33c094['stop']();}})[_0x3723('0x1b')](function(_0x4fc5d9){logger[_0x3723('0x1c')]('[%s][AMAZONLEX]\x20%s',_0x20825f,JSON['stringify'](_0x4fc5d9));_0x33c094[_0x3723('0xa')]();});}else{_0x33c094[_0x3723('0xa')]();}});}}catch(_0x1c7521){logger[_0x3723('0x1c')]('[%s][AMAZONLEX]\x20%s',_0x20825f,JSON[_0x3723('0x1d')](_0x1c7521));_0x33c094[_0x3723('0x1f')]();}};}; \ No newline at end of file +var _0xacda=['dialogState','Failed','catch','lodash','moment','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','out','channel','chat','ChatWebsiteId','AccountId','created','isEmpty','body','getMustacheRender','Message','create','then','error','stringify','stop','LexRuntime','postText','next','amazonlex'];(function(_0x173dbb,_0x43ccba){var _0x2cc702=function(_0x806945){while(--_0x806945){_0x173dbb['push'](_0x173dbb['shift']());}};_0x2cc702(++_0x43ccba);}(_0xacda,0x7e));var _0xaacd=function(_0x13ae66,_0x1d4205){_0x13ae66=_0x13ae66-0x0;var _0x279359=_0xacda[_0x13ae66];return _0x279359;};'use strict';var _=require(_0xaacd('0x0'));var moment=require(_0xaacd('0x1'));var AWS=require(_0xaacd('0x2'));var utils=require(_0xaacd('0x3'));var logger=require(_0xaacd('0x4'))(_0xaacd('0x5'));var rpc={'chatMessage':require(_0xaacd('0x6')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xaacd('0x7')),'smsMessage':require(_0xaacd('0x8')),'faxMessage':require(_0xaacd('0x9'))};exports[_0xaacd('0xa')]=function(_0x27ee1c,_0x41a5ab){return function(_0x49fc6d){try{if(!_[_0xaacd('0xb')](this[_0xaacd('0xc')][_0xaacd('0xd')])){logger[_0xaacd('0xe')](_0xaacd('0xf'),_0x27ee1c,_0xaacd('0x10'));return _0x49fc6d['next']();}var _0x495088={'ContactId':this[_0xaacd('0x11')]['id'],'sentAt':moment()[_0xaacd('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xaacd('0x13')};var _0x4c6efc=this[_0xaacd('0x14')];if(_0x4c6efc===_0xaacd('0x15')){_0x495088[_0xaacd('0x16')]=this['account']['id'];}else{_0x495088[_['upperFirst'](_0x4c6efc)+_0xaacd('0x17')]=this['account']['id'];}_0x495088[_['upperFirst'](_0x4c6efc)+'InteractionId']=this[_0xaacd('0xc')]['id'];if(this[_0xaacd('0xc')][_0xaacd('0x18')]){var _0x44030f=_0x41a5ab[0x4];if(!_[_0xaacd('0x19')](_0x44030f)){_0x495088[_0xaacd('0x1a')]=utils[_0xaacd('0x1b')](_0x44030f,this);return rpc[_0x4c6efc+_0xaacd('0x1c')][_0xaacd('0x1d')](_0x495088)[_0xaacd('0x1e')](function(_0x56b7c0){logger[_0xaacd('0xe')](_0xaacd('0xf'),_0x27ee1c,_0x495088[_0xaacd('0x1a')]);})['catch'](function(_0xdd5646){logger[_0xaacd('0x1f')](_0xaacd('0xf'),_0x27ee1c,JSON[_0xaacd('0x20')](_0xdd5646));})['finally'](function(){logger[_0xaacd('0xe')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x27ee1c);_0x49fc6d['stop']();});}else{logger[_0xaacd('0xe')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x27ee1c);_0x49fc6d[_0xaacd('0x21')]();}}else{var _0x4f898e=this;var _0x143689=new AWS[(_0xaacd('0x22'))]({'accessKeyId':_0x41a5ab[0x0],'secretAccessKey':_0x41a5ab[0x1],'region':_0x41a5ab[0x2]});var _0x1b8b7f={'botAlias':'$LATEST','botName':_0x41a5ab[0x3],'inputText':this['message'][_0xaacd('0x1a')],'userId':this[_0xaacd('0xc')]['id']['toString']()};_0x143689[_0xaacd('0x23')](_0x1b8b7f,function(_0x5a08e4,_0x3bb4bf){if(_0x5a08e4){logger['error'](_0xaacd('0xf'),_0x27ee1c,_0x5a08e4['message']);_0x49fc6d[_0xaacd('0x24')]();}else if(_0x3bb4bf&&_0x3bb4bf['message']){_0x4f898e['body'][_0xaacd('0x25')]=_0x3bb4bf;_0x495088[_0xaacd('0x1a')]=_0x3bb4bf['message'];return rpc[_0x4c6efc+_0xaacd('0x1c')][_0xaacd('0x1d')](_0x495088)[_0xaacd('0x1e')](function(_0x56c931){logger[_0xaacd('0xe')]('[%s][AMAZONLEX]\x20%s',_0x27ee1c,_0x495088[_0xaacd('0x1a')]);if(_0x3bb4bf[_0xaacd('0x26')]==_0xaacd('0x27')){_0x49fc6d['next']();}else{_0x49fc6d[_0xaacd('0x21')]();}})[_0xaacd('0x28')](function(_0x41b768){logger[_0xaacd('0x1f')](_0xaacd('0xf'),_0x27ee1c,JSON[_0xaacd('0x20')](_0x41b768));_0x49fc6d[_0xaacd('0x24')]();});}else{_0x49fc6d['next']();}});}}catch(_0x3365fd){logger[_0xaacd('0x1f')](_0xaacd('0xf'),_0x27ee1c,JSON['stringify'](_0x3365fd));_0x49fc6d[_0xaacd('0x21')]();}};}; \ 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 e78e77e..a14d1ca 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 _0xe706=['next','channel','getMustacheRender','YYYY-MM-DD\x20HH:mm:ss','out','message','from','read','subject','Re:','Re:\x20','chat','ChatWebsiteId','AccountId','account','upperFirst','InteractionId','Message','Smtp','service','host','port','secure','auth','user','pass','inReplyTo','messageId','html','','replace','body','';return mailRpc[_0x6e70('0x33')](_0x228350,_0x37b3e0)['then'](function(_0x259486){logger['info'](_0x6e70('0x34'),_0x1b0389);_0x37b3e0[_0x6e70('0x2c')]=_0x259486[_0x6e70('0x16')]['messageId'];return rpc[_0x743eb5+_0x6e70('0x22')][_0x6e70('0x35')](_0x37b3e0);})['then'](function(_0x13d673){logger[_0x6e70('0xe')]('[%s][AUTOREPLY]\x20%s',_0x1b0389,JSON[_0x6e70('0x36')](_0x13d673));})[_0x6e70('0x37')](function(_0x2d52bd){logger[_0x6e70('0x38')](_0x6e70('0x39'),_0x1b0389,JSON[_0x6e70('0x36')](_0x2d52bd));})[_0x6e70('0x3a')](function(){_0x36357b[_0x6e70('0x11')]();});}else{return rpc[this[_0x6e70('0x12')]+_0x6e70('0x22')]['create'](_0x37b3e0)[_0x6e70('0x3b')](function(_0x4795a0){logger[_0x6e70('0xe')](_0x6e70('0xf'),_0x1b0389,_0x37b3e0[_0x6e70('0x30')]);})[_0x6e70('0x37')](function(_0x233a83){logger[_0x6e70('0x38')](_0x6e70('0xf'),_0x1b0389,JSON[_0x6e70('0x36')](_0x233a83));})[_0x6e70('0x3a')](function(){_0x36357b[_0x6e70('0x11')]();});}}}catch(_0x2a5444){logger[_0x6e70('0x38')](_0x6e70('0xf'),_0x1b0389,JSON['stringify'](_0x2a5444));_0x36357b['stop']();}};}; \ No newline at end of file +var _0xcb91=['consequence','interaction','created','Autoreply\x20already\x20sent','next','channel','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','message','from','phone','read','subject','Re:','Re:\x20','account','upperFirst','AccountId','mail','Smtp','service','port','secure','authentication','auth','user','pass','inReplyTo','messageId','','body','','then','info','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','[%s][AUTOREPLY]\x20%s','stringify','error','[RPC][%s][AUTOREPLY]\x20%s','finally','Message','stop','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../mailRpc'];(function(_0x4bf50f,_0x578e28){var _0x559a54=function(_0x91f49a){while(--_0x91f49a){_0x4bf50f['push'](_0x4bf50f['shift']());}};_0x559a54(++_0x578e28);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4409e7,_0x307f17){_0x4409e7=_0x4409e7-0x0;var _0x24c751=_0xcb91[_0x4409e7];return _0x24c751;};'use strict';var _=require('lodash');var moment=require('moment');var utils=require(_0x1cb9('0x0'));var logger=require(_0x1cb9('0x1'))(_0x1cb9('0x2'));var rpc={'chatMessage':require(_0x1cb9('0x3')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x1cb9('0x4')),'smsMessage':require(_0x1cb9('0x5')),'faxMessage':require('../../rpc/faxMessage')};var mailRpc=require(_0x1cb9('0x6'));exports[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return function(_0x3f7deb){try{if(_0x226b69[0x0]==='1'&&(_['isNil'](this[_0x1cb9('0x8')][_0x1cb9('0x9')])||!this['interaction'][_0x1cb9('0x9')])){logger['info']('[%s][AUTOREPLY]\x20%s',_0x53ffbd,_0x1cb9('0xa'));return _0x3f7deb[_0x1cb9('0xb')]();}var _0x74ce19=this[_0x1cb9('0xc')];var _0x2fc627={'body':utils['getMustacheRender'](_0x226b69[0x1],this),'ContactId':this[_0x1cb9('0xd')]['id'],'sentAt':moment()[_0x1cb9('0xe')](_0x1cb9('0xf')),'direction':_0x1cb9('0x10')};if(this[_0x1cb9('0x11')]){_0x2fc627['to']=this['message']['from']||'';_0x2fc627['cc']=this['message']['cc']||'';_0x2fc627[_0x1cb9('0x12')]=this[_0x1cb9('0x11')]['to']||'';_0x2fc627[_0x1cb9('0x13')]=this[_0x1cb9('0x11')]['phone']||'';_0x2fc627[_0x1cb9('0x14')]=!![];if(this[_0x1cb9('0x11')][_0x1cb9('0x15')]){_0x2fc627[_0x1cb9('0x15')]='';_0x2fc627[_0x1cb9('0x15')]+=_['startsWith'](this['message'][_0x1cb9('0x15')],_0x1cb9('0x16'))?'':_0x1cb9('0x17');_0x2fc627[_0x1cb9('0x15')]+=this[_0x1cb9('0x11')][_0x1cb9('0x15')];}}if(this[_0x1cb9('0xc')]==='chat'){_0x2fc627['ChatWebsiteId']=this[_0x1cb9('0x18')]['id'];}else{_0x2fc627[_[_0x1cb9('0x19')](this[_0x1cb9('0xc')])+_0x1cb9('0x1a')]=this[_0x1cb9('0x18')]['id'];}_0x2fc627[_[_0x1cb9('0x19')](this[_0x1cb9('0xc')])+'InteractionId']=this['interaction']['id'];if(rpc[this[_0x1cb9('0xc')]+'Message']){if(this[_0x1cb9('0xc')]===_0x1cb9('0x1b')){var _0x523b26={'tls':{'rejectUnauthorized':![]}};if(this['account'][_0x1cb9('0x1c')][_0x1cb9('0x1d')]){_0x523b26[_0x1cb9('0x1d')]=this[_0x1cb9('0x18')][_0x1cb9('0x1c')][_0x1cb9('0x1d')];}else{_0x523b26['host']=this['account'][_0x1cb9('0x1c')]['host'];_0x523b26[_0x1cb9('0x1e')]=this[_0x1cb9('0x18')][_0x1cb9('0x1c')][_0x1cb9('0x1e')];_0x523b26[_0x1cb9('0x1f')]=this['account'][_0x1cb9('0x1c')][_0x1cb9('0x1f')];}if(this['account'][_0x1cb9('0x1c')][_0x1cb9('0x20')]){_0x523b26[_0x1cb9('0x21')]={'user':this[_0x1cb9('0x18')][_0x1cb9('0x1c')][_0x1cb9('0x22')],'pass':this[_0x1cb9('0x18')][_0x1cb9('0x1c')][_0x1cb9('0x23')]};}_0x2fc627[_0x1cb9('0x24')]=this['message'][_0x1cb9('0x25')];_0x2fc627['html']=_0x1cb9('0x26')+_['replace'](_0x2fc627[_0x1cb9('0x27')],_0x1cb9('0x28'),_0x1cb9('0x29'))+_0x1cb9('0x2a');return mailRpc['sendMailMessage'](_0x523b26,_0x2fc627)[_0x1cb9('0x2b')](function(_0x4eba82){logger[_0x1cb9('0x2c')](_0x1cb9('0x2d'),_0x53ffbd);_0x2fc627[_0x1cb9('0x25')]=_0x4eba82['message'][_0x1cb9('0x25')];return rpc[_0x74ce19+'Message'][_0x1cb9('0x2e')](_0x2fc627);})['then'](function(_0x2164e3){logger[_0x1cb9('0x2c')](_0x1cb9('0x2f'),_0x53ffbd,JSON[_0x1cb9('0x30')](_0x2164e3));})['catch'](function(_0x2114a4){logger[_0x1cb9('0x31')](_0x1cb9('0x32'),_0x53ffbd,JSON[_0x1cb9('0x30')](_0x2114a4));})[_0x1cb9('0x33')](function(){_0x3f7deb[_0x1cb9('0xb')]();});}else{return rpc[this[_0x1cb9('0xc')]+_0x1cb9('0x34')][_0x1cb9('0x2e')](_0x2fc627)[_0x1cb9('0x2b')](function(_0x294eec){logger[_0x1cb9('0x2c')](_0x1cb9('0x2f'),_0x53ffbd,_0x2fc627['body']);})['catch'](function(_0x299ff8){logger[_0x1cb9('0x31')](_0x1cb9('0x2f'),_0x53ffbd,JSON[_0x1cb9('0x30')](_0x299ff8));})[_0x1cb9('0x33')](function(){_0x3f7deb[_0x1cb9('0xb')]();});}}}catch(_0x35f5e8){logger[_0x1cb9('0x31')]('[%s][AUTOREPLY]\x20%s',_0x53ffbd,JSON[_0x1cb9('0x30')](_0x35f5e8));_0x3f7deb[_0x1cb9('0x35')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/close.js b/server/services/routing/server/applications/close.js index 0e070db..b4195e8 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 _0x23a3=['catch','error','[%s][CLOSE]\x20%s','stringify','stop','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','consequence','[%s][CLOSE]\x20reason\x20%s','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','interaction','then','info','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!'];(function(_0x1a1c6b,_0x5c27a8){var _0x3d04df=function(_0x4c1404){while(--_0x4c1404){_0x1a1c6b['push'](_0x1a1c6b['shift']());}};_0x3d04df(++_0x5c27a8);}(_0x23a3,0x131));var _0x323a=function(_0x5af97f,_0x4be6a2){_0x5af97f=_0x5af97f-0x0;var _0x1e1495=_0x23a3[_0x5af97f];return _0x1e1495;};'use strict';var moment=require('moment');var logger=require('../../../../config/logger')('routing');var rpc={'chatInteraction':require(_0x323a('0x0')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x323a('0x1')),'mailInteraction':require(_0x323a('0x2')),'faxInteraction':require(_0x323a('0x3'))};exports[_0x323a('0x4')]=function(_0x46030e,_0x180066,_0x42593b,_0x3c1648){return function(_0x14a418){try{logger['info'](_0x323a('0x5'),_0x46030e,_0x180066[0x0]);var _0x3544bd={'closed':0x1,'closedAt':moment()['format'](_0x323a('0x6')),'closeReason':_0x323a('0x7'),'disposition':_0x180066[0x0]};if(rpc[_0x3c1648[_0x323a('0x8')]+'Interaction']){rpc[_0x3c1648[_0x323a('0x8')]+_0x323a('0x9')][_0x323a('0xa')](_0x3c1648[_0x323a('0xb')]['id'],_0x3544bd)[_0x323a('0xc')](function(_0x50a99b){logger[_0x323a('0xd')](_0x323a('0xe'),_0x46030e,_0x3c1648[_0x323a('0xb')]['id']);})[_0x323a('0xf')](function(_0x42b854){logger[_0x323a('0x10')](_0x323a('0x11'),_0x46030e,JSON[_0x323a('0x12')](_0x42b854));})['finally'](function(){_0x14a418[_0x323a('0x13')]();});}}catch(_0x4831bc){logger[_0x323a('0x10')]('[%s][CLOSE]\x20%s',_0x46030e,JSON['stringify'](_0x4831bc));_0x14a418[_0x323a('0x13')]();}};}; \ No newline at end of file +var _0x98b7=['error','stringify','stop','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/faxInteraction','consequence','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system','Interaction','interaction','then','catch','[%s][CLOSE]\x20%s','finally'];(function(_0x2136dc,_0x3fb482){var _0x2c7675=function(_0x1c94a8){while(--_0x1c94a8){_0x2136dc['push'](_0x2136dc['shift']());}};_0x2c7675(++_0x3fb482);}(_0x98b7,0xc1));var _0x798b=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x98b7[_0x4565bf];return _0x5610ba;};'use strict';var moment=require(_0x798b('0x0'));var logger=require(_0x798b('0x1'))(_0x798b('0x2'));var rpc={'chatInteraction':require(_0x798b('0x3')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0x798b('0x4'))};exports[_0x798b('0x5')]=function(_0x3c9c14,_0x15b21a,_0x33c026,_0x4c197e){return function(_0x2bab89){try{logger['info'](_0x798b('0x6'),_0x3c9c14,_0x15b21a[0x0]);var _0xbf4c6c={'closed':0x1,'closedAt':moment()[_0x798b('0x7')](_0x798b('0x8')),'closeReason':_0x798b('0x9'),'disposition':_0x15b21a[0x0]};if(rpc[_0x4c197e['channel']+_0x798b('0xa')]){rpc[_0x4c197e['channel']+_0x798b('0xa')]['update'](_0x4c197e[_0x798b('0xb')]['id'],_0xbf4c6c)[_0x798b('0xc')](function(_0x17391e){logger['info']('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0x3c9c14,_0x4c197e[_0x798b('0xb')]['id']);})[_0x798b('0xd')](function(_0x168e5f){logger['error'](_0x798b('0xe'),_0x3c9c14,JSON['stringify'](_0x168e5f));})[_0x798b('0xf')](function(){_0x2bab89['stop']();});}}catch(_0x30a0e2){logger[_0x798b('0x10')](_0x798b('0xe'),_0x3c9c14,JSON[_0x798b('0x11')](_0x30a0e2));_0x2bab89[_0x798b('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 67a4052..689d019 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 _0x439b=['upperFirst','AccountId','account','InteractionId','created','getMustacheRender','Message','create','then','[%s][DIALOGFLOW]\x20%s','body','error','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','dialogflow','fulfillment','speech','result','metadata','endConversation','next','stringify','catch','lodash','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','interaction','info','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','chat','ChatWebsiteId'];(function(_0x1b5aea,_0x3f04b7){var _0x15cfc6=function(_0x204e92){while(--_0x204e92){_0x1b5aea['push'](_0x1b5aea['shift']());}};_0x15cfc6(++_0x3f04b7);}(_0x439b,0x135));var _0xb439=function(_0x4eaa96,_0x53b203){_0x4eaa96=_0x4eaa96-0x0;var _0x390958=_0x439b[_0x4eaa96];return _0x390958;};'use strict';var _=require(_0xb439('0x0'));var moment=require('moment');var apiai=require(_0xb439('0x1'));var md5=require(_0xb439('0x2'));var utils=require(_0xb439('0x3'));var logger=require(_0xb439('0x4'))(_0xb439('0x5'));var rpc={'chatMessage':require(_0xb439('0x6')),'openchannelMessage':require(_0xb439('0x7')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xb439('0x8')),'faxMessage':require(_0xb439('0x9'))};exports[_0xb439('0xa')]=function(_0x2c950f,_0x4971fa){return function(_0xf5d704){try{if(!_[_0xb439('0xb')](this[_0xb439('0xc')]['UserId'])){logger[_0xb439('0xd')]('[%s][DIALOGFLOW]\x20%s',_0x2c950f,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0xf5d704['next']();}var _0x4f59ad={'ContactId':this[_0xb439('0xe')]['id'],'sentAt':moment()[_0xb439('0xf')](_0xb439('0x10')),'direction':_0xb439('0x11')};var _0x56c4e6=this['channel'];if(_0x56c4e6===_0xb439('0x12')){_0x4f59ad[_0xb439('0x13')]=this['account']['id'];}else{_0x4f59ad[_[_0xb439('0x14')](_0x56c4e6)+_0xb439('0x15')]=this[_0xb439('0x16')]['id'];}_0x4f59ad[_['upperFirst'](_0x56c4e6)+_0xb439('0x17')]=this[_0xb439('0xc')]['id'];if(this[_0xb439('0xc')][_0xb439('0x18')]){var _0x53cf6c=_0x4971fa[0x2];if(!_['isEmpty'](_0x53cf6c)){_0x4f59ad['body']=utils[_0xb439('0x19')](_0x53cf6c,this);return rpc[_0x56c4e6+_0xb439('0x1a')][_0xb439('0x1b')](_0x4f59ad)[_0xb439('0x1c')](function(_0x3df2fd){logger[_0xb439('0xd')](_0xb439('0x1d'),_0x2c950f,_0x4f59ad[_0xb439('0x1e')]);})['catch'](function(_0x1bb958){logger[_0xb439('0x1f')](_0xb439('0x1d'),_0x2c950f,JSON['stringify'](_0x1bb958));})[_0xb439('0x20')](function(){logger[_0xb439('0xd')](_0xb439('0x21'),_0x2c950f);_0xf5d704[_0xb439('0x22')]();});}else{logger[_0xb439('0xd')](_0xb439('0x23'),_0x2c950f);_0xf5d704[_0xb439('0x22')]();}}else{var _0x518cda=this;var _0x26665e=apiai(_0x4971fa[0x0],{'language':_0x4971fa[0x1]||'en'});return _0x26665e[_0xb439('0x24')](this[_0xb439('0x25')][_0xb439('0x1e')],{'sessionId':md5(this[_0xb439('0xc')]['id'])})[_0xb439('0x1c')](function(_0x3ff491){_0x518cda[_0xb439('0x1e')][_0xb439('0x26')]=_0x3ff491;_0x4f59ad['body']=_0x3ff491['result'][_0xb439('0x27')][_0xb439('0x28')];return rpc[_0x56c4e6+_0xb439('0x1a')][_0xb439('0x1b')](_0x4f59ad)[_0xb439('0x1c')](function(_0xdaf064){logger[_0xb439('0xd')](_0xb439('0x1d'),_0x2c950f,_0x4f59ad[_0xb439('0x1e')]);if(_0x3ff491[_0xb439('0x29')][_0xb439('0x2a')][_0xb439('0x2b')]){_0xf5d704[_0xb439('0x2c')]();}else{_0xf5d704[_0xb439('0x22')]();}})['catch'](function(_0x4077b5){logger['error'](_0xb439('0x1d'),_0x2c950f,JSON[_0xb439('0x2d')](_0x4077b5));_0xf5d704[_0xb439('0x2c')]();});})[_0xb439('0x2e')](function(_0x4c6200){logger['error'](_0xb439('0x1d'),_0x2c950f,_0x4c6200[_0xb439('0x25')]);_0xf5d704[_0xb439('0x2c')]();});}}catch(_0x525ad0){logger[_0xb439('0x1f')](_0xb439('0x1d'),_0x2c950f,JSON[_0xb439('0x2d')](_0x525ad0));_0xf5d704[_0xb439('0x22')]();}};}; \ No newline at end of file +var _0x8c62=['body','getMustacheRender','then','error','[%s][DIALOGFLOW]\x20%s','info','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','message','result','fulfillment','speech','Message','endConversation','stringify','catch','apiai-promise','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','consequence','isNil','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','out','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created'];(function(_0x2c86de,_0x3c324b){var _0x15b50d=function(_0x2c5533){while(--_0x2c5533){_0x2c86de['push'](_0x2c86de['shift']());}};_0x15b50d(++_0x3c324b);}(_0x8c62,0x1f1));var _0x28c6=function(_0x10ae51,_0x56cdb1){_0x10ae51=_0x10ae51-0x0;var _0x4bd157=_0x8c62[_0x10ae51];return _0x4bd157;};'use strict';var _=require('lodash');var moment=require('moment');var apiai=require(_0x28c6('0x0'));var md5=require('md5');var utils=require(_0x28c6('0x1'));var logger=require('../../../../config/logger')(_0x28c6('0x2'));var rpc={'chatMessage':require(_0x28c6('0x3')),'openchannelMessage':require(_0x28c6('0x4')),'mailMessage':require(_0x28c6('0x5')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x28c6('0x6'))};exports[_0x28c6('0x7')]=function(_0x40aeb8,_0x1ad22d){return function(_0x1c7695){try{if(!_[_0x28c6('0x8')](this[_0x28c6('0x9')][_0x28c6('0xa')])){logger['info']('[%s][DIALOGFLOW]\x20%s',_0x40aeb8,_0x28c6('0xb'));return _0x1c7695[_0x28c6('0xc')]();}var _0x5eb08d={'ContactId':this[_0x28c6('0xd')]['id'],'sentAt':moment()[_0x28c6('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x28c6('0xf')};var _0x454a7f=this['channel'];if(_0x454a7f===_0x28c6('0x10')){_0x5eb08d[_0x28c6('0x11')]=this[_0x28c6('0x12')]['id'];}else{_0x5eb08d[_[_0x28c6('0x13')](_0x454a7f)+_0x28c6('0x14')]=this['account']['id'];}_0x5eb08d[_[_0x28c6('0x13')](_0x454a7f)+_0x28c6('0x15')]=this[_0x28c6('0x9')]['id'];if(this[_0x28c6('0x9')][_0x28c6('0x16')]){var _0xa47c74=_0x1ad22d[0x2];if(!_['isEmpty'](_0xa47c74)){_0x5eb08d[_0x28c6('0x17')]=utils[_0x28c6('0x18')](_0xa47c74,this);return rpc[_0x454a7f+'Message']['create'](_0x5eb08d)[_0x28c6('0x19')](function(_0x2cbf99){logger['info']('[%s][DIALOGFLOW]\x20%s',_0x40aeb8,_0x5eb08d[_0x28c6('0x17')]);})['catch'](function(_0x4693f2){logger[_0x28c6('0x1a')](_0x28c6('0x1b'),_0x40aeb8,JSON['stringify'](_0x4693f2));})['finally'](function(){logger[_0x28c6('0x1c')](_0x28c6('0x1d'),_0x40aeb8);_0x1c7695[_0x28c6('0x1e')]();});}else{logger['info'](_0x28c6('0x1f'),_0x40aeb8);_0x1c7695[_0x28c6('0x1e')]();}}else{var _0x4ccc6e=this;var _0x29f319=apiai(_0x1ad22d[0x0],{'language':_0x1ad22d[0x1]||'en'});return _0x29f319['textRequest'](this[_0x28c6('0x20')]['body'],{'sessionId':md5(this[_0x28c6('0x9')]['id'])})['then'](function(_0x2bdc56){_0x4ccc6e[_0x28c6('0x17')]['dialogflow']=_0x2bdc56;_0x5eb08d[_0x28c6('0x17')]=_0x2bdc56[_0x28c6('0x21')][_0x28c6('0x22')][_0x28c6('0x23')];return rpc[_0x454a7f+_0x28c6('0x24')]['create'](_0x5eb08d)[_0x28c6('0x19')](function(_0x21a143){logger[_0x28c6('0x1c')](_0x28c6('0x1b'),_0x40aeb8,_0x5eb08d['body']);if(_0x2bdc56['result']['metadata'][_0x28c6('0x25')]){_0x1c7695[_0x28c6('0xc')]();}else{_0x1c7695['stop']();}})['catch'](function(_0x5594b9){logger['error']('[%s][DIALOGFLOW]\x20%s',_0x40aeb8,JSON[_0x28c6('0x26')](_0x5594b9));_0x1c7695['next']();});})[_0x28c6('0x27')](function(_0x571ecc){logger[_0x28c6('0x1a')]('[%s][DIALOGFLOW]\x20%s',_0x40aeb8,_0x571ecc[_0x28c6('0x20')]);_0x1c7695[_0x28c6('0xc')]();});}}catch(_0x878196){logger[_0x28c6('0x1a')](_0x28c6('0x1b'),_0x40aeb8,JSON[_0x28c6('0x26')](_0x878196));_0x1c7695[_0x28c6('0x1e')]();}};}; \ 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 3d39b4f..5311eb0 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 _0xf732=['replace','validate','length','map','message','join','condition','priorityTrue','priorityFalse','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','info','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','stop','error','[%s][GOTOIF]\x20%s','stringify','lodash','html-to-text','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','getMustacheRender'];(function(_0xb7ba4e,_0x3007a2){var _0x4071e1=function(_0x940528){while(--_0x940528){_0xb7ba4e['push'](_0xb7ba4e['shift']());}};_0x4071e1(++_0x3007a2);}(_0xf732,0x1a9));var _0x2f73=function(_0x1d6b55,_0x43ab65){_0x1d6b55=_0x1d6b55-0x0;var _0x1751f9=_0xf732[_0x1d6b55];return _0x1751f9;};'use strict';var schema=require('validate');var _=require(_0x2f73('0x0'));var htmlToText=require(_0x2f73('0x1'));var utils=require(_0x2f73('0x2'));var logger=require(_0x2f73('0x3'))(_0x2f73('0x4'));var gotoif=schema({'condition':{'type':_0x2f73('0x5'),'required':!![],'message':_0x2f73('0x6')},'priorityTrue':{'type':_0x2f73('0x7'),'message':_0x2f73('0x8')},'priorityFalse':{'type':_0x2f73('0x7'),'message':'priority\x20false\x20is\x20a\x20number'}});exports['consequence']=function(_0x1b743a,_0xbe872){return function(_0x3469b9){try{var _0x55c7e4={'condition':htmlToText['fromString'](utils[_0x2f73('0x9')](_0xbe872[0x0],this),{'wordwrap':![]})[_0x2f73('0xa')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0xbe872[0x1],'priorityFalse':_0xbe872[0x2]};var _0xbd982b=gotoif[_0x2f73('0xb')](_0x55c7e4,{'typecast':!![]});if(_0xbd982b[_0x2f73('0xc')]){logger['error']('[%s][GOTOIF]\x20%s',_0x1b743a,_[_0x2f73('0xd')](_0xbd982b,_0x2f73('0xe'))[_0x2f73('0xf')](',\x20'));_0x3469b9['stop']();}else{try{var _0x127a23=eval('('+_0x55c7e4[_0x2f73('0x10')]+')');var _0x5b8ebf=_0x127a23?_0x55c7e4[_0x2f73('0x11')]:_0x55c7e4[_0x2f73('0x12')];logger['info'](_0x2f73('0x13'),_0x1b743a,_0x55c7e4[_0x2f73('0x10')],_0x127a23,_0x5b8ebf||_0x2f73('0x14'));if(_0x5b8ebf){var _0x43a64e=_[_0x2f73('0x15')](_0x3469b9[_0x2f73('0x16')](),{'p':_0x5b8ebf});if(_0x43a64e>=0x0){logger[_0x2f73('0x17')](_0x2f73('0x18'),_0x1b743a,_0x5b8ebf||_0x2f73('0x14'),_0x43a64e);_0x3469b9[_0x2f73('0x14')](_0x43a64e);}else{logger['info']('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x1b743a,_0x5b8ebf||_0x2f73('0x14'));_0x3469b9[_0x2f73('0x19')]();}}else{_0x3469b9[_0x2f73('0x14')]();}}catch(_0x1b0c6a){logger[_0x2f73('0x1a')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x1b743a,_0x1b0c6a[_0x2f73('0xe')]);_0x3469b9[_0x2f73('0x19')]();}}}catch(_0x1ec78a){logger[_0x2f73('0x1a')](_0x2f73('0x1b'),_0x1b743a,JSON[_0x2f73('0x1c')](_0x1ec78a));_0x3469b9[_0x2f73('0x19')]();}};}; \ No newline at end of file +var _0x4fc8=['stringify','validate','lodash','html-to-text','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','priority\x20true\x20is\x20a\x20number','number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','length','error','[%s][GOTOIF]\x20%s','map','stop','condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s'];(function(_0x1085de,_0x3f6bfb){var _0x49f042=function(_0x4ba270){while(--_0x4ba270){_0x1085de['push'](_0x1085de['shift']());}};_0x49f042(++_0x3f6bfb);}(_0x4fc8,0xa9));var _0x84fc=function(_0x23b1b4,_0x56df65){_0x23b1b4=_0x23b1b4-0x0;var _0x52e3b9=_0x4fc8[_0x23b1b4];return _0x52e3b9;};'use strict';var schema=require(_0x84fc('0x0'));var _=require(_0x84fc('0x1'));var htmlToText=require(_0x84fc('0x2'));var utils=require(_0x84fc('0x3'));var logger=require(_0x84fc('0x4'))(_0x84fc('0x5'));var gotoif=schema({'condition':{'type':_0x84fc('0x6'),'required':!![],'message':_0x84fc('0x7')},'priorityTrue':{'type':'number','message':_0x84fc('0x8')},'priorityFalse':{'type':_0x84fc('0x9'),'message':_0x84fc('0xa')}});exports[_0x84fc('0xb')]=function(_0x5edfea,_0x19a4d3){return function(_0x4adff9){try{var _0xfee809={'condition':htmlToText[_0x84fc('0xc')](utils[_0x84fc('0xd')](_0x19a4d3[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x19a4d3[0x1],'priorityFalse':_0x19a4d3[0x2]};var _0x172a89=gotoif[_0x84fc('0x0')](_0xfee809,{'typecast':!![]});if(_0x172a89[_0x84fc('0xe')]){logger[_0x84fc('0xf')](_0x84fc('0x10'),_0x5edfea,_[_0x84fc('0x11')](_0x172a89,'message')['join'](',\x20'));_0x4adff9[_0x84fc('0x12')]();}else{try{var _0x547e4f=eval('('+_0xfee809[_0x84fc('0x13')]+')');var _0x216ca4=_0x547e4f?_0xfee809[_0x84fc('0x14')]:_0xfee809[_0x84fc('0x15')];logger[_0x84fc('0x16')](_0x84fc('0x17'),_0x5edfea,_0xfee809[_0x84fc('0x13')],_0x547e4f,_0x216ca4||_0x84fc('0x18'));if(_0x216ca4){var _0x23b27f=_['findIndex'](_0x4adff9['rules'](),{'p':_0x216ca4});if(_0x23b27f>=0x0){logger[_0x84fc('0x16')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x5edfea,_0x216ca4||_0x84fc('0x18'),_0x23b27f);_0x4adff9[_0x84fc('0x18')](_0x23b27f);}else{logger[_0x84fc('0x16')](_0x84fc('0x19'),_0x5edfea,_0x216ca4||_0x84fc('0x18'));_0x4adff9[_0x84fc('0x12')]();}}else{_0x4adff9[_0x84fc('0x18')]();}}catch(_0x2d2583){logger[_0x84fc('0xf')](_0x84fc('0x1a'),_0x5edfea,_0x2d2583['message']);_0x4adff9['stop']();}}}catch(_0x4cfc68){logger['error']('[%s][GOTOIF]\x20%s',_0x5edfea,JSON[_0x84fc('0x1b')](_0x4cfc68));_0x4adff9[_0x84fc('0x12')]();}};}; \ 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 8db0971..0b4dafa 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 _0xf4e9=['lodash','../../../../config/logger','routing','number','consequence','length','error','[%s][GOTOP]\x20%s','map','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','validate'];(function(_0x52f7df,_0x4d6440){var _0x21dbb9=function(_0x12342a){while(--_0x12342a){_0x52f7df['push'](_0x52f7df['shift']());}};_0x21dbb9(++_0x4d6440);}(_0xf4e9,0x1c7));var _0x9f4e=function(_0xdd2e1d,_0x33acbb){_0xdd2e1d=_0xdd2e1d-0x0;var _0x34d3cf=_0xf4e9[_0xdd2e1d];return _0x34d3cf;};'use strict';var schema=require(_0x9f4e('0x0'));var _=require(_0x9f4e('0x1'));var logger=require(_0x9f4e('0x2'))(_0x9f4e('0x3'));var gotop=schema({'priority':{'type':_0x9f4e('0x4'),'required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports[_0x9f4e('0x5')]=function(_0x45a5a3,_0xc9bd3f){return function(_0x5401d1){try{var _0x1d92b2={'priority':_0xc9bd3f[0x0]};var _0x3250c7=gotop['validate'](_0x1d92b2,{'typecast':!![]});if(_0x3250c7[_0x9f4e('0x6')]){logger[_0x9f4e('0x7')](_0x9f4e('0x8'),_0x45a5a3,_[_0x9f4e('0x9')](_0x3250c7,'message')['join'](',\x20'));_0x5401d1[_0x9f4e('0xa')]();}else{logger[_0x9f4e('0xb')](_0x9f4e('0xc'),_0x45a5a3,_0x1d92b2[_0x9f4e('0xd')]);if(_0x1d92b2['priority']){var _0x560af8=_[_0x9f4e('0xe')](_0x5401d1[_0x9f4e('0xf')](),{'p':_0x1d92b2[_0x9f4e('0xd')]});if(_0x560af8>=0x0){logger[_0x9f4e('0xb')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x45a5a3,_0x1d92b2[_0x9f4e('0xd')]||_0x9f4e('0x10'),_0x560af8);_0x5401d1[_0x9f4e('0x10')](_0x560af8);}else{logger[_0x9f4e('0xb')](_0x9f4e('0x11'),_0x45a5a3,_0x1d92b2[_0x9f4e('0xd')]||_0x9f4e('0x10'));_0x5401d1[_0x9f4e('0xa')]();}}else{_0x5401d1[_0x9f4e('0x10')]();}}}catch(_0x551981){logger[_0x9f4e('0x7')](_0x9f4e('0x8'),_0x45a5a3,JSON[_0x9f4e('0x12')](_0x551981));_0x5401d1['stop']();}};}; \ No newline at end of file +var _0xd732=['priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','error','stringify','stop','validate','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','[%s][GOTOP]\x20%s','map','message','join','info','[%s][GOTOP]\x20priority\x20%s'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0xd732,0x198));var _0x2d73=function(_0x1738e8,_0x37fb8f){_0x1738e8=_0x1738e8-0x0;var _0x3d1030=_0xd732[_0x1738e8];return _0x3d1030;};'use strict';var schema=require(_0x2d73('0x0'));var _=require('lodash');var logger=require(_0x2d73('0x1'))(_0x2d73('0x2'));var gotop=schema({'priority':{'type':_0x2d73('0x3'),'required':!![],'message':_0x2d73('0x4')}});exports[_0x2d73('0x5')]=function(_0xd06149,_0x434a08){return function(_0x726b5a){try{var _0x5d6b04={'priority':_0x434a08[0x0]};var _0x265be0=gotop[_0x2d73('0x0')](_0x5d6b04,{'typecast':!![]});if(_0x265be0['length']){logger['error'](_0x2d73('0x6'),_0xd06149,_[_0x2d73('0x7')](_0x265be0,_0x2d73('0x8'))[_0x2d73('0x9')](',\x20'));_0x726b5a['stop']();}else{logger[_0x2d73('0xa')](_0x2d73('0xb'),_0xd06149,_0x5d6b04[_0x2d73('0xc')]);if(_0x5d6b04['priority']){var _0x3a4b2d=_[_0x2d73('0xd')](_0x726b5a[_0x2d73('0xe')](),{'p':_0x5d6b04[_0x2d73('0xc')]});if(_0x3a4b2d>=0x0){logger['info'](_0x2d73('0xf'),_0xd06149,_0x5d6b04['priority']||_0x2d73('0x10'),_0x3a4b2d);_0x726b5a['next'](_0x3a4b2d);}else{logger[_0x2d73('0xa')](_0x2d73('0x11'),_0xd06149,_0x5d6b04[_0x2d73('0xc')]||_0x2d73('0x10'));_0x726b5a['stop']();}}else{_0x726b5a[_0x2d73('0x10')]();}}}catch(_0x1cad6e){logger[_0x2d73('0x12')](_0x2d73('0x6'),_0xd06149,JSON[_0x2d73('0x13')](_0x1cad6e));_0x726b5a[_0x2d73('0x14')]();}};}; \ 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 8a19147..3d01e3d 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 _0x8921=['../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','getMustacheRender','contact','chat','upperFirst','account','channel','InteractionId','Message','then','info','[%s][MESSAGE]\x20%s','body','catch','error','stringify','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage'];(function(_0x38edb4,_0x254432){var _0x53692e=function(_0x4a6281){while(--_0x4a6281){_0x38edb4['push'](_0x38edb4['shift']());}};_0x53692e(++_0x254432);}(_0x8921,0x103));var _0x1892=function(_0x33aabe,_0x26a182){_0x33aabe=_0x33aabe-0x0;var _0x59b724=_0x8921[_0x33aabe];return _0x59b724;};'use strict';var _=require(_0x1892('0x0'));var utils=require(_0x1892('0x1'));var logger=require(_0x1892('0x2'))(_0x1892('0x3'));var rpc={'chatMessage':require(_0x1892('0x4')),'openchannelMessage':require(_0x1892('0x5')),'mailMessage':require(_0x1892('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x1892('0x7'))};exports['consequence']=function(_0xd3a182,_0xf6c982){return function(_0x23761b){try{var _0x1aad57={'body':utils[_0x1892('0x8')](_0xf6c982[0x0],this),'ContactId':this[_0x1892('0x9')]['id']};if(this['channel']===_0x1892('0xa')){_0x1aad57['ChatWebsiteId']=this['account']['id'];}else{_0x1aad57[_[_0x1892('0xb')](this['channel'])+'AccountId']=this[_0x1892('0xc')]['id'];}_0x1aad57[_[_0x1892('0xb')](this[_0x1892('0xd')])+_0x1892('0xe')]=this['interaction']['id'];if(rpc[this[_0x1892('0xd')]+_0x1892('0xf')]){return rpc[this[_0x1892('0xd')]+_0x1892('0xf')]['create'](_0x1aad57)[_0x1892('0x10')](function(_0x598baa){logger[_0x1892('0x11')](_0x1892('0x12'),_0xd3a182,_0x1aad57[_0x1892('0x13')]);_0x23761b['next']();})[_0x1892('0x14')](function(_0x1c7234){logger[_0x1892('0x15')](_0x1892('0x12'),_0xd3a182,JSON[_0x1892('0x16')](_0x1c7234));_0x23761b['stop']();});}}catch(_0x425843){logger['error'](_0x1892('0x12'),_0xd3a182,JSON[_0x1892('0x16')](_0x425843));_0x23761b[_0x1892('0x17')]();}};}; \ No newline at end of file +var _0x8002=['../../rpc/openchannelMessage','../../rpc/faxMessage','consequence','contact','upperFirst','channel','AccountId','interaction','Message','then','info','[%s][MESSAGE]\x20%s','body','next','catch','error','stop','stringify','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage'];(function(_0x9472f6,_0x46fbaa){var _0x32802d=function(_0x35e2b1){while(--_0x35e2b1){_0x9472f6['push'](_0x9472f6['shift']());}};_0x32802d(++_0x46fbaa);}(_0x8002,0x1b0));var _0x2800=function(_0x247c01,_0x3623b0){_0x247c01=_0x247c01-0x0;var _0x1b1846=_0x8002[_0x247c01];return _0x1b1846;};'use strict';var _=require(_0x2800('0x0'));var utils=require(_0x2800('0x1'));var logger=require(_0x2800('0x2'))(_0x2800('0x3'));var rpc={'chatMessage':require(_0x2800('0x4')),'openchannelMessage':require(_0x2800('0x5')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x2800('0x6'))};exports[_0x2800('0x7')]=function(_0x5e93ce,_0x4cc431){return function(_0x8501a2){try{var _0x45b1dc={'body':utils['getMustacheRender'](_0x4cc431[0x0],this),'ContactId':this[_0x2800('0x8')]['id']};if(this['channel']==='chat'){_0x45b1dc['ChatWebsiteId']=this['account']['id'];}else{_0x45b1dc[_[_0x2800('0x9')](this[_0x2800('0xa')])+_0x2800('0xb')]=this['account']['id'];}_0x45b1dc[_['upperFirst'](this[_0x2800('0xa')])+'InteractionId']=this[_0x2800('0xc')]['id'];if(rpc[this[_0x2800('0xa')]+_0x2800('0xd')]){return rpc[this[_0x2800('0xa')]+_0x2800('0xd')]['create'](_0x45b1dc)[_0x2800('0xe')](function(_0x348b45){logger[_0x2800('0xf')](_0x2800('0x10'),_0x5e93ce,_0x45b1dc[_0x2800('0x11')]);_0x8501a2[_0x2800('0x12')]();})[_0x2800('0x13')](function(_0x3a28ec){logger[_0x2800('0x14')](_0x2800('0x10'),_0x5e93ce,JSON['stringify'](_0x3a28ec));_0x8501a2[_0x2800('0x15')]();});}}catch(_0xfd2c2e){logger[_0x2800('0x14')](_0x2800('0x10'),_0x5e93ce,JSON[_0x2800('0x16')](_0xfd2c2e));_0x8501a2['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/noop.js b/server/services/routing/server/applications/noop.js index 9ef7078..b9fb39d 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 _0x5be7=['error','stop','../../../../config/logger','routing','consequence','info','[%s][NOOP]\x20%s','getMustacheRender','next'];(function(_0x297ab2,_0x3a3d6b){var _0x874246=function(_0x2ee708){while(--_0x2ee708){_0x297ab2['push'](_0x297ab2['shift']());}};_0x874246(++_0x3a3d6b);}(_0x5be7,0x134));var _0x75be=function(_0x10e1b7,_0x28e02a){_0x10e1b7=_0x10e1b7-0x0;var _0x469e84=_0x5be7[_0x10e1b7];return _0x469e84;};'use strict';var utils=require('./utils');var logger=require(_0x75be('0x0'))(_0x75be('0x1'));exports[_0x75be('0x2')]=function(_0x1f5ef4,_0x21a4f4){return function(_0x4a46b8){try{logger[_0x75be('0x3')](_0x75be('0x4'),_0x1f5ef4,utils[_0x75be('0x5')](_0x21a4f4[0x0],this));_0x4a46b8[_0x75be('0x6')]();}catch(_0x3de4c1){logger[_0x75be('0x7')](_0x75be('0x4'),_0x1f5ef4,JSON['stringify'](_0x3de4c1));_0x4a46b8[_0x75be('0x8')]();}};}; \ No newline at end of file +var _0x8b67=['./utils','../../../../config/logger','routing','info','next','error','stringify','stop'];(function(_0x5924b6,_0x2d29b5){var _0xeceaa3=function(_0x157783){while(--_0x157783){_0x5924b6['push'](_0x5924b6['shift']());}};_0xeceaa3(++_0x2d29b5);}(_0x8b67,0x178));var _0x78b6=function(_0x126fb9,_0x122c59){_0x126fb9=_0x126fb9-0x0;var _0xc8a3b1=_0x8b67[_0x126fb9];return _0xc8a3b1;};'use strict';var utils=require(_0x78b6('0x0'));var logger=require(_0x78b6('0x1'))(_0x78b6('0x2'));exports['consequence']=function(_0x5c3e00,_0x359db5){return function(_0x3b17ed){try{logger[_0x78b6('0x3')]('[%s][NOOP]\x20%s',_0x5c3e00,utils['getMustacheRender'](_0x359db5[0x0],this));_0x3b17ed[_0x78b6('0x4')]();}catch(_0x56b94e){logger[_0x78b6('0x5')]('[%s][NOOP]\x20%s',_0x5c3e00,JSON[_0x78b6('0x6')](_0x56b94e));_0x3b17ed[_0x78b6('0x7')]();}};}; \ 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 bf2ce71..f987135 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 _0x1a9c=['[%s][QUEUE]\x20ROUTING\x20STOPPED','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','validate','lodash','util','seq-queue','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','defaults','localhost','socket.io-emitter','redis','queue_id','account','from','joinAt','emit','queue','format','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','../../rpc/openchannelQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','contact','list','upperFirst','QueueId','channel','InteractionId','interaction','MessageId','message','chat','AccountId','WebsiteId','info','name','QueueReport','create','catch','error','create\x20queue\x20report','YYYY-MM-DD\x20HH:mm:ss','accepted','update','update\x20queue\x20report','timeout','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','stop','Queues','createQueue','atimeout','qtimeout','rules','end','close'];(function(_0x351b46,_0x26b265){var _0x1515df=function(_0x22896a){while(--_0x22896a){_0x351b46['push'](_0x351b46['shift']());}};_0x1515df(++_0x26b265);}(_0x1a9c,0x9d));var _0xc1a9=function(_0x44900a,_0xed6538){_0x44900a=_0x44900a-0x0;var _0x33de6f=_0x1a9c[_0x44900a];return _0x33de6f;};'use strict';var schema=require(_0xc1a9('0x0'));var _=require(_0xc1a9('0x1'));var util=require(_0xc1a9('0x2'));var seqqueue=require(_0xc1a9('0x3'));var moment=require('moment');var Redis=require(_0xc1a9('0x4'));var config=require(_0xc1a9('0x5'));var logger=require(_0xc1a9('0x6'))(_0xc1a9('0x7'));var strategy=require(_0xc1a9('0x8'));config['redis']=_[_0xc1a9('0x9')](config['redis'],{'host':_0xc1a9('0xa'),'port':0x18eb});var io=require(_0xc1a9('0xb'))(new Redis(config[_0xc1a9('0xc')]));var attributes=['id',_0xc1a9('0xd'),_0xc1a9('0xe'),'queue',_0xc1a9('0xf'),_0xc1a9('0x10')];function emit(_0x3ec070,_0xf4a9f3,_0x40e359){io['to'](_0x3ec070)[_0xc1a9('0x11')](_0xf4a9f3,_0x40e359);}function emitChannelQueueInteraction(_0xc61a2a,_0x5aa72a,_0x5cf083,_0xe710b1,_0x3b63b9,_0x44ad5f,_0x3739b4,_0x369047){_0x5cf083[_0xc1a9('0xd')]=_0x369047;_0x5cf083[_0xc1a9('0x12')]=_0x5aa72a;_0x5cf083[_0xc1a9('0xe')]=_0xe710b1;_0x5cf083['id']=_0x3b63b9;if(_0x44ad5f){_0x3739b4[util[_0xc1a9('0x13')]('%sQueuesWaitingInteractions',_0xc61a2a)][_0x3b63b9]=_[_0xc1a9('0x14')](_0x5cf083,attributes);}else{delete _0x3739b4[util['format']('%sQueuesWaitingInteractions',_0xc61a2a)][_0x3b63b9];}emit(util['format'](_0xc1a9('0x15'),_0xc61a2a,_0x5aa72a),util['format'](_0xc1a9('0x16'),_0xc61a2a,_0x44ad5f?'save':'remove'),_[_0xc1a9('0x14')](_0x5cf083,attributes));}var rpc={'openchannelQueueReport':require(_0xc1a9('0x17')),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require(_0xc1a9('0x18')),'smsQueueReport':require(_0xc1a9('0x19')),'faxQueueReport':require('../../rpc/faxQueueReport')};var queue=schema({'name':{'type':_0xc1a9('0x1a'),'required':!![],'message':_0xc1a9('0x1b')},'timeout':{'type':_0xc1a9('0x1c'),'message':_0xc1a9('0x1d')}});function startRouting(_0x1c61c3,_0x246788,_0x301e5c,_0x10c9ea){if(_0x1c61c3&&_0x246788&&_0x301e5c){_0x246788[_0xc1a9('0x1e')]+=0x1;var _0xf3cee9={'uniqueid':_0x1c61c3,'from':_0x301e5c[_0xc1a9('0x1f')]?_0x301e5c[_0xc1a9('0x1f')][_0xc1a9('0xf')]:'','joinAt':moment()[_0xc1a9('0x13')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x301e5c[_0xc1a9('0x20')]?_0x301e5c['contact']['id']:null,'ListId':_0x301e5c['list']?_0x301e5c[_0xc1a9('0x21')]['id']:null};_0xf3cee9[_[_0xc1a9('0x22')](_0x301e5c['channel'])+_0xc1a9('0x23')]=_0x246788['id']||null;_0xf3cee9[_[_0xc1a9('0x22')](_0x301e5c[_0xc1a9('0x24')])+_0xc1a9('0x25')]=_0x301e5c[_0xc1a9('0x26')]?_0x301e5c[_0xc1a9('0x26')]['id']:null;_0xf3cee9[_[_0xc1a9('0x22')](_0x301e5c[_0xc1a9('0x24')])+_0xc1a9('0x27')]=_0x301e5c[_0xc1a9('0x28')]?_0x301e5c['message']['id']:null;_0xf3cee9[_[_0xc1a9('0x22')](_0x301e5c[_0xc1a9('0x24')])+(_0x301e5c[_0xc1a9('0x24')]!==_0xc1a9('0x29')?_0xc1a9('0x2a'):_0xc1a9('0x2b'))]=_0x301e5c[_0xc1a9('0xe')]?_0x301e5c[_0xc1a9('0xe')]['id']:null;logger[_0xc1a9('0x2c')](util[_0xc1a9('0x13')]('[%s][START:QUEUE][NAME:%s]',_0x1c61c3,_0x246788['name']));emitChannelQueueInteraction(_0x301e5c[_0xc1a9('0x24')],_0x246788[_0xc1a9('0x2d')],_0xf3cee9,_0x301e5c[_0xc1a9('0xe')]['name'],_0x301e5c[_0xc1a9('0x28')]['id'],!![],_0x10c9ea,_0x246788['id']);if(rpc[_0x301e5c['channel']+_0xc1a9('0x2e')]){return rpc[_0x301e5c[_0xc1a9('0x24')]+'QueueReport'][_0xc1a9('0x2f')](_0xf3cee9)[_0xc1a9('0x30')](function(_0x2f79cd){logger[_0xc1a9('0x31')](_0xc1a9('0x32'));});}}}function stopRouting(_0x4a4f84,_0x14f6b0,_0x7abf52,_0xa89584){if(_0x4a4f84&&_0x14f6b0){_0x14f6b0['waiting']-=0x1;var _0x1a572b={'leaveAt':moment()[_0xc1a9('0x13')]('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()[_0xc1a9('0x13')](_0xc1a9('0x33')),'reason':_0xc1a9('0x34')};logger[_0xc1a9('0x2c')](util[_0xc1a9('0x13')]('[%s][STOP:QUEUE][NAME:%s]',_0x4a4f84,_0x14f6b0[_0xc1a9('0x2d')]));emitChannelQueueInteraction(_0x7abf52['channel'],_0x14f6b0[_0xc1a9('0x2d')],_0x7abf52[_0xc1a9('0x1f')],_0x7abf52[_0xc1a9('0xe')][_0xc1a9('0x2d')],_0x7abf52['message']['id'],![],_0xa89584,_0x14f6b0['id']);if(rpc[_0x7abf52['channel']+_0xc1a9('0x2e')]){return rpc[_0x7abf52[_0xc1a9('0x24')]+'QueueReport'][_0xc1a9('0x35')](_0x4a4f84,_0x1a572b)[_0xc1a9('0x30')](function(_0x4b7542){logger['error'](_0xc1a9('0x36'));});}}}function endRouting(_0x1c2968,_0x336b3d,_0xc87090,_0x3a1235){if(_0x1c2968&&_0x336b3d){_0x336b3d[_0xc1a9('0x1e')]-=0x1;var _0x15113d={'leaveAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0xc1a9('0x13')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xc1a9('0x37')};logger[_0xc1a9('0x2c')](util['format']('[%s][END:QUEUE][NAME:%s]',_0x1c2968,_0x336b3d['name']));emitChannelQueueInteraction(_0xc87090[_0xc1a9('0x24')],_0x336b3d[_0xc1a9('0x2d')],_0xc87090[_0xc1a9('0x1f')],_0xc87090[_0xc1a9('0xe')]['name'],_0xc87090[_0xc1a9('0x28')]['id'],![],_0x3a1235);if(rpc[_0xc87090[_0xc1a9('0x24')]+_0xc1a9('0x2e')]){return rpc[_0xc87090[_0xc1a9('0x24')]+'QueueReport'][_0xc1a9('0x35')](_0x1c2968,_0x15113d)['catch'](function(_0x4e4d11){logger[_0xc1a9('0x31')](_0xc1a9('0x36'));});}}}function handleFindQueue(_0x4da8d1){return function(_0xc2ca99){return _0xc2ca99[_0xc1a9('0x2d')][_0xc1a9('0x38')]()===_0x4da8d1[_0xc1a9('0x38')]();};}exports[_0xc1a9('0x39')]=function(_0x1a4fef,_0x506a42,_0x423547,_0x551287){return function(_0x5a28d9){try{var _0x48c241={'name':_0x506a42[0x0],'timeout':_0x506a42[0x1]};var _0x1889c9=queue[_0xc1a9('0x0')](_0x48c241,{'typecast':!![]});if(_0x1889c9[_0xc1a9('0x3a')]){logger['error'](_0xc1a9('0x3b'),_0x1a4fef,_['map'](_0x1889c9,_0xc1a9('0x28'))['join'](',\x20'));_0x5a28d9[_0xc1a9('0x3c')]();}else{var _0x32abad=_['find'](_0x423547[_0x551287['channel']+_0xc1a9('0x3d')],handleFindQueue(_0x48c241[_0xc1a9('0x2d')]));if(_0x32abad){startRouting(_0x1a4fef,_0x32abad,_0x551287,_0x423547);var _0x4d9757=(_0x32abad[_0xc1a9('0x37')]||0xa)*0x3e8;var _0x4b1a66=(_0x48c241[_0xc1a9('0x37')]||0x14)*0x3e8;var _0x2a912d,_0x2de510;if(_0x4d9757>_0x4b1a66){_0x4b1a66=_0x4d9757;}var _0x6371d1=seqqueue[_0xc1a9('0x3e')](_0x4d9757);_0x6371d1['id']=_0x1a4fef;_0x6371d1[_0xc1a9('0x3f')]=_0x4d9757;_0x6371d1[_0xc1a9('0x40')]=_0x4b1a66;_0x6371d1[_0xc1a9('0x24')]=_0x551287['channel'];_0x423547[_0xc1a9('0x41')][_0x1a4fef]['on'](_0xc1a9('0x42'),function(){stopRouting(_0x1a4fef,_0x32abad,_0x551287,_0x423547);_0x6371d1[_0xc1a9('0x43')](!![]);clearTimeout(_0x2a912d);_0x2a912d=undefined;if(_0x423547[_0xc1a9('0x41')][_0x1a4fef]){delete _0x423547['rules'][_0x1a4fef];}logger[_0xc1a9('0x2c')](_0xc1a9('0x44'),_0x1a4fef);_0x5a28d9[_0xc1a9('0x3c')]();});_0x2a912d=setTimeout(function(){endRouting(_0x1a4fef,_0x32abad,_0x551287,_0x423547);clearTimeout(_0x2a912d);_0x6371d1['close'](!![]);logger[_0xc1a9('0x2c')]('[%s][QUEUE]\x20ROUTING\x20END',_0x1a4fef);_0x5a28d9[_0xc1a9('0x45')]();},_0x4b1a66);switch(_0x32abad[_0xc1a9('0x46')]){case _0xc1a9('0x47'):strategy[_0xc1a9('0x47')](_0x6371d1,_0x32abad,_0x423547,_0x551287);break;default:strategy[_0xc1a9('0x48')](_0x6371d1,_0x32abad,_0x423547,_0x551287);}}else{logger[_0xc1a9('0x31')](_0xc1a9('0x49'),_0x1a4fef,_0x48c241[_0xc1a9('0x2d')]);_0x5a28d9[_0xc1a9('0x3c')]();}}}catch(_0x4502db){console[_0xc1a9('0x4a')](_0x4502db);logger['error'](_0xc1a9('0x3b'),_0x1a4fef,_0x4502db['stack']);_0x5a28d9['stop']();}};}; \ No newline at end of file +var _0xaa35=['remove','../../rpc/openchannelQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','timeout\x20is\x20a\x20number','waiting','body','contact','list','channel','QueueId','upperFirst','interaction','message','chat','AccountId','info','name','QueueReport','catch','YYYY-MM-DD\x20HH:mm:ss','accepted','[%s][STOP:QUEUE][NAME:%s]','update','error','update\x20queue\x20report','timeout','toLowerCase','length','[%s][QUEUE]\x20%s','stop','find','Queues','createQueue','atimeout','rules','end','close','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','lodash','seq-queue','moment','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','socket.io-emitter','queue','from','emit','queue_id','account','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','save'];(function(_0x1a6ac3,_0x59fa91){var _0x156530=function(_0x568795){while(--_0x568795){_0x1a6ac3['push'](_0x1a6ac3['shift']());}};_0x156530(++_0x59fa91);}(_0xaa35,0x171));var _0x5aa3=function(_0x40d8d7,_0x30dd5e){_0x40d8d7=_0x40d8d7-0x0;var _0x3454cc=_0xaa35[_0x40d8d7];return _0x3454cc;};'use strict';var schema=require(_0x5aa3('0x0'));var _=require(_0x5aa3('0x1'));var util=require('util');var seqqueue=require(_0x5aa3('0x2'));var moment=require(_0x5aa3('0x3'));var Redis=require('ioredis');var config=require(_0x5aa3('0x4'));var logger=require(_0x5aa3('0x5'))(_0x5aa3('0x6'));var strategy=require(_0x5aa3('0x7'));config['redis']=_['defaults'](config[_0x5aa3('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x5aa3('0x9'))(new Redis(config[_0x5aa3('0x8')]));var attributes=['id','queue_id','account',_0x5aa3('0xa'),_0x5aa3('0xb'),'joinAt'];function emit(_0x31b6c9,_0x436daf,_0x3f1129){io['to'](_0x31b6c9)[_0x5aa3('0xc')](_0x436daf,_0x3f1129);}function emitChannelQueueInteraction(_0x57a7e6,_0x44f3a6,_0x48770f,_0x186171,_0x2403a0,_0x470502,_0x8aac40,_0x549629){_0x48770f[_0x5aa3('0xd')]=_0x549629;_0x48770f[_0x5aa3('0xa')]=_0x44f3a6;_0x48770f[_0x5aa3('0xe')]=_0x186171;_0x48770f['id']=_0x2403a0;if(_0x470502){_0x8aac40[util[_0x5aa3('0xf')](_0x5aa3('0x10'),_0x57a7e6)][_0x2403a0]=_[_0x5aa3('0x11')](_0x48770f,attributes);}else{delete _0x8aac40[util[_0x5aa3('0xf')](_0x5aa3('0x10'),_0x57a7e6)][_0x2403a0];}emit(util[_0x5aa3('0xf')](_0x5aa3('0x12'),_0x57a7e6,_0x44f3a6),util['format'](_0x5aa3('0x13'),_0x57a7e6,_0x470502?_0x5aa3('0x14'):_0x5aa3('0x15')),_['pick'](_0x48770f,attributes));}var rpc={'openchannelQueueReport':require(_0x5aa3('0x16')),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require(_0x5aa3('0x17')),'smsQueueReport':require(_0x5aa3('0x18')),'faxQueueReport':require('../../rpc/faxQueueReport')};var queue=schema({'name':{'type':'string','required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':'number','message':_0x5aa3('0x19')}});function startRouting(_0x2cd48c,_0x2efc21,_0x913ead,_0x5c575f){if(_0x2cd48c&&_0x2efc21&&_0x913ead){_0x2efc21[_0x5aa3('0x1a')]+=0x1;var _0x5ef0ca={'uniqueid':_0x2cd48c,'from':_0x913ead[_0x5aa3('0x1b')]?_0x913ead[_0x5aa3('0x1b')]['from']:'','joinAt':moment()[_0x5aa3('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x913ead[_0x5aa3('0x1c')]?_0x913ead['contact']['id']:null,'ListId':_0x913ead[_0x5aa3('0x1d')]?_0x913ead[_0x5aa3('0x1d')]['id']:null};_0x5ef0ca[_['upperFirst'](_0x913ead[_0x5aa3('0x1e')])+_0x5aa3('0x1f')]=_0x2efc21['id']||null;_0x5ef0ca[_[_0x5aa3('0x20')](_0x913ead[_0x5aa3('0x1e')])+'InteractionId']=_0x913ead[_0x5aa3('0x21')]?_0x913ead[_0x5aa3('0x21')]['id']:null;_0x5ef0ca[_[_0x5aa3('0x20')](_0x913ead['channel'])+'MessageId']=_0x913ead[_0x5aa3('0x22')]?_0x913ead[_0x5aa3('0x22')]['id']:null;_0x5ef0ca[_[_0x5aa3('0x20')](_0x913ead[_0x5aa3('0x1e')])+(_0x913ead[_0x5aa3('0x1e')]!==_0x5aa3('0x23')?_0x5aa3('0x24'):'WebsiteId')]=_0x913ead[_0x5aa3('0xe')]?_0x913ead[_0x5aa3('0xe')]['id']:null;logger[_0x5aa3('0x25')](util['format']('[%s][START:QUEUE][NAME:%s]',_0x2cd48c,_0x2efc21[_0x5aa3('0x26')]));emitChannelQueueInteraction(_0x913ead[_0x5aa3('0x1e')],_0x2efc21[_0x5aa3('0x26')],_0x5ef0ca,_0x913ead[_0x5aa3('0xe')]['name'],_0x913ead[_0x5aa3('0x22')]['id'],!![],_0x5c575f,_0x2efc21['id']);if(rpc[_0x913ead[_0x5aa3('0x1e')]+_0x5aa3('0x27')]){return rpc[_0x913ead[_0x5aa3('0x1e')]+_0x5aa3('0x27')]['create'](_0x5ef0ca)[_0x5aa3('0x28')](function(_0x2e1bee){logger['error']('create\x20queue\x20report');});}}}function stopRouting(_0x56d4d6,_0x197bd0,_0x2fd6cf,_0x5cb503){if(_0x56d4d6&&_0x197bd0){_0x197bd0[_0x5aa3('0x1a')]-=0x1;var _0x555127={'leaveAt':moment()[_0x5aa3('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()['format'](_0x5aa3('0x29')),'reason':_0x5aa3('0x2a')};logger[_0x5aa3('0x25')](util[_0x5aa3('0xf')](_0x5aa3('0x2b'),_0x56d4d6,_0x197bd0[_0x5aa3('0x26')]));emitChannelQueueInteraction(_0x2fd6cf[_0x5aa3('0x1e')],_0x197bd0[_0x5aa3('0x26')],_0x2fd6cf[_0x5aa3('0x1b')],_0x2fd6cf['account'][_0x5aa3('0x26')],_0x2fd6cf['message']['id'],![],_0x5cb503,_0x197bd0['id']);if(rpc[_0x2fd6cf['channel']+_0x5aa3('0x27')]){return rpc[_0x2fd6cf[_0x5aa3('0x1e')]+_0x5aa3('0x27')][_0x5aa3('0x2c')](_0x56d4d6,_0x555127)['catch'](function(_0x1780e9){logger[_0x5aa3('0x2d')](_0x5aa3('0x2e'));});}}}function endRouting(_0x4cba76,_0x3b9dba,_0x18ebae,_0x413b0a){if(_0x4cba76&&_0x3b9dba){_0x3b9dba[_0x5aa3('0x1a')]-=0x1;var _0xfc8886={'leaveAt':moment()[_0x5aa3('0xf')](_0x5aa3('0x29')),'exitAt':moment()[_0x5aa3('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x5aa3('0x2f')};logger[_0x5aa3('0x25')](util[_0x5aa3('0xf')]('[%s][END:QUEUE][NAME:%s]',_0x4cba76,_0x3b9dba[_0x5aa3('0x26')]));emitChannelQueueInteraction(_0x18ebae[_0x5aa3('0x1e')],_0x3b9dba[_0x5aa3('0x26')],_0x18ebae['body'],_0x18ebae['account'][_0x5aa3('0x26')],_0x18ebae[_0x5aa3('0x22')]['id'],![],_0x413b0a);if(rpc[_0x18ebae[_0x5aa3('0x1e')]+_0x5aa3('0x27')]){return rpc[_0x18ebae['channel']+_0x5aa3('0x27')]['update'](_0x4cba76,_0xfc8886)[_0x5aa3('0x28')](function(_0x13c103){logger[_0x5aa3('0x2d')](_0x5aa3('0x2e'));});}}}function handleFindQueue(_0x6a68b9){return function(_0x3ab1ef){return _0x3ab1ef[_0x5aa3('0x26')][_0x5aa3('0x30')]()===_0x6a68b9[_0x5aa3('0x30')]();};}exports['consequence']=function(_0x217288,_0x1f450f,_0x850a0f,_0x5addd8){return function(_0x58eaa7){try{var _0x244730={'name':_0x1f450f[0x0],'timeout':_0x1f450f[0x1]};var _0x40b6c0=queue[_0x5aa3('0x0')](_0x244730,{'typecast':!![]});if(_0x40b6c0[_0x5aa3('0x31')]){logger[_0x5aa3('0x2d')](_0x5aa3('0x32'),_0x217288,_['map'](_0x40b6c0,_0x5aa3('0x22'))['join'](',\x20'));_0x58eaa7[_0x5aa3('0x33')]();}else{var _0x310d85=_[_0x5aa3('0x34')](_0x850a0f[_0x5addd8[_0x5aa3('0x1e')]+_0x5aa3('0x35')],handleFindQueue(_0x244730[_0x5aa3('0x26')]));if(_0x310d85){startRouting(_0x217288,_0x310d85,_0x5addd8,_0x850a0f);var _0x468a05=(_0x310d85['timeout']||0xa)*0x3e8;var _0xbdfca1=(_0x244730[_0x5aa3('0x2f')]||0x14)*0x3e8;var _0xe80a7f,_0x29bdbb;if(_0x468a05>_0xbdfca1){_0xbdfca1=_0x468a05;}var _0x5d2b1f=seqqueue[_0x5aa3('0x36')](_0x468a05);_0x5d2b1f['id']=_0x217288;_0x5d2b1f[_0x5aa3('0x37')]=_0x468a05;_0x5d2b1f['qtimeout']=_0xbdfca1;_0x5d2b1f[_0x5aa3('0x1e')]=_0x5addd8[_0x5aa3('0x1e')];_0x850a0f[_0x5aa3('0x38')][_0x217288]['on'](_0x5aa3('0x39'),function(){stopRouting(_0x217288,_0x310d85,_0x5addd8,_0x850a0f);_0x5d2b1f[_0x5aa3('0x3a')](!![]);clearTimeout(_0xe80a7f);_0xe80a7f=undefined;if(_0x850a0f[_0x5aa3('0x38')][_0x217288]){delete _0x850a0f[_0x5aa3('0x38')][_0x217288];}logger[_0x5aa3('0x25')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x217288);_0x58eaa7['stop']();});_0xe80a7f=setTimeout(function(){endRouting(_0x217288,_0x310d85,_0x5addd8,_0x850a0f);clearTimeout(_0xe80a7f);_0x5d2b1f[_0x5aa3('0x3a')](!![]);logger['info']('[%s][QUEUE]\x20ROUTING\x20END',_0x217288);_0x58eaa7['next']();},_0xbdfca1);switch(_0x310d85[_0x5aa3('0x3b')]){case _0x5aa3('0x3c'):strategy[_0x5aa3('0x3c')](_0x5d2b1f,_0x310d85,_0x850a0f,_0x5addd8);break;default:strategy[_0x5aa3('0x3d')](_0x5d2b1f,_0x310d85,_0x850a0f,_0x5addd8);}}else{logger[_0x5aa3('0x2d')](_0x5aa3('0x3e'),_0x217288,_0x244730[_0x5aa3('0x26')]);_0x58eaa7[_0x5aa3('0x33')]();}}}catch(_0x35c383){console[_0x5aa3('0x3f')](_0x35c383);logger[_0x5aa3('0x2d')](_0x5aa3('0x32'),_0x217288,_0x35c383[_0x5aa3('0x40')]);_0x58eaa7['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/agent.js b/server/services/routing/server/applications/strategy/agent.js index 93ee1f8..a6dceb3 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 _0x9585=['routing','notificationId','squeue','realtime','push','handleRun','handleTimeout','timeout','drained','handleDrained','bind','prototype','info','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','agent','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','busy','busyQueue','showNotification','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','hideNotification','STOP','TIMEOUT','exports','uuid','../../../../../config/logger'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x9585,0x15e));var _0x5958=function(_0x105086,_0x4ebc35){_0x105086=_0x105086-0x0;var _0x4bb1d1=_0x9585[_0x105086];return _0x4bb1d1;};'use strict';var _=require('lodash');var uuid=require(_0x5958('0x0'));var util=require('./util');var logger=require(_0x5958('0x1'))(_0x5958('0x2'));var Agent=function(_0x384f6c,_0x1a8c5e,_0x35e63f,_0x1f8027){this[_0x5958('0x3')]=uuid['v4']();this[_0x5958('0x4')]=_0x384f6c;this['agent']=_0x1a8c5e;this[_0x5958('0x5')]=_0x35e63f;this['routing']=_0x1f8027;this[_0x5958('0x4')][_0x5958('0x6')](this[_0x5958('0x7')]['bind'](this),this[_0x5958('0x8')]['bind'](this));this[_0x5958('0x4')]['on'](_0x5958('0x9'),this['handleTimeout']['bind'](this));this[_0x5958('0x4')]['on'](_0x5958('0xa'),this[_0x5958('0xb')][_0x5958('0xc')](this));};Agent[_0x5958('0xd')]['push']=function(){this[_0x5958('0x4')][_0x5958('0x6')](this[_0x5958('0x7')][_0x5958('0xc')](this),this[_0x5958('0x8')]['bind'](this));};Agent['prototype'][_0x5958('0xb')]=function(){this[_0x5958('0x8')](!![]);};Agent[_0x5958('0xd')]['handleRun']=function(_0x3c5d2b){logger[_0x5958('0xe')](_0x5958('0xf'),this[_0x5958('0x4')]['id'],this['agent']['id']);if(_[_0x5958('0x10')](this[_0x5958('0x5')][_0x5958('0x11')][this[_0x5958('0x12')]['id']])){logger[_0x5958('0xe')](_0x5958('0x13'),this['squeue']['id'],this[_0x5958('0x12')]['id']);setTimeout(this[_0x5958('0x6')][_0x5958('0xc')](this),0x3e8);}else{if(this[_0x5958('0x2')][_0x5958('0x14')]||util['isAgentAvailable'](this[_0x5958('0x4')]['id'],this[_0x5958('0x5')][_0x5958('0x11')][this[_0x5958('0x12')]['id']],this[_0x5958('0x4')]['channel'],![])){this[_0x5958('0x5')]['agents'][this['agent']['id']][_0x5958('0x15')]=!![];this['realtime'][_0x5958('0x11')][this[_0x5958('0x12')]['id']][_0x5958('0x16')]=undefined;util[_0x5958('0x17')](this[_0x5958('0x3')],this['squeue']['id'],this['realtime']['agents'][this[_0x5958('0x12')]['id']],null,this[_0x5958('0x2')]);util[_0x5958('0x18')](this[_0x5958('0x4')]['id'],this['realtime'][_0x5958('0x11')][this[_0x5958('0x12')]['id']],_0x5958('0x19')+(this['routing'][_0x5958('0x14')]?_0x5958('0x1a'):''));}else{logger[_0x5958('0xe')](_0x5958('0x1b'),this[_0x5958('0x4')]['id'],this[_0x5958('0x12')]['id']);setTimeout(this[_0x5958('0x6')]['bind'](this),0x3e8);}}};Agent['prototype'][_0x5958('0x8')]=function(_0x3d28d6){if(_[_0x5958('0x10')](this['realtime'][_0x5958('0x11')][this[_0x5958('0x12')]['id']])){return logger[_0x5958('0xe')](_0x5958('0x13'),this[_0x5958('0x4')]['id'],this[_0x5958('0x12')]['id']);}else{logger[_0x5958('0xe')]('[%s][AGENT]\x20timeout\x20with\x20%s',this['squeue']['id'],this[_0x5958('0x12')]['id']);util[_0x5958('0x1c')](this[_0x5958('0x3')],this['squeue']['id'],this['realtime'][_0x5958('0x11')][this[_0x5958('0x12')]['id']],null,this[_0x5958('0x2')]);this[_0x5958('0x5')][_0x5958('0x11')][this[_0x5958('0x12')]['id']][_0x5958('0x15')]=![];this['realtime'][_0x5958('0x11')][this['agent']['id']][_0x5958('0x16')]=undefined;util[_0x5958('0x18')](this['squeue']['id'],this['realtime'][_0x5958('0x11')][this[_0x5958('0x12')]['id']],_0x3d28d6?_0x5958('0x1d'):_0x5958('0x1e'));}if(!_0x3d28d6){setTimeout(this[_0x5958('0x6')]['bind'](this),0x3e8);}};function agent(_0x433c66,_0xecd835,_0x19a36c,_0x32789b){return new Agent(_0x433c66,_0xecd835,_0x19a36c,_0x32789b);}module[_0x5958('0x1f')]=agent; \ No newline at end of file +var _0xd01b=['push','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','info','[%s][AGENT]\x20try\x20with\x20%s','realtime','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','busy','busyQueue','showNotification','notificationId','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','isNil','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','STOP','exports','uuid','./util','squeue','agent','routing'];(function(_0x5a60a2,_0x5739ff){var _0x4d408c=function(_0x10f3d4){while(--_0x10f3d4){_0x5a60a2['push'](_0x5a60a2['shift']());}};_0x4d408c(++_0x5739ff);}(_0xd01b,0x11b));var _0xbd01=function(_0x5d1f74,_0x73554a){_0x5d1f74=_0x5d1f74-0x0;var _0x3ba9ca=_0xd01b[_0x5d1f74];return _0x3ba9ca;};'use strict';var _=require('lodash');var uuid=require(_0xbd01('0x0'));var util=require(_0xbd01('0x1'));var logger=require('../../../../../config/logger')('routing');var Agent=function(_0x163a38,_0x4afaa8,_0x3b8599,_0x449834){this['notificationId']=uuid['v4']();this[_0xbd01('0x2')]=_0x163a38;this[_0xbd01('0x3')]=_0x4afaa8;this['realtime']=_0x3b8599;this[_0xbd01('0x4')]=_0x449834;this[_0xbd01('0x2')][_0xbd01('0x5')](this[_0xbd01('0x6')][_0xbd01('0x7')](this),this[_0xbd01('0x8')][_0xbd01('0x7')](this));this['squeue']['on'](_0xbd01('0x9'),this[_0xbd01('0x8')]['bind'](this));this[_0xbd01('0x2')]['on'](_0xbd01('0xa'),this[_0xbd01('0xb')][_0xbd01('0x7')](this));};Agent[_0xbd01('0xc')][_0xbd01('0x5')]=function(){this['squeue'][_0xbd01('0x5')](this['handleRun'][_0xbd01('0x7')](this),this[_0xbd01('0x8')][_0xbd01('0x7')](this));};Agent[_0xbd01('0xc')][_0xbd01('0xb')]=function(){this[_0xbd01('0x8')](!![]);};Agent['prototype'][_0xbd01('0x6')]=function(_0x425ca2){logger[_0xbd01('0xd')](_0xbd01('0xe'),this[_0xbd01('0x2')]['id'],this[_0xbd01('0x3')]['id']);if(_['isNil'](this[_0xbd01('0xf')][_0xbd01('0x10')][this[_0xbd01('0x3')]['id']])){logger['info'](_0xbd01('0x11'),this[_0xbd01('0x2')]['id'],this[_0xbd01('0x3')]['id']);setTimeout(this['push'][_0xbd01('0x7')](this),0x3e8);}else{if(this[_0xbd01('0x4')][_0xbd01('0x12')]||util['isAgentAvailable'](this['squeue']['id'],this[_0xbd01('0xf')]['agents'][this[_0xbd01('0x3')]['id']],this[_0xbd01('0x2')]['channel'],![])){this[_0xbd01('0xf')][_0xbd01('0x10')][this['agent']['id']][_0xbd01('0x13')]=!![];this[_0xbd01('0xf')][_0xbd01('0x10')][this[_0xbd01('0x3')]['id']][_0xbd01('0x14')]=undefined;util[_0xbd01('0x15')](this[_0xbd01('0x16')],this[_0xbd01('0x2')]['id'],this[_0xbd01('0xf')][_0xbd01('0x10')][this[_0xbd01('0x3')]['id']],null,this[_0xbd01('0x4')]);util[_0xbd01('0x17')](this[_0xbd01('0x2')]['id'],this[_0xbd01('0xf')][_0xbd01('0x10')][this[_0xbd01('0x3')]['id']],_0xbd01('0x18')+(this[_0xbd01('0x4')][_0xbd01('0x12')]?_0xbd01('0x19'):''));}else{logger[_0xbd01('0xd')](_0xbd01('0x1a'),this[_0xbd01('0x2')]['id'],this[_0xbd01('0x3')]['id']);setTimeout(this['push']['bind'](this),0x3e8);}}};Agent[_0xbd01('0xc')][_0xbd01('0x8')]=function(_0xedecfb){if(_[_0xbd01('0x1b')](this[_0xbd01('0xf')][_0xbd01('0x10')][this[_0xbd01('0x3')]['id']])){return logger[_0xbd01('0xd')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this['squeue']['id'],this[_0xbd01('0x3')]['id']);}else{logger[_0xbd01('0xd')](_0xbd01('0x1c'),this[_0xbd01('0x2')]['id'],this['agent']['id']);util[_0xbd01('0x1d')](this[_0xbd01('0x16')],this['squeue']['id'],this[_0xbd01('0xf')][_0xbd01('0x10')][this[_0xbd01('0x3')]['id']],null,this['routing']);this['realtime'][_0xbd01('0x10')][this[_0xbd01('0x3')]['id']][_0xbd01('0x13')]=![];this[_0xbd01('0xf')][_0xbd01('0x10')][this[_0xbd01('0x3')]['id']]['busyQueue']=undefined;util[_0xbd01('0x17')](this['squeue']['id'],this[_0xbd01('0xf')]['agents'][this['agent']['id']],_0xedecfb?_0xbd01('0x1e'):'TIMEOUT');}if(!_0xedecfb){setTimeout(this[_0xbd01('0x5')][_0xbd01('0x7')](this),0x3e8);}};function agent(_0x2745ed,_0x4891fd,_0x22e530,_0xb1cc83){return new Agent(_0x2745ed,_0x4891fd,_0x22e530,_0xb1cc83);}module[_0xbd01('0x1f')]=agent; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/beepall.js b/server/services/routing/server/applications/strategy/beepall.js index ba001cb..f4e9896 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 _0xb803=['bind','handleTimeout','timeout','drained','prototype','handleDrained','isNil','Agents','length','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','writeLog','agents','RINGING','busy','busyQueue','name','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','hideNotification','TIMEOUT','exports','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','queue','realtime','squeue','push','handleRun'];(function(_0x43c4c6,_0x5b5fac){var _0x3a62ae=function(_0x1007ee){while(--_0x1007ee){_0x43c4c6['push'](_0x43c4c6['shift']());}};_0x3a62ae(++_0x5b5fac);}(_0xb803,0x153));var _0x3b80=function(_0x5f5fa8,_0x1927ca){_0x5f5fa8=_0x5f5fa8-0x0;var _0x189d51=_0xb803[_0x5f5fa8];return _0x189d51;};'use strict';var _=require(_0x3b80('0x0'));var uuid=require(_0x3b80('0x1'));var util=require(_0x3b80('0x2'));var logger=require(_0x3b80('0x3'))(_0x3b80('0x4'));var Beepall=function(_0x2424fd,_0x352f21,_0x534241,_0x3eabb8){this[_0x3b80('0x5')]=uuid['v4']();this['squeue']=_0x2424fd;this[_0x3b80('0x6')]=_0x352f21;this[_0x3b80('0x7')]=_0x534241;this[_0x3b80('0x4')]=_0x3eabb8;this[_0x3b80('0x8')][_0x3b80('0x9')](this[_0x3b80('0xa')][_0x3b80('0xb')](this),this[_0x3b80('0xc')][_0x3b80('0xb')](this));this[_0x3b80('0x8')]['on'](_0x3b80('0xd'),this['handleTimeout'][_0x3b80('0xb')](this));this[_0x3b80('0x8')]['on'](_0x3b80('0xe'),this['handleDrained'][_0x3b80('0xb')](this));};Beepall[_0x3b80('0xf')][_0x3b80('0x9')]=function(){this['squeue'][_0x3b80('0x9')](this['handleRun'][_0x3b80('0xb')](this),this['handleTimeout'][_0x3b80('0xb')](this));};Beepall['prototype'][_0x3b80('0x10')]=function(_0x3da3a4){this[_0x3b80('0xc')](!![]);};Beepall['prototype'][_0x3b80('0xa')]=function(_0x482a3c){var _0x27508f=!![];if(!_[_0x3b80('0x11')](this[_0x3b80('0x6')])&&!_['isNil'](this[_0x3b80('0x6')][_0x3b80('0x12')])&&this[_0x3b80('0x6')][_0x3b80('0x12')][_0x3b80('0x13')]>0x0){for(var _0x538f1c=0x0,_0x493a1d;_0x538f1c0x0){for(var _0x445d4b=0x0,_0x5eb22;_0x445d4b0x0&&_0x4a289f[_0x4c76f+'CurrentCapacity']>=_0x4a289f[_0x4c76f+_0x7045('0x23')]){writeLog(_0x2124fc,_0x4a289f,_0x4c76f[_0x7045('0x25')]()+_0x7045('0x26'));return![];}}return!![];};exports[_0x7045('0x27')]=function(_0x4f41e8,_0x258378,_0x349010,_0x37b288,_0x2e7e65){return sendNotification(!![],_0x4f41e8,_0x258378,_0x349010,_0x37b288,_0x2e7e65);};exports[_0x7045('0x28')]=function(_0x297a4d,_0x109a88,_0x4e078b,_0x408b46,_0x3360c5){return sendNotification(![],_0x297a4d,_0x109a88,_0x4e078b,_0x408b46,_0x3360c5);};exports[_0x7045('0x29')]=writeLog; \ No newline at end of file +var _0x4899=['hideNotification','writeLog','util','mustache','../../../../../config/logger','routing','redis','defaults','socket.io-emitter','emit','format','user:%s','split','\x20interaction','name','account','notificationSound','notificationShake','body','queue','msg','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','error','[%s][QUEUE]\x20%s','message','notification:%s','save','remove','info','[%s][QUEUE][AGENT:%s][STATUS:%s]','busy','online','Pause','Capacity','hasOwnProperty','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','showNotification'];(function(_0x3dea8b,_0x231a01){var _0x3a511e=function(_0x5a946d){while(--_0x5a946d){_0x3dea8b['push'](_0x3dea8b['shift']());}};_0x3a511e(++_0x231a01);}(_0x4899,0x142));var _0x9489=function(_0x5b0984,_0x2fdef4){_0x5b0984=_0x5b0984-0x0;var _0x14f6fb=_0x4899[_0x5b0984];return _0x14f6fb;};'use strict';var _=require('lodash');var util=require(_0x9489('0x0'));var utils=require('../utils');var Mustache=require(_0x9489('0x1'));var Redis=require('ioredis');var config=require('../../../../../config/environment');var logger=require(_0x9489('0x2'))(_0x9489('0x3'));config[_0x9489('0x4')]=_[_0x9489('0x5')](config[_0x9489('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x9489('0x6'))(new Redis(config[_0x9489('0x4')]));function emit(_0x2e1be2,_0x11229b,_0x42c910){io['to'](_0x2e1be2)[_0x9489('0x7')](_0x11229b,_0x42c910);}function sendNotification(_0x4fcd75,_0x591560,_0x3a9150,_0x1c8c08,_0x328233,_0x3eb597){io['to'](util[_0x9489('0x8')](_0x9489('0x9'),_0x1c8c08['name']))[_0x9489('0x7')]('user:save',_0x1c8c08);var _0x5c2c63=_0x3eb597||{};var _0x4890b5=_0x3a9150[_0x9489('0xa')]('.');var _0x86d0fb={'uniqueid':_0x591560,'channel':_0x4890b5[0x0],'id':_0x4890b5[0x1],'title':_0x4890b5[0x0]+_0x9489('0xb'),'interactionId':_0x4890b5[0x2],'queue':_0x328233?_0x328233[_0x9489('0xc')]:null,'sound':_0x5c2c63[_0x9489('0xd')][_0x9489('0xe')],'shake':_0x5c2c63[_0x9489('0xd')][_0x9489('0xf')]};try{if(!_0x5c2c63[_0x9489('0x10')]){_0x5c2c63[_0x9489('0x10')]={};}if(_0x328233){_0x5c2c63[_0x9489('0x10')][_0x9489('0x11')]=_0x328233;}else if(_0x5c2c63[_0x9489('0x10')][_0x9489('0x11')]){delete _0x5c2c63['body'][_0x9489('0x11')];}_0x86d0fb[_0x9489('0x12')]=utils['getMustacheRender'](_0x5c2c63[_0x9489('0xd')][_0x9489('0x13')],_0x5c2c63);}catch(_0x46e6ca){_0x86d0fb['msg']=_0x9489('0x14');logger[_0x9489('0x15')](util[_0x9489('0x8')](_0x9489('0x16'),_0x591560,_0x46e6ca[_0x9489('0x17')]));}io['to'](util[_0x9489('0x8')](_0x9489('0x9'),_0x1c8c08[_0x9489('0xc')]))[_0x9489('0x7')](util['format'](_0x9489('0x18'),_0x4fcd75?_0x9489('0x19'):_0x9489('0x1a')),_0x86d0fb);}function writeLog(_0x36e536,_0x32b48f,_0x49c18e){return logger[_0x9489('0x1b')](util['format'](_0x9489('0x1c'),_0x36e536,_0x32b48f['name'],_0x49c18e));}exports['isAgentAvailable']=function(_0x3b5118,_0x147fec,_0x1b9e86,_0x14c3ae){if(_0x147fec[_0x9489('0x1d')]){writeLog(_0x3b5118,_0x147fec,'BUSY');return![];}if(!_0x147fec[_0x9489('0x1e')]){writeLog(_0x3b5118,_0x147fec,'OFFLINE');return![];}if(_0x147fec[_0x1b9e86+_0x9489('0x1f')]){writeLog(_0x3b5118,_0x147fec,'PAUSE');return![];}if(_0x14c3ae&&_0x147fec['hasOwnProperty'](_0x1b9e86+_0x9489('0x20'))&&_0x147fec[_0x9489('0x21')](_0x1b9e86+'CurrentCapacity')){if(_0x147fec[_0x1b9e86+_0x9489('0x20')]>0x0&&_0x147fec[_0x1b9e86+_0x9489('0x22')]>=_0x147fec[_0x1b9e86+_0x9489('0x20')]){writeLog(_0x3b5118,_0x147fec,_0x1b9e86[_0x9489('0x23')]()+_0x9489('0x24'));return![];}}return!![];};exports[_0x9489('0x25')]=function(_0x31c846,_0x3b1bda,_0x26e2a1,_0x28c7f0,_0x191dee){return sendNotification(!![],_0x31c846,_0x3b1bda,_0x26e2a1,_0x28c7f0,_0x191dee);};exports[_0x9489('0x26')]=function(_0x3c7f5a,_0x20e01b,_0x2d6931,_0x106b5f,_0x4b9675){return sendNotification(![],_0x3c7f5a,_0x20e01b,_0x2d6931,_0x106b5f,_0x4b9675);};exports[_0x9489('0x27')]=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 5804b79..680cb0a 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 _0xe36c=['length','error','[%s][SYSTEM]\x20%s','map','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','info','[%s][SYSTEM]\x20commnad:\x20%s','replace','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','isObject','stringify','validate','shelljs','lodash','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0xe36c,0xe7));var _0xce36=function(_0x121de1,_0xd830d){_0x121de1=_0x121de1-0x0;var _0x68cd5b=_0xe36c[_0x121de1];return _0x68cd5b;};'use strict';var schema=require(_0xce36('0x0'));var sh=require(_0xce36('0x1'));var _=require(_0xce36('0x2'));var utils=require(_0xce36('0x3'));var logger=require(_0xce36('0x4'))(_0xce36('0x5'));var system=schema({'command':{'type':_0xce36('0x6'),'required':!![],'message':_0xce36('0x7')}});exports[_0xce36('0x8')]=function(_0x4b2cc8,_0x29f027){return function(_0x127830){try{var _0x1260f2={'command':_0x29f027[0x0]};var _0x1775e7=system['validate'](_0x1260f2,{'typecast':!![]});if(_0x1775e7[_0xce36('0x9')]){logger[_0xce36('0xa')](_0xce36('0xb'),_0x4b2cc8,_[_0xce36('0xc')](_0x1775e7,'message')['join'](',\x20'));logger['info'](_0xce36('0xd'),_0x4b2cc8);_0x127830[_0xce36('0xe')]();}else{var _0x1995ee=this;var _0xf79462=utils[_0xce36('0xf')](_0x29f027[0x0],this);logger[_0xce36('0x10')](_0xce36('0x11'),_0x4b2cc8,_0xf79462);sh['exec'](_['trim'](_0xf79462),function(_0x3f5e21,_0x1a2d46){logger[_0xce36('0x10')]('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x4b2cc8,_0x3f5e21);if(_0x3f5e21==0x0){var _0x1b9785=_0x1a2d46[_0xce36('0x12')](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x29f027[0x1])||_[_0xce36('0x13')](_0x29f027[0x1])){logger[_0xce36('0x10')](_0xce36('0x14'),_0x4b2cc8);_0x1995ee[_0xce36('0x15')][_0x29f027[0x1]]=_0x1b9785;}else{logger[_0xce36('0x10')]('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x4b2cc8,_0x29f027[0x1],_0x1b9785);_0x1995ee[_0xce36('0x15')][_0x29f027[0x1]]=_0x1b9785;}}_0x127830['next']();});}}catch(_0x14038c){logger['error'](_0xce36('0xb'),_0x4b2cc8,_[_0xce36('0x16')](_0x14038c)?JSON[_0xce36('0x17')](_0x14038c):_0x14038c);logger[_0xce36('0x10')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x4b2cc8);_0x127830[_0xce36('0xe')]();}};}; \ No newline at end of file +var _0x10f0=['message','join','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','info','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','isNil','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','stringify','validate','lodash','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','map'];(function(_0x1d70db,_0x142b63){var _0x3060c6=function(_0x347866){while(--_0x347866){_0x1d70db['push'](_0x1d70db['shift']());}};_0x3060c6(++_0x142b63);}(_0x10f0,0x1e9));var _0x010f=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x10f0[_0x122ef9];return _0x42fba0;};'use strict';var schema=require(_0x010f('0x0'));var sh=require('shelljs');var _=require(_0x010f('0x1'));var utils=require(_0x010f('0x2'));var logger=require(_0x010f('0x3'))(_0x010f('0x4'));var system=schema({'command':{'type':_0x010f('0x5'),'required':!![],'message':_0x010f('0x6')}});exports[_0x010f('0x7')]=function(_0x2e132f,_0x3d5d92){return function(_0x39deab){try{var _0x506d3f={'command':_0x3d5d92[0x0]};var _0x1abcf1=system[_0x010f('0x0')](_0x506d3f,{'typecast':!![]});if(_0x1abcf1[_0x010f('0x8')]){logger[_0x010f('0x9')]('[%s][SYSTEM]\x20%s',_0x2e132f,_[_0x010f('0xa')](_0x1abcf1,_0x010f('0xb'))[_0x010f('0xc')](',\x20'));logger['info'](_0x010f('0xd'),_0x2e132f);_0x39deab[_0x010f('0xe')]();}else{var _0x2a6901=this;var _0x579aea=utils[_0x010f('0xf')](_0x3d5d92[0x0],this);logger[_0x010f('0x10')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x2e132f,_0x579aea);sh[_0x010f('0x11')](_[_0x010f('0x12')](_0x579aea),function(_0x33982f,_0x3cd987){logger[_0x010f('0x10')](_0x010f('0x13'),_0x2e132f,_0x33982f);if(_0x33982f==0x0){var _0x534108=_0x3cd987['replace'](/(\r\n|\n|\r)/gm,'');if(_[_0x010f('0x14')](_0x3d5d92[0x1])||_['isEmpty'](_0x3d5d92[0x1])){logger['info'](_0x010f('0x15'),_0x2e132f);_0x2a6901[_0x010f('0x16')][_0x3d5d92[0x1]]=_0x534108;}else{logger[_0x010f('0x10')](_0x010f('0x17'),_0x2e132f,_0x3d5d92[0x1],_0x534108);_0x2a6901['body'][_0x3d5d92[0x1]]=_0x534108;}}_0x39deab['next']();});}}catch(_0x139b95){logger[_0x010f('0x9')]('[%s][SYSTEM]\x20%s',_0x2e132f,_['isObject'](_0x139b95)?JSON[_0x010f('0x18')](_0x139b95):_0x139b95);logger[_0x010f('0x10')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x2e132f);_0x39deab[_0x010f('0xe')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tag.js b/server/services/routing/server/applications/tag.js index 0a3e363..5ec45d1 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(_0x175f79,_0x7fed9){var _0x5005da=function(_0x27ab74){while(--_0x27ab74){_0x175f79['push'](_0x175f79['shift']());}};_0x5005da(++_0x7fed9);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'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 _0x7a54=['finally','error','validate','lodash','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','[%s][TAG]\x20%s','map','join','next','channel','Interaction','addTags','then','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','interaction','catch','stringify','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next'];(function(_0x91d1b0,_0x2029bd){var _0x513bc5=function(_0x792721){while(--_0x792721){_0x91d1b0['push'](_0x91d1b0['shift']());}};_0x513bc5(++_0x2029bd);}(_0x7a54,0x106));var _0x47a5=function(_0x43e889,_0x2be11e){_0x43e889=_0x43e889-0x0;var _0x2935db=_0x7a54[_0x43e889];return _0x2935db;};'use strict';var schema=require(_0x47a5('0x0'));var _=require(_0x47a5('0x1'));var rpc={'chatInteraction':require(_0x47a5('0x2')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x47a5('0x3')),'mailInteraction':require(_0x47a5('0x4')),'faxInteraction':require('../../rpc/faxInteraction')};var logger=require(_0x47a5('0x5'))(_0x47a5('0x6'));var tag=schema({'tag':{'type':_0x47a5('0x7'),'required':!![],'message':_0x47a5('0x8')}});exports[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629,_0x59199c,_0x343372){return function(_0x30e405){try{var _0x506eda={'tag':_0x3d5629[0x0]};var _0x194fb0=tag['validate'](_0x506eda,{'typecast':!![]});if(_0x194fb0['length']){logger['error'](_0x47a5('0xa'),_0x545a97,_[_0x47a5('0xb')](_0x194fb0,'message')[_0x47a5('0xc')](',\x20'));logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x545a97);_0x30e405[_0x47a5('0xd')]();}else{var _0x69e4d4={'ids':[_0x3d5629[0x0]]};if(rpc[_0x343372[_0x47a5('0xe')]+_0x47a5('0xf')]){rpc[_0x343372[_0x47a5('0xe')]+_0x47a5('0xf')][_0x47a5('0x10')](_0x343372['interaction']['id'],_0x69e4d4)[_0x47a5('0x11')](function(_0x221b54){logger[_0x47a5('0x12')](_0x47a5('0x13'),_0x545a97,_0x3d5629[0x1],_0x343372[_0x47a5('0xe')],_0x343372[_0x47a5('0x14')]['id']);})[_0x47a5('0x15')](function(_0x190faa){logger['error'](_0x47a5('0xa'),_0x545a97,JSON[_0x47a5('0x16')](_0x190faa));logger[_0x47a5('0x12')](_0x47a5('0x17'),_0x545a97);})[_0x47a5('0x18')](function(){_0x30e405['next']();});}}}catch(_0x549de3){logger[_0x47a5('0x19')]('[%s][TAG]\x20%s',_0x545a97,_['isObject'](_0x549de3)?JSON[_0x47a5('0x16')](_0x549de3):_0x549de3);logger[_0x47a5('0x12')](_0x47a5('0x17'),_0x545a97);_0x30e405[_0x47a5('0xd')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/utils.js b/server/services/routing/server/applications/utils.js index 1cd14a5..f19066a 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 _0x19da=['merge','contact','message','interaction','list','lodash','render'];(function(_0x3b0af2,_0xf0ffbd){var _0x51aa38=function(_0x5535e7){while(--_0x5535e7){_0x3b0af2['push'](_0x3b0af2['shift']());}};_0x51aa38(++_0xf0ffbd);}(_0x19da,0x9f));var _0xa19d=function(_0x2ed7d1,_0x363741){_0x2ed7d1=_0x2ed7d1-0x0;var _0x38ae3c=_0x19da[_0x2ed7d1];return _0x38ae3c;};'use strict';var Mustache=require('mustache');var _=require(_0xa19d('0x0'));module['exports']={'getMustacheRender':function(_0x45747d,_0x5ba569){return Mustache[_0xa19d('0x1')](_0x45747d,_[_0xa19d('0x2')](_0x5ba569['body'],{'contact':_0x5ba569[_0xa19d('0x3')],'message':_0x5ba569[_0xa19d('0x4')],'account':_0x5ba569['account'],'interaction':_0x5ba569[_0xa19d('0x5')],'list':_0x5ba569[_0xa19d('0x6')]}))||'';}}; \ No newline at end of file +var _0x0207=['body','contact','message','account','lodash','render','merge'];(function(_0x53b53e,_0x498437){var _0xbb6179=function(_0x3975eb){while(--_0x3975eb){_0x53b53e['push'](_0x53b53e['shift']());}};_0xbb6179(++_0x498437);}(_0x0207,0x162));var _0x7020=function(_0x2dc343,_0xf015a2){_0x2dc343=_0x2dc343-0x0;var _0x51eac5=_0x0207[_0x2dc343];return _0x51eac5;};'use strict';var Mustache=require('mustache');var _=require(_0x7020('0x0'));module['exports']={'getMustacheRender':function(_0x49775a,_0x1a481c){return Mustache[_0x7020('0x1')](_0x49775a,_[_0x7020('0x2')](_0x1a481c[_0x7020('0x3')],{'contact':_0x1a481c[_0x7020('0x4')],'message':_0x1a481c[_0x7020('0x5')],'account':_0x1a481c[_0x7020('0x6')],'interaction':_0x1a481c['interaction'],'list':_0x1a481c['list']}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 4114444..1bffbda 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 _0x4250=['error','Please\x20create\x20a\x20new\x20file\x20under','Applications\x20executed','matchPath','emit','No\x20applications\x20to\x20execute','stack','channel','QueueReport','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','agent','agents','busy','end','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','chatQueues','loggedIn','name','paused','waiting','mailQueues','available','openchannelQueues','smsQueues','faxQueues','values','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','faxQueuesWaitingInteractions','http','stringify','127.0.0.1','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','../../../config/logger','../rpc/openchannelQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../lib/rule-engine','%s.%s.%s','IntervalId','isNil','map','Intervals','interval','listen','rules','message','interaction','applications','isArray','length','app','.js','toLowerCase','autoreply','appdata','split','push','slice','join','tag','TagId','format','./interval','condition','intervals','./applications/','consequence','priority','info','on\x20interval','\x20|\x20'];(function(_0x576170,_0x1712ae){var _0x397c70=function(_0x2eb9de){while(--_0x2eb9de){_0x576170['push'](_0x576170['shift']());}};_0x397c70(++_0x1712ae);}(_0x4250,0x178));var _0x0425=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0x4250[_0x521929];return _0x632436;};'use strict';var _=require(_0x0425('0x0'));var util=require(_0x0425('0x1'));var path=require(_0x0425('0x2'));var fs=require('fs');var jayson=require(_0x0425('0x3'));var BPromise=require(_0x0425('0x4'));var uuid=require('uuid');var config=require('../../../config/environment');var logger=require(_0x0425('0x5'))('routing');var rpc={'openchannelQueueReport':require(_0x0425('0x6'))};var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0x0425('0x7')),'smsQueueReport':require(_0x0425('0x8')),'faxQueueReport':require('../rpc/faxQueueReport')};var RuleEngine=require(_0x0425('0x9'));function getId(_0x4ddc36,_0x5c8125,_0x2305c3){return util['format'](_0x0425('0xa'),_0x4ddc36,_0x5c8125||0x0,_0x2305c3||0x0);}function getIntervals(_0x5275e1,_0x36ba7d){var _0x1df40f=[];if(!_['isNil'](_0x36ba7d[_0x0425('0xb')])&&!_[_0x0425('0xc')](_0x5275e1[_0x36ba7d[_0x0425('0xb')]])&&!_[_0x0425('0xc')](_0x5275e1[_0x36ba7d['IntervalId']]['Intervals'])){_0x1df40f=_[_0x0425('0xd')](_0x5275e1[_0x36ba7d[_0x0425('0xb')]][_0x0425('0xe')],_0x0425('0xf'));}else if(!_['isNil'](_0x36ba7d[_0x0425('0xf')])){_0x1df40f=[_0x36ba7d['interval']];}return _0x1df40f;}exports[_0x0425('0x10')]=function(_0x133209){_0x133209[_0x0425('0x11')]={};return new BPromise(function(_0x5e26e3,_0x13897a){var _0x5bb967={'Start':function(_0x3f9e9e){var _0x39a6f6=this;return new Promise(function(_0x2b0092,_0x350a03){if(_0x3f9e9e){try{var _0xabf369=[];var _0x37a64f=getId(_0x3f9e9e['channel'],_0x3f9e9e['message']?_0x3f9e9e[_0x0425('0x12')]['id']:0x0,_0x3f9e9e[_0x0425('0x13')]?_0x3f9e9e[_0x0425('0x13')]['id']:0x0);if(_0x3f9e9e[_0x0425('0x14')]&&_[_0x0425('0x15')](_0x3f9e9e['applications'])&&_0x3f9e9e[_0x0425('0x14')][_0x0425('0x16')]){for(var _0x335a26=0x0;_0x335a26<_0x3f9e9e['applications'][_0x0425('0x16')];_0x335a26+=0x1){var _0x44311c=_0x3f9e9e[_0x0425('0x14')][_0x335a26];if(fs['existsSync'](path['join'](__dirname,_0x0425('0x14'),_0x44311c[_0x0425('0x17')]+_0x0425('0x18')))){var _0x7f9dc8=[];switch(_0x44311c[_0x0425('0x17')][_0x0425('0x19')]()){case _0x0425('0x1a'):var _0xd75a93=_0x44311c[_0x0425('0x1b')][_0x0425('0x1c')](',');_0x7f9dc8[_0x0425('0x1d')](_0xd75a93[0x0]);_0x7f9dc8['push'](_0xd75a93[_0x0425('0x1e')](0x1,_0xd75a93['length'])[_0x0425('0x1f')](','));break;case'dialogflow':var _0xd75a93=_0x44311c[_0x0425('0x1b')]['split'](',');_0x7f9dc8[_0x0425('0x1d')](_0xd75a93[0x0]);_0x7f9dc8[_0x0425('0x1d')](_0xd75a93[0x1]);_0x7f9dc8[_0x0425('0x1d')](_0xd75a93['slice'](0x2,_0xd75a93[_0x0425('0x16')])[_0x0425('0x1f')](','));break;case'amazonlex':var _0xd75a93=_0x44311c[_0x0425('0x1b')][_0x0425('0x1c')](',');_0x7f9dc8[_0x0425('0x1d')](_0xd75a93[0x0]);_0x7f9dc8['push'](_0xd75a93[0x1]);_0x7f9dc8[_0x0425('0x1d')](_0xd75a93[0x2]);_0x7f9dc8['push'](_0xd75a93[0x3]);_0x7f9dc8[_0x0425('0x1d')](_0xd75a93['slice'](0x4,_0xd75a93['length'])[_0x0425('0x1f')](','));break;case _0x0425('0x12'):_0x7f9dc8[_0x0425('0x1d')](_0x44311c['appdata']);break;case _0x0425('0x20'):_0x7f9dc8[_0x0425('0x1d')](_0x44311c[_0x0425('0x21')]);_0x7f9dc8[_0x0425('0x1d')](_0x44311c['appdata']);break;default:_0x7f9dc8=_[_0x0425('0xc')](_0x44311c[_0x0425('0x1b')])?[]:_0x44311c['appdata'][_0x0425('0x1c')](',');}var _0x3e589f={'id':util[_0x0425('0x22')]('%s:%s:%s',_0x37a64f,_0x44311c['id'],_0x44311c[_0x0425('0x17')]),'condition':require(_0x0425('0x23'))[_0x0425('0x24')](_0x37a64f,getIntervals(_0x133209[_0x0425('0x25')],_0x44311c),_0x133209),'consequence':require(_0x0425('0x26')+_0x44311c[_0x0425('0x17')])[_0x0425('0x27')](_0x37a64f,_0x7f9dc8,_0x133209,_0x3f9e9e),'p':_0x44311c[_0x0425('0x28')]||0x0};logger[_0x0425('0x29')]('Push\x20new\x20rule',_0x3e589f['id'],_0x0425('0x2a'),getIntervals(_0x133209[_0x0425('0x25')],_0x44311c)['join'](_0x0425('0x2b')));_0xabf369[_0x0425('0x1d')](_0x3e589f);}else{logger[_0x0425('0x2c')](_0x0425('0x2d'),path[_0x0425('0x1f')](__dirname,_0x0425('0x14'),_0x44311c[_0x0425('0x17')]+_0x0425('0x18')));}}_0x133209[_0x0425('0x11')][_0x37a64f]=new RuleEngine(_0xabf369);_0x133209[_0x0425('0x11')][_0x37a64f]['execute'](_0x3f9e9e,function(_0x22eac2){logger[_0x0425('0x29')](_0x0425('0x2e'),JSON['stringify'](_0x22eac2[_0x0425('0x2f')]));if(_0x133209[_0x0425('0x11')][_0x37a64f]){_0x133209['rules'][_0x37a64f][_0x0425('0x30')]('end');}});return _0x2b0092({'code':0xc8,'message':_0x3f9e9e});}else{logger[_0x0425('0x29')](_0x0425('0x31'));return _0x2b0092({'code':0xc8,'message':_0x3f9e9e});}}catch(_0x444913){logger[_0x0425('0x2c')](_0x444913[_0x0425('0x32')]);return _0x350a03(_0x39a6f6[_0x0425('0x2c')](0x1f4,_0x444913));}}return _0x350a03('routing\x20is\x20empty');});},'AcceptMessage':function(_0x26ded5){var _0x1899b0=this;return new Promise(function(_0x233f02,_0x4effc3){if(_0x26ded5[_0x0425('0x12')]&&_0x26ded5['message']['id']){try{var _0x502aa2=getId(_0x26ded5['channel'],_0x26ded5[_0x0425('0x12')]?_0x26ded5[_0x0425('0x12')]['id']:0x0,_0x26ded5[_0x0425('0x13')]?_0x26ded5[_0x0425('0x13')]['id']:0x0);if(_0x133209[_0x0425('0x11')][_0x502aa2]){_0x133209[_0x0425('0x11')][_0x502aa2]['emit']('end');if(rpc[_0x26ded5[_0x0425('0x33')]+_0x0425('0x34')]){rpc[_0x26ded5['channel']+_0x0425('0x34')]['update'](_0x502aa2,{'UserId':_0x26ded5[_0x0425('0x12')][_0x0425('0x35')]})[_0x0425('0x36')](function(_0x26a879){logger[_0x0425('0x2c')](_0x0425('0x37'));});}}return _0x233f02({'code':0xc8,'message':_0x26ded5});}catch(_0x3bef6d){logger[_0x0425('0x2c')](_0x3bef6d['stack']);return _0x4effc3(_0x1899b0[_0x0425('0x2c')](0x1f4,_0x3bef6d));}}logger['error'](_0x0425('0x38'));return _0x4effc3(_0x1899b0['error'](0x1f4,_0x0425('0x38')));});},'RejectMessage':function(_0x35e293){var _0x554bcb=this;return new Promise(function(_0x3a16fc,_0x385f20){if(_0x35e293[_0x0425('0x39')]&&_0x35e293[_0x0425('0x39')]['id']){try{if(_0x133209['agents'][_0x35e293['agent']['id']]){_0x133209[_0x0425('0x3a')][_0x35e293[_0x0425('0x39')]['id']][_0x0425('0x3b')]=![];_0x133209[_0x0425('0x3a')][_0x35e293[_0x0425('0x39')]['id']]['busyQueue']=undefined;}return _0x3a16fc({'code':0xc8,'message':_0x35e293});}catch(_0x431e47){logger[_0x0425('0x2c')](_0x431e47[_0x0425('0x32')]);return _0x385f20(_0x554bcb[_0x0425('0x2c')](0x1f4,_0x431e47));}}logger[_0x0425('0x2c')](_0x0425('0x38'));return _0x385f20(_0x554bcb[_0x0425('0x2c')](0x1f4,_0x0425('0x38')));});},'AbandonInteraction':function(_0x2daabd){var _0x113bb1=this;return new Promise(function(_0x16b4c5,_0x19c6be){if(_0x2daabd['channel']&&_0x2daabd[_0x0425('0x13')]&&_0x2daabd[_0x0425('0x13')]['id']){try{var _0x277baa=getId(_0x2daabd[_0x0425('0x33')],_0x2daabd[_0x0425('0x12')]?_0x2daabd[_0x0425('0x12')]['id']:0x0,_0x2daabd[_0x0425('0x13')]?_0x2daabd[_0x0425('0x13')]['id']:0x0);if(_0x133209[_0x0425('0x11')][_0x277baa]){_0x133209[_0x0425('0x11')][_0x277baa][_0x0425('0x30')](_0x0425('0x3c'));}return _0x16b4c5({'code':0xc8,'message':_0x2daabd});}catch(_0x17b14f){logger[_0x0425('0x2c')](_0x17b14f[_0x0425('0x32')]);return _0x19c6be(_0x113bb1[_0x0425('0x2c')](0x1f4,_0x17b14f));}}logger[_0x0425('0x2c')](_0x0425('0x38'));return _0x19c6be(_0x113bb1[_0x0425('0x2c')](0x1f4,_0x0425('0x38')));});},'AgentCapacity':function(_0x3ea18d){var _0x45095e=this;return new Promise(function(_0x26ada9,_0x2c3f73){if(_0x133209['agents'][_0x0425('0x3d')](_0x3ea18d['id'])){for(var _0x2ed0c0 in _0x3ea18d[_0x0425('0x3e')]){if(_0x3ea18d[_0x0425('0x3e')][_0x0425('0x3d')](_0x2ed0c0)){if(_0x133209[_0x0425('0x3a')][_0x3ea18d['id']][_0x0425('0x3d')](_0x2ed0c0+_0x0425('0x3f'))){_0x133209[_0x0425('0x3a')][_0x3ea18d['id']][_0x2ed0c0+_0x0425('0x3f')]=parseInt(_0x3ea18d[_0x0425('0x3e')][_0x2ed0c0],0xa);}}}_0x133209[_0x0425('0x3a')][_0x3ea18d['id']][_0x0425('0x40')]();return _0x26ada9({'code':0xc8,'message':_0x133209[_0x0425('0x3a')][_0x3ea18d['id']]});}else{return _0x2c3f73(_0x45095e[_0x0425('0x2c')](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x3ff04e){return new Promise(function(_0x57b9b8,_0x192e59){var _0x483f1f=_['values'](_0x133209[_0x0425('0x3a')]);_0x57b9b8({'count':_0x483f1f[_0x0425('0x16')],'rows':_0x483f1f});});},'ChatQueues':function(_0x58f1b5){return new Promise(function(_0x26d7e6,_0x4ed9bf){var _0x109e31=[];for(var _0x35e085 in _0x133209[_0x0425('0x41')]){if(_0x133209[_0x0425('0x41')][_0x0425('0x3d')](_0x35e085)){var _0x820503=_0x133209['chatQueues'][_0x35e085];var _0x5de2bd={'id':_0x820503['id'],'available':_0x820503['available'],'loggedIn':_0x820503[_0x0425('0x42')],'name':_0x820503[_0x0425('0x43')],'paused':_0x820503[_0x0425('0x44')],'waiting':_0x820503[_0x0425('0x45')]};_0x109e31[_0x0425('0x1d')](_0x5de2bd);}}_0x26d7e6({'count':_0x109e31[_0x0425('0x16')],'rows':_0x109e31});});},'MailQueues':function(_0x381896){return new Promise(function(_0x234a41,_0x28865b){var _0x4aa601=[];for(var _0x5ad7bc in _0x133209[_0x0425('0x46')]){if(_0x133209[_0x0425('0x46')][_0x0425('0x3d')](_0x5ad7bc)){var _0xf081df=_0x133209[_0x0425('0x46')][_0x5ad7bc];var _0x177987={'id':_0xf081df['id'],'available':_0xf081df[_0x0425('0x47')],'loggedIn':_0xf081df[_0x0425('0x42')],'name':_0xf081df[_0x0425('0x43')],'paused':_0xf081df[_0x0425('0x44')],'waiting':_0xf081df[_0x0425('0x45')]};_0x4aa601[_0x0425('0x1d')](_0x177987);}}_0x234a41({'count':_0x4aa601[_0x0425('0x16')],'rows':_0x4aa601});});},'OpenchannelQueues':function(_0x4e3068){return new Promise(function(_0x5e942c,_0x38a056){var _0x79cf9c=[];for(var _0x2402a4 in _0x133209['openchannelQueues']){if(_0x133209[_0x0425('0x48')][_0x0425('0x3d')](_0x2402a4)){var _0x3db711=_0x133209[_0x0425('0x48')][_0x2402a4];var _0x4ddced={'id':_0x3db711['id'],'available':_0x3db711['available'],'loggedIn':_0x3db711[_0x0425('0x42')],'name':_0x3db711[_0x0425('0x43')],'paused':_0x3db711['paused'],'waiting':_0x3db711['waiting']};_0x79cf9c[_0x0425('0x1d')](_0x4ddced);}}_0x5e942c({'count':_0x79cf9c[_0x0425('0x16')],'rows':_0x79cf9c});});},'SmsQueues':function(_0xde69e9){return new Promise(function(_0x1bf6e4,_0x17b129){var _0x1d26e6=[];for(var _0x2a4c27 in _0x133209['smsQueues']){if(_0x133209[_0x0425('0x49')][_0x0425('0x3d')](_0x2a4c27)){var _0x54fe02=_0x133209[_0x0425('0x49')][_0x2a4c27];var _0x5e1135={'id':_0x54fe02['id'],'available':_0x54fe02[_0x0425('0x47')],'loggedIn':_0x54fe02['loggedIn'],'name':_0x54fe02[_0x0425('0x43')],'paused':_0x54fe02[_0x0425('0x44')],'waiting':_0x54fe02[_0x0425('0x45')]};_0x1d26e6[_0x0425('0x1d')](_0x5e1135);}}_0x1bf6e4({'count':_0x1d26e6[_0x0425('0x16')],'rows':_0x1d26e6});});},'FaxQueues':function(_0x3ec90){return new Promise(function(_0x2f4115,_0x1d5e95){var _0x1c9d83=[];for(var _0x4880dd in _0x133209['faxQueues']){if(_0x133209[_0x0425('0x4a')][_0x0425('0x3d')](_0x4880dd)){var _0x4f6469=_0x133209[_0x0425('0x4a')][_0x4880dd];var _0x391aba={'id':_0x4f6469['id'],'available':_0x4f6469[_0x0425('0x47')],'loggedIn':_0x4f6469[_0x0425('0x42')],'name':_0x4f6469[_0x0425('0x43')],'paused':_0x4f6469['paused'],'waiting':_0x4f6469[_0x0425('0x45')]};_0x1c9d83[_0x0425('0x1d')](_0x391aba);}}_0x2f4115({'count':_0x1c9d83[_0x0425('0x16')],'rows':_0x1c9d83});});},'ChatQueuesWaitingInteractions':function(_0x43ed7b){return new Promise(function(_0x4c87c8,_0x57a5b7){var _0x24bf43=_[_0x0425('0x4b')](_0x133209[_0x0425('0x4c')]);_0x4c87c8({'count':_0x24bf43['length'],'rows':_0x24bf43});});},'MailQueuesWaitingInteractions':function(_0x40c7b3){return new Promise(function(_0x538cfa,_0x2f0ce1){var _0x5df13f=_[_0x0425('0x4b')](_0x133209[_0x0425('0x4d')]);_0x538cfa({'count':_0x5df13f[_0x0425('0x16')],'rows':_0x5df13f});});},'OpenchannelQueuesWaitingInteractions':function(_0x3658a3){return new Promise(function(_0x20b018,_0x152d19){var _0x3c66f8=_[_0x0425('0x4b')](_0x133209[_0x0425('0x4e')]);_0x20b018({'count':_0x3c66f8[_0x0425('0x16')],'rows':_0x3c66f8});});},'SmsQueuesWaitingInteractions':function(_0x54bac4){return new Promise(function(_0x5bf3f2,_0x2a62fa){var _0x1a9626=_['values'](_0x133209['smsQueuesWaitingInteractions']);_0x5bf3f2({'count':_0x1a9626[_0x0425('0x16')],'rows':_0x1a9626});});},'FaxQueuesWaitingInteractions':function(_0x150081){return new Promise(function(_0x2f834b,_0x4d8f77){var _0x4757b6=_[_0x0425('0x4b')](_0x133209[_0x0425('0x4f')]);_0x2f834b({'count':_0x4757b6[_0x0425('0x16')],'rows':_0x4757b6});});}};var _0x3eda4c=jayson['server'](_0x5bb967)[_0x0425('0x50')]();_0x3eda4c['on'](_0x0425('0x2c'),function(_0x21de58){logger['error'](JSON[_0x0425('0x51')](_0x21de58));return _0x13897a(_0x21de58);});_0x3eda4c[_0x0425('0x10')](0x232c,_0x0425('0x52'),function(){console['log']('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x5e26e3(_0x0425('0x53')+0x232c);});});}; \ No newline at end of file +var _0x5bc1=['routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/faxQueueReport','../lib/rule-engine','format','isNil','IntervalId','Intervals','map','interval','listen','rules','channel','message','interaction','applications','isArray','length','join','app','.js','toLowerCase','autoreply','appdata','split','push','slice','dialogflow','TagId','./interval','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','execute','Applications\x20executed','emit','end','stack','routing\x20is\x20empty','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','agent','agents','busy','busyQueue','hasOwnProperty','capacity','CurrentCapacity','agent\x20not\x20found','values','chatQueues','available','waiting','mailQueues','name','paused','openchannelQueues','loggedIn','smsQueues','faxQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','faxQueuesWaitingInteractions','http','stringify','127.0.0.1','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','jayson/promise','uuid'];(function(_0x309222,_0x5e6d8f){var _0x5a762b=function(_0x48e144){while(--_0x48e144){_0x309222['push'](_0x309222['shift']());}};_0x5a762b(++_0x5e6d8f);}(_0x5bc1,0xf3));var _0x15bc=function(_0x58d092,_0x36a559){_0x58d092=_0x58d092-0x0;var _0xe2d411=_0x5bc1[_0x58d092];return _0xe2d411;};'use strict';var _=require(_0x15bc('0x0'));var util=require('util');var path=require('path');var fs=require('fs');var jayson=require(_0x15bc('0x1'));var BPromise=require('bluebird');var uuid=require(_0x15bc('0x2'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x15bc('0x3'));var rpc={'openchannelQueueReport':require(_0x15bc('0x4'))};var rpc={'openchannelQueueReport':require(_0x15bc('0x4')),'mailQueueReport':require(_0x15bc('0x5')),'chatQueueReport':require(_0x15bc('0x6')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require(_0x15bc('0x7'))};var RuleEngine=require(_0x15bc('0x8'));function getId(_0x1584c5,_0x46b20d,_0x350d9c){return util[_0x15bc('0x9')]('%s.%s.%s',_0x1584c5,_0x46b20d||0x0,_0x350d9c||0x0);}function getIntervals(_0x2aef36,_0x589fae){var _0x44b95c=[];if(!_[_0x15bc('0xa')](_0x589fae[_0x15bc('0xb')])&&!_[_0x15bc('0xa')](_0x2aef36[_0x589fae[_0x15bc('0xb')]])&&!_[_0x15bc('0xa')](_0x2aef36[_0x589fae[_0x15bc('0xb')]][_0x15bc('0xc')])){_0x44b95c=_[_0x15bc('0xd')](_0x2aef36[_0x589fae[_0x15bc('0xb')]]['Intervals'],_0x15bc('0xe'));}else if(!_[_0x15bc('0xa')](_0x589fae[_0x15bc('0xe')])){_0x44b95c=[_0x589fae[_0x15bc('0xe')]];}return _0x44b95c;}exports[_0x15bc('0xf')]=function(_0x333a74){_0x333a74[_0x15bc('0x10')]={};return new BPromise(function(_0x2e7af6,_0x167a8d){var _0x5d08bb={'Start':function(_0x246260){var _0x544d1c=this;return new Promise(function(_0x350a09,_0x4e44fa){if(_0x246260){try{var _0x450061=[];var _0x5dd64e=getId(_0x246260[_0x15bc('0x11')],_0x246260['message']?_0x246260[_0x15bc('0x12')]['id']:0x0,_0x246260['interaction']?_0x246260[_0x15bc('0x13')]['id']:0x0);if(_0x246260[_0x15bc('0x14')]&&_[_0x15bc('0x15')](_0x246260[_0x15bc('0x14')])&&_0x246260[_0x15bc('0x14')]['length']){for(var _0xc04e0e=0x0;_0xc04e0e<_0x246260[_0x15bc('0x14')][_0x15bc('0x16')];_0xc04e0e+=0x1){var _0xaeff77=_0x246260[_0x15bc('0x14')][_0xc04e0e];if(fs['existsSync'](path[_0x15bc('0x17')](__dirname,_0x15bc('0x14'),_0xaeff77[_0x15bc('0x18')]+_0x15bc('0x19')))){var _0x47024d=[];switch(_0xaeff77['app'][_0x15bc('0x1a')]()){case _0x15bc('0x1b'):var _0x36ba75=_0xaeff77[_0x15bc('0x1c')][_0x15bc('0x1d')](',');_0x47024d[_0x15bc('0x1e')](_0x36ba75[0x0]);_0x47024d[_0x15bc('0x1e')](_0x36ba75[_0x15bc('0x1f')](0x1,_0x36ba75[_0x15bc('0x16')])['join'](','));break;case _0x15bc('0x20'):var _0x36ba75=_0xaeff77[_0x15bc('0x1c')][_0x15bc('0x1d')](',');_0x47024d[_0x15bc('0x1e')](_0x36ba75[0x0]);_0x47024d[_0x15bc('0x1e')](_0x36ba75[0x1]);_0x47024d[_0x15bc('0x1e')](_0x36ba75['slice'](0x2,_0x36ba75[_0x15bc('0x16')])[_0x15bc('0x17')](','));break;case'amazonlex':var _0x36ba75=_0xaeff77[_0x15bc('0x1c')][_0x15bc('0x1d')](',');_0x47024d[_0x15bc('0x1e')](_0x36ba75[0x0]);_0x47024d[_0x15bc('0x1e')](_0x36ba75[0x1]);_0x47024d['push'](_0x36ba75[0x2]);_0x47024d[_0x15bc('0x1e')](_0x36ba75[0x3]);_0x47024d['push'](_0x36ba75[_0x15bc('0x1f')](0x4,_0x36ba75[_0x15bc('0x16')])[_0x15bc('0x17')](','));break;case _0x15bc('0x12'):_0x47024d['push'](_0xaeff77[_0x15bc('0x1c')]);break;case'tag':_0x47024d[_0x15bc('0x1e')](_0xaeff77[_0x15bc('0x21')]);_0x47024d['push'](_0xaeff77[_0x15bc('0x1c')]);break;default:_0x47024d=_[_0x15bc('0xa')](_0xaeff77['appdata'])?[]:_0xaeff77[_0x15bc('0x1c')][_0x15bc('0x1d')](',');}var _0x133cab={'id':util[_0x15bc('0x9')]('%s:%s:%s',_0x5dd64e,_0xaeff77['id'],_0xaeff77[_0x15bc('0x18')]),'condition':require(_0x15bc('0x22'))['condition'](_0x5dd64e,getIntervals(_0x333a74[_0x15bc('0x23')],_0xaeff77),_0x333a74),'consequence':require(_0x15bc('0x24')+_0xaeff77[_0x15bc('0x18')])[_0x15bc('0x25')](_0x5dd64e,_0x47024d,_0x333a74,_0x246260),'p':_0xaeff77[_0x15bc('0x26')]||0x0};logger[_0x15bc('0x27')](_0x15bc('0x28'),_0x133cab['id'],_0x15bc('0x29'),getIntervals(_0x333a74['intervals'],_0xaeff77)['join'](_0x15bc('0x2a')));_0x450061[_0x15bc('0x1e')](_0x133cab);}else{logger[_0x15bc('0x2b')]('Please\x20create\x20a\x20new\x20file\x20under',path[_0x15bc('0x17')](__dirname,_0x15bc('0x14'),_0xaeff77[_0x15bc('0x18')]+_0x15bc('0x19')));}}_0x333a74[_0x15bc('0x10')][_0x5dd64e]=new RuleEngine(_0x450061);_0x333a74[_0x15bc('0x10')][_0x5dd64e][_0x15bc('0x2c')](_0x246260,function(_0x4ea416){logger[_0x15bc('0x27')](_0x15bc('0x2d'),JSON['stringify'](_0x4ea416['matchPath']));if(_0x333a74['rules'][_0x5dd64e]){_0x333a74[_0x15bc('0x10')][_0x5dd64e][_0x15bc('0x2e')](_0x15bc('0x2f'));}});return _0x350a09({'code':0xc8,'message':_0x246260});}else{logger[_0x15bc('0x27')]('No\x20applications\x20to\x20execute');return _0x350a09({'code':0xc8,'message':_0x246260});}}catch(_0x3ce44f){logger[_0x15bc('0x2b')](_0x3ce44f[_0x15bc('0x30')]);return _0x4e44fa(_0x544d1c['error'](0x1f4,_0x3ce44f));}}return _0x4e44fa(_0x15bc('0x31'));});},'AcceptMessage':function(_0x20d588){var _0x11f6c3=this;return new Promise(function(_0x26ecda,_0x1d9477){if(_0x20d588[_0x15bc('0x12')]&&_0x20d588[_0x15bc('0x12')]['id']){try{var _0x2a5b68=getId(_0x20d588[_0x15bc('0x11')],_0x20d588[_0x15bc('0x12')]?_0x20d588[_0x15bc('0x12')]['id']:0x0,_0x20d588['interaction']?_0x20d588['interaction']['id']:0x0);if(_0x333a74[_0x15bc('0x10')][_0x2a5b68]){_0x333a74['rules'][_0x2a5b68][_0x15bc('0x2e')]('end');if(rpc[_0x20d588[_0x15bc('0x11')]+_0x15bc('0x32')]){rpc[_0x20d588[_0x15bc('0x11')]+'QueueReport'][_0x15bc('0x33')](_0x2a5b68,{'UserId':_0x20d588[_0x15bc('0x12')][_0x15bc('0x34')]})[_0x15bc('0x35')](function(_0xc4ea30){logger[_0x15bc('0x2b')](_0x15bc('0x36'));});}}return _0x26ecda({'code':0xc8,'message':_0x20d588});}catch(_0x3ba4ee){logger[_0x15bc('0x2b')](_0x3ba4ee[_0x15bc('0x30')]);return _0x1d9477(_0x11f6c3[_0x15bc('0x2b')](0x1f4,_0x3ba4ee));}}logger[_0x15bc('0x2b')](_0x15bc('0x37'));return _0x1d9477(_0x11f6c3['error'](0x1f4,_0x15bc('0x37')));});},'RejectMessage':function(_0x5c2c97){var _0x59f933=this;return new Promise(function(_0x15dd80,_0x492b64){if(_0x5c2c97['agent']&&_0x5c2c97[_0x15bc('0x38')]['id']){try{if(_0x333a74[_0x15bc('0x39')][_0x5c2c97['agent']['id']]){_0x333a74['agents'][_0x5c2c97['agent']['id']][_0x15bc('0x3a')]=![];_0x333a74[_0x15bc('0x39')][_0x5c2c97[_0x15bc('0x38')]['id']][_0x15bc('0x3b')]=undefined;}return _0x15dd80({'code':0xc8,'message':_0x5c2c97});}catch(_0x5e15fb){logger[_0x15bc('0x2b')](_0x5e15fb['stack']);return _0x492b64(_0x59f933['error'](0x1f4,_0x5e15fb));}}logger[_0x15bc('0x2b')]('message\x20is\x20empty');return _0x492b64(_0x59f933['error'](0x1f4,_0x15bc('0x37')));});},'AbandonInteraction':function(_0x25fe88){var _0x59b8b6=this;return new Promise(function(_0x3071ef,_0x2038a2){if(_0x25fe88[_0x15bc('0x11')]&&_0x25fe88[_0x15bc('0x13')]&&_0x25fe88[_0x15bc('0x13')]['id']){try{var _0x4bbc0f=getId(_0x25fe88[_0x15bc('0x11')],_0x25fe88[_0x15bc('0x12')]?_0x25fe88[_0x15bc('0x12')]['id']:0x0,_0x25fe88['interaction']?_0x25fe88[_0x15bc('0x13')]['id']:0x0);if(_0x333a74[_0x15bc('0x10')][_0x4bbc0f]){_0x333a74[_0x15bc('0x10')][_0x4bbc0f][_0x15bc('0x2e')](_0x15bc('0x2f'));}return _0x3071ef({'code':0xc8,'message':_0x25fe88});}catch(_0x28e97b){logger[_0x15bc('0x2b')](_0x28e97b['stack']);return _0x2038a2(_0x59b8b6['error'](0x1f4,_0x28e97b));}}logger[_0x15bc('0x2b')](_0x15bc('0x37'));return _0x2038a2(_0x59b8b6[_0x15bc('0x2b')](0x1f4,_0x15bc('0x37')));});},'AgentCapacity':function(_0x330af0){var _0x1c63b0=this;return new Promise(function(_0x213cdb,_0xcacdfc){if(_0x333a74[_0x15bc('0x39')][_0x15bc('0x3c')](_0x330af0['id'])){for(var _0x1ac0c1 in _0x330af0[_0x15bc('0x3d')]){if(_0x330af0[_0x15bc('0x3d')][_0x15bc('0x3c')](_0x1ac0c1)){if(_0x333a74[_0x15bc('0x39')][_0x330af0['id']][_0x15bc('0x3c')](_0x1ac0c1+_0x15bc('0x3e'))){_0x333a74[_0x15bc('0x39')][_0x330af0['id']][_0x1ac0c1+_0x15bc('0x3e')]=parseInt(_0x330af0['capacity'][_0x1ac0c1],0xa);}}}_0x333a74[_0x15bc('0x39')][_0x330af0['id']]['updateRealtime']();return _0x213cdb({'code':0xc8,'message':_0x333a74[_0x15bc('0x39')][_0x330af0['id']]});}else{return _0xcacdfc(_0x1c63b0[_0x15bc('0x2b')](0x1f4,_0x15bc('0x3f')));}});},'Agents':function(_0x47712b){return new Promise(function(_0x12994d,_0x4278fe){var _0x1e768e=_[_0x15bc('0x40')](_0x333a74[_0x15bc('0x39')]);_0x12994d({'count':_0x1e768e[_0x15bc('0x16')],'rows':_0x1e768e});});},'ChatQueues':function(_0x3c904c){return new Promise(function(_0x4b315c,_0x1a0fe7){var _0x91fb1c=[];for(var _0x412a8a in _0x333a74[_0x15bc('0x41')]){if(_0x333a74[_0x15bc('0x41')]['hasOwnProperty'](_0x412a8a)){var _0x130876=_0x333a74[_0x15bc('0x41')][_0x412a8a];var _0x285f11={'id':_0x130876['id'],'available':_0x130876[_0x15bc('0x42')],'loggedIn':_0x130876['loggedIn'],'name':_0x130876['name'],'paused':_0x130876['paused'],'waiting':_0x130876[_0x15bc('0x43')]};_0x91fb1c[_0x15bc('0x1e')](_0x285f11);}}_0x4b315c({'count':_0x91fb1c['length'],'rows':_0x91fb1c});});},'MailQueues':function(_0x2f0d42){return new Promise(function(_0x320c45,_0x21575a){var _0x24fd88=[];for(var _0x27af7c in _0x333a74[_0x15bc('0x44')]){if(_0x333a74[_0x15bc('0x44')][_0x15bc('0x3c')](_0x27af7c)){var _0x4b77c8=_0x333a74['mailQueues'][_0x27af7c];var _0x10651b={'id':_0x4b77c8['id'],'available':_0x4b77c8['available'],'loggedIn':_0x4b77c8['loggedIn'],'name':_0x4b77c8[_0x15bc('0x45')],'paused':_0x4b77c8[_0x15bc('0x46')],'waiting':_0x4b77c8[_0x15bc('0x43')]};_0x24fd88[_0x15bc('0x1e')](_0x10651b);}}_0x320c45({'count':_0x24fd88[_0x15bc('0x16')],'rows':_0x24fd88});});},'OpenchannelQueues':function(_0x4ce098){return new Promise(function(_0x49a2ff,_0x59c030){var _0x232011=[];for(var _0x3e9a34 in _0x333a74[_0x15bc('0x47')]){if(_0x333a74[_0x15bc('0x47')]['hasOwnProperty'](_0x3e9a34)){var _0x41f91a=_0x333a74[_0x15bc('0x47')][_0x3e9a34];var _0x565881={'id':_0x41f91a['id'],'available':_0x41f91a[_0x15bc('0x42')],'loggedIn':_0x41f91a[_0x15bc('0x48')],'name':_0x41f91a[_0x15bc('0x45')],'paused':_0x41f91a['paused'],'waiting':_0x41f91a[_0x15bc('0x43')]};_0x232011[_0x15bc('0x1e')](_0x565881);}}_0x49a2ff({'count':_0x232011[_0x15bc('0x16')],'rows':_0x232011});});},'SmsQueues':function(_0x380199){return new Promise(function(_0x54d092,_0x16336f){var _0x208719=[];for(var _0x25b19a in _0x333a74[_0x15bc('0x49')]){if(_0x333a74[_0x15bc('0x49')][_0x15bc('0x3c')](_0x25b19a)){var _0x5319a8=_0x333a74[_0x15bc('0x49')][_0x25b19a];var _0x13e9a7={'id':_0x5319a8['id'],'available':_0x5319a8[_0x15bc('0x42')],'loggedIn':_0x5319a8[_0x15bc('0x48')],'name':_0x5319a8[_0x15bc('0x45')],'paused':_0x5319a8[_0x15bc('0x46')],'waiting':_0x5319a8[_0x15bc('0x43')]};_0x208719['push'](_0x13e9a7);}}_0x54d092({'count':_0x208719[_0x15bc('0x16')],'rows':_0x208719});});},'FaxQueues':function(_0x134a5e){return new Promise(function(_0x2fdcbe,_0x22315f){var _0x10ef46=[];for(var _0x3585bd in _0x333a74['faxQueues']){if(_0x333a74[_0x15bc('0x4a')][_0x15bc('0x3c')](_0x3585bd)){var _0x547f60=_0x333a74['faxQueues'][_0x3585bd];var _0x2d5af8={'id':_0x547f60['id'],'available':_0x547f60[_0x15bc('0x42')],'loggedIn':_0x547f60[_0x15bc('0x48')],'name':_0x547f60['name'],'paused':_0x547f60[_0x15bc('0x46')],'waiting':_0x547f60[_0x15bc('0x43')]};_0x10ef46['push'](_0x2d5af8);}}_0x2fdcbe({'count':_0x10ef46[_0x15bc('0x16')],'rows':_0x10ef46});});},'ChatQueuesWaitingInteractions':function(_0x591902){return new Promise(function(_0xbc9a4b,_0x2f4bfb){var _0x310a68=_[_0x15bc('0x40')](_0x333a74[_0x15bc('0x4b')]);_0xbc9a4b({'count':_0x310a68[_0x15bc('0x16')],'rows':_0x310a68});});},'MailQueuesWaitingInteractions':function(_0x531ad1){return new Promise(function(_0x40cc7d,_0x45832c){var _0x5159e5=_[_0x15bc('0x40')](_0x333a74[_0x15bc('0x4c')]);_0x40cc7d({'count':_0x5159e5[_0x15bc('0x16')],'rows':_0x5159e5});});},'OpenchannelQueuesWaitingInteractions':function(_0x4b43a3){return new Promise(function(_0xfd0d8,_0x45441d){var _0x577808=_[_0x15bc('0x40')](_0x333a74['openchannelQueuesWaitingInteractions']);_0xfd0d8({'count':_0x577808[_0x15bc('0x16')],'rows':_0x577808});});},'SmsQueuesWaitingInteractions':function(_0x3874be){return new Promise(function(_0xea9495,_0x44d644){var _0x59ebd4=_['values'](_0x333a74['smsQueuesWaitingInteractions']);_0xea9495({'count':_0x59ebd4[_0x15bc('0x16')],'rows':_0x59ebd4});});},'FaxQueuesWaitingInteractions':function(_0x4d2736){return new Promise(function(_0x19e21b,_0x2e7c1e){var _0x1adc0c=_[_0x15bc('0x40')](_0x333a74[_0x15bc('0x4d')]);_0x19e21b({'count':_0x1adc0c['length'],'rows':_0x1adc0c});});}};var _0x4d6cc3=jayson['server'](_0x5d08bb)[_0x15bc('0x4e')]();_0x4d6cc3['on'](_0x15bc('0x2b'),function(_0x34a98c){logger[_0x15bc('0x2b')](JSON[_0x15bc('0x4f')](_0x34a98c));return _0x167a8d(_0x34a98c);});_0x4d6cc3[_0x15bc('0xf')](0x232c,_0x15bc('0x50'),function(){console['log'](_0x15bc('0x51'),0x232c);return _0x2e7af6('RPC\x20listening\x20on\x20port:'+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 3aa12b2..951b5f7 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 _0xdc11=['[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','Command','indexOf','true','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','util','bluebird','lodash','../../../config/logger','routing','client','http','then','error','message','result','catch','condition','rules','info'];(function(_0x2dd45b,_0x263c58){var _0x382d93=function(_0x36baff){while(--_0x36baff){_0x2dd45b['push'](_0x2dd45b['shift']());}};_0x382d93(++_0x263c58);}(_0xdc11,0x1cd));var _0x1dc1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdc11[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x1dc1('0x0'));var BPromise=require(_0x1dc1('0x1'));var jayson=require('jayson/promise');var _=require(_0x1dc1('0x2'));var logger=require(_0x1dc1('0x3'))(_0x1dc1('0x4'));var client=jayson[_0x1dc1('0x5')][_0x1dc1('0x6')]({'port':0x232a});function request(_0x563f41,_0x51ac35){return new BPromise(function(_0x9a8ba,_0x481926){return client['request'](_0x563f41,_0x51ac35)[_0x1dc1('0x7')](function(_0x4f04d1){if(_0x4f04d1[_0x1dc1('0x8')]){return _0x481926(_0x4f04d1[_0x1dc1('0x8')][_0x1dc1('0x9')]);}else{return _0x9a8ba(_0x4f04d1[_0x1dc1('0xa')]);}})[_0x1dc1('0xb')](function(_0x19e456){return _0x481926(_0x19e456);});});}exports[_0x1dc1('0xc')]=function(_0x36604f,_0x1af8b3,_0xbabe7e){return function(_0x2296e4){if(_0xbabe7e[_0x1dc1('0xd')]&&!_0xbabe7e[_0x1dc1('0xd')][_0x36604f]){logger[_0x1dc1('0xe')](_0x1dc1('0xf'),_0x36604f);return _0x2296e4[_0x1dc1('0x10')]();}var _0x34c5b1=[];for(var _0x588c5a=0x0;_0x588c5a<_0x1af8b3[_0x1dc1('0x11')];_0x588c5a+=0x1){_0x34c5b1['push'](request(_0x1dc1('0x12'),{'command':util['format']('iftime\x20%s',_0x1af8b3[_0x588c5a])})['then'](function(_0x56caf1){return _0x56caf1&&_0x56caf1[_0x1dc1('0x9')]&&_0x56caf1[_0x1dc1('0x9')][_0x1dc1('0x13')](_0x1dc1('0x14'))>=0x0?!![]:![];})['catch'](function(_0x18fd73){logger['error'](_0x1dc1('0x15'),_0x36604f,_0x1af8b3[_0x588c5a]);}));}BPromise[_0x1dc1('0x16')](_0x34c5b1)[_0x1dc1('0x7')](function(_0xe4d4f0){var _0x2c065d=_[_0x1dc1('0x17')](_0xe4d4f0);logger[_0x1dc1('0xe')](_0x1dc1('0x18'),_0x36604f,_0x1af8b3[_0x1dc1('0x19')](_0x1dc1('0x1a')),_0x2c065d);_0x2296e4[_0x1dc1('0x1b')](_0x2c065d);})[_0x1dc1('0xb')](function(_0x3c3771){console['log'](_0x3c3771);logger[_0x1dc1('0x8')]('[%s][INTERVAL]\x20%s\x20%s',_0x36604f,_0x1af8b3['join'](_0x1dc1('0x1a')),_0x3c3771['stack']);_0x2296e4[_0x1dc1('0x10')]();});};}; \ No newline at end of file +var _0x080f=['Command','format','iftime\x20%s','indexOf','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','log','stack','util','bluebird','lodash','../../../config/logger','routing','client','http','request','then','error','message','result','catch','condition','rules','info','stop','length'];(function(_0x2f85e2,_0x1b3c15){var _0x45ce1a=function(_0x4826aa){while(--_0x4826aa){_0x2f85e2['push'](_0x2f85e2['shift']());}};_0x45ce1a(++_0x1b3c15);}(_0x080f,0xc0));var _0xf080=function(_0x5a0f03,_0x4eb4ce){_0x5a0f03=_0x5a0f03-0x0;var _0x59443e=_0x080f[_0x5a0f03];return _0x59443e;};'use strict';var util=require(_0xf080('0x0'));var BPromise=require(_0xf080('0x1'));var jayson=require('jayson/promise');var _=require(_0xf080('0x2'));var logger=require(_0xf080('0x3'))(_0xf080('0x4'));var client=jayson[_0xf080('0x5')][_0xf080('0x6')]({'port':0x232a});function request(_0x353897,_0x4317cd){return new BPromise(function(_0x26e85f,_0x35a6c3){return client[_0xf080('0x7')](_0x353897,_0x4317cd)[_0xf080('0x8')](function(_0x44e089){if(_0x44e089['error']){return _0x35a6c3(_0x44e089[_0xf080('0x9')][_0xf080('0xa')]);}else{return _0x26e85f(_0x44e089[_0xf080('0xb')]);}})[_0xf080('0xc')](function(_0x188789){return _0x35a6c3(_0x188789);});});}exports[_0xf080('0xd')]=function(_0x419678,_0x3fe498,_0x3c096d){return function(_0x38d00b){if(_0x3c096d['rules']&&!_0x3c096d[_0xf080('0xe')][_0x419678]){logger[_0xf080('0xf')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x419678);return _0x38d00b[_0xf080('0x10')]();}var _0x2f7c01=[];for(var _0x30265a=0x0;_0x30265a<_0x3fe498[_0xf080('0x11')];_0x30265a+=0x1){_0x2f7c01['push'](request(_0xf080('0x12'),{'command':util[_0xf080('0x13')](_0xf080('0x14'),_0x3fe498[_0x30265a])})[_0xf080('0x8')](function(_0x1fc2b2){return _0x1fc2b2&&_0x1fc2b2[_0xf080('0xa')]&&_0x1fc2b2[_0xf080('0xa')][_0xf080('0x15')]('true')>=0x0?!![]:![];})[_0xf080('0xc')](function(_0xaa682f){logger[_0xf080('0x9')](_0xf080('0x16'),_0x419678,_0x3fe498[_0x30265a]);}));}BPromise[_0xf080('0x17')](_0x2f7c01)[_0xf080('0x8')](function(_0x1eedf0){var _0x134c89=_[_0xf080('0x18')](_0x1eedf0);logger[_0xf080('0xf')](_0xf080('0x19'),_0x419678,_0x3fe498[_0xf080('0x1a')](_0xf080('0x1b')),_0x134c89);_0x38d00b['when'](_0x134c89);})[_0xf080('0xc')](function(_0x2681f3){console[_0xf080('0x1c')](_0x2681f3);logger[_0xf080('0x9')]('[%s][INTERVAL]\x20%s\x20%s',_0x419678,_0x3fe498[_0xf080('0x1a')](_0xf080('0x1b')),_0x2681f3[_0xf080('0x1d')]);_0x38d00b['stop']();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index e3a0a23..bdc2524 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 _0x57ec=['lastevent','getVoiceQueueByName','type','agentcomplete','acw','acwtime','agentacw','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalledAt','now','called','connectedlinename','error','stack','agentringnoanswer','isNil','rejected','reason','holdtime','ringtime','talktime','queuecallerabandon','forIn','agentringnoanswerAt','abandoned','agentconnect','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','agentcompleteAt','agentconnectAt','complete','transfereruniqueid','transfer','transfertype','blind','extension','transferuniqueid','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','transferexten','secondtransfererexten','transfertargetuniqueid','diffTime','agent','util','./utils','info','format','uniqueid','channel','queue','interface','calleridnum','connectedlinenum'];(function(_0x1a639b,_0x10bcbc){var _0x24534f=function(_0x2bc193){while(--_0x2bc193){_0x1a639b['push'](_0x1a639b['shift']());}};_0x24534f(++_0x10bcbc);}(_0x57ec,0x1cb));var _0xc57e=function(_0x4c6d6f,_0x291557){_0x4c6d6f=_0x4c6d6f-0x0;var _0x2d4478=_0x57ec[_0x4c6d6f];return _0x2d4478;};'use strict';var _=require('lodash');var util=require(_0xc57e('0x0'));var utils=require(_0xc57e('0x1'));var agents={};var transfers={};function writeDB(_0x24a485,_0x3ef14c){utils[_0xc57e('0x2')](util[_0xc57e('0x3')]('AGENT|%s|%s|%s|%s|%s|%s|%s|%s',_0x24a485[_0xc57e('0x4')],_0x24a485[_0xc57e('0x5')],_0x24a485[_0xc57e('0x6')],_0x24a485['membername'],_0x24a485[_0xc57e('0x7')],_0x24a485[_0xc57e('0x8')],_0x24a485[_0xc57e('0x9')],_0x24a485[_0xc57e('0xa')]));if(_0x24a485[_0xc57e('0x6')]){utils[_0xc57e('0xb')](_0x24a485['queue'])['then'](function(_0x5bdf55){if(_0x5bdf55){_0x24a485[_0xc57e('0xc')]=_0x5bdf55['type'];_0x24a485['agentacw']=_0x24a485[_0xc57e('0xd')]?_0x5bdf55[_0xc57e('0xe')]:![];_0x24a485[_0xc57e('0xf')]=_0x24a485[_0xc57e('0x10')]?_0x5bdf55[_0xc57e('0x11')]:0x0;}utils['request']('CreateVoiceAgentReport',_0x24a485);});}else{utils[_0xc57e('0x12')](_0xc57e('0x13'),_0x24a485);}if(_0x3ef14c){delete transfers[_0x24a485[_0xc57e('0x4')]];}else{delete agents[_0x24a485[_0xc57e('0x14')]];}}exports['agentcalled']=function(_0x58fe0c){try{agents[_0x58fe0c[_0xc57e('0x14')]]=_0x58fe0c;agents[_0x58fe0c['destuniqueid']][_0xc57e('0x15')]=utils[_0xc57e('0x16')]();agents[_0x58fe0c[_0xc57e('0x14')]][_0xc57e('0xa')]=_0xc57e('0x17');agents[_0x58fe0c[_0xc57e('0x14')]]['connectedlinenum']=null;agents[_0x58fe0c['destuniqueid']][_0xc57e('0x18')]=null;}catch(_0x1a0e53){utils[_0xc57e('0x19')](_0x1a0e53[_0xc57e('0x1a')]);}};exports[_0xc57e('0x1b')]=function(_0x1a6004){try{if(!_[_0xc57e('0x1c')](agents[_0x1a6004[_0xc57e('0x14')]])){agents[_0x1a6004['destuniqueid']]['agentringnoanswer']=!![];agents[_0x1a6004[_0xc57e('0x14')]]['agentringnoanswerAt']=utils[_0xc57e('0x16')]();agents[_0x1a6004[_0xc57e('0x14')]][_0xc57e('0xa')]=_0xc57e('0x1d');agents[_0x1a6004['destuniqueid']][_0xc57e('0x1e')]=_0xc57e('0x1d');agents[_0x1a6004[_0xc57e('0x14')]][_0xc57e('0x1f')]=_0x1a6004[_0xc57e('0x20')]?parseInt(_0x1a6004[_0xc57e('0x20')])/0x3e8:0x0;agents[_0x1a6004[_0xc57e('0x14')]][_0xc57e('0x21')]=0x0;writeDB(agents[_0x1a6004['destuniqueid']]);}}catch(_0x1674e2){utils[_0xc57e('0x19')](_0x1674e2['stack']);}};exports[_0xc57e('0x22')]=function(_0x16eb4e){try{_[_0xc57e('0x23')](agents,function(_0x1153e8,_0x37aab6){if(_0x1153e8['uniqueid']==_0x16eb4e[_0xc57e('0x4')]){_0x1153e8[_0xc57e('0x1b')]=!![];_0x1153e8[_0xc57e('0x24')]=utils[_0xc57e('0x16')]();_0x1153e8[_0xc57e('0xa')]=_0xc57e('0x25');_0x1153e8['reason']=_0xc57e('0x25');_0x1153e8[_0xc57e('0x1f')]=_0x16eb4e[_0xc57e('0x1f')];_0x1153e8[_0xc57e('0x21')]=0x0;writeDB(_0x1153e8);}});}catch(_0x54077e){utils[_0xc57e('0x19')](_0x54077e[_0xc57e('0x1a')]);}};exports[_0xc57e('0x26')]=function(_0x10aefe){try{if(agents[_0x10aefe[_0xc57e('0x14')]]){agents[_0x10aefe[_0xc57e('0x14')]]['agentconnectAt']=utils[_0xc57e('0x16')]();agents[_0x10aefe[_0xc57e('0x14')]]['connectedlinenum']=_0x10aefe[_0xc57e('0x9')];agents[_0x10aefe[_0xc57e('0x14')]]['connectedlinename']=_0x10aefe[_0xc57e('0x18')];agents[_0x10aefe['destuniqueid']]['holdtime']=_0x10aefe['ringtime'];agents[_0x10aefe['destuniqueid']][_0xc57e('0xa')]=_0xc57e('0x27');_[_0xc57e('0x23')](agents,function(_0x25a299,_0x2dfe34){if(_0x25a299[_0xc57e('0x14')]!=_0x10aefe[_0xc57e('0x14')]&&_0x25a299[_0xc57e('0x4')]==_0x10aefe[_0xc57e('0x4')]){_0x25a299[_0xc57e('0x21')]=0x0;_0x25a299['holdtime']=_0x10aefe['ringtime'];_0x25a299[_0xc57e('0x1b')]=!![];_0x25a299[_0xc57e('0x24')]=utils[_0xc57e('0x16')]();_0x25a299[_0xc57e('0xa')]=_0xc57e('0x28');_0x25a299[_0xc57e('0x1e')]=_0xc57e('0x28');_0x25a299[_0xc57e('0x29')]=_0x10aefe[_0xc57e('0x14')];_0x25a299[_0xc57e('0x2a')]=_0x10aefe['membername'];writeDB(_0x25a299);}});}}catch(_0xbdb9){utils[_0xc57e('0x19')](_0xbdb9[_0xc57e('0x1a')]);}};exports[_0xc57e('0xd')]=function(_0x50f174){try{if(!_[_0xc57e('0x1c')](agents[_0x50f174[_0xc57e('0x14')]])){agents[_0x50f174[_0xc57e('0x14')]][_0xc57e('0xd')]=!![];agents[_0x50f174[_0xc57e('0x14')]]['agentcompleteAt']=utils['now']();agents[_0x50f174[_0xc57e('0x14')]][_0xc57e('0x21')]=utils['diffTime'](agents[_0x50f174[_0xc57e('0x14')]][_0xc57e('0x2b')],agents[_0x50f174[_0xc57e('0x14')]][_0xc57e('0x2c')]);agents[_0x50f174['destuniqueid']][_0xc57e('0x1e')]=_0x50f174[_0xc57e('0x1e')];agents[_0x50f174['destuniqueid']][_0xc57e('0xa')]=_0xc57e('0x2d');writeDB(agents[_0x50f174[_0xc57e('0x14')]]);}}catch(_0x4dc308){utils[_0xc57e('0x19')](_0x4dc308[_0xc57e('0x1a')]);}};exports['blindtransfer']=function(_0x43b42f){try{if(!_['isNil'](agents[_0x43b42f[_0xc57e('0x2e')]])){agents[_0x43b42f[_0xc57e('0x2e')]][_0xc57e('0x2f')]=!![];agents[_0x43b42f[_0xc57e('0x2e')]][_0xc57e('0x30')]=_0xc57e('0x31');agents[_0x43b42f[_0xc57e('0x2e')]]['transferexten']=_0x43b42f[_0xc57e('0x32')];agents[_0x43b42f['transfereruniqueid']][_0xc57e('0x33')]=agents[_0x43b42f['transfereruniqueid']][_0xc57e('0x4')];}}catch(_0x425024){utils[_0xc57e('0x19')](_0x425024[_0xc57e('0x1a')]);}};exports[_0xc57e('0x34')]=function(_0x295f48){try{if(_0x295f48[_0xc57e('0x35')]==_0x295f48[_0xc57e('0x36')]){if(!_[_0xc57e('0x1c')](agents[_0x295f48['secondtransfereruniqueid']])){agents[_0x295f48[_0xc57e('0x37')]][_0xc57e('0x2f')]=!![];agents[_0x295f48[_0xc57e('0x37')]][_0xc57e('0x30')]=_0xc57e('0x38');agents[_0x295f48[_0xc57e('0x37')]]['transferexten']=_0x295f48[_0xc57e('0x39')];agents[_0x295f48[_0xc57e('0x37')]][_0xc57e('0x33')]=_0x295f48['origtransfereruniqueid'];}if(_0x295f48[_0xc57e('0x3a')]&&agents[_0x295f48[_0xc57e('0x3a')]]){agents[_0x295f48['transfereeuniqueid']][_0xc57e('0x3b')]=0x1;transfers[_0x295f48[_0xc57e('0x3a')]]=_[_0xc57e('0x3c')](agents[_0x295f48[_0xc57e('0x3a')]]);transfers[_0x295f48[_0xc57e('0x3a')]][_0xc57e('0x8')]=agents[_0x295f48[_0xc57e('0x37')]]['calleridnum'];transfers[_0x295f48[_0xc57e('0x3a')]]['calleridname']=agents[_0x295f48['secondtransfereruniqueid']][_0xc57e('0x3d')];transfers[_0x295f48['transfereeuniqueid']]['agentcalledAt']=utils['now']();transfers[_0x295f48[_0xc57e('0x3a')]][_0xc57e('0x2c')]=utils[_0xc57e('0x16')]();transfers[_0x295f48[_0xc57e('0x3a')]][_0xc57e('0x1f')]=0x0;transfers[_0x295f48[_0xc57e('0x3a')]]['agententerreason']=0x2;}}else if(_0x295f48[_0xc57e('0x37')]==_0x295f48['secondtransfererlinkedid']){if(!_['isNil'](agents[_0x295f48[_0xc57e('0x35')]])){agents[_0x295f48[_0xc57e('0x35')]]['transfer']=!![];agents[_0x295f48[_0xc57e('0x35')]][_0xc57e('0x30')]='ATTENDED';agents[_0x295f48['origtransfereruniqueid']][_0xc57e('0x3e')]=_0x295f48[_0xc57e('0x3f')];agents[_0x295f48[_0xc57e('0x35')]][_0xc57e('0x33')]=_0x295f48[_0xc57e('0x37')];}if(_0x295f48[_0xc57e('0x40')]&&agents[_0x295f48[_0xc57e('0x40')]]){agents[_0x295f48[_0xc57e('0x40')]][_0xc57e('0x3b')]=0x1;transfers[_0x295f48[_0xc57e('0x40')]]=_[_0xc57e('0x3c')](agents[_0x295f48[_0xc57e('0x40')]]);transfers[_0x295f48['transfertargetuniqueid']][_0xc57e('0x8')]=agents[_0x295f48[_0xc57e('0x35')]][_0xc57e('0x8')];transfers[_0x295f48[_0xc57e('0x40')]][_0xc57e('0x3d')]=agents[_0x295f48[_0xc57e('0x35')]][_0xc57e('0x3d')];transfers[_0x295f48['transfertargetuniqueid']][_0xc57e('0x15')]=utils[_0xc57e('0x16')]();transfers[_0x295f48[_0xc57e('0x40')]][_0xc57e('0x2c')]=utils[_0xc57e('0x16')]();transfers[_0x295f48[_0xc57e('0x40')]]['holdtime']=0x0;transfers[_0x295f48[_0xc57e('0x40')]][_0xc57e('0x3b')]=0x2;}}}catch(_0x4263e1){utils[_0xc57e('0x19')](_0x4263e1[_0xc57e('0x1a')]);}};exports['hangup']=function(_0x45fcee){try{if(transfers[_0x45fcee[_0xc57e('0x4')]]){transfers[_0x45fcee[_0xc57e('0x4')]]['agentcomplete']=!![];transfers[_0x45fcee[_0xc57e('0x4')]][_0xc57e('0x2b')]=utils[_0xc57e('0x16')]();transfers[_0x45fcee[_0xc57e('0x4')]][_0xc57e('0x21')]=utils[_0xc57e('0x41')](transfers[_0x45fcee[_0xc57e('0x4')]][_0xc57e('0x2b')],transfers[_0x45fcee[_0xc57e('0x4')]][_0xc57e('0x2c')]);transfers[_0x45fcee[_0xc57e('0x4')]][_0xc57e('0x1e')]=_0xc57e('0x42');transfers[_0x45fcee[_0xc57e('0x4')]][_0xc57e('0xa')]=_0xc57e('0x2d');writeDB(transfers[_0x45fcee[_0xc57e('0x4')]],!![]);}if(agents[_0x45fcee[_0xc57e('0x4')]]&&agents[_0x45fcee[_0xc57e('0x4')]]['agentconnectAt']){agents[_0x45fcee[_0xc57e('0x4')]]['agentcomplete']=!![];agents[_0x45fcee[_0xc57e('0x4')]]['agentcompleteAt']=utils['now']();agents[_0x45fcee[_0xc57e('0x4')]][_0xc57e('0x21')]=utils[_0xc57e('0x41')](agents[_0x45fcee[_0xc57e('0x4')]][_0xc57e('0x2b')],agents[_0x45fcee['uniqueid']][_0xc57e('0x2c')]);agents[_0x45fcee[_0xc57e('0x4')]]['reason']=agents[_0x45fcee[_0xc57e('0x4')]][_0xc57e('0x2f')]?'transfer':_0xc57e('0x42');agents[_0x45fcee[_0xc57e('0x4')]][_0xc57e('0xa')]=_0xc57e('0x2d');writeDB(agents[_0x45fcee[_0xc57e('0x4')]]);}}catch(_0x3cad98){utils[_0xc57e('0x19')](_0x3cad98[_0xc57e('0x1a')]);}}; \ No newline at end of file +var _0x05d4=['transferexten','extension','transferuniqueid','attendedtransfer','origtransfereruniqueid','secondtransfereruniqueid','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridnum','calleridname','secondtransfererlinkedid','transfertype','secondtransfererexten','transfertargetuniqueid','diffTime','agent','lodash','util','./utils','info','format','channel','queue','lastevent','getVoiceQueueByName','then','type','acw','acwtime','agentacw','acwTimeout','request','CreateVoiceAgentReport','uniqueid','destuniqueid','agentcalled','agentcalledAt','now','called','connectedlinenum','connectedlinename','error','stack','agentringnoanswer','agentringnoanswerAt','reason','rejected','holdtime','ringtime','talktime','queuecallerabandon','forIn','abandoned','agentconnectAt','connect','answered_elsewhere','answeredelsewheremembername','membername','agentcomplete','isNil','agentcompleteAt','complete','transfereruniqueid','transfer','blind'];(function(_0x10d014,_0x2382d9){var _0x32884e=function(_0x3faa84){while(--_0x3faa84){_0x10d014['push'](_0x10d014['shift']());}};_0x32884e(++_0x2382d9);}(_0x05d4,0x98));var _0x405d=function(_0xc847ef,_0x527860){_0xc847ef=_0xc847ef-0x0;var _0x401594=_0x05d4[_0xc847ef];return _0x401594;};'use strict';var _=require(_0x405d('0x0'));var util=require(_0x405d('0x1'));var utils=require(_0x405d('0x2'));var agents={};var transfers={};function writeDB(_0x316e24,_0x89eb69){utils[_0x405d('0x3')](util[_0x405d('0x4')]('AGENT|%s|%s|%s|%s|%s|%s|%s|%s',_0x316e24['uniqueid'],_0x316e24[_0x405d('0x5')],_0x316e24[_0x405d('0x6')],_0x316e24['membername'],_0x316e24['interface'],_0x316e24['calleridnum'],_0x316e24['connectedlinenum'],_0x316e24[_0x405d('0x7')]));if(_0x316e24[_0x405d('0x6')]){utils[_0x405d('0x8')](_0x316e24[_0x405d('0x6')])[_0x405d('0x9')](function(_0x50ab69){if(_0x50ab69){_0x316e24[_0x405d('0xa')]=_0x50ab69['type'];_0x316e24['agentacw']=_0x316e24['agentcomplete']?_0x50ab69[_0x405d('0xb')]:![];_0x316e24[_0x405d('0xc')]=_0x316e24[_0x405d('0xd')]?_0x50ab69[_0x405d('0xe')]:0x0;}utils[_0x405d('0xf')](_0x405d('0x10'),_0x316e24);});}else{utils['request'](_0x405d('0x10'),_0x316e24);}if(_0x89eb69){delete transfers[_0x316e24[_0x405d('0x11')]];}else{delete agents[_0x316e24[_0x405d('0x12')]];}}exports[_0x405d('0x13')]=function(_0x4adf51){try{agents[_0x4adf51[_0x405d('0x12')]]=_0x4adf51;agents[_0x4adf51[_0x405d('0x12')]][_0x405d('0x14')]=utils[_0x405d('0x15')]();agents[_0x4adf51[_0x405d('0x12')]][_0x405d('0x7')]=_0x405d('0x16');agents[_0x4adf51[_0x405d('0x12')]][_0x405d('0x17')]=null;agents[_0x4adf51[_0x405d('0x12')]][_0x405d('0x18')]=null;}catch(_0x27d245){utils[_0x405d('0x19')](_0x27d245[_0x405d('0x1a')]);}};exports[_0x405d('0x1b')]=function(_0x16428e){try{if(!_['isNil'](agents[_0x16428e[_0x405d('0x12')]])){agents[_0x16428e[_0x405d('0x12')]][_0x405d('0x1b')]=!![];agents[_0x16428e['destuniqueid']][_0x405d('0x1c')]=utils['now']();agents[_0x16428e['destuniqueid']][_0x405d('0x7')]='rejected';agents[_0x16428e[_0x405d('0x12')]][_0x405d('0x1d')]=_0x405d('0x1e');agents[_0x16428e[_0x405d('0x12')]][_0x405d('0x1f')]=_0x16428e[_0x405d('0x20')]?parseInt(_0x16428e[_0x405d('0x20')])/0x3e8:0x0;agents[_0x16428e['destuniqueid']][_0x405d('0x21')]=0x0;writeDB(agents[_0x16428e['destuniqueid']]);}}catch(_0x1a7279){utils[_0x405d('0x19')](_0x1a7279[_0x405d('0x1a')]);}};exports[_0x405d('0x22')]=function(_0x1a8c38){try{_[_0x405d('0x23')](agents,function(_0x33fccc,_0x43566e){if(_0x33fccc[_0x405d('0x11')]==_0x1a8c38[_0x405d('0x11')]){_0x33fccc[_0x405d('0x1b')]=!![];_0x33fccc[_0x405d('0x1c')]=utils[_0x405d('0x15')]();_0x33fccc['lastevent']=_0x405d('0x24');_0x33fccc[_0x405d('0x1d')]='abandoned';_0x33fccc[_0x405d('0x1f')]=_0x1a8c38['holdtime'];_0x33fccc[_0x405d('0x21')]=0x0;writeDB(_0x33fccc);}});}catch(_0x3cc4eb){utils[_0x405d('0x19')](_0x3cc4eb[_0x405d('0x1a')]);}};exports['agentconnect']=function(_0x3331a6){try{if(agents[_0x3331a6[_0x405d('0x12')]]){agents[_0x3331a6[_0x405d('0x12')]][_0x405d('0x25')]=utils[_0x405d('0x15')]();agents[_0x3331a6[_0x405d('0x12')]][_0x405d('0x17')]=_0x3331a6[_0x405d('0x17')];agents[_0x3331a6[_0x405d('0x12')]][_0x405d('0x18')]=_0x3331a6[_0x405d('0x18')];agents[_0x3331a6['destuniqueid']][_0x405d('0x1f')]=_0x3331a6[_0x405d('0x20')];agents[_0x3331a6[_0x405d('0x12')]]['lastevent']=_0x405d('0x26');_[_0x405d('0x23')](agents,function(_0x2e4c3d,_0x2543ad){if(_0x2e4c3d[_0x405d('0x12')]!=_0x3331a6[_0x405d('0x12')]&&_0x2e4c3d[_0x405d('0x11')]==_0x3331a6[_0x405d('0x11')]){_0x2e4c3d[_0x405d('0x21')]=0x0;_0x2e4c3d[_0x405d('0x1f')]=_0x3331a6[_0x405d('0x20')];_0x2e4c3d[_0x405d('0x1b')]=!![];_0x2e4c3d[_0x405d('0x1c')]=utils[_0x405d('0x15')]();_0x2e4c3d[_0x405d('0x7')]=_0x405d('0x27');_0x2e4c3d[_0x405d('0x1d')]='answered_elsewhere';_0x2e4c3d['answeredelsewheredestinationuniqueid']=_0x3331a6['destuniqueid'];_0x2e4c3d[_0x405d('0x28')]=_0x3331a6[_0x405d('0x29')];writeDB(_0x2e4c3d);}});}}catch(_0x442dd6){utils[_0x405d('0x19')](_0x442dd6['stack']);}};exports[_0x405d('0x2a')]=function(_0x5577b9){try{if(!_[_0x405d('0x2b')](agents[_0x5577b9[_0x405d('0x12')]])){agents[_0x5577b9[_0x405d('0x12')]][_0x405d('0x2a')]=!![];agents[_0x5577b9[_0x405d('0x12')]][_0x405d('0x2c')]=utils[_0x405d('0x15')]();agents[_0x5577b9[_0x405d('0x12')]][_0x405d('0x21')]=utils['diffTime'](agents[_0x5577b9['destuniqueid']][_0x405d('0x2c')],agents[_0x5577b9[_0x405d('0x12')]][_0x405d('0x25')]);agents[_0x5577b9['destuniqueid']][_0x405d('0x1d')]=_0x5577b9['reason'];agents[_0x5577b9[_0x405d('0x12')]]['lastevent']=_0x405d('0x2d');writeDB(agents[_0x5577b9[_0x405d('0x12')]]);}}catch(_0xd16855){utils[_0x405d('0x19')](_0xd16855[_0x405d('0x1a')]);}};exports['blindtransfer']=function(_0x2a1954){try{if(!_['isNil'](agents[_0x2a1954[_0x405d('0x2e')]])){agents[_0x2a1954['transfereruniqueid']][_0x405d('0x2f')]=!![];agents[_0x2a1954[_0x405d('0x2e')]]['transfertype']=_0x405d('0x30');agents[_0x2a1954[_0x405d('0x2e')]][_0x405d('0x31')]=_0x2a1954[_0x405d('0x32')];agents[_0x2a1954[_0x405d('0x2e')]][_0x405d('0x33')]=agents[_0x2a1954[_0x405d('0x2e')]][_0x405d('0x11')];}}catch(_0x17cb01){utils[_0x405d('0x19')](_0x17cb01['stack']);}};exports[_0x405d('0x34')]=function(_0x57c916){try{if(_0x57c916[_0x405d('0x35')]==_0x57c916['origtransfererlinkedid']){if(!_['isNil'](agents[_0x57c916[_0x405d('0x36')]])){agents[_0x57c916[_0x405d('0x36')]][_0x405d('0x2f')]=!![];agents[_0x57c916[_0x405d('0x36')]]['transfertype']='ATTENDED';agents[_0x57c916[_0x405d('0x36')]]['transferexten']=_0x57c916[_0x405d('0x37')];agents[_0x57c916['secondtransfereruniqueid']][_0x405d('0x33')]=_0x57c916[_0x405d('0x35')];}if(_0x57c916[_0x405d('0x38')]&&agents[_0x57c916['transfereeuniqueid']]){agents[_0x57c916['transfereeuniqueid']][_0x405d('0x39')]=0x1;transfers[_0x57c916[_0x405d('0x38')]]=_[_0x405d('0x3a')](agents[_0x57c916[_0x405d('0x38')]]);transfers[_0x57c916[_0x405d('0x38')]][_0x405d('0x3b')]=agents[_0x57c916[_0x405d('0x36')]][_0x405d('0x3b')];transfers[_0x57c916['transfereeuniqueid']][_0x405d('0x3c')]=agents[_0x57c916[_0x405d('0x36')]][_0x405d('0x3c')];transfers[_0x57c916[_0x405d('0x38')]][_0x405d('0x14')]=utils[_0x405d('0x15')]();transfers[_0x57c916[_0x405d('0x38')]][_0x405d('0x25')]=utils[_0x405d('0x15')]();transfers[_0x57c916[_0x405d('0x38')]][_0x405d('0x1f')]=0x0;transfers[_0x57c916[_0x405d('0x38')]][_0x405d('0x39')]=0x2;}}else if(_0x57c916[_0x405d('0x36')]==_0x57c916[_0x405d('0x3d')]){if(!_[_0x405d('0x2b')](agents[_0x57c916[_0x405d('0x35')]])){agents[_0x57c916[_0x405d('0x35')]]['transfer']=!![];agents[_0x57c916['origtransfereruniqueid']][_0x405d('0x3e')]='ATTENDED';agents[_0x57c916[_0x405d('0x35')]][_0x405d('0x31')]=_0x57c916[_0x405d('0x3f')];agents[_0x57c916[_0x405d('0x35')]][_0x405d('0x33')]=_0x57c916[_0x405d('0x36')];}if(_0x57c916[_0x405d('0x40')]&&agents[_0x57c916[_0x405d('0x40')]]){agents[_0x57c916[_0x405d('0x40')]][_0x405d('0x39')]=0x1;transfers[_0x57c916[_0x405d('0x40')]]=_['clone'](agents[_0x57c916['transfertargetuniqueid']]);transfers[_0x57c916[_0x405d('0x40')]][_0x405d('0x3b')]=agents[_0x57c916[_0x405d('0x35')]][_0x405d('0x3b')];transfers[_0x57c916[_0x405d('0x40')]][_0x405d('0x3c')]=agents[_0x57c916[_0x405d('0x35')]][_0x405d('0x3c')];transfers[_0x57c916[_0x405d('0x40')]][_0x405d('0x14')]=utils[_0x405d('0x15')]();transfers[_0x57c916[_0x405d('0x40')]][_0x405d('0x25')]=utils['now']();transfers[_0x57c916[_0x405d('0x40')]]['holdtime']=0x0;transfers[_0x57c916[_0x405d('0x40')]]['agententerreason']=0x2;}}}catch(_0x1a72c5){utils[_0x405d('0x19')](_0x1a72c5[_0x405d('0x1a')]);}};exports['hangup']=function(_0x560541){try{if(transfers[_0x560541[_0x405d('0x11')]]){transfers[_0x560541[_0x405d('0x11')]][_0x405d('0x2a')]=!![];transfers[_0x560541['uniqueid']]['agentcompleteAt']=utils[_0x405d('0x15')]();transfers[_0x560541['uniqueid']][_0x405d('0x21')]=utils[_0x405d('0x41')](transfers[_0x560541[_0x405d('0x11')]][_0x405d('0x2c')],transfers[_0x560541[_0x405d('0x11')]][_0x405d('0x25')]);transfers[_0x560541[_0x405d('0x11')]][_0x405d('0x1d')]=_0x405d('0x42');transfers[_0x560541[_0x405d('0x11')]]['lastevent']=_0x405d('0x2d');writeDB(transfers[_0x560541[_0x405d('0x11')]],!![]);}if(agents[_0x560541[_0x405d('0x11')]]&&agents[_0x560541[_0x405d('0x11')]][_0x405d('0x25')]){agents[_0x560541[_0x405d('0x11')]][_0x405d('0x2a')]=!![];agents[_0x560541[_0x405d('0x11')]][_0x405d('0x2c')]=utils[_0x405d('0x15')]();agents[_0x560541[_0x405d('0x11')]][_0x405d('0x21')]=utils[_0x405d('0x41')](agents[_0x560541[_0x405d('0x11')]][_0x405d('0x2c')],agents[_0x560541['uniqueid']][_0x405d('0x25')]);agents[_0x560541[_0x405d('0x11')]][_0x405d('0x1d')]=agents[_0x560541[_0x405d('0x11')]]['transfer']?'transfer':_0x405d('0x42');agents[_0x560541[_0x405d('0x11')]][_0x405d('0x7')]=_0x405d('0x2d');writeDB(agents[_0x560541[_0x405d('0x11')]]);}}catch(_0x32c7d9){utils[_0x405d('0x19')](_0x32c7d9['stack']);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 2c119af..50069d9 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 _0x14c8=['newchannel','linkedid','OutgoingSpoolFailed','calleridnum','context','now','DOCUMENTATION','stack','isNil','systemanswertime','channelstate','destinationchannel','answertime','disposition','hangup','calleridname','endtime','duration','diffTime','starttime','billableseconds','error','localtwolinkedid','transfereechannel','secondtransfererchannel','_attended','transfertargetchannel','origtransfererchannel','userfield','musiconholdstart','musiconholdstop','musiconholdstartAt','varset','variable','xmd-phone','value','xmd-callerid-preview','xmd-callerid','xmd-queue','Queue','lastdata','xmd-contactid','ContactId','xmd-cdrtype','outboundrouteid','sipcallid','newexten','application','toLowerCase','startsWith','appdata','cdr','split','substring','lastIndexOf','includes','noop','execif','set','gotoif','lodash','./utils','NO\x20ANSWER','FAILED','ANSWERED','BUSY','info','format','CALL|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','type','accountcode','source','destination','callerid','UserId','request','CreateVoiceCallReport'];(function(_0x480fba,_0x32e5b5){var _0x3a836b=function(_0x5adc03){while(--_0x5adc03){_0x480fba['push'](_0x480fba['shift']());}};_0x3a836b(++_0x32e5b5);}(_0x14c8,0x178));var _0x814c=function(_0xa631a0,_0x43aa99){_0xa631a0=_0xa631a0-0x0;var _0x572f19=_0x14c8[_0xa631a0];return _0x572f19;};'use strict';var _=require(_0x814c('0x0'));var util=require('util');var utils=require(_0x814c('0x1'));var dispositions=[_0x814c('0x2'),_0x814c('0x3'),_0x814c('0x3'),_0x814c('0x2'),_0x814c('0x2'),_0x814c('0x2'),_0x814c('0x4'),_0x814c('0x5'),_0x814c('0x3'),'FAILED',_0x814c('0x3')];var channels={};function writeDB(_0x2f5b27){utils[_0x814c('0x6')](util[_0x814c('0x7')](_0x814c('0x8'),_0x2f5b27[_0x814c('0x9')],_0x2f5b27[_0x814c('0xa')],_0x2f5b27[_0x814c('0xb')],_0x2f5b27[_0x814c('0xc')],_0x2f5b27[_0x814c('0xd')],_0x2f5b27[_0x814c('0xe')],_0x2f5b27[_0x814c('0xf')],_0x2f5b27['disposition']));if(_0x2f5b27['accountcode']){utils['getUserByInternal'](_0x2f5b27[_0x814c('0xc')])['then'](function(_0x4446f9){if(_0x4446f9){_0x2f5b27[_0x814c('0x10')]=_0x4446f9['id'];}utils[_0x814c('0x11')](_0x814c('0x12'),_0x2f5b27);});}else{utils[_0x814c('0x11')](_0x814c('0x12'),_0x2f5b27);}if(channels[_0x2f5b27[_0x814c('0x9')]]){delete channels[_0x2f5b27[_0x814c('0x9')]];}}exports[_0x814c('0x13')]=function(_0x26438c){try{if(_0x26438c[_0x814c('0x9')]==_0x26438c[_0x814c('0x14')]&&_0x26438c[_0x814c('0xa')]!=_0x814c('0x15')){channels[_0x26438c['uniqueid']]={'uniqueid':_0x26438c[_0x814c('0x9')],'accountcode':_0x26438c['accountcode'],'source':_0x26438c[_0x814c('0x16')],'destination':_0x26438c['exten'],'destinationcontext':_0x26438c[_0x814c('0x17')],'channel':_0x26438c['channel'],'starttime':utils[_0x814c('0x18')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x814c('0x2'),'amaflags':_0x814c('0x19')};}}catch(_0x5e6fa8){utils['error'](_0x5e6fa8[_0x814c('0x1a')]);}};exports['newstate']=function(_0x186c8f){try{if(!_[_0x814c('0x1b')](channels[_0x186c8f[_0x814c('0x9')]])&&_0x186c8f['channelstate']==0x6){if(_[_0x814c('0x1b')](channels[_0x186c8f[_0x814c('0x9')]][_0x814c('0x1c')])){channels[_0x186c8f[_0x814c('0x9')]][_0x814c('0x1c')]=utils[_0x814c('0x18')]();}}else if(!_[_0x814c('0x1b')](channels[_0x186c8f[_0x814c('0x14')]])&&_0x186c8f[_0x814c('0x1d')]==0x6&&_0x186c8f[_0x814c('0x17')]!='transfer'){channels[_0x186c8f[_0x814c('0x14')]][_0x814c('0xc')]=_0x186c8f[_0x814c('0xc')];channels[_0x186c8f[_0x814c('0x14')]][_0x814c('0x1e')]=_0x186c8f[_0x814c('0xa')];if(_['isNil'](channels[_0x186c8f[_0x814c('0x14')]][_0x814c('0x1f')])){channels[_0x186c8f[_0x814c('0x14')]]['answertime']=utils[_0x814c('0x18')]();}channels[_0x186c8f['linkedid']][_0x814c('0x20')]=dispositions[_['toNumber'](_0x186c8f['channelstate'])]||'ANSWERED';}}catch(_0x5f2394){utils['error'](_0x5f2394['stack']);}};exports[_0x814c('0x21')]=function(_0x25d94b){try{if(!_[_0x814c('0x1b')](channels[_0x25d94b['uniqueid']])){if(_[_0x814c('0x1b')](channels[_0x25d94b[_0x814c('0x9')]][_0x814c('0xf')])){channels[_0x25d94b[_0x814c('0x9')]]['callerid']=_0x25d94b[_0x814c('0x22')]+'\x20<'+_0x25d94b['calleridnum']+'>';}channels[_0x25d94b[_0x814c('0x9')]][_0x814c('0x23')]=utils[_0x814c('0x18')]();channels[_0x25d94b['uniqueid']][_0x814c('0x24')]=utils[_0x814c('0x25')](channels[_0x25d94b['uniqueid']]['endtime'],channels[_0x25d94b['uniqueid']][_0x814c('0x26')]);channels[_0x25d94b[_0x814c('0x9')]][_0x814c('0x27')]=channels[_0x25d94b[_0x814c('0x9')]][_0x814c('0x1f')]?utils['diffTime'](channels[_0x25d94b[_0x814c('0x9')]][_0x814c('0x23')],channels[_0x25d94b[_0x814c('0x9')]][_0x814c('0x1f')]):0x0;writeDB(channels[_0x25d94b['uniqueid']]);}}catch(_0x3dad36){utils[_0x814c('0x28')](_0x3dad36[_0x814c('0x1a')]);}};exports['attendedtransfer']=function(_0x1cdf61){try{if(!_[_0x814c('0x1b')](channels[_0x1cdf61[_0x814c('0x29')]])){if(channels[_0x1cdf61['localtwolinkedid']][_0x814c('0xa')]==_0x1cdf61[_0x814c('0x2a')]){channels[_0x1cdf61['localtwolinkedid']][_0x814c('0x1e')]=_0x1cdf61[_0x814c('0x2b')];channels[_0x1cdf61[_0x814c('0x29')]]['userfield']=_0x814c('0x2c');}else if(channels[_0x1cdf61['localtwolinkedid']][_0x814c('0xa')]=_0x1cdf61[_0x814c('0x2d')]){channels[_0x1cdf61[_0x814c('0x29')]][_0x814c('0x1e')]=_0x1cdf61[_0x814c('0x2e')];channels[_0x1cdf61['localtwolinkedid']][_0x814c('0x2f')]=_0x814c('0x2c');}}}catch(_0x80c895){utils[_0x814c('0x28')](_0x80c895[_0x814c('0x1a')]);}};exports[_0x814c('0x30')]=function(_0x10e8b1){try{if(!_['isNil'](channels[_0x10e8b1[_0x814c('0x9')]])){channels[_0x10e8b1[_0x814c('0x9')]]['musiconholdstartAt']=utils[_0x814c('0x18')]();}}catch(_0x29f85c){utils['error'](_0x29f85c['stack']);}};exports[_0x814c('0x31')]=function(_0x385562){try{if(!_['isNil'](channels[_0x385562['uniqueid']])){if(!_[_0x814c('0x1b')](channels[_0x385562[_0x814c('0x9')]][_0x814c('0x32')])){channels[_0x385562[_0x814c('0x9')]]['mohtime']+=utils['diffTime'](utils['now'](),channels[_0x385562[_0x814c('0x9')]][_0x814c('0x32')]);delete channels[_0x385562[_0x814c('0x9')]][_0x814c('0x32')];}}}catch(_0x37ca92){utils['error'](_0x37ca92['stack']);}};exports[_0x814c('0x33')]=function(_0x45c065){try{if(!_['isNil'](channels[_0x45c065[_0x814c('0x9')]])){if(!_[_0x814c('0x1b')](_0x45c065[_0x814c('0x34')]['xmd-originatecalleridnum'])){channels[_0x45c065[_0x814c('0x9')]][_0x814c('0xd')]=_0x45c065['value'];}if(!_['isNil'](_0x45c065[_0x814c('0x34')][_0x814c('0x35')])){channels[_0x45c065[_0x814c('0x9')]][_0x814c('0xe')]=_0x45c065[_0x814c('0x36')];channels[_0x45c065[_0x814c('0x9')]][_0x814c('0xf')]='\x22'+_0x45c065[_0x814c('0x36')]+'\x22\x20<'+_0x45c065[_0x814c('0x36')]+'>';}if(!_[_0x814c('0x1b')](_0x45c065[_0x814c('0x34')][_0x814c('0x37')])||!_[_0x814c('0x1b')](_0x45c065[_0x814c('0x34')][_0x814c('0x38')])){channels[_0x45c065[_0x814c('0x9')]][_0x814c('0xf')]=_0x45c065['value'];}if(!_['isNil'](_0x45c065[_0x814c('0x34')][_0x814c('0x39')])||!_[_0x814c('0x1b')](_0x45c065['variable']['xmcs-queue'])){channels[_0x45c065[_0x814c('0x9')]]['lastapplication']=_0x814c('0x3a');channels[_0x45c065[_0x814c('0x9')]][_0x814c('0x3b')]=_0x45c065[_0x814c('0x36')];channels[_0x45c065[_0x814c('0x9')]]['queue']=!![];}if(!_['isNil'](_0x45c065['variable'][_0x814c('0x3c')])){channels[_0x45c065[_0x814c('0x9')]][_0x814c('0x3d')]=_0x45c065[_0x814c('0x36')];}if(!_[_0x814c('0x1b')](_0x45c065[_0x814c('0x34')][_0x814c('0x3e')])){channels[_0x45c065[_0x814c('0x9')]]['type']=_0x45c065[_0x814c('0x36')];}if(!_[_0x814c('0x1b')](_0x45c065[_0x814c('0x34')][_0x814c('0x3f')])){channels[_0x45c065['uniqueid']]['routeid']=_0x45c065[_0x814c('0x36')];}if(!_[_0x814c('0x1b')](_0x45c065[_0x814c('0x34')][_0x814c('0x40')])){channels[_0x45c065[_0x814c('0x9')]][_0x814c('0x40')]=_0x45c065['value'];}}}catch(_0x3a7b3e){utils[_0x814c('0x28')](_0x3a7b3e['stack']);}};exports[_0x814c('0x41')]=function(_0x3a3c6b){try{if(!_[_0x814c('0x1b')](channels[_0x3a3c6b[_0x814c('0x9')]])){if(_0x3a3c6b[_0x814c('0x42')][_0x814c('0x43')]()=='set'&&_[_0x814c('0x44')](_0x3a3c6b[_0x814c('0x45')][_0x814c('0x43')](),_0x814c('0x46'))){var _0x332de6=_0x3a3c6b['appdata'][_0x814c('0x47')]('=');var _0x19a9f5=_0x332de6[0x0][_0x814c('0x48')](_0x332de6[0x0][_0x814c('0x49')]('(')+0x1,_0x332de6[0x0][_0x814c('0x49')](')'));var _0x3fbd4a=_0x332de6[0x1];channels[_0x3a3c6b[_0x814c('0x9')]][_0x19a9f5]=_0x3fbd4a;}if(!_[_0x814c('0x4a')]([_0x814c('0x21'),_0x814c('0x4b'),_0x814c('0x4c'),_0x814c('0x4d'),_0x814c('0x4e')],_0x3a3c6b[_0x814c('0x42')][_0x814c('0x43')]())){channels[_0x3a3c6b['uniqueid']]['lastapplication']=_0x3a3c6b[_0x814c('0x42')];channels[_0x3a3c6b[_0x814c('0x9')]]['lastdata']=_0x3a3c6b['appdata'];}}}catch(_0x4e93ff){utils[_0x814c('0x28')](_0x4e93ff['stack']);}}; \ No newline at end of file +var _0x29c2=['./utils','NO\x20ANSWER','ANSWERED','FAILED','info','format','uniqueid','channel','type','source','disposition','accountcode','UserId','request','CreateVoiceCallReport','newchannel','OutgoingSpoolFailed','exten','context','now','DOCUMENTATION','error','stack','newstate','isNil','systemanswertime','linkedid','destinationchannel','toNumber','channelstate','callerid','calleridname','calleridnum','endtime','billableseconds','answertime','diffTime','attendedtransfer','localtwolinkedid','transfereechannel','secondtransfererchannel','userfield','_attended','transfertargetchannel','musiconholdstartAt','varset','variable','xmd-originatecalleridnum','xmd-phone','destination','value','\x22\x20<','xmd-callerid-preview','xmd-callerid','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','xmd-contactid','ContactId','outboundrouteid','routeid','sipcallid','newexten','toLowerCase','set','startsWith','appdata','cdr','split','substring','lastIndexOf','includes','hangup','noop','execif','gotoif','application','lodash'];(function(_0x1ab180,_0x382b2c){var _0xfb2c2d=function(_0x1c5fd3){while(--_0x1c5fd3){_0x1ab180['push'](_0x1ab180['shift']());}};_0xfb2c2d(++_0x382b2c);}(_0x29c2,0x13f));var _0x229c=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x29c2[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x229c('0x0'));var util=require('util');var utils=require(_0x229c('0x1'));var dispositions=['NO\x20ANSWER','FAILED','FAILED',_0x229c('0x2'),_0x229c('0x2'),_0x229c('0x2'),_0x229c('0x3'),'BUSY','FAILED',_0x229c('0x4'),_0x229c('0x4')];var channels={};function writeDB(_0x49b772){utils[_0x229c('0x5')](util[_0x229c('0x6')]('CALL|%s|%s|%s|%s|%s|%s|%s|%s',_0x49b772[_0x229c('0x7')],_0x49b772[_0x229c('0x8')],_0x49b772[_0x229c('0x9')],_0x49b772['accountcode'],_0x49b772[_0x229c('0xa')],_0x49b772['destination'],_0x49b772['callerid'],_0x49b772[_0x229c('0xb')]));if(_0x49b772[_0x229c('0xc')]){utils['getUserByInternal'](_0x49b772[_0x229c('0xc')])['then'](function(_0x4cd504){if(_0x4cd504){_0x49b772[_0x229c('0xd')]=_0x4cd504['id'];}utils[_0x229c('0xe')](_0x229c('0xf'),_0x49b772);});}else{utils[_0x229c('0xe')](_0x229c('0xf'),_0x49b772);}if(channels[_0x49b772['uniqueid']]){delete channels[_0x49b772[_0x229c('0x7')]];}}exports[_0x229c('0x10')]=function(_0x344cea){try{if(_0x344cea[_0x229c('0x7')]==_0x344cea['linkedid']&&_0x344cea[_0x229c('0x8')]!=_0x229c('0x11')){channels[_0x344cea[_0x229c('0x7')]]={'uniqueid':_0x344cea[_0x229c('0x7')],'accountcode':_0x344cea[_0x229c('0xc')],'source':_0x344cea['calleridnum'],'destination':_0x344cea[_0x229c('0x12')],'destinationcontext':_0x344cea[_0x229c('0x13')],'channel':_0x344cea['channel'],'starttime':utils[_0x229c('0x14')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0x229c('0x15')};}}catch(_0x279eca){utils[_0x229c('0x16')](_0x279eca[_0x229c('0x17')]);}};exports[_0x229c('0x18')]=function(_0x17c293){try{if(!_[_0x229c('0x19')](channels[_0x17c293[_0x229c('0x7')]])&&_0x17c293['channelstate']==0x6){if(_[_0x229c('0x19')](channels[_0x17c293[_0x229c('0x7')]][_0x229c('0x1a')])){channels[_0x17c293[_0x229c('0x7')]][_0x229c('0x1a')]=utils[_0x229c('0x14')]();}}else if(!_['isNil'](channels[_0x17c293[_0x229c('0x1b')]])&&_0x17c293['channelstate']==0x6&&_0x17c293[_0x229c('0x13')]!='transfer'){channels[_0x17c293[_0x229c('0x1b')]][_0x229c('0xc')]=_0x17c293['accountcode'];channels[_0x17c293[_0x229c('0x1b')]][_0x229c('0x1c')]=_0x17c293[_0x229c('0x8')];if(_[_0x229c('0x19')](channels[_0x17c293[_0x229c('0x1b')]]['answertime'])){channels[_0x17c293[_0x229c('0x1b')]]['answertime']=utils['now']();}channels[_0x17c293[_0x229c('0x1b')]][_0x229c('0xb')]=dispositions[_[_0x229c('0x1d')](_0x17c293[_0x229c('0x1e')])]||_0x229c('0x3');}}catch(_0x4d9f18){utils[_0x229c('0x16')](_0x4d9f18['stack']);}};exports['hangup']=function(_0x2f4221){try{if(!_[_0x229c('0x19')](channels[_0x2f4221[_0x229c('0x7')]])){if(_[_0x229c('0x19')](channels[_0x2f4221['uniqueid']][_0x229c('0x1f')])){channels[_0x2f4221['uniqueid']][_0x229c('0x1f')]=_0x2f4221[_0x229c('0x20')]+'\x20<'+_0x2f4221[_0x229c('0x21')]+'>';}channels[_0x2f4221[_0x229c('0x7')]][_0x229c('0x22')]=utils['now']();channels[_0x2f4221[_0x229c('0x7')]]['duration']=utils['diffTime'](channels[_0x2f4221['uniqueid']]['endtime'],channels[_0x2f4221[_0x229c('0x7')]]['starttime']);channels[_0x2f4221[_0x229c('0x7')]][_0x229c('0x23')]=channels[_0x2f4221[_0x229c('0x7')]][_0x229c('0x24')]?utils[_0x229c('0x25')](channels[_0x2f4221[_0x229c('0x7')]]['endtime'],channels[_0x2f4221[_0x229c('0x7')]][_0x229c('0x24')]):0x0;writeDB(channels[_0x2f4221['uniqueid']]);}}catch(_0x526d35){utils[_0x229c('0x16')](_0x526d35[_0x229c('0x17')]);}};exports[_0x229c('0x26')]=function(_0x389151){try{if(!_[_0x229c('0x19')](channels[_0x389151[_0x229c('0x27')]])){if(channels[_0x389151[_0x229c('0x27')]][_0x229c('0x8')]==_0x389151[_0x229c('0x28')]){channels[_0x389151[_0x229c('0x27')]][_0x229c('0x1c')]=_0x389151[_0x229c('0x29')];channels[_0x389151[_0x229c('0x27')]][_0x229c('0x2a')]=_0x229c('0x2b');}else if(channels[_0x389151['localtwolinkedid']][_0x229c('0x8')]=_0x389151[_0x229c('0x2c')]){channels[_0x389151[_0x229c('0x27')]][_0x229c('0x1c')]=_0x389151['origtransfererchannel'];channels[_0x389151['localtwolinkedid']][_0x229c('0x2a')]=_0x229c('0x2b');}}}catch(_0x8e9664){utils[_0x229c('0x16')](_0x8e9664[_0x229c('0x17')]);}};exports['musiconholdstart']=function(_0x4b2d1f){try{if(!_[_0x229c('0x19')](channels[_0x4b2d1f['uniqueid']])){channels[_0x4b2d1f[_0x229c('0x7')]][_0x229c('0x2d')]=utils[_0x229c('0x14')]();}}catch(_0x2b0929){utils[_0x229c('0x16')](_0x2b0929[_0x229c('0x17')]);}};exports['musiconholdstop']=function(_0x2353d8){try{if(!_[_0x229c('0x19')](channels[_0x2353d8[_0x229c('0x7')]])){if(!_['isNil'](channels[_0x2353d8['uniqueid']][_0x229c('0x2d')])){channels[_0x2353d8[_0x229c('0x7')]]['mohtime']+=utils[_0x229c('0x25')](utils[_0x229c('0x14')](),channels[_0x2353d8[_0x229c('0x7')]][_0x229c('0x2d')]);delete channels[_0x2353d8[_0x229c('0x7')]]['musiconholdstartAt'];}}}catch(_0x1adb1f){utils['error'](_0x1adb1f[_0x229c('0x17')]);}};exports[_0x229c('0x2e')]=function(_0xd470d0){try{if(!_['isNil'](channels[_0xd470d0[_0x229c('0x7')]])){if(!_['isNil'](_0xd470d0[_0x229c('0x2f')][_0x229c('0x30')])){channels[_0xd470d0[_0x229c('0x7')]][_0x229c('0xa')]=_0xd470d0['value'];}if(!_[_0x229c('0x19')](_0xd470d0[_0x229c('0x2f')][_0x229c('0x31')])){channels[_0xd470d0['uniqueid']][_0x229c('0x32')]=_0xd470d0[_0x229c('0x33')];channels[_0xd470d0[_0x229c('0x7')]][_0x229c('0x1f')]='\x22'+_0xd470d0['value']+_0x229c('0x34')+_0xd470d0[_0x229c('0x33')]+'>';}if(!_[_0x229c('0x19')](_0xd470d0['variable'][_0x229c('0x35')])||!_[_0x229c('0x19')](_0xd470d0[_0x229c('0x2f')][_0x229c('0x36')])){channels[_0xd470d0[_0x229c('0x7')]][_0x229c('0x1f')]=_0xd470d0[_0x229c('0x33')];}if(!_[_0x229c('0x19')](_0xd470d0[_0x229c('0x2f')][_0x229c('0x37')])||!_['isNil'](_0xd470d0[_0x229c('0x2f')][_0x229c('0x38')])){channels[_0xd470d0['uniqueid']][_0x229c('0x39')]=_0x229c('0x3a');channels[_0xd470d0[_0x229c('0x7')]][_0x229c('0x3b')]=_0xd470d0['value'];channels[_0xd470d0['uniqueid']]['queue']=!![];}if(!_[_0x229c('0x19')](_0xd470d0['variable'][_0x229c('0x3c')])){channels[_0xd470d0[_0x229c('0x7')]][_0x229c('0x3d')]=_0xd470d0[_0x229c('0x33')];}if(!_[_0x229c('0x19')](_0xd470d0['variable']['xmd-cdrtype'])){channels[_0xd470d0[_0x229c('0x7')]][_0x229c('0x9')]=_0xd470d0['value'];}if(!_[_0x229c('0x19')](_0xd470d0[_0x229c('0x2f')][_0x229c('0x3e')])){channels[_0xd470d0[_0x229c('0x7')]][_0x229c('0x3f')]=_0xd470d0[_0x229c('0x33')];}if(!_[_0x229c('0x19')](_0xd470d0[_0x229c('0x2f')][_0x229c('0x40')])){channels[_0xd470d0[_0x229c('0x7')]]['sipcallid']=_0xd470d0[_0x229c('0x33')];}}}catch(_0x32a056){utils[_0x229c('0x16')](_0x32a056['stack']);}};exports[_0x229c('0x41')]=function(_0x111531){try{if(!_[_0x229c('0x19')](channels[_0x111531[_0x229c('0x7')]])){if(_0x111531['application'][_0x229c('0x42')]()==_0x229c('0x43')&&_[_0x229c('0x44')](_0x111531[_0x229c('0x45')][_0x229c('0x42')](),_0x229c('0x46'))){var _0x130b5d=_0x111531[_0x229c('0x45')][_0x229c('0x47')]('=');var _0x4a361d=_0x130b5d[0x0][_0x229c('0x48')](_0x130b5d[0x0][_0x229c('0x49')]('(')+0x1,_0x130b5d[0x0][_0x229c('0x49')](')'));var _0x7f150=_0x130b5d[0x1];channels[_0x111531[_0x229c('0x7')]][_0x4a361d]=_0x7f150;}if(!_[_0x229c('0x4a')]([_0x229c('0x4b'),_0x229c('0x4c'),_0x229c('0x4d'),_0x229c('0x43'),_0x229c('0x4e')],_0x111531[_0x229c('0x4f')][_0x229c('0x42')]())){channels[_0x111531[_0x229c('0x7')]][_0x229c('0x39')]=_0x111531[_0x229c('0x4f')];channels[_0x111531[_0x229c('0x7')]]['lastdata']=_0x111531[_0x229c('0x45')];}}}catch(_0x2f9cbd){utils['error'](_0x2f9cbd[_0x229c('0x17')]);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index abae52c..cbef8a0 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 _0x6c7b=['SHUTDOWN','fullybooted','FULLYBOOTED','error','close','CLOSE','managerevent','./utils','CONNECTED','info'];(function(_0x55e659,_0x233aa4){var _0xca08c7=function(_0xe1c5b0){while(--_0xe1c5b0){_0x55e659['push'](_0x55e659['shift']());}};_0xca08c7(++_0x233aa4);}(_0x6c7b,0x10b));var _0xb6c7=function(_0x331958,_0x383b87){_0x331958=_0x331958-0x0;var _0x4d6768=_0x6c7b[_0x331958];return _0x4d6768;};'use strict';var utils=require(_0xb6c7('0x0'));var _=require('lodash');exports['connect']=function(){utils['info'](_0xb6c7('0x1'));};exports['shutdown']=function(){utils[_0xb6c7('0x2')](_0xb6c7('0x3'));};exports[_0xb6c7('0x4')]=function(){utils['info'](_0xb6c7('0x5'));};exports[_0xb6c7('0x6')]=function(_0xfe3eb9){utils[_0xb6c7('0x6')](_0xfe3eb9);};exports[_0xb6c7('0x7')]=function(){utils['info'](_0xb6c7('0x8'));};exports[_0xb6c7('0x9')]=function(_0xe2ce08){}; \ No newline at end of file +var _0xcaf2=['info','shutdown','fullybooted','FULLYBOOTED','error','close','CLOSE','managerevent','./utils','connect'];(function(_0x194df0,_0x31cc25){var _0xe48553=function(_0x8b5de4){while(--_0x8b5de4){_0x194df0['push'](_0x194df0['shift']());}};_0xe48553(++_0x31cc25);}(_0xcaf2,0x8a));var _0x2caf=function(_0x253673,_0x3287fb){_0x253673=_0x253673-0x0;var _0x259903=_0xcaf2[_0x253673];return _0x259903;};'use strict';var utils=require(_0x2caf('0x0'));var _=require('lodash');exports[_0x2caf('0x1')]=function(){utils[_0x2caf('0x2')]('CONNECTED');};exports[_0x2caf('0x3')]=function(){utils[_0x2caf('0x2')]('SHUTDOWN');};exports[_0x2caf('0x4')]=function(){utils['info'](_0x2caf('0x5'));};exports[_0x2caf('0x6')]=function(_0x249a4b){utils['error'](_0x249a4b);};exports[_0x2caf('0x7')]=function(){utils[_0x2caf('0x2')](_0x2caf('0x8'));};exports[_0x2caf('0x9')]=function(_0x5611aa){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 75c0a98..80fdc26 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 _0xc822=['outboundrouteid','value','dialbegin','isNil','assign','starttime','now','lastevent','called','dialend','dialstatus','ANSWER','answertime','connect','complete','duration','diffTime','endtime','holdtime','billableseconds','lodash','util','./utils','info','DIAL|%s|%s|%s|%s|%s|%s','channel','dialstring','request','CreateVoiceDialReport','uniqueid','newexten','application','set','appdata','cdr(routeid)','split','error','stack','varset'];(function(_0x17a32f,_0x5a51a){var _0x15a293=function(_0x55fbd3){while(--_0x55fbd3){_0x17a32f['push'](_0x17a32f['shift']());}};_0x15a293(++_0x5a51a);}(_0xc822,0xd7));var _0x2c82=function(_0x4c80d7,_0x2bef29){_0x4c80d7=_0x4c80d7-0x0;var _0x3c5095=_0xc822[_0x4c80d7];return _0x3c5095;};'use strict';var _=require(_0x2c82('0x0'));var util=require(_0x2c82('0x1'));var utils=require(_0x2c82('0x2'));var dials={};function writeDB(_0x457d12){utils[_0x2c82('0x3')](util['format'](_0x2c82('0x4'),_0x457d12['uniqueid'],_0x457d12[_0x2c82('0x5')],_0x457d12[_0x2c82('0x6')],_0x457d12['calleridnum'],_0x457d12['connectedlinenum'],_0x457d12['dialstatus']));utils[_0x2c82('0x7')](_0x2c82('0x8'),_0x457d12);delete dials[_0x457d12[_0x2c82('0x9')]];}exports[_0x2c82('0xa')]=function(_0x54d290){try{if(_0x54d290[_0x2c82('0xb')]['toLowerCase']()==_0x2c82('0xc')&&_['startsWith'](_0x54d290[_0x2c82('0xd')]['toLowerCase'](),_0x2c82('0xe'))){var _0x4fbe37=_0x54d290[_0x2c82('0xd')][_0x2c82('0xf')]('=');dials[_0x54d290[_0x2c82('0x9')]]={'routeId':_0x4fbe37[0x1]};}}catch(_0x6d8475){utils[_0x2c82('0x10')](_0x6d8475[_0x2c82('0x11')]);}};exports[_0x2c82('0x12')]=function(_0x550d88){try{if(!_['isNil'](_0x550d88['variable'][_0x2c82('0x13')])){dials[_0x550d88[_0x2c82('0x9')]]={'routeId':_0x550d88[_0x2c82('0x14')]};}}catch(_0x49bb33){utils[_0x2c82('0x10')](_0x49bb33[_0x2c82('0x11')]);}};exports[_0x2c82('0x15')]=function(_0x3bbdb2){try{if(!_[_0x2c82('0x16')](dials[_0x3bbdb2[_0x2c82('0x9')]])){dials[_0x3bbdb2[_0x2c82('0x9')]]=_[_0x2c82('0x17')](dials[_0x3bbdb2['uniqueid']],_0x3bbdb2);dials[_0x3bbdb2['uniqueid']][_0x2c82('0x18')]=utils[_0x2c82('0x19')]();dials[_0x3bbdb2[_0x2c82('0x9')]][_0x2c82('0x1a')]=_0x2c82('0x1b');}}catch(_0xf75dfc){utils[_0x2c82('0x10')](_0xf75dfc[_0x2c82('0x11')]);}};exports[_0x2c82('0x1c')]=function(_0x113fd1){try{if(!_[_0x2c82('0x16')](dials[_0x113fd1[_0x2c82('0x9')]])){dials[_0x113fd1['uniqueid']][_0x2c82('0x1d')]=_0x113fd1[_0x2c82('0x1d')];if(_0x113fd1[_0x2c82('0x1d')]==_0x2c82('0x1e')){dials[_0x113fd1[_0x2c82('0x9')]]=_[_0x2c82('0x17')](dials[_0x113fd1[_0x2c82('0x9')]],_0x113fd1);dials[_0x113fd1[_0x2c82('0x9')]][_0x2c82('0x1f')]=utils[_0x2c82('0x19')]();dials[_0x113fd1[_0x2c82('0x9')]][_0x2c82('0x1a')]=_0x2c82('0x20');}}}catch(_0x1873c0){utils[_0x2c82('0x10')](_0x1873c0[_0x2c82('0x11')]);}};exports['hangup']=function(_0x29850e){try{if(!_['isNil'](dials[_0x29850e['uniqueid']])){dials[_0x29850e[_0x2c82('0x9')]]=_[_0x2c82('0x17')](dials[_0x29850e[_0x2c82('0x9')]],{'endtime':utils[_0x2c82('0x19')](),'lastevent':_0x2c82('0x21')});dials[_0x29850e[_0x2c82('0x9')]][_0x2c82('0x22')]=utils[_0x2c82('0x23')](dials[_0x29850e[_0x2c82('0x9')]][_0x2c82('0x24')],dials[_0x29850e[_0x2c82('0x9')]]['starttime']);dials[_0x29850e[_0x2c82('0x9')]][_0x2c82('0x25')]=utils['diffTime'](dials[_0x29850e[_0x2c82('0x9')]][_0x2c82('0x1f')]||dials[_0x29850e[_0x2c82('0x9')]][_0x2c82('0x24')],dials[_0x29850e[_0x2c82('0x9')]]['starttime']);dials[_0x29850e[_0x2c82('0x9')]][_0x2c82('0x26')]=dials[_0x29850e[_0x2c82('0x9')]][_0x2c82('0x1f')]?utils['diffTime'](dials[_0x29850e[_0x2c82('0x9')]][_0x2c82('0x24')],dials[_0x29850e[_0x2c82('0x9')]][_0x2c82('0x1f')]):0x0;writeDB(dials[_0x29850e['uniqueid']]);}}catch(_0x42af08){utils['error'](_0x42af08[_0x2c82('0x11')]);}}; \ No newline at end of file +var _0x0a97=['holdtime','diffTime','billableseconds','lodash','util','./utils','info','format','DIAL|%s|%s|%s|%s|%s|%s','uniqueid','dialstring','request','CreateVoiceDialReport','newexten','application','toLowerCase','set','startsWith','appdata','split','error','isNil','outboundrouteid','value','stack','dialbegin','assign','starttime','now','dialend','dialstatus','ANSWER','answertime','hangup','endtime'];(function(_0x2caf37,_0x319fac){var _0x522bf7=function(_0x14c922){while(--_0x14c922){_0x2caf37['push'](_0x2caf37['shift']());}};_0x522bf7(++_0x319fac);}(_0x0a97,0x1a7));var _0x70a9=function(_0x2080a3,_0x48acfa){_0x2080a3=_0x2080a3-0x0;var _0x8d7d17=_0x0a97[_0x2080a3];return _0x8d7d17;};'use strict';var _=require(_0x70a9('0x0'));var util=require(_0x70a9('0x1'));var utils=require(_0x70a9('0x2'));var dials={};function writeDB(_0x2f02af){utils[_0x70a9('0x3')](util[_0x70a9('0x4')](_0x70a9('0x5'),_0x2f02af[_0x70a9('0x6')],_0x2f02af['channel'],_0x2f02af[_0x70a9('0x7')],_0x2f02af['calleridnum'],_0x2f02af['connectedlinenum'],_0x2f02af['dialstatus']));utils[_0x70a9('0x8')](_0x70a9('0x9'),_0x2f02af);delete dials[_0x2f02af['uniqueid']];}exports[_0x70a9('0xa')]=function(_0x3179c7){try{if(_0x3179c7[_0x70a9('0xb')][_0x70a9('0xc')]()==_0x70a9('0xd')&&_[_0x70a9('0xe')](_0x3179c7[_0x70a9('0xf')][_0x70a9('0xc')](),'cdr(routeid)')){var _0x24dbfd=_0x3179c7[_0x70a9('0xf')][_0x70a9('0x10')]('=');dials[_0x3179c7[_0x70a9('0x6')]]={'routeId':_0x24dbfd[0x1]};}}catch(_0x5a4000){utils[_0x70a9('0x11')](_0x5a4000['stack']);}};exports['varset']=function(_0x5f2b1d){try{if(!_[_0x70a9('0x12')](_0x5f2b1d['variable'][_0x70a9('0x13')])){dials[_0x5f2b1d[_0x70a9('0x6')]]={'routeId':_0x5f2b1d[_0x70a9('0x14')]};}}catch(_0x418f4b){utils[_0x70a9('0x11')](_0x418f4b[_0x70a9('0x15')]);}};exports[_0x70a9('0x16')]=function(_0x54c03b){try{if(!_['isNil'](dials[_0x54c03b[_0x70a9('0x6')]])){dials[_0x54c03b[_0x70a9('0x6')]]=_[_0x70a9('0x17')](dials[_0x54c03b[_0x70a9('0x6')]],_0x54c03b);dials[_0x54c03b['uniqueid']][_0x70a9('0x18')]=utils[_0x70a9('0x19')]();dials[_0x54c03b[_0x70a9('0x6')]]['lastevent']='called';}}catch(_0xf6cf0d){utils[_0x70a9('0x11')](_0xf6cf0d[_0x70a9('0x15')]);}};exports[_0x70a9('0x1a')]=function(_0x4bf476){try{if(!_['isNil'](dials[_0x4bf476[_0x70a9('0x6')]])){dials[_0x4bf476[_0x70a9('0x6')]][_0x70a9('0x1b')]=_0x4bf476['dialstatus'];if(_0x4bf476[_0x70a9('0x1b')]==_0x70a9('0x1c')){dials[_0x4bf476[_0x70a9('0x6')]]=_['assign'](dials[_0x4bf476[_0x70a9('0x6')]],_0x4bf476);dials[_0x4bf476[_0x70a9('0x6')]][_0x70a9('0x1d')]=utils[_0x70a9('0x19')]();dials[_0x4bf476[_0x70a9('0x6')]]['lastevent']='connect';}}}catch(_0x16d6ac){utils['error'](_0x16d6ac[_0x70a9('0x15')]);}};exports[_0x70a9('0x1e')]=function(_0x5e0759){try{if(!_[_0x70a9('0x12')](dials[_0x5e0759[_0x70a9('0x6')]])){dials[_0x5e0759[_0x70a9('0x6')]]=_['assign'](dials[_0x5e0759['uniqueid']],{'endtime':utils[_0x70a9('0x19')](),'lastevent':'complete'});dials[_0x5e0759[_0x70a9('0x6')]]['duration']=utils['diffTime'](dials[_0x5e0759['uniqueid']][_0x70a9('0x1f')],dials[_0x5e0759['uniqueid']][_0x70a9('0x18')]);dials[_0x5e0759[_0x70a9('0x6')]][_0x70a9('0x20')]=utils[_0x70a9('0x21')](dials[_0x5e0759[_0x70a9('0x6')]]['answertime']||dials[_0x5e0759[_0x70a9('0x6')]][_0x70a9('0x1f')],dials[_0x5e0759['uniqueid']][_0x70a9('0x18')]);dials[_0x5e0759[_0x70a9('0x6')]][_0x70a9('0x22')]=dials[_0x5e0759[_0x70a9('0x6')]]['answertime']?utils[_0x70a9('0x21')](dials[_0x5e0759[_0x70a9('0x6')]][_0x70a9('0x1f')],dials[_0x5e0759[_0x70a9('0x6')]][_0x70a9('0x1d')]):0x0;writeDB(dials[_0x5e0759['uniqueid']]);}}catch(_0x2970f0){utils[_0x70a9('0x11')](_0x2970f0[_0x70a9('0x15')]);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index de6fe44..c9ddea8 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 _0x1c5f=['newexten','newchannel','dialbegin','dialend','asterisk-manager','../../config/environment','./utils','asterisk','port','username','password','keepConnected','xdr','info','XDR\x20DISABLED','./agents.controller','./queues.controller','./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'];(function(_0x2fba57,_0x266b67){var _0x54ffbf=function(_0x1a9179){while(--_0x1a9179){_0x2fba57['push'](_0x2fba57['shift']());}};_0x54ffbf(++_0x266b67);}(_0x1c5f,0x123));var _0xf1c5=function(_0x372bf0,_0x5643c0){_0x372bf0=_0x372bf0-0x0;var _0x425d0c=_0x1c5f[_0x372bf0];return _0x425d0c;};var AsteriskManager=require(_0xf1c5('0x0'));var config=require(_0xf1c5('0x1'));var utils=require(_0xf1c5('0x2'));var ami=new AsteriskManager(config[_0xf1c5('0x3')][_0xf1c5('0x4')],config['asterisk']['ip'],config[_0xf1c5('0x3')][_0xf1c5('0x5')],config['asterisk'][_0xf1c5('0x6')],!![]);ami[_0xf1c5('0x7')]();if(config[_0xf1c5('0x8')]&&config[_0xf1c5('0x8')]['disabled']){utils[_0xf1c5('0x9')](_0xf1c5('0xa'));}else{var agents=require(_0xf1c5('0xb'));var calls=require('./calls.controller');var queues=require(_0xf1c5('0xc'));var recordings=require(_0xf1c5('0xd'));var members=require('./members.controller');var dials=require(_0xf1c5('0xe'));var transfers=require('./transfers.controller');var core=require(_0xf1c5('0xf'));ami['on'](_0xf1c5('0x10'),core[_0xf1c5('0x10')]);ami['on'](_0xf1c5('0x11'),core[_0xf1c5('0x11')]);ami['on']('fullybooted',core[_0xf1c5('0x12')]);ami['on'](_0xf1c5('0x13'),core[_0xf1c5('0x13')]);ami['on']('close',core['close']);ami['on'](_0xf1c5('0x14'),core[_0xf1c5('0x14')]);ami['on'](_0xf1c5('0x15'),function(_0x50a39b){try{members[_0xf1c5('0x15')](_0x50a39b);}catch(_0x55fea9){utils[_0xf1c5('0x13')](_0x55fea9);}});ami['on'](_0xf1c5('0x16'),function(_0x3e93df){try{agents['agentcalled'](_0x3e93df);}catch(_0x581086){utils[_0xf1c5('0x13')](_0x581086);}});ami['on'](_0xf1c5('0x17'),function(_0x5d0ca4){try{agents[_0xf1c5('0x17')](_0x5d0ca4);}catch(_0x2ae018){utils[_0xf1c5('0x13')](_0x2ae018);}});ami['on'](_0xf1c5('0x18'),function(_0x34ccd0){try{agents[_0xf1c5('0x18')](_0x34ccd0);queues[_0xf1c5('0x18')](_0x34ccd0);}catch(_0x4914d5){utils[_0xf1c5('0x13')](_0x4914d5);}});ami['on']('agentcomplete',function(_0xa42fea){try{agents['agentcomplete'](_0xa42fea);queues['agentcomplete'](_0xa42fea);members[_0xf1c5('0x19')](_0xa42fea);}catch(_0x334399){utils[_0xf1c5('0x13')](_0x334399);}});ami['on'](_0xf1c5('0x1a'),function(_0x212e95){try{agents[_0xf1c5('0x1a')](_0x212e95);queues[_0xf1c5('0x1a')](_0x212e95);}catch(_0x3c9866){utils[_0xf1c5('0x13')](_0x3c9866);}});ami['on']('queuecallerjoin',function(_0x5a4922){try{queues[_0xf1c5('0x1b')](_0x5a4922);recordings[_0xf1c5('0x1b')](_0x5a4922);}catch(_0x38ae21){utils['error'](_0x38ae21);}});ami['on'](_0xf1c5('0x1c'),function(_0x5f1b27){try{queues['queuecallerleave'](_0x5f1b27);}catch(_0x1e6c05){utils[_0xf1c5('0x13')](_0x1e6c05);}});ami['on'](_0xf1c5('0x1d'),function(_0x3c8750){try{queues[_0xf1c5('0x1d')](_0x3c8750);calls[_0xf1c5('0x1d')](_0x3c8750);}catch(_0x65ceae){utils[_0xf1c5('0x13')](_0x65ceae);}});ami['on'](_0xf1c5('0x1e'),function(_0x410db0){try{queues[_0xf1c5('0x1e')](_0x410db0);calls['musiconholdstop'](_0x410db0);}catch(_0xae454d){utils['error'](_0xae454d);}});ami['on'](_0xf1c5('0x1f'),function(_0x11c63e){try{calls[_0xf1c5('0x1f')](_0x11c63e);recordings[_0xf1c5('0x1f')](_0x11c63e);}catch(_0x41e9df){utils[_0xf1c5('0x13')](_0x41e9df);}});ami['on']('hangup',function(_0x4aa6b5){try{calls[_0xf1c5('0x20')](_0x4aa6b5);recordings[_0xf1c5('0x20')](_0x4aa6b5);dials[_0xf1c5('0x20')](_0x4aa6b5);agents[_0xf1c5('0x20')](_0x4aa6b5);queues[_0xf1c5('0x20')](_0x4aa6b5);}catch(_0x23d1b7){utils[_0xf1c5('0x13')](_0x23d1b7);}});ami['on'](_0xf1c5('0x21'),function(_0x13f146){try{members[_0xf1c5('0x21')](_0x13f146);}catch(_0x234bbf){utils[_0xf1c5('0x13')](_0x234bbf);}});ami['on'](_0xf1c5('0x22'),function(_0x3aa2d5){try{queues['blindtransfer'](_0x3aa2d5);agents[_0xf1c5('0x22')](_0x3aa2d5);transfers[_0xf1c5('0x22')](_0x3aa2d5);}catch(_0x493b29){utils[_0xf1c5('0x13')](_0x493b29);}});ami['on'](_0xf1c5('0x23'),function(_0x53bb66){try{queues[_0xf1c5('0x23')](_0x53bb66);transfers['attendedtransfer'](_0x53bb66);agents[_0xf1c5('0x23')](_0x53bb66);calls[_0xf1c5('0x23')](_0x53bb66);}catch(_0x4d3f08){utils[_0xf1c5('0x13')](_0x4d3f08);}});ami['on'](_0xf1c5('0x24'),function(_0x5c33e7){try{queues[_0xf1c5('0x24')](_0x5c33e7);recordings[_0xf1c5('0x24')](_0x5c33e7);calls[_0xf1c5('0x24')](_0x5c33e7);dials[_0xf1c5('0x24')](_0x5c33e7);}catch(_0x3b28a8){utils[_0xf1c5('0x13')](_0x3b28a8);}});ami['on'](_0xf1c5('0x25'),function(_0x442b53){try{calls[_0xf1c5('0x25')](_0x442b53);recordings[_0xf1c5('0x25')](_0x442b53);dials[_0xf1c5('0x25')](_0x442b53);}catch(_0x265549){utils[_0xf1c5('0x13')](_0x265549);}});ami['on']('newchannel',function(_0x2ffcc3){try{calls[_0xf1c5('0x26')](_0x2ffcc3);recordings[_0xf1c5('0x26')](_0x2ffcc3);}catch(_0x48a528){utils['error'](_0x48a528);}});ami['on'](_0xf1c5('0x27'),function(_0x4620d0){try{dials[_0xf1c5('0x27')](_0x4620d0);}catch(_0x345f9a){utils['error'](_0x345f9a);}});ami['on']('dialend',function(_0x55b26d){try{dials[_0xf1c5('0x28')](_0x55b26d);}catch(_0x2a7051){utils[_0xf1c5('0x13')](_0x2a7051);}});} \ No newline at end of file +var _0x3e4e=['asterisk','username','keepConnected','xdr','disabled','info','XDR\x20DISABLED','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','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','port'];(function(_0x1e74d4,_0x41bed3){var _0x416147=function(_0x2f5474){while(--_0x2f5474){_0x1e74d4['push'](_0x1e74d4['shift']());}};_0x416147(++_0x41bed3);}(_0x3e4e,0xd4));var _0xe3e4=function(_0x5b8296,_0x3c54ae){_0x5b8296=_0x5b8296-0x0;var _0x1856af=_0x3e4e[_0x5b8296];return _0x1856af;};var AsteriskManager=require(_0xe3e4('0x0'));var config=require(_0xe3e4('0x1'));var utils=require('./utils');var ami=new AsteriskManager(config['asterisk'][_0xe3e4('0x2')],config[_0xe3e4('0x3')]['ip'],config['asterisk'][_0xe3e4('0x4')],config['asterisk']['password'],!![]);ami[_0xe3e4('0x5')]();if(config['xdr']&&config[_0xe3e4('0x6')][_0xe3e4('0x7')]){utils[_0xe3e4('0x8')](_0xe3e4('0x9'));}else{var agents=require('./agents.controller');var calls=require(_0xe3e4('0xa'));var queues=require(_0xe3e4('0xb'));var recordings=require(_0xe3e4('0xc'));var members=require(_0xe3e4('0xd'));var dials=require(_0xe3e4('0xe'));var transfers=require(_0xe3e4('0xf'));var core=require(_0xe3e4('0x10'));ami['on'](_0xe3e4('0x11'),core['connect']);ami['on'](_0xe3e4('0x12'),core[_0xe3e4('0x12')]);ami['on'](_0xe3e4('0x13'),core[_0xe3e4('0x13')]);ami['on'](_0xe3e4('0x14'),core[_0xe3e4('0x14')]);ami['on']('close',core[_0xe3e4('0x15')]);ami['on']('managerevent',core[_0xe3e4('0x16')]);ami['on'](_0xe3e4('0x17'),function(_0x53de6e){try{members[_0xe3e4('0x17')](_0x53de6e);}catch(_0x2b5ad2){utils['error'](_0x2b5ad2);}});ami['on'](_0xe3e4('0x18'),function(_0x556c14){try{agents[_0xe3e4('0x18')](_0x556c14);}catch(_0x59e090){utils[_0xe3e4('0x14')](_0x59e090);}});ami['on'](_0xe3e4('0x19'),function(_0x1854ff){try{agents['agentringnoanswer'](_0x1854ff);}catch(_0x35b679){utils['error'](_0x35b679);}});ami['on']('agentconnect',function(_0x3df7ad){try{agents[_0xe3e4('0x1a')](_0x3df7ad);queues[_0xe3e4('0x1a')](_0x3df7ad);}catch(_0xfe307b){utils[_0xe3e4('0x14')](_0xfe307b);}});ami['on']('agentcomplete',function(_0x56036d){try{agents[_0xe3e4('0x1b')](_0x56036d);queues[_0xe3e4('0x1b')](_0x56036d);members[_0xe3e4('0x1b')](_0x56036d);}catch(_0x5d7128){utils['error'](_0x5d7128);}});ami['on'](_0xe3e4('0x1c'),function(_0x228ad3){try{agents[_0xe3e4('0x1c')](_0x228ad3);queues[_0xe3e4('0x1c')](_0x228ad3);}catch(_0x3f8cce){utils['error'](_0x3f8cce);}});ami['on'](_0xe3e4('0x1d'),function(_0x2ef994){try{queues[_0xe3e4('0x1d')](_0x2ef994);recordings[_0xe3e4('0x1d')](_0x2ef994);}catch(_0x589b8d){utils[_0xe3e4('0x14')](_0x589b8d);}});ami['on']('queuecallerleave',function(_0x4d397b){try{queues[_0xe3e4('0x1e')](_0x4d397b);}catch(_0x4907d3){utils[_0xe3e4('0x14')](_0x4907d3);}});ami['on'](_0xe3e4('0x1f'),function(_0xbd697d){try{queues[_0xe3e4('0x1f')](_0xbd697d);calls[_0xe3e4('0x1f')](_0xbd697d);}catch(_0x27e44d){utils[_0xe3e4('0x14')](_0x27e44d);}});ami['on'](_0xe3e4('0x20'),function(_0x1b75dc){try{queues['musiconholdstop'](_0x1b75dc);calls['musiconholdstop'](_0x1b75dc);}catch(_0x2d763a){utils[_0xe3e4('0x14')](_0x2d763a);}});ami['on'](_0xe3e4('0x21'),function(_0x5331f7){try{calls[_0xe3e4('0x21')](_0x5331f7);recordings[_0xe3e4('0x21')](_0x5331f7);}catch(_0x2b82f9){utils[_0xe3e4('0x14')](_0x2b82f9);}});ami['on']('hangup',function(_0x27cc2d){try{calls['hangup'](_0x27cc2d);recordings[_0xe3e4('0x22')](_0x27cc2d);dials[_0xe3e4('0x22')](_0x27cc2d);agents[_0xe3e4('0x22')](_0x27cc2d);queues[_0xe3e4('0x22')](_0x27cc2d);}catch(_0x46bab6){utils[_0xe3e4('0x14')](_0x46bab6);}});ami['on'](_0xe3e4('0x23'),function(_0xee241d){try{members[_0xe3e4('0x23')](_0xee241d);}catch(_0x2b3445){utils[_0xe3e4('0x14')](_0x2b3445);}});ami['on'](_0xe3e4('0x24'),function(_0x418775){try{queues[_0xe3e4('0x24')](_0x418775);agents[_0xe3e4('0x24')](_0x418775);transfers[_0xe3e4('0x24')](_0x418775);}catch(_0x1a20d9){utils[_0xe3e4('0x14')](_0x1a20d9);}});ami['on'](_0xe3e4('0x25'),function(_0x1140e8){try{queues[_0xe3e4('0x25')](_0x1140e8);transfers[_0xe3e4('0x25')](_0x1140e8);agents[_0xe3e4('0x25')](_0x1140e8);calls[_0xe3e4('0x25')](_0x1140e8);}catch(_0x1c8a3b){utils[_0xe3e4('0x14')](_0x1c8a3b);}});ami['on'](_0xe3e4('0x26'),function(_0x489f25){try{queues[_0xe3e4('0x26')](_0x489f25);recordings[_0xe3e4('0x26')](_0x489f25);calls[_0xe3e4('0x26')](_0x489f25);dials['varset'](_0x489f25);}catch(_0x2dc174){utils['error'](_0x2dc174);}});ami['on'](_0xe3e4('0x27'),function(_0x44cdac){try{calls[_0xe3e4('0x27')](_0x44cdac);recordings[_0xe3e4('0x27')](_0x44cdac);dials['newexten'](_0x44cdac);}catch(_0x360937){utils[_0xe3e4('0x14')](_0x360937);}});ami['on']('newchannel',function(_0x37d163){try{calls[_0xe3e4('0x28')](_0x37d163);recordings['newchannel'](_0x37d163);}catch(_0x42cce6){utils['error'](_0x42cce6);}});ami['on'](_0xe3e4('0x29'),function(_0x1a57c5){try{dials[_0xe3e4('0x29')](_0x1a57c5);}catch(_0xda8941){utils['error'](_0xda8941);}});ami['on']('dialend',function(_0x2950d5){try{dials[_0xe3e4('0x2a')](_0x2950d5);}catch(_0x23e43b){utils[_0xe3e4('0x14')](_0x23e43b);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 24d9704..bb2d0e7 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 _0x82f5=['cdr','channel','data1','source','data3','destination','data2','util','./utils','Local/_attended@transfer','Queue:','info','format','MEMBER|%s|%s|%s|%s|%s|%s','uniqueid','type','interface','name','internal','request','CreateMemberReport','getUserByName','split','then','membername','catch','error','startsWith','state','INUSE','BUSY','device','voice','TALKING','now','agent','NOT_INUSE','exitAt','diffTime','agentcomplete','isNil','assign','queue'];(function(_0x24eebe,_0x5f68ad){var _0x533899=function(_0x311f1b){while(--_0x311f1b){_0x24eebe['push'](_0x24eebe['shift']());}};_0x533899(++_0x5f68ad);}(_0x82f5,0x18a));var _0x582f=function(_0x288975,_0x3fd763){_0x288975=_0x288975-0x0;var _0x328bb3=_0x82f5[_0x288975];return _0x328bb3;};'use strict';var _=require('lodash');var util=require(_0x582f('0x0'));var utils=require(_0x582f('0x1'));var members={};var exclude=[_0x582f('0x2'),_0x582f('0x3')];function writeDB(_0x4b2fc3){utils[_0x582f('0x4')](util[_0x582f('0x5')](_0x582f('0x6'),_0x4b2fc3[_0x582f('0x7')],_0x4b2fc3['interface'],_0x4b2fc3['channel'],_0x4b2fc3['data2'],_0x4b2fc3['membername'],_0x4b2fc3[_0x582f('0x8')]));if(_0x4b2fc3[_0x582f('0x9')]){utils['getUserByInterface'](_0x4b2fc3['interface'])['then'](function(_0x196a32){if(_0x196a32){_0x4b2fc3['membername']=_0x196a32[_0x582f('0xa')];_0x4b2fc3['internal']=_0x196a32[_0x582f('0xb')];utils[_0x582f('0xc')](_0x582f('0xd'),_0x4b2fc3);}else{utils[_0x582f('0xe')](_0x4b2fc3[_0x582f('0x9')][_0x582f('0xf')]('/')[0x1])[_0x582f('0x10')](function(_0x40c3ac){if(_0x40c3ac){_0x4b2fc3[_0x582f('0x11')]=_0x40c3ac[_0x582f('0xa')];_0x4b2fc3[_0x582f('0xb')]=_0x40c3ac[_0x582f('0xb')];utils[_0x582f('0xc')]('CreateMemberReport',_0x4b2fc3);}});}})[_0x582f('0x12')](function(_0x347b4b){utils[_0x582f('0x13')](_0x347b4b);});}delete members[_0x4b2fc3[_0x582f('0x9')]];}function startsWith(_0x554a38,_0x1219b3){return _['some'](_0x554a38,function(_0x3b9162){return _[_0x582f('0x14')](_0x1219b3,_0x3b9162);});}exports['devicestatechange']=function(_0x762888){switch(_0x762888[_0x582f('0x15')]){case _0x582f('0x16'):case _0x582f('0x17'):if(!startsWith(exclude,_0x762888['device'])){members[_0x762888[_0x582f('0x18')]]={'channel':_0x582f('0x19'),'interface':_0x762888['device'],'type':_0x582f('0x1a'),'enterAt':utils[_0x582f('0x1b')](),'role':_0x582f('0x1c')};}break;case _0x582f('0x1d'):if(!_['isNil'](members[_0x762888[_0x582f('0x18')]])){members[_0x762888[_0x582f('0x18')]][_0x582f('0x1e')]=utils[_0x582f('0x1b')]();members[_0x762888[_0x582f('0x18')]]['duration']=utils[_0x582f('0x1f')](members[_0x762888[_0x582f('0x18')]][_0x582f('0x1e')],members[_0x762888[_0x582f('0x18')]]['enterAt']);if(members[_0x762888[_0x582f('0x18')]][_0x582f('0x7')]){writeDB(members[_0x762888[_0x582f('0x18')]]);}}default:break;}};exports[_0x582f('0x20')]=function(_0x4b5886){if(!_[_0x582f('0x21')](members[_0x4b5886['interface']])){members[_0x4b5886[_0x582f('0x9')]]=_[_0x582f('0x22')](members[_0x4b5886[_0x582f('0x9')]],{'data4':_0x4b5886[_0x582f('0x23')],'uniqueid':_0x4b5886['uniqueid']});}};exports[_0x582f('0x24')]=function(_0x292d7a){if(_0x292d7a[_0x582f('0x25')]){var _0x5cda2a=_0x292d7a['channel'][_0x582f('0xf')]('-')[0x0];if(!_[_0x582f('0x21')](members[_0x5cda2a])){members[_0x5cda2a]=_[_0x582f('0x22')](members[_0x5cda2a],{'data1':members[_0x5cda2a][_0x582f('0x26')]||_0x292d7a[_0x582f('0x8')],'data2':members[_0x5cda2a]['data2']||_0x292d7a[_0x582f('0x27')],'data3':members[_0x5cda2a][_0x582f('0x28')]||_0x292d7a[_0x582f('0x29')],'uniqueid':members[_0x5cda2a][_0x582f('0x7')]||_0x292d7a[_0x582f('0x7')]});if(members[_0x5cda2a]['exitAt']){writeDB(members[_0x5cda2a]);}}}if(_0x292d7a['destinationchannel']){var _0x4bf366=_0x292d7a['destinationchannel']['split']('-')[0x0];if(!_[_0x582f('0x21')](members[_0x4bf366])){members[_0x4bf366]=_[_0x582f('0x22')](members[_0x4bf366],{'data1':members[_0x4bf366]['data1']||_0x292d7a[_0x582f('0x8')],'data2':members[_0x4bf366][_0x582f('0x2a')]||_0x292d7a['source'],'data3':members[_0x4bf366][_0x582f('0x28')]||_0x292d7a[_0x582f('0x29')],'uniqueid':members[_0x4bf366][_0x582f('0x7')]||_0x292d7a[_0x582f('0x7')]});if(members[_0x4bf366][_0x582f('0x1e')]){writeDB(members[_0x4bf366]);}}}}; \ No newline at end of file +var _0x466d=['Queue:','info','format','MEMBER|%s|%s|%s|%s|%s|%s','uniqueid','interface','channel','data2','membername','getUserByInterface','name','internal','request','CreateMemberReport','getUserByName','then','catch','error','devicestatechange','state','INUSE','BUSY','device','voice','TALKING','now','agent','NOT_INUSE','exitAt','duration','enterAt','agentcomplete','isNil','assign','queue','split','data1','type','source','data3','destination','lodash','util','./utils','Local/_attended@transfer'];(function(_0x328061,_0x2aa6d9){var _0x4ea035=function(_0x330173){while(--_0x330173){_0x328061['push'](_0x328061['shift']());}};_0x4ea035(++_0x2aa6d9);}(_0x466d,0x10a));var _0xd466=function(_0x4ca6a4,_0x5e9694){_0x4ca6a4=_0x4ca6a4-0x0;var _0x120555=_0x466d[_0x4ca6a4];return _0x120555;};'use strict';var _=require(_0xd466('0x0'));var util=require(_0xd466('0x1'));var utils=require(_0xd466('0x2'));var members={};var exclude=[_0xd466('0x3'),_0xd466('0x4')];function writeDB(_0x360c34){utils[_0xd466('0x5')](util[_0xd466('0x6')](_0xd466('0x7'),_0x360c34[_0xd466('0x8')],_0x360c34[_0xd466('0x9')],_0x360c34[_0xd466('0xa')],_0x360c34[_0xd466('0xb')],_0x360c34[_0xd466('0xc')],_0x360c34['type']));if(_0x360c34[_0xd466('0x9')]){utils[_0xd466('0xd')](_0x360c34[_0xd466('0x9')])['then'](function(_0x2650a3){if(_0x2650a3){_0x360c34[_0xd466('0xc')]=_0x2650a3[_0xd466('0xe')];_0x360c34[_0xd466('0xf')]=_0x2650a3['internal'];utils[_0xd466('0x10')](_0xd466('0x11'),_0x360c34);}else{utils[_0xd466('0x12')](_0x360c34[_0xd466('0x9')]['split']('/')[0x1])[_0xd466('0x13')](function(_0x50c79d){if(_0x50c79d){_0x360c34[_0xd466('0xc')]=_0x50c79d['name'];_0x360c34[_0xd466('0xf')]=_0x50c79d[_0xd466('0xf')];utils[_0xd466('0x10')](_0xd466('0x11'),_0x360c34);}});}})[_0xd466('0x14')](function(_0x38a48c){utils[_0xd466('0x15')](_0x38a48c);});}delete members[_0x360c34[_0xd466('0x9')]];}function startsWith(_0x30af84,_0x4c1d6a){return _['some'](_0x30af84,function(_0x174936){return _['startsWith'](_0x4c1d6a,_0x174936);});}exports[_0xd466('0x16')]=function(_0x145559){switch(_0x145559[_0xd466('0x17')]){case _0xd466('0x18'):case _0xd466('0x19'):if(!startsWith(exclude,_0x145559[_0xd466('0x1a')])){members[_0x145559[_0xd466('0x1a')]]={'channel':_0xd466('0x1b'),'interface':_0x145559[_0xd466('0x1a')],'type':_0xd466('0x1c'),'enterAt':utils[_0xd466('0x1d')](),'role':_0xd466('0x1e')};}break;case _0xd466('0x1f'):if(!_['isNil'](members[_0x145559[_0xd466('0x1a')]])){members[_0x145559[_0xd466('0x1a')]][_0xd466('0x20')]=utils[_0xd466('0x1d')]();members[_0x145559[_0xd466('0x1a')]][_0xd466('0x21')]=utils['diffTime'](members[_0x145559[_0xd466('0x1a')]][_0xd466('0x20')],members[_0x145559['device']][_0xd466('0x22')]);if(members[_0x145559[_0xd466('0x1a')]][_0xd466('0x8')]){writeDB(members[_0x145559[_0xd466('0x1a')]]);}}default:break;}};exports[_0xd466('0x23')]=function(_0x37808e){if(!_[_0xd466('0x24')](members[_0x37808e[_0xd466('0x9')]])){members[_0x37808e[_0xd466('0x9')]]=_[_0xd466('0x25')](members[_0x37808e[_0xd466('0x9')]],{'data4':_0x37808e[_0xd466('0x26')],'uniqueid':_0x37808e[_0xd466('0x8')]});}};exports['cdr']=function(_0x574dc6){if(_0x574dc6[_0xd466('0xa')]){var _0xc6cdac=_0x574dc6[_0xd466('0xa')][_0xd466('0x27')]('-')[0x0];if(!_[_0xd466('0x24')](members[_0xc6cdac])){members[_0xc6cdac]=_[_0xd466('0x25')](members[_0xc6cdac],{'data1':members[_0xc6cdac][_0xd466('0x28')]||_0x574dc6[_0xd466('0x29')],'data2':members[_0xc6cdac][_0xd466('0xb')]||_0x574dc6[_0xd466('0x2a')],'data3':members[_0xc6cdac][_0xd466('0x2b')]||_0x574dc6[_0xd466('0x2c')],'uniqueid':members[_0xc6cdac][_0xd466('0x8')]||_0x574dc6[_0xd466('0x8')]});if(members[_0xc6cdac][_0xd466('0x20')]){writeDB(members[_0xc6cdac]);}}}if(_0x574dc6['destinationchannel']){var _0x1038af=_0x574dc6['destinationchannel']['split']('-')[0x0];if(!_['isNil'](members[_0x1038af])){members[_0x1038af]=_['assign'](members[_0x1038af],{'data1':members[_0x1038af]['data1']||_0x574dc6['type'],'data2':members[_0x1038af][_0xd466('0xb')]||_0x574dc6[_0xd466('0x2a')],'data3':members[_0x1038af][_0xd466('0x2b')]||_0x574dc6['destination'],'uniqueid':members[_0x1038af]['uniqueid']||_0x574dc6[_0xd466('0x8')]});if(members[_0x1038af][_0xd466('0x20')]){writeDB(members[_0x1038af]);}}}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 966f528..39f4276 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 _0x67bf=['mohtime','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','error','stack','musiconholdstart','musiconholdstartAt','musiconholdstop','lodash','./utils','info','format','uniqueid','channel','queue','lastAssignedTo','calleridnum','queuecallerexitreason','type','request','transfereduniqueid','queuecallerjoin','assign','now','hangup','isNil','queuecallerleaveAt','queuecallerabandon','queuecallercompleteAt','COMPLETEDBYAGENT','queuecallerenterreason','variable','queuestatus','queuecallerabandonAt','queuecallerexitAt','toUpperCase','queueposition','queuecallerexit','holdtime','diffTime','position','count','connectedlinenum','connectedlinename','agentconnect','assigned','accountcode','destaccountcode','membername','agentcomplete','transfer','TRANSFER','COMPLETEDBY','blindtransfer','transfereeuniqueid','transferexten','BLINDTRANSFER','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','transfertype','ATTENDED','origtransfererexten','transferuniqueid','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridname','queuecallerjoinAt'];(function(_0x3f43c2,_0x3b54f3){var _0x542695=function(_0x89c88f){while(--_0x89c88f){_0x3f43c2['push'](_0x3f43c2['shift']());}};_0x542695(++_0x3b54f3);}(_0x67bf,0xe1));var _0xf67b=function(_0x43b6f9,_0x2b066b){_0x43b6f9=_0x43b6f9-0x0;var _0x5e20ee=_0x67bf[_0x43b6f9];return _0x5e20ee;};'use strict';var _=require(_0xf67b('0x0'));var util=require('util');var utils=require(_0xf67b('0x1'));var queues={};function writeDB(_0x374567){utils[_0xf67b('0x2')](util[_0xf67b('0x3')]('QUEUE|%s|%s|%s|%s|%s|%s|%s',_0x374567[_0xf67b('0x4')],_0x374567[_0xf67b('0x5')],_0x374567[_0xf67b('0x6')],_0x374567[_0xf67b('0x7')],_0x374567[_0xf67b('0x8')],_0x374567['accountcode'],_0x374567[_0xf67b('0x9')]));if(_0x374567[_0xf67b('0x6')]){utils['getVoiceQueueByName'](_0x374567['queue'])['then'](function(_0x332a25){if(_0x332a25){_0x374567[_0xf67b('0xa')]=_0x332a25[_0xf67b('0xa')];}utils['request']('CreateVoiceQueueReport',_0x374567);});}else{utils[_0xf67b('0xb')]('CreateVoiceQueueReport',_0x374567);}if(_0x374567[_0xf67b('0xc')]){delete queues[_0x374567[_0xf67b('0xc')]];}else{delete queues[_0x374567[_0xf67b('0x4')]];}}exports[_0xf67b('0xd')]=function(_0x545ab4){queues[_0x545ab4[_0xf67b('0x4')]]=_[_0xf67b('0xe')](_0x545ab4,{'originalposition':_0x545ab4['position'],'queuecallerjoinAt':utils[_0xf67b('0xf')](),'mohtime':0x0});};exports[_0xf67b('0x10')]=function(_0x39c412){if(!_[_0xf67b('0x11')](queues[_0x39c412[_0xf67b('0x4')]])){if(queues[_0x39c412[_0xf67b('0x4')]][_0xf67b('0x12')]){if(!queues[_0x39c412[_0xf67b('0x4')]][_0xf67b('0x13')]&&!queues[_0x39c412['uniqueid']]['queuecallerexit']){queues[_0x39c412[_0xf67b('0x4')]]['queuecallercomplete']=!![];queues[_0x39c412[_0xf67b('0x4')]][_0xf67b('0x14')]=utils['now']();queues[_0x39c412['uniqueid']]['queuecallerexitreason']=_0xf67b('0x15');}writeDB(queues[_0x39c412[_0xf67b('0x4')]]);}else{if(queues[_0x39c412[_0xf67b('0x4')]][_0xf67b('0xc')]){queues[queues[_0x39c412[_0xf67b('0x4')]][_0xf67b('0xc')]]=queues[_0x39c412[_0xf67b('0x4')]];queues[queues[_0x39c412[_0xf67b('0x4')]][_0xf67b('0xc')]][_0xf67b('0x16')]=0x2;delete queues[_0x39c412[_0xf67b('0x4')]];}}}};exports['varset']=function(_0x499265){if(!_[_0xf67b('0x11')](_0x499265[_0xf67b('0x17')][_0xf67b('0x18')])){if(!_['isNil'](queues[_0x499265['uniqueid']])){queues[_0x499265[_0xf67b('0x4')]]['queuecallerabandon']=![];queues[_0x499265[_0xf67b('0x4')]][_0xf67b('0x19')]=null;queues[_0x499265[_0xf67b('0x4')]]['queuecallerexit']=!![];queues[_0x499265[_0xf67b('0x4')]][_0xf67b('0x1a')]=utils['now']();queues[_0x499265[_0xf67b('0x4')]][_0xf67b('0x9')]=_0x499265['value'][_0xf67b('0x1b')]();writeDB(queues[_0x499265['uniqueid']]);}}else if(!_[_0xf67b('0x11')](_0x499265[_0xf67b('0x17')][_0xf67b('0x1c')])){if(!_['isNil'](queues[_0x499265[_0xf67b('0x4')]])&&!queues[_0x499265[_0xf67b('0x4')]][_0xf67b('0x13')]){queues[_0x499265[_0xf67b('0x4')]][_0xf67b('0x13')]=![];queues[_0x499265[_0xf67b('0x4')]][_0xf67b('0x19')]=null;queues[_0x499265[_0xf67b('0x4')]]['queuecallerexit']=!![];queues[_0x499265[_0xf67b('0x4')]][_0xf67b('0x1a')]=utils[_0xf67b('0xf')]();queues[_0x499265[_0xf67b('0x4')]][_0xf67b('0x9')]='EXITWITHKEY';}}};exports[_0xf67b('0x13')]=function(_0x277eaf){if(!_[_0xf67b('0x11')](queues[_0x277eaf[_0xf67b('0x4')]])){queues[_0x277eaf['uniqueid']][_0xf67b('0x1d')]=![];queues[_0x277eaf[_0xf67b('0x4')]]['queuecallerexitAt']=null;queues[_0x277eaf[_0xf67b('0x4')]][_0xf67b('0x13')]=!![];queues[_0x277eaf['uniqueid']]['queuecallerabandonAt']=utils['now']();queues[_0x277eaf['uniqueid']][_0xf67b('0x9')]='ABANDONED';}};exports['queuecallerleave']=function(_0x2023d3){if(!_[_0xf67b('0x11')](queues[_0x2023d3[_0xf67b('0x4')]])){queues[_0x2023d3[_0xf67b('0x4')]]['queuecallerleave']=!![];queues[_0x2023d3[_0xf67b('0x4')]]['queuecallerleaveAt']=utils[_0xf67b('0xf')]();queues[_0x2023d3['uniqueid']][_0xf67b('0x1e')]=utils[_0xf67b('0x1f')](queues[_0x2023d3[_0xf67b('0x4')]][_0xf67b('0x12')],queues[_0x2023d3[_0xf67b('0x4')]]['queuecallerjoinAt']);queues[_0x2023d3[_0xf67b('0x4')]][_0xf67b('0x20')]=_0x2023d3['position'];queues[_0x2023d3[_0xf67b('0x4')]][_0xf67b('0x21')]=_0x2023d3['count'];queues[_0x2023d3[_0xf67b('0x4')]][_0xf67b('0x22')]=_0x2023d3[_0xf67b('0x22')];queues[_0x2023d3[_0xf67b('0x4')]][_0xf67b('0x23')]=_0x2023d3[_0xf67b('0x23')];}};exports[_0xf67b('0x24')]=function(_0x33ed7e){if(!_['isNil'](queues[_0x33ed7e['uniqueid']])){queues[_0x33ed7e[_0xf67b('0x4')]]['queuecallerabandon']=![];queues[_0x33ed7e[_0xf67b('0x4')]]['queuecallerabandon']=![];queues[_0x33ed7e[_0xf67b('0x4')]][_0xf67b('0x19')]=null;queues[_0x33ed7e[_0xf67b('0x4')]][_0xf67b('0x1d')]=![];queues[_0x33ed7e[_0xf67b('0x4')]]['queuecallerexitAt']=null;queues[_0x33ed7e[_0xf67b('0x4')]][_0xf67b('0x25')]=!![];queues[_0x33ed7e[_0xf67b('0x4')]][_0xf67b('0x26')]=_0x33ed7e[_0xf67b('0x27')];queues[_0x33ed7e['uniqueid']][_0xf67b('0x7')]=_0x33ed7e[_0xf67b('0x28')];}};exports[_0xf67b('0x29')]=function(_0x42dd32){if(!_[_0xf67b('0x11')](queues[_0x42dd32['uniqueid']])){if(queues[_0x42dd32[_0xf67b('0x4')]][_0xf67b('0x12')]){queues[_0x42dd32[_0xf67b('0x4')]][_0xf67b('0x13')]=![];queues[_0x42dd32[_0xf67b('0x4')]][_0xf67b('0x13')]=![];queues[_0x42dd32['uniqueid']][_0xf67b('0x19')]=null;queues[_0x42dd32[_0xf67b('0x4')]][_0xf67b('0x1d')]=![];queues[_0x42dd32[_0xf67b('0x4')]][_0xf67b('0x1a')]=null;queues[_0x42dd32[_0xf67b('0x4')]][_0xf67b('0x25')]=!![];queues[_0x42dd32[_0xf67b('0x4')]][_0xf67b('0x7')]=_0x42dd32[_0xf67b('0x28')];queues[_0x42dd32[_0xf67b('0x4')]]['queuecallercomplete']=!![];queues[_0x42dd32[_0xf67b('0x4')]][_0xf67b('0x14')]=utils[_0xf67b('0xf')]();if(_0x42dd32['reason']=='transfer'){if(!queues[_0x42dd32['uniqueid']][_0xf67b('0x2a')]){queues[_0x42dd32[_0xf67b('0x4')]]['queuecallerexitreason']=_0xf67b('0x2b');}}else{queues[_0x42dd32['uniqueid']]['queuecallerexitreason']=_0xf67b('0x2c')+_0x42dd32['reason']['toUpperCase']();}writeDB(queues[_0x42dd32[_0xf67b('0x4')]]);}}};exports[_0xf67b('0x2d')]=function(_0x1ca58e){if(!_[_0xf67b('0x11')](queues[_0x1ca58e[_0xf67b('0x2e')]])){queues[_0x1ca58e['transfereeuniqueid']][_0xf67b('0x2a')]=!![];queues[_0x1ca58e[_0xf67b('0x2e')]]['transfertype']='BLIND';queues[_0x1ca58e[_0xf67b('0x2e')]][_0xf67b('0x2f')]=_0x1ca58e['extension'];queues[_0x1ca58e[_0xf67b('0x2e')]]['transferuniqueid']=_0x1ca58e['transfereeuniqueid'];queues[_0x1ca58e['transfereeuniqueid']][_0xf67b('0x9')]=_0xf67b('0x30');}};exports[_0xf67b('0x31')]=function(_0x814a3a){try{if(_0x814a3a[_0xf67b('0x32')]==_0x814a3a[_0xf67b('0x33')]){if(!_[_0xf67b('0x11')](queues[_0x814a3a[_0xf67b('0x34')]])){queues[_0x814a3a[_0xf67b('0x34')]]['transfer']=!![];queues[_0x814a3a[_0xf67b('0x34')]][_0xf67b('0x35')]=_0xf67b('0x36');queues[_0x814a3a[_0xf67b('0x34')]][_0xf67b('0x2f')]=_0x814a3a[_0xf67b('0x37')];queues[_0x814a3a[_0xf67b('0x34')]][_0xf67b('0x38')]=_0x814a3a['origtransfereruniqueid'];queues[_0x814a3a[_0xf67b('0x34')]][_0xf67b('0x9')]=_0xf67b('0x39');}if(!_[_0xf67b('0x11')](queues[_0x814a3a[_0xf67b('0x33')]])){if(_0x814a3a[_0xf67b('0x3a')]&&queues[_0x814a3a[_0xf67b('0x3a')]]){queues[_0x814a3a[_0xf67b('0x3a')]]['queuecallerenterreason']=0x1;queues[_0x814a3a['transfereeuniqueid']]=_[_0xf67b('0x3b')](queues[_0x814a3a['transfereelinkedid']]);queues[_0x814a3a['transfereeuniqueid']][_0xf67b('0xc')]=_0x814a3a[_0xf67b('0x3c')];queues[_0x814a3a[_0xf67b('0x2e')]][_0xf67b('0x16')]=0x2;queues[_0x814a3a['transfereeuniqueid']][_0xf67b('0x8')]=queues[_0x814a3a['secondtransfererlinkedid']][_0xf67b('0x8')];queues[_0x814a3a[_0xf67b('0x2e')]][_0xf67b('0x3d')]=queues[_0x814a3a[_0xf67b('0x34')]][_0xf67b('0x3d')];queues[_0x814a3a[_0xf67b('0x2e')]][_0xf67b('0x3e')]=utils['now']();queues[_0x814a3a['transfereeuniqueid']][_0xf67b('0x12')]=utils[_0xf67b('0xf')]();queues[_0x814a3a['transfereeuniqueid']][_0xf67b('0x1e')]=0x0;queues[_0x814a3a['transfereeuniqueid']][_0xf67b('0x3f')]=0x0;}else{queues[_0x814a3a[_0xf67b('0x33')]][_0xf67b('0xc')]=_0x814a3a[_0xf67b('0x34')];}}}else if(_0x814a3a[_0xf67b('0x40')]==_0x814a3a[_0xf67b('0x34')]){if(!_[_0xf67b('0x11')](queues[_0x814a3a[_0xf67b('0x33')]])){queues[_0x814a3a[_0xf67b('0x33')]]['transfer']=!![];queues[_0x814a3a['origtransfererlinkedid']][_0xf67b('0x35')]='ATTENDED';queues[_0x814a3a[_0xf67b('0x33')]][_0xf67b('0x2f')]=_0x814a3a[_0xf67b('0x41')];queues[_0x814a3a[_0xf67b('0x33')]][_0xf67b('0x38')]=_0x814a3a[_0xf67b('0x40')];queues[_0x814a3a[_0xf67b('0x33')]][_0xf67b('0x9')]=_0xf67b('0x39');}if(!_[_0xf67b('0x11')](queues[_0x814a3a[_0xf67b('0x34')]])){if(_0x814a3a['transfertargetlinkedid']&&queues[_0x814a3a[_0xf67b('0x42')]]){queues[_0x814a3a['transfertargetlinkedid']][_0xf67b('0x16')]=0x1;queues[_0x814a3a[_0xf67b('0x3c')]]=_['clone'](queues[_0x814a3a[_0xf67b('0x42')]]);queues[_0x814a3a[_0xf67b('0x3c')]][_0xf67b('0xc')]=_0x814a3a[_0xf67b('0x3c')];queues[_0x814a3a[_0xf67b('0x3c')]][_0xf67b('0x16')]=0x2;queues[_0x814a3a[_0xf67b('0x3c')]][_0xf67b('0x8')]=queues[_0x814a3a[_0xf67b('0x33')]]['calleridnum'];queues[_0x814a3a['transfertargetuniqueid']]['calleridname']=queues[_0x814a3a['origtransfererlinkedid']][_0xf67b('0x3d')];queues[_0x814a3a[_0xf67b('0x3c')]][_0xf67b('0x3e')]=utils[_0xf67b('0xf')]();queues[_0x814a3a['transfertargetuniqueid']]['queuecallerleaveAt']=utils[_0xf67b('0xf')]();queues[_0x814a3a[_0xf67b('0x3c')]][_0xf67b('0x1e')]=0x0;queues[_0x814a3a[_0xf67b('0x3c')]][_0xf67b('0x3f')]=0x0;}else{queues[_0x814a3a['secondtransfererlinkedid']][_0xf67b('0xc')]=_0x814a3a['origtransfererlinkedid'];}}}}catch(_0x2a8f67){utils[_0xf67b('0x43')](_0x2a8f67[_0xf67b('0x44')]);}};exports[_0xf67b('0x45')]=function(_0x342756){if(!_[_0xf67b('0x11')](queues[_0x342756['uniqueid']])){queues[_0x342756[_0xf67b('0x4')]][_0xf67b('0x46')]=utils[_0xf67b('0xf')]();}};exports[_0xf67b('0x47')]=function(_0x1bb0a1){if(!_[_0xf67b('0x11')](queues[_0x1bb0a1[_0xf67b('0x4')]])){if(!_[_0xf67b('0x11')](queues[_0x1bb0a1['uniqueid']]['musiconholdstartAt'])){queues[_0x1bb0a1[_0xf67b('0x4')]][_0xf67b('0x3f')]+=utils[_0xf67b('0x1f')](utils[_0xf67b('0xf')](),queues[_0x1bb0a1[_0xf67b('0x4')]]['musiconholdstartAt']);delete queues[_0x1bb0a1[_0xf67b('0x4')]][_0xf67b('0x46')];}}}; \ No newline at end of file +var _0x0962=['queuecallerenterreason','queuestatus','queuecallerabandonAt','value','queueposition','queuecallerexitAt','ABANDONED','queuecallerleave','queuecallerleaveAt','diffTime','queuecallerjoinAt','position','count','connectedlinenum','connectedlinename','agentconnect','assigned','destaccountcode','membername','agentcomplete','reason','transfer','TRANSFER','COMPLETEDBY','toUpperCase','blindtransfer','transfereeuniqueid','BLIND','extension','BLINDTRANSFER','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','ATTENDED','transferexten','origtransfererexten','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridnum','calleridname','holdtime','transfertype','secondtransfererexten','transferuniqueid','secondtransfereruniqueid','transfertargetlinkedid','mohtime','musiconholdstart','musiconholdstartAt','musiconholdstop','lodash','util','./utils','info','format','QUEUE|%s|%s|%s|%s|%s|%s|%s','uniqueid','queue','lastAssignedTo','accountcode','queuecallerexitreason','then','type','CreateVoiceQueueReport','request','transfereduniqueid','now','isNil','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt'];(function(_0x3f465d,_0xbd2037){var _0x121ad1=function(_0x5b13d6){while(--_0x5b13d6){_0x3f465d['push'](_0x3f465d['shift']());}};_0x121ad1(++_0xbd2037);}(_0x0962,0x116));var _0x2096=function(_0x23c1e9,_0x3915b4){_0x23c1e9=_0x23c1e9-0x0;var _0x20365d=_0x0962[_0x23c1e9];return _0x20365d;};'use strict';var _=require(_0x2096('0x0'));var util=require(_0x2096('0x1'));var utils=require(_0x2096('0x2'));var queues={};function writeDB(_0x237146){utils[_0x2096('0x3')](util[_0x2096('0x4')](_0x2096('0x5'),_0x237146[_0x2096('0x6')],_0x237146['channel'],_0x237146[_0x2096('0x7')],_0x237146[_0x2096('0x8')],_0x237146['calleridnum'],_0x237146[_0x2096('0x9')],_0x237146[_0x2096('0xa')]));if(_0x237146[_0x2096('0x7')]){utils['getVoiceQueueByName'](_0x237146['queue'])[_0x2096('0xb')](function(_0x4c21c6){if(_0x4c21c6){_0x237146[_0x2096('0xc')]=_0x4c21c6[_0x2096('0xc')];}utils['request'](_0x2096('0xd'),_0x237146);});}else{utils[_0x2096('0xe')](_0x2096('0xd'),_0x237146);}if(_0x237146[_0x2096('0xf')]){delete queues[_0x237146['transfereduniqueid']];}else{delete queues[_0x237146[_0x2096('0x6')]];}}exports['queuecallerjoin']=function(_0x125fa8){queues[_0x125fa8['uniqueid']]=_['assign'](_0x125fa8,{'originalposition':_0x125fa8['position'],'queuecallerjoinAt':utils[_0x2096('0x10')](),'mohtime':0x0});};exports['hangup']=function(_0x64dd4c){if(!_[_0x2096('0x11')](queues[_0x64dd4c[_0x2096('0x6')]])){if(queues[_0x64dd4c[_0x2096('0x6')]]['queuecallerleaveAt']){if(!queues[_0x64dd4c['uniqueid']][_0x2096('0x12')]&&!queues[_0x64dd4c[_0x2096('0x6')]][_0x2096('0x13')]){queues[_0x64dd4c[_0x2096('0x6')]][_0x2096('0x14')]=!![];queues[_0x64dd4c[_0x2096('0x6')]][_0x2096('0x15')]=utils[_0x2096('0x10')]();queues[_0x64dd4c['uniqueid']]['queuecallerexitreason']='COMPLETEDBYAGENT';}writeDB(queues[_0x64dd4c[_0x2096('0x6')]]);}else{if(queues[_0x64dd4c['uniqueid']]['transfereduniqueid']){queues[queues[_0x64dd4c['uniqueid']][_0x2096('0xf')]]=queues[_0x64dd4c[_0x2096('0x6')]];queues[queues[_0x64dd4c[_0x2096('0x6')]][_0x2096('0xf')]][_0x2096('0x16')]=0x2;delete queues[_0x64dd4c[_0x2096('0x6')]];}}}};exports['varset']=function(_0x47fcd2){if(!_['isNil'](_0x47fcd2['variable'][_0x2096('0x17')])){if(!_[_0x2096('0x11')](queues[_0x47fcd2[_0x2096('0x6')]])){queues[_0x47fcd2['uniqueid']][_0x2096('0x12')]=![];queues[_0x47fcd2[_0x2096('0x6')]][_0x2096('0x18')]=null;queues[_0x47fcd2[_0x2096('0x6')]]['queuecallerexit']=!![];queues[_0x47fcd2[_0x2096('0x6')]]['queuecallerexitAt']=utils['now']();queues[_0x47fcd2['uniqueid']]['queuecallerexitreason']=_0x47fcd2[_0x2096('0x19')]['toUpperCase']();writeDB(queues[_0x47fcd2[_0x2096('0x6')]]);}}else if(!_[_0x2096('0x11')](_0x47fcd2['variable'][_0x2096('0x1a')])){if(!_[_0x2096('0x11')](queues[_0x47fcd2[_0x2096('0x6')]])&&!queues[_0x47fcd2['uniqueid']]['queuecallerabandon']){queues[_0x47fcd2[_0x2096('0x6')]][_0x2096('0x12')]=![];queues[_0x47fcd2[_0x2096('0x6')]]['queuecallerabandonAt']=null;queues[_0x47fcd2[_0x2096('0x6')]][_0x2096('0x13')]=!![];queues[_0x47fcd2[_0x2096('0x6')]][_0x2096('0x1b')]=utils[_0x2096('0x10')]();queues[_0x47fcd2[_0x2096('0x6')]][_0x2096('0xa')]='EXITWITHKEY';}}};exports['queuecallerabandon']=function(_0x194bca){if(!_[_0x2096('0x11')](queues[_0x194bca[_0x2096('0x6')]])){queues[_0x194bca[_0x2096('0x6')]][_0x2096('0x13')]=![];queues[_0x194bca[_0x2096('0x6')]][_0x2096('0x1b')]=null;queues[_0x194bca[_0x2096('0x6')]]['queuecallerabandon']=!![];queues[_0x194bca['uniqueid']]['queuecallerabandonAt']=utils[_0x2096('0x10')]();queues[_0x194bca[_0x2096('0x6')]][_0x2096('0xa')]=_0x2096('0x1c');}};exports[_0x2096('0x1d')]=function(_0x27897b){if(!_[_0x2096('0x11')](queues[_0x27897b[_0x2096('0x6')]])){queues[_0x27897b['uniqueid']][_0x2096('0x1d')]=!![];queues[_0x27897b['uniqueid']][_0x2096('0x1e')]=utils[_0x2096('0x10')]();queues[_0x27897b[_0x2096('0x6')]]['holdtime']=utils[_0x2096('0x1f')](queues[_0x27897b[_0x2096('0x6')]][_0x2096('0x1e')],queues[_0x27897b[_0x2096('0x6')]][_0x2096('0x20')]);queues[_0x27897b[_0x2096('0x6')]][_0x2096('0x21')]=_0x27897b[_0x2096('0x21')];queues[_0x27897b[_0x2096('0x6')]][_0x2096('0x22')]=_0x27897b[_0x2096('0x22')];queues[_0x27897b['uniqueid']][_0x2096('0x23')]=_0x27897b[_0x2096('0x23')];queues[_0x27897b[_0x2096('0x6')]]['connectedlinename']=_0x27897b[_0x2096('0x24')];}};exports[_0x2096('0x25')]=function(_0x43240c){if(!_[_0x2096('0x11')](queues[_0x43240c[_0x2096('0x6')]])){queues[_0x43240c[_0x2096('0x6')]]['queuecallerabandon']=![];queues[_0x43240c['uniqueid']][_0x2096('0x12')]=![];queues[_0x43240c[_0x2096('0x6')]][_0x2096('0x18')]=null;queues[_0x43240c[_0x2096('0x6')]]['queuecallerexit']=![];queues[_0x43240c[_0x2096('0x6')]][_0x2096('0x1b')]=null;queues[_0x43240c[_0x2096('0x6')]][_0x2096('0x26')]=!![];queues[_0x43240c['uniqueid']][_0x2096('0x9')]=_0x43240c[_0x2096('0x27')];queues[_0x43240c['uniqueid']][_0x2096('0x8')]=_0x43240c[_0x2096('0x28')];}};exports[_0x2096('0x29')]=function(_0x2f4dd2){if(!_[_0x2096('0x11')](queues[_0x2f4dd2[_0x2096('0x6')]])){if(queues[_0x2f4dd2[_0x2096('0x6')]][_0x2096('0x1e')]){queues[_0x2f4dd2[_0x2096('0x6')]][_0x2096('0x12')]=![];queues[_0x2f4dd2['uniqueid']][_0x2096('0x12')]=![];queues[_0x2f4dd2[_0x2096('0x6')]][_0x2096('0x18')]=null;queues[_0x2f4dd2[_0x2096('0x6')]][_0x2096('0x13')]=![];queues[_0x2f4dd2['uniqueid']]['queuecallerexitAt']=null;queues[_0x2f4dd2[_0x2096('0x6')]][_0x2096('0x26')]=!![];queues[_0x2f4dd2[_0x2096('0x6')]][_0x2096('0x8')]=_0x2f4dd2[_0x2096('0x28')];queues[_0x2f4dd2[_0x2096('0x6')]]['queuecallercomplete']=!![];queues[_0x2f4dd2[_0x2096('0x6')]][_0x2096('0x15')]=utils[_0x2096('0x10')]();if(_0x2f4dd2[_0x2096('0x2a')]==_0x2096('0x2b')){if(!queues[_0x2f4dd2[_0x2096('0x6')]][_0x2096('0x2b')]){queues[_0x2f4dd2[_0x2096('0x6')]][_0x2096('0xa')]=_0x2096('0x2c');}}else{queues[_0x2f4dd2[_0x2096('0x6')]][_0x2096('0xa')]=_0x2096('0x2d')+_0x2f4dd2[_0x2096('0x2a')][_0x2096('0x2e')]();}writeDB(queues[_0x2f4dd2['uniqueid']]);}}};exports[_0x2096('0x2f')]=function(_0x5d7daf){if(!_[_0x2096('0x11')](queues[_0x5d7daf[_0x2096('0x30')]])){queues[_0x5d7daf[_0x2096('0x30')]][_0x2096('0x2b')]=!![];queues[_0x5d7daf[_0x2096('0x30')]]['transfertype']=_0x2096('0x31');queues[_0x5d7daf[_0x2096('0x30')]]['transferexten']=_0x5d7daf[_0x2096('0x32')];queues[_0x5d7daf[_0x2096('0x30')]]['transferuniqueid']=_0x5d7daf['transfereeuniqueid'];queues[_0x5d7daf[_0x2096('0x30')]][_0x2096('0xa')]=_0x2096('0x33');}};exports[_0x2096('0x34')]=function(_0x2a8ac7){try{if(_0x2a8ac7[_0x2096('0x35')]==_0x2a8ac7[_0x2096('0x36')]){if(!_[_0x2096('0x11')](queues[_0x2a8ac7[_0x2096('0x37')]])){queues[_0x2a8ac7[_0x2096('0x37')]][_0x2096('0x2b')]=!![];queues[_0x2a8ac7[_0x2096('0x37')]]['transfertype']=_0x2096('0x38');queues[_0x2a8ac7['secondtransfererlinkedid']][_0x2096('0x39')]=_0x2a8ac7[_0x2096('0x3a')];queues[_0x2a8ac7[_0x2096('0x37')]]['transferuniqueid']=_0x2a8ac7[_0x2096('0x35')];queues[_0x2a8ac7[_0x2096('0x37')]][_0x2096('0xa')]=_0x2096('0x3b');}if(!_[_0x2096('0x11')](queues[_0x2a8ac7[_0x2096('0x36')]])){if(_0x2a8ac7[_0x2096('0x3c')]&&queues[_0x2a8ac7[_0x2096('0x3c')]]){queues[_0x2a8ac7['transfereelinkedid']]['queuecallerenterreason']=0x1;queues[_0x2a8ac7[_0x2096('0x30')]]=_[_0x2096('0x3d')](queues[_0x2a8ac7['transfereelinkedid']]);queues[_0x2a8ac7[_0x2096('0x30')]]['transfereduniqueid']=_0x2a8ac7[_0x2096('0x3e')];queues[_0x2a8ac7[_0x2096('0x30')]][_0x2096('0x16')]=0x2;queues[_0x2a8ac7[_0x2096('0x30')]][_0x2096('0x3f')]=queues[_0x2a8ac7['secondtransfererlinkedid']]['calleridnum'];queues[_0x2a8ac7[_0x2096('0x30')]][_0x2096('0x40')]=queues[_0x2a8ac7[_0x2096('0x37')]][_0x2096('0x40')];queues[_0x2a8ac7[_0x2096('0x30')]][_0x2096('0x20')]=utils[_0x2096('0x10')]();queues[_0x2a8ac7[_0x2096('0x30')]][_0x2096('0x1e')]=utils[_0x2096('0x10')]();queues[_0x2a8ac7[_0x2096('0x30')]][_0x2096('0x41')]=0x0;queues[_0x2a8ac7[_0x2096('0x30')]]['mohtime']=0x0;}else{queues[_0x2a8ac7[_0x2096('0x36')]][_0x2096('0xf')]=_0x2a8ac7['secondtransfererlinkedid'];}}}else if(_0x2a8ac7['secondtransfereruniqueid']==_0x2a8ac7[_0x2096('0x37')]){if(!_['isNil'](queues[_0x2a8ac7[_0x2096('0x36')]])){queues[_0x2a8ac7[_0x2096('0x36')]][_0x2096('0x2b')]=!![];queues[_0x2a8ac7[_0x2096('0x36')]][_0x2096('0x42')]=_0x2096('0x38');queues[_0x2a8ac7[_0x2096('0x36')]][_0x2096('0x39')]=_0x2a8ac7[_0x2096('0x43')];queues[_0x2a8ac7[_0x2096('0x36')]][_0x2096('0x44')]=_0x2a8ac7[_0x2096('0x45')];queues[_0x2a8ac7['origtransfererlinkedid']][_0x2096('0xa')]=_0x2096('0x3b');}if(!_[_0x2096('0x11')](queues[_0x2a8ac7[_0x2096('0x37')]])){if(_0x2a8ac7['transfertargetlinkedid']&&queues[_0x2a8ac7[_0x2096('0x46')]]){queues[_0x2a8ac7[_0x2096('0x46')]]['queuecallerenterreason']=0x1;queues[_0x2a8ac7[_0x2096('0x3e')]]=_[_0x2096('0x3d')](queues[_0x2a8ac7[_0x2096('0x46')]]);queues[_0x2a8ac7[_0x2096('0x3e')]][_0x2096('0xf')]=_0x2a8ac7[_0x2096('0x3e')];queues[_0x2a8ac7[_0x2096('0x3e')]][_0x2096('0x16')]=0x2;queues[_0x2a8ac7['transfertargetuniqueid']][_0x2096('0x3f')]=queues[_0x2a8ac7['origtransfererlinkedid']][_0x2096('0x3f')];queues[_0x2a8ac7['transfertargetuniqueid']][_0x2096('0x40')]=queues[_0x2a8ac7[_0x2096('0x36')]][_0x2096('0x40')];queues[_0x2a8ac7[_0x2096('0x3e')]][_0x2096('0x20')]=utils[_0x2096('0x10')]();queues[_0x2a8ac7['transfertargetuniqueid']][_0x2096('0x1e')]=utils[_0x2096('0x10')]();queues[_0x2a8ac7[_0x2096('0x3e')]]['holdtime']=0x0;queues[_0x2a8ac7[_0x2096('0x3e')]][_0x2096('0x47')]=0x0;}else{queues[_0x2a8ac7['secondtransfererlinkedid']]['transfereduniqueid']=_0x2a8ac7['origtransfererlinkedid'];}}}}catch(_0x236a4d){utils['error'](_0x236a4d['stack']);}};exports[_0x2096('0x48')]=function(_0x50bde2){if(!_['isNil'](queues[_0x50bde2[_0x2096('0x6')]])){queues[_0x50bde2[_0x2096('0x6')]][_0x2096('0x49')]=utils[_0x2096('0x10')]();}};exports[_0x2096('0x4a')]=function(_0x595f6b){if(!_[_0x2096('0x11')](queues[_0x595f6b[_0x2096('0x6')]])){if(!_[_0x2096('0x11')](queues[_0x595f6b[_0x2096('0x6')]][_0x2096('0x49')])){queues[_0x595f6b[_0x2096('0x6')]][_0x2096('0x47')]+=utils[_0x2096('0x1f')](utils[_0x2096('0x10')](),queues[_0x595f6b[_0x2096('0x6')]][_0x2096('0x49')]);delete queues[_0x595f6b[_0x2096('0x6')]]['musiconholdstartAt'];}}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 203da16..c4d06ed 100644 --- a/server/services/xdr/recordings.controller.js +++ b/server/services/xdr/recordings.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['uniqueid','channelstate','transfer','error','varset','variable','mixmonitor_filename','endsWith','value','.wav49','replace','.WAV','find','monitors','push','hangup','calleridnum','calleridname','connectedlinenum','connectedlinename','type','outbound','clone','newexten','toLowerCase','startsWith','appdata','cdr','split','substring','lastIndexOf','queuecallerjoin','queue','debug','accountcode','getUserByInternal','then','name','UserId','CreateVoiceRecording','request','newchannel','linkedid','exten','context','channel','stack','newstate','isNil'];(function(_0x4fdefb,_0x4bdfdc){var _0x468822=function(_0x5d38de){while(--_0x5d38de){_0x4fdefb['push'](_0x4fdefb['shift']());}};_0x468822(++_0x4bdfdc);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x37c07d,_0xdbdb5f){_0x37c07d=_0x37c07d-0x0;var _0x10dadc=_0xcb91[_0x37c07d];return _0x10dadc;};'use strict';var _=require('lodash');var utils=require('./utils');var recordings={};function writeDB(_0x26fe42){utils[_0x1cb9('0x0')](_0x26fe42);if(_0x26fe42[_0x1cb9('0x1')]){utils[_0x1cb9('0x2')](_0x26fe42['accountcode'])[_0x1cb9('0x3')](function(_0x2c17b8){if(_0x2c17b8){_0x26fe42['membername']=_0x2c17b8[_0x1cb9('0x4')];_0x26fe42[_0x1cb9('0x5')]=_0x2c17b8['id'];}utils['request'](_0x1cb9('0x6'),_0x26fe42);});}else{utils[_0x1cb9('0x7')]('CreateVoiceRecording',_0x26fe42);}}exports[_0x1cb9('0x8')]=function(_0x12567c){try{if(_0x12567c['uniqueid']==_0x12567c[_0x1cb9('0x9')]){recordings[_0x12567c['uniqueid']]={'uniqueid':_0x12567c['uniqueid'],'accountcode':_0x12567c[_0x1cb9('0x1')],'exten':_0x12567c[_0x1cb9('0xa')],'context':_0x12567c[_0x1cb9('0xb')],'channel':_0x12567c[_0x1cb9('0xc')],'monitors':[]};}}catch(_0x2fc627){utils['error'](_0x2fc627[_0x1cb9('0xd')]);}};exports[_0x1cb9('0xe')]=function(_0x3af35f){try{if(!_[_0x1cb9('0xf')](recordings[_0x3af35f[_0x1cb9('0x10')]])&&_0x3af35f['channelstate']==0x6){}else if(!_['isNil'](recordings[_0x3af35f['linkedid']])&&_0x3af35f[_0x1cb9('0x11')]==0x6&&_0x3af35f[_0x1cb9('0xb')]!=_0x1cb9('0x12')){recordings[_0x3af35f[_0x1cb9('0x9')]]['accountcode']=_0x3af35f[_0x1cb9('0x1')];}}catch(_0x6ef389){utils[_0x1cb9('0x13')](_0x6ef389[_0x1cb9('0xd')]);}};exports[_0x1cb9('0x14')]=function(_0x5806d8){try{if(!_['isNil'](_0x5806d8[_0x1cb9('0x15')])&&!_[_0x1cb9('0xf')](_0x5806d8[_0x1cb9('0x15')][_0x1cb9('0x16')])){if(_[_0x1cb9('0x17')](_0x5806d8[_0x1cb9('0x18')],_0x1cb9('0x19'))){_0x5806d8['value']=_0x5806d8['value'][_0x1cb9('0x1a')](_0x1cb9('0x19'),_0x1cb9('0x1b'));}if(recordings[_0x5806d8[_0x1cb9('0x9')]]){var _0x280a84=_[_0x1cb9('0x1c')](recordings[_0x5806d8[_0x1cb9('0x9')]]['monitors'],{'value':_0x5806d8['value']});if(_[_0x1cb9('0xf')](_0x280a84)){recordings[_0x5806d8['linkedid']][_0x1cb9('0x1d')][_0x1cb9('0x1e')]({'value':_0x5806d8['value']});}}}}catch(_0x599275){utils[_0x1cb9('0x13')](_0x599275[_0x1cb9('0xd')]);}};exports[_0x1cb9('0x1f')]=function(_0x4601b8){try{if(!_[_0x1cb9('0xf')](recordings[_0x4601b8[_0x1cb9('0x10')]])){recordings[_0x4601b8['uniqueid']]['calleridnum']=_0x4601b8[_0x1cb9('0x20')];recordings[_0x4601b8['uniqueid']][_0x1cb9('0x21')]=_0x4601b8[_0x1cb9('0x21')];recordings[_0x4601b8[_0x1cb9('0x10')]][_0x1cb9('0x22')]=_0x4601b8[_0x1cb9('0x22')];recordings[_0x4601b8['uniqueid']][_0x1cb9('0x23')]=_0x4601b8[_0x1cb9('0x23')];if(recordings[_0x4601b8['uniqueid']][_0x1cb9('0x24')]==_0x1cb9('0x25')&&recordings[_0x4601b8[_0x1cb9('0x10')]][_0x1cb9('0x1')]){recordings[_0x4601b8[_0x1cb9('0x10')]][_0x1cb9('0x22')]=recordings[_0x4601b8[_0x1cb9('0x10')]][_0x1cb9('0x1')];recordings[_0x4601b8[_0x1cb9('0x10')]][_0x1cb9('0x23')]='';}recordings[_0x4601b8['uniqueid']][_0x1cb9('0x1d')]['forEach'](_0x110282=>{var _0x4efebc=_[_0x1cb9('0x26')](recordings[_0x4601b8[_0x1cb9('0x10')]]);_0x4efebc[_0x1cb9('0x18')]=_0x110282[_0x1cb9('0x18')];writeDB(_0x4efebc);});delete recordings[_0x4601b8['uniqueid']];}}catch(_0x1c701f){utils['error'](_0x1c701f[_0x1cb9('0xd')]);}};exports[_0x1cb9('0x27')]=function(_0x4220d7){try{if(!_['isNil'](recordings[_0x4220d7[_0x1cb9('0x10')]])){if(_0x4220d7['application'][_0x1cb9('0x28')]()=='set'&&_[_0x1cb9('0x29')](_0x4220d7[_0x1cb9('0x2a')][_0x1cb9('0x28')](),_0x1cb9('0x2b'))){var _0x56c3e0=_0x4220d7[_0x1cb9('0x2a')][_0x1cb9('0x2c')]('=');var _0x3467d5=_0x56c3e0[0x0][_0x1cb9('0x2d')](_0x56c3e0[0x0][_0x1cb9('0x2e')]('(')+0x1,_0x56c3e0[0x0][_0x1cb9('0x2e')](')'));var _0xc6d5fd=_0x56c3e0[0x1];recordings[_0x4220d7[_0x1cb9('0x10')]][_0x3467d5]=_0xc6d5fd;}}}catch(_0x386e8b){utils[_0x1cb9('0x13')](_0x386e8b[_0x1cb9('0xd')]);}};exports[_0x1cb9('0x2f')]=function(_0x29f149){try{if(!_['isNil'](recordings[_0x29f149['uniqueid']])){recordings[_0x29f149[_0x1cb9('0x10')]][_0x1cb9('0x30')]=_0x29f149[_0x1cb9('0x30')];}}catch(_0x29f451){utils[_0x1cb9('0x13')](_0x29f451[_0x1cb9('0xd')]);}}; \ No newline at end of file +var _0xedd9=['UserId','request','CreateVoiceRecording','uniqueid','linkedid','context','channel','error','stack','isNil','channelstate','varset','variable','endsWith','value','.wav49','.WAV','find','monitors','calleridnum','calleridname','connectedlinenum','connectedlinename','type','outbound','clone','newexten','application','set','startsWith','appdata','cdr','split','substring','lastIndexOf','queuecallerjoin','queue','./utils','debug','accountcode','getUserByInternal','then','name'];(function(_0x2963b5,_0x44209e){var _0x45ae66=function(_0x4a5ec7){while(--_0x4a5ec7){_0x2963b5['push'](_0x2963b5['shift']());}};_0x45ae66(++_0x44209e);}(_0xedd9,0xfc));var _0x9edd=function(_0x573a19,_0x5939b5){_0x573a19=_0x573a19-0x0;var _0x1e4cc4=_0xedd9[_0x573a19];return _0x1e4cc4;};'use strict';var _=require('lodash');var utils=require(_0x9edd('0x0'));var recordings={};function writeDB(_0x2d7989){utils[_0x9edd('0x1')](_0x2d7989);if(_0x2d7989[_0x9edd('0x2')]){utils[_0x9edd('0x3')](_0x2d7989[_0x9edd('0x2')])[_0x9edd('0x4')](function(_0x36b53f){if(_0x36b53f){_0x2d7989['membername']=_0x36b53f[_0x9edd('0x5')];_0x2d7989[_0x9edd('0x6')]=_0x36b53f['id'];}utils[_0x9edd('0x7')](_0x9edd('0x8'),_0x2d7989);});}else{utils['request'](_0x9edd('0x8'),_0x2d7989);}}exports['newchannel']=function(_0x172522){try{if(_0x172522[_0x9edd('0x9')]==_0x172522[_0x9edd('0xa')]){recordings[_0x172522[_0x9edd('0x9')]]={'uniqueid':_0x172522['uniqueid'],'accountcode':_0x172522[_0x9edd('0x2')],'exten':_0x172522['exten'],'context':_0x172522[_0x9edd('0xb')],'channel':_0x172522[_0x9edd('0xc')],'monitors':[]};}}catch(_0x523026){utils[_0x9edd('0xd')](_0x523026[_0x9edd('0xe')]);}};exports['newstate']=function(_0x30c0d7){try{if(!_[_0x9edd('0xf')](recordings[_0x30c0d7[_0x9edd('0x9')]])&&_0x30c0d7[_0x9edd('0x10')]==0x6){}else if(!_[_0x9edd('0xf')](recordings[_0x30c0d7[_0x9edd('0xa')]])&&_0x30c0d7[_0x9edd('0x10')]==0x6&&_0x30c0d7[_0x9edd('0xb')]!='transfer'){recordings[_0x30c0d7[_0x9edd('0xa')]][_0x9edd('0x2')]=_0x30c0d7[_0x9edd('0x2')];}}catch(_0x4d9a7){utils[_0x9edd('0xd')](_0x4d9a7[_0x9edd('0xe')]);}};exports[_0x9edd('0x11')]=function(_0x75a4ab){try{if(!_['isNil'](_0x75a4ab[_0x9edd('0x12')])&&!_[_0x9edd('0xf')](_0x75a4ab[_0x9edd('0x12')]['mixmonitor_filename'])){if(_[_0x9edd('0x13')](_0x75a4ab[_0x9edd('0x14')],_0x9edd('0x15'))){_0x75a4ab['value']=_0x75a4ab[_0x9edd('0x14')]['replace'](_0x9edd('0x15'),_0x9edd('0x16'));}if(recordings[_0x75a4ab['linkedid']]){var _0x498977=_[_0x9edd('0x17')](recordings[_0x75a4ab['linkedid']][_0x9edd('0x18')],{'value':_0x75a4ab['value']});if(_['isNil'](_0x498977)){recordings[_0x75a4ab[_0x9edd('0xa')]][_0x9edd('0x18')]['push']({'value':_0x75a4ab['value']});}}}}catch(_0x341d67){utils[_0x9edd('0xd')](_0x341d67[_0x9edd('0xe')]);}};exports['hangup']=function(_0x3741c8){try{if(!_[_0x9edd('0xf')](recordings[_0x3741c8[_0x9edd('0x9')]])){recordings[_0x3741c8[_0x9edd('0x9')]][_0x9edd('0x19')]=_0x3741c8['calleridnum'];recordings[_0x3741c8[_0x9edd('0x9')]][_0x9edd('0x1a')]=_0x3741c8[_0x9edd('0x1a')];recordings[_0x3741c8[_0x9edd('0x9')]][_0x9edd('0x1b')]=_0x3741c8['connectedlinenum'];recordings[_0x3741c8['uniqueid']][_0x9edd('0x1c')]=_0x3741c8[_0x9edd('0x1c')];if(recordings[_0x3741c8[_0x9edd('0x9')]][_0x9edd('0x1d')]==_0x9edd('0x1e')&&recordings[_0x3741c8['uniqueid']]['accountcode']){recordings[_0x3741c8[_0x9edd('0x9')]][_0x9edd('0x1b')]=recordings[_0x3741c8[_0x9edd('0x9')]]['accountcode'];recordings[_0x3741c8[_0x9edd('0x9')]][_0x9edd('0x1c')]='';}recordings[_0x3741c8[_0x9edd('0x9')]][_0x9edd('0x18')]['forEach'](_0x2155a1=>{var _0x3fb556=_[_0x9edd('0x1f')](recordings[_0x3741c8[_0x9edd('0x9')]]);_0x3fb556[_0x9edd('0x14')]=_0x2155a1[_0x9edd('0x14')];writeDB(_0x3fb556);});delete recordings[_0x3741c8[_0x9edd('0x9')]];}}catch(_0x1fba7b){utils[_0x9edd('0xd')](_0x1fba7b[_0x9edd('0xe')]);}};exports[_0x9edd('0x20')]=function(_0x138002){try{if(!_[_0x9edd('0xf')](recordings[_0x138002[_0x9edd('0x9')]])){if(_0x138002[_0x9edd('0x21')]['toLowerCase']()==_0x9edd('0x22')&&_[_0x9edd('0x23')](_0x138002[_0x9edd('0x24')]['toLowerCase'](),_0x9edd('0x25'))){var _0x3990fb=_0x138002[_0x9edd('0x24')][_0x9edd('0x26')]('=');var _0x21bc30=_0x3990fb[0x0][_0x9edd('0x27')](_0x3990fb[0x0][_0x9edd('0x28')]('(')+0x1,_0x3990fb[0x0][_0x9edd('0x28')](')'));var _0xd0fd74=_0x3990fb[0x1];recordings[_0x138002[_0x9edd('0x9')]][_0x21bc30]=_0xd0fd74;}}}catch(_0x29e789){utils[_0x9edd('0xd')](_0x29e789[_0x9edd('0xe')]);}};exports[_0x9edd('0x29')]=function(_0x5757fc){try{if(!_[_0x9edd('0xf')](recordings[_0x5757fc['uniqueid']])){recordings[_0x5757fc[_0x9edd('0x9')]][_0x9edd('0x2a')]=_0x5757fc[_0x9edd('0x2a')];}}catch(_0x434d26){utils[_0x9edd('0xd')](_0x434d26['stack']);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 4e7c35d..93ee109 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 _0xf15e=['TRANSFER|%s','type','CreateVoiceTransferReport','blindtransfer','error','stack','assign','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','attended','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetcontext','transfertargetexten','lodash','./utils','info','format'];(function(_0x508985,_0x38144e){var _0x1d600b=function(_0x67172){while(--_0x67172){_0x508985['push'](_0x508985['shift']());}};_0x1d600b(++_0x38144e);}(_0xf15e,0xb9));var _0xef15=function(_0x26ae13,_0x1a67ed){_0x26ae13=_0x26ae13-0x0;var _0xbd8843=_0xf15e[_0x26ae13];return _0xbd8843;};'use strict';var _=require(_0xef15('0x0'));var util=require('util');var utils=require(_0xef15('0x1'));function writeDB(_0x43f9b0){utils[_0xef15('0x2')](util[_0xef15('0x3')](_0xef15('0x4'),_0x43f9b0[_0xef15('0x5')]));utils['request'](_0xef15('0x6'),_0x43f9b0);}exports[_0xef15('0x7')]=function(_0x258cb7){try{_0x258cb7[_0xef15('0x5')]='blind';writeDB(_0x258cb7);}catch(_0x2ad584){utils[_0xef15('0x8')](_0x2ad584[_0xef15('0x9')]);}};exports['attendedtransfer']=function(_0x37385f){try{_0x37385f=_[_0xef15('0xa')](_0x37385f,{'transfererchannel':_0x37385f[_0xef15('0xb')],'transferercalleridnum':_0x37385f[_0xef15('0xc')],'transferercalleridname':_0x37385f['origtransferercalleridname'],'transfererconnectedlinenum':_0x37385f[_0xef15('0xd')],'transfererconnectedlinename':_0x37385f[_0xef15('0xe')],'transfereraccountcode':_0x37385f[_0xef15('0xf')],'transferercontext':_0x37385f['secondtransferercontext'],'transfererexten':_0x37385f[_0xef15('0x10')],'transfererlinkedid':_0x37385f[_0xef15('0x11')],'context':_0x37385f[_0xef15('0x12')],'extension':_0x37385f[_0xef15('0x13')],'type':_0xef15('0x14')});if(_['isNil'](_0x37385f['transfereechannel'])){_0x37385f=_[_0xef15('0xa')](_0x37385f,{'transfereechannel':_0x37385f[_0xef15('0x15')],'transfereecalleridnum':_0x37385f[_0xef15('0x16')],'transfereecalleridname':_0x37385f['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x37385f[_0xef15('0x17')],'transfereeconnectedlinename':_0x37385f['transfertargetconnectedlinename'],'transfereeaccountcode':_0x37385f[_0xef15('0x18')],'transfereecontext':_0x37385f[_0xef15('0x19')],'transfereeexten':_0x37385f[_0xef15('0x1a')],'transfereelinkedid':_0x37385f['transfertargetlinkedid']});}writeDB(_0x37385f);}catch(_0xc8d2b2){utils['error'](_0xc8d2b2['stack']);}}; \ No newline at end of file +var _0xaab2=['request','blindtransfer','blind','error','stack','attendedtransfer','assign','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','attended','isNil','transfertargetchannel','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetcontext','transfertargetexten','./utils','info','TRANSFER|%s','type'];(function(_0x31ced5,_0x5d5415){var _0x10d9e5=function(_0x2e51a5){while(--_0x2e51a5){_0x31ced5['push'](_0x31ced5['shift']());}};_0x10d9e5(++_0x5d5415);}(_0xaab2,0x15b));var _0x2aab=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xaab2[_0x4709c0];return _0x13348b;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x2aab('0x0'));function writeDB(_0x246bde){utils[_0x2aab('0x1')](util['format'](_0x2aab('0x2'),_0x246bde[_0x2aab('0x3')]));utils[_0x2aab('0x4')]('CreateVoiceTransferReport',_0x246bde);}exports[_0x2aab('0x5')]=function(_0x26503f){try{_0x26503f[_0x2aab('0x3')]=_0x2aab('0x6');writeDB(_0x26503f);}catch(_0x1c567d){utils[_0x2aab('0x7')](_0x1c567d[_0x2aab('0x8')]);}};exports[_0x2aab('0x9')]=function(_0x22382b){try{_0x22382b=_[_0x2aab('0xa')](_0x22382b,{'transfererchannel':_0x22382b[_0x2aab('0xb')],'transferercalleridnum':_0x22382b[_0x2aab('0xc')],'transferercalleridname':_0x22382b[_0x2aab('0xd')],'transfererconnectedlinenum':_0x22382b['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x22382b[_0x2aab('0xe')],'transfereraccountcode':_0x22382b[_0x2aab('0xf')],'transferercontext':_0x22382b[_0x2aab('0x10')],'transfererexten':_0x22382b[_0x2aab('0x11')],'transfererlinkedid':_0x22382b[_0x2aab('0x12')],'context':_0x22382b[_0x2aab('0x13')],'extension':_0x22382b['origtransfererexten'],'type':_0x2aab('0x14')});if(_[_0x2aab('0x15')](_0x22382b['transfereechannel'])){_0x22382b=_['assign'](_0x22382b,{'transfereechannel':_0x22382b[_0x2aab('0x16')],'transfereecalleridnum':_0x22382b['transfertargetcalleridnum'],'transfereecalleridname':_0x22382b['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x22382b[_0x2aab('0x17')],'transfereeconnectedlinename':_0x22382b['transfertargetconnectedlinename'],'transfereeaccountcode':_0x22382b[_0x2aab('0x18')],'transfereecontext':_0x22382b[_0x2aab('0x19')],'transfereeexten':_0x22382b[_0x2aab('0x1a')],'transfereelinkedid':_0x22382b['transfertargetlinkedid']});}writeDB(_0x22382b);}catch(_0x164fbf){utils['error'](_0x164fbf['stack']);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 5e268a3..c3f4ca9 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 _0xc947=['format','subtractTime','YYYY-MM-DD\x20HH:mm:ss','diffTime','diff','sumTime','now','isAfter','isBefore','jayson/promise','moment','bluebird','client','http','xdr','info','debug','stringify','error','stack','request','catch','internal','name','interface','then','result','length','FOUND','getUserByInternal','getUserByName','getVoiceQueueByName','GetVoiceQueue','type','acw','GETVOICEQUEUEBYNAME|','NOTFOUND','addTime','add','seconds'];(function(_0x185249,_0x1dbbe2){var _0x5ec104=function(_0x936acc){while(--_0x936acc){_0x185249['push'](_0x185249['shift']());}};_0x5ec104(++_0x1dbbe2);}(_0xc947,0xd1));var _0x7c94=function(_0x24e400,_0x1ddd22){_0x24e400=_0x24e400-0x0;var _0x5defef=_0xc947[_0x24e400];return _0x5defef;};'use strict';var jayson=require(_0x7c94('0x0'));var moment=require(_0x7c94('0x1'));var BPromise=require(_0x7c94('0x2'));var client=jayson[_0x7c94('0x3')][_0x7c94('0x4')]({'port':0x2329});var logger=require('../../config/logger')(_0x7c94('0x5'));exports[_0x7c94('0x6')]=function(_0x656bf3){logger[_0x7c94('0x6')](_0x656bf3);};exports[_0x7c94('0x7')]=function(_0x53a32f){logger[_0x7c94('0x7')](JSON[_0x7c94('0x8')](_0x53a32f));};exports[_0x7c94('0x9')]=function(_0xd8e605){logger['error'](_0xd8e605[_0x7c94('0xa')]);};exports[_0x7c94('0xb')]=function(_0x205d56,_0x3518d5){return client[_0x7c94('0xb')](_0x205d56,{'body':_0x3518d5})['then'](function(_0x6bfdb0){logger[_0x7c94('0x7')](JSON['stringify'](_0x6bfdb0));})[_0x7c94('0xc')](function(_0x7a0fc8){logger[_0x7c94('0x9')](_0x7a0fc8[_0x7c94('0xa')]);});};function getUser(_0x2f52d3){return client[_0x7c94('0xb')]('GetUser',{'options':{'raw':!![],'attributes':['id',_0x7c94('0xd'),_0x7c94('0xe'),_0x7c94('0xf')],'where':_0x2f52d3,'limit':0x1}})[_0x7c94('0x10')](function(_0x3e71bb){logger[_0x7c94('0x6')]('GETUSER|'+JSON[_0x7c94('0x8')](_0x2f52d3)+'|'+(_0x3e71bb[_0x7c94('0x11')][_0x7c94('0x12')]?_0x7c94('0x13'):'NOTFOUND'));return _0x3e71bb['result']['length']?_0x3e71bb['result'][0x0]:null;});}exports[_0x7c94('0x14')]=function(_0x4fb8e5){return new BPromise(function(_0x181ad3,_0x58d09a){if(_0x4fb8e5){return getUser({'internal':_0x4fb8e5})[_0x7c94('0x10')](function(_0x8e34f4){return _0x181ad3(_0x8e34f4);})[_0x7c94('0xc')](function(_0x376560){logger[_0x7c94('0x9')](_0x376560[_0x7c94('0xa')]);return _0x181ad3(null);});}else{return _0x181ad3(null);}});};exports['getUserByInterface']=function(_0x1357a6){return new BPromise(function(_0x53d619,_0x412d5f){if(_0x1357a6){return getUser({'interface':_0x1357a6})[_0x7c94('0x10')](function(_0xa1ed72){return _0x53d619(_0xa1ed72);})[_0x7c94('0xc')](function(_0x239f1d){logger[_0x7c94('0x9')](_0x239f1d[_0x7c94('0xa')]);return _0x53d619(null);});}else{return _0x53d619(null);}});};exports[_0x7c94('0x15')]=function(_0x53aa08){return new BPromise(function(_0x23c60f,_0x1a4482){if(_0x53aa08){return getUser({'name':_0x53aa08})[_0x7c94('0x10')](function(_0x11a9af){return _0x23c60f(_0x11a9af);})[_0x7c94('0xc')](function(_0x5090a3){logger['error'](_0x5090a3[_0x7c94('0xa')]);return _0x23c60f(null);});}else{return _0x23c60f(null);}});};exports[_0x7c94('0x16')]=function(_0x3536f9){return new BPromise(function(_0x32da60,_0x4a4fa7){if(_0x3536f9){return client['request'](_0x7c94('0x17'),{'options':{'raw':!![],'attributes':['id',_0x7c94('0xe'),_0x7c94('0x18'),_0x7c94('0x19'),'acwTimeout'],'where':{'name':_0x3536f9},'limit':0x1}})[_0x7c94('0x10')](function(_0x309c02){logger[_0x7c94('0x6')](_0x7c94('0x1a')+_0x3536f9+'|'+(_0x309c02['result']['length']?'FOUND':_0x7c94('0x1b')));return _0x32da60(_0x309c02['result'][_0x7c94('0x12')]?_0x309c02[_0x7c94('0x11')][0x0]:null);})[_0x7c94('0xc')](function(_0x11b1b6){logger[_0x7c94('0x9')](_0x11b1b6['stack']);return _0x32da60(null);});}else{return _0x32da60(null);}});};exports[_0x7c94('0x1c')]=function(_0x41816d,_0x22b999){return moment(_0x41816d)[_0x7c94('0x1d')](_0x22b999,_0x7c94('0x1e'))[_0x7c94('0x1f')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x7c94('0x20')]=function(_0x4e0e35,_0x1c5905){return moment(_0x4e0e35)['subtract'](_0x1c5905,_0x7c94('0x1e'))[_0x7c94('0x1f')](_0x7c94('0x21'));};exports[_0x7c94('0x22')]=function(_0x12a08d,_0x557916){return moment(_0x12a08d)[_0x7c94('0x23')](moment(_0x557916),_0x7c94('0x1e'));};exports[_0x7c94('0x24')]=function(_0x3eead6,_0x3b131b){return parseInt(_0x3eead6,0xa)+parseInt(_0x3b131b,0xa);};exports[_0x7c94('0x25')]=function(){return moment()[_0x7c94('0x1f')](_0x7c94('0x21'));};exports[_0x7c94('0x26')]=function(_0x4ae692,_0x8e65e6){if(_0x8e65e6){return moment(_0x4ae692)[_0x7c94('0x26')](_0x8e65e6);}else{return!![];}};exports['isBefore']=function(_0x153f31,_0x28f247){if(_0x28f247){return moment(_0x153f31)[_0x7c94('0x27')](_0x28f247);}else if(_0x153f31){return!![];}else{return![];}}; \ No newline at end of file +var _0x7def=['stack','request','GetUser','internal','name','interface','GETUSER|','length','NOTFOUND','getUserByInternal','getUserByInterface','catch','getUserByName','getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout','GETVOICEQUEUEBYNAME|','result','FOUND','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtract','sumTime','isAfter','isBefore','jayson/promise','moment','client','http','../../config/logger','xdr','info','stringify','error','then','debug'];(function(_0x465c62,_0xa5f620){var _0x44f071=function(_0x197c4f){while(--_0x197c4f){_0x465c62['push'](_0x465c62['shift']());}};_0x44f071(++_0xa5f620);}(_0x7def,0x12d));var _0xf7de=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x7def[_0x8c43de];return _0xa6591b;};'use strict';var jayson=require(_0xf7de('0x0'));var moment=require(_0xf7de('0x1'));var BPromise=require('bluebird');var client=jayson[_0xf7de('0x2')][_0xf7de('0x3')]({'port':0x2329});var logger=require(_0xf7de('0x4'))(_0xf7de('0x5'));exports['info']=function(_0x46e50b){logger[_0xf7de('0x6')](_0x46e50b);};exports['debug']=function(_0x4633b8){logger['debug'](JSON[_0xf7de('0x7')](_0x4633b8));};exports[_0xf7de('0x8')]=function(_0x3ad27c){logger[_0xf7de('0x8')](_0x3ad27c['stack']);};exports['request']=function(_0x5d0d03,_0x5b65f3){return client['request'](_0x5d0d03,{'body':_0x5b65f3})[_0xf7de('0x9')](function(_0x3b3876){logger[_0xf7de('0xa')](JSON[_0xf7de('0x7')](_0x3b3876));})['catch'](function(_0x457338){logger[_0xf7de('0x8')](_0x457338[_0xf7de('0xb')]);});};function getUser(_0x30f55d){return client[_0xf7de('0xc')](_0xf7de('0xd'),{'options':{'raw':!![],'attributes':['id',_0xf7de('0xe'),_0xf7de('0xf'),_0xf7de('0x10')],'where':_0x30f55d,'limit':0x1}})[_0xf7de('0x9')](function(_0x25ccdb){logger[_0xf7de('0x6')](_0xf7de('0x11')+JSON[_0xf7de('0x7')](_0x30f55d)+'|'+(_0x25ccdb['result'][_0xf7de('0x12')]?'FOUND':_0xf7de('0x13')));return _0x25ccdb['result'][_0xf7de('0x12')]?_0x25ccdb['result'][0x0]:null;});}exports[_0xf7de('0x14')]=function(_0x4d7f9e){return new BPromise(function(_0x3ef664,_0x41d1f6){if(_0x4d7f9e){return getUser({'internal':_0x4d7f9e})[_0xf7de('0x9')](function(_0x4af310){return _0x3ef664(_0x4af310);})['catch'](function(_0x5d879a){logger[_0xf7de('0x8')](_0x5d879a[_0xf7de('0xb')]);return _0x3ef664(null);});}else{return _0x3ef664(null);}});};exports[_0xf7de('0x15')]=function(_0x4df100){return new BPromise(function(_0xaffc94,_0x11505f){if(_0x4df100){return getUser({'interface':_0x4df100})[_0xf7de('0x9')](function(_0x45ab0a){return _0xaffc94(_0x45ab0a);})[_0xf7de('0x16')](function(_0x534c9c){logger[_0xf7de('0x8')](_0x534c9c[_0xf7de('0xb')]);return _0xaffc94(null);});}else{return _0xaffc94(null);}});};exports[_0xf7de('0x17')]=function(_0x3b571f){return new BPromise(function(_0x280535,_0x4f5ae6){if(_0x3b571f){return getUser({'name':_0x3b571f})[_0xf7de('0x9')](function(_0x30cea0){return _0x280535(_0x30cea0);})['catch'](function(_0x15ece2){logger[_0xf7de('0x8')](_0x15ece2['stack']);return _0x280535(null);});}else{return _0x280535(null);}});};exports[_0xf7de('0x18')]=function(_0x14ec63){return new BPromise(function(_0x3f61e9,_0x7b904d){if(_0x14ec63){return client['request'](_0xf7de('0x19'),{'options':{'raw':!![],'attributes':['id',_0xf7de('0xf'),_0xf7de('0x1a'),_0xf7de('0x1b'),_0xf7de('0x1c')],'where':{'name':_0x14ec63},'limit':0x1}})[_0xf7de('0x9')](function(_0x4141c2){logger[_0xf7de('0x6')](_0xf7de('0x1d')+_0x14ec63+'|'+(_0x4141c2[_0xf7de('0x1e')][_0xf7de('0x12')]?_0xf7de('0x1f'):_0xf7de('0x13')));return _0x3f61e9(_0x4141c2[_0xf7de('0x1e')]['length']?_0x4141c2[_0xf7de('0x1e')][0x0]:null);})[_0xf7de('0x16')](function(_0xa68bd7){logger['error'](_0xa68bd7[_0xf7de('0xb')]);return _0x3f61e9(null);});}else{return _0x3f61e9(null);}});};exports['addTime']=function(_0x5dd084,_0x42829c){return moment(_0x5dd084)['add'](_0x42829c,_0xf7de('0x20'))[_0xf7de('0x21')](_0xf7de('0x22'));};exports['subtractTime']=function(_0x38623b,_0x3d1f08){return moment(_0x38623b)[_0xf7de('0x23')](_0x3d1f08,_0xf7de('0x20'))[_0xf7de('0x21')]('YYYY-MM-DD\x20HH:mm:ss');};exports['diffTime']=function(_0x57f72f,_0x228a91){return moment(_0x57f72f)['diff'](moment(_0x228a91),_0xf7de('0x20'));};exports[_0xf7de('0x24')]=function(_0x4e0364,_0x46882d){return parseInt(_0x4e0364,0xa)+parseInt(_0x46882d,0xa);};exports['now']=function(){return moment()['format']('YYYY-MM-DD\x20HH:mm:ss');};exports['isAfter']=function(_0x65c55e,_0x12ebe3){if(_0x12ebe3){return moment(_0x65c55e)[_0xf7de('0x25')](_0x12ebe3);}else{return!![];}};exports[_0xf7de('0x26')]=function(_0x5c7cbf,_0x511b2b){if(_0x511b2b){return moment(_0x5c7cbf)[_0xf7de('0x26')](_0x511b2b);}else if(_0x5c7cbf){return!![];}else{return![];}}; \ No newline at end of file